From 633a2252e0be3c867dce264a180a89ce8181d36f Mon Sep 17 00:00:00 2001 From: Akihiro MOTOKI Date: Sun, 17 Oct 2010 02:20:51 +0900 Subject: [PATCH] (split) Import translated manuals from JM CVS Repository. --- ChangeLog | 12591 +++++++++++++++++++++++ contrib/man7/mdoc.samples.7 | 2852 +++++ draft/man1/intro.1 | 504 + draft/man1/ldd.1 | 130 + draft/man1/time.1 | 489 + draft/man2/_exit.2 | 211 + draft/man2/_syscall.2 | 220 + draft/man2/accept.2 | 693 ++ draft/man2/access.2 | 423 + draft/man2/acct.2 | 231 + draft/man2/adjtimex.2 | 232 + draft/man2/alarm.2 | 140 + draft/man2/alloc_hugepages.2 | 265 + draft/man2/arch_prctl.2 | 237 + draft/man2/bdflush.2 | 183 + draft/man2/bind.2 | 484 + draft/man2/brk.2 | 277 + draft/man2/cacheflush.2 | 141 + draft/man2/capget.2 | 413 + draft/man2/chdir.2 | 211 + draft/man2/chmod.2 | 346 + draft/man2/chown.2 | 502 + draft/man2/chroot.2 | 210 + draft/man2/clock_getres.2 | 382 + draft/man2/clock_nanosleep.2 | 411 + draft/man2/clone.2 | 1831 ++++ draft/man2/close.2 | 218 + draft/man2/connect.2 | 440 + draft/man2/create_module.2 | 97 + draft/man2/delete_module.2 | 88 + draft/man2/dup.2 | 363 + draft/man2/epoll_create.2 | 217 + draft/man2/epoll_ctl.2 | 449 + draft/man2/epoll_wait.2 | 308 + draft/man2/eventfd.2 | 645 ++ draft/man2/execve.2 | 1023 ++ draft/man2/exit_group.2 | 74 + draft/man2/faccessat.2 | 252 + draft/man2/fallocate.2 | 233 + draft/man2/fchmodat.2 | 225 + draft/man2/fchownat.2 | 225 + draft/man2/fcntl.2 | 2222 ++++ draft/man2/flock.2 | 361 + draft/man2/fork.2 | 398 + draft/man2/fstatat.2 | 225 + draft/man2/fsync.2 | 314 + draft/man2/futex.2 | 480 + draft/man2/futimesat.2 | 219 + draft/man2/get_kernel_syms.2 | 130 + draft/man2/get_mempolicy.2 | 448 + draft/man2/get_thread_area.2 | 95 + draft/man2/getcontext.2 | 285 + draft/man2/getdents.2 | 376 + draft/man2/getdomainname.2 | 207 + draft/man2/getdtablesize.2 | 128 + draft/man2/getgid.2 | 67 + draft/man2/getgroups.2 | 268 + draft/man2/gethostname.2 | 303 + draft/man2/getitimer.2 | 390 + draft/man2/getpagesize.2 | 163 + draft/man2/getpeername.2 | 192 + draft/man2/getpid.2 | 155 + draft/man2/getpriority.2 | 395 + draft/man2/getresuid.2 | 121 + draft/man2/getrlimit.2 | 868 ++ draft/man2/getrusage.2 | 291 + draft/man2/getsid.2 | 122 + draft/man2/getsockname.2 | 178 + draft/man2/getsockopt.2 | 344 + draft/man2/gettid.2 | 113 + draft/man2/gettimeofday.2 | 386 + draft/man2/getuid.2 | 93 + draft/man2/getxattr.2 | 258 + draft/man2/idle.2 | 103 + draft/man2/init_module.2 | 150 + draft/man2/inotify_add_watch.2 | 188 + draft/man2/inotify_init.2 | 160 + draft/man2/inotify_rm_watch.2 | 120 + draft/man2/intro.2 | 144 + draft/man2/io_cancel.2 | 155 + draft/man2/io_destroy.2 | 144 + draft/man2/io_getevents.2 | 172 + draft/man2/io_setup.2 | 160 + draft/man2/io_submit.2 | 161 + draft/man2/ioctl.2 | 245 + draft/man2/ioctl_list.2 | 1080 ++ draft/man2/ioperm.2 | 165 + draft/man2/iopl.2 | 162 + draft/man2/ioprio_set.2 | 542 + draft/man2/ipc.2 | 113 + draft/man2/kill.2 | 292 + draft/man2/killpg.2 | 218 + draft/man2/link.2 | 319 + draft/man2/linkat.2 | 258 + draft/man2/listen.2 | 284 + draft/man2/listxattr.2 | 267 + draft/man2/llseek.2 | 142 + draft/man2/lookup_dcookie.2 | 145 + draft/man2/lseek.2 | 247 + draft/man2/madvise.2 | 373 + draft/man2/mbind.2 | 812 ++ draft/man2/mincore.2 | 287 + draft/man2/mkdir.2 | 235 + draft/man2/mkdirat.2 | 190 + draft/man2/mknod.2 | 379 + draft/man2/mknodat.2 | 192 + draft/man2/mlock.2 | 577 ++ draft/man2/mmap.2 | 1118 ++ draft/man2/mmap2.2 | 150 + draft/man2/modify_ldt.2 | 219 + draft/man2/mount.2 | 797 ++ draft/man2/move_pages.2 | 376 + draft/man2/mprotect.2 | 324 + draft/man2/mq_getsetattr.2 | 79 + draft/man2/mremap.2 | 370 + draft/man2/msgctl.2 | 601 ++ draft/man2/msgget.2 | 399 + draft/man2/msgop.2 | 748 ++ draft/man2/msync.2 | 210 + draft/man2/nanosleep.2 | 375 + draft/man2/nfsservctl.2 | 78 + draft/man2/nice.2 | 187 + draft/man2/open.2 | 1529 +++ draft/man2/openat.2 | 269 + draft/man2/outb.2 | 111 + draft/man2/pause.2 | 91 + draft/man2/pciconfig_read.2 | 193 + draft/man2/personality.2 | 112 + draft/man2/pipe.2 | 292 + draft/man2/pivot_root.2 | 281 + draft/man2/poll.2 | 538 + draft/man2/posix_fadvise.2 | 242 + draft/man2/prctl.2 | 758 ++ draft/man2/pread.2 | 174 + draft/man2/ptrace.2 | 973 ++ draft/man2/query_module.2 | 290 + draft/man2/quotactl.2 | 348 + draft/man2/read.2 | 324 + draft/man2/readahead.2 | 153 + draft/man2/readdir.2 | 195 + draft/man2/readlink.2 | 212 + draft/man2/readlinkat.2 | 195 + draft/man2/readv.2 | 385 + draft/man2/reboot.2 | 305 + draft/man2/recv.2 | 844 ++ draft/man2/remap_file_pages.2 | 266 + draft/man2/removexattr.2 | 200 + draft/man2/rename.2 | 438 + draft/man2/renameat.2 | 218 + draft/man2/rmdir.2 | 235 + draft/man2/sched_get_priority_max.2 | 184 + draft/man2/sched_rr_get_interval.2 | 191 + draft/man2/sched_setaffinity.2 | 424 + draft/man2/sched_setparam.2 | 197 + draft/man2/sched_setscheduler.2 | 825 ++ draft/man2/sched_yield.2 | 143 + draft/man2/select.2 | 951 ++ draft/man2/select_tut.2 | 1199 +++ draft/man2/semctl.2 | 894 ++ draft/man2/semget.2 | 509 + draft/man2/semop.2 | 937 ++ draft/man2/send.2 | 734 ++ draft/man2/sendfile.2 | 300 + draft/man2/set_mempolicy.2 | 532 + draft/man2/set_thread_area.2 | 120 + draft/man2/set_tid_address.2 | 166 + draft/man2/seteuid.2 | 197 + draft/man2/setfsgid.2 | 180 + draft/man2/setfsuid.2 | 179 + draft/man2/setgid.2 | 111 + draft/man2/setpgid.2 | 521 + draft/man2/setresuid.2 | 162 + draft/man2/setreuid.2 | 225 + draft/man2/setsid.2 | 145 + draft/man2/setuid.2 | 201 + draft/man2/setup.2 | 122 + draft/man2/setxattr.2 | 279 + draft/man2/sgetmask.2 | 124 + draft/man2/shmctl.2 | 714 ++ draft/man2/shmget.2 | 525 + draft/man2/shmop.2 | 507 + draft/man2/shutdown.2 | 133 + draft/man2/sigaction.2 | 1138 ++ draft/man2/sigaltstack.2 | 380 + draft/man2/signal.2 | 504 + draft/man2/signalfd.2 | 753 ++ draft/man2/sigpending.2 | 134 + draft/man2/sigprocmask.2 | 223 + draft/man2/sigqueue.2 | 256 + draft/man2/sigreturn.2 | 123 + draft/man2/sigsuspend.2 | 175 + draft/man2/sigwaitinfo.2 | 310 + draft/man2/socket.2 | 697 ++ draft/man2/socketcall.2 | 110 + draft/man2/socketpair.2 | 207 + draft/man2/splice.2 | 373 + draft/man2/spu_create.2 | 273 + draft/man2/spu_run.2 | 394 + draft/man2/stat.2 | 1018 ++ draft/man2/statfs.2 | 424 + draft/man2/statvfs.2 | 292 + draft/man2/stime.2 | 100 + draft/man2/swapon.2 | 294 + draft/man2/symlink.2 | 263 + draft/man2/symlinkat.2 | 191 + draft/man2/sync.2 | 110 + draft/man2/sync_file_range.2 | 302 + draft/man2/syscall.2 | 113 + draft/man2/syscalls.2 | 1065 ++ draft/man2/sysctl.2 | 249 + draft/man2/sysfs.2 | 175 + draft/man2/sysinfo.2 | 137 + draft/man2/syslog.2 | 460 + draft/man2/tee.2 | 290 + draft/man2/time.2 | 123 + draft/man2/timerfd_create.2 | 829 ++ draft/man2/times.2 | 356 + draft/man2/tkill.2 | 177 + draft/man2/truncate.2 | 350 + draft/man2/umask.2 | 192 + draft/man2/umount.2 | 282 + draft/man2/uname.2 | 276 + draft/man2/unimplemented.2 | 103 + draft/man2/unlink.2 | 261 + draft/man2/unlinkat.2 | 260 + draft/man2/unshare.2 | 285 + draft/man2/uselib.2 | 172 + draft/man2/ustat.2 | 189 + draft/man2/utime.2 | 290 + draft/man2/vfork.2 | 371 + draft/man2/vhangup.2 | 103 + draft/man2/vm86.2 | 116 + draft/man2/vmsplice.2 | 247 + draft/man2/wait.2 | 1026 ++ draft/man2/wait4.2 | 246 + draft/man2/write.2 | 381 + draft/man3/INFINITY.3 | 147 + draft/man3/MB_CUR_MAX.3 | 63 + draft/man3/MB_LEN_MAX.3 | 70 + draft/man3/__setfpucw.3 | 119 + draft/man3/a64l.3 | 131 + draft/man3/abort.3 | 114 + draft/man3/abs.3 | 173 + draft/man3/acos.3 | 168 + draft/man3/acosh.3 | 169 + draft/man3/addseverity.3 | 129 + draft/man3/adjtime.3 | 228 + 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 | 258 + draft/man3/argz_add.3 | 357 + draft/man3/asin.3 | 164 + draft/man3/asinh.3 | 139 + draft/man3/asprintf.3 | 106 + draft/man3/assert.3 | 118 + draft/man3/assert_perror.3 | 115 + draft/man3/atan.3 | 139 + draft/man3/atan2.3 | 253 + draft/man3/atanh.3 | 223 + draft/man3/atexit.3 | 240 + draft/man3/atof.3 | 89 + draft/man3/atoi.3 | 149 + draft/man3/backtrace.3 | 378 + draft/man3/basename.3 | 284 + draft/man3/bcmp.3 | 101 + draft/man3/bcopy.3 | 102 + draft/man3/bindresvport.3 | 166 + draft/man3/bsd_signal.3 | 163 + draft/man3/bsearch.3 | 154 + draft/man3/bstring.3 | 110 + draft/man3/btowc.3 | 112 + draft/man3/btree.3 | 370 + draft/man3/byteorder.3 | 110 + draft/man3/bzero.3 | 88 + draft/man3/cabs.3 | 63 + draft/man3/cacos.3 | 67 + draft/man3/cacosh.3 | 75 + draft/man3/canonicalize_file_name.3 | 37 + draft/man3/carg.3 | 92 + draft/man3/casin.3 | 67 + draft/man3/casinh.3 | 69 + draft/man3/catan.3 | 65 + draft/man3/catanh.3 | 69 + draft/man3/catgets.3 | 140 + draft/man3/catopen.3 | 340 + draft/man3/cbrt.3 | 121 + draft/man3/ccos.3 | 50 + draft/man3/ccosh.3 | 52 + draft/man3/ceil.3 | 171 + draft/man3/cerf.3 | 66 + draft/man3/cexp.3 | 55 + draft/man3/cexp2.3 | 48 + draft/man3/cfree.3 | 194 + draft/man3/cimag.3 | 63 + draft/man3/clearenv.3 | 158 + draft/man3/clock.3 | 143 + draft/man3/clog.3 | 75 + draft/man3/clog10.3 | 75 + draft/man3/clog2.3 | 73 + draft/man3/closedir.3 | 105 + draft/man3/cmsg.3 | 343 + draft/man3/confstr.3 | 230 + draft/man3/conj.3 | 57 + draft/man3/copysign.3 | 120 + draft/man3/cos.3 | 159 + draft/man3/cosh.3 | 186 + draft/man3/cpow.3 | 55 + draft/man3/cproj.3 | 65 + draft/man3/creal.3 | 63 + draft/man3/crypt.3 | 366 + draft/man3/csin.3 | 50 + draft/man3/csinh.3 | 51 + draft/man3/csqrt.3 | 55 + draft/man3/ctan.3 | 50 + draft/man3/ctanh.3 | 52 + draft/man3/ctermid.3 | 99 + draft/man3/ctime.3 | 618 ++ draft/man3/daemon.3 | 172 + draft/man3/dbopen.3 | 887 ++ draft/man3/des_crypt.3 | 237 + draft/man3/difftime.3 | 104 + draft/man3/dirfd.3 | 143 + draft/man3/div.3 | 140 + draft/man3/dl_iterate_phdr.3 | 309 + draft/man3/dlopen.3 | 885 ++ draft/man3/dprintf.3 | 130 + draft/man3/drand48.3 | 332 + draft/man3/drand48_r.3 | 132 + draft/man3/dysize.3 | 80 + draft/man3/ecvt.3 | 182 + draft/man3/ecvt_r.3 | 136 + draft/man3/encrypt.3 | 239 + draft/man3/end.3 | 153 + draft/man3/envz_add.3 | 223 + draft/man3/erf.3 | 173 + draft/man3/erfc.3 | 185 + draft/man3/err.3 | 232 + draft/man3/errno.3 | 756 ++ draft/man3/error.3 | 215 + draft/man3/ether_aton.3 | 200 + draft/man3/euidaccess.3 | 140 + draft/man3/exec.3 | 359 + draft/man3/exit.3 | 300 + draft/man3/exp.3 | 191 + draft/man3/exp10.3 | 115 + draft/man3/exp2.3 | 131 + draft/man3/expm1.3 | 213 + draft/man3/fabs.3 | 127 + draft/man3/fclose.3 | 165 + draft/man3/fcloseall.3 | 92 + draft/man3/fdim.3 | 120 + draft/man3/fenv.3 | 564 + draft/man3/ferror.3 | 180 + draft/man3/fexecve.3 | 144 + draft/man3/fflush.3 | 181 + draft/man3/ffs.3 | 107 + draft/man3/fgetgrent.3 | 138 + draft/man3/fgetpwent.3 | 152 + draft/man3/fgetwc.3 | 140 + draft/man3/fgetws.3 | 117 + draft/man3/finite.3 | 160 + draft/man3/flockfile.3 | 204 + draft/man3/floor.3 | 156 + draft/man3/fma.3 | 235 + draft/man3/fmax.3 | 87 + draft/man3/fmemopen.3 | 427 + draft/man3/fmin.3 | 87 + draft/man3/fmod.3 | 205 + draft/man3/fmtmsg.3 | 471 + draft/man3/fnmatch.3 | 163 + draft/man3/fopen.3 | 530 + draft/man3/fpathconf.3 | 284 + draft/man3/fpclassify.3 | 181 + draft/man3/fpurge.3 | 122 + draft/man3/fputwc.3 | 136 + draft/man3/fputws.3 | 95 + draft/man3/fread.3 | 117 + draft/man3/frexp.3 | 175 + draft/man3/fseek.3 | 288 + draft/man3/fseeko.3 | 128 + draft/man3/ftime.3 | 151 + draft/man3/ftok.3 | 168 + draft/man3/fts.3 | 1368 +++ draft/man3/ftw.3 | 686 ++ draft/man3/futimes.3 | 150 + draft/man3/fwide.3 | 142 + draft/man3/gamma.3 | 171 + draft/man3/gcvt.3 | 109 + draft/man3/getaddrinfo.3 | 1293 +++ draft/man3/getcwd.3 | 411 + draft/man3/getdate.3 | 426 + draft/man3/getdirentries.3 | 111 + draft/man3/getenv.3 | 124 + draft/man3/getfsent.3 | 212 + draft/man3/getgrent.3 | 212 + draft/man3/getgrent_r.3 | 264 + draft/man3/getgrnam.3 | 371 + draft/man3/getgrouplist.3 | 281 + draft/man3/gethostbyname.3 | 737 ++ draft/man3/gethostid.3 | 197 + draft/man3/getipnodebyname.3 | 438 + draft/man3/getline.3 | 263 + draft/man3/getloadavg.3 | 102 + draft/man3/getlogin.3 | 319 + draft/man3/getmntent.3 | 303 + draft/man3/getnameinfo.3 | 459 + draft/man3/getnetent.3 | 201 + draft/man3/getopt.3 | 800 ++ draft/man3/getpass.3 | 231 + draft/man3/getprotoent.3 | 178 + draft/man3/getpt.3 | 95 + draft/man3/getpw.3 | 150 + draft/man3/getpwent.3 | 226 + draft/man3/getpwent_r.3 | 263 + draft/man3/getpwnam.3 | 474 + draft/man3/getrpcent.3 | 158 + draft/man3/getrpcport.3 | 65 + draft/man3/gets.3 | 306 + draft/man3/getservent.3 | 195 + draft/man3/getspnam.3 | 406 + draft/man3/getsubopt.3 | 301 + draft/man3/getttyent.3 | 131 + draft/man3/getumask.3 | 82 + draft/man3/getusershell.3 | 115 + draft/man3/getutent.3 | 438 + draft/man3/getw.3 | 102 + draft/man3/getwchar.3 | 102 + draft/man3/glob.3 | 528 + draft/man3/gnu_get_libc_version.3 | 100 + draft/man3/grantpt.3 | 119 + draft/man3/gsignal.3 | 170 + draft/man3/hash.3 | 243 + draft/man3/hsearch.3 | 552 + draft/man3/hypot.3 | 235 + draft/man3/iconv.3 | 219 + draft/man3/iconv_close.3 | 70 + draft/man3/iconv_open.3 | 154 + draft/man3/ilogb.3 | 192 + draft/man3/index.3 | 115 + draft/man3/inet.3 | 463 + draft/man3/inet_ntop.3 | 213 + draft/man3/inet_pton.3 | 348 + draft/man3/infnan.3 | 109 + draft/man3/initgroups.3 | 121 + draft/man3/insque.3 | 120 + draft/man3/intro.3 | 156 + draft/man3/isalpha.3 | 293 + draft/man3/isatty.3 | 95 + draft/man3/isgreater.3 | 146 + draft/man3/iswalnum.3 | 111 + draft/man3/iswalpha.3 | 116 + draft/man3/iswblank.3 | 110 + draft/man3/iswcntrl.3 | 87 + draft/man3/iswctype.3 | 100 + draft/man3/iswdigit.3 | 116 + draft/man3/iswgraph.3 | 105 + draft/man3/iswlower.3 | 129 + draft/man3/iswprint.3 | 81 + draft/man3/iswpunct.3 | 109 + draft/man3/iswspace.3 | 94 + draft/man3/iswupper.3 | 119 + draft/man3/iswxdigit.3 | 105 + draft/man3/j0.3 | 219 + draft/man3/key_setsecret.3 | 110 + draft/man3/ldexp.3 | 202 + draft/man3/lgamma.3 | 259 + draft/man3/localeconv.3 | 97 + draft/man3/lockf.3 | 280 + draft/man3/log.3 | 205 + draft/man3/log10.3 | 126 + draft/man3/log1p.3 | 188 + draft/man3/log2.3 | 131 + draft/man3/logb.3 | 208 + draft/man3/login.3 | 220 + draft/man3/longjmp.3 | 215 + draft/man3/lrint.3 | 158 + draft/man3/lround.3 | 165 + draft/man3/lsearch.3 | 130 + draft/man3/lseek64.3 | 241 + draft/man3/makecontext.3 | 332 + draft/man3/malloc.3 | 484 + draft/man3/malloc_hook.3 | 195 + draft/man3/mblen.3 | 132 + draft/man3/mbrlen.3 | 127 + draft/man3/mbrtowc.3 | 182 + draft/man3/mbsinit.3 | 136 + draft/man3/mbsnrtowcs.3 | 168 + draft/man3/mbsrtowcs.3 | 153 + draft/man3/mbstowcs.3 | 130 + draft/man3/mbtowc.3 | 150 + draft/man3/memccpy.3 | 81 + draft/man3/memchr.3 | 213 + draft/man3/memcmp.3 | 84 + draft/man3/memcpy.3 | 80 + draft/man3/memfrob.3 | 88 + draft/man3/memmem.3 | 99 + draft/man3/memmove.3 | 92 + draft/man3/mempcpy.3 | 113 + draft/man3/memset.3 | 55 + draft/man3/mkdtemp.3 | 126 + draft/man3/mkfifo.3 | 168 + draft/man3/mkfifoat.3 | 196 + draft/man3/mkstemp.3 | 243 + draft/man3/mktemp.3 | 160 + draft/man3/modf.3 | 125 + draft/man3/mpool.3 | 369 + draft/man3/mq_close.3 | 106 + draft/man3/mq_getattr.3 | 257 + draft/man3/mq_notify.3 | 429 + draft/man3/mq_open.3 | 386 + draft/man3/mq_receive.3 | 262 + draft/man3/mq_send.3 | 269 + draft/man3/mq_unlink.3 | 102 + draft/man3/mtrace.3 | 81 + draft/man3/nan.3 | 122 + draft/man3/netlink.3 | 139 + draft/man3/nextafter.3 | 244 + draft/man3/nl_langinfo.3 | 186 + draft/man3/offsetof.3 | 136 + draft/man3/on_exit.3 | 124 + draft/man3/opendir.3 | 204 + draft/man3/openpty.3 | 299 + draft/man3/perror.3 | 230 + draft/man3/popen.3 | 340 + draft/man3/posix_fallocate.3 | 190 + draft/man3/posix_memalign.3 | 388 + draft/man3/posix_openpt.3 | 148 + draft/man3/pow.3 | 552 + draft/man3/pow10.3 | 75 + draft/man3/printf.3 | 1848 ++++ draft/man3/profil.3 | 143 + draft/man3/program_invocation_name.3 | 96 + draft/man3/psignal.3 | 95 + draft/man3/ptsname.3 | 169 + draft/man3/putenv.3 | 176 + draft/man3/putgrent.3 | 71 + draft/man3/putpwent.3 | 100 + draft/man3/puts.3 | 201 + draft/man3/putwchar.3 | 103 + draft/man3/qecvt.3 | 120 + draft/man3/qsort.3 | 166 + draft/man3/queue.3 | 746 ++ draft/man3/raise.3 | 90 + draft/man3/rand.3 | 260 + draft/man3/random.3 | 271 + draft/man3/random_r.3 | 197 + draft/man3/rcmd.3 | 232 + draft/man3/re_comp.3 | 85 + draft/man3/readdir.3 | 408 + draft/man3/realpath.3 | 360 + draft/man3/recno.3 | 354 + draft/man3/regex.3 | 505 + draft/man3/remainder.3 | 310 + draft/man3/remove.3 | 140 + draft/man3/remquo.3 | 193 + draft/man3/resolver.3 | 417 + draft/man3/rewinddir.3 | 74 + draft/man3/rexec.3 | 203 + draft/man3/rint.3 | 187 + draft/man3/round.3 | 167 + draft/man3/rpc.3 | 1779 ++++ draft/man3/rpmatch.3 | 209 + draft/man3/rtime.3 | 187 + draft/man3/rtnetlink.3 | 173 + draft/man3/scalb.3 | 297 + draft/man3/scandir.3 | 269 + draft/man3/scanf.3 | 1258 +++ draft/man3/sched_getcpu.3 | 117 + draft/man3/seekdir.3 | 121 + draft/man3/sem_close.3 | 95 + draft/man3/sem_destroy.3 | 117 + draft/man3/sem_getvalue.3 | 112 + draft/man3/sem_init.3 | 165 + draft/man3/sem_open.3 | 289 + draft/man3/sem_post.3 | 108 + draft/man3/sem_unlink.3 | 99 + draft/man3/sem_wait.3 | 375 + draft/man3/setaliasent.3 | 220 + draft/man3/setbuf.3 | 312 + draft/man3/setenv.3 | 205 + draft/man3/setjmp.3 | 204 + draft/man3/setlocale.3 | 329 + draft/man3/setlogmask.3 | 119 + draft/man3/setnetgrent.3 | 171 + draft/man3/shm_open.3 | 477 + draft/man3/siginterrupt.3 | 132 + draft/man3/signbit.3 | 96 + draft/man3/significand.3 | 79 + draft/man3/sigpause.3 | 183 + draft/man3/sigset.3 | 452 + draft/man3/sigsetops.3 | 270 + draft/man3/sigvec.3 | 431 + draft/man3/sigwait.3 | 142 + draft/man3/sin.3 | 160 + draft/man3/sincos.3 | 130 + draft/man3/sinh.3 | 182 + draft/man3/sleep.3 | 94 + draft/man3/sockatmark.3 | 196 + draft/man3/sqrt.3 | 153 + draft/man3/stdarg.3 | 457 + draft/man3/stdin.3 | 273 + draft/man3/stdio.3 | 435 + draft/man3/stdio_ext.3 | 192 + draft/man3/stpcpy.3 | 121 + draft/man3/stpncpy.3 | 78 + draft/man3/strcasecmp.3 | 96 + draft/man3/strcat.3 | 150 + draft/man3/strchr.3 | 150 + draft/man3/strcmp.3 | 101 + draft/man3/strcoll.3 | 99 + draft/man3/strcpy.3 | 211 + draft/man3/strdup.3 | 140 + draft/man3/strerror.3 | 302 + draft/man3/strfmon.3 | 279 + draft/man3/strfry.3 | 80 + draft/man3/strftime.3 | 834 ++ draft/man3/string.3 | 130 + draft/man3/strlen.3 | 55 + draft/man3/strnlen.3 | 67 + draft/man3/strpbrk.3 | 82 + draft/man3/strptime.3 | 657 ++ draft/man3/strsep.3 | 141 + draft/man3/strsignal.3 | 89 + draft/man3/strspn.3 | 72 + draft/man3/strstr.3 | 119 + draft/man3/strtod.3 | 276 + draft/man3/strtoimax.3 | 98 + draft/man3/strtok.3 | 293 + draft/man3/strtol.3 | 389 + draft/man3/strtoul.3 | 302 + draft/man3/strverscmp.3 | 157 + draft/man3/strxfrm.3 | 113 + draft/man3/swab.3 | 68 + draft/man3/sysconf.3 | 542 + draft/man3/syslog.3 | 531 + draft/man3/system.3 | 265 + draft/man3/sysv_signal.3 | 149 + draft/man3/tan.3 | 182 + draft/man3/tanh.3 | 136 + draft/man3/tcgetpgrp.3 | 204 + draft/man3/tcgetsid.3 | 115 + draft/man3/telldir.3 | 118 + draft/man3/tempnam.3 | 296 + draft/man3/termios.3 | 1570 +++ draft/man3/tgamma.3 | 298 + draft/man3/timegm.3 | 139 + draft/man3/timeradd.3 | 247 + draft/man3/tmpfile.3 | 131 + draft/man3/tmpnam.3 | 266 + draft/man3/toascii.3 | 79 + draft/man3/toupper.3 | 84 + draft/man3/towctrans.3 | 80 + draft/man3/towlower.3 | 82 + draft/man3/towupper.3 | 81 + draft/man3/trunc.3 | 113 + draft/man3/tsearch.3 | 382 + draft/man3/ttyname.3 | 109 + draft/man3/ttyslot.3 | 257 + draft/man3/tzset.3 | 383 + draft/man3/ualarm.3 | 193 + draft/man3/ulimit.3 | 130 + draft/man3/undocumented.3 | 211 + draft/man3/ungetwc.3 | 98 + draft/man3/unlocked_stdio.3 | 162 + draft/man3/unlockpt.3 | 88 + draft/man3/updwtmp.3 | 125 + draft/man3/usleep.3 | 195 + draft/man3/wcpcpy.3 | 71 + draft/man3/wcpncpy.3 | 87 + draft/man3/wcrtomb.3 | 131 + draft/man3/wcscasecmp.3 | 91 + draft/man3/wcscat.3 | 69 + draft/man3/wcschr.3 | 65 + draft/man3/wcscmp.3 | 71 + draft/man3/wcscpy.3 | 71 + draft/man3/wcscspn.3 | 79 + draft/man3/wcsdup.3 | 90 + draft/man3/wcslen.3 | 59 + draft/man3/wcsncasecmp.3 | 96 + draft/man3/wcsncat.3 | 67 + draft/man3/wcsncmp.3 | 77 + draft/man3/wcsncpy.3 | 80 + draft/man3/wcsnlen.3 | 75 + draft/man3/wcsnrtombs.3 | 170 + draft/man3/wcspbrk.3 | 67 + draft/man3/wcsrchr.3 | 62 + draft/man3/wcsrtombs.3 | 160 + draft/man3/wcsspn.3 | 77 + draft/man3/wcsstr.3 | 71 + draft/man3/wcstoimax.3 | 77 + draft/man3/wcstok.3 | 126 + draft/man3/wcstombs.3 | 130 + draft/man3/wcswidth.3 | 72 + draft/man3/wctob.3 | 93 + draft/man3/wctomb.3 | 124 + draft/man3/wctrans.3 | 97 + draft/man3/wctype.3 | 120 + draft/man3/wcwidth.3 | 82 + draft/man3/wmemchr.3 | 62 + draft/man3/wmemcmp.3 | 74 + draft/man3/wmemcpy.3 | 72 + draft/man3/wmemmove.3 | 65 + draft/man3/wmemset.3 | 56 + draft/man3/wordexp.3 | 347 + draft/man3/wprintf.3 | 371 + draft/man3/xcrypt.3 | 125 + draft/man3/xdr.3 | 897 ++ draft/man3/y0.3 | 356 + draft/man4/console.4 | 159 + draft/man4/console_codes.4 | 822 ++ draft/man4/console_ioctl.4 | 941 ++ draft/man4/dsp56k.4 | 188 + draft/man4/fd.4 | 337 + draft/man4/full.4 | 81 + draft/man4/hd.4 | 161 + draft/man4/initrd.4 | 857 ++ draft/man4/intro.4 | 62 + draft/man4/lp.4 | 223 + draft/man4/mem.4 | 105 + draft/man4/mouse.4 | 233 + draft/man4/null.4 | 81 + draft/man4/pts.4 | 140 + draft/man4/ram.4 | 57 + draft/man4/random.4 | 381 + draft/man4/rtc.4 | 569 + draft/man4/sd.4 | 227 + draft/man4/sk98lin.4 | 1005 ++ draft/man4/st.4 | 1608 +++ draft/man4/tty.4 | 121 + draft/man4/ttyS.4 | 65 + draft/man4/tty_ioctl.4 | 816 ++ draft/man4/vcs.4 | 229 + draft/man4/wavelan.4 | 245 + draft/man5/acct.5 | 250 + draft/man5/charmap.5 | 200 + draft/man5/core.5 | 593 ++ draft/man5/dir_colors.5 | 632 ++ draft/man5/elf.5 | 2879 ++++++ draft/man5/filesystems.5 | 322 + draft/man5/ftpusers.5 | 81 + draft/man5/group.5 | 85 + draft/man5/host.conf.5 | 360 + draft/man5/hosts.5 | 198 + draft/man5/hosts.equiv.5 | 121 + draft/man5/intro.5 | 52 + draft/man5/issue.5 | 60 + draft/man5/locale.5 | 1064 ++ draft/man5/motd.5 | 57 + draft/man5/nologin.5 | 54 + draft/man5/nscd.conf.5 | 271 + draft/man5/nsswitch.conf.5 | 426 + draft/man5/passwd.5 | 234 + draft/man5/proc.5 | 4334 ++++++++ draft/man5/protocols.5 | 117 + draft/man5/resolv.conf.5 | 458 + draft/man5/rpc.5 | 102 + draft/man5/securetty.5 | 64 + draft/man5/services.5 | 340 + draft/man5/shells.5 | 81 + draft/man5/slabinfo.5 | 191 + draft/man5/termcap.5 | 882 ++ draft/man5/ttytype.5 | 93 + draft/man5/tzfile.5 | 234 + draft/man5/utmp.5 | 562 + draft/man6/intro.6 | 50 + draft/man7/arp.7 | 561 + draft/man7/ascii.7 | 263 + draft/man7/boot.7 | 382 + draft/man7/bootparam.7 | 2267 ++++ draft/man7/capabilities.7 | 1598 +++ draft/man7/charsets.7 | 657 ++ draft/man7/complex.7 | 88 + draft/man7/credentials.7 | 484 + draft/man7/ddp.7 | 402 + draft/man7/environ.7 | 420 + draft/man7/epoll.7 | 949 ++ draft/man7/feature_test_macros.7 | 913 ++ draft/man7/fifo.7 | 116 + draft/man7/futex.7 | 214 + draft/man7/glob.7 | 353 + draft/man7/hier.7 | 795 ++ draft/man7/icmp.7 | 332 + draft/man7/inotify.7 | 698 ++ draft/man7/intro.7 | 56 + draft/man7/ip.7 | 1832 ++++ draft/man7/ipv6.7 | 592 ++ draft/man7/iso_8859-1.7 | 191 + draft/man7/iso_8859-15.7 | 227 + draft/man7/iso_8859-16.7 | 221 + draft/man7/iso_8859-2.7 | 230 + draft/man7/iso_8859-7.7 | 204 + draft/man7/iso_8859-9.7 | 202 + draft/man7/koi8-r.7 | 232 + draft/man7/locale.7 | 361 + draft/man7/mailaddr.7 | 183 + draft/man7/man-pages.7 | 948 ++ draft/man7/man.7 | 903 ++ draft/man7/math_error.7 | 440 + draft/man7/mdoc.7 | 711 ++ draft/man7/mq_overview.7 | 512 + draft/man7/netdevice.7 | 455 + draft/man7/netlink.7 | 746 ++ draft/man7/operator.7 | 87 + draft/man7/packet.7 | 715 ++ draft/man7/path_resolution.7 | 415 + draft/man7/pipe.7 | 443 + draft/man7/posixoptions.7 | 1084 ++ draft/man7/pthreads.7 | 1252 +++ draft/man7/pty.7 | 273 + draft/man7/raw.7 | 512 + draft/man7/regex.7 | 523 + draft/man7/rtnetlink.7 | 731 ++ draft/man7/sem_overview.7 | 281 + draft/man7/shm_overview.7 | 200 + draft/man7/signal.7 | 1400 +++ draft/man7/socket.7 | 1348 +++ draft/man7/spufs.7 | 829 ++ draft/man7/standards.7 | 449 + draft/man7/suffixes.7 | 526 + draft/man7/svipc.7 | 516 + draft/man7/tcp.7 | 1988 ++++ draft/man7/termio.7 | 95 + draft/man7/time.7 | 337 + draft/man7/udp.7 | 442 + draft/man7/udplite.7 | 239 + draft/man7/unicode.7 | 540 + draft/man7/units.7 | 206 + draft/man7/unix.7 | 674 ++ draft/man7/uri.7 | 1163 +++ draft/man7/utf-8.7 | 495 + draft/man7/x25.7 | 206 + draft/man8/intro.8 | 67 + draft/man8/ld.so.8 | 671 ++ draft/man8/ldconfig.8 | 279 + draft/man8/nscd.8 | 153 + draft/man8/sync.8 | 156 + draft/man8/tzselect.8 | 83 + draft/man8/zdump.8 | 71 + draft/man8/zic.8 | 658 ++ obsolete/man1/chgrp.1 | 91 + obsolete/man1/dircolors.1 | 131 + obsolete/man1/intro.1 | 41 + obsolete/man1/touch.1 | 175 + obsolete/man2/fdatasync.2 | 185 + obsolete/man2/gethostid.2 | 153 + obsolete/man2/mlockall.2 | 275 + obsolete/man2/munlock.2 | 164 + obsolete/man2/munlockall.2 | 80 + obsolete/man2/obsolete.2 | 74 + obsolete/man2/setregid.2 | 110 + obsolete/man2/sigblock.2 | 161 + obsolete/man2/sigpause.2 | 141 + obsolete/man2/sigvec.2 | 76 + obsolete/man2/sstk.2 | 67 + obsolete/man2/undocumented.2 | 35 + obsolete/man3/atol.3 | 60 + obsolete/man3/isinf.3 | 82 + obsolete/man3/killpg.3 | 112 + obsolete/man3/labs.3 | 55 + obsolete/man3/mblen.3 | 59 + obsolete/man3/mbstowcs.3 | 52 + obsolete/man3/mbtowc.3 | 53 + obsolete/man3/readv.3 | 113 + obsolete/man3/snprintf.3 | 135 + obsolete/man3/wcstombs.3 | 53 + obsolete/man3/wctomb.3 | 53 + obsolete/man5/lilo.conf.5 | 456 + obsolete/man7/LDP.7 | 138 + obsolete/man8/lilo.8 | 190 + obsolete/man9/ksoftirqd.9 | 70 + obsolete_list | 37 + original/man-pages.lsm | 14 + original/man1/intro.1 | 301 + original/man1/ldd.1 | 77 + original/man1/time.1 | 305 + original/man2/_Exit.2 | 1 + original/man2/__clone2.2 | 1 + original/man2/_exit.2 | 128 + original/man2/_llseek.2 | 1 + original/man2/_newselect.2 | 1 + original/man2/_syscall.2 | 166 + original/man2/_sysctl.2 | 1 + original/man2/accept.2 | 385 + original/man2/accept4.2 | 1 + original/man2/access.2 | 240 + original/man2/acct.2 | 144 + original/man2/add_key.2 | 137 + original/man2/adjtimex.2 | 153 + original/man2/afs_syscall.2 | 1 + original/man2/alarm.2 | 89 + original/man2/alloc_hugepages.2 | 149 + original/man2/arch_prctl.2 | 143 + original/man2/bdflush.2 | 113 + original/man2/bind.2 | 329 + original/man2/break.2 | 1 + original/man2/brk.2 | 154 + original/man2/cacheflush.2 | 87 + original/man2/capget.2 | 224 + original/man2/capset.2 | 1 + original/man2/chdir.2 | 138 + original/man2/chmod.2 | 217 + original/man2/chown.2 | 313 + original/man2/chown32.2 | 1 + original/man2/chroot.2 | 130 + original/man2/clock_getres.2 | 235 + original/man2/clock_gettime.2 | 1 + original/man2/clock_nanosleep.2 | 249 + original/man2/clock_settime.2 | 1 + original/man2/clone.2 | 1021 ++ original/man2/clone2.2 | 1 + original/man2/close.2 | 131 + original/man2/connect.2 | 267 + original/man2/creat.2 | 1 + original/man2/create_module.2 | 62 + original/man2/delete_module.2 | 57 + original/man2/dup.2 | 209 + original/man2/dup2.2 | 1 + original/man2/dup3.2 | 1 + original/man2/epoll_create.2 | 128 + original/man2/epoll_create1.2 | 1 + original/man2/epoll_ctl.2 | 251 + original/man2/epoll_pwait.2 | 1 + original/man2/epoll_wait.2 | 188 + original/man2/eventfd.2 | 398 + original/man2/eventfd2.2 | 1 + original/man2/execve.2 | 630 ++ original/man2/exit.2 | 1 + original/man2/exit_group.2 | 48 + original/man2/faccessat.2 | 154 + original/man2/fadvise64.2 | 1 + original/man2/fadvise64_64.2 | 1 + original/man2/fallocate.2 | 136 + original/man2/fchdir.2 | 1 + original/man2/fchmod.2 | 1 + original/man2/fchmodat.2 | 142 + original/man2/fchown.2 | 1 + original/man2/fchown32.2 | 1 + original/man2/fchownat.2 | 141 + original/man2/fcntl.2 | 1223 +++ original/man2/fcntl64.2 | 1 + original/man2/fdatasync.2 | 1 + original/man2/fgetxattr.2 | 1 + original/man2/flistxattr.2 | 1 + original/man2/flock.2 | 212 + original/man2/fork.2 | 226 + original/man2/free_hugepages.2 | 1 + original/man2/fremovexattr.2 | 1 + original/man2/fsetxattr.2 | 1 + original/man2/fstat.2 | 1 + original/man2/fstat64.2 | 1 + original/man2/fstatat.2 | 141 + original/man2/fstatat64.2 | 1 + original/man2/fstatfs.2 | 1 + original/man2/fstatfs64.2 | 1 + original/man2/fstatvfs.2 | 1 + original/man2/fsync.2 | 189 + original/man2/ftruncate.2 | 1 + original/man2/ftruncate64.2 | 1 + original/man2/futex.2 | 269 + original/man2/futimesat.2 | 136 + original/man2/get_kernel_syms.2 | 79 + original/man2/get_mempolicy.2 | 244 + original/man2/get_thread_area.2 | 51 + original/man2/getcontext.2 | 164 + original/man2/getcpu.2 | 125 + original/man2/getcwd.2 | 1 + original/man2/getdents.2 | 260 + original/man2/getdents64.2 | 1 + original/man2/getdomainname.2 | 128 + original/man2/getdtablesize.2 | 79 + original/man2/getegid.2 | 1 + original/man2/getegid32.2 | 1 + original/man2/geteuid.2 | 1 + original/man2/geteuid32.2 | 1 + original/man2/getgid.2 | 50 + original/man2/getgid32.2 | 1 + original/man2/getgroups.2 | 167 + original/man2/getgroups32.2 | 1 + original/man2/gethostid.2 | 1 + original/man2/gethostname.2 | 170 + original/man2/getitimer.2 | 225 + original/man2/getpagesize.2 | 103 + original/man2/getpeername.2 | 120 + original/man2/getpgid.2 | 1 + original/man2/getpgrp.2 | 1 + original/man2/getpid.2 | 107 + original/man2/getpmsg.2 | 1 + original/man2/getppid.2 | 1 + original/man2/getpriority.2 | 230 + original/man2/getresgid.2 | 1 + original/man2/getresgid32.2 | 1 + original/man2/getresuid.2 | 75 + original/man2/getresuid32.2 | 1 + original/man2/getrlimit.2 | 487 + original/man2/getrusage.2 | 172 + original/man2/getsid.2 | 77 + original/man2/getsockname.2 | 116 + original/man2/getsockopt.2 | 207 + original/man2/gettid.2 | 71 + original/man2/gettimeofday.2 | 240 + original/man2/getuid.2 | 61 + original/man2/getuid32.2 | 1 + original/man2/getxattr.2 | 152 + original/man2/gtty.2 | 1 + original/man2/idle.2 | 63 + original/man2/inb.2 | 1 + original/man2/inb_p.2 | 1 + original/man2/init_module.2 | 102 + original/man2/inl.2 | 1 + original/man2/inl_p.2 | 1 + original/man2/inotify_add_watch.2 | 117 + original/man2/inotify_init.2 | 101 + original/man2/inotify_init1.2 | 1 + original/man2/inotify_rm_watch.2 | 76 + original/man2/insb.2 | 1 + original/man2/insl.2 | 1 + original/man2/insw.2 | 1 + original/man2/intro.2 | 89 + original/man2/inw.2 | 1 + original/man2/inw_p.2 | 1 + original/man2/io_cancel.2 | 105 + original/man2/io_destroy.2 | 99 + original/man2/io_getevents.2 | 114 + original/man2/io_setup.2 | 106 + original/man2/io_submit.2 | 108 + original/man2/ioctl.2 | 145 + original/man2/ioctl_list.2 | 867 ++ original/man2/ioperm.2 | 110 + original/man2/iopl.2 | 100 + original/man2/ioprio_get.2 | 1 + original/man2/ioprio_set.2 | 322 + original/man2/ipc.2 | 70 + original/man2/keyctl.2 | 166 + original/man2/kill.2 | 179 + original/man2/killpg.2 | 134 + original/man2/lchown.2 | 1 + original/man2/lchown32.2 | 1 + original/man2/lgetxattr.2 | 1 + original/man2/link.2 | 186 + original/man2/linkat.2 | 152 + original/man2/listen.2 | 172 + original/man2/listxattr.2 | 164 + original/man2/llistxattr.2 | 1 + original/man2/llseek.2 | 84 + original/man2/lock.2 | 1 + original/man2/lookup_dcookie.2 | 88 + original/man2/lremovexattr.2 | 1 + original/man2/lseek.2 | 165 + original/man2/lsetxattr.2 | 1 + original/man2/lstat.2 | 1 + original/man2/lstat64.2 | 1 + original/man2/madvise.2 | 238 + original/man2/madvise1.2 | 1 + original/man2/mbind.2 | 447 + original/man2/mincore.2 | 168 + original/man2/mkdir.2 | 135 + original/man2/mkdirat.2 | 119 + original/man2/mknod.2 | 212 + original/man2/mknodat.2 | 121 + original/man2/mlock.2 | 329 + original/man2/mlockall.2 | 1 + original/man2/mmap.2 | 656 ++ original/man2/mmap2.2 | 93 + original/man2/modify_ldt.2 | 135 + original/man2/mount.2 | 450 + original/man2/move_pages.2 | 226 + original/man2/mprotect.2 | 222 + original/man2/mpx.2 | 1 + original/man2/mq_getsetattr.2 | 55 + original/man2/mq_notify.2 | 1 + original/man2/mq_open.2 | 1 + original/man2/mq_timedreceive.2 | 1 + original/man2/mq_timedsend.2 | 1 + original/man2/mq_unlink.2 | 1 + original/man2/mremap.2 | 209 + original/man2/msgctl.2 | 343 + original/man2/msgget.2 | 222 + original/man2/msgop.2 | 436 + original/man2/msgrcv.2 | 1 + original/man2/msgsnd.2 | 1 + original/man2/msync.2 | 121 + original/man2/munlock.2 | 1 + original/man2/munlockall.2 | 1 + original/man2/munmap.2 | 1 + original/man2/nanosleep.2 | 212 + original/man2/nfsservctl.2 | 54 + original/man2/nice.2 | 111 + original/man2/oldfstat.2 | 1 + original/man2/oldlstat.2 | 1 + original/man2/oldolduname.2 | 1 + original/man2/oldstat.2 | 1 + original/man2/olduname.2 | 1 + original/man2/open.2 | 850 ++ original/man2/openat.2 | 172 + original/man2/outb.2 | 69 + original/man2/outb_p.2 | 1 + original/man2/outl.2 | 1 + original/man2/outl_p.2 | 1 + original/man2/outsb.2 | 1 + original/man2/outsl.2 | 1 + original/man2/outsw.2 | 1 + original/man2/outw.2 | 1 + original/man2/outw_p.2 | 1 + original/man2/path_resolution.2 | 2 + original/man2/pause.2 | 63 + original/man2/pciconfig_iobase.2 | 1 + original/man2/pciconfig_read.2 | 110 + original/man2/pciconfig_write.2 | 1 + original/man2/personality.2 | 69 + original/man2/pipe.2 | 195 + original/man2/pipe2.2 | 1 + original/man2/pivot_root.2 | 142 + original/man2/poll.2 | 331 + original/man2/posix_fadvise.2 | 147 + original/man2/ppoll.2 | 1 + original/man2/prctl.2 | 420 + original/man2/pread.2 | 104 + original/man2/pread64.2 | 1 + original/man2/prof.2 | 1 + original/man2/pselect.2 | 1 + original/man2/pselect6.2 | 1 + original/man2/ptrace.2 | 536 + original/man2/putpmsg.2 | 1 + original/man2/pwrite.2 | 1 + original/man2/pwrite64.2 | 1 + original/man2/query_module.2 | 177 + original/man2/quotactl.2 | 243 + original/man2/read.2 | 190 + original/man2/readahead.2 | 97 + original/man2/readdir.2 | 119 + original/man2/readlink.2 | 136 + original/man2/readlinkat.2 | 122 + original/man2/readv.2 | 220 + original/man2/reboot.2 | 180 + original/man2/recv.2 | 497 + original/man2/recvfrom.2 | 1 + original/man2/recvmsg.2 | 1 + original/man2/remap_file_pages.2 | 162 + original/man2/removexattr.2 | 119 + original/man2/rename.2 | 250 + original/man2/renameat.2 | 134 + original/man2/request_key.2 | 141 + original/man2/rmdir.2 | 140 + original/man2/rt_sigaction.2 | 1 + original/man2/rt_sigpending.2 | 1 + original/man2/rt_sigprocmask.2 | 1 + original/man2/rt_sigqueueinfo.2 | 1 + original/man2/rt_sigreturn.2 | 1 + original/man2/rt_sigsuspend.2 | 1 + original/man2/rt_sigtimedwait.2 | 1 + original/man2/sbrk.2 | 1 + original/man2/sched_get_priority_max.2 | 112 + original/man2/sched_get_priority_min.2 | 1 + original/man2/sched_getaffinity.2 | 1 + original/man2/sched_getparam.2 | 1 + original/man2/sched_getscheduler.2 | 1 + original/man2/sched_rr_get_interval.2 | 124 + original/man2/sched_setaffinity.2 | 230 + original/man2/sched_setparam.2 | 126 + original/man2/sched_setscheduler.2 | 483 + original/man2/sched_yield.2 | 84 + original/man2/security.2 | 1 + original/man2/select.2 | 529 + original/man2/select_tut.2 | 835 ++ original/man2/semctl.2 | 515 + original/man2/semget.2 | 285 + original/man2/semop.2 | 520 + original/man2/semtimedop.2 | 1 + original/man2/send.2 | 425 + original/man2/sendfile.2 | 176 + original/man2/sendfile64.2 | 1 + original/man2/sendmsg.2 | 1 + original/man2/sendto.2 | 1 + original/man2/set_mempolicy.2 | 295 + original/man2/set_thread_area.2 | 68 + original/man2/set_tid_address.2 | 93 + original/man2/setcontext.2 | 1 + original/man2/setdomainname.2 | 1 + original/man2/setegid.2 | 1 + original/man2/seteuid.2 | 121 + original/man2/setfsgid.2 | 104 + original/man2/setfsgid32.2 | 1 + original/man2/setfsuid.2 | 104 + original/man2/setfsuid32.2 | 1 + original/man2/setgid.2 | 71 + original/man2/setgid32.2 | 1 + original/man2/setgroups.2 | 1 + original/man2/setgroups32.2 | 1 + original/man2/sethostid.2 | 1 + original/man2/sethostname.2 | 1 + original/man2/setitimer.2 | 1 + original/man2/setpgid.2 | 308 + original/man2/setpgrp.2 | 1 + original/man2/setpriority.2 | 1 + original/man2/setregid.2 | 1 + original/man2/setregid32.2 | 1 + original/man2/setresgid.2 | 1 + original/man2/setresgid32.2 | 1 + original/man2/setresuid.2 | 99 + original/man2/setresuid32.2 | 1 + original/man2/setreuid.2 | 143 + original/man2/setreuid32.2 | 1 + original/man2/setrlimit.2 | 1 + original/man2/setsid.2 | 89 + original/man2/setsockopt.2 | 1 + original/man2/settimeofday.2 | 1 + original/man2/setuid.2 | 115 + original/man2/setuid32.2 | 1 + original/man2/setup.2 | 71 + original/man2/setxattr.2 | 162 + original/man2/sgetmask.2 | 76 + original/man2/shmat.2 | 1 + original/man2/shmctl.2 | 409 + original/man2/shmdt.2 | 1 + original/man2/shmget.2 | 297 + original/man2/shmop.2 | 289 + original/man2/shutdown.2 | 100 + original/man2/sigaction.2 | 702 ++ original/man2/sigaltstack.2 | 230 + original/man2/signal.2 | 278 + original/man2/signalfd.2 | 442 + original/man2/signalfd4.2 | 1 + original/man2/sigpending.2 | 89 + original/man2/sigprocmask.2 | 141 + original/man2/sigqueue.2 | 151 + original/man2/sigreturn.2 | 76 + original/man2/sigsuspend.2 | 113 + original/man2/sigtimedwait.2 | 1 + original/man2/sigwaitinfo.2 | 184 + original/man2/socket.2 | 417 + original/man2/socketcall.2 | 71 + original/man2/socketpair.2 | 128 + original/man2/splice.2 | 229 + original/man2/spu_create.2 | 269 + original/man2/spu_run.2 | 263 + original/man2/ssetmask.2 | 1 + original/man2/stat.2 | 603 ++ original/man2/stat64.2 | 1 + original/man2/statfs.2 | 254 + original/man2/statfs64.2 | 1 + original/man2/statvfs.2 | 180 + original/man2/stime.2 | 73 + original/man2/stty.2 | 1 + original/man2/swapoff.2 | 1 + original/man2/swapon.2 | 171 + original/man2/symlink.2 | 167 + original/man2/symlinkat.2 | 121 + original/man2/sync.2 | 76 + original/man2/sync_file_range.2 | 187 + original/man2/syscall.2 | 85 + original/man2/syscalls.2 | 797 ++ original/man2/sysctl.2 | 168 + original/man2/sysfs.2 | 101 + original/man2/sysinfo.2 | 95 + original/man2/syslog.2 | 257 + original/man2/tee.2 | 199 + original/man2/tgkill.2 | 1 + original/man2/time.2 | 79 + original/man2/timer_create.2 | 434 + original/man2/timer_delete.2 | 71 + original/man2/timer_getoverrun.2 | 137 + original/man2/timer_gettime.2 | 1 + original/man2/timer_settime.2 | 212 + original/man2/timerfd_create.2 | 546 + original/man2/timerfd_gettime.2 | 1 + original/man2/timerfd_settime.2 | 1 + original/man2/times.2 | 210 + original/man2/tkill.2 | 108 + original/man2/truncate.2 | 221 + original/man2/truncate64.2 | 1 + original/man2/tuxcall.2 | 1 + original/man2/ugetrlimit.2 | 1 + original/man2/umask.2 | 121 + original/man2/umount.2 | 166 + original/man2/umount2.2 | 1 + original/man2/uname.2 | 158 + original/man2/unimplemented.2 | 65 + original/man2/unlink.2 | 157 + original/man2/unlinkat.2 | 158 + original/man2/unshare.2 | 195 + original/man2/uselib.2 | 111 + original/man2/ustat.2 | 116 + original/man2/utime.2 | 187 + original/man2/utimensat.2 | 603 ++ original/man2/utimes.2 | 1 + original/man2/vfork.2 | 207 + original/man2/vhangup.2 | 67 + original/man2/vm86.2 | 73 + original/man2/vm86old.2 | 1 + original/man2/vmsplice.2 | 156 + original/man2/vserver.2 | 1 + original/man2/wait.2 | 606 ++ original/man2/wait3.2 | 1 + original/man2/wait4.2 | 152 + original/man2/waitid.2 | 1 + original/man2/waitpid.2 | 1 + original/man2/write.2 | 211 + original/man2/writev.2 | 1 + original/man3/CMSG_ALIGN.3 | 1 + original/man3/CMSG_FIRSTHDR.3 | 1 + original/man3/CMSG_NXTHDR.3 | 1 + original/man3/CMSG_SPACE.3 | 1 + original/man3/CPU_ALLOC.3 | 1 + original/man3/CPU_ALLOC_SIZE.3 | 1 + original/man3/CPU_AND.3 | 1 + original/man3/CPU_AND_S.3 | 1 + original/man3/CPU_CLR.3 | 1 + original/man3/CPU_CLR_S.3 | 1 + original/man3/CPU_COUNT.3 | 1 + original/man3/CPU_COUNT_S.3 | 1 + original/man3/CPU_EQUAL.3 | 1 + original/man3/CPU_EQUAL_S.3 | 1 + original/man3/CPU_FREE.3 | 1 + original/man3/CPU_ISSET.3 | 1 + original/man3/CPU_ISSET_S.3 | 1 + original/man3/CPU_OR.3 | 1 + original/man3/CPU_OR_S.3 | 1 + original/man3/CPU_SET.3 | 353 + original/man3/CPU_SET_S.3 | 1 + original/man3/CPU_XOR.3 | 1 + original/man3/CPU_XOR_S.3 | 1 + original/man3/CPU_ZERO.3 | 1 + original/man3/CPU_ZERO_S.3 | 1 + original/man3/FD_CLR.3 | 1 + original/man3/FD_ISSET.3 | 1 + original/man3/FD_SET.3 | 1 + original/man3/FD_ZERO.3 | 1 + original/man3/HUGE_VAL.3 | 1 + original/man3/HUGE_VALF.3 | 1 + original/man3/HUGE_VALL.3 | 1 + original/man3/INFINITY.3 | 94 + original/man3/MB_CUR_MAX.3 | 41 + original/man3/MB_LEN_MAX.3 | 43 + original/man3/NAN.3 | 1 + original/man3/__fbufsize.3 | 1 + original/man3/__flbf.3 | 1 + original/man3/__fpending.3 | 1 + original/man3/__fpurge.3 | 1 + original/man3/__freadable.3 | 1 + original/man3/__freading.3 | 1 + original/man3/__fsetlocking.3 | 1 + original/man3/__fwritable.3 | 1 + original/man3/__fwriting.3 | 1 + original/man3/__malloc_hook.3 | 1 + original/man3/__setfpucw.3 | 60 + original/man3/_flushlbf.3 | 1 + original/man3/a64l.3 | 78 + original/man3/abort.3 | 77 + original/man3/abs.3 | 122 + original/man3/acos.3 | 116 + original/man3/acosf.3 | 1 + original/man3/acosh.3 | 117 + original/man3/acoshf.3 | 1 + original/man3/acoshl.3 | 1 + original/man3/acosl.3 | 1 + original/man3/addmntent.3 | 1 + original/man3/addseverity.3 | 68 + original/man3/adjtime.3 | 142 + original/man3/aio_cancel.3 | 92 + original/man3/aio_error.3 | 74 + original/man3/aio_fsync.3 | 94 + original/man3/aio_read.3 | 123 + original/man3/aio_return.3 | 67 + original/man3/aio_suspend.3 | 90 + original/man3/aio_write.3 | 127 + original/man3/alloca.3 | 152 + original/man3/alphasort.3 | 1 + original/man3/argz.3 | 1 + original/man3/argz_add.3 | 205 + original/man3/argz_add_sep.3 | 1 + original/man3/argz_append.3 | 1 + original/man3/argz_count.3 | 1 + original/man3/argz_create.3 | 1 + original/man3/argz_create_sep.3 | 1 + original/man3/argz_delete.3 | 1 + original/man3/argz_extract.3 | 1 + original/man3/argz_insert.3 | 1 + original/man3/argz_next.3 | 1 + original/man3/argz_replace.3 | 1 + original/man3/argz_stringify.3 | 1 + original/man3/asctime.3 | 1 + original/man3/asctime_r.3 | 1 + original/man3/asin.3 | 115 + original/man3/asinf.3 | 1 + original/man3/asinh.3 | 102 + original/man3/asinhf.3 | 1 + original/man3/asinhl.3 | 1 + original/man3/asinl.3 | 1 + original/man3/asprintf.3 | 69 + original/man3/assert.3 | 77 + original/man3/assert_perror.3 | 74 + original/man3/atan.3 | 101 + original/man3/atan2.3 | 172 + original/man3/atan2f.3 | 1 + original/man3/atan2l.3 | 1 + original/man3/atanf.3 | 1 + original/man3/atanh.3 | 148 + original/man3/atanhf.3 | 1 + original/man3/atanhl.3 | 1 + original/man3/atanl.3 | 1 + original/man3/atexit.3 | 159 + original/man3/atof.3 | 62 + original/man3/atoi.3 | 110 + original/man3/atol.3 | 1 + original/man3/atoll.3 | 1 + original/man3/atoq.3 | 1 + original/man3/auth_destroy.3 | 1 + original/man3/authnone_create.3 | 1 + original/man3/authunix_create.3 | 1 + original/man3/authunix_create_default.3 | 1 + original/man3/backtrace.3 | 251 + original/man3/backtrace_symbols.3 | 1 + original/man3/backtrace_symbols_fd.3 | 1 + original/man3/basename.3 | 176 + original/man3/bcmp.3 | 72 + original/man3/bcopy.3 | 71 + original/man3/be16toh.3 | 1 + original/man3/be32toh.3 | 1 + original/man3/be64toh.3 | 1 + original/man3/bindresvport.3 | 100 + original/man3/bsd_signal.3 | 97 + original/man3/bsearch.3 | 120 + original/man3/bstring.3 | 91 + original/man3/btowc.3 | 66 + original/man3/btree.3 | 247 + original/man3/byteorder.3 | 80 + original/man3/bzero.3 | 57 + original/man3/cabs.3 | 36 + original/man3/cabsf.3 | 1 + original/man3/cabsl.3 | 1 + original/man3/cacos.3 | 39 + original/man3/cacosf.3 | 1 + original/man3/cacosh.3 | 43 + original/man3/cacoshf.3 | 1 + original/man3/cacoshl.3 | 1 + original/man3/cacosl.3 | 1 + original/man3/calloc.3 | 1 + original/man3/callrpc.3 | 1 + original/man3/canonicalize_file_name.3 | 23 + original/man3/carg.3 | 51 + original/man3/cargf.3 | 1 + original/man3/cargl.3 | 1 + original/man3/casin.3 | 39 + original/man3/casinf.3 | 1 + original/man3/casinh.3 | 40 + original/man3/casinhf.3 | 1 + original/man3/casinhl.3 | 1 + original/man3/casinl.3 | 1 + original/man3/catan.3 | 37 + original/man3/catanf.3 | 1 + original/man3/catanh.3 | 40 + original/man3/catanhf.3 | 1 + original/man3/catanhl.3 | 1 + original/man3/catanl.3 | 1 + original/man3/catclose.3 | 1 + original/man3/catgets.3 | 84 + original/man3/catopen.3 | 189 + original/man3/cbc_crypt.3 | 1 + original/man3/cbrt.3 | 82 + original/man3/cbrtf.3 | 1 + original/man3/cbrtl.3 | 1 + original/man3/ccos.3 | 31 + original/man3/ccosf.3 | 1 + original/man3/ccosh.3 | 31 + original/man3/ccoshf.3 | 1 + original/man3/ccoshl.3 | 1 + original/man3/ccosl.3 | 1 + original/man3/ceil.3 | 108 + original/man3/ceilf.3 | 1 + original/man3/ceill.3 | 1 + original/man3/cerf.3 | 39 + original/man3/cerfc.3 | 1 + original/man3/cerfcf.3 | 1 + original/man3/cerfcl.3 | 1 + original/man3/cerff.3 | 1 + original/man3/cerfl.3 | 1 + original/man3/cexp.3 | 35 + original/man3/cexp2.3 | 29 + original/man3/cexp2f.3 | 1 + original/man3/cexp2l.3 | 1 + original/man3/cexpf.3 | 1 + original/man3/cexpl.3 | 1 + original/man3/cfgetispeed.3 | 1 + original/man3/cfgetospeed.3 | 1 + original/man3/cfmakeraw.3 | 1 + original/man3/cfree.3 | 117 + original/man3/cfsetispeed.3 | 1 + original/man3/cfsetospeed.3 | 1 + original/man3/cfsetspeed.3 | 1 + original/man3/cimag.3 | 38 + original/man3/cimagf.3 | 1 + original/man3/cimagl.3 | 1 + original/man3/clearenv.3 | 100 + original/man3/clearerr.3 | 1 + original/man3/clearerr_unlocked.3 | 1 + original/man3/clnt_broadcast.3 | 1 + original/man3/clnt_call.3 | 1 + original/man3/clnt_control.3 | 1 + original/man3/clnt_create.3 | 1 + original/man3/clnt_destroy.3 | 1 + original/man3/clnt_freeres.3 | 1 + original/man3/clnt_geterr.3 | 1 + original/man3/clnt_pcreateerror.3 | 1 + original/man3/clnt_perrno.3 | 1 + original/man3/clnt_perror.3 | 1 + original/man3/clnt_spcreateerror.3 | 1 + original/man3/clnt_sperrno.3 | 1 + original/man3/clnt_sperror.3 | 1 + original/man3/clntraw_create.3 | 1 + original/man3/clnttcp_create.3 | 1 + original/man3/clntudp_bufcreate.3 | 1 + original/man3/clntudp_create.3 | 1 + original/man3/clock.3 | 87 + original/man3/clock_getcpuclockid.3 | 147 + original/man3/clock_getres.3 | 3 + original/man3/clock_gettime.3 | 3 + original/man3/clock_settime.3 | 3 + original/man3/clog.3 | 44 + original/man3/clog10.3 | 43 + original/man3/clog10f.3 | 1 + original/man3/clog10l.3 | 1 + original/man3/clog2.3 | 41 + original/man3/clog2f.3 | 1 + original/man3/clog2l.3 | 1 + original/man3/clogf.3 | 1 + original/man3/clogl.3 | 1 + original/man3/closedir.3 | 71 + original/man3/closelog.3 | 1 + original/man3/cmsg.3 | 216 + original/man3/confstr.3 | 147 + original/man3/conj.3 | 36 + original/man3/conjf.3 | 1 + original/man3/conjl.3 | 1 + original/man3/copysign.3 | 83 + original/man3/copysignf.3 | 1 + original/man3/copysignl.3 | 1 + original/man3/cos.3 | 111 + original/man3/cosf.3 | 1 + original/man3/cosh.3 | 127 + original/man3/coshf.3 | 1 + original/man3/coshl.3 | 1 + original/man3/cosl.3 | 1 + original/man3/cpow.3 | 35 + original/man3/cpowf.3 | 1 + original/man3/cpowl.3 | 1 + original/man3/cproj.3 | 35 + original/man3/cprojf.3 | 1 + original/man3/cprojl.3 | 1 + original/man3/creal.3 | 38 + original/man3/crealf.3 | 1 + original/man3/creall.3 | 1 + original/man3/crypt.3 | 230 + original/man3/crypt_r.3 | 1 + original/man3/csin.3 | 31 + original/man3/csinf.3 | 1 + original/man3/csinh.3 | 31 + original/man3/csinhf.3 | 1 + original/man3/csinhl.3 | 1 + original/man3/csinl.3 | 1 + original/man3/csqrt.3 | 31 + original/man3/csqrtf.3 | 1 + original/man3/csqrtl.3 | 1 + original/man3/ctan.3 | 31 + original/man3/ctanf.3 | 1 + original/man3/ctanh.3 | 32 + original/man3/ctanhf.3 | 1 + original/man3/ctanhl.3 | 1 + original/man3/ctanl.3 | 1 + original/man3/ctermid.3 | 68 + original/man3/ctime.3 | 368 + original/man3/ctime_r.3 | 1 + original/man3/cuserid.3 | 1 + original/man3/daemon.3 | 104 + original/man3/daylight.3 | 1 + original/man3/db.3 | 1 + original/man3/dbopen.3 | 552 + original/man3/des_crypt.3 | 138 + original/man3/des_setparity.3 | 1 + original/man3/difftime.3 | 71 + original/man3/dirfd.3 | 91 + original/man3/dirname.3 | 1 + original/man3/div.3 | 99 + original/man3/dl_iterate_phdr.3 | 205 + original/man3/dladdr.3 | 1 + original/man3/dlclose.3 | 1 + original/man3/dlerror.3 | 1 + original/man3/dlopen.3 | 515 + original/man3/dlsym.3 | 1 + original/man3/dlvsym.3 | 1 + original/man3/dn_comp.3 | 1 + original/man3/dn_expand.3 | 1 + original/man3/dprintf.3 | 78 + original/man3/drand48.3 | 210 + original/man3/drand48_r.3 | 101 + original/man3/drem.3 | 1 + original/man3/dremf.3 | 1 + original/man3/dreml.3 | 1 + original/man3/dysize.3 | 56 + original/man3/eaccess.3 | 1 + original/man3/ecb_crypt.3 | 1 + original/man3/ecvt.3 | 114 + original/man3/ecvt_r.3 | 94 + original/man3/edata.3 | 1 + original/man3/encrypt.3 | 160 + original/man3/encrypt_r.3 | 1 + original/man3/end.3 | 111 + original/man3/endaliasent.3 | 1 + original/man3/endfsent.3 | 1 + original/man3/endgrent.3 | 1 + original/man3/endhostent.3 | 1 + original/man3/endian.3 | 150 + original/man3/endmntent.3 | 1 + original/man3/endnetent.3 | 1 + original/man3/endnetgrent.3 | 1 + original/man3/endprotoent.3 | 1 + original/man3/endpwent.3 | 1 + original/man3/endrpcent.3 | 1 + original/man3/endservent.3 | 1 + original/man3/endspent.3 | 1 + original/man3/endttyent.3 | 1 + original/man3/endusershell.3 | 1 + original/man3/endutent.3 | 1 + original/man3/endutxent.3 | 1 + original/man3/envz.3 | 1 + original/man3/envz_add.3 | 139 + original/man3/envz_entry.3 | 1 + original/man3/envz_get.3 | 1 + original/man3/envz_merge.3 | 1 + original/man3/envz_remove.3 | 1 + original/man3/envz_strip.3 | 1 + original/man3/erand48.3 | 1 + original/man3/erand48_r.3 | 1 + original/man3/erf.3 | 121 + original/man3/erfc.3 | 126 + original/man3/erfcf.3 | 1 + original/man3/erfcl.3 | 1 + original/man3/erff.3 | 1 + original/man3/erfl.3 | 1 + original/man3/err.3 | 165 + original/man3/errno.3 | 533 + original/man3/error.3 | 131 + original/man3/error_at_line.3 | 1 + original/man3/error_message_count.3 | 1 + original/man3/error_on_per_line.3 | 1 + original/man3/error_print_progname.3 | 1 + original/man3/errx.3 | 1 + original/man3/etext.3 | 1 + original/man3/ether_aton.3 | 130 + original/man3/ether_aton_r.3 | 1 + original/man3/ether_hostton.3 | 1 + original/man3/ether_line.3 | 1 + original/man3/ether_ntoa.3 | 1 + original/man3/ether_ntoa_r.3 | 1 + original/man3/ether_ntohost.3 | 1 + original/man3/euidaccess.3 | 90 + original/man3/eventfd_read.3 | 1 + original/man3/eventfd_write.3 | 1 + original/man3/exec.3 | 213 + original/man3/execl.3 | 1 + original/man3/execle.3 | 1 + original/man3/execlp.3 | 1 + original/man3/execv.3 | 1 + original/man3/execvp.3 | 1 + original/man3/exit.3 | 171 + original/man3/exp.3 | 131 + original/man3/exp10.3 | 82 + original/man3/exp10f.3 | 1 + original/man3/exp10l.3 | 1 + original/man3/exp2.3 | 95 + original/man3/exp2f.3 | 1 + original/man3/exp2l.3 | 1 + original/man3/expf.3 | 1 + original/man3/expl.3 | 1 + original/man3/expm1.3 | 151 + original/man3/expm1f.3 | 1 + original/man3/expm1l.3 | 1 + original/man3/fabs.3 | 91 + original/man3/fabsf.3 | 1 + original/man3/fabsl.3 | 1 + original/man3/fclose.3 | 105 + original/man3/fcloseall.3 | 62 + original/man3/fcvt.3 | 1 + original/man3/fcvt_r.3 | 1 + original/man3/fdim.3 | 76 + original/man3/fdimf.3 | 1 + original/man3/fdiml.3 | 1 + original/man3/fdopen.3 | 1 + original/man3/fdopendir.3 | 1 + original/man3/feclearexcept.3 | 1 + original/man3/fedisableexcept.3 | 1 + original/man3/feenableexcept.3 | 1 + original/man3/fegetenv.3 | 1 + original/man3/fegetexcept.3 | 1 + original/man3/fegetexceptflag.3 | 1 + original/man3/fegetround.3 | 1 + original/man3/feholdexcept.3 | 1 + original/man3/fenv.3 | 324 + original/man3/feof.3 | 1 + original/man3/feof_unlocked.3 | 1 + original/man3/feraiseexcept.3 | 1 + original/man3/ferror.3 | 116 + original/man3/ferror_unlocked.3 | 1 + original/man3/fesetenv.3 | 1 + original/man3/fesetexceptflag.3 | 1 + original/man3/fesetround.3 | 1 + original/man3/fetestexcept.3 | 1 + original/man3/feupdateenv.3 | 1 + original/man3/fexecve.3 | 89 + original/man3/fflush.3 | 113 + original/man3/fflush_unlocked.3 | 1 + original/man3/ffs.3 | 77 + original/man3/ffsl.3 | 1 + original/man3/ffsll.3 | 1 + original/man3/fgetc.3 | 1 + original/man3/fgetc_unlocked.3 | 1 + original/man3/fgetgrent.3 | 98 + original/man3/fgetgrent_r.3 | 1 + original/man3/fgetpos.3 | 1 + original/man3/fgetpwent.3 | 108 + original/man3/fgetpwent_r.3 | 1 + original/man3/fgets.3 | 1 + original/man3/fgets_unlocked.3 | 1 + original/man3/fgetspent.3 | 1 + original/man3/fgetspent_r.3 | 1 + original/man3/fgetwc.3 | 86 + original/man3/fgetwc_unlocked.3 | 1 + original/man3/fgetws.3 | 73 + original/man3/fgetws_unlocked.3 | 1 + original/man3/fileno.3 | 1 + original/man3/fileno_unlocked.3 | 1 + original/man3/finite.3 | 113 + original/man3/finitef.3 | 1 + original/man3/finitel.3 | 1 + original/man3/flockfile.3 | 126 + original/man3/floor.3 | 98 + original/man3/floorf.3 | 1 + original/man3/floorl.3 | 1 + original/man3/fma.3 | 151 + original/man3/fmaf.3 | 1 + original/man3/fmal.3 | 1 + original/man3/fmax.3 | 53 + original/man3/fmaxf.3 | 1 + original/man3/fmaxl.3 | 1 + original/man3/fmemopen.3 | 256 + original/man3/fmin.3 | 53 + original/man3/fminf.3 | 1 + original/man3/fminl.3 | 1 + original/man3/fmod.3 | 138 + original/man3/fmodf.3 | 1 + original/man3/fmodl.3 | 1 + original/man3/fmtmsg.3 | 295 + original/man3/fnmatch.3 | 103 + original/man3/fopen.3 | 306 + original/man3/fopencookie.3 | 439 + original/man3/forkpty.3 | 1 + original/man3/fpathconf.3 | 167 + original/man3/fpclassify.3 | 119 + original/man3/fprintf.3 | 1 + original/man3/fpurge.3 | 82 + original/man3/fputc.3 | 1 + original/man3/fputc_unlocked.3 | 1 + original/man3/fputs.3 | 1 + original/man3/fputs_unlocked.3 | 1 + original/man3/fputwc.3 | 83 + original/man3/fputwc_unlocked.3 | 1 + original/man3/fputws.3 | 60 + original/man3/fputws_unlocked.3 | 1 + original/man3/fread.3 | 103 + original/man3/fread_unlocked.3 | 1 + original/man3/free.3 | 1 + original/man3/freeaddrinfo.3 | 1 + original/man3/freehostent.3 | 1 + original/man3/freeifaddrs.3 | 1 + original/man3/freopen.3 | 1 + original/man3/frexp.3 | 132 + original/man3/frexpf.3 | 1 + original/man3/frexpl.3 | 1 + original/man3/fscanf.3 | 1 + original/man3/fseek.3 | 168 + original/man3/fseeko.3 | 82 + original/man3/fsetpos.3 | 1 + original/man3/ftell.3 | 1 + original/man3/ftello.3 | 1 + original/man3/ftime.3 | 97 + original/man3/ftok.3 | 104 + original/man3/ftrylockfile.3 | 1 + original/man3/fts.3 | 787 ++ original/man3/fts_children.3 | 1 + original/man3/fts_close.3 | 1 + original/man3/fts_open.3 | 1 + original/man3/fts_read.3 | 1 + original/man3/fts_set.3 | 1 + original/man3/ftw.3 | 392 + original/man3/funlockfile.3 | 1 + original/man3/futimens.3 | 1 + original/man3/futimes.3 | 93 + original/man3/fwide.3 | 88 + original/man3/fwprintf.3 | 1 + original/man3/fwrite.3 | 1 + original/man3/fwrite_unlocked.3 | 1 + original/man3/gai_strerror.3 | 1 + original/man3/gamma.3 | 94 + original/man3/gammaf.3 | 1 + original/man3/gammal.3 | 1 + original/man3/gcvt.3 | 70 + original/man3/get_current_dir_name.3 | 1 + original/man3/get_myaddress.3 | 1 + original/man3/getaddrinfo.3 | 818 ++ original/man3/getaliasbyname.3 | 1 + original/man3/getaliasbyname_r.3 | 1 + original/man3/getaliasent.3 | 1 + original/man3/getaliasent_r.3 | 1 + original/man3/getc.3 | 1 + original/man3/getc_unlocked.3 | 1 + original/man3/getchar.3 | 1 + original/man3/getchar_unlocked.3 | 1 + original/man3/getcwd.3 | 234 + original/man3/getdate.3 | 289 + original/man3/getdate_err.3 | 1 + original/man3/getdate_r.3 | 1 + original/man3/getdelim.3 | 1 + original/man3/getdirentries.3 | 74 + original/man3/getenv.3 | 82 + original/man3/getfsent.3 | 133 + original/man3/getfsfile.3 | 1 + original/man3/getfsspec.3 | 1 + original/man3/getgrent.3 | 144 + original/man3/getgrent_r.3 | 185 + original/man3/getgrgid.3 | 1 + original/man3/getgrgid_r.3 | 1 + original/man3/getgrnam.3 | 223 + original/man3/getgrnam_r.3 | 1 + original/man3/getgrouplist.3 | 192 + original/man3/gethostbyaddr.3 | 1 + original/man3/gethostbyaddr_r.3 | 1 + original/man3/gethostbyname.3 | 429 + original/man3/gethostbyname2.3 | 1 + original/man3/gethostbyname2_r.3 | 1 + original/man3/gethostbyname_r.3 | 1 + original/man3/gethostent.3 | 1 + original/man3/gethostent_r.3 | 1 + original/man3/gethostid.3 | 118 + original/man3/getifaddrs.3 | 283 + original/man3/getipnodebyaddr.3 | 1 + original/man3/getipnodebyname.3 | 268 + original/man3/getline.3 | 171 + original/man3/getloadavg.3 | 70 + original/man3/getlogin.3 | 196 + original/man3/getlogin_r.3 | 1 + original/man3/getmntent.3 | 196 + original/man3/getmntent_r.3 | 1 + original/man3/getnameinfo.3 | 301 + original/man3/getnetbyaddr.3 | 1 + original/man3/getnetbyaddr_r.3 | 1 + original/man3/getnetbyname.3 | 1 + original/man3/getnetbyname_r.3 | 1 + original/man3/getnetent.3 | 139 + original/man3/getnetent_r.3 | 143 + original/man3/getnetgrent.3 | 1 + original/man3/getnetgrent_r.3 | 1 + original/man3/getopt.3 | 514 + original/man3/getopt_long.3 | 1 + original/man3/getopt_long_only.3 | 1 + original/man3/getpass.3 | 125 + original/man3/getprotobyname.3 | 1 + original/man3/getprotobyname_r.3 | 1 + original/man3/getprotobynumber.3 | 1 + original/man3/getprotobynumber_r.3 | 1 + original/man3/getprotoent.3 | 126 + original/man3/getprotoent_r.3 | 235 + original/man3/getpt.3 | 52 + original/man3/getpw.3 | 108 + original/man3/getpwent.3 | 154 + original/man3/getpwent_r.3 | 183 + original/man3/getpwnam.3 | 302 + original/man3/getpwnam_r.3 | 1 + original/man3/getpwuid.3 | 1 + original/man3/getpwuid_r.3 | 1 + original/man3/getrpcbyname.3 | 1 + original/man3/getrpcbyname_r.3 | 1 + original/man3/getrpcbynumber.3 | 1 + original/man3/getrpcbynumber_r.3 | 1 + original/man3/getrpcent.3 | 104 + original/man3/getrpcent_r.3 | 132 + original/man3/getrpcport.3 | 34 + original/man3/gets.3 | 179 + original/man3/getservbyname.3 | 1 + original/man3/getservbyname_r.3 | 1 + original/man3/getservbyport.3 | 1 + original/man3/getservbyport_r.3 | 1 + original/man3/getservent.3 | 135 + original/man3/getservent_r.3 | 239 + original/man3/getspent.3 | 1 + original/man3/getspent_r.3 | 1 + original/man3/getspnam.3 | 246 + original/man3/getspnam_r.3 | 1 + original/man3/getsubopt.3 | 210 + original/man3/getttyent.3 | 78 + original/man3/getttynam.3 | 1 + original/man3/getumask.3 | 62 + original/man3/getusershell.3 | 84 + original/man3/getutent.3 | 286 + original/man3/getutent_r.3 | 1 + original/man3/getutid.3 | 1 + original/man3/getutid_r.3 | 1 + original/man3/getutline.3 | 1 + original/man3/getutline_r.3 | 1 + original/man3/getutmp.3 | 69 + original/man3/getutmpx.3 | 1 + original/man3/getutxent.3 | 1 + original/man3/getutxid.3 | 1 + original/man3/getutxline.3 | 1 + original/man3/getw.3 | 66 + original/man3/getwc.3 | 1 + original/man3/getwc_unlocked.3 | 1 + original/man3/getwchar.3 | 64 + original/man3/getwchar_unlocked.3 | 1 + original/man3/getwd.3 | 1 + original/man3/glob.3 | 324 + original/man3/globfree.3 | 1 + original/man3/gmtime.3 | 1 + original/man3/gmtime_r.3 | 1 + original/man3/gnu_dev_major.3 | 1 + original/man3/gnu_dev_makedev.3 | 1 + original/man3/gnu_dev_minor.3 | 1 + original/man3/gnu_get_libc_release.3 | 1 + original/man3/gnu_get_libc_version.3 | 76 + original/man3/grantpt.3 | 69 + original/man3/gsignal.3 | 104 + original/man3/h_errno.3 | 1 + original/man3/hash.3 | 161 + original/man3/hasmntopt.3 | 1 + original/man3/hcreate.3 | 1 + original/man3/hcreate_r.3 | 1 + original/man3/hdestroy.3 | 1 + original/man3/hdestroy_r.3 | 1 + original/man3/herror.3 | 1 + original/man3/hsearch.3 | 337 + original/man3/hsearch_r.3 | 1 + original/man3/hstrerror.3 | 1 + original/man3/htobe16.3 | 1 + original/man3/htobe32.3 | 1 + original/man3/htobe64.3 | 1 + original/man3/htole16.3 | 1 + original/man3/htole32.3 | 1 + original/man3/htole64.3 | 1 + original/man3/htonl.3 | 1 + original/man3/htons.3 | 1 + original/man3/hypot.3 | 154 + original/man3/hypotf.3 | 1 + original/man3/hypotl.3 | 1 + original/man3/iconv.3 | 123 + original/man3/iconv_close.3 | 40 + original/man3/iconv_open.3 | 89 + original/man3/ilogb.3 | 137 + original/man3/ilogbf.3 | 1 + original/man3/ilogbl.3 | 1 + original/man3/imaxabs.3 | 1 + original/man3/imaxdiv.3 | 1 + original/man3/index.3 | 79 + original/man3/inet.3 | 306 + original/man3/inet_addr.3 | 1 + original/man3/inet_aton.3 | 1 + original/man3/inet_lnaof.3 | 1 + original/man3/inet_makeaddr.3 | 1 + original/man3/inet_netof.3 | 1 + original/man3/inet_network.3 | 1 + original/man3/inet_ntoa.3 | 1 + original/man3/inet_ntop.3 | 119 + original/man3/inet_pton.3 | 216 + original/man3/infnan.3 | 73 + original/man3/initgroups.3 | 85 + original/man3/initstate.3 | 1 + original/man3/initstate_r.3 | 1 + original/man3/innetgr.3 | 1 + original/man3/insque.3 | 96 + original/man3/intro.3 | 97 + original/man3/iruserok.3 | 1 + original/man3/isalnum.3 | 1 + original/man3/isalpha.3 | 198 + original/man3/isascii.3 | 1 + original/man3/isatty.3 | 64 + original/man3/isblank.3 | 1 + original/man3/iscntrl.3 | 1 + original/man3/isdigit.3 | 1 + original/man3/isfinite.3 | 1 + original/man3/isgraph.3 | 1 + original/man3/isgreater.3 | 91 + original/man3/isgreaterequal.3 | 1 + original/man3/isinf.3 | 1 + original/man3/isinff.3 | 1 + original/man3/isinfl.3 | 1 + original/man3/isless.3 | 1 + original/man3/islessequal.3 | 1 + original/man3/islessgreater.3 | 1 + original/man3/islower.3 | 1 + original/man3/isnan.3 | 1 + original/man3/isnanf.3 | 1 + original/man3/isnanl.3 | 1 + original/man3/isnormal.3 | 1 + original/man3/isprint.3 | 1 + original/man3/ispunct.3 | 1 + original/man3/isspace.3 | 1 + original/man3/isunordered.3 | 1 + original/man3/isupper.3 | 1 + original/man3/iswalnum.3 | 71 + original/man3/iswalpha.3 | 75 + original/man3/iswblank.3 | 73 + original/man3/iswcntrl.3 | 56 + original/man3/iswctype.3 | 68 + original/man3/iswdigit.3 | 74 + original/man3/iswgraph.3 | 67 + original/man3/iswlower.3 | 82 + original/man3/iswprint.3 | 53 + original/man3/iswpunct.3 | 69 + original/man3/iswspace.3 | 61 + original/man3/iswupper.3 | 75 + original/man3/iswxdigit.3 | 66 + original/man3/isxdigit.3 | 1 + original/man3/j0.3 | 154 + original/man3/j0f.3 | 1 + original/man3/j0l.3 | 1 + original/man3/j1.3 | 1 + original/man3/j1f.3 | 1 + original/man3/j1l.3 | 1 + original/man3/jn.3 | 1 + original/man3/jnf.3 | 1 + original/man3/jnl.3 | 1 + original/man3/jrand48.3 | 1 + original/man3/jrand48_r.3 | 1 + original/man3/key_decryptsession.3 | 1 + original/man3/key_encryptsession.3 | 1 + original/man3/key_gendes.3 | 1 + original/man3/key_secretkey_is_set.3 | 1 + original/man3/key_setsecret.3 | 65 + original/man3/klogctl.3 | 1 + original/man3/l64a.3 | 1 + original/man3/labs.3 | 1 + original/man3/lckpwdf.3 | 1 + original/man3/lcong48.3 | 1 + original/man3/lcong48_r.3 | 1 + original/man3/ldexp.3 | 131 + original/man3/ldexpf.3 | 1 + original/man3/ldexpl.3 | 1 + original/man3/ldiv.3 | 1 + original/man3/le16toh.3 | 1 + original/man3/le32toh.3 | 1 + original/man3/le64toh.3 | 1 + original/man3/lfind.3 | 1 + original/man3/lgamma.3 | 159 + original/man3/lgamma_r.3 | 1 + original/man3/lgammaf.3 | 1 + original/man3/lgammaf_r.3 | 1 + original/man3/lgammal.3 | 1 + original/man3/lgammal_r.3 | 1 + original/man3/llabs.3 | 1 + original/man3/lldiv.3 | 1 + original/man3/llrint.3 | 1 + original/man3/llrintf.3 | 1 + original/man3/llrintl.3 | 1 + original/man3/llround.3 | 1 + original/man3/llroundf.3 | 1 + original/man3/llroundl.3 | 1 + original/man3/localeconv.3 | 64 + original/man3/localtime.3 | 1 + original/man3/localtime_r.3 | 1 + original/man3/lockf.3 | 152 + original/man3/log.3 | 137 + original/man3/log10.3 | 91 + original/man3/log10f.3 | 1 + original/man3/log10l.3 | 1 + original/man3/log1p.3 | 133 + original/man3/log1pf.3 | 1 + original/man3/log1pl.3 | 1 + original/man3/log2.3 | 93 + original/man3/log2f.3 | 1 + original/man3/log2l.3 | 1 + original/man3/logb.3 | 134 + original/man3/logbf.3 | 1 + original/man3/logbl.3 | 1 + original/man3/logf.3 | 1 + original/man3/login.3 | 125 + original/man3/login_tty.3 | 1 + original/man3/logl.3 | 1 + original/man3/logout.3 | 1 + original/man3/logwtmp.3 | 1 + original/man3/longjmp.3 | 126 + original/man3/lrand48.3 | 1 + original/man3/lrand48_r.3 | 1 + original/man3/lrint.3 | 110 + original/man3/lrintf.3 | 1 + original/man3/lrintl.3 | 1 + original/man3/lround.3 | 113 + original/man3/lroundf.3 | 1 + original/man3/lroundl.3 | 1 + original/man3/lsearch.3 | 74 + original/man3/lseek64.3 | 160 + original/man3/lutimes.3 | 1 + original/man3/major.3 | 1 + original/man3/makecontext.3 | 222 + original/man3/makedev.3 | 81 + original/man3/malloc.3 | 268 + original/man3/malloc_hook.3 | 134 + original/man3/matherr.3 | 422 + original/man3/mblen.3 | 83 + original/man3/mbrlen.3 | 77 + original/man3/mbrtowc.3 | 110 + original/man3/mbsinit.3 | 85 + original/man3/mbsnrtowcs.3 | 106 + original/man3/mbsrtowcs.3 | 98 + original/man3/mbstowcs.3 | 83 + original/man3/mbtowc.3 | 94 + original/man3/memalign.3 | 1 + original/man3/memccpy.3 | 58 + original/man3/memchr.3 | 140 + original/man3/memcmp.3 | 61 + original/man3/memcpy.3 | 59 + original/man3/memfrob.3 | 62 + original/man3/memmem.3 | 65 + original/man3/memmove.3 | 63 + original/man3/mempcpy.3 | 72 + original/man3/memrchr.3 | 1 + original/man3/memset.3 | 52 + original/man3/minor.3 | 1 + original/man3/mkdtemp.3 | 83 + original/man3/mkfifo.3 | 111 + original/man3/mkfifoat.3 | 122 + original/man3/mkostemp.3 | 1 + original/man3/mkstemp.3 | 144 + original/man3/mktemp.3 | 100 + original/man3/mktime.3 | 1 + original/man3/mmap64.3 | 1 + original/man3/modf.3 | 91 + original/man3/modff.3 | 1 + original/man3/modfl.3 | 1 + original/man3/mpool.3 | 226 + original/man3/mq_close.3 | 72 + original/man3/mq_getattr.3 | 154 + original/man3/mq_notify.3 | 282 + original/man3/mq_open.3 | 237 + original/man3/mq_receive.3 | 162 + original/man3/mq_send.3 | 167 + original/man3/mq_setattr.3 | 1 + original/man3/mq_timedreceive.3 | 1 + original/man3/mq_timedsend.3 | 1 + original/man3/mq_unlink.3 | 71 + original/man3/mrand48.3 | 1 + original/man3/mrand48_r.3 | 1 + original/man3/mtrace.3 | 43 + original/man3/muntrace.3 | 1 + original/man3/nan.3 | 70 + original/man3/nanf.3 | 1 + original/man3/nanl.3 | 1 + original/man3/nearbyint.3 | 1 + original/man3/nearbyintf.3 | 1 + original/man3/nearbyintl.3 | 1 + original/man3/netlink.3 | 90 + original/man3/nextafter.3 | 156 + original/man3/nextafterf.3 | 1 + original/man3/nextafterl.3 | 1 + original/man3/nexttoward.3 | 1 + original/man3/nexttowardf.3 | 1 + original/man3/nexttowardl.3 | 1 + original/man3/nftw.3 | 1 + original/man3/nl_langinfo.3 | 121 + original/man3/nrand48.3 | 1 + original/man3/nrand48_r.3 | 1 + original/man3/ntohl.3 | 1 + original/man3/ntohs.3 | 1 + original/man3/offsetof.3 | 100 + original/man3/on_exit.3 | 82 + original/man3/open_memstream.3 | 1 + original/man3/open_wmemstream.3 | 1 + original/man3/opendir.3 | 127 + original/man3/openlog.3 | 1 + original/man3/openpty.3 | 172 + original/man3/optarg.3 | 1 + original/man3/opterr.3 | 1 + original/man3/optind.3 | 1 + original/man3/optopt.3 | 1 + original/man3/passwd2des.3 | 1 + original/man3/pathconf.3 | 1 + original/man3/pclose.3 | 1 + original/man3/perror.3 | 139 + original/man3/pmap_getmaps.3 | 1 + original/man3/pmap_getport.3 | 1 + original/man3/pmap_rmtcall.3 | 1 + original/man3/pmap_set.3 | 1 + original/man3/pmap_unset.3 | 1 + original/man3/popen.3 | 203 + original/man3/posix_fallocate.3 | 119 + original/man3/posix_memalign.3 | 214 + original/man3/posix_openpt.3 | 104 + original/man3/pow.3 | 355 + original/man3/pow10.3 | 54 + original/man3/pow10f.3 | 1 + original/man3/pow10l.3 | 1 + original/man3/powf.3 | 1 + original/man3/powl.3 | 1 + original/man3/printf.3 | 1071 ++ original/man3/profil.3 | 83 + original/man3/program_invocation_name.3 | 62 + original/man3/program_invocation_short_name.3 | 1 + original/man3/psignal.3 | 71 + original/man3/pthread_attr_destroy.3 | 1 + original/man3/pthread_attr_getaffinity_np.3 | 1 + original/man3/pthread_attr_getdetachstate.3 | 1 + original/man3/pthread_attr_getguardsize.3 | 1 + original/man3/pthread_attr_getinheritsched.3 | 1 + original/man3/pthread_attr_getschedparam.3 | 1 + original/man3/pthread_attr_getschedpolicy.3 | 1 + original/man3/pthread_attr_getscope.3 | 1 + original/man3/pthread_attr_getstack.3 | 1 + original/man3/pthread_attr_getstackaddr.3 | 1 + original/man3/pthread_attr_getstacksize.3 | 1 + original/man3/pthread_attr_init.3 | 307 + original/man3/pthread_attr_setaffinity_np.3 | 120 + original/man3/pthread_attr_setdetachstate.3 | 113 + original/man3/pthread_attr_setguardsize.3 | 162 + original/man3/pthread_attr_setinheritsched.3 | 127 + original/man3/pthread_attr_setschedparam.3 | 104 + original/man3/pthread_attr_setschedpolicy.3 | 99 + original/man3/pthread_attr_setscope.3 | 124 + original/man3/pthread_attr_setstack.3 | 161 + original/man3/pthread_attr_setstackaddr.3 | 112 + original/man3/pthread_attr_setstacksize.3 | 114 + original/man3/pthread_cancel.3 | 229 + original/man3/pthread_cleanup_pop.3 | 1 + original/man3/pthread_cleanup_pop_restore_np.3 | 1 + original/man3/pthread_cleanup_push.3 | 313 + original/man3/pthread_cleanup_push_defer_np.3 | 106 + original/man3/pthread_create.3 | 377 + original/man3/pthread_detach.3 | 101 + original/man3/pthread_equal.3 | 56 + original/man3/pthread_exit.3 | 105 + original/man3/pthread_getaffinity_np.3 | 1 + original/man3/pthread_getattr_np.3 | 355 + original/man3/pthread_getconcurrency.3 | 1 + original/man3/pthread_getcpuclockid.3 | 173 + original/man3/pthread_getschedparam.3 | 1 + original/man3/pthread_join.3 | 131 + original/man3/pthread_kill.3 | 81 + original/man3/pthread_kill_other_threads_np.3 | 68 + original/man3/pthread_self.3 | 76 + original/man3/pthread_setaffinity_np.3 | 210 + original/man3/pthread_setcancelstate.3 | 178 + original/man3/pthread_setcanceltype.3 | 1 + original/man3/pthread_setconcurrency.3 | 99 + original/man3/pthread_setschedparam.3 | 439 + original/man3/pthread_setschedprio.3 | 99 + original/man3/pthread_sigmask.3 | 141 + original/man3/pthread_testcancel.3 | 64 + original/man3/pthread_timedjoin_np.3 | 1 + original/man3/pthread_tryjoin_np.3 | 137 + original/man3/pthread_yield.3 | 62 + original/man3/ptsname.3 | 98 + original/man3/ptsname_r.3 | 1 + original/man3/putc.3 | 1 + original/man3/putc_unlocked.3 | 1 + original/man3/putchar.3 | 1 + original/man3/putchar_unlocked.3 | 1 + original/man3/putenv.3 | 119 + original/man3/putgrent.3 | 43 + original/man3/putpwent.3 | 86 + original/man3/puts.3 | 122 + original/man3/putspent.3 | 1 + original/man3/pututline.3 | 1 + original/man3/pututxline.3 | 1 + original/man3/putw.3 | 1 + original/man3/putwc.3 | 1 + original/man3/putwc_unlocked.3 | 1 + original/man3/putwchar.3 | 62 + original/man3/putwchar_unlocked.3 | 1 + original/man3/qecvt.3 | 85 + original/man3/qecvt_r.3 | 1 + original/man3/qfcvt.3 | 1 + original/man3/qfcvt_r.3 | 1 + original/man3/qgcvt.3 | 1 + original/man3/qsort.3 | 120 + original/man3/queue.3 | 487 + original/man3/raise.3 | 70 + original/man3/rand.3 | 167 + original/man3/rand_r.3 | 1 + original/man3/random.3 | 164 + original/man3/random_r.3 | 128 + original/man3/rawmemchr.3 | 1 + original/man3/rcmd.3 | 223 + original/man3/re_comp.3 | 73 + original/man3/re_exec.3 | 1 + original/man3/readdir.3 | 249 + original/man3/readdir_r.3 | 1 + original/man3/realloc.3 | 1 + original/man3/realpath.3 | 209 + original/man3/recno.3 | 224 + original/man3/regcomp.3 | 1 + original/man3/regerror.3 | 1 + original/man3/regex.3 | 299 + original/man3/regexec.3 | 1 + original/man3/regfree.3 | 1 + original/man3/registerrpc.3 | 1 + original/man3/remainder.3 | 202 + original/man3/remainderf.3 | 1 + original/man3/remainderl.3 | 1 + original/man3/remove.3 | 91 + original/man3/remque.3 | 1 + original/man3/remquo.3 | 119 + original/man3/remquof.3 | 1 + original/man3/remquol.3 | 1 + original/man3/res_init.3 | 1 + original/man3/res_mkquery.3 | 1 + original/man3/res_query.3 | 1 + original/man3/res_querydomain.3 | 1 + original/man3/res_search.3 | 1 + original/man3/res_send.3 | 1 + original/man3/resolver.3 | 269 + original/man3/rewind.3 | 1 + original/man3/rewinddir.3 | 57 + original/man3/rexec.3 | 135 + original/man3/rindex.3 | 1 + original/man3/rint.3 | 123 + original/man3/rintf.3 | 1 + original/man3/rintl.3 | 1 + original/man3/round.3 | 105 + original/man3/roundf.3 | 1 + original/man3/roundl.3 | 1 + original/man3/rpc.3 | 1114 ++ original/man3/rpmatch.3 | 132 + original/man3/rresvport.3 | 1 + original/man3/rtime.3 | 124 + original/man3/rtnetlink.3 | 121 + original/man3/ruserok.3 | 1 + original/man3/scalb.3 | 190 + original/man3/scalbf.3 | 1 + original/man3/scalbl.3 | 1 + original/man3/scalbln.3 | 163 + original/man3/scalblnf.3 | 1 + original/man3/scalblnl.3 | 1 + original/man3/scalbn.3 | 1 + original/man3/scalbnf.3 | 1 + original/man3/scalbnl.3 | 1 + original/man3/scandir.3 | 176 + original/man3/scanf.3 | 716 ++ original/man3/sched_getcpu.3 | 83 + original/man3/seed48.3 | 1 + original/man3/seed48_r.3 | 1 + original/man3/seekdir.3 | 79 + original/man3/sem_close.3 | 66 + original/man3/sem_destroy.3 | 78 + original/man3/sem_getvalue.3 | 74 + original/man3/sem_init.3 | 106 + original/man3/sem_open.3 | 178 + original/man3/sem_post.3 | 73 + original/man3/sem_timedwait.3 | 1 + original/man3/sem_trywait.3 | 1 + original/man3/sem_unlink.3 | 69 + original/man3/sem_wait.3 | 268 + original/man3/setaliasent.3 | 149 + original/man3/setbuf.3 | 205 + original/man3/setbuffer.3 | 1 + original/man3/setenv.3 | 132 + original/man3/setfsent.3 | 1 + original/man3/setgrent.3 | 1 + original/man3/sethostent.3 | 1 + original/man3/sethostid.3 | 1 + original/man3/setjmp.3 | 119 + original/man3/setkey.3 | 1 + original/man3/setkey_r.3 | 1 + original/man3/setlinebuf.3 | 1 + original/man3/setlocale.3 | 198 + original/man3/setlogmask.3 | 73 + original/man3/setmntent.3 | 1 + original/man3/setnetent.3 | 1 + original/man3/setnetgrent.3 | 105 + original/man3/setprotoent.3 | 1 + original/man3/setpwent.3 | 1 + original/man3/setrpcent.3 | 1 + original/man3/setservent.3 | 1 + original/man3/setspent.3 | 1 + original/man3/setstate.3 | 1 + original/man3/setstate_r.3 | 1 + original/man3/setttyent.3 | 1 + original/man3/setusershell.3 | 1 + original/man3/setutent.3 | 1 + original/man3/setutxent.3 | 1 + original/man3/setvbuf.3 | 1 + original/man3/sgetspent.3 | 1 + original/man3/sgetspent_r.3 | 1 + original/man3/shm_open.3 | 279 + original/man3/shm_unlink.3 | 1 + original/man3/sigaddset.3 | 1 + original/man3/sigandset.3 | 1 + original/man3/sigblock.3 | 1 + original/man3/sigdelset.3 | 1 + original/man3/sigemptyset.3 | 1 + original/man3/sigfillset.3 | 1 + original/man3/siggetmask.3 | 1 + original/man3/sighold.3 | 1 + original/man3/sigignore.3 | 1 + original/man3/siginterrupt.3 | 86 + original/man3/sigisemptyset.3 | 1 + original/man3/sigismember.3 | 1 + original/man3/siglongjmp.3 | 1 + original/man3/sigmask.3 | 1 + original/man3/signbit.3 | 56 + original/man3/signgam.3 | 1 + original/man3/significand.3 | 52 + original/man3/significandf.3 | 1 + original/man3/significandl.3 | 1 + original/man3/sigorset.3 | 1 + original/man3/sigpause.3 | 105 + original/man3/sigrelse.3 | 1 + original/man3/sigset.3 | 259 + original/man3/sigsetjmp.3 | 1 + original/man3/sigsetmask.3 | 1 + original/man3/sigsetops.3 | 168 + original/man3/sigvec.3 | 259 + original/man3/sigwait.3 | 93 + original/man3/sin.3 | 114 + original/man3/sincos.3 | 78 + original/man3/sincosf.3 | 1 + original/man3/sincosl.3 | 1 + original/man3/sinf.3 | 1 + original/man3/sinh.3 | 127 + original/man3/sinhf.3 | 1 + original/man3/sinhl.3 | 1 + original/man3/sinl.3 | 1 + original/man3/sleep.3 | 63 + original/man3/snprintf.3 | 1 + original/man3/sockatmark.3 | 134 + original/man3/sprintf.3 | 1 + original/man3/sqrt.3 | 108 + original/man3/sqrtf.3 | 1 + original/man3/sqrtl.3 | 1 + original/man3/srand.3 | 1 + original/man3/srand48.3 | 1 + original/man3/srand48_r.3 | 1 + original/man3/srandom.3 | 1 + original/man3/srandom_r.3 | 1 + original/man3/sscanf.3 | 1 + original/man3/ssignal.3 | 1 + original/man3/stdarg.3 | 309 + original/man3/stderr.3 | 1 + original/man3/stdin.3 | 155 + original/man3/stdio.3 | 254 + original/man3/stdio_ext.3 | 132 + original/man3/stdout.3 | 1 + original/man3/stpcpy.3 | 88 + original/man3/stpncpy.3 | 52 + original/man3/strcasecmp.3 | 70 + original/man3/strcasestr.3 | 1 + original/man3/strcat.3 | 105 + original/man3/strchr.3 | 105 + original/man3/strchrnul.3 | 1 + original/man3/strcmp.3 | 73 + original/man3/strcoll.3 | 69 + original/man3/strcpy.3 | 142 + original/man3/strcspn.3 | 1 + original/man3/strdup.3 | 108 + original/man3/strdupa.3 | 1 + original/man3/strerror.3 | 181 + original/man3/strerror_r.3 | 1 + original/man3/strfmon.3 | 168 + original/man3/strfry.3 | 59 + original/man3/strftime.3 | 517 + original/man3/string.3 | 116 + original/man3/strlen.3 | 51 + original/man3/strncasecmp.3 | 1 + original/man3/strncat.3 | 1 + original/man3/strncmp.3 | 1 + original/man3/strncpy.3 | 1 + original/man3/strndup.3 | 1 + original/man3/strndupa.3 | 1 + original/man3/strnlen.3 | 43 + original/man3/strpbrk.3 | 59 + original/man3/strptime.3 | 414 + original/man3/strrchr.3 | 1 + original/man3/strsep.3 | 94 + original/man3/strsignal.3 | 69 + original/man3/strspn.3 | 75 + original/man3/strstr.3 | 85 + original/man3/strtod.3 | 175 + original/man3/strtof.3 | 1 + original/man3/strtoimax.3 | 64 + original/man3/strtok.3 | 205 + original/man3/strtok_r.3 | 1 + original/man3/strtol.3 | 260 + original/man3/strtold.3 | 1 + original/man3/strtoll.3 | 1 + original/man3/strtoq.3 | 1 + original/man3/strtoul.3 | 188 + original/man3/strtoull.3 | 1 + original/man3/strtoumax.3 | 1 + original/man3/strtouq.3 | 1 + original/man3/strverscmp.3 | 93 + original/man3/strxfrm.3 | 76 + original/man3/svc_destroy.3 | 1 + original/man3/svc_freeargs.3 | 1 + original/man3/svc_getargs.3 | 1 + original/man3/svc_getcaller.3 | 1 + original/man3/svc_getreq.3 | 1 + original/man3/svc_getreqset.3 | 1 + original/man3/svc_register.3 | 1 + original/man3/svc_run.3 | 1 + original/man3/svc_sendreply.3 | 1 + original/man3/svc_unregister.3 | 1 + original/man3/svcerr_auth.3 | 1 + original/man3/svcerr_decode.3 | 1 + original/man3/svcerr_noproc.3 | 1 + original/man3/svcerr_noprog.3 | 1 + original/man3/svcerr_progvers.3 | 1 + original/man3/svcerr_systemerr.3 | 1 + original/man3/svcerr_weakauth.3 | 1 + original/man3/svcfd_create.3 | 1 + original/man3/svcraw_create.3 | 1 + original/man3/svctcp_create.3 | 1 + original/man3/svcudp_bufcreate.3 | 1 + original/man3/svcudp_create.3 | 1 + original/man3/swab.3 | 60 + original/man3/swapcontext.3 | 1 + original/man3/swprintf.3 | 1 + original/man3/sys_errlist.3 | 1 + original/man3/sys_nerr.3 | 1 + original/man3/sysconf.3 | 340 + original/man3/syslog.3 | 312 + original/man3/system.3 | 151 + original/man3/sysv_signal.3 | 90 + original/man3/tan.3 | 140 + original/man3/tanf.3 | 1 + original/man3/tanh.3 | 103 + original/man3/tanhf.3 | 1 + original/man3/tanhl.3 | 1 + original/man3/tanl.3 | 1 + original/man3/tcdrain.3 | 1 + original/man3/tcflow.3 | 1 + original/man3/tcflush.3 | 1 + original/man3/tcgetattr.3 | 1 + original/man3/tcgetpgrp.3 | 118 + original/man3/tcgetsid.3 | 72 + original/man3/tcsendbreak.3 | 1 + original/man3/tcsetattr.3 | 1 + original/man3/tcsetpgrp.3 | 1 + original/man3/tdelete.3 | 1 + original/man3/tdestroy.3 | 1 + original/man3/telldir.3 | 78 + original/man3/tempnam.3 | 168 + original/man3/termios.3 | 970 ++ original/man3/tfind.3 | 1 + original/man3/tgamma.3 | 176 + original/man3/tgammaf.3 | 1 + original/man3/tgammal.3 | 1 + original/man3/timegm.3 | 101 + original/man3/timelocal.3 | 1 + original/man3/timeradd.3 | 150 + original/man3/timerclear.3 | 1 + original/man3/timercmp.3 | 1 + original/man3/timerisset.3 | 1 + original/man3/timersub.3 | 1 + original/man3/timezone.3 | 1 + original/man3/tmpfile.3 | 91 + original/man3/tmpnam.3 | 153 + original/man3/tmpnam_r.3 | 1 + original/man3/toascii.3 | 63 + original/man3/tolower.3 | 1 + original/man3/toupper.3 | 76 + original/man3/towctrans.3 | 51 + original/man3/towlower.3 | 53 + original/man3/towupper.3 | 53 + original/man3/trunc.3 | 79 + original/man3/truncf.3 | 1 + original/man3/truncl.3 | 1 + original/man3/tsearch.3 | 263 + original/man3/ttyname.3 | 77 + original/man3/ttyname_r.3 | 1 + original/man3/ttyslot.3 | 143 + original/man3/twalk.3 | 1 + original/man3/tzname.3 | 1 + original/man3/tzset.3 | 235 + original/man3/ualarm.3 | 124 + original/man3/ulckpwdf.3 | 1 + original/man3/ulimit.3 | 87 + original/man3/undocumented.3 | 190 + original/man3/ungetc.3 | 1 + original/man3/ungetwc.3 | 63 + original/man3/unlocked_stdio.3 | 131 + original/man3/unlockpt.3 | 53 + original/man3/unsetenv.3 | 1 + original/man3/updwtmp.3 | 83 + original/man3/updwtmpx.3 | 1 + original/man3/usleep.3 | 126 + original/man3/utmpname.3 | 1 + original/man3/utmpxname.3 | 1 + original/man3/va_arg.3 | 1 + original/man3/va_copy.3 | 1 + original/man3/va_end.3 | 1 + original/man3/va_start.3 | 1 + original/man3/valloc.3 | 1 + original/man3/vasprintf.3 | 1 + original/man3/vdprintf.3 | 1 + original/man3/verr.3 | 1 + original/man3/verrx.3 | 1 + original/man3/versionsort.3 | 1 + original/man3/vfprintf.3 | 1 + original/man3/vfscanf.3 | 1 + original/man3/vfwprintf.3 | 1 + original/man3/vprintf.3 | 1 + original/man3/vscanf.3 | 1 + original/man3/vsnprintf.3 | 1 + original/man3/vsprintf.3 | 1 + original/man3/vsscanf.3 | 1 + original/man3/vswprintf.3 | 1 + original/man3/vsyslog.3 | 1 + original/man3/vwarn.3 | 1 + original/man3/vwarnx.3 | 1 + original/man3/vwprintf.3 | 1 + original/man3/warn.3 | 1 + original/man3/warnx.3 | 1 + original/man3/wcpcpy.3 | 48 + original/man3/wcpncpy.3 | 58 + original/man3/wcrtomb.3 | 84 + original/man3/wcscasecmp.3 | 57 + original/man3/wcscat.3 | 47 + original/man3/wcschr.3 | 45 + original/man3/wcscmp.3 | 48 + original/man3/wcscpy.3 | 49 + original/man3/wcscspn.3 | 53 + original/man3/wcsdup.3 | 57 + original/man3/wcslen.3 | 40 + original/man3/wcsncasecmp.3 | 60 + original/man3/wcsncat.3 | 44 + original/man3/wcsncmp.3 | 50 + original/man3/wcsncpy.3 | 53 + original/man3/wcsnlen.3 | 47 + original/man3/wcsnrtombs.3 | 109 + original/man3/wcspbrk.3 | 46 + original/man3/wcsrchr.3 | 42 + original/man3/wcsrtombs.3 | 104 + original/man3/wcsspn.3 | 51 + original/man3/wcsstr.3 | 47 + original/man3/wcstoimax.3 | 57 + original/man3/wcstok.3 | 80 + original/man3/wcstombs.3 | 83 + original/man3/wcstoumax.3 | 1 + original/man3/wcswidth.3 | 49 + original/man3/wctob.3 | 61 + original/man3/wctomb.3 | 82 + original/man3/wctrans.3 | 63 + original/man3/wctype.3 | 74 + original/man3/wcwidth.3 | 55 + original/man3/wmemchr.3 | 41 + original/man3/wmemcmp.3 | 48 + original/man3/wmemcpy.3 | 48 + original/man3/wmemmove.3 | 43 + original/man3/wmempcpy.3 | 1 + original/man3/wmemset.3 | 37 + original/man3/wordexp.3 | 214 + original/man3/wordfree.3 | 1 + original/man3/wprintf.3 | 227 + original/man3/xcrypt.3 | 69 + original/man3/xdecrypt.3 | 1 + original/man3/xdr.3 | 550 + original/man3/xdr_accepted_reply.3 | 1 + original/man3/xdr_array.3 | 1 + original/man3/xdr_authunix_parms.3 | 1 + original/man3/xdr_bool.3 | 1 + original/man3/xdr_bytes.3 | 1 + original/man3/xdr_callhdr.3 | 1 + original/man3/xdr_callmsg.3 | 1 + original/man3/xdr_char.3 | 1 + original/man3/xdr_destroy.3 | 1 + original/man3/xdr_double.3 | 1 + original/man3/xdr_enum.3 | 1 + original/man3/xdr_float.3 | 1 + original/man3/xdr_free.3 | 1 + original/man3/xdr_getpos.3 | 1 + original/man3/xdr_inline.3 | 1 + original/man3/xdr_int.3 | 1 + original/man3/xdr_long.3 | 1 + original/man3/xdr_opaque.3 | 1 + original/man3/xdr_opaque_auth.3 | 1 + original/man3/xdr_pmap.3 | 1 + original/man3/xdr_pmaplist.3 | 1 + original/man3/xdr_pointer.3 | 1 + original/man3/xdr_reference.3 | 1 + original/man3/xdr_rejected_reply.3 | 1 + original/man3/xdr_replymsg.3 | 1 + original/man3/xdr_setpos.3 | 1 + original/man3/xdr_short.3 | 1 + original/man3/xdr_string.3 | 1 + original/man3/xdr_u_char.3 | 1 + original/man3/xdr_u_int.3 | 1 + original/man3/xdr_u_long.3 | 1 + original/man3/xdr_u_short.3 | 1 + original/man3/xdr_union.3 | 1 + original/man3/xdr_vector.3 | 1 + original/man3/xdr_void.3 | 1 + original/man3/xdr_wrapstring.3 | 1 + original/man3/xdrmem_create.3 | 1 + original/man3/xdrrec_create.3 | 1 + original/man3/xdrrec_endofrecord.3 | 1 + original/man3/xdrrec_eof.3 | 1 + original/man3/xdrrec_skiprecord.3 | 1 + original/man3/xdrstdio_create.3 | 1 + original/man3/xencrypt.3 | 1 + original/man3/xprt_register.3 | 1 + original/man3/xprt_unregister.3 | 1 + original/man3/y0.3 | 235 + original/man3/y0f.3 | 1 + original/man3/y0l.3 | 1 + original/man3/y1.3 | 1 + original/man3/y1f.3 | 1 + original/man3/y1l.3 | 1 + original/man3/yn.3 | 1 + original/man3/ynf.3 | 1 + original/man3/ynl.3 | 1 + original/man4/console.4 | 93 + original/man4/console_codes.4 | 638 ++ original/man4/console_ioctl.4 | 638 ++ original/man4/cpuid.4 | 93 + original/man4/dsp56k.4 | 118 + original/man4/epoll.4 | 2 + original/man4/fd.4 | 215 + original/man4/fifo.4 | 2 + original/man4/full.4 | 54 + original/man4/futex.4 | 2 + original/man4/hd.4 | 100 + original/man4/initrd.4 | 483 + original/man4/intro.4 | 38 + original/man4/kmem.4 | 1 + original/man4/lp.4 | 127 + original/man4/mem.4 | 84 + original/man4/mouse.4 | 154 + original/man4/msr.4 | 56 + original/man4/null.4 | 55 + original/man4/port.4 | 1 + original/man4/ptmx.4 | 1 + original/man4/pts.4 | 72 + original/man4/ram.4 | 43 + original/man4/random.4 | 219 + original/man4/rtc.4 | 340 + original/man4/sd.4 | 135 + original/man4/sk98lin.4 | 605 ++ original/man4/st.4 | 959 ++ original/man4/tty.4 | 74 + original/man4/ttyS.4 | 52 + original/man4/tty_ioctl.4 | 492 + original/man4/urandom.4 | 1 + original/man4/vcs.4 | 154 + original/man4/vcsa.4 | 1 + original/man4/wavelan.4 | 166 + original/man4/zero.4 | 1 + original/man5/acct.5 | 177 + original/man5/charmap.5 | 129 + original/man5/complex.5 | 2 + original/man5/core.5 | 382 + original/man5/dir_colors.5 | 363 + original/man5/elf.5 | 1878 ++++ original/man5/environ.5 | 2 + original/man5/filesystems.5 | 184 + original/man5/fs.5 | 1 + original/man5/ftpusers.5 | 50 + original/man5/group.5 | 59 + original/man5/host.conf.5 | 203 + original/man5/hosts.5 | 124 + original/man5/hosts.equiv.5 | 65 + original/man5/intro.5 | 38 + original/man5/ipc.5 | 1 + original/man5/issue.5 | 41 + original/man5/locale.5 | 617 ++ original/man5/motd.5 | 41 + original/man5/networks.5 | 78 + original/man5/nologin.5 | 39 + original/man5/nscd.conf.5 | 190 + original/man5/nsswitch.conf.5 | 285 + original/man5/numa_maps.5 | 5 + original/man5/passwd.5 | 142 + original/man5/proc.5 | 2608 +++++ original/man5/protocols.5 | 83 + original/man5/resolv.conf.5 | 263 + original/man5/resolver.5 | 1 + original/man5/rpc.5 | 76 + original/man5/securetty.5 | 44 + original/man5/services.5 | 220 + original/man5/shells.5 | 54 + original/man5/slabinfo.5 | 123 + original/man5/termcap.5 | 472 + original/man5/ttytype.5 | 68 + original/man5/tzfile.5 | 134 + original/man5/utmp.5 | 349 + original/man5/utmpx.5 | 1 + original/man5/wtmp.5 | 1 + original/man6/intro.6 | 35 + original/man7/armscii-8.7 | 141 + original/man7/arp.7 | 308 + original/man7/ascii.7 | 199 + original/man7/boot.7 | 205 + original/man7/bootparam.7 | 1306 +++ original/man7/capabilities.7 | 924 ++ original/man7/charsets.7 | 362 + original/man7/complex.7 | 57 + original/man7/cp1251.7 | 175 + original/man7/cpuset.7 | 1503 +++ original/man7/credentials.7 | 280 + original/man7/ddp.7 | 248 + original/man7/environ.7 | 240 + original/man7/epoll.7 | 546 + original/man7/feature_test_macros.7 | 584 ++ original/man7/fifo.7 | 70 + original/man7/futex.7 | 118 + original/man7/glibc.7 | 1 + original/man7/glob.7 | 209 + original/man7/hier.7 | 503 + original/man7/hostname.7 | 94 + original/man7/icmp.7 | 188 + original/man7/inotify.7 | 404 + original/man7/intro.7 | 41 + original/man7/ip.7 | 1039 ++ original/man7/ipv6.7 | 327 + original/man7/iso-8859-1.7 | 1 + original/man7/iso-8859-10.7 | 1 + original/man7/iso-8859-11.7 | 1 + original/man7/iso-8859-13.7 | 1 + original/man7/iso-8859-14.7 | 1 + original/man7/iso-8859-15.7 | 1 + original/man7/iso-8859-16.7 | 1 + original/man7/iso-8859-2.7 | 1 + original/man7/iso-8859-3.7 | 1 + original/man7/iso-8859-4.7 | 1 + original/man7/iso-8859-5.7 | 1 + original/man7/iso-8859-6.7 | 1 + original/man7/iso-8859-7.7 | 1 + original/man7/iso-8859-8.7 | 1 + original/man7/iso-8859-9.7 | 1 + original/man7/iso_8859-1.7 | 176 + original/man7/iso_8859-10.7 | 166 + original/man7/iso_8859-11.7 | 160 + original/man7/iso_8859-13.7 | 164 + original/man7/iso_8859-14.7 | 162 + original/man7/iso_8859-15.7 | 176 + original/man7/iso_8859-16.7 | 178 + original/man7/iso_8859-2.7 | 180 + original/man7/iso_8859-3.7 | 158 + original/man7/iso_8859-4.7 | 161 + original/man7/iso_8859-5.7 | 161 + original/man7/iso_8859-6.7 | 118 + original/man7/iso_8859-7.7 | 161 + original/man7/iso_8859-8.7 | 132 + original/man7/iso_8859-9.7 | 162 + original/man7/iso_8859_1.7 | 1 + original/man7/iso_8859_10.7 | 1 + original/man7/iso_8859_11.7 | 1 + original/man7/iso_8859_13.7 | 1 + original/man7/iso_8859_14.7 | 1 + original/man7/iso_8859_15.7 | 1 + original/man7/iso_8859_16.7 | 1 + original/man7/iso_8859_2.7 | 1 + original/man7/iso_8859_3.7 | 1 + original/man7/iso_8859_4.7 | 1 + original/man7/iso_8859_5.7 | 1 + original/man7/iso_8859_6.7 | 1 + original/man7/iso_8859_7.7 | 1 + original/man7/iso_8859_8.7 | 1 + original/man7/iso_8859_9.7 | 1 + original/man7/koi8-r.7 | 194 + original/man7/koi8-u.7 | 183 + original/man7/latin1.7 | 1 + original/man7/latin10.7 | 1 + original/man7/latin2.7 | 1 + original/man7/latin3.7 | 1 + original/man7/latin4.7 | 1 + original/man7/latin5.7 | 1 + original/man7/latin6.7 | 1 + original/man7/latin7.7 | 1 + original/man7/latin8.7 | 1 + original/man7/latin9.7 | 1 + original/man7/libc.7 | 100 + original/man7/locale.7 | 220 + original/man7/mailaddr.7 | 125 + original/man7/man-pages.7 | 551 + original/man7/man.7 | 561 + original/man7/math_error.7 | 264 + original/man7/mdoc.7 | 438 + original/man7/mdoc.samples.7 | 2953 ++++++ original/man7/mq_overview.7 | 293 + original/man7/netdevice.7 | 280 + original/man7/netlink.7 | 460 + original/man7/numa.7 | 187 + original/man7/operator.7 | 62 + original/man7/packet.7 | 402 + original/man7/path_resolution.7 | 233 + original/man7/pipe.7 | 243 + original/man7/posixoptions.7 | 855 ++ original/man7/pthreads.7 | 907 ++ original/man7/pty.7 | 159 + original/man7/raw.7 | 278 + original/man7/regex.7 | 288 + original/man7/rtld-audit.7 | 604 ++ original/man7/rtnetlink.7 | 449 + original/man7/sem_overview.7 | 161 + original/man7/shm_overview.7 | 126 + original/man7/signal.7 | 875 ++ original/man7/socket.7 | 738 ++ original/man7/spufs.7 | 770 ++ original/man7/standards.7 | 256 + original/man7/suffixes.7 | 281 + original/man7/svipc.7 | 333 + original/man7/symlink.7 | 487 + original/man7/tcp.7 | 1135 ++ original/man7/termio.7 | 59 + original/man7/time.7 | 203 + original/man7/tis-620.7 | 1 + original/man7/udp.7 | 243 + original/man7/udplite.7 | 152 + original/man7/unicode.7 | 309 + original/man7/units.7 | 127 + original/man7/unix.7 | 375 + original/man7/uri.7 | 706 ++ original/man7/url.7 | 1 + original/man7/urn.7 | 1 + original/man7/utf-8.7 | 298 + original/man7/utf8.7 | 1 + original/man7/x25.7 | 122 + original/man8/intro.8 | 47 + original/man8/ld-linux.8 | 1 + original/man8/ld-linux.so.8 | 1 + original/man8/ld.so.8 | 379 + original/man8/ldconfig.8 | 177 + original/man8/nscd.8 | 90 + original/man8/sync.8 | 84 + original/man8/tzselect.8 | 48 + original/man8/zdump.8 | 42 + original/man8/zic.8 | 417 + release/man1/intro.1 | 294 + release/man1/ldd.1 | 83 + release/man1/time.1 | 311 + release/man2/_exit.2 | 141 + release/man2/_syscall.2 | 167 + release/man2/accept.2 | 415 + release/man2/access.2 | 276 + release/man2/acct.2 | 160 + release/man2/adjtimex.2 | 170 + release/man2/alarm.2 | 99 + release/man2/alloc_hugepages.2 | 164 + release/man2/arch_prctl.2 | 152 + release/man2/bdflush.2 | 121 + release/man2/bind.2 | 343 + release/man2/brk.2 | 176 + release/man2/cacheflush.2 | 97 + release/man2/capget.2 | 251 + release/man2/chdir.2 | 142 + release/man2/chmod.2 | 238 + release/man2/chown.2 | 329 + release/man2/chroot.2 | 144 + release/man2/clock_getres.2 | 244 + release/man2/clock_nanosleep.2 | 245 + release/man2/clone.2 | 1018 ++ release/man2/close.2 | 151 + release/man2/connect.2 | 284 + release/man2/create_module.2 | 64 + release/man2/delete_module.2 | 57 + release/man2/dup.2 | 228 + release/man2/epoll_create.2 | 138 + release/man2/epoll_ctl.2 | 268 + release/man2/epoll_wait.2 | 195 + release/man2/eventfd.2 | 406 + release/man2/execve.2 | 655 ++ release/man2/exit_group.2 | 55 + release/man2/faccessat.2 | 159 + release/man2/fallocate.2 | 144 + release/man2/fchmodat.2 | 142 + release/man2/fchownat.2 | 141 + release/man2/fcntl.2 | 1251 +++ release/man2/flock.2 | 221 + release/man2/fork.2 | 250 + release/man2/fstatat.2 | 142 + release/man2/fsync.2 | 202 + release/man2/futex.2 | 282 + release/man2/futimesat.2 | 137 + release/man2/get_kernel_syms.2 | 84 + release/man2/get_mempolicy.2 | 258 + release/man2/get_thread_area.2 | 61 + release/man2/getcontext.2 | 176 + release/man2/getdents.2 | 283 + release/man2/getdomainname.2 | 137 + release/man2/getdtablesize.2 | 89 + release/man2/getgid.2 | 55 + release/man2/getgroups.2 | 176 + release/man2/gethostname.2 | 195 + release/man2/getitimer.2 | 230 + release/man2/getpagesize.2 | 112 + release/man2/getpeername.2 | 135 + release/man2/getpid.2 | 114 + release/man2/getpriority.2 | 239 + release/man2/getresuid.2 | 89 + release/man2/getrlimit.2 | 527 + release/man2/getrusage.2 | 189 + release/man2/getsid.2 | 89 + release/man2/getsockname.2 | 122 + release/man2/getsockopt.2 | 212 + release/man2/gettid.2 | 79 + release/man2/gettimeofday.2 | 255 + release/man2/getuid.2 | 71 + release/man2/getxattr.2 | 165 + release/man2/idle.2 | 78 + release/man2/init_module.2 | 102 + release/man2/inotify_add_watch.2 | 120 + release/man2/inotify_init.2 | 110 + release/man2/inotify_rm_watch.2 | 87 + release/man2/intro.2 | 90 + release/man2/io_cancel.2 | 107 + release/man2/io_destroy.2 | 98 + release/man2/io_getevents.2 | 118 + release/man2/io_setup.2 | 109 + release/man2/io_submit.2 | 109 + release/man2/ioctl.2 | 163 + release/man2/ioctl_list.2 | 876 ++ release/man2/ioperm.2 | 120 + release/man2/iopl.2 | 109 + release/man2/ioprio_set.2 | 309 + release/man2/ipc.2 | 87 + release/man2/kill.2 | 196 + release/man2/killpg.2 | 148 + release/man2/link.2 | 209 + release/man2/linkat.2 | 160 + release/man2/listen.2 | 183 + release/man2/listxattr.2 | 176 + release/man2/llseek.2 | 100 + release/man2/lookup_dcookie.2 | 99 + release/man2/lseek.2 | 174 + release/man2/madvise.2 | 239 + release/man2/mbind.2 | 448 + release/man2/mincore.2 | 179 + release/man2/mkdir.2 | 155 + release/man2/mkdirat.2 | 120 + release/man2/mknod.2 | 239 + release/man2/mknodat.2 | 122 + release/man2/mlock.2 | 328 + release/man2/mmap.2 | 687 ++ release/man2/mmap2.2 | 106 + release/man2/modify_ldt.2 | 147 + release/man2/mount.2 | 491 + release/man2/move_pages.2 | 230 + release/man2/mprotect.2 | 236 + release/man2/mq_getsetattr.2 | 60 + release/man2/mremap.2 | 226 + release/man2/msgctl.2 | 353 + release/man2/msgget.2 | 248 + release/man2/msgop.2 | 446 + release/man2/msync.2 | 129 + release/man2/nanosleep.2 | 238 + release/man2/nfsservctl.2 | 59 + release/man2/nice.2 | 126 + release/man2/open.2 | 920 ++ release/man2/openat.2 | 173 + release/man2/outb.2 | 79 + release/man2/pause.2 | 68 + release/man2/pciconfig_read.2 | 119 + release/man2/personality.2 | 79 + release/man2/pipe.2 | 208 + release/man2/pivot_root.2 | 173 + release/man2/poll.2 | 336 + release/man2/posix_fadvise.2 | 157 + release/man2/prctl.2 | 449 + release/man2/pread.2 | 114 + release/man2/ptrace.2 | 564 + release/man2/query_module.2 | 180 + release/man2/quotactl.2 | 243 + release/man2/read.2 | 209 + release/man2/readahead.2 | 99 + release/man2/readdir.2 | 135 + release/man2/readlink.2 | 156 + release/man2/readlinkat.2 | 124 + release/man2/readv.2 | 237 + release/man2/reboot.2 | 191 + release/man2/recv.2 | 525 + release/man2/remap_file_pages.2 | 155 + release/man2/removexattr.2 | 134 + release/man2/rename.2 | 268 + release/man2/renameat.2 | 136 + release/man2/rmdir.2 | 163 + release/man2/sched_get_priority_max.2 | 123 + release/man2/sched_rr_get_interval.2 | 136 + release/man2/sched_setaffinity.2 | 266 + release/man2/sched_setparam.2 | 139 + release/man2/sched_setscheduler.2 | 490 + release/man2/sched_yield.2 | 98 + release/man2/select.2 | 560 + release/man2/select_tut.2 | 840 ++ release/man2/semctl.2 | 523 + release/man2/semget.2 | 310 + release/man2/semop.2 | 550 + release/man2/send.2 | 447 + release/man2/sendfile.2 | 190 + release/man2/set_mempolicy.2 | 301 + release/man2/set_thread_area.2 | 70 + release/man2/set_tid_address.2 | 104 + release/man2/seteuid.2 | 138 + release/man2/setfsgid.2 | 118 + release/man2/setfsuid.2 | 117 + release/man2/setgid.2 | 81 + release/man2/setpgid.2 | 325 + release/man2/setresuid.2 | 114 + release/man2/setreuid.2 | 155 + release/man2/setsid.2 | 99 + release/man2/setuid.2 | 133 + release/man2/setup.2 | 91 + release/man2/setxattr.2 | 175 + release/man2/sgetmask.2 | 82 + release/man2/shmctl.2 | 433 + release/man2/shmget.2 | 326 + release/man2/shmop.2 | 311 + release/man2/shutdown.2 | 103 + release/man2/sigaction.2 | 726 ++ release/man2/sigaltstack.2 | 242 + release/man2/sigblock.2 | 116 + release/man2/signal.2 | 317 + release/man2/signalfd.2 | 453 + release/man2/sigpause.2 | 97 + release/man2/sigpending.2 | 96 + release/man2/sigprocmask.2 | 147 + release/man2/sigqueue.2 | 168 + release/man2/sigreturn.2 | 83 + release/man2/sigsuspend.2 | 118 + release/man2/sigvec.2 | 61 + release/man2/sigwaitinfo.2 | 197 + release/man2/socket.2 | 444 + release/man2/socketcall.2 | 84 + release/man2/socketpair.2 | 145 + release/man2/splice.2 | 232 + release/man2/spu_create.2 | 167 + release/man2/spu_run.2 | 259 + release/man2/stat.2 | 643 ++ release/man2/statfs.2 | 283 + release/man2/statvfs.2 | 194 + release/man2/stime.2 | 85 + release/man2/swapon.2 | 192 + release/man2/symlink.2 | 181 + release/man2/symlinkat.2 | 122 + release/man2/sync.2 | 90 + release/man2/sync_file_range.2 | 190 + release/man2/syscall.2 | 90 + release/man2/syscalls.2 | 801 ++ release/man2/sysctl.2 | 179 + release/man2/sysfs.2 | 116 + release/man2/sysinfo.2 | 104 + release/man2/syslog.2 | 268 + release/man2/tee.2 | 209 + release/man2/time.2 | 86 + release/man2/timerfd_create.2 | 543 + release/man2/times.2 | 224 + release/man2/tkill.2 | 116 + release/man2/truncate.2 | 233 + release/man2/umask.2 | 130 + release/man2/umount.2 | 182 + release/man2/uname.2 | 167 + release/man2/unimplemented.2 | 68 + release/man2/unlink.2 | 180 + release/man2/unlinkat.2 | 158 + release/man2/unshare.2 | 188 + release/man2/uselib.2 | 115 + release/man2/ustat.2 | 129 + release/man2/utime.2 | 187 + release/man2/vfork.2 | 216 + release/man2/vhangup.2 | 78 + release/man2/vm86.2 | 82 + release/man2/vmsplice.2 | 162 + release/man2/wait.2 | 644 ++ release/man2/wait4.2 | 159 + release/man2/write.2 | 251 + release/man3/INFINITY.3 | 97 + release/man3/MB_CUR_MAX.3 | 47 + release/man3/MB_LEN_MAX.3 | 47 + release/man3/__setfpucw.3 | 73 + release/man3/a64l.3 | 85 + release/man3/abort.3 | 82 + release/man3/abs.3 | 118 + release/man3/acos.3 | 117 + release/man3/acosh.3 | 122 + release/man3/addseverity.3 | 80 + release/man3/adjtime.3 | 137 + release/man3/aio_cancel.3 | 95 + release/man3/aio_error.3 | 73 + release/man3/aio_fsync.3 | 100 + release/man3/aio_read.3 | 128 + release/man3/aio_return.3 | 71 + release/man3/aio_suspend.3 | 92 + release/man3/aio_write.3 | 130 + release/man3/alloca.3 | 158 + release/man3/argz_add.3 | 214 + release/man3/asin.3 | 118 + release/man3/asinh.3 | 107 + release/man3/asprintf.3 | 73 + release/man3/assert.3 | 84 + release/man3/assert_perror.3 | 78 + release/man3/atan.3 | 106 + release/man3/atan2.3 | 167 + release/man3/atanh.3 | 154 + release/man3/atexit.3 | 162 + release/man3/atof.3 | 67 + release/man3/atoi.3 | 115 + release/man3/backtrace.3 | 254 + release/man3/basename.3 | 181 + release/man3/bcmp.3 | 76 + release/man3/bcopy.3 | 78 + release/man3/bindresvport.3 | 110 + release/man3/bsd_signal.3 | 105 + release/man3/bsearch.3 | 121 + release/man3/bstring.3 | 92 + release/man3/btowc.3 | 69 + release/man3/btree.3 | 238 + release/man3/byteorder.3 | 80 + release/man3/bzero.3 | 68 + release/man3/cabs.3 | 44 + release/man3/cacos.3 | 49 + release/man3/cacosh.3 | 54 + release/man3/canonicalize_file_name.3 | 26 + release/man3/carg.3 | 62 + release/man3/casin.3 | 49 + release/man3/casinh.3 | 51 + release/man3/catan.3 | 49 + release/man3/catanh.3 | 51 + release/man3/catgets.3 | 91 + release/man3/catopen.3 | 193 + release/man3/cbrt.3 | 95 + release/man3/ccos.3 | 40 + release/man3/ccosh.3 | 42 + release/man3/ceil.3 | 119 + release/man3/cerf.3 | 47 + release/man3/cexp.3 | 42 + release/man3/cexp2.3 | 35 + release/man3/cfree.3 | 130 + release/man3/cimag.3 | 46 + release/man3/clearenv.3 | 107 + release/man3/clock.3 | 97 + release/man3/clog.3 | 54 + release/man3/clog10.3 | 53 + release/man3/clog2.3 | 51 + release/man3/closedir.3 | 80 + release/man3/cmsg.3 | 226 + release/man3/confstr.3 | 149 + release/man3/conj.3 | 42 + release/man3/copysign.3 | 90 + release/man3/cos.3 | 119 + release/man3/cosh.3 | 130 + release/man3/cpow.3 | 39 + release/man3/cproj.3 | 45 + release/man3/creal.3 | 46 + release/man3/crypt.3 | 232 + release/man3/csin.3 | 40 + release/man3/csinh.3 | 41 + release/man3/csqrt.3 | 40 + release/man3/ctan.3 | 40 + release/man3/ctanh.3 | 41 + release/man3/ctermid.3 | 72 + release/man3/ctime.3 | 366 + release/man3/daemon.3 | 109 + release/man3/dbopen.3 | 543 + release/man3/des_crypt.3 | 134 + release/man3/difftime.3 | 80 + release/man3/dirfd.3 | 100 + release/man3/div.3 | 102 + release/man3/dl_iterate_phdr.3 | 200 + release/man3/dlopen.3 | 537 + release/man3/dprintf.3 | 86 + release/man3/drand48.3 | 215 + release/man3/drand48_r.3 | 107 + release/man3/dysize.3 | 61 + release/man3/ecvt.3 | 118 + release/man3/ecvt_r.3 | 99 + release/man3/encrypt.3 | 168 + release/man3/end.3 | 113 + release/man3/envz_add.3 | 142 + release/man3/erf.3 | 125 + release/man3/erfc.3 | 123 + release/man3/err.3 | 162 + release/man3/errno.3 | 542 + release/man3/error.3 | 138 + release/man3/ether_aton.3 | 139 + release/man3/euidaccess.3 | 95 + release/man3/exec.3 | 216 + release/man3/exit.3 | 174 + release/man3/exp.3 | 128 + release/man3/exp10.3 | 88 + release/man3/exp2.3 | 99 + release/man3/expm1.3 | 148 + release/man3/fabs.3 | 96 + release/man3/fclose.3 | 114 + release/man3/fcloseall.3 | 67 + release/man3/fdim.3 | 80 + release/man3/fenv.3 | 336 + release/man3/ferror.3 | 129 + release/man3/fexecve.3 | 94 + release/man3/fflush.3 | 128 + release/man3/ffs.3 | 82 + release/man3/fgetgrent.3 | 102 + release/man3/fgetpwent.3 | 111 + release/man3/fgetwc.3 | 88 + release/man3/fgetws.3 | 72 + release/man3/finite.3 | 120 + release/man3/flockfile.3 | 126 + release/man3/floor.3 | 113 + release/man3/fma.3 | 146 + release/man3/fmax.3 | 63 + release/man3/fmemopen.3 | 260 + release/man3/fmin.3 | 63 + release/man3/fmod.3 | 138 + release/man3/fmtmsg.3 | 297 + release/man3/fnmatch.3 | 110 + release/man3/fopen.3 | 326 + release/man3/fpathconf.3 | 175 + release/man3/fpclassify.3 | 125 + release/man3/fpurge.3 | 83 + release/man3/fputwc.3 | 84 + release/man3/fputws.3 | 59 + release/man3/fread.3 | 115 + release/man3/frexp.3 | 130 + release/man3/fseek.3 | 179 + release/man3/fseeko.3 | 86 + release/man3/ftime.3 | 113 + release/man3/ftok.3 | 110 + release/man3/fts.3 | 751 ++ release/man3/ftw.3 | 465 + release/man3/futimes.3 | 104 + release/man3/fwide.3 | 85 + release/man3/gamma.3 | 108 + release/man3/gcvt.3 | 81 + release/man3/getaddrinfo.3 | 844 ++ release/man3/getcwd.3 | 254 + release/man3/getdate.3 | 295 + release/man3/getdirentries.3 | 76 + release/man3/getenv.3 | 86 + release/man3/getfsent.3 | 138 + release/man3/getgrent.3 | 150 + release/man3/getgrent_r.3 | 196 + release/man3/getgrnam.3 | 240 + release/man3/getgrouplist.3 | 206 + release/man3/gethostbyname.3 | 462 + release/man3/gethostid.3 | 131 + release/man3/getipnodebyname.3 | 263 + release/man3/getline.3 | 178 + release/man3/getloadavg.3 | 74 + release/man3/getlogin.3 | 200 + release/man3/getmntent.3 | 193 + release/man3/getnameinfo.3 | 299 + release/man3/getnetent.3 | 136 + release/man3/getopt.3 | 526 + release/man3/getpass.3 | 139 + release/man3/getprotoent.3 | 124 + release/man3/getpt.3 | 60 + release/man3/getpw.3 | 114 + release/man3/getpwent.3 | 155 + release/man3/getpwent_r.3 | 195 + release/man3/getpwnam.3 | 318 + release/man3/getrpcent.3 | 104 + release/man3/getrpcport.3 | 40 + release/man3/gets.3 | 192 + release/man3/getservent.3 | 137 + release/man3/getspnam.3 | 248 + release/man3/getsubopt.3 | 219 + release/man3/getttyent.3 | 84 + release/man3/getumask.3 | 66 + release/man3/getusershell.3 | 85 + release/man3/getutent.3 | 289 + release/man3/getw.3 | 72 + release/man3/getwchar.3 | 64 + release/man3/glob.3 | 323 + release/man3/gnu_get_libc_version.3 | 79 + release/man3/grantpt.3 | 76 + release/man3/gsignal.3 | 111 + release/man3/hash.3 | 174 + release/man3/hsearch.3 | 352 + release/man3/hypot.3 | 158 + release/man3/iconv.3 | 136 + release/man3/iconv_close.3 | 50 + release/man3/iconv_open.3 | 97 + release/man3/ilogb.3 | 142 + release/man3/index.3 | 82 + release/man3/inet.3 | 304 + release/man3/inet_ntop.3 | 137 + release/man3/inet_pton.3 | 229 + release/man3/infnan.3 | 80 + release/man3/initgroups.3 | 89 + release/man3/insque.3 | 95 + release/man3/intro.3 | 96 + release/man3/isalpha.3 | 206 + release/man3/isatty.3 | 68 + release/man3/isgreater.3 | 101 + release/man3/iswalnum.3 | 68 + release/man3/iswalpha.3 | 70 + release/man3/iswblank.3 | 71 + release/man3/iswcntrl.3 | 55 + release/man3/iswctype.3 | 66 + release/man3/iswdigit.3 | 70 + release/man3/iswgraph.3 | 67 + release/man3/iswlower.3 | 77 + release/man3/iswprint.3 | 52 + release/man3/iswpunct.3 | 67 + release/man3/iswspace.3 | 61 + release/man3/iswupper.3 | 75 + release/man3/iswxdigit.3 | 66 + release/man3/j0.3 | 153 + release/man3/key_setsecret.3 | 70 + release/man3/ldexp.3 | 135 + release/man3/lgamma.3 | 163 + release/man3/localeconv.3 | 71 + release/man3/lockf.3 | 178 + release/man3/log.3 | 135 + release/man3/log10.3 | 96 + release/man3/log1p.3 | 135 + release/man3/log2.3 | 99 + release/man3/logb.3 | 138 + release/man3/login.3 | 134 + release/man3/longjmp.3 | 137 + release/man3/lrint.3 | 116 + release/man3/lround.3 | 120 + release/man3/lsearch.3 | 95 + release/man3/lseek64.3 | 168 + release/man3/makecontext.3 | 229 + release/man3/malloc.3 | 277 + release/man3/malloc_hook.3 | 138 + release/man3/mblen.3 | 76 + release/man3/mbrlen.3 | 74 + release/man3/mbrtowc.3 | 105 + release/man3/mbsinit.3 | 86 + release/man3/mbsnrtowcs.3 | 92 + release/man3/mbsrtowcs.3 | 86 + release/man3/mbstowcs.3 | 76 + release/man3/mbtowc.3 | 86 + release/man3/memccpy.3 | 63 + release/man3/memchr.3 | 141 + release/man3/memcmp.3 | 64 + release/man3/memcpy.3 | 62 + release/man3/memfrob.3 | 62 + release/man3/memmem.3 | 72 + release/man3/memmove.3 | 69 + release/man3/mempcpy.3 | 78 + release/man3/memset.3 | 55 + release/man3/mkdtemp.3 | 88 + release/man3/mkfifo.3 | 116 + release/man3/mkfifoat.3 | 124 + release/man3/mkstemp.3 | 167 + release/man3/mktemp.3 | 111 + release/man3/modf.3 | 92 + release/man3/mpool.3 | 225 + release/man3/mq_close.3 | 75 + release/man3/mq_getattr.3 | 162 + release/man3/mq_notify.3 | 289 + release/man3/mq_open.3 | 232 + release/man3/mq_receive.3 | 173 + release/man3/mq_send.3 | 175 + release/man3/mq_unlink.3 | 77 + release/man3/mtrace.3 | 50 + release/man3/nan.3 | 81 + release/man3/netlink.3 | 100 + release/man3/nextafter.3 | 151 + release/man3/nl_langinfo.3 | 123 + release/man3/offsetof.3 | 105 + release/man3/on_exit.3 | 87 + release/man3/opendir.3 | 139 + release/man3/openpty.3 | 183 + release/man3/perror.3 | 146 + release/man3/popen.3 | 209 + release/man3/posix_fallocate.3 | 119 + release/man3/posix_memalign.3 | 243 + release/man3/posix_openpt.3 | 105 + release/man3/pow.3 | 316 + release/man3/pow10.3 | 58 + release/man3/printf.3 | 1014 ++ release/man3/profil.3 | 103 + release/man3/program_invocation_name.3 | 66 + release/man3/psignal.3 | 75 + release/man3/ptsname.3 | 106 + release/man3/putenv.3 | 118 + release/man3/putgrent.3 | 49 + release/man3/putpwent.3 | 91 + release/man3/puts.3 | 135 + release/man3/putwchar.3 | 66 + release/man3/qecvt.3 | 85 + release/man3/qsort.3 | 124 + release/man3/queue.3 | 489 + release/man3/raise.3 | 73 + release/man3/rand.3 | 166 + release/man3/random.3 | 172 + release/man3/random_r.3 | 131 + release/man3/rcmd.3 | 219 + release/man3/re_comp.3 | 81 + release/man3/readdir.3 | 268 + release/man3/realpath.3 | 215 + release/man3/recno.3 | 229 + release/man3/regex.3 | 312 + release/man3/remainder.3 | 198 + release/man3/remove.3 | 98 + release/man3/remquo.3 | 121 + release/man3/resolver.3 | 264 + release/man3/rewinddir.3 | 60 + release/man3/rexec.3 | 119 + release/man3/rint.3 | 134 + release/man3/round.3 | 119 + release/man3/rpc.3 | 1104 ++ release/man3/rpmatch.3 | 145 + release/man3/rtime.3 | 126 + release/man3/rtnetlink.3 | 129 + release/man3/scalb.3 | 184 + release/man3/scandir.3 | 195 + release/man3/scanf.3 | 739 ++ release/man3/sched_getcpu.3 | 88 + release/man3/seekdir.3 | 89 + release/man3/sem_close.3 | 70 + release/man3/sem_destroy.3 | 81 + release/man3/sem_getvalue.3 | 77 + release/man3/sem_init.3 | 104 + release/man3/sem_open.3 | 176 + release/man3/sem_post.3 | 76 + release/man3/sem_unlink.3 | 74 + release/man3/sem_wait.3 | 271 + release/man3/setaliasent.3 | 153 + release/man3/setbuf.3 | 207 + release/man3/setenv.3 | 136 + release/man3/setjmp.3 | 131 + release/man3/setlocale.3 | 207 + release/man3/setlogmask.3 | 80 + release/man3/setnetgrent.3 | 107 + release/man3/shm_open.3 | 288 + release/man3/siginterrupt.3 | 92 + release/man3/signbit.3 | 63 + release/man3/significand.3 | 56 + release/man3/sigpause.3 | 119 + release/man3/sigset.3 | 263 + release/man3/sigsetops.3 | 177 + release/man3/sigvec.3 | 256 + release/man3/sigwait.3 | 100 + release/man3/sin.3 | 120 + release/man3/sincos.3 | 84 + release/man3/sinh.3 | 130 + release/man3/sleep.3 | 71 + release/man3/sockatmark.3 | 139 + release/man3/sqrt.3 | 111 + release/man3/stdarg.3 | 303 + release/man3/stdin.3 | 147 + release/man3/stdio.3 | 276 + release/man3/stdio_ext.3 | 124 + release/man3/stpcpy.3 | 91 + release/man3/stpncpy.3 | 50 + release/man3/strcasecmp.3 | 70 + release/man3/strcat.3 | 111 + release/man3/strchr.3 | 106 + release/man3/strcmp.3 | 75 + release/man3/strcoll.3 | 70 + release/man3/strcpy.3 | 146 + release/man3/strdup.3 | 110 + release/man3/strerror.3 | 194 + release/man3/strfmon.3 | 184 + release/man3/strfry.3 | 58 + release/man3/strftime.3 | 537 + release/man3/string.3 | 122 + release/man3/strlen.3 | 55 + release/man3/strnlen.3 | 44 + release/man3/strpbrk.3 | 65 + release/man3/strptime.3 | 417 + release/man3/strsep.3 | 101 + release/man3/strsignal.3 | 75 + release/man3/strspn.3 | 72 + release/man3/strstr.3 | 89 + release/man3/strtod.3 | 177 + release/man3/strtoimax.3 | 70 + release/man3/strtok.3 | 208 + release/man3/strtol.3 | 269 + release/man3/strtoul.3 | 192 + release/man3/strverscmp.3 | 101 + release/man3/strxfrm.3 | 80 + release/man3/swab.3 | 64 + release/man3/sysconf.3 | 310 + release/man3/syslog.3 | 338 + release/man3/system.3 | 170 + release/man3/sysv_signal.3 | 96 + release/man3/tan.3 | 140 + release/man3/tanh.3 | 104 + release/man3/tcgetpgrp.3 | 129 + release/man3/tcgetsid.3 | 77 + release/man3/telldir.3 | 88 + release/man3/tempnam.3 | 185 + release/man3/termios.3 | 950 ++ release/man3/tgamma.3 | 179 + release/man3/timegm.3 | 104 + release/man3/timeradd.3 | 160 + release/man3/tmpfile.3 | 96 + release/man3/tmpnam.3 | 155 + release/man3/toascii.3 | 70 + release/man3/toupper.3 | 84 + release/man3/towctrans.3 | 53 + release/man3/towlower.3 | 53 + release/man3/towupper.3 | 52 + release/man3/trunc.3 | 86 + release/man3/tsearch.3 | 254 + release/man3/ttyname.3 | 80 + release/man3/ttyslot.3 | 159 + release/man3/tzset.3 | 253 + release/man3/ualarm.3 | 126 + release/man3/ulimit.3 | 89 + release/man3/undocumented.3 | 197 + release/man3/ungetwc.3 | 62 + release/man3/unlocked_stdio.3 | 138 + release/man3/unlockpt.3 | 58 + release/man3/updwtmp.3 | 92 + release/man3/usleep.3 | 137 + release/man3/wcpcpy.3 | 49 + release/man3/wcpncpy.3 | 54 + release/man3/wcrtomb.3 | 72 + release/man3/wcscasecmp.3 | 56 + release/man3/wcscat.3 | 48 + release/man3/wcschr.3 | 45 + release/man3/wcscmp.3 | 46 + release/man3/wcscpy.3 | 49 + release/man3/wcscspn.3 | 49 + release/man3/wcsdup.3 | 60 + release/man3/wcslen.3 | 40 + release/man3/wcsncasecmp.3 | 58 + release/man3/wcsncat.3 | 47 + release/man3/wcsncmp.3 | 49 + release/man3/wcsncpy.3 | 50 + release/man3/wcsnlen.3 | 49 + release/man3/wcsnrtombs.3 | 91 + release/man3/wcspbrk.3 | 44 + release/man3/wcsrchr.3 | 42 + release/man3/wcsrtombs.3 | 87 + release/man3/wcsspn.3 | 48 + release/man3/wcsstr.3 | 47 + release/man3/wcstoimax.3 | 62 + release/man3/wcstok.3 | 83 + release/man3/wcstombs.3 | 75 + release/man3/wcswidth.3 | 45 + release/man3/wctob.3 | 56 + release/man3/wctomb.3 | 70 + release/man3/wctrans.3 | 58 + release/man3/wctype.3 | 70 + release/man3/wcwidth.3 | 55 + release/man3/wmemchr.3 | 43 + release/man3/wmemcmp.3 | 47 + release/man3/wmemcpy.3 | 50 + release/man3/wmemmove.3 | 45 + release/man3/wmemset.3 | 40 + release/man3/wordexp.3 | 218 + release/man3/wprintf.3 | 208 + release/man3/xcrypt.3 | 75 + release/man3/xdr.3 | 558 + release/man3/y0.3 | 231 + release/man4/console.4 | 116 + release/man4/console_codes.4 | 640 ++ release/man4/console_ioctl.4 | 610 ++ release/man4/dsp56k.4 | 123 + release/man4/fd.4 | 231 + release/man4/full.4 | 63 + release/man4/hd.4 | 121 + release/man4/initrd.4 | 498 + release/man4/intro.4 | 50 + release/man4/lp.4 | 142 + release/man4/mem.4 | 105 + release/man4/mouse.4 | 158 + release/man4/null.4 | 72 + release/man4/pts.4 | 88 + release/man4/ram.4 | 57 + release/man4/random.4 | 234 + release/man4/rtc.4 | 334 + release/man4/sd.4 | 147 + release/man4/sk98lin.4 | 598 ++ release/man4/st.4 | 916 ++ release/man4/tty.4 | 88 + release/man4/ttyS.4 | 65 + release/man4/tty_ioctl.4 | 506 + release/man4/vcs.4 | 175 + release/man4/wavelan.4 | 138 + release/man5/acct.5 | 181 + release/man5/charmap.5 | 124 + release/man5/core.5 | 394 + release/man5/dir_colors.5 | 367 + release/man5/elf.5 | 1904 ++++ release/man5/filesystems.5 | 203 + release/man5/ftpusers.5 | 52 + release/man5/group.5 | 66 + release/man5/host.conf.5 | 220 + release/man5/hosts.5 | 127 + release/man5/hosts.equiv.5 | 71 + release/man5/intro.5 | 41 + release/man5/issue.5 | 48 + release/man5/locale.5 | 566 + release/man5/motd.5 | 46 + release/man5/nologin.5 | 44 + release/man5/nscd.conf.5 | 191 + release/man5/nsswitch.conf.5 | 274 + release/man5/passwd.5 | 155 + release/man5/proc.5 | 2694 +++++ release/man5/protocols.5 | 82 + release/man5/resolv.conf.5 | 270 + release/man5/rpc.5 | 80 + release/man5/securetty.5 | 48 + release/man5/services.5 | 212 + release/man5/shells.5 | 64 + release/man5/slabinfo.5 | 124 + release/man5/termcap.5 | 496 + release/man5/ttytype.5 | 66 + release/man5/tzfile.5 | 133 + release/man5/utmp.5 | 363 + release/man6/intro.6 | 40 + release/man7/arp.7 | 333 + release/man7/ascii.7 | 204 + release/man7/boot.7 | 214 + release/man7/bootparam.7 | 1345 +++ release/man7/capabilities.7 | 948 ++ release/man7/charsets.7 | 365 + release/man7/complex.7 | 61 + release/man7/credentials.7 | 297 + release/man7/ddp.7 | 243 + release/man7/environ.7 | 267 + release/man7/epoll.7 | 570 + release/man7/feature_test_macros.7 | 592 ++ release/man7/fifo.7 | 69 + release/man7/futex.7 | 123 + release/man7/glob.7 | 211 + release/man7/hier.7 | 527 + release/man7/icmp.7 | 205 + release/man7/inotify.7 | 418 + release/man7/intro.7 | 45 + release/man7/ip.7 | 1074 ++ release/man7/ipv6.7 | 347 + release/man7/iso_8859-1.7 | 185 + release/man7/iso_8859-15.7 | 183 + release/man7/iso_8859-16.7 | 179 + release/man7/iso_8859-2.7 | 188 + release/man7/iso_8859-7.7 | 170 + release/man7/iso_8859-9.7 | 170 + release/man7/koi8-r.7 | 205 + release/man7/locale.7 | 223 + release/man7/mailaddr.7 | 125 + release/man7/man-pages.7 | 552 + release/man7/man.7 | 558 + release/man7/math_error.7 | 258 + release/man7/mdoc.7 | 429 + release/man7/mq_overview.7 | 313 + release/man7/netdevice.7 | 295 + release/man7/netlink.7 | 473 + release/man7/operator.7 | 67 + release/man7/packet.7 | 418 + release/man7/path_resolution.7 | 236 + release/man7/pipe.7 | 248 + release/man7/posixoptions.7 | 888 ++ release/man7/pthreads.7 | 926 ++ release/man7/pty.7 | 162 + release/man7/raw.7 | 297 + release/man7/regex.7 | 306 + release/man7/rtnetlink.7 | 467 + release/man7/sem_overview.7 | 173 + release/man7/shm_overview.7 | 133 + release/man7/signal.7 | 894 ++ release/man7/socket.7 | 761 ++ release/man7/spufs.7 | 475 + release/man7/standards.7 | 289 + release/man7/suffixes.7 | 293 + release/man7/svipc.7 | 337 + release/man7/tcp.7 | 1132 ++ release/man7/termio.7 | 65 + release/man7/time.7 | 198 + release/man7/udp.7 | 259 + release/man7/udplite.7 | 159 + release/man7/unicode.7 | 314 + release/man7/units.7 | 130 + release/man7/unix.7 | 401 + release/man7/uri.7 | 682 ++ release/man7/utf-8.7 | 297 + release/man7/x25.7 | 119 + release/man8/intro.8 | 49 + release/man8/ld.so.8 | 401 + release/man8/ldconfig.8 | 182 + release/man8/nscd.8 | 94 + release/man8/sync.8 | 93 + release/man8/tzselect.8 | 55 + release/man8/zdump.8 | 46 + release/man8/zic.8 | 405 + translation_list | 2059 ++++ 3782 files changed, 598032 insertions(+) create mode 100644 ChangeLog create mode 100644 contrib/man7/mdoc.samples.7 create mode 100644 draft/man1/intro.1 create mode 100644 draft/man1/ldd.1 create mode 100644 draft/man1/time.1 create mode 100644 draft/man2/_exit.2 create mode 100644 draft/man2/_syscall.2 create mode 100644 draft/man2/accept.2 create mode 100644 draft/man2/access.2 create mode 100644 draft/man2/acct.2 create mode 100644 draft/man2/adjtimex.2 create mode 100644 draft/man2/alarm.2 create mode 100644 draft/man2/alloc_hugepages.2 create mode 100644 draft/man2/arch_prctl.2 create mode 100644 draft/man2/bdflush.2 create mode 100644 draft/man2/bind.2 create mode 100644 draft/man2/brk.2 create mode 100644 draft/man2/cacheflush.2 create mode 100644 draft/man2/capget.2 create mode 100644 draft/man2/chdir.2 create mode 100644 draft/man2/chmod.2 create mode 100644 draft/man2/chown.2 create mode 100644 draft/man2/chroot.2 create mode 100644 draft/man2/clock_getres.2 create mode 100644 draft/man2/clock_nanosleep.2 create mode 100644 draft/man2/clone.2 create mode 100644 draft/man2/close.2 create mode 100644 draft/man2/connect.2 create mode 100644 draft/man2/create_module.2 create mode 100644 draft/man2/delete_module.2 create mode 100644 draft/man2/dup.2 create mode 100644 draft/man2/epoll_create.2 create mode 100644 draft/man2/epoll_ctl.2 create mode 100644 draft/man2/epoll_wait.2 create mode 100644 draft/man2/eventfd.2 create mode 100644 draft/man2/execve.2 create mode 100644 draft/man2/exit_group.2 create mode 100644 draft/man2/faccessat.2 create mode 100644 draft/man2/fallocate.2 create mode 100644 draft/man2/fchmodat.2 create mode 100644 draft/man2/fchownat.2 create mode 100644 draft/man2/fcntl.2 create mode 100644 draft/man2/flock.2 create mode 100644 draft/man2/fork.2 create mode 100644 draft/man2/fstatat.2 create mode 100644 draft/man2/fsync.2 create mode 100644 draft/man2/futex.2 create mode 100644 draft/man2/futimesat.2 create mode 100644 draft/man2/get_kernel_syms.2 create mode 100644 draft/man2/get_mempolicy.2 create mode 100644 draft/man2/get_thread_area.2 create mode 100644 draft/man2/getcontext.2 create mode 100644 draft/man2/getdents.2 create mode 100644 draft/man2/getdomainname.2 create mode 100644 draft/man2/getdtablesize.2 create mode 100644 draft/man2/getgid.2 create mode 100644 draft/man2/getgroups.2 create mode 100644 draft/man2/gethostname.2 create mode 100644 draft/man2/getitimer.2 create mode 100644 draft/man2/getpagesize.2 create mode 100644 draft/man2/getpeername.2 create mode 100644 draft/man2/getpid.2 create mode 100644 draft/man2/getpriority.2 create mode 100644 draft/man2/getresuid.2 create mode 100644 draft/man2/getrlimit.2 create mode 100644 draft/man2/getrusage.2 create mode 100644 draft/man2/getsid.2 create mode 100644 draft/man2/getsockname.2 create mode 100644 draft/man2/getsockopt.2 create mode 100644 draft/man2/gettid.2 create mode 100644 draft/man2/gettimeofday.2 create mode 100644 draft/man2/getuid.2 create mode 100644 draft/man2/getxattr.2 create mode 100644 draft/man2/idle.2 create mode 100644 draft/man2/init_module.2 create mode 100644 draft/man2/inotify_add_watch.2 create mode 100644 draft/man2/inotify_init.2 create mode 100644 draft/man2/inotify_rm_watch.2 create mode 100644 draft/man2/intro.2 create mode 100644 draft/man2/io_cancel.2 create mode 100644 draft/man2/io_destroy.2 create mode 100644 draft/man2/io_getevents.2 create mode 100644 draft/man2/io_setup.2 create mode 100644 draft/man2/io_submit.2 create mode 100644 draft/man2/ioctl.2 create mode 100644 draft/man2/ioctl_list.2 create mode 100644 draft/man2/ioperm.2 create mode 100644 draft/man2/iopl.2 create mode 100644 draft/man2/ioprio_set.2 create mode 100644 draft/man2/ipc.2 create mode 100644 draft/man2/kill.2 create mode 100644 draft/man2/killpg.2 create mode 100644 draft/man2/link.2 create mode 100644 draft/man2/linkat.2 create mode 100644 draft/man2/listen.2 create mode 100644 draft/man2/listxattr.2 create mode 100644 draft/man2/llseek.2 create mode 100644 draft/man2/lookup_dcookie.2 create mode 100644 draft/man2/lseek.2 create mode 100644 draft/man2/madvise.2 create mode 100644 draft/man2/mbind.2 create mode 100644 draft/man2/mincore.2 create mode 100644 draft/man2/mkdir.2 create mode 100644 draft/man2/mkdirat.2 create mode 100644 draft/man2/mknod.2 create mode 100644 draft/man2/mknodat.2 create mode 100644 draft/man2/mlock.2 create mode 100644 draft/man2/mmap.2 create mode 100644 draft/man2/mmap2.2 create mode 100644 draft/man2/modify_ldt.2 create mode 100644 draft/man2/mount.2 create mode 100644 draft/man2/move_pages.2 create mode 100644 draft/man2/mprotect.2 create mode 100644 draft/man2/mq_getsetattr.2 create mode 100644 draft/man2/mremap.2 create mode 100644 draft/man2/msgctl.2 create mode 100644 draft/man2/msgget.2 create mode 100644 draft/man2/msgop.2 create mode 100644 draft/man2/msync.2 create mode 100644 draft/man2/nanosleep.2 create mode 100644 draft/man2/nfsservctl.2 create mode 100644 draft/man2/nice.2 create mode 100644 draft/man2/open.2 create mode 100644 draft/man2/openat.2 create mode 100644 draft/man2/outb.2 create mode 100644 draft/man2/pause.2 create mode 100644 draft/man2/pciconfig_read.2 create mode 100644 draft/man2/personality.2 create mode 100644 draft/man2/pipe.2 create mode 100644 draft/man2/pivot_root.2 create mode 100644 draft/man2/poll.2 create mode 100644 draft/man2/posix_fadvise.2 create mode 100644 draft/man2/prctl.2 create mode 100644 draft/man2/pread.2 create mode 100644 draft/man2/ptrace.2 create mode 100644 draft/man2/query_module.2 create mode 100644 draft/man2/quotactl.2 create mode 100644 draft/man2/read.2 create mode 100644 draft/man2/readahead.2 create mode 100644 draft/man2/readdir.2 create mode 100644 draft/man2/readlink.2 create mode 100644 draft/man2/readlinkat.2 create mode 100644 draft/man2/readv.2 create mode 100644 draft/man2/reboot.2 create mode 100644 draft/man2/recv.2 create mode 100644 draft/man2/remap_file_pages.2 create mode 100644 draft/man2/removexattr.2 create mode 100644 draft/man2/rename.2 create mode 100644 draft/man2/renameat.2 create mode 100644 draft/man2/rmdir.2 create mode 100644 draft/man2/sched_get_priority_max.2 create mode 100644 draft/man2/sched_rr_get_interval.2 create mode 100644 draft/man2/sched_setaffinity.2 create mode 100644 draft/man2/sched_setparam.2 create mode 100644 draft/man2/sched_setscheduler.2 create mode 100644 draft/man2/sched_yield.2 create mode 100644 draft/man2/select.2 create mode 100644 draft/man2/select_tut.2 create mode 100644 draft/man2/semctl.2 create mode 100644 draft/man2/semget.2 create mode 100644 draft/man2/semop.2 create mode 100644 draft/man2/send.2 create mode 100644 draft/man2/sendfile.2 create mode 100644 draft/man2/set_mempolicy.2 create mode 100644 draft/man2/set_thread_area.2 create mode 100644 draft/man2/set_tid_address.2 create mode 100644 draft/man2/seteuid.2 create mode 100644 draft/man2/setfsgid.2 create mode 100644 draft/man2/setfsuid.2 create mode 100644 draft/man2/setgid.2 create mode 100644 draft/man2/setpgid.2 create mode 100644 draft/man2/setresuid.2 create mode 100644 draft/man2/setreuid.2 create mode 100644 draft/man2/setsid.2 create mode 100644 draft/man2/setuid.2 create mode 100644 draft/man2/setup.2 create mode 100644 draft/man2/setxattr.2 create mode 100644 draft/man2/sgetmask.2 create mode 100644 draft/man2/shmctl.2 create mode 100644 draft/man2/shmget.2 create mode 100644 draft/man2/shmop.2 create mode 100644 draft/man2/shutdown.2 create mode 100644 draft/man2/sigaction.2 create mode 100644 draft/man2/sigaltstack.2 create mode 100644 draft/man2/signal.2 create mode 100644 draft/man2/signalfd.2 create mode 100644 draft/man2/sigpending.2 create mode 100644 draft/man2/sigprocmask.2 create mode 100644 draft/man2/sigqueue.2 create mode 100644 draft/man2/sigreturn.2 create mode 100644 draft/man2/sigsuspend.2 create mode 100644 draft/man2/sigwaitinfo.2 create mode 100644 draft/man2/socket.2 create mode 100644 draft/man2/socketcall.2 create mode 100644 draft/man2/socketpair.2 create mode 100644 draft/man2/splice.2 create mode 100644 draft/man2/spu_create.2 create mode 100644 draft/man2/spu_run.2 create mode 100644 draft/man2/stat.2 create mode 100644 draft/man2/statfs.2 create mode 100644 draft/man2/statvfs.2 create mode 100644 draft/man2/stime.2 create mode 100644 draft/man2/swapon.2 create mode 100644 draft/man2/symlink.2 create mode 100644 draft/man2/symlinkat.2 create mode 100644 draft/man2/sync.2 create mode 100644 draft/man2/sync_file_range.2 create mode 100644 draft/man2/syscall.2 create mode 100644 draft/man2/syscalls.2 create mode 100644 draft/man2/sysctl.2 create mode 100644 draft/man2/sysfs.2 create mode 100644 draft/man2/sysinfo.2 create mode 100644 draft/man2/syslog.2 create mode 100644 draft/man2/tee.2 create mode 100644 draft/man2/time.2 create mode 100644 draft/man2/timerfd_create.2 create mode 100644 draft/man2/times.2 create mode 100644 draft/man2/tkill.2 create mode 100644 draft/man2/truncate.2 create mode 100644 draft/man2/umask.2 create mode 100644 draft/man2/umount.2 create mode 100644 draft/man2/uname.2 create mode 100644 draft/man2/unimplemented.2 create mode 100644 draft/man2/unlink.2 create mode 100644 draft/man2/unlinkat.2 create mode 100644 draft/man2/unshare.2 create mode 100644 draft/man2/uselib.2 create mode 100644 draft/man2/ustat.2 create mode 100644 draft/man2/utime.2 create mode 100644 draft/man2/vfork.2 create mode 100644 draft/man2/vhangup.2 create mode 100644 draft/man2/vm86.2 create mode 100644 draft/man2/vmsplice.2 create mode 100644 draft/man2/wait.2 create mode 100644 draft/man2/wait4.2 create mode 100644 draft/man2/write.2 create mode 100644 draft/man3/INFINITY.3 create mode 100644 draft/man3/MB_CUR_MAX.3 create mode 100644 draft/man3/MB_LEN_MAX.3 create mode 100644 draft/man3/__setfpucw.3 create mode 100644 draft/man3/a64l.3 create mode 100644 draft/man3/abort.3 create mode 100644 draft/man3/abs.3 create mode 100644 draft/man3/acos.3 create mode 100644 draft/man3/acosh.3 create mode 100644 draft/man3/addseverity.3 create mode 100644 draft/man3/adjtime.3 create mode 100644 draft/man3/aio_cancel.3 create mode 100644 draft/man3/aio_error.3 create mode 100644 draft/man3/aio_fsync.3 create mode 100644 draft/man3/aio_read.3 create mode 100644 draft/man3/aio_return.3 create mode 100644 draft/man3/aio_suspend.3 create mode 100644 draft/man3/aio_write.3 create mode 100644 draft/man3/alloca.3 create mode 100644 draft/man3/argz_add.3 create mode 100644 draft/man3/asin.3 create mode 100644 draft/man3/asinh.3 create mode 100644 draft/man3/asprintf.3 create mode 100644 draft/man3/assert.3 create mode 100644 draft/man3/assert_perror.3 create mode 100644 draft/man3/atan.3 create mode 100644 draft/man3/atan2.3 create mode 100644 draft/man3/atanh.3 create mode 100644 draft/man3/atexit.3 create mode 100644 draft/man3/atof.3 create mode 100644 draft/man3/atoi.3 create mode 100644 draft/man3/backtrace.3 create mode 100644 draft/man3/basename.3 create mode 100644 draft/man3/bcmp.3 create mode 100644 draft/man3/bcopy.3 create mode 100644 draft/man3/bindresvport.3 create mode 100644 draft/man3/bsd_signal.3 create mode 100644 draft/man3/bsearch.3 create mode 100644 draft/man3/bstring.3 create mode 100644 draft/man3/btowc.3 create mode 100644 draft/man3/btree.3 create mode 100644 draft/man3/byteorder.3 create mode 100644 draft/man3/bzero.3 create mode 100644 draft/man3/cabs.3 create mode 100644 draft/man3/cacos.3 create mode 100644 draft/man3/cacosh.3 create mode 100644 draft/man3/canonicalize_file_name.3 create mode 100644 draft/man3/carg.3 create mode 100644 draft/man3/casin.3 create mode 100644 draft/man3/casinh.3 create mode 100644 draft/man3/catan.3 create mode 100644 draft/man3/catanh.3 create mode 100644 draft/man3/catgets.3 create mode 100644 draft/man3/catopen.3 create mode 100644 draft/man3/cbrt.3 create mode 100644 draft/man3/ccos.3 create mode 100644 draft/man3/ccosh.3 create mode 100644 draft/man3/ceil.3 create mode 100644 draft/man3/cerf.3 create mode 100644 draft/man3/cexp.3 create mode 100644 draft/man3/cexp2.3 create mode 100644 draft/man3/cfree.3 create mode 100644 draft/man3/cimag.3 create mode 100644 draft/man3/clearenv.3 create mode 100644 draft/man3/clock.3 create mode 100644 draft/man3/clog.3 create mode 100644 draft/man3/clog10.3 create mode 100644 draft/man3/clog2.3 create mode 100644 draft/man3/closedir.3 create mode 100644 draft/man3/cmsg.3 create mode 100644 draft/man3/confstr.3 create mode 100644 draft/man3/conj.3 create mode 100644 draft/man3/copysign.3 create mode 100644 draft/man3/cos.3 create mode 100644 draft/man3/cosh.3 create mode 100644 draft/man3/cpow.3 create mode 100644 draft/man3/cproj.3 create mode 100644 draft/man3/creal.3 create mode 100644 draft/man3/crypt.3 create mode 100644 draft/man3/csin.3 create mode 100644 draft/man3/csinh.3 create mode 100644 draft/man3/csqrt.3 create mode 100644 draft/man3/ctan.3 create mode 100644 draft/man3/ctanh.3 create mode 100644 draft/man3/ctermid.3 create mode 100644 draft/man3/ctime.3 create mode 100644 draft/man3/daemon.3 create mode 100644 draft/man3/dbopen.3 create mode 100644 draft/man3/des_crypt.3 create mode 100644 draft/man3/difftime.3 create mode 100644 draft/man3/dirfd.3 create mode 100644 draft/man3/div.3 create mode 100644 draft/man3/dl_iterate_phdr.3 create mode 100644 draft/man3/dlopen.3 create mode 100644 draft/man3/dprintf.3 create mode 100644 draft/man3/drand48.3 create mode 100644 draft/man3/drand48_r.3 create mode 100644 draft/man3/dysize.3 create mode 100644 draft/man3/ecvt.3 create mode 100644 draft/man3/ecvt_r.3 create mode 100644 draft/man3/encrypt.3 create mode 100644 draft/man3/end.3 create mode 100644 draft/man3/envz_add.3 create mode 100644 draft/man3/erf.3 create mode 100644 draft/man3/erfc.3 create mode 100644 draft/man3/err.3 create mode 100644 draft/man3/errno.3 create mode 100644 draft/man3/error.3 create mode 100644 draft/man3/ether_aton.3 create mode 100644 draft/man3/euidaccess.3 create mode 100644 draft/man3/exec.3 create mode 100644 draft/man3/exit.3 create mode 100644 draft/man3/exp.3 create mode 100644 draft/man3/exp10.3 create mode 100644 draft/man3/exp2.3 create mode 100644 draft/man3/expm1.3 create mode 100644 draft/man3/fabs.3 create mode 100644 draft/man3/fclose.3 create mode 100644 draft/man3/fcloseall.3 create mode 100644 draft/man3/fdim.3 create mode 100644 draft/man3/fenv.3 create mode 100644 draft/man3/ferror.3 create mode 100644 draft/man3/fexecve.3 create mode 100644 draft/man3/fflush.3 create mode 100644 draft/man3/ffs.3 create mode 100644 draft/man3/fgetgrent.3 create mode 100644 draft/man3/fgetpwent.3 create mode 100644 draft/man3/fgetwc.3 create mode 100644 draft/man3/fgetws.3 create mode 100644 draft/man3/finite.3 create mode 100644 draft/man3/flockfile.3 create mode 100644 draft/man3/floor.3 create mode 100644 draft/man3/fma.3 create mode 100644 draft/man3/fmax.3 create mode 100644 draft/man3/fmemopen.3 create mode 100644 draft/man3/fmin.3 create mode 100644 draft/man3/fmod.3 create mode 100644 draft/man3/fmtmsg.3 create mode 100644 draft/man3/fnmatch.3 create mode 100644 draft/man3/fopen.3 create mode 100644 draft/man3/fpathconf.3 create mode 100644 draft/man3/fpclassify.3 create mode 100644 draft/man3/fpurge.3 create mode 100644 draft/man3/fputwc.3 create mode 100644 draft/man3/fputws.3 create mode 100644 draft/man3/fread.3 create mode 100644 draft/man3/frexp.3 create mode 100644 draft/man3/fseek.3 create mode 100644 draft/man3/fseeko.3 create mode 100644 draft/man3/ftime.3 create mode 100644 draft/man3/ftok.3 create mode 100644 draft/man3/fts.3 create mode 100644 draft/man3/ftw.3 create mode 100644 draft/man3/futimes.3 create mode 100644 draft/man3/fwide.3 create mode 100644 draft/man3/gamma.3 create mode 100644 draft/man3/gcvt.3 create mode 100644 draft/man3/getaddrinfo.3 create mode 100644 draft/man3/getcwd.3 create mode 100644 draft/man3/getdate.3 create mode 100644 draft/man3/getdirentries.3 create mode 100644 draft/man3/getenv.3 create mode 100644 draft/man3/getfsent.3 create mode 100644 draft/man3/getgrent.3 create mode 100644 draft/man3/getgrent_r.3 create mode 100644 draft/man3/getgrnam.3 create mode 100644 draft/man3/getgrouplist.3 create mode 100644 draft/man3/gethostbyname.3 create mode 100644 draft/man3/gethostid.3 create mode 100644 draft/man3/getipnodebyname.3 create mode 100644 draft/man3/getline.3 create mode 100644 draft/man3/getloadavg.3 create mode 100644 draft/man3/getlogin.3 create mode 100644 draft/man3/getmntent.3 create mode 100644 draft/man3/getnameinfo.3 create mode 100644 draft/man3/getnetent.3 create mode 100644 draft/man3/getopt.3 create mode 100644 draft/man3/getpass.3 create mode 100644 draft/man3/getprotoent.3 create mode 100644 draft/man3/getpt.3 create mode 100644 draft/man3/getpw.3 create mode 100644 draft/man3/getpwent.3 create mode 100644 draft/man3/getpwent_r.3 create mode 100644 draft/man3/getpwnam.3 create mode 100644 draft/man3/getrpcent.3 create mode 100644 draft/man3/getrpcport.3 create mode 100644 draft/man3/gets.3 create mode 100644 draft/man3/getservent.3 create mode 100644 draft/man3/getspnam.3 create mode 100644 draft/man3/getsubopt.3 create mode 100644 draft/man3/getttyent.3 create mode 100644 draft/man3/getumask.3 create mode 100644 draft/man3/getusershell.3 create mode 100644 draft/man3/getutent.3 create mode 100644 draft/man3/getw.3 create mode 100644 draft/man3/getwchar.3 create mode 100644 draft/man3/glob.3 create mode 100644 draft/man3/gnu_get_libc_version.3 create mode 100644 draft/man3/grantpt.3 create mode 100644 draft/man3/gsignal.3 create mode 100644 draft/man3/hash.3 create mode 100644 draft/man3/hsearch.3 create mode 100644 draft/man3/hypot.3 create mode 100644 draft/man3/iconv.3 create mode 100644 draft/man3/iconv_close.3 create mode 100644 draft/man3/iconv_open.3 create mode 100644 draft/man3/ilogb.3 create mode 100644 draft/man3/index.3 create mode 100644 draft/man3/inet.3 create mode 100644 draft/man3/inet_ntop.3 create mode 100644 draft/man3/inet_pton.3 create mode 100644 draft/man3/infnan.3 create mode 100644 draft/man3/initgroups.3 create mode 100644 draft/man3/insque.3 create mode 100644 draft/man3/intro.3 create mode 100644 draft/man3/isalpha.3 create mode 100644 draft/man3/isatty.3 create mode 100644 draft/man3/isgreater.3 create mode 100644 draft/man3/iswalnum.3 create mode 100644 draft/man3/iswalpha.3 create mode 100644 draft/man3/iswblank.3 create mode 100644 draft/man3/iswcntrl.3 create mode 100644 draft/man3/iswctype.3 create mode 100644 draft/man3/iswdigit.3 create mode 100644 draft/man3/iswgraph.3 create mode 100644 draft/man3/iswlower.3 create mode 100644 draft/man3/iswprint.3 create mode 100644 draft/man3/iswpunct.3 create mode 100644 draft/man3/iswspace.3 create mode 100644 draft/man3/iswupper.3 create mode 100644 draft/man3/iswxdigit.3 create mode 100644 draft/man3/j0.3 create mode 100644 draft/man3/key_setsecret.3 create mode 100644 draft/man3/ldexp.3 create mode 100644 draft/man3/lgamma.3 create mode 100644 draft/man3/localeconv.3 create mode 100644 draft/man3/lockf.3 create mode 100644 draft/man3/log.3 create mode 100644 draft/man3/log10.3 create mode 100644 draft/man3/log1p.3 create mode 100644 draft/man3/log2.3 create mode 100644 draft/man3/logb.3 create mode 100644 draft/man3/login.3 create mode 100644 draft/man3/longjmp.3 create mode 100644 draft/man3/lrint.3 create mode 100644 draft/man3/lround.3 create mode 100644 draft/man3/lsearch.3 create mode 100644 draft/man3/lseek64.3 create mode 100644 draft/man3/makecontext.3 create mode 100644 draft/man3/malloc.3 create mode 100644 draft/man3/malloc_hook.3 create mode 100644 draft/man3/mblen.3 create mode 100644 draft/man3/mbrlen.3 create mode 100644 draft/man3/mbrtowc.3 create mode 100644 draft/man3/mbsinit.3 create mode 100644 draft/man3/mbsnrtowcs.3 create mode 100644 draft/man3/mbsrtowcs.3 create mode 100644 draft/man3/mbstowcs.3 create mode 100644 draft/man3/mbtowc.3 create mode 100644 draft/man3/memccpy.3 create mode 100644 draft/man3/memchr.3 create mode 100644 draft/man3/memcmp.3 create mode 100644 draft/man3/memcpy.3 create mode 100644 draft/man3/memfrob.3 create mode 100644 draft/man3/memmem.3 create mode 100644 draft/man3/memmove.3 create mode 100644 draft/man3/mempcpy.3 create mode 100644 draft/man3/memset.3 create mode 100644 draft/man3/mkdtemp.3 create mode 100644 draft/man3/mkfifo.3 create mode 100644 draft/man3/mkfifoat.3 create mode 100644 draft/man3/mkstemp.3 create mode 100644 draft/man3/mktemp.3 create mode 100644 draft/man3/modf.3 create mode 100644 draft/man3/mpool.3 create mode 100644 draft/man3/mq_close.3 create mode 100644 draft/man3/mq_getattr.3 create mode 100644 draft/man3/mq_notify.3 create mode 100644 draft/man3/mq_open.3 create mode 100644 draft/man3/mq_receive.3 create mode 100644 draft/man3/mq_send.3 create mode 100644 draft/man3/mq_unlink.3 create mode 100644 draft/man3/mtrace.3 create mode 100644 draft/man3/nan.3 create mode 100644 draft/man3/netlink.3 create mode 100644 draft/man3/nextafter.3 create mode 100644 draft/man3/nl_langinfo.3 create mode 100644 draft/man3/offsetof.3 create mode 100644 draft/man3/on_exit.3 create mode 100644 draft/man3/opendir.3 create mode 100644 draft/man3/openpty.3 create mode 100644 draft/man3/perror.3 create mode 100644 draft/man3/popen.3 create mode 100644 draft/man3/posix_fallocate.3 create mode 100644 draft/man3/posix_memalign.3 create mode 100644 draft/man3/posix_openpt.3 create mode 100644 draft/man3/pow.3 create mode 100644 draft/man3/pow10.3 create mode 100644 draft/man3/printf.3 create mode 100644 draft/man3/profil.3 create mode 100644 draft/man3/program_invocation_name.3 create mode 100644 draft/man3/psignal.3 create mode 100644 draft/man3/ptsname.3 create mode 100644 draft/man3/putenv.3 create mode 100644 draft/man3/putgrent.3 create mode 100644 draft/man3/putpwent.3 create mode 100644 draft/man3/puts.3 create mode 100644 draft/man3/putwchar.3 create mode 100644 draft/man3/qecvt.3 create mode 100644 draft/man3/qsort.3 create mode 100644 draft/man3/queue.3 create mode 100644 draft/man3/raise.3 create mode 100644 draft/man3/rand.3 create mode 100644 draft/man3/random.3 create mode 100644 draft/man3/random_r.3 create mode 100644 draft/man3/rcmd.3 create mode 100644 draft/man3/re_comp.3 create mode 100644 draft/man3/readdir.3 create mode 100644 draft/man3/realpath.3 create mode 100644 draft/man3/recno.3 create mode 100644 draft/man3/regex.3 create mode 100644 draft/man3/remainder.3 create mode 100644 draft/man3/remove.3 create mode 100644 draft/man3/remquo.3 create mode 100644 draft/man3/resolver.3 create mode 100644 draft/man3/rewinddir.3 create mode 100644 draft/man3/rexec.3 create mode 100644 draft/man3/rint.3 create mode 100644 draft/man3/round.3 create mode 100644 draft/man3/rpc.3 create mode 100644 draft/man3/rpmatch.3 create mode 100644 draft/man3/rtime.3 create mode 100644 draft/man3/rtnetlink.3 create mode 100644 draft/man3/scalb.3 create mode 100644 draft/man3/scandir.3 create mode 100644 draft/man3/scanf.3 create mode 100644 draft/man3/sched_getcpu.3 create mode 100644 draft/man3/seekdir.3 create mode 100644 draft/man3/sem_close.3 create mode 100644 draft/man3/sem_destroy.3 create mode 100644 draft/man3/sem_getvalue.3 create mode 100644 draft/man3/sem_init.3 create mode 100644 draft/man3/sem_open.3 create mode 100644 draft/man3/sem_post.3 create mode 100644 draft/man3/sem_unlink.3 create mode 100644 draft/man3/sem_wait.3 create mode 100644 draft/man3/setaliasent.3 create mode 100644 draft/man3/setbuf.3 create mode 100644 draft/man3/setenv.3 create mode 100644 draft/man3/setjmp.3 create mode 100644 draft/man3/setlocale.3 create mode 100644 draft/man3/setlogmask.3 create mode 100644 draft/man3/setnetgrent.3 create mode 100644 draft/man3/shm_open.3 create mode 100644 draft/man3/siginterrupt.3 create mode 100644 draft/man3/signbit.3 create mode 100644 draft/man3/significand.3 create mode 100644 draft/man3/sigpause.3 create mode 100644 draft/man3/sigset.3 create mode 100644 draft/man3/sigsetops.3 create mode 100644 draft/man3/sigvec.3 create mode 100644 draft/man3/sigwait.3 create mode 100644 draft/man3/sin.3 create mode 100644 draft/man3/sincos.3 create mode 100644 draft/man3/sinh.3 create mode 100644 draft/man3/sleep.3 create mode 100644 draft/man3/sockatmark.3 create mode 100644 draft/man3/sqrt.3 create mode 100644 draft/man3/stdarg.3 create mode 100644 draft/man3/stdin.3 create mode 100644 draft/man3/stdio.3 create mode 100644 draft/man3/stdio_ext.3 create mode 100644 draft/man3/stpcpy.3 create mode 100644 draft/man3/stpncpy.3 create mode 100644 draft/man3/strcasecmp.3 create mode 100644 draft/man3/strcat.3 create mode 100644 draft/man3/strchr.3 create mode 100644 draft/man3/strcmp.3 create mode 100644 draft/man3/strcoll.3 create mode 100644 draft/man3/strcpy.3 create mode 100644 draft/man3/strdup.3 create mode 100644 draft/man3/strerror.3 create mode 100644 draft/man3/strfmon.3 create mode 100644 draft/man3/strfry.3 create mode 100644 draft/man3/strftime.3 create mode 100644 draft/man3/string.3 create mode 100644 draft/man3/strlen.3 create mode 100644 draft/man3/strnlen.3 create mode 100644 draft/man3/strpbrk.3 create mode 100644 draft/man3/strptime.3 create mode 100644 draft/man3/strsep.3 create mode 100644 draft/man3/strsignal.3 create mode 100644 draft/man3/strspn.3 create mode 100644 draft/man3/strstr.3 create mode 100644 draft/man3/strtod.3 create mode 100644 draft/man3/strtoimax.3 create mode 100644 draft/man3/strtok.3 create mode 100644 draft/man3/strtol.3 create mode 100644 draft/man3/strtoul.3 create mode 100644 draft/man3/strverscmp.3 create mode 100644 draft/man3/strxfrm.3 create mode 100644 draft/man3/swab.3 create mode 100644 draft/man3/sysconf.3 create mode 100644 draft/man3/syslog.3 create mode 100644 draft/man3/system.3 create mode 100644 draft/man3/sysv_signal.3 create mode 100644 draft/man3/tan.3 create mode 100644 draft/man3/tanh.3 create mode 100644 draft/man3/tcgetpgrp.3 create mode 100644 draft/man3/tcgetsid.3 create mode 100644 draft/man3/telldir.3 create mode 100644 draft/man3/tempnam.3 create mode 100644 draft/man3/termios.3 create mode 100644 draft/man3/tgamma.3 create mode 100644 draft/man3/timegm.3 create mode 100644 draft/man3/timeradd.3 create mode 100644 draft/man3/tmpfile.3 create mode 100644 draft/man3/tmpnam.3 create mode 100644 draft/man3/toascii.3 create mode 100644 draft/man3/toupper.3 create mode 100644 draft/man3/towctrans.3 create mode 100644 draft/man3/towlower.3 create mode 100644 draft/man3/towupper.3 create mode 100644 draft/man3/trunc.3 create mode 100644 draft/man3/tsearch.3 create mode 100644 draft/man3/ttyname.3 create mode 100644 draft/man3/ttyslot.3 create mode 100644 draft/man3/tzset.3 create mode 100644 draft/man3/ualarm.3 create mode 100644 draft/man3/ulimit.3 create mode 100644 draft/man3/undocumented.3 create mode 100644 draft/man3/ungetwc.3 create mode 100644 draft/man3/unlocked_stdio.3 create mode 100644 draft/man3/unlockpt.3 create mode 100644 draft/man3/updwtmp.3 create mode 100644 draft/man3/usleep.3 create mode 100644 draft/man3/wcpcpy.3 create mode 100644 draft/man3/wcpncpy.3 create mode 100644 draft/man3/wcrtomb.3 create mode 100644 draft/man3/wcscasecmp.3 create mode 100644 draft/man3/wcscat.3 create mode 100644 draft/man3/wcschr.3 create mode 100644 draft/man3/wcscmp.3 create mode 100644 draft/man3/wcscpy.3 create mode 100644 draft/man3/wcscspn.3 create mode 100644 draft/man3/wcsdup.3 create mode 100644 draft/man3/wcslen.3 create mode 100644 draft/man3/wcsncasecmp.3 create mode 100644 draft/man3/wcsncat.3 create mode 100644 draft/man3/wcsncmp.3 create mode 100644 draft/man3/wcsncpy.3 create mode 100644 draft/man3/wcsnlen.3 create mode 100644 draft/man3/wcsnrtombs.3 create mode 100644 draft/man3/wcspbrk.3 create mode 100644 draft/man3/wcsrchr.3 create mode 100644 draft/man3/wcsrtombs.3 create mode 100644 draft/man3/wcsspn.3 create mode 100644 draft/man3/wcsstr.3 create mode 100644 draft/man3/wcstoimax.3 create mode 100644 draft/man3/wcstok.3 create mode 100644 draft/man3/wcstombs.3 create mode 100644 draft/man3/wcswidth.3 create mode 100644 draft/man3/wctob.3 create mode 100644 draft/man3/wctomb.3 create mode 100644 draft/man3/wctrans.3 create mode 100644 draft/man3/wctype.3 create mode 100644 draft/man3/wcwidth.3 create mode 100644 draft/man3/wmemchr.3 create mode 100644 draft/man3/wmemcmp.3 create mode 100644 draft/man3/wmemcpy.3 create mode 100644 draft/man3/wmemmove.3 create mode 100644 draft/man3/wmemset.3 create mode 100644 draft/man3/wordexp.3 create mode 100644 draft/man3/wprintf.3 create mode 100644 draft/man3/xcrypt.3 create mode 100644 draft/man3/xdr.3 create mode 100644 draft/man3/y0.3 create mode 100644 draft/man4/console.4 create mode 100644 draft/man4/console_codes.4 create mode 100644 draft/man4/console_ioctl.4 create mode 100644 draft/man4/dsp56k.4 create mode 100644 draft/man4/fd.4 create mode 100644 draft/man4/full.4 create mode 100644 draft/man4/hd.4 create mode 100644 draft/man4/initrd.4 create mode 100644 draft/man4/intro.4 create mode 100644 draft/man4/lp.4 create mode 100644 draft/man4/mem.4 create mode 100644 draft/man4/mouse.4 create mode 100644 draft/man4/null.4 create mode 100644 draft/man4/pts.4 create mode 100644 draft/man4/ram.4 create mode 100644 draft/man4/random.4 create mode 100644 draft/man4/rtc.4 create mode 100644 draft/man4/sd.4 create mode 100644 draft/man4/sk98lin.4 create mode 100644 draft/man4/st.4 create mode 100644 draft/man4/tty.4 create mode 100644 draft/man4/ttyS.4 create mode 100644 draft/man4/tty_ioctl.4 create mode 100644 draft/man4/vcs.4 create mode 100644 draft/man4/wavelan.4 create mode 100644 draft/man5/acct.5 create mode 100644 draft/man5/charmap.5 create mode 100644 draft/man5/core.5 create mode 100644 draft/man5/dir_colors.5 create mode 100644 draft/man5/elf.5 create mode 100644 draft/man5/filesystems.5 create mode 100644 draft/man5/ftpusers.5 create mode 100644 draft/man5/group.5 create mode 100644 draft/man5/host.conf.5 create mode 100644 draft/man5/hosts.5 create mode 100644 draft/man5/hosts.equiv.5 create mode 100644 draft/man5/intro.5 create mode 100644 draft/man5/issue.5 create mode 100644 draft/man5/locale.5 create mode 100644 draft/man5/motd.5 create mode 100644 draft/man5/nologin.5 create mode 100644 draft/man5/nscd.conf.5 create mode 100644 draft/man5/nsswitch.conf.5 create mode 100644 draft/man5/passwd.5 create mode 100755 draft/man5/proc.5 create mode 100644 draft/man5/protocols.5 create mode 100644 draft/man5/resolv.conf.5 create mode 100644 draft/man5/rpc.5 create mode 100644 draft/man5/securetty.5 create mode 100644 draft/man5/services.5 create mode 100644 draft/man5/shells.5 create mode 100644 draft/man5/slabinfo.5 create mode 100644 draft/man5/termcap.5 create mode 100644 draft/man5/ttytype.5 create mode 100644 draft/man5/tzfile.5 create mode 100644 draft/man5/utmp.5 create mode 100644 draft/man6/intro.6 create mode 100644 draft/man7/arp.7 create mode 100644 draft/man7/ascii.7 create mode 100644 draft/man7/boot.7 create mode 100644 draft/man7/bootparam.7 create mode 100644 draft/man7/capabilities.7 create mode 100644 draft/man7/charsets.7 create mode 100644 draft/man7/complex.7 create mode 100644 draft/man7/credentials.7 create mode 100644 draft/man7/ddp.7 create mode 100644 draft/man7/environ.7 create mode 100644 draft/man7/epoll.7 create mode 100644 draft/man7/feature_test_macros.7 create mode 100644 draft/man7/fifo.7 create mode 100644 draft/man7/futex.7 create mode 100644 draft/man7/glob.7 create mode 100644 draft/man7/hier.7 create mode 100644 draft/man7/icmp.7 create mode 100644 draft/man7/inotify.7 create mode 100644 draft/man7/intro.7 create mode 100644 draft/man7/ip.7 create mode 100644 draft/man7/ipv6.7 create mode 100644 draft/man7/iso_8859-1.7 create mode 100644 draft/man7/iso_8859-15.7 create mode 100644 draft/man7/iso_8859-16.7 create mode 100644 draft/man7/iso_8859-2.7 create mode 100644 draft/man7/iso_8859-7.7 create mode 100644 draft/man7/iso_8859-9.7 create mode 100644 draft/man7/koi8-r.7 create mode 100644 draft/man7/locale.7 create mode 100644 draft/man7/mailaddr.7 create mode 100644 draft/man7/man-pages.7 create mode 100644 draft/man7/man.7 create mode 100644 draft/man7/math_error.7 create mode 100644 draft/man7/mdoc.7 create mode 100644 draft/man7/mq_overview.7 create mode 100644 draft/man7/netdevice.7 create mode 100644 draft/man7/netlink.7 create mode 100644 draft/man7/operator.7 create mode 100644 draft/man7/packet.7 create mode 100644 draft/man7/path_resolution.7 create mode 100644 draft/man7/pipe.7 create mode 100644 draft/man7/posixoptions.7 create mode 100644 draft/man7/pthreads.7 create mode 100644 draft/man7/pty.7 create mode 100644 draft/man7/raw.7 create mode 100644 draft/man7/regex.7 create mode 100644 draft/man7/rtnetlink.7 create mode 100644 draft/man7/sem_overview.7 create mode 100644 draft/man7/shm_overview.7 create mode 100644 draft/man7/signal.7 create mode 100644 draft/man7/socket.7 create mode 100644 draft/man7/spufs.7 create mode 100644 draft/man7/standards.7 create mode 100644 draft/man7/suffixes.7 create mode 100644 draft/man7/svipc.7 create mode 100644 draft/man7/tcp.7 create mode 100644 draft/man7/termio.7 create mode 100644 draft/man7/time.7 create mode 100644 draft/man7/udp.7 create mode 100644 draft/man7/udplite.7 create mode 100644 draft/man7/unicode.7 create mode 100644 draft/man7/units.7 create mode 100644 draft/man7/unix.7 create mode 100644 draft/man7/uri.7 create mode 100644 draft/man7/utf-8.7 create mode 100644 draft/man7/x25.7 create mode 100644 draft/man8/intro.8 create mode 100644 draft/man8/ld.so.8 create mode 100644 draft/man8/ldconfig.8 create mode 100644 draft/man8/nscd.8 create mode 100644 draft/man8/sync.8 create mode 100644 draft/man8/tzselect.8 create mode 100644 draft/man8/zdump.8 create mode 100644 draft/man8/zic.8 create mode 100644 obsolete/man1/chgrp.1 create mode 100644 obsolete/man1/dircolors.1 create mode 100644 obsolete/man1/intro.1 create mode 100644 obsolete/man1/touch.1 create mode 100644 obsolete/man2/fdatasync.2 create mode 100644 obsolete/man2/gethostid.2 create mode 100644 obsolete/man2/mlockall.2 create mode 100644 obsolete/man2/munlock.2 create mode 100644 obsolete/man2/munlockall.2 create mode 100644 obsolete/man2/obsolete.2 create mode 100644 obsolete/man2/setregid.2 create mode 100644 obsolete/man2/sigblock.2 create mode 100644 obsolete/man2/sigpause.2 create mode 100644 obsolete/man2/sigvec.2 create mode 100644 obsolete/man2/sstk.2 create mode 100644 obsolete/man2/undocumented.2 create mode 100644 obsolete/man3/atol.3 create mode 100644 obsolete/man3/isinf.3 create mode 100644 obsolete/man3/killpg.3 create mode 100644 obsolete/man3/labs.3 create mode 100644 obsolete/man3/mblen.3 create mode 100644 obsolete/man3/mbstowcs.3 create mode 100644 obsolete/man3/mbtowc.3 create mode 100644 obsolete/man3/readv.3 create mode 100644 obsolete/man3/snprintf.3 create mode 100644 obsolete/man3/wcstombs.3 create mode 100644 obsolete/man3/wctomb.3 create mode 100644 obsolete/man5/lilo.conf.5 create mode 100644 obsolete/man7/LDP.7 create mode 100644 obsolete/man8/lilo.8 create mode 100644 obsolete/man9/ksoftirqd.9 create mode 100644 obsolete_list create mode 100644 original/man-pages.lsm create mode 100644 original/man1/intro.1 create mode 100644 original/man1/ldd.1 create mode 100644 original/man1/time.1 create mode 100644 original/man2/_Exit.2 create mode 100644 original/man2/__clone2.2 create mode 100644 original/man2/_exit.2 create mode 100644 original/man2/_llseek.2 create mode 100644 original/man2/_newselect.2 create mode 100644 original/man2/_syscall.2 create mode 100644 original/man2/_sysctl.2 create mode 100644 original/man2/accept.2 create mode 100644 original/man2/accept4.2 create mode 100644 original/man2/access.2 create mode 100644 original/man2/acct.2 create mode 100644 original/man2/add_key.2 create mode 100644 original/man2/adjtimex.2 create mode 100644 original/man2/afs_syscall.2 create mode 100644 original/man2/alarm.2 create mode 100644 original/man2/alloc_hugepages.2 create mode 100644 original/man2/arch_prctl.2 create mode 100644 original/man2/bdflush.2 create mode 100644 original/man2/bind.2 create mode 100644 original/man2/break.2 create mode 100644 original/man2/brk.2 create mode 100644 original/man2/cacheflush.2 create mode 100644 original/man2/capget.2 create mode 100644 original/man2/capset.2 create mode 100644 original/man2/chdir.2 create mode 100644 original/man2/chmod.2 create mode 100644 original/man2/chown.2 create mode 100644 original/man2/chown32.2 create mode 100644 original/man2/chroot.2 create mode 100644 original/man2/clock_getres.2 create mode 100644 original/man2/clock_gettime.2 create mode 100644 original/man2/clock_nanosleep.2 create mode 100644 original/man2/clock_settime.2 create mode 100644 original/man2/clone.2 create mode 100644 original/man2/clone2.2 create mode 100644 original/man2/close.2 create mode 100644 original/man2/connect.2 create mode 100644 original/man2/creat.2 create mode 100644 original/man2/create_module.2 create mode 100644 original/man2/delete_module.2 create mode 100644 original/man2/dup.2 create mode 100644 original/man2/dup2.2 create mode 100644 original/man2/dup3.2 create mode 100644 original/man2/epoll_create.2 create mode 100644 original/man2/epoll_create1.2 create mode 100644 original/man2/epoll_ctl.2 create mode 100644 original/man2/epoll_pwait.2 create mode 100644 original/man2/epoll_wait.2 create mode 100644 original/man2/eventfd.2 create mode 100644 original/man2/eventfd2.2 create mode 100644 original/man2/execve.2 create mode 100644 original/man2/exit.2 create mode 100644 original/man2/exit_group.2 create mode 100644 original/man2/faccessat.2 create mode 100644 original/man2/fadvise64.2 create mode 100644 original/man2/fadvise64_64.2 create mode 100644 original/man2/fallocate.2 create mode 100644 original/man2/fchdir.2 create mode 100644 original/man2/fchmod.2 create mode 100644 original/man2/fchmodat.2 create mode 100644 original/man2/fchown.2 create mode 100644 original/man2/fchown32.2 create mode 100644 original/man2/fchownat.2 create mode 100644 original/man2/fcntl.2 create mode 100644 original/man2/fcntl64.2 create mode 100644 original/man2/fdatasync.2 create mode 100644 original/man2/fgetxattr.2 create mode 100644 original/man2/flistxattr.2 create mode 100644 original/man2/flock.2 create mode 100644 original/man2/fork.2 create mode 100644 original/man2/free_hugepages.2 create mode 100644 original/man2/fremovexattr.2 create mode 100644 original/man2/fsetxattr.2 create mode 100644 original/man2/fstat.2 create mode 100644 original/man2/fstat64.2 create mode 100644 original/man2/fstatat.2 create mode 100644 original/man2/fstatat64.2 create mode 100644 original/man2/fstatfs.2 create mode 100644 original/man2/fstatfs64.2 create mode 100644 original/man2/fstatvfs.2 create mode 100644 original/man2/fsync.2 create mode 100644 original/man2/ftruncate.2 create mode 100644 original/man2/ftruncate64.2 create mode 100644 original/man2/futex.2 create mode 100644 original/man2/futimesat.2 create mode 100644 original/man2/get_kernel_syms.2 create mode 100644 original/man2/get_mempolicy.2 create mode 100644 original/man2/get_thread_area.2 create mode 100644 original/man2/getcontext.2 create mode 100644 original/man2/getcpu.2 create mode 100644 original/man2/getcwd.2 create mode 100644 original/man2/getdents.2 create mode 100644 original/man2/getdents64.2 create mode 100644 original/man2/getdomainname.2 create mode 100644 original/man2/getdtablesize.2 create mode 100644 original/man2/getegid.2 create mode 100644 original/man2/getegid32.2 create mode 100644 original/man2/geteuid.2 create mode 100644 original/man2/geteuid32.2 create mode 100644 original/man2/getgid.2 create mode 100644 original/man2/getgid32.2 create mode 100644 original/man2/getgroups.2 create mode 100644 original/man2/getgroups32.2 create mode 100644 original/man2/gethostid.2 create mode 100644 original/man2/gethostname.2 create mode 100644 original/man2/getitimer.2 create mode 100644 original/man2/getpagesize.2 create mode 100644 original/man2/getpeername.2 create mode 100644 original/man2/getpgid.2 create mode 100644 original/man2/getpgrp.2 create mode 100644 original/man2/getpid.2 create mode 100644 original/man2/getpmsg.2 create mode 100644 original/man2/getppid.2 create mode 100644 original/man2/getpriority.2 create mode 100644 original/man2/getresgid.2 create mode 100644 original/man2/getresgid32.2 create mode 100644 original/man2/getresuid.2 create mode 100644 original/man2/getresuid32.2 create mode 100644 original/man2/getrlimit.2 create mode 100644 original/man2/getrusage.2 create mode 100644 original/man2/getsid.2 create mode 100644 original/man2/getsockname.2 create mode 100644 original/man2/getsockopt.2 create mode 100644 original/man2/gettid.2 create mode 100644 original/man2/gettimeofday.2 create mode 100644 original/man2/getuid.2 create mode 100644 original/man2/getuid32.2 create mode 100644 original/man2/getxattr.2 create mode 100644 original/man2/gtty.2 create mode 100644 original/man2/idle.2 create mode 100644 original/man2/inb.2 create mode 100644 original/man2/inb_p.2 create mode 100644 original/man2/init_module.2 create mode 100644 original/man2/inl.2 create mode 100644 original/man2/inl_p.2 create mode 100644 original/man2/inotify_add_watch.2 create mode 100644 original/man2/inotify_init.2 create mode 100644 original/man2/inotify_init1.2 create mode 100644 original/man2/inotify_rm_watch.2 create mode 100644 original/man2/insb.2 create mode 100644 original/man2/insl.2 create mode 100644 original/man2/insw.2 create mode 100644 original/man2/intro.2 create mode 100644 original/man2/inw.2 create mode 100644 original/man2/inw_p.2 create mode 100644 original/man2/io_cancel.2 create mode 100644 original/man2/io_destroy.2 create mode 100644 original/man2/io_getevents.2 create mode 100644 original/man2/io_setup.2 create mode 100644 original/man2/io_submit.2 create mode 100644 original/man2/ioctl.2 create mode 100644 original/man2/ioctl_list.2 create mode 100644 original/man2/ioperm.2 create mode 100644 original/man2/iopl.2 create mode 100644 original/man2/ioprio_get.2 create mode 100644 original/man2/ioprio_set.2 create mode 100644 original/man2/ipc.2 create mode 100644 original/man2/keyctl.2 create mode 100644 original/man2/kill.2 create mode 100644 original/man2/killpg.2 create mode 100644 original/man2/lchown.2 create mode 100644 original/man2/lchown32.2 create mode 100644 original/man2/lgetxattr.2 create mode 100644 original/man2/link.2 create mode 100644 original/man2/linkat.2 create mode 100644 original/man2/listen.2 create mode 100644 original/man2/listxattr.2 create mode 100644 original/man2/llistxattr.2 create mode 100644 original/man2/llseek.2 create mode 100644 original/man2/lock.2 create mode 100644 original/man2/lookup_dcookie.2 create mode 100644 original/man2/lremovexattr.2 create mode 100644 original/man2/lseek.2 create mode 100644 original/man2/lsetxattr.2 create mode 100644 original/man2/lstat.2 create mode 100644 original/man2/lstat64.2 create mode 100644 original/man2/madvise.2 create mode 100644 original/man2/madvise1.2 create mode 100644 original/man2/mbind.2 create mode 100644 original/man2/mincore.2 create mode 100644 original/man2/mkdir.2 create mode 100644 original/man2/mkdirat.2 create mode 100644 original/man2/mknod.2 create mode 100644 original/man2/mknodat.2 create mode 100644 original/man2/mlock.2 create mode 100644 original/man2/mlockall.2 create mode 100644 original/man2/mmap.2 create mode 100644 original/man2/mmap2.2 create mode 100644 original/man2/modify_ldt.2 create mode 100644 original/man2/mount.2 create mode 100644 original/man2/move_pages.2 create mode 100644 original/man2/mprotect.2 create mode 100644 original/man2/mpx.2 create mode 100644 original/man2/mq_getsetattr.2 create mode 100644 original/man2/mq_notify.2 create mode 100644 original/man2/mq_open.2 create mode 100644 original/man2/mq_timedreceive.2 create mode 100644 original/man2/mq_timedsend.2 create mode 100644 original/man2/mq_unlink.2 create mode 100644 original/man2/mremap.2 create mode 100644 original/man2/msgctl.2 create mode 100644 original/man2/msgget.2 create mode 100644 original/man2/msgop.2 create mode 100644 original/man2/msgrcv.2 create mode 100644 original/man2/msgsnd.2 create mode 100644 original/man2/msync.2 create mode 100644 original/man2/munlock.2 create mode 100644 original/man2/munlockall.2 create mode 100644 original/man2/munmap.2 create mode 100644 original/man2/nanosleep.2 create mode 100644 original/man2/nfsservctl.2 create mode 100644 original/man2/nice.2 create mode 100644 original/man2/oldfstat.2 create mode 100644 original/man2/oldlstat.2 create mode 100644 original/man2/oldolduname.2 create mode 100644 original/man2/oldstat.2 create mode 100644 original/man2/olduname.2 create mode 100644 original/man2/open.2 create mode 100644 original/man2/openat.2 create mode 100644 original/man2/outb.2 create mode 100644 original/man2/outb_p.2 create mode 100644 original/man2/outl.2 create mode 100644 original/man2/outl_p.2 create mode 100644 original/man2/outsb.2 create mode 100644 original/man2/outsl.2 create mode 100644 original/man2/outsw.2 create mode 100644 original/man2/outw.2 create mode 100644 original/man2/outw_p.2 create mode 100644 original/man2/path_resolution.2 create mode 100644 original/man2/pause.2 create mode 100644 original/man2/pciconfig_iobase.2 create mode 100644 original/man2/pciconfig_read.2 create mode 100644 original/man2/pciconfig_write.2 create mode 100644 original/man2/personality.2 create mode 100644 original/man2/pipe.2 create mode 100644 original/man2/pipe2.2 create mode 100644 original/man2/pivot_root.2 create mode 100644 original/man2/poll.2 create mode 100644 original/man2/posix_fadvise.2 create mode 100644 original/man2/ppoll.2 create mode 100644 original/man2/prctl.2 create mode 100644 original/man2/pread.2 create mode 100644 original/man2/pread64.2 create mode 100644 original/man2/prof.2 create mode 100644 original/man2/pselect.2 create mode 100644 original/man2/pselect6.2 create mode 100644 original/man2/ptrace.2 create mode 100644 original/man2/putpmsg.2 create mode 100644 original/man2/pwrite.2 create mode 100644 original/man2/pwrite64.2 create mode 100644 original/man2/query_module.2 create mode 100644 original/man2/quotactl.2 create mode 100644 original/man2/read.2 create mode 100644 original/man2/readahead.2 create mode 100644 original/man2/readdir.2 create mode 100644 original/man2/readlink.2 create mode 100644 original/man2/readlinkat.2 create mode 100644 original/man2/readv.2 create mode 100644 original/man2/reboot.2 create mode 100644 original/man2/recv.2 create mode 100644 original/man2/recvfrom.2 create mode 100644 original/man2/recvmsg.2 create mode 100644 original/man2/remap_file_pages.2 create mode 100644 original/man2/removexattr.2 create mode 100644 original/man2/rename.2 create mode 100644 original/man2/renameat.2 create mode 100644 original/man2/request_key.2 create mode 100644 original/man2/rmdir.2 create mode 100644 original/man2/rt_sigaction.2 create mode 100644 original/man2/rt_sigpending.2 create mode 100644 original/man2/rt_sigprocmask.2 create mode 100644 original/man2/rt_sigqueueinfo.2 create mode 100644 original/man2/rt_sigreturn.2 create mode 100644 original/man2/rt_sigsuspend.2 create mode 100644 original/man2/rt_sigtimedwait.2 create mode 100644 original/man2/sbrk.2 create mode 100644 original/man2/sched_get_priority_max.2 create mode 100644 original/man2/sched_get_priority_min.2 create mode 100644 original/man2/sched_getaffinity.2 create mode 100644 original/man2/sched_getparam.2 create mode 100644 original/man2/sched_getscheduler.2 create mode 100644 original/man2/sched_rr_get_interval.2 create mode 100644 original/man2/sched_setaffinity.2 create mode 100644 original/man2/sched_setparam.2 create mode 100644 original/man2/sched_setscheduler.2 create mode 100644 original/man2/sched_yield.2 create mode 100644 original/man2/security.2 create mode 100644 original/man2/select.2 create mode 100644 original/man2/select_tut.2 create mode 100644 original/man2/semctl.2 create mode 100644 original/man2/semget.2 create mode 100644 original/man2/semop.2 create mode 100644 original/man2/semtimedop.2 create mode 100644 original/man2/send.2 create mode 100644 original/man2/sendfile.2 create mode 100644 original/man2/sendfile64.2 create mode 100644 original/man2/sendmsg.2 create mode 100644 original/man2/sendto.2 create mode 100644 original/man2/set_mempolicy.2 create mode 100644 original/man2/set_thread_area.2 create mode 100644 original/man2/set_tid_address.2 create mode 100644 original/man2/setcontext.2 create mode 100644 original/man2/setdomainname.2 create mode 100644 original/man2/setegid.2 create mode 100644 original/man2/seteuid.2 create mode 100644 original/man2/setfsgid.2 create mode 100644 original/man2/setfsgid32.2 create mode 100644 original/man2/setfsuid.2 create mode 100644 original/man2/setfsuid32.2 create mode 100644 original/man2/setgid.2 create mode 100644 original/man2/setgid32.2 create mode 100644 original/man2/setgroups.2 create mode 100644 original/man2/setgroups32.2 create mode 100644 original/man2/sethostid.2 create mode 100644 original/man2/sethostname.2 create mode 100644 original/man2/setitimer.2 create mode 100644 original/man2/setpgid.2 create mode 100644 original/man2/setpgrp.2 create mode 100644 original/man2/setpriority.2 create mode 100644 original/man2/setregid.2 create mode 100644 original/man2/setregid32.2 create mode 100644 original/man2/setresgid.2 create mode 100644 original/man2/setresgid32.2 create mode 100644 original/man2/setresuid.2 create mode 100644 original/man2/setresuid32.2 create mode 100644 original/man2/setreuid.2 create mode 100644 original/man2/setreuid32.2 create mode 100644 original/man2/setrlimit.2 create mode 100644 original/man2/setsid.2 create mode 100644 original/man2/setsockopt.2 create mode 100644 original/man2/settimeofday.2 create mode 100644 original/man2/setuid.2 create mode 100644 original/man2/setuid32.2 create mode 100644 original/man2/setup.2 create mode 100644 original/man2/setxattr.2 create mode 100644 original/man2/sgetmask.2 create mode 100644 original/man2/shmat.2 create mode 100644 original/man2/shmctl.2 create mode 100644 original/man2/shmdt.2 create mode 100644 original/man2/shmget.2 create mode 100644 original/man2/shmop.2 create mode 100644 original/man2/shutdown.2 create mode 100644 original/man2/sigaction.2 create mode 100644 original/man2/sigaltstack.2 create mode 100644 original/man2/signal.2 create mode 100644 original/man2/signalfd.2 create mode 100644 original/man2/signalfd4.2 create mode 100644 original/man2/sigpending.2 create mode 100644 original/man2/sigprocmask.2 create mode 100644 original/man2/sigqueue.2 create mode 100644 original/man2/sigreturn.2 create mode 100644 original/man2/sigsuspend.2 create mode 100644 original/man2/sigtimedwait.2 create mode 100644 original/man2/sigwaitinfo.2 create mode 100644 original/man2/socket.2 create mode 100644 original/man2/socketcall.2 create mode 100644 original/man2/socketpair.2 create mode 100644 original/man2/splice.2 create mode 100644 original/man2/spu_create.2 create mode 100644 original/man2/spu_run.2 create mode 100644 original/man2/ssetmask.2 create mode 100644 original/man2/stat.2 create mode 100644 original/man2/stat64.2 create mode 100644 original/man2/statfs.2 create mode 100644 original/man2/statfs64.2 create mode 100644 original/man2/statvfs.2 create mode 100644 original/man2/stime.2 create mode 100644 original/man2/stty.2 create mode 100644 original/man2/swapoff.2 create mode 100644 original/man2/swapon.2 create mode 100644 original/man2/symlink.2 create mode 100644 original/man2/symlinkat.2 create mode 100644 original/man2/sync.2 create mode 100644 original/man2/sync_file_range.2 create mode 100644 original/man2/syscall.2 create mode 100644 original/man2/syscalls.2 create mode 100644 original/man2/sysctl.2 create mode 100644 original/man2/sysfs.2 create mode 100644 original/man2/sysinfo.2 create mode 100644 original/man2/syslog.2 create mode 100644 original/man2/tee.2 create mode 100644 original/man2/tgkill.2 create mode 100644 original/man2/time.2 create mode 100644 original/man2/timer_create.2 create mode 100644 original/man2/timer_delete.2 create mode 100644 original/man2/timer_getoverrun.2 create mode 100644 original/man2/timer_gettime.2 create mode 100644 original/man2/timer_settime.2 create mode 100644 original/man2/timerfd_create.2 create mode 100644 original/man2/timerfd_gettime.2 create mode 100644 original/man2/timerfd_settime.2 create mode 100644 original/man2/times.2 create mode 100644 original/man2/tkill.2 create mode 100644 original/man2/truncate.2 create mode 100644 original/man2/truncate64.2 create mode 100644 original/man2/tuxcall.2 create mode 100644 original/man2/ugetrlimit.2 create mode 100644 original/man2/umask.2 create mode 100644 original/man2/umount.2 create mode 100644 original/man2/umount2.2 create mode 100644 original/man2/uname.2 create mode 100644 original/man2/unimplemented.2 create mode 100644 original/man2/unlink.2 create mode 100644 original/man2/unlinkat.2 create mode 100644 original/man2/unshare.2 create mode 100644 original/man2/uselib.2 create mode 100644 original/man2/ustat.2 create mode 100644 original/man2/utime.2 create mode 100644 original/man2/utimensat.2 create mode 100644 original/man2/utimes.2 create mode 100644 original/man2/vfork.2 create mode 100644 original/man2/vhangup.2 create mode 100644 original/man2/vm86.2 create mode 100644 original/man2/vm86old.2 create mode 100644 original/man2/vmsplice.2 create mode 100644 original/man2/vserver.2 create mode 100644 original/man2/wait.2 create mode 100644 original/man2/wait3.2 create mode 100644 original/man2/wait4.2 create mode 100644 original/man2/waitid.2 create mode 100644 original/man2/waitpid.2 create mode 100644 original/man2/write.2 create mode 100644 original/man2/writev.2 create mode 100644 original/man3/CMSG_ALIGN.3 create mode 100644 original/man3/CMSG_FIRSTHDR.3 create mode 100644 original/man3/CMSG_NXTHDR.3 create mode 100644 original/man3/CMSG_SPACE.3 create mode 100644 original/man3/CPU_ALLOC.3 create mode 100644 original/man3/CPU_ALLOC_SIZE.3 create mode 100644 original/man3/CPU_AND.3 create mode 100644 original/man3/CPU_AND_S.3 create mode 100644 original/man3/CPU_CLR.3 create mode 100644 original/man3/CPU_CLR_S.3 create mode 100644 original/man3/CPU_COUNT.3 create mode 100644 original/man3/CPU_COUNT_S.3 create mode 100644 original/man3/CPU_EQUAL.3 create mode 100644 original/man3/CPU_EQUAL_S.3 create mode 100644 original/man3/CPU_FREE.3 create mode 100644 original/man3/CPU_ISSET.3 create mode 100644 original/man3/CPU_ISSET_S.3 create mode 100644 original/man3/CPU_OR.3 create mode 100644 original/man3/CPU_OR_S.3 create mode 100644 original/man3/CPU_SET.3 create mode 100644 original/man3/CPU_SET_S.3 create mode 100644 original/man3/CPU_XOR.3 create mode 100644 original/man3/CPU_XOR_S.3 create mode 100644 original/man3/CPU_ZERO.3 create mode 100644 original/man3/CPU_ZERO_S.3 create mode 100644 original/man3/FD_CLR.3 create mode 100644 original/man3/FD_ISSET.3 create mode 100644 original/man3/FD_SET.3 create mode 100644 original/man3/FD_ZERO.3 create mode 100644 original/man3/HUGE_VAL.3 create mode 100644 original/man3/HUGE_VALF.3 create mode 100644 original/man3/HUGE_VALL.3 create mode 100644 original/man3/INFINITY.3 create mode 100644 original/man3/MB_CUR_MAX.3 create mode 100644 original/man3/MB_LEN_MAX.3 create mode 100644 original/man3/NAN.3 create mode 100644 original/man3/__fbufsize.3 create mode 100644 original/man3/__flbf.3 create mode 100644 original/man3/__fpending.3 create mode 100644 original/man3/__fpurge.3 create mode 100644 original/man3/__freadable.3 create mode 100644 original/man3/__freading.3 create mode 100644 original/man3/__fsetlocking.3 create mode 100644 original/man3/__fwritable.3 create mode 100644 original/man3/__fwriting.3 create mode 100644 original/man3/__malloc_hook.3 create mode 100644 original/man3/__setfpucw.3 create mode 100644 original/man3/_flushlbf.3 create mode 100644 original/man3/a64l.3 create mode 100644 original/man3/abort.3 create mode 100644 original/man3/abs.3 create mode 100644 original/man3/acos.3 create mode 100644 original/man3/acosf.3 create mode 100644 original/man3/acosh.3 create mode 100644 original/man3/acoshf.3 create mode 100644 original/man3/acoshl.3 create mode 100644 original/man3/acosl.3 create mode 100644 original/man3/addmntent.3 create mode 100644 original/man3/addseverity.3 create mode 100644 original/man3/adjtime.3 create mode 100644 original/man3/aio_cancel.3 create mode 100644 original/man3/aio_error.3 create mode 100644 original/man3/aio_fsync.3 create mode 100644 original/man3/aio_read.3 create mode 100644 original/man3/aio_return.3 create mode 100644 original/man3/aio_suspend.3 create mode 100644 original/man3/aio_write.3 create mode 100644 original/man3/alloca.3 create mode 100644 original/man3/alphasort.3 create mode 100644 original/man3/argz.3 create mode 100644 original/man3/argz_add.3 create mode 100644 original/man3/argz_add_sep.3 create mode 100644 original/man3/argz_append.3 create mode 100644 original/man3/argz_count.3 create mode 100644 original/man3/argz_create.3 create mode 100644 original/man3/argz_create_sep.3 create mode 100644 original/man3/argz_delete.3 create mode 100644 original/man3/argz_extract.3 create mode 100644 original/man3/argz_insert.3 create mode 100644 original/man3/argz_next.3 create mode 100644 original/man3/argz_replace.3 create mode 100644 original/man3/argz_stringify.3 create mode 100644 original/man3/asctime.3 create mode 100644 original/man3/asctime_r.3 create mode 100644 original/man3/asin.3 create mode 100644 original/man3/asinf.3 create mode 100644 original/man3/asinh.3 create mode 100644 original/man3/asinhf.3 create mode 100644 original/man3/asinhl.3 create mode 100644 original/man3/asinl.3 create mode 100644 original/man3/asprintf.3 create mode 100644 original/man3/assert.3 create mode 100644 original/man3/assert_perror.3 create mode 100644 original/man3/atan.3 create mode 100644 original/man3/atan2.3 create mode 100644 original/man3/atan2f.3 create mode 100644 original/man3/atan2l.3 create mode 100644 original/man3/atanf.3 create mode 100644 original/man3/atanh.3 create mode 100644 original/man3/atanhf.3 create mode 100644 original/man3/atanhl.3 create mode 100644 original/man3/atanl.3 create mode 100644 original/man3/atexit.3 create mode 100644 original/man3/atof.3 create mode 100644 original/man3/atoi.3 create mode 100644 original/man3/atol.3 create mode 100644 original/man3/atoll.3 create mode 100644 original/man3/atoq.3 create mode 100644 original/man3/auth_destroy.3 create mode 100644 original/man3/authnone_create.3 create mode 100644 original/man3/authunix_create.3 create mode 100644 original/man3/authunix_create_default.3 create mode 100644 original/man3/backtrace.3 create mode 100644 original/man3/backtrace_symbols.3 create mode 100644 original/man3/backtrace_symbols_fd.3 create mode 100644 original/man3/basename.3 create mode 100644 original/man3/bcmp.3 create mode 100644 original/man3/bcopy.3 create mode 100644 original/man3/be16toh.3 create mode 100644 original/man3/be32toh.3 create mode 100644 original/man3/be64toh.3 create mode 100644 original/man3/bindresvport.3 create mode 100644 original/man3/bsd_signal.3 create mode 100644 original/man3/bsearch.3 create mode 100644 original/man3/bstring.3 create mode 100644 original/man3/btowc.3 create mode 100644 original/man3/btree.3 create mode 100644 original/man3/byteorder.3 create mode 100644 original/man3/bzero.3 create mode 100644 original/man3/cabs.3 create mode 100644 original/man3/cabsf.3 create mode 100644 original/man3/cabsl.3 create mode 100644 original/man3/cacos.3 create mode 100644 original/man3/cacosf.3 create mode 100644 original/man3/cacosh.3 create mode 100644 original/man3/cacoshf.3 create mode 100644 original/man3/cacoshl.3 create mode 100644 original/man3/cacosl.3 create mode 100644 original/man3/calloc.3 create mode 100644 original/man3/callrpc.3 create mode 100644 original/man3/canonicalize_file_name.3 create mode 100644 original/man3/carg.3 create mode 100644 original/man3/cargf.3 create mode 100644 original/man3/cargl.3 create mode 100644 original/man3/casin.3 create mode 100644 original/man3/casinf.3 create mode 100644 original/man3/casinh.3 create mode 100644 original/man3/casinhf.3 create mode 100644 original/man3/casinhl.3 create mode 100644 original/man3/casinl.3 create mode 100644 original/man3/catan.3 create mode 100644 original/man3/catanf.3 create mode 100644 original/man3/catanh.3 create mode 100644 original/man3/catanhf.3 create mode 100644 original/man3/catanhl.3 create mode 100644 original/man3/catanl.3 create mode 100644 original/man3/catclose.3 create mode 100644 original/man3/catgets.3 create mode 100644 original/man3/catopen.3 create mode 100644 original/man3/cbc_crypt.3 create mode 100644 original/man3/cbrt.3 create mode 100644 original/man3/cbrtf.3 create mode 100644 original/man3/cbrtl.3 create mode 100644 original/man3/ccos.3 create mode 100644 original/man3/ccosf.3 create mode 100644 original/man3/ccosh.3 create mode 100644 original/man3/ccoshf.3 create mode 100644 original/man3/ccoshl.3 create mode 100644 original/man3/ccosl.3 create mode 100644 original/man3/ceil.3 create mode 100644 original/man3/ceilf.3 create mode 100644 original/man3/ceill.3 create mode 100644 original/man3/cerf.3 create mode 100644 original/man3/cerfc.3 create mode 100644 original/man3/cerfcf.3 create mode 100644 original/man3/cerfcl.3 create mode 100644 original/man3/cerff.3 create mode 100644 original/man3/cerfl.3 create mode 100644 original/man3/cexp.3 create mode 100644 original/man3/cexp2.3 create mode 100644 original/man3/cexp2f.3 create mode 100644 original/man3/cexp2l.3 create mode 100644 original/man3/cexpf.3 create mode 100644 original/man3/cexpl.3 create mode 100644 original/man3/cfgetispeed.3 create mode 100644 original/man3/cfgetospeed.3 create mode 100644 original/man3/cfmakeraw.3 create mode 100644 original/man3/cfree.3 create mode 100644 original/man3/cfsetispeed.3 create mode 100644 original/man3/cfsetospeed.3 create mode 100644 original/man3/cfsetspeed.3 create mode 100644 original/man3/cimag.3 create mode 100644 original/man3/cimagf.3 create mode 100644 original/man3/cimagl.3 create mode 100644 original/man3/clearenv.3 create mode 100644 original/man3/clearerr.3 create mode 100644 original/man3/clearerr_unlocked.3 create mode 100644 original/man3/clnt_broadcast.3 create mode 100644 original/man3/clnt_call.3 create mode 100644 original/man3/clnt_control.3 create mode 100644 original/man3/clnt_create.3 create mode 100644 original/man3/clnt_destroy.3 create mode 100644 original/man3/clnt_freeres.3 create mode 100644 original/man3/clnt_geterr.3 create mode 100644 original/man3/clnt_pcreateerror.3 create mode 100644 original/man3/clnt_perrno.3 create mode 100644 original/man3/clnt_perror.3 create mode 100644 original/man3/clnt_spcreateerror.3 create mode 100644 original/man3/clnt_sperrno.3 create mode 100644 original/man3/clnt_sperror.3 create mode 100644 original/man3/clntraw_create.3 create mode 100644 original/man3/clnttcp_create.3 create mode 100644 original/man3/clntudp_bufcreate.3 create mode 100644 original/man3/clntudp_create.3 create mode 100644 original/man3/clock.3 create mode 100644 original/man3/clock_getcpuclockid.3 create mode 100644 original/man3/clock_getres.3 create mode 100644 original/man3/clock_gettime.3 create mode 100644 original/man3/clock_settime.3 create mode 100644 original/man3/clog.3 create mode 100644 original/man3/clog10.3 create mode 100644 original/man3/clog10f.3 create mode 100644 original/man3/clog10l.3 create mode 100644 original/man3/clog2.3 create mode 100644 original/man3/clog2f.3 create mode 100644 original/man3/clog2l.3 create mode 100644 original/man3/clogf.3 create mode 100644 original/man3/clogl.3 create mode 100644 original/man3/closedir.3 create mode 100644 original/man3/closelog.3 create mode 100644 original/man3/cmsg.3 create mode 100644 original/man3/confstr.3 create mode 100644 original/man3/conj.3 create mode 100644 original/man3/conjf.3 create mode 100644 original/man3/conjl.3 create mode 100644 original/man3/copysign.3 create mode 100644 original/man3/copysignf.3 create mode 100644 original/man3/copysignl.3 create mode 100644 original/man3/cos.3 create mode 100644 original/man3/cosf.3 create mode 100644 original/man3/cosh.3 create mode 100644 original/man3/coshf.3 create mode 100644 original/man3/coshl.3 create mode 100644 original/man3/cosl.3 create mode 100644 original/man3/cpow.3 create mode 100644 original/man3/cpowf.3 create mode 100644 original/man3/cpowl.3 create mode 100644 original/man3/cproj.3 create mode 100644 original/man3/cprojf.3 create mode 100644 original/man3/cprojl.3 create mode 100644 original/man3/creal.3 create mode 100644 original/man3/crealf.3 create mode 100644 original/man3/creall.3 create mode 100644 original/man3/crypt.3 create mode 100644 original/man3/crypt_r.3 create mode 100644 original/man3/csin.3 create mode 100644 original/man3/csinf.3 create mode 100644 original/man3/csinh.3 create mode 100644 original/man3/csinhf.3 create mode 100644 original/man3/csinhl.3 create mode 100644 original/man3/csinl.3 create mode 100644 original/man3/csqrt.3 create mode 100644 original/man3/csqrtf.3 create mode 100644 original/man3/csqrtl.3 create mode 100644 original/man3/ctan.3 create mode 100644 original/man3/ctanf.3 create mode 100644 original/man3/ctanh.3 create mode 100644 original/man3/ctanhf.3 create mode 100644 original/man3/ctanhl.3 create mode 100644 original/man3/ctanl.3 create mode 100644 original/man3/ctermid.3 create mode 100644 original/man3/ctime.3 create mode 100644 original/man3/ctime_r.3 create mode 100644 original/man3/cuserid.3 create mode 100644 original/man3/daemon.3 create mode 100644 original/man3/daylight.3 create mode 100644 original/man3/db.3 create mode 100644 original/man3/dbopen.3 create mode 100644 original/man3/des_crypt.3 create mode 100644 original/man3/des_setparity.3 create mode 100644 original/man3/difftime.3 create mode 100644 original/man3/dirfd.3 create mode 100644 original/man3/dirname.3 create mode 100644 original/man3/div.3 create mode 100644 original/man3/dl_iterate_phdr.3 create mode 100644 original/man3/dladdr.3 create mode 100644 original/man3/dlclose.3 create mode 100644 original/man3/dlerror.3 create mode 100644 original/man3/dlopen.3 create mode 100644 original/man3/dlsym.3 create mode 100644 original/man3/dlvsym.3 create mode 100644 original/man3/dn_comp.3 create mode 100644 original/man3/dn_expand.3 create mode 100644 original/man3/dprintf.3 create mode 100644 original/man3/drand48.3 create mode 100644 original/man3/drand48_r.3 create mode 100644 original/man3/drem.3 create mode 100644 original/man3/dremf.3 create mode 100644 original/man3/dreml.3 create mode 100644 original/man3/dysize.3 create mode 100644 original/man3/eaccess.3 create mode 100644 original/man3/ecb_crypt.3 create mode 100644 original/man3/ecvt.3 create mode 100644 original/man3/ecvt_r.3 create mode 100644 original/man3/edata.3 create mode 100644 original/man3/encrypt.3 create mode 100644 original/man3/encrypt_r.3 create mode 100644 original/man3/end.3 create mode 100644 original/man3/endaliasent.3 create mode 100644 original/man3/endfsent.3 create mode 100644 original/man3/endgrent.3 create mode 100644 original/man3/endhostent.3 create mode 100644 original/man3/endian.3 create mode 100644 original/man3/endmntent.3 create mode 100644 original/man3/endnetent.3 create mode 100644 original/man3/endnetgrent.3 create mode 100644 original/man3/endprotoent.3 create mode 100644 original/man3/endpwent.3 create mode 100644 original/man3/endrpcent.3 create mode 100644 original/man3/endservent.3 create mode 100644 original/man3/endspent.3 create mode 100644 original/man3/endttyent.3 create mode 100644 original/man3/endusershell.3 create mode 100644 original/man3/endutent.3 create mode 100644 original/man3/endutxent.3 create mode 100644 original/man3/envz.3 create mode 100644 original/man3/envz_add.3 create mode 100644 original/man3/envz_entry.3 create mode 100644 original/man3/envz_get.3 create mode 100644 original/man3/envz_merge.3 create mode 100644 original/man3/envz_remove.3 create mode 100644 original/man3/envz_strip.3 create mode 100644 original/man3/erand48.3 create mode 100644 original/man3/erand48_r.3 create mode 100644 original/man3/erf.3 create mode 100644 original/man3/erfc.3 create mode 100644 original/man3/erfcf.3 create mode 100644 original/man3/erfcl.3 create mode 100644 original/man3/erff.3 create mode 100644 original/man3/erfl.3 create mode 100644 original/man3/err.3 create mode 100644 original/man3/errno.3 create mode 100644 original/man3/error.3 create mode 100644 original/man3/error_at_line.3 create mode 100644 original/man3/error_message_count.3 create mode 100644 original/man3/error_on_per_line.3 create mode 100644 original/man3/error_print_progname.3 create mode 100644 original/man3/errx.3 create mode 100644 original/man3/etext.3 create mode 100644 original/man3/ether_aton.3 create mode 100644 original/man3/ether_aton_r.3 create mode 100644 original/man3/ether_hostton.3 create mode 100644 original/man3/ether_line.3 create mode 100644 original/man3/ether_ntoa.3 create mode 100644 original/man3/ether_ntoa_r.3 create mode 100644 original/man3/ether_ntohost.3 create mode 100644 original/man3/euidaccess.3 create mode 100644 original/man3/eventfd_read.3 create mode 100644 original/man3/eventfd_write.3 create mode 100644 original/man3/exec.3 create mode 100644 original/man3/execl.3 create mode 100644 original/man3/execle.3 create mode 100644 original/man3/execlp.3 create mode 100644 original/man3/execv.3 create mode 100644 original/man3/execvp.3 create mode 100644 original/man3/exit.3 create mode 100644 original/man3/exp.3 create mode 100644 original/man3/exp10.3 create mode 100644 original/man3/exp10f.3 create mode 100644 original/man3/exp10l.3 create mode 100644 original/man3/exp2.3 create mode 100644 original/man3/exp2f.3 create mode 100644 original/man3/exp2l.3 create mode 100644 original/man3/expf.3 create mode 100644 original/man3/expl.3 create mode 100644 original/man3/expm1.3 create mode 100644 original/man3/expm1f.3 create mode 100644 original/man3/expm1l.3 create mode 100644 original/man3/fabs.3 create mode 100644 original/man3/fabsf.3 create mode 100644 original/man3/fabsl.3 create mode 100644 original/man3/fclose.3 create mode 100644 original/man3/fcloseall.3 create mode 100644 original/man3/fcvt.3 create mode 100644 original/man3/fcvt_r.3 create mode 100644 original/man3/fdim.3 create mode 100644 original/man3/fdimf.3 create mode 100644 original/man3/fdiml.3 create mode 100644 original/man3/fdopen.3 create mode 100644 original/man3/fdopendir.3 create mode 100644 original/man3/feclearexcept.3 create mode 100644 original/man3/fedisableexcept.3 create mode 100644 original/man3/feenableexcept.3 create mode 100644 original/man3/fegetenv.3 create mode 100644 original/man3/fegetexcept.3 create mode 100644 original/man3/fegetexceptflag.3 create mode 100644 original/man3/fegetround.3 create mode 100644 original/man3/feholdexcept.3 create mode 100644 original/man3/fenv.3 create mode 100644 original/man3/feof.3 create mode 100644 original/man3/feof_unlocked.3 create mode 100644 original/man3/feraiseexcept.3 create mode 100644 original/man3/ferror.3 create mode 100644 original/man3/ferror_unlocked.3 create mode 100644 original/man3/fesetenv.3 create mode 100644 original/man3/fesetexceptflag.3 create mode 100644 original/man3/fesetround.3 create mode 100644 original/man3/fetestexcept.3 create mode 100644 original/man3/feupdateenv.3 create mode 100644 original/man3/fexecve.3 create mode 100644 original/man3/fflush.3 create mode 100644 original/man3/fflush_unlocked.3 create mode 100644 original/man3/ffs.3 create mode 100644 original/man3/ffsl.3 create mode 100644 original/man3/ffsll.3 create mode 100644 original/man3/fgetc.3 create mode 100644 original/man3/fgetc_unlocked.3 create mode 100644 original/man3/fgetgrent.3 create mode 100644 original/man3/fgetgrent_r.3 create mode 100644 original/man3/fgetpos.3 create mode 100644 original/man3/fgetpwent.3 create mode 100644 original/man3/fgetpwent_r.3 create mode 100644 original/man3/fgets.3 create mode 100644 original/man3/fgets_unlocked.3 create mode 100644 original/man3/fgetspent.3 create mode 100644 original/man3/fgetspent_r.3 create mode 100644 original/man3/fgetwc.3 create mode 100644 original/man3/fgetwc_unlocked.3 create mode 100644 original/man3/fgetws.3 create mode 100644 original/man3/fgetws_unlocked.3 create mode 100644 original/man3/fileno.3 create mode 100644 original/man3/fileno_unlocked.3 create mode 100644 original/man3/finite.3 create mode 100644 original/man3/finitef.3 create mode 100644 original/man3/finitel.3 create mode 100644 original/man3/flockfile.3 create mode 100644 original/man3/floor.3 create mode 100644 original/man3/floorf.3 create mode 100644 original/man3/floorl.3 create mode 100644 original/man3/fma.3 create mode 100644 original/man3/fmaf.3 create mode 100644 original/man3/fmal.3 create mode 100644 original/man3/fmax.3 create mode 100644 original/man3/fmaxf.3 create mode 100644 original/man3/fmaxl.3 create mode 100644 original/man3/fmemopen.3 create mode 100644 original/man3/fmin.3 create mode 100644 original/man3/fminf.3 create mode 100644 original/man3/fminl.3 create mode 100644 original/man3/fmod.3 create mode 100644 original/man3/fmodf.3 create mode 100644 original/man3/fmodl.3 create mode 100644 original/man3/fmtmsg.3 create mode 100644 original/man3/fnmatch.3 create mode 100644 original/man3/fopen.3 create mode 100644 original/man3/fopencookie.3 create mode 100644 original/man3/forkpty.3 create mode 100644 original/man3/fpathconf.3 create mode 100644 original/man3/fpclassify.3 create mode 100644 original/man3/fprintf.3 create mode 100644 original/man3/fpurge.3 create mode 100644 original/man3/fputc.3 create mode 100644 original/man3/fputc_unlocked.3 create mode 100644 original/man3/fputs.3 create mode 100644 original/man3/fputs_unlocked.3 create mode 100644 original/man3/fputwc.3 create mode 100644 original/man3/fputwc_unlocked.3 create mode 100644 original/man3/fputws.3 create mode 100644 original/man3/fputws_unlocked.3 create mode 100644 original/man3/fread.3 create mode 100644 original/man3/fread_unlocked.3 create mode 100644 original/man3/free.3 create mode 100644 original/man3/freeaddrinfo.3 create mode 100644 original/man3/freehostent.3 create mode 100644 original/man3/freeifaddrs.3 create mode 100644 original/man3/freopen.3 create mode 100644 original/man3/frexp.3 create mode 100644 original/man3/frexpf.3 create mode 100644 original/man3/frexpl.3 create mode 100644 original/man3/fscanf.3 create mode 100644 original/man3/fseek.3 create mode 100644 original/man3/fseeko.3 create mode 100644 original/man3/fsetpos.3 create mode 100644 original/man3/ftell.3 create mode 100644 original/man3/ftello.3 create mode 100644 original/man3/ftime.3 create mode 100644 original/man3/ftok.3 create mode 100644 original/man3/ftrylockfile.3 create mode 100644 original/man3/fts.3 create mode 100644 original/man3/fts_children.3 create mode 100644 original/man3/fts_close.3 create mode 100644 original/man3/fts_open.3 create mode 100644 original/man3/fts_read.3 create mode 100644 original/man3/fts_set.3 create mode 100644 original/man3/ftw.3 create mode 100644 original/man3/funlockfile.3 create mode 100644 original/man3/futimens.3 create mode 100644 original/man3/futimes.3 create mode 100644 original/man3/fwide.3 create mode 100644 original/man3/fwprintf.3 create mode 100644 original/man3/fwrite.3 create mode 100644 original/man3/fwrite_unlocked.3 create mode 100644 original/man3/gai_strerror.3 create mode 100644 original/man3/gamma.3 create mode 100644 original/man3/gammaf.3 create mode 100644 original/man3/gammal.3 create mode 100644 original/man3/gcvt.3 create mode 100644 original/man3/get_current_dir_name.3 create mode 100644 original/man3/get_myaddress.3 create mode 100644 original/man3/getaddrinfo.3 create mode 100644 original/man3/getaliasbyname.3 create mode 100644 original/man3/getaliasbyname_r.3 create mode 100644 original/man3/getaliasent.3 create mode 100644 original/man3/getaliasent_r.3 create mode 100644 original/man3/getc.3 create mode 100644 original/man3/getc_unlocked.3 create mode 100644 original/man3/getchar.3 create mode 100644 original/man3/getchar_unlocked.3 create mode 100644 original/man3/getcwd.3 create mode 100644 original/man3/getdate.3 create mode 100644 original/man3/getdate_err.3 create mode 100644 original/man3/getdate_r.3 create mode 100644 original/man3/getdelim.3 create mode 100644 original/man3/getdirentries.3 create mode 100644 original/man3/getenv.3 create mode 100644 original/man3/getfsent.3 create mode 100644 original/man3/getfsfile.3 create mode 100644 original/man3/getfsspec.3 create mode 100644 original/man3/getgrent.3 create mode 100644 original/man3/getgrent_r.3 create mode 100644 original/man3/getgrgid.3 create mode 100644 original/man3/getgrgid_r.3 create mode 100644 original/man3/getgrnam.3 create mode 100644 original/man3/getgrnam_r.3 create mode 100644 original/man3/getgrouplist.3 create mode 100644 original/man3/gethostbyaddr.3 create mode 100644 original/man3/gethostbyaddr_r.3 create mode 100644 original/man3/gethostbyname.3 create mode 100644 original/man3/gethostbyname2.3 create mode 100644 original/man3/gethostbyname2_r.3 create mode 100644 original/man3/gethostbyname_r.3 create mode 100644 original/man3/gethostent.3 create mode 100644 original/man3/gethostent_r.3 create mode 100644 original/man3/gethostid.3 create mode 100644 original/man3/getifaddrs.3 create mode 100644 original/man3/getipnodebyaddr.3 create mode 100644 original/man3/getipnodebyname.3 create mode 100644 original/man3/getline.3 create mode 100644 original/man3/getloadavg.3 create mode 100644 original/man3/getlogin.3 create mode 100644 original/man3/getlogin_r.3 create mode 100644 original/man3/getmntent.3 create mode 100644 original/man3/getmntent_r.3 create mode 100644 original/man3/getnameinfo.3 create mode 100644 original/man3/getnetbyaddr.3 create mode 100644 original/man3/getnetbyaddr_r.3 create mode 100644 original/man3/getnetbyname.3 create mode 100644 original/man3/getnetbyname_r.3 create mode 100644 original/man3/getnetent.3 create mode 100644 original/man3/getnetent_r.3 create mode 100644 original/man3/getnetgrent.3 create mode 100644 original/man3/getnetgrent_r.3 create mode 100644 original/man3/getopt.3 create mode 100644 original/man3/getopt_long.3 create mode 100644 original/man3/getopt_long_only.3 create mode 100644 original/man3/getpass.3 create mode 100644 original/man3/getprotobyname.3 create mode 100644 original/man3/getprotobyname_r.3 create mode 100644 original/man3/getprotobynumber.3 create mode 100644 original/man3/getprotobynumber_r.3 create mode 100644 original/man3/getprotoent.3 create mode 100644 original/man3/getprotoent_r.3 create mode 100644 original/man3/getpt.3 create mode 100644 original/man3/getpw.3 create mode 100644 original/man3/getpwent.3 create mode 100644 original/man3/getpwent_r.3 create mode 100644 original/man3/getpwnam.3 create mode 100644 original/man3/getpwnam_r.3 create mode 100644 original/man3/getpwuid.3 create mode 100644 original/man3/getpwuid_r.3 create mode 100644 original/man3/getrpcbyname.3 create mode 100644 original/man3/getrpcbyname_r.3 create mode 100644 original/man3/getrpcbynumber.3 create mode 100644 original/man3/getrpcbynumber_r.3 create mode 100644 original/man3/getrpcent.3 create mode 100644 original/man3/getrpcent_r.3 create mode 100644 original/man3/getrpcport.3 create mode 100644 original/man3/gets.3 create mode 100644 original/man3/getservbyname.3 create mode 100644 original/man3/getservbyname_r.3 create mode 100644 original/man3/getservbyport.3 create mode 100644 original/man3/getservbyport_r.3 create mode 100644 original/man3/getservent.3 create mode 100644 original/man3/getservent_r.3 create mode 100644 original/man3/getspent.3 create mode 100644 original/man3/getspent_r.3 create mode 100644 original/man3/getspnam.3 create mode 100644 original/man3/getspnam_r.3 create mode 100644 original/man3/getsubopt.3 create mode 100644 original/man3/getttyent.3 create mode 100644 original/man3/getttynam.3 create mode 100644 original/man3/getumask.3 create mode 100644 original/man3/getusershell.3 create mode 100644 original/man3/getutent.3 create mode 100644 original/man3/getutent_r.3 create mode 100644 original/man3/getutid.3 create mode 100644 original/man3/getutid_r.3 create mode 100644 original/man3/getutline.3 create mode 100644 original/man3/getutline_r.3 create mode 100644 original/man3/getutmp.3 create mode 100644 original/man3/getutmpx.3 create mode 100644 original/man3/getutxent.3 create mode 100644 original/man3/getutxid.3 create mode 100644 original/man3/getutxline.3 create mode 100644 original/man3/getw.3 create mode 100644 original/man3/getwc.3 create mode 100644 original/man3/getwc_unlocked.3 create mode 100644 original/man3/getwchar.3 create mode 100644 original/man3/getwchar_unlocked.3 create mode 100644 original/man3/getwd.3 create mode 100644 original/man3/glob.3 create mode 100644 original/man3/globfree.3 create mode 100644 original/man3/gmtime.3 create mode 100644 original/man3/gmtime_r.3 create mode 100644 original/man3/gnu_dev_major.3 create mode 100644 original/man3/gnu_dev_makedev.3 create mode 100644 original/man3/gnu_dev_minor.3 create mode 100644 original/man3/gnu_get_libc_release.3 create mode 100644 original/man3/gnu_get_libc_version.3 create mode 100644 original/man3/grantpt.3 create mode 100644 original/man3/gsignal.3 create mode 100644 original/man3/h_errno.3 create mode 100644 original/man3/hash.3 create mode 100644 original/man3/hasmntopt.3 create mode 100644 original/man3/hcreate.3 create mode 100644 original/man3/hcreate_r.3 create mode 100644 original/man3/hdestroy.3 create mode 100644 original/man3/hdestroy_r.3 create mode 100644 original/man3/herror.3 create mode 100644 original/man3/hsearch.3 create mode 100644 original/man3/hsearch_r.3 create mode 100644 original/man3/hstrerror.3 create mode 100644 original/man3/htobe16.3 create mode 100644 original/man3/htobe32.3 create mode 100644 original/man3/htobe64.3 create mode 100644 original/man3/htole16.3 create mode 100644 original/man3/htole32.3 create mode 100644 original/man3/htole64.3 create mode 100644 original/man3/htonl.3 create mode 100644 original/man3/htons.3 create mode 100644 original/man3/hypot.3 create mode 100644 original/man3/hypotf.3 create mode 100644 original/man3/hypotl.3 create mode 100644 original/man3/iconv.3 create mode 100644 original/man3/iconv_close.3 create mode 100644 original/man3/iconv_open.3 create mode 100644 original/man3/ilogb.3 create mode 100644 original/man3/ilogbf.3 create mode 100644 original/man3/ilogbl.3 create mode 100644 original/man3/imaxabs.3 create mode 100644 original/man3/imaxdiv.3 create mode 100644 original/man3/index.3 create mode 100644 original/man3/inet.3 create mode 100644 original/man3/inet_addr.3 create mode 100644 original/man3/inet_aton.3 create mode 100644 original/man3/inet_lnaof.3 create mode 100644 original/man3/inet_makeaddr.3 create mode 100644 original/man3/inet_netof.3 create mode 100644 original/man3/inet_network.3 create mode 100644 original/man3/inet_ntoa.3 create mode 100644 original/man3/inet_ntop.3 create mode 100644 original/man3/inet_pton.3 create mode 100644 original/man3/infnan.3 create mode 100644 original/man3/initgroups.3 create mode 100644 original/man3/initstate.3 create mode 100644 original/man3/initstate_r.3 create mode 100644 original/man3/innetgr.3 create mode 100644 original/man3/insque.3 create mode 100644 original/man3/intro.3 create mode 100644 original/man3/iruserok.3 create mode 100644 original/man3/isalnum.3 create mode 100644 original/man3/isalpha.3 create mode 100644 original/man3/isascii.3 create mode 100644 original/man3/isatty.3 create mode 100644 original/man3/isblank.3 create mode 100644 original/man3/iscntrl.3 create mode 100644 original/man3/isdigit.3 create mode 100644 original/man3/isfinite.3 create mode 100644 original/man3/isgraph.3 create mode 100644 original/man3/isgreater.3 create mode 100644 original/man3/isgreaterequal.3 create mode 100644 original/man3/isinf.3 create mode 100644 original/man3/isinff.3 create mode 100644 original/man3/isinfl.3 create mode 100644 original/man3/isless.3 create mode 100644 original/man3/islessequal.3 create mode 100644 original/man3/islessgreater.3 create mode 100644 original/man3/islower.3 create mode 100644 original/man3/isnan.3 create mode 100644 original/man3/isnanf.3 create mode 100644 original/man3/isnanl.3 create mode 100644 original/man3/isnormal.3 create mode 100644 original/man3/isprint.3 create mode 100644 original/man3/ispunct.3 create mode 100644 original/man3/isspace.3 create mode 100644 original/man3/isunordered.3 create mode 100644 original/man3/isupper.3 create mode 100644 original/man3/iswalnum.3 create mode 100644 original/man3/iswalpha.3 create mode 100644 original/man3/iswblank.3 create mode 100644 original/man3/iswcntrl.3 create mode 100644 original/man3/iswctype.3 create mode 100644 original/man3/iswdigit.3 create mode 100644 original/man3/iswgraph.3 create mode 100644 original/man3/iswlower.3 create mode 100644 original/man3/iswprint.3 create mode 100644 original/man3/iswpunct.3 create mode 100644 original/man3/iswspace.3 create mode 100644 original/man3/iswupper.3 create mode 100644 original/man3/iswxdigit.3 create mode 100644 original/man3/isxdigit.3 create mode 100644 original/man3/j0.3 create mode 100644 original/man3/j0f.3 create mode 100644 original/man3/j0l.3 create mode 100644 original/man3/j1.3 create mode 100644 original/man3/j1f.3 create mode 100644 original/man3/j1l.3 create mode 100644 original/man3/jn.3 create mode 100644 original/man3/jnf.3 create mode 100644 original/man3/jnl.3 create mode 100644 original/man3/jrand48.3 create mode 100644 original/man3/jrand48_r.3 create mode 100644 original/man3/key_decryptsession.3 create mode 100644 original/man3/key_encryptsession.3 create mode 100644 original/man3/key_gendes.3 create mode 100644 original/man3/key_secretkey_is_set.3 create mode 100644 original/man3/key_setsecret.3 create mode 100644 original/man3/klogctl.3 create mode 100644 original/man3/l64a.3 create mode 100644 original/man3/labs.3 create mode 100644 original/man3/lckpwdf.3 create mode 100644 original/man3/lcong48.3 create mode 100644 original/man3/lcong48_r.3 create mode 100644 original/man3/ldexp.3 create mode 100644 original/man3/ldexpf.3 create mode 100644 original/man3/ldexpl.3 create mode 100644 original/man3/ldiv.3 create mode 100644 original/man3/le16toh.3 create mode 100644 original/man3/le32toh.3 create mode 100644 original/man3/le64toh.3 create mode 100644 original/man3/lfind.3 create mode 100644 original/man3/lgamma.3 create mode 100644 original/man3/lgamma_r.3 create mode 100644 original/man3/lgammaf.3 create mode 100644 original/man3/lgammaf_r.3 create mode 100644 original/man3/lgammal.3 create mode 100644 original/man3/lgammal_r.3 create mode 100644 original/man3/llabs.3 create mode 100644 original/man3/lldiv.3 create mode 100644 original/man3/llrint.3 create mode 100644 original/man3/llrintf.3 create mode 100644 original/man3/llrintl.3 create mode 100644 original/man3/llround.3 create mode 100644 original/man3/llroundf.3 create mode 100644 original/man3/llroundl.3 create mode 100644 original/man3/localeconv.3 create mode 100644 original/man3/localtime.3 create mode 100644 original/man3/localtime_r.3 create mode 100644 original/man3/lockf.3 create mode 100644 original/man3/log.3 create mode 100644 original/man3/log10.3 create mode 100644 original/man3/log10f.3 create mode 100644 original/man3/log10l.3 create mode 100644 original/man3/log1p.3 create mode 100644 original/man3/log1pf.3 create mode 100644 original/man3/log1pl.3 create mode 100644 original/man3/log2.3 create mode 100644 original/man3/log2f.3 create mode 100644 original/man3/log2l.3 create mode 100644 original/man3/logb.3 create mode 100644 original/man3/logbf.3 create mode 100644 original/man3/logbl.3 create mode 100644 original/man3/logf.3 create mode 100644 original/man3/login.3 create mode 100644 original/man3/login_tty.3 create mode 100644 original/man3/logl.3 create mode 100644 original/man3/logout.3 create mode 100644 original/man3/logwtmp.3 create mode 100644 original/man3/longjmp.3 create mode 100644 original/man3/lrand48.3 create mode 100644 original/man3/lrand48_r.3 create mode 100644 original/man3/lrint.3 create mode 100644 original/man3/lrintf.3 create mode 100644 original/man3/lrintl.3 create mode 100644 original/man3/lround.3 create mode 100644 original/man3/lroundf.3 create mode 100644 original/man3/lroundl.3 create mode 100644 original/man3/lsearch.3 create mode 100644 original/man3/lseek64.3 create mode 100644 original/man3/lutimes.3 create mode 100644 original/man3/major.3 create mode 100644 original/man3/makecontext.3 create mode 100644 original/man3/makedev.3 create mode 100644 original/man3/malloc.3 create mode 100644 original/man3/malloc_hook.3 create mode 100644 original/man3/matherr.3 create mode 100644 original/man3/mblen.3 create mode 100644 original/man3/mbrlen.3 create mode 100644 original/man3/mbrtowc.3 create mode 100644 original/man3/mbsinit.3 create mode 100644 original/man3/mbsnrtowcs.3 create mode 100644 original/man3/mbsrtowcs.3 create mode 100644 original/man3/mbstowcs.3 create mode 100644 original/man3/mbtowc.3 create mode 100644 original/man3/memalign.3 create mode 100644 original/man3/memccpy.3 create mode 100644 original/man3/memchr.3 create mode 100644 original/man3/memcmp.3 create mode 100644 original/man3/memcpy.3 create mode 100644 original/man3/memfrob.3 create mode 100644 original/man3/memmem.3 create mode 100644 original/man3/memmove.3 create mode 100644 original/man3/mempcpy.3 create mode 100644 original/man3/memrchr.3 create mode 100644 original/man3/memset.3 create mode 100644 original/man3/minor.3 create mode 100644 original/man3/mkdtemp.3 create mode 100644 original/man3/mkfifo.3 create mode 100644 original/man3/mkfifoat.3 create mode 100644 original/man3/mkostemp.3 create mode 100644 original/man3/mkstemp.3 create mode 100644 original/man3/mktemp.3 create mode 100644 original/man3/mktime.3 create mode 100644 original/man3/mmap64.3 create mode 100644 original/man3/modf.3 create mode 100644 original/man3/modff.3 create mode 100644 original/man3/modfl.3 create mode 100644 original/man3/mpool.3 create mode 100644 original/man3/mq_close.3 create mode 100644 original/man3/mq_getattr.3 create mode 100644 original/man3/mq_notify.3 create mode 100644 original/man3/mq_open.3 create mode 100644 original/man3/mq_receive.3 create mode 100644 original/man3/mq_send.3 create mode 100644 original/man3/mq_setattr.3 create mode 100644 original/man3/mq_timedreceive.3 create mode 100644 original/man3/mq_timedsend.3 create mode 100644 original/man3/mq_unlink.3 create mode 100644 original/man3/mrand48.3 create mode 100644 original/man3/mrand48_r.3 create mode 100644 original/man3/mtrace.3 create mode 100644 original/man3/muntrace.3 create mode 100644 original/man3/nan.3 create mode 100644 original/man3/nanf.3 create mode 100644 original/man3/nanl.3 create mode 100644 original/man3/nearbyint.3 create mode 100644 original/man3/nearbyintf.3 create mode 100644 original/man3/nearbyintl.3 create mode 100644 original/man3/netlink.3 create mode 100644 original/man3/nextafter.3 create mode 100644 original/man3/nextafterf.3 create mode 100644 original/man3/nextafterl.3 create mode 100644 original/man3/nexttoward.3 create mode 100644 original/man3/nexttowardf.3 create mode 100644 original/man3/nexttowardl.3 create mode 100644 original/man3/nftw.3 create mode 100644 original/man3/nl_langinfo.3 create mode 100644 original/man3/nrand48.3 create mode 100644 original/man3/nrand48_r.3 create mode 100644 original/man3/ntohl.3 create mode 100644 original/man3/ntohs.3 create mode 100644 original/man3/offsetof.3 create mode 100644 original/man3/on_exit.3 create mode 100644 original/man3/open_memstream.3 create mode 100644 original/man3/open_wmemstream.3 create mode 100644 original/man3/opendir.3 create mode 100644 original/man3/openlog.3 create mode 100644 original/man3/openpty.3 create mode 100644 original/man3/optarg.3 create mode 100644 original/man3/opterr.3 create mode 100644 original/man3/optind.3 create mode 100644 original/man3/optopt.3 create mode 100644 original/man3/passwd2des.3 create mode 100644 original/man3/pathconf.3 create mode 100644 original/man3/pclose.3 create mode 100644 original/man3/perror.3 create mode 100644 original/man3/pmap_getmaps.3 create mode 100644 original/man3/pmap_getport.3 create mode 100644 original/man3/pmap_rmtcall.3 create mode 100644 original/man3/pmap_set.3 create mode 100644 original/man3/pmap_unset.3 create mode 100644 original/man3/popen.3 create mode 100644 original/man3/posix_fallocate.3 create mode 100644 original/man3/posix_memalign.3 create mode 100644 original/man3/posix_openpt.3 create mode 100644 original/man3/pow.3 create mode 100644 original/man3/pow10.3 create mode 100644 original/man3/pow10f.3 create mode 100644 original/man3/pow10l.3 create mode 100644 original/man3/powf.3 create mode 100644 original/man3/powl.3 create mode 100644 original/man3/printf.3 create mode 100644 original/man3/profil.3 create mode 100644 original/man3/program_invocation_name.3 create mode 100644 original/man3/program_invocation_short_name.3 create mode 100644 original/man3/psignal.3 create mode 100644 original/man3/pthread_attr_destroy.3 create mode 100644 original/man3/pthread_attr_getaffinity_np.3 create mode 100644 original/man3/pthread_attr_getdetachstate.3 create mode 100644 original/man3/pthread_attr_getguardsize.3 create mode 100644 original/man3/pthread_attr_getinheritsched.3 create mode 100644 original/man3/pthread_attr_getschedparam.3 create mode 100644 original/man3/pthread_attr_getschedpolicy.3 create mode 100644 original/man3/pthread_attr_getscope.3 create mode 100644 original/man3/pthread_attr_getstack.3 create mode 100644 original/man3/pthread_attr_getstackaddr.3 create mode 100644 original/man3/pthread_attr_getstacksize.3 create mode 100644 original/man3/pthread_attr_init.3 create mode 100644 original/man3/pthread_attr_setaffinity_np.3 create mode 100644 original/man3/pthread_attr_setdetachstate.3 create mode 100644 original/man3/pthread_attr_setguardsize.3 create mode 100644 original/man3/pthread_attr_setinheritsched.3 create mode 100644 original/man3/pthread_attr_setschedparam.3 create mode 100644 original/man3/pthread_attr_setschedpolicy.3 create mode 100644 original/man3/pthread_attr_setscope.3 create mode 100644 original/man3/pthread_attr_setstack.3 create mode 100644 original/man3/pthread_attr_setstackaddr.3 create mode 100644 original/man3/pthread_attr_setstacksize.3 create mode 100644 original/man3/pthread_cancel.3 create mode 100644 original/man3/pthread_cleanup_pop.3 create mode 100644 original/man3/pthread_cleanup_pop_restore_np.3 create mode 100644 original/man3/pthread_cleanup_push.3 create mode 100644 original/man3/pthread_cleanup_push_defer_np.3 create mode 100644 original/man3/pthread_create.3 create mode 100644 original/man3/pthread_detach.3 create mode 100644 original/man3/pthread_equal.3 create mode 100644 original/man3/pthread_exit.3 create mode 100644 original/man3/pthread_getaffinity_np.3 create mode 100644 original/man3/pthread_getattr_np.3 create mode 100644 original/man3/pthread_getconcurrency.3 create mode 100644 original/man3/pthread_getcpuclockid.3 create mode 100644 original/man3/pthread_getschedparam.3 create mode 100644 original/man3/pthread_join.3 create mode 100644 original/man3/pthread_kill.3 create mode 100644 original/man3/pthread_kill_other_threads_np.3 create mode 100644 original/man3/pthread_self.3 create mode 100644 original/man3/pthread_setaffinity_np.3 create mode 100644 original/man3/pthread_setcancelstate.3 create mode 100644 original/man3/pthread_setcanceltype.3 create mode 100644 original/man3/pthread_setconcurrency.3 create mode 100644 original/man3/pthread_setschedparam.3 create mode 100644 original/man3/pthread_setschedprio.3 create mode 100644 original/man3/pthread_sigmask.3 create mode 100644 original/man3/pthread_testcancel.3 create mode 100644 original/man3/pthread_timedjoin_np.3 create mode 100644 original/man3/pthread_tryjoin_np.3 create mode 100644 original/man3/pthread_yield.3 create mode 100644 original/man3/ptsname.3 create mode 100644 original/man3/ptsname_r.3 create mode 100644 original/man3/putc.3 create mode 100644 original/man3/putc_unlocked.3 create mode 100644 original/man3/putchar.3 create mode 100644 original/man3/putchar_unlocked.3 create mode 100644 original/man3/putenv.3 create mode 100644 original/man3/putgrent.3 create mode 100644 original/man3/putpwent.3 create mode 100644 original/man3/puts.3 create mode 100644 original/man3/putspent.3 create mode 100644 original/man3/pututline.3 create mode 100644 original/man3/pututxline.3 create mode 100644 original/man3/putw.3 create mode 100644 original/man3/putwc.3 create mode 100644 original/man3/putwc_unlocked.3 create mode 100644 original/man3/putwchar.3 create mode 100644 original/man3/putwchar_unlocked.3 create mode 100644 original/man3/qecvt.3 create mode 100644 original/man3/qecvt_r.3 create mode 100644 original/man3/qfcvt.3 create mode 100644 original/man3/qfcvt_r.3 create mode 100644 original/man3/qgcvt.3 create mode 100644 original/man3/qsort.3 create mode 100644 original/man3/queue.3 create mode 100644 original/man3/raise.3 create mode 100644 original/man3/rand.3 create mode 100644 original/man3/rand_r.3 create mode 100644 original/man3/random.3 create mode 100644 original/man3/random_r.3 create mode 100644 original/man3/rawmemchr.3 create mode 100644 original/man3/rcmd.3 create mode 100644 original/man3/re_comp.3 create mode 100644 original/man3/re_exec.3 create mode 100644 original/man3/readdir.3 create mode 100644 original/man3/readdir_r.3 create mode 100644 original/man3/realloc.3 create mode 100644 original/man3/realpath.3 create mode 100644 original/man3/recno.3 create mode 100644 original/man3/regcomp.3 create mode 100644 original/man3/regerror.3 create mode 100644 original/man3/regex.3 create mode 100644 original/man3/regexec.3 create mode 100644 original/man3/regfree.3 create mode 100644 original/man3/registerrpc.3 create mode 100644 original/man3/remainder.3 create mode 100644 original/man3/remainderf.3 create mode 100644 original/man3/remainderl.3 create mode 100644 original/man3/remove.3 create mode 100644 original/man3/remque.3 create mode 100644 original/man3/remquo.3 create mode 100644 original/man3/remquof.3 create mode 100644 original/man3/remquol.3 create mode 100644 original/man3/res_init.3 create mode 100644 original/man3/res_mkquery.3 create mode 100644 original/man3/res_query.3 create mode 100644 original/man3/res_querydomain.3 create mode 100644 original/man3/res_search.3 create mode 100644 original/man3/res_send.3 create mode 100644 original/man3/resolver.3 create mode 100644 original/man3/rewind.3 create mode 100644 original/man3/rewinddir.3 create mode 100644 original/man3/rexec.3 create mode 100644 original/man3/rindex.3 create mode 100644 original/man3/rint.3 create mode 100644 original/man3/rintf.3 create mode 100644 original/man3/rintl.3 create mode 100644 original/man3/round.3 create mode 100644 original/man3/roundf.3 create mode 100644 original/man3/roundl.3 create mode 100644 original/man3/rpc.3 create mode 100644 original/man3/rpmatch.3 create mode 100644 original/man3/rresvport.3 create mode 100644 original/man3/rtime.3 create mode 100644 original/man3/rtnetlink.3 create mode 100644 original/man3/ruserok.3 create mode 100644 original/man3/scalb.3 create mode 100644 original/man3/scalbf.3 create mode 100644 original/man3/scalbl.3 create mode 100644 original/man3/scalbln.3 create mode 100644 original/man3/scalblnf.3 create mode 100644 original/man3/scalblnl.3 create mode 100644 original/man3/scalbn.3 create mode 100644 original/man3/scalbnf.3 create mode 100644 original/man3/scalbnl.3 create mode 100644 original/man3/scandir.3 create mode 100644 original/man3/scanf.3 create mode 100644 original/man3/sched_getcpu.3 create mode 100644 original/man3/seed48.3 create mode 100644 original/man3/seed48_r.3 create mode 100644 original/man3/seekdir.3 create mode 100644 original/man3/sem_close.3 create mode 100644 original/man3/sem_destroy.3 create mode 100644 original/man3/sem_getvalue.3 create mode 100644 original/man3/sem_init.3 create mode 100644 original/man3/sem_open.3 create mode 100644 original/man3/sem_post.3 create mode 100644 original/man3/sem_timedwait.3 create mode 100644 original/man3/sem_trywait.3 create mode 100644 original/man3/sem_unlink.3 create mode 100644 original/man3/sem_wait.3 create mode 100644 original/man3/setaliasent.3 create mode 100644 original/man3/setbuf.3 create mode 100644 original/man3/setbuffer.3 create mode 100644 original/man3/setenv.3 create mode 100644 original/man3/setfsent.3 create mode 100644 original/man3/setgrent.3 create mode 100644 original/man3/sethostent.3 create mode 100644 original/man3/sethostid.3 create mode 100644 original/man3/setjmp.3 create mode 100644 original/man3/setkey.3 create mode 100644 original/man3/setkey_r.3 create mode 100644 original/man3/setlinebuf.3 create mode 100644 original/man3/setlocale.3 create mode 100644 original/man3/setlogmask.3 create mode 100644 original/man3/setmntent.3 create mode 100644 original/man3/setnetent.3 create mode 100644 original/man3/setnetgrent.3 create mode 100644 original/man3/setprotoent.3 create mode 100644 original/man3/setpwent.3 create mode 100644 original/man3/setrpcent.3 create mode 100644 original/man3/setservent.3 create mode 100644 original/man3/setspent.3 create mode 100644 original/man3/setstate.3 create mode 100644 original/man3/setstate_r.3 create mode 100644 original/man3/setttyent.3 create mode 100644 original/man3/setusershell.3 create mode 100644 original/man3/setutent.3 create mode 100644 original/man3/setutxent.3 create mode 100644 original/man3/setvbuf.3 create mode 100644 original/man3/sgetspent.3 create mode 100644 original/man3/sgetspent_r.3 create mode 100644 original/man3/shm_open.3 create mode 100644 original/man3/shm_unlink.3 create mode 100644 original/man3/sigaddset.3 create mode 100644 original/man3/sigandset.3 create mode 100644 original/man3/sigblock.3 create mode 100644 original/man3/sigdelset.3 create mode 100644 original/man3/sigemptyset.3 create mode 100644 original/man3/sigfillset.3 create mode 100644 original/man3/siggetmask.3 create mode 100644 original/man3/sighold.3 create mode 100644 original/man3/sigignore.3 create mode 100644 original/man3/siginterrupt.3 create mode 100644 original/man3/sigisemptyset.3 create mode 100644 original/man3/sigismember.3 create mode 100644 original/man3/siglongjmp.3 create mode 100644 original/man3/sigmask.3 create mode 100644 original/man3/signbit.3 create mode 100644 original/man3/signgam.3 create mode 100644 original/man3/significand.3 create mode 100644 original/man3/significandf.3 create mode 100644 original/man3/significandl.3 create mode 100644 original/man3/sigorset.3 create mode 100644 original/man3/sigpause.3 create mode 100644 original/man3/sigrelse.3 create mode 100644 original/man3/sigset.3 create mode 100644 original/man3/sigsetjmp.3 create mode 100644 original/man3/sigsetmask.3 create mode 100644 original/man3/sigsetops.3 create mode 100644 original/man3/sigvec.3 create mode 100644 original/man3/sigwait.3 create mode 100644 original/man3/sin.3 create mode 100644 original/man3/sincos.3 create mode 100644 original/man3/sincosf.3 create mode 100644 original/man3/sincosl.3 create mode 100644 original/man3/sinf.3 create mode 100644 original/man3/sinh.3 create mode 100644 original/man3/sinhf.3 create mode 100644 original/man3/sinhl.3 create mode 100644 original/man3/sinl.3 create mode 100644 original/man3/sleep.3 create mode 100644 original/man3/snprintf.3 create mode 100644 original/man3/sockatmark.3 create mode 100644 original/man3/sprintf.3 create mode 100644 original/man3/sqrt.3 create mode 100644 original/man3/sqrtf.3 create mode 100644 original/man3/sqrtl.3 create mode 100644 original/man3/srand.3 create mode 100644 original/man3/srand48.3 create mode 100644 original/man3/srand48_r.3 create mode 100644 original/man3/srandom.3 create mode 100644 original/man3/srandom_r.3 create mode 100644 original/man3/sscanf.3 create mode 100644 original/man3/ssignal.3 create mode 100644 original/man3/stdarg.3 create mode 100644 original/man3/stderr.3 create mode 100644 original/man3/stdin.3 create mode 100644 original/man3/stdio.3 create mode 100644 original/man3/stdio_ext.3 create mode 100644 original/man3/stdout.3 create mode 100644 original/man3/stpcpy.3 create mode 100644 original/man3/stpncpy.3 create mode 100644 original/man3/strcasecmp.3 create mode 100644 original/man3/strcasestr.3 create mode 100644 original/man3/strcat.3 create mode 100644 original/man3/strchr.3 create mode 100644 original/man3/strchrnul.3 create mode 100644 original/man3/strcmp.3 create mode 100644 original/man3/strcoll.3 create mode 100644 original/man3/strcpy.3 create mode 100644 original/man3/strcspn.3 create mode 100644 original/man3/strdup.3 create mode 100644 original/man3/strdupa.3 create mode 100644 original/man3/strerror.3 create mode 100644 original/man3/strerror_r.3 create mode 100644 original/man3/strfmon.3 create mode 100644 original/man3/strfry.3 create mode 100644 original/man3/strftime.3 create mode 100644 original/man3/string.3 create mode 100644 original/man3/strlen.3 create mode 100644 original/man3/strncasecmp.3 create mode 100644 original/man3/strncat.3 create mode 100644 original/man3/strncmp.3 create mode 100644 original/man3/strncpy.3 create mode 100644 original/man3/strndup.3 create mode 100644 original/man3/strndupa.3 create mode 100644 original/man3/strnlen.3 create mode 100644 original/man3/strpbrk.3 create mode 100644 original/man3/strptime.3 create mode 100644 original/man3/strrchr.3 create mode 100644 original/man3/strsep.3 create mode 100644 original/man3/strsignal.3 create mode 100644 original/man3/strspn.3 create mode 100644 original/man3/strstr.3 create mode 100644 original/man3/strtod.3 create mode 100644 original/man3/strtof.3 create mode 100644 original/man3/strtoimax.3 create mode 100644 original/man3/strtok.3 create mode 100644 original/man3/strtok_r.3 create mode 100644 original/man3/strtol.3 create mode 100644 original/man3/strtold.3 create mode 100644 original/man3/strtoll.3 create mode 100644 original/man3/strtoq.3 create mode 100644 original/man3/strtoul.3 create mode 100644 original/man3/strtoull.3 create mode 100644 original/man3/strtoumax.3 create mode 100644 original/man3/strtouq.3 create mode 100644 original/man3/strverscmp.3 create mode 100644 original/man3/strxfrm.3 create mode 100644 original/man3/svc_destroy.3 create mode 100644 original/man3/svc_freeargs.3 create mode 100644 original/man3/svc_getargs.3 create mode 100644 original/man3/svc_getcaller.3 create mode 100644 original/man3/svc_getreq.3 create mode 100644 original/man3/svc_getreqset.3 create mode 100644 original/man3/svc_register.3 create mode 100644 original/man3/svc_run.3 create mode 100644 original/man3/svc_sendreply.3 create mode 100644 original/man3/svc_unregister.3 create mode 100644 original/man3/svcerr_auth.3 create mode 100644 original/man3/svcerr_decode.3 create mode 100644 original/man3/svcerr_noproc.3 create mode 100644 original/man3/svcerr_noprog.3 create mode 100644 original/man3/svcerr_progvers.3 create mode 100644 original/man3/svcerr_systemerr.3 create mode 100644 original/man3/svcerr_weakauth.3 create mode 100644 original/man3/svcfd_create.3 create mode 100644 original/man3/svcraw_create.3 create mode 100644 original/man3/svctcp_create.3 create mode 100644 original/man3/svcudp_bufcreate.3 create mode 100644 original/man3/svcudp_create.3 create mode 100644 original/man3/swab.3 create mode 100644 original/man3/swapcontext.3 create mode 100644 original/man3/swprintf.3 create mode 100644 original/man3/sys_errlist.3 create mode 100644 original/man3/sys_nerr.3 create mode 100644 original/man3/sysconf.3 create mode 100644 original/man3/syslog.3 create mode 100644 original/man3/system.3 create mode 100644 original/man3/sysv_signal.3 create mode 100644 original/man3/tan.3 create mode 100644 original/man3/tanf.3 create mode 100644 original/man3/tanh.3 create mode 100644 original/man3/tanhf.3 create mode 100644 original/man3/tanhl.3 create mode 100644 original/man3/tanl.3 create mode 100644 original/man3/tcdrain.3 create mode 100644 original/man3/tcflow.3 create mode 100644 original/man3/tcflush.3 create mode 100644 original/man3/tcgetattr.3 create mode 100644 original/man3/tcgetpgrp.3 create mode 100644 original/man3/tcgetsid.3 create mode 100644 original/man3/tcsendbreak.3 create mode 100644 original/man3/tcsetattr.3 create mode 100644 original/man3/tcsetpgrp.3 create mode 100644 original/man3/tdelete.3 create mode 100644 original/man3/tdestroy.3 create mode 100644 original/man3/telldir.3 create mode 100644 original/man3/tempnam.3 create mode 100644 original/man3/termios.3 create mode 100644 original/man3/tfind.3 create mode 100644 original/man3/tgamma.3 create mode 100644 original/man3/tgammaf.3 create mode 100644 original/man3/tgammal.3 create mode 100644 original/man3/timegm.3 create mode 100644 original/man3/timelocal.3 create mode 100644 original/man3/timeradd.3 create mode 100644 original/man3/timerclear.3 create mode 100644 original/man3/timercmp.3 create mode 100644 original/man3/timerisset.3 create mode 100644 original/man3/timersub.3 create mode 100644 original/man3/timezone.3 create mode 100644 original/man3/tmpfile.3 create mode 100644 original/man3/tmpnam.3 create mode 100644 original/man3/tmpnam_r.3 create mode 100644 original/man3/toascii.3 create mode 100644 original/man3/tolower.3 create mode 100644 original/man3/toupper.3 create mode 100644 original/man3/towctrans.3 create mode 100644 original/man3/towlower.3 create mode 100644 original/man3/towupper.3 create mode 100644 original/man3/trunc.3 create mode 100644 original/man3/truncf.3 create mode 100644 original/man3/truncl.3 create mode 100644 original/man3/tsearch.3 create mode 100644 original/man3/ttyname.3 create mode 100644 original/man3/ttyname_r.3 create mode 100644 original/man3/ttyslot.3 create mode 100644 original/man3/twalk.3 create mode 100644 original/man3/tzname.3 create mode 100644 original/man3/tzset.3 create mode 100644 original/man3/ualarm.3 create mode 100644 original/man3/ulckpwdf.3 create mode 100644 original/man3/ulimit.3 create mode 100644 original/man3/undocumented.3 create mode 100644 original/man3/ungetc.3 create mode 100644 original/man3/ungetwc.3 create mode 100644 original/man3/unlocked_stdio.3 create mode 100644 original/man3/unlockpt.3 create mode 100644 original/man3/unsetenv.3 create mode 100644 original/man3/updwtmp.3 create mode 100644 original/man3/updwtmpx.3 create mode 100644 original/man3/usleep.3 create mode 100644 original/man3/utmpname.3 create mode 100644 original/man3/utmpxname.3 create mode 100644 original/man3/va_arg.3 create mode 100644 original/man3/va_copy.3 create mode 100644 original/man3/va_end.3 create mode 100644 original/man3/va_start.3 create mode 100644 original/man3/valloc.3 create mode 100644 original/man3/vasprintf.3 create mode 100644 original/man3/vdprintf.3 create mode 100644 original/man3/verr.3 create mode 100644 original/man3/verrx.3 create mode 100644 original/man3/versionsort.3 create mode 100644 original/man3/vfprintf.3 create mode 100644 original/man3/vfscanf.3 create mode 100644 original/man3/vfwprintf.3 create mode 100644 original/man3/vprintf.3 create mode 100644 original/man3/vscanf.3 create mode 100644 original/man3/vsnprintf.3 create mode 100644 original/man3/vsprintf.3 create mode 100644 original/man3/vsscanf.3 create mode 100644 original/man3/vswprintf.3 create mode 100644 original/man3/vsyslog.3 create mode 100644 original/man3/vwarn.3 create mode 100644 original/man3/vwarnx.3 create mode 100644 original/man3/vwprintf.3 create mode 100644 original/man3/warn.3 create mode 100644 original/man3/warnx.3 create mode 100644 original/man3/wcpcpy.3 create mode 100644 original/man3/wcpncpy.3 create mode 100644 original/man3/wcrtomb.3 create mode 100644 original/man3/wcscasecmp.3 create mode 100644 original/man3/wcscat.3 create mode 100644 original/man3/wcschr.3 create mode 100644 original/man3/wcscmp.3 create mode 100644 original/man3/wcscpy.3 create mode 100644 original/man3/wcscspn.3 create mode 100644 original/man3/wcsdup.3 create mode 100644 original/man3/wcslen.3 create mode 100644 original/man3/wcsncasecmp.3 create mode 100644 original/man3/wcsncat.3 create mode 100644 original/man3/wcsncmp.3 create mode 100644 original/man3/wcsncpy.3 create mode 100644 original/man3/wcsnlen.3 create mode 100644 original/man3/wcsnrtombs.3 create mode 100644 original/man3/wcspbrk.3 create mode 100644 original/man3/wcsrchr.3 create mode 100644 original/man3/wcsrtombs.3 create mode 100644 original/man3/wcsspn.3 create mode 100644 original/man3/wcsstr.3 create mode 100644 original/man3/wcstoimax.3 create mode 100644 original/man3/wcstok.3 create mode 100644 original/man3/wcstombs.3 create mode 100644 original/man3/wcstoumax.3 create mode 100644 original/man3/wcswidth.3 create mode 100644 original/man3/wctob.3 create mode 100644 original/man3/wctomb.3 create mode 100644 original/man3/wctrans.3 create mode 100644 original/man3/wctype.3 create mode 100644 original/man3/wcwidth.3 create mode 100644 original/man3/wmemchr.3 create mode 100644 original/man3/wmemcmp.3 create mode 100644 original/man3/wmemcpy.3 create mode 100644 original/man3/wmemmove.3 create mode 100644 original/man3/wmempcpy.3 create mode 100644 original/man3/wmemset.3 create mode 100644 original/man3/wordexp.3 create mode 100644 original/man3/wordfree.3 create mode 100644 original/man3/wprintf.3 create mode 100644 original/man3/xcrypt.3 create mode 100644 original/man3/xdecrypt.3 create mode 100644 original/man3/xdr.3 create mode 100644 original/man3/xdr_accepted_reply.3 create mode 100644 original/man3/xdr_array.3 create mode 100644 original/man3/xdr_authunix_parms.3 create mode 100644 original/man3/xdr_bool.3 create mode 100644 original/man3/xdr_bytes.3 create mode 100644 original/man3/xdr_callhdr.3 create mode 100644 original/man3/xdr_callmsg.3 create mode 100644 original/man3/xdr_char.3 create mode 100644 original/man3/xdr_destroy.3 create mode 100644 original/man3/xdr_double.3 create mode 100644 original/man3/xdr_enum.3 create mode 100644 original/man3/xdr_float.3 create mode 100644 original/man3/xdr_free.3 create mode 100644 original/man3/xdr_getpos.3 create mode 100644 original/man3/xdr_inline.3 create mode 100644 original/man3/xdr_int.3 create mode 100644 original/man3/xdr_long.3 create mode 100644 original/man3/xdr_opaque.3 create mode 100644 original/man3/xdr_opaque_auth.3 create mode 100644 original/man3/xdr_pmap.3 create mode 100644 original/man3/xdr_pmaplist.3 create mode 100644 original/man3/xdr_pointer.3 create mode 100644 original/man3/xdr_reference.3 create mode 100644 original/man3/xdr_rejected_reply.3 create mode 100644 original/man3/xdr_replymsg.3 create mode 100644 original/man3/xdr_setpos.3 create mode 100644 original/man3/xdr_short.3 create mode 100644 original/man3/xdr_string.3 create mode 100644 original/man3/xdr_u_char.3 create mode 100644 original/man3/xdr_u_int.3 create mode 100644 original/man3/xdr_u_long.3 create mode 100644 original/man3/xdr_u_short.3 create mode 100644 original/man3/xdr_union.3 create mode 100644 original/man3/xdr_vector.3 create mode 100644 original/man3/xdr_void.3 create mode 100644 original/man3/xdr_wrapstring.3 create mode 100644 original/man3/xdrmem_create.3 create mode 100644 original/man3/xdrrec_create.3 create mode 100644 original/man3/xdrrec_endofrecord.3 create mode 100644 original/man3/xdrrec_eof.3 create mode 100644 original/man3/xdrrec_skiprecord.3 create mode 100644 original/man3/xdrstdio_create.3 create mode 100644 original/man3/xencrypt.3 create mode 100644 original/man3/xprt_register.3 create mode 100644 original/man3/xprt_unregister.3 create mode 100644 original/man3/y0.3 create mode 100644 original/man3/y0f.3 create mode 100644 original/man3/y0l.3 create mode 100644 original/man3/y1.3 create mode 100644 original/man3/y1f.3 create mode 100644 original/man3/y1l.3 create mode 100644 original/man3/yn.3 create mode 100644 original/man3/ynf.3 create mode 100644 original/man3/ynl.3 create mode 100644 original/man4/console.4 create mode 100644 original/man4/console_codes.4 create mode 100644 original/man4/console_ioctl.4 create mode 100644 original/man4/cpuid.4 create mode 100644 original/man4/dsp56k.4 create mode 100644 original/man4/epoll.4 create mode 100644 original/man4/fd.4 create mode 100644 original/man4/fifo.4 create mode 100644 original/man4/full.4 create mode 100644 original/man4/futex.4 create mode 100644 original/man4/hd.4 create mode 100644 original/man4/initrd.4 create mode 100644 original/man4/intro.4 create mode 100644 original/man4/kmem.4 create mode 100644 original/man4/lp.4 create mode 100644 original/man4/mem.4 create mode 100644 original/man4/mouse.4 create mode 100644 original/man4/msr.4 create mode 100644 original/man4/null.4 create mode 100644 original/man4/port.4 create mode 100644 original/man4/ptmx.4 create mode 100644 original/man4/pts.4 create mode 100644 original/man4/ram.4 create mode 100644 original/man4/random.4 create mode 100644 original/man4/rtc.4 create mode 100644 original/man4/sd.4 create mode 100644 original/man4/sk98lin.4 create mode 100644 original/man4/st.4 create mode 100644 original/man4/tty.4 create mode 100644 original/man4/ttyS.4 create mode 100644 original/man4/tty_ioctl.4 create mode 100644 original/man4/urandom.4 create mode 100644 original/man4/vcs.4 create mode 100644 original/man4/vcsa.4 create mode 100644 original/man4/wavelan.4 create mode 100644 original/man4/zero.4 create mode 100644 original/man5/acct.5 create mode 100644 original/man5/charmap.5 create mode 100644 original/man5/complex.5 create mode 100644 original/man5/core.5 create mode 100644 original/man5/dir_colors.5 create mode 100644 original/man5/elf.5 create mode 100644 original/man5/environ.5 create mode 100644 original/man5/filesystems.5 create mode 100644 original/man5/fs.5 create mode 100644 original/man5/ftpusers.5 create mode 100644 original/man5/group.5 create mode 100644 original/man5/host.conf.5 create mode 100644 original/man5/hosts.5 create mode 100644 original/man5/hosts.equiv.5 create mode 100644 original/man5/intro.5 create mode 100644 original/man5/ipc.5 create mode 100644 original/man5/issue.5 create mode 100644 original/man5/locale.5 create mode 100644 original/man5/motd.5 create mode 100644 original/man5/networks.5 create mode 100644 original/man5/nologin.5 create mode 100644 original/man5/nscd.conf.5 create mode 100644 original/man5/nsswitch.conf.5 create mode 100644 original/man5/numa_maps.5 create mode 100644 original/man5/passwd.5 create mode 100644 original/man5/proc.5 create mode 100644 original/man5/protocols.5 create mode 100644 original/man5/resolv.conf.5 create mode 100644 original/man5/resolver.5 create mode 100644 original/man5/rpc.5 create mode 100644 original/man5/securetty.5 create mode 100644 original/man5/services.5 create mode 100644 original/man5/shells.5 create mode 100644 original/man5/slabinfo.5 create mode 100644 original/man5/termcap.5 create mode 100644 original/man5/ttytype.5 create mode 100644 original/man5/tzfile.5 create mode 100644 original/man5/utmp.5 create mode 100644 original/man5/utmpx.5 create mode 100644 original/man5/wtmp.5 create mode 100644 original/man6/intro.6 create mode 100644 original/man7/armscii-8.7 create mode 100644 original/man7/arp.7 create mode 100644 original/man7/ascii.7 create mode 100644 original/man7/boot.7 create mode 100644 original/man7/bootparam.7 create mode 100644 original/man7/capabilities.7 create mode 100644 original/man7/charsets.7 create mode 100644 original/man7/complex.7 create mode 100644 original/man7/cp1251.7 create mode 100644 original/man7/cpuset.7 create mode 100644 original/man7/credentials.7 create mode 100644 original/man7/ddp.7 create mode 100644 original/man7/environ.7 create mode 100644 original/man7/epoll.7 create mode 100644 original/man7/feature_test_macros.7 create mode 100644 original/man7/fifo.7 create mode 100644 original/man7/futex.7 create mode 100644 original/man7/glibc.7 create mode 100644 original/man7/glob.7 create mode 100644 original/man7/hier.7 create mode 100644 original/man7/hostname.7 create mode 100644 original/man7/icmp.7 create mode 100644 original/man7/inotify.7 create mode 100644 original/man7/intro.7 create mode 100644 original/man7/ip.7 create mode 100644 original/man7/ipv6.7 create mode 100644 original/man7/iso-8859-1.7 create mode 100644 original/man7/iso-8859-10.7 create mode 100644 original/man7/iso-8859-11.7 create mode 100644 original/man7/iso-8859-13.7 create mode 100644 original/man7/iso-8859-14.7 create mode 100644 original/man7/iso-8859-15.7 create mode 100644 original/man7/iso-8859-16.7 create mode 100644 original/man7/iso-8859-2.7 create mode 100644 original/man7/iso-8859-3.7 create mode 100644 original/man7/iso-8859-4.7 create mode 100644 original/man7/iso-8859-5.7 create mode 100644 original/man7/iso-8859-6.7 create mode 100644 original/man7/iso-8859-7.7 create mode 100644 original/man7/iso-8859-8.7 create mode 100644 original/man7/iso-8859-9.7 create mode 100644 original/man7/iso_8859-1.7 create mode 100644 original/man7/iso_8859-10.7 create mode 100644 original/man7/iso_8859-11.7 create mode 100644 original/man7/iso_8859-13.7 create mode 100644 original/man7/iso_8859-14.7 create mode 100644 original/man7/iso_8859-15.7 create mode 100644 original/man7/iso_8859-16.7 create mode 100644 original/man7/iso_8859-2.7 create mode 100644 original/man7/iso_8859-3.7 create mode 100644 original/man7/iso_8859-4.7 create mode 100644 original/man7/iso_8859-5.7 create mode 100644 original/man7/iso_8859-6.7 create mode 100644 original/man7/iso_8859-7.7 create mode 100644 original/man7/iso_8859-8.7 create mode 100644 original/man7/iso_8859-9.7 create mode 100644 original/man7/iso_8859_1.7 create mode 100644 original/man7/iso_8859_10.7 create mode 100644 original/man7/iso_8859_11.7 create mode 100644 original/man7/iso_8859_13.7 create mode 100644 original/man7/iso_8859_14.7 create mode 100644 original/man7/iso_8859_15.7 create mode 100644 original/man7/iso_8859_16.7 create mode 100644 original/man7/iso_8859_2.7 create mode 100644 original/man7/iso_8859_3.7 create mode 100644 original/man7/iso_8859_4.7 create mode 100644 original/man7/iso_8859_5.7 create mode 100644 original/man7/iso_8859_6.7 create mode 100644 original/man7/iso_8859_7.7 create mode 100644 original/man7/iso_8859_8.7 create mode 100644 original/man7/iso_8859_9.7 create mode 100644 original/man7/koi8-r.7 create mode 100644 original/man7/koi8-u.7 create mode 100644 original/man7/latin1.7 create mode 100644 original/man7/latin10.7 create mode 100644 original/man7/latin2.7 create mode 100644 original/man7/latin3.7 create mode 100644 original/man7/latin4.7 create mode 100644 original/man7/latin5.7 create mode 100644 original/man7/latin6.7 create mode 100644 original/man7/latin7.7 create mode 100644 original/man7/latin8.7 create mode 100644 original/man7/latin9.7 create mode 100644 original/man7/libc.7 create mode 100644 original/man7/locale.7 create mode 100644 original/man7/mailaddr.7 create mode 100644 original/man7/man-pages.7 create mode 100644 original/man7/man.7 create mode 100644 original/man7/math_error.7 create mode 100644 original/man7/mdoc.7 create mode 100644 original/man7/mdoc.samples.7 create mode 100644 original/man7/mq_overview.7 create mode 100644 original/man7/netdevice.7 create mode 100644 original/man7/netlink.7 create mode 100644 original/man7/numa.7 create mode 100644 original/man7/operator.7 create mode 100644 original/man7/packet.7 create mode 100644 original/man7/path_resolution.7 create mode 100644 original/man7/pipe.7 create mode 100644 original/man7/posixoptions.7 create mode 100644 original/man7/pthreads.7 create mode 100644 original/man7/pty.7 create mode 100644 original/man7/raw.7 create mode 100644 original/man7/regex.7 create mode 100644 original/man7/rtld-audit.7 create mode 100644 original/man7/rtnetlink.7 create mode 100644 original/man7/sem_overview.7 create mode 100644 original/man7/shm_overview.7 create mode 100644 original/man7/signal.7 create mode 100644 original/man7/socket.7 create mode 100644 original/man7/spufs.7 create mode 100644 original/man7/standards.7 create mode 100644 original/man7/suffixes.7 create mode 100644 original/man7/svipc.7 create mode 100644 original/man7/symlink.7 create mode 100644 original/man7/tcp.7 create mode 100644 original/man7/termio.7 create mode 100644 original/man7/time.7 create mode 100644 original/man7/tis-620.7 create mode 100644 original/man7/udp.7 create mode 100644 original/man7/udplite.7 create mode 100644 original/man7/unicode.7 create mode 100644 original/man7/units.7 create mode 100644 original/man7/unix.7 create mode 100644 original/man7/uri.7 create mode 100644 original/man7/url.7 create mode 100644 original/man7/urn.7 create mode 100644 original/man7/utf-8.7 create mode 100644 original/man7/utf8.7 create mode 100644 original/man7/x25.7 create mode 100644 original/man8/intro.8 create mode 100644 original/man8/ld-linux.8 create mode 100644 original/man8/ld-linux.so.8 create mode 100644 original/man8/ld.so.8 create mode 100644 original/man8/ldconfig.8 create mode 100644 original/man8/nscd.8 create mode 100644 original/man8/sync.8 create mode 100644 original/man8/tzselect.8 create mode 100644 original/man8/zdump.8 create mode 100644 original/man8/zic.8 create mode 100644 release/man1/intro.1 create mode 100644 release/man1/ldd.1 create mode 100644 release/man1/time.1 create mode 100644 release/man2/_exit.2 create mode 100644 release/man2/_syscall.2 create mode 100644 release/man2/accept.2 create mode 100644 release/man2/access.2 create mode 100644 release/man2/acct.2 create mode 100644 release/man2/adjtimex.2 create mode 100644 release/man2/alarm.2 create mode 100644 release/man2/alloc_hugepages.2 create mode 100644 release/man2/arch_prctl.2 create mode 100644 release/man2/bdflush.2 create mode 100644 release/man2/bind.2 create mode 100644 release/man2/brk.2 create mode 100644 release/man2/cacheflush.2 create mode 100644 release/man2/capget.2 create mode 100644 release/man2/chdir.2 create mode 100644 release/man2/chmod.2 create mode 100644 release/man2/chown.2 create mode 100644 release/man2/chroot.2 create mode 100644 release/man2/clock_getres.2 create mode 100644 release/man2/clock_nanosleep.2 create mode 100644 release/man2/clone.2 create mode 100644 release/man2/close.2 create mode 100644 release/man2/connect.2 create mode 100644 release/man2/create_module.2 create mode 100644 release/man2/delete_module.2 create mode 100644 release/man2/dup.2 create mode 100644 release/man2/epoll_create.2 create mode 100644 release/man2/epoll_ctl.2 create mode 100644 release/man2/epoll_wait.2 create mode 100644 release/man2/eventfd.2 create mode 100644 release/man2/execve.2 create mode 100644 release/man2/exit_group.2 create mode 100644 release/man2/faccessat.2 create mode 100644 release/man2/fallocate.2 create mode 100644 release/man2/fchmodat.2 create mode 100644 release/man2/fchownat.2 create mode 100644 release/man2/fcntl.2 create mode 100644 release/man2/flock.2 create mode 100644 release/man2/fork.2 create mode 100644 release/man2/fstatat.2 create mode 100644 release/man2/fsync.2 create mode 100644 release/man2/futex.2 create mode 100644 release/man2/futimesat.2 create mode 100644 release/man2/get_kernel_syms.2 create mode 100644 release/man2/get_mempolicy.2 create mode 100644 release/man2/get_thread_area.2 create mode 100644 release/man2/getcontext.2 create mode 100644 release/man2/getdents.2 create mode 100644 release/man2/getdomainname.2 create mode 100644 release/man2/getdtablesize.2 create mode 100644 release/man2/getgid.2 create mode 100644 release/man2/getgroups.2 create mode 100644 release/man2/gethostname.2 create mode 100644 release/man2/getitimer.2 create mode 100644 release/man2/getpagesize.2 create mode 100644 release/man2/getpeername.2 create mode 100644 release/man2/getpid.2 create mode 100644 release/man2/getpriority.2 create mode 100644 release/man2/getresuid.2 create mode 100644 release/man2/getrlimit.2 create mode 100644 release/man2/getrusage.2 create mode 100644 release/man2/getsid.2 create mode 100644 release/man2/getsockname.2 create mode 100644 release/man2/getsockopt.2 create mode 100644 release/man2/gettid.2 create mode 100644 release/man2/gettimeofday.2 create mode 100644 release/man2/getuid.2 create mode 100644 release/man2/getxattr.2 create mode 100644 release/man2/idle.2 create mode 100644 release/man2/init_module.2 create mode 100644 release/man2/inotify_add_watch.2 create mode 100644 release/man2/inotify_init.2 create mode 100644 release/man2/inotify_rm_watch.2 create mode 100644 release/man2/intro.2 create mode 100644 release/man2/io_cancel.2 create mode 100644 release/man2/io_destroy.2 create mode 100644 release/man2/io_getevents.2 create mode 100644 release/man2/io_setup.2 create mode 100644 release/man2/io_submit.2 create mode 100644 release/man2/ioctl.2 create mode 100644 release/man2/ioctl_list.2 create mode 100644 release/man2/ioperm.2 create mode 100644 release/man2/iopl.2 create mode 100644 release/man2/ioprio_set.2 create mode 100644 release/man2/ipc.2 create mode 100644 release/man2/kill.2 create mode 100644 release/man2/killpg.2 create mode 100644 release/man2/link.2 create mode 100644 release/man2/linkat.2 create mode 100644 release/man2/listen.2 create mode 100644 release/man2/listxattr.2 create mode 100644 release/man2/llseek.2 create mode 100644 release/man2/lookup_dcookie.2 create mode 100644 release/man2/lseek.2 create mode 100644 release/man2/madvise.2 create mode 100644 release/man2/mbind.2 create mode 100644 release/man2/mincore.2 create mode 100644 release/man2/mkdir.2 create mode 100644 release/man2/mkdirat.2 create mode 100644 release/man2/mknod.2 create mode 100644 release/man2/mknodat.2 create mode 100644 release/man2/mlock.2 create mode 100644 release/man2/mmap.2 create mode 100644 release/man2/mmap2.2 create mode 100644 release/man2/modify_ldt.2 create mode 100644 release/man2/mount.2 create mode 100644 release/man2/move_pages.2 create mode 100644 release/man2/mprotect.2 create mode 100644 release/man2/mq_getsetattr.2 create mode 100644 release/man2/mremap.2 create mode 100644 release/man2/msgctl.2 create mode 100644 release/man2/msgget.2 create mode 100644 release/man2/msgop.2 create mode 100644 release/man2/msync.2 create mode 100644 release/man2/nanosleep.2 create mode 100644 release/man2/nfsservctl.2 create mode 100644 release/man2/nice.2 create mode 100644 release/man2/open.2 create mode 100644 release/man2/openat.2 create mode 100644 release/man2/outb.2 create mode 100644 release/man2/pause.2 create mode 100644 release/man2/pciconfig_read.2 create mode 100644 release/man2/personality.2 create mode 100644 release/man2/pipe.2 create mode 100644 release/man2/pivot_root.2 create mode 100644 release/man2/poll.2 create mode 100644 release/man2/posix_fadvise.2 create mode 100644 release/man2/prctl.2 create mode 100644 release/man2/pread.2 create mode 100644 release/man2/ptrace.2 create mode 100644 release/man2/query_module.2 create mode 100644 release/man2/quotactl.2 create mode 100644 release/man2/read.2 create mode 100644 release/man2/readahead.2 create mode 100644 release/man2/readdir.2 create mode 100644 release/man2/readlink.2 create mode 100644 release/man2/readlinkat.2 create mode 100644 release/man2/readv.2 create mode 100644 release/man2/reboot.2 create mode 100644 release/man2/recv.2 create mode 100644 release/man2/remap_file_pages.2 create mode 100644 release/man2/removexattr.2 create mode 100644 release/man2/rename.2 create mode 100644 release/man2/renameat.2 create mode 100644 release/man2/rmdir.2 create mode 100644 release/man2/sched_get_priority_max.2 create mode 100644 release/man2/sched_rr_get_interval.2 create mode 100644 release/man2/sched_setaffinity.2 create mode 100644 release/man2/sched_setparam.2 create mode 100644 release/man2/sched_setscheduler.2 create mode 100644 release/man2/sched_yield.2 create mode 100644 release/man2/select.2 create mode 100644 release/man2/select_tut.2 create mode 100644 release/man2/semctl.2 create mode 100644 release/man2/semget.2 create mode 100644 release/man2/semop.2 create mode 100644 release/man2/send.2 create mode 100644 release/man2/sendfile.2 create mode 100644 release/man2/set_mempolicy.2 create mode 100644 release/man2/set_thread_area.2 create mode 100644 release/man2/set_tid_address.2 create mode 100644 release/man2/seteuid.2 create mode 100644 release/man2/setfsgid.2 create mode 100644 release/man2/setfsuid.2 create mode 100644 release/man2/setgid.2 create mode 100644 release/man2/setpgid.2 create mode 100644 release/man2/setresuid.2 create mode 100644 release/man2/setreuid.2 create mode 100644 release/man2/setsid.2 create mode 100644 release/man2/setuid.2 create mode 100644 release/man2/setup.2 create mode 100644 release/man2/setxattr.2 create mode 100644 release/man2/sgetmask.2 create mode 100644 release/man2/shmctl.2 create mode 100644 release/man2/shmget.2 create mode 100644 release/man2/shmop.2 create mode 100644 release/man2/shutdown.2 create mode 100644 release/man2/sigaction.2 create mode 100644 release/man2/sigaltstack.2 create mode 100644 release/man2/sigblock.2 create mode 100644 release/man2/signal.2 create mode 100644 release/man2/signalfd.2 create mode 100644 release/man2/sigpause.2 create mode 100644 release/man2/sigpending.2 create mode 100644 release/man2/sigprocmask.2 create mode 100644 release/man2/sigqueue.2 create mode 100644 release/man2/sigreturn.2 create mode 100644 release/man2/sigsuspend.2 create mode 100644 release/man2/sigvec.2 create mode 100644 release/man2/sigwaitinfo.2 create mode 100644 release/man2/socket.2 create mode 100644 release/man2/socketcall.2 create mode 100644 release/man2/socketpair.2 create mode 100644 release/man2/splice.2 create mode 100644 release/man2/spu_create.2 create mode 100644 release/man2/spu_run.2 create mode 100644 release/man2/stat.2 create mode 100644 release/man2/statfs.2 create mode 100644 release/man2/statvfs.2 create mode 100644 release/man2/stime.2 create mode 100644 release/man2/swapon.2 create mode 100644 release/man2/symlink.2 create mode 100644 release/man2/symlinkat.2 create mode 100644 release/man2/sync.2 create mode 100644 release/man2/sync_file_range.2 create mode 100644 release/man2/syscall.2 create mode 100644 release/man2/syscalls.2 create mode 100644 release/man2/sysctl.2 create mode 100644 release/man2/sysfs.2 create mode 100644 release/man2/sysinfo.2 create mode 100644 release/man2/syslog.2 create mode 100644 release/man2/tee.2 create mode 100644 release/man2/time.2 create mode 100644 release/man2/timerfd_create.2 create mode 100644 release/man2/times.2 create mode 100644 release/man2/tkill.2 create mode 100644 release/man2/truncate.2 create mode 100644 release/man2/umask.2 create mode 100644 release/man2/umount.2 create mode 100644 release/man2/uname.2 create mode 100644 release/man2/unimplemented.2 create mode 100644 release/man2/unlink.2 create mode 100644 release/man2/unlinkat.2 create mode 100644 release/man2/unshare.2 create mode 100644 release/man2/uselib.2 create mode 100644 release/man2/ustat.2 create mode 100644 release/man2/utime.2 create mode 100644 release/man2/vfork.2 create mode 100644 release/man2/vhangup.2 create mode 100644 release/man2/vm86.2 create mode 100644 release/man2/vmsplice.2 create mode 100644 release/man2/wait.2 create mode 100644 release/man2/wait4.2 create mode 100644 release/man2/write.2 create mode 100644 release/man3/INFINITY.3 create mode 100644 release/man3/MB_CUR_MAX.3 create mode 100644 release/man3/MB_LEN_MAX.3 create mode 100644 release/man3/__setfpucw.3 create mode 100644 release/man3/a64l.3 create mode 100644 release/man3/abort.3 create mode 100644 release/man3/abs.3 create mode 100644 release/man3/acos.3 create mode 100644 release/man3/acosh.3 create mode 100644 release/man3/addseverity.3 create mode 100644 release/man3/adjtime.3 create mode 100644 release/man3/aio_cancel.3 create mode 100644 release/man3/aio_error.3 create mode 100644 release/man3/aio_fsync.3 create mode 100644 release/man3/aio_read.3 create mode 100644 release/man3/aio_return.3 create mode 100644 release/man3/aio_suspend.3 create mode 100644 release/man3/aio_write.3 create mode 100644 release/man3/alloca.3 create mode 100644 release/man3/argz_add.3 create mode 100644 release/man3/asin.3 create mode 100644 release/man3/asinh.3 create mode 100644 release/man3/asprintf.3 create mode 100644 release/man3/assert.3 create mode 100644 release/man3/assert_perror.3 create mode 100644 release/man3/atan.3 create mode 100644 release/man3/atan2.3 create mode 100644 release/man3/atanh.3 create mode 100644 release/man3/atexit.3 create mode 100644 release/man3/atof.3 create mode 100644 release/man3/atoi.3 create mode 100644 release/man3/backtrace.3 create mode 100644 release/man3/basename.3 create mode 100644 release/man3/bcmp.3 create mode 100644 release/man3/bcopy.3 create mode 100644 release/man3/bindresvport.3 create mode 100644 release/man3/bsd_signal.3 create mode 100644 release/man3/bsearch.3 create mode 100644 release/man3/bstring.3 create mode 100644 release/man3/btowc.3 create mode 100644 release/man3/btree.3 create mode 100644 release/man3/byteorder.3 create mode 100644 release/man3/bzero.3 create mode 100644 release/man3/cabs.3 create mode 100644 release/man3/cacos.3 create mode 100644 release/man3/cacosh.3 create mode 100644 release/man3/canonicalize_file_name.3 create mode 100644 release/man3/carg.3 create mode 100644 release/man3/casin.3 create mode 100644 release/man3/casinh.3 create mode 100644 release/man3/catan.3 create mode 100644 release/man3/catanh.3 create mode 100644 release/man3/catgets.3 create mode 100644 release/man3/catopen.3 create mode 100644 release/man3/cbrt.3 create mode 100644 release/man3/ccos.3 create mode 100644 release/man3/ccosh.3 create mode 100644 release/man3/ceil.3 create mode 100644 release/man3/cerf.3 create mode 100644 release/man3/cexp.3 create mode 100644 release/man3/cexp2.3 create mode 100644 release/man3/cfree.3 create mode 100644 release/man3/cimag.3 create mode 100644 release/man3/clearenv.3 create mode 100644 release/man3/clock.3 create mode 100644 release/man3/clog.3 create mode 100644 release/man3/clog10.3 create mode 100644 release/man3/clog2.3 create mode 100644 release/man3/closedir.3 create mode 100644 release/man3/cmsg.3 create mode 100644 release/man3/confstr.3 create mode 100644 release/man3/conj.3 create mode 100644 release/man3/copysign.3 create mode 100644 release/man3/cos.3 create mode 100644 release/man3/cosh.3 create mode 100644 release/man3/cpow.3 create mode 100644 release/man3/cproj.3 create mode 100644 release/man3/creal.3 create mode 100644 release/man3/crypt.3 create mode 100644 release/man3/csin.3 create mode 100644 release/man3/csinh.3 create mode 100644 release/man3/csqrt.3 create mode 100644 release/man3/ctan.3 create mode 100644 release/man3/ctanh.3 create mode 100644 release/man3/ctermid.3 create mode 100644 release/man3/ctime.3 create mode 100644 release/man3/daemon.3 create mode 100644 release/man3/dbopen.3 create mode 100644 release/man3/des_crypt.3 create mode 100644 release/man3/difftime.3 create mode 100644 release/man3/dirfd.3 create mode 100644 release/man3/div.3 create mode 100644 release/man3/dl_iterate_phdr.3 create mode 100644 release/man3/dlopen.3 create mode 100644 release/man3/dprintf.3 create mode 100644 release/man3/drand48.3 create mode 100644 release/man3/drand48_r.3 create mode 100644 release/man3/dysize.3 create mode 100644 release/man3/ecvt.3 create mode 100644 release/man3/ecvt_r.3 create mode 100644 release/man3/encrypt.3 create mode 100644 release/man3/end.3 create mode 100644 release/man3/envz_add.3 create mode 100644 release/man3/erf.3 create mode 100644 release/man3/erfc.3 create mode 100644 release/man3/err.3 create mode 100644 release/man3/errno.3 create mode 100644 release/man3/error.3 create mode 100644 release/man3/ether_aton.3 create mode 100644 release/man3/euidaccess.3 create mode 100644 release/man3/exec.3 create mode 100644 release/man3/exit.3 create mode 100644 release/man3/exp.3 create mode 100644 release/man3/exp10.3 create mode 100644 release/man3/exp2.3 create mode 100644 release/man3/expm1.3 create mode 100644 release/man3/fabs.3 create mode 100644 release/man3/fclose.3 create mode 100644 release/man3/fcloseall.3 create mode 100644 release/man3/fdim.3 create mode 100644 release/man3/fenv.3 create mode 100644 release/man3/ferror.3 create mode 100644 release/man3/fexecve.3 create mode 100644 release/man3/fflush.3 create mode 100644 release/man3/ffs.3 create mode 100644 release/man3/fgetgrent.3 create mode 100644 release/man3/fgetpwent.3 create mode 100644 release/man3/fgetwc.3 create mode 100644 release/man3/fgetws.3 create mode 100644 release/man3/finite.3 create mode 100644 release/man3/flockfile.3 create mode 100644 release/man3/floor.3 create mode 100644 release/man3/fma.3 create mode 100644 release/man3/fmax.3 create mode 100644 release/man3/fmemopen.3 create mode 100644 release/man3/fmin.3 create mode 100644 release/man3/fmod.3 create mode 100644 release/man3/fmtmsg.3 create mode 100644 release/man3/fnmatch.3 create mode 100644 release/man3/fopen.3 create mode 100644 release/man3/fpathconf.3 create mode 100644 release/man3/fpclassify.3 create mode 100644 release/man3/fpurge.3 create mode 100644 release/man3/fputwc.3 create mode 100644 release/man3/fputws.3 create mode 100644 release/man3/fread.3 create mode 100644 release/man3/frexp.3 create mode 100644 release/man3/fseek.3 create mode 100644 release/man3/fseeko.3 create mode 100644 release/man3/ftime.3 create mode 100644 release/man3/ftok.3 create mode 100644 release/man3/fts.3 create mode 100644 release/man3/ftw.3 create mode 100644 release/man3/futimes.3 create mode 100644 release/man3/fwide.3 create mode 100644 release/man3/gamma.3 create mode 100644 release/man3/gcvt.3 create mode 100644 release/man3/getaddrinfo.3 create mode 100644 release/man3/getcwd.3 create mode 100644 release/man3/getdate.3 create mode 100644 release/man3/getdirentries.3 create mode 100644 release/man3/getenv.3 create mode 100644 release/man3/getfsent.3 create mode 100644 release/man3/getgrent.3 create mode 100644 release/man3/getgrent_r.3 create mode 100644 release/man3/getgrnam.3 create mode 100644 release/man3/getgrouplist.3 create mode 100644 release/man3/gethostbyname.3 create mode 100644 release/man3/gethostid.3 create mode 100644 release/man3/getipnodebyname.3 create mode 100644 release/man3/getline.3 create mode 100644 release/man3/getloadavg.3 create mode 100644 release/man3/getlogin.3 create mode 100644 release/man3/getmntent.3 create mode 100644 release/man3/getnameinfo.3 create mode 100644 release/man3/getnetent.3 create mode 100644 release/man3/getopt.3 create mode 100644 release/man3/getpass.3 create mode 100644 release/man3/getprotoent.3 create mode 100644 release/man3/getpt.3 create mode 100644 release/man3/getpw.3 create mode 100644 release/man3/getpwent.3 create mode 100644 release/man3/getpwent_r.3 create mode 100644 release/man3/getpwnam.3 create mode 100644 release/man3/getrpcent.3 create mode 100644 release/man3/getrpcport.3 create mode 100644 release/man3/gets.3 create mode 100644 release/man3/getservent.3 create mode 100644 release/man3/getspnam.3 create mode 100644 release/man3/getsubopt.3 create mode 100644 release/man3/getttyent.3 create mode 100644 release/man3/getumask.3 create mode 100644 release/man3/getusershell.3 create mode 100644 release/man3/getutent.3 create mode 100644 release/man3/getw.3 create mode 100644 release/man3/getwchar.3 create mode 100644 release/man3/glob.3 create mode 100644 release/man3/gnu_get_libc_version.3 create mode 100644 release/man3/grantpt.3 create mode 100644 release/man3/gsignal.3 create mode 100644 release/man3/hash.3 create mode 100644 release/man3/hsearch.3 create mode 100644 release/man3/hypot.3 create mode 100644 release/man3/iconv.3 create mode 100644 release/man3/iconv_close.3 create mode 100644 release/man3/iconv_open.3 create mode 100644 release/man3/ilogb.3 create mode 100644 release/man3/index.3 create mode 100644 release/man3/inet.3 create mode 100644 release/man3/inet_ntop.3 create mode 100644 release/man3/inet_pton.3 create mode 100644 release/man3/infnan.3 create mode 100644 release/man3/initgroups.3 create mode 100644 release/man3/insque.3 create mode 100644 release/man3/intro.3 create mode 100644 release/man3/isalpha.3 create mode 100644 release/man3/isatty.3 create mode 100644 release/man3/isgreater.3 create mode 100644 release/man3/iswalnum.3 create mode 100644 release/man3/iswalpha.3 create mode 100644 release/man3/iswblank.3 create mode 100644 release/man3/iswcntrl.3 create mode 100644 release/man3/iswctype.3 create mode 100644 release/man3/iswdigit.3 create mode 100644 release/man3/iswgraph.3 create mode 100644 release/man3/iswlower.3 create mode 100644 release/man3/iswprint.3 create mode 100644 release/man3/iswpunct.3 create mode 100644 release/man3/iswspace.3 create mode 100644 release/man3/iswupper.3 create mode 100644 release/man3/iswxdigit.3 create mode 100644 release/man3/j0.3 create mode 100644 release/man3/key_setsecret.3 create mode 100644 release/man3/ldexp.3 create mode 100644 release/man3/lgamma.3 create mode 100644 release/man3/localeconv.3 create mode 100644 release/man3/lockf.3 create mode 100644 release/man3/log.3 create mode 100644 release/man3/log10.3 create mode 100644 release/man3/log1p.3 create mode 100644 release/man3/log2.3 create mode 100644 release/man3/logb.3 create mode 100644 release/man3/login.3 create mode 100644 release/man3/longjmp.3 create mode 100644 release/man3/lrint.3 create mode 100644 release/man3/lround.3 create mode 100644 release/man3/lsearch.3 create mode 100644 release/man3/lseek64.3 create mode 100644 release/man3/makecontext.3 create mode 100644 release/man3/malloc.3 create mode 100644 release/man3/malloc_hook.3 create mode 100644 release/man3/mblen.3 create mode 100644 release/man3/mbrlen.3 create mode 100644 release/man3/mbrtowc.3 create mode 100644 release/man3/mbsinit.3 create mode 100644 release/man3/mbsnrtowcs.3 create mode 100644 release/man3/mbsrtowcs.3 create mode 100644 release/man3/mbstowcs.3 create mode 100644 release/man3/mbtowc.3 create mode 100644 release/man3/memccpy.3 create mode 100644 release/man3/memchr.3 create mode 100644 release/man3/memcmp.3 create mode 100644 release/man3/memcpy.3 create mode 100644 release/man3/memfrob.3 create mode 100644 release/man3/memmem.3 create mode 100644 release/man3/memmove.3 create mode 100644 release/man3/mempcpy.3 create mode 100644 release/man3/memset.3 create mode 100644 release/man3/mkdtemp.3 create mode 100644 release/man3/mkfifo.3 create mode 100644 release/man3/mkfifoat.3 create mode 100644 release/man3/mkstemp.3 create mode 100644 release/man3/mktemp.3 create mode 100644 release/man3/modf.3 create mode 100644 release/man3/mpool.3 create mode 100644 release/man3/mq_close.3 create mode 100644 release/man3/mq_getattr.3 create mode 100644 release/man3/mq_notify.3 create mode 100644 release/man3/mq_open.3 create mode 100644 release/man3/mq_receive.3 create mode 100644 release/man3/mq_send.3 create mode 100644 release/man3/mq_unlink.3 create mode 100644 release/man3/mtrace.3 create mode 100644 release/man3/nan.3 create mode 100644 release/man3/netlink.3 create mode 100644 release/man3/nextafter.3 create mode 100644 release/man3/nl_langinfo.3 create mode 100644 release/man3/offsetof.3 create mode 100644 release/man3/on_exit.3 create mode 100644 release/man3/opendir.3 create mode 100644 release/man3/openpty.3 create mode 100644 release/man3/perror.3 create mode 100644 release/man3/popen.3 create mode 100644 release/man3/posix_fallocate.3 create mode 100644 release/man3/posix_memalign.3 create mode 100644 release/man3/posix_openpt.3 create mode 100644 release/man3/pow.3 create mode 100644 release/man3/pow10.3 create mode 100644 release/man3/printf.3 create mode 100644 release/man3/profil.3 create mode 100644 release/man3/program_invocation_name.3 create mode 100644 release/man3/psignal.3 create mode 100644 release/man3/ptsname.3 create mode 100644 release/man3/putenv.3 create mode 100644 release/man3/putgrent.3 create mode 100644 release/man3/putpwent.3 create mode 100644 release/man3/puts.3 create mode 100644 release/man3/putwchar.3 create mode 100644 release/man3/qecvt.3 create mode 100644 release/man3/qsort.3 create mode 100644 release/man3/queue.3 create mode 100644 release/man3/raise.3 create mode 100644 release/man3/rand.3 create mode 100644 release/man3/random.3 create mode 100644 release/man3/random_r.3 create mode 100644 release/man3/rcmd.3 create mode 100644 release/man3/re_comp.3 create mode 100644 release/man3/readdir.3 create mode 100644 release/man3/realpath.3 create mode 100644 release/man3/recno.3 create mode 100644 release/man3/regex.3 create mode 100644 release/man3/remainder.3 create mode 100644 release/man3/remove.3 create mode 100644 release/man3/remquo.3 create mode 100644 release/man3/resolver.3 create mode 100644 release/man3/rewinddir.3 create mode 100644 release/man3/rexec.3 create mode 100644 release/man3/rint.3 create mode 100644 release/man3/round.3 create mode 100644 release/man3/rpc.3 create mode 100644 release/man3/rpmatch.3 create mode 100644 release/man3/rtime.3 create mode 100644 release/man3/rtnetlink.3 create mode 100644 release/man3/scalb.3 create mode 100644 release/man3/scandir.3 create mode 100644 release/man3/scanf.3 create mode 100644 release/man3/sched_getcpu.3 create mode 100644 release/man3/seekdir.3 create mode 100644 release/man3/sem_close.3 create mode 100644 release/man3/sem_destroy.3 create mode 100644 release/man3/sem_getvalue.3 create mode 100644 release/man3/sem_init.3 create mode 100644 release/man3/sem_open.3 create mode 100644 release/man3/sem_post.3 create mode 100644 release/man3/sem_unlink.3 create mode 100644 release/man3/sem_wait.3 create mode 100644 release/man3/setaliasent.3 create mode 100644 release/man3/setbuf.3 create mode 100644 release/man3/setenv.3 create mode 100644 release/man3/setjmp.3 create mode 100644 release/man3/setlocale.3 create mode 100644 release/man3/setlogmask.3 create mode 100644 release/man3/setnetgrent.3 create mode 100644 release/man3/shm_open.3 create mode 100644 release/man3/siginterrupt.3 create mode 100644 release/man3/signbit.3 create mode 100644 release/man3/significand.3 create mode 100644 release/man3/sigpause.3 create mode 100644 release/man3/sigset.3 create mode 100644 release/man3/sigsetops.3 create mode 100644 release/man3/sigvec.3 create mode 100644 release/man3/sigwait.3 create mode 100644 release/man3/sin.3 create mode 100644 release/man3/sincos.3 create mode 100644 release/man3/sinh.3 create mode 100644 release/man3/sleep.3 create mode 100644 release/man3/sockatmark.3 create mode 100644 release/man3/sqrt.3 create mode 100644 release/man3/stdarg.3 create mode 100644 release/man3/stdin.3 create mode 100644 release/man3/stdio.3 create mode 100644 release/man3/stdio_ext.3 create mode 100644 release/man3/stpcpy.3 create mode 100644 release/man3/stpncpy.3 create mode 100644 release/man3/strcasecmp.3 create mode 100644 release/man3/strcat.3 create mode 100644 release/man3/strchr.3 create mode 100644 release/man3/strcmp.3 create mode 100644 release/man3/strcoll.3 create mode 100644 release/man3/strcpy.3 create mode 100644 release/man3/strdup.3 create mode 100644 release/man3/strerror.3 create mode 100644 release/man3/strfmon.3 create mode 100644 release/man3/strfry.3 create mode 100644 release/man3/strftime.3 create mode 100644 release/man3/string.3 create mode 100644 release/man3/strlen.3 create mode 100644 release/man3/strnlen.3 create mode 100644 release/man3/strpbrk.3 create mode 100644 release/man3/strptime.3 create mode 100644 release/man3/strsep.3 create mode 100644 release/man3/strsignal.3 create mode 100644 release/man3/strspn.3 create mode 100644 release/man3/strstr.3 create mode 100644 release/man3/strtod.3 create mode 100644 release/man3/strtoimax.3 create mode 100644 release/man3/strtok.3 create mode 100644 release/man3/strtol.3 create mode 100644 release/man3/strtoul.3 create mode 100644 release/man3/strverscmp.3 create mode 100644 release/man3/strxfrm.3 create mode 100644 release/man3/swab.3 create mode 100644 release/man3/sysconf.3 create mode 100644 release/man3/syslog.3 create mode 100644 release/man3/system.3 create mode 100644 release/man3/sysv_signal.3 create mode 100644 release/man3/tan.3 create mode 100644 release/man3/tanh.3 create mode 100644 release/man3/tcgetpgrp.3 create mode 100644 release/man3/tcgetsid.3 create mode 100644 release/man3/telldir.3 create mode 100644 release/man3/tempnam.3 create mode 100644 release/man3/termios.3 create mode 100644 release/man3/tgamma.3 create mode 100644 release/man3/timegm.3 create mode 100644 release/man3/timeradd.3 create mode 100644 release/man3/tmpfile.3 create mode 100644 release/man3/tmpnam.3 create mode 100644 release/man3/toascii.3 create mode 100644 release/man3/toupper.3 create mode 100644 release/man3/towctrans.3 create mode 100644 release/man3/towlower.3 create mode 100644 release/man3/towupper.3 create mode 100644 release/man3/trunc.3 create mode 100644 release/man3/tsearch.3 create mode 100644 release/man3/ttyname.3 create mode 100644 release/man3/ttyslot.3 create mode 100644 release/man3/tzset.3 create mode 100644 release/man3/ualarm.3 create mode 100644 release/man3/ulimit.3 create mode 100644 release/man3/undocumented.3 create mode 100644 release/man3/ungetwc.3 create mode 100644 release/man3/unlocked_stdio.3 create mode 100644 release/man3/unlockpt.3 create mode 100644 release/man3/updwtmp.3 create mode 100644 release/man3/usleep.3 create mode 100644 release/man3/wcpcpy.3 create mode 100644 release/man3/wcpncpy.3 create mode 100644 release/man3/wcrtomb.3 create mode 100644 release/man3/wcscasecmp.3 create mode 100644 release/man3/wcscat.3 create mode 100644 release/man3/wcschr.3 create mode 100644 release/man3/wcscmp.3 create mode 100644 release/man3/wcscpy.3 create mode 100644 release/man3/wcscspn.3 create mode 100644 release/man3/wcsdup.3 create mode 100644 release/man3/wcslen.3 create mode 100644 release/man3/wcsncasecmp.3 create mode 100644 release/man3/wcsncat.3 create mode 100644 release/man3/wcsncmp.3 create mode 100644 release/man3/wcsncpy.3 create mode 100644 release/man3/wcsnlen.3 create mode 100644 release/man3/wcsnrtombs.3 create mode 100644 release/man3/wcspbrk.3 create mode 100644 release/man3/wcsrchr.3 create mode 100644 release/man3/wcsrtombs.3 create mode 100644 release/man3/wcsspn.3 create mode 100644 release/man3/wcsstr.3 create mode 100644 release/man3/wcstoimax.3 create mode 100644 release/man3/wcstok.3 create mode 100644 release/man3/wcstombs.3 create mode 100644 release/man3/wcswidth.3 create mode 100644 release/man3/wctob.3 create mode 100644 release/man3/wctomb.3 create mode 100644 release/man3/wctrans.3 create mode 100644 release/man3/wctype.3 create mode 100644 release/man3/wcwidth.3 create mode 100644 release/man3/wmemchr.3 create mode 100644 release/man3/wmemcmp.3 create mode 100644 release/man3/wmemcpy.3 create mode 100644 release/man3/wmemmove.3 create mode 100644 release/man3/wmemset.3 create mode 100644 release/man3/wordexp.3 create mode 100644 release/man3/wprintf.3 create mode 100644 release/man3/xcrypt.3 create mode 100644 release/man3/xdr.3 create mode 100644 release/man3/y0.3 create mode 100644 release/man4/console.4 create mode 100644 release/man4/console_codes.4 create mode 100644 release/man4/console_ioctl.4 create mode 100644 release/man4/dsp56k.4 create mode 100644 release/man4/fd.4 create mode 100644 release/man4/full.4 create mode 100644 release/man4/hd.4 create mode 100644 release/man4/initrd.4 create mode 100644 release/man4/intro.4 create mode 100644 release/man4/lp.4 create mode 100644 release/man4/mem.4 create mode 100644 release/man4/mouse.4 create mode 100644 release/man4/null.4 create mode 100644 release/man4/pts.4 create mode 100644 release/man4/ram.4 create mode 100644 release/man4/random.4 create mode 100644 release/man4/rtc.4 create mode 100644 release/man4/sd.4 create mode 100644 release/man4/sk98lin.4 create mode 100644 release/man4/st.4 create mode 100644 release/man4/tty.4 create mode 100644 release/man4/ttyS.4 create mode 100644 release/man4/tty_ioctl.4 create mode 100644 release/man4/vcs.4 create mode 100644 release/man4/wavelan.4 create mode 100644 release/man5/acct.5 create mode 100644 release/man5/charmap.5 create mode 100644 release/man5/core.5 create mode 100644 release/man5/dir_colors.5 create mode 100644 release/man5/elf.5 create mode 100644 release/man5/filesystems.5 create mode 100644 release/man5/ftpusers.5 create mode 100644 release/man5/group.5 create mode 100644 release/man5/host.conf.5 create mode 100644 release/man5/hosts.5 create mode 100644 release/man5/hosts.equiv.5 create mode 100644 release/man5/intro.5 create mode 100644 release/man5/issue.5 create mode 100644 release/man5/locale.5 create mode 100644 release/man5/motd.5 create mode 100644 release/man5/nologin.5 create mode 100644 release/man5/nscd.conf.5 create mode 100644 release/man5/nsswitch.conf.5 create mode 100644 release/man5/passwd.5 create mode 100644 release/man5/proc.5 create mode 100644 release/man5/protocols.5 create mode 100644 release/man5/resolv.conf.5 create mode 100644 release/man5/rpc.5 create mode 100644 release/man5/securetty.5 create mode 100644 release/man5/services.5 create mode 100644 release/man5/shells.5 create mode 100644 release/man5/slabinfo.5 create mode 100644 release/man5/termcap.5 create mode 100644 release/man5/ttytype.5 create mode 100644 release/man5/tzfile.5 create mode 100644 release/man5/utmp.5 create mode 100644 release/man6/intro.6 create mode 100644 release/man7/arp.7 create mode 100644 release/man7/ascii.7 create mode 100644 release/man7/boot.7 create mode 100644 release/man7/bootparam.7 create mode 100644 release/man7/capabilities.7 create mode 100644 release/man7/charsets.7 create mode 100644 release/man7/complex.7 create mode 100644 release/man7/credentials.7 create mode 100644 release/man7/ddp.7 create mode 100644 release/man7/environ.7 create mode 100644 release/man7/epoll.7 create mode 100644 release/man7/feature_test_macros.7 create mode 100644 release/man7/fifo.7 create mode 100644 release/man7/futex.7 create mode 100644 release/man7/glob.7 create mode 100644 release/man7/hier.7 create mode 100644 release/man7/icmp.7 create mode 100644 release/man7/inotify.7 create mode 100644 release/man7/intro.7 create mode 100644 release/man7/ip.7 create mode 100644 release/man7/ipv6.7 create mode 100644 release/man7/iso_8859-1.7 create mode 100644 release/man7/iso_8859-15.7 create mode 100644 release/man7/iso_8859-16.7 create mode 100644 release/man7/iso_8859-2.7 create mode 100644 release/man7/iso_8859-7.7 create mode 100644 release/man7/iso_8859-9.7 create mode 100644 release/man7/koi8-r.7 create mode 100644 release/man7/locale.7 create mode 100644 release/man7/mailaddr.7 create mode 100644 release/man7/man-pages.7 create mode 100644 release/man7/man.7 create mode 100644 release/man7/math_error.7 create mode 100644 release/man7/mdoc.7 create mode 100644 release/man7/mq_overview.7 create mode 100644 release/man7/netdevice.7 create mode 100644 release/man7/netlink.7 create mode 100644 release/man7/operator.7 create mode 100644 release/man7/packet.7 create mode 100644 release/man7/path_resolution.7 create mode 100644 release/man7/pipe.7 create mode 100644 release/man7/posixoptions.7 create mode 100644 release/man7/pthreads.7 create mode 100644 release/man7/pty.7 create mode 100644 release/man7/raw.7 create mode 100644 release/man7/regex.7 create mode 100644 release/man7/rtnetlink.7 create mode 100644 release/man7/sem_overview.7 create mode 100644 release/man7/shm_overview.7 create mode 100644 release/man7/signal.7 create mode 100644 release/man7/socket.7 create mode 100644 release/man7/spufs.7 create mode 100644 release/man7/standards.7 create mode 100644 release/man7/suffixes.7 create mode 100644 release/man7/svipc.7 create mode 100644 release/man7/tcp.7 create mode 100644 release/man7/termio.7 create mode 100644 release/man7/time.7 create mode 100644 release/man7/udp.7 create mode 100644 release/man7/udplite.7 create mode 100644 release/man7/unicode.7 create mode 100644 release/man7/units.7 create mode 100644 release/man7/unix.7 create mode 100644 release/man7/uri.7 create mode 100644 release/man7/utf-8.7 create mode 100644 release/man7/x25.7 create mode 100644 release/man8/intro.8 create mode 100644 release/man8/ld.so.8 create mode 100644 release/man8/ldconfig.8 create mode 100644 release/man8/nscd.8 create mode 100644 release/man8/sync.8 create mode 100644 release/man8/tzselect.8 create mode 100644 release/man8/zdump.8 create mode 100644 release/man8/zic.8 create mode 100644 translation_list diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 00000000..33e076e4 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,12591 @@ +Tue Apr 27 02:05:10 2010 Akihiro MOTOKI + + * draft/man5/resolv.conf.5, release/man5/resolv.conf.5: + [JM:13011], [JM:13013] "reverse IPv6 lookups" ¤ò + ¡ÖIPv6 ¥¢¥É¥ì¥¹¤ÎµÕ°ú¤­¡×¤ËÄûÀµ + +Sun Apr 25 12:01:31 JST 2010 JM ML to CVS Gateway + + * translation_list: [JM:13007] + * draft/man2/fcntl.2: [JM:13007] + * release/man2/fcntl.2: [JM:13007] + +Sun Apr 25 06:01:41 JST 2010 JM ML to CVS Gateway + + * translation_list: [JM:13004] + * draft/man2/sync_file_range.2: [JM:13004] + * release/man2/sync_file_range.2: [JM:13004] + +Sun Apr 25 06:01:40 JST 2010 JM ML to CVS Gateway + + * translation_list: [JM:13003] + * draft/man2/sigaction.2: [JM:13003] + * release/man2/sigaction.2: [JM:13003] + +Sun Apr 25 06:01:39 JST 2010 JM ML to CVS Gateway + + * translation_list: [JM:13002] + * draft/man2/open.2: [JM:13002] + * release/man2/open.2: [JM:13002] + +Sun Apr 25 06:01:37 JST 2010 JM ML to CVS Gateway + + * translation_list: [JM:13001] + * draft/man2/mount.2: [JM:13001] + * release/man2/mount.2: [JM:13001] + +Sun Apr 25 06:01:36 JST 2010 JM ML to CVS Gateway + + * translation_list: [JM:13000] + * draft/man2/fork.2: [JM:13000] + * release/man2/fork.2: [JM:13000] + +Sun Apr 25 06:01:35 JST 2010 JM ML to CVS Gateway + + * translation_list: [JM:12999] + * draft/man3/strftime.3: [JM:12999] + * release/man3/strftime.3: [JM:12999] + +Sun Apr 25 06:01:34 JST 2010 JM ML to CVS Gateway + + * translation_list: [JM:12998] + * draft/man3/fmemopen.3: [JM:12998] + * release/man3/fmemopen.3: [JM:12998] + +Sun Apr 25 06:01:33 JST 2010 JM ML to CVS Gateway + + * translation_list: [JM:12997] + * draft/man5/resolv.conf.5: [JM:12997] + * release/man5/resolv.conf.5: [JM:12997] + +Sun Apr 25 06:01:32 JST 2010 JM ML to CVS Gateway + + * translation_list: [JM:13005] + * draft/man2/setreuid.2: [JM:13005] + * release/man2/setreuid.2: [JM:13005] + +Sun Apr 25 06:01:30 JST 2010 JM ML to CVS Gateway + + * translation_list: [JM:12996] + * draft/man8/ld.so.8: [JM:12996] + * release/man8/ld.so.8: [JM:12996] + +Sun Apr 25 05:41:44 2010 Akihiro MOTOKI + + * mmap.2, sendfile.2, seteuid.2, setpgid.2, getaddrinfo.3, + getline.3, lockf.3, mq_notify.3, posix_memalign.3, telldir.3: + v3.19 -> v3.24 ¤Ç¤Î¾®¤µ¤á¤Î¿·µ¬ÄɲÃÉôʬ¤òÈ¿±Ç + +Sun Apr 18 01:06:12 2010 Akihiro MOTOKI + + * chown.2, clock_getres.2, clone.2, epoll_ctl.2, execve.2, + faccessat.2, fchmodat.2, fchownat.2, fstatat.2, futimesat.2, + getdents.2, getdomainname.2, getrusage.2, intro.2, linkat.2, + mkdirat.2, mknodat.2, openat.2, pipe.2, poll.2, readlinkat.2, + rename.2, renameat.2, stat.2, stime.2, symlinkat.2, + timerfd_create.2, umount.2, unlinkat.2, gcvt.3, mkfifoat.3, + posix_fallocate.3, realpath.3, seekdir.3, sem_post.3, strftime.3, + timeradd.3, resolv.conf.5, capabilities.7, environ.7, hier.7, + feature_test_macros.7, mq_overview.7, signal.7, time.7, udp.7: + v3.24 ¤Ç¹¹¿·¤µ¤ì¤¿¾¯¤·Êѹ¹¤¬Â礭ÌܤΠeditorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Sat Apr 10 23:14:40 2010 Akihiro MOTOKI + + * original/: v3.24 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: minor/editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Thu May 14 21:59:06 JST 2009 Kentaro Shirakata + + * ecvt.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Thu Apr 23 00:01:33 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12899] + * draft/man3/ecvt.3: [JM:12899] + +Wed Apr 22 01:25:59 2009 Akihiro MOTOKI + + * original/: v3.21 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: minor/editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Mon Apr 13 23:28:18 2009 Akihiro MOTOKI + + * getrusage.2: v3.20 ÂбþÈǤò¥ê¥ê¡¼¥¹ + +Mon Apr 13 23:08:02 2009 Akihiro MOTOKI + + * accept.2, getcontext.2, getitimer.2, gettimeofday.2, ptrace.2, + read.2, recv.2, send.2, write.2, basename.3, bcopy.3, + bsd_signal.3, ctime.3, getgrent.3, getgrnam.3, gethostbyname.3, + getpwent.3, getpwnam.3, index.3, isalpha.3, lockf.3, + makecontext.3, readdir.3, scalb.3, siginterrupt.3, sigset.3, + toascii.3, console_ioctl.4, null.4, random.4, group.5, proc.5, + inotify.7: v3.19->v3.20 ¤Î minor ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç¡£ + +Mon Apr 13 02:43:22 2009 Akihiro MOTOKI + + * capget.2, clone.2, epoll_ctl.2, epoll_wait.2, select_tut.2, + signalfd.2, dlopen.3, fexecve.3, longjmp.3, printf.3, sem_open.3, + shm_open.3, capabilities.7, epoll.7, mq_overview.7, + sem_overview.7, tcp.7: v3.20 ÂбþÈÇ + * proc.5: v3.19 ÂбþÈÇ¥ê¥ê¡¼¥¹ + +Mon Apr 13 01:47:06 2009 Akihiro MOTOKI + + * original/: v3.20 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: minor/editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Sat Mar 14 15:40:06 JST 2009 Kentaro Shirakata + + * epoll_create.2, nscd.8: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Mon Mar 9 06:01:48 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12868] + * draft/man3/longjmp.3: [JM:12868] + +Mon Mar 9 06:01:47 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12867] + * draft/man3/fexecve.3: [JM:12867] + +Mon Mar 9 06:01:46 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12866] + * draft/man3/dlopen.3: [JM:12866] + +Mon Mar 9 06:01:45 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12865] + * draft/man2/signalfd.2: [JM:12865] + +Mon Mar 9 06:01:44 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12864] + * draft/man2/select_tut.2: [JM:12864] + +Mon Mar 9 06:01:43 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12863] + * draft/man2/epoll_wait.2: [JM:12863] + +Mon Mar 9 06:01:42 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12862] + * draft/man2/epoll_ctl.2: [JM:12862] + +Mon Mar 9 06:01:41 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12861] + * draft/man2/clone.2: [JM:12861] + +Mon Mar 9 06:01:39 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12877] + * draft/man7/tcp.7: [JM:12877] + +Mon Mar 9 06:01:38 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12876] + * draft/man7/sem_overview.7: [JM:12876] + +Mon Mar 9 06:01:37 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12875] + * draft/man7/mq_overview.7: [JM:12875] + +Mon Mar 9 06:01:36 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12874] + * draft/man7/epoll.7: [JM:12874] + +Mon Mar 9 06:01:35 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12873] + * draft/man7/capabilities.7: [JM:12873] + +Mon Mar 9 06:01:34 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12872] + * draft/man5/proc.5: [JM:12872] + +Mon Mar 9 06:01:33 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12871] + * draft/man3/shm_open.3: [JM:12871] + +Mon Mar 9 06:01:32 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12870] + * draft/man3/sem_open.3: [JM:12870] + +Mon Mar 9 06:01:31 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12869] + * draft/man3/printf.3: [JM:12869] + +Mon Mar 9 06:01:29 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12860] + * draft/man2/capget.2: [JM:12860] + +Fri Mar 6 18:01:30 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12858] + * draft/man8/nscd.8: [JM:12858] + +Fri Mar 6 18:01:29 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12857] + * draft/man2/epoll_create.2: [JM:12857] + +Thu Mar 5 16:34:56 2009 Kentaro Shirakata + + * getdents.2, setjmp.3, strsep.3, netdevice.7: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sun Feb 22 11:29:13 2009 Akihiro MOTOKI + + * original/: v3.19 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: minor/editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Mon Feb 16 06:01:31 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12844] + * draft/man7/netdevice.7: [JM:12844] + +Mon Feb 16 06:01:30 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12843] + * draft/man3/strsep.3: [JM:12843] + +Mon Feb 16 06:01:29 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12842] + * draft/man3/setjmp.3: [JM:12842] + +Mon Feb 16 06:01:27 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12841] + * draft/man2/getdents.2: [JM:12841] + +Thu Feb 12 03:51:50 2009 Akihiro MOTOKI + + * original/: v3.18 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * release/man2/clock_getres.2, draft/man2/clock_getres.2: + original ¤Ç¤Î se 3 ¤«¤é 2 ¤Ë°ÜÆ°¤Ëȼ¤¤¡¢clock_getres.3 ¤«¤é°ÜÆ° + * draft, release: minor/editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Thu Feb 12 00:40:30 2009 Akihiro MOTOKI + + * original/: v3.17 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + * gethostid.3: gethostid.2 ¤ÎÆâÍƤòÈ¿±Ç¤·¤Æ¿·µ¬Äɲà + +Fri Jan 16 03:51:38 2009 Akihiro MOTOKI + + * original/: v3.16 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + * obsolete/man2/gethostid.2: ºï½ü¤Ë¤Ä¤­ draft/man2 ¤«¤é°ÜÆ° + * obsolete_list: gethostid.2 ¤Îºï½ü¤òÈ¿±Ç + +Thu Jan 15 06:01:31 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12826] + * draft/man7/ip.7: [JM:12826] + * release/man7/ip.7: [JM:12826] + +Thu Jan 15 06:01:30 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12825] + * draft/man7/icmp.7: [JM:12825] + * release/man7/icmp.7: [JM:12825] + +Thu Jan 15 06:01:29 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12824] + * draft/man7/arp.7: [JM:12824] + * release/man7/arp.7: [JM:12824] + +Thu Jan 15 06:01:28 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12823] + * draft/man3/fopen.3: [JM:12823] + * release/man3/fopen.3: [JM:12823] + +Thu Jan 15 06:01:27 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12822] + * draft/man3/getaddrinfo.3: [JM:12822] + * release/man3/getaddrinfo.3: [JM:12822] + +Thu Jan 15 06:01:26 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12821] + * draft/man3/on_exit.3: [JM:12821] + * release/man3/on_exit.3: [JM:12821] + +Thu Jan 15 06:01:25 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12820] + * draft/man3/atexit.3: [JM:12820] + * release/man3/atexit.3: [JM:12820] + +Thu Jan 15 06:01:24 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12818] + * draft/man2/gethostname.2: [JM:12818] + * release/man2/gethostname.2: [JM:12818] + +Thu Jan 15 06:01:23 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12828] + * draft/man7/udp.7: [JM:12828] + * release/man7/udp.7: [JM:12828] + +Thu Jan 15 06:01:22 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12827] + * draft/man7/pthreads.7: [JM:12827] + * release/man7/pthreads.7: [JM:12827] + +Thu Jan 15 06:01:20 JST 2009 JM ML to CVS Gateway + + * translation_list: [JM:12819] + * draft/man2/getdomainname.2: [JM:12819] + * release/man2/getdomainname.2: [JM:12819] + +Wed Jan 14 23:22:28 2009 Akihiro MOTOKI + + * open.2: [JM:12807] ¤Î²¬Ì¤ó¤Î¥³¥á¥ó¥ÈÈ¿±Ç + * makecontext.3: [JM:12808] ¤Î²¬Ì¤ó¤Î¥³¥á¥ó¥ÈÈ¿±Ç + +Wed Dec 24 12:01:36 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12806] + * draft/man3/makecontext.3: [JM:12806] + * release/man3/makecontext.3: [JM:12806] + +Wed Dec 24 12:01:35 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12805] + * draft/man2/sched_setaffinity.2: [JM:12805] + * release/man2/sched_setaffinity.2: [JM:12805] + +Wed Dec 24 12:01:34 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12804] + * draft/man2/recv.2: [JM:12804] + * release/man2/recv.2: [JM:12804] + +Wed Dec 24 12:01:33 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12803] + * draft/man2/open.2: [JM:12803] + * release/man2/open.2: [JM:12803] + +Wed Dec 24 12:01:32 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12802] + * draft/man2/mmap.2: [JM:12802] + * release/man2/mmap.2: [JM:12802] + +Wed Dec 24 12:01:30 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12801] + * draft/man2/accept.2: [JM:12801] + * release/man2/accept.2: [JM:12801] + +Wed Dec 24 07:51:54 2008 Akihiro MOTOKI + + * time.1, _exit.2, accept.2, exit_group.2, mmap.2, open.2, recv.2, + sched_setaffinity.2, stat.2, bindresvport.3, getgrnam.3, + getpwnam.3, inet_ntop.3, makecontext.3, signal.7: + LDP v3.15 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * proc.5, capabilities.7: draft commit. + +Fri Dec 19 03:29:56 2008 Akihiro MOTOKI + + * original/: v3.15 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Thu Dec 18 00:25:53 2008 Akihiro MOTOKI + + * translation_list: move_pages.2 ¤Î¥¹¥Æ¡¼¥¿¥¹¹¹¿·Ëº¤ì (¥ê¥ê¡¼¥¹ºÑ) + +Sun Dec 14 02:29:12 2008 Akihiro MOTOKI + + * time.1, clone.2, eventfd.2, get_mempolicy.2, mbind.2, pipe.2, + set_mempolicy.2, signalfd.2, socket.2, timerfd_create.2, + fmemopen.3, popen.3: LDP v3.13 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Thu Nov 20 06:01:37 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12764] + * draft/man1/time.1: [JM:12764] + +Thu Nov 20 06:01:35 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12763] + * draft/man2/timerfd_create.2: [JM:12763] + +Thu Nov 20 06:01:34 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12762] + * draft/man2/mbind.2: [JM:12762] + +Thu Nov 20 06:01:33 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12761] + * draft/man2/set_mempolicy.2: [JM:12761] + +Thu Nov 20 06:01:32 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12760] + * draft/man2/get_mempolicy.2: [JM:12760] + +Thu Nov 20 06:01:29 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12759] + * draft/man2/umount.2: [JM:12759] + * release/man2/umount.2: [JM:12759] + +Thu Nov 20 06:01:27 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12758] + * draft/man2/mount.2: [JM:12758] + * release/man2/mount.2: [JM:12758] + +Mon Nov 10 12:01:33 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12754] + * draft/man2/move_pages.2: [JM:12754] + +Mon Nov 10 12:01:31 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12753] + * draft/man2/signalfd.2: [JM:12753] + +Mon Nov 10 12:01:28 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12752] + * draft/man2/eventfd.2: [JM:12752] + +Mon Nov 10 06:01:40 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12751] + * draft/man2/clone.2: [JM:12751] + +Mon Nov 10 06:01:39 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12750] + * draft/man2/getrusage.2: [JM:12750] + +Mon Nov 10 06:01:38 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12749] + * draft/man2/vfork.2: [JM:12749] + * release/man2/vfork.2: [JM:12749] + +Mon Nov 10 06:01:36 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12748] + * draft/man3/ctime.3: [JM:12748] + * release/man3/ctime.3: [JM:12748] + +Mon Nov 10 03:34:04 2008 Akihiro MOTOKI + + * draft/man2/spu_run.2, release/man2/spu_run.2: ºÇ¿·ÈǤ˹¹¿·¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + * draft/man2/spu_create.2, draft/man7/spufs.7: ´Ö°ã¤¨¤Æºî¶ÈÃæ¤Î + ¤â¤Î¤¬ÅÐÏ¿¤·¤Æ¤·¤Þ¤Ã¤Æ¤¤¤¿¤Î¤Ç¡¢¥ê¥ê¡¼¥¹ÈǤ˺¹¤·Ìᤷ¡£ + +Mon Nov 10 03:04:43 2008 Akihiro MOTOKI + + * dup.2, execve.2, fallocate.2, inotify_init.2, mlock.2, + readdir.2, sched_yield.2, sigaltstack.2, sigpending.2, + sigprocmask.2, sigwaitinfo.2, splice.2, mq_getattr.3, + mq_receive.3, mq_send.3, realpath.3: + v3.10->v3.13 ¤ÎÊѹ¹ÅÀ¤òÈ¿±Ç + +Sun Nov 9 12:01:34 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12747] + * draft/man3/popen.3: [JM:12747] + +Sun Nov 9 12:01:33 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12746] + * draft/man3/fmemopen.3: [JM:12746] + +Sun Nov 9 12:01:32 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12745] + * draft/man2/socket.2: [JM:12745] + +Sun Nov 9 12:01:30 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12744] + * draft/man2/pipe.2: [JM:12744] + +Sun Nov 9 09:01:06 2008 Akihiro MOTOKI + + * dup.2, epoll_create.2, getdents.2, getrlimit.2, mlock.2, + pause.2, sched_setaffinity.2, sigaction.2, socketpair.2, + syscalls.2, wait4.2, clock_getres.3, fenv.3, fma.3, getaddrinfo.3, + pthreads.7: v3.10->v3.13 ¤ÎÊѹ¹ÅÀ¤òÈ¿±Ç + +Sat Nov 8 23:51:10 2008 Akihiro MOTOKI + + * original/: v3.13 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * mprotect.2, open.2, readlink.2, sched_setscheduler.2, wait.2, + backtrace.3, end.3, frexp.3, getdate.3, getgrouplist.3, + gnu_get_libc_version.3, inet.3, inet_pton.3, makecontext.3, + offsetof.3, resolver.3, sem_wait.3, strftime.3, strtok.3, strtol.3, + core.5, epoll.7, iso_8859-7.7: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Sat Nov 8 23:32:58 2008 Akihiro MOTOKI + + * getsockopt.2, open.2, readdir.2, vfork.2, ctime.3, dlopen.3, + fopen.3, frexp.3, gethostbyname.3, readdir.3, strcpy.3, + pthreads.7: v3.11, v3.12 ¤Ç¤ÎÊѹ¹ÅÀ¤òÈ¿±Ç + +Sun Nov 2 09:29:21 2008 Akihiro MOTOKI + + * original/: v3.12 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Sun Oct 12 04:54:21 2008 Akihiro MOTOKI + + * clock_nanosleep.2, fcntl.2, stat.2, end.3, erfc.3, getdate.3, + getnetent.3, getprotoent.3, getrpcent.3, getservent.3, + gnu_get_libc_version.3, hsearch.3, random_r.3, sched_getcpu.3, + sigwait.3, y0.3, core.5, inotify.7, math_error.7, shm_overview.7, + udplite.7: LDP v3.11 ÂбþÈÇ¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­È¿±Ç + +Sun Oct 12 03:43:17 2008 Akihiro MOTOKI + + * draft, release: v3.10->3.11 ¤Î editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Sun Oct 12 03:24:17 2008 Akihiro MOTOKI + + * original/: v3.11 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + +Fri Oct 10 03:05:10 2008 Akihiro MOTOKI + + * original/: v3.10 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Fri Oct 10 02:37:52 2008 Akihiro MOTOKI + + * draft/man3/crypt.3, release/man3/crypt.3: v3.05¢ª3.07 ¤ÎÊѹ¹ÅÀ¤Î + È¿±Çϳ¤ì¤ò½¤Àµ + +Wed Oct 8 17:21:15 JST 2008 Kentaro Shirakata + + * getdents.2, mkdir.2, crypt.3, ftime.3, getpw.3, mkfifo.3, + updwtmp.3, console_codes.4, mdoc.7: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Mon Sep 29 00:01:25 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12726] + * draft/man3/crypt.3: [JM:12726] + +Sun Sep 21 06:01:36 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12724] + * draft/man3/getservent.3: [JM:12724] + +Sun Sep 21 06:01:35 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12723] + * draft/man3/getrpcent.3: [JM:12723] + +Sun Sep 21 06:01:34 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12722] + * draft/man3/getprotoent.3: [JM:12722] + +Sun Sep 21 06:01:33 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12721] + * draft/man3/getnetent.3: [JM:12721] + +Sun Sep 21 06:01:32 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12720] + * draft/man5/core.5: [JM:12720] + +Sun Sep 21 06:01:31 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12719] + * draft/man3/hsearch.3: [JM:12719] + +Sun Sep 21 06:01:30 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12718] + * draft/man3/getdate.3: [JM:12718] + +Sun Sep 21 06:01:29 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12716] + * draft/man2/fcntl.2: [JM:12716] + +Sun Sep 21 06:01:29 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12725] + * draft/man7/inotify.7: [JM:12725] + +Sun Sep 21 06:01:27 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12717] + * draft/man2/stat.2: [JM:12717] + +Fri Sep 19 18:48:22 2008 Akihiro MOTOKI + + * ¥ê¥ê¡¼¥¹ºÑ¤ß¤È¤Ê¤Ã¤Æ¤¤¤ë¥Ú¡¼¥¸¤Ç¡¢draft ÈÇ (ºÇ¿·ÈÇ) ¤¬ + ¥ê¥ê¡¼¥¹ÈǤËÈ¿±Ç¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ú¡¼¥¸¤¬¤¢¤Ã¤¿¤Î¤Ç¡¢¥³¥Ô¡¼ + (LDP v3.08 ¤Ø¤ÎÄɽ¾ºî¶È»þ¤Ë release/ ¤Ë¥³¥Ô¡¼¤·Ëº¤ì¤Þ¤·¤¿): + faccessat.2, fchmodat.2, fchownat.2, fcntl.2, fstatat.2, linkat.2, + mkdirat.2, mknodat.2, mmap.2, openat.2, readlinkat.2, renameat.2, + shmop.2, socketcall.2, socketpair.2, symlinkat.2, tkill.2, + unlinkat.2, dirfd.3, exec.3, fmemopen.3, gethostbyname.3, + mkdtemp.3, mkfifoat.3, mq_notify.3, psignal.3, realpath.3, + sem_init.3, strsignal.3, rpc.5 + +Fri Sep 19 18:19:15 2008 Akihiro MOTOKI + + * LDP v3.07 ¤Ç¹¹¿·¤µ¤ì¤¿¿ô³Ø´Ø¿ô¤òºÇ¿·ÈǤËÄɽ¾ + +Fri Sep 19 18:16:51 2008 Akihiro MOTOKI + + * draft/man3/erfc.3: subnormal ¤ÎÌõ¤ò½¤Àµ + +Fri Sep 19 18:01:51 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12704] + * draft/man3/fpclassify.3: [JM:12704] + * release/man3/fpclassify.3: [JM:12704] + +Fri Sep 19 18:01:50 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12703] + * draft/man3/gamma.3: [JM:12703] + * release/man3/gamma.3: [JM:12703] + +Fri Sep 19 18:01:49 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12702] + * draft/man3/hypot.3: [JM:12702] + * release/man3/hypot.3: [JM:12702] + +Fri Sep 19 18:01:48 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12701] + * draft/man3/lgamma.3: [JM:12701] + * release/man3/lgamma.3: [JM:12701] + +Fri Sep 19 18:01:47 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12700] + * draft/man3/log.3: [JM:12700] + * release/man3/log.3: [JM:12700] + +Fri Sep 19 18:01:46 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12699] + * draft/man3/atanh.3: [JM:12699] + * release/man3/atanh.3: [JM:12699] + +Fri Sep 19 18:01:45 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12698] + * draft/man3/acos.3: [JM:12698] + * release/man3/acos.3: [JM:12698] + +Fri Sep 19 18:01:42 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12697] + * draft/man3/y0.3: [JM:12697] + +Fri Sep 19 18:01:42 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12714] + * draft/man3/ceil.3: [JM:12714] + * release/man3/ceil.3: [JM:12714] + +Fri Sep 19 18:01:41 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12713] + * draft/man3/lrint.3: [JM:12713] + * release/man3/lrint.3: [JM:12713] + +Fri Sep 19 18:01:39 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12712] + * draft/man3/lround.3: [JM:12712] + * release/man3/lround.3: [JM:12712] + +Fri Sep 19 18:01:38 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12711] + * draft/man3/nextafter.3: [JM:12711] + * release/man3/nextafter.3: [JM:12711] + +Fri Sep 19 18:01:37 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12710] + * draft/man3/pow.3: [JM:12710] + * release/man3/pow.3: [JM:12710] + +Fri Sep 19 18:01:36 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12709] + * draft/man3/scalb.3: [JM:12709] + * release/man3/scalb.3: [JM:12709] + +Fri Sep 19 18:01:35 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12708] + * draft/man3/tgamma.3: [JM:12708] + * release/man3/tgamma.3: [JM:12708] + +Fri Sep 19 18:01:34 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12707] + * draft/man3/exp.3: [JM:12707] + * release/man3/exp.3: [JM:12707] + +Fri Sep 19 18:01:33 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12706] + * draft/man3/fenv.3: [JM:12706] + * release/man3/fenv.3: [JM:12706] + +Fri Sep 19 18:01:32 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12705] + * draft/man3/fma.3: [JM:12705] + * release/man3/fma.3: [JM:12705] + +Fri Sep 19 18:01:29 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12696] + * draft/man3/erfc.3: [JM:12696] + +Sun Sep 14 18:01:44 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12694] + * draft/man7/udplite.7: [JM:12694] + +Sun Sep 14 18:01:42 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12693] + * draft/man7/shm_overview.7: [JM:12693] + +Sun Sep 14 18:01:40 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12692] + * draft/man7/math_error.7: [JM:12692] + +Sun Sep 14 18:01:38 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12691] + * draft/man3/sigwait.3: [JM:12691] + +Sun Sep 14 18:01:36 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12690] + * draft/man3/sched_getcpu.3: [JM:12690] + +Sun Sep 14 18:01:34 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12689] + * draft/man3/random_r.3: [JM:12689] + +Sun Sep 14 18:01:32 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12688] + * draft/man3/gnu_get_libc_version.3: [JM:12688] + +Sun Sep 14 18:01:30 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12687] + * draft/man3/end.3: [JM:12687] + +Sun Sep 14 18:01:27 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12686] + * draft/man2/clock_nanosleep.2: [JM:12686] + +Sun Sep 14 12:17:15 2008 Akihiro MOTOKI + + * link.2, getcwd.3, opendir.3: v3.08 ÂбþÈǤò¥ê¥ê¡¼¥¹ + +Sun Sep 14 12:02:19 2008 Akihiro MOTOKI + + * original/: v3.09 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Sun Sep 14 06:13:53 2008 Akihiro MOTOKI + + * capget.2, getrlimit.2, open.2, prctl.2, sched_setscheduler.2, + getaddrinfo.3, getgrouplist.3, getopt.3, inet.3, inet_pton.3, + mkstemp.3, readdir.3, random.4, acct.5, core.5, locale.5, utmp.5, + credentials.7, signal.7, unix.7: v3.08 ÂбþÈǤò¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­È¿±Ç + +Tue Sep 2 23:29:27 2008 Akihiro MOTOKI + + * original/: v3.08 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Wed Aug 20 22:30:28 2008 Akihiro MOTOKI + + * original/: v3.07 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Tue Aug 19 06:01:33 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12658] + * draft/man3/inet_pton.3: [JM:12658] + +Tue Aug 19 06:01:32 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12657] + * draft/man3/inet_ntop.3: [JM:12657] + +Tue Aug 19 06:01:31 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12656] + * draft/man3/inet.3: [JM:12656] + +Tue Aug 19 06:01:30 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12655] + * draft/man3/getopt.3: [JM:12655] + +Tue Aug 19 06:01:29 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12654] + * draft/man3/getgrouplist.3: [JM:12654] + +Tue Aug 19 06:01:28 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12653] + * draft/man3/getaddrinfo.3: [JM:12653] + +Tue Aug 19 06:01:27 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12652] + * draft/man2/sched_setscheduler.2: [JM:12652] + +Tue Aug 19 06:01:26 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12651] + * draft/man2/prctl.2: [JM:12651] + +Tue Aug 19 06:01:25 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12665] + * draft/man7/signal.7: [JM:12665] + +Tue Aug 19 06:01:24 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12664] + * draft/man5/utmp.5: [JM:12664] + +Tue Aug 19 06:01:23 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12663] + * draft/man5/locale.5: [JM:12663] + +Tue Aug 19 06:01:21 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12662] + * draft/man4/random.4: [JM:12662] + +Tue Aug 19 06:01:20 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12661] + * draft/man3/scanf.3: [JM:12661] + +Tue Aug 19 06:01:19 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12660] + * draft/man3/readdir.3: [JM:12660] + +Tue Aug 19 06:01:18 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12659] + * draft/man3/mkstemp.3: [JM:12659] + +Tue Aug 19 06:01:17 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12650] + * draft/man2/capget.2: [JM:12650] + +Sun Aug 10 12:01:27 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12644] + * draft/man5/core.5: [JM:12644] + +Sun Aug 10 12:01:26 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12643] + * draft/man5/acct.5: [JM:12643] + +Sun Aug 10 12:01:25 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12642] + * draft/man3/ctime.3: [JM:12642] + +Sun Aug 10 12:01:24 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12641] + * draft/man2/set_mempolicy.2: [JM:12641] + +Sun Aug 10 12:01:23 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12640] + * draft/man2/open.2: [JM:12640] + +Sun Aug 10 12:01:22 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12639] + * draft/man2/nanosleep.2: [JM:12639] + +Sun Aug 10 12:01:21 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12638] + * draft/man2/getrlimit.2: [JM:12638] + +Sun Aug 10 12:01:21 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12637] + * draft/man2/getgroups.2: [JM:12637] + +Sun Aug 10 12:01:20 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12647] + * draft/man7/unix.7: [JM:12647] + +Sun Aug 10 12:01:19 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12646] + * draft/man7/time.7: [JM:12646] + +Sun Aug 10 12:01:18 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12645] + * draft/man7/credentials.7: [JM:12645] + +Sun Aug 10 12:01:16 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12636] + * draft/man2/get_mempolicy.2: [JM:12636] + +Sun Aug 10 08:01:02 2008 Akihiro MOTOKI + + * draft/*, release/*: v2.79->3.05 ¤ÎÊѹ¹¤òÈ¿±Ç¡£ + +Mon Aug 4 00:09:26 2008 Akihiro MOTOKI + + * draft/*, release/*: v2.79->3.05 ¤Î section 4-8 ¤Î¤µ¤µ¤¤¤ÊÊѹ¹¤òÈ¿±Ç¡£ + +Sun Aug 3 01:35:37 2008 Akihiro MOTOKI + + * draft/*, release/*: v3.04->3.05 ¤Î section 2 ¤Î¤µ¤µ¤¤¤ÊÊѹ¹¤òÈ¿±Ç¡£ + +Sun Aug 3 01:10:51 2008 Akihiro MOTOKI + + * draft/*, release/*: v2.79->3.05 ¤Î section 3 ¤Î¤µ¤µ¤¤¤ÊÊѹ¹¤òÈ¿±Ç¡£ + +Thu Jul 31 06:01:19 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12633] + * draft/man7/mdoc.7: [JM:12633] + +Thu Jul 31 06:01:17 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12632] + * draft/man2/wait.2: [JM:12632] + +Thu Jul 31 02:54:13 2008 Akihiro MOTOKI + + * draft/*, release/*: v2.79->3.05 ¤Î section 2 ¤Î¤µ¤µ¤¤¤ÊÊѹ¹¤òÈ¿±Ç¡£ + +Thu Jul 31 00:01:23 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12631] + * draft/man3/updwtmp.3: [JM:12631] + +Thu Jul 31 00:01:22 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12630] + * draft/man3/mkfifo.3: [JM:12630] + +Thu Jul 31 00:01:21 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12629] + * draft/man3/ftime.3: [JM:12629] + +Thu Jul 31 00:01:21 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12628] + * draft/man3/crypt.3: [JM:12628] + +Thu Jul 31 00:01:20 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12627] + * draft/man2/mkdir.2: [JM:12627] + +Thu Jul 31 00:01:18 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12626] + * draft/man2/getdents.2: [JM:12626] + +Thu Jul 30 18:21:34 JST 2008 Kentaro Shirakata + + * draft/*, release/*: ¤µ¤µ¤¤¤ÊÊѹ¹¤òÈ¿±Ç¡£ + +Mon Jul 28 08:13:57 2008 Akihiro MOTOKI + + * draft/*, release/*: v2.79->3.05 ¤Î¤µ¤µ¤¤¤ÊÊѹ¹¤òÈ¿±Ç¡£ + +Sun Jul 27 08:01:10 2008 Akihiro MOTOKI + + * original/: v3.05 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * {draft,release}/ seteuid.2, cerf.3, floor.3, rint.3, round.3, + significand.3: v3.05 ¤ÎÊѹ¹È¿±Ç¡£ + +Thu Jul 24 04:23:10 JST 2008 Kentaro Shirakata + + * draft/*, release/*: ¤µ¤µ¤¤¤ÊÊѹ¹¤òÈ¿±Ç¡£ + +Wed Jul 23 18:01:24 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12624] + * draft/man3/getpw.3: [JM:12624] + +Wed Jul 23 00:01:19 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12622] + * draft/man4/console_codes.4: [JM:12622] + +Wed Jul 23 00:01:17 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12621] + * draft/man4/console_ioctl.4: [JM:12621] + +Tue Jul 22 04:15:19 JST 2008 Kentaro Shirakata + + * charmap.5, protocols.5, rpc.5, charsets.7, uri.7: + ¤µ¤µ¤¤¤ÊÊѹ¹¤òÈ¿±Ç¡£ + +Mon Jul 21 08:29:44 2008 Akihiro MOTOKI + + * original/: v3.04 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + +Mon Jul 21 08:19:33 2008 Akihiro MOTOKI + + * execve.2, open.2, syslog.2, ctime.3, getaddrinfo.3, epoll.7: + LDP v2.79 ÂбþÈÇ¥ê¥ê¡¼¥¹ + +Thu Apr 10 06:01:21 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12613] + * draft/man7/epoll.7: [JM:12613] + +Thu Apr 10 06:01:20 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12612] + * draft/man3/getaddrinfo.3: [JM:12612] + +Thu Apr 10 06:01:19 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12611] + * draft/man3/ctime.3: [JM:12611] + +Thu Apr 10 06:01:18 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12610] + * draft/man2/syslog.2: [JM:12610] + +Thu Apr 10 06:01:17 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12609] + * draft/man2/open.2: [JM:12609] + +Thu Apr 10 06:01:15 JST 2008 JM ML to CVS Gateway + + * translation_list: [JM:12608] + * draft/man2/execve.2: [JM:12608] + +Fri Apr 4 01:42:05 2008 Akihiro MOTOKI + + * original/: v2.79 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Tue Feb 12 14:07:02 2008 Akihiro MOTOKI + + * draft, release: v2.66->v2.77 ¤ÎÊѹ¹ÅÀ¤òÈ¿±Ç + +Fri Feb 8 05:21:36 2008 Akihiro MOTOKI + + * original/: v2.77 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Mon Jan 28 01:43:01 2008 Akihiro MOTOKI + + * fallocate.2, fsync.2, getitimer.2, open.2, sgetmask.2, + spu_create.2, spu_run.2, backtrace.3, longjmp.3, malloc.3, + opendir.3, readdir.3, timeradd.3, spufs.7: + LDP v2.67 ÂбþÈÇ¥ê¥ê¡¼¥¹ + +Tue Oct 30 00:01:26 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12593] + * draft/man7/credentials.7: [JM:12593] + +Thu Oct 25 01:58:56 2007 Akihiro MOTOKI + + * original/: v2.67 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + +Sun Oct 14 18:02:33 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12571] + * draft/man2/getitimer.2: [JM:12571] + +Sun Oct 14 12:02:36 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12576] + * draft/man3/readdir.3: [JM:12576] + +Sun Oct 14 12:02:35 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12575] + * draft/man3/opendir.3: [JM:12575] + +Sun Oct 14 12:02:34 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12574] + * draft/man3/malloc.3: [JM:12574] + +Sun Oct 14 12:02:33 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12573] + * draft/man3/longjmp.3: [JM:12573] + +Sun Oct 14 12:02:32 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12572] + * draft/man2/open.2: [JM:12572] + +Sun Oct 14 12:02:31 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12570] + * draft/man2/fsync.2: [JM:12570] + +Sun Oct 14 12:02:30 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12569] + * draft/man2/execve.2: [JM:12569] + * release/man2/execve.2: [JM:12569] + +Sun Oct 14 12:02:28 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12568] + * draft/man2/close.2: [JM:12568] + * release/man2/close.2: [JM:12568] + +Thu Oct 11 01:53:44 2007 Akihiro MOTOKI + + * access.2, mmap.2, mmap2.2, select.2, setpgid.2, sigqueue.2, + syscalls.2, epoll.7, feature_test_macros.7: + LDP v2.64 ÂбþÈÇ¥ê¥ê¡¼¥¹ + +Wed Oct 10 23:36:37 2007 Akihiro MOTOKI + + * original/: v2.66 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç + * obsolete/man2/fdatasync.2: ºï½ü¤Ëȼ¤¤ draft/man2 ¤«¤é°ÜÆ° + * obsolete_list: fdatasync.2 ¤Îºï½ü¤òÈ¿±Ç + +Wed Sep 26 06:02:29 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12551] + * draft/man2/mmap2.2: [JM:12551] + +Wed Sep 26 00:02:40 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12558] + * draft/man7/feature_test_macros.7: [JM:12558] + +Wed Sep 26 00:02:39 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12557] + * draft/man7/epoll.7: [JM:12557] + +Wed Sep 26 00:02:38 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12556] + * draft/man2/syscalls.2: [JM:12556] + +Wed Sep 26 00:02:37 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12555] + * draft/man2/sigqueue.2: [JM:12555] + +Wed Sep 26 00:02:36 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12554] + * draft/man2/setpgid.2: [JM:12554] + +Wed Sep 26 00:02:35 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12553] + * draft/man2/sigaction.2: [JM:12553] + +Wed Sep 26 00:02:34 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12552] + * draft/man2/select.2: [JM:12552] + +Wed Sep 26 00:02:33 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12550] + * draft/man2/mmap.2: [JM:12550] + +Wed Sep 26 00:02:32 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12559] + * draft/man7/signal.7: [JM:12559] + +Wed Sep 26 00:02:30 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12549] + * draft/man2/access.2: [JM:12549] + +Thu Sep 6 10:43:06 2007 Akihiro MOTOKI + + * v2.60->v2.64 ¤ÎÊѹ¹ÅÀ¤òÈ¿±Ç (section 3). + +Thu Sep 6 00:47:38 2007 Akihiro MOTOKI + + * v2.60->v2.64 ¤ÎÊѹ¹ÅÀ¤òÈ¿±Ç (section 4). + +Tue Sep 4 01:46:47 2007 Akihiro MOTOKI + + * original/: v2.64 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + +Tue Sep 4 01:09:31 2007 Akihiro MOTOKI + + * original/: v2.63 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç (section 2,7,8) + +Sat Jul 28 08:03:00 2007 Akihiro MOTOKI + + * listen.2, strcat.3, strcpy.3, proc.5, man-pages.7: + LDP v2.60 ÂбþÈÇ¥ê¥ê¡¼¥¹ + +Tue Jul 3 03:08:10 2007 Akihiro MOTOKI + + * original/: v2.60 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç¡£ + +Sun Jul 1 01:37:02 2007 Akihiro MOTOKI + + * alloc_hugepages.2, bind.2, clone.2, modify_ldt.2, mprotect.2, + signal.2, bindresvport.3, exit.3, getaddrinfo.3, gethostbyname.3, + memmove.3, inotify.7, man.7, man-pages.7, ld.so.8: + LDP v2.57 ÂбþÈÇ¥ê¥ê¡¼¥¹ + +Mon Jun 18 12:02:23 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12540] + * draft/man3/exit.3: [JM:12540] + +Mon Jun 18 12:02:21 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12539] + * draft/man2/modify_ldt.2: [JM:12539] + +Mon Jun 18 03:36:07 2007 Akihiro MOTOKI + + * original/: v2.57 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç¡£ + +Fri Jun 15 06:02:12 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12530] + * draft/man2/bind.2: [JM:12530] + +Fri Jun 15 06:02:09 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12538] + * draft/man7/man-pages.7: [JM:12538] + +Fri Jun 15 06:02:08 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12537] + * draft/man7/man.7: [JM:12537] + +Fri Jun 15 06:02:07 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12536] + * draft/man3/memmove.3: [JM:12536] + +Fri Jun 15 06:02:06 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12535] + * draft/man8/ld.so.8: [JM:12535] + +Fri Jun 15 06:02:06 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12534] + * draft/man7/inotify.7: [JM:12534] + +Fri Jun 15 06:02:05 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12533] + * draft/man3/getaddrinfo.3: [JM:12533] + +Fri Jun 15 06:02:04 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12532] + * draft/man2/signal.2: [JM:12532] + +Fri Jun 15 06:02:02 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12531] + * draft/man2/clone.2: [JM:12531] + +Fri Jun 15 02:45:41 2007 Akihiro MOTOKI + + * original/: v2.56 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç¡£ + +Wed Jun 13 06:02:14 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12529] + * draft/man3/gethostbyname.3: [JM:12529] + +Wed Jun 13 06:02:14 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12528] + * draft/man3/bindresvport.3: [JM:12528] + +Wed Jun 13 06:02:13 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12527] + * draft/man2/mprotect.2: [JM:12527] + +Wed Jun 13 06:02:11 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12526] + * draft/man2/alloc_hugepages.2: [JM:12526] + +Wed Jun 13 03:49:40 2007 Akihiro MOTOKI + + * original/: v2.55 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç¡£ + * path_resolution.2 ¤ò path_resolution.7 ¤Ë°ÜÆ° + +Mon Jun 11 02:06:46 2007 Akihiro MOTOKI + + * original/: v2.54 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹ÅÀ¤òÈ¿±Ç¡£ + * LDP.7, ksoftirqd.7: ºï½ü (obsolete/ °Ê²¼¤Ë°ÜÆ°) + * obsolete_list: LDP.7, ksoftirqd.7 ¤Î¾ðÊó¤ò + translation_list ¤«¤é°ÜÆ°¡£ + * sk98lin.4: ML ¤Ç¤Î±ó»³¤µ¤ó¤Î¥³¥á¥ó¥ÈÈ¿±Ç¡£ + +Sun Jun 10 17:43:39 2007 Akihiro MOTOKI + + * original/: v2.53 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: v2.51->v2.52->v2.53 ¤ÎÊѹ¹ÅÀ¤òÈ¿±Ç + +Fri Jun 8 01:08:31 2007 Akihiro MOTOKI + + * epoll_wait.2, execve.2, readv.2, sched_rr_get_interval.2, + bsd_signal.3, clock.3, copysign.3, euidaccess.3, getsubopt.3, + iconv_open.3, strcoll.3, sysv_signal.3, sk98lin.4, ip.7, signal.7: + LDP v2.51 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + ML ¤Ç¤ÎÉð°æ¤µ¤ó¡¢±ó»³¤µ¤ó¤Î¥³¥á¥ó¥È¤òÈ¿±Ç¡£Â¾¡¢¹»Àµºî¶È¡£ + +Wed Jun 6 12:02:20 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12523] + * draft/man4/sk98lin.4: [JM:12523] + +Sun Jun 3 12:02:53 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12516] + * draft/man2/execve.2: [JM:12516] + +Sun Jun 3 12:02:51 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12513] + * draft/man3/sysv_signal.3: [JM:12513] + +Sun Jun 3 12:02:49 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12515] + * draft/man3/getsubopt.3: [JM:12515] + +Sun Jun 3 12:02:47 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12514] + * draft/man3/bsd_signal.3: [JM:12514] + +Sun Jun 3 12:02:44 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12512] + * draft/man3/euidaccess.3: [JM:12512] + +Sun Jun 3 12:02:43 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12511] + * draft/man2/epoll_wait.2: [JM:12511] + +Sun Jun 3 12:02:41 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12510] + * draft/man2/readv.2: [JM:12510] + +Sun Jun 3 12:02:39 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12509] + * draft/man2/sched_rr_get_interval.2: [JM:12509] + +Sun Jun 3 07:41:56 2007 Akihiro MOTOKI + + * draft/man2/acct.2, release/man2/acct.2: + bold ¤Çɽ¼¨¤¹¤ëÈϰϤ¬´Ö°ã¤Ã¤Æ¤¤¤¿¤Î¤Ç½¤Àµ¡£ + * draft/man2/personality.2, release/man2/personality.2, + draft/man3/basename.3, release/man3/basename.3: + v2.46->v2.51 ¤Î editorical ¤ÊÊѹ¹¤ÎÈ¿±Ç¤È¡¢Ìõʸ¤Î¹»Àµ¡£ + draft/man2/pciconfig_read.2, release/man2/pciconfig_read.2: + v2.43->v2.51 ¤Î editorical ¤ÊÊѹ¹¤ÎÈ¿±Ç¤È¡¢Ìõʸ¤Î¹»Àµ¡£ + +Fri Jun 1 06:02:19 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12507] + * draft/man7/ip.7: [JM:12507] + +Fri Jun 1 06:02:18 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12506] + * draft/man7/signal.7: [JM:12506] + +Fri Jun 1 06:02:17 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12505] + * draft/man3/strcoll.3: [JM:12505] + +Fri Jun 1 06:02:16 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12504] + * draft/man3/iconv_open.3: [JM:12504] + +Fri Jun 1 06:02:15 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12502] + * draft/man3/clock.3: [JM:12502] + +Fri Jun 1 06:02:14 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12503] + * draft/man3/copysign.3: [JM:12503] + +Fri Jun 1 02:52:01 2007 Akihiro MOTOKI + + * mmap.2, sigaction.2, signal.2, epoll.7, ipv6.7: + v2.46->v2.51 ¤Î¾¯¤·Â礭¤á¤Î editorical ¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: ¾åµ­È¿±Ç + +Fri Jun 1 00:51:23 2007 Akihiro MOTOKI + + * original/: v2.51 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹¤òÈ¿±Ç + +Mon May 28 06:03:23 2007 Akihiro MOTOKI + + * original/: v2.50 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹¤òÈ¿±Ç + +Mon May 28 03:39:18 2007 Akihiro MOTOKI + + * original/: v2.48 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: editorical ¤ÊÊѹ¹¤òÈ¿±Ç + +Mon May 21 01:34:41 2007 Akihiro MOTOKI + + * draft/man2/rename.2, draft/man2/semop.2, draft/man2/write.2, + draft/man3/termios.3, draft/man7/feature_test_macros.7: + ±ó»³¤µ¤ó¤Î¥³¥á¥ó¥È¤òÈ¿±Ç¡£ + * access.2, clone.2, faccessat.2, mincore.2, mmap.2, mount.2, + open.2, ptrace.2, rename.2, semop.2, write.2, fcloseall.3, + getopt.3, inet.3, termios.3, ualarm.3, usleep.3, + feature_test_macros.7, termio.7, time.7: LDP v2.46 ÂбþÈÇ¥ê¥ê¡¼¥¹ + +Fri May 4 18:02:15 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12487] + * draft/man3/fcloseall.3: [JM:12487] + +Fri May 4 12:02:29 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12484] + * draft/man2/faccessat.2: [JM:12484] + +Fri May 4 12:02:27 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12491] + * draft/man2/mincore.2: [JM:12491] + +Fri May 4 12:02:26 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12490] + * draft/man7/bootparam.7: [JM:12490] + * release/man7/bootparam.7: [JM:12490] + +Fri May 4 12:02:25 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12489] + * draft/man2/mmap.2: [JM:12489] + +Fri May 4 12:02:24 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12488] + * draft/man2/rename.2: [JM:12488] + +Fri May 4 12:02:23 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12486] + * draft/man3/usleep.3: [JM:12486] + +Fri May 4 12:02:22 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12485] + * draft/man3/ualarm.3: [JM:12485] + +Fri May 4 12:02:21 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12483] + * draft/man7/time.7: [JM:12483] + +Fri May 4 12:02:18 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12482] + * draft/man7/termio.7: [JM:12482] + +Thu May 3 18:01:55 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12478] + * draft/man3/inet.3: [JM:12478] + +Thu May 3 18:01:54 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12477] + * draft/man3/getopt.3: [JM:12477] + +Thu May 3 18:01:54 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12476] + * draft/man3/basename.3: [JM:12476] + * release/man3/basename.3: [JM:12476] + +Thu May 3 18:01:53 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12475] + * draft/man2/write.2: [JM:12475] + +Thu May 3 18:01:52 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12474] + * draft/man2/semop.2: [JM:12474] + +Thu May 3 18:01:51 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12473] + * draft/man2/ptrace.2: [JM:12473] + +Thu May 3 18:01:50 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12472] + * draft/man2/open.2: [JM:12472] + +Thu May 3 18:01:49 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12471] + * draft/man2/mount.2: [JM:12471] + +Thu May 3 18:01:48 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12469] + * draft/man2/access.2: [JM:12469] + +Thu May 3 18:01:47 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12481] + * draft/man7/feature_test_macros.7: [JM:12481] + +Thu May 3 18:01:46 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12480] + * draft/man3/termios.3: [JM:12480] + +Thu May 3 18:01:44 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12479] + * draft/man3/isalpha.3: [JM:12479] + * release/man3/isalpha.3: [JM:12479] + +Thu May 3 18:01:43 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12470] + * draft/man2/clone.2: [JM:12470] + +Thu May 3 07:20:29 2007 Akihiro MOTOKI + + * draft/man3/popen.3, release/man3/popen.3: + [JM:12462] [JM:12463] ¤Ç¤Î»ØŦ¤òÈ¿±Ç¡£¤½¤Î¾¹»Àµ¤ò¾¯¤·¡£ + +Tue May 1 17:32:51 2007 Akihiro MOTOKI + + * original/: v2.46 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: º³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + +Tue May 1 07:13:52 2007 Akihiro MOTOKI + + * original/: v2.44 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: º³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + +Sat Feb 10 01:40:20 2007 Akihiro MOTOKI + + * linkat.2: v2.43 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Thu Feb 8 02:51:19 2007 Yuichi SATO + + * brk.2, faccessat.2, fork.2, + futex.2, posix_fadvise.2, rtc.4: v2.43 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sun Feb 4 12:21:21 2007 Akihiro MOTOKI + + * draft/man2/splice.2, draft/man2/vmsplice.2: + [JM:12451] [JM:12452] ¤Î±ó»³¤µ¤ó¤Î¥³¥á¥ó¥ÈÈ¿±Ç + * release/man2/splice.2, release/man2/tee.2, + release/man2/vmsplice.2: ¿·µ¬¥ê¥ê¡¼¥¹ + +Sun Jan 28 01:00:19 2007 Akihiro MOTOKI + + * release/man2/link.2, draft/man2/link.2: + dereference ¤ÎÌõ¤ò¡Ö»²¾È¤Îºï½ü¡×¤Ë½¤Àµ + +Sun Jan 28 00:02:19 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12449] + * draft/man2/vmsplice.2: [JM:12449] + +Sun Jan 28 00:02:17 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12448] + * draft/man2/tee.2: [JM:12448] + +Sun Jan 28 00:02:13 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12447] + * draft/man2/splice.2: [JM:12447] + +Sun Jan 21 06:02:23 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12445] + * draft/man2/linkat.2: [JM:12445] + +Sun Jan 21 05:24:26 2007 Akihiro MOTOKI + + * fchmodat.2, fchownat.2, fstatat.2, futimesat.2, mkdirat.2, + mknodat.2, openat.2, readlinkat.2, renameat.2, symlinkat.2, + unlinkat.2, mkfifoat.3: v2.39 -> v2.43 ¤Î editorical ¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: ¾åµ­¤òÈ¿±Ç + +Mon Jan 15 06:45:25 2007 Akihiro MOTOKI + + * clone.2, execve.2, getpagesize.2, ioperm.2, madvise.2, mmap.2, + mount.2, open.2, prctl.2, ptrace.2, set_mempolicy.2, vfork.2, + clog10.3, clog2.3, getnameinfo.3, qsort.3, termios.3, tzset.3, + core.5, proc.5, capabilities.7, ip.7, pthreads.7, raw.7, socket.7, + udp.7: LDP v2.43 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£±ó»³¤µ¤ó¤Î¥³¥á¥ó¥È¤òÈ¿±Ç¡£ + * ioprio_set.2, sync_file_range.2: ¿·µ¬¥ê¥ê¡¼¥¹ (LDP v2.43) + * translation_list: ¾åµ­È¿±Ç¡£ + +Sun Jan 14 23:39:15 2007 Kentaro Shirakata + + * getdtablesize.2, msync.2, crypt.3, getaddrinfo.3, + getcwd.3, syslog.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Mon Jan 8 18:01:46 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12422] + * draft/man2/sync_file_range.2: [JM:12422] + +Mon Jan 8 12:02:23 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12427] + * draft/man2/madvise.2: [JM:12427] + +Mon Jan 8 12:02:22 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12426] + * draft/man2/execve.2: [JM:12426] + +Mon Jan 8 12:02:22 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12425] + * draft/man2/prctl.2: [JM:12425] + +Mon Jan 8 12:02:21 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12424] + * draft/man2/vfork.2: [JM:12424] + +Mon Jan 8 12:02:19 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12423] + * draft/man2/ioprio_set.2: [JM:12423] + +Mon Jan 8 12:02:17 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12421] + * draft/man2/faccessat.2: [JM:12421] + +Mon Jan 8 06:14:21 2007 Akihiro MOTOKI + + * get_mempolicy.2, getrlimit.2, readv.2, umask.2, bcopy.3, + fexecve.3: ËÝÌõ»þ¤Î°õ (.\"O+, .\"O-) ¤¬»Ä¤Ã¤Æ¤¤¤¿¤Î¤Çºï½ü¡£ + * draft/man7/raw.7: ºï½ü¤â¤ìÉôʬ¤òºï½ü + +Mon Jan 8 06:02:21 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12420] + * draft/man4/rtc.4: [JM:12420] + +Sun Jan 7 18:02:16 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12406] + * draft/man2/getpagesize.2: [JM:12406] + +Sun Jan 7 12:02:27 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12415] + * draft/man2/set_mempolicy.2: [JM:12415] + +Sun Jan 7 12:02:27 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12414] + * draft/man3/clog10.3: [JM:12414] + +Sun Jan 7 12:02:26 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12413] + * draft/man3/clog2.3: [JM:12413] + +Sun Jan 7 12:02:25 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12412] + * draft/man3/getnameinfo.3: [JM:12412] + +Sun Jan 7 12:02:24 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12411] + * draft/man3/qsort.3: [JM:12411] + +Sun Jan 7 12:02:23 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12410] + * draft/man3/termios.3: [JM:12410] + +Sun Jan 7 12:02:22 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12409] + * draft/man3/tzset.3: [JM:12409] + +Sun Jan 7 12:02:21 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12408] + * draft/man2/ioperm.2: [JM:12408] + +Sun Jan 7 12:02:20 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12419] + * draft/man2/mmap.2: [JM:12419] + +Sun Jan 7 12:02:19 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12418] + * draft/man2/mount.2: [JM:12418] + +Sun Jan 7 12:02:18 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12417] + * draft/man2/open.2: [JM:12417] + +Sun Jan 7 12:02:17 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12416] + * draft/man2/ptrace.2: [JM:12416] + +Sun Jan 7 12:02:16 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12407] + * draft/man2/clone.2: [JM:12407] + +Sat Jan 6 06:02:04 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12396] + * draft/man5/proc.5: [JM:12396] + +Sat Jan 6 00:02:29 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12404] + * draft/man7/capabilities.7: [JM:12404] + +Sat Jan 6 00:02:28 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12403] + * draft/man7/udp.7: [JM:12403] + +Sat Jan 6 00:02:27 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12402] + * draft/man7/socket.7: [JM:12402] + +Sat Jan 6 00:02:26 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12401] + * draft/man7/raw.7: [JM:12401] + +Sat Jan 6 00:02:25 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12400] + * draft/man7/pthreads.7: [JM:12400] + +Sat Jan 6 00:02:24 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12399] + * draft/man7/ip.7: [JM:12399] + +Sat Jan 6 00:02:23 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12398] + * draft/man7/capabilities.7: [JM:12398] + +Sat Jan 6 00:02:21 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12397] + * draft/man5/core.5: [JM:12397] + +Fri Jan 5 06:02:34 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12394] + +Fri Jan 5 06:02:32 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12393] + * draft/man2/posix_fadvise.2: [JM:12393] + +Wed Jan 3 06:02:20 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12392] + * draft/man2/futex.2: [JM:12392] + +Wed Jan 3 06:02:18 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12391] + * draft/man2/fork.2: [JM:12391] + +Tue Jan 2 12:01:54 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12390] + * draft/man2/brk.2: [JM:12390] + +Tue Jan 2 06:02:31 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12389] + * draft/man3/syslog.3: [JM:12389] + +Tue Jan 2 06:02:30 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12388] + * draft/man3/getcwd.3: [JM:12388] + +Tue Jan 2 06:02:29 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12387] + * draft/man3/getaddrinfo.3: [JM:12387] + +Tue Jan 2 06:02:28 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12386] + * draft/man3/crypt.3: [JM:12386] + +Tue Jan 2 06:02:27 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12385] + * draft/man2/msync.2: [JM:12385] + +Tue Jan 2 06:02:26 JST 2007 JM ML to CVS Gateway + + * translation_list: [JM:12384] + * draft/man2/getdtablesize.2: [JM:12384] + +Sat Dec 30 00:11:28 2006 Akihiro MOTOKI + + * original/: v2.43 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: º³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + +Thu Dec 28 05:18:00 2006 Yuichi SATO + + * fstatat.2, fchmodat.2, fchownat.2, faccessat.2: + LDP v2.39 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Thu Dec 28 03:18:00 2006 Akihiro MOTOKI + + * inotify_add_watch.2, inotify_init.2, inotify_rm_watch.2, + set_mempolicy.2, get_mempolicy.2, mbind.2, standards.7: + LDP v2.39 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sat Oct 14 18:01:50 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12371] + * draft/man2/faccessat.2: [JM:12371] + +Sat Oct 14 12:11:52 2006 Yuichi SATO + + * openat.2 : ¡Ö¥Ç¥£¥¯¥¹¥¹¥¯¥ê¥×¥¿¡×->¡Ö¥Ç¥£¥¹¥¯¥ê¥×¥¿¡× + * posix_fallocate.3 : ¡Ö¥Ç¥£¥¯¥¹¥¹¥Ú¡¼¥¹¡×->¡Ö¥Ç¥£¥¹¥¯¥¹¥Ú¡¼¥¹¡× + +Sat Oct 14 12:02:20 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12368] + * draft/man2/fchmodat.2: [JM:12368] + +Sat Oct 14 06:02:21 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12364] + * draft/man2/fchownat.2: [JM:12364] + +Fri Oct 13 06:02:02 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12363] + * draft/man2/fstatat.2: [JM:12363] + +Fri Oct 13 01:25:23 2006 Yuichi SATO + + * futimesat.2, linkat.2, mkdirat.2, mknodat.2, + openat.2, readlinkat.2, renameat.2, symlinkat.2, + unlinkat.2: LDP v2.39 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¡£ + +Sat Sep 30 18:02:11 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12360] + * draft/man2/futimesat.2: [JM:12360] + +Sat Sep 30 12:02:17 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12359] + * draft/man2/linkat.2: [JM:12359] + +Sat Sep 30 06:02:30 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12358] + * draft/man2/mkdirat.2: [JM:12358] + +Sat Sep 30 06:02:26 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12356] + * draft/man2/mknodat.2: [JM:12356] + +Wed Sep 27 12:02:22 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12355] + * draft/man2/openat.2: [JM:12355] + +Wed Sep 27 06:01:51 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12354] + * draft/man2/readlinkat.2: [JM:12354] + +Tue Sep 5 06:02:35 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12352] + * draft/man2/renameat.2: [JM:12352] + +Tue Aug 29 12:01:59 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12351] + * draft/man2/symlinkat.2: [JM:12351] + +Thu Aug 24 06:02:24 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12350] + * draft/man2/unlinkat.2: [JM:12350] + +Sat Aug 19 09:53:00 2006 Yuichi SATO + + * inotify.7: LDP v2.36-v2.39 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¡£ + +Sat Aug 19 08:17:25 2006 Yuichi SATO + + * unshare.2, sockatmark.3, posix_fallocate.3, + mkfifoat.3, error.3, rtc.4, time.7: LDP v2.39 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç + +Wed Aug 16 12:02:35 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12348] + +Wed Aug 16 12:02:34 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12347] + +Wed Aug 16 12:02:31 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12346] + * draft/man2/inotify_rm_watch.2: [JM:12346] + +Wed Aug 16 12:02:28 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12344] + * draft/man2/inotify_init.2: [JM:12344] + +Wed Aug 16 12:02:25 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12345] + * draft/man2/inotify_add_watch.2: [JM:12345] + +Wed Aug 16 00:02:14 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12341] + * draft/man2/mbind.2: [JM:12341] + +Wed Aug 16 00:02:12 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12340] + * draft/man2/get_mempolicy.2: [JM:12340] + +Wed Aug 16 00:02:10 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12339] + * draft/man2/set_mempolicy.2: [JM:12339] + +Wed Aug 16 00:02:07 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12338] + * draft/man7/standards.7: [JM:12338] + +Mon Aug 14 22:28:05 JST 2006 Kentaro Shirakata + + * fsync.2, getitimer.2, console_codes.4: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sun Aug 13 06:01:45 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12335] + +Sun Aug 13 05:39:56 2006 Akihiro MOTOKI + + * nanosleep.2, errno.3: LDP v2.39 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * intro.2, execve.2, sched_setscheduler.2, capabilities.7: + v2.36->v2.39 ¤Î¹¹¿·È¿±Ç + +Sat Aug 12 22:32:14 2006 Akihiro MOTOKI + + * adjtimex.2, bind.2, capget.2, create_module.2, delete_module.2, + epoll_ctl.2, get_kernel_syms.2, gettimeofday.2, init_module.2, + mmap.2, mount.2, mq_getsetattr.2, poll.2, ptrace.2, + query_module.2, readlink.2, rmdir.2, sched_setaffinity.2, + select.2, select_tut.2, semget.2, sendfile.2, shmctl.2, shmget.2, + sigwaitinfo.2, stat.2, statfs.2, truncate.2, umask.2, utime.2, + adjtime.3, confstr.3, fexecve.3, fmemopen.3, fopen.3, ftw.3, + futimes.3, getline.3, mq_notify.3, offsetof.3, + program_invocation_name.3, rpmatch.3, strchr.3, strtod.3, + strtol.3, tempnam.3, termios.3, tmpnam.3, core.5, nscd.conf.5, + passwd.5, feature_test_macros.7, signal.7, tcp.7: + LDP v2.39 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * brk.2, chdir.2: v2.36->v2.39 ¤Î¹¹¿·È¿±Ç + +Fri Aug 11 01:49:09 2006 Akihiro MOTOKI + + * * original/: v2.39 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: 2.38->2.39 ¤ÎÊѹ¹ÅÀ¤òÈ¿±Ç + (½àµò¤¹¤ëµ¬³Ê¤Î½¤Àµ¤¬Ãæ¿´) + +Thu Aug 10 12:02:17 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12327] + * draft/man2/unshare.2: [JM:12327] + +Thu Aug 10 07:51:34 2006 Akihiro MOTOKI + + * original/: v2.38 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft, release: 2.36->2.38 ¤ÎÊѹ¹ÅÀ¤òÈ¿±Ç + (½àµò¤¹¤ëµ¬³Ê¤Î½¤Àµ¤¬Ãæ¿´) + +Wed Aug 9 12:01:51 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12326] + +Sat Aug 5 06:01:57 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12311] + +Fri Aug 4 12:02:13 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12310] + * draft/man3/error.3: [JM:12310] + +Fri Aug 4 06:02:27 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12309] + * draft/man3/mkfifoat.3: [JM:12309] + +Tue Aug 1 06:01:47 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12308] + * draft/man3/sockatmark.3: [JM:12308] + +Tue Aug 1 06:01:46 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12307] + +Mon Jul 31 12:02:22 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12302] + * draft/man3/futimes.3: [JM:12302] + +Mon Jul 31 12:02:20 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12300] + * draft/man3/rpmatch.3: [JM:12300] + +Mon Jul 31 12:02:18 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12299] + * draft/man2/get_kernel_syms.2: [JM:12299] + +Mon Jul 31 12:02:16 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12301] + * draft/man3/fexecve.3: [JM:12301] + +Mon Jul 31 12:02:13 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12297] + * draft/man3/mq_notify.3: [JM:12297] + +Sun Jul 30 06:02:10 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12296] + * draft/man2/mq_getsetattr.2: [JM:12296] + +Sun Jul 30 06:02:08 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12295] + * draft/man2/query_module.2: [JM:12295] + +Sun Jul 30 06:02:06 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12294] + * draft/man2/init_module.2: [JM:12294] + +Sun Jul 30 06:02:04 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12292] + * draft/man2/delete_module.2: [JM:12292] + +Sun Jul 30 06:02:02 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12293] + * draft/man2/create_module.2: [JM:12293] + +Sun Jul 30 06:02:01 JST 2006 JM ML to CVS Gateway + * translation_list: [JM:12291] + * draft/man7/signal.7: [JM:12291] + +Sun Jul 30 06:02:00 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12290] + * draft/man3/ftw.3: [JM:12290] + +Sun Jul 30 06:01:59 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12288] + * draft/man2/fsync.2: [JM:12288] + +Wed Jul 26 12:02:29 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12285] + * draft/man3/errno.3: [JM:12285] + +Wed Jul 26 12:02:28 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12282] + * draft/man3/tempnam.3: [JM:12282] + +Wed Jul 26 12:02:28 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12281] + * draft/man2/ptrace.2: [JM:12281] + +Wed Jul 26 12:02:27 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12284] + * draft/man3/termios.3: [JM:12284] + +Wed Jul 26 12:02:25 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12283] + * draft/man3/tmpnam.3: [JM:12283] + +Wed Jul 26 07:11:36 2006 Akihiro MOTOKI + + * fnmatch.3, initrd.4, sd.4, socket.7: + ËÝÌõ»þ¤Îºî¶ÈÌÜ°õ (.\"O+, .\"O-) ¤Îºï½üϳ¤ì¤òºï½ü¡£ + +Wed Jul 26 06:02:03 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12272] + * draft/man2/poll.2: [JM:12272] + +Wed Jul 26 06:02:02 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12270] + * draft/man2/capget.2: [JM:12270] + +Wed Jul 26 06:02:01 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12271] + * draft/man2/nanosleep.2: [JM:12271] + +Wed Jul 26 06:02:01 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12278] + * draft/man2/mount.2: [JM:12278] + +Wed Jul 26 06:02:00 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12277] + +Wed Jul 26 06:01:59 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12274] + * draft/man2/sched_setaffinity.2: [JM:12274] + +Wed Jul 26 06:01:58 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12276] + +Wed Jul 26 06:01:57 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12273] + * draft/man2/rmdir.2: [JM:12273] + +Wed Jul 26 06:01:56 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12280] + * draft/man2/select.2: [JM:12280] + +Wed Jul 26 06:01:55 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12279] + * draft/man2/select_tut.2: [JM:12279] + +Wed Jul 26 06:01:52 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12275] + * draft/man3/offsetof.3: [JM:12275] + +Mon Jul 24 12:02:38 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12262] + * draft/man2/utime.2: [JM:12262] + +Mon Jul 24 12:02:37 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12261] + * draft/man2/umask.2: [JM:12261] + +Mon Jul 24 12:02:35 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12260] + * draft/man2/truncate.2: [JM:12260] + +Mon Jul 24 12:02:34 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12259] + * draft/man2/statfs.2: [JM:12259] + +Mon Jul 24 12:02:33 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12258] + * draft/man2/stat.2: [JM:12258] + +Mon Jul 24 12:02:31 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12255] + * draft/man2/shmget.2: [JM:12255] + +Mon Jul 24 12:02:31 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12254] + * draft/man2/semget.2: [JM:12254] + +Mon Jul 24 12:02:30 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12256] + * draft/man2/shmctl.2: [JM:12256] + +Mon Jul 24 12:02:29 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12268] + * draft/man3/program_invocation_name.3: [JM:12268] + +Mon Jul 24 12:02:27 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12266] + * draft/man3/adjtime.3: [JM:12266] + +Mon Jul 24 12:02:26 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12265] + * draft/man2/mmap.2: [JM:12265] + +Mon Jul 24 12:02:25 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12264] + * draft/man2/gettimeofday.2: [JM:12264] + +Mon Jul 24 12:02:24 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12263] + * draft/man7/feature_test_macros.7: [JM:12263] + +Mon Jul 24 12:02:22 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12257] + * draft/man2/sigwaitinfo.2: [JM:12257] + +Mon Jul 24 00:02:30 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12253] + * draft/man2/getitimer.2: [JM:12253] + +Mon Jul 24 00:02:28 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12252] + * draft/man4/console_codes.4: [JM:12252] + +Sun Jul 23 06:01:54 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12251] + * draft/man7/time.7: [JM:12251] + +Fri Jul 21 06:02:02 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12249] + +Thu Jul 20 12:01:58 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12242] + * draft/man4/full.4: [JM:12242] + * release/man4/full.4: [JM:12242] + +Thu Jul 20 12:01:57 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12241] + * draft/man3/fopen.3: [JM:12241] + +Thu Jul 20 12:01:56 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12240] + * draft/man5/core.5: [JM:12240] + +Thu Jul 20 12:01:55 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12239] + * draft/man3/strchr.3: [JM:12239] + +Thu Jul 20 12:01:54 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12238] + * draft/man3/strtol.3: [JM:12238] + +Thu Jul 20 12:01:53 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12237] + * draft/man3/strtod.3: [JM:12237] + +Thu Jul 20 12:01:53 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12236] + * draft/man3/confstr.3: [JM:12236] + +Thu Jul 20 12:01:52 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12234] + * draft/man3/getline.3: [JM:12234] + +Thu Jul 20 12:01:51 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12248] + * draft/man3/printf.3: [JM:12248] + * release/man3/printf.3: [JM:12248] + +Thu Jul 20 12:01:50 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12247] + * draft/man3/scandir.3: [JM:12247] + * release/man3/scandir.3: [JM:12247] + +Thu Jul 20 12:01:49 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12246] + * draft/man3/difftime.3: [JM:12246] + * release/man3/difftime.3: [JM:12246] + +Thu Jul 20 12:01:48 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12245] + * draft/man3/strtoul.3: [JM:12245] + * release/man3/strtoul.3: [JM:12245] + +Thu Jul 20 12:01:47 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12244] + * draft/man7/capabilities.7: [JM:12244] + * release/man7/capabilities.7: [JM:12244] + +Thu Jul 20 12:01:46 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12243] + * draft/man7/mq_overview.7: [JM:12243] + * release/man7/mq_overview.7: [JM:12243] + +Thu Jul 20 12:01:44 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12235] + * draft/man3/fmemopen.3: [JM:12235] + +Thu Jul 20 06:02:37 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12233] + * draft/man7/inotify.7: [JM:12233] + +Thu Jul 20 06:02:36 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12231] + * draft/man2/epoll_ctl.2: [JM:12231] + +Thu Jul 20 06:02:35 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12230] + * draft/man5/nscd.conf.5: [JM:12230] + +Thu Jul 20 06:02:34 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12228] + * draft/man2/sendfile.2: [JM:12228] + +Thu Jul 20 06:02:34 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12229] + * draft/man2/readlink.2: [JM:12229] + +Thu Jul 20 06:02:33 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12227] + * draft/man2/bind.2: [JM:12227] + +Thu Jul 20 06:02:32 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12226] + * draft/man7/tcp.7: [JM:12226] + +Thu Jul 20 06:02:29 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12225] + * draft/man5/passwd.5: [JM:12225] + +Tue Jul 18 00:38:19 2006 Akihiro MOTOKI + + * original/: v2.36 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * chown.2, fdatasync.2, getrlimit.2, sigprocmask.2, cmsg.3, + ferror.3, getaddrinfo.3, intro.3, recno.3, scanf.3, sigset.3, + strftime.3, wavelan.4, proc.5, futex.7, ip.7, mailaddr.7: + v2.34->v2.36 ¤Î editorial ¤ÊÊѹ¹¤òÈ¿±Ç + * getmntent.3, getutent.3, re_comp.3, resolver.3: + v2.29->v2.34 ¤Îº³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + +Sun Jul 16 12:01:49 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12224] + * draft/man2/adjtimex.2: [JM:12224] + +Sun Jul 16 12:01:46 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12223] + * draft/man7/feature_test_macros.7: [JM:12223] + +Sun Jul 16 06:39:52 2006 Akihiro MOTOKI + + * fcntl.2, flock.2: v2.29->v2.34 ¤Îº³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: ¾åµ­È¿±Ç + +Fri Jul 14 08:09:21 2006 Akihiro MOTOKI + + * original/: v2.34 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * {draft,release}/*: v2.29->v2.34 ¤Î editorial ¤ÊÊѹ¹¤òÈ¿±Ç + * ¥»¥¯¥·¥ç¥ó°ÜÆ°: (sec4 to sec7) epoll.7, fifo.7, futex.7, + (sec5 to sec7) complex.7, environ.7, svipc.7 (from ipc.5). + +Thu Jul 13 06:02:22 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12221] + * draft/man3/posix_fallocate.3: [JM:12221] + +Thu Jul 13 03:47:47 2006 Akihiro MOTOKI + + * accept.2, fcntl.2, getrlimit.2, intro.2, mremap.2, open.2, + poll.2, recv.2, sched_setscheduler.2, select.2, send.2, shmop.2, + mq_close.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, + mq_unlink.3, sem_close.3, sem_destroy.3, sem_getvalue.3, + sem_init.3, sem_open.3, sem_post.3, sem_unlink.3, sem_wait.3, + tempnam.3, core.5, proc.5, capabilities.7, mq_overview.7, + sem_overview.7: v2.29 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Wed Jul 12 06:02:18 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12220] + * draft/man4/rtc.4: [JM:12220] + +Wed Jul 12 03:13:06 2006 Yuichi SATO + + * inotify.7, netlink.7 : v2.29 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Wed Jul 5 06:01:54 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12215] + * draft/man7/inotify.7: [JM:12215] + +Fri Jun 23 12:02:21 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12214] + * draft/man7/netlink.7: [JM:12214] + +Mon Apr 24 06:02:10 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12168] + * draft/man3/mq_getattr.3: [JM:12168] + +Mon Apr 24 06:02:09 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12167] + * draft/man3/mq_close.3: [JM:12167] + +Mon Apr 24 06:02:08 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12165] + * draft/man3/sem_unlink.3: [JM:12165] + +Mon Apr 24 06:02:07 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12164] + * draft/man3/sem_post.3: [JM:12164] + +Mon Apr 24 06:02:05 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12162] + * draft/man3/sem_init.3: [JM:12162] + +Mon Apr 24 06:02:03 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12161] + * draft/man3/sem_getvalue.3: [JM:12161] + +Mon Apr 24 06:02:01 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12160] + * draft/man3/sem_destroy.3: [JM:12160] + +Mon Apr 24 06:01:59 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12158] + * draft/man7/sem_overview.7: [JM:12158] + +Mon Apr 24 06:01:57 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12172] + * draft/man3/mq_send.3: [JM:12172] + +Mon Apr 24 06:01:55 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12159] + * draft/man3/sem_close.3: [JM:12159] + +Mon Apr 24 06:01:53 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12166] + * draft/man3/sem_wait.3: [JM:12166] + +Mon Apr 24 06:01:51 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12163] + * draft/man3/sem_open.3: [JM:12163] + +Mon Apr 24 06:01:50 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12173] + * draft/man3/mq_unlink.3: [JM:12173] + +Mon Apr 24 06:01:49 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12171] + * draft/man3/mq_receive.3: [JM:12171] + +Mon Apr 24 06:01:47 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12170] + * draft/man7/mq_overview.7: [JM:12170] + +Mon Apr 24 06:01:44 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12169] + * draft/man3/mq_open.3: [JM:12169] + +Mon Apr 24 06:01:43 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12157] + * draft/man2/poll.2: [JM:12157] + +Mon Apr 17 06:02:24 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12154] + * draft/man2/fcntl.2: [JM:12154] + +Mon Apr 17 06:02:23 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12153] + * draft/man2/sched_setscheduler.2: [JM:12153] + +Mon Apr 17 06:02:21 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12156] + * draft/man5/core.5: [JM:12156] + +Mon Apr 17 00:02:18 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12155] + * draft/man2/getrlimit.2: [JM:12155] + +Mon Apr 17 00:02:16 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12152] + * draft/man2/select.2: [JM:12152] + +Sun Apr 16 12:02:29 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12150] + * draft/man5/proc.5: [JM:12150] + +Sun Apr 16 12:02:29 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12149] + * draft/man2/intro.2: [JM:12149] + +Sun Apr 16 12:02:28 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12148] + * draft/man2/mremap.2: [JM:12148] + +Sun Apr 16 12:02:26 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12147] + * draft/man7/capabilities.7: [JM:12147] + +Sun Apr 16 06:01:29 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12140] + * draft/man2/unlink.2: [JM:12140] + * release/man2/unlink.2: [JM:12140] + +Sun Apr 16 06:01:27 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12141] + * draft/man2/recv.2: [JM:12141] + +Sat Apr 15 23:58:12 2006 Akihiro MOTOKI + + * ctermid.3, pthreads.7, packet.7: v2.25->v2.29 ¤ÎÊѹ¹È¿±Ç + * translation_list: ¾åµ­È¿±Ç + +Sun Apr 16 00:04:15 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12144] + * draft/man7/socket.7: [JM:12144] + * release/man7/socket.7: [JM:12144] + +Sun Apr 16 00:04:14 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12143] + * draft/man2/open.2: [JM:12143] + +Sun Apr 16 00:04:13 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12142] + * draft/man2/send.2: [JM:12142] + +Fri Apr 14 12:02:22 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12139] + * draft/man3/tempnam.3: [JM:12139] + +Fri Apr 14 12:02:21 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12138] + * draft/man2/sched_setparam.2: [JM:12138] + * release/man2/sched_setparam.2: [JM:12138] + +Fri Apr 14 12:02:20 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12137] + * draft/man2/sched_get_priority_max.2: [JM:12137] + * release/man2/sched_get_priority_max.2: [JM:12137] + +Fri Apr 14 12:02:19 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12136] + * draft/man7/ascii.7: [JM:12136] + * release/man7/ascii.7: [JM:12136] + +Fri Apr 14 12:02:18 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12135] + * draft/man2/shmop.2: [JM:12135] + +Fri Apr 14 12:02:17 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12134] + * draft/man2/accept.2: [JM:12134] + +Fri Apr 14 07:01:55 2006 Akihiro MOTOKI + + * epoll_ctl.2, getpeername.2, getsockname.2, ddp.7, hier.7, + icmp.7, ip.7, raw.7, rtnetlink.7, unix.7: v2.25->v2.29 ¤Î + editorial ¤ÊÊѹ¹¤òÈ¿±Ç + +Fri Apr 14 05:14:51 2006 Akihiro MOTOKI + + * draft/man2/clone.2, release/man2/clone2: ¹ÔƬ¤Ë + ¤¬»Ä¤Ã¤Æ + ¤¤¤¿¤Î¤Ç¡¢ºï½ü¡£ + +Fri Apr 14 04:42:12 2006 Akihiro MOTOKI + + * original/: 2.29 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * {draft,release}/*: v2.28->v2.29 ¤Î editorial ¤ÊÊѹ¹¤òÈ¿±Ç + +Fri Apr 14 03:17:31 2006 Akihiro MOTOKI + + * clone.2, lseek.2, msgop.2, fnmatch.3, proc.5: v2.25 ÂбþÈÇ¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­¤ËÂбþ¡£Ã¢¤· clone.2 ¤Ï original ¤Ï v2.25 -> + v2.28 ¤Ç¹¹¿·¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢¡ù ¥Þ¡¼¥¯¤ËÊѹ¹¡£ + +Sun Apr 2 04:40:38 2006 Akihiro MOTOKI + + * original/: 2.28 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * {draft,release}/*: v2.25->v2.28 ¤Î editorial ¤ÊÊѹ¹¤òÈ¿±Ç + +Sun Apr 2 04:37:30 2006 Akihiro MOTOKI + + * original/: 2.27 ¤Ë¹¹¿· + +Mon Mar 6 06:02:04 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12123] + * draft/man3/fnmatch.3: [JM:12123] + +Mon Mar 6 06:02:03 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12122] + * draft/man2/msgop.2: [JM:12122] + +Mon Mar 6 06:02:02 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12120] + * draft/man2/lseek.2: [JM:12120] + +Mon Mar 6 06:02:01 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12121] + * draft/man5/proc.5: [JM:12121] + +Mon Mar 6 06:01:59 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12119] + * draft/man2/clone.2: [JM:12119] + +Mon Mar 6 01:08:15 2006 Akihiro MOTOKI + + * original/: 2.25 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * {draft,release}/*: v2.23->v2.25 ¤Î editorial ¤ÊÊѹ¹¤òÈ¿±Ç + +Sun Mar 5 21:56:41 2006 Akihiro MOTOKI + + * clone.2, fcntl.2, mlock.2, mmap.2, open.2, getopt.3, openpty.3, + proc.5, locale.7: v2.23 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + +Fri Feb 17 19:25:01 2006 NAKANO Takeo + + * release,draft/man2/ptrace.2: fix description around PTRACE_KILL + & PTRACE_DETACH + +Wed Feb 15 06:01:51 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12115] + * draft/man5/proc.5: [JM:12115] + +Wed Feb 15 06:01:50 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12114] + * draft/man2/clone.2: [JM:12114] + +Wed Feb 15 06:01:49 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12113] + * draft/man2/fcntl.2: [JM:12113] + +Wed Feb 15 06:01:48 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12111] + * draft/man2/open.2: [JM:12111] + +Wed Feb 15 06:01:47 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12112] + * draft/man2/mlock.2: [JM:12112] + +Wed Feb 15 06:01:46 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12110] + * draft/man7/locale.7: [JM:12110] + +Wed Feb 15 03:30:57 2006 Akihiro MOTOKI + + * capget.2, kill.2, msgop.2, capabilities.7: v2.22->v2.23 ¤ÎÊѹ¹È¿±Ç + * translation_list: ¾åµ­È¿±Ç + +Tue Feb 14 00:02:04 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12109] + * draft/man3/openpty.3: [JM:12109] + +Tue Feb 14 00:02:03 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12108] + * draft/man3/getopt.3: [JM:12108] + +Tue Feb 14 00:02:01 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12107] + * draft/man2/mmap.2: [JM:12107] + +Mon Feb 13 07:13:55 2006 Akihiro MOTOKI + + * getrlimit.2, mmap.2, mount.2, mremap.2, path_resolution.2, + prctl.2, read.2, select.2, send.2, shmget.2, shmop.2, sigaction.2, + sysfs.2, write.2, fmemopen.3, getopt.3, localeconv.3, mkdtemp.3, + openpty.3, rtnetlink.3, scanf.3, setlocale.3, ipc.5, locale.5, + proc.5, ddp.7, ipv6.7, pthreads.7, tcp.7, udp.7, ldconfig.8: + v2.22->v2.23 ¤Ç¤Î editorial ¤ÊÊѹ¹¡¢Ã±½ã¤ÊÊѹ¹¤òÈ¿±Ç¡£ + +Mon Feb 13 03:00:49 2006 Akihiro MOTOKI + + * original/: 2.23 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + +Thu Feb 9 08:03:15 2006 Akihiro MOTOKI + + * original/: 2.22 ¤Ë¹¹¿· + * gethostname.2, ioperm.2, wait.2, inet.3, qsort.3, strtol.3, + strtoul.3, x25.7: v2.21->v2.22 ¤Îº³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: ¾åµ­È¿±Ç + +Thu Feb 9 06:51:01 2006 Akihiro MOTOKI + + * bind.2, capget.2, gethostname.2, mmap2.2, open.2, sigaltstack.2, + dlopen.3, fmemopen.3, fopen.3, fseeko.3, gethostbyname.3, + getopt.3, qsort.3, proc.5: v2.21 ÂбþÈǤò¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­¤òÈ¿±Ç + +Wed Feb 1 06:01:58 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12098] + * draft/man2/capget.2: [JM:12098] + +Wed Feb 1 06:01:57 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12097] + * draft/man2/gethostname.2: [JM:12097] + +Wed Feb 1 06:01:55 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12096] + * draft/man5/proc.5: [JM:12096] + +Mon Jan 30 00:02:15 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12094] + * draft/man3/dlopen.3: [JM:12094] + +Mon Jan 30 00:02:14 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12095] + * draft/man3/fmemopen.3: [JM:12095] + +Thu Jan 19 00:02:08 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12089] + * draft/man2/mmap2.2: [JM:12089] + +Thu Jan 19 00:02:07 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12088] + * draft/man2/open.2: [JM:12088] + +Thu Jan 19 00:02:06 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12087] + * draft/man3/getopt.3: [JM:12087] + +Thu Jan 19 00:02:05 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12086] + * draft/man3/qsort.3: [JM:12086] + +Thu Jan 19 00:02:05 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12085] + * draft/man3/gethostbyname.3: [JM:12085] + +Thu Jan 19 00:02:03 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12084] + * draft/man3/fseeko.3: [JM:12084] + +Wed Jan 18 01:38:38 2006 Akihiro MOTOKI + + * original/: 2.21 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * draft/*, release/*: ver2.20->2.21 ¤Î format ¾å¤ÎÊѹ¹¤òÈ¿±Ç + +Sat Jan 14 12:35:46 2006 Yuichi SATO + + * pipe.2, ipv6.7: ver2.20 ÂбþÈǤò¥ê¥ê¡¼¥¹ + * translation_list : ¾åµ­¤òÈ¿±Ç¡£ + +Thu Jan 12 02:44:49 2006 Akihiro MOTOKI + + * send.2, wait.2, fmemopen.3, inet.3, rexec.3, sigpause.3, + sigset.3, sigvec.3, strerror.3, pipe.7, socket.7, tcp.7, udp.7, + unix.7: ver2.20 ÂбþÈǤò¥ê¥ê¡¼¥¹ + * draft/man7/ipv6.7: ver2.19->2.20 ¤ÎÊѹ¹ÅÀ¤òÈ¿±Ç + +Tue Jan 10 18:02:15 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12078] + * draft/man2/sigaltstack.2: [JM:12078] + +Tue Jan 10 06:02:24 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12075] + * draft/man3/fopen.3: [JM:12075] + +Tue Jan 10 06:02:23 JST 2006 JM ML to CVS Gateway + + * translation_list: [JM:12076] + * draft/man2/bind.2: [JM:12076] + +Tue Jan 10 02:06:56 2006 Akihiro MOTOKI + + * getloadavg.3, strcpy.3, capabilities.7: ver2.18->ver2.20 ¤Î + Êѹ¹¤òÈ¿±Ç + +Mon Jan 9 00:31:16 2006 Akihiro MOTOKI + + * err.3, proc.5, arp.7, icmp.7, ip.7, netdevice.7, packet.7, + raw.7, rtnetlink.7: ver2.18->ver2.20 ¤Î format ¾å¤ÎÊѹ¹¤òÈ¿±Ç + +Sun Jan 8 22:59:42 2006 Akihiro MOTOKI + + * original/: 2.20 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + +Sun Jan 8 22:28:26 2006 Akihiro MOTOKI + + * original/: 2.19 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + +Wed Dec 28 18:02:10 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12058] + * draft/man3/rexec.3: [JM:12058] + +Tue Dec 27 18:02:07 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12057] + * draft/man7/pipe.7: [JM:12057] + +Tue Dec 27 18:02:04 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12056] + * draft/man3/fmemopen.3: [JM:12056] + +Tue Dec 27 01:51:29 2005 Akihiro MOTOKI + + * getaddrinfo.3: 2.16->2.17 ¤ÎÊѹ¹ (EAI_* ¤ÎÀ°Îó) ¤òÈ¿±Ç + * translation_list: ¾åµ­È¿±Ç + +Mon Dec 26 18:02:27 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12055] + * draft/man3/strerror.3: [JM:12055] + +Mon Dec 26 18:02:26 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12054] + * draft/man7/socket.7: [JM:12054] + +Mon Dec 26 18:02:25 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12053] + * draft/man2/bind.2: [JM:12053] + +Mon Dec 26 18:02:24 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12052] + * draft/man2/wait.2: [JM:12052] + +Mon Dec 26 18:02:23 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12051] + * draft/man7/unix.7: [JM:12051] + +Mon Dec 26 18:02:23 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12050] + * draft/man7/udp.7: [JM:12050] + +Mon Dec 26 18:02:21 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12049] + * draft/man7/tcp.7: [JM:12049] + +Mon Dec 26 06:02:32 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12048] + * draft/man2/send.2: [JM:12048] + +Mon Dec 26 06:02:30 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12047] + * draft/man3/inet.3: [JM:12047] + +Mon Dec 26 03:17:17 2005 Akihiro MOTOKI + + * original/: 2.18 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * recv.2, err.3, errno.3, gethostbyname.3, perror.3, resolver.3, + operator.7, raw.7: ver2.17->2.18 ¤Îº³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + +Sat Dec 17 12:02:07 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12035] + * draft/man7/ipv6.7: [JM:12035] + +Sat Dec 17 12:02:05 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12034] + * draft/man2/pipe.2: [JM:12034] + +Fri Dec 16 20:15:10 2005 Akihiro MOTOKI + + * original/: 2.17 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * fork.2, carg.3, getnameinfo.3, inet.3, fifo.4, environ.5, udp.7: + ver2.16->2.17 ¤Îº³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + +Tue Dec 13 06:02:28 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12032] + * draft/man3/sigvec.3: [JM:12032] + +Tue Dec 13 03:03:08 2005 Akihiro MOTOKI + + * kill.2, poll.2, shmop.2, sigpending.2, sigsetops.3, strftime.3, + intro.7, socket.7: ver2.16 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * arch_prctl.2, execve.2, stat.2, strtok.3: ±ó»³¤µ¤ó¤Î¥³¥á¥ó¥ÈÈ¿±Ç + ([JM:12026]¡Á[JM:12030]) + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Thu Dec 8 18:01:59 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12025] + * draft/man3/sigset.3: [JM:12025] + +Thu Dec 8 18:01:57 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12024] + * draft/man3/strftime.3: [JM:12024] + +Mon Dec 5 06:02:31 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12022] + +Mon Dec 5 06:02:30 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12021] + +Mon Dec 5 06:02:29 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12020] + * draft/man7/socket.7: [JM:12020] + +Mon Dec 5 06:02:28 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12019] + * draft/man3/sigsetops.3: [JM:12019] + +Mon Dec 5 06:02:27 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12018] + * draft/man7/intro.7: [JM:12018] + +Mon Dec 5 06:02:27 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12017] + * draft/man2/poll.2: [JM:12017] + +Mon Dec 5 06:02:26 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12016] + * draft/man2/shmop.2: [JM:12016] + +Mon Dec 5 06:02:25 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12015] + * draft/man2/kill.2: [JM:12015] + +Mon Dec 5 06:02:22 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12023] + * draft/man3/sigpause.3: [JM:12023] + +Mon Dec 5 06:02:21 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12014] + * draft/man2/sigpending.2: [JM:12014] + +Sun Dec 4 15:04:06 2005 Akihiro MOTOKI + + * mmap.2, sigaction.2, signal.2, errno.3, undocumented.3, ip.7, + packet.7, signal.7, udp.7: ver2.14->2.16 ¤Îº³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: ¾åµ­È¿±Ç + +Sun Dec 4 14:09:06 2005 Akihiro MOTOKI + + * original/: 2.16 ¤Ë¹¹¿· + * translation_list: ¾åµ­È¿±Ç + * sigblock.2, sigpause.2, sigvec.2: ver2.16 ¤Çºï½ü¤µ¤ì¤¿¤Î¤Ç + obsolete/man2 ¤Ë°ÜÆ° + * obsolete_list: ¾åµ­¤òÄɲà + +Sun Dec 4 13:36:06 2005 Akihiro MOTOKI + + * arch_prctl.2, execve.2, fcntl.2, open.2, stat.2, frexp.3, + strtok.3, proc.5: ver2.14 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sat Nov 19 12:02:18 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12012] + * draft/man5/proc.5: [JM:12012] + +Sat Nov 19 12:02:17 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12011] + * draft/man2/fcntl.2: [JM:12011] + +Sat Nov 19 12:02:16 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12010] + * draft/man2/stat.2: [JM:12010] + +Sat Nov 19 12:02:15 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12009] + * draft/man2/open.2: [JM:12009] + +Sat Nov 19 12:02:14 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12008] + * draft/man2/execve.2: [JM:12008] + +Sat Nov 19 12:02:14 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12007] + * draft/man2/arch_prctl.2: [JM:12007] + +Sat Nov 19 12:02:13 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12006] + * draft/man3/frexp.3: [JM:12006] + +Sat Nov 19 12:02:11 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12005] + * draft/man3/strtok.3: [JM:12005] + +Sat Nov 19 08:45:10 2005 Akihiro MOTOKI + + * syslog.2, exec.3, getpwnam.3, getspnam.3, tmpnam.3, LDP.7, + signal.7: ËÝÌõ»þ¤Îºî¶ÈÌÜ°õ (.\"O+, .\"O-) ¤Îºï½üϳ¤ì¤òºï½ü¡£ + +Sat Nov 19 04:25:42 2005 Akihiro MOTOKI + + * original/: 2.14 ¤Ë¹¹¿· + * mount.2, shmget.2, getpwent.3, malloc.3, posix_memalign.3, + putenv.3, sd.4, signal.7, socket.7, ld.so.8: + v2.13->v2.14 ¤Îº³ºÙ¤ÊÊѹ¹ÅÀÈ¿±Ç + * translation_list: ¾åµ­È¿±Ç + +Sun Nov 13 09:57:33 2005 Akihiro MOTOKI + + * getrlimit.2, mlock.2, path_resolution.2, setresuid.2, + shmget.2, sigaltstack.2, byteorder.3, ftw.3, capabilities.7: + LDP man-pages ver2.13 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + +Sat Nov 5 06:01:55 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:12000] + * draft/man3/ftw.3: [JM:12000] + +Fri Nov 4 18:02:19 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11997] + * draft/man7/capabilities.7: [JM:11997] + +Fri Nov 4 12:02:19 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11996] + * draft/man2/path_resolution.2: [JM:11996] + +Fri Nov 4 12:02:18 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11995] + * draft/man2/setresuid.2: [JM:11995] + +Fri Nov 4 12:02:17 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11994] + * draft/man2/shmget.2: [JM:11994] + +Fri Nov 4 12:02:17 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11993] + * draft/man2/sigaltstack.2: [JM:11993] + +Fri Nov 4 12:02:16 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11992] + * draft/man2/mlock.2: [JM:11992] + +Fri Nov 4 12:02:14 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11991] + * draft/man3/byteorder.3: [JM:11991] + +Fri Nov 4 07:11:55 2005 Akihiro MOTOKI + + * draft/man3/bcmp.3, draft/man3/bcopy.3, draft/man3/getpwent.3, + draft/man3/isalpha.3: BSD 4.x -> 4.xBSD. + * release/man3/bcmp.3, release/man3/bcopy.3, + release/man3/getpwent.3, release/man3/isalpha.3: ¥ê¥ê¡¼¥¹ÈǤˤâÈ¿±Ç¡£ + +Fri Nov 4 05:07:57 2005 Akihiro MOTOKI + + * original/: 2.13 ¤Ë¹¹¿· + * draft/, release/: v2.12->v2.13 ¤ÎÊѹ¹ÅÀÈ¿±Ç (format ¤ÎÊѹ¹¤Î¤ß) + * translation_list: ¾åµ­È¿±Ç + +Fri Nov 4 00:51:32 2005 Akihiro MOTOKI + + * original/: 2.12 ¤Ë¹¹¿· + * draft/, release/: v2.11->v2.12 ¤Îº³ºÙ¤ÊÊѹ¹ÅÀÈ¿±Ç + * translation_list: ¾åµ­È¿±Ç + +Thu Nov 3 04:35:42 2005 Yuichi SATO + + * mprotect.2, elf.5: v2.11 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sun Oct 30 03:22:18 JST 2005 Kentaro Shirakata + + * getitimer.2, mremap.2, outb.2, fopen.3, + getaddrinfo.3, inet.3, udp.7: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Fri Oct 28 06:02:20 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11983] + * draft/man3/getopt.3: [JM:11983] + * release/man3/getopt.3: [JM:11983] + +Fri Oct 28 00:02:00 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11982] + * draft/man2/path_resolution.2: [JM:11982] + +Fri Oct 28 00:01:58 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11981] + * draft/man2/getrlimit.2: [JM:11981] + +Thu Oct 27 23:49:44 2005 Akihiro MOTOKI + + * draft/man3/wcsspn.3, draft/man3/wcstok.3: ³µÍ×ÀâÌÀ (.SH ̾Á°" + ¤Î¾Ï) ¤¬ÆüËܸì¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¤¿¤á¡¢½¤Àµ¡£ + * releaseman3/wcsspn.3, release/man3/wcstok.3: ¾åµ­¤ÎÊѹ¹¤òÈ¿±Ç¡£ + +Thu Oct 27 21:28:54 2005 Akihiro MOTOKI + + * original/: 2.11 ¤Ë¹¹¿· + * draft/, release/: v2.10->v2.11 ¤Îº³ºÙ¤ÊÊѹ¹ÅÀÈ¿±Ç + * translation_list: ¾åµ­È¿±Ç + +Wed Oct 26 01:13:25 2005 Akihiro MOTOKI + + * Many pages: v2.09->v2.10 ¤ÎÊѹ¹ÅÀ (¤Û¤È¤ó¤É¤Ï´Ø¿ô̾¤Î + ¸å¤í¤Ø¤Î () ¤ÎÄɲÃ) ¤òÈ¿±Ç¡£ + * draft/man3/ulimit.3, draft/man4/fd.4, draft/man4/intro.4, + draft/man4/lp.4, draft/man4/mouse.4, draft/man4/wavelan.4, + draft/man5/intro.5, draft/man5/ttytype.5, draft/man6/intro.6: + release ¤À¤±¤¬Â¸ºß¤· draft ¤¬¤Ê¤¤¥Ú¡¼¥¸¤ò¡¢release ¤«¤é¥³¥Ô¡¼¡£ + +Tue Oct 25 21:23:22 2005 Akihiro MOTOKI + + * original/: 2.10 ¤Ë¹¹¿· (translation_list ¤Î¹¹¿·¤Ï¤Þ¤À) + +Sun Oct 23 03:13:27 2005 Akihiro MOTOKI + + * fcntl.2, getpriority.2, getrlimit.2, msgctl.2, nice.2, open.2, + poll.2, prctl.2, readv.2, remap_file_pages.2, sched_setparam.2, + sched_setscheduler.2, semctl.2, shmctl.2, stat.2, getpwnam.3, + initrd.4, read.2, write.2, proc.5, pty.7, socket.7: + v2.09 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sat Oct 22 03:46:04 JST 2005 Akihiro MOTOKI + + * draft/man2/fcntl.2: [JM:11970] ¤Ç»ØŦ¤ÎÌõ¤Î±Ì¤ì¤òÄɲᣠ+ +Sun Oct 16 03:33:21 JST 2005 Akihiro MOTOKI + + * release/man2/{cacheflush.2, connect.2, mmap.2, sigaction.2, + sigpending.2, sigprocmask.2, sigsuspend.2}, release/man5/utmp.5, + release/man7/capabilities.7, release/man7/ip.7: v2.09 ÂбþÈǤò + ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sun Oct 16 03:19:00 JST 2005 Akihiro MOTOKI + + * draft/man2/mprotect.2: [JM:11964] ¤Ç [JM:11962] (º´Æ£¤µ¤ó)¤ÎÅê¹Æ + ¤ò¾å½ñ¤­¤·¤Æ¤·¤Þ¤Ã¤¿¤Î¤Ç¡¢½¤Àµ¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sat Oct 15 06:02:38 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11971] + * draft/man2/mremap.2: [JM:11971] + +Sat Oct 15 06:02:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11969] + * draft/man5/proc.5: [JM:11969] + +Sat Oct 15 06:02:36 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11968] + * draft/man7/socket.7: [JM:11968] + +Sat Oct 15 06:02:35 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11967] + * draft/man2/open.2: [JM:11967] + +Sat Oct 15 06:02:34 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11966] + * draft/man2/write.2: [JM:11966] + +Sat Oct 15 06:02:33 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11965] + * draft/man2/read.2: [JM:11965] + +Sat Oct 15 06:02:32 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11964] + * draft/man2/mprotect.2: [JM:11964] + +Sat Oct 15 06:02:31 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11963] + * draft/man2/fcntl.2: [JM:11963] + +Sat Oct 15 06:02:30 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11972] + * draft/man3/fopen.3: [JM:11972] + +Sat Oct 15 06:02:29 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11962] + * draft/man2/mprotect.2: [JM:11962] + +Sat Oct 15 00:02:15 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11950] + * draft/man7/pty.7: [JM:11950] + +Fri Oct 14 03:27:23 JST 2005 Akihiro MOTOKI + + * draft,release: 2.08->2.09 ¤Î editorial ¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: ¾åµ­¤òÈ¿±Ç + +Fri Oct 14 02:41:49 JST 2005 Akihiro MOTOKI + + * original/: 2.09 ¤Ë¹¹¿· + * translation_list: ¾åµ­¤òÈ¿±Ç + +Wed Oct 12 06:02:23 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11945] + * draft/man2/getrlimit.2: [JM:11945] + +Tue Oct 11 12:02:28 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11944] + * draft/man2/semctl.2: [JM:11944] + +Tue Oct 11 12:02:27 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11943] + * draft/man2/msgctl.2: [JM:11943] + +Tue Oct 11 12:02:26 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11942] + * draft/man2/sched_setscheduler.2: [JM:11942] + +Tue Oct 11 08:07:59 2005 Akihiro MOTOKI + + * translation_list (proc.5): draft ¤ÎÂбþ version ¤ò 2.07 ¤Ë½¤Àµ + +Tue Oct 11 08:06:47 2005 Akihiro MOTOKI + + * {draft,release}/man3/rpc.3: 2.07->2.08 ¤Î editorial ¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list (rpc.3): ¾åµ­¤òÈ¿±Ç + +Tue Oct 11 02:09:22 JST 2005 Akihiro MOTOKI + + * draft/man2/sched_setparam.2: [JM:11935] ¸íµ­½¤Àµ + +Mon Oct 10 18:01:52 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11937] + * draft/man2/outb.2: [JM:11937] + +Mon Oct 10 06:02:08 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11934] + +Mon Oct 10 06:02:07 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11933] + +Mon Oct 10 06:02:06 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11932] + +Mon Oct 10 06:02:05 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11930] + * draft/man2/sched_setparam.2: [JM:11930] + +Mon Oct 10 06:02:04 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11929] + * draft/man2/remap_file_pages.2: [JM:11929] + +Mon Oct 10 06:02:03 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11931] + * draft/man2/poll.2: [JM:11931] + +Mon Oct 10 06:02:03 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11928] + * draft/man5/proc.5: [JM:11928] + +Mon Oct 10 06:02:02 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11927] + * draft/man4/initrd.4: [JM:11927] + +Mon Oct 10 06:01:59 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11926] + * draft/man3/getpwnam.3: [JM:11926] + +Mon Oct 10 00:02:24 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11924] + +Sun Oct 9 18:12:07 JST 2005 Akihiro MOTOKI + + * draft/man2/signal.2, draft/man3/system.3, draft/man7/posixoptions.7: + WORD ¥ê¥¹¥È¤Ë "feature test macro = µ¡Ç½¸¡ºº¥Þ¥¯¥í" ¤òÄɲᣠ+ * draft/man2/signal.2: feature test macro ¤ÎÌõ¤òÊѹ¹ (ÆÃÀ­¥Æ¥¹¥È + ¥Þ¥¯¥í ¢ª ¤Êµ¡Ç½¸¡ºº¥Þ¥¯¥í)¡£ + * release/man2/signal.2, release/man3/system.3, + release/man7/posixoptions.7: ¾åµ­¤ÎÊѹ¹¤ò release ÈǤˤâÈ¿±Ç¡£ + +Sun Oct 9 18:11:27 JST 2005 Akihiro MOTOKI + + * draft/man2/getpriority.2: [JM:11908] BSD 4.2 -> 4.2BSD + +Sun Oct 9 18:02:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11921] + * draft/man2/shmctl.2: [JM:11921] + +Sun Oct 9 18:02:38 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11922] + * draft/man2/stat.2: [JM:11922] + +Sun Oct 9 06:01:57 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11912] + * draft/man3/getaddrinfo.3: [JM:11912] + +Sun Oct 9 06:01:56 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11911] + * draft/man7/udp.7: [JM:11911] + +Sun Oct 9 06:01:56 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11910] + * draft/man2/outb.2: [JM:11910] + +Sun Oct 9 06:01:54 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11909] + * draft/man2/mremap.2: [JM:11909] + +Sat Oct 8 18:02:14 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11907] + * draft/man2/readv.2: [JM:11907] + +Sat Oct 8 18:02:13 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11906] + * draft/man2/getpriority.2: [JM:11906] + +Sat Oct 8 18:02:12 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11905] + * draft/man2/nice.2: [JM:11905] + +Sat Oct 8 18:02:10 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11904] + * draft/man2/prctl.2: [JM:11904] + +Sat Oct 8 00:02:17 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11903] + * draft/man3/scanf.3: [JM:11903] + * release/man3/scanf.3: [JM:11903] + +Sat Oct 8 00:02:16 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11902] + * draft/man2/open.2: [JM:11902] + * release/man2/open.2: [JM:11902] + +Sat Oct 8 00:02:14 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11901] + * draft/man2/sched_setaffinity.2: [JM:11901] + * release/man2/sched_setaffinity.2: [JM:11901] + +Fri Oct 7 06:02:07 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11900] + * draft/man5/utmp.5: [JM:11900] + +Fri Oct 7 06:02:05 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11899] + * draft/man7/ip.7: [JM:11899] + +Thu Oct 6 00:03:33 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11898] + * draft/man7/capabilities.7: [JM:11898] + +Thu Oct 6 00:03:32 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11897] + * draft/man2/mmap.2: [JM:11897] + +Thu Oct 6 00:03:31 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11896] + * draft/man7/socket.7: [JM:11896] + +Thu Oct 6 00:03:30 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11895] + * draft/man2/connect.2: [JM:11895] + +Thu Oct 6 00:03:29 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11894] + * draft/man2/sigaction.2: [JM:11894] + +Thu Oct 6 00:03:28 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11893] + * draft/man2/sigsuspend.2: [JM:11893] + +Thu Oct 6 00:03:27 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11892] + * draft/man2/cacheflush.2: [JM:11892] + +Thu Oct 6 00:03:26 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11891] + * draft/man2/sigprocmask.2: [JM:11891] + +Thu Oct 6 00:03:21 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11890] + * draft/man2/sigpending.2: [JM:11890] + +Tue Oct 4 06:02:22 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11889] + * draft/man3/inet.3: [JM:11889] + +Sun Oct 2 13:10:29 2005 Akihiro MOTOKI + + * 2.07->2.08 ¤Î editorial ¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: ¾åµ­¤òÈ¿±Ç + * translation_list: v2.08 ¤Ç sigpending.3, sigprocmask.3, + sigsuspend.3 ¤¬¥ê¥ó¥¯¥Ú¡¼¥¸¤«¤é¼ÂÂΤΤ¢¤ë¥Ú¡¼¥¸¤ËÊѹ¹¤Ë¤Ê¤Ã¤¿¡£ + +Sun Oct 2 09:44:02 JST 2005 Akihiro MOTOKI + + * draft/man3/scanf.3: [JM:11882] ±ó»³¤µ¤ó¤Î¥³¥á¥ó¥ÈÈ¿±Ç¡£ + +Sun Oct 2 09:39:37 JST 2005 Akihiro MOTOKI + + * original/: 2.08 ¤Ë¹¹¿· + * translation_list: ¾åµ­¤òÈ¿±Ç + +Mon Sep 19 00:02:12 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11880] + * draft/man3/scanf.3: [JM:11880] + +Wed Sep 14 19:53:06 JST 2005 Akihiro MOTOKI + + * release/{accept.2, clone.2, connect.2, dup.2, fcntl.2, shmctl.2, hosts.5, + ip.7, pthreads.7, tcp.7}: v2.07 ÂбþÈǤò¥ê¥ê¡¼¥¹ + * draft/{fcntl.2, pthreads.7, tcp.7}: ML ¤Ç¤Î±ó»³¤µ¤ó¤Î»ØŦ¤ò½¤Àµ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Wed Sep 14 18:01:55 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11875] + * draft/man5/proc.5: [JM:11875] + +Wed Sep 14 18:01:53 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11876] + +Wed Sep 14 06:02:26 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11873] + * draft/man2/open.2: [JM:11873] + +Wed Sep 14 06:02:25 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11872] + * draft/man2/sched_setaffinity.2: [JM:11872] + +Wed Sep 14 00:02:14 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11870] + +Wed Sep 14 00:02:13 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11871] + +Tue Sep 13 01:01:57 JST 2005 Akihiro MOTOKI + + * epoll_ctl.2, execve.2, flock.2, fsync.2, getrusage.2, mknod.2, + mmap.2, mount.2, nice.2, prctl.2, read.2, semop.2, setresuid.2, + sigreturn.2, stat.2, syslog.2, truncate.2, umask.2, atexit.3, + canonicalize_file_name.3, confstr.3, errno.3, exit.3, + fpclassify.3, getgrent.3, getgrnam.3, getpwent.3, getpwnam.3, + gets.3, getspnam.3, log2.3, readdir.3, realpath.3, shm_open.3, + stdin.3: v2.07 ÂбþÈǤò¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sun Sep 11 18:02:17 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11863] + * draft/man7/tcp.7: [JM:11863] + +Sun Sep 11 18:02:15 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11862] + * draft/man7/pthreads.7: [JM:11862] + +Sun Sep 11 06:02:24 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11861] + * draft/man2/fcntl.2: [JM:11861] + +Sun Sep 11 06:02:23 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11860] + * draft/man2/clone.2: [JM:11860] + +Sun Sep 11 06:02:21 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11859] + * draft/man2/getitimer.2: [JM:11859] + +Sat Sep 10 06:02:27 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11855] + * draft/man2/getrlimit.2: [JM:11855] + +Sat Sep 10 06:02:26 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11854] + * draft/man5/elf.5: [JM:11854] + +Sat Sep 10 03:39:23 JST 2005 Akihiro MOTOKI + + * draft/man2/{mknod.2, shmctl.2, stat.2, umask.2}, + draft/man3/{getspname.3, realpath.3, stdin.3}, draft/man5/hosts.5, + draft/man7/ip.7: ML ¤Ç¤Î±ó»³¤µ¤ó¤Î¥³¥á¥ó¥È¤òÈ¿±Ç¡£ + +Thu Sep 8 00:02:21 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11848] + * draft/man2/accept.2: [JM:11848] + +Thu Sep 8 00:02:20 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11847] + * draft/man2/connect.2: [JM:11847] + +Thu Sep 8 00:02:18 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11849] + * draft/man2/dup.2: [JM:11849] + +Wed Sep 7 12:02:10 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11838] + +Wed Sep 7 06:01:57 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11837] + * draft/man2/shmctl.2: [JM:11837] + +Wed Sep 7 00:02:48 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11812] + * draft/man3/log2.3: [JM:11812] + +Wed Sep 7 00:02:48 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11813] + * draft/man3/getgrent.3: [JM:11813] + +Wed Sep 7 00:02:47 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11811] + * draft/man3/getgrnam.3: [JM:11811] + +Wed Sep 7 00:02:45 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11810] + * draft/man3/getpwent.3: [JM:11810] + +Wed Sep 7 00:02:44 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11809] + * draft/man3/readdir.3: [JM:11809] + +Wed Sep 7 00:02:43 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11808] + * draft/man3/realpath.3: [JM:11808] + +Wed Sep 7 00:02:42 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11836] + * draft/man7/ip.7: [JM:11836] + +Wed Sep 7 00:02:41 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11835] + * draft/man5/hosts.5: [JM:11835] + +Wed Sep 7 00:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11834] + +Wed Sep 7 00:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11807] + * draft/man3/confstr.3: [JM:11807] + +Wed Sep 7 00:02:38 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11833] + * draft/man3/canonicalize_file_name.3: [JM:11833] + +Wed Sep 7 00:02:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11832] + * draft/man2/stat.2: [JM:11832] + +Wed Sep 7 00:02:36 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11831] + * draft/man2/syslog.2: [JM:11831] + +Wed Sep 7 00:02:35 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11830] + * draft/man2/truncate.2: [JM:11830] + +Wed Sep 7 00:02:35 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11829] + * draft/man2/mount.2: [JM:11829] + +Wed Sep 7 00:02:34 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11827] + * draft/man2/mmap.2: [JM:11827] + +Wed Sep 7 00:02:33 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11828] + * draft/man2/flock.2: [JM:11828] + +Wed Sep 7 00:02:32 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11826] + * draft/man2/read.2: [JM:11826] + +Wed Sep 7 00:02:31 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11825] + * draft/man2/nice.2: [JM:11825] + +Wed Sep 7 00:02:30 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11824] + * draft/man2/semop.2: [JM:11824] + +Wed Sep 7 00:02:29 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11806] + * draft/man3/exit.3: [JM:11806] + +Wed Sep 7 00:02:29 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11823] + * draft/man2/mknod.2: [JM:11823] + +Wed Sep 7 00:02:27 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11820] + * draft/man2/fsync.2: [JM:11820] + +Wed Sep 7 00:02:26 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11822] + * draft/man2/getrusage.2: [JM:11822] + +Wed Sep 7 00:02:26 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11821] + * draft/man2/prctl.2: [JM:11821] + +Wed Sep 7 00:02:25 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11819] + * draft/man3/getspnam.3: [JM:11819] + +Wed Sep 7 00:02:23 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11818] + * draft/man2/sigreturn.2: [JM:11818] + +Wed Sep 7 00:02:22 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11817] + * draft/man2/execve.2: [JM:11817] + +Wed Sep 7 00:02:22 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11816] + * draft/man2/epoll_ctl.2: [JM:11816] + +Wed Sep 7 00:02:19 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11815] + * draft/man2/umask.2: [JM:11815] + +Wed Sep 7 00:02:18 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11814] + * draft/man3/getpwnam.3: [JM:11814] + +Wed Sep 7 00:02:17 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11805] + * draft/man3/gets.3: [JM:11805] + +Tue Sep 6 00:02:06 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11804] + * draft/man2/setresuid.2: [JM:11804] + +Tue Sep 6 00:02:05 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11803] + * draft/man3/shm_open.3: [JM:11803] + +Tue Sep 6 00:02:04 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11802] + * draft/man3/errno.3: [JM:11802] + +Tue Sep 6 00:02:03 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11801] + * draft/man3/fpclassify.3: [JM:11801] + +Tue Sep 6 00:02:02 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11800] + * draft/man3/atexit.3: [JM:11800] + +Tue Sep 6 00:02:00 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11799] + * draft/man3/stdin.3: [JM:11799] + +Sat Sep 3 06:42:30 JST 2005 Akihiro MOTOKI + + * 2.02->2.07 ¤Î editorial ¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: ¾åµ­¤òÈ¿±Ç + +Thu Sep 1 23:01:50 JST 2005 Akihiro MOTOKI + + * original/: updated to 2.07 + * translation_list: modified as such. + * obsolete_list, obsolete/man2/sstk.2: original ¤«¤é + ºï½ü¤µ¤ì¤¿¤Î¤Ç¡¢obsolete ¤Ë°ÜÆ° + +Wed Aug 31 00:03:02 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11794] + * draft/man3/getaddrinfo.3: [JM:11794] + * release/man3/getaddrinfo.3: [JM:11794] + +Sun Aug 29 00:12:15 JST 2005 Akihiro MOTOKI + + * fcntl.2, semop.2, sendfile.2, uselib.2, strftime.3, man.7: + v2.02 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sun Aug 28 00:02:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11791] + * draft/man2/clone.2: [JM:11791] + * release/man2/clone.2: [JM:11791] + +Sun Jun 12 20:16:03 JST 2005 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man4/st.4: [LOCAL] + * release/man4/st.4: [LOCAL] + +Thu May 12 00:51:19 2005 Yuichi SATO + + * epoll_create.2, epoll_ctl.2, epoll_wait.2, link.2, mincore.2, + posix_fadvise.2, rename.2, random.4: v2.02 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sat May 7 04:52:41 JST 2005 Kentaro Shirakata + + * getitimer.2, times.2, strstr.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sun Apr 24 18:02:23 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11669] + * draft/man4/st.4: [JM:11669] + +Sat Apr 23 12:02:32 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11668] + * draft/man2/getitimer.2: [JM:11668] + +Sat Apr 23 06:02:22 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11667] + * draft/man2/fcntl.2: [JM:11667] + +Fri Apr 22 06:02:09 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11666] + * draft/man4/random.4: [JM:11666] + +Fri Apr 22 06:02:08 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11665] + * draft/man2/rename.2: [JM:11665] + +Fri Apr 22 06:02:08 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11664] + * draft/man2/posix_fadvise.2: [JM:11664] + +Fri Apr 22 06:02:07 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11663] + * draft/man2/mincore.2: [JM:11663] + +Fri Apr 22 06:02:05 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11662] + * draft/man2/link.2: [JM:11662] + +Thu Apr 21 06:02:36 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11660] + * draft/man2/semop.2: [JM:11660] + +Thu Apr 21 06:02:34 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11661] + * draft/man2/uselib.2: [JM:11661] + +Wed Apr 20 12:02:34 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11659] + * draft/man3/strstr.3: [JM:11659] + +Wed Apr 20 12:02:32 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11658] + * draft/man2/times.2: [JM:11658] + +Wed Apr 20 06:02:04 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11657] + * draft/man2/epoll_ctl.2: [JM:11657] + +Wed Apr 20 06:02:03 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11656] + * draft/man2/clone.2: [JM:11656] + +Wed Apr 20 06:02:02 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11655] + * draft/man2/sendfile.2: [JM:11655] + +Wed Apr 20 06:02:02 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11653] + * draft/man3/strftime.3: [JM:11653] + +Wed Apr 20 06:02:00 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11654] + * draft/man7/man.7: [JM:11654] + +Wed Apr 20 00:52:47 JST 2005 Akihiro MOTOKI + + * shmop.2: 2.01->2.02 ¤Î editorial ¤ÊÊѹ¹¤òÈ¿±Ç + +Tue Apr 19 12:02:24 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11651] + * draft/man2/epoll_wait.2: [JM:11651] + +Tue Apr 19 12:02:22 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11650] + * draft/man2/epoll_create.2: [JM:11650] + +Sat Apr 16 04:31:05 JST 2005 Akihiro MOTOKI + + * kill.2, personality.2, pipe.2, bcopy.3, ctime.3, memcpy.3, + tzfile.5, boot.7, tzselect.8, zdump.8, zic.8: + Original 2.01->2.02 ¤Î editorial ¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: modified as such. + +Sat Apr 16 04:04:58 JST 2005 Akihiro MOTOKI + + * original/ updated to 2.02 + * translation_list: modified as such. + +Thu Apr 14 16:22:10 JST 2005 Kentaro Shirakata + + * mkdir.2, mlock.2, outb.2: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Wed Apr 13 00:02:02 2005 Yuichi SATO + + * {draft,release}/man4/console_codes.4, + release/man4/mouse.4: ¡ÖÉä¹ç¡×¤ò¡ÖÉä¹æ¡×¤Ë½¤Àµ¡£ + +Tue Apr 5 06:02:30 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11639] + * draft/man2/syscalls.2: [JM:11639] + * release/man2/syscalls.2: [JM:11639] + +Sun Apr 3 06:01:45 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11638] + * draft/man2/fcntl.2: [JM:11638] + * release/man2/fcntl.2: [JM:11638] + +Fri Apr 1 12:02:48 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11634] + * draft/man2/select.2: [JM:11634] + * release/man2/select.2: [JM:11634] + +Thu Mar 31 06:01:52 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11633] + * draft/man3/sysconf.3: [JM:11633] + * release/man3/sysconf.3: [JM:11633] + +Thu Mar 31 06:01:51 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11632] + * draft/man2/select_tut.2: [JM:11632] + * release/man2/select_tut.2: [JM:11632] + +Thu Mar 31 00:28:49 JST 2005 Akihiro MOTOKI + + * man2/recv.2, man2/send.2, man2/sendfile.2, man2/sigaction.2, + man2/wait.2, man3/dlopen.3, man3/getlogin.3, man3/getmntent.3, + man3/getutent.3, man3/malloc.3, man3/perror.3, man3/printf.3, + man3/rand.3, man3/sysconf.3, man7/capabilities.7: + ver2.01 ÂбþÈÇ¥ê¥ê¡¼¥¹ + +Wed Mar 30 00:02:47 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11625] + * draft/man2/mlock.2: [JM:11625] + +Fri Mar 25 06:02:35 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11616] + * draft/man2/fcntl.2: [JM:11616] + +Thu Mar 24 06:01:34 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11613] + * draft/man2/outb.2: [JM:11613] + +Thu Mar 24 06:01:32 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11612] + * draft/man2/mkdir.2: [JM:11612] + +Thu Mar 24 03:18:44 JST 2005 Kentaro Shirakata + + * obsolete/man2/mlockall.2, obsolete/man2/munlock.2, + obsolete/man2/munlockall.2, obsolete/man3/isinf.3: + ¸Å¤¯¤Ê¤Ã¤¿¥Ú¡¼¥¸¤òÅÐÏ¿¡£ + * obsolete_list: ¾åµ­È¿±Ç¡£ + +Tue Mar 22 04:47:43 2005 Akihiro MOTOKI + + * draft/man2/mkdir.2: draft ¤ò 2.01ÈǤËÂбþ + +Tue Mar 22 00:02:44 2005 Akihiro MOTOKI + + * draft/man2/send.2, draft/man2/recv.2, draft/man2/sendfile.2, + draft/man3/tmpnam.3, draft/man7/capabilities.7: + [JM:11598¡Á11602] ¤Î»ØŦ¤òÈ¿±Ç (typo fix ¤ÈºÙ¤«¤Êɽ¸½¤Î½¤Àµ) + +Mon Mar 21 00:02:27 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11595] + * draft/man3/printf.3: [JM:11595] + +Mon Mar 21 00:02:26 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11594] + * draft/man2/wait.2: [JM:11594] + +Sat Mar 19 06:02:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11593] + * draft/man3/getlogin.3: [JM:11593] + +Sat Mar 19 06:02:36 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11592] + * draft/man3/getmntent.3: [JM:11592] + +Sat Mar 19 06:02:35 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11591] + * draft/man2/sigaction.2: [JM:11591] + +Sat Mar 19 06:02:34 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11590] + * draft/man3/getutent.3: [JM:11590] + +Fri Mar 18 06:02:15 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11589] + * draft/man3/dlopen.3: [JM:11589] + +Fri Mar 18 06:02:14 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11588] + * draft/man2/select.2: [JM:11588] + +Fri Mar 18 06:02:14 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11587] + * draft/man2/select_tut.2: [JM:11587] + +Fri Mar 18 06:02:12 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11586] + * draft/man3/sysconf.3: [JM:11586] + +Wed Mar 16 06:01:57 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11585] + +Wed Mar 16 06:01:56 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11584] + +Wed Mar 16 06:01:56 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11583] + +Wed Mar 16 06:01:55 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11582] + +Wed Mar 16 06:01:54 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11581] + * draft/man3/malloc.3: [JM:11581] + +Wed Mar 16 06:01:54 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11580] + * draft/man3/rand.3: [JM:11580] + +Wed Mar 16 06:01:53 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11579] + * draft/man3/errno.3: [JM:11579] + +Wed Mar 16 06:01:52 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11578] + * draft/man3/perror.3: [JM:11578] + +Wed Mar 16 06:01:51 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11577] + * draft/man3/tmpnam.3: [JM:11577] + +Tue Mar 15 12:02:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11576] + * draft/man2/recv.2: [JM:11576] + +Tue Mar 15 12:02:49 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11575] + * draft/man2/send.2: [JM:11575] + +Tue Mar 15 12:02:48 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11574] + * draft/man2/sendfile.2: [JM:11574] + +Tue Mar 15 05:52:01 JST 2005 Yuichi SATO + + * telldir.3, strcat.3, sinh.3, sin.3, setenv.3, resolver.3, + remainder.3, regex.3, opendir.3, profil.3, killpg.3, infnan.3, + gcvt.3, erf.3, cosh.3, cos.3, closedir.3, vhangup.2, utime.2, + symlink.2, swapon.2, sigpause.2, setsid.2, sched_setparam.2, + rename.2, readlink.2, read.2, quotactl.2, pipe.2, mprotect.2, + modify_ldt.2, link.2, killpg.2, getuid.2, getsockname.2, futex.2, + execve.2, chdir.2, capget.2, bind.2, bdflush.2: 2.01 ÂбþÈǤò¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Mon Mar 14 06:01:46 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11571] + * draft/man7/capabilities.7: [JM:11571] + +Mon Mar 14 03:02:44 2005 Akihiro MOTOKI + + * clone.2, nanosleep.2, semget.2, semop.2, stat.2: ±ó»³¤µ¤ó¤Î + ¥³¥á¥ó¥È¤òÈ¿±Ç [JM:11559-11560,11563-11565] + +Sat Mar 12 19:40:12 JST 2005 Akihiro MOTOKI + + * accept.2, access.2, clone.2, connect.2, flock.2, getpeername.2, + getpriority.2, intro.2, ioctl.2, ioperm.2, iopl.2, kill.2, + lseek.2, mount.2, msgget.2, msgop.2, readahead.2, rmdir.2, + semget.2, semop.2, setfsgid.2, setfsuid.2, shmget.2, stat.2, + tkill.2, uselib.2, wait4.2: 2.01ÂбþÈǤò¥ê¥ê¡¼¥¹ + +Sat Mar 12 18:02:53 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11557] + * draft/man7/man.7: [JM:11557] + * release/man7/man.7: [JM:11557] + +Sat Mar 12 18:02:52 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11555] + * draft/man3/fenv.3: [JM:11555] + * release/man3/fenv.3: [JM:11555] + +Sat Mar 12 18:02:51 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11556] + * draft/man7/boot.7: [JM:11556] + * release/man7/boot.7: [JM:11556] + +Sat Mar 12 18:02:51 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11554] + * draft/man7/packet.7: [JM:11554] + * release/man7/packet.7: [JM:11554] + +Sat Mar 12 18:02:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11553] + * draft/man7/socket.7: [JM:11553] + * release/man7/socket.7: [JM:11553] + +Sat Mar 12 18:02:49 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11552] + * draft/man7/tcp.7: [JM:11552] + * release/man7/tcp.7: [JM:11552] + +Sat Mar 12 18:02:47 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11551] + * draft/man5/hosts.equiv.5: [JM:11551] + * release/man5/hosts.equiv.5: [JM:11551] + +Sat Mar 12 03:20:12 JST 2005 Akihiro MOTOKI + + * basename.3, cexp2.3, cproj.3, ctime.3, exec.3, finite.3, + getnameinfo.3, isalpha.3, lsearch.3, on_exit.3, ptsname.3, + realpath.3, setnetgrent.3, strftime.3, system.3, termios.3: + 2.01ÂбþÈǤò¥ê¥ê¡¼¥¹ + +Thu Mar 11 00:35:21 JST 2005 Akihiro MOTOKI + + * complex.5, hosts.equiv.5, group.5, utmp.5, LDP.7, ascii.7, + boot.7, mailaddr.7, man.7, packet.7, signal.7, socket.7, tcp.7, + unix.7: 2.01ÂбþÈǤò¥ê¥ê¡¼¥¹ + +Tue Mar 8 00:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11536] + * draft/man2/msgget.2: [JM:11536] + +Tue Mar 8 00:02:39 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11535] + * draft/man2/wait4.2: [JM:11535] + +Tue Mar 8 00:02:38 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11534] + * draft/man2/msgop.2: [JM:11534] + +Fri Mar 4 06:01:33 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11519] + * draft/man2/stat.2: [JM:11519] + +Thu Mar 3 06:02:41 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11514] + * draft/man2/shmget.2: [JM:11514] + +Thu Mar 3 06:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11513] + * draft/man2/semget.2: [JM:11513] + +Thu Mar 3 06:02:39 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11512] + * draft/man2/semop.2: [JM:11512] + +Mon Feb 28 12:02:47 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11508] + +Mon Feb 28 12:02:46 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11507] + * draft/man2/mount.2: [JM:11507] + +Mon Feb 28 12:02:45 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11506] + * draft/man2/tkill.2: [JM:11506] + +Mon Feb 28 12:02:45 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11505] + +Mon Feb 28 12:02:44 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11504] + +Mon Feb 28 12:02:43 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11503] + +Mon Feb 28 12:02:43 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11502] + +Mon Feb 28 12:02:42 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11501] + * draft/man2/kill.2: [JM:11501] + +Mon Feb 28 12:02:41 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11500] + * draft/man2/uselib.2: [JM:11500] + +Mon Feb 28 00:02:52 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11496] + * draft/man2/readahead.2: [JM:11496] + +Mon Feb 28 00:02:51 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11495] + * draft/man3/system.3: [JM:11495] + +Mon Feb 28 00:02:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11494] + * draft/man3/realpath.3: [JM:11494] + +Mon Feb 28 00:02:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11493] + * draft/man3/ptsname.3: [JM:11493] + +Mon Feb 28 00:02:48 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11492] + * draft/man3/getnameinfo.3: [JM:11492] + +Sun Feb 27 00:02:17 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11486] + * draft/man2/lookup_dcookie.2: [JM:11486] + * release/man2/lookup_dcookie.2: [JM:11486] + +Sun Feb 27 00:02:16 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11483] + * draft/man2/nanosleep.2: [JM:11483] + * release/man2/nanosleep.2: [JM:11483] + +Sun Feb 27 00:02:15 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11482] + * draft/man2/clone.2: [JM:11482] + +Sun Feb 27 00:02:14 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11481] + * draft/man2/flock.2: [JM:11481] + +Sat Feb 26 18:02:28 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11480] + * draft/man3/lgamma.3: [JM:11480] + * release/man3/lgamma.3: [JM:11480] + +Sat Feb 26 18:02:26 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11479] + * draft/man3/gamma.3: [JM:11479] + * release/man3/gamma.3: [JM:11479] + +Sat Feb 26 18:02:25 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11478] + * draft/man3/tgamma.3: [JM:11478] + * release/man3/tgamma.3: [JM:11478] + +Sat Feb 26 12:02:54 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11465] + * draft/man3/shm_open.3: [JM:11465] + * release/man3/shm_open.3: [JM:11465] + +Sat Feb 26 12:02:54 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11464] + * draft/man3/exec.3: [JM:11464] + +Sat Feb 26 12:02:53 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11463] + * draft/man3/on_exit.3: [JM:11463] + +Sat Feb 26 12:02:53 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11462] + * draft/man3/lsearch.3: [JM:11462] + +Sat Feb 26 12:02:52 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11461] + * draft/man3/inet_ntop.3: [JM:11461] + * release/man3/inet_ntop.3: [JM:11461] + +Sat Feb 26 12:02:51 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11460] + * draft/man3/bsearch.3: [JM:11460] + * release/man3/bsearch.3: [JM:11460] + +Sat Feb 26 12:02:51 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11459] + * draft/man3/basename.3: [JM:11459] + +Sat Feb 26 12:02:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11477] + * draft/man3/fenv.3: [JM:11477] + +Sat Feb 26 12:02:49 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11476] + * draft/man3/gets.3: [JM:11476] + * release/man3/gets.3: [JM:11476] + +Sat Feb 26 12:02:48 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11458] + * draft/man3/remainder.3: [JM:11458] + +Sat Feb 26 12:02:48 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11475] + * draft/man3/initgroups.3: [JM:11475] + * release/man3/initgroups.3: [JM:11475] + +Sat Feb 26 12:02:47 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11474] + * draft/man3/isalpha.3: [JM:11474] + +Sat Feb 26 12:02:47 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11473] + * draft/man3/strftime.3: [JM:11473] + +Sat Feb 26 12:02:46 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11472] + * draft/man3/tzset.3: [JM:11472] + * release/man3/tzset.3: [JM:11472] + +Sat Feb 26 12:02:45 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11471] + * draft/man3/termios.3: [JM:11471] + +Sat Feb 26 12:02:44 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11470] + * draft/man3/remainder.3: [JM:11470] + * release/man3/remainder.3: [JM:11470] + +Sat Feb 26 12:02:44 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11469] + * draft/man3/mkstemp.3: [JM:11469] + * release/man3/mkstemp.3: [JM:11469] + +Sat Feb 26 12:02:43 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11468] + * draft/man3/clog2.3: [JM:11468] + * release/man3/clog2.3: [JM:11468] + +Sat Feb 26 12:02:42 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11467] + * draft/man3/clog10.3: [JM:11467] + * release/man3/clog10.3: [JM:11467] + +Sat Feb 26 12:02:42 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11466] + * draft/man3/cerf.3: [JM:11466] + * release/man3/cerf.3: [JM:11466] + +Sat Feb 26 12:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11457] + * draft/man3/regex.3: [JM:11457] + +Sat Feb 26 08:24:05 JST 2005 Akihiro MOTOKI + + * ecvt_r.3, getaddrinfo.3, grantpt.3, regex.3, console_ioctl.4: + Synchronized to 2.01 release. (minor modification) + +Fri Feb 25 06:01:38 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11453] + * draft/man3/ctime.3: [JM:11453] + +Fri Feb 25 06:01:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11451] + * draft/man5/utmp.5: [JM:11451] + +Fri Feb 25 06:01:36 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11452] + * draft/man3/cexp2.3: [JM:11452] + +Thu Feb 24 12:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11447] + * draft/man2/ioperm.2: [JM:11447] + +Thu Feb 24 12:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11446] + * draft/man2/iopl.2: [JM:11446] + +Thu Feb 24 12:02:39 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11445] + * draft/man2/setfsgid.2: [JM:11445] + +Thu Feb 24 12:02:38 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11444] + * draft/man2/setfsuid.2: [JM:11444] + +Thu Feb 24 12:02:38 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11443] + * draft/man2/getpriority.2: [JM:11443] + +Thu Feb 24 12:02:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11442] + * draft/man2/getpeername.2: [JM:11442] + +Thu Feb 24 12:02:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11441] + * draft/man2/connect.2: [JM:11441] + +Thu Feb 24 12:02:36 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11439] + * draft/man2/accept.2: [JM:11439] + +Thu Feb 24 12:02:35 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11450] + * draft/man2/rmdir.2: [JM:11450] + +Thu Feb 24 12:02:34 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11449] + * draft/man2/lseek.2: [JM:11449] + +Thu Feb 24 12:02:33 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11448] + * draft/man2/ioctl.2: [JM:11448] + +Thu Feb 24 12:02:32 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11440] + * draft/man2/access.2: [JM:11440] + +Thu Feb 23 22:56:36 JST 2005 Akihiro MOTOKI + + * translation_list: readahead.2 ¤¬Á´ÌÌŪ¤Ë½ñ¤­´¹¤¨¤é¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢ + ¾õÂÖ¤ò¥ê¥»¥Ã¥È¤·¤¿¡£ + * getsockopt.2, madvise.2, mremap.2, nice.2, pivot_root.2, + ptrace.2, reboot.2, sched_setscheduler.2, set_thred_area.2, + setgid.2, socket.2, socketpair.2, stime.2, times.2, truncate.2, + write.2: Synchronized to 2.01 release. (minor modification) + +Thu Feb 24 06:02:38 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11437] + * draft/man2/read.2: [JM:11437] + +Thu Feb 24 06:02:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11436] + * draft/man2/quotactl.2: [JM:11436] + +Thu Feb 24 06:02:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11435] + * draft/man2/modify_ldt.2: [JM:11435] + +Thu Feb 24 06:02:35 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11434] + * draft/man3/telldir.3: [JM:11434] + +Thu Feb 24 06:02:32 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11433] + * draft/man3/strcat.3: [JM:11433] + +Thu Feb 24 00:02:46 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11432] + * draft/man3/setnetgrent.3: [JM:11432] + +Thu Feb 24 00:02:45 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11431] + * draft/man7/socket.7: [JM:11431] + +Thu Feb 24 00:02:44 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11430] + * draft/man7/man.7: [JM:11430] + +Thu Feb 24 00:02:43 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11429] + * draft/man7/signal.7: [JM:11429] + +Mon Feb 21 12:02:58 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11418] + * draft/man7/tcp.7: [JM:11418] + +Mon Feb 21 12:02:56 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11417] + * draft/man7/mailaddr.7: [JM:11417] + +Mon Feb 21 12:02:56 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11416] + * draft/man7/ascii.7: [JM:11416] + +Mon Feb 21 12:02:55 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11415] + * draft/man3/ctanh.3: [JM:11415] + * release/man3/ctanh.3: [JM:11415] + +Mon Feb 21 12:02:54 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11414] + * draft/man3/ctan.3: [JM:11414] + * release/man3/ctan.3: [JM:11414] + +Mon Feb 21 12:02:54 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11413] + * draft/man3/cproj.3: [JM:11413] + +Mon Feb 21 12:02:52 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11412] + * draft/man3/finite.3: [JM:11412] + +Mon Feb 21 12:02:51 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11411] + * draft/man2/intro.2: [JM:11411] + +Mon Feb 21 12:02:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11428] + +Mon Feb 21 12:02:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11427] + +Mon Feb 21 12:02:49 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11426] + +Mon Feb 21 12:02:49 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11425] + +Mon Feb 21 12:02:48 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11424] + +Mon Feb 21 12:02:47 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11423] + * draft/man7/LDP.7: [JM:11423] + +Mon Feb 21 12:02:47 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11422] + * draft/man7/boot.7: [JM:11422] + +Mon Feb 21 12:02:46 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11421] + * draft/man7/packet.7: [JM:11421] + +Mon Feb 21 12:02:45 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11420] + +Mon Feb 21 12:02:45 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11419] + * draft/man7/unix.7: [JM:11419] + +Mon Feb 21 12:02:43 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11409] + * draft/man3/undocumented.3: [JM:11409] + * release/man3/undocumented.3: [JM:11409] + +Sun Feb 20 20:18:36 JST 2005 Akihiro MOTOKI + + * translation_list: signgam.3 ¤¬È´¤±¤Æ¤¤¤¿¤Î¤ÇÄɲà + +Mon Feb 21 00:02:44 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11407] + * draft/man5/group.5: [JM:11407] + +Mon Feb 21 00:02:44 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11406] + * draft/man5/hosts.equiv.5: [JM:11406] + +Mon Feb 21 00:02:42 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11405] + * draft/man5/complex.5: [JM:11405] + +Sun Feb 20 11:25:44 JST 2005 Akihiro MOTOKI + + * translation_list (setnetgrent.3): Changed from link to normal page. + +Sun Feb 20 07:23:27 JST 2005 Akihiro MOTOKI + + * release/man2/munlock.2, release/man3/isinf.3, + release/man2/mlockall.2, release/man2/munlockall.2, + draft/man2/munlock.2, draft/man2/mlockall.2, draft/man3/isinf.3: + Remove release/draft pages because originals are changed to link pages. + + * translation_list: finite.3 ¤¬Ä̾ï¤Î¥Ú¡¼¥¸¤ËÊѹ¹¤Ë¤Ê¤Ã¤¿¤Î¤ÇÈ¿±Ç + +Sun Feb 20 06:42:47 JST 2005 Akihiro MOTOKI + + * _exit.2, alarm.2, alloc_hugepages.2, arch_prctl.2, cacheflush.2, + dup.2, epoll_wait.2, fdatasync.2, fsync.2, get_thread_area.2, + getcontext.2, getdents.2, getdtablesize.2, getgid.2, gethostid.2, + getpagesize.2, getpid.2, getresuid.2, gettid.2, getxattr.2, + idle.2, listxattr.2, mmap2.2, msync.2, pause.2, pciconfig_read.2, + personality.2, posix_fadvise.2, prctl.2, pread.2, readdir.2, + readv.2, removexattr.2, sched_get_priority_max.2, + sched_rr_get_interval.2, setpgid.2, setup.2, setxattr.2, + shutdown.2, sigreturn.2, sigvec.2, sigwaitinfo.2, sync.2, + sysctl.2, sysfs.2, syslog.2, time.2, umask.2, uname.2, + undocumented.2, ustat.2, vfork.2, vm86.2: + Synchronized to 2.01 release. (minor modification) + + * modf.3, nan.3, nextafter.3, nl_langinfo.3, openpty.3, popen.3, + posix_memalign.3, pow.3, psignal.3, putenv.3, putgrent.3, + putpwent.3, puts.3, qecvt.3, qsort.3, raise.3, random.3, rcmd.3, + re_comp.3, remove.3, rewinddir.3, rpc.3, rtime.3, rtnetlink.3, + scanf.3, seekdir.3, setlocale.3, setlogmask.3, siginterrupt.3, + signbit.3, sigsetops.3, sincos.3, sleep.3, sqrt.3, stdarg.3, + stdio.3, stdio_ext.3, stpcpy.3, strcasecmp.3, strchr.3, strcmp.3, + strcoll.3, strcpy.3, strdup.3, strerror.3, strfry.3, string.3, + strlen.3, strpbrk.3, strptime.3, strsep.3, strsignal.3, strspn.3, + strstr.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, strxfrm.3, + swab.3, syslog.3, tan.3, tanh.3, tcgetpgrp.3, tcgetsid.3, + tempnam.3, timegm.3, tmpfile.3, toascii.3, toupper.3, towctrans.3, + towlower.3, towupper.3, tsearch.3, ttyslot.3, ualarm.3, ulimit.3, + unlocked_stdio.3, unlockpt.3, usleep.3, wcscat.3, wcschr.3, + wcsnrtombs.3, wcspbrk.3, wcsrtombs.3, wcstoimax.3, wcswidth.3, + wctomb.3, wcwidth.3, wprintf.3: Ditto. + + * mlockall.2, munlock.2, munlockall.2: Changed to link page. + +Sat Feb 19 09:26:28 JST 2005 Akihiro MOTOKI + + * intro.1, ldd.1: Synchronized to 2.01 release. (minor modification) + + * MB_CUR_MAX.3, __setfpucw.3, abort.3, abs.3, acos.3, acosh.3, + aio_read.3, aio_return.3, aio_write.3, argz_add.3, asin.3, + asinh.3, asprintf.3, assert.3, assert_perror.3, atan.3, atan2.3, + atanh.3, atexit.3, atof.3, atoi.3, bcmp.3, bcopy.3, + bindresvport.3, bstring.3, byteorder.3, bzero.3, cabs.3, cacos.3, + cacosh.3, carg.3, casin.3, casinh.3, catan.3, catanh.3, catgets.3, + catopen.3, cbrt.3, ccos.3, ccosh.3, cexp.3, cimag.3, clearenv.3, + clock.3, clog.3, cmsg.3, confstr.3, conj.3, copysign.3, cpow.3, + creal.3, csin.3, csinh.3, csqrt.3, ctermid.3, difftime.3, dirfd.3, + div.3, dprintf.3, drand48.3, dysize.3, ecvt.3, ether_aton.3, + exit.3, exp.3, exp10.3, exp2.3, expm1.3, fcloseall.3, ferror.3, + ffs.3, fgetgrent.3, fgetpwent.3, fgetwc.3, fgetws.3, flockfile.3, + fmod.3, fnmatch.3, fpathconf.3, fpurge.3, fputws.3, frexp.3, + fseeko.3, ftok.3, ftw.3, getcwd.3, getdate.3, getdirentries.3, + getenv.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, + getgrouplist.3, getipnodebyname.3, getline.3, getnetent.3, + getprotoent.3, getpt.3, getpw.3, getpwent.3, getpwent_r.3, + getpwnam.3, getservent.3, getspnam.3, getumask.3, getusershell.3, + getw.3, glob.3, gsignal.3, iconv.3, iconv_close.3, iconv_open.3, + index.3, inet.3, inet_pton.3, insque.3, iswctype.3, iswxdigit.3, + j0.3, localeconv.3, log.3, log10.3, log1p.3, makecontext.3, + malloc_hook.3, mbsnrtowcs.3, mbsrtowcs.3, mbtowc.3, memccpy.3, + memchr.3, memcmp.3, memcpy.3, memfrob.3, memmem.3, memmove.3, + mempcpy.3, memset.3, mkdtemp.3, mkfifo.3, mktemp.3: Ditto + + * console_codes.4, fd.4, fifo.4, full.4, hd.4, initrd.4, lp.4, + mouse.4, ram.4, sd.4, st.4, tty.4, ttyS.4, vcs.4: Ditto. + + * charmap.5, dir_colors.5, environ.5, ftpusers.5, host.conf.5, + hosts.5, ipc.5, locale.5, nsswitch.conf.5, passwd.5, services.5, + slabinfo.5, termcap.5, ttytype.5: Ditto. + + * isnan.3: ¥ê¥ó¥¯»²¾ÈÀèÊѹ¹ + * isinf.3: ¥ê¥ó¥¯¥Ú¡¼¥¸¤ËÊѹ¹ + +Sat Feb 19 12:02:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11399] + * draft/man3/gamma.3: [JM:11399] + +Sat Feb 19 12:02:49 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11398] + * draft/man3/tgamma.3: [JM:11398] + +Sat Feb 19 12:02:48 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11397] + * draft/man3/lgamma.3: [JM:11397] + +Fri Feb 18 02:53:56 JST 2005 Akihiro MOTOKI + + * arp.7, bootparam.7, charsets.7, ddp.7, glob.7, hier.7, ipv6.7, + iso_8859-16.7, locale.7, netdevice.7, netlink.7, raw.7, x25.7, + rtnetlink.7, suffixes.7, udp.7, unicode.7, units.7, uri.7: + Synchronized to 2.01 release. (minor modification) + * ldconfig.8, sync.8: Ditto. + +Fri Feb 18 00:02:48 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11391] + * draft/man3/sinh.3: [JM:11391] + +Fri Feb 18 00:02:46 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11390] + * draft/man3/sin.3: [JM:11390] + +Fri Feb 18 00:02:43 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11389] + * draft/man3/setenv.3: [JM:11389] + +Thu Feb 17 06:02:15 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11386] + * draft/man3/resolver.3: [JM:11386] + +Thu Feb 17 06:02:14 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11385] + * draft/man3/profil.3: [JM:11385] + +Thu Feb 17 06:02:12 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11384] + * draft/man3/opendir.3: [JM:11384] + +Thu Feb 17 06:02:12 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11383] + * draft/man3/killpg.3: [JM:11383] + +Thu Feb 17 06:02:10 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11382] + * draft/man3/infnan.3: [JM:11382] + +Thu Feb 17 06:02:08 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11381] + * draft/man3/gcvt.3: [JM:11381] + +Thu Feb 17 00:02:30 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11379] + +Tue Feb 15 06:02:30 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11378] + * draft/man3/erf.3: [JM:11378] + +Tue Feb 15 06:02:29 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11377] + * draft/man3/cosh.3: [JM:11377] + +Tue Feb 15 06:02:28 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11376] + * draft/man3/cos.3: [JM:11376] + +Tue Feb 15 06:02:26 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11375] + * draft/man3/closedir.3: [JM:11375] + +Tue Feb 15 06:02:24 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11374] + * draft/man2/vhangup.2: [JM:11374] + +Tue Feb 15 06:02:22 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11373] + * draft/man2/utime.2: [JM:11373] + +Mon Feb 14 23:20:36 JST 2005 Yuichi SATO + + * acct.2, chown.2, getrusage.2, gettimeofday.2, exit_group.2, + unlink.2, statvfs.2, statfs.2, sigqueue.2, signal.2, shmop.2, + shmctl.2, setuid.2, setreuid.2, setresuid.2, seteuid.2, semctl.2, + sched_setaffinity.2, remap_file_pages.2, set_tid_address.2, + path_resolution.2, open.2, poll.2, acct.2, chown.2, + gettimeofday.2, exit_group.2, hsearch.3, getopt.3, + gethostbyname.3, fpclassify.3, fmin.3, fmax.3, fma.3, floor.3, + fdim.3, fclose.3, fabs.3, clock_getres.3, ceil.3, significand.3, + scalb.3, remquo.3, pow10.3, posix_openpt.3, lseek64.3, logb.3, + ilogb.3, drand48_r.3, dl_iterate_phdr.3, INFINITY.3, + random.4, epoll.4, proc.5, elf.5, resolv.conf.5, ip.7, + nscd.8, ksoftirqd.9: 2.01 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + +Sat Feb 12 18:02:22 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11367] + * draft/man3/lgamma.3: [JM:11367] + +Sat Feb 12 18:02:21 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11366] + * draft/man3/tgamma.3: [JM:11366] + +Sat Feb 12 12:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11365] + * draft/man2/symlink.2: [JM:11365] + +Sat Feb 12 00:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11363] + +Sat Feb 12 00:02:39 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11362] + +Fri Feb 11 12:02:43 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11361] + * draft/man2/swapon.2: [JM:11361] + +Fri Feb 11 12:02:41 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11360] + * draft/man2/sigpause.2: [JM:11360] + +Fri Feb 11 00:02:17 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11359] + * draft/man2/setsid.2: [JM:11359] + +Fri Feb 11 00:02:15 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11358] + * draft/man2/sched_setparam.2: [JM:11358] + +Thu Feb 10 12:02:24 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11357] + * draft/man2/rename.2: [JM:11357] + +Thu Feb 10 12:02:22 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11356] + * draft/man2/readlink.2: [JM:11356] + +Thu Feb 10 12:02:21 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11355] + * draft/man2/pipe.2: [JM:11355] + +Thu Feb 10 06:01:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11354] + * draft/man2/lookup_dcookie.2: [JM:11354] + +Thu Feb 10 06:01:49 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11353] + * draft/man2/nanosleep.2: [JM:11353] + +Tue Feb 8 12:02:44 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11352] + * draft/man2/mprotect.2: [JM:11352] + +Tue Feb 8 12:02:42 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11351] + * draft/man2/link.2: [JM:11351] + +Sun Feb 6 00:02:44 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11350] + * draft/man2/killpg.2: [JM:11350] + +Sun Feb 6 00:02:42 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11349] + * draft/man2/getuid.2: [JM:11349] + +Sat Feb 5 18:02:36 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11345] + * draft/man2/getsockname.2: [JM:11345] + +Sat Feb 5 18:02:35 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11344] + * draft/man2/futex.2: [JM:11344] + +Sat Feb 5 12:02:31 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11343] + * draft/man2/execve.2: [JM:11343] + +Sat Feb 5 12:02:30 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11342] + * draft/man2/chdir.2: [JM:11342] + +Thu Feb 3 06:02:16 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11340] + * draft/man2/capget.2: [JM:11340] + +Thu Feb 3 06:02:16 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11339] + * draft/man2/bind.2: [JM:11339] + +Thu Feb 3 06:02:15 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11338] + * draft/man2/bdflush.2: [JM:11338] + +Thu Feb 3 06:02:08 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11337] + * draft/man9/ksoftirqd.9: [JM:11337] + +Tue Feb 1 12:02:41 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11336] + * draft/man3/significand.3: [JM:11336] + +Tue Feb 1 12:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11335] + * draft/man3/scalb.3: [JM:11335] + +Tue Feb 1 12:02:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11334] + * draft/man3/remquo.3: [JM:11334] + +Sun Jan 30 18:02:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11326] + * draft/man3/pow10.3: [JM:11326] + +Sun Jan 30 12:02:41 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11325] + * draft/man3/posix_openpt.3: [JM:11325] + +Sun Jan 30 06:02:10 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11324] + * draft/man3/lseek64.3: [JM:11324] + +Sat Jan 29 12:02:43 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11323] + * draft/man3/logb.3: [JM:11323] + +Sat Jan 29 06:02:03 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11322] + * draft/man3/ilogb.3: [JM:11322] + +Sat Jan 29 06:02:01 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11321] + * draft/man3/drand48_r.3: [JM:11321] + +Thu Jan 27 12:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11318] + * draft/man3/dl_iterate_phdr.3: [JM:11318] + +Thu Jan 27 06:01:58 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11317] + * draft/man3/INFINITY.3: [JM:11317] + +Wed Jan 26 12:02:46 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11316] + * draft/man2/set_tid_address.2: [JM:11316] + +Wed Jan 26 06:02:08 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11315] + * draft/man2/path_resolution.2: [JM:11315] + +Sun Jan 23 06:01:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11311] + * draft/man5/resolv.conf.5: [JM:11311] + +Sun Jan 23 03:48:37 JST 2005 Yuichi SATO + + * {draft,release}/man5/{resolv.conf.5,resolver.5}: man-pages-2.01 ¤Ç + ¥ê¥ó¥¯¤¬ resolv.conf.5 -> resolver.5 ¤ËÊѹ¹¤Ë¤Ê¤Ã¤¿¤¿¤á¡¢ + resolver.5 ¤ò resolv.conf.5 ¤Ë¥Õ¥¡¥¤¥ë̾Êѹ¹¤·¤¿¡£ + * translation_list: ¾åµ­¤Î¥ê¥ó¥¯Êѹ¹¤òÈ¿±Ç¡£ + +Sun Jan 23 00:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11309] + * draft/man2/exit_group.2: [JM:11309] + +Sat Jan 22 18:02:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11307] + * draft/man8/nscd.8: [JM:11307] + +Sat Jan 22 18:02:35 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11306] + * draft/man7/ip.7: [JM:11306] + +Sat Jan 22 06:01:34 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11304] + * draft/man5/proc.5: [JM:11304] + +Fri Jan 21 00:02:18 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11302] + * draft/man2/sigaltstack.2: [JM:11302] + * release/man2/sigaltstack.2: [JM:11302] + +Tue Jan 18 06:02:13 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11299] + * draft/man4/random.4: [JM:11299] + +Tue Jan 18 06:02:11 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11298] + * draft/man4/epoll.4: [JM:11298] + +Sun Jan 16 12:02:51 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11295] + * draft/man3/trunc.3: [JM:11295] + +Sun Jan 16 12:02:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11294] + * draft/man3/scandir.3: [JM:11294] + +Sun Jan 16 12:02:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11293] + * draft/man3/round.3: [JM:11293] + +Sun Jan 16 12:02:49 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11292] + * draft/man3/rint.3: [JM:11292] + +Sun Jan 16 12:02:48 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11291] + * draft/man3/readdir.3: [JM:11291] + +Sun Jan 16 12:02:47 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11290] + * draft/man3/lround.3: [JM:11290] + +Sun Jan 16 00:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11289] + * draft/man3/lrint.3: [JM:11289] + +Sun Jan 16 00:02:39 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11288] + * draft/man3/login.3: [JM:11288] + +Sun Jan 16 00:02:39 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11287] + * draft/man3/log2.3: [JM:11287] + +Sun Jan 16 00:02:38 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11286] + * draft/man3/ldexp.3: [JM:11286] + +Sun Jan 16 00:02:37 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11285] + * draft/man3/isgreater.3: [JM:11285] + +Sun Jan 16 00:02:35 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11284] + * draft/man3/hypot.3: [JM:11284] + +Fri Jan 14 12:02:43 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11282] + * draft/man2/getrusage.2: [JM:11282] + +Fri Jan 14 05:47:37 JST 2005 Yuichi SATO + + * acct.2, adjtimex.2, chmod.2, chown.2, chroot.2, close.2, + epoll_create.2, epoll_ctl.2, fork.2, getdomainname.2, getgroups.2, + gethostname.2, getrlimit.2, gettimeofday.2, llseek.2, mincore.2, + mknod.2, mmap.2, msgctl.2, posixoptions.7, + elf.5 : v2.01 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£getrusage.2 ¤ò̤Ìõ¥Ú¡¼¥¸¤ËÊѹ¹¡£ + +Tue Jan 11 00:02:05 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11280] + * draft/man3/hsearch.3: [JM:11280] + +Mon Jan 10 18:02:44 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11279] + * draft/man3/getopt.3: [JM:11279] + +Mon Jan 10 18:02:42 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11278] + * draft/man3/gethostbyname.3: [JM:11278] + +Mon Jan 10 12:02:34 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11275] + * draft/man3/fmax.3: [JM:11275] + +Mon Jan 10 12:02:33 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11274] + * draft/man3/fma.3: [JM:11274] + +Mon Jan 10 12:02:32 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11273] + * draft/man3/floor.3: [JM:11273] + +Mon Jan 10 12:02:31 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11270] + * draft/man3/fdim.3: [JM:11270] + +Mon Jan 10 12:02:31 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11269] + * draft/man3/fclose.3: [JM:11269] + +Mon Jan 10 12:02:30 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11268] + * draft/man3/fabs.3: [JM:11268] + +Mon Jan 10 12:02:29 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11277] + * draft/man3/fpclassify.3: [JM:11277] + +Mon Jan 10 12:02:29 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11276] + * draft/man3/fmin.3: [JM:11276] + +Mon Jan 10 12:02:27 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11267] + * draft/man3/clock_getres.3: [JM:11267] + +Mon Jan 10 00:01:55 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11265] + * draft/man3/ceil.3: [JM:11265] + +Mon Jan 10 00:01:54 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11264] + * draft/man2/unlink.2: [JM:11264] + +Mon Jan 10 00:01:54 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11263] + * draft/man2/statvfs.2: [JM:11263] + +Mon Jan 10 00:01:52 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11262] + * draft/man2/statfs.2: [JM:11262] + +Sat Jan 8 12:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11259] + * draft/man2/sigqueue.2: [JM:11259] + +Fri Jan 7 12:02:57 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11258] + * draft/man2/signal.2: [JM:11258] + +Fri Jan 7 12:02:56 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11257] + * draft/man2/shmop.2: [JM:11257] + +Wed Jan 5 06:01:51 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11255] + * draft/man2/shmctl.2: [JM:11255] + +Wed Jan 5 06:01:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11254] + * draft/man2/setuid.2: [JM:11254] + +Wed Jan 5 06:01:49 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11253] + * draft/man2/setreuid.2: [JM:11253] + +Tue Jan 4 12:02:50 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11252] + * draft/man2/setresuid.2: [JM:11252] + +Tue Jan 4 06:01:43 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11251] + * draft/man2/seteuid.2: [JM:11251] + +Mon Jan 3 06:02:20 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11250] + * draft/man2/semctl.2: [JM:11250] + +Mon Jan 3 06:02:19 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11249] + * draft/man2/sched_setaffinity.2: [JM:11249] + +Mon Jan 3 06:02:18 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11248] + * draft/man2/remap_file_pages.2: [JM:11248] + +Mon Jan 3 06:02:17 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11247] + * draft/man2/poll.2: [JM:11247] + +Sat Jan 1 12:02:40 JST 2005 JM ML to CVS Gateway + + * translation_list: [JM:11246] + * draft/man2/open.2: [JM:11246] + +Fri Dec 31 12:02:23 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11245] + * draft/man2/msgctl.2: [JM:11245] + +Fri Dec 31 12:02:22 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11244] + * draft/man2/mknod.2: [JM:11244] + +Fri Dec 31 12:02:21 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11243] + * draft/man2/mincore.2: [JM:11243] + +Fri Dec 31 06:01:57 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11242] + * draft/man2/llseek.2: [JM:11242] + +Thu Dec 30 18:02:43 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11241] + * draft/man2/gettimeofday.2: [JM:11241] + +Thu Dec 30 18:02:41 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11240] + * draft/man2/getrlimit.2: [JM:11240] + +Thu Dec 30 06:02:31 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11239] + * draft/man2/gethostname.2: [JM:11239] + +Thu Dec 30 06:02:30 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11238] + * draft/man2/getgroups.2: [JM:11238] + +Thu Dec 30 00:01:20 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11237] + * draft/man2/getdomainname.2: [JM:11237] + +Wed Dec 29 18:02:36 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11236] + * draft/man2/fork.2: [JM:11236] + +Wed Dec 29 12:02:48 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11235] + * draft/man2/epoll_ctl.2: [JM:11235] + +Wed Dec 29 12:02:47 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11234] + * draft/man2/epoll_create.2: [JM:11234] + +Wed Dec 29 12:02:46 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11233] + * draft/man2/close.2: [JM:11233] + +Wed Dec 29 12:02:46 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11232] + * draft/man2/chown.2: [JM:11232] + +Wed Dec 29 12:02:44 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11231] + * draft/man2/chmod.2: [JM:11231] + +Tue Dec 28 12:02:43 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11230] + * draft/man2/adjtimex.2: [JM:11230] + +Tue Dec 28 12:02:41 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11229] + * draft/man2/acct.2: [JM:11229] + +Tue Dec 28 06:02:31 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11228] + * draft/man2/mmap.2: [JM:11228] + +Tue Dec 28 06:02:29 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11227] + * draft/man2/chroot.2: [JM:11227] + +Sun Dec 26 23:44:31 2004 Takeo Nakano + + * original/ updated to 2.01 + * translation_list: modified as such. + +Thu Dec 16 06:01:42 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11218] + * draft/man7/posixoptions.7: [JM:11218] + +Thu Dec 16 06:01:40 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11217] + * draft/man5/elf.5: [JM:11217] + +Tue Nov 16 06:02:38 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11212] + +Tue Nov 16 06:02:36 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11211] + * draft/man7/operator.7: [JM:11211] + * release/man7/operator.7: [JM:11211] + +Tue Nov 16 06:02:34 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11210] + * draft/man4/tty_ioctl.4: [JM:11210] + * release/man4/tty_ioctl.4: [JM:11210] + +Sat Oct 16 12:02:26 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11205] + * draft/man7/operator.7: [JM:11205] + +Sat Oct 16 12:02:23 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11203] + * draft/man4/tty_ioctl.4: [JM:11203] + +Sat Oct 16 06:02:34 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11202] + * draft/man4/sk98lin.4: [JM:11202] + * release/man4/sk98lin.4: [JM:11202] + +Sat Oct 16 06:02:30 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11201] + * draft/man3/xcrypt.3: [JM:11201] + * release/man3/xcrypt.3: [JM:11201] + +Sat Oct 9 18:01:30 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11197] + * draft/man4/sk98lin.4: [JM:11197] + +Wed Sep 29 06:01:45 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11194] + * draft/man3/wordexp.3: [JM:11194] + * release/man3/wordexp.3: [JM:11194] + +Wed Sep 15 06:01:39 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11192] + * draft/man3/xcrypt.3: [JM:11192] + +Tue Sep 14 06:02:34 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11180] + * draft/man3/remainder.3: [JM:11180] + * release/man3/remainder.3: [JM:11180] + +Tue Sep 14 06:02:33 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11179] + * draft/man3/queue.3: [JM:11179] + * release/man3/queue.3: [JM:11179] + +Tue Sep 14 06:02:32 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11178] + * draft/man3/putgrent.3: [JM:11178] + * release/man3/putgrent.3: [JM:11178] + +Tue Sep 14 06:02:31 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11177] + * draft/man3/mempcpy.3: [JM:11177] + * release/man3/mempcpy.3: [JM:11177] + +Tue Sep 14 06:02:30 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11176] + * draft/man3/login.3: [JM:11176] + * release/man3/login.3: [JM:11176] + +Tue Sep 14 06:02:29 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11175] + * draft/man3/log2.3: [JM:11175] + * release/man3/log2.3: [JM:11175] + +Tue Sep 14 06:02:28 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11174] + * draft/man3/isgreater.3: [JM:11174] + * release/man3/isgreater.3: [JM:11174] + +Tue Sep 14 06:02:27 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11173] + * draft/man3/getttyent.3: [JM:11173] + * release/man3/getttyent.3: [JM:11173] + +Tue Sep 14 06:02:26 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11187] + * draft/man3/wordexp.3: [JM:11187] + * release/man3/wordexp.3: [JM:11187] + +Tue Sep 14 06:02:25 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11186] + * draft/man3/wcstoimax.3: [JM:11186] + * release/man3/wcstoimax.3: [JM:11186] + +Tue Sep 14 06:02:24 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11185] + * draft/man3/ualarm.3: [JM:11185] + * release/man3/ualarm.3: [JM:11185] + +Tue Sep 14 06:02:23 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11184] + * draft/man3/ttyslot.3: [JM:11184] + * release/man3/ttyslot.3: [JM:11184] + +Tue Sep 14 06:02:22 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11183] + * draft/man3/strtoimax.3: [JM:11183] + * release/man3/strtoimax.3: [JM:11183] + +Tue Sep 14 06:02:21 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11182] + * draft/man3/setaliasent.3: [JM:11182] + * release/man3/setaliasent.3: [JM:11182] + +Tue Sep 14 06:02:19 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11181] + * draft/man3/rtime.3: [JM:11181] + * release/man3/rtime.3: [JM:11181] + +Tue Sep 14 06:02:16 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11172] + * draft/man3/getspnam.3: [JM:11172] + * release/man3/getspnam.3: [JM:11172] + +Sun Sep 12 06:02:11 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11170] + * draft/man3/wordexp.3: [JM:11170] + +Sat Sep 11 12:02:39 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11168] + * draft/man3/wcstoimax.3: [JM:11168] + +Sat Sep 11 12:02:37 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11167] + * draft/man3/ualarm.3: [JM:11167] + +Wed Sep 8 06:01:37 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11166] + * draft/man3/ttyslot.3: [JM:11166] + +Mon Sep 6 00:01:36 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11165] + * draft/man3/strtoimax.3: [JM:11165] + +Mon Sep 6 00:01:33 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11164] + * draft/man3/setaliasent.3: [JM:11164] + +Thu Sep 2 12:02:39 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11163] + * draft/man3/rtime.3: [JM:11163] + +Thu Sep 2 06:02:18 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11161] + * draft/man3/remainder.3: [JM:11161] + +Thu Sep 2 06:02:16 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11160] + * draft/man3/queue.3: [JM:11160] + +Sat Aug 28 18:01:58 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11158] + * draft/man3/putgrent.3: [JM:11158] + +Sat Aug 28 12:02:39 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11157] + * draft/man3/mempcpy.3: [JM:11157] + +Thu Aug 26 06:02:10 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11156] + * draft/man3/login.3: [JM:11156] + +Fri Aug 20 06:01:52 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11155] + * draft/man3/log2.3: [JM:11155] + +Fri Aug 20 06:01:51 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11154] + * draft/man3/isgreater.3: [JM:11154] + +Fri Aug 20 06:01:49 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11153] + * draft/man3/getttyent.3: [JM:11153] + +Fri Aug 20 06:01:47 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11152] + * draft/man3/getspnam.3: [JM:11152] + +Sat Aug 14 18:02:27 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11146] + * draft/man3/fpclassify.3: [JM:11146] + * release/man3/fpclassify.3: [JM:11146] + +Sat Aug 14 18:02:26 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11145] + * draft/man3/fmtmsg.3: [JM:11145] + * release/man3/fmtmsg.3: [JM:11145] + +Sat Aug 14 18:02:25 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11144] + * draft/man3/fmin.3: [JM:11144] + * release/man3/fmin.3: [JM:11144] + +Sat Aug 14 18:02:24 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11143] + * draft/man3/fmax.3: [JM:11143] + * release/man3/fmax.3: [JM:11143] + +Sat Aug 14 18:02:23 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11142] + * draft/man3/fma.3: [JM:11142] + * release/man3/fma.3: [JM:11142] + +Sat Aug 14 18:02:22 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11141] + * draft/man3/fdim.3: [JM:11141] + * release/man3/fdim.3: [JM:11141] + +Sat Aug 14 18:02:21 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11140] + * draft/man3/des_crypt.3: [JM:11140] + * release/man3/des_crypt.3: [JM:11140] + +Sat Aug 14 18:02:20 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11139] + * draft/man3/clock_getres.3: [JM:11139] + * release/man3/clock_getres.3: [JM:11139] + +Sat Aug 14 18:02:19 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11149] + * draft/man3/getpwent_r.3: [JM:11149] + * release/man3/getpwent_r.3: [JM:11149] + +Sat Aug 14 18:02:18 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11148] + * draft/man3/getgrouplist.3: [JM:11148] + * release/man3/getgrouplist.3: [JM:11148] + +Sat Aug 14 18:02:16 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11147] + * draft/man3/getgrent_r.3: [JM:11147] + * release/man3/getgrent_r.3: [JM:11147] + +Sat Aug 14 18:02:14 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11138] + * draft/man3/cfree.3: [JM:11138] + * release/man3/cfree.3: [JM:11138] + +Sun Aug 8 06:01:38 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11136] + * draft/man3/getpwent_r.3: [JM:11136] + +Sat Aug 7 18:02:00 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11135] + * draft/man3/getgrouplist.3: [JM:11135] + +Fri Jul 30 22:23:23 2004 NAKANO Takeo + + * strftime.3: ½¤Àµ¥³¥á¥ó¥ÈŬÍÑ ([JM:11129]) + +Thu Jul 29 06:02:24 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11126] + * draft/man3/getgrent_r.3: [JM:11126] + +Wed Jul 28 00:01:49 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11124] + * draft/man3/fpclassify.3: [JM:11124] + +Sun Jul 25 00:02:20 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11123] + * draft/man3/fmtmsg.3: [JM:11123] + +Sat Jul 24 12:02:00 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11122] + * draft/man3/fmin.3: [JM:11122] + +Sat Jul 24 12:01:59 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11121] + * draft/man3/fmax.3: [JM:11121] + +Sat Jul 24 12:01:57 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11120] + * draft/man3/fma.3: [JM:11120] + +Sat Jul 24 12:01:55 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11119] + * draft/man3/fdim.3: [JM:11119] + +Fri Jul 23 06:01:57 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11118] + * draft/man3/des_crypt.3: [JM:11118] + +Tue Jul 20 00:01:31 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11116] + * draft/man3/clock_getres.3: [JM:11116] + +Mon Jul 19 06:01:48 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11115] + * draft/man3/cfree.3: [JM:11115] + +Mon Jul 19 06:01:46 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11113] + * draft/man2/remap_file_pages.2: [JM:11113] + * release/man2/remap_file_pages.2: [JM:11113] + +Sun Jul 18 18:01:33 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11108] + * draft/man3/aio_suspend.3: [JM:11108] + * release/man3/aio_suspend.3: [JM:11108] + +Sun Jul 18 18:01:32 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11107] + * draft/man3/aio_return.3: [JM:11107] + * release/man3/aio_return.3: [JM:11107] + +Sun Jul 18 18:01:31 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11106] + * draft/man3/aio_read.3: [JM:11106] + * release/man3/aio_read.3: [JM:11106] + +Sun Jul 18 18:01:30 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11105] + * draft/man3/aio_fsync.3: [JM:11105] + * release/man3/aio_fsync.3: [JM:11105] + +Sun Jul 18 18:01:28 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11104] + * draft/man3/aio_error.3: [JM:11104] + * release/man3/aio_error.3: [JM:11104] + +Sun Jul 18 18:01:27 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11103] + * draft/man2/statvfs.2: [JM:11103] + * release/man2/statvfs.2: [JM:11103] + +Sun Jul 18 18:01:27 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11102] + * draft/man2/pciconfig_read.2: [JM:11102] + * release/man2/pciconfig_read.2: [JM:11102] + +Sun Jul 18 18:01:26 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11101] + * draft/man3/aio_cancel.3: [JM:11101] + * release/man3/aio_cancel.3: [JM:11101] + +Sun Jul 18 18:01:24 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11109] + * draft/man3/aio_write.3: [JM:11109] + * release/man3/aio_write.3: [JM:11109] + +Sun Jul 18 18:01:23 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11100] + * draft/man3/addseverity.3: [JM:11100] + * release/man3/addseverity.3: [JM:11100] + +Sun Jul 18 12:02:11 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11096] + * draft/man2/statvfs.2: [JM:11096] + * release/man2/statvfs.2: [JM:11096] + +Sun Jul 18 12:02:10 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11095] + * draft/man2/sstk.2: [JM:11095] + * release/man2/sstk.2: [JM:11095] + +Sun Jul 18 12:02:08 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11094] + * draft/man2/posix_fadvise.2: [JM:11094] + * release/man2/posix_fadvise.2: [JM:11094] + +Sun Jul 18 12:02:06 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11093] + * draft/man2/pciconfig_read.2: [JM:11093] + * release/man2/pciconfig_read.2: [JM:11093] + +Sun Jul 18 00:01:40 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11092] + * draft/man4/epoll.4: [JM:11092] + * release/man4/epoll.4: [JM:11092] + +Wed Jul 14 06:02:10 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11088] + * draft/man2/epoll_wait.2: [JM:11088] + * release/man2/epoll_wait.2: [JM:11088] + +Wed Jul 14 06:02:07 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11087] + * draft/man2/epoll_ctl.2: [JM:11087] + * release/man2/epoll_ctl.2: [JM:11087] + +Sat Jul 10 06:02:22 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11083] + * draft/man3/aio_write.3: [JM:11083] + +Sat Jul 10 06:02:20 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11082] + * draft/man3/aio_suspend.3: [JM:11082] + +Fri Jul 9 06:02:13 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11081] + * draft/man3/aio_return.3: [JM:11081] + +Wed Jul 7 16:19:00 2004 NAKANO Takeo + + * draft,release/man2/getdents.2: fix typo (thanks gotom) + +Tue Jul 6 19:14:40 2004 NAKANO Takeo + + * draft,release/man3/getdate.3: fix typo (thanks gotom) + +Mon Jul 5 06:01:35 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11080] + * draft/man3/aio_read.3: [JM:11080] + +Sun Jul 4 18:01:30 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11079] + * draft/man3/aio_fsync.3: [JM:11079] + +Sat Jul 3 06:01:44 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11074] + * draft/man3/aio_error.3: [JM:11074] + +Thu Jul 1 06:02:26 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11073] + * draft/man3/aio_cancel.3: [JM:11073] + +Thu Jul 1 06:02:23 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11072] + * draft/man3/addseverity.3: [JM:11072] + +Wed Jun 30 00:01:52 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11071] + * draft/man2/statvfs.2: [JM:11071] + +Fri Jun 25 06:02:08 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11070] + * draft/man2/sstk.2: [JM:11070] + +Thu Jun 24 06:01:52 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11069] + * draft/man2/remap_file_pages.2: [JM:11069] + +Sun Jun 20 18:02:11 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11061] + * draft/man2/posix_fadvise.2: [JM:11061] + +Sat Jun 19 18:01:58 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11059] + * draft/man2/pciconfig_read.2: [JM:11059] + +Sat Jun 19 18:01:55 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11058] + * draft/man4/epoll.4: [JM:11058] + +Fri Jun 18 23:45:18 JST 2004 SEKINE Tatsuo + + * draft/man2/select_tut.2: fix typo + * release/man2/select_tut.2: fix typo + +Wed Jun 16 06:01:47 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11057] + * draft/man2/epoll_wait.2: [JM:11057] + +Tue Jun 15 06:01:43 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11056] + * draft/man2/epoll_ctl.2: [JM:11056] + +Mon Jun 14 00:02:36 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11046] + * draft/man4/random.4: [JM:11046] + * release/man4/random.4: [JM:11046] + +Mon Jun 14 00:02:36 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11045] + * draft/man3/wcsdup.3: [JM:11045] + * release/man3/wcsdup.3: [JM:11045] + +Mon Jun 14 00:02:32 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11044] + * draft/man3/qsort.3: [JM:11044] + * release/man3/qsort.3: [JM:11044] + +Sun Jun 13 18:02:15 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11032] + * draft/man2/poll.2: [JM:11032] + * release/man2/poll.2: [JM:11032] + +Sun Jun 13 18:02:14 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11031] + * draft/man2/mlockall.2: [JM:11031] + * release/man2/mlockall.2: [JM:11031] + +Sun Jun 13 18:02:13 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11030] + * draft/man2/ioctl_list.2: [JM:11030] + * release/man2/ioctl_list.2: [JM:11030] + +Sun Jun 13 18:02:13 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11029] + * draft/man2/fdatasync.2: [JM:11029] + * release/man2/fdatasync.2: [JM:11029] + +Sun Jun 13 18:02:12 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11028] + * draft/man2/epoll_create.2: [JM:11028] + * release/man2/epoll_create.2: [JM:11028] + +Sun Jun 13 18:02:11 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11027] + * draft/man2/dup.2: [JM:11027] + * release/man2/dup.2: [JM:11027] + +Sun Jun 13 18:02:10 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11026] + * draft/man2/brk.2: [JM:11026] + * release/man2/brk.2: [JM:11026] + +Sun Jun 13 18:02:10 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11043] + * draft/man3/ldexp.3: [JM:11043] + * release/man3/ldexp.3: [JM:11043] + +Sun Jun 13 18:02:09 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11025] + * draft/man2/arch_prctl.2: [JM:11025] + * release/man2/arch_prctl.2: [JM:11025] + +Sun Jun 13 18:02:08 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11042] + * draft/man3/hypot.3: [JM:11042] + * release/man3/hypot.3: [JM:11042] + +Sun Jun 13 18:02:07 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11041] + * draft/man3/getpwnam.3: [JM:11041] + * release/man3/getpwnam.3: [JM:11041] + +Sun Jun 13 18:02:07 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11040] + * draft/man3/getgrnam.3: [JM:11040] + * release/man3/getgrnam.3: [JM:11040] + +Sun Jun 13 18:02:06 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11039] + * draft/man3/getgrent.3: [JM:11039] + * release/man3/getgrent.3: [JM:11039] + +Sun Jun 13 18:02:05 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11038] + * draft/man3/div.3: [JM:11038] + * release/man3/div.3: [JM:11038] + +Sun Jun 13 18:02:04 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11037] + * draft/man3/atexit.3: [JM:11037] + * release/man3/atexit.3: [JM:11037] + +Sun Jun 13 18:02:04 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11036] + * draft/man2/vm86.2: [JM:11036] + * release/man2/vm86.2: [JM:11036] + +Sun Jun 13 18:02:03 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11035] + * draft/man2/ustat.2: [JM:11035] + * release/man2/ustat.2: [JM:11035] + +Sun Jun 13 18:02:02 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11034] + * draft/man2/setuid.2: [JM:11034] + * release/man2/setuid.2: [JM:11034] + +Sun Jun 13 18:02:02 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11033] + * draft/man2/setresuid.2: [JM:11033] + * release/man2/setresuid.2: [JM:11033] + +Sun Jun 13 18:01:59 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11024] + * draft/man2/alloc_hugepages.2: [JM:11024] + * release/man2/alloc_hugepages.2: [JM:11024] + +Wed Jun 9 06:01:33 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11007] + * draft/man2/epoll_create.2: [JM:11007] + +Tue Jun 8 06:02:30 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11006] + * draft/man2/arch_prctl.2: [JM:11006] + +Mon Jun 7 00:01:55 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11005] + * draft/man2/alloc_hugepages.2: [JM:11005] + +Sun Jun 6 18:01:46 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11004] + * draft/man4/random.4: [JM:11004] + +Sun Jun 6 18:01:45 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11003] + * draft/man3/wcsdup.3: [JM:11003] + +Sun Jun 6 18:01:44 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11002] + * draft/man3/qsort.3: [JM:11002] + +Sun Jun 6 12:01:43 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11001] + * draft/man3/ldexp.3: [JM:11001] + +Sun Jun 6 06:02:12 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:11000] + * draft/man3/hypot.3: [JM:11000] + +Sun Jun 6 06:02:11 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10999] + * draft/man3/getpwnam.3: [JM:10999] + +Sun Jun 6 00:02:25 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10998] + * draft/man3/getgrnam.3: [JM:10998] + +Sun May 30 18:02:31 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10995] + * draft/man3/getgrent.3: [JM:10995] + +Sun May 30 18:02:29 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10994] + * draft/man3/div.3: [JM:10994] + +Sun May 23 06:02:53 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10973] + * draft/man2/outb.2: [JM:10973] + +Sun May 23 06:02:53 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10972] + * draft/man2/munlock.2: [JM:10972] + +Sun May 23 06:02:52 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10971] + * draft/man2/mlock.2: [JM:10971] + +Sun May 23 06:02:51 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10970] + * draft/man2/mkdir.2: [JM:10970] + +Sun May 23 06:02:50 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10969] + * draft/man2/intro.2: [JM:10969] + +Sun May 23 06:02:48 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10968] + * draft/man3/atexit.3: [JM:10968] + +Sun May 23 00:05:00 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10967] + * draft/man2/vm86.2: [JM:10967] + +Sun May 23 00:05:00 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10966] + * draft/man2/ustat.2: [JM:10966] + +Sun May 23 00:04:58 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10965] + * draft/man2/setuid.2: [JM:10965] + +Sat May 22 18:02:56 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10964] + * draft/man2/setresuid.2: [JM:10964] + +Sat May 22 18:02:54 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10963] + * draft/man2/poll.2: [JM:10963] + +Sat May 22 16:47:41 2004 Yuichi SATO + + * {draft,release}/man3/rpc.3 : typo fix. + +Fri May 21 06:02:38 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10961] + * draft/man2/mlockall.2: [JM:10961] + +Wed May 19 06:03:32 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10957] + * draft/man2/ioctl_list.2: [JM:10957] + +Wed May 19 06:03:31 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10955] + * draft/man2/fdatasync.2: [JM:10955] + +Wed May 19 06:03:30 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10954] + * draft/man2/dup.2: [JM:10954] + +Wed May 19 06:03:28 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10953] + * draft/man2/brk.2: [JM:10953] + +Wed May 19 00:08:40 2004 Yuichi SATO + + * original/* : LDP man-pages 1.66 ¤Ë¹¹¿·¡£ + remap_file_pages.2, sk98lin.4, elf.5 ¤¬Äɲ䵤줿¡£ + * futex.2, nice.2, prctl.2, daemon.3, setbuf.3, psignal.3, + protocols.5, locale.5, raw.7, udp.7 : 1.64->1.66 ¤Îº³ºÙ¤ÊÊѹ¹¤ò + draft, release ¤ËÈ¿±Ç¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¡£ + * draft/man3/psignal.3 : draft ¥Õ¥¡¥¤¥ë¤¬¤Ê¤«¤Ã¤¿¤Î¤Ç¡¢ + release/man3/psignal.3 ¤Ë¸¶Ê¸¤ò¥³¥á¥ó¥È¤·¤¿¤â¤Î¤ò + ²Ã¤¨¤ÆºîÀ®¤·¤¿¡£ + * draft/man5/protocols.5 : ¸¶Ê¸¤ò¥³¥á¥ó¥È¤·¤¿¤â¤Î¤òÄɲᣠ+ +Tue Apr 20 02:16:24 2004 Yuichi SATO + + * {draft,release}/man2/chmod.2, + {draft,release}/man5/termcap.5: fix typo [JM:10884]. + +Sat Apr 17 02:16:44 2004 Yuichi SATO + + * {draft,release}/man5/proc.5 : typo ¤Î½¤Àµ¡£ + +Thu Apr 15 03:23:54 2004 Yuichi SATO + + * {draft,release}/man7/regex.7 : fix typo [JM:10864]. + +Thu Apr 15 00:26:56 2004 Yuichi SATO + + * {draft,release}/man2/accept.2 : fix typo [JM:10859]. + +Sun Mar 21 03:03:14 2004 Yuichi SATO + + * release/man2/rename.2: fix typo [JM:10857]. + +Fri Mar 12 02:33:06 2004 Yuichi SATO + + * chown.2 : 1.64 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Mon Mar 8 05:47:24 2004 SEKINE Tatsuo + + * release/man2/readv.2: [JM:10775]¤Ç¤Î»ØŦ¤òÈ¿±Ç + * draft/man2/readv.2: ditto. + +Mon Mar 8 01:25:07 2004 SEKINE Tatsuo + + * release/man7/icmp.7: fix typo ([JM:10839]) + * draft/man7/icmp.7: ditto. + * draft/man2/uselib.2: fix typo ([JM:10839]) + * release/man2/uselib.2: ditto. + * draft/man2/vfork.2: fix typo ([JM:10839]) + * release/man2/vfork.:2 ditto. + +Wed Mar 3 01:22:24 2004 Yuichi SATO + + * draft/man3/fnmatch.3 : [JM:10829] ¤Ç¤Î¸æ»ØŦ¤òÈ¿±Ç¡£ + ¸¶Ê¸¤ò¥³¥á¥ó¥È¤È¤·¤ÆÄɲᣠ+ .TH ¤ò¸¶Ê¸¤Ë¹ç¤ï¤»¤Æ½¤Àµ¡£ + * release/man3/fnmatch.3: ¾åµ­¤Î draft ¤ò¤â¤È¤Ë¹¹¿·¡£ + +Sun Feb 29 18:03:01 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10826] + * draft/man2/chown.2: [JM:10826] + +Sat Feb 28 01:22:57 2004 Yuichi SATO + + * {draft, release}/man5/services.5 : fix typo [JM:10822]. + +Tue Feb 24 00:54:42 2004 SEKINE Tatsuo + + * release/man2/ptrace.2: remove mail header([JM:10812]). + +Mon Feb 16 19:23:12 2004 Norihiro Hattori + + * draft/man3/wcpcpy.3: fix typo ([JM:10799]). + +Mon Feb 16 02:09:38 2004 TAKEI Nobumitsu + + * release/man3/bzero.3: fix typo ([JM:10798]). + * draft/man3/bzero.3: ditto. + * release/man3/mbtowc.3: ditto. + * draft/man3/mbtowc.3: ditto. + * release/man2/mlock.2: ditto. + * draft/man2/mlock.2: ditto. + * release/man2/mlockall.2: ditto. + +Sat Feb 7 00:12:00 2004 Yuichi SATO + + * getrlimit.2, signal.2, + encrypt.3, hsearch.3, stdio.3: 1.64 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sat Jan 17 06:03:19 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10698] + * draft/man3/stdio.3: [JM:10698] + +Sat Jan 17 06:03:19 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10697] + * draft/man3/hsearch.3: [JM:10697] + +Sat Jan 17 06:03:18 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10696] + * draft/man3/encrypt.3: [JM:10696] + +Sat Jan 17 06:03:17 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10695] + * draft/man2/signal.2: [JM:10695] + +Sat Jan 17 06:03:16 JST 2004 JM ML to CVS Gateway + + * translation_list: [JM:10694] + * draft/man2/getrlimit.2: [JM:10694] + +Sat Jan 17 00:22:04 JST 2004 Yuichi SATO + + * open.2, a64l.3, gethostbyname.3, memchr.3, acct.5, proc.5: + 1.64 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Mon Dec 15 14:40:24 2003 GOTO Masanori + + * release/man2/getsockopt.2: fix the fifth arguments from int to + socklen_t followed by the latest standard and manpages. + * draft/man2/getsockopt.2: likewise. + +Mon Dec 15 01:01:23 2003 TAKEI Nobumitsu + + * release/man2/capget.2: fix typo. + * draft/man2/capget.2: ditto. + +Sun Dec 14 03:37:42 2003 Akihiro MOTOKI + + * release/man7/semctl.2, draft/man7/semctl.2: + [JM:10628] ¤Ç¤Î»ØŦ»ö¹à (´ØÏ¢¹àÌܤËsemphore¤È´Ø·¸¤Î¤Ê¤¤¶¦Í­¥á¥â¥ê + ´ØÏ¢¤Î¥Ú¡¼¥¸¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë)¤ò½¤Àµ¡£ + +Sat Dec 13 18:02:41 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10666] + * draft/man7/capabilities.7: [JM:10666] + +Sat Dec 13 00:21:50 2003 Akihiro MOTOKI + + * {release,draft}/man7/{raw,udp}.7: [JM:10626] ¤Ç¤Î»ØŦ»ö¹à¤ò + ½¤Àµ (IP_PMTU_DISCOVER->IP_MTU_DISCOVER) + +Fri Dec 12 21:47:34 2003 TAKEI Nobumitsu + + * release/man2/sysctl.2: typo fix ([JM:10661]). + +Thu Dec 4 00:20:39 2003 Akihiro MOTOKI + + * {draft,release}/man3/undocumented.3, tanh.3, tan.3, syslog.3, + sqrt.3, sinh.3, sincos.3, sin.3, putpwent.3, printf.3, pow.3, + nextafter.3, modf.3, log10.3, log.3, initgroups.3, grantpt.3, + getpwent.3, getpw.3, getpt.3, getipnodebyname.3, frexp.3, fmod.3, + fgetgrent.3, expm1.3, exp2.3, exp10.3, exp.3, errno.3, erf.3, + cosh.3, cos.3, atanh.3, atan2.3, atan.3, asinh.3, asin.3, acosh.3, + acos.3: 1.63->1.64 ¤Îº³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + + * release/man3/drem.3: ºï½ü(original¤Çremainder.3¤Ø¤Î¥ê¥ó¥¯¤ËÊѹ¹) + +Wed Dec 3 10:29:18 2003 TAKEI Nobumitsu + + * release/man1/intro.1: s/Meja/Maja/ ([JM:10654]) + * draft/man1/intro.1: ditto. + +Tue Dec 2 07:53:28 2003 Akihiro MOTOKI + + * {draft,release}/semctl.2, stat.2, fgetpwent.3, environ.5, + hosts.5, ipc.5, utmp.5, ascii.7, ip.7, packet.7: + 1.63->1.64 ¤Îº³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + +Tue Dec 2 07:10:23 2003 Akihiro MOTOKI + + * original/: update original (LDP_man-pages_1_64) + +Sun Nov 30 01:20:51 2003 Akihiro MOTOKI + + * {draft,release}/man3/abs.3, atoi.3, cmsg.3, ctime.3, dlopen.3, + ether_aton.3, fgetgrent.3, ftw.3, gamma.3, getpt.3, getpwent.3, + log10.3, malloc_hook.3, memcmp.3, memcpy.3, memmove.3, memset.3, + qecvt.3, setlocale.3, stpcpy.3, stpncpy.3, strcasecmp.3, strcat.3, + strchr.3, strcpy.3, strtol.3, tempnam.3, undocumented.3, wcpcpy.3, + wcpncpy.3, wmemcpy.3 : original 1.60¢ª1.63 ¤Îº³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + * {draft, release}/man3/ldiv.3: original ¤¬ link page ¤Ë¤Ê¤Ã¤¿¤¿¤á¡¢ + ºï½ü + +Thu Nov 27 06:01:46 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10644] + * draft/man5/proc.5: [JM:10644] + +Thu Nov 27 06:01:46 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10643] + * draft/man5/acct.5: [JM:10643] + +Thu Nov 27 06:01:45 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10642] + * draft/man3/memchr.3: [JM:10642] + +Thu Nov 27 06:01:44 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10641] + * draft/man3/gethostbyname.3: [JM:10641] + +Thu Nov 27 06:01:44 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10640] + * draft/man3/a64l.3: [JM:10640] + +Thu Nov 27 06:01:43 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10639] + * draft/man2/open.2: [JM:10639] + +Mon Nov 24 06:51:31 2003 Akihiro MOTOKI + + * original 1.60¢ª1.63 ¤Îº³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + ldd.1, intro.2, dsp56k.4, fd.4, fifo.4, futex.4, lp.4, mouse.4, + tty.4, charmap.5, ftpusers.5, hosts.5, locale.5, nscd.conf.5, + passwd.5, utmp.5, LDP.7, boot.7, ld.so.8, ldconfig.8, nscd.8, sync.8 + +Mon Nov 24 06:00:10 2003 Akihiro MOTOKI + + * original/: update original (LDP_man-pages_1_63) + +Sat Nov 22 02:22:10 2003 SEKINE Tatsuo + + * {draft,release}/man5/ipc.5: [JM:10634] typo fix + +Sat Nov 15 00:01:40 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10633] + * draft/man2/futex.2: [JM:10633] + * release/man2/futex.2: [JM:10633] + +Sat Nov 15 00:01:38 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10632] + * draft/man4/futex.4: [JM:10632] + * release/man4/futex.4: [JM:10632] + +Sat Nov 15 00:01:37 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10631] + * draft/man2/mprotect.2: [JM:10631] + * release/man2/mprotect.2: [JM:10631] + +Sat Nov 15 00:01:36 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10630] + * draft/man2/msync.2: [JM:10630] + * release/man2/msync.2: [JM:10630] + +Thu Nov 13 03:41:23 JST 2003 Kentaro Shirakata + + * getdents.2, getresuid.2, getsockopt.2, ioperm.2, + iopl.2, mlock.2, munlock.2, ptrace.2, reboot.2, recv.2, + rmdir.2, sched_rr_get_interval.2, bstring.3, fenv.3, fmod.3, + frexp.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sat Nov 1 01:27:17 JST 2003 Yuichi SATO + + * proc.5, ip.7: 1.60 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sat Oct 25 18:01:44 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10612] + * draft/man2/futex.2: [JM:10612] + +Sat Oct 25 18:01:42 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10611] + * draft/man4/futex.4: [JM:10611] + +Sat Oct 25 12:01:43 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10609] + * draft/man2/msync.2: [JM:10609] + +Sat Oct 25 00:01:43 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10608] + * draft/man2/mprotect.2: [JM:10608] + +Wed Oct 22 13:15:41 2003 NAKANO Takeo + + * draft,release/man7/socket.7: pending ¤ÎÌõ¸ì¤ò¡ÖÊÝα¡×¤Ë¤·¤¿. + +Sat Oct 18 06:01:45 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10592] + * draft/man2/munlock.2: [JM:10592] + +Sat Oct 18 06:01:44 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10591] + * draft/man3/frexp.3: [JM:10591] + +Sat Oct 18 06:01:42 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10590] + * draft/man3/fmod.3: [JM:10590] + +Sat Oct 18 06:01:42 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10589] + * draft/man3/fenv.3: [JM:10589] + +Sat Oct 18 06:01:40 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10588] + * draft/man3/bstring.3: [JM:10588] + +Sat Oct 18 06:01:39 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10587] + * draft/man5/proc.5: [JM:10587] + +Thu Oct 16 12:01:46 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10580] + * draft/man7/ip.7: [JM:10580] + +Wed Oct 15 03:48:40 2003 Yuichi SATO + + * gettimeofday.2, llseek.2, mmap2.2, + open.2, sched_setaffinity.2, statfs.2, + dirfd.3, encrypt.3, getopt.3, stdio.3, + host.conf.5: 1.60 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sun Oct 12 12:01:44 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10563] + * draft/man2/mlock.2: [JM:10563] + +Sun Oct 12 12:01:43 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10562] + * draft/man2/iopl.2: [JM:10562] + +Sun Oct 12 12:01:42 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10561] + * draft/man2/ioperm.2: [JM:10561] + +Sun Oct 12 12:01:41 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10560] + * draft/man2/getsockopt.2: [JM:10560] + +Sun Oct 12 12:01:39 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10559] + * draft/man2/getresuid.2: [JM:10559] + +Sun Oct 12 12:01:37 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10558] + * draft/man2/getdents.2: [JM:10558] + +Sun Oct 12 09:02:30 JST 2003 Kentaro Shirakata + + * modify_ldt.2: ¤µ¤µ¤¤¤ÊÊѹ¹¤ò¹¹¿·¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sun Oct 12 00:01:45 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10549] + * draft/man2/sched_rr_get_interval.2: [JM:10549] + +Sun Oct 12 00:01:43 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10548] + * draft/man2/rmdir.2: [JM:10548] + +Sun Oct 12 00:01:42 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10547] + * draft/man2/recv.2: [JM:10547] + +Sun Oct 12 00:01:42 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10546] + * draft/man2/reboot.2: [JM:10546] + +Sun Oct 12 00:01:40 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10545] + * draft/man2/ptrace.2: [JM:10545] + +Sat Oct 11 20:17:48 JST 2003 Kentaro Shirakata + + * brk.2, capget.2: ¤µ¤µ¤¤¤ÊÊѹ¹¤ò¹¹¿·¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sat Oct 11 19:32:59 JST 2003 Kentaro Shirakata + + * semop.2, wait.2, wait4.2, insque.3, isinf.3, modf.3, + sqrt.3, updwtmp.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Tue Oct 7 00:00:57 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10543] + +Tue Sep 30 06:05:12 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10532] + * draft/man2/lookup_dcookie.2: [JM:10532] + +Tue Sep 30 06:05:09 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10531] + * draft/man2/nanosleep.2: [JM:10531] + +Mon Sep 29 23:52:43 2003 Akihiro MOTOKI + + * release/man?/{gettid.2, mmap.2, exp10.3, exp2.3, expm1.3, + openpty.3, posix_memalign.3, tty4}: ¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­È¿±Ç + +Mon Sep 29 00:05:02 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10530] + * draft/man7/glob.7: [JM:10530] + * release/man7/glob.7: [JM:10530] + +Mon Sep 29 00:05:01 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10529] + * draft/man3/getenv.3: [JM:10529] + * release/man3/getenv.3: [JM:10529] + +Sun Sep 28 00:07:24 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10526] + * draft/man3/getenv.3: [JM:10526] + +Wed Sep 24 00:05:03 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10522] + * draft/man3/expm1.3: [JM:10522] + +Wed Sep 24 00:05:01 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10521] + * draft/man3/exp2.3: [JM:10521] + +Wed Sep 24 00:04:59 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10520] + * draft/man3/exp10.3: [JM:10520] + +Tue Sep 23 19:19:03 2003 Akihiro MOTOKI + + * draft/man3/{log10.3,log1p.3,pow.3}: ML ¤Ç¤Î»ØŦȿ±Ç + * release/man3/{exp.3,log.3,log10.3,log1p.3,pow.3,sincos.3, + iso_8859-16.7}: ¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­È¿±Ç + +Mon Sep 15 18:04:03 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10499] + * draft/man3/posix_memalign.3: [JM:10499] + +Mon Sep 15 18:04:02 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10498] + * draft/man3/openpty.3: [JM:10498] + +Mon Sep 15 00:04:57 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10491] + * draft/man4/tty.4: [JM:10491] + +Mon Sep 15 00:04:56 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10490] + * draft/man2/mmap.2: [JM:10490] + +Sun Sep 14 18:04:48 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10484] + * draft/man3/updwtmp.3: [JM:10484] + +Sun Sep 14 18:04:48 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10483] + * draft/man3/insque.3: [JM:10483] + +Sun Sep 14 18:04:47 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10482] + * draft/man3/sqrt.3: [JM:10482] + +Sun Sep 14 18:04:46 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10481] + * draft/man3/modf.3: [JM:10481] + +Sun Sep 14 18:04:44 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10480] + * draft/man3/isinf.3: [JM:10480] + +Sun Sep 14 18:04:43 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10477] + * draft/man2/gettid.2: [JM:10477] + +Sun Sep 14 05:33:39 JST 2003 Kentaro Shirakata + + * lseek.2, personality.2, sendfile.2, stime.2, sync.2, dlopen.2, + ffs.3, termios.3, undocumented.3, usleep.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sat Sep 13 02:54:58 2003 Akihiro MOTOKI + + * draft/man7/iso_8859-16.7: [JM:10468] ÇòÊý¤µ¤ó¤Î»ØŦÆâÍƤò½¤Àµ + +Fri Sep 12 06:05:13 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10473] + * draft/man2/wait4.2: [JM:10473] + +Fri Sep 12 06:05:13 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10472] + * draft/man2/wait.2: [JM:10472] + +Fri Sep 12 06:05:12 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10471] + * draft/man2/semop.2: [JM:10471] + +Fri Sep 12 01:12:43 2003 Akihiro MOTOKI + + * release/man3/cbrt.3: ¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­È¿±Ç + +Fri Sep 12 00:04:19 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10463] + * draft/man3/exp.3: [JM:10463] + +Fri Sep 12 00:04:18 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10462] + * draft/man3/sincos.3: [JM:10462] + +Fri Sep 12 00:04:17 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10461] + * draft/man3/log1p.3: [JM:10461] + +Fri Sep 12 00:04:16 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10460] + * draft/man3/log10.3: [JM:10460] + +Fri Sep 12 00:04:15 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10459] + * draft/man3/log.3: [JM:10459] + +Fri Sep 12 00:04:14 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10458] + * draft/man3/pow.3: [JM:10458] + +Fri Sep 12 00:04:11 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10457] + * draft/man7/iso_8859-16.7: [JM:10457] + +Wed Sep 10 04:14:43 JST 2003 Akihiro MOTOKI + + * translation_list: + - log.3,log10.3,log1p.3,pow.3 ¼ïÊÌÊѹ¹ (link ¢ª roff) + - log/pow ´ØÏ¢¤Î link page ¤Î»²¾ÈÀ轤Àµ + - iso_8859-*.7 ¤Î¾õÂÖ¹¹¿· (²¼µ­) + * iso_8859-{1,2,7,9,15}.7: ¸¶Ê¸¤Îº³ºÙ¤ÊÊѹ¹¤ËÂбþ + +Mon Sep 8 12:05:26 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10449] + * draft/man2/sync.2: [JM:10449] + +Mon Sep 8 12:05:25 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10448] + * draft/man2/sendfile.2: [JM:10448] + +Mon Sep 8 12:05:25 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10447] + * draft/man2/stime.2: [JM:10447] + +Mon Sep 8 12:05:24 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10446] + * draft/man2/semop.2: [JM:10446] + +Mon Sep 8 12:05:23 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10445] + * draft/man2/lseek.2: [JM:10445] + +Mon Sep 8 00:04:55 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10444] + * draft/man5/host.conf.5: [JM:10444] + +Sun Sep 7 18:04:47 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10443] + * draft/man3/stdio.3: [JM:10443] + +Sun Sep 7 18:04:46 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10442] + * draft/man3/getopt.3: [JM:10442] + +Sun Sep 7 18:04:45 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10441] + * draft/man3/encrypt.3: [JM:10441] + +Sun Sep 7 06:04:35 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10440] + * draft/man3/dirfd.3: [JM:10440] + +Sun Sep 7 06:04:34 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10439] + * draft/man2/statfs.2: [JM:10439] + +Sun Sep 7 00:04:23 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10438] + * draft/man2/sched_setaffinity.2: [JM:10438] + +Sat Sep 6 18:07:33 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10435] + * draft/man2/mmap2.2: [JM:10435] + +Sat Sep 6 18:07:32 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10434] + * draft/man2/llseek.2: [JM:10434] + +Sat Sep 6 18:07:31 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10433] + * draft/man2/gettimeofday.2: [JM:10433] + +Sat Sep 6 12:04:27 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10431] + * draft/man2/open.2: [JM:10431] + +Sat Sep 6 10:55:03 2003 Yuichi SATO + + * mincore.2, mknod.2: v1.60 ¤ËÂбþ¤µ¤»¤¿ËÝÌõ¤ò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Tue Sep 2 02:43:08 2003 Akihiro MOTOKI + + * translation_list: tcsetpgrp.3 ¤Î¥ê¥ó¥¯¡¦¥¹¥Æ¡¼¥¿¥¹Êѹ¹ + +Tue Sep 2 02:22:54 2003 Akihiro MOTOKI + + * {release,draft}/ cabs.3, cacos.3, cacosh.3, carg.3, casin.3, + casinh.3, catan.3, catanh.3, ccos.3, ccosh.3, cerf.3, cexp.3, + cexp2.3, cimag.3, clog.3, clog10.3, clog2.3, conj.3, cpow.3, + cproj.3, creal.3, csin.3, csinh.3, csqrt.3, ctan.3, ctanh.3, + complex.5: ¥ê¥ê¡¼¥¹ (& ¥³¥á¥ó¥ÈÈ¿±Ç [JM:10397-10407,10409]) + * translation_list: ¾åµ­È¿±Ç + +Mon Sep 1 06:04:41 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10424] + * draft/man3/usleep.3: [JM:10424] + +Mon Sep 1 06:04:40 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10423] + * draft/man3/undocumented.3: [JM:10423] + +Mon Sep 1 06:04:40 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10422] + * draft/man3/termios.3: [JM:10422] + +Mon Sep 1 06:04:39 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10421] + * draft/man3/ffs.3: [JM:10421] + +Mon Sep 1 06:04:38 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10420] + * draft/man3/dlopen.3: [JM:10420] + +Mon Sep 1 00:51:52 JST 2003 Kentaro Shirakata + + * {draft, release}/man7/signal.7: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Tue Aug 29 00:40:52 2003 Akihiro MOTOKI + + * get_thread_area.2, sched_setscheduler.2, select.2, select_tut.2, + send.2, socket.2, socketpair.2, ctime.3, j0.3, readdir.3, + scandir.3, strftime.3, strtol.3, strtoul.3, tcgetsid.3, wcwidth.3, + initrd.4, ascii.7, charsets.7, hier.7, tcp.7, udp.7, x25.7 (°Ê¾å + draft/release ¤È¤â), acos.3, acosh.3, asin.3, asinh.3, atan.3, + atan2.3, atanh.3, cos.3, cosh.3, erf.3, sin.3, sinh.3, tan.3, + tanh.3 (°Ê¾å release ¤Î¤ß): original(1.57¢ª1.60)¤Îº³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + +Thu Aug 28 00:54:10 2003 Akihiro MOTOKI + + * original/: update original (LDP_man-pages_1_60) + +Tue Aug 5 01:35:13 2003 Akihiro MOTOKI + + * original/: update original (LDP_man-pages_1_58) + +Sun Aug 3 18:04:58 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10390] + * draft/man3/carg.3: [JM:10390] + +Sun Aug 3 18:04:57 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10389] + * draft/man3/cpow.3: [JM:10389] + +Sun Aug 3 18:04:56 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10388] + * draft/man3/csqrt.3: [JM:10388] + +Sun Aug 3 18:04:55 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10387] + * draft/man3/conj.3: [JM:10387] + +Sun Aug 3 18:04:54 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10386] + * draft/man3/cexp2.3: [JM:10386] + +Sun Aug 3 18:04:53 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10385] + * draft/man3/clog2.3: [JM:10385] + +Sun Aug 3 18:04:52 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10384] + * draft/man3/clog10.3: [JM:10384] + +Sun Aug 3 18:04:51 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10383] + * draft/man3/clog.3: [JM:10383] + +Sun Aug 3 18:04:50 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10393] + * draft/man5/complex.5: [JM:10393] + +Sun Aug 3 18:04:49 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10392] + * draft/man3/cproj.3: [JM:10392] + +Sun Aug 3 18:04:48 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10391] + * draft/man3/cerf.3: [JM:10391] + +Sun Aug 3 18:04:47 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10382] + * draft/man3/cexp.3: [JM:10382] + +Wed Jul 30 06:04:31 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10380] + * draft/man2/open.2: [JM:10380] + +Tue Jul 29 00:08:58 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10370] + * draft/man3/casin.3: [JM:10370] + +Tue Jul 29 00:08:57 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10369] + * draft/man3/cacos.3: [JM:10369] + +Tue Jul 29 00:08:56 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10368] + * draft/man3/ctanh.3: [JM:10368] + +Tue Jul 29 00:08:55 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10367] + * draft/man3/csinh.3: [JM:10367] + +Tue Jul 29 00:08:54 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10366] + * draft/man3/ccosh.3: [JM:10366] + +Tue Jul 29 00:08:53 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10365] + * draft/man3/csin.3: [JM:10365] + +Tue Jul 29 00:08:52 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10364] + * draft/man3/ccos.3: [JM:10364] + +Tue Jul 29 00:08:51 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10363] + * draft/man3/ctan.3: [JM:10363] + +Tue Jul 29 00:08:50 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10377] + * draft/man3/cimag.3: [JM:10377] + +Tue Jul 29 00:08:49 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10376] + * draft/man3/creal.3: [JM:10376] + +Tue Jul 29 00:08:48 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10375] + * draft/man3/cabs.3: [JM:10375] + +Tue Jul 29 00:08:47 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10374] + * draft/man3/catanh.3: [JM:10374] + +Tue Jul 29 00:08:46 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10373] + * draft/man3/casinh.3: [JM:10373] + +Tue Jul 29 00:08:45 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10372] + * draft/man3/cacosh.3: [JM:10372] + +Tue Jul 29 00:08:41 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10371] + * draft/man3/catan.3: [JM:10371] + +Tue Jul 29 00:08:40 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10362] + * draft/man3/cbrt.3: [JM:10362] + +Sat Jul 26 18:04:34 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10360] + * draft/man2/mknod.2: [JM:10360] + +Sat Jul 26 18:04:33 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10359] + * draft/man2/mincore.2: [JM:10359] + +Sat Jul 26 00:28:00 2003 Akihiro MOTOKI + + * ctime.3, lockf.3, popen.3, strerror.3, undocumented.3, undocumented.2: + LDP_man-pages 1.57 ¤Ç¤Îº³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: ¾åµ­¤Ëȼ¤¤¡¢¥¹¥Æ¡¼¥¿¥¹¤ò¹»Àµ½ªÎ»¤ËÊѹ¹ + +Fri Jul 25 03:20:12 2003 Akihiro MOTOKI + + * translation_list: Ê£ÁÇ¿ô´ØÏ¢¤Î¥Ú¡¼¥¸ (c*.3) ¤òͽÌó + +Fri Jul 25 02:48:41 2003 Akihiro MOTOKI + + * original/: update original (LDP_man-pages_1_57) + * translation_list: ¾åµ­È¿±Ç¡£Â¾¤ËÆüÉÕ¤¬ 0000/00/00 ¤Î¤â¤Î¤ò½¤Àµ + +Fri Jul 25 00:08:02 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10356] + * draft/man7/signal.7: [JM:10356] + +Wed Jul 23 06:04:42 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10353] + +Wed Jul 23 06:04:42 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10352] + +Wed Jul 23 06:04:41 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10351] + * draft/man2/readahead.2: [JM:10351] + +Wed Jul 23 06:04:40 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10350] + * draft/man3/tcgetsid.3: [JM:10350] + +Wed Jul 23 06:04:38 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10349] + * draft/man3/tcgetpgrp.3: [JM:10349] + +Fri Jul 18 06:04:06 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10347] + * draft/man2/clone.2: [JM:10347] + +Wed Jul 16 04:08:29 2003 Akihiro MOTOKI + + * select.2, mmap.2, errno.3: ÎëÌÚ¤µ¤ó¤Î¥³¥á¥ó¥ÈÈ¿±Ç & ËÝÌõ¹»Àµ + * getxattr.2, listxattr.2, removexattr.2, setxattr.2, + lookup_dcookie.2, getpt.3, grantpt.3, unlockpt.3, pts.4: + ¸À¤¤²ó¤·¤ò¾¯¤·½¤Àµ + * get_thread_area.2: section ÈÖ¹æ¤Î () È´¤±¤ò½¤Àµ [JM:10343] + * ¾åµ­¥Ú¡¼¥¸¤ò¥ê¥ê¡¼¥¹ + * getpagesize.2, msgget.2, set_thred_area.2, assert_perror.3: + ¥ê¥ê¡¼¥¹ (draft¤«¤é½¤Àµ¤Ê¤·) + +Tue Jul 15 10:27:30 2003 TAKEI Nobumitsu + + * release/man3/strftime.3: fix typo ([JM:10336][JM:10337]) + * draft/man3/strftime.3: ditto. + +Wed Jul 9 06:04:36 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10334] + * draft/man2/set_thread_area.2: [JM:10334] + +Wed Jul 9 06:04:35 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10333] + * draft/man2/get_thread_area.2: [JM:10333] + +Wed Jul 9 06:04:34 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10332] + * draft/man2/setxattr.2: [JM:10332] + +Wed Jul 9 06:04:33 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10331] + * draft/man3/assert_perror.3: [JM:10331] + +Wed Jul 9 06:04:32 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10330] + * draft/man2/getxattr.2: [JM:10330] + +Wed Jul 9 06:04:31 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10329] + * draft/man2/listxattr.2: [JM:10329] + +Wed Jul 9 06:04:29 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10328] + * draft/man2/removexattr.2: [JM:10328] + +Wed Jul 9 00:04:20 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10327] + * draft/man2/lookup_dcookie.2: [JM:10327] + +Wed Jul 9 00:04:19 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10326] + * draft/man3/grantpt.3: [JM:10326] + +Wed Jul 9 00:04:18 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10325] + * draft/man3/getpt.3: [JM:10325] + +Wed Jul 9 00:04:17 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10324] + * draft/man3/unlockpt.3: [JM:10324] + +Wed Jul 9 00:04:16 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10323] + * draft/man3/ptsname.3: [JM:10323] + +Wed Jul 9 00:04:14 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10322] + * draft/man4/pts.4: [JM:10322] + +Thu Jul 3 12:04:12 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10314] + * draft/man3/errno.3: [JM:10314] + +Thu Jul 3 12:04:12 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10313] + * draft/man2/mmap.2: [JM:10313] + +Thu Jul 3 12:04:11 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10312] + * draft/man2/msgget.2: [JM:10312] + +Thu Jul 3 12:04:11 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10311] + * draft/man2/getpagesize.2: [JM:10311] + +Thu Jul 3 12:04:10 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10310] + * draft/man2/select.2: [JM:10310] + +Wed Jul 2 21:18:37 2003 TAKEI Nobumitsu + + * release/man3/popen.3: upstream fix applied([JM:10306]). + +Tue Jul 1 06:04:47 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10308] + * draft/man2/gettid.2: [JM:10308] + * release/man2/gettid.2: [JM:10308] + +Mon Jun 30 17:20:35 2003 TAKEI Nobumitsu + + * release/man2/chdir.2: typo fix ([JM:10299]) + * draft/man2/chdir.2: ditto. + +Wed Jun 18 00:04:56 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10291] + * draft/man2/personality.2: [JM:10291] + +Sun Jun 1 21:33:31 2003 SEKINE Tatsuo + + * {draft,release}/man7/man.7: typo fix([JM:10142]¤Ë¤è¤ë»ØŦ) + +Thu May 22 19:19:00 2003 SEKINE Tatsuo + + * release/man3/memccpy.3: typo fix([JM:10232]¤Ë¤è¤ë»ØŦ) + +Mon Apr 14 23:42:36 JST 2003 Kentaro Shirakata + + * {draft, release}/man2/semget.2: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Wed Apr 9 00:04:21 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10144] + * draft/man2/semget.2: [JM:10144] + +Fri Mar 14 12:04:06 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10109] + * draft/man2/tkill.2: [JM:10109] + * release/man2/tkill.2: [JM:10109] + +Fri Mar 14 12:04:05 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10108] + * draft/man2/undocumented.2: [JM:10108] + * release/man2/undocumented.2: [JM:10108] + +Fri Mar 14 12:04:04 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10107] + * draft/man3/bzero.3: [JM:10107] + * release/man3/bzero.3: [JM:10107] + +Fri Mar 14 12:04:04 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10106] + * draft/man2/syslog.2: [JM:10106] + * release/man2/syslog.2: [JM:10106] + +Fri Mar 14 12:04:02 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10105] + * draft/man1/intro.1: [JM:10105] + * release/man1/intro.1: [JM:10105] + +Fri Mar 14 12:03:59 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10104] + * draft/man3/openpty.3: [JM:10104] + * release/man3/openpty.3: [JM:10104] + +Fri Mar 14 06:04:50 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10095] + * draft/man2/io_submit.2: [JM:10095] + * release/man2/io_submit.2: [JM:10095] + +Fri Mar 14 06:04:49 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10094] + * draft/man2/io_setup.2: [JM:10094] + * release/man2/io_setup.2: [JM:10094] + +Fri Mar 14 06:04:48 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10093] + * draft/man2/io_getevents.2: [JM:10093] + * release/man2/io_getevents.2: [JM:10093] + +Fri Mar 14 06:04:46 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10092] + * draft/man2/io_destroy.2: [JM:10092] + * release/man2/io_destroy.2: [JM:10092] + +Fri Mar 14 06:04:33 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10091] + * draft/man2/io_cancel.2: [JM:10091] + * release/man2/io_cancel.2: [JM:10091] + +Fri Mar 14 04:35:27 2003 Yuichi SATO + + * sigwaitinfo.2, proc.5: v1.56 ÂбþÈǤò¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Thu Mar 13 11:32:35 JST 2003 Kentaro Shirakata + + * setpgid.2, shmget.2, bcmp.3, bcopy.3, remove.3, scanf.3: + ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Mon Mar 10 18:03:51 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10072] + * draft/man3/envz_add.3: [JM:10072] + * release/man3/envz_add.3: [JM:10072] + +Mon Mar 10 18:03:50 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10071] + * draft/man3/argz_add.3: [JM:10071] + * release/man3/argz_add.3: [JM:10071] + +Mon Mar 10 18:03:49 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10069] + * draft/man3/gsignal.3: [JM:10069] + * release/man3/gsignal.3: [JM:10069] + +Mon Mar 10 18:03:48 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10070] + * draft/man3/err.3: [JM:10070] + * release/man3/err.3: [JM:10070] + +Mon Mar 10 18:03:45 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10068] + * draft/man3/shm_open.3: [JM:10068] + * release/man3/shm_open.3: [JM:10068] + +Sun Mar 9 00:04:06 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10047] + * draft/man2/io_getevents.2: [JM:10047] + +Sun Mar 9 00:04:05 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10046] + * draft/man2/io_destroy.2: [JM:10046] + +Sun Mar 9 00:04:04 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10045] + * draft/man2/io_cancel.2: [JM:10045] + +Sun Mar 9 00:04:03 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10044] + * draft/man2/io_submit.2: [JM:10044] + +Sun Mar 9 00:04:01 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10043] + * draft/man2/io_setup.2: [JM:10043] + +Sun Mar 9 00:03:59 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10042] + * draft/man3/openpty.3: [JM:10042] + +Thu Mar 6 21:20:51 2003 Akihiro Motoki + + * original/: update original (LDP man-pages 1.56) + * {release,draft}/ftw.3, release/unimplemented.2: º³ºÙ¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: ¾åµ­È¿±Ç + +Thu Mar 6 12:03:49 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10029] + * draft/man2/undocumented.2: [JM:10029] + +Thu Mar 6 12:03:49 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10028] + * draft/man3/bzero.3: [JM:10028] + +Thu Mar 6 12:03:47 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10027] + * draft/man2/tkill.2: [JM:10027] + +Thu Mar 6 12:03:46 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10026] + * draft/man2/syslog.2: [JM:10026] + +Thu Mar 6 12:03:44 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10025] + * draft/man2/gettid.2: [JM:10025] + +Thu Mar 6 06:04:09 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:10024] + * draft/man1/intro.1: [JM:10024] + +Sun Mar 2 00:03:19 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09998] + * draft/man5/proc.5: [JM:09998] + +Wed Feb 26 19:52:51 2003 NAKANO Takeo + + * inet_ntop.3: Äɽ¾Ï³¤ì¥Ð¥° ([JM:09988]) ¤Î½¤Àµ + +Sun Feb 23 14:37:46 JST 2003 Kentaro Shirakata + + * intro.1: ´°Á´¤ËÊѹ¹¤µ¤ì¤Æ¤¤¤ë¤Î¤Çµì¥Ú¡¼¥¸¤ò obsolete ¤Ë¡£ + * obsolete_list, translation_list: ¾åµ­È¿±Ç¡£ + +Sun Feb 23 06:03:33 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09954] + * draft/man3/scanf.3: [JM:09954] + +Sun Feb 23 06:03:32 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09953] + * draft/man3/bcmp.3: [JM:09953] + +Sun Feb 23 06:03:31 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09952] + * draft/man3/bcopy.3: [JM:09952] + +Sun Feb 23 06:03:31 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09951] + * draft/man2/shmget.2: [JM:09951] + +Sun Feb 23 06:03:30 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09950] + * draft/man2/setpgid.2: [JM:09950] + +Sun Feb 23 06:03:29 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09949] + * draft/man3/remove.3: [JM:09949] + +Fri Feb 21 06:03:59 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09935] + * draft/man2/sigwaitinfo.2: [JM:09935] + +Mon Feb 17 18:03:44 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09931] + * draft/man3/envz_add.3: [JM:09931] + +Mon Feb 17 18:03:43 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09930] + * draft/man3/argz_add.3: [JM:09930] + +Mon Feb 17 18:03:42 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09929] + * draft/man3/shm_open.3: [JM:09929] + +Mon Feb 17 18:03:41 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09928] + * draft/man3/err.3: [JM:09928] + +Mon Feb 17 18:03:37 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09927] + * draft/man3/gsignal.3: [JM:09927] + +Sun Feb 16 23:24:15 2003 Akihiro Motoki + + * original/: update original (LDP man-pages 1.55) + * kill.2, modify_ldt.2, recv.2, send.2, sysctl.2, unimplemented.2, + ctermid.3, string.3, termios.3, ttyname.3, xdr.3, ipc.5: ¸¶Ê¸¤Î¤µ + ¤µ¤¤¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: ¾åµ­È¿±Ç¡¢signal.7 ¤Ï original 1.48 °Ê¹ß¤ÎÊѹ¹ + ¤¬È¿±Ç¤µ¤ì¤Æ¤¤¤Ê¤¤¤¿¤áÍ×Êѹ¹¤ËÌ᤹¡£ + +Sat Feb 15 14:50:33 2003 Yuichi SATO + + * shmop.2, statfs.2: v1.54 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sat Feb 15 02:01:02 JST 2003 Yuichi SATO + + * sched_setaffinity.2: v1.54 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Fri Feb 14 03:56:43 JST 2003 Kentaro Shirakata + + * mount.2, semop.2, setgid.2, setpgid.2, syscalls.2, + wait.2, console_ioctl.4: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Fri Feb 14 02:54:07 2003 Akihiro Motoki + + * iso_8859-9.7: ¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­È¿±Ç + +Wed Feb 12 22:16:52 2003 Akihiro Motoki + + * select.2, key_setsecret.3, nextafter.3, socket.7: ¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­È¿±Ç + +Wed Feb 12 06:03:23 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09896] + * draft/man3/strftime.3: [JM:09896] + * release/man3/strftime.3: [JM:09896] + +Sun Feb 9 06:04:46 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09884] + * draft/man2/semop.2: [JM:09884] + +Fri Feb 7 06:03:45 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09882] + * draft/man2/setgid.2: [JM:09882] + +Fri Feb 7 06:03:43 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09881] + * draft/man2/setpgid.2: [JM:09881] + +Fri Feb 7 00:03:38 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09878] + * draft/man2/syscalls.2: [JM:09878] + +Mon Feb 3 00:06:29 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09864] + * draft/man7/socket.7: [JM:09864] + +Mon Feb 3 00:06:28 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09851] + * draft/man3/key_setsecret.3: [JM:09851] + +Mon Feb 3 00:06:24 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09850] + * draft/man3/nextafter.3: [JM:09850] + +Sun Feb 2 23:58:06 2003 Akihiro Motoki + + * draft/man5/locale.5, release/man5/locale.5: ²Õ¾ò½ñ¤­Éôʬ¤Îɽ¸½¤ò + ½¤Àµ(¹ÔƬ¤Î¡Ö¤Ï¡×¤ä¡Ö¤Î¾ì¹ç¤Ë¤Ï¡×¤Ê¤É¤òºï½ü) + +Sun Feb 2 22:49:51 2003 Akihiro Motoki + + * man5/charmap.5, man5/locale.5, man7/ascii.7, man7/iso_8859-1.7, + man7/iso_8859-2.7, man7/iso_8859-7.7, man7/iso_8859-2.9, + man7/iso_8859-15.7, koi8-r.7: ²¿¿Ê¿ô¤Îɽµ­¤ò¥¢¥é¥Ó¥¢¿ô»ú¤ËÊѹ¹ + (Îã: ½½¿Ê¿ô ¢ª 10 ¿Ê¿ô) [JM:09859] + +Sun Feb 2 20:20:55 2003 Akihiro Motoki + + * realpath.3, nan.3, readv.2, getumask.3, malloc_hook.3, mtrace.3, + unix.7: ¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­È¿±Ç + +Wed Jan 29 03:15:18 2003 Akihiro Motoki + + * draft/man7/iso_8859_{7,15}.7: original ¤Ç¤Ï iso_8859-{7,15}.7 + ¤Ø¤Î¥ê¥ó¥¯¤Ê¤Î¤Çºï½ü + +Tue Jan 28 06:04:08 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09817] + * draft/man4/console_ioctl.4: [JM:09817] + +Tue Jan 28 00:03:53 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09816] + * draft/man2/wait.2: [JM:09816] + +Tue Jan 28 00:03:51 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09815] + * draft/man2/mount.2: [JM:09815] + +Sun Jan 26 14:23:35 2003 Akihiro Motoki + + * draft/man3/nan.3: [JM:09790] ´Øº¬¤µ¤ó¤Î¥³¥á¥ó¥È¤òÈ¿±Ç + * draft/man3/realpath.3: [JM:09793] [JM:09794] ´Øº¬¤µ¤ó¡¢ÃæÌ¤ó + ¤Î¥³¥á¥ó¥È¤òÈ¿±Ç + +Sun Jan 26 00:15:10 2003 Akihiro Motoki + + * {draft,release}/man3/lgamma.3: [JM:09802] ÆâÅĤµ¤ó¤Î»ØŦ¤òÈ¿±Ç + +Sun Jan 26 00:03:40 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09805] + * draft/man7/socket.7: [JM:09805] + +Thu Jan 23 06:04:12 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09800] + * draft/man2/sched_setaffinity.2: [JM:09800] + +Mon Jan 20 06:06:15 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09791] + * draft/man7/iso_8859-9.7: [JM:09791] + +Mon Jan 20 06:06:14 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09789] + * draft/man3/realpath.3: [JM:09789] + +Mon Jan 20 06:06:11 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09788] + * draft/man3/nan.3: [JM:09788] + +Mon Jan 20 02:32:10 2003 Akihiro Motoki + + * {release,draft}/man5/utmp.5: ¸¶Ê¸¤Î editorial ¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: ¾åµ­È¿±Ç + +Mon Jan 20 00:03:49 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09787] + * draft/man2/select.2: [JM:09787] + +Mon Jan 20 00:03:48 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09786] + * draft/man3/strftime.3: [JM:09786] + +Sun Jan 19 21:47:10 2003 Akihiro Motoki + + * {release,draft}/man3/nl_langinfo.3, draft/man3/mtrace.3: + ¸¶Ê¸¤Î¤µ¤µ¤¤¤ÊÊѹ¹¤òÈ¿±Ç + * translation_list: ¾åµ­È¿±Ç + +Sun Jan 19 21:41:36 2003 Akihiro Motoki + + * man3/readv.3 ¤ò obsolete ¤Ë°ÜÆ° (1.54 ¤Ç original ¤è¤êºï½ü) + * obsolete_list: ¾åµ­È¿±Ç + +Sun Jan 19 18:03:12 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09785] + +Sat Jan 18 18:03:35 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09782] + * draft/man2/statfs.2: [JM:09782] + +Sat Jan 18 18:03:32 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09781] + * draft/man2/shmop.2: [JM:09781] + +Sat Jan 18 00:49:59 2003 SEKINE Tatsuo + + * gethostid.2: typo fix. + +Thu Jan 16 06:03:15 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09773] + * draft/man3/malloc_hook.3: [JM:09773] + +Thu Jan 16 06:03:14 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09772] + * draft/man7/unix.7: [JM:09772] + +Thu Jan 16 06:03:11 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09771] + * draft/man2/readv.2: [JM:09771] + +Thu Jan 16 02:59:38 2003 Kentaro Shirakata + + * dlopen.2: ¤µ¤µ¤¤¤ÊÊѹ¹¤ò¹¹¿·¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Thu Jan 16 01:35:33 2003 Akihiro Motoki + + * dup.2, select_tut.2: original 1.54 ¤ËÂбþ + * translation_list: ¾åµ­È¿±Ç + * {draft,release}/readv.3: origianl ¤«¤éºï½ü¤µ¤ì¤¿¤¿¤áºï½ü + (readv.2 ¤ËÅý¹ç) + +Wed Jan 15 06:04:21 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09767] + * draft/man3/mtrace.3: [JM:09767] + +Sat Jan 11 02:51:00 2003 Kentaro Shirakata + + * prctl.2, sched_setscheduler.2: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Thu Jan 9 18:03:47 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09759] + * draft/man3/getumask.3: [JM:09759] + +Wed Jan 9 00:51:22 2003 Akihiro Motoki + + * capget.2, ioctl_list.2, msync.2, sched_get_priority_max.2, + sched_setparam.2, sched_setscheduler.2, socket.2, vcs.4, + securetty.5, proc.5, ascii.7: original 1.54 ¤ËÂбþ. + * translation_list: ¾åµ­È¿±Ç. + * {draft,release}/tcp.7: ¸¶Ê¸¤ÎÈ¿±Ç±Ì¤ì¤ò½¤Àµ. + +Tue Jan 7 16:31:30 2003 NAKANO Takeo + + * tcp.7: ¸¶Ê¸Êѹ¹¤ÏÃæÌî¤ÎÁ÷¤Ã¤¿¥Ñ¥Ã¥Á¤Ê¤Î¤Ç¡¢¤½¤Îʬ¤À¤±È¿±Ç. + * translation_list: ¾åµ­È¿±Ç. + +Wed Jan 7 01:30:17 2003 Akihiro Motoki + + * original/: update original (LDP man-pages 1.54) + +Wed Jan 1 18:04:04 JST 2003 JM ML to CVS Gateway + + * translation_list: [JM:09723] + * draft/man2/sched_setscheduler.2: [JM:09723] + +Sun Dec 29 23:37:45 2002 NAKANO Takeo + + * (draft,release)/man3/nl_langinfo.3: fix typo [JM:09720] + +Fri Dec 20 06:03:07 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09716] + * draft/man2/prctl.2: [JM:09716] + +Sat Dec 14 19:04:45 JST 2002 JM ML to CVS Gateway + + * tcp.7 local release. + +Fri Dec 13 02:56:18 JST 2002 Kentaro Shirakata + + * getpeername.2, mount.2, mremap.2, msgop.2, getipnodebyname.3: + ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Wed Nov 27 00:03:07 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09675] + * draft/man2/mremap.2: [JM:09675] + +Wed Nov 27 00:03:05 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09674] + * draft/man2/getpeername.2: [JM:09674] + +Wed Nov 27 00:03:02 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09673] + * draft/man2/msgop.2: [JM:09673] + +Tue Nov 26 18:04:29 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09672] + * draft/man3/getipnodebyname.3: [JM:09672] + +Mon Nov 25 00:08:45 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09669] + * draft/man2/mount.2: [JM:09669] + +Sat Nov 16 20:56:32 JST 2002 Yuichi SATO + + * proc.5 : v1.53 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Fri Nov 15 18:03:49 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09654] + * draft/man7/tcp.7: [JM:09654] + +Fri Nov 15 00:15:20 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09652] + * draft/man7/locale.7: [JM:09652] + * release/man7/locale.7: [JM:09652] + +Thu Nov 14 22:35:02 JST 2002 Kentaro Shirakata + + * {draft, release}/man2/getdtablesize.2: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Tue Nov 12 00:03:47 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09650] + +Tue Nov 5 00:09:33 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09637] + * draft/man5/proc.5: [JM:09637] + +·î 11·î 4 20:08:54 JST 2002 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/open.2: [LOCAL] + * release/man2/open.2: [LOCAL] + +Wed Oct 16 06:03:58 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09625] + * draft/man2/getdtablesize.2: [JM:09625] + +Mon Oct 14 04:10:18 JST 2002 Kentaro Shirakata + + * kill.2, assert.3, clock.3, on_exit.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sun Oct 13 06:03:44 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09621] + * draft/man7/locale.7: [JM:09621] + +Sat Oct 12 19:28:56 2002 NAKANO Takeo + + * madvise.2, setlocale.3: released. + * translation_list: modified as such. + +Fri Oct 11 00:56:35 2002 Akihiro Motoki + + * °Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ò¥ê¥ê¡¼¥¹. + select.2, select_tut.2 + * translation_list: ¾åµ­È¿±Ç + +Thu Oct 10 07:00:07 2002 Akihiro Motoki + + * °Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ò¥ê¥ê¡¼¥¹. + accept.2, clone.2, ioctl.2, setfsgid.2, setfsuid.2, socketpair.2, + write.2, copysign.3, ecvt_r.3, ether_aton.3, gamma.3, j0.3, + lgamma.3, qecvt.3, signbit.3, strverscmp.3, system.3, tgamma.3 + * translation_list: ¾åµ­È¿±Ç + +Tue Oct 8 06:03:46 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09604] + * draft/man2/madvise.2: [JM:09604] + +Sat Sep 28 23:52:31 2002 NAKANO Takeo + + * °Ê²¼¤Î¥Õ¥¡¥¤¥ë¤Î¾®¤µ¤ÊÊѹ¹¤ò¹¹¿·. + iso_8859-15.7, iso_8859-2.7 iso_8859-7.7, locale.7, raw.7 + * translation_list: °Ê¾å¤òÈ¿±Ç. + +Fri Sep 27 06:04:08 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09552] + * draft/man3/clock.3: [JM:09552] + +Fri Sep 27 06:04:06 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09551] + * draft/man3/on_exit.3: [JM:09551] + +Fri Sep 27 06:04:04 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09550] + * draft/man2/kill.2: [JM:09550] + +Thu Sep 26 06:03:12 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09542] + +Thu Sep 26 00:03:55 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09535] + * draft/man3/setlocale.3: [JM:09535] + +Tue Sep 24 12:04:06 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09518] + * draft/man3/copysign.3: [JM:09518] + +Tue Sep 24 12:04:05 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09517] + * draft/man2/socketpair.2: [JM:09517] + +Tue Sep 24 12:04:04 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09516] + * draft/man2/write.2: [JM:09516] + +Tue Sep 24 12:04:03 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09515] + * draft/man2/setfsgid.2: [JM:09515] + +Tue Sep 24 12:04:01 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09514] + * draft/man2/setfsuid.2: [JM:09514] + +Tue Sep 24 12:04:00 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09513] + * draft/man2/ioctl.2: [JM:09513] + +Tue Sep 24 12:03:59 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09512] + * draft/man3/signbit.3: [JM:09512] + +Tue Sep 24 12:03:58 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09511] + * draft/man3/qecvt.3: [JM:09511] + +Tue Sep 24 12:03:57 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09524] + * draft/man2/clone.2: [JM:09524] + +Tue Sep 24 12:03:57 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09523] + * draft/man2/accept.2: [JM:09523] + +Tue Sep 24 12:03:56 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09522] + * draft/man3/j0.3: [JM:09522] + +Tue Sep 24 12:03:55 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09521] + * draft/man3/system.3: [JM:09521] + +Tue Sep 24 12:03:55 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09520] + * draft/man2/select_tut.2: [JM:09520] + +Tue Sep 24 12:03:54 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09519] + * draft/man2/select.2: [JM:09519] + +Tue Sep 24 12:03:50 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09510] + * draft/man3/ecvt_r.3: [JM:09510] + +Sun Sep 22 12:03:51 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09496] + * draft/man3/gamma.3: [JM:09496] + +Sun Sep 22 12:03:50 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09495] + * draft/man3/lgamma.3: [JM:09495] + +Sun Sep 22 12:03:49 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09494] + * draft/man3/tgamma.3: [JM:09494] + +Sun Sep 22 12:03:44 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09493] + * draft/man3/strverscmp.3: [JM:09493] + +Sun Sep 22 00:42:30 2002 NAKANO Takeo + + * (draft,release)/man3/setlocale.3: " ¤ò \*(lq, \*(rq ¥Þ¥¯¥í + ¤ËÃÖ¤­´¹¤¨ ([JM:09489]) + +Fri Sep 20 00:02:58 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09465] + * draft/man3/assert.3: [JM:09465] + +Thu Sep 19 06:03:05 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09461] + * draft/man2/open.2: [JM:09461] + +Thu Sep 19 03:12:54 JST 2002 Yuichi SATO + + * getrlimit.2, alloca.3, hosts.5: 1.53 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Wed Sep 18 06:04:12 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09437] + * draft/man3/ether_aton.3: [JM:09437] + +Sat Sep 14 02:18:17 JST 2002 Kentaro Shirakata + + * getpriority.2, shmget.2, socket.2, truncate.2, wait.2, times.2, + dlopen.3, getcwd.3, printf.3, strtol.3, strtoul.3, + sysconf.3, ttyname.3, iso_8859-1.7: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sat Aug 31 06:04:10 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09402] + * draft/man5/hosts.5: [JM:09402] + +Sat Aug 31 06:04:08 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09401] + * draft/man3/alloca.3: [JM:09401] + +Mon Aug 26 06:04:18 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09383] + * draft/man2/socket.2: [JM:09383] + +Mon Aug 26 00:14:02 JST 2002 Kentaro Shirakata + + * translation_list: getrlimit.2 ¤Î¥Ð¡¼¥¸¥ç¥óÉôʬ¤¬¤¦¤Þ¤¯¹¹¿·¤µ¤ì¤Æ + ¤¤¤Ê¤«¤Ã¤¿¤Î¤Ç¼êÆ°¤Ç¹¹¿·¡£ + +Sun Aug 25 06:04:28 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09382] + * draft/man2/getrlimit.2: [JM:09382] + +Thu Aug 22 00:07:55 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09373] + * draft/man2/truncate.2: [JM:09373] + +Wed Aug 21 18:04:58 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09372] + * draft/man2/times.2: [JM:09372] + +Wed Aug 21 18:04:58 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09371] + * draft/man2/wait.2: [JM:09371] + +Wed Aug 21 18:04:54 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09370] + * draft/man3/dlopen.3: [JM:09370] + +Tue Aug 20 04:27:14 JST 2002 JM ML to CVS Gateway + + * mmap2.2, msgctl.2, open.2, sigqueue.2, + syscall.2, unlink.2, a64l.3, clearenv.3, lockf.3, + ld.so.8, ldconfig.8: 1.52 ÂбþÈǤò¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sat Aug 17 06:04:05 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09364] + * draft/man3/getcwd.3: [JM:09364] + +Sat Aug 17 06:04:04 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09363] + * draft/man3/printf.3: [JM:09363] + +Sat Aug 17 00:10:15 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09362] + * draft/man3/strtoul.3: [JM:09362] + +Sat Aug 17 00:10:14 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09361] + * draft/man3/strtol.3: [JM:09361] + +Sat Aug 17 00:09:57 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09360] + * draft/man3/sysconf.3: [JM:09360] + +Fri Aug 16 18:08:51 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09359] + * draft/man3/ttyname.3: [JM:09359] + +Fri Aug 16 06:13:48 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09355] + * draft/man2/shmget.2: [JM:09355] + +Fri Aug 16 06:13:45 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09354] + * draft/man7/iso_8859-1.7: [JM:09354] + +Fri Aug 16 06:13:45 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09353] + * draft/man2/getpriority.2: [JM:09353] + +Fri Aug 16 02:04:18 2002 Akihiro Motoki + + * {draft,release}/mlock.2, posix_memalign.3, strstr.3, + undocumented.3, wcwidth.3, ttyS.4, tzfile.5: Catch up with the + upstream (trivial changes). + +Thu Aug 15 23:48:51 JST 2002 Akihiro Motoki + + * original/: update original (LDP man-pages 1.52) + +Wed Aug 14 02:40:34 JST 2002 Akihiro Motoki + + * mmap.2: release ([JM:09086]). + * stdio_ext.3: release & newly added ([JM:09068],[JM:09107]). + * services.5: minor fix up to 1.51. + * translation_list: ¾åµ­¤òÈ¿±Ç + +Wed Aug 7 22:27:24 JST 2002 NAKANO Takeo + + * getfsent.3, boot.7, bootparam.7: added & updated. + +Tue Aug 6 06:04:19 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09342] + * draft/man3/a64l.3: [JM:09342] + +Tue Aug 6 06:04:16 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09340] + * draft/man2/syscall.2: [JM:09340] + +Tue Aug 6 06:04:13 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09339] + * draft/man2/sigqueue.2: [JM:09339] + +Sat Aug 3 04:47:04 2002 Yuichi SATO + + * {draft,release}/man2/sigaction.2 : typo fix. + +Tue Jul 30 18:03:37 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09337] + * draft/man7/boot.7: [JM:09337] + +Thu Jul 18 06:03:51 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09329] + * draft/man2/mmap2.2: [JM:09329] + +Mon Jul 15 06:03:42 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09320] + * draft/man8/ldconfig.8: [JM:09320] + +Mon Jul 15 06:03:41 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09319] + * draft/man8/ld.so.8: [JM:09319] + +Mon Jul 15 06:03:41 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09318] + * draft/man3/lockf.3: [JM:09318] + +Mon Jul 15 06:03:40 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09317] + * draft/man3/clearenv.3: [JM:09317] + +Mon Jul 15 06:03:39 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09316] + * draft/man2/unlink.2: [JM:09316] + +Sun Jul 14 23:10:32 JST 2002 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/access.2: [LOCAL] + * release/man2/access.2: [LOCAL] + +Wed Jul 10 12:04:30 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09308] + * draft/man2/open.2: [JM:09308] + +Sat Jul 6 06:02:53 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09307] + * draft/man2/msgctl.2: [JM:09307] + +Sat Jul 6 06:02:52 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09306] + * draft/man2/getrlimit.2: [JM:09306] + +Mon Jun 17 06:02:51 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09303] + * draft/man2/access.2: [JM:09303] + +¶â 6·î 14 22:58:58 JST 2002 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/dirfd.3: [LOCAL] + * release/man3/dirfd.3: [LOCAL] + +¶â 6·î 14 22:58:12 JST 2002 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/shmop.2: [LOCAL] + * release/man2/shmop.2: [LOCAL] + +Sun Jun 2 06:02:46 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09273] + * draft/man2/select_tut.2: [JM:09273] + * release/man2/select_tut.2: [JM:09273] + +Sun Jun 2 06:02:42 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09272] + * draft/man2/select.2: [JM:09272] + * release/man2/select.2: [JM:09272] + +Tue May 14 19:30:34 JST 2002 Kentaro Shirakata + + * truncate.2, strtoul.3, syslog.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sun May 12 18:02:38 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09267] + * draft/man2/getpagesize.2: [JM:09267] + +Tue May 7 06:02:42 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09257] + * draft/man2/shmop.2: [JM:09257] + +Tue May 7 00:04:00 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09254] + * draft/man3/dirfd.3: [JM:09254] + +Mon May 6 00:46:30 2002 TAKEI Nobumitsu + + * release/man3/printf.3: typo fix ([JM:09251]). + * draft/man3/printf.3: likewise. + +Thu Apr 25 02:05:32 JST 2002 Yuichi SATO + + * {draft,release}/man3/fopen.3 : typo fix. + +Mon Apr 22 00:02:38 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09243] + * draft/man3/getfsent.3: [JM:09243] + +2002ǯ 4·î 21Æü ÆüÍËÆü 17:57:39 JST JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man7/bootparam.7: [LOCAL] + +Sat Apr 13 19:59:39 JST 2002 Yuichi SATO + + * difftime.3, getopt.3, memchr.3, readdir.3 : 1.48 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sat Apr 13 06:02:38 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09231] + * draft/man3/strtoul.3: [JM:09231] + +Sat Apr 13 06:02:37 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09230] + * draft/man3/syslog.3: [JM:09230] + +Sat Apr 13 06:02:35 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09229] + * draft/man2/truncate.2: [JM:09229] + +Sat Apr 13 02:08:50 JST 2002 Kentaro Shirakata + + * fopen.3, getcwd.3, strtok.3, strtol.3, environ.5, man.7: + ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Thu Mar 28 18:02:40 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09218] + * draft/man3/strtok.3: [JM:09218] + +Sun Mar 24 06:02:39 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09188] + * draft/man3/readdir.3: [JM:09188] + +Sun Mar 24 06:02:37 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09187] + * draft/man3/memchr.3: [JM:09187] + +Sun Mar 24 06:02:34 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09186] + * draft/man3/difftime.3: [JM:09186] + +Sun Mar 24 00:02:28 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09184] + * draft/man3/getopt.3: [JM:09184] + +Sun Mar 24 00:02:28 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09183] + * draft/man3/strtol.3: [JM:09183] + +Sun Mar 24 00:02:27 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09182] + * draft/man5/environ.5: [JM:09182] + +Sun Mar 24 00:02:25 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09181] + * draft/man3/getcwd.3: [JM:09181] + +Sat Mar 23 18:02:49 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09180] + * draft/man3/fopen.3: [JM:09180] + +Sat Mar 23 06:02:54 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09177] + * draft/man7/man.7: [JM:09177] + +Thu Mar 21 15:00:00 JST 2002 HANATAKA Shinya + + * original/*: man-pages-1.48 ¤Ë¹¹¿· + * {draft, release}/*: ¤µ¤µ¤¤¤ÊÊѹ¹¤ËľÀÜÂбþ¤µ¤»¤ë + * translation_list: ¾åµ­È¿±Ç + +Thu Feb 14 22:05:45 JST 2002 JM ML to CVS Gateway + + * ld.so.8, tsearch.3, stdio.3 + scandir.3, openpty.3, uname.2, ldd.1: ver.1.47 ¤ËÂбþ¤¹¤ë + ËÝÌõ¤ò¥ê¥ê¡¼¥¹ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sun Feb 10 00:02:51 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09096] + * draft/man2/select_tut.2: [JM:09096] + +Sun Feb 3 18:35:09 JST 2002 Kentaro Shirakata + + * getsid.2, crypt.3, mkstemp.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Fri Jan 25 06:02:41 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09067] + * draft/man3/stdio_ext.3: [JM:09067] + +Thu Jan 24 12:03:00 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09064] + +Thu Jan 24 12:02:59 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09063] + +Wed Jan 23 18:03:08 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09060] + * draft/man3/openpty.3: [JM:09060] + +Wed Jan 23 01:19:15 2002 Yuichi SATO + + * {draft,release}/man3/fwide.3 : typo fix. + * {draft,release}/man5/ipc.5 : typo fix. + * {draft,release}/man8/zic.8 : ¡Ö¥°¥ì¥´¥ê¥ªÎò¡×¢ª¡Ö¥°¥ì¥´¥ê¥ªÎñ¡× + +Tue Jan 22 18:02:43 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09056] + +Tue Jan 22 00:03:17 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09053] + * draft/man3/tsearch.3: [JM:09053] + +Mon Jan 21 12:30:19 JST 2002 JM ML to CVS Gateway + + * getloadavg.3: released locally. + +Sun Jan 20 15:11:42 2002 Yuichi SATO + + * release/man2/readdir.2 : typo fix. + +Sun Jan 20 12:03:24 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09050] + +Sun Jan 20 12:03:24 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09049] + * draft/man3/stdio.3: [JM:09049] + +Sun Jan 20 12:03:22 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09048] + * draft/man3/scandir.3: [JM:09048] + +Sun Jan 20 00:02:45 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09044] + +Sat Jan 19 18:02:34 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09043] + +Sat Jan 19 17:07:14 2002 Yuichi SATO + + * release/man2/nanosleep.2 : typo fix. + +Sat Jan 19 14:49:28 2002 Yuichi SATO + + * clone.2, dup.2, getsockopt.2, nanosleep.2, + quotactl.2, syscalls.2, time.2, + mbtowc.3, sysconf.3, wcpcpy.3, wcstombs.3, + console_ioctl.4, wavelan.4, environ.5, + charsets.7, regex.7 : typo fix. + +Sat Jan 19 06:03:30 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09036] + * draft/man3/crypt.3: [JM:09036] + +Fri Jan 18 18:03:57 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09034] + * draft/man2/uname.2: [JM:09034] + +Fri Jan 18 12:02:52 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09033] + * draft/man8/ld.so.8: [JM:09033] + +Thu Jan 17 18:02:43 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09032] + * draft/man1/ldd.1: [JM:09032] + +Thu Jan 17 06:02:40 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09026] + * draft/man2/getsid.2: [JM:09026] + +Thu Jan 17 06:02:34 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09025] + * draft/man3/mkstemp.3: [JM:09025] + +Tue Jan 15 12:02:57 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09021] + * draft/man2/mmap.2: [JM:09021] + +Mon Jan 14 22:32:53 JST 2002 Akihiro Motoki + + * release/man3/syslog.3: ver 1.47 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * {draft,release}/man3/{strptime,strftime.3}: broken-down¤ÎÌõ½¤Àµ¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Mon Jan 14 18:37:20 2002 Yuichi SATO + + * tzselect.8, proc.5, dir_colors.5, + strptime.3, hsearch.3, gethostbyname.3, daemon.3, catopen.3, + signal.2, semctl.2, select.2, open.2, + gettimeofday.2, gethostname.2, close.2: ver1.47 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¡£ + +Mon Jan 14 17:27:48 JST 2002 Kentaro Shirakata + + * kill.2, mount.2, truncate.2, ctime.3, ffs.3, getutent.3, + initgroups.3, printf.3, strftime.3, termios.3, + console.4, console_codes.4, charmap.5, charsets.7: + ¥ê¥ê¡¼¥¹¡£ + * tranlation_list: ¾åµ­È¿±Ç¡£ + +Mon Jan 14 16:12:50 JST 2002 JM ML to CVS Gateway + + °Ê²¼¤Î¥Ú¡¼¥¸¤ò local release. + units.7 hier.7 timegm.3 getdate.3 fpurge.3 dprintf.3 + asprintf.3 fcntl.2 + +Sun Jan 13 00:02:38 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09003] + * draft/man3/getloadavg.3: [JM:09003] + +Sun Jan 13 00:02:37 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:09002] + +Sat Jan 12 18:04:42 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08999] + * draft/man3/getdate.3: [JM:08999] + +Sat Jan 12 18:04:39 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08998] + * draft/man3/fpurge.3: [JM:08998] + +Sat Jan 12 18:04:36 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08996] + * draft/man3/asprintf.3: [JM:08996] + +Sat Jan 12 18:04:33 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08997] + * draft/man3/dprintf.3: [JM:08997] + +Thu Jan 10 06:05:41 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08977] + * draft/man5/proc.5: [JM:08977] + +Thu Jan 10 06:05:40 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08976] + * draft/man5/dir_colors.5: [JM:08976] + +Thu Jan 10 06:05:39 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08975] + * draft/man3/strptime.3: [JM:08975] + +Thu Jan 10 06:05:34 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08974] + * draft/man2/gethostname.2: [JM:08974] + +Thu Jan 10 00:09:01 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08972] + * draft/man3/strftime.3: [JM:08972] + +Thu Jan 10 00:08:49 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08970] + * draft/man2/truncate.2: [JM:08970] + +Thu Jan 10 00:07:22 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08969] + * draft/man3/initgroups.3: [JM:08969] + +Thu Jan 10 00:06:56 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08968] + * draft/man3/ffs.3: [JM:08968] + +Thu Jan 10 00:06:24 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08967] + * draft/man4/console_codes.4: [JM:08967] + +Thu Jan 10 00:06:18 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08966] + * draft/man4/console.4: [JM:08966] + +Wed Jan 9 18:08:29 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08965] + * draft/man5/charmap.5: [JM:08965] + +Sun Jan 6 12:02:38 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08956] + * draft/man2/fcntl.2: [JM:08956] + +Sun Jan 6 07:45:57 JST 2002 JM ML to CVS Gateway + + * dysize.3, fssko.3, ftok.3, tzset.3: released locally. + * translation_list: modified appropriately. + +Sat Jan 5 07:05:06 2002 NAKANO Takeo + + * {draft,release}/man3/strcpy.3: ¡ÖNUL ʸ»ú¡×¤ÇÅý°ì. + +Sat Jan 5 06:03:01 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08946] + * draft/man3/hsearch.3: [JM:08946] + +Sat Jan 5 00:02:57 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08940] + * draft/man3/syslog.3: [JM:08940] + +Sat Jan 5 00:02:54 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08939] + * draft/man7/charsets.7: [JM:08939] + +Fri Jan 4 18:03:02 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08938] + +Fri Jan 4 18:02:58 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08937] + * draft/man3/termios.3: [JM:08937] + +Fri Jan 4 00:02:40 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08936] + * draft/man3/printf.3: [JM:08936] + +Fri Jan 4 00:02:34 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08935] + * draft/man3/getutent.3: [JM:08935] + +Thu Jan 3 18:03:03 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08934] + * draft/man3/gethostbyname.3: [JM:08934] + +Thu Jan 3 18:03:02 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08933] + * draft/man3/ctime.3: [JM:08933] + +Thu Jan 3 18:03:02 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08932] + * draft/man2/mount.2: [JM:08932] + +Thu Jan 3 18:02:56 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08931] + * draft/man2/kill.2: [JM:08931] + +Thu Jan 3 13:03:54 JST 2002 Kentaro Shirakata + + * translation_list: assert.3 ¤ÏÌõʸ¤Ë±Æ¶Á¤Ê¤«¤Ã¤¿¤Î¤Ç¡û¤ËÊѹ¹¡£ + +Thu Jan 3 06:03:09 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08926] + * draft/man3/timegm.3: [JM:08926] + +Thu Jan 3 06:02:53 JST 2002 JM ML to CVS Gateway + + * translation_list: [JM:08925] + * draft/man7/units.7: [JM:08925] + +Wed Jan 2 16:32:10 JST 2002 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/semctl.2: [LOCAL] + +Wed Jan 2 16:31:44 JST 2002 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/open.2: [LOCAL] + +Wed Jan 2 14:28:34 2002 Yuichi SATO + + * draft/man2/select.2: ver.1.47 ¤Ç¤ÎÊѹ¹ÅÀ¤òÈ¿±Ç¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Wed Jan 2 08:17:02 JST 2002 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man7/units.7: [LOCAL] + +Wed Jan 2 02:23:28 JST 2002 Kentaro Shirakata + + * original/*: man-pages-1.47.tar.gz ¤«¤é¹¹¿·¡£ + * {draft, release}/*: ¤µ¤µ¤¤¤ÊÊѹ¹¤ò¹¹¿·¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Tue Jan 1 16:12:28 JST 2002 Kentaro Shirakata + + * kill.2, shmget.2, write.2, dlopen.3, ftime.3, perror.3, swab.3, + ttyname.3, environ.5, fs.5, rpc.5, man.7: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sun Dec 30 00:02:47 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08905] + * draft/man7/hier.7: [JM:08905] + +Sat Dec 29 00:03:50 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08899] + +Fri Dec 28 20:58:41 2001 NAKANO Takeo + + * draft/man3/strcpy.3: nulls ¤ÎÌõ¸ì¤ò NULL¢ª¥Ì¥ëʸ»ú ¤Ë¤·¤¿¡£ + +Thu Dec 27 06:02:56 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08887] + * draft/man2/kill.2: [JM:08887] + +Thu Dec 27 06:02:53 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08886] + * draft/man7/man.7: [JM:08886] + +Mon Dec 24 00:02:53 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08863] + * draft/man2/signal.2: [JM:08863] + +Sun Dec 23 18:02:31 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08862] + +Sun Dec 23 12:02:52 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08859] + * draft/man3/catopen.3: [JM:08859] + +Sun Dec 23 12:02:51 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08858] + * draft/man8/tzselect.8: [JM:08858] + +Sun Dec 23 12:02:50 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08857] + * draft/man3/daemon.3: [JM:08857] + +Sun Dec 23 06:03:19 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08856] + * draft/man2/select.2: [JM:08856] + +Sun Dec 23 06:03:19 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08855] + * draft/man2/gettimeofday.2: [JM:08855] + +Sun Dec 23 06:03:16 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08854] + * draft/man2/close.2: [JM:08854] + +Sat Dec 22 06:02:47 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08852] + * draft/man2/shmget.2: [JM:08852] + +Sat Dec 22 06:02:46 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08851] + * draft/man5/rpc.5: [JM:08851] + +Sat Dec 22 06:02:45 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08850] + * draft/man5/environ.5: [JM:08850] + +Sat Dec 22 00:03:03 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08849] + * draft/man5/fs.5: [JM:08849] + +Sat Dec 22 00:02:59 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08848] + * draft/man3/perror.3: [JM:08848] + +Fri Dec 21 18:02:28 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08847] + * draft/man3/ttyname.3: [JM:08847] + +Fri Dec 21 18:02:25 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08846] + * draft/man3/swab.3: [JM:08846] + +Fri Dec 21 18:02:25 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08845] + * draft/man3/dlopen.3: [JM:08845] + +Fri Dec 21 18:02:24 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08844] + * draft/man2/write.2: [JM:08844] + +Fri Dec 21 18:02:23 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08843] + * draft/man3/ftime.3: [JM:08843] + +Fri Dec 21 04:08:44 JST 2001 Kentaro Shirakata + + * access.2, getpriority.2, lseek.2, outb.2, wait.2, wait4.2, + ctime.3, fopen.3, ftw.3, malloc.3, mbrtowc.3: + ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Fri Dec 21 03:25:46 JST 2001 Kentaro Shirakata + + * original/*: man-pages-1.45.tar.gz ¤«¤é¹¹¿·¡£ + * {draft, release}/*: ¤µ¤µ¤¤¤ÊÊѹ¹¤ò¹¹¿·¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Mon Dec 17 11:30:59 JST 2001 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/setresuid.2: [LOCAL] + * release/man2/setresuid.2: [LOCAL] + +Mon Dec 17 11:30:39 JST 2001 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/syslog.2: [LOCAL] + * release/man2/syslog.2: [LOCAL] + +Mon Dec 17 11:30:18 JST 2001 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/read.2: [LOCAL] + * release/man2/read.2: [LOCAL] + +Sat Dec 15 22:10:38 JST 2001 JM ML to CVS Gateway + + * {draft,release}/man2/getcontext.2: [LOCAL] released. + * {draft,release}/man3/makecontext.3: [LOCAL] released. + * translation_list: [LOCAL] reflect above. + +Fri Dec 14 16:47:01 2001 Yuichi SATO + + * _exit.2, sigaltstack.2, + exit.3, strptime.3, tmpfile.3 : 1.44 ÂбþÈǤò¥ê¥ê¡¼¥¹¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¡£ + +Fri Dec 14 06:02:53 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08821] + * draft/man2/outb.2: [JM:08821] + +Fri Dec 14 06:02:51 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08820] + * draft/man2/lseek.2: [JM:08820] + +Fri Dec 14 06:02:37 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08817] + * draft/man2/access.2: [JM:08817] + +Fri Dec 14 00:02:45 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08816] + * draft/man2/getpriority.2: [JM:08816] + +Fri Dec 14 00:02:45 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08815] + * draft/man3/mbrtowc.3: [JM:08815] + +Fri Dec 14 00:02:43 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08814] + * draft/man2/wait4.2: [JM:08814] + +Thu Dec 13 18:02:52 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08813] + * draft/man3/ctime.3: [JM:08813] + +Thu Dec 13 06:02:48 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08809] + * draft/man2/wait.2: [JM:08809] + +Thu Dec 13 06:02:46 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08808] + * draft/man3/fopen.3: [JM:08808] + +Thu Dec 13 06:02:45 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08807] + * draft/man3/malloc.3: [JM:08807] + +Thu Dec 13 06:02:44 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08806] + * draft/man3/ftw.3: [JM:08806] + +Thu Dec 13 03:17:40 JST 2001 Kentaro Shirakata + + * {draft, release}/man7/unicode.7: ¸í»ú½¤Àµ¡£ + * translation_list: ftw.3 ¤Ï 1.42¢ª1.43¤Ë¤âÊѹ¹¤¬¤¢¤Ã¤¿¤Î¤Ç¡¢ + ¥¹¥Æ¡¼¥¿¥¹¤ò°ìö¡ù¤Ëº¹¤·Ìᤷ¡£ + +Mon Dec 10 06:02:34 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08799] + * draft/man3/tzset.3: [JM:08799] + +Mon Dec 10 00:02:41 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08795] + * draft/man2/_exit.2: [JM:08795] + +Sun Dec 9 18:02:57 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08794] + * draft/man3/tmpfile.3: [JM:08794] + +Sun Dec 9 18:02:56 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08793] + * draft/man3/exit.3: [JM:08793] + +Sun Dec 9 18:02:56 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08792] + * draft/man3/strptime.3: [JM:08792] + +Sun Dec 9 18:02:55 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08791] + +Sun Dec 9 18:02:54 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08790] + +Sat Dec 8 00:02:36 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08786] + * draft/man2/sigaltstack.2: [JM:08786] + +Fri Dec 7 15:21:47 2001 NAKANO Takeo + + * {draft,release}/man2/select.2: typo fix. ([JM:08781]) + +Fri Dec 7 06:03:28 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08779] + * draft/man3/ftok.3: [JM:08779] + +Fri Dec 7 00:03:26 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08775] + * draft/man3/fseeko.3: [JM:08775] + +Fri Dec 7 00:03:24 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08774] + * draft/man3/dysize.3: [JM:08774] + +Fri Dec 7 00:03:19 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08773] + * draft/man3/makecontext.3: [JM:08773] + +Fri Dec 7 00:03:15 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08772] + * draft/man2/getcontext.2: [JM:08772] + +Thu Dec 6 23:38:21 2001 NAKANO Takeo + + * {draft,release}/man2/accept.2: 1.44 ¹¹¿·ÄÉ¿ï. + * {draft,release}/man3/ftw.3: ditto. + * translation_list: ¾åµ­È¿±Ç. + +Thu Dec 6 19:12:49 2001 NAKANO Takeo + + * draft/man3/fseek.3: ¼ê¸µ¤Î RCS ¥ê¥Ý¥¸¥È¥ê¤Ë¤¢¤Ã¤¿ + ¸¶Ê¸¤Ä¤­¤ÎÅۤ˺¹¤·Âؤ¨. + * release/man3/fseek.3: ¡Ö.SH ½ñ¼°¡×¤òÄɲÃ. + +Thu Dec 6 18:02:07 2001 NAKANO Takeo + + * {draft,release}/man7/LDP.7: 1.44 ¹¹¿·ÄÉ¿ï. + * translation_list: ¾åµ­È¿±Ç. + +Wed Dec 6 00:15:00 2001 JST Kentaro Shirakata + + * original/*: man-pages-1.44.tar.gz ¤«¤é¹¹¿·¡£ + * {draft, release}/*: ¤µ¤µ¤¤¤ÊÊѹ¹¤ò¹¹¿·¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Wed Dec 5 22:04:32 2001 JST Kentaro Shirakata + + * original/*: man-pages-1.43.tar.gz ¤«¤é¹¹¿·¡£ + * {draft, release}/*: ¤µ¤µ¤¤¤ÊÊѹ¹¤ò¹¹¿·¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sat Nov 17 03:23:38 2001 Yuichi SATO + + * {draft,release}/man2/bind.2 : º¸³ç¸Ì¤¬È´¤±¤Æ¤¤¤¿Éôʬ¤Î½¤Àµ¤È + .TH ¤ÎÊѹ¹¤Ê¤É¡£ + +Sun Nov 11 08:59:32 2001 Akihiro Motoki + + * getpriority.2, sigaction.2, flockfile.3, posix_memalign.3, + setlogmask.3, strcmp.3, syslog.3, unlocked_stdio.3, locale.5, + nsswitch.conf.5: ¥ê¥ê¡¼¥¹ (1.42 ¤ËÂбþ)¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¡£ + +Sun Nov 11 03:45:25 2001 Yuichi SATO + + * madvise.2, dbopen.3, mpool.3, console.4, + initrd.4, hosts.5, slabinfo.5 : "free", "release", "unpin" ¤Î + Ìõ¤Î¤¦¤Á¡Ö³«Êü¡×¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤â¤Î¤ò¡Ö²òÊü¡×¤ËÊѹ¹¡£ + ñ¸ì¤ÎÅÓÃæ¤Ç²þ¹Ô¤µ¤ì¤Æ¤¤¤ëÅÀ¤Ê¤É¤Î½¤Àµ¡£ + +Fri Nov 9 22:06:58 2001 Yuichi SATO + + * acct.2, mansigaltstack.2, open.2, + alloca.3, clearenv.3, exit.3, fgetws.3, + getline.3, hsearch.3, ldiv.3, mkdtemp.3, regex.3, + rpc.3, strchr.3, strerror.3, strptime.3 : ¥ê¥ê¡¼¥¹ (1.42 ¤ËÂбþ)¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¡£ + +Fri Nov 9 20:40:45 JST 2001 Kentaro Shirakata + + * mount.2, shutdown.2, socket.2, sync.2, wait.2, ctime.3, ferror.3, + fflush.3, fgetwc.3, fputwc.3, fputws.3, fread.3, gets.3, + getutent.3, getwchar.3, puts.3, putwchar.3, stdarg.3, + strdup.3, system.3, termios.3, undocumented.3, protocols.5: + ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Mon Nov 5 12:02:20 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08627] + +Mon Nov 5 12:02:18 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08625] + * draft/man3/posix_memalign.3: [JM:08625] + +Mon Nov 5 12:02:14 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08624] + * draft/man3/flockfile.3: [JM:08624] + +Mon Nov 5 00:02:11 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08620] + * draft/man3/clearenv.3: [JM:08620] + +Sun Nov 4 00:02:42 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08613] + * draft/man3/setlogmask.3: [JM:08613] + +Sun Nov 4 00:02:38 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08614] + * draft/man3/unlocked_stdio.3: [JM:08614] + +Sat Nov 3 18:01:58 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08612] + * draft/man2/mansigaltstack.2: [JM:08612] + +Sat Nov 3 12:02:32 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08610] + * draft/man3/strerror.3: [JM:08610] + +Sat Nov 3 06:02:51 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08609] + * draft/man3/putwchar.3: [JM:08609] + +Sat Nov 3 06:02:50 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08607] + * draft/man3/getwchar.3: [JM:08607] + +Sat Nov 3 06:02:33 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08608] + * draft/man3/fread.3: [JM:08608] + +Sat Nov 3 00:02:15 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08605] + +Sat Nov 3 00:02:15 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08604] + +Sat Nov 3 00:02:08 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08603] + +Fri Nov 2 06:02:41 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08602] + * draft/man3/fputws.3: [JM:08602] + +Fri Nov 2 06:02:41 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08601] + * draft/man3/fflush.3: [JM:08601] + +Fri Nov 2 06:02:39 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08600] + * draft/man3/puts.3: [JM:08600] + +Fri Nov 2 06:02:38 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08599] + * draft/man3/strdup.3: [JM:08599] + +Fri Nov 2 06:02:37 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08598] + * draft/man3/gets.3: [JM:08598] + +Fri Nov 2 06:02:37 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08597] + * draft/man3/fputwc.3: [JM:08597] + +Fri Nov 2 06:02:36 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08596] + * draft/man3/fgetwc.3: [JM:08596] + +Fri Nov 2 06:02:35 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08595] + * draft/man3/ferror.3: [JM:08595] + +Sat Oct 27 12:02:03 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08566] + * draft/man3/fgetws.3: [JM:08566] + +Sat Oct 27 06:02:44 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08565] + * draft/man3/exit.3: [JM:08565] + +Fri Oct 26 10:11:24 JST 2001 Kentaro Shirakata + + * draft/man3/undocumented.3: 1.41¢ª1.42¤ÎÊѹ¹¤ËÂбþ¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Fri Oct 26 02:12:16 JST 2001 Akihiro Motoki + + * original/*: man-pages-1.42 ¤Ë¹¹¿·. + * llseek.2, getenv.3, putenv.3, setenv.3, environ.5: + release/draft ¤Ë original ¤ÎÊѹ¹ÅÀ¤òÈ¿±Ç. + * translation_list: ¾åµ­¤òÈ¿±Ç. + +Sun Oct 21 06:02:47 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08555] + * draft/man3/mkdtemp.3: [JM:08555] + +Sun Oct 21 06:02:44 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08554] + * draft/man3/getline.3: [JM:08554] + +Sun Oct 21 06:02:42 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08553] + * draft/man3/rpc.3: [JM:08553] + +Thu Oct 18 12:02:58 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08546] + * draft/man2/sigaction.2: [JM:08546] + +Thu Oct 18 12:02:57 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08545] + * draft/man2/getpriority.2: [JM:08545] + +Thu Oct 18 12:02:54 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08544] + * draft/man3/syslog.3: [JM:08544] + +Thu Oct 18 12:02:54 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08543] + * draft/man5/nsswitch.conf.5: [JM:08543] + +Thu Oct 18 12:02:52 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08542] + * draft/man5/locale.5: [JM:08542] + +Thu Oct 18 12:02:49 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08541] + * draft/man3/strcmp.3: [JM:08541] + +Tue Oct 16 12:02:49 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08537] + * draft/man3/getutent.3: [JM:08537] + +Tue Oct 16 06:03:01 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08536] + * draft/man5/protocols.5: [JM:08536] + +Tue Oct 16 06:02:58 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08535] + * draft/man2/sync.2: [JM:08535] + +Tue Oct 16 06:02:57 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08534] + * draft/man3/undocumented.3: [JM:08534] + +Tue Oct 16 06:02:55 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08533] + * draft/man3/termios.3: [JM:08533] + +Tue Oct 16 06:02:54 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08532] + * draft/man3/system.3: [JM:08532] + +Tue Oct 16 06:02:53 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08531] + * draft/man3/strchr.3: [JM:08531] + +Tue Oct 16 06:02:51 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08530] + * draft/man3/ldiv.3: [JM:08530] + +Tue Oct 16 06:02:51 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08529] + * draft/man3/stdarg.3: [JM:08529] + +Tue Oct 16 06:02:45 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08528] + * draft/man3/alloca.3: [JM:08528] + +Tue Oct 16 00:02:57 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08527] + * draft/man2/open.2: [JM:08527] + +Tue Oct 16 00:02:57 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08526] + * draft/man2/acct.2: [JM:08526] + +Tue Oct 16 00:02:56 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08525] + * draft/man3/ctime.3: [JM:08525] + +Tue Oct 16 00:02:55 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08524] + * draft/man2/mount.2: [JM:08524] + +Tue Oct 16 00:02:55 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08523] + +Tue Oct 16 00:02:54 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08522] + +Tue Oct 16 00:02:53 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08520] + * draft/man3/regex.3: [JM:08520] + +Tue Oct 16 00:02:47 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08519] + * draft/man3/hsearch.3: [JM:08519] + +Mon Oct 15 18:29:26 JST 2001 Kentaro Shirakata + + * original/*: man-pages-1.41.tar.gz ¤«¤é¹¹¿·¡£ + * shed_setscheduler.2, malloc.3, mkstemp.3, rpc.3, trunc.3: + ¤µ¤µ¤¤¤ÊÊѹ¹¤ò¹¹¿·¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Mon Oct 15 06:02:50 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08514] + * draft/man2/wait.2: [JM:08514] + +Mon Oct 15 06:02:50 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08513] + * draft/man2/socket.2: [JM:08513] + +Mon Oct 15 06:02:48 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08512] + * draft/man2/shutdown.2: [JM:08512] + +Thu Oct 11 12:02:52 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08502] + * draft/man3/strptime.3: [JM:08502] + +Thu Oct 11 02:31:32 2001 Yuichi SATO + + * release/man2/madvise.2 : madvice.2 ¤«¤é̾Á°¤òÊѹ¹¡£ + +Thu Oct 11 02:13:55 2001 Yuichi SATO + + * original/* : 1.40 ¤Ë¹¹¿·¡£ + * {draft, release}/* : ¤¤¤¯¤Ä¤«¤Î¥Ú¡¼¥¸¤Ë¤Ä¤¤¤Æ + original ¤ÎÊѹ¹ÅÀ¤òÈ¿±Ç¡£draft ¥Ú¡¼¥¸¤ÎºîÀ®¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¡£ + +Fri Sep 21 02:15:32 2001 NAKANO Takeo + + * release,draft/man3/iconv.3: add patch fro nakai-san [JM:08464] + +Wed Sep 12 06:57:35 2001 Yuichi SATO + + * translation_list: °Ê²¼¤Î¥Ú¡¼¥¸¤ò¥ê¥ê¡¼¥¹. + * release/man2/getrlimit.2 : ver. 1.39 + +Mon Sep 10 18:53:01 JST 2001 JM ML to CVS Gateway + + * translation_list: °Ê²¼¤Î¥Ú¡¼¥¸¤ò¥ê¥ê¡¼¥¹. + * release/man7/bootparam.7: + * release/man5/slabinfo.5: + * release/man2/madvise.2: + +Mon Sep 10 17:40:43 JST 2001 HANATAKA Shinya + + * translation_list: °Ê²¼¤Î¥Ú¡¼¥¸¤ò¥ê¥ê¡¼¥¹ + * release/man2/wait4.2: + * release/man2/execve.2: + * release/man2/getpriority.2: + * release/man2/clone.2: + +Tue Sep 4 00:02:50 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08419] + * draft/man7/bootparam.7: [JM:08419] + +Sun Sep 2 02:18:31 2001 TAKEI Nobumitsu + + * draft/man7/bootparam.7: fix typo ("init ¤¬¤¬" ¢ª "init ¤¬") + +Mon Aug 20 12:02:41 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08379] + * draft/man2/getrlimit.2: [JM:08379] + +Sun Aug 19 00:02:43 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08375] + +Sat Aug 18 06:02:46 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08361] + * draft/man2/wait4.2: [JM:08361] + +Sat Aug 18 06:02:44 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08359] + * draft/man2/clone.2: [JM:08359] + +Sat Aug 18 06:02:42 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08360] + * draft/man2/getpriority.2: [JM:08360] + +Sat Aug 18 06:02:36 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08358] + * draft/man2/execve.2: [JM:08358] + +Fri Aug 17 00:03:07 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08343] + * draft/man5/slabinfo.5: [JM:08343] + +Fri Aug 17 00:03:06 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08341] + +Fri Aug 17 00:03:00 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08340] + * draft/man2/madvise.2: [JM:08340] + +Thu Aug 16 03:30:44 JST 2001 HANATAKA Shinya + + * original/*: man-pages-1.39 ¤Ë¹¹¿·¡£ + * release/man2/undocumented.2 ¤ò obsolete ¤Ë°ÜÆ° + * ³Æ release ¤È draft ¤Ë original ¤ÎÊѹ¹¤òÈ¿±Ç + * translation_list, obsolete_list: ¾åµ­È¿±Ç¡£ + +Tue Aug 14 02:08:58 JST 2001 Kentaro Shirakata + + * mount.2, nice.2, stat.2, wait.2, write.2: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Mon Aug 13 21:15:43 2001 TAKEI Nobumitsu + + * release/man7/bootparam.7: fix typo (¾¤ÎÌÜŪ¤¿¤á¢ªÂ¾¤ÎÌÜŪ¤Î¤¿¤á) + +Sat Aug 11 00:03:38 2001 NAKANO Takeo + + * release/man2/lseek.2: ¥ª¥Õ¥Ã¥»¥È->¥ª¥Õ¥»¥Ã¥È ([JM:08309]) + +Tue Aug 7 01:19:05 2001 TAKEI Nobumitsu + + * release/man5/services.5: fix typo & ɽ¸½¤ò½¤Àµ + +Sun Jul 15 12:02:32 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08272] + * draft/man3/nl_langinfo.3: [JM:08272] + * release/man3/nl_langinfo.3: [JM:08272] + +Sat Jul 14 11:44:30 2001 Yuichi SATO + + * utf-8.7, unicode.7, koi8-r.7, + trunc.3, strtod.3, setbuf.3, round.3, + rint.3, lround.3, lrint.3, getopt.3, + gethostbyname.3, floor.3, fabs.3, ceil.3, + select.2, mincore.2, + fork.2, chmod.2 : LDP man-pages 1.38 ¤ÎËÝÌõ¤ò¥ê¥ê¡¼¥¹ + * translation_list : ¾åµ­¤òÈ¿±Ç¡£ + +Mon Jul 9 06:02:36 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08244] + * draft/man2/mincore.2: [JM:08244] + +Sun Jul 8 12:02:48 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08243] + * draft/man3/lrint.3: [JM:08243] + +Sun Jul 8 12:02:46 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08242] + * draft/man3/lround.3: [JM:08242] + +Sun Jul 8 12:02:45 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08241] + * draft/man3/round.3: [JM:08241] + +Sun Jul 8 12:02:41 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08240] + * draft/man3/trunc.3: [JM:08240] + +Sun Jul 8 08:45:26 2001 Yuichi SATO + + * brk.2, execve.2, popen.3, bootparam.7: ¡Ö¡¤¡×¢ª¡Ö¡¢¡×¤ËÃÖ´¹¡£ + ñ¸ì¤ÎÅÓÃæ¤Ç¤Î²þ¹Ô¤ò½¤Àµ¡£typo ¤È .TH ¤Î½¤Àµ¡£ + +Sun Jul 8 00:02:47 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08236] + * draft/man2/fork.2: [JM:08236] + +Sun Jul 8 00:02:45 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08235] + * draft/man7/koi8-r.7: [JM:08235] + +Sat Jul 7 23:09:27 2001 Yuichi SATO + + * {draft,release}/man7/{iso_8859-1.7,iso_8859-2.7, + iso_8859-7.7,iso_8859-15.7} : typo ¤È .TH ¤Î½¤Àµ¡£ + +Sat Jul 7 00:02:26 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08232] + +Sun Jul 1 18:01:48 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08206] + * draft/man3/strtod.3: [JM:08206] + +Sun Jul 1 18:01:47 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08205] + * draft/man3/setbuf.3: [JM:08205] + +Sun Jul 1 18:01:46 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08204] + * draft/man3/rint.3: [JM:08204] + +Sun Jul 1 18:01:44 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08203] + * draft/man3/getopt.3: [JM:08203] + +Sun Jul 1 12:02:41 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08200] + * draft/man3/gethostbyname.3: [JM:08200] + +Sun Jul 1 12:02:40 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08198] + * draft/man3/floor.3: [JM:08198] + +Sun Jul 1 12:02:38 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08197] + * draft/man3/fabs.3: [JM:08197] + +Sun Jul 1 12:02:37 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08196] + * draft/man3/ceil.3: [JM:08196] + +Sun Jul 1 12:02:36 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08195] + * draft/man2/select.2: [JM:08195] + +Sun Jul 1 12:02:35 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08194] + * draft/man7/utf-8.7: [JM:08194] + +Sun Jul 1 08:10:42 2001 Yuichi SATO + + * {draft,release}/man3/mbsinit.3 : typo fix. + +Tue Jun 26 00:03:20 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08166] + * draft/man2/write.2: [JM:08166] + +Tue Jun 26 00:03:19 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08165] + * draft/man2/wait.2: [JM:08165] + +Tue Jun 26 00:03:19 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08164] + * draft/man2/stat.2: [JM:08164] + +Tue Jun 26 00:03:18 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08163] + * draft/man2/mount.2: [JM:08163] + +Tue Jun 26 00:03:16 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08162] + * draft/man2/nice.2: [JM:08162] + +Mon Jun 25 00:02:20 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08150] + * draft/man2/chmod.2: [JM:08150] + +Sat Jun 23 12:09:15 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08144] + * draft/man7/unicode.7: [JM:08144] + +Sat Jun 23 00:02:38 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08139] + +Fri Jun 22 20:34:16 2001 Yuichi SATO + + * {draft,release}/man2/gettimeofday.2 : typo fix. + +Tue Jun 19 16:03:40 JST 2001 Kentaro Shirakata + + * original/*: man-pages-1.38.tar.gz ¤«¤é¹¹¿·¡£ + * statfs.2, putenv.3, ftpusers.5, packet.7, raw.7, rtnetlink.7, + socket.7, udp.7, unix.7: º³ºÙ¤ÊÊѹ¹¤ò¹¹¿·¡£ + * obsolete/man2/setregid.2: ¸¶Ê¸¤¬¥ê¥ó¥¯¤Ë¤Ê¤Ã¤¿¤Î¤Ç°ÜÆ°¡£ + * translation_list, obsolete_list: ¾åµ­È¿±Ç¡£ + +Fri Jun 15 06:01:48 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08117] + * draft/man3/nl_langinfo.3: [JM:08117] + +Wed Jun 13 21:13:57 2001 Yuichi SATO + + * getrlimit.2, mknod.2, msgctl.2, select.2 + semctl.2, seteuid.2, setreuid.2, shmctl.2 + shmget.2, unlink.2, write.2, nscd.conf.5 + ldconfig.8, nscd.8 : ¥ê¥ê¡¼¥¹¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¡£ + +Sat Jun 9 12:02:27 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08105] + * draft/man5/nscd.conf.5: [JM:08105] + +Sat Jun 9 00:02:29 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08104] + * draft/man8/nscd.8: [JM:08104] + +Tue Jun 5 00:02:47 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08094] + * draft/man8/ldconfig.8: [JM:08094] + +Tue Jun 5 00:02:43 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08093] + * draft/man2/setreuid.2: [JM:08093] + +Mon Jun 4 12:02:20 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08091] + * draft/man2/seteuid.2: [JM:08091] + +Sun Jun 3 23:21:30 JST 2001 Kentaro Shirakata + + * draft/man8/ldconfig.8: ld.so ¥Ñ¥Ã¥±¡¼¥¸¤«¤é import¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sun Jun 3 18:02:20 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08087] + * draft/man2/write.2: [JM:08087] + +Sun Jun 3 18:02:18 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08082] + * draft/man2/shmget.2: [JM:08082] + +Sun Jun 3 18:02:14 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08081] + * draft/man2/shmctl.2: [JM:08081] + +Sun Jun 3 13:36:14 JST 2001 Kentaro Shirakata + + * times.2, ferror.3, malloc.3, setbuf.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sun Jun 3 13:03:48 JST 2001 Kentaro Shirakata + + * mount.2, setlocale.3, system.3, usleep.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sun Jun 3 12:02:29 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08079] + * draft/man2/semctl.2: [JM:08079] + +Sun Jun 3 12:02:25 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08078] + * draft/man2/select.2: [JM:08078] + +Sun Jun 3 00:02:30 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08074] + * draft/man2/msgctl.2: [JM:08074] + +Sun Jun 3 00:02:28 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08073] + * draft/man2/mknod.2: [JM:08073] + +Sat Jun 2 21:07:21 2001 Yuichi SATO + + * draft/man2/{gettimeofday.2, llseek.2, + statfs.2, sysfs.2} : ver. 1.36 ¤Ë¹ç¤ï¤»¤Æ¿·µ¬Äɲᣠ+ * release/man2/{gettimeofday.2, llseek.2, + statfs.2, sysfs.2} : ver. 1.36 ¤Ë¹ç¤ï¤»¤Æ¹¹¿·¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¤·¤¿¡£ + +Sat Jun 2 18:02:11 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08071] + * draft/man2/getrlimit.2: [JM:08071] + +Sat Jun 2 12:02:31 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08069] + * draft/man2/unlink.2: [JM:08069] + +Sat Jun 2 11:32:59 2001 Yuichi SATO + + * draft/man2/{acct.2, adjtimex.2} : ver. 1.36 ¤Ë¹ç¤ï¤»¤Æ¿·µ¬Äɲᣠ+ * release/man2/{acct.2, adjtimex.2} : ver. 1.36 ¤Ë¹ç¤ï¤»¤Æ¹¹¿·¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¤·¤¿¡£ + +Fri Jun 1 06:02:08 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08068] + +Sat May 26 00:12:28 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08063] + +Fri May 25 20:54:16 2001 Yuichi SATO + + * {draft, release}/man2/open.2: ¥í¡¼¥«¥ë¤Ç¥ê¥ê¡¼¥¹¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¤·¤¿¡£ + +Wed May 23 18:02:18 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08049] + * draft/man2/mount.2: [JM:08049] + +Wed May 23 18:02:17 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08050] + * draft/man2/times.2: [JM:08050] + +Sun May 20 00:04:02 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08037] + * draft/man3/usleep.3: [JM:08037] + +Sun May 20 00:04:01 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08036] + * draft/man3/system.3: [JM:08036] + +Sun May 20 00:03:51 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08032] + * draft/man3/setbuf.3: [JM:08032] + +Sun May 20 00:03:50 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08031] + * draft/man3/malloc.3: [JM:08031] + +Sun May 20 00:03:48 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08030] + * draft/man3/ferror.3: [JM:08030] + +Wed May 16 00:09:58 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:08010] + * draft/man2/open.2: [JM:08010] + +Fri May 4 06:02:13 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07987] + * draft/man3/setlocale.3: [JM:07987] + +Thu May 3 23:16:35 JST 2001 Kentaro Shirakata + + * stat.2, stime.2, times.2, strsep.3, strtol.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Tue Apr 24 23:14:17 2001 Yuichi SATO + + * release/man7/bootparam.7 : ¥ê¥ó¥¯ÀÚ¤ì¤Î URL ¤ò½¤Àµ¤·¤¿¡£ + +Tue Apr 24 21:59:30 2001 Yuichi SATO + + * dir_colors.5, proc.5, suffixes.7 : ¥í¡¼¥«¥ë¤Ç¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¤·¤¿¡£ + +Fri Apr 13 20:50:52 JST 2001 NAKANO Takeo + + * chroot.2, basename.3, environ.5, LDP.7: local release + * ¾åµ­È¿±Ç. + +Wed Apr 11 18:08:12 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07955] + * draft/man3/strsep.3: [JM:07955] + +Wed Apr 11 18:07:55 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07954] + * draft/man2/stime.2: [JM:07954] + +Wed Apr 11 02:42:52 2001 Yuichi SATO + + * release/man7/bootparam.7 : typo fix. + +Tue Apr 10 12:16:27 2001 Yuichi SATO + + * {draft,release}/man2/close.2 : [JM:07946] ¤ÎÉð°æ¤µ¤ó¤Î¸æ»ØŦ¤òÈ¿±Ç¡£ + +Tue Apr 10 12:02:53 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07949] + * draft/man2/times.2: [JM:07949] + +Tue Apr 10 12:02:50 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07948] + * draft/man2/stat.2: [JM:07948] + +Tue Apr 10 06:02:08 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07945] + * draft/man5/dir_colors.5: [JM:07945] + +Mon Apr 9 20:07:17 2001 Yuichi SATO + + * close.2 : ¥í¡¼¥«¥ë¤Ç¥ê¥ê¡¼¥¹¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¤·¤¿¡£ + +Mon Apr 9 18:02:06 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07941] + * draft/man3/strtol.3: [JM:07941] + +Sun Apr 8 18:02:38 JST 2001 Kentaro Shirakata + + * {draft, release}/man4/{hd.4, ram.4}: ¤µ¤µ¤¤¤ÊÊѹ¹¤ËÂбþ¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Fri Apr 6 19:18:00 2001 NAKANO Takeo + + * draft/man2/chroot.2: ¹¹¿·¡£[JM:07935] ¤Çº¹Ê¬¤ò¥Ý¥¹¥È¤·¤Þ¤·¤¿¡£ + +Thu Apr 5 00:30:55 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07926] + * draft/man2/close.2: [JM:07926] + +Thu Apr 5 00:30:52 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07925] + * draft/man7/suffixes.7: [JM:07925] + +Thu Apr 5 00:30:50 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07924] + * draft/man5/proc.5: [JM:07924] + +Wed Apr 4 16:58:19 JST 2001 JM ML to CVS Gateway + + * fnctl.2, fclose.3, strptime.3, + acct.5, host.conf.5, hosts.equiv.5, + ip.7, ipv6.7, netlink.7, rtnetlink.7, + tzselect.8, zic.8 : 1.35 ¤Ë¤ª¤±¤ë¹¹¿·¤ËÂбþ¤·¤¿½¤Àµ¡£ + * translation_list: ¾åµ­¤òÈ¿±Ç¤·¤¿¡£ + +Sun Apr 1 12:02:19 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07916] + * draft/man7/LDP.7: [JM:07916] + +Sun Apr 1 00:07:47 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07913] + * draft/man3/basename.3: [JM:07913] + +Sat Mar 31 18:44:13 2001 NAKANO Takeo + + * translation_list: dirname.3 ¤ò dirname.3 ¤Ø¤Î¥ê¥ó¥¯¤Ë½¤Àµ. + pselect.2 ¤ò select.2 ¤Ø¤Î¥ê¥ó¥¯¤Ë½¤Àµ. + +Sat Mar 31 17:44:08 2001 Yuichi SATO + + * original/* : 1.34 ¢ª 1.35 ¤Ë¹¹¿·¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¡£ + * obsolete_list : lilo.conf.5, lilo.8 ¤òÄɲá£sjis ¢ª euc ¤ËÊѹ¹¡£ + +Mon Mar 12 17:42:35 JST 2001 NAKANO Takeo + + * ftpusers.5, arp.7, ipv6.7, utf-8.7: release. + * translation_list: ¾åµ­È¿±Ç. + +Sun Mar 11 03:48:04 JST 2001 Kentaro Shirakata + + * sendfile.2, times.2, dlopen.3, termios.3, ip.7, netdevice.7, + packet.7, rtnetlink.7, socket.7, tcp.7, udp.7, uri.7: + ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Mon Feb 26 12:02:06 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07676] + * draft/man7/utf-8.7: [JM:07676] + +Mon Feb 19 00:02:20 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07631] + * draft/man7/utf-8.7: [JM:07631] + +Mon Feb 19 00:02:16 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07628] + * draft/man7/ipv6.7: [JM:07628] + +Sun Feb 18 18:25:28 JST 2001 Kentaro Shirakata + + * translation_list: cmsg.2 ¤Ï¹¹¿·ºÑ¤ß¤À¤Ã¤¿¤Î¤Ç½¤Àµ¡£ + +Sun Feb 18 00:01:58 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07623] + +Sat Feb 17 18:02:15 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07621] + * draft/man3/termios.3: [JM:07621] + +Sat Feb 17 18:02:14 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07620] + * draft/man3/dlopen.3: [JM:07620] + +Sat Feb 17 18:02:13 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07619] + * draft/man2/times.2: [JM:07619] + +Sat Feb 17 18:02:12 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07618] + * draft/man2/sendfile.2: [JM:07618] + +Sat Feb 17 00:02:16 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07608] + * draft/man5/ftpusers.5: [JM:07608] + +Sat Feb 17 00:02:15 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07607] + * draft/man7/arp.7: [JM:07607] + +Thu Feb 15 18:02:00 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07596] + * draft/man7/packet.7: [JM:07596] + +Thu Feb 15 18:02:00 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07595] + * draft/man7/netdevice.7: [JM:07595] + +Thu Feb 15 18:01:58 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07594] + * draft/man7/ip.7: [JM:07594] + +Thu Feb 15 00:02:18 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07582] + +Wed Feb 14 23:34:27 JST 2001 JM ML to CVS Gateway + + * °Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ò local release: + recv.2, fenv.3, getnameinfo.3, getpass.3, strfmon.3 + * obsolete/man3/getpass.3: remove. + * translation_list: ¾åµ­È¿±Ç¡£ + +Wed Feb 14 23:29:59 2001 NAKANO Takeo + + * contrib/man7/mdoc.samples.7: ¿·¤·¤¯¤Ê¤Ã¤Æ¤¿¤Î¤Ç import. + +Sun Feb 11 06:02:14 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07566] + * draft/man7/uri.7: [JM:07566] + +Sun Feb 11 06:02:14 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07565] + * draft/man7/udp.7: [JM:07565] + +Sun Feb 11 06:02:13 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07564] + * draft/man7/socket.7: [JM:07564] + +Sun Feb 11 06:02:13 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07563] + * draft/man7/tcp.7: [JM:07563] + +Sun Feb 11 06:02:11 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07562] + * draft/man7/rtnetlink.7: [JM:07562] + +Sun Feb 11 00:43:56 2001 Yuichi SATO + + * getgroups.2, vcs.4 : ¥í¡¼¥«¥ë¤Ç¥ê¥ê¡¼¥¹¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¡£ + +Sat Feb 10 00:02:09 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07555] + * draft/man3/getpass.3: [JM:07555] + +Sat Feb 10 00:02:08 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07554] + * draft/man2/recv.2: [JM:07554] + +Fri Feb 9 11:05:57 JST 2001 Kentaro Shirakata + + * send.2, abs.3, atoi.3, getcwd.3, printf.3: ¥ê¥ê¡¼¥¹¡£ + * release/man3/getpass.3: ´°Á´¤ËÊ̤ÎÆâÍƤˤʤä¿¤Î¤Ç + obsolete/ ¤Ë°ÜÆ°¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + * obsolete_list: ¾åµ­È¿±Ç¡£ + +Thu Feb 8 06:01:58 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07540] + * draft/man3/fenv.3: [JM:07540] + +Thu Feb 8 06:01:55 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07539] + * draft/man3/strfmon.3: [JM:07539] + +Sat Feb 3 18:01:59 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07519] + * draft/man3/printf.3: [JM:07519] + +Sat Feb 3 18:01:59 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07518] + * draft/man3/getcwd.3: [JM:07518] + +Sat Feb 3 18:01:57 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07517] + * draft/man3/atoi.3: [JM:07517] + +Sat Feb 3 18:01:56 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07516] + * draft/man3/abs.3: [JM:07516] + +Sat Feb 3 18:01:55 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07515] + * draft/man2/send.2: [JM:07515] + +Sat Feb 3 18:01:55 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07514] + * draft/man4/vcs.4: [JM:07514] + +Sat Feb 3 12:01:59 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07512] + * draft/man2/getgroups.2: [JM:07512] + +Sat Feb 3 06:02:18 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07509] + +Mon Jan 15 18:01:46 JST 2001 JM ML to CVS Gateway + + * translation_list: [JM:07458] + * draft/man3/getnameinfo.3: [JM:07458] + +Mon Jan 15 12:22:34 2001 NAKANO Takeo + + * getaddrinfo.3, getipnodebyname.3, inet_pton.3, inet_ntop.3: + follow the changes in original. + * translation_list: reflect above. + +Mon Jan 15 10:13:58 JST 2001 JM ML to CVS Gateway + + * translation_list: Reservation for inet_pton.3, inet_ntop.3, + getipnodebyname.3, getaddrinfo.3, getnameinfo.3 + +Sun Jan 14 07:12:43 JST 2001 JM ML to CVS Gateway + + * inet_pton.3, inet_ntop.3, getipnodebyname.3, getaddrinfo.3: + released locally. + * translation_list: reflect above. + +Tue Jan 9 21:14:33 2001 Yuichi SATO + + * {release,draft}/man3/getopt.3 : typo fix. + +Fri Dec 22 03:32:06 2000 Yuichi SATO + + * {release, draft}/man2/send.2 : .BI, .BR ¤Î 2 ²Õ½ê¤ò½¤Àµ¡£ + +Tue Dec 19 00:02:05 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:07338] + * draft/man3/getipnodebyname.3: [JM:07338] + +Sun Dec 17 00:02:07 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:07331] + +Sun Dec 17 00:02:06 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:07330] + * draft/man3/inet_pton.3: [JM:07330] + +Sun Dec 17 00:02:04 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:07329] + * draft/man3/inet_ntop.3: [JM:07329] + +Sun Dec 17 00:02:02 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:07328] + * draft/man3/getaddrinfo.3: [JM:07328] + +Sat Dec 16 18:01:57 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:07327] + +Sat Dec 16 13:23:25 2000 Yuichi SATO + + * translation_list : µ­ºÜ±Ì¤ì¤Î¥Ú¡¼¥¸¤òÄɲᣠ+ ¥ª¥ê¥¸¥Ê¥ë¤Ç¤Ê¤¯¤Ê¤Ã¤¿ fpurge.3 ¤òºï½ü¡£ + +Sat Dec 16 08:02:37 2000 Yuichi SATO + + * release/man2/write.2 : ºÇ½ª¹Ô¤Ë²þ¹Ô¤òÄɲä·¤¿ (draft ¤Ê¤·)¡£ + +Mon Dec 11 06:01:57 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:07306] + * draft/man5/shells.5: [JM:07306] + * release/man5/shells.5: [JM:07306] + +Tue Nov 14 20:06:50 2000 NAKANO Takeo + + * draft,release/man3/*.3: change copyright notice of JM + to contact info. + +Tue Nov 14 19:10:38 2000 NAKANO Takeo + + * release/man4/console_codes.4: patch from MLD guy ([JM:07132]) + +Thu Oct 19 06:24:49 2000 Yuichi SATO + + * release/man3/daemon.3 : [JM:06908] ¤Ç¤ÎÉð°æ¤µ¤ó¤Î¸æ»ØŦ¤Ë¤è¤ê¡¢ + ¡Ö»Ï¤á¤Æ¡×¤ò¡Ö½é¤á¤Æ¡×¤Ë½¤Àµ¡£ + * translation_list : ¾åµ­¤òÈ¿±Ç¡£ + +Sun Oct 15 06:02:01 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06892] + * draft/man7/hier.7: [JM:06892] + * release/man7/hier.7: [JM:06892] + +Sat Oct 14 23:52:38 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/tempnam.3: [LOCAL] + * release/man3/tempnam.3: [LOCAL] + +Sat Oct 14 12:31:36 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/strftime.3: [LOCAL] + * release/man3/strftime.3: [LOCAL] + +Thu Oct 12 19:09:35 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man5/termcap.5: [LOCAL] + * release/man5/termcap.5: [LOCAL] + +Thu Oct 12 19:00:52 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/tempnam.3: [LOCAL] + * release/man3/tempnam.3: [LOCAL] + +Thu Oct 12 19:00:51 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/gethostbyname.3: [LOCAL] + * release/man3/gethostbyname.3: [LOCAL] + +Thu Oct 12 18:58:27 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/recv.2: [LOCAL] + * release/man2/recv.2: [LOCAL] + +Thu Oct 12 18:58:26 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/mmap.2: [LOCAL] + * release/man2/mmap.2: [LOCAL] + +Thu Oct 12 18:58:25 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/accept.2: [LOCAL] + * release/man2/accept.2: [LOCAL] + +Tue Oct 10 23:12:51 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/strptime.3: [LOCAL] + * release/man3/strptime.3: [LOCAL] + +Tue Oct 10 06:01:46 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06854] + * draft/man3/strftime.3: [JM:06854] + +Mon Oct 9 00:01:58 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06842] + * draft/man3/tempnam.3: [JM:06842] + +Sat Oct 7 12:01:57 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06836] + +Fri Oct 6 21:52:50 JST 2000 Kentaro Shirakata + + * stat.2, assert.3, exec.3, fclose.3, printf.3, rand.3: + ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Fri Oct 6 18:01:32 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06833] + * draft/man3/setlocale.3: [JM:06833] + * release/man3/setlocale.3: [JM:06833] + +Tue Oct 3 06:46:03 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/gethostname.2: [LOCAL] + * release/man2/gethostname.2: [LOCAL] + +Tue Oct 3 06:45:20 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/getdomainname.2: [LOCAL] + * release/man2/getdomainname.2: [LOCAL] + +Mon Oct 2 18:02:00 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06811] + * draft/man3/setlocale.3: [JM:06811] + +Sun Oct 1 06:01:35 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06808] + * draft/man3/strptime.3: [JM:06808] + +Sun Oct 1 00:01:51 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06807] + +Fri Sep 29 18:01:36 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06799] + * draft/man2/gethostname.2: [JM:06799] + +Thu Sep 28 00:01:47 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06790] + * draft/man2/recv.2: [JM:06790] + +Tue Sep 26 12:01:52 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06779] + * draft/man2/getdomainname.2: [JM:06779] + +Mon Sep 25 18:01:37 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06774] + * draft/man2/accept.2: [JM:06774] + +Mon Sep 25 12:01:39 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06771] + +Mon Sep 25 06:19:05 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/bindresvport.3: [LOCAL] + * release/man3/bindresvport.3: [LOCAL] + +Mon Sep 25 06:01:54 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06770] + * draft/man3/assert.3: [JM:06770] + +Mon Sep 25 06:01:53 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06763] + * draft/man5/termcap.5: [JM:06763] + +Mon Sep 25 06:01:53 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06762] + * draft/man3/bindresvport.3: [JM:06762] + +Mon Sep 25 06:01:53 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06761] + * draft/man3/fclose.3: [JM:06761] + +Mon Sep 25 06:01:50 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06760] + * draft/man3/exec.3: [JM:06760] + +Mon Sep 25 00:01:57 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06753] + * draft/man3/encrypt.3: [JM:06753] + * release/man3/encrypt.3: [JM:06753] + +Mon Sep 25 00:01:55 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06752] + * draft/man5/resolver.5: [JM:06752] + * release/man5/resolver.5: [JM:06752] + +Mon Sep 25 00:01:53 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06751] + * draft/man5/hosts.5: [JM:06751] + * release/man5/hosts.5: [JM:06751] + +Mon Sep 25 00:01:47 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06750] + * draft/man3/rand.3: [JM:06750] + +Mon Sep 25 00:01:45 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06749] + * draft/man5/host.conf.5: [JM:06749] + * release/man5/host.conf.5: [JM:06749] + +Mon Sep 25 00:01:43 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06746] + * draft/man2/stat.2: [JM:06746] + +Thu Sep 24 23:28:06 JST 2000 Kentaro Shirakata + + * release/man3/abort.3: ¤µ¤µ¤¤¤ÊÊѹ¹¤ËÂбþ¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sat Sep 23 12:01:39 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06737] + * draft/man3/printf.3: [JM:06737] + +Thu Sep 21 06:01:40 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06726] + * draft/man3/gethostbyname.3: [JM:06726] + +Thu Sep 21 06:01:33 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06725] + * draft/man2/mmap.2: [JM:06725] + +Thu Sep 21 00:38:48 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/fflush.3: [LOCAL] + * release/man3/fflush.3: [LOCAL] + +Thu Sep 21 00:13:51 JST 2000 Kentaro Shirakata + + * {draft, release}/man3/strtok.3: ¤µ¤µ¤¤¤ÊÊѹ¹¤ËÂбþ¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Wed Sep 20 18:43:27 2000 NAKANO Takeo + + * contrib/man7/mdoc.samples.7: FreeBSD jpman archive ¤è¤ê import. + * translation_list: ¾åµ­È¿±Ç. + +Wed Sep 20 17:57:37 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/fenv.3: [LOCAL] + * release/man3/fenv.3: [LOCAL] + +Wed Sep 20 17:57:12 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/__setfpucw.3: [LOCAL] + * release/man3/__setfpucw.3: [LOCAL] + +Mon Sep 18 00:02:01 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06700] + * draft/man7/hier.7: [JM:06700] + +Mon Sep 18 00:01:58 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06699] + * draft/man3/__setfpucw.3: [JM:06699] + +Mon Sep 18 00:01:56 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06698] + * draft/man3/fenv.3: [JM:06698] + +Sat Sep 16 12:01:59 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06692] + * draft/man3/encrypt.3: [JM:06692] + +Sat Sep 16 12:01:56 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06691] + * draft/man5/hosts.5: [JM:06691] + +Sat Sep 16 07:27:55 2000 Yuichi SATO + + * translation_list: encrypt.3 ¤Î "LDP_man" ¤ò "LDP man" ¤Ë½¤Àµ + +Sat Sep 16 06:02:12 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06690] + * draft/man5/resolver.5: [JM:06690] + +Thu Sep 14 23:46:15 JST 2000 JM ML to CVS Gateway + + * dircolors.1, mkdir.2, getmntent.3, tzset.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Wed Sep 13 16:43:58 2000 NAKANO Takeo + + * (draft,release)/man3/glob.3: GLOB_DOOFS ¢ª GLOB_DOOFFS [JM:06674] + +Wed Sep 13 12:02:12 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06683] + * draft/man2/mkdir.2: [JM:06683] + +Sat Sep 9 06:01:35 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06665] + * draft/man3/tzset.3: [JM:06665] + +Thu Sep 7 09:10:16 JST 2000 HANATAKA Shinya + + * translation_list ¤ò 1.31 ¤Ë¹¹¿· + * 1.30 ¢Í 1.31 ¤Î¤µ¤µ¤¤¤ÊÊѹ¹¤òÁ´¤ÆľÀÜ release ¤ËÈ¿±Ç + +Tue Sep 5 03:49:46 JST 2000 Yuichi SATO + + * release/man3/fts.3: NULL ¥Ý¥¤¥ó¥¿¤È NUL ʸ»ú¤Îº®Æ±¤ò½¤Àµ ([JM:06520]) + * translation_list: ¾åµ­¤òÈ¿±Ç + +Tue Sep 5 02:17:41 JST 2000 Yuichi SATO + + * release/man2/unlink.2: ¿¢¾¾¤µ¤ó¤Î¤´»ØŦ¤Ë¤è¤ë½¤Àµ ([JM:06649]) + * translation_list: ¾åµ­¤òÈ¿±Ç + +Sun Sep 3 12:01:42 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06645] + +Sun Sep 3 12:01:41 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06644] + * draft/man3/getmntent.3: [JM:06644] + +Sat Sep 2 06:01:20 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06642] + * draft/man5/host.conf.5: [JM:06642] + +Fri Sep 1 12:01:52 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06628] + * draft/man2/mkdir.2: [JM:06628] + +Fri Sep 1 06:01:40 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06627] + * draft/man3/tzset.3: [JM:06627] + +Fri Sep 1 00:01:38 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06625] + * draft/man1/dircolors.1: [JM:06625] + +Wed Aug 23 18:01:51 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06607] + * draft/man3/malloc.3: [JM:06607] + * release/man3/malloc.3: [JM:06607] + +Wed Aug 23 18:01:46 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06606] + * draft/man3/bzero.3: [JM:06606] + * release/man3/bzero.3: [JM:06606] + +Tue Aug 15 19:03:33 2000 NAKANO Takeo + + * (draft,release)/man7/ip.7: getsockopt ¤È setsockopt ¤Î + µ­½Ò¤¬µÕ¤À¤Ã¤¿ ([JM:06586]) + +Fri Aug 11 06:01:19 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06574] + +Wed Jul 12 00:01:56 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06513] + * draft/man4/dsp56k.4: [JM:06513] + * release/man4/dsp56k.4: [JM:06513] + +Wed Jul 12 00:01:53 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06512] + * draft/man5/dir_colors.5: [JM:06512] + * release/man5/dir_colors.5: [JM:06512] + +Wed Jul 12 00:01:46 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06511] + * draft/man5/acct.5: [JM:06511] + * release/man5/acct.5: [JM:06511] + +Wed Jul 12 00:01:43 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06510] + * draft/man3/lockf.3: [JM:06510] + * release/man3/lockf.3: [JM:06510] + +Wed Jul 12 00:01:41 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06509] + * draft/man3/iconv_open.3: [JM:06509] + * release/man3/iconv_open.3: [JM:06509] + +Wed Jul 12 00:01:39 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06508] + * draft/man3/iconv_close.3: [JM:06508] + * release/man3/iconv_close.3: [JM:06508] + +Wed Jul 12 00:01:36 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06507] + * draft/man3/iconv.3: [JM:06507] + * release/man3/iconv.3: [JM:06507] + +Wed Jul 12 00:01:33 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06506] + * draft/man3/fts.3: [JM:06506] + * release/man3/fts.3: [JM:06506] + +Wed Jul 5 00:01:09 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06493] + * draft/man5/dir_colors.5: [JM:06493] + +Sun Jul 2 06:01:15 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06488] + * draft/man4/dsp56k.4: [JM:06488] + +Sat Jul 1 00:01:27 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06484] + * draft/man5/acct.5: [JM:06484] + +Sat Jul 1 00:01:25 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06482] + * draft/man3/lockf.3: [JM:06482] + +Sat Jul 1 00:01:22 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06481] + * draft/man3/iconv_open.3: [JM:06481] + +Sat Jul 1 00:01:19 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06480] + * draft/man3/iconv_close.3: [JM:06480] + +Sat Jul 1 00:01:17 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06479] + * draft/man3/iconv.3: [JM:06479] + +Sat Jul 1 00:01:16 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06478] + * draft/man3/fts.3: [JM:06478] + +Sat Jul 1 00:01:13 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06477] + * draft/man3/fts.3: [JM:06477] + +Wed Jun 28 06:01:52 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06468] + * draft/man3/fcloseall.3: [JM:06468] + * release/man3/fcloseall.3: [JM:06468] + +Wed Jun 28 06:01:46 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06467] + * draft/man3/daemon.3: [JM:06467] + * release/man3/daemon.3: [JM:06467] + +Sun Jun 25 18:01:17 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06455] + +Sat Jun 24 06:01:16 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06448] + * draft/man3/fcloseall.3: [JM:06448] + +Sat Jun 24 06:01:13 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06447] + * draft/man3/daemon.3: [JM:06447] + +Mon Jun 19 01:24:10 JST 2000 Kentaro Shirakata + + * {draft, release}/man3/getw.3, printf.3, putenv.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Wed Jun 14 11:10:55 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/pivot_root.2: [LOCAL] + * release/man2/pivot_root.2: [LOCAL] + +Tue Jun 13 18:01:22 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06404] + * draft/man8/sync.8: [JM:06404] + * release/man8/sync.8: [JM:06404] + +Thu Jun 8 00:01:46 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06371] + * draft/man3/putenv.3: [JM:06371] + +Thu Jun 8 00:01:46 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06370] + * draft/man3/printf.3: [JM:06370] + +Thu Jun 8 00:01:20 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06369] + * draft/man3/getw.3: [JM:06369] + +Fri Jun 7 18:57:26 JST 2000 Kentaro Shirakata + + * original/*: man-pages-1.30.tar.gz ¤Ë¹¹¿·¡£ + * {draft, release}/*: ¤µ¤µ¤¤¤ÊÊѹ¹¤ËÂбþ¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Wed Jun 7 06:01:10 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06366] + * draft/man8/sync.8: [JM:06366] + +Mon Jun 5 06:01:15 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06355] + * draft/man2/pivot_root.2: [JM:06355] + +Sun May 14 23:00:23 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/printf.3: [LOCAL] + * release/man3/printf.3: [LOCAL] + +Tue May 9 18:02:47 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06291] + +Mon Apr 24 14:29:36 2000 NAKANO Takeo + + * release/man3/getmntent.3, draft/man3/getmntent.3: + ¤Ê¤¼¤«ÆâÍƤ¬ getlogin.3 ¤Ë¤Ê¤Ã¤Æ¤¤¤¿¤Î¤Ç¡¢¼ê¸µ¤Ë¤¢¤Ã¤¿ + ¸¶¹Æ¤òº¹¤·Âؤ¨¡£ + +Wed Apr 19 22:13:19 JST 2000 HANATAKA Shinya + + * translation_list: [JM:06194] + * release/man2/socket.2 + * draft/man2/socket.2 + +Wed Apr 19 12:02:36 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06193] + * draft/man3/printf.3: [JM:06193] + +Fri Apr 14 22:24:41 JST 2000 Kentaro Shirakata + + * setup.2, strtok.3 tmpnam.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Thu Apr 13 20:25:05 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man5/environ.5: [LOCAL] + * release/man5/environ.5: [LOCAL] + +Wed Apr 12 14:11:15 2000 NAKANO Takeo + + * draft/man3/strtod.3, release/man3/strtod.3: + º´Ì¤ó¤Î¤´»ØŦ¤Ë¤è¤ë½¤Àµ ([JM:06161]) + +Sat Apr 8 06:01:11 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06158] + * draft/man7/hier.7: [JM:06158] + * release/man7/hier.7: [JM:06158] + +Tue Mar 21 18:00:50 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06107] + * draft/man5/environ.5: [JM:06107] + +Tue Mar 21 13:06:10 2000 NAKANO Takeo + + * draft/man3/gets.3, release/man3/gets.3: ¹Ô³ä¤ì½¤Àµ. + ([JM:06101]) + +Sat Mar 18 18:01:17 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06087] + * draft/man7/hier.7: [JM:06087] + +Sat Mar 18 06:00:46 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06082] + * draft/man3/strtok.3: [JM:06082] + +Fri Mar 17 13:29:50 2000 NAKANO Takeo + + * translation_list: alphabetical sort, ¤¤¤¯¤Ä¤«¥Ñ¥Ã¥Á. + +Thu Mar 16 18:01:00 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06075] + * draft/man2/setup.2: [JM:06075] + +Thu Mar 16 06:00:56 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06071] + * draft/man7/hier.7: [JM:06071] + +Thu Mar 16 00:00:35 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06070] + * draft/man3/tmpnam.3: [JM:06070] + +Mon Mar 13 06:00:49 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06045] + * draft/man7/hier.7: [JM:06045] + +Sun Mar 12 23:35:24 2000 NAKANO Takeo + + * translation_list: st.4 ¤È hosts.equiv.5 ¤ò ¡û¤Ë¡£ + +Sun Mar 12 22:34:24 JST 2000 HANATAKA Shinya + + * translation_list ¤ò 1.29 ¤Ë¹¹¿· + * 1.28 ¢Í 1.29 ¤Î¤µ¤µ¤¤¤ÊÊѹ¹¤òÁ´¤ÆľÀÜ release ¤ËÈ¿±Ç + +Sun Mar 12 18:46:50 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man7/uri.7: [LOCAL] + * release/man7/uri.7: [LOCAL] + +Sun Mar 12 18:46:47 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man4/st.4: [LOCAL] + * release/man4/st.4: [LOCAL] + +Sun Mar 12 18:46:45 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man5/hosts.equiv.5: [LOCAL] + * release/man5/hosts.equiv.5: [LOCAL] + +Sun Mar 12 18:44:35 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man7/uri.7: [LOCAL] + * release/man7/uri.7: [LOCAL] + +Sun Mar 12 18:44:33 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man4/st.4: [LOCAL] + * release/man4/st.4: [LOCAL] + +Sun Mar 12 18:44:31 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man5/hosts.equiv.5: [LOCAL] + * release/man5/hosts.equiv.5: [LOCAL] + +Sun Mar 12 06:01:17 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:06038] + +Sun Mar 12 00:57:04 JST 2000 HANATAKA Shinya + + * original/*: 1.29 ¤Ë¹¹¿· + +Mon Feb 28 23:08:08 2000 NAKANO Takeo + + * draft/man4/st.4: ¸åÆ£¤µ¤ó¤Î»ØŦ¤òÈ¿±Ç ([JM:05977]) + +Mon Feb 21 20:44:46 2000 NAKANO Takeo + + * draft/man7/uri.7: ÇòÊý¤µ¤ó¤Î»ØŦ¤òÈ¿±Ç (X-ML-Count: 05906) + +Sun Feb 20 23:31:27 2000 NAKANO Takeo + + * draft/man4/st.4: °ú¤­Â³¤­¸åÆ£¤µ¤ó¤Î»ØŦ¤òÈ¿±Ç (X-ML-Count: 05892) + +Sat Feb 19 17:42:57 2000 NAKANO Takeo + + * draft/man4/st.4: ¸åÆ£¤µ¤ó¤Î»ØŦ¤òÈ¿±Ç (X-ML-Count: 05888) + +Thu Feb 17 00:01:10 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05886] + * draft/man4/st.4: [JM:05886] + +Mon Feb 14 21:14:31 2000 NAKANO Takeo + + * draft/man4/st.4: µìÌõ¤òÈ¿±Ç. + +Sun Feb 13 13:06:26 2000 NAKANO Takeo + + * release/man4/st.4: typo fix. + +Thu Feb 10 18:00:46 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05876] + +Thu Feb 10 00:00:45 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05870] + * draft/man7/uri.7: [JM:05870] + +Tue Feb 8 12:00:52 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05867] + * draft/man5/hosts.equiv.5: [JM:05867] + +Fri Feb 4 06:01:02 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05862] + +Sun Jan 30 14:12:10 JST 2000 HANATAAKA Shinya + + * draft/man2/listen.2 [JM:05844] SO_MAXCONN => SOMAXCONN + * release/man2/listen.2 [JM:05844] same avove + +Sun Jan 23 06:01:47 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05833] + * draft/man1/chgrp.1: [JM:05833] + * release/man1/chgrp.1: [JM:05833] + +Sun Jan 23 06:01:45 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05832] + * draft/man1/touch.1: [JM:05832] + * release/man1/touch.1: [JM:05832] + +Fri Jan 14 20:37:58 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man7/mdoc.7: [LOCAL] + * release/man7/mdoc.7: [LOCAL] + +Fri Jan 14 20:37:49 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man7/man.7: [LOCAL] + * release/man7/man.7: [LOCAL] + +Fri Jan 14 05:06:05 JST 2000 JM ML to CVS Gateway + + * intro.1, connect.2, idle.2, intro.2, listen.2, send.2, + shutdown.2, socket.2, stat.2, uselib.2, ecvt.3, fgetwc.3, + fputwc.3, glob.3, inet.3, iswalnum.3, iswalpha.3, + iswblank.3, iswdigit.3, iswgraph.3, iswlower.3, iswpunct.3, + iswspace.3, iswupper.3, iswxdigit.3: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Fri Jan 14 00:12:34 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man7/iso_8859-15.7: [LOCAL] + * release/man7/iso_8859-15.7: [LOCAL] + +Fri Jan 14 00:12:26 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man7/iso_8859-7.7: [LOCAL] + * release/man7/iso_8859-7.7: [LOCAL] + +Fri Jan 14 00:12:17 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man7/iso_8859-2.7: [LOCAL] + * release/man7/iso_8859-2.7: [LOCAL] + +Fri Jan 14 00:12:01 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man4/fifo.4: [LOCAL] + * release/man4/fifo.4: [LOCAL] + +Fri Jan 14 00:11:49 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/xdr.3: [LOCAL] + * release/man3/xdr.3: [LOCAL] + +Fri Jan 14 00:11:36 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/rpc.3: [LOCAL] + * release/man3/rpc.3: [LOCAL] + +Fri Jan 14 00:01:05 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05793] + * draft/man1/chgrp.1: [JM:05793] + +Fri Jan 14 00:01:03 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05792] + * draft/man1/touch.1: [JM:05792] + +Tue Jan 11 06:01:26 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05779] + * draft/man2/capget.2: [JM:05779] + * release/man2/capget.2: [JM:05779] + +Tue Jan 11 01:05:57 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/wprintf.3: [LOCAL] + * release/man3/wprintf.3: [LOCAL] + +Tue Jan 11 01:05:47 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/wctomb.3: [LOCAL] + * release/man3/wctomb.3: [LOCAL] + +Tue Jan 11 01:05:32 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/wcstombs.3: [LOCAL] + * release/man3/wcstombs.3: [LOCAL] + +Tue Jan 11 01:05:19 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/ungetwc.3: [LOCAL] + * release/man3/ungetwc.3: [LOCAL] + +Tue Jan 11 01:05:07 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/strnlen.3: [LOCAL] + * release/man3/strnlen.3: [LOCAL] + +Tue Jan 11 01:04:55 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/stpncpy.3: [LOCAL] + * release/man3/stpncpy.3: [LOCAL] + +Tue Jan 11 01:04:36 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbrtowc.3: [LOCAL] + * release/man3/mbrtowc.3: [LOCAL] + +Tue Jan 11 01:04:15 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbtowc.3: [LOCAL] + * release/man3/mbtowc.3: [LOCAL] + +Tue Jan 11 01:03:49 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbstowcs.3: [LOCAL] + * release/man3/mbstowcs.3: [LOCAL] + +Tue Jan 11 01:03:38 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbsrtowcs.3: [LOCAL] + * release/man3/mbsrtowcs.3: [LOCAL] + +Tue Jan 11 01:03:31 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbsnrtowcs.3: [LOCAL] + * release/man3/mbsnrtowcs.3: [LOCAL] + +Tue Jan 11 01:03:20 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbsinit.3: [LOCAL] + * release/man3/mbsinit.3: [LOCAL] + +Tue Jan 11 01:03:10 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbrtowc.3: [LOCAL] + * release/man3/mbrtowc.3: [LOCAL] + +Tue Jan 11 01:02:57 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbrlen.3: [LOCAL] + * release/man3/mbrlen.3: [LOCAL] + +Tue Jan 11 01:02:47 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mblen.3: [LOCAL] + * release/man3/mblen.3: [LOCAL] + +Tue Jan 11 01:02:33 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/putwchar.3: [LOCAL] + * release/man3/putwchar.3: [LOCAL] + +Tue Jan 11 01:02:24 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/getwchar.3: [LOCAL] + * release/man3/getwchar.3: [LOCAL] + +Tue Jan 11 01:02:12 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/getrpcport.3: [LOCAL] + * release/man3/getrpcport.3: [LOCAL] + +Tue Jan 11 01:01:56 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/getrpcent.3: [LOCAL] + * release/man3/getrpcent.3: [LOCAL] + +Tue Jan 11 01:01:31 JST 2000 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/fwide.3: [LOCAL] + * release/man3/fwide.3: [LOCAL] + +Thu Jan 6 06:01:23 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05753] + * draft/man7/mdoc.7: [JM:05753] + +Thu Jan 6 06:01:21 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05742] + * draft/man7/iso_8859-15.7: [JM:05742] + +Thu Jan 6 06:01:19 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05741] + * draft/man7/iso_8859-7.7: [JM:05741] + +Thu Jan 6 06:01:16 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05740] + * draft/man7/iso_8859-2.7: [JM:05740] + +Thu Jan 6 06:01:16 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05739] + * draft/man4/fifo.4: [JM:05739] + +Wed Jan 5 15:10:58 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05727] + * draft/man3/rpc.3: [JM:05727] + +Wed Jan 5 15:10:57 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05726] + * draft/man3/xdr.3: [JM:05726] + +Tue Jan 4 06:14:08 JST 2000 JM ML to CVS Gateway + + * draft/man2/connect.2, idle.2, intro.2, listen.2, + send.2, shutdown.2, socket.2, stat.2, uselib.2, + draft/man3/glob.3: 1.28¤ËÂбþ¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sat Jan 3 17:22:50 1999 Kentaro Shirakata + + * {draft,release}/man2/bind.2: 1.27¢ª1.28 ¤Î¤µ¤µ¤¤¤ÊÊѹ¹¤ËÂбþ¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sun Jan 2 23:44:56 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05712] + * draft/man3/getrpcport.3: [JM:05712] + +Sun Jan 2 23:44:53 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05711] + * draft/man3/getrpcent.3: [JM:05711] + +Sun Jan 2 23:44:49 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05710] + * draft/man3/wprintf.3: [JM:05710] + +Sun Jan 2 23:44:44 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05709] + * draft/man3/wctomb.3: [JM:05709] + +Sun Jan 2 23:44:40 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05708] + * draft/man3/ungetwc.3: [JM:05708] + +Sun Jan 2 23:44:34 JST 2000 JM ML to CVS Gateway + + * translation_list: [JM:05707] + * draft/man3/wcstombs.3: [JM:05707] + +Thu Dec 30 19:21:55 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05702] + * draft/man3/getwchar.3: [JM:05702] + +Thu Dec 30 17:16:41 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05702] + * draft/man3/getwchar.3: [JM:05702] + +Thu Dec 30 01:37:56 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbrtowc.3: [LOCAL] + +Thu Dec 30 01:15:56 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbsinit.3: [LOCAL] + +Thu Dec 30 01:14:46 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/strnlen.3: [LOCAL] + +Thu Dec 30 01:14:26 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/stpncpy.3: [LOCAL] + +Thu Dec 30 01:14:02 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/putwchar.3: [LOCAL] + +Thu Dec 30 01:13:40 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbtowc.3: [LOCAL] + +Thu Dec 30 01:13:18 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbstowcs.3: [LOCAL] + +Thu Dec 30 01:12:39 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbsrtowcs.3: [LOCAL] + +Thu Dec 30 01:11:03 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mblen.3: [LOCAL] + +Thu Dec 30 01:10:48 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbsnrtowcs.3: [LOCAL] + +Wed Dec 29 22:23:37 1999 NAKANO Takeo + + * draft/man7/man.7: ÇòÊý¤µ¤ó¤Î¥³¥á¥ó¥È¤òÈ¿±Ç m(__)m + +Tue Dec 28 00:15:09 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/capget.2: [LOCAL] + +Mon Dec 27 09:17:37 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/fwide.3: [LOCAL] + +Mon Dec 27 09:17:20 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man3/mbrlen.3: [LOCAL] + +Sun Dec 26 23:45:15 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/sendfile.2: [LOCAL] + * release/man2/sendfile.2: [LOCAL] + +Sun Dec 26 23:45:04 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/unlink.2: [LOCAL] + * release/man2/unlink.2: [LOCAL] + +Sun Dec 26 23:44:53 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/execve.2: [LOCAL] + * release/man2/execve.2: [LOCAL] + +Sun Dec 26 23:44:37 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/dup.2: [LOCAL] + * release/man2/dup.2: [LOCAL] + +Sun Dec 26 22:30:59 JST 1999 JM ML to CVS Gateway + + * translation_list: [LOCAL] + * draft/man2/vfork.2: [LOCAL] + * release/man2/vfork.2: [LOCAL] + +Sun Dec 26 23:27:14 1999 Kentaro Shirakata + + * draft/man1/intro.1, + draft/man3/{ecvt.3, inet.3, fgetwc.3, fputwc.3, + iswalnum.3, iswalpha.3, iswblank.3, iswdigit.3, + iswgraph.3, iswlower.3, iswpunct.3, iswspace.3, + iswupper.3, iswxdigit.3}: 1.28¤ËÂбþ¡£ + * obsolete/man3/{mblen.3, mbstowcs.3, mbtowc.3, + wcstombs.3, wctomb.3}: + ¥Ú¡¼¥¸¤ÎÆâÍƤ¬´°Á´¤ËÊѤï¤Ã¤Æ¤¤¤¿¤Î¤Çrelease/¤«¤é°ÜÆ°¡£ + * obsolete_list: ¾åµ­È¿±Ç¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sat Dec 25 17:08:53 1999 Kentaro Shirakata + + * fopen.3, getcwd.3, getpw.3, mkfifo.3, putenv.3 + remove.3, setjmp.3, strpbrk.3, strsignal.3 + sysconf.3, proc.5, charsets.7: ¥ê¥ê¡¼¥¹¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sat Dec 25 05:19:28 1999 Kentaro Shirakata + + * draft/man3/*, release/man3/*: 1.27¢ª1.28 ¤Î¤µ¤µ¤¤¤ÊÊѹ¹¤ËÂбþ¡£ + * obsolete/man3/snprintf.3: printf.3 ¤Ø¤Î¥ê¥ó¥¯¤È¤Ê¤Ã¤¿¤¿¤á + draft/man3/snprintf.3 ¤«¤é°ÜÆ°¡£ + * translation_list: ¾åµ­È¿±ÇµÚ¤Ó typo fix¡£ + +Thu Dec 23 19:28:45 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05653] + +Thu Dec 23 19:27:07 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05652] + * draft/man7/man.7: [JM:05652] + +Sat Dec 11 00:50:57 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05615]-[JM:05619] + * draft/man3/putenv.3, remove.3, setjmp.3, strpbrk.3, + mkfifo.3: [JM:05615]-[JM:05619] + +Wed Dec 8 05:11:25 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05602]-[JM:05606] + * draft/man3/strsignal.3, getpw.3, getcwd.3, sysconf.3, fopen.3: + [JM:05602]-[JM:05606] + +Mon Dec 6 17:33:06 1999 NAKANO Takeo + + * translation_list: ½ñ¼°¥¨¥é¡¼¤Î½¤Àµ. + +Mon Dec 6 09:15:27 JST 1999 NAKANO Takeo + + °Ê²¼¤ò¥ê¥ê¡¼¥¹: + arp.7, ddp.7, icmp.7, ip.7, netdevice.7, netlink.7, packet.7, + raw.7, rtnetlink.7, socket.7, tcp.7, udp.7, unix.7, x25.7 + (°Ê¾å¿·µ¬ÄɲÃ) + signal.7 (¹¹¿·) + +Mon Dec 6 08:19:11 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05588] + * draft/man7/signal.7: [JM:05588] + +Sub Dec 5 23:07:47 1999 Kentaro Shirakata + + * draft/man2/*, release/man2/*: 1.27¢ª1.28¤Î¤µ¤µ¤¤¤ÊÊѹ¹¤ËÂбþ¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sat Dec 4 03:01:01 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05586] + * draft/man5/proc.5: [JM:05586] + +Sat Dec 4 01:37:32 1999 Kentaro Shirakata + + * release/man4/console.4, console_codes.4, console_ioctl.4: + 1.28¤ËÂбþ¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Fri Dec 3 23:37:47 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05583] + * draft/man7/charsets.7: [JM:05583] + +Fri Dec 3 21:17:24 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05575] + * draft/man2/vfork.2: [JM:05575] + +Fri Dec 3 21:04:27 1999 NAKANO Takeo + + * translation_list: ¹¹¿·È¿±Ç. + * original/man4/charsets.4: man7/charsets.7 ¤Ë. + +Fri Dec 3 20:07:15 1999 NAKANO Takeo + + * original/*: 1.28 ¤Ë¹¹¿·. + +Sat Nov 27 03:22:44 1999 Kentaro Shirakata + + * {draft, release}/man3/{fgetwc.3, wcwidth.3}: + 1.27¤ËÂбþ¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sat Nov 27 02:26:53 1999 Kentaro Shirakata + + * {draft, release}/man3/{lsearch.3, setbuf.3, stdarg.3}: + 1.27¤ËÂбþ¡£ + * translation_list: ¾åµ­È¿±Ç¡£ + +Sat Nov 27 01:47:34 1999 NAKANO Takeo + + * */man7/ascii.7: TBL ¤ò¸Æ¤Ö¤¿¤á¤Ë¤Ï, ÀèƬ¹Ô¤Ï + '\" t ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤è¤¦¤Ç¤¹¡£ + +Sat Nov 27 01:40:44 1999 NAKANO Takeo + + * draft/man3/rpc.3 ¤Û¤«: ¤È¤ê¤¢¤¨¤º¥¢¥ó¥³¥á¥ó¥È¤·¤¿¤À¤±¡£ + +Sat Nov 27 01:37:49 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05567] + * draft/man7/intro.7: [JM:05567] + * release/man7/intro.7: [JM:05567] + +Sat Nov 27 01:37:43 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05566] + * draft/man7/ascii.7: [JM:05566] + * release/man7/ascii.7: [JM:05566] + +Fri Nov 26 06:20:28 1999 Kentaro Shirakata + + * release/man4/iso_8859-1.7, suffixes.7: 1.27¤ËÂбþ¡£ + * translation_list: °Ê¾åÈ¿±Ç¡£ + +Fri Nov 26 00:47:35 JST 1999 HANATAKA Shinya + + * release/man2/prctl.2 + * release/man2/ptrace.2 + * release/man2/sched_setscheduler.2 + * release/man2/setpgid.2 + ¸¶Ê¸¤ò½üµî¤·¤Æ release + +Wed Nov 24 20:59:10 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05544] + * draft/man7/signal.7: [JM:05544] + +Wed Nov 24 20:37:50 1999 NAKANO Takeo + + * release/man7/signal.7: ¥Æ¡¼¥Ö¥ë¹½À®¤¬°ì¸Ä°ã¤Ã¤Æ¤¿. + * draft/man7/signal.7: ¤³¤Ã¤Á¤â. + +Wed Nov 24 20:15:36 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05542] + * draft/man7/x25.7: [JM:05542] + +Wed Nov 24 20:15:28 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05541] + * draft/man7/unix.7: [JM:05541] + +Mon Nov 22 01:06:18 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05507] + * draft/man2/sched_setscheduler.2: [JM:05507] + +Mon Nov 22 01:06:12 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05508] + * draft/man2/setpgid.2: [JM:05508] + +Mon Nov 22 01:06:07 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05506] + * draft/man2/ptrace.2: [JM:05506] + +Mon Nov 22 01:05:55 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05504] + * draft/man2/prctl.2: [JM:05504] + +Mon Nov 22 00:19:57 1999 NAKANO Takeo + + * draft/man7/ip.7, netlink.7: draft. + * translation_list: ¾åµ­. + +Sat Nov 20 17:01:19 JST 1999 HANATAKA, Shinya + + * dup.2 fork.2 getrlimit.2 getsockname.2 lseek.2 setfsgid.2 + setfsuid.2 setgid.2 setresuid.2 write.2 ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò + man-pages-1.27 ¤ËÂбþ¤µ¤»¤¿¡£ + +Sat Nov 20 15:31:11 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05502] + * draft/man7/rtnetlink.7: [JM:05502] + +Sat Nov 20 00:34:34 JST 1999 HANATAKA, Shinya + + * man2/*.2 ¤Î¡Ö´ØÏ¢¹àÌܡפΥե©¡¼¥Þ¥Ã¥È¤ò man-pages-1.27 ¤Ë + Âбþ¤µ¤»¤¿¡£ + +Fri Nov 19 17:08:08 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05491] + * draft/man7/netdevice.7: [JM:05491] + +Wed Nov 17 07:44:22 1999 Kentaro Shirakata + + * translation_list: + - recv.2: [JM:05016] + - signal.7: [JM:4428][JM:4821] + - other: typo + +Mon Nov 15 17:31:10 1999 NAKANO Takeo + + * original/man8/sync.8: Äɲ䷤Ƥª¤¤¤¿. + +Mon Nov 15 17:21:59 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05480] + * draft/man7/socket.7: [JM:05480] + +Sat Nov 13 13:54:03 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05474] + * draft/man7/packet.7: [JM:05474] + +Fri Nov 12 18:40:19 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05470] + * draft/man7/tcp.7: [JM:05470] + +Fri Nov 12 00:36:25 JST 1999 HANATAKA, Shinya + * translation_list + * original + man-pages-1.27 ¤ò original ¤ËÈ¿±Ç¤µ¤»¤¿¡£ + +Thu Nov 11 21:48:24 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05464] + +Thu Nov 11 21:48:18 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05465] + * draft/man3/snprintf.3: [JM:05465] + +Tue Nov 9 19:18:32 1999 NAKANO Takeo + + * release/man2/getitimer.2: [JM:05410] ¤Î¥Ñ¥Ã¥Á¤òŬÍÑ¡£ + ´Øº¬¤µ¤ó¤Î¤´°Õ¸«¤ò¼õ¤±¤Æ¡Öʬ²òǽ¡×¤Ë¤·¤¿¡£ + +Tue Nov 9 19:17:25 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05454] + * draft/man7/udp.7: [JM:05454] + +Mon Nov 8 16:52:45 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05441] + * draft/man7/ddp.7: [JM:05441] + +Mon Nov 8 04:24:58 1999 Kentaro Shirakata + + * draft/man4/full.4, hd.4, initrd.4, mem.4, null.4, + ram.4, random.4, sd.4, ttys.4, vcs.4: + 1.26¤ËÂбþ¡£ + * release/man4/full.4, hd.4, initrd.4, mem.4, null.4, + ram.4, random.4, sd.4, ttys.4, vcs.4: + ¸¶Ê¸½üµî¤·¤Ærelease¡£ + * translation_list: °Ê¾åÈ¿±Ç¡£ + +Sun Nov 7 23:20:18 1999 NAKANO Takeo + + * draft/man7/arp.7, icmp.7, raw.7: ¤È¤ê¤¢¤¨¤º¥É¥é¥Õ¥È. + * draft/man7/ip.7, ddp.7: ¤Á¤ç¤Ã¤È¼ê¤ò¤Ä¤±¤¿. + * draft/man7/mdoc.samples.7: ¥³¥á¥ó¥È¹Ô¤ÎÀ°Íý¤À¤±. + * translation_list: ¥Í¥Ã¥È´Ø·¸¤Î sec7 ¥Ú¡¼¥¸¤òͽÌó. + +Sat Nov 6 12:42:13 1999 NAKANO Takeo + + * translation_list: arp.7, ip.7, raw.7 ͽÌó. + +Mon Nov 1 07:05:53 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:5398] + * draft/man3/printf.3: [JM:5398] + * release/man3/printf.3: [JM:5398] + +Mon Nov 1 07:03:14 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:5397] + * draft/man3/ctime.3: [JM:5397] + * release/man3/ctime.3: [JM:5397] + +Fri Oct 29 00:27:19 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcschr.3: [JMPOST] + * release/man3/wcschr.3: [JMPOST] + +Fri Oct 29 00:27:19 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcscat.3: [JMPOST] + * release/man3/wcscat.3: [JMPOST] + +Fri Oct 29 00:27:18 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcscasecmp.3: [JMPOST] + * release/man3/wcscasecmp.3: [JMPOST] + +Fri Oct 29 00:27:18 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcrtomb.3: [JMPOST] + * release/man3/wcrtomb.3: [JMPOST] + +Fri Oct 29 00:27:17 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcpncpy.3: [JMPOST] + * release/man3/wcpncpy.3: [JMPOST] + +Fri Oct 29 00:27:17 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcpcpy.3: [JMPOST] + * release/man3/wcpcpy.3: [JMPOST] + +Fri Oct 29 00:27:16 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wmemset.3: [JMPOST] + * release/man3/wmemset.3: [JMPOST] + +Fri Oct 29 00:27:16 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wmemmove.3: [JMPOST] + * release/man3/wmemmove.3: [JMPOST] + +Fri Oct 29 00:27:15 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wmemcpy.3: [JMPOST] + * release/man3/wmemcpy.3: [JMPOST] + +Fri Oct 29 00:27:15 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wmemcmp.3: [JMPOST] + * release/man3/wmemcmp.3: [JMPOST] + +Fri Oct 29 00:27:14 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wmemchr.3: [JMPOST] + * release/man3/wmemchr.3: [JMPOST] + +Fri Oct 29 00:27:14 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcwidth.3: [JMPOST] + * release/man3/wcwidth.3: [JMPOST] + +Fri Oct 29 00:27:13 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wctype.3: [JMPOST] + * release/man3/wctype.3: [JMPOST] + +Fri Oct 29 00:27:13 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/towupper.3: [JMPOST] + * release/man3/towupper.3: [JMPOST] + +Fri Oct 29 00:27:12 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wctrans.3: [JMPOST] + * release/man3/wctrans.3: [JMPOST] + +Fri Oct 29 00:27:12 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wctob.3: [JMPOST] + * release/man3/wctob.3: [JMPOST] + +Fri Oct 29 00:27:12 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcswidth.3: [JMPOST] + * release/man3/wcswidth.3: [JMPOST] + +Fri Oct 29 00:27:11 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcstok.3: [JMPOST] + * release/man3/wcstok.3: [JMPOST] + +Fri Oct 29 00:27:11 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcsstr.3: [JMPOST] + * release/man3/wcsstr.3: [JMPOST] + +Fri Oct 29 00:27:10 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcsspn.3: [JMPOST] + * release/man3/wcsspn.3: [JMPOST] + +Fri Oct 29 00:27:10 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcsrtombs.3: [JMPOST] + * release/man3/wcsrtombs.3: [JMPOST] + +Fri Oct 29 00:27:09 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcsrchr.3: [JMPOST] + * release/man3/wcsrchr.3: [JMPOST] + +Fri Oct 29 00:27:09 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcspbrk.3: [JMPOST] + * release/man3/wcspbrk.3: [JMPOST] + +Fri Oct 29 00:27:08 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcsnrtombs.3: [JMPOST] + * release/man3/wcsnrtombs.3: [JMPOST] + +Fri Oct 29 00:27:08 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/towlower.3: [JMPOST] + * release/man3/towlower.3: [JMPOST] + +Fri Oct 29 00:27:07 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcsnlen.3: [JMPOST] + * release/man3/wcsnlen.3: [JMPOST] + +Fri Oct 29 00:27:07 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcsncpy.3: [JMPOST] + * release/man3/wcsncpy.3: [JMPOST] + +Fri Oct 29 00:27:06 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcsncmp.3: [JMPOST] + * release/man3/wcsncmp.3: [JMPOST] + +Fri Oct 29 00:27:06 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcsncat.3: [JMPOST] + * release/man3/wcsncat.3: [JMPOST] + +Fri Oct 29 00:27:05 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcsncasecmp.3: [JMPOST] + * release/man3/wcsncasecmp.3: [JMPOST] + +Fri Oct 29 00:27:05 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcslen.3: [JMPOST] + * release/man3/wcslen.3: [JMPOST] + +Fri Oct 29 00:27:04 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcsdup.3: [JMPOST] + * release/man3/wcsdup.3: [JMPOST] + +Fri Oct 29 00:27:04 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcscspn.3: [JMPOST] + * release/man3/wcscspn.3: [JMPOST] + +Fri Oct 29 00:27:03 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcscpy.3: [JMPOST] + * release/man3/wcscpy.3: [JMPOST] + +Fri Oct 29 00:27:03 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcscmp.3: [JMPOST] + * release/man3/wcscmp.3: [JMPOST] + +Fri Oct 29 00:27:02 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/towctrans.3: [JMPOST] + * release/man3/towctrans.3: [JMPOST] + +Tue Oct 26 01:04:12 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wmemcmp.3: [JMPOST] + +Tue Oct 26 01:04:11 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wmemchr.3: [JMPOST] + +Tue Oct 26 01:04:11 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcscasecmp.3: [JMPOST] + +Tue Oct 26 01:04:10 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcrtomb.3: [JMPOST] + +Tue Oct 26 01:04:10 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcpncpy.3: [JMPOST] + +Tue Oct 26 01:04:09 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wcpcpy.3: [JMPOST] + +Tue Oct 26 01:04:09 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/towupper.3: [JMPOST] + +Tue Oct 26 01:04:09 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/towlower.3: [JMPOST] + +Tue Oct 26 01:04:08 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wmemset.3: [JMPOST] + +Tue Oct 26 01:04:08 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wmemmove.3: [JMPOST] + +Tue Oct 26 01:04:07 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/wmemcpy.3: [JMPOST] + +Tue Oct 26 01:03:22 JST 1999 JM ML to CVS Gateway + + * translation_list: [JMPOST] + * draft/man3/towctrans.3: [JMPOST] + +Sat Oct 23 23:40:52 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05317]-[JM:05326] + * draft/man3/wcwidth.3: [JM:05326] + * draft/man3/wctrans.3: [JM:05325] + * draft/man3/wctob.3: [JM:05324] + * draft/man3/wctype.3: [JM:05323] + * draft/man3/wcsstr.3: [JM:05322] + * draft/man3/wcswidth.3: [JM:05321] + * draft/man3/wcstok.3: [JM:05320] + * draft/man3/wcsspn.3: [JM:05319] + * draft/man3/wcsrchr.3: [JM:05318] + * draft/man3/wcsrtombs.3: [JM:05317] + +Sat Oct 23 23:26:38 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05312],[JM:05316] + * draft/man3/wcspbrk.3: [JM:05316] + * draft/man3/wcsnrtombs.3: [JM:05312] + +Sat Oct 23 23:16:24 1999 Kentaro Shirakata + + * draft/man3/ctime.3,printf.3: draftÄɲà + * translation_list: °Ê¾åÈ¿±Ç + +Fri Oct 22 16:34:48 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05291],[JM:05292] + * draft/man3/wcsncpy.3: [JM:05292] + * draft/man3/wcsnlen.3: [JM:05291] + +Tue Oct 19 18:17:10 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05280]-[JM:05283],[JM:05285] + * draft/man3/wcslen.3: [JM:05285] + * draft/man3/wcsdup.3: [JM:05283] + * draft/man3/wcsncasecmp.3: [JM:05282] + * draft/man3/wcsncat.3: [JM:05281] + * draft/man3/wcsncmp.3: [JM:05280] + +Sun Oct 17 23:44:23 JST 1999 JM ML to CVS Gateway + + * translation_list: [JM:05267] - [JM:05271] + * draft/man3/wcscat.3: [JM:05271] + * draft/man3/wcschr.3: [JM:05270] + * draft/man3/wcscspn.3: [JM:05269] + * draft/man3/wcscpy.3: [JM:05268] + * draft/man3/wcscmp.3: [JM:05267] + +Thu Oct 14 23:22:36 1999 NAKANO Takeo + + * release/man2/gettimeofday.2: typo ½¤Àµ. + +Thu Oct 14 23:16:24 1999 Kentaro Shirakata + + * release/(man2/mount.2,man3/system.3): ¸¶Ê¸½üµî¤·¤Ærelease + * translation_list: °Ê¾åÈ¿±ÇµÚ¤Óctime.3,printf.3ͽÌó + +Wed Oct 13 07:09:28 1999 Kentaro Shirakata + + * original/man-pages.lsm: ¿·µ¬Äɲà + * translation_list: exec.3¤ÏËÜʸ¤ÏÊѤï¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤Ç¡û¤ËÊѹ¹ + +Sun Oct 10 07:42:24 1999 Kentaro Shirakata + + * draft/man3/fclose.3,memmem.3: release/¤«¤é°ÜÆ° + * release/man3/fclose.3,memmem.3: ¸¶Ê¸½üµî + * translation_list: fclose.3,memmem.3¤ÏËÜʸ¤Ï + ÊѤï¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤Ç¡û¤ËÊѹ¹ + +Sat Oct 9 15:58:22 1999 NAKANO Takeo + + * draft/man1/dircolors.1, release/man1/dircolors.1: + 0.4 ¥Ñ¥Ã¥±¡¼¥¸¤«¤é½¦¤Ã¤ÆÄɲÃ. + +Wed Oct 3 06:26:10 1999 Kentaro Shirakata + + * release/man3/strcpy.3,strstr.3: draft/¤«¤é¸¶Ê¸½üµî¤·¤Ærelease + * translation_list: °Ê¾åÈ¿±Ç + +Sat Oct 2 19:05:19 1999 NAKANO Takeo + + * translation_list: ½ñ¼°Êѹ¹. + +Wed Sep 28 07:20:26 1999 Kentaro Shirakata + + * draft/man3/system.3, draft/man2/mount.2: draftÄɲà + * translation_list: °Ê¾åÈ¿±Ç + +Tue Sep 14 12:01:59 1999 NAKANO Takeo + + * draft/(man3/ftw.3,man5/tzfile.5,man8/zdump.8,man8/zic.8): + typo fixing. + * release/* (¾åµ­ + man5/rpc.5,man8/tzselect.8): ¸¶Ê¸ strip, + release. + * translation_list: °Ê¾åÈ¿±Ç. + +Sun Sep 12 23:23:13 1999 FUJIWARA Teruyoshi + + * release/man3/isw*.3, fputwc.3, fputws.3, fgetwc.3, fgetws.3: released. + +Sat Sep 11 11:15:56 1999 HAYAKAWA Hitoshi + + * draft/man3/btowc, MB_LEN_MAX, MB_CUR_MAX: commit + * release/man3/btowc, MB_LEN_MAX, MB_CUR_MAX: commit + +Fri Sep 10 20:13:37 1999 NAKANO Takeo + + * translation_list: typo fix. + +Sun Sep 5 23:18:44 1999 FUJIWARA Teruyoshi + + * draft/man3/isw*.3: ¥É¥é¥Õ¥ÈºîÀ®. + +Wed Sep 1 01:27:26 1999 Kentaro Shirakata + + * draft/man3/string.3,usleep.3: release¤«¤é°ÜÆ° + * release/man3/string.3,usleep.3: ¸¶Ê¸¤Î¥³¥á¥ó¥È¤ò½üµî + * translation_list: string.3,usleep.3¤ò1.26¤ËÂбþ + +Mon Aug 30 23:38:45 1999 HAYAKAWA Hitoshi + + * draft/man3/btowc.3, MB_CUR_MAX.3, MB_LEN_MAX.3: Added the drafts. + +Mon Aug 30 00:45:42 1999 FUJIWARA Teruyoshi + + * draft/man3/fgetwc.3 fgetws.3, fputwc.3, fputws.3: ¥É¥é¥Õ¥ÈºîÀ®. + +Sun Aug 29 22:43:08 1999 Kentaro Shirakata + + * release/man2/uname.2, draft/man3/gets.3, + release/man3/gets.3: 1.26¤ËÂбþ + * translation_list: ¾åµ­È¿±Ç + +Sun Aug 29 10:44:28 1999 HAYAKAWA Hitoshi + + * translation_list: MB_CUR_MAX, MB_LEN_MAX, btowc Àë¸ÀÈ¿±Ç + +Fri Aug 27 17:10:32 1999 NAKANO Takeo + + * draft/man5/rpc.5, draft/man5/tzfile.5: ¥É¥é¥Õ¥ÈºîÀ®. + * translation_list: ¾åµ­È¿±Ç. + +Thu Aug 26 21:14:58 1999 HAYAKAWA Hitoshi + + * release/man2/fcntl.2, bind.2, connect.2, intro.2, flock.2, + ioctl.2, send.2, open.2, recv.2, shmop.2, + sigaction.2, socket.2, stat.2: Äɲà + * translation_list: °Ê¾åÈ¿±Ç. + +Tue Aug 24 21:49:28 1999 NAKANO Takeo + + * translation_list: console_ioctls.4 ¢ª console_ioctl.4 + +Sat Aug 21 13:10:47 1999 NAKANO Takeo + + * draft/man3/errno.3,gethostbyname.3,getlogin.3,getopt.3, + draft/man5/environ.5, nsswitch.conf.5: 1.22->1.25 + * release/(¾åµ­): ¸¶Ê¸ strip ÈÇÅÐÏ¿. + * draft/man3/ftw.3: Êѹ¹¤¬Â¿¤«¤Ã¤¿¤Î¤Ç ML ¤Ë review °ÍÍê. + * translation_list: °Ê¾åÈ¿±Ç. + +Fri Aug 20 11:29:46 1999 NAKANO Takeo + + * draft/man5/lilo.conf.5: ¹»Àµ. + * release/man5/lilo.conf.5: ¸¶Ê¸¤Ê¤«¤Ã¤¿¤Î¤Ç¤½¤Î¤Þ¤Þ¥³¥Ô¡¼. + * draft/man3/netlink.3, rtnetlink.3: ¹»Àµ. + * release/man3/netlink.3, rtnetlink.3: ¸¶Ê¸ strip. + * translation_list: °Ê¾åÈ¿±Ç. + +Thu Aug 19 14:10:27 1999 NAKANO Takeo + + * draft/man3/dbopen.3, mpool.3, recno.3: ¹»Àµ. + * draft/man3/btree.3: ¤Á¤ç¤Ã¤È¤À¤±½¤Àµ. + * release/man3/btree.3, dbopen.3, mpool.3, recno.3: ¸¶Ê¸ strip. + * translation_list: °Ê¾åÈ¿±Ç. + +Tue Aug 17 22:06:46 1999 NAKANO Takeo + + * draft/man3/cmsg.3, hash.3: ¹»Àµ. + * draft/man3/btree.3: hash.3 ¤È°ìÉôɽµ­¤ò¹ç¤ï¤»¤¿¡£ + * release/man3/cmsg.3,hash.3,btree.3: ¾åµ­¤Î¸¶Ê¸ strip ÈÇ. + * translation_list: °Ê¾åÈ¿±Ç. + +Mon Aug 16 21:04:49 1999 NAKANO Takeo + + * draft/man3/btree.3: ¹»Àµ. + * release/man3/btree.3: ¾åµ­¤è¤ê¸¶Ê¸¤ò strip. + * translation_list: °Ê¾åÈ¿±Ç. + +Mon Aug 16 15:44:18 1999 NAKANO Takeo + + * translation_list: ¤¤¤¯¤Ä¤«¤Î¹»ÀµÀë¸À. + +Sat Aug 14 04:11:33 1999 NAKANO Takeo + + * draft/man8/*.8: ¥É¥é¥Õ¥È¤ÎÌõ¤Ä¤±¡£ + * translation_list: ¾åµ­¤ÎÈ¿±Ç¡£ + +Wed Aug 11 23:30:23 1999 NAKANO Takeo + + * original/*/*: add from tar ball + * translation_list: ̵¤¤¥Þ¥Ë¥å¥¢¥ëÄɲÃ, ¥¹¥Æ¡¼¥¿¥¹¤ò¡ù¤Ë + +Mon Aug 9 12:34:57 1999 NAKANO Takeo + + * release/man3/gets.3,exec.3: add fujiwara's patch. diff --git a/contrib/man7/mdoc.samples.7 b/contrib/man7/mdoc.samples.7 new file mode 100644 index 00000000..3560eb45 --- /dev/null +++ b/contrib/man7/mdoc.samples.7 @@ -0,0 +1,2852 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)mdoc.samples.7 8.2 (Berkeley) 12/30/93 +.\" %FreeBSD: src/share/man/man7/mdoc.samples.7,v 1.28.2.9 2001/03/13 17:54:18 ru Exp % +.\" +.\" This tutorial sampler invokes every macro in the package several +.\" times and is guaranteed to give a worst case performance +.\" for an already extremely slow package. +.\" +.\" jpman %Id: mdoc.samples.7,v 1.4 1999/01/21 17:52:58 kuma Stab % +.\" +.\" WORD: display ɽ¼¨ÆâÍÆ +.\" WORD: angle bracket ¥«¥®³ç¸Ì <> +.\" WORD: keep ¥­¡¼¥× +.\" WORD: display ¥Ç¥£¥¹¥×¥ì¥¤ +.\" WORD: literal ¥ê¥Æ¥é¥ë +.\" WORD: content macro ¥³¥ó¥Æ¥ó¥È¥Þ¥¯¥í +.\" WORD: command modifier ¥³¥Þ¥ó¥É½¤¾þ»Ò +.\" WORD: enclosure °Ï¤¤ +.\" WORD: quoting ¥¯¥©¡¼¥È +.\" WORD: nest Æþ¤ì»Ò +.\" WORD: block ragged ±úÆÌ¥Ö¥í¥Ã¥¯ +.\" WORD: constant width character ÄêÉýʸ»ú +.\" +.Dd December 30, 1993 +.Os +.Dt MDOC.SAMPLES 7 +.Sh ̾¾Î +.Nm mdoc.samples +.Nd +.Nm \-mdoc +¤ò»È¤Ã¤Æ +.Bx +¥Þ¥Ë¥å¥¢¥ë¤ò½ñ¤¯¤¿¤á¤Î¥Á¥å¡¼¥È¥ê¥¢¥ë¥µ¥ó¥×¥ë +.Sh ½ñ¼° +.Nm man mdoc.samples +.Sh ²òÀâ +.Xr troff 1 +ÍѤΠ+.Em ¥³¥ó¥Æ¥ó¥È¥Ù¡¼¥¹ +¤Ç¤«¤Ä +.Em Îΰè¥Ù¡¼¥¹ +¤Ê¥Õ¥©¡¼¥Þ¥Ã¥È¥Ñ¥Ã¥±¡¼¥¸¤Ç¤¢¤ë +.Nm \-mdoc +¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸¤ò»È¤Ã¤Æ +.Bx +¥Þ¥Ë¥å¥¢¥ë¤ò½ñ¤¯¤¿¤á¤Î¥Á¥å¡¼¥È¥ê¥¢¥ë¥µ¥ó¥×¥ë¤Ç¤¹¡£ +Á°¿È¤Ç¤¢¤ë +.Xr \-man 7 +¥Ñ¥Ã¥±¡¼¥¸¤Ï¥Õ¥©¥ó¥È¤ÎÁàºî¤ä¾¤Î¼Ì¿¢ÊýË¡¤Î¾ÜºÙ¤Ï¸Ä¡¹¤Îºî¼Ô¤ËǤ¤»¤¿ +¥Ú¡¼¥¸¥ì¥¤¥¢¥¦¥È¥Ù¡¼¥¹¤Î¤â¤Î¤Ç¤·¤¿¡£ +.Nm \-mdoc +¤Ç¤Ï¡¢¥Ú¡¼¥¸¥ì¥¤¥¢¥¦¥È¥Þ¥¯¥í¤Ï +¥¿¥¤¥È¥ë¡¢¥»¥¯¥·¥ç¥ó¤Î¥Ø¥Ã¥À¡¢¥Ç¥£¥¹¥×¥ì¥¤¡¢¥ê¥¹¥È¤Î¥Þ¥¯¥í¤«¤é¤Ê¤ë +.Em "¥Ú¡¼¥¸¹½Â¤Îΰè" +¤ò·ÁÀ®¤·¤Æ¤¤¤Þ¤¹¡£ +¥Ú¡¼¥¸¹½Â¤Îΰè¤Ë²Ã¤¨¡¢ +¤µ¤é¤Ë¥Þ¥Ë¥å¥¢¥ëÎΰ褪¤è¤Ó°ìÈ̥ƥ­¥¹¥ÈÎΰè¤Î 2 ¤Ä¤ÎÎΰ褬¤¢¤ê¤Þ¤¹¡£ +°ìÈ̥ƥ­¥¹¥ÈÎΰè¤Ï¥Æ¥­¥¹¥È¤Î°ìÉô¤ò¥¯¥©¡¼¥È¤·¤¿¤ê¡¢¶¯Ä´¤¹¤ë¤È¤¤¤Ã¤¿¤è¤¦¤Êºî¶È¤ò +¼Â¹Ô¤¹¤ë¥Þ¥¯¥í¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +¥Þ¥Ë¥å¥¢¥ëÎΰè¤Ï¥³¥Þ¥ó¥É¤ä¥ë¡¼¥Á¥ó¡¢¤½¤ì¤Ë +.Bx +¤Î´ØÏ¢¥Õ¥¡¥¤¥ë¤òµ­½Ò¤¹¤ë¤¿¤á¤ÎÆü¾ï»ÈÍѤµ¤ì¤ë¥¤¥ó¥Õ¥©¡¼¥Þ¥ë¤Ê¸ÀÍդΠ+¥µ¥Ö¥»¥Ã¥È¤Ç¤¢¤ë¥Þ¥¯¥í¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +¥Þ¥Ë¥å¥¢¥ëÎΰè¤Î¥Þ¥¯¥í¤Ï¥³¥Þ¥ó¥É̾¡¢¥³¥Þ¥ó¥É¹Ô¤Î°ú¿ô¤È¥ª¥×¥·¥ç¥ó¡¢ +´Ø¿ô̾¡¢´Ø¿ô¤Î¥Ñ¥é¥á¡¼¥¿¡¢¥Ñ¥¹Ì¾¡¢ÊÑ¿ô̾¡¢Â¾¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ø¤Î +¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹¤Ê¤É¤ò°·¤¤¤Þ¤¹¡£ +¤³¤ì¤é¤ÎÎΰè¤Î¹àÌܤϺî¼Ô¤È¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¾­Íè¤Î¥æ¡¼¥¶¤Îξ¼Ô¤Ë +¤È¤Ã¤Æ²ÁÃͤΤ¢¤ë¤â¤Î¤Ç¤¹¡£ +¥Þ¥Ë¥å¥¢¥ë´Ö¤Ç°ì´ÓÀ­¤ò¹â¤á¤ë¤³¤È¤Ë¤è¤Ã¤Æ¾­Íè¤Î¥É¥­¥å¥á¥ó¥È¥Ä¡¼¥ë¤Ø¤Î +°Ü¹Ô¤¬Íưפˤʤ뤳¤È¤¬Ë¾¤Þ¤ì¤Þ¤¹¡£ +.Pp +¥Þ¥Ë¥å¥¢¥ë¤Î¥¨¥ó¥È¥ê¤Ï¡¢¼ÂºÝ¤ÎŤµ¤Ë´Ø¤ï¤é¤º¡¢ +¤Þ¤¿Ã˽÷¤Î¶èÊ̤ò¤¹¤ë¤è¤¦¤Ê°Õ¿Þ¤Ê¤·¤Ç¡¢ +.Ux +¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òÄ̤·¤Æ¡¢Ã±½ã¤Ë man ¥Ú¡¼¥¸¤È¤·¤Æ»²¾È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +.Sh ¤µ¤¢¡¢»Ï¤á¤è¤¦ +Ä̾ï¥Á¥å¡¼¥È¥ê¥¢¥ë¥É¥­¥å¥á¥ó¥È¤Ï¡¢¤½¤³¤Ë¼¨¤µ¤ì¤¿Âêºà¤ò¤¹¤°¤Ë»È¤¤¤¿¤¤»þ +¤ËÆɤà¤â¤Î¤Ç¤¹¤Î¤Ç¡¢¤³¤Î¥É¥­¥å¥á¥ó¥È¤Î¥æ¡¼¥¶¤Ï¤»¤Ã¤«¤Á¤Ê¿Í¤À¤È +²¾Äꤷ¤Æ¤¤¤Þ¤¹¡£ +¤³¤Î¥É¥­¥å¥á¥ó¥È¤Î»Ä¤ê¤ÎÉôʬ¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ëÂêºà¤Ï°Ê²¼¤Î¤è¤¦¤Ê¹½À®¤Ë +¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ +.Bl -enum -offset indent +.It +.Tn "TROFF ¤ËÆÃÍ­¤Êɽ¸½" +.Bl -tag -width flag -compact -offset indent +.It "¥Þ¥¯¥í¤Î»ÈÍÑÊýË¡" +.It "°ú¿ô¤Ë¶õÇòʸ»ú¤ò»ØÄꤹ¤ë" +.It "¹ÔËö¤Î¶õÇòʸ»ú (·Ù¹ð)" +.It "Æüìʸ»ú¤Î¥¨¥¹¥±¡¼¥×" +.El +.It +.Tn "MAN ¥Ú¡¼¥¸¤ÎʬÀÏ" +.Bl -tag -width flag -compact -offset indent +.It "¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥Æ¥ó¥×¥ì¡¼¥È" +.El +.It +.Tn "¥¿¥¤¥È¥ë¥Þ¥¯¥í" +.It +.Tn "¥Þ¥Ë¥å¥¢¥ëÎΰ褪¤è¤Ó°ìÈ̥ƥ­¥¹¥ÈÎΰè¤Î¾Ò²ð" +.Bl -tag -width flag -compact -offset indent +.It "¤³¤Î̾Á°¤Ë¤Ï²¿¤¬...?" +.It "°ìÈÌŪ¤Ê¹½Ê¸" +.El +.It +.Tn "¥Þ¥Ë¥å¥¢¥ëÎΰè" +.Bl -tag -width flag -compact -offset indent +.It "¥¢¥É¥ì¥¹" +.It "ºî¼Ô̾" +.It "°ú¿ô" +.It "¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥óÀë¸À (¥»¥¯¥·¥ç¥ó 4 ¤Î¤ß)" +.It "¥³¥Þ¥ó¥É½¤¾þ»Ò" +.It "ÄêµÁºÑ¤ß¤ÎÊÑ¿ô" +.It "errno (¥»¥¯¥·¥ç¥ó 2 ¤Î¤ß)" +.It "´Ä¶­ÊÑ¿ô" +.It "´Ø¿ô¤Î°ú¿ô" +.It "´Ø¿ô¤ÎÀë¸À" +.It "¥Õ¥é¥°" +.It "´Ø¿ô (¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó)" +.It "´Ø¿ô¤Î·¿" +.\" .It "¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë (¥½¡¼¥¹¥³¡¼¥É¤ò´Þ¤à)" +.It "¥é¥¤¥Ö¥é¥ê̾" +.It "ÂÐÏÃŪ¤Ê¥³¥Þ¥ó¥É" +.It "̾¾Î" +.It "¥ª¥×¥·¥ç¥ó" +.It "¥Ñ¥¹Ì¾" +.It "ɸ½à" +.It "ÊÑ¿ô" +.It "¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹" +.El +.It +.Tn "°ìÈ̥ƥ­¥¹¥ÈÎΰè" +.Bl -tag -width flag -compact -offset indent +.It "AT&T ¥Þ¥¯¥í" +.It "BSD ¥Þ¥¯¥í" +.It "FreeBSD/NetBSD/OpenBSD ¥Þ¥¯¥í" +.It "UNIX ¥Þ¥¯¥í" +.It "°Ï¤¤/¥¯¥©¡¼¥È ¥Þ¥¯¥í" +.Bl -tag -width flag -compact -offset indent +.It "¥«¥®³ç¸Ì <> ¤Ë¤è¤ë¥¯¥©¡¼¥È/°Ï¤¤" +.It "³Ñ³ç¸Ì [] ¤Ë¤è¤ë¥¯¥©¡¼¥È/°Ï¤¤" +.It "Æó½Å°úÍÑÉä¥Þ¥¯¥í/°Ï¤¤" +.It "³ç¸Ì () ¤Ë¤è¤ë¥¯¥©¡¼¥È/°Ï¤¤" +.It "°ì½Å°úÍÑÉä¤Ë¤è¤ë¥¯¥©¡¼¥È/°Ï¤¤" +.It "¥×¥ì¥Õ¥£¥Ã¥¯¥¹¥Þ¥¯¥í" +.El +.It "no\-op ¤â¤·¤¯¤ÏÄ̾ï¥Æ¥­¥¹¥È¥Þ¥¯¥í" +.It "¶õÇò¤Ê¤·¥Þ¥¯¥í" +.It "¥»¥¯¥·¥ç¥ó¤Î¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹" +.It "»²¹Íʸ¸¥¤È°úÍÑ" +.It "Ìá¤êÃÍ (¥»¥¯¥·¥ç¥ó 2 ¤ª¤è¤Ó 3 ¤Î¤ß)" +.It "¾¦É¸Ì¾ (Ƭ»ú¸ì¤È¥¿¥¤¥×̾)" +.It "³ÈÄ¥°ú¿ô" +.El +.It +.Tn "¥Ú¡¼¥¸¹½Â¤Îΰè" +.Bl -tag -width flag -compact -offset indent +.It "¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À" +.It "ÃÊÍî¤È¹Ô¥¹¥Ú¡¼¥¹" +.It "¥­¡¼¥×" +.It "Î㼨¤È¥Ç¥£¥¹¥×¥ì¥¤" +.It "¥Õ¥©¥ó¥È¥â¡¼¥É (¶¯Ä´¡¢¥ê¥Æ¥é¥ë¡¢¤ª¤è¤Ó¥·¥ó¥Ü¥ê¥Ã¥¯)" +.It "¥ê¥¹¥È¤ÈÎó" +.El +.It +.Tn "ÄêµÁºÑ¤ß¤Îʸ»úÎó" +.It +.Tn "¿ÇÃÇ" +.It +.Tn "GROFF¡¢TROFF¡¢¤ª¤è¤Ó NROFF ¤ò»ÈÍѤ·¤¿¥Õ¥©¡¼¥Þ¥Ã¥Æ¥£¥ó¥°" +.It +.Tn "¥Ð¥°" +.El +.Sh TROFF ¤ËÆÃÍ­¤Êɽ¸½ +.Nm \-mdoc +¥Ñ¥Ã¥±¡¼¥¸¤Ï man ¥Ú¡¼¥¸¤òµ­½Ò¤¹¤ë¥×¥í¥»¥¹¤ò´Êñ¤Ë¤¹¤ë¤³¤È¤ò +ÌÜŪ¤È¤·¤Æ¤¤¤Þ¤¹¡£ +.Nm \-mdoc +¤ò»È¤¦¤¿¤á¤Ë +.Xr troff 1 +¤Î¥´¥¿¥´¥¿¤·¤¿¾ÜºÙ¤ò³Ø¤ÖɬÍפ¬¤Ê¤¤¤Î¤¬ÍýÁۤǤ¹¤¬¡¢ +¤¤¤¯¤Ä¤«ÊÒÉÕ¤±¤ë¤Ù¤­Èò¤±¤é¤ì¤Ê¤¤À©¸Â»ö¹à¤¬¤¢¤ê¤Þ¤¹¡£ +¤Þ¤¿¡¢¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ï¹â®¤Ç +.Em ¤Ê¤¤ +¤È¤¤¤¦¤³¤È¤âͽ¤á·Ù¹ð¤·¤Æ¤ª¤­¤Þ¤¹¡£ +.Ss ¥Þ¥¯¥í¤Î»ÈÍÑÊýË¡ +.Xr troff 1 +¤Î¤è¤¦¤Ë¡¢¥Þ¥¯¥í¤Ï +.Ql \&\. +(¥É¥Ã¥Èʸ»ú) +¤ò¹ÔƬ¤ËÃÖ¤­¡¢¤½¤ì¤Ë³¤±¤Æ 2 ʸ»ú¤«¤é¤Ê¤ë¥Þ¥¯¥í¤Î̾¾Î¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤Æ +¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£ +°ú¿ô¤Ï¥Þ¥¯¥í¤Î¸å¤Ë¥¹¥Ú¡¼¥¹¤Ç¶èÀڤäƻØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +¹ÔƬ¤Ë¥É¥Ã¥Èʸ»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤Æ +.Xr troff 1 +¤Ë¤½¤ì¤Ë³¤¯ 2 ʸ»ú¤ò¥Þ¥¯¥í̾¤È¤·¤Æ²ò¼á¤¹¤ë¤è¤¦»Ø¼¨¤·¤Æ¤¤¤Þ¤¹¡£ +¥Þ¥¯¥í¤òµ¯Æ°¤»¤º¤Ë¡¢¤¢¤ëʸ̮¤Î¹Ô¤ÎÀèƬ¤Ë +.Ql \&\. +(¥É¥Ã¥Èʸ»ú) +¤òÃÖ¤¯¤¿¤á¤Ë¤Ï¡¢ +.Ql \&\. +(¥É¥Ã¥È) ¤ÎÁ°¤Ë¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ +.Ql \e& +¤ò»ØÄꤷ¤Þ¤¹¡£ +.Ql \e& +¤Ïʸ»úÄ̤ꥹ¥Ú¡¼¥¹Éý¤¬ 0 ¤È¤·¤Æ²ò¼á¤µ¤ì¡¢½ÐÎϤˤϸ½¤ì¤Þ¤»¤ó¡£ +.Pp +°ìÈÌŪ¤Ë +.Xr troff 1 +¥Þ¥¯¥í¤Ï°ú¿ô¤ò 9 ¤Ä¤Þ¤Ç¼è¤ë¤³¤È¤¬¤Ç¤­¡¢¤½¤ì°Ê¾å»ØÄꤵ¤ì¤¿°ú¿ô¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£ +.Nm \-mdoc +¤Ç¤Î¤Û¤È¤ó¤É¤Î¥Þ¥¯¥í¤Ï 9 ¤Ä¤Î°ú¿ô¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¡¢ +¸Â¤é¤ì¤¿¾ì¹ç¤Ë¤Î¤ß°ú¿ô¤Ï¼¡¤Î¹Ô¤Ë³¤±¤Æ»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹ ( +.Sx ³ÈÄ¥°ú¿ô +¥»¥¯¥·¥ç¥ó¤ò»²¾È)¡£ +¤¤¤¯¤Ä¤«¤Î¥Þ¥¯¥í¤Ï°úÍÑÉä¤Ë°Ï¤Þ¤ì¤¿°ú¿ô¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹ (²¼¤Î +.Sx °ú¿ô¤Ë¶õÇòʸ»ú¤ò»ØÄꤹ¤ë +¥»¥¯¥·¥ç¥ó¤ò»²¾È)¡£ +.Pp +.Nm \-mdoc +¤Ç¤Î°ìÈ̥ƥ­¥¹¥ÈÎΰè¤È¥Þ¥Ë¥å¥¢¥ëÎΰè¤Î¤Û¤È¤ó¤É¤Î¥Þ¥¯¥í¤ÏÆÃÊ̤Ǥ¢¤ê¡¢ +¤½¤Î°ú¿ô¤Î¥ê¥¹¥È¤Ï¸Æ¤Ó½Ð¤·²Äǽ¤Ê¥Þ¥¯¥í̾¤È¤·¤Æ +.Em ²òÀÏ +¤µ¤ì¤Þ¤¹¡£ +¤³¤ì¤Ï°ìÈ̥ƥ­¥¹¥ÈÎΰè¤Þ¤¿¤Ï¥Þ¥Ë¥å¥¢¥ëÎΰè¤Î¥Þ¥¯¥í̾¤Ë°ìÃפ·¡¢ +¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¢¤ë¤ÈȽÃǤµ¤ì¤¿°ú¿ô¥ê¥¹¥È¤ÎÃæ¤Î°ú¿ô¤Ï¡¢ +¼Â¹Ô¤µ¤ì¤ë¤«¡¢¤½¤ì¤¬½èÍý¤µ¤ì¤ë»þ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¤³¤È¤ò°ÕÌ£¤·¤Æ¤¤¤Þ¤¹¡£ +¤³¤Î¾ì¹ç¡¢°ú¿ô¤Ï¥Þ¥¯¥í̾¤Ë¤â´Ø¤ï¤é¤º¡¢ +.Ql \&\. +(¥É¥Ã¥È) +¤ÇÁ°ÃÖ¤µ¤ì¤Þ¤»¤ó¡£ +¤³¤Î¤è¤¦¤Ë¤·¤Æ¤¿¤¯¤µ¤ó¤Î¥Þ¥¯¥í¤òÆþ¤ì»Ò¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +Î㤨¤Ð¥ª¥×¥·¥ç¥ó¥Þ¥¯¥í +.Ql \&.Op +¤Ï¥Õ¥é¥°¥Þ¥¯¥í +.Ql \&Fl +¤È°ú¿ô¥Þ¥¯¥í +.Ql \&Ar +¤ò +.Em ¸Æ¤Ó½Ð¤·¤Æ +¡¢¥ª¥×¥·¥ç¥ó¤Î¥Õ¥é¥°¤ò°ú¿ô¤È¤È¤â¤Ë»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Bl -tag -width "\&.Op \&Fl s \&Ar bytes" -offset indent +.It Op Fl s Ar bytes +¤Ï +.Li \&.Op \&Fl s \&Ar bytes +¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤ë +.El +.Pp +2 ʸ»ú¤«¤é¤Ê¤ëʸ»úÎó¤ò¥Þ¥¯¥í̾¤È¤·¤Æ²ò¼á¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¡¢ +¤½¤Îʸ»úÎó¤ÎÁ°¤Ë¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ +.Ql \e& +¤ò»ØÄꤷ¤Þ¤¹¡£ +.Bl -tag -width "\&.Op \&Fl s \&Ar bytes" -offset indent +.It Op \&Fl s \&Ar bytes +¤Ï +.Li \&.Op \e&Fl s \e&Ar bytes +¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤ë +.El +.Pp +¤³¤³¤Çʸ»úÎó +.Ql \&Fl +¤È +.Ql \&Ar +¤Ï¥Þ¥¯¥í¤È¤·¤Æ²ò¼á¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ +Ëܥɥ­¥å¥á¥ó¥È¤È´ØÏ¢¤Î¥¯¥¤¥Ã¥¯¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë +.Xr mdoc 7 +¤òÄ̤·¤Æ¡¢ +°ú¿ô¥ê¥¹¥È¤¬¸Æ¤Ó½Ð¤·²Äǽ¤Ê°ú¿ô¤È¤·¤Æ²òÀϤµ¤ì¤ë¥Þ¥¯¥í¤Ï¡Ö²òÀϤµ¤ì¤ë¡×¡¢ +°ú¿ô¥ê¥¹¥È¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¥Þ¥¯¥í¤Ï¡Ö¸Æ¤Ó½Ð¤·²Äǽ¡× +¤Èɽ¸½¤·¤Þ¤¹¡£ +.Nm \-mdoc +¤Î¤Û¤È¤ó¤É¤¹¤Ù¤Æ¤Î¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¤ë¤Î¤Ç¤¹¤«¤é¡¢¤³¤ì¤Ïµ»½ÑŪ¤Ë¤Ï +.Em ÉԶ࿵¤Ê +¤³¤È¤Ç¤¹¤¬¡¢¾ï¤Ë¥Þ¥¯¥í¤ò¡Ö¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¢¤ë¡×¤È¤«¡Ö¾¤Î¥Þ¥¯¥í¤ò +¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡×¤Èɽ¸½¤¹¤ë¤Î¤ÏÌÌÅݤʤ³¤È¤Ç¤¢¤ë¤¿¤á¡¢ +¡Ö²òÀϤµ¤ì¤ë¡×¤È¤¤¤¦ÍѸ줬»È¤ï¤ì¤Æ¤¤¤Þ¤¹¡£ +.Ss °ú¿ô¤Ë¶õÇòʸ»ú¤ò»ØÄꤹ¤ë +¤Ò¤È¤Ä°Ê¾å¤Î¶õÇòʸ»ú¤ò´Þ¤àʸ»úÎó¤ò¤Ò¤È¤Ä¤Î°ú¿ô¤È¤·¤Æ»ØÄꤷ¤¿¤¤¾ì¹ç¤¬ +¤è¤¯¤¢¤ê¤Þ¤¹¡£ +¤³¤ì¤Ï 9 ¸Ä¤ò±Û¤¨¤ë°ú¿ô¤ò»ØÄê¤Ç¤­¤Ê¤¤¤È¤¤¤¦À©¸Â¤ËÂн褷¤¿¤ê¡¢ +°ú¿ô¤Î¥ê¥¹¥È¤Ë¤¢¤ëÆÃÍ­¤ÊÇÛÃÖ¤ò¤ª¤³¤Ê¤¦¤³¤È¤¬É¬Íפʥޥ¯¥í¤Ë°ú¿ô¤ò»ØÄꤹ¤ë¤è¤¦¤Ê +¾ì¹ç¤ËɬÍפȤʤ뤳¤È¤¬¤¢¤ê¤Þ¤¹¡£ +¤¿¤È¤¨¤Ð¡¢´Ø¿ô¥Þ¥¯¥í +.Ql \&.Fn +¤Ç¤ÏºÇ½é¤Î°ú¿ô¤Ï´Ø¿ô̾¤Ç¤¢¤ê¡¢»Ä¤ê¤Î°ú¿ô¤¬´Ø¿ô¤Î¥Ñ¥é¥á¡¼¥¿¤Ç¤¢¤ë¤³¤È¤¬ +ɬÍפǤ¹¡£ +.Tn "ANSI C" +¤Î³ç¸Ì¤Ç°Ï¤Þ¤ì¤¿¥Ñ¥é¥á¡¼¥¿¥ê¥¹¥È¤Ë¤ª¤±¤ë´Ø¿ô¤Î¥Ñ¥é¥á¡¼¥¿¤ÎÀë¸À¤Îµ¬Äê¤Ë +¤è¤ê¡¢³Æ¥Ñ¥é¥á¡¼¥¿¤ÏºÇÄã¤Ç¤â 2 ¸ì¤Îʸ»úÎó¤È¤Ê¤ê¤Þ¤¹¡£ +¤¿¤È¤¨¤Ð +.Fa int foo +¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ +.Pp +¶õÇò¤ò´Þ¤à°ú¿ô¤ò»ØÄꤹ¤ë¤Ë¤Ï 2 Ä̤ê¤ÎÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£ +.Em ¼ÂÁõ¤Ë¤ª¤±¤ëÃí : +²òÀϤÎÁ°¤Ë¸Ä¡¹¤Î°ú¿ô¤òºÆ³ä¤êÅö¤Æ¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢ +°úÍÑÉä¤Î´Ö¤Ë¶õÇò¤ò´Þ¤á¤ÆÅϤ¹¤Î¤¬ºÇ¤âÊØÍø¤ÊÊýË¡¤Ê¤Î¤Ç¤¹¤¬¡¢ +.Tn AT&T +¤Î +.Xr troff +¤Î¤¹¤Ù¤Æ¤Î¥Þ¥¯¥í¤ò¼ÂÁõ¤¹¤ë¤Ë¤Ï½èÍý®ÅÙ¤ª¤è¤Ó¥á¥â¥ê»ÈÍÑÎ̤ÎÅÀ¤Ç +¤«¤Ê¤ê¹â²Á¤ÊÊýË¡¤È¤Ê¤ê¤Þ¤¹¡£ +.Xr groff +¤Ç¤Ï¹â²Á¤Ê½èÍý¤Ë¤Ï¤Ê¤ê¤Þ¤»¤ó¤¬¡¢°Ü¿¢À­¤Î¤¿¤á¡¢¤³¤ÎÊýË¡¤Ï +¶õÇò¤ò´Þ¤á¤ë¤³¤È¤¬ºÇ¤âɬÍפǤ¢¤ë°Ê²¼¤Î¥Þ¥¯¥í¤À¤±¤Ë¸Â¤Ã¤Æ¤¤¤Þ¤¹¡£ +.Pp +.Bl -tag -width 4n -offset indent -compact +.It Li \&Cd +¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥óÀë¸À (¥»¥¯¥·¥ç¥ó 4 ¤Î +.Sx SYNOPSIS ) +.It Li \&Bl +¥ê¥¹¥È³«»Ï (Éý»ØÄêÍÑ) +.It Li \&Em +¥Æ¥­¥¹¥È¶¯Ä´ +.It Li \&Fn +´Ø¿ô (¥»¥¯¥·¥ç¥ó 2 ¤È 4) +.It Li \&It +¥ê¥¹¥È¤Î¹àÌÜ +.It Li \&Li +¥ê¥Æ¥é¥ë¥Æ¥­¥¹¥È +.It Li \&Sy +¥·¥ó¥Ü¥ê¥Ã¥¯¥Æ¥­¥¹¥È +.It Li \&%B +½ñÀҤΥ¿¥¤¥È¥ë +.It Li \&%J +Äê´ü´©¹Ôʪ¤Î¥¿¥¤¥È¥ë +.It Li \&%O +»²¾È¤ÎÄɲÃŪ¤ÊÃí¼á +.It Li \&%R +Êó¹ð½ñ¤Î¥¿¥¤¥È¥ë (»²¾È¤ÎÃæ¤Ç) +.It Li \&%T +½ñÀҤ⤷¤¯¤ÏÄê´ü´©¹Ôʪ¤ÎÃæ¤Îµ­»ö¤Î¥¿¥¤¥È¥ë +.El +.Pp +¶õÇò¤ò´Þ¤àʸ»úÎó¤òÅϤ¹¤Î¤Ë¡¢¸ÇÄê¶õÇò¡¢¤¹¤Ê¤ï¤ÁµÍ¤á¹þ¤Þ¤ì¤Ê¤¤¶õÇòʸ»ú +.Ql \e\ +¤ò»È¤¦ÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£¤¹¤Ê¤ï¤Á¡¢¶õÇò¤ÎÁ°¤Ë¥¨¥¹¥±¡¼¥×ʸ»ú +.Ql \e +¤ò»ØÄꤹ¤ëÊýË¡¤Ç¤¹¡£ +¤³¤ÎÊýË¡¤Ï¤É¤Î¥Þ¥¯¥í¤Ç¤â»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¤¬¡¢1 ¹Ô¤ò±Û¤¨¤ëŤµ¤Î¥Æ¥­¥¹¥È¤Î +Ä´À°¤Î¼ÙËâ¤Ë¤Ê¤ë¤È¤¤¤¦ÉûºîÍѤ¬¤¢¤ê¤Þ¤¹¡£ +.Xr troff +¤Ç¤Ï¸ÇÄê¶õÇò¤Ï¾¤Î°õºþ²Äǽʸ»ú¤ÈƱÍͤ˰·¤ï¤ì¡¢Ä̾ï´üÂÔ¤µ¤ì¤ë¤è¤¦¤Ë¡¢ +¤½¤³¤Çʸ»úÎó¤ò¶õÇò¤ä²þ¹Ô¤Çʬ¤±¤ë¤³¤È¤ò¹Ô¤Ê¤ï¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£ +¤³¤ÎÊýË¡¤Ïʸ»úÎ󤬹Ԥζ­³¦¤ò¤Þ¤¿¤¬¤Ê¤¤¤Ç¤¢¤í¤¦¾ì¹ç¤ËÍ­ÍѤǤ¹¡£ +Î㤨¤Ð¡¢ +.Bl -tag -width "fetch(char *str)" -offset indent +.It Fn fetch char\ *str +¤Ï +.Ql \&.Fn fetch char\e *str +¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤ë +.It Fn fetch "char *str" +¤Ï +.Ql \&.Fn fetch "\\*qchar *str\\*q" +¤Ç¤âÀ¸À®¤µ¤ì¤ë +.El +.Pp +¤â¤· +.Ql \e +¤ä°úÍÑÉ䤬¾Ê¤«¤ì¤ë¤È¡¢ +.Ql \&.Fn +¤Ï°ú¿ô¤ò 3 ¤Ä¼è¤ê¡¢¤½¤Î·ë²Ì¤Ï +.Pp +.Dl Fn fetch char *str +.Pp +¤È¤Ê¤ê¤Þ¤¹¡£ +.Pp +¥Ñ¥é¥á¡¼¥¿¤Î¥ê¥¹¥È¤¬²þ¹Ô¤Î¶­³¦¤ò¤Þ¤¿¤°¾ì¹ç¤Ë²¿¤¬¤ª¤³¤ë¤«¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.Sx ¥Ð¥° +¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ +.Ss ¹ÔËö¤Î¶õÇòʸ»ú +.Xr troff +¤Ï¹ÔËö¤Ë¶õÇòʸ»ú¤¬¤¢¤ë¤Èº®Í𤷤Ƥ·¤Þ¤¦¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£ +<¶õÇò><¹ÔËö>¤Îʸ»ú¥·¡¼¥±¥ó¥¹¤«¤é¤¹¤Ù¤Æ¤Î¶õÇòʸ»ú¤ò¼è¤ê½ü¤¯¤Î¤ÏÎɤ¤Í½Ëɺö¤Ç¤¹¡£ +¤É¤¦¤·¤Æ¤â¹ÔËö¤Ë¶õÇòʸ»ú¤ò¤ª¤¯É¬Í×À­¤¬½Ð¤Æ¤­¤¿¾ì¹ç¤Ï¡¢ +µÍ¤á¹þ¤Þ¤ì¤Ê¤¤¶õÇò¤È¥¨¥¹¥±¡¼¥×ʸ»ú +.Ql \e& +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë¤è¤Ã¤ÆÂбþ¤Ç¤­¤Þ¤¹¡£ +Î㤨¤Ð¡¢ +.Ql string\e\ \e& +¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£ +.Ss Æüìʸ»ú¤Î¥¨¥¹¥±¡¼¥× +²þ¹Ô +.Ql \en +¤Î¤è¤¦¤ÊÆüìʸ»ú¤Ï +.Ql \e +¤ò +.Ql \ee +¤ÇÃÖ¤­´¹¤¨¤ë +(¤¹¤Ê¤ï¤Á +.Ql \een +¤È¤¹¤ë) ¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤ò»Ä¤·¤Æ°·¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Sh MAN ¥Ú¡¼¥¸¤ÎʬÀÏ +man ¥Ú¡¼¥¸¤ÎËÜʸ¤Ï¥Õ¥¡¥¤¥ë +.Pa /usr/share/misc/mdoc.template +¤Î´ðËܥƥó¥×¥ì¡¼¥È¤ò»È¤Ã¤ÆÍưפ˺î¤ê¾å¤²¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Pa /usr/share/examples/mdoc +¤Ë¤Ï¤¤¤¯¤Ä¤«¤Î¥µ¥ó¥×¥ë¤Î man ¥Ú¡¼¥¸¤¬¼ý¤á¤é¤ì¤Æ¤¤¤Þ¤¹¡£ +.Pp +.Ss ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥Æ¥ó¥×¥ì¡¼¥È +.Bd -literal -offset indent +\&.\e" °Ê²¼¤Î¹àÌܤϤ¹¤Ù¤Æ¤Î man ¥Ú¡¼¥¸¤ÇɬÍפʹàÌܤǤ¹¡£ +\&.Dd ·î\ Æü, ǯ +\&.Os ¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à [¥Ð¡¼¥¸¥ç¥ó/¥ê¥ê¡¼¥¹] +\&.Dt ¥É¥­¥å¥á¥ó¥È¥¿¥¤¥È¥ë [¥»¥¯¥·¥ç¥óÈÖ¹æ] [¥Ü¥ê¥å¡¼¥à] +\&.Sh NAME +\&.Nm ̾¾Î +\&.Nd ̾¾Î¤Î 1 ¹Ô¤Ç¤ÎÀâÌÀ +\&.Sh SYNOPSIS +\&.Sh DESCRIPTION +\&.\e" °Ê²¼¤Î¹àÌܤˤĤ¤¤Æ¤Ï¡¢É¬Íפ˱þ¤¸¤Æ¥³¥á¥ó¥È¤ò¤Ï¤º¤·¤Æ»ÈÍѤ·¤Æ¤¯ +\&.\e" ¤À¤µ¤¤¡£ +\&.\e" .Sh IMPLEMENTATION NOTES +\&.\e" ¤³¤Î¼¡¤Î¹àÌܤϥ»¥¯¥·¥ç¥ó 2, 3, 9 ¤Ç¤Î¤ßɬÍפʡ¢´Ø¿ô¤Î +\&.\e" Ìá¤êÃͤǤ¹¡£ +\&.\e" .Sh RETURN VALUE +\&.\e" ¼¡¤Î¹àÌܤϥ»¥¯¥·¥ç¥ó 1, 6, 7, 8, 9 ¤Ç¤Î¤ßɬÍפʤâ¤Î¤Ç¤¹¡£ +\&.\e" .Sh ENVIRONMENT +\&.\e" .Sh FILES +\&.\e" .Sh EXAMPLES +\&.\e" ¼¡¤Î¹àÌܤϥ»¥¯¥·¥ç¥ó 1, 6, 7, 8, 9 ¤Ç¤Î¤ßɬÍפʤâ¤Î¤Ç¤¹¡£ +\&.\e" ((¥·¥§¥ë¤Ø¤Î)¥³¥Þ¥ó¥É¤ÎÌá¤êÃÍ¤È fprintf/stderr ¤Î·¿¤Î¿ÇÃÇ +\&.\e" ¤Ç¤¹¡£) +\&.\e" .Sh DIAGNOSTICS +\&.\e" .Sh COMPATIBILITY +\&.\e" ¼¡¤Î¹àÌܤϥ»¥¯¥·¥ç¥ó 2, 3, 9 ¤Ç¤Î¤ßɬÍפʡ¢¥¨¥é¡¼¥Ï¥ó¥É¥ê¥ó¥°¤È +\&.\e" ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥ê¥ó¥°¤Ç¤¹¡£ +\&.\e" .Sh ERRORS +\&.\e" .Sh SEE ALSO +\&.\e" .Sh STANDARDS +\&.\e" .Sh HISTORY +\&.\e" .Sh AUTHORS +\&.\e" .Sh BUGS +.Ed +.Pp +¤³¤Î¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤ª¤±¤ëºÇ½é¤Î¹àÌܤϥޥ¯¥í +.Pq Li \&.Dd , \&.Os , \&.Dt +¤Ç¤¢¤ê¡¢¤½¤ì¤¾¤ì¥É¥­¥å¥á¥ó¥È¤ÎÆüÉÕ¡¢ +man ¥Ú¡¼¥¸¤â¤·¤¯¤ÏÂêºà¤È¤Ê¤Ã¤Æ¤¤¤ë¥½¡¼¥¹¤Î³«È¯¤äÊѹ¹¤Î¥Ù¡¼¥¹¤È¤Ê¤Ã¤¿ +¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¡¢ +.Pq Em Âçʸ»ú¤Ç +man ¥Ú¡¼¥¸¥¿¥¤¥È¥ë¤ò¤½¤Î¥Ú¡¼¥¸¤¬Â°¤¹¤ë¥Þ¥Ë¥å¥¢¥ë¤Î¥»¥¯¥·¥ç¥óÈÖ¹æ¤È¤È¤â¤Ë +»ØÄꤷ¤¿¤â¤Î¡¢¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï¤½¤Î¥Ú¡¼¥¸¤ò¼±Ê̤¹¤ë¤â¤Î¤Ç¤¢¤ê¡¢¸å½Ò¤Î +.Sx ¥¿¥¤¥È¥ë¥Þ¥¯¥í +¤ÇµÄÏÀ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +.Pp +¥Æ¥ó¥×¥ì¡¼¥ÈÃæ¤Î»Ä¤ê¤Î¹àÌܤϥ»¥¯¥·¥ç¥ó¤Î¥Ø¥Ã¥À +.Pq Li \&.Sh +¤Ç¤¢¤ê¡¢¤½¤ì¤é¤Î¤¦¤Á +.Sx NAME +¤È +.Sx SYNOPSIS +¤È +.Sx DESCRIPTION +¤Ïɬ¿Ü¹àÌܤǤ¹¡£ +¤³¤ì¤é¤Î¥Ø¥Ã¥À¤Ë¤Ä¤¤¤Æ¤Ï +.Sx ¥Þ¥Ë¥å¥¢¥ëÎΰè +¤òÀâÌÀ¤·¤¿¸å¡¢ +.Sx ¥Ú¡¼¥¸¹½Â¤Îΰè +¤ÇµÄÏÀ¤µ¤ì¤Þ¤¹¡£ +¤¤¤¯¤Ä¤«¤Î¥³¥ó¥Æ¥ó¥È¥Þ¥¯¥í¤Ï¥Ú¡¼¥¸¥ì¥¤¥¢¥¦¥È¥Þ¥¯¥í¤ÎÀâÌÀ¤Ë +»È¤ï¤ì¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¥Ú¡¼¥¸¥ì¥¤¥¢¥¦¥È¥Þ¥¯¥í¤ÎÁ°¤Ë¥³¥ó¥Æ¥ó¥È¥Þ¥¯¥í¤Ë¤Ä¤¤¤Æ +Æɤळ¤È¤ò¿ä¾©¤·¤Þ¤¹¡£ +.Sh ¥¿¥¤¥È¥ë¥Þ¥¯¥í +¥¿¥¤¥È¥ë¥Þ¥¯¥í¤Ï¥Ú¡¼¥¸¹½Â¤Îΰè¤ÎºÇ½é¤ÎÉôʬ¤Ç¤¹¤¬¡¢man ¥Ú¡¼¥¸¤ò +Á°Æü¤Ë½ñ¤­»Ï¤á¤¿¤¤¤È¤¤¤¦¿Í¤Î¤¿¤á¤Ë¡¢ºÇ½é¤Ëʬ¤±¤Æµ­½Ò¤µ¤ì¤Þ¤¹¡£ +3 ¤Ä¤Î¥Ø¥Ã¥À¥Þ¥¯¥í¤Ç¥É¥­¥å¥á¥ó¥È¤« man ¥Ú¡¼¥¸¤Î¥¿¥¤¥È¥ë¡¢ +¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¡¢¤ª¤è¤Ó¸¶Ãø¤ÎÆüÉÕ¤ò»ØÄꤷ¤Þ¤¹¡£ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï¥É¥­¥å¥á¥ó¥È¤ÎºÇ½é¤Ë°ìÅÙ¤À¤±¸Æ¤Ó½Ð¤µ¤ì¤ë¤â¤Î¤Ç¡¢ +¥Ø¥Ã¥À¤È¥Õ¥Ã¥¿¤ò¹½À®¤¹¤ë¤¿¤á¤À¤±¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£ +.Bl -tag -width 6n +.It Li \&.Dt ¥É¥­¥å¥á¥ó¥È¥¿¥¤¥È¥ë ¥»¥¯¥·¥ç¥óÈÖ¹æ [¥Ü¥ê¥å¡¼¥à] +¥É¥­¥å¥á¥ó¥È¥¿¥¤¥È¥ë¤Ï man ¥Ú¡¼¥¸¤Î¼çÂê¤Ç¤¢¤ê¡¢troff ¤ÎÀ©¸Â¤Ë¤è¤ê +.Tn Âçʸ»ú +¤Ç¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó¡£ +¥»¥¯¥·¥ç¥óÈÖ¹æ¤Ï 1,\ ...,\ 9 ¤È¤Ê¤ê¡¢¤³¤ì¤¬»ØÄꤵ¤ì¤ë¤È +¥Ü¥ê¥å¡¼¥à¥¿¥¤¥È¥ë¤ò¾Êά¤·¤Æ¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£ +.Pp +.Fx +¤Ç¤Ï¡¢¼¡¤Î¥»¥¯¥·¥ç¥óÈÖ¹æ¤È²òÀâ¤Ë¤Ä¤¤¤Æ¸å½Ò¤·¤Þ¤¹: +.Pp +.Bl -column SMM -offset indent -compact +.It Li 1 FreeBSD General Commands Manual +.It Li 2 FreeBSD System Calls Manaul +.It Li 3 FreeBSD Library Calls Manual +.It Li 4 FreeBSD Kernel Interfaces Manual +.It Li 5 FreeBSD File Formats Manual +.It Li 6 FreeBSD Games Manual +.It Li 7 FreeBSD Miscellaneous Information Manual +.It Li 8 FreeBSD System Manager's Manual +.It Li 9 FreeBSD Kernel Developers Guide +.El +.Pp +¥Ü¥ê¥å¡¼¥à¥¿¥¤¥È¥ë¤ÏǤ°Õ¤Î¤â¤Î¤«¡¢°Ê²¼¤Î¤¦¤Á¤¤¤º¤ì¤«¤Ë¤Ê¤ê¤Þ¤¹¡£ +.\" .Cl +.\" USD UNIX User's Supplementary Documents +.\" .Cl +.\" PS1 UNIX Programmer's Supplementary Documents +.Pp +.Bl -column SMM -offset indent -compact +.It Li AMD UNIX Ancestral Manual Documents +.It Li SMM UNIX System Manager's Manual +.It Li URM UNIX Reference Manual +.It Li PRM UNIX Programmer's Manual +.El +.Pp +¥Ç¥Õ¥©¥ë¥È¤Î¥Ü¥ê¥å¡¼¥à¤Ï +¥»¥¯¥·¥ç¥ó 1, 6, 7 ¤Ç¤Ï +.Li URM +¡¢¥»¥¯¥·¥ç¥ó 8 ¤Ç¤Ï +.Li SMM +¡¢¥»¥¯¥·¥ç¥ó 2, 3, 4, 5 ¤Ç¤Ï +.Li PRM +¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ +.\" .Cl +.\" MMI UNIX Manual Master Index +.\" .Cl +.\" CON UNIX Contributed Software Manual +.\" .Cl +.\" LOC UNIX Local Manual +.It Li \&.Os ¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à ¥ê¥ê¡¼¥¹ÈÖ¹æ +¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î̾¾Î¤Ë¤Ï°ìÈÌŪ¤ÊƬ»ú¸ì (ά¾Î) +¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +Î㤨¤Ð¡¢ +.Tn BSD +¤ä +.Fx +¤ä +.Tn ATT +¤È¤¤¤Ã¤¿¤â¤Î¤Ç¤¹¡£ +¥ê¥ê¡¼¥¹ÈÖ¹æ¤Ï¡¢Î㤨¤Ð4.3, 4.3+Tahoe, V.3, V.4 ¤È¤¤¤¦¤è¤¦¤Ê³Æ¥·¥¹¥Æ¥à +¤Ç¤Îɸ½à¤Î¥ê¥ê¡¼¥¹¤Î̿̾ˡ¤ò»ÈÍѤ·¤Þ¤¹¡£ +ǧ¼±¤µ¤ì¤Ê¤¤°ú¿ô¤Ï¥Ú¡¼¥¸¤Î¥Õ¥Ã¥¿Ãæ¤Ëµ­½Ò¤µ¤ì¤¿Ä̤ê¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£ +°Ê²¼¤Ë¥Õ¥Ã¥¿¤Îŵ·¿Åª¤ÊÎã¤ò¼¨¤·¤Þ¤¹¡£ +.Pp +.Dl \&.Os 4.3BSD +.Pp +¤ä +.Dl \&.Os FreeBSD 2.2 +.Pp +¥í¡¼¥«¥ë¤Çºî¤é¤ì¤¿¥»¥Ã¥È¤ÎÎã¡£ +.Pp +.Dl \&.Os CS Department +.Pp +Berkeley ¤Ç¤Î¥Ç¥Õ¥©¥ë¥È¤Ç¤¢¤ë¡¢°ú¿ô¤Ê¤·¤Î +.Ql \&.Os +¤Ï¥µ¥¤¥È¸ÇÍ­¤Î¥Õ¥¡¥¤¥ë +.Pa /usr/share/tmac/mdoc/doc-common +¤Ë¤ª¤¤¤Æ +.Tn BSD +¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +¤³¤ì¤Ï¼ÂºÝ¤Ë¤Ï +.Tn LOCAL +¤È¤·¤ÆÄêµÁ¤¹¤Ù¤­¤Ç¤¹¡£ +.Ql \&.Os +¥Þ¥¯¥í¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ú¡¼¥¸¤Îº¸²¼³Ñ¤Ï¤ß¤Ë¤¯¤¯¤Ê¤ë¤Ç¤¢¤í¤¦¤³¤È¤Ë +Ãí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£ +.It Li \&.Dd ·î Æü, ǯ +ÆüÉդϼ¡¤Î¤è¤¦¤Ë¥Õ¥©¡¼¥Þ¥ë¤Ê·Á¼°¤Çµ­½Ò¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +.Pp +.Dl January 25, 1989 +.El +.Sh ¥Þ¥Ë¥å¥¢¥ëÎΰ褪¤è¤Ó°ìÈ̥ƥ­¥¹¥ÈÎΰè¤Î¾Ò²ð +.Ss ¤³¤Î̾Á°¤Ë¤Ï²¿¤¬...? +¥Þ¥Ë¥å¥¢¥ëÎΰè¤Î¥Þ¥¯¥í̾¤Ï¥³¥Þ¥ó¥É¤ä¥µ¥Ö¥ë¡¼¥Á¥ó¡¢¤½¤ì¤Ë´ØÏ¢¥Õ¥¡¥¤¥ë¤ò +ÀâÌÀ¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤Æ¤¤¤ëÆü¾ï¤Î¥¤¥ó¥Õ¥©¡¼¥Þ¥ë¤Ê¸ÀÍÕ¤«¤é¼è¤é¤ì¤Æ¤¤¤Þ¤¹¡£ +¤³¤Î¸ÀÍդȾ¯¤·°ã¤¦¥Ð¥ê¥¨¡¼¥·¥ç¥ó¤Î¤â¤Î¤¬ man ¥Ú¡¼¥¸¤ò½ñ¤¯¾å¤Ç¤Î +3 ¤Ä¤Î°Û¤Ê¤Ã¤¿Ì̤òµ­½Ò¤¹¤ë¤Î¤Ë»È¤ï¤ì¤Þ¤¹¡£ +ºÇ½é¤Î¤â¤Î¤Ï¡¢ +.Nm \-mdoc +¥Þ¥¯¥í»ÈÍÑÊýË¡¤ÎÀâÌÀ¤Ç¤¹¡£ +2 ÈÖÌܤΤâ¤Î¤Ï +.Nm \-mdoc +¥Þ¥¯¥í¤òÍѤ¤¤¿ +.Ux +¥³¥Þ¥ó¥É¤Îµ­½Ò¤Ç¤¹¡£ +3 ÈÖÌܤϥ³¥Þ¥ó¥É¤òÄ̾ï¤Î¸ÀÍդδ¶³Ð¤Ç¥æ¡¼¥¶¤Ë¼¨¤·¤¿¤â¤Î¤Ç¤¹¡£ +¤³¤ì¤Ï¤¹¤Ê¤ï¤Á¡¢man ¥Ú¡¼¥¸¤Î¥Æ¥­¥¹¥ÈÃæ¤Ç¤Î¥³¥Þ¥ó¥É¤ÎµÄÏÀ¤È¤Ê¤ê¤Þ¤¹¡£ +.Pp +ºÇ½é¤Î¥±¡¼¥¹¤Ç¤Ï¡¢ +.Xr troff 1 +¥Þ¥¯¥í¤Ï¤½¤ì¼«¿È¡¢°ì¼ï¤Î¥³¥Þ¥ó¥É¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ +troff ¥³¥Þ¥ó¥É¤Ï°ìÈÌŪ¤Ë°Ê²¼¤Î¤è¤¦¤Ê·Á¼°¤ò¤È¤ê¤Þ¤¹¡£ +.Bd -filled -offset indent +\&.Va argument1 argument2 ... argument9 +.Ed +.Pp +.Ql \&.Va +¤Ï¥Þ¥¯¥í¥³¥Þ¥ó¥É¤â¤·¤¯¤ÏÍ×µá¤ò¼¨¤·¤Æ¤ª¤ê¡¢¤½¤ì¤Ë³¤¯¤â¤Î¤Ï +¤¹¤Ù¤Æ°ú¿ô¤È¤·¤Æ½èÍý¤µ¤ì¤Þ¤¹¡£ +2 ÈÖÌܤΥ±¡¼¥¹¤Ç¤Ï¡¢¥³¥ó¥Æ¥ó¥È¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë +.Ux +¥³¥Þ¥ó¥É¤Îµ­½Ò¤¬¤â¤¦¾¯¤·´Þ¤Þ¤ì¤Þ¤¹¡£ +ŵ·¿Åª¤Ê +.Sx SYNOPSIS +¥³¥Þ¥ó¥É¹Ô¤Ï¤³¤Î¤è¤¦¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£ +.Bd -filled -offset indent +.Nm filter +.Op Fl flag +.Ar infile outfile +.Ed +.Pp +¤³¤³¤Ç +.Nm filter +¤Ï¥³¥Þ¥ó¥É̾¤Ç¤¢¤ê¡¢³Ñ³ç¸Ì¤Ç°Ï¤Þ¤ì¤¿Ê¸»úÎó +.Fl flag +¤Ï +.Em ¥Õ¥é¥° +°ú¿ô¤Ç¡¢¤³¤ì¤Ï³Ñ³ç¸Ì¤Ç°Ï¤à¤³¤È¤Ë¤è¤Ã¤Æ¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¤³¤È¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£ +.Nm \-mdoc +¤ÎÍѸì¤Ç¤Ï +.Ar infile +¤È +.Ar outfile +¤Ï +.Em °ú¿ô +¤È¾Î¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +¾å¤ÎÎã¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¹Ô¤Ê¤Ã¤¿¥Þ¥¯¥í¤Ï°Ê²¼¤Î¤â¤Î¤Ç¤¹¡£ +.Bd -literal -offset indent +\&.Nm filter +\&.Op \&Fl flag +\&.Ar infile outfile +.Ed +.Pp +3 ÈÖÌܤΥ±¡¼¥¹¤Ç¤Ï¡¢¥³¥Þ¥ó¥É¤ÎÀâÌÀ¤ä¹½Ê¸¤Ë¾åµ­¤ÎÎã¤ÎξÊý¤¬»È¤ï¤ì¡¢ +¤µ¤é¤ËºÙ¤«¤¤µ­½Ò¤¬Äɲ䵤ì¤ë¤Ç¤·¤ç¤¦¡£ +¾å¤ÎÎã¤Ç¤Î°ú¿ô +.Ar infile +¤È +.Ar outfile +¤Ï +.Em ¥ª¥Ú¥é¥ó¥É +¤â¤·¤¯¤Ï +.Em ¥Õ¥¡¥¤¥ë°ú¿ô +¤È¤·¤Æ»²¾È¤µ¤ì¤Þ¤¹¡£ +¥³¥Þ¥ó¥É¹Ô¤Î°ú¿ô¤Î¥ê¥¹¥È¤Ï¤«¤Ê¤êŤ¯¤Ê¤ë¾ì¹ç¤â¤¢¤ê¤Þ¤¹¡£ +.Bl -tag -width make -offset indent +.It Nm make +.Op Fl eiknqrstv +.Op Fl D Ar variable +.Op Fl d Ar flags +.Op Fl f Ar makefile +.Bk -words +.Op Fl I Ar directory +.Ek +.Op Fl j Ar max_jobs +.Op Ar variable=value +.Bk -words +.Op Ar target ... +.Ek +.El +.Pp +¤³¤³¤Ç¤Ï¥³¥Þ¥ó¥É +.Nm make +¤Ë¤Ä¤¤¤Æµ­½Ò¤·¤Æ¤ª¤ê¡¢ +.Ar makefile +¤ò¥Õ¥é¥° +.Fl f +¤Î°ú¿ô¤È¤·¤Æ¤¤¤Þ¤¹¡£ +¤Þ¤¿¥ª¥×¥·¥ç¥ó¤Î¥Õ¥¡¥¤¥ë¥ª¥Ú¥é¥ó¥É +.Ar target +¤Ë¤Ä¤¤¤Æ¤âµÄÏÀ¤·¤Æ¤¤¤Þ¤¹¡£ +¸ÀÍդǤÎÀâÌÀ¤Ç¤Ï¡¢¤³¤¦¤¤¤Ã¤¿¾ÜºÙ¤Êµ­½Ò¤¬º®Íð¤òËɤ¤¤Ç¤¯¤ì¤Þ¤¹¤¬¡¢ +.Nm \-mdoc +¥Ñ¥Ã¥±¡¼¥¸¤Ë¤Ï¥Õ¥é¥° +.Em ¤Ø¤Î +°ú¿ô¤Î¤¿¤á¤Î¥Þ¥¯¥í¤¬¤¢¤ê¤Þ¤»¤ó¡£ +¤½¤ÎÂå¤ï¤ê¤Ë +.Ar target +¤Î¤è¤¦¤Ê¥ª¥Ú¥é¥ó¥É¤ä¥Õ¥¡¥¤¥ë°ú¿ô¤Ë»È¤ï¤ì¤ë°ú¿ô¥Þ¥¯¥í +.Ql \&Ar +¤¬ +.Ar variable +¤Î¤è¤¦¤Ê¥Õ¥é¥°¤Ø¤Î°ú¿ô¤Ë¤â»È¤ï¤ì¤Þ¤¹¡£ +¤³¤Î make ¥³¥Þ¥ó¥É¹Ô¤Ï°Ê²¼¤Î»ØÄê¤Ë¤è¤êÀ¸À®¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +.Bd -literal -offset indent +\&.Nm make +\&.Op Fl eiknqrstv +\&.Op Fl D Ar variable +\&.Op Fl d Ar flags +\&.Op Fl f Ar makefile +\&.Op Fl I Ar directory +\&.Op Fl j Ar max_jobs +\&.Op Ar variable=value +\&.Bk -words +\&.Op Ar target ... +\&.Ek +.Ed +.Pp +¥Þ¥¯¥í +.Ql \&.Bk +¤È +.Ql \&.Ek +¤Ï +.Sx ¥­¡¼¥× +¥»¥¯¥·¥ç¥ó¤Ë¤ª¤¤¤Æ²òÀ⤵¤ì¤Æ¤¤¤Þ¤¹¡£ +.Ss °ìÈÌŪ¤Ê¹½Ê¸ +¥Þ¥Ë¥å¥¢¥ëÎΰè¤È°ìÈ̥ƥ­¥¹¥ÈÎΰè¤Î¥Þ¥¯¥í¤Ï¤¤¤¯¤Ä¤«¤Î¾®¤µ¤Ê°ã¤¤ +¤¬¤¢¤ë¤â¤Î¤Î¡¢Æ±Íͤʹ½Ê¸¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£ +.Ql \&.Ar , +.Ql \&.Fl , +.Ql \&.Nm , +.Ql \&.Pa +¤Ï°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤Î¤ß°Û¤Ê¤ê¤Þ¤¹¡£ +.Ql \&.Fn +¤È +.Ql \&.Xr +¤Ï°ú¿ô¤Î¥ê¥¹¥È¤Î½çÈÖ¤¬°Û¤Ê¤ê¤Þ¤¹¡£ +¥Þ¥¯¥í +.Ql \&.Op +¤È +.Ql \&.Fn +¤Ë¤ÏÆþ¤ì»Ò¤ÎÀ©¸Â¤¬¤¢¤ê¤Þ¤¹¡£ +¤¹¤Ù¤Æ¤Î¥³¥ó¥Æ¥ó¥È¥Þ¥¯¥í¤¬¶çÆÉÅÀ¤òǧ¼±¤·¡¢Àµ¤·¤¯°·¤¦¤Ë¤Ï¡¢ +³Æ¡¹¤Î¶çÆÉÅÀʸ»ú¤¬Àè¹Ô¤¹¤ë¶õÇò¤ÇʬΥ¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ +°Ê²¼¤Î¤è¤¦¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.Pp +.Dl \&.Li sptr, ptr), +.Pp +¤½¤Î·ë²Ì¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ +.Pp +.Dl Li sptr, ptr), +.Pp +¤³¤³¤Ç¤Ï¶çÆÉÅÀ¤Ïǧ¼±¤µ¤ì¤º¤¹¤Ù¤Æ¤Î½ÐÎϤϥê¥Æ¥é¥ë¤Ê¥Õ¥©¥ó¥È¤Ç¹Ô¤Ê¤ï¤ì¤Æ +¤¤¤Þ¤¹¡£¶çÆÉÅÀ¤¬¶õÇòʸ»ú¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.Pp +.Dl \&.Li "sptr , ptr ) ," +.Pp +·ë²Ì¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ +.Pp +.Dl Li sptr , ptr ) , +.Pp +º£Å٤϶çÆÉÅÀ¤¬Ç§¼±¤µ¤ì¡¢½ÐÎϤϥǥե©¥ë¥È¤Î¥Õ¥©¥ó¥È¤Ç¹Ô¤Ê¤ï¤ì +¥ê¥Æ¥é¥ë¥Õ¥©¥ó¥È¤Îʸ»úÎó¤È¶èÊ̤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +.Pp +.Ql \e& +¤Ç¥¨¥¹¥±¡¼¥×¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¶çÆÉÅÀʸ»ú¤ÎÆÃÊ̤ʰÕÌ£¤ò¼è¤ê½ü¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Xr troff +¤Ï¥Þ¥¯¥í¸À¸ì¤È¤·¤Æ¤Î¸Â³¦¤«¤é¡¢¿ô³Ø¡¢ÏÀÍý³Ø¡¢¤â¤·¤¯¤Ï°Ê²¼¤Î°úÍÑÉä¤Î +½¸¹ç¤Î¥á¥ó¥Ð¤ò´Þ¤ó¤Àʸ»úÎó¤òɽ¸½¤¹¤ë¤Î¤Ïº¤Æñ¤Ç¤¹¡£ +.Bd -literal -offset indent-two +\&{+,\-,/,*,\&%,<,>,<=,>=,=,==,&,`,',"} +.Ed +.Pp +.Xr troff +¤¬Ê¸»ú¤Ë¤è¤Ã¤Æ¼¨º¶¤µ¤ì¤Æ¤¤¤ëÁàºî¤â¤·¤¯¤Ïɾ²Á¤ò¼ÂºÝ¤Ë¹Ô¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤¬¡¢ +¤½¤ÎÌäÂê¤Î¸¶°ø¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ +.Ql \e& +¤Ç¤³¤ì¤é¤ò¥¨¥¹¥±¡¼¥×¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¤³¤ì¤é¤Îʸ»ú¤¬Í½´ü¤»¤º¤Ë +ɾ²Á¤µ¤ì¤ë¤³¤È¤òËɻߤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +ºÇ½é¤Î¥³¥ó¥Æ¥ó¥È¥Þ¥¯¥í¤Ï¡¢°Ê²¼¤Î +.Ql \&.Ad +¤Ë¤ª¤¤¤Æ¡¢¤½¤Îŵ·¿Åª¤Ê¹½Ê¸¤¬¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +.Sh ¥Þ¥Ë¥å¥¢¥ëÎΰè +.Ss ¥¢¥É¥ì¥¹¥Þ¥¯¥í +¥¢¥É¥ì¥¹¥Þ¥¯¥í¤Ï addr1[,addr2[,addr3]] ¤Î·Á¼°¤«¤é¤Ê¤ë¥¢¥É¥ì¥¹¤ò¼±Ê̤·¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Ad address ... \*(Pu +.Bl -tag -width ".Ad f1 , f2 , f3 :" -compact -offset 14n +.It Li \&.Ad addr1 +.Ad addr1 +.It Li \&.Ad addr1\ . +.Ad addr1 . +.It Li \&.Ad addr1\ , file2 +.Ad addr1 , file2 +.It Li \&.Ad f1\ , f2\ , f3\ : +.Ad f1 , f2 , f3 : +.It Li \&.Ad addr\ )\ )\ , +.Ad addr ) ) , +.El +.Pp +.Ql \&.Ad +¤ò°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤¹¤Î¤Ï¥¨¥é¡¼¤Ç¤¹¡£ +.Ql \&.Ad +¤Ï¾¤Î¥Þ¥¯¥í¤«¤é¸Æ¤Ó½Ð¤·²Äǽ¤Ç²òÀϤµ¤ì¤Þ¤¹¡£ +.Ss ºî¼Ô̾ +.Ql \&.An +¥Þ¥¯¥í¤Ïʸ½ñ²½¤µ¤ì¤Æ¤¤¤ë¹àÌܤκî¼Ô¤Î̾Á°¡¢¤â¤·¤¯¤Ï¼ÂºÝ¤Î +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Îºî¼Ô¤Î̾Á°¤ò»ØÄꤹ¤ë¤¿¤á¤Ë»È¤ï¤ì¤Þ¤¹¡£ +̾Á°¤Î¾ðÊó¤Î¸å¤Î¤¹¤Ù¤Æ¤Î°ú¿ô¤Ï¶çÆÉÅÀ¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .An author_name \*(Pu +.Bl -tag -width ".An Joe Author ) ) ," -compact -offset 14n +.It Li \&.An Joe\ Author +.An Joe Author +.It Li \&.An Joe\ Author\ , +.An Joe\ Author , +.It Li \&.An Joe\ Author\ \&Aq\ nobody@FreeBSD.ORG +.An Joe Author Aq nobody@FreeBSD.ORG +.It Li \&.An Joe\ Author\ )\ )\ , +.An Joe Author ) ) , +.El +.Pp +.Ql \&.An +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ql \&.An +¤ò°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤¹¤Î¤Ï¥¨¥é¡¼¤Ç¤¹¡£ +.Pp +.Sx AUTHORS +¥»¥¯¥·¥ç¥ó¤Ç¤Ï¡¢ +.Ql \&.An +Í×µá¤Ï²þ¹Ô¤ò°ú¤­µ¯¤³¤·¡¢³Æ¿·µ¬¤Î̾Á°¤¬¤½¤ì¤¾¤ì¤Î¹Ô¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£ +¤³¤ÎÆ°ºî¤¬Ë¾¤Þ¤·¤¯¤Ê¤¤¾ì¹ç¡¢ +.Bd -literal -offset indent +\&.An -nosplit +.Ed +.Pp +¸Æ¤Ó½Ð¤·¤Ç̵¸ú²½²Äǽ¤Ç¤¹¡£ +¤½¤ì¤¾¤ì¤Î¹Ô¤Ëɽ¼¨¤µ¤»¤ëÆ°ºî¤ËÌᤷ¤¿¤¤¾ì¹ç¤Ï¡¢ +.Bd -literal -offset indent +\&.An -split +.Ed +¸Æ¤Ó½Ð¤·¤ò»ÈÍѤ·¤Þ¤¹¡£ +.Ss °ú¿ô¥Þ¥¯¥í +°ú¿ô¥Þ¥¯¥í +.Ql \&.Ar +¤Ï¥³¥Þ¥ó¥É¹Ô¤Î°ú¿ô¤ò»²¾È¤¹¤ëºÝ¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Ar argument ... \*(Pu +.Bl -tag -width ".Ar file1 file2" -compact -offset 15n +.It Li \&.Ar +.Ar +.It Li \&.Ar file1 +.Ar file1 +.It Li \&.Ar file1\ . +.Ar file1 . +.It Li \&.Ar file1 file2 +.Ar file1 file2 +.It Li \&.Ar f1 f2 f3\ : +.Ar f1 f2 f3 : +.It Li \&.Ar file\ )\ )\ , +.Ar file ) ) , +.El +.Pp +.Ql \&.Ar +¤¬°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤µ¤ì¤ë¤È¡¢ +.Ql Ar +¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£ +.Ql \&.Ar +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss ¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥óÀë¸À (¥»¥¯¥·¥ç¥ó 4 ¤Î¤ß) +.Ql \&.Cd +¥Þ¥¯¥í¤Ï¥»¥¯¥·¥ç¥ó 4 ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤ª¤¤¤Æ¡¢¥Ç¥Ð¥¤¥¹¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î +.Xr config 8 +¤Ë¤è¤ëÀë¸À¤ÎÀâÌÀ¤Ë»È¤ï¤ì¤Þ¤¹¡£ +¤³¤Î¥Þ¥¯¥í¤Ï°úÍÑÉä (2 ½Å°úÍÑÉä¤Î¤ß) ¤Ç°Ï¤Þ¤ì¤¿°ú¿ô¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Pp +.Bl -tag -width "device le0 at scode?" -offset indent +.It Cd "device le0 at scode?" +¤Ï +.Ql ".Cd device le0 at scode?" +¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤Þ¤¹¡£ +.El +.Ss ¥³¥Þ¥ó¥É½¤¾þ»Ò +¥³¥Þ¥ó¥É½¤¾þ»Ò¤Ï +.Ql \&.Cm +¥Þ¥¯¥í¤¬¤¹¤Ù¤Æ¤Î°ú¿ô¤ÎÁ°¤Ë¥À¥Ã¥·¥åʸ»ú¤òÉÕ¤±¤Ê¤¤¤³¤È¤ò½ü¤¤¤Æ¡¢ +.Ql \&.Fl +(¥Õ¥é¥°) ¥³¥Þ¥ó¥É¤ÈƱ¤¸¤Ç¤¹¡£ +ÅÁÅýŪ¤Ë¥Õ¥é¥°¤Ï¥À¥Ã¥·¥åʸ»ú¤Ë°ú¤­Â³¤¤¤Æ»ØÄꤵ¤ì¤Þ¤¹¤¬¡¢ +¤¤¤¯¤Ä¤«¤Î¥³¥Þ¥ó¥É¤ä¥³¥Þ¥ó¥É¤Î¥µ¥Ö¥»¥Ã¥È¤Ï¤³¤ÎÊýË¡¤ò»È¤Ã¤Æ¤¤¤Þ¤»¤ó¡£ +¥³¥Þ¥ó¥É½¤¾þ»Ò¤Ï¥¨¥Ç¥£¥¿¥³¥Þ¥ó¥É¤Î¤è¤¦¤ÊÂÐÏÃŪ¤Ê¥³¥Þ¥ó¥É¤Ç¤â +»ØÄꤵ¤ì¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£ +.Sx ¥Õ¥é¥° +¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ +.Ss ÄêµÁºÑ¤ß¤ÎÊÑ¿ô +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ë¤ª¤¤¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ëÊÑ¿ô¤Ï +.Ql \&.Dv +¥Þ¥¯¥í¤Ë¤è¤Ã¤Æ»ØÄꤷ¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Dv defined_variable ... \*(Pu +.Bl -tag -width ".Dv MAXHOSTNAMELEN" -compact -offset 14n +.It Li ".Dv MAXHOSTNAMELEN" +.Dv MAXHOSTNAMELEN +.It Li ".Dv TIOCGPGRP )" +.Dv TIOCGPGRP ) +.El +.Pp +.Ql \&.Dv +¤ò°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤¹¤Î¤Ï¥¨¥é¡¼¤Ç¤¹¡£ +.Ql \&.Dv +¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss errno (¥»¥¯¥·¥ç¥ó 2 ¤Î¤ß) +¥¨¥é¡¼¥Þ¥¯¥í +.Ql \&.Er +¤Ï¥»¥¯¥·¥ç¥ó 2 ¤Î¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó¤Ë¤ª¤±¤ë¥¨¥é¡¼¤ÎÌá¤êÃͤò»ØÄꤷ¤Þ¤¹¡£ +²¼µ­¤Î 2 ÈÖÌܤÎÎã¤Ç¤Ï +.Ql \&.Er +¤Ï°ìÈ̥ƥ­¥¹¥ÈÎΰè¥Þ¥¯¥í¤Ç¤¢¤ë +.Ql \&.Bq +(¤³¤ì¤Ï¥»¥¯¥·¥ç¥ó 2 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç»È¤ï¤ì¤Æ¤¤¤Þ¤¹) ¤È¶¦¤Ë»È¤ï¤ì¤Æ¤¤¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Er ERRNOTYPE ... \*(Pu +.Bl -tag -width ".Bq Er ENOTDIR" -compact -offset 14n +.It Li \&.Er ENOENT +.Er ENOENT +.It Li \&.Er ENOENT\ )\ ; +.Er ENOENT ) ; +.It Li \&.Bq \&Er ENOTDIR +.Bq Er ENOTDIR +.El +.Pp +.Ql \&.Er +¤ò°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤¹¤Î¤Ï¥¨¥é¡¼¤Ç¤¹¡£ +.Ql \&.Er +¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss ´Ä¶­ÊÑ¿ô +.Ql \&.Ev +¥Þ¥¯¥í¤Ï´Ä¶­ÊÑ¿ô¤ò»ØÄꤷ¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Ev argument ... \*(Pu +.Bl -tag -width ".Ev PRINTER ) ) ," -compact -offset 14n +.It Li \&.Ev DISPLAY +.Ev DISPLAY +.It Li \&.Ev PATH\ . +.Ev PATH . +.It Li \&.Ev PRINTER\ )\ )\ , +.Ev PRINTER ) ) , +.El +.Pp +.Ql \&.Ev +¤ò°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤¹¤Î¤Ï¥¨¥é¡¼¤Ç¤¹¡£ +.Ql \&.Ev +¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss ´Ø¿ô¤Î°ú¿ô +.Ql \&.Fa +¥Þ¥¯¥í¤Ï´Ø¿ô¤Î°ú¿ô (¥Ñ¥é¥á¡¼¥¿) ¤ò +¥Þ¥Ë¥å¥¢¥ë¤Î +.Sx SYNOPSIS +¤Î¥»¥¯¥·¥ç¥ó³°¡¢¤â¤·¤¯¤Ï +.Sx SYNOPSIS +¤Î¥»¥¯¥·¥ç¥óÆâ¤Ç»²¾È¤¹¤ë¾ì¹ç¤Ë»È¤ï¤ì¤Þ¤¹¡£ +¥Ñ¥é¥á¡¼¥¿¤Î¥ê¥¹¥È¤¬ +.Ql \&.Fn +¥Þ¥¯¥í¤Ç¤ÏŤ¹¤®¤ë¾ì¹ç¤Ï¡¢ +°Ï¤Ã¤Æ»È¤¦¥Þ¥¯¥í +.Ql \&.Fo +¤È +.Ql \&.Fc +¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +.Ql \&.Fa +¤Ï¹½Â¤ÂΤΥá¥ó¥Ð¤ò»²¾È¤¹¤ë¾ì¹ç¤Ë¤â»È¤ï¤ì¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Fa function_argument ... \*(Pu +.Bl -tag -width ".Fa d_namlen\ )\ )\ ," -compact -offset 14n +.It Li \&.Fa d_namlen\ )\ )\ , +.Fa d_namlen ) ) , +.It Li \&.Fa iov_len +.Fa iov_len +.El +.Pp +.Ql \&.Fa +¤ò°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤¹¤Î¤Ï¥¨¥é¡¼¤Ç¤¹¡£ +.Ql \&.Fa +¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss ´Ø¿ô¤ÎÀë¸À +.Ql \&.Fd +¥Þ¥¯¥í¤Ï +.Sx SYNOPSIS +¥»¥¯¥·¥ç¥ó¤Ë¤ª¤¤¤Æ¡¢¥»¥¯¥·¥ç¥ó 2 ¤Þ¤¿¤Ï 3 ¤Î´Ø¿ô¤ÎÀâÌÀ¤Ç»È¤ï¤ì¤Þ¤¹¡£ +.Ql \&.Fd +¥Þ¥¯¥í¤«¤é¾¤Î¥Þ¥¯¥í¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ï¤Ê¤¯¡¢Â¾¤Î¥Þ¥¯¥í¤«¤é¸Æ¤Ó½Ð¤¹¤³¤È¤â +¤Ç¤­¤Þ¤»¤ó¡£ +.Pp +.Dl »È¤¤Êý: .Fd include_file (or defined variable) +.Pp +.Sx SYNOPSIS +¥»¥¯¥·¥ç¥ó¤Ë¤ª¤¤¤Æ¡¢´Ø¿ô¤¬¤¹¤Ç¤Ë¼¨¤µ¤ì¤Æ¤¤¤Æ²þ¹Ô¤¬Æþ¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.Ql \&.Fd +¤Ë¤è¤Ã¤Æ²þ¹Ô¤¬ÁÞÆþ¤µ¤ì¤Þ¤¹¡£ +¤³¤ì¤Ë¤è¤Ã¤ÆÁ°¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤È¼¡¤Î´Ø¿ô¤ÎÀë¸À¤Î´Ö¤ËºÇŬ¤Ê¹Ô´Ö¤¬ÀßÄꤵ¤ì¤Þ¤¹¡£ +.Ss ¥Õ¥é¥° +.Ql \&.Fl +¥Þ¥¯¥í¤Ï¥³¥Þ¥ó¥É¹Ô¤Î¥Õ¥é¥°¤ò°·¤¤¤Þ¤¹¡£ +¥Õ¥é¥°¤ÎÁ°¤Ë¤Ï¥À¥Ã¥·¥å +.Ql \- +¤¬ÁÞÆþ¤µ¤ì¤Þ¤¹¡£ +ÂÐÏÃŪ¤Ê¥³¥Þ¥ó¥É¤Î¥Õ¥é¥°¤Ç¤Ï¡¢¥À¥Ã¥·¥å¤¬¥Õ¥é¥°¤ÎÁ°¤Ë¤ÏÁÞÆþ¤µ¤ì¤Þ¤»¤ó¤¬¡¢ +.Ql \&.Cm +(¥³¥Þ¥ó¥É½¤¾þ»Ò) ¥Þ¥¯¥í¤Ï¡¢¥À¥Ã¥·¥å¤òÉÕ¤±¤Ê¤¤¤³¤È¤ò½ü¤­¡¢Æ±¤¸Æ¯¤­¤ò¤·¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Fl argument ... \*(Pu +.Bl -tag -width ".Fl \-s \-t \-v" -compact -offset 14n +.It Li \&.Fl +.Fl +.It Li \&.Fl cfv +.Fl cfv +.It Li \&.Fl cfv\ . +.Fl cfv . +.It Li \&.Fl s v t +.Fl s v t +.It Li \&.Fl -\ , +.Fl - , +.It Li \&.Fl xyz\ )\ , +.Fl xyz ) , +.El +.Pp +°ú¿ô¤Ê¤·¤Ç +.Ql \&.Fl +¥Þ¥¯¥í¤ò»ØÄꤹ¤ë¤È¡¢É¸½àÆþÎÏ/ɸ½à½ÐÎϤò°ÕÌ£¤¹¤ë¥À¥Ã¥·¥å¤È¤Ê¤ê¤Þ¤¹¡£ +¤Ò¤È¤Ä¤Î¥À¥Ã¥·¥å¤Ë +.Ql \&.Fl +¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤È¡¢2 ¤Ä¥À¥Ã¥·¥å¤È¤Ê¤ë¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£ +.Ql \&.Fl +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss ´Ø¿ô (¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó) +.Ql \&.Fn +¥Þ¥¯¥í¤Ï ANSI C ¤Îµ­Ë¡¤òµ¬ÈϤȤ·¤Æ¤¤¤Þ¤¹¡£ +.Bd -literal +»È¤¤Êý: .Fn [type] function [[type] parameters ... \*(Pu] +.Ed +.Bl -tag -width ".Fn _int align_ _const * char *sptrsxx" -compact +.It Li "\&.Fn getchar" +.Fn getchar +.It Li "\&.Fn strlen ) ," +.Fn strlen ) , +.It Li \&.Fn "\\*qint align\\*q" "\\*qconst * char *sptrs\\*q" , +.Fn "int align" "const * char *sptrs" , +.El +.Pp +.Ql \&.Fn +¤ò°ú¿ô¤ò»ØÄꤻ¤º¤Ë¸Æ¤Ó½Ð¤¹¤Î¤Ï¥¨¥é¡¼¤Ç¤¹¡£ +.Ql \&.Fn +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£Â¾¤Î¥Þ¥¯¥í¤Î¸Æ¤Ó½Ð¤·¤Ï +.Ql \&.Fn +¤Î¸Æ¤Ó½Ð¤·¤Î½ªÎ»¤ò°ÕÌ£¤¹¤ë¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤ +(ÊĤ¸³ç¸Ì¤¬¤½¤ÎÅÀ¤ÇÁÞÆþ¤µ¤ì¤Þ¤¹)¡£ +.Pp +9 ¸Ä°Ê¾å¤Î¥Ñ¥é¥á¡¼¥¿¤ò¤È¤ë´Ø¿ô (¤³¤ì¤ÏÌÇ¿¤Ë¤Ê¤¤¤³¤È¤Ç¤¹¤¬) ¤Ç¤Ï¡¢ +.Ql \&.Fo +¥Þ¥¯¥í (´Ø¿ô¥ª¡¼¥×¥ó) ¤È +.Ql \&.Fc +¥Þ¥¯¥í (´Ø¿ô¥¯¥í¡¼¥º) ¤ò +.Ql \&.Fa +(´Ø¿ô°ú¿ô) ¤È¶¦¤Ë»È¤Ã¤Æ¡¢¤³¤ÎÀ©¸Â¤ò²óÈò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +°Ê²¼¤Ë¤½¤ÎÎã¤ò¼¨¤·¤Þ¤¹¡£ +.Bd -literal -offset indent +\&.Ft int +\&.Fo res_mkquery +\&.Fa "int op" +\&.Fa "char *dname" +\&.Fa "int class" +\&.Fa "int type" +\&.Fa "char *data" +\&.Fa "int datalen" +\&.Fa "struct rrec *newrr" +\&.Fa "char *buf" +\&.Fa "int buflen" +\&.Fc +.Ed +.Pp +¤³¤ì¤Ï°Ê²¼¤Î¤è¤¦¤Ê·ë²Ì¤Ë¤Ê¤ê¤Þ¤¹¡£ +.Bd -filled -offset indent +.Ft int +.Fo res_mkquery +.Fa "int op" +.Fa "char *dname" +.Fa "int class" +.Fa "int type" +.Fa "char *data" +.Fa "int datalen" +.Fa "struct rrec *newrr" +.Fa "char *buf" +.Fa "int buflen" +.Fc +.Ed +.Pp +.Ql \&.Fo +¤È +.Ql \&.Fc +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Sx SYNOPSIS +¥»¥¯¥·¥ç¥ó¤Ç¤Ï¡¢´Ø¿ô¤Ï¾ï¤Ë¹Ô¤ÎÀèƬ¤«¤é³«»Ï¤µ¤ì¤Þ¤¹¡£ +.Sx SYNOPSIS +¥»¥¯¥·¥ç¥ó¤Ë¤ª¤¤¤Æ¡¢Ê£¿ô¤Î´Ø¿ô¤¬¼¨¤µ¤ì¤Æ¤ª¤ê¡¢´Ø¿ô¤Î·¿¤¬¼¨¤µ¤ì¤Ê¤¤¾ì¹ç¡¢ +²þ¹Ô¤¬ÁÞÆþ¤µ¤ì¡¢¸½ºß¤Î´Ø¿ô̾¤È¤½¤ÎÁ°¤Î´Ø¿ô̾¤Î´Ö¤ËºÇŬ¤Ê²þ¹ÔÎ̤¬ÀßÄꤵ¤ì¤Þ¤¹¡£ +¸½ºß¡¢ +.Ql \&.Fn +¤Ï troff ¤Î¹Ô¤ÎŤµ¤ËÂФ·¤Æ¡¢¸ì¤Î¶­³¦¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤ª¤é¤º¡¢Í½´ü¤·¤Ê¤¤ +¾ì½ê¤Ç²þ¹Ô¤¬ÁÞÆþ¤µ¤ì¤Æ¤·¤Þ¤¦¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£ +¤³¤ì¤Ï¶á¤¤¾­Í轤Àµ¤µ¤ì¤ë¤Ç¤·¤ç¤¦¡£ +.Ss ´Ø¿ô¤Î·¿ +¤³¤Î¥Þ¥¯¥í¤Ï +.Sx SYNOPSIS +¥»¥¯¥·¥ç¥ó¤Ç»È¤¦¤â¤Î¤Ç¤¹¡£ +man ¥Ú¡¼¥¸Ãæ¤Î¾¤Î¾ì½ê¤Ç¤âÌäÂê¤Ê¤¯»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¤¬¡¢ +¥»¥¯¥·¥ç¥ó 2 ¤È 3 ¤Î +.Sx SYNOPSIS +¥»¥¯¥·¥ç¥ó¤Ç¥«¡¼¥Í¥ë¤ÎÄ̾ï¤Î·Á¼°¤Ç´Ø¿ô¤Î·¿¤ò¼¨¤¹¤³¤È¤¬¤³¤Î¥Þ¥¯¥í¤ÎÌÜŪ¤Ç¤¹ +(¤³¤Î¥Þ¥¯¥í¤Ï´Ø¿ô̾¤¬¼¡¤Î¹Ô¤ËÃÖ¤«¤ì¤ë¤è¤¦¤Ë²þ¹Ô¤òÁÞÆþ¤·¤Þ¤¹)¡£ +.Pp +.Dl »È¤¤Êý: .Ft type ... \*(Pu +.Bl -tag -width "\&.Ft struct stat" -offset 14n -compact +.It Li \&.Ft struct stat +.Ft struct stat +.El +.Pp +.Ql \&.Ft +¤Ï¾¤Î¥Þ¥¯¥í¤«¤é¤Ï¸Æ¤Ó½Ð¤»¤Þ¤»¤ó¡£ +.Ss ÂÐÏÃŪ¤Ê¥³¥Þ¥ó¥É +.Ql \&.Ic +¥Þ¥¯¥í¤ÏÂÐÏÃŪ¤Ê¥³¥Þ¥ó¥É¡¢¤â¤·¤¯¤ÏÆâÉô¥³¥Þ¥ó¥É¤ò»ØÄꤷ¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Ic argument ... \*(Pu +.Bl -tag -width ".Ic setenv , unsetenvxx" -compact -offset 14n +.It Li \&.Ic :wq +.Ic :wq +.It Li \&.Ic do while {...} +.Ic do while {...} +.It Li \&.Ic setenv\ , unsetenv +.Ic setenv , unsetenv +.El +.Pp +.Ql \&.Ic +¤ò°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤¹¤Î¤Ï¥¨¥é¡¼¤Ç¤¹¡£ +.Ql \&.Ic +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss ¥é¥¤¥Ö¥é¥ê̾ +.Ql \&.Lb +¥Þ¥¯¥í¤Ï¡¢´Ø¿ô¤¬¤É¤Î¥é¥¤¥Ö¥é¥ê¤ËÁȤ߹þ¤Þ¤ì¤ë¤«¤ò»ØÄꤷ¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Lb argument ... \*(Pu +.Pp +.Ql \&.Lb +¥Þ¥¯¥í¤ËÂФ·¤Æ»ÈÍѲÄǽ¤Ê°ú¿ô¤È·ë²Ì¤Ï¼¡¤ÎÄ̤ê¤Ç¤¹: +.Pp +.Bl -tag -width "libnetgraph" -compact -offset indent +.It Li "libc" +.Lb libc +.It Li "libc_r" +.Lb libc_r +.It Li "libcalendar" +.Lb libcalendar +.It Li "libcam" +.Lb libcam +.It Li "libcompat" +.Lb libcompat +.It Li "libcrypt" +.Lb libcrypt +.It Li "libdevstat" +.Lb libdevstat +.It Li "libdisk" +.Lb libdisk +.It Li "libedit" +.Lb libedit +.It Li "libfetch" +.Lb libfetch +.It Li "libipsec" +.Lb libipsec +.It Li "libipx" +.Lb libipx +.It Li "libkvm" +.Lb libkvm +.It Li "libm" +.Lb libm +.It Li "libmd" +.Lb libmd +.It Li "libnetgraph" +.Lb libnetgraph +.It Li "libposix1e" +.Lb libposix1e +.It Li "libskey" +.Lb libskey +.It Li "libusb" +.Lb libusb +.It Li "libutil" +.Lb libutil +.It Li "libvgl" +.Lb libvgl +.El +.Ss ̾¾Î¥Þ¥¯¥í +.Ql \&.Nm +¥Þ¥¯¥í¤Ïʸ½ñ¤Î¥¿¥¤¥È¥ë¤ä¥µ¥Ö¥¸¥§¥¯¥È̾¤ò»ØÄꤹ¤ë¤¿¤á¤Ë»È¤ï¤ì¤Þ¤¹¡£ +¤³¤Î¥Þ¥¯¥í¤ÏºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤Î°ú¿ô¤ò³Ð¤¨¤Æ¤ª¤¯¤È¤¤¤¦ÆÃÀ­¤ò»ý¤Ã¤Æ¤ª¤ê¡¢ +¤½¤ì¤Ï¾ï¤Ë¤½¤Î¥Ú¡¼¥¸¤Î¥µ¥Ö¥¸¥§¥¯¥È̾¤Ç¤¢¤ë¤Ù¤­¤Ç¤¹¡£ +°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤µ¤ì¤ë¤È +.Ql \&.Nm +¤Ïºî¼Ô¤Îºî¶È¤ò¾¯¤Ê¤¯¤¹¤ë¤¿¤á¤À¤±¤ÎÌÜŪ¤Ç¡¢ºÇ½é¤Î̾¾Î¤ò½ÐÎϤ·¤Þ¤¹¡£ +Ãí: +¥»¥¯¥·¥ç¥ó 2 ¤Þ¤¿¤Ï 3 ¤Î¥É¥­¥å¥á¥ó¥È¤Î´Ø¿ô̾¤Ï +.Sx NAME +¥»¥¯¥·¥ç¥ó¤Ë¤ª¤¤¤Æ +.Ql \&.Nm +¤Ç»ØÄꤵ¤ì¡¢ +.Sx SYNOPSIS +¥»¥¯¥·¥ç¥ó¤ä»Ä¤ê¤Î¥»¥¯¥·¥ç¥ó¤Ç¤Ï +.Ql \&.Fn +¤Ç»ØÄꤵ¤ì¤Þ¤¹¡£ +.Xr csh 1 +¤Ç¤Î +.Ql while +¥³¥Þ¥ó¥É¤Î¥­¡¼¥ï¡¼¥É¤Î¤è¤¦¤ÊÂÐÏÃŪ¤Ê¥³¥Þ¥ó¥É¤Ç¤Ï +.Ql \&.Ic +¥Þ¥¯¥í¤ò»È¤¦¤Ù¤­¤Ç¤¹¡£ +.Ql \&.Ic +¤Ï¤Û¤È¤ó¤É +.Ql \&.Nm +¤ÈƱ°ì¤Ç¤¹¤¬¡¢ +¤½¤ì¤¬ºÇ½é¤Ë»È¤ï¤ì¤¿¤È¤­¤Î°ú¿ô¤òµ­²±¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ +.Pp +.Dl »È¤¤Êý: .Nm argument ... \*(Pu +.Bl -tag -width ".Nm mdoc.sample" -compact -offset 14n +.It Li \&.Nm mdoc.sample +.Nm mdoc.sample +.It Li \&.Nm \e-mdoc +.Nm \-mdoc . +.It Li \&.Nm foo\ )\ )\ , +.Nm foo ) ) , +.It Li \&.Nm +.Nm +.El +.Pp +.Ql \&.Nm +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss ¥ª¥×¥·¥ç¥ó +.Ql \&.Op +¥Þ¥¯¥í¤Ï¥³¥Þ¥ó¥É¹Ô¤Î»Ä¤ê¤Î¤¹¤Ù¤Æ¤Î°ú¿ô¤ò +¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹³Ñ³ç¸Ì¤Ç°Ï¤ß¡¢ +ËöÈø¤Î¶çÆÉÅÀ¤Ï³Ñ³ç¸Ì¤Î³°¤ËÃÖ¤­¤Þ¤¹¡£ +.Ql \&.Oc +¥Þ¥¯¥í¤È +.Ql \&.Oo +¥Þ¥¯¥í¤ÏÊ£¿ô¹Ô¤ËÅϤäƻȤ¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Op options ... \*(Pu +.Bl -tag -width ".Op Fl c Ar objfil Op Ar corfil ," -compact -offset indent +.It Li \&.Op +.Op +.It Li ".Op Fl k" +.Op Fl k +.It Li ".Op Fl k ) ." +.Op Fl k ) . +.It Li ".Op Fl k Ar kookfile" +.Op Fl k Ar kookfile +.It Li ".Op Fl k Ar kookfile ," +.Op Fl k Ar kookfile , +.It Li ".Op Ar objfil Op Ar corfil" +.Op Ar objfil Op Ar corfil +.It Li ".Op Fl c Ar objfil Op Ar corfil ," +.Op Fl c Ar objfil Op Ar corfil , +.It Li \&.Op word1 word2 +.Op word1 word2 +.El +.Pp +.Ql \&.Oc +¥Þ¥¯¥í¤È +.Ql \&.Oo +¥Þ¥¯¥í: +.Bd -literal -offset indent +\&.Oo +\&.Op \&Fl k \&Ar kilobytes +\&.Op \&Fl i \&Ar interval +\&.Op \&Fl c \&Ar count +\&.Oc +.Ed +.Pp +½ÐÎÏ·ë²Ì: +.Oo +.Op Fl k Ar kilobytes +.Op Fl i Ar interval +.Op Fl c Ar count +.Oc +.Pp +.Ql \&.Op +¤È +.Ql \&.Oc +¤È +.Ql \&.Oo +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss ¥Ñ¥¹Ì¾ +.Ql \&.Pa +¥Þ¥¯¥í¤Ï¥Ñ¥¹Ì¾¤â¤·¤¯¤Ï¥Õ¥¡¥¤¥ë̾¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤·¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Pa pathname \*(Pu +.Bl -tag -width ".Pa /tmp/fooXXXXX ) ." -compact -offset 14n +.It Li \&.Pa /usr/share +.Pa /usr/share +.It Li \&.Pa /tmp/fooXXXXX\ )\ . +.Pa /tmp/fooXXXXX ) . +.El +.Pp +.Ql \&.Pa +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss µ¬³Ê +.Ql \&.St +¥Þ¥¯¥í¤Ï¡¢µ¬³Ê¤Îû½Ì̾¾Î¤òÀµ¼°Ì¾¾Î¤ËÃÖ´¹¤·¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .St abbreviature +.Pp +»ÈÍѲÄǽ¤Ê +.Dq û½Ì̾¾Î/Àµ¼°Ì¾¾Î +¤ÎÁȤϼ¡¤ÎÄ̤ê¤Ç¤¹: +.Bl -tag -width "-p1003.2-92XX." -compact -offset indent +.It Li "-ansiC" +.St -ansiC +.It Li "-ansiC-89" +.St -ansiC-89 +.It Li "-ieee754" +.St -ieee754 +.It Li "-iso8802-3" +.St -iso8802-3 +.It Li "-isoC" +.St -isoC +.It Li "-isoC-99" +.St -isoC-99 +.It Li "-p1003.1" +.St -p1003.1 +.It Li "-p1003.1-88" +.St -p1003.1-88 +.It Li "-p1003.1-90" +.St -p1003.1-90 +.It Li "-p1003.1-96" +.St -p1003.1-96 +.It Li "-p1003.1b-93" +.St -p1003.1b-93 +.It Li "-p1003.1g-2000" +.St -p1003.1g-2000 +.It Li "-p1003.2" +.St -p1003.2 +.It Li "-p1003.2-92" +.St -p1003.2-92 +.It Li "-susv2" +.St -susv2 +.It Li "-xpg3" +.St -xpg3 +.It Li "-xpg4" +.St -xpg4 +.It Li "-xpg4.2" +.St -xpg4.2 +.El +.Ss ÊÑ¿ô +°ìÈÌŪ¤ÊÊÑ¿ô¤Ø¤Î»²¾È¤Ç¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Va variable ... \*(Pu +.Bl -tag -width ".Va char s ] ) ) ," -compact -offset 14n +.It Li \&.Va count +.Va count +.It Li \&.Va settimer , +.Va settimer , +.It Li \&.Va int\ *prt\ )\ : +.Va int\ *prt ) : +.It Li \&.Va char\ s\ ]\ )\ )\ , +.Va char\ s ] ) ) , +.El +.Pp +.Ql \&.Va +¤ò°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤¹¤Î¤Ï¥¨¥é¡¼¤Ç¤¹¡£ +.Ql \&.Va +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹ +.Ql \&.Xr +¥Þ¥¯¥í¤ÏºÇ½é¤Î°ú¿ô¤Ë¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î̾¾Î¤ò¼è¤ê¡¢¤â¤·¤¢¤ì¤Ð¼¡¤Î°ú¿ô¤Ë +¥»¥¯¥·¥ç¥ó¤Î¥Ú¡¼¥¸¿ô¤«¶çÆÉÅÀ¤ò¼è¤ê¤Þ¤¹¡£ +¤¹¤Ù¤Æ¤Î»Ä¤ê¤Î°ú¿ô¤Ï¶çÆÉÅÀ¤È¸«¤Ê¤µ¤ì¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Xr man_page [1,...,9] \*(Pu +.Bl -tag -width ".Xr mdoc 7 ) ) ," -compact -offset 14n +.It Li \&.Xr mdoc +.Xr mdoc +.It Li \&.Xr mdoc\ , +.Xr mdoc , +.It Li \&.Xr mdoc 7 +.Xr mdoc 7 +.It Li \&.Xr mdoc 7\ )\ )\ , +.Xr mdoc 7 ) ) , +.El +.Pp +.Ql \&.Xr +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ql \&.Xr +¤ò°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤¹¤Î¤Ï¥¨¥é¡¼¤Ç¤¹¡£ +.Sh °ìÈ̥ƥ­¥¹¥ÈÎΰè +.Ss AT&T ¥Þ¥¯¥í +.Bd -literal -offset indent -compact +»È¤¤Êý: .At [v6 | v7 | 32v | V.1 | V.4] ... \*(Pu +.Ed +.Bl -tag -width ".At v6 ) ," -compact -offset 14n +.It Li ".At" +.At +.It Li ".At v6 ." +.At v6 . +.El +.Pp +.Ql \&.At +¥Þ¥¯¥í¤Ï²òÀÏ +.Em ¤µ¤ì¤º +¡¢¸Æ¤Ó½Ð¤· +.Em ÉÔ²Äǽ +¤Ç¤¹¡£ +ºÇÂç 2 ¤Ä¤Þ¤Ç¤Î°ú¿ô¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Ss BSD ¥Þ¥¯¥í +.Dl »È¤¤Êý: .Bx [Version/release] ... \*(Pu +.Bl -tag -width ".Bx 4.3 ) ," -compact -offset 14n +.It Li ".Bx" +.Bx +.It Li ".Bx 4.3 ." +.Bx 4.3 . +.El +.Pp +.Ql \&.Bx +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss FreeBSD/NetBSD/OpenBSD ¥Þ¥¯¥í +.Bd -literal -offset indent -compact +»È¤¤Êý: .Fx [ Version.release ] ... \*(Pu +.Ed +.Bl -tag -width ".Fx 2.2 ) ," -compact -offset 14n +.It Li ".Fx 2.2 ." +.Fx 2.2 . +.El +.Pp +.Bd -literal -offset indent -compact +»È¤¤Êý: .Nx [ Version.release ] ... \*(Pu +.Ed +.Bl -tag -width ".Nx 1.4 ) ," -compact -offset 14n +.It Li ".Nx 1.4 ." +.Nx 1.4 . +.El +.Pp +.Bd -literal -offset indent -compact +»È¤¤Êý: .Ox [ Version.release ] ... \*(Pu +.Ed +.Bl -tag -width ".Ox 2.5 ) ," -compact -offset 14n +.It Li ".Ox 2.5 ." +.Ox 2.5 . +.El +.Pp +.Ql \&.Fx , +.Ql \&.Nx , +.Ql \&.Ox +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +ºÇÂç 2 ¤Ä¤Þ¤Ç¤Î°ú¿ô¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Ss UNIX ¥Þ¥¯¥í +.Dl »È¤¤Êý: .Ux ... \*(Pu +.Bl -tag -width ".Ux 4.3 ) ," -compact -offset 14n +.It Li ".Ux" +.Ux +.El +.Pp +.Ql \&.Ux +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss °Ï¤¤/¥¯¥©¡¼¥È¥Þ¥¯¥í +°Ï¤¤¤Î³µÇ°¤Ï¥¯¥©¡¼¥È¤È»÷¤¿¤â¤Î¤Ç¤¹¡£ +1 ¤Ä°Ê¾å¤Îʸ»úÎ󤬰úÍÑÉä¤ä³ç¸Ì¤Î¤è¤¦¤Êʸ»ú¤Î¥Ú¥¢¤Ç°Ï¤Þ¤ì¤Æ¤¤¤ë +¥ª¥Ö¥¸¥§¥¯¥È¤ò»Ø¤·¤Þ¤¹¡£ +¥¯¥©¡¼¥È¤È°Ï¤¤¤È¤¤¤¦ÍѸì¤Ï¤³¤Îʸ½ñ¤òÄ̤·¤ÆƱ¤¸°ÕÌ£¤Ç»È¤ï¤ì¤Þ¤¹¡£ +¤Û¤È¤ó¤É¤Î 1 ¹Ô¤Î°Ï¤¤¥Þ¥¯¥í¤Ï¥¯¥©¡¼¥È (quote) ¤Î¥Ò¥ó¥È¤È¤¹¤ë¤¿¤á¤Ë¡¢¾®Ê¸»ú¤Î +.Ql q +¤Ç½ªÎ»¤·¤Þ¤¹¤¬¡¢¤¤¤¯¤Ä¤«¤ÎÎã³°¤¬¤¢¤ê¤Þ¤¹¡£ +³Æ¡¹¤Î°Ï¤¤¥Þ¥¯¥í¤ËÂФ·¡¢³«»Ï¥Þ¥¯¥í¤È½ªÎ»¥Þ¥¯¥í¤Î¥Ú¥¢¤â¤¢¤ê¡¢¤½¤ì¤¾¤ì¾®Ê¸»ú¤Î +.Ql o +¤È +.Ql c +¤Ç½ªÎ»¤·¤Þ¤¹¡£ +¤³¤ì¤é¤Ï 1 ¹Ô°Ê¾å¤Î¥Æ¥­¥¹¥È¤ËÅϤäƻȤ¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¤¬¡¢ +Æþ¤ì»Ò¤Ë¤¹¤ë¾ì¹ç¤ËÀ©¸Â¤¬¤¢¤ê¤Þ¤¹¡£ +¤½¤ÎÃæ¤Ç¤Ï 1 ¹Ô·Á¼°¤Î¥¯¥©¡¼¥È¥Þ¥¯¥í¤Î¤ß»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Pp +.Bd -filled -offset indent +.Bl -column "¥¯¥©¡¼¥È " "½ªÎ» " "³«»Ï " "¥¯¥©¡¼¥È¤µ¤ì¤¿¥ê¥Æ¥é¥ë " XXʸ»úÎóXX +.Em " ¥¯¥©¡¼¥È ½ªÎ» ³«»Ï µ¡Ç½ ·ë²Ì" +\&.Aq .Ac .Ao ¥«¥®³ç¸Ì¤Ë¤è¤ë°Ï¤¤ <ʸ»úÎó> +\&.Bq .Bc .Bo ³Ñ³ç¸Ì¤Ë¤è¤ë°Ï¤¤ [ʸ»úÎó] +\&.Dq .Dc .Do 2 ½Å°úÍÑÉä ``ʸ»úÎó'' + .Ec .Eo °Ï¤¤Ê¸»úÎó (XX¤Ë¤è¤ë) XXʸ»úÎóXX +\&.Pq .Pc .Po ³ç¸Ì¤Ë¤è¤ë°Ï¤¤ (ʸ»úÎó) +\&.Ql ¥¯¥©¡¼¥È¤µ¤ì¤¿¥ê¥Æ¥é¥ë `st' ¤Þ¤¿¤Ïʸ»úÎó +\&.Qq .Qc .Qo ¤Þ¤Ã¤¹¤°¤Ê 2 ½Å°úÍÑÉä "ʸ»úÎó" +\&.Sq .Sc .So 1 ½Å°úÍÑÉä `ʸ»úÎó' +.El +.Ed +.Pp +²¼µ­¤ÎÉÔÀµ¤Ê¥Þ¥¯¥í¤ò½ü¤­¡¢¤¹¤Ù¤Æ¤Î¥¯¥©¡¼¥È¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +¶çÆÉÅÀ¤¬¤Ò¤È¤Ä¤º¤ÄÃÖ¤«¤ì¤Æ¤¤¤Æ¡¢¥¹¥Ú¡¼¥¹¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤ì¤Ð¡¢ +¤¹¤Ù¤Æ¤Î¥¯¥©¡¼¥È¥Þ¥¯¥í¤Ï¶çÆÉÅÀ¤òŬÀڤ˰·¤¤¤Þ¤¹¡£ +¥¯¥©¡¼¥È¥Þ¥¯¥í¤Ï³«¤¯¶çÆÉÅÀ¡¢ÊĤ¸¤ë¶çÆÉÅÀ +(ÌõÃí: ¶çÆÉÅÀ¤Ë¤Ï³ç¸Ì¤Ê¤É¤â´Þ¤ß¤Þ¤¹) ¤òÄ´¤Ù¡¢ +¤½¤ì¤¬°Ï¤àʸ»úÎó¤è¤êÁ°¤«¸å¤«¤ò·è¤á¤Þ¤¹¡£ +¤³¤ì¤Ë¤è¤Ã¤Æ¡¢¤¢¤ëÄøÅÙ¤ÎÆþ¤ì»Ò¤¬²Äǽ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ +.Bl -tag -width xxx,xxxx +.It Li \&.Ec , \&.Eo +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï³Æ¡¹³«»Ï¤ª¤è¤Ó½ªÎ»¤Îʸ»úÎó¤òºÇ½é¤Î°ú¿ô¤Ë¼è¤ê¤Þ¤¹¡£ +.It Li \&.Ql +¥ê¥Æ¥é¥ë¤ò¥¯¥©¡¼¥È¤¹¤ë¥Þ¥¯¥í¤Ï +.Xr troff +¤Ç¤Ï +.Xr nroff +¤È°Û¤Ê¤Ã¤¿½èÍý¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£ +.Xr nroff +¤Ç¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤¿¾ì¹ç¡¢¥¯¥©¡¼¥È»ØÄꤵ¤ì¤¿¥ê¥Æ¥é¥ë¤Ï¾ï¤Ë¥¯¥©¡¼¥È¤µ¤ì¤Þ¤¹¡£ +.Xr troff +¤Ç¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤¿¾ì¹ç¤Ï¡¢¥¢¥¤¥Æ¥à¤ÎÉý¤¬¸ÇÄêÉýʸ»ú 3 ¤Äʬ¤è¤ê +¶¹¤¤¾ì¹ç¤Ë¤Î¤ß¥¯¥©¡¼¥È¤µ¤ì¤Þ¤¹¡£ +¤³¤ì¤Ï¥ê¥Æ¥é¥ë (¸ÇÄêÉý) ¤Î¥Õ¥©¥ó¥È¤ÎÊѹ¹¤¬¤¢¤Þ¤êµ¤¤Å¤«¤ì¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¤¿¤á¡¢ +û¤¤Ê¸»úÎó¤òÎɤ¯¸«¤¨¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ç¤¹¡£ +.It Li \&.Pf +¥×¥ì¥Õ¥£¥Ã¥¯¥¹¥Þ¥¯¥í¤Ï¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢²òÀϤµ¤ì¤Þ¤¹¡£ +.Bl -tag -width "(namexx" -offset indent +.It Li ".Pf ( Fa name2" +¤Ï +.Pf ( Fa name2 +¤È¤Ê¤ê¤Þ¤¹¡£ +.El +.Pp +.Ql \&.Ns +(¶õÇò¤Ê¤·) ¥Þ¥¯¥í¤Ï¥µ¥Õ¥£¥Ã¥¯¥¹µ¡Ç½¤ÈƱÍͤκîÍѤ¬¤¢¤ê¤Þ¤¹¡£ +.El +.Pp +¥¯¥©¡¼¥È¤ÎÎã: +.Bl -tag -width ".Aq Pa ctype.h ) ,xxxxxxxx" -compact -offset indent +.It Li \&.Aq +.Aq +.It Li \&.Aq \&Ar ctype.h\ )\ , +.Aq Ar ctype.h ) , +.It Li \&.Bq +.Bq +.It Li \&.Bq \&Em Greek \&, French \&. +.Bq Em Greek , French . +.It Li \&.Dq +.Dq +.It Li ".Dq string abc ." +.Dq string abc . +.It Li ".Dq \'^[A-Z]\'" +.Dq \'^[A-Z]\' +.It Li "\&.Ql man mdoc" +.Ql man mdoc +.It Li \&.Qq +.Qq +.It Li "\&.Qq string ) ," +.Qq string ) , +.It Li "\&.Qq string Ns )," +.Qq string Ns ), +.It Li \&.Sq +.Sq +.It Li "\&.Sq string +.Sq string +.El +.Pp +°Ï¤¤¥Þ¥¯¥í¤ÎÆþ¤ì»Ò¤Ë¤Ä¤¤¤Æ¤ÎÎɤ¤Îã¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +¥ª¥×¥·¥ç¥ó¥Þ¥¯¥í +.Ql \&.Op +¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ +¤³¤Î¥Þ¥¯¥í¤Ï¾å¤Ç¥ê¥¹¥È¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê°Ï¤¤¥Þ¥¯¥í¤ÈƱ¤¸¥Ù¡¼¥¹¤Î¾å¤Ë +ºî¤é¤ì¤Æ¤¤¤Þ¤¹¡£ +³ÈÄ¥°ú¿ô¥ê¥¹¥È¥Þ¥¯¥í +.Ql \&.Xo +¤È +.Ql \&.Xc +¤â¤Þ¤¿Æ±¤¸¥ë¡¼¥Á¥ó¤ò¥Ù¡¼¥¹¤Ëºî¤é¤ì¤Æ¤ª¤ê¡¢ +.Nm \-mdoc +¥Þ¥¯¥í¤Î»È¤¤Êý¤ÎÈó¾ï¤ËÎɤ¤Îã¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ +.Ss no\-op ¤â¤·¤¯¤ÏÄ̾ï¥Æ¥­¥¹¥È¥Þ¥¯¥í +.Ql \&.No +¥Þ¥¯¥í¤Ï¥Þ¥¯¥í¥³¥Þ¥ó¥É¹Ô¤Ë¤ª¤¤¤Æ¡¢¥³¥ó¥Æ¥ó¥È¥Þ¥¯¥í¤Î¹½Ê¸·Á¼°¤Ë½¾¤¦¤¬¡¢ +¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤Æ¤Ï +.Em ¤Ê¤é¤Ê¤¤ +ñ¸ì¤ò¥Ï¥Ã¥¯¤¹¤ë¤â¤Î¤Ç¤¹¡£ +.Ss ¶õÇò¤Ê¤·¥Þ¥¯¥í +.Ql \&.Ns +¥Þ¥¯¥í¤Ï¥Þ¥¯¥í´Ö¤Ç¤ÎÉÔÍפʶõÇò¤ò½üµî¤·¤Þ¤¹¡£ +¤³¤ì¤Ï¥Õ¥é¥°¤È°ú¿ô¤Î´Ö¤Ë¶õÇò¤ò´Þ¤Þ¤Ê¤¤¸Å¤¤¥¹¥¿¥¤¥ë¤Î°ú¿ô¥ê¥¹¥È¤ò»È¤¦¾ì¹ç¤Ë +ÊØÍø¤Ç¤¹¡£ +.Bl -tag -width ".Op Fl I Ns Ar directoryxx" -offset indent +.It Li ".Op Fl I Ns Ar directory" +¤³¤ì¤Ï°Ê²¼¤Î·ë²Ì¤Ë¤Ê¤ê¤Þ¤¹¡£ +.Op Fl I Ns Ar directory +.El +.Pp +Ãí: +.Ql \&.Ns +¥Þ¥¯¥í¤Ï¾¤Î¥Þ¥¯¥í̾¤¬Â³¤«¤Ê¤±¤ì¤Ð¡¢¥¹¥Ú¡¼¥¹¤ò½üµî¤·¤¿¤¢¤È¤Ë +.Ql \&.No +¥Þ¥¯¥í¤ò¾ï¤Ëµ¯Æ°¤·¤Þ¤¹¡£ +.Ql \&.Ns +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss ¥»¥¯¥·¥ç¥ó¤Î¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹ +.Ql \&.Sx +¥Þ¥¯¥í¤ÏƱ°ìʸ½ñÆâ¤Ç¤Î¥»¥¯¥·¥ç¥ó¤Î¥Ø¥Ã¥À¤Ø¤Î»²¾È¤ò»ØÄꤷ¤Þ¤¹¡£ +¤³¤ì¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Pp +.Bl -tag -width "Li \&.Sx FILES" -offset 14n +.It Li \&.Sx FILES +.Sx FILES +.El +.Ss »²¹Íʸ¸¥¤È°úÍÑ +°Ê²¼¤Î¥Þ¥¯¥í¤Ï¿¾¯¤Ê¤ê¤È¤â»²¹Íʸ¸¥¤ò°·¤¨¤ë¤è¤¦¤Ë¤È°Õ¿Þ¤·¤¿¤â¤Î¤Ç¤¹¡£ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï¡¢¤»¤¤¤¼¤¤»²¾È¥¹¥¿¥¤¥ë¤Î»²¹Íʸ¸¥¤Î¥µ¥Ö¥»¥Ã¥È¤ò¼êÆ°¤Ç +ºîÀ®¤·¤ä¤¹¤¯¤¹¤ëÄøÅ٤Ǥ¹¡£ +.Pp +.Bl -tag -width 6n -offset indent -compact +.It Li ".Rs" +»²¹Íʸ¸¥¤Î³«»Ï¡£ +²þ¹Ô¤òÁÞÆþ¤·¤Æ¤«¤é¡¢»²¹Íʸ¸¥¤Î½ªÎ»¥Þ¥¯¥í¤¬Æɤ߹þ¤Þ¤ì¤ë¤Þ¤Ç +»²¹Íʸ¸¥¤Î¾ðÊó¤ò¼ý½¸¤¹¤ë¡£ +.It Li ".Re" +»²¹Íʸ¸¥¤Î½ªÎ»¡£ +»²¹Íʸ¸¥¤¬É½¼¨¤µ¤ì¤ë¡£ +.It Li ".%A" +»²¹Íʸ¸¥¤Îºî¼Ô̾¡£1 ²ó¤Î¸Æ¤Ó½Ð¤·¤Ë¤Ä¤­¡¢ºî¼Ô̾¤ò¤Ò¤È¤Ä»ØÄꤹ¤ë¡£ +.It Li ".%B" +½ñÀҤΥ¿¥¤¥È¥ë¡£ +.It Li ".\&%C" +»Ô / ¾ì½ê¡£ +.It Li ".\&%D" +ÆüÉÕ¡£ +.It Li ".%J" +Äê´ü´©¹Ôʪ¤Î̾¾Î¡£ +.It Li ".%N" +ȯ¹ÔÈֹ档 +.It Li ".%O" +ÄɲþðÊó¡£ +.It Li ".%P" +¥Ú¡¼¥¸Èֹ档 +.It Li ".%R" +Êó¹ð½ñ¤Î̾¾Î¡£ +.It Li ".%T" +µ­»ö¤Î¥¿¥¤¥È¥ë¡£ +.It Li ".%V" +´¬¿ô¡£ +.El +.Pp +.Ql % +¤Ç»Ï¤Þ¤ë¥Þ¥¯¥í¤Ï¸Æ¤Ó½Ð¤·ÉÔ²Äǽ¤Ç¤¹¤¬¡¢ +¸Æ¤Ó½Ð¤·Â¦¤ËÌá¤ë¾¦É¸Ì¾¥Þ¥¯¥í¤À¤±¤Ï²òÀϤµ¤ì¤Þ¤¹¡£ +(¸½»þÅÀ¤Ç¤Ïͽ´ü¤Ç¤­¤Ê¤¤¤³¤È¤Ç¤¹¡£) +¾¦É¸Ì¾¤Î¤ß²òÀϤµ¤ì¤ë¤Î¤Ï +.Xr troff Ns / Ns Xr ditroff +¤Î½ÐÎϤò¤­¤ì¤¤¤Ë¤¹¤ë¤¿¤á¤Ç¤¹¡£ +.Ss Ìá¤êÃÍ +.Ql \&.Rv +¥Þ¥¯¥í¤Ï +.Sx RETURN VALUE +¤Î¥»¥¯¥·¥ç¥ó¤Ç»È¤¦¥Æ¥­¥¹¥È¤òÀ¸À®¤·¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Rv [-std function] +.Pp +.Ql \&.Rv -std atexit +¤³¤ì¤Ï°Ê²¼¤Î¥Æ¥­¥¹¥È¤òÀ¸À®¤·¤Þ¤¹¡£ +.Pp +.Rv -std atexit +.Pp +.Fl std +¥ª¥×¥·¥ç¥ó¤Ï¥»¥¯¥·¥ç¥ó 2 ¤È 3 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Î¤ßÍ­¸ú¤Ç¤¹¡£ +.Ss ¾¦É¸Ì¾ (Ƭ»ú¸ì¤È¥¿¥¤¥×̾) +¾¦É¸Ì¾¥Þ¥¯¥í¤Ï°ìÈÌŪ¤ËŤµ¤¬ 2 ʸ»ú¤ò±Û¤¨¤ë¤¹¤Ù¤Æ¤¬Âçʸ»ú¤Îñ¸ìÍÑ +¤Ë»È¤ï¤ì¤ë¾®¤µ¤ÊÂçʸ»ú¤Î¥Þ¥¯¥í¤Ç¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Tn symbol ... \*(Pu +.Bl -tag -width ".Tn ASCII" -compact -offset 14n +.It Li \&.Tn DEC +.Tn DEC +.It Li \&.Tn ASCII +.Tn ASCII +.El +.Pp +.Ql \&.Tn +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢Â¾¤Î¥Þ¥¯¥í¤«¤é¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ss ³ÈÄ¥°ú¿ô +.Ql \&.Xo +¤È +.Ql \&.Xc +¥Þ¥¯¥í¤Ç¥Þ¥¯¥í¤Î¶­³¦¤Ë¤ª¤±¤ë°ú¿ô¥ê¥¹¥È¤ò³ÈÄ¥¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +°ú¿ô¥ê¥¹¥È¤Ï +.Ql \&.Op +¤Î¤è¤¦¤Ê¤¹¤Ù¤Æ¤Î°ú¿ô¤¬ 1 ¹ÔÃæ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¤³¤È¤òÁ°Äó¤È¤·¤Æ¤¤¤ë +¥Þ¥¯¥í¤ÎÃæ¤Ç¤Ï¹Ô¤ËÅϤäƳÈÄ¥¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ +.Pp +°Ê²¼¤Ë¶õÇò¥â¡¼¥É¥Þ¥¯¥í¤ò¥¹¥Ú¡¼¥·¥ó¥°¤ò¥ª¥Õ¤Ë¤¹¤ë¤¿¤á¤Ë»È¤Ã¤¿ +.Ql \&.Xo +¤Ç¤ÎÎã¤ò¼¨¤·¤Þ¤¹¡£ +.Bd -literal -offset indent +\&.Sm off +\&.It Xo Sy I Ar operation +\&.No \een Ar count No \een +\&.Xc +\&.Sm on +.Ed +.Pp +¤³¤ì¤Ï°Ê²¼¤Î¤è¤¦¤Ê·ë²Ì¤Ë¤Ê¤ê¤Þ¤¹¡£ +.Bd -filled -offset indent +.Bl -tag -width flag -compact +.Sm off +.It Xo Sy I Ar operation +.No \en Ar count No \en +.Xc +.Sm on +.El +.Ed +.Pp +Îã¤ò¤â¤¦¤Ò¤È¤Ä: +.Bd -literal -offset indent +\&.Sm off +\&.It Cm S No \&/ Ar old_pattern Xo +\&.No \&/ Ar new_pattern +\&.No \&/ Op Cm g +\&.Xc +\&.Sm on +.Ed +.Pp +¤³¤ì¤Ï°Ê²¼¤Î¤è¤¦¤Ê·ë²Ì¤Ë¤Ê¤ê¤Þ¤¹¡£ +.Bd -filled -offset indent +.Bl -tag -width flag -compact +.Sm off +.It Cm S No \&/ Ar old_pattern Xo +.No \&/ Ar new_pattern +.No \&/ Op Cm g +.Xc +.Sm on +.El +.Ed +.Pp +°Ï¤¤¥Þ¥¯¥í¤ò»È¤Ã¤¿ +.Ql \&.Xo +¤Î¾¤ÎÎã: +ÊÑ¿ô¤ÎÃͤò¥Æ¥¹¥È¤·¤Æ²¼¤µ¤¤¡£ +.Bd -literal -offset indent +\&.It Xo +\&.Ic .ifndef +\&.Oo \e&! Oc Ns Ar variable +\&.Op Ar operator variable ... +\&.Xc +.Ed +.Pp +·ë²Ì¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ +.Bd -filled -offset indent +.Bl -tag -width flag -compact +.It Xo +.Ic .ifndef +.Oo \&! Oc Ns Ar variable +.Op Ar operator variable ... +.Xc +.El +.Ed +.Pp +¾å¤Î¤¹¤Ù¤Æ¤ÎÎã¤Ç¤Ï +.Ql \&.It +(¥ê¥¹¥È¹àÌÜ) ¥Þ¥¯¥í¤Î°ú¿ô¥ê¥¹¥È¤Ë +.Ql \&.Xo +¥Þ¥¯¥í¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£ +³ÈÄ¥¥Þ¥¯¥í¤¬»È¤ï¤ì¤ë¤³¤È¤Ï¤¢¤Þ¤ê¤¢¤ê¤Þ¤»¤ó¡£ +»È¤ï¤ì¤ë¤È¤¹¤ì¤Ð¡¢¥ê¥¹¥È¹àÌܤΰú¿ô¥ê¥¹¥È¤ò³ÈÄ¥¤¹¤ë¾ì¹ç¤Ç¤¹¡£ +»ÄÇ°¤Ê¤³¤È¤Ë¡¢¤³¤ì¤¬³ÈÄ¥¥Þ¥¯¥í¤¬ºÇ¤âĨ¤êÀ­¤Ç¤¢¤ë¤È¤³¤í¤Ç¤â¤¢¤ê¤Þ¤¹¡£ +ºÇ½é¤Î 2 ¤Ä¤ÎÎã¤Ç¤Ï¡¢¥¹¥Ú¡¼¥·¥ó¥°¤Ï¥ª¥Õ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ +3 ÈÖÌܤǤϡ¢¤¢¤ë²Õ½ê¤Ë¤Ï¥¹¥Ú¡¼¥·¥ó¥°¤òÆþ¤ì¤ë¤³¤È¤¬Ë¾¤Þ¤·¤¤¤Î¤Ç¤¹¤¬¡¢ +½ÐÎÏÁ´ÂΤËÆþ¤ì¤¿¤¤¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ +¤½¤Î¤è¤¦¤Ê¾õ¶·¤Ç¤³¤ì¤é¤Î¥Þ¥¯¥í¤¬Å¬ÀÚ¤ËÆ°ºî¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.Ql \&.Xo +¤È +.Ql \&.Xc +¥Þ¥¯¥í¤¬ 3 ÈÖÌܤÎÎã¤Ë¤¢¤ë¤è¤¦¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£ +.Ql \&.Xo +¥Þ¥¯¥í¤¬ÃÖ¤«¤ì¤¿ +.Ql \&.It +¤Î°ú¿ô¥ê¥¹¥È¤Ë¾¤Î¤â¤Î¤¬ÃÖ¤«¤ì¤ë¤È¡¢¥¹¥Ú¡¼¥·¥ó¥°¤¬¤É¤¦¤Ê¤ë¤«¤Ïͽ¬ÉÔ²Äǽ¤Ç¤¹¡£ +¤³¤Î¾ì¹ç¡¢ +.Ql \&.Ns +(¶õÇò¤Ê¤·¥Þ¥¯¥í) +¤Ï¹ÔÃæ¤ÎºÇ½é¤â¤·¤¯¤ÏºÇ¸å¤Î¥Þ¥¯¥í¤Ë»ØÄꤷ¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£ +¸½ºß +.Bx +¤Ç¥ê¥ê¡¼¥¹¤µ¤ì¤Æ¤¤¤ë 900 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸ (¼ÂºÝ¤Î¥Ú¡¼¥¸¤Ç¤ÏÌó 1500 +¥Ú¡¼¥¸) ¤Î¤¦¤Á 15 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Î¤ß¤·¤« +.Ql \&.Xo +¤¬»È¤ï¤ì¤Æ¤¤¤Þ¤»¤ó¡£ +.Sh ¥Ú¡¼¥¸¹½Â¤Îΰè +.Ss ¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À +°Ê²¼¤Ë¥ê¥¹¥È¤µ¤ì¤Æ¤¤¤ë¡¢ºÇ½é¤Î 3 ¤Ä¤Î¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Þ¥¯¥í +.Ql \&.Sh +¤Ï¤¹¤Ù¤Æ¤Î man ¥Ú¡¼¥¸¤Çɬ¿Ü¤Î¤â¤Î¤Ç¤¹¡£ +»Ä¤ê¤Î¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¤Ï¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Îºî¼Ô¤ÎºÛÎ̤ˤª¤¤¤Æ¡¢ +¿ä¾©¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ç¤¹¡£ +.Ql \&.Sh +¥Þ¥¯¥í¤Ï 9 ¤Ä¤Þ¤Ç¤Î°ú¿ô¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +¤³¤ì¤Ï²òÀϤµ¤ì¤Þ¤¹¤¬¡¢¸Æ¤Ó½Ð¤·ÉÔ²Äǽ¤Ç¤¹¡£ +.Bl -tag -width ".Sh SYNOPSIS" +.It \&.Sh NAME +.Ql \&.Sh NAME (ÌõÃí: ̾¾Î) +¥Þ¥¯¥í¤Ïɬ¿Ü¤Î¤â¤Î¤Ç¤¹¡£ +¤³¤ì¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢¥Ø¥Ã¥À¤È¥Õ¥Ã¥¿¡¢¤½¤ì¤Ë¥Ç¥Õ¥©¥ë¥È¤Î +¥Ú¡¼¥¸¥ì¥¤¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤º¡¢·ë²Ì¤Ï¤«¤Ê¤ê¹¥¤Þ¤·¤¯¤Ê¤¤¤â¤Î¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£ +.Sx NAME +¥»¥¯¥·¥ç¥ó¤ÏºÇÄã 3 ¤Ä¤Î¹àÌܤ«¤é¤Ê¤ê¤Þ¤¹¡£ +ºÇ½é¤Î¤â¤Î¤Ï̾¾Î¥Þ¥¯¥í +.Ql \&.Nm +¤Ç¤¢¤ê¡¢man ¥Ú¡¼¥¸¤Î¥µ¥Ö¥¸¥§¥¯¥È¤È¤Ê¤ê¤Þ¤¹¡£ +2 ÈÖÌܤΤâ¤Î¤Ï̾¾ÎÀâÌÀ¥Þ¥¯¥í +.Ql \&.Nd +¤Ç¤¢¤ê¡¢¥µ¥Ö¥¸¥§¥¯¥È̾¤ò 3 ¤Ä¤á¤Î¹àÌÜ¡¢ +¤¹¤Ê¤ï¤Á¤½¤Î̾¾Î¤ÎÀâÌÀ¤ÈʬΥ¤·¤Þ¤¹¡£ +ÀâÌÀ¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¥¹¥Ú¡¼¥¹¤Ï¾®¤µ¤¤¤â¤Î¤Ç¤¹¤Î¤Ç¡¢ +¤Ç¤­¤ë¤À¤±´Ê·é¤Çʬ¤«¤ê¤ä¤¹¤¤¤â¤Î¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +.It \&.Sh SYNOPSIS +.Sx SYNOPSIS (ÌõÃí: ½ñ¼°) +¥»¥¯¥·¥ç¥ó¤Ï¤½¤Î man ¥Ú¡¼¥¸¤Î¥µ¥Ö¥¸¥§¥¯¥È¤È¤Ê¤Ã¤Æ¤¤¤ë¹àÌܤΠ+ŵ·¿Åª¤Ê»ÈÍÑË¡¤òÀâÌÀ¤·¤Þ¤¹¡£ +ɬ¿Ü¤Î¥Þ¥¯¥í¤Ï +.Ql ".Nm" , +.Ql ".Cd" , +.Ql ".Fn" +¤Î¤¤¤º¤ì¤«¤Ç¤¹¡£ +(¾¤Ë¤Ï +.Ql ".Fo" , +.Ql ".Fc" , +.Ql ".Fd" , +.Ql ".Ft" +¤Î¥Þ¥¯¥í¤âɬÍפʾì¹ç¤¬¤¢¤ê¤Þ¤¹¡£) +´Ø¿ô̾¥Þ¥¯¥í +.Ql ".Fn" +¤Ï¥»¥¯¥·¥ç¥ó 2 ¤È 3 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¤ª¤¤¤Æɬ¿Ü¤Î¤â¤Î¤Ç¡¢ +¥³¥Þ¥ó¥É¤È°ìÈÌ̾¾Î¥Þ¥¯¥í +.Ql \&.Nm +¤Ï¥»¥¯¥·¥ç¥ó 1, 5, 6, 7, 8 ¤Çɬ¿Ü¤Î¹àÌܤǤ¹¡£ +¥»¥¯¥·¥ç¥ó 4 ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ç¤Ï +.Ql ".Nm" +¤« +.Ql ".Fd" +¡¢¤â¤·¤¯¤Ï¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Ç¥Ð¥¤¥¹»ÈÍÑË¡¥Þ¥¯¥í +.Ql ".Cd" +¤¬É¬ÍפǤ¹¡£ +¤½¤Î¾¤Î¤¤¤¯¤Ä¤«¤Î¥Þ¥¯¥í¤¬²¼¤Ë¼¨¤¹¤è¤¦¤Ê½ñ¼°¹Ô¤òÀ¸À®¤¹¤ë¤¿¤á¤ËɬÍפʤ³¤È +¤¬¤¢¤ê¤Þ¤¹¡£ +.Pp +.Bd -filled -offset indent +.Nm cat +.Op Fl benstuv +.Op Fl +.Ar +.Ed +.Pp +°Ê²¼¤Î¥Þ¥¯¥í¤¬»È¤ï¤ì¤Æ¤¤¤Þ¤¹¡£ +.Pp +.Dl \&.Nm cat +.Dl \&.Op \&Fl benstuv +.Dl \&.Op \&Fl +.Dl \&.Ar +.Pp +.Sy Ãí : +¥Þ¥¯¥í +.Ql \&.Op , +.Ql \&.Fl , +.Ql \&.Ar +¤Ï¥Ñ¥¤¥×¤Îʸ»ú +.Ql \*(Ba +¤òǧ¼±¤·¡¢²¼µ­¤Î¤è¤¦¤Ê¥³¥Þ¥ó¥É¹Ô +.Pp +.Dl ".Op Fl a | Fl b" +.Pp +¤Ï¤¦¤Þ¤¯¤¤¤­¤Þ¤»¤ó¡£ +.Xr troff +¤ÏÄ̾ï \*(Ba ¤òÆÃÊ̤Υª¥Ú¥ì¡¼¥¿¤È¤·¤Æ²ò¼á¤·¤Þ¤¹¡£ +¤³¤Î¾¤Ç \*(Ba ¤¬»È¤¨¤ë¾ì¹ç¤Ë¤Ä¤¤¤Æ¤Ï +.Sx ÄêµÁºÑ¤ß¤Îʸ»úÎó +¥»¥¯¥·¥ç¥ó¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£ +.It \&.Sh DESCRIPTION +.Sx DESCRIPTION (ÌõÃí: ²òÀâ) +¥»¥¯¥·¥ç¥ó¤Ç¤ÎºÇ½é¤Î¥Æ¥­¥¹¥È¤Ï¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç¤Ç¤Ï¤½¤Î¥³¥Þ¥ó¥É¡¢ +´Ø¿ô¤â¤·¤¯¤Ï¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤Îû¤¤ÃÊÍî¤Ç¡¢¥ª¥×¥·¥ç¥ó¤Î¹½Ê¸¥ê¥¹¥È¤È +¤½¤ì¤¾¤ì¤ÎÀâÌÀ¤¬¤½¤ì¤Ë³¤­¤Þ¤¹¡£ +¤½¤Î¤è¤¦¤Ê¥ê¥¹¥È¤òºîÀ®¤¹¤ë¤Ë¤Ï +¥ê¥¹¥È³«»Ï¥Þ¥¯¥í +.Ql \&.Bl +¡¢¥ê¥¹¥È¹àÌÜ¥Þ¥¯¥í +.Ql \&.It +¡¢¥ê¥¹¥È½ªÎ»¥Þ¥¯¥í +.Ql \&.El +¤ò»È¤¤¤Þ¤¹ (¸å½Ò¤Î +.Sx ¥ê¥¹¥È¤ÈÎó +¥»¥¯¥·¥ç¥ó¤ò»²¾È)¡£ +.El +.Pp +°Ê²¼¤Î +.Ql \&.Sh +¤Î¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¤Ï¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¹¥¤Þ¤·¤¤¥ì¥¤¥¢¥¦¥È¤Î°ìÉô¤Ç¤¢¤ê¡¢ +°ì´ÓÀ­¤òÊݤĤ¿¤á¤ËŬÀڤ˻Ȥï¤ì¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +¤³¤ì¤é¤Ï»È¤ï¤ì¤ë½çÈ֤˥ꥹ¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +.Bl -tag -width ½ñ¼° +.It \&.Sh ENVIRONMENT (ÌõÃí: ´Ä¶­ÊÑ¿ô) +.Sx ENVIRONMENT +¥»¥¯¥·¥ç¥ó¤Ï´ØÏ¢¤¹¤ë´Ä¶­ÊÑ¿ô¤òÌÀ¤é¤«¤Ë¤·¡¢ +¤½¤ì¤é¤Î¿¶Éñ¤ä»ÈÍÑÊýË¡¤ò¼¨¤·¤Þ¤¹¡£ +.It \&.Sh EXAMPLES (ÌõÃí: »ÈÍÑÎã¡¢¼Â¹ÔÎã) +»ÈÍÑÎã¡¢¼Â¹ÔÎã¤òºîÀ®¤¹¤ë¤Ë¤ÏÍÍ¡¹¤ÊÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£ +¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢²¼¤Î +.Sx Î㼨¤È¥Ç¥£¥¹¥×¥ì¥¤ +¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ +.It \&.Sh FILES (ÌõÃí: ´ØÏ¢¥Õ¥¡¥¤¥ë) +man ¥Ú¡¼¥¸¤Î¥µ¥Ö¥¸¥§¥¯¥È¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¤«À¸À®¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ç¡¢ +.Sx FILES +¤Î¥»¥¯¥·¥ç¥óÃæ¤Ç¥Þ¥¯¥í +.Ql \&.Pa +¤Ë¤è¤Ã¤Æ¥ê¥¹¥È¤µ¤ì¤Þ¤¹¡£ +.It \&.Sh SEE ALSO (ÌõÃí: ´ØÏ¢¹àÌÜ) +.Sx SEE ALSO +¥»¥¯¥·¥ç¥ó¤Ë¤Ï¡¢¤½¤Î man ¥Ú¡¼¥¸¤ÎÂêºà¤Ë´Ø¤¹¤ë»ñÎÁ¤Ø¤Î»²¾È¤È +¾¤Î´ØÏ¢¤¹¤ë man ¥Ú¡¼¥¸¤Ø¤Î¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹¤¬µ­ºÜ¤µ¤ì¤Þ¤¹¡£ +¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹¤Ï +.Ql \&.Xr +¥Þ¥¯¥í¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤Þ¤¹¡£ +.Sx SEE ALSO +¥»¥¯¥·¥ç¥ó¤Ç¤Î¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹¤Ï¥»¥¯¥·¥ç¥óÈÖ¹æ½ç¤Ëʤ١¢ +¥»¥¯¥·¥ç¥óÃæ¤Ç¤Ï¥«¥ó¥Þ¤Ç¶èÀڤäƥ¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Ëʤ٤ʤ±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +°Ê²¼¤ËÎã¤ò¼¨¤·¤Þ¤¹¡£ +.Pp +.Xr ls 1 , +.Xr ps 1 , +.Xr group 5 , +.Xr passwd 5 +.Pp +¤³¤³¤Ç»²¹Í¥¹¥¿¥¤¥ë¤Ç¤¢¤ë +.Xr refer 1 +¤ÏŬ±þ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ +.It \&.Sh STANDARDS (ÌõÃí: µ¬³Ê) +¥³¥Þ¥ó¥É¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ä¥Õ¥¡¥¤¥ë¤¬¡¢ +.St -p1003.2 +¤ä +.St -ansiC +¤Î¤è¤¦¤ÊÆÃÄê¤Î¼ÂÁõ¤Ë¤è¤ë¤â¤Î¤Ç¤¢¤ì¤Ð¡¢¤³¤³¤Çµ­½Ò¤·¤Þ¤¹¡£ +¤â¤·¥³¥Þ¥ó¥É¤¬¤É¤Îµ¬³Ê¤Ë¤â´ð¤Å¤¤¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¤½¤ÎÎò»Ë¤Ï +.Sx HISTORY +¤Î¥»¥¯¥·¥ç¥ó¤ÇÀâÌÀ¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +.It \&.Sh HISTORY (ÌõÃí: Îò»Ë) +ÆÃÄê¤Îµ¬³Ê¤Ë´ð¤Å¤¤¤Æ¤¤¤Ê¤¤¥³¥Þ¥ó¥É¤Ï¡¢ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ç¤½¤ÎÎò»Ë¤Î³µÍפ¬ÀâÌÀ¤µ¤ì¤ë¤Ù¤­¤Ç¤¹¡£ +.It \&.Sh AUTHORS (ÌõÃí: ºî¼Ô) +¥¯¥ì¥¸¥Ã¥È¤¬É¬ÍפǤ¢¤ì¤Ð¡¢¤³¤³¤ÇÆþ¤ì¤Þ¤¹¡£ +¿Íʪ̾¤ò»ØÄꤹ¤ë¤Ë¤Ï +.Ql \&.An +¥Þ¥¯¥í¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£ +.It \&.Sh DIAGNOSTICS (ÌõÃí: ¿ÇÃÇ) +¥³¥Þ¥ó¥É¤«¤é¤Î¿ÇÃǤϤ³¤Î¥»¥¯¥·¥ç¥ó¤ËÆþ¤ì¤Þ¤¹¡£ +.It \&.Sh ERRORS (ÌõÃí: ¥¨¥é¡¼) +ÆÃÄê¤Î¥¨¥é¡¼¥Ï¥ó¥É¥ê¥ó¥°¡¢Æä˥饤¥Ö¥é¥ê´Ø¿ô +(man ¥Ú¡¼¥¸¤Î¥»¥¯¥·¥ç¥ó 2, 3, 9) ¤Ç¤Î¥¨¥é¡¼¥Ï¥ó¥É¥ê¥ó¥°¤Ï¡¢¤³¤³¤ÇÀâÌÀ¤·¤Þ¤¹¡£ +.Ql \&.Er +¥Þ¥¯¥í¤¬ errno ¤òµ­½Ò¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤Þ¤¹¡£ +.It \&.Sh BUGS (ÌõÃí: ¥Ð¥°) +¤¢¤­¤é¤«¤ÊÌäÂê¤Ï¤³¤³¤Çµ­½Ò¤·¤Þ¤¹¡£ +.El +.Pp +¥æ¡¼¥¶»ØÄê¤Î +.Ql \&.Sh +¥»¥¯¥·¥ç¥ó¤òÄɲ乤뤳¤È¤¬¤Ç¤­¤Þ¤¹¡£ +¤¿¤È¤¨¤Ð¡¢¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï°Ê²¼¤Î¤è¤¦¤ËÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹¡£ +.Bd -literal -offset 14n +\&.Sh ¥Ú¡¼¥¸¹½Â¤Îΰè +.Ed +.Ss ÃÊÍî¤È¹Ô¥¹¥Ú¡¼¥¹ +.Bl -tag -width 6n +.It \&.Pp +.Ql \&.Pp +ÃÊÍ¥Þ¥ó¥É +¤ÏɬÍפʾì¹ç¤Ë¹Ô¥¹¥Ú¡¼¥¹¤ò»ØÄꤹ¤ë¤¿¤á¤Ë»È¤ï¤ì¤Þ¤¹¡£ +¤³¤Î¥Þ¥¯¥í¤Ï +.Ql \&.Sh +¥Þ¥¯¥í¤ä +.Ql \&.Ss +¥Þ¥¯¥í¤Î¤¢¤È¡¢¤½¤ì¤Ë +.Ql \&.Bl +¥Þ¥¯¥í¤ÎÁ°¤Ç¤ÏɬÍפ¢¤ê¤Þ¤»¤ó¡£ +( +.Ql \&.Bl +¥Þ¥¯¥í¤Ï -compact ¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢½ÄÊý¸þ¤Îµ÷Î¥¤òÀë¸À¤·¤Þ¤¹ +)¡£ +.El +.\" This worked with version one, need to redo for version three +.\" .Pp +.\" .Ds I +.\" .Cw (ax+bx+c) \ is\ produced\ by\ \& +.\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\& +.\" .Cl Cx \t\t +.\" .Li \&.Cx\ ( +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Va ax +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Sy \+ +.\" .Cx +.\" .Cl Cx \&(\& +.\" .Va ax +.\" .Cx + +.\" .Va by +.\" .Cx + +.\" .Va c ) +.\" .Cx \t +.\" .Em is produced by +.\" .Cx \t +.\" .Li \&.Va by +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Sy \+ +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Va c ) +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Cx +.\" .Cx +.\" .Cw +.\" .De +.\" .Pp +.\" This example shows the same equation in a different format. +.\" The spaces +.\" around the +.\" .Li \&+ +.\" signs were forced with +.\" .Li \e : +.\" .Pp +.\" .Ds I +.\" .Cw (ax\ +\ bx\ +\ c) \ is\ produced\ by\ \& +.\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\& +.\" .Cl Cx \t\t +.\" .Li \&.Cx\ ( +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Va a +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Sy x +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Cx \e\ +\e\ \e& +.\" .Cx +.\" .Cl Cx \&(\& +.\" .Va a +.\" .Sy x +.\" .Cx \ +\ \& +.\" .Va b +.\" .Sy y +.\" .Cx \ +\ \& +.\" .Va c ) +.\" .Cx \t +.\" .Em is produced by +.\" .Cl Cx \t\t +.\" .Li \&.Va b +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Sy y +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Cx \e\ +\e\ \e& +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Va c ) +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Cx +.\" .Cx +.\" .Cw +.\" .De +.\" .Pp +.\" The incantation below was +.\" lifted from the +.\" .Xr adb 1 +.\" manual page: +.\" .Pp +.\" .Ds I +.\" .Cw \&[?/]m_b1_e1_f1[?/]\& is\ produced\ by +.\" .Cl Cx \t\t +.\" .Li \&.Cx Op Sy ?/ +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Nm m +.\" .Cx +.\" .Cl Cx Op Sy ?/ +.\" .Nm m +.\" .Ad \ b1 e1 f1 +.\" .Op Sy ?/ +.\" .Cx \t +.\" .Em is produced by +.\" .Cx \t +.\" .Li \&.Ar \e\ b1 e1 f1 +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Op Sy ?/ +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Cx +.\" .Cx +.\" .Cw +.\" .De +.\" .Pp +.Ss ¥­¡¼¥× +¸½ºß¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¥­¡¼¥×¤Ïñ¸ì¤ËÂФ¹¤ë¤â¤Î¤À¤±¤Ç¤¹¡£ +¤½¤ì¤é¤Ï +.Ql \&.Bk +(¥­¡¼¥×³«»Ï) ¥Þ¥¯¥í¤È +.Ql \&.Ek +(¥­¡¼¥×½ªÎ») ¥Þ¥¯¥í¤Ç¤¹¡£ +.Ql \&.Bk +¤Ë»ØÄê¤Ç¤­¤ë¥ª¥×¥·¥ç¥ó¤Ï +.Fl words +¤Î¤ß¤Ç¤¢¤ê¡¢¤³¤ì¤Ï¥ª¥×¥·¥ç¥ó¤ÎÅÓÃæ¤Ç²þ¹Ô¤¬Æþ¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Î¤ËÊØÍø¤Ç¤¹¡£ +¥³¥Þ¥ó¥É¹Ô¤Î°ú¿ô¤òÀ¸À®¤¹¤ëÎã ( +.Sx ¤³¤Î̾Á°¤Ë¤Ï²¿¤¬...? +¥»¥¯¥·¥ç¥ó¤ò»²¾È) ¤Ë¤ª¤¤¤Æ¡¢¥­¡¼¥×¤Ï +.Xr nroff +¤¬¥Õ¥é¥°¤È°ú¿ô¤òÊ̤ιԤËʬ¤±¤Ê¤¤¤è¤¦¤Ë»È¤ï¤ì¤Æ¤¤¤Þ¤¹¡£ +(¼ÂºÝ¤Ë¤Ï¡¢¥ª¥×¥·¥ç¥ó¥Þ¥¯¥í¤¬¤³¤ÎÌÜŪ¤Ç»È¤ï¤ì¤Æ¤¤¤Þ¤·¤¿¤¬¡¢ +¥ª¥×¥·¥ç¥ó¤¬¹ÔÃæ¤Ë¤ï¤¿¤Ã¤Æ»¶¤é¤Ð¤Ã¤Æ¤·¤Þ¤¦¤È +°ìÈÌŪ¤Ë¸«±É¤¨¤¬°­¤¯¤Ê¤ë¤È¤¤¤¦Íýͳ¤Ë¤è¤ê +.Xr troff +¤Ç±¦Â·¤¨¤Î¥Þ¡¼¥¸¥ó¤ò¶¯À©Åª¤Ë¹Ô¤Ê¤¦ (½¡¶µÅª¤Ê) ·èÄ꤬¤Ê¤µ¤ì¤Æ¤«¤é¡¢ +¥ª¥×¥·¥ç¥ó¥Þ¥¯¥í¤ò¤³¤ÎÌÜŪ¤Ç»È¤ï¤Ê¤¤¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£ +¥­¡¼¥×¥Þ¥¯¥í¤Ë¤Ä¤¤¤Æ¤Ï¤â¤Ã¤Èµ¡Ç½¤ò¸þ¾å¤¹¤ëºî¶È¤¬É¬ÍפǤ¢¤ê¡¢ +.Fl line +¥ª¥×¥·¥ç¥ó¤òÄɲ䷤Ƥ¤¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£) +.Ss Î㼨¤È¥Ç¥£¥¹¥×¥ì¥¤ +¥Ç¥£¥¹¥×¥ì¥¤¤Ë¤Ï 5 ¤Ä¤Î¥¿¥¤¥×¤¬¤¢¤ê¤Þ¤¹¡£ +¨ÀÊ 1 ¹Ô¥¤¥ó¥Ç¥ó¥È¥Ç¥£¥¹¥×¥ì¥¤ +.Ql \&.D1 +¡¢Â¨ÀÊ 1 ¹Ô¥ê¥Æ¥é¥ë¥Ç¥£¥¹¥×¥ì¥¤ +.Ql \&.Dl +¡¢¤½¤ì¤Ë +¥Ç¥£¥¹¥×¥ì¥¤³«»Ï¥Þ¥¯¥í +.Ql \&.Bd +¤È¥Ç¥£¥¹¥×¥ì¥¤½ªÎ»¥Þ¥¯¥í +.Ql \&.Ed +¤ò»ÈÍѤ¹¤ë¥ê¥Æ¥é¥ë¥Ö¥í¥Ã¥¯¡¢¥Õ¥£¥ë¥Ö¥í¥Ã¥¯¤ª¤è¤ÓÆ̱ú¥Ö¥í¥Ã¥¯¤Ç¤¹¡£ +.Pp +.Bl -tag -width \&.Dlxx +.It Li \&.D1 +(D-¤¤¤Á) ¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤¿¥Æ¥­¥¹¥È¤ò 1 ¹Ôɽ¼¨¤·¤Þ¤¹¡£ +¤³¤Î¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¤Þ¤¹¤¬¡¢¸Æ¤Ó½Ð¤·ÉÔ²Äǽ¤Ç¤¹¡£ +.Pp +.D1 Fl ldghfstru +.Pp +¤³¤ì¤Ï¼¡¤Î»ØÄê¤ÇÀ¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£ +.Li \&.D1 \&Fl ldghfstru +.It Li \&.Dl +(D-¥¨¥ë) +¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤¿ +.Em ¥ê¥Æ¥é¥ë +¥Æ¥­¥¹¥È¤ò 1 ¹Ôɽ¼¨¤·¤Þ¤¹¡£ +.Ql \&.Dl +¥Þ¥¯¥í¤ÎÎã¤ÏËÜ¥Õ¥¡¥¤¥ë¤ÎÃæ¤ËÅϤäƻȤï¤ì¤Æ¤¤¤Þ¤¹¡£ +¤³¤ì¤Ë¤è¤Ã¤Æ 1 ¹Ô¤Î¥Æ¥­¥¹¥È¤Î¥¤¥ó¥Ç¥ó¥È (ɽ¼¨) ¤¬²Äǽ¤Ë¤Ê¤ê¤Þ¤¹¡£ +¤³¤Î¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢Â¾¤Î¥Þ¥¯¥í¤òǧ¼±¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¤¬¡¢ +¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥©¥ó¥È¤Ï¸ÇÄêÉý (¥ê¥Æ¥é¥ë) ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¸Æ¤Ó½Ð¤·¤ÏÉÔ²Äǽ¤Ç¤¹¡£ +.Pp +.Dl % ls -ldg /usr/local/bin +.Pp +¤³¤ì¤Ï +.Li \&.Dl % ls -ldg /usr/local/bin +¤«¤éÀ¸À®¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +.It Li \&.Bd +¥Ç¥£¥¹¥×¥ì¥¤³«»Ï¤Ç¤¹¡£ +.Ql \&.Bd +¤Ë¤è¤ë¥Ç¥£¥¹¥×¥ì¥¤¤Ï +.Ql \&.Ed +¥Þ¥¯¥í¤Ë¤è¤Ã¤Æ½ªÎ»¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +¥Ç¥£¥¹¥×¥ì¥¤¤Ï¥Ç¥£¥¹¥×¥ì¥¤Æ⤪¤è¤Ó¥ê¥¹¥ÈÆâ¤ÇÆþ¤ì»Ò¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Ql \&.Bd +¤Ï°Ê²¼¤Î½ñ¼°¤ò¤È¤ê¤Þ¤¹¡£ +.Pp +.Dl ".Bd ¥Ç¥£¥¹¥×¥ì¥¤¥¿¥¤¥× [-offset ¥ª¥Õ¥»¥Ã¥ÈÃÍ] [-compact]" +.Pp +¥Ç¥£¥¹¥×¥ì¥¤¥¿¥¤¥×¤Ï°Ê²¼¤Î 4 ¤Ä¤Î¥¿¥¤¥×¤ÎÆâ¤Î 1 ¤Ä¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¥¤¥ó¥Ç¥ó¥È +.Ql \&.Bd +¤Î¥ª¥Õ¥»¥Ã¥ÈÃͤò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Pp +.Bl -tag -width "file ¥Õ¥¡¥¤¥ë̾ " -compact +.It Fl ragged +¥Æ¥­¥¹¥È¤Î¥Ö¥í¥Ã¥¯¤ò¥¿¥¤¥×¤µ¤ì¤¿Ä̤ê¤Ëɽ¼¨¤·¤Þ¤¹¡£ +±¦¥Þ¡¼¥¸¥ó (¤Èº¸¥Þ¡¼¥¸¥ó) ¤Î¥¨¥Ã¥¸¤Ïº¸¤ËÉÔ·¤¤¤Ë´ó¤»¤é¤ì¤Þ¤¹¡£ +.It Fl filled +¥Õ¥£¥ë (¥Õ¥©¡¼¥Þ¥Ã¥È) ¤µ¤ì¤¿¥Ö¥í¥Ã¥¯¤òɽ¼¨¤·¤Þ¤¹¡£ +¥Æ¥­¥¹¥È¤Î¥Ö¥í¥Ã¥¯¤¬¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤Þ¤¹ +(¥¨¥Ã¥¸¤Ïº¸È󷤨¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥£¥ë¤µ¤ì¤Þ¤¹)¡£ +.It Fl literal +¥ê¥Æ¥é¥ë¤Ê¥Ö¥í¥Ã¥¯¤òɽ¼¨¤·¤Þ¤¹¡£ +¥½¡¼¥¹¥³¡¼¥É¤ä¡¢Ã±½ã¤Ë¥¿¥Ö¤â¤·¤¯¤Ï¥¹¥Ú¡¼¥¹¤ÇÀ°¤¨¤é¤ì¤¿¥Æ¥­¥¹¥È¤ÇÊØÍø¤Ç¤¹¡£ +.It Fl file Ar ¥Õ¥¡¥¤¥ë̾ +.Fl file +¥Õ¥é¥°¤Ë³¤¯Ì¾¾Î¤Î¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤Þ¤ì¡¢É½¼¨¤µ¤ì¤Þ¤¹¡£ +ɽ¼¨¤Ï¥ê¥Æ¥é¥ë¤Ê¥â¡¼¥É¤Ç¹Ô¤ï¤ì¡¢¥¿¥Ö¤ÏÄêÉýʸ»ú 8 ¤Äʬ¤Ë¸ÇÄꤵ¤ì¤Þ¤¹¤¬¡¢ +¥Õ¥¡¥¤¥ëÃæ¤Î¤¹¤Ù¤Æ¤Î +.Xr troff/ Ns Nm \-mdoc +¥³¥Þ¥ó¥É¤Ï²ò¼á¤µ¤ì¤Þ¤¹¡£ +.It Fl offset Ar ʸ»úÎó +.Fl offset +¤¬°Ê²¼¤Îʸ»úÎó¤Î¤¤¤º¤ì¤«¤È¤È¤â¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢ +¤½¤Îʸ»úÎó¤Ï¼¡¤Î¥Æ¥­¥¹¥È¤Î¥Ö¥í¥Ã¥¯¤Î¥¤¥ó¥Ç¥ó¥È¤Î¥ì¥Ù¥ë¤ò¼¨¤¹¤â¤Î¤È¤·¤Æ +²ò¼á¤µ¤ì¤Þ¤¹¡£ +.Pp +.Bl -tag -width "indent-two" -compact +.It Ar left +¥Ö¥í¥Ã¥¯¤ò¸½ºß¤Îº¸¥Þ¡¼¥¸¥ó¤Ë·¤¨¤Þ¤¹¡£ +¤³¤ì¤Ï +.Ql \&.Bd +¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥â¡¼¥É¤Ç¤¹¡£ +.It Ar center +¥Ö¥í¥Ã¥¯¤òÃæ±û·¤¨¤Ë¤·¤Þ¤¹¡£ +»ÄÇ°¤Ê¤¬¤é¸½»þÅÀ¤Ç¤Ï¡¢ +ñ¤Ë¥Ö¥í¥Ã¥¯¤Îº¸Â¦¤ò²¾ÁÛŪ¤ÊÃæ±û¥Þ¡¼¥¸¥ó¤Ë·¤¨¤ë¤À¤±¤Ç¤¹¡£ +.It Ar indent +¥Ç¥Õ¥©¥ë¥È¤Î¥¤¥ó¥Ç¥ó¥ÈÃͤ⤷¤¯¤Ï¥¿¥Ö¤Îʬ¤À¤±¥¤¥ó¥Ç¥ó¥È¤·¤Þ¤¹¡£ +¥Ç¥Õ¥©¥ë¥È¤Î¥¤¥ó¥Ç¥ó¥ÈÃͤϥǥ£¥¹¥×¥ì¥¤ +.Ql \&.D1 +¤Ç¤â»È¤ï¤ì¡¢¤³¤ì¤é 2 ¤Ä¤Î¥¿¥¤¥×¤Î¥Ç¥£¥¹¥×¥ì¥¤¤ò»È¤Ã¤¿¾ì¹ç¡¢ +¹Ô¤¬Â·¤¦¤³¤È¤¬Êݾڤµ¤ì¤Æ¤¤¤Þ¤¹¡£ +¤³¤Î¥¤¥ó¥Ç¥ó¥È¤ÏÄ̾ï 6n ¤«Ìó 2/3 ¥¤¥ó¥Á (ÄêÉýʸ»ú 6 ¤Äʬ) ¤Ç¤¹¡£ +.It Ar indent-two +¥Ç¥Õ¥©¥ë¥È¤Î¥¤¥ó¥Ç¥ó¥ÈÃͤΠ2 ÇÜʬ¥¤¥ó¥Ç¥ó¥È¤·¤Þ¤¹¡£ +.It Ar right +¤³¤ì¤Ï¥Ö¥í¥Ã¥¯¤ò¥Ú¡¼¥¸¤Î±¦Ã¼¤«¤éÌó 2 ¥¤¥ó¥ÁÎ¥¤·¤Æ +.Em º¸ +·¤¨¤·¤Þ¤¹¡£ +¤³¤Î¥Þ¥¯¥í¤Ï¤Á¤ã¤ó¤ÈÆ°ºî¤¹¤ëɬÍפ¬¤¢¤ë¤Î¤Ç¤¹¤¬¡¢ +.Xr troff +¤Ç¤Ï¤Þ¤Ã¤¿¤¯¤Á¤ã¤ó¤ÈÆ°ºî¤·¤Æ¤¯¤ì¤Æ¤¤¤Þ¤»¤ó¡£ +.El +.El +.It ".Ed" +¥Ç¥£¥¹¥×¥ì¥¤½ªÎ»¡£ +.El +.Ss ¥Õ¥©¥ó¥È¥â¡¼¥É +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥Æ¥­¥¹¥È¤Î¸«±É¤¨¤òÊѹ¹¤¹¤ë¥Þ¥¯¥í¤Ï 5 ¤Ä¤¢¤ê¤Þ¤¹¡£ +.Bl -tag -width \&.Emxx +.It \&.Em +¥Æ¥­¥¹¥È¤Ï +.Ql \&.Em +¥Þ¥¯¥í¤Ç¶¯Ä´¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +¶¯Ä´¤Î¾ì¹ç¡¢Ä̾磻¥¿¥ê¥Ã¥¯ÂΤΥե©¥ó¥È¤¬»È¤ï¤ì¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Em argument ... \*(Pu +.Bl -tag -width ".Em vide infra ) ) ," -compact -offset 14n +.It Li ".Em does not" +.Em does not +.It Li ".Em exceed 1024 ." +.Em exceed 1024 . +.It Li ".Em vide infra ) ) ," +.Em vide infra ) ) , +.El +.Pp +.Ql \&.Em +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ql \&.Em +¤ò°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤¹¤Î¤Ï¥¨¥é¡¼¤Ç¤¹¡£ +.It \&.Li +¥ê¥Æ¥é¥ë¥Þ¥¯¥í +.Ql \&.Li +¤ÏÆüìʸ»ú¤äÊÑ¿ôÄê¿ô¡¢¤½¤Î¾¥¿¥¤¥×¤µ¤ì¤¿Ä̤ê¤Ëɽ¼¨¤¹¤ëɬÍפ¬¤¢¤ë¤â¤Î¤Ë +»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Li argument ... \*(Pu +.Bl -tag -width ".Li cntrl-D ) ," -compact -offset 14n +.It Li \&.Li \een +.Li \en +.It Li \&.Li M1 M2 M3\ ; +.Li M1 M2 M3 ; +.It Li \&.Li cntrl-D\ )\ , +.Li cntrl-D ) , +.It Li \&.Li 1024\ ... +.Li 1024 ... +.El +.Pp +.Ql \&.Li +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.It \&.Sy +¥·¥ó¥Ü¥ê¥Ã¥¯Âζ¯Ä´¥Þ¥¯¥í¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¤Î°ÕÌ£¤Ç¤â +ÅÁÅýŪ¤Ê±Ñ¸ì¤Î»È¤¤¤«¤¿¤Ë¤ª¤¤¤Æ¤â¡¢ +Ä̾ï¤Ï¥Ü¡¼¥ë¥É¥Þ¥¯¥í¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: .Sy symbol ... \*(Pu +.Bl -tag -width ".Sy Important Noticex" -compact -offset 14n +.It Li \&.Sy Important Notice +.Sy Important Notice +.El +.Pp +.Ql \&.Sy +¥Þ¥¯¥í¤Ï²òÀϤµ¤ì¡¢¸Æ¤Ó½Ð¤·²Äǽ¤Ç¤¹¡£ +.Ql \&.Sy +¤Î°ú¿ô¤Ï°úÍÑÉä¤Ç°Ï¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.It Li \&.Bf +¥Õ¥©¥ó¥È¥â¡¼¥É³«»Ï¡£ +¥Õ¥©¥ó¥È¥â¡¼¥É +.Ql \&.Bf +¤Ï +.Ql \&.Ef +¥Þ¥¯¥í¤Ç½ªÎ»¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +¥Õ¥©¥ó¥È¥â¡¼¥É¤Ï¾¤Î¥Õ¥©¥ó¥È¥â¡¼¥É¤ÈÆþ¤ì»Ò¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Ql \&.Bf +¤Ï¼¡¤Î¹½Ê¸¤ò¼è¤ê¤Þ¤¹¡£ +.Pp +.Dl ".Bf ¥Õ¥©¥ó¥È¥â¡¼¥É" +.Pp +¥Õ¥©¥ó¥È¥â¡¼¥É¤Ï°Ê²¼¤Î 3 ¤Ä¤Î¥¿¥¤¥×¤Î¤¦¤Á¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +.Pp +.Bl -tag -width "file file_name " -compact +.It Sy \&Em | Fl emphasis +¶¯Ä´¥â¡¼¥É¡£ +.Ql \&.Em +¥Þ¥¯¥í¤¬¥Æ¥­¥¹¥È¥Ö¥í¥Ã¥¯Á´ÂΤ˻Ȥï¤ì¤Æ¤¤¤ë¤Î¤ÈƱÍͤǤ¹¡£ +.It Sy \&Li | Fl literal +¥ê¥Æ¥é¥ë¥â¡¼¥É¡£ +.Ql \&.Li +¥Þ¥¯¥í¤¬¥Æ¥­¥¹¥È¥Ö¥í¥Ã¥¯Á´ÂΤ˻Ȥï¤ì¤Æ¤¤¤ë¤Î¤ÈƱÍͤǤ¹¡£ +.It Sy \&Sy | Fl symbolic +¥·¥ó¥Ü¥ê¥Ã¥¯¥â¡¼¥É¡£ +.Ql \&.Sy +¥Þ¥¯¥í¤¬¥Æ¥­¥¹¥È¥Ö¥í¥Ã¥¯Á´ÂΤ˻Ȥï¤ì¤Æ¤¤¤ë¤Î¤ÈƱÍͤǤ¹¡£ +.El +.It ".Ef" +¥Õ¥©¥ó¥È¥â¡¼¥É¤Î½ªÎ»¡£ +.El +.Ss ¥¿¥°¤Ä¤­¥ê¥¹¥È¤ÈÎó +¥ê¥¹¥È³«»Ï¥Þ¥¯¥í +.Ql ".Bl" +¤Ç³«»Ï¤µ¤ì¤ë¥ê¥¹¥È¤Ë¤Ï¤¤¤¯¤Ä¤«¤Î¥¿¥¤¥×¤¬¤¢¤ê¤Þ¤¹¡£ +¥ê¥¹¥ÈÃæ¤Î¹àÌܤϹàÌÜ¥Þ¥¯¥í +.Ql ".It" +¤Ç»ØÄꤵ¤ì¡¢³Æ¥ê¥¹¥È¤Ï +.Ql ".El" +¥Þ¥¯¥í¤Ç½ªÎ»¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +¥ê¥¹¥È¤Ï¥ê¥¹¥È¼«¿È¤ä¥Ç¥£¥¹¥×¥ì¥¤¤ÎÃæ¤ÇÆþ¤ì»Ò¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +Îó¤Ï¥ê¥¹¥È¤ÎÃæ¤Ç»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¤¬¡¢ +¥ê¥¹¥È¤¬Îó¤ÎÃæ¤Ç»È¤¨¤ë¤«¤É¤¦¤«¤Ï¸¡¾Ú¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ +.Pp +¤µ¤é¤Ë¡¢¥¿¥°¤ÎÉý¡¢¥ê¥¹¥È¤Î¥ª¥Õ¥»¥Ã¥È¡¢¥³¥ó¥Ñ¥¯¥È¤µ +(¹àÌܴ֤ζõÇò¹Ô¤¬µö¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«) ¤Î¤è¤¦¤Ê¡¢ +¤¤¤¯¤Ä¤«¤Î¥ê¥¹¥È¤Î°À­¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +Ëܥɥ­¥å¥á¥ó¥È¤Î¤Û¤È¤ó¤É¤Ï¥¿¥° +.Pq Fl tag +¥¹¥¿¥¤¥ë¥ê¥¹¥È¤Ç¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +³Æ¼ï¥ê¥¹¥È¥¿¥¤¥×¤Ï¡¢Ä´»Ò¤òÊѤ¨¤ë¤¿¤á¤Ë¥ª¡¼¥Ð¡¼¥Ï¥ó¥° +.Pq Fl ohang +¤Ç¥ê¥¹¥È¤·¤Þ¤·¤¿¡£ +¤³¤Î¥ê¥¹¥È¤Î¥¿¥¤¥×¤Ï +.Tn TeX +¤Î¥æ¡¼¥¶¤ËÈó¾ï¤Ë¿Íµ¤¤Î¤¢¤ë¤â¤Î¤Ç¤¹¤¬¡¢tag ¥ê¥¹¥È¤Ç¹½À®¤µ¤ì¤¿¥Ú¡¼¥¸¤ò +²¿¥Ú¡¼¥¸¤âÆɤó¤À¸å¤Ë¤Ï´öʬÊѤ˸«¤¨¤ë¤Ç¤·¤ç¤¦¡£ +°Ê²¼¤Î¥ê¥¹¥È¥¿¥¤¥×¤ò +.Ql ".Bl" +¤Ç»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Pp +.Bl -ohang -compact +.It Fl bullet +.It Fl item +.It Fl enum +¤³¤ì¤é 3 ¤Ä¤ÏºÇ¤âñ½ã¤Ê¥ê¥¹¥È¤Î¥¿¥¤¥×¤Ç¤¹¡£ +°ìö +.Ql ".Bl" +¥Þ¥¯¥í¤¬Í¿¤¨¤é¤ì¤ë¤È¡¢¥ê¥¹¥ÈÃæ¤Î¹àÌܤÏñ¤Ë +.Ql ".It" +¥Þ¥¯¥í¤Ë¤è¤Ã¤Æ¤Î¤ß¹½À®¤µ¤ì¤ë¹Ô¤Ç»ØÄꤵ¤ì¤Þ¤¹¡£ +Îã¤È¤·¤Æ¡¢´Êñ¤ÊÎóµó¥ê¥¹¥È¤Î¥½¡¼¥¹¥Æ¥­¥¹¥È¤Ï¡¢¤³¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ +.Bd -literal -offset indent-two +\&.Bl -enum -compact +\&.It +\&¤Ò¤È¤Ä¤á¤Ï¤³¤³¡£ +\&.It +\&¤½¤·¤Æ¤Õ¤¿¤Ä¤á¡£ +\&.It +\&ºÇ¸å¤Ë¤ß¤Ã¤Ä¤á¤Ï¤³¤³¡£ +\&.El +.Ed +.Pp +¤³¤ì¤é¤Î·ë²Ì¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ +.Pp +.Bl -enum -offset indent-two -compact +.It +¤Ò¤È¤Ä¤á¤Ï¤³¤³¡£ +.It +¤½¤·¤Æ¤Õ¤¿¤Ä¤á¡£ +.It +ºÇ¸å¤Ë¤ß¤Ã¤Ä¤á¤Ï¤³¤³¡£ +.El +.Pp +´Êñ¤Ê bullet ¥ê¥¹¥È¹½À®¤ÎÎã¤ò¼¨¤·¤Þ¤¹¡£ +.Bd -literal -offset indent-two +\&.Bl -bullet -compact +\&.It +\&¤Ò¤È¤Ä¤á¤Î bullet¡£ +\&.It +\&¤³¤ì¤Ï¤Õ¤¿¤Ä¤á¤Î bullet¡£ +\&.El +.Ed +.Pp +¤½¤Î·ë²Ì¤Ï¤³¤¦¤Ê¤ê¤Þ¤¹¡£ +.Bl -bullet -offset indent-two -compact +.It +¤Ò¤È¤Ä¤á¤Î bullet¡£ +.It +¤³¤ì¤Ï¤Õ¤¿¤Ä¤á¤Î bullet¡£ +.El +.Pp +.It Fl tag +.It Fl diag +.It Fl hang +.It Fl ohang +.It Fl inset +¤³¤ì¤é¤Î¥ê¥¹¥È¥¿¥¤¥×¤Ï +.Ql \&.It +¥Þ¥¯¥í¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤Æ¤¤¤ë°ú¿ô¤«¤é¥é¥Ù¥ë¤òÀ¸À®¤·¤Þ¤¹¡£ +¤½¤·¤Æ¡¢ +.Em inset +¤Ç¤Ï¡¢¼¡¤Î¥Æ¥­¥¹¥È¤Ø¤½¤Î¥é¥Ù¥ë¤òÁÞÆþ¤·¤Þ¤¹¡£ +.Em hang +¤Ç¤Ï¡¢¼¡¤Î¥Æ¥­¥¹¥È¤ò¥é¥Ù¥ë¤Î°ÌÃ֤إ¤¥ó¥Ç¥ó¥È¤·¤Þ¤¹¡£ +.Em ohang +(¥ª¡¼¥Ð¡¼¥Ï¥ó¥°) ¤Ç¤Ï¡¢¼¡¤Î¥Æ¥­¥¹¥È¤ò¥é¥Ù¥ë¤Î°ÌÃ֤ˤ֤鲼¤²¡¢¥¤¥ó¥Ç¥ó¥È¤·¤Þ¤»¤ó¡£ +.Em tag +¤Ç¤Ï¡¢¥¿¥°¤Ä¤­¥Æ¥­¥¹¥È¤Î·Á¼°¤Ë¤·¤Þ¤¹¡£ +¤Á¤Ê¤ß¤Ë¾å¤Î¥ê¥¹¥È¤Ï +.Ql Fl ohang +¥ê¥¹¥È¥¿¥¤¥×¤Ç¹½À®¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +.Ql \&.It +¥Þ¥¯¥í¤Ï inset, hang, tag ¤Î¥ê¥¹¥È¥¿¥¤¥×¤Ç¤Î¤ß²òÀϤµ¤ì¡¢ +¸Æ¤Ó½Ð¤·ÉÔ²Äǽ¤Ç¤¹¡£ +°Ê²¼¤Ë inset ¥é¥Ù¥ë¤ÎÎã¤ò¼¨¤·¤Þ¤¹¡£ +.Bl -inset -offset indent +.It Em tag +tag ¥ê¥¹¥È (tag ÃÊÍî¤È¤â¸Æ¤Ð¤ì¤ë) ¤Ï¡¢ +Berkely ¥Þ¥Ë¥å¥¢¥ë¤Ç»È¤ï¤ì¤Æ¤¤¤ë¥ê¥¹¥È¤Î¤¦¤ÁºÇ¤â°ìÈÌŪ¤Ê¥¿¥¤¥×¤Ç¤¹¡£ +.It Em diag (¿ÇÃÇ) +¿ÇÃǥꥹ¥È¤Ï¥»¥¯¥·¥ç¥ó 4 ¤Î¿ÇÃǥꥹ¥È¤òÀ¸À®¤¹¤ë¤â¤Î¤Ç¡¢ +¸Æ¤Ó½Ð¤·²Äǽ¤Ê¥Þ¥¯¥í¤¬Ìµ»ë¤µ¤ì¤ë¤³¤È¤ò½ü¤­¡¢inset ¥ê¥¹¥È¤È»÷¤Æ¤¤¤Þ¤¹¡£ +.It Em hang +hang ¥é¥Ù¥ë¤Ï¹¥¤ß¤ÎÌäÂê¤Ç¤¹¡£ +.It Em ohang +ohang ¥é¥Ù¥ë¤Ï¥¹¥Ú¡¼¥¹¤ËÀ©¸Â¤¬¤¢¤ë»þ¤ËÊØÍø¤Ç¤¹¡£ +.It Em inset +inset ¥é¥Ù¥ë¤ÏÃÊÍî¤Î¥Ö¥í¥Ã¥¯¤òÀ©¸æ¤¹¤ë¤Î¤ËÊØÍø¤Ç¡¢ +.Nm \-mdoc +¥Þ¥Ë¥å¥¢¥ë¤ò¾¤Î·Á¼°¤ËÊÑ´¹¤¹¤ë»þ¤ËÌòΩ¤Á¤Þ¤¹¡£ +.El +.Pp +¾å¤ÎÎã¤òÀ¸À®¤·¤¿¥½¡¼¥¹¥Æ¥­¥¹¥È¤Ï¤³¤¦¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ +.Bd -literal -offset indent +\&.Bl -inset -offset indent +\&.It Em tag +\&tag ¥ê¥¹¥È (tag ÃÊÍî¤È¤â¸Æ¤Ð¤ì¤ë) ¤Ï¡¢ +\&Berkely ¥Þ¥Ë¥å¥¢¥ë¤Ç»È¤ï¤ì¤Æ¤¤¤ë¥ê¥¹¥È¤Î¤¦¤ÁºÇ¤â°ìÈÌŪ¤Ê¥¿¥¤¥×¤Ç¤¹¡£ +\&.It Em diag (¿ÇÃÇ) +\&¿ÇÃǥꥹ¥È¤Ï¥»¥¯¥·¥ç¥ó 4 ¤Î¿ÇÃǥꥹ¥È¤òÀ¸À®¤¹¤ë¤â¤Î¤Ç¡¢ +\&¸Æ¤Ó½Ð¤·²Äǽ¤Ê¥Þ¥¯¥í¤¬Ìµ»ë¤µ¤ì¤ë¤³¤È¤ò½ü¤­¡¢inset ¥ê¥¹¥È¤È»÷¤Æ¤¤¤Þ¤¹¡£ +\&.It Em hang +\&hang ¥é¥Ù¥ë¤Ï¹¥¤ß¤ÎÌäÂê¤Ç¤¹¡£ +\&.It Em ohang +\&ohang ¥é¥Ù¥ë¤Ï¥¹¥Ú¡¼¥¹¤ËÀ©¸Â¤¬¤¢¤ë»þ¤ËÊØÍø¤Ç¤¹¡£ +\&.It Em inset +\&inset ¥é¥Ù¥ë¤ÏÃÊÍî¤Î¥Ö¥í¥Ã¥¯¤òÀ©¸æ¤¹¤ë¤Î¤ËÊØÍø¤Ç¡¢ +\&.Nm \-mdoc +\&¥Þ¥Ë¥å¥¢¥ë¤ò¾¤Î·Á¼°¤ËÊÑ´¹¤¹¤ë»þ¤ËÌòΩ¤Á¤Þ¤¹¡£ +\&.El +.Ed +.Pp +°Ê²¼¤Ï 2 ¤Ä¤Î¹àÌܤò»ý¤Ä hang ¥ê¥¹¥È¤Ç¤¹¡£ +.Bl -hang -offset indent +.It Em hang +¥é¥Ù¥ë¤¬¥é¥Ù¥ë¤ÎÉý¤è¤ê¾®¤µ¤¤¤È¤­¤Ë¤Ï¡¢ +¥é¥Ù¥ë¤Ï tag ¥ê¥¹¥È¤ÈƱ¤¸¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ +.It Em Ť¤ hang ¥ê¥¹¥È¥é¥Ù¥ë +¤Ï¡¢tag ÃÊÍî¤Î¥é¥Ù¥ë¤È¤Ï°Û¤Ê¤ê¡¢ +ÃÊÍî¤ÎÃæ¤ËËä¤á¹þ¤Þ¤ì¤Þ¤¹¡£ +.El +.Pp +¤³¤ì¤òÀ¸À®¤·¤Æ¤¤¤ë¸µ¤Î¥Æ¥­¥¹¥È¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ +.Bd -literal -offset indent +\&.Bl -hang -offset indent +\&.It Em hang +\&¥é¥Ù¥ë¤¬¥é¥Ù¥ë¤ÎÉý¤è¤ê¾®¤µ¤¤¤È¤­¤Ë¤Ï¡¢ +\&¥é¥Ù¥ë¤Ï tag ¥ê¥¹¥È¤ÈƱ¤¸¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ +\&.It Em Ť¤ hang ¥ê¥¹¥È¥é¥Ù¥ë +\&¤Ï¡¢tag ÃÊÍî¤Î¥é¥Ù¥ë¤È¤Ï°Û¤Ê¤ê¡¢ +\&ÃÊÍî¤ÎÃæ¤ËËä¤á¹þ¤Þ¤ì¤Þ¤¹¡£ +\&.El +.Ed +.Pp +¥¿¥°Éý¤òÀ©¸æ¤¹¤ë¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤ÎÉý»ØÄê¤ò»È¤Ã¤¿¥¿¥°¤Ä¤­¥ê¥¹¥È¤Ï +°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ +.Pp +.Bl -tag -width "PAGEIN" -compact -offset indent +.It SL +¥×¥í¥»¥¹¤¬ sleep ¤·¤Æ¤¤¤ë»þ´Ö (¥Ö¥í¥Ã¥¯¤µ¤ì¤¿Éÿô) +.It PAGEIN +¤½¤Î¥×¥í¥»¥¹¤Ë¤è¤ë¥³¥¢¤Ë¥í¡¼¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ú¡¼¥¸¤Ø¤Î»²¾È¤Ë¤è¤ë¥Ç¥£¥¹¥¯ +.Tn I/O +¤Î²ó¿ô +.It UID +¥×¥í¥»¥¹¤Î½êÍ­¼Ô¤Î¿ô»úɽµ­¤Ë¤è¤ë¥æ¡¼¥¶ID +.It PPID +¿Æ¥×¥í¥»¥¹¤Î¿ô»úɽµ­¤Ë¤è¤ëID¡¢¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ +(³ä¤ê¹þ¤ßÉԲĤΥ¦¥¨¥¤¥È¤Ç¤¢¤ë¤È¤­¤Ë¤ÏÈóÀµÃÍ) +.El +.Pp +¸µ¤Î¥Æ¥­¥¹¥È¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ +.Bd -literal -offset indent +\&.Bl -tag -width "PAGEIN" -compact -offset indent +\&.It SL +\&¥×¥í¥»¥¹¤¬ sleep ¤·¤Æ¤¤¤ë»þ´Ö (¥Ö¥í¥Ã¥¯¤µ¤ì¤¿Éÿô) +\&.It PAGEIN +\&¤½¤Î¥×¥í¥»¥¹¤Ë¤è¤ë¥³¥¢¤Ë¥í¡¼¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ú¡¼¥¸¤Ø¤Î»²¾È¤Ë¤è¤ë¥Ç¥£¥¹¥¯ +\&.Tn I/O +\&¤Î²ó¿ô +\&.It UID +\&¥×¥í¥»¥¹¤Î½êÍ­¼Ô¤Î¿ô»úɽµ­¤Ë¤è¤ë¥æ¡¼¥¶ID +\&.It PPID +\&¿Æ¥×¥í¥»¥¹¤Î¿ô»úɽµ­¤Ë¤è¤ëID¡¢¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ +\&(³ä¤ê¹þ¤ßÉԲĤΥ¦¥¨¥¤¥È¤Ç¤¢¤ë¤È¤­¤Ë¤ÏÈóÀµÃÍ) +\&.El +.Ed +.Pp +Éý»ØÄê¤È¤·¤Æ°Ê²¼¤Î¤â¤Î¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Bl -tag -width Ar -offset indent +.It Fl width Ar "\&Fl" +¤½¤Î¥Õ¥é¥°¤Ç¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÉý¤ò»ØÄꤷ¤Þ¤¹¡£ +¤¹¤Ù¤Æ¤Î¸Æ¤Ó½Ð¤·²Äǽ¤Ê¥Þ¥¯¥í¤Ï³Æ¡¹¥Ç¥Õ¥©¥ë¥È¤ÎÉý¤ÎÃͤò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£ +¸½ºß¡¢ +.Ql \&.Fl +¤ÎÃͤÏÄêÉýʸ»ú 10 ¸Äʬ¡¢¤â¤·¤¯¤ÏÌó 5/6 ¥¤¥ó¥Á¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ +.It Fl width Ar "24n" +ÄêÉýʸ»ú 24 ¸Äʬ¤ÎÉý¡¢¤â¤·¤¯¤ÏÌó 2 ¥¤¥ó¥Á¤ÎÉý¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£ +¤³¤ì¤¬Àµ¤·¤¯Æ°ºî¤¹¤ë¤Ë¤Ï +.Ql n +¤¬É¬¤ºÉ¬ÍפȤʤê¤Þ¤¹¡£ +.It Fl width Ar "ENAMETOOLONG" +»ØÄꤵ¤ì¤¿Ê¸»úÎó¤Î¸ÇÄêŤËÉý¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£ +.It Fl width Ar "\\*qint mkfifo\\*q" +¤³¤ì¤â¡¢»ØÄꤵ¤ì¤¿Ê¸»úÎó¤Î¸ÇÄêŤËÉý¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£ +.El +.El +.Pp +¥¿¥°¤Ä¤­¥ê¥¹¥È¥¿¥¤¥×¤ÇÉý¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢ +.Ql \&.It +¤¬ºÇ½é¤Ëµ¯Æ°¤µ¤ì¤¿»þ¤ËŬ¤·¤¿Éý¤ò·èÄꤹ¤ë¤³¤È¤¬»î¤ß¤é¤ì¤Þ¤¹¡£ +.Ql ".It" +¤ÎºÇ½é¤Î°ú¿ô¤¬¸Æ¤Ó½Ð¤·²Äǽ¤Ê¥Þ¥¯¥í¤Ç¤¢¤ì¤Ð¡¢¤½¤Î¥Þ¥¯¥í¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÉý¤¬ +¤½¤Î¥Þ¥¯¥í̾¤¬Éý¤È¤·¤Æ»ØÄꤵ¤ì¤¿¤è¤¦¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¤½¤Î¥ê¥¹¥ÈÃæ¤Ë¾¤Î¹àÌܤ¬Ê̤θƤӽФ·²Äǽ¤Ê¥Þ¥¯¥í̾¤Ç +Í¿¤¨¤é¤ì¤Æ¤¤¤ë¤È¡¢¿·¤·¤¯Æþ¤ì»Ò¤È¤Ê¤Ã¤¿¥ê¥¹¥È¤È¤·¤Æ½èÍý¤µ¤ì¤Þ¤¹¡£ +.Sh ÄêµÁºÑ¤ß¤Îʸ»úÎó +°Ê²¼¤Îʸ»úÎó¤Ï¤¢¤é¤«¤¸¤áÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ç¤¢¤ê¡¢ +troff ¤Îʸ»úÎó²ò¼á¥·¡¼¥±¥ó¥¹ +.Ql \&\e*(xx +¤â¤·¤¯¤Ï +.Ql \&\e*x +¤òÁ°¤Ëȼ¤Ã¤Æ»È¤ï¤ì¤Þ¤¹¡£ +¤³¤³¤Ç¡¢ +.Em xx +¤â¤·¤¯¤Ï +.Em x +¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤ëʸ»úÎó¤Î̾¾Î¤Ç¤¹¡£ +²ò¼á¥·¡¼¥±¥ó¥¹¤Ï¥Æ¥­¥¹¥È¤Î¤É¤³¤Ç¤â»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Pp +.Bl -column "ʸ»úÎó " "Nroff " "Troff " -offset indent +.It Sy "ʸ»úÎó Nroff Troff" +.It Li "<=" Ta \&<\&= Ta \*(<= +.It Li ">=" Ta \&>\&= Ta \*(>= +.It Li "Rq" Ta "''" Ta \*(Rq +.It Li "Lq" Ta "``" Ta \*(Lq +.It Li "ua" Ta ^ Ta \*(ua +.It Li "aa" Ta ' Ta \*(aa +.It Li "ga" Ta \` Ta \*(ga +.\" .It Li "sL" Ta ` Ta \*(sL +.\" .It Li "sR" Ta ' Ta \*(sR +.It Li "q" Ta \&" Ta \*q +.It Li "Pi" Ta pi Ta \*(Pi +.It Li "Ne" Ta != Ta \*(Ne +.It Li "Le" Ta <= Ta \*(Le +.It Li "Ge" Ta >= Ta \*(Ge +.It Li "Lt" Ta < Ta \*(Gt +.It Li "Gt" Ta > Ta \*(Lt +.It Li "Pm" Ta +- Ta \*(Pm +.It Li "If" Ta infinity Ta \*(If +.It Li "Na" Ta \fINaN\fP Ta \*(Na +.It Li "Ba" Ta \fR\&|\fP Ta \*(Ba +.El +.Pp +.Sy Ãí : +.Ql q +¤Î̾¾Î¤¬¤Ä¤±¤é¤ì¤Æ¤¤¤ëʸ»úÎó¤Ï¡¢1 ʸ»ú¤Ç¤¢¤ë¤¿¤á +.Ql \e*q +¤È½ñ¤«¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +.Sh ¿ÇÃÇ +.Nm \-mdoc +¤Ï¸Â¤é¤ì¤¿¥Ç¥Ð¥Ã¥°µ¡Ç½¤·¤«»ý¤Ã¤Æ¤¤¤Þ¤»¤ó¤¬¡¢ +°ú¿ô̾¤ÈÆâÉô¥ì¥¸¥¹¥¿¤ä¥Þ¥¯¥í̾¤È¤Î¾×ÆͤΤ褦¤Ê +ÀøºßŪ¤Ê¥¨¥é¡¼¤ò¸¡½Ð¤¹¤ë¤Î¤ËÌòΩ¤Á¤Þ¤¹¡£ +(A ¤Ã¤Æ²¿?) +¥ì¥¸¥¹¥¿¤Ï +.Xr troff +¤Ç¤Î±é»»Íѵ­²±¥¯¥é¥¹¤Ç¤¢¤ê¡¢1 ʸ»ú¤« 2 ʸ»ú¤Î̾¾Î¤¬¤Ä¤¤¤Æ¤¤¤Þ¤¹¡£ +.Xr troff +¤È +.Xr ditroff +¤Ç¤Î +.Nm \-mdoc +¤Î¤¹¤Ù¤Æ¤ÎÆâÉô¥ì¥¸¥¹¥¿¤Ï +.Ql \&Ar +¤Î¤è¤¦¤Ë2 ʸ»ú¤«¤é¤Ê¤ë <Âçʸ»ú><¾®Ê¸»ú> ¤Î·Á¼°¤«¡¢ +.Ql \&aR +¤Î¤è¤¦¤Ë <¾®Ê¸»ú><Âçʸ»ú> ¤Î·Á¼°¤«¡¢ +.Ql \&C\&1 +¤Î¤è¤¦¤Ë <Âçʸ»ú¤â¤·¤¯¤Ï¾®Ê¸»ú><¿ô»ú> ¤Î·Á¼°¤ò¼è¤ê¤Þ¤¹¡£ +¤µ¤é¤Ëº®Í𤹤뤳¤È¤Ë¡¢ +.Xr troff +¤Ï¤½¤ì¼«¿È¤ÎÆâÉô¥ì¥¸¥¹¥¿¤ò»ý¤Á¡¢ +¤½¤ì¤é¤¹¤Ù¤Æ¤Ï¾®Ê¸»ú 2 ʸ»ú¤«¡¢¥É¥Ã¥È¤Ëʸ»ú¤â¤·¤¯¤Ï¥á¥¿Ê¸»ú¤¬Â³¤¯·Á¼°¤ò¼è¤ê¤Þ¤¹¡£ +¾Ò²ðÎã¤Î 1 ¤Ä¤Ë¡¢ +¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ +.Ql \e& +¤Ç¥Þ¥¯¥í̾¤ò²ò¼á¤µ¤»¤Ê¤¤ÊýË¡¤¬¤¢¤ê¤Þ¤·¤¿¡£ +¤³¤ì¤ÏÆâÉô¥ì¥¸¥¹¥¿Ì¾¤Ë¤âÍ­¸ú¤Ç¤¹¡£ +.Pp +.\" Every callable macro name has a corresponding register +.\" of the same name (). +.\" There are also specific registers which have +.\" been used for stacks and arrays and are listed in the +.\" .Sx Appendix . +.\" .Bd -ragged -offset 4n +.\" [A-Z][a-z] registers corresponding to macro names (example ``Ar'') +.\" [a-z][A-Z] registers corresponding to macro names (example ``aR'') +.\" C[0-9] argument types (example C1) +.\" O[0-9] offset stack (displays) +.\" h[0-9] horizontal spacing stack (lists) +.\" o[0-9] offset (stack) (lists) +.\" t[0-9] tag stack (lists) +.\" v[0-9] vertical spacing stack (lists) +.\" w[0-9] width tag/label stack +.\" .Ed +.\" .Pp +¥¨¥¹¥±¡¼¥×¤µ¤ì¤Æ¤¤¤Ê¤¤¥ì¥¸¥¹¥¿Ì¾¤¬°ú¿ô¥ê¥¹¥È¤Ë»ØÄꤵ¤ì¤ë¤È¡¢ +ͽ´ü¤Ç¤­¤Ê¤¤¿¶Éñ¤¤¤È¤Ê¤ê¤Þ¤¹¡£ +°ìÈÌŪ¤Ë¤Ï¡¢¥Æ¥­¥¹¥È¤Î¤«¤Ê¤êÂ礭¤ÊÉôʬ¤¬½ÐÎϤµ¤ì¤ë¤Ù¤­¤È¤³¤í¤Ë +½ÐÎϤµ¤ì¤Ê¤¤¤È¤«¡¢¥ê¥¹¥È¤Î¥¿¥°¤Î¤è¤¦¤Ê¾®¤µ¤Êʸ»úÎ󤬾䨤Ƥ·¤Þ¤¦¤È¤«¡¢ +°ú¿ô¥ê¥¹¥È¤ÎÃæ¤Î°ú¿ô¤Î¥¿¥¤¥×¤¬´Ö°ã¤Ã¤Æ²ò¼á¤µ¤ì¤ë¤È¤«¤¤¤¦¤³¤È¤¬¡¢µ¯¤³¤êÆÀ¤Þ¤¹¡£ +¤­¤Ã¤È¤¢¤Ê¤¿¤Î¤ªÊ줵¤ó¤Ï¡¢¤¢¤Ê¤¿¤Ë¤³¤ó¤ÊÌÌÅݤʤ³¤È¤ò³Ð¤¨¤ë¤è¤¦¤Ë¤È¤Ï +¹Í¤¨¤Æ¤¤¤Ê¤¤¤Ç¤·¤ç¤¦¡£ +¤½¤³¤Ç¡¢Í¿¤¨¤é¤ì¤¿°ú¿ô¤¬Í­¸ú¤«Ìµ¸ú¤«¤òȽÃǤ¹¤ëÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£ +¤½¤ó¤Ê¤È¤­¤Ë¤Ï¡¢ +.Ql \&.Db +(¥Ç¥Ð¥Ã¥°) ¥Þ¥¯¥í¤Ë¤è¤Ã¤Æ¤Û¤È¤ó¤É¤Î¥Þ¥¯¥í¤Î°ú¿ô¥ê¥¹¥È¤¬¤É¤¦²ò¼á¤µ¤ì¤ë¤« +¤òɽ¼¨¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +.Ql \&.Pp +(ÃÊÍî) ¥Þ¥¯¥í¤Î¤è¤¦¤Ê¥Þ¥¯¥í¤Ï¥Ç¥Ð¥Ã¥°¾ðÊó¤ò´Þ¤ó¤Ç¤¤¤Þ¤»¤ó¡£ +¸Æ¤Ó½Ð¤·²Äǽ¤Ê¥Þ¥¯¥í¤Ï¤¹¤Ù¤Æ¥Ç¥Ð¥Ã¥°¾ðÊó¤ò´Þ¤ó¤Ç¤ª¤ê¡¢ +µ¿¤¤¤¬¤¢¤ë¾ì¹ç¤Ï¤¤¤Ä¤Ç¤â +.Ql \&.Db +¥Þ¥¯¥í¤ò¥ª¥ó¤Ë¤¹¤ë¤³¤È¤ò¶¯¤¯¤ª´«¤á¤·¤Þ¤¹¡£ +.Pp +.Dl »È¤¤Êý: \&.Db [on | off] +.Pp +°Ê²¼¤ÎÎã¤Ç¤Ï¡¢ +ÌäÂ꤬¸Î°Õ¤ËȯÀ¸¤¹¤ë¤è¤¦¤Ë¤µ¤ì¤¿Éôʬ¤Î¾å¤È²¼¤Ç +¥Ç¥Ð¥Ã¥°¥Þ¥¯¥í¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤¹ +(¥Õ¥é¥°°ú¿ô +.Ql \&aC +¤ÏÀµ¤·¤¯Æ°ºî¤¹¤ë¤¿¤á¤Ë¤Ï +.Ql \e&aC +¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó)¡£ +.Bd -literal -offset indent +\&.Db on +\&.Op Fl aC Ar file ) +\&.Db off +.Ed +.Pp +¤³¤Î·ë²Ì¤Î½ÐÎϤϰʲ¼¤ÎÄ̤ê¤Ç¤¹¡£ +.Bd -literal -offset indent +DEBUGGING ON +DEBUG(argv) MACRO: `.Op' Line #: 2 + Argc: 1 Argv: `Fl' Length: 2 + Space: `' Class: Executable + Argc: 2 Argv: `aC' Length: 2 + Space: `' Class: Executable + Argc: 3 Argv: `Ar' Length: 2 + Space: `' Class: Executable + Argc: 4 Argv: `file' Length: 4 + Space: ` ' Class: String + Argc: 5 Argv: `)' Length: 1 + Space: ` ' Class: Closing Punctuation or suffix + MACRO REQUEST: .Op Fl aC Ar file ) +DEBUGGING OFF +.Ed +.Pp +¤³¤Î¾ðÊó¤ÎºÇ½é¤Î¹Ô¤Ç¤Ï¸Æ¤Ó½Ð¤µ¤ì¤Æ¤¤¤ë¥Þ¥¯¥í¤Î̾¾Î¤¬½ÐÎϤµ¤ì¤Æ¤¤¤Þ¤¹¡£ +¤³¤³¤Ç¤Ï +.Ql \&.Op +¤È¤½¤ì¤¬¸½¤ì¤¿¹ÔÈֹ椬ɽ¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +Ê£¿ô¤Î¥Õ¥¡¥¤¥ë¤¬½èÍý¤µ¤ì¤Æ¤¤¤ë¾ì¹ç +(Æä˥ƥ­¥¹¥È¤¬Â¾¤Î¥Õ¥¡¥¤¥ë¤«¤é¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤Æ¤¤¤ë¾ì¹ç)¡¢ +¹ÔÈÖ¹æ¤ÏÀµ¤·¤¯¤Ê¤¤¤Ç¤·¤ç¤¦¡£ +¥Õ¥¡¥¤¥ë¤¬ 1 ¤Ä¤À¤±¤Î¾ì¹ç¤Ë¤ÏÀµ¤·¤¤¹ÔÈֹ椬½ÐÎϤµ¤ì¤Þ¤¹¡£ +2 ÈÖÌܤιԤǤϰú¿ô¤Î¸Ä¿ô¤È°ú¿ô +.Pq Ql \&Fl +¤È¤½¤ÎŤµ¤¬½ÐÎϤµ¤ì¤Æ¤¤¤Þ¤¹¡£ +°ú¿ô¤ÎŤµ¤¬ 2 ʸ»ú¤Ç¤¢¤ì¤Ð¡¢ +¤½¤Î°ú¿ô¤¬¼Â¹Ô²Äǽ +(¥¼¥í¤Ç¤Ê¤¤Ãͤò´Þ¤à¤¹¤Ù¤Æ¤Î¥ì¥¸¥¹¥¿¤Ï¼Â¹Ô²Äǽ¤Ê¤è¤¦¤Ë¸«¤¨¤Þ¤¹) +¤«¤É¤¦¤«¥Æ¥¹¥È¤µ¤ì¤Þ¤¹¡£ +3 ÈÖÌܤιԤǤϤ½¤Î¥¯¥é¥¹¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¹¥Ú¡¼¥¹¤È¥¯¥é¥¹¥¿¥¤¥×¤¬ +½ÐÎϤµ¤ì¤Æ¤¤¤Þ¤¹¡£ +¤³¤³¤Ç¤ÎÌäÂê¤Ï°ú¿ô aC ¤¬¼Â¹ÔÉÔ²Äǽ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤Ç¤¹¡£ +¥¯¥é¥¹¤Î 4 ¤Ä¤Î¥¿¥¤¥×¤Ïʸ»úÎ󡢼¹ԲÄǽ¡¢ÊĤ¸¤ë¶çÆÉÅÀ¡¢³«¤¯¶çÆÉÅÀ¤Ç¤¹¡£ +ºÇ¸å¤Î¹Ô¤Ç¤Ï°ú¿ô¥ê¥¹¥ÈÁ´ÂΤ¬Æɤ߹þ¤Þ¤ì¤¿Ä̤ê¤Ëɽ¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +¼¡¤ÎÎã¤Ç¤ÏÌäÂê¤Î¸¶°ø¤È¤Ê¤Ã¤Æ¤¤¤ë +.Ql \&aC +¤¬¥¨¥¹¥±¡¼¥×¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +.Bd -literal -offset indent +\&.Db on +\&.Em An escaped \e&aC +\&.Db off +.Ed +.Bd -literal -offset indent +DEBUGGING ON +DEBUG(fargv) MACRO: `.Em' Line #: 2 + Argc: 1 Argv: `An' Length: 2 + Space: ` ' Class: String + Argc: 2 Argv: `escaped' Length: 7 + Space: ` ' Class: String + Argc: 3 Argv: `aC' Length: 2 + Space: ` ' Class: String + MACRO REQUEST: .Em An escaped &aC +DEBUGGING OFF +.Ed +.Pp +.Ql \e& +¥·¡¼¥±¥ó¥¹¤ÏŤµ¤¬ 0 ¤È¤Ê¤ë¤¿¤á¤Ë +°ú¿ô +.Ql \e&aC +¤ÏÀè¤ÎÎã¤ÈƱÍͤËŤµ 2 ¤Èɽ¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +¤·¤«¤·¡¢ +.Ql \e&aC +¤È¤¤¤¦Ì¾¾Î¤Î¥ì¥¸¥¹¥¿¤¬¸«¤Ä¤«¤é¤º¡¢¥¿¥¤¥×¤Ïʸ»úÎó¤ÈȽÃǤµ¤ì¤Æ¤¤¤Þ¤¹¡£ +.Pp +¤³¤Î¾¤Î¿ÇÃǤϻÈÍÑÊýË¡¤òÊó¹ð¤¹¤ë¤â¤Î¤Ç¤¢¤ê¡¢ +¤½¤ì¼«¿È¤¬ÀâÌÀ¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£ +.Sh GROFF, TROFF, NROFF +.Nm \-mdoc +¥Ñ¥Ã¥±¡¼¥¸¤Ï +.Xr groff +¤È¤Î¸ß´¹¥â¡¼¥É¤ÏɬÍפǤϤ¢¤ê¤Þ¤»¤ó¡£ +.Pp +¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ç¤Ï²þ¥Ú¡¼¥¸¤È¡¢ +.Xr nroff +¤Ç²þ¥Ú¡¼¥¸»þ¤ËÄ̾ïÁÞÆþ¤µ¤ì¤ë¥Ø¥Ã¥À¤È¥Õ¥Ã¥¿¤Ï¶Ø»ß¤µ¤ì¤Æ¤ª¤ê¡¢ +¥Þ¥Ë¥å¥¢¥ë¤ò¥ª¥ó¥é¥¤¥ó¤Ç¸úΨÎɤ¯¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ +¸½ºß¤Î½ê¡¢ +.Fl T Ns Ar ascii +¤¬»ØÄꤵ¤ì¤¿ +.Xr groff +¤Ï¥Ú¡¼¥¸ÆâÍƤÎ̵¤¤¥Õ¥¡¥¤¥ëËö¤Î»Ä¤ê¤ÎÉôʬ¤Þ¤Ç½ÐÎϤ·¤Þ¤¹¡£ +²þ¥Ú¡¼¥¸¤ò¶Ø»ß¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ +.Xr nroff +¤Ë¤è¤ë½ÐÎϤϥϡ¼¥É¥³¥Ô¡¼¤Ë¤ÏŬ¤µ¤Ê¤¤¤â¤Î¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ +¥µ¥¤¥È°Í¸¤Î¥¹¥¿¥¤¥ë¥Õ¥¡¥¤¥ë +.Pa /usr/src/share/tmac/doc-nroff +¤Ë¤ª¤¤¤Æ 0 ¤Ë¥»¥Ã¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.Ql \&cR +¤Î̾¾Î¤ò»ý¤Ä¥ì¥¸¥¹¥¿¤¬¸Å¤¤¥¹¥¿¥¤¥ë¤Î¿¶¤ëÉñ¤¤¤ò¼Â¸½¤¹¤ë¤¿¤á¤ËÍÑ°Õ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +.Sh ´ØÏ¢¥Õ¥¡¥¤¥ë +.Bl -tag -width /usr/share/man0/template.doc -compact +.It Pa /usr/share/tmac/doc.tmac +¥Þ¥Ë¥å¥¢¥ë¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸ +.It Pa /usr/share/misc/mdoc.template +man ¥Ú¡¼¥¸¤ò½ñ¤¯¤¿¤á¤Î¥Æ¥ó¥×¥ì¡¼¥È +.It Pa /usr/share/examples/mdoc/* +man ¥Ú¡¼¥¸¤Î¤¤¤¯¤Ä¤«¤ÎÎã +.El +.Sh ¥Ð¥° +¤¢¤é¤«¤¸¤áÄêµÁ¤µ¤ì¤Æ¤¤¤ëʸ»úÎó¤Ïʸ½ñ¤Ë¤ª¤¤¤ÆÀë¸À¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ +.Pp +¥»¥¯¥·¥ç¥ó 3f ¤Ï¥Ø¥Ã¥À¥ë¡¼¥Á¥ó¤Ë¤ÏÄɲ䵤ì¤Æ¤¤¤Þ¤»¤ó¡£ +.Pp +.Ql \&.Nm +¥Õ¥©¥ó¥È¤Ï +.Sx NAME +¥»¥¯¥·¥ç¥ó¤Ë¤ª¤¤¤ÆÊѹ¹¤µ¤ì¤ë¤Ù¤­¤Ç¤¹¡£ +.Pp +.Ql \&.Fn +¤Ïʬ³ä¤µ¤ì¤ë¤Î¤òËɻߤ¹¤ë¤¿¤á¤Ë¡¢ +¹Ô¤ÎŤµ¤¬Ã»¤¹¤®¤Ê¤¤¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ +¤È¤­¤É¤­¡¢ºÇ¸å¤Î³ç¸Ì¤¬Ê¬³ä¤µ¤ì¤ë¤³¤È¤¬¤¢¤ê¡¢ +¹Ô¤¬¥Õ¥£¥ë¥â¡¼¥É¤Ç¤¢¤ë¤È¤­¤Ë¤ÏÁ´¤¯¤ª¤«¤·¤Ê·ë²Ì¤Ë¤Ê¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£ +.Pp +¥ê¥¹¥È¥Þ¥¯¥í¤È¥Ç¥£¥¹¥×¥ì¥¤¥Þ¥¯¥í¤Ï¥­¡¼¥×¤ò¹Ô¤¤¤Þ¤»¤ó¤¬¡¢ +¤³¤ì¤Ï¥­¡¼¥×¤ò¹Ô¤¦¤Ù¤­¤Ç¤¹¡£ +.\" Note what happens if the parameter list overlaps a newline +.\" boundary. +.\" to make sure a line boundary is crossed: +.\" .Bd -literal +.\" \&.Fn struct\e\ dictionarytable\e\ *dictionarylookup struct\e\ dictionarytable\e\ *tab[] +.\" .Ed +.\" .Pp +.\" produces, nudge nudge, +.\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] , +.\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] , +.\" nudge +.\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] . +.\" .Pp +.\" If double quotes are used, for example: +.\" .Bd -literal +.\" \&.Fn \*qstruct dictionarytable *dictionarylookup\*q \*qchar *h\*q \*qstruct dictionarytable *tab[]\*q +.\" .Ed +.\" .Pp +.\" produces, nudge nudge, +.\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" , +.\" nudge +.\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" , +.\" nudge +.\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" . +.\" .Pp +.\" Not a pretty sight... +.\" In a paragraph, a long parameter containing unpaddable spaces as +.\" in the former example will cause +.\" .Xr troff +.\" to break the line and spread +.\" the remaining words out. +.\" The latter example will adjust nicely to +.\" justified margins, but may break in between an argument and its +.\" declaration. +.\" In +.\" .Xr nroff +.\" the right margin adjustment is normally ragged and the problem is +.\" not as severe. +.Sh ´ØÏ¢¹àÌÜ +.Xr man 1 , +.Xr troff 1 , +.Xr groff_mdoc 7 , +.Xr mdoc 7 diff --git a/draft/man1/intro.1 b/draft/man1/intro.1 new file mode 100644 index 00000000..584210b4 --- /dev/null +++ b/draft/man1/intro.1 @@ -0,0 +1,504 @@ +.\" Copyright (c) 2002 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. +.\" +.\" 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 ÌÚ +.\" +.TH INTRO 1 2007-11-15 "Linux" "Linux User's Manual" +.\"O .SH NAME +.\"O intro \- Introduction to user commands +.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 ¾Ï¤Ï¡¢¥æ¡¼¥¶¡¼¥³¥Þ¥ó¥É¤ä¥Ä¡¼¥ë¤ÎÀâÌÀ¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤ë¡£ +Î㤨¤Ð¡¢¥Õ¥¡¥¤¥ëÁàºî¥Ä¡¼¥ë¡¢¥·¥§¥ë¡¢¥³¥ó¥Ñ¥¤¥é¡¢¥¦¥§¥Ö¥Ö¥é¥¦¥¶¡¢ +¥Õ¥¡¥¤¥ë¤ä¥¤¥á¡¼¥¸¤Î¥Ó¥å¡¼¥¢¤ä¥¨¥Ç¥£¥¿¡¢¤Ê¤É¤Ç¤¢¤ë¡£ + +.\"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 É÷¤Î¥·¥¹¥Æ¥à¤Ç¤âƱÍͤǤ¢¤ë)¡£ +.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" +.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" +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.LP +.\"O A session might go like +¥»¥Ã¥·¥ç¥ó¤ÎÎã¤ò°Ê²¼¤Ë¼¨¤¹¡£ + +.RS +.nf +.BI "knuth login: " aeb +.BI "Password: " ******** +.BI "% " date +Tue Aug 6 23:50:44 CEST 2002 +.BI "% " cal + August 2002 +Su Mo Tu We Th Fr Sa + 1 2 3 + 4 5 6 7 8 9 10 +11 12 13 14 15 16 17 +18 19 20 21 22 23 24 +25 26 27 28 29 30 31 + +.BI "% " ls +bin tel +.BI "% " "ls \-l" +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" +maja 0501\-1136285 +peter 0136\-7399214 +.BI "% " "cp tel tel2" +.BI "% " "ls \-l" +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" +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" +maja 0501\-1136285 +.BI "% " +.fi +.RE + +.\"O and here typing Control-D ended the session. +¤³¤³¤Ç Control-D ¤òÂǤĤȥ»¥Ã¥·¥ç¥ó¤¬½ªÎ»¤¹¤ë¡£ +.\"O The +.\"O .B "% " +.\"O here was the command prompt \(em it 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? " ¤ÈÀßÄꤹ¤ë¤È¡¢ +¥×¥í¥ó¥×¥È¤Ï¤½¤Î¤è¤¦¤ËÊѹ¹¤µ¤ì¤ë¤À¤í¤¦¡£ +.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 +¤È¤¤¤¦¥«¥ì¥ó¥À¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤â¤¢¤ë¡£ +.LP +.\"O The command +.\"O .I ls +.\"O lists the contents of the current directory \(em it 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 +¥³¥Þ¥ó¥É¤ÇÊѹ¹¤Ç¤­¤ë¡£ +.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" (Ï¢·ë¤·¤Æ°õ»ú¤¹¤ë) ¤ËͳÍ褷¤Æ¤¤¤ë¡£ +°ú¿ô¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍƤ¬Ï¢·ë¤µ¤ì¡¢¡Öɸ½à½ÐÎÏ¡× +¤ËÁ÷¤é¤ì¤ë¡£¾å¤ÎÎã¤Ç¤Ï¡¢É¸½à½ÐÎϤÏüËö¤Î¥¹¥¯¥ê¡¼¥ó¤Ç¤¢¤ë¡£) +.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 +¥³¥Þ¥ó¥É¤Ïñ½ã¤Ë¥Õ¥¡¥¤¥ë̾¤ÎÊѹ¹¤ò¹Ô¤¦ +(¤½¤Î̾Á°¤Ï "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 ¤Ä¤Î¥Õ¥¡¥¤¥ë¤Î°ã¤¤¤òɽ¼¨¤¹¤ë¡£ +¾å¤ÎÎã¤Ç¤Ï¡¢Æó¤Ä¤Î¥Õ¥¡¥¤¥ë¤Ë°ã¤¤¤¬¤Ê¤¤¤Î¤Ç¡¢²¿¤â½ÐÎϤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.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 +¥³¥Þ¥ó¥É¤Ï¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¡£¥Õ¥¡¥¤¥ë¤Ï¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤Î¤Ç +Ãí°Õ¤·¤Æ»ÈÍѤ¹¤ë¤³¤È! ¥´¥ßÈ¢¤ËÁêÅö¤¹¤ë¤â¤Î¤Ï¤Ê¤¯¡¢ +ºï½ü¤Ï¤½¤Î¥Õ¥¡¥¤¥ë¤¬´°Á´¤Ë¼º¤ï¤ì¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.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" +.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" ¤Ë¾Êά¤·¤Æ½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +.\"O The command +.\"O .I pwd +.\"O prints the current directory. +.I pwd +¥³¥Þ¥ó¥É¤Ï¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤òɽ¼¨¤¹¤ë¡£ +.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" +.SS ¥Ç¥£¥ì¥¯¥È¥ê +.\"O The command +.\"O .I mkdir +.\"O makes a new directory. +.I mkdir +¥³¥Þ¥ó¥É¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ò¿·µ¬¤ËºîÀ®¤¹¤ë¡£ +.LP +.\"O The command +.\"O .I rmdir +.\"O removes a directory if it is empty, and complains otherwise. +.I rmdir +¥³¥Þ¥ó¥É¤Ï¶õ¤Ç¤¢¤ì¤Ð¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¡¢ +¶õ¤Ç¤Ê¤±¤ì¤Ð¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£ +.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" +.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" +.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" +.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 +¤¬»È¤ï¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ +¼¡¤Î¥Ú¡¼¥¸¤Ë¿Ê¤à¤Ë¤Ï¥¹¥Ú¡¼¥¹¡¦¥­¡¼¤ò¡¢½ªÎ»¤¹¤ë¤Ë¤Ï 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 ¥Ú¡¼¥¸¤Ï´Ê·é¤Ë½ñ¤«¤ì¤Æ¤ª¤ê¡¢¾ÜºÙ¤ò˺¤ì¤¿¤È¤­¤ËÁÇÁ᤯¾ðÊó¤ò¸«¤Ä¤±¤ë +¤³¤È¤¬¤Ç¤­¤ë¡£Îã¤äÀâÌÀ¤È¤È¤â¤ËÆþÌç¸þ¤±¤Îµ­ºÜ¤â¤¢¤ë¤Î¤Ç¡¢½é¤á¤Æ¤Î¿Í¤Ë¤È¤Ã¤Æ¤â +Ìò¤ËΩ¤Ä¤â¤Î¤Ç¤¢¤ë¡£ +.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" ¥×¥í¥°¥é¥à¤Î»È¤¤Êý¤Î¾Ò²ð¤¬É½¼¨¤µ¤ì¤ë¡£ +.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" +.SH ´ØÏ¢¹àÌÜ +.BR standards (7) diff --git a/draft/man1/ldd.1 b/draft/man1/ldd.1 new file mode 100644 index 00000000..5b89a6ff --- /dev/null +++ b/draft/man1/ldd.1 @@ -0,0 +1,130 @@ +.\" Copyright 1995-2000 David Engel (david@ods.com) +.\" Copyright 1995 Rickard E. Faith (faith@cs.unc.edu) +.\" Copyright 2000 Ben Collins (bcollins@debian.org) +.\" Redone for GLibc 2.2 +.\" Copyright 2000 Jakub Jelinek (jakub@redhat.com) +.\" Corrected. +.\" 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 +.\" +.TH LDD 1 2000-10-30 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O ldd \- print shared library dependencies +.SH ̾Á° +ldd \- ¶¦Í­¥é¥¤¥Ö¥é¥ê¤Ø¤Î°Í¸´Ø·¸¤òɽ¼¨¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.BR ldd " [OPTION]... FILE..." +.\"O .SH DESCRIPTION +.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 +.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 +.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). +¥ê¥í¥±¡¼¥·¥ç¥ó¤ò¼Â¹Ô¤·¡¢Â­¤ê¤Ê¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ä¤¤¤Æ¥ì¥Ý¡¼¥È¤¹¤ë (ELF ¤Î¤ß)¡£ +.TP +.B \-r\ \-\-function\-relocs +.\"O report any missing objects or functions (ELF only). +­¤ê¤Ê¤¤¥ª¥Ö¥¸¥§¥¯¥È¤ä´Ø¿ô¤Ë¤Ä¤¤¤Æ¥ì¥Ý¡¼¥È¤¹¤ë (ELF ¤Î¤ß)¡£ +.TP +.B \-\-help +.\"O Usage information. +»ÈÍÑË¡¤òɽ¼¨¤¹¤ë¡£ +.\"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 +¤·¤«¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.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 +.SH ¥Ð¥° +.\"O .B ldd +.\"O does not work on a.out shared libraries. +.B ldd +¤Ï 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 Ãø¼Ô +.\" David Engel. +.\" Roland McGrath and Ulrich Drepper. +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR ld.so (8), +.BR ldconfig (8) diff --git a/draft/man1/time.1 b/draft/man1/time.1 new file mode 100644 index 00000000..cc6f9ac2 --- /dev/null +++ b/draft/man1/time.1 @@ -0,0 +1,489 @@ +.\" Copyright Andries Brouwer, 2000 +.\" +.\" This page is distributed under GPL. +.\" 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 +.SH ̾Á° +.\"O time \- time a simple command or give resource usage +time \- ¥³¥Þ¥ó¥É¤Î»þ´Ö·×¬¤ä¥ê¥½¡¼¥¹»ÈÍÑÎ̤òɽ¼¨¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.BI "time [" options "] " command " [" arguments... "] " +.\"O .SH DESCRIPTION +.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 +¤ÎÃͤιç·×)¡£ + +.\"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 +.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. +POSIX ¥í¥±¡¼¥ë¤Î¾ì¹ç¡¢ÅÁÅýŪ¤Ê¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤¢¤ë +.in +5 +"real %f\enuser %f\ensys %f\en" +.in -5 +¤¬»ÈÍѤµ¤ì¤ë (³Æ¿ô»ú¤ÏÉÃñ°Ì)¡£ +%f ¤Î½ÐÎϤǤξ®¿ôÅÀ°Ê²¼¤Î·å¿ô¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +¥¯¥í¥Ã¥¯¡¦¥Æ¥£¥Ã¥¯ (clock tick) ¤ÎÀºÅÙ¤òɽ¤¹¤Î¤Ë½½Ê¬¤Ê·å¿ô¤È¤Ê¤ê¡¢ +¾¯¤Ê¤¯¤È¤â°ì·å¤Ï¸ºß¤¹¤ë¡£ +.\"O .SH "EXIT STATUS" +.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 +.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 +¤òõ¤¹¤Î¤Ë»È¤ï¤ì¤ë¡£¤½¤ì°Ê³°¤Ï½ÐÎÏʸ»ú¤ä½ñ¼°¤Ë»ÈÍѤµ¤ì¤ë¡£ +.\"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 +¤Ç»ØÄê¤Ç¤­¤ë¡£ +.LP +.\"O The default format string is +¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Ï°Ê²¼¤ÎÄ̤ꡣ +.br +.in +3 +%Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k +.br +%Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps +.br +.in -3 +.LP +.\"O When the \-p option is given the (portable) output format +\-p ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢(¾¤È¸ß´¹À­¤Î¤¢¤ë) ½ÐÎÏ +¥Õ¥©¡¼¥Þ¥Ã¥È¤¬»ÈÍѤµ¤ì¤ë¡£ +.br +.in +3 +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) +¤Ç»ÈÍѤµ¤ì¤ëÊÑ´¹¤ÏÁ´¤Æ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +.B "Time" +.TP +.B %E +.\"O Elapsed real time (in [hours:]minutes:seconds). +·Ð²á¤·¤¿¼Â»þ´Ö ([hours:]minutes:seconds ¤Î·Á¼°)¡£ +.TP +.B %e +.\"O (Not in tcsh.) Elapsed real time (in seconds). +(tcsh ¤Ë¤Ï¤Ê¤¤) ·Ð²á¤·¤¿¼Â»þ´Ö (ÉÃñ°Ì)¡£ +.TP +.B %S +.\"O Total number of CPU-seconds that the process spent in kernel mode. +¤½¤Î¥×¥í¥»¥¹¤¬¥«¡¼¥Í¥ë¥â¡¼¥É¤Ç¾ÃÈñ¤·¤¿ CPU »þ´Ö¤Î¹ç·× (ÉÃñ°Ì)¡£ +.TP +.B %U +.\"O Total number of CPU-seconds that the process spent in user mode. +¤½¤Î¥×¥í¥»¥¹¤¬¥æ¡¼¥¶¥â¡¼¥É¤Ç¾ÃÈñ¤·¤¿ CPU »þ´Ö¤Î¹ç·× (ÉÃñ°Ì)¡£ +.TP +.B %P +.\"O Percentage of the CPU that this job got, computed as (%U + %S) / %E. +¤³¤Î¥¸¥ç¥Ö¤¬³ÍÆÀ¤·¤¿ 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. +¥Þ¥¤¥Ê¡¼¥Ú¡¼¥¸¥Õ¥©¡¼¥ë¥È¡¢¤Ä¤Þ¤ê²óÉü²Äǽ¤Ê¥Ú¡¼¥¸¥Õ¥©¥ë¥È¤Î²ó¿ô¡£ +¤³¤ì¤Ï¡¢¤½¤Î¥Ú¡¼¥¸¤ÏÍ­¸ú¤Ç¤Ê¤¤¤¬¡¢¤Þ¤À¾¤Î²¾ÁÛ¥Ú¡¼¥¸¤ËÃ¥¤ï¤ì¤Æ +¤¤¤Ê¤«¤Ã¤¿¥Ú¡¼¥¸¤ËÂФ¹¤ë¥Ú¡¼¥¸¥Õ¥©¥ë¥È¤Ë´Ø¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.B %W +.\"O Number of times the process was swapped out of main memory. +¤½¤Î¥×¥í¥»¥¹¤¬¼çµ­²±¤«¤é¥¹¥ï¥Ã¥×¥¢¥¦¥È¤µ¤ì¤¿²ó¿ô¡£ +.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 Áàºî¤Î´°Î»¤òÂԤäƤ¤¤ë´Ö¤Ê¤É¤¬³ºÅö¤¹¤ë¡£ +.LP +.B "I/O" +.TP +.B %I +.\"O Number of file system inputs by the process. +¤½¤Î¥×¥í¥»¥¹¤Ë¤è¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤é¤ÎÆþÎϤβó¿ô¡£ +.TP +.B %O +.\"O Number of file system outputs by the process. +¤½¤Î¥×¥í¥»¥¹¤Ë¤è¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î½ÐÎϤβó¿ô¡£ +.TP +.B %r +.\"O Number of socket messages received by the process. +¤½¤Î¥×¥í¥»¥¹¤¬¼õ¿®¤·¤¿¥½¥±¥Ã¥È¥á¥Ã¥»¡¼¥¸¿ô¡£ +.TP +.B %s +.\"O Number of socket messages sent by the process. +¤½¤Î¥×¥í¥»¥¹¤¬Á÷¿®¤·¤¿¥½¥±¥Ã¥È¥á¥Ã¥»¡¼¥¸¿ô¡£ +.TP +.B %k +.\"O Number of signals delivered to the process. +¤½¤Î¥×¥í¥»¥¹¤ËÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¿ô¡£ +.TP +.B %C +.\"O (Not in tcsh.) Name and command line arguments of the command being timed. +(tcsh ¤Ë¤Ï¤Ê¤¤) time ¤ÎÂоݤȤʤä¿¥³¥Þ¥ó¥É̾¤È¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¡£ +.TP +.B %x +.\"O (Not in tcsh.) Exit status of the command. +(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. +¾¤Î 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. +Èó¾ï¤Ë¾Ü¤·¤¤½ÐÎϤǡ¢Æþ¼ê¤Ç¤­¤ëÁ´¤Æ¤Î¾ðÊó¤ò½ÐÎϤ¹¤ë¡£ +.\"O .SS "GNU Standard Options" +.SS "GNU ɸ½à¥ª¥×¥·¥ç¥ó" +.TP +.B "\-\-help" +.\"O Print a usage message on standard output and exit successfully. +»ÈÍÑÊýË¡¤Ë´Ø¤¹¤ë¥á¥Ã¥»¡¼¥¸¤òɸ½à½ÐÎϤËɽ¼¨¤·¡¢Àµ¾ï½ªÎ»¤¹¤ë¡£ +.TP +.B "\-V, \-\-version" +.\"O Print version information on standard output, then exit successfully. +¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɸ½à½ÐÎϤËɽ¼¨¤·¡¢Àµ¾ï½ªÎ»¤¹¤ë¡£ +.TP +.B "\-\-" +.\"O Terminate option list. +¥ª¥×¥·¥ç¥ó¥ê¥¹¥È¤ÎËöÈø¤ò¼¨¤¹¡£ +.\"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 ¤Ç¼èÆÀ²Äǽ¤Ê¥Ç¡¼¥¿¤Ë +´ð¤Å¤¤¤ÆÁªÂò¤µ¤ì¤Æ¤¤¤ë¡£ +.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 ¤ÎÍ×·ï¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£ +.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 ¤Î¤è¤¦¤Ê̾Á°¤ò (¥×¥í¥°¥é¥à¤Î¥Ñ¥¹Ì¾¤Î»ØÄê¤Ç¤Ï¤Ê¤¯) +¥×¥í¥°¥é¥à¤Ø¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤Î¤Ë»È¤¦¤È¡¢ +ÌÌÅݤʤ³¤È¤ò°ú¤­µ¯¤³¤¹²ÄǽÀ­¤¬¹â¤¤¡£ +.LP +.\"O It seems unfortunate that \-o overwrites instead of appends. +.\"O (That is, the \-a option should be the default.) +\-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 +¤ËÂФ¹¤ëÄó°Æ¤ä¥Ð¥°¥ì¥Ý¡¼¥È¤Ï +.br +.I bug\-utils@prep.ai.mit.edu +.br +¤Þ¤Ç¥á¡¼¥ë¤òÁ÷¤Ã¤Æ¤Û¤·¤¤¡£ +¤½¤Î¾ì¹ç¤Ë¤Ï +.B time +¤ä OS¡¢»ÈÍѤ·¤Æ¤¤¤ë C ¥³¥ó¥Ñ¥¤¥é¤Î +¥Ð¡¼¥¸¥ç¥ó¤òµ­ºÜ¤·¤Æ¤Û¤·¤¤¡£ +.B time +¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï°Ê²¼¤Î¥³¥Þ¥ó¥É¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +.br +.I time \-\-version +.br +.\" .SH AUTHORS +.\" .TP +.\" .IP "David Keppel" +.\" Original version +.\" .IP "David MacKenzie" +.\" POSIXization, autoconfiscation, GNU getoptization, +.\" documentation, other bug fixes and improvements. +.\" .IP "Arne Henrik Juul" +.\" Helped with portability +.\" .IP "Francois Pinard" +.\" Helped with portability +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR tcsh (1), +.BR times (2), +.BR wait3 (2) diff --git a/draft/man2/_exit.2 b/draft/man2/_exit.2 new file mode 100644 index 00000000..9ccdddbc --- /dev/null +++ b/draft/man2/_exit.2 @@ -0,0 +1,211 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 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 ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\" +.TH _EXIT 2 2008-11-27 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O _exit, _Exit \- terminate the calling process +_exit, _Exit \- ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "void _exit(int " status ); +.sp +.B #include +.sp +.BI "void _Exit(int " status ); +.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 _Exit (): +.\"O _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; ¤Þ¤¿¤Ï +.I cc\ -std=c99 +.\"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 +¥·¥°¥Ê¥ë¤¬Á÷½Ð¤µ¤ì¤ë¡£ +.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) +·Ï´Ø¿ô¤òÍøÍѤ¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +.\"O The function +.\"O .BR _Exit () +.\"O is equivalent to +.\"O .BR _exit (). +´Ø¿ô +.BR _Exit () +¤Ï +.BR _exit () +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.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 +.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) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.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 ¤¬¥­¥ã¥ó¥»¥ë¤µ¤ì¤ë¤Î¤«¤Ï¼ÂÁõ¤Ë°Í¸¤¹¤ë¡£ + +.\"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" +.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) diff --git a/draft/man2/_syscall.2 b/draft/man2/_syscall.2 new file mode 100644 index 00000000..ec15eac8 --- /dev/null +++ b/draft/man2/_syscall.2 @@ -0,0 +1,220 @@ +.\" +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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. +.\" +.\" Tue Jul 6 12:42:46 MDT 1993 +.\" Added "Calling Directly" and supporting paragraphs +.\" +.\" Modified Sat Jul 24 15:19:12 1993 by Rik Faith +.\" +.\" Modified 21 Aug 1994 by Michael Chastain : +.\" Added explanation of arg stacking when 6 or more args. +.\" +.\" Modified 10 June 1995 by Andries Brouwer +.\" +.\" 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 +.SH ̾Á° +.\"O _syscall \- invoking a system call without library support (OBSOLETE) +_syscall \- ¥é¥¤¥Ö¥é¥ê¤Î¥µ¥Ý¡¼¥È¤Ê¤·¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤¹¤ë (ÀΤÎÊýË¡) +.\"O .SH "SYNOPSIS" +.SH ½ñ¼° +.B #include + +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 ¸Ä¤Î¥Þ¥¯¥í¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï°Ê²¼¤Î·Á¤Ç¤¢¤ë¡£ +.sp +.RS +.RI _syscall X ( type , name , type1 , arg1 , type2 , arg2 ,...) +.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 +.SH ¥Õ¥¡¥¤¥ë +.I /usr/include/linux/unistd.h +.\"O .SH "CONFORMING TO" +.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) +¤¬É¬ÍפǤ¢¤Ã¤¿¡£) + +.\"O The _syscall() macros \fIdo not\fP produce a prototype. +.\"O You may have to +.\"O create one, especially for C++ users. +_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) +¤ò»²¾È¡£ + +.\"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). +.\" However, this mechanism can only be used if using a libc +.\" (such as glibc) that supports +.\" .BR syscall (2), +.\" and if the +.\" .I +.\" header file contains the required SYS_foo definition. +.\" Otherwise, the use of a _syscall macro is required. +.\" +.\"O .SH EXAMPLE +.SH Îã +.nf +#include +#include +#include +#include /* for _syscallX macros/related stuff */ +#include /* for struct sysinfo */ + +_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 ʸÆâ¤Î;ʬ¤Ê¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤ò˺¤ì¤º¤Ëºï½ü¤¹¤ë¤è¤¦¤Ë¡£ */ + +int +main(void) +{ + struct sysinfo s_info; + 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", + s_info.uptime, s_info.loads[0], + s_info.loads[1], s_info.loads[2], + s_info.totalram, s_info.freeram, + s_info.sharedram, s_info.bufferram, + s_info.totalswap, s_info.freeswap, + s_info.procs); + exit(EXIT_SUCCESS); +} +.fi +.SS "Sample Output" +.nf +code error = 0 +uptime = 502034s +Load: 1 min 13376 / 5 min 5504 / 15 min 1152 +RAM: total 15343616 / free 827392 / shared 8237056 +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) diff --git a/draft/man2/accept.2 b/draft/man2/accept.2 new file mode 100644 index 00000000..de088250 --- /dev/null +++ b/draft/man2/accept.2 @@ -0,0 +1,693 @@ +.\" Copyright (c) 1983, 1990, 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. +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-10-21 by Eric S. Raymond +.\" Modified 1998-2000 by Andi Kleen to match Linux 2.2 reality +.\" Modified 2002-04-23 by Roger Luethi +.\" 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 ÀܳµñÈÝ +.\" +.TH ACCEPT 2 2009-02-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O accept \- accept a connection on a socket +.SH ̾Á° +accept \- ¥½¥±¥Ã¥È¤Ø¤ÎÀܳ¤ò¼õ¤±¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.\"O .BR "#include " " /* See NOTES */" +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.B #include + +.BI "int accept(int " sockfd ", struct sockaddr *" addr ", socklen_t *" addrlen ); + +.B #define _GNU_SOURCE +.B #include + +.BI "int accept4(int " sockfd ", struct sockaddr *" addr , +.BI " socklen_t *" addrlen ", int " flags ); +.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 +¤Ï¤³¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡£ +.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) +¤ò·Ð¤ÆÀܳ¤òÂԤäƤ¤¤ë¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£ + +.\"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 +¤Ï»ÈÍѤµ¤ì¤º¡¢¤³¤Î°ú¤­¿ô¤Ï 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 +¤¬»Ø¤¹¹½Â¤ÂΤΥµ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤Ç½é´ü²½¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Ê֤äƤ¯¤ë»þ¤Ë¤Ï¡¢ÀܳÁê¼ê¤Î¥¢¥É¥ì¥¹¤Î¼ÂºÝ¤ÎÂ礭¤µ¤¬³ÊǼ¤µ¤ì¤ë¡£ + +.\"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 +¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·»þ¤ËÅϤµ¤ì¤¿Ãͤè¤ê¤âÂ礭¤ÊÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +.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 +¤Ç¼ºÇÔ¤¹¤ë¡£ +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.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) +¤Ï¿·¤·¤¤¥½¥±¥Ã¥È¤ò¥¯¥í¡¼¥º¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤Ê¤µ¤ì¤ë¡£ +¸½ºß¤Î¤È¤³¤í¡¢ +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) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.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" +.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" +.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 +.SH ¥¨¥é¡¼ +.TP +.\"O .BR EAGAIN " or " EWOULDBLOCK +.BR EAGAIN " ¤Þ¤¿¤Ï " EWOULDBLOCK +.\" 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. +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¡£ +.TP +.B ECONNABORTED +.\"O A connection has been aborted. +Àܳ¤¬Ãæ»ß¤µ¤ì¤¿¡£ +.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. +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 +.B EOPNOTSUPP +.\"O The referenced socket is not of type +.\"O .BR SOCK_STREAM . +»²¾È¤·¤Æ¤¤¤ë¥½¥±¥Ã¥È¤Î·¿¤¬ +.B SOCK_STREAM +¤Ç¤Ê¤¤¡£ +.TP +.B EPROTO +.\"O Protocol error. +¥×¥í¥È¥³¥ë¡¦¥¨¥é¡¼¡£ +.PP +.\"O In addition, Linux +.\"O .BR accept () +.\"O may fail if: +¾åµ­¤Ë²Ã¤¨¤Æ¡¢Linux ¤Î +.BR accept () +¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë: +.TP +.B EPERM +.\"O Firewall rules forbid connection. +¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Î¥ë¡¼¥ë¤Ë¤è¤êÀܳ¤¬¶Ø»ß¤µ¤ì¤¿¡£ +.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 +.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 +.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 ¤Ç¤Ï¡¢ +.\" EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE, +.\" ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK +.\" ¤¬¥¨¥é¡¼¤È¤·¤Æµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.\" ¤µ¤é¤Ë¡¢SUSv2 ¤Ë¤Ï EFAULT, ENOSR ¤âµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"O .BR accept4 () +.\"O is a nonstandard Linux extension. +.BR accept4 () +¤ÏÈóɸ½à¤Î 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 +.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 ·Ï) ¤Ç¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬ +ɬÍפǤ¢¤ê¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò +¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬¸­ÌÀ¤Ç¤¢¤í¤¦¡£ + +.\"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 ¤Îȯ¸À¤ò°úÍѤ¹¤ë: + +.\" .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" ¤òºî¤ë¤È¤¤¤¦²ò·èºö¤ò¤Ê¤ó¤È¤«¤Ò¤Í¤ê½Ð¤·¤¿¡£ +¤½¤â¤½¤âºÇ½é¤«¤éÊü¤Ã¤Æ¤ª¤±¤ÐÎɤ«¤Ã¤¿¤ó¤À¤¬¡¢ +¤¤¤¸¤Ã¤Á¤ã¤Ã¤¿°Ê¾å¡¢ +̾Á°ÉÕ¤­¤Î·¿¤ò»ý¤¿¤»¤Ê¤­¤ã¤Ê¤é¤Ê¤¤¡¢¤È»×¤Ã¤¿¤ß¤¿¤¤¤À¤Í¡£ +¤Ê¤ó¤Ç¤«¤Ï¤ï¤«¤ó¤Ê¤¤¤±¤É +(¤­¤Ã¤ÈºÇ½é¤Ë¤ä¤Ã¤Á¤Þ¤Ã¤¿Çϼ¯¤Ê´Ö°ã¤¤¤Ç´é¤ò¤Ä¤Ö¤·¤¿¤¯¤Ê¤«¤Ã¤¿¤«¤é¡¢ +¤³¤Ã¤½¤ê̾Á°¤òÉÕ¤±Âؤ¨¤Æ¼«Ê¬¤¿¤Á¤ÎÂ缺ÇÔ¤ò¤´¤Þ¤«¤½¤¦¤È¤·¤¿¤ó¤À¤í¤¦)¡£¡× +.\"O .SH EXAMPLE +.SH Îã +.\"O See +.\"O .BR bind (2). +.BR bind (2) +»²¾È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bind (2), +.BR connect (2), +.BR listen (2), +.BR select (2), +.BR socket (2), +.BR socket (7) diff --git a/draft/man2/access.2 b/draft/man2/access.2 new file mode 100644 index 00000000..a48c0d9f --- /dev/null +++ b/draft/man2/access.2 @@ -0,0 +1,423 @@ +.\" 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/acct.2 b/draft/man2/acct.2 new file mode 100644 index 00000000..cc3409db --- /dev/null +++ b/draft/man2/acct.2 @@ -0,0 +1,231 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 1993-07-22 by Rik Faith +.\" Modified 1993-08-10 by Alan Cox +.\" Modified 1998-11-04 by Tigran Aivazian +.\" Modified 2004-05-27, 2004-06-17, 2004-06-23 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-22, HANATAKA Shinya +.\" Modified 1998-11-30, HANATAKA Shinya +.\" Updated and Modified 2001-06-02, Yuichi SATO +.\" Updated and Modified 2001-10-15, Yuichi SATO +.\" Updated and Modified 2004-12-28, Yuichi SATO +.\" Updated 2008-08-04, Akihiro MOTOKI +.\" +.\"WORD: account ¥¢¥«¥¦¥ó¥È +.\"WORD: process ¥×¥í¥»¥¹ +.\" +.TH ACCT 2 2008-06-16 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O acct \- switch process accounting on or off +acct \- ¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥È¤Î¥ª¥ó¤È¥ª¥Õ¤òÀڤ괹¤¨¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.ad l +.nf +.B #include +.sp +.BI "int acct(const char *" filename ); +.fi +.ad b +.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 acct (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR acct () +.\"O system call enables or disables process accounting. +.\"O If called with the name of an existing file as its argument, +.\"O accounting is turned on, +.\"O and records for each terminating process are appended to +.\"O \fIfilename\fP as it terminates. +.\"O An argument of NULL causes accounting to be turned off. +.BR acct () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥È¤ÎÍ­¸ú¡¦Ìµ¸ú¤òÀÚ¤êÂؤ¨¤ë¡£ +´û¸¤Î¥Õ¥¡¥¤¥ë¤Î̾Á°¤ò°ú¤­¿ô¤Ë»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¤é¡¢ +¥¢¥«¥¦¥ó¥È (account) ¤¬Í­¸ú¤Ë¤Ê¤ê¡¢ +½ªÎ»¤·¤¿¥×¥í¥»¥¹¤Îµ­Ï¿¤¬ \fIfilename\fP ¤ËÄɵ­¤µ¤ì¤ë¡£ +NULL ¤ò°ú¤­¿ô¤È¤·¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¤é¥¢¥«¥¦¥ó¥È¤ò¥ª¥Õ¤Ë¤¹¤ë¡£ +.\"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 EACCES +.\"O Write permission is denied for the specified file. +»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤¯¡¢½ñ¤­¹þ¤ß¤¬µñÈݤµ¤ì¤¿¡£ +.TP +.B EACCES +.\"O Write permission is denied for the specified file, +»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤¯¡¢½ñ¤­¹þ¤ß¤¬µñÈݤµ¤ì¤¿¡£ +.\"O or search permission is denied for one of the directories +.\"O in the path prefix of +.\"O .I filename +.\"O (see also +.\"O .BR path_resolution (7)), +¤Þ¤¿¤Ï +.I filename +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Î²¿¤ì¤«¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸¡º÷µö²Ä¤¬¤Ê¤¯µñÈݤµ¤ì¤¿ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.\"O or +.\"O .I filename +.\"O is not a regular file. +¤Þ¤¿¤Ï +.I filename +¤¬Ä̾ï (regular) ¤Î¥Õ¥¡¥¤¥ë¤Ç¤Ê¤¤¡£ +.TP +.B EFAULT +.\"O .I filename +.\"O points outside your accessible address space. +¥¢¥¯¥»¥¹¤Ç¤­¤ë¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò +.I filename +¤¬»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EIO +.\"O Error writing to the file +.\"O .IR filename . +.I filename +¤Ø¤Î½ñ¤­¹þ¤ß¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EISDIR +.\"O .I filename +.\"O is a directory. +.I filename +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¡£ +.TP +.B ELOOP +.\"O Too many symbolic links were encountered in resolving +.\"O .IR filename . +.I filename +¤Î¼ÂÂΤˤ¿¤É¤êÃ夯¤Þ¤Ç¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¿ô¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.\"O .I filename +.\"O was 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 specified filename does not exist. +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +.\"O Out of memory. +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B ENOSYS +.\"O BSD process accounting has not been enabled when the operating system +.\"O kernel was compiled. +.\"O The kernel configuration parameter controlling this feature is +.\"O .BR CONFIG_BSD_PROCESS_ACCT . +¥«¡¼¥Í¥ë¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤¿»þ¤Ë BSD ¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥È¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¡£ +¤³¤Îµ¡Ç½¤Ï¥«¡¼¥Í¥ë¤Î¥³¥ó¥Õ¥£¥°¤Î +.B CONFIG_BSD_PROCESS_ACCT +¥Ñ¥é¥á¡¼¥¿¤Ë¤è¤Ã¤ÆÀ©¸æ¤µ¤ì¤ë¡£ +.TP +.B ENOTDIR +.\"O A component used as a directory in +.\"O .I filename +.\"O is not in fact a directory. +.I filename +¤ÎÃæ¤Ç¥Ç¥£¥ì¥¯¥È¥ê¤·¤Æ°·¤ï¤ì¤Æ¤¤¤ëÍ×ÁǤ¬¡¢ +¼ÂºÝ¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EPERM +.\"O The calling process has insufficient privilege to enable process accounting. +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ë¤Ï¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥È¤òÍ­¸ú¤Ë¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÆø¢¤¬¤Ê¤¤¡£ +.\"O On Linux the +.\"O .B CAP_SYS_PACCT +.\"O capability is required. +Linux ¤Ç¤Ï +.B CAP_SYS_PACCT +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬É¬ÍפǤ¢¤ë¡£ +.TP +.B EROFS +.\"O .I filename +.\"O refers to a file on a read-only file system. +Æɤ߹þ¤ß¤À¤±¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤ò +.I filename +¤¬»²¾È¤·¤Æ¤¤¤ë¡£ +.TP +.B EUSERS +.\"O There are no more free file structures or we ran out of memory. +»ÈÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¹½Â¤ÂΤ¬¤Ê¤¤¤«¡¢¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O SVr4, 4.3BSD (but not POSIX). +.\"O .\" SVr4 documents an EBUSY error condition, +.\"O .\" but no EISDIR or ENOSYS. Also AIX and HPUX document EBUSY (attempt is made +.\"O .\" to enable accounting when it is already enabled), as does Solaris +.\"O .\" (attempt is made to enable accounting using the same file that is +.\"O .\" currently being used). +SVr4, 4.3BSD (POSIX ¤Ç¤Ï¤Ê¤¤)¡£ +.\" SVr4 ¤Ë¤Ï EBUSY ¥¨¥é¡¼¤¬µ­½Ò¤µ¤ì¤Æ¤¤¤ë¤¬¡¢EISDIR, ENOSYS ¤Ï¤Ê¤¤¡£ +.\" AIX ¤È HPUX ¤Ë¤Ï¡¢EBUSY ¤Ë¤Ä¤¤¤Æ¡Ö¤¹¤Ç¤Ë¥¢¥«¥¦¥ó¥È¤¬Í­¸ú¤Ë¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +.\" ¤µ¤é¤ËÍ­¸ú¤Ë¤·¤è¤¦¤È¤·¤¿¡×¤È¤¤¤¦µ­½Ò¤¬¤¢¤ë¡£ +.\" ¤³¤ì¤Ï Solaris ¤Ë¤ª¤±¤ë¡Ö¸½ºß¡¢¥¢¥«¥¦¥ó¥È¤Ë»È¤ï¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤È +.\" Ʊ¤¸¥Õ¥¡¥¤¥ë¤Ç¥¢¥«¥¦¥ó¥È¤òÍ­¸ú¤Ë¤·¤è¤¦¤È¤·¤¿¡×¤È¤¤¤¦µ­½Ò¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O No accounting is produced for programs running when a system crash occurs. +.\"O In particular, nonterminating processes are never accounted for. +¥·¥¹¥Æ¥à¤¬¥¯¥é¥Ã¥·¥å¤·¤¿»þ¤Ë¼Â¹ÔÃæ¤À¤Ã¤¿¥×¥í¥°¥é¥à¤Î¥¢¥«¥¦¥ó¥È¤ÏÀ¸À®¤µ¤ì¤Ê¤¤¡£ +Æäˡ¢½ªÎ»¤·¤Ê¤¤¥×¥í¥°¥é¥à¤¬¥¢¥«¥¦¥ó¥È¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ + +.\"O The structure of the records written to the accounting file is described in +.\"O .BR acct (5). +¥¢¥«¥¦¥ó¥ÈÍÑ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¥ì¥³¡¼¥É¤Î¹½Â¤ÂΤˤĤ¤¤Æ¤Ï +.BR acct (5) +¤ËÀâÌÀ¤¬¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.\"O .BR acct (5) +.BR acct (5) diff --git a/draft/man2/adjtimex.2 b/draft/man2/adjtimex.2 new file mode 100644 index 00000000..9b37a368 --- /dev/null +++ b/draft/man2/adjtimex.2 @@ -0,0 +1,232 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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 1997-01-31 by Eric S. Raymond +.\" 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 ¥á¥â¥ê +.\" +.TH ADJTIMEX 2 2004-05-27 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O adjtimex \- tune kernel clock +adjtimex \- ¥«¡¼¥Í¥ë¤Î»þ·×¤òÄ´À°¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int adjtimex(struct timex *" "buf" ); +.\"O .SH DESCRIPTION +.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 +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡¼¤ò¼õ¤±¼è¤ê¡¢¤½¤ÎÃͤǥ«¡¼¥Í¥ë¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ò¹¹¿·¤·¤Æ¡¢ +Ʊ¤¸¹½Â¤ÂΤ˸½ºß¤Î¥«¡¼¥Í¥ë¤ÎÃͤòÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤ë: +.PP +.in +4n +.nf +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 tolerance; /* clock frequency tolerance (ppm) + (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 +¤«¤é¤Ê¤ë: +.PP +.in +4n +.nf +#define ADJ_OFFSET 0x0001 /* time offset */ +#define ADJ_FREQUENCY 0x0002 /* frequency offset */ +#define ADJ_MAXERROR 0x0004 /* maximum time error */ +#define ADJ_ESTERROR 0x0008 /* estimated time error */ +#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() */ +.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 ¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Î¤ß¤¬Á´¤Æ¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤òÀßÄê¤Ç¤­¤ë¡£ +.br +.ne 12v +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR adjtimex () +.\"O returns the clock state: +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR adjtimex () +¤Ï +¥¯¥í¥Ã¥¯¤Î¾õÂÖ¤òÊÖ¤¹: +.PP +.in +4n +.nf +#define TIME_OK 0 /* clock synchronized */ +#define TIME_INS 1 /* insert leap second */ +#define TIME_DEL 2 /* delete leap second */ +#define TIME_OOP 3 /* leap second in progress */ +#define TIME_BAD 4 /* clock not synchronized */ +.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 +.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 +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR settimeofday (2), +.BR adjtime (3), +.BR capabilities (7), +.BR time (7) diff --git a/draft/man2/alarm.2 b/draft/man2/alarm.2 new file mode 100644 index 00000000..324ca6cc --- /dev/null +++ b/draft/man2/alarm.2 @@ -0,0 +1,140 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 Wed Jul 21 19:42:57 1993, Rik Faith +.\" Modified Sun Jul 21 21:25:26 1996, 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 ¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +.\" +.TH ALARM 2 2008-06-12 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O alarm \- set an alarm clock for delivery of a signal +alarm \- ¥·¥°¥Ê¥ëÇÛÁ÷¤Î¤¿¤á¤Î¥¢¥é¡¼¥à¡¦¥¯¥í¥Ã¥¯¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "unsigned int alarm(unsigned int " seconds ); +.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 +Éøå¤Ë¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ËÇÛÁ÷¤¹¤ë¤è¤¦¤Ë¼êÇÛ¤¹¤ë¡£ + +.\"O If +.\"O .I seconds +.\"O is zero, no new +.\"O .BR alarm () +.\"O is scheduled. +.I seconds +¤¬¥¼¥í¤Ê¤é¤Ð¡¢¿·¤¿¤Ê +.BR alarm () +¤Ï¼êÇÛ¤µ¤ì¤Ê¤¤¡£ + +.\"O In any event any previously set +.\"O .BR alarm () +.\"O is canceled. +º£¤Þ¤Ç¤ËÀßÄꤵ¤ì¤Æ¤¤¤¿ +.BR alarm () +¤ÏÃæÃǤµ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.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" +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD. +.\"O .SH NOTES +.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) +¤ÏƱ¤¸¥¿¥¤¥Þ¡¼¤ò¶¦Í­¤·¤Æ¤¤¤ë; ÊÒÊý¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ï¤â¤¦°ìÊý¤Î +»ÈÍѤ˱ƶÁ¤òÍ¿¤¨¤ë¡£ +.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) +¤òº®¤¼¤Æ»ÈÍѤ·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +.\"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" +.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) diff --git a/draft/man2/alloc_hugepages.2 b/draft/man2/alloc_hugepages.2 new file mode 100644 index 00000000..38f34045 --- /dev/null +++ b/draft/man2/alloc_hugepages.2 @@ -0,0 +1,265 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 2003 Andries E. 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. +.\" +.\" +.\" 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 +.\" +.\"WORD: huge page ¥Ò¥å¡¼¥¸¥Ú¡¼¥¸ +.\" +.TH ALLOC_HUGEPAGES 2 2007-05-31 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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); +.sp +.BI "int free_hugepages(void *" addr ); +.\" asmlinkage int sys_free_hugepages(unsigned long addr); +.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 +¤Ç¼ºÇÔ¤¹¤ë¡£ +.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. +¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¤Ï¥á¥â¥êÆâ¤Ë¥í¥Ã¥¯¤µ¤ì¡¢¥¹¥ï¥Ã¥×¤µ¤ì¤Ê¤¤¡£ +.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 +¤ò»È¤¦Â¾¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È¶¦Í­¤µ¤ì¡¢»Ò¥×¥í¥»¥¹¤Ë·Ñ¾µ¤µ¤ì¤ë¡£ +.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. +¥¢¥É¥ì¥¹¤ÏÀµ¤·¤¯ÇÛÃÖ¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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 +°ú¤­¿ô¤ÏÍ׵ᤵ¤ì¤¿¥»¥°¥á¥ó¥È¤ÎŤµ¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¤Î¥µ¥¤¥º¤ÎÇÜ¿ô¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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 +¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ +.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" +.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 +.SH ¥¨¥é¡¼ +.TP +.B ENOSYS +.\"O The system call is not supported on this kernel. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"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" +.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 +.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) +¤ò»È¤Ã¤Æ¤³¤Î²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥Õ¥¡¥¤¥ë¤ò¥Þ¥Ã¥×¤¹¤ë¤³¤È¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +.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 ¤¬É¬ÍפǤ¢¤ë¡£ +.\" mount -t hugetlbfs hugetlbfs /huge +.\" SHM_HUGETLB diff --git a/draft/man2/arch_prctl.2 b/draft/man2/arch_prctl.2 new file mode 100644 index 00000000..b2bc1a79 --- /dev/null +++ b/draft/man2/arch_prctl.2 @@ -0,0 +1,237 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2003 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. +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated 2004-06-08, Yuichi SATO +.\" Updated 2005-11-19, Akihiro MOTOKI +.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 +.\" +.TH ARCH_PRCTL 2 2007-12-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O arch_prctl \- set architecture-specific thread state +arch_prctl \- ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¸ÇÍ­¤Î¥¹¥ì¥Ã¥É¾õÂÖ¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "int arch_prctl(int " code ", unsigned long *" addr ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR arch_prctl () +.\"O function sets architecture-specific process or thread state. +.BR arch_prctl () +´Ø¿ô¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã¸ÇÍ­¤Î¥×¥í¥»¥¹¾õÂÖ¤Þ¤¿¤Ï¥¹¥ì¥Ã¥É¾õÂÖ¤òÀßÄꤹ¤ë¡£ +.\"O .I code +.\"O selects a subfunction +.\"O and passes argument +.\"O .I addr +.\"O to it; +.\"O .I addr +.\"O is interpreted as either an +.\"O .I "unsigned long" +.\"O for the "set" operations, or as an +.\"O .IR "unsigned long *" , +.\"O for the "get" operations. +.I code +¤ÏÉûµ¡Ç½¤òÁªÂò¤·¡¢°ú¤­¿ô +.I addr +¤òÉûµ¡Ç½¤ËÅϤ¹¡£ +.I addr +¤Ï¡¢"set" Áàºî¤Ç¤Ï +.I "unsigned long" +¤È¤·¤Æ¡¢"get" Áàºî¤Ç¤Ï +.I "unsigned long *" +¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +.LP +.\"O Sub functions for x86-64 are: +x86-64 ¤ÎÉûµ¡Ç½¤Ï°Ê²¼¤ÎÄ̤ê: +.TP +.B ARCH_SET_FS +.\"O Set the 64-bit base for the +.\"O .I FS +.\"O register to +.\"O .IR addr . +.I FS +¥ì¥¸¥¹¥¿¤Î 64 ¥Ó¥Ã¥È¥Ù¡¼¥¹¤ò +.I addr +¤ËÀßÄꤹ¤ë¡£ +.TP +.B ARCH_GET_FS +.\"O Return the 64-bit base value for the +.\"O .I FS +.\"O register of the current thread in the +.\"O .I unsigned long +.\"O pointed to by +.\"O .IR addr . +¸½ºß¤Î¥¹¥ì¥Ã¥É¤Î +.I FS +¥ì¥¸¥¹¥¿¤Î 64 ¥Ó¥Ã¥È¥Ù¡¼¥¹Ãͤò¡¢ +.I addr +¤¬»Ø¤¹ +.I unsigned long +¤ÎÎΰè¤Ë³ÊǼ¤¹¤ë¡£ +.TP +.B ARCH_SET_GS +.\"O Set the 64-bit base for the +.\"O .I GS +.\"O register to +.\"O .IR addr . +.I GS +¥ì¥¸¥¹¥¿¤Î 64 ¥Ó¥Ã¥È¥Ù¡¼¥¹¤ò +.I addr +¤ËÀßÄꤹ¤ë¡£ +.TP +.B ARCH_GET_GS +.\"O Return the 64-bit base value for the +.\"O .I GS +.\"O register of the current thread in the +.\"O .I unsigned long +.\"O pointed to by +.\"O .IR addr . +¸½ºß¤Î¥¹¥ì¥Ã¥É¤Î +.I GS +¥ì¥¸¥¹¥¿¤Î 64 ¥Ó¥Ã¥È¥Ù¡¼¥¹Ãͤò¡¢ +.I addr +¤¬»Ø¤¹ +.I unsigned long +¤ÎÎΰè¤Ë³ÊǼ¤¹¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR arch_prctl () +.\"O returns 0; on error, \-1 is returned, and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR arch_prctl () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O .I addr +.\"O points to an unmapped address or is outside the process address space. +.I addr +¤¬¥¢¥ó¥Þ¥Ã¥×¤µ¤ì¤¿¥¢¥É¥ì¥¹¤ò»Ø¤·¤Æ¤¤¤ë¤«¡¢¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Ë¤¢¤ë¡£ +.TP +.B EINVAL +.\"O .I code +.\"O is not a valid subcommand. +.I code +¤¬Í­¸ú¤Ê¥µ¥Ö¥³¥Þ¥ó¥É¤Ç¤Ê¤¤¡£ +.TP +.B EPERM +.\"O .I addr +.\"O is outside the process address space. +.I addr +¤¬¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Ë¤¢¤ë¡£ +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\"O .\" Man page written by Andi Kleen. +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï Andi Kleen ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR arch_prctl () +.\"O is a Linux/x86-64 extension and should not be used in programs intended +.\"O to be portable. +.BR arch_prctl () +¤Ï Linux/x86-64 ³ÈÄ¥¤Ç¤¢¤ê¡¢°Ü¿¢À­¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»È¤¦¤Ù¤­¤Ç¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O .BR arch_prctl () +.\"O is only supported on Linux/x86-64 for 64-bit programs currently. +.BR arch_prctl () +¤Ï¸½ºß¤Î¤È¤³¤í Linux/x86-64 ¾å¤Î 64 ¥Ó¥Ã¥È¥×¥í¥°¥é¥à¤Ç¤Î¤ß¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"O The 64-bit base changes when a new 32-bit segment selector is loaded. +¿·¤·¤¤ 32 ¥Ó¥Ã¥È¥»¥°¥á¥ó¥È¥»¥ì¥¯¥¿¤¬¥í¡¼¥É¤µ¤ì¤¿¾ì¹ç¡¢ +64 ¥Ó¥Ã¥È¥Ù¡¼¥¹¤ÏÊѹ¹¤µ¤ì¤ë¡£ + +.\"O .B ARCH_SET_GS +.\"O is disabled in some kernels. +.B ARCH_SET_GS +¤¬Ìµ¸ú¤Ë¤µ¤ì¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤â¤¢¤ë¡£ + +.\"O Context switches for 64-bit segment bases are rather expensive. +.\"O It may be a faster alternative to set a 32-bit base using a +.\"O segment selector by setting up an LDT with +.\"O .BR modify_ldt (2) +.\"O or using the +.\"O .BR set_thread_area (2) +.\"O system call in kernel 2.5 or later. +64 ¥Ó¥Ã¥È¥»¥°¥á¥ó¥È¥Ù¡¼¥¹¤Î¥³¥ó¥Æ¥­¥¹¥È¥¹¥¤¥Ã¥Á¤Ï¡¢¤ä¤ä¹â²Á¤Ç¤¢¤ë¡£ +LDT ¤ò +.BR modify_ldt (2) +¤ÇÀßÄꤷ¤Æ¥»¥°¥á¥ó¥È¥»¥ì¥¯¥¿¤ò»È¤¦¤«¡¢ +(¥«¡¼¥Í¥ë 2.5 °Ê¹ß¤Î) +.BR set_thread_area (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤³¤È¤Ë¤è¤ê¡¢ +32 ¥Ó¥Ã¥È¥Ù¡¼¥¹¤òÀßÄꤹ¤ë¤È¤¤¤¦¹â®¤ÊÂåÂؼêÃʤ⤢¤ë¡£ +.\"O .BR arch_prctl () +.\"O is only needed when you want to set bases that are larger than 4GB. +4GB ¤è¤êÂ礭¤Ê¥Ù¡¼¥¹¤òÀßÄꤷ¤¿¤¤¾ì¹ç¤Ë¤Î¤ß¡¢ +.BR arch_prctl () +¤¬É¬ÍפǤ¢¤ë¡£ +.\"O Memory in the first 2GB of address space can be allocated by using +.\"O .BR mmap (2) +.\"O with the +.\"O .B MAP_32BIT +.\"O flag. +¥¢¥É¥ì¥¹¶õ´Ö¤ÎºÇ½é¤Î 2GB ¤Ë¤¢¤ë¥á¥â¥ê¤Ï¡¢ +.BR mmap (2) +¤Ë +.B MAP_32BIT +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O As of version 2.7, glibc provides no prototype for +.\"O .BR arch_prctl (). +.\"O You have to declare it yourself for now. +.\"O This may be fixed in future glibc versions. +¥Ð¡¼¥¸¥ç¥ó 2.7 »þÅÀ¤Ç¤Ï¡¢glibc ¤Ë¤Ï +.BR arch_prctl () +¤Î¥×¥í¥È¥¿¥¤¥×¤¬¤Ê¤¤¡£ +º£¤Î¤È¤³¤í¥æ¡¼¥¶¤Ï¼«Ê¬¼«¿È¤ÇÀë¸À¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤ì¤Ï¾­Íè¤Î glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç½¤Àµ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + +.\"O .I FS +.\"O may be already used by the threading library. +.I FS +¤Ï¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤Ç´û¤Ë»È¤ï¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mmap (2), +.BR modify_ldt (2), +.BR prctl (2), +.BR set_thread_area (2) +.sp +AMD X86-64 Programmer's manual diff --git a/draft/man2/bdflush.2 b/draft/man2/bdflush.2 new file mode 100644 index 00000000..1ac840fa --- /dev/null +++ b/draft/man2/bdflush.2 @@ -0,0 +1,183 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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 1997-01-31 by Eric S. Raymond +.\" Modified 2004-06-17 by Michael Kerrisk +.\" +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Feb 22 20:03:58 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Thu Feb 3 03:15:15 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: buffer-dirty-flush ¥Ð¥Ã¥Õ¥¡¡¼¡¦¥À¡¼¥Æ¥£¡¼¡¦¥Õ¥é¥Ã¥·¥å +.\"WORD: daemon ¥Ç¡¼¥â¥ó +.\"WORD: flush ¥Õ¥é¥Ã¥·¥å +.\"WORD: tune Ä´À° +.\"WORD: long word ¥í¥ó¥°¡¦¥ï¡¼¥É +.\"WORD: parameter ¥Ñ¥é¥á¡¼¥¿¡¼ +.\"WORD: source file ¥½¡¼¥¹¡¦¥Õ¥¡¥¤¥ë +.\" +.TH BDFLUSH 2 2004-06-17 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O bdflush \- start, flush, or tune buffer-dirty-flush daemon +bdflush \- ¥Ð¥Ã¥Õ¥¡¡¼¡¦¥À¡¼¥Æ¥£¡¼¡¦¥Õ¥é¥Ã¥·¥å¡¦¥Ç¡¼¥â¥ó¤òµ¯Æ°¡¢¥Õ¥é¥Ã¥·¥å¡¢Ä´À°¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "int bdflush(int " func ", long *" address ); +.BI "int bdflush(int " func ", long " data ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR bdflush () +.\"O starts, flushes, or tunes the buffer-dirty-flush daemon. +.BR bdflush () +¤Ï¥Ð¥Ã¥Õ¥¡¡¼¡¦¥À¡¼¥Æ¥£¡¼¡¦¥Õ¥é¥Ã¥·¥å (buffer-dirty-flush)¡¦ +¥Ç¡¼¥â¥ó (daemon) ¤òµ¯Æ°¡¢¥Õ¥é¥Ã¥·¥å (flush)¡¢Ä´À° (tune) ¤¹¤ë¡£ +.\"O Only a privileged process (one with the +.\"O .B CAP_SYS_ADMIN +.\"O capability) may call +.\"O .BR bdflush (). +.RB ( CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ä) Æø¢¥×¥í¥»¥¹¤Î¤ß¤¬ +.BR bdflush () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O If +.\"O .I func +.\"O is negative or 0, and no daemon has been started, then +.\"O .BR bdflush () +.\"O enters the daemon code and never returns. +.I func +¤¬É餫 0 ¤Ç¥Ç¡¼¥â¥ó¤¬µ¯Æ°¤µ¤ì¤Æ¤¤¤Ê¤ì¤Ð¡¢ +.BR bdflush () +¤Ï¥Ç¡¼¥â¥ó¤Î¥³¡¼¥É¤ØÆþ¤ê¡¢Ìá¤Ã¤Æ¤³¤Ê¤¤¡£ +.PP +.\"O If +.\"O .I func +.\"O is 1, +.\"O some dirty buffers are written to disk. +.I func +¤¬ 1 ¤Ê¤é¤Ð¡¢ +±ø¤ì¤¿ (dirty) ¥Ð¥Ã¥Õ¥¡¡¼¤¬¥Ç¥£¥¹¥¯¤Ø¤È½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.PP +.\"O If +.\"O .I func +.\"O is 2 or more and is even (low bit is 0), then +.\"O .I address +.\"O is the address of a long word, +.\"O and the tuning parameter numbered +.\"O .RI "(" "func" "\-2)/2" +.\"O is returned to the caller in that address. +.I func +¤¬ 2 °Ê¾å¤Ç¶ö¿ô (ºÇ¾®¥Ó¥Ã¥È¤¬ 0) ¤Ê¤é¤Ð¡¢ +.I address +¤Ë¥í¥ó¥°¡¦¥ï¡¼¥É¤Ç¥¢¥É¥ì¥¹¤ò»ØÄꤷ¡¢¤½¤Î¥¢¥É¥ì¥¹¤Ë +.RI "(" "func" "\-2)/2" +¤Ç»ØÄꤵ¤ì¤¿Ä´Àá¥Ñ¥é¥á¡¼¥¿¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O If +.\"O .I func +.\"O is 3 or more and is odd (low bit is 1), then +.\"O .I data +.\"O is a long word, +.\"O and the kernel sets tuning parameter numbered +.\"O .RI "(" "func" "\-3)/2" +.\"O to that value. +.I func +¤¬ 3 °Ê¾å¤Ç´ñ¿ô (ºÇ¾®¥Ó¥Ã¥È¤¬ 1) ¤Ê¤é¤Ð¡¢ +.I data +¤ò¥í¥ó¥°¡¦¥ï¡¼¥É¤Ç»ØÄꤷ¡¢¤½¤ÎÃͤò +.RI "(" "func" "\-3)/2" +¤Ç»ØÄꤵ¤ì¤¿Ä´Àá¥Ñ¥é¥á¡¼¥¿¡¼¤ËÀßÄꤹ¤ë¡£ +.PP +.\"O The set of parameters, their values, and their valid ranges +.\"O are defined in the kernel source file +.\"O .IR fs/buffer.c . +¥Ñ¥é¥á¡¼¥¿¡¼¤Î½¸¹ç¤ä¤½¤ÎÃÍ¡¢Í­¸ú¤ÊÈϰϤϥ«¡¼¥Í¥ë¤Î¥½¡¼¥¹¡¦¥Õ¥¡¥¤¥ë¤Î +.I fs/buffer.c +¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O If +.\"O .I func +.\"O is negative or 0 and the daemon successfully starts, +.\"O .BR bdflush () +.\"O never returns. +.I func +¤¬É餫 0 ¤Ç¡¢¥Ç¥â¡¼¥ó¤Îµ¯Æ°¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ï +.BR bdflush () +¤ÏÊ֤äƤ³¤Ê¤¤¡£ +.\"O Otherwise, the return value is 0 on success and \-1 on failure, with +.\"O .I errno +.\"O set to indicate the error. +¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤Ë¤½¤Î¥¨¥é¡¼¤¬»Ø¼¨¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBUSY +.\"O An attempt was made to enter the daemon code after +.\"O another process has already entered. +¾¤Î¥×¥í¥»¥¹¤¬´û¤Ë¥Ç¡¼¥â¥ó¡¦¥³¡¼¥É¤ËÆþ¤Ã¤Æ¤¤¤ë¤Î¤Ë¡¢Æþ¤í¤¦¤È»î¤ß¤¿¡£ +.TP +.B EFAULT +.\"O .I address +.\"O points outside your accessible address space. +.I address +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O An attempt was made to read or write an invalid parameter number, +.\"O or to write an invalid value to a parameter. +ÉÔÀµ¤Ê¥Ñ¥é¥á¡¼¥¿¡¼¤ÎÆɤ߽ñ¤­¤ò»î¤ß¤¿¤«¡¢¥Ñ¥é¥á¡¼¥¿¡¼¤ØÉÔÀµ¤ÊÃͤò +½ñ¤­¹þ¤â¤¦¤È¤·¤¿¡£ +.TP +.B EPERM +.\"O Caller does not have the +.\"O .B CAP_SYS_ADMIN +.\"O capability. +¸Æ¤Ó½Ð¤·¸µ¤Ë +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR bdflush () +.\"O is Linux-specific and should not be used in programs +.\"O intended to be portable. +.BR bdflush () +¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fsync (2), +.BR sync (2), +.BR sync (8), +.BR update (8) diff --git a/draft/man2/bind.2 b/draft/man2/bind.2 new file mode 100644 index 00000000..44d35ba4 --- /dev/null +++ b/draft/man2/bind.2 @@ -0,0 +1,484 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from /usr/include/sys/socket.h, which does not have +.\" any authorship information in it. It is probably available under the GPL. +.\" +.\" 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. +.\" +.\" +.\" Other portions are from the 6.9 (Berkeley) 3/10/91 man page: +.\" +.\" Copyright (c) 1983 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. +.\" +.\" Modified Mon Oct 21 23:05:29 EDT 1996 by Eric S. Raymond +.\" Modified 1998 by Andi Kleen +.\" $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 +.SH ̾Á° +.\"O bind \- bind a name to a socket +bind \- ¥½¥±¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.\"O .BR "#include " " /* See NOTES */" +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.B #include +.sp +.BI "int bind(int " sockfd ", const struct sockaddr *" addr , +.BI " socklen_t " addrlen ); +.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 +¤¬»Ø¤¹¥¢¥É¥ì¥¹¹½Â¤ÂΤΥµ¥¤¥º¤ò¥Ð¥¤¥Èñ°Ì¤Ç»ØÄꤹ¤ë¡£ +ÅÁÅýŪ¤Ë¤³¤ÎÁàºî¤Ï +¡Ö¥½¥±¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë¡× +¤È¸Æ¤Ð¤ì¤ë¡£ +.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 () +¤ò»ÈÍѤ·¤Æ¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤ò³ä¤êÅö¤Æ¤ëɬÍפ¬¤¢¤ë¡£ + +.\"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) +¤ò»²¾È¡£ + +.\"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 +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤Ê´¶¤¸¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +struct sockaddr { + sa_family_t sa_family; + char sa_data[14]; +} + +.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" +.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 EACCES +.\" 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 +.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. +¥½¥±¥Ã¥È¤¬¤¹¤Ç¤Ë¥¢¥É¥ì¥¹¤Ë·ë¤Ó¤Ä¤± (bind) ¤é¤ì¤Æ¤¤¤ë¡£ +.\" ¤³¤ì¤Ï¾­ÍèÊѹ¹¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\" ¾Ü¤·¤¯¤Ï +.\" .I linux/unix/sock.c +.\" ¤ò»²¾È¤¹¤ë¤³¤È¡£ +.B ENOTSOCK +.\"O .I sockfd +.\"O is a descriptor for a file, not a socket. +.I sockfd +¤¬¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¡¢¥½¥±¥Ã¥È¤ËÂФ¹¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +.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. +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +.\"O Insufficient kernel memory was available. +¥«¡¼¥Í¥ë¤Ë¡¢ÍøÍѲÄǽ¤Ê¥á¥â¥ê¡¼¤¬½½Ê¬¤Ë¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O A component of the path prefix is not a directory. +¥Ñ¥¹Ì¾¤Î¹½À®Í×ÁǤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EROFS +.\"O The socket inode would reside on a read-only file system. +¥½¥±¥Ã¥È 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 ¤Ë¤Ï¾¤Ë¡¢°ìÈ̤Υ¨¥é¡¼¾õÂÖ +.\" .B ENOSR +.\" µÚ¤Ó Unix ¥É¥á¥¤¥ó¤Î¥¨¥é¡¼¾õÂÖ +.\" .BR EIO , +.\" .B EISDIR +.\" ¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.\"O .SH NOTES +.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 ·Ï) ¤Ç¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬ +ɬÍפǤ¢¤ê¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò +¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬¸­ÌÀ¤Ç¤¢¤í¤¦¡£ + +.\"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 +.SH ¥Ð¥° +.\"O The transparent proxy options are not described. +Æ©²áŪ¥×¥í¥­¥· (transparent proxy) ¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æµ­½Ò¤·¤Æ¤¤¤Ê¤¤¡£ +.\" FIXME What *are* transparent proxy options? +.\"O .SH EXAMPLE +.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) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"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. + +.nf +#include +#include +#include +#include +#include + +#define MY_SOCK_PATH "/somepath" +#define LISTEN_BACKLOG 50 + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int +main(int argc, char *argv[]) +{ + int sfd, cfd; + struct sockaddr_un my_addr, peer_addr; + socklen_t peer_addr_size; + + sfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (sfd == \-1) + handle_error("socket"); + + memset(&my_addr, 0, sizeof(struct sockaddr_un)); + /* Clear structure */ + my_addr.sun_family = AF_UNIX; + strncpy(my_addr.sun_path, MY_SOCK_PATH, + sizeof(my_addr.sun_path) \- 1); + + if (bind(sfd, (struct sockaddr *) &my_addr, + sizeof(struct sockaddr_un)) == \-1) + handle_error("bind"); + + if (listen(sfd, LISTEN_BACKLOG) == \-1) + handle_error("listen"); + + /* Now we can accept incoming connections one + at a time using accept(2) */ + + peer_addr_size = sizeof(struct sockaddr_un); + cfd = accept(sfd, (struct sockaddr *) &peer_addr, + &peer_addr_size) + if (cfd == \-1) + handle_error("accept"); + + /* Code to deal with incoming connection(s)... */ + + /* When no longer required, the socket pathname, MY_SOCK_PATH + 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) diff --git a/draft/man2/brk.2 b/draft/man2/brk.2 new file mode 100644 index 00000000..9444b7c4 --- /dev/null +++ b/draft/man2/brk.2 @@ -0,0 +1,277 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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 2008-06-18 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O brk, sbrk \- change data segment size +brk, sbrk \- ¥Ç¡¼¥¿¡¦¥»¥°¥á¥ó¥È¤Î¥µ¥¤¥º¤ÎÊѹ¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int brk(void *" addr ); +.sp +.BI "void *sbrk(intptr_t " increment ); +.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 brk (), +.BR sbrk (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.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) ¤Î +ËöÈø¤ò¼¨¤¹ (¥×¥í¥°¥é¥à¡¦¥Ö¥ì¡¼¥¯¤Ï¡¢½é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤ +¥Ç¡¼¥¿¡¦¥»¥°¥á¥ó¥È¤ÎËöÈø¤Îľ¸å¤Î¾ì½ê¤È¤Ê¤ë)¡£ +¥×¥í¥°¥é¥à¡¦¥Ö¥ì¡¼¥¯¤òÁý¤ä¤¹¤È¤¤¤¦¤³¤È¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Ø¤Î +¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤ë¸ú²Ì¤¬¤¢¤ê¡¢ +¥×¥í¥°¥é¥à¡¦¥Ö¥ì¡¼¥¯¤ò¸º¤é¤¹¤È¤¤¤¦¤³¤È¤Ï¡¢¥á¥â¥ê¤ò²òÊü¤¹¤ë +¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ + +.\"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) +¤ò»²¾È)¡£ + +.\"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" +.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 +¤òÀßÄꤹ¤ë +(¤¿¤À¤·¡Ö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" +.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 () +.\" ¤È +.\" .BR sbrk () +.\" ¤Ï C µ¬³Ê (C Standard) ¤Ë¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" ¤Þ¤¿ POSIX.1 µ¬³Ê¤«¤é¤Ï°Õ¿ÞŪ¤Ë½ü³°¤µ¤ì¤Æ¤¤¤ë (ÃÊÍî B.1.1.1.3, B.8.3.3 »²¾È)¡£ +.\"O .SH NOTES +.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) +¥á¥â¥ê³ä¤êÅö¤Æ¥Ñ¥Ã¥±¡¼¥¸¤ÎÊý¤¬¡¢°Ü¿¢À­¤¬¹â¤¯¡¢ +»È¤¤¤ä¤¹¤¤¥á¥â¥ê³ä¤êÅö¤ÆÊýË¡¤òÄ󶡤·¤Æ¤¤¤ë¡£ + +.\"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), +.\" \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 ¤È¤¤¤¦ÊÖ¤êÃͤòÊÖ¤¹¡£ + +.\"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 () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢ +°ÊÁ°¤Î¥Ö¥ì¡¼¥¯¤ÎÃͤòÊÖ¤¹¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤ËÆâÉô¤ÇÄ´À°¤¬¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR execve (2), +.BR getrlimit (2), +.BR end (3), +.BR malloc (3) diff --git a/draft/man2/cacheflush.2 b/draft/man2/cacheflush.2 new file mode 100644 index 00000000..c51557ea --- /dev/null +++ b/draft/man2/cacheflush.2 @@ -0,0 +1,141 @@ +.\" Written by Ralf Baechle (ralf@waldorf-gmbh.de), +.\" Copyright (c) 1994, 1995 Waldorf GMBH +.\" +.\" 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 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 ¥Õ¥é¥Ã¥·¥å +.\" +.TH CACHEFLUSH 2 2007-05-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O cacheflush \- flush contents of instruction and/or data cache +cacheflush \- Ì¿Îᥭ¥ã¥Ã¥·¥å¤ä¥Ç¡¼¥¿¥­¥ã¥Ã¥·¥å¤ÎÆâÍƤò¥Õ¥é¥Ã¥·¥å¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int cacheflush(char *" addr ", int "nbytes ", int "cache ); +.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. +Ì¿Îá (instruction) ¥­¥ã¥Ã¥·¥å¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.TP +.B DCACHE +.\"O Write back to memory and invalidate the affected valid cache lines. +Êѹ¹¤¬¤¢¤Ã¤¿¥­¥ã¥Ã¥·¥å¥é¥¤¥ó¤ò¥á¥â¥ê¤Ë½ñ¤­Ìᤷ¡¢Ìµ¸ú¤Ë¤¹¤ë¡£ +.TP +.B BCACHE +.\"O Same as +.\"O .BR (ICACHE|DCACHE) . +.B (ICACHE|DCACHE) +¤ÈƱ¤¸¡£ +.\"O .SH "RETURN VALUE" +.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 +¤Ë¥¨¥é¡¼¤¬»Ø¼¨¤µ¤ì¤ë¡£ +.\"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 +.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 +.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 +¤Ï̵»ë¤µ¤ì¤ë¡£¤½¤Î¤¿¤á¡¢ +¾ï¤ËÁ´¤Æ¤Î¥­¥ã¥Ã¥·¥å¤¬¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë¡£ diff --git a/draft/man2/capget.2 b/draft/man2/capget.2 new file mode 100644 index 00000000..c62ab5f9 --- /dev/null +++ b/draft/man2/capget.2 @@ -0,0 +1,413 @@ +.\" written by Andrew Morgan +.\" may be distributed as per GPL +.\" Modified by David A. Wheeler +.\" Modified 2004-05-27, mtk +.\" Modified 2004-06-21, aeb +.\" Modified 2008-04-28, morgan of kernel.org +.\" Update in line with addition of file capabilities and +.\" 64-bit capability sets in kernel 2.6.2[45]. +.\" Modified 2009-01-26, andi kleen +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1999-12-26, HANATAKA Shinya +.\" Updated & Modified 2005-02-03, Yuichi SATO +.\" Updated & Modified 2006-01-31, Akihiro MOTOKI +.\" Updated & Modified 2006-07-23, Akihiro MOTOKI, LDP v2.36 +.\" Updated & Modified 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2009-02-24, Akihiro MOTOKI, LDP v3.19 +.\" +.\"WORD: capability ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\"WORD: effective capability ¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\"WORD: inheritable capabilit ·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\"WORD: permitted capabily µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\" +.TH CAPGET 2 2009-01-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O capget, capset \- set/get capabilities of thread(s) +capget, capset \- ¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÀßÄê/¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #undef _POSIX_SOURCE +.br +.B #include +.sp +.BI "int capget(cap_user_header_t " hdrp ", cap_user_data_t " datap ); +.sp +.BI "int capset(cap_user_header_t " hdrp ", const cap_user_data_t " datap ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O As of Linux 2.2, +.\"O the power of the superuser (root) has been partitioned into +.\"O a set of discrete capabilities. +.\"O Each thread has a set of effective capabilities identifying +.\"O which capabilities (if any) it may currently exercise. +.\"O Each thread also has a set of inheritable capabilities that may be +.\"O passed through an +.\"O .BR execve (2) +.\"O call, and a set of permitted capabilities +.\"O that it can make effective or inheritable. +Linux 2.2 ¤Ç¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼ (root) ¤Î¸¢¸Â¤Ï¡¢¸ÄÊ̤Υ±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +(capabilities) ¤Ø¤Èʬ³ä¤µ¤ì¡¢¤½¤Î½¸¹ç¤È¤·¤Æɽ¸½¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +³Æ¥¹¥ì¥Ã¥É¤Ï¡Ö¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (effective capability) ¤Î½¸¹ç¡×¤ò»ý¤Á¡¢ +¤½¤ì¤Ë¤è¤Ã¤Æ¸½ºß¤É¤ÎÁàºî¤¬¼Â¹Ô²Äǽ¤«¤ò¼±Ê̤Ǥ­¤ë¡£ +¤Þ¤¿¡¢³Æ¥¹¥ì¥Ã¥É¤Ï¡¢ +¡Ö·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (inheritable capability) ¤Î½¸¹ç¡×¤È +¡Öµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (permitted capability) ¤Î½¸¹ç¡×¤ò»ý¤Ä¡£ +¡Ö·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î½¸¹ç¡×¤Ï +.BR execve (2) +¤òÄ̤¸¤ÆÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î½¸¹ç¤Ç¤¢¤ê¡¢ +¡Öµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (permitted capability) ¤Î½¸¹ç¡×¤Ï +¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ä·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤È¤·¤ÆÍ­¸ú¤Ë¤Ç¤­¤ë +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òµ¬Äꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.PP +.\"O These two functions are the raw kernel interface for getting and +.\"O setting thread capabilities. +.\"O Not only are these system calls specific to Linux, +.\"O but the kernel API is likely to change and use of +.\"O these functions (in particular the format of the +.\"O .I cap_user_*_t +.\"O types) is subject to extension with each kernel revision, +.\"O but old programs will keep working. +¤³¤ÎÆó¤Ä¤Î´Ø¿ô¤Ï¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¼èÆÀ¤·¤¿¤êÀßÄꤷ¤¿¤ê¤¹¤ë¤¿¤á¤Î +À¸¤Î¥«¡¼¥Í¥ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ë¤È¤¤¤¦¤À¤±¤Ç¤Ê¤¯¡¢ +¥«¡¼¥Í¥ë API ¤ÏÊѹ¹¤µ¤ì¤ë¤«¤â¤·¤ì¤º¡¢¤³¤ì¤é¤Î +´Ø¿ô¤Î»ÈÍÑË¡ (ÆÃ¤Ë +.I cap_user_*_t +·¿¤È¤¤¤¦½ñ¼°) ¤Ï¥«¡¼¥Í¥ë¤Î¥ê¥Ó¥¸¥ç¥óËè¤Ë³ÈÄ¥¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¤¬¡¢ +°ÊÁ°¤Î¥×¥í¥°¥é¥à¤Ï¤½¤Î¤Þ¤ÞÆ°ºî¤¹¤ë¡£ +.sp +.\"O The portable interfaces are +.\"O .BR cap_set_proc (3) +.\"O and +.\"O .BR cap_get_proc (3); +°Ü¿¢À­¤Î¤¢¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï +.BR cap_set_proc (3) +¤È +.BR cap_get_proc (3) +¤Ç¤¢¤ë¡£ +.\"O if possible you should use those interfaces in applications. +²Äǽ¤Ê¤é¤Ð¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤ì¤é¤Î´Ø¿ô¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O If you wish to use the Linux extensions in applications, you should +.\"O use the easier-to-use interfaces +.\"O .BR capsetp (3) +.\"O and +.\"O .BR capgetp (3). +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë Linux ³ÈÄ¥¤ò»ÈÍѤ·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢¤è¤ê´Êñ¤Ë +»È¤¨¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë +.BR capsetp (3) +¤È +.BR capgetp (3) +¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SS "Current details" +.SS ¸½ºß¤Î¾ÜºÙ +.\"O Now that you have been warned, some current kernel details. +.\"O The structures are defined as follows. +¸½ºß¤Î¥«¡¼¥Í¥ë¤Î¾ÜºÙ¤Ë¤Ä¤¤¤ÆÃí°Õ¤ò½Ò¤Ù¤Æ¤ª¤¯¡£ +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.sp +.nf +.in +4n +#define _LINUX_CAPABILITY_VERSION_1 0x19980330 +#define _LINUX_CAPABILITY_U32S_1 1 + +#define _LINUX_CAPABILITY_VERSION_2 0x20071026 +#define _LINUX_CAPABILITY_U32S_2 2 + +typedef struct __user_cap_header_struct { + __u32 version; + int pid; +} *cap_user_header_t; + +typedef struct __user_cap_data_struct { + __u32 effective; + __u32 permitted; + __u32 inheritable; +} *cap_user_data_t; +.fi +.in -4n +.sp +.\"O .I effective, permitted, inheritable +.\"O are bitmasks of the capabilities defined in +.\"O .I capability(7). +.\"O Note the +.\"O .I CAP_* +.\"O values are bit indexes and need to be bit-shifted before ORing into +.\"O the bit fields. +.\"O To define the structures for passing to the system call you have to use the +.\"O .I struct __user_cap_header_struct +.\"O and +.\"O .I struct __user_cap_data_struct +.\"O names because the typedefs are only pointers. +.I effective, permitted, inheritable +¤Ï¡¢ +.BR capability (7) +¤ÇÄêµÁ¤µ¤ì¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +.I CAP_* +¤Ï¥Ó¥Ã¥ÈÈÖ¹æ¤òɽ¤¹¥¤¥ó¥Ç¥Ã¥¯¥¹ÃͤǤ¢¤ê¡¢ +¥Ó¥Ã¥È¥Õ¥£¡¼¥ë¥É¤Ë OR ¤ò¹Ô¤¦Á°¤Ë +.I CAP_* +¤ÎÃͤÎʬ¤À¤±¥Ó¥Ã¥È¥·¥Õ¥È¤ò¹Ô¤¦É¬Íפ¬¤¢¤ë¡£ +typedef ¤ÎÊý¤Ï¥Ý¥¤¥ó¥¿¤Ê¤Î¤Ç¡¢ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹¹½Â¤ÂΤòÄêµÁ¤¹¤ë¤Ë¤Ï¡¢ +.I struct __user_cap_header_struct +¤È +.I struct __user_cap_data_struct +¤È¤¤¤¦Ì¾Á°¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O Kernels prior to 2.6.25 prefer +.\"O 32-bit capabilities with version +.\"O .BR _LINUX_CAPABILITY_VERSION_1 , +.\"O and kernels 2.6.25+ prefer 64-bit capabilities with version +.\"O .BR _LINUX_CAPABILITY_VERSION_2 . +.\"O Note, 64-bit capabilities use +.\"O .IR datap [0] +.\"O and +.\"O .IR datap [1], +.\"O whereas 32-bit capabilities only use +.\"O .IR datap [0]. +¥«¡¼¥Í¥ë 2.6.25 ¤è¤êÁ°¤Ç¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó +.B _LINUX_CAPABILITY_VERSION_1 +¤Î 32 ¥Ó¥Ã¥È¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¿ä¾©¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.6.25 °Ê¹ß¤Ç¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó +.B _LINUX_CAPABILITY_VERSION_2 +¤Î 64 ¥Ó¥Ã¥È¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¿ä¾©¤Ç¤¢¤ë¡£ +64 ¥Ó¥Ã¥È¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ç¤Ï +.IR datap [0] +¤È +.IR datap [1] +¤¬»ÈÍѤµ¤ì¤ë¤Î¤ËÂФ·¡¢ +32 ¥Ó¥Ã¥È¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ç¤Ï +.IR datap [0] +¤À¤±¤¬»ÈÍѤµ¤ì¤ë¡£ +.sp +.\"O Another change affecting the behavior of these system calls is kernel +.\"O support for file capabilities (VFS capability support). +.\"O This support is currently a compile time option (added in kernel 2.6.24). +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎµóÆ°¤Ë±Æ¶Á¤¬¤¢¤ë¤â¤¦°ì¤Ä¤ÎÊѹ¹ÅÀ¤Ï¡¢ +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (file capabilities) ¤Î¥«¡¼¥Í¥ë¤Ë¤è¤ë¥µ¥Ý¡¼¥È +(VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥µ¥Ý¡¼¥È) ¤Ç¤¢¤ë¡£ +VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥µ¥Ý¡¼¥È¤Ï¸½ºß¤Î¤È¤³¤í¥³¥ó¥Ñ¥¤¥ë»þ¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë +(¥«¡¼¥Í¥ë 2.6.24 ¤ÇÄɲ䵤줿)¡£ +.sp +.\"O For +.\"O .BR capget () +.\"O calls, one can probe the capabilities of any process by specifying its +.\"O process ID with the +.\"O .I hdrp->pid +.\"O field value. +.BR capget () +¤Ç¤Ï¡¢ +.I hdrp->pid +¤Î¥Õ¥£¡¼¥ë¥ÉÃͤ˥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÃΤꤿ¤¤¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤ò +»ØÄꤹ¤ë¤³¤È¤Ç¡¢Ç¤°Õ¤Î¥×¥í¥»¥¹¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SS With VFS Capability Support +.SS VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç +.\"O VFS Capability support creates a file-attribute method for adding +.\"O capabilities to privileged executables. +.\"O This privilege model obsoletes kernel support for one process +.\"O asynchronously setting the capabilities of another. +.\"O That is, with VFS support, for +.\"O .BR capset () +.\"O calls the only permitted values for +.\"O .I hdrp->pid +.\"O are 0 or +.\"O .BR getpid (2), +.\"O which are equivalent. +VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥µ¥Ý¡¼¥È¤Ç¤Ï¡¢Æø¢¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò +Äɲ乤뤿¤á¤Î¥Õ¥¡¥¤¥ë°À­¥á¥½¥Ã¥É¤¬ºîÀ®¤µ¤ì¤¿¡£ +¤³¤ÎÆø¢¥â¥Ç¥ë¤ÎƳÆþ¤Ë¤è¤ê¡¢¤¢¤ë¥×¥í¥»¥¹¤Ë¤è¤êÊÌ¤Î¥×¥í¥»¥¹¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +¤òÈóƱ´ü¤ËÀßÄꤹ¤ëµ¡Ç½¤Î¥«¡¼¥Í¥ë¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤ÏÇѻߤµ¤ì¤ë¡£ +¤Ä¤Þ¤ê¡¢VFS ¥µ¥Ý¡¼¥È¤Ç¤Ï¡¢ +.BR capset () +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë +.I hdrp->pid +¤ÎÃͤȤ·¤Æµö¤µ¤ì¤ë¤Î¤Ï 0 ¤È +.BR getpid (2) +¤¬ÊÖ¤¹ÃͤÀ¤±¤È¤Ê¤ë (¤É¤Á¤é¤ÎÃͤǤâÅù²Á¤Ç¤¢¤ë)¡£ +.\"O .SS Without VFS Capability Support +.SS VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç +.\"O When the kernel does not support VFS capabilities, +.\"O .BR capset () +.\"O calls can operate on the capabilities of the thread specified by the +.\"O .I pid +.\"O field of +.\"O .I hdrp +.\"O when that is nonzero, or on the capabilities of the calling thread if +.\"O .I pid +.\"O is 0. +¥«¡¼¥Í¥ë¤¬ VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.I hdrp +¤Î +.I pid +¥Õ¥£¡¼¥ë¥É¤¬ 0 °Ê³°¤Ç¤¢¤ì¤Ð¡¢ +.BR capset () +¤ÎÁàºîÂÐ¾Ý¤Ï +.I pid +¤Ç»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ë¤Ê¤ë¡£ +.I pid +¤¬ 0 ¤Î¾ì¹ç¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬ÁàºîÂоݤȤʤ롣 +.\"O If +.\"O .I pid +.\"O refers to a single-threaded process, then +.\"O .I pid +.\"O can be specified as a traditional process ID; +.\"O operating on a thread of a multithreaded process requires a thread ID +.\"O of the type returned by +.\"O .BR gettid (2). +.I pid +¤¬¥·¥ó¥°¥ë¥¹¥ì¥Ã¥É¡¦¥×¥í¥»¥¹¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.I pid +¤Ï°ÊÁ°¤«¤é»È¤ï¤ì¤Æ¤¤¤ë¥×¥í¥»¥¹ID ¤ò»È¤Ã¤Æ»ØÄê¤Ç¤­¤ë¡£ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¡¦¥×¥í¥»¥¹Æâ¤Î¤¢¤ë¥¹¥ì¥Ã¥É¤òÂоݤˤ¹¤ë¾ì¹ç¤Ï¡¢ +.BR gettid (2) +¤¬ÊÖ¤¹¥¹¥ì¥Ã¥ÉID ¤òÍѤ¤¤Æ»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ +.\"O For +.\"O .BR capset (), +.\"O .I pid +.\"O can also be: \-1, meaning perform the change on all threads except the +.\"O caller and +.\"O .BR init (8); +.\"O or a value less than \-1, in which case the change is applied +.\"O to all members of the process group whose ID is \-\fIpid\fP. +¤Þ¤¿¡¢ +.BR capset () +¤Ç¤Ï \-1 ¤ä \-1 ¤è¤ê¾®¤µ¤ÊÃͤò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +\-1 ¤Ï¸Æ¤Ó½Ð¤·¸µ¤È +.BR init (8) +¤ò½ü¤¯Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤òÂоݤȤ·¤ÆÊѹ¹¤ò¹Ô¤¦¤³¤È¤ò¡¢ +\-1 ¤è¤ê¾®¤µ¤ÊÃÍ¤Ï ID ¤¬ \-\fIpid\fP ¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð +¤òÂоݤȤ·¤ÆÊѹ¹¤ò¹Ô¤¦¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ + +.\"O For details on the data, see +.\"O .BR capabilities (7). +¤³¤Î¥Ç¡¼¥¿¤Î¾ÜºÙ¤Ï +.BR capabilities (7) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"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 The calls will fail with the error +.\"O .BR EINVAL , +.\"O and set the +.\"O .I version +.\"O field of +.\"O .I hdrp +.\"O to the kernel preferred value of +.\"O .B _LINUX_CAPABILITY_VERSION_? +.\"O when an unsupported +.\"O .I version +.\"O value is specified. +.I hdrp +¤Î¥Õ¥£¡¼¥ë¥É +.I version +¤Ë¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤Ãͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤·¡¢ +.I version +¤Ë¥«¡¼¥Í¥ë¿ä¾©¤Î +.B _LINUX_CAPABILITY_VERSION_? +¤òÀßÄꤹ¤ë¡£ +.\"O In this way, one can probe what the current +.\"O preferred capability revision is. +¤³¤Î¤è¤¦¤Ë¤·¤Æ¡¢¸½ºß¤Î¿ä¾©¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥ê¥Ó¥¸¥ç¥ó¤¬²¿¤«¤ò +Ä´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O Bad memory address. +.\"O .I hdrp +.\"O must not be NULL. +.\"O .I datap +.\"O may only be NULL when the user is trying to determine the preferred +.\"O capability version format supported by the kernel. +ÉÔÀµ¤Ê¥á¥â¥ê¥¢¥É¥ì¥¹¡£ +.I hdrp +¤Ï NULL ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.I datap +¤Ë NULL ¤ò»ØÄꤷ¤Æ¤è¤¤¤Î¤Ï¡¢¥æ¡¼¥¶¤¬¥«¡¼¥Í¥ë¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë +¿ä¾©¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¡¼¥¸¥ç¥ó¤òȽÄꤷ¤è¤¦¤È¤·¤Æ¤¤¤ë¤È¤­¤À¤±¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +.\"O One of the arguments was invalid. +°ú¤­¿ô¤Î¤É¤ì¤«¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.TP +.B EPERM +.\"O An attempt was made to add a capability to the Permitted set, or to set +.\"O a capability in the Effective or Inheritable sets that is not in the +.\"O Permitted set. +¡Öµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¡×¤Ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÄɲ䷤褦¤È¤·¤Æ¤¤¤ë¤«¡¢ +¤â¤·¤¯¤Ï¡Öµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¡×¤Ë´Þ¤Þ¤ì¤Ê¤¤¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò +¡Ö¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¡×¤ä¡Ö·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¡×¤Ë +¥»¥Ã¥È¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¡£ +.TP +.B EPERM +.\"O The caller attempted to use +.\"O .BR capset () +.\"O to modify the capabilities of a thread other than itself, +.\"O but lacked sufficient privilege. +.\"O For kernels supporting VFS +.\"O capabilities, this is never permitted. +.\"O For kernels lacking VFS +.\"O support, the +.\"O .B CAP_SETPCAP +.\"O capability is required. +.\"O (A bug in kernels before 2.6.11 meant that this error could also +.\"O occur if a thread without this capability tried to change its +.\"O own capabilities by specifying the +.\"O .I pid +.\"O field as a nonzero value (i.e., the value returned by +.\"O .BR getpid (2)) +.\"O instead of 0.) +¸Æ¤Ó½Ð¤·¸µ¤¬¼«Ê¬°Ê³°¤Î¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò +.BR capset () +¤ò»È¤Ã¤Æ½¤Àµ¤·¤è¤¦¤È¤·¤¿¤¬¡¢½½Ê¬¤ÊÆø¢¤¬¤Ê¤«¤Ã¤¿¡£ +VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¤³¤ÎÁàºî¤¬µö²Ä¤µ¤ì¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£ +VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +(¥Ð¡¼¥¸¥ç¥ó 2.6.11 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¡¢ +¤³¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤¥¹¥ì¥Ã¥É¤¬ +.I pid +¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤Ç¤Ê¤¤ÃÍ (¤Ä¤Þ¤ê¡¢0 ¤ÎÂå¤ï¤ê¤Ë +.BR getpid (2) +¤¬ÊÖ¤¹ÃÍ) ¤ò»ØÄꤷ¤Æ¼«Ê¬¼«¿È¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¤â¡¢ +¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¤¤¤¦¥Ð¥°¤¬¤¢¤Ã¤¿¡£) +.TP +.B ESRCH +.\"O No such thread. +¤½¤Î¤è¤¦¤Ê¥¹¥ì¥Ã¥É¤¬Â¸ºß¤·¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These system calls are Linux-specific. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH È÷¹Í +.\"O The portable interface to the capability querying and setting +.\"O functions is provided by the +.\"O .I libcap +.\"O library and is available: +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÀßÄꤷ¤¿¤ê¼èÆÀ¤·¤¿¤ê¤¹¤ëµ¡Ç½¤Î¤¿¤á¤Î°Ü¿¢À­¤¢¤ë +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï +.I libcap +¥é¥¤¥Ö¥é¥ê¤Ë¤è¤Ã¤ÆÄ󶡤µ¤ì¤ë¡£ +¤³¤Î¥é¥¤¥Ö¥é¥ê¤Ï°Ê²¼¤«¤éÆþ¼ê¤Ç¤­¤ë: +.br +http://www.kernel.org/pub/linux/libs/security/linux-privs +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR gettid (2), +.BR capabilities (7) diff --git a/draft/man2/chdir.2 b/draft/man2/chdir.2 new file mode 100644 index 00000000..ca64a604 --- /dev/null +++ b/draft/man2/chdir.2 @@ -0,0 +1,211 @@ +.\" 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-21 by Rik Faith +.\" Modified 1995-04-15 by Michael Chastain : +.\" Added 'fchdir'. Fixed bugs in error section. +.\" Modified 1996-10-21 by Eric S. Raymond +.\" 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 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O chdir, fchdir \- change working directory +chdir, fchdir \- ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÎÊѹ¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int chdir(const char *" path ); +.br +.BI "int fchdir(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 fchdir (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"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 +¤Ë»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤¹¤ë¡£ +.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" +.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 +.\"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) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EFAULT +.\"O .I path +.\"O points outside your accessible address space. +³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö³°¤ò +.I path +¤¬»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EIO +.\"O An I/O error occurred. +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 +.B ENOTDIR +.\"O A component of +.\"O .I path +.\"O is not a directory. +.I path +¤Î¹½À®Í×ÁǤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.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" +.SH ½àµò +SVr4, 4.4BSD, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The current working directory is the starting point for interpreting +.\"O relative pathnames (those not starting with \(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) +¤ÎÁ°¸å¤Ç¡¢¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ + +.\"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) diff --git a/draft/man2/chmod.2 b/draft/man2/chmod.2 new file mode 100644 index 00000000..75bafb7f --- /dev/null +++ b/draft/man2/chmod.2 @@ -0,0 +1,346 @@ +.\" 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-21 by Rik Faith +.\" Modified 1997-01-12 by Michael Haardt +.\" : 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 2008-05-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O chmod, fchmod \- change permissions of a file +chmod, fchmod \- ¥Õ¥¡¥¤¥ë¤Î¥â¡¼¥É¤òÊѹ¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int chmod(const char *" path ", mode_t " mode ); +.br +.BI "int fchmod(int " fd ", mode_t " mode ); +.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 fchmod (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"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) ¤òÊѹ¹¤¹¤ë¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë´Ö¤Î°ã¤¤¤Ï¡¢¥Õ¥¡¥¤¥ë¤Î»ØÄê¤Î»ÅÊý¤À¤±¤Ç¤¢¤ë¡£ +.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 +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î¾ì¹ç¤Ï¡¢¥ê¥ó¥¯¤ÎŸ³«¤¬¹Ô¤ï¤ì¤ë¡£ +.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 +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Îµö²Ä¤òÊѹ¹¤¹¤ë¡£ +.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 (ÏÀÍýÏÂ) ¤ò¤È¤Ã¤ÆºîÀ®¤µ¤ì¤ë +¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +.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 +.BR S_IWUSR " (00200)" +.\"O write by owner +½êÍ­¼Ô¤Ë¤è¤ë½ñ¤­¹þ¤ß +.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 +.BR S_IRGRP " (00040)" +.\"O read by group +¥°¥ë¡¼¥×¤Ë¤è¤ëÆɤ߼è¤ê +.TP +.BR S_IWGRP " (00020)" +.\"O write by group +¥°¥ë¡¼¥×¤Ë¤è¤ë½ñ¤­¹þ¤ß +.TP +.BR S_IXGRP " (00010)" +.\"O execute/search by group +¥°¥ë¡¼¥×¤Ë¤è¤ë¼Â¹Ô / ¸¡º÷ +.TP +.BR S_IROTH " (00004)" +.\"O read by others +¾¿Í (others) ¤Ë¤è¤ëÆɤ߼è¤ê +.TP +.BR S_IWOTH " (00002)" +.\"O write by others +¾¿Í¤Ë¤è¤ë½ñ¤­¹þ¤ß +.TP +.BR S_IXOTH " (00001)" +.\"O execute/search by others +¾¿Í¤Ë¤è¤ë¼Â¹Ô / ¸¡º÷ +.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) ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ + +.\"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 +¥Ó¥Ã¥È¤Ï¥ª¥Õ¤Ë¤µ¤ì¤ë¤¬¡¢¤³¤ì¤Ë¤è¤Ã¤Æ¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ + +.\"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) +¤ò¸«¤è¡£ + +.\"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 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ç¤Ï¡¢¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤òÀ©¸Â¤¹¤ë¤È¡¢ +´û¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¤¹¤°¤Ë±Æ¶Á¤¬µÚ¤Ö¡£ +¤³¤ì¤Ï¥¢¥¯¥»¥¹À©¸æ¤¬¥µ¡¼¥Ð¡¼¾å¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¤¬¡¢ +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Ï¥¯¥é¥¤¥¢¥ó¥È¦¤Ç´ÉÍý¤µ¤ì¤Æ¤¤¤ë¤¿¤á¤Ç¤¢¤ë¡£ +¥¯¥é¥¤¥¢¥ó¥È¦¤Ç¥Õ¥¡¥¤¥ë°À­¤Î¥­¥ã¥Ã¥·¥å¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ÎÀ©¸Â¤ò´Ë¤¯¤¹¤ë¤È¡¢ +¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤Ë¾ðÊó¤¬ÅÁ¤ï¤ë¤Î¤¬ÃÙ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"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 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. +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 +.B ENOMEM +.\"O Insufficient kernel memory was available. +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O A component of the path prefix is not a directory. +¥Ñ¥¹Ì¾¤Î¹½À®Í×ÁǤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.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. +¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤ßÀìÍÑ (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. +¾åµ­¤ò»²¾È¡£ +.TP +.B EPERM +.\"O See above. +¾åµ­¤ò»²¾È¡£ +.TP +.B EROFS +.\"O See above. +¾åµ­¤ò»²¾È¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.4BSD, SVr4, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR chown (2), +.BR execve (2), +.BR fchmodat (2), +.BR open (2), +.BR stat (2), +.BR path_resolution (7) diff --git a/draft/man2/chown.2 b/draft/man2/chown.2 new file mode 100644 index 00000000..739250d4 --- /dev/null +++ b/draft/man2/chown.2 @@ -0,0 +1,502 @@ +.\" 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 2008-06-16 "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 (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"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); + } /* if */ + + exit(EXIT_SUCCESS); +} /* main */ +.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 new file mode 100644 index 00000000..4d455bb8 --- /dev/null +++ b/draft/man2/chroot.2 @@ -0,0 +1,210 @@ +.\" 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-21 by Rik Faith +.\" Modified 1994-08-21 by Michael Chastain +.\" Modified 1996-06-13 by aeb +.\" Modified 1996-11-06 by Eric S. Raymond +.\" 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 2008-06-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O chroot \- change root directory +.SH ̾Á° +chroot \- ¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int chroot(const char *" path ); +.\"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 () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"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" ¤«¤éƨ¤²½Ð¤»¤Æ¤·¤Þ¤¦¡£ +.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 ¥Ä¥ê¡¼¤Î³°¤Ë¤¢¤ë +¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.\"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 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. +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 +.B ENOMEM +.\"O Insufficient kernel memory was available. +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.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. +¸Æ¤Ó½Ð¤·Â¦¤Ë½½Ê¬¤ÊÆø¢¤¬¤Ê¤¤¡£ +.\"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 +.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) +¤Î¾ì¹ç¤â¡¢¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR chdir (2), +.BR path_resolution (7) diff --git a/draft/man2/clock_getres.2 b/draft/man2/clock_getres.2 new file mode 100644 index 00000000..633cd176 --- /dev/null +++ b/draft/man2/clock_getres.2 @@ -0,0 +1,382 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 2003 Nick Clifford (zaf@nrc.co.nz), Jan 25, 2003 +.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl), Aug 24, 2003 +.\" +.\" 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. +.\" +.\" 2003-08-23 Martin Schulze improvements +.\" 2003-08-24 aeb, large parts rewritten +.\" 2004-08-06 Christoph Lameter , SMP note +.\" +.\" 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 +.SH ̾Á° +.\"O clock_getres, clock_gettime, clock_settime \- clock and time functions +clock_getres, clock_gettime, clock_settime \- ¥¯¥í¥Ã¥¯¤È»þ´Ö¤Î´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int clock_getres(clockid_t " clk_id ", struct timespec *" res ); + +.BI "int clock_gettime(clockid_t " clk_id ", struct timespec *" tp ); + +.BI "int clock_settime(clockid_t " clk_id ", const struct timespec *" tp ); +.sp +.\"O Link with \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) +»²¾È): +.in +.sp +.ad l +.BR clock_getres (), +.BR clock_gettime (), +.BR clock_settime (): +_POSIX_C_SOURCE\ >=\ 199309L +.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 +¤ÎÇÜ¿ô¤ËÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.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 +¤Î»þ´Ö¤ò¼èÆÀ¤Þ¤¿¤ÏÀßÄꤹ¤ë¡£ +.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 +¤Ç°Ê²¼¤Î¤è¤¦¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.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 ¤Ä¤Î¥×¥í¥»¥¹Æâ¤Ç¤Î¤ß»þ´Ö¤ò·×¬¤¹¤ë¾ì¹ç¤Ï¡¢ +¥×¥í¥»¥¹Ëè¤ËŬÍѤ¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.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. +»þ´Ö¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¡¢ÁêÂÐŪ¤Ê»þ´Ö´Ö³Ö¤Î¥¿¥¤¥Þ¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¤¬¡¢ +ÀäÂÐŪ¤Ê»þÅÀ¤Î¥¿¥¤¥Þ¤Ï±Æ¶Á¤ò¼õ¤±¤ë¡£ +.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 ÆÃÍ­)" +.\" 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. +CPU ¤Ë¤è¤ë¹âʬ²òǽ¤Î¥×¥í¥»¥¹Ëè¤Î¥¿¥¤¥Þ¡£ +.TP +.B CLOCK_THREAD_CPUTIME_ID +.\"O Thread-specific CPU-time clock. +¥¹¥ì¥Ã¥É¸ÇÍ­¤Î 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 +.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. +.\" 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" +.SH ½àµò +SUSv2, POSIX.1-2001. +.\"O .SH AVAILABILITY +.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 +.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) ¤òÊÖ¤¹¤«¤â¤·¤ì¤Ê¤¤¡£ +.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 ¾å¤Ëα¤Þ¤Ã¤Æ¤¤¤ë¤³¤È¤¬ +ÊݾڤǤ­¤ë¾ì¹ç¤Ë¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +.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 +.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" +.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) diff --git a/draft/man2/clock_nanosleep.2 b/draft/man2/clock_nanosleep.2 new file mode 100644 index 00000000..2ca785b9 --- /dev/null +++ b/draft/man2/clock_nanosleep.2 @@ -0,0 +1,411 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 +.\" +.TH CLOCK_NANOSLEEP 2 2008-07-09 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O clock_nanosleep \- high-resolution sleep with specifiable clock +clock_nanosleep \- »ØÄꤷ¤¿¥¯¥í¥Ã¥¯¤Ç¤Î¹âÀºÅ٤ʼ¹ÔÄä»ß (sleep) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.nf +.sp +.BI "int clock_nanosleep(clockid_t " clock_id ", int " flags , +.BI " const struct timespec *" request , +.BI " struct timespec *" remain ); +.fi +.sp +.\"O Link with \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) +»²¾È): +.in +.sp +.BR clock_nanosleep (): +_XOPEN_SOURCE\ >=\ 600 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Like +.\"O .BR nanosleep (2), +.\"O .BR clock_nanosleep () +.\"O allows the caller 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) +¤È°ã¤¦¤Î¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¤¬Ää»ß´ü´Ö¤ò¤É¤Î¥¯¥í¥Ã¥¯¤ËÂФ·¤Æ·×¬¤¹¤ë¤Î¤«¤òÁªÂò +¤Ç¤­¤ëÅÀ¤È¡¢Ää»ß´ü´Ö¤òÀäÂÐÃͤǤâÁêÂÐÃͤǤâ»ØÄê¤Ç¤­¤ëÅÀ¤Ç¤¢¤ë¡£ + +.\"O The time values passed to and returned by this call are specified using +.\"O .I timespec +.\"O structures, defined as follows: +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ·¤¿¤ê¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÊÖ¤·¤¿¤ê¤¹¤ë»þ´Ö¤ÎÃÍ¤Ï +.I timespec +¹½Â¤ÂΤò»È¤Ã¤Æ»ØÄꤵ¤ì¤ë¡£¤³¤Î¹½Â¤ÂΤÎÄêµÁ¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.sp +.in +4n +.nf +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds [0 .. 999999999] */ +}; +.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 »þ´Ö¤ò·×¬¤¹¤ë¥×¥í¥»¥¹Ã±°Ì¤Î +¥¯¥í¥Ã¥¯¡£¤³¤Î¥¯¥í¥Ã¥¯¤ÏÀßÄê²Äǽ¤Ç¤¢¤ë¡£ +.\" There is some trickery between glibc and the kernel +.\" to deal with the CLOCK_PROCESS_CPUTIME_ID case. +.PP +.\"O See +.\"O .BR clock_getres (2) +.\"O for further details on these clocks. +¤³¤ì¤é¤Î¥¯¥í¥Ã¥¯¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR clock_getres (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 +¤Ç»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯¤Î¸½ºß¤ÎÃͤ«¤é¤ÎÁêÂÐŪ¤Ê´ü´Ö¤È²ò¼á¤µ¤ì¤ë¡£ + +.\"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 () +¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤ÎÄä»ß¤ò¹Ô¤ï¤º¡¢¤¹¤°¤ËÊ֤롣 + +.\"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 +¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¤¬·Ð²á¤¹¤ë¤Þ¤Ç¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤òÄä»ß¤¹¤ë¡£ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¤ê¡¢¤½¤Î¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë¤è¤¦¤Ê +¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤¿¤ê¤·¤¿¾ì¹ç¤Ë¤â¡¢¥¹¥ì¥Ã¥É¤Î¼Â¹ÔÄä»ß¤Ï½ªÎ»¤¹¤ë¡£ + +.\"O If the call is interrupted by a signal handler, +.\"O .BR clock_nanosleep () +.\"O returns \-1, and sets +.\"O .I errno +.\"O to +.\"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 () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B EINTR +¤òÀßÄꤹ¤ë¡£¤½¤ì¤Ë²Ã¤¨¤Æ¡¢ +.I remain +¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä +.I flags +¤¬ +.B TIMER_ABSTIME +¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +.I remain +¤Ë»Ä¤ê¤ÎÄä»ß»þ´Ö¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤ÎÃͤò»È¤Ã¤Æ +.BR clock_nanosleep () +¤òºÆÅٸƤӽФ¹¤³¤È¤Ç¡¢(ÁêÂÐŪ¤Ê´ü´Ö¤Î) Ää»ß¤ò´°Î»¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SH "RETURN VALUE" +.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 a positive error number. +Í׵ᤵ¤ì¤¿´ü´Ö¤ÎÄä»ß¤ËÀ®¸ù¤¹¤ë¤È¡¢ +.BR clock_nanosleep () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ç³ä¤ê¹þ¤Þ¤ì¤¿¤ê¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤ê¤·¤¿¾ì¹ç¡¢ +Àµ¤Î¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.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 +.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 +.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" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.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 ¤¬¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤ò +¤â¤¦°ìÅټ¹ԤǤ­¤ë¤è¤¦¤Ë¤Ê¤ë¤Þ¤Ç¤Ë¤Ï¡¢Ãٱ䤬Æþ¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ + +.\"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 () +¤ò¸Æ¤Ó½Ð¤¹¡£ + +.\"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 () +¤¬ºÆ³«¤µ¤ì¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£ + +.\"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 +°ú¤­¿ô¤ò»È¤Ã¤ÆºÆÅٸƤӽФ¹¤³¤È¤¬¤Ç¤­¤ë)¡£ + +.\"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 () +¤Ï¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤ä¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡¢¤È¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"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 () +¤Ï¤¹¤°¤ËÊ֤뤳¤È¤Ë¤Ê¤ë¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR clock_getres (2), +.BR nanosleep (2), +.BR timer_create (2), +.BR sleep (3), +.BR usleep (3), +.BR time (7) diff --git a/draft/man2/clone.2 b/draft/man2/clone.2 new file mode 100644 index 00000000..4a64b6a4 --- /dev/null +++ b/draft/man2/clone.2 @@ -0,0 +1,1831 @@ +.\" 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 2009-07-18 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O clone, __clone2 \- create a child process +.SH ̾Á° +clone, __clone2 \- »Ò¥×¥í¥»¥¹¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.\" 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 towards 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 downwards 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 is not yet complete, +.\"O but probably will be mostly complete by about Linux 2.6.28.) +(¤³¤Î¥Õ¥é¥°¤Î¼ÂÁõ¤Ï¤Þ¤À´°Î»¤·¤Æ¤¤¤Ê¤¤¤¬¡¢ +¤ª¤½¤é¤¯ Linux 2.6.28 ¤¢¤¿¤ê¤Þ¤Ç¤Ë¤Ï¤Û¤Ü´°À®¤¹¤ë¤³¤È¤À¤í¤¦¡£) + +.\"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 (2) +.\"O will produce processes with PIDs that are unique within the namespace. +PID ̾Á°¶õ´Ö¤Ï¡¢PID ¤Ë´Ø¤·¤ÆʬΥ¤µ¤ì¤¿´Ä¶­¤òÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¿·¤·¤¤Ì¾Á°¶õ´Ö¤Ë¤ª¤±¤ë PID ¤Ï 1 ¤«¤é»Ï¤Þ¤ê +(¤³¤ì¤Ï¥¹¥¿¥ó¥É¥¢¥í¥ó¤Î¥·¥¹¥Æ¥à¤È»÷¤¿¤è¤¦¤Ê´¶¤¸)¡¢ +.BR fork (2), +.BR vfork (2), +.BR clone (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¤½¤Î̾Á°¶õ´Ö¤Ç°ì°Õ¤Ê 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 (2) +¤ò»È¤Ã¤ÆÀ¸À®¤·¤¿¥¹¥ì¥Ã¥É¤Ë¤Ï +.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 (2) +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ç¤Î½õ¤±¤¬É¬ÍפÀ¤¬¡¢¸½¾õ¤Î¼ÂÁõ¤Ç¤Ï¡¢ +¤¢¤ë¾õ¶·²¼¤Ë¤ª¤¤¤Æ¥­¥ã¥Ã¥·¥å¤¬ºÇ¿·¤È¤Ê¤é¤Ê¤¤²ÄǽÀ­¤¬¤¢¤ë¡£ +.\"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 () +.\"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 () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¤½¤ì¤Þ¤Ç¤Ë clone ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬»Ò¥×¥í¥»¥¹¤Î PID ¥­¥ã¥Ã¥·¥å¤ò +¹¹¿·¤¹¤ëµ¡²ñ¤¬ÆÀ¤é¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹ ("¿Æ¥×¥í¥»¥¹") ¤Î PID ¤¬ +ÊÖ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.\"O (This discussion ignores the case where the child was created using +.\"O .BR CLONE_THREAD , +.\"O when +.\"O .BR getpid () +.\"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 () +¤Ï»Ò¥×¥í¥»¥¹¤È +.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 new file mode 100644 index 00000000..df7d70a0 --- /dev/null +++ b/draft/man2/close.2 @@ -0,0 +1,218 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 Wed Jul 21 22:40:25 1993 by Rik Faith +.\" Modified Sat Feb 18 15:27:48 1995 by Michael Haardt +.\" Modified Sun Apr 14 11:40:50 1996 by Andries Brouwer : +.\" 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 +.\" 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 ¥¯¥©¡¼¥¿ +.\" +.TH CLOSE 2 2007-12-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O close \- close a file descriptor +close \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int close(int " fd ); +.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) +»²¾È) ¤Î¤¦¤Á¡¢¤½¤Î¥×¥í¥»¥¹¤¬ÊÝÍ­¤·¤Æ¤¤¤ë¤â¤Î¤Ï¡¢ +(¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥í¥Ã¥¯¼èÆÀ¤ËÍøÍѤµ¤ì¤¿¤« +¤É¤¦¤«¤Ë¤è¤é¤º) ¤¹¤Ù¤Æºï½ü¤µ¤ì¤ë¡£ +.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" +.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 +.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. +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" +.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 ¤ä¥Ç¥£¥¹¥¯¡¦¥¯¥©¡¼¥¿¤ò»ÈÍѤ·¤¿¾ì¹ç¤Ë¸«¤é¤ì¤ë¡£ +.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) +¤ò¹Ô¤Ã¤¿»þÅÀ¤Ç¡¢¥Ç¡¼¥¿¤ÎÊݸ¤Ï¥Ç¥£¥¹¥¯¤Î¥Ï¡¼¥É¥¦¥§¥¢¤Ë°Í¸¤¹¤ë +ÌäÂê¤È¤Ê¤ë)¡£ +.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 +.\" in use by a system call is closed and then reused by e.g. an +.\" independent open() in some unrelated thread, before the original system +.\" 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) diff --git a/draft/man2/connect.2 b/draft/man2/connect.2 new file mode 100644 index 00000000..60304567 --- /dev/null +++ b/draft/man2/connect.2 @@ -0,0 +1,440 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from /usr/include/sys/socket.h, which does not have +.\" any authorship information in it. It is probably available under the GPL. +.\" +.\" 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. +.\" +.\" +.\" Other portions are from the 6.9 (Berkeley) 3/10/91 man page: +.\" +.\" Copyright (c) 1983 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. +.\" +.\" Modified 1997-01-31 by Eric S. Raymond +.\" 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 +.SH ̾Á° +.\"O connect \- initiate a connection on a socket +connect \- ¥½¥±¥Ã¥È¤ÎÀܳ¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.\"O .BR "#include " " /* See NOTES */" +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.br +.B #include +.sp +.BI "int connect(int " sockfd ", const struct sockaddr *" addr , +.BI " socklen_t " addrlen ); +.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) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"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 +¤Ç»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿¥½¥±¥Ã¥È¤ËÂФ¹¤ëÀܳ¤Î +ºîÀ®¤ò»î¤ß¤ë¡£ +.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" +.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 +.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 +.B EADDRINUSE +.\"O Local address is already in use. +¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤¬´û¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +.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 +.B EFAULT +.\"O The socket structure address is outside the user's address space. +¥½¥±¥Ã¥È¹½Â¤ÂΤΥ¢¥É¥ì¥¹¤¬¥æ¡¼¥¶¡¼¤Î¥¢¥É¥ì¥¹¶õ´Ö³°¤Ë¤¢¤ë¡£ +.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. +¥½¥±¥Ã¥È¤Ï´û¤ËÀܳ (connect) ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ENETUNREACH +.\"O Network is unreachable. +Åþã¤Ç¤­¤Ê¤¤¥Í¥Ã¥È¥ï¡¼¥¯¤Ç¤¢¤ë¡£ +.TP +.B ENOTSOCK +.\"O The file descriptor is not associated with a socket. +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤¬¥½¥±¥Ã¥È¤È´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +.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" +.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 ¤Ç¤Ï¡¢°ìÈÌŪ¤Ê¥¨¥é¡¼¡¦¥³¡¼¥É¤È¤·¤Æ +.\" .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 +.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 ·Ï) ¤Ç¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬ +ɬÍפǤ¢¤ê¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò +¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬¸­ÌÀ¤Ç¤¢¤í¤¦¡£ + +.\"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) +¤â»²¾È¤Î¤³¤È¡£ +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR accept (2), +.BR bind (2), +.BR getsockname (2), +.BR listen (2), +.BR socket (2), +.BR path_resolution (7) diff --git a/draft/man2/create_module.2 b/draft/man2/create_module.2 new file mode 100644 index 00000000..72aeebc5 --- /dev/null +++ b/draft/man2/create_module.2 @@ -0,0 +1,97 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-29, Akihiro MOTOKI +.\" +.TH CREATE_MODULE 2 2007-06-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O create_module \- create a loadable module entry +create_module \- ¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Î¥¨¥ó¥È¥ê¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "caddr_t create_module(const char *" name ", size_t " size ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR create_module () +.\"O attempts to create a loadable module entry and reserve the kernel memory +.\"O that will be needed to hold the module. +.\"O This system call requires privilege. +.BR create_module () +¤Ï¡¢¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Î¥¨¥ó¥È¥ê¤òºîÀ®¤·¡¢¤½¤Î¥â¥¸¥å¡¼¥ë¤ÎÊÝ»ý¤ËɬÍ×¤Ê +¥«¡¼¥Í¥ë¥á¥â¥ê¤òͽÌ󤷤褦¤È¤¹¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, returns the kernel address at which the module will reside. +.\"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 A module by that name already exists. +¤½¤Î̾Á°¤Î¥â¥¸¥å¡¼¥ë¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¡£ +.TP +.B EFAULT +.\"O .I name +.\"O is outside the program's accessible address space. +.I name +¤¬¥×¥í¥°¥é¥à¤¬¥¢¥¯¥»¥¹¤Ç¤­¤ë¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤Ë¤¢¤ë¡£ +.TP +.B EINVAL +.\"O The requested size is too small even for the module header information. +Í׵ᤷ¤¿¥µ¥¤¥º¤¬¾®¤µ¤¹¤®¤Æ¡¢¥â¥¸¥å¡¼¥ë¤Î¥Ø¥Ã¥À¾ðÊ󤹤é³ÊǼ¤Ç¤­¤Ê¤¤¡£ +.TP +.B ENOMEM +.\"O The kernel could not allocate a contiguous block of memory large +.\"O enough for the module. +¥â¥¸¥å¡¼¥ë¤ò³ÊǼ¤¹¤ë¤Î¤ËɬÍפÊÂ礭¤µ¤ÎϢ³¤·¤¿¥á¥â¥ê¥Ö¥í¥Ã¥¯¤ò +¥«¡¼¥Í¥ë¤¬³ÎÊݤǤ­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOSYS +.\"O .BR create_module () +.\"O is not supported in this version of the kernel. +.BR create_module () +¤¬¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EPERM +.\"O The caller was not privileged +.\"O (did not have the +.\"O .B CAP_SYS_MODULE +.\"O capability). +¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢ +.RB ( CAP_SYS_MODULE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O This system call is only present on Linux up until kernel 2.4; +.\"O it was removed in Linux 2.6. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¤Î¤Ï¥«¡¼¥Í¥ë 2.4 ¤Þ¤Ç¤Î Linux ¤À¤±¤Ç¤¢¤ë¡£ +Linux 2.6 ¤Ç¤Ïºï½ü¤µ¤ì¤¿¡£ +.\" Removed in Linux 2.5.48 +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR create_module () +.\"O is Linux-specific. +.BR create_module () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR delete_module (2), +.BR init_module (2), +.BR query_module (2) diff --git a/draft/man2/delete_module.2 b/draft/man2/delete_module.2 new file mode 100644 index 00000000..eb4cb677 --- /dev/null +++ b/draft/man2/delete_module.2 @@ -0,0 +1,88 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-29, Akihiro MOTOKI +.\" +.TH DELETE_MODULE 2 2006-02-09 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O delete_module \- delete a loadable module entry +delete_module \- ¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Î¥¨¥ó¥È¥ê¤òºï½ü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int delete_module(const char *" name ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR delete_module () +.\"O attempts to remove an unused loadable module entry. +.\"O If +.\"O .I name +.\"O is NULL, +.\"O all unused modules marked auto-clean will be removed. +.\"O This system call requires privilege. +.BR delete_module () +¤Ï¡¢Ì¤»ÈÍÑ¤Î¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Î¥¨¥ó¥È¥ê¤òºï½ü¤·¤è¤¦¤È¤¹¤ë¡£ +.I name +¤¬ NULL ¤Î¾ì¹ç¡¢Ì¤»ÈÍѤΥ⥸¥å¡¼¥ë¤Î¤¦¤Á¡Ö¼«Æ°ºï½ü (auto-clean)¡× +¥Þ¡¼¥¯¤¬¤Ä¤¤¤¿¤â¤Î¤òÁ´¤Æºï½ü¤¹¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£ +.\"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 The module is in use. +¤½¤Î¥â¥¸¥å¡¼¥ë¤Ï»ÈÍÑÃæ¤Ç¤¢¤ë¡£ +.TP +.B EFAULT +.\"O .I name +.\"O is outside the program's accessible address space. +.I name +¤¬¥×¥í¥°¥é¥à¤¬¥¢¥¯¥»¥¹¤Ç¤­¤ë¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤Ë¤¢¤ë¡£ +.TP +.B EINVAL +.\"O .I name +.\"O was an empty string. +.I name +¤¬¶õʸ»úÎó¤Ç¤¢¤ë¡£ +.TP +.B ENOENT +.\"O No module by that name exists. +¤½¤Î̾Á°¤Î¥â¥¸¥å¡¼¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B EPERM +.\"O The caller was not privileged +.\"O (did not have the +.\"O .B CAP_SYS_MODULE +.\"O capability). +¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢ +.RB ( CAP_SYS_MODULE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR delete_module () +.\"O is Linux-specific. +.BR delete_module () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR create_module (2), +.BR init_module (2), +.BR query_module (2) diff --git a/draft/man2/dup.2 b/draft/man2/dup.2 new file mode 100644 index 00000000..9a32bbcf --- /dev/null +++ b/draft/man2/dup.2 @@ -0,0 +1,363 @@ +.\" 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) 2005, 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 1993-07-21, Rik Faith +.\" Modified 1994-08-21, Michael Chastain : +.\" Fixed typoes. +.\" Modified 1997-01-31, Eric S. Raymond +.\" Modified 2002-09-28, aeb +.\" 2009-01-12, mtk, reordered text in DESCRIPTION and added some +.\" 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 2008-10-09 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O dup, dup2, dup3 \- duplicate a file descriptor +.SH ̾Á° +dup, dup2, dup3 \- ¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊ£À½¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int dup(int " oldfd ); +.BI "int dup2(int " oldfd ", int " newfd ); +.sp +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int dup3(int " oldfd ", int " newfd ", int " flags ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These system calls create a copy of the file descriptor +.\"O .IR oldfd . +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I oldfd +¤ÎÊ£À½¤òºî¤ë¡£ + +.\"O .BR dup () +.\"O uses the lowest-numbered unused descriptor for the new descriptor. +.BR dup () +¤ÏºÇ¤â¾®¤µ¤¤ÈÖ¹æ¤Î̤»ÈÍѤΥǥ£¥¹¥¯¥ê¥×¥¿¤ò +¿·¤·¤¤¥Ç¥£¥¹¥¯¥ê¥×¥¿¤È¤·¤Æ»ÈÍѤ¹¤ë¡£ + +.\"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 +¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +°Ê²¼¤ÎÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.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 +¤Ï¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.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 +¤òÊÖ¤¹¡£ +.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) +¤ò»È¤Ã¤Æ¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤òÊѹ¹¤·¤¿¾ì¹ç¡¢¤â¤¦°ìÊý¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î +¥ª¥Õ¥»¥Ã¥È¤âÊѲ½¤¹¤ë¡£ + +.\"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 ¤È¤Ê¤ë¡£ + +.\"O .BR dup3 () +.\"O is the same as +.\"O .BR dup2 (), +.\"O except that: +.BR dup3 () +¤Ï +.BR dup2 () +¤ÈƱ¤¸¤À¤¬¡¢°Ê²¼¤ÎÅÀ¤¬°Û¤Ê¤ë¡£ +.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 +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.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" +.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 +.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 +.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 +¤Ë̵¸ú¤ÊÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.\" 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 +.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" +.SH ½àµò +.BR dup (), +.BR dup2 (): +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 +.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 +¤òÊÖ¤¹¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR fcntl (2), +.BR open (2) diff --git a/draft/man2/epoll_create.2 b/draft/man2/epoll_create.2 new file mode 100644 index 00000000..5b39a681 --- /dev/null +++ b/draft/man2/epoll_create.2 @@ -0,0 +1,217 @@ +.\" +.\" 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 new file mode 100644 index 00000000..ffc8a7b9 --- /dev/null +++ b/draft/man2/epoll_ctl.2 @@ -0,0 +1,449 @@ +.\" +.\" 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 +.\" +.\" 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 2009-01-17 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O epoll_ctl \- control interface for an epoll descriptor +epoll_ctl \- epoll ¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÁàºî¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int epoll_ctl(int " epfd ", int " op ", int " fd \ +", struct epoll_event *" event ); +.\"O .SH DESCRIPTION +.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 +¤Î¼Â¹Ô¤¬Í׵ᤵ¤ì¤ë¡£ + +.\"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 ¤Ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë +(⤷¡¢²¼µ­¤Î¡Ö¥Ð¥°¡×¤ò»²¾È)¡£ +.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 +¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.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 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 +¤ËÀßÄꤹ¤ëɬÍפϤʤ¤¡£ +.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 +.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 +°ú¤­¿ô¤Ë»ØÄê¤Ç¤­¤ëÍ­¸ú¤ÊÃͤϡ¢°Ê²¼¤ÎÄ̤ê: +.\"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 +.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 +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR epoll_create (2), +.BR epoll_wait (2), +.BR poll (2), +.BR epoll (7) diff --git a/draft/man2/epoll_wait.2 b/draft/man2/epoll_wait.2 new file mode 100644 index 00000000..62c967f2 --- /dev/null +++ b/draft/man2/epoll_wait.2 @@ -0,0 +1,308 @@ +.\" +.\" 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/eventfd.2 b/draft/man2/eventfd.2 new file mode 100644 index 00000000..06f7f574 --- /dev/null +++ b/draft/man2/eventfd.2 @@ -0,0 +1,645 @@ +.\" Copyright (C) 2008 Michael Kerrisk +.\" starting from a version by 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 +.\" +.\" 2008-10-10, mtk: describe eventfd2(), and EFD_NONBLOCK and EFD_CLOEXEC +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-04-08, Akihiro MOTOKI +.\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.13 +.\" +.TH EVENTFD 2 2009-01-26 Linux "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O eventfd \- create a file descriptor for event notification +eventfd \- ¥¤¥Ù¥ó¥ÈÄÌÃÎÍѤΥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int eventfd(unsigned int " initval ", int " flags ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR eventfd () +.\"O creates an "eventfd object" that can be used as +.\"O an event wait/notify mechanism by userspace applications, +.\"O and by the kernel to notify userspace applications of events. +.\"O The object contains an unsigned 64-bit integer +.\"O .RI ( uint64_t ) +.\"O counter that is maintained by the kernel. +.\"O This counter is initialized with the value specified in the argument +.\"O .IR initval . +.BR eventfd () +¤Ï "eventfd ¥ª¥Ö¥¸¥§¥¯¥È" ¤òÀ¸À®¤¹¤ë¡£ +eventfd ¥ª¥Ö¥¸¥§¥¯¥È¤Ï¥æ¡¼¥¶¶õ´Ö¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¥¤¥Ù¥ó¥ÈÂÔ¤Á¼õ¤±/ÄÌÃÎÍѤΠ+»ÅÁȤߤȤ·¤Æ»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£¤Þ¤¿¡¢¥«¡¼¥Í¥ë¤¬¥æ¡¼¥¶¶õ´Ö¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë +¥¤¥Ù¥ó¥È¤òÄÌÃΤ¹¤ë¤¿¤á¤Ë¤â»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ï¡¢unsigned ¤Î 64 ¥Ó¥Ã¥ÈÀ°¿ô +.RI ( uint64_t ) +·¿¤Î¥«¥¦¥ó¥¿¤¬´Þ¤Þ¤ì¤Æ¤ª¤ê¡¢¤³¤Î¥«¥¦¥ó¥¿¤Ï¥«¡¼¥Í¥ë¤Ë¤è¤ê´ÉÍý¤µ¤ì¤ë¡£ +¤³¤Î¥«¥¦¥ó¥¿¤Ï +.I initval +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿Ãͤǽé´ü²½¤µ¤ì¤ë¡£ + +.\"O Starting with Linux 2.6.27, the following values may be bitwise ORed in +.\"O .IR flags +.\"O to change the behaviour of +.\"O .BR eventfd (): +Linux 2.6.27 °Ê¹ß¤Ç¤Ï¡¢ +°Ê²¼¤ÎÃͤΤ¤¤¯¤Ä¤«¤ò¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýÏ (OR) ¤Ç»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +.BR eventfd () +¤Î¿¶Éñ¤¤¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 14 +.B EFD_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) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.TP +.B EFD_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 +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O In Linux up to version 2.6.26, the +.\"O .I flags +.\"O argument is unused, and must be specified as zero. +¥Ð¡¼¥¸¥ç¥ó 2.6.26 °ÊÁ°¤Î Linux ¤Ç¤Ï¡¢ +.I flags +°ú¤­¿ô¤Ï̤»ÈÍѤǤ¢¤ê¡¢0 ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O As its return value, +.\"O .BR eventfd () +.\"O returns a new file descriptor that can be used to refer to the +.\"O eventfd object. +.\"O The following operations can be performed on the file descriptor: +.BR eventfd () +¤Ï eventfd ¥ª¥Ö¥¸¥§¥¯¥È¤ò»²¾È¤¹¤ë¤Î¤Ë»ÈÍѤǤ­¤ë¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +¤òÊÖ¤¹¡£ÊÖ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ¤Ï°Ê²¼¤ÎÁàºî¤ò¼Â¹Ô¤Ç¤­¤ë¡£ +.TP +.BR read (2) +.\"O If the eventfd counter has a nonzero value, then a +.\"O .BR read (2) +.\"O returns 8 bytes containing that value, +.\"O and the counter's value is reset to zero. +.\"O (The returned value is in host byte order, +.\"O i.e., the native byte order for integers on the host machine.) +eventfd ¥«¥¦¥ó¥¿¤¬ 0 °Ê³°¤ÎÃͤξì¹ç¡¢ +.BR read (2) +¤Ï¥«¥¦¥ó¥¿Ãͤò³ÊǼ¤·¤¿ 8 ¥Ð¥¤¥È¤ÎÃͤòÊÖ¤·¡¢ +¥«¥¦¥ó¥¿ÃÍ¤Ï 0 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë +(ÊÖ¤êÃͤϥۥ¹¥È¡¦¥Ð¥¤¥È¥ª¡¼¥À¡¢¤Ä¤Þ¤ê +¥Û¥¹¥È¥Þ¥·¥ó¤ÇÀ°¿ôɽ¸½¤ËËÜÍè»ÈÍѤµ¤ì¤ë¥Ð¥¤¥È¥ª¡¼¥À¤Ç³ÊǼ¤µ¤ì¤ë)¡£ +.IP +.\"O If the counter is zero at the time of the +.\"O .BR read (2), +.\"O then the call either blocks until the counter becomes nonzero, +.\"O or fails with the error +.\"O .B EAGAIN +.\"O if the file descriptor has been made nonblocking. +.BR read (2) +¤Î»þÅÀ¤Ç¥«¥¦¥ó¥¿¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR read (2) +¤Ï¥«¥¦¥ó¥¿¤¬ 0 °Ê³°¤Ë¤Ê¤ë¤Þ¤ÇÄä»ß (block) ¤¹¤ë¡¢ +¤â¤·¤¯¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÈóÄä»ß (nonblocking) +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¡£ +.IP +.\"O A +.\"O .BR read (2) +.\"O will fail with the error +.\"O .B EINVAL +.\"O if the size of the supplied buffer is less than 8 bytes. +ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤¬ 8 ¥Ð¥¤¥È̤Ëþ¤Î¾ì¹ç¡¢ +.BR read (2) +¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.BR write (2) +.\"O A +.\"O .BR write (2) +.\"O call adds the 8-byte integer value supplied in its +.\"O buffer to the counter. +.\"O The maximum value that may be stored in the counter is the largest +.\"O unsigned 64-bit value minus 1 (i.e., 0xfffffffffffffffe). +.BR write (2) +¤Ï¡¢°ú¤­¿ô¤Î¥Ð¥Ã¥Õ¥¡¤ÇÅϤµ¤ì¤¿ 8 ¥Ð¥¤¥È¤ÎÀ°¿ôÃͤò¥«¥¦¥ó¥¿¤Ë²Ã»»¤¹¤ë¡£ +¥«¥¦¥ó¥¿¤Ë³ÊǼ²Äǽ¤ÊºÇÂçÃÍ¤Ï unsigned ¤Î 64 ¥Ó¥Ã¥ÈÀ°¿ô¤ÎºÇÂçÃͤ«¤é +1 ¤ò°ú¤¤¤¿ÃÍ (¤¹¤Ê¤ï¤Á 0xfffffffffffffffe) ¤Ç¤¢¤ë¡£ +.\"O If the addition would cause the counter's value to exceed +.\"O the maximum, then the +.\"O .BR write (2) +.\"O either blocks until a +.\"O .BR read (2) +.\"O is performed on the file descriptor, +.\"O or fails with the error +.\"O .B EAGAIN +.\"O if the file descriptor has been made nonblocking. +²Ã»»¤ò¹Ô¤¦¤È¥«¥¦¥ó¥¿Ãͤ¬ºÇÂçÃͤòĶ²á¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +.BR read (2) +¤¬¼Â¹Ô¤µ¤ì¤ë¤Þ¤Ç¡¢ +.BR write (2) +¤ÏÄä»ß (block) ¤¹¤ë¡¢ +¤â¤·¤¯¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÈóÄä»ß (nonblocking) +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¡£ +.IP +.\"O A +.\"O .BR write (2) +.\"O will fail with the error +.\"O .B EINVAL +.\"O if the size of the supplied buffer is less than 8 bytes, +.\"O or if an attempt is made to write the value 0xffffffffffffffff. +ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤¬ 8 ¥Ð¥¤¥È̤Ëþ¤Î¾ì¹ç¡¢¤â¤·¤¯¤Ï +ÃÍ 0xffffffffffffffff ¤ò½ñ¤­¹þ¤â¤¦¤È¤·¤¿¾ì¹ç¡¢ +.BR write (2) +¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.\"O .BR poll "(2), " select "(2) (and similar)" +.BR poll "(2), " select "(2) (¤ÈƱÍͤÎÁàºî)" +.\"O The returned file descriptor supports +.\"O .BR poll (2) +.\"O (and analogously +.\"O .BR epoll (7)) +.\"O and +.\"O .BR select (2), +.\"O as follows: +ÊÖ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢ +.BR poll (2) +.RB ( epoll (7) +¤âƱ¤¸) ¤ä +.BR select (2) +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤ª¤ê¡¢°Ê²¼¤Î¤è¤¦¤ÊÆ°ºî¤ò¤¹¤ë¡£ +.RS +.IP * 3 +.\"O The file descriptor is readable +.\"O (the +.\"O .BR select (2) +.\"O .I readfds +.\"O argument; the +.\"O .BR poll (2) +.\"O .B POLLIN +.\"O flag) +.\"O if the counter has a value greater than 0. +¥«¥¦¥ó¥¿¤¬ 0 ¤è¤êÂ礭¤¤Ãͤξì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÆɤ߽Ф·²Äǽ¤È¤Ê¤ë +.RB ( select (2) +¤Î +.I readfds +°ú¤­¿ô¤ä +.BR poll (2) +¤Î +.B POLLIN +¥Õ¥é¥°)¡£ +.IP * +.\"O The file descriptor is writable +.\"O (the +.\"O .BR select (2) +.\"O .I writefds +.\"O argument; the +.\"O .BR poll (2) +.\"O .B POLLOUT +.\"O flag) +.\"O if it is possible to write a value of at least "1" without blocking. +¾¯¤Ê¤¯¤È¤âÃÍ "1" ¤ò¡¢Ää»ß (block) ¤òȼ¤ï¤º¤Ë½ñ¤­¹þ¤á¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï½ñ¤­¹þ¤ß²Äǽ¤È¤Ê¤ë +.RB ( select (2) +¤Î +.I writefds +°ú¤­¿ô¤ä +.BR poll (2) +¤Î +.B POLLOUT +¥Õ¥é¥°)¡£ +.IP * +.\"O If an overflow of the counter value was detected, +.\"O then +.\"O .BR select (2) +.\"O indicates the file descriptor as being both readable and writable, and +.\"O .BR poll (2) +.\"O returns a +.\"O .B POLLERR +.\"O event. +¥«¥¦¥ó¥¿ÃͤΥª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¡¢ +.BR select (2) +¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÆɤ߽Ф·²Äǽ¤È½ñ¤­¹þ¤ß²Äǽ¤ÎξÊý¤òÄÌÃΤ·¡¢ +.BR poll (2) +¤Ï +.B POLLERR +¥¤¥Ù¥ó¥È¤òÊÖ¤¹¡£ +.\"O As noted above, +.\"O .BR write (2) +.\"O can never overflow the counter. +.\"O However an overflow can occur if 2^64 +.\"O eventfd "signal posts" were performed by the KAIO +.\"O subsystem (theoretically possible, but practically unlikely). +.\"O If an overflow has occurred, then +.\"O .BR read (2) +.\"O will return that maximum +.\"O .I uint64_t +.\"O value (i.e., 0xffffffffffffffff). +¾å½Ò¤ÎÄ̤ꡢ +.BR write (2) +¤Ç¥«¥¦¥ó¥¿¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢ KAIO ¥µ¥Ö¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ 2^64 ²ó¤Î eventfd "signal posts" ¤¬ +¼Â¹Ô¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬µ¯¤³¤êÆÀ¤ë +(ÍýÏÀŪ¤Ë¤Ï¤¢¤êÆÀ¤ë¤¬¡¢¼ÂÍÑŪ¤Ë¤Ï¤¢¤êÆÀ¤Ê¤¤)¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¡¢ +.BR read (2) +¤Ï +.I uint64_t +¤ÎºÇÂçÃÍ (¤¹¤Ê¤ï¤Á 0xffffffffffffffff) ¤òÊÖ¤¹¡£ +.RE +.IP +.\"O The eventfd file descriptor also supports the other file-descriptor +.\"O multiplexing APIs: +.\"O .BR pselect (2), +.\"O .BR ppoll (2), +.\"O and +.\"O .BR epoll (7). +eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤³¤ì°Ê³°¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +¿½Å API ¤Ç¤¢¤ë +.BR pselect (2), +.BR ppoll (2), +.BR epoll (7) +¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.TP +.BR close (2) +.\"O When the file descriptor is no longer required it should be closed. +.\"O When all file descriptors associated with the same eventfd object +.\"O have been closed, the resources for object are freed by the kernel. +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¤½¤ì°Ê¹ß¤ÏɬÍפʤ¯¤Ê¤Ã¤¿ºÝ¤Ë¤Ï¡¢¥¯¥í¡¼¥º¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Ʊ¤¸ eventfd ¥ª¥Ö¥¸¥§¥¯¥È¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Á´¤Æ +¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¡¢¤½¤Î¥ª¥Ö¥¸¥§¥¯¥ÈÍѤλñ¸»¤¬¥«¡¼¥Í¥ë¤Ë¤è¤ê²òÊü¤µ¤ì¤ë¡£ +.PP +.\"O A copy of the file descriptor created by +.\"O .BR eventfd () +.\"O is inherited by the child produced by +.\"O .BR fork (2). +.\"O The duplicate file descriptor is associated with the same +.\"O eventfd object. +.\"O File descriptors created by +.\"O .BR eventfd () +.\"O are preserved across +.\"O .BR execve (2). +.BR fork (2) +¤ÇÀ¸À®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢ +.BR eventfd () +¤ÇÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +Ê£À½¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏƱ¤¸ eventfd ¥ª¥Ö¥¸¥§¥¯¥È¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç +.BR eventfd () +¤ÇÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÊÝ»ý¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR eventfd () +.\"O returns a new eventfd file descriptor. +.\"O On error, \-1 is returned and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR eventfd () +¤Ï¿·µ¬¤Î eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O .I flags +.\"O is invalid; +.\"O or, in Linux 2.6.26 or earlier, +.\"O .I flags +.\"O is nonzero. +.I flags +¤¬Ìµ¸ú¡£ +Linux 2.6.26 °ÊÁ°¤Ç¤Ï¡¢ +.I flags +¤¬ 0 °Ê³°¤ÎÃÍ¡£ +.TP +.B EMFILE +.\"O The per-process limit on open file descriptors has been reached. +¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô¤¬¥×¥í¥»¥¹¤¢¤¿¤ê¤Î¾å¸Â¤Ë +㤷¤Æ¤¤¤¿¡£ +.TP +.B ENFILE +.\"O The system-wide limit on the total number of open files has been +.\"O reached. +¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ëÁí¿ô¤¬¥·¥¹¥Æ¥àÁ´ÂΤξå¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENODEV +.\" Note from Davide: +.\" The ENODEV error is basically never going to happen if +.\" the kernel boots correctly. That error happen only if during +.\" the kernel initialization, some error occur in the anonymous +.\" inode source initialization. +.\"O Could not mount (internal) anonymous inode device. +(¥«¡¼¥Í¥ëÆâ¤Î) ̵̾ inode ¥Ç¥Ð¥¤¥¹¤ò¥Þ¥¦¥ó¥È¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O There was insufficient memory to create a new +.\"O eventfd file descriptor. +¿·¤·¤¤ eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR eventfd () +.\"O is available on Linux since kernel 2.6.22. +.\"O Working support is provided in glibc since version 2.8. +.BR eventfd () +¤Ï¥«¡¼¥Í¥ë 2.6.22 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +Àµ¤·¤¯Æ°ºî¤¹¤ë glibc ¦¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.8 °Ê¹ß¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\" eventfd() is in glibc 2.7, but reportedly does not build +.\"O The +.\"O .BR eventfd2 () +.\"O system call (see NOTES) is available on Linux since kernel 2.6.27. +.BR eventfd2 () +¥·¥¹¥Æ¥à¥³¡¼¥ë (¡ÖÃí°Õ¡×»²¾È) ¤Ï +¥«¡¼¥Í¥ë 2.6.27 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O Since version 2.9, the glibc +.\"O .BR eventfd () +.\"O wrapper will employ the +.\"O .BR eventfd2 () +.\"O system call, if it is supported by the kernel. +¥Ð¡¼¥¸¥ç¥ó 2.9 °Ê¹ß¤Ç¤Ï¡¢glibc ¤Î +.BR eventfd () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥«¡¼¥Í¥ë¤¬Âбþ¤·¤Æ¤¤¤ì¤Ð +.BR eventfd2 () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍøÍѤ¹¤ë¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O .BR eventfd () +.\"O and +.\"O .BR eventfd2 () +.\"O are Linux-specific. +.BR eventfd () +¤È +.BR eventfd2 () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Applications can use an eventfd file descriptor instead of a pipe (see +.\"O .BR pipe (2)) +.\"O in all cases where a pipe is used simply to signal events. +.\"O The kernel overhead of an eventfd file descriptor +.\"O is much lower than that of a pipe, +.\"O and only one file descriptor is +.\"O required (versus the two required for a pipe). +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢¥Ñ¥¤¥×¤ò¥¤¥Ù¥ó¥È¤òÄÌÃΤ¹¤ë¤¿¤á¤À¤±¤Ë»ÈÍѤ·¤Æ¤¤¤ë +Á´¤Æ¤Î¾ìÌ̤ˤª¤¤¤Æ¡¢¥Ñ¥¤¥×¤ÎÂå¤ï¤ê¤Ë eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»È¤¦Êý¤¬¡¢¥Ñ¥¤¥×¤ò»È¤¦¾ì¹ç¤ËÈæ¤Ù¤Æ +¥«¡¼¥Í¥ë¤Ç¤Î¥ª¡¼¥Ð¥Ø¥Ã¥É¤ÏÈæ¤Ù¤ë¤È¤º¤Ã¤È¾®¤µ¤¯¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤â +°ì¤Ä¤·¤«É¬ÍפȤ·¤Ê¤¤ (¥Ñ¥¤¥×¤Î¾ì¹ç¤ÏÆó¤ÄɬÍפǤ¢¤ë)¡£ + +.\"O When used in the kernel, an eventfd +.\"O file descriptor can provide a kernel-userspace bridge allowing, +.\"O for example, functionalities like KAIO (kernel AIO) +.\"O .\" or eventually syslets/threadlets +.\"O to signal to a file descriptor that some operation is complete. +¥«¡¼¥Í¥ëÆâ¤Ç»ÈÍѤ¹¤ë¤È¡¢eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +¥«¡¼¥Í¥ë¶õ´Ö¤È¥æ¡¼¥¶¶õ´Ö¤Î¥Ö¥ê¥Ã¥¸µ¡Ç½¤òÄ󶡤¹¤ë¤³¤È¤¬¤Ç¤­¡¢ +Î㤨¤Ð KAIO (kernel AIO) +.\" ¤ä eventually syslets/threadlets +¤Î¤è¤¦¤Êµ¡Ç½¤¬¡¢¤¢¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë²¿¤é¤«¤ÎÁàºî¤¬´°Î»¤·¤¿¤³¤È¤ò +ÄÌÃΤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O A key point about an eventfd file descriptor is that it can be +.\"O monitored just like any other file descriptor using +.\"O .BR select (2), +.\"O .BR poll (2), +.\"O or +.\"O .BR epoll (7). +eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î½ÅÍפÊÅÀ¤Ï¡¢ +eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.BR select (2), +.BR poll (2), +.BR epoll (7) +¤ò»È¤Ã¤Æ¾¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÈÁ´¤¯Æ±Íͤ˴ƻë¤Ç¤­¤ëÅÀ¤Ç¤¢¤ë¡£ +.\"O This means that an application can simultaneously monitor the +.\"O readiness of "traditional" files and the readiness of other +.\"O kernel mechanisms that support the eventfd interface. +.\"O (Without the +.\"O .BR eventfd () +.\"O interface, these mechanisms could not be multiplexed via +.\"O .BR select (2), +.\"O .BR poll (2), +.\"O or +.\"O .BR epoll (7).) +¤³¤Î¤³¤È¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡Ö½¾Íè¤Î (traditional)¡× ¥Õ¥¡¥¤¥ë¤Î¾õÂÖÊѲ½¤È +eventfd ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¥µ¥Ý¡¼¥È¤¹¤ë¾¤Î¥«¡¼¥Í¥ëµ¡¹½¤Î¾õÂÖÊѲ½¤òƱ»þ¤Ë´Æ»ë +¤Ç¤­¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë +.RB ( eventfd () +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬¤Ê¤¤»þ¤Ë¤Ï¡¢¤³¤ì¤é¤Î¥«¡¼¥Í¥ëµ¡¹½¤Ï +.BR select (2), +.BR poll (2), +.BR epoll (7) +·Ðͳ¤Ç¿½Å¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤«¤Ã¤¿)¡£ +.\"O .SS Underlying Linux system calls +.SS ²¼Áؤˤ¢¤ë Linux ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë +.\"O There are two underlying Linux system calls: +.\"O .BR eventfd () +.\"O and the more recent +.\"O .BR eventfd2 (). +.\"O The former system call does not implement a +.\"O .I flags +.\"O argument. +.\"O The latter system call implements the +.\"O .I flags +.\"O values described above. +²¼Áؤˤ¢¤ë Linux ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÆó¼ïÎढ¤ê¡¢ +.BR eventfd () +¤È¡¢¤â¤Ã¤È¿·¤·¤¤ +.BR eventfd2 () +¤Ç¤¢¤ë¡£ +.BR eventfd () +¤Ï +.I flags +°ú¤­¿ô¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¡£ +.BR eventfd2 () +¤Ç¤Ï¾åµ­¤ÎÃͤΠ+.I flags +¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O The glibc wrapper function will use +.\"O .BR eventfd2 () +.\"O where it is available. +glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢ +.BR eventfd2 () +¤¬ÍøÍѲÄǽ¤Ç¤¢¤ì¤Ð¡¢¤³¤ì¤ò»ÈÍѤ¹¤ë¡£ +.\"O .SS Additional glibc features +.SS glibc ¤ÎÄɲõ¡Ç½ +.\"O The GNU C library defines an additional type, +.\"O and two functions that attempt to abstract some of the details of +.\"O reading and writing on an eventfd file descriptor: +GNU C ¥é¥¤¥Ö¥é¥ê¤Ï¡¢eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÆɤ߽Ф·¤È½ñ¤­¹þ¤ß¤Ë +¤ò´Ø¤¹¤ë¾ÜºÙ¤Î¤¤¤¯¤Ä¤«Ãê¾Ý²½¤¹¤ë¤¿¤á¤Ë¡¢°ì¤Ä¤Î·¿¤È¡¢Æó¤Ä¤Î´Ø¿ô¤òÄÉ²Ã¤Ç +ÄêµÁ¤·¤Æ¤¤¤ë¡£ +.in +4n +.nf + +typedef uint64_t eventfd_t; + +int eventfd_read(int fd, eventfd_t *value); +int eventfd_write(int fd, eventfd_t value); +.fi +.in + +.\"O The functions perform the read and write operations on an +.\"O eventfd file descriptor, +.\"O returning 0 if the correct number of bytes was transferred, +.\"O or \-1 otherwise. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ëÆɤ߽Ф·¤È +½ñ¤­¹þ¤ß¤ÎÁàºî¤ò¼Â¹Ô¤·¡¢Àµ¤·¤¤¥Ð¥¤¥È¿ô¤¬Å¾Á÷¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï +0 ¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.\"O .SH EXAMPLE +.SH Îã +.PP +.\"O The following program creates an eventfd file descriptor +.\"O and then forks to create a child process. +.\"O While the parent briefly sleeps, +.\"O the child writes each of the integers supplied in the program's +.\"O command-line arguments to the eventfd file descriptor. +.\"O When the parent has finished sleeping, +.\"O it reads from the eventfd file descriptor. +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤·¡¢ +¤½¤Î¸å fork ¤ò¼Â¹Ô¤·¤Æ»Ò¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¡£ +¿Æ¥×¥í¥»¥¹¤¬¾¯¤·¤Î´Ö sleep ¤¹¤ë´Ö¤Ë¡¢»Ò¥×¥í¥»¥¹¤Ï +¥×¥í¥°¥é¥à¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿À°¿ô(Îó)¤ò¤½¤ì¤¾¤ì +eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë½ñ¤­¹þ¤à¡£ +¿Æ¥×¥í¥»¥¹¤Ï sleep ¤ò´°Î»¤¹¤ë¤È eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é +Æɤ߽Ф·¤ò¹Ô¤¦¡£ + +.\"O The following shell session shows a sample run of the program: +°Ê²¼¤Ë¼¨¤¹¥·¥§¥ë¥»¥Ã¥·¥ç¥ó¤Ë¤³¤Î¥×¥í¥°¥é¥à¤Î»È¤¤Êý¤ò¼¨¤¹¡£ +.in +4n +.nf + +.RB "$" " ./a.out 1 2 4 7 14" +Child writing 1 to efd +Child writing 2 to efd +Child writing 4 to efd +Child writing 7 to efd +Child writing 14 to efd +Child completed write loop +Parent about to read +Parent read 28 (0x1c) from efd +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include +#include /* Definition of uint64_t */ + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int +main(int argc, char *argv[]) +{ + int efd, j; + uint64_t u; + ssize_t s; + + if (argc < 2) { + fprintf(stderr, "Usage: %s ...\\n", argv[0]); + exit(EXIT_FAILURE); + } + + efd = eventfd(0, 0); + if (efd == \-1) + handle_error("eventfd"); + + switch (fork()) { + case 0: + for (j = 1; j < argc; j++) { + printf("Child writing %s to efd\\n", argv[j]); + u = strtoull(argv[j], NULL, 0); + /* strtoull() allows various bases */ + s = write(efd, &u, sizeof(uint64_t)); + if (s != sizeof(uint64_t)) + handle_error("write"); + } + printf("Child completed write loop\\n"); + + exit(EXIT_SUCCESS); + + default: + sleep(2); + + printf("Parent about to read\\n"); + s = read(efd, &u, sizeof(uint64_t)); + if (s != sizeof(uint64_t)) + handle_error("read"); + printf("Parent read %llu (0x%llx) from efd\\n", + (unsigned long long) u, (unsigned long long) u); + exit(EXIT_SUCCESS); + + case \-1: + handle_error("fork"); + } +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR futex (2), +.BR pipe (2), +.BR poll (2), +.BR read (2), +.BR select (2), +.BR signalfd (2), +.BR timerfd_create (2), +.BR write (2), +.BR epoll (7), +.BR sem_overview (7) diff --git a/draft/man2/execve.2 b/draft/man2/execve.2 new file mode 100644 index 00000000..f1668c6a --- /dev/null +++ b/draft/man2/execve.2 @@ -0,0 +1,1023 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 +.\" 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. +.\" +.\" Modified by Michael Haardt +.\" Modified 1993-07-21 by Rik Faith +.\" Modified 1994-08-21 by Michael Chastain : +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 1999-11-12 by Urs Thuermann +.\" Modified 2004-06-23 by Michael Kerrisk +.\" 2006-09-04 Michael Kerrisk +.\" Added list of process attributes that are not preserved on exec(). +.\" 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 +.SH ̾Á° +.\"O execve \- execute program +execve \- ¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int execve(const char *" filename ", char *const " argv "[], " +.br +.BI " char *const " envp []); +.\"O .SH DESCRIPTION +.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 ¤Ï¡¢¥Ð¥¤¥Ê¥ê¼Â¹Ô·Á¼°¤«¡¢ +°Ê²¼¤Î·Á¼°¤Î¹Ô¤Ç»Ï¤Þ¤ë¥¹¥¯¥ê¥×¥È¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.in +4n +.nf +\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 ´Ø¿ô¤ò +°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥¢¥¯¥»¥¹²Äǽ¤Ë¤Ê¤ë¡£ + +.in +4n +.nf +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, ¥¹¥¿¥Ã¥¯¤Ï¡¢ +Æɤ߹þ¤Þ¤ì¤¿¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ¾å½ñ¤­¤µ¤ì¤ë¡£ + +.\"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 ¤Ï +¥×¥í¥°¥é¥à¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×¤ËÊѹ¹¤µ¤ì¤ë¡£ + +.\"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 () +¤ÎÁ°¸å¤ÇÊÝ»ý¤µ¤ì¤ë¡£ +.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))¡£ +.IP * +.\"O Any alternate signal stack is not preserved +.\"O .RB ( sigaltstack (2)). +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Ï¤É¤ì¤âÊÝ»ý¤µ¤ì¤Ê¤¤ +.RB ( sigaltstack (2))¡£ +.IP * +.\"O Memory mappings are not preserved +.\"O .RB ( mmap (2)). +¥á¥â¥ê¥Þ¥Ã¥Ô¥ó¥°¤ÏÊÝ»ý¤µ¤ì¤Ê¤¤ +.RB ( mmap (2))¡£ +.IP * +.\"O Attached System V shared memory segments are detached +.\"O .RB ( shmat (2)). +Éղ䵤줿 (attached) System V ¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤ÏʬΥ¤µ¤ì¤ë +.RB ( shmat (2))¡£ +.IP * +.\"O POSIX shared memory regions are unmapped +.\"O .RB ( shm_open (3)). +POSIX ¶¦Í­¥á¥â¥êÎΰè¤Ï¥Þ¥Ã¥Ô¥ó¥°¤ò²ò½ü¤µ¤ì¤ë +.RB ( shm_open (3))¡£ +.IP * +.\"O Open POSIX message queue descriptors are closed +.\"O .RB ( mq_overview (7)). +¥ª¡¼¥×¥ó¤µ¤ì¤¿ POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¥¯¥í¡¼¥º¤µ¤ì¤ë +.RB ( mq_overview (7))¡£ +.IP * +.\"O Any open POSIX named semaphores are closed +.\"O .RB ( sem_overview (7)). +¥ª¡¼¥×¥ó¤µ¤ì¤¿ POSIX ̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤Ï¤¤¤º¤ì¤â¥¯¥í¡¼¥º¤µ¤ì¤ë +.RB ( sem_overview (7))¡£ +.IP * +.\"O POSIX timers are not preserved +.\"O .RB ( timer_create (2)). +POSIX ¥¿¥¤¥Þ¤ÏÊÝ»ý¤µ¤ì¤Ê¤¤ +.RB ( timer_create (2))¡£ +.IP * +.\"O Any open directory streams are closed +.\"O .RB ( opendir (3)). +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤Ï¤¤¤º¤ì¤â¥¯¥í¡¼¥º¤µ¤ì¤ë +.RB ( opendir (3))¡£ +.IP * +.\"O Memory locks are not preserved +.\"O .RB ( mlock (2), +.\"O .BR mlockall (2)). +¥á¥â¥ê¥í¥Ã¥¯¤ÏÊÝ»ý¤µ¤ì¤Ê¤¤ +.RB ( mlock (2), +.BR mlockall (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))¡£ +.IP * +.\"O The floating-point environment is reset to the default (see +.\"O .BR fenv (3)). +ÉâÆ°¾®¿ôÅÀ´ØÏ¢¤Î´Ä¶­¤Ï¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë +.RB ( fenv (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 () +¤ÎÁ°¸å¤ÇÊÝ»ý¤µ¤ì¤Ê¤¤¡£ +.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 +¥Õ¥é¥°¤Ï¥¯¥ê¥¢¤µ¤ì¤ë¡£¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¤³¤Î¥Õ¥é¥°¤Ï¥»¥Ã¥È¤µ¤ì¤ë¡£ +.IP * +.\"O The +.\"O .BR prctl (2) +.\"O .B PR_SET_KEEPCAPS +.\"O flag is cleared. +.BR prctl (2) +¤Î +.B PR_SET_KEEPCAPS +¥Õ¥é¥°¤Ï¥¯¥ê¥¢¤µ¤ì¤ë¡£ +.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" +¤Çɽ¼¨¤Ç¤­¤ë¡£ +.IP * +.\"O The termination signal is reset to +.\"O .B SIGCHLD +.\"O (see +.\"O .BR clone (2)). +½ªÎ»¥·¥°¥Ê¥ë (termination signal) ¤Ï +.B SIGCHLD +¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë +.RB ( clone (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 ¥ª¥Ö¥¸¥§¥¯¥È¤ÏÊÝ»ý¤µ¤ì¤Ê¤¤¡£ +.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 ¤Ç¤ÏÁ°¼Ô (Êѹ¹¤·¤Ê¤¤) ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.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))¡£ +.IP * +.\"O For the handling of capabilities during +.\"O .BR execve (), +.\"O see +.\"O .BR capabilities (7). +.BR execve (2) +»þ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î°·¤¤¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR capabilities (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 +.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] +.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 +¤Ï°Ê²¼¤Î°ú¤­¿ô¤Çµ¯Æ°¤µ¤ì¤ë¡£ + +.in +4n +.nf +\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¥ï¡¼¥É¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë +(¤Ä¤Þ¤ê¡¢¥Û¥ï¥¤¥È¡¦¥¹¥Ú¡¼¥¹¤ò´Þ¤á¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤)¡£ +²¼µ­¤Î¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¡£ +.\"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)" +¤Î¸Æ¤Ó½Ð¤·¤ÇÆþ¼ê¤Ç¤­¤ë¤«¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë)¡£ + +.\"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 ¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢ +ºÇÂ祵¥¤¥º¤Ï 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" +.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 +.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. +I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EISDIR +.\"O An ELF interpreter was a directory. +ELF ¥¤¥ó¥¿¥×¥ê¥¿¤¬¥Ç¥£¥ì¥¯¥È¥ê¤À¤Ã¤¿¡£ +.TP +.B ELIBBAD +.\"O An ELF interpreter was not in a recognized format. +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 +.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 +.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. +¼Â¹Ô¥Õ¥¡¥¤¥ë¤ò½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤¬¤¢¤ë¡£ +.\"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 +.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 () +¤ÏÀ®¸ù¤¹¤ë¡£ + +.\"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 onwards +.\"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 ) +¤Ë¤Ê¤ë¡£ +.\" 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). +.\" + +.\"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 ÈǤÎÃæ¤Ë¤Ï +.\" .BR execve () +.\" ¤Ë¾¤Î¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤¬ +.\" ¸ºß¤¹¤ë¤â¤Î¤â¤¢¤ê¡¢¹ªÌ¯¤ËºÙ¹©¤µ¤ì¤¿ ELF ¥Ð¥¤¥Ê¥ê¤Ë¤è¤Ã¤Æ +.\" ¥µ¡¼¥Ó¥¹µñÈÝ (denial of service) ¤ËÍøÍѤµ¤ì¤Æ¤·¤Þ¤¦¡£ +.\" 2.0.34 ¤Þ¤¿ 2.2.15 ¤Ë¤Ï¡¢ÃΤé¤ì¤Æ¤¤¤ëÌäÂê¤Ï¤Ê¤¤¡£ +.\"O .SS Historical +.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 +.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¸Ä¤º¤Äɽ¼¨¤¹¤ë¤À¤±¤Î¥×¥í¥°¥é¥à¤Ç¤¢¤ë¡£ + +.in +4n +.nf +/* myecho.c */ + +#include +#include + +int +main(int argc, char *argv[]) +{ + int j; + + for (j = 0; j < argc; j++) + printf("argv[%d]: %s\\n", 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 + +/* execve.c */ + +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + char *newargv[] = { NULL, "hello", "world", NULL }; + char *newenviron[] = { NULL }; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + newargv[0] = argv[1]; + + execve(argv[1], newargv, newenviron); + perror("execve"); /* execve() only returns on error */ + exit(EXIT_FAILURE); +} +.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" +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 +¤ò»È¤¦¥¹¥¯¥ê¥×¥È¤òºîÀ®¤¹¤ë¡£ + +.in +4n +.nf +.RB "$" " cat > script.sh" +.B #! ./myecho script-arg +.B ^D +.RB "$" " chmod +x script.sh" +.fi +.in + +.\"O We can then use our program to exec the script: +ºîÀ®¤·¤Æ¤ª¤¤¤¿¥×¥í¥°¥é¥à¤ò»È¤Ã¤Æ¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤¹¤ë¡£ + +.in +4n +.nf +.RB "$" " ./execve ./script.sh" +argv[0]: ./myecho +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) diff --git a/draft/man2/exit_group.2 b/draft/man2/exit_group.2 new file mode 100644 index 00000000..911b244a --- /dev/null +++ b/draft/man2/exit_group.2 @@ -0,0 +1,74 @@ +.\" Copyright (C) 2004 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. +.\" +.\" 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 +.SH ̾Á° +.\"O exit_group \- exit all threads in a process +exit_group \- ¥×¥í¥»¥¹Ãæ¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤ò exit ¤µ¤»¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void exit_group(int " status ); +.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) +¤ÈÅù¤·¤¤¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤À¤±¤Ç¤Ê¤¯¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Ë +¤¢¤ëÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤ò½ªÎ»¤µ¤»¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +.\"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. +¤³¤Î¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR exit (2) diff --git a/draft/man2/faccessat.2 b/draft/man2/faccessat.2 new file mode 100644 index 00000000..8e7e11ad --- /dev/null +++ b/draft/man2/faccessat.2 @@ -0,0 +1,252 @@ +.\" 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 (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.\"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 new file mode 100644 index 00000000..71d145c2 --- /dev/null +++ b/draft/man2/fallocate.2 @@ -0,0 +1,233 @@ +.\" 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 2009-03-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fallocate \- manipulate file space +fallocate \- ¥Õ¥¡¥¤¥ë¶õ´Ö¤ÎÁàºî +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +#define _GNU_SOURCE +.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 new file mode 100644 index 00000000..00073466 --- /dev/null +++ b/draft/man2/fchmodat.2 @@ -0,0 +1,225 @@ +.\" 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 (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.\"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 new file mode 100644 index 00000000..bc83b20a --- /dev/null +++ b/draft/man2/fchownat.2 @@ -0,0 +1,225 @@ +.\" 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 FCHOWNAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "int fchownat(int " dirfd ", const char *" pathname , +.BI " uid_t " owner ", gid_t " group ", 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 fchownat (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"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) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.\"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) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î +ÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.\"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) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.\"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, 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" +.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 +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR fchownat () +.\"O was added to Linux in kernel 2.6.16. +.BR fchownat () +¤Ï 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 fchownat (). +.BR fchownat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR chown (2), +.BR openat (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/draft/man2/fcntl.2 b/draft/man2/fcntl.2 new file mode 100644 index 00000000..bb066c71 --- /dev/null +++ b/draft/man2/fcntl.2 @@ -0,0 +1,2222 @@ +'\" 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 +¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë¤ÎËöÈø¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤È²ò¼á¤µ¤ì¤ë¡£ +¸å¤í¤Î£²¤Ä¤Î¾ì¹ç¤Ë¤Ï¡¢ +¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤è¤êÁ°¤Ë¤Ê¤é¤Ê¤¤ÈϰϤǡ¢ +.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 flags. +¥Õ¥é¥°¤ÎÃͤòÊÖ¤¹¡£ +.TP +.B F_GETFL +.\"O Value of 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 new file mode 100644 index 00000000..1ee6aa11 --- /dev/null +++ b/draft/man2/flock.2 @@ -0,0 +1,361 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) and +.\" and Copyright 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 Fri Jan 31 16:26:07 1997 by Eric S. Raymond +.\" Modified Fri Dec 11 17:57:27 1998 by Jamie Lokier +.\" Modified 24 Apr 2002 by Michael Kerrisk +.\" Substantial rewrites and additions +.\" 2005-05-10 mtk, noted that lock conversions are not atomic. +.\" +.\" 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 +.\" +.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 +.SH ̾Á° +flock \- ¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥¢¥É¥Ð¥¤¥¶¥ê¡¦¥í¥Ã¥¯¤ÎŬÍÑ¡¢²ò½ü¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int flock(int " fd ", int " operation ); +.\"O .SH DESCRIPTION +.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 +¤Ë¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄꤹ¤ë: +.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. +¤³¤Î¥×¥í¥»¥¹¤¬ÊÝ»ý¤·¤Æ¤¤¤ë´û¸¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë¡£ +.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 +.\"O .IR OR ing) +.\"O with any of the above operations. +.BR flock () +¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤­¤Ë¡¢»ØÄꤷ¤¿¥í¥Ã¥¯¼ïÊ̤Ȱۤʤë¥í¥Ã¥¯¤¬ÊÌ¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ +ÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +.BR flock () +¤ÏÄä»ß (block) ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +ÈóÄä»ß (nonblocking) ¥¿¥¤¥×¤ÎÍ×µá¤ò¹Ô¤¦¤¿¤á¤Ë¤Ï¡¢ +¾åµ­¤ÎÁàºî (operation) ¤Ë +.B LOCK_NB +¤òÏÀÍýϤηÁ¤Ç»ØÄꤹ¤ë¡£ + +.\"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 +Áàºî¤ò»Ø¼¨¤·¤¿¾ì¹ç¤«¡¢¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¤¹¤Ù¤Æ +ÊĤ¸¤é¤ì¤¿¾ì¹ç¤Ë¹Ô¤ï¤ì¤ë¡£ + +.\"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 () +¤Ï¤³¤ì¤éÊ£¿ô¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò³Æ¡¹ÆÈΩ¤Î¤â¤Î¤È¤·¤Æ°·¤¦¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î°ì¤Ä¤ò»È¤Ã¤Æ¥Õ¥¡¥¤¥ë¤ò¥í¥Ã¥¯¤·¤è¤¦¤È +¤·¤¿ºÝ¡¢¤½¤Î¥í¥Ã¥¯Í×µá¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¤½¤Î¥Õ¥¡¥¤¥ë¤ÎÊ̤Π+¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤Ç¤¹¤Ç¤ËÀßÄꤷ¤Æ¤¤¤ë¥í¥Ã¥¯¤Ë¤è¤Ã¤ÆµñÈݤµ¤ì¤ë¾ì¹ç¤¬¤¢¤ë¡£ + +.\"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 () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢´û¸¤Î¥í¥Ã¥¯¤ò¿·¤·¤¤¥í¥Ã¥¯¥â¡¼¥É¤ËÊѹ¹¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£ + +.\"O Locks created by +.\"O .BR flock () +.\"O are preserved across an +.\"O .BR execve (2). +.BR flock () +¤Ë¤è¤êºîÀ®¤µ¤ì¤¿¥í¥Ã¥¯¤Ï +.BR execve (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 +.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 +.B EWOULDBLOCK +.\"O The file is locked and the +.\"O .B LOCK_NB +.\"O flag was selected. +»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤ª¤ê¡¢ +.B LOCK_NB +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.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 +.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 ¾å¤Ç¥í¥Ã¥¯¤¬¤Ç¤­¤ë¡£ +.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 () +¤¬¥Ç¥Ã¥É¥í¥Ã¥¯¤ò¸¡½Ð¤·¤Ê¤¯¤Ê¤ë¡£ +.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 () +¤Î»ÈÍѤË̵»ë¤·¤Æ¡¢¥Õ¥¡¥¤¥ë¤Ø¤ÎÆþ½ÐÎϤò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.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 () +¤ÎÆ°ºî¤Ï¤³¤Î¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤È¤Ï°ã¤¦¤À¤í¤¦¡£ +.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 +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï) ¼ºÇÔ¤·¤¿¤ê¤¹¤ë¡£ +(¤³¤ì¤Ï¸µ¡¹¤Î 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) + +.\"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 ) +¤â»²¾È¤Î¤³¤È¡£ diff --git a/draft/man2/fork.2 b/draft/man2/fork.2 new file mode 100644 index 00000000..d0583171 --- /dev/null +++ b/draft/man2/fork.2 @@ -0,0 +1,398 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2006 Michael Kerrisk +.\" A few fragments remain from an earlier (1992) page by +.\" Drew Eckhardt (drew@cs.colorado.edu), +.\" +.\" 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 Sat Jul 24 13:22:07 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 21 Aug 1994 by Michael Chastain (mec@shell.portal.com): +.\" Referenced 'clone(2)'. +.\" Modified 1995-06-10, 1996-04-18, 1999-11-01, 2000-12-24 +.\" by Andries Brouwer (aeb@cwi.nl) +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" 2006-09-04, Michael Kerrisk +.\" 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 +.SH ̾Á° +.\"O fork \- create a child process +fork \- »Ò¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B pid_t fork(void); +.\"O .SH DESCRIPTION +.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 ¤Ç»²¾È¤µ¤ì¤ë¿·¤·¤¤¥×¥í¥»¥¹¤Ï¡¢°Ê²¼¤ÎÅÀ¤ò½ü¤­¡¢ +\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 ¤È¤â°ìÃפ·¤Ê¤¤¡£ +.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)) +¤ò°ú¤­·Ñ¤¬¤Ê¤¤¡£ +.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 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +.IP * +.\"O The child's set of pending signals is initially empty +.\"O .RB ( sigpending (2)). +»Ò¥×¥í¥»¥¹¤Î½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Î½¸¹ç +.RB ( sigpending (2)) +¤Ï¡¢½é´ü¾õÂ֤Ǥ϶õ¤Ë¤Ê¤ë¡£ +.IP * +.\"O The child does not inherit semaphore adjustments from its parent +.\"O .RB ( semop (2)). +»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤«¤é¥»¥Þ¥Õ¥©Ä´À° +.RB ( semop (2)) +¤ò°ú¤­·Ñ¤¬¤Ê¤¤¡£ +.IP * +.\"O The child does not inherit record locks from its parent +.\"O .RB ( fcntl (2)). +»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤«¤é¥ì¥³¡¼¥É¥í¥Ã¥¯ +.RB ( fcntl (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)) +¤ò°ú¤­·Ñ¤¬¤Ê¤¤¡£ +.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 +.\"O .RB ( see io_setup (2)). +»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤«¤é¼ç¤À¤Ã¤¿ÈóƱ´ü I/O Áàºî¤ò°ú¤­·Ñ¤¬¤Ê¤¤ +.RB ( aio_read (3), +.BR aio_write (3) +»²¾È)¡£ +¤Þ¤¿¡¢¿Æ¥×¥í¥»¥¹¤«¤éÈóƱ´ü I/O ¥³¥ó¥Æ¥­¥¹¥È¤ò°ú¤­·Ñ¤¬¤Ê¤¤ +.RB ( io_setup (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 ¸ÇÍ­¤Î¥×¥í¥»¥¹Â°À­¤â°Û¤Ê¤ë: +.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 +¤ÎÀâÌÀ¤ò»²¾È) ¤ò°ú¤­·Ñ¤¬¤Ê¤¤¡£ +.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 +¤ÎÀßÄ꤬¥ê¥»¥Ã¥È¤µ¤ì¡¢»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¤È¤­¤Ë +¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤Ê¤¤¡£ +.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 () +¤Ë¤è¤Ã¤Æ°ú¤­·Ñ¤¬¤ì¤Ê¤¤¡£ +.IP * +.\"O The termination signal of the child is always +.\"O .B SIGCHLD +.\"O (see +.\"O .BR clone (2)). +»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥·¥°¥Ê¥ë¤Ï¾ï¤Ë +.B SIGCHLD +¤Ç¤¢¤ë +.RB ( clone (2) +¤ò»²¾È)¡£ +.PP +.\"O Note the following further points: +¤µ¤é¤Ë°Ê²¼¤ÎÅÀ¤Ë¤Ä¤¤¤ÆÃí°Õ¤¹¤ë¤³¤È: +.IP * 3 +.\"O The child process is created with a single thread \(em the +.\"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) +¤ò»È¤¦¤ÈÎɤ¤¤À¤í¤¦¡£ +.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 +¤ÎÀâÌÀ¤ò»²¾È) ¤ò¶¦Í­¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.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 ) +¤ò¶¦Í­¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.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" +.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 +.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" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.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) ¤¬Àµ¤·¤¤ÃͤòÊÖ¤¹¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë²¿¤é¤«¤Î½èÍý¤ò¹Ô¤¦¡£ + +.\"O .SH EXAMPLE +.SH Îã +.\"O See +.\"O .BR pipe (2) +.\"O and +.\"O .BR wait (2). +.BR pipe (2) +¤ª¤è¤Ó +.BR wait (2) +¤ò»²¾È¡£ +.\"O .SH "SEE ALSO" +.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) diff --git a/draft/man2/fstatat.2 b/draft/man2/fstatat.2 new file mode 100644 index 00000000..04532c74 --- /dev/null +++ b/draft/man2/fstatat.2 @@ -0,0 +1,225 @@ +.\" 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 (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.\"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 new file mode 100644 index 00000000..0aeb407f --- /dev/null +++ b/draft/man2/fsync.2 @@ -0,0 +1,314 @@ +.\" 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/futex.2 b/draft/man2/futex.2 new file mode 100644 index 00000000..6c6a180d --- /dev/null +++ b/draft/man2/futex.2 @@ -0,0 +1,480 @@ +.\" Page by b.hubert - may be freely modified and distributed +.\" +.\" Niki A. Rahimi (LTC Security Development, narahimi@us.ibm.com) +.\" added ERRORS section. +.\" +.\" Modified 2004-06-17 mtk +.\" Modified 2004-10-07 aeb, added FUTEX_REQUEUE, FUTEX_CMP_REQUEUE +.\" +.\" FIXME +.\" 2.6.14 adds FUTEX_WAKE_OP +.\" 2.6.18 adds (Ingo Molnar) priority inheritance support: +.\" FUTEX_LOCK_PI, FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI. These need +.\" to be documented in the manual page. Probably there is sufficient +.\" material in the kernel source file Documentation/pi-futex.txt. +.\" 2.6.25 adds FUTEX_WAKE_BITSET, FUTEX_WAIT_BITSET +.\" +.\" Japanese Version Copyright(C) 2003 Suzuki Takashi +.\" all rights reserved. +.\" Translated Fri Oct 24 10:37:10 JST 2003 +.\" by Suzuki Takashi. +.\" Updated & Modified Sat Feb 5 14:28:53 JST 2005 +.\" by Yuichi SATO , LDP v2.01 +.\" Updated & Modified Wed Jan 3 04:51:22 JST 2007 by Yuichi SATO, LDP v2.43 +.\" +.\"WORD: integer int ·¿ÊÑ¿ô +.\"WORD: sleep µ¯¾²ÂÔ¤Á¤¹¤ë +.\"WORD: wake µ¯¾²¤¹¤ë +.\"WORD: wake up µ¯¾²¤¹¤ë +.\" +.TH FUTEX 2 2008-11-27 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O futex \- Fast Userspace Locking system call +futex \- ¹â®¥æ¡¼¥¶¶õ´Ö¥í¥Ã¥¯µ¡¹½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.sp +.B "#include " +.B "#include " +.sp +.BI "int futex(int *" uaddr ", int " op ", int " val \ +", const struct timespec *" timeout , +.br +.BI " int *" uaddr2 ", int " val3 ); +.\" int *? void *? u32 *? +.fi +.\"O .SH "DESCRIPTION" +.SH ÀâÌÀ +.PP +.\"O The +.\"O .BR futex () +.\"O system call provides a method for +.\"O a program to wait for a value at a given address to change, and a +.\"O method to wake up anyone waiting on a particular address (while the +.\"O addresses for the same memory in separate processes may not be +.\"O equal, the kernel maps them internally so the same memory mapped in +.\"O different locations will correspond for +.\"O .BR futex () +.\"O calls). +.\"O It is typically used to +.\"O implement the contended case of a lock in shared memory, as +.\"O described in +.\"O .BR futex (7). +.BR futex () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +»ØÄꤷ¤¿¥¢¥É¥ì¥¹¤ÎÃͤ¬Êѹ¹¤µ¤ì¤ë¤Î¤ò¥×¥í¥°¥é¥à¤¬ÂԤļêÃʤä +ÆÃÄê¤Î¥¢¥É¥ì¥¹¤ËÂФ·¤ÆÂÔµ¡Ãæ¤Î¥×¥í¥»¥¹¤ò wake (µ¯¾²) ¤µ¤»¤ë¼êÃʤòÄ󶡤¹¤ë +(¥×¥í¥»¥¹¤¬°Û¤Ê¤ì¤ÐƱ¤¸¥á¥â¥ê¤ËÂФ¹¤ë¥¢¥É¥ì¥¹¤âƱ¤¸¤Ç¤Ï¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¤¬¡¢ +¥«¡¼¥Í¥ë¤Ï°Û¤Ê¤ë°ÌÃ֤˥ޥåפµ¤ì¤¿Æ±¤¸¥á¥â¥ê¤ò +.BR futex () +¤Ç»È¤¨¤ë¤è¤¦ÆâÉô¤Ç¥Þ¥Ã¥×¤¹¤ë)¡£ +ŵ·¿Åª¤Ë¤Ï¡¢futex ¤Ï +.BR futex (7) +¤Ëµ­¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¡¢ +¶¦Í­¥á¥â¥êÃæ¤Î¥í¥Ã¥¯¤¬¶¥¹ç¤¹¤ë¾ì¹ç¤Î½èÍý¤ò¼ÂÁõ¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +.\"O When a +.\"O .BR futex (7) +.\"O operation did not finish uncontended in userspace, a call needs to be made +.\"O to the kernel to arbitrate. +.\"O Arbitration can either mean putting the calling +.\"O process to sleep or, conversely, waking a waiting process. +.BR futex (7) +¤ÎÁàºî¤¬¥æ¡¼¥¶¶õ´Ö¤Ç¶¥¹ç¤Ê¤¯´°Î»¤·¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +¥«¡¼¥Í¥ë¤ËÃçºÛ¤µ¤»¤ë¤¿¤á¤Ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤ÖɬÍפ¬¤¢¤ë¡£ +ÃçºÛ¤È¤¤¤¦¤Î¤Ï¡¢¸Æ¤Ó½Ð¤·¥×¥í¥»¥¹¤ò sleep (µ¯¾²ÂÔ¤Á) ¤µ¤»¤¿¤ê¡¢È¿ÂÐ¤Ë +ÂÔ¤Á¥×¥í¥»¥¹¤ò wake ¤µ¤»¤¿¤ê¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.PP +.\"O Callers of this function are expected to adhere to the semantics as set out in +.\"O .BR futex (7). +.\"O As these +.\"O semantics involve writing nonportable assembly instructions, this in turn +.\"O probably means that most users will in fact be library authors and not +.\"O general application developers. +¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¥×¥í¥»¥¹¤Ï +.BR futex (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤ËÃé¼Â¤Ç¤¢¤ë¤³¤È¤¬Í׵ᤵ¤ì¤ë¡£ +¤³¤Î¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤Ë¤Ï°Ü¿¢ÉÔ²Äǽ¤Ê¥¢¥»¥ó¥Ö¥êÌ¿Îá¤ò½ñ¤¯¤³¤È¤¬´Þ¤Þ¤ì¤ë¡£ +¤³¤Î¤³¤È¤Ï¸À¤¤´¹¤¨¤ë¤È futex ¤Î¥æ¡¼¥¶¤Î¤Û¤È¤ó¤É¤Ï¼ÂºÝ¤Ï¥é¥¤¥Ö¥é¥ê¤Îºî¼Ô¤Ç¤¢¤ê¡¢ +°ìÈÌ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î³«È¯¼Ô¤Ç¤Ï¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.PP +.\"O The +.\"O .I uaddr +.\"O argument needs to point to an aligned integer which stores the counter. +.\"O The operation to execute is passed via the +.\"O .I op +.\"O argument, along with a value +.\"O .IR val . +.I uaddr +°ú¤­¿ô¤Ï¡¢¥«¥¦¥ó¥¿¤ò³ÊǼ¤¹¤ë¡¢ +¥¢¥é¥¤¥ó¥á¥ó¥È¤Î·¤Ã¤¿ int ·¿ÊÑ¿ô¤ò»Ø¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +¼Â¹Ô¤¹¤ëÁàºî¤Ï +.I op +°ú¤­¿ô¤ò²ð¤·¤Æ¡¢ÃÍ +.I val +¤È¤È¤â¤ËÅϤµ¤ì¤ë¡£ +.PP +.\"O Five operations are currently defined: +¸½ºß¤Î¤È¤³¤í 5 ¤Ä¤ÎÁàºî¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.TP +.B FUTEX_WAIT +.\"O This operation atomically verifies that the futex address +.\"O .I uaddr +.\"O still contains the value +.\"O .IR val , +.\"O and sleeps awaiting +.\"O .B FUTEX_WAKE +.\"O on this futex address. +.\"O If the +.\"O .I timeout +.\"O argument is non-NULL, its contents describe the maximum +.\"O duration of the wait, which is infinite otherwise. +.\"O The arguments +.\"O .I uaddr2 +.\"O and +.\"O .I val3 +.\"O are ignored. +¤³¤ÎÁàºî¤Ï futex ¥¢¥É¥ì¥¹ +.I uaddr +¤Ë»ØÄꤵ¤ì¤¿ÃÍ +.I val +¤¬¤Þ¤À³ÊǼ¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤òÉÔ²ÄʬÁàºî¤Ç¸¡¾Ú¤·¡¢ +sleep ¾õÂÖ¤Ç +¤³¤Î futex ¥¢¥É¥ì¥¹¤ËÂФ·¤Æ +.B FUTEX_WAKE +¤¬¼Â¹Ô¤µ¤ì¤ë¤Î¤òÂԤġ£ +.I timeout +°ú¤­¿ô¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢¤½¤ÎÆâÍÆ¤Ï +ÂÔ¤Á»þ´Ö¤ÎºÇÂçÃͤòɽ¤¹¡£NULL ¤Î¾ì¹ç¤Ï̵¸ÂÂç¤òɽ¤¹¡£ +°ú¤­¿ô +.I uaddr2 +¤È +.I val3 +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"O For +.\"O .BR futex (7), +.\"O this call is executed if decrementing the count gave a negative value +.\"O (indicating contention), and will sleep until another process releases +.\"O the futex and executes the +.\"O .B FUTEX_WAKE +.\"O operation. +.BR futex (7) +¤Ë¾È¤é¤·¹ç¤ï¤»¤ë¤È¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤Ï +¥«¥¦¥ó¥È¤Î¥Ç¥¯¥ê¥á¥ó¥È¤ÇÉé¤ÎÃÍ (¶¥¹ç¤òɽ¤¹) ¤Ë¤Ê¤Ã¤¿¾ì¹ç¤Ë¼Â¹Ô¤µ¤ì¡¢ +ÊÌ¤Î¥×¥í¥»¥¹¤¬¤½¤Î futex ¤ò²òÊü¤· +.B FUTEX_WAKE +¤ÎÁàºî¤ò¼Â¹Ô¤¹¤ë¤Þ¤Ç sleep ¤¹¤ë¡£ +.TP +.B FUTEX_WAKE +.\"O This operation wakes at most \fIval\fP +.\"O processes waiting on this futex address (i.e., inside +.\"O .BR FUTEX_WAIT ). +¤³¤ÎÁàºî¤Ç¤Ï»ØÄꤷ¤¿ futex ¥¢¥É¥ì¥¹¤ËÂФ·¤ÆÂÔ¤Á¾õÂ֤Π+(¤¹¤Ê¤ï¤Á +.B FUTEX_WAIT +Ãæ¤Î) ºÇÂç \fIval\fP ¸Ä¤Î¥×¥í¥»¥¹¤ò wake ¤µ¤»¤ë¡£ +.\"O The arguments +.\"O .IR timeout , +.\"O .I uaddr2 +.\"O and +.\"O .I val3 +.\"O are ignored. +°ú¤­¿ô +.IR timeout , +.IR uaddr2 , +.I val3 +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"O For +.\"O .BR futex (7), +.\"O this is executed if incrementing +.\"O the count showed that there were waiters, once the futex value has been set +.\"O to 1 (indicating that it is available). +\fBfutex\fR(4) ¤Ë¾È¤é¤·¹ç¤ï¤»¤ë¤È¡¢ +¤³¤ÎÁàºî¤Ï +¥«¥¦¥ó¥È¤Î¥¤¥ó¥¯¥ê¥á¥ó¥È¤ÇÂÔ¤Á¥×¥í¥»¥¹¤¬¤¢¤ë¤ÈȽÌÀ¤·¡¢ +futex Ãͤ¬ 1 ¤ËÀßÄꤵ¤ì¤¿ (ÍøÍѲÄǽ¤Ç¤¢¤ë¤³¤È¤òɽ¤¹) ¾ì¹ç¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ +.TP +.\"O .BR FUTEX_FD " (present up to and including Linux 2.6.25)" +.BR FUTEX_FD " (Linux 2.6.25 °ÊÁ°)" +.\"O To support asynchronous wakeups, this operation associates a file descriptor +.\"O with a futex. +.\"O .\" , suitable for .BR poll (2). +.\"O If another process executes a +.\"O .BR FUTEX_WAKE , +.\"O the process will receive the signal number that was passed in +.\"O number that was passed in +.\"O .IR val . +.\"O The calling process must close the returned file descriptor after use. +ÈóƱ´ü¤Î wake ¤ËÂбþ¤¹¤ë¤¿¤á¡¢¤³¤ÎÁàºî¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò futex ¤Ë +´ØÏ¢¤Å¤±¤ë¡£ +.\" .BR poll (2) +.\" ¤ËŬ¤·¤Æ¤¤¤ë¡£ +ÊÌ¤Î¥×¥í¥»¥¹¤¬ +.B FUTEX_WAKE +¤ò¼Â¹Ô¤¹¤ë¤È¡¢¥×¥í¥»¥¹¤Ï +.I val +¤ÇÅϤµ¤ì¤¿¥·¥°¥Ê¥ëÈÖ¹æ¤Î¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¡£ +¸Æ¤Ó½Ð¤·¥×¥í¥»¥¹¤Ï»ÈÍѸ塢ÊÖ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +¥¯¥í¡¼¥º¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O The arguments +.\"O .IR timeout , +.\"O .I uaddr2 +.\"O and +.\"O .I val3 +.\"O are ignored. +°ú¤­¿ô +.IR timeout , +.IR uaddr2 , +.I val3 +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"O To prevent race conditions, the caller should test if the futex has +.\"O been upped after +.\"O .B FUTEX_FD +.\"O returns. +¶¥¹ç¾õÂÖ¤òËɻߤ¹¤ë¤¿¤á¡¢¸Æ¤Ó½Ð¤·¥×¥í¥»¥¹¤Ï +.B FUTEX_FD +¤¬Ê֤俤¢¤È +futex ¤¬ up ¤µ¤ì¤¿¤«¤É¤¦¤«¤ò³Îǧ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\" FIXME . Check that this flag does eventually get removed. +.\"O Because it was inherently racy, +.\"O .B FUTEX_FD +.\"O has been removed from Linux 2.6.26 onwards. +.B FUTEX_FD +¤Ï¤â¤È¤â¤È¶¥¹ç¤¬µ¯¤­¤ä¤¹¤«¤Ã¤¿¤¿¤á¡¢ +Linux 2.6.26 °Ê¹ß¤Çºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.\"O .BR FUTEX_REQUEUE " (since Linux 2.5.70)" +.BR FUTEX_REQUEUE " (Linux 2.5.70 °Ê¹ß)" +.\"O This operation was introduced in order to avoid a "thundering herd" effect +.\"O when +.\"O .B FUTEX_WAKE +.\"O is used and all processes woken up need to acquire another +.\"O futex. +.\"O This call wakes up +.\"O .I val +.\"O processes, and requeues all other waiters on the futex at address +.\"O .IR uaddr2 . +¤³¤ÎÁàºî¤Ï¡¢ +.B FUTEX_WAKE +¤¬»È¤ï¤ì¤Æ¤¤¤Æ¡¢¤«¤Ä wake ¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥×¥í¥»¥¹¤¬ +¾¤Î futex ¤ò¼èÆÀ¤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ë¡¢ +¡Ö½Ã¤Î·²¤ì¤Î˽Áö (thundering herd)¡×¸ú²Ì¤òÈò¤±¤ë¤¿¤á¤ËƳÆþ¤µ¤ì¤¿¡£ +¤³¤Î¸Æ¤Ó½Ð¤·¤Ï +.I val +¸Ä¤Î¥×¥í¥»¥¹¤ò wake ¤·¡¢¥¢¥É¥ì¥¹ +.I uaddr2 +¤Ç futex ¤òÂԤäƤ¤¤ë¾¤ÎÁ´¤Æ¤Î¥×¥í¥»¥¹¤òºÆÅÙ¥­¥å¡¼¤Ë¤¤¤ì¤ë¡£ +.\"O The arguments +.\"O .I timeout +.\"O and +.\"O .I val3 +.\"O are ignored. +°ú¤­¿ô +.I timeout +¤È +.I val3 +¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.\"O .BR FUTEX_CMP_REQUEUE " (since Linux 2.6.7)" +.BR FUTEX_CMP_REQUEUE " (Linux 2.6.7 °Ê¹ß)" +.\"O There was a race in the intended use of +.\"O .BR FUTEX_REQUEUE , +.\"O so +.\"O .B FUTEX_CMP_REQUEUE +.\"O was introduced. +.\"O This is similar to +.\"O .BR FUTEX_REQUEUE , +.\"O but first checks whether the location +.\"O .I uaddr +.\"O still contains the value +.\"O .IR val3 . +.\"Osato: +.\"Osato: intended ¤¬¤è¤¯Ê¬¤«¤é¤Ê¤¤¡£ +.\"Osato: +¸Î°Õ¤Ë +.B FUTEX_REQUEUE +¤ò»È¤¦¾ì¹ç¤Ë¶¥¹ç¤¬µ¯¤³¤ë¤¿¤á¡¢ +.B FUTEX_CMP_REQUEUE +¤¬Æ³Æþ¤µ¤ì¤¿¡£¤³¤ì¤Ï +.B FUTEX_REQUEUE +¤È»÷¤Æ¤¤¤ë¤¬¡¢¾ì½ê +.I uaddr +¤ËÃÍ +.I val3 +¤¬¤Þ¤ÀÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¤«¤òºÇ½é¤Ë¥Á¥§¥Ã¥¯¤¹¤ë¡£ +.\"O If not, the operation fails with the error +.\"O .BR EAGAIN . +.\"O The argument +.\"O .I timeout +.\"O is ignored. +ÊÝ»ý¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢Áàºî¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¡£°ú¤­¿ô +.I timeout +¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.PP +.\"O Depending on which operation was executed, +.\"O the returned value for a successful call can have differing meanings. +¤É¤ÎÁàºî¤¬¼Â¹Ô¤µ¤ì¤¿¤«¤Ë¤è¤Ã¤Æ¡¢ +À®¸ù»þ¤ÎÊÖ¤êÃͤΰÕÌ£¤¬ÊѤï¤ë¡£ +.TP +.B FUTEX_WAIT +.\"O Returns 0 if the process was woken by a +.\"O .B FUTEX_WAKE +.\"O call. +.\"O In case of timeout, +.\"O the operation fails with the error +.\"O .BR ETIMEDOUT . +.\"O If the futex was not equal to the expected value, +.\"O the operation fails with the error +.\"O .BR EWOULDBLOCK . +.\"O Signals (see +.\"O .BR signal (7)) +.\"O or other spurious wakeups cause +.\"O .B FUTEX_WAIT +.\"O to fail with the error +.\"O .BR EINTR . +¥×¥í¥»¥¹¤¬ +.B FUTEX_WAKE +¤Î¸Æ¤Ó½Ð¤·¤Ç wake ¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¥¿¥¤¥à¥¢¥¦¥È¤Î¾ì¹ç¡¢Áàºî¤Ï¥¨¥é¡¼ +.B ETIMEOUT +¤Ç¼ºÇÔ¤¹¤ë¡£ +futex ¤¬»ØÄꤵ¤ì¤¿ÃͤÈÅù¤·¤¯¤Ê¤¤¾ì¹ç¡¢ +¥¨¥é¡¼ +.B EWOULDBLOCK +¤Ç¼ºÇÔ¤¹¤ë¡£ +¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¤« +.RB ( signal (7) +»²¾È) ¾¤Îµ¶¤Î wake ¤¬¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.B FUTEX_WAKE +.\"O Returns the number of processes woken up. +wake ¤·¤¿¥×¥í¥»¥¹¤Î¿ô¤òÊÖ¤¹¡£ +.TP +.B FUTEX_FD +.\"O Returns the new file descriptor associated with the futex. +futex ¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¿·¤¿¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.TP +.B FUTEX_REQUEUE +.\"O Returns the number of processes woken up. +wake ¤·¤¿¥×¥í¥»¥¹¤Î¿ô¤òÊÖ¤¹¡£ +.TP +.B FUTEX_CMP_REQUEUE +.\"O Returns the number of processes woken up. +wake ¤·¤¿¥×¥í¥»¥¹¤Î¿ô¤òÊÖ¤¹¡£ +.PP +.\"O In the event of an error, all operations return \-1, and set +.\"O .I errno +.\"O to indicate the error. +¥¨¥é¡¼¤Î¾ì¹ç¡¢Á´¤Æ¤ÎÁàºî¤Ç \-1 ¤¬Ê֤ꡢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤò¼¨¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O No read access to futex memory. +futex ¥á¥â¥ê¤ËÆɤ߹þ¤ß¥¢¥¯¥»¥¹¸¢¤¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B EAGAIN +.\"O .B FUTEX_CMP_REQUEUE +.\"O found an unexpected futex value. +.\"O (This probably indicates a race; +.\"O use the safe +.\"O .B FUTEX_WAKE +.\"O now.) +.B FUTEX_CMP_REQUEUE +¤Çͽ´ü¤·¤Ê¤¤ futex Ãͤ¬¸«¤Ä¤«¤Ã¤¿ +(¤³¤ì¤Ï¶¥¹ç¤ò¼¨¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î¾ì¹ç¤Ï°ÂÁ´¤Ê +.B FUTEX_WAKE +¤ò»È¤¦¤³¤È)¡£ +.TP +.B EFAULT +.\"O Error in getting +.\"O .I timeout +.\"O information from userspace. +¥æ¡¼¥¶¶õ´Ö¤«¤é +.I timeout +¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ëºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EINVAL +.\"O An operation was not defined or error in page alignment. +Áàºî¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£¤Þ¤¿¤Ï¥Ú¡¼¥¸¡¦¥¢¥é¥¤¥ó¥á¥ó¥È¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ENFILE +.\"O The system limit on the total number of open files has been reached. +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥à¤ÎÀ©¸Â¤Ë㤷¤¿¡£ +.TP +.B ENOSYS +.\"O Invalid operation specified in +.\"O .IR op . +.I op +¤Ë̵¸ú¤ÊÁàºî¤¬»ØÄꤵ¤ì¤¿¡£ +.\"O .SH "VERSIONS" +.SH ¥Ð¡¼¥¸¥ç¥ó +.PP +.\"O Initial futex support was merged in Linux 2.5.7 but with different semantics +.\"O from what was described above. +.\"O A 4-argument system call with the semantics +.\"O given here was introduced in Linux 2.5.40. +.\"O In Linux 2.5.70 one argument +.\"O was added. +.\"O In Linux 2.6.7 a sixth argument was added \(em messy, especially +.\"O on the s390 architecture. +ºÇ½é¤Î futex Âбþ¤Ï Linux 2.5.7 ¤ÇÁȤ߹þ¤Þ¤ì¤¿¤¬¡¢ +¾åµ­¤Î¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤È¤Ï°Û¤Ê¤ë¡£ +¤³¤³¤Ç¼¨¤µ¤ì¤Æ¤¤¤ë¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤ò»ý¤Ä +4 ¤Ä¤Î°ú¤­¿ô¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢Linux 2.5.40 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +Linux 2.5.70 ¤Ç¤Ï 1 ¤Ä¤Î°ú¤­¿ô¤¬Äɲ䵤줿¡£ +Linux 2.6.7 ¤Ç¤Ï 6 ÈÖÌܤΰú¤­¿ô¤¬Äɲ䵤줿¡£ +¤³¤ì¤Ï±ø¤¯¡¢s390 ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¾å¤ÎÆÃÊ̤Τâ¤Î¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This system call is Linux-specific. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\"O .SH "NOTES" +.SH Ãí°Õ +.PP +.\"O To reiterate, bare futexes are not intended as an easy-to-use abstraction +.\"O for end-users. +.\"O (There is no wrapper function for this system call in glibc.) +.\"O Implementors are expected to be assembly literate and to have +.\"O read the sources of the futex userspace library referenced below. +·«¤êÊÖ¤¹¤¬¡¢Íç¤Î futex ¤Ï¥¨¥ó¥É¥æ¡¼¥¶¤¬Íưפ˻Ȥ¦¤³¤È¤Î¤Ç¤­¤ë³µÇ°¤È¤·¤Æ +°Õ¿Þ¤µ¤ì¤¿¤â¤Î¤Ç¤Ï¤Ê¤¤ +(glibc ¤Ë¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¤Ê¤¤)¡£ +¼ÂÁõ¼Ô¤Ï¡¢¥¢¥»¥ó¥Ö¥ê¸À¸ì¤Ë´·¤ì¤Æ¤ª¤ê¡¢°Ê²¼¤Ëµó¤²¤ë futex ¥æ¡¼¥¶¶õ´Ö¥é¥¤¥Ö¥é¥ê¤Î +¥½¡¼¥¹¤òÆɤ߽ª¤¨¤Æ¤¤¤ë¤³¤È¤¬Í׵ᤵ¤ì¤ë¡£ +.\"O .\" .SH "AUTHORS" +.\" .SH Ãø¼Ô +.\" .PP +.\"O .\" Futexes were designed and worked on by +.\"O .\" Hubertus Franke (IBM Thomas J. Watson Research Center), +.\"O .\" Matthew Kirkwood, Ingo Molnar (Red Hat) +.\"O .\" and Rusty Russell (IBM Linux Technology Center). +.\"O .\" This page written by bert hubert. +.\" futex ¤Ï Hubertus Franke (IBM Thomas J. Watson Research Center), +.\" Matthew Kirkwood, Ingo Molnar (Red Hat), +.\" Rusty Russell (IBM Linux Technology Center) ¤¬À߷פ·¡¢ºîÀ®¤·¤¿¡£ +.\" ¤³¤Î¥Ú¡¼¥¸¤Ï bert hubert ¤¬µ­¤·¤¿¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR futex (7) +.PP +\fIFuss, Futexes and Furwocks: Fast Userlevel Locking in Linux\fP +(proceedings of the Ottawa Linux Symposium 2002), +.\"O futex example library, futex-*.tar.bz2 +futex ¤Î»ÈÍÑÎã¥é¥¤¥Ö¥é¥ê, futex-*.tar.bz2 +. diff --git a/draft/man2/futimesat.2 b/draft/man2/futimesat.2 new file mode 100644 index 00000000..f292e3ba --- /dev/null +++ b/draft/man2/futimesat.2 @@ -0,0 +1,219 @@ +.\" 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-09-30 by Yuichi SATO , LDP v2.39 +.\" +.TH FUTIMESAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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_* Äê¿ô¤ÎÄêµÁ */ +.sp +.BI "int futimesat(int " dirfd ", const char *" pathname , +.BI " const struct timeval " times [2]); +.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 futimesat (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This system call is obsolete. +.\"O Use +.\"O .BR utimensat (2) +.\"O instead. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£ +Âå¤ï¤ê¤Ë +.BR utimensat (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) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.\"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) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.\"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) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I pathname +.\"O is absolute, then +.\"O .I dirfd +.\"O is ignored. +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.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 +.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 () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR futimesat () +.\"O was added to Linux in kernel 2.6.16. +.BR futimesat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.\"O .SH "CONFORMING TO" +.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) +¤ÇÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ + +.\"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 +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î»þ¹ï¤ò¹¹¿·¤¹¤ë¡£ +.\" The Solaris futimesat() also has this strangeness. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR stat (2), +.BR utimensat (2), +.BR utimes (2), +.BR futimes (3), +.BR path_resolution (7) diff --git a/draft/man2/get_kernel_syms.2 b/draft/man2/get_kernel_syms.2 new file mode 100644 index 00000000..18112751 --- /dev/null +++ b/draft/man2/get_kernel_syms.2 @@ -0,0 +1,130 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-31, Akihiro MOTOKI +.\" +.TH GET_KERNEL_SYMS 2 2007-06-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O get_kernel_syms \- retrieve exported kernel and module symbols +get_kernel_syms \- ¸ø³«¤µ¤ì¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤ä¥â¥¸¥å¡¼¥ë¤Î¥·¥ó¥Ü¥ë¤Î¼èÆÀ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int get_kernel_syms(struct kernel_sym *" table ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O If +.\"O .I table +.\"O is NULL, +.\"O .BR get_kernel_syms () +.\"O returns the number of symbols available for query. +.\"O Otherwise it fills in a table of structures: +.BR get_kernel_syms () +¤Ï¡¢ +.I table +¤¬ NULL ¤Î¾ì¹ç¡¢ +Ì䤤¹ç¤ï¤»¤Ç¤­¤ë¥·¥ó¥Ü¥ë¤Î¿ô¤òÊÖ¤¹¡£ +NULL °Ê³°¤Î¾ì¹ç¡¢°Ê²¼¤Î¹½Â¤ÂΤÎÎó (table) ¤ËÃͤòÆþ¤ì¤ÆÊÖ¤¹¡£ +.PP +.in +4n +.nf +struct kernel_sym { + unsigned long value; + char name[60]; +}; +.fi +.in +.PP +.\"O The symbols are interspersed with magic symbols of the form +.\"O .BI # module-name +.\"O with the kernel having an empty name. +.\"O The value associated with a symbol of this form is the address at +.\"O which the module is loaded. +¥·¥ó¥Ü¥ë¤ÎÃæ¤Ë¤Ï¡¢ +.BI # module-name +¤È¤¤¤¦·Á¼°¤Î¡¢¥«¡¼¥Í¥ë¤¬¶õ¤Î̾Á°¤ò»ý¤Ã¤Æ¤¤¤ë¥Þ¥¸¥Ã¥¯¥·¥ó¥Ü¥ë +(magic symbol) ¤¬»¶ºß¤·¤Æ¤¤¤ë¡£¤³¤Î·Á¼°¤Î¥·¥ó¥Ü¥ë¤ËÂбþ¤¹¤ëÃÍ¤Ï +¥â¥¸¥å¡¼¥ë¤¬¥í¡¼¥É¤µ¤ì¤¿¥¢¥É¥ì¥¹¤È¤Ê¤ë¡£ +.PP +.\"O The symbols exported from each module follow their magic module tag +.\"O and the modules are returned in the reverse of the +.\"O order in which they were loaded. +¸Ä¡¹¤Î¥â¥¸¥å¡¼¥ë¤«¤é¸ø³« (export) ¤µ¤ì¤¿¥·¥ó¥Ü¥ë¤Ï¡¢¥Þ¥¸¥Ã¥¯¥â¥¸¥å¡¼¥ë¥¿¥° +¤Î¸å¤í¤ËÃÖ¤«¤ì¤ë¡£¤Þ¤¿¡¢¥â¥¸¥å¡¼¥ë¤Ï¥í¡¼¥É¤µ¤ì¤¿½çÈ֤Ȥϵսç¤ÇÊÖ¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, returns the number of symbols copied to +.\"O .IR table . +.\"O On error, \-1 is returned and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤¹¤ë¤È¡¢ +.I table +¤Ë¥³¥Ô¡¼¤µ¤ì¤¿¥·¥ó¥Ü¥ë¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O There is only one possible error return: +ÊÖ¤ë²ÄǽÀ­¤¬¤¢¤ë¥¨¥é¡¼¤Ï°ì¤Ä¤À¤±¤Ç¤¢¤ë¡£ +.TP +.B ENOSYS +.\"O .BR get_kernel_syms () +.\"O is not supported in this version of the kernel. +.BR get_kernel_syms () +¤¬¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O This system call is only present on Linux up until kernel 2.4; +.\"O it was removed in Linux 2.6. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¤Î¤Ï¥«¡¼¥Í¥ë 2.4 ¤Þ¤Ç¤Î Linux ¤À¤±¤Ç¤¢¤ë¡£ +Linux 2.6 ¤Ç¤Ïºï½ü¤µ¤ì¤¿¡£ +.\" Removed in Linux 2.5.48 +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR get_kernel_syms () +.\"O is Linux-specific. +.BR get_kernel_syms () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O There is no way to indicate the size of the buffer allocated for +.\"O .IR table . +.\"O If symbols have been added to the kernel since the +.\"O program queried for the symbol table size, memory will be corrupted. +.I table +ÍѤ˳ÎÊݤ·¤¿¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤òÅÁ¤¨¤ëÊýË¡¤¬¤Ê¤¤¡£ +¥×¥í¥°¥é¥à¤¬¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤ÎÂ礭¤µ¤òÌ䤤¹ç¤ï¤»¤¿¸å¤Ë¡¢¥«¡¼¥Í¥ë¤Ë +¥·¥ó¥Ü¥ë¤¬Äɲ䵤ì¤ë¤È¡¢¥á¥â¥ê¤ÎÆâÍƤ¬Ç˲õ¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.PP +.\"O The length of exported symbol names is limited to 59 characters. +¸ø³«¤µ¤ì¤ë¥·¥ó¥Ü¥ë̾¤ÎŤµ¤¬ 59 ʸ»ú¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O Because of these limitations, this system call is deprecated in +.\"O favor of +.\"O .BR query_module (2) +.\"O (which is itself nowadays deprecated +.\"O in favor of other interfaces described on its manual page). +¤³¤ì¤é¤ÎÀ©¸Â¤¬¤¢¤ë¤Î¤Ç¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤è¤ê¤Ï +.BR query_module (2) +¤ò»È¤¦¤Î¤¬Ë¾¤Þ¤·¤¤ +(¸½ºß¤Ç¤Ï +.BR query_module (2) +¼«¿È¤â¤½¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¤è¤¦¤Ë +¾¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò»È¤¦¤Î¤¬Ë¾¤Þ¤·¤¤¤È¤µ¤ì¤Æ¤¤¤ë)¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR create_module (2), +.BR delete_module (2), +.BR init_module (2), +.BR query_module (2) diff --git a/draft/man2/get_mempolicy.2 b/draft/man2/get_mempolicy.2 new file mode 100644 index 00000000..857da08a --- /dev/null +++ b/draft/man2/get_mempolicy.2 @@ -0,0 +1,448 @@ +.\" Copyright 2003,2004 Andi Kleen, SuSE Labs. +.\" and Copyright 2007 Lee Schermerhorn, Hewlett Packard +.\" +.\" 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. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\" 2006-02-03, mtk, substantial wording changes and other improvements +.\" 2007-08-27, Lee Schermerhorn +.\" more precise specification of behavior. +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2006-08-14, Akihiro MOTOKI , LDP v2.39 +.\" Updated 2008-02-13, Akihiro MOTOKI, LDP v2.77 +.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-08-21, Akihiro MOTOKI, LDP v3.07 +.\" Updated 2008-11-19, Akihiro MOTOKI, LDP v3.13 +.\" +.TH GET_MEMPOLICY 2 2008-08-15 Linux "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O get_mempolicy \- Retrieve NUMA memory policy for a process +get_mempolicy \- ¥×¥í¥»¥¹¤Î NUMA ¥á¥â¥ê¤Î¥Ý¥ê¥·¡¼¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int get_mempolicy(int *" mode ", unsigned long *" nodemask , +.BI " unsigned long " maxnode ", unsigned long " addr , +.BI " unsigned long " flags ); +.sp +.\"O Link with \fI\-lnuma\fP. +\fI\-lnuma\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR get_mempolicy () +.\"O retrieves the NUMA policy of the calling process or of a memory address, +.\"O depending on the setting of +.\"O .IR flags . +.BR get_mempolicy () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤â¤·¤¯¤Ï»ØÄꤵ¤ì¤¿¥á¥â¥ê¥¢¥É¥ì¥¹¤Î +NUMA ¥Ý¥ê¥·¡¼¤ò +.I flags +¤ÎÀßÄê¤Ë½¾¤Ã¤Æ¼èÆÀ¤¹¤ë¡£ + +.\"O A NUMA machine has different +.\"O memory controllers with different distances to specific CPUs. +.\"O The memory policy defines from which node memory is allocated for +.\"O the process. +NUMA (ÈóÂоΥá¥â¥ê¥¢¥¯¥»¥¹) ¥Þ¥·¥ó¤Ç¤Ï¡¢CPU ¤Ë¤è¤ê +¥á¥â¥ê¥³¥ó¥È¥í¡¼¥é¤¬°Û¤Ê¤ê¡¢µ÷Î¥¤â°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï¡¢¤É¤Î¥Î¡¼¥É¤«¤é¥á¥â¥ê¤ò¤½¤Î¥×¥í¥»¥¹¤Ë +³ä¤êÅö¤Æ¤ë¤«¤òÄê¤á¤ë¤â¤Î¤Ç¤¢¤ë¡£ + +.\"O If +.\"O .I flags +.\"O is specified as 0, +.\"O then information about the calling process's default policy +.\"O (as set by +.\"O .BR set_mempolicy (2)) +.\"O is returned. +.I flags +¤Ë 0 ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.RB ( set_mempolicy (2) +¤ÇÀßÄꤵ¤ì¤¿) +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÖ¤¹¡£ +.\"O The policy returned +.\"O .RI [ mode +.\"O and +.\"O .IR nodemask ] +.\"O may be used to restore the process's policy to its state at +.\"O the time of the call to +.\"O .BR get_mempolicy () +.\"O using +.\"O .BR set_mempolicy (2). +ÊÖ¤µ¤ì¤¿¥Ý¥ê¥·¡¼ +.RI [ mode +¤È +.IR nodemask ] +¤ò +.BR set_mempolicy (2) +¤ËÅϤ¹¤³¤È¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥Ý¥ê¥·¡¼¤ò +.BR get_mempolicy () +¤ò¸Æ¤Ó½Ð¤·¤¿»þÅÀ¤Î¾õÂÖ¤ËÌ᤹¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O If +.\"O .I flags +.\"O specifies +.\"O .BR MPOL_F_MEMS_ALLOWED +.\"O (available since Linux 2.6.24), the +.\"O .I mode +.\"O argument is ignored and the set of nodes [memories] that the +.\"O process is allowed to specify in subsequent calls to +.\"O .BR mbind (2) +.\"O or +.\"O .BR set_mempolicy (2) +.\"O [in the absense of any +.\"O .IR "mode flags" ] +.\"O is returned in +.\"O .IR nodemask . +.\"O It is not permitted to combine +.\"O .B MPOL_F_MEMS_ALLOWED +.\"O with either +.\"O .B MPOL_F_ADDR +.\"O or +.\"O .BR MPOL_F_NODE . +.I flags +¤Ë +.B MPOL_F_MEMS_ALLOWED +(Linux 2.6.24 °Ê¹ß¤ÇÍøÍѲÄǽ) ¤ò»ØÄꤹ¤ë¤È¡¢ +.I mode +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¡¢ +¤½¤Î¥×¥í¥»¥¹¤¬¤½¤Î¸å¤Î +.BR mbind (2) +¤ä +.BR set_mempolicy (2) +¤Ç +.RI [ "¥â¡¼¥É¥Õ¥é¥°" +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë ] »ØÄê¤Ç¤­¤ë¥Î¡¼¥É (¥á¥â¥ê) ¤Î½¸¹ç¤¬ +.I nodemask +¤ËÊÖ¤µ¤ì¤ë¡£ +.B MPOL_F_MEMS_ALLOWED +¤ò¡¢ +.B MPOL_F_ADDR +¤ä +.B MPOL_F_NODE +¤ÈƱ»þ¤Ë»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ + +.\"O If +.\"O .I flags +.\"O specifies +.\"O .BR MPOL_F_ADDR , +.\"O then information is returned about the policy governing the memory +.\"O address given in +.\"O .IR addr . +.\"O This policy may be different from the process's default policy if +.\"O .BR mbind (2) +.\"O or one of the helper functions described in +.\"O .BR numa (3) +.\"O has been used to establish a policy for the memory range containing +.\"O .IR addr . +.I flags +¤Ë +.B MPOL_F_ADDR +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.I addr +¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥ê¥¢¥É¥ì¥¹¤ËŬÍѤµ¤ì¤Æ¤¤¤ë¥Ý¥ê¥·¡¼¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÖ¤¹¡£ +.BR mbind (2) +¤ä +.BR numa (3) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥Ø¥ë¥Ñ¡¼´Ø¿ô¤ò»È¤Ã¤Æ¡¢ +.I addr +¤ò´Þ¤à¥á¥â¥êÎΰè¤ËÂФ¹¤ë¥Ý¥ê¥·¡¼¤¬ÀßÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¡¢ +ÊÖ¤µ¤ì¤ë¥Ý¥ê¥·¡¼¤Ï¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤È°ã¤¦¤³¤È¤¬¤¢¤ë¡£ + +.\"O If the +.\"O .I mode +.\"O argument is not NULL, then +.\"O .BR get_mempolicy () +.\"O will store the policy mode and any optional +.\"O .I "mode flags" +.\"O of the requested NUMA policy in the location pointed to by this argument. +.I mode +°ú¤­¿ô¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.BR get_mempolicy () +¤ÏÍ׵ᤵ¤ì¤¿ NUMA ¥Ý¥ê¥·¡¼¤Î¥â¡¼¥É¤ÈÄɲäΠ+.I "¥â¡¼¥É¥Õ¥é¥°" +¤ò +.I mode +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤¹¤ë¡£ +.\"O If +.\"O .I nodemask +.\"O is not NULL, then the nodemask associated with the policy will be stored +.\"O in the location pointed to by this argument. +.\"O .I maxnode +.\"O specifies the number of node IDs +.\"O that can be stored into +.\"O .IR nodemask \(emthat +.\"O is, the maximum node ID plus one. +.\"O The value specified by +.\"O .I maxnode +.\"O is always rounded to a multiple of +.\"O .IR "sizeof(unsigned long)" . +.I nodemask +¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢¤½¤Î¥Ý¥ê¥·¡¼¤ËÂбþ¤¹¤ë¥Î¡¼¥É¥Þ¥¹¥¯¤ò +¤³¤Î°ú¤­¿ô¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤¹¤ë¡£ +.I maxnode +¤Ë¤Ï +.I nodemask +¤Ë³ÊǼ¤Ç¤­¤ë¥Î¡¼¥É ID ¤Î¿ô¡¢¤Ä¤Þ¤êºÇÂç¥Î¡¼¥É ID ¤Ë 1 ¤ò­¤·¤¿Ãͤò»ØÄꤹ¤ë¡£ +.I maxnode +¤Ç»ØÄꤵ¤ì¤¿ÃͤϾï¤Ë +.I sizeof(unsigned long) +¤ÎÇÜ¿ô¤ËÀÚ¤ê¾å¤²¤é¤ì¤ë¡£ + +.\"O If +.\"O .I flags +.\"O specifies both +.\"O .B MPOL_F_NODE +.\"O and +.\"O .BR MPOL_F_ADDR , +.\"O .BR get_mempolicy () +.\"O will return the node ID of the node on which the address +.\"O .I addr +.\"O is allocated into the location pointed to by +.\"O .IR mode . +.\"O If no page has yet been allocated for the specified address, +.\"O .BR get_mempolicy () +.\"O will allocate a page as if the process had performed a read +.\"O [load] access to that address, and return the ID of the node +.\"O where that page was allocated. +.I flags +¤Ç +.B MPOL_F_NODE +¤È +.B MPOL_F_ADDR +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.BR get_mempolicy () +¤Ï¥¢¥É¥ì¥¹ +.I addr +¤¬³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤Î¥Î¡¼¥É ID ¤ò +.I mode +¤¬»Ø¤¹¾ì½ê¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤Ë¤É¤Î¥Ú¡¼¥¸¤â¤Þ¤À³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.BR get_mempolicy () +¤Ï¡¢¤¢¤¿¤«¤â¤½¤Î¥×¥í¥»¥¹¤¬¤½¤Î¥¢¥É¥ì¥¹¤ËÂФ·¤ÆÆɤ߹þ¤ß¥¢¥¯¥»¥¹¤ò +¼Â¹Ô¤·¤¿¤«¤Î¤è¤¦¤Ë¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤ò¹Ô¤¤¡¢¥Ú¡¼¥¸¤¬³ä¤êÅö¤Æ¤é¤ì¤¿ +¥Î¡¼¥É¤Î ID ¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I flags +.\"O specifies +.\"O .BR MPOL_F_NODE , +.\"O but not +.\"O .BR MPOL_F_ADDR , +.\"O and the process's current policy is +.\"O .BR MPOL_INTERLEAVE , +.\"O then +.\"O .BR get_mempolicy () +.\"O will return in the location pointed to by a non-NULL +.\"O .I mode +.\"O argument, +.\"O the node ID of the next node that will be used for +.\"O interleaving of internal kernel pages allocated on behalf of the process. +.I flags +¤Ç +.B MPOL_F_NODE +¤Ï»ØÄꤵ¤ì¤¿¤¬¡¢ +.B MPOL_F_ADDR +¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¡¢¤«¤Ä +¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î¥Ý¥ê¥·¡¼¤¬ +.B MPOL_INTERLEAVE +¤Î¾ì¹ç¡¢ +.BR get_mempolicy () +¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ³ä¤êÅö¤Æ¤é¤ì¤¿¥«¡¼¥Í¥ë¤ÎÆâÉô¥Ú¡¼¥¸¤Ç +¼¡¤Ë¥¤¥ó¥¿¡¼¥ê¡¼¥ÖÍѤ˻ÈÍѤµ¤ì¤ë¥Î¡¼¥É¤Î¥Î¡¼¥É ID ¤ò¡¢ +NULL ¤Ç¤Ê¤¤ +.I mode +°ú¤­¿ô¤¬»Ø¤¹¾ì½ê¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +.\" Note: code returns next interleave node via 'mode' argument -Lee Schermerhorn +.\"O These allocations include pages for memory mapped files in +.\"O process memory ranges mapped using the +.\"O .BR mmap (2) +.\"O call with the +.\"O .B MAP_PRIVATE +.\"O flag for read accesses, and in memory ranges mapped with the +.\"O .B MAP_SHARED +.\"O flag for all accesses. +Æɤ߹þ¤ß¥¢¥¯¥»¥¹ÍѤȤ·¤Æ +.B MAP_PRIVATE +¥Õ¥é¥°ÉÕ¤­¤Ç +.BR mmap (2) +¤·¤¿¥×¥í¥»¥¹¥á¥â¥êÎΰè¤ä¡¢ +Ǥ°Õ¤Î¥¢¥¯¥»¥¹ÍѤȤ·¤Æ +.B MAP_SHARED +¥Õ¥é¥°ÉÕ¤­¤Ç +.BR mmap (2) +¤·¤¿¥á¥â¥êÎΰè¤Î¡¢¥á¥â¥ê¥Þ¥Ã¥×¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥Ú¡¼¥¸¤â +¾åµ­¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ³ä¤êÅö¤Æ¤é¤ì¤¿¥Ú¡¼¥¸¤Ë´Þ¤Þ¤ì¤ë¡£ + +.\"O Other flag values are reserved. +¾¤Î¥Õ¥é¥°¤ÏͽÌ󤵤ì¤Æ¤¤¤ë¡£ + +.\"O For an overview of the possible policies see +.\"O .BR set_mempolicy (2). +ÀßÄê²Äǽ¤Ê¥Ý¥ê¥·¡¼¤Î³µÍפˤĤ¤¤Æ¤Ï +.BR set_mempolicy (2) +¤ò»²¾È¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR get_mempolicy () +.\"O returns 0; +.\"O on error, \-1 is returned and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR get_mempolicy () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O Part of all of the memory range specified by +.\"O .I nodemask +.\"O and +.\"O .I maxnode +.\"O points outside your accessible address space. +.\"motoki: Part of all of the memory ¤Ï Part or all .. ¤Î´Ö°ã¤¤¡© +.I nodemask +¤È +.I maxnode +¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥êÎΰè¤Î°ìÉô¤Þ¤¿¤ÏÁ´Éô¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O The value specified by +.\"O .I maxnode +.\"O is less than the number of node IDs supported by the system. +.I maxnode +¤Ç»ØÄꤵ¤ì¤¿Ãͤ¬¥·¥¹¥Æ¥à¤¬¥µ¥Ý¡¼¥È¤¹¤ë¥Î¡¼¥É ID ¤Î¿ô¤è¤ê¤â¾¯¤Ê¤¤¡£ +.\"O Or +.\"O .I flags +.\"O specified values other than +.\"O .B MPOL_F_NODE +.\"O or +.\"O .BR MPOL_F_ADDR ; +¤Þ¤¿¤Ï¡¢ +.I flags +¤Ë +.B MPOL_F_NODE +¤Ç¤â +.B MPOL_F_ADDR +¤Ç¤â¤Ê¤¤Ãͤ¬»ØÄꤵ¤ì¤¿¡£ +.\"O or +.\"O .I flags +.\"O specified +.\"O .B MPOL_F_ADDR +.\"O and +.\"O .I addr +.\"O is NULL, +¤Þ¤¿¤Ï¡¢ +.I flags +¤Ë +.B MPOL_F_ADDR +¤¬»ØÄꤵ¤ì¤Æ¤ª¤ê¡¢ +.I addr +¤¬ NULL ¤Ç¤¢¤ë¡£ +.\"O or +.\"O .I flags +.\"O did not specify +.\"O .B MPOL_F_ADDR +.\"O and +.\"O .I addr +.\"O is not NULL. +¤Þ¤¿¤Ï¡¢ +.I flags +¤Ë +.B MPOL_F_ADDR +¤¬¤µ¤ì¤Æ¤ª¤é¤º¡¢ +.I addr +¤¬ NULL ¤Ç¤Ê¤¤¡£ +.\"O Or, +.\"O .I flags +.\"O specified +.\"O .B MPOL_F_NODE +.\"O but not +.\"O .B MPOL_F_ADDR +.\"O and the current process policy is not +.\"O .BR MPOL_INTERLEAVE . +¤Þ¤¿¤Ï¡¢ +.I flags +¤Ë +.B MPOL_F_NODE +¤¬»ØÄꤵ¤ì¤Æ¤ª¤ê¡¢ +.B MPOL_F_ADDR +¤¬»ØÄꤵ¤ì¤Æ¤ª¤é¤º¡¢ +¥×¥í¥»¥¹¤Î¸½ºß¤Î¥Ý¥ê¥·¡¼¤¬ +.B MPOL_INTERLEAVE +¤Ç¤Ê¤¤¡£ +.\"O Or, +.\"O .I flags +.\"O specified +.\"O .B MPOL_F_MEMS_ALLOWED +.\"O with either +.\"O .B MPOL_F_ADDR +.\"O or +.\"O .BR MPOL_F_NODE . +¤Þ¤¿¤Ï¡¢ +.I flags +¤Ë +.B MPOL_F_MEMS_ALLOWED +¤¬»ØÄꤵ¤ì¤Æ¤ª¤ê¡¢¤µ¤é¤Ë +.B MPOL_F_ADDR +¤« +.B MPOL_F_NODE +¤Î¤¤¤º¤ì¤«¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ +.\"O (And there are other +.\"O .B EINVAL +.\"O cases.) +(¾¤Ë¤â +.B EINVAL +¤È¤Ê¤ë¾ì¹ç¤¬¤¢¤ë¡£) +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The +.\"O .BR get_mempolicy () +.\"O system call was added to the Linux kernel in version 2.6.7. +.BR get_mempolicy () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ð¡¼¥¸¥ç¥ó 2.6.7 ¤Ç Linux ¥«¡¼¥Í¥ë¤ËÄɲ䵤줿¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O This system call is Linux-specific. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O For information on library support, see +.\"O .BR numa (7). +¥é¥¤¥Ö¥é¥ê¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR numa (7) +¤ò»²¾È¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR getcpu (2), +.BR mbind (2), +.BR mmap (2), +.BR set_mempolicy (2), +.BR numa (3), +.BR numa (7), +.BR numactl (8) diff --git a/draft/man2/get_thread_area.2 b/draft/man2/get_thread_area.2 new file mode 100644 index 00000000..ff2ca7b6 --- /dev/null +++ b/draft/man2/get_thread_area.2 @@ -0,0 +1,95 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" 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 +.\" +.\"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 +.SH ̾Á° +get_thread_area \- ¥¹¥ì¥Ã¥É¶É½êµ­²± (TLS) Îΰè¤ò¼è¤ê½Ð¤¹ +.\"O .SH "SYNOPSIS" +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int get_thread_area(struct user_desc *" u_info ); +.\"O .SH "DESCRIPTION" +.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" +.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 +¤ËŬÀÚ¤ÊÃͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH "ERRORS" +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O \fIu_info\fP is an invalid pointer. +\fIu_info\fP ¤¬ÉÔÀµ¤Ê¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +.\"O \fIu_info\->entry_number\fP is out of bounds. +\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" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR modify_ldt (2), +.BR set_thread_area (2) diff --git a/draft/man2/getcontext.2 b/draft/man2/getcontext.2 new file mode 100644 index 00000000..e82c5895 --- /dev/null +++ b/draft/man2/getcontext.2 @@ -0,0 +1,285 @@ +.\" Copyright (C) 2001 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. +.\" +.\" 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 +.SH ̾Á° +getcontext, setcontext \- ¥æ¡¼¥¶¥³¥ó¥Æ¥­¥¹¥È¤ò¼èÆÀ/ÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int getcontext(ucontext_t *" ucp ); +.br +.BI "int setcontext(const ucontext_t *" ucp ); +.\"O .SH DESCRIPTION +.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 +¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢¤¢¤ë¥×¥í¥»¥¹ÆâÉô¤ÇÀ©¸æ²¼¤Ë¤¢¤ëÊ£¿ô¤Î¥¹¥ì¥Ã¥É´Ö¤Ç¡¢ +¥æ¡¼¥¶¥ì¥Ù¥ë¤Î¥³¥ó¥Æ¥­¥¹¥ÈÀÚÂؤ¨¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.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 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤ò»ý¤Ä¡£ +.in +4 +.nf + +typedef struct ucontext { + struct ucontext *uc_link; + sigset_t uc_sigmask; + stack_t uc_stack; + mcontext_t uc_mcontext; + ... +} ucontext_t; + +.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 ¤ÏÊݸ¤µ¤ì¤Æ¤¤¤ë¥³¥ó¥Æ¥­¥¹¥È¤Î +¥Þ¥·¥óÆÃÍ­¤Îɽ¸½·Á¼°¤Ç¤¢¤ê¡¢ +¤³¤³¤Ë¤Ï¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¥Þ¥·¥ó¥ì¥¸¥¹¥¿¤¬³ÊǼ¤µ¤ì¤ë¡£ +.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 ¤¬»Ø¤¹¹½Â¤ÂΤò¡¢ +¸½ºß¥¢¥¯¥Æ¥£¥Ö¤Ê¥³¥ó¥Æ¥­¥¹¥È¤Ë½é´ü²½¤¹¤ë¡£ +.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) +¤ÇÆÀ¤é¤ì¤¿¤â¤Î¤«¡¢ +¤¢¤ë¤¤¤Ï¥·¥°¥Ê¥ë¤ÎÂè»°°ú¿ô¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿¤â¤Î¤Ë¤Ê¤ë¡£ +.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 () +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤Æ¤¤¤¿¤â¤Î¤Î¾ì¹ç¤Ï¡¢ +¥×¥í¥°¥é¥à¤Ï¤³¤Î¸Æ¤Ó½Ð¤·¤«¤éÊ֤ä¿Ä¾¸å¤«¤é¤Î¤è¤¦¤Ë¼Â¹Ô¤ò·Ñ³¤¹¤ë¡£ +.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 ¤À¤Ã¤¿¾ì¹ç¤Ï¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ï½ªÎ»¤¹¤ë¡£ +.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 ¤Çºï½ü¤µ¤ì¤¿¤Î¤Ç¡¢ +¸½ºß¤ÎȽÃǤϡַë²Ì¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡×¤Ç¤¢¤ë¡£ +.\"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 +.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 +.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 () +¸Æ¤Ó½Ð¤·¤«¤é¤Î¤â¤Î¤Ç¤¢¤ë¤«¤ò +¶èÊ̤¹¤ëÍưפÊÊýË¡¤¬¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£ +¥æ¡¼¥¶¤Ï¡Ö¤·¤ª¤ê¡×µ¡¹½¤ò¼«Ê¬¤Çºî¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥ì¥¸¥¹¥¿ÊÑ¿ô¤Ï (¥ì¥¸¥¹¥¿¤Ï¥ê¥¹¥È¥¢¤µ¤ì¤Æ¤·¤Þ¤¦¤Î¤Ç) ¤³¤ì¤ò¤ä¤Ã¤Æ¤¯¤ì¤Ê¤¤¡£ +.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" +.SH ´ØÏ¢¹àÌÜ +.BR sigaction (2), +.BR sigaltstack (2), +.BR sigprocmask (2), +.BR longjmp (3), +.BR makecontext (3), +.BR sigsetjmp (3) diff --git a/draft/man2/getdents.2 b/draft/man2/getdents.2 new file mode 100644 index 00000000..5ddf4f9b --- /dev/null +++ b/draft/man2/getdents.2 @@ -0,0 +1,376 @@ +.\" 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 new file mode 100644 index 00000000..1c3d8b00 --- /dev/null +++ b/draft/man2/getdomainname.2 @@ -0,0 +1,207 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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-08-25 by Nicolas 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 +.SH ̾Á° +.\"O getdomainname, setdomainname \- get/set domain name +getdomainname, setdomainname \- ¥É¥á¥¤¥ó̾¤Î¼èÆÀ¡¦ÀßÄê¤ò¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int getdomainname(char *" name ", size_t " len ); +.br +.BI "int setdomainname(const char *" name ", size_t " len ); +.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 getdomainname (), +.BR setdomainname (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.ad b +.\"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 ¥Ð¥¤¥È¤ÏɬÍפʤ¤)¡£ + +.\"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" +.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 .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) ¤¬¤Ê¤¤)¡£ +.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" +.SH ½àµò +.\"O POSIX does not specify these calls. +.\"O .\" 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 ¥Ð¥¤¥È¤Ç¤¢¤Ã¤¿¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR gethostname (2), +.BR sethostname (2), +.BR uname (2) diff --git a/draft/man2/getdtablesize.2 b/draft/man2/getdtablesize.2 new file mode 100644 index 00000000..1970c0c6 --- /dev/null +++ b/draft/man2/getdtablesize.2 @@ -0,0 +1,128 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 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 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getdtablesize \- get descriptor table size +getdtablesize \- ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Æ¡¼¥Ö¥ë¤Î¥µ¥¤¥º¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B int getdtablesize(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 getdtablesize (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"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 ¤Ä¤Î¥×¥í¥»¥¹¤Î¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤ÎºÇÂçÃͤòÊÖ¤¹¡£ +ÊÖ¤êÃͤϥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¼è¤êÆÀ¤ëºÇÂçÃͤè¤ê 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) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤¬¤¢¤ë¡£ +²¼µ­¤Î¡ÖÃí°Õ¡×¤ò»²¾È¤Î¤³¤È¡£ +.\"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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR dup (2), +.BR getrlimit (2), +.BR open (2) diff --git a/draft/man2/getgid.2 b/draft/man2/getgid.2 new file mode 100644 index 00000000..b359c332 --- /dev/null +++ b/draft/man2/getgid.2 @@ -0,0 +1,67 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated Thu Jun 26 20:27:59 JST 1997 +.\" by SUTO, Mitsuaki +.\" +.TH GETGID 2 1993-07-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getgid, getegid \- get group identity +getgid, getegid \- ¥°¥ë¡¼¥× ID ¤òÆÀ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.B gid_t getgid(void); +.br +.B gid_t getegid(void); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR getgid () +.\"O returns the real group ID of the calling process. +.BR getgid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¥°¥ë¡¼¥× ID ¤òÊÖ¤¹¡£ + +.\"O .BR getegid () +.\"O returns the effective group ID of the calling process. +.BR getegid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O These functions are always successful. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001, 4.3BSD. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getresgid (2), +.BR setgid (2), +.BR setregid (2), +.BR credentials (7) diff --git a/draft/man2/getgroups.2 b/draft/man2/getgroups.2 new file mode 100644 index 00000000..b87c94eb --- /dev/null +++ b/draft/man2/getgroups.2 @@ -0,0 +1,268 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 Thu Oct 31 12:04:29 1996 by Eric S. Raymond +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" 2008-05-03, mtk, expanded and rewrote parts of DESCRIPTION and RETURN +.\" VALUE, made style of page more consistent with man-pages style. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-22, HANATAKA Shinya +.\" Updated 2001-02-10, Yuichi SATO +.\" Updated & Modified 2004-12-30, Yuichi SATO +.\" Updated 2008-08-04, Akihiro MOTOKI , LDP v3.05 +.\" +.\"WORD: group ¥°¥ë¡¼¥× +.\"WORD: access ¥¢¥¯¥»¥¹ +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: super user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\"WORD: supplementary group Êä½õ¥°¥ë¡¼¥× +.\" +.TH GETGROUPS 2 2008-06-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getgroups, setgroups \- get/set list of supplementary group IDs +getgroups, setgroups \- Êä½õ¥°¥ë¡¼¥× ID ¤Î¥ê¥¹¥È¤ò¼èÆÀ/ÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int getgroups(int " size ", gid_t " list []); +.sp +.B #include +.sp +.BI "int setgroups(size_t " size ", const gid_t *" list ); +.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 setgroups (): +_BSD_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.PP +.\"O .BR getgroups () +.\"O returns the supplementary group IDs of the calling process in +.\"O .IR list . +.\"O The argument +.\"O .I size +.\"O should be set to the maximum number of items that can be stored in the +.\"O buffer pointed to by +.\"O .IR list . +.\"O If the calling process is a member of more than +.\"O .I size +.\"O supplementary groups, then an error results. +.BR getgroups () +¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ÎÊä½õ¥°¥ë¡¼¥× (supplementary group) ID ¤ò +.I list +¤ËÊÖ¤¹¡£ +.I size +°ú¤­¿ô¤Ë¤Ï¡¢ +.I list +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤Ç¤­¤ëÍ×ÁǤκÇÂç¿ô¤òÀßÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬ +.I size +¸Ä¤è¤ê¿¤¯¤ÎÊä½õ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¤Î¾ì¹ç¤Ë¤Ï¡¢¥¨¥é¡¼¤È¤Ê¤ë¡£ +.\"O It is unspecified whether the effective group ID of the calling process +.\"O is included in the returned list. +.\"O (Thus, an application should also call +.\"O .BR getegid (2) +.\"O and add or remove the resulting value.) +¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤¬¡¢ +ÊÖ¤µ¤ì¤ë¥ê¥¹¥È¤Ë´Þ¤Þ¤ì¤ë¤«¤É¤¦¤«¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤ +(¤·¤¿¤¬¤Ã¤Æ¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï +.BR getegid (2) +¤ò¸Æ¤Ó½Ð¤·¡¢¤½¤Î·ë²Ì¤ÎÃͤòÄɲᦺï½ü¤¹¤Ù¤­¤Ç¤¢¤ë)¡£ + +.\"O If +.\"O .I size +.\"O is zero, +.\"O .I list +.\"O is not modified, but the total number of supplementary group IDs for the +.\"O process is returned. +.I size +¤¬ 0 ¤Ê¤é¤Ð¡¢ +.I list +¤Ï½¤Àµ¤µ¤ì¤Ê¤¤¤¬¡¢¤½¤Î¥×¥í¥»¥¹¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤Î¹ç·×¿ô¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O This allows the caller to determine the size of a dynamically allocated +.\"O .I list +.\"O to be used in a further call to +.\"O .BR getgroups (). +¤³¤ì¤ò»È¤¦¤³¤È¤Ç¡¢¤½¤ì°Ê¹ß¤Î +.BR getgroups () +¤Î¸Æ¤Ó½Ð¤·¤ÇɬÍפȤʤëưŪ³ä¤êÅö¤Æ¥Ð¥Ã¥Õ¥¡ +.I list +¤Î¥µ¥¤¥º¤ò¡¢¸Æ¤Ó½Ð¤·¸µ¤¬·èÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O .BR setgroups () +.\"O sets the supplementary group IDs for the calling process. +.\"O Appropriate privileges (Linux: the +.\"O .B CAP_SETGID +.\"O capability) are required. +.BR setgroups () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë¡£ +ŬÀÚ¤ÊÆø¢ (Linux ¤Ç¤Ï +.B CAP_SETGID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability)) ¤¬É¬ÍפǤ¢¤ë¡£ +.\"O The +.\"O .I size +.\"O argument specifies the number of supplementary group IDs +.\"O in the buffer pointed to by +.\"O .IR list . +.I size +°ú¤­¿ô¤Ë¤Ï¡¢ +.I list +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤¿Êä½õ¥°¥ë¡¼¥× ID ¤Î¿ô¤ò»ØÄꤹ¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR getgroups () +.\"O returns the number of supplementary group IDs. +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +.BR getgroups () +¤Ï¡¢À®¸ù¤¹¤ë¤ÈÊä½õ¥°¥ë¡¼¥× ID ¤Î¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ + +.\"O On success, +.\"O .BR setgroups () +.\"O returns 0. +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +.BR setgroups () +¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O .I list +.\"O has an invalid address. +.I list +¤¬ÉÔÀµ¤Ê¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.PP +.\"O .BR getgroups () +.\"O can additionally fail with the following error: +.BR getgroups () +¤Ï¡¢¾åµ­¤Ë²Ã¤¨¤Æ°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.\"O .I size +.\"O is less than the number of supplementary group IDs, but is not zero. +.I size +¤¬Êä½õ¥°¥ë¡¼¥× ID ¤Î¿ô¤è¤ê¾®¤µ¤¤¤¬ 0 ¤Ç¤Ê¤¤¡£ +.PP +.\"O .BR setgroups () +.\"O can additionally fail with the following errors: +.BR setgroups () +¤Ï¡¢¾åµ­¤Ë²Ã¤¨¤Æ°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.\"O .I size +.\"O is greater than +.\"O .B NGROUPS_MAX +.\"O (32 before Linux 2.6.4; 65536 since Linux 2.6.4). +.I size +¤¬ +.B NGROUPS_MAX +¤è¤êÂ礭¤¤ +.RB ( NGROUPS_MAX +¤Ï Linux 2.6.4 ¤è¤êÁ°¤Ç¤Ï 32¡¢Linux 2.6.4 °Ê¹ß¤Ç¤Ï 65536)¡£ +.TP +.B ENOMEM +.\"O Out of memory. +¥á¥â¥êÉÔ­¡£ +.TP +.B EPERM +.\"O The calling process has insufficient privilege. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬½½Ê¬¤ÊÆø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O SVr4, 4.3BSD. +.\"O The +.\"O .BR getgroups () +.\"O function is in POSIX.1-2001. +.\"O Since +.\"O .BR setgroups () +.\"O requires privilege, it is not covered by POSIX.1-2001. +SVr4, 4.3BSD. +.BR getgroups () +´Ø¿ô¤Ï POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR setgroups () +¤ÏÆø¢¤òɬÍפȤ¹¤ë¤¿¤á¡¢POSIX.1-2001 ¤Ë½¾¤Ã¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O A process can have up to +.\"O .B NGROUPS_MAX +.\"O supplementary group IDs +.\"O in addition to the effective group ID. +.\"O The set of supplementary group IDs +.\"O is inherited from the parent process, and preserved across an +.\"O .BR execve (2). +¥×¥í¥»¥¹¤Ï¡¢¼Â¸ú¥°¥ë¡¼¥× ID ¤Ë²Ã¤¨¡¢ºÇÂç +.B NGROUPS_MAX +¤Þ¤Ç¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +Êä½õ¥°¥ë¡¼¥× ID ¤Î½¸¹ç¤Ï¿Æ¥×¥í¥»¥¹¤«¤é·Ñ¾µ¤µ¤ì¡¢ +.BR execve (2) +¤ÎÁ°¸å¤ÇÊÝ»ý¤µ¤ì¤ë¡£ + +.\"O The maximum number of supplementary group IDs can be found using +.\"O .BR sysconf (3): +Êä½õ¥°¥ë¡¼¥× ID ¤ÎºÇÂç¿ô¤Ï +.BR sysconf (3) +¤ò»È¤Ã¤Æ°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë: +.nf + + long ngroups_max; + ngroups_max = sysconf(_SC_NGROUPS_MAX); + +.fi +.\"O The maximum return value of +.\"O .BR getgroups () +.\"O cannot be larger than one more than this value. +.BR getgroups () +¤ÎÊÖ¤êÃͤκÇÂçÃͤϡ¢¤³¤ÎÃͤè¤ê 1 Â礭¤¤Ãͤè¤êÂ礭¤¯¤Ê¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getgid (2), +.BR setgid (2), +.BR getgrouplist (3), +.BR initgroups (3), +.BR capabilities (7), +.BR credentials (7) diff --git a/draft/man2/gethostname.2 b/draft/man2/gethostname.2 new file mode 100644 index 00000000..7b09f0e9 --- /dev/null +++ b/draft/man2/gethostname.2 @@ -0,0 +1,303 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 +.\" 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 1995-07-22 by Michael Chastain : +.\" 'gethostname' is real system call on Linux/Alpha. +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2000-06-04, 2001-12-15 by aeb +.\" 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 2008-11-27 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O gethostname, sethostname \- get/set hostname +gethostname, sethostname \- ¥Û¥¹¥È̾¤Î¼èÆÀ¡¦ÀßÄê¤ò¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int gethostname(char *" name ", size_t " len ); +.br +.BI "int sethostname(const char *" name ", size_t " len ); +.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 gethostname (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR sethostname (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.ad b +.\"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 ¥Ð¥¤¥È¤ÏɬÍפʤ¤)¡£ + +.\"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" +.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 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" +.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 +.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 +.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, no null-terminator is included in the returned +.\"O .IR name . +¥³¥Ô¡¼¤ò¹Ô¤Ã¤¿ºÝ¤Ë¡¢¤³¤Î´Ø¿ô¤Ï +.I nodename +¤ÎŤµ¤¬ +.I len +°Ê¾å¤«¤Î³Îǧ¤ò¹Ô¤¤¡¢ +.I len +°Ê¾å¤Î¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B ENAMETOOLONG +¤òÀßÄꤹ¤ë¡£ +¤³¤Î¾ì¹ç¡¢ÊÖ¤µ¤ì¤¿ +.I name +¤Ë¤Ï½ªÃ¼¤Î 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" +.SH ´ØÏ¢¹àÌÜ +.BR getdomainname (2), +.BR setdomainname (2), +.BR uname (2) diff --git a/draft/man2/getitimer.2 b/draft/man2/getitimer.2 new file mode 100644 index 00000000..9e2b0f49 --- /dev/null +++ b/draft/man2/getitimer.2 @@ -0,0 +1,390 @@ +.\" Copyright 7/93 by Darren Senn +.\" Based on a similar page Copyright 1992 by Rick Faith +.\" May be freely distributed +.\" Modified Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond +.\" 2005-04-06 mtk, Matthias Lang +.\" Noted MAX_SEC_IN_JIFFIES ceiling +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-22, HANATAKA Shinya +.\" Updated 2005-04-23, Kentaro Shirakata +.\" Updated 2005-09-11, Kentaro Shirakata +.\" Updated 2006-07-23, Kentaro Shirakata +.\" Updated 2007-10-14, Akihiro MOTOKI +.\" Updated 2009-04-13, Akihiro MOTOKI, LDP v3.20 +.\" +.\" WORD: timer ¥¿¥¤¥Þ¡¼ +.\" WORD: jiffies jiffy +.\" +.TH GETITIMER 2 2009-03-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getitimer, setitimer \- ¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¡¼¤ÎÃͤò¼èÆÀ¤Þ¤¿¤ÏÀßÄꤹ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getitimer(int " which ", struct itimerval *" curr_value ); +.br +.BI "int setitimer(int " which ", const struct itimerval *" new_value , +.BI " struct itimerval *" old_value ); +.fi +.SH ÀâÌÀ +.\"O The system provides each process with three interval timers, each decrementing +.\"O in a distinct time domain. +.\"O When any timer expires, a signal is sent to the +.\"O process, and the timer (potentially) restarts. +¥·¥¹¥Æ¥à¤Ï 1 ¸Ä¤Î¥×¥í¥»¥¹¤Ë¤Ä¤­ 3 ¸Ä¤Î¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¡¼¤òÄ󶡤¹¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥¿¥¤¥Þ¡¼¤ÏÊÌ¡¹¤Î»þ´ÖÎΰè¤Ç¸º¾¯¤¹¤ë¡£ +¤É¤Î¥¿¥¤¥Þ¡¼¤âËþλ¤¹¤ë¤È¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¡¢ +¥¿¥¤¥Þ¡¼¤Ï (ÀßÄê¤Ë¤è¤Ã¤Æ¤Ï) ºÆ¤Ó³«»Ï¤µ¤ì¤ë¡£ +.TP 1.5i +.\"O .B ITIMER_REAL +.\"O decrements in real time, and delivers +.\"O .B SIGALRM +.\"O upon expiration. +.B ITIMER_REAL +¼Â»þ´Ö (real time) ¤Ç¸º¾¯¤·¡¢Ëþλ¤¹¤ë¤È +.B SIGALRM +¤¬Á÷¤é¤ì¤ë¡£ +.TP +.\"O .B ITIMER_VIRTUAL +.\"O decrements only when the process is executing, and delivers +.\"O .B SIGVTALRM +.\"O upon expiration. +.B ITIMER_VIRTUAL +¥×¥í¥»¥¹¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë´Ö¤Î¤ß¸º¾¯¤·¡¢Ëþλ¤¹¤ë¤È +.B SIGVTALRM +¤¬Á÷¤é¤ì¤ë¡£ +.TP +.\"O .B ITIMER_PROF +.\"O decrements both when the process executes and when the system is executing +.\"O on behalf of the process. +.\"O Coupled with +.\"O .BR ITIMER_VIRTUAL , +.\"O this timer is usually used to profile the time spent by the +.\"O application in user and kernel space. +.\"O .B SIGPROF +.\"O is delivered upon expiration. +.B ITIMER_PROF +¥×¥í¥»¥¹¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤Æ¡¢ +¤«¤Ä¥·¥¹¥Æ¥à¤¬¤½¤Î¥×¥í¥»¥¹¤Î¤¿¤á¤Ë½èÍý¤ò¹Ô¤Ê¤Ã¤Æ¤¤¤ë´Ö¤Ë¸º¾¯¤¹¤ë¡£ +¿¤¯¤Î¾ì¹ç¡¢¤³¤Î¥¿¥¤¥Þ¡¼¤Ï +.B ITIMER_VIRTUAL +¤ÈÁȤ߹ç¤ï¤µ¤ì¤Æ¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¥«¡¼¥Í¥ë¶õ´Ö¤È¥æ¡¼¥¶¡¼¶õ´Ö¤Ç +¤É¤ì¤À¤±¤Î»þ´Ö¤ò²á¤´¤·¤¿¤«¤ò¥×¥í¥Õ¥¡¥¤¥ë¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +Ëþλ¤¹¤ë¤È +.B SIGPROF +¤¬Á÷¤é¤ì¤ë¡£ +.LP +.\"O Timer values are defined by the following structures: +¥¿¥¤¥Þ¡¼¤ÎÃͤϰʲ¼¤Î¹½Â¤ÂΤˤè¤Ã¤ÆÄêµÁ¤µ¤ì¤ë: +.PD 0 +.in +4n +.nf + +struct itimerval { + struct timeval it_interval; /* next value */ + struct timeval it_value; /* current value */ +}; + +struct timeval { + long tv_sec; /* seconds */ + long tv_usec; /* microseconds */ +}; +.fi +.in +.PD +.LP +.\"O The function +.\"O .BR getitimer () +.\"O fills the structure pointed to by +.\"O .I curr_value +.\"O with the current setting for the timer specified by +.\"O .I which +.\"O (one of +.\"O .BR ITIMER_REAL , +.\"O .BR ITIMER_VIRTUAL , +.\"O or +.\"O .BR ITIMER_PROF ). +.BR getitimer () +´Ø¿ô¤Ï¡¢ +.I which +¤Ç»ØÄꤵ¤ì¤¿¥¿¥¤¥Þ¡¼ +.RB ( ITIMER_REAL , +.BR ITIMER_VIRTUAL , +.B ITIMER_PROF +¤Î¤É¤ì¤«) ¤Î¸½ºß¤ÎÀßÄê¤ò¡¢ +.I curr_value +¤Ç»ØÄꤵ¤ì¤¿¹½Â¤ÂΤ˳ÊǼ¤¹¤ë¡£ +.\"O The element +.\"O .I it_value +.\"O is set to the amount of time remaining on the timer, or zero if the timer +.\"O is disabled. +.\"O Similarly, +.\"O .I it_interval +.\"O is set to the reset value. +.I it_value +Í×ÁǤˤϥ¿¥¤¥Þ¡¼¤Î»Ä¤ê»þ´Ö¤¬ÀßÄꤵ¤ì¤ë¡£¥¿¥¤¥Þ¡¼¤¬¥ª¥Õ¤Î¾ì¹ç¤Ï +¥¼¥í¤¬ÀßÄꤵ¤ì¤ë¡£Æ±ÍÍ¤Ë +.I it_interval +¤Ë¤Ï½é´üÃͤ¬ÀßÄꤵ¤ì¤ë¡£ + +.\"O The function +.\"O .BR setitimer () +.\"O sets the specified timer to the value in +.\"O .IR new_value . +.BR setitimer () +´Ø¿ô¤Ï»ØÄꤵ¤ì¤¿¥¿¥¤¥Þ¡¼¤Ë +.I new_value +¤ÎÃͤòÀßÄꤹ¤ë¡£ +.\"O If +.\"O .I old_value +.\"O is non-NULL, the old value of the timer is stored there. +.I old_value +¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢¥¿¥¤¥Þ¡¼¤Î¸Å¤¤Ãͤ¬ +.I old_value +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.LP +.\"O Timers decrement from +.\"O .I it_value +.\"O to zero, generate a signal, and reset to +.\"O .IR it_interval . +¥¿¥¤¥Þ¡¼¤Ï +.I it_value +¤«¤é¥¼¥í¤Ø¸þ¤±¤Æ¸º¤Ã¤Æ¤¤¤­¡¢¥·¥°¥Ê¥ë¤òÀ¸À®¤·¡¢ +.I it_interval +¤Ë½é´ü²½¤µ¤ì¤ë¡£ +.\"O A timer which is set to zero +.\"O .RI ( it_value +.\"O is zero or the timer expires and +.\"O .I it_interval +.\"O is zero) stops. +¥¿¥¤¥Þ¡¼¤¬¥¼¥í¤ËÀßÄꤵ¤ì¤¿¾ì¹ç +.RI ( it_value +¤¬¥¼¥í¤«¡¢¥¿¥¤¥Þ¡¼¤¬Ëþλ¤·¤¿»þ¤Ë +.I it_interval +¤¬¥¼¥í¤Î¾ì¹ç) ¤ÏÄä»ß¤¹¤ë¡£ +.LP +.\"O Both +.\"O .I tv_sec +.\"O and +.\"O .I tv_usec +.\"O are significant in determining the duration of a timer. +¥¿¥¤¥Þ¡¼¤Î´ü´Ö¤Ï +.I tv_sec +¤È +.I tv_usec +¤ÎξÊý¤Ë¤è¤ê·èÄꤵ¤ì¤ë¡£ +.LP +.\"O Timers will never expire before the requested time, +.\"O but may expire some (short) time afterwards, which depends +.\"O on the system timer resolution and on the system load; see +.\"O .BR time (7). +.\"O (But see BUGS below.) +.\"O Upon expiration, a signal will be generated and the timer reset. +.\"O If the timer expires while the process is active (always true for +.\"O .BR ITIMER_VIRTUAL ) +.\"O the signal will be delivered immediately when generated. +.\"O Otherwise the +.\"O delivery will be offset by a small time dependent on the system loading. +Í׵ᤷ¤¿»þ´Ö¤¬¤¯¤ëÁ°¤Ë¥¿¥¤¥Þ¡¼¤¬Ëþλ¤¹¤ë¤³¤È¤Ï¤Ê¤¤¤¬¡¢ +µÕ¤Ë¤¢¤ë (û¤¤) »þ´Ö¤À¤±Ëþ뤬ÃÙ¤ì¤ë¤³¤È¤Ï¤¢¤ë¡£ +¤É¤ì¤À¤±ÃÙ¤ì¤ë¤«¤Ï¥·¥¹¥Æ¥à¤Î»þ´Öʬ²òǽ¤È¥·¥¹¥Æ¥à¤ÎÉé²Ù¤Ë°Í¸¤¹¤ë +.RB ( time (7) +»²¾È; ⤷¡¢¥Ð¥°¤Î¹à¤â»²¾È¤Î¤³¤È)¡£ +¥¿¥¤¥Þ¡¼¤¬Ëþλ¤¹¤ë¤È¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¡¢¥¿¥¤¥Þ¡¼¤Ï½é´ü²½¤µ¤ì¤ë¡£ +¥×¥í¥»¥¹¤¬¥¢¥¯¥Æ¥£¥Ö¤Ê»þ +.RB ( ITIMER_VIRTUAL +¤Î¾ì¹ç¤Ë¤Ï¾ï¤Ë¤½¤¦¤Ç¤¢¤ë) ¤Ë¥¿¥¤¥Þ¡¼¤¬Ëþλ¤·¤¿¾ì¹ç¡¢À¸À®¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ï +¤¹¤°¤ËÇÛÁ÷¤µ¤ì¤ë¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¥·¥¹¥Æ¥à¤ÎÉé²Ù¤Ë¤è¤ê¾¯¤·¤Î»þ´Ö¤À¤± +ÃÙ¤ì¤ÆÇÛÁ÷¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.\"O On success, zero is returned. +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤¬Ê֤롣¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬Ê֤ꡢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O .IR new_value , +.\"O .IR old_value , +.\"O or +.\"O .I curr_value +.\"O is not valid a pointer. +.IR new_value , +.IR old_value , +.I curr_value +¤¬Í­¸ú¤Ê¥Ý¥¤¥ó¥¿¡¼¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O .I which +.\"O is not one of +.\"O .BR ITIMER_REAL , +.\"O .BR ITIMER_VIRTUAL , +.\"O or +.\"O .BR ITIMER_PROF ; +.\"O or (since Linux 2.6.22) one of the +.\"O .I tv_usec +.\"O fields in the structure pointed to by +.\"O .I new_value +.\"O contains a value outside the range 0 to 999999. +.I which +¤¬ +.BR ITIMER_REAL , +.BR ITIMER_VIRTUAL , +.B ITIMER_PROF +¤Î¤É¤ì¤Ç¤â¤Ê¤¤¡£ +¤Þ¤¿¤Ï (Linux 2.6.22 °Ê¹ß¤Ç) +.I new_value +¤Ç»ØÄꤵ¤ì¤¿¹½Â¤ÂΤΠ+.I tv_usec +¥Õ¥£¡¼¥ë¥É¤Î°ì¤Ä¤¬ 0 °Ê¾å 999999 °Ê²¼¤ÎÈϰϤËÆþ¤é¤Ê¤¤ÃͤǤ¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O POSIX.1-2001, SVr4, 4.4BSD (this call first appeared in 4.2BSD). +POSIX.1-2001, SVr4, 4.4BSD (¤³¤Î¥³¡¼¥ë¤Ï 4.2BSD ¤Ç»Ï¤á¤Æ¸½¤ï¤ì¤¿). +.\"O POSIX.1-2008 marks +.\"O .BR getitimer () +.\"O and +.\"O .BR setitimer () +.\"O obsolete, recommending the use of the POSIX timers API +.\"O .RB ( timer_gettime (2), +.\"O .BR timer_settime (2), +.\"O etc.) instead. +POSIX.1-2008 ¤Ç¤Ï¡¢ +.BR getitimer () +¤È +.BR setitimer () +¤ÏÇÑ»ßͽÄê¤È¤µ¤ì¤Æ¤ª¤ê¡¢ +Âå¤ï¤ê¤Ë POSIX ¥¿¥¤¥Þ¡¼ API +.RB ( timer_gettime (2), +.BR timer_settime (2) +¤Ê¤É) ¤ò»È¤¦¤³¤È¤¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O A child created via +.\"O .BR fork (2) +.\"O does not inherit its parent's interval timers. +.\"O Interval timers are preserved across an +.\"O .BR execve (2). +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤Î¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¡¼¤ò·Ñ¾µ¤·¤Ê¤¤¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¤Ï¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¡¼¤ÏÊݸ¤µ¤ì¤ë¡£ + +.\"O POSIX.1 leaves the +.\"O interaction between +.\"O .BR setitimer() +.\"O and the three interfaces +.\"O .BR alarm (2), +.\"O .BR sleep (3), +.\"O and +.\"O .BR usleep (3) +.\"O unspecified. +POSIX.1 ¤Ç¤Ï¡¢ +.BR setitimer () +¤È¡¢ +.BR alarm (2), +.BR sleep (3), +.BR usleep (3) +¤È¤¤¤¦ 3 ¤Ä¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤È¤ÎÁê¸ß¤Î±Æ¶Á¤Ë¤Ä¤¤¤Æ¤Ïµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The generation and delivery of a signal are distinct, and +.\"O only one instance of each of the signals listed above may be pending +.\"O for a process. +.\"O Under very heavy loading, an +.\"O .B ITIMER_REAL +.\"O timer may expire before the signal from a previous expiration +.\"O has been delivered. +.\"O The second signal in such an event will be lost. +¥·¥°¥Ê¥ë¤ÎÀ¸À®¤ÈÇÛÁ÷¤ÏÊ̸ĤΤâ¤Î¤Ç¤¢¤ê¡¢ +Á°½Ò¤Î¥·¥°¥Ê¥ë¤Î¤½¤ì¤¾¤ì¤Ë¤Ä¤¤¤Æ°ì¤Ä¤À¤±¤¬¥×¥í¥»¥¹¤Î¤¿¤á¤Ë +ÂÔµ¡¤¹¤ë¡£ +Èó¾ï¤Ë½Å¤¤Éé²Ù¤Î²¼¤Ç¤Ï¡¢ +.B ITIMER_REAL +¥¿¥¤¥Þ¡¼¤Ç¤Ï¡¢»þ´ÖÀÚ¤ì¤Ë¤è¤êÀ¸À®¤µ¤ì¤¿°ì¤ÄÁ°¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ëÁ°¤Ë¡¢ +¼¡¤Î»þ´ÖÀڤ줬µ¯¤³¤ë¾ì¹ç¤¬¤¢¤ë¡£ +¤½¤Î¤è¤¦¤Ê¾ì¹ç¡¢ 2 ¸Ä¤á¤Î¥¤¥Ù¥ó¥È¤ËÂФ¹¤ë¥·¥°¥Ê¥ë¤Ï¼º¤ï¤ì¤Æ¤·¤Þ¤¦¡£ + +.\"O On Linux kernels before 2.6.16, timer values are represented in jiffies. +¥Ð¡¼¥¸¥ç¥ó 2.6.16 ¤è¤êÁ°¤Î Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¥¿¥¤¥Þ¡¼¤ÎÃÍ¤Ï jiffy ¤Çɽ¸½¤µ¤ì¤ë¡£ +.\"O If a request is made set a timer with a value whose jiffies +.\"O representation exceeds +.\"O .B MAX_SEC_IN_JIFFIES +.\"O (defined in +.\"O .IR include/linux/jiffies.h ), +.\"O then the timer is silently truncated to this ceiling value. +.\"O On Linux/i386 (where, since Linux 2.6.13, +.\"O the default jiffy is 0.004 seconds), +.\"O this means that the ceiling value for a timer is +.\"O approximately 99.42 days. +Í׵᤬ jiffy ɽ¸½¤Ç +.RI ( include/linux/jiffies.h +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë) +.B MAX_SEC_IN_JIFFIES +¤ò±Û¤¨¤ëÃͤò¥¿¥¤¥Þ¡¼¤ËÀßÄꤷ¤è¤¦¤È¤¹¤ë¤â¤Î¤Î¾ì¹ç¡¢ +¥¿¥¤¥Þ¡¼¤Ï°ÅÌۤˤ³¤Î¾å¸ÂÃͤËÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +Linux/i386 ¤Î¾ì¹ç (Linux 2.6.13 °Ê¹ß¤Ç¤Ï jiffy ¤Ï 0.004 ÉÃ) ¤Î¾ì¹ç¡¢ +¤³¤ì¤Ï¥¿¥¤¥Þ¡¼¤Î¾å¸ÂÃͤ¬¤ª¤è¤½ 99.42 Æü¤Ë¤Ê¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.\"O Since Linux 2.6.16, +.\"O the kernel uses a different internal representation for times, +.\"O and this ceiling is removed. +Linux 2.6.16 °Ê¹ß¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤Ï»þ´Ö¤Ë´Ø¤¹¤ëÆâÉôɽ¸½¤È¤·¤Æ +°Û¤Ê¤ëɽ¸½¤ò»È¤¦¤è¤¦¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢¤³¤Î¾å¸Â¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£ + +.\"O On certain systems (including i386), +.\"O Linux kernels before version 2.6.12 have a bug which will produce +.\"O premature timer expirations of up to one jiffy under some circumstances. +.\"O This bug is fixed in kernel 2.6.12. +(i386 ¤ò´Þ¤à) ¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +¥Ð¡¼¥¸¥ç¥ó 2.6.12 °ÊÁ°¤Î Linux ¥«¡¼¥Í¥ë¤Ï +¤¢¤ë¼ï¤Î¾õ¶·¤Ç¤Ï 1 jiffy Á᤯¥¿¥¤¥Þ¡¼¤¬½ªÎ»¤·¤Æ¤·¤Þ¤¦¤È¤¤¤¦¥Ð¥°¤¬¤¢¤Ã¤¿¡£ +¤³¤Î¥Ð¥°¤Ï¥«¡¼¥Í¥ë 2.6.12 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ +.\" 4 Jul 2005: It looks like this bug may remain in 2.4.x. +.\" http://lkml.org/lkml/2005/7/1/165 + +.\"O POSIX.1-2001 says that +.\"O .BR setitimer () +.\"O should fail if a +.\"O .I tv_usec +.\"O value is specified that is outside of the range 0 to 999999. +.\"O However, in kernels up to and including 2.6.21, +.\"O Linux does not give an error, but instead silently +.\"O adjusts the corresponding seconds value for the timer. +POSIX.1-2001 ¤Ç¤Ï +.BR setitimer () +¤Ï +.I tv_usec +¤ÎÃͤ¬ 0 ¤«¤é 999999 ¤ÎÈϰϳ°¤Ç¤¢¤ë¾ì¹ç¤Ë¤Ï¼ºÇÔ¤¹¤ë¤Ù¤­¤À¤È¤·¤Æ¤¤¤ë¡£ +¤·¤«¤·¡¢2.6.21 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Î Linux ¤Ç¤Ï¥¨¥é¡¼¤Ë¤Ê¤é¤º¡¢ +Âбþ¤¹¤ëÉÿô¤Îʬ¤À¤±¤½¤Î¥¿¥¤¥Þ¡¼¤ÎÉäÎÃͤ¬°ÅÌÛ¤ËÄ´À°¤µ¤ì¤ë¡£ +.\"O From kernel 2.6.22 onwards, +.\"O this nonconformance has been repaired: +.\"O an improper +.\"O .I tv_usec +.\"O value results in an +.\"O .B EINVAL +.\"O error. +¥«¡¼¥Í¥ë 2.6.22 °Ê¹ß¤Ç¤Ï¡¢¤³¤Îɸ½àÈó½àµò¤ÎÆ°ºî¤Ï½¤Àµ¤µ¤ì¡¢ +.I tv_usec +¤ÎÃͤ¬ÉÔŬÀڤʾì¹ç¤Ë¤Ï +.B EINVAL +¥¨¥é¡¼¤È¤Ê¤ë¡£ +.\" Bugzilla report 25 Apr 2006: +.\" http://bugzilla.kernel.org/show_bug.cgi?id=6443 +.\" "setitimer() should reject noncanonical arguments" +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR gettimeofday (2), +.BR sigaction (2), +.BR signal (2), +.BR timer_create (2), +.BR timerfd_create (2), +.BR time (7) diff --git a/draft/man2/getpagesize.2 b/draft/man2/getpagesize.2 new file mode 100644 index 00000000..e2db5424 --- /dev/null +++ b/draft/man2/getpagesize.2 @@ -0,0 +1,163 @@ +.\" 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 2007-07-26 "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 (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"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/getpeername.2 b/draft/man2/getpeername.2 new file mode 100644 index 00000000..c35f6540 --- /dev/null +++ b/draft/man2/getpeername.2 @@ -0,0 +1,192 @@ +.\" 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. +.\" +.\" @(#)getpeername.2 6.5 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 16:37:50 1993 by Rik Faith +.\" Modified Thu Jul 30 14:37:50 1993 by Martin Schulze +.\" Modified Sun Mar 28 21:26:46 1999 by Andries Brouwer +.\" Modified 17 Jul 2002, Michael Kerrisk +.\" Added 'socket' to NAME, so that "man -k socket" will show this page. +.\" +.\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Apr 3 14:53:19 JST 1999 +.\" by HANATAKA Shinya +.\" Updated Tue Nov 26 JST 2002 by Kentaro Shirakata +.\" +.\"WORD: connect Àܳ +.\"WORD: peer Áê¼ê +.\"WORD: socket ¥½¥±¥Ã¥È +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡ +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: argument °ú¤­¿ô +.\" +.TH GETPEERNAME 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getpeername \- get name of connected peer socket +getpeername \- Àܳ¤·¤Æ¤¤¤ëÁê¼ê¥½¥±¥Ã¥È¤Î̾Á°¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int getpeername(int " sockfd ", struct sockaddr *" addr \ +", socklen_t *" addrlen ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR getpeername () +.\"O returns the address of the peer connected to the socket +.\"O .IR sockfd , +.\"O in the buffer pointed to by +.\"O .IR addr . +.BR getpeername () +¤Ï¡¢¥½¥±¥Ã¥È(socket) +.I sockfd +¤ËÀܳ¤·¤Æ¤¤¤ëÁê¼ê¤Î¥¢¥É¥ì¥¹¤ò¡¢ +.I addr +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.\"O The +.\"O .I addrlen +.\"O argument should be initialized to indicate the amount of space pointed to +.\"O by +.\"O .IR addr . +.I addrlen +°ú¤­¿ô¤Ï¡¢ +.I addr +¤¬»Ø¤·¤Æ¤¤¤ëÎΰè¤Î¥µ¥¤¥º¤Ë½é´ü²½¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O On return it contains the actual size of the name returned (in bytes). +.\"O The name is truncated if the buffer provided is too small. +´Ø¿ô¤¬ÊÖ¤ë»þ¤Ë¤Ï¡¢ +.I addrlen +¤Ë¤Ï¼ÂºÝ¤ËÊÖ¤µ¤ì¤¿Ì¾Á°¤Î¥µ¥¤¥º¤¬ (¥Ð¥¤¥Èñ°Ì¤Ç) ³ÊǼ¤µ¤ì¤ë¡£ +Ä󶡤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ¤¹¤®¤¿¾ì¹ç¤Ë¤Ï¡¢Ì¾Á°¤ÏÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ + +.\"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" +.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 EBADF +.\"O The argument +.\"O .I sockfd +.\"O is not a valid descriptor. +°ú¤­¿ô +.I sockfd +¤¬Í­¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.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 +.B ENOTCONN +.\"O The socket is not connected. +¥½¥±¥Ã¥È¤¬Àܳ¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTSOCK +.\"O The argument +.\"O .I sockfd +.\"O is a file, not a socket. +°ú¤­¿ô +.I sockfd +¤¬¥½¥±¥Ã¥È¤Ç¤Ê¤¯¤Æ¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O SVr4, 4.4BSD (the +.\"O .BR getpeername () +.\"O function call first appeared in 4.2BSD), POSIX.1-2001. +SVr4, 4.4BSD +.RB ( getpeername () +´Ø¿ô¤Ï 4.2BSD ¤ÇÅо줷¤¿), POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The third argument of +.\"O .BR getpeername () +.\"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 getpeername () +¤Î»°ÈÖÌܤΰú¤­¿ô¤Ï¼ÂºÝ¤Ë¤Ï +.I `int *' +¤Ç¤¢¤ë (4.x BSD, libc4, libc5 ¤Ç¤Ï +¤³¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë)¡£ +POSIX ¤Ç¤Ïäþ;¶ÊÀÞ¤ò·Ð¤Æ¸½ºß¤Î +.I socklen_t +¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +glibc ¤Ç¤â +.I socklen_t +¤ò»È¤Ã¤Æ¤¤¤ë¡£ +.BR accept (2) +¤â»²¾È¤Î¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR accept (2), +.BR bind (2), +.BR getsockname (2), +.BR ip (7), +.BR socket (7), +.BR unix (7) diff --git a/draft/man2/getpid.2 b/draft/man2/getpid.2 new file mode 100644 index 00000000..c3713599 --- /dev/null +++ b/draft/man2/getpid.2 @@ -0,0 +1,155 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" 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 SUTO, Mitsuaki +.\" and Copyright(c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jun 26 20:33:01 JST 1997 +.\" by SUTO, Mitsuaki +.\" Updated 2008-10-03, Akihiro MOTOKI, LDP v3.10 +.\" +.TH GETPID 2 2008-09-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getpid, getppid \- get process identification +getpid, getppid \- ¥×¥í¥»¥¹ ID ¤òÆÀ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.B pid_t getpid(void); +.br +.B pid_t getppid(void); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR getpid () +.\"O returns the process ID of the calling process. +.\"O (This is often used by +.\"O routines that generate unique temporary filenames.) +.BR getpid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤òÊÖ¤¹¡£(¥Æ¥ó¥Ý¥é¥êÍѤΥե¡¥¤¥ë̾¤È¤·¤Æ +¾¤È½Å¤Ê¤é¤Ê¤¤Ì¾Á°¤òÀ¸À®¤¹¤ë¥ë¡¼¥Á¥ó¤Ç¤·¤Ð¤·¤Ð»ÈÍѤµ¤ì¤ë¡£) + +.\"O .BR getppid () +.\"O returns the process ID of the parent of the calling process. +.BR getppid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¿Æ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O These functions are always successful. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001, 4.3BSD, SVr4. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Since glibc version 2.3.4, +.\"O the glibc wrapper function for +.\"O .BR getpid () +.\"O caches PIDs, +.\"O so as to avoid additional system calls when a process calls +.\"O .BR getpid () +.\"O repeatedly. +glibc ¥Ð¡¼¥¸¥ç¥ó 2.3.4 °Ê¹ß¤Ç¤Ï¡¢ +glibc ¤Î +.BR getpid () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï PID ¤ò¥­¥ã¥Ã¥·¥å¤¹¤ë¡£ +¤³¤ì¤Ï¡¢¥×¥í¥»¥¹¤¬·«¤êÊÖ¤· +.BR getpid () +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤Ë¤½¤ÎÅÔÅÙ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ö¤Î¤òÈò¤±¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.\"O Normally this caching is invisible, +.\"O but its correct operation relies on support in the wrapper functions for +.\"O .BR fork (2), +.\"O .BR vfork (2), +.\"O and +.\"O .BR clone (2): +.\"O if an application bypasses the glibc wrappers for these system calls by using +.\"O .BR syscall (2), +.\"O then a call to +.\"O .BR getpid () +.\"O in the child will return the wrong value +.\"O (to be precise: it will return the PID of the parent process). +Ä̾ï¤Ï¡¢¤³¤Î¥­¥ã¥Ã¥·¥å½èÍý¤¬¸«¤¨¤ë¤³¤È¤Ï¤Ê¤¤¤¬¡¢ +¥­¥ã¥Ã¥·¥å½èÍý¤¬Àµ¤·¤¯Æ¯¤¯¤¿¤á¤Ë¤Ï +.BR fork (2), +.BR vfork (2), +.BR clone (2) +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ç¤Î¥µ¥Ý¡¼¥È¤¬É¬ÍפǤ¢¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë¡¢ +glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤ò·Ðͳ¤»¤º¤Ë +.BR syscall (2) +¤ò»È¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢»Ò¥×¥í¥»¥¹¤Ç +.BR getpid () +¤ò¸Æ¤Ó½Ð¤¹¤È´Ö°ã¤Ã¤¿Ãͤ¬Ê֤뤳¤È¤À¤í¤¦ +(Àµ³Î¤Ë¤¤¤¦¤È¡¢¿Æ¥×¥í¥»¥¹¤Î PID ¤¬ÊÖ¤µ¤ì¤ë)¡£ +.\" The following program demonstrates this "feature": +.\" +.\" #define _GNU_SOURCE +.\" #include +.\" #include +.\" #include +.\" #include +.\" #include +.\" +.\" int +.\" main(int argc, char *argv[]) +.\" { +.\" /* The following statement fills the getpid() cache */ +.\" +.\" printf("parent PID = %ld\n", (long) getpid()); +.\" +.\" if (syscall(SYS_fork) == 0) { +.\" if (getpid() != syscall(SYS_getpid)) +.\" printf("child getpid() mismatch: getpid()=%ld; " +.\" "syscall(SYS_getpid)=%ld\n", +.\" (long) getpid(), (long) syscall(SYS_getpid)); +.\" exit(EXIT_SUCCESS); +.\" } +.\" wait(NULL); +.\"} +.\"O See also +.\"O .BR clone (2) +.\"O for discussion of a case where +.\"O .BR getpid () +.\"O may return the wrong value even when invoking +.\"O .BR clone (2) +.\"O via the glibc wrapper function. +.BR clone (2) +¤ò glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô·Ðͳ¤Çµ¯Æ°¤·¤¿ºÝ¤Ë¤â +.BR getpid () +¤¬´Ö°ã¤Ã¤¿ÃͤòÊÖ¤¹¾ì¹ç¤¬¤¢¤ê¡¢¤³¤ì¤Ë´Ø¤¹¤ëµÄÏÀ¤Ï +.BR clone (2) +¤â»²¾È¤·¤Æ¤Û¤·¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR fork (2), +.BR kill (2), +.BR exec (3), +.BR mkstemp (3), +.BR tempnam (3), +.BR tmpfile (3), +.BR tmpnam (3), +.BR credentials (7) diff --git a/draft/man2/getpriority.2 b/draft/man2/getpriority.2 new file mode 100644 index 00000000..27e0af5c --- /dev/null +++ b/draft/man2/getpriority.2 @@ -0,0 +1,395 @@ +.\" Copyright (c) 1980, 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. +.\" +.\" @(#)getpriority.2 6.9 (Berkeley) 3/10/91 +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-07-01 by Andries Brouwer +.\" Modified 1996-11-06 by Eric S. Raymond +.\" Modified 2001-10-21 by Michael Kerrisk +.\" Corrected statement under EPERM to clarify privileges required +.\" Modified 2002-06-21 by Michael Kerrisk +.\" Clarified meaning of 0 value for 'who' argument +.\" Modified 2004-05-27 by Michael Kerrisk +.\" +.\" FIXME Oct 2008: Denys Vlasenko is working on a PRIO_THREAD feature that +.\" is likely to get included in mainline; this will need to be documented. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-22, HANATAKA Shinya +.\" Modified 2001-08-17, HANATAKA Shinya +.\" Modified 2001-10-18, Akihiro MOTOKI +.\" Updated 2001-12-13, Kentaro Shirakata +.\" Updated 2002-10-16, Kentaro Shirakata +.\" Updated 2005-02-24, Akihiro MOTOKI +.\" Updated 2005-10-07, Akihiro MOTOKI +.\" Updated 2008-08-04, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: scheduling ¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +.\"WORD: piority Í¥ÀèÅÙ +.\"WORD: call ¥³¡¼¥ë +.\"WORD: user-ID UID +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: user ¥æ¡¼¥¶¡¼ +.\"WORD: super user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\"WORD: effective user-ID ¼Â¸úUID +.\"WORD: real user-ID ¼ÂUID +.\" +.TH GETPRIORITY 2 2008-05-29 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getpriority, setpriority \- get/set program scheduling priority +getpriority, setpriority \- ¥×¥í¥°¥é¥à¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ÎÍ¥ÀèÅÙ¤ò¼èÆÀ/ÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int getpriority(int " which ", int " who ); +.br +.BI "int setpriority(int " which ", int " who ", int " prio ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The scheduling priority of the process, process group, or user, as +.\"O indicated by +.\"O .I which +.\"O and +.\"O .I who +.\"O is obtained with the +.\"O .BR getpriority () +.\"O call and set with the +.\"O .BR setpriority () +.\"O call. +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR getpriority () +¤ä +.BR setpriority () +¤Ï¡¢ +.I which +¤È +.I who +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¡¢¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¢¥æ¡¼¥¶¡¼¤Î +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Í¥ÀèÅÙ (scheduling priority) ¤Î +¼èÆÀ¤äÀßÄê¤ò¤½¤ì¤¾¤ì¹Ô¤¦¡£ + +.\"O The value +.\"O .I which +.\"O is one of +.\"O .BR PRIO_PROCESS , +.\"O .BR PRIO_PGRP , +.\"O or +.\"O .BR PRIO_USER , +.\"O and +.\"O .I who +.\"O is interpreted relative to +.\"O .I which +.\"O (a process identifier for +.\"O .BR PRIO_PROCESS , +.\"O process group +.\"O identifier for +.\"O .BR PRIO_PGRP , +.\"O and a user ID for +.\"O .BR PRIO_USER ). +.I which +¤ÎÃÍ¤Ï +.BR PRIO_PROCESS , +.BR PRIO_PGRP , +.BR PRIO_USER , +¤Î¤É¤ì¤«°ì¤Ä¤Ç¡¢ +.I who +¤Ï +.I which +¤Ë±þ¤¸¤Æ²ò¼á¤µ¤ì¤ë +.RB ( PRIO_PROCESS +¤À¤È¥×¥í¥»¥¹¼±Ê̻ҡ¢ +.B PRIO_PGRP +¤À¤È¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¼±Ê̻ҡ¢ +.B PRIO_USER +¤À¤È UID (¥æ¡¼¥¶ID) ¤È²ò¼á¤µ¤ì¤ë)¡£ +.\"O A zero value for +.\"O .I who +.\"O denotes (respectively) the calling process, the process group of the +.\"O calling process, or the real user ID of the calling process. +.I who +¤¬¥¼¥í¤Ê¤é¤Ð¡¢(¤½¤ì¤¾¤ì)¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼ÂUID ¤ò°ÕÌ£¤¹¤ë¡£ +.\"O .I Prio +.\"O is a value in the range \-20 to 19 (but see the Notes below). +.\"O The default priority is 0; +.\"O lower priorities cause more favorable scheduling. +.I prio +¤Ï \-20 ¤«¤é 19 ¤ÎÈϰϤÎÃÍ¤Ç (⤷°Ê²¼¤ÎÃí°Õ¤Î¹à¤ò»²¾È¤Î¤³¤È)¡¢ +¥Ç¥Õ¥©¥ë¥È¤ÎÍ¥ÀèÅÙ¤Ï 0 ¤Ç¤¢¤ë; +¾®¤µ¤Ê¿ô»ú¤Û¤É¡¢Í­Íø¤Ê¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤È¤Ê¤ë¡£ + +.\"O The +.\"O .BR getpriority () +.\"O call returns the highest priority (lowest numerical value) +.\"O enjoyed by any of the specified processes. +.\"O The +.\"O .BR setpriority () +.\"O call sets the priorities of all of the specified processes +.\"O to the specified value. +.\"O Only the superuser may lower priorities. +.BR getpriority () +¥³¡¼¥ë¤Ï»ØÄꤷ¤¿¥×¥í¥»¥¹¤ÎÃæ¤ÎºÇ¤â¹â¤¤Í¥ÀèÅÙ (¿ôÃÍŪ¤Ë¤ÏºÇ¾®¤ÎÃÍ) ¤òÊÖ¤¹¡£ +.BR setpriority () +¥³¡¼¥ë¤Ï»ØÄꤷ¤¿¥×¥í¥»¥¹Á´¤Æ¤ÎÍ¥ÀèÅÙ¤ò»ØÄꤷ¤¿ÃͤËÀßÄꤹ¤ë¡£ +Í¥ÀèÅÙ¤òº£¤è¤ê¾®¤µ¤¤ÃͤËÀßÄê¤Ç¤­¤ë¤Î¤Ï¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤À¤±¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O Since +.\"O .BR getpriority () +.\"O can legitimately return the value \-1, it is necessary +.\"O to clear the external variable +.\"O .I errno +.\"O prior to the +.\"O call, then check it afterwards to determine +.\"O if \-1 is an error or a legitimate value. +.\"O The +.\"O .BR setpriority () +.\"O call returns 0 if there is no error, or +.\"O \-1 if there is. +.BR getpriority () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤â \-1 ¤ÎÃͤòÊÖ¤¹²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¡¢ +¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë³°ÉôÊÑ¿ô¤Î +.I errno +¤ò¥¯¥ê¥¢¤·¡¢¸Æ¤Ó½Ð¤·¤Î¸å¤ËÊÖ¤êÃͤΠ\-1 ¤¬ÀµÅö¤ÊÃͤ« +¥¨¥é¡¼¤«¤òȽÊ̤¹¤ëɬÍפ¬¤¢¤ë¡£ +.BR setpriority () +¥³¡¼¥ë¤Ï¥¨¥é¡¼¤¬¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤¬¤¢¤ì¤Ð \-1 ¤òÊÖ¤¹¡£ + +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O .I which +.\"O was not one of +.\"O .BR PRIO_PROCESS , +.\"O .BR PRIO_PGRP , +.\"O or +.\"O .BR PRIO_USER . +.I which +¤¬ +.BR PRIO_PROCESS , +.BR PRIO_PGRP , +.B PRIO_USER +¤Î¤¤¤º¤ì¤Ç¤â¤Ê¤¤¡£ +.TP +.B ESRCH +.\"O No process was located using the +.\"O .I which +.\"O and +.\"O .I who +.\"O values specified. +.I which +¤È +.I who +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +.PP +.\"O In addition to the errors indicated above, +.\"O .BR setpriority () +.\"O may fail if: +¾åµ­¤Î¤â¤Î¤Ë²Ã¤¨¤Æ +.BR setpriority () +¤Ç¤Ï°Ê²¼¤Î¥¨¥é¡¼¤¬¤¢¤ë: +.TP +.B EACCES +.\"O The caller attempted to lower a process priority, but did not +.\"O have the required privilege (on Linux: did not have the +.\"O .B CAP_SYS_NICE +.\"O capability). +.\"O Since Linux 2.6.12, this error only occurs if the caller attempts +.\"O to set a process priority outside the range of the +.\"O .B RLIMIT_NICE +.\"O soft resource limit of the target process; see +.\"O .BR getrlimit (2) +.\"O for details. +¸Æ¤Ó½Ð¤·¸µ¤¬¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤ò²¼¤²¤è¤¦¤È¤·¤¿¤¬¡¢É¬ÍפÊÆø¢¤ò +»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿ (Linux ¤Î¾ì¹ç¡¢ +.B CAP_SYS_NICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤«¤Ã¤¿)¡£ +Linux 2.6.12 °Ê¹ß¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤¬¡¢¤¢¤ë¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤ò¡¢ +Êѹ¹ÂÐ¾Ý¤Î¥×¥í¥»¥¹¤Î¥ê¥½¡¼¥¹ +.B RLIMIT_NICE +¤Î¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤ÎÈϰϳ°¤ËÀßÄꤷ¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¤Î¤ß¡¢ +¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¡£¾ÜºÙ¤Ï +.BR getrlimit (2) +¤ò»²¾È¡£ +.TP +.B EPERM +.\"O A process was located, but its effective user ID did not match +.\"O either the effective or the real user ID of the caller, +.\"O and was not privileged (on Linux: did not have the +.\"O .B CAP_SYS_NICE +.\"O capability). +.\"O But see NOTES below. +¥×¥í¥»¥¹¤Ï¸«¤Ä¤«¤Ã¤¿¤¬¡¢¤½¤Î¥×¥í¥»¥¹¤Î¼Â¸ú (effective) UID ¤¬ +¸Æ¤Ó½Ð¤·¸µ¤Î¼Â¸úUID ¤Ë¤â¼Â (real) UID ¤Ë¤â°ìÃפ»¤º¡¢ +¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢¤â»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿ (Linux ¤Î¾ì¹ç¡¢ +.B CAP_SYS_NICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤«¤Ã¤¿)¡£ +°Ê²¼¤Î¡ÖÃí°Õ¡×¤â»²¾È¤Î¤³¤È¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O SVr4, 4.4BSD (these function calls first appeared in 4.2BSD), +.\"O POSIX.1-2001. +SVr4, 4.4BSD (¤³¤ì¤é¤Î´Ø¿ô¤Ï 4.2BSD ¤ÇºÇ½é¤ËÅо줷¤¿), +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O A child created by +.\"O .BR fork (2) +.\"O inherits its parent's nice value. +.\"O The nice value is preserved across +.\"O .BR execve (2). +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤Î nice Ãͤò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç nice ÃͤÏÊݸ¤µ¤ì¤ë¡£ + +.\"O The degree to which their relative nice value affects the scheduling of +.\"O processes varies across Unix systems, and, +.\"O on Linux, across kernel versions. +.\"O Starting with kernel 2.6.23, Linux adopted an algorithm that causes +.\"O relative differences in nice values to have a much stronger effect. +.\"O This causes very low nice values (+19) to truly provide little CPU +.\"O to a process whenever there is any other +.\"O higher priority load on the system, +.\"O and makes high nice values (\-20) deliver most of the CPU to applications +.\"O that require it (e.g., some audio applications). +ÁêÂÐŪ¤Ê nice Ãͤΰ㤤¤¬¥×¥í¥»¥¹´Ö¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ë¤É¤ÎÄøÅٱƶÁ¤òÍ¿¤¨¤ë¤« +¤Ï¡¢Unix ¥·¥¹¥Æ¥à´Ö¤Ç°Û¤Ê¤ê¡¢Linux ¤Ç¤Ï¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê°Û¤Ê¤ë¡£ +Linux ¤Ï¡¢¥«¡¼¥Í¥ë 2.6.23 °Ê¹ß¤Ç¡¢nice ÃͤÎÁêÂÐŪ¤Ê°ã¤¤¤¬¡¢Èó¾ï¤Ë¶¯¤¤±Æ¶Á¤ò +Í¿¤¨¤ë¥¢¥ë¥´¥ê¥º¥à¤òºÎÍѤ·¤¿¡£¤³¤Î¥¢¥ë¥´¥ê¥º¥à¤Ç¤Ï¡¢ +¾¤ËÍ¥ÀèÅ٤ι⤤¤â¤Î¤¬¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë»þ¤Ë¤Ï¡¢ +Èó¾ï¤ËÄ㤤 nice ÃÍ (+19) ¤Ç¤Ï¥×¥í¥»¥¹¤ËËÜÅö¤Ë¤Û¤È¤ó¤É CPU ¤¬³ä¤êÅö¤Æ¤é¤ì¤Ê¤¤¡£ +¤Þ¤¿¡¢¹â¤¤ nice ÃÍ (\-20) ¤Ç¤Ï CPU ¤òɬÍפȤ¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó (Î㤨¤Ð +¥ª¡¼¥Ç¥£¥ª¡¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó) ¤Ë CPU ¤Î¤Û¤È¤ó¤É¤¬³ä¤êÅö¤Æ¤é¤ì¤ë¡£ + +.\"O The details on the condition for +.\"O .B EPERM +.\"O depend on the system. +.B EPERM +¤¬È¯À¸¤¹¤ë¾ò·ï¤Î¾ÜºÙ¤Ï¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¡£ +.\"O The above description is what POSIX.1-2001 says, and seems to be followed on +.\"O all System V-like systems. +¾åµ­¤ÎÀâÌÀ¤Ï POSIX.1-2001 ¤Î¤â¤Î¤Ç¤¢¤ê¡¢Á´¤Æ¤Î System V É÷¥·¥¹¥Æ¥à¤Ï +¤³¤ì¤Ë½¾¤Ã¤Æ¤¤¤ë¤è¤¦¤Ç¤¢¤ë¡£ +.\"O Linux kernels before 2.6.12 required the real or +.\"O effective user ID of the caller to match +.\"O the real user of the process \fIwho\fP (instead of its effective user ID). +2.6.12 ¤è¤êÁ°¤Î Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¼Â UID ¤Þ¤¿¤Ï +¼Â¸ú UID ¤¬¥×¥í¥»¥¹ \fIwho\fP ¤Î (¼Â¸ú UID ¤Ç¤Ê¤¯) +¼Â UID ¤Ë°ìÃפ¹¤ëɬÍפ¬¤¢¤ë¡£ +.\"O Linux 2.6.12 and later require +.\"O the effective user ID of the caller to match +.\"O the real or effective user ID of the process \fIwho\fP. +.\"O All BSD-like systems (SunOS 4.1.3, Ultrix 4.2, +.\"O 4.3BSD, FreeBSD 4.3, OpenBSD-2.5, ...) behave in the same +.\"O manner as Linux 2.6.12 and later. +Linux 2.6.12 °Ê¹ß¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¼Â¹Ô UID ¤¬¥×¥í¥»¥¹ \fIwho\fP +¤Î¼Â UID ¤«¼Â¸ú UID ¤Î¤¤¤º¤ì¤«¤È°ìÃפ¹¤ëɬÍפ¬¤¢¤ë¡£ +Á´¤Æ¤Î BSD É÷¥·¥¹¥Æ¥à (SunOS 4.1.3, Ultrix 4.2, +4.3BSD, FreeBSD 4.3, OpenBSD-2.5Åù) ¤Ï¡¢ +Linux 2.6.12 °Ê¹ß¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¡£ +.LP +.\"O The actual priority range varies between kernel versions. +.\"O Linux before 1.3.36 had \-infinity..15. +.\"O Since kernel 1.3.43 Linux has the range \-20..19. +.\"O Within the kernel, nice values are actually represented +.\"O using the corresponding range 40..1 +.\"O (since negative numbers are error codes) and these are the values +.\"O employed by the +.\"O .BR setpriority () +.\"O and +.\"O .BR getpriority () +.\"O system calls. +.\"O The glibc wrapper functions for these system calls handle the +.\"O translations between the user-land and kernel representations +.\"O of the nice value according to the formula +.\"O .IR "unice\ =\ 20\ \-\ knice" . +¼ÂºÝ¤ÎÍ¥ÀèÅÙ¤ÎÃͤÎÈϰϤϥ«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +1.3.36 ¤è¤êÁ°¤Î Linux ¤Ç¤Ï¡¢Í¥ÀèÅÙ¤ÎÈϰϤÏÉé¤Î̵¸ÂÂç ¡Á 15 ¤Ç¤¢¤ë¡£ +1.3.43 °Ê¹ß¤Î Linux ¤Ç¤Ï¡¢Í¥ÀèÅÙ¤ÎÈÏ°Ï¤Ï \-20 ¡Á 19 ¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ëÆâÉô¤Ç¤Ï¡¢nice ÃÍ¤Ï¼ÂºÝ¤Ë¤Ï 40 ¡Á 1 ¤ÎÈϰϤò»È¤Ã¤Æ +ɽ¸½¤µ¤ì¤Æ¤ª¤ê (Éé¤ÎÃͤϥ¨¥é¡¼¥³¡¼¥É¤È¤Ê¤ë¤¿¤á)¡¢¤³¤Á¤é¤ÎÃͤ¬ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR setpriority () +¤È +.BR getpriority () +¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +glibc ¤Î¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ë¤ª¤¤¤Æ¡¢nice ÃͤΠ+¥æ¡¼¥¶Îΰè (user-land) ¤È¥«¡¼¥Í¥ëɽ¸½¤Î´Ö¤ÎÊÑ´¹¤¬¹Ô¤ï¤ì¤ë¡£ +ÊÑ´¹¼°¤Ï°Ê²¼¤ÎÄ̤ê: +.I "unice\ =\ 20\ \-\ knice" +.LP +.\"O On some systems, the range of nice values is \-20..20. +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢nice ÃͤÎÈÏ°Ï¤Ï \20 ¡Á 20 ¤Ç¤¢¤ë¡£ +.LP +.\"O Including +.\"O .I +.\"O is not required these days, but increases portability. +.\"O (Indeed, +.\"O .I +.\"O defines the +.\"O .I rusage +.\"O structure with fields of type +.\"O .I struct timeval +.\"O defined in +.\"O .IR .) +¸½ºß¤Ç¤Ï +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëɬÍפϤʤ¤¤¬¡¢¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ì¤Ð°Ü¿¢À­¤ò¹â¤á¤ë¤³¤È¤¬¤Ç¤­¤ë +(¼ÂºÝ¤Ë¤Ï +.I +¤Ç +.I rusage +¹½Â¤ÂΤ¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¤½¤Î¥Õ¥£¡¼¥ë¥É¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë +.I struct timeval +·¿¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR nice (1), +.BR fork (2), +.BR capabilities (7), +.BR renice (8) +.sp +.\"O .I Documentation/scheduler/sched-nice-design.txt +.\"O in the kernel source tree (since Linux 2.6.23). +(Linux 2.6.23 °Ê¹ß¤Î) ¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¥Ä¥ê¡¼Æâ¤Î +.I Documentation/scheduler/sched-nice-design.txt diff --git a/draft/man2/getresuid.2 b/draft/man2/getresuid.2 new file mode 100644 index 00000000..6acd46bb --- /dev/null +++ b/draft/man2/getresuid.2 @@ -0,0 +1,121 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl) +.\" 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. +.\" +.\" Modified, 2003-05-26, Michael Kerrisk, +.\" +.\" 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 Sat Aug 30 14:47:25 JST 1997 +.\" by HANATAKA Shinya +.\" Updated Sun Oct 12 JST 2003 by Kentaro Shirakata +.\" +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: real user ID ¼Â¥æ¡¼¥¶¡¼ID +.\"WORD: saved user ID Êݸ¥æ¡¼¥¶¡¼ID +.\"WORD: effective group ID ¼Â¸ú¥°¥ë¡¼¥×ID +.\"WORD: real group ID ¼Â¥°¥ë¡¼¥×ID +.\"WORD: saved group ID Êݸ¥°¥ë¡¼¥×ID +.\" +.TH GETRESUID 2 2007-12-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getresuid, getresgid \- get real, effective and saved user/group ID +getresuid, getresgid \- ¼Â¡¢¼Â¸ú¡¢Êݸ¡¢¥æ¡¼¥¶¡¼ ID / ¥°¥ë¡¼¥× ID ¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int getresuid(uid_t *" ruid ", uid_t *" euid ", uid_t *" suid ); +.br +.BI "int getresgid(gid_t *" rgid ", gid_t *" egid ", gid_t *" sgid ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR getresuid () +.\"O returns the real UID, the effective UID, and the saved set-user-ID +.\"O of the calling process, in the arguments +.\"O .IR ruid , +.\"O .IR euid , +.\"O and +.\"O .IR suid , +.\"O respectively. +.\"O .BR getresgid () +.\"O performs the analogous task for the process's group IDs. +.BR getresuid () +¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â (real) UID¡¢¼Â¸ú (effective) UID¡¢ +Êݸ (saved) set-user-ID +.RB ( getresgid +¤Î¾ì¹ç¤Ï¥°¥ë¡¼¥× ID) ¤ò¡¢ +¤½¤ì¤¾¤ì°ú¤­¿ô +.IR ruid , +.IR euid , +.I suid +¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.BR getresgid () +¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥°¥ë¡¼¥× ID ¤Ë¤Ä¤¤¤ÆƱÍͤνèÍý¤ò¹Ô¤¦¡£ +.\"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 +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O One of the arguments specified an address outside the calling program's +.\"O address space. +»ØÄꤷ¤¿°ú¤­¿ô¤Î¤É¤ì¤«¤¬¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥°¥é¥à¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Î +¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These system calls appeared on Linux starting with kernel 2.1.44. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.1.44 ¤«¤é Linux ¤ËÅо줷¤¿¡£ + +.\"O The prototypes are given by glibc since version 2.3.2 +.\"O provided +.\"O .B _GNU_SOURCE +.\"O is defined. +¥×¥í¥È¥¿¥¤¥×Àë¸À¤Ï 2.3.2 °Ê¹ß¤Î glibc ¤Ç¤Ï +.B _GNU_SOURCE +¤òÄêµÁ¤·¤Æ¤¤¤ë¤ÈÆÀ¤é¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These calls are nonstandard; +.\"O they also appear on HP-UX and some of the BSDs. +¤³¤ì¤é¤Î¥³¡¼¥ë¤ÏÈóɸ½à¤Ç¤¢¤ë¡£ +HP-UX ¤ä BSD ·Ï¤Î¤¤¤¯¤Ä¤«¤Ë¤â¸ºß¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getuid (2), +.BR setresuid (2), +.BR setreuid (2), +.BR setuid (2), +.BR credentials (7), +.BR feature_test_macros (7) diff --git a/draft/man2/getrlimit.2 b/draft/man2/getrlimit.2 new file mode 100644 index 00000000..1a3c2bfc --- /dev/null +++ b/draft/man2/getrlimit.2 @@ -0,0 +1,868 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt, March 28, 1992 +.\" and Copyright (c) 2002, 2004, 2005, 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-23 by Rik Faith +.\" Modified 1996-01-13 by Arnt Gulbrandsen +.\" Modified 1996-01-22 by aeb, following a remark by +.\" Tigran Aivazian +.\" Modified 1996-04-14 by aeb, following a remark by +.\" Robert Bihlmeyer +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 2001-05-04 by aeb, following a remark by +.\" Havard Lygre +.\" Modified 2001-04-17 by Michael Kerrisk +.\" Modified 2002-06-13 by Michael Kerrisk +.\" Added note on nonstandard behavior when SIGCHLD is ignored. +.\" Modified 2002-07-09 by Michael Kerrisk +.\" Enhanced descriptions of 'resource' values for [gs]etrlimit() +.\" Modified 2003-11-28 by aeb, added RLIMIT_CORE +.\" Modified 2004-03-26 by aeb, added RLIMIT_AS +.\" Modified 2004-06-16 by Michael Kerrisk +.\" Added notes on CAP_SYS_RESOURCE +.\" +.\" 2004-11-16 -- mtk: the getrlimit.2 page, which formally included +.\" coverage of getrusage(2), has been split, so that the latter +.\" is now covered in its own getrusage.2. +.\" +.\" Modified 2004-11-16, mtk: A few other minor changes +.\" Modified 2004-11-23, mtk +.\" Added notes on RLIMIT_MEMLOCK, RLIMIT_NPROC, and RLIMIT_RSS +.\" to "CONFORMING TO" +.\" Modified 2004-11-25, mtk +.\" Rewrote discussion on RLIMIT_MEMLOCK to incorporate kernel +.\" 2.6.9 changes. +.\" Added note on RLIMIT_CPU error in older kernels +.\" 2004-11-03, mtk, Added RLIMIT_SIGPENDING +.\" 2005-07-13, mtk, documented RLIMIT_MSGQUEUE limit. +.\" 2005-07-28, mtk, Added descriptions of RLIMIT_NICE and RLIMIT_RTPRIO +.\" 2008-05-07, mtk / Peter Zijlstra, Added description of RLIMIT_RTTIME +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-22, HANATAKA Shinya +.\" Updated and Modified 2001-06-02, Yuichi SATO +.\" Updated and Modified 2001-08-18, Yuichi SATO +.\" Updated and Modified 2002-08-25, Yuichi SATO +.\" Updated and Modified 2004-01-17, Yuichi SATO +.\" Updated and Modified 2004-12-30, Yuichi SATO +.\" Updated and Modified 2005-09-10, Yuichi SATO +.\" Updated and Modified 2005-10-11, Akihiro MOTOKI +.\" Updated and Modified 2005-10-27, Akihiro MOTOKI +.\" Updated and Modified 2006-04-15, Akihiro MOTOKI, Catch up to LDP v2.29 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-10-13, Akihiro MOTOKI, LDP v3.11 +.\" +.\"WORD: resource »ñ¸» +.\"WORD: limit À©¸Â +.\" +.TH GETRLIMIT 2 2008-10-06 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getrlimit, setrlimit \- get/set resource limits +getrlimit, setrlimit \- »ñ¸»¤ÎÀ©¸Â¤ò¼èÆÀ/ÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int getrlimit(int " resource ", struct rlimit *" rlim ); +.br +.BI "int setrlimit(int " resource ", const struct rlimit *" rlim ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR getrlimit () +.\"O and +.\"O .BR setrlimit () +.\"O get and set resource limits respectively. +.BR getrlimit () +¤È +.BR setrlimit () +¤Ï¤½¤ì¤¾¤ì»ñ¸» (resource) ¤ÎÀ©¸Â (limit) ¤ÎÀßÄê¤È¼èÆÀ¤ò¹Ô¤¦¡£ +.\"O Each resource has an associated soft and hard limit, as defined by the +.\"O .I rlimit +.\"O structure (the +.\"O .I rlim +.\"O argument to both +.\"O .BR getrlimit () +.\"O and +.\"O .BR setrlimit ()): +³Æ¥ê¥½¡¼¥¹¤Ë¤Ï¡¢¤½¤ì¤ËÂбþ¤¹¤ë¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤È¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤¬¤¢¤ë¡£ +¥ê¥ß¥Ã¥È¤Ï +.RB ( getrlimit () +¤È +.BR setrlimit () +¤Î +.I rlim +°ú¤­¿ô¤Ç¤¢¤ë) +.I rlimit +¹½Â¤ÂΤÇÄêµÁ¤µ¤ì¤ë: +.PP +.in +4n +.nf +struct rlimit { +.\"O rlim_t rlim_cur; /* Soft limit */ +.\"O rlim_t rlim_max; /* Hard limit (ceiling for rlim_cur) */ + rlim_t rlim_cur; /* ¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È */ + rlim_t rlim_max; /* ¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È + (rlim_cur ¤è¤ê¾®¤µ¤¯¤Ê¤¤) */ +}; + +.fi +.in +.\"O The soft limit is the value that the kernel enforces for the +.\"O corresponding resource. +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Ï¡¢¥«¡¼¥Í¥ë¤¬Âбþ¤¹¤ë¥ê¥½¡¼¥¹¤ËÂФ·¤Æ²Ý¤¹À©¸ÂÃͤǤ¢¤ë¡£ +.\"O The hard limit acts as a ceiling for the soft limit: +¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤Ï¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Î¾å¸Â¤È¤·¤ÆƯ¤¯¡£ +.\"O an unprivileged process may only set its soft limit to a value in the +.\"O range from 0 up to the hard limit, and (irreversibly) lower its hard limit. +Æø¢¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹¤Ï¡¢¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤ÎÃͤò +0 ¤«¤é¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ÎÈϰϤËÀßÄꤹ¤ë¤³¤È¤È¡¢ +¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ò²¼¤²¤ë¤³¤È¤Î¤ß¤¬¤Ç¤­¤ë +(°ìÅÙ²¼¤²¤¿¥Ï¡¼¥É¥ê¥ß¥Ã¥È¤Ï¾å¤²¤é¤ì¤Ê¤¤)¡£ +.\"O A privileged process (under Linux: one with the +.\"O .B CAP_SYS_RESOURCE +.\"O capability) may make arbitrary changes to either limit value. +Æø¢¥×¥í¥»¥¹ (Linux ¤Ç¤Ï +.B CAP_SYS_RESOURCE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Ï +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤È¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ò¼«Í³¤ËÊѹ¹¤Ç¤­¤ë¡£ +.PP +.\"O The value +.\"O .B RLIM_INFINITY +.\"O denotes no limit on a resource (both in the structure returned by +.\"O .BR getrlimit () +.\"O and in the structure passed to +.\"O .BR setrlimit ()). +ÃÍ +.B RLIM_INFINITY +¤Ï¥ê¥½¡¼¥¹¤ËÀ©¸Â¤¬¤Ê¤¤¤³¤È¤òɽ¤¹ +(¤³¤ÎÃÍ¤Ï +.BR getrlimit () +¤¬ÊÖ¤¹¹½Â¤ÂÎ¤È +.BR setrlimit () +¤ËÅϤ¹¹½Â¤ÂΤÎξÊý¤Ç»ÈÍѤµ¤ì¤ë)¡£ +.PP +.\"O .I resource +.\"O must be one of: +.I resource +¤Ï¼¡¤Î¤¤¤º¤ì¤« 1 ¤Ä¤Ç¤¢¤ë¡£ +.TP +.B RLIMIT_AS +.\"O The maximum size of the process's virtual memory (address space) in bytes. +¥×¥í¥»¥¹¤Î²¾ÁÛ¥á¥â¥ê (¥¢¥É¥ì¥¹¶õ´Ö) ¤ÎºÇÂ祵¥¤¥º (¥Ð¥¤¥Èñ°Ì)¡£ +.\"O .\" since 2.0.27 / 2.1.12 +.\" 2.0.27 / 2.1.12 °Ê¹ß¡£ +.\"O This limit affects calls to +.\"O .BR brk (2), +.\"O .BR mmap (2) +.\"O and +.\"O .BR mremap (2), +.\"O which fail with the error +.\"O .B ENOMEM +.\"O upon exceeding this limit. +.\"O Also automatic stack expansion will fail +.\"O (and generate a +.\"O .B SIGSEGV +.\"O that kills the process if no alternate stack +.\"O has been made available via +.\"O .BR sigaltstack (2)). +¤³¤ÎÀ©¸Â¤Ï +.BR brk (2), +.BR mmap (2), +.BR mremap (2) +¤Î¸Æ¤Ó½Ð¤·¤Ë±Æ¶Á¤·¡¢¤³¤ÎÀ©¸Â¤òĶ¤¨¤¿¾ì¹ç¤Ï +¥¨¥é¡¼ +.B ENOMEM +¤Ç¼ºÇÔ¤¹¤ë¡£ +¤Þ¤¿¼«Æ°Åª¤Ê¥¹¥¿¥Ã¥¯³ÈÄ¥¤Ë¤â¼ºÇÔ¤¹¤ë +(¤µ¤é¤Ë +.BR sigaltstack (2) +¤ò»È¤Ã¤¿ÂåÂØ¥¹¥¿¥Ã¥¯¤òÍøÍѲÄǽ¤Ë¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +.B SIGSEGV +¤òÀ¸À®¤·¤Æ¤½¤Î¥×¥í¥»¥¹¤ò kill ¤¹¤ë)¡£ +.\"O Since the value is a \fIlong\fP, on machines with a 32-bit \fIlong\fP +.\"O either this limit is at most 2 GiB, or this resource is unlimited. +¤³¤ÎÃÍ¤Ï \fIlong\fP ·¿¤Ê¤Î¤Ç¡¢32 ¥Ó¥Ã¥È¤Î \fIlong\fP ·¿¤ò»ý¤Ä¥Þ¥·¥ó¤Ç¤Ï¡¢ +¤³¤ÎÀ©¸Â¤ÏºÇÂç¤Ç 2 GiB ¤Ë¤Ê¤ë¤«¡¢¤³¤Î»ñ¸»¤¬ÌµÀ©¸Â¤Ë¤Ê¤ë¡£ +.TP +.B RLIMIT_CORE +.\"O Maximum size of +.\"O .I core +.\"O file. +.\"O When 0 no core dump files are created. +.I core +¥Õ¥¡¥¤¥ë¤ÎºÇÂ祵¥¤¥º¡£ +0 ¤Î¾ì¹ç¡¢core ¥Õ¥¡¥¤¥ë¤ÏÀ¸À®¤µ¤ì¤Ê¤¤¡£ +.\"O When nonzero, larger dumps are truncated to this size. +0 °Ê³°¤Î¾ì¹ç¡¢¤³¤Î¥µ¥¤¥º¤è¤êÂ礭¤¤¥À¥ó¥×¤ÏÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.TP +.B RLIMIT_CPU +.\"O CPU time limit in seconds. +CPU »þ´Ö¤Î¾å¸Â (Éÿô)¡£ +.\"O When the process reaches the soft limit, it is sent a +.\"O .B SIGXCPU +.\"O signal. +¥×¥í¥»¥¹¤¬¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Ë㤷¤¿¾ì¹ç¤Ë¡¢ +.B SIGXCPU +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.\"O The default action for this signal is to terminate the process. +¤³¤Î¥·¥°¥Ê¥ë¤ËÂФ¹¤ë¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¡¢¥×¥í¥»¥¹¤Î½ªÎ»¤Ç¤¢¤ë¡£ +.\"O However, the signal can be caught, and the handler can return control to +.\"O the main program. +¤¿¤À¤·¥·¥°¥Ê¥ë¤ò¥­¥ã¥Ã¥Á¤·¤Æ¡¢¥Ï¥ó¥É¥é¤¬¥á¥¤¥ó¥×¥í¥°¥é¥à¤Ë +À©¸æ¤òÊÖ¤¹¤³¤È¤â¤Ç¤­¤ë¡£ +.\"O If the process continues to consume CPU time, it will be sent +.\"O .B SIGXCPU +.\"O once per second until the hard limit is reached, at which time +.\"O it is sent +.\"O .BR SIGKILL . +¥×¥í¥»¥¹¤¬ CPU »þ´Ö¤ò»È¤¤Â³¤±¤¿¾ì¹ç¤Ï¡¢ +¥Ï¡¼¥É¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤Þ¤Ç 1 ÉÃËè¤Ë¥×¥í¥»¥¹¤Ë +.B SIGXCPU +¤òÁ÷¤ê¡¢ +¥Ï¡¼¥É¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤È +.B SIGKILL +¤òÁ÷¤ë¡£ +.\"O (This latter point describes Linux 2.2 through 2.6 behavior. +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤òĶ²á¤·¤¿¤È¤­¤ÎÆ°ºî¤Ï¡¢ +Linux 2.2 ¤«¤é 2.6 ¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.\"O Implementations vary in how they treat processes which continue to +.\"O consume CPU time after reaching the soft limit. +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤òĶ¤¨¤Æ CPU »þ´Ö¤ò»È¤¤Â³¤±¤ë¥×¥í¥»¥¹¤Î +°·¤¤Êý¤Ë¤Ä¤¤¤Æ¤Î¼ÂÁõ¤ÏÊѲ½¤·¤Æ¤­¤Æ¤¤¤ë¡£ +.\"O Portable applications that need to catch this signal should +.\"O perform an orderly termination upon first receipt of +.\"O .BR SIGXCPU .) +¤³¤Î¥·¥°¥Ê¥ë¤ò¥­¥ã¥Ã¥Á¤¹¤ëɬÍפΤ¢¤ë +°Ü¿¢À­¤ò¹Í¤¨¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +ºÇ½é¤Ë +.B SIGXCPU +¤ò¼õ¤±¼è¤Ã¤¿»þÅÀ¤ÇÀµ¤·¤¯½ªÎ»¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B RLIMIT_DATA +.\"O The maximum size of the process's data segment (initialized data, +.\"O uninitialized data, and heap). +¥×¥í¥»¥¹¤Î¥Ç¡¼¥¿¥»¥°¥á¥ó¥È +(½é´ü²½¤µ¤ì¤¿¥Ç¡¼¥¿¡¦½é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ç¡¼¥¿¡¦¥Ò¡¼¥×) ¤ÎºÇÂçÃÍ¡£ +.\"O This limit affects calls to +.\"O .BR brk (2) +.\"O and +.\"O .BR sbrk (2), +.\"O which fail with the error +.\"O .B ENOMEM +.\"O upon encountering the soft limit of this resource. +¤³¤Î¥ê¥ß¥Ã¥È¤Ï +.BR brk (2) +¤È +.BR sbrk (2) +¤Î¸Æ¤Ó½Ð¤·¤Ë±Æ¶Á¤¹¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤³¤Î¥ê¥½¡¼¥¹¤Î¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤È¡¢ +¥¨¥é¡¼ +.B ENOMEM +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.B RLIMIT_FSIZE +.\"O The maximum size of files that the process may create. +¥×¥í¥»¥¹¤¬ºîÀ®¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ÎºÇÂçÃÍ¡£ +.\"O Attempts to extend a file beyond this limit result in delivery of a +.\"O .B SIGXFSZ +.\"O signal. +¤³¤Î¥µ¥¤¥º¤òĶ¤¨¤Æ¥Õ¥¡¥¤¥ë¤ò³ÈÄ¥¤¹¤ë¤È¡¢ +.B SIGXFSZ +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.\"O By default, this signal terminates a process, but a process can +.\"O catch this signal instead, in which case the relevant system call (e.g., +.\"O .BR write (2), +.\"O .BR truncate (2)) +.\"O fails with the error +.\"O .BR EFBIG . +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î¥·¥°¥Ê¥ë¤Ï¥×¥í¥»¥¹¤ò½ªÎ»¤¹¤ë¡£ +¥×¥í¥»¥¹¤ò¥­¥ã¥Ã¥Á¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¤¬¡¢ +´ØÏ¢¤¹¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë +.RB ( write (2), +.BR truncate (2) +¤Ê¤É) ¤Ï¥¨¥é¡¼ +.B EFBIG +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.\"O .BR RLIMIT_LOCKS " (Early Linux 2.4 only)" +.BR RLIMIT_LOCKS " (½é´ü¤Î Linux 2.4 ¤Î¤ß)" +.\"O .\" to be precise: Linux 2.4.0-test9; no longer in 2.4.25 / 2.5.65 +.\" Àµ³Î¤Ë¤Ï Linux 2.4.0-test9 ¤Î¤ß¡£2.4.25 / 2.5.65 ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O A limit on the combined number of +.\"O .BR flock (2) +.\"O locks and +.\"O .BR fcntl (2) +.\"O leases that this process may establish. +¤³¤Î¥×¥í¥»¥¹¤¬¼Â¹Ô¤Ç¤­¤ë +.BR flock (2) +¥í¥Ã¥¯¿ô¤È +.BR fcntl (2) +¥ê¡¼¥¹¿ô¤Î¹ç·×ÃͤòÀ©¸Â¤¹¤ë¡£ +.TP +.B RLIMIT_MEMLOCK +.\"O The maximum number of bytes of memory that may be locked +.\"O into RAM. +RAM Æâ¤Ë¥í¥Ã¥¯¤Ç¤­¤ë¥á¥â¥ê¤ÎºÇÂç¥Ð¥¤¥È¿ô¡£ +.\"O In effect this limit is rounded down to the nearest multiple +.\"O of the system page size. +¼ÂºÝ¤Ë¤Ï¡¢¤³¤ÎÀ©¸Â¤Ï¥·¥¹¥Æ¥à¥Ú¡¼¥¸¥µ¥¤¥º¤ÎºÇ¤â¶á¤¤ÇÜ¿ô¤Ë +ÀÚ¤ê¼Î¤Æ¤Æ´Ý¤á¤é¤ì¤ë¡£ +.\"O This limit affects +.\"O .BR mlock (2) +.\"O and +.\"O .BR mlockall (2) +.\"O and the +.\"O .BR mmap (2) +.\"O .B MAP_LOCKED +.\"O operation. +¤³¤ÎÀ©¸Â¤Ï +.BR mlock (2), +.BR mlockall (2), +.BR mmap (2) +¤Î +.B MAP_LOCKED +Áàºî¤Ë±Æ¶Á¤¹¤ë¡£ +.\"O Since Linux 2.6.9 it also affects the +.\"O .BR shmctl (2) +.\"O .B SHM_LOCK +.\"O operation, where it sets a maximum on the total bytes in +.\"O shared memory segments (see +.\"O .BR shmget (2)) +.\"O that may be locked by the real user ID of the calling process. +Linux 2.6.9 °Ê¹ß¤Ç¤Ï +.BR shmctl (2) +.B SHM_LOCK +Áàºî¤Ë¤â±Æ¶Á¤¹¤ë¡£ +¤³¤ÎÁàºî¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â (real) ¥æ¡¼¥¶¡¼ ID ¤Ë¥í¥Ã¥¯¤µ¤ì¤ë +¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È +.RB ( shmget (2) +¤ò»²¾È) ¤Î¹ç·×¥Ð¥¤¥È¿ô¤ÎºÇÂçÃͤòÀßÄꤹ¤ë¡£ +.\"O The +.\"O .BR shmctl (2) +.\"O .B SHM_LOCK +.\"O locks are accounted for separately from the per-process memory +.\"O locks established by +.\"O .BR mlock (2), +.\"O .BR mlockall (2), +.\"O and +.\"O .BR mmap (2) +.\"O .BR MAP_LOCKED ; +.\"O a process can lock bytes up to this limit in each of these +.\"O two categories. +.BR shmctl (2) +.B SHM_LOCK +¤Ë¤è¤ë¥í¥Ã¥¯¤Ï¡¢ +.BR mlock (2), +.BR mlockall (2), +.BR mmap (2) +¤Î +.B MAP_LOCKED +¤Ë¤è¤Ã¤Æ³ÎΩ¤µ¤ì¤ë¥×¥í¥»¥¹Ëè¤Î¥á¥â¥ê¥í¥Ã¥¯¤È¤Ïʬ¤±¤Æ¿ô¤¨¤ë¡£ +1 ¤Ä¤Î¥×¥í¥»¥¹¤Ï¤³¤ÎÀ©¸Â¤Þ¤Ç¤Î¥Ð¥¤¥È¤ò¥í¥Ã¥¯¤Ç¤­¤ë¡£ +¤³¤ÎÀ©¸Â¤Ë¤Ï 2 ¤Ä¤Î¼ïÎब¤¢¤ë¡£ +.\"O In Linux kernels before 2.6.9, this limit controlled the amount of +.\"O memory that could be locked by a privileged process. +2.6.9 ¤è¤êÁ°¤Î Linux ¥«¡¼¥Í¥ë ¤Ç¤Ï¡¢ +¤³¤ÎÀ©¸Â¤ÏÆø¢¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤µ¤ì¤ë¥á¥â¥ê¤Î¹ç·×¤òÀ©¸æ¤·¤Æ¤¤¤¿¡£ +.\"O Since Linux 2.6.9, no limits are placed on the amount of memory +.\"O that a privileged process may lock, and this limit instead governs +.\"O the amount of memory that an unprivileged process may lock. +Linux 2.6.9 °Ê¹ß¤Ç¤Ï¡¢Æø¢¥×¥í¥»¥¹¤¬¥í¥Ã¥¯¤¹¤ë¥á¥â¥ê¤Î¹ç·×¤ËÀ©¸Â¤Ï¤Ê¤¯¡¢ +Âå¤ï¤ê¤Ë¤³¤ÎÀ©¸Â¤ÏÈóÆø¢¥×¥í¥»¥¹¤¬¥í¥Ã¥¯¤¹¤ë¥á¥â¥ê¤Î¹ç·×¤Ë +ŬÍѤµ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +.TP +.\"O .BR RLIMIT_MSGQUEUE " (Since Linux 2.6.8)" +.BR RLIMIT_MSGQUEUE " (Linux 2.6.8 °Ê¹ß)" +.\"O Specifies the limit on the number of bytes that can be allocated +.\"O for POSIX message queues for the real user ID of the calling process. +.\"O This limit is enforced for +.\"O .BR mq_open (3). +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤ËÂФ·¤Æ¡¢ +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¤¿¤á¤Ë³ÎÊݤǤ­¤ë¥Ð¥¤¥È¿ô¤ÎÀ©¸Â¤ò»ØÄꤹ¤ë¡£ +¤³¤ÎÀ©¸Â¤Ï +.BR mq_open (3) +¤ËÂФ·¤ÆŬÍѤµ¤ì¤ë¡£ +.\"O Each message queue that the user creates counts (until it is removed) +.\"O against this limit according to the formula: +¥æ¡¼¥¶¤¬ºîÀ®¤·¤¿³Æ¡¹¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¥Ð¥¤¥È¿ô¤Ï +°Ê²¼¤Î¼°¤Ë¤è¤ê·×»»¤µ¤ì¡¢(¤½¤Î¥­¥å¡¼¤¬ºï½ü¤µ¤ì¤ë¤Þ¤Ç¤Î´Ö) +¤³¤ÎÀ©¸Â¤Î·×»»Âоݤ˴ޤá¤é¤ì¤ë¡£ +.nf + + bytes = attr.mq_maxmsg * sizeof(struct msg_msg *) + + attr.mq_maxmsg * attr.mq_msgsize + +.fi +.\"O where +.\"O .I attr +.\"O is the +.\"O .I mq_attr +.\"O structure specified as the fourth argument to +.\"O .BR mq_open (3). +¤³¤³¤Ç +.I attr +¤Ï +.I mq_attr +¹½Â¤ÂΤǤ¢¤ê¡¢ +.BR mq_open (3) +¤ÎÂè 4 °ú¤­¿ô¤È¤·¤Æ»ØÄꤵ¤ì¤ë¡£ + +.\"O The first addend in the formula, which includes +.\"O .I "sizeof(struct msg_msg *)" +.\"O (4 bytes on Linux/i386), ensures that the user cannot +.\"O create an unlimited number of zero-length messages (such messages +.\"O nevertheless each consume some system memory for bookkeeping overhead). +.I "sizeof(struct msg_msg *)" +(Linux/i386 ¤Ç¤Ï 4 ¥Ð¥¤¥È) ¤ò´Þ¤àºÇ½é¤Î²Ã¿ô¤Ï¡¢ +¥æ¡¼¥¶¡¼¤¬Ä¹¤µ 0 ¤Î¥á¥Ã¥»¡¼¥¸¤ò̵À©¸Â¤Ëºî¤ì¤Ê¤¤¤³¤ÈÊݾڤ·¤Æ¤¤¤ë +(¤³¤Î¤è¤¦¤Ê¥á¥Ã¥»¡¼¥¸¤Ç¤¢¤Ã¤Æ¤â¡¢ +µ­Ï¿¤Î¤¿¤á¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤Ç¥·¥¹¥Æ¥à¥á¥â¥ê¤ò¾ÃÈñ¤¹¤ë)¡£ +.TP +.\"O .BR RLIMIT_NICE " (since Linux 2.6.12, but see BUGS below)" +.BR RLIMIT_NICE " (Linux 2.6.12 °Ê¹ß, ²¼µ­¤Î¡Ö¥Ð¥°¡×¤ÎÀá¤â»²¾È)" +.\"O Specifies a ceiling to which the process's nice value can be raised using +.\"O .BR setpriority (2) +.\"O or +.\"O .BR nice (2). +.\"O The actual ceiling for the nice value is calculated as +.\"O .IR "20\ \-\ rlim_cur" . +.\"O (This strangeness occurs because negative numbers cannot be specified +.\"O as resource limit values, since they typically have special meanings. +.\"O For example, +.\"O .B RLIM_INFINITY +.\"O typically is the same as \-1.) +.BR setpriority (2) +¤ä +.BR nice (2) +¤ò»È¤Ã¤Æ°ú¤­¾å¤²¤é¤ì¤ë¥×¥í¥»¥¹¤Î nice Ãͤξå¸Â¤ò»ØÄꤹ¤ë¡£ +nice Ãͤμºݤξå¸Â¤Ï +.I "20\ \-\ rlim_cur" +¤Ç·×»»¤µ¤ì¤ë +(¤³¤Î¤è¤¦¤ÊÊѤʾõ¶·¤Ï¡¢¥ê¥½¡¼¥¹À©¸ÂÃͤȤ·¤ÆÉé¤Î¿ô¤ò»ØÄê¤Ç¤­¤Ê¤¤¤¿¤á +ȯÀ¸¤¹¤ë¡£Ä̾Éé¤ÎÃͤÏÆÃÊ̤ʰÕÌ£¤ò»ý¤Ã¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢Ä̾ï¤Ï +.B RLIM_INFINITY +¤ÎÃÍ¤Ï \-1 ¤Ç¤¢¤ë)¡£ +.TP +.B RLIMIT_NOFILE +.\"O Specifies a value one greater than the maximum file descriptor number +.\"O that can be opened by this process. +¤³¤Î¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¿ô¤ÎºÇÂçÃͤè¤ê +1 Â礭¤¤Ãͤò»ØÄꤹ¤ë¡£ +.\"O Attempts +.\"O .RB ( open (2), +.\"O .BR pipe (2), +.\"O .BR dup (2), +.\"O etc.) +.\"O to exceed this limit yield the error +.\"O .BR EMFILE . +.\"O (Historically, this limit was named +.\"O .B RLIMIT_OFILE +.\"O on BSD.) +.RB ( open (2), +.BR pipe (2), +.BR dup (2) +¤Ê¤É¤Ë¤è¤ê) ¤³¤Î¾å¸Â¤òĶ¤¨¤è¤¦¤È¤·¤¿¾ì¹ç¡¢¥¨¥é¡¼ +.B EMFILE +¤¬È¯À¸¤¹¤ë +(Îò»ËŪ¤Ë¡¢BSD ¤Ç¤Ï¤³¤Î¾å¸Â¤Ï +.B RLIMIT_OFILE +¤È¤¤¤¦Ì¾Á°¤È¤Ê¤Ã¤Æ¤¤¤ë)¡£ +.TP +.B RLIMIT_NPROC +.\"O The maximum number of processes (or, more precisely on Linux, threads) +.\"O that can be created for the real user ID of the calling process. +.\"O Upon encountering this limit, +.\"O .BR fork (2) +.\"O fails with the error +.\"O .BR EAGAIN . +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤ÇºîÀ®¤Ç¤­¤ëºÇÂç¥×¥í¥»¥¹¿ô +(¤è¤êÀµ³Î¤Ë¤Ï Linux ¤Ç¤Ï¥¹¥ì¥Ã¥É¿ô)¡£ +¤³¤Î¾å¸Â¤Ë㤹¤ë¤È¡¢ +.BR fork (2) +¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.B RLIMIT_RSS +.\"O Specifies the limit (in pages) of the process's resident set +.\"O (the number of virtual pages resident in RAM). +¥×¥í¥»¥¹¤Î resident set (RAM ¾å¤Ë¸ºß¤¹¤ë²¾ÁÛ¥Ú¡¼¥¸¤Î¿ô) ¤Î +¾å¸Â¤ò (¥Ú¡¼¥¸¿ô¤Ç) »ØÄꤹ¤ë¡£ +.\"O This limit only has effect in Linux 2.4.x, x < 30, and there only +.\"O affects calls to +.\"O .BR madvise (2) +.\"O specifying +.\"O .BR MADV_WILLNEED . +¤³¤ÎÀ©¸Â¤Ï 2.4.30 ¤è¤êÁ°¤Ç¤·¤«±Æ¶Á¤¬¤Ê¤¯¡¢ +.BR madvise (2) +¤Ë +.B MADV_WILLNEED +¤ò»ØÄꤷ¤¿´Ø¿ô¥³¡¼¥ë¤Ë¤·¤«±Æ¶Á¤·¤Ê¤¤¡£ +.\"O .\" As at kernel 2.6.12, this limit still does nothing in 2.6 though +.\"O .\" talk of making it do something has surfaced from time to time in LKML +.\" ¥«¡¼¥Í¥ë 2.6.12 ¤Î»þÅÀ¤Ç¤Ï¡¢ +.\" ¤³¤ÎÀ©¸Â¤Ï¥«¡¼¥Í¥ë 2.6 ¤Ç¤Ï¤Þ¤À²¿¤â¹Ô¤ï¤Ê¤¤¡£ +.\" ¤·¤«¤·¡¢²¿¤ò¤µ¤»¤ë¤«¤Ë¤Ä¤¤¤Æ¤Ï LKML ¤Ç»þ¡¹ÏÃÂê¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" -- MTK, Jul 05 +.TP +.\"O .BR RLIMIT_RTPRIO " (Since Linux 2.6.12, but see BUGS)" +.BR RLIMIT_RTPRIO " (Linux 2.6.12 °Ê¹ß, ¥Ð¥°¤ÎÀá¤â»²¾È)" +.\"O Specifies a ceiling on the real-time priority that may be set for +.\"O this process using +.\"O .BR sched_setscheduler (2) +.\"O and +.\"O .BR sched_setparam (2). +.BR sched_setscheduler (2) +¤ä +.BR sched_setparam (2) +¤ò»È¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥ê¥¢¥ë¥¿¥¤¥àÍ¥ÀèÅ٤ξå¸Â¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .BR RLIMIT_RTTIME " (Since Linux 2.6.25)" +.BR RLIMIT_RTTIME " (Linux 2.6.25 °Ê¹ß)" +.\"O Specifies a limit on the amount of CPU time that a process scheduled +.\"O under a real-time scheduling policy may consume without making a blocking +.\"O system call. +.\"O For the purpose of this limit, +.\"O each time a process makes a blocking system call, +.\"O the count of its consumed CPU time is reset to zero. +.\"O The CPU time count is not reset if the process continues trying to +.\"O use the CPU but is preempted, its time slice expires, or it calls +.\"O .BR sched_yield (2). +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤ë¥×¥í¥»¥¹¤¬ +¥Ö¥í¥Ã¥­¥ó¥°·¿¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤µ¤º¤Ë¾ÃÈñ¤¹¤ë¤³¤È¤Î¤Ç¤­¤ë +CPU »þ´Ö¤Î¹ç·×¤Ë¤Ä¤¤¤Æ¤Î¾å¸Â¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¾å¸Â¤ÎÌÜŪ¤Î¤¿¤á¡¢¥×¥í¥»¥¹¤¬¥Ö¥í¥Ã¥­¥ó¥°·¿¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò +¸Æ¤Ó½Ð¤¹Å٤ˡ¢¾ÃÈñ¤µ¤ì¤¿ CPU »þ´Ö¤Î¥«¥¦¥ó¥È¤Ï 0 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +¥×¥í¥»¥¹¤¬ CPU ¤ò»È¤¤Â³¤±¤è¤¦¤È¤·¤¿¤¬Â¾¤Î¥×¥í¥»¥¹¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿ +(preempted) ¾ì¹ç¤ä¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥¿¥¤¥à¥¹¥é¥¤¥¹¤¬Ëþλ¤·¤¿¾ì¹ç¡¢ +¤½¤Î¥×¥í¥»¥¹¤¬ +.BR sched_yield (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤Ï¡¢CPU »þ´Ö¤Î¥«¥¦¥ó¥È¤Ï¥ê¥»¥Ã¥È¤µ¤ì¤Ê¤¤¡£ + +.\"O Upon reaching the soft limit, the process is sent a +.\"O .B SIGXCPU +.\"O signal. +.\"O If the process catches or ignores this signal and +.\"O continues consuming CPU time, then +.\"O .B SIGXCPU +.\"O will be generated once each second until the hard limit is reached, +.\"O at which point the process is sent a +.\"O .B SIGKILL +.\"O signal. +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Ë +.B SIGXCPU +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£¤½¤Î¥×¥í¥»¥¹¤¬¤³¤Î¥·¥°¥Ê¥ë¤òÊ᪤¹¤ë¤« +̵»ë¤·¤Æ¡¢CPU »þ´Ö¤ò¾ÃÈñ¤·Â³¤±¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤Þ¤Ç 1 ÉÃ¤Ë 1 ²ó +.B SIGXCPU +¤¬À¸À®¤µ¤ì³¤±¤ë¤³¤È¤Ë¤Ê¤ë¡£ +¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤Ë㤷¤¿»þÅÀ¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤Ë¤Ï +.B SIGKILL +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ + +.\"O The intended use of this limit is to stop a runaway +.\"O real-time process from locking up the system. +¤³¤Î¾å¸Â¤ò°Õ¿ÞŪ¤Ë»ÈÍѤ¹¤ë¤Î¤Ï¡¢Ë½Áö¤·¤¿¥ê¥¢¥ë¥¿¥¤¥à¡¦¥×¥í¥»¥¹¤ò +Ää»ß¤·¤Æ¡¢¥·¥¹¥Æ¥à¤¬Æ°¤«¤Ê¤¯¤Ê¤ë¤Î¤òÈò¤±¤ë¾ì¹ç¤Ç¤¢¤ë¡£ +.TP +.\"O .BR RLIMIT_SIGPENDING " (Since Linux 2.6.8)" +.BR RLIMIT_SIGPENDING " (Linux 2.6.8 °Ê¹ß)" +.\"O Specifies the limit on the number of signals +.\"O that may be queued for the real user ID of the calling process. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤ËÂФ·¤Æ +¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¥·¥°¥Ê¥ë¤Î¿ô¤ÎÀ©¸Â¤ò»ØÄꤹ¤ë¡£ +.\"O Both standard and real-time signals are counted for the purpose of +.\"O checking this limit. +¤³¤ÎÀ©¸Â¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤¿¤á¡¢ +ɸ½à¥·¥°¥Ê¥ë¤È¥ê¥¢¥ë¥¿¥¤¥à¡¦¥·¥°¥Ê¥ë¤ÎξÊý¤¬¥«¥¦¥ó¥È¤µ¤ì¤ë¡£ +.\"O However, the limit is only enforced for +.\"O .BR sigqueue (2); +.\"O it is always possible to use +.\"O .BR kill (2) +.\"O to queue one instance of any of the signals that are not already +.\"O queued to the process. +¤·¤«¤·¡¢¤³¤ÎÀ©¸Â¤Ï +.BR sigqueue (2) +¤ËÂФ·¤Æ¤·¤«¶¯À©¤µ¤ì¤º¡¢ +.BR kill (2) +»È¤¦¤³¤È¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ¤Þ¤À¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤Æ¤¤¤Ê¤¤ +¥·¥°¥Ê¥ë¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ò¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .\" This replaces the /proc/sys/kernel/rtsig-max system-wide limit +.\"O .\" that was present in kernels <= 2.6.7. MTK Dec 04 +.\" ¤³¤ì¤Ï¥«¡¼¥Í¥ë 2.6.7 °ÊÁ°¤Ë¸ºß¤¹¤ë¥·¥¹¥Æ¥àÁ´ÂΤÎÀ©¸Â +.\" /proc/sys/kernel/rtsig-max ¤òÃÖ¤­´¹¤¨¤ë¡£MTK Dec 04 +.TP +.B RLIMIT_STACK +.\"O The maximum size of the process stack, in bytes. +¥×¥í¥»¥¹¡¦¥¹¥¿¥Ã¥¯¤ÎºÇÂ祵¥¤¥º¤ò¥Ð¥¤¥Èñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.\"O Upon reaching this limit, a +.\"O .B SIGSEGV +.\"O signal is generated. +¤³¤Î¾å¸Â¤Ë㤹¤ë¤È¡¢ +.B SIGSEGV +¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤ë¡£ +.\"O To handle this signal, a process must employ an alternate signal stack +.\"O .RB ( sigaltstack (2)). +¤³¤Î¥·¥°¥Ê¥ë¤ò°·¤¦¤¿¤á¤Ë¤Ï¡¢ +¥×¥í¥»¥¹¤ÏÂå¤ê¤Î¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯ +.RB ( sigaltstack (2)) +¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O Since Linux 2.6.23, +.\"O this limit also determines the amount of space used for the process's +.\"O command-line arguments and environment variables; for details, see +.\"O .BR execve (2). +Linux 2.6.23 °Ê¹ß¤Ç¤Ï¡¢¤³¤ÎÀ©¸Â¤Ï¥×¥í¥»¥¹¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤È´Ä¶­ÊÑ¿ô +¤Ë»ÈÍѤµ¤ì¤ë¶õ´Ö¤Î¹ç·×¥µ¥¤¥º¤Î¾å¸Â¤Î·èÄê¤Ë¤â»ÈÍѤµ¤ì¤ë¡£¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR execve (2) +¤ò»²¾È¡£ +.\"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 EFAULT +.\"O .I rlim +.\"O points outside the accessible address space. +.I rlim +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O .I resource +.\"O is not valid; +.\"O or, for +.\"O .BR setrlimit (): +.\"O .I rlim\->rlim_cur +.\"O was greater than +.\"O .IR rlim\->rlim_max . +.I resource +¤¬Í­¸ú¤Ç¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.BR setrlimit () +¤Ç¡¢ +.I rlim\->rlim_cur +¤¬ +.I rlim\->rlim_max +¤è¤ê¤âÂ礭¤«¤Ã¤¿¡£ +.TP +.B EPERM +.\"O An unprivileged process tried to use +.\"O .BR setrlimit () +.\"O to +.\"O increase a soft or hard limit above the current hard limit; the +.\"O .B CAP_SYS_RESOURCE +.\"O capability is required to do this. +Æø¢¤Î¤Ê¤¤¥×¥í¥»¥¹¤¬ +.BR setrlimit () +¤ò»ÈÍѤ·¤Æ +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Þ¤¿¤Ï¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ò +¸½ºß¤Î¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤è¤êÂ礭¤¯¤·¤è¤¦¤È»î¤ß¤¿¡£ +¤³¤ì¤ò¹Ô¤¦¤¿¤á¤Ë¤Ï +.B CAP_SYS_RESOURCE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.\"O Or, the process tried to use +.\"O .BR setrlimit () +.\"O to increase +.\"O the soft or hard +.\"O .B RLIMIT_NOFILE +.\"O limit above the current kernel +.\"O maximum +.\"O .RB ( NR_OPEN ). +¤Þ¤¿¤ÏÆø¢¤Î¤Ê¤¤¥×¥í¥»¥¹¤¬ +.BR setrlimit () +¤ò»ÈÍѤ·¤Æ +¥½¥Õ¥È¤Þ¤¿¤Ï¥Ï¡¼¥É +.B RLIMIT_NOFILE +¥ê¥ß¥Ã¥È¤ò¸½ºß¤Î¥«¡¼¥Í¥ë¤ÎºÇÂçÃÍ +.RB ( NR_OPEN ) +°Ê¾å¤ËÁý²Ã¤µ¤»¤è¤¦¤È¤·¤¿¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .B RLIMIT_MEMLOCK +.\"O and +.\"O .B RLIMIT_NPROC +.\"O derive from BSD and are not specified in POSIX.1-2001; +.\"O they are present on the BSDs and Linux, but on few other implementations. +.B RLIMIT_MEMLOCK +¤È +.B RLIMIT_NPROC +¤Ï BSD ¤«¤éÇÉÀ¸¤·¡¢POSIX.1-2001 ¤Ë¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤ì¤é¤Ï BSD ·Ï¤È Linux ¤Ë¸ºß¤¹¤ë¤¬¡¢Â¾¤Î¼ÂÁõ¤Ï¾¯¤Ê¤¤¡£ +.\"O .B RLIMIT_RSS +.\"O derives from BSD and is not specified in POSIX.1-2001; +.\"O it is nevertheless present on most implementations. +.R RLIMIT_RSS +¤Ï BSD ¤«¤éÇÉÀ¸¤·¡¢POSIX.1-2001 ¤Ë¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤½¤ì¤Ë¤â´Ø¤ï¤é¤ºÂ¿¤¯¤Î¼ÂÁõ¤Ç¸ºß¤¹¤ë¡£ +.\"O .BR RLIMIT_MSGQUEUE , +.\"O .BR RLIMIT_NICE , +.\"O .BR RLIMIT_RTPRIO , +.\"O .BR RLIMIT_RTTIME , +.\"O and +.\"O .B RLIMIT_SIGPENDING +.\"O are Linux-specific. +.BR RLIMIT_MSGQUEUE , +.BR RLIMIT_NICE , +.BR RLIMIT_RTPRIO , +.BR RLIMIT_RTTIME , +.B RLIMIT_SIGPENDING +¤Ï Linux ¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O A child process created via +.\"O .BR fork (2) +.\"O inherits its parent's resource limits. +.\"O Resource limits are preserved across +.\"O .BR execve (2). +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿ºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤Î¥ê¥½¡¼¥¹À©¸Â¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¥ê¥½¡¼¥¹À©¸Â¤ÏÊݸ¤µ¤ì¤ë¡£ + +.\"O One can set the resource limits of the shell using the built-in +.\"O .IR ulimit +.\"O command +.\"O .RI ( limit +.\"O in +.\"O .BR csh (1)). +.\"O The shell's resource limits are inherited by the processes that +.\"O it creates to execute commands. +¥·¥§¥ë¤Î¥ê¥½¡¼¥¹À©¸Â¤Ï¡¢¥·¥§¥ë¤ÎÁȤ߹þ¤ß¥³¥Þ¥ó¥É¤Ç¤¢¤ë +.I ulimit +.RB ( csh (1) +¤Ç¤Ï +.I limit ) +¤ò»È¤Ã¤ÆÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥·¥§¥ë¤Î¥ê¥½¡¼¥¹À©¸Â¤Ï¡¢¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¥·¥§¥ë¤¬À¸À®¤¹¤ë¥×¥í¥»¥¹ +¤Ë°ú¤­·Ñ¤¬¤ì¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O In older Linux kernels, the +.\"O .B SIGXCPU +.\"O and +.\"O .B SIGKILL +.\"O signals delivered when a process encountered the soft and hard +.\"O .B RLIMIT_CPU +.\"O limits were delivered one (CPU) second later than they should have been. +°ÊÁ°¤Î Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥×¥í¥»¥¹¤¬¥½¥Õ¥È¤Þ¤¿¤Ï¥Ï¡¼¥É +.B RLIMIT_CPU +¥ê¥ß¥Ã¥È¤Ë㤷¤¿¾ì¹ç¤ËÁ÷¤é¤ì¤ë +.B SIGXCPU +¤È +.B SIGKILL +¥·¥°¥Ê¥ë¤¬¡¢ËÜÍèÁ÷¤é¤ì¤ë¤Ù¤­»þÅÀ¤Î 1 (CPU) Éøå¤ËÁ÷¤é¤ì¤Æ¤·¤Þ¤¦¡£ +.\"O This was fixed in kernel 2.6.8. +¤³¤ì¤Ï¥«¡¼¥Í¥ë 2.6.8 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ + +.\"O In 2.6.x kernels before 2.6.17, a +.\"O .B RLIMIT_CPU +.\"O limit of 0 is wrongly treated as "no limit" (like +.\"O .BR RLIM_INFINITY ). +.\"O Since Linux 2.6.17, setting a limit of 0 does have an effect, +.\"O but is actually treated as a limit of 1 second. +2.6.17 ¤è¤êÁ°¤Î 2.6.x ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.B RLIMIT_CPU +¥ê¥ß¥Ã¥È¤¬ 0 ¤Î¾ì¹ç¡¢ +.RB ( RLIM_INFINITY +¤ÈƱ¤¸¤è¤¦¤Ë) ¡ÖÀ©¸Â¤Ê¤·¡×¤È´Ö°ã¤Ã¤Æ²ò¼á¤µ¤ì¤Æ¤¤¤¿¡£ +Linux 2.6.17 °Ê¹ß¤Ç¤Ï¡¢¥ê¥ß¥Ã¥È¤ò 0 ¤ËÀßÄꤷ¤¿¾ì¹ç¤Ë¤â +¸ú²Ì¤ò»ý¤Ä¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¬¡¢¼ÂºÝ¤Ë¤Ï¥ê¥ß¥Ã¥È¤ÎÃÍ¤Ï 1 ÉäȤʤ롣 +.\" see http://marc.theaimsgroup.com/?l=linux-kernel&m=114008066530167&w=2 + +.\"O A kernel bug means that +.\"O .B RLIMIT_RTPRIO +.\"O does not work in kernel 2.6.12; the problem is fixed in kernel 2.6.13. +¥«¡¼¥Í¥ë 2.6.12 ¤Ë¤Ï¡¢ +.B RLIMIT_RTPRIO +¤¬Æ°ºî¤·¤Ê¤¤¤È¤¤¤¦¥Ð¥°¤¬¤¢¤ë¡£¤³¤ÎÌäÂê¤Ï¥«¡¼¥Í¥ë 2.6.13 ¤Ç½¤Àµ¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"O In kernel 2.6.12, there was an off-by-one mismatch +.\"O between the priority ranges returned by +.\"O .BR getpriority (2) +.\"O and +.\"O .BR RLIMIT_NICE . +.\"O This had the effect that actual ceiling for the nice value +.\"O was calculated as +.\"O .IR "19\ \-\ rlim_cur" . +.\"O This was fixed in kernel 2.6.13. +.\"O .\" see http://marc.theaimsgroup.com/?l=linux-kernel&m=112256338703880&w=2 +¥«¡¼¥Í¥ë 2.6.12 ¤Ç¤Ï¡¢ +.BR getpriority (2) +¤È +.B RLIMIT_NICE +¤¬ÊÖ¤¹Í¥ÀèÅÙ¤ÎÈϰϤ¬°ì¤Ä¤º¤ì¤Æ¤¤¤¿¡£¤³¤Î¤¿¤á¡¢nice Ãͤμºݤξå¸Â¤¬ +.I "19\ \-\ rlim_cur" +¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¤È¤¤¤¦±Æ¶Á¤¬¤¢¤Ã¤¿¡£¤³¤ì¤Ï¥«¡¼¥Í¥ë 2.6.13 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ +.\" »²¹Í: http://marc.theaimsgroup.com/?l=linux-kernel&m=112256338703880&w=2 + +.\"O Kernels before 2.4.22 did not diagnose the error +.\"O .B EINVAL +.\"O for +.\"O .BR setrlimit () +.\"O when +.\"O .I rlim\->rlim_cur +.\"O was greater than +.\"O .IR rlim\->rlim_max . +2.4.22 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.I rlim\->rlim_cur +¤¬ +.I rlim\->rlim_max +¤è¤êÂ礭¤«¤Ã¤¿¾ì¹ç¡¢ +.BR setrlimit () +¤Ç¤Î +.B EINVAL +¥¨¥é¡¼¤ò¸¡½Ð¤Ç¤­¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR dup (2), +.BR fcntl (2), +.BR fork (2), +.BR getrusage (2), +.BR mlock (2), +.BR mmap (2), +.BR open (2), +.BR quotactl (2), +.BR sbrk (2), +.BR shmctl (2), +.BR sigqueue (2), +.BR malloc (3), +.BR ulimit (3), +.BR core (5), +.BR capabilities (7), +.BR signal (7) diff --git a/draft/man2/getrusage.2 b/draft/man2/getrusage.2 new file mode 100644 index 00000000..14d6044d --- /dev/null +++ b/draft/man2/getrusage.2 @@ -0,0 +1,291 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt, March 28, 1992 +.\" 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. +.\" +.\" 2004-11-16 -- mtk: the getrlimit.2 page, which formerly included +.\" coverage of getrusage(2), has been split, so that the latter is +.\" now covered in its own getrusage.2. For older details of change +.\" history, etc., see getrlimit.2 +.\" +.\" Modified 2004-11-16, mtk, Noted that the nonconformance +.\" when SIGCHLD is being ignored is fixed in 2.6.9. +.\" 2008-02-22, Sripathi Kodi : Document RUSAGE_THREAD +.\" 2008-05-25, mtk, clarify RUSAGE_CHILDREN + other clean-ups. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-22, HANATAKA Shinya +.\" Updated and Modified 2001-06-02, Yuichi SATO +.\" Updated and Modified 2001-08-18, Yuichi SATO +.\" Updated and Modified 2002-08-25, Yuichi SATO +.\" Updated and Modified 2004-01-17, Yuichi SATO +.\" Updated and Modified 2004-12-30, Yuichi SATO +.\" Updated and Modified 2005-09-06, Akihiro MOTOKI +.\" Updated 2008-11-10, Akihiro MOTOKI, LDP v3.11 +.\" +.TH GETRUSAGE 2 2009-08-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getrusage \- get resource usage +getrusage \- »ñ¸»¤Î»ÈÍÑÎ̤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int getrusage(int " who ", struct rusage *" usage ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.PP +.\"O .BR getrusage () +.\"O returns resource usage measures for +.\"O .IR who , +.\"O which can be one of the following: +.BR getrusage () +¤Ï +.I who +¤Î»ñ¸» (resource) ¤Î»ÈÍÑÎ̤òÊÖ¤¹¡£ +.I who +¤Ë¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄê¤Ç¤­¤ë¡£ +.TP +.B RUSAGE_SELF +.\"O Return resource usage statistics for the calling process, +.\"O which is the sum of resources used by all threads in the process. +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î»ñ¸»»ÈÍÑÎÌ¡¢ +¤½¤Î¥×¥í¥»¥¹Æâ¤ÎÁ´¥¹¥ì¥Ã¥É¤¬»ÈÍѤ·¤Æ¤¤¤ë»ñ¸»¤Î¹ç·×¤òÊÖ¤¹¡£ + +Á°¼Ô¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥ê¥½¡¼¥¹»ÈÍÑÎ̤òÍ׵ᤷ¡¢ +¸å¼Ô¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î»Ò¶¡¤Î¤¦¤Á +½ªÎ»¤·¤ÆÂÔ¤Á¾õÂ֤ˤ¢¤ë¥×¥í¥»¥¹¤Î»ÈÍÑÎ̤òÍ׵᤹¤ë¡£ +.TP +.B RUSAGE_CHILDREN +.\"O Return resource usage statistics for all children of the +.\"O calling process that have terminated and been waited for. +.\"O These statistics will include the resources used by grandchildren, +.\"O and further removed descendants, +.\"O if all of the intervening descendants waited on their terminated children. +.\"Omotoki: Ìõ¤Ë¼«¿®¤Ê¤· (ÆÃ¤Ë if all of .... °Ê¹ß¤¬º£¤¤¤ÁÍý²ò¤Ç¤­¤º) +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î¤¦¤Á¡¢ +½ªÎ»¤·¤ÆÂÔ¤Á¾õÂ֤ˤ¢¤ëÁ´¥×¥í¥»¥¹¤¬»ÈÍѤ·¤Æ¤¤¤ë»ñ¸»»ÈÍÑÎ̤ÎÅý·×¤òÊÖ¤¹¡£ +¤³¤ì¤é¤ÎÅý·×¾ðÊó¤Ë¤Ï¡¢Â¹¥×¥í¥»¥¹¤ä¤½¤Î»Ò¹¤Î¥×¥í¥»¥¹¤Î¤¦¤Á¡¢ +ºï½üÂÔ¤Á¤Î¤â¤Î¤¬»ÈÍѤ·¤Æ¤¤¤ë»ñ¸»¤â´Þ¤Þ¤ì¤ë¡£ +.TP +.\"O .BR RUSAGE_THREAD " (since Linux 2.6.26)" +.BR RUSAGE_THREAD " (Linux 2.6.26 °Ê¹ß)" +.\"O Return resource usage statistics for the calling thread. +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Ë´Ø¤¹¤ë»ñ¸»»ÈÍÑÎ̤ÎÅý·×¤òÊÖ¤¹¡£ +.PP +.\"O The resource usages are returned in the structure pointed to by +.\"O .IR usage , +.\"O which has the following form: +»ñ¸»»ÈÍÑÎÌ¤Ï +.I usage +¤¬»Ø¤¹¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ +¹½Â¤ÂΤϰʲ¼¤Î·Á¼°¤Ç¤¢¤ë¡£ +.PP +.in +4n +.nf +struct rusage { +.\"O struct timeval ru_utime; /* user time used */ +.\"O struct timeval ru_stime; /* system time used */ +.\"O long ru_maxrss; /* maximum resident set size */ +.\"O long ru_ixrss; /* integral shared memory size */ +.\"O long ru_idrss; /* integral unshared data size */ +.\"O long ru_isrss; /* integral unshared stack size */ +.\"O long ru_minflt; /* page reclaims */ +.\"O long ru_majflt; /* page faults */ +.\"O long ru_nswap; /* swaps */ +.\"O long ru_inblock; /* block input operations */ +.\"O long ru_oublock; /* block output operations */ +.\"O long ru_msgsnd; /* messages sent */ +.\"O long ru_msgrcv; /* messages received */ +.\"O long ru_nsignals; /* signals received */ +.\"O long ru_nvcsw; /* voluntary context switches */ +.\"O long ru_nivcsw; /* involuntary context switches */ + struct timeval ru_utime; /* »ÈÍѤµ¤ì¤¿¥æ¡¼¥¶¡¼»þ´Ö */ + struct timeval ru_stime; /* »ÈÍѤµ¤ì¤¿¥·¥¹¥Æ¥à»þ´Ö */ + long ru_maxrss; /* RAM ¾å¤Ë¸ºß¤¹¤ë²¾ÁÛ¥Ú¡¼¥¸¤Î¥µ¥¤¥º + (resident set size) ¤ÎºÇÂçÃÍ */ + long ru_ixrss; /* ¶¦Í­¥á¥â¥ê¤Î¹ç·×¥µ¥¤¥º */ + long ru_idrss; /* Èó¶¦Í­¥Ç¡¼¥¿¤Î¹ç·×¥µ¥¤¥º */ + long ru_isrss; /* Èó¶¦Í­¥¹¥¿¥Ã¥¯¤Î¹ç·×¥µ¥¤¥º */ + long ru_minflt; /* ÍøÍѤµ¤ì¤¿¥Ú¡¼¥¸ */ + long ru_majflt; /* ¥Ú¡¼¥¸¥Õ¥©¡¼¥ë¥È */ + long ru_nswap; /* ¥¹¥ï¥Ã¥× */ + long ru_inblock; /* ¥Ö¥í¥Ã¥¯ÆþÎÏÁàºî */ + long ru_oublock; /* ¥Ö¥í¥Ã¥¯½ÐÎÏÁàºî */ + long ru_msgsnd; /* Á÷¿®¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸ */ + long ru_msgrcv; /* ¼õ¿®¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸ */ + long ru_nsignals; /* ¼õ¿®¤µ¤ì¤¿¥·¥°¥Ê¥ë */ + long ru_nvcsw; /* °Õ¿Þ¤·¤¿¥³¥ó¥Æ¥­¥¹¥ÈÀÚ¤êÂؤ¨ */ + long ru_nivcsw; /* °Õ¿Þ¤·¤Ê¤¤¥³¥ó¥Æ¥­¥¹¥ÈÀÚ¤êÂؤ¨ */ +}; +.fi +.in +.\"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 EFAULT +.\"O .I usage +.\"O points outside the accessible address space. +.I usage +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O .I who +.\"O is invalid. +.I who +¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD. +.\"O POSIX.1-2001 specifies +.\"O .BR getrusage (), +.\"O but only specifies the fields +.\"O .I ru_utime +.\"O and +.\"O .IR ru_stime . +POSIX.1-2001 ¤Ï +.BR getrusage () +¤òµ¬Äꤷ¤Æ¤¤¤ë¤¬¡¢µ¬Äꤷ¤Æ¤¤¤ë¥Õ¥£¡¼¥ë¥É¤Ï +.I ru_utime +¤È +.I ru_stime +¤À¤±¤Ç¤¢¤ë¡£ + +.\"O .B RUSAGE_THREAD +.\"O is Linux-specific. +.B RUSAGE_THREAD +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Resource usage metrics are preserved across an +.\"O .BR execve (2). +.BR execve (2) +¤ÎÁ°¸å¤Ç¥ê¥½¡¼¥¹»ÈÍÑÎ̤λØɸ¤ÏÊÝ»ý¤µ¤ì¤ë¡£ + +.\"O Including +.\"O .I +.\"O is not required these days, but increases portability. +.\"O (Indeed, +.\"O .I struct timeval +.\"O is defined in +.\"O .IR .) +º£Æü¤Ç¤Ï +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëɬÍפϤʤ¤¤¬¡¢ +¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ¤ª¤±¤Ð°Ü¿¢À­¤¬Áý¤¹¡£ +(¼ÂºÝ +.I struct timeval +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£) +.PP +.\"O In Linux kernel versions before 2.6.9, if the disposition of +.\"O .B SIGCHLD +.\"O is set to +.\"O .B SIG_IGN +.\"O then the resource usages of child processes +.\"O are automatically included in the value returned by +.\"O .BR RUSAGE_CHILDREN , +.\"O although POSIX.1-2001 explicitly prohibits this. +2.6.9 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.B SIGCHLD +¤Î½èÍý¤¬ +.B SIG_IGN +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢ +»Ò¥×¥í¥»¥¹¤Î¥ê¥½¡¼¥¹»ÈÍÑÎ̤¬ +.B RUSAGE_CHILDREN +¤ÇÊÖ¤µ¤ì¤ëÃͤ˼«Æ°Åª¤Ë´Þ¤á¤é¤ì¤ë¡£ +¤·¤«¤· POSIX.1-2001 ¤Ç¤Ï¡¢¤³¤ì¤òÌÀ³Î¤Ë¶Ø»ß¤·¤Æ¤¤¤ë¡£ +.\"O This nonconformance is rectified in Linux 2.6.9 and later. +.\"O .\" See the description of getrusage() in XSH. +.\"O .\" A similar statement was also in SUSv2. +¤³¤Î½àµò¤·¤Æ¤¤¤Ê¤«¤Ã¤¿ÅÀ¤Ï¡¢Linux 2.6.9 °Ê¹ß¤Ç²þÀµ¤µ¤ì¤¿¡£ +.\" XSH ¤Î getrusage() ¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\" ƱÍͤε­½Ò¤Ï SUSv2 ¤Ë¤â¤¢¤ë¡£ +.LP +.\"O The structure definition shown at the start of this page +.\"O was taken from 4.3BSD Reno. +.\"O Not all fields are meaningful under Linux. +.\"O In Linux 2.4 only the fields +.\"O .IR ru_utime , +.\"O .IR ru_stime , +.\"O .IR ru_minflt , +.\"O and +.\"O .I ru_majflt +.\"O are maintained. +¤³¤Î¥Ú¡¼¥¸¤ÎºÇ½é¤Ç¼¨¤·¤¿¹½Â¤ÂΤÎÄêµÁ¤Ï 4.3BSD Reno ¤Î¤â¤Î¤òºÎÍѤ·¤¿¡£ +Linux ¤Ç¤ÏÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤¬°ÕÌ£¤ò»ý¤Ä¤È¤¤¤¦¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +Linux 2.4 ¤Ç¤Ï¡¢¥Õ¥£¡¼¥ë¥É +.IR ru_utime , +.IR ru_stime , +.IR ru_minflt , +.I ru_majflt +¤Î¤ß¤¬¥á¥ó¥Æ¥Ê¥ó¥¹¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O Since Linux 2.6, +.\"O .I ru_nvcsw +.\"O and +.\"O .I ru_nivcsw +.\"O are also maintained. +Linux 2.6 °Ê¹ß¤Ç¤Ï +.IR ru_nvcsw , +.I ru_nivcsw +¤â¥á¥ó¥Æ¥Ê¥ó¥¹¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O Since Linux 2.6.22, +.\"O .I ru_inblock +.\"O and +.\"O .I ru_oublock +.\"O are also maintained. +Linux 2.6.22 °Ê¹ß¤Ç¤Ï +.IR ru_inblock , +.I ru_oublock +¤â¥á¥ó¥Æ¥Ê¥ó¥¹¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"O See also the description of +.\"O .IR /proc/PID/stat +.\"O in +.\"O .BR proc (5). +.BR proc (5) +¤Ë¤¢¤ë +.I /proc/PID/stat +¤ÎÀâÌÀ¤â»²¾È¤Î¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR clock_gettime (2), +.BR getrlimit (2), +.BR times (2), +.BR wait (2), +.BR wait4 (2), +.BR clock (3) diff --git a/draft/man2/getsid.2 b/draft/man2/getsid.2 new file mode 100644 index 00000000..df48ac19 --- /dev/null +++ b/draft/man2/getsid.2 @@ -0,0 +1,122 @@ +.\" Copyright (C) 1996 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. +.\" +.\" Modified Thu Oct 31 14:18:40 1996 by Eric S. Raymond +.\" Modified 2001-12-17, aeb +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Thu Dec 11 23:36:57 JST 1997 +.\" by HANATAKA Shinya +.\" Updated Thu Jan 17 JST 2001 by Kentaro Shirakata +.\" +.\"WORD: session ¥»¥Ã¥·¥ç¥ó +.\"WORD: process ¥×¥í¥»¥¹ +.\" +.TH GETSID 2 2008-12-05 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getsid \- get session ID +getsid \- ¥»¥Ã¥·¥ç¥ó ID ¤ò¼èÆÀ¤¹¤ë¡£ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "pid_t getsid(pid_t" " pid" ); +.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 getsid (): +_XOPEN_SOURCE\ >=\ 500 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .I getsid(0) +.\"O returns the session ID of the calling process. +.\"O .I getsid(p) +.\"O returns the session ID of the process with process ID +.\"O .IR p . +.I getsid(0) +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤òÊÖ¤¹¡£ +.I getsid(p) +¤Ï¥×¥í¥»¥¹ ID +.I p +¤ò»ý¤Ä¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤òÊÖ¤¹ +.\"O (The session ID of a process is the process group ID of the +.\"O session leader.) +(¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤Ï ¥»¥Ã¥·¥ç¥ó¥ê¡¼¥À¡¼¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤Ç¤¢¤ë)¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, a session ID is returned. +.\"O On error, \fI(pid_t)\ \-1\fP will be returned, and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤¹¤ë¤È¡¢¥»¥Ã¥·¥ç¥ó ID ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\fI(pid_t) \-1\fP ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EPERM +.\"O A process with process ID +.\"O .I p +.\"O exists, but it is not in the same session as the calling process, +.\"O and the implementation considers this an error. +¥×¥í¥»¥¹ ID +.I p +¤Î¥×¥í¥»¥¹¤Ï¸ºß¤¹¤ë¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸¥»¥Ã¥·¥ç¥ó¤Ç¤Ï¤Ê¤¯¡¢ +¤µ¤é¤Ë¼ÂÁõ¤¬¤³¤Î¾õÂÖ¤ò¥¨¥é¡¼¤ÈȽÃǤ·¤¿¾ì¹ç¡£ +.TP +.B ESRCH +.\"O No process with process ID +.\"O .I p +.\"O was found. +¥×¥í¥»¥¹ ID ¤¬ +.I p +¤Î¥×¥í¥»¥¹¤¬¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O This system call is available on Linux since version 2.0. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¥Ð¡¼¥¸¥ç¥ó 2.0 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\" Linux has this system call since Linux 1.3.44. +.\" There is libc support since libc 5.2.19. +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001 +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Linux does not return +.\"O .BR EPERM . +Linux ¤Ï +.B EPERM +¤òÊÖ¤µ¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getpgid (2), +.BR setsid (2), +.BR credentials (7) diff --git a/draft/man2/getsockname.2 b/draft/man2/getsockname.2 new file mode 100644 index 00000000..a708ef39 --- /dev/null +++ b/draft/man2/getsockname.2 @@ -0,0 +1,178 @@ +.\" 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. +.\" +.\" @(#)getsockname.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 16:30:29 1993 by Rik Faith +.\" 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 +.SH ̾Á° +.\"O getsockname \- get socket name +getsockname \- ¥½¥±¥Ã¥È¤Î̾Á°¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getsockname(int " sockfd ", struct sockaddr *" addr \ +", socklen_t *" addrlen ); +.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 +¤Ë¤Ï¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Î¼ÂºÝ¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤¬³ÊǼ¤µ¤ì¤ë¡£ + +.\"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" +.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 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 +.B ENOTSOCK +.\"O The argument +.\"O .I sockfd +.\"O is a file, not a socket. +°ú¤­¿ô +.I sockfd +¤¬¥½¥±¥Ã¥È¤Ç¤Ï¤Ê¤¯¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bind (2), +.BR socket (2), +.BR getifaddrs (3), +.BR ip (7), +.BR socket (7), +.BR unix (7) diff --git a/draft/man2/getsockopt.2 b/draft/man2/getsockopt.2 new file mode 100644 index 00000000..46bbbb01 --- /dev/null +++ b/draft/man2/getsockopt.2 @@ -0,0 +1,344 @@ +.\" 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. +.\" +.\" $Id: getsockopt.2,v 1.1 1999/05/24 14:57:04 freitag Exp $ +.\" +.\" Modified Sat Jul 24 16:19:32 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon Apr 22 02:29:06 1996 by Martin Schulze (joey@infodrom.north.de) +.\" Modified Tue Aug 27 10:52:51 1996 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Thu Jan 23 13:29:34 1997 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Sun Mar 28 21:26:46 1999 by Andries Brouwer (aeb@cwi.nl) +.\" 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 +.SH ̾Á° +.\"O getsockopt, setsockopt \- get and set options on sockets +getsockopt, setsockopt \- ¥½¥±¥Ã¥È¤Î¥ª¥×¥·¥ç¥ó¤ÎÀßÄê¤È¼èÆÀ¤ò¹Ô¤Ê¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.\"O .BR "#include " " /* See NOTES */" +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.br +.B #include +.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 ); +.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)¤Ë¸ºß¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¤¬¡¢ +¤³¤ì¤é¤Ï¾ï¤ËºÇ¾å°Ì¤Î¥½¥±¥Ã¥ÈÁؤؤÈÀßÄꤵ¤ì¤ë¡£ + +.\"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) +¤ò»²¾È¤¹¤ë¤³¤È¡£ + +.\"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 ¤Ç¤âÎɤ¤¡£ + +.\"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 +¤Ë¤Ï¸å½Ò¤Î¥½¥±¥Ã¥ÈÁؤΥª¥×¥·¥ç¥ó¤ÎÄêµÁ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¾¤Î¥×¥í¥È¥³¥ëÁؤǤÏ̾Á°¤ä·Á¼°¤Ï°Û¤Ê¤ë¡£ +¥Þ¥Ë¥å¥¢¥ë¤Î¥»¥¯¥·¥ç¥ó 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)¤Ë¤¹¤ë¤Ë¤Ï¥¼¥í¤ò»ØÄꤹ¤ë¡£ +.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" +.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 +.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 +.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 +.B ENOPROTOOPT +.\"O The option is unknown at the level indicated. +»ØÄꤵ¤ì¤¿ÁØ(level)¤Ë¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOTSOCK +.\"O The argument +.\"O .I sockfd +.\"O is a file, not a socket. +°ú¤­¿ô +.I sockfd +¤Ï¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¡¢¥½¥±¥Ã¥È¤Ç¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.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 ¥¨¥é¡¼¡¦¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤âµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.\" ¤·¤«¤·¡¢ +.\" .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO +.\" ¥ª¥×¥·¥ç¥ó¤Ë´Ø¤¹¤ëµ­½Ò¤Ï¤Ê¤¤¡£ +.\"O .SH NOTES +.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 ·Ï) ¤Ç¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬ +ɬÍפǤ¢¤ê¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò +¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬¸­ÌÀ¤Ç¤¢¤í¤¦¡£ + +.\"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 +.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) diff --git a/draft/man2/gettid.2 b/draft/man2/gettid.2 new file mode 100644 index 00000000..1c0a5864 --- /dev/null +++ b/draft/man2/gettid.2 @@ -0,0 +1,113 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 2003 Abhijit Menon-Sen +.\" 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. +.\" +.\" 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 +.SH ̾Á° +.\"O gettid \- get thread identification +gettid \- ¥¹¥ì¥Ã¥ÉID ¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B pid_t gettid(void); +.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 +¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"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" +.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 +.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 +.\" "gettid() should have a wrapper" + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR fork (2), +.BR getpid (2) diff --git a/draft/man2/gettimeofday.2 b/draft/man2/gettimeofday.2 new file mode 100644 index 00000000..a75fbe20 --- /dev/null +++ b/draft/man2/gettimeofday.2 @@ -0,0 +1,386 @@ +.\" 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, recomending 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/getuid.2 b/draft/man2/getuid.2 new file mode 100644 index 00000000..0fe783d9 --- /dev/null +++ b/draft/man2/getuid.2 @@ -0,0 +1,93 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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. +.\" +.\" Historical remark, aeb, 2004-06-05 +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated Thu Jun 26 20:37:44 JST 1997 +.\" by SUTO, Mitsuaki +.\" Updated & Modified Sat Feb 5 19:49:39 JST 2005 +.\" by Yuichi SATO +.\" +.TH GETUID 2 1993-07-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getuid, geteuid \- get user identity +getuid, geteuid \- ¥æ¡¼¥¶¡¼ ID ¤òÆÀ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.B uid_t getuid(void); +.br +.B uid_t geteuid(void); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR getuid () +.\"O returns the real user ID of the calling process. +.BR getuid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤òÊÖ¤¹¡£ + +.\"O .BR geteuid () +.\"O returns the effective user ID of the calling process. +.BR geteuid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O These functions are always successful. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001, 4.3BSD. +.\"O .SH NOTES +.\"O .SS History +.SH Ãí°Õ +.SS Îò»Ë +.\"O In Unix V6 the +.\"O .BR getuid () +.\"O call returned +.\"O .IR "(euid << 8) + uid" . +.\"O Unix V7 introduced separate calls +.\"O .BR getuid () +.\"O and +.\"O .BR geteuid (). +Unix V6 ¤Ç¤Ï +.BR getuid () +¥³¡¼¥ë¤Ï +.I "(euid << 8) + uid" +¤òÊÖ¤·¤Æ¤¤¤¿¡£ +Unix V7 ¤Ç¤Ï +.BR getuid () +¤È +.BR geteuid () +¤È¤¤¤¦ÊÌ¡¹¤Î¥³¡¼¥ë¤¬Æ³Æþ¤µ¤ì¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getresuid (2), +.BR setreuid (2), +.BR setuid (2), +.BR credentials (7) diff --git a/draft/man2/getxattr.2 b/draft/man2/getxattr.2 new file mode 100644 index 00000000..cbce2703 --- /dev/null +++ b/draft/man2/getxattr.2 @@ -0,0 +1,258 @@ +.\" +.\" Extended attributes system calls manual pages +.\" +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" 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) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 02:47:19 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: extended attributes ³Èĥ°À­ +.\"WORD: namespace ̾Á°¶õ´Ö +.\" +.TH GETXATTR 2 2001-12-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O getxattr, lgetxattr, fgetxattr \- retrieve an extended attribute value +.SH ̾Á° +getxattr, lgetxattr, fgetxattr \- ³Èĥ°À­¤ÎÃͤò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.fam C +.nf +.B #include +.B #include +.sp +.BI "ssize_t getxattr(const char\ *" path ", const char\ *" name , +.BI " void\ *" value ", size_t " size ); +.BI "ssize_t lgetxattr(const char\ *" path ", const char\ *" name , +.BI " void\ *" value ", size_t " size ); +.BI "ssize_t fgetxattr(int " fd ", const char\ *" name , +.BI " void\ *" value ", size_t " size ); +.fi +.fam T +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Extended attributes are +.\"O .IR name :\c +.\"O .I value +.\"O pairs associated with inodes (files, directories, symbolic links, etc.). +.\"O They are extensions to the normal attributes which are associated +.\"O with all inodes in the system (i.e., the +.\"O .BR stat (2) +.\"O data). +.\"O A complete overview of extended attributes concepts can be found in +.\"O .BR attr (5). +³Èĥ°À­¤Ï¡¢inode (¥Õ¥¡¥¤¥ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯Åù) ¤Ë +´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +.IR name :\c +.I value +¤ÎÂФǤ¢¤ë¡£ +¤³¤ì¤é¤Ï¡¢¥·¥¹¥Æ¥à¾å¤Î¤¹¤Ù¤Æ¤Î inode ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ä̾ï¤Î°À­ +.RB ( stat (2) +¤¬ÊÖ¤¹¥Ç¡¼¥¿) ¤ò³ÈÄ¥¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +³Èĥ°À­¤Î¥³¥ó¥»¥×¥È¤Ï +.BR attr (5) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O .BR getxattr () +.\"O retrieves the +.\"O .I value +.\"O of the extended attribute identified by +.\"O .I name +.\"O and associated with the given +.\"O .I path +.\"O in the file system. +.\"O The length of the attribute +.\"O .I value +.\"O is returned. +.BR getxattr () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î»ØÄꤵ¤ì¤¿ +.I path +¤ËÂбþ¤¹¤ë¡¢Ì¾Á° +.I name +¤Î³Èĥ°À­¤Î +.I value +(ÃÍ) ¤ò¼èÆÀ¤¹¤ë¡£ +°À­ +.I value +¤ÎŤµ¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O .BR lgetxattr () +.\"O is identical to +.\"O .BR getxattr (), +.\"O except in the case of a symbolic link, where the link itself is +.\"O interrogated, not the file that it refers to. +.BR lgetxattr () +¤Ï +.BR getxattr () +¤ÈƱ¤¸¤À¤¬¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¡¢¥ê¥ó¥¯¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë +¤Ç¤Ï¤Ê¤¯¡¢¥ê¥ó¥¯¤½¤Î¤â¤Î¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +.PP +.\"O .BR fgetxattr () +.\"O is identical to +.\"O .BR getxattr (), +.\"O only the open file referred to by +.\"O .I fd +.\"O (as returned by +.\"O .BR open (2)) +.\"O is interrogated in place of +.\"O .IR path . +.BR fgetxattr () +¤Ï +.BR getxattr () +¤ÈƱ¤¸¤À¤¬¡¢ +.I path +¤ÎÂå¤ï¤ê¤Ë +.I fd +¤Ç»²¾È¤µ¤ì¤¿¥ª¡¼¥×¥óºÑ¤ß¥Õ¥¡¥¤¥ë¤Î¾ðÊó¤À¤±¤ò¼èÆÀ¤¹¤ëÅÀ¤¬°Û¤Ê¤ë +.RI ( fd +¤Ï +.BR open (2) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë)¡£ +.PP +.\"O An extended attribute +.\"O .I name +.\"O is a simple null-terminated string. +.\"O The name includes a namespace prefix; there may be several, disjoint +.\"O namespaces associated with an individual inode. +.\"O The value of an extended attribute is a chunk of arbitrary textual or +.\"O binary data of specified length. +³Èĥ°À­¤Î̾Á° +.I name +¤ÏÉáÄ̤ΠNULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +̾Á°¤Ë¤Ï¡¢Ì¾Á°¶õ´Ö¤òɽ¤¹ÀÜƬ¼­ (prefix) ¤¬´Þ¤Þ¤ì¤ë; +¸Ä¡¹¤Î inode ¤ËÂФ·¤Æ¡¢¸ß¤¤¤ËÆÈΩ¤Ê̾Á°¶õ´Ö¤¬Ê£¿ô¤¢¤Ã¤Æ¤â¤è¤¤¡£ +³Èĥ°À­¤ÎÃͤϡ¢¤¢¤ë°ìÄê¤ÎŤµ¤ÎǤ°Õ¤Î¥Æ¥­¥¹¥È¡¦¥Ç¡¼¥¿¤Þ¤¿¤Ï +¥Ð¥¤¥Ê¥ê¡¦¥Ç¡¼¥¿¤Î½¸¹ç¤Ç¤¢¤ë¡£ +.PP +.\"O An empty buffer of +.\"O .I size +.\"O zero can be passed into these calls to return the current size of the +.\"O named extended attribute, which can be used to estimate the size of a +.\"O buffer which is sufficiently large to hold the value associated with +.\"O the extended attribute. +.I size +¤Ë 0 ¤ò»ØÄꤷ¤Æ¶õ¤Î¥Ð¥Ã¥Õ¥¡¤ò¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹¤³¤È¤¬¤Ç¤­¡¢ +¤³¤Î¾ì¹ç¤Ë¤Ï»ØÄꤵ¤ì¤¿Ì¾Á°¤Î³Èĥ°À­¤Î¸½ºß¤Î¥µ¥¤¥º¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤ÎÊýË¡¤Ï¡¢³Èĥ°À­¤ÎÃͤòÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Î¥Ð¥Ã¥Õ¥¡¡¦¥µ¥¤¥º¤ò +¸«ÀѤâ¤ë¤Î¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡¢ +.PP +.\"O The interface is designed to allow guessing of initial buffer +.\"O sizes, and to enlarge buffers when the return value indicates +.\"O that the buffer provided was too small. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¡¢½é´ü¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Î¿ä¬¤ò¤·¤¿¤ê¡¢ +Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ¤¹¤®¤¿¤³¤È¤òÊÖ¤êÃͤÇÃΤ餻¤ë¤³¤È¤Ç¥Ð¥Ã¥Õ¥¡¤òÂ礭¤¯ +¤·¤¿¤ê¤Ç¤­¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, a positive number is returned indicating the size of the +.\"O extended attribute value. +.\"O On failure, \-1 is returned and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤·¤¿¾ì¹ç¡¢³Èĥ°À­¤ÎÃͤÎŤµ¤òɽ¤¹Àµ¤Î¿ô¤¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O If the named attribute does not exist, or the process has no access to +.\"O this attribute, +.\"O .I errno +.\"O is set to +.\"O .BR ENOATTR . +»ØÄꤵ¤ì¤¿Ì¾Á°¤Î°À­¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢¤Þ¤¿¤Ï¥×¥í¥»¥¹¤¬¤½¤Î°À­¤Ë¥¢¥¯¥»¥¹ +¤¹¤ë¸¢¸Â¤¬¤Ê¤¤¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOATTR +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O If the +.\"O .I size +.\"O of the +.\"O .I value +.\"O buffer is too small to hold the result, +.\"O .I errno +.\"O is set to +.\"O .B ERANGE . +.I value +¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ +.I size +¤¬·ë²Ì¤òÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I errno +¤Ë +.B ERANGE +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O If extended attributes are not supported by the file system, or are disabled, +.\"O .I errno +.\"O is set to +.\"O .B ENOTSUP . +³Èĥ°À­¤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¤â¤·¤¯¤Ï̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOTSUP +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O The errors documented for the +.\"O .BR stat (2) +.\"O system call are also applicable here. +.BR stat (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀâÌÀ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ï +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤âŬÍѤµ¤ì¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These system calls have been available on Linux since kernel 2.4; +.\"O glibc support is provided since version 2.3. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.4 °Ê¹ß¤Î Linux ¤ÇÍøÍѤǤ­¤ë¡£ +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3 °Ê¹ß¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These system calls are Linux-specific. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\"O .\" .SH AUTHORS +.\" .SH Ãø¼Ô +.\"O .\" Andreas Gruenbacher, +.\"O .\" .RI < a.gruenbacher@computer.org > +.\"O .\" and the SGI XFS development team, +.\"O .\" .RI < linux-xfs@oss.sgi.com >. +.\"O .\" Please send any bug reports or comments to these addresses. +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" ¤È SGI XFS ³«È¯¥Á¡¼¥à, +.\" .RI < linux-xfs@oss.sgi.com >¡£ +.\" ¥Ð¥°¥ì¥Ý¡¼¥È¤ä¥³¥á¥ó¥È¤Ï¾åµ­¤Î¥¢¥É¥ì¥¹¤Þ¤ÇÁ÷¤Ã¤Æ²¼¤µ¤¤¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR getfattr (1), +.BR setfattr (1), +.BR listxattr (2), +.BR open (2), +.BR removexattr (2), +.BR setxattr (2), +.BR stat (2), +.BR attr (5), +.BR symlink (7) diff --git a/draft/man2/idle.2 b/draft/man2/idle.2 new file mode 100644 index 00000000..8427ba85 --- /dev/null +++ b/draft/man2/idle.2 @@ -0,0 +1,103 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from linux/mm/swap.c: +.\" Copyright (C) 1991, 1992 Linus Torvalds +.\" +.\" 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 : +.\" Added text about calling restriction (new in kernel 1.1.20 I believe). +.\" 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 +.\" +.\"WORD: Linux-specific Linux ÆÃÍ­ +.\"WORK: portable °Ü¿¢ +.\" +.TH IDLE 2 1994-08-21 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O idle \- make process 0 idle +idle \- ID 0 ¤Î¥×¥í¥»¥¹¤ò¥¢¥¤¥É¥ë¾õÂ֤ˤ¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B int idle(void); +.\"O .SH DESCRIPTION +.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 ¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.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" +.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 +.SH ¥¨¥é¡¼ +.TP +.B EPERM +.\"O Always, for a user process. +¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤Ë¤Ï¾ï¤Ë¤³¤ÎÃͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH VERSIONS +.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 ÆÃÍ­¤Î´Ø¿ô¤Ç¤¢¤ê¡¢°Ü¿¢À­¤ò»ý¤¿¤»¤¿¤¤¥×¥í¥°¥é¥à¤Ë¤Ï»È +ÍѤ¹¤Ù¤­¤Ç¤Ê¤¤¡£ diff --git a/draft/man2/init_module.2 b/draft/man2/init_module.2 new file mode 100644 index 00000000..929109d5 --- /dev/null +++ b/draft/man2/init_module.2 @@ -0,0 +1,150 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-29, Akihiro MOTOKI +.\" +.TH INIT_MODULE 2 2006-02-09 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O init_module \- initialize a loadable module entry +init_module \- ¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Î¥¨¥ó¥È¥ê¤ò½é´ü²½¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int init_module(const char *" name ", struct module *" image ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR init_module () +.\"O loads the relocated module image into kernel space and runs the +.\"O module's +.\"O .I init +.\"O function. +.BR init_module () +¤ÏºÆÇÛÃÖ¤µ¤ì¤¿¥â¥¸¥å¡¼¥ë¥¤¥á¡¼¥¸¤ò¥«¡¼¥Í¥ë¶õ´Ö¤Ë¥í¡¼¥É¤·¡¢ +¤½¤Î¥â¥¸¥å¡¼¥ë¤Î +.I init +´Ø¿ô¤ò¼Â¹Ô¤¹¤ë¡£ +.PP +.\"O The module image begins with a module structure and is followed by +.\"O code and data as appropriate. +.\"O The module structure is defined as follows: +¥â¥¸¥å¡¼¥ë¥¤¥á¡¼¥¸¤ÏÀèƬÉôʬ¤Ë module ¹½Â¤ÂΤ¬¤¢¤ê¡¢¤½¤Î¸å¤í¤Ë +ŬÀڤʥ³¡¼¥É¤È¥Ç¡¼¥¿¤¬Â³¤¯¡£ +¤³¤Î module ¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.PP +.in +4n +.nf +struct module { + unsigned long size_of_struct; + struct module *next; + const char *name; + unsigned long size; + long usecount; + unsigned long flags; + unsigned int nsyms; + unsigned int ndeps; + struct module_symbol *syms; + struct module_ref *deps; + struct module_ref *refs; + int (*init)(void); + void (*cleanup)(void); + const struct exception_table_entry *ex_table_start; + const struct exception_table_entry *ex_table_end; +#ifdef __alpha__ + unsigned long gp; +#endif +}; +.fi +.in +.PP +.\"O All of the pointer fields, with the exception of +.\"O .I next +.\"O and +.\"O .IR refs , +.\"O are expected to point within the module body and be +.\"O initialized as appropriate for kernel space, that is, relocated with +.\"O the rest of the module. +.I next +¤È +.I refs +°Ê³°¤ÎÁ´¤Æ¤Î¥Ý¥¤¥ó¥¿Í×ÁǤϥ⥸¥å¡¼¥ëËÜÂÎÆâÉô¤ò»Ø¤·¡¢ +¥«¡¼¥Í¥ë¶õ´Ö¤Ç¤ÎŬÀÚ¤ÊÃͤǽé´ü²½¤µ¤ì¤ë (¤Ä¤Þ¤ê¡¢¥â¥¸¥å¡¼¥ë¤Î»Ä¤ê¤Î +Éôʬ¤ÇºÆÇÛÃÖ¤µ¤ì¤ë) ¤³¤È¤¬´üÂÔ¤µ¤ì¤ë¡£ +.PP +.\"O This system call requires privilege. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£ +.\"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 The module's initialization routine failed. +¥â¥¸¥å¡¼¥ë¤Î½é´ü²½¥ë¡¼¥Á¥ó¤¬¼ºÇÔ¤·¤¿¡£ +.TP +.B EFAULT +.\"O .I name +.\"O or +.\"O .I image +.\"O is outside the program's accessible address space. +.I name +¤ä +.I image +¤¬¥×¥í¥°¥é¥à¤¬¥¢¥¯¥»¥¹¤Ç¤­¤ë¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤Ë¤¢¤ë¡£ +.TP +.B EINVAL +.\"O Some +.\"O .I image +.\"O slot is filled in incorrectly, +.\"O .I image\->name +.\"O does not correspond to the original module name, some +.\"O .I image\->deps +.\"O entry does not correspond to a loaded module, +.\"O or some other similar inconsistency. +°ìÉô¤Î +.I image +¥¹¥í¥Ã¥È¤Ë¤ª¤«¤·¤ÊÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¡£¤Þ¤¿¤Ï +.I image\->name +¤¬¸µ¤Î¥â¥¸¥å¡¼¥ë̾¤È°ìÃפ·¤Æ¤¤¤Ê¤¤¡£¤Þ¤¿¤Ï¡¢°ìÉô¤Î +.I image\->deps +¥¨¥ó¥È¥ê¤¬¥í¡¼¥É¤µ¤ì¤¿¥â¥¸¥å¡¼¥ë¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢Â¾¤ËƱÍͤÎÌ·½â¤¬µ¯¤³¤Ã¤Æ¤¤¤ë¡£ +.TP +.B ENOENT +.\"O No module by that name exists. +¤½¤Î̾Á°¤Î¥â¥¸¥å¡¼¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B EPERM +.\"O The caller was not privileged +.\"O (did not have the +.\"O .B CAP_SYS_MODULE +.\"O capability). +¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢ +.RB ( CAP_SYS_MODULE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR init_module () +.\"O is Linux-specific. +.BR init_module () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR create_module (2), +.BR delete_module (2), +.BR query_module (2) diff --git a/draft/man2/inotify_add_watch.2 b/draft/man2/inotify_add_watch.2 new file mode 100644 index 00000000..8e23e4a7 --- /dev/null +++ b/draft/man2/inotify_add_watch.2 @@ -0,0 +1,188 @@ +.\" man2/inotify_add_watch.2 - inotify_add_watch man page +.\" +.\" Copyright (C) 2005 Robert Love +.\" and Copyright, 2006 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. +.\" +.\" 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 +.SH ̾Á° +.\"O inotify_add_watch \- add a watch to an initialized inotify instance +inotify_add_watch \- ½é´ü²½ºÑ¤ß inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤Ë´Æ»ëÂоݤòÄɲ乤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int inotify_add_watch(int " fd ", const char *" pathname ", uint32_t " mask ); +.\"O .SH DESCRIPTION +.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) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"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 +¤¬¤¹¤Ç¤Ë´Æ»ëÂоݤˤʤäƤ¤¤ì¤Ð¡¢´û¸¤Î´Æ»ë¥¢¥¤¥Æ¥à¤ËÂФ¹¤ë +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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" +.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 +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O Read access to the given file is not permitted. +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëÆɤ߽Ф·¥¢¥¯¥»¥¹¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EBADF +.\"O The given file descriptor is not valid. +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Í­¸ú¤Ç¤Ï¤Ê¤¤¡£ +.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 +.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 +.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) diff --git a/draft/man2/inotify_init.2 b/draft/man2/inotify_init.2 new file mode 100644 index 00000000..6e3cdeeb --- /dev/null +++ b/draft/man2/inotify_init.2 @@ -0,0 +1,160 @@ +.\" man2/inotify_init.2 - inotify_init man page +.\" +.\" Copyright (C) 2005 Robert Love +.\" +.\" 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. +.\" +.\" 2005-07-19 Robert Love - initial version +.\" 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 +.SH ̾Á° +.\"O inotify_init, inotify_init1 \- initialize an inotify instance +inotify_init, inotify_init1 \- inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤ò½é´ü²½¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B "int inotify_init(void);" +.BI "int inotify_init1(int " flags ); +.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 ¥¤¥Ù¥ó¥È¥­¥å¡¼ +¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ + +.\"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) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.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" +.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 +.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. +inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤ÎÁí¿ô¤¬¥æ¡¼¥¶Ã±°Ì¤Î¾å¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENFILE +.\"O The system limit on the total number of file descriptors has been reached. +inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥à¤Î¾å¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENOMEM +.\"O Insufficient kernel memory is available. +¥«¡¼¥Í¥ë¥á¥â¥ê¤¬½½Ê¬¤Ë¤Ê¤«¤Ã¤¿¡£ +.\"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" +.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) diff --git a/draft/man2/inotify_rm_watch.2 b/draft/man2/inotify_rm_watch.2 new file mode 100644 index 00000000..bb0acb9d --- /dev/null +++ b/draft/man2/inotify_rm_watch.2 @@ -0,0 +1,120 @@ +.\" man2/inotify_rm_watch.2 - inotify_rm_watch man page +.\" +.\" Copyright (C) 2005 Robert Love +.\" +.\" 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. +.\" +.\" 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 ´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿ +.\" +.TH INOTIFY_RM_WATCH 2 2006-02-07 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O inotify_rm_watch \- remove an existing watch from an inotify instance +inotify_rm_watch \- inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤«¤é´û¸¤Î´Æ»ë¥¢¥¤¥Æ¥à¤òºï½ü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int inotify_rm_watch(int " fd ", uint32_t " wd ); +.\" FIXME . The type of the second argument should probably be "int". +.\" 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 .SH DESCRIPTION +.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 ¥¤¥ó¥¹¥¿¥ó¥¹¤«¤éºï½ü¤¹¤ë¡£ + +.\"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" +.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 +.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 +.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) diff --git a/draft/man2/intro.2 b/draft/man2/intro.2 new file mode 100644 index 00000000..5acf3f2c --- /dev/null +++ b/draft/man2/intro.2 @@ -0,0 +1,144 @@ +.\" 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. +.\" +.\" 2007-10-23 mtk: moved the _syscallN specific material to the +.\" 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-02-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 ¥é¥¤¥Ö¥é¥ê¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬¤¢¤ê¡¢ +¤½¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹¤Î¤ËɬÍפʽèÍý¤ò¼Â¹Ô¤¹¤ë¡£ +¤½¤Î¤¿¤á¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹¤Î¤ÏÄ̾ï¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¤Î¤È +Ʊ¤¸¤è¤¦¤Ë¸«¤¨¤ë¡£ + +.\"O For a list of the Linux system calls, see +.\"O .BR syscalls (2). +Linux ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥ê¥¹¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR syscalls (2) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH RETURN VALUE +.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 ¤òÊÖ¤¹¡£ + +.\"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 °Ê³°¤ÎÃͤòÊÖ¤¹¥·¥¹¥Æ¥à¥³¡¼¥ë¤â¤¢¤ë¡£ +¾ÜºÙ¤Ï¸Ä¡¹¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"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 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" +.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 "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" +.SH ´ØÏ¢¹àÌÜ +.BR _syscall (2), +.BR syscall (2), +.BR errno (3), +.BR feature_test_macros (7), +.BR standards (7) diff --git a/draft/man2/io_cancel.2 b/draft/man2/io_cancel.2 new file mode 100644 index 00000000..5c12ed15 --- /dev/null +++ b/draft/man2/io_cancel.2 @@ -0,0 +1,155 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" 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 +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .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 +.SH ̾Á° +io_cancel \- ̤½èÍý¤ÎÈóƱ´ü I/O Áàºî¤Î¼è¤ê¾Ã¤· +.\"O .SH "SYNOPSIS" +.SH ½ñ¼° +.nf +.\" .ad l +.\" .hy 0 +.\" +.B #include +.\"#include +.sp +.\" .HP 16 +.BI "int io_cancel(aio_context_t " ctx_id ", struct iocb *" iocb , +.BI " struct io_event *" result ); +.\" .ad +.\" .hy +.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" +.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" +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.\"O The \fIiocb\fP specified was not canceled. +»ØÄꤵ¤ì¤¿ \fIiocb\fP ¤Î¼è¤ê¾Ã¤·¤¬¹Ô¤ï¤ì¤Ê¤«¤Ã¤¿¡£ +.TP +.B EFAULT +.\"O One of the data structures points to invalid data. +¥Ç¡¼¥¿¹½Â¤¤ÎÃæ¤Ë̵¸ú¤Ê¥Ç¡¼¥¿¤ò»Ø¤·¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.\"O The AIO context specified by \fIctx_id\fP is invalid. +\fIctx_id\fP ¤Ç»ØÄꤵ¤ì¤¿ AIO ¥³¥ó¥Æ¥­¥¹¥È¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.TP +.B ENOSYS +.\"O .BR io_cancel () +.\"O is not implemented on this architecture. +.BR io_cancel () +¤Ï¤³¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "VERSIONS" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR io_destroy (2), +.BR io_getevents (2), +.BR io_setup (2), +.BR io_submit (2) +.\"O .\" .SH "NOTES" +.\" .SH Ãí +.\" .PP +.\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Benjamin LaHaise ¤¬½ñ¤¤¤¿¡£ +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\" Kent Yoder. diff --git a/draft/man2/io_destroy.2 b/draft/man2/io_destroy.2 new file mode 100644 index 00000000..af2e8e37 --- /dev/null +++ b/draft/man2/io_destroy.2 @@ -0,0 +1,144 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" 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 +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .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 +.SH ̾Á° +io_destroy \- ÈóƱ´ü I/O ¥³¥ó¥Æ¥­¥¹¥È¤Î¾Ãµî +.\"O .SH "SYNOPSIS" +.SH ½ñ¼° +.nf +.\" .ad l +.\" .hy 0 +.B #include +.\" #include +.sp +.\" .HP 17 +.BI "int io_destroy(aio_context_t " ctx ); +.\" .ad +.\" .hy +.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" +.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" +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O The context pointed to is invalid. +.\"motoki: ʬ¤«¤ê¤Ë¤¯¤¤¤Î¤Ç¡¢io_cancel.2 ¤«¤éήÍÑ¡£¤ª¤½¤é¤¯Æ±¤¸°ÕÌ£¡£ +¥Ç¡¼¥¿¹½Â¤¤ÎÃæ¤Ë̵¸ú¤Ê¥Ç¡¼¥¿¤ò»Ø¤·¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.\"O The AIO context specified by \fIctx\fP is invalid. +\fIctx\fP ¤Ç»ØÄꤵ¤ì¤¿ AIO ¥³¥ó¥Æ¥­¥¹¥È¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.TP +.B ENOSYS +.\"O .BR io_destroy () +.\"O is not implemented on this architecture. +.BR io_destroy () +¤Ï¤³¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "VERSIONS" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR io_cancel (2), +.BR io_getevents (2), +.BR io_setup (2), +.BR io_submit (2) +.\"O .\" .SH "NOTES" +.\" .SH Ãí +.\" .PP +.\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Benjamin LaHaise ¤¬½ñ¤¤¤¿¡£ +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\" Kent Yoder. diff --git a/draft/man2/io_getevents.2 b/draft/man2/io_getevents.2 new file mode 100644 index 00000000..6ed02881 --- /dev/null +++ b/draft/man2/io_getevents.2 @@ -0,0 +1,172 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" 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 +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .IP "\\$1" \\$2 +.\" .. +.TH IO_GETEVENTS 2 2008-07-04 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.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 +.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" +.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" +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O Either \fIevents\fP or \fItimeout\fP is an invalid pointer. +\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" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.PP +.BR io_cancel (2), +.BR io_destroy (2), +.BR io_setup (2), +.BR io_submit (2), +.BR time (7) +.\"O .\" .SH "NOTES" +.\" .SH Ãí +.\" .PP +.\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Benjamin LaHaise ¤¬½ñ¤¤¤¿¡£ +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\" Kent Yoder. diff --git a/draft/man2/io_setup.2 b/draft/man2/io_setup.2 new file mode 100644 index 00000000..df0ae882 --- /dev/null +++ b/draft/man2/io_setup.2 @@ -0,0 +1,160 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" 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 +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .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 +.SH ̾Á° +io_setup \- ÈóƱ´ü I/O ¥³¥ó¥Æ¥­¥¹¥È¤òºîÀ®¤¹¤ë +.\"O .SH "SYNOPSIS" +.SH ½ñ¼° +.nf +.\" .ad l +.\" .hy 0 +.B #include +.\" #include +.sp +.\" .HP 15 +.BI "int io_setup(unsigned " nr_events ", aio_context_t *" ctxp ); +.\" .ad +.\" .hy +.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" +.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" +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.\"O The specified \fInr_events\fP exceeds the user's limit of available events. +»ØÄꤵ¤ì¤¿ \fInr_events\fP ¤¬¥æ¡¼¥¶¤¬»ÈÍѤǤ­¤ë¥¤¥Ù¥ó¥È¿ô¤Î¾å¸Â¤ò±Û¤¨¤Æ¤¤¤ë¡£ +.TP +.B EFAULT +.\"O An invalid pointer is passed for \fIctxp\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 +.B ENOSYS +.\"O .BR io_setup () +.\"O is not implemented on this architecture. +.BR io_setup () +¤¬¤³¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "VERSIONS" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.PP +.BR io_cancel (2), +.BR io_destroy (2), +.BR io_getevents (2), +.BR io_submit (2) +.\"O .\" .SH "NOTES" +.\" .SH Ãí +.\" .PP +.\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Benjamin LaHaise ¤¬½ñ¤¤¤¿¡£ +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\" Kent Yoder. diff --git a/draft/man2/io_submit.2 b/draft/man2/io_submit.2 new file mode 100644 index 00000000..1c05d558 --- /dev/null +++ b/draft/man2/io_submit.2 @@ -0,0 +1,161 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" 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 +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .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 +.SH ̾Á° +io_submit \- ÈóƱ´ü I/O ¥Ö¥í¥Ã¥¯¤ò½èÍýÂÔ¤Á¥­¥å¡¼¤ËÅÐÏ¿¤¹¤ë +.\"O .SH "SYNOPSIS" +.SH ½ñ¼° +.nf +.\" .ad l +.\" .hy 0 +.B #include +.\" #include +.sp +.\" .HP 16 +.BI "int io_submit(aio_context_t " ctx_id ", long " nr \ +", struct iocb **" iocbpp ); +.\" .ad +.\" .hy +.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" +.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 ¤òÊÖ¤¹)¡£ +¼ºÇÔ»þ¤ÎÊÖ¤êÃͤˤĤ¤¤Æ¤Ï¡¢¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "ERRORS" +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.\"O Insufficient resources are available to queue any \fIiocb\fPs. +²¿¸Ä¤«¤Î \fIiocb\fP ¤ò¥­¥å¡¼¤ËÆþ¤ì¤ë¤Î¤ËɬÍפʥ꥽¡¼¥¹¤¬ÆÀ¤é¤ì¤Ê¤¤¡£ +.TP +.B EBADF +.\"O The file descriptor specified in the first \fIiocb\fP is invalid. +ÀèƬ¤Î \fIiocb\fP ¤Ë»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.TP +.B EFAULT +.\"O One of the data structures points to invalid data. +¥Ç¡¼¥¿¹½Â¤¤ÎÃæ¤Ë̵¸ú¤Ê¥Ç¡¼¥¿¤ò»Ø¤·¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ë¡£ +.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" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR io_cancel (2), +.BR io_destroy (2), +.BR io_getevents (2), +.BR io_setup (2) +.\"O .\" .SH "NOTES" +.\" .SH Ãí +.\" .PP +.\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Benjamin LaHaise ¤¬½ñ¤¤¤¿¡£ +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\" Kent Yoder. diff --git a/draft/man2/ioctl.2 b/draft/man2/ioctl.2 new file mode 100644 index 00000000..034e406f --- /dev/null +++ b/draft/man2/ioctl.2 @@ -0,0 +1,245 @@ +.\" Copyright (c) 1980, 1991 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. +.\" +.\" @(#)ioctl.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified 1993-07-23 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" 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 +.\" +.\"WORD: device ¥Ç¥Ð¥¤¥¹ +.\"WORD: control À©¸æ¤¹¤ë +.\"WORD: special ¥¹¥Ú¥·¥ã¥ë +.\"WORD: character ¥­¥ã¥é¥¯¥¿ +.\"WORD: parameter ¥Ñ¥é¥á¡¼¥¿ +.\"WORD: operate Áàºî +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: request ¥ê¥¯¥¨¥¹¥È +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: argument °ú¤­¿ô +.\"WORD: encode ¥¨¥ó¥³¡¼¥É +.\" +.TH IOCTL 2 2000-09-21 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O ioctl \- control device +.SH ̾Á° +ioctl \- ¥Ç¥Ð¥¤¥¹ (device) ¤òÀ©¸æ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int ioctl(int " d ", int " request ", ...);" +.\"O .SH DESCRIPTION +.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 +¤Ï¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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 +¤Èɽµ­¤µ¤ì¤Æ¤¤¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Îʸ¾Ï¤Ç¤â¤½¤Î¤è¤¦¤Ë̾ÉÕ¤±¤ë¤³¤È¤È¤¹¤ë¡£ +.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 +¤Ë¤Ï¡¢°Ê²¼¤Î¾ðÊó¤ò¥Ð¥¤¥È¿ô¤Ç¥¨¥ó¥³¡¼¥É¤¹¤ë: +(1)°ú¤­¿ô¤¬ +.I ÆþÎÏ +¥Ñ¥é¥á¡¼¥¿¤« +.I ½ÐÎÏ +¥Ñ¥é¥á¡¼¥¿¤Î¤É¤Á¤é¤«¤Ç¤¢¤ë¤«¡¢ +(2) +.I argp +¤ÎÂ礭¤µ¡£ +.BR ioctl () +.I request +¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Þ¥¯¥í(macro)¤ÈÄêµÁ¤Ï +.I +¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O Usually, on success zero is returned. +.\"O A few +.BR ioctl () +requests use the return value as an output parameter +.\"O and return a nonnegative value on success. +¤¿¤¤¤Æ¤¤¤Î¾ì¹ç¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£ +¤¤¤¯¤Ä¤«¤Î +.BR ioctl () +Í×µá¤Ç¤Ï½ÐÎϥѥé¥á¡¼¥¿¤È¤·¤ÆÊÖ¤êÃͤò»ÈÍѤ·¤Æ¤¤¤¿¤ê¡¢ +À®¸ù¤·¤¿¾ì¹ç¤ËÈó 0 ¤ÎÃͤòÊÖ¤·¤¿¤ê¤¹¤ë¡£ +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.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 +.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 +.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 +¥Õ¥é¥°¤ò¤Ä¤±¤ë¤³¤È¤Ç¤³¤ÎÉûºîÍѤòÈò¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"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) diff --git a/draft/man2/ioctl_list.2 b/draft/man2/ioctl_list.2 new file mode 100644 index 00000000..496bd584 --- /dev/null +++ b/draft/man2/ioctl_list.2 @@ -0,0 +1,1080 @@ +.\" Ioctl List 1.3.27 +.\" Sun 17 Sep 1995 +.\" Michael Elizabeth Chastain +.\" +.\" +.\" // Copyright +.\" +.\" Ioctl List 1.3.27 is copyright 1995 by Michael Elizabeth Chastain. +.\" It is licensed under the Gnu Public License, Version 2. +.\" +.\" +.\" +.\" // Change Log +.\" +.\" 1.3.27 421 ioctls. +.\" Type information for non-pointer args. +.\" SIOCDEVPRIVATE, SIOCPROTOPRIVATE ioctls. +.\" Descriptions of extended arguments. +.\" +.\" 1.2.9 365 ioctls. +.\" First public version. +.\" +.\" +.\" 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 +.\" +.TH IOCTL_LIST 2 2007-12-29 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 ¤ËÂФ·¤Æ¡¢¿ôÃÍ¡¢Ì¾¾Î¡¢ +°ú¤­¿ô¤Î·¿¤òÎóµó¤·¤Æ¤¢¤ê¤Þ¤¹¡£ +.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 ¥Þ¡¼¥¯¤òÉÕ¤±¤Æ¤¢¤ê¤Þ¤¹¡£ +.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 ¥Þ¡¼¥¯¤òÉÕ¤±¤Æ¡¢ +¤µ¤é¤ËʬΥ¤·¤¿¥»¥¯¥·¥ç¥ó¤ÇÀâÌÀ¤·¤Æ¤¢¤ê¤Þ¤¹¡£ +.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 ¥Ó¥Ã¥È¤ÎÄê¿ô¤Ç¤¹¡£ +¸¶Â§¤È¤·¤Æ¡¢¤³¤ì¤é¤ÎÄê¿ô¤ÏÁ´¤¯Ç¤°Õ¤Î¤â¤Î¤Ç¤¹¤¬¡¢ +À߷׼Ԥϲ¿¤é¤«¤Î¹½Â¤¤ò¤³¤ì¤é¤ÎÄê¿ô¤ËÁȤ߹þ¤â¤¦¤È¤·¤Æ¤¤¤Þ¤¹¡£ +.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 ¥É¥é¥¤¥Ð¤òɽ¤·¤Þ¤¹¡£ +.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 ¥Ó¥Ã¥È¤Î¥·¥ê¥¢¥ëÈֹ椫¤é¹½À®¤µ¤ì¤Þ¤¹¡£ +.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 ¤ÄÌܤΰú¤­¿ô¤Ï¥Ç¡¼¥¿¥¿¥¤¥×¤Ç¤¹¡£ +.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)) +¤ò»È¤Ã¤¿¥Ð¥°¤ò´Þ¤ó¤À¥Þ¥¯¥í¤ä¡¢²áµî¤«¤é¼õ¤±·Ñ¤¤¤ÀÃͤ¬¸¶°ø¤Ç¤¹¡£ +.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 ¤¬½ÐÎÏÃͤòÊÖ¤·¤Þ¤¹¡£ +¤³¤ì¤Ïº£¤Î¤È¤³¤í°Ê²¼¤Ç¤Ï¼¨¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ + +// Main table. + +// +.TS +l l l. +0x00008901 FIOSETOWN const int * +0x00008902 SIOCSPGRP const int * +0x00008903 FIOGETOWN int * +0x00008904 SIOCGPGRP int * +0x00008905 SIOCATMAR int * +0x00008906 SIOCGSTAMP timeval * +.TE + +// +.TS +l l l l. +0x00005401 TCGETS struct termios * +0x00005402 TCSETS const struct termios * +0x00005403 TCSETSW const struct termios * +0x00005404 TCSETSF const struct termios * +0x00005405 TCGETA struct termio * +0x00005406 TCSETA const struct termio * +0x00005407 TCSETAW const struct termio * +0x00005408 TCSETAF const struct termio * +0x00005409 TCSBRK int +0x0000540A TCXONC int +0x0000540B TCFLSH int +0x0000540C TIOCEXCL void +0x0000540D TIOCNXCL void +0x0000540E TIOCSCTTY int +0x0000540F TIOCGPGRP pid_t * +0x00005410 TIOCSPGRP const pid_t * +0x00005411 TIOCOUTQ int * +0x00005412 TIOCSTI const char * +0x00005413 TIOCGWINSZ struct winsize * +0x00005414 TIOCSWINSZ const struct winsize * +0x00005415 TIOCMGET int * +0x00005416 TIOCMBIS const int * +0x00005417 TIOCMBIC const int * +0x00005418 TIOCMSET const int * +0x00005419 TIOCGSOFTCAR int * +0x0000541A TIOCSSOFTCAR const int * +0x0000541B FIONREAD int * +0x0000541B TIOCINQ int * +0x0000541C TIOCLINUX const char * // MORE +0x0000541D TIOCCONS void +0x0000541E TIOCGSERIAL struct serial_struct * +0x0000541F TIOCSSERIAL const struct serial_struct * +0x00005420 TIOCPKT const int * +0x00005421 FIONBIO const int * +0x00005422 TIOCNOTTY void +0x00005423 TIOCSETD const int * +0x00005424 TIOCGETD int * +0x00005425 TCSBRKP int +0x00005426 TIOCTTYGSTRUCT struct tty_struct * +0x00005450 FIONCLEX void +0x00005451 FIOCLEX void +0x00005452 FIOASYNC const int * +0x00005453 TIOCSERCONFIG void +0x00005454 TIOCSERGWILD int * +0x00005455 TIOCSERSWILD const int * +0x00005456 TIOCGLCKTRMIOS struct termios * +0x00005457 TIOCSLCKTRMIOS const struct termios * +0x00005458 TIOCSERGSTRUCT struct async_struct * +0x00005459 TIOCSERGETLSR int * +0x0000545A TIOCSERGETMULTI struct serial_multiport_struct * +0x0000545B TIOCSERSETMULTI const struct serial_multiport_struct * +.TE + +// +.TS +l l l l. +0x000089E0 SIOCAX25GETUID const struct sockaddr_ax25 * +0x000089E1 SIOCAX25ADDUID const struct sockaddr_ax25 * +0x000089E2 SIOCAX25DELUID const struct sockaddr_ax25 * +0x000089E3 SIOCAX25NOUID const int * +0x000089E4 SIOCAX25DIGCTL const int * +0x000089E5 SIOCAX25GETPARMS struct ax25_parms_struct * // I-O +0x000089E6 SIOCAX25SETPARMS const struct ax25_parms_struct * +.TE + +// +.TS +l l l l. +0x00007314 STL_BINTR void +0x00007315 STL_BSTART void +0x00007316 STL_BSTOP void +0x00007317 STL_BRESET void +.TE + +// +.TS +l l l l. +0x00005301 CDROMPAUSE void +0x00005302 CDROMRESUME void +0x00005303 CDROMPLAYMSF const struct cdrom_msf * +0x00005304 CDROMPLAYTRKIND const struct cdrom_ti * +0x00005305 CDROMREADTOCHDR struct cdrom_tochdr * +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 +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 +0x00005311 CDROM_GET_UPC struct { char [8]; } * +0x00005312 CDROMRESET void +0x00005313 CDROMVOLREAD struct cdrom_volctrl * +0x00005314 CDROMREADRAW const struct cdrom_msf * // MORE +0x00005315 CDROMREADCOOKED const struct cdrom_msf * // MORE +0x00005316 CDROMSEEK const struct cdrom_msf * +.TE + +// +.TS +l l l l. +0x00002000 CM206CTL_GET_STAT int +0x00002001 CM206CTL_GET_LAST_STAT int +.TE + +// +.TS +l l l l. +0x00435901 CYGETMON struct cyclades_monitor * +0x00435902 CYGETTHRESH int * +0x00435903 CYSETTHRESH int +0x00435904 CYGETDEFTHRESH int * +0x00435905 CYSETDEFTHRESH int +0x00435906 CYGETTIMEOUT int * +0x00435907 CYSETTIMEOUT int +0x00435908 CYGETDEFTIMEOUT int * +0x00435909 CYSETDEFTIMEOUT int +.TE + +// +.TS +l l l l. +0x80046601 EXT2_IOC_GETFLAGS int * +0x40046602 EXT2_IOC_SETFLAGS const int * +0x80047601 EXT2_IOC_GETVERSION int * +0x40047602 EXT2_IOC_SETVERSION const int * +.TE + +// +.TS +l l l l. +0x00000000 FDCLRPRM void +0x00000001 FDSETPRM const struct floppy_struct * +0x00000002 FDDEFPRM const struct floppy_struct * +0x00000003 FDGETPRM struct floppy_struct * +0x00000004 FDMSGON void +0x00000005 FDMSGOFF void +0x00000006 FDFMTBEG void +0x00000007 FDFMTTRK const struct format_descr * +0x00000008 FDFMTEND void +0x0000000A FDSETEMSGTRESH int +0x0000000B FDFLUSH void +0x0000000C FDSETMAXERRS const struct floppy_max_errors * +0x0000000E FDGETMAXERRS struct floppy_max_errors * +0x00000010 FDGETDRVTYP struct { char [16]; } * +0x00000014 FDSETDRVPRM const struct floppy_drive_params * +0x00000015 FDGETDRVPRM struct floppy_drive_params * +0x00000016 FDGETDRVSTAT struct floppy_drive_struct * +0x00000017 FDPOLLDRVSTAT struct floppy_drive_struct * +0x00000018 FDRESET int +0x00000019 FDGETFDCSTAT struct floppy_fdc_state * +0x0000001B FDWERRORCLR void +0x0000001C FDWERRORGET struct floppy_write_errors * +0x0000001E FDRAWCMD struct floppy_raw_cmd * // MORE // I-O +0x00000028 FDTWADDLE void +.TE + +// +.TS +l l l l. +0x0000125D BLKROSET const int * +0x0000125E BLKROGET int * +0x0000125F BLKRRPART void +0x00001260 BLKGETSIZE unsigned long * +0x00001261 BLKFLSBUF void +0x00001262 BLKRASET int +0x00001263 BLKRAGET int * +0x00000001 FIBMAP int * // I-O +0x00000002 FIGETBSZ int * +.TE + +// +.TS +l l l l. +0x00000301 HDIO_GETGEO struct hd_geometry * +0x00000302 HDIO_GET_UNMASKINTR int * +0x00000304 HDIO_GET_MULTCOUNT int * +0x00000307 HDIO_GET_IDENTITY struct hd_driveid * +0x00000308 HDIO_GET_KEEPSETTINGS int * +0x00000309 HDIO_GET_CHIPSET int * +0x0000030A HDIO_GET_NOWERR int * +0x0000030B HDIO_GET_DMA int * +0x0000031F HDIO_DRIVE_CMD int * // I-O +0x00000321 HDIO_SET_MULTCOUNT int +0x00000322 HDIO_SET_UNMASKINTR int +0x00000323 HDIO_SET_KEEPSETTINGS int +0x00000324 HDIO_SET_CHIPSET int +0x00000325 HDIO_SET_NOWERR int +0x00000326 HDIO_SET_DMA int +.TE + +// +.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 +.TE + +// +.TS +l l l l. +0x000089F0 SIOCDEVPLIP struct ifreq * // I-O +.TE + +// +.TS +l l l l. +0x00005490 PPPIOCGFLAGS int * +0x00005491 PPPIOCSFLAGS const int * +0x00005492 PPPIOCGASYNCMAP int * +0x00005493 PPPIOCSASYNCMAP const int * +0x00005494 PPPIOCGUNIT int * +0x00005495 PPPIOCSINPSIG const int * +0x00005497 PPPIOCSDEBUG const int * +0x00005498 PPPIOCGDEBUG int * +0x00005499 PPPIOCGSTAT struct ppp_stats * +0x0000549A PPPIOCGTIME struct ppp_ddinfo * +0x0000549B PPPIOCGXASYNCMAP struct { int [8]; } * +0x0000549C PPPIOCSXASYNCMAP const struct { int [8]; } * +0x0000549D PPPIOCSMRU const int * +0x0000549E PPPIOCRASYNCMAP const int * +0x0000549F PPPIOCSMAXCID const int * +.TE + +// +.TS +l l l l. +0x000089E0 SIOCAIPXITFCRT const char * +0x000089E1 SIOCAIPXPRISLT const char * +0x000089E2 SIOCIPXCFGDATA struct ipx_config_data * +.TE + +// +.TS +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 +0x00004B6C PIO_FONTX const struct console_font_desc * //MORE +0x00004B70 GIO_CMAP struct { char [48]; } * +0x00004B71 PIO_CMAP const struct { char [48]; } +0x00004B2F KIOCSOUND int +0x00004B30 KDMKTONE int +0x00004B31 KDGETLED char * +0x00004B32 KDSETLED int +0x00004B33 KDGKBTYPE char * +0x00004B34 KDADDIO int // MORE +0x00004B35 KDDELIO int // MORE +0x00004B36 KDENABIO void // MORE +0x00004B37 KDDISABIO void // MORE +0x00004B3A KDSETMODE int +0x00004B3B KDGETMODE int * +0x00004B3C KDMAPDISP void // MORE +0x00004B3D KDUNMAPDISP void // MORE +0x00004B40 GIO_SCRNMAP struct { char [E_TABSZ]; } * +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 +0x00004B67 PIO_UNIMAP const struct unimapdesc * // MORE +0x00004B68 PIO_UNIMAPCLR const struct unimapinit * +0x00004B44 KDGKBMODE int * +0x00004B45 KDSKBMODE int +0x00004B62 KDGKBMETA int * +0x00004B63 KDSKBMETA int +0x00004B64 KDGKBLED int * +0x00004B65 KDSKBLED int +0x00004B46 KDGKBENT struct kbentry * // I-O +0x00004B47 KDSKBENT const struct kbentry * +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 +0x00004B4D KDSETKEYCODE const struct kbkeycode * +0x00004B4E KDSIGACCEPT int +.TE + +// +.TS +l l l l. +0x00000601 LPCHAR int +0x00000602 LPTIME int +0x00000604 LPABORT int +0x00000605 LPSETIRQ int +0x00000606 LPGETIRQ int * +0x00000608 LPWAIT int +0x00000609 LPCAREFUL int +0x0000060A LPABORTOPEN int +0x0000060B LPGETSTATUS int * +0x0000060C LPRESET void +0x0000060D LPGETSTATS struct lp_stats * +.TE + +// +.TS +l l l l. +0x000089E0 SIOCGETVIFCNT struct sioc_vif_req * // I-O +0x000089E1 SIOCGETSGCNT struct sioc_sg_req * // I-O +.TE + +// +.TS +l l l l. +0x40086D01 MTIOCTOP const struct mtop * +0x801C6D02 MTIOCGET struct mtget * +0x80046D03 MTIOCPOS struct mtpos * +0x80206D04 MTIOCGETCONFIG struct mtconfiginfo * +0x40206D05 MTIOCSETCONFIG const struct mtconfiginfo * +.TE + +// +.TS +l l l l. +0x000089E0 SIOCNRGETPARMS struct nr_parms_struct * // I-O +0x000089E1 SIOCNRSETPARMS const struct nr_parms_struct * +0x000089E2 SIOCNRDECOBS void +0x000089E3 SIOCNRRTCTL const int * +.TE + +// +.TS +l l l l. +0x00009000 DDIOCSDBG const int * +0x00005382 CDROMAUDIOBUFSIZ int +.TE + +// +.TS +l l l l. +0x00005470 TIOCSCCINI void +0x00005471 TIOCCHANINI const struct scc_modem * +0x00005472 TIOCGKISS struct ioctl_command * // I-O +0x00005473 TIOCSKISS const struct ioctl_command * +0x00005474 TIOCSCCSTAT struct scc_stat * +.TE + +// +.TS +l l l l. +0x00005382 SCSI_IOCTL_GET_IDLUN struct { int [2]; } * +0x00005383 SCSI_IOCTL_TAGGED_ENABLE void +0x00005384 SCSI_IOCTL_TAGGED_DISABLE void +0x00005385 SCSI_IOCTL_PROBE_HOST const int * // MORE +.TE + +// +.TS +l l l l. +0x80027501 SMB_IOC_GETMOUNTUID uid_t * +.TE + +// +.TS +l l l l. +0x0000890B SIOCADDRT const struct rtentry * // MORE +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 +0x00008914 SIOCSIFFLAGS const struct ifreq * +0x00008915 SIOCGIFADDR struct ifreq * // I-O +0x00008916 SIOCSIFADDR const struct ifreq * +0x00008917 SIOCGIFDSTADDR struct ifreq * // I-O +0x00008918 SIOCSIFDSTADDR const struct ifreq * +0x00008919 SIOCGIFBRDADDR struct ifreq * // I-O +0x0000891A SIOCSIFBRDADDR const struct ifreq * +0x0000891B SIOCGIFNETMASK struct ifreq * // I-O +0x0000891C SIOCSIFNETMASK const struct ifreq * +0x0000891D SIOCGIFMETRIC struct ifreq * // I-O +0x0000891E SIOCSIFMETRIC const struct ifreq * +0x0000891F SIOCGIFMEM struct ifreq * // I-O +0x00008920 SIOCSIFMEM const struct ifreq * +0x00008921 SIOCGIFMTU struct ifreq * // I-O +0x00008922 SIOCSIFMTU const struct ifreq * +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 +0x00008929 SIOCGIFSLAVE void +0x00008930 SIOCSIFSLAVE void +0x00008931 SIOCADDMULTI const struct ifreq * +0x00008932 SIOCDELMULTI const struct ifreq * +0x00008940 SIOCADDRTOLD void +0x00008941 SIOCDELRTOLD void +0x00008950 SIOCDARP const struct arpreq * +0x00008951 SIOCGARP struct arpreq * // I-O +0x00008952 SIOCSARP const struct arpreq * +0x00008960 SIOCDRARP const struct arpreq * +0x00008961 SIOCGRARP struct arpreq * // I-O +0x00008962 SIOCSRARP const struct arpreq * +0x00008970 SIOCGIFMAP struct ifreq * // I-O +0x00008971 SIOCSIFMAP const struct ifreq * +.TE + +// +.TS +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 +0x80045104 SNDCTL_SEQ_GETOUTCOUNT int * +0x80045105 SNDCTL_SEQ_GETINCOUNT int * +0x40045106 SNDCTL_SEQ_PERCMODE void +0x40285107 SNDCTL_FM_LOAD_INSTR const struct sbi_instrument * +0x40045108 SNDCTL_SEQ_TESTMIDI const int * +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 +0x4004510D SNDCTL_SEQ_THRESHOLD const int * +0xC004510E SNDCTL_SYNTH_MEMAVL int * // I-O +0x4004510F SNDCTL_FM_4OP_ENABLE const int * +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 +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 +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 +0xC0046D01 SNDCTL_MIDI_MPUMODE const int * +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 +0x00005008 SNDCTL_DSP_POST void +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 +0x800C500C SNDCTL_DSP_GETOSPACE struct audio_buf_info * +0x800C500D SNDCTL_DSP_GETISPACE struct audio_buf_info * +0x0000500E SNDCTL_DSP_NONBLOCK void +0x80045002 SOUND_PCM_READ_RATE int * +0x80045006 SOUND_PCM_READ_CHANNELS int * +0x80045005 SOUND_PCM_READ_BITS int * +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 +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 +0x4FA44308 SNDCTL_COPR_SENDMSG const struct copr_msg * +0x8FA44309 SNDCTL_COPR_RCVMSG struct copr_msg * +0x80044D00 SOUND_MIXER_READ_VOLUME int * +0x80044D01 SOUND_MIXER_READ_BASS int * +0x80044D02 SOUND_MIXER_READ_TREBLE int * +0x80044D03 SOUND_MIXER_READ_SYNTH int * +0x80044D04 SOUND_MIXER_READ_PCM int * +0x80044D05 SOUND_MIXER_READ_SPEAKER int * +0x80044D06 SOUND_MIXER_READ_LINE int * +0x80044D07 SOUND_MIXER_READ_MIC int * +0x80044D08 SOUND_MIXER_READ_CD int * +0x80044D09 SOUND_MIXER_READ_IMIX int * +0x80044D0A SOUND_MIXER_READ_ALTPCM int * +0x80044D0B SOUND_MIXER_READ_RECLEV int * +0x80044D0C SOUND_MIXER_READ_IGAIN int * +0x80044D0D SOUND_MIXER_READ_OGAIN int * +0x80044D0E SOUND_MIXER_READ_LINE1 int * +0x80044D0F SOUND_MIXER_READ_LINE2 int * +0x80044D10 SOUND_MIXER_READ_LINE3 int * +0x80044D1C SOUND_MIXER_READ_MUTE int * +0x80044D1D SOUND_MIXER_READ_ENHANCE int * +0x80044D1E SOUND_MIXER_READ_LOUD int * +0x80044DFF SOUND_MIXER_READ_RECSRC int * +0x80044DFE SOUND_MIXER_READ_DEVMASK int * +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 +.TE + +// +.TS +l l l l. +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 +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 +0x000004D9 UMSDOS_GETVERSION struct umsdos_ioctl * +0x000004DA UMSDOS_INIT_EMD void +0x000004DB UMSDOS_DOS_SETUP const struct umsdos_ioctl * +0x000004DC UMSDOS_RENAME_DOS const struct umsdos_ioctl * +.TE + +// +.TS +l l l l. +0x00005600 VT_OPENQRY int * +0x00005601 VT_GETMODE struct vt_mode * +0x00005602 VT_SETMODE const struct vt_mode * +0x00005603 VT_GETSTATE struct vt_stat * +0x00005604 VT_SENDSIG void +0x00005605 VT_RELDISP int +0x00005606 VT_ACTIVATE int +0x00005607 VT_WAITACTIVE int +0x00005608 VT_DISALLOCATE int +0x00005609 VT_RESIZE const struct vt_sizes * +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 ¤ÏÄɲäΥݥ¤¥ó¥¿¤ò´Þ¤à¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò»ÈÍѤ·¤Þ¤¹¡£ +¤³¤³¤Ç¤³¤ì¤é¤ò¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤ËÀâÌÀ¤·¤Þ¤¹¡£ + +.\"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" +¤Î½ÐÎϥХåե¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¹¡£ + +.\"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 ¤Ç¤¹)¡£ +.nf + + CDROMREADCOOKED char [CD_FRAMESIZE] + CDROMREADMODE1 char [CD_FRAMESIZE or OPT_BLOCKSIZE] + CDROMREADMODE2 char [CD_FRAMESIZE_RAW0] + 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 +¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤Ë¼¨¤¹Ê̤ι½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¹: +.nf + + EQL_ENSLAVE const struct slaving_request * + EQL_EMANCIPATE const struct slaving_request * + 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 +¤Î½ÐÎϥХåե¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ë¤Ê¤ê¤Þ¤¹¡£ + +.\"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 +¤ÎÆþÎϥХåե¡¤Ç¤¹¡£ + +.\"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 +¤ÎÆþÎϥХåե¡¤Ç¤¹¡£ + +.\"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' ¤Ø¤ÎÊ̤Π+¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¹¡£ + +.\"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 ¥Ý¡¼¥È¤Ø¤Î¥¢¥¯¥»¥¹¤ò²Äǽ/ÉÔ²Äǽ¤Ë¤·¤Þ¤¹¡£ +¤³¤ì¤é¤Ï¥«¡¼¥Í¥ë¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ + +.\"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 [] +¥Ð¥Ã¥Õ¥¡ ¤Ø¤Î½ÐÎϥݥ¤¥ó¥¿¤È¤·¤Æ¤â»ÈÍѤ·¤Þ¤¹¡£ + +.\"O .B SIOCADDRT +.\"O and +.\"O .B SIOCDELRT +.\"O take an input pointer whose type depends on +.\"O the protocol: +.BR SIOCADDRT , +.B SIOCDELRT +¤Ï·¿¤¬°Ê²¼¤Î¥×¥í¥È¥³¥ë¤Ë°Í¸¤¹¤ëÆþÎϥݥ¤¥ó¥¿¤ò»ÈÍѤ·¤Þ¤¹: +.nf + + Most protocols const struct rtentry * + AX.25 const struct ax25_route * + 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 [] +·¿¤Î¥ê¥¹¥È¤Ø½ñ¤­¹þ¤ß¤Þ¤¹¡£ + +.\"O .B SIOCSIFHWADDR +.\"O takes an input pointer whose type depends on the protocol: +.B SIOCSIFHWADDR +¤Ï·¿¤¬°Ê²¼¤Î¥×¥í¥È¥³¥ë¤Ë°Í¸¤¹¤ëÆþÎϥݥ¤¥ó¥¿¤ò»ÈÍѤ·¤Þ¤¹: +.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 +¤ÎÃæ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +.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 * + +.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 ¤ò´Þ¤ó¤Ç¤¤¤Þ¤»¤ó¡£ +.TS +l l l. +0x00000001 FDSETPRM FIBMAP +0x00000002 FDDEFPRM FIGETBSZ +0x00005382 CDROMAUDIOBUFSIZ SCSI_IOCTL_GET_IDLUN +0x00005402 SNDCTL_TMR_START TCSETS +0x00005403 SNDCTL_TMR_STOP TCSETSW +0x00005404 SNDCTL_TMR_CONTINUE TCSETSF +.TE +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR ioctl (2) diff --git a/draft/man2/ioperm.2 b/draft/man2/ioperm.2 new file mode 100644 index 00000000..f69c6ead --- /dev/null +++ b/draft/man2/ioperm.2 @@ -0,0 +1,165 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de) +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 15:12:05 1993 by Rik Faith +.\" Modified Tue Aug 1 16:27 1995 by Jochen Karrer +.\" +.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" Modified Mon Feb 15 17:28:41 CET 1999 by Andries E. Brouwer +.\" 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 +.SH ̾Á° +.\"O ioperm \- set port input/output permissions +ioperm \- ¥Ý¡¼¥È¤ÎÆþ½ÐÎϵö²Ä¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +/* for libc5 */ +.br +.B #include +/* for glibc */ +.sp +.BI "int ioperm(unsigned long " from ", unsigned long " num ", int " turn_on ); +.\"O .SH DESCRIPTION +.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 ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\" 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) +´Ø¿ô¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"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) +¤ÎÁ°¸å¤Ç¥¢¥¯¥»¥¹¸¢¤ÏÊݸ¤µ¤ì¤ë¡£¤³¤Îµ¡Ç½¤Ï +ÈóÆø¢¥×¥í¥°¥é¥à¤Ë¥Ý¡¼¥È¤Ø¤Î¥¢¥¯¥»¥¹¸¢¤ò +Í¿¤¨¤ë¤Î¤Ë»ÈÍѤǤ­¤ë¡£ + +.\"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 ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¤¿¤á¤À¤±¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤½¤Î¾¤Î¿¤¯¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¸ºß¤·¤Ê¤¤¤«¡¢¾ï¤Ë¥¨¥é¡¼¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ë \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.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. +(PowerPC ¤Ç) ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOMEM +.\" Could not allocate I/O bitmap. +.\"O Out of memory. +¥á¥â¥êÉÔ­¡£ +.TP +.B EPERM +.\"O The calling process has insufficient privilege. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë½½Ê¬¤Ê¸¢¸Â¤¬¤Ê¤«¤Ã¤¿¡£ +.\"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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR iopl (2), +.BR capabilities (7) diff --git a/draft/man2/iopl.2 b/draft/man2/iopl.2 new file mode 100644 index 00000000..e3778645 --- /dev/null +++ b/draft/man2/iopl.2 @@ -0,0 +1,162 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from linux/kernel/ioport.c (no copyright notice). +.\" +.\" 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 Tue Aug 1 16:47 1995 by Jochen Karrer +.\" +.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" Modified Fri Nov 27 14:50:36 CET 1998 by Andries Brouwer +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" Japanese Version Copyright (c) 1997 HORIMOTO Masafumi +.\" all rights reserved. +.\" Translated 1997-09-29, HORIMOTO Masafumi +.\" Modified 1999-04-03, HANATAKA Shinya +.\" Updated 2003-10-12, Kentaro Shirakata +.\" Updated 2005-02-24, Akihiro MOTOKI +.\" +.TH IOPL 2 2004-05-27 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iopl \- change I/O privilege level +iopl \- I/O Æø¢¥ì¥Ù¥ë¤òÊѹ¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int iopl(int " level ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR iopl () +.\"O changes the I/O privilege level of the calling process, as specified in +.\"O .IR level . +.BR iopl () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î I/O Æø¢¥ì¥Ù¥ë¤ò +.I level +¤Ç»ØÄꤷ¤¿ÃͤËÊѹ¹¤¹¤ë¡£ + +.\"O This call is necessary to allow 8514-compatible X servers to run under +.\"O Linux. +.\"O Since these X servers require access to all 65536 I/O ports, the +.\"O .BR ioperm (2) +.\"O call is not sufficient. +¤³¤Î´Ø¿ô¤Ï 8514 ¸ß´¹¤Î X ¥µ¡¼¥Ð¤ò Linux ¤ÇÆ°ºî¤µ¤»¤ë¤¿¤á¤ËɬÍפǤ¢¤ë¡£ +¤Ê¤¼¤Ê¤é¤³¤Î X ¥µ¡¼¥Ð¤Ï 65536 ¸Ä¤Î I/O ¥Ý¡¼¥ÈÁ´¤Æ¤Ø¤Î¥¢¥¯¥»¥¹¤òÍ׵᤹¤ë¤Î¤Ç +.BR ioperm (2) +´Ø¿ô¤Ç¤ÏÉÔ½½Ê¬¤À¤«¤é¤Ç¤¢¤ë¡£ + +.\"O In addition to granting unrestricted I/O port access, running at a higher +.\"O I/O privilege level also allows the process to disable interrupts. +.\"O This will probably crash the system, and is not recommended. +¤è¤ê¹â¤¤ I/O Æø¢¥ì¥Ù¥ë¤Ç¤ÎÆ°ºî¤ò¤µ¤»¤ë¤³¤È¤Ë¤è¤Ã¤Æ +I/O ¥Ý¡¼¥È¥¢¥¯¥»¥¹¤ÎÀ©¸Â¤ò²ò½ü¤¹¤ë¤³¤È¤Ë²Ã¤¨¤Æ¡¢¥×¥í¥»¥¹¤¬³ä¤ê¹þ¤ß¤ò +̵¸ú¤Ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£¤³¤Îµ¡Ç½¤Ï»þ¤È¤·¤Æ¥·¥¹¥Æ¥à¤ÎÇ˲õ¤ò +¤â¤¿¤é¤¹¤Î¤Ç´«¤á¤é¤ì¤Ê¤¤¡£ + +.\"O Permissions are inherited by +.\"O .BR fork (2) +.\"O and +.\"O .BR exec (2). +.BR fork (2) +¤ä +.BR exec (2) +¤ò¹Ô¤Ã¤¿¾ì¹ç¡¢Æø¢¤Ï·Ñ¾µ¤µ¤ì¤ë¡£ + +.\"O The I/O privilege level for a normal process is 0. +Ä̾ï¤Î¥×¥í¥»¥¹¤Î I/O Æø¢¥ì¥Ù¥ë¤Ï 0 ¤Ç¤¢¤ë¡£ + +.\"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 ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¤¿¤á¤À¤±¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤½¤Î¾¤Î¿¤¯¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¸ºß¤·¤Ê¤¤¤«¡¢¾ï¤Ë¥¨¥é¡¼¤òÊÖ¤¹¡£ +.\"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 EINVAL +.\"O .I level +.\"O is greater than 3. +°ú¤­¿ô +.I level +¤¬ 3 ¤è¤êÂ礭¤¤¡£ +.TP +.B ENOSYS +.\"O This call is unimplemented. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .TP +.\"O .B EPERM +.\"O The calling process has insufficient privilege to call +.\"O .BR iopl (); +.\"O the +.\"O .B CAP_SYS_RAWIO +.\"O capability is required. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë +.BR iopl () +¤ò¸Æ¤Ó½Ð¤¹¤Î¤Ë½½Ê¬¤Ê¸¢¸Â¤¬¤Ê¤«¤Ã¤¿¡£ +.BR iopl () +¤ò¸Æ¤Ó½Ð¤¹¤Ë¤Ï +.B CAP_SYS_RAWIO +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR iopl () +.\"O is Linux-specific and should not be used in processes +.\"O intended to be portable. +.BR iopl () +¤Ï Linux ÆÃÍ­¤Î´Ø¿ô¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç +»ÈÍѤ·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.\"O .SH NOTES +.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" +.SH ´ØÏ¢¹àÌÜ +.BR ioperm (2), +.BR capabilities (7) diff --git a/draft/man2/ioprio_set.2 b/draft/man2/ioprio_set.2 new file mode 100644 index 00000000..46c7a65c --- /dev/null +++ b/draft/man2/ioprio_set.2 @@ -0,0 +1,542 @@ +.\" This is _*_ nroff _*_ source. Emacs, gimme all those colors :) +.\" +.\" Copyright (c) International Business Machines orp., 2006 +.\" +.\" 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 +.\" +.\" HISTORY: +.\" 2006-04-27, created by Eduardo M. Fleury +.\" with various additions by Michael Kerrisk +.\" +.\" 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 +.\" +.TH IOPRIO_SET 2 2008-07-09 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ioprio_get, ioprio_set \- get/set I/O scheduling class and priority +ioprio_get, ioprio_set \- I/O ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ÈÍ¥ÀèÅÙ¤ÎÀßÄê/¼èÆÀ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.BI "int ioprio_get(int " which ", int " who ); +.BI "int ioprio_set(int " which ", int " who ", int " ioprio ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR ioprio_get () +.\"O and +.\"O .BR ioprio_set () +.\"O system calls respectively get and set the I/O scheduling class and +.\"O priority of one or more processes. +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR ioprio_get () +/ +.BR ioprio_set () +¤Ï¡¢(1¤Ä°Ê¾å¤Î) ¥×¥í¥»¥¹¤Î I/O ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤È +Í¥ÀèÅ٤μèÆÀ/ÀßÄê¤ò¹Ô¤¦¡£ + +.\"O The +.\"O .I which +.\"O and +.\"O .I who +.\"O arguments identify the process(es) on which the system +.\"O calls operate. +.\"O The +.\"O .I which +.\"O argument determines how +.\"O .I who +.\"O is interpreted, and has one of the following values: +.I which +¤È +.I who +°ú¤­¿ô¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÁàºîÂоݤȤʤë¥×¥í¥»¥¹¤ò»Ø¼¨¤¹¤ë¡£ +.I which +°ú¤­¿ô¤Ï¡¢ +.I who +¤ò¤É¤Î¤è¤¦¤Ë²ò¼á¤¹¤ë¤«¤ò·è¤á¤ë¤â¤Î¤Ç¡¢°Ê²¼¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄꤹ¤ë¡£ +.TP +.B IOPRIO_WHO_PROCESS +.\"O .I who +.\"O is a process ID identifying a single process. +.I who +¤Ï¥×¥í¥»¥¹ID ¤Ç¤¢¤ê¡¢»ØÄꤵ¤ì¤¿ 1 ¥×¥í¥»¥¹¤¬ÂоݤȤʤ롣 +.TP +.B IOPRIO_WHO_PGRP +.\"O .I who +.\"O is a process group ID identifying all the members of a process group. +.I who +¤Ï¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤Ç¤¢¤ê¡¢¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¤¬ÂоݤȤʤ롣 +.TP +.B IOPRIO_WHO_USER +.\"O .I who +.\"O is a user ID identifying all of the processes that +.\"O have a matching real UID. +.I who +¤Ï¥æ¡¼¥¶ID ¤Ç¤¢¤ê¡¢¼Â UID ¤Ë°ìÃפ¹¤ëÁ´¥×¥í¥»¥¹¤¬ÂоݤȤʤ롣 +.PP +.\"O If +.\"O .I which +.\"O is specified as +.\"O .B IOPRIO_WHO_PGRP +.\"O or +.\"O .B IOPRIO_WHO_USER +.\"O when calling +.\"O .BR ioprio_get (), +.\"O and more than one process matches +.\"O .IR who , +.\"O then the returned priority will be the highest one found among +.\"O all of the matching processes. +.\"O One priority is said to be +.\"O higher than another one if it belongs to a higher priority +.\"O class +.\"O .RB ( IOPRIO_CLASS_RT +.\"O is the highest priority class; +.\"O .B IOPRIO_CLASS_IDLE +.\"O is the lowest) +.\"O or if it belongs to the same priority class as the other process but +.\"O has a higher priority level (a lower priority number means a +.\"O higher priority level). +.BR ioprio_get () +¤Î¸Æ¤Ó½Ð¤·»þ¤Ë +.I which +¤Ë +.B IOPRIO_WHO_PGRP +¤« +.B IOPRIO_WHO_USER +¤¬»ØÄꤵ¤ì¡¢ +.I who +¤Ë°ìÃפ¹¤ë¥×¥í¥»¥¹¤¬Ê£¿ô¤¢¤Ã¤¿¾ì¹ç¡¢ +°ìÃפ¹¤ë¥×¥í¥»¥¹Á´ÂΤÎÃæ¤ÇºÇ¤â¹â¤¤Í¥ÀèÅÙ¤¬ÊÖ¤µ¤ì¤ë¡£ +Í¥ÀèÅÙ¤¬¹â¤¤¤È¤Ï¡¢¤è¤ê¹â¤¤Í¥ÀèÅÙ¥¯¥é¥¹¤Ë°¤·¤Æ¤¤¤ë +.RB ( IOPRIO_CLASS_RT +¤¬ºÇ¤â¹â¤¤Í¥ÀèÅÙ¥¯¥é¥¹¤Ç¡¢ +.B IOPRIO_CLASS_IDLE +¤¬ºÇ¤âÄ㤤)¡¢¤â¤·¤¯¤Ï +Ʊ¤¸Í¥ÀèÅÙ¥¯¥é¥¹¤Ë°¤·¤Æ¤¤¤ë¤¬Í¥ÀèÅÙ¥ì¥Ù¥ë¤¬¹â¤¤ +(Í¥ÀèÅÙÈֹ椬¾®¤µ¤¤Êý¤¬Í¥ÀèÅÙ¥ì¥Ù¥ë¤¬¹â¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë)¡¢ +¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ + +.\"O The +.\"O .I ioprio +.\"O argument given to +.\"O .BR ioprio_set () +.\"O is a bit mask that specifies both the scheduling class and the +.\"O priority to be assigned to the target process(es). +.\"O The following macros are used for assembling and dissecting +.\"O .I ioprio +.\"O values: +.BR ioprio_set () +¤ËÅϤ¹ +.I ioprio +°ú¤­¿ô¤Ï¡¢ÂоݤȤʤë¥×¥í¥»¥¹¤Ë³ä¤êÅö¤Æ¤ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤È +Í¥ÀèÅÙ¤ÎξÊý¤ò»ØÄꤹ¤ë¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +.I ioprio +¤ÎÃͤòÁȤßΩ¤Æ¤¿¤ê²ò¼á¤¹¤ë¤Î¤Ë¡¢°Ê²¼¤Î¥Þ¥¯¥í¤¬ÍøÍѤǤ­¤ë¡£ +.TP +.BI IOPRIO_PRIO_VALUE( class ", " data ) +.\"O Given a scheduling +.\"O .I class +.\"O and priority +.\"O .RI ( data ), +.\"O this macro combines the two values to produce an +.\"O .I ioprio +.\"O value, which is returned as the result of the macro. +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹ +.I class +¤ÈÍ¥ÀèÅÙ +.RI ( data ) +¤òÍ¿¤¨¤ë¤È¡¢¤³¤Î¥Þ¥¯¥í¤Ï 2¤Ä¤ÎÃͤòÁȤ߹ç¤ï¤»¤Æ¡¢ +.I ioprio +ÃͤòÀ¸À®¤·¡¢¥Þ¥¯¥í¤Î·ë²Ì¤È¤·¤ÆÊÖ¤¹¡£ +.TP +.BI IOPRIO_PRIO_CLASS( mask ) +.\"O Given +.\"O .I mask +.\"O (an +.\"O .I ioprio +.\"O value), this macro returns its I/O class component, that is, +.\"O one of the values +.\"O .BR IOPRIO_CLASS_RT , +.\"O .BR IOPRIO_CLASS_BE , +.\"O or +.\"O .BR IOPRIO_CLASS_IDLE . +.I mask +.RI ( ioprio +ÃÍ) ¤òÍ¿¤¨¤ë¤È¡¢¤³¤Î¥Þ¥¯¥í¤Ï I/O ¥¯¥é¥¹Í×ÁÇ¡¢¤Ä¤Þ¤ê +.BR IOPRIO_CLASS_RT , +.BR IOPRIO_CLASS_BE , +.B IOPRIO_CLASS_IDLE +¤Î¤¤¤º¤ì¤«°ì¤Ä¤ÎÃͤòÊÖ¤¹¡£ +.TP +.BI IOPRIO_PRIO_DATA( mask ) +.\"O Given +.\"O .I mask +.\"O (an +.\"O .I ioprio +.\"O value), this macro returns its priority +.\"O .RI ( data ) +.\"O component. +.I mask +.RI ( ioprio +ÃÍ) ¤òÍ¿¤¨¤ë¤È¡¢¤³¤Î¥Þ¥¯¥í¤ÏÍ¥ÀèÅÙ +.RI ( data ) +Í×ÁǤòÊÖ¤¹¡£ +.PP +.\"O See the NOTES section for more +.\"O information on scheduling classes and priorities. +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ÈÍ¥ÀèÅ٤˴ؤ¹¤ë¾Ü¤·¤¤¾ðÊó¤Ï¡¢ +¡ÖÈ÷¹Í¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ + +.\"O I/O priorities are supported for reads and for synchronous +.\"O .RB ( O_DIRECT , +.\"O .BR O_SYNC ) +.\"O writes. +.\"O I/O priorities are not supported for asynchronous +.\"O writes because they are issued outside the context of the program +.\"O dirtying the memory, and thus program-specific priorities do not apply. +I/O Í¥ÀèÅÙ¤ÏÆɤ߽Ф·¤ÈƱ´ü½ñ¤­¹þ¤ß +.RB ( O_DIRECT , +.BR O_SYNC ) +¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +I/O Í¥ÀèÅÙ¤ÏÈóƱ´ü½ñ¤­¹þ¤ß¤Ë¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢ +ÈóƱ´ü½ñ¤­¹þ¤ß¤Ï¥á¥â¥ê½ñ¤­´¹¤¨¤ò¹Ô¤¦¥×¥í¥°¥é¥à¤ÎÆ°ºî (context) ¤È¤Ï +´Ø·¸¤Ê¤¯È¯¹Ô¤µ¤ì¡¢¤½¤Î¤¿¤á¥×¥í¥°¥é¥àñ°Ì¤ÎÍ¥ÀèÅÙ¤ÏŬÍѤµ¤ì¤Ê¤¤¤«¤é +¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR ioprio_get () +.\"O returns the +.\"O .I ioprio +.\"O value of the process with highest I/O priority of any of the processes +.\"O that match the criteria specified in +.\"O .I which +.\"O and +.\"O .IR who . +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR ioprio_get () +¤Ï¡¢ +.I which +¤È +.I who +¤Ç»ØÄꤵ¤ì¤¿´ð½à¤Ë¹çÃפ·¤¿Á´¥×¥í¥»¥¹¤ÇºÇ¤â¹â¤¤ I/O Í¥ÀèÅÙ¤ò»ý¤Ä¥×¥í¥»¥¹¤Î +.I ioprio +ÃͤòÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.PP +.\"O On success, +.\"O .BR ioprio_set () +.\"O returns 0. +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR ioprio_set () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O Invalid value for +.\"O .I which +.\"O or +.\"O .IR ioprio . +.\"O Refer to the NOTES section for available scheduler +.\"O classes and priority levels for +.\"O .IR ioprio . +.I which +¤« +.I ioprio +¤ÎÃͤ¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.I ioprio +ÍѤ˻ØÄê²Äǽ¤Ê¥¹¥±¥¸¥å¡¼¥é¥¯¥é¥¹¤ÈÍ¥ÀèÅÙ¥ì¥Ù¥ë¤Ë¤Ä¤¤¤Æ¤Ï +¡ÖÈ÷¹Í¡×¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B EPERM +.\"O The calling process does not have the privilege needed to assign this +.\"O .I ioprio +.\"O to the specified process(es). +.\"O See the NOTES section for more information on required +.\"O privileges for +.\"O .BR ioprio_set (). +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¡¢»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Ë +.I ioprio +¤ò³ä¤êÅö¤Æ¤ë¤Î¤ËɬÍפʸ¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.BR ioprio_set () +¤ËɬÍפʸ¢¸Â¤Ë¤Ä¤¤¤Æ¤Î¾Ü¤·¤¤¾ðÊó¤Ï¡ÖÈ÷¹Í¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B ESRCH +.\"O No process(es) could be found that matched the specification in +.\"O .I which +.\"O and +.\"O .IR who . +.I which +¤È +.I who +¤Ç»ØÄꤵ¤ì¤¿´ð½à¤Ë¹çÃפ¹¤ë¥×¥í¥»¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These system calls have been available on Linux since +.\"O kernel 2.6.13. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.6.13 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These system calls are Linux-specific. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH È÷¹Í +.\"O Glibc does not provide wrapper for these system calls; call them using +.\"O .BR syscall (2). +glibc ¤Ï¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£ + +.\"O These system calls only have an effect when used +.\"O in conjunction with an I/O scheduler that supports I/O priorities. +.\"O As at kernel 2.6.17 the only such scheduler is the Completely Fair Queuing +.\"O (CFQ) I/O scheduler. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢I/O Í¥ÀèÅÙ¤ËÂбþ¤·¤¿ I/O ¥¹¥±¥¸¥å¡¼¥é¤È +ÁȤ߹ç¤ï¤»¤Æ»ÈÍѤµ¤ì¤¿¾ì¹ç¤Ë¤Î¤ß¸ú²Ì¤ò»ý¤Ä¡£ +¥«¡¼¥Í¥ë 2.6.17 ¤Ç¤Ï¡¢¤³¤Î¾ò·ï¤òËþ¤¿¤¹¥¹¥±¥¸¥å¡¼¥é¤Ï +Completely Fair Queuing (CFQ) I/O ¥¹¥±¥¸¥å¡¼¥é¤À¤±¤Ç¤¢¤ë¡£ +.\"O .SS "Selecting an I/O Scheduler" +.SS I/O ¥¹¥±¥¸¥å¡¼¥é¤ÎÁªÂò +.\"O I/O Schedulers are selected on a per-device basis via the special +.\"O file +.\"O .IR /sys/block//queue/scheduler . +I/O ¥¹¥±¥¸¥å¡¼¥é¤ÎÁªÂò¤Ï¥Ç¥Ð¥¤¥¹Ã±°Ì¤Ë¹Ô¤ï¤ì¡¢¤½¤ÎÁªÂò¤Ï +¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë +.I /sys/block//queue/scheduler +·Ðͳ¤Ç¹Ô¤ï¤ì¤ë¡£ + +.\"O One can view the current I/O scheduler via the +.\"O .I /sys +.\"O file system. +.\"O For example, the following command +.\"O displays a list of all schedulers currently loaded in the kernel: +¸½ºß¤Î I/O ¥¹¥±¥¸¥å¡¼¥é¤Ï +.I /sys +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à·Ðͳ¤Ç»²¾È¤Ç¤­¤ë¡£Î㤨¤Ð¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤È¡¢ +¸½ºß¥«¡¼¥Í¥ë¤Ç¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥¹¥±¥¸¥å¡¼¥é¤ÎÁ´¥ê¥¹¥È¤¬É½¼¨¤µ¤ì¤ë¡£ +.sp +.RS +.nf +.RB "$" " cat /sys/block/hda/queue/scheduler" +noop anticipatory deadline [cfq] +.fi +.RE +.sp +.\"O The scheduler surrounded by brackets is the one actually +.\"O in use for the device +.\"O .RI ( hda +.\"O in the example). +³ç¸Ì¤Ç°Ï¤Þ¤ì¤¿¥¹¥±¥¸¥å¡¼¥é¤¬¤½¤Î¥Ç¥Ð¥¤¥¹ (¾å¤ÎÎã¤Ç¤Ï +.IR hda ) +¤Ë¤Ä¤¤¤Æ¼ÂºÝ¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¥¹¥±¥¸¥å¡¼¥é¤Ç¤¢¤ë¡£ +.\"O Setting another scheduler is done by writing the name of the +.\"O new scheduler to this file. +.\"O For example, the following command will set the +.\"O scheduler for the +.\"O .I hda +.\"O device to +.\"O .IR cfq : +Ê̤Υ¹¥±¥¸¥å¡¼¥é¤òÀßÄꤹ¤ë¤Ë¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¿·¤·¤¤¥¹¥±¥¸¥å¡¼¥é̾¤ò +½ñ¤­¹þ¤á¤Ð¤è¤¤¡£Î㤨¤Ð¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤È¡¢¥Ç¥Ð¥¤¥¹ +.I hda +¤Î¥¹¥±¥¸¥å¡¼¥é¤È¤·¤Æ +.I cfq +¤¬ÀßÄꤵ¤ì¤ë¡£ +.sp +.RS +.nf +.RB "$" " su" +Password: +.RB "#" " echo cfq > /sys/block/hda/queue/scheduler" +.fi +.RE +.\"O .SS "The Completely Fair Queuing (CFQ) I/O Scheduler" +.SS "Completely Fair Queuing (CFQ) I/O ¥¹¥±¥¸¥å¡¼¥é" +.\"O Since v3 (aka CFQ Time Sliced) CFQ implements +.\"O I/O nice levels similar to those +.\"O of CPU scheduling. +.\"O These nice levels are grouped in three scheduling classes +.\"O each one containing one or more priority levels: +¥Ð¡¼¥¸¥ç¥ó 3 (ÊÌ̾ CFQ Time Sliced) °Ê¹ß¡¢ +CPU ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ÈƱÍͤΠI/O nice ¥ì¥Ù¥ë¤¬ CFQ ¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î nice ¥ì¥Ù¥ë¤Ï 3¤Ä¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ËʬÎà¤Ç¤­¡¢ +³Æ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤Ë¤Ä¤­ 1¤Ä°Ê¾å¤ÎÍ¥ÀèÅÙ¥ì¥Ù¥ë¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.BR IOPRIO_CLASS_RT " (1)" +.\"O This is the real-time I/O class. +.\"O This scheduling class is given +.\"O higher priority than any other class: +.\"O processes from this class are +.\"O given first access to the disk every time. +.\"O Thus this I/O class needs to be used with some +.\"O care: one I/O real-time process can starve the entire system. +.\"O Within the real-time class, +.\"O there are 8 levels of class data (priority) that determine exactly +.\"O how much time this process needs the disk for on each service. +.\"O The highest real-time priority level is 0; the lowest is 7. +.\"O In the future this might change to be more directly mappable to +.\"O performance, by passing in a desired data rate instead. +¤³¤ì¤Ï¥ê¥¢¥ë¥¿¥¤¥à I/O ¥¯¥é¥¹¤Ç¤¢¤ë¡£ +¤³¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤Ë¤Ï¾¤Î¥¯¥é¥¹¤è¤ê¤â¹â¤¤Í¥ÀèÅÙ¤¬Í¿¤¨¤é¤ì¤ë¡£ +¤³¤Î¥¯¥é¥¹¤Î¥×¥í¥»¥¹¤Ë¤Ï¡¢¾ï¤Ë¥Ç¥£¥¹¥¯¤Ø¤Î¥¢¥¯¥»¥¹¤¬Í¥À褷¤Æ +³ä¤êÅö¤Æ¤é¤ì¤ë¡£¤½¤Î¤¿¤á¡¢¤³¤Î I/O ¥¯¥é¥¹¤ò»È¤¦ºÝ¤Ë¤Ï¡¢ +¤¿¤Ã¤¿°ì¤Ä¤Î ¥ê¥¢¥ë¥¿¥¤¥à I/O ¥¯¥é¥¹¤Î¥×¥í¥»¥¹¤Ë¤è¤ê +¥·¥¹¥Æ¥àÁ´ÂΤΥǥ£¥¹¥¯¥¢¥¯¥»¥¹¤¬¤Ç¤­¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤³¤È¤¬¤¢¤ë +¤È¤¤¤¦ÅÀ¤Ë¡¢Ãí°Õ¤òʧ¤¦É¬Íפ¬¤¢¤ë¡£ +¤³¤Î¥¯¥é¥¹¤Ë¤Ï¡¢8 Ãʳ¬¤Î class data (Í¥ÀèÅÙ¥ì¥Ù¥ë) ¤¬¤¢¤ë¡£ +¤³¤ÎÃͤϡ¢¤½¤Î¥×¥í¥»¥¹¤¬ 1²ó¤Î¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹¤Ë¤É¤ì¤À¤±¤Î +»þ´Ö¤¬É¬Íפ«¤òÀµ³Î¤Ë·è¤á¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +ºÇ¹â¤Î¥ê¥¢¥ë¥¿¥¤¥àÍ¥ÀèÅÙ¥ì¥Ù¥ë¤Ï 0 ¤Ç¡¢ºÇÄã¤Ï 7 ¤Ç¤¢¤ë¡£ +¾­ÍèŪ¤Ë¤Ï¡¢Í¥ÀèÅÙ¥ì¥Ù¥ë¤Ï¡¢´õ˾¤¹¤ë¥Ç¡¼¥¿¥ì¡¼¥È¤òÅϤ¹¤Ê¤É¡¢ +¤è¤êľÀÜŪ¤ËÀ­Ç½¾ò·ï¤òÈ¿±Ç¤Ç¤­¤ë¤è¤¦¤ËÊѹ¹¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.BR IOPRIO_CLASS_BE " (2)" +.\"O This is the best-effort scheduling class, +.\"O which is the default for any process +.\"O that hasn't set a specific I/O priority. +.\"O The class data (priority) determines how much +.\"O I/O bandwidth the process will get. +.\"O Best-effort priority levels are analogous to CPU nice values +.\"O (see +.\"O .BR getpriority (2)). +.\"O The priority level determines a priority relative +.\"O to other processes in the best-effort scheduling class. +.\"O Priority levels range from 0 (highest) to 7 (lowest). +¤³¤ì¤Ï ¥Ù¥¹¥È¥¨¥Õ¥©¡¼¥È¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤Ç¤¢¤ë¡£ +¤³¤Î¥¯¥é¥¹¤Ï¡¢ÆÃÄê¤Î I/O Í¥ÀèÅÙ¤òÀßÄꤷ¤Æ¤¤¤Ê¤¤¥×¥í¥»¥¹¤Î +¥Ç¥Õ¥©¥ë¥ÈÃͤǤ¢¤ë¡£ +class data (Í¥ÀèÅÙ¥ì¥Ù¥ë) ¤Ë¤è¤ê¡¢¤½¤Î¥×¥í¥»¥¹¤¬¤É¤ÎÄøÅ٤Π+I/O ÂÓ°è¤òÆÀ¤é¤ì¤ë¤«¤¬·èÄꤵ¤ì¤ë¡£ +¥Ù¥¹¥È¥¨¥Õ¥©¡¼¥È¡¦Í¥ÀèÅÙ¥ì¥Ù¥ë¤Ï¡¢CPU ¤Î nice ÃÍ +.RB ( getpriority (2) +»²¾È) ¤ÈƱÍͤΤâ¤Î¤Ç¤¢¤ë¡£ +Í¥ÀèÅÙ¥ì¥Ù¥ë¤Ï¡¢¥Ù¥¹¥È¥¨¥Õ¥©¡¼¥È¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ÎÃæ¤Ç +¾¤Î¥×¥í¥»¥¹¤È¤ÎÁêÂÐŪ¤ÊÍ¥ÀèÅÙ¤ò·èÄꤹ¤ë¡£ +Í¥ÀèÅÙ¥ì¥Ù¥ë¤ÎÃͤÎÈÏ°Ï¤Ï 0 (ºÇ¹â) ¤«¤é 7 (ºÇÄã) ¤Ç¤¢¤ë¡£ +.TP +.BR IOPRIO_CLASS_IDLE " (3)" +.\"O This is the idle scheduling class. +.\"O Processes running at this level only get I/O +.\"O time when no-one else needs the disk. +.\"O The idle class has no class data. +.\"O Attention is required when assigning this priority class to a process, +.\"O since it may become starved if higher priority processes are +.\"O constantly accessing the disk. +¤³¤ì¤Ï idle ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤Ç¤¢¤ë¡£ +¤³¤Î¥ì¥Ù¥ë¤ÇÆ°ºî¤¹¤ë¥×¥í¥»¥¹¤Ï¾¤Ë¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹¤ò¤·¤è¤¦¤È¤¹¤ë +¥×¥í¥»¥¹¤¬¤Ê¤¤¾ì¹ç¤Ë¤Î¤ß I/O »þ´Ö¤ò¼èÆÀ¤¹¤ë¡£ +idle ¥¯¥é¥¹¤Ë¤Ï class data (Í¥ÀèÅÙ) ¤ÏÍÑ°Õ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¥×¥í¥»¥¹¤Ë¤³¤ÎÍ¥ÀèÅÙ¤ò³ä¤êÅö¤Æ¤ëºÝ¤Ë¤ÏÃí°Õ¤¬É¬ÍפǤ¢¤ë¡£ +¤Ê¤¼¤Ê¤é¡¢Í¥ÀèÅ٤ι⤤¥×¥í¥»¥¹¤¬¾ï¤Ë¥Ç¥£¥¹¥¯¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï +¥Ç¥£¥¹¥¯¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¯¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ë¤«¤é¤À¡£ +.PP +.\"O Refer to +.\"O .I Documentation/block/ioprio.txt +.\"O for more information on the CFQ I/O Scheduler and an example program. +CFQ I/O ¥¹¥±¥¸¥å¡¼¥é¤Î¹¹¤Ê¤ë¾ðÊó¤È¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ¤Ï +.I Documentation/block/ioprio.txt +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SS "Required permissions to set I/O priorities" +.SS "I/O Í¥ÀèÅÙ¤ÎÀßÄê¤ËɬÍפʵö²Ä" +.\"O Permission to change a process's priority is granted or denied based +.\"O on two assertions: +¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤òÊѹ¹¤¹¤ëµö²Ä¤¬ÆÀ¤é¤ì¤ë¤«¤É¤¦¤«¤Ï +°Ê²¼¤Î 2¤Ä¤Î¾ò·ï¤Ë´ð¤¤¤Æ·èÄꤵ¤ì¤ë¡£ +.TP +.\"O .B "Process ownership" +.B "¥×¥í¥»¥¹¤Î½êÍ­¸¢" +.\"O An unprivileged process may only set the I/O priority of a process +.\"O whose real UID +.\"O matches the real or effective UID of the calling process. +.\"O A process which has the +.\"O .B CAP_SYS_NICE +.\"O capability can change the priority of any process. +ÈóÆø¢¥×¥í¥»¥¹¤Ï¡¢¥×¥í¥»¥¹¤Î¼Â UID ¤¬¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â UID ¤â¤·¤¯¤Ï +¼Â¸ú UID ¤È°ìÃפ¹¤ë¥×¥í¥»¥¹¤Î I/O Í¥ÀèÅ٤ΤߤòÀßÄê¤Ç¤­¤ë¡£ +.B CAP_SYS_NICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹¤Ï¡¢¤É¤Î¥×¥í¥»¥¹¤ÎÍ¥ÀèÅ٤ǤâÊѹ¹¤Ç¤­¤ë¡£ +.TP +.\"O .B "What is the desired priority" +.B "¤É¤ÎÍ¥ÀèÅÙ¤ËÀßÄꤷ¤è¤¦¤È¤·¤Æ¤¤¤ë¤«" +.\"O Attempts to set very high priorities +.\"O .RB ( IOPRIO_CLASS_RT ) +.\"O require the +.\"O .B CAP_SYS_ADMIN +.\"O capability. +Èó¾ï¤Ë¹â¤¤Í¥ÀèÅÙ +.RB ( IOPRIO_CLASS_RT ) +¤òÀßÄꤷ¤è¤¦¤È¤¹¤ë¾ì¹ç¡¢ +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.\"O Kernel versions up to 2.6.24 also required +.\"O .B CAP_SYS_ADMIN +.\"O to set a very low priority +.\"O .RB ( IOPRIO_CLASS_IDLE ), +.\"O but since Linux 2.6.25, this is no longer required. +¥«¡¼¥Í¥ë 2.6.24 °ÊÁ°¤Ç¤Ï¡¢Èó¾ï¤ËÄ㤤ͥÀèÅÙ +.RB ( IOPRIO_CLASS_IDLE ) +¤òÀßÄꤹ¤ë¤¿¤á¤Ë¤â +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤Ã¤¿¤¬¡¢ +Linux 2.6.25 °Ê¹ß¤Ç¤Ï¤â¤Ï¤äɬÍפʤ¯¤Ê¤Ã¤¿¡£ +.PP +.\"O A call to +.\"O .BR ioprio_set () +.\"O must follow both rules, or the call will fail with the error +.\"O .BR EPERM . +.BR ioprio_set () +¤Ï¤³¤ÎξÊý¤Î¥ë¡¼¥ë¤Ë½¾¤¤¡¢¾ò·ï¤òËþ¤¿¤µ¤Ê¤¤¾ì¹ç¡¢¥¨¥é¡¼ +.B EPERM +¤Ç¼ºÇÔ¤¹¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\" 6 May 07: Bug report raised: +.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=4464 +.\" Ulriich Drepper replied that he wasn't going to add these +.\" to glibc. +.\"O Glibc does not yet provide a suitable header file defining +.\"O the function prototypes and macros described on this page. +.\"O Suitable definitions can be found in +.\"O .IR linux/ioprio.h . +glibc ¤Ï¡¢¤³¤Î¥Ú¡¼¥¸¤Ëµ­ºÜ¤µ¤ì¤¿´Ø¿ô¥×¥í¥È¥¿¥¤¥×¤ä¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë +ŬÀڤʥإåÀ¥Õ¥¡¥¤¥ë¤ò¤Þ¤ÀÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +ɬÍפÊÄêµÁ¤Ë¤Ä¤¤¤Æ¤Ï +.I linux/ioprio.h +¤ò¸«¤ì¤Ð¤è¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getpriority (2), +.BR open (2), +.BR capabilities (7) +.sp +.\"O Documentation/block/ioprio.txt in the kernel source tree. +¥«¡¼¥Í¥ë¡¦¥½¡¼¥¹Æâ¤Î Documentation/block/ioprio.txt diff --git a/draft/man2/ipc.2 b/draft/man2/ipc.2 new file mode 100644 index 00000000..faca08e2 --- /dev/null +++ b/draft/man2/ipc.2 @@ -0,0 +1,113 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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 Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sun Feb 23 16:13:46 JST 1997 +.\" by HANATAKA Shinya +.\" Updated 2007-09-04, Akihiro MOTOKI , LDP v2.64 +.\" +.\"WORD: IPC IPC +.\"WORD: message ¥á¥Ã¥»¡¼¥¸ +.\"WORD: semaphore ¥»¥Þ¥Õ¥©¡¼ +.\"WORD: shared memory ¶¦Í­¥á¥â¥ê +.\"WORD: entry point ¥¨¥ó¥È¥ê¡¦¥Ý¥¤¥ó¥È +.\"WORD: argument °ú¤­¿ô +.\"WORD: hacker ¥Ï¥Ã¥«¡¼ +.\"WORD: standart library ɸ½à¥é¥¤¥Ö¥é¥ê +.\"WORD: implement ¼ÂÁõ +.\" +.TH IPC 2 2007-06-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ipc \- System V IPC system calls +ipc \- System V IPC ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.BI "int ipc(unsigned int " call ", int " first ", int " second \ +", int " third , +.BI " void *" ptr ", long " fifth ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR ipc () +.\"O is a common kernel entry point for the System V IPC calls +.\"O for messages, semaphores, and shared memory. +.\"O .I call +.\"O determines which IPC function to invoke; +.\"O the other arguments are passed through to the appropriate call. +.BR ipc () +¤Ï ¥á¥Ã¥»¡¼¥¸¡¢¥»¥Þ¥Õ¥©¡¼¡¢¶¦Í­¥á¥â¥ê¤Ë´Ø¤¹¤ë System V IPC ¥³¡¼¥ë¤Î +¶¦Ä̤Υ«¡¼¥Í¥ë¤Ø¤Î¥¨¥ó¥È¥ê¡¦¥Ý¥¤¥ó¥È¤Ç¤¢¤ë¡£ +.I call +¤Ï¤É¤Î IPC ´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¤«¤ò·è¤á¡¨ +¾¤Î°ú¤­¿ô¤ÏŬÀڤʥ³¡¼¥ë¤Ø¤ÈÅϤµ¤ì¤ë¡£ +.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 ipc (). +¥æ¡¼¥¶¡¼¡¦¥×¥í¥°¥é¥à¤ÏÄ̾ï¤Î̾Á°¤ÇŬÀڤʴؿô¤ò¸Æ¤Ó½Ð¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +ɸ½à¥é¥¤¥Ö¥é¥ê¤Î¼ÂÁõ¼Ô¤ä¥«¡¼¥Í¥ë¡¦¥Ï¥Ã¥«¡¼¤Î¤ß¤¬ +.BR ipc () +¤Ë¤Ä¤¤¤ÆÃΤëɬÍפ¬¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR ipc () +.\"O is Linux-specific, and should not be used in programs +.\"O intended to be portable. +.BR ipc () +¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢ °Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O On a few architectures, for example ia64, there is no +.\"O .BR ipc () +.\"O system call; instead +.\"O .BR msgctl (2), +.\"O .BR semctl (2), +.\"O .BR shmctl (2), +.\"O and so on really are implemented as separate system calls. +ia64 ¤Ê¤É¤Î¤¤¤¯¤Ä¤«¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR ipc () +¤¬Â¸ºß¤·¤Ê¤¤¡£¼ÂºÝ¤Ë¤Ï¡¢¤½¤ÎÂå¤ï¤ê¤Ë +.BR msgctl (2), +.BR semctl (2), +.BR shmctl (2) +¤Ê¤É¤¬ÆÈΩ¤·¤¿¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR msgctl (2), +.BR msgget (2), +.BR msgrcv (2), +.BR msgsnd (2), +.BR semctl (2), +.BR semget (2), +.BR semop (2), +.BR shmat (2), +.BR shmctl (2), +.BR shmdt (2), +.BR shmget (2) diff --git a/draft/man2/kill.2 b/draft/man2/kill.2 new file mode 100644 index 00000000..62d425e6 --- /dev/null +++ b/draft/man2/kill.2 @@ -0,0 +1,292 @@ +.\" 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 by Thomas Koenig +.\" Modified 1993-07-23 by Rik Faith +.\" Modified 1993-07-25 by Rik Faith +.\" Modified 1995-11-01 by Michael Haardt +.\" +.\" Modified 1996-04-14 by Andries Brouwer +.\" [added some polishing contributed by Mike Battersby ] +.\" Modified 1996-07-21 by Andries Brouwer +.\" Modified 1997-01-17 by Andries Brouwer +.\" Modified 2001-12-18 by Andries Brouwer +.\" Modified 2002-07-24 by Michael Kerrisk +.\" Added note on historical rules enforced when an unprivileged process +.\" sends a signal. +.\" Modified 2004-06-16 by Michael Kerrisk +.\" Added note on CAP_KILL +.\" Modified 2004-06-24 by aeb +.\" Modified, 2004-11-30, after idea from emmanuel.colbus@ensimag.imag.fr +.\" +.\" 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 +.\" Updated 2001-12-27, Kentaro Shirakata +.\" Updated 2002-01-03, Kentaro Shirakata +.\" Updated 2002-09-27, Kentaro Shirakata +.\" Updated 2005-02-27, Akihiro MOTOKI +.\" Updated 2005-12-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.16 +.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: process group ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× +.\"WORD: permission µö²Ä +.\"WORD: privileges Æø¢ +.\"WORD: set-user-id ¥»¥Ã¥È¥æ¡¼¥¶¡¼ID +.\"WORD: signal handler ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¡¼ +.\" +.TH KILL 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O kill \- send signal to a process +kill \- ¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "int kill(pid_t " pid ", int " sig ); +.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 kill (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR kill () +.\"O system call +.\"O can be used to send any signal to any process group or process. +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î +.BR kill () +¤Ï¡¢Ç¤°Õ¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤â¤·¤¯¤Ï¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤ò +Á÷¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£ +.PP +.\"O If \fIpid\fP is positive, then signal \fIsig\fP is sent to the +.\"O process with the ID specified by \fIpid\fP. +\fIpid\fP ¤ËÀµ¤ÎÃͤò»ØÄꤷ¤¿¾ì¹ç¡¢¥·¥°¥Ê¥ë \fIsig\fP ¤¬ +\fIpid\fP ¤Ç»ØÄꤵ¤ì¤¿ ID ¤ò»ý¤Ä¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤ë¡£ +.PP +.\"O If \fIpid\fP equals 0, then \fIsig\fP is sent to every process in the +.\"O process group of the calling process. +\fIpid\fP ¤Ë 0 ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Ë°¤¹¤ë¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤Ë +\fIsig\fP ¤Ç»ØÄꤷ¤¿¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +.PP +.\"O If \fIpid\fP equals \-1, then \fIsig\fP is sent to every process +.\"O for which the calling process has permission to send signals, +.\"O except for process 1 (\fIinit\fP), but see below. +\fIpid\fP ¤Ë \-1 ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ \fIsig\fP ¤Ç»ØÄꤷ¤¿¥·¥°¥Ê¥ë¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÁ÷¤ëµö²Ä¤ò»ý¤ÄÁ´¤Æ¤Î¥×¥í¥»¥¹¤Ë +Á÷¤é¤ì¤ë¡£Ã¢¤·¡¢¥×¥í¥»¥¹ÈÖ¹æ 1 (\fIinit\fP) ¤Ø¤Ï¥·¥°¥Ê¥ë¤ÏÁ÷¤é¤ì¤Ê¤¤¡£ +°Ê²¼¤Î´ØÏ¢Éôʬ¤â»²¾È¤Î¤³¤È¡£ +.PP +.\"O If \fIpid\fP is less than \-1, then \fIsig\fP is sent to every process +.\"O in the process group whose ID is \fI\-pid\fP. +\fIpid\fP ¤Ë \-1 ¤è¤ê¾®¤µ¤ÊÃͤò»ØÄꤷ¤¿¾ì¹ç¡¢ +ID ¤¬ \fI\-pid\fP ¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Ë°¤¹¤ë¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤Ë +\fIsig\fP ¤Ç»ØÄꤷ¤¿¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +.PP +.\"O If \fIsig\fP is 0, then no signal is sent, but error checking is still +.\"O performed; +.\"O this can be used to check for the existence of a process ID or +.\"O process group ID. +\fIsig\fP ¤Ë 0 ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¥·¥°¥Ê¥ë¤ÏÁ÷¤é¤ì¤Ê¤¤¤¬¡¢ +¥¨¥é¡¼¤Î¥Á¥§¥Ã¥¯¤Ï¹Ô¤ï¤ì¤ë¡£¤³¤ì¤ò»È¤Ã¤Æ¡¢¥×¥í¥»¥¹ ID ¤ä +¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤Î¸ºß³Îǧ¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O For a process to have permission to send a signal +.\"O it must either be privileged (under Linux: have the +.\"O .B CAP_KILL +.\"O capability), or the real or effective +.\"O user ID of the sending process must equal the real or +.\"O saved set-user-ID of the target process. +.\"O In the case of +.\"O .B SIGCONT +.\"O it suffices when the sending and receiving +.\"O processes belong to the same session. +¤¢¤ë¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÁ÷¤ëµö²Ä¤ò»ý¤Ä¤Ë¤Ï¡¢ +¤½¤Î¥×¥í¥»¥¹¤¬Æø¢ (Linux ¤Ç¤Ï +.B CAP_KILL +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤Ä¥×¥í¥»¥¹¤Ç¤¢¤ë¤«¡¢¥·¥°¥Ê¥ë¤òÁ÷¤ë¦¤Î¥×¥í¥»¥¹¤Î +¼ÂUID ¤«¼Â¸úUID ¤¬¼õ¤±¤ë¦¤Î¥×¥í¥»¥¹¤Î¼Â set-UID ¤« +Êݸ (saved) set-UID ¤¬°ìÃפ·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B SIGCONT +¤Î¾ì¹ç¤Ï¡¢¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ë¥×¥í¥»¥¹¤È¼õ¿®¤¹¤ë¥×¥í¥»¥¹¤¬ +Ʊ¤¸¥»¥Ã¥·¥ç¥ó¤Ë½ê°¤·¤Æ¤¤¤ì¤Ð½½Ê¬¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success (at least one signal was sent), 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 EINVAL +.\"O An invalid signal was specified. +̵¸ú¤Ê¥·¥°¥Ê¥ë¤ò»ØÄꤷ¤¿¡£ +.TP +.B EPERM +.\"O The process does not have permission to send the signal +.\"O to any of the receiving processes. +¥×¥í¥»¥¹¤¬¡¢¼õ¿®¤¹¤ë¥×¥í¥»¥¹¤Î¤¤¤º¤ì¤ËÂФ·¤Æ¤â +¥·¥°¥Ê¥ë¤òÁ÷¤ëµö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ESRCH +.\"O The pid or process group does not exist. +.\"O Note that an existing process might be a zombie, +.\"O a process which already committed termination, but +.\"O has not yet been +.\"O .BR wait (2)ed +.\"O for. +»ØÄꤷ¤¿¥×¥í¥»¥¹¤Þ¤¿¤Ï¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¡£ +¥¾¥ó¥Ó¥×¥í¥»¥¹¤Ï¸ºß¤¹¤ë¥×¥í¥»¥¹¤È¤·¤Æ¤ß¤Ê¤µ¤ì¤ë¡£ +¥¾¥ó¥Ó¥×¥í¥»¥¹¤È¤Ï¤¹¤Ç¤Ë½èÍý¤Ï½ªÎ»¤·¤Æ¤¤¤ë¤¬¡¢¿Æ¥×¥í¥»¥¹¤Ë¤è¤ë +.BR wait () +½èÍý¤¬¹Ô¤ï¤ì¤Æ¤¤¤Ê¤¤¥×¥í¥»¥¹¤Î¤³¤È¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The only signals that can be sent to process ID 1, the +.\"O .I init +.\"O process, are those for which +.\"O .I init +.\"O has explicitly installed signal handlers. +.\"O This is done to assure the +.\"O system is not brought down accidentally. +¥×¥í¥»¥¹ÈÖ¹æ 1 ¤Î +.I init +¥×¥í¥»¥¹¤ËÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¥·¥°¥Ê¥ë¤Ï¡¢ +.I init +¤¬ÌÀ¼¨Åª¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤷ¤¿¥·¥°¥Ê¥ë¤À¤±¤Ç¤¢¤ë¡£ +¤³¤¦¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ï¡¢¸í¤Ã¤Æ¥·¥¹¥Æ¥à¤ò¥À¥¦¥ó¤µ¤»¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.LP +.\"O POSIX.1-2001 requires that \fIkill(\-1,sig)\fP send \fIsig\fP +.\"O to all processes that the calling process may send signals to, +.\"O except possibly for some implementation-defined system processes. +.\"O Linux allows a process to signal itself, but on Linux the call +.\"O \fIkill(\-1,sig)\fP does not signal the calling process. +POSIX.1-2001 ¤Ç¤Ï¡¢ \fIkill(\-1,sig)\fP ¤¬ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤¬½ÐÍè¤ë¥×¥í¥»¥¹Á´¤Æ¤Ë +\fIsig\fP ¤òÁ÷¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +⤷¡¢¥·¥¹¥Æ¥à¼ÂÁõ»þ¤ËÄê¤á¤é¤ì¤¿¥·¥¹¥Æ¥à¥×¥í¥»¥¹¤Ï +¥·¥°¥Ê¥ë¤ÎÁ÷¿®Âоݤ«¤é½ü³°¤µ¤ì¤ë¡£ +Linux ¤Ç¤Ï¡¢¥×¥í¥»¥¹¤¬¼«Ê¬¼«¿È¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¬¡¢ +Linux ¤Î \fIkill(\-1,sig)\fP ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë¤Ï¥·¥°¥Ê¥ë¤òÁ÷¤é¤Ê¤¤¡£ +.LP +.\"O POSIX.1-2001 requires that if a process sends a signal to itself, +.\"O and the sending thread does not have the signal blocked, +.\"O and no other thread +.\"O has it unblocked or is waiting for it in +.\"O .BR sigwait (3), +.\"O at least one +.\"O unblocked signal must be delivered to the sending thread before the +.\"O .BR kill () +.\"O returns. +POSIX.1-2001 ¤Ç¤Ï°Ê²¼¤ÎÆ°ºî¤Ë¤Ê¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +¼«Ê¬¼«¿È¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¤È¡¢¥·¥°¥Ê¥ë¤òÁ÷¤Ã¤¿¥¹¥ì¥Ã¥É¤¬¤½¤Î¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯ +¤·¤Æ¤ª¤é¤º¡¢Â¾¤Î¤É¤Î¥¹¥ì¥Ã¥É¤â¤½¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±¤ë¾õÂ֤ˤâ¤Ê¤¯ +.BR sigwait (3) +¤Ç¤½¤Î¥·¥°¥Ê¥ë¤òÂԤäƤ⤤¤Ê¤¤¾ì¹ç¡¢ +.BR kill () +¤¬ÊÖ¤ëÁ°¤Ë¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤ +¥·¥°¥Ê¥ë¤¬¥·¥°¥Ê¥ë¤òÁ÷¤Ã¤¿¥¹¥ì¥Ã¥É¤ËÇÛÁ÷¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SS "Linux Notes" +.SS "Linux ¤Ç¤ÎÃí°Õ" +.\"O Across different kernel versions, Linux has enforced different rules +.\"O for the permissions required for an unprivileged process +.\"O to send a signal to another process. +.\"O .\" In the 0.* kernels things chopped and changed quite +.\"O .\" a bit - MTK, 24 Jul 02 +.\"O In kernels 1.0 to 1.2.2, a signal could be sent if the +.\"O effective user ID of the sender matched that of the receiver, +.\"O or the real user ID of the sender matched that of the receiver. +.\"O From kernel 1.2.3 until 1.3.77, a signal could be sent if the +.\"O effective user ID of the sender matched either the real or effective +.\"O user ID of the receiver. +.\"O The current rules, which conform to POSIX.1-2001, were adopted +.\"O in kernel 1.3.78. +Linux ¤Ç¤Ï¡¢Æø¢¤Î¤Ê¤¤¥×¥í¥»¥¹¤¬Â¾¤Î¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ë¤¿¤á¤Ë +ɬÍפʸ¢¸Â¤Ë¤Ä¤¤¤Æ¤Î¥ë¡¼¥ë¤¬¡¢¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê°ã¤Ã¤Æ¤¤¤ë¡£ +.\" 0.* ¥«¡¼¥Í¥ë¤ÎÏäϳ䰦¤·¡¢Â¿¾¯Êѹ¹¤·¤¿¡£- MTK, 24 Jul 02 +¥«¡¼¥Í¥ë 1.0 ¤«¤é 1.2.2 ¤Ç¤Ï¡¢Á÷¿®Â¦¤Î¼Â¸ú¥æ¡¼¥¶¡¼ID ¤¬¼õ¿®Â¦¤Î +¼Â¸ú¥æ¡¼¥¶¡¼ ID¤È°ìÃפ¹¤ì¤Ð¥·¥°¥Ê¥ë¤òÁ÷¿®¤Ç¤­¤¿¡£ +¥«¡¼¥Í¥ë 1.2.3 ¤«¤é 1.3.77¤Ç¤Ï¡¢Á÷¿®Â¦¤Î¼Â¸ú¥æ¡¼¥¶¡¼ID ¤¬¼õ¿®Â¦¤Î +¼Â¥æ¡¼¥¶¡¼ID ¤«¼Â¸ú¥æ¡¼¥¶¡¼ID ¤Î¤¤¤º¤ì¤«¤È°ìÃפ¹¤ì¤Ð¥·¥°¥Ê¥ë¤òÁ÷¿®¤Ç¤­¤¿¡£ +¸½ºß¤Î¥ë¡¼¥ë¤Ï¡¢POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤ª¤ê¡¢¥«¡¼¥Í¥ë 1.3.78 °Ê¹ß¤Ç +ŬÍѤµ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O In 2.6 kernels up to and including 2.6.7, +.\"O there was a bug that meant that when sending signals to a process group, +.\"O .BR kill () +.\"O failed with the error +.\"O .B EPERM +.\"O if the caller did have permission to send the signal to \fIany\fP (rather +.\"O than \fIall\fP) of the members of the process group. +.\"O Notwithstanding this error return, the signal was still delivered +.\"O to all of the processes for which the caller had permission to signal. +¥Ð¡¼¥¸¥ç¥ó 2.6.7 °ÊÁ°¤Î 2.6 ·Ï¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¡¢ +¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤Ã¤¿¤È¤­¤Ë¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î (Á´¥á¥ó¥Ð¡¼¤Ç¤Ï¤Ê¤¯) °ìÉô¤Î¥á¥ó¥Ð¡¼ +¤ËÂФ·¤Æ¤Î¤ß¥·¥°¥Ê¥ë¤òÁ÷¤ëµö²Ä¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +.BR kill () +¤¬¥¨¥é¡¼ +.B EPERM +¤Ç¼ºÇÔ¤¹¤ë¤È¤¤¤¦¥Ð¥°¤¬¤¢¤ë¡£ +¤³¤Î¥¨¥é¡¼¤¬ÊÖ¤ë¤Ë¤â¤«¤«¤ï¤é¤º¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï¸Æ¤Ó½Ð¤·¸µ¤¬ +¥·¥°¥Ê¥ë¤òÁ÷¤ëµö²Ä¤ò»ý¤ÄÁ´¤Æ¤Î¥×¥í¥»¥¹¤ØÁ÷¤é¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR _exit (2), +.BR killpg (2), +.BR signal (2), +.BR sigqueue (2), +.BR tkill (2), +.BR exit (3), +.BR credentials (7), +.BR capabilities (7), +.BR signal (7) diff --git a/draft/man2/killpg.2 b/draft/man2/killpg.2 new file mode 100644 index 00000000..32cb6028 --- /dev/null +++ b/draft/man2/killpg.2 @@ -0,0 +1,218 @@ +.\" Copyright (c) 1980, 1991 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. +.\" +.\" @(#)killpg.2 6.5 (Berkeley) 3/10/91 +.\" +.\" Modified Fri Jul 23 21:55:01 1993 by Rik Faith +.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" Modified 2004-06-16 by Michael Kerrisk +.\" Added notes on CAP_KILL +.\" Modified 2004-06-21 by aeb +.\" +.\" Japanese Version Copyright (c) 1997 Kazuyuki Tanisako +.\" all rights reserved. +.\" Translated Sat May 17 14:10:42 JST 1997 +.\" by Kazuyuki Tanisako +.\" Updated & Modified Sat Feb 5 21:24:32 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: process group ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: super-user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\" +.TH KILLPG 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O killpg \- send signal to a process group +killpg \- ¥·¥°¥Ê¥ë¤ò¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÁ÷¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int killpg(int " pgrp ", int " sig ); +.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 killpg (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR killpg () +.\"O sends the signal +.\"O .I sig +.\"O to the process group +.\"O .IR pgrp . +.BR killpg () +¤Ï +.I sig +¤Ç»ØÄꤷ¤¿¥·¥°¥Ê¥ë¤ò +.I pgrp +¤Ç»ØÄꤷ¤¿¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÁ÷¤ë¡£ +¥·¥°¥Ê¥ë¤ÎÄêµÁ¤Î°ìÍ÷¤Ï +.\"O See +.\"O .BR signal (7) +.\"O for a list of signals. +.BR signal (7) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"O If +.\"O .I pgrp +.\"O is 0, +.\"O .BR killpg () +.\"O sends the signal to the sending process's process group. +.\"O sends the signal to the calling process's process group. +°ú¤­¿ô +.I pgrp +¤Ë 0 ¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï +.BR killpg () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬Â°¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÂФ·¤Æ¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.\"O (POSIX says: If +.\"O .I pgrp +.\"O is less than or equal to 1, the behavior is undefined.) +(POSIX ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë: +.I pgrp +¤¬ 1 °Ê²¼¤Ç¤¢¤ë¾ì¹ç¡¢Æ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£) + +.\"O For a process to have permission to send a signal +.\"O it must either be privileged (under Linux: have the +.\"O .B CAP_KILL +.\"O capability), or the real or effective +.\"O user ID of the sending process must equal the real or +.\"O saved set-user-ID of the target process. +¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ëµö²Ä¤ò»ý¤Ä¤¿¤á¤Ë¤Ï¡¢ +¥×¥í¥»¥¹¤¬Æø¢ (Linux ¤Ç¤Ï +.B CAP_KILL +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability)) ¤ò»ý¤Ä¤«¡¢ +Á÷¿®¸µ¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤Þ¤¿¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ +Á÷¿®Àè¥×¥í¥»¥¹¤Î¼Â set-user-ID ¤Þ¤¿¤ÏÊݸ set-user-ID ¤È +Åù¤·¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O In the case of +.\"O .B SIGCONT +.\"O it suffices when the sending and receiving +.\"O processes belong to the same session. +.B SIGCONT +¤Î¾ì¹ç¡¢Á÷¿®¥×¥í¥»¥¹¤È¼õ¿®¥×¥í¥»¥¹¤¬ +Ʊ¤¸¥»¥Ã¥·¥ç¥ó¤Ë°¤·¤Æ¤¤¤ì¤Ð½½Ê¬¤Ç¤¢¤ë¡£ +.\"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 EINVAL +.\"O .I Sig +.\"O is not a valid signal number. +.I sig +¤Ç»ØÄꤵ¤ì¤¿ÃͤÏ̵¸ú¤Ê¥·¥°¥Ê¥ëÈÖ¹æ¤Ç¤¢¤ë¡£ +.TP +.B EPERM +.\"O The process does not have permission to send the signal +.\"O to any of the target processes. +¥×¥í¥»¥¹¤Ë²¿¤ì¤«¤ÎÁ÷¿®Àè¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ëµö²Ä¤¬¤Ê¤¤¡£ +.TP +.B ESRCH +.\"O No process can be found in the process group specified by +.\"O .IR pgrp . +.I pgrp +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Ë°¤¹¤ë¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¡£ +.TP +.B ESRCH +.\"O The process group was given as 0 but the sending process does not +.\"O have a process group. +¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤È¤·¤Æ 0 ¤¬»ØÄꤵ¤ì¤¿¤¬¡¢Á÷¿®¥×¥í¥»¥¹¤Ï +¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O SVr4, 4.4BSD (the +.\"O .BR killpg () +.\"O function call first appeared in 4BSD), POSIX.1-2001. +SVr4, 4.4BSD +.RB ( killpg () +¤Ï 4BSD ¤Ç½é¤á¤ÆÄɲ䵤줿), POSIX.1-2001¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O There are various differences between the permission checking +.\"O in BSD-type systems and System V-type systems. +.\"O See the POSIX rationale for +.\"O .BR kill (). +.\"O A difference not mentioned by POSIX concerns the return +.\"O value +.\"O .BR EPERM : +.\"O BSD documents that no signal is sent and +.\"O .B EPERM +.\"O returned when the permission check failed for at least one target process, +.\"O while POSIX documents +.\"O .B EPERM +.\"O only when the permission check failed for all target processes. +BSD ·Ï¥·¥¹¥Æ¥à¤È System V ·Ï¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +µö²Ä¤Î¥Á¥§¥Ã¥¯¤ËÍÍ¡¹¤Ê°ã¤¤¤¬¤¢¤ë¡£ +.BR kill (2) +¤Ë¤Ä¤¤¤Æ¤Î POSIX ¤Î¸¶Íý (rationale) ¤ò»²¾È¤¹¤ë¤³¤È¡£ +POSIX ¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤°ã¤¤¤È¤·¤Æ¤Ï¡¢ÊÖ¤êÃÍ +.B EPERM +¤¬¤¢¤ë¡£ +BSD ¤Ç¤Ï¡ÖÁ÷¿®Àè¥×¥í¥»¥¹¤Îµö²Ä¤Î¥Á¥§¥Ã¥¯¤¬ 1 ¤Ä¤Ç¤â¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢ +¥·¥°¥Ê¥ë¤¬Á÷¿®¤µ¤ì¤º¡¢ +.B EPERM +¤¬ÊÖ¤µ¤ì¤ë¡×¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +POSIX ¤Ç¤Ï¡ÖÁ÷¿®Àè¥×¥í¥»¥¹¤Îµö²Ä¤Î¥Á¥§¥Ã¥¯¤¬Á´¤Æ¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Î¤ß¡¢ +.B EPERM +¤¬ÊÖ¤µ¤ì¤ë¡×¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"O On Linux, +.\"O .BR killpg () +.\"O is implemented as a library function that makes the call +.\"O .IR "kill(-pgrp,\ sig)" . +Linux ¤Ç¤Ï¡¢ +.BR killpg () +¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢ +.I "kill(-pgrp,\ sig)" +¤Î¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getpgrp (2), +.BR kill (2), +.BR signal (2), +.BR credentials (7), +.BR capabilities (7) diff --git a/draft/man2/link.2 b/draft/man2/link.2 new file mode 100644 index 00000000..e1d4a91a --- /dev/null +++ b/draft/man2/link.2 @@ -0,0 +1,319 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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-23 by Rik Faith +.\" Modified 1994-08-21 by Michael Haardt +.\" Modified 2004-06-23 by Michael Kerrisk +.\" Modified 2005-04-04, as per suggestion by Michael Hardt for rename.2 +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Thu Dec 11 23:47:55 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Tue Feb 8 06:36:08 JST 2005 +.\" by Yuichi SATO +.\" Updated & Modified Fri Apr 22 02:05:00 JST 2005 by Yuichi SATO +.\" Updated 2008-09-07, Akihiro MOTOKI , LDP v3.08 +.\" +.\"WORD: link ¥ê¥ó¥¯ +.\"WORD: hard link ¥Ï¡¼¥É¡¦¥ê¥ó¥¯ +.\"WORD: overwrite ¾å½ñ¤­ +.\"WORD: permission µö²Ä(permission) +.\"WORD: ownership ½êÍ­¼Ô(ownership) +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: effective uid ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: dangling symbolic link ²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: directory entry ¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê +.\" +.TH LINK 2 2008-08-21 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O link \- make a new name for a file +link \- ¥Õ¥¡¥¤¥ë¤Î¿·¤·¤¤Ì¾Á°¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int link(const char *" oldpath ", const char *" newpath ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR link () +.\"O creates a new link (also known as a hard link) to an existing file. +.BR link () +¤Ï¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¤Ø¤Î¿·¤·¤¤¥ê¥ó¥¯ (link) +(¥Ï¡¼¥É¡¦¥ê¥ó¥¯ (hard link) ¤È¤â¤¤¤¦) ¤òºîÀ®¤¹¤ë¡£ + +.\"O If +.\"O .I newpath +.\"O exists it will +.\"O .I not +.\"O be overwritten. +.I newpath +¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¾å½ñ¤­¤Ï\fI¤µ¤ì¤Ê¤¤\fR¡£ + +.\"O This new name may be used exactly as the old one for any operation; +.\"O both names refer to the same file (and so have the same permissions +.\"O and ownership) and it is impossible to tell which name was the +.\"O original. +¤³¤Î¿·¤·¤¤Ì¾Á°¤ÏÁ´¤Æ¤ÎÁàºî¤Ë¤ª¤¤¤Æ¸Å¤¤Ì¾Á°¤È´°Á´¤ËƱ¤¸¤è¤¦¤Ë»ÈÍѤµ¤ì¤ë; +ξÊý¤Î̾Á°¤ÏƱ¤¸¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤ª¤ê +(¤½¤ì¤ÇƱ¤¸µö²Ä (permission) ¤ä½êÍ­¼Ô (ownership) ¤È¤Ê¤ë¤Î¤Ç)¡¢ +¤É¤Á¤é¤Î̾Á°¤¬ËÜÍè¤Î¤â¤Î¤Ç¤¢¤ë¤«È½Ê̤Ǥ­¤Ê¤¤¡£ +.\"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 EACCES +.\"O Write access to the directory containing +.\"O .I newpath +.\"O is denied, or search permission is denied for one of the directories +.\"O in the path prefix of +.\"O .I oldpath +.\"O or +.\"O .IR newpath . +.\"O (See also +.\"O .BR path_resolution (7).) +.I newpath +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î½ñ¤­¹þ¤ß¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +.I oldpath +¤Þ¤¿¤Ï +.I newpath +¤Ø¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä¤¬¤Ê¤¤ +.RB ( path_resolution (7) +¤ò»²¾È)¡£ +.TP +.B EEXIST +.\"O .I newpath +.\"O already exists. +.I newpath +¤¬´û¤Ë¸ºß¤¹¤ë¡£ +.TP +.B EFAULT +.\"O .IR oldpath " or " newpath " points outside your accessible address space." +.IR oldpath " ¤Þ¤¿¤Ï " newpath " +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EIO +.\"O An I/O error occurred. +I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ELOOP +.\"O Too many symbolic links were encountered in resolving +.\"O .IR oldpath " or " newpath . +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B EMLINK +.\"O The file referred to by +.\"O .I oldpath +.\"O already has the maximum number of links to it. +.I oldpath +¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ï +´û¤ËºÇÂç¿ô¤Þ¤Ç¤Î¥ê¥ó¥¯¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +.TP +.B ENAMETOOLONG +.\"O .IR oldpath " or " newpath " was too long." +.IR oldpath " ¤Þ¤¿¤Ï " newpath " +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +.\"O A directory component in +.\"O .IR oldpath " or " newpath +.\"O does not exist or is a dangling symbolic link. +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢ +²õ¤ì¤¿(dangling)¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +.\"O Insufficient kernel memory was available. +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOSPC +.\"O The device containing the file has no room for the new directory +.\"O entry. +¤½¤Î¥Õ¥¡¥¤¥ë¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥Ð¥¤¥¹¤Ë¿·¤·¤¤¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤ò +ºîÀ®¤¹¤ë¤¿¤á¤Î¶õ¤­¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O A component used as a directory in +.\"O .IR oldpath " or " newpath +.\"O is not, in fact, a directory. +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¡¢¼ÂºÝ¤Ë¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EPERM +.\"O .I oldpath +.\"O is a directory. +.I oldpath +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¡£ +.TP +.B EPERM +.\"O The file system containing +.\"O .IR oldpath " and " newpath +.\"O does not support the creation of hard links. +.IR oldpath " ¤È " newpath +¤ò´Þ¤ó¤Ç¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬¥Ï¡¼¥É¡¦¥ê¥ó¥¯¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EROFS +.\"O The file is on a read-only file system. +¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +.TP +.B EXDEV +.\"O .IR oldpath " and " newpath +.\"O are not on the same mounted file system. +.IR oldpath " ¤È " newpath +¤¬Æ±¤¸¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£ +.\"O (Linux permits a file system to be mounted at multiple points, but +.\"O .BR link () +.\"O does not work across different mount points, +.\"O even if the same file system is mounted on both.) +(Linux ¤Ï 1 ¤Ä¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤òÊ£¿ô¤Î¥Þ¥¦¥ó¥È°ÌÃÖ¤Ë +¥Þ¥¦¥ó¥È¤¹¤ë¤³¤È¤òµö²Ä¤·¤Æ¤¤¤ë¡£ +¤·¤«¤· +.BR link () +¤Ï¡¢¤¿¤È¤¨Æ±¤¸¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤¢¤Ã¤Æ¤â¡¢ +ÊÌ¡¹¤Î¥Þ¥¦¥ó¥È°ÌÃÖ¤ò¸Ù¤¤¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¡£) +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O SVr4, 4.3BSD, POSIX.1-2001 (but see NOTES) +.\"O .\" SVr4 documents additional ENOLINK and +.\"O .\" EMULTIHOP error conditions; POSIX.1 does not document ELOOP. +.\"O .\" X/OPEN does not document EFAULT, ENOMEM or EIO. +SVr4, 4.3BSD, POSIX.1-2001 (⤷¡ÖÃí°Õ¡×¤ò»²¾È)¡£ +.\" SVr4 ¤Ï¾¤Ë ENOLINK, EMULTIHOP ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤âµ­½Ò¤·¤Æ¤¤¤ë¡£ +.\" POSIX.1 ¤Ë¤Ï ELOOP ¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£ +.\" X/OPEN ¤Ë¤Ï EFAULT, ENOMEM, EIO ¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Hard links, as created by +.\"O .BR link (), +.\"O cannot span file systems. +.\"O Use +.\"O .BR symlink (2) +.\"O if this is required. +.BR link () +¤Ç¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤òĶ¤¨¤Æ¥Ï¡¼¥É¡¦¥ê¥ó¥¯¤òºîÀ®¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ï +.BR symlink (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ + +.\"O POSIX.1-2001 says that +.\"O .BR link () +.\"O should dereference +.\"O .I oldpath +.\"O if it is a symbolic link. +POSIX.1-2001 ¤Ç¤Ï¡¢ +.I oldpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¡¢ +.BR link () +¤Ï +.I oldpath +¤Î»²¾È¤ò²ò·è¤¹¤Ù¤­¤Ç¤¢¤ë¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O However, since kernel 2.0, +.\"O .\" more precisely: since kernel 1.3.56 +.\"O Linux does not do so: if +.\"O .I oldpath +.\"O is a symbolic link, then +.\"O .I newpath +.\"O is created as a (hard) link to the same symbolic link file +¤·¤«¤·¡¢¥«¡¼¥Í¥ë 2.0 °Ê¹ß¤Î +.\" Àµ³Î¤Ë¤Ï¥«¡¼¥Í¥ë 1.3.56 °Ê¹ß +Linux ¤Ç¤Ï¤½¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¡£ +.I oldpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¡¢ +.I newpath +¤ÏƱ¤¸¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¥Õ¥¡¥¤¥ë¤Ø¤Î (¥Ï¡¼¥É) ¥ê¥ó¥¯¤È¤·¤ÆºîÀ®¤µ¤ì¤ë +.\"O (i.e., +.\"O .I newpath +.\"O becomes a symbolic link to the same file that +.\"O .I oldpath +.\"O refers to). +(¤Ä¤Þ¤ê +.I newpath +¤Ï +.I oldpath +¤¬»²¾È¤·¤Æ¤¤¤¿Æ±¤¸¥Õ¥¡¥¤¥ë¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤Ê¤ë)¡£ +.\"O Some other implementations behave in the same manner as Linux. +¾¤Î¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤Ç¤â Linux ¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ +.\"O .\" For example, the default Solaris compilation environment +.\"O .\" behaves like Linux, and contributors to a March 2005 +.\"O .\" thread in the Austin mailing list reported that some +.\"O .\" other (System V) implementations did/do the same -- MTK, Apr 05 +.\" Î㤨¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤Î Solaris ¤Î¥³¥ó¥Ñ¥¤¥ë´Ä¶­¤Ç¤Ï +.\" Linux ¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£¤½¤·¤Æ Austin ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Î +.\" 2005 ǯ 3 ·î¤Î¥¹¥ì¥Ã¥É¤ËÅê¹Æ¤·¤¿¿Í¤¿¤Á¤Ï¡¢ +.\" ¤½¤Î¾¤Î¤¤¤¯¤Ä¤«¤Î (System V) ¼ÂÁõ¤Ç¤âƱ¤¸¤Ç¤¢¤Ã¤¿/¤¢¤ë¡¢ +.\" ¤ÈÊó¹ð¤·¤Æ¤¤¤ë -- MTK, Apr 05 +.\"O POSIX.1-2008 changes the specification of +.\"O .BR link (), +.\"O making it implementation-dependent whether or not +.\"O .I oldpath +.\"O is dereferenced if it is a symbolic link. +.\"O For precise control over the treatment of symbolic links when +.\"O creating a link, see +.\"O .BR linkat (2). +POSIX.1-2008 ¤Ç¤Ï +.BR link () +¤Î»ÅÍͤ¬Êѹ¹¤µ¤ì¡¢ +.I oldpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î»²¾È¤ò +²ò·è¤¹¤ë¤«¤É¤¦¤«¤Ï¼ÂÁõ°Í¸¤È¤Ê¤Ã¤¿¡£ +¥ê¥ó¥¯ºîÀ®»þ¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î°·¤¤¤Ë¤Ä¤¤¤Æ¤Î¾ÜºÙ¤ÊÀ©¸æ¤Ë +´Ø¤·¤Æ¤Ï +.BR linkat (2) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O On NFS file systems, the return code may be wrong in case the NFS server +.\"O performs the link creation and dies before it can say so. +.\"O Use +.\"O .BR stat (2) +.\"O to find out if the link got created. +NFS ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤Ï¡¢NFS ¥µ¡¼¥Ð¡¼¤¬¥ê¥ó¥¯¤òºîÀ®¤·¤¿¸å¤Ë¡¢ +¤½¤ì¤òÅÁ¤¨¤ëÁ°¤Ë»à¤ó¤À¾ì¹ç¤Ë¤ÏÊÖ¤êÃͤ¬ÉÔÀµ¤Ê¾ì¹ç¤¬¤¢¤ë¡£ +¥ê¥ó¥¯¤¬ºîÀ®¤Ç¤­¤¿¤«¤É¤¦¤«¸«¤Ä¤±¤ë¤¿¤á¤Ë¤Ï +.BR stat (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ln (1), +.BR linkat (2), +.BR open (2), +.BR rename (2), +.BR stat (2), +.BR symlink (2), +.BR unlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/draft/man2/linkat.2 b/draft/man2/linkat.2 new file mode 100644 index 00000000..ed3bd79c --- /dev/null +++ b/draft/man2/linkat.2 @@ -0,0 +1,258 @@ +.\" 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-09-30 by Yuichi SATO , LDP v2.39 +.\" +.TH LINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O linkat \- create a file link relative to directory file descriptors +linkat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤˥ե¡¥¤¥ë¥ê¥ó¥¯¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.\"O .B #include /* Definition of AT_* constants */ +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int linkat(int " olddirfd ", const char *" oldpath , +.BI " int " newdirfd ", const char *" newpath ", 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 linkat (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.\"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) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.\"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) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.\"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) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I oldpath +.\"O is absolute, then +.\"O .I olddirfd +.\"O is ignored. +.I oldpath +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I olddirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"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 +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.\"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" +.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 +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR linkat () +.\"O was added to Linux in kernel 2.6.16. +.BR linkat () +¤Ï 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 linkat (). +.BR linkat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR link (2), +.BR openat (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/draft/man2/listen.2 b/draft/man2/listen.2 new file mode 100644 index 00000000..7aca4a54 --- /dev/null +++ b/draft/man2/listen.2 @@ -0,0 +1,284 @@ +.\" Copyright (c) 1983, 1991 The Regents of the University of California. +.\" and Copyright (C) 2007, Michael Kerrisk +.\" 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. +.\" +.\" $Id: listen.2,v 1.4 2001/05/19 02:09:20 hanataka Exp $ +.\" +.\" Modified Fri Jul 23 22:07:54 1993 by Rik Faith +.\" Modified 950727 by aeb, following a suggestion by Urs Thuermann +.\" +.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" 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 +.SH ̾Á° +.\"O listen \- listen for connections on a socket +listen \- ¥½¥±¥Ã¥È(socket)¾å¤ÎÀܳ¤òÂÔ¤Ä +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.\"O .BR "#include " " /* See NOTES */" +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.br +.B #include +.sp +.BI "int listen(int " sockfd ", int " backlog ); +.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) +¤ò»È¤Ã¤ÆÅþÃ夷¤¿ÀܳÍ×µá¤ò¼õ¤±ÉÕ¤±¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£ + +.\"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 +·¿¤Î¥½¥±¥Ã¥È¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ + +.\"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" +.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 .TP +.\"O .B EADDRINUSE +.\"O Another socket is already listening on the same port. +.TP +.B EADDRINUSE +Ê̤Υ½¥±¥Ã¥È¤¬´û¤ËƱ¤¸¥Ý¡¼¥È¤ò 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" +.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 +.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) +¤Ç¥½¥±¥Ã¥È¤òºîÀ®¤¹¤ë¡£ +.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) +¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +.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 () +¤ò»È¤Ã¤Æ¡¢ÀܳÍ×µá¤ò¼õ¤±ÉÕ¤±¤ë°Õ»Ö¤ÈÀܳÍ×µá¤òÆþ¤ì¤ë¥­¥å¡¼Ä¹¤ò»ØÄꤹ¤ë¡£ +.IP 4. +.\"O Connections are accepted with +.\"O .BR accept (2). +.BR accept (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 ·Ï) ¤Ç¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬ +ɬÍפǤ¢¤ê¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò +¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬¸­ÌÀ¤Ç¤¢¤í¤¦¡£ + +.\"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 ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +ÏÀÍýŪ¤ÊºÇÂçĹ¤Ï¸ºß¤»¤º¡¢¤³¤ÎÀßÄê¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"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 +.SH Îã +.\"O See +.\"O .BR bind (2). +.BR bind (2) +»²¾È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR accept (2), +.BR bind (2), +.BR connect (2), +.BR socket (2), +.BR socket (7) diff --git a/draft/man2/listxattr.2 b/draft/man2/listxattr.2 new file mode 100644 index 00000000..fde95d1a --- /dev/null +++ b/draft/man2/listxattr.2 @@ -0,0 +1,267 @@ +.\" +.\" Extended attributes system calls manual pages +.\" +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" 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) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 04:17:12 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: extended attributes ³Èĥ°À­ +.\"WORD: namespace ̾Á°¶õ´Ö +.\" +.TH LISTXATTR 2 2001-12-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O listxattr, llistxattr, flistxattr \- list extended attribute names +.SH ̾Á° +listxattr, llistxattr, flistxattr \- ³Èĥ°À­¤Î̾Á°¥ê¥¹¥È¤òÆÀ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.fam C +.nf +.B #include +.B #include +.sp +.BI "ssize_t listxattr(const char\ *" path ", char\ *" list \ +", size_t " size ); +.BI "ssize_t llistxattr(const char\ *" path ", char\ *" list \ +", size_t " size ); +.BI "ssize_t flistxattr(int " fd ", char\ *" list ", size_t " size ); +.fi +.fam T +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Extended attributes are name:value +.\"O pairs associated with inodes (files, directories, symbolic links, etc.). +.\"O They are extensions to the normal attributes which are associated +.\"O with all inodes in the system (i.e., the +.\"O .BR stat (2) +.\"O data). +.\"O A complete overview of extended attributes concepts can be found in +.\"O .BR attr (5). +³Èĥ°À­¤Ï¡¢inode (¥Õ¥¡¥¤¥ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯Åù) ¤Ë +´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +.IR name :\c +.I value +¤ÎÂФǤ¢¤ë¡£ +¤³¤ì¤é¤Ï¡¢¥·¥¹¥Æ¥à¾å¤Î¤¹¤Ù¤Æ¤Î inode ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ä̾ï¤Î°À­ +.RB ( stat (2) +¤¬ÊÖ¤¹¥Ç¡¼¥¿) ¤ò³ÈÄ¥¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +³Èĥ°À­¤Î¥³¥ó¥»¥×¥È¤Ï +.BR attr (5) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O .BR listxattr () +.\"O retrieves the +.\"O .I list +.\"O of extended attribute names associated with the given +.\"O .I path +.\"O in the file system. +.\"O The list is the set of (null-terminated) names, one after the other. +.\"O Names of extended attributes to which the calling process does not +.\"O have access may be omitted from the list. +.\"O The length of the attribute name +.\"O .I list +.\"O is returned. +.BR listxattr () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î»ØÄꤵ¤ì¤¿ +.I path +¤ËÂбþ¤¹¤ë³Èĥ°À­¤Î̾Á°¥ê¥¹¥È¤ò¼èÆÀ¤¹¤ë¡£ +¥ê¥¹¥È¤Ï̾Á°¤Î½¸¹ç¤Ç¡¢ NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤¬Ï¢Â³¤·¤Æʤó¤Ç¤¤¤ë¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤Î¤Ê¤¤³Èĥ°À­¤Î̾Á°¤Ï¡¢ +¥ê¥¹¥È¤Ë´Þ¤Þ¤ì¤Ê¤¤¡£³Èĥ°À­¤Î̾Á°¤Î +.I list +¤ÎŤµ¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O .BR llistxattr () +.\"O is identical to +.\"O .BR listxattr (), +.\"O except in the case of a symbolic link, where the list of names of +.\"O extended attributes associated with the link itself is retrieved, +.\"O not the file that it refers to. +.BR llistxattr () +¤Ï +.BR listxattr () +¤ÈƱ¤¸¤À¤¬¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¡¢¥ê¥ó¥¯¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë +¤Ç¤Ï¤Ê¤¯¡¢¥ê¥ó¥¯¤½¤Î¤â¤Î¤Î³Èĥ°À­¤Î̾Á°¥ê¥¹¥È¤ò¼èÆÀ¤¹¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +.PP +.\"O .BR flistxattr () +.\"O is identical to +.\"O .BR listxattr (), +.\"O only the open file referred to by +.\"O .I fd +.\"O (as returned by +.\"O .BR open (2)) +.\"O is interrogated in place of +.\"O .IR path . +.BR flistxattr () +¤Ï +.BR listxattr () +¤ÈƱ¤¸¤À¤¬¡¢ +.I path +¤ÎÂå¤ï¤ê¤Ë +.I fd +¤Ç»²¾È¤µ¤ì¤¿¥ª¡¼¥×¥óºÑ¤ß¥Õ¥¡¥¤¥ë¤Î¾ðÊó¤À¤±¤ò¼èÆÀ¤¹¤ëÅÀ¤¬°Û¤Ê¤ë +.RI ( filedes +¤Ï +.BR open (2) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë)¡£ +.PP +.\"O A single extended attribute +.\"O .I name +.\"O is a simple null-terminated string. +.\"O The name includes a namespace prefix; there may be several, disjoint +.\"O namespaces associated with an individual inode. +¸Ä¡¹¤Î³Èĥ°À­¤Î +.I name +¤ÏÉáÄ̤ΠNULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +̾Á°¤Ë¤Ï¡¢Ì¾Á°¶õ´Ö¤òɽ¤¹ÀÜƬ¼­ (prefix) ¤¬´Þ¤Þ¤ì¤ë; +¸Ä¡¹¤Î inode ¤ËÂФ·¤Æ¡¢¸ß¤¤¤ËÆÈΩ¤Ê̾Á°¶õ´Ö¤¬Ê£¿ô¤¢¤Ã¤Æ¤â¤è¤¤¡£ +.PP +.\"O An empty buffer of +.\"O .I size +.\"O zero can be passed into these calls to return the current size of the +.\"O list of extended attribute names, which can be used to estimate the +.\"O size of a buffer which is sufficiently large to hold the list of names. +.I size +¤Ë 0 ¤ò»ØÄꤷ¤Æ¶õ¤Î¥Ð¥Ã¥Õ¥¡¤ò¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹¤³¤È¤¬¤Ç¤­¡¢ +¤³¤Î¾ì¹ç¤Ë¤Ï³Èĥ°À­¤Î̾Á°¥ê¥¹¥È¤Î¸½ºß¤Î¥µ¥¤¥º¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤ÎÊýË¡¤Ï̾Á°¥ê¥¹¥È¤òÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Î¥Ð¥Ã¥Õ¥¡¡¦¥µ¥¤¥º¤ò +¸«ÀѤâ¤ë¤Î¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡¢ +.\"O .SS Example +.SS Îã +.\"O The +.\"O .I list +.\"O of names is returned as an unordered array of null-terminated character +.\"O strings (attribute names are separated by null bytes (\(aq\\0\(aq)), like this: +ÊÖ¤µ¤ì¤ë̾Á°¤Î +.I list +¤Ï¡¢ NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤ÎÇÛÎó (°À­Ì¾¤Ï NULL ¥Ð¥¤¥È (\(aq\\0\(aq) +¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤ë) ¤Ç¡¢³ÆÍ×ÁǤÏÀ°Î󤵤ì¤Æ¤¤¤ëÌõ¤Ç¤Ï¤Ê¤¤¡£ +°Ê²¼¤ËÎã¤ò¼¨¤¹: +.fam C +.RS +.nf + +user.name1\\0system.name1\\0user.name2\\0 +.fi +.RE +.fam T +.P +.\"O Filesystems like ext2, ext3 and XFS which implement POSIX ACLs using +.\"O extended attributes, might return a +.\"O .I list +.\"O like this: +³Èĥ°À­¤ò»È¤Ã¤Æ POSIX ACL ¤ò¼ÂÁõ¤·¤Æ¤¤¤ë ext2¡¢ext3¡¢XFS ¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë +¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ÊÖ¤µ¤ì¤ë +.I list +¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¤³¤È¤À¤í¤¦: +.fam C +.RS +.nf + +system.posix_acl_access\\0system.posix_acl_default\\0 +.fi +.RE +.fam T +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, a positive number is returned indicating the size of the +.\"O extended attribute name list. +.\"O On failure, \-1 is returned and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤·¤¿¾ì¹ç¡¢³Èĥ°À­¤Î̾Á°¥ê¥¹¥È¤ÎŤµ¤òɽ¤¹Àµ¤Î¿ô¤¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O If the +.\"O .I size +.\"O of the +.\"O .I list +.\"O buffer is too small to hold the result, +.\"O .I errno +.\"O is set to +.\"O .BR ERANGE . +.I list +¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ +.I size +¤¬·ë²Ì¤òÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I errno +¤Ë +.B ERANGE +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O If extended attributes are not supported by the file system, or are disabled, +.\"O .I errno +.\"O is set to +.\"O .BR ENOTSUP . +³Èĥ°À­¤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¤â¤·¤¯¤Ï̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOTSUP +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O The errors documented for the +.\"O .BR stat (2) +.\"O system call are also applicable here. +.BR stat (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀâÌÀ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ï +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤âŬÍѤµ¤ì¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These system calls have been available on Linux since kernel 2.4; +.\"O glibc support is provided since version 2.3. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.4 °Ê¹ß¤Î Linux ¤ÇÍøÍѤǤ­¤ë¡£ +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3 °Ê¹ß¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These system calls are Linux-specific. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\"O .\" .SH AUTHORS +.\" .SH Ãø¼Ô +.\"O .\" Andreas Gruenbacher, +.\"O .\" .RI < a.gruenbacher@computer.org > +.\"O .\" and the SGI XFS development team, +.\"O .\" .RI < linux-xfs@oss.sgi.com >. +.\"O .\" Please send any bug reports or comments to these addresses. +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" ¤È the SGI XFS development team, +.\" .RI < linux-xfs@oss.sgi.com >¡£ +.\" ¥Ð¥°¥ì¥Ý¡¼¥È¤ä¥³¥á¥ó¥È¤Ï¾åµ­¤Î¥¢¥É¥ì¥¹¤Þ¤ÇÁ÷¤Ã¤Æ²¼¤µ¤¤¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR getfattr (1), +.BR setfattr (1), +.BR getxattr (2), +.BR open (2), +.BR removexattr (2), +.BR setxattr (2), +.BR stat (2), +.BR attr (5), +.BR symlink (7) diff --git a/draft/man2/llseek.2 b/draft/man2/llseek.2 new file mode 100644 index 00000000..009214c1 --- /dev/null +++ b/draft/man2/llseek.2 @@ -0,0 +1,142 @@ +.\" 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 10 June 1995 by Andries Brouwer +.\" Modified Thu Oct 31 15:16:23 1996 by Eric S. Raymond +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sun Feb 23 16:22:27 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Sat Jun 2 18:27:49 JST 2001 +.\" by Yuichi SATO +.\" Updated & Modified Sat Sep 6 17:05:03 JST 2003 +.\" by Yuichi SATO +.\" Updated & Modified Fri Dec 31 00:50:01 JST 2004 by Yuichi SATO +.\" +.\"WORD: offset ¥ª¥Õ¥»¥Ã¥È +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\"WORD: argument °ú¤­¿ô +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: support ¥µ¥Ý¡¼¥È +.\" +.TH LLSEEK 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O _llseek \- reposition read/write file offset +_llseek \- ¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¥ª¥Õ¥»¥Ã¥È¤Î°ÌÃÖ¤òÊѤ¨¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "int _llseek(unsigned int " fd ", unsigned long " offset_high , +.BI " unsigned long " offset_low ", loff_t *" result , +.BI " unsigned int " whence ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR _llseek () +.\"O function repositions the offset of the open file associated +.\"O with the file descriptor +.\"O .I fd +.\"O to +.\"O .I (offset_high<<32) | offset_low +.\"O bytes relative to the beginning of the file, the current position in the file, +.\"O or the end of the file, depending on whether +.\"O .I whence +.\"O is +.\"O .BR SEEK_SET , +.\"O .BR SEEK_CUR , +.\"O or +.\"O .BR SEEK_END , +.\"O respectively. +.\"O It returns the resulting file position in the argument +.\"O .IR result . +.BR _llseek () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ (descriptor) +.I fd +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥ª¥Õ¥»¥Ã¥È¤Î°ÌÃÖ¤ò¡¢ÁêÂÐŪ¤Ë +.I (offset_high<<32) | offset_low +¥Ð¥¤¥È¤À¤±Êѹ¹¤¹¤ë¡£ +´ð½à¤È¤Ê¤ë°ÌÃÖ¤òɽ¤¹ +.I whence +¤Ë¤Ï +.BR SEEK_SET , +.BR SEEK_CUR , +.B SEEK_END +¤Î¤¤¤º¤ì¤«¤ò»ØÄꤷ¡¢¤½¤ì¤¾¤ì +¥Õ¥¡¥¤¥ë¤ÎÀèƬ¡¢¥Õ¥¡¥¤¥ë¤Î¸½ºß°ÌÃÖ¡¢ +¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤òɽ¤¹¡£ +·ë²Ì¤Î¥Õ¥¡¥¤¥ë°ÌÃÖ¤ò +.I result +°ú¤­¿ô¤ËÊÖ¤¹¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O Upon successful completion, +.\"O .BR _llseek () +.\"O returns 0. +.\"O Otherwise, a value of \-1 is returned and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤·¤¿¾ì¹ç¤Ï¡¢ +.BR _llseek () +¤Ï 0 ¤òÊÖ¤¹¡£ +¤½¤¦¤Ç¤Ê¤ì¤Ð \-1 ¤È¤¤¤¦Ãͤ¬Ê֤ꡢ¥¨¥é¡¼¤ò¼¨¤¹ +.I errno +¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O .I fd +.\"O is not an open file descriptor. +.I fd +¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ê¤¤¡£ +.TP +.B EFAULT +.\"O Problem with copying results to user space. +·ë²Ì¤ò¥æ¡¼¥¶¶õ´Ö¤Ë¥³¥Ô¡¼¤¹¤ë¤È¤­¤ËÌäÂ꤬¤¢¤Ã¤¿¡£ +.TP +.B EINVAL +.\"O .I whence +.\"O is invalid. +.I whence +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is Linux-specific, and should not be used in programs +.\"O intended to be portable. +¤³¤Î´Ø¿ô¤Ï 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 .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR lseek (2), +.BR lseek64 (3) diff --git a/draft/man2/lookup_dcookie.2 b/draft/man2/lookup_dcookie.2 new file mode 100644 index 00000000..806f9a06 --- /dev/null +++ b/draft/man2/lookup_dcookie.2 @@ -0,0 +1,145 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2003 John Levon +.\" +.\" 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 2004-06-17 Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated, 2003-06-04, Akihiro MOTOKI +.\" Updated, 2003-09-30, Akihiro MOTOKI +.\" Updated, 2005-02-10, Akihiro MOTOKI +.\" +.\"WORD: opaque identifier ÆâÉô¼±ÊÌ»Ò +.\"WORD: Linux specific Linux Æȼ« +.\"WORD: capability ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\" +.TH LOOKUP_DCOOKIE 2 2004-06-17 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O lookup_dcookie \- return a directory entry's path +lookup_dcookie \- ¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤Î¥Ñ¥¹Ì¾¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.BI "int lookup_dcookie(u64 " cookie ", char *" buffer ", size_t " len ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Look up the full path of the directory entry specified by the value +.\"O .I cookie +.\"O . +.\"O The cookie is an opaque identifier uniquely identifying a particular +.\"O directory entry. +.\"O The buffer given is filled in with the full path of the directory entry. +.I cookie +ÃͤǻØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤Î¥Õ¥ë¥Ñ¥¹Ì¾¤ò¸¡º÷¤¹¤ë¡£ +cookie ¤Ï¡¢¸Ä¡¹¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤ò¶èÊ̤¹¤ëÆâÉô¼±ÊÌ»Ò (opaque +identifier) ¤Ç¤¢¤ë¡£°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤Î +¥Õ¥ë¥Ñ¥¹Ì¾¤¬³ÊǼ¤µ¤ì¤ë¡£ + +.\"O For +.\"O .BR lookup_dcookie () +.\"O to return successfully, +.\"O the kernel must still hold a cookie reference to the directory entry. +.BR lookup_dcookie () +¤¬Àµ¾ï¤ËÃͤòÊÖ¤¹¤¿¤á¤Ë¤Ï¡¢¥«¡¼¥Í¥ë¤¬¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤Ø¤Î cookie »²¾È¤ò +ÊÝ»ý¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR lookup_dcookie () +.\"O returns the length of the path string copied into the buffer. +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR lookup_dcookie () +¤Ï¥Ð¥Ã¥Õ¥¡¤Ë¥³¥Ô¡¼¤·¤¿¥Ñ¥¹Ê¸»úÎó¤ÎŤµ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O The buffer was not valid. +¥Ð¥Ã¥Õ¥¡¤¬Í­¸ú¤Ç¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINVAL +.\"O The kernel has no registered cookie/directory entry mappings at the +.\"O time of lookup, or the cookie does not refer to a valid directory entry. +¸¡º÷¤¬¹Ô¤ï¤ì¤¿»þ¡¢cookie ¤È¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤Î¥Þ¥Ã¥Ô¥ó¥°¤¬¥«¡¼¥Í¥ë¤Ë +ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤«¡¢¤Þ¤¿¤Ï cookie ¤¬Í­¸ú¤Ê¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤ò +»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENAMETOOLONG +.\"O The name could not fit in the buffer. +̾Á°¤¬¥Ð¥Ã¥Õ¥¡¤ËÆþ¤êÀÚ¤é¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O The kernel could not allocate memory for the temporary buffer holding +.\"O the path. +¥«¡¼¥Í¥ë¤¬¡¢¥Ñ¥¹Ì¾¤òÊÝ»ý¤¹¤ë°ì»þ¥Ð¥Ã¥Õ¥¡ÍѤΥá¥â¥ê¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬ +¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPERM +.\"O The process does not have the capability +.\"O .B CAP_SYS_ADMIN +.\"O required to look up cookie values. +¥×¥í¥»¥¹¤¬ cookie Ãͤò¸¡º÷¤¹¤ë¤Î¤ËɬÍפʥ±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.B CAP_SYS_ADMIN +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ERANGE +.\"O The buffer was not large enough to hold the path of the directory entry. +¥Ð¥Ã¥Õ¥¡¤¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤Î¥Ñ¥¹Ì¾¤ò¼ýÍƤ¹¤ë¤Î¤Ë +½½Ê¬¤ÊÂ礭¤µ¤Ç¤Ï¤Ê¤«¤Ã¤¿¡£ +.\"O .SH VERSIONS +.\"O Since Linux 2.5.43. +.\"O The +.\"O .B ENAMETOOLONG +.\"O error return was added in 2.5.70. +.SH ¥Ð¡¼¥¸¥ç¥ó +Linux 2.5.43 °Ê¹ß¤ÇÍøÍѤǤ­¤ë¡£ +¥¨¥é¡¼ +.B ENAMETOOLONG +¤òÊÖ¤¹»ÅÍÍ¤Ï 2.5.70 ¤ÇÄɲ䵤줿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR lookup_dcookie () +.\"O is Linux-specific. +.BR lookup_dcookie () +¤Ï Linux Æȼ«¤Î´Ø¿ô¤Ç¤¢¤ë¡£ +.\"O .SH "NOTES" +.SH Ãí°Õ +.\"O .BR lookup_dcookie () +.\"O is a special-purpose system call, currently used only by the oprofile profiler. +.\"O It relies on a kernel driver to register cookies for directory entries. +.BR lookup_dcookie () +¤ÏÆüì¤ÊÍÑÅӤ˻Ȥï¤ì¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢¸½ºß¤Î¤È¤³¤í oprofile profiler ¤Ç +»È¤ï¤ì¤Æ¤¤¤ë¤À¤±¤Ç¤¢¤ë¡£ + +.\"O The path returned may be suffixed by the string " (deleted)" if the directory +.\"O entry has been removed. +»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤¬ºï½ü¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢ÊÖ¤µ¤ì¤ë¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Ë +" (deleted)" +¤È¤¤¤¦Ê¸»úÎó¤¬Éղ䵤ì¤ë¤³¤È¤¬¤¢¤ë¡£ diff --git a/draft/man2/lseek.2 b/draft/man2/lseek.2 new file mode 100644 index 00000000..8dc131de --- /dev/null +++ b/draft/man2/lseek.2 @@ -0,0 +1,247 @@ +.\" Copyright (c) 1980, 1991 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. +.\" +.\" @(#)lseek.2 6.5 (Berkeley) 3/10/91 +.\" +.\" Modified Fri Jul 23 22:17:00 1993 by Rik Faith +.\" Modified 10 June 1995 by Andries Brouwer +.\" Modified Thu Oct 31 15:18:33 1996 by Eric S. Raymond +.\" Modified Sat Jan 17 13:00:32 MET 1998 by Michael Haardt +.\" +.\" Modified Mon Sep 24 16:18:02 CEST 2001 by Michael Haardt +.\" +.\" Japanese Version Copyright (c) 1997-1998 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Modified 1998-05-11, HANATAKA Shinya +.\" Updated 2001-12-14, Kentaro Shirakata +.\" Updated 2003-09-08, Kentaro Shirakata +.\" Updated 2005-02-24, Akihiro MOTOKI +.\" Updated 2006-03-05, Akihiro MOTOKI, catch up to LDP v2.25 +.\" +.\"WORD: end-of-file ¥Õ¥¡¥¤¥ë¤Î½ªÃ¼(end-of-file) +.\" +.TH LSEEK 2 2001-09-24 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +lseek \- ¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¥ª¥Õ¥»¥Ã¥È¤Î°ÌÃÖ¤òÊѤ¨¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "off_t lseek(int " fd ", off_t " offset ", int " whence ); +.SH ÀâÌÀ +.\"O The +.\"O .BR lseek () +.\"O function repositions the offset of the open file associated with the +.\"O file descriptor +.\"O .I fd +.\"O to the argument +.\"O .I offset +.\"O according to the directive +.\"O .I whence +.\"O as follows: +.BR lseek () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ (descriptor) +.I fd +¤ËÂбþ¤¹¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥ª¥Õ¥»¥Ã¥È¤ò¡¢ +.IR whence +¤Ë´ð¤Å¤­ +.I offset +°ú¤­¿ô¤Î°ÌÃ֤ذʲ¼¤Î¤è¤¦¤ËÊѹ¹¤¹¤ë: +.TP +.B SEEK_SET +.\"O The offset is set to +.\"O .I offset +.\"O bytes. +¥ª¥Õ¥»¥Ã¥È¤Ï +.I offset +¥Ð¥¤¥È¤ËÀßÄꤵ¤ì¤ë¡£ +.TP +.B SEEK_CUR +.\"O The offset is set to its current location plus +.\"O .I offset +.\"O bytes. +¥ª¥Õ¥»¥Ã¥È¤Ï¸½ºß°ÌÃÖ¤Ë +.I offset +¥Ð¥¤¥È¤ò­¤·¤¿°ÌÃ֤ˤʤ롣 +.TP +.B SEEK_END +.\"O The offset is set to the size of the file plus +.\"O .I offset +.\"O bytes. +¥ª¥Õ¥»¥Ã¥È¤Ï¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤Ë +.I offset +¥Ð¥¤¥È¤ò­¤·¤¿°ÌÃ֤ˤʤ롣 +.PP +.\"O The +.\"O .BR lseek () +.\"O function allows the file offset to be set beyond the end +.\"O of the file (but this does not change the size of the file). +.\"O If data is later written at this point, subsequent reads of the data +.\"O in the gap (a "hole") return null bytes (\(aq\\0\(aq) until +.\"O data is actually written into the gap. +.BR lseek () +´Ø¿ô¤Ï¡¢¥ª¥Õ¥»¥Ã¥È¤ò¥Õ¥¡¥¤¥ë¤ÎËöÈø¤ò±Û¤¨¤¿°ÌÃÖ¤ËÀßÄê¤Ç¤­¤ë +(⤷¡¢¤³¤ì¤Ë¤è¤ê¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤¬ÊѤï¤é¤Ê¤¤)¡£ +¤â¤·¥Ç¡¼¥¿¤¬¤³¤Î¥ª¥Õ¥»¥Ã¥È°ÌÃְʹߤ˽ñ¤­¹þ¤Þ¤ì¤¿¾ì¹ç¡¢ +´Ö¤Î¶õ·ä¤ÎÉôʬ ("·ê (hole)") ¤ÎÆɤ߽Ф·¤¬¤¢¤ë¤È¡¢ +¼ÂºÝ¤Ë¤½¤³¤Ë¥Ç¡¼¥¿¤ò½ñ¤­¹þ¤Þ¤ì¤ë¤Þ¤Ç¤Ï +NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤ÎÎó¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O Upon successful completion, +.\"O .BR lseek () +.\"O returns the resulting offset location as measured in bytes from the +.\"O beginning of the file. +.\"O Otherwise, a value of \fI(off_t)\ \-1\fP is returned and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR lseek () +¤Ï·ë²Ì¤Î¥Õ¥¡¥¤¥ë°ÌÃÖ¤ò¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤«¤é¤Î¥Ð¥¤¥È¿ô¤ÇÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ÃͤȤ·¤Æ \fI(off_t)\ \-1\fP ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤¬»Ø¼¨¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O .I fd +.\"O is not an open file descriptor. +.I fd +¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O .I whence +.\"O is not one of +.\"O .BR SEEK_SET , +.\"O .BR SEEK_CUR , +.\"O .BR SEEK_END ; +.\"O or the resulting file offset would be negative, +.\"O or beyond the end of a seekable device. +.\"O .\" Some systems may allow negative offsets for character devices +.\"O .\" and/or for remote file systems. +.I whence +¤¬ +.BR SEEK_SET , +.BR SEEK_CUR , +.B SEEK_END +¤Î¤É¤ì¤Ç¤â¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢seek ¤Î·ë²Ì¡¢¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤¬Éé¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¤«¡¢ +seek ²Äǽ¤Ê¥Ç¥Ð¥¤¥¹¤ÎËöÈø¤ò±Û¤¨¤Æ¤·¤Þ¤¦¡£ +.\" ¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹¤ä¥ê¥â¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ·¤Æ +.\" Éé¤Î¥ª¥Õ¥»¥Ã¥È¤¬µö¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.B EOVERFLOW +.\"O .\" HP-UX 11 says EINVAL for this case (but POSIX.1 says EOVERFLOW) +.\"O The resulting file offset cannot be represented in an +.\"O .IR off_t . +.\" ¤³¤Î¾ì¹ç HP-UX 11 ¤Ï EINVAL ¤òÊÖ¤¹ (°ìÊý¡¢POSIX.1 ¤Ï EOVERFLOW ¤òÊÖ¤¹) +·ë²Ì¤Î¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤ò +.I off_t +·¿¤Çɽ¸½¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.B ESPIPE +.\"O .I fd +.\"O is associated with a pipe, socket, or FIFO. +.I fd +¤¬¥Ñ¥¤¥×¡¢¥½¥±¥Ã¥È¡¢FIFO ¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O This document's use of +.\"O .I whence +.\"O is incorrect English, but maintained for historical reasons. +¤³¤Îʸ¾Ï¤Ç»ÈÍѤ·¤¿ +.I whence +¤Ï±Ñ¸ì¤È¤·¤ÆÀµ¤·¤¯¤Ê¤¤¤¬¡¢ +Îò»ËŪÍýͳ¤Ë¤è¤ê¤½¤Î¤Þ¤Þ»È¤ï¤ì¤Æ¤¤¤ë¡£ + +.\"O Some devices are incapable of seeking and POSIX does not specify which +.\"O devices must support +.\"O .BR lseek (). +¤¤¤¯¤Ä¤«¤Î¥Ç¥Ð¥¤¥¹¤Ç¤Ï seek ¤¬¤Ç¤­¤Ê¤¤¡£ +POSIX ¤Ï¤É¤Î¥Ç¥Ð¥¤¥¹¤¬ +.BR lseek () +¤ËÂбþ¤¹¤Ù¤­¤«¤Ïµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£ + +.\"O On Linux, using +.\"O .BR lseek () +.\"O on a tty device returns +.\"O \fBESPIPE\fP. +.\"O .\" Other systems return the number of written characters, +.\"O .\" using SEEK_SET to set the counter. (Of written characters.) +Linux ¤Ç¤Ï¡¢ tty ¥Ç¥Ð¥¤¥¹¤Ë +.BR lseek () +¤ò»ÈÍѤ¹¤ë¤È +\fBESPIPE\fP ¤òÊÖ¤¹¡£ +.\" ¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¤Î¿ô¤òÊÖ¤·¡¢ +.\" SEEK_SET ¤òÍѤ¤¤Æ¥«¥¦¥ó¥¿¤òÀßÄꤹ¤ë¡£ (½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¤Î¡£) + +.\"O When converting old code, substitute values for \fIwhence\fP with the +.\"O following macros: +¸Å¤¤¥³¡¼¥É¤òÊÑ´¹¤¹¤ë»þ¤Ï \fIwhence\fP ¤ÎÃͤò°Ê²¼¤Î¥Þ¥¯¥í¤ËÃÖ¤­´¹¤¨¤ë¤³¤È: +.TS +c c +l l. +old new +0 SEEK_SET +1 SEEK_CUR +2 SEEK_END +L_SET SEEK_SET +L_INCR SEEK_CUR +L_XTND SEEK_END +.TE +.PP +.\"O SVr1-3 returns \fIlong\fP instead of \fIoff_t\fP, BSD returns \fIint\fP. +ÊÖ¤êÃͤη¿¤Ï¡¢SVr1-3 ¤Ç¤Ï \fIoff_t\fP ¤Ç¤Ï¤Ê¤¯ \fIlong\fP ¤Ç¤¢¤ê¡¢ +BSD ¤Ç¤Ï \fIint\fP ¤Ç¤¢¤ë¡£ +.PP +.\"O Note that file descriptors created by +.\"O .BR dup (2) +.\"O or +.\"O .BR fork (2) +.\"O share the current file position pointer, so seeking on such files may be +.\"O subject to race conditions. +.BR dup (2) +¤ä +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¸½ºß¤Î¥Õ¥¡¥¤¥ë°ÌÃ֥ݥ¤¥ó¥¿ +(current file position pointer) ¤ò¶¦Í­¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ +¤³¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¤Ç°ÜÆ°¤ò¹Ô¤¦¤È¶¥¹ç¾õÂÖ¤ò°ú¤­µ¯¤³¤¹²ÄǽÀ­¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR dup (2), +.BR fork (2), +.BR open (2), +.BR fseek (3), +.BR lseek64 (3), +.BR posix_fallocate (3) diff --git a/draft/man2/madvise.2 b/draft/man2/madvise.2 new file mode 100644 index 00000000..abf0bb75 --- /dev/null +++ b/draft/man2/madvise.2 @@ -0,0 +1,373 @@ +.\" 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/mbind.2 b/draft/man2/mbind.2 new file mode 100644 index 00000000..b5b797c1 --- /dev/null +++ b/draft/man2/mbind.2 @@ -0,0 +1,812 @@ +.\" Copyright 2003,2004 Andi Kleen, SuSE Labs. +.\" and Copyright 2007 Lee Schermerhorn, Hewlett Packard +.\" +.\" 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. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\" 2006-02-03, mtk, substantial wording changes and other improvements +.\" 2007-08-27, Lee Schermerhorn +.\" more precise specification of behavior. +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2006-07-25, Akihiro MOTOKI , LDP v2.36 +.\" Updated 2008-08-21, Akihiro MOTOKI, LDP v3.07 +.\" Updated 2008-09-19, Akihiro MOTOKI, LDP v3.08 +.\" +.TH MBIND 2 2008-08-15 Linux "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mbind \- Set memory policy for a memory range +mbind \- ¥á¥â¥êÎΰè¤ËÂФ·¤Æ¥á¥â¥ê¥Ý¥ê¥·¡¼¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int mbind(void *" addr ", unsigned long " len ", int " mode , +.BI " unsigned long *" nodemask ", unsigned long " maxnode , +.BI " unsigned " flags ); +.sp +.\"O Link with \fI\-lnuma\fP. +\fI\-lnuma\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR mbind () +.\"O sets the NUMA memory policy, +.\"O which consists of a policy mode and zero or more nodes, +.\"O for the memory range starting with +.\"O .I addr +.\"O and continuing for +.\"O .I len +.\"O bytes. +.BR mbind () +¤Ï¡¢ +.I addr +¤«¤é»Ï¤Þ¤ëŤµ +.I len +¥Ð¥¤¥È¤ÎÈϰϤΥá¥â¥ê¤Ë NUMA ¥á¥â¥ê¥Ý¥ê¥·¡¼¤òÀßÄꤹ¤ë¡£ +NUMA ¥Ý¥ê¥·¡¼¤Ï¥Ý¥ê¥·¡¼¥â¡¼¥É¤È 0 ¸Ä°Ê¾å¤Î¥Î¡¼¥É¤«¤é¹½À®¤µ¤ì¤ë¡£ +.\"O The memory policy defines from which node memory is allocated. +¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï¤É¤Î¥Î¡¼¥É¤«¤é¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤ë¤«¤ò·èÄꤹ¤ë¡£ + +.\"O If the memory range specified by the +.\"O .IR addr " and " len +.\"O arguments includes an "anonymous" region of memory\(emthat is +.\"O a region of memory created using the +.\"O .BR mmap (2) +.\"O system call with the +.\"O .BR MAP_ANONYMOUS \(emor +.\"O a memory mapped file, mapped using the +.\"O .BR mmap (2) +.\"O system call with the +.\"O .B MAP_PRIVATE +.\"O flag, pages will only be allocated according to the specified +.\"O policy when the application writes [stores] to the page. +.I addr +¤È +.I len +¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥êÈϰϤˡ¢ +¥á¥â¥ê¤Î¡Ö̵̾¡×Îΰè \(em +.B MAP_ANONYMOUS +ÉÕ¤­¤Î +.BR mmap (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥á¥â¥êÎΰè \(em ¤ä +.B MAP_PRIVATE +ÉÕ¤­¤Î +.BR mmap (2) +¤ò»È¤Ã¤Æ¥Þ¥Ã¥×¤µ¤ì¤¿¥á¥â¥ê¥Þ¥Ã¥×¡¦¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¥Ú¡¼¥¸¤¬»ØÄꤵ¤ì¤¿¥Ý¥ê¥·¡¼¤Ë´ð¤Å¤¤¤Æ³ä¤êÅö¤Æ¤é¤ì¤ë¤Î¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó +¤¬¤½¤Î¥Ú¡¼¥¸¤Ø¤Î½ñ¤­¹þ¤ß (¥Ç¡¼¥¿¤Î³ÊǼ) ¤ò¹Ô¤Ã¤¿»þ¤À¤±¤Ç¤¢¤ë¡£ +.\"O For anonymous regions, an initial read access will use a shared +.\"O page in the kernel containing all zeros. +.\"O For a file mapped with +.\"O .BR MAP_PRIVATE , +.\"O an initial read access will allocate pages according to the +.\"O process policy of the process that causes the page to be allocated. +.\"O This may not be the process that called +.\"O .BR mbind (). +̵̾Îΰè¤Î¾ì¹ç¡¢ºÇ½é¤ÎÆɤ߽Ф·¥¢¥¯¥»¥¹¤ÎºÝ¤Ë¤Ï +¥«¡¼¥Í¥ëÆâ¤ÎÁ´¥Ç¡¼¥¿¤¬ 0 ¤Ç¤¢¤ë¶¦Í­¥Ú¡¼¥¸¤¬»ÈÍѤµ¤ì¤ë¡£ +.B MAP_PRIVATE +¤Ç¥Þ¥Ã¥×¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¢ºÇ½é¤ÎÆɤ߽Ф·¥¢¥¯¥»¥¹¤¬¤¢¤ë¤È¡¢ +¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬È¯À¸¤¹¤ë¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼ +¤Ë¤·¤¿¤¬¤Ã¤Æ¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£ +¥Ú¡¼¥¸³ä¤êÅö¤Æ¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¥×¥í¥»¥¹¤Ï¡¢ +.BR mbind () +¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ÈƱ¤¸¤È¤Ï¸Â¤é¤Ê¤¤¡£ + +.\"O The specified policy will be ignored for any +.\"O .B MAP_SHARED +.\"O mappings in the specified memory range. +.\"O Rather the pages will be allocated according to the process policy +.\"O of the process that caused the page to be allocated. +.\"O Again, this may not be the process that called +.\"O .BR mbind (). +»ØÄꤵ¤ì¤¿¥á¥â¥êÈÏ°ÏÆâ¤Ë¤¢¤ë +.B MAP_SHARED +¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ç¤Ï»ØÄꤵ¤ì¤¿¥Ý¥ê¥·¡¼¤Ï̵»ë¤µ¤ì¡¢ +¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬È¯À¸¤¹¤ë¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ë +¤·¤¿¤¬¤Ã¤Æ¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +·«¤êÊÖ¤·¤Ë¤Ê¤ë¤¬¡¢¥Ú¡¼¥¸³ä¤êÅö¤Æ¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¥×¥í¥»¥¹¤Ï¡¢ +.BR mbind () +¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ÈƱ¤¸¤È¤Ï¸Â¤é¤Ê¤¤¡£ + +.\"O If the specified memory range includes a shared memory region +.\"O created using the +.\"O .BR shmget (2) +.\"O system call and attached using the +.\"O .BR shmat (2) +.\"O system call, +.\"O pages allocated for the anonymous or shared memory region will +.\"O be allocated according to the policy specified, regardless which +.\"O process attached to the shared memory segment causes the allocation. +.\"Omotoki: Ìõ¤Ë¾¯¤·¤À¤±¼«¿®¤¬¤Ê¤¤¡£ +»ØÄꤵ¤ì¤¿¥á¥â¥êÈϰϤˡ¢ +.BR shmget (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿¤ê¡¢ +.BR shmat (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤ÆÉղà (attach) ¤µ¤ì¤¿¤ê¤·¤¿¶¦Í­¥á¥â¥êÎΰ褬 +´Þ¤Þ¤ì¤ë¾ì¹ç¡¢ÌµÌ¾¥á¥â¥êÎΰè¤ä¶¦Í­¥á¥â¥êÎΰè¤ËÂФ¹¤ë¥Ú¡¼¥¸³ä¤êÅö¤Æ¤Ï¡¢ +¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤Ø¥Ý¥ê¥·¡¼¤ÎÀßÄê¤ò¹Ô¤Ã¤¿¥×¥í¥»¥¹¤¬¥Ú¡¼¥¸³ä¤êÅö¤Æ +¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¤«¤Ë´Ø¤ï¤é¤º¡¢»ØÄꤵ¤ì¤¿¥Ý¥ê¥·¡¼¤Ë¤·¤¿¤¬¤Ã¤Æ³ä¤êÅö¤Æ +¤¬¹Ô¤ï¤ì¤ë¡£ +.\"O If, however, the shared memory region was created with the +.\"O .B SHM_HUGETLB +.\"O flag, +.\"O the huge pages will be allocated according to the policy specified +.\"O only if the page allocation is caused by the process that calls +.\"O .BR mbind () +.\"O for that region. +¤·¤«¤·¤Ê¤¬¤é¡¢¶¦Í­¥á¥â¥êÎΰ褬 +.B SHM_HUGETLB +¥Õ¥é¥°¤ò»ØÄꤷ¤ÆºîÀ®¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢¥Ò¥å¡¼¥¸¥Ú¡¼¥¸ (huge page) ¤Î³ä¤êÅö¤Æ¤¬ +»ØÄꤵ¤ì¤¿¥Ý¥ê¥·¡¼¤Ë¤·¤¿¤¬¤Ã¤Æ¹Ô¤ï¤ì¤ë¤Î¤Ï¡¢¤½¤ÎÎΰè¤ËÂФ·¤Æ +.BR mbind () +¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬¥Ú¡¼¥¸³ä¤êÅö¤Æ¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¾ì¹ç¤Î¤ß¤Ç¤¢¤ë¡£ + +.\"O By default, +.\"O .BR mbind () +.\"O only has an effect for new allocations; if the pages inside +.\"O the range have been already touched before setting the policy, +.\"O then the policy has no effect. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR mbind () +¤Ï¿·µ¬¤Î¥á¥â¥ê³ä¤êÅö¤Æ¤ËÂФ·¤Æ¤Î¤ß¸ú²Ì¤ò»ý¤Ä¡£ +¥Ý¥ê¥·¡¼¤¬ÀßÄꤵ¤ì¤ëÁ°¤Ë¤¹¤Ç¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ëÈÏ°ÏÆâ¤Î¥Ú¡¼¥¸¤ËÂФ·¤Æ¤Ï¡¢ +¥Ý¥ê¥·¡¼¤Ï±Æ¶Á¤·¤Ê¤¤¡£ +.\"O This default behavior may be overridden by the +.\"O .B MPOL_MF_MOVE +.\"O and +.\"O .B MPOL_MF_MOVE_ALL +.\"O flags described below. +¤³¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ë¥Õ¥é¥° +.B MPOL_MF_MOVE +¤ä +.B MPOL_MF_MOVE_ALL +¤Ë¤è¤ê¾å½ñ¤­¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ + +.\"O The +.\"O .I mode +.\"O argument must specify one of +.\"O .BR MPOL_DEFAULT , +.\"O .BR MPOL_BIND , +.\"O .B MPOL_INTERLEAVE +.\"O or +.\"O .BR MPOL_PREFERRED . +.\"O All policy modes except +.\"O .B MPOL_DEFAULT +.\"O require the caller to specify via the +.\"O .I nodemask +.\"O argument, +.\"O the node or nodes to which the mode applies. +.I mode +°ú¤­¿ô¤Ë¤Ï¡¢ +.BR MPOL_DEFAULT , +.BR MPOL_BIND , +.BR MPOL_INTERLEAVE , +.B MPOL_PREFERRED +¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B MPOL_DEFAULT +°Ê³°¤Î¥Ý¥ê¥·¡¼¥â¡¼¥É¤Î¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï +.I nodemask +°ú¤­¿ô¤Ç¤½¤Î¥Ý¥ê¥·¡¼¥â¡¼¥É¤òŬÍѤ¹¤ë¥Î¡¼¥É¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ + +.\"O The +.\"O .I mode +.\"O argument may also include an optional +.\"O .IR "mode flag ". +.\"O The supported +.\"O .I "mode flags" +.\"O are: +.I mode +°ú¤­¿ô¤Ë¤Ï¡¢ÄÉ²Ã¤Ç +.I "¥â¡¼¥É¥Õ¥é¥°" +¤ò´Þ¤á¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë +.I "¥â¡¼¥É¥Õ¥é¥°" +¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.TP +.\"O .BR MPOL_F_STATIC_NODES " (since Linux-2.6.26)" +.BR MPOL_F_STATIC_NODES " (Linux-2.6.26 °Ê¹ß)" +.\"O A nonempty +.\"O .I nodemask +.\"O specifies physical node ids. +.\"O Linux does not remap the +.\"O .I nodemask +.\"O when the process moves to a different cpuset context, +.\"O nor when the set of nodes allowed by the process's +.\"O current cpuset context changes. +¶õ¤Ç¤Ê¤¤ +.I nodemask +¤Ï¡¢ÊªÍý¥Î¡¼¥É ID ¤Ç¤¢¤ë¡£ +Linux ¤Ç¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬°Û¤Ê¤ë CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È (cpuset context) +¤Ë°ÜÆ°¤·¤¿¾ì¹ç¤Ç¤â¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç +µö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É½¸¹ç¤¬ÊѲ½¤·¤¿¾ì¹ç¤Ç¤â¡¢ +.I nodemask +¤ò¥Þ¥Ã¥Ô¥ó¥°¤·Ä¾¤¹¤³¤È¤Ï¤Ê¤¤¡£ +.TP +.\"O .BR MPOL_F_RELATIVE_NODES " (since Linux-2.6.26)" +.BR MPOL_F_RELATIVE_NODES " (Linux-2.6.26 °Ê¹ß)" +.\"O A nonempty +.\"O .I nodemask +.\"O specifies node ids that are relative to the set of +.\"O node ids allowed by the process's current cpuset. +¶õ¤Ç¤Ê¤¤ +.I nodemask +¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¤Çµö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É ID ½¸¹ç +¤Ë¤ª¤±¤ëÁêÂÐŪ¤Ê¥Î¡¼¥É ID ¤Ç¤¢¤ë¡£ +.PP +.\"O .I nodemask +.\"O points to a bitmask of nodes containing up to +.\"O .I maxnode +.\"O bits. +.\"O The bit mask size is rounded to the next multiple of +.\"O .IR "sizeof(unsigned long)" , +.\"O but the kernel will only use bits up to +.\"O .IR maxnode . +.I nodemask +¤Ï¡¢ºÇÂç¤Ç +.I maxnode +¥Ó¥Ã¥È¤«¤é¹½À®¤µ¤ì¤ë¥Î¡¼¥É¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤ò»Ø¤¹¡£ +¥Ó¥Ã¥È¥Þ¥¹¥¯¤ÎÂ礭¤µ¤Ï¡¢Ä¾¶á¤Î +.I sizeof(unsigned long) +¤ÎÇÜ¿ô¤ËÀÚ¤ê¾å¤²¤é¤ì¤ë¤¬¡¢¥«¡¼¥Í¥ë¤¬»ÈÍѤ¹¤ë¤Î¤Ï +.I maxnode +¸Ä¤Þ¤Ç¤Î¥Ó¥Ã¥È¤À¤±¤Ç¤¢¤ë¡£ +.\"O A NULL value of +.\"O .I nodemask +.\"O or a +.\"O .I maxnode +.\"O value of zero specifies the empty set of nodes. +.\"O If the value of +.\"O .I maxnode +.\"O is zero, +.\"O the +.\"O .I nodemask +.\"O argument is ignored. +NULL ÃͤΠ+.I nodemask +¤â¤·¤¯¤ÏÃͤ¬ 0 ¤Î +.I maxnode +¤Ï¥Î¡¼¥É¤Î¶õ½¸¹ç¤òɽ¤¹¡£ +.I maxnode +¤ÎÃͤ¬ 0 ¤Î¾ì¹ç¡¢ +.I nodemask +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O Where a +.\"O .I nodemask +.\"O is required, it must contain at least one node that is on-line, +.\"O allowed by the process's current cpuset context +.\"O [unless the +.\"O .B MPOL_F_STATIC_NODES +.\"O mode flag is specified], +.\"O and contains memory. +.I nodemask +¤¬É¬¿Ü¤Î¾ìÌ̤Ǥϡ¢ +.I nodemask +¤Ë¡¢¥ª¥ó¥é¥¤¥ó¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç +µö²Ä¤µ¤ì¤Æ¤ª¤ê +.RB ( MPOL_F_STATIC_NODES +¥â¡¼¥É¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢¥á¥â¥ê¤¬¤¢¤ë¥Î¡¼¥É¤¬ +¾¯¤Ê¤¯¤È¤â°ì¤ÄÆþ¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O The +.\"O .B MPOL_DEFAULT +.\"O mode requests that any nondefault policy be removed, +.\"O restoring default behavior. +¥â¡¼¥É +.B MPOL_DEFAULT +¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¤Ê¤¤¥×¥í¥»¥¹¤Î¥á¥â¥ê¥Ý¥ê¥·¡¼¤òºï½ü¤·¡¢ +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤ËÌ᤹¤³¤È¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.\"O When applied to a range of memory via +.\"O .BR mbind (), +.\"O this means to use the process policy, +.\"O which may have been set with +.\"O .BR set_mempolicy (2). +.BR mbind () +·Ðͳ¤Ç¡¢¤¢¤ë¥á¥â¥êÎΰè¤ËÂФ·¤Æ +.B MPOL_DEFAULT +¤¬Å¬ÍѤµ¤ì¤¿¾ì¹ç¡¢¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤ò»ÈÍѤ¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ï¡¢ +.BR set_mempolicy (2) +¤ÇÊѹ¹¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O If the mode of the process policy is also +.\"O .BR MPOL_DEFAULT , +.\"O the system-wide default policy will be used. +¥×¥í¥»¥¹¤Î¥Ý¥ê¥·¡¼¤Î¥â¡¼¥É¤â +.B MPOL_DEFAULT +¤Î¾ì¹ç¡¢¥·¥¹¥Æ¥àÁ´ÂΤΥǥե©¥ë¥È¥Ý¥ê¥·¡¼¤¬»ÈÍѤµ¤ì¤ë¡£ +.\"O The system-wide default policy allocates +.\"O pages on the node of the CPU that triggers the allocation. +.\"O For +.\"O .BR MPOL_DEFAULT , +.\"O the +.\"O .I nodemask +.\"O and +.\"O .I maxnode +.\"O arguments must be specify the empty set of nodes. +¥·¥¹¥Æ¥àÁ´ÂΤΥǥե©¥ë¥È¥Ý¥ê¥·¡¼¤Ç¤Ï¡¢³ä¤êÅö¤Æ¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿ +CPU ¤Î¥Î¡¼¥É¤«¤é¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤ò¹Ô¤¦¡£ +.B MPOL_DEFAULT +¤Ç¤Ï¡¢°ú¤­¿ô +.I nodemask +¤È +.I maxnode +¤Ë¥Î¡¼¥É¤Î¶õ½¸¹ç¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O The +.\"O .B MPOL_BIND +.\"O mode specifies a strict policy that restricts memory allocation to +.\"O the nodes specified in +.\"O .IR nodemask . +.\"O If +.\"O .I nodemask +.\"O specifies more than one node, page allocations will come from +.\"O the node with the lowest numeric node ID first, until that node +.\"O contains no free memory. +.\"O Allocations will then come from the node with the next highest +.\"O node ID specified in +.\"O .I nodemask +.\"O and so forth, until none of the specified nodes contain free memory. +.\"O Pages will not be allocated from any node not specified in the +.\"O .IR nodemask . +.B MPOL_BIND +¤Ï¸·¤·¤¤¥Ý¥ê¥·¡¼¤Ç¡¢¥á¥â¥ê³ä¤êÅö¤Æ¤Ï +.I nodemask +¤Ë»ØÄꤵ¤ì¤¿¥Î¡¼¥É¤Ë¸ÂÄꤵ¤ì¤ë¡£ +¾¤Î¥Î¡¼¥É¤Ø¤Î³ä¤êÅö¤Æ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +.I nodemask +¤Ë 2 ¸Ä°Ê¾å¤Î¥Î¡¼¥É¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ï +¥Î¡¼¥É ID ¤¬¿ô»ú¤È¤·¤ÆºÇ¾®¤Î¥Î¡¼¥É¤«¤é³«»Ï¤µ¤ì¡¢ +¤½¤Î¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç¤½¤Î¥Î¡¼¥É¤«¤é +¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£¤½¤Î¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤Ã¤¿¤é¡¢ +.\"motoki: the next highest ¤Ï the next lowest ¤Î´Ö°ã¤¤¡© +¼¡¤Ë¾®¤µ¤Ê¥Î¡¼¥É ID ¤ò»ý¤Ä¥Î¡¼¥É¤«¤é¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£ +¤³¤ì¤ò¡¢ +.I nodemask +¤Ç»ØÄꤵ¤ì¤¿Á´¤Æ¤Î¥Î¡¼¥É¤Ç¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç·«¤êÊÖ¤¹¡£ +.I nodemask +¤Ç»ØÄꤵ¤ì¤¿°Ê³°¤Î¥Î¡¼¥É¤«¤é¤Ï¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ + +.\"O The +.\"O .B MPOL_INTERLEAVE +.\"O mode specifies that page allocations be interleaved across the +.\"O set of nodes specified in +.\"O .IR nodemask . +.\"O This optimizes for bandwidth instead of latency +.\"O by spreading out pages and memory accesses to those pages across +.\"O multiple nodes. +.\"O To be effective the memory area should be fairly large, +.\"O at least 1MB or bigger with a fairly uniform access pattern. +.\"O Accesses to a single page of the area will still be limited to +.\"O the memory bandwidth of a single node. +.B MPOL_INTERLEAVE +¤Ï¡¢¥á¥â¥ê³ä¤êÅö¤Æ¤¬ +.I nodemask +¤Ë»ØÄꤵ¤ì¤¿¥Î¡¼¥É´Ö¤Ç¸ò¸ß¤Ë¹Ô¤ï¤ì¤ë¤³¤È¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥Ý¥ê¥·¡¼¤Ç¤Ï¡¢Ê£¿ô¤Î¥Î¡¼¥É¤Ë¥Ú¡¼¥¸¤ò¹­¤²¤ÆÇÛÃÖ¤·¡¢¤³¤ì¤é¤Î¥Ú¡¼¥¸¤Ø¤Î +¥á¥â¥ê¥¢¥¯¥»¥¹¤òʬ»¶¤¹¤ë¤³¤È¤Ç¡¢ÃÙ±ä¤Ç¤Ï¤Ê¤¯¡¢ÂÓ°è¤òºÇŬ²½¤¹¤ë¡£ +¸ú²Ì¤òÆÀ¤ë¤Ë¤Ï¡¢¥á¥â¥êÎΰè¤ò¤¢¤ëÄøÅÙÂ礭¤¯¤¹¤Ù¤­¤Ç¤¢¤ê¡¢ +¥á¥â¥ê¥¢¥¯¥»¥¹¤Î¥Ñ¥¿¡¼¥ó¤¬¤«¤Ê¤ê¶Ñ°ì¤Ê¾ì¹ç¤Ç¤â +¾¯¤Ê¤¯¤È¤â 1MB °Ê¾å¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤Î¥â¡¼¥É¤Ç¤â¡¢°ì¤Ä¤Î¥Ú¡¼¥¸¤Ø¤Î¥¢¥¯¥»¥¹¤Ë´Ø¤·¤Æ¤Ï +°ì¤Ä¤Î¥Î¡¼¥É¤Î¥á¥â¥êÂӰ褬¾å¸Â¤È¤Ê¤ë¤³¤È¤ÏÊѤï¤ê¤Ê¤¤¡£ + +.\"O .B MPOL_PREFERRED +.\"O sets the preferred node for allocation. +.\"O The kernel will try to allocate pages from this +.\"O node first and fall back to other nodes if the +.\"O preferred nodes is low on free memory. +.\"O If +.\"O .I nodemask +.\"O specifies more than one node ID, the first node in the +.\"O mask will be selected as the preferred node. +.\"O If the +.\"O .I nodemask +.\"O and +.\"O .I maxnode +.\"O arguments specify the empty set, then the memory is allocated on +.\"O the node of the CPU that triggered the allocation. +.\"O This is the only way to specify "local allocation" for a +.\"O range of memory via +.\"O .BR mbind (). +.B MPOL_PREFERRED +¤Ï¡¢³ä¤êÅö¤Æ»þ¤ËÍ¥À褵¤ì¤ë¥Î¡¼¥É¤òÀßÄꤹ¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¤Þ¤ºÍ¥Àè¥Î¡¼¥É¤Ë¥Ú¡¼¥¸³ä¤êÅö¤Æ¤ò¹Ô¤ª¤¦¤È¤·¡¢ +Í¥Àè¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¾¯¤Ê¤¤¾ì¹ç¤Ë¾¤Î¥Î¡¼¥É¤Ë³ä¤êÅö¤Æ¤ò¹Ô¤¦¡£ +.I nodemask +¤ËÊ£¿ô¤Î¥Î¡¼¥É ID ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +.I nodemask +Æâ¤ÎºÇ½é¤Î¥Î¡¼¥É¤¬Í¥Àè¥Î¡¼¥É¤È¤·¤ÆÁªÂò¤µ¤ì¤ë¡£ +°ú¤­¿ô +.IR nodemask , +.I maxnode +¤Ç¶õ½¸¹ç¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢³ä¤êÅö¤Æ¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿ CPU ¤Î¥Î¡¼¥É¤Ë +¥á¥â¥ê³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£ +.BR mbind (2) +¤Ç¡¢¤¢¤ë¥á¥â¥êÎΰè¤ËÂФ·¤Æ¡Ö¥í¡¼¥«¥ë¤«¤é¤Î³ä¤êÅö¤Æ (local allocation)¡×¤ò +»ØÄꤹ¤ëÊýË¡¤Ï¤³¤ì¤·¤«¤Ê¤¤¡£ + +.\"O If +.\"O .B MPOL_MF_STRICT +.\"O is passed in +.\"O .I flags +.\"O and +.\"O .I policy +.\"O is not +.\"O .BR MPOL_DEFAULT , +.\"O then the call will fail with the error +.\"O .B EIO +.\"O if the existing pages in the memory range don't follow the policy. +.I flags +¤Ë +.B MPOL_MF_STRICT +¤¬ +»ØÄꤵ¤ì¡¢ +.I policy +¤¬ +.B MPOL_DEFAULT +¤Ç¤Ê¤¤¾ì¹ç¡¢ +»ØÄꤵ¤ì¤¿¥Ý¥ê¥·¡¼¤Ë½¾¤Ã¤Æ¤¤¤Ê¤¤¥á¥â¥êÎΰè¤Ë¥Ú¡¼¥¸¤¬Â¸ºß¤¹¤ë¤È¡¢ +.BR mbind () +¤Ï¥¨¥é¡¼ +.B EIO +¤Ç¼ºÇÔ¤¹¤ë¡£ +.\" According to the kernel code, the following is not true +.\" --Lee Schermerhorn +.\" .\"O In 2.6.16 or later the kernel will also try to move pages +.\" .\"O to the requested node with this flag. +.\" 2.6.16 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Î¥Õ¥é¥°¤ÇÍ׵ᤵ¤ì¤¿¥Î¡¼¥É¤Ë +.\" ¥Ú¡¼¥¸¤ò°ÜÆ°¤·¤è¤¦¤È¤¹¤ë¡£ + +.\"O If +.\"O .B MPOL_MF_MOVE +.\"O is specified in +.\"O .IR flags , +.\"O then the kernel will attempt to move all the existing pages +.\"O in the memory range so that they follow the policy. +.\"O Pages that are shared with other processes will not be moved. +.\"O If +.\"O .B MPOL_MF_STRICT +.\"O is also specified, then the call will fail with the error +.\"O .B EIO +.\"O if some pages could not be moved. +.I flags +¤Ë +.B MPOL_MF_MOVE +¤¬»ØÄꤵ¤ì¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï¤½¤Î¥á¥â¥êÎΰèÆâ¤Î´û¸¤ÎÁ´¤Æ¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤·¡¢ +»ØÄꤵ¤ì¤¿¥Ý¥ê¥·¡¼¤Ë½¾¤¦¤è¤¦¤Ë¤·¤è¤¦¤È¤¹¤ë¡£ +¾¤Î¥×¥í¥»¥¹¤È¶¦Í­¤µ¤ì¤Æ¤¤¤ë¥Ú¡¼¥¸¤Ï°ÜÆ°¤µ¤ì¤Ê¤¤¡£ +.B MPOL_MF_STRICT +¤â»ØÄꤵ¤ì¤¿¾ì¹ç¡¢°ÜÆ°¤Ç¤­¤Ê¤«¤Ã¤¿¥Ú¡¼¥¸¤¬¤¢¤ë¤È¡¢ +.BR mbind () +¤Ï¥¨¥é¡¼ +.B EIO +¤Ç¼ºÇÔ¤¹¤ë¡£ + +.\"O If +.\"O .B MPOL_MF_MOVE_ALL +.\"O is passed in +.\"O .IR flags , +.\"O then the kernel will attempt to move all existing pages in the memory range +.\"O regardless of whether other processes use the pages. +.\"O The calling process must be privileged +.\"O .RB ( CAP_SYS_NICE ) +.\"O to use this flag. +.\"O If +.\"O .B MPOL_MF_STRICT +.\"O is also specified, then the call will fail with the error +.\"O .B EIO +.\"O if some pages could not be moved. +.I flags +¤Ë +.B MPOL_MF_MOVE_ALL +¤¬»ØÄꤵ¤ì¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï¤½¤Î¥á¥â¥êÎΰèÆâ¤Î´û¸¤ÎÁ´¤Æ¤Î¥Ú¡¼¥¸¤ò¡¢ +¾¤Î¥×¥í¥»¥¹¤¬¥Ú¡¼¥¸¤ò»ÈÍѤ·¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ë´Ø¤ï¤é¤º°ÜÆ°¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÏÆø¢ +.RB ( CAP_SYS_NICE ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B MPOL_MF_STRICT +¤â»ØÄꤵ¤ì¤¿¾ì¹ç¡¢°ÜÆ°¤Ç¤­¤Ê¤«¤Ã¤¿¥Ú¡¼¥¸¤¬¤¢¤ë¤È¡¢ +.BR mbind () +¤Ï¥¨¥é¡¼ +.B EIO +¤Ç¼ºÇÔ¤¹¤ë¡£ +.\" --------------------------------------------------------------- +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR mbind () +.\"O returns 0; +.\"O on error, \-1 is returned and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR mbind () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\" --------------------------------------------------------------- +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\" I think I got all of the error returns. --Lee Schermerhorn +.TP +.B EFAULT +.\"O Part or all of the memory range specified by +.\"O .I nodemask +.\"O and +.\"O .I maxnode +.\"O points outside your accessible address space. +.\"O Or, there was an unmapped hole in the specified memory range. +.I nodemask +¤È +.I maxnode +¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥êÎΰè¤Î°ìÉô¤Þ¤¿¤ÏÁ´Éô¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +¤â¤·¤¯¤Ï»ØÄꤵ¤ì¤¿¥á¥â¥êÎΰè¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Ê¤¤Éôʬ (unmapped hole) +¤¬¤¢¤Ã¤¿¡¢ +.TP +.B EINVAL +.\"O An invalid value was specified for +.\"O .I flags +.\"O or +.\"O .IR mode ; +.I flags +¤ä +.I mode +¤ËÉÔÀµ¤ÊÃͤ¬»ØÄꤵ¤ì¤¿¡£ +.\"O or +.\"O .I addr + len +.\"O was less than +.\"O .IR addr ; +.I addr + len +¤¬ +.I addr +¤è¤ê¾®¤µ¤¤¡£ +.\"O or +.\"O .I addr +.\"O is not a multiple of the system page size. +.\"O Or, +.\"O .I mode +.\"O is +.\"O .B MPOL_DEFAULT +.\"O and +.\"O .I nodemask +.\"O specified a nonempty set; +.I addr +¤¬¥·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¤Ï +.I mode +¤¬ +.B MPOL_DEFAULT +¤Ç +.I nodemask +¤Ë¶õ¤Ç¤Ê¤¤½¸¹ç¤¬»ØÄꤵ¤ì¤¿¡£ +.\"O or +.\"O .I mode +.\"O is +.\"O .B MPOL_BIND +.\"O or +.\"O .B MPOL_INTERLEAVE +.\"O and +.\"O .I nodemask +.\"O is empty. +.I mode +¤¬ +.B MPOL_BIND +¤« +.B MPOL_INTERLEAVE +¤Ç +.I nodemask +¤¬¶õ¤Ç¤¢¤Ã¤¿¡£ +.\"O Or, +.\"O .I maxnode +.\"O exceeds a kernel-imposed limit. +.I maxnode +¤¬¥«¡¼¥Í¥ë¤ËŬÍѤµ¤ì¤¿¾å¸Â¤òĶ¤¨¤Æ¤¤¤ë¡£ +.\" As at 2.6.23, this limit is "a page worth of bits", e.g., +.\" 8 * 4096 bits, assuming a 4kB page size. +.\"O Or, +.\"O .I nodemask +.\"O specifies one or more node IDs that are +.\"O greater than the maximum supported node ID. +.I nodemask +¤Ë¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëºÇÂç¥Î¡¼¥É ID ¤è¤êÂ礭¤¤¥Î¡¼¥É¤¬»ØÄꤵ¤ì¤¿¡£ +.\"O Or, none of the node IDs specified by +.\"O .I nodemask +.\"O are on-line and allowed by the process's current cpuset context, +.\"O or none of the specified nodes contain memory. +.I nodemask +¤Ë¡¢¥ª¥ó¥é¥¤¥ó¤Ç¡¢¤«¤Ä¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç +µö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤¬°ì¤Ä¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +¥á¥â¥ê¤ò´Þ¤à¥Î¡¼¥É¤¬°ì¤Ä¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O Or, the +.\"O .I mode +.\"O argument specified both +.\"O .B MPOL_F_STATIC_NODES +.\"O and +.\"O .BR MPOL_F_RELATIVE_NODES . +.I mode +°ú¤­¿ô¤Ë +.B MPOL_F_STATIC_NODES +¤È +.B MPOL_F_RELATIVE_NODES +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B EIO +.\"O .B MPOL_MF_STRICT +.\"O was specified and an existing page was already on a node +.\"O that does not follow the policy; +.B MPOL_MF_STRICT +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¤³¤Î¥Ý¥ê¥·¡¼¤Ë½¾¤Ã¤Æ¤¤¤Ê¤¤¥Î¡¼¥É¤Ë +¤¹¤Ç¤Ë¥Ú¡¼¥¸¤¬Â¸ºß¤·¤Æ¤¤¤¿¡£ +.\"O or +.\"O .B MPOL_MF_MOVE +.\"O or +.\"O .B MPOL_MF_MOVE_ALL +.\"O was specified and the kernel was unable to move all existing +.\"O pages in the range. +¤â¤·¤¯¤Ï +.B MPOL_MF_MOVE +¤« +.B MPOL_MF_MOVE_ALL +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¥«¡¼¥Í¥ë¤¬»ØÄꤵ¤ì¤¿ÎΰèÆâ¤Î´û¸¤ÎÁ´¤Æ¤Î¥Ú¡¼¥¸¤ò +°ÜÆ°¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O Insufficient kernel memory was available. +ÍøÍѲÄǽ¤Ê¥«¡¼¥Í¥ë¥á¥â¥ê¤¬½½Ê¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPERM +.\"O The +.\"O .I flags +.\"O argument included the +.\"O .B MPOL_MF_MOVE_ALL +.\"O flag and the caller does not have the +.\"O .B CAP_SYS_NICE +.\"O privilege. +.I flags +°ú¤­¿ô¤Ë +.B MPOL_MF_MOVE_ALL +¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¤¬ +.B CAP_SYS_NICE +Æø¢¤ò»ý¤¿¤Ê¤¤¡£ +.\" --------------------------------------------------------------- +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The +.\"O .BR mbind () +.\"O system call was added to the Linux kernel in version 2.6.7. +.BR mbind () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ð¡¼¥¸¥ç¥ó 2.6.7 ¤Ç Linux ¥«¡¼¥Í¥ë¤ËÄɲ䵤줿¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O This system call is Linux-specific. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O For information on library support, see +.\"O .BR numa (7). +¥é¥¤¥Ö¥é¥ê¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR numa (7) +¤ò»²¾È¡£ + +.\"O NUMA policy is not supported on a memory mapped file range +.\"O that was mapped with the +.\"O .B MAP_SHARED +.\"O flag. +NUMA ¥Ý¥ê¥·¡¼¤Ï¡¢ +.B MAP_SHARED +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¥Þ¥Ã¥×¤µ¤ì¤¿¥á¥â¥ê¥Þ¥Ã¥×¡¦¥Õ¥¡¥¤¥ë¤ÎÎΰè¤Ç¤Ï +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"O The +.\"O .B MPOL_DEFAULT +.\"O mode can have different effects for +.\"O .BR mbind () +.\"O and +.\"O .BR set_mempolicy (2). +.B MPOL_DEFAULT +¥â¡¼¥É¤Ï¡¢ +.BR mbind () +¤È +.BR set_mempolicy (2) +¤Ç°Û¤Ê¤ë¸ú²Ì¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O When +.\"O .B MPOL_DEFAULT +.\"O is specified for +.\"O .BR set_mempolicy (2), +.\"O the process's policy reverts to system default policy +.\"O or local allocation. +.BR set_mempolicy (2) +¤Ç +.B MPOL_DEFAULT +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥Ý¥ê¥·¡¼¤Ï¥·¥¹¥Æ¥à¤Î +¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¡¢¤¹¤Ê¤ï¤Á¥í¡¼¥«¥ë¤«¤é¤Î³ä¤êÅö¤Æ¡¢¤ËÌá¤ë¡£ +.\"O When +.\"O .B MPOL_DEFAULT +.\"O is specified for a range of memory using +.\"O .BR mbind (), +.\"O any pages subsequently allocated for that range will use +.\"O the process's policy, as set by +.\"O .BR set_mempolicy (2). +.BR mbind () +¤ò»È¤Ã¤Æ¥á¥â¥ê¤Î¤¢¤ëÎΰè¤Ë +.B MPOL_DEFAULT +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¤½¤ÎÈϰϤËÂФ·¤Æ¤½¤ì°Ê¹ß¤Ë¹Ô¤ï¤ì¤ë¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ç¤Ï¡¢ +.BR set_mempolicy (2) +¤ÇÀßÄꤷ¤¿¤Î¤ÈƱ¤¸¤è¤¦¤Ë¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥Ý¥ê¥·¡¼¤¬Å¬ÍѤµ¤ì¤ë¡£ +.\"O This effectively removes the explicit policy from the +.\"O specified range, "falling back" to a possibly nondefault +.\"O policy. +.\"0motoki: possibly nondefault policy ¤Ï default policy ¤Î´Ö°ã¤¤¡© +¤³¤ì¤Ë¤è¤ê¡¢ÆÃÄê¤Î¥á¥â¥êÎΰè¤Ë¤Ä¤¤¤Æ¤À¤±ÌÀ¼¨Åª¤Ê¥Ý¥ê¥·¡¼¤òºï½ü¤·¡¢ +¥Ç¥Õ¥©¥ë¥È¤Î¥Ý¥ê¥·¡¼¤Ë¡ÖÌ᤹¡×¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O To select explicit "local allocation" for a memory range, +.\"O specify a +.\"O .I mode +.\"O of +.\"O .B MPOL_PREFERRED +.\"O with an empty set of nodes. +.\"O This method will work for +.\"O .BR set_mempolicy (2), +.\"O as well. +¤¢¤ë¥á¥â¥êÎΰè¤ËÂФ·¤Æ¡Ö¥í¡¼¥«¥ë¤«¤é¤Î³ä¤êÅö¤Æ¡×¤òÌÀ¼¨Åª¤ËÀßÄꤹ¤ë¤Ë¤Ï¡¢ +.I mode +¤Ë +.B MPOL_PREFERRED +¤ò»ØÄꤷ¡¢ +.I nodemask +¤Ë¶õ½¸¹ç¤Î¥Î¡¼¥É¤ò»ØÄꤹ¤ì¤Ð¤è¤¤¡£ +¤³¤ÎÊýË¡¤Ï +.BR set_mempolicy (2) +¤Ç¤âÄÌÍѤ¹¤ë¡£ + +.\"O Support for huge page policy was added with 2.6.16. +.\"O For interleave policy to be effective on huge page mappings the +.\"O policied memory needs to be tens of megabytes or larger. +2.6.16 ¤Ç¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¡¦¥Ý¥ê¥·¡¼¤Ø¤ÎÂбþ¤¬Äɲ䵤줿¡£ +¥¤¥ó¥¿¡¼¥ê¡¼¥Ö¡¦¥Ý¥ê¥·¡¼¤¬¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ç¸ú²Ì¤ò»ý¤Ä¤Ë¤Ï¡¢ +¥Ý¥ê¥·¡¼¤¬Å¬ÍѤµ¤ì¤ë¥á¥â¥ê¤¬¿ô½½¥á¥¬¥Ð¥¤¥È°Ê¾å¤Ç¤¢¤ëɬÍפ¬¤¢¤ë¡£ + +.\"O .B MPOL_MF_STRICT +.\"O is ignored on huge page mappings. +.B MPOL_MF_STRICT +¤Ï¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ç¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"O .B MPOL_MF_MOVE +.\"O and +.\"O .B MPOL_MF_MOVE_ALL +.\"O are only available on Linux 2.6.16 and later. +.B MPOL_MF_MOVE +¤È +.B MPOL_MF_MOVE_ALL +¤Ï Linux 2.6.16 °Ê¹ß¤Ç¤Î¤ßÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR get_mempolicy (2), +.BR getcpu (2), +.BR mmap (2), +.BR set_mempolicy (2), +.BR shmat (2), +.BR shmget (2), +.BR numa (3), +.BR cpuset (7), +.BR numa (7), +.BR numactl (8) diff --git a/draft/man2/mincore.2 b/draft/man2/mincore.2 new file mode 100644 index 00000000..80193f56 --- /dev/null +++ b/draft/man2/mincore.2 @@ -0,0 +1,287 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2001 Bert Hubert +.\" 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. +.\" +.\" Created Sun Jun 3 17:23:32 2001 by bert hubert +.\" Slightly adapted, following comments by Hugh Dickins, aeb, 2001-06-04. +.\" Modified, 20 May 2003, Michael Kerrisk +.\" Modified, 30 Apr 2004, Michael Kerrisk +.\" 2005-04-05 mtk, Fixed error descriptions +.\" 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 ºÇ²¼°Ì¥Ó¥Ã¥È +.\" +.TH MINCORE 2 2008-04-22 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mincore \- determine whether pages are resident in memory +mincore \- ¥Ú¡¼¥¸¤¬¥á¥â¥êÆâ¤Ë¤¢¤ë¤«¤É¤¦¤«¤òȽÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int mincore(void *" addr ", size_t " length ", unsigned char *" vec ); +.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 mincore (): +_BSD_SOURCE || _SVID_SOURCE +.\"O .SH DESCRIPTION +.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 +¥Ð¥¤¥È¤ÎÈϰϤΥڡ¼¥¸¤Ë´Ø¤¹¤ë¸ºß¾ðÊó¤òÊÖ¤¹¡£ + +.\"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) +¤ò»È¤Ã¤ÆÆþ¼ê¤Ç¤­¤ë¡£ + +.\"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" +.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 +.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 +¤¬ÊÖ¤µ¤ì¤Æ¤¤¤¿¡£ +.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. +.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. +.\" .BR mincore () +.\" ´Ø¿ô¤Ï 4.4BSD ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "BUGS" +.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 ¤Î¸½ºß¤Ë»ê¤ë¤Þ¤Ç)¡¢ +.\" .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 ¥Õ¥¡¥¤¥ë¥Þ¥Ã¥Ô¥ó¥°¤Ë¤Ä¤¤¤Æ¡¢ +.\" .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 ¥Þ¥Ã¥Ô¥ó¥°¤Ë¤Ä¤¤¤Æ¡¢ +.\" .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 ¥Þ¥Ã¥Ô¥ó¥°¤Ë¤Ä¤¤¤Æ¡¢ +.\" .B mincore +.\" ¤Ï¾ï¤Ë +.\" .B ENOMEM +.\" ¤Ç¼ºÇÔ¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mlock (2), +.BR mmap (2) diff --git a/draft/man2/mkdir.2 b/draft/man2/mkdir.2 new file mode 100644 index 00000000..aab527c4 --- /dev/null +++ b/draft/man2/mkdir.2 @@ -0,0 +1,235 @@ +.\" 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 new file mode 100644 index 00000000..3d0c5c6a --- /dev/null +++ b/draft/man2/mkdirat.2 @@ -0,0 +1,190 @@ +.\" 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-09-30 by Yuichi SATO , LDP v2.39 +.\" +.TH MKDIRAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "int mkdirat(int " dirfd ", const char *" pathname ", mode_t " mode ); +.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 mkdirat (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.\"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) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.\"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) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.\"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) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I pathname +.\"O is absolute, then +.\"O .I dirfd +.\"O is ignored. +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.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 +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR mkdirat () +.\"O was added to Linux in kernel 2.6.16. +.BR mkdirat () +¤Ï 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 mkdirat (). +.\"O +.BR mkdirat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ÀâÌÀ +.BR mkdir (2), +.BR openat (2), +.BR path_resolution (7) diff --git a/draft/man2/mknod.2 b/draft/man2/mknod.2 new file mode 100644 index 00000000..078a27f0 --- /dev/null +++ b/draft/man2/mknod.2 @@ -0,0 +1,379 @@ +.\" 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. +.\" +.\" Modified 1996-08-18 by urs +.\" Modified 2003-04-23 by Michael Kerrisk +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated 1997-06-26, SUTO, Mitsuaki +.\" Updated & Modified 1999-03-01, NAKANO Takeo +.\" Updated & Modified 2001-06-04, Yuichi SATO +.\" Updated & Modified 2003-07-26, Yuichi SATO +.\" Updated & Modified 2004-12-31, Yuichi SATO +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" +.\"WORD: node ¥Î¡¼¥É +.\"WORD: permission µö²Ä°À­ +.\"WORD: resolve (¥Ñ¥¹Ì¾¤ò) ²ò·è¤¹¤ë +.\" +.TH MKNOD 2 2008-12-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mknod \- create a special or ordinary file +mknod \- Æüì¥Õ¥¡¥¤¥ë¤äÄ̾ï¤Î¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.B #include +.sp +.BI "int mknod(const char *" pathname ", mode_t " mode ", dev_t " dev ); +.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 mknod (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The system call +.\"O .BR mknod () +.\"O creates a file system node (file, device special file or +.\"O named pipe) named +.\"O .IR pathname , +.\"O with attributes specified by +.\"O .I mode +.\"O and +.\"O .IR dev . +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR mknod () +¤Ï +.I pathname +¤È¤¤¤¦Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥Î¡¼¥É +(¥Õ¥¡¥¤¥ë¡¢¥Ç¥Ð¥¤¥¹¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¡¢Ì¾Á°ÉÕ¤­¥Ñ¥¤¥×) ¤ò¡¢ +°À­ +.I mode +¤È +.I dev +¤Î»ØÄê¤Ë¤·¤¿¤¬¤Ã¤ÆºîÀ®¤¹¤ë¡£ + +.\"O The +.\"O .I mode +.\"O argument specifies both the permissions to use and the type of node +.\"O to be created. +.I mode +°ú¤­¿ô¤Ë¤Ï¡¢ºîÀ®¤¹¤ë¥Î¡¼¥É¤Îµö²Ä°À­ (permission) ¤È¥¿¥¤¥×¤ò»ØÄꤹ¤ë¡£ +.\"O It should be a combination (using bitwise OR) of one of the file types +.\"O listed below and the permissions for the new node. +.I mode +¤Î»ØÄê¤Ï°Ê²¼¤Ë¤¢¤²¤ë¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤Î¤¦¤Á¤Î 1 ¤Ä¤È¡¢ +µö²Ä°À­¤ÎÁȹ礻 (¥Ó¥Ã¥È¤´¤È¤Î OR ¤ò»ÈÍÑ) ¤Ç¹Ô¤¦¡£ + +.\"O The permissions are modified by the process's +.\"O .I umask +.\"O in the usual way: the permissions of the created node are +.\"O .IR "(mode & ~umask)" . +µö²Ä°À­¤ÏÄ̾ïÄ̤ꡢ¥×¥í¥»¥¹¤Î +.I umask +¤Ë¤è¤Ã¤Æ½¤Àµ¤µ¤ì¡¢ºîÀ®¤µ¤ì¤¿¥Î¡¼¥É¤Îµö²Ä°À­¤Ï +.I "(mode & ~umask)" +¤È¤Ê¤ë¡£ + +.\"O The file type must be one of +.\"O .BR S_IFREG , +.\"O .BR S_IFCHR , +.\"O .BR S_IFBLK , +.\"O .B S_IFIFO +.\"O or +.\"O .B S_IFSOCK +.\"O .\" (S_IFSOCK since Linux 1.2.4) +.\"O to specify a regular file (which will be created empty), character +.\"O special file, block special file, FIFO (named pipe), or Unix domain socket, +.\"O respectively. +.\"O (Zero file type is equivalent to type +.\"O .BR S_IFREG .) +¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤Ë¤Ï +.BR S_IFREG , +.BR S_IFCHR , +.BR S_IFBLK , +.BR S_IFIFO , +.B S_IFSOCK +.\" (S_IFSOCK ¤Ï Linux 1.2.4 ¤«¤é¸ºß¤¹¤ë) +¤Î¤¤¤º¤ì¤«¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤½¤ì¤¾¤ì½ç¤Ë¡¢Ä̾ï¤Î¥Õ¥¡¥¤¥ë (¶õ¤Î¥Õ¥¡¥¤¥ë¤È¤·¤ÆºîÀ®¤µ¤ì¤ë)¡¦ +¥­¥ã¥é¥¯¥¿¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¡¦¥Ö¥í¥Ã¥¯¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¡¦ +FIFO (̾Á°ÉÕ¤­¥Ñ¥¤¥×)¡¦Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤Ç¤¢¤ë +(¥Õ¥¡¥¤¥ë¥¿¥¤¥× 0 ¤Ï +.B S_IFREG +¤ÈƱ¤¸¤Ç¤¢¤ë)¡£ + +.\"O If the file type is +.\"O .B S_IFCHR +.\"O or +.\"O .B S_IFBLK +.\"O then +.\"O .I dev +.\"O specifies the major and minor numbers of the newly created device +.\"O special file +.\"O .RB ( makedev (3) +.\"O may be useful to build the value for +.\"O .IR dev ); +.\"O otherwise it is ignored. +¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤¬ +.B S_IFCHR +¤Þ¤¿¤Ï +.B S_IFBLK +¤Î¤È¤­¡¢ +.I dev +¤Ë¤ÏºîÀ®¤¹¤ë¥Ç¥Ð¥¤¥¹¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Î¥á¥¸¥ã¡¼ÈÖ¹æ¤È +¥Þ¥¤¥Ê¡¼ÈÖ¹æ¤ò»ØÄꤹ¤ë +.RB ( makedev (3) +¤Ï +.I dev +¤Î¤³¤ì¤é¤ÎÈÖ¹æ¤òºîÀ®¤¹¤ëºÝ¤ËÌòΩ¤Ä¤À¤í¤¦)¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï +.I dev +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I pathname +.\"O already exists, or is a symbolic link, this call fails with an +.\"O .B EEXIST +.\"O error. +.I pathname +¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢¤Þ¤¿¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¡¢ +¤³¤Î¸Æ¤Ó½Ð¤·¤Ï +.B EEXIST +¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¡£ + +.\"O The newly created node will be owned by the effective user ID of the +.\"O process. +.\"O If the directory containing the node has the set-group-ID +.\"O bit set, or if the file system is mounted with BSD group semantics, the +.\"O new node will inherit the group ownership from its parent directory; +.\"O otherwise it will be owned by the effective group ID of the process. +¿·¤·¤¯ºîÀ®¤µ¤ì¤¿¥Î¡¼¥É¤Î½êÍ­¼Ô¤Ï¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +¿·¤¿¤Ëºî¤é¤ì¤¿¥Î¡¼¥É¤òÊÝ»ý¤¹¤ë +¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î set-group-ID ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¤ê¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ BSD ¤Î¥°¥ë¡¼¥×¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤Ë¤·¤¿¤¬¤Ã¤Æ +¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¿·¤·¤¤¥Î¡¼¥É¤Î¥°¥ë¡¼¥×½êÍ­¸¢¤Ï¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î +¥°¥ë¡¼¥×½êÍ­¸¢¤ò·Ñ¾µ¤¹¤ë (¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤ÈƱ¤¸¤Ë¤Ê¤ë)¡£ +¤Þ¤¿¡¢¤½¤¦¤Ç¤Ê¤«¤Ã¤¿¾ì¹ç¤Î½êÍ­¥°¥ë¡¼¥×¤Ï¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤È¤Ê¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O .BR mknod () +.\"O returns zero on success, or \-1 if an error occurred (in which case, +.\"O .I errno +.\"O is set appropriately). +.BR mknod () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç 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 the path prefix of +.\"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. +.\"O This includes the case where +.\"O .I pathname +.\"O is a symbolic link, dangling or not. +.I pathname +¤¬´û¤Ë¸ºß¤¹¤ë¡£ +¤³¤ì¤Ë¤Ï +.I pathname +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¤â´Þ¤Þ¤ì¤ë +(¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬²õ¤ì¤Æ¤¤¤ë¤« (dangling) ¤É¤¦¤«¤Ï´Ø·¸¤Ê¤¤)¡£ +.TP +.B EFAULT +.\"O .IR pathname " points outside your accessible address space." +.I pathname +¤¬¤½¤Î¥×¥í¥»¥¹¤Î¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O .I mode +.\"O requested creation of something other than a regular file, device +.\"O special file, FIFO or socket. +.I mode +¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥Ð¥¤¥¹¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¡¦FIFO¡¦¥½¥±¥Ã¥È°Ê³°¤ò +ºîÀ®¤¹¤ë¤è¤¦¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.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 node. +.I pathname +¤Î¤¢¤ë¥Ç¥Ð¥¤¥¹¤Ë¿·¤¿¤Ë¥Î¡¼¥É¤òºîÀ®¤¹¤ë¶õ¤­¤¬Ìµ¤¤¡£ +.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 .I mode +.\"O requested creation of something other than a regular file, +.\"O FIFO (named pipe), or Unix domain socket, and the caller +.\"O is not privileged (Linux: does not have the +.\"O .B CAP_MKNOD +.\"O capability); +.\"O .\" For Unix domain sockets and regular files, EPERM is only returned in +.\"O .\" Linux 2.2 and earlier; in Linux 2.4 and later, unprivileged can +.\"O .\" use mknod() to make these files. +.\"O also returned if the file system containing +.\"O .I pathname +.\"O does not support the type of node requested. +.I mode +¤ÏÄ̾ï¤Î¥Õ¥¡¥¤¥ë¡¦FIFO (̾Á°ÉÕ¤­¥Ñ¥¤¥×)¡¦Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È°Ê³°¤ò +ºîÀ®¤¹¤ë¤è¤¦¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¼Â¹Ô¼Ô¤¬Æø¢ +(Linux ¤Ç¤Ï +.B CAP_MKNOD +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability)) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.\" Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤ÈÄ̾ï¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ mknod() ¤ò¹Ô¤¦¤È¡¢ +.\" Linux 2.2 °ÊÁ°¤Ç¤Ï EPERM ¤òÊÖ¤¹¤À¤±¤Ç¤¢¤ë¡£ +.\" Linux 2.4 °Ê¹ß¤Ç¤ÏÆø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¯¤Æ¤â¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤ò +.\" ºîÀ®¤¹¤ë¤Î¤Ë mknod() ¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤Þ¤¿¤Ï +.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, 4.4BSD, POSIX.1-2001 (but see below). +.\"O .\" The Linux version differs from the SVr4 version in that it +.\"O .\" does not require root permission to create pipes, also in that no +.\"O .\" EMULTIHOP, ENOLINK, or EINTR error is documented. +SVr4, 4.4BSD, POSIX.1-2001 (²¼µ­¤â»²¾È). +.\" Linux ¤Î¼ÂÁõ¤Ï SVr4 ¤Î¼ÂÁõ¤È°Û¤Ê¤ê¡¢¥Ñ¥¤¥×¤ÎºîÀ®¤Ë¤Ï root ¸¢¸Â¤¬ÉÔÍפǤ¢¤ë¡£ +.\" ¤Þ¤¿ EMULTIHOP ¤È ENOLINK ¤È EINTR ¤Î¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O POSIX.1-2001 says: "The only portable use of +.\"O .BR mknod () +.\"O is to create a FIFO-special file. +.\"O If +.\"O .I mode +.\"O is not +.\"O .B S_IFIFO +.\"O or +.\"O .I dev +.\"O is not 0, the behavior of +.\"O .BR mknod () +.\"O is unspecified." +POSIX.1-2001 ¤Ç¤Ï¼¡¤Î¤è¤¦¤Ë½ñ¤¤¤Æ¤¤¤ë¡§ +.RB ¡Ö mknod () +¤ÎÍ£°ì¤Î°Ü¿¢À­¤Î¤¢¤ë»ÈÍÑË¡¤Ï¡¢FIFO ¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +.I mode +¤¬ +.B S_IFIFO +¤Ç¤Ï¤Ê¤¤¾ì¹ç¡¢¤Þ¤¿¤Ï +.I dev +¤¬ 0 ¤Ç¤Ï¤Ê¤¤¾ì¹ç¡¢ +.BR mknod () +¤ÎµóÆ°¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£¡× +.\"O However, nowadays one should never use +.\"O .BR mknod () +.\"O for this purpose; one should use +.\"O .BR mkfifo (3), +.\"O a function especially defined for this purpose. +¤·¤«¤·¤Ê¤¬¤é¡¢¸½ºß¤Ç¤Ï¤³¤ÎÌÜŪ¤Î¤¿¤á¤Ë +.BR mknod () +¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£¤³¤ÎÌÜŪ¤Î¤¿¤á¤ËÆÃÊ̤ËÄêµÁ¤µ¤ì¤¿´Ø¿ô¤Ç¤¢¤ë +.BR mkfifo () +¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O Under Linux, this call cannot be used to create directories. +Linux ¤Ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë¤¿¤á¤Ë +¤³¤Î¸Æ¤Ó½Ð¤·¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\"O One should make directories with +.\"O .BR mkdir (2). +¥Ç¥£¥ì¥¯¥È¥ê¤Ï +.BR mkdir (2) +¤ÇºîÀ®¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .\" and one should make Unix domain sockets with socket(2) and bind(2). +.\" Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤Ï socket(2) ¤È bind(2) ¤ÇºîÀ®¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O There are many infelicities in the protocol underlying NFS. +.\"O Some of these affect +.\"O .BR mknod (). +NFS ¤ò¼Â¸½¤·¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¤Ë¤Ï¿¤¯¤ÎÉÔÈ÷¤¬Â¸ºß¤·¡¢ +¤½¤ì¤é¤Î¤¤¤¯¤Ä¤«¤Ï +.BR mknod () +¤Ë±Æ¶Á¤òÍ¿¤¨¤ë¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR chmod (2), +.BR chown (2), +.BR fcntl (2), +.BR mkdir (2), +.BR mknodat (2), +.BR mount (2), +.BR socket (2), +.BR stat (2), +.BR umask (2), +.BR unlink (2), +.BR makedev (3), +.BR mkfifo (3), +.BR path_resolution (7) diff --git a/draft/man2/mknodat.2 b/draft/man2/mknodat.2 new file mode 100644 index 00000000..dae73665 --- /dev/null +++ b/draft/man2/mknodat.2 @@ -0,0 +1,192 @@ +.\" 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-09-30 by Yuichi SATO , LDP v2.39 +.\" +.TH MKNODAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mknodat \- create a special or ordinary file relative to a directory +.\"O file descriptor +mknodat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˡ¢ +Æüì¥Õ¥¡¥¤¥ë¤äÄ̾ï¤Î¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.\"O .B #include /* Definition of AT_* constants */ +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int mknodat(int " dirfd ", const char *" pathname ", mode_t " mode \ +", dev_t " dev ); +.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 mknodat (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.\"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) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.\"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) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.\"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) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I pathname +.\"O is absolute, then +.\"O .I dirfd +.\"O is ignored. +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.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 +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR mknodat () +.\"O was added to Linux in kernel 2.6.16. +.BR mknodat () +¤Ï 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 mknodat (). +.BR mknodat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mknod (2), +.BR openat (2), +.BR path_resolution (7) diff --git a/draft/man2/mlock.2 b/draft/man2/mlock.2 new file mode 100644 index 00000000..e8823e89 --- /dev/null +++ b/draft/man2/mlock.2 @@ -0,0 +1,577 @@ +.\" 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 new file mode 100644 index 00000000..e58589af --- /dev/null +++ b/draft/man2/mmap.2 @@ -0,0 +1,1118 @@ +.\" 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 new file mode 100644 index 00000000..43add67c --- /dev/null +++ b/draft/man2/mmap2.2 @@ -0,0 +1,150 @@ +.\" 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/modify_ldt.2 b/draft/man2/modify_ldt.2 new file mode 100644 index 00000000..a56dc241 --- /dev/null +++ b/draft/man2/modify_ldt.2 @@ -0,0 +1,219 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@duracef.shout.net), 22 July 1995. +.\" +.\" 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 & Modified 2005-02-24, Yuichi SATO +.\" Updated 2007-06-18, Akihiro MOTOKI , LDP v2.57 +.\" +.\"WORD: ldt ldt +.\"WORD: local descriptor table ¥í¡¼¥«¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Æ¡¼¥Ö¥ë +.\"WORD: processer ¥×¥í¥»¥Ã¥µ +.\"WORD: entry ¥¨¥ó¥È¥ê +.\" +.TH MODIFY_LDT 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O modify_ldt \- get or set ldt +modify_ldt \- ldt ¤òÀßÄê¤Þ¤¿¤Ï¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int modify_ldt(int " "func" ", void *" "ptr" ", unsigned long " "bytecount" ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR modify_ldt () +.\"O reads or writes the local descriptor table (ldt) for a process. +.\"O The ldt is a per-process memory management table used by the i386 processor. +.\"O For more information on this table, see an Intel 386 processor handbook. +.BR modify_ldt () +¤Ï¥×¥í¥»¥¹¤Î¥í¡¼¥«¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Æ¡¼¥Ö¥ë (local descriptor table; ldt) +¤òÆɤ߽ñ¤­¤¹¤ë¡£ +ldt ¤Ï i386 ¥×¥í¥»¥Ã¥µ¤Ç»ÈÍѤµ¤ì¤ë¥×¥í¥»¥¹¤´¤È¤Î¥á¥â¥ê´ÉÍý¥Æ¡¼¥Ö¥ë¤Ç¤¢¤ë¡£ +¤³¤Î¥Æ¡¼¥Ö¥ë¤Ë´Ø¤·¤Æ¤Î¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï Intel 386 processor handbook ¤ò +»²¾È¤¹¤ë¤³¤È¡£ +.PP +.\"O When +.\"O .I func +.\"O is 0, +.\"O .BR modify_ldt () +.\"O reads the ldt into the memory pointed to by +.\"O .IR ptr . +.I func +¤¬ 0 ¤Ê¤é¤Ð¡¢ +.BR modify_ldt () +¤Ï ldt ¤ò +.I ptr +¤¬»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤ËÆɤ߹þ¤à¡£ +.\"O The number of bytes read is the smaller of +.\"O .I bytecount +.\"O and the actual size of the ldt. +Æɤ߹þ¤à¥Ð¥¤¥È¿ô¤Ï¼ÂºÝ¤Î ldt ¤Î¥µ¥¤¥º¤« +.I bytecount +¤è¤ê¾®¤µ¤¤Êý¤Ç¤¢¤ë¡£ +.PP +.\"O When +.\"O .I func +.\"O is 1, +.\"O .BR modify_ldt () +.\"O modifies one ldt entry. +.I func +¤¬ 1 ¤Ê¤é¤Ð¡¢ +.BR modify_ldt () +¤Ï ldt ¥¨¥ó¥È¥ê¤Î°ì¤Ä¤òÊѹ¹¤¹¤ë¡£ +.\"O .I ptr +.\"O points to a +.\"O .I user_desc +.\"O structure +.\"O and +.\"O .I bytecount +.\"O must equal the size of this structure. +.I ptr +¤Ï +.I user_desc +¹½Â¤ÂΤò»Ø¤·¡¢ +.I bytecount +¤Ï¤³¤Î¹½Â¤ÂΤÎÂ礭¤µ¤ËÅù¤·¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" +.\" FIXME ? say something about func == 2 ans func == 0x11? +.\" In Linux 2.4, func == 2 returned "the default ldt" +.\" In Linux 2.6, func == 2 is a nop, returning a zeroed out structure. +.\" Linux 2.4 and 2.6 implement an operation for func == 0x11 + +.\"O The +.\"O .I user_desc +.\"O structure is defined in \fI\fP as: +.I user_desc +¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +struct user_desc { + unsigned int entry_number; + unsigned long base_addr; + unsigned int limit; + unsigned int seg_32bit:1; + unsigned int contents:2; + unsigned int read_exec_only:1; + unsigned int limit_in_pages:1; + unsigned int seg_not_present:1; + unsigned int useable:1; +}; +.fi +.in +.PP +.\"O In Linux 2.4 and earlier, this structure was named +.\"O .IR modify_ldt_ldt_s . +Linux 2.4 °ÊÁ°¤Ç¤Ï¡¢¤³¤Î¹½Â¤ÂÎ¤Ï +.I modify_ldt_ldt_s +¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤Ã¤¿¡£ +.\" .PP +.\"O .\" The ldt is specific for the calling process. Any attempts to change +.\"O .\" the ldt to include the address space of another process or the kernel +.\"O .\" will result in a segmentation violation when trying to access the memory +.\"O .\" outside of the process address space. The memory protection is enforced +.\"O .\" at the paging layer. +.\" ldt ¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.\" ¾¤Î¥×¥í¥»¥¹¤ä¥«¡¼¥Í¥ë¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ò´Þ¤à¤è¤¦¤Ë ldt ¤òÊѹ¹¤·¤è¤¦¤¹¤ë¤È¡¢ +.\" ¥×¥í¥»¥¹¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Î¥á¥â¥ê¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤¿¤È¤­¤Ë¡¢ +.\" ¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó°ãÈ¿ (segmentation violation) ¤Ë¤Ê¤ë¡£ +.\" ¥á¥â¥êÊݸî¤Ï¥Ú¡¼¥¸¥ó¥°¥ì¥¤¥ä¤Ç¼Â»Ü¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR modify_ldt () +.\"O returns either the actual number of bytes read (for reading) +.\"O or 0 (for writing). +À®¸ù¤·¤¿¾ì¹ç¤Ï¡¢ +.BR modify_ldt () +¤Ï (Æɤ߹þ¤ß¤Î¾ì¹ç¤Ï) ¼ÂºÝ¤ËÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¡¢ +¤Þ¤¿¤Ï (½ñ¤­¹þ¤ß¤Î¾ì¹ç¤Ï) 0 ¤òÊÖ¤¹¡£ +.\"O On failure, +.\"O .BR modify_ldt () +.\"O returns \-1 and sets +.\"O .I errno +.\"O to indicate the error. +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï +.BR modify_ldt () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O .I ptr +.\"O points outside the address space. +.I ptr +¤¬¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O .I ptr +.\"O is 0, +.\"O or +.\"O .I func +.\"O is 1 and +.\"O .I bytecount +.\"O is not equal to the size of the structure +.\"O .IR modify_ldt_ldt_s , +.\"O or +.\"O .I func +.\"O is 1 and the new ldt entry has invalid values. +.I ptr +¤¬ 0 ¤Ç¤¢¤ë¡¢ +¤Þ¤¿¤Ï +.I func +¤¬ 1 ¤Ç +.I bytecount +¤¬ +.I modify_ldt_ldt_s +¹½Â¤ÂΤΥµ¥¤¥º¤ÈÅù¤·¤¯¤Ê¤¤¤«¡¢ +.I func +¤¬ 1 ¤Ç¿·¤·¤¤ ldt ¥¨¥ó¥È¥ê¤¬Ìµ¸ú¤ÊÃͤǤ¢¤ë¡£ +.TP +.B ENOSYS +.\"O .I func +.\"O is neither 0 nor 1. +.I func +¤¬ 0 ¤Ç¤â 1 ¤Ç¤â¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This call is Linux-specific and should not be used in programs intended +.\"O to be portable. +¤³¤Î¥³¡¼¥ë¤Ï 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 .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR vm86 (2) diff --git a/draft/man2/mount.2 b/draft/man2/mount.2 new file mode 100644 index 00000000..fe002538 --- /dev/null +++ b/draft/man2/mount.2 @@ -0,0 +1,797 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1993 Rickard E. Faith +.\" and Copyright (C) 1994 Andries E. Brouwer +.\" and Copyright (C) 2002, 2005 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 1996-11-04 by Eric S. Raymond +.\" Modified 2001-10-13 by Michael Kerrisk +.\" Added note on historical behavior of MS_NOSUID +.\" Modified 2002-05-16 by Michael Kerrisk +.\" Extensive changes and additions +.\" Modified 2002-05-27 by aeb +.\" Modified 2002-06-11 by Michael Kerrisk +.\" Enhanced descriptions of MS_MOVE, MS_BIND, and MS_REMOUNT +.\" Modified 2004-06-17 by Michael Kerrisk +.\" 2005-05-18, mtk, Added MNT_EXPIRE, plus a few other tidy-ups. +.\" 2008-10-06, mtk: move umount*() material into separate umount.2 page. +.\" 2008-10-06, mtk: Add discussion of namespaces. +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated 1997-06-26,SUTO, Mitsuaki +.\" Updated 2001-05-20, Kentaro Shirakata +.\" Updated 2001-06-25, Kentaro Shirakata +.\" Updated 2001-10-15, Kentaro Shirakata +.\" Updated 2002-01-01, Kentaro Shirakata +.\" Updated 2002-11-24, Kentaro Shirakata +.\" Updated 2003-01-27, Kentaro Shirakata +.\" Updated 2005-02-28, Akihiro MOTOKI +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2006-07-23, Akihiro MOTOKI, LDP v2.36 +.\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-11-10, Akihiro MOTOKI, LDP v3.11 +.\" Updated 2010-04-23, Akihiro MOTOKI, LDP v3.24 +.\" +.\"WORD: lazy umount Ãٱ䥢¥ó¥Þ¥¦¥ó¥È +.\"WORD: Linux-specific Linux ÆÃÍ­ +.\" +.\" motoki 2005-02-28: +.\" - subtree ¤ò¤É¤¦Ìõ¤¹¤«¡£ÉôʬÌÚ¡¢Éôʬ¥Ä¥ê¡¼¡¢¥µ¥Ö¥Ä¥ê¡¼¡£¡£¡£²¿¤«¤Ê¤¤¤«¡£ +.\" +.TH MOUNT 2 2009-06-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mount \- mount and unmount file systems +mount \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥Þ¥¦¥ó¥È/¥¢¥ó¥Þ¥¦¥ó¥È¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int mount(const char *" source ", const char *" target , +.BI " const char *" filesystemtype ", unsigned long " mountflags , +.BI " const void *" data ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR mount () +.\"O attaches the file system specified by +.\"O .I source +.\"O (which is often a device name, but can also be a directory name +.\"O or a dummy) to the directory specified by +.\"O .IR target . +.BR mount () +¤Ï +.I source +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à (¥Ç¥Ð¥¤¥¹Ì¾¤Ç¤¢¤ë¤³¤È¤¬Â¿¤¤¤¬¡¢ +¥Ç¥£¥ì¥¯¥È¥ê̾¤ä¥À¥ß¡¼¤Î¾ì¹ç¤â¤¢¤ë) ¤ò +.I target +¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë·ë¤Ó¤Ä¤±¤ë¡£ + +.\"O Appropriate privilege (Linux: the +.\"O .B CAP_SYS_ADMIN +.\"O capability) is required to mount file systems. +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¤ò¹Ô¤¦¤Ë¤Ï¡¢ +ŬÀڤʸ¢¸Â (Linux ¤Ç¤Ï +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤¬É¬ÍפǤ¢¤ë¡£ + +.\"O Since Linux 2.4 a single file system can be visible at +.\"O multiple mount points, and multiple mounts can be stacked +.\"O on the same mount point. +.\"O .\" Multiple mounts on same mount point: since 2.3.99pre7. +Linux 2.4 °Ê¹ß¡¢¤Ò¤È¤Ä¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÊ£¿ô¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë +·ë¤Ó¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¡¢Æ±¤¸¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ËÊ£¿ô¤Î¥Þ¥¦¥ó¥È¤ò¥¹¥¿¥Ã¥¯ +¤µ¤»¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.\" Multiple mounts on same mount point: since 2.3.99pre7. + +.\"O Values for the +.\"O .I filesystemtype +.\"O argument supported by the kernel are listed in +.\"O .I /proc/filesystems +.\"O (like "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", +.\"O "msdos", "proc", "nfs", "iso9660" etc.). +.\"O Further types may become available when the appropriate modules +.\"O are loaded. +°ú¤­¿ô +.I filesystemtype +¤È¤·¤Æ¥«¡¼¥Í¥ë¤¬Âбþ¤·¤Æ¤¤¤ëÃͤϡ¢ +.I /proc/filesystems +¤Ç»²¾È¤Ç¤­¤ë (Î㤨¤Ð "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", +"msdos", "proc", "nfs", "iso9660" Åù)¡£ +ŬÀڤʥ⥸¥å¡¼¥ë¤¬Æɤ߹þ¤Þ¤ì¤ë¤È¡¢¤µ¤é¤ËÊ̤ÎÃͤ¬ÍøÍѲÄǽ¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + +.\"O The +.\"O .I mountflags +.\"O argument may have the magic number 0xC0ED (\fBMS_MGC_VAL\fP) +.\"O in the top 16 bits (this was required in kernel versions prior to 2.4, but +.\"O is no longer required and ignored if specified), +.\"O and various mount flags (as defined in \fI\fP for libc4 and libc5 +.\"O and in \fI\fP for glibc2) in the low order 16 bits: +°ú¤­¿ô +.I mountflags +¤Ï¡¢ÀèƬ 16 ¥Ó¥Ã¥È¤Ï¥Þ¥¸¥Ã¥¯¥Ê¥ó¥Ð¡¼ 0xC0ED (\fBMS_MGC_VAL\fP) ¤Ç¡¢ +»Ä¤ê¤Î 16 ¥Ó¥Ã¥È¤¬¥Þ¥¦¥ó¥È¥Õ¥é¥°¤Ç¤¢¤ë¡£ +¥Þ¥¸¥Ã¥¯¥Ê¥ó¥Ð¡¼¤Ï¡¢¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó 2.4 ¤è¤êÁ°¤Ç¤Ïɬ¿Ü¤Ç¤¢¤Ã¤¿¤¬¡¢ +¸½ºß¤ÏɬÍפʤ¯¡¢»ØÄꤵ¤ì¤Æ¤â̵»ë¤µ¤ì¤ë¡£ +¥Þ¥¦¥ó¥È¥Õ¥é¥°¤Ï libc4 ¤È libc5 ¤Ç¤Ï \fI\fP ¡¢ +glibc2 ¤Ç¤Ï \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.\" FIXME 2.6.15 added flags for "shared subtree" functionality: +.\" MS_UNBINDABLE, MS_PRIVATE, MS_SHARED, MS_SLAVE +.\" These need to be documented on this page. +.\" See: +.\" Documentation/filesystems/sharedsubtree.txt +.\" +.\" http://lwn.net/Articles/159077/ +.\" +.\" http://myweb.sudhaa.com:2022/~ram/sharedsubtree/paper/sharedsubtree.1.pdf +.\" Shared-Subtree Concept, Implementation, and Applications in Linux +.\" Al Viro viro@ftp.linux.org.uk +.\" Ram Pai linuxram@us.ibm.com +.\" +.\" http://foss.in/2005/slides/sharedsubtree1.pdf +.\" Shared Subtree Concept and Implementation in the Linux Kernel +.\" Ram Pai +.\" +.\" 2.6.25 Added MS_I_VERSION, which needs to be documented. +.\" +.TP +.\"O .BR MS_BIND " (Linux 2.4 onwards)" +.BR MS_BIND " (Linux 2.4 °Ê¹ß)" +.\"O .\" since 2.4.0-test9 +.\" Àµ³Î¤Ë¤Ï 2.4.0-test9 °Ê¹ß +.\"O Perform a bind mount, making a file or a directory subtree visible at +.\"O another point within a file system. +.\"O Bind mounts may cross file system boundaries and span +.\"O .BR chroot (2) +.\"O jails. +.\"O The +.\"O .IR filesystemtype +.\"O and +.\"O .IR data +.\"O arguments are ignored. +.\"O Up until Linux 2.6.26, +.\"O .I mountflags +.\"O was also ignored +.\"O .\" with the exception of the "hidden" MS_REC mountflags bit +.\"O (the bind mount has the same mount options as +.\"O the underlying mount point). +¥Ð¥¤¥ó¥É¥Þ¥¦¥ó¥È¤ò¹Ô¤¦¡£¤³¤ì¤Ï¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤ÎÉôʬÌÚ¤ò +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâÉô¤ÎÊ̤ξì½ê¤Ç¸«¤¨¤ë¤è¤¦¤Ë¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¥Ð¥¤¥ó¥É¥Þ¥¦¥ó¥È¤ò»È¤¦¤È¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¤Þ¤¿¤¤¤Ç +.BR chroot (2) +jail ¤ò¹½À®¤¹¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤ë¡£ +°ú¤­¿ô +.I filesystemtype +¤È +.I data +¤Ï̵»ë¤µ¤ì¤ë¡£ +Linux 2.6.26 ¤è¤êÁ°¤Ç¤Ï +.I mountflags +¤â̵»ë¤µ¤ì¤Æ¤¤¤¿ +.\" with the exception of the "hidden" MS_REC mountflags bit +(¥Ð¥¤¥ó¥É¥Þ¥¦¥ó¥È¤Ç¤Ï¡¢¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤È¤Ê¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È +Ʊ¤¸¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó¤¬»ÈÍѤµ¤ì¤ë)¡£ +.\"O Since Linux 2.6.26, the +.\"O .B MS_RDONLY +.\"O flag is honored when making a bind mount. +Linux 2.6.26 °Ê¹ß¤Ç¤Ï¡¢¥Ð¥¤¥ó¥É¥Þ¥¦¥ó¥È¤ò¹Ô¤¦ºÝ¤Ë +.B MS_RDONLY +¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤Ê¤¤¡£ +.TP +.\"O .BR MS_DIRSYNC " (Since Linux 2.5.19)" +.BR MS_DIRSYNC " (Linux 2.5.19 °Ê¹ß)" +.\"O Make directory changes on this file system synchronous. +.\"O (This property can be obtained for individual directories +.\"O or subtrees using +.\"O .BR chattr (1).) +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î¥Ç¥£¥ì¥¯¥È¥êÊѹ¹¤òƱ´üŪ¤Ë¹Ô¤¦¡£ +(¤³¤ÎÆÃÀ­¤Ï¸Ä¡¹¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¢¤Þ¤¿¤Ï +.BR chattr (1) +¤ò»È¤Ã¤¿ÉôʬÌÚËè¤ËÀßÄê¤Ç¤­¤ë¡£) +.TP +.B MS_MANDLOCK +.\"O Permit mandatory locking on files in this file system. +.\"O (Mandatory locking must still be enabled on a per-file basis, +.\"O as described in +.\"O .BR fcntl (2).) +.\"O .\" FIXME Say more about MS_MOVE +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¶¯À©¥í¥Ã¥¯¤òǧ¤á¤ë¡£ +(¶¯À©¥í¥Ã¥¯¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢ +.BR fcntl (2) +¤Ç½Ò¤Ù¤é¤ì¤Æ¤¤¤ëÊýË¡¤Ç¥Õ¥¡¥¤¥ëñ°Ì¤Çµö²Ä¤ò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤) +.\" FIXME Say more about MS_MOVE +.TP +.B MS_MOVE +.\"O Move a subtree. +.\"O .I source +.\"O specifies an existing mount point and +.\"O .I target +.\"O specifies the new location. +.\"O The move is atomic: at no point is the subtree unmounted. +.\"O The +.\"O .IR filesystemtype ", " mountflags ", and " data +.\"O arguments are ignored. +ÉôʬÌÚ¤ò°ÜÆ°¤¹¤ë¡£ +.I source +¤Ë¤Ï¤¹¤Ç¤Ë¸ºß¤¹¤ë¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò»ØÄꤷ¡¢ +.I target +¤Ë¤Ï¿·¤·¤¤¾ì½ê¤ò»ØÄꤹ¤ë¡£ +°ÜÆ°¤Ï¥¢¥È¥ß¥Ã¥¯¤Ç¤¢¤ë¡£ +Áàºî¤Î¼Â¹ÔÃæ¡¢Éôʬ¥Ä¥ê¡¼¤¬¥¢¥ó¥Þ¥¦¥ó¥È¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.IR filesystemtype ", " mountflags ", " data +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.B MS_NOATIME +.\"O Do not update access times for (all types of) files on this file system. +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î (Á´¤Æ¤Î¼ïÎà¤Î) ¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹»þ¹ï¤ò¹¹¿·¤·¤Ê¤¤¡£ +.TP +.B MS_NODEV +.\"O Do not allow access to devices (special files) on this file system. +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ç¥Ð¥¤¥¹ (¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë) ¤Ø¤Î¥¢¥¯¥»¥¹¤òµö²Ä¤·¤Ê¤¤¡£ +.TP +.B MS_NODIRATIME +.\"O Do not update access times for directories on this file system. +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¥¢¥¯¥»¥¹»þ¹ï¤ò¹¹¿·¤·¤Ê¤¤¡£ +.\"O This flag provides a subset of the functionality provided by +.\"O .BR MS_NOATIME ; +.\"O that is, +.\"O .BR MS_NOATIME +.\"O implies +.\"O .BR MS_NODIRATIME . +¤³¤Î¥Õ¥é¥°¤Ï +.B MS_NOATIME +¤ÇÄ󶡤µ¤ì¤ëµ¡Ç½¤Î¥µ¥Ö¥»¥Ã¥È¤òÄ󶡤¹¤ë¡£¤Ä¤Þ¤ê¡¢ +.B MS_NOATIME +¤Ç¤Ï +.B MS_NODIRATIME +¤¬°ÅÌۤΤ¦¤ÁÀßÄꤵ¤ì¤ë¡£ +.TP +.B MS_NOEXEC +.\"O Do not allow programs to be executed from this file system. +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤¢¤ë¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤òµö²Ä¤·¤Ê¤¤¡£ +.\" (Possibly useful for a file system that contains non-Linux executables. +.\" Often used as a security feature, e.g., to make sure that restricted +.\" users cannot execute files uploaded using ftp or so.) +.TP +.B MS_NOSUID +.\"O Do not honor set-user-ID and set-group-ID bits when executing +.\"O programs from this file system. +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤È¤­¤Ë¡¢ +set-user-ID ¥Ó¥Ã¥È¤È set-group-ID ¥Ó¥Ã¥È¤ò̵»ë¤¹¤ë¡£ +.\" (This is a security feature to prevent users executing set-UID and +.\" set-GID programs from removable disk devices.) +.TP +.B MS_RDONLY +.\"O Mount file system read-only. +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÆɤ߹þ¤ßÀìÍѤǥޥ¦¥ó¥È¤¹¤ë¡£ +.\" +.\" FIXME Document MS_REC, available since 2.4.11. +.\" This flag has meaning in conjunction with MS_BIND and +.\" also with the shared subtree flags. +.TP +.\"O .BR MS_RELATIME " (Since Linux 2.6.20)" +.BR MS_RELATIME " (Linux 2.6.20 °Ê¹ß)" +.\"O When a file on this file system is accessed, +.\"O only update the file's last access time (atime) if the current value +.\"O of atime is less than or equal to the file's last modification time (mtime) +.\"O or last status change time (ctime). +.\"O This option is useful for programs, such as +.\"O .BR mutt (1), +.\"O that need to know when a file has been read since it was last modified. +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤¬¥¢¥¯¥»¥¹¤µ¤ì¤¿ºÝ¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤ÎºÇ½ª¥¢¥¯¥»¥¹»þ¹ï (atime) ¤Î¸½ºßÃͤ¬ +ºÇ½ª½¤Àµ»þ¹ï (mtime) ¤äºÇ½ª¾õÂÖÊѹ¹»þ¹ï (ctime) ¤È +Åù¤·¤¤¤«¾®¤µ¤¤¾ì¹ç¤Ë¤Î¤ß¡¢atime ¤ò¹¹¿·¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.BR mutt (1) +¤Î¤è¤¦¤Ë¡¢ºÇ¸å¤ÎÆâÍƽ¤Àµ°Ê¹ß¤Ë¥Õ¥¡¥¤¥ë¤¬¤¤¤ÄÆɤ߽Фµ¤ì¤¿¤«¤òÃΤë +ɬÍפ¬¤¢¤ë¥×¥í¥°¥é¥à¤ÇÍ­ÍѤǤ¢¤ë¡£ +.\"O Since Linux 2.6.30, the kernel defaults to the behavior provided +.\"O by this flag (unless +.\"O .BR MS_NOATIME +.\"O was specified), and the +.\"O .B MS_STRICTATIME +.\"O flag is required to obtain traditional semantics. +.\"O In addition, since Linux 2.6.30, +.\"O the file's last access time is always updated if it +.\"O is more than 1 day old. +Linux 2.6.30 °Ê¹ß¤Ç¤Ï¡¢ +.B MS_NOATIME +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¤³¤Î¥Õ¥é¥°¤ÎÆ°ºî¤¬ +¥«¡¼¥Í¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÆ°ºî¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢ +Linux 2.6.30 ¤è¤êÁ°¤ÎÆ°ºî¤ò¤µ¤»¤ë¤¿¤á¤Ë¤Ï +.B MS_STRICTATIME +¥Õ¥é¥°¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤ì¤Ë²Ã¤¨¤Æ¡¢Linux 2.6.30 °Ê¹ß¤Ç¤Ï¡¢ +¥Õ¥¡¥¤¥ë¤ÎºÇ½ª¥¢¥¯¥»¥¹»þ¹ï¤¬ 1 Æü°Ê¾åÁ°¤Î¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¤ÎºÇ½ª¥¢¥¯¥»¥¹»þ¹ï¤Ï¾ï¤Ë¹¹¿·¤µ¤ì¤ë¡£ +.\" Matthew Garrett notes in the patch that added this behavior +.\" that this lets utilities such as tmpreaper (which deletes +.\" files based on last acces time) work correctly. +.TP +.B MS_REMOUNT +.\"O Remount an existing mount. +.\"O This allows you to change the +.\"O .I mountflags +.\"O and +.\"O .I data +.\"O of an existing mount without having to unmount and remount the file system. +.\"O .I source +.\"O and +.\"O .I target +.\"O should be the same values specified in the initial +.\"O .BR mount () +.\"O call; +.\"O .I filesystemtype +.\"O is ignored. +¤¹¤Ç¤Ë¸ºß¤¹¤ë¥Þ¥¦¥ó¥È¤òºÆ¥Þ¥¦¥ó¥È¤¹¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¤¹¤Ç¤Ë¸ºß¤¹¤ë¥Þ¥¦¥ó¥È¤Î +.I mountflags +¤È +.I data +¤ò¡¢°ìÅÙ¥¢¥ó¥Þ¥¦¥ó¥È¤·¤Æ¤«¤éºÆ¥Þ¥¦¥ó¥È¤¹¤ë¤È¤¤¤¦ºî¶È¤ò¤»¤º¤Ë +Êѹ¹¤Ç¤­¤ë¡£ +.I source +¤È +.I target +¤ÏºÇ½é¤Î +.BR mount () +¸Æ¤Ó½Ð¤·¤ÈƱ¤¸Ãͤò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ +.I filesystemtype +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"O The following +.\"O .I mountflags +.\"O can be changed: +.\"O .BR MS_RDONLY , +.\"O .BR MS_SYNCHRONOUS , +.\"O .BR MS_MANDLOCK ; +.\"O before kernel 2.6.16, the following could also be changed: +.\"O .B MS_NOATIME +.\"O and +.\"O .BR MS_NODIRATIME ; +.\"O and, additionally, before kernel 2.4.10, the following could also be changed: +.\"O .BR MS_NOSUID , +.\"O .BR MS_NODEV , +.\"O .BR MS_NOEXEC . +.I mountflags +¤Î¤¦¤Á +.BR MS_RDONLY , +.BR MS_SYNCHRONOUS , +.B MS_MANDLOCK +¤ÏÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.6.16 ¤è¤êÁ°¤Ç¤Ï¡¢ +.BR MS_NOATIME , +.B MS_NODIRATIME +¤âÊѹ¹²Äǽ¤Ç¤¢¤Ã¤¿¡£ +¥«¡¼¥Í¥ë 2.4.10 ¤è¤êÁ°¤Ç¤Ï¡¢¾åµ­¤Ë²Ã¤¨¤Æ¡¢ +.BR MS_NOSUID , +.BR MS_NODEV , +.B MS_NOEXEC +¤âÊѹ¹²Äǽ¤Ç¤¢¤Ã¤¿¡£ +.TP +.\"O .BR MS_SILENT " (since Linux 2.6.17)" +.BR MS_SILENT " (Linux 2.6.17 °Ê¹ß)" +.\"O Suppress the display of certain +.\"O .RI ( printk ()) +.\"O warning messages in the kernel log. +.\"O This flag supersedes the misnamed and obsolete +.\"O .BR MS_VERBOSE +.\"O flag (available since Linux 2.4.12), which has the same meaning. +¥«¡¼¥Í¥ë¤Î¥í¥°Æâ¤Î¤¢¤ë¼ï¤Î +.RI ( printk ()) +·Ù¹ð¥á¥Ã¥»¡¼¥¸¤Îɽ¼¨¤òÍÞÀ©¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢Ì¾Á°¤¬ÉÔŬÀÚ¤ÇÇѻߤµ¤ì¤¿ +.B MS_VERBOSE +¥Õ¥é¥° (Linux 2.4.12 °Ê¹ß¤ÇÍøÍѲÄǽ) ¤òÃÖ¤­´¹¤¨¤ë¤â¤Î¤Ç¡¢Æ±¤¸°ÕÌ£¤ò»ý¤Ä¡£ +.TP +.\"O .BR MS_STRICTATIME " (Since Linux 2.6.30)" +.BR MS_STRICTATIME " (Linux 2.6.30 °Ê¹ß)" +.\"O Always update the last access time (atime) when files on this +.\"O file system are accessed. +.\"O (This was the default behavior before Linux 2.6.30.) +.\"O Specifying this flag overrides the effect of setting the +.\"O .BR MS_NOATIME +.\"O and +.\"O .BR MS_RELATIME +.\"O flags. +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥¢¥¯¥»¥¹¤µ¤ì¤¿ºÝ¤ËºÇ½ª¥¢¥¯¥»¥¹»þ¹ï (atime) +¤ò¾ï¤Ë¹¹¿·¤¹¤ë (Linux 2.6.30 ¤è¤êÁ°¤Ç¤Ï¡¢¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî +¤Ç¤¢¤Ã¤¿)¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +.B MS_NOATIME +¤È +.B MS_RELATIME +¤Îξ¥Õ¥é¥°¤òÀßÄꤷ¤¿ºÝ¤Î±Æ¶Á¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B MS_SYNCHRONOUS +.\"O Make writes on this file system synchronous (as though +.\"O the +.\"O .B O_SYNC +.\"O flag to +.\"O .BR open (2) +.\"O was specified for all file opens to this file system). +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ·¤ÆƱ´üŪ¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦¡£ +(¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÁ´¤Æ¤Î¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¡¢ +.BR open (2) +¤Î¥Õ¥é¥°¤Ë +.B O_SYNC +¤ò»ØÄꤷ¤¿¤è¤¦¤ÊÆ°ºî¤È¤Ê¤ë) +.PP +.\"O From Linux 2.4 onwards, the +.\"O .BR MS_NODEV ", " MS_NOEXEC ", and " MS_NOSUID +.\"O flags are settable on a per-mount-point basis. +.\"O From kernel 2.6.16 onwards, +.\"O .B MS_NOATIME +.\"O and +.\"O .B MS_NODIRATIME +.\"O are also settable on a per-mount-point basis. +.\"O The +.\"O .B MS_RELATIME +.\"O flag is also settable on a per-mount-point basis. +Linux 2.4 °Ê¹ß¤Ç¤Ï¡¢ +.BR MS_NODEV ", " MS_NOEXEC ", " MS_NOSUID +¤Ï¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥Èñ°Ì¤Ç»ØÄê¤Ç¤­¤ë¡£ +¥«¡¼¥Í¥ë 2.6.16 °Ê¹ß¤Ç¤Ï¡¢ +.B MS_NOATIME +¤È +.B MS_NODIRATIME +¤â¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥Èñ°Ì¤Ç»ØÄê¤Ç¤­¤ë¡£ +¤Þ¤¿¡¢ +.B MS_RELATIME +¥Õ¥é¥°¤â¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥Èñ°Ì¤ÇÀßÄê¤Ç¤­¤ë¡£ +.PP +.\"O The +.\"O .I data +.\"O argument is interpreted by the different file systems. +°ú¤­¿ô +.I data +¤¬¤É¤Î¤è¤¦¤Ë²ò¼á¤µ¤ì¤ë¤«¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +.\"O Typically it is a string of comma-separated options +.\"O understood by this file system. +.\"O See +.\"O .BR mount (8) +.\"O for details of the options available for each filesystem type. +¤¿¤¤¤Æ¤¤¤Ï¡¢»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ê¥ª¥×¥·¥ç¥ó¤¬ +¥³¥ó¥Þ¶èÀÚ¤ê¤Çʤ٤é¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +³Æ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ·¤Æ»ØÄê²Äǽ¤Ê¥ª¥×¥·¥ç¥ó¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR mount (8) +¤ò»²¾È¤Î¤³¤È¡£ +.\"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 The error values given below result from filesystem type independent +.\"O errors. +.\"O Each filesystem type may have its own special errors and its +.\"O own special behavior. +.\"O See the kernel source code for details. +°Ê²¼¤Ë¼¨¤¹¥¨¥é¡¼¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¿¥¤¥×¤Ë¤Ï¸ÇÍ­¤Î¥¨¥é¡¼¤¬Â¸ºß¤¹¤ë¾ì¹ç¤¬¤¢¤ê¡¢ +Æȼ«¤ÎÆ°ºî¤ò¤¹¤ë¤³¤È¤â¤¢¤ë¡£¾Ü¤·¤¯¤Ï¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¤ò¸«¤ÆÍߤ·¤¤¡£ +.TP +.B EACCES +.\"O A component of a path was not searchable. +.\"O (See also +.\"O .BR path_resolution (7).) +.\"O Or, mounting a read-only filesystem was attempted without giving the +.\"O .B MS_RDONLY +.\"O flag. +.\"O Or, the block device +.\"O .I source +.\"O is located on a filesystem mounted with the +.\"O .B MS_NODEV +.\"O option. +.\"O .\" mtk: Probably: write permission is required for MS_BIND, with +.\"O .\" the error EPERM if not present; CAP_DAC_OVERRIDE is required. +¥Ñ¥¹¤Ë´Þ¤Þ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸¡º÷ (¼Â¹Ô) µö²Ä¤¬¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È)¡£ +¤Þ¤¿¤Ï¡¢ +.B MS_RONLY +¥Õ¥é¥°¤ò»ØÄꤻ¤º¤ËÆɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +¥Þ¥¦¥ó¥È¤·¤è¤¦¤È¤·¤¿¡£ +¤Þ¤¿¤Ï¡¢¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ +.I source +¤¬ +.B MS_NODEV +¥ª¥×¥·¥ç¥ó¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ë¤¢¤ë¡£ +.\" mtk: Probably: write permission is required for MS_BIND, with +.\" the error EPERM if not present; CAP_DAC_OVERRIDE is required. +.TP +.B EBUSY +.\"O .I source +.\"O is already mounted. +.\"O Or, it cannot be remounted read-only, +.\"O because it still holds files open for writing. +.\"O Or, it cannot be mounted on +.\"O .I target +.\"O because +.\"O .I target +.\"O is still busy (it is the working directory of some task, +.\"O the mount point of another device, has open files, etc.). +.I source +¤Ï´û¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤Þ¤¿¤Ï¡¢½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¡¢ +Æɤ߹þ¤ßÀìÍѤǺƥޥ¦¥ó¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I target +¤¬»ÈÍÑÃæ (busy) ¤Î¤¿¤á¡¢ +.I target +¤Ë¥Þ¥¦¥ó¥È¤Ç¤­¤Ê¤¤¡£ +.I target +¤¬»ÈÍÑÃæ¤ÎÎã¤È¤·¤Æ¤Ï¡¢¤¢¤ë¥¿¥¹¥¯¤¬Æ°ºî¤·¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê (working +directory) ¤Ç¤¢¤ë¤È¤«¡¢Ê̤ΥǥХ¤¥¹¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤¢¤ë¤È¤«¡¢ +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¡¢¤Ê¤É¤¬¤¢¤ë¡£ +.TP +.B EFAULT +.\"O One of the pointer arguments points outside the user address space. +¾ì½ê¤ò¼¨¤¹°ú¤­¿ô¤Î¤Ò¤È¤Ä¤¬¥æ¡¼¥¶¡¼¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O .I source +.\"O had an invalid superblock. +.I source +¤ËÉÔÀµ¤Ê¥¹¡¼¥Ñ¡¼¥Ö¥í¥Ã¥¯¤¬¤¢¤ë¡£ +.\"O Or, a remount +.\"O .RB ( MS_REMOUNT ) +.\"O was attempted, but +.\"O .I source +.\"O was not already mounted on +.\"O .IR target . +¤Þ¤¿¤Ï¡¢ +.I source +¤¬ +.I target +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤Î¤Ë¡¢ºÆ¥Þ¥¦¥ó¥È +.RB ( MS_REMOUNT ) +¤¬Í׵ᤵ¤ì¤¿¡£ +.\"O Or, a move +.\"O .RB ( MS_MOVE ) +.\"O was attempted, but +.\"O .I source +.\"O was not a mount point, or was \(aq/\(aq. +¤Þ¤¿¤Ï¡¢ +.I source +¤¬¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤Ï¤Ê¤¤¤«¡¢\(aq/\(aq ¤Ê¤Î¤Ë¡¢°ÜÆ° +.RB ( MS_MOVE ) +¤¬Í׵ᤵ¤ì¤¿¡£ +.TP +.B ELOOP +.\"O Too many links encountered during pathname resolution. +.\"O Or, a move was attempted, while +.\"O .I target +.\"O is a descendant of +.\"O .IR source . +¥Ñ¥¹Ì¾¤Î²ò·èÃæ¤ËÅо줷¤¿¥ê¥ó¥¯¤¬Â¿¤¹¤®¤¿¡£ +¤Þ¤¿¤Ï¡¢ +.I target +¤¬ +.I source +¤Î»Ò¹¤Ê¤Î¤Ë°ÜÆ°¤¬Í׵ᤵ¤ì¤¿¡£ +.TP +.B EMFILE +.\"O (In case no block device is required:) +.\"O Table of dummy devices is full. +.\" motoki: ¤É¤¦Ìõ¤¹¤Î¤¬¤¤¤¤¤À¤í¤¦¤«¡© +(¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤¬É¬ÍפǤʤ¤¾ì¹ç) +¥À¥ß¡¼¥Ç¥Ð¥¤¥¹¤Î¥Æ¡¼¥Ö¥ë¤¬°ìÇդˤʤä¿¡£ +.TP +.B ENAMETOOLONG +.\"O A pathname was longer than +.\"O .BR MAXPATHLEN . +¥Ñ¥¹Ì¾¤ÎŤµ¤¬ +.B MAXPATHLEN +¤ò±Û¤¨¤¿¡£ +.TP +.B ENODEV +.\"O .I filesystemtype +.\"O not configured in the kernel. +.I filesystemtype +¤¬¥«¡¼¥Í¥ëÃæ¤ÇÄêµÁ (config) ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOENT +.\"O A pathname was empty or had a nonexistent component. +¥Ñ¥¹Ì¾¤¬¶õ¤Ç¤¢¤ë¡£¤â¤·¤¯¤Ï»ØÄꤵ¤ì¤¿¥Ñ¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +.\"O The kernel could not allocate a free page to copy filenames or data into. +¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë̾¤ä¥Ç¡¼¥¿¤ò¥³¥Ô¡¼¤¹¤ë¤¿¤á¤Î¶õ¤­¥Ú¡¼¥¸¤ò³ÎÊݤǤ­¤Ê¤¤¡£ +.TP +.B ENOTBLK +.\"O .I source +.\"O is not a block device (and a device was required). +(¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤¬É¬ÍפÀ¤¬) +.I source +¤¬¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O .IR target , +.\"O or a prefix of +.\"O .IR source , +.\"O is not a directory. +.I target +¤«¡¢ +.I source +¤Î¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ENXIO +.\"O The major number of the block device +.\"O .I source +.\"O is out of range. +¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ +.I source +¤Î¥á¥¸¥ã¡¼Èֹ椬Èϰϳ°¤Ç¤¢¤ë¡£ +.TP +.B EPERM +.\"O The caller does not have the required privileges. +¸Æ¤Ó½Ð¤·¸µ¤ËɬÍפʸ¢¸Â¤¬¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is Linux-specific and should not be used in +.\"O programs intended to be portable. +¤³¤Î´Ø¿ô¤Ï Linux ¸ÇÍ­¤Î´Ø¿ô¤Ç¤¢¤ê¡¢°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +»ÈÍѤ¹¤Ù¤­¤Ç¤Ê¤¤¡£ +.\"O .SH NOTES +.\"O The original +.\"O .B MS_SYNC +.\"O flag was renamed +.\"O .B MS_SYNCHRONOUS +.\"O in 1.1.69 +.\"O when a different +.\"O .B MS_SYNC +.\"O was added to \fI\fP. +¸µ¤Î +.B MS_SYNC +¥Õ¥é¥°¤Ï¡¢Ê̤Π+.B MS_SYNC +¤¬ \fI\fP ¤ËÄɲ䵤줿¤Î¤Ç +1.1.69 ¤«¤é +.B MS_SYNCHRONOUS +¤Ë̾Á°¤¬ÊѤï¤Ã¤¿¡£ +.LP +.\"O Before Linux 2.4 an attempt to execute a set-UID or set-GID program +.\"O on a filesystem mounted with +.\"O .B MS_NOSUID +.\"O would fail with +.\"O .BR EPERM . +Linux 2.4 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ +.B MS_NOSUID +¥ª¥×¥·¥ç¥óÉÕ¤­¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î +set-UID ¤ä set-GID ¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤è¤¦¤È¤¹¤ë¤È¡¢ +.B EPERM +¥¨¥é¡¼¤È¤Ê¤Ã¤¿¡£ +.\"O Since Linux 2.4 the set-UID and set-GID bits are just silently ignored +.\"O in this case. +Linux 2.4 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ï set-UID ¥Ó¥Ã¥È¤ä set-GID ¥Ó¥Ã¥È¤¬ +̵»ë¤µ¤ì¤ë¤À¤±¤Ç¤¢¤ë¡£ +.\"O .\" The change is in patch-2.4.0-prerelease. +.\" ¤³¤ÎÊѹ¹¤Ï patch-2.4.0-prerelease ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS Per-process Namespaces +.SS ¥×¥í¥»¥¹Ã±°Ì¤Î̾Á°¶õ´Ö +.\"O Starting with kernel 2.4.19, Linux provides +.\"O per-process mount namespaces. +.\"O A mount namespace is the set of file system mounts that +.\"O are visible to a process. +.\"O Mount-point namespaces can be (and usually are) +.\"O shared between multiple processes, +.\"O and changes to the namespace (i.e., mounts and unmounts) by one process +.\"O are visible to all other processes sharing the same namespace. +.\"O (The pre-2.4.19 Linux situation can be considered as one in which +.\"O a single namespace was shared by every process on the system.) +¥«¡¼¥Í¥ë 2.4.19 °Ê¹ß¤Î Linux ¤Ç¤Ï¡¢¥×¥í¥»¥¹Ã±°Ì¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö +(mount namespace) ¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤È¤Ï¡¢ +¤¢¤ë¥×¥í¥»¥¹¤Ë¸«¤¨¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¤Î½¸¹ç¤Ç¤¢¤ë¡£ +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Î̾Á°¶õ´Ö¤ÏÊ£¿ô¤Î¥×¥í¥»¥¹¤Ç¶¦Í­¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢ +ÉáÄ̤϶¦Í­¤µ¤ì¤Æ¤¤¤ë¡£ +°ì¤Ä¤Î¥×¥í¥»¥¹¤Ë¤è¤ë̾Á°¶õ´Ö¤ÎÊѹ¹ (¤¹¤Ê¤ï¤Á¡¢¥Þ¥¦¥ó¥È¤ä¥¢¥ó¥Þ¥¦¥ó¥È) ¤Ï +Ʊ¤¸Ì¾Á°¶õ´Ö¤ò¶¦Í­¤¹¤ë¾¤ÎÁ´¤Æ¤Î¥×¥í¥»¥¹¤Ë¤â¸«¤¨¤ë¡£ +(2.4.19 ¤è¤êÁ°¤Î Linux ¤Ï¡¢°ì¤Ä¤Î̾Á°¶õ´Ö¤¬¥·¥¹¥Æ¥à¾å¤ÎÁ´¥×¥í¥»¥¹¤Ç +¶¦Í­¤µ¤ì¤ë¾õ¶·¤È¤ß¤Ê¤¹¤³¤È¤¬¤Ç¤­¤ë¡£) + +.\"O A child process created by +.\"O .BR fork (2) +.\"O shares its parent's mount namespace; +.\"O the mount namespace is preserved across an +.\"O .BR execve (2). +.BR fork (2) +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤ò¶¦Í­¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤ÏÊÝ»ý¤µ¤ì¤ë¡£ + +.\"O A process can obtain a private mount namespace if: +.\"O it was created using the +.\"O .BR clone () +.\"O .BR CLONE_NEWNS +.\"O flag, +.\"O in which case its new namespace is initialized to be a +.\"O .I copy +.\"O of the namespace of the process that called +.\"O .BR clone (); +.\"O or it calls +.\"O .BR unshare (2) +.\"O with the +.\"O .BR CLONE_NEWNS +.\"O flag, +.\"O which causes the caller's mount namespace to obtain a private copy +.\"O of the namespace that it was previously sharing with other processes, +.\"O so that future mounts and unmounts by the caller are invisible +.\"O to other processes (except child processes that the caller +.\"O subsequently creates) and vice versa. +¥×¥í¥»¥¹¤Ï¼«Ê¬ÍÑ (private) ¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +¼«Ê¬ÍѤÎ̾Á°¶õ´Ö¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¤Î¤Ï¡¢ +¤½¤Î¥×¥í¥»¥¹¤¬ +.BR clone () +.B CLONE_NEWNS +¥Õ¥é¥°¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿¾ì¹ç¤È¡¢ +¤½¤Î¥×¥í¥»¥¹¤¬ +.B CLONE_NEWNS +¥Õ¥é¥°ÉÕ¤­¤Ç +.BR unshare (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤Ç¤¢¤ë¡£ +Á°¼Ô¤Î¾ì¹ç¡¢ºîÀ®¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¿·¤·¤¤Ì¾Á°¶õ´Ö¤Ï +.BR clone () +¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î̾Á°¶õ´Ö¤Î¡Ö¥³¥Ô¡¼¡×¤Ç½é´ü²½¤µ¤ì¤ë¡£ +¸å¼Ô¤Î¾ì¹ç¡¢ +.BR unshare (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤¬¡¢ +¤½¤ì¤Þ¤Ç¤Ï¾¤Î¥×¥í¥»¥¹¤È¶¦Í­¤·¤Æ¤¤¤¿Ì¾Á°¶õ´Ö¤Î¼«Ê¬ÍѤΥ³¥Ô¡¼¤È¤Ê¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¤³¤ì°Ê¸å¤Ë¹Ô¤¦¥Þ¥¦¥ó¥È/¥¢¥ó¥Þ¥¦¥ó¥È¤Ï +¾¤Î¥×¥í¥»¥¹¤«¤é¸«¤¨¤Ê¤¯¤Ê¤ë +(¤¿¤À¤·¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬ +.BR unshare (2) +¤Î¸Æ¤Ó½Ð¤·°Ê¹ß¤ËºîÀ®¤·¤¿»Ò¥×¥í¥»¥¹¤Ë¤Ï¸«¤¨¤ë)¡£ +¤Þ¤¿¡¢¤½¤ÎµÕ¤Î¡¢Â¾¤Î¥×¥í¥»¥¹¤¬¹Ô¤Ã¤¿¥Þ¥¦¥ó¥È/¥¢¥ó¥Þ¥¦¥ó¥È¤â¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë¤Ï +¸«¤¨¤Ê¤¯¤Ê¤ë¡£ + +.\"O The Linux-specific +.\"O .I /proc/PID/self +.\"O file exposes the list of mount points in the mount +.\"O namespace of the process with the specified ID; see +.\"O .BR proc (5) +.\"O for details. +Linux Æȼ«¤Î¥Õ¥¡¥¤¥ë +.\"Omotoki: /proc/PID/mounts ¤Î´Ö°ã¤¤¤Ç¤Ï¡© +.\"Omotoki: self ¤Ï PID ¤ÎÂå¤ï¤ê¤Ë¤Ê¤ë¤â¤Î¡£ +.I /proc/PID/mounts +¤Ç¤Ï¡¢»ØÄꤵ¤ì¤¿ ID ¤ò»ý¤Ä¥×¥í¥»¥¹¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤Ë¤ª¤±¤ë +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Î¥ê¥¹¥È¤¬¸ø³«¤µ¤ì¤Æ¤¤¤ë¡£¾ÜºÙ¤Ï +.BR proc (5) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR umount (2), +.BR path_resolution (7), +.BR mount (8), +.BR umount (8) diff --git a/draft/man2/move_pages.2 b/draft/man2/move_pages.2 new file mode 100644 index 00000000..eb142e49 --- /dev/null +++ b/draft/man2/move_pages.2 @@ -0,0 +1,376 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" 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. +.\" +.\" FIXME Should programs normally be using this API directly, or should +.\" they rather be using interfaces in the numactl package? +.\" (e.g., compare with recommendation in mbind(2)). +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-10-26, Akihiro MOTOKI +.\" +.TH MOVE_PAGES 2 2008-10-06 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O move_pages \- move individual pages of a process to another node +move_pages \- ¤¢¤ë¥×¥í¥»¥¹¤Î¸Ä¡¹¤Î¥Ú¡¼¥¸¤òÊ̤ΥΡ¼¥É¤Ë°ÜÆ°¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long move_pages(int " pid ", unsigned long count, void **" pages , +.BI " const int *" nodes ", int *" status ", int " flags ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR move_pages () +.\"O moves the specified +.\"O .I pages +.\"O of the process +.\"O .I pid +.\"O to the memory nodes specified by +.\"O .IR nodes . +.\"O The result of the move is reflected in +.\"O .IR status . +.\"O The +.\"O .I flags +.\"O indicate constraints on the pages to be moved. +.BR move_pages () +¤Ï¡¢¥×¥í¥»¥¹ +.I pid +¤Î»ØÄꤵ¤ì¤¿¥Ú¡¼¥¸ +.I pages +¤ò +.I nodes +¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥ê¥Î¡¼¥É¤Ë°ÜÆ°¤¹¤ë¡£ +°ÜÆ°¤Î·ë²Ì¤Ï +.I status +¤ËÈ¿±Ç¤µ¤ì¤ë¡£ +.I flags +¤Ç¤Ï°ÜÆ°¤µ¤ì¤ë¥Ú¡¼¥¸¤Ë´Ø¤¹¤ëÀ©Ìó¤ò»ØÄꤹ¤ë¡£ + +.\"O .I pid +.\"O is the ID of the process in which pages are to be moved. +.\"O To move pages in another process, +.\"O the caller must be privileged +.\"O .RB ( CAP_SYS_NICE ) +.\"O or the real or effective user ID of the calling process must match the +.\"O real or saved-set user ID of the target process. +.\"O If +.\"O .I pid +.\"O is 0 then +.\"O .BR move_pages () +.\"O moves pages of the calling process. +.I pid +¤Ï¡¢°ÜÆ°¤µ¤ì¤ë¥Ú¡¼¥¸¤¬Â°¤¹¤ë¥×¥í¥»¥¹¤Î ID ¤Ç¤¢¤ë¡£ +ÊÌ¤Î¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢ +.RB ( CAP_SYS_NICE ) +¤ò»ý¤Ã¤Æ¤¤¤ë¤«¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID ¤«¼Â¸ú¥æ¡¼¥¶ ID ¤¬ +¥Ú¡¼¥¸°ÜÆ°ÂÐ¾Ý¤Î¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID ¤«Êݸ set-user-ID ¤Î¤É¤Á¤é¤«¤È +°ìÃפ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I pid +¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR move_pages () +¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤¹¤ë¡£ + +.\"O .I count +.\"O is the number of pages to move. +.\"O It defines the size of the three arrays +.\"O .IR pages , +.\"O .IR nodes , +.\"O and +.\"O .IR status . +.I count +¤Ï°ÜÆ°¤¹¤ë¥Ú¡¼¥¸¿ô¤Ç¤¢¤ë¡£ +.I count +¤Ë¤è¤ê +.IR pages , +.IR nodes , +.I status +¤Î 3 ¤Ä¤ÎÇÛÎó¤ÎÂ礭¤µ¤¬ÄêµÁ¤µ¤ì¤ë¡£ + +.\"O .I pages +.\"O is an array of pointers to the pages that should be moved. +.\"O These are pointers that should be aligned to page boundaries. +.I pages +¤Ï¡¢°ÜÆ°¤¹¤Ù¤­¥Ú¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Ç¤¢¤ê¡¢ +³Æ¥Ý¥¤¥ó¥¿¤Ï¥Ú¡¼¥¸¶­³¦¤Ë·¤¨¤¿Ãͤò»ØÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.\" FIXME what if they are not aligned? +.\"O Addresses are specified as seen by the process specified by +.\"O .IR pid . +.I pid +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Ç¸«¤¨¤ë¥¢¥É¥ì¥¹¤ò»ØÄꤹ¤ë¡£ + +.\"O .I nodes +.\"O is an array of integers that specify the desired location for each page. +.\"O Each element in the array is a node number. +.\"O .I nodes +.\"O can also be NULL, in which case +.\"O .BR move_pages () +.\"O does not move any pages but instead will return the node +.\"O where each page currently resides, in the +.\"O .I status +.\"O array. +.\"O Obtaining the status of each page may be necessary to determine +.\"O pages that need to be moved. +.I nodes +¤Ï¡¢³Æ¥Ú¡¼¥¸¤Î´õ˾¤Î°ÜÆ°¾ì½ê¤ò¼¨¤¹À°¿ôÃͤÎÇÛÎó¤Ç¤¢¤ê¡¢ +ÇÛÎó¤Î³ÆÍ×ÁǤϥΡ¼¥ÉÈÖ¹æ¤Ç¤¢¤ë¡£ +.I nodes +¤Ë¤Ï NULL ¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¡¢¤³¤Î¾ì¹ç¤Ë¤Ï +.BR move_pages () +¤Ï¤É¤Î¥Ú¡¼¥¸¤â°ÜÆ°¤·¤Ê¤¤¤¬¡¢³Æ¥Ú¡¼¥¸¤¬¸½ºßÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤òÇÛÎó +.I status +¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£¤É¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤¹¤ëɬÍפ¬¤¢¤ë¤«¤òȽÃǤ¹¤ë¤¿¤á¤Ë¡¢ +³Æ¥Ú¡¼¥¸¤Î¾õÂ֤μèÆÀ¤¬É¬Íפʾì¹ç¤â¤¢¤ë¡£ + +.\"O .I status +.\"O is an array of integers that return the status of each page. +.\"O The array only contains valid values if +.\"O .BR move_pages () +.\"O did not return an error. +.I status +¤Ï¡¢³Æ¥Ú¡¼¥¸¤Î¾õÂÖ¤òɽ¤¹À°¿ôÃͤÎÇÛÎó¤Ç¤¢¤ë¡£ +¤³¤ÎÇÛÎó¤ËÍ­¸ú¤ÊÃͤ¬³ÊǼ¤µ¤ì¤ë¤Î¤Ï¡¢ +.BR move_pages () +¤¬¥¨¥é¡¼¤òÊÖ¤µ¤Ê¤«¤Ã¤¿¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ + +.\"O .I flags +.\"O specify what types of pages to move. +.\"O .B MPOL_MF_MOVE +.\"O means that only pages that are in exclusive use by the process +.\"O are to be moved. +.\"O .B MPOL_MF_MOVE_ALL +.\"O means that pages shared between multiple processes can also be moved. +.\"O The process must be privileged +.\"O .RB ( CAP_SYS_NICE ) +.\"O to use +.\"O .BR MPOL_MF_MOVE_ALL . +.I flags +¤Ë¤Ï¡¢¤É¤Î¼ïÎà¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤¹¤ë¤«¤ò»ØÄꤹ¤ë¡£ +.B MPOL_MF_MOVE +¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬ÇÓ¾Ū¤Ë»ÈÍѤ·¤Æ¤¤¤ë¥Ú¡¼¥¸¤À¤±¤ò°ÜÆ°¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.B MPOL_MF_MOVE_ALL +¤Ï¡¢Ê£¿ô¤Î¥×¥í¥»¥¹´Ö¤Ç¶¦Í­¤µ¤ì¤Æ¤¤¤ë¥Ú¡¼¥¸¤â°ÜÆ°¤Ç¤­¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.B MPOL_MF_MOVE_ALL +¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬Æø¢ +.RB ( CAP_SYS_NICE ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH Page states in the status array +.SH status ÇÛÎó¤Ë³ÊǼ¤µ¤ì¤ë¥Ú¡¼¥¸¾õÂÖ +.\"O The following values can be returned in each element of the +.\"O .I status +.\"O array. +.I status +ÇÛÎó¤Î³ÆÍ×ÁǤȤ·¤Æ¡¢°Ê²¼¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.B 0..MAX_NUMNODES +.\"O Identifies the node on which the page resides. +¤½¤Î¥Ú¡¼¥¸¤¬ÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤ò¼¨¤¹¡£ +.TP +.B -EACCES +.\"O The page is mapped by multiple processes and can only be moved if +.\"O .B MPOL_MF_MOVE_ALL +.\"O is specified. +¤½¤Î¥Ú¡¼¥¸¤ÏÊ£¿ô¤Î¥×¥í¥»¥¹¤Ë¤è¤ê¥Þ¥Ã¥×¤µ¤ì¤Æ¤ª¤ê¡¢ +.B MPOL_MF_MOVE_ALL +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Î¤ß°ÜÆ°¤Ç¤­¤ë¡£ +.TP +.B -EBUSY +.\"O The page is currently busy and cannot be moved. +.\"O Try again later. +.\"O This occurs if a page is undergoing I/O or another kernel subsystem +.\"O is holding a reference to the page. +¤½¤Î¥Ú¡¼¥¸¤¬¸½ºß¥Ó¥¸¡¼¤Ç¤¢¤ê¡¢°ÜÆ°¤Ç¤­¤Ê¤¤¡£¸å¤Ç¤â¤¦°ìÅٻ¤³¤È¡£ +¤³¤Î¾õ¶·¤Ï¡¢¥Ú¡¼¥¸¤¬ I/O ¤Î¼Â¹ÔÃæ¤Ç¤¢¤Ã¤¿¤ê¡¢¥«¡¼¥Í¥ë¤Î¾¤Î¥µ¥Ö¥·¥¹¥Æ¥à +¤¬¤½¤Î¥Ú¡¼¥¸¤Ø¤Î»²¾È¤òÊÝ»ý¤·¤Æ¤¤¤ë¾ì¹ç¤ËȯÀ¸¤¹¤ë¡£ +.TP +.B -EFAULT +.\"O This is a zero page or the memory area is not mapped by the process. +¤½¤Î¥Ú¡¼¥¸¤¬ zero page ¤Ç¤¢¤ë¤«¡¢¤½¤Î¥á¥â¥êÎΰè¤Ï¤½¤Î¥×¥í¥»¥¹¤Ë¤è¤ê +¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B -EIO +.\"O Unable to write back a page. +.\"O The page has to be written back +.\"O in order to move it since the page is dirty and the file system +.\"O does not provide a migration function that would allow the move +.\"O of dirty pages. +¥Ú¡¼¥¸¤ò½ñ¤­Ì᤹ (write back) ¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +¥Ú¡¼¥¸¤¬ dirty ¤Ç¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ dirty ¤Ê¥Ú¡¼¥¸¤ò°ÜÆ°¤Ç¤­¤ë¤è¤¦¤Ê +°ÜÆ°µ¡Ç½¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¤¿¤á¡¢¤½¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤¹¤ë¤¿¤á¤Ë¤Ï¥Ú¡¼¥¸¤ò +½ñ¤­Ìᤵ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B -EINVAL +.\"O A dirty page cannot be moved. +.\"O The file system does not +.\"O provide a migration function and has no ability to write back pages. +dirty ¤Ê¥Ú¡¼¥¸¤ò°ÜÆ°¤Ç¤­¤Ê¤¤¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ dirty ¤Ê¥Ú¡¼¥¸¤ò°ÜÆ°¤¹¤ë¤¿¤á¤Îµ¡Ç½¤òÄ󶡤·¤Æ¤ª¤é¤º¡¢ +¥Ú¡¼¥¸¤ò½ñ¤­Ì᤹ǽÎϤâ¤Ê¤¤¡£ +.TP +.B -ENOENT +.\"O The page is not present. +¥Ú¡¼¥¸¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B -ENOMEM +.\"O Unable to allocate memory on target node. +°ÜÆ°Àè¤Î¥Î¡¼¥É¤Ç¥á¥â¥ê¤ò³ÎÊݤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success +.\"O .BR move_pages () +.\"O returns zero. +À®¸ù¤¹¤ë¤È¡¢ +.BR move_pages () +¤Ï 0 ¤òÊÖ¤¹¡£ +.\" FIXME Is the following quite true: does the wrapper in numactl +.\" do the right thing? +.\"O On error, it returns \-1, and sets +.\"O .I errno +.\"O to indicate the error. +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B E2BIG +.\"O Too many pages to move. +°ÜÆ°¤¹¤Ù¤­¥Ú¡¼¥¸¤¬Â¿²á¤®¤ë¡£ +.TP +.B EACCES +.\" FIXME Clarify "current cpuset". Is that the cpuset of the caller +.\" or the target? +.\"O One of the target nodes is not allowed by the current cpuset. +°ÜÆ°Àè¤Î¥Î¡¼¥É¤Î¤¤¤º¤ì¤«¤¬¸½ºß¤Î CPU ½¸¹ç¤Ç¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +.\"O Parameter array could not be accessed. +¥Ñ¥é¥á¡¼¥¿ÇÛÎó¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINVAL +.\"O Flags other than +.\"O .B MPOL_MF_MOVE +.\"O and +.\"O .B MPOL_MF_MOVE_ALL +.\"O was specified or an attempt was made to migrate pages of a kernel thread. +.I flags +¤Ë +.B MPOL_MF_MOVE +¤Ç¤â +.B MPOL_MF_MOVE_ALL +¤Ç¤â¤Ê¤¤Ãͤ¬»ØÄꤵ¤ì¤¿¤«¡¢¥«¡¼¥Í¥ë¥¹¥ì¥Ã¥É¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤µ¤»¤è¤¦¤È¤·¤¿¡£ +.TP +.B ENODEV +.\"O One of the target nodes is not online. +°ÜÆ°Àè¤Î¥Î¡¼¥É¤Î¤¤¤º¤ì¤«¤¬¥ª¥ó¥é¥¤¥ó¤Ç¤Ê¤¤¡£ +.TP +.B ENOENT +.\"O No pages were found that require moving. +.\"O All pages are either already +.\"O on the target node, not present, had an invalid address or could not be +.\"O moved because they were mapped by multiple processes. +°ÜÆ°¤¬É¬Íפʥڡ¼¥¸¤¬Á´¤¯¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +»ØÄꤵ¤ì¤¿Á´¤Æ¤Î¥Ú¡¼¥¸¤¬¡¢¤¹¤Ç¤Ë°ÜÆ°Àè¤Î¥Î¡¼¥É¤Ë¸ºß¤¹¤ë¤«¡¢Â¸ºß¤·¤Ê¤¤¤«¡¢ +̵¸ú¤Ê¥¢¥É¥ì¥¹¤Ç¤¢¤Ã¤¿¤«¡¢Ê£¿ô¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Æ°ÜÆ°¤Ç¤­ +¤Ê¤«¤Ã¤¿¤«¡¢¤Î¤¤¤º¤ì¤«¤Ç¤¢¤Ã¤¿¡£ +.TP +.B EPERM +.\"O The caller specified +.\"O .B MPOL_MF_MOVE_ALL +.\"O without sufficient privileges +.\"O .RB ( CAP_SYS_NICE ). +.\"O Or, the caller attempted to move pages of a process belonging +.\"O to another user but did not have privilege to do so +.\"O .RB ( CAP_SYS_NICE ). +¸Æ¤Ó½Ð¤·¸µ¤Ï +.B MPOL_MF_MOVE_ALL +¤ò»ØÄꤷ¤¿¤¬¡¢½½Ê¬¤ÊÆø¢ +.RB ( CAP_SYS_NICE ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤¬Â¾¤Î¥æ¡¼¥¶¤Ë°¤¹¤ë¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤·¤è¤¦¤È¤·¤¿¤¬¡¢ +¤½¤ì¤ò¹Ô¤¨¤ë¤À¤±¤ÎÆø¢ +.RB ( CAP_SYS_NICE ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B ESRCH +.\"O Process does not exist. +¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR move_pages () +.\"O first appeared on Linux in version 2.6.18. +.BR move_pages () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.6.18 ¤Ç½é¤á¤Æ Linux ¤ËÅо줷¤¿¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O This system call is Linux-specific. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH "NOTES" +.SH Ãí°Õ +.\"O For information on library support, see +.\"O .BR numa (7). +¥é¥¤¥Ö¥é¥ê¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR numa (7) +¤ò»²¾È¡£ + +.\"O Use +.\"O .BR get_mempolicy (2) +.\"O with the +.\"O .B MPOL_F_MEMS_ALLOWED +.\"O flag to obtain the set of nodes that are allowed by +.\" FIXME Clarify "current cpuset". Is that the cpuset of the caller +.\" or the target? +.\"O the current cpuset. +.\"O Note that this information is subject to change at any +.\"O time by manual or automatic reconfiguration of the cpuset. +¸½ºß¤Î CPU ½¸¹ç¤Çµö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤Î½¸¹ç¤ò¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢¥Õ¥é¥° +.B MPOL_F_MEMS_ALLOWED +¤ò»ØÄꤷ¤Æ +.BR get_mempolicy (2) +¤ò»ÈÍѤ¹¤ì¤Ð¤è¤¤¡£ +¼èÆÀ¤·¤¿¾ðÊó¤Ï¡¢CPU ½¸¹ç¤Î¼êÆ°¤Þ¤¿¤Ï¼«Æ°¤Ç¤ÎºÆ¹½À®¤Ë¤è¤ê +¤¤¤Ä²¿»þÊѲ½¤·¤Æ¤·¤Þ¤¦¤«Ê¬¤«¤é¤Ê¤¤¡£ + +.\"O Use of this function may result in pages whose location +.\"O (node) violates the memory policy established for the +.\"O specified addresses (See +.\"O .BR mbind (2)] +.\"O and/or the specified process [See +.\"O .BR set_mempolicy (2)). +.\"O That is, memory policy does not constrain the destination +.\"O nodes used by +.\"O .BR move_pages (). +¤³¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤È¡¢¥Ú¡¼¥¸¤Î°ÌÃÖ (¥Î¡¼¥É) ¤¬ +»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤ËÂФ·¤ÆÀßÄꤵ¤ì¤¿¥á¥â¥ê¥Ý¥ê¥·¡¼ +.RB ( mbind (2) +»²¾È) ¤ä»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤ËÂФ·¤ÆÀßÄꤵ¤ì¤¿¥á¥â¥ê¥Ý¥ê¥·¡¼ +.RB ( set_mempolicy (2) +»²¾È) ¤Ë°ãÈ¿¤·¤Æ¤·¤Þ¤¦²ÄǽÀ­¤¬¤¢¤ë¡£ +¤Ä¤Þ¤ê¡¢¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï +.BR move_pages () +¤Ç»È¤ï¤ì¤ë°ÜÆ°Àè¥Î¡¼¥É¤òÀ©¸Â¤·¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR get_mempolicy (2), +.BR mbind (2), +.BR set_mempolicy (2), +.BR numa (3), +.BR numa_maps (5), +.BR cpuset (7), +.BR numa (7), +.BR migratepages (8), +.BR numa_stat (8) diff --git a/draft/man2/mprotect.2 b/draft/man2/mprotect.2 new file mode 100644 index 00000000..9aedcd1d --- /dev/null +++ b/draft/man2/mprotect.2 @@ -0,0 +1,324 @@ +.\" -*- nroff -*- +.\" Copyright (C) 2007 Michael Kerrisk +.\" and Copyright (C) 1995 Michael Shields . +.\" +.\" 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 author of this work. +.\" +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 1997-05-31 by Andries Brouwer +.\" Modified 2003-08-24 by Andries Brouwer +.\" Modified 2004-08-16 by Andi Kleen +.\" 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 Æɤ߼è¤êÀìÍÑ +.\" +.TH MPROTECT 2 2008-08-06 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mprotect \- set protection on a region of memory +mprotect \- ¥á¥â¥êÎΰè¤ÎÊݸî¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int mprotect(const void *" addr ", size_t " len ", int " prot ); +.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 +¤Ï¥Ú¡¼¥¸¶­³¦¤Ë°ìÃפ·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"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 +¤ò¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤ÆÀ¸À®¤¹¤ë¡£ +.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. +¤½¤Î¥á¥â¥ê¤Ë¤ÏÁ´¤¯¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¡£ +.TP +.B PROT_READ +.\"O The memory can be read. +¤½¤Î¥á¥â¥ê¤òÆɤ߼è¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B PROT_WRITE +.\"O The memory can be modified. +¤½¤Î¥á¥â¥ê¤òÊѹ¹¤Ç¤­¤ë¡£ +.TP +.B PROT_EXEC +.\"O The memory can be executed. +¤½¤Î¥á¥â¥ê¤Ï¼Â¹Ô²Äǽ¤Ç¤¢¤ë¡£ +.\" 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 +.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 ¤¬Í­¸ú¤Ê¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¤¤«¡¢ +¥·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ê¤¤¡£ +.\" Or: both PROT_GROWSUP and PROT_GROWSDOWN were specified in 'prot'. +.TP +.B ENOMEM +.\"O Internal kernel structures could not be allocated. +¥«¡¼¥Í¥ëÆâÉô¤Î¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O Addresses in the range +.\"O .RI [ addr , +.\"O .IR addr + len ] +.\"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 ¤Ä°Ê¾å¤Î¥Ú¡¼¥¸¤ò»Ø¤·¤Æ¤¤¤ë +(¥«¡¼¥Í¥ë 2.4.19 ¤è¤êÁ°¤Ç¤Ï¡¢¤³¤Î¾õ¶·¤Ç¥¨¥é¡¼ +.B EFAULT +¤¬´Ö°ã¤Ã¤ÆÀ¸À®¤µ¤ì¤Æ¤¤¤¿)¡£ +.\"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 +.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 () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¡¢¾ï¤Ëµö¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤ÏÆä˴û¸¤Î¥³¡¼¥É¥Þ¥Ã¥Ô¥ó¥°¤ò½ñ¤­¹þ¤ß²Äǽ¤Ë¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ + +.\"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 +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ + +.\"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 +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¥¢¥¯¥»¥¹¤Ïµö²Ä¤µ¤ì¤Ê¤¤ÅÀ¤À¤±¤Ï +Ëþ¤¿¤¹É¬Íפ¬¤¢¤ë¡£ +.\"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 upwards +.\"O through the allocated region modifying bytes. +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥á¥â¥ê¥Ú¡¼¥¸¤ò 4¤Ä³ÎÊݤ·¡¢¤½¤Î¤¦¤Á 3ÈÖÌܤΥڡ¼¥¸¤ò +Æɤ߹þ¤ßÀìÍѤËÀßÄꤹ¤ë¡£¤½¤Î¸å¤Ç¡¢³ÎÊݤ·¤¿Îΰè¤Î¥¢¥É¥ì¥¹¤Î¾®¤µ¤¤Êý¤«¤é +Â礭¤ÊÊý¤Ë¸þ¤«¤Ã¤Æ½çÈ֤˥Х¤¥ÈÃͤòÊѹ¹¤¹¤ë¥ë¡¼¥×¤ò¼Â¹Ô¤¹¤ë¡£ + +.\"O An example of what we might see when running the program is the +.\"O following: +¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Î°ìÎã¤ò°Ê²¼¤Ë¼¨¤¹¡£ + +.in +4n +.nf +.RB "$" " ./a.out" +Start of region: 0x804c000 +Got SIGSEGV at address: 0x804e000 +.fi +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.in +.nf +#include +#include +#include +#include +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +char *buffer; + +static void +handler(int sig, siginfo_t *si, void *unused) +{ + printf("Got SIGSEGV at address: 0x%lx\\n", + (long) si\->si_addr); + exit(EXIT_FAILURE); +} + +int +main(void) +{ + char *p; + int pagesize; + struct sigaction sa; + + sa.sa_flags = SA_SIGINFO; + sigemptyset(&sa.sa_mask); + sa.sa_sigaction = handler; + if (sigaction(SIGSEGV, &sa, NULL) == \-1) + handle_error("sigaction"); + + pagesize = sysconf(_SC_PAGE_SIZE); + if (pagesize == \-1) + handle_error("sysconf"); + + /* Allocate a buffer aligned on a page boundary; + initial protection is PROT_READ | PROT_WRITE */ + + buffer = memalign(pagesize, 4 * pagesize); + if (buffer == NULL) + handle_error("memalign"); + + printf("Start of region: 0x%lx\\n", (long) buffer); + + if (mprotect(buffer + pagesize * 2, pagesize, + PROT_NONE) == \-1) + handle_error("mprotect"); + + for (p = buffer ; ; ) + *(p++) = \(aqa\(aq; + + printf("Loop completed\\n"); /* Should never happen */ + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mmap (2), +.BR sysconf (3) diff --git a/draft/man2/mq_getsetattr.2 b/draft/man2/mq_getsetattr.2 new file mode 100644 index 00000000..e8b2c56a --- /dev/null +++ b/draft/man2/mq_getsetattr.2 @@ -0,0 +1,79 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-16, Akihiro MOTOKI +.\" +.TH MQ_GETSETATTR 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mq_getsetattr \- get/set message queue attributes +mq_getsetattr \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î°À­¤òÀßÄê/¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "mqd_t mq_getsetattr(mqd_t " mqdes ", struct mq_attr *" newattr "," +.BI " struct mq_attr *" oldattr ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Do not use this system call. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ÈÍѤ·¤Ê¤¤¤³¤È¡£ + +.\"O This is the low-level system call used to implement +.\"O .BR mq_getattr (3) +.\"O and +.\"O .BR mq_setattr (3). +.\"O For an explanation of how this system call operates, +.\"O see the description of +.\"O .BR mq_setattr (3). +.BR mq_getattr (3) +¤È +.BR mq_setattr (3) +¤Î¼ÂÁõ¤Ë»ÈÍѤµ¤ì¤ëÄã¥ì¥Ù¥ë¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤É¤Î¤è¤¦¤ËÆ°ºî¤¹¤ë¤«¤Ï +.BR mq_setattr (3) +¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O This interface is nonstandard; avoid its use. +¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÏÈóɸ½à¤Ç¤¢¤ë¡£»ÈÍѤòÈò¤±¤ë¤³¤È¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Glibc does not provide a wrapper for this system call; call it using +.\"O .BR syscall (2). +.\"O (Actually, never call it unless you are writing a C library!) +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£ +(¼Â¤Î¤È¤³¤í¡¢C ¥é¥¤¥Ö¥é¥ê¤ò½ñ¤¤¤Æ¤¤¤ë¤Î¤Ç¤Ê¤¤¸Â¤ê¡¢ +·è¤·¤Æ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤µ¤Ê¤¤¤³¤È!) +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mq_getattr (3), +.BR mq_overview (7) diff --git a/draft/man2/mremap.2 b/draft/man2/mremap.2 new file mode 100644 index 00000000..983e7896 --- /dev/null +++ b/draft/man2/mremap.2 @@ -0,0 +1,370 @@ +.\" 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 2005-09-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O mremap \- remap a virtual memory address +.SH ̾Á° +mremap \- ²¾ÁÛ¥á¥â¥ê¡¦¥¢¥É¥ì¥¹¤òºÆ¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "void *mremap(void *" old_address ", size_t " old_size , +.BI " size_t " new_size ", int " flags ); +.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 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), +.BR feature_test_macros (7) +.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/msgctl.2 b/draft/man2/msgctl.2 new file mode 100644 index 00000000..064fb314 --- /dev/null +++ b/draft/man2/msgctl.2 @@ -0,0 +1,601 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" and Copyright 2004, 2005 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 Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" Modified Sun Feb 18 01:59:29 2001 by Andries E. Brouwer +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on CAP_IPC_OWNER requirement +.\" Modified, 17 Jun 2004, Michael Kerrisk +.\" Added notes on CAP_SYS_ADMIN requirement for IPC_SET and IPC_RMID +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added msqid_ds and ipc_perm structure definitions +.\" 2005-08-02, mtk: Added IPC_INFO, MSG_INFO, MSG_STAT descriptions +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Updated & Modified 2001-06-04, Yuichi SATO +.\" Updated & Modified 2002-07-06, Yuichi SATO +.\" Updated & Modified 2004-12-31, Yuichi SATO +.\" Updated & Modified 2005-10-10, Akihiro MOTOKI +.\" +.\"WORD: message ¥á¥Ã¥»¡¼¥¸ +.\"WORD: queue ¥­¥å¡¼ +.\"WORD: member ¥á¥ó¥Ð¡¼ +.\"WORD: structure ¹½Â¤ÂÎ +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶ ID +.\"WORD: creator ºîÀ®¼Ô +.\"WORD: owner ½êÍ­¼Ô +.\"WORD: feature test macro µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\" +.TH MSGCTL 2 2008-08-06 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O msgctl \- message control operations +msgctl \- ¥á¥Ã¥»¡¼¥¸À©¸æÁàºî +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include + +.BI "int msgctl(int " msqid ", int " cmd ", struct msqid_ds *" buf ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR msgctl () +.\"O performs the control operation specified by +.\"O .I cmd +.\"O on the message queue with identifier +.\"O .IR msqid . +.BR msgctl () +¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¼±ÊÌ»Ò +.I msqid +¤Ç»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼ (message queue) ¤ËÂФ·¤Æ +.I cmd +¤Ç»ØÄꤵ¤ì¤¿À©¸æÁàºî¤ò¹Ô¤Ê¤¦¡£ +.PP +.\"O The +.\"O .I msqid_ds +.\"O data structure is defined in \fI\fP as follows: +.I msqid_ds +¥Ç¡¼¥¿¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.nf +.in +4n + +struct msqid_ds { +.\"O struct ipc_perm msg_perm; /* Ownership and permissions */ +.\"O time_t msg_stime; /* Time of last msgsnd(2) */ +.\"O time_t msg_rtime; /* Time of last msgrcv(2) */ +.\"O time_t msg_ctime; /* Time of last change */ +.\"O unsigned long __msg_cbytes; /* Current number of bytes in +.\"O queue (nonstandard) */ +.\"O msgqnum_t msg_qnum; /* Current number of messages +.\"O in queue */ +.\"O msglen_t msg_qbytes; /* Maximum number of bytes +.\"O allowed in queue */ +.\"O pid_t msg_lspid; /* PID of last msgsnd(2) */ +.\"O pid_t msg_lrpid; /* PID of last msgrcv(2) */ + struct ipc_perm msg_perm; /* ½êÍ­¸¢¤Èµö²Ä */ + time_t msg_stime; /* ºÇ¸å¤Î msgsnd(2) ¤Î»þ¹ï */ + time_t msg_rtime; /* ºÇ¸å¤Î msgrcv(2) ¤Î»þ¹ï */ + time_t msg_ctime; /* ºÇ¸å¤ËÊѹ¹¤¬¹Ô¤ï¤ì¤¿»þ¹ï */ + unsigned long __msg_cbytes; /* ¥­¥å¡¼¤Ë¤¢¤ë¸½ºß¤Î¥Ð¥¤¥È¿ô + (Èóɸ½à) */ + msgqnum_t msg_qnum; /* ¥­¥å¡¼¤Ë¤¢¤ë¸½ºßÆþ¤Ã¤Æ¤¤¤ë + ¥á¥Ã¥»¡¼¥¸¤Î¿ô */ + msglen_t msg_qbytes; /* ¥­¥å¡¼¤Ëµö²Ä¤µ¤ì¤Æ¤¤¤ë + ºÇÂç¥Ð¥¤¥È¿ô */ + pid_t msg_lspid; /* ºÇ¸å¤Î msgsnd(2) ¤Î PID */ + pid_t msg_lrpid; /* ºÇ¸å¤Î msgrcv(2) ¤Î PID */ +}; +.in +.fi +.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 +¤ò»È¤Ã¤ÆÀßÄê²Äǽ¤Ç¤¢¤ë): +.PP +.nf +.in +4n +struct ipc_perm { +.\"O key_t __key; /* Key supplied to msgget(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; /* Permissions */ +.\"O unsigned short __seq; /* Sequence number */ + key_t __key; /* msgget(2) ¤ËÍ¿¤¨¤ë¥­¡¼ */ + uid_t \fBuid\fP; /* ½êÍ­¼Ô¤Î¼Â¸ú UID */ + gid_t \fBgid\fP; /* ½êÍ­¼Ô¤Î¼Â¸ú GID */ + uid_t cuid; /* ºîÀ®¼Ô¤Î¼Â¸ú UID */ + gid_t cgid; /* ºîÀ®¼Ô¤Î¼Â¸ú GID */ + unsigned short \fBmode\fP; /* µö²Ä */ + unsigned short __seq; /* ¥·¡¼¥±¥ó¥¹ÈÖ¹æ */ +}; +.in +.fi +.PP +.\"O Valid values for +.\"O .I cmd +.\"O are: +.I cmd +¤È¤·¤ÆÍ­¸ú¤ÊÃͤÏ: +.TP +.B IPC_STAT +.\"O Copy information from the kernel data structure associated with +.\"O .I msqid +.\"O into the +.\"O .I msqid_ds +.\"O structure pointed to by +.\"O .IR buf . +.\"O The caller must have read permission on the message queue. +.I msqid +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¡¦¥Ç¡¼¥¿¹½Â¤ÂΤ«¤é¡¢¥Ý¥¤¥ó¥¿ +.I buf +¤¬»Ø¤·¼¨¤¹ +.I msqid_ds +¹½Â¤ÂΤ˾ðÊó¤ò¥³¥Ô¡¼¤¹¤ë¡£ +¸Æ¤Ó½Ð¤·Â¦¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÂФ¹¤ëÆɤ߹þ¤ßµö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B IPC_SET +.\"O Write the values of some members of the +.\"O .I msqid_ds +.\"O structure pointed to by +.\"O .I buf +.\"O to the kernel data structure associated with this message queue, +.\"O updating also its +.\"O .I msg_ctime +.\"O member. +¥Ý¥¤¥ó¥¿ +.I buf +¤¬»Ø¤·¼¨¤¹ +.I msqid_ds +¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤ÎÃͤò¡¢¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿ +¥«¡¼¥Í¥ë¡¦¥Ç¡¼¥¿¹½Â¤ÂΤ˽ñ¤­¹þ¤ß¡¢ +.I msg_ctime +¥á¥ó¥Ð¡¼¤â¹¹¿·¤¹¤ë¡£ +.\"O The following members of the structure are updated: +¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Î¤¦¤Á¡¢¹¹¿·¤µ¤ì¤ë¤â¤Î¤ò°Ê²¼¤Ë¼¨¤¹: +.\"O .IR msg_qbytes , +.\"O .IR msg_perm.uid , +.\"O .IR msg_perm.gid , +.\"O and (the least significant 9 bits of) +.\"O .IR msg_perm.mode . +.IR msg_qbytes , +.IR msg_perm.uid , +.IR msg_perm.gid , +.I msg_perm.mode +(¤Î²¼°Ì 9 ¥Ó¥Ã¥È)¡£ +.\"O The effective UID of the calling process must match the owner +.\"O .RI ( msg_perm.uid ) +.\"O or creator +.\"O .RI ( msg_perm.cuid ) +.\"O of the message queue, or the caller must be privileged. +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬¡¢¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î½êÍ­¼Ô +.RI ( msg_perm.uid ) +¤Þ¤¿¤ÏºîÀ®¼Ô +.RI ( msg_perm.cuid ) +¤È°ìÃפ¹¤ë¤«¡¢¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O Appropriate privilege (Linux: the +.\"O .B CAP_IPC_RESOURCE +.\"O capability) is required to raise the +.\"O .I msg_qbytes +.\"O value beyond the system parameter +.\"O .BR MSGMNB . +.I msg_qbytes +¤ò¥·¥¹¥Æ¥à¡¦¥Ñ¥é¥á¡¼¥¿¤Î +.B MSGMNB +¤òĶ¤¨¤ÆÀßÄꤹ¤ë¤Ë¤Ï¡¢Å¬ÀÚ¤ÊÆø¢ (Linux ¤Ç¤Ï +.B CAP_IPC_RESOURCE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability)) ¤¬É¬ÍפǤ¢¤ë¡£ +.TP +.B IPC_RMID +.\"O Immediately remove the message queue, +.\"O awakening all waiting reader and writer processes (with an error +.\"O return and +.\"O .I errno +.\"O set to +.\"O .BR EIDRM ). +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ò¤¿¤À¤Á¤Ëºï½ü¤¹¤ë¡£ +Ʊ»þ¤Ë¤½¤Î¹½Â¤ÂΤÎÆɤ߽ñ¤­¤ÎÂÔ¤Á¾õÂ֤ˤ¢¤Ã¤¿¥×¥í¥»¥¹¤ËÄÌÃΤ¹¤ë +(¥¨¥é¡¼¤¬Ê֤ꡢ +.I errno +¤¬ +.B EIDRM +¤ËÀßÄꤵ¤ì¤ë)¡£ +.\"O The calling process must have appropriate privileges +.\"O or its effective user ID must be either that of the creator or owner +.\"O of the message queue. +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬Å¬ÀÚ¤ÊÆø¢¤ò»ý¤Ã¤Æ¤¤¤ë¤«¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ÎºîÀ®¼Ô¤« +½êÍ­¼Ô¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.\"O .BR IPC_INFO " (Linux-specific)" +.BR IPC_INFO " (Linux ¸ÇÍ­)" +.\"O Returns information about system-wide message queue limits and +.\"O parameters in the structure pointed to by +.\"O .IR buf . +¥·¥¹¥Æ¥àÁ´ÂΤǤΥá¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ÎÀ©¸Â¤È¥Ñ¥é¥á¡¼¥¿¤Ë´Ø¤¹¤ë¾ðÊó¤ò¡¢ +.I buf +¤¬»Ø¤¹¹½Â¤ÂΤËÆþ¤ì¤ÆÊÖ¤¹¡£ +.\"O This structure is of type +.\"O .I msginfo +.\"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 msginfo +·¿¤Ç¤¢¤ë (¤½¤Î¤¿¤á¥­¥ã¥¹¥È¤¬É¬ÍפǤ¢¤ë)¡£ +.I msginfo +¤Ï +.B _GNU_SOURCE +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.nf +.in +4n + +struct msginfo { +.\"O int msgpool; /* Size in kibibytes of buffer pool +.\"O used to hold message data; +.\"O unused within kernel */ +.\"O int msgmap; /* Maximum number of entries in message +.\"O map; unused within kernel */ +.\"O int msgmax; /* Maximum number of bytes that can be +.\"O written in a single message */ +.\"O int msgmnb; /* Maximum number of bytes that can be +.\"O written to queue; used to initialize +.\"O msg_qbytes during queue creation +.\"O (msgget(2)) */ +.\"O int msgmni; /* Maximum number of message queues */ +.\"O int msgssz; /* Message segment size; +.\"O unused within kernel */ +.\"O int msgtql; /* Maximum number of messages on all queues +.\"O in system; unused within kernel */ +.\"O unsigned short int msgseg; +.\"O /* Maximum number of segments; +.\"O unused within kernel */ + int msgpool; /* ¥á¥Ã¥»¡¼¥¸¡¦¥Ç¡¼¥¿¤ÎÊÝ»ý¤Ë»ÈÍѤµ¤ì¤ë + ¥Ð¥Ã¥Õ¥¡¡¦¥×¡¼¥ë¤ÎÂ礭¤µ (1024 ¥Ð¥¤¥Èñ°Ì); + ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + int msgmap; /* ¥á¥Ã¥»¡¼¥¸¡¦¥Þ¥Ã¥×¤ÎºÇÂ票¥ó¥È¥ê¿ô; + ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + int msgmax; /* °ì¤Ä¤Î¥á¥Ã¥»¡¼¥¸¤Ë½ñ¤­¹þ¤ß²Äǽ¤Ê + ºÇÂç¥Ð¥¤¥È¿ô */ + int msgmnb; /* °ì¤Ä¤Î¥­¥å¡¼¤Ë½ñ¤­¹þ¤ß²Äǽ¤ÊºÇÂç¥Ð¥¤¥È¿ô; + (msgget(2) ¤Ç¤Î) ¥­¥å¡¼ºîÀ®Ãæ¤Î msg_qbytes + ¤Î½é´ü²½¤Ë»ÈÍѤµ¤ì¤ë */ + int msgmni; /* ¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¿ô¤ÎºÇÂçÃÍ */ + int msgssz; /* ¥á¥Ã¥»¡¼¥¸¡¦¥»¥°¥á¥ó¥È¤Î¥µ¥¤¥º; + ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + int msgtql; /* ¥·¥¹¥Æ¥à¾å¤ÎÁ´¥­¥å¡¼¤ÎºÇÂç¥á¥Ã¥»¡¼¥¸¿ô; + ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + unsigned short int msgseg; + /* ºÇÂ祻¥°¥á¥ó¥È¿ô; ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ +}; + +.in +.fi +.\"O The +.\"O .IR msgmni , +.\"O .IR msgmax , +.\"O and +.\"O .I msgmnb +.\"O settings can be changed via +.\"O .I /proc +.\"O files of the same name; see +.\"O .BR proc (5) +.\"O for details. +ÀßÄê +.I msgmni , +.I msgmax , +.I msgmnb +¤Ï +.I /proc +¤Ë¤¢¤ëƱ¤¸Ì¾Á°¤Î¥Õ¥¡¥¤¥ë·Ðͳ¤ÇÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +¾Ü¤·¤¯¤Ï +.BR proc (5) +¤ò»²¾È¡£ +.TP +.\"O .BR MSG_INFO " (Linux-specific)" +.BR MSG_INFO " (Linux ¸ÇÍ­)" +.\"O Returns a +.\"O .I msginfo +.\"O structure containing the same information as for +.\"O .BR IPC_INFO , +.\"O except that the following fields are returned with information +.\"O about system resources consumed by message queues: the +.\"O .I msgpool +.\"O field returns the number of message queues that currently exist +.\"O on the system; the +.\"O .I msgmap +.\"O field returns the total number of messages in all queues +.\"O on the system; and the +.\"O .I msgtql +.\"O field returns the total number of bytes in all messages +.\"O in all queues on the system. +.B IPC_INFO +¤Î¤È¤­¤ÈƱ¤¸¾ðÊó¤ò³ÊǼ¤·¤¿ +.I msginfo +¹½Â¤ÂΤòÊÖ¤¹¡£ +⤷¡¢°Ê²¼¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬ +¾ÃÈñ¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à»ñ¸»¤Ë´Ø¤¹¤ë¾ðÊ󤬳ÊǼ¤µ¤ì¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +.I msgpool +¥Õ¥£¡¼¥ë¥É¤Ï¸½ºß¥·¥¹¥Æ¥à¾å¤Ë¸ºß¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¿ô¤òÊÖ¤¹¡£ +.I msgmap +¥Õ¥£¡¼¥ë¥É¤Ï¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸Áí¿ô¤òÊÖ¤¹¡£ +.I msgtql +¥Õ¥£¡¼¥ë¥É¤Ï¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ëÁ´¥á¥Ã¥»¡¼¥¸¤Î +Áí¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +.TP +.\"O .BR MSG_STAT " (Linux-specific)" +.BR MSG_STAT " (Linux ¸ÇÍ­)" +.\"O Returns a +.\"O .I msqid_ds +.\"O structure as for +.\"O .BR IPC_STAT . +.B IPC_STAT +¤ÈƱ¤¸¤¯ +.I msqid_ds +¹½Â¤ÂΤòÊÖ¤¹¡£ +.\"O However, the +.\"O .I msqid +.\"O argument is not a queue identifier, but instead an index into +.\"O the kernel's internal array that maintains information about +.\"O all message queues on the system. +⤷¡¢ +.I msqid +°ú¤­¿ô¤Ï¡¢¥­¥å¡¼¼±Ê̻ҤǤϤʤ¯¡¢¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼ +¤Ë´Ø¤¹¤ë¾ðÊó¤ò´ÉÍý¤¹¤ë¥«¡¼¥Í¥ë¤ÎÆâÉôÇÛÎó¤Ø¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR IPC_STAT , +.\"O .BR IPC_SET , +.\"O and +.\"O .B IPC_RMID +.\"O return 0. +À®¸ù¤¹¤ë¤È¡¢ +.BR IPC_STAT , +.BR IPC_SET , +.B IPC_RMID +¤Ï 0 ¤òÊÖ¤¹¡£ +.\"O A successful +.\"O .B IPC_INFO +.\"O or +.\"O .B MSG_INFO +.\"O operation returns the index of the highest used entry in the +.\"O kernel's internal array recording information about all +.\"O message queues. +.B IPC_INFO +¤È +.B MSG_INFO +Áàºî¤Ï¡¢À®¸ù¤¹¤ë¤È¡¢Á´¤Æ¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ë´Ø¤¹¤ë¾ðÊó¤ò +´ÉÍý¤·¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤ÎÆâÉôÇÛÎó¤Î»ÈÍÑÃ楨¥ó¥È¥ê¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î +¤¦¤ÁºÇÂçÃͤòÊÖ¤¹ +.\"O (This information can be used with repeated +.\"O .B MSG_STAT +.\"O operations to obtain information about all queues on the system.) +(¤³¤Î¾ðÊó¤Ï¡¢¥·¥¹¥Æ¥à¤ÎÁ´¤Æ¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ë´Ø¤¹¤ë¾ðÊó¤ò +¼èÆÀ¤¹¤ë¤¿¤á¤Ë¡¢ +.B MSG_STAT +Áàºî¤ò·«¤êÊÖ¤·¼Â¹Ô¤¹¤ëºÝ¤Ë»ÈÍѤǤ­¤ë)¡£ +.\"O A successful +.\"O .B MSG_STAT +.\"O operation returns the identifier of the queue whose index was given in +.\"O .IR msqid . +.B MSG_STAT +Áàºî¤Ï¡¢À®¸ù¤¹¤ë¤È¡¢ +.I msqid +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¼±Ê̻ҤòÊÖ¤¹¡£ + +.\"O On error, \-1 is returned with +.\"O .I errno +.\"O indicating the error. +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O On failure, +.\"O .I errno +.\"O is set to one of the following: +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ï°Ê²¼¤ÎÃͤÎÃæ¤Î¤É¤ì¤«°ì¤Ä¤ËÀßÄꤵ¤ì¤ë: +.TP +.B EACCES +.\"O The argument +.\"O .I cmd +.\"O is equal to +.\"O .B IPC_STAT +.\"O or +.\"O .BR MSG_STAT , +.\"O but the calling process does not have read permission on the message queue +.\"O .IR msqid , +.\"O and does not have the +.\"O .B CAP_IPC_OWNER +.\"O capability. +°ú¤­¿ô +.I cmd +¤¬ +.B IPC_STAT +¤Þ¤¿¤Ï +.B MSG_STAT +¤ËÅù¤·¤¤¤¬¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼ +.I msqid +¤ËÂФ¹¤ëÆɤ߹þ¤ßµö²Ä¤ò»ý¤Ã¤Æ¤ª¤é¤º¡¢¤«¤Ä +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +.\"O The argument +.\"O .I cmd +.\"O has the value +.\"O .B IPC_SET +.\"O or +.\"O .BR 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 The message queue was removed. +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬ºï½ü¤µ¤ì¤¿¡£ +.TP +.B EINVAL +.\"O Invalid value for +.\"O .I cmd +.\"O or +.\"O .IR msqid . +.\"O Or: for a +.\"O .B MSG_STAT +.\"O operation, the index value specified in +.\"O .I msqid +.\"O referred to an array slot that is currently unused. +.I cmd +¤Þ¤¿¤Ï +.I msqid +¤ËÉÔÀµ¤ÊÃͤ¬ÀßÄꤵ¤ì¤¿¡£ +¤â¤·¤¯¤Ï¡¢ +.B MSG_STAT +Áàºî¤Î¾ì¹ç¤Ë¡¢ +.I msqid +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹Ãͤ¬¸½ºß̤»ÈÍѤÎÇÛÎó¤Î¥¹¥í¥Ã¥È¤ò»²¾È¤¤¤Æ¤¤¤¿¡£ +.TP +.B EPERM +.\"O The argument +.\"O .I cmd +.\"O has the value +.\"O .B IPC_SET +.\"O or +.\"O .BR IPC_RMID , +.\"O but the effective user ID of the calling process is not the creator +.\"O (as found in +.\"O .IR msg_perm.cuid ) +.\"O or the owner +.\"O (as found in +.\"O .IR msg_perm.uid ) +.\"O of the message queue, +.\"O and the process is not privileged (Linux: it does not have the +.\"O .B CAP_SYS_ADMIN +.\"O capability). +°ú¤­¿ô +.I cmd +¤¬ +.B IPC_SET +¤« +.B IPC_RMID +¤Ç¤¢¤ë¤¬¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î +.RI ( msg_perm.cuid +¤È¤·¤Æ¸«¤Ä¤«¤ë) ºîÀ®¼Ô +¤È +.RI ( msg_perm.uid +¤È¤·¤Æ¸«¤Ä¤«¤ë) ½êÍ­¼Ô¤Î¤¤¤º¤ì¤Ç¤â¤Ê¤¯¡¢ +¤«¤Ä¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ËÆø¢ (Linux ¤Ç¤Ï +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤¬¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O .\" SVID does not document the EIDRM error condition. +.\" SVID ¤Ë¤Ï EIDRM ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The +.\"O .BR IPC_INFO , +.\"O .B MSG_STAT +.\"O and +.\"O .B MSG_INFO +.\"O operations are used by the +.\"O .BR ipcs (8) +.\"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 MSG_STAT , +.B MSG_INFO +Áàºî¤Ï¡¢ +.BR ipcs (8) +¥×¥í¥°¥é¥à¤Ç³ä¤êÅö¤ÆºÑ¤Î»ñ¸»¤Ë´Ø¤¹¤ë¾ðÊó¤òÄ󶡤¹¤ë¤¿¤á¤Ë +»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£¾­Íè¡¢¤³¤ì¤é¤ÎÁàºî¤ÏÊѹ¹¤µ¤ì¤¿¤ê¡¢ +/proc ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë°ÜÆ°¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + + +.\"O Various fields in the \fIstruct msqid_ds\fP were +.\"O 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 .) +\fIstruct msqid_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" +.SH ´ØÏ¢¹àÌÜ +.BR msgget (2), +.BR msgrcv (2), +.BR msgsnd (2), +.BR capabilities (7), +.BR mq_overview (7), +.BR svipc (7) diff --git a/draft/man2/msgget.2 b/draft/man2/msgget.2 new file mode 100644 index 00000000..534b5c67 --- /dev/null +++ b/draft/man2/msgget.2 @@ -0,0 +1,399 @@ +.\" Copyright 1993 Giorgio Ciucci +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provflags 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. +.\" +.\" Added correction due to Nick Duffek , aeb, 960426 +.\" Modified Wed Nov 6 04:00:31 1996 by Eric S. Raymond +.\" Modified, 8 Jan 2003, Michael Kerrisk, +.\" Removed EIDRM from errors - that can't happen... +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added notes on /proc files +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Modified 2003-07-03, Akihiro MOTOKI +.\" Updated 2005-03-04, Akihiro MOTOKI +.\" +.\"WORD: message ¥á¥Ã¥»¡¼¥¸ +.\"WORD: queue ¥­¥å¡¼ +.\"WORD: identifier ¼±ÊÌ»Ò +.\"WORD: argument °ú¤­¿ô +.\"WORD: owner ½êÍ­¼Ô +.\"WORD: group ¥°¥ë¡¼¥× +.\"WORD: other ¾¿Í +.\"WORD: initialize ½é´ü²½ +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: effective group ID ¼Â¸ú¥°¥ë¡¼¥×ID +.\"WORD: current time ¸½ºß»þ¹ï +.\"WORD: destruction ÇË´þ +.\"WORD: policy Êý¿Ë +.\" +.TH MSGGET 2 2004-05-27 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O msgget \- get a message queue identifier +.SH ̾Á° +msgget \- ¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¼±Ê̻Ҥò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include + +.BI "int msgget(key_t " key ", int " msgflg ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR msgget () +.\"O system call returns the message queue identifier associated +.\"O with the value of the +.\"O .I key +.\"O argument. +.BR msgget () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I key +°ú¤­¿ô¤ÎÃͤËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¼±Ê̻ҤòÊÖ¤¹¡£ +.\"O A new message queue 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 message queue with the given key +.\"O .I key +.\"O exists, and +.\"O .B IPC_CREAT +.\"O is specified in +.\"O .IR msgflg . +.I key +¤ÎÃͤ¬ +.B IPC_PRIVATE +¤Î¾ì¹ç¡¢¤Þ¤¿¤Ï +.I key +¤¬ +.B IPC_PRIVATE +¤Ç¤Ê¤¯¤Æ¤â¡¢ +.I key +¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬Â¸ºß¤»¤º¡¢ +.I msgflg +¤Ë +.B IPC_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬ºîÀ®¤µ¤ì¤ë¡£ +.PP +.\"O If +.\"O .I msgflg +.\"O specifies both +.\"O .B IPC_CREAT +.\"O and +.\"O .B IPC_EXCL +.\"O and a message queue already exists for +.\"O .IR key , +.\"O then +.\"O .BR msgget () +.\"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 msgflg +¤Ë +.B IPC_CREAT +¤È +.B IPC_EXCL +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.I key +¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬´û¤Ë¸ºß¤¹¤ë¤È¡¢ +.BR msgget () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EEXIST +¤¬ÀßÄꤵ¤ì¤ë¡£ +(¤³¤ì¤Ï +.BR open (2) +¤Ë +.B O_CREAT | O_EXCL +¤ò»ØÄꤷ¤¿¾ì¹ç¤ÎÆ°ºî¤ÈƱ¤¸¤Ç¤¢¤ë) +.PP +.\"O Upon creation, the least significant bits of the argument +.\"O .I msgflg +.\"O define the permissions of the message queue. +.\"O These permission bits have the same format and semantics +.\"O as the permissions specified for the +.\"O .I mode +.\"O argument of +.\"O .BR open (2). +.\"O (The execute permissions are not used.) +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ÎºîÀ®»þ¤Ë¡¢ +.I msgflg +°ú¤­¿ô¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤Ï¡¢ +¤½¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥¢¥¯¥»¥¹µö²Ä¤ÎÄêµÁ¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +¤³¤ì¤é¤Îµö²Ä¥Ó¥Ã¥È¤Ï +.BR open (2) +¤Î°ú¤­¿ô +.I mode +¤ÈƱ¤¸·Á¼°¤ÇƱ¤¸°ÕÌ£¤Ç¤¢¤ë¡£ +¤ä +.BR creat (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Î¥¢¥¯¥»¥¹µö²Ä¥Ñ¥é¥á¡¼¥¿¤ÈƱ¤¸·Á¼°¤Ç¡¢Æ±¤¸°ÕÌ£¤ò»ý¤Ä¡£ +(⤷¡¢¼Â¹Ô (execute) µö²Ä¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£) +.PP +.\"O If a new message queue is created, +.\"O then its associated data structure +.\"O .I msqid_ds +.\"O (see +.\"O .BR msgctl (2)) +.\"O is initialized as follows: +¿·µ¬¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤òºîÀ®¤¹¤ëºÝ¡¢ +.BR msgget () +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥Ç¡¼¥¿¹½Â¤ÂÎ +.I msqid_ds +¤ò°Ê²¼¤Î¤è¤¦¤Ë½é´ü²½¤¹¤ë +.RI ( msqid_ds +¤Ë¤Ä¤¤¤Æ¤Ï +.BR msgctl (2) +¤ò»²¾È): +.IP +.\"O .I msg_perm.cuid +.\"O and +.\"O .I msg_perm.uid +.\"O are set to the effective user ID of the calling process. +.I msg_perm.cuid +¤È +.I msg_perm.uid +¤Ë¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ID ¤òÀßÄꤹ¤ë¡£ +.IP +.\"O .I msg_perm.cgid +.\"O and +.\"O .I msg_perm.gid +.\"O are set to the effective group ID of the calling process. +.I msg_perm.cgid +¤È +.I msg_perm.gid +¤Ë¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥°¥ë¡¼¥×ID ¤òÀßÄꤹ¤ë¡£ +.IP +.\"O The least significant 9 bits of +.\"O .I msg_perm.mode +.\"O are set to the least significant 9 bits of +.\"O .IR msgflg . +.I msg_perm.mode +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤Ï +.I msgflg +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤òÀßÄꤹ¤ë¡£ +.IP +.\"O .IR msg_qnum , +.\"O .IR msg_lspid , +.\"O .IR msg_lrpid , +.\"O .I msg_stime +.\"O and +.\"O .I msg_rtime +.\"O are set to 0. +.IR msg_qnum , +.IR msg_lspid , +.IR msg_lrpid , +.IR msg_stime , +.I msg_rtime +¤Ë 0 ¤òÀßÄꤵ¤ì¤ë¡£ +.IP +.\"O .I msg_ctime +.\"O is set to the current time. +.I msg_ctime +¤Ë¸½ºß¤Î»þ¹ï¤òÀßÄꤹ¤ë¡£ +.IP +.\"O .I msg_qbytes +.\"O is set to the system limit +.\"O .BR MSGMNB . +.I msg_qbytes +¤Ë¡¢¥·¥¹¥Æ¥à¤Ç·è¤á¤é¤ì¤¿¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ÎºÇÂ祵¥¤¥º +.B MSGMNB +¤òÀßÄꤹ¤ë¡£ +.PP +.\"O If the message queue already exists the permissions are +.\"O verified, and a check is made to see if it is marked for +.\"O destruction. +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ï¡¢¥¢¥¯¥»¥¹µö²Ä¤Î¸¡ºº¤È¡¢ +ÇË´þ (destruction) ¥Þ¡¼¥¯¤¬¤Ê¤¤¤«¤Î³Îǧ¤¬¹Ô¤ï¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O If successful, the return value will be the message queue identifier (a +.\"O nonnegative integer), otherwise \-1 +.\"O with +.\"O .I errno +.\"O indicating the error. +À®¸ù¤·¤¿¾ì¹ç¡¢ÊÖ¤êÃͤϥá¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¼±ÊÌ»Ò (ÈóÉé¤ÎÀ°¿ô) ¤È¤Ê¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤Ë¤½¤Î¥¨¥é¡¼¤¬¼¨¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O On failure, +.\"O .I errno +.\"O is set to one of the following values: +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ë°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤¬ÀßÄꤵ¤ì¤ë: +.TP +.B EACCES +.\"O A message queue exists for +.\"O .IR key , +.\"O but the calling process does not have permission to access the queue, +.\"O and does not have the +.\"O .B CAP_IPC_OWNER +.\"O capability. +.I key +¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ï¸ºß¤¹¤ë¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï¤½¤Î¥­¥å¡¼¤ËÂФ¹¤ë¥¢¥¯¥»¥¹µö²Ä¤¬¤Ê¤¯¡¢ +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EEXIST +.\"O A message queue exists for +.\"O .I key +.\"O and +.\"O .I msgflg +.\"O specified both +.\"O .B IPC_CREAT +.\"O and +.\"O .BR IPC_EXCL . +.I key +¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬Â¸ºß¤·¡¢ +.I msgflg +¤Ë +.B IPC_CREAT +¤È +.B IPC_EXCL +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¡£ +.TP +.B ENOENT +.\"O No message queue exists for +.\"O .I key +.\"O and +.\"O .I msgflg +.\"O did not specify +.\"O .BR IPC_CREAT . +.I key +¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬Â¸ºß¤»¤º¡¢ +.I msgflg +¤Ë +.B IPC_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O A message queue has to be created but the system does not have enough +.\"O memory for the new data structure. +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤òºîÀ®¤·¤è¤¦¤È¤·¤¿¤¬¡¢¿·¤·¤¤¥Ç¡¼¥¿¹½Â¤ÂΤòºîÀ® +¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOSPC +.\"O A message queue has to be created but the system limit for the maximum +.\"O number of message queues +.\"O .RB ( MSGMNI ) +.\"O would be exceeded. +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤òºîÀ®¤·¤è¤¦¤È¤·¤¿¤¬¡¢ºîÀ®¤¹¤ë¤È +¥·¥¹¥Æ¥àÁ´ÂΤΥá¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¿ô¤ÎºÇÂçÃÍ +.RB ( MSGMNI ) +¤òĶ¤¨¤Æ¤·¤Þ¤¦¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O .SH NOTES +.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 msgflg +.\"O and creates a new message queue (on success). +¤³¤ÎÆÃÊ̤ÊÃͤ¬ +.I key +¤È¤·¤Æ»ÈÍѤµ¤ì¤¿¾ì¹ç¡¢ +.BR msgget () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I msgflg +¤Î²¼°Ì 9 ¥Ó¥Ã¥È°Ê³°¤ÎÁ´¤Æ¤ò̵»ë¤·¤Æ +(À®¸ù¤·¤¿¾ì¹ç¤Ï) ¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤òºîÀ®¤¹¤ë¡£ +.PP +.\"O The following is a system limit on message queue resources affecting a +.\"O .BR msgget () +.\"O call: +.BR msgget () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î»ñ¸»¤Î +¥·¥¹¥Æ¥à¤È¤·¤Æ¤ÎÀ©¸Â¤ò°Ê²¼¤Ë¼¨¤¹: +.TP +.B MSGMNI +.\"O System wide maximum number of message queues: policy +.\"O dependent +.\"O (on Linux, this limit can be read and modified via +.\"O .IR /proc/sys/kernel/msgmni ). +¥·¥¹¥Æ¥àÁ´ÂΤΥá¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¿ô¤ÎºÇÂçÃÍ: Êý¿Ë°Í¸ +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/msgmni +·Ðͳ¤Ç»²¾È¤·¤¿¤ê¡¢Êѹ¹¤·¤¿¤ê¤Ç¤­¤ë)¡£ +.\"O .SS "Linux Notes" +.SS Linux ¤Ç¤ÎÃí°Õ +.\"O Until version 2.3.20 Linux would return +.\"O .B EIDRM +.\"O for a +.\"O .BR msgget () +.\"O on a message queue scheduled for deletion. +Linux 2.3.20 ¤Þ¤Ç¤Ï¡¢ºï½ü¤¬Í½Äꤵ¤ì¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÂФ·¤Æ +.BR msgget () +¤ò¹Ô¤¦¤È +.B EIDRM +¤¬¥¨¥é¡¼¤È¤·¤ÆÊÖ¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£ +.\"O .SH BUGS +.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" +.SH ´ØÏ¢¹àÌÜ +.BR msgctl (2), +.BR msgrcv (2), +.BR msgsnd (2), +.BR ftok (3), +.BR capabilities (7), +.BR mq_overview (7), +.BR svipc (7) diff --git a/draft/man2/msgop.2 b/draft/man2/msgop.2 new file mode 100644 index 00000000..e7b83a61 --- /dev/null +++ b/draft/man2/msgop.2 @@ -0,0 +1,748 @@ +.\" Copyright 1993 Giorgio Ciucci +.\" +.\" 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 Tue Oct 22 16:40:11 1996 by Eric S. Raymond +.\" Modified Mon Jul 10 21:09:59 2000 by aeb +.\" Modified 1 Jun 2002, Michael Kerrisk +.\" Language clean-ups. +.\" Enhanced and corrected information on msg_qbytes, MSGMNB and MSGMAX +.\" Added note on restart behavior of msgsnd() and msgrcv() +.\" Formatting clean-ups (argument and field names marked as .I +.\" instead of .B) +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added notes on /proc files +.\" FIXME . Add example programs to this page. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Modified 2000-09-23, HANATAKA Shinya +.\" Updated 2002-11-26, Kentaro Shirakata +.\" Updated 2005-03-04, Akihiro MOTOKI +.\" Updated 2006-03-05, Akihiro MOTOKI, LDP v2.25 +.\" Updated 2008-08-09, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: message ¥á¥Ã¥»¡¼¥¸ +.\"WORD: operation Áàºî +.\"WORD: queue ¥­¥å¡¼ +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: catch Êá³Í(catch) +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: suspend Ää»ß(suspend) +.\"WORD: sleep Ää»ß(sleep) +.\"WORD: block Ää»ß(block) +.\"WORD: process-ID ¥×¥í¥»¥¹ID +.\"WORD: type ·¿ +.\"WORD: policy Êý¿Ë +.\"WORD: super-user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\"WORD: current time ¸½ºß»þ¹ï +.\"WORD: implement ¼ÂÁõ +.\" +.TH MSGOP 2 2008-04-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O msgrcv, msgsnd \- message operations +msgrcv, msgsnd \- ¥á¥Ã¥»¡¼¥¸Áàºî +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int msgsnd(int " msqid ", const void *" msgp ", size_t " msgsz \ +", int " msgflg ); +.sp +.BI "ssize_t msgrcv(int " msqid ", void *" msgp ", size_t " msgsz \ +", long " msgtyp , +.BI " int " msgflg ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR msgsnd () +.\"O and +.\"O .BR msgrcv () +.\"O system calls are used, respectively, to send messages to, +.\"O and receive messages from, a message queue. +.\"O The calling process must have write permission on the message queue +.\"O in order to send a message, and read permission to receive a message. +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR msgsnd () +¤È +.BR msgrcv () +¤Ï¤½¤ì¤¾¤ì¡¢¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ø¤Î¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®¤È¡¢ +¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®¤Ë»ÈÍѤµ¤ì¤ë¡£¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï¡¢ +¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤¹¤ë¤¿¤á¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÂФ¹¤ë½ñ¤­¹þ¤ßµö²Ä¤ò¡¢ +¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë¤¿¤á¤Ë¤ÏÆɤ߽Ф·µö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The +.\"O .I msgp +.\"O argument is a pointer to caller-defined structure +.\"O of the following general form: +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï°Ê²¼¤Ë¼¨¤¹¹½Â¤ÂΤòÍÑ°Õ¤·¡¢¤³¤Î¹½Â¤ÂΤؤΠ+¥Ý¥¤¥ó¥¿¤ò +.msgp +°ú¤­¿ô¤È¤·¤ÆÅϤ¹¡£ +.in +4n +.nf + +struct msgbuf { + long mtype; /* message type, must be > 0 */ + char mtext[1]; /* message data */ +}; +.fi +.in +.PP +.\"O The +.\"O .I mtext +.\"O field is an array (or other structure) whose size is specified by +.\"O .IR msgsz , +.\"O a nonnegative integer value. +.I mtext +¥Õ¥£¡¼¥ë¥É¤ÏÇÛÎó (¤Þ¤¿¤Ï¾¤Î¹½Â¤ÂÎ) ¤Ç¡¢¤½¤ÎÂ礭¤µ¤Ï +ÈóÉé¤ÎÀ°¿ô¤Ç¤¢¤ë +.I msgsz +¤Ç»ØÄꤵ¤ì¤ë¡£ +.\"O Messages of zero length (i.e., no +.\"O .I mtext +.\"O field) are permitted. +Ťµ 0 ¤Î¥á¥Ã¥»¡¼¥¸ (¤Ä¤Þ¤ê +.I mtext +¥Õ¥£¡¼¥ë¥É¤¬¤Ê¤¤¥á¥Ã¥»¡¼¥¸) ¤âǧ¤á¤é¤ì¤Æ¤¤¤ë¡£ +.\"O The +.\"O .I mtype +.\"O field must have a strictly positive integer value. +.\"O This value can be +.\"O used by the receiving process for message selection +.\"O (see the description of +.\"O .BR msgrcv () +.\"O below). +.B mtype +¥Õ¥£¡¼¥ë¥É¤Ï¸·Ì©¤ËÀµ¤ÎÀ°¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ÎÃͤϡ¢¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë¥×¥í¥»¥¹¤Ç¥á¥Ã¥»¡¼¥¸¤òÁªÂò¤¹¤ë¤¿¤á¤Ë +»ÈÍѤµ¤ì¤ë (²¼µ­¤Î +.BR msgrcv () +¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È)¡£ +.SS msgsnd() +.\"O The +.\"O .BR msgsnd () +.\"O system call appends a copy of the message pointed to by +.\"O .I msgp +.\"O to the message queue whose identifier is specified +.\"O by +.\"O .IR msqid . +.BR msgsnd () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I msgp +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤Î¥³¥Ô¡¼¤ò +.I msqid +¤Ç»ØÄꤵ¤ì¤¿¼±Ê̻Ҥò»ý¤Ä¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ØÄɲ乤롣 +.PP +.\"O If sufficient space is available in the queue, +.\"O .BR msgsnd () +.\"O succeeds immediately. +¥­¥å¡¼¤Ë½½Ê¬¤Ê¶õ¤­ÍÆÎ̤¬¤¢¤ë¾ì¹ç¡¢ +.BR msgsnd () +¤Ïľ¤Á¤ËÀ®¸ù¤¹¤ë¡£ +.\"O (The queue capacity is defined by the +.\"O .I msg_bytes +.\"O field in the associated data structure for the message queue. +.\"O During queue creation this field is initialized to +.\"O .B MSGMNB +.\"O bytes, but this limit can be modified using +.\"O .BR msgctl (2).) +(¥­¥å¡¼¤ÎÍÆÎ̤ϡ¢¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥Ç¡¼¥¿¹½Â¤ÂΤΠ+.I msg_bytes +¥Õ¥£¡¼¥ë¥É¤ÇÄêµÁ¤µ¤ì¤ë¡£ +¥­¥å¡¼ºîÀ®»þ¤Ë¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï +.B MSGMNB +¤Ë½é´ü²½¤µ¤ì¤ë¤¬¡¢¤³¤ÎÀ©¸Â¤Ï +.BR msgctl (2) +¤ò»È¤Ã¤ÆÊѹ¹¤Ç¤­¤ë¡£) +.\"O If insufficient space is available in the queue, then the default +.\"O behavior of +.\"O .BR msgsnd () +.\"O is to block until space becomes available. +¥­¥å¡¼¤Ë½½Ê¬¤Ê¶õ¤­ÍÆÎ̤¬¤Ê¤¤¾ì¹ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +.BR msgsnd () +¤Ï¶õ¤­ÍÆÎ̤¬¤Ç¤­¤ë¤Þ¤ÇÄä»ß (block) ¤¹¤ë¡£ +.\"O If +.\"O .B IPC_NOWAIT +.\"O is specified in +.\"O .IR msgflg , +.\"O then the call instead fails with the error +.\"O .BR EAGAIN . +.I msgflg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¡£ + +.\"O A blocked +.\"O .BR msgsnd () +.\"O call may also fail if: +Ää»ß¤·¤Æ¤¤¤ë +.BR msgsnd () +¤Ï°Ê²¼¤Î¾ì¹ç¤Ë¤â¼ºÇÔ¤¹¤ë¡£ +.IP * 2 +.\"O the queue is removed, +.\"O in which case the system call fails with +.\"O .I errno +.\"O set to +.\"O .BR EIDRM ; +.\"O or +¥­¥å¡¼¤¬ºï½ü¤µ¤ì¤¿¡£ +¤³¤Î¾ì¹ç¡¢ +.I errno +¤Ï +.B EIDRM +¤ËÀßÄꤵ¤ì¤ë¡£ +.IP * +.\"O a signal is caught, in which case the system call fails +.\"O with +.\"O .I errno +.\"O set to +.\"O .BR EINTR ; see +.\"O .BR signal (7). +¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤¿¡£ +¤³¤Î¾ì¹ç¡¢ +.I errno +¤Ï +.BR EINTR +¤ËÀßÄꤵ¤ì¤ë¡£ +.BR signal (7) +»²¾È¡£ +.\"O .RB ( msgsnd () +.\"O is never automatically restarted after being interrupted by a +.\"O signal handler, regardless of the setting of the +.\"O .B SA_RESTART +.\"O flag when establishing a signal handler.) +.RB ( msgsnd () +¤Ï¡¢¤¿¤È¤¨¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÀßÄê»þ¤Ë +.B SA_RESTART +¤ò»ØÄꤷ¤Æ¤¤¤¿¤È¤·¤Æ¤â¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¸å¤Ç +¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£) +.PP +.\"O Upon successful completion the message queue data structure is updated +.\"O as follows: +Àµ¾ï¤Ë½ªÎ»¤·¤¿¾ì¹ç¡¢¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤Ë +¹¹¿·¤µ¤ì¤ë: +.IP +.\"O .I msg_lspid +.\"O is set to the process ID of the calling process. +.I msg_lspid +¤Ë¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP +.\"O .I msg_qnum +.\"O is incremented by 1. +.I msg_qnum +¤Ï 1 Áý²Ã¤¹¤ë¡£ +.IP +.\"O .I msg_stime +.\"O is set to the current time. +.I msg_stime +¤Ë¤Ï¸½ºß»þ¹ï¤¬ÀßÄꤵ¤ì¤ë¡£ +.SS msgrcv() +.\"O The +.\"O .BR msgrcv () +.\"O system call removes a message from the queue specified by +.\"O .I msqid +.\"O and places it in the buffer +.\"O pointed to by +.\"O .IR msgp . +.BR msgrcv () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I msqid +¤Ç»ØÄꤵ¤ì¤¿¥­¥å¡¼¤«¤é¥á¥Ã¥»¡¼¥¸¤òºï½ü¤·¡¢ +.I msgp +¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë¤½¤Î¥á¥Ã¥»¡¼¥¸¤ò³ÊǼ¤¹¤ë¡£ +.PP +.\"O The argument +.\"O .I msgsz +.\"O specifies the maximum size in bytes for the member +.\"O .I mtext +.\"O of the structure pointed to by the +.\"O .I msgp +.\"O argument. +.I msgsz +°ú¤­¿ô¤Ë¤Ï +.I msgp +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿¹½Â¤ÂΤΠ+.I mtext +¥á¥ó¥Ð¡¼¤ÎºÇÂç¤Î¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£ +.\"O If the message text has length greater than +.\"O .IR msgsz , +.\"O then the behavior depends on whether +.\"O .B MSG_NOERROR +.\"O is specified in +.\"O .IR msgflg . +.\"O If +.\"O .B MSG_NOERROR +.\"O is specified, then +.\"O the message text will be truncated (and the truncated part will be +.\"O lost); if +.\"O .B MSG_NOERROR +.\"O is not specified, then +.\"O the message isn't removed from the queue and +.\"O the system call fails returning \-1 with +.\"O .I errno +.\"O set to +.\"O .BR E2BIG . +¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥­¥¹¥È¤ÎŤµ¤¬ +.I msgsz +¤è¤êÂ礭¤¤¾ì¹ç¤ÎÆ°ºî¤Ï¡¢ +.I msgflg +¤Ë +.B MSG_NOERROR +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ç·è¤Þ¤ë¡£ +.B MSG_NOERROR +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥­¥¹¥È¤ÏÀÚ¤êµÍ¤á¤é¤ì¤ë +(ÀÚ¤ê¼Î¤Æ¤é¤ì¤¿Éôʬ¤Ï¼º¤ï¤ì¤ë)¡£ +.B MSG_NOERROR +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¥á¥Ã¥»¡¼¥¸¤Ï¥­¥å¡¼¤«¤éºï½ü¤µ¤ì¤º¡¢ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï \-1 ¤òÊÖ¤·¤Æ¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B E2BIG +¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O The argument +.\"O .I msgtyp +.\"O specifies the type of message requested as follows: +.I msgtyp +°ú¤­¿ô¤Ë¤ÏÍ׵᤹¤ë¥á¥Ã¥»¡¼¥¸¤Î·¿¤ò»ØÄꤹ¤ë¡£ +·¿¤Ï°Ê²¼¤Î¤è¤¦¤Ë»ØÄꤹ¤ë: +.IP * 2 +.\"O If +.\"O .I msgtyp +.\"O is 0, +.\"O then the first message in the queue is read. +.I msgtyp +¤¬ 0 ¤Ê¤é¤Ð¡¢¥­¥å¡¼¤ÎºÇ½é¤Ë¤¢¤ë¥á¥Ã¥»¡¼¥¸¤¬Æɤ߹þ¤Þ¤ì¤ë¡£ +.IP * +.\"O If +.\"O .I msgtyp +.\"O is greater than 0, +.\"O then the first message in the queue of type +.\"O .I msgtyp +.\"O is read, unless +.\"O .B MSG_EXCEPT +.\"O was specified in +.\"O .IR msgflg , +.\"O in which case +.\"O the first message in the queue of type not equal to +.\"O .I msgtyp +.\"O will be read. +.I msgtyp +¤¬ 0 ¤è¤êÂ礭¤¤¾ì¹ç¡¢ +.I msgflg +¤Ë +.B MSG_EXCEPT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +.I msgtyp +·¿¤Î¥­¥å¡¼¤ÎºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤¬Æɤ߹þ¤Þ¤ì¤ë¡£ +.B MSG_EXCEPT +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +.I msgtyp +·¿°Ê³°¤Î¥­¥å¡¼¤ÎºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤¬Æɤ߹þ¤Þ¤ì¤ë¡£ +.IP * +.\"O If +.\"O .I msgtyp +.\"O is less than 0, +.\"O then the first message in the queue with the lowest type less than or +.\"O equal to the absolute value of +.\"O .I msgtyp +.\"O will be read. +.I msgtyp +¤¬ 0 ¤è¤ê¾®¤µ¤±¤ì¤Ð¡¢ +.I msgtyp +¤ÎÀäÂÐÃͰʲ¼¤ÇºÇ¤â¾®¤µ¤¤·¿¤ò»ý¤Ä¥­¥å¡¼¤ÎºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤¬Æɤ߹þ¤Þ¤ì¤ë¡£ +.PP +.\"O The +.\"O .I msgflg +.\"O argument is a bit mask constructed by ORing together zero or more +.\"O of the following flags: +.I msgflg +°ú¤­¿ô¤Ë¤Ï¡¢°Ê²¼¤Î¥Õ¥é¥°¤òǤ°Õ¤Î¿ô¤À¤± (0¸Ä¤â²Ä)¡¢¤³¤ì¤é¤Î OR ¤Ç»ØÄꤹ¤ë: +.TP +.B IPC_NOWAIT +.\"O Return immediately if no message of the requested type is in the queue. +.\"O The system call fails with +.\"O .I errno +.\"O set to +.\"O .BR ENOMSG . +¥­¥å¡¼¤ËÍ׵ᤵ¤ì¤¿·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ïľ¤Á¤ËÊ֤롣 +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë¤Ï +.B ENOMSG +¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +.B MSG_EXCEPT +.\"O Used with +.\"O .I msgtyp +.\"O greater than 0 +.\"O to read the first message in the queue with message type that differs +.\"O from +.\"O .IR msgtyp . +0 ¤è¤êÂ礭¤Ê +.I msgtyp +¤È°ì½ï¤Ë»ÈÍѤ·¤Æ¡¢ +.I msgtyp +°Ê³°¤Î¥­¥å¡¼¤ÎºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤òÆɤ߹þ¤à¡£ +.TP +.B MSG_NOERROR +.\"O To truncate the message text if longer than +.\"O .I msgsz +.\"O bytes. +.I msgsz +¥Ð¥¤¥È¤è¤ê¤âŤ«¤Ã¤¿¾ì¹ç¤Ï¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥­¥¹¥È¤òÀÚ¤êµÍ¤á¤ë¡£ +.PP +.\"O If no message of the requested type is available and +.\"O .B IPC_NOWAIT +.\"O isn't specified in +.\"O .IR msgflg , +.\"O the calling process is blocked until one of the following conditions occurs: +Í׵ᤵ¤ì¤¿·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬Â¸ºß¤»¤º¡¢ +.I msgflg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï +°Ê²¼¤Î¤¤¤º¤ì¤«¤Î¾õ¶·¤Ë¤Ê¤ë¤Þ¤ÇÄä»ß (block) ¤µ¤ì¤ë: +.IP * 2 +.\"O A message of the desired type is placed in the queue. +Í׵ᤷ¤Æ¤¤¤ë·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬¥­¥å¡¼¤ØÆþ¤ì¤é¤ì¤¿¡£ +.IP * +.\"O The message queue is removed from the system. +.\"O In this case the system call fails with +.\"O .I errno +.\"O set to +.\"O .BR EIDRM . +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬¥·¥¹¥Æ¥à¤«¤éºï½ü¤µ¤ì¤¿¡£ +¤³¤Î¾ì¹ç¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EIDRM +¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP * +.\"O The calling process catches a signal. +.\"O In this case the system call fails with +.\"O .I errno +.\"O set to +.\"O .BR EINTR . +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿¡£ +¤³¤Î¾ì¹ç¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EINTR +¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O .RB ( msgrcv () +.\"O is never automatically restarted after being interrupted by a +.\"O signal handler, regardless of the setting of the +.\"O .B SA_RESTART +.\"O flag when establishing a signal handler.) +.RB ( msgrcv () +¤Ï¡¢¤¿¤È¤¨¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÀßÄê»þ¤Ë +.B SA_RESTART +¤ò»ØÄꤷ¤Æ¤¤¤¿¤È¤·¤Æ¤â¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¸å¤Ç +¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£) +.PP +.\"O Upon successful completion the message queue data structure is updated +.\"O as follows: +¼Â¹Ô¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤Ë +¹¹¿·¤µ¤ì¤ë: +.IP +.\"O .I msg_lrpid +.\"O is set to the process ID of the calling process. +.I msg_lrpid +¤Ë¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP +.\"O .I msg_qnum +.\"O is decremented by 1. +.I msg_qnum +¤Ï 1 ¸º»»¤µ¤ì¤ë¡£ +.IP +.\"O .I msg_rtime +.\"O is set to the current time. +.I msg_rtime +¤Ë¤Ï¸½ºß¤Î»þ¹ï¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On failure both functions return \-1 +.\"O with +.\"O .I errno +.\"O indicating the error, +.\"O otherwise +.\"O .BR msgsnd () +.\"O returns 0 +.\"O and +.\"O .BR msgrcv () +.\"O returns the number of bytes actually copied into the +.\"O .I mtext +.\"O array. +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢¤É¤Á¤é¤Î´Ø¿ô¤â \-1 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤ò +.I errno +¤Ëɽ¼¨¤¹¤ë¡£À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR msgsnd () +¤Ï 0 ¤òÊÖ¤·¡¢ +.BR msgrcv () +¤Ï +.I mtext +ÇÛÎó¤Ë¼ÂºÝ¤Ë¥³¥Ô¡¼¤·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O When +.\"O .BR msgsnd () +.\"O fails, +.\"O .I errno +.\"O will be set to one among the following values: +.BR msgsnd () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.B errno +¤Ë°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤¬ÀßÄꤵ¤ì¤ë: +.TP +.B EACCES +.\"O The calling process does not have write permission on the message queue, +.\"O and does not have the +.\"O .B CAP_IPC_OWNER +.\"O capability. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÂФ¹¤ë½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤¯¡¢ +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â¤Ê¤¤¡£ +.TP +.B EAGAIN +.\"O The message can't be sent due to the +.\"O .I msg_qbytes +.\"O limit for the queue and +.\"O .B IPC_NOWAIT +.\"O was specified in +.\"O .IR msgflg . +.I msg_qbytes +¤¬¥­¥å¡¼¤ÎÀ©¸Â¤òĶ¤¨¤Æ¤¤¤¿¤¿¤á¡¢¥á¥Ã¥»¡¼¥¸¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤º¡¢¤«¤Ä +.I msgflg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¡£ +.TP +.B EFAULT +.\"O The address pointed to by +.\"O .I msgp +.\"O isn't accessible. +.I msgp +¤¬»Ø¤·¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤¬¥¢¥¯¥»¥¹²Äǽ¤Ç¤Ê¤¤¡£ +.TP +.B EIDRM +.\"O The message queue was removed. +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬ºï½ü¤µ¤ì¤¿¡£ +.TP +.B EINTR +.\"O Sleeping on a full message queue condition, the process caught a signal. +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬Í׵ᤷ¤¿¾ò·ï¤òËþ¤¿¤¹¤Þ¤ÇÄä»ß¤·¤Æ¤¤¤ë»þ¤Ë¡¢ +¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿¡£ +.TP +.B EINVAL +.\"O Invalid +.\"O .I msqid +.\"O value, or nonpositive +.\"O .I mtype +.\"O value, or +.\"O invalid +.\"O .I msgsz +.\"O value (less than 0 or greater than the system value +.\"O .BR MSGMAX ). +.I msqid +¤¬ÉÔŬÀÚ¤ÊÃͤǤ¢¤ë¤«¡¢ +.I mtype +¤¬Àµ¤ÎÃͤǤʤ¤¤«¡¢ +.I msgsz +¤¬ÉÔŬÀÚ¤ÊÃÍ (0 °Ê²¼¤«¡¢¥·¥¹¥Æ¥à¤Ç·è¤Þ¤ëÃÍ +.B MSGMAX +¤è¤ê¤âÂ礭¤¤ÃÍ) ¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +.\"O The system does not have enough memory to make a copy of the +.\"O message pointed to by +.\"O .IR msgp . +.I msgp +¤¬»Ø¤¹¥á¥Ã¥»¡¼¥¸¤Î¥³¥Ô¡¼¤òºîÀ®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£ +.PP +.\"O When +.\"O .BR msgrcv () +.\"O fails, +.\"O .I errno +.\"O will be set to one among the following values: +.BR msgrcv () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï +.I errno +¤Ë°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤¬ÀßÄꤵ¤ì¤ë: +.TP +.B E2BIG +.\"O The message text length is greater than +.\"O .I msgsz +.\"O and +.\"O .B MSG_NOERROR +.\"O isn't specified in +.\"O .IR msgflg . +¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥­¥¹¥È¤ÎŤµ¤¬ +.I msgsz +¤è¤ê¤âÂ礭¤¯¡¢ +.I msgflg +¤Ë +.B MSG_NOERROR +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B EACCES +.\"O The calling process does not have read permission on the message queue, +.\"O and does not have the +.\"O .B CAP_IPC_OWNER +.\"O capability. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÂФ¹¤ëÆɤ߹þ¤ßµö²Ä¤¬¤Ê¤¯¡¢ +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â¤Ê¤¤¡£ +.TP +.B EAGAIN +.\"O No message was available in the queue and +.\"O .B IPC_NOWAIT +.\"O was specified in +.\"O .IR msgflg . +¥­¥å¡¼¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬¤Ê¤¯¡¢ +.I msgflg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B EFAULT +.\"O The address pointed to by +.\"O .I msgp +.\"O isn't accessible. +.I msgp +¤¬»Ø¤·¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤¬¥¢¥¯¥»¥¹²Äǽ¤Ç¤Ê¤¤¡£ +.TP +.B EIDRM +.\"O While the process was sleeping to receive a message, +.\"O the message queue was removed. +¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë¤¿¤á¤Ë¥×¥í¥»¥¹¤¬Ää»ß¤·¤Æ¤¤¤ë´Ö¤Ë¡¢ +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬ºï½ü¤µ¤ì¤¿¡£ +.TP +.B EINTR +.\"O While the process was sleeping to receive a message, +.\"O the process caught a signal; see +.\"O .BR signal (7). +¥á¥Ã¥»¡¼¥¸¤ò¼õ¤±¤ë¤¿¤á¤Ë¥×¥í¥»¥¹¤¬Ää»ß¤·¤Æ¤¤¤ë´Ö¤Ë¡¢ +¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.\"O .I msgqid +.\"O was invalid, or +.\"O .I msgsz +.\"O was less than 0. +.I msgqid +¤¬ÉÔÀµ¤«¡¢ +.I msgsz +¤¬ 0 ¤è¤ê¾®¤µ¤¤¡£ +.TP +.B ENOMSG +.\"O .B IPC_NOWAIT +.\"O was specified in +.\"O .I msgflg +.\"O and no message of the requested type existed on the message queue. +.I msgflg +¤Ë +.B IPC_NOWAIT +¤¬ÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢ +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÍ׵ᤵ¤ì¤¿·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The +.\"O .I msgp +.\"O argument is declared as \fIstruct msgbuf *\fP with +.\"O libc4, libc5, glibc 2.0, glibc 2.1. +.\"O It is declared as \fIvoid *\fP +.\"O with glibc 2.2 and later, as required by SUSv2 and SUSv3. +.I msgp +°ú¤­¿ô¤Ï¡¢ libc4, libc5, glibc 2.0, glibc 2.1 ¤Ç¤Ï +\fIstruct msgbuf *\fP ¤ÈÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£glibc 2.2 °Ê¹ß¤Ç¤Ï¡¢ +SUSv2 ¤È SUSv3 ¤ÎÍ×µáÄ̤ꡢ\fIvoid *\fP ¤ÈÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"O The following limits on message queue resources affect the +.\"O .BR msgsnd () +.\"O call: +°Ê²¼¤Ï +.B msgsnd +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë±Æ¶Á¤¹¤ë¥·¥¹¥Æ¥àÀ©¸Â¤Ç¤¢¤ë: +.TP +.B MSGMAX +.\"O Maximum size for a message text: 8192 bytes +.\"O (on Linux, this limit can be read and modified via +.\"O .IR /proc/sys/kernel/msgmax ). +¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥­¥¹¥È¤ÎºÇÂ祵¥¤¥º: 8192 ¥Ð¥¤¥È +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/msgmax +·Ðͳ¤ÇÆɤ߽Ф·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë)¡£ +.TP +.B MSGMNB +.\"O Default maximum size in bytes of a message queue: 16384 bytes +.\"O (on Linux, this limit can be read and modified via +.\"O .IR /proc/sys/kernel/msgmnb ). +.\"O The superuser can increase the size of a message queue beyond +.\"O .B MSGMNB +.\"O by a +.\"O .BR msgctl (2) +.\"O system call. +¥Ð¥¤¥Èñ°Ì¤Ç¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥Ç¥Õ¥©¥ë¥È¤ÎºÇÂ祵¥¤¥º : 16384 ¥Ð¥¤¥È¡£ +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/msgmnb +·Ðͳ¤ÇÆɤ߽Ф·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë)¡£ +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤Ï +.BR msgctl (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥µ¥¤¥º¤ò +.B MSGMNB +¤è¤ê¤âÂ礭¤¤ÃͤËÁý¤ä¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O The implementation has no intrinsic limits for the system wide maximum +.\"O number of message headers +.\"O .RB ( MSGTQL ) +.\"O and for the system wide maximum size in bytes of the message pool +.\"O .RB ( MSGPOOL ). +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢¥·¥¹¥Æ¥àÁ´ÂΤΥá¥Ã¥»¡¼¥¸¡¦¥Ø¥Ã¥À¡¼¤ÎºÇÂç¿ô +.RB ( MSGTQL ) +¤È¡¢¥·¥¹¥Æ¥àÁ´ÂΤΥá¥Ã¥»¡¼¥¸¡¦¥×¡¼¥ë¤ÎºÇÂç¥Ð¥¤¥È¿ô +.RB ( MSGPOOL ) +¤Ë´Ø¤·¤Æ¼ÂÁõ°Í¸¤ÎÀ©¸Â¤Ï¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR msgctl (2), +.BR msgget (2), +.BR capabilities (7), +.BR mq_overview (7), +.BR svipc (7) diff --git a/draft/man2/msync.2 b/draft/man2/msync.2 new file mode 100644 index 00000000..6f1a6432 --- /dev/null +++ b/draft/man2/msync.2 @@ -0,0 +1,210 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1996 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. +.\" +.\" 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 ¥á¥â¥ê¾å¤Î +.\" +.TH MSYNC 2 2008-04-22 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O msync \- synchronize a file with a memory map +msync \- ¥Õ¥¡¥¤¥ë¤ò¥Þ¥Ã¥×¤·¤¿¥á¥â¥ê¤ÈƱ´ü¤µ¤»¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int msync(void *" addr ", size_t " length ", int " flags ); +.\"O .SH DESCRIPTION +.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 +¤Î¥á¥â¥êÎΰè¤ËÂбþ¤¹¤ëÉôʬ¤¬¹¹¿·¤µ¤ì¤ë¡£ + +.\"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 +¤Ï(¤¿¤Ã¤¿º£½ñ¤­¹þ¤ó¤À¿·¤·¤¤Ãͤǥޥåԥ󥰤ò¹¹¿·¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë) +Ʊ¤¸¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¾¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤òÍ׵᤹¤ë¡£ +.\"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 .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. +»ØÄꤵ¤ì¤¿¥á¥â¥ê (¤Þ¤¿¤Ï¤½¤Î°ìÉô) ¤¬¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR mmap (2) +.br +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 new file mode 100644 index 00000000..8d6aa1ad --- /dev/null +++ b/draft/man2/nanosleep.2 @@ -0,0 +1,375 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) Markus Kuhn, 1996 +.\" and Copyright (C) Linux Foundation, 2008, written by 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-10 Markus Kuhn +.\" First version written +.\" Modified, 2004-10-24, aeb +.\" 2008-06-24, mtk +.\" Minor rewrites of some parts. +.\" 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 +.\" +.\"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 +.SH ̾Á° +.\"O nanosleep \- high-resolution sleep +nanosleep \- ¹âÀºÅ٤ʥ¹¥ê¡¼¥× +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int nanosleep(const struct timespec *" req ", struct timespec *" rem ); +.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 nanosleep (): +_POSIX_C_SOURCE\ >=\ 199309L +.\"O .SH DESCRIPTION +.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 +¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¤Î´Ö¡¢¤â¤·¤¯¤Ï¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Ç¥Ï¥ó¥É¥é¤Îµ¯Æ°¤Î +¤­¤Ã¤«¤±¤È¤Ê¤ë¥·¥°¥Ê¥ë¡¢¤Þ¤¿¤Ï¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤¬ +¹Ô¤ï¤ì¤ë¤Þ¤Ç°ì»þÄä»ß¤¹¤ë¡£ + +.\"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 () +¤ò¤â¤¦°ìÅٸƤӽФ·¤Æ¡¢»ØÄꤷ¤¿»þ´Ö¤ÎÄä»ß¤ò +´°Î»¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë (⤷¡¢¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È)¡£ + +.\"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 +¹½Â¤ÂΤ¬»ÈÍѤµ¤ì¤ë¡£¤³¤Î¹½Â¤ÂΤϼ¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.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" +.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 +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O Problem with copying information from user space. +¥æ¡¼¥¶¶õ´Ö¤«¤é¤Î¾ðÊó¤Î¥³¥Ô¡¼¤ÇÌäÂ꤬¤¢¤Ã¤¿¡£ +.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" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.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 ¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤òºÆ¤Ó¼Â¹Ô¤Ç¤­¤ë¤è¤¦¤Ë +¤Ê¤ë¤Þ¤Ç¤Ë¤ÏÃٱ䤬Æþ¤ë¡£ + +.\"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) +¤ò»È¤¦¤³¤È¤Ç²óÈò¤Ç¤­¤ë¡£ + +.\"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 () +.\"O says that discontinuous changes in +.\"O .B CLOCK_REALTIME +.\"O should not affect +.\"O .BR nanosleep (): +¤³¤Î¤³¤È¤Ï¤ª¤½¤é¤¯ÌäÂê¤Ë¤Ê¤é¤Ê¤¤¤À¤í¤¦¡£ +¤Ê¤¼¤Ê¤é¡¢POSIX.1 ¤Î +.BR clock_settime () +¤Î»ÅÍͤˤϡ¢ +.B CLOCK_REALTIME +¤ÎÉÔϢ³¤ÊÊѲ½¤Ï +.BR nanosleep () +¤Ë±Æ¶Á¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡¢¤È½ñ¤«¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +.RS +.PP +.\"O Setting the value of the +.\"O .B CLOCK_REALTIME +.\"O clock via +.\"O .BR clock_settime () +.\"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 () +·Ðͳ¤Ç +.B CLOCK_REALTIME +¥¯¥í¥Ã¥¯¤ÎÃͤòÀßÄꤷ¤Æ¤â¡¢ +.BR nanosleep () +´Ø¿ô¤Ê¤É¤Î +.B CLOCK_REALTIME +¤Ë´ð¤Å¤¯¥µ¡¼¥Ó¥¹¤Ë¤è¤êÁêÂÐŪ¤Ê´ü´Ö¤À¤±¼Â¹Ô¤òÄä»ß¤¹¤ë¥¹¥ì¥Ã¥É¤Ë¤Ï±Æ¶Á¤Ï¤Ê¤¤¡£ +·ë²Ì¤È¤·¤Æ¡¢¥¯¥í¥Ã¥¯Ãͤ¬¹¹¿·Á°¤«¸å¤«¤Ë´Ø¤ï¤é¤º¡¢Í׵ᤵ¤ì¤¿ÁêÂÐŪ¤Ê»þ´Ö¤¬ +·Ð²á¤¹¤ë¤ÈËþλ¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR clock_nanosleep (2), +.BR sched_setscheduler (2), +.BR sleep (3), +.BR timer_create (2), +.BR usleep (3), +.BR time (7) diff --git a/draft/man2/nfsservctl.2 b/draft/man2/nfsservctl.2 new file mode 100644 index 00000000..0a648a97 --- /dev/null +++ b/draft/man2/nfsservctl.2 @@ -0,0 +1,78 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Original text is in the public domain. +.\" +.\" FIXME The description of nfsservctl() on this page +.\" is woefully thin. +.\" +.\" Japanese Version is copyrighted. but can freely distribute. +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Aug 30 14:47:25 JST 1997 +.\" by HANATAKA Shinya +.\" +.TH NFSSERVCTL 2 1997-07-16 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O nfsservctl \- syscall interface to kernel nfs daemon +nfsservctl \- ¥«¡¼¥Í¥ë nfs ¥Ç¡¼¥â¥ó¤Î¤¿¤á¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long nfsservctl(int " cmd ", struct nfsctl_arg *" argp , +.BI " union nfsctl_res *" resp ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.nf +/* +.\"O * These are the commands understood by nfsctl(). + * nfsctl() ¤Ë¤è¤Ã¤ÆÍý²ò¤µ¤ì¤ë¥³¥Þ¥ó¥É + */ +.\"O #define NFSCTL_SVC 0 /* This is a server process. */ +.\"O #define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */ +.\"O #define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */ +.\"O #define NFSCTL_EXPORT 3 /* export a file system. */ +.\"O #define NFSCTL_UNEXPORT 4 /* unexport a file system. */ +.\"O #define NFSCTL_UGIDUPDATE 5 /* update a client's UID/GID map. */ +.\"O #define NFSCTL_GETFH 6 /* get an fh (used by mountd) */ +#define NFSCTL_SVC 0 /* ¥µ¡¼¥Ð¡¼¥×¥í¥»¥¹ */ +#define NFSCTL_ADDCLIENT 1 /* NFS ¥¯¥é¥¤¥¢¥ó¥È¤òÄɲà */ +#define NFSCTL_DELCLIENT 2 /* NFS ¥¯¥é¥¤¥¢¥ó¥É¤òºï½ü */ +#define NFSCTL_EXPORT 3 /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¨¥¯¥¹¥Ý¡¼¥È */ +#define NFSCTL_UNEXPORT 4 /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¢¥ó¥¨¥¯¥¹¥Ý¡¼¥È */ +#define NFSCTL_UGIDUPDATE 5 /* UID/GID ¥Þ¥Ã¥×¤Î¹¹¿· */ +#define NFSCTL_GETFH 6 /* (mountd ¤Ç»ÈÍѤµ¤ì¤ë) fh ¤Î¼èÆÀ */ + +struct nfsctl_arg { + int ca_version; /* safeguard */ + union { + struct nfsctl_svc u_svc; + struct nfsctl_client u_client; + struct nfsctl_export u_export; + struct nfsctl_uidmap u_umap; + struct nfsctl_fhparm u_getfh; + unsigned int u_debug; + } u; +} + +union nfsctl_res { + struct knfs_fh cr_getfh; + unsigned int cr_debug; +}; +.fi +.\"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 "CONFORMING TO" +.SH ½àµò +.\"O This call is Linux-specific. +¤³¤Î¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ë¡£ diff --git a/draft/man2/nice.2 b/draft/man2/nice.2 new file mode 100644 index 00000000..86fb52d7 --- /dev/null +++ b/draft/man2/nice.2 @@ -0,0 +1,187 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt , 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 1996-11-04 by Eric S. Raymond +.\" 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" +.SH ̾Á° +nice \- ¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int nice(int " inc ); +.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 nice (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.\"O .SH DESCRIPTION +.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" +.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 +¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ +.\"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" +.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 +.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) +¤ò»È¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR nice (1), +.BR fork (2), +.BR getpriority (2), +.BR setpriority (2), +.BR capabilities (7), +.BR renice (8) diff --git a/draft/man2/open.2 b/draft/man2/open.2 new file mode 100644 index 00000000..cc06946a --- /dev/null +++ b/draft/man2/open.2 @@ -0,0 +1,1529 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" 2008 Greg Banks +.\" +.\" 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 by Rik Faith +.\" Modified 1994-08-21 by Michael Haardt +.\" Modified 1996-04-13 by Andries Brouwer +.\" Modified 1996-05-13 by Thomas Koenig +.\" Modified 1996-12-20 by Michael Haardt +.\" Modified 1999-02-19 by Andries Brouwer +.\" Modified 1998-11-28 by Joseph S. Myers +.\" Modified 1999-06-03 by Michael Haardt +.\" Modified 2002-05-07 by Michael Kerrisk +.\" Modified 2004-06-23 by Michael Kerrisk +.\" 2004-12-08, mtk, reordered flags list alphabetically +.\" 2004-12-08, Martin Pool (& mtk), added O_NOATIME +.\" 2007-09-18, mtk, Added description of O_CLOEXEC + other minor edits +.\" 2008-01-03, mtk, with input from Trond Myklebust +.\" and Timo Sirainen +.\" Rewrite description of O_EXCL. +.\" 2008-01-11, Greg Banks : add more detail +.\" on O_DIRECT. +.\" 2008-02-26, Michael Haardt: Reorganized text for O_CREAT and mode +.\" +.\" FIXME . Apr 08: The next POSIX revision has O_EXEC, O_SEARCH, and +.\" O_TTYINIT. Eventually these may need to be documented. --mtk +.\" FIXME Linux 2.6.33 has O_DSYNC, and a hiddden __O_SYNC. +.\" +.\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1999-08-14, HANATAKA Shinya +.\" Updated 2001-05-25, Yuichi SATO +.\" Updated & Modified 2002-01-02, Yuichi SATO +.\" Updated & Modified 2002-07-07, Yuichi SATO +.\" Updated & Modified 2002-09-19, Yuichi SATO +.\" Updated & Modified 2003-07-30, Yuichi SATO +.\" Updated & Modified 2003-11-27, Yuichi SATO +.\" Updated & Modified 2005-01-01, Yuichi SATO +.\" Updated & Modified 2005-09-14, Akihiro MOTOKI +.\" Updated & Modified 2005-10-14, Akihiro MOTOKI +.\" Updated & Modified 2006-01-18, Akihiro MOTOKI +.\" Updated & Modified 2006-04-15, Akihiro MOTOKI, LDP v2.29 +.\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" Updated 2007-10-12, Akihiro MOTOKI, LDP v2.66 +.\" Updated 2008-02-12, Akihiro MOTOKI, LDP v2.77 +.\" Updated 2008-04-04, Akihiro MOTOKI, LDP v2.79 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2010-04-23, Akihiro MOTOKI, LDP v3.24 +.\" +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: file description ¥Õ¥¡¥¤¥ëµ­½Ò +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: create ºîÀ® +.\"WORD: file offset ¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È +.\"WORD: controling terminal À©¸æüËö +.\"WORD: non-blocking I/O ÈóÄä»ß I/O +.\"WORD: synchronous I/O Ʊ´ü I/O +.\"WORD: permission µö²Ä +.\"WORD: user ¥æ¡¼¥¶¡¼ +.\"WORD: owner ½êÍ­¼Ô +.\"WORD: group ¥°¥ë¡¼¥× +.\"WORD: other ¾¿Í +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: dangling symbolic link ²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: file creation flag ¥Õ¥¡¥¤¥ëºîÀ®¥Õ¥é¥° +.\"WORD: file status flag ¥Õ¥¡¥¤¥ë¾õÂ֥ե饰 +.\" +.TH OPEN 2 2009-09-20 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O open, creat \- open and possibly create a file or device +open, creat \- ¥Õ¥¡¥¤¥ë¤ä¥Ç¥Ð¥¤¥¹¤Î¥ª¡¼¥×¥ó¡¢ºîÀ®¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int open(const char *" pathname ", int " flags ); +.BI "int open(const char *" pathname ", int " flags ", mode_t " mode ); + +.BI "int creat(const char *" pathname ", mode_t " mode ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Given a +.\"O .I pathname +.\"O for a file, +.\"O .BR open () +.\"O returns a file descriptor, a small, nonnegative integer +.\"O for use in subsequent system calls +.\"O .RB ( read "(2), " write "(2), " lseek "(2), " fcntl "(2), etc.)." +.\"O The file descriptor returned by a successful call will be +.\"O the lowest-numbered file descriptor not currently open for the process. +¥Õ¥¡¥¤¥ë¤Î +.I pathname +¤òÍ¿¤¨¤ë¤È¡¢ +.BR open () +¤Ï¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤³¤Î¸å¤Ë³¤¯¥·¥¹¥Æ¥à¥³¡¼¥ë +.RB ( read "(2), " write "(2), " lseek "(2), " fcntl "(2) ¤Ê¤É)" +¤Ç»ÈÍѤµ¤ì¤ë¾®¤µ¤ÊÈóÉé¤ÎÀ°¿ô¤Ç¤¢¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬À®¸ù¤·¤¿¾ì¹ç¤ËÊÖ¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +¤½¤Î¥×¥í¥»¥¹¤¬¤½¤Î»þÅÀ¤Ç¥ª¡¼¥×¥ó¤·¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î +¤¦¤ÁºÇ¾®¤Î¿ô»ú¤Î¤â¤Î¤È¤Ê¤ë¡£ +.PP +.\"O By default, the new file descriptor is set to remain open across an +.\"O .BR execve (2) +.\"O (i.e., the +.\"O .B FD_CLOEXEC +.\"O file descriptor flag described in +.\"O .BR fcntl (2) +.\"O is initially disabled; the Linux-specific +.\"O .B O_CLOEXEC +.\"O flag, described below, can be used to change this default). +.\"O The file offset is set to the beginning of the file (see +.\"O .BR lseek (2)). +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¿·¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.BR execve (2) +¤ò¼Â¹Ô¤·¤¿¸å¤â¥ª¡¼¥×¥ó¤µ¤ì¤¿¤Þ¤Þ¤È¤Ê¤ë (¤Ä¤Þ¤ê¡¢ +.BR fcntl (2) +¤ËÀâÌÀ¤¬¤¢¤ë +.B FD_CLOEXEC +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Õ¥é¥°¤ÏºÇ½é¤Ï̵¸ú¤Ç¤¢¤ë; +¸å½Ò¤Î Linux ¸ÇÍ­¤Î¥Õ¥é¥° +.B O_CLOEXEC +¤ò»È¤¦¤È¤³¤Î¥Ç¥Õ¥©¥ë¥È¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë)¡£ +¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È (file offset) ¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤ËÀßÄꤵ¤ì¤ë +.RB ( lseek (2) +»²¾È)¡£ +.PP +.\"O A call to +.\"O .BR open () +.\"O creates a new +.\"O .IR "open file description" , +.\"O an entry in the system-wide table of open files. +.BR open () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¡Ö¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¡× +.I "(open file description)" +¤¬ºîÀ®¤µ¤ì¤ë¡£¥Õ¥¡¥¤¥ëµ­½Ò¤È¤Ï¡¢¥·¥¹¥Æ¥àÁ´ÂΤΠ+¥ª¡¼¥×¥óÃæ¤Î¥Õ¥¡¥¤¥ë¤Î¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¤Ç¤¢¤ë¡£ +.\"O This entry records the file offset and the file status flags +.\"O (modifiable via the +.\"O .BR fcntl (2) +.\"O .B F_SETFL +.\"O operation). +.\"O A file descriptor is a reference to one of these entries; +.\"O this reference is unaffected if +.\"O .I pathname +.\"O is subsequently removed or modified to refer to a different file. +¤³¤Î¥¨¥ó¥È¥ê¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤È¥Õ¥¡¥¤¥ë¾õÂ֥ե饰 +.RB ( fcntl (2) +.B F_SETFL +Áàºî¤Ë¤è¤êÊѹ¹²Äǽ) ¤¬ÊÝ»ý¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¤³¤ì¤é¤Î¥¨¥ó¥È¥ê¤Î°ì¤Ä¤Ø¤Î»²¾È¤Ç¤¢¤ë¡£ +¤³¤Î¸å¤Ç +.I pathname +¤¬ºï½ü¤µ¤ì¤¿¤ê¡¢Â¾¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¤è¤¦¤ËÊѹ¹¤µ¤ì¤¿¤ê¤·¤Æ¤â¡¢ +¤³¤Î»²¾È¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡£ +.\"O The new open file description is initially not shared +.\"O with any other process, +.\"O but sharing may arise via +.\"O .BR fork (2). +¿·¤·¤¤¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¤ÏºÇ½é¤Ï¾¤Î¤É¤Î¥×¥í¥»¥¹¤È¤â +¶¦Í­¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +.BR fork (2) +¤Ç¶¦Í­¤¬µ¯¤³¤ë¾ì¹ç¤¬¤¢¤ë¡£ +.PP +.\"O The argument +.\"O .I flags +.\"O must include one of the following +.\"O .IR "access modes" : +.\"O .BR O_RDONLY ", " O_WRONLY ", or " O_RDWR . +.\"O These request opening the file read-only, write-only, or read/write, +.\"O respectively. +°ú¤­¿ô +.I flags +¤Ë¤Ï¡¢¥¢¥¯¥»¥¹¥â¡¼¥É +.BR O_RDONLY ", " O_WRONLY ", " O_RDWR +¤Î¤É¤ì¤«¤Ò¤È¤Ä¤¬Æþ¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤é¤Ï¤½¤ì¤¾¤ìÆɤ߹þ¤ßÀìÍÑ¡¢½ñ¤­¹þ¤ßÀìÍÑ¡¢Æɤ߽ñ¤­ÍÑ¤Ë +¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤òÍ׵᤹¤ë¤â¤Î¤Ç¤¢¤ë¡£ + +.\"O In addition, zero or more file creation flags and file status flags +.\"O can be +.\"O .RI bitwise- or 'd +.\"O in +.\"O .IR flags . +¤µ¤é¤Ë¡¢ +.I flags +¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ëºîÀ®¥Õ¥é¥° (file creation flag) ¤È¥Õ¥¡¥¤¥ë¾õÂ֥ե饰 +(file status flag) ¤ò 0 ¸Ä°Ê¾å¡Ö¥Ó¥Ã¥Èñ°Ì¤Î OR (bitwise-or)¡×¤Ç +»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O The +.\"O .I file creation flags +.\"O are +.\"O .BR O_CREAT ", " O_EXCL ", " O_NOCTTY ", and " O_TRUNC . +.\"O The +.\"O .I file status flags +.\"O are all of the remaining flags listed below. +.I ¥Õ¥¡¥¤¥ëºîÀ®¥Õ¥é¥° +¤Ï +.BR O_CREAT ", " O_EXCL ", " O_NOCTTY ", " O_TRUNC +¤Ç¤¢¤ë¡£ +.I ¥Õ¥¡¥¤¥ë¾õÂ֥ե饰 +¤Ï°Ê²¼¤Î¥ê¥¹¥È¤Î¤¦¤Á¾åµ­°Ê³°¤Î»Ä¤ê¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.\" FIXME . Actually is it true that the "file status flags" are all of the +.\" remaining flags listed below? SUSv4 divides the flags into: +.\" * Access mode +.\" * File creation +.\" * File status +.\" * Other (O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW) +.\" though it's not clear what the difference between "other" and +.\" "File creation" flags is. (I've raised an Aardvark to see if this +.\" can be clarified in SUSv4; 10 Oct 2008.) +.\"O The distinction between these two groups of flags is that +.\"O the file status flags can be retrieved and (in some cases) +.\"O modified using +.\"O .BR fcntl (2). +.\"O The full list of file creation flags and file status flags is as follows: +Æó¼ïÎà¤Î¥Õ¥é¥°¤Î°ã¤¤¤Ï¡¢¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤ÎÊý¤Ï +.BR fcntl (2) +¤ò»È¤Ã¤Æ¤½¤ÎÆâÍƤò¼èÆÀ¤·¤¿¤ê (¾ì¹ç¤Ë¤è¤Ã¤Æ¤Ï) Êѹ¹¤·¤¿¤ê¤Ç¤­¤ëÅÀ¤Ë¤¢¤ë¡£ +¥Õ¥¡¥¤¥ëºîÀ®¥Õ¥é¥°¤È¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤ÎÁ´¥ê¥¹¥È¤ò°Ê²¼¤Ë¼¨¤¹: +.TP +.B O_APPEND +.\"O The file is opened in append mode. +.\"O Before each +.\"O .BR write (2), +.\"O the file offset is positioned at the end of the file, +.\"O as if with +.\"O .BR lseek (2). +¥Õ¥¡¥¤¥ë¤òÄɲà (append) ¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤¹¤ë¡£ +Ëè²ó¤Î +.BR write (2) +¤ÎÁ°¤Ë +.BR lseek (2) +¤ò¹Ô¤Ã¤¿¤«¤Î¤è¤¦¤Ë¡¢¥Õ¥¡¥¤¥ë¡¦¥Ý¥¤¥ó¥¿¡¼¤ò¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë°ÜÆ°¤¹¤ë¡£ +.\"O .B O_APPEND +.\"O may lead to corrupted files on NFS file systems if more than one process +.\"O appends data to a file at once. +.\" For more background, see +.\" http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453946 +.\" http://nfs.sourceforge.net/ +.\"O This is because NFS does not support +.\"O appending to a file, so the client kernel has to simulate it, which +.\"O can't be done without a race condition. +NFS ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¡¢ +.B O_APPEND +¤ò»ÈÍѤ¹¤ë¤È¡¢Ê£¿ô¤Î¥×¥í¥»¥¹¤¬¤Ò¤È¤Ä¤Î¥Õ¥¡¥¤¥ë¤ËƱ»þ¤Ë¥Ç¡¼¥¿¤òÄɲä·¤¿¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤·¤Þ¤¦¤³¤È¤¬¤¢¤ë¡£ +¤³¤ì¤Ï NFS ¤¬Äɲå⡼¥É¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤¿¤á¡¢ +¥¯¥é¥¤¥¢¥ó¥È¤Î¥«¡¼¥Í¥ë (kernel) ¤¬¤½¤ì¤ò¥·¥ß¥å¥ì¡¼¥È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Î¤À¤¬¡¢ +¶¥¹ç¾õÂÖ¤òÈò¤±¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.TP +.B O_ASYNC +.\"O Enable signal-driven I/O: +.\"O generate a signal +.\"O .RB ( SIGIO +.\"O by default, but this can be changed via +.\"O .BR fcntl (2)) +.\"O when input or output becomes possible on this file descriptor. +¥·¥°¥Ê¥ë¶îÆ° I/O (signal-driven I/O) ¤òÍ­¸ú¤Ë¤¹¤ë: +¤³¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ø¤Î +ÆþÎϤޤ¿¤Ï½ÐÎϤ¬²Äǽ¤Ë¤Ê¤Ã¤¿¾ì¹ç¤Ë¡¢¥·¥°¥Ê¥ë¤òÀ¸À®¤¹¤ë +(¥Ç¥Õ¥©¥ë¥È¤Ï +.B SIGIO +¤Ç¤¢¤ë¤¬¡¢ +.BR fcntl (2) +¤Ë¤è¤Ã¤ÆÊѹ¹²Äǽ¤Ç¤¢¤ë)¡£ +.\"O This feature is only available for terminals, pseudo-terminals, +.\"O sockets, and (since Linux 2.6) pipes and FIFOs. +.\"O See +.\"O .BR fcntl (2) +.\"O for further details. +¤³¤Îµ¡Ç½¤¬»ÈÍѲÄǽ¤Ê¤Î¤ÏüËö¡¢µ¿»÷üËö¡¢¥½¥±¥Ã¥È¤Î¤ß¤Ç¤¢¤ê¡¢ +(Linux 2.6 °Ê¹ß¤Ç¤Ï) ¥Ñ¥¤¥×¤È FIFO ¤ËÂФ·¤Æ¤â»ÈÍѤǤ­¤ë¡£ +¤µ¤é¤Ë¾Ü¤·¤¤ÀâÌÀ¤Ï +.BR fcntl (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.\"O .BR O_CLOEXEC " (Since Linux 2.6.23)" +.BR O_CLOEXEC " (Linux 2.6.23 °Ê¹ß)" +.\"O Enable the close-on-exec flag for the new file descriptor. +¿·¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ close-on-exec ¥Õ¥é¥°¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.\"O Specifying this flag permits a program to avoid additional +.\"O .BR fcntl (2) +.\"O .B F_SETFD +.\"O operations to set the +.\"O .B FD_CLOEXEC +.\"O flag. +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢¥×¥í¥°¥é¥à¤Ï +.B FD_CLOEXEC +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤¿¤á¤Î +.BR fcntl (2) +.B F_SETFD +Áàºî¤òÊÌÅӸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.\"O Additionally, +.\"O use of this flag is essential in some multithreaded programs +.\"O since using a separate +.\"O .BR fcntl (2) +.\"O .B F_SETFD +.\"O operation to set the +.\"O .B FD_CLOEXEC +.\"O flag does not suffice to avoid race conditions +.\"O where one thread opens a file descriptor at the same +.\"O time as another thread does a +.\"O .BR fork (2) +.\"O plus +.\"O .BR execve (2). +¤Þ¤¿¡¢¤¢¤ë¼ï¤Î¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Î¥×¥í¥°¥é¥à¤Ï¤³¤Î¥Õ¥é¥°¤Î»ÈÍÑ¤Ï +ÉԲķç¤Ç¤¢¤ë¡£¤Ê¤¼¤Ê¤é¡¢¸ÄÊÌ¤Ë +.B FD_CLOEXEC +¥Õ¥é¥°¤òÀßÄꤹ¤ë +.BR fcntl (2) +.B F_SETFD +Áàºî¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤·¤Æ¤â¡¢¤¢¤ë¥¹¥ì¥Ã¥É¤¬¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +¥ª¡¼¥×¥ó¤¹¤ë¤Î¤ÈƱ»þ¤ËÊ̤Υ¹¥ì¥Ã¥É¤¬ +.BR fork (2) +¤È +.BR execve (2) +¤ò¼Â¹Ô¤¹¤ë¤È¤¤¤¦¶¥¹ç¾ò·ï¤òÈò¤±¤ë¤Î¤Ë¤Ï½½Ê¬¤Ç¤Ï¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.\" This flag fixes only one form of the race condition; +.\" The race can also occur with, for example, descriptors +.\" returned by accept(), pipe(), etc. +.TP +.B O_CREAT +.\"O If the file does not exist it will be created. +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤ÏºîÀ® (create) ¤¹¤ë¡£ +.\"O The owner (user ID) of the file is set to the effective user ID +.\"O of the process. +.\"O The group ownership (group ID) is set either to +.\"O the effective group ID of the process or to the group ID of the +.\"O parent directory (depending on file system type and mount options, +.\"O and the mode of the parent directory, see the mount options +.\"O .I bsdgroups +.\"O and +.\"O .I sysvgroups +.\"O described in +.\"O .BR mount (8)). +.\"O .\" As at 2.6.25, bsdgroups is supported by ext2, ext3, ext4, and +.\"O .\" XFS (since 2.6.14). +¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô (¥æ¡¼¥¶¡¼ ID) ¤Ï¡¢¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ËÀßÄꤵ¤ì¤ë¡£ +¥°¥ë¡¼¥×½êÍ­¸¢ (¥°¥ë¡¼¥× ID) ¤Ï¡¢¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID +¤Þ¤¿¤Ï¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î¥°¥ë¡¼¥× ID ¤ËÀßÄꤵ¤ì¤ë +(¤³¤ì¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¿¥¤¥×¡¢¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó¡¢ +¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î¥â¡¼¥É¤Ë°Í¸¤¹¤ë¡£ +.BR mount (8) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó +.I bsdgroups +¤È +.I sysvgroups +¤ò»²¾È)¡£ +.\" 2.6.25 »þÅÀ¤Ç¤Ï¡¢bsdgroups ¤Ï ext2, ext3, ext4, XFS ¤Ç¥µ¥Ý¡¼¥È +.\" ¤µ¤ì¤Æ¤¤¤ë (2.6.14 °Ê¹ß)¡£ +.RS +.PP +.\"O .I mode +.\"O specifies the permissions to use in case a new file is created. +.\"O This argument must be supplied when +.\"O .B O_CREAT +.\"O is specified in +.\"O .IR flags ; +.\"O if +.\"O .B O_CREAT +.\"O is not specified, then +.\"O .I mode +.\"O is ignored. +.\"O The effective permissions are modified by +.\"O the process's +.\"O .I umask +.\"O in the usual way: The permissions of the created file are +.\"O .IR "(mode\ &\ ~umask)" . +.I mode +¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¾ì¹ç¤Ë»ÈÍѤ¹¤ë¥¢¥¯¥»¥¹µö²Ä (permission) ¤ò»ØÄꤹ¤ë¡£ +.I flags +¤Ë +.B O_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.I mode +¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B O_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.I mode +¤Ï̵»ë¤µ¤ì¤ë¡£ +Í­¸ú¤Ê¥¢¥¯¥»¥¹µö²Ä¤Ï¡¢ÉáÃʤÈƱ¤¸¤è¤¦¤Ë¥×¥í¥»¥¹¤Î +.I umask +¤Ë¤è¤Ã¤Æ½¤Àµ¤µ¤ì¡¢ºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Îµö²Ä¤Ï +.I "(mode\ &\ ~umask)" +¤È¤Ê¤ë¡£ +.\"O Note that this mode only applies to future accesses of the +.\"O newly created file; the +.\"O .BR open () +.\"O call that creates a read-only file may well return a read/write +.\"O file descriptor. +¤³¤Î¥â¡¼¥É¤Ï¡¢¿·¤·¤¯ºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¤½¤ì°Ê¹ß¤Î¥¢¥¯¥»¥¹ +¤Ë¤Î¤ßŬÍѤµ¤ì¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +Æɤ߼è¤êÀìÍѤΥե¡¥¤¥ë¤òºîÀ®¤¹¤ë +.BR open () +¥³¡¼¥ë¤Ç¤¢¤Ã¤Æ¤â¡¢ +Æɤ߽ñ¤­²Äǽ¤Ê¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¤³¤È¤¬¤¢¤ê¤¦¤ë¡£ +.PP +.\"O The following symbolic constants are provided for +.\"O .IR mode : +.I mode +¤Î¤¿¤á¤Ë°Ê²¼¤Î¥·¥ó¥Ü¥ëÄê¿ô¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë : +.TP 9 +.B S_IRWXU +.\"O 00700 user (file owner) has read, write and execute permission +00700 ¥æ¡¼¥¶¡¼ (¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô) ¤ËÆɤ߹þ¤ß¡¢½ñ¤­¹þ¤ß¡¢ +¼Â¹Ô¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IRUSR +.\"O 00400 user has read permission +00400 ¥æ¡¼¥¶¡¼¤ËÆɤ߹þ¤ß¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IWUSR +.\"O 00200 user has write permission +00200 ¥æ¡¼¥¶¡¼¤Ë½ñ¤­¹þ¤ß¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IXUSR +.\"O 00100 user has execute permission +00100 ¥æ¡¼¥¶¡¼¤Ë¼Â¹Ô¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IRWXG +.\"O 00070 group has read, write and execute permission +00070 ¥°¥ë¡¼¥×¤ËÆɤ߹þ¤ß¡¢½ñ¤­¹þ¤ß¡¢¼Â¹Ô¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IRGRP +.\"O 00040 group has read permission +00040 ¥°¥ë¡¼¥×¤ËÆɤ߹þ¤ß¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IWGRP +.\"O 00020 group has write permission +00020 ¥°¥ë¡¼¥×¤Ë½ñ¤­¹þ¤ß¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IXGRP +.\"O 00010 group has execute permission +00010 ¥°¥ë¡¼¥×¤Ë¼Â¹Ô¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IRWXO +.\"O 00007 others have read, write and execute permission +00007 ¾¿Í (others) ¤ËÆɤ߹þ¤ß¡¢½ñ¤­¹þ¤ß¡¢¼Â¹Ô¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IROTH +.\"O 00004 others have read permission +00004 ¾¿Í¤ËÆɤ߹þ¤ß¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IWOTH +.\"O 00002 others have write permission +00002 ¾¿Í¤Ë½ñ¤­¹þ¤ß¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IXOTH +.\"O 00001 others have execute permission +00001 ¾¿Í¤Ë¼Â¹Ô¤Îµö²Ä¤¬¤¢¤ë¡£ +.RE +.TP +.\"O .BR O_DIRECT " (Since Linux 2.4.10)" +.BR O_DIRECT " (Linux 2.4.10 °Ê¹ß)" +.\"O Try to minimize cache effects of the I/O to and from this file. +.\"O In general this will degrade performance, but it is useful in +.\"O special situations, such as when applications do their own caching. +.\"O File I/O is done directly to/from user space buffers. +¤³¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë I/O ¤Î¥­¥ã¥Ã¥·¥å¤Î¸ú²Ì¤òºÇ¾®²½¤·¤è¤¦¤È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤È¡¢°ìÈÌŪ¤ËÀ­Ç½¤¬Äã²¼¤¹¤ë¡£ +¤·¤«¤·¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬Æȼ«¤Ë¥­¥ã¥Ã¥·¥ó¥°¤ò¹Ô¤Ã¤Æ¤¤¤ë¤è¤¦¤Ê +ÆÃÊ̤ʾì¹ç¤Ë¤ÏÌò¤ËΩ¤Ä¡£ +¥Õ¥¡¥¤¥ë¤Î I/O ¤Ï¥æ¡¼¥¶¡¼¶õ´Ö¥Ð¥Ã¥Õ¥¡¤ËÂФ·¤ÆľÀܹԤï¤ì¤ë¡£ +.\"O The +.\"O .B O_DIRECT +.\"O flag on its own makes at an effort to transfer data synchronously, +.\"O but does not give the guarantees of the +.\"O .B O_SYNC +.\"O that data and necessary metadata are transferred. +.B O_DIRECT +¥Õ¥é¥°¼«¿È¤Ï¥Ç¡¼¥¿¤òƱ´ü¤ÇžÁ÷¤·¤è¤¦¤È¤Ï¤¹¤ë¤¬¡¢ +.B O_SYNC +¤Î¤è¤¦¤Ë¥Ç¡¼¥¿¤ÈɬÍפʥ᥿¥Ç¡¼¥¿¤ÎžÁ÷¤¬Êݾڤµ¤ì¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.\"O To guarantee synchronous I/O the +.\"O .B O_SYNC +.\"O must be used in addition to +.\"O .BR O_DIRECT . +Ʊ´ü I/O ¤òÊݾڤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.B O_DIRECT +¤Ë²Ã¤¨¤Æ +.B O_SYNC +¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O See +.\"O .B NOTES +.\"O below for further discussion. +¡ÖÃí°Õ¡×¤ÎÀá (²¼µ­) ¤ÎµÄÏÀ¤â»²¾È¡£ +.sp +.\"O A semantically similar (but deprecated) interface for block devices +.\"O is described in +.\"O .BR raw (8). +¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë»÷Ä̤ä¿°ÕÌ£¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ +.BR raw (8) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë (⤷¡¢¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÏÈó¿ä¾©¤Ç¤¢¤ë)¡£ +.TP +.B O_DIRECTORY +.\"O If \fIpathname\fP is not a directory, cause the open to fail. +.\"O .\" But see the following and its replies: +.\"O .\" http://marc.theaimsgroup.com/?t=112748702800001&r=1&w=2 +.\"O .\" [PATCH] open: O_DIRECTORY and O_CREAT together should fail +.\"O .\" O_DIRECTORY | O_CREAT causes O_DIRECTORY to be ignored. +.\"O This flag is Linux-specific, and was added in kernel version 2.1.126, to +.\"O avoid denial-of-service problems if +.\"O .BR opendir (3) +.\"O is called on a +.\"O FIFO or tape device, but should not be used outside of the +.\"O implementation of +.\"O .BR opendir (3). +\fIpathname\fP ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð¥ª¡¼¥×¥ó¤Ï¼ºÇÔ¤¹¤ë¡£ +.\" °Ê²¼¤Îµ­»ö¤È¤½¤Î¥ê¥×¥é¥¤¤ò»²¾È¤Î¤³¤È¡£ +.\" http://marc.theaimsgroup.com/?t=112748702800001&r=1&w=2 +.\" [PATCH] open: O_DIRECTORY and O_CREAT together should fail +.\" O_DIRECTORY | O_CREAT ¤ò»ØÄꤹ¤ë¤È O_DIRECTORY ¤¬Ìµ»ë¤µ¤ì¤Æ¤·¤Þ¤¦¡£ +¤³¤Î¥Õ¥é¥°¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢ +.BR opendir (3) +¤¬ FIFO ¤ä¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ¥³¡¼¥ë¤µ¤ì¤¿¾ì¹ç¤Î +¥µ¡¼¥Ó¥¹ÉÔǽ (denial-of-service) ¹¶·â¤òÈò¤±¤ë¤¿¤á¤Ë +¥«¡¼¥Í¥ë 2.1.126 ¤ÇÄɲ䵤줿¡£ +¤·¤«¤·¤³¤ì¤Ï +.BR opendir (3) +¤Î¼ÂÁõ°Ê³°¤Ç¤Ï»ÈÍѤ¹¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B O_EXCL +.\"O Ensure that this call creates the file: +.\"O if this flag is specified in conjunction with +.\"O .BR O_CREAT , +.\"O and +.\"O .I pathname +.\"O already exists, then +.\"O .BR open () +.\"O will fail. +.\"O The behavior of +.\"O .B O_EXCL +.\"O is undefined if +.\"O .B O_CREAT +.\"O is not specified. +¤³¤Î¸Æ¤Ó½Ð¤·¤Ç¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤ë¤³¤È¤òÊݾڤ¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬ +.B O_CREAT +¤È°ì½ï¤Ë»ØÄꤵ¤ì¡¢ +.I pathname +¤Î¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤·¤¿¾ì¹ç¡¢ +.BR open () +¤Ï¼ºÇÔ¤¹¤ë¡£ +.B O_CREAT +¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Î +.B O_EXCL +¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ + +.\"O When these two flags are specified, symbolic links are not followed: +.\"O .\" POSIX.1-2001 explicitly requires this behavior. +.\"O if +.\"O .I pathname +.\"O is a symbolic link, then +.\"O .BR open () +.\"O fails regardless of where the symbolic link points to. +¤³¤ì¤éÆó¤Ä¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿ºÝ¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ïé¤é¤ì¤Ê¤¤¡£ +.\" POSIX.1-2001 ¤Ç¤ÏÌÀ¼¨Åª¤Ë¤³¤ÎÆ°ºî¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +.I pathname +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¡¢ +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬¤É¤³¤ò»Ø¤·¤Æ¤¤¤ë¤«¤Ë´Ø¤ï¤é¤º +.BR open () +¤Ï¼ºÇÔ¤¹¤ë¡£ + +.\"O .B O_EXCL +.\"O is only supported on NFS when using NFSv3 or later on kernel 2.6 or later. +.B O_EXCL +¤Ï¡¢Linux 2.6 °Ê¹ß¤Ç NFSv3 °Ê¹ß¤ò»È¤Ã¤Æ¤¤¤ë NFS ¤Ç¤Î¤ß¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O In environments where NFS +.\"O .B O_EXCL +.\"O support is not provided, programs that rely on it +.\"O for performing locking tasks will contain a race condition. +.\"O Portable programs that want to perform atomic file locking using a lockfile, +.\"O and need to avoid reliance on NFS support for +.\"O .BR O_EXCL , +.\"O can create a unique file on +.\"O the same file system (e.g., incorporating hostname and PID), and use +.\"O .BR link (2) +.\"O to make a link to the lockfile. +NFS ¤Î +.B O_EXCL +¥µ¥Ý¡¼¥È¤¬Ä󶡤µ¤ì¤Æ¤¤¤Ê¤¤´Ä¶­¤Ç¤Ï¡¢¤³¤Î¥Õ¥é¥°¤ËÍê¤Ã¤Æ +¥í¥Ã¥¯½èÍý¤ò¼Â¹Ô¤¹¤ë¥×¥í¥°¥é¥à¤Ï¶¥¹ç¾õÂÖ (race condition) ¤Ë½Ð²ñ¤¦ +²ÄǽÀ­¤¬¤¢¤ë¡£ +¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤ÆÉÔ²Äʬ (atomic) ¤Ê¥Õ¥¡¥¤¥ë¥í¥Ã¥¯¤ò¼Â¸½¤·¡¢ +NFS ¤¬ +.B O_EXCL +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«¤Ë°Í¸¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¡¢ +°Ü¿¢À­¤Î¤¢¤ëÊýË¡¤Ï¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ë¾¤È̾Á°¤Î½Å¤Ê¤é¤Ê¤¤ +¥Õ¥¡¥¤¥ë (Î㤨¤Ð¥Û¥¹¥È̾¤È PID ¤òÁȤ߹ç¤ï¤»¤¿Ì¾Á°) ¤òºîÀ®¤·¡¢ +.BR link (2) +¤ò»ÈÍѤ·¤Æ¤½¤Î¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯¤òºîÀ®¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +.\"O If +.\"O .BR link (2) +.\"O returns 0, the lock is successful. +.\"O Otherwise, use +.\"O .BR stat (2) +.\"O on the unique file to check if its link count has increased to 2, +.\"O in which case the lock is also successful. +.BR link (2) +¥³¡¼¥ë¤ÎÊÖ¤êÃͤ¬ 0 ¤Ê¤é¤Ð¥í¥Ã¥¯¤ËÀ®¸ù¤·¤Æ¤¤¤ë¡£ +¤¢¤ë¤¤¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ë +.BR stat (2) +¤ò»ÈÍѤ·¤Æ¥ê¥ó¥¯¿ô (link count) ¤¬ 2 ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +¤½¤¦¤Ê¤Ã¤Æ¤¤¤ì¤Ð¡¢Æ±¤¸¤¯¥í¥Ã¥¯¤ËÀ®¸ù¤·¤Æ¤¤¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.TP +.B O_LARGEFILE +(LFS) +.\"O Allow files whose sizes cannot be represented in an +.\"O .I off_t +.\"O (but can be represented in an +.\"O .IR off64_t ) +.\"O to be opened. +.\"O The +.\"O .B _LARGEFILE64_SOURCE +.\"O macro must be defined in order to obtain this definition. +.\"O Setting the +.\"O .B _FILE_OFFSET_BITS +.\"O feature test macro to 64 (rather than using +.\"O .BR O_LARGEFILE ) +.\"O is the preferred method of obtaining +.\"O method of accessing large files on 32-bit systems (see +.\"O .BR feature_test_macros (7)). +.I off_t +¤Ç¤Ï¥µ¥¤¥º¤òɽ¤»¤Ê¤¤ (¤À¤À¤· +.I off64_t +¤Ç¤Ï¥µ¥¤¥º¤òɽ¤»¤ë) ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó²Äǽ¤Ë¤¹¤ë¡£ +¤³¤ÎÄêµÁ¤òÍ­¸ú¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.B _LARGEFILE64_SOURCE +¥Þ¥¯¥í¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +32¥Ó¥Ã¥È¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤ÆÂ礭¤Ê¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ëÊýË¡¤òÆÀ¤¿¤¤¾ì¹ç¡¢ +.RB ( O_LARGEFILE +¤ò»È¤¦¤è¤ê¤â) +.B _FILE_OFFSET_BITS +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤ò¥»¥Ã¥È¤¹¤ëÊý¤¬Ë¾¤Þ¤·¤¤ÊýË¡¤Ç¤¢¤ë +.RB ( feature_test_macros (7) +¤ò»²¾È)¡£ +.TP +.\"O .BR O_NOATIME " (Since Linux 2.6.8)" +.BR O_NOATIME " (Linux 2.6.8 °Ê¹ß)" +.\"O Do not update the file last access time (st_atime in the inode) +.\"O when the file is +.\"O .BR read (2). +¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +.BR read (2) +¤¬¼Â¹Ô¤µ¤ì¤¿¤È¤­¤Ë¡¢ºÇ½ª¥¢¥¯¥»¥¹»þ¹ï (inode ¤Î st_atime) ¤ò¹¹¿·¤·¤Ê¤¤¡£ +.\"O This flag is intended for use by indexing or backup programs, +.\"O where its use can significantly reduce the amount of disk activity. +¤³¤Î¥Õ¥é¥°¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹ºîÀ®¤ä¥Ð¥Ã¥¯¥¢¥Ã¥×¥×¥í¥°¥é¥à¤Ç»È¤¦¤³¤È¤ò°Õ¿Þ¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤ò»È¤¦¤È¥Ç¥£¥¹¥¯¤ËÂФ¹¤ëÁàºî¤òÂçÉý¤Ë¸º¤é¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O This flag may not be effective on all file systems. +.\"O One example is NFS, where the server maintains the access time. +¤³¤Î¥Õ¥é¥°¤ÏÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ·¤ÆÍ­¸ú¤Ç¤¢¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¤½¤Î°ìÎ㤬 NFS ¤Ç¤¢¤ê¡¢¥µ¡¼¥Ð¤¬¥¢¥¯¥»¥¹»þ¹ï¤ò´ÉÍý¤·¤Æ¤¤¤ë¡£ +.\" The O_NOATIME flag also affects the treatment of st_atime +.\" by mmap() and readdir(2), MTK, Dec 04. +.TP +.B O_NOCTTY +.\"O If +.\"O .I pathname +.\"O refers to a terminal device \(em see +.\"O .BR tty (4) +.\"O \(em it will not become the process's controlling terminal even if the +.\"O process does not have one. +.I pathname +¤¬Ã¼Ëö (terminal) ¥Ç¥Ð¥¤¥¹ +\(em +.BR tty (4) +»²¾È +\(em +¤ò»Ø¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢¤¿¤È¤¨¤½¤Î¥×¥í¥»¥¹¤¬À©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢ +¥ª¡¼¥×¥ó¤·¤¿¥Õ¥¡¥¤¥ë¤ÏÀ©¸æüËö¤Ë¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.B O_NOFOLLOW +.\"O If \fIpathname\fP is a symbolic link, then the open fails. +.\"O This is a FreeBSD extension, which was added to Linux in version 2.1.126. +.\"O Symbolic links in earlier components of the pathname will still be +.\"O followed. +.\"O .\" The headers from glibc 2.0.100 and later include a +.\"O .\" definition of this flag; \fIkernels before 2.1.126 will ignore it if +.\"O .\" used\fP. +\fIpathname\fP ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤À¤Ã¤¿¾ì¹ç¡¢¥ª¡¼¥×¥ó¤Ï¼ºÇÔ¤¹¤ë¡£ +¤³¤ì¤Ï FreeBSD ¤Î³ÈÄ¥¤Ç¡¢Linux ¤Ë¤Ï 2.1.126 ¤è¤êÄɲ䵤줿¡£ +pathname ¤ÎÁ°¤Î¥³¥ó¥Ý¡¼¥Í¥ó¥È (earlier component; +ÌõÃð: ºÇ¸å¤Î¥Ç¥£¥ì¥¯¥È¥ê¥»¥Ñ¥ì¡¼¥¿¤è¤êÁ°¤ÎÉôʬ) ¤¬ +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ì¤¬»Ø¤¹À褬»²¾È¤µ¤ì¤ë¡£ +.\" glibc 2.0.100 °Ê¹ß¤Î¥Ø¥Ã¥À¡¼¤Ë¤Ï¤³¤Î¥Õ¥é¥°¤ÎÄêµÁ¤¬¤¢¤ë¡£ +.\" \fI2.1.126 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç»ÈÍѤ·¤¿¾ì¹ç¤Ë¤Ï̵»ë¤µ¤ì¤ë¡£\fP +.TP +.\"O .BR O_NONBLOCK " or " O_NDELAY +.BR O_NONBLOCK " ¤Þ¤¿¤Ï " O_NDELAY +.\"O When possible, the file is opened in nonblocking mode. +.\"O Neither the +.\"O .BR open () +.\"O nor any subsequent operations on the file descriptor which is +.\"O returned will cause the calling process to wait. +.\"O For the handling of FIFOs (named pipes), see also +.\"O .BR fifo (7). +.\"O For a discussion of the effect of +.\"O .B O_NONBLOCK +.\"O in conjunction with mandatory file locks and with file leases, see +.\"O .BR fcntl (2). +²Äǽ¤Ê¤é¤Ð¡¢¥Õ¥¡¥¤¥ë¤ÏÈóÄä»ß (nonblocking) ¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.BR open () +¤â¡¢ÊÖ¤·¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ë°Ê¸å¤Î¤¹¤Ù¤Æ¤ÎÁàºî¤â +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤òÂÔ¤¿¤»¤ë¤³¤È¤Ï¤Ê¤¤¡£ +FIFO (¥Í¡¼¥à¥É¡¦¥Ñ¥¤¥×) ¤ò°·¤¦¾ì¹ç¤Ë¤Ï +.BR fifo (7) +¤â»²¾È¤¹¤ë¤³¤È¡£ +¶¯À©¥Õ¥¡¥¤¥ë¥í¥Ã¥¯ (mandatory file lock) ¤ä¥Õ¥¡¥¤¥ë¥ê¡¼¥¹ (file lease) +¤ÈÁȤ߹ç¤ï¤»¤¿¾ì¹ç¤Î¡¢ +.B O_NONBLOCK +¤Î¸ú²Ì¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤Ï¡¢ +.BR fcntl (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.B O_SYNC +.\"O The file is opened for synchronous I/O. +.\"O Any +.\"O .BR write (2)s +.\"O on the resulting file descriptor will block the calling process until +.\"O the data has been physically written to the underlying hardware. +.\"O .IR "But see NOTES below" . +¥Õ¥¡¥¤¥ë¤ÏƱ´ü (synchronous) I/O ¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.BR open () +¤¬ÊÖ¤·¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +.BR write (2) +¤ò¹Ô¤¦¤È¡¢É¬¤º¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ò¥Ö¥í¥Ã¥¯¤·¡¢ +³ºÅö¥Ï¡¼¥É¥¦¥§¥¢¤ËʪÍýŪ¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¤Þ¤ÇÊÖ¤é¤Ê¤¤¡£ +.I °Ê²¼¤Î¡ÖÃí°Õ¡×¤Î¾Ï¤â»²¾È¡£ +.TP +.B O_TRUNC +.\"O If the file already exists and is a regular file and the open mode allows +.\"O writing (i.e., is +.\"O .B O_RDWR +.\"O or +.\"O .BR O_WRONLY ) +.\"O it will be truncated to length 0. +.\"O If the file is a FIFO or terminal device file, the +.\"O .B O_TRUNC +.\"O flag is ignored. +.\"O Otherwise the effect of +.\"O .B O_TRUNC +.\"O is unspecified. +¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤·¡¢Ä̾ï¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¡¢ +½ñ¤­¹þ¤ß²Ä¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë +(¤Ä¤Þ¤ê¡¢ +.BR O_RDWR "¤Þ¤¿¤Ï" O_WRONLY +¤Î) ¾ì¹ç¡¢Ä¹¤µ 0 ¤ËÀÚ¤êµÍ¤á (truncate) ¤é¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬ FIFO ¤Þ¤¿¤ÏüËö¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¢ +.B O_TRUNC +¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.B O_TRUNC +¤Î¸ú²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.PP +.\"O Some of these optional flags can be altered using +.\"O .BR fcntl (2) +.\"O after the file has been opened. +¤³¤ì¤é¤ÎÁªÂò¥Õ¥é¥°¤Î¤¤¤¯¤Ä¤«¤Ï¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤¿¸å¤Ç¤â +.BR fcntl (2) +¤ò»ÈÍѤ·¤ÆÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O .BR creat () +.\"O is equivalent to +.\"O .BR open () +.\"O with +.\"O .I flags +.\"O equal to +.\"O .BR O_CREAT|O_WRONLY|O_TRUNC . +.BR creat () +¤Ï +.I flags +¤Ë +.B O_CREAT|O_WRONLY|O_TRUNC +¤ò»ØÄꤷ¤Æ +.BR open () +¤ò¹Ô¤¦¤Î¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR open () +.\"O and +.\"O .BR creat () +.\"O return the new file descriptor, or \-1 if an error occurred +.\"O (in which case, +.\"O .I errno +.\"O is set appropriately). +.BR open () +¤È +.BR creat () +¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹ +(¤½¤Î¾ì¹ç¤Ï +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë)¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O The requested access to the file is not allowed, or search permission +.\"O is denied for one of the directories in the path prefix of +.\"O .IR pathname , +.\"O or the file did not exist yet and write access to the parent directory +.\"O is not allowed. +.\"O (See also +.\"O .BR path_resolution (7).) +¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëÍ׵ᤵ¤ì¤¿¥¢¥¯¥»¥¹¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +.I pathname +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Î²¿¤ì¤«¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸¡º÷µö²Ä¤¬¤Ê¤«¤Ã¤¿¡£ +¤Þ¤¿¤Ï¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤»¤º¡¢¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤«¤Ã¤¿¡£ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È¡£) +.TP +.B EEXIST +.\"O .I pathname +.\"O already exists and +.\"O .BR O_CREAT " and " O_EXCL +.\"O were used. +.I pathname +¤Ï´û¤Ë¸ºß¤·¡¢ +.BR O_CREAT " ¤È " O_EXCL +¤¬»ÈÍѤµ¤ì¤¿¡£ +.TP +.B EFAULT +.\"O .I pathname +.\"O points outside your accessible address space. +.I pathname +¤Î»Ø¤¹Îΰ褬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤Ê¤¤¡£ +.TP +.B EFBIG +.\"O See +.\"O .BR EOVERFLOW . +.B EOVERFLOW +»²¾È¡£ +.TP +.B EINTR +.\"O While blocked waiting to complete an open of a slow device +.\"O (e.g., a FIFO; see +.\"O .BR fifo (7)), +.\"O the call was interrupted by a signal handler; see +.\"O .BR signal (7). +ÃÙ¤¤¥Ç¥Ð¥¤¥¹ +(Î㤨¤Ð FIFO¡¢ +.BR fifo (7) +»²¾È) ¤Î¥ª¡¼¥×¥ó¤¬´°Î»¤¹¤ë¤Î¤òÂԤäÆÄä»ß¤·¤Æ¤¤¤ë´Ö¤Ë +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EISDIR +.\"O .I pathname +.\"O refers to a directory and the access requested involved writing +.\"O (that is, +.\"O .B O_WRONLY +.\"O or +.\"O .B O_RDWR +.\"O is set). +.I pathname +¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤ª¤ê¡¢½ñ¤­¹þ¤ßÍ׵᤬´Þ¤Þ¤ì¤Æ¤¤¤¿ +(¤Ä¤Þ¤ê +.B O_WRONLY +¤Þ¤¿¤Ï +.B O_RDWR +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë)¡£ +.TP +.B ELOOP +.\"O Too many symbolic links were encountered in resolving +.\"O .IR pathname , +.\"O or \fBO_NOFOLLOW\fP was specified but +.\"O .I pathname +.\"O was a symbolic link. +.I pathname +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +¤Þ¤¿¤Ï \fBO_NOFOLLOW\fP ¤¬»ØÄꤵ¤ì¤Æ¤ª¤ê¡¢ +.I pathname +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤À¤Ã¤¿¡£ +.TP +.B EMFILE +.\"O The process already has the maximum number of files open. +¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤¬¤¹¤Ç¤ËºÇÂç¿ô¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENAMETOOLONG +.\"O .I pathname +.\"O was too long. +.I pathname +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENFILE +.\"O The system limit on the total number of open files has been reached. +¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤Î¹ç·×¿ô¤¬¥·¥¹¥Æ¥àÀ©¸Â¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENODEV +.\"O .I pathname +.\"O refers to a device special file and no corresponding device exists. +.\"O (This is a Linux kernel bug; in this situation +.\"O .B ENXIO +.\"O must be returned.) +.I pathname +¤¬¥Ç¥Ð¥¤¥¹¡¦¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤ª¤ê¡¢Âбþ¤¹¤ë¥Ç¥Ð¥¤¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +(¤³¤ì¤Ï Linux ¥«¡¼¥Í¥ë¤Î¥Ð¥°¤Ç¤¢¤ê¡¢¤³¤Î¾ì¹ç¤Ë¤Ï +.B ENXIO +¤¬ÊÖ¤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë) +.TP +.B ENOENT +.\"O .B O_CREAT +.\"O is not set and the named file does not exist. +.\"O Or, a directory component in +.\"O .I pathname +.\"O does not exist or is a dangling symbolic link. +.B O_CREAT +¤¬ÀßÄꤵ¤ì¤Æ¤ª¤é¤º¡¢¤«¤Ä»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I pathname +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬Â¸ºß¤·¤Ê¤¤¤«²õ¤ì¤¿ (dangling) ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +.\"O Insufficient kernel memory was available. +¥«¡¼¥Í¥ë¤ËÍøÍѤǤ­¤ë¥á¥â¥ê¤¬ÉÔ­¤·¤Æ¤¤¤ë +.TP +.B ENOSPC +.\"O .I pathname +.\"O was to be created but the device containing +.\"O .I pathname +.\"O has no room for the new file. +.I pathname +¤òºîÀ®¤¹¤ëɬÍפ¬¤¢¤ë¤¬¡¢ +.I pathname +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥Ð¥¤¥¹¤Ë¿·¤·¤¤¥Õ¥¡¥¤¥ë¤Î¤¿¤á¤Î¶õ¤­ÍÆÎ̤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O A component used as a directory in +.\"O .I pathname +.\"O is not, in fact, a directory, or \fBO_DIRECTORY\fP was specified and +.\"O .I pathname +.\"O was not a directory. +.I pathname +¤Ë´Þ¤Þ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Î¤É¤ì¤«¤¬¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +¤Þ¤¿¤Ï \fBO_DIRECTORY\fP ¤¬»ØÄꤵ¤ì¤Æ¤ª¤ê¡¢ +.I pathname +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B ENXIO +.\"O .BR O_NONBLOCK " | " O_WRONLY +.\"O is set, the named file is a FIFO and +.\"O no process has the file open for reading. +.\"O Or, the file is a device special file and no corresponding device exists. +.BR O_NONBLOCK " | " O_WRONLY +¤¬ÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¬ FIFO ¤Ç +¤½¤Î¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢¥Õ¥¡¥¤¥ë¤¬¥Ç¥Ð¥¤¥¹¡¦¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤Ç +Âбþ¤¹¤ë¥Ç¥Ð¥¤¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B EOVERFLOW +.\"O .I pathname +.\"O refers to a regular file that is too large to be opened. +.\"O The usual scenario here is that an application compiled +.\"O on a 32-bit platform without +.\"O .I -D_FILE_OFFSET_BITS=64 +.\"O tried to open a file whose size exceeds +.\"O .I (2<<31)-1 +.\"O bits; +.\"O see also +.\"O .B O_LARGEFILE +.\"O above. +.\"O This is the error specified by POSIX.1-2001; +.\"O in kernels before 2.6.24, Linux gave the error +.\"O .B EFBIG +.\"O for this case. +.I pathname +¤¬»²¾È¤·¤Æ¤¤¤ë¤Î¤¬¡¢Â礭²á¤®¤Æ¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +Ä̾¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤Ï¡¢32 ¥Ó¥Ã¥È¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¾å¤Ç +.I -D_FILE_OFFSET_BITS=64 +¤ò»ØÄꤻ¤º¤Ë¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤¬ +.I (2<31)-1 +¥Ó¥Ã¥È¤òĶ¤¨¤ë¥Õ¥¡¥¤¥ë¤ò³«¤³¤¦¤È¤·¤¿¾ì¹ç¤Ç¤¢¤ë¡£ +¾åµ­¤Î +.B O_LARGEFILE +¤â»²¾È¡£ +¤³¤ì¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ç¤¢¤ë¡£ +2.6.24 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢Linux ¤Ï¤³¤Î¾ì¹ç¤Ë¥¨¥é¡¼ +.B EFBIG +¤òÊÖ¤·¤Æ¤¤¤¿¡£ +.\" See http://bugzilla.kernel.org/show_bug.cgi?id=7253 +.\" "Open of a large file on 32-bit fails with EFBIG, should be EOVERFLOW" +.\" Reported 2006-10-03 +.TP +.B EPERM +.\"O The +.\"O .B O_NOATIME +.\"O flag was specified, but the effective user ID of the caller +.\"O .\" Strictly speaking, it's the file system UID... (MTK) +.\"O did not match the owner of the file and the caller was not privileged +.\"O .RB ( CAP_FOWNER ). +.B O_NOATIME +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ +.\" ¸·Ì©¤Ë¸À¤¨¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID...(MTK) +¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤È°ìÃפ»¤º¡¢¤«¤Ä¸Æ¤Ó½Ð¤·¸µ¤ËÆø¢ +.RB ( CAP_FOWNER ) +¤¬¤Ê¤¤¡£ +.TP +.B EROFS +.\"O .I pathname +.\"O refers to a file on a read-only file system and write access was +.\"O requested. +.I pathname +¤¬Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤ª¤ê¡¢ +½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¬Í׵ᤵ¤ì¤¿¡£ +.TP +.B ETXTBSY +.\"O .I pathname +.\"O refers to an executable image which is currently being executed and +.\"O write access was requested. +.I pathname +¤¬¸½ºß¼Â¹ÔÃæ¤Î¼Â¹Ô¥¤¥á¡¼¥¸¤ò»²¾È¤·¤Æ¤ª¤ê¡¢½ñ¤­¹þ¤ß¤¬Í׵ᤵ¤ì¤¿¡£ +.TP +.B EWOULDBLOCK +.\"O The +.\"O .B O_NONBLOCK +.\"O flag was specified, and an incompatible lease was held on the file +.\"O (see +.\"O .BR fcntl (2)). +.B O_NONBLOCK +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ë¤ÏÌ·½â¤¹¤ë¥ê¡¼¥¹¤¬ÀßÄꤵ¤ì¤Æ¤¤¤¿ +.RB ( fcntl (2) +»²¾È)¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O The +.\"O .BR O_DIRECTORY , +.\"O .BR O_NOATIME , +.\"O and +.\"O .B O_NOFOLLOW +.\"O flags are Linux-specific, and one may need to define +.\"O .B _GNU_SOURCE +.\"O to obtain their definitions. +¥Õ¥é¥° +.BR O_DIRECTORY , +.BR O_NOATIME , +.B O_NOFOLLOW +¤Ï Linux ÆÃÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢ +¤³¤ì¤é¤Î¥Õ¥é¥°¤ÎÄêµÁ¤òÆÀ¤ë¤¿¤á¤Ë¤Ï¡¢ +.B _GNU_SOURCE +¤òÄêµÁ¤¹¤ëɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + +.\"O The +.\"O .BR O_CLOEXEC +.\"O flag is not specified in POSIX.1-2001, +.\"O but is specified in POSIX.1-2008. +.BR O_CLOEXEC +¥Õ¥é¥°¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +POSIX.1-2008 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +.\"O .B O_DIRECT +.\"O is not specified in POSIX; one has to define +.\"O .B _GNU_SOURCE +.\"O to get its definition. +.B O_DIRECT +¤Ï POSIX ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.B O_DIRECT +¤ÎÄêµÁ¤òÆÀ¤ë¤Ë¤Ï +.B _GNU_SOURCE +¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Under Linux, the +.\"O .B O_NONBLOCK +.\"O flag indicates that one wants to open +.\"O but does not necessarily have the intention to read or write. +Linux ¤Ç¤Ï¡¢ +.B O_NONBLOCK +¥Õ¥é¥°¤Ï¡¢ +open ¤ò¼Â¹Ô¤·¤¿¤¤¤¬ read ¤Þ¤¿¤Ï write ¤ò¼Â¹Ô¤¹¤ë°Õ¿Þ¤Ï +ɬ¤º¤·¤â¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.\"O This is typically used to open devices in order to get a file descriptor +.\"O for use with +.\"O .BR ioctl (2). +¤³¤ì¤Ï +.BR ioctl (2) +¤Î¤¿¤á¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë¡¢ +¥Ç¥Ð¥¤¥¹¤ò¥ª¡¼¥×¥ó¤¹¤ë¤È¤­¤Ë¤è¤¯ÍѤ¤¤é¤ì¤ë¡£ + +.\"O Unlike the other values that can be specified in +.\"O .IR flags , +.\"O the +.\"O .I "access mode" +.\"O values +.\"O .BR O_RDONLY ", " O_WRONLY ", and " O_RDWR , +.\"O do not specify individual bits. +.\"O Rather, they define the low order two bits of +.\"O .IR flags , +.\"O and are defined respectively as 0, 1, and 2. +¡Ö¥¢¥¯¥»¥¹¥â¡¼¥É¡×¤ÎÃÍ +.BR O_RDONLY ", " O_WRONLY ", " O_RDWR +¤Ï¡¢ +.I flags +¤Ë»ØÄê¤Ç¤­¤ë¾¤ÎÃͤȰ㤤¡¢¸Ä¡¹¤Î¥Ó¥Ã¥È¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¤³¤ì¤é¤ÎÃÍ¤Ï +.I flags +¤Î²¼°Ì 2 ¥Ó¥Ã¥È¤òÄêµÁ¤¹¤ë¡£ +.BR O_RDONLY ", " O_WRONLY ", " O_RDWR +¤Ï¤½¤ì¤¾¤ì 0, 1, 2 ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O In other words, the combination +.\"O .B "O_RDONLY | O_WRONLY" +.\"O is a logical error, and certainly does not have the same meaning as +.\"O .BR O_RDWR . +¸À¤¤´¹¤¨¤ë¤È¡¢ +.B "O_RDONLY | O_WRONLY" +¤ÎÁȤ߹ç¤ï¤»¤ÏÏÀÍýŪ¤Ë´Ö°ã¤¤¤Ç¤¢¤ê¡¢³Î¤«¤Ë +.B O_RDWR +¤ÈƱ¤¸°ÕÌ£¤Ç¤Ï¤Ê¤¤¡£ +.\"O Linux reserves the special, nonstandard access mode 3 (binary 11) in +.\"O .I flags +.\"O to mean: +.\"O check for read and write permission on the file and return a descriptor +.\"O that can't be used for reading or writing. +.\"O This nonstandard access mode is used by some Linux drivers to return a +.\"O descriptor that is only to be used for device-specific +.\"O .BR ioctl (2) +.\"O operations. +Linux ¤Ç¤Ï¡¢ÆÃÊ̤ʡ¢Èóɸ½à¤Ê¥¢¥¯¥»¥¹¥â¡¼¥É¤È¤·¤Æ 3 (¥Ð¥¤¥Ê¥ê¤Ç¤Ï 11) ¤¬ +ͽÌ󤵤ì¤Æ¤ª¤ê +.I flags +¤Ë»ØÄê¤Ç¤­¤ë¡£ +¤³¤Î¥¢¥¯¥»¥¹¥â¡¼¥É¤ò»ØÄꤹ¤ë¤È¡¢¥Õ¥¡¥¤¥ë¤ÎÆɤ߽Ф·/½ñ¤­¹þ¤ßµö²Ä¤ò¥Á¥§¥Ã¥¯¤·¡¢ +Æɤ߽Ф·¤Ë¤â½ñ¤­¹þ¤ß¤Ë¤â»ÈÍѤǤ­¤Ê¤¤¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¤³¤ÎÈóɸ½à¤Î¥¢¥¯¥»¥¹¥â¡¼¥É¤Ï¤¤¤¯¤Ä¤«¤Î Linux ¥É¥é¥¤¥Ð¤Ç»ÈÍѤµ¤ì¤Æ¤ª¤ê¡¢ +¥Ç¥Ð¥¤¥¹¸ÇÍ­¤Î +.BR ioctl (2) +Áàºî¤Ë¤Î¤ß»ÈÍѤµ¤ì¤ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¤¿¤á¤Ë»È¤ï¤ì¤Æ¤¤¤ë¡£ +.\" See for example util-linux's disk-utils/setfdprm.c +.\" For some background on access mode 3, see +.\" http://thread.gmane.org/gmane.linux.kernel/653123 +.\" "[RFC] correct flags to f_mode conversion in __dentry_open" +.\" LKML, 12 Mar 2008 +.LP +.\"O The (undefined) effect of +.\"O .B O_RDONLY | O_TRUNC +.\"O varies among implementations. +.\"O On many systems the file is actually truncated. +.B O_RDONLY | O_TRUNC +¤Î±Æ¶Á¤Ï̤ÄêµÁ¤Ç¤¢¤ê¡¢¤½¤ÎÆ°ºî¤Ï¼ÂÁõ¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¥Õ¥¡¥¤¥ë¤Ï¼ÂºÝ¤ËÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.\" Linux 2.0, 2.5: truncate +.\" Solaris 5.7, 5.8: truncate +.\" Irix 6.5: truncate +.\" Tru64 5.1B: truncate +.\" HP-UX 11.22: truncate +.\" FreeBSD 4.7: truncate +.PP +.\"O There are many infelicities in the protocol underlying NFS, affecting +.\"O amongst others +.\"O .BR O_SYNC " and " O_NDELAY . +NFS ¤ò¼Â¸½¤·¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¤Ë¤Ï¿¤¯¤ÎÉÔÈ÷¤¬¤¢¤ê¡¢ÆÃ¤Ë +.BR O_SYNC " ¤È " O_NDELAY +¤Ë±Æ¶Á¤¹¤ë¡£ + +.\"O POSIX provides for three different variants of synchronized I/O, +.\"O corresponding to the flags +.\"O .BR O_SYNC , +.\"O .BR O_DSYNC , +.\"O and +.\"O .BR O_RSYNC . +POSIX ¤Ç¤Ï¡¢3 ¼ïÎà¤ÎƱ´ü I/O ¤¬Ä󶡤µ¤ì¤Æ¤ª¤ê¡¢ +.BR O_SYNC , +.BR O_DSYNC , +.BR O_RSYNC +¥Õ¥é¥°¤¬¤³¤ì¤ËÂбþ¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.\"O Currently (2.6.31), Linux only implements +.\"O .BR O_SYNC , +.\"O but glibc maps +.\"O .B O_DSYNC +.\"O and +.\"O .B O_RSYNC +.\"O to the same numerical value as +.\"O .BR O_SYNC +º£¤Î¤È¤³¤í (¥«¡¼¥Í¥ë 2.6.31)¡¢ +Linux ¤Ç¤Ï +.B O_SYNC +¤À¤±¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +glibc ¤Ï +.B O_DSYNC +¤È +.B O_RSYNC +¤Ë +.B O_SYNC +¤ÈƱ¤¸¿ôÃͤò³ä¤êÅö¤Æ¤Æ¤¤¤ë¡£ +.\"O Most Linux filesystems don't actually implement the POSIX +.\"O .B O_SYNC +.\"O semantics, which require all metadata updates of a write +.\"O to be on disk on returning to userspace, but only the +.\"O .B O_DSYNC +.\"O semantics, which require only actual file data and metadata necessary +.\"O to retrieve it to be on disk by the time the system call returns. +¤Û¤È¤ó¤É¤Î Linux ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢¼ÂºÝ¤Ë¤Ï POSIX ¤Î +.B O_SYNC +¤ÎÆ°ºî¤Ç¤Ï¤Ê¤¯ +.B O_DSYNC +¤ÎÆ°ºî¤À¤±¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +POSIX ¤Î +.B O_SYNC +¤Ç¤Ï¡¢ +.BR open () +¤¬¥æ¡¼¥¶¶õ´Ö¤ËÊÖ¤ëºÝ¤Ë¡¢½ñ¤­¹þ¤ß¤Ë´Ø¤¹¤ëÁ´¤Æ¤Î¥á¥¿¥Ç¡¼¥¿¤Î +¹¹¿·¤¬¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +°ìÊý¡¢ +.B O_DSYNC +¤Ç¤Ï¡¢ +.BR open () +¤¬ÊÖ¤ë¤Þ¤Ç¤Ë¡¢¼ÂºÝ¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¡¼¥¿¤È¤½¤Î¥Ç¡¼¥¿¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë +ɬÍפʥ᥿¥Ç¡¼¥¿¤À¤±¤¬¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤ì¤Ð¤è¤¤¡£ + +.\"O Note that +.\"O .BR open () +.\"O can open device special files, but +.\"O .BR creat () +.\"O cannot create them; use +.\"O .BR mknod (2) +.\"O instead. +.BR open () +¤Ï¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤¬¡¢ +.BR creat () +¤Ç¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤òºîÀ®¤Ç¤­¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +Âå¤ï¤ê¤Ë +.BR mknod (2) +¤ò»ÈÍѤ¹¤ë¡£ +.LP +.\"O On NFS file systems with UID mapping enabled, +.\"O .BR open () +.\"O may +.\"O return a file descriptor but, for example, +.\"O .BR read (2) +.\"O requests are denied +.\"O with \fBEACCES\fP. +.\"O This is because the client performs +.\"O .BR open () +.\"O by checking the +.\"O permissions, but UID mapping is performed by the server upon +.\"O read and write requests. +UID ¥Þ¥Ã¥Ô¥ó¥°¤ò»ÈÍѤ·¤Æ¤¤¤ë NFS ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR open () +¤¬¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤·¤¿¾ì¹ç¤Ç¤â +.BR read (2) +¤¬ \fBEACCES\fP ¤ÇµñÈݤµ¤ì¤ë¾ì¹ç¤¬¤¢¤ë¡£ +¤³¤ì¤Ï¥¯¥é¥¤¥¢¥ó¥È¤¬¥¢¥¯¥»¥¹µö²Ä¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤Ã¤Æ +.BR open () +¤ò¼Â¹Ô¤¹¤ë¤¬¡¢Æɤ߹þ¤ß¤ä½ñ¤­¹þ¤ß¤ÎºÝ¤Ë¤Ï +¥µ¡¼¥Ð¡¼¤Ç UID ¥Þ¥Ã¥Ô¥ó¥°¤¬¹Ô¤ï¤ì¤ë¤¿¤á¤Ç¤¢¤ë¡£ + +.\"O If the file is newly created, its +.\"O .IR st_atime , +.\"O .IR st_ctime , +.\"O .I st_mtime +.\"O fields +.\"O (respectively, time of last access, time of last status change, and +.\"O time of last modification; see +.\"O .BR stat (2)) +.\"O are set +.\"O to the current time, and so are the +.\"O .I st_ctime +.\"O and +.\"O .I st_mtime +.\"O fields of the +.\"O parent directory. +.\"O Otherwise, if the file is modified because of the +.\"O .B O_TRUNC +.\"O flag, its st_ctime and st_mtime fields are set to the current time. +¥Õ¥¡¥¤¥ë¤¬¿·¤·¤¯ºîÀ®¤µ¤ì¤ë¤È¡¢ +¥Õ¥¡¥¤¥ë¤Î +.IR st_atime , +.IR st_ctime , +.I st_mtime +¥Õ¥£¡¼¥ë¥É +(¤½¤ì¤¾¤ìºÇ½ª¥¢¥¯¥»¥¹»þ¹ï¡¢ºÇ½ª¾õÂÖÊѹ¹»þ¹ï¡¢ºÇ½ª½¤Àµ»þ¹ï¤Ç¤¢¤ë¡£ +.BR stat (2) +»²¾È) ¤¬¸½ºß»þ¹ï¤ËÀßÄꤵ¤ì¤ë¡£ +¤µ¤é¤Ë¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î +.I st_ctime +¤È +.I st_mtime +¤â¸½ºß»þ¹ï¤ËÀßÄꤵ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ç¡¢O_TRUNC ¥Õ¥é¥°¤Ç¥Õ¥¡¥¤¥ë¤¬½¤Àµ¤µ¤ì¤¿¤È¤­¤Ï¡¢ +¥Õ¥¡¥¤¥ë¤Î +.I st_ctime +¤È +.I st_mtime +¥Õ¥£¡¼¥ë¥É¤¬¸½ºß»þ¹ï¤ËÀßÄꤵ¤ì¤ë¡£ +.SS O_DIRECT +.LP +.\"O The +.\"O .B O_DIRECT +.\"O flag may impose alignment restrictions on the length and address +.\"O of userspace buffers and the file offset of I/Os. +.\"O In Linux alignment +.\"O restrictions vary by file system and kernel version and might be +.\"O absent entirely. +.\"O However there is currently no file system\-independent +.\"O interface for an application to discover these restrictions for a given +.\"O file or file system. +.\"O Some file systems provide their own interfaces +.\"O for doing so, for example the +.\"O .B XFS_IOC_DIOINFO +.\"O operation in +.\"O .BR xfsctl (3). +.B O_DIRECT +¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢¥æ¡¼¥¶¶õ´Ö¥Ð¥Ã¥Õ¥¡¤ÎŤµ¤ä¥¢¥É¥ì¥¹¡¢ +I/O ¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Ë´Ø¤·¤Æ¥¢¥é¥¤¥ó¥á¥ó¥È¤ÎÀ©¸Â¤¬²Ý¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +Linux ¤Ç¤Ï¡¢¥¢¥é¥¤¥ó¥á¥ó¥È¤ÎÀ©¸Â¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ä¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë +¤è¤Ã¤Æ°Û¤Ê¤ê¡¢Á´¤¯À©¸Â¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤â¤¢¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¸½ºß¤Î¤È¤³¤í¡¢»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ä¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ·¤Æ +¤³¤¦¤·¤¿À©¸Â¤¬¤¢¤ë¤«¤ò¸«¤Ä¤±¤ë¤¿¤á¤Î¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¸þ¤±¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÈó°Í¸¤Î¤â¤Î¤Ï¸ºß¤·¤Ê¤¤¡£ +¤¤¤¯¤Ä¤«¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢À©¸Â¤ò³Îǧ¤¹¤ë¤¿¤á¤ÎÆȼ«¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬ +Ä󶡤µ¤ì¤Æ¤¤¤ë¡£Î㤨¤Ð¡¢ +.BR xfsctl (3) +¤Î +.B XFS_IOC_DIOINFO +Ì¿Îá¤Ç¤¢¤ë¡£ +.LP +.\"O Under Linux 2.4, transfer sizes, and the alignment of the user buffer +.\"O and the file offset must all be multiples of the logical block size +.\"O of the file system. +.\"O Under Linux 2.6, alignment to 512-byte boundaries +.\"O suffices. +Linux 2.4 ¤Ç¤Ï¡¢Å¾Á÷¥µ¥¤¥º¡¢ +¥æ¡¼¥¶¡¼¥Ð¥Ã¥Õ¥¡¤Î¥¢¥é¥¤¥ó¥á¥ó¥È¡¢¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Ï¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÏÀÍý¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Linux 2.6 ¤Ç¤Ï¡¢512 ¥Ð¥¤¥È¤´¤È¤Î¶­³¦¤ËÇÛÃÖ¤µ¤ì¤Æ¤¤¤ì¤Ð½¼Ê¬¤Ç¤¢¤ë¡£ +.LP +.\"O The +.\"O .B O_DIRECT +.\"O flag was introduced in SGI IRIX, where it has alignment +.\"O restrictions similar to those of Linux 2.4. +.\"O IRIX has also a +.\"O .BR fcntl (2) +.\"O call to query appropriate alignments, and sizes. +.\"O FreeBSD 4.x introduced +.\"O a flag of the same name, but without alignment restrictions. +.B O_DIRECT +¥Õ¥é¥°¤Ï SGI IRIX ¤ÇƳÆþ¤µ¤ì¤¿¡£SGI IRIX ¤Ë¤â Linux 2.4 ¤ÈƱÍͤΠ+(¥æ¡¼¥¶¡¼¥Ð¥Ã¥Õ¥¡¤Î) ¥¢¥é¥¤¥ó¥á¥ó¥È¤ÎÀ©¸Â¤¬¤¢¤ë¡£ +¤Þ¤¿¡¢IRIX ¤Ë¤ÏŬÀÚ¤ÊÇÛÃ֤ȥµ¥¤¥º¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Î +.BR fcntl (2) +¥³¡¼¥ë¤¬¤¢¤ë¡£ +FreeBSD 4.x ¤âƱ¤¸Ì¾Á°¤Î¥Õ¥é¥°¤òƳÆþ¤·¤¿¤¬¡¢¥¢¥é¥¤¥ó¥á¥ó¥È¤ÎÀ©¸Â¤Ï¤Ê¤¤¡£ +.LP +.\"O .B O_DIRECT +.\"O support was added under Linux in kernel version 2.4.10. +.\"O Older Linux kernels simply ignore this flag. +.\"O Some file systems may not implement the flag and +.\"O .BR open () +.\"O will fail with +.\"O .B EINVAL +.\"O if it is used. +.B O_DIRECT +¤¬ Linux ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤¿¤Î¤Ï¡¢¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó 2.4.10 ¤Ç¤¢¤ë¡£ +¸Å¤¤ Linux ¥«¡¼¥Í¥ë¤Ï¡¢¤³¤Î¥Õ¥é¥°¤òñ¤Ë̵»ë¤¹¤ë¡£ +.B O_DIRECT +¥Õ¥é¥°¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤â¤¢¤ê¡¢¤½¤Î¾ì¹ç¤Ï¡¢ +.B O_DIRECT +¤ò»ÈÍѤ¹¤ë¤È +.BR open () +¤Ï +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.LP +.\"O Applications should avoid mixing +.\"O .B O_DIRECT +.\"O and normal I/O to the same file, +.\"O and especially to overlapping byte regions in the same file. +.\"O Even when the file system correctly handles the coherency issues in +.\"O this situation, overall I/O throughput is likely to be slower than +.\"O using either mode alone. +.\"O Likewise, applications should avoid mixing +.\"O .BR mmap (2) +.\"O of files with direct I/O to the same files. +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¡¢ +ÆäËƱ¤¸¥Õ¥¡¥¤¥ë¤Î½ÅÊ£¤¹¤ë¥Ð¥¤¥ÈÎΰè¤ËÂФ·¤Æ¡¢ +.B O_DIRECT +¤ÈÄ̾ï¤Î I/O ¤òº®¤¼¤Æ»È¤¦¤Î¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¤³¤Î¤è¤¦¤Ê¾õ¶·¤Ë¤ª¤¤¤Æ°ì´ÓÀ­¤ÎÌäÂê¤òÀµ¤·¤¯ +°·¤¦¤³¤È¤¬¤Ç¤­¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢Á´ÂΤΠI/O ¥¹¥ë¡¼¥×¥Ã¥È¤Ï +¤É¤Á¤é¤«°ìÊý¤ò»ÈÍѤ¹¤ë¤È¤­¤ÈÈæ¤Ù¤ÆÄ㮤ˤʤë¤Ç¤¢¤í¤¦¡£ +ƱÍͤˡ¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +.BR mmap (2) +¤ÈľÀÜ I/O +.RB ( O_DIRECT ) +¤òº®¤¼¤Æ»È¤¦¤Î¤âÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.LP +.\"O The behaviour of +.\"O .B O_DIRECT +.\"O with NFS will differ from local file systems. +.\"O Older kernels, or +.\"O kernels configured in certain ways, may not support this combination. +.\"O The NFS protocol does not support passing the flag to the server, so +.\"O .B O_DIRECT +.\"O I/O will only bypass the page cache on the client; the server may +.\"O still cache the I/O. +NFS ¤Ç +.B O_DIRECT +¤ò»È¤Ã¤¿¾ì¹ç¤ÎÆ°ºî¤Ï¥í¡¼¥«¥ë¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¾ì¹ç¤È°ã¤¦¡£ +¸Å¤¤¥«¡¼¥Í¥ë¤ä¡¢¤¢¤ë¼ï¤ÎÀßÄê¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥«¡¼¥Í¥ë¤Ï¡¢ +.B O_DIRECT +¤È NFS ¤ÎÁȤ߹ç¤ï¤»¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +NFS ¥×¥í¥È¥³¥ë¼«ÂΤϥµ¡¼¥Ð¤Ë¥Õ¥é¥°¤òÅϤ¹µ¡Ç½¤Ï»ý¤Ã¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢ +.B O_DIRECT +I/O ¤Ï¥¯¥é¥¤¥¢¥ó¥È¾å¤Î¥Ú¡¼¥¸¥­¥ã¥Ã¥·¥å¤ò¥Ð¥¤¥Ñ¥¹¤¹¤ë¤À¤±¤Ë¤Ê¤ê¡¢ +¥µ¡¼¥Ð¤Ï I/O ¤ò¥­¥ã¥Ã¥·¥å¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O The client asks the server to make the I/O +.\"O synchronous to preserve the synchronous semantics of +.\"O .BR O_DIRECT . +.\"O Some servers will perform poorly under these circumstances, especially +.\"O if the I/O size is small. +.\"O Some servers may also be configured to +.\"O lie to clients about the I/O having reached stable storage; this +.\"O will avoid the performance penalty at some risk to data integrity +.\"O in the event of server power failure. +.\"O The Linux NFS client places no alignment restrictions on +.\"O .B O_DIRECT +.\"O I/O. +¥¯¥é¥¤¥¢¥ó¥È¤Ï¡¢ +.B O_DIRECT +¤ÎƱ´üµ¡¹½¤òÊÝ»ý¤¹¤ë¤¿¤á¡¢¥µ¡¼¥Ð¤ËÂФ·¤Æ I/O ¤òƱ´ü¤·¤Æ¹Ô¤¦¤è¤¦¤Ë°ÍÍꤹ¤ë¡£ +¥µ¡¼¥Ð¤Ë¤è¤Ã¤Æ¤Ï¡¢¤³¤¦¤·¤¿¾õ¶·²¼¡¢ÆÃ¤Ë I/O ¥µ¥¤¥º¤¬¾®¤µ¤¤¾ì¹ç¤Ë +À­Ç½¤¬Â礭¤¯Îô²½¤¹¤ë¡£ +¤Þ¤¿¡¢¥µ¡¼¥Ð¤Ë¤è¤Ã¤Æ¤Ï¡¢I/O ¤¬°ÂÄꤷ¤¿¥¹¥È¥ì¡¼¥¸¤Ë¤Þ¤Ç¹Ô¤ï¤ì¤¿¤È¡¢ +¥¯¥é¥¤¥¢¥ó¥È¤ËÂФ·¤Æ±³¤ò¤Ä¤¯¤â¤Î¤â¤¢¤ë¡£ +¤³¤ì¤Ï¡¢¥µ¡¼¥Ð¤ÎÅŸ»¸Î¾ã¤¬µ¯¤³¤Ã¤¿ºÝ¤Ë¥Ç¡¼¥¿¤Î´°Á´À­¤¬Êݤ¿¤ì¤Ê¤¤ +´í¸±¤Ï¾¯¤·¤¢¤ë¤¬¡¢À­Ç½Ì̤ǤÎÉÔÍø¤Ê¾ò·ï¤ò²óÈò¤¹¤ë¤¿¤á¤Ë¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +Linux ¤Î NFS ¥¯¥é¥¤¥¢¥ó¥È¤Ç¤Ï +.B O_DIRECT +I/O +¤Ç¤Î¥¢¥é¥¤¥ó¥á¥ó¥È¤ÎÀ©¸Â¤Ï¤Ê¤¤¡£ +.PP +.\"O In summary, +.\"O .B O_DIRECT +.\"O is a potentially powerful tool that should be used with caution. +.\"O It is recommended that applications treat use of +.\"O .B O_DIRECT +.\"O as a performance option which is disabled by default. +¤Þ¤È¤á¤ë¤È¡¢ +.B O_DIRECT +¤Ï¡¢Ãí°Õ¤·¤Æ»È¤¦¤Ù¤­¤Ç¤¢¤ë¤¬¡¢¶¯ÎϤʥġ¼¥ë¤È¤Ê¤ë²ÄǽÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï +.B O_DIRECT +¤ò¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëÀ­Ç½¸þ¾å¤Î¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤È +¹Í¤¨¤Æ¤ª¤¯¤Î¤¬¤è¤¤¤Ç¤¢¤í¤¦¡£ +.PP +.RS +.\"O "The thing that has always disturbed me about O_DIRECT is that the whole +.\"O interface is just stupid, and was probably designed by a deranged monkey +.\"O on some serious mind-controlling substances." \(em Linus +¡ÖO_DIRECT ¤Ç¤¤¤Ä¤âº¤¤ë¤Î¤Ï¡¢¥¤¥ó¥¿¥Õ¥§¡¼¥¹Á´Éô¤¬ËÜÅö¤Ë¤ªÇϼ¯¤ÊÅÀ¤À¡£ +¤¿¤Ö¤ó´í¤Ê¤¤¥Þ¥¤¥ó¥É¥³¥ó¥È¥í¡¼¥ëºÞ¤Ç +Ƭ¤¬¤ª¤«¤·¤¯¤Ê¤Ã¤¿¥µ¥ë¤¬À߷פ·¤¿¤ó¤¸¤ã¤Ê¤¤¤«¤Ê¡× \(em Linus +.RE +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Currently, it is not possible to enable signal-driven +.\"O I/O by specifying +.\"O .B O_ASYNC +.\"O when calling +.\"O .BR open (); +.\"O use +.\"O .BR fcntl (2) +.\"O to enable this flag. +¸½ºß¤Î¤È¤³¤í¡¢ +.BR open () +¤Î¸Æ¤Ó½Ð¤·»þ¤Ë +.B O_ASYNC +¤ò»ØÄꤷ¤Æ¥·¥°¥Ê¥ë¶îÆ° I/O ¤òÍ­¸ú¤Ë¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¤³¤Î¥Õ¥é¥°¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï +.BR fcntl (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.\" FIXME . Check bugzilla report on open(O_ASYNC) +.\" See http://bugzilla.kernel.org/show_bug.cgi?id=5993 +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR chmod (2), +.BR chown (2), +.BR close (2), +.BR dup (2), +.BR fcntl (2), +.BR link (2), +.BR lseek (2), +.BR mknod (2), +.BR mmap (2), +.BR mount (2), +.BR openat (2), +.BR read (2), +.BR socket (2), +.BR stat (2), +.BR umask (2), +.BR unlink (2), +.BR write (2), +.BR fopen (3), +.BR feature_test_macros (7), +.BR fifo (7), +.BR path_resolution (7), +.BR symlink (7) diff --git a/draft/man2/openat.2 b/draft/man2/openat.2 new file mode 100644 index 00000000..24b946c0 --- /dev/null +++ b/draft/man2/openat.2 @@ -0,0 +1,269 @@ +.\" 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-09-27 by Yuichi SATO , LDP v2.39 +.\" +.TH OPENAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O openat \- open a file relative to a directory file descriptor +openat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int openat(int " dirfd ", const char *" pathname ", int " flags ); +.BI "int openat(int " dirfd ", const char *" pathname ", int " flags \ +", mode_t " mode ); +.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 openat (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.\"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) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.\"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) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î +ÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.\"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) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I pathname +.\"O is absolute, then +.\"O .I dirfd +.\"O is ignored. +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.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 +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.\"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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR openat () +.\"O was added to Linux in kernel 2.6.16. +.BR openat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.\"O .SH "CONFORMING TO" +.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 +.\" to refer to the notion of "at a relative location". +.\" +.\" See the following for a discussion of the inconsistent +.\" naming of the *at() functions: +.\" http://www.opengroup.org/austin/mailarchives/ag/msg09103.html +.\" Subject: RE: The naming of at()s is a difficult matter +.\" From: Don Cragun +.\" Date: Tue, 14 Feb 2006 14:56:50 -0800 (PST) +.\" +.\"O .SH NOTES +.SH Ãí°Õ +.\"O .BR openat () +.\"O and other similar system calls suffixed "at" are supported +.\"O for two reasons. +.BR openat () +¤ä "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 +°ú¤­¿ô¤Ë»ØÄꤹ¤ë¤³¤È¤Ç²óÈò¤Ç¤­¤ë¡£ + +.\"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 +¤ò»È¤Ã¤¿Î¢µ»¤Ç¤â¼Â¸½¤Ç¤­¤ë¤¬¡¢¤¢¤Þ¤ê¸úΨŪ¤Ç¤Ï¤Ê¤¤)¡£ +.\"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) diff --git a/draft/man2/outb.2 b/draft/man2/outb.2 new file mode 100644 index 00000000..b73ba73b --- /dev/null +++ b/draft/man2/outb.2 @@ -0,0 +1,111 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Paul Gortmaker +.\" (gpg109@rsphy1.anu.edu.au) +.\" Wed Nov 29 10:58:54 EST 1995 +.\" +.\" 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) 1996 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Wed Dec 4 15:19:14 JST 1996 +.\" by HANATAKA Shinya +.\" Updated Fri Dec 14 JST 2001 by Kentaro Shirakata +.\" Updated Sun May 23 JST 2004 by Kentaro Shirakata +.\" Updated Thu Mar 24 JST 2005 by Kentaro Shirakata +.\" Updated Thu Oct 9 JST 2005 by Kentaro Shirakata +.\" +.\"WORD: inline macro ¥¤¥ó¥é¥¤¥ó¡¦¥Þ¥¯¥í +.\"WORD: unresolved reference ²ò·è¤Ç¤­¤Ê¤¤»²¾È +.\"WORD: segmentation fault ¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó°ãÈ¿ +.\" +.TH OUTB 2 1995-11-29 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +.\"O outb, outw, outl, outsb, outsw, outsl, +.\"O inb, inw, inl, insb, insw, insl, +.\"O outb_p, outw_p, outl_p, inb_p, inw_p, inl_p \- port I/O +outb, outw, outl, outsb, outsw, outsl, +inb, inw, inl, insb, insw, insl, +outb_p, outw_p, outl_p, inb_p, inw_p, inl_p \- ¥Ý¡¼¥ÈÆþ½ÐÎÏ +.SH ÀâÌÀ +.\"O This family of functions is used to do low-level port input and output. +.\"O The out* functions do port output, the in* functions do port input; +.\"O the b-suffix functions are byte-width and the w-suffix functions +.\"O word-width; the _p-suffix functions pause until the I/O completes. +¤³¤Î°ìÏ¢¤Î´Ø¿ô¤Ï¥Ý¡¼¥È¤ËÂФ¹¤ëÄã¥ì¥Ù¥ë¤ÎÆþ½ÐÎϤ˻ÈÍѤ¹¤ë¡£ +out* ´Ø¿ô¤Ï¥Ý¡¼¥È½ÐÎÏ¡¢in* ´Ø¿ô¤Ï¥Ý¡¼¥ÈÆþÎϤò¹Ô¤¦¡£ +¸ìÈø¤Ë b ¤¬¤Ä¤¤¤Æ¤¤¤ë´Ø¿ô¤Ï¥Ð¥¤¥Èñ°Ì¡¢w ¤¬¤Ä¤¤¤Æ¤¤¤ë´Ø¿ô¤Ï¥ï¡¼¥Éñ°Ì¤Ç¤¢¤ë¡£ +_p ¤¬¤Ä¤¤¤Æ¤¤¤ë´Ø¿ô¤Ï I/O ¤¬½ªÎ»¤¹¤ë¤Þ¤ÇÂԤġ£ +.LP +.\"O They are primarily designed for internal kernel use, +.\"O but can be used from user space. +.\"O .\" , given the following information +.\"O .\" in addition to that given in +.\"O .\" .BR outb (9). +¤³¤ì¤é¤Î´Ø¿ô¤Ï¤â¤È¤â¤È¥«¡¼¥Í¥ëÆâÉô¤Ç¤Î»ÈÍѤòÁÛÄꤷ¤ÆÀ߷פµ¤ì¤Æ¤¤¤ë¤¬¡¢ +¥æ¡¼¥¶¡¼¶õ´Ö¤«¤é¤Ç¤â»ÈÍѤǤ­¤ë¡£ +.\" ÄɲäξðÊó¤Ï +.\" .BR outb (9) +.\" ¤Ë¤¢¤ë¡£ + +.\"O You compile with \fB\-O\fP or \fB\-O2\fP or similar. +.\"O The functions +.\"O are defined as inline macros, and will not be substituted in without +.\"O optimization enabled, causing unresolved references at link time. +\fB\-O\fP ¤ä \fB\-O2\fP ¤Ê¤É¤ò»ØÄꤷ¤Æ¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤³¤È¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¤¥ó¥é¥¤¥ó¡¦¥Þ¥¯¥í¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +ºÇŬ²½¤ò¹Ô¤ï¤Ê¤¤¤È´Ø¿ô¤ÎŸ³«¤¬¹Ô¤ï¤ì¤º¡¢ +¥ê¥ó¥¯¤Î»þ¤Ë¡Ö²ò·è¤Ç¤­¤Ê¤¤»²¾È(unresolved reference)¡×¤¬È¯À¸¤¹¤ë¡£ + +.\"O You use +.\"O .BR ioperm (2) +.\"O or alternatively +.\"O .BR iopl (2) +.\"O to tell the kernel to allow the user space application to access the +.\"O I/O ports in question. +.\"O Failure to do this will cause the application +.\"O to receive a segmentation fault. +¥æ¡¼¥¶¡¼¶õ´Ö¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ I/O ¥Ý¡¼¥È¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤ò +¥«¡¼¥Í¥ë¤Ë¶µ¤¨¤ë¤¿¤á¤Ë +.BR ioperm (2) +¤â¤·¤¯¤Ï +.BR iopl (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£¤³¤ì¤ò˺¤ì¤ë¤È¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó°ãÈ¿ +(segmentation fault) ¤ò¼õ¤±¤È¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.SH ½àµò +.\"O .BR outb () +.\"O and friends are hardware-specific. +.\"O The +.\"O .I value +.\"O argument is passed first and the +.\"O .I port +.\"O argument is passed second, +.\"O which is the opposite order from most DOS implementations. +.BR outb () +¤È¤½¤ÎÃç´Ö¤Ï¥Ï¡¼¥É¥¦¥§¥¢ÆÃÍ­¤Ç¤¢¤ë¡£ +.I value +°ú¿ô¤¬ºÇ½é¤ËÅϤµ¤ì¡¢ +.I port +°ú¿ô¤¬ÆóÈÖÌܤËÅϤµ¤ì¤ë¡£ +¤³¤Î½ç½ø¤Ï¤Û¤È¤ó¤É¤Î DOS ¤Ç¤Î¼ÂÁõ¤È¤ÏµÕ¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ioperm (2), +.BR iopl (2) diff --git a/draft/man2/pause.2 b/draft/man2/pause.2 new file mode 100644 index 00000000..353ac1ac --- /dev/null +++ b/draft/man2/pause.2 @@ -0,0 +1,91 @@ +.\" 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 Sat Jul 24 14:48:00 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995 by Mike Battersby (mib@deakin.edu.au) +.\" Modified 2000 by aeb, following Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated Thu Jun 26 21:08:30 JST 1997 +.\" by SUTO, Mitsuaki +.\" +.TH PAUSE 2 2008-10-06 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O pause \- wait for signal +pause \- ¥·¥°¥Ê¥ë¤òÂÔ¤Ä +.\"O .SH SYNOPSIS +.SH µ­½Ò +.B #include +.sp +.B int pause(void); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR pause () +.\"O causes the calling process (or thread) to sleep +.\"O until a signal is delivered that either terminates the process or causes +.\"O the invocation of a signal-catching function. +.BR pause () +¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹ (¤Þ¤¿¤Ï¥¹¥ì¥Ã¥É) ¤ò¡¢ +¤½¤Î¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤¿¤ê¡¢¥·¥°¥Ê¥ëÊ᪴ؿô¤¬µ¯Æ°¤µ¤ì¤ë¤è¤¦¤Ê +¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¡¢¥¹¥ê¡¼¥×¤µ¤»¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR pause () +.\"O only returns when a signal was caught and the +.\"O signal-catching function returned. +.\"O In this case +.\"O .BR pause () +.\"O returns \-1, and +.\"O .I errno +.\"O is set to +.\"O .\" .BR ERESTARTNOHAND . +.\"O .BR EINTR . +.BR pause () +¤¬ÊÖ¤ë¤Î¤Ï¡¢¥·¥°¥Ê¥ë¤ò¼õ¤±¼è¤ê¥·¥°¥Ê¥ëÊá³Í´Ø¿ô¤«¤éÊ֤俾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +¤³¤Î¾ì¹ç¤Ï +.BR pause () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.\" .B ERESTARTNOHAND +.B EINTR +¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINTR +.\"O a signal was caught and the signal-catching function returned. +¥·¥°¥Ê¥ë¤ò¼õ¤±¼è¤ê¡¢¥·¥°¥Ê¥ëÊá³Í´Ø¿ô¤«¤éµ¢¤Ã¤Æ¤­¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR select (2), +.BR signal (2), +.BR sigsuspend (2) diff --git a/draft/man2/pciconfig_read.2 b/draft/man2/pciconfig_read.2 new file mode 100644 index 00000000..b1dbd88f --- /dev/null +++ b/draft/man2/pciconfig_read.2 @@ -0,0 +1,193 @@ +.\" Contributed by Niki A. Rahimi, LTC Security Development +.\" narahimi@us.ibm.com +.\" May be freely distributed. +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Sat Jun 19 17:51:11 JST 2004 +.\" by Yuichi SATO +.\" +.TH PCICONFIG_READ 2 2003-07-14 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O pciconfig_read, pciconfig_write, pciconfig_iobase \- pci device information handling +pciconfig_read, pciconfig_write, pciconfig_iobase \- pci ¥Ç¥Ð¥¤¥¹¾ðÊó¤ò°·¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int pciconfig_read(unsigned long " bus ", unsigned long " dfn , +.BI " unsigned long " off ", unsigned long " len ", void *" buf ); +.BI "int pciconfig_write(unsigned long " bus ", unsigned long " dfn , +.BI " unsigned long " off ", unsigned long " len ", void *" buf ); +.BI "int pciconfig_iobase(long " which ", unsigned long " bus , +.BI " unsigned long " devfn ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.PP +.\"O Most of the interaction with PCI devices is already handled by the +.\"O kernel PCI layer, +.\"O and thus these calls should not normally need to be accessed from userspace. +PCI ¥Ç¥Ð¥¤¥¹¤È¤Î¤ä¤ê¼è¤ê (interaction) ¤Ï +¥«¡¼¥Í¥ë PCI ¥ì¥¤¥ä¤Ç¤¹¤Ç¤Ë½èÍý¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢ +Ä̾ï¤Ï¤³¤é¤é¤Î´Ø¿ô¤ò¥æ¡¼¥¶¶õ´Ö¤«¤é¥¢¥¯¥»¥¹¤¹¤ëɬÍפϤʤ¤¡£ +.TP +.BR pciconfig_read () +.\"O Reads to +.\"O .I buf +.\"O from device +.\"O .I dev +.\"O at offset +.\"O .I off +.\"O value. +¥Ç¥Ð¥¤¥¹ +.I dev +¤Î¥ª¥Õ¥»¥Ã¥È +.I off +¤ÎÃͤò +.I buf +¤ËÆɤ߹þ¤à¡£ +.TP +.BR pciconfig_write () +.\"O Writes from +.\"O .I buf +.\"O to device +.\"O .I dev +.\"O at offset +.\"O .I off +.\"O value. +¥Ç¥Ð¥¤¥¹ +.I dev +¤Î¥ª¥Õ¥»¥Ã¥È +.I off +¤Ë +.I buf +¤ÎÃͤò½ñ¤­¹þ¤à¡£ +.TP +.BR pciconfig_iobase () +.\"O You pass it a bus/devfn pair and get a physical address for either the +.\"O memory offset (for things like prep, this is 0xc0000000), +.\"O the IO base for PIO cycles, or the ISA holes if any. +.\"Osato: +.\"Osato: prep ¤Ï PowerPC Reference Platform ¤Î¤³¤È¤«¡£ +.\"Osato: PIO cycles ¤Ï memory offset ¤Ë¤â¤«¤«¤ë¤Î¤«¡£ +.\"Osato: if any ¤Ï¤É¤³¤Þ¤Ç¤«¤«¤ë¤Î¤«¡£ +.\"Osato: +bus/devfn ¥Ú¥¢¤ò¤³¤Î´Ø¿ô¤ËÅϤ·¡¢ +¥á¥â¥ê¥ª¥Õ¥»¥Ã¥È (prep ¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤Ï¡¢¤³¤ÎÃÍ¤Ï 0xc0000000 ¤Ç¤¢¤ë) ¤È +PIO ¥µ¥¤¥¯¥ë¤Î IO ¥Ù¡¼¥¹¤ÎʪÍý¥¢¥É¥ì¥¹¤ò¼èÆÀ¤¹¤ë¡£ +¤Þ¤¿¡¢¤â¤·¤¢¤ë¤Ê¤é¤Ð ISA hole ¤ÎʪÍý¥¢¥É¥ì¥¹¤ò¼èÆÀ¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.TP +.BR pciconfig_read () +.\"O On success zero is returned. +.\"O On error, \-1 is returned and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.TP +.BR pciconfig_write () +.\"O On success zero is returned. +.\"O On error, \-1 is returned and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.TP +.BR pciconfig_iobase () +.\"O Returns information on locations of various I/O +.\"O regions in physical memory according to the +.\"O .I which +.\"O value. +.\"O Values for +.\"O .I which +.\"O are: +.\"O .BR IOBASE_BRIDGE_NUMBER , +.\"O .BR IOBASE_MEMORY , +.\"O .BR IOBASE_IO , +.\"O .BR IOBASE_ISA_IO , +.\"O .BR IOBASE_ISA_MEM . +.I which +¤ÎÃͤ˴ð¤Å¤¤¤Æ¡¢ÊªÍý¥á¥â¥êÆâ¤ÎÍÍ¡¹¤Ê I/O Îΰè¤Î°ÌÃÖ¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£ +.I which +¤ÎÃͤϡ¢ +.BR IOBASE_BRIDGE_NUMBER , +.BR IOBASE_MEMORY , +.BR IOBASE_IO , +.BR IOBASE_ISA_IO , +.B IOBASE_ISA_MEM +¤Ç¤¢¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O .I len +.\"O value is invalid. +.\"O This does not apply to +.\"O .BR pciconfig_iobase (). +.I len +¤ÎÃͤ¬Ìµ¸ú¤Ç¤¢¤ë¡£ +¤³¤Î¥¨¥é¡¼¤Ï +.BR pciconfig_iobase () +¤Ë¤ÏŬÍѤµ¤ì¤Ê¤¤¡£ +.TP +.B EIO +.\"O I/O error. +I/O ¥¨¥é¡¼¡£ +.TP +.B ENODEV +.\"O For +.\"O .BR pciconfig_iobase (), +.\"O "hose" value is NULL. +.\"O For the other calls, could not find a slot. +.BR pciconfig_iobase () +¤Î¾ì¹ç¡¢¤Ç¥Û¡¼¥¹ (hose) ¤ÎÃͤ¬ NULL ¤Ç¤¢¤ë¡£ +¾¤Î¸Æ¤Ó½Ð¤·¤Î¾ì¹ç¡¢¥¹¥í¥Ã¥È (slot) ¤¬¸«¤Ä¤«¤é¤Ê¤¤¡£ +.TP +.B ENOSYS +.\"O The system has not implemented these calls +.\"O .RB ( CONFIG_PCI +.\"O not defined). +¤³¤Î¥·¥¹¥Æ¥à¤Ï¤³¤ì¤é¤Î¸Æ¤Ó½Ð¤·¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¡£ +.RB ( CONFIG_PCI +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤)¡£ +.TP +.B EOPNOTSUPP +.\"O This return value is only valid for +.\"O .BR pciconfig_iobase (). +¤³¤ÎÊÖ¤êÃÍ¤Ï +.BR pciconfig_iobase () +¤Ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +.\"O It is returned if the value for +.\"O .I which +.\"O is invalid. +¤³¤Î¥¨¥é¡¼¤Ï +.I which +¤ÎÃͤ¬Ìµ¸ú¤Ç¤¢¤ë¤È¤­¤ËÊÖ¤µ¤ì¤ë¡£ +.TP +.B EPERM +.\"O User does not have the \fBCAP_SYS_ADMIN\fP capability. +.\"O This does not apply to +.\"O .BR pciconfig_iobase (). +¥æ¡¼¥¶¤¬ +.B CAP_SYS_ADMIN +¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +¤³¤Î¥¨¥é¡¼¤Ï +.BR pciconfig_iobase () +¤Ë¤ÏŬÍѤµ¤ì¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These calls are Linux-specific, available since Linux 2.0.26/2.1.11. +¤³¤ì¤é¤Î¸Æ¤Ó½Ð¤·¤Ï Linux ÆÃÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢ +Linux 2.0.26/2.1.11 ¤«¤é»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR capabilities (7) diff --git a/draft/man2/personality.2 b/draft/man2/personality.2 new file mode 100644 index 00000000..056ef3c1 --- /dev/null +++ b/draft/man2/personality.2 @@ -0,0 +1,112 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created Sat Aug 21 1995 Thomas K. Dyas +.\" +.\" typo corrected, aeb, 950825 +.\" added layout change from joey, 960722 +.\" changed prototype, documented 0xffffffff, aeb, 030101 +.\" Modified 2004-11-03 patch from Martin Schulze +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Updated 2003-04-24, Kentaro Shirakata +.\" Updated 2007-05-04, Akihiro MOTOKI +.\" +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: execution domain ¼Â¹Ô¥É¥á¥¤¥ó +.\"WORD: personality ¥Ñ¡¼¥½¥Ê¥ê¥Æ¥£ +.\"WORD: binary ¥Ð¥¤¥Ê¥ê +.\"WORD: operating system ¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¡¦¥·¥¹¥Æ¥à +.\" +.TH PERSONALITY 2 2003-01-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O personality \- set the process execution domain +personality \- ¥×¥í¥»¥¹¤ò¼Â¹Ô¤¹¤ë¥É¥á¥¤¥ó¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int personality(unsigned long " persona ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Linux supports different execution domains, or personalities, for each +.\"O process. +.\"O Among other things, execution domains tell Linux how to map +.\"O signal numbers into signal actions. +.\"O The execution domain system allows +.\"O Linux to provide limited support for binaries compiled under other +.\"O Unix-like operating systems. +Linux ¤Ï¡¢¥×¥í¥»¥¹Ëè¤Î°Û¤Ê¤ë¼Â¹Ô¥É¥á¥¤¥ó¡¢¤¹¤Ê¤ï¤Á +¥Ñ¡¼¥½¥Ê¥ê¥Æ¥£ (personality) ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¼Â¹Ô¥É¥á¥¤¥ó¤Ï Linux ¤Ë¥·¥°¥Ê¥ëÈÖ¹æ¤Ë¤É¤Î¥·¥°¥Ê¥ë¤ò³ä¤êÉÕ¤±¤ë¤«¤ò +¶µ¤¨¤¿¤ê¤¹¤ë¡£¤Þ¤¿¡¢¼Â¹Ô¥É¥á¥¤¥ó¡¦¥·¥¹¥Æ¥à¤Ë¤è¤ê¡¢ +Linux ¤Ï¾¤Î Unix É÷¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¡¦¥·¥¹¥Æ¥à¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ +¥Ð¥¤¥Ê¥ê¤ËÂФ¹¤ë¸ÂÄêŪ¤Ê¥µ¥Ý¡¼¥È¤òÄ󶡤·¤Æ¤¤¤ë¡£ + +.\"O This function will return the current +.\"O .BR personality () +.\"O when +.\"O .I persona +.\"O equals 0xffffffff. +.\"O Otherwise, it will make the execution domain +.\"O referenced by +.\"O .I persona +.\"O the new execution domain of the calling process. +.B personality () +´Ø¿ô¤Ï¡¢ +.I persona +¤¬ 0xffffffff ¤Î¾ì¹ç¤Ï¸½ºß¤Î +.B ¥Ñ¡¼¥½¥Ê¥ê¥Æ¥£ +¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.I persona +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¼Â¹Ô¥É¥á¥¤¥ó¤ò¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¿·¤·¤¤¼Â¹Ô¥É¥á¥¤¥ó¤È¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, the previous +.\"O .I persona +.\"O is returned. +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤·¤¿¾ì¹ç¡¢°ÊÁ°¤Î +.I persona +¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O The kernel was unable to change the personality. +¥«¡¼¥Í¥ë¤¬¥Ñ¡¼¥½¥Ê¥ê¥Æ¥£¤òÊѹ¹¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR personality () +.\"O is Linux-specific and should not be used in programs intended to +.\"O be portable. +.BR personality () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ diff --git a/draft/man2/pipe.2 b/draft/man2/pipe.2 new file mode 100644 index 00000000..bf0dc970 --- /dev/null +++ b/draft/man2/pipe.2 @@ -0,0 +1,292 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2005, 2008, Michael Kerrisk +.\" (A few fragments remain from an earlier (1992) version by +.\" Drew Eckhardt .) +.\" +.\" 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-23 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 2004-06-17 by Michael Kerrisk +.\" Modified 2005, mtk: added an example program +.\" Modified 2008-01-09, mtk: rewrote DESCRIPTION; minor additions +.\" to EXAMPLE text. +.\" 2008-10-10, mtk: add description of pipe2() +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated Thu Jun 26 21:09:51 JST 1997 +.\" by SUTO, Mitsuaki +.\" Updated & Modified Thu Feb 10 00:47:11 JST 2005 +.\" by Yuichi SATO +.\" Updated & Modified Sat Dec 17 08:10:16 JST 2005 by Yuichi SATO +.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 +.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" +.TH PIPE 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O pipe, pipe2 \- create pipe +pipe, pipe2 \- ¥Ñ¥¤¥×¤òÀ¸À®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int pipe(int " pipefd "[2]);" +.sp +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int pipe2(int " pipefd "[2], int " flags ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR pipe () +.\"O creates a pipe, a unidirectional data channel that +.\"O can be used for interprocess communication. +.\"O The array +.\"O .IR pipefd +.\"O is used to return two file descriptors referring to the ends of the pipe. +.\"O .IR pipefd[0] +.\"O refers to the read end of the pipe. +.\"O .IR pipefd[1] +.\"O refers to the write end of the pipe. +.\"O Data written to the write end of the pipe is buffered by the kernel +.\"O until it is read from the read end of the pipe. +.\"O For further details, see +.\"O .BR pipe (7). +.BR pipe (2) +¤Ï¥Ñ¥¤¥×¤òÀ¸À®¤¹¤ë¡£ +¥Ñ¥¤¥×¤Ï¡¢¥×¥í¥»¥¹´ÖÄÌ¿®¤Ë»ÈÍѤǤ­¤ëñÊý¸þ¤Î¥Ç¡¼¥¿¥Á¥ã¥Í¥ë¤Ç¤¢¤ë¡£ +ÇÛÎó +.I pipefd +¤Ï¡¢¥Ñ¥¤¥×¤Îξü¤ò»²¾È¤¹¤ëÆó¤Ä¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +ÊÖ¤¹¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +.I pipefd[0] +¤¬¥Ñ¥¤¥×¤ÎÆɤ߽Ф·Â¦¡¢ +.I pipefd[1] +¤¬¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤Ç¤¢¤ë¡£ +¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤Ï¡¢ +¥Ñ¥¤¥×¤ÎÆɤ߽Ф·Â¦¤«¤éÆɤ߽Фµ¤ì¤ë¤Þ¤Ç¥«¡¼¥Í¥ë¤Ç¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤ë¡£ +¤µ¤é¤Ê¤ë¾ÜºÙ¤Ï +.BR pipe (7) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"O If +.\"O .IR flags +.\"O is 0, then +.\"O .BR pipe2 () +.\"O is the same as +.\"O .BR pipe (). +.\"O The following values can be bitwise ORed in +.\"O .IR flags +.\"O to obtain different behavior: +.BR pipe2 () +¤Ï +.I flags +¤¬ 0 ¤Î¾ì¹ç¤Ë¤Ï +.BR pipe () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.I flags +¤Ë°Ê²¼¤ÎÃͤò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýÏ (OR) ¤Ç»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +°Û¤Ê¤ëÆ°ºî¤ò¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 12 +.B O_NONBLOCK +.\"O Set the +.\"O .BR O_NONBLOCK +.\"O file status flag on the two new open file descriptions. +.\"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) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.TP +.B O_CLOEXEC +.\"O Set the close-on-exec +.\"O .RB ( FD_CLOEXEC ) +.\"O flag on the two new file descriptors. +.\"O See the description of the same 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, 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 EFAULT +.\"O .I pipefd +.\"O is not valid. +.I pipefd +¤¬Ìµ¸ú¤ÊÃͤǤ¢¤ë¡£ +.TP +.B EINVAL +.\"O .RB ( pipe2 ()) +.\"O Invalid value in +.\"O .IR flags . +.RB ( pipe2 ()) +.I flags +¤Ë̵¸ú¤ÊÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.TP +.B EMFILE +.\"O Too many file descriptors are in use by the process. +¤³¤Î¥×¥í¥»¥¹¤Ç»È¤ï¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENFILE +.\"O The system limit on the total number of open files has been reached. +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥à¤ÎÀ©¸Â¤Ë㤷¤¿¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR pipe2 () +.\"O was added to Linux in version 2.6.27; +.\"O glibc support is available starting with +.\"O version 2.9. +.BR pipe2 () +¤Ï¥Ð¡¼¥¸¥ç¥ó 2.6.27 ¤Ç Linux ¤ËÄɲ䵤줿¡£ +glibc ¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.9 °Ê¹ß¤ÇÍøÍѤǤ­¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.BR pipe (): +POSIX.1-2001. + +.\"O .BR pipe2 () +.\"O is Linux-specific. +.BR pipe2 () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O .\" fork.2 refers to this example program. +.\" fork.2 ¤Ï¤³¤ÎÎã¤Î¥×¥í¥°¥é¥à¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.\"O The following program creates a pipe, and then +.\"O .BR fork (2)s +.\"O to create a child process; +.\"O the child inherits a duplicate set of file +.\"O descriptors that refer to the same pipe. +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¥Ñ¥¤¥×¤òÀ¸À®¤·¡¢¤½¤Î¸å +.BR fork (2) +¤Ç»Ò¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¡£ +»Ò¥×¥í¥»¥¹¤ÏƱ¤¸¥Ñ¥¤¥×¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Î¥³¥Ô¡¼¤ò +·Ñ¾µ¤¹¤ë¡£ +.\"O After the +.\"O .BR fork (2), +.\"O each process closes the descriptors that it doesn't need for the pipe +.\"O (see +.\"O .BR pipe (7)). +.BR fork (2) +¤Î¸å¡¢³Æ¥×¥í¥»¥¹¤Ï¥Ñ¥¤¥× +.RB ( pipe (7) +¤ò»²¾È) ¤ËɬÍפ¬¤Ê¤¯¤Ê¤Ã¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.\"O The parent then writes the string contained in the program's +.\"O command-line argument to the pipe, +.\"O and the child reads this string a byte at a time from the pipe +.\"O and echoes it on standard output. +¿Æ¥×¥í¥»¥¹¤Ï¥×¥í¥°¥é¥à¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ë´Þ¤Þ¤ì¤ë +ʸ»úÎó¤ò¥Ñ¥¤¥×¤Ø½ñ¤­¹þ¤ß¡¢ +»Ò¥×¥í¥»¥¹¤Ï¤³¤Îʸ»úÎó¤ò¥Ñ¥¤¥×¤«¤é 1 ¥Ð¥¤¥È¤º¤ÄÆɤ߹þ¤ó¤Çɸ½à½ÐÎϤ˥¨¥³¡¼¤¹¤ë¡£ +.nf + +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int pipefd[2]; + pid_t cpid; + char buf; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + if (pipe(pipefd) == \-1) { + perror("pipe"); + exit(EXIT_FAILURE); + } + + cpid = fork(); + if (cpid == \-1) { + perror("fork"); + exit(EXIT_FAILURE); + } + +.\"O if (cpid == 0) { /* Child reads from pipe */ + if (cpid == 0) { /* »Ò¥×¥í¥»¥¹¤¬¥Ñ¥¤¥×¤«¤éÆɤ߹þ¤à */ +.\"O close(pipefd[1]); /* Close unused write end */ + close(pipefd[1]); /* »ÈÍѤ·¤Ê¤¤ write ¦¤Ï¥¯¥í¡¼¥º¤¹¤ë */ + + while (read(pipefd[0], &buf, 1) > 0) + write(STDOUT_FILENO, &buf, 1); + + write(STDOUT_FILENO, "\\n", 1); + close(pipefd[0]); + _exit(EXIT_SUCCESS); + +.\"O } else { /* Parent writes argv[1] to pipe */ +.\"O close(pipefd[0]); /* Close unused read end */ +.\"O write(pipefd[1], argv[1], strlen(argv[1])); +.\"O close(pipefd[1]); /* Reader will see EOF */ +.\"O wait(NULL); /* Wait for child */ + } else { /* ¿Æ¥×¥í¥»¥¹¤Ï argv[1] ¤ò¥Ñ¥¤¥×¤Ø½ñ¤­¹þ¤à */ + close(pipefd[0]); /* »ÈÍѤ·¤Ê¤¤ read ¦¤Ï¥¯¥í¡¼¥º¤¹¤ë */ + write(pipefd[1], argv[1], strlen(argv[1])); + close(pipefd[1]); /* Æɤ߹þ¤ß¦¤¬ EOF ¤Ë½Ð²ñ¤¦ */ + wait(NULL); /* »Ò¥×¥í¥»¥¹¤òÂÔ¤Ä */ + exit(EXIT_SUCCESS); + } +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fork (2), +.BR read (2), +.BR socketpair (2), +.BR write (2), +.BR popen (3), +.BR pipe (7) diff --git a/draft/man2/pivot_root.2 b/draft/man2/pivot_root.2 new file mode 100644 index 00000000..0c2d91b2 --- /dev/null +++ b/draft/man2/pivot_root.2 @@ -0,0 +1,281 @@ +.\" Copyright (C) 2000 by Werner Almesberger +.\" May be distributed under GPL +.\" +.\" Written 2000-02-23 by Werner Almesberger +.\" Modified 2004-06-17 Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 2000 NAKANO Takeo all rights reserved. +.\" Translated Wed Jun 14 2000 by NAKANO Takeo +.\" +.TH PIVOT_ROOT 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O pivot_root \- change the root file system +.SH ̾Á° +pivot_root \- root ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÊѹ¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.BI "int pivot_root(const char *" new_root ", const char *" put_old ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR pivot_root () +.\"O moves the root file system of the calling process to the +.\"O directory \fIput_old\fP and makes \fInew_root\fP the new root file system +.\"O of the calling process. +.BR pivot_root () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î root ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +.I put_old +¥Ç¥£¥ì¥¯¥È¥ê¤Ë°ÜÆ°¤·¡¢ +.I new_root +¤ò¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¿·¤·¤¤ root ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤¹¤ë¡£ +.\"O .\" +.\"O .\" The +.\"O .\" .B CAP_SYS_ADMIN +.\"O .\" capability is required. +.\" +.\" .B CAP_SYS_ADMIN +.\" ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ + +.\"O The typical use of +.\"O .BR pivot_root () +.\"O is during system startup, when the +.\"O system mounts a temporary root file system (e.g., an \fBinitrd\fP), then +.\"O mounts the real root file system, and eventually turns the latter into +.\"O the current root of all relevant processes or threads. +.BR pivot_root () +¤Îŵ·¿Åª¤ÊÍøÍÑË¡¤Ï¡¢¥·¥¹¥Æ¥à¤Îµ¯Æ°Ãæ¤Ë¥·¥¹¥Æ¥à¤¬°ì»þŪ¤Ê +root ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à (Î㤨¤Ð +.BR initrd ) +¤ò¥Þ¥¦¥ó¥È¤·¡¢¤³¤ì¤Ë³¤¤¤ÆËÜÅö¤Î root ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥Þ¥¦¥ó¥È¤·¡¢ +¸å¼Ô¤òɬÍפÊÁ´¤Æ¤Î¥×¥í¥»¥¹¡¦¥¹¥ì¥Ã¥É¤Î +¥«¥ì¥ó¥È root ¤ËÊѹ¹¤¹¤ë¤è¤¦¤Ê¾ì¹ç¤Ç¤¢¤ë¡£ + +.\"O .BR pivot_root () +.\"O may or may not change the current root and the current +.\"O working directory of any processes or threads which use the old +.\"O root directory. +.\"O The caller of +.\"O .BR pivot_root () +.\"O must ensure that processes with root or current working directory +.\"O at the old root operate correctly in either case. +.\"O An easy way to ensure this is to change their +.\"O root and current working directory to \fInew_root\fP before invoking +.\"O .BR pivot_root (). +¸Å¤¤ root ¥Ç¥£¥ì¥¯¥È¥ê¤ò»È¤Ã¤Æ¤¤¤¿Á´¤Æ¤Î¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤Î +¥«¥ì¥ó¥È root ¤È¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ò¡¢ +.BR pivot_root () +¤¬Êѹ¹¤¹¤ë¤«¤É¤¦¤«¤Ï¤ï¤«¤é¤Ê¤¤¡£ +.BR pivot_root () +¤Î¸Æ¤Ó¤À¤·¥×¥í¥»¥¹¤Ï¡¢¸Å¤¤ root ¤ä¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ò»È¤Ã¤Æ¤¤¤¿ +¥×¥í¥»¥¹¤¬¡¢¤¤¤º¤ì¤Î¾ì¹ç¤Ç¤âÀµ¤·¤¯Æ°ºî¤¹¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤ò´Êñ¤Ë¹Ô¤¦¤Ë¤Ï¡¢¤½¤ì¤é¤Î¥×¥í¥»¥¹¤Î root ¤È +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ò +.BR pivot_root () +¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë +.I new_root +¤ËÊѹ¹¤·¤Æ¤ª¤¯¤³¤È¤Ç¤¢¤ë¡£ + +.\"O The paragraph above is intentionally vague because the implementation +.\"O of +.\"O .BR pivot_root () +.\"O may change in the future. +.\"O At the time of writing, +.\"O .BR pivot_root () +.\"O changes root and current working directory of each process or +.\"O thread to \fInew_root\fP if they point to the old root directory. +.\"O This +.\"O is necessary in order to prevent kernel threads from keeping the old +.\"O root directory busy with their root and current working directory, +.\"O even if they never access +.\"O the file system in any way. +.\"O In the future, there may be a mechanism for +.\"O kernel threads to explicitly relinquish any access to the file system, +.\"O such that this fairly intrusive mechanism can be removed from +.\"O .BR pivot_root (). +¾åµ­¤ÎÃÊÍî¤Ï¡¢¾­Íè +.BR pivot_root () +¤¬Êѹ¹¤µ¤ì¤ë¤«¤âÃΤì¤Ê¤¤¤³¤È¤ò´Õ¤ß¤Æ¡¢¤ï¤¶¤ÈÛ£Ëæ¤Ë½ñ¤¤¤Æ¤¢¤ë¡£ +ËÜ¥Ú¡¼¥¸¤òµ­½Ò¤·¤Æ¤¤¤ë»þÅÀ¤Ç¤Ï¡¢ +.BR pivot_root () +¤Ï¸Å¤¤ root ¥Ç¥£¥ì¥¯¥È¥ê¤òÍѤ¤¤Æ¤¤¤ëÁ´¤Æ¤Î¥×¥í¥»¥¹¡¦¥¹¥ì¥Ã¥É¤Î root ¤È +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ò +.I new_root +¤ËÊѹ¹¤¹¤ë¡£¤³¤ì¤Ï¥«¡¼¥Í¥ë¤Î¥¹¥ì¥Ã¥É¤¬¸Å¤¤ root ¥Ç¥£¥ì¥¯¥È¥ê¤ò +busy ¾õÂ֤ˤ·¤Ê¤¤¤¿¤á¤ËɬÍפǤ¢¤ë¡£¤³¤ì¤é¤Î¥¹¥ì¥Ã¥É¤¬ +¸Å¤¤¥Ç¥£¥ì¥¯¥È¥ê¤ò root ¤ä¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤Æ¤¤¤ë¤È¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°ìÀÚ¥¢¥¯¥»¥¹¤·¤Ê¤¤¾ì¹ç¤Ç¤â +¸Å¤¤ root ¤¬ busy ¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¤«¤é¤Ç¤¢¤ë¡£ +.\"nakano: ¤Á¤È¾éĹ... +¾­Íè¤Ï¡¢¥«¡¼¥Í¥ë¥¹¥ì¥Ã¥É¤¬¤¢¤é¤æ¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î¥¢¥¯¥»¥¹¤ò +ÌÀ¼¨Åª¤ËÊü´þ¤¹¤ë¥á¥«¥Ë¥º¥à¤¬¤Ç¤­¡¢¤³¤Î¤Ç¤·¤ã¤Ð¤ê¤Êµ¡Ç½¤Ï +.BR pivot_root () +¤«¤éºï½ü¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + +.\"O Note that this also applies to the calling process: +.\"O .BR pivot_root () +.\"O may +.\"O or may not affect its current working directory. +.\"O It is therefore recommended to call +.\"O \fBchdir("/")\fP immediately after +.\"O .BR pivot_root (). +¤³¤ì¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë¤Ä¤¤¤Æ¤âÅö¤Æ¤Ï¤Þ¤ë¤³¤È¤ËÃí°Õ¡£ +.BR pivot_root () +¤¬¥«¥ì¥ó¥È¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤Ë±Æ¶Á¤¹¤ë¤«¤É¤¦¤«¤Ï +ʬ¤«¤é¤Ê¤¤¡£¤·¤¿¤¬¤Ã¤Æ +.BR pivot_root () +¤Îľ¸å¤Ë +.B chdir("/") +¤ò¸Æ¤Ó½Ð¤¹¤È¤è¤¤¡£ + +.\"O The following restrictions apply to \fInew_root\fP and \fIput_old\fP: +.IR new_root " ¤ª¤è¤Ó " put_old +¤Ë¤Ï°Ê²¼¤ÎÀ©¸Â¤¬¤¢¤ë: +.IP \- 3 +.\"O They must be directories. +¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP \- 3 +.\"O \fInew_root\fP and \fIput_old\fP must not be on the same file system as +.\"O the current root. +.IR new_root " ¤È " put_old +¤Ï¸½ºß¤Î root ¤ÈƱ¤¸¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.IP \- 3 +.\"O \fIput_old\fP must be underneath \fInew_root\fP, that is, adding a nonzero +.\"O number of \fI/..\fP to the string pointed to by \fIput_old\fP must yield +.\"O the same directory as \fInew_root\fP. +.IR put_old " ¤Ï " new_root +°Ê²¼¤Ë¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤¹¤Ê¤ï¤Á +.I put_old +¤òº¹¤¹Ê¸»úÎó¤Ë 1 ¸Ä°Ê¾å¤Î +.I ../ +¤òÉÕ¤±¤ë¤³¤È¤Ë¤è¤Ã¤Æ +.I new_root +¤ÈƱ¤¸¥Ç¥£¥ì¥¯¥È¥ê¤¬ÆÀ¤é¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP \- 3 +.\"O No other file system may be mounted on \fIput_old\fP. +¾¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ +.I put_old +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O See also +.\"O .BR pivot_root (8) +.\"O for additional usage examples. +ÍøÍÑÎã¤Ë¤Ä¤¤¤Æ¤Ï +.BR pivot_root (8) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"O If the current root is not a mount point (e.g., after +.\"O .BR chroot (2) +.\"O or +.\"O .BR pivot_root (), +.\"O see also below), not the old root directory, but the +.\"O mount point of that file system is mounted on \fIput_old\fP. +¸½ºß¤Î root ¤¬¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤Ï¤Ê¤¤ +.RB ( chroot (2) +¤ä +.BR pivot_root () +¤Î¸å¤Ê¤É¡£°Ê²¼¤â»²¾È) ¾ì¹ç¡¢ +¸Å¤¤ root ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¯¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤¬ +.I put_old +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ + +.\"O \fInew_root\fP does not have to be a mount point. +.\"O In this case, +.\"O \fI/proc/mounts\fP will show the mount point of the file system containing +.\"O \fInew_root\fP as root (\fI/\fP). +.I new_root +¤Ï¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤Ê¤¯¤Æ¤â¤è¤¤¡£ +¤³¤Î¾ì¹ç +.I /proc/mounts +¤Ï¡¢ +.I new_root +¤ò root +.RI ( / ) +¤È¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤òɽ¼¨¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, zero is returned. +.\"O On error, \-1 is returned, and +.\"O \fIerrno\fP is set appropriately. +À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤¬µ¯¤ë¤È \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ÊÃͤËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O .BR pivot_root () +.\"O may return (in \fIerrno\fP) any of the errors returned by +.\"O .BR stat (2). +.\"O Additionally, it may return: +.BR pivot_root () +¤Ï +.BR stat (2) +¤ÎÊÖ¤¹¤¢¤é¤æ¤ë¥¨¥é¡¼¤ò +.RI ( errno +¤Ë) ÊÖ¤¹²ÄǽÀ­¤¬¤¢¤ë¡£¤µ¤é¤Ë°Ê²¼¤òÊÖ¤¹¤³¤È¤¬¤¢¤ë: +.TP +.B EBUSY +.\"O \fInew_root\fP or \fIput_old\fP are on the current root file system, +.\"O or a file system is already mounted on \fIput_old\fP. +.IR new_root " ¤Þ¤¿¤Ï " put_old +¤¬¡¢¸½ºß¤Î root ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ë¤¢¤ë¤«¡¢´û¤Ë +.I put_old +¤Ë¤Ê¤ó¤é¤«¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O \fIput_old\fP is not underneath \fInew_root\fP. +.IR put_old " ¤¬ " new_root +¤Î²¼Áؤˤʤ¤¡£ +.TP +.B ENOTDIR +.\"O \fInew_root\fP or \fIput_old\fP is not a directory. +.IR new_root " ¤Þ¤¿¤Ï " put_old +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EPERM +.\"O The calling process does not have the +.\"O .B CAP_SYS_ADMIN +.\"O capability. +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬ +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR pivot_root () +.\"O was introduced in Linux 2.3.41. +.BR pivot_root () +¤Ï Linux 2.3.41 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR pivot_root () +.\"O is Linux-specific and hence is not portable. +.BR pivot_root () +¤Ï 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 .SH BUGS +.SH ¥Ð¥° +.\"O .BR pivot_root () +.\"O should not have to change root and current working directory of all other +.\"O processes in the system. +.BR pivot_root () +¤Ï¥·¥¹¥Æ¥à¤Î¾¤Î¥×¥í¥»¥¹Á´¤Æ¤Î root ¤È +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤È¤òÊѹ¹¤·¤Ê¤¯¤Æ¤â¤è¤¤¤Ï¤º¤Ç¤¢¤ë¡£ + +.\"O Some of the more obscure uses of +.\"O .BR pivot_root () +.\"O may quickly lead to +.\"O insanity. +.BR pivot_root () +¤Î»È¤¤Êý¤¬¤â¤¦¤Á¤ç¤Ã¤ÈÛ£Ëæ¤Ë¤Ê¤ë¤È¡¢ +¤¢¤Ã¤È¤¤¤¦´Ö¤Ë¤ï¤±¤Î¤ï¤«¤é¤Ê¤¤¾õÂ֤ˤʤäƤ·¤Þ¤¦¤À¤í¤¦ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR chdir (2), +.BR chroot (2), +.BR stat (2), +.BR initrd (4), +.BR pivot_root (8) diff --git a/draft/man2/poll.2 b/draft/man2/poll.2 new file mode 100644 index 00000000..fffd3db3 --- /dev/null +++ b/draft/man2/poll.2 @@ -0,0 +1,538 @@ +.\" 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 2009-09-15 "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 +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int ppoll(struct pollfd *" fds ", nfds_t " nfds ", " +.BI " const struct timespec *" timeout ", 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 pseudo-terminal 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 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 +.\"O .I timeout +.\"O argument, the following +.\"O .BR ppoll () +.\"O call: +.I timeout +°ú¤­¿ô¤Î°ã¤¤¤ò½ü¤¯¤È¡¢°Ê²¼¤Î +.BR ppoll () +¤Î¸Æ¤Ó½Ð¤·¤Ï¡¢ +.nf + + ready = ppoll(&fds, nfds, 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 = 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 +.\"O is specified as NULL, then +.\"O .BR ppoll () +.\"O can block indefinitely. +.I timeout +¤Ë 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 select(2) 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 This constant is not provided in glibc. +¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤Ç¤Ï¡¢ÃÍ \-1 ¤ò»ý¤Ã¤¿Èóɸ½à¤ÎÄê¿ô +.B INFTIM +¤¬ÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +.I timeout +¤Î»ØÄê¤Ë»ÈÍѤǤ­¤ë¡£ +¤³¤ÎÄê¿ô¤Ï glibc ¤Ç¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SS "LINUX NOTES" +.SS "Linux ¤Ç¤ÎÃí°Õ" +.\"O The Linux +.\"O .BR ppoll () +.\"O system call modifies its +.\"O .I timeout +.\"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 +.\"O argument. +Linux ¤Î +.BR ppoll () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I timeout +°ú¤­¿ô¤òÊѹ¹¤¹¤ë¡£ +¤·¤«¤·¡¢glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ timeout °ú¤­¿ô +¤È¤·¤Æ¥í¡¼¥«¥ëÊÑ¿ô¤ò»È¤¦¤³¤È¤Ç¤³¤ÎÆ°ºî¤ò±£Ê䷤Ƥ¤¤ë¡£ +¤³¤Î¤¿¤á¡¢glibc ¤Î +.BR ppoll () +´Ø¿ô¤Ï +.I timeout +°ú¤­¿ô¤òÊѹ¹¤·¤Ê¤¤¡£ +.\"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 feature_test_macros (7), +.BR time (7) diff --git a/draft/man2/posix_fadvise.2 b/draft/man2/posix_fadvise.2 new file mode 100644 index 00000000..cf55636c --- /dev/null +++ b/draft/man2/posix_fadvise.2 @@ -0,0 +1,242 @@ +.\" 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. +.BR feature_test_macros (7) diff --git a/draft/man2/prctl.2 b/draft/man2/prctl.2 new file mode 100644 index 00000000..5da1b05a --- /dev/null +++ b/draft/man2/prctl.2 @@ -0,0 +1,758 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1998 Andries Brouwer (aeb@cwi.nl) +.\" and Copyright (C) 2002 Michael Kerrisk +.\" and Copyright Guillem Jover +.\" +.\" 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 Thu Nov 11 04:19:42 MET 1999, aeb: added PR_GET_PDEATHSIG +.\" Modified 27 Jun 02, Michael Kerrisk +.\" Added PR_SET_DUMPABLE, PR_GET_DUMPABLE, +.\" PR_SET_KEEPCAPS, PR_GET_KEEPCAPS +.\" Modified 2006-08-30 Guillem Jover +.\" Updated Linux versions where the options where introduced. +.\" Added PR_SET_TIMING, PR_GET_TIMING, PR_SET_NAME, PR_GET_NAME, +.\" PR_SET_UNALIGN, PR_GET_UNALIGN, PR_SET_FPEMU, PR_GET_FPEMU, +.\" PR_SET_FPEXC, PR_GET_FPEXC +.\" 2008-04-29 Serge Hallyn, Document PR_CAPBSET_READ and PR_CAPBSET_DROP +.\" 2008-06-13 Erik Bosman, +.\" Document PR_GET_TSC and PR_SET_TSC. +.\" 2008-06-15 mtk, Document PR_SET_SECCOMP, PR_GET_SECCOMP +.\" +.\" Japanese Version Copyright (c) 1998-1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1999-04-03, HANATAKA Shinya +.\" Updated 2002-12-20, Kentaro Shirakata +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2005-10-07, Akihiro MOTOKI +.\" Updated 2007-01-08, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2007-10-12, Akihiro MOTOKI, LDP v2.66 +.\" Updated 2008-08-12, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: capability ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\"WORD: keep capabilities ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ÊÝ»ý +.\" +.TH PRCTL 2 2008-07-16 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O prctl \- operations on a process +prctl \- ¥×¥í¥»¥¹¤ÎÁàºî¤ò¹Ô¤Ê¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int prctl(int " option ", unsigned long " arg2 ", unsigned long " arg3 , +.BI " unsigned long " arg4 ", unsigned long " arg5 ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR prctl () +.\"O is called with a first argument describing what to do +.\"O (with values defined in \fI\fP), and further +.\"O arguments with a significance depending on the first one. +.\"O The first argument can be: +.BR prctl () +¤ÎÆ°ºî¤ÏºÇ½é¤Î°ú¤­¿ô¤Ë¤è¤Ã¤Æ·èÄꤵ¤ì¤ë (¤³¤ÎÃÍ¤Ï +\fI\fP ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +»Ä¤ê¤Î°ú¤­¿ô¤ÏºÇ½é¤Î°ú¤­¿ô¤Ë¤è¤Ã¤ÆÊѲ½¤¹¤ë¡£ +°ìÈÖÌܤΰú¤­¿ô¤È¤·¤Æ°Ê²¼¤Î¤â¤Î¤ò»ØÄê¤Ç¤­¤ë: +.TP +.\"O .BR PR_CAPBSET_READ " (since Linux 2.6.25) +.BR PR_CAPBSET_READ " (Linux 2.6.25 °Ê¹ß)" +.\"O Return (as the function result) 1 if the capability specified in +.\"O .I arg2 +.\"O is in the calling thread's capability bounding set, +.\"O or 0 if it is not. +.\"O (The capability constants are defined in +.\"O .IR .) +.\"O The capability bounding set dictates +.\"O whether the process can receive the capability through a +.\"O file's permitted capability set on a subsequent call to +.\"O .BR execve (2). +¤Ç»ØÄꤵ¤ì¤¿¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +¥Ð¥¤¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È (capability bounding set) ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +(´Ø¿ô¤ÎÊÖ¤êÃͤȤ·¤Æ) 1 ¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç 0 ¤òÊÖ¤¹ +(¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£Äê¿ô¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï¡¢ +.BR execve (2) +¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¡¢¥Õ¥¡¥¤¥ë¤Îµö²Ä (permitted) ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÎÃæ¤Ç +¤½¤Î¥×¥í¥»¥¹¤¬³ÍÆÀ¤Ç¤­¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»Ø¼¨¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ + +.\"O If the capability specified in +.\"O .I arg2 +.\"O is not valid, then the call fails with the error +.\"O .BR EINVAL . +.I arg2 +¤Ë»ØÄꤵ¤ì¤¿¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Í­¸ú¤Ç¤Ê¤¤¾ì¹ç¡¢ +¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.\"O .BR PR_CAPBSET_DROP " (since Linux 2.6.25)" +.BR PR_CAPBSET_DROP " (Linux 2.6.25 °Ê¹ß)" +.\"O If the calling thread has the +.\"O .B CAP_SETPCAP +.\"O capability, then drop the capability specified by +.\"O .I arg2 +.\"O from the calling thread's capability bounding set. +.\"O Any children of the calling thread will inherit the newly +.\"O reduced bounding set. +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.B CAP_SETPCAP +¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é +.I arg2 +¤Ç»ØÄꤵ¤ì¤¿¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò³°¤¹¡£ +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î»Ò¥×¥í¥»¥¹¤ÏÊѹ¹¸å¤Î¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤ò +·Ñ¾µ¤¹¤ë¡£ + +.\"O The call fails with the error: +.\"O .B EPERM +.\"O if the calling thread does not have the +.\"O.BR CAP_SETPCAP ; +.\"O .BR EINVAL +.\"O if +.\"O .I arg2 +.\"O does not represent a valid capability; or +.\"O .BR EINVAL +.\"O if file capabilities are not enabled in the kernel, +.\"O in which case bounding sets are not supported. +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬ +.B CAP_SETPCAP +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼ +.B EPERM +¤Ç¼ºÇÔ¤¹¤ë¡£ +.I arg2 +¤Ë»ØÄꤵ¤ì¤¿¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Í­¸ú¤Ç¤Ê¤¤¾ì¹ç¡¢ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥«¡¼¥Í¥ë¤ÇÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç +(¤³¤Î¾ì¹ç¤Ë¤Ï¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤)¡¢ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.\"O .BR PR_SET_DUMPABLE " (since Linux 2.3.20)" +.BR PR_SET_DUMPABLE " (Linux 2.3.20 °Ê¹ß)" +.\"O Set the state of the flag determining whether core dumps are produced +.\"O for this process upon delivery of a signal whose default behavior is +.\"O to produce a core dump. +.\"O (Normally this flag is set for a process by default, but it is cleared +.\"O when a set-user-ID or set-group-ID program is executed and also by +.\"O various system calls that manipulate process UIDs and GIDs). +.\"O In kernels up to and including 2.6.12, +.\"O .I arg2 +.\"O must be either 0 (process is not dumpable) or 1 (process is dumpable). +(Linux 2.3.20 °Ê¹ß) +¥Ç¥Õ¥©¥ë¥È¤Î¿¶¤ëÉñ¤¤¤Ç¤Ï¥³¥¢¥À¥ó¥×¤ò°ú¤­µ¯¤³¤¹¤è¤¦¤Ê¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤¿¤È¤­¤Ë¡¢ +¥³¥¢¥À¥ó¥×¤¹¤ë¤«¤É¤¦¤«¤ò·èÄꤹ¤ë¥Õ¥é¥°¤òÀßÄꤹ¤ë +(Ä̾盧¤Î¥Õ¥é¥°¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +set-user-ID ¤¢¤ë¤¤¤Ï set-group-ID ¥×¥í¥°¥é¥à¤¬¼Â¹Ô¤µ¤ì¤¿¤ê¡¢ +¤µ¤Þ¤¶¤Þ¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤è¤Ã¤Æ¥×¥í¥»¥¹¤Î UID ¤ä GID ¤¬Áàºî¤µ¤ì¤¿¤È¤­¤Ë +¥¯¥ê¥¢¤µ¤ì¤ë)¡£ +2.6.12 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.I arg2 +¤Ï 0 (¥×¥í¥»¥¹¤Ï¥À¥ó¥×ÉÔ²Ä) ¤¢¤ë¤¤¤Ï 1 (¥×¥í¥»¥¹¤Ï¥À¥ó¥×²Äǽ) ¤Î +¤É¤Á¤é¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O Between kernels 2.6.13 and 2.6.17, the value 2 was also permitted, +.\"O which caused any binary which normally would not be dumped +.\"O to be dumped readable by root only; +.\"O for security reasons, this feature has been removed. +2.6.13 ¤«¤é 2.6.17 ¤Þ¤Ç¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ÃÍ 2 ¤âǧ¤á¤é¤ì¤Æ¤¤¤¿¡£ +¤³¤ÎÃͤò»ØÄꤹ¤ë¤È¡¢Ä̾ï¤Ï¥À¥ó¥×¤µ¤ì¤Ê¤¤¥Ð¥¤¥Ê¥ê¤¬ root ¤À¤±¤¬ +Æɤ߹þ¤ß²Äǽ¤Ê·Á¤Ç¥À¥ó¥×¤µ¤ì¤¿¡£ +¥»¥­¥å¥ê¥Æ¥£¾å¤ÎÍýͳ¤«¤é¡¢¤³¤Îµ¡Ç½¤Ïºï½ü¤µ¤ì¤¿ +.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=115270289030630&w=2 +.\" Subject: Fix prctl privilege escalation (CVE-2006-2451) +.\" From: Marcel Holtmann +.\" Date: 2006-07-12 11:12:00 +.\"O (See also the description of +.\"O .I /proc/sys/fs/suid_dumpable +.\"O in +.\"O .BR proc (5).) +.RB ( proc (5) +¤Î +.I /proc/sys/fs/suid_dumpable +¤ÎÀâÌÀ¤â»²¾È)¡£ +.TP +.\"O .BR PR_GET_DUMPABLE " (since Linux 2.3.20)" +.BR PR_GET_DUMPABLE " (Linux 2.3.20 °Ê¹ß)" +.\"O Return (as the function result) the current state of the calling +.\"O process's dumpable flag. +(Linux 2.3.20 °Ê¹ß) +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤ª¤±¤ë¥À¥ó¥×²Äǽ¥Õ¥é¥°¤Î +¸½ºß¤Î¾õÂÖ¤ò (´Ø¿ô¤ÎÊÖ¤êÃͤȤ·¤Æ) ÊÖ¤¹¡£ +.\"O .\" Since Linux 2.6.13, the dumpable flag can have the value 2, +.\"O .\" but in 2.6.13 PR_GET_DUMPABLE simply returns 1 if the dumpable +.\"O .\" flags has a nonzero value. This was fixed in 2.6.14. +.\" [Í×½¤Àµ] Linux 2.6.13 °Ê¹ß¤Ç¤Ï¡¢¥À¥ó¥×²Äǽ¥Õ¥é¥°¤ÏÃÍ 2 ¤ò¤È¤ë¤³¤È¤¬ +.\" ¤Ç¤­¤ë¤¬¡¢2.6.13 ¤Ç¤Ï PR_GET_DUMPABLE ¤Ï¥À¥ó¥×²Äǽ¥Õ¥é¥°¤¬ 0 °Ê³°¤Î +.\" Ãͤξì¹ç 1 ¤òÊÖ¤¹¤À¤±¤Ç¤¢¤ë¡£¤³¤ì¤Ï 2.6.14 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ +.TP +.\"O .BR PR_SET_ENDIAN " (since Linux 2.6.18, PowerPC only)" +.BR PR_SET_ENDIAN " (Linux 2.6.18 °Ê¹ß¡¢PowerPC ¤Î¤ß)" +.\"O Set the endian-ness of the calling process to the value given +.\"O in \fIarg2\fP, which should be one of the following: +.\"O .\" Respectively 0, 1, 2 +.\"O .BR PR_ENDIAN_BIG , +.\"O .BR PR_ENDIAN_LITTLE , +.\"O or +.\"O .B PR_ENDIAN_PPC_LITTLE +.\"O (PowerPC pseudo little endian). +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥¨¥ó¥Ç¥£¥¢¥óÀßÄê (endian-ness) ¤ò +\fIarg2\fP ¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ëÃÍ¤Ï +.\" ¤½¤ì¤¾¤ì 0, 1, 2 +.BR PR_ENDIAN_BIG , +.BR PR_ENDIAN_LITTLE , +.B PR_ENDIAN_PPC_LITTLE +(PowerPC µ¼»÷¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó) +¤Î¤¤¤º¤ì¤«°ì¤Ä¤Ç¤¢¤ë¡£ +.TP +.\"O .BR PR_GET_ENDIAN " (since Linux 2.6.18, PowerPC only)" +.BR PR_GET_ENDIAN " (Linux 2.6.18 °Ê¹ß¡¢PowerPC ¤Î¤ß)" +.\"O Return the endian-ness of the calling process, +.\"O in the location pointed to by +.\"O .IR "(int\ *) arg2" . +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥¨¥ó¥Ç¥£¥¢¥óÀßÄê (endian-ness) ¤ò +.I "(int\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.TP +.\"O .BR PR_SET_FPEMU " (since Linux 2.4.18, 2.5.9, only on ia64)" +.BR PR_SET_FPEMU " (Linux 2.4.18 °Ê¹ß, 2.5.9, ia64 ¤Î¤ß)" +.\"O Set floating-point emulation control bits to \fIarg2\fP. +.\"O Pass \fBPR_FPEMU_NOPRINT\fP to silently emulate fp operations accesses, or +.\"O \fBPR_FPEMU_SIGFPE\fP to not emulate fp operations and send +.\"O .B SIGFPE +.\"O instead. +ÉâÆ°¾®¿ôÅÀ¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó (floating-point emulation) À©¸æ¥Ó¥Ã¥È¤ò +\fIarg2\fP ¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ëÃÍ¤Ï \fBPR_FPEMU_NOPRINT\fP (ÉâÆ°¾®¿ôÅÀÌ¿Îᥢ¥¯¥»¥¹¤òÌÛ¤Ã¤Æ +¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë) ¤« \fBPR_FPEMU_SIGFPE\fP (ÉâÆ°¾®¿ôÅÀÌ¿Îá¤ò¥¨¥ß¥å¥ì¡¼¥È¤»¤º¡¢ +Âå¤ï¤ê¤Ë +.B SIGFPE +¤òÁ÷¤ë) ¤Ç¤¢¤ë¡£ +.TP +.\"O .BR PR_GET_FPEMU " (since Linux 2.4.18, 2.5.9, only on ia64)" +.BR PR_GET_FPEMU " (Linux 2.4.18 °Ê¹ß, 2.5.9, ia64 ¤Î¤ß)" +.\"O Return floating-point emulation control bits, +.\"O in the location pointed to by +.\"O .IR "(int\ *) arg2" . +ÉâÆ°¾®¿ôÅÀ¥¨¥ß¥å¥ì¡¼¥·¥ç¥óÀ©¸æ¥Ó¥Ã¥È¤ÎÃͤò +.I "(int\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.TP +.\"O .BR PR_SET_FPEXC " (since Linux 2.4.21, 2.5.32, only on PowerPC)" +.BR PR_SET_FPEXC " (Linux 2.4.21 ¤ª¤è¤Ó 2.5.32 °Ê¹ß¡¢PowerPC ¤Î¤ß)" +.\"O Set floating-point exception mode to \fIarg2\fP. +.\"O Pass \fBPR_FP_EXC_SW_ENABLE\fP to use FPEXC for FP exception enables, +.\"O \fBPR_FP_EXC_DIV\fP for floating-point divide by zero, +.\"O \fBPR_FP_EXC_OVF\fP for floating-point overflow, +.\"O \fBPR_FP_EXC_UND\fP for floating-point underflow, +.\"O \fBPR_FP_EXC_RES\fP for floating-point inexact result, +.\"O \fBPR_FP_EXC_INV\fP for floating-point invalid operation, +.\"O \fBPR_FP_EXC_DISABLED\fP for FP exceptions disabled, +.\"O \fBPR_FP_EXC_NONRECOV\fP for async nonrecoverable exception mode, +.\"O \fBPR_FP_EXC_ASYNC\fP for async recoverable exception mode, +.\"O \fBPR_FP_EXC_PRECISE\fP for precise exception mode. +ÉâÆ°¾®¿ôÅÀÎã³°¥â¡¼¥É (floating-point exception mode) ¤ò +\fIarg2\fP ¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ë¤Î¤Ï°Ê²¼¤ÎÃͤǤ¢¤ë: +\fBPR_FP_EXC_SW_ENABLE\fP (FPEXC ¤ÇÉâÆ°¾®¿ôÅÀÎã³°¤òÍ­¸ú¤Ë¤¹¤ë)¡¢ +\fBPR_FP_EXC_DIV\fP (0 ½ü»»)¡¢ +\fBPR_FP_EXC_OVF\fP (¥ª¡¼¥Ð¡¼¥Õ¥í¡¼)¡¢ +\fBPR_FP_EXC_UND\fP (¥¢¥ó¥À¡¼¥Õ¥í¡¼)¡¢ +\fBPR_FP_EXC_RES\fP (ÉÔÀµ³Î¤Ê·ë²Ì (inexact result))¡¢ +\fBPR_FP_EXC_INV\fP (ÉÔÀµ¤ÊÌ¿Îá (invalid operation))¡¢ +\fBPR_FP_EXC_DISABLED\fP (ÉâÆ°¾®¿ôÅÀÎã³°¤ò̵¸ú¤Ë¤¹¤ë)¡¢ +\fBPR_FP_EXC_NONRECOV\fP (async nonrecoverable exception mode)¡¢ +\fBPR_FP_EXC_ASYNC\fP (async recoverable exception mode)¡¢ +\fBPR_FP_EXC_PRECISE\fP (precise exception mode)¡£ +.TP +.\"O .BR PR_GET_FPEXC " (since Linux 2.4.21, 2.5.32, only on PowerPC)" +.BR PR_GET_FPEXC "(Linux 2.4.21 ¤ª¤è¤Ó 2.5.32 °Ê¹ß¡¢PowerPC ¤Î¤ß)" +.\"O Return floating-point exception mode, +.\"O in the location pointed to by +.\"O .IR "(int\ *) arg2" . +ÉâÆ°¾®¿ôÅÀÎã³°¥â¡¼¥É¤ÎÃͤò +.I "(int\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.TP +.\"O .BR PR_SET_KEEPCAPS " (since Linux 2.2.18)" +.BR PR_SET_KEEPCAPS " (Linux 2.2.18 °Ê¹ß)" +.\"O Set the state of the thread's "keep capabilities" flag, +.\"O which determines whether the threads's effective and permitted +.\"O capability sets are cleared when a change is made to the threads's user IDs +.\"O such that the threads's real UID, effective UID, and saved set-user-ID +.\"O all become nonzero when at least one of them previously had the value 0. +.\"O (By default, these credential sets are cleared). +.\"O .I arg2 +.\"O must be either 0 (capabilities are cleared) or 1 (capabilities are kept). +.\"O This value will be reset to 0 on subsequent calls to +.\"O .BR execve (2). +¥¹¥ì¥Ã¥É¤Î¡Ö¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ÊÝ»ý¡×¥Õ¥é¥°¤òÀßÄꤹ¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢¥¹¥ì¥Ã¥É¤Î¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤Î¤¦¤Á¾¯¤Ê¤¯¤È¤â +°ì¤Ä¤¬ 0 ¤Ç¤¢¤Ã¤¿¾õÂÖ¤«¤é¡¢¤³¤ì¤éÁ´¤Æ¤¬ 0 °Ê³°¤ËÊѹ¹¤µ¤ì¤¿¤È¤­¡¢ +¥¹¥ì¥Ã¥É¤Î¼Â¸ú/µö²Ä¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£½¸¹ç¤¬¥¯¥ê¥¢¤µ¤ì¤ë¤«¤É¤¦¤«¤ò·èÄꤹ¤ë +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£½¸¹ç¤Ï¥¯¥ê¥¢¤µ¤ì¤ë)¡£ +.I arg2 +¤Ï 0 (¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥¯¥ê¥¢¤¹¤ë) ¤¢¤ë¤¤¤Ï 1 (¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÊÝ»ý¤¹¤ë) ¤Î +¤É¤Á¤é¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BR execve (2) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤È¡¢¤³¤ÎÃÍ¤Ï 0 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +.TP +.\"O .BR PR_GET_KEEPCAPS " (since Linux 2.2.18)" +.BR PR_GET_KEEPCAPS " (Linux 2.2.18 °Ê¹ß)" +.\"O Return (as the function result) the current state of the calling threads's +.\"O "keep capabilities" flag. +¸Æ¤Ó½Ð¤·¸µ¥¹¥ì¥Ã¥É¤Ë¤ª¤±¤ë¡Ö¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ÊÝ»ý¡×¥Õ¥é¥°¤Î +¸½ºß¤Î¾õÂÖ¤ò (´Ø¿ô¤ÎÊÖ¤êÃͤȤ·¤Æ) ÊÖ¤¹¡£ +.TP +.\"O .BR PR_SET_NAME " (since Linux 2.6.9)" +.BR PR_SET_NAME " (Linux 2.6.9 °Ê¹ß)" +.\"O Set the process name for the calling process, +.\"O using the value in the location pointed to by +.\"O .IR "(char\ *) arg2" . +.\"O The name can be up to 16 bytes long, +.\"O .\" TASK_COMM_LEN in include/linux/sched.h +.\"O and should be null-terminated if it contains fewer bytes. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹Ì¾¤ò +.I "(char\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤µ¤ì¤¿Ãͤò»È¤Ã¤ÆÀßÄꤹ¤ë¡£ +̾Á°¤ÏºÇÂç¤Ç 16 ¥Ð¥¤¥È¤Ç¤¢¤ê¡¢ +.\" TASK_COMM_LEN in include/linux/sched.h +¤½¤ì¤è¤ê¾¯¤Ê¤¤¥Ð¥¤¥È¿ô¤Î¾ì¹ç¤Ï NULL ¤Ç½ªÃ¼¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.\"O .BR PR_GET_NAME " (since Linux 2.6.11)" +.BR PR_GET_NAME " (Linux 2.6.11 °Ê¹ß)" +.\"O Return the process name for the calling process, +.\"O in the buffer pointed to by +.\"O .IR "(char\ *) arg2" . +.\"O The buffer should allow space for up to 16 bytes; +.\"O the returned string will be null-terminated if it is shorter than that. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹Ì¾¤ò +.I "(char\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +¥Ð¥Ã¥Õ¥¡¤ÏºÇÂç¤Ç 16 ¥Ð¥¤¥È¤ò³ÊǼ¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +ÊÖ¤µ¤ì¤ëʸ»úÎó¤Ï¡¢Ä¹¤µ¤¬ 16 ¥Ð¥¤¥È¤è¤êû¤¤¾ì¹ç¤Ï NULL ½ªÃ¼¤µ¤ì¤ë¡£ +.TP +.\"O .BR PR_SET_PDEATHSIG " (since Linux 2.1.57)" +.BR PR_SET_PDEATHSIG " (Linux 2.1.57 °Ê¹ß)" +.\"O Set the parent process death signal +.\"O of the calling process to \fIarg2\fP (either a signal value +.\"O in the range 1..maxsig, or 0 to clear). +.\"O This is the signal that the calling process will get when its +.\"O parent dies. +.\"O This value is cleared for the child of a +.\"O .BR fork (2). +¿Æ¥×¥í¥»¥¹»àË´¥·¥°¥Ê¥ë (parent process death signal) ¤ò \fIarg2\fP ¤ËÀßÄꤹ¤ë +(ÀßÄê¤Ç¤­¤ë¥·¥°¥Ê¥ëÃͤÎÈÏ°Ï¤Ï 1..maxsig ¤Ç¤¢¤ê¡¢0 ¤ÏÄÌÃΤβò½ü¤Ç¤¢¤ë)¡£ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¿Æ¥×¥í¥»¥¹¤¬»à¤ó¤ÀºÝ¤Ë¡¢¤³¤³¤ÇÀßÄꤷ¤¿Ãͤ¬ +¥·¥°¥Ê¥ë¤È¤·¤ÆÄÌÃΤµ¤ì¤ë¡£¤³¤ÎÃÍ¤Ï +.BR fork (2) +¤Î»Ò¥×¥í¥»¥¹¤Ç¤Ï²ò½ü¤µ¤ì¤ë¡£ +.TP +.\"O .BR PR_GET_PDEATHSIG " (since Linux 2.3.15)" +.BR PR_GET_PDEATHSIG " (Linux 2.3.15 °Ê¹ß)" +.\"O Return the current value of the parent process death signal, +.\"O in the location pointed to by +.\"O .IR "(int\ *) arg2" . +¿Æ¥×¥í¥»¥¹»àË´¥·¥°¥Ê¥ë¤Î¸½ºß¤ÎÃͤò +.I "(int\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.TP +.\"O .BR PR_SET_SECCOMP " (since Linux 2.6.23)" +.BR PR_SET_SECCOMP " (Linux 2.6.23 °Ê¹ß)" +.\" See http://thread.gmane.org/gmane.linux.kernel/542632 +.\" [PATCH 0 of 2] seccomp updates +.\" andrea@cpushare.com +.\"O Set the secure computing mode for the calling thread. +.\"O In the current implementation, +.\"O .IR arg2 +.\"O must be 1. +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î secure computing ¥â¡¼¥É¤òÀßÄꤹ¤ë¡£ +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.I arg2 +¤Ï 1 ¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O After the secure computing mode has been set to 1, +.\"O the only system calls that the thread is permitted to make are +.\"O .BR read (2), +.\"O .BR write (2), +.\"O .BR _exit (2), +.\"O and +.\"O .BR sigreturn (2). +.\"O Other system calls result in the delivery of a +.\"O .BR SIGKILL +.\"O signal. +secure computing ¥â¡¼¥É¤ò 1 ¤ËÀßÄꤹ¤ë¤È¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¤¬¸Æ¤Ó½Ð¤·¤òµö²Ä¤µ¤ì¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.BR read (2), +.BR write (2), +.BR _exit (2), +.BR sigreturn (2) +¤À¤±¤Ë¤Ê¤ë¡£ +¤½¤ì°Ê³°¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¥·¥°¥Ê¥ë +.B SIGKILL +¤¬ÇÛÁ÷¤µ¤ì¤ë¡£ +.\"O Secure computing mode is useful for number-crunching applications +.\"O that may need to execute untrusted byte code, +.\"O perhaps obtained by reading from a pipe or socket. +.\"O This operation is only available +.\"O if the kernel is configured with CONFIG_SECCOMP enabled. +¥Ñ¥¤¥×¤ä¥½¥±¥Ã¥È¤«¤éÆɤ߹þ¤ó¤À¡¢¿®Íê¤Ç¤­¤Ê¤¤¥Ð¥¤¥È¥³¡¼¥É¤ò¼Â¹Ô¤¹¤ë +ɬÍפ¬¤¢¤ëÂçÎ̤α黻¤ò¹Ô¤¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤ª¤¤¤Æ¡¢ +secure computing ¥â¡¼¥É¤ÏÌòΩ¤Ä¡£ +¤³¤ÎÁàºî¤ÏÍøÍѤǤ­¤ë¤Î¤Ï¡¢¥«¡¼¥Í¥ë¤¬ CONFIG_SECCOMP ¤òÍ­¸ú¤Ë¤·¤Æ +ºîÀ®¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +.TP +.\"O .BR PR_GET_SECCOMP " (since Linux 2.6.23)" +.BR PR_GET_SECCOMP " (Linux 2.6.23 °Ê¹ß)" +.\"O Return the secure computing mode of the calling thread. +.\"O Not very useful for the current implementation (mode equals 1), +.\"O but may be useful for other possible future modes: +.\"O if the caller is not in secure computing mode, this operation returns 0; +.\"O if the caller is in secure computing mode, then the +.\"O .BR prctl () +.\"O call will cause a +.\"O .B SIGKILL +.\"O signal to be sent to the process. +.\"O This operation is only available +.\"O if the kernel is configured with CONFIG_SECCOMP enabled. +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î secure computing ¥â¡¼¥É¤òÊÖ¤¹¡£ +¸½ºß¤Î¼ÂÁõ (¥â¡¼¥É¤Ï 1 ¸ÇÄê) ¤Ï¤¢¤Þ¤êÌò¤ËΩ¤¿¤Ê¤¤¤¬¡¢ +¾­Í辤Υ⡼¥É¤¬¼ÂÁõ¤µ¤ì¤ë¤ÈÌòΩ¤Ä¤è¤¦¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬ secure computing ¥â¡¼¥É¤Ç¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +¤³¤ÎÁàºî¤Ï 0 ¤òÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬ secure computing ¥â¡¼¥É¤Î¾ì¹ç¡¢ +.BR prctl () +¤ò¸Æ¤Ó½Ð¤¹¤È¥·¥°¥Ê¥ë +.B SIGKILL +¤¬¤½¤Î¥×¥í¥»¥¹¤ËÁ÷¿®¤µ¤ì¤ë¡£ +¤³¤ÎÁàºî¤¬ÍøÍѤǤ­¤ë¤Î¤Ï¡¢¥«¡¼¥Í¥ë¤¬ CONFIG_SECCOMP ¤òÍ­¸ú¤Ë¤·¤Æ +ºîÀ®¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +.TP +.\"O .BR PR_SET_SECUREBITS " (since Linux 2.6.26)" +.BR PR_SET_SECUREBITS " (Linux 2.6.26 °Ê¹ß)" +.\"O Set the "securebits" flags of the calling thread to the value supplied in +.\"O .IR arg2 . +.\"O See +.\"O .BR capabilities (7). +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î "securebits" ¥Õ¥é¥°¤ò +.I arg2 +¤ÇÅϤµ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +.BR capabilities (7) +»²¾È¡£ +.TP +.\"O .BR PR_GET_SECUREBITS " (since Linux 2.6.26)" +.BR PR_GET_SECUREBITS " (Linux 2.6.26 °Ê¹ß)" +.\"O Return (as the function result) +.\"O the "securebits" flags of the calling thread. +.\"O See +.\"O .BR capabilities (7). +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î "securebits" ¥Õ¥é¥°¤ò +(´Ø¿ô¤ÎÊÖ¤êÃͤȤ·¤Æ) ÊÖ¤¹¡£ +.BR capabilities (7) +»²¾È¡£ +.TP +.\"O .BR PR_SET_TIMING " (since Linux 2.6.0-test4)" +.BR PR_SET_TIMING " (Linux 2.6.0-test4 °Ê¹ß)" +.\"O Set whether to use (normal, traditional) statistical process timing or +.\"O accurate timestamp based process timing, by passing +.\"O .B PR_TIMING_STATISTICAL +.\"O .\" 0 +.\"O or +.\"O .B PR_TIMING_TIMESTAMP +.\"O .\" 1 +.\"O to \fIarg2\fP. +.\"O .B PR_TIMING_TIMESTAMP +.\"O is not currently implemented +.\"O (attempting to set this mode will yield the error +.\"O .BR EINVAL ). +.\"O .\" PR_TIMING_TIMESTAMP doesn't do anything in 2.6.26-rc8, +.\"O .\" and looking at the patch history, it appears +.\"O .\" that it never did anything. +(Ä̾ï¤Î¡¢ÅÁÅýŪ¤Ë»È¤ï¤ì¤Æ¤­¤¿) Åý·×Ū¤Ê¥×¥í¥»¥¹¥¿¥¤¥ß¥ó¥°¤ò»ÈÍѤ¹¤ë¤«¡¢ +Àµ³Î¤Ê¥¿¥¤¥à¥¹¥¿¥ó¥×¤Ë´ð¤Å¤¯¥×¥í¥»¥¹¥¿¥¤¥ß¥ó¥°¤ò»ÈÍѤ¹¤ë¤«¤òÀßÄꤹ¤ë¡£ +\fIarg2\fP ¤Ë»ØÄê¤Ç¤­¤ëÃÍ¤Ï +.B PR_TIMING_STATISTICAL +.\" 0 +¤« +.B PR_TIMING_TIMESTAMP +.\" 1 +¤Ç¤¢¤ë¡£ +.B PR_TIMING_TIMESTAMP +¤Ï¸½ºß¤Î¤È¤³¤í¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤ +(¤³¤Î¥â¡¼¥É¤ËÀßÄꤷ¤è¤¦¤È¤¹¤ë¤È¥¨¥é¡¼ +.B EINVAL +¤¬µ¯¤³¤ë¤³¤È¤À¤í¤¦)¡£ +.\" 2.6.26-rc8 ¤Ç¤Ï PR_TIMING_TIMESTAMP ¤Ï²¿¤â¤·¤Ê¤¤¡£ +.\" ¥Ñ¥Ã¥Á¤ÎÍúÎò¤ò¸«¤¿¤¬¡¢²áµî¤Ë¤â²¿¤«¤ò¤·¤¿¤³¤È¤â¤Ê¤¤¡£ +.TP +.\"O .BR PR_GET_TIMING " (since Linux 2.6.0-test4)" +.BR PR_GET_TIMING " (Linux 2.6.0-test4 °Ê¹ß)" +.\"O Return (as the function result) which process timing method is currently +.\"O in use. +¸½ºß»ÈÍÑÃæ¤Î¥×¥í¥»¥¹¥¿¥¤¥ß¥ó¥°¤ò·è¤á¤ëÊýË¡¤òÊÖ¤¹¡£ +.TP +.\"O .BR PR_SET_TSC " (since Linux 2.6.26, x86 only)" +.BR PR_SET_TSC " (Linux 2.6.26 °Ê¹ß, x86 ¤Î¤ß)" +.\"O Set the state of the flag determining whether the timestamp counter +.\"O can be read by the process. +.\"O Pass +.\"O .B PR_TSC_ENABLE +.\"O to +.\"O .I arg2 +.\"O to allow it to be read, or +.\"O .B PR_TSC_SIGSEGV +.\"O to generate a +.\"O .B SIGSEGV +.\"O when the process tries to read the timestamp counter. +¤½¤Î¥×¥í¥»¥¹¤¬¥¿¥¤¥à¥¹¥¿¥ó¥×¡¦¥«¥¦¥ó¥¿¤òÆɤ߽Ф»¤ë¤«¤ò·èÄꤹ¤ë +¥Õ¥é¥°¤Î¾õÂÖ¤òÀßÄꤹ¤ë¡£ +Æɤ߽Ф·¤òµö²Ä¤¹¤ë¾ì¹ç¤Ï +.I arg2 +¤Ë +.B PR_TSC_ENABLE +¤ò¡¢¤½¤Î¥×¥í¥»¥¹¤¬¥¿¥¤¥à¥¹¥¿¥ó¥×¡¦¥«¥¦¥ó¥¿¤òÆɤ߽Ф½¤¦¤È¤·¤¿ºÝ¤Ë +.B SIGSEGV +¤òȯÀ¸¤µ¤»¤ë¾ì¹ç¤Ë¤Ï +.B PR_TSC_SIGSEGV +¤òÅϤ¹¡£ +.TP +.\"O .BR PR_GET_TSC " (since Linux 2.6.26, x86 only)" +.BR PR_GET_TSC " (Linux 2.6.26 °Ê¹ß, x86 ¤Î¤ß)" +.\"O Return the state of the flag determining whether the timestamp counter +.\"O can be read, +.\"O in the location pointed to by +.\"O .IR "(int\ *) arg2" . +¤½¤Î¥×¥í¥»¥¹¤¬¥¿¥¤¥à¥¹¥¿¥ó¥×¡¦¥«¥¦¥ó¥¿¤òÆɤ߽Ф»¤ë¤«¤ò·èÄꤹ¤ë +¥Õ¥é¥°¤Î¾õÂÖ¤ò +.I "(int\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.TP +.B PR_SET_UNALIGN +.\"O (Only on: ia64, since Linux 2.3.48; parisc, since Linux 2.6.15; +.\"O PowerPC, since Linux 2.6.18; Alpha, since Linux 2.6.22) +(ia64 ¤Ç¤Ï Linux 2.3.48 °Ê¹ß; +parisc ¤Ç¤Ï Linux 2.6.15 °Ê¹ß; +PowerPC ¤Ç¤Ï Linux 2.6.18 °Ê¹ß; +Alpha ¤Ç¤Ï¡¡Linux 2.6.22 °Ê¹ß; +¤³¤ì¤é¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¤ß) +.\"O Set unaligned access control bits to \fIarg2\fP. +.\"O Pass +.\"O \fBPR_UNALIGN_NOPRINT\fP to silently fix up unaligned user accesses, +.\"O or \fBPR_UNALIGN_SIGBUS\fP to generate +.\"O .B SIGBUS +.\"O on unaligned user access. +unaligned ¥¢¥¯¥»¥¹À©¸æ¥Ó¥Ã¥È¤ò \fIarg2\fP ¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ëÃÍ¤Ï \fBPR_UNALIGN_NOPRINT\fP (unaligned ¤Ê¥æ¡¼¥¶¥¢¥¯¥»¥¹¤òÌÛ¤Ã¤Æ +½¤Àµ¤¹¤ë) ¤« \fBPR_UNALIGN_SIGBUS\fP (unaligned ¤Ê¥æ¡¼¥¶¥¢¥¯¥»¥¹¤¬¤¢¤Ã¤¿¾ì¹ç +.B SIGBUS +¤òÀ¸À®¤¹¤ë) ¤Ç¤¢¤ë¡£ +.TP +.B PR_GET_UNALIGN +.\"O (see +.\"O .B PR_SET_UNALIGN +.\"O for information on versions and architectures) +(¥Ð¡¼¥¸¥ç¥ó¤È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¾ðÊó¤Ï +.B PR_SET_UNALIGN +»²¾È) +.\"O Return unaligned access control bits, in the location pointed to by +.\"O .IR "(int\ *) arg2" . +unaligned ¥¢¥¯¥»¥¹À©¸æ¥Ó¥Ã¥È¤ÎÃͤò +.I "(int\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR PR_GET_DUMPABLE , +.\"O .BR PR_GET_KEEPCAPS , +.\"O .BR PR_CAPBSET_READ , +.\"O .BR PR_GET_TIMING , +.\"O .BR PR_GET_SECUREBITS , +.\"O and (if it returns) +.\"O .BR PR_GET_SECCOMP +.\"O return the nonnegative values described above. +À®¸ù¤¹¤ë¤È¡¢ +.BR PR_GET_DUMPABLE , +.BR PR_GET_KEEPCAPS , +.BR PR_CAPBSET_READ , +.BR PR_GET_TIMING , +.BR PR_GET_SECUREBITS , +.BR PR_GET_SECCOMP +¤Ï¾å½Ò¤ÎÉé¤Ç¤Ê¤¤ÃͤòÊÖ¤¹ +.RB ( PR_GET_SECCOMP +¤ÏÊÖ¤é¤Ê¤¤¾ì¹ç¤â¤¢¤ë)¡£ +.\"O All other +.\"O .I option +.\"O values return 0 on success. +.I option +¤¬Â¾¤ÎÃͤξì¹ç¤ÏÀ®¸ù»þ¤Ë 0 ¤òÊÖ¤¹¡£ +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O .I arg2 +.\"O is an invalid address. +.I arg2 +¤¬ÉÔÀµ¤Ê¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +.\"O The value of +.\"O .I option +.\"O is not recognized +.I option +¤ÎÃͤ¬Íý²ò¤Ç¤­¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O .I arg2 +.\"O is not valid value for this +.\"O .IR option . +.I arg2 +¤¬»ØÄꤵ¤ì¤¿ +.I option +¤ÇÍ­¸ú¤ÊÃͤǤϤʤ¤¡£ +.TP +.B EINVAL +.\"O .I option +.\"O is +.\"O .BR PR_SET_SECCOMP +.\"O or +.\"O .BR PR_SET_SECCOMP , +.\"O and the kernel was not configured with +.\"O .BR CONFIG_SECCOMP . +.I option +¤¬ +.BR PR_SET_SECCOMP +¤« +.BR PR_GET_SECCOMP +¤À¤¬¡¢¥«¡¼¥Í¥ë¤¬ +.B CONFIG_SECCOMP +¤òÍ­¸ú¤Ë¤·¤ÆºîÀ®¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPERM +.\"O .I option +.\"O is +.\"O .BR PR_SET_SECUREBITS , +.\"O and the caller does not have the +.\"O .B CAP_SETPCAP +.\"O capability, +.\"O or tried to unset a "locked" flag, +.\"O or tried to set a flag whose corresponding locked flag was set +.\"O (see +.\"O .BR capabilities (7)). +.I option +¤¬ +.B PR_SET_SECUREBITS +¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤¬¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.B CAP_SETPCAP +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢"locked" ¥Õ¥é¥°¤ò²ò½ü¤·¤è¤¦¤È¤·¤¿¡£ +¤Þ¤¿¤Ï¡¢locked ¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¤è¤¦¤È¤·¤¿ +.RB ( capabilities (7) +»²¾È)¡£ +.TP +.B EPERM +.\"O .I option +.\"O is +.\"O .BR PR_SET_KEEPCAPS , +.\"O and the callers's +.\"O .B SECURE_KEEP_CAPS_LOCKED +.\"O flag is set +.\"O (see +.\"O .BR capabilities (7)). +.I option +¤¬ +.B PR_SET_KEEPCAPS +¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥Õ¥é¥° +.B SECURE_KEEP_CAPS_LOCKED +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë +.RB ( capabilities (7) +»²¾È)¡£ +.TP +.B EPERM +.\"O .I option +.\"O is +.\"O .BR PR_CAPBSET_DROP , +.\"O and the caller does not have the +.\"O .B CAP_SETPCAP +.\"O capability. +.I option +¤¬ +.B PR_CAPBSET_DROP +¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤¬¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.B CAP_SETPCAP +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.\" The following can't actually happen, because prctl() in +.\" seccomp mode will cause SIGKILL. +.\" .TP +.\" .B EPERM +.\" .I option +.\" is +.\" .BR PR_SET_SECCOMP , +.\" and secure computing mode is already 1. +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The +.\"O .BR prctl () +.\"O system call was introduced in Linux 2.1.57. +.\"O .\" The library interface was added in glibc 2.0.6 +.BR prctl () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.1.57 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.\" ¥é¥¤¥Ö¥é¥ê¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï glibc 2.0.6 ¤ÇÄɲ䵤줿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This call is Linux-specific. +.\"O IRIX has a +.\"O .BR prctl () +.\"O system call (also introduced in Linux 2.1.44 +.\"O as irix_prctl on the MIPS architecture), +.\"O with prototype +¤³¤Î¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ë¡£ +IRIX ¤Ë¤Ï +.BR prctl () +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬¤¢¤ë¤¬ (MIPS ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤¤¤Æ +irix_prctl ¤È¤·¤Æ Linux 2.1.44 ¤ÇƱÍͤËƳÆþ¤µ¤ì¤¿)¡¢ +¤½¤Î¥×¥í¥È¥¿¥¤¥×¤Ï +.sp +.BI "ptrdiff_t prctl(int " option ", int " arg2 ", int " arg3 ); +.sp +.\"O and options to get the maximum number of processes per user, +.\"O get the maximum number of processors the calling process can use, +.\"O find out whether a specified process is currently blocked, +.\"O get or set the maximum stack size, etc. +¤Ç¤¢¤ë¡£¥æ¡¼¥¶¡¼Åö¤ê¤Î¥×¥í¥»¥¹ºÇÂç¿ô¤ò¼èÆÀ¤¹¤ë¥ª¥×¥·¥ç¥ó¡¢ +¥×¥í¥»¥¹¤Î»ÈÍѤǤ­¤ëºÇÂç¥×¥í¥Ã¥µ¡¼¿ô¤ò¼èÆÀ¤¹¤ë¥ª¥×¥·¥ç¥ó¡¢ +¸½ºßÆÃÄê¤Î¥×¥í¥»¥¹¤¬Ää»ß(block)¤µ¤»¤é¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«Ä´¤Ù¤ë¥ª¥×¥·¥ç¥ó¡¢ +¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤ÎºÇÂçÃͤμèÆÀ¤äÀßÄê¤ò¹Ô¤Ê¤¦¥ª¥×¥·¥ç¥ó¤Ê¤É¤¬¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR signal (2), +.BR core (5) diff --git a/draft/man2/pread.2 b/draft/man2/pread.2 new file mode 100644 index 00000000..bc79ff80 --- /dev/null +++ b/draft/man2/pread.2 @@ -0,0 +1,174 @@ +.\" 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 2008-12-03 "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 #define _XOPEN_SOURCE 500 +.sp +.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 ); +.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), +.BR feature_test_macros (7) diff --git a/draft/man2/ptrace.2 b/draft/man2/ptrace.2 new file mode 100644 index 00000000..86e6f7dc --- /dev/null +++ b/draft/man2/ptrace.2 @@ -0,0 +1,973 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" changes Copyright 1999 Mike Coleman (mkc@acm.org) +.\" -- major revision to fully document ptrace semantics per recent Linux +.\" kernel (2.2.10) and glibc (2.1.2) +.\" Sun Nov 7 03:18:35 CST 1999 +.\" +.\" 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 Fri Jul 23 23:47:18 1993 by Rik Faith +.\" Modified Fri Jan 31 16:46:30 1997 by Eric S. Raymond +.\" Modified Thu Oct 7 17:28:49 1999 by Andries Brouwer +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" 2006-03-24, Chuck Ebbert <76306.1226@compuserve.com> +.\" Added PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, +.\" PTRACE_SETSIGINFO, PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP +.\" (Thanks to Blaisorblade, Daniel Jacobowitz and others who helped.) +.\" +.\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1999-11-20, HANATAKA Shinya +.\" Updated 2003-10-11, Kentaro Shirakata +.\" Updated 2006-07-23, Akihiro MOTOKI , LDP v2.28 +.\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2009-04-13, Akihiro MOTOKI, LDP v3.20 +.\" +.\"WORD: child process »Ò¥×¥í¥»¥¹ +.\"WORD: parent process ¿Æ¥×¥í¥»¥¹ +.\"WORD: core image ¥á¥â¥ê¡¦¥¤¥á¡¼¥¸ +.\"WORD: break point ¥Ö¥ì¡¼¥¯¡¦¥Ý¥¤¥ó¥È +.\"WORD: single step ¥·¥ó¥°¥ë¡¦¥¹¥Æ¥Ã¥×¼Â¹Ô +.\"WORD: trap flag ¥È¥é¥Ã¥×¡¦¥Õ¥é¥° +.\"WORD: attach Àܳ +.\"WORD: detach ʬΥ +.\"WORD: process ID ¥×¥í¥»¥¹ID +.\" +.TH PTRACE 2 2009-03-30 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +.\"O ptrace \- process trace +ptrace \- ¥×¥í¥»¥¹¤Î¥È¥ì¡¼¥¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long ptrace(enum __ptrace_request " request ", pid_t " pid ", " +.BI " void *" addr ", void *" data ); +.fi +.SH ÀâÌÀ +.\"O The +.\"O .BR ptrace () +.\"O system call provides a means by which a parent process may observe +.\"O and control the execution of another process, +.\"O and examine and change its core image and registers. +.\"O It is primarily used to implement breakpoint debugging and system +.\"O call tracing. +.BR ptrace () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¿Æ¥×¥í¥»¥¹¤¬¡¢ÊÌ¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤Î´Æ»ë/À©¸æ¤ò +¹Ô¤Ã¤¿¤ê¡¢¥³¥¢¥¤¥á¡¼¥¸ (core image) ¤ä¥ì¥¸¥¹¥¿¤ÎÄ´ºº/Êѹ¹¤ò +¹Ô¤Ã¤¿¤ê¤¹¤ë¼êÃʤòÄ󶡤¹¤ë¡£ +.BR ptrace () +¤Ï¡¢¼ç¤Ë¥Ö¥ì¡¼¥¯¥Ý¥¤¥ó¥È¤Ë¤è¤ë¥Ç¥Ð¥Ã¥°¤ä¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥È¥ì¡¼¥¹¤ò +¼ÂÁõ¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +.LP +.\"O The parent can initiate a trace by calling +.\"O .BR fork (2) +.\"O and having the resulting child do a +.\"O .BR PTRACE_TRACEME , +.\"O followed (typically) by an +.\"O .BR exec (3). +.\"O Alternatively, the parent may commence trace of an existing process using +.\"O .BR PTRACE_ATTACH . +¥È¥ì¡¼¥¹¤ò³«»Ï¤¹¤ë¤Ë¤Ï¡¢¤Þ¤º¿Æ¥×¥í¥»¥¹¤Ç +.BR fork (2) +¤ò¸Æ¤Ó½Ð¤¹¡£À¸À®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ç +.B PTRACE_TRACEME +¤ò¹Ô¤¤¡¢Â³¤¤¤Æ (ŵ·¿Åª¤Ë¤Ï) +.BR exec (3) +¤ò¹Ô¤Ê¤¦¡£ +Ê̤ÎÊýË¡¤È¤·¤Æ¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤¬´û¸¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ +.B PTRACE_ATTACH +¤ò»ÈÍѤ·¡¢¥È¥ì¡¼¥¹¤ò³«»Ï¤¹¤ë¡£ +.LP +.\"O While being traced, the child will stop each time a signal is delivered, +.\"O even if the signal is being ignored. +.\"O (The exception is +.\"O .BR SIGKILL , +.\"O which has its usual effect.) +.\"O The parent will be notified at its next +.\"O .BR wait (2) +.\"O and may inspect and modify the child process while it is stopped. +.\"O The parent then causes the child to continue, +.\"O optionally ignoring the delivered signal +.\"O (or even delivering a different signal instead). +¥È¥ì¡¼¥¹¤Î¼Â¹ÔÃæ¡¢»Ò¥×¥í¥»¥¹¤Ï¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤¿¤Ó¤Ë¡¢ +¤¿¤È¤¨¤½¤Î¥·¥°¥Ê¥ë¤¬Ìµ»ë¤¹¤Ù¤­¤â¤Î¤Ç¤¢¤Ã¤Æ¤âÄä»ß¤¹¤ë +.RB ( SIGKILL +¤ÏÎã³°¤Ç¡¢Ä̾ï¤É¤ª¤ê¤Î¸ú²Ì¤ò¤â¤¿¤é¤¹)¡£ +¿Æ¥×¥í¥»¥¹¤Ë¤Ï¼¡¤Î +.BR wait (2) +¤ÇÄÌÃΤµ¤ì¡¢Ää»ß¤·¤Æ¤¤¤ë´Ö¤Ë»Ò¥×¥í¥»¥¹¤òÄ´¤Ù¤¿¤ê½¤Àµ¤·¤¿¤ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤½¤·¤Æ¿Æ¥×¥í¥»¥¹¤Ï»Ò¥×¥í¥»¥¹¤Î¼Â¹Ô¤òºÆ³«¤µ¤»¤ë¤¬¡¢ÇÛÁ÷¤µ¤ì¤¿ +¥·¥°¥Ê¥ë¤ò̵»ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë (¤¢¤ë¤¤¤ÏÂå¤ï¤ê¤ËÊ̤Υ·¥°¥Ê¥ë¤ò +ÇÛÁ÷¤¹¤ë¤³¤È¤â¤Ç¤­¤ë) ¡£ +.LP +.\"O When the parent is finished tracing, it can terminate the child with +.\"O .B PTRACE_KILL +.\"O or cause it to continue executing in a normal, untraced mode +.\"O via +.\"O .BR PTRACE_DETACH . +¿Æ¥×¥í¥»¥¹¤¬¥È¥ì¡¼¥¹¤ò½ªÎ»¤¹¤ëºÝ¤Ë¤Ï¡¢ +.B PTRACE_KILL +¤ò»ÈÍѤ·¤Æ»Ò¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë¤³¤È¤â¤Ç¤­¤ë¤·¡¢ +.B PTRACE_DETACH +¤òÍѤ¤¤ÆÄ̾ï¤Î¥È¥ì¡¼¥¹¤Ê¤·¤Î¥â¡¼¥É¤Ë¤·¤Æ¡¢ +¼Â¹Ô¤ò·Ñ³¤µ¤»¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.LP +.\"O The value of \fIrequest\fP determines the action to be performed: +\fIrequest\fP ¤ÎÃͤ¬¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÆ°ºî¤ò·èÄꤹ¤ë: +.TP +.B PTRACE_TRACEME +.\"O Indicates that this process is to be traced by its parent. +.\"O Any signal +.\"O (except +.\"O .BR SIGKILL ) +.\"O delivered to this process will cause it to stop and its +.\"O parent to be notified via +.\"O .BR wait (2). +.\"O Also, all subsequent calls to +.\"O .BR execve (2) +.\"O by this process will cause a +.\"O .B SIGTRAP +.\"O to be sent to it, +.\"O giving the parent a chance to gain control before the new program +.\"O begins execution. +.\"O A process probably shouldn't make this request if its parent +.\"O isn't expecting to trace it. +.\"O (\fIpid\fP, \fIaddr\fP, and \fIdata\fP are ignored.) +¤³¤Î¥×¥í¥»¥¹¤¬¿Æ¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ¥È¥ì¡¼¥¹¤µ¤ì¤ë¤³¤È¤òɽ¤¹¡£ +¤³¤Î¥×¥í¥»¥¹¤Ë +.RB ( SIGKILL +°Ê³°¤Î) ¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤È¡¢ +¥×¥í¥»¥¹¤ÏÄä»ß¤·¡¢¿Æ¥×¥í¥»¥¹¤Ë +.BR wait (2) +¤òÄ̤¸¤ÆÄÌÃΤµ¤ì¤ë¡£ +¤Þ¤¿¡¢¤³¤ì°Ê¹ß¤Ï¤³¤Î¥×¥í¥»¥¹¤¬ +.BR execve (2) +¤ò¸Æ¤Ó½Ð¤¹ÅÙ¤Ë +.B SIGTRAP +¤¬Á÷¿®¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤³¤ì¤Ë¤è¤Ã¤Æ¡¢¿Æ¥×¥í¥»¥¹¤Ï +¿·¤·¤¤¥×¥í¥°¥é¥à¤¬¼Â¹Ô¤ò³«»Ï¤¹¤ëÁ°¤ËÀ©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¿Æ¥×¥í¥»¥¹¤¬¼«¥×¥í¥»¥¹¤ò¥È¥ì¡¼¥¹¤¹¤ë¤Ä¤â¤ê¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +¤ª¤½¤é¤¯¤³¤Î¥×¥í¥»¥¹¤ÏËÜÍ×µá¤ò¹Ô¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¤À¤í¤¦¡£ +(\fIpid\fP, \fIaddr\fP, \fIdata\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.LP +.\"O The above request is used only by the child process; +.\"O the rest are used only by the parent. +.\"O In the following requests, \fIpid\fP specifies the child process +.\"O to be acted on. +.\"O For requests other than +.\"O .BR PTRACE_KILL , +.\"O the child process must +.\"O be stopped. +¾åµ­¤ÎÍ×µá¤Ï»Ò¥×¥í¥»¥¹¤À¤±¤¬¹Ô¤Ê¤¦¤â¤Î¤Ç¤¢¤ë¡£ +»Ä¤ê¤Ï¿Æ¥×¥í¥»¥¹¤À¤±¤¬¹Ô¤Ê¤¦¤â¤Î¤Ç¤¢¤ë¡£ +°Ê²¼¤ÎÍ×µá¤Ç¤Ï¡¢\fIpid\fP ¤ÇÁàºî¤ÎÂоݤȤʤë +»Ò¥×¥í¥»¥¹¤ò»ØÄꤹ¤ë¡£ +.B PTRACE_KILL +¤ò½ü¤­¡¢Í×µá¤ò¹Ô¤Ê¤¦¤¿¤á¤Ë¤Ï +»Ò¥×¥í¥»¥¹¤ÏÄä»ß¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BR PTRACE_PEEKTEXT ", " PTRACE_PEEKDATA +.\"O Reads a word at the location +.\"O .I addr +.\"O in the child's memory, returning the word as the result of the +.\"O .BR ptrace () +.\"O call. +.\"O Linux does not have separate text and data address spaces, so the two +.\"O requests are currently equivalent. +.\"O (The argument \fIdata\fP is ignored.) +»Ò¥×¥í¥»¥¹¤Î¥á¥â¥ê¤Î +.I addr +¤Î°ÌÃÖ¤«¤é 1 ¥ï¡¼¥É¤òÆɤ߽Ф¹¡£Æɤ߽Ф·¤¿¥ï¡¼¥É¤Ï +.BR ptrace () +¤ÎÊÖ¤êÃͤȤ·¤ÆÊÖ¤µ¤ì¤ë¡£ Linux ¤Ç¤Ï¥Æ¥­¥¹¥È (text) ¤È¥Ç¡¼¥¿ (data) ¤Ç +Ʊ¤¸¥¢¥É¥ì¥¹¶õ´Ö¤ò»ÈÍѤ¹¤ë¤¿¤á¡¢¤³¤Î 2 ¤Ä¤ÎÍ×µá¤Ï¸½ºß¤Î¤È¤³¤í +Ʊ¤¸¤â¤Î¤Ç¤¢¤ë¡£ (°ú¤­¿ô \fIdata\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.B PTRACE_PEEKUSER +.\" PTRACE_PEEKUSR in kernel source, but glibc uses PTRACE_PEEKUSER, +.\" and that is the name that seems common on other systems. +.\"O Reads a word at offset +.\"O .I addr +.\"O in the child's USER area, +.\"O which holds the registers and other information about the process +.\"O (see \fI\fP). +.\"O The word is returned as the result of the +.\"O .BR ptrace () +.\"O call. +.\"O Typically the offset must be word-aligned, though this might vary by +.\"O architecture. +.\"O See NOTES. +.\"O (\fIdata\fP is ignored.) +»Ò¥×¥í¥»¥¹¤Î USER Îΰè¤Î¥ª¥Õ¥»¥Ã¥È +.I addr +¤Î°ÌÃÖ¤«¤é 1 ¥ï¡¼¥É¤òÆɤ߹þ¤à¡£USER Îΰè¤Ë¤Ï¤½¤Î¥×¥í¥»¥¹¤Î +¥ì¥¸¥¹¥¿ (registers) ¤Ê¤É¤Î¾ðÊó¤¬ÊÝ»ý¤µ¤ì¤Æ¤¤¤ë +(\fI\fP ¤ò»²¾È)¡£Æɤ߹þ¤ó¤À¥ï¡¼¥É¤Ï +.BR ptrace () +¥³¡¼¥ë¤Î·ë²Ì¤È¤·¤ÆÊÖ¤µ¤ì¤ë¡£ +¤¿¤¤¤Æ¤¤¤Ï¥ª¥Õ¥»¥Ã¥È¤Ï¥ï¡¼¥É¶­³¦¤Ë¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤¬¡¢ +¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤è¤Ã¤Æ¤Ï¤½¤ÎɬÍפϤʤ¤¡£ +¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¡£ +(\fIdata\fP ¤Ï̵»ë¤µ¤ì¤ë¡£ ) +.TP +.BR PTRACE_POKETEXT ", " PTRACE_POKEDATA +.\"O Copies the word +.\"O .I data +.\"O to location +.\"O .I addr +.\"O in the child's memory. +.\"O As above, the two requests are currently equivalent. +¥ï¡¼¥É +.I data +¤ò»Ò¥×¥í¥»¥¹¤Î¥á¥â¥ê¤Î +.I addr +¤Î°ÌÃ֤إ³¥Ô¡¼¤¹¤ë¡£¾å¤ÈƱÍͤˡ¢¸½ºß¤Î¤È¤³¤íÆó¤Ä¤Î +Í×µá¤ÏƱ¤¸¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.B PTRACE_POKEUSER +.\" PTRACE_POKEUSR in kernel source, but glibc uses PTRACE_POKEUSER, +.\" and that is the name that seems common on other systems. +.\"O Copies the word +.\"O .I data +.\"O to offset +.\"O .I addr +.\"O in the child's USER area. +.\"O As above, the offset must typically be word-aligned. +.\"O In order to maintain the integrity of the kernel, +.\"O some modifications to the USER area are disallowed. +¥ï¡¼¥É +.I data +¤ò»Ò¥×¥í¥»¥¹¤Î USER Îΰè¤Î¥ª¥Õ¥»¥Ã¥È +.I addr +¤Î°ÌÃ֤˥³¥Ô¡¼¤¹¤ë¡£ +¾å¤ÈƱÍͤˡ¢Ä̾¥ª¥Õ¥»¥Ã¥È¤Ï¥ï¡¼¥É¶­³¦¤Ë¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥«¡¼¥Í¥ë¤Î´°Á´À­ (integrity) ¤ò°Ý»ý¤¹¤ë¤¿¤á¡¢ +Êѹ¹ÆâÍƤˤè¤Ã¤Æ¤Ï USER Îΰè¤ÎÊѹ¹¤Ï¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.BR PTRACE_GETREGS ", " PTRACE_GETFPREGS +.\"O Copies the child's general purpose or floating-point registers, +.\"O respectively, to location \fIdata\fP in the parent. +.\"O See \fI\fP for information on +.\"O the format of this data. +.\"O (\fIaddr\fP is ignored.) +¤½¤ì¤¾¤ì¡¢»Ò¥×¥í¥»¥¹¤ÎÈÆÍѥ쥸¥¹¥¿¡¢ÉâÆ°¾®¿ôÅÀ¥ì¥¸¥¹¥¿¤ò¿Æ¥×¥í¥»¥¹¤Î +\fIdata\fP ¤Î°ÌÃ֤˥³¥Ô¡¼¤¹¤ë¡£¤³¤Î data ¤Î½ñ¼°¤Ë´Ø¤·¤Æ¤Ï +\fI\fP ¤ò»²¾È¤¹¤ë¤³¤È¡£(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.\"O .BR PTRACE_GETSIGINFO " (since Linux 2.3.99-pre6)" +.BR PTRACE_GETSIGINFO " (Linux 2.3.99-pre6 °Ê¹ß)" +.\"O Retrieve information about the signal that caused the stop. +.\"O Copies a \fIsiginfo_t\fP structure (see +.\"O .BR sigaction (2)) +.\"O from the child to location \fIdata\fP in the parent. +.\"O (\fIaddr\fP is ignored.) +Ää»ß¤Î¸¶°ø¤È¤Ê¤Ã¤¿¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ +\fIsiginfo_t\fP ¹½Â¤ÂÎ +.RB ( sigaction (2) +»²¾È) ¤ò»Ò¥×¥í¥»¥¹¤«¤é¿Æ¥×¥í¥»¥¹¤Î \fIdata\fP ¤Î°ÌÃ֤˥³¥Ô¡¼¤¹¤ë¡£ +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.BR PTRACE_SETREGS ", " PTRACE_SETFPREGS +.\"O Copies the child's general purpose or floating-point registers, +.\"O respectively, from location \fIdata\fP in the parent. +.\"O As for +.\"O .BR PTRACE_POKEUSER , +.\"O some general +.\"O purpose register modifications may be disallowed. +.\"O (\fIaddr\fP is ignored.) +¤½¤ì¤¾¤ì¡¢»Ò¥×¥í¥»¥¹¤ÎÈÆÍѥ쥸¥¹¥¿¡¢ÉâÆ°¾®¿ôÅÀ¥ì¥¸¥¹¥¿¤Ë +¿Æ¥×¥í¥»¥¹¤Î \fIdate\fP ¤Î°ÌÃÖ¤«¤é¥³¥Ô¡¼¤¹¤ë¡£ +.B PTRACE_POKEUSER +¤ÈƱÍͤˡ¢ÈÆÍѥ쥸¥¹¥¿¤Ë¤è¤Ã¤Æ¤Ï +Êѹ¹¤¬¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤¬¤¢¤ë¡£ (\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.\"O .BR PTRACE_SETSIGINFO " (since Linux 2.3.99-pre6)" +.BR PTRACE_SETSIGINFO " (Linux 2.3.99-pre6 °Ê¹ß)" +.\"O Set signal information. +.\"O Copies a \fIsiginfo_t\fP structure from location \fIdata\fP in the +.\"O parent to the child. +.\"O This will only affect signals that would normally be delivered to +.\"O the child and were caught by the tracer. +.\"O It may be difficult to tell +.\"O these normal signals from synthetic signals generated by +.\"O .BR ptrace () +.\"O itself. +.\"O (\fIaddr\fP is ignored.) +¥·¥°¥Ê¥ë¾ðÊó¤òÀßÄꤹ¤ë¡£ +\fIsiginfo_t\fP ¹½Â¤ÂΤò¿Æ¥×¥í¥»¥¹¤Î¥Ç¡¼¥¿ \fIdata\fP ¤Î°ÌÃÖ¤«¤é +»Ò¥×¥í¥»¥¹¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +¤³¤Î½èÍý¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¤Î¤Ï¡¢»Ò¥×¥í¥»¥¹¤ËÄ̾ï¤ÏÇÛÁ÷¤µ¤ì¤ë¤Ï¤º¤Ç +¥È¥ì¡¼¥µ¤ËÊ᪤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ë¤Ä¤¤¤Æ¤À¤±¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤ÎÄ̾ï¤Î¥·¥°¥Ê¥ë¤È +.BR ptrace () +¼«¿È¤¬È¯À¸¤¹¤ë¥·¥°¥Ê¥ë¤ò¸«Ê¬¤±¤ë¤Î¤ÏÆñ¤·¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.\"O .BR PTRACE_SETOPTIONS " (since Linux 2.4.6; see BUGS for caveats)" +.BR PTRACE_SETOPTIONS " (Linux 2.4.6 °Ê¹ß; ¥Ð¥°¤Î¾Ï¤Ë¤¢¤ë·Ù¹ð¤â»²¾È)" +.\"O Sets ptrace options from \fIdata\fP in the parent. +.\"O (\fIaddr\fP is ignored.) +.\"O \fIdata\fP is interpreted +.\"O as a bit mask of options, which are specified by the following flags: +¿Æ¥×¥í¥»¥¹¤Î \fIdata\fP ¤Ë´ð¤Å¤¤¤Æ ptrace ¤Î¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë)¡£ +\fIdata\fP ¤Ï¥ª¥×¥·¥ç¥ó¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤È¤·¤Æ²ò¼á¤µ¤ì¡¢ +¥ª¥×¥·¥ç¥ó¤Ë¤Ï°Ê²¼¤Î¥Õ¥é¥°¤ò»ØÄê¤Ç¤­¤ë: +.RS +.TP +.\"O .BR PTRACE_O_TRACESYSGOOD " (since Linux 2.4.6)" +.BR PTRACE_O_TRACESYSGOOD " (Linux 2.4.6 °Ê¹ß)" +.\"O When delivering syscall traps, set bit 7 in the signal number +.\"O (i.e., deliver \fI(SIGTRAP | 0x80)\fP +.\"O This makes it easy for the tracer to tell the difference +.\"O between normal traps and those caused by a syscall. +.\"O .RB ( PTRACE_O_TRACESYSGOOD +.\"O may not work on all architectures.) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥È¥é¥Ã¥×¤¬ÇÛÁ÷¤µ¤ì¤¿¤È¤­¤Ë¡¢¥·¥°¥Ê¥ëÈÖ¹æ¤Î¥Ó¥Ã¥È 7 +¤òÀßÄꤹ¤ë (¤¹¤Ê¤ï¤Á¡¢\fI(SIGTRAP | 0x80)\fP ¤òÇÛÁ÷¤¹¤ë)¡£ +¤³¤ì¤Ë¤è¤ê¡¢¥È¥ì¡¼¥µ¤¬Ä̾ï¤Î¥È¥é¥Ã¥×¤È¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤è¤ë¥È¥é¥Ã¥×¤ò +¶èÊ̤·¤ä¤¹¤¯¤Ê¤ë¡£ +.RB ( PTRACE_O_TRACESYSGOOD +¤Ï¤É¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤âÆ°ºî¤·¤Ê¤¤²ÄǽÀ­¤¬¤¢¤ë¡£) +.TP +.\"O .BR PTRACE_O_TRACEFORK " (since Linux 2.5.46)" +.BR PTRACE_O_TRACEFORK " (Linux 2.5.46 °Ê¹ß)" +.\"O Stop the child at the next +.\"O .BR fork (2) +.\"O call with \fISIGTRAP | PTRACE_EVENT_FORK\ <<\ 8\fP and automatically +.\"O start tracing the newly forked process, +.\"O which will start with a +.\"O .BR SIGSTOP . +.\"O The PID for the new process can be retrieved with +.\"O .BR PTRACE_GETEVENTMSG . +¼¡¤Î +.BR fork (2) +¸Æ¤Ó½Ð¤·»þ¤Ë \fISIGTRAP | PTRACE_EVENT_FORK\ <<\ 8\fP ¤Ç +»Ò¥×¥í¥»¥¹¤ÎÆ°ºî¤òÄä»ß¤µ¤»¡¢ +¿·¤¿¤Ë fork ¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¥È¥ì¡¼¥¹¤ò¼«Æ°Åª¤Ë³«»Ï¤·¡¢ +.B SIGSTOP +¤Ç¤½¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò³«»Ï¤¹¤ë¡£ +¿·¤·¤¤¥×¥í¥»¥¹¤Î PID ¤Ï +.B PTRACE_GETEVENTMSG +¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +.TP +.\"O .BR PTRACE_O_TRACEVFORK " (since Linux 2.5.46)" +.BR PTRACE_O_TRACEVFORK " (Linux 2.5.46 °Ê¹ß)" +.\"O Stop the child at the next +.\"O .BR vfork (2) +.\"O call with \fISIGTRAP | PTRACE_EVENT_VFORK\ <<\ 8\fP and automatically start +.\"O tracing the newly vforked process, which will start with a +.\"O .BR SIGSTOP . +.\"O The PID for the new process can be retrieved with +.\"O .BR PTRACE_GETEVENTMSG . +¼¡¤Î +.BR vfork (2) +¸Æ¤Ó½Ð¤·»þ¤Ë \fISIGTRAP | PTRACE_EVENT_VFORK\ <<\ 8\fP ¤Ç +»Ò¥×¥í¥»¥¹¤ÎÆ°ºî¤òÄä»ß¤µ¤»¡¢ +¿·¤¿¤Ë vfork ¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¥È¥ì¡¼¥¹¤ò¼«Æ°Åª¤Ë³«»Ï¤·¡¢ +.B SIGSTOP +¤Ç¤½¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò³«»Ï¤¹¤ë¡£ +¿·¤·¤¤¥×¥í¥»¥¹¤Î PID ¤Ï +.B PTRACE_GETEVENTMSG +¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +.TP +.\"O .BR PTRACE_O_TRACECLONE " (since Linux 2.5.46)" +.BR PTRACE_O_TRACECLONE " (Linux 2.5.46 °Ê¹ß)" +.\"O Stop the child at the next +.\"O .BR clone (2) +.\"O call with \fISIGTRAP | PTRACE_EVENT_CLONE\ <<\ 8\fP and automatically start +.\"O tracing the newly cloned process, which will start with a +.\"O .BR SIGSTOP . +.\"O The PID for the new process can be retrieved with +.\"O .BR PTRACE_GETEVENTMSG . +.\"O This option may not catch +.\"O .BR clone (2) +.\"O calls in all cases. +.\"O If the child calls +.\"O .BR clone (2) +.\"O with the +.\"O .B CLONE_VFORK +.\"O flag, +.\"O .B PTRACE_EVENT_VFORK +.\"O will be delivered instead +.\"O if +.\"O .B PTRACE_O_TRACEVFORK +.\"O is set; otherwise if the child calls +.\"O .BR clone (2) +.\"O with the exit signal set to +.\"O .BR SIGCHLD , +.\"O .B PTRACE_EVENT_FORK +.\"O will be delivered +.\"O if +.\"O .B PTRACE_O_TRACEFORK +.\"O is set. +¼¡¤Î +.BR clone (2) +¸Æ¤Ó½Ð¤·»þ¤Ë \fISIGTRAP | PTRACE_EVENT_CLONE\ << \8\fP ¤Ç +»Ò¥×¥í¥»¥¹¤ÎÆ°ºî¤òÄä»ß¤µ¤»¡¢ +¿·¤¿¤Ë clone ¤ÇºîÀ®¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¥È¥ì¡¼¥¹¤ò¼«Æ°Åª¤Ë³«»Ï¤·¡¢ +.B SIGSTOP +¤Ç¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò³«»Ï¤¹¤ë¡£ +¿·¤·¤¤¥×¥í¥»¥¹¤Î PID ¤Ï +.B PTRACE_GETEVENTMSG +¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÇÁ´¤Æ¤Î +.BR clone (2) +¥³¡¼¥ë¤òÊá¤Þ¤¨¤é¤ì¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +»Ò¥×¥í¥»¥¹¤¬ +.B CLONE_VFORK +¥Õ¥é¥°ÉÕ¤­¤Ç +.BR clone (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¡¢ +.B PTRACE_O_TRACEVFORK +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ì¤ÐÂå¤ï¤ê¤Ë +.B PTRACE_EVENT_VFORK +¤¬ÇÛÁ÷¤µ¤ì¤ë¡£ +¤Þ¤¿¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¥·¥°¥Ê¥ë¤ò +.B SIGCHLD +¤ËÀßÄꤷ¤Æ +.BR clone (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤Ï¡¢ +.B PTRACE_O_TRACEFORK +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð +.B PTRACE_EVENT_FORK +¤¬ÇÛÁ÷¤µ¤ì¤ë¡£ +.TP +.\"O .BR PTRACE_O_TRACEEXEC " (since Linux 2.5.46)" +.BR PTRACE_O_TRACEEXEC " (Linux 2.5.46 °Ê¹ß)" +.\"O Stop the child at the next +.\"O .BR execve (2) +.\"O call with \fISIGTRAP | PTRACE_EVENT_EXEC\ <<\ 8\fP. +¼¡¤Î +.BR execve (2) +¸Æ¤Ó½Ð¤·»þ¤Ë +\fISIGTRAP | PTRACE_EVENT_EXEC\ <<\ 8\fP +¤Ç»Ò¥×¥í¥»¥¹¤ÎÆ°ºî¤òÄä»ß¤µ¤»¤ë¡£ +.TP +.\"O .BR PTRACE_O_TRACEVFORKDONE " (since Linux 2.5.60)" +.BR PTRACE_O_TRACEVFORKDONE " (Linux 2.5.60 °Ê¹ß)" +.\"O Stop the child at the completion of the next +.\"O .BR vfork (2) +.\"O call with \fISIGTRAP | PTRACE_EVENT_VFORK_DONE\ <<\ 8\fP. +¼¡¤Î +.BR vfork (2) +¸Æ¤Ó½Ð¤·»þ¤Ë +\fISIGTRAP | PTRACE_EVENT_VFORK_DONE\ <<\ 8\fP +¤Ç»Ò¥×¥í¥»¥¹¤ÎÆ°ºî¤òÄä»ß¤µ¤»¤ë¡£ +.TP +.\"O .BR PTRACE_O_TRACEEXIT " (since Linux 2.5.60)" +.BR PTRACE_O_TRACEEXIT " (Linux 2.5.60 °Ê¹ß)" +.\"O Stop the child at exit with \fISIGTRAP | PTRACE_EVENT_EXIT\ <<\ 8\fP. +.\"O The child's exit status can be retrieved with +.\"O .BR PTRACE_GETEVENTMSG . +.\"O This stop will be done early during process exit when registers +.\"O are still available, allowing the tracer to see where the exit occurred, +.\"O whereas the normal exit notification is done after the process +.\"O is finished exiting. +.\"O Even though context is available, the tracer cannot prevent the exit from +.\"O happening at this point. +½ªÎ» (exit) »þ¤Ë \fISIGTRAP | PTRACE_EVENT_EXIT\ <<\ 8\fP +¤Ç»Ò¥×¥í¥»¥¹¤ÎÆ°ºî¤òÄä»ß¤µ¤»¤ë¡£»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ï +.B PTRACE_GETEVENTMSG +¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +¤³¤ÎÄä»ß¤Ï¥ì¥¸¥¹¥¿¤¬¤Þ¤À»²¾È²Äǽ¤Ç¤¢¤ë¥×¥í¥»¥¹½ªÎ»½èÍý¤Î½é´ü¤Ë¹Ô¤ï¤ì¡¢ +¥È¥ì¡¼¥µ¤Ï¤É¤³¤Ç½ªÎ»¤¬È¯À¸¤·¤¿¤«¤òÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +Ä̾ï¤Î½ªÎ»ÄÌÃÎ (exit notification) ¤Ï¥×¥í¥»¥¹¤Î½ªÎ»½èÍý¤¬´°Î»¤·¤¿¸å¤Ë +¹Ô¤ï¤ì¤ë¡£¥³¥ó¥Æ¥­¥¹¥È¤ò»²¾È¤¹¤ë¤³¤È¤Ï¤Ç¤­¤ë¤Ë¤â´Ø¤ï¤é¤º¡¢ +¥È¥ì¡¼¥µ¤Ï¤³¤Î»þÅÀ¤«¤é½ªÎ»¤ò»ß¤á¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.RE +.TP +.\"O .BR PTRACE_GETEVENTMSG " (since Linux 2.5.46)" +.BR PTRACE_GETEVENTMSG " (Linux 2.5.46 °Ê¹ß)" +.\"O Retrieve a message (as an +.\"O .IR "unsigned long" ) +.\"O about the ptrace event +.\"O that just happened, placing it in the location \fIdata\fP in the parent. +.\"O For +.\"O .B PTRACE_EVENT_EXIT +.\"O this is the child's exit status. +.\"O For +.\"O .BR PTRACE_EVENT_FORK , +.\"O .B PTRACE_EVENT_VFORK +.\"O and +.\"O .B PTRACE_EVENT_CLONE +.\"O this +.\"O is the PID of the new process. +.\"O Since Linux 2.6.18, the PID of the new process is also available +.\"O for +.\"O .BR PTRACE_EVENT_VFORK_DONE . +.\"O (\fIaddr\fP is ignored.) +ȯÀ¸¤·¤¿¤Ð¤«¤ê¤Î ptrace ¥¤¥Ù¥ó¥È¤Ë´Ø¤¹¤ë¥á¥Ã¥»¡¼¥¸¤ò +.RI ( "unsigned long" +·¿¤Ç) ¼èÆÀ¤¹¤ë¡£ +¼èÆÀ¤·¤¿¥á¥Ã¥»¡¼¥¸¤Ï¿Æ¥×¥í¥»¥¹¤Î \fIdata\fP ¤Î°ÌÃ֤˳ÊǼ¤µ¤ì¤ë¡£ +ÆÀ¤é¤ì¤ëÆâÍƤϡ¢ +.B PTRACE_EVENT_EXIT +¤Î¾ì¹ç¤Ï»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ç¤¢¤ê¡¢ +.BR PTRACE_EVENT_FORK , +.BR PTRACE_EVENT_VFORK , +.B PTRACE_EVENT_CLONE +¤Î¾ì¹ç¤Ï¿·¤·¤¤¥×¥í¥»¥¹¤Î PID ¤Ç¤¢¤ë¡£ +Linux 2.6.18 °Ê¹ß¤Ç¤Ï¡¢¿·¤·¤¤¥×¥í¥»¥¹¤Î PID ¤Ï +.B PTRACE_EVENT_VFORK_DONE +¤ÇÆþ¼ê¤Ç¤­¤ë¡£ +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.B PTRACE_CONT +.\"O Restarts the stopped child process. +.\"O If \fIdata\fP is nonzero and not +.\"O .BR SIGSTOP , +.\"O it is interpreted as a signal to be delivered to the child; +.\"O otherwise, no signal is delivered. +.\"O Thus, for example, the parent can control +.\"O whether a signal sent to the child is delivered or not. +.\"O (\fIaddr\fP is ignored.) +Ää»ß¤·¤¿»Ò¥×¥í¥»¥¹¤Î¼Â¹Ô¤òºÆ³«¤µ¤»¤ë¡£ +\fIdata\fP ¤¬¥¼¥í¤Ç¤Ê¤¯¡¢ +.B SIGSTOP +¤Ç¤â¤Ê¤±¤ì¤Ð¡¢ +»Ò¥×¥í¥»¥¹¤ËÇÛÁ÷¤µ¤ì¤ë¥·¥°¥Ê¥ë¤È²ò¼á¤µ¤ì¤ë¡£ +¥¼¥í¤ä +.B SIGSTOP +¤Î¾ì¹ç¤Ï¥·¥°¥Ê¥ë¤ÏÇÛÁ÷¤µ¤ì¤Ê¤¤¡£ +¤³¤ì¤ò»È¤¦¤È¡¢Î㤨¤Ð¡¢¿Æ¥×¥í¥»¥¹¤Ï +»Ò¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤¿¥·¥°¥Ê¥ë¤ò¼ÂºÝ¤ËÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¤ò +À©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.BR PTRACE_SYSCALL ", " PTRACE_SINGLESTEP +.\"O Restarts the stopped child as for +.\"O .BR PTRACE_CONT , +.\"O but arranges for +.\"O the child to be stopped at the next entry to or exit from a system call, +.\"O or after execution of a single instruction, respectively. +.\"O (The child will also, as usual, be stopped upon receipt of a signal.) +.\"O From the parent's perspective, the child will appear to have been +.\"O stopped by receipt of a +.\"O .BR SIGTRAP . +.\"O So, for +.\"O .BR PTRACE_SYSCALL , +.\"O for example, the idea is to inspect +.\"O the arguments to the system call at the first stop, +.\"O then do another +.\"O .B PTRACE_SYSCALL +.\"O and inspect the return value of +.\"O the system call at the second stop. +.\"O The +.\"O .I data +.\"O argument is treated as for +.\"O .BR PTRACE_CONT . +.\"O (\fIaddr\fP is ignored.) +.B PTRACE_CONT +¤ÈƱÍͤËÄä»ß¤·¤¿»Ò¥×¥í¥»¥¹¤òºÆ³«¤¹¤ë¡£¤¿¤À¤·¡¢ +.B PTRACE_SYSCALL +¤Î¾ì¹ç¤Ï»Ò¥×¥í¥»¥¹¤¬ +¼¡¤Ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÆþ¤ë¤«¥·¥¹¥Æ¥à¥³¡¼¥ë¤«¤éÈ´¤±¤ë¤«¤¹¤ë»þ¤Ë¡¢ +.B PTRACE_SINGLESTEP +¤Î¾ì¹ç¤Ï 1 Ì¿Îá (instruction) ¼Â¹Ô¤·¤¿¸å¤ËÄä»ß¤µ¤»¤ë +(Ä̾ï¤É¤ª¤ê¡¢»Ò¥×¥í¥»¥¹¤Ï¥·¥°¥Ê¥ë¤ò¼õ¤±¼è¤Ã¤¿¾ì¹ç¤Ë¤âÄä»ß¤¹¤ë)¡£ +¿Æ¥×¥í¥»¥¹¤«¤é¸«¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤Ï +.B SIGTRAP +¤ò¼õ¿®¤·¤ÆÄä»ß¤·¤¿¤è¤¦¤Ë¸«¤¨¤ë¡£¤½¤Î¤¿¤á¡¢Î㤨¤Ð +.B PTRACE_SYSCALL +¤ò»È¤¦¤È¡¢1²óÌܤÎÄä»ß¤Ç°ú¤­¿ô¤òÄ´¤Ù¤Æ +.B PTRACE_SYSCALL +¤ò¼Â¹Ô¤·¡¢ 2²óÌܤÎÄä»ß¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÊÖ¤êÃͤòÄ´¤Ù¤ë¡¢ +¤È¤¤¤¦¤è¤¦¤Ê¤³¤È¤¬¤Ç¤­¤ë¡£ +°ú¤­¿ô +.I data +¤Ï +.B PTRACE_CONT +¤Î¾ì¹ç¤ÈƱ¤¸Íͤ˲ò¼á¤µ¤ì¤ë¡£ +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.\"O .BR PTRACE_SYSEMU ", " PTRACE_SYSEMU_SINGLESTEP " (since Linux 2.6.14)" +.BR PTRACE_SYSEMU ", " PTRACE_SYSEMU_SINGLESTEP " (Linux 2.6.14 °Ê¹ß)" +.\"O For +.\"O .BR PTRACE_SYSEMU , +.\"O continue and stop on entry to the next syscall, +.\"O which will not be executed. +.\"O For +.\"O .BR PTRACE_SYSEMU_SINGLESTEP , +.\"O do the same +.\"O but also singlestep if not a syscall. +.\"O This call is used by programs like +.\"O User Mode Linux that want to emulate all the child's syscalls. +.\"O The +.\"O .I data +.\"O argument is treated as for +.\"O .BR PTRACE_CONT . +.\"O (\fIaddr\fP is ignored; +.\"O not supported on all architectures.) +.B PTRACE_SYSEMU +¤Ï¡¢¼Â¹Ô¤òºÆ³«¤·¡¢¼¡¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÆþ¤ë»þ¤ËÄä»ß¤µ¤»¤ë¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼Â¹Ô¤µ¤ì¤Ê¤¤¡£ +.B PTRACE_SYSEMU_SINGLESTEP +¤âƱÍͤÀ¤¬¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï +1 Ì¿Îá (singlestep) ¤À¤±¼Â¹Ô¤·¤¿»þÅÀ¤Ç¤âÄä»ß¤µ¤»¤ë¡£ +¤³¤Î¥³¡¼¥ë¤Ï User Mode Linux ¤Î¤è¤¦¤Ë»Ò¥×¥í¥»¥¹¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÁ´¤Æ +¥¨¥ß¥å¥ì¡¼¥È¤·¤è¤¦¤È¤¹¤ë¥×¥í¥°¥é¥à¤Ç»ÈÍѤµ¤ì¤ë¡£ +°ú¤­¿ô +.I data +¤Ï +.B PTRACE_CONT +¤Î¾ì¹ç¤ÈƱ¤¸Íͤ˲ò¼á¤µ¤ì¤ë¡£ +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£ +Á´¤Æ¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£) +.TP +.B PTRACE_KILL +.\"O Sends the child a +.\"O .B SIGKILL +.\"O to terminate it. +.\"O (\fIaddr\fP and \fIdata\fP are ignored.) +»Ò¥×¥í¥»¥¹¤Ë +.B SIGKILL +¤òÁ÷¤ê½ªÎ»¤µ¤»¤ë¡£(\fIaddr\fP ¤È \fIdata\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.B PTRACE_ATTACH +.\"O Attaches to the process specified in +.\"O .IR pid , +.\"O making it a traced "child" of the calling process; +.\"O the behavior of the child is as if it had done a +.\"O .BR PTRACE_TRACEME . +.\"O The calling process actually becomes the parent of the child +.\"O process for most purposes (e.g., it will receive +.\"O notification of child events and appears in +.\"O .BR ps (1) +.\"O output as the child's parent), but a +.\"O .BR getppid (2) +.\"O by the child will still return the PID of the original parent. +.\"O The child is sent a +.\"O .BR SIGSTOP , +.\"O but will not necessarily have stopped +.\"O by the completion of this call; use +.\"O .BR wait (2) +.\"O to wait for the child to stop. +.\"O (\fIaddr\fP and \fIdata\fP are ignored.) +.I pid +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤ËÀܳ (attach) ¤·¡¢¤½¤ì¤ò¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î +»Ò¥×¥í¥»¥¹¤È¤·¤Æ¥È¥ì¡¼¥¹¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£»Ò¥×¥í¥»¥¹¤Ï +.B PTRACE_TRACEME +¤·¤¿¤«¤Î¤è¤¦¤Ë¿¶Éñ¤¦¡£¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ï¤½¤Î¤Û¤È¤ó¤É¤ÎÌÜŪ¤Ë¤ª¤¤¤Æ¡¢ +¤½¤Î»Ò¥×¥í¥»¥¹¤Î¼ÂºÝ¤Î¿Æ¤Ë¤Ê¤ë (Î㤨¤Ð¡¢»Ò¥×¥í¥»¥¹¤Î¥¤¥Ù¥ó¥È¤Î +ÄÌÃΤò¼õ¤±¤È¤Ã¤¿¤ê¡¢ +.BR ps (1) +¤Ç¿Æ¤È¤·¤Æɽ¼¨¤µ¤ì¤¿¤ê¤¹¤ë)¡£¤·¤«¤·¡¢»Ò¥×¥í¥»¥¹¤Ç +.BR getppid (2) +¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Ë¤Ï¸µ¤Î¿Æ¥×¥í¥»¥¹¤Î PID ¤¬ÊÖ¤µ¤ì¤ë¡£ +»Ò¥×¥í¥»¥¹¤Ë¤Ï +.B SIGSTOP +¤¬Á÷¤é¤ì¤ë¤¬¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤¬´°Î»¤¹¤ë¤Þ¤Ç¤Ë +ɬ¤º¤·¤âÄä»ß¤¹¤ë¤È¤Ï¸Â¤é¤Ê¤¤¡£»Ò¥×¥í¥»¥¹¤ÎÄä»ß¤òÂÔ¤Ä¤Ë¤Ï +.BR wait (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£(\fIaddr\fP ¤È \fIdata\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.B PTRACE_DETACH +.\"O Restarts the stopped child as for +.\"O .BR PTRACE_CONT , +.\"O but first detaches +.\"O from the process, undoing the reparenting effect of +.\"O .BR PTRACE_ATTACH , +.\"O and the effects of +.\"O .BR PTRACE_TRACEME . +.\"O Although perhaps not intended, under Linux a traced child can be +.\"O detached in this way regardless of which method was used to initiate +.\"O tracing. +.\"O (\fIaddr\fP is ignored.) +.B PTRACE_CONT +¤ÈƱÍͤËÄä»ß¤·¤¿»Ò¥×¥í¥»¥¹¤òºÆ³«¤¹¤ë¡£¤¿¤À¤· +¤Þ¤º¤½¤Î¥×¥í¥»¥¹¤«¤é¤ÎʬΥ (detach) ¤ò¹Ô¤¤¡¢ +.B PTRACE_ATTACH +¤Ç¤Î¿Æ¤ÎÀڤ괹¤¨¤Ë¤è¤ë¸ú²Ì¤È +.B PTRACE_TRACEME +¤Î¸ú²Ì¤ò¼è¤ê¾Ã¤¹¡£°Õ¿Þ¤·¤¿¤â¤Î¤Ç¤Ï¤Ê¤¤¤À¤í¤¦¤¬¡¢ +Linux ¤Ç¤Ï¡¢¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤ë»Ò¥×¥í¥»¥¹¤Ï¤É¤Î¤è¤¦¤ÊÊýË¡¤Ç¥È¥ì¡¼¥¹¤ò +³«»Ï¤µ¤ì¤¿¤È¤·¤Æ¤â¡¢¤³¤ÎÊýË¡¤ÇʬΥ (detach) ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .B PTRACE_PEEK* +.\"O requests return the requested data, +.\"O while other requests return zero. +.\"O On error, all requests return \-1, and +.\"O .I errno +.\"O is set appropriately. +.\"O Since the value returned by a successful +.\"O .B PTRACE_PEEK* +.\"O request may be \-1, the caller must check +.\"O .I errno +.\"O after such requests to determine whether or not an error occurred. +À®¸ù¤¹¤ë¤È¡¢ +.B PTRACE_PEEK* +¤Î¾ì¹ç¤ÏÍ׵ᤷ¤¿¥Ç¡¼¥¿¤òÊÖ¤·¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.B PTRACE_PEEK* +¤¬À®¸ù¤·¤ÆÊÖ¤¹Ãͤ⡡\-1 ¤Ë¤Ê¤ë¤³¤È¤¬¤¢¤ë¤¿¤á¡¢ +¤½¤Î¤è¤¦¤ÊÍ×µá¤Î¾ì¹ç¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï +.I errno +¤òÄ´¤Ù¡¢¥¨¥é¡¼¤«È¯À¸¤·¤¿¤Î¤«¤É¤¦¤«¤òȽÃǤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBUSY +.\"O (i386 only) There was an error with allocating or freeing a debug +.\"O register. +(i386 ¤Î¤ß) ¥Ç¥Ð¥Ã¥°¥ì¥¸¥¹¥¿¤Î³ÎÊݤޤ¿¤Ï²òÊü¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EFAULT +.\"O There was an attempt to read from or write to an invalid area in +.\"O the parent's or child's memory, +.\"O probably because the area wasn't mapped or accessible. +.\"O Unfortunately, under Linux, different variations of this fault +.\"O will return +.\"O .B EIO +.\"O or +.\"O .B EFAULT +.\"O more or less arbitrarily. +¿Æ¥×¥í¥»¥¹¤Þ¤¿¤Ï»Ò¥×¥í¥»¥¹¤Î¥á¥â¥ê¤ÎÉÔÀµ¤ÊÎΰè¤ËÆɤ߽ñ¤­¤·¤è¤¦¤È¤·¤¿¡£ +¤ª¤½¤é¤¯¤½¤ÎÎΰ褬¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +¤½¤ÎÎΰè¤Ø¤Î¥¢¥¯¥»¥¹¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¤Ç¤¢¤ë¡£ +ÉÔ±¿¤Ê¤³¤È¤Ë¡¢Linux ¤Ç¤Ï¤³¤Î¤è¤¦¤Ê¥¨¥é¡¼¤Î¾ì¹ç¡¢Â¿¤«¤ì¾¯¤Ê¤«¤ì +×ó°ÕŪ¤Ë +.B EIO +¤òÊÖ¤·¤¿¤ê +.B EFAULT +¤òÊÖ¤·¤¿¤ê¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.\"O An attempt was made to set an invalid option. +ÉÔÀµ¤Ê¥ª¥×¥·¥ç¥ó¤òÀßÄꤷ¤è¤¦¤È¤·¤¿¡£ +.TP +.B EIO +.\"O \fIrequest\fP is invalid, or an attempt was made to read from or +.\"O write to an invalid area in the parent's or child's memory, +.\"O or there was a word-alignment violation, +.\"O or an invalid signal was specified during a restart request. +\fIrequest\fP ¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +¤Þ¤¿¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Þ¤¿¤Ï»Ò¥×¥í¥»¥¹¤Î¥á¥â¥ê¤Î +ÉÔÀµ¤ÊÎΰè¤ËÆɤ߽ñ¤­¤·¤è¤¦¤È¤·¤¿¡£ +¤Þ¤¿¤Ï¡¢¥ï¡¼¥É¶­³¦°ãÈ¿¤¬¤¢¤Ã¤¿¡£ +¤Þ¤¿¤Ï¡¢¼Â¹ÔºÆ³«¤ÎÍ×µá¤ÇÉÔÀµ¤Ê¥·¥°¥Ê¥ë¤ò»ØÄꤷ¤¿¡£ +.TP +.B EPERM +.\"O The specified process cannot be traced. +.\"O This could be because the +.\"O parent has insufficient privileges (the required capability is +.\"O .BR CAP_SYS_PTRACE ); +.\"O unprivileged processes cannot trace processes that they +.\"O cannot send signals to or those running +.\"O set-user-ID/set-group-ID programs, for obvious reasons. +.\"O Alternatively, the process may already be being traced, or be +.\"O .BR init (8) +.\"O (PID 1). +»ØÄꤷ¤¿¥×¥í¥»¥¹¤ò¥È¥ì¡¼¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£¤³¤ì¤Ï¿Æ¥×¥í¥»¥¹¤¬ +ɬÍפʸ¢¸Â (ɬÍפʥ±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï +.BR CAP_SYS_PTRACE ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¤³¤È¤¬¸¶°ø¤Î¾ì¹ç¤¬¤¢¤ë¡£ +ʬ¤«¤ê¤ä¤¹¤¤Íýͳ¤òµó¤²¤ë¤Ê¤é¡¢ +ÈóÆø¢¥×¥í¥»¥¹¤Ï¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¥×¥í¥»¥¹¤ò¥È¥ì¡¼¥¹¤Ç¤­¤Ê¤¤¤·¡¢ +set-user-ID/set-group-ID ¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Ï¥È¥ì¡¼¥¹¤Ç¤­¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢¥×¥í¥»¥¹¤Ï¤¹¤Ç¤Ë¥È¥ì¡¼¥¹Ãæ¤Ç¤¢¤ë¡¢ +¤Þ¤¿¤Ï +.BR init (8) +¥×¥í¥»¥¹ (PID ¤¬ 1) ¤Ç¤¢¤ë¡£ +.TP +.B ESRCH +.\"O The specified process does not exist, or is not currently being traced +.\"O by the caller, or is not stopped (for requests that require that). +»ØÄꤷ¤¿¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢»ØÄꤷ¤¿¥×¥í¥»¥¹¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬ +¸½ºß¥È¥ì¡¼¥¹Ãæ¤Î»Ò¥×¥í¥»¥¹¤Ç¤Ï¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢»ØÄꤷ¤¿¥×¥í¥»¥¹¤¬Ää»ß¤·¤Æ¤¤¤Ê¤¤ (Ää»ß¤·¤Æ¤¤¤ë¤³¤È¤¬É¬ÍפÊÍ×µá¤Î¾ì¹ç)¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Although arguments to +.\"O .BR ptrace () +.\"O are interpreted according to the prototype given, +.\"O glibc currently declares +.\"O .BR ptrace () +.\"O as a variadic function with only the \fIrequest\fP argument fixed. +.\"O This means that unneeded trailing arguments may be omitted, +.\"O though doing so makes use of undocumented +.\"O .BR gcc (1) +.\"O behavior. +.BR ptrace () +¤Î°ú¤­¿ô¤Ï¾å¤Î¤è¤¦¤Ê¥×¥í¥È¥¿¥¤¥×¤Ë´ð¤Å¤¤¤Æ²ò¼á¤µ¤ì¤ë¤¬¡¢ +glibc ¤Ç¤Ï¡¢¸½ºß¤Î¤È¤³¤í +.BR ptrace () +¤Ï \fIrequest\fP °ú¤­¿ô¤À¤±¤¬¸ÇÄê¤Î²ÄÊÑĹ°ú¤­¿ô´Ø¿ô¤È¤·¤Æ +Àë¸À¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤ÏɬÍפʤ±¤ì¤Ð»Ä¤ê¤Î°ú¤­¿ô¤Ï¾Êά²Äǽ¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¤¬¡¢ +¤½¤ì¤Ï +.BR gcc (1) +¤ÎÌÀʸ²½¤µ¤ì¤Æ¤¤¤Ê¤¤Æ°ºî¤òÍøÍѤ·¤Æ¤¤¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.LP +.\"O .BR init (8), +.\"O the process with pid 1, may not be traced. +.BR init (8) +¤¹¤Ê¤ï¤Á PID ¤¬ 1 ¤Î¥×¥í¥»¥¹¤Ï¥È¥ì¡¼¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.LP +.\"O The layout of the contents of memory and the USER area are quite OS- and +.\"O architecture-specific. +¥á¥â¥ê¤ä USER Îΰè¤ÎÆâÍƤäÇÛÃÖ¤Ï OS ¤´¤È¡¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤´¤È¤Ë +Èó¾ï¤Ë°Í¸¤¹¤ë¡£ +.\"O The offset supplied, and the data returned, +.\"O might not entirely match with the definition of +.\"O .IR "struct user" . +.\"O .\" See http://lkml.org/lkml/2008/5/8/375 +¥ª¥Õ¥»¥Ã¥È¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ÊÖ¤µ¤ì¤ë¥Ç¡¼¥¿¤Ï +.I "struct user" +¤ÎÄêµÁ¤È´°Á´¤Ë°ìÃפ·¤Ê¤¤¤³¤È¤â¤¢¤ê¤¨¤ë¡£ +.\" http://lkml.org/lkml/2008/5/8/375 »²¾È¡£ +.LP +.\"O The size of a "word" is determined by the OS variant +.\"O (e.g., for 32-bit Linux it is 32 bits, etc.). +¡Ö¥ï¡¼¥É (word) ¡×¤ÎÂ礭¤µ¤Ï OS ¤Ë¤è¤Ã¤Æ·è¤Þ¤ë¡£ +(Î㤨¤Ð¡¢32 ¥Ó¥Ã¥È¤Î Linux ¤Ç¤Ï 32 ¥Ó¥Ã¥È¤Ç¤¢¤ë¡¢¤Ê¤É¡£) +.LP +.\"O Tracing causes a few subtle differences in the semantics of +.\"O traced processes. +.\"O For example, if a process is attached to with +.\"O .BR PTRACE_ATTACH , +.\"O its original parent can no longer receive notification via +.\"O .BR wait (2) +.\"O when it stops, and there is no way for the new parent to +.\"O effectively simulate this notification. +¥È¥ì¡¼¥¹¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥È¥ì¡¼¥¹¤µ¤ì¤ë¥×¥í¥»¥¹¤ÎÆ°ºî¤Ëº³ºÙ¤Ê°ã¤¤¤¬ +µ¯¤³¤ë¤³¤È¤¬¤¢¤ë¡£Î㤨¤Ð¡¢¥×¥í¥»¥¹¤¬ +.B PTRACE_ATTACH +¤Ë¤è¤Ã¤ÆÀܳ¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬Ää»ß¤·¤¿»þ¤Ç¤âËÜÍè¤Î¿Æ¤Ï +.BR wait (2) +¤ò»È¤Ã¤ÆÄÌÃΤò¼õ¤±¤ë¤³¤È¤¬¤Ç¤­¤º¡¢¿·¤·¤¤¿Æ¤¬¸úΨ¤è¤¯ +¤³¤ÎÄÌÃΤò¿¿»÷¤ëÊýË¡¤â¤Ê¤¤¡£ +.LP +.\"O When the parent receives an event with +.\"O .B PTRACE_EVENT_* +.\"O set, +.\"O the child is not in the normal signal delivery path. +.\"O This means the parent cannot do +.\"O .BR ptrace (PTRACE_CONT) +.\"O with a signal or +.\"O .BR ptrace (PTRACE_KILL). +.\"O .BR kill (2) +.\"O with a +.\"O .B SIGKILL +.\"O signal can be used instead to kill the child process +.\"O after receiving one of these messages. +¿Æ¥×¥í¥»¥¹¤¬ +.B PTRACE_EVENT_* +¤¬¥»¥Ã¥È¤µ¤ì¤¿¥¤¥Ù¥ó¥È¤ò¼õ¿®¤·¤¿¾ì¹ç¡¢ +»Ò¥×¥í¥»¥¹¤ÏÄ̾ïÄ̤ê¤Î¥·¥°¥Ê¥ëÇÛÁ÷¤¬¹Ô¤ï¤ì¤ë¾õÂ֤ˤʤ¤¡£ +¤Ä¤Þ¤ê¡¢¿Æ¥×¥í¥»¥¹¤¬¡¢ +¥·¥°¥Ê¥ë¤Ë¤è¤ê +.BR ptrace (PTRACE_CONT) +¤ò¹Ô¤Ã¤¿¤ê¡¢ +.BR ptrace (PTRACE_KILL) +¤ò¹Ô¤Ã¤¿¤ê¤Ç¤­¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +¤³¤é¤é¤Î¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®¸å¤Ï¡¢»Ò¥×¥í¥»¥¹¤ò½ªÎ» (kill) ¤¹¤ë¤Î¤Ë¡¢ +¥·¥°¥Ê¥ë +.B SIGKILL +¤ò»ØÄꤷ¤Æ +.BR kill (2) +¤ò¹Ô¤¦ÊýË¡¤òÂå¤ï¤ê¤Ë»ÈÍѤǤ­¤ë¡£ +.LP +.\"O This page documents the way the +.\"O .BR ptrace () +.\"O call works currently in Linux. +.\"O Its behavior differs noticeably on other flavors of Unix. +.\"O In any case, use of +.\"O .BR ptrace () +.\"O is highly OS- and architecture-specific. +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï¸½ºß¤Î Linux ¤Ë¤ª¤±¤ë +.BR ptrace () +¥³¡¼¥ë¤ÎÆ°ºî¤Ë¤Ä¤¤¤Æµ­½Ò¤·¤Æ¤¤¤ë¡£Â¾¤Î Unix ¤Ç¤Ï +¤½¤ÎÆ°ºî¤ÏÃø¤·¤¯°Û¤Ê¤ë¡£ +¤¤¤«¤Ê¤ë¾ì¹ç¤â +.BR ptrace () +¤ò»È¤¦¤È OS ¤ä¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ËÈó¾ï¤Ë°Í¸¤·¤¿¤â¤Î¤Ë¤Ê¤ë¡£ +.LP +.\"O The SunOS man page describes +.\"O .BR ptrace () +.\"O as "unique and arcane", which it is. +.\"O The proc-based debugging interface +.\"O present in Solaris 2 implements a superset of +.\"O .BR ptrace () +.\"O functionality in a more powerful and uniform way. +SunOS ¤Î¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸¤Ë¤Ï +.BR ptrace () +¤Ï¡ÖÆÈÆäÇÉԲIJò¡×¤Èµ­½Ò¤µ¤ì¤Æ¤ª¤ê¡¢¤Þ¤µ¤·¤¯¤½¤¦¤Ç¤¢¤ë¡£ +Solaris 2 ¤Ç¤Ï proc ¥Ù¡¼¥¹¤Î +¥Ç¥Ð¥Ã¥°¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤È¤·¤Æ +.BR ptrace () +¤Î¾å°Ì¸ß´¹´Ø¿ô¤¬¼ÂÁõ¤µ¤ì¡¢¤è¤ê¶¯ÎϤǰì´ÓÀ­¤Î¤¢¤ë¤â¤Î¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O On hosts with 2.6 kernel headers, +.\"O .B PTRACE_SETOPTIONS +.\"O is declared +.\"O with a different value than the one for 2.4. +.\"O This leads to applications compiled with such +.\"O headers failing when run on 2.4 kernels. +.\"O This can be worked around by redefining +.\"O .B PTRACE_SETOPTIONS +.\"O to +.\"O .BR PTRACE_OLDSETOPTIONS , +.\"O if that is defined. +¥«¡¼¥Í¥ë 2.6 ¤Î¥Ø¥Ã¥À¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥Û¥¹¥È¤Ç¤Ï¡¢ +.B PTRACE_SETOPTIONS +¤Ï¥«¡¼¥Í¥ë 2.4 ¤Î¥Ø¥Ã¥À¤È¤Ï°Û¤Ê¤ëÃͤÇÀë¸À¤µ¤ì¤ë¡£ +¤³¤Î¤¿¤á¡¢¥«¡¼¥Í¥ë 2.6 ¤Î¥Ø¥Ã¥À¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï +¥«¡¼¥Í¥ë 2.4 ¤Ç¤ÏÀµ¤·¤¯Æ°ºî¤·¤Ê¤¤¡£ +¤³¤ÎÌäÂê¤Ï¡¢ +.B PTRACE_SETOPTIONS +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤¿ºÝ¤Ï¡¢ +.B PTRACE_SETOPTIONS +¤ò +.B PTRACE_OLDSETOPTIONS +¤ËÄêµÁ¤·Ä¾¤¹¤³¤È¤ÇÂнè¤Ç¤­¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR gdb (1), +.BR strace (1), +.BR execve (2), +.BR fork (2), +.BR signal (2), +.BR wait (2), +.BR exec (3), +.BR capabilities (7) diff --git a/draft/man2/query_module.2 b/draft/man2/query_module.2 new file mode 100644 index 00000000..0df6d712 --- /dev/null +++ b/draft/man2/query_module.2 @@ -0,0 +1,290 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-29, Akihiro MOTOKI +.\" +.TH QUERY_MODULE 2 2007-06-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O query_module \- query the kernel for various bits pertaining to modules +query_module \- ¥â¥¸¥å¡¼¥ë¤Ë´ØÏ¢¤¹¤ë³Æ¼ï¤Î¾ðÊó¤ò¥«¡¼¥Í¥ë¤ËÌ䤤¹ç¤ï¤»¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int query_module(const char *" name ", int " which ", void *" buf , +.BI " size_t " bufsize ", size_t *" ret ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR query_module () +.\"O requests information from the kernel about loadable modules. +.\"O The returned information is placed in the buffer pointed to by +.\"O .IR buf . +.\"O The caller must specify the size of +.\"O .I buf +.\"O in +.\"O .IR bufsize . +.\"O The precise nature and format of the returned information +.\"O depend on the operation specified by +.\"O .IR which . +.\"O Some operations require +.\"O .I name +.\"O to identify a currently loaded module, some allow +.\"O .I name +.\"O to be NULL, indicating the kernel proper. +.BR query_module () +¤Ï¡¢¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤ò¥«¡¼¥Í¥ë¤ËÌ䤤¹ç¤ï¤»¤ë¡£ +¾ðÊó¤Ï +.I buf +¤¬»Ø¤·¼¨¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï +.I buf +¤Î¥µ¥¤¥º¤ò +.I bufsize +¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ÆÀ¤é¤ì¤ë¾ðÊó¤ÎÀµ³Î¤Ê°ÕÌ£¤È¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢ +.I which +¤Ç¤É¤ÎÁàºî¤ò»ØÄꤹ¤ë¤«¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +¸½ºß¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥â¥¸¥å¡¼¥ë¤òÆÃÄꤹ¤ë¤¿¤á¤Ë +.I name +¤òɬÍפȤ¹¤ëÁàºî¤¬¤¢¤ì¤Ð¡¢ +¥«¡¼¥Í¥ë¸ÇÍ­¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹ NULL ¤ò»ØÄê¤Ç¤­¤ëÁàºî¤â¤¢¤ë¡£ + +.\"O The following values can be specified for +.\"O .IR which : +.I which +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.TP +.B 0 +.\"O Returns success, if the kernel supports +.\"O .BR query_module (). +.\"O Used to probe for availability of the system call. +¥«¡¼¥Í¥ë¤¬ +.BR query_module () +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç¡¢À®¸ù¤òÊÖ¤¹¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÍøÍѲÄǽ¤«¤òÄ´¤Ù¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.TP +.B QM_MODULES +.\"O Returns the names of all loaded modules. +.\"O The returned buffer consists of a sequence of null-terminated strings; +.\"O .I ret +.\"O is set to the number of +.\"O modules. +¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥â¥¸¥å¡¼¥ë¤Î̾Á°¤òÊÖ¤¹¡£ +¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎ󤬽ç¤ËÆþ¤ë¡£ +ÊÖ¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡ +.I ret +¤Ë¤Ï¥â¥¸¥å¡¼¥ë¤Î¿ô¤¬ÀßÄꤵ¤ì¤ë¡£ +.\" ret is set on ENOSPC +.TP +.B QM_DEPS +.\"O Returns the names of all modules used by the indicated module. +.\"O The returned buffer consists of a sequence of null-terminated strings; +.\"O .I ret +.\"O is set to the number of modules. +»ØÄꤵ¤ì¤¿¥â¥¸¥å¡¼¥ë¤¬»ÈÍѤ·¤Æ¤¤¤ëÁ´¥â¥¸¥å¡¼¥ë¤Î̾Á°¤òÊÖ¤¹¡£ +¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎ󤬽ç¤ËÆþ¤ë¡£ +ÊÖ¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡ +.I ret +¤Ë¤Ï¥â¥¸¥å¡¼¥ë¤Î¿ô¤¬ÀßÄꤵ¤ì¤ë¡£ +.\" ret is set on ENOSPC +.TP +.B QM_REFS +.\"O Returns the names of all modules using the indicated module. +.\"O This is the inverse of +.\"O .BR QM_DEPS . +.\"O The returned buffer consists of a sequence of null-terminated strings; +.\"O .I ret +.\"O is set to the number of modules. +»ØÄꤵ¤ì¤¿¥â¥¸¥å¡¼¥ë¤ò»ÈÍѤ·¤Æ¤¤¤ëÁ´¥â¥¸¥å¡¼¥ë¤Î̾Á°¤òÊÖ¤¹¡£ +¤³¤ì¤Ï +.B QM_DEPS +¤ÈµÕ¤Îµ¡Ç½¤Ç¤¢¤ë¡£ +¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎ󤬽ç¤ËÆþ¤ë¡£ +ÊÖ¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡ +.I ret +¤Ë¤Ï¥â¥¸¥å¡¼¥ë¤Î¿ô¤¬ÀßÄꤵ¤ì¤ë¡£ +.\" ret is set on ENOSPC +.TP +.B QM_SYMBOLS +.\"O Returns the symbols and values exported by the kernel or the indicated +.\"O module. +.\"O The returned buffer is an array of structures of the following form +¥«¡¼¥Í¥ë¤Þ¤¿¤Ï»ØÄꤵ¤ì¤¿¥â¥¸¥å¡¼¥ë¤¬¥¨¥¯¥¹¥Ý¡¼¥È¤·¤Æ¤¤¤ë¥·¥ó¥Ü¥ë¤È +ÃͤòÊÖ¤¹¡£ +¥Ð¥Ã¥Õ¥¡¤Î¥Ç¡¼¥¿¤Ï¡¢ +°Ê²¼¤Î¹½Â¤ÂΤÎÇÛÎó¤Ë NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤¬Â³¤¯·Á¤È¤Ê¤ë¡£ +.\" ret is set on ENOSPC +.in +4n +.nf + +struct module_symbol { + unsigned long value; + unsigned long name; +}; +.fi +.in +.IP +.\"O followed by null-terminated strings. +.\"O The value of +.\"O .I name +.\"O is the character offset of the string relative to the start of +.\"O .IR buf ; +.\"O .I ret +.\"O is set to the number of symbols. +.I name +¤ÎÃͤϡ¢ +.I buf +¤ÎÀèƬ¤«¤é¤Îʸ»úÎó¤Þ¤Ç¤Î¥ª¥Õ¥»¥Ã¥Èʸ»ú¿ô¤Ç¤¢¤ë¡£ +.I ret +¤Ë¤Ï¥·¥ó¥Ü¥ë¤Î¿ô¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +.B QM_INFO +.\"O Returns miscellaneous information about the indicated module. +.\"O The output buffer format is: +»ØÄꤵ¤ì¤¿¥â¥¸¥å¡¼¥ë¤Ë´Ø¤¹¤ëÍÍ¡¹¤Ê¾ðÊó¤òÊÖ¤¹¡£ +½ÐÎϥХåե¡¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï°Ê²¼¤Î·Á¼°¤È¤Ê¤ë: +.in +4n +.nf + +struct module_info { + unsigned long address; + unsigned long size; + unsigned long flags; +}; +.fi +.in +.IP +.\"O where +.\"O .I address +.\"O is the kernel address at which the module resides, +.\"O .I size +.\"O is the size of the module in bytes, and +.\"O .I flags +.\"O is a mask of +.\"O .BR MOD_RUNNING , +.\"O .BR MOD_AUTOCLEAN , +.\"O etc. that indicates the current status of the module +.\"O (see the kernel source file +.\"O .IR include/linux/module.h ). +.\"O .I ret +.\"O is set to the size of the +.\"O .I module_info +.\"O structure. +.I address +¤Ï¤½¤Î¥â¥¸¥å¡¼¥ë¤¬ÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¥«¡¼¥Í¥ë¶õ´Ö¾å¤Î¥¢¥É¥ì¥¹¡¢ +.I size +¤Ï¤½¤Î¥â¥¸¥å¡¼¥ë¤Î¥Ð¥¤¥Èñ°Ì¤Î¥µ¥¤¥º¡¢ +.I flags +¤Ï +.BR MOD_RUNNING , +.B MOD_AUTOCLEAN +Åù¤Î¥Þ¥¹¥¯¤Ç¤¢¤ê¡¢¤½¤Î¥â¥¸¥å¡¼¥ë¤Î¸½ºß¤Î¾õÂÖ¤ò¼¨¤¹ +(¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë +.I include/linux/module.h +¤ò»²¾È)¡£ +.I ret +¤Ë¤Ï +.I module_info +¹½Â¤ÂΤΥµ¥¤¥º¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"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 EFAULT +.\"O At least one of +.\"O .IR name , +.\"O .IR buf , +.\"O or +.\"O .I ret +.\"O was outside the program's accessible address space. +.IR name , +.IR buf , +.I ret +¤Î¾¯¤Ê¤¯¤È¤â°ì¤Ä¤¬¡¢¥×¥í¥°¥é¥à¤¬¥¢¥¯¥»¥¹¤Ç¤­¤ë +¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤Ç¤¢¤Ã¤¿¡£ +.TP +.B EINVAL +.\"O Invalid +.\"O .IR which ; +.\"O or +.\"O .I name +.\"O is NULL (indicating "the kernel"), +.\"O but this is not permitted with the specified value of +.\"O .IR which . +.I which +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£¤¢¤ë¤¤¤Ï +.I name +¤¬ NULL ¤À¤¬ (NULL ¤Ï "¥«¡¼¥Í¥ë" ¤ò¼¨¤¹)¡¢ +.I which +¤Ç»ØÄꤵ¤ì¤¿ÃͤȤÎÁȤ߹ç¤ï¤»¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" Not permitted with QM_DEPS, QM_REFS, or QM_INFO. +.TP +.B ENOENT +.\"O No module by that +.\"O .I name +.\"O exists. +.I name +¤È¤¤¤¦Ì¾Á°¤Î¥â¥¸¥å¡¼¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOSPC +.\"O The buffer size provided was too small. +.\"O .I ret +.\"O is set to the minimum size needed. +Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤¬¾®¤µ¤¹¤®¤ë¡£ +.I ret +¤Ë¤ÏºÇ¾®¸ÂɬÍפʥХåե¡¤Î¥µ¥¤¥º¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +.B ENOSYS +.\"O .BR query_module () +.\"O is not supported in this version of the kernel. +.BR query_module () +¤Ï¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR query_module () +.\"O is Linux-specific. +.BR query_module () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O This system call is only present on Linux up until kernel 2.4; +.\"O it was removed in Linux 2.6. +.\"O .\" Removed in Linux-2.5.48 +.\"O Some of the information that was available via +.\"O .BR query_module () +.\"O can be obtained from +.\"O .IR /proc/modules , +.\"O .IR /proc/kallsyms , +.\"O and +.\"O .IR /sys/modules . +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¤Î¤Ï¥«¡¼¥Í¥ë 2.4 ¤Þ¤Ç¤Î Linux ¤À¤±¤Ç¤¢¤ë¡£ +Linux 2.6 ¤Ç¤Ïºï½ü¤µ¤ì¤¿¡£ +.\" Removed in Linux 2.5.48 +.BR query_module () +¤ÇÆÀ¤é¤ì¤¿¾ðÊó¤Î¤¤¤¯¤Ä¤«¤Ï¡¢ +.IR /proc/modules , +.IR /proc/kallsyms , +.I /sys/modules +¤«¤é¼èÆÀ¤Ç¤­¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR create_module (2), +.BR delete_module (2), +.BR get_kernel_syms (2), +.BR init_module (2) diff --git a/draft/man2/quotactl.2 b/draft/man2/quotactl.2 new file mode 100644 index 00000000..7a64a996 --- /dev/null +++ b/draft/man2/quotactl.2 @@ -0,0 +1,348 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1996 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. +.\" +.\" FIXME There is much that is missing and/or out of date in this page. +.\" (There is a quotactl.2 page in the quotactl package that seems to +.\" have more info than this page.) +.\" As things stand the page more or less documents Linux 2.2 reality: +.\" +.\" Linux 2.2 has: +.\" +.\" Q_GETQUOTA +.\" Q_GETSTATS +.\" Q_QUOTAOFF +.\" Q_QUOTAON +.\" Q_RSQUASH (not currently documented) +.\" Q_SETQLIM +.\" Q_SETQUOTA +.\" Q_SETUSE +.\" Q_SYNC +.\" +.\" Linux 2.4 has: +.\" +.\" Q_COMP_QUOTAOFF +.\" Q_COMP_QUOTAON +.\" Q_COMP_SYNC +.\" Q_GETFMT +.\" Q_GETINFO +.\" Q_GETQUOTA +.\" Q_QUOTAOFF +.\" Q_QUOTAON +.\" Q_SETINFO +.\" Q_SETQUOTA +.\" Q_SYNC +.\" Q_V1_GETQUOTA Q_V1_GETSTATS Q_V1_RSQUASH Q_V1_SETQLIM +.\" Q_V1_SETQUOTA Q_V1_SETUSE +.\" Q_V2_GETINFO Q_V2_GETQUOTA Q_V2_SETFLAGS Q_V2_SETGRACE +.\" Q_V2_SETINFO Q_V2_SETQUOTA Q_V2_SETUSE +.\" Q_XGETQSTAT Q_XGETQUOTA Q_XQUOTAOFF Q_XQUOTAON Q_XQUOTARM +.\" Q_XSETQLIM +.\" +.\" Linux 2.6.16 has: +.\" +.\" Q_GETFMT +.\" Q_GETINFO +.\" Q_GETQUOTA +.\" Q_QUOTAOFF +.\" Q_QUOTAON +.\" Q_SETINFO +.\" Q_SETQUOTA +.\" Q_SYNC +.\" Q_XGETQSTAT +.\" Q_XGETQUOTA +.\" Q_XQUOTAOFF +.\" Q_XQUOTAON +.\" Q_XQUOTARM +.\" Q_XQUOTASYNC +.\" Q_XSETQLIM +.\" +.\" Japanese Version Copyright (c) 1997 Kazuyoshi Furutaka +.\" all rights reserved. +.\" Translated Sun Dec 21 21:58:06 JST 1997 +.\" by Kazuyoshi Furutaka +.\" Modified Wed Dec 24 22:17:00 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Thu Feb 24 02:50:48 JST 2005 +.\" by Yuichi SATO +.\" +.TH QUOTACTL 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O quotactl \- manipulate disk quota +quotactl \- ¥Ç¥£¥¹¥¯ quota ¤òÁàºî¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "int quotactl(int " cmd ", const char *" special ", int " id \ +", caddr_t " addr ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The quota system defines for each user and/or group a soft limit +.\"O and a hard limit bounding the amount of disk space that can be +.\"O used on a given file system. +.\"O The hard limit cannot be crossed. +.\"O The soft limit can be crossed, but warnings will ensue. +.\"O Moreover, +.\"O the user cannot be above the soft limit for more than one week (by default) +.\"O at a time: after this week the soft limit counts as hard limit. +quota ¥·¥¹¥Æ¥à¤Ï¡¢³Æ¡¹¤Î¥æ¡¼¥¶µÚ¤Ó/¤Þ¤¿¤Ï¥°¥ë¡¼¥×¤ËÂФ·¤Æ¡¢ +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥ÈµÚ¤Ó¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤òÄê¤á¤ë¡£¤³¤ì¤Ï¤¢¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç +»ÈÍѤ¹¤ë»ö¤¬½ÐÍè¤ë¥Ç¥£¥¹¥¯ÍÆÎ̤òÀ©¸Â¤¹¤ë¡£ +¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ÏĶ²á¤¹¤ë¤³¤È¤Ï½ÐÍè¤Ê¤¤¡£ +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤ÏĶ²á¤¹¤ë»ö¤¬½ÐÍè¤ë¤¬¡¢·Ù¹ð¤¬È¯¤»¤é¤ì¤ë¡£ +¹¹¤Ë¡¢(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï) °ì½µ´Ö°Ê¾å¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤òĶ²á¤·¤¿¤Þ¤Þ¤Ë +¤·¤Æ¤ª¤¯»ö¤Ï¤Ç¤­¤Ê¤¤: °ì½µ´Ö·Ð²á¤·¤¿¸å¤Ï¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤òĶ²á¤·¤¿¤È +¤ß¤Ê¤µ¤ì¤ë¡£ + +.\"O The +.\"O .BR quotactl () +.\"O system call manipulates these quota. +.\"O Its first argument is +.\"O of the form +.\"O .BI QCMD( subcmd , type ) +.\"O where +.\"O .I type +.\"O is either +.\"O .B USRQUOTA +.\"O or +.\"O .B GRPQUOTA +.\"O (for user quota and group quota, respectively), and +.\"O .I subcmd +.\"O is described below. +.BR quotactl () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤³¤ì¤é¤Î quota ¤ËÂФ¹¤ëÁàºî¤ò¹Ô¤Ê¤¦¡£ +ºÇ½é¤Î°ú¤­¿ô¤Ï +.BI QCMD( subcmd , type ) +¤È¤¤¤¦·Á¼°¤Ç¤¢¤ë¡£ +.I type +¤Ë¤Ï¡¢¥æ¡¼¥¶¡¼ quota ¤Ë¤Ä¤¤¤Æ¤Ï +.B USRQUOTA +¤ò¡¢¥°¥ë¡¼¥× quota ¤Ë¤Ä¤¤¤Æ¤Ï +.B GRPQUOTA +¤ò»ØÄꤹ¤ë¡£ +.I subcmd +¤Ï°Ê²¼¤ÇÀâÌÀ¤¹¤ë¡£ + +.\"O The second argument +.\"O .I special +.\"O is the block special device these quota apply to. +.\"O It must be mounted. +ÆóÈÖÌܤΰú¤­¿ô +.I special +¤Ï quota ¤òŬÍѤ¹¤ë¥Ç¥Ð¥¤¥¹¤Î¥Ö¥í¥Ã¥¯¡¦¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +¤½¤Î¥Ç¥Ð¥¤¥¹¤Ï¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +.\"O The third argument +.\"O .I id +.\"O is the user or group ID these quota apply to (when relevant). +»°ÈÖÌܤΰú¤­¿ô +.I id +¤Ë¤Ï¡¢(ɬÍפʾì¹ç¤Ë) quota ¤òŬÍѤ¹¤ë¥æ¡¼¥¶¡¼¤â¤·¤¯¤Ï¥°¥ë¡¼¥×¤Î ID ¤ò»ØÄꤹ¤ë¡£ + +.\"O The fourth argument +.\"O .I addr +.\"O is the address of a data structure, depending on the command. +»ÍÈÖÌܤΰú¤­¿ô +.I addr +¤Ë¤Ï¡¢¥³¥Þ¥ó¥É¤´¤È¤Ë°Û¤Ã¤¿¥Ç¡¼¥¿¹½Â¤ÂΤΥ¢¥É¥ì¥¹¤ò»ØÄꤹ¤ë¡£ + +.\"O The +.\"O .I subcmd +.\"O is one of +.I subcmd +¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë +.TP 1.1i +.B Q_QUOTAON +.\"O Enable quota. +.\"O The +.\"O .I addr +.\"O argument is the pathname of the file containing +.\"O the quota for the file system. +quota ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.I addr +°ú¤­¿ô¤Ë¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î quota ¤¬µ­Ï¿¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Î +¥Ñ¥¹Ì¾¤ò»ØÄꤹ¤ë¡£ +.TP +.B Q_QUOTAOFF +.\"O Disable quota. +quota ¤ò̵¸ú¤Ë¤¹¤ë¡£ +.TP +.B Q_GETQUOTA +.\"O Get limits and current usage of disk space. +.\"O The +.\"O .I addr +.\"O argument is a pointer to a dqblk structure (defined in +.\"O .IR ). +¥Ç¥£¥¹¥¯»ÈÍÑÎ̤ÎÀ©¸ÂÃͤȸ½ºß¤Î»ÈÍÑÎ̤òÆÀ¤ë¡£ +.I addr +°ú¤­¿ô¤Ï +.RI ( +¤ÇÄêµÁ¤µ¤ì¤¿) dqblk ¹½Â¤ÂΤò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.TP +.B Q_SETQUOTA +.\"O Set limits and current usage; +.\"O .I addr +.\"O is as before. +À©¸ÂÃͤȸ½ºß¤Î»ÈÍÑÎ̤òÀßÄꤹ¤ë: +.I addr +¤ÏƱ¾å¡£ +.TP +.B Q_SETQLIM +.\"O Set limits; +.\"O .I addr +.\"O is as before. +À©¸ÂÃͤòÀßÄꤹ¤ë; +.I addr +¤ÏƱ¾å¡£ +.TP +.B Q_SETUSE +.\"O Set usage. +»ÈÍÑÎ̤òÀßÄꤹ¤ë¡£ +.TP +.B Q_SYNC +.\"O Sync disk copy of a file system's quota. +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î quota ¥Õ¥¡¥¤¥ë¤ò¥Ç¥£¥¹¥¯¤ÈƱ´ü¤µ¤»¤ë¡£ +.TP +.B Q_GETSTATS +.\"O Get collected stats. +¼ý½¸¤µ¤ì¤¿Åý·×¤ò¼èÆÀ¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR quotactl () +.\"O returns 0. +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +.BR quotactl () +¤Ï¡¢À®¸ù»þ¤Ë¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼»þ¤Ï¡¢\-1 ¤òÊÖ¤¹¤È¤È¤â¤Ë¡¢ +.I errno +¤¬Å¬ÀÚ¤ÊÃͤËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP 0.9i +.B EACCES +.\"O The quota file is not an ordinary file. +quota ¥Õ¥¡¥¤¥ë¤¬ÉáÄ̤Υե¡¥¤¥ë¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EBUSY +.\"O .B Q_QUOTAON +.\"O was asked, but quotas were enabled already. +.B Q_QUOTAON +¤ÎÍ׵᤬¤Ê¤µ¤ì¤¿¤¬¡¢quota(s) ¤Ï´û¤ËÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.TP +.B EFAULT +.\"O Bad +.\"O .I addr +.\"O value. +.I addr +¤ÎÃͤ˸í¤ê¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.\"O .I type +.\"O is not a known quota type. +.\"O Or, +.\"O .I special +.\"O could not be found. +.I type +¤¬´ûÃΤΠquota ¤Î·Á¼°¤Ç¤Ï¤Ê¤¤¡£¤â¤·¤¯¤Ï¡¢ +.I special +¥Ç¥Ð¥¤¥¹¤¬¸«ÉÕ¤«¤é¤Ê¤«¤Ã¤¿¡£ +.TP +.B EIO +.\"O Cannot read or write the quota file. +quota ¥Õ¥¡¥¤¥ë¤Ø¤ÎÆɤ߽ñ¤­¤¬½ÐÍè¤Ê¤¤¡£ +.TP +.B EMFILE +.\"O Too many open files: cannot open quota file. +¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤¹¤®¤Æ¤¤¤ë: quota ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó½ÐÍè¤Ê¤¤¡£ +.TP +.B ENODEV +.\"O .I special +.\"O cannot be found in the mount table. +.I special +¤¬¥Þ¥¦¥ó¥È¡¦¥Æ¡¼¥Ö¥ëÆâ¤Ë¸«Åö¤¿¤é¤Ê¤¤¡£ +.TP +.B ENOPKG +.\"O The kernel was compiled without quota support. +quota ¤ò»ÈÍѲĤˤ·¤Æ¥«¡¼¥Í¥ë¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTBLK +.\"O .I special +.\"O is not a block special device. +.I special +¤¬¥Ö¥í¥Ã¥¯¡¦¥¹¥Ú¥·¥ã¥ë¡¦¥Ç¥Ð¥¤¥¹¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EPERM +.\"O The process was not root (for the file system), and +.\"O .B Q_GETQUOTA +.\"O was asked for another +.\"O .I id +.\"O than that of the process itself, or anything other than +.\"O .B Q_GETSTATS +.\"O or +.\"O .B Q_SYNC +.\"O was asked. +¥×¥í¥»¥¹¤¬ (¤½¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î) root ¤Î¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¤«¤Ä¥×¥í¥»¥¹¼«¿È¤Î¤â¤Î¤È¤Ï°Û¤Ê¤ë +.I id +¤ËÂФ·¤Æ +.B Q_GETQUOTA +Í×µá¤ò¹Ô¤Ê¤Ã¤¿¡£ +¤â¤·¤¯¤Ï¡¢ +.BR Q_GETSTATS , +.B Q_SYNC +°Ê³°¤ÎÍ׵᤬¤Ê¤µ¤ì¤¿¡£ +.TP +.B ESRCH +.\"O .B Q_GETQUOTA +.\"O or +.\"O .B Q_SETQUOTA +.\"O or +.\"O .B Q_SETUSE +.\"O or +.\"O .B Q_SETQLIM +.\"O was asked for a file system that didn't have quota enabled. +quota ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ËÂФ·¤Æ +.BR Q_GETQUOTA , +.BR Q_SETQUOTA , +.BR Q_SETUSE , +.B Q_SETQLIM +¤Î¤¤¤º¤ì¤«¤ÎÍ׵᤬¤Ê¤µ¤ì¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +BSD. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR quota (1), +.BR getrlimit (2), +.BR setrlimit (2), +.BR ulimit (3), +.BR quotacheck (8), +.BR quotaon (8) diff --git a/draft/man2/read.2 b/draft/man2/read.2 new file mode 100644 index 00000000..45ff7573 --- /dev/null +++ b/draft/man2/read.2 @@ -0,0 +1,324 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 Sat Jul 24 00:06:00 1993 by Rik Faith +.\" Modified Wed Jan 17 16:02:32 1996 by Michael Haardt +.\" +.\" Modified Thu Apr 11 19:26:35 1996 by Andries Brouwer +.\" Modified Sun Jul 21 18:59:33 1996 by Andries Brouwer +.\" Modified Fri Jan 31 16:47:33 1997 by Eric S. Raymond +.\" Modified Sat Jul 12 20:45:39 1997 by Michael Haardt +.\" +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Modified 1997-09-28, HANATAKA Shinya +.\" Updated & Modified 2005-02-24, Yuichi SATO +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2005-10-14, Akihiro MOTOKI +.\" Updated 2008-02-10, Akihiro MOTOKI, LDP v2.77 +.\" Updated 2009-04-13, Akihiro MOTOKI, LDP v3.20 +.\" +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡¡¼ +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: process group ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× +.\"WORD: backgraound ¥Ð¥Ã¥¯¥°¥é¥ó¥É +.\"WORD: orphan ¸ÉΩ +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: object ¥ª¥Ö¥¸¥§¥¯¥È +.\" +.TH READ 2 2009-02-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O read \- read from a file descriptor +read \- ¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤«¤éÆɤ߹þ¤à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "ssize_t read(int " fd ", void *" buf ", size_t " count ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR read () +.\"O attempts to read up to +.\"O .I count +.\"O bytes from file descriptor +.\"O .I fd +.\"O into the buffer starting at +.\"O .IR buf . +.BR read () +¤Ï¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ (file descriptor) +.I fd +¤«¤éºÇÂç +.I count +¥Ð¥¤¥È¤ò +.I buf +¤Ç»Ï¤Þ¤ë¥Ð¥Ã¥Õ¥¡¡¼¤ØÆɤ߹þ¤â¤¦¤È¤¹¤ë¡£ +.PP +.\"O If +.\"O .I count +.\"O is zero, +.\"O .BR read () +.\"O returns zero and has no other results. +.\"O If +.\"O .I count +.\"O is greater than +.\"O .BR SSIZE_MAX , +.\"O the result is unspecified. +.I count +¤¬ 0 ¤Ê¤é¤Ð¡¢ +.BR read () +¤Ï 0 ¤òÊÖ¤·¡¢Â¾¤Ë²¿¤âµ¯¤­¤Ê¤¤¡£ +.I count +¤¬ +.B SSIZE_MAX +¤è¤êÂ礭¤±¤ì¤Ð¡¢·ë²Ì¤ÏÆÃÄê¤Ç¤­¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, the number of bytes read is returned (zero indicates end of +.\"O file), and the file position is advanced by this number. +.\"O It is not an error if this number is smaller than the number of bytes +.\"O requested; this may happen for example because fewer bytes are actually +.\"O available right now (maybe because we were close to end-of-file, or +.\"O because we are reading from a pipe, or from a terminal), or because +.\"O .BR read () +.\"O was interrupted by a signal. +À®¸ù¤·¤¿¾ì¹ç¡¢Æɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÊÖ¤¹ (0 ¤Ï¥Õ¥¡¥¤¥ë¤Î½ª¤ê¤ò°ÕÌ£¤¹¤ë)¡£ +¥Õ¥¡¥¤¥ë°ÌÃ֤Ϥ³¤Î¿ô¤À¤±¿Ê¤á¤é¤ì¤ë¡£ +¤³¤Î¿ô¤¬Í׵ᤷ¤¿¿ô¤è¤ê¾®¤µ¤«¤Ã¤¿¤È¤·¤Æ¤â¥¨¥é¡¼¤Ç¤Ï¤Ê¤¤; +Î㤨¤Ðº£¤¹¤°¤Ë¤Ï¼ÂºÝ¤Ë¤½¤ì¤À¤±¤Î¿ô¤·¤«¤Ê¤¤¾ì¹ç (¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë¶á¤¤¤Î¤«¤â +¤·¤ì¤Ê¤¤¤·¡¢¥Ñ¥¤¥× (pipe) ¤äüËö (terminal) ¤«¤éÆɤ߹þ¤ó¤Ç¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤) ¤ä +.BR read () +¤¬¥·¥°¥Ê¥ë (signal) ¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¤Ë¤³¤ì¤Ïµ¯¤³¤ê¤¨¤ë¡£ +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +.\"O In this case it is left unspecified whether +.\"O the file position (if any) changes. +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£¤³¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë°ÌÃÖ¤¬Êѹ¹¤µ¤ì¤ë¤«¤É¤¦¤«¤Ï +ÉÔÄê¤Ç¤¢¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.\"O The file descriptor +.\"O .I fd +.\"O refers to a file other than a socket and has been marked nonblocking +.\"O .RB ( O_NONBLOCK ), +.\"O and the read would block. +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.I fd +¤¬¥½¥±¥Ã¥È°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤Æ¡¢ +ÈóÄä»ß (nonblocking) ¥â¡¼¥É +.RB ( O_NONBLOCK ) +¤ËÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢Æɤ߹þ¤ß¤ò¹Ô¤¦¤ÈÄä»ß¤¹¤ë¾õ¶·¤Ë¤¢¤ë¡£ +.TP +.\"O .BR EAGAIN " or " EWOULDBLOCK +.BR EAGAIN " ¤Þ¤¿¤Ï " EWOULDBLOCK +.\" Actually EAGAIN on Linux +.\"O The file descriptor +.\"O .I fd +.\"O refers to a socket and has been marked nonblocking +.\"O .RB ( O_NONBLOCK ), +.\"O and the read 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. +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.I fd +¤¬¥½¥±¥Ã¥È¤ò»²¾È¤·¤Æ¤¤¤Æ¡¢ÈóÄä»ß (nonblocking) ¥â¡¼¥É +.RB ( O_NONBLOCK ) +¤ËÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢Æɤ߹þ¤ß¤ò¹Ô¤¦¤ÈÄä»ß¤¹¤ë¾õ¶·¤Ë¤¢¤ë¡£ +POSIX.1-2001 ¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¤É¤Á¤é¤Î¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤âǧ¤á¤Æ¤ª¤ê¡¢ +¤³¤ì¤é 2 ¤Ä¤ÎÄê¿ô¤¬Æ±¤¸Ãͤò»ý¤Ä¤³¤È¤âµá¤á¤Æ¤¤¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢Î¾Êý¤Î²ÄǽÀ­¤ò +³Îǧ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B EBADF +.\"O .I fd +.\"O is not a valid file descriptor or is not open for reading. +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ê¤¤¤«¡¢Æɤ߹þ¤ß¤Î¤¿¤á¤Ë +¥ª¡¼¥×¥ó (open) ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +.\"O .I buf +.\"O is outside your accessible address space. +.I buf +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Ë¤¢¤ë¡£ +.TP +.B EINTR +.\"O The call was interrupted by a signal before any data was read; see +.\"O .BR signal (7). +²¿¤Î¥Ç¡¼¥¿¤âÆɤ߹þ¤Þ¤Ê¤¤¤¦¤Á¤Ë¥·¥°¥Ê¥ë¤Ë³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.\"O .I fd +.\"O is attached to an object which is unsuitable for reading; +.\"O or the file was opened with the +.\"O .B O_DIRECT +.\"O flag, and either the address specified in +.\"O .IR buf , +.\"O the value specified in +.\"O .IR count , +.\"O or the current file offset is not suitably aligned. +.I fd +¤ÏÆɤ߹þ¤ß¤ËŬ¤·¤Æ¤¤¤Ê¤¤¥ª¥Ö¥¸¥§¥¯¥È¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +¤â¤·¤¯¤Ï¡¢¥Õ¥¡¥¤¥ë¤¬ +.B O_DIRECT +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +.I buf +¤Ë»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¡¢ +.I count +¤Ë»ØÄꤵ¤ì¤¿ÃÍ¡¢ +¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Î¤¤¤º¤ì¤«¤Î +¥¢¥é¥¤¥ó¥á¥ó¥È¤¬ÉÔŬÀڤǤ¢¤ë¡£ +.TP +.B EINVAL +.\"O .I fd +.\"O was created via a call to +.\"O .BR timerfd_create (2) +.\"O and the wrong size buffer was given to +.\"O .BR read (); +.\"O see +.\"O .BR timerfd_create (2) +.\"O for further information. +.I fd +¤¬ +.BR timerfd_create (2) +¤Î¸Æ¤Ó½Ð¤·¤ÇºîÀ®¤µ¤ì¤¿¤¬¡¢ +.BR read () +¤Ë´Ö°ã¤Ã¤¿¥µ¥¤¥º¤Î¥Ð¥Ã¥Õ¥¡¤¬ÅϤµ¤ì¤¿¡£ +¤µ¤é¤Ê¤ë¾ðÊó¤Ï +.BR timerfd_create (2) +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B EIO +.\"O I/O error. +.\"O This will happen for example when the process is in a +.\"O background process group, tries to read from its controlling tty, +.\"O and either it is ignoring or blocking +.\"O .B SIGTTIN +.\"O or its process group +.\"O is orphaned. +.\"O It may also occur when there is a low-level I/O error +.\"O while reading from a disk or tape. +I/O ¥¨¥é¡¼¡£¤³¤ì¤ÏÎ㤨¤Ð¥×¥í¥»¥¹¤¬¥Ð¥Ã¥¯¥°¥é¥ó¥É¡¦¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Ç¡¢ +¤½¤ì¤òÀ©¸æ¤·¤Æ¤¤¤ë tty ¤«¤éÆɤ߹þ¤â¤¦¤È¤·¡¢ +.B SIGTTIN +¤¬Ìµ»ë (ignore) ¤Þ¤¿¤Ï¶Ø»ß (blocking) ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤ä¡¢ +¤½¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤¬¸ÉΩ (orphan) ¤·¤Æ¤¤¤ë¾ì¹ç¤Ëµ¯¤³¤ë¡£ +¤Þ¤¿¥Ç¥£¥¹¥¯¤ä¥Æ¡¼¥×¤òÆɤó¤Ç¤¤¤ë»þ¤ËÄã¥ì¥Ù¥ë I/O ¥¨¥é¡¼ +¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤âµ¯¤³¤ë¡£ +.TP +.B EISDIR +.\"O .I fd +.\"O refers to a directory. +.I fd +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.PP +.\"O Other errors may occur, depending on the object connected to +.\"O .IR fd . +.I fd +¤¬Àܳ¤·¤Æ¤¤¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤è¤Ã¤Æ¤Ï¾¤Î¥¨¥é¡¼¤âµ¯¤³¤ê¤¨¤ë¡£ +.\"O POSIX allows a +.\"O .BR read () +.\"O that is interrupted after reading some data +.\"O to return \-1 (with +.\"O .I errno +.\"O set to +.\"O .BR EINTR ) +.\"O or to return the number of bytes already read. +POSIX ¤Ç¤Ï¡¢ +¤¤¤¯¤é¤«¤Î¥Ç¡¼¥¿¤òÆɤó¤À¸å¤Ë³ä¤ê¹þ¤ß¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.BR read () +¤Ï +.RI ( errno +¤Ë +.B EINTR +¤òÀßÄꤷ¤Æ) \-1 ¤òÊÖ¤·¤Æ¤â¤è¤¤¤·¡¢ +´û¤ËÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÊÖ¤·¤Æ¤â¤è¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O On NFS file systems, reading small amounts of data will only update the +.\"O timestamp the first time, subsequent calls may not do so. +.\"O This is caused +.\"O by client side attribute caching, because most if not all NFS clients +.\"O leave st_atime (last file access time) +.\"O updates to the server and client side reads satisfied from the +.\"O client's cache will not cause st_atime updates on the server as there are no +.\"O server side reads. +.\"O Unix semantics can be obtained by disabling client +.\"O side attribute caching, but in most situations this will substantially +.\"O increase server load and decrease performance. +NFS ¤Ë¤ª¤¤¤Æ¡£¾¯Î̤Υǡ¼¥¿¤òÆɤ߹þ¤à¾ì¹ç¡¢ºÇ½é¤Î»þ¤Î¤ß¤Ë¥¿¥¤¥à +¥¹¥¿¥ó¥×¤¬¹¹¿·¤µ¤ì¡¢Â³¤¯¥³¡¼¥ë¤Ç¤Ï¹¹¿·¤µ¤ì¤Ê¤¤¤À¤í¤¦¡£ +¤³¤ì¤Ï¥¯¥é¥¤¥¢¥ó¥È¦¤Ç°À­¤Î¥­¥ã¥Ã¥·¥ó¥°¤ò¹Ô¤Ê¤¦¤¿¤á¤Ç¤¢¤ë¡£ +¤Ê¤¼¤Ê¤é¤Ð¡¢¤â¤·Á´¤Æ¤Î NFS ¥¯¥é¥¤¥¢¥ó¥È¤¬ st_atime (ºÇ½ª¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹»þ¹ï) +¤Î¹¹¿·¤ò¥µ¡¼¥Ð¡¼¤ËÁ÷¤é¤º¡¢¥¯¥é¥¤¥¢¥ó¥È¦¤Ç¥­¥ã¥Ã¥·¥å¤òÆɤळ¤È¤ËËþ­¤·¤Æ +¤¤¤ì¤Ð¡¢¥µ¡¼¥Ð¡¼Â¦¤Ç¤Î read ¤ÏȯÀ¸¤·¤Ê¤¤¤Î¤Ç st_atime ¤Î¹¹¿·¤Ï¹Ô¤Ê¤ï¤ì¤«¤é¤À¡£ +Unix ¤ÎÊý¼°¤Ç¤Ï¡¢¥¯¥é¥¤¥¢¥ó¥È¦¤Î°À­¤Î¥­¥ã¥Ã¥·¥ó¥°¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤Ç¡¢ +¤³¤ì¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤·¤«¤·¤Û¤È¤ó¤É¤Î¾õ¶·¤Ç¤Ï¤³¤ì¤Ï³¤¯¥µ¡¼¥Ð¡¼¤Î +Éé²Ù¤òÁý²Ã¤µ¤»¡¢¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ÎÄã²¼¤ò¤â¤¿¤é¤¹¡£ +.PP +.\"O Many file systems and disks were considered to be fast enough that the +.\"O implementation of +.\"O .B O_NONBLOCK +.\"O was deemed unnecessary. +.\"O So, +.\"O .B O_NONBLOCK +.\"O may not be available on files +.\"O and/or disks. +¿¤¯¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ä¥Ç¥£¥¹¥¯¤Ï +.B O_NONBLOCK +¤Î¼ÂÁõ¤Ï¤·¤Ê¤¯¤Æ¤âºÑ¤à¤¯¤é¤¤¤Ë½½Ê¬¤Ë¹â®¤Ç¤¢¤ë¤È¹Í¤¨¤é¤ì¤Æ¤¤¤ë¡£ +¤½¤ì¤Ç¤½¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥¹¥¯¤Ë¤Ï +.B O_NONBLOCK +¤ÏÍøÍѤǤ­¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR fcntl (2), +.BR ioctl (2), +.BR lseek (2), +.BR open (2), +.BR pread (2), +.BR readdir (2), +.BR readlink (2), +.BR readv (2), +.BR select (2), +.BR write (2), +.BR fread (3) diff --git a/draft/man2/readahead.2 b/draft/man2/readahead.2 new file mode 100644 index 00000000..e21c780b --- /dev/null +++ b/draft/man2/readahead.2 @@ -0,0 +1,153 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 2004, 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. +.\" +.\" 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 ¥Õ¥¡¥¤¥ëµ­½Ò»Ò +.\" +.TH READAHEAD 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O readahead \- perform file readahead into page cache +readahead \- Á°¤â¤Ã¤Æ¥Õ¥¡¥¤¥ë¤ò¥Ú¡¼¥¸¡¦¥­¥ã¥Ã¥·¥å¤ËÆɤ߹þ¤à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "ssize_t readahead(int " fd ", off64_t " offset ", size_t " count ); +.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 +¤Ç»²¾È¤µ¤ì¤¿¥ª¡¼¥×¥óºÑ¤Î¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Î¸½ºßÃÍ¤Ï +Êѹ¹¤µ¤ì¤Ê¤¤¡£ +.\"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 +.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 +.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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR lseek (2), +.BR madvise (2), +.BR mmap (2), +.BR posix_fadvise (2), +.BR read (2) diff --git a/draft/man2/readdir.2 b/draft/man2/readdir.2 new file mode 100644 index 00000000..61681e94 --- /dev/null +++ b/draft/man2/readdir.2 @@ -0,0 +1,195 @@ +.\" 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 : +.\" 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 ¥Ì¥ëʸ»ú +.\" +.TH READDIR 2 2008-10-02 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 ); +.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) +¤Ë¤è¤Ã¤Æ¼è¤Ã¤ÆÂå¤ï¤é¤ì¤¿¡£ +.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 +¹½Â¤ÂΤÎÆɤ߹þ¤ß¤Ë¤ª¤¤¤Æ)̵»ë¤µ¤ì¤ë +.PP +.\"O The +.\"O .I old_linux_dirent +.\"O structure is declared as follows: +.I old_linux_dirent +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤ë: +.PP +.in +4n +.nf +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) */ +} +.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 null terminator. +.\"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 +¤ÎÂ礭¤µ¤Ç¡¢ +¥Ì¥ëʸ»ú¤Î½ªÃ¼¤ò´Þ¤ó¤Ç¤¤¤Ê¤¤¡£ +.I d_name +¤Ï¥Ì¥ëʸ»ú¤Ç½ª¤ë¥Õ¥¡¥¤¥ë̾¤Ç¤¢¤ë¡£ +.\"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 +.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 ½àµò +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR getdents (2), +.BR readdir (3) diff --git a/draft/man2/readlink.2 b/draft/man2/readlink.2 new file mode 100644 index 00000000..638d4e13 --- /dev/null +++ b/draft/man2/readlink.2 @@ -0,0 +1,212 @@ +.\" 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. +.\" +.\" @(#)readlink.2 6.8 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 00:10:21 1993 by Rik Faith +.\" Modified Tue Jul 9 23:55:17 1996 by aeb +.\" Modified Fri Jan 24 00:26:00 1997 by aeb +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-12-12, HANATAKA Shinya +.\" Updated 2005-02-10, Yuichi SATO +.\" Updated 2006-07-19, Akihiro MOTOKI , LDP v2.36 +.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡¡¼ +.\"WORD: NUL ¥Ì¥ëʸ»ú +.\"WORD: global variable ¥°¥í¡¼¥Ð¥ëÊÑ¿ô +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\" +.TH READLINK 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O readlink \- read value of a symbolic link +readlink \- ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ÎÃͤòÆɤà +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "ssize_t readlink(const char *" path ", char *" buf ", size_t " bufsiz ); +.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 readlink (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _POSIX_C_SOURCE\ >=\ 200112L +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR readlink () +.\"O places the contents of the symbolic link +.\"O .I path +.\"O in the buffer +.\"O .IR buf , +.\"O which has size +.\"O .IR bufsiz . +.BR readlink () +¤Ï +.I path +¤ÇÍ¿¤¨¤é¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ÎÆâÍƤò +.I buf +¥Ð¥Ã¥Õ¥¡¡¼¤Ø³ÊǼ¤¹¤ë¡¢ +.I buf +¤Î¥µ¥¤¥º¤Ï +.I bufsiz +¤Ç¤¢¤ë¡£ +.\"O .BR readlink () +.\"O does not append a null byte to +.\"O .IR buf . +.BR readlink () +¤Ï NULL ¥Ð¥¤¥È¤ò +.I buf +¤ËÄɲ䷤ʤ¤¡£ +.\"O It will truncate the contents (to a length of +.\"O .I bufsiz +.\"O characters), in case the buffer is too small to hold all of the contents. +¤½¤ÎÆâÍÆÁ´¤Æ¤ò³ÊǼ¤¹¤ë¤Î¤Ë¥Ð¥Ã¥Õ¥¡¡¼¤¬¾®¤µ²á¤®¤ë¾ì¹ç¤Ï¡¢ +.RI ( bufsiz +¥Ð¥¤¥È¤ÎŤµ¤Ë) ÆâÍƤòÀÚ¤êµÍ¤á¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR readlink () +.\"O returns the number of bytes placed in +.\"O .IR buf . +.\"O On error, \-1 is returned and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR readlink () +¤Ï +.I buf +¤Ë³ÊǼ¤µ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O Search permission is denied for a component of the path prefix. +.\"O (See also +.\"O .BR path_resolution (7).) +¥Ñ¥¹¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Ë¸¡º÷µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EFAULT +.\"O .I buf +.\"O extends outside the process's allocated address space. +.I buf +¤¬¥×¥í¥»¥¹¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O .I bufsiz +.\"O is not positive. +.I bufsiz +¤¬Àµ¤Ç¤Ê¤¤¡£ +.\" At the glibc level, bufsiz is unsigned, so this error can only occur +.\" if bufsiz==0. However, the in the kernel syscall, bufsiz is signed, +.\" and this error can also occur if bufsiz < 0. +.\" See: http://thread.gmane.org/gmane.linux.man/380 +.\" Subject: [patch 0/3] [RFC] kernel/glibc mismatch of "readlink" syscall? +.TP +.B EINVAL +.\"O The named file is not a symbolic link. +»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤Ê¤¤¡£ +.TP +.B EIO +.\"O An I/O error occurred while reading from the file system. +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ÎÆɤ߹þ¤ßÃæ¤Ë I/O ¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B ELOOP +.\"O Too many symbolic links were encountered in translating the pathname. +¥Ñ¥¹Ì¾¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.\"O A pathname, or a component of a pathname, was too long. +¥Ñ¥¹Ì¾¤«¥Ñ¥¹Ì¾¤Î°ìÉôʬ¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +.\"O The named 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. +¥Ñ¥¹¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O 4.4BSD (the +.\"O .BR readlink () +.\"O function call appeared in 4.2BSD), +.\"O POSIX.1-2001. +4.4BSD +.RB ( readlink () +´Ø¿ô¥³¡¼¥ë¤Ï 4.2BSD ¤Ç¸½¤ï¤ì¤¿), POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O In versions of glibc up to and including glibc 2.4, the return type of +.\"O .BR readlink () +.\"O was declared as +.\"O .IR int . +.\"O Nowadays, the return type is declared as +.\"O .IR ssize_t , +.\"O as (newly) required in POSIX.1-2001. +¥Ð¡¼¥¸¥ç¥ó 2.4 °ÊÁ°¤Î glibc (¥Ð¡¼¥¸¥ç¥ó 2.4 ¤ò´Þ¤à) ¤Ç¤Ï¡¢ +.BR readlink () +¤ÎÊÖ¤êÃͤη¿¤Ï +.I int +¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤¿¡£¸½ºß¤Ç¤Ï¡¢ÊÖ¤êÃͤη¿¤Ï +.I ssize_t +¤Ç¤¢¤ë (ÊÖ¤êÃÍ +.I ssize_t +¤Ï POSIX.1-2001 ¤Ç (¿·¤¿¤Ë) ɬ¿Ü¤È¤Ê¤Ã¤¿)¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR lstat (2), +.BR readlinkat (2), +.BR stat (2), +.BR symlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/draft/man2/readlinkat.2 b/draft/man2/readlinkat.2 new file mode 100644 index 00000000..d391764a --- /dev/null +++ b/draft/man2/readlinkat.2 @@ -0,0 +1,195 @@ +.\" 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-09-27 by Yuichi SATO , LDP v2.39 +.\" +.TH READLINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O readlinkat \- read value of a symbolic link relative to +.\"O a directory file descriptor +readlinkat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ÎÃͤòÆɤà +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.\"O .B #include /* Definition of AT_* constants */ +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int readlinkat(int " dirfd ", const char *" pathname , +.BI " char *" buf ", size_t " bufsiz ); +.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 readlinkat (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.\"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) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.\"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) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.\"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) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I pathname +.\"O is absolute, then +.\"O .I dirfd +.\"O is ignored. +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.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 +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.\"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 () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR readlinkat () +.\"O was added to Linux in kernel 2.6.16. +.BR readlinkat () +¤Ï 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 readlinkat (). +.BR readlinkat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR openat (2), +.BR readlink (2), +.BR path_resolution (7) diff --git a/draft/man2/readv.2 b/draft/man2/readv.2 new file mode 100644 index 00000000..055ce226 --- /dev/null +++ b/draft/man2/readv.2 @@ -0,0 +1,385 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2007 Michael Kerrisk +.\" and 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 18:34:44 1993 by Rik Faith (faith@cs.unc.edu) +.\" Merged readv.[23], 2002-10-17, aeb +.\" 2007-04-30 mtk, A fairly major rewrite to fix errors and +.\" add more details. +.\" +.\" 1996-04-12 Tom Bjorkholm +.\" First version written +.\" Modified Tue Oct 22 17:41:07 1996 by Eric S. Raymond +.\" +.\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Updated 1999-04-03, HANATAKA Shinya +.\" Updated 2003-01-14, Akihiro MOTOKI +.\" Updated 2005-10-07, Akihiro MOTOKI +.\" Updated 2007-06-01, Akihiro MOTOKI, LDP v2.50 +.\" +.\"WORD: vector ¥Ù¥¯¥¿ (vector) +.\"WORD: file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡ +.\" +.TH READV 2 2002-10-17 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O readv, writev \- read or write data into multiple buffers +.SH ̾Á° +readv, writev \- Ê£¿ô¤Î¥Ð¥Ã¥Õ¥¡¤Ø¤ÎÆɤ߽ñ¤­¤ò¹Ô¤Ê¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "ssize_t readv(int " fd ", const struct iovec *" iov ", int " iovcnt ); +.sp +.BI "ssize_t writev(int " fd ", const struct iovec *" iov ", int " iovcnt ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR readv () +.\"O function reads +.\"O .I iovcnt +.\"O buffers from the file associated with the file descriptor +.\"O .I fd +.\"O into the buffers described by +.\"O .I iov +.\"O ("scatter input"). +.BR readv () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤«¤é¡¢ +.I iovcnt +¸Ä¤Î¥Ð¥Ã¥Õ¥¡Ê¬¤Î¥Ç¡¼¥¿¤òÆɤ߹þ¤ß¡¢ +.I iov +¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤¹¤ë +("scatter input";¡Ö¤Ð¤é¤Þ¤­ÆþÎÏ¡×)¡£ +.PP +.\"O The +.\"O .BR writev () +.\"O function writes at most +.\"O .I iovcnt +.\"O buffers described by +.\"O .I iov +.\"O to the file associated with the file descriptor +.\"O .I fd +.\"O ("gather output"). +.BR writev () +´Ø¿ô¤Ï¡¢ +.I iov +¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤«¤éºÇÂç +.I iovcnt +¸Ä¤Î¥Ð¥Ã¥Õ¥¡Ê¬¤Î¥Ç¡¼¥¿¤ò¼è¤ê½Ð¤·¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à +("gather output";¡Ö¤«¤­½¸¤á½ÐÎÏ¡×)¡£ +.PP +.\"O The pointer +.\"O .I iov +.\"O points to an array of +.\"O .I iovec +.\"O structures, +.\"O defined in +.\"O .I +.\"O as: +¥Ý¥¤¥ó¥¿ +.I iov +¤Ï +.I iovec +¹½Â¤ÂΤÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I iovec +¹½Â¤ÂÎ¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.PP +.br +.in +4n +.nf +struct iovec { + void *iov_base; /* Starting address */ + size_t iov_len; /* Number of bytes to transfer */ +}; +.fi +.in +.PP +.\"O The +.\"O .BR readv () +.\"O function works just like +.\"O .BR read (2) +.\"O except that multiple buffers are filled. +.BR readv () +´Ø¿ô¤Ï¡¢Ê£¿ô¤Î¥Ð¥Ã¥Õ¥¡¤Ë¥Ç¡¼¥¿¤òÆɤ߹þ¤àÅÀ¤ò½ü¤¤¤Æ +.BR read (2) +¤ÈÁ´¤¯Æ±ÍͤÎÆ°ºî¤ò¹Ô¤¦¡£ +.PP +.\"O The +.\"O .BR writev () +.\"O function works just like +.\"O .BR write (2) +.\"O except that multiple buffers are written out. +.BR writev () +´Ø¿ô¤Ï¡¢Ê£¿ô¤Î¥Ð¥Ã¥Õ¥¡¤Î¥Ç¡¼¥¿¤ò½ñ¤­½Ð¤¹ÅÀ°Ê³°¤Ï +.BR write (2) +¤ÈÁ´¤¯Æ±ÍͤÎÆ°ºî¤ò¹Ô¤¦¡£ +.PP +.\"O Buffers are processed in array order. +.\"O This means that +.\"O .BR readv () +.\"O completely fills +.\"O .IR iov [0] +.\"O before proceeding to +.\"O .IR iov [1], +.\"O and so on. +.\"O (If there is insufficient data, then not all buffers pointed to by +.\"O .I iov +.\"O may be filled.) +.\"O Similarly, +.\"O .BR writev () +.\"O writes out the entire contents of +.\"O .IR iov [0] +.\"O before proceeding to +.\"O .IR iov [1], +.\"O and so on. +¥Ð¥Ã¥Õ¥¡¤ÏÇÛÎó¤Î½ç½ø¤Ç½èÍý¤µ¤ì¤ë¡£¤³¤ì¤Ï¡¢ +.BR readv () +¤¬ +.IR iov [0] +¤¬´°Á´¤Ë°ìÇդˤʤë¤Þ¤Ç¥Ç¡¼¥¿¤òµÍ¤á¤Æ¤«¤é¡¢ +.IR iov [0] +¤Ê¤É¤Ë¿Ê¤à¤³¤È¤ò°ÕÌ£¤¹¤ë +(¥Ç¡¼¥¿¤¬½½Ê¬¤Ê¤¤¾ì¹ç¤Ï¡¢ +.I iov +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Î¤¤¤º¤ì¤â°ìÇդˤʤé¤Ê¤¤)¡£ +ƱÍͤˡ¢ +.BR writev () +¤Ï +.IR iov [0] +¤ÎÆâÍƤòÁ´Éô½ñ¤­½Ð¤·¤Æ¤«¤é +.IR iov [1] +¤Ê¤É¤Ë¿Ê¤à¡£ +.PP +.\"O The data transfers performed by +.\"O .BR readv () +.\"O and +.\"O .BR writev () +.\"O are atomic: the data written by +.\"O .BR writev () +.\"O is written as a single block that is not intermingled with output +.\"O from writes in other processes (but see +.\"O .BR pipe (7) +.\"O for an exception); +.\"O analogously, +.\"O .BR readv () +.\"O is guaranteed to read a contiguous block of data from the file, +.\"O regardless of read operations performed in other threads or processes +.\"O that have file descriptors referring to the same open file description +.\"O (see +.\"O .BR open (2)). +.BR readv () +¤È +.BR writev () +¤Ë¤è¤ë¥Ç¡¼¥¿Å¾Á÷¤Ï atomic ¤Ë¹Ô¤ï¤ì¤ë¡£¤Ä¤Þ¤ê¡¢ +.BR writev () +¤Ë¤è¤ë¥Ç¡¼¥¿½ñ¤­¹þ¤ß¤Ï°ì¤Ä¤Î¥Ö¥í¥Ã¥¯¤È¤·¤Æ¹Ô¤ï¤ì¡¢Â¾¤Î¥×¥í¥»¥¹¤Î +write ¤Ë¤è¤ë½ñ¤­¹þ¤ß¤Èº®¤¶¤ê¹ç¤¦¤³¤È¤Ï¤Ê¤¤ +(Îã³°¤Ë´Ø¤·¤Æ¤Ï +.BR pipe (7) +¤ò»²¾È¤Î¤³¤È)¡£Æ±Íͤˡ¢ +.BR readv () +¤Ï¥Õ¥¡¥¤¥ë¤«¤éϢ³¤¹¤ë¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤¬Æɤ߽Ф¹¤³¤È¤¬Êݾڤµ¤ì¡¢ +Ʊ¤¸¥Õ¥¡¥¤¥ëµ­½Ò (file description; +.BR open (2) +»²¾È) ¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»ý¤Ä¾¤Î¥¹¥ì¥Ã¥É¤ä¥×¥í¥»¥¹¤¬ +¼Â¹Ô¤·¤¿ read Áàºî¤Î±Æ¶Á¤ò¼õ¤±¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, the +.\"O .BR readv () +.\"O function returns the number of bytes read; the +.\"O .BR writev () +.\"O function returns the number of bytes written. +.\"O On error, \-1 is returned, and \fIerrno\fP is set appropriately. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR readv () +´Ø¿ô¤ÏÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÊÖ¤·¡¢ +.BR writev () +´Ø¿ô¤Ï½ñ¤­¹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢\fIerrno\fP ¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O The errors are as given for +.\"O .BR read (2) +.\"O and +.\"O .BR write (2). +.BR read (2) +¤ä +.BR write (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O Additionally the following error is defined: +¤µ¤é¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.TP +.B EINVAL +.\"O The sum of the +.\"O .I iov_len +.\"O values overflows an +.\"O .I ssize_t +.\"O value. +.\"O Or, the vector count \fIiovcnt\fP is less than zero or greater than the +.\"O permitted maximum. +.I iov_len +¤Î¹ç·×¤¬ +.I ssize_t +¤ÎÈϰϤò¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤·¤¿¡£¤â¤·¤¯¤Ï¡¢ +¥Ù¥¯¥¿¿ô \fIiovcnt\fP ¤¬ 0 ¤è¤ê¾®¤µ¤¤¤«µö²Ä¤µ¤ì¤¿ºÇÂçÃͤè¤ê¤âÂ礭¤«¤Ã¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O 4.4BSD (the +.\"O .BR readv () +.\"O and +.\"O .BR writev () +.\"O functions first appeared in 4.2BSD), POSIX.1-2001. +.\"O Linux libc5 used \fIsize_t\fP as the type of the \fIiovcnt\fP argument, +.\"O and \fIint\fP as return type for these functions. +.\"O .\" The readv/writev system calls were buggy before Linux 1.3.40. +.\"O .\" (Says release.libc.) +4.4BSD +.RB ( readv () +¤È +.BR writev () +´Ø¿ô¤Ï 4.2BSD ¤ÇºÇ½é¤Ë¸½¤ï¤ì¤¿)¡¢POSIX.1-2001¡£ +Linux libc5 ¤Ç¤Ï \fIiovcnt\fP °ú¤­¿ô¤Î·¿¤È¤·¤Æ \fIsize_t\fP ¤ò¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤ÎÊÖ¤êÃͤȤ·¤Æ \fIint\fP ¤ò»ÈÍѤ·¤Æ¤¤¤¿¡£ +.\" readv/writev ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 1.3.40 °ÊÁ°¤Ï¥Ð¥°¤À¤é¤±¤Ç¤¢¤Ã¤¿ +.\" (¤È release.libc ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë)¡£ +.\"O .SH NOTES +.\"O .SS Linux Notes +.SH Ãí°Õ +.SS "Linux ¤Ç¤ÎÃí°Õ" +.\"O POSIX.1-2001 allows an implementation to place a limit on +.\"O the number of items that can be passed in +.\"O .IR iov . +.\"O An implementation can advertise its limit by defining +.\"O .B IOV_MAX +.\"O in +.\"O .IR +.\"O or at run time via the return value from +.\"O .IR sysconf(_SC_IOV_MAX) . +.\"O On Linux, the limit advertised by these mechanisms is 1024, +.\"O which is the true kernel limit. +POSIX.1-2001 ¤Ç¤Ï¡¢ +.I iov +¤ÇÅϤ¹¤³¤È¤¬¤Ç¤­¤ëÍ×ÁÇ¿ô¤Ë¾å¸Â¤òÀߤ±¤ë¼ÂÁõ¤¬Ç§¤á¤é¤ì¤Æ¤¤¤ë¡£ +¼ÂÁõ¤Ï¡¢ +.I +¤Î +.B IOV_MAX +¤òÄêµÁ¤¹¤ë¤³¤È¤ä¡¢¼Â¹Ô»þ¤Ë +.I sysconf(_SC_IOV_MAX) +¤ÎÊÖ¤êÃÍ·Ðͳ¤Ç¡¢¤³¤Î¾å¸Â¤ò¹­¹ð¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Linux ¤Ç¤Ï¡¢¤³¤Î»ÅÁȤߤˤè¤ê¹­¹ð¤µ¤ì¤ë¾å¸Â¤Ï 1024 ¤Ç¤¢¤ê¡¢ +¤³¤ÎÃͤϥ«¡¼¥Í¥ë¤Ç¤Î¾å¸Â¤½¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.\"O However, the glibc wrapper functions do some extra work if +.\"O they detect that the underlying kernel system call failed because this +.\"O limit was exceeded. +.\"O In the case of +.\"O .BR readv () +.\"O the wrapper function allocates a temporary buffer large enough +.\"O for all of the items specified by +.\"O .IR iov , +.\"O passes that buffer in a call to +.\"O .BR read (2), +.\"O copies data from the buffer to the locations specified by the +.\"O .I iov_base +.\"O fields of the elements of +.\"O .IR iov , +.\"O and then frees the buffer. +.\"O The wrapper function for +.\"O .BR writev () +.\"O performs the analogous task using a temporary buffer and a call to +.\"O .BR write (2). +°ìÊý¤Ç¡¢glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¤½¤Î´Ø¿ô¤ÎÆâÉô¤Ç¸Æ¤Ð¤ì¤ë¥«¡¼¥Í¥ë¡¦ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤³¤Î¾å¸Â¤òĶ²á¤·¤Æ¼ºÇÔ¤·¤¿¤³¤È¤ò¸¡½Ð¤¹¤ë¤È¡¢ +ÄɲäÎÆ°ºî¤ò¤¹¤ë¡£ +.BR readv () +¤Î¾ì¹ç¡¢¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï +.I iov +¤Ç»ØÄꤵ¤ì¤¿Á´¤Æ¤ÎÍ×ÁǤò³ÊǼ¤Ç¤­¤ëÂ礭¤µ¤Î°ì»þ¥Ð¥Ã¥Õ¥¡¤ò³ä¤êÅö¤Æ¡¢ +.BR read (2) +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë¤½¤Î¥Ð¥Ã¥Õ¥¡¤òÅϤ·¡¢ +¤½¤Î¥Ð¥Ã¥Õ¥¡¤Î¥Ç¡¼¥¿¤ò +.I iov +¤Î³ÆÍ×ÁǤΠ+.I iov_base +¥Õ¥£¡¼¥ë¥É¤¬»ØÄꤹ¤ë¾ì½ê¤Ë¥³¥Ô¡¼¤·¤Æ¤«¤é¡¢ +¤½¤Î¥Ð¥Ã¥Õ¥¡¤ò²òÊü¤¹¤ë¡£ +.BR writev () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤â¡¢Æ±¤¸¤è¤¦¤Ë°ì»þ¥Ð¥Ã¥Õ¥¡¤ò»È¤Ã¤Æ +.BR write (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O It is not advisable to mix calls to functions like +.\"O .BR readv () +.\"O or +.\"O .BR writev (), +.\"O which operate on file descriptors, with the functions from the stdio +.\"O library; the results will be undefined and probably not what you want. +.BR readv () +¤ä +.BR writev () +¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ëÁàºî¤ò¹Ô¤¦´Ø¿ô¤È¡¢ +ɸ½àÆþ½ÐÎϥ饤¥Ö¥é¥ê¤Î´Ø¿ô¤ò¤´¤Á¤ã¤Þ¤¼¤Ë¤·¤Æ¸Æ¤Ö¤Î¤Ï¤ªÁ¦¤á¤·¤Ê¤¤¡£ +¤É¤ó¤Ê·ë²Ì¤Ë¤Ê¤ë¤«¤ÏÄêµÁ¤µ¤ì¤Æ¤ª¤é¤º¡¢ +¤ª¤½¤é¤¯Íߤ·¤¤·ë²Ì¤ÏÆÀ¤é¤ì¤Ê¤¤¤À¤í¤¦¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The following code sample demonstrates the use of +.\"O .BR writev (): +°Ê²¼¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ï +.BR writev () +¤Î»ÈÍÑÊýË¡¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£ + +.in +4n +.nf +char *str0 = "hello "; +char *str1 = "world\\n"; +struct iovec iov[2]; +ssize_t nwritten; + +iov[0].iov_base = str0; +iov[0].iov_len = strlen(str0); +iov[1].iov_base = str1; +iov[1].iov_len = strlen(str1); + +nwritten = writev(STDOUT_FILENO, iov, 2); +.fi +.in +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR read (2), +.BR write (2) diff --git a/draft/man2/reboot.2 b/draft/man2/reboot.2 new file mode 100644 index 00000000..1489100e --- /dev/null +++ b/draft/man2/reboot.2 @@ -0,0 +1,305 @@ +.\" Copyright (c) 1998 Andries Brouwer (aeb@cwi.nl), 24 September 1998 +.\" +.\" 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, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" Japanese Version Copyright (c) 1997 Ueyama Rui +.\" all rights reserved. +.\" Translated Mon Sep 29 23:21:04 JST 1997 +.\" by Ueyama Rui +.\" Updated & Modified Mon Mar 1 1999 +.\" by NAKANO Takeo +.\" Updated Sat Oct 11 JST 2003 by Kentaro Shirakata +.\" +.\"WORD halt Ää»ß +.\"WORD stop Ää»ß +.\"WORD reboot ºÆµ¯Æ° +.\" +.TH REBOOT 2 2008-02-11 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O reboot \- reboot or enable/disable Ctrl-Alt-Del +reboot \- ºÆµ¯Æ°¤¹¤ë¡£¤Þ¤¿¤Ï Ctrl-Alt-Del¤òÍ­¸ú¡¦Ìµ¸ú¤Ë¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.\"O /* For libc4 and libc5 the library call and the system call +.\"O are identical, and since kernel version 2.1.30 there are +.\"O symbolic names LINUX_REBOOT_* for the constants and a +.\"O fourth argument to the call: */ +/* libc4 ¤È libc5 ¤Ç¤Î¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤È¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏƱ¤¸¤Ç¤¢¤ë¡£ + ¤Þ¤¿¥«¡¼¥Í¥ë 2.1.30 °Ê¹ß¤Ç¤Ï¡¢Äê¿ô¤È¤·¤Æ¥·¥ó¥Ü¥ê¥Ã¥¯¤Ê̾Á° + LINUX_REBOOT_* ¤¬ÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢¸Æ¤Ó½Ð¤·¤ÎÂè 4 °ú¿ô¤È¤·¤Æ + »ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£*/ +.sp +.B #include +.br +.B #include +.sp +.BI "int reboot(int " magic ", int " magic2 ", int " cmd ", void *" arg ); +.sp +.\"O /* Under glibc some of the constants involved have gotten +.\"O symbolic names RB_*, and the library call is a 1-argument +.\"O wrapper around the 3-argument system call: +/* glibc ¤Ç¤Ï¡¢´ØÏ¢¤¹¤ëÄê¿ô¤Ë RB_* ¤È¤¤¤¦¥·¥ó¥Ü¥ê¥Ã¥¯¤Ê̾Á°¤¬ÉÕ¤± + ¤é¤ì¤Æ¤¤¤ë¡£¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î°ú¿ô¤Ï 1 ¤Ä¤Ç¡¢3 °ú¿ô¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î + ¥é¥Ã¥Ñ (wrapper) ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ */ +.sp +.B #include +.br +.B #include +.sp +.BI "int reboot(int " cmd ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR reboot () +.\"O call reboots the system, or enables/disables the reboot keystroke +.\"O (abbreviated CAD, since the default is Ctrl-Alt-Delete; +.\"O it can be changed using +.\"O .BR loadkeys (1)). +.BR reboot () +¤Ï¥·¥¹¥Æ¥à¤òºÆµ¯Æ°¤¹¤ë¡£¤Þ¤¿¤ÏºÆµ¯Æ°¤Î¥­¡¼¥¹¥È¥í¡¼¥¯¤Ç¤¢¤ë +Ctrl-Alt-Delete (CAD) ¤òÍ­¸ú/̵¸ú¤Ë¤¹¤ë¡£ +¤³¤Î¥­¡¼¥¹¥È¥í¡¼¥¯¤Ï +.BR loadkeys (1) +¤Ë¤è¤Ã¤ÆÊѹ¹¤Ç¤­¤ë¡£ +.PP +.\"O This system call will fail (with +.\"O .BR EINVAL ) +.\"O unless +.\"O .I magic +.\"O equals +.\"O .B LINUX_REBOOT_MAGIC1 +.\"O (that is, 0xfee1dead) and +.\"O .I magic2 +.\"O equals +.\"O .B LINUX_REBOOT_MAGIC2 +.\"O (that is, 672274793). +.\"O However, since 2.1.17 also +.\"O .B LINUX_REBOOT_MAGIC2A +.\"O (that is, 85072278) +.\"O and since 2.1.97 also +.\"O .B LINUX_REBOOT_MAGIC2B +.\"O (that is, 369367448) +.\"O and since 2.5.71 also +.\"O .B LINUX_REBOOT_MAGIC2C +.\"O (that is, 537993216) +.\"O are permitted as value for +.\"O .IR magic2 . +.\"O (The hexadecimal values of these constants are meaningful.) +.\"O The +.\"O .I cmd +.\"O argument can have the following values: +.I magic +¤¬ +.B LINUX_REBOOT_MAGIC1 +(ÃÍ¤Ï 0xfee1dead) ¤Ç¤¢¤ê¡¢¤«¤Ä +.I magic2 +¤¬ +.B LINUX_REBOOT_MAGIC2 +(672274793) ¤Ç¤Ê¤±¤ì¤Ð¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ºÇÔ¤·¡¢ +.B EINVAL +¤¬ÊÖ¤µ¤ì¤ë¡£ +¤·¤«¤· 2.1.17 ¤«¤é¤Ï +.B LINUX_REBOOT_MAGIC2A +(85072278) ¤¬¡¢ +¤Þ¤¿ 2.1.97 ¤«¤é¤Ï +.B LINUX_REBOOT_MAGIC2B +(369367448) ¤¬¡¢ +2.5.71 ¤«¤é¤Ï +.B LINUX_REBOOT_MAGIC2C +(537993216) ¤¬ +.I magic2 +¤ÎÃͤȤ·¤Æ»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿ (¤³¤ì¤é¤ÎÄê¿ô¤Î 16 ¿Ê¤Ç¤Î +ɽµ­¤Ë¤Ï¤Á¤ç¤Ã¤È¤·¤¿°ÕÌ£¤¬¤¢¤ë)¡£ +.I cmd +°ú¿ô¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë¡£ +.TP +.B LINUX_REBOOT_CMD_RESTART +(RB_AUTOBOOT, 0x1234567) +.\"O The message "Restarting system." is printed, and a default +.\"O restart is performed immediately. +.\"O If not preceded by a +.\"O .BR sync (2), +.\"O data will be lost. +"Restarting system." ¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¡¢ +¥Ç¥Õ¥©¥ë¥È¤ÎºÆµ¯Æ°½èÍý¤¬¤¿¤À¤Á¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ +Àè¤Ë +.BR sync (2) +¤ò¹Ô¤Ê¤ï¤Ê¤¤¤È¡¢¥Ç¡¼¥¿¤¬¼º¤ï¤ì¤ë¡£ +.TP +.B LINUX_REBOOT_CMD_HALT +.\"O (RB_HALT_SYSTEM, 0xcdef0123; since 1.1.76). +.\"O The message "System halted." is printed, and the system is halted. +.\"O Control is given to the ROM monitor, if there is one. +.\"O If not preceded by a +.\"O .BR sync (2), +.\"O data will be lost. +(RB_HALT_SYSTEM, 0xcdef0123; 1.1.76 °Ê¹ß) +"System halted." ¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¡¢¥·¥¹¥Æ¥à¤ÏÄä»ß (halt) ¤¹¤ë¡£ +À©¸æ¤Ï ROM ¥â¥Ë¥¿¤Ë°Ü¤ë (ROM ¥â¥Ë¥¿¤¬¤¢¤ë¾ì¹ç)¡£ +Àè¤Ë +.BR sync (2) +¤ò¹Ô¤Ê¤ï¤Ê¤¤¤È¡¢¥Ç¡¼¥¿¤¬¼º¤ï¤ì¤ë¡£ +.TP +.B LINUX_REBOOT_CMD_POWER_OFF +.\"O (0x4321fedc; since 2.1.30). +.\"O The message "Power down." is printed, the system is stopped, +.\"O and all power is removed from the system, if possible. +.\"O If not preceded by a +.\"O .BR sync (2), +.\"O data will be lost. +(0x4321fedc; 2.1.30 °Ê¹ß) +"Power down" ¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¡¢¥·¥¹¥Æ¥à¤ÏÄä»ß (stop) ¤¹¤ë¡£ +²Äǽ¤Ê¾ì¹ç¤Ï¥·¥¹¥Æ¥à¤ÎÅŸ»¤¬Íî¤È¤µ¤ì¤ë¡£ +Àè¤Ë +.BR sync (2) +¤ò¹Ô¤Ê¤ï¤Ê¤¤¤È¡¢¥Ç¡¼¥¿¤¬¼º¤ï¤ì¤ë¡£ +.TP +.B LINUX_REBOOT_CMD_RESTART2 +.\"O (0xa1b2c3d4; since 2.1.30). +.\"O The message "Restarting system with command \(aq%s\(aq" is printed, +.\"O and a restart (using the command string given in +.\"O .IR arg ) +.\"O is performed immediately. +.\"O If not preceded by a +.\"O .BR sync (2), +.\"O data will be lost. +(0xa1b2c3d4; 2.1.30 °Ê¹ß) +"Restarting system with command \(aq%s\(aq" ¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¡¢ +¤¿¤À¤Á¤Ë ( +.I arg +¤Ë»ØÄꤵ¤ì¤¿¥³¥Þ¥ó¥É¤òÍѤ¤¤Æ) ºÆµ¯Æ° (restart) ¤¬¹Ô¤ï¤ì¤ë¡£ +Àè¤Ë +.BR sync (2) +¤ò¹Ô¤Ê¤ï¤Ê¤¤¤È¡¢¥Ç¡¼¥¿¤¬¼º¤ï¤ì¤ë¡£ +.TP +.B LINUX_REBOOT_CMD_CAD_ON +.\"O (RB_ENABLE_CAD, 0x89abcdef). +.\"O CAD is enabled. +.\"O This means that the CAD keystroke will immediately cause +.\"O the action associated with +.\"O .BR LINUX_REBOOT_CMD_RESTART . +(RB_ENABLE_CAD, 0x89abcdef) +CAD ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤ì°Ê¹ß¤Ë CAD ¥­¡¼¥¹¥È¥í¡¼¥¯¤¬ÆþÎϤµ¤ì¤ë¤È¡¢ +¤¿¤À¤Á¤Ë +.B LINUX_REBOOT_CMD_RESTART +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Æ°ºî¤¬¹Ô¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.TP +.B LINUX_REBOOT_CMD_CAD_OFF +.\"O (RB_DISABLE_CAD, 0). +.\"O CAD is disabled. +.\"O This means that the CAD keystroke will cause a +.\"O .B SIGINT +.\"O signal to be +.\"O sent to init (process 1), whereupon this process may decide upon a +.\"O proper action (maybe: kill all processes, sync, reboot). +(RB_DISABLE_CAD, 0) +CAD ¤ò̵¸ú¤Ë¤¹¤ë¡£ +¤³¤ì°Ê¹ß¤Ë CAD ¥­¡¼¥¹¥È¥í¡¼¥¯¤¬ÆþÎϤµ¤ì¤ë¤È¡¢ +.B SIGINT +¥·¥°¥Ê¥ë¤¬ init (¥×¥í¥»¥¹ 1) ¤ËÁ÷¤é¤ì¤ë¡£ +¤³¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±¤ë¤È¡¢¤ª¤½¤é¤¯ init ¥×¥í¥»¥¹¤Ï +Á°¤â¤Ã¤ÆÄê¤á¤é¤ì¤¿Æ°ºî¤ò¹Ô¤¦¤³¤È¤Ë¤Ê¤ë (¿ʬ¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤Î kill, +sync, ºÆµ¯Æ°)¡£ +.LP +.\"O Only the superuser may call +.\"O .BR reboot (). +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤À¤±¤¬ +.BR reboot () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +.\"O The precise effect of the above actions depends on the architecture. +.\"O For the i386 architecture, the additional argument does not do +.\"O anything at present (2.1.122), but the type of reboot can be +.\"O determined by kernel command-line arguments ("reboot=...") to be +.\"O either warm or cold, and either hard or through the BIOS. +¾å½Ò¤Î¥¢¥¯¥·¥ç¥ó¤Î¼ÂºÝ¤Î¸ú²Ì¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë°Í¸¤¹¤ë¡£ +i386 ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢¸½ºß¤Î¤È¤³¤í (2.1.122) Éղðú¿ô¤Ï +²¿¤â¹Ô¤ï¤Ê¤¤¤¬¡¢ºÆµ¯Æ°¤Î¥¿¥¤¥×¤ò¥«¡¼¥Í¥ë¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¿ô +("reboot=...") ¤Ë¤è¤Ã¤ÆÄê¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤Ï warm ¤Þ¤¿¤Ï cold ¤È¡¢ hard ¤Þ¤¿¤Ï BIOS ·Ðͳ¤ÎºÆµ¯Æ°¤ò +ÀßÄê¤Ç¤­¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O For the values of +.\"O .I cmd +.\"O that stop or restart the system, +.\"O a successful call to +.\"O .BR reboot () +.\"O does not return. +.\"O For the other +.\"O .I cmd +.\"O values, zero is returned on success. +.\"O In all cases, \-1 is returned on failure, and +.\"O .I errno +.\"O is set appropriately. +.I cmd +¤¬¥·¥¹¥Æ¥à¤ÎÄä»ß¤äºÆµ¯Æ°¤òɽ¤¹Ãͤξì¹ç¡¢¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤È +.BR reboot () +¤ÏÊÖ¤é¤Ê¤¤¡£ +.I cmd +¤¬Â¾¤ÎÃͤξì¹ç¤Ë¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤¬Ê֤롣 +.I cmd +¤ÎÃͤ˴ؤï¤é¤º¡¢¼ºÇԤξì¹ç¤Ë¤Ï \-1 ¤¬Ê֤ꡢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O Problem with getting userspace data under +.\"O .BR LINUX_REBOOT_CMD_RESTART2 . +.B LINUX_REBOOT_CMD_RESTART2 +¤Î»þ¤Ë¥æ¡¼¥¶¡¼¥¹¥Ú¡¼¥¹¤Î¥Ç¡¼¥¿¤Î¼èÆÀ¤ËÌäÂ꤬¤¢¤Ã¤¿¡£ +.TP +.B EINVAL +.\"O Bad magic numbers or \fIcmd\fP. +magic ¤Î¿ô»ú¤« \fIcmd\fP ¤¬´Ö°ã¤Ã¤Æ¤¤¤ë¡£ +.TP +.B EPERM +.\"O The calling process has insufficient privilege to call +.\"O .BR reboot (); +.\"O the +.\"O .B CAP_SYS_BOOT +.\"O capability is required. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë +.BR reboot () +¤ò¸Æ¤Ó½Ð¤¹¤Î¤Ë½½Ê¬¤Ê¸¢¸Â¤¬¤Ê¤«¤Ã¤¿¡£ +.B CAP_SYS_BOOT +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR reboot () +.\"O is Linux-specific, +.\"O and should not be used in programs intended to be portable. +.BR reboot () +¤Ï Linux ¤ËÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤ÏÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sync (2), +.BR bootparam (7), +.BR ctrlaltdel (8), +.BR halt (8), +.BR reboot (8), +.BR capabilities (7) diff --git a/draft/man2/recv.2 b/draft/man2/recv.2 new file mode 100644 index 00000000..bbe4be21 --- /dev/null +++ b/draft/man2/recv.2 @@ -0,0 +1,844 @@ +.\" Copyright (c) 1983, 1990, 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. +.\" +.\" $Id: recv.2,v 1.8 2001/08/15 18:00:48 hanataka 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 ÉÔÀµ¤Ê +.\" +.TH RECV 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O recv, recvfrom, recvmsg \- receive a message from a socket +.SH ̾Á° +recv, recvfrom, recvmsg \- ¥½¥±¥Ã¥È¤«¤é¥á¥Ã¥»¡¼¥¸¤ò¼õ¤±¼è¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.\" .B #include +.\" .br +.nf +.B #include +.br +.B #include +.sp +.BI "ssize_t recv(int " sockfd ", void *" buf ", size_t " len ", int " flags ); +.sp +.BI "ssize_t recvfrom(int " sockfd ", void *" buf ", size_t " len ", int " flags , +.BI " struct sockaddr *" src_addr ", socklen_t *" addrlen ); +.sp +.BI "ssize_t recvmsg(int " sockfd ", struct msghdr *" msg ", int " flags ); +.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) ¤Ç¤¢¤Ã¤Æ¤â¤Ê¤¯¤Æ¤â¤è¤¤¡£ +.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 ¥É¥á¥¤¥ó¤È¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥É¥á¥¤¥ó¤Î¤É¤Á¤é¤Î¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤Ç¤â +.\" .I src_addr +.\" ¤ËÁ÷¿®¸µ¥¢¥É¥ì¥¹¤¬Æþ¤ì¤é¤ì¤ë¡£¤Þ¤¿¡¢Unix ¥É¥á¥¤¥ó¤Î¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¤Ç¤â +.\" ƱÍͤÀ¤¬¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥É¥á¥¤¥ó¤Î¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¤Ç¤Ï +.\" .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 +¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·»þ¤ËÅϤµ¤ì¤¿Ãͤè¤ê¤âÂ礭¤ÊÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +.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 () +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.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 +¤òÀßÄꤹ¤ë¡£ +¤³¤ì¤é¤Î¼õ¿®ÍѤΥ³¡¼¥ë¤Ï¡¢¼õ¿®¤·¤¿¥Ç¡¼¥¿¤Î¥µ¥¤¥º¤¬Í׵ᤷ¤¿¥µ¥¤¥º¤Ë +㤹¤ë¤Þ¤ÇÂԤĤΤǤϤʤ¯¡¢²¿¤é¤«¤Î¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ë¤ÈÉüµ¢¤¹¤ë +(¼õ¿®¤µ¤ì¤ë¥Ç¡¼¥¿¤ÎºÇÂ祵¥¤¥º¤ÏÍ׵ᤷ¤¿¥µ¥¤¥º¤Ç¤¢¤ë)¡£ +.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) +¥³¡¼¥ë¤ò»È¤Ã¤Æ¡¢¼¡¤Î¥Ç¡¼¥¿¤¬¤¤¤ÄÆϤ¯¤«¤òȽÃǤǤ­¤ë¡£ +.PP +.\"O The +.\"O .I flags +.\"O argument to a +.\"O .BR recv () +.\"O call is formed by +.\"O .IR OR 'ing +.\"O one or more of the following values: +.BR recv () +¥³¡¼¥ë¤Î +.I flags +°ú¤­¿ô¤Ë¤Ï¡¢°Ê²¼¤ÎÃͤò 1¤Ä°Ê¾å¡¢¥Ó¥Ã¥Èñ°Ì¤Î +.I OR (ÏÀÍýÏÂ) +¤ò¼è¤Ã¤¿¤â¤Î¤ò»ØÄꤹ¤ë: +.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 +¥Õ¥é¥°¤ÈƱ¤¸Íýͳ¤ÇÍ­ÍѤǤ¢¤ë¡£ +.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 +.\"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 +·Ðͳ¤Ç»²¾È¤Ç¤­¤ë¡£ +.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 +¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤¬ÅϤµ¤ì¤¿¸å¤Ë¤Ï¡¢¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¼¡¤Î¥¨¥é¡¼¤Ë´ð¤¤¤Æ¡¢ +½èÍýÂÔ¤Á¤Î¥½¥±¥Ã¥È¡¦¥¨¥é¡¼¤¬ºÆÀ¸À®¤µ¤ì¡¢¼¡¤Î¥½¥±¥Ã¥ÈÁàºî¤ÎºÝ¤ËÅϤµ¤ì¤ë¡£ + +.IP +.\"O The error is supplied in a +.\"O .I sock_extended_err +.\"O structure: +¤³¤Î¥¨¥é¡¼¤Ï +.I sock_extended_err +¹½Â¤ÂΤÇÄ󶡤µ¤ì¤ë: +.in +4n +.nf + +#define SO_EE_ORIGIN_NONE 0 +#define SO_EE_ORIGIN_LOCAL 1 +#define SO_EE_ORIGIN_ICMP 2 +#define SO_EE_ORIGIN_ICMP6 3 + +struct sock_extended_err +{ + uint32_t ee_errno; /* error number */ + uint8_t ee_origin; /* where the error originated */ + uint8_t ee_type; /* type */ + uint8_t ee_code; /* code */ + uint8_t ee_pad; /* padding */ + uint32_t ee_info; /* additional information */ + uint32_t ee_data; /* other data */ + /* More data may follow */ +}; + +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 +¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤ÏÉÔÄê¤Ç¤¢¤ë¡£ +¥¨¥é¡¼¤ÎȯÀ¸¤·¤¿¥Ñ¥±¥Ã¥È¤Î¥Ú¥¤¥í¡¼¥É¤ÏÄ̾ï¤Î¥Ç¡¼¥¿¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +.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. +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢ +¼õ¿®¥­¥å¡¼¤ÎºÇ½é¤Î¥Ç¡¼¥¿¤òÊÖ¤¹¤È¤­¡¢¥­¥å¡¼¤«¤é¥Ç¡¼¥¿¤òºï½ü¤·¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Î¸å¤Ç¤â¤¦°ìÅÙ¼õ¿®¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹¤È¡¢Æ±¤¸¥Ç¡¼¥¿¤¬Ê֤뤳¤È¤Ë¤Ê¤ë¡£ +.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)) +¥½¥±¥Ã¥È¤Ë¤Ä¤¤¤Æ¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"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) ¤¬È¯À¸¤·¤¿¤ê¡¢ +¼¡¤Ë¼õ¿®¤µ¤ì¤ë¥Ç¡¼¥¿¤¬°Û¤Ê¤ë·¿¤À¤Ã¤¿¤ê¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +Í׵ᤷ¤¿Î̤è¤ê¥Ç¡¼¥¿¤¬¾¯¤Ê¤¯¤Æ¤âÊ֤뤳¤È¤¬¤¢¤ë¡£ +.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 +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +struct iovec { /* Scatter/gather array items */ + void *iov_base; /* Starting address */ + size_t iov_len; /* Number of bytes to transfer */ +}; + +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 */ + socklen_t msg_controllen; /* ancillary data buffer len */ + int msg_flags; /* flags on received message */ +}; +.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 +¤Î¥Ð¥Ã¥Õ¥¡¤ÎŤµ¤òÆþ¤ì¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +¥³¡¼¥ë¤¬À®¸ù¤·¤ÆÊ֤俾ì¹ç¡¢À©¸æ¥á¥Ã¥»¡¼¥¸Îó¤ÎŤµ¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.PP +.\"O The messages are of the form: +¥á¥Ã¥»¡¼¥¸¤Î·Á¼°¤Ï°Ê²¼¤ÎÄ̤ê: +.in +4n +.nf + +struct cmsghdr { + socklen_t cmsg_len; /* data byte count, including hdr */ + int cmsg_level; /* originating protocol */ + 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) +¤ËÄêµÁ¤µ¤ì¤¿¥Þ¥¯¥í·Ðͳ¤Ç¤Î¤ß¥¢¥¯¥»¥¹¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.\"O As an example, Linux uses this auxiliary data mechanism to pass extended +.\"O errors, IP options or file descriptors over Unix sockets. +Îã¤ò¤¢¤²¤ë¤È¡¢ Linux ¤Ï¤³¤ÎÊä½õ¥Ç¡¼¥¿¤Î¥á¥«¥Ë¥º¥à¤ò¡¢ +Unix ¥½¥±¥Ã¥È¾å¤Ç¤Î³ÈÄ¥¥¨¥é¡¼¤ä IP ¥ª¥×¥·¥ç¥ó¡¢ +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¼õ¤±ÅϤ·¤ËÍøÍѤ·¤Æ¤¤¤ë¡£ +.PP +.\"O The +.\"O .I msg_flags +.\"O field in the msghdr is set on return of +.\"O .BR recvmsg (). +.\"O It can contain several flags: +msghdr ¤Î +.I msg_flags +¥Õ¥£¡¼¥ë¥É¤Ï +.BR recvmsg () +¤«¤é¤Î¥ê¥¿¡¼¥ó»þ¤ËÀßÄꤵ¤ì¤ë¡£¤³¤³¤Ë¤Ï¤¤¤¯¤Ä¤«¤Î¥Õ¥é¥°¤¬Æþ¤ë¡£ +.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 +.B MSG_ERRQUEUE +.\"O indicates that no data was received but an extended error from the socket +.\"O error queue. +¥Ç¡¼¥¿¤Ï¼õ¿®¤·¤Ê¤«¤Ã¤¿¤¬ +¥½¥±¥Ã¥È¤Î¥¨¥é¡¼¡¦¥­¥å¡¼¤«¤é³ÈÄ¥¥¨¥é¡¼¤ò¼õ¿®¤·¤¿¤³¤È¤ò¼¨¤¹¡£ +.\"O .SH "RETURN VALUE" +.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 +.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 +.\" 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. +¼õ¿®¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.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. +ÉÔÀµ¤Ê°ú¤­¿ô¤¬ÅϤµ¤ì¤¿¡£ +.\" 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 +.B ENOTSOCK +.\"O The argument +.\"O .I sockfd +.\"O does not refer to a socket. +°ú¤­¿ô +.I sockfd +¤¬¥½¥±¥Ã¥È¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O 4.4BSD (these function calls first appeared in 4.2BSD), +.\"O 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 +.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) +¤â»²¾È¤¹¤ë¤³¤È¡£ + +.\"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 (2.4) types it as +.\"O .IR size_t . +POSIX.1-2001 ¤Ç¤Ï¡¢¹½Â¤ÂÎ +.I msghdr +¤Î¥Õ¥£¡¼¥ë¥É +.I msg_controllen +¤Ï +.I socklen_t +·¿¤Ç¤¢¤ë¤Ù¤­¤À¤È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +¸½ºß¤Î glibc (glibc 2.4) ¤Ç¤Ï +.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 EXAMPLE +.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" +.SH ´ØÏ¢¹àÌÜ +.BR fcntl (2), +.BR getsockopt (2), +.BR read (2), +.BR select (2), +.BR shutdown (2), +.BR socket (2), +.BR cmsg (3), +.BR sockatmark (3), +.BR socket (7) diff --git a/draft/man2/remap_file_pages.2 b/draft/man2/remap_file_pages.2 new file mode 100644 index 00000000..243db3a1 --- /dev/null +++ b/draft/man2/remap_file_pages.2 @@ -0,0 +1,266 @@ +.\" Copyright (C) 2003, Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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. +.\" +.\" 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 +.SH ̾Á° +.\"O remap_file_pages \- create a nonlinear file mapping +remap_file_pages \- ÈóÀþ·Á¥Õ¥¡¥¤¥ë¥Þ¥Ã¥Ô¥ó¥°¤òºîÀ®¤¹¤ë¡£ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int remap_file_pages(void *" addr ", size_t " size ", int " prot , +.BI " ssize_t " pgoff ", int " flags ); +.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, ²¾ÁÛ¥á¥â¥êÎΰè) +¥Ç¡¼¥¿¹½Â¤ÂΤòÄɲäǺîÀ®¤¹¤ëɬÍפ¬¤Ê¤¤¤³¤È¤Ç¤¢¤ë¡£ + +.\"O To create a nonlinear mapping we perform the following steps: +ÈóÀþ·Á¥Þ¥Ã¥Ô¥ó¥°¤òºîÀ®¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +°Ê²¼¤Î¤è¤¦¤Ê¥¹¥Æ¥Ã¥×¤ò¼Â¹Ô¤¹¤ë: +.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 +¥Õ¥é¥°¤ò»ØÄꤷ¤ÆºîÀ®¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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 ²ó°Ê¾å¸Æ¤Ó½Ð¤·¤Æ¡¢ +¥Þ¥Ã¥Ô¥ó¥°¤Î¥Ú¡¼¥¸¤È¥Õ¥¡¥¤¥ë¤Î¥Ú¡¼¥¸¤ÎÂбþ´Ø·¸¤òºÆ¹½À®¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤ÎƱ¤¸¥Ú¡¼¥¸¤ò¥Þ¥Ã¥Ô¥ó¥°Îΰè¤ÎÊ£¿ô¤Î¾ì½ê¤Ë +¥Þ¥Ã¥×¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¡£ +.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 +¤ÏÎΰè¤ÎŤµ¤Ç¤¢¤ê¡¢Ã±°Ì¤Ï¥Ð¥¤¥È¤Ç¤¢¤ë¡£ + +.\"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 +¤Ë¤è¤Ã¤Æ»ØÄꤹ¤ë¤³¤È¤Ç¤¢¤ë¡£ + +.\"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() ¤Î +.\" ƱÍͤΰú¤­¿ô¤Î½èÍýÊýË¡¤È¤âÌ·½â¤¹¤ë¡£ +.\" MTK, 14 Sep 2005 + +.\"O The +.\"O .I prot +.\"O argument must be specified as 0. +.I prot +°ú¤­¿ô¤Ï 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" +.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 +.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 +.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" +.SH ½àµò +.\"O The +.\"O .BR remap_file_pages () +.\"O system call is Linux-specific. +.BR remap_file_pages () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getpagesize (2), +.BR mmap (2), +.BR mmap2 (2), +.BR mprotect (2), +.BR mremap (2), +.BR msync (2), +.BR feature_test_macros (7) diff --git a/draft/man2/removexattr.2 b/draft/man2/removexattr.2 new file mode 100644 index 00000000..2317ae55 --- /dev/null +++ b/draft/man2/removexattr.2 @@ -0,0 +1,200 @@ +.\" +.\" Extended attributes system calls manual pages +.\" +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" 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) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 04:43:40 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: extended attributes ³Èĥ°À­ +.\"WORD: namespace ̾Á°¶õ´Ö +.\" +.TH REMOVEXATTR 2 2001-12-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O removexattr, lremovexattr, fremovexattr \- remove an extended attribute +.SH ̾Á° +removexattr, lremovexattr, fremovexattr \- ³Èĥ°À­¤òºï½ü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.fam C +.nf +.B #include +.B #include +.sp +.BI "int removexattr(const char\ *" path ", const char\ *" name ); +.BI "int lremovexattr(const char\ *" path ", const char\ *" name ); +.BI "int fremovexattr(int " fd ", const char\ *" name ); +.fi +.fam T +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Extended attributes are +.\"O .IR name :\c +.\"O value pairs associated with inodes (files, directories, symbolic links, etc.). +.\"O They are extensions to the normal attributes which are associated +.\"O with all inodes in the system (i.e., the +.\"O .BR stat (2) +.\"O data). +.\"O A complete overview of extended attributes concepts can be found in +.\"O .BR attr (5). +³Èĥ°À­¤Ï¡¢inode (¥Õ¥¡¥¤¥ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯Åù) ¤Ë +´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +.IR name :\c +.I value +¤ÎÂФǤ¢¤ë¡£ +¤³¤ì¤é¤Ï¡¢¥·¥¹¥Æ¥à¾å¤Î¤¹¤Ù¤Æ¤Î inode ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ä̾ï¤Î°À­ +.RB ( stat (2) +¤¬ÊÖ¤¹¥Ç¡¼¥¿) ¤ò³ÈÄ¥¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +³Èĥ°À­¤Î¥³¥ó¥»¥×¥È¤Ï +.BR attr (5) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O .BR removexattr () +.\"O removes the extended attribute identified by +.\"O .I name +.\"O and associated with the given +.\"O .I path +.\"O in the file system. +.BR removexattr () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î»ØÄꤵ¤ì¤¿ +.I path +¤ËÂбþ¤¹¤ë¡¢Ì¾Á° +.I name +¤Î³Èĥ°À­¤òºï½ü¤¹¤ë¡£ +.PP +.\"O .BR lremovexattr () +.\"O is identical to +.\"O .BR removexattr (), +.\"O except in the case of a symbolic link, where the extended attribute is +.\"O removed from the link itself, not the file that it refers to. +.BR lremovexattr () +¤Ï +.BR removexattr () +¤ÈƱ¤¸¤À¤¬¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¡¢¥ê¥ó¥¯¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë +¤Ç¤Ï¤Ê¤¯¡¢¥ê¥ó¥¯¤½¤Î¤â¤Î¤Î¾ðÊó¤òºï½ü¤¹¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +.PP +.\"O .BR fremovexattr () +.\"O is identical to +.\"O .BR removexattr (), +.\"O only the extended attribute is removed from the open file referred to by +.\"O .I fd +.\"O (as returned by +.\"O .BR open (2)) +.\"O in place of +.\"O .IR path . +.BR fremovexattr () +¤Ï +.BR removexattr () +¤ÈƱ¤¸¤À¤¬¡¢ +.I path +¤ÎÂå¤ï¤ê¤Ë +.I fd +¤Ç»²¾È¤µ¤ì¤¿¥ª¡¼¥×¥óºÑ¤ß¥Õ¥¡¥¤¥ë¤«¤é³Èĥ°À­¤òºï½ü¤¹¤ë¤À¤±¤Ç¤¢¤ëÅÀ¤¬°Û¤Ê¤ë +.RI ( fd +¤Ï +.BR open (2) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë)¡£ +.PP +.\"O An extended attribute name is a simple null-terminated string. +.\"O The +.\"O .I name +.\"O includes a namespace prefix; there may be several, disjoint +.\"O namespaces associated with an individual inode. +³Èĥ°À­¤Î̾Á°¤Ï¡¢ÉáÄ̤ΠNULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +.I name +¤Ë¤Ï¡¢Ì¾Á°¶õ´Ö¤òɽ¤¹ÀÜƬ¼­ (prefix) ¤¬´Þ¤Þ¤ì¤ë¡£ +¸Ä¡¹¤Î inode ¤ËÂФ·¡¢¸ß¤¤¤ËÆÈΩ¤Ê̾Á°¶õ´Ö¤¬Ê£¿ô¤¢¤Ã¤Æ¤â¤è¤¤¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, zero is returned. +.\"O On failure, \-1 is returned and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O If the named attribute does not exist, +.\"O .I errno +.\"O is set to +.\"O .BR ENOATTR . +»ØÄꤵ¤ì¤¿Ì¾Á°¤Î°À­¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOATTR +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O If extended attributes are not supported by the file system, or are disabled, +.\"O .I errno +.\"O is set to +.\"O .BR ENOTSUP . +³Èĥ°À­¤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¤â¤·¤¯¤Ï̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOTSUP +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O The errors documented for the +.\"O .BR stat (2) +.\"O system call are also applicable here. +.BR stat (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀâÌÀ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ï +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤âŬÍѤµ¤ì¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These system calls have been available on Linux since kernel 2.4; +.\"O glibc support is provided since version 2.3. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.4 °Ê¹ß¤Î Linux ¤ÇÍøÍѤǤ­¤ë¡£ +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3 °Ê¹ß¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These system calls are Linux-specific. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\"O .\" .SH AUTHORS +.\" .SH Ãø¼Ô +.\"O .\" Andreas Gruenbacher, +.\"O .\" .RI < a.gruenbacher@computer.org > +.\"O .\" and the SGI XFS development team, +.\"O .\" .RI < linux-xfs@oss.sgi.com >. +.\"O .\" Please send any bug reports or comments to these addresses. +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" ¤È SGI XFS ³«È¯¥Á¡¼¥à, +.\" .RI < linux-xfs@oss.sgi.com >¡£ +.\" ¥Ð¥°¥ì¥Ý¡¼¥È¤ä¥³¥á¥ó¥È¤Ï¾åµ­¤Î¥¢¥É¥ì¥¹¤Þ¤ÇÁ÷¤Ã¤Æ²¼¤µ¤¤¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR getfattr (1), +.BR setfattr (1), +.BR getxattr (2), +.BR listxattr (2), +.BR open (2), +.BR setxattr (2), +.BR stat (2), +.BR attr (5), +.BR symlink (7) diff --git a/draft/man2/rename.2 b/draft/man2/rename.2 new file mode 100644 index 00000000..83096f57 --- /dev/null +++ b/draft/man2/rename.2 @@ -0,0 +1,438 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt; +.\" 1993,1995 Ian Jackson. +.\" +.\" 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 Sat Jul 24 00:35:52 1993 by Rik Faith +.\" Modified Thu Jun 4 12:21:13 1998 by Andries Brouwer +.\" Modified Thu Mar 3 09:49:35 2005 by Michael Haardt +.\" 2007-03-25, mtk, added various text to DESCRIPTION. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Fri Dec 12 00:15:52 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Thu Feb 10 07:23:59 JST 2005 +.\" by Yuichi SATO +.\" Updated & Modified Fri Apr 22 03:21:04 JST 2005 by Yuichi SATO +.\" Updated 2007-05-04, Akihiro MOTOKI , LDP v2.44 +.\" Updated 2009-04-24, Akihiro MOTOKI , LDP v3.20 +.\" +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: hard link ¥Ï¡¼¥É¡¦¥ê¥ó¥¯ +.\"WORD: overwrite ¾å½ñ¤­(overwrite) +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: crash ¥¯¥é¥Ã¥·¥å +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: working directory ¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: root directory ¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: effective uid ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: sticky bit ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È +.\"WORD: memory ¥á¥â¥ê +.\"WORD: read-only Æɤ߹þ¤ßÀìÍÑ +.\"WORD: uid ¥æ¡¼¥¶¡¼ID +.\"WORD: dangling symbolic link ²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: server ¥µ¡¼¥Ð¡¼ +.\" +.TH RENAME 2 2009-03-30 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O rename \- change the name or location of a file +rename \- ¥Õ¥¡¥¤¥ë¤Î̾Á°¤ä°ÌÃÖ¤òÊѹ¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int rename(const char *" oldpath ", const char *" newpath ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR rename () +.\"O renames a file, moving it between directories if required. +.BR rename () +¤Ï¥Õ¥¡¥¤¥ë¤Î̾Á°¤òÊѹ¹¤·¡¢É¬Íפʤé¤Ð¥Ç¥£¥ì¥¯¥È¥ê´Ö¤Î°ÜÆ°¤ò¹Ô¤Ê¤¦¡£ +.\"O Any other hard links to the file (as created using +.\"O .BR link (2)) +.\"O are unaffected. +¤½¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë +.RB ( link (2) +¤ò»ÈÍѤ·¤Æºî¤é¤ì¤¿) ¾¤Î¥Ï¡¼¥É¥ê¥ó¥¯ (hard link) ¤Ë¤Ï±Æ¶Á¤Ï¤Ê¤¤¡£ +.\"O Open file descriptors for +.\"O .I oldpath +.\"O are also unaffected. +¥ª¡¼¥×¥óºÑ¤Î +.I oldpath +¤ËÂФ¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤â±Æ¶Á¤Ï¤Ê¤¤¡£ + +.\"O If +.\"O .I newpath +.\"O already exists it will be atomically replaced (subject to +.\"O a few conditions; see ERRORS below), so that there is +.\"O no point at which another process attempting to access +.\"O .I newpath +.\"O will find it missing. +.I newpath +¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢¤½¤ì¤ÏÉÔ²ÄʬÁàºî¤Ç (atomically) ÃÖ¤­´¹¤¨¤é¤ì¤ë +(¤¿¤À¤·¡¢¤¤¤¯¤Ä¤«¤Î¾ò·ï¤¬¤¢¤ë; °Ê²¼¤Î¡Ö¥¨¥é¡¼¡×¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È)¡£ +¤½¤Î¤¿¤á¡¢ +.I newpath +¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¾¤Î¥×¥í¥»¥¹¤¬¥Õ¥¡¥¤¥ë¤ò¸«¼º¤¦¤³¤È¤Ï¤Ê¤¤ +(ÌõÃð: ¾ï¤Ë¥¢¥¯¥»¥¹²Äǽ¤Ç¤¢¤ë)¡£ + +.\"O If +.\"O .I oldpath +.\"O and +.\"O .I newpath +.\"O are existing hard links referring to the same file, then +.\"O .BR rename () +.\"O does nothing, and returns a success status. +.I oldpath +¤È +.I newpath +¤¬¤É¤Á¤é¤â´û¸¤Î¥Ï¡¼¥É¥ê¥ó¥¯¤Ç¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR rename () +¤Ï²¿¤â¹Ô¤ï¤º¡¢¥¹¥Æ¡¼¥¿¥¹¤È¤·¤ÆÀ®¸ù¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I newpath +.\"O exists but the operation fails for some reason +.\"O .BR rename () +.\"O guarantees to leave an instance of +.\"O .I newpath +.\"O in place. +.I newpath +¤¬Â¸ºß¤·¡¢²¿¤é¤«¤ÎÍýͳ¤ÇÁàºî¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.BR rename () +¤Ï +.I newpath +¤Î¼ÂÂΤò¸µ¤Î¤Þ¤Þ»Ä¤¹¤³¤È¤òÊݾڤ¹¤ë¡£ + +.\"O .I oldpath +.\"O can specify a directory. +.\"O In this case, +.\"O .I newpath +.\"O must either not exist, or it must specify an empty directory. +.I oldpath +¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤Î¾ì¹ç¡¢ +.I newpath +¤Ï¸ºß¤·¤Ê¤¤¤«¡¢¶õ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O However, when overwriting there will probably be a window in which +.\"O both +.\"O .I oldpath +.\"O and +.\"O .I newpath +.\"O refer to the file being renamed. +°ìÊý¤Ç¡¢¾å½ñ¤­¤ò¹Ô¤Ê¤¦¾ì¹ç¤Ï¡¢rename ¤¬¹Ô¤Ê¤ï¤ì¤ë¥Õ¥¡¥¤¥ë¤ò +.I oldpath +¤È +.I newpath +¤ÎξÊý¤Ç»²¾È¤Ç¤­¤ë½Ö´Ö¤¬¤ª¤½¤é¤¯Â¸ºß¤¹¤ë¡£ + +.\"O If +.\"O .I oldpath +.\"O refers to a symbolic link the link is renamed; if +.\"O .I newpath +.\"O refers to a symbolic link the link will be overwritten. +.I oldpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ (symbolic link) ¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¥ê¥ó¥¯¤Î̾Á°¤¬Êѹ¹¤µ¤ì¤ë¡£ +¤Þ¤¿¡¢ +.I newpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥ê¥ó¥¯¤¬¾å½ñ¤­¤µ¤ì¤ë¡£ +.\"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 EACCES +.\"O Write permission is denied for the directory containing +.\"O .I oldpath +.\"O or +.\"O .IR newpath , +.\"O or, search permission is denied for one of the directories +.\"O in the path prefix of +.\"O .I oldpath +.\"O or +.\"O .IR newpath , +.\"O or +.\"O .I oldpath +.\"O is a directory and does not allow write permission (needed to update +.\"O the +.\"O .I .. +.\"O entry). +.\"O (See also +.\"O .BR path_resolution (7).) +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä¤¬¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I oldpath +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç +.RI ( .. +¥¨¥ó¥È¥ê¤ò¹¹¿·¤¹¤ë¤Î¤ËɬÍפÊ) ½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È)¡£ +.TP +.B EBUSY +.\"O The rename fails because +.\"O .IR oldpath " or " newpath +.\"O is a directory that is in use by some process (perhaps as +.\"O current working directory, or as root directory, or because +.\"O it was open for reading) or is in use by the system +.\"O (for example as mount point), while the system considers +.\"O this an error. +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¡¢²¿¤é¤«¤Î¥×¥í¥»¥¹¤¬»ÈÍÑÃæ +(¿ʬ¡¢¥«¥ì¥ó¥È¡¦¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê¤«¡¢¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤«¡¢ +Æɤ߹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤«¤Ç¤í¤¦) +¤â¤·¤¯¤Ï¡¢¥·¥¹¥Æ¥à¤¬»ÈÍÑÃæ (Î㤨¤Ð¥Þ¥¦¥ó¥È¡¦¥Ý¥¤¥ó¥È¤Ç¤¢¤ë) +¤Ç¤¢¤ê¡¢¥·¥¹¥Æ¥à¤¬¤³¤ì¤ò¥¨¥é¡¼¤Ç¤¢¤ë¤ÈȽÃǤ·¤¿¤¿¤á¤Ë rename ¤¬¼ºÇÔ¤·¤¿¡£ +.\"O (Note that there is no requirement to return +.\"O .B EBUSY +.\"O in such +.\"O cases \(em there is nothing wrong with doing the rename anyway \(em +.\"O but it is allowed to return +.\"O .B EBUSY +.\"O if the system cannot otherwise +.\"O handle such situations.) +(¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë +.B EBUSY +¤òÊÖ¤¹¤³¤È¤Ïµ¬³Ê¤Ç¤ÏÍ׵ᤵ¤ì¤Æ¤¤¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¡¢rename ¤ò¤È¤Ë¤«¤¯¼Â¹Ô¤·¤Æ¤ß¤ë¤Î¤Ï²¿¤ÎÌäÂê¤â¤Ê¤¤¡£ +¤¿¤À¤·¡¢¤½¤Î¤è¤¦¤Ê¾õ¶·¤Ç¡¢¥·¥¹¥Æ¥à¤¬Â¾¤ËÊÖ¤¹¥¨¥é¡¼¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï +.B EBUSY +¤òÊÖ¤¹¤³¤È¤¬µö¤µ¤ì¤Æ¤¤¤ë¡£) +.TP +.B EFAULT +.\"O .IR oldpath " or " newpath " points outside your accessible address space." +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O The new pathname contained a path prefix of the old, or, more generally, +.\"O an attempt was made to make a directory a subdirectory of itself. +.IR newpath " ¤¬ " oldpath +¤Î¥Ñ¥¹Éôʬ¤ò´Þ¤ó¤Ç¤¤¤ë¡£¥Ç¥£¥ì¥¯¥È¥ê¤ò¼«Ê¬¼«¿È¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë +Êѹ¹¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤¬¤Û¤È¤ó¤É¤Ç¤¢¤ë¡£ +.TP +.B EISDIR +.\"O .I newpath +.\"O is an existing directory, but +.\"O .I oldpath +.\"O is not a directory. +.I newpath +¤Ï¸ºß¤·¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤¬¡¢ +.I oldpath +¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B ELOOP +.\"O Too many symbolic links were encountered in resolving +.\"O .IR oldpath " or " newpath . +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B EMLINK +.\"O .I oldpath +.\"O already has the maximum number of links to it, or +.\"O it was a directory and the directory containing +.\"O .I newpath +.\"O has the maximum number of links. +.I oldpath +¤Ï´û¤ËºÇÂç¿ô¤Þ¤Ç¤Î¥ê¥ó¥¯¤ò»ý¤Ã¤Æ¤¤¤ë¤«¡¢¤½¤ì¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç +.I newpath +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤¬ºÇÂç¿ô¤Þ¤Ç¤Î¥ê¥ó¥¯¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +.TP +.B ENAMETOOLONG +.\"O .IR oldpath " or " newpath " was too long." +.IR oldpath " ¤Þ¤¿¤Ï " newpath " ¤¬Ä¹²á¤®¤ë¡£" +.TP +.B ENOENT +.\"O The link named by +.\"O .I oldpath +.\"O does not exist; +.\"O or, a directory component in +.\"O .I newpath +.\"O does not exist; +.\"O or, +.\"O .I oldpath +.\"O or +.\"O .I newpath +.\"O is an empty string. +.I oldpath +¤È¤¤¤¦Ì¾Á°¤Î¥ê¥ó¥¯¤¬Â¸ºß¤·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I newpath +¤È¤¤¤¦¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I oldpath +¤« +.I newpath +¤¬¶õ¤Îʸ»úÎó¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +.\"O Insufficient kernel memory was available. +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOSPC +.\"O The device containing the file has no room for the new directory +.\"O entry. +¥Õ¥¡¥¤¥ë¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥Ð¥¤¥¹¤Ë¿·¤·¤¤¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤ò +ºîÀ®¤¹¤ë¤¿¤á¤Î¶õ¤­¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O A component used as a directory in +.\"O .IR oldpath " or " newpath +.\"O is not, in fact, a directory. +.IR oldpath " ¤« " newpath +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬ +¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.\"O Or, +.\"O .I oldpath +.\"O is a directory, and +.\"O .I newpath +.\"O exists but is not a directory. +¤Þ¤¿¤Ï +.I oldpath +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¡¢ +.I newpath +¤¬Â¸ºß¤·¤Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.\"O .BR ENOTEMPTY " or " EEXIST +.B ENOTEMPTY " ¤Þ¤¿¤Ï " EEXIST +.\"O .I newpath +.\"O is a nonempty directory, that is, contains entries other than "." and "..". +.I newpath +¤¬¶õ¤Ç¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¡£¤¹¤Ê¤ï¤Á "." ¤È ".." °Ê³°¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +.TP +.\"O .BR EPERM " or " EACCES +.BR EPERM " ¤Þ¤¿¤Ï " EACCES +.\"O The directory containing +.\"O .I oldpath +.\"O has the sticky bit +.\"O .RB ( S_ISVTX ) +.\"O set and the process's effective user ID is neither +.\"O the user ID of the file to be deleted nor that of the directory +.\"O containing it, and the process is not privileged +.\"O (Linux: does not have the +.\"O .B CAP_FOWNER +.\"O capability); +.I oldpath +¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È (sticky bit) +.RB ( S_ISVTX ) +¤¬ÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢ +¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ +ºï½ü¤·¤è¤¦¤È¤¹¤ë¥Õ¥¡¥¤¥ë¤Î¥æ¡¼¥¶¡¼ ID ¤È +¤½¤Î¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È¥ê¤Î¥æ¡¼¥¶¡¼ ID ¤Î¤¤¤º¤ì¤È¤â°ìÃפ»¤º¡¢¤«¤Ä +¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¤ (Linux ¤Ç¤Ï +.B CAP_FOWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¤Ê¤¤)¡£ +.\"O or +.\"O .I newpath +.\"O is an existing file and the directory containing it has the sticky bit set +.\"O and the process's effective user ID is neither the user ID of the file +.\"O to be replaced nor that of the directory containing it, +.\"O and the process is not privileged +.\"O (Linux: does not have the +.\"O .B CAP_FOWNER +.\"O capability); +¤Þ¤¿¤Ï¡¢ +.I newpath +¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¤Ç¡¢¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢ +¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ +ÃÖ¤­´¹¤¨¤è¤¦¤È¤¹¤ë¥Õ¥¡¥¤¥ë¤Î¥æ¡¼¥¶¡¼ ID ¤È +¤½¤Î¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È¥ê¤Î¥æ¡¼¥¶¡¼ ID ¤Î¤¤¤º¤ì¤È¤â°ìÃפ»¤º¡¢¤«¤Ä +¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¤ (Linux ¤Ç¤Ï +.B CAP_FOWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¤)¡£ +.\"O or the file system containing +.\"O .I pathname +.\"O does not support renaming of the type requested. +¤Þ¤¿¤Ï +.IR oldpath " ¤È " newpath +¤¬Â¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬¡¢Í׵ᤵ¤ì¤¿¼ïÎà¤Î̾Á°¤ÎÊѹ¹¤ò +¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EROFS +.\"O The file is on a read-only file system. +¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤ßÀìÍÑ (read-only) ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¤¢¤ë¡£ +.TP +.B EXDEV +.\"O .IR oldpath " and " newpath +.\"O are not on the same mounted file system. +.IR oldpath " ¤È " newpath +¤¬Æ±¤¸¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£ +.\"O (Linux permits a file system to be mounted at multiple points, but +.\"O .BR rename () +.\"O does not work across different mount points, +.\"O even if the same file system is mounted on both.) +(Linux ¤Ï 1 ¤Ä¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤òÊ£¿ô¤Î¥Þ¥¦¥ó¥È°ÌÃÖ¤Ë +¥Þ¥¦¥ó¥È¤¹¤ë¤³¤È¤òµö²Ä¤·¤Æ¤¤¤ë¡£ +¤·¤«¤· +.BR rename () +¤Ï¡¢¤¿¤È¤¨Æ±¤¸¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤¢¤Ã¤Æ¤â¡¢ +ÊÌ¡¹¤Î¥Þ¥¦¥ó¥È°ÌÃÖ¤ò¸Ù¤¤¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¡£) +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD, C89, C99, POSIX.1-2001. +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O On NFS file systems, you can not assume that if the operation +.\"O failed the file was not renamed. +.\"O If the server does the rename operation +.\"O and then crashes, the retransmitted RPC which will be processed when the +.\"O server is up again causes a failure. +.\"O The application is expected to +.\"O deal with this. +.\"O See +.\"O .BR link (2) +.\"O for a similar problem. +NFS ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤Ï¡¢Áàºî¤¬¼ºÇÔ¤·¤¿¤«¤é¤È¤¤¤Ã¤Æ¡¢ +¥Õ¥¡¥¤¥ë¤Î̾Á°¤¬Êѹ¹¤Ç¤­¤Ê¤«¤Ã¤¿¤È·è¤á¤Æ¤«¤«¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¥µ¡¼¥Ð¤¬ rename Áàºî¤ò½ª¤¨¤Æ¤«¤é¥¯¥é¥Ã¥·¥å¤·¤¿¾ì¹ç¡¢ +¥µ¡¼¥Ð¤¬ºÆ¤ÓΩ¤Á¾å¤¬¤Ã¤¿¤È¤­¤Ë¡¢ +ºÆÁ÷¿®¤µ¤ì¤¿ RPC ¤¬½èÍý¤µ¤ì¤ë¤¬¡¢¤³¤ì¤Ï¼ºÇԤȤʤ롣 +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤ÎÌäÂê¤òÀµ¤·¤¯¼è¤ê°·¤¦¤³¤È¤¬´üÂÔ¤µ¤ì¤Æ¤¤¤ë¡£ +ƱÍͤÎÌäÂê¤Ë¤Ä¤¤¤Æ +.BR link (2) +¤Ë¤â½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mv (1), +.BR chmod (2), +.BR link (2), +.BR renameat (2), +.BR symlink (2), +.BR unlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/draft/man2/renameat.2 b/draft/man2/renameat.2 new file mode 100644 index 00000000..b06e2ce3 --- /dev/null +++ b/draft/man2/renameat.2 @@ -0,0 +1,218 @@ +.\" 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-09-05 by Yuichi SATO , LDP v2.39 +.\" +.TH RENAMEAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "int renameat(int " olddirfd ", const char *" oldpath , +.BI " int " newdirfd ", const char *" newpath ); +.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 renameat (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.\"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) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.\"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) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î +ÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.\"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) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I oldpath +.\"O is absolute, then +.\"O .I olddirfd +.\"O is ignored. +.I oldpath +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I olddirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"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 +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +.\"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 +.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 () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR renameat () +.\"O was added to Linux in kernel 2.6.16. +.BR renameat () +¤Ï 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 renameat (). +.BR renameat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR openat (2), +.BR rename (2), +.BR path_resolution (7) diff --git a/draft/man2/rmdir.2 b/draft/man2/rmdir.2 new file mode 100644 index 00000000..a3fc08da --- /dev/null +++ b/draft/man2/rmdir.2 @@ -0,0 +1,235 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 1997-01-31 by Eric S. Raymond +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-12-12, HANATAKA Shinya +.\" Updated 2003-10-11, Kentaro Shirakata +.\" Updated 2005-02-24, Akihiro MOTOKI +.\" Updated 2006-07-23, Akihiro MOTOKI, LDP v2.36 +.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: sticky bit ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È +.\"WORD: dangling symbolic link ²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: working directory ¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: root directory ¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: effective uid ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: sticky bit ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È +.\"WORD: read-only Æɤ߹þ¤ßÀìÍÑ +.\"WORD: uid ¥æ¡¼¥¶¡¼ID +.\"WORD: entry ¥¨¥ó¥È¥ê +.\"WORD: memory ¥á¥â¥ê +.\" +.TH RMDIR 2 2008-05-08 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O rmdir \- delete a directory +rmdir \- ¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int rmdir(const char *" pathname ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR rmdir () +.\"O deletes a directory, which must be empty. +.BR rmdir () +¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤¹¤ë¡£ºï½ü¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ï¶õ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"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 +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O Write access to the directory containing +.\"O .I pathname +.\"O was not allowed, or one of the directories in the path prefix of +.\"O .I pathname +.\"O did not allow search permission. +.\"O (See also +.\"O .BR path_resolution (7). +.I pathname +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¬ +¥×¥í¥»¥¹¤Î¼Â¸ú (effective) UID ¤ËÂФ·¤Æµö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +.I pathname +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¤É¤ì¤«¤Ë¸¡º÷ (¼Â¹Ô) µö²Ä¤¬¤Ê¤¤¤«¡¢ +.I pathname +¤Ë»ê¤ë¤Þ¤Ç¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤¤¤º¤ì¤«¤ËÂФ¹¤ë¸¡º÷µö²Ä¤¬¤Ê¤«¤Ã¤¿¡£ +.RB ( path_resolution (7) +¤â»²¾È¤Î¤³¤È) +.TP +.B EBUSY +.\"O .I pathname +.\"O is currently in use by the system or some process that prevents its +.\"O removal. +.\"O On Linux this means +.\"O .I pathname +.\"O is currently used as a mount point +.\"O or is the root directory of the calling process. +.I pathname +¤¬¥·¥¹¥Æ¥à¤äÊÌ¤Î¥×¥í¥»¥¹¤Ë¤è¤ê»ÈÍÑÃæ¤Çºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +Linux ¤Ç¤Ï¡¢ +.I pathname +¤¬¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤È¤·¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤ë¤«¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.TP +.B EFAULT +.\"O .IR pathname " points outside your accessible address space." +.I pathname +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O .I pathname +.\"O has +.\"O .I . +.\"O as last component. +.I pathname +¤ÎºÇ¸å¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬ +.I . +¤Ç¤¢¤ë¡£ +.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 +¤ÎÃæ¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢²õ¤ì¤¿ (dangling) +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ (symbolic link) ¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +.\"O Insufficient kernel memory was available. +½½Ê¬¤Ê¥«¡¼¥Í¥ë¤Î¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O .IR pathname , +.\"O or a component used as a directory in +.\"O .IR pathname , +.\"O is not, in fact, a directory. +.I pathname +¤« +.I pathname +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¡¢¼ÂºÝ¤Ë¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B ENOTEMPTY +.\"O .I pathname +.\"O contains entries other than +.\"O .IR . " and " .. " ;" +.\"O or, +.\"O .I pathname +.\"O has +.\"O .I .. +.\"O as its final component. +.\"O POSIX.1-2001 also allows +.\"O .B EEXIST +.\"O for this condition. +¥Ç¥£¥ì¥¯¥È¥ê +.I pathname +¤Ë +.IR . " ¤È " .. +°Ê³°¤Î¥¨¥ó¥È¥ê¤¬¤¢¤ë¡£¤Þ¤¿¤Ï¡¢ +.I pathname +¤ò¹½À®¤¹¤ëºÇ¸å¤ÎÍ×ÁǤ¬ +.I .. +¤Ç¤¢¤ë¡£ +POSIX.1-2001 ¤Ï¡¢¤³¤Î¾õ¶·¤Ç +.B EEXIST +¤òÊÖ¤¹¤³¤È¤òǧ¤á¤Æ¤¤¤ë¡£ +.TP +.B EPERM +.\"O The directory containing +.\"O .I pathname +.\"O has the sticky-bit +.\"O .RB ( S_ISVTX ) +.\"O set and the process's effective user ID is neither the user ID +.\"O of the file to be deleted nor that of the directory containing it, +.\"O and the process is not privileged (Linux: does not have the +.\"O .B CAP_FOWNER +.\"O capability). +.I pathname +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È(sticky-bit) +.RB ( S_ISVTX ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¡¢¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ID ¤¬ºï½ü¤·¤è¤¦¤È¤¹¤ë¥Õ¥¡¥¤¥ë¤Î +¥æ¡¼¥¶ID ¤È¤½¤Î¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È¥ê¤Î¥æ¡¼¥¶¡¼ID ¤Î¤É¤Á¤é¤È¤â°Û¤Ê¤ê¡¢ +¥×¥í¥»¥¹¤â¸¢¸Â (Linux ¤Ç¤Ï +.B CAP_FOWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤¬¤Ê¤¤¡£ +.TP +.B EPERM +.\"O The file system containing +.\"O .I pathname +.\"O does not support the removal of directories. +.I pathname +¤ò´Þ¤ó¤Ç¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î +ºï½ü¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EROFS +.\"O .I pathname +.\"O refers to a directory on a read-only file system. +.I pathname +¤¬Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¾å¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Infelicities in the protocol underlying NFS can cause the unexpected +.\"O disappearance of directories which are still being used. +NFS ¥×¥í¥È¥³¥ë¤ËÀøºß¤·¤Æ¤¤¤ë·ç´Ù¤Ë¤è¤Ã¤Æ¡¢¤Þ¤À»ÈÍÑÃæ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤¬ +ÆÍÁ³¾ÃÌǤ¹¤ë¸½¾Ý¤¬°ú¤­µ¯¤³¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR rm (1), +.BR rmdir (1), +.BR chdir (2), +.BR chmod (2), +.BR mkdir (2), +.BR rename (2), +.BR unlink (2), +.BR unlinkat (2) diff --git a/draft/man2/sched_get_priority_max.2 b/draft/man2/sched_get_priority_max.2 new file mode 100644 index 00000000..8e2a0dd2 --- /dev/null +++ b/draft/man2/sched_get_priority_max.2 @@ -0,0 +1,184 @@ +.\" 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 2006-04-14, Akihiro MOTOKI , LDP v2.29 +.\" +.\"WORD: static ÀÅŪ +.\"WORD: priority ¥×¥é¥¤¥ª¥ê¥Æ¥£ +.\"WORD: scheduling ¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +.\"WORD: algorithm ¥¢¥ë¥´¥ê¥º¥à +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: portable °Ü¿¢À­¤Î¤¢¤ë +.\"WORD: policy Êý¿Ë +.\" +.TH SCHED_GET_PRIORITY_MAX 2 2006-03-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.SH ½ñ¼° +.B #include +.sp +.BI "int sched_get_priority_max(int " policy ); +.sp +.BI "int sched_get_priority_min(int " policy ); +.\"O .SH DESCRIPTION +.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) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ + +.\"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 () +¤¬ÊÖ¤¹Ãͤè¤ê¤âÂ礭¤¤¡£ + +.\"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 ¤ò»ý¤Ä¡£ +¤½¤ì¤¾¤ì¤ÎÊý¿Ë¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥×¥é¥¤¥ª¥ê¥Æ¥£¤ÎÈÏ°Ï¤Ï +Êѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ + +.\"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 ¤Ë¤¹¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ + +.\"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" +.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 +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O The argument \fIpolicy\fP does not identify a defined scheduling policy. +°ú¤­¿ô \fIpolicy\fP ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤È°ìÃפ·¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH "SEE ALSO" +.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), +.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_rr_get_interval.2 b/draft/man2/sched_rr_get_interval.2 new file mode 100644 index 00000000..9176d085 --- /dev/null +++ b/draft/man2/sched_rr_get_interval.2 @@ -0,0 +1,191 @@ +.\" 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 new file mode 100644 index 00000000..00bc0569 --- /dev/null +++ b/draft/man2/sched_setaffinity.2 @@ -0,0 +1,424 @@ +.\" man2/sched_setaffinity.2 - sched_setaffinity and sched_getaffinity man page +.\" +.\" Copyright (C) 2002 Robert Love +.\" and Copyright (C) 2006 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. +.\" +.\" 2002-11-19 Robert Love - initial version +.\" 2004-04-20 mtk - fixed description of return value +.\" 2004-04-22 aeb - added glibc prototype history +.\" 2005-05-03 mtk - noted that sched_setaffinity may cause thread +.\" migration and that CPU affinity is a per-thread attribute. +.\" 2006-02-03 mtk -- Major rewrite +.\" 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 ¸¢¸Â +.\" +.TH SCHED_SETAFFINITY 2 2008-11-14 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int sched_setaffinity(pid_t " pid ", size_t " cpusetsize , +.BI " cpu_set_t *" mask ); +.sp +.BI "int sched_getaffinity(pid_t " pid ", size_t " cpusetsize , +.BI " cpu_set_t *" mask ); +.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 ¤Ç¼Â¹Ô¤òºÆ³«¤¹¤ë¤È¤­¤ËȯÀ¸¤¹¤ë +¥­¥ã¥Ã¥·¥å̵¸ú²½ (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) +¤Çµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"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)" +¤ò»ØÄꤹ¤ì¤Ð¤è¤¤¡£ + +.\"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 +¤Ç»ØÄꤵ¤ì¤¿ 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" +.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 +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O A supplied memory address was invalid. +»ØÄꤵ¤ì¤¿¥á¥â¥êÈÖÃϤ¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.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 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. +¥×¥í¥»¥¹ 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" +.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 ½¸¹ç¤ËÂФ¹¤ëÀ©¸Â¤Ï¥«¡¼¥Í¥ë¤Ë¤è¤ê +°ÅÌۤΤ¦¤Á¤ËŬÍѤµ¤ì¤ë¡£ + +.\"O .BR sched_setscheduler (2) +.\"O has a description of the Linux scheduling scheme. +.BR sched_setscheduler (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) +¤ò»ÈÍѤ¹¤ë¤³¤È)¡£ + +.\"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) +¤ÎÁ°¸å¤ÇÊݸ¤µ¤ì¤ë¡£ + +.\"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" +.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 pthread_setaffinity_np (3), +.BR CPU_SET (3), +.BR sched_getcpu (3), +.BR capabilities (7), +.BR cpuset (7) diff --git a/draft/man2/sched_setparam.2 b/draft/man2/sched_setparam.2 new file mode 100644 index 00000000..aed29dd4 --- /dev/null +++ b/draft/man2/sched_setparam.2 @@ -0,0 +1,197 @@ +.\" 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 +.\" 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 +.\" +.TH SCHED_SETPARAM 2 2006-03-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sched_setparam, sched_getparam \- set and get scheduling parameters +sched_setparam, sched_getparam \- ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ñ¥é¥á¡¼¥¿¤ÎÀßÄê¤È¼èÆÀ¤ò¹Ô¤Ê¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sched_setparam(pid_t " pid ", const struct sched_param *" param ); +.sp +.BI "int sched_getparam(pid_t " pid ", struct sched_param *" param ); +.sp +.nf +.ta 4n +\fBstruct sched_param { + ... + int \fIsched_priority\fB; + ... +}; +.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) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"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 ¤Ê¤é¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Ñ¥é¥á¡¼¥¿¤ò¼èÆÀ¤¹¤ë¡£ + +.\"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) +¤ÎÈϰϤËÆþ¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"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) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"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" +.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 +.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" +.SH ½àµò +POSIX.1-2001. +.\"O .SH "SEE ALSO" +.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) +.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_setscheduler.2 b/draft/man2/sched_setscheduler.2 new file mode 100644 index 00000000..eb62d069 --- /dev/null +++ b/draft/man2/sched_setscheduler.2 @@ -0,0 +1,825 @@ +.\" 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 new file mode 100644 index 00000000..56c4a49f --- /dev/null +++ b/draft/man2/sched_yield.2 @@ -0,0 +1,143 @@ +.\" 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 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 ¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +.\" +.TH SCHED_YIELD 2 2008-10-18 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sched_yield \- yield the processor +sched_yield \- ¥×¥í¥»¥Ã¥µ¡¼¤ò¶õ¤±ÅϤ¹(yield) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B int sched_yield(void); +.\"O .SH DESCRIPTION +.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" +.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 +.SH ¥¨¥é¡¼ +.\"O In the Linux implementation, +.\"O .BR sched_yield () +.\"O always succeeds. +Linux ¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.BR sched_yield () +¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.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 () +¤ò¸Æ¤Ó½Ð¤·¤¿»þÅÀ¤ÇºÇÂçÍ¥ÀèÅ٤Υꥹ¥È¤ÎÃæ¤Ë¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤·¤« +¸ºß¤·¤Ê¤±¤ì¤Ð¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ï¸Æ¤Ó½Ð¤·¸å¤âÁö¤ê³¤±¤ë¤³¤È¤Ë¤Ê¤ë¡£ + +.\"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 +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ß»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ + +.\"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 () +¤Î¸Æ¤Ó½Ð¤·¤è¤êÉÔɬÍפʥ³¥ó¥Æ¥­¥¹¥È¥¹¥¤¥Ã¥Á¤¬µ¯¤³¤ê¡¢¥·¥¹¥Æ¥àÀ­Ç½¤¬ +Îô²½¤¹¤ë·ë²Ì¤Ë¤Ê¤ë¤«¤é¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.\"O .BR sched_setscheduler (2) +.\"O for a description of Linux scheduling. +Linux ¤Î¥¹¥±¡¼¥¸¥å¥ê¥ó¥°(scheduling)¤Ë¤Ä¤¤¤Æ¤Ï +.BR sched_setscheduler (2) +¤ò»²¾È¤»¤è¡£ +.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/select.2 b/draft/man2/select.2 new file mode 100644 index 00000000..49ed8279 --- /dev/null +++ b/draft/man2/select.2 @@ -0,0 +1,951 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is copyright (C) 1992 Drew Eckhardt, +.\" copyright (C) 1995 Michael Shields. +.\" +.\" 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-05-18 by Jim Van Zandt +.\" Sun Feb 11 14:07:00 MET 1996 Martin Schulze +.\" * layout slightly modified +.\" +.\" Modified Mon Oct 21 23:05:29 EDT 1996 by Eric S. Raymond +.\" Modified Thu Feb 24 01:41:09 CET 2000 by aeb +.\" Modified Thu Feb 9 22:32:09 CET 2001 by bert hubert , aeb +.\" Modified Mon Nov 11 14:35:00 PST 2002 by Ben Woodard +.\" 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 °Ü¿¢À­¤Î¤¢¤ë +.\" +.TH SELECT 2 2008-12-05 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 ¤Ë½¾¤¦¾ì¹ç */ +.br +.B #include +.sp +.\"O /* According to earlier standards */ +/* °ÊÁ°¤Îµ¬³Ê¤Ë½¾¤¦¾ì¹ç */ +.br +.B #include +.br +.B #include +.br +.B #include +.sp +.BI "int select(int " nfds ", fd_set *" readfds ", fd_set *" writefds , +.BI " fd_set *" exceptfds ", struct timeval *" timeout ); +.sp +.BI "void FD_CLR(int " fd ", fd_set *" set ); +.br +.BI "int FD_ISSET(int " fd ", fd_set *" set ); +.br +.BI "void FD_SET(int " fd ", fd_set *" set ); +.br +.BI "void FD_ZERO(fd_set *" set ); +.sp +.B #include +.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 ); +.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 pselect (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.\"O .SH DESCRIPTION +.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) +¤Ê¤É) ¤¬Ää»ß (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 +(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 +(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 +(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 () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.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 ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.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 () +¤¬½ªÎ»¤·¤¿¸å¤Ë»È¤¦¤ÈÊØÍø¤Ç¤¢¤ë¡£ +.PP +.\"O .I nfds +.\"O is the highest-numbered file descriptor in any of the three sets, plus 1. +.I nfds +¤Ï 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 stucture 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) ¤¹¤ë¡£ +.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" ´Ø¿ô¤ò¼Â¹Ô¤·¡¢ +½ªÎ»¸å¤Ë¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò¸µ¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ËÌ᤹¡£ +.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 () +¤Î¸Æ¤Ó½Ð¤·¤Ï¡¢ +.nf + + ready = pselect(nfds, &readfds, &writefds, &exceptfds, + 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 = select(nfds, &readfds, &writefds, &exceptfds, timeout); + 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" +.SS ¥¿¥¤¥à¥¢¥¦¥È +.\"O The time structures involved are defined in +.\"O .I +.\"O and look like +¤³¤ì¤é¤Î´Ø¿ô¤Ç»ÈÍѤµ¤ì¤ë»þ´Ö´ØÏ¢¤Î¹½Â¤ÂΤϡ¢ +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"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 { + long tv_sec; /* Éà */ + long tv_usec; /* ¥Þ¥¤¥¯¥íÉà */ +}; +.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 { + long tv_sec; /* Éà */ + long tv_nsec; /* ¥Ê¥ÎÉà */ +}; +.fi +.in + +.\"O (However, see below on the POSIX.1-2001 versions.) +(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 () +¤ò¸Æ¤Ó½Ð¤¹¤È¤¤¤¦ÊýË¡¤ò»È¤Ã¤Æ¤¤¤ë¥³¡¼¥É¤â¤¢¤ë¡£ +.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" +.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 +.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 +.B EINTR +.\"O A signal was caught; see +.\"O .BR signal (7). +¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤¿¡£ +.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. +ÆâÉô¥Æ¡¼¥Ö¥ë¤Ë¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.\"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" +.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 ·Ï¤Ç¤Ï¤½¤¦¤Ç¤Ê¤¤¤Î¤ÇÃí°Õ¤¹¤ë¤³¤È¡£ +.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 +.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 +¤ÏÍ­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +.\"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 ¤Î²¼¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct timeval { + time_t tv_sec; /* Éà */ + suseconds_t tv_usec; /* ¥Þ¥¤¥¯¥íÉà */ +}; +.fi +.in + +¤³¤Î¹½Â¤ÂÎ¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢¥Ç¡¼¥¿·¿ +.I time_t +¤È +.I suseconds_t +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.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 +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ì¤Ð¤è¤¤¡£ + +.\"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" +.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 +.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 () +¤¬Ä󶡤µ¤ì¤Æ¤¤¤¿¡£ + +.\"O Since version 2.1, glibc has provided an emulation of +.\"O .BR pselect () +.\"O that is implemented using +.\"O .BR sigprocmask (2) +.\"O and +.\"O .BR select (). +.\"O This implementation remains 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 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 () +¤Ç´Æ»ë¤¹¤ë¤È¤¤¤¦ÊýË¡¤Ç¤¢¤ë)¡£ + +.\"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 ¤òÊÖ¤·¤Æ¤·¤Þ¤¦? + +.\"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 +.SH Îã +.nf +#include +#include +#include +#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) +{ + fd_set rfds; + struct timeval tv; + int retval; + + /* stdin (fd 0) ¤ò´Æ»ë¤·¡¢ÆþÎϤ¬¤¢¤Ã¤¿¾ì¹ç¤Ëɽ¼¨¤¹¤ë¡£*/ + FD_ZERO(&rfds); + FD_SET(0, &rfds); + + /* 5 Éôִƻ뤹¤ë¡£*/ + tv.tv_sec = 5; + tv.tv_usec = 0; + + retval = select(1, &rfds, NULL, NULL, &tv); + /* ¤³¤Î»þÅÀ¤Ç¤Î tv ¤ÎÃͤò¿®Íꤷ¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£*/ + + if (retval == \-1) + perror("select()"); + else if (retval) + printf("º£¡¢¥Ç¡¼¥¿¤¬¼èÆÀ¤Ç¤­¤Þ¤·¤¿¡£\\n"); + /* FD_ISSET(0, &rfds) ¤¬ true ¤Ë¤Ê¤ë¡£*/ + else + printf("5 ÉðÊÆâ¤Ë¥Ç¡¼¥¿¤¬ÆþÎϤµ¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£\\n"); + + 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) +¤¬¤¢¤ë¡£ +.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) diff --git a/draft/man2/select_tut.2 b/draft/man2/select_tut.2 new file mode 100644 index 00000000..1715ac14 --- /dev/null +++ b/draft/man2/select_tut.2 @@ -0,0 +1,1199 @@ +.\" This manpage is copyright (C) 2001 Paul Sheer. +.\" +.\" 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. +.\" +.\" very minor changes, aeb +.\" +.\" Modified 5 June 2002, Michael Kerrisk +.\" 2006-05-13, mtk, removed much material that is redundant with select.2 +.\" 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 Îã³°¾õÂÖ +.\" +.TH SELECT_TUT 2 2009-01-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 ¤Ë½¾¤¦¾ì¹ç */ +.br +.B #include +.sp +.\"O /* According to earlier standards */ +/* °ÊÁ°¤Îµ¬³Ê¤Ë½¾¤¦¾ì¹ç */ +.br +.B #include +.br +.B #include +.br +.B #include +.sp +.BI "int select(int " nfds ", fd_set *" readfds ", fd_set *" writefds , +.BI " fd_set *" exceptfds ", struct timeval *" utimeout ); +.sp +.BI "void FD_CLR(int " fd ", fd_set *" set ); +.br +.BI "int FD_ISSET(int " fd ", fd_set *" set ); +.br +.BI "void FD_SET(int " fd ", fd_set *" set ); +.br +.BI "void FD_ZERO(fd_set *" set ); +.sp +.B #include +.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 ); +.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 pselect (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.\"O .SH DESCRIPTION +.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 +.SS °ú¤­¿ô +.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 +\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 +\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 pseudo-terminals +.\"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) +¤ò»²¾È¤Î¤³¤È¡£ +(¤³¤ì°Ê³°¤Ç¤Ï¡¢¤Þ¤ì¤Ê¤³¤È¤À¤¬¡¢ +¥Ñ¥±¥Ã¥È¥â¡¼¥É¤Îµ¼»÷üËö (pseudo-terminals) ¤Ç +.BR select () +¤¬Îã³°¾õÂÖ¤ò¼¨¤¹¤³¤È¤¬¤¢¤ë¡£) +.BR select () +¤¬ÊÖ¤ë»þ¤Ë¡¢\fIexceptfds\fP ¤Î¤¦¤Á¡¢ +Îã³°¾õÂÖ¤¬È¯À¸¤·¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿°Ê³°¤Ï½¸¹ç¤«¤éºï½ü¤µ¤ì¤ë¡£ +.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 +\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 ¤Ï¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.IP +.in +4n +.nf +struct timeval { + time_t tv_sec; /* seconds */ + long tv_usec; /* microseconds */ +}; +.fi +.in +.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" +¤Ï¼¡¤Ë¼¨¤¹¤è¤¦¤Ë¥Ê¥ÎÉäÎÀºÅÙ¤ò»ý¤Ä¡£ +.in +4n +.nf +struct timespec { + long tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.fi +.in +.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 +.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 +¤ò¡¢¤â¤È¤â¤È¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò»È¤Ã¤ÆÍ­¸ú¤Ë¤¹¤ë¤Î¤À¡£ +¤³¤Î¥×¥í¥°¥é¥à¤Ï¼¡¤Î¤è¤¦¤Ë¤Ê¤ë¡£ +.PP +.nf +static volatile sig_atomic_t got_SIGCHLD = 0; + +static void +child_sig_handler(int sig) +{ + got_SIGCHLD = 1; +} + +int +main(int argc, char *argv[]) +{ + sigset_t sigmask, empty_mask; + struct sigaction sa; + fd_set readfds, writefds, exceptfds; + int r; + + sigemptyset(&sigmask); + sigaddset(&sigmask, SIGCHLD); + if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == \-1) { + perror("sigprocmask"); + exit(EXIT_FAILURE); + } + + sa.sa_flags = 0; + sa.sa_handler = child_sig_handler; + sigemptyset(&sa.sa_mask); + if (sigaction(SIGCHLD, &sa, NULL) == \-1) { + perror("sigaction"); + exit(EXIT_FAILURE); + } + + sigemptyset(&empty_mask); + + for (;;) { /* main loop */ + /* Initialize readfds, writefds, and exceptfds + before the pselect() call. (Code omitted.) */ + + r = pselect(nfds, &readfds, &writefds, &exceptfds, + NULL, &empty_mask); + if (r == \-1 && errno != EINTR) { + /* Handle error */ + } + + if (got_SIGCHLD) { + got_SIGCHLD = 0; + + /* Handle signalled event here; e.g., wait() for all + terminated children. (Code omitted.) */ + } + + /* main body of program */ + } +} +.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 +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 +2. +.\"O The value \fInfds\fP must be properly calculated for efficiency as +.\"O explained above. +¾å½Ò¤·¤¿¤è¤¦¤Ë¡¢ +¸úΨŪ¤Ê¥×¥í¥°¥é¥à¤ò½ñ¤¯¤Ë¤Ï +.I nfds +¤ÎÃͤòŬÀڤ˷׻»¤·¤ÆÍ¿¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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 () +¥³¡¼¥ë¤Î½ªÎ»¸å¤Ë·ë²Ì¤ò¥Á¥§¥Ã¥¯¤·¤Æ¡¢ +ŬÀÚ¤ËÂбþ¤¹¤ë¤Ä¤â¤ê¤Î¤Ê¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢ +¤É¤Î½¸¹ç¤Ë¤â²Ã¤¨¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¼¡¤Î¥ë¡¼¥ë¤â»²¾È¡£ +.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 +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 ¥Ð¥¤¥È¤·¤«Á÷¼õ¿®¤Ç¤­¤Ê¤¤¤è¤¦¤Ê¾ì¹ç¤â +¹Íθ¤ËÆþ¤ì¤Æ¤ä¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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 ¥Ð¥¤¥È¤Ë¤·¤Æ¤¤¤ë¤¬¡¢ +¤³¤Î¥µ¥¤¥º¤òÂ礭¤¯¤¹¤ë¤Î¤Ï´Êñ¤À¤í¤¦¡£ +.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 +¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¤À¤í¤¦¡£ +.\" ¤½¤ì¤Ç¤â¤Ê¤ª¡¢´°Á´¤ò´ü¤¹¤ë¤Ê¤é¤Ð¡¢ +.\" ¤³¤ì¤é¤Î¥¨¥é¡¼¤ò¹Íθ¤ËÆþ¤ì¤ëɬÍפ¬¤¢¤ë¡£ +.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) +¤ò¸Æ¤Ó½Ð¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.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 +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 +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 ¥Ç¡¼¥¿¤òÀµ¤·¤¯½èÍý¤·¤Ê¤¤¤é¤·¤¤¡£ +.\" ¤Þ¤¿¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Á´¤¯¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤è¤¦¤Ê +.\" .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 () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢¤³¤ì¤òÂåÍѤǤ­¤ë¡£ +°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¡£ +.PP +.nf + struct timeval tv; + tv.tv_sec = 0; + tv.tv_usec = 200000; /* 0.2 seconds */ + 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 () +¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Ë»Ä¤Ã¤Æ¤¤¤ë +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÁí¿ô¤òÊÖ¤¹¡£ + +.\"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 ¤Ë¤Ê¤ë¡£ +¤½¤Î»þ¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Ï¤¹¤Ù¤Æ¶õ¤Ç¤¢¤ë +(¤·¤«¤·¤½¤¦¤Ê¤é¤Ê¤¤¥·¥¹¥Æ¥à¤â¤¢¤ë)¡£ + +.\"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 +¤òÊѹ¹¤·¤Ê¤¤¡£ +.\"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¡¢¥·¥°¥Ê¥ë¡¢¥á¥â¥ê¶¦Í­¡¢ +Åù¡¹¤ò»È¤Ã¤Æ¤â¤Ã¤ÈÊ£»¨¤ÊÊýË¡¤Ç²ò·è¤·¤è¤¦¤È¤¹¤ë¿¤¯¤ÎÌäÂ꤬¡¢ +°Ü¿¢À­¤¬¤¢¤ê¤«¤Ä¸úΨŪ¤ÊÊýË¡¤Ç²ò·è¤Ç¤­¤ë¡£ +.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 () +¤è¤ê°Ü¿¢À­¤ÎÌ̤ÇÎô¤Ã¤Æ¤¤¤¿¡£ +.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 +.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 ¥Õ¥©¥ï¡¼¥É¥×¥í¥°¥é¥à¤Ç¤¢¤ë¡£ +.PP +.nf +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int forward_port; + +#undef max +#define max(x,y) ((x) > (y) ? (x) : (y)) + +static int +listen_socket(int listen_port) +{ + struct sockaddr_in a; + int s; + int yes; + + if ((s = socket(AF_INET, SOCK_STREAM, 0)) == \-1) { + perror("socket"); + return \-1; + } + yes = 1; + if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, + (char *) &yes, sizeof(yes)) == \-1) { + perror("setsockopt"); + close(s); + return \-1; + } + memset(&a, 0, sizeof(a)); + a.sin_port = htons(listen_port); + a.sin_family = AF_INET; + if (bind(s, (struct sockaddr *) &a, sizeof(a)) == \-1) { + perror("bind"); + close(s); + return \-1; + } + printf("accepting connections on port %d\\n", listen_port); + listen(s, 10); + return s; +} + +static int +connect_socket(int connect_port, char *address) +{ + struct sockaddr_in a; + int s; + + if ((s = socket(AF_INET, SOCK_STREAM, 0)) == \-1) { + perror("socket"); + close(s); + return \-1; + } + + memset(&a, 0, sizeof(a)); + a.sin_port = htons(connect_port); + a.sin_family = AF_INET; + + if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) { + perror("bad IP address format"); + close(s); + return \-1; + } + + if (connect(s, (struct sockaddr *) &a, sizeof(a)) == \-1) { + perror("connect()"); + shutdown(s, SHUT_RDWR); + close(s); + return \-1; + } + return s; +} + +#define SHUT_FD1 do { \\ + if (fd1 >= 0) { \\ + shutdown(fd1, SHUT_RDWR); \\ + close(fd1); \\ + fd1 = \-1; \\ + } \\ + } while (0) + +#define SHUT_FD2 do { \\ + if (fd2 >= 0) { \\ + shutdown(fd2, SHUT_RDWR); \\ + close(fd2); \\ + fd2 = \-1; \\ + } \\ + } while (0) + +#define BUF_SIZE 1024 + +int +main(int argc, char *argv[]) +{ + int h; + int fd1 = \-1, fd2 = \-1; + char buf1[BUF_SIZE], buf2[BUF_SIZE]; + int buf1_avail, buf1_written; + int buf2_avail, buf2_written; + + if (argc != 4) { + fprintf(stderr, "Usage\\n\\tfwd " + " \\n"); + exit(EXIT_FAILURE); + } + + signal(SIGPIPE, SIG_IGN); + + forward_port = atoi(argv[2]); + + h = listen_socket(atoi(argv[1])); + if (h == \-1) + exit(EXIT_FAILURE); + + for (;;) { + int r, nfds = 0; + fd_set rd, wr, er; + + FD_ZERO(&rd); + FD_ZERO(&wr); + FD_ZERO(&er); + FD_SET(h, &rd); + nfds = max(nfds, h); + if (fd1 > 0 && buf1_avail < BUF_SIZE) { + FD_SET(fd1, &rd); + nfds = max(nfds, fd1); + } + if (fd2 > 0 && buf2_avail < BUF_SIZE) { + FD_SET(fd2, &rd); + nfds = max(nfds, fd2); + } + if (fd1 > 0 && buf2_avail \- buf2_written > 0) { + FD_SET(fd1, &wr); + nfds = max(nfds, fd1); + } + if (fd2 > 0 && buf1_avail \- buf1_written > 0) { + FD_SET(fd2, &wr); + nfds = max(nfds, fd2); + } + if (fd1 > 0) { + FD_SET(fd1, &er); + nfds = max(nfds, fd1); + } + if (fd2 > 0) { + FD_SET(fd2, &er); + nfds = max(nfds, fd2); + } + + r = select(nfds + 1, &rd, &wr, &er, NULL); + + if (r == \-1 && errno == EINTR) + continue; + + if (r == \-1) { + perror("select()"); + exit(EXIT_FAILURE); + } + + if (FD_ISSET(h, &rd)) { + unsigned int l; + struct sockaddr_in client_address; + + memset(&client_address, 0, l = sizeof(client_address)); + r = accept(h, (struct sockaddr *) &client_address, &l); + if (r == \-1) { + perror("accept()"); + } else { + SHUT_FD1; + SHUT_FD2; + buf1_avail = buf1_written = 0; + buf2_avail = buf2_written = 0; + fd1 = r; + fd2 = connect_socket(forward_port, argv[3]); + if (fd2 == \-1) + SHUT_FD1; + else + printf("connect from %s\\n", + inet_ntoa(client_address.sin_addr)); + } + } + + /* NB: read oob data before normal reads */ + + if (fd1 > 0) + if (FD_ISSET(fd1, &er)) { + char c; + + r = recv(fd1, &c, 1, MSG_OOB); + if (r < 1) + SHUT_FD1; + else + send(fd2, &c, 1, MSG_OOB); + } + if (fd2 > 0) + if (FD_ISSET(fd2, &er)) { + char c; + + r = recv(fd2, &c, 1, MSG_OOB); + if (r < 1) + SHUT_FD1; + else + send(fd1, &c, 1, MSG_OOB); + } + if (fd1 > 0) + if (FD_ISSET(fd1, &rd)) { + r = read(fd1, buf1 + buf1_avail, + BUF_SIZE \- buf1_avail); + if (r < 1) + SHUT_FD1; + else + buf1_avail += r; + } + if (fd2 > 0) + if (FD_ISSET(fd2, &rd)) { + r = read(fd2, buf2 + buf2_avail, + BUF_SIZE \- buf2_avail); + if (r < 1) + SHUT_FD2; + else + buf2_avail += r; + } + if (fd1 > 0) + if (FD_ISSET(fd1, &wr)) { + r = write(fd1, buf2 + buf2_written, + buf2_avail \- buf2_written); + if (r < 1) + SHUT_FD1; + else + buf2_written += r; + } + if (fd2 > 0) + if (FD_ISSET(fd2, &wr)) { + r = write(fd2, buf1 + buf1_written, + buf1_avail \- buf1_written); + if (r < 1) + SHUT_FD2; + else + buf1_written += r; + } + + /* check if write data has caught read data */ + + if (buf1_written == buf1_avail) + buf1_written = buf1_avail = 0; + if (buf2_written == buf2_avail) + buf2_written = buf2_avail = 0; + + /* one side has closed the connection, keep + writing to the other side until empty */ + + if (fd1 < 0 && buf1_avail \- buf1_written == 0) + SHUT_FD2; + if (fd2 < 0 && buf2_avail \- buf2_written == 0) + SHUT_FD1; + } + exit(EXIT_SUCCESS); +} +.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 ¤ò¥»¥Ã¥È¤¹¤ì¤ÐÎɤ¤¡¢¤È¤¤¤¦¥¢¥¤¥Ç¥¢¤â¤¢¤ë¤À¤í¤¦¡£ +¤³¤ì¤Ë¤â¼ÂºÝ¤Ë¤ÏÌäÂ꤬¤¢¤ê¡¢¥¿¥¤¥à¥¢¥¦¥È¤¬Èó¸úΨŪ¤Ëµ¯¤³¤Ã¤Æ¤·¤Þ¤¦¡£ + +.\"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 \(em one 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) +.\" .SH AUTHORS +.\" This man page was written by Paul Sheer. diff --git a/draft/man2/semctl.2 b/draft/man2/semctl.2 new file mode 100644 index 00000000..211326b5 --- /dev/null +++ b/draft/man2/semctl.2 @@ -0,0 +1,894 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" and Copyright 2004, 2005 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 Tue Oct 22 17:53:56 1996 by Eric S. Raymond +.\" Modified Fri Jun 19 10:59:15 1998 by Andries Brouwer +.\" Modified Sun Feb 18 01:59:29 2001 by Andries Brouwer +.\" Modified 20 Dec 2001, Michael Kerrisk +.\" Modified 21 Dec 2001, aeb +.\" Modified 27 May 2004, Michael Kerrisk +.\" Added notes on CAP_IPC_OWNER requirement +.\" Modified 17 Jun 2004, Michael Kerrisk +.\" Added notes on CAP_SYS_ADMIN requirement for IPC_SET and IPC_RMID +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Rewrote semun text +.\" Added semid_ds and ipc_perm structure definitions +.\" 2005-08-02, mtk: Added IPC_INFO, SEM_INFO, SEM_STAT descriptions. +.\" +.\" Japanese Version Copyright (c) 1997,1998 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Modified 1998-09-10, HANATAKA Shinya +.\" Updated & Modified 2001-06-03, Yuichi SATO +.\" Updated & Modified 2002-01-02, Yuichi SATO +.\" Updated & Modified 2005-01-03, Yuichi SATO +.\" Updated & Modified 2005-10-10, Akihiro MOTOKI +.\" +.\"WORD: semaphore ¥»¥Þ¥Õ¥© +.\"WORD: semaphore set ¥»¥Þ¥Õ¥©½¸¹ç +.\"WORD: union ¶¦ÍÑÂÎ +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡ +.\"WORD: member ¥á¥ó¥Ð¡¼ +.\"WORD: superuser ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶ +.\"WORD: effective uid ¼Â¸ú¥æ¡¼¥¶ ID +.\"WORD: creator ºîÀ®¼Ô +.\"WORD: owner ½êÍ­¼Ô +.\"WORD: entry ¥¨¥ó¥È¥ê +.\"WORD: undo ¥¢¥ó¥É¥¥ +.\"WORD: implement ¼ÂÁõ +.\"WORD: feature test macro µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\" +.TH SEMCTL 2 2009-09-27 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O semctl \- semaphore control operations +semctl \- ¥»¥Þ¥Õ¥©¤ÎÀ©¸æÁàºî¤ò¹Ô¤Ê¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int semctl(int " semid ", int " semnum ", int " cmd ", ...);" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR semctl () +.\"O performs the control operation specified by +.\"O .I cmd +.\"O on the semaphore set identified by +.\"O .IR semid , +.\"O or on the +.\"O .IR semnum -th +.\"O semaphore of that set. +.\"O (The semaphores in a set are numbered starting at 0.) +.BR semctl () +¤Ï¡¢ +.I semid +¤Ç»ØÄꤵ¤ì¤¿¥»¥Þ¥Õ¥©½¸¹ç (semaphore set) +¤Þ¤¿¤Ï¥»¥Þ¥Õ¥©½¸¹ç¤Î +.I semnun +ÈÖÌܤΥ»¥Þ¥Õ¥©¤ËÂФ·¤Æ¡¢ +.I cmd +¤Ç»ØÄꤵ¤ì¤¿À©¸æÁàºî¤ò¹Ô¤Ê¤¦ +(½¸¹çÆâ¤Î¥»¥Þ¥Õ¥©¤ÎÈÖ¹æ¤Ï 0 ¤«¤é»Ï¤Þ¤ë)¡£ +.PP +.\"O This function has three or four arguments, depending on +.\"O .IR cmd . +.\"O When there are four, the fourth has the type +.\"O .IR "union semun" . +.\"O The \fIcalling program\fP must define this union as follows: +¤³¤Î´Ø¿ô¤Ï¡¢ +.I cmd +¤ÎÃͤ˰͸¤·¤Æ¡¢3 ¸Ä¤Þ¤¿¤Ï 4 ¸Ä¤Î°ú¤­¿ô¤ò»ý¤Ä¡£ +°ú¤­¿ô¤¬ 4 ¸Ä¤Î¾ì¹ç¡¢Âè 4 °ú¤­¿ô¤Î·¿¤Ï +.I "union semun" +¤Ç¤¢¤ë¡£ +\fI¸Æ¤Ó½Ð¤·¸µ¥×¥í¥°¥é¥à\fP¤Ï¡¢ +¤³¤Î¶¦ÍÑÂÎ (union) ¤ò°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.nf +.in +4n +union semun { +.\"O int val; /* Value for SETVAL */ + int val; /* SETVAL ¤ÎÃÍ */ +.\"O struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ + struct semid_ds *buf; /* IPC_STAT, IPC_SET ÍѤΥХåե¡ */ +.\"O unsigned short *array; /* Array for GETALL, SETALL */ + unsigned short *array; /* GETALL, SETALL ÍѤÎÇÛÎó */ +.\"O struct seminfo *__buf; /* Buffer for IPC_INFO +.\"O (Linux-specific) */ + struct seminfo *__buf; /* IPC_INFO ÍѤΥХåե¡ + (Linux ¸ÇÍ­) */ +}; +.in +.fi +.PP +.\"O The +.\"O .I semid_ds +.\"O data structure is defined in \fI\fP as follows: +.I semid_ds +¥Ç¡¼¥¿¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.nf +.in +4n + +struct semid_ds { +.\"O struct ipc_perm sem_perm; /* Ownership and permissions */ + struct ipc_perm sem_perm; /* ½êÍ­¸¢¤Èµö²Ä */ +.\"O time_t sem_otime; /* Last semop time */ + time_t sem_otime; /* ºÇ¸å¤Î semop ¤Î»þ¹ï */ +.\"O time_t sem_ctime; /* Last change time */ + time_t sem_ctime; /* ºÇ¸å¤ËÊѹ¹¤¬¹Ô¤ï¤ì¤¿»þ¹ï */ +.\"O unsigned short sem_nsems; /* No. of semaphores in set */ + unsigned short sem_nsems; /* ½¸¹çÆâ¤Î¥»¥Þ¥Õ¥©¤Î¿ô */ +}; +.fi +.PP +.in +.fi +.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 +¤ò»È¤Ã¤ÆÀßÄê²Äǽ¤Ç¤¢¤ë): +.PP +.nf +.in +4n +struct ipc_perm { +.\"O key_t __key; /* Key supplied to semget(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 */ + key_t __key; /* semget(2) ¤ËÍ¿¤¨¤é¤ì¤ë¥­¡¼ */ + uid_t \fBuid\fP; /* ½êÍ­¼Ô (owner) ¤Î¼Â¸ú UID */ + gid_t \fBgid\fP; /* ½êÍ­¼Ô¤Î¼Â¸ú GID */ + uid_t cuid; /* ºîÀ®¼Ô (creator) ¤Î¼Â¸ú UID */ + gid_t cgid; /* ºîÀ®¼Ô¤Î¼Â¸ú GID */ +.\"O unsigned short \fBmode\fP; /* Permissions */ + unsigned short \fBmode\fP; /* µö²Ä */ +.\"O unsigned short __seq; /* Sequence number */ + unsigned short __seq; /* ¥·¡¼¥±¥ó¥¹ÈÖ¹æ */ +}; +.in +.fi +.PP +.\"O Valid values for +.\"O .I cmd +.\"O are: +.I cmd +¤È¤·¤ÆÍ­¸ú¤ÊÃÍ¤Ï +.TP 10 +.B IPC_STAT +.\"O Copy information from the kernel data structure associated with +.\"O .I semid +.\"O into the +.\"O .I semid_ds +.\"O structure pointed to by +.\"O .IR arg.buf . +.I semid +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥«¡¼¥Í¥ë¥Ç¡¼¥¿¹½Â¤ÂΤξðÊó¤ò +.I arg.buf +¤Ç»Ø¤µ¤ì¤¿ +.I semid_ds +¹½Â¤ÂΤإ³¥Ô¡¼¤¹¤ë¡£ +.\"O The argument +.\"O .I semnum +.\"O is ignored. +.\"O The calling process must have read permission on the semaphore set. +.I semnum +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÂФ¹¤ë +Æɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B IPC_SET +.\"O Write the values of some members of the +.\"O .I semid_ds +.\"O structure pointed to by +.\"O .I arg.buf +.\"O to the kernel data structure associated with this semaphore set, +.\"O updating also its +.\"O .I sem_ctime +.I arg.buf +¤Ç»ØÄꤵ¤ì¤¿ +.I semid_ds +¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Î¤¤¤¯¤Ä¤«¤ÎÃͤò¡¢ +¤³¤Î¥»¥Þ¥Õ¥©¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥«¡¼¥Í¥ë¥Ç¡¼¥¿¹½Â¤ÂΤ˽ñ¤­¹þ¤ß¡¢ +.I sem_ctime +¥á¥ó¥Ð¡¼¤ÎÃͤ⹹¿·¤¹¤ë¡£ +.\"O The following members of the structure are updated: +.\"O .IR sem_perm.uid , +.\"O .IR sem_perm.gid , +.\"O and (the least significant 9 bits of) +.\"O .IR sem_perm.mode . +¹½Â¤ÂΤΰʲ¼¤Î¥á¥ó¥Ð¡¼¤¬¹¹¿·¤µ¤ì¤ë: +.IR sem_perm.uid , +.IR sem_perm.gid , +.I sem_perm.mode +(¤ÎºÇ²¼°Ì 9 ¥Ó¥Ã¥È)¡£ +.\"O The effective UID of the calling process must match the owner +.\"O .RI ( sem_perm.uid ) +.\"O or creator +.\"O .RI ( sem_perm.cuid ) +.\"O of the semaphore set, or the caller must be privileged. +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤¬½êÍ­¼Ô +.RI ( sem_perm.uid ) +¤Þ¤¿¤ÏºîÀ®¼Ô +.RI ( sem_perm.cuid ) +¤È°ìÃפ¹¤ë¤«¡¢¸Æ¤Ó½Ð¤·¤¿¿Í¤¬Æø¢¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O The argument +.\"O .I semnum +.\"O is ignored. +.I semnum +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.B IPC_RMID +.\"O Immediately remove the semaphore set, +.\"O awakening all processes blocked in +.\"O .BR semop (2) +.\"O calls on the set (with an error return and +.\"O .I errno +.\"O set to +.\"O .BR EIDRM ). +¥»¥Þ¥Õ¥©½¸¹ç¤ò¤¿¤À¤Á¤Ëºï½ü¤·¡¢¤½¤Î½¸¹ç¾å¤Î +.BR semop (2) +¥³¡¼¥ë¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥×¥í¥»¥¹¤òÌܳФᤵ¤»¤ë +(¥¨¥é¡¼Ãͤ¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë +.B EIDRM +¤¬ÀßÄꤵ¤ì¤ë)¡£ +.\"O The effective user ID of the calling process must +.\"O match the creator or owner of the semaphore set, +.\"O or the caller must be privileged. +.\"O The argument +.\"O .I semnum +.\"O is ignored. +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬ +¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ÎºîÀ®¼Ô¤Þ¤¿¤Ï½êÍ­¼Ô¤È°ìÃפ¹¤ë¤«¡¢ +¸Æ¤Ó½Ð¤·¤¿¿Í¤¬Æø¢¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I semnum +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.\"O .BR IPC_INFO " (Linux-specific)" +.BR IPC_INFO " (Linux ¸ÇÍ­)" +.\"O Returns information about system-wide semaphore limits and +.\"O parameters in the structure pointed to by +.\"O .IR arg.__buf . +¥·¥¹¥Æ¥àÁ´ÂΤǤΥ»¥Þ¥Õ¥©¤ÎÀ©¸Â¤È¥Ñ¥é¥á¡¼¥¿¤Ë´Ø¤¹¤ë¾ðÊó¤ò¡¢ +.I arg.__buf +¤¬»Ø¤¹¹½Â¤ÂΤËÆþ¤ì¤ÆÊÖ¤¹¡£ +.\"O This structure is of type +.\"O .IR seminfo , +.\"O defined in +.\"O .I +.\"O if the +.\"O .B _GNU_SOURCE +.\"O feature test macro is defined: +¤³¤Î¹½Â¤ÂÎ¤Ï +.I seminfo +·¿¤Ç¤¢¤ë¡£ +.I seminfo +¤Ï +.B _GNU_SOURCE +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.nf +.in +4n + +struct seminfo { +.\"O int semmap; /* Number of entries in semaphore +.\"O map; unused within kernel */ +.\"O int semmni; /* Maximum number of semaphore sets */ +.\"O int semmns; /* Maximum number of semaphores in all +.\"O semaphore sets */ +.\"O int semmnu; /* System-wide maximum number of undo +.\"O structures; unused within kernel */ +.\"O int semmsl; /* Maximum number of semaphores in a +.\"O set */ +.\"O int semopm; /* Maximum number of operations for +.\"O semop(2) */ +.\"O int semume; /* Maximum number of undo entries per +.\"O process; unused within kernel */ +.\"O int semusz; /* Size of struct sem_undo */ +.\"O int semvmx; /* Maximum semaphore value */ +.\"O int semaem; /* Max. value that can be recorded for +.\"O semaphore adjustment (SEM_UNDO) */ + int semmap; /* ¥»¥Þ¥Õ¥©¡¦¥Þ¥Ã¥×¤ÎºÇÂ票¥ó¥È¥ê¿ô; + ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + int semmni; /* ¥»¥Þ¥Õ¥©½¸¹ç¤ÎºÇÂç¿ô */ + int semmns; /* Á´¥»¥Þ¥Õ¥©½¸¹çÃæ¤Î¥»¥Þ¥Õ¥©¤Î + ºÇÂç¿ô */ + int semmnu; /* ¥¢¥ó¥É¥¥¹½Â¤ÂΤΥ·¥¹¥Æ¥àÁ´ÂΤǤΠ+ ºÇÂç¿ô; ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + int semmsl; /* °ì¤Ä¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ÎºÇÂ祻¥Þ¥Õ¥©¿ô */ + int semopm; /* semop(2) ¤ËÅϤ¹Áàºî¤ÎºÇÂç¿ô */ + int semume; /* ¥×¥í¥»¥¹¤¢¤¿¤ê¤Î¥¢¥ó¥É¥¥¡¦¥¨¥ó¥È¥ê + ¤ÎºÇÂç¿ô; ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + int semusz; /* ¹½Â¤ÂÎ sem_undo ¤Î¥µ¥¤¥º */ + int semvmx; /* ¥»¥Þ¥Õ¥©¤ÎºÇÂçÃÍ */ + int semaem; /* ¥»¥Þ¥Õ¥©¤ÎÄ´À° (semaphore adjustment; + SEM_UNDO) ¤Î¤¿¤á¤Ëµ­Ï¿¤µ¤ì¤ëºÇÂçÃÍ */ +}; + +.in +.fi +.\"O The +.\"O .IR semmsl , +.\"O .IR semmns , +.\"O .IR semopm , +.\"O and +.\"O .I semmni +.\"O settings can be changed via +.\"O .IR /proc/sys/kernel/sem ; +.\"O see +.\"O .BR proc (5) +.\"O for details. +ÀßÄê +.IR semmsl , +.IR semmns , +.IR semopm , +.I semmni +¤Ï +.I /proc/sys/kernel/sem +·Ðͳ¤ÇÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +¾Ü¤·¤¯¤Ï +.BR proc (5) +¤ò»²¾È¡£ +.TP +.\"O .BR SEM_INFO " (Linux-specific)" +.BR SEM_INFO " (Linux ¸ÇÍ­)" +.\"O Returns a +.\"O .I seminfo +.\"O structure containing the same information as for +.\"O .BR IPC_INFO , +.\"O except that the following fields are returned with information +.\"O about system resources consumed by semaphores: the +.\"O .I semusz +.\"O field returns the number of semaphore sets that currently exist +.\"O on the system; and the +.\"O .I semaem +.\"O field returns the total number of semaphores in all semaphore sets +.\"O on the system. +.B IPC_INFO +¤Î¤È¤­¤ÈƱ¤¸¾ðÊó¤ò³ÊǼ¤·¤¿ +.I seminfo +¹½Â¤ÂΤòÊÖ¤¹¡£ +⤷¡¢°Ê²¼¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥»¥Þ¥Õ¥©¤¬¾ÃÈñ¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à»ñ¸»¤Ë +´Ø¤¹¤ë¾ðÊ󤬳ÊǼ¤µ¤ì¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +.I semusz +¥Õ¥£¡¼¥ë¥É¤Ï¸½ºß¥·¥¹¥Æ¥à¾å¤Ë¸ºß¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤Î¿ô¤òÊÖ¤¹¡£ +.I semaem +¥Õ¥£¡¼¥ë¥É¤Ï¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Ë´Þ¤Þ¤ì¤ë +¥»¥Þ¥Õ¥©¤ÎÁí¿ô¤òÊÖ¤¹¡£ +.TP +.\"O .BR SEM_STAT " (Linux-specific)" +.BR SEM_STAT " (Linux ¸ÇÍ­)" +.\"O Returns a +.\"O .I semid_ds +.\"O structure as for +.\"O .BR IPC_STAT . +.B IPC_STAT +¤ÈƱ¤¸¤¯ +.I semid_ds +¹½Â¤ÂΤòÊÖ¤¹¡£ +.\"O However, the +.\"O .I semid +.\"O argument is not a semaphore identifier, but instead an index into +.\"O the kernel's internal array that maintains information about +.\"O all semaphore sets on the system. +⤷¡¢ +.I semid +°ú¤­¿ô¤Ï¡¢¥»¥Þ¥Õ¥©¼±Ê̻ҤǤϤʤ¯¡¢¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¥»¥Þ¥Õ¥©½¸¹ç +¤Ë´Ø¤¹¤ë¾ðÊó¤ò´ÉÍý¤¹¤ë¥«¡¼¥Í¥ë¤ÎÆâÉôÇÛÎó¤Ø¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤¢¤ë¡£ +.TP +.B GETALL +.\"O Return +.\"O .B semval +.\"O (i.e., the current value) +.\"O for all semaphores of the set into +.\"O .IR arg.array . +.\"O The argument +.\"O .I semnum +.\"O is ignored. +.\"O The calling process must have read permission on the semaphore set. +½¸¹ç¤ÎÁ´¤Æ¤Î¥»¥Þ¥Õ¥©¤Î +.B semval +¤ÎÃÍ (¸½ºß¤ÎÃÍ) ¤ò +.I arg.array +¤ËÊÖ¤¹¡£ +.I semnum +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÆɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B GETNCNT +.\"O The system call returns the value of +.\"O .B semncnt +.\"O for the +.\"O .IR semnum \-th +.\"O semaphore of the set +.\"O (i.e., the number of processes waiting for an increase of +.\"O .B semval +.\"O for the +.\"O .IR semnum \-th +.\"O semaphore of the set). +.\"O The calling process must have read permission on the semaphore set. +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B semncnt +¤ÎÃͤòÊÖ¤¹ (½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B semval +¤ÎÁý²Ã¤òÂԤäƤ¤¤ë¥×¥í¥»¥¹¤Î¿ô¤òÊÖ¤¹)¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÆɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B GETPID +.\"O The system call returns the value of +.\"O .B sempid +.\"O for the +.\"O .IR semnum \-th +.\"O semaphore of the set +.\"O (i.e., the PID of the process that executed the last +.\"O .BR semop (2) +.\"O call for the +.\"O .IR semnum \-th +.\"O semaphore of the set). +.\"O The calling process must have read permission on the semaphore set. +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B sempid +¤ÎÃÍ (½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤ËºÇ¸å¤Ë +.BR semop (2) +¥³¡¼¥ë¤ò¼Â¹Ô¤·¤¿¥×¥í¥»¥¹¤Î PID) ¤òÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÆɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B GETVAL +.\"O The system call returns the value of +.\"O .B semval +.\"O for the +.\"O .IR semnum \-th +.\"O semaphore of the set. +.\"O The calling process must have read permission on the semaphore set. +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B semval +¤ÎÃͤòÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÆɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B GETZCNT +.\"O The system call returns the value of +.\"O .B semzcnt +.\"O for the +.\"O .IR semnum \-th +.\"O semaphore of the set +.\"O (i.e., the number of processes waiting for +.\"O .B semval +.\"O of the +.\"O .IR semnum \-th +.\"O semaphore of the set to become 0). +.\"O The calling process must have read permission on the semaphore set. +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B semzcnt +¤ÎÃͤòÊÖ¤¹ (½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B semval +¤ÎÃͤ¬ 0 ¤Ë¤Ê¤ë¤Î¤òÂԤäƤ¤¤ë¥×¥í¥»¥¹¤Î¿ô¤òÊÖ¤¹)¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÆɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B SETALL +.\"O Set +.\"O .B semval +.\"O for all semaphores of the set using +.\"O .IR arg.array , +.\"O updating also the +.\"O .I sem_ctime +.\"O member of the +.\"O .I semid_ds +.\"O structure associated with the set. +½¸¹ç¤ÎÁ´¤Æ¤Î¥»¥Þ¥Õ¥©¤Î +.B semval +¤Ë +.I arg.array +¤Ç»ØÄꤵ¤ì¤¿ÃͤòÀßÄꤹ¤ë¡£ +¤½¤Î½¸¹ç¤Ë´ØÏ¢¤¹¤ë +.I semid_ds +¹½Â¤ÂΤΠ+.I sem_ctime +¥á¥ó¥Ð¡¼¤ÎÃͤ⹹¿·¤¹¤ë¡£ +.\"O Undo entries (see +.\"O .BR semop (2)) +.\"O are cleared for altered semaphores in all processes. +.\"O If the changes to semaphore values would permit blocked +.\"O .BR semop (2) +.\"O calls in other processes to proceed, then those processes are woken up. +Á´¤Æ¤Î¥×¥í¥»¥¹¤Î¥»¥Þ¥Õ¥©¤ÎÊѹ¹¤Ë¤Ä¤¤¤Æ¤Î¥¢¥ó¥É¥¥¡¦¥¨¥ó¥È¥ê +.RB ( semop (2) +¤ò»²¾È) ¤Ï¾Ãµî (clear) ¤µ¤ì¤ë¡£ +¥»¥Þ¥Õ¥©¤ÎÃͤÎÊѹ¹¤Ë¤è¤ê¡¢Â¾¤Î¥×¥í¥»¥¹Æâ¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë +.BR semop (2) +¥³¡¼¥ë¤Î³¹Ô¤¬µö²Ä¤µ¤ì¤ë¤È¡¢¤½¤ì¤é¤Î¥×¥í¥»¥¹¤Ïµ¯¤³¤µ¤ì¤ë (wake up)¡£ +.\"O The argument +.\"O .I semnum +.\"O is ignored. +.\"O The calling process must have alter (write) permission on +.\"O the semaphore set. +.I semnum +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Ë +Êѹ¹ (½ñ¤­¹þ¤ß) µö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B SETVAL +.\"O Set the value of +.\"O .B semval +.\"O to +.\"O .I arg.val +.\"O for the +.\"O .IR semnum \-th +.\"O semaphore of the set, updating also the +.\"O .I sem_ctime +.\"O member of the +.\"O .I semid_ds +.\"O structure associated with the set. +½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B semval +¤Ë +.I arg.val +¤ÎÃͤòÀßÄꤹ¤ë¡£¤½¤Î½¸¹ç¤Ë´ØÏ¢¤¹¤ë +.I semid_ds +¹½Â¤ÂΤΠ+.I sem_ctime +¥á¥ó¥Ð¡¼¤ÎÃͤ⹹¿·¤¹¤ë¡£ +.\"O Undo entries are cleared for altered semaphores in all processes. +.\"O If the changes to semaphore values would permit blocked +.\"O .BR semop (2) +.\"O calls in other processes to proceed, then those processes are woken up. +.\"O The calling process must have alter permission on the semaphore set. +Á´¤Æ¤Î¥×¥í¥»¥¹¤Î¥»¥Þ¥Õ¥©¤ÎÊѹ¹¤Ë¤Ä¤¤¤Æ¤Î¥¢¥ó¥É¥¥¡¦¥¨¥ó¥È¥ê¤Ï¾Ãµî¤µ¤ì¤ë¡£ +¥»¥Þ¥Õ¥©¤ÎÃͤÎÊѹ¹¤Ë¤è¤ê¡¢Â¾¤Î¥×¥í¥»¥¹Æâ¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë +.BR semop (2) +¥³¡¼¥ë¤Î³¹Ô¤¬µö²Ä¤µ¤ì¤ë¤È¡¢¤½¤ì¤é¤Î¥×¥í¥»¥¹¤Ïµ¯¤³¤µ¤ì¤ë (wake up)¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Ë +Êѹ¹ (½ñ¤­¹þ¤ß) µö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On failure +.\"O .BR semctl () +.\"O returns \-1 +.\"O with +.\"O .I errno +.\"O indicating the error. +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.BR semctl () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¤½¤Î¥¨¥é¡¼¤ò¼¨¤¹¡£ + +.\"O Otherwise the system call returns a nonnegative value depending on +.\"O .I cmd +.\"O as follows: +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I cmd +¤Ë¤è¤Ã¤Æ°Ê²¼¤ÎÉé¤Ç¤Ê¤¤ÃͤòÊÖ¤¹: +.TP 12 +.B GETNCNT +.\"O the value of +.\"O .BR semncnt . +.B semncnt +¤ÎÃÍ +.TP +.B GETPID +.\"O the value of +.\"O .BR sempid . +.B sempid +¤ÎÃÍ +.TP +.B GETVAL +.\"O the value of +.\"O .BR semval . +.B semval +¤ÎÃÍ +.TP +.B GETZCNT +.\"O the value of +.\"O .BR semzcnt . +.B semzcnt +¤ÎÃÍ +.TP +.B IPC_INFO +.\"O the index of the highest used entry in the +.\"O kernel's internal array recording information about all +.\"O semaphore sets. +.\"O (This information can be used with repeated +.\"O .B SEM_STAT +.\"O operations to obtain information about all semaphore sets on the system.) +Á´¤Æ¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Ë´Ø¤¹¤ë¾ðÊó¤ò´ÉÍý¤·¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤ÎÆâÉôÇÛÎó¤Î»ÈÍÑÃæ +¥¨¥ó¥È¥ê¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎºÇÂçÃÍ +(¤³¤Î¾ðÊó¤Ï¡¢¥·¥¹¥Æ¥à¤ÎÁ´¤Æ¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Ë´Ø¤¹¤ë¾ðÊó¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë +.B SEM_STAT +Áàºî¤ò·«¤êÊÖ¤·¼Â¹Ô¤¹¤ëºÝ¤Ë»ÈÍѤǤ­¤ë) +.TP +.B SEM_INFO +.\"O As for +.\"O .BR IPC_INFO . +.B IPC_INFO +¤ÈƱ¤¸ +.TP +.B SEM_STAT +.\"O the identifier of the semaphore set whose index was given in +.\"O .IR semid . +.I semid +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¥»¥Þ¥Õ¥©½¸¹ç¤Î¼±ÊÌ»Ò +.LP +.\"O All other +.\"O .I cmd +.\"O values return 0 on success. +.I cmd +¤ÎÃͤ¬¤½¤ì°Ê³°¤Î¾ì¹ç¡¢À®¸ù¤¹¤ë¤È 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O On failure, +.\"O .I errno +.\"O will be set to one of the following: +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï +.I errno +¤Ë¤Ï°Ê²¼¤ÎÃͤΤɤ줫¤¬ÀßÄꤵ¤ì¤ë: +.TP +.B EACCES +.\"O The argument +.\"O .I cmd +.\"O has one of the values +.\"O .BR GETALL , +.\"O .BR GETPID , +.\"O .BR GETVAL , +.\"O .BR GETNCNT , +.\"O .BR GETZCNT , +.\"O .BR IPC_STAT , +.\"O .BR SEM_STAT , +.\"O .BR SETALL , +.\"O or +.\"O .B SETVAL +.\"O and the calling process does not have the required +.\"O permissions on the semaphore set and does not have the +.\"O .B CAP_IPC_OWNER +.\"O capability. +.I cmd +°ú¤­¿ô¤¬ +.BR GETALL , +.BR GETPID , +.BR GETVAL , +.BR GETNCNT , +.BR GETZCNT , +.BR IPC_STAT , +.BR SEM_STAT , +.BR SETALL , +.B SETVAL +¤Î¤¦¤Á¤Î²¿¤ì¤«¤ÎÃͤò»ý¤Á¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬¥»¥Þ¥Õ¥©¤ËÂФ·¤ÆɬÍפȤµ¤ì¤ëµö²Ä¤È +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +.\"O The address pointed to by +.\"O .I arg.buf +.\"O or +.\"O .I arg.array +.\"O isn't accessible. +.I arg.buf +¤Þ¤¿¤Ï +.I arg.array +¤Ç»Ø¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.B EIDRM +.\"O The semaphore set was removed. +¥»¥Þ¥Õ¥©½¸¹ç¤¬ºï½ü¤µ¤ì¤¿¡£ +.TP +.B EINVAL +.\"O Invalid value for +.\"O .I cmd +.\"O or +.\"O .IR semid . +.\"O Or: for a +.\"O .B SEM_STAT +.\"O operation, the index value specified in +.\"O .I semid +.\"O referred to an array slot that is currently unused. +.I cmd +¤Þ¤¿¤Ï +.I semid +¤Ë̵¸ú¤ÊÃͤ¬»ØÄꤵ¤ì¤¿¡£ +¤â¤·¤¯¤Ï¡¢ +.B SEM_STAT +Áàºî¤Î¾ì¹ç¤Ë¡¢ +.I semid +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹Ãͤ¬¸½ºß̤»ÈÍѤÎÇÛÎó¤Î¥¹¥í¥Ã¥È¤ò»²¾È¤¤¤Æ¤¤¤¿¡£ +.TP +.B EPERM +.\"O The argument +.\"O .I cmd +.\"O has the value +.\"O .B IPC_SET +.\"O or +.\"O .B IPC_RMID +.\"O but the effective user ID of the calling process is not the creator +.\"O (as found in +.\"O .IR sem_perm.cuid ) +.\"O or the owner +.\"O (as found in +.\"O .IR sem_perm.uid ) +.\"O of the semaphore set, +.\"O and the process does not have the +.\"O .B CAP_SYS_ADMIN +.\"O capability. +.I cmd +°ú¤­¿ô¤Ë +.B IPC_SET +¤Þ¤¿¤Ï +.B IPC_RMID +¤¬»ØÄꤵ¤ì¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬¥»¥Þ¥Õ¥©¤Î +.RI ( sem_perm.cuid +¤Ç¸«¤Ä¤«¤ë) ºîÀ®¼Ô¤Þ¤¿¤Ï +.RI ( sem_perm.uid +¤Ç¸«¤Ä¤«¤ë) ½êÍ­¼Ô¤Ç¤â¤Ê¤¯¡¢ +¥×¥í¥»¥¹¤¬ +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤¡£ +.TP +.B ERANGE +.\"O The argument +.\"O .I cmd +.\"O has the value +.\"O .B SETALL +.\"O or +.\"O .B SETVAL +.\"O and the value to which +.\"O .B semval +.\"O is to be set (for some semaphore of the set) is less than 0 +.\"O or greater than the implementation limit +.\"O .BR SEMVMX . +.I cmd +°ú¤­¿ô¤Ë +.B SETALL +¤Þ¤¿¤Ï +.B SETVAL +¤¬»ØÄꤵ¤ì¡¢(½¸¹ç¤Î¥»¥Þ¥Õ¥©¤Î¤É¤ì¤«¤Î) +.B semval +¤ËÀßÄꤵ¤ì¤ëÃͤ¬ 0 ¤è¤ê¾®¤µ¤¤¤«¡¢¼ÂÁõ¤ÎÀ©¸Â +.B SEMVMX +¤è¤ê¤âÂ礭¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O .\" SVr4 documents more error conditions EINVAL and EOVERFLOW. +.\" SVr4 ¤Ë¤Ï¡¢Â¾¤Ë EINVAL, EOVERFLOW ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The +.\"O .BR IPC_INFO , +.\"O .B SEM_STAT +.\"O and +.\"O .B SEM_INFO +.\"O operations are used by the +.\"O .BR ipcs (8) +.\"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 SEM_STAT , +.B SEM_INFO +Áàºî¤Ï +.BR ipcs (8) +¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ³äÅö¤é¤ì¤¿»ñ¸»¤Ë¤Ä¤¤¤Æ¾ðÊó¤òÄ󶡤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +¾­ÍèŪ¤Ë¤Ï¤³¤ì¤é¤ÏÊѹ¹¤µ¤ì¤ë¤«¡¢ +/proc ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë°ÜÆ°¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +.\"O Various fields in a \fIstruct semid_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¹½Â¤ÂÎ semid_ds\fP Æâ¤Î¿¤¯¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +Linux 2.2 ¤Ç¤Ï +.I short +·¿¤À¤Ã¤¿¤¬¡¢Linux 2.4 ¤Ç¤Ï +.I long +·¿¤Ë¤Ê¤Ã¤¿¡£ +¤³¤ÎÍøÅÀ¤òÀ¸¤«¤¹¤Ë¤Ï¡¢glibc-2.1.91 °Ê¹ß¤Î´Ä¶­²¼¤Ç +ºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ì¤Ð½½Ê¬¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¿·¤·¤¤·Á¼°¤Î¸Æ¤Ó½Ð¤·¤È¸Å¤¤·Á¼°¤Î¸Æ¤Ó½Ð¤·¤ò +.I cmd +Æâ¤Î +.B IPC_64 +¥Õ¥é¥°¤Ç¶èÊ̤¹¤ë¡£ +.PP +.\"O In some earlier versions of glibc, the +.\"O .I semun +.\"O union was defined in \fI\fP, but POSIX.1-2001 requires +.\"O that the caller define this union. +½é´ü¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢ +.I semun +¶¦ÍÑÂÎ¤Ï \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤¿¤¬¡¢ +POSIX.1-2001 ¤Ç¤Ï¸Æ¤Ó½Ð¤·Â¦¤¬¤³¤Î¶¦ÍÑÂΤòÄêµÁ¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.\"O On versions of glibc where this union is \fInot\fP defined, +.\"O the macro +.\"O .B _SEM_SEMUN_UNDEFINED +.\"O is defined in \fI\fP. +¤³¤Î¶¦ÍÑÂΤ¬ÄêµÁ¤µ¤ì¤Æ\fI¤¤¤Ê¤¤\fP glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ +¥Þ¥¯¥í +.B _SEM_SEMUN_UNDEFINED +¤¬ \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O The following system limit on semaphore sets affects a +.\"O .BR semctl () +.\"O call: +°Ê²¼¤Ï +.BR semctl () +¥³¡¼¥ë¤Ë±Æ¶Á¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤Î¥·¥¹¥Æ¥àÀ©¸Â: +.TP +.B SEMVMX +.\"O Maximum value for +.\"O .BR semval : +.\"O implementation dependent (32767). +.B semval +¤ÎºÇÂçÃÍ : ¼ÂÁõ°Í¸ (32767)¡£ +.LP +.\"O For greater portability it is best to always call +.\"O .BR semctl () +.\"O with four arguments. +°Ü¿¢À­¤ò¹â¤á¤ë¤¿¤á¤Î°ìÈÖÎɤ¤ÊýË¡¤Ï¡¢¾ï¤Ë 4 ¸Ä¤Î°ú¤­¿ô¤Ç +.BR semctl () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ipc (2), +.BR semget (2), +.BR semop (2), +.BR capabilities (7), +.BR sem_overview (7), +.BR svipc (7) diff --git a/draft/man2/semget.2 b/draft/man2/semget.2 new file mode 100644 index 00000000..9946384c --- /dev/null +++ b/draft/man2/semget.2 @@ -0,0 +1,509 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 Tue Oct 22 17:54:56 1996 by Eric S. Raymond +.\" Modified 1 Jan 2002, Martin Schulze +.\" Modified 4 Jan 2002, Michael Kerrisk +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added notes on /proc files +.\" Rewrote BUGS note about semget()'s failure to initialize +.\" semaphore values +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Updated 2003-04-08, Kentaro Shirakata +.\" Updated 2005-03-01, Akihiro MOTOKI +.\" Updated 2006-07-20, Akihiro MOTOKI, LDP v2.36 +.\" +.\"WORD: semaphore ¥»¥Þ¥Õ¥© +.\"WORD: identifier ¼±ÊÌ»Ò +.\"WORD: owner ½êÍ­¼Ô +.\"WORD: group ¥°¥ë¡¼¥× +.\"WORD: other ¾¿Í +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ ID +.\"WORD: effective group ID ¼Â¸ú¥°¥ë¡¼¥× ID +.\"WORD: calling process ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹ +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: policy Êý¿Ë +.\"WORD: structure ¹½Â¤ÂÎ +.\"WORD: initialize ½é´ü²½ +.\"WORD: system call ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë +.\" +.TH SEMGET 2 2004-05-27 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O semget \- get a semaphore set identifier +semget \- ¥»¥Þ¥Õ¥©½¸¹ç¤Î¼±Ê̻Ҥò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.fi +.sp +.BI "int semget(key_t " key , +.BI "int " nsems , +.BI "int " semflg ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR semget () +.\"O system call returns the semaphore set identifier +.\"O associated with the argument +.\"O .IR key . +.BR semget () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢°ú¤­¿ô +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç (semaphore set) ¤Î +¼±ÊÌ»Ò (identifier) ¤òÊÖ¤¹¡£ +.\"O A new set of +.\"O .I nsems +.\"O semaphores is created if +.\"O .I key +.\"O has the value +.\"O .B IPC_PRIVATE +.\"O or if no existing semaphore set is associated with +.\"O .I key +.\"O and +.\"O .B IPC_CREAT +.\"O is specified in +.\"O .IR semflg . +.I key +¤ÎÃͤ¬ +.B IPC_PRIVATE +¤Î¾ì¹ç¡¢¤â¤·¤¯¤Ï +.I semflg +¤Ë +.B IPC_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +.I nsems +¸Ä¤Î¥»¥Þ¥Õ¥©¤«¤é¤Ê¤ë¿·¤·¤¤½¸¹ç¤¬ºîÀ®¤µ¤ì¤ë¡£ +.PP +.\"O If +.\"O .I semflg +.\"O specifies both +.\"O .B IPC_CREAT +.\"O and +.\"O .B IPC_EXCL +.\"O and a semaphore set already exists for +.\"O .IR key , +.\"O then +.\"O .BR semget () +.\"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 semflg +¤Ë +.B IPC_CREAT +¤È +.B IPC_EXCL +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤¬´û¤Ë¸ºß¤¹¤ë¤È¡¢ +.BR semget () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EEXIST +¤¬ÀßÄꤵ¤ì¤ë +(¤³¤ì¤Ï +.BR open (2) +¤Ë +.B O_CREAT | O_EXCL +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤ÎÆ°ºî¤ÈƱ¤¸¤Ç¤¢¤ë)¡£ +.PP +.\"O Upon creation, the least significant 9 bits of the argument +.\"O .I semflg +.\"O define the permissions (for owner, group and others) +.\"O for the semaphore set. +.\"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 (though the execute permissions are +.\"O not meaningful for semaphores, and write permissions mean permission +.\"O to alter semaphore values). +¥»¥Þ¥Õ¥©½¸¹çºîÀ®»þ¤Ë¡¢°ú¤­¿ô +.I semflg +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤Ï¡¢¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Î (½êÍ­¼Ô (owner)¡¢¥°¥ë¡¼¥× (group)¡¢ +¾¿Í (others) ¤ËÂФ¹¤ë) ¥¢¥¯¥»¥¹µö²Ä¤ÎÄêµÁ¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +¤³¤ì¤é¤Î¥Ó¥Ã¥È¤Ï +.BR open (2) +¤Î°ú¤­¿ô +.I mode +¤ÈƱ¤¸·Á¼°¤ÇƱ¤¸°ÕÌ£¤Ç¤¢¤ë +(⤷¡¢¼Â¹Ô (execute) µö²Ä¤Ï¥»¥Þ¥Õ¥©¤Ç¤Ï°ÕÌ£¤ò»ý¤¿¤º¡¢ +½ñ¤­¹þ¤ß (write) µö²Ä¤Ï¥»¥Þ¥Õ¥©ÃͤÎÊѹ¹ (alter) µö²Ä¤È¤·¤Æµ¡Ç½¤¹¤ë)¡£ +.PP +.\"O The values of the semaphores in a newly created set are indeterminate. +.\"O (POSIX.1-2001 is explicit on this point.) +.\"O Although Linux, like many other implementations, +.\"O initializes the semaphore values to 0, +.\"O a portable application cannot rely on this: +.\"O it should explicitly initialize the semaphores to the desired values. +¿·¤·¤¯ºîÀ®¤µ¤ì¤¿¥»¥Þ¥Õ¥©½¸¹ç¤Î³Æ¥»¥Þ¥Õ¥©¤ÎÃͤÏÉÔÄê¤Ç¤¢¤ë +(¤³¤ÎÅÀ¤Ï POSIX.1-2001 ¤ËÌÀµ­¤µ¤ì¤Æ¤¤¤ë)¡£ +Linux ¤Ï¾¤Î¿¤¯¤Î¼ÂÁõ¤ÈƱÍͤ˥»¥Þ¥Õ¥©Ãͤò 0 ¤Ë½é´ü²½¤¹¤ë¤¬¡¢ +°Ü¿¢À­¤ò¹Íθ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤ÎÆ°ºî¤òÁ°Äó¤Ë¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÏÌÀ¼¨Åª¤Ë¥»¥Þ¥Õ¥©¤ò´õ˾¤ÎÃͤǽé´ü²½¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\" In truth, every one of the many implementations that I've tested sets +.\" the values to zero, but I suppose there is/was some obscure +.\" implementation out there that does not. +.PP +.\"O When creating a new semaphore set, +.\"O .BR semget () +.\"O initializes the set's associated data structure, +.\"O .I semid_ds +.\"O (see +.\"O .BR semctl (2)), +.\"O as follows: +¿·µ¬¤Î¥»¥Þ¥Õ¥©½¸¹ç¤òºîÀ®¤¹¤ëºÝ¡¢ +.BR semget () +¤Ï¥»¥Þ¥Õ¥©½¸¹ç¤Î¾ðÊó¤òÊÝ»ý¤¹¤ë¥Ç¡¼¥¿¹½Â¤ÂÎ +.I semid_ds +¤ò¼¡¤Î¤è¤¦¤Ë½é´ü²½¤¹¤ë +.RI ( semid_ds +¤Ë¤Ä¤¤¤Æ¤Ï +.BR semctl (2) +¤ò»²¾È): +.IP +.\"O .I sem_perm.cuid +.\"O and +.\"O .I sem_perm.uid +.\"O are set to the effective user ID of the calling process. +.I sem_perm.cuid +¤È +.I sem_perm.uid +¤Ë¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥æ¡¼¥¶ ID ¤òÀßÄꤹ¤ë¡£ +.IP +.\"O .I sem_perm.cgid +.\"O and +.\"O .I sem_perm.gid +.\"O are set to the effective group ID of the calling process. +.I sem_perm.cgid +¤È +.I sem_perm.gid +¤Ë¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë¡£ +.IP +.\"O The least significant 9 bits of +.\"O .I sem_perm.mode +.\"O are set to the least significant 9 bits of +.\"O .IR semflg . +.I sem_perm.mode +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤Ë +.I semflg +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤òÀßÄꤹ¤ë¡£ +.IP +.\"O .I sem_nsems +.\"O is set to the value of +.\"O .IR nsems . +.I sem_nsems +¤Ë +.I nsems +¤ÎÃͤòÀßÄꤹ¤ë¡£ +.IP +.\"O .I sem_otime +.\"O is set to 0. +.I sem_otime +¤Ë 0 ¤òÀßÄꤹ¤ë¡£ +.IP +.\"O .I sem_ctime +.\"O is set to the current time. +.I sem_ctime +¤Ë¸½ºß¤Î»þ¹ï¤òÀßÄꤹ¤ë¡£ +.PP +.\"O The argument +.\"O .I nsems +.\"O can be 0 +.\"O (a don't care) +.\"O when a semaphore set is not being created. +.\"O Otherwise +.\"O .I nsems +.\"O must be greater than 0 +.\"O and less than or equal to the maximum number of semaphores per semaphore set +.\"O .RB ( SEMMSL ). +¥»¥Þ¥Õ¥©½¸¹ç¤ÎºîÀ®¤ò¹Ô¤ï¤Ê¤¤¾ì¹ç¤Ï¡¢°ú¤­¿ô +.I nsems +¤Ë (don't care ¤ò°ÕÌ£¤¹¤ë) 0 ¤ò»ØÄꤷ¤Æ¤â¤è¤¤¡£ +¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢ +.I nsems +¤Ï 0 ¤è¤êÂ礭¤¤ÃͤǤʤ±¤ì¤Ð¤Ê¤é¤º¡¢¥»¥Þ¥Õ¥©½¸¹ç¤¢¤¿¤ê¤Î¥»¥Þ¥Õ¥©¤ÎºÇÂç¿ô +.RB ( SEMMSL ) +°Ê²¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O If the semaphore set already exists, the permissions are +.\"O verified. +¥»¥Þ¥Õ¥©½¸¹ç¤¬´û¤Ë¸ºß¤·¤¿¾ì¹ç¤Ï¡¢¥¢¥¯¥»¥¹µö²Ä¤Î¸¡ºº¤¬¹Ô¤ï¤ì¤ë¡£ +.\"O .\" and a check is made to see if it is marked for destruction. +.\" Ç˲õ (destruction) ¥Þ¡¼¥¯¤¬¤Ê¤¤¤«¥Á¥§¥Ã¥¯¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O If successful, the return value will be the semaphore set identifier +.\"O (a nonnegative integer), otherwise \-1 +.\"O is returned, with +.\"O .I errno +.\"O indicating the error. +À®¸ù¤·¤¿¾ì¹ç¡¢¥»¥Þ¥Õ¥©½¸¹ç¤Î¼±ÊÌ»Ò (ÈóÉé¤ÎÀ°¿ô) ¤¬ÊÖ¤êÃͤȤʤ롣 +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O On failure +.\"O .I errno +.\"O will be set to one of the following: +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ë¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤¬ÀßÄꤵ¤ì¤ë: +.TP +.B EACCES +.\"O A semaphore set exists for +.\"O .IR key , +.\"O but the calling process does not have permission to access the set, +.\"O and does not have the +.\"O .B CAP_IPC_OWNER +.\"O capability. +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤Ï¸ºß¤¹¤ë¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ï¤½¤Î½¸¹ç¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä¤¬¤Ê¤¯¡¢ +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EEXIST +.\"O A semaphore set exists for +.\"O .I key +.\"O and +.\"O .I semflg +.\"O specified both +.\"O .B IPC_CREAT +.\"O and +.\"O .BR IPC_EXCL . +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤¬Â¸ºß¤·¡¢ +.I semflg +¤Ë¤Ï +.B IPC_CREAT +¤È +.B IPC_EXCL +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¡£ +.\" .TP +.\"O .\" .B EIDRM +.\"O .\" The semaphore set is marked to be deleted. +.\" .B EIDRM +.\" ¥»¥Þ¥Õ¥©½¸¹ç¤Ëºï½ü (delete) ¥Þ¡¼¥¯¤¬¤Ä¤±¤é¤ì¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O .I nsems +.\"O is less than 0 or greater than the limit on the number +.\"O of semaphores per semaphore set +.\"O .RB ( SEMMSL ), +.I nsems +¤¬ 0 ¤è¤ê¾®¤µ¤¤¤«¡¢¥»¥Þ¥Õ¥©½¸¹ç¤¢¤¿¤ê¤Î¥»¥Þ¥Õ¥©¤ÎºÇÂç¿ô +.RB ( SEMMSL ) +¤è¤êÂ礭¤¤¡£ +.\"O or a semaphore set corresponding to +.\"O .I key +.\"O already exists, and +.\"O .I nsems +.\"O is larger than the number of semaphores in that set. +¤Þ¤¿¤Ï¡¢ +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤¬´û¤Ë¸ºß¤·¡¢ +.I nsems +¤¬¤½¤Î½¸¹ç¤Î¥»¥Þ¥Õ¥©¿ô¤è¤ê¤âÂ礭¤¤¡£ +.TP +.B ENOENT +.\"O No semaphore set exists for +.\"O .I key +.\"O and +.\"O .I semflg +.\"O did not specify +.\"O .BR IPC_CREAT . +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤¬Â¸ºß¤»¤º¡¢ +.I semflg +¤Ë +.B IPC_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤â¤¤¤Ê¤¤¡£ +.TP +.B ENOMEM +.\"O A semaphore set has to be created but the system does not have +.\"O enough memory for the new data structure. +¥»¥Þ¥Õ¥©½¸¹ç¤òºîÀ®¤·¤è¤¦¤È¤·¤¿¤¬¡¢¿·¤·¤¤¥Ç¡¼¥¿¹½Â¤ÂΤò +ºîÀ®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOSPC +.\"O A semaphore set has to be created but the system limit for the maximum +.\"O number of semaphore sets +.\"O .RB ( SEMMNI ), +.\"O or the system wide maximum number of semaphores +.\"O .RB ( SEMMNS ), +.\"O would be exceeded. +¥»¥Þ¥Õ¥©½¸¹ç¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¤È¡¢¥·¥¹¥Æ¥à¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Î +ºÇÂç¿ô +.RB ( SEMMNI ) +¤«¡¢¥·¥¹¥Æ¥àÁ´ÂΤΥ»¥Þ¥Õ¥©¤ÎºÇÂç¿ô +.RB ( SEMMNS ) +¤Î¤¤¤º¤ì¤«¤òĶ¤¨¤Æ¤·¤Þ¤¦¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O .\" SVr4 documents additional error conditions EFBIG, E2BIG, EAGAIN, +.\"O .\" ERANGE, EFAULT. +.\" SVr4 ¤Ë¤Ï¡¢ÄÉ²Ã¤Ç EFBIG, E2BIG, EAGAIN, ERANGE, EFAULT +.\" ¤Î¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.\"O .SH NOTES +.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 semflg +.\"O and creates a new semaphore set (on success). +¤³¤ÎÆÃÊ̤ÊÃͤ¬ +.I key +¤Ë»ØÄꤵ¤ì¤ë¤È¡¢ +.BR semget () +.I semflg +¤Î²¼°Ì 9 ¥Ó¥Ã¥È°Ê³°¤ÏÁ´¤Æ̵»ë¤·¡¢ +(À®¸ù¤·¤¿¾ì¹ç¤Ï) ¿·¤·¤¤¥»¥Þ¥Õ¥©½¸¹ç¤òºîÀ®¤¹¤ë¡£ +.PP +.\"O The following limits on semaphore set resources affect the +.\"O .BR semget () +.\"O call: +¥»¥Þ¥Õ¥©½¸¹ç¤Î¥ê¥½¡¼¥¹¤Ë´Ø¤¹¤ëÀ©¸Â¤Î¤¦¤Á¡¢ +.BR semget () +¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¤â¤Î¤ò°Ê²¼¤Ëµó¤²¤ë: +.TP +.B SEMMNI +.\"O System wide maximum number of semaphore sets: policy dependent +.\"O (on Linux, this limit can be read and modified via the fourth field of +.\"O .IR /proc/sys/kernel/sem ). +.\"O .\" This /proc file is not available in Linux 2.2 and earlier -- MTK +¥·¥¹¥Æ¥àÁ´ÂΤΥ»¥Þ¥Õ¥©½¸¹ç¤ÎºÇÂç¿ô: Êý¿Ë°Í¸ +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/sem +¤ÎÂè4¥Õ¥£¡¼¥ë¥É¤ËÂбþ¤·¡¢Æɤ߽Ф·¤âÊѹ¹¤â¤Ç¤­¤ë)¡£ +.\" ¤³¤Î /proc ¥Õ¥¡¥¤¥ë¤Ï Linux 2.2 °ÊÁ°¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤ -- MTK +.TP +.B SEMMSL +.\"O Maximum number of semaphores per semid: implementation dependent +.\"O (on Linux, this limit can be read and modified via the first field of +.\"O .IR /proc/sys/kernel/sem ). +semid ¤¢¤¿¤ê¤Î¥»¥Þ¥Õ¥©¤ÎºÇÂç¿ô: ¼ÂÁõ°Í¸ +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/sem +¤ÎÂè1¥Õ¥£¡¼¥ë¥É¤ËÂбþ¤·¡¢Æɤ߽Ф·¤âÊѹ¹¤â¤Ç¤­¤ë)¡£ +.TP +.B SEMMNS +.\"O System wide maximum number of semaphores: policy dependent +.\"O (on Linux, this limit can be read and modified via the second field of +.\"O .IR /proc/sys/kernel/sem ). +.\"O Values greater than +.\"O .B SEMMSL * SEMMNI +.\"O makes it irrelevant. +¥·¥¹¥Æ¥àÁ´ÂΤΥ»¥Þ¥Õ¥©¤ÎºÇÂç¿ô: Êý¿Ë°Í¸ +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/sem +¤ÎÂè2¥Õ¥£¡¼¥ë¥É¤ËÂбþ¤·¡¢Æɤ߽Ф·¤âÊѹ¹¤â¤Ç¤­¤ë)¡£ +.B SEMMSL * SEMMNI +¤è¤êÂ礭¤ÊÃͤϰÕÌ£¤ò»ý¤¿¤Ê¤¤¡£ +.\"O .SH BUGS +.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 +¤ÎÊý¤¬¤è¤êÌÀ³Î¤Ë¤½¤Îµ¡Ç½¤òɽ¤·¤Æ¤¤¤ë¤À¤í¤¦¡£ +.LP +.\"O The semaphores in a set are not initialized by +.\"O .BR semget (). +.\"O .\" In fact they are initialized to zero on Linux, but POSIX.1-2001 +.\"O .\" does not specify this, and we can't portably rely on it. +.\"O In order to initialize the semaphores, +.\"O .BR semctl (2) +.\"O must be used to perform a +.\"O .B SETVAL +.\"O or a +.\"O .B SETALL +.\"O operation on the semaphore set. +¥»¥Þ¥Õ¥©½¸¹çÆâ¤Î¥»¥Þ¥Õ¥©¤Ï +.BR semget () +¤Ç¤Ï½é´ü²½¤µ¤ì¤Ê¤¤¡£ +.\" ¼ÂºÝ¤Ï Linux ¤Ç¤Ï¥»¥Þ¥Õ¥©¤Ï 0 ¤Ë½é´ü²½¤µ¤ì¤ë¤¬¡¢ +.\" POSIX.1-2001 ¤Ç¤Ï¤³¤¦¤Ê¤ë¤³¤È¤òµ¬Äꤷ¤Æ¤¤¤ëÌõ¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢ +.\" °Ü¿¢¤ò¹Íθ¤¹¤ë¤È¤­¤Ë¤Ï¤³¤ì¤òÁ°Äó¤Ë¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +¤³¤Î¥»¥Þ¥Õ¥©¤ò½é´ü²½¤¹¤ë¤Ë¤Ï¡¢¥»¥Þ¥Õ¥©½¸¹ç¤ËÂФ·¤Æ +.BR semctl (2) +¤ò»È¤Ã¤Æ +.B SETVAL +¤« +.B SETALL +Áàºî¤ò¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.\"O (Where multiple peers do not know who will be the first to +.\"O initialize the set, checking for a nonzero +.\"O .I sem_otime +.\"O in the associated data structure retrieved by a +.\"O .BR semctl (2) +.\"O .B IPC_STAT +.\"O operation can be used to avoid races.) +(Ê£¿ô²Õ½ê¤«¤é¥»¥Þ¥Õ¥©½¸¹ç¤ÎÁàºî¤¬¹Ô¤ï¤ì¤ë¾ìÌ̤Ǥϡ¢ +郎ºÇ½é¤Ë½¸¹ç¤ò½é´ü²½¤¹¤ì¤Ð¤è¤¤¤«Ê¬¤«¤é¤Ê¤¤¡£ +¤³¤Î¾õ¶·¤òÈò¤±¤ë¤Ë¤Ï¡¢ +.BR semctl (2) +¤Î +.B IPC_STAT +Áàºî¤Ç¼èÆÀ¤Ç¤­¤ë¥»¥Þ¥Õ¥©¤Î¥Ç¡¼¥¿¹½Â¤ÂΤΠ+.I sem_otime +¤¬ 0 °Ê³°¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ì¤Ð¤è¤¤¡£) +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR semctl (2), +.BR semop (2), +.BR ftok (3), +.BR capabilities (7), +.BR sem_overview (7), +.BR svipc (7) diff --git a/draft/man2/semop.2 b/draft/man2/semop.2 new file mode 100644 index 00000000..1e329fac --- /dev/null +++ b/draft/man2/semop.2 @@ -0,0 +1,937 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 1996-10-22, Eric S. Raymond +.\" Modified 2002-01-08, Michael Kerrisk +.\" Modified 2003-04-28, Ernie Petrides +.\" Modified 2004-05-27, Michael Kerrisk +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added notes on /proc files +.\" 2005-04-08, mtk, Noted kernel version numbers for semtimedop() +.\" 2007-07-09, mtk, Added an EXAMPLE code segment. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Updated 2003-02-09, Kentaro Shirakata +.\" Updated 2003-09-12, Kentaro Shirakata +.\" Updated 2005-03-01, Akihiro MOTOKI +.\" Updated 2005-04-17, Akihiro MOTOKI +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" +.\"WORD: semaphore ¥»¥Þ¥Õ¥© +.\"WORD: member ¥á¥ó¥Ð¡¼ +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: system call ¥·¥¹¥Æ¥à¥³¡¼¥ë +.\"WORD: undo ¥¢¥ó¥É¥¥ +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: catch Êá³Í(catch) +.\"WORD: process-ID ¥×¥í¥»¥¹ID +.\"WORD: policy Êý¿Ë +.\"WORD: implement ¼ÂÁõ +.\"WORD: queue ¥­¥å¡¼ +.\"WORD: free ²òÊü(free). +.\"WORD: memory ¥á¥â¥ê +.\"WORD: anonymous structure ̵̾¹½Â¤ÂÎ +.\"WORD: time limit À©¸Â»þ´Ö +\" +.TH SEMOP 2 2008-10-04 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O semop, semtimedop \- semaphore operations +semop, semtimedop \- ¥»¥Þ¥Õ¥©¤ÎÁàºî +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int semop(int " semid ", struct sembuf *" sops ", unsigned " nsops ); +.sp +.BI "int semtimedop(int " semid ", struct sembuf *" sops ", unsigned " nsops , +.BI " struct timespec *" timeout ); +.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 semtimedop (): +_GNU_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Each semaphore in a semaphore set has the following associated values: +¥»¥Þ¥Õ¥©½¸¹ç (semaphore set) ¤Î¥á¥ó¥Ð¡¼¤Î³Æ¥»¥Þ¥Õ¥©¤Ï +°Ê²¼¤Î´ØÏ¢¾ðÊó¤ò»ý¤Ã¤Æ¤¤¤ë: +.sp +.in +4n +.nf +.\"O unsigned short semval; /* semaphore value */ +.\"O unsigned short semzcnt; /* # waiting for zero */ +.\"O unsigned short semncnt; /* # waiting for increase */ +.\"O pid_t sempid; /* process that did last op */ +unsigned short semval; /* ¥»¥Þ¥Õ¥©ÃÍ */ +unsigned short semzcnt; /* ¥¼¥í¤òÂÔ¤Ä¥×¥í¥»¥¹¿ô */ +unsigned short semncnt; /* Áý²Ã¤òÂÔ¤Ä¥×¥í¥»¥¹¿ô */ +pid_t sempid; /* ºÇ¸å¤ËÁàºî¤ò¹Ô¤Ê¤Ã¤¿¥×¥í¥»¥¹ */ +.sp +.in -4n +.fi +.\"O .BR semop () +.\"O performs operations on selected semaphores in the set indicated by +.\"O .IR semid . +.BR semop () +¤Ï +.I semid +¤Ç»ØÄꤵ¤ì¤¿¥»¥Þ¥Õ¥©½¸¹ç¤ÎÁªÂò¤µ¤ì¤¿¥»¥Þ¥Õ¥©¤ËÂФ·¤ÆÁàºî¤ò¹Ô¤¦¡£ +.\"O Each of the +.\"O .I nsops +.\"O elements in the array pointed to by +.\"O .I sops +.\"O specifies an operation to be performed on a single semaphore. +.\"O The elements of this structure are of type +.\"O .IR "struct sembuf" , +.\"O containing the following members: +.I sops +¤Ï +.I nsops +¸Ä¤ÎÍ×ÁǤÎÇÛÎó¤ò»Ø¤·¡¢ÇÛÎó¤Î³ÆÍ×ÁǤϸġ¹¤Î¥»¥Þ¥Õ¥©¤Ë +ÂФ¹¤ëÁàºî¤ò¼¨¤¹¡£¤½¤Î·¿¤Ï +.I struct sembuf +¤Ç¡¢¼¡¤Î¥á¥ó¥Ð¤ò»ý¤Ä: +.sp +.in +4n +.nf +.\"O unsigned short sem_num; /* semaphore number */ +.\"O short sem_op; /* semaphore operation */ +.\"O short sem_flg; /* operation flags */ +unsigned short sem_num; /* ¥»¥Þ¥Õ¥©ÈÖ¹æ */ +short sem_op; /* ¥»¥Þ¥Õ¥©Áàºî */ +short sem_flg; /* Áàºî¥Õ¥é¥° */ +.sp +.in -4n +.fi +.\"O Flags recognized in +.\"O .I sem_flg +.\"O are +.\"O .B IPC_NOWAIT +.\"O and +.\"O .BR SEM_UNDO . +.\"O If an operation specifies +.\"O .BR SEM_UNDO , +.\"O it will be automatically undone when the process terminates. +.I sem_flg +¤Ë¤Ï +.B IPC_NOWAIT +¤È +.B SEM_UNDO +¤¬ÀßÄê¤Ç¤­¤ë¡£ +.B SEM_UNDO +¤¬»ØÄꤵ¤ì¤¿Áàºî¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿»þ¤Ë¼«Æ°Åª¤Ë¼è¤ê¾Ã¤µ¤ì¤ë¡£ +.PP +.\"O The set of operations contained in +.\"O .I sops +.\"O is performed in +.\"O .IR "array order" , +.\"O and +.\"O .IR atomically , +.\"O that is, the operations are performed either as a complete unit, +.\"O or not at all. +.I sops +¤Ë´Þ¤Þ¤ì¤ëÁàºî¤Î½¸¹ç¤Ï¡¢ +.I "ÇÛÎó¤Î½ç½ø" +¤Ç¡¢ +.I ¥¢¥È¥ß¥Ã¥¯¤Ë +¼Â¹Ô¤µ¤ì¤ë¡£ +¤¹¤Ê¤ï¤Á¡¢Á´¤Æ¤ÎÁàºî¤¬´°Á´¤Ë¼Â¹Ô¤µ¤ì¤ë¤«¡¢Á´¤¯¼Â¹Ô¤µ¤ì¤Ê¤¤¤«¤Î +¤É¤Á¤é¤«¤È¤Ê¤ë¡£ + +.\"O The behavior of the system call if not all operations can be +.\"O performed immediately depends on the presence of the +.\"O .B IPC_NOWAIT +.\"O flag in the individual +.\"O .I sem_flg +.\"O fields, as noted below. +Á´¤Æ¤ÎÁàºî¤¬Ä¾¤Á¤Ë¼Â¹Ô¤Ç¤­¤Ê¤¤¾ì¹ç¤Î¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¿¶¤ëÉñ¤¤¤Ï +¸Ä¡¹¤ÎÁàºî¤Î +.I sem_flg +¥Õ¥£¡¼¥ë¥É¤Ë +.B IPC_NOWAIT +¤¬Â¸ºß¤¹¤ë¤«¤Ë¤è¤Ã¤Æ·è¤Þ¤ê¡¢¸å½Ò¤Î¤è¤¦¤Ë¤Ê¤ë¡£ + +.\"O Each operation is performed on the +.\"O .IR sem_num \-th +.\"O semaphore of the semaphore set, where the first semaphore of the set +.\"O is numbered 0. +¤½¤ì¤¾¤ì¤ÎÁàºî¤Ï¥»¥Þ¥Õ¥©½¸¹ç¤Î +.IR sem_num ÈÖÌÜ +¤Î¥»¥Þ¥Õ¥©¤ËÂФ·¤Æ¼Â¹Ô¤µ¤ì¤ë¡£¥»¥Þ¥Õ¥©½¸¹ç¤ÎºÇ½é¤Î¥»¥Þ¥Õ¥©¤Ë¤Ï +ÈÖ¹æ 0 ¤¬¿¶¤é¤ì¤ë¡£ +.\"O There are three types of operation, distinguished by the value of +.\"O .IR sem_op . +¤½¤·¤ÆÁàºî¤Ï»°¼ïÎढ¤ê¡¢ +.I sem_op +¤ÎÃͤǶèÊ̤µ¤ì¤ë¡£ +.PP +.\"O If +.\"O .I sem_op +.\"O is a positive integer, the operation adds this value to +.\"O the semaphore value +.\"O .RI ( semval ). +.\"O Furthermore, if +.\"O .B SEM_UNDO +.\"O is specified for this operation, the system updates the process undo count +.\"O .RI ( semadj ) +.\"O for this semaphore. +.\"O This operation can always proceed \(em it never forces a process to wait. +.\"O The calling process must have alter permission on the semaphore set. +.I sem_op +¤¬Àµ¤ÎÀ°¿ô¤Î¾ì¹ç¡¢Áàºî¤È¤·¤Æ¤½¤ÎÃͤò¥»¥Þ¥Õ¥©¤ÎÃÍ +.RI ( semval ) +¤Ë²Ã¤¨¤ë¡£¤µ¤é¤Ë¤³¤ÎÁàºî¤Ë +.B SEM_UNDO +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥·¥¹¥Æ¥à¤Ï¤³¤Î¥»¥Þ¥Õ¥©¤Î ¥×¥í¥»¥¹¡¦¥¢¥ó¥É¥¥¿ô +.RI ( semadj ) +¤ò¹¹¿·¤¹¤ë¡£ +¤³¤ÎÁàºî¤Ïɬ¤º¼Â¹Ô¤Ç¤­¡¢¥×¥í¥»¥¹¤ÎÄä»ß¤Ïµ¯¤³¤é¤Ê¤¤¡£ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ÏÂоݤΥ»¥Þ¥Õ¥©½¸¹ç¤òÊѹ¹¤¹¤ëµö²Ä¤¬¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O If +.\"O .I sem_op +.\"O is zero, the process must have read permission on the semaphore +.\"O set. +.\"O This is a "wait-for-zero" operation: if +.\"O .I semval +.\"O is zero, the operation can immediately proceed. +.I sem_op +¤¬ 0 ¤Î¾ì¹ç¡¢¡Ö¥¼¥í¤Þ¤ÇÂԤġ×Áàºî¤Ç¤¢¤ë¡£¤³¤Î¾ì¹ç¡¢¥×¥í¥»¥¹¤Ï +¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÂФ¹¤ëÆɤ߹þ¤ßµö²Ä¤¬¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I semval +¤¬ 0 ¤Ê¤é¤Ð¡¢Áàºî¤Ïľ¤Á¤Ë¹Ô¤ï¤ì¤ë¡£ +.\"O Otherwise, if +.\"O .B IPC_NOWAIT +.\"O is specified in +.\"O .IR sem_flg , +.\"O .BR semop () +.\"O fails with +.\"O .I errno +.\"O set to +.\"O .B EAGAIN +.\"O (and none of the operations in +.\"O .I sops +.\"O is performed). +.I semval +¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I sem_flg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢ +.BR semop () +¤Ï¼ºÇÔ¤·¡¢ +.B errno +¤Ë +.B EAGAIN +¤¬ÀßÄꤵ¤ì¤ë (¤³¤Î¤È¤­ +.I sops +¤ËÂФ¹¤ëÁàºî¤ÏÁ´¤¯¼Â¹Ô¤µ¤ì¤Ê¤¤)¡£ +.\"O Otherwise +.\"O .I semzcnt +.\"O (the count of processes waiting until this semaphore's value becomes zero) +.\"O is incremented by one and the process sleeps until +.\"O one of the following occurs: +.I sem_flg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.I semzcnt +(¥»¥Þ¥Õ¥©Ãͤ¬ 0 ¤Ë¤Ê¤ë¤Î¤òÂԤäƤ¤¤ë¥×¥í¥»¥¹¤Î¿ô) ¤ò 1 Áý²Ã¤µ¤»¤Æ¡¢ +°Ê²¼¤Î¤¤¤º¤ì¤«¤¬µ¯¤³¤ë¤Þ¤Ç¥×¥í¥»¥¹¤òÄä»ß (sleep) ¤¹¤ë¡£ +.IP \(bu 3 +.\"O .I semval +.\"O becomes 0, at which time the value of +.\"O .I semzcnt +.\"O is decremented. +.I semval +¤¬ 0 ¤Ë¤Ê¤Ã¤¿: ¤³¤Î¤È¤­ +.I semval +¤ÎÃÍ¤Ï 1 ¸º»»¤µ¤ì¤ë¡£ +.IP \(bu +.\"O The semaphore set +.\"O is removed: +.\"O .BR semop () +.\"O fails, with +.\"O .I errno +.\"O set to +.\"O .BR EIDRM . +¥»¥Þ¥Õ¥©½¸¹ç¤¬ºï½ü¤µ¤ì¤¿: ¤³¤Î¤È¤­ +.BR semop () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EIDRM +¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP \(bu +.\"O The calling process catches a signal: +.\"O the value of +.\"O .I semzcnt +.\"O is decremented and +.\"O .BR semop () +.\"O fails, with +.\"O .I errno +.\"O set to +.\"O .BR EINTR . +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿: ¤³¤Î¤È¤­ +.I semzcnt +¤ÎÃÍ¤Ï 1 ¸º»»¤µ¤ì¡¢ +.BR semop () +¤Ï¼ºÇÔ¤· +.I errno +¤Ë +.B EINTR +¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP \(bu +.\"O The time limit specified by +.\"O .I timeout +.\"O in a +.\"O .BR semtimedop () +.\"O call expires: +.\"O .BR semop () +.\"O fails, with +.\"O .I errno +.\"O set to +.\"O .BR EAGAIN . +.\" motoki: semop () ¤Ï semtimedop () ¤Î´Ö°ã¤¤¡© +.BR semtimedop () +¤Î +.I timeout +¤Ç»ØÄꤵ¤ì¤¿À©¸Â»þ´Ö¤¬·Ð²á¤·¤¿: ¤³¤Î¤È¤­ +.BR semtimedop () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O If +.\"O .I sem_op +.\"O is less than zero, the process must have alter permission on the +.\"O semaphore set. +.\"O If +.\"O .I semval +.\"O is greater than or equal to the absolute value of +.\"O .IR sem_op , +.\"O the operation can proceed immediately: +.\"O the absolute value of +.\"O .I sem_op +.\"O is subtracted from +.\"O .IR semval , +.\"O and, if +.\"O .B SEM_UNDO +.\"O is specified for this operation, the system updates the process undo count +.\"O .RI ( semadj ) +.\"O for this semaphore. +.I sem_op +¤¬ 0 ̤Ëþ¤Î¾ì¹ç¡¢¥×¥í¥»¥¹¤Ë¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤òÊѹ¹¤¹¤ëµö²Ä¤¬¤Ê¤±¤ì¤Ð +¤Ê¤é¤Ê¤¤¡£ +.I semval +¤¬ +.I sem_op +¤ÎÀäÂÐÃͰʾå¤Î¾ì¹ç¤Ï¡¢Áàºî¤Ïľ¤Á¤Ë¼Â¹Ô¤µ¤ì¤ë: +.I semval +¤«¤é +.I sem_op +¤ÎÀäÂÐÃͤ¬¸º»»¤µ¤ì¤ë¡£ +¤µ¤é¤Ë¡¢¤³¤ÎÁàºî¤Ë +.B SEM_UNDO +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤³¤Î¥»¥Þ¥Õ¥©¤Î¥×¥í¥»¥¹¡¦¥¢¥ó¥É¥¥¿ô +.RI ( semadj ) +¤ò¹¹¿·¤¹¤ë¡£ +.\"O If the absolute value of +.\"O .I sem_op +.\"O is greater than +.\"O .IR semval , +.\"O and +.\"O .B IPC_NOWAIT +.\"O is specified in +.\"O .IR sem_flg , +.\"O .BR semop () +.\"O fails, with +.\"O .I errno +.\"O set to +.\"O .B EAGAIN +.\"O (and none of the operations in +.\"O .I sops +.\"O is performed). +.I semval +¤¬ +.I sem_op +¤ÎÀäÂÐÃͤè¤ê¾®¤µ¤¯¡¢ +.I sem_flg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +.BR semop () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤¬ÀßÄꤵ¤ì¤ë (¤³¤Î¤È¤­ +.I sops +¤ÎÁàºî¤ÏÁ´¤¯¼Â¹Ô¤µ¤ì¤Ê¤¤)¡£ +.\"O Otherwise +.\"O .I semncnt +.\"O (the counter of processes waiting for this semaphore's value to increase) +.\"O is incremented by one and the process sleeps until +.\"O one of the following occurs: +.B IPC_WAIT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +.I semncnt +(¤³¤Î¥»¥Þ¥Õ¥©¤ÎÃͤ¬Áý²Ã¤¹¤ë¤Î¤òÂԤäƤ¤¤ë¥×¥í¥»¥¹¿ô¤Î¥«¥¦¥ó¥¿) +¤ò 1 Áý²Ã¤µ¤»¤Æ¡¢°Ê²¼¤Î¤¤¤º¤ì¤«¤¬µ¯¤³¤ë¤Þ¤Ç¥×¥í¥»¥¹¤òÄä»ß (sleep) ¤¹¤ë¡£ +.IP \(bu 3 +.\"O .I semval +.\"O becomes greater than or equal to the absolute value of +.\"O .IR sem_op , +.\"O at which time the value of +.\"O .I semncnt +.\"O is decremented, the absolute value of +.\"O .I sem_op +.\"O is subtracted from +.\"O .I semval +.\"O and, if +.\"O .B SEM_UNDO +.\"O is specified for this operation, the system updates the process undo count +.\"O .RI ( semadj ) +.\"O for this semaphore. +.I semval +¤¬ +.I sem_op +¤ÎÀäÂÐÃͰʾå¤Ë¤Ê¤Ã¤¿: ¤³¤Î¤È¤­ +.I semncnt +¤¬ 1 ¸º»»¤µ¤ì¡¢ +.I semval +¤«¤é +.I sem_op +¤ÎÀäÂÐÃͤ¬°ú¤«¤ì¤ë¡£ +¤³¤ÎÁàºî¤Ë +.B SEM_UNDO +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¤³¤Î¥»¥Þ¥Õ¥©¤Î¥×¥í¥»¥¹¡¦¥¢¥ó¥É¥¥¿ô +.RI ( semadj ) +¤â¹¹¿·¤¹¤ë¡£ +.IP \(bu +.\"O The semaphore set is removed from the system: +.\"O .BR semop () +.\"O fails, with +.\"O .I errno +.\"O set to +.\"O .BR EIDRM . +¥»¥Þ¥Õ¥©½¸¹ç¤¬¥·¥¹¥Æ¥à¤«¤éºï½ü¤µ¤ì¤¿: ¤³¤Î¤È¤­ +.BR semop () +¤Ï¼ºÇÔ¤· +.I errno +¤Ë +.B EIDRM +¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP \(bu +.\"O The calling process catches a signal: +.\"O the value of +.\"O .I semncnt +.\"O is decremented and +.\"O .BR semop () +.\"O fails, with +.\"O .I errno +.\"O set to +.\"O .BR EINTR . +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿: ¤³¤Î¤È¤­ +.I semncnt +¤¬ 1 ¸º»»¤µ¤ì¡¢ +.BR semop () +¤Ï¼ºÇÔ¤· +.I errno +¤Ë +.B EINTR +¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP \(bu +.\"O The time limit specified by +.\"O .I timeout +.\"O in a +.\"O .BR semtimedop () +.\"O call expires: the system call fails, with +.\"O .I errno +.\"O set to +.\"O .BR EAGAIN . +.\" motoki: the system call ¤Ï semtimedop () ¤Î¤³¤È¡© +.BR semtimedop () +¤Î +.I timeout +¤Ç»ØÄꤵ¤ì¤¿À©¸Â»þ´Ö¤¬·Ð²á¤·¤¿: ¤³¤Î¤È¤­ +.BR semtimedop () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O On successful completion, the +.\"O .I sempid +.\"O value for each semaphore specified in the array pointed to by +.\"O .I sops +.\"O is set to the process ID of the calling process. +Áàºî¤¬À®¸ù¤·¤¿¾ì¹ç¡¢ +.I sops +¤¬»Ø¤¹ÇÛÎó¤Ë¤è¤Ã¤ÆÁàºîÂоݤȤʤ俳ƥ»¥Þ¥Õ¥©¤Î +.I sempid +¥á¥ó¥Ð¡¼¤Ë¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O In addition, the +.\"O .I sem_otime +.\"O .\" and +.\"O .\" .I sem_ctime +.\"O is set to the current time. +¤µ¤é¤Ë +.I sem_otime +.\" ¤È +.\" .I sem_ctime +¤Ë¸½ºß»þ¹ï¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O The function +.\"O .BR semtimedop () +.\"O behaves identically to +.\"O .BR semop () +.\"O except that in those cases were the calling process would sleep, +.\"O the duration of that sleep is limited by the amount of elapsed +.\"O time specified by the +.\"O .I timespec +.\"O structure whose address is passed in the +.\"O .I timeout +.\"O argument. +.BR semtimedop () +´Ø¿ô¤Î¿¶¤ëÉñ¤¤¤Ï +.BR semop () +¤ÈÁ´¤¯Æ±¤¸¤À¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬Ää»ß¤¹¤ë¾ì¹ç¡¢Ää»ß´ü´Ö¤Î¾å¸Â¤¬ +.I timeout +°ú¤­¿ô¤Î»Ø¤¹ +.I timespec +¹½Â¤ÂΤǻØÄꤵ¤ì¤¿»þ´Ö¤È¤Ê¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +.\"O If the specified time limit has been reached, +.\"O .BR semtimedop () +.\"O fails with +.\"O .I errno +.\"O set to +.\"O .B EAGAIN +.\"O (and none of the operations in +.\"O .I sops +.\"O is performed). +»ØÄꤷ¤¿À©¸Â»þ´Ö¤Ë㤷¤¿¾ì¹ç¤Ï¡¢ +.BR semtimedop () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤¬ÀßÄꤵ¤ì¤ë +(¤³¤Î¤È¤­ +.I sops +¤ÎÁàºî¤Ï¼Â¹Ô¤µ¤ì¤Ê¤¤)¡£ +.\"O If the +.\"O .I timeout +.\"O argument is NULL, +.\"O then +.\"O .BR semtimedop () +.\"O behaves exactly like +.\"O .BR semop (). +.I timeout +°ú¤­¿ô¤¬ NULL ¤Î¾ì¹ç¡¢ +.BR semtimedop () +´Ø¿ô¤Î¿¶¤ëÉñ¤¤¤Ï +.BR semop () +´Ø¿ô¤ÈÁ´¤¯Æ±¤¸¤Ë¤Ê¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O If successful +.\"O .BR semop () +.\"O and +.\"O .BR semtimedop () +.\"O return 0; +.\"O otherwise they return \-1 +.\"O with +.\"O .I errno +.\"O indicating the error. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR semop () +¤È +.BR semtimedop () +¤Ï 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð \-1 ¤òÊÖ¤·¡¢ +¥¨¥é¡¼¤ò¼¨¤¹ +.I errno +¤òÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O On failure, +.\"O .I errno +.\"O is set to one of the following: +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ë°Ê²¼¤Î¤É¤ì¤«¤¬ÀßÄꤵ¤ì¤ë: +.TP +.B E2BIG +.\"O The argument +.\"O .I nsops +.\"O is greater than +.\"O .BR SEMOPM , +.\"O the maximum number of operations allowed per system +.\"O call. +.I nsops +°ú¤­¿ô¤¬ +.B SEMOPM +¤è¤êÂ礭¤¤¡£ +.B SEMOPM +¤Ï°ì²ó¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Çµö¤µ¤ì¤ëÁàºî¤ÎºÇÂç¸Ä¿ô¤Ç¤¢¤ë¡£ +.TP +.B EACCES +.\"O The calling process does not have the permissions required +.\"O to perform the specified semaphore operations, +.\"O and does not have the +.\"O .B CAP_IPC_OWNER +.\"O capability. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤Ï»ØÄꤵ¤ì¤¿¥»¥Þ¥Õ¥©Áàºî¤ò¹Ô¤¦¤Î¤Ë +ɬÍפʥ¢¥¯¥»¥¹µö²Ä¤¬¤Ê¤¯¡¢ +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â¤Ê¤¤¡£ +.TP +.B EAGAIN +.\"O An operation could not proceed immediately and either +.\"O .B IPC_NOWAIT +.\"O was specified in +.\"O .I sem_flg +.\"O or the time limit specified in +.\"O .I timeout +.\"O expired. +Áàºî¤òľ¤Á¤Ë½èÍý¤¹¤ë¤³¤È¤¬¤Ç¤­¤º¡¢¤«¤Ä +.I sem_flg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤« +.I timeout +¤Ç»ØÄꤵ¤ì¤¿À©¸Â»þ´Ö¤¬·Ð²á¤·¤¿¡£ +.TP +.B EFAULT +.\"O An address specified in either the +.\"O .I sops +.\"O or the +.\"O .I timeout +.\"O arguments isn't accessible. +°ú¤­¿ô +.I sops +¤« +.I timeout +¤¬»Ø¤·¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¡£ +.TP +.B EFBIG +.\"O For some operation the value of +.\"O .I sem_num +.\"O is less than 0 or greater than or equal to the number +.\"O of semaphores in the set. +¤¢¤ëÁàºî¤Ç¡¢ +.I sem_num +¤ÎÃͤ¬ 0 ̤Ëþ¤«¡¢½¸¹çÆâ¤Î¥»¥Þ¥Õ¥©¤Î¿ô°Ê¾å¤Ç¤¢¤ë¡£ +.TP +.B EIDRM +.\"O The semaphore set was removed. +¥»¥Þ¥Õ¥©½¸¹ç¤¬ºï½ü¤µ¤ì¤¿¡£ +.TP +.B EINTR +.\"O While blocked in this system call, the process caught a signal; see +.\"O .BR signal (7). +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÇÄä»ß¤·¤Æ¤¤¤ë»þ¤Ë¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿¡£ +.BR single (7) +»²¾È¡£ +.TP +.B EINVAL +.\"O The semaphore set doesn't exist, or +.\"O .I semid +.\"O is less than zero, or +.\"O .I nsops +.\"O has a nonpositive value. +¥»¥Þ¥Õ¥©½¸¹ç¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢ +.I semid +¤¬ 0 ̤Ëþ¤Ç¤¢¤ë¤«¡¢ +.I nsops +¤¬Àµ¤Î¿ô¤Ç¤Ê¤¤¡£ +.TP +.B ENOMEM +.\"O The +.\"O .I sem_flg +.\"O of some operation specified +.\"O .B SEM_UNDO +.\"O and the system does not have enough memory to allocate the undo +.\"O structure. +¤¢¤ëÁàºî¤Ç +.I sem_flg +¤Ë +.B SEM_UNDO +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¥·¥¹¥Æ¥à¤Ë¥¢¥ó¥É¥¥¹½Â¤ÂΤ˳ä¤êÅö¤Æ¤ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ERANGE +.\"O For some operation +.\"O .I sem_op+semval +.\"O is greater than +.\"O .BR SEMVMX , +.\"O the implementation dependent maximum value for +.\"O .IR semval . +¤¢¤ëÁàºî¤Ç +.I sem_op+semval +¤¬ +.B SEMVMX +¤è¤êÂ礭¤¤¡£ +.B SEMVMX +¤Ï +.I semval +¤ÎºÇÂçÃͤǡ¢¤½¤ÎÃͤϼÂÁõ°Í¸¤Ç¤¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR semtimedop () +.\"O first appeared in Linux 2.5.52, +.\"O and was subsequently backported into kernel 2.4.22. +.BR semtimedop () +¤Ï Linux 2.5.52 ¤Ç½é¤á¤ÆÅо줷¡¢ +¤½¤ì¤«¤é¥«¡¼¥Í¥ë 2.4.22 ¤Ë¤â°Ü¿¢¤µ¤ì¤¿¡£ +.\"O Glibc support for +.\"O .BR semtimedop () +.\"O first appeared in version 2.3.3. +.BR semtimedop () +¤Î glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3.3 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O .\" SVr4 documents additional error conditions EINVAL, EFBIG, ENOSPC. +.\" SVr4 ¤Ë¤Ï¡¢ÄÉ²Ã¤Ç EINVAL, EFBIG, ENOSPC ¤Î¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Î +.\" µ­½Ò¤¬¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The +.\"O .I sem_undo +.\"O structures of a process aren't inherited by the child produced by +.\"O .BR fork (2), +.\"O but they are inherited across an +.\"O .BR execve (2) +.\"O system call. +¤¢¤ë¥×¥í¥»¥¹¤Î +.I sem_undo +¹½Â¤ÂÎ¤Ï +.BR fork (2) +¤ÇÀ¸À®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ë¤Ï·Ñ¾µ¤µ¤ì¤Ê¤¤¤¬¡¢ +.BR execve (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¾ì¹ç¤Ï·Ñ¾µ¤µ¤ì¤ë¡£ +.PP +.\"O .BR semop () +.\"O is never automatically restarted after being interrupted by a signal handler, +.\"O regardless of the setting of the +.\"O .B SA_RESTART +.\"O flag when establishing a signal handler. +.BR semop () +¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤ÆÃæÃǤµ¤ì¤¿¸å¤Ë¡¢ +·è¤·¤Æ¼«Æ°Åª¤ËºÆ³«¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +¤¿¤È¤¨¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÀßÄê»þ¤Ë +.B SA_RESTART +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Æ¤âºÆ³«¤¹¤ë¤³¤È¤Ï¤Ê¤¤ +.PP +.\"O .I semadj +.\"O is a per-process integer which is simply the (negative) count +.\"O of all semaphore operations performed specifying the +.\"O .B SEM_UNDO +.\"O flag. +.I semadj +¤Ï¥×¥í¥»¥¹¤´¤È¤ÎÀ°¿ô¤Ç¡¢ +.B SEM_UNDO +¥Õ¥é¥°¤òÀßÄꤷ¤Æ¼Â¹Ô¤µ¤ì¤¿Á´¤Æ¤Î¥»¥Þ¥Õ¥©Áàºî¤Î(Éé¿ô¤Î)¥«¥¦¥ó¥¿¤Ç¤¢¤ë¡£ +.\"O When a semaphore's value is directly set using the +.\"O .B SETVAL +.\"O or +.\"O .B SETALL +.\"O request to +.\"O .BR semctl (2), +.\"O the corresponding +.\"O .I semadj +.\"O values in all processes are cleared. +.BR semctl (2) +¤Ë +.B SETVAL +¤Þ¤¿¤Ï +.B SETALL +¤ò»ØÄꤷ¡¢¥»¥Þ¥Õ¥©¤ÎÃͤ¬ +ľÀÜÀßÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢Á´¤Æ¤Î¥×¥í¥»¥¹¤Ë¤ª¤¤¤ÆÂбþ¤¹¤ë +.I semadj +¤ÎÃͤ¬¥¯¥ê¥¢¤µ¤ì¤ë¡£ +.PP +.\"O The \fIsemval\fP, \fIsempid\fP, \fIsemzcnt\fP, and \fIsemnct\fP values +.\"O for a semaphore can all be retrieved using appropriate +.\"O .BR semctl (2) +.\"O calls. +¤¢¤ë¥»¥Þ¥Õ¥©¤Î \fIsemval\fP, \fIsempid\fP, \fIsemzcnt\fP, \fIsemnct\fP +¤ÎÃͤϤ¤¤º¤ì¤â¡¢Å¬ÀÚ¤ÊÁàºî¤ò»ØÄꤷ¤Æ +.BR semctl (2) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +.PP +.\"O The following limits on semaphore set resources affect the +.\"O .BR semop () +.\"O call: +¥»¥Þ¥Õ¥©½¸¹ç¤Î¥ê¥½¡¼¥¹¤Ë´Ø¤¹¤ëÀ©¸Â¤Î¤¦¤Á¡¢ +.BR semop () +¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¤â¤Î¤ò°Ê²¼¤Ëµó¤²¤ë: +.TP +.B SEMOPM +.\"O Maximum number of operations allowed for one +.\"O .BR semop () +.\"O call (32) +.\"O (on Linux, this limit can be read and modified via the third field of +.\"O .IR /proc/sys/kernel/sem ). +.\"O .\" This /proc file is not available in Linux 2.2 and earlier -- MTK +°ì²ó¤Î +.BR semop () +¤Çµö¤µ¤ì¤ëÁàºî¤ÎºÇÂç¿ô (32)¡£ +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/sem +¤ÎÂè3¥Õ¥£¡¼¥ë¥É¤ËÂбþ¤·¡¢Æɤ߽Ф·¤âÊѹ¹¤â¤Ç¤­¤ë)¡£ +.\" ¤³¤Î /proc ¥Õ¥¡¥¤¥ë¤Ï Linux 2.2 °ÊÁ°¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤ -- MTK +.TP +.B SEMVMX +.\"O Maximum allowable value for +.\"O .IR semval : +.\"O implementation dependent (32767). +.I semval +¤¬¼è¤êÆÀ¤ëºÇÂçÃÍ: ¼ÂÁõ°Í¸ (32767)¡£ +.PP +.\"O The implementation has no intrinsic limits for +.\"O the adjust on exit maximum value +.\"O .RB ( SEMAEM ), +.\"O the system wide maximum number of undo structures +.\"O .RB ( SEMMNU ) +.\"O and the per-process maximum number of undo entries system parameters. +°Ê²¼¤ÎÃͤ˴ؤ·¤Æ¤Ï¼ÂÁõ°Í¸¤ÎÀ©¸Â¤Ï¤Ê¤¤¡£ +½ªÎ»»þ¤ÎÄ´À° (adjust on exit) ¤ÎºÇÂçÃÍ +.RB ( SEMAEM )¡¢ +¥·¥¹¥Æ¥àÁ´ÂΤΥ¢¥ó¥É¥¥¹½Â¤ÂΤκÇÂç¿ô +.RB ( SEMMNU )¡¢ +¥×¥í¥»¥¹¤¢¤¿¤ê¤Î¥¢¥ó¥É¥¥¹½Â¤ÂΤκÇÂç¿ô¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O When a process terminates, its set of associated +.\"O .I semadj +.\"O structures is used to undo the effect of all of the +.\"O semaphore operations it performed with the +.\"O .B SEM_UNDO +.\"O flag. +¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ëºÝ¡¢¥×¥í¥»¥¹¤ËÂбþ¤¹¤ë +.I semadj +¤Î½¸¹ç¤ò»È¤Ã¤Æ¡¢ +.B SEM_UNDO +¥Õ¥é¥°ÉÕ¤­¤Ç¼Â¹Ô¤µ¤ì¤¿Á´¤Æ¤Î¥»¥Þ¥Õ¥©Áàºî¤Î±Æ¶Á¤ò¼è¤ê¾Ã¤¹¡£ +.\"O This raises a difficulty: if one (or more) of these semaphore adjustments +.\"O would result in an attempt to decrease a semaphore's value below zero, +.\"O what should an implementation do? +¤³¤ì¤Ë¤è¤ê¤¢¤ëÌäÂ꤬ȯÀ¸¤¹¤ë: ¤³¤ì¤é¤Î¥»¥Þ¥Õ¥©¤ÎÄ´À°¤ò¹Ô¤Ã¤Æ¤¤¤ë¤È¡¢ +Ãæ¤Ë¤Ï¥»¥Þ¥Õ¥©¤ÎÃͤ¬ 0 ̤Ëþ¤ÎÃͤˤ·¤è¤¦¤È¤¹¤ë¾ì¹ç¤¬½Ð¤Æ¤¯¤ë¡£ +¤³¤Î¤è¤¦¤Ê¾ì¹ç¡¢¤É¤Î¤è¤¦¤Ë¼ÂÁõ¤¹¤ë¤Ù¤­¤«? +.\"O One possible approach would be to block until all the semaphore +.\"O adjustments could be performed. +.\"O This is however undesirable since it could force process termination to +.\"O block for arbitrarily long periods. +¤Ò¤È¤Ä¤Î¹Í¤¨¤é¤ì¤ë¼êË¡¤Ï¡¢Á´¤Æ¤Î¥»¥Þ¥Õ¥©Ä´À°¤¬¼Â¹Ô¤µ¤ì¤ë¤Þ¤Ç +Ää»ß¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£¤·¤«¤·¡¢¤³¤ÎÊýË¡¤Ç¤Ï¥×¥í¥»¥¹¤Î½ªÎ»¤¬ +Ĺ»þ´Ö¤Ë¤ï¤¿¤Ã¤ÆÄä»ß¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¤Î¤Ç˾¤Þ¤·¤¯¤Ê¤¤¡£ +¤·¤«¤â¤É¤ì¤¯¤é¤¤Ä¹»þ´Ö¤Ë¤Ê¤ë¤«¤Ïʬ¤«¤é¤Ê¤¤¡£ +.\"O Another possibility is that such semaphore adjustments could be ignored +.\"O altogether (somewhat analogously to failing when +.\"O .B IPC_NOWAIT +.\"O is specified for a semaphore operation). +Ê̤ÎÁªÂò»è¤È¤·¤Æ¡¢¤³¤Î¤è¤¦¤Ê¥»¥Þ¥Õ¥©Ä´À°¤ò´°Á´¤Ë̵»ë¤·¤Æ¤·¤Þ¤¦ÊýË¡¤¬¤¢¤ë +(¤³¤ì¤Ï¥»¥Þ¥Õ¥©Áàºî¤È¤·¤Æ +.B IPC_NOWAIT +¤¬»ØÄꤹ¤ë¤Î¤È¾¯¤·»÷¤Æ¤¤¤ë)¡£ +.\"O Linux adopts a third approach: decreasing the semaphore value +.\"O as far as possible (i.e., to zero) and allowing process +.\"O termination to proceed immediately. +Linux ¤ÏÂè»°¤Î¼êË¡¤òºÎÍѤ·¤Æ¤¤¤ë: ¥»¥Þ¥Õ¥©¤ÎÃͤò½ÐÍè¤ë¤À¤± (¤Ä¤Þ¤ê +0 ¤Þ¤Ç) ¸º¾¯¤µ¤»¤Æ¡¢¥×¥í¥»¥¹¤Î½ªÎ»¤òľ¤Á¤Ë³¹Ô¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤ë¡£ + +.\"O In kernels 2.6.x, x <= 10, there is a bug that in some circumstances +.\"O prevents a process that is waiting for a semaphore value to become +.\"O zero from being woken up when the value does actually become zero. +.\"O This bug is fixed in kernel 2.6.11. +.\"O .\" The bug report: +.\"O .\" http://marc.theaimsgroup.com/?l=linux-kernel&m=110260821123863&w=2 +.\"O .\" the fix: +.\"O .\" http://marc.theaimsgroup.com/?l=linux-kernel&m=110261701025794&w=2 +¥«¡¼¥Í¥ë 2.6.x (x <= 10) ¤Ë¤Ï¡¢¤¢¤ë¾õ¶·¤Ë¤ª¤¤¤Æ¥»¥Þ¥Õ¥©Ãͤ¬ 0 ¤Ë¤Ê¤ë¤Î¤ò +ÂԤäƤ¤¤ë¥×¥í¥»¥¹¤¬¡¢¥»¥Þ¥Õ¥©Ãͤ¬¼ÂºÝ¤Ë 0 ¤Ë¤Ê¤Ã¤¿¤È¤­¤Ëµ¯¾² (wake up) +¤µ¤ì¤Ê¤¤¡¢¤È¤¤¤¦¥Ð¥°¤¬¤¢¤ë¡£¤³¤Î¥Ð¥°¤Ï¥«¡¼¥Í¥ë 2.6.11 ¤Ç½¤Àµ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" ¥Ð¥°¥ì¥Ý¡¼¥È: +.\" http://marc.theaimsgroup.com/?l=linux-kernel&m=110260821123863&w=2 +.\" ½¤Àµ: +.\" http://marc.theaimsgroup.com/?l=linux-kernel&m=110261701025794&w=2 +.\"O .SH EXAMPLE +.SH Îã +.\"O The following code segment uses +.\"O .BR semop () +.\"O to atomically wait for the value of semaphore 0 to become zero, +.\"O and then increment the semaphore value by one. +°Ê²¼¤ÎÉôʬŪ¤Ê¥³¡¼¥É¤Ï¡¢ +¥»¥Þ¥Õ¥© 0 ¤ÎÃͤ¬ 0 ¤Ë¤Ê¤ë¤Î¤òÂԤäƤ«¤é¡¢ +¥»¥Þ¥Õ¥©¤ÎÃͤò 1 ²Ã»»¤¹¤ë½èÍý¤ò¡¢ +.BR semop () +¤ò»È¤Ã¤Æ¥¢¥È¥ß¥Ã¥¯ (atomically) ¤Ë¹Ô¤¦¡£ +.nf + + struct sembuf sops[2]; + int semid; + + /* Code to set \fIsemid\fP omitted */ + + sops[0].sem_num = 0; /* Operate on semaphore 0 */ + sops[0].sem_op = 0; /* Wait for value to equal 0 */ + sops[0].sem_flg = 0; + + sops[1].sem_num = 0; /* Operate on semaphore 0 */ + sops[1].sem_op = 1; /* Increment value by one */ + sops[1].sem_flg = 0; + + if (semop(semid, sops, 2) == \-1) { + perror("semop"); + exit(EXIT_FAILURE); + } +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR semctl (2), +.BR semget (2), +.BR sigaction (2), +.BR capabilities (7), +.BR sem_overview (7), +.BR svipc (7), +.BR time (7) diff --git a/draft/man2/send.2 b/draft/man2/send.2 new file mode 100644 index 00000000..5e4f2b6e --- /dev/null +++ b/draft/man2/send.2 @@ -0,0 +1,734 @@ +.\" 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. +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified Oct 1998 by Andi Kleen +.\" 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 íÕíÔ +.\" +.TH SEND 2 2009-02-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O send, sendto, sendmsg \- send a message on a socket +send, sendto, sendmsg \- ¥½¥±¥Ã¥È¤Ø¥á¥Ã¥»¡¼¥¸¤òÁ÷¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "ssize_t send(int " sockfd ", const void *" buf ", size_t " len \ +", int " flags ); + +.BI "ssize_t sendto(int " sockfd ", const void *" buf ", size_t " len \ +", int " flags , +.BI " const struct sockaddr *" dest_addr ", socklen_t " addrlen ); + +.BI "ssize_t sendmsg(int " sockfd ", const struct msghdr *" msg \ +", int " flags ); +.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 () +¤Ï¡¢¤â¤¦°ìÊý¤Î¥½¥±¥Ã¥È¤Ø¥á¥Ã¥»¡¼¥¸¤òžÁ÷¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +.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 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 +¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR send () +¤Ï +.BR write (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 +¤Ï¡¢¥Ç¡¼¥¿¤òÁ÷¿®¤¹¤ë¥Ñ¥±¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.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 +¤Ç»ØÄꤵ¤ì¤ë¡£ +.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 () +¤Ç¤Ï¡¢Êä½õ¥Ç¡¼¥¿ (À©¸æ¾ðÊó¤È¤â¸Æ¤Ð¤ì¤ë) ¤òÁ÷¿®¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.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 +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¡¢¤½¤Î¥á¥Ã¥»¡¼¥¸¤ÏžÁ÷¤µ¤ì¤Ê¤¤¡£ +.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 ¤È¤·¤ÆÄÌÃΤµ¤ì¤ë¡£ +.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) +¥³¡¼¥ë¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.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) ¤ä¥ë¡¼¥Æ¥£¥ó¥°¡¦¥×¥í¥°¥é¥à¤Ë +¤è¤Ã¤Æ¤Î¤ß»ÈÍѤµ¤ì¤ë¡£¤³¤Î¥Õ¥é¥°¤Ï¡¢·ÐÏ©À©¸æ¤¬¹Ô¤ï¤ì¤ë¥×¥í¥È¥³¥ë¥Õ¥¡¥ß¥ê¡¼ +¤ËÂФ·¤Æ¤Î¤ßÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£¥Ñ¥±¥Ã¥È¥½¥±¥Ã¥È¤Ë¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.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 +¤È¤Î°ã¤¤¤Ï¡¢¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤È¸Æ¤Ó½Ð¤·Ã±°Ì¤Ç +¤³¤Îµ¡Ç½¤òÍ­¸ú¤Ë¤Ç¤­¤ëÅÀ¤Ç¤¢¤ë¡£ + +.\"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 +¤ÏÊÖ¤µ¤ì¤ë¡£ +.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 ÂÓ°è³° +¥Ç¡¼¥¿¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +.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) +¤È°Ê²¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£ +.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 socklen_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; /* Êä½õ¥Ç¡¼¥¿(¸å½Ò) */ + socklen_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" +.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 +.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 +.\" 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. +̵¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B ECONNRESET +.\"O Connection reset by peer. +Àܳ¤¬ÀܳÁê¼ê¤Ë¤è¤ê¥ê¥»¥Ã¥È¤µ¤ì¤¿¡£ +.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 +.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 +.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 +.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 +.B ENOMEM +.\"O No memory available. +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B ENOTCONN +.\"O The socket is not connected, and no target has been given. +¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤ª¤é¤º¡¢ÀܳÀè¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.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 +¤âƱ»þ¤ËÁ÷¤é¤ì¤ë¡£ +.\"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 The +.\"O .B MSG_CONFIRM +.\"O flag is a Linux extension. +POSIX.1-2001 ¤Ë¤Ï¡¢ +.B MSG_OOB +¤È +.B MSG_EOR +¥Õ¥é¥°¤À¤±¤¬µ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.B MSG_CONFIRM +¥Õ¥é¥°¤Ï Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.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) +¤â»²¾È¤¹¤ë¤³¤È¡£ + +.\"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 (2.4) types it as +.\"O .IR size_t . +POSIX.1-2001 ¤Ç¤Ï¡¢¹½Â¤ÂÎ +.I msghdr +¤Î¥Õ¥£¡¼¥ë¥É +.I msg_controllen +¤Ï +.I socklen_t +·¿¤Ç¤¢¤ë¤Ù¤­¤À¤È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +¸½ºß¤Î glibc (glibc 2.4) ¤Ç¤Ï +.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 +.SH ¥Ð¥° +.\"O Linux may return +.\"O .B EPIPE +.\"O instead of +.\"O .BR ENOTCONN . +Linux ¤Ï +.B ENOTCONN +¤òÊÖ¤¹¾õ¶·¤Ç +.B EPIPE +¤òÊÖ¤¹¤³¤È¤¬¤¢¤ë¡£ +.\"O .SH EXAMPLE +.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" +.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) diff --git a/draft/man2/sendfile.2 b/draft/man2/sendfile.2 new file mode 100644 index 00000000..04aa68c1 --- /dev/null +++ b/draft/man2/sendfile.2 @@ -0,0 +1,300 @@ +.\" This man page is Copyright (C) 1998 Pawel Krawczyk. +.\" 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. +.\" $Id: sendfile.2,v 1.5 1999/05/18 11:54:11 freitag Exp $ +.\" 2000-11-19 bert hubert : in_fd cannot be socket +.\" +.\" 2004-12-17, mtk +.\" updated description of in_fd and out_fd for 2.6 +.\" Various wording and formatting changes +.\" +.\" 2005-03-31 Martin Pool mmap() improvements +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1999-06-26, HANATAKA Shinya +.\" Updated 2001-02-16, Kentaro Shirakata +.\" Updated 2003-09-08, Kentaro Shirakata +.\" Updated 2005-03-14, Akihiro MOTOKI +.\" Updated 2005-04-17, Akihiro MOTOKI +.\" Updated 2010-04-18, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: socket ¥½¥±¥Ã¥È +.\"WORD: lock ¥í¥Ã¥¯ +.\" +.TH SENDFILE 2 2010-02-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sendfile \- ¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿´Ö¤Ç¥Ç¡¼¥¿¤òžÁ÷¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \ + offset ", size_t" " count" ); +.\"O .\" The below is too ugly. Comments about glibc versions belong +.\"O .\" in the notes, not in the header. +.\" °Ê²¼¤Ï¡¢¤¢¤Þ¤ê¤Ë¤â±ø¤¤¡£ glibc ¥Ð¡¼¥¸¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Î¥³¥á¥ó¥È¤Ï +.\" ¡Ö¥Ø¥Ã¥À¡×¤Ç¤Ï¤Ê¤¯¡¢¡ÖÃí°Õ¡×¤Ë½ñ¤¤¤Æ¤ª¤¯¡£ +.\" +.\" .B #include +.\" .br +.\" .B #if (__GLIBC__==2 && __GLIBC_MINOR__>=1) || __GLIBC__>2 +.\" .br +.\" .B #include +.\" .br +.\" #else +.\" .br +.\" .B #include +.\" .br +.\" .B /* No system prototype before glibc 2.1. */ +.\" .br +.\" .BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \ +.\" offset ", size_t" " count" ) +.\" .br +.\" .B #endif +.\" +.SH ÀâÌÀ +.\"O .BR sendfile () +.\"O copies data between one file descriptor and another. +.\"O Because this copying is done within the kernel, +.\"O .BR sendfile () +.\"O is more efficient than the combination of +.\"O .BR read (2) +.\"O and +.\"O .BR write (2), +.\"O which would require transferring data to and from user space. +.BR sendfile () +¤Ï¡¢¤¢¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÊ̤Π+¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ø¤Î¥Ç¡¼¥¿¤Î¥³¥Ô¡¼¤ò¹Ô¤¦¡£ +¤³¤Î¥³¥Ô¡¼¤Ï¥«¡¼¥Í¥ëÆâ¤Ç¹Ô¤ï¤ì¤ë¤Î¤Ç¡¢ +.BR sendfile () +¤Ï¡¢ +.BR read (2) +¤È +.BR write (2) +¤òÁȤ߹ç¤ï¤»¤ë¤è¤ê¤â¸úΨ¤¬¤è¤¤¡£ +.BR read (2) +¤ä +.BR write (2) +¤Ç¤Ï¥æ¡¼¥¶¶õ´Ö¤È¤Î´Ö¤Ç¥Ç¡¼¥¿¤ÎžÁ÷¤¬É¬ÍפȤʤ뤫¤é¤Ç¤¢¤ë¡£ + +.\"O .I in_fd +.\"O should be a file descriptor opened for reading and +.\"O .I out_fd +.\"O should be a descriptor opened for writing. +.I in_fd +¤ÏÆɤ߹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¢ +.I out_fd +¤Ï½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O If +.\"O .I offset +.\"O is not NULL, then it points +.\"O to a variable holding the file offset from which +.\"O .BR sendfile () +.\"O will start reading data from +.\"O .IR in_fd . +.\"O When +.\"O .BR sendfile () +.\"O returns, this variable +.\"O will be set to the offset of the byte following the last byte that was read. +.I offset +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I offset +¤Ï +.BR sendfile () +¤¬ +.I in_fd +¤Î¤É¤³¤«¤é¥Ç¡¼¥¿¤òÆɤ߻Ϥá¤ë¤«¤ò¼¨¤¹¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤òÊÝ»ý¤¹¤ëÊÑ¿ô¤Ø¤Î +¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.BR sendfile () +¤ÏÉüµ¢¤¹¤ë»þ¡¢¤³¤ÎÊÑ¿ô¤ËºÇ¸å¤ËÆɤ߹þ¤ó¤À¥Ð¥¤¥È¤Î +¼¡¤Î¥Ð¥¤¥È¤Î¥ª¥Õ¥»¥Ã¥È¤ò½ñ¤­¹þ¤à¡£ +.\"O If +.\"O .I offset +.\"O is not NULL, then +.\"O .BR sendfile () +.\"O does not modify the current file offset of +.\"O .IR in_fd ; +.\"O otherwise the current file offset is adjusted to reflect +.\"O the number of bytes read from +.\"O .IR in_fd . +.I offset +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.BR sendfile () +¤Ï +.I in_fd +¤Î¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤Î¸½ºßÃͤòÊѹ¹¤·¤Ê¤¤¡£ +NULL ¤Î¾ì¹ç¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤Î¸½ºßÃͤò +.I in_fd +¤«¤éÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÈ¿±Ç¤·¤¿°ÌÃÖ¤ËÄ´À°¤¹¤ë¡£ + +.\"O If +.\"O .I offset +.\"O is NULL, then data will be read from +.\"O .IR in_fd +.\"O starting at the current file offset, +.\"O and the file offset will be updated by the call. +.I offset +¤¬ NULL ¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¤Ï +.I in_fd +¤Î¸½ºß¤Î¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤«¤éÆɤ߽Фµ¤ì¡¢ +¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤Ï¤³¤Î¸Æ¤Ó½Ð¤·¤Ç¹¹¿·¤µ¤ì¤ë¡£ + +.\"O .I count +.\"O is the number of bytes to copy between the file descriptors. +.I count +¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿´Ö¤Ç¥³¥Ô¡¼¤¹¤ë¥Ð¥¤¥È¿ô¤Ç¤¢¤ë¡£ + +.\"O Presently (Linux 2.6.9): +.\"O .IR in_fd , +.\"O must correspond to a file which supports +.\"O .BR mmap (2)-like +.\"O operations +.\"O (i.e., it cannot be a socket); +.\"O and +.\"O .I out_fd +.\"O must refer to a socket. +º£¤Î¤È¤³¤í (Linux 2.6.9 ¤Ç¤Ï)¡¢ +.I in_fd +¤Ï +.BR mmap (2) +É÷¤ÎÁàºî¤¬¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(¥½¥±¥Ã¥È¤ò»Ø¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤)¡£¤Þ¤¿¡¢ +.I out_fd +¤Ï¥½¥±¥Ã¥È¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O Applications may wish to fall back to +.\"O .BR read (2)/ write (2) +.\"O in the case where +.\"O .BR sendfile () +.\"O fails with +.\"O .B EINVAL +.\"O or +.\"O .BR ENOSYS . +.BR sendfile () +¤¬ +.B EINVAL +¤ä +.B ENOSYS +¤Ç¼ºÇÔ¤¹¤ë¤è¤¦¤Ê¾ì¹ç¤Ï¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï +.BR read (2)/ write (2) +¤ËÌ᤹¤³¤È¤ò¹Í¤¨¤Æ¤â¤è¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O If the transfer was successful, the number of bytes written to +.\"O .I out_fd +.\"O is returned. +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +žÁ÷¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ +.I out_fd +¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.\"O Nonblocking I/O has been selected using +.\"O .B O_NONBLOCK +.\"O and the write would block. +.B O_NONBLOCK +¤òÍѤ¤¤ÆÈó¥Ö¥í¥Ã¥¯ I/O ¤¬ÁªÂò¤µ¤ì¤¿¤¬¡¢½ñ¤­¹þ¤ß¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¡£ +.TP +.B EBADF +.\"O The input file was not opened for reading or the output file +.\"O was not opened for writing. +ÆþÎÏ¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +½ÐÎÏ¥Õ¥¡¥¤¥ë¤¬½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +.\"O Bad address. +¥¢¥É¥ì¥¹¤¬¤ª¤«¤·¤¤¡£ +.TP +.B EINVAL +.\"O Descriptor is not valid or locked, or an +.\"O .BR mmap (2)-like +.\"O operation is not available for +.\"O .IR in_fd . +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Í­¸ú¤Ç¤Ê¤¤¤«¡¢¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¡£¤â¤·¤¯¤Ï +.BR mmap (2) +É÷¤ÎÁàºî¤¬ +.I in_fd +¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +.TP +.B EIO +.\"O Unspecified error while reading from +.\"O .IR in_fd . +.I in_fd +¤«¤éÆɤ߹þ¤ó¤Ç¤¤¤ë¤¦¤Á¤Ëͽ´ü¤·¤Ê¤¤¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O Insufficient memory to read from +.\"O .IR in_fd . +.I in_fd +¤«¤éÆɤ߹þ¤à¤¿¤á¤Î½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .B sendfile +.\"O is a new feature in Linux 2.2. +.B sendfile +¤Ï Linux 2.2 ¤Î¿·¤·¤¤µ¡Ç½¤Ç¤¢¤ë¡£ +.\"O The include file +.\"O .I +.\"O is present since glibc 2.1. +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤Ï glibc 2.1 ¤«¤é¸ºß¤·¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Not specified in POSIX.1-2001, or other standards. +POSIX.1-2001 ¤ä¾¤Îɸ½à¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"O Other Unix systems implement +.\"O .BR sendfile () +.\"O with different semantics and prototypes. +.\"O It should not be used in portable programs. +¾¤Î Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢°Û¤Ê¤Ã¤¿Êý¼°¤ä¥×¥í¥È¥¿¥¤¥×¤Ç +.BR sendfile () +¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£°Ü¿¢À­¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O If you plan to use +.\"O .BR sendfile () +.\"O for sending files to a TCP socket, but need +.\"O to send some header data in front of the file contents, you will find +.\"O it useful to employ the +.\"O .B TCP_CORK +.\"O option, described in +.\"O .BR tcp (7), +.\"O to minimize the number of packets and to tune performance. +.BR sendfile () +¤ò»È¤Ã¤Æ TCP ¥½¥±¥Ã¥È¤Ë¥Õ¥¡¥¤¥ë¤òÁ÷¤í¤¦¤È¤·¤Æ¤¤¤Æ¡¢ +¥Õ¥¡¥¤¥ë¤ÎÆâÍƤÎÁ°¤Ë¥Ø¥Ã¥À¡¦¥Ç¡¼¥¿¤òÉÕ¤±²Ã¤¨¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ï¡¢ +¥Ñ¥±¥Ã¥È¿ô¤òºÇ¾®¤Ë¤·¤ÆÀ­Ç½¤ò¾å¤²¤ë¤¿¤á¤Ë +.BR tcp (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë +.B TCP_CORK +¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¤¤¤¤¤À¤í¤¦¡£ + +.\"O In Linux 2.4 and earlier, +.\"O .I out_fd +.\"O could refer to a regular file, and +.\"O .BR sendfile () +.\"O changed the current offset of that file. +Linux 2.4 ¤È¤½¤ì°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ +.I out_fd +¤ÏÄ̾ï¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤Ç¤­¡¢ +.BR sendfile () +¤Ï¤½¤Î¥Õ¥¡¥¤¥ë¤Î¥ª¥Õ¥»¥Ã¥È¤Î¸½ºßÃͤòÊѹ¹¤·¤Æ¤¤¤¿¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR mmap (2), +.BR open (2), +.BR socket (2), +.BR splice (2) diff --git a/draft/man2/set_mempolicy.2 b/draft/man2/set_mempolicy.2 new file mode 100644 index 00000000..7c14fe07 --- /dev/null +++ b/draft/man2/set_mempolicy.2 @@ -0,0 +1,532 @@ +.\" Copyright 2003,2004 Andi Kleen, SuSE Labs. +.\" and Copyright 2007 Lee Schermerhorn, Hewlett Packard +.\" +.\" 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. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\" 2006-02-03, mtk, substantial wording changes and other improvements +.\" 2007-08-27, Lee Schermerhorn +.\" more precise specification of behavior. +.\" +.\" Translated 2006-08-14, Akihiro MOTOKI , LDP v2.39 +.\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2008-02-13, Akihiro MOTOKI, LDP v2.77 +.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-08-21, Akihiro MOTOKI, LDP v3.07 +.\" Updated 2008-09-02, Akihiro MOTOKI, LDP v3.08 +.\" Updated 2008-11-19, Akihiro MOTOKI, LDP v3.13 +.\" +.\"WORD: anonymous memory ̵̾¥á¥â¥ê +.\" +.TH SET_MEMPOLICY 2 2008-08-15 Linux "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O set_mempolicy \- set default NUMA memory policy for a process and its children +set_mempolicy \- ¥×¥í¥»¥¹¤È¤½¤Î»Ò¥×¥í¥»¥¹¤Î NUMA ¥á¥â¥ê¤Î +¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int set_mempolicy(int " mode ", unsigned long *" nodemask , +.BI " unsigned long " maxnode ); +.sp +.\"O Link with \fI\-lnuma\fP. +\fI\-lnuma\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR set_mempolicy () +.\"O sets the NUMA memory policy of the calling process, +.\"O which consists of a policy mode and zero or more nodes, +.\"O to the values specified by the +.\"O .IR mode , +.\"O .I nodemask +.\"O and +.\"O .I maxnode +.\"O arguments. +.BR set_mempolicy () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î NUMA ¥Ý¥ê¥·¡¼¤ò +.I policy +¤ËÀßÄꤹ¤ë¡£ +NUMA ¥Ý¥ê¥·¡¼¤Ï¥Ý¥ê¥·¡¼¥â¡¼¥É¤È 0 ¸Ä°Ê¾å¤Î¥Î¡¼¥É¤«¤é¹½À®¤µ¤ì¡¢ +ÀßÄêÆâÍƤϰú¤­¿ô +.IR mode , +.IR nodemask , +.I maxnode +¤Ë¤è¤ê»ØÄꤵ¤ì¤ë¡£ + +.\"O A NUMA machine has different +.\"O memory controllers with different distances to specific CPUs. +.\"O The memory policy defines from which node memory is allocated for +.\"O the process. +NUMA (ÈóÂоΥá¥â¥ê¥¢¥¯¥»¥¹) ¥Þ¥·¥ó¤Ç¤Ï¡¢CPU ¤Ë¤è¤ê +¥á¥â¥ê¥³¥ó¥È¥í¡¼¥é¤¬°Û¤Ê¤ê¡¢µ÷Î¥¤â°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï¡¢¤É¤Î¥Î¡¼¥É¤«¤é¥á¥â¥ê¤ò¤½¤Î¥×¥í¥»¥¹¤Ë +³ä¤êÅö¤Æ¤é¤ì¤ë¤«¤òÄê¤á¤ë¤â¤Î¤Ç¤¢¤ë¡£ + +.\"O This system call defines the default policy for the process. +.\"O The process policy governs allocation of pages in the process's +.\"O address space outside of memory ranges +.\"O controlled by a more specific policy set by +.\"O .BR mbind (2). +.BR set_mempolicy () +¤Ï¡¢¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤òÄê¤á¤ë¡£ +¥×¥í¥»¥¹¤Î¥Ý¥ê¥·¡¼¤Ï¡¢ +.BR mbind (2) +¤ÇÀßÄꤵ¤ì¤ëÆÃÄê¤Î¥Ý¥ê¥·¡¼¤Ë¤è¤êÀ©¸æ¤µ¤ì¤ë¥á¥â¥êÎΰè°Ê³°¤Î +¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤ª¤±¤ë¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤ËŬÍѤµ¤ì¤ë¡£ +.\"O The process default policy also controls allocation of any pages for +.\"O memory mapped files mapped using the +.\"O .BR mmap (2) +.\"O call with the +.\"O .B MAP_PRIVATE +.\"O flag and that are only read [loaded] from by the process +.\"O and of memory mapped files mapped using the +.\"O .BR mmap (2) +.\"O call with the +.\"O .B MAP_SHARED +.\"O flag, regardless of the access type. +¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ï¡¢ +.B MAP_PRIVATE +¥Õ¥é¥°¤ò»ØÄꤷ¤¿ +.BR mmap (2) +¤ò»È¤Ã¤Æ¥Þ¥Ã¥×¤µ¤ì¤¿¥á¥â¥ê¥Þ¥Ã¥×¡¦¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëÆɤ߽Ф·ÀìÍÑ +(¥í¡¼¥É¤µ¤ì¤ë¤À¤±) ¤Î¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ë¤âŬÍѤµ¤ì¤ë¡£ +¤Þ¤¿¡¢ +.B MAP_SHARED +¥Õ¥é¥°¤ò»ØÄꤷ¤¿ +.BR mmap (2) +¤ò»È¤Ã¤Æ¥Þ¥Ã¥×¤µ¤ì¤¿¥á¥â¥ê¥Þ¥Ã¥×¡¦¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ë¤â +ŬÍѤµ¤ì¤ë (¤³¤Î¾ì¹ç¤Ï¥Ú¡¼¥¸¤Î¥¢¥¯¥»¥¹¼ïÊ̤˴ؤï¤é¤ºÅ¬ÍѤµ¤ì¤ë) ¡£ +.\"O The policy is only applied when a new page is allocated +.\"O for the process. +.\"O For anonymous memory this is when the page is first +.\"O touched by the application. +ÀßÄꤷ¤¿¥Ý¥ê¥·¡¼¤Ï¡¢¥×¥í¥»¥¹¤Ë¿·µ¬¤Î¥Ú¡¼¥¸¤¬³ä¤êÅö¤Æ¤é¤ì¤ë¤È¤­¤Ë¤Î¤ß +ŬÍѤµ¤ì¤ë¡£ÌµÌ¾¥á¥â¥ê (anonymous memory) ¤Î¾ì¹ç¡¢¿·µ¬¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ï +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬½é¤á¤Æ¥Ú¡¼¥¸¤Ë¥¢¥¯¥»¥¹¤·¤¿ºÝ¤Ë¹Ô¤ï¤ì¤ë¡£ + +.\"O The +.\"O .I mode +.\"O argument must specify one of +.\"O .BR MPOL_DEFAULT , +.\"O .BR MPOL_BIND , +.\"O .B MPOL_INTERLEAVE +.\"O or +.\"O .BR MPOL_PREFERRED . +.\"O All modes except +.\"O .B MPOL_DEFAULT +.\"O require the caller to specify via the +.\"O .I nodemask +.\"O argument one or more nodes. +.I mode +°ú¤­¿ô¤Ë¤Ï +.BR MPOL_DEFAULT , +.BR MPOL_BIND , +.BR MPOL_INTERLEAVE , +.B MPOL_PREFERRED +¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄꤷ¤Æ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B MPOL_DEFAULT +°Ê³°¤Î¥Ý¥ê¥·¡¼¤Î¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï +.I nodemask +°ú¤­¿ô¤Ç°ì¤Ä°Ê¾å¤Î¥Î¡¼¥É¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ + +.\"O The +.\"O .I mode +.\"O argument may also include an optional +.\"O .IR "mode flag" . +.\"O The supported +.\"O .I "mode flags" +.\"O are: +.I mode +°ú¤­¿ô¤Ë¤Ï¡¢ÄÉ²Ã¤Ç +.I "¥â¡¼¥É¥Õ¥é¥°" +¤ò´Þ¤á¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë +.I "¥â¡¼¥É¥Õ¥é¥°" +¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.TP +.\"O .BR MPOL_F_STATIC_NODES " (since Linux 2.6.26)" +.BR MPOL_F_STATIC_NODES " (Linux 2.6.26 °Ê¹ß)" +.\"O A nonempty +.\"O .I nodemask +.\"O specifies physical node ids. +.\"O Linux does will not remap the +.\"O .I nodemask +.\"O when the process moves to a different cpuset context, +.\"O nor when the set of nodes allowed by the process's +.\"O current cpuset context changes. +¶õ¤Ç¤Ê¤¤ +.I nodemask +¤Ï¡¢ÊªÍý¥Î¡¼¥É ID ¤Ç¤¢¤ë¡£ +Linux ¤Ç¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬°Û¤Ê¤ë CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È (cpuset context) +¤Ë°ÜÆ°¤·¤¿¾ì¹ç¤Ç¤â¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç +µö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É½¸¹ç¤¬ÊѲ½¤·¤¿¾ì¹ç¤Ç¤â¡¢ +.I nodemask +¤ò¥Þ¥Ã¥Ô¥ó¥°¤·Ä¾¤¹¤³¤È¤Ï¤Ê¤¤¡£ +.TP +.\"O .BR MPOL_F_RELATIVE_NODES " (since Linux 2.6.26)" +.BR MPOL_F_RELATIVE_NODES " (Linux 2.6.26 °Ê¹ß)" +.\"O A nonempty +.\"O .I nodemask +.\"O specifies node ids that are relative to the set of +.\"O node ids allowed by the process's current cpuset. +¶õ¤Ç¤Ê¤¤ +.I nodemask +¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¤Çµö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É ID ½¸¹ç +¤Ë¤ª¤±¤ëÁêÂÐŪ¤Ê¥Î¡¼¥É ID ¤Ç¤¢¤ë¡£ +.PP +.\"O .I nodemask +.\"O points to a bit mask of node IDs that contains up to +.\"O .I maxnode +.\"O bits. +.\"O The bit mask size is rounded to the next multiple of +.\"O .IR "sizeof(unsigned long)" , +.\"O but the kernel will only use bits up to +.\"O .IR maxnode . +.I nodemask +¤Ï¡¢ºÇÂç¤Ç +.I maxnode +¥Ó¥Ã¥È¤«¤é¹½À®¤µ¤ì¤ë¥Î¡¼¥É ID ¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤ò»Ø¤¹¡£ +¥Ó¥Ã¥È¥Þ¥¹¥¯¤ÎÂ礭¤µ¤Ï¡¢Ä¾¶á¤Î +.I sizeof(unsigned long) +¤ÎÇÜ¿ô¤ËÀÚ¤ê¾å¤²¤é¤ì¤ë¤¬¡¢¥«¡¼¥Í¥ë¤¬»ÈÍѤ¹¤ë¤Î¤Ï +.I maxnode +¸Ä¤Þ¤Ç¤Î¥Ó¥Ã¥È¤À¤±¤Ç¤¢¤ë¡£ +.\"O A NULL value of +.\"O .I nodemask +.\"O or a +.\"O .I maxnode +.\"O value of zero specifies the empty set of nodes. +.\"O If the value of +.\"O .I maxnode +.\"O is zero, +.\"O the +.\"O .I nodemask +.\"O argument is ignored. +NULL ÃͤΠ+.I nodemask +¤â¤·¤¯¤ÏÃͤ¬ 0 ¤Î +.I maxnode +¤Ï¥Î¡¼¥É¤Î¶õ½¸¹ç¤òɽ¤¹¡£ +.I maxnode +¤ÎÃͤ¬ 0 ¤Î¾ì¹ç¡¢ +.I nodemask +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"O Where a +.\"O .I nodemask +.\"O is required, it must contain at least one node that is on-line, +.\"O allowed by the process's current cpuset context, +.\"O [unless the +.\"O .B MPOL_F_STATIC_NODES +.\"O mode flag is specified], +.\"O and contains memory. +.I nodemask +¤¬É¬¿Ü¤Î¾ìÌ̤Ǥϡ¢ +.I nodemask +¤Ë¡¢¥ª¥ó¥é¥¤¥ó¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç +µö²Ä¤µ¤ì¤Æ¤ª¤ê +.RB ( MPOL_F_STATIC_NODES +¥â¡¼¥É¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢¥á¥â¥ê¤¬¤¢¤ë¥Î¡¼¥É¤¬ +¾¯¤Ê¤¯¤È¤â°ì¤ÄÆþ¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O If the +.\"O .B MPOL_F_STATIC_NODES +.\"O is set in +.\"O .I mode +.\"O and a required +.\"O .I nodemask +.\"O contains no nodes that are allowed by the process's current cpuset context, +.\"O the memory policy reverts to +.\"O .IR "local allocation" . +.\"O This effectively overrides the specified policy until the process's +.\"O cpuset context includes one or more of the nodes specified by +.\"O .IR nodemask. +.I mode +¤Ë +.B MPOL_F_STATIC_NODES +¤¬¥»¥Ã¥È¤µ¤ì¡¢ +.I nodemask +¤¬É¬¿Ü¤Î¾ìÌ̤ǡ¢ +.I nodemask +¤Ë¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Çµö²Ä¤µ¤ì¤¿¥Î¡¼¥É¤¬ +°ì¤Ä¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥á¥â¥ê¤Î¥Ý¥ê¥·¡¼¤È¤·¤Æ¥Ç¥Õ¥©¥ë¥È¤Î +¡Ö¥í¡¼¥«¥ë¤«¤é³ä¤êÅö¤Æ (local allocation)¡×¤¬Å¬ÍѤµ¤ì¤ë¡£ +¤½¤Î¥×¥í¥»¥¹¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤¬ +.I nodemask +¤Ç»ØÄꤵ¤ì¤¿¥Î¡¼¥É¤ò¾¯¤Ê¤¯¤È¤â°ì¤Ä´Þ¤à¤è¤¦¤Ë¤Ê¤ë¤Þ¤Ç¤Ï¡¢ +·ë²ÌŪ¤Ë»ØÄꤵ¤ì¤¿Æ°ºî¤¬¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ + +.\"O The +.\"O .B MPOL_DEFAULT +.\"O mode specifies that any nondefault process memory policy be removed, +.\"O so that the memory policy "falls back" to the system default policy. +.\"O The system default policy is "local allocation"-- +.\"O i.e., allocate memory on the node of the CPU that triggered the allocation. +.\"O .I nodemask +.\"O must be specified as NULL. +.\"O If the "local node" contains no free memory, the system will +.\"O attempt to allocate memory from a "near by" node. +.B MPOL_DEFAULT +¥â¡¼¥É¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¤Ê¤¤¥×¥í¥»¥¹¤Î¥á¥â¥ê¥Ý¥ê¥·¡¼¤òºï½ü¤¹¤ë¤³¤È¤ò +»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï¥·¥¹¥Æ¥à¤Î +¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ë¡ÖÌá¤ë¡×¤³¤È¤Ë¤Ê¤ë¡£ +¥·¥¹¥Æ¥à¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ï¡Ö¥í¡¼¥«¥ë¤«¤é¤Î³ä¤êÅö¤Æ (local allocation)¡×¡¢ +¤Ä¤Þ¤ê¥á¥â¥ê³ä¤êÅö¤Æ¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿ CPU ¤Î¥Î¡¼¥É¤Î¥á¥â¥ê¤¬³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +.I nodemask +¤Ë¤Ï NULL ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¡Ö¼«¥Î¡¼¥É (local node)¡×¤Ë¶õ¤­¥á¥â¥ê¤¬Á´¤¯¤Ê¤¤¾ì¹ç¡¢¥·¥¹¥Æ¥à¤Ï +¡Ö¶á¤¯¤Î (near by) ¥Î¡¼¥É¡×¤«¤é¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤è¤¦¤È»î¤ß¤ë¡£ + +.\"O The +.\"O .B MPOL_BIND +.\"O mode defines a strict policy that restricts memory allocation to the +.\"O nodes specified in +.\"O .IR nodemask . +.\"O If +.\"O .I nodemask +.\"O specifies more than one node, page allocations will come from +.\"O the node with the lowest numeric node ID first, until that node +.\"O contains no free memory. +.\"O Allocations will then come from the node with the next highest +.\"O node ID specified in +.\"O .I nodemask +.\"O and so forth, until none of the specified nodes contain free memory. +.\"O Pages will not be allocated from any node not specified in the +.\"O .IR nodemask . +.B MPOL_BIND +¥â¡¼¥É¤Ï¸·Ì©¤Ê¥Ý¥ê¥·¡¼¤Ç¡¢¥á¥â¥ê³ä¤êÅö¤Æ¤Ï +.I nodemask +¤Ë»ØÄꤵ¤ì¤¿¥Î¡¼¥É¤Ë¸ÂÄꤵ¤ì¤ë¡£ +.I nodemask +¤Ë 2 ¸Ä°Ê¾å¤Î¥Î¡¼¥É¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ï +¥Î¡¼¥É ID ¤¬¿ô»ú¤È¤·¤ÆºÇ¾®¤Î¥Î¡¼¥É¤«¤é³«»Ï¤µ¤ì¡¢ +¤½¤Î¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç¤½¤Î¥Î¡¼¥É¤«¤é +¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£¤½¤Î¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤Ã¤¿¤é¡¢ +.\"motoki: the next highest ¤Ï the next lowest ¤Î´Ö°ã¤¤¡© +¼¡¤Ë¾®¤µ¤Ê¥Î¡¼¥É ID ¤ò»ý¤Ä¥Î¡¼¥É¤«¤é¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£ +¤³¤ì¤ò¡¢ +.I nodemask +¤Ç»ØÄꤵ¤ì¤¿Á´¤Æ¤Î¥Î¡¼¥É¤Ç¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç·«¤êÊÖ¤¹¡£ +.I nodemask +¤Ç»ØÄꤵ¤ì¤¿°Ê³°¤Î¥Î¡¼¥É¤«¤é¤Ï¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ + +.\"O .B MPOL_INTERLEAVE +.\"O interleaves page allocations across the nodes specified in +.\"O .I nodemask +.\"O in numeric node ID order. +.\"O This optimizes for bandwidth instead of latency +.\"O by spreading out pages and memory accesses to those pages across +.\"O multiple nodes. +.\"O However, accesses to a single page will still be limited to +.\"O the memory bandwidth of a single node. +.B MPOL_INTERLEAVE +¤Ç¤Ï¡¢¥Ú¡¼¥¸³ä¤êÅö¤Æ¤ò +.I nodemask +¤Ë»ØÄꤵ¤ì¤¿¥Î¡¼¥É¤Î´Ö¤Ç¥Î¡¼¥É ID ¤Î¿ô»ú½ç¤Ç¸ò¸ß¤Ë¹Ô¤¦¡£ +¤³¤Î¥Ý¥ê¥·¡¼¤Ç¤Ï¡¢Ê£¿ô¤Î¥Î¡¼¥É¤Ë¥Ú¡¼¥¸¤ò¹­¤²¤ÆÇÛÃÖ¤·¡¢¤³¤ì¤é¤Î¥Ú¡¼¥¸¤Ø¤Î¥á¥â¥ê +¥¢¥¯¥»¥¹¤òʬ»¶¤¹¤ë¤³¤È¤Ç¡¢ÃÙ±ä¤Ç¤Ï¤Ê¤¯¡¢ÂÓ°è¤òºÇŬ²½¤¹¤ë¡£ +¤¿¤À¤·¡¢°ì¤Ä¤Î¥Ú¡¼¥¸¤Ø¤Î¥¢¥¯¥»¥¹¤Ë´Ø¤·¤Æ¤Ï°ÍÁ³¤È¤·¤Æ°ì¤Ä¤Î¥Î¡¼¥É¤Î¥á¥â¥êÂÓ°è +¤¬¾å¸Â¤È¤Ê¤ë¡£ +.\" NOTE: the following sentence doesn't make sense in the context +.\" of set_mempolicy() -- no memory area specified. +.\" To be effective the memory area should be fairly large, +.\" at least 1MB or bigger. + +.\"O .B MPOL_PREFERRED +.\"O sets the preferred node for allocation. +.\"O The kernel will try to allocate pages from this node first +.\"O and fall back to "near by" nodes if the preferred node is low on free +.\"O memory. +.\"O If +.\"O .I nodemask +.\"O specifies more than one node ID, the first node in the +.\"O mask will be selected as the preferred node. +.\"O If the +.\"O .I nodemask +.\"O and +.\"O .I maxnode +.\"O arguments specify the empty set, then the policy +.\"O specifies "local allocation" +.\"O (like the system default policy discussed above). +.B MPOL_PREFERRED +¤Ï¡¢³ä¤êÅö¤Æ»þ¤ËÍ¥À褵¤ì¤ë¥Î¡¼¥É (preferred node) ¤òÀßÄꤹ¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¤Þ¤ºÍ¥Àè¥Î¡¼¥É¤«¤é¥Ú¡¼¥¸³ä¤êÅö¤Æ¤ò¹Ô¤ª¤¦¤È¤·¡¢ +Í¥Àè¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¾¯¤Ê¤¤¾ì¹ç¤Ë¡Ö¶á¤¯¤Î (near by)¡×¥Î¡¼¥É¤«¤é +³ä¤êÅö¤Æ¤ò¹Ô¤¦¡£ +.I nodemask +¤ËÊ£¿ô¤Î¥Î¡¼¥É ID ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +.I nodemask +Æâ¤ÎºÇ½é¤Î¥Î¡¼¥É¤¬Í¥Àè¥Î¡¼¥É¤È¤·¤ÆÁªÂò¤µ¤ì¤ë¡£ +°ú¤­¿ô +.IR nodemask , +.I maxnode +¤Ç¶õ½¸¹ç¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢¥Ý¥ê¥·¡¼¤Ï (¾å½Ò¤Î¥·¥¹¥Æ¥à¤Î +¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤ÈƱÍͤË) ¡Ö¥í¡¼¥«¥ë¤«¤é¤Î³ä¤êÅö¤Æ¡×¤È¤Ê¤ë¡£ + +.\"O The process memory policy is preserved across an +.\"O .BR execve (2), +.\"O and is inherited by child processes created using +.\"O .BR fork (2) +.\"O or +.\"O .BR clone (2). +¥×¥í¥»¥¹¤Î¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï +.BR execve (2) +¤ÎÁ°¸å¤ÇÊÝ»ý¤µ¤ì¡¢ +.BR fork (2) +¤ä +.BR clone (2) +¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ë·Ñ¾µ¤µ¤ì¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR set_mempolicy () +.\"O returns 0; +.\"O on error, \-1 is returned and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR set_mempolicy () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O Part of all of the memory range specified by +.\"O .I nodemask +.\"O and +.\"O .I maxnode +.\"O points outside your accessible address space. +.\"motoki: Part of all of the memory ¤Ï Part or all .. ¤Î´Ö°ã¤¤¡© +.I nodemask +¤È +.I maxnode +¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥êÎΰè¤Î°ìÉô¤Þ¤¿¤ÏÁ´Éô¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O .I mode +.\"O is invalid. +.I mode +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.\"O Or, +.\"O .I mode +.\"O is +.\"O .B MPOL_DEFAULT +.\"O and +.\"O .I nodemask +.\"O is nonempty, +.I mode +¤¬ +.B MPOL_DEFAULT +¤Ç¡¢ +.I nodemask +¤¬¶õ¤Ç¤Ï¤Ê¤¤¡£ +.\"O or +.\"O .I mode +.\"O is +.\"O .B MPOL_BIND +.\"O or +.\"O .B MPOL_INTERLEAVE +.\"O and +.\"O .I nodemask +.\"O is empty. +.I mode +¤¬ +.B MPOL_BIND +¤« +.B MPOL_INTERLEAVE +¤Ç¡¢ +.I nodemask +¤¬¶õ¤Ç¤¢¤ë¡£ +.\"O Or, +.\"O .I maxnode +.\"O specifies more than a page worth of bits. +.I maxnode +¤Ç¼ÂºÝ¤Ë°ÕÌ£¤¬¤¢¤ë¥Ó¥Ã¥È¿ô¤è¤ê¿¤¯¤Î¥Ó¥Ã¥È¿ô¤¬»ØÄꤵ¤ì¤¿¡£ +.\"O Or, +.\"O .I nodemask +.\"O specifies one or more node IDs that are +.\"O greater than the maximum supported node ID. +.I nodemask +¤Ë¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëºÇÂç¥Î¡¼¥É ID ¤è¤êÂ礭¤¤¥Î¡¼¥É¤¬»ØÄꤵ¤ì¤¿¡£ +.\"O Or, none of the node IDs specified by +.\"O .I nodemask +.\"O are on-line and allowed by the process's current cpuset context, +.\"O or none of the specified nodes contain memory. +.I nodemask +¤Ë¡¢¥ª¥ó¥é¥¤¥ó¤Ç¡¢¤«¤Ä¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç +µö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤¬°ì¤Ä¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +¥á¥â¥ê¤ò´Þ¤à¥Î¡¼¥É¤¬°ì¤Ä¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O Or, the +.\"O .I mode +.\"O argument specified both +.\"O .B MPOL_F_STATIC_NODES +.\"O and +.\"O .BR MPOL_F_RELATIVE_NODES . +.I mode +°ú¤­¿ô¤Ë +.B MPOL_F_STATIC_NODES +¤È +.B MPOL_F_RELATIVE_NODES +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B ENOMEM +.\"O Insufficient kernel memory was available. +ÍøÍѲÄǽ¤Ê¥«¡¼¥Í¥ë¥á¥â¥ê¤¬½½Ê¬¤Ç¤Ê¤«¤Ã¤¿¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The +.\"O .BR set_mempolicy (), +.\"O system call was added to the Linux kernel in version 2.6.7. +.BR set_mempolicy () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ð¡¼¥¸¥ç¥ó 2.6.7 ¤Ç Linux ¥«¡¼¥Í¥ë¤ËÄɲ䵤줿¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O This system call is Linux-specific. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Process policy is not remembered if the page is swapped out. +¥Ú¡¼¥¸¤¬¥¹¥ï¥Ã¥×¡¦¥¢¥¦¥È¤µ¤ì¤ë¾ì¹ç¤Ë¤Ï¡¢ +¥×¥í¥»¥¹¥Ý¥ê¥·¡¼¤ÎÀßÄê¤Ï¿ä¾©¤µ¤ì¤Ê¤¤¡£ +.\"O When such a page is paged back in, it will use the policy of +.\"O the process or memory range that is in effect at the time the +.\"O page is allocated. +¥¹¥ï¥Ã¥×¡¦¥¢¥¦¥È¤µ¤ì¤¿¥Ú¡¼¥¸¤¬¥Ú¡¼¥¸¡¦¥¤¥ó¤¹¤ëºÝ¤Ë¤â¡¢ +¥Ú¡¼¥¸³ä¤êÅö¤Æ»þ¤ËŬÍѤµ¤ì¤ë¥×¥í¥»¥¹¥Ý¥ê¥·¡¼¤ä¥á¥â¥êÎΰè¥Ý¥ê¥·¡¼¤¬ +»ÈÍѤµ¤ì¤ë¡£ + +.\"O For information on library support, see +.\"O .BR numa (7). +¥é¥¤¥Ö¥é¥ê¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR numa (7) +¤ò»²¾È¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR get_mempolicy (2), +.BR getcpu (2), +.BR mbind (2), +.BR mmap (2), +.BR numa (3), +.BR cpuset (7), +.BR numa (7), +.BR numactl (8) diff --git a/draft/man2/set_thread_area.2 b/draft/man2/set_thread_area.2 new file mode 100644 index 00000000..9fc24d61 --- /dev/null +++ b/draft/man2/set_thread_area.2 @@ -0,0 +1,120 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" 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 +.\" +.\"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 +.SH ̾Á° +set_thread_area \- ¥¹¥ì¥Ã¥É¶É½êµ­²± (TLS) Îΰè¤òÀßÄꤹ¤ë +.\"O .SH "SYNOPSIS" +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int set_thread_area(struct user_desc *" u_info ); +.\"O .SH "DESCRIPTION" +.SH ÀâÌÀ +.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" +.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" +.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. +̤»ÈÍѤΠ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" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR get_thread_area (2) diff --git a/draft/man2/set_tid_address.2 b/draft/man2/set_tid_address.2 new file mode 100644 index 00000000..e2a28ae6 --- /dev/null +++ b/draft/man2/set_tid_address.2 @@ -0,0 +1,166 @@ +.\" Copyright (C) 2004 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. +.\" +.\" Japanese Version Copyright (c) 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated Wed Jan 26 07:21:01 JST 2005 +.\" by Yuichi SATO +.\" +.TH SET_TID_ADDRESS 2 2004-09-10 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O set_tid_address \- set pointer to thread ID +set_tid_address \- ¥¹¥ì¥Ã¥É ID ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long set_tid_address(int *" tidptr ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The kernel keeps for each process two values called +.\"O .I set_child_tid +.\"O and +.\"O .I clear_child_tid +.\"O that are NULL by default. +¥«¡¼¥Í¥ë¤Ï³Æ¥×¥í¥»¥¹¤Ë¤Ä¤¤¤Æ +.I set_child_tid +¤È +.I clear_child_tid +¤È¤¤¤¦ 2 ¤Ä¤ÎÃͤòÊÝ»ý¤¹¤ë¡£ +¤³¤ì¤é¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï NULL ¤Ç¤¢¤ë¡£ +.SS set_child_tid +.\"O If a process is started using +.\"O .BR clone (2) +.\"O with the +.\"O .B CLONE_CHILD_SETTID +.\"O flag, +.\"O .I set_child_tid +.\"O is set to +.\"O .IR child_tidptr , +.\"O the fifth argument of that system call. +¥×¥í¥»¥¹¤¬ +.B CLONE_CHILD_SETTID +¥Õ¥é¥°¤ò»ØÄꤷ¤¿ +.BR clone (2) +¤Ë¤è¤Ã¤Æ³«»Ï¤µ¤ì¤¿¾ì¹ç¡¢ +.I set_child_tid +¤Ï +.I child_tidptr +¤ËÀßÄꤵ¤ì¤ë¡£ +¤³¤ì¤Ï +.BR clone (2) +¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î 5 ÈÖÌܤΰú¤­¿ô¤Ç¤¢¤ë¡£ +.\"Osato: +.\"Osato: __syscall5 ¤Ç __NR_clone ¤ò¸Æ¤Ó½Ð¤¹¤È¤­¤Î +.\"Osato: 5 ÈÖÌܤΰú¤­¿ô¤È¤¤¤¦¤³¤È¤À¤í¤¦¤«¡£ +.\"Osato: +.LP +.\"O When +.\"O .I set_child_tid +.\"O is set, the very first thing the new process does +.\"O is writing its PID at this address. +.I set_child_tid +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢°ìÈֺǽé¤Ë¿·¤·¤¤¥×¥í¥»¥¹¤¬¹Ô¤¦¤³¤È¤Ï¡¢ +¤³¤Î¥¢¥É¥ì¥¹¤Ë¼«¿È¤Î PID ¤ò½ñ¤­¹þ¤à¤³¤È¤Ç¤¢¤ë¡£ +.SS clear_child_tid +.\"O If a process is started using +.\"O .BR clone (2) +.\"O with the +.\"O .B CLONE_CHILD_CLEARTID +.\"O flag, +.\"O .I clear_child_tid +.\"O is set to +.\"O .IR child_tidptr , +.\"O the fifth argument of that system call. +¥×¥í¥»¥¹¤¬ +.B CLONE_CHILD_CLEARTID +¥Õ¥é¥°¤ò»ØÄꤷ¤¿ +.BR clone (2) +¤Ë¤è¤Ã¤Æ³«»Ï¤µ¤ì¤¿¾ì¹ç¡¢ +.I clear_child_tid +¤Ï +.I child_tidptr +¤ËÀßÄꤵ¤ì¤ë¡£ +¤³¤ì¤Ï +.BR clone (2) +¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î 5 ÈÖÌܤΰú¤­¿ô¤Ç¤¢¤ë¡£ +.LP +.\"O The system call +.\"O .BR set_tid_address () +.\"O sets the +.\"O .I clear_child_tid +.\"O value for the calling process to +.\"O .IR tidptr . +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR set_tid_address () +¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +.I clear_child_tid +¤ÎÃͤò +.I tidptr +¤ËÀßÄꤹ¤ë¡£ +.LP +.\"O When +.\"O .I clear_child_tid +.\"O is set, and the process exits, and the process was sharing memory +.\"O with other processes or threads, then 0 is written at this address, +.\"O and a +.\"O .I futex(child_tidptr, FUTEX_WAKE, 1, NULL, NULL, 0); +.\"O call is done. +.\"O (That is, wake a single process waiting on this futex.) +.\"O Errors are ignored. +.I clear_child_tid +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È¤­¤Ë¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤È¡¢ +¤½¤Î¥×¥í¥»¥¹¤Ï¾¤Î¥×¥í¥»¥¹¤Þ¤¿¤Ï¥¹¥ì¥Ã¥É¤È¥á¥â¥ê¤ò¶¦Í­¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ +¤³¤Î¥¢¥É¥ì¥¹¤Ë 0 ¤¬½ñ¤­¹þ¤Þ¤ì¡¢ +.I futex(child_tidptr, FUTEX_WAKE, 1, NULL, NULL, 0); +¤Î¸Æ¤Ó½Ð¤·¤¬¼Â¹Ô¤µ¤ì¤ë +(¤Ä¤Þ¤ê¡¢¤³¤Î futex ¤ÇÂԤäƤ¤¤ë 1 ¤Ä¤Î¥×¥í¥»¥¹¤òµ¯¤³¤¹ (wake))¡£ +¥¨¥é¡¼¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR set_tid_address () +.\"O always returns the PID of the calling process. +.BR set_tid_address () +¤Ï¾ï¤Ë¸½ºß¤Î¥×¥í¥»¥¹¤Î PID ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O .BR set_tid_address () +.\"O always succeeds. +.BR set_tid_address () +¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O This call is present since Linux 2.5.48. +.\"O Details as given here are valid since Linux 2.5.49. +¤³¤Î¸Æ¤Ó½Ð¤·¤Ï Linux 2.5.48 °Ê¹ß¤Ç¸ºß¤¹¤ë¡£ +¤³¤³¤Ç½ñ¤«¤ì¤¿¾ÜºÙ¤Ï Linux 2.5.49 °Ê¹ß¤ÇÍ­¸ú¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This system call is Linux-specific. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR futex (2) diff --git a/draft/man2/seteuid.2 b/draft/man2/seteuid.2 new file mode 100644 index 00000000..bf388f91 --- /dev/null +++ b/draft/man2/seteuid.2 @@ -0,0 +1,197 @@ +.\" Copyright (C) 2001 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. +.\" +.\" [should really be seteuid.3] +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" Japanese Version Copyright (c) 2001, 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated 2001-06-04, Yuichi SATO +.\" Updated & Modified 2005-01-04, Yuichi SATO +.\" Updated 2010-04-23, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ ID +.\"WORD: real user ID ¼Â¥æ¡¼¥¶¡¼ ID +.\"WORD: saved user ID Êݸ¥æ¡¼¥¶¡¼ ID +.\"WORD: +.\" +.TH SETEUID 2 2009-10-17 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O seteuid, setegid \- set effective user or group ID +seteuid, setegid \- ¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ä ¼Â¸ú¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int seteuid(uid_t " euid ); +.br +.BI "int setegid(gid_t " egid ); +.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 seteuid (), +.BR setegid (): +_BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR seteuid () +.\"O sets the effective user ID of the calling process. +.\"O Unprivileged user processes may only set the effective user ID to the +.\"O real user ID, the effective user ID or the saved set-user-ID. +.BR seteuid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤òÀßÄꤹ¤ë¡£ +ÈóÆø¢¥æ¡¼¥¶¡¼¤Î¥×¥í¥»¥¹¤Î¾ì¹ç¡¢¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ËÀßÄê¤Ç¤­¤ë¤Î¤Ï¡¢ +¼Â¥æ¡¼¥¶¡¼ ID¡¦¼Â¸ú¥æ¡¼¥¶¡¼ ID¡¦Êݸ set-user-ID ¤Î¤¤¤º¤ì¤«¤À¤±¤Ç¤¢¤ë¡£ + +.\"O Precisely the same holds for +.\"O .BR setegid () +.\"O with "group" instead of "user". +.BR setegid () +¤Ï¡Ö¥æ¡¼¥¶¡¼¡×¤Ç¤Ï¤Ê¤¯¡Ö¥°¥ë¡¼¥×¡×¤ËÂФ·¤ÆÁ´¤¯Æ±¤¸¤³¤È¤ò¹Ô¤¦¡£ +.\" When +.\" .I euid +.\" equals \-1, nothing is changed. +.\" (This is an artifact of the implementation in glibc of seteuid() +.\" using setresuid(2).) +.\"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 EINVAL +.TP +.B EPERM +.\"O The calling process is not privileged (Linux: does not have the +.\"O .B CAP_SETUID +.\"O capability in the case of +.\"O .BR seteuid (), +.\"O or the +.\"O .B CAP_SETGID +.\"O capability in the case of +.\"O .BR setegid ()) +.\"O and +.\"O .I euid +.\"O (respectively, +.\"O .IR egid ) +.\"O is not the real user (group) ID, the effective user (group) ID, +.\"O or the saved set-user-ID (saved set-group-ID). +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¯¡¢ +.I euid +.RI ( egid ) +¤¬¼Â¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID¡¢¤Þ¤¿¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID¡¢ +Êݸ set-user-ID (Êݸ set-group-ID) ¤Î¤¤¤º¤ì¤Ç¤â¤Ç¤Ï¤Ê¤¤ +(Linux ¤Ë¤ª¤¤¤Æ¤Ï¡¢ +.BR seteuid () +¤Ç¤Ï +.B CAP_SETUID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¡¢ +.BR setegid () +¤Ç¤Ï +.B CAP_SETGID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¤¾ì¹ç¤Ë¡¢Æø¢¤¬¤Ê¤¤¤ÈȽÃǤµ¤ì¤ë)¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Setting the effective user (group) ID to the +.\"O saved set-user-ID (set-group-ID) is +.\"O possible since Linux 1.1.37 (1.1.38). +.\"O On an arbitrary system one should check +.\"O .BR _POSIX_SAVED_IDS . +¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤òÊݸ set-user-ID (Êݸ set-group-ID) ¤Ë +ÀßÄê¤Ç¤­¤ë¤Î¤Ï¡¢Linux 1.1.37 (1.1.38) °Ê¹ß¤Ç¤¢¤ë¡£ +Á´¤Æ¤Î¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ +.B _POSIX_SAVED_IDS +¤ò¥Á¥§¥Ã¥¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.LP +.\"O Under libc4, libc5 and glibc 2.0 +.\"O .BI seteuid( euid ) +.\"O is equivalent to +.\"O .BI setreuid(\-1, " euid" ) +.\"O and hence may change the saved set-user-ID. +.\"O Under glibc 2.1 it is equivalent to +.\"O .BI setresuid(\-1, " euid" ", \-1)" +.\"O and hence does not change the saved set-user-ID. +.\"O Similar remarks hold for +.\"O .BR setegid (). +libc4, libc5, glibc 2.0 ¤Ç¤Ï¡¢ +.BI seteuid( euid ) +¤Ï +.BI setreuid(\-1, " euid" ) +¤ÈÅù²Á¤Ç¤¢¤ê¡¢Êݸ set-user-ID ¤òÊѹ¹¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +glibc 2.1 ¤Ç¤Ï¡¢ +.BI setresuid(\-1, " euid" ", \-1)" +¤ÈÅù²Á¤Ç¤¢¤ê¡¢Êݸ set-user-ID Êѹ¹¤·¤Ê¤¤¡£ +ƱÍͤΤ³¤È¤¬ +.BR setegid () +¤Ë¤â¸À¤¨¤ë¡£ + +.\"O According to POSIX.1, +.\"O .BR seteuid () +.\"O .RB ( setegid ()) +.\"O need not permit +.\"O .I euid +.\"O .RI ( egid ) +.\"O to be the same value as the current effective user (group) ID, +.\"O and some implementations do not permit this. +POSIX.1 ¤Ç¤Ï¡¢ +.BR seteuid () +.RB ( setegid ()) +¤Ç¡¢ +.I euid +.RI ( egid ) +¤È¤·¤Æ¸½ºß¤Î¼Â¸ú¥æ¡¼¥¶ (¥°¥ë¡¼¥×) ID ¤ÈƱ¤¸Ãͤò»ØÄê²Äǽ¤Ç¤¢¤ë +ɬÍפϤʤ¤¤È¤µ¤ì¤Æ¤ª¤ê¡¢¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤Ç¤Ï +.I euid +.RI ( egid ) +¤È¤·¤Æ¸½ºß¤Î¼Â¸ú¥æ¡¼¥¶ (¥°¥ë¡¼¥×) ID ¤ÈƱ¤¸Ãͤò +»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR geteuid (2), +.BR setresuid (2), +.BR setreuid (2), +.BR setuid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/draft/man2/setfsgid.2 b/draft/man2/setfsgid.2 new file mode 100644 index 00000000..9de9a55c --- /dev/null +++ b/draft/man2/setfsgid.2 @@ -0,0 +1,180 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created 1995-08-06 Thomas K. Dyas +.\" Modified 2000-07-01 aeb +.\" Modified 2002-07-23 aeb +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Mar 1 00:54:23 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Mon Sep 23 21:21:54 JST 2000 +.\" by HANATAKA Shinya +.\" Modified 2002-09-24 by Akihiro MOTOKI +.\" Modified 2005-02-24, Akihiro MOTOKI +.\" +.\"WORD: identity ID +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: effective group ID ¼Â¸ú¥°¥ë¡¼¥×ID +.\"WORD: real group ID ¼Â¥°¥ë¡¼¥×ID +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: security hole ¥»¥­¥å¥ê¥Æ¥£¡¦¥Û¡¼¥ë +.\"WORD: saved set-group-ID Êݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID +.\" +.TH SETFSGID 2 2008-12-05 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O setfsgid \- set group identity used for file system checks +.SH ̾Á° +setfsgid \- ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¥Á¥§¥Ã¥¯¤ËÍѤ¤¤é¤ì¤ë¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +/* glibc ¤Ç¤Ï */ +.sp +.BI "int setfsgid(uid_t " fsgid ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The system call +.\"O .BR setfsgid () +.\"O sets the group ID that the Linux kernel uses to check for all accesses +.\"O to the file system. +.\"O Normally, the value of +.\"O .I fsgid +.\"O will shadow the value of the effective group ID. +.\"O In fact, whenever the +.\"O effective group ID is changed, +.\"O .I fsgid +.\"O will also be changed to the new value of the effective group ID. +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR setfsgid () +¤Ï Linux ¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ËÂФ¹¤ë +Á´¤Æ¤Î¥¢¥¯¥»¥¹¤Î¥Á¥§¥Ã¥¯¤Ë»ÈÍѤ¹¤ë¥°¥ë¡¼¥× ID¤òÀßÄꤹ¤ë¡£Ä̾ï¤Ï +.I fsgid +¤ÎÃͤϼ¸ú (effective) ¥°¥ë¡¼¥×ID ¤ÈƱ¤¸¤Ë¤Ê¤ë¡£¼ÂºÝ¡¢ +¼Â¸ú¥°¥ë¡¼¥× ID ¤¬Êѹ¹¤µ¤ì¤ëÅÙ¤Ë +.I fsgid +¤â¤Þ¤¿¿·¤·¤¤¼Â¸ú¥°¥ë¡¼¥×ID ¤ÎÃͤËÊѹ¹¤µ¤ì¤ë¡£ + +.\"O Explicit calls to +.\"O .BR setfsuid (2) +.\"O and +.\"O .BR setfsgid () +.\"O are usually only used by programs such as the Linux NFS server that +.\"O need to change what user and group ID is used for file access without a +.\"O corresponding change in the real and effective user and group IDs. +.\"O A change in the normal user IDs for a program such as the NFS server +.\"O is a security hole that can expose it to unwanted signals. +.\"O (But see below.) +Ä̾ +.BR setfsuid () +¤ä +.BR setfsgid () +¤¬ÌÀ¼¨Åª¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¤Î¤Ï¡¢Linux NFS ¥µ¡¼¥Ð¡¼ ¤Î¤è¤¦¤Ë¡¢ +¥Õ¥¡¥¤¥ë¡¦¥¢¥¯¥»¥¹¤ËÍѤ¤¤ë¥æ¡¼¥¶ID / ¥°¥ë¡¼¥×ID ¤òÊѹ¹¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤¬¡¢ +Âбþ¤¹¤ë¼Â(real)/¼Â¸ú(effective) ¥æ¡¼¥¶ID / ¥°¥ë¡¼¥×ID ¤ÏÊѹ¹¤·¤¿¤¯¤Ê¤¤¤è¤¦¤Ê +¥×¥í¥°¥é¥à¤Ë¸Â¤é¤ì¤ë¡£ +NFS ¥µ¡¼¥Ð¡¼¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¡¢Ä̾ï¤Î¥æ¡¼¥¶ID ¤òÊѹ¹¤¹¤ë¤È¡¢ +¥×¥í¥»¥¹¤ò˾¤Þ¤Ê¤¤¥·¥°¥Ê¥ë¤Ë¤µ¤é¤¹²ÄǽÀ­¤¬¤¢¤ê¡¢ +¥»¥­¥å¥ê¥Æ¥£¡¦¥Û¡¼¥ë¤Ë¤Ê¤ë¡£(²¼µ­»²¾È) + +.\"O .BR setfsgid () +.\"O will only succeed if the caller is the superuser or if +.\"O .I fsgid +.\"O matches either the real group ID, effective group ID, +.\"O saved set-group-ID, or the current value of +.\"O .IR fsgid . +.BR setfsgid () +¤Ï¡¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤«¡¢ +.I fsgid +¤¬¼Â¥°¥ë¡¼¥×ID¡¢¼Â¸ú¥°¥ë¡¼¥×ID¡¢ +Êݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID (saved set-group-ID)¡¢¸½ºß¤Î +.I fsgid +¤ÎÃͤΤ¤¤º¤ì¤«¤Ë°ìÃפ¹¤ë¾ì¹ç¤Ë¤Î¤ßÀ®¸ù¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, the previous value of +.\"O .I fsgid +.\"O is returned. +.\"O On error, the current value of +.\"O .I fsgid +.\"O is returned. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.I fsgid +¤Î°ÊÁ°¤ÎÃͤòÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï +.I fsgid +¤Î¸½ºß¤ÎÃͤòÊÖ¤¹¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O This system call is present in Linux since version 1.2. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ð¡¼¥¸¥ç¥ó 1.2 °Ê¹ß¤Î Linux ¤Ë¸ºß¤¹¤ë¡£ +.\" This system call is present since Linux 1.1.44 +.\" and in libc since libc 4.7.6. +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR setfsgid () +.\"O is Linux-specific and should not be used in programs intended +.\"O to be portable. +.BR setfsgid () +¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O When glibc determines that the argument is not a valid group ID, +.\"O it will return \-1 and set \fIerrno\fP to +.\"O .B EINVAL +.\"O without attempting +.\"O the system call. +glibc ¤¬°ú¤­¿ô¤¬¥°¥ë¡¼¥×ID ¤È¤·¤ÆÉÔÀµ¤À¤ÈȽÃǤ·¤¿¾ì¹ç¤Ï¡¢ +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤ï¤º \fIerrno\fP ¤Ë +.B EINVAL +¤òÀßÄꤷ¤Æ \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.LP +.\"O Note that at the time this system call was introduced, a process +.\"O could send a signal to a process with the same effective user ID. +.\"O Today signal permission handling is slightly different. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Æ³Æþ¤µ¤ì¤¿Åö»þ¡¢¥×¥í¥»¥¹¤Ï +Ʊ¤¸¼Â¸ú¥æ¡¼¥¶ID¤Î¥×¥í¥»¥¹¤Ø¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤¿¡£ +º£Æü¤Ç¤Ï¡¢¥·¥°¥Ê¥ëÁ÷¿®¸¢¸Â¤Î°·¤¤¤Ï¤«¤Ê¤ê°ã¤¦¤â¤Î¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O No error messages of any kind are returned to the caller. +.\"O At the very +.\"O least, +.\"O .B EPERM +.\"O should be returned when the call fails (because the caller lacks the +.\"O .B CAP_SETGID +.\"O capability). +¤¤¤«¤Ê¤ë¼ïÎà¤Î¥¨¥é¡¼¡¦¥á¥Ã¥»¡¼¥¸¤âÊÖ¤µ¤Ê¤¤¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï (¸Æ¤Ó½Ð¤·¸µ¤Ë¤Ï +.B CAP_SETGID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤«¤Ã¤¿¤Î¤À¤«¤é) ºÇÄã¤Ç¤â +.B EPERM +¤¯¤é¤¤¤ÏÊÖ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR setfsuid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/draft/man2/setfsuid.2 b/draft/man2/setfsuid.2 new file mode 100644 index 00000000..5e3bcd64 --- /dev/null +++ b/draft/man2/setfsuid.2 @@ -0,0 +1,179 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created 1995-08-06 Thomas K. Dyas +.\" Modified 2000-07-01 aeb +.\" Modified 2002-07-23 aeb +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Mar 1 00:55:10 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Mon Sep 23 21:15:17 JST 2000 +.\" by HANATAKA Shinya +.\" Modified 2002-09-24 by Akihiro MOTOKI +.\" Modified 2005-02-24, Akihiro MOTOKI +.\" +.\"WORD: identity ID +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶ID +.\"WORD: real user ID ¼Â¥æ¡¼¥¶ID +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: security hole ¥»¥­¥å¥ê¥Æ¥£¡¦¥Û¡¼¥ë +.\"WORD: saved set-user-ID Êݸ¥»¥Ã¥È¥æ¡¼¥¶ID +.\" +.TH SETFSUID 2 2008-12-05 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O setfsuid \- set user identity used for file system checks +.SH ̾Á° +setfsuid \- ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¥Á¥§¥Ã¥¯¤ËÍѤ¤¤é¤ì¤ë¥æ¡¼¥¶ ID ¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +/* glibc ¤Ç¤Ï */ +.sp +.BI "int setfsuid(uid_t " fsuid ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The system call +.\"O .BR setfsuid () +.\"O sets the user ID that the Linux kernel uses to check for all accesses +.\"O to the file system. +.\"O Normally, the value of +.\"O .I fsuid +.\"O will shadow the value of the effective user ID. +.\"O In fact, whenever the +.\"O effective user ID is changed, +.\"O .I fsuid +.\"O will also be changed to the new value of the effective user ID. +.BR setfsuid () +¤Ï Linux ¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ËÂФ¹¤ë +Á´¤Æ¤Î¥¢¥¯¥»¥¹¤Î¥Á¥§¥Ã¥¯¤Ë»ÈÍѤ¹¤ë¥æ¡¼¥¶ID ¤òÀßÄꤹ¤ë¡£Ä̾ï¤Ï +.I fsuid +¤ÎÃͤϼ¸ú (effective) ¥æ¡¼¥¶ID ¤ÈƱ¤¸¤Ë¤Ê¤ë¡£¼ÂºÝ¡¢ +¼Â¸ú¥æ¡¼¥¶ID ¤¬Êѹ¹¤µ¤ì¤ëÅÙ¤Ë +.I fsuid +¤â¤Þ¤¿¿·¤·¤¤¼Â¸ú¥æ¡¼¥¶ID ¤ÎÃͤËÊѹ¹¤µ¤ì¤ë¡£ + +.\"O Explicit calls to +.\"O .BR setfsuid () +.\"O and +.\"O .BR setfsgid (2) +.\"O are usually only used by programs such as the Linux NFS server that +.\"O need to change what user and group ID is used for file access without a +.\"O corresponding change in the real and effective user and group IDs. +.\"O A change in the normal user IDs for a program such as the NFS server +.\"O is a security hole that can expose it to unwanted signals. +.\"O (But see below.) +Ä̾ +.BR setfsuid () +¤ä +.BR setfsgid () +¤¬ÌÀ¼¨Åª¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¤Î¤Ï¡¢Linux NFS ¥µ¡¼¥Ð¡¼ ¤Î¤è¤¦¤Ë¡¢ +¥Õ¥¡¥¤¥ë¡¦¥¢¥¯¥»¥¹¤ËÍѤ¤¤ë¥æ¡¼¥¶ID / ¥°¥ë¡¼¥×ID ¤òÊѹ¹¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤¬¡¢ +Âбþ¤¹¤ë¼Â(real)/¼Â¸ú(effective) ¥æ¡¼¥¶ID / ¥°¥ë¡¼¥×ID ¤ÏÊѹ¹¤·¤¿¤¯¤Ê¤¤¤è¤¦¤Ê +¥×¥í¥°¥é¥à¤Ë¸Â¤é¤ì¤ë¡£ +NFS ¥µ¡¼¥Ð¡¼¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¡¢Ä̾ï¤Î¥æ¡¼¥¶ID ¤òÊѹ¹¤¹¤ë¤È¡¢ +¥×¥í¥»¥¹¤ò˾¤Þ¤Ê¤¤¥·¥°¥Ê¥ë¤Ë¤µ¤é¤¹²ÄǽÀ­¤¬¤¢¤ê¡¢ +¥»¥­¥å¥ê¥Æ¥£¡¦¥Û¡¼¥ë¤Ë¤Ê¤ë¡£(²¼µ­»²¾È) + +.\"O .BR setfsuid () +.\"O will only succeed if the caller is the superuser or if +.\"O .I fsuid +.\"O matches either the real user ID, effective user ID, saved set-user-ID, or +.\"O the current value of +.\"O .IR fsuid . +.BR setfsuid () +¤Ï¡¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤«¡¢ +.I fsuid +¤¬¼Â¥æ¡¼¥¶ID¡¢¼Â¸ú¥æ¡¼¥¶ID¡¢ +Êݸ¥»¥Ã¥È¥æ¡¼¥¶ID (saved set-user-ID)¡¢¸½ºß¤Î +.I fsuid +¤ÎÃͤΤ¤¤º¤ì¤«¤Ë°ìÃפ¹¤ë¾ì¹ç¤Ë¤Î¤ßÀ®¸ù¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, the previous value of +.\"O .I fsuid +.\"O is returned. +.\"O On error, the current value of +.\"O .I fsuid +.\"O is returned. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.I fsuid +¤Î°ÊÁ°¤ÎÃͤòÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï +.I fsuid +¤Î¸½ºß¤ÎÃͤòÊÖ¤¹¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O This system call is present in Linux since version 1.2. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ð¡¼¥¸¥ç¥ó 1.2 °Ê¹ß¤Î Linux ¤Ë¸ºß¤¹¤ë¡£ +.\" This system call is present since Linux 1.1.44 +.\" and in libc since libc 4.7.6. +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR setfsuid () +.\"O is Linux-specific and should not be used in programs intended +.\"O to be portable. +.BR setfsuid () +¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O When glibc determines that the argument is not a valid user ID, +.\"O it will return \-1 and set \fIerrno\fP to +.\"O .B EINVAL +.\"O without attempting +.\"O the system call. +glibc ¤¬°ú¤­¿ô¤¬¥æ¡¼¥¶ID ¤È¤·¤ÆÉÔÀµ¤À¤ÈȽÃǤ·¤¿¾ì¹ç¤Ï¡¢ +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤ï¤º \fIerrno\fP ¤Ë +.B EINVAL +¤òÀßÄꤷ¤Æ \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.LP +.\"O Note that at the time this system call was introduced, a process +.\"O could send a signal to a process with the same effective user ID. +.\"O Today signal permission handling is slightly different. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Æ³Æþ¤µ¤ì¤¿Åö»þ¡¢¥×¥í¥»¥¹¤Ï +Ʊ¤¸¼Â¸ú¥æ¡¼¥¶ID¤Î¥×¥í¥»¥¹¤Ø¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤¿¡£ +º£Æü¤Ç¤Ï¡¢¥·¥°¥Ê¥ëÁ÷¿®¸¢¸Â¤Î°·¤¤¤Ï¤«¤Ê¤ê°ã¤¦¤â¤Î¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O No error messages of any kind are returned to the caller. +.\"O At the very +.\"O least, +.\"O .B EPERM +.\"O should be returned when the call fails (because the caller lacks the +.\"O .B CAP_SETUID +.\"O capability). +¤¤¤«¤Ê¤ë¼ïÎà¤Î¥¨¥é¡¼¡¦¥á¥Ã¥»¡¼¥¸¤â¸Æ¤Ó½Ð¤·¸µ¤ËÊÖ¤µ¤Ê¤¤¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï (¸Æ¤Ó½Ð¤·¸µ¤Ë¤Ï +.B CAP_SETUID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤«¤Ã¤¿¤Î¤À¤«¤é) ºÇÄã¤Ç¤â +.B EPERM +¤¯¤é¤¤¤ÏÊÖ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR setfsgid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/draft/man2/setgid.2 b/draft/man2/setgid.2 new file mode 100644 index 00000000..bb56ba96 --- /dev/null +++ b/draft/man2/setgid.2 @@ -0,0 +1,111 @@ +.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.) +.\" +.\" 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. +.\" +.\" Fri Jul 29th 12:56:44 BST 1994 Wilf. +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2002-03-09 by aeb +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Mar 1 16:31:56 JST 1997 +.\" by HANATAKA Shinya +.\" Updated Fri Feb 7 JST 2003 by Kentaro Shirakata +.\" +.\"WORD: identity ¼±ÊÌ +.\"WORD: effective group ID ¼Â¸ú¥°¥ë¡¼¥×ID +.\"WORD: real group ID ¼Â¥°¥ë¡¼¥×ID +.\"WORD: saved set-group-ID Êݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID +.\"WORD: implement ¼ÂÁõ +.\"WORD: superuser ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\" +.TH SETGID 2 2009-10-17 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O setgid \- set group identity +setgid \- ¥°¥ë¡¼¥×¼±ÊÌ(identity)¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int setgid(gid_t " gid ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR setgid () +.\"O sets the effective group ID of the calling process. +.\"O If the caller is the +.\"O superuser, the real GID and saved set-group-ID are also set. +.BR setgid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥°¥ë¡¼¥×ID ¤òÀßÄꤹ¤ë¡£ +¤â¤·¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤Ï¡¢ +¼Â (real) ¥°¥ë¡¼¥×ID ¤ÈÊݸ (saved) set-group-ID ¤âÀßÄꤵ¤ì¤ë¡£ + +.\"O Under Linux, +.\"O .BR setgid () +.\"O is implemented like the POSIX version with the +.\"O .B _POSIX_SAVED_IDS +.\"O feature. +.\"O This allows a set-group-ID program that is not set-user-ID-root +.\"O to drop all of its group +.\"O privileges, do some un-privileged work, and then reengage the original +.\"O effective group ID in a secure manner. +Linux ¤Ë¤ª¤¤¤Æ¡¢ +.BR setgid () +¤Ï +.B _POSIX_SAVED_IDS +¤ò¤â¤Ã¤¿ POSIX ÈǤΤ褦¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï set-user-ID-root ¤Ç¤Ê¤¤ set-group-ID ¥×¥í¥°¥é¥à¤Ë¤½¤Î¥°¥ë¡¼¥×¤Î +Æø¢¤ÎÁ´¤ÆÍî¤È¤·¡¢Æø¢¤ÎɬÍפʤ¤»Å»ö¤ò¤·¡¢ËÜÍè¤Î¼Â¸ú¥°¥ë¡¼¥×ID ¤Ë +°ÂÁ´¤ÊÊýË¡¤ÇºÆ¤ÓÌ᤹¤³¤È¤òµö¤¹¡£ +.\"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 +.SH ¥¨¥é¡¼ +.TP +.B EPERM +.\"O The calling process is not privileged (does not have the +.\"O \fBCAP_SETGID\fP capability), and +.\"O .I gid +.\"O does not match the real group ID or saved set-group-ID of +.\"O the calling process. +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë¸¢¸Â¤¬¤Ê¤¯ (\fBCAP_SETGID\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¯)¡¢¤«¤Ä +.I gid +¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¥°¥ë¡¼¥×ID ¤ÈÊݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID +¤Î¤É¤Á¤é¤È¤â°ìÃפ·¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getgid (2), +.BR setegid (2), +.BR setregid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/draft/man2/setpgid.2 b/draft/man2/setpgid.2 new file mode 100644 index 00000000..5e9eaadc --- /dev/null +++ b/draft/man2/setpgid.2 @@ -0,0 +1,521 @@ +.\" Copyright (c) 1983, 1991 Regents of the University of California. +.\" and Copyright (C) 2007, Michael Kerrisk +.\" 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. +.\" +.\" @(#)getpgrp.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1995-04-15 by Michael Chastain : +.\" Added 'getpgid'. +.\" Modified 1996-07-21 by Andries Brouwer +.\" Modified 1996-11-06 by Eric S. Raymond +.\" Modified 1999-09-02 by Michael Haardt +.\" Modified 2002-01-18 by Michael Kerrisk +.\" Modified 2003-01-20 by Andries Brouwer +.\" 2007-07-25, mtk, fairly substantial rewrites and rearrangements +.\" of text. +.\" +.\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sun Nov 21 18:54:10 JST 1999 +.\" by HANATAKA Shinya +.\" Updated Fri Feb 7 JST 2003 by Kentaro Shirakata +.\" Updated Sun Feb 23 JST 2003 by Kentaro Shirakata +.\" Updated 2007-09-25, Akihiro MOTOKI , LDP v2.64 +.\" Updated 2010-04-23, Akihiro MOTOKI, LDP v3.24 +.\" +.\"WORD: process group ¥×¥í¥»¥¹¥°¥ë¡¼¥× +.\"WORD: process group ID ¥×¥í¥»¥¹¥°¥ë¡¼¥× ID +.\"WORD: terminal üËö +.\"WORD: foreground ¥Õ¥©¥¢¥°¥é¥ó¥É +.\"WORD: block ÃæÃÇ(block) +.\"WORD: job control ¥¸¥ç¥Ö¡¦¥³¥ó¥È¥í¡¼¥ë +.\" +.TH SETPGID 2 2009-09-20 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O setpgid, getpgid, setpgrp, getpgrp \- set/get process group +setpgid, getpgid, setpgrp, getpgrp \- ¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÀßÄê/¼èÆÀ¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int setpgid(pid_t " pid ", pid_t " pgid ); +.br +.BI "pid_t getpgid(pid_t " pid ); +.sp +.BR "pid_t getpgrp(void);" " /* POSIX.1 version */" +.br +.BI "pid_t getpgrp(pid_t " pid ");\ \ \ \ \ \ \ \ \ " +/* BSD version */ +.sp +.BR "int setpgrp(void);" " /* System V version */" +.br +.BI "int setpgrp(pid_t " pid ", pid_t " pgid ); +/* BSD version */ +.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 getpgid (): +_XOPEN_SOURCE\ >=\ 500 +.br +.BR setpgrp () +(POSIX.1): _SVID_SOURCE || _XOPEN_SOURCE >= 500 +.sp +.BR setpgrp "()\ (BSD)," +.BR getpgrp "()\ (BSD):" +_BSD_SOURCE && !\ (_POSIX_SOURCE || _POSIX_C_SOURCE || +_XOPEN_SOURCE || _XOPEN_SOURCE_EXTENDED || _GNU_SOURCE || _SVID_SOURCE) +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O All of these interfaces are available on Linux, +.\"O and are used for getting and setting the +.\"O process group ID (PGID) of a process. +.\"O The preferred, POSIX.1-specified ways of doing this are: +.\"O .BR getpgrp (void), +.\"O for retrieving the calling process's PGID; and +.\"O .BR setpgid (), +.\"O for setting a process's PGID. +¤³¤ì¤é¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¹¤Ù¤Æ¤¬ Linux ¤ÇÍøÍѲÄǽ¤Ç¡¢ +¤³¤ì¤é¤ò»È¤Ã¤Æ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID (PGID) ¤Î +¼èÆÀ¤äÀßÄ꤬¤Ç¤­¤ë¡£ +¿ä¾©¤Î¡¢POSIX.1 ¤Çµ¬Äꤵ¤ì¤¿ÊýË¡¤Ç¤Ï¡¢ +.BR getpgrp (void) +¤Ç¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î PGID ¤ò¼èÆÀ¤·¡¢ +.BR setpgid () +¤ÇÀßÄꤹ¤ë¡£ + +.\"O .BR setpgid () +.\"O sets the PGID of the process specified by +.\"O .I pid +.\"O to +.\"O .IR pgid . +.\"O If +.\"O .I pid +.\"O is zero, then the process ID of the calling process is used. +.\"O If +.\"O .I pgid +.\"O is zero, then the PGID of the process specified by +.\"O .I pid +.\"O is made the same as its process ID. +.BR setpgid () +¤Ï +.I pid +¤Ç»ØÄꤷ¤¿¥×¥í¥»¥¹¤Î PGID ¤Ë +.I pgid +¤òÀßÄꤹ¤ë¡£ +.I pid +¤¬¥¼¥í¤Ê¤é¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤¬ pid ¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +.I pgid +¤¬¥¼¥í¤Ê¤é¤Ð¡¢ +.I pid +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Î PGID ¤¬¤½¤Î¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤È +Ʊ¤¸¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O If +.\"O .BR setpgid () +.\"O is used to move a process from one process +.\"O group to another (as is done by some shells when creating pipelines), +.\"O both process groups must be part of the same session (see +.\"O .BR setsid (2) +.\"O and +.\"O .BR credentials (7)). +.\"O In this case, +.\"O the \fIpgid\fP specifies an existing process group to be joined and the +.\"O session ID of that group must match the session ID of the joining process. +.BR setpgid () +¤ò¥×¥í¥»¥¹¤ò¤¢¤ë¥×¥í¥»¥¹¥°¥ë¡¼¥×¤«¤éÊ̤Υ°¥ë¡¼¥×¤Ø +°ÜÆ°¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¾ì¹ç¤Ï (°ìÉô¤Î¥·¥§¥ë¤Ï¥Ñ¥¤¥×¥é¥¤¥ó¤òÀ¸À® +¤¹¤ë»þ¤Ë¤³¤ì¤ò¹Ô¤¦)¡¢Î¾Êý¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÏƱ¤¸¥»¥Ã¥·¥ç¥ó¤Î +°ìÉô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.RB ( setsid (2) +¤È +.BR credentials (7) +»²¾È)¡£¤³¤Î¾ì¹ç¤Ï \fIpgid\fP ¤Ï»²²Ã¤¹¤Ù¤­´û¸¤Î +¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ò»ØÄꤷ¡¢¤½¤Î¥»¥Ã¥·¥ç¥ó ID ¤Ï»²²Ã¤¹¤ë¥×¥í¥»¥¹¤Î +¥»¥Ã¥·¥ç¥ó ID ¤Ë°ìÃפ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O The POSIX.1 version of +.\"O .BR getpgrp (), +.\"O which takes no arguments, +.\"O returns the PGID of the calling process. +POSIX.1 ¥Ð¡¼¥¸¥ç¥ó¤Î +.BR getpgrp () +¤Ï°ú¤­¿ô¤ò°ì¤Ä¤â¤È¤é¤º¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î PGID ¤òÊÖ¤¹¡£ + +.\"O .BR getpgid () +.\"O returns the PGID of the process specified by +.\"O .IR pid . +.\"O If +.\"O .I pid +.\"O is zero, the process ID of the calling process is used. +.\"O (Retrieving the PGID of a process other than the caller is rarely +.\"O necessary, and the POSIX.1 +.\"O .BR getpgrp () +.\"O is preferred for that task.) +.BR getpgid () +¤Ï +.I pid +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Î PGID ¤òÊÖ¤¹¡£ +.I pid +¤¬¥¼¥í¤Ê¤é¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤¬ pid ¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +(¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹°Ê³°¤Î¥×¥í¥»¥¹¤Î PGID ¤Î¼èÆÀ¤¬É¬Íפˤʤ뤳¤È¤Ï +¤á¤Ã¤¿¤Ë¤Ê¤¯¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î PGID ¤ò¼èÆÀ¤¹¤ë¤Ë¤Ï +POSIX.1 ¥Ð¡¼¥¸¥ç¥ó¤Î +.BR getpgrp () +¤ò»È¤¦¤Î¤¬Ë¾¤Þ¤·¤¤¡£) + +.\"O The System V-style +.\"O .BR setpgrp (), +.\"O which takes no arguments, is equivalent to +.\"O .IR "setpgid(0,\ 0)" . +System V ¥Ð¡¼¥¸¥ç¥ó¤Î +.BR setpgrp () +¤Ï°ú¤­¿ô¤ò°ì¤Ä¤â¤È¤é¤º¡¢ +.I "setpgid(0,\ 0)" +¤ÈÅù²Á¤Ç¤¢¤ë¡£ + +.\"O The BSD-specific +.\"O .BR setpgrp () +.\"O call, which takes arguments +.\"O .I pid +.\"O and +.\"O .IR pgid , +.\"O is equivalent to +.\"O .IR "setpgid(pid, pgid)" . +BSD »ÅÍͤΠ+.BR setpgrp () +¤Ï +.I pid +¤È +.I pgid +¤ò°ú¤­¿ô¤Ë¤È¤ê¡¢ +.I "setpgid(pid, pgid)" +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.\" The true BSD setpgrp() system call differs in allowing the PGID +.\" to be set to arbitrary values, rather than being restricted to +.\" PGIDs in the same session. + +.\"O The BSD-specific +.\"O .BR getpgrp () +.\"O call, which takes a single +.\"O .I pid +.\"O argument, is equivalent to +.\"O .IR "getpgid(pid)" . +BSD »ÅÍͤΠ+.BR getpgrp () +¤Ï +.I pid +¤À¤±¤ò°ú¤­¿ô¤Ë¤È¤ê¡¢ +.I "getpgid(pid)" +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR setpgid () +.\"O and +.\"O .BR setpgrp () +.\"O return zero. +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +.BR setpgid () +¤È +.BR setpgrp () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç¡¢¥¼¥í¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ + +.\"O The POSIX.1 +.\"O .BR getpgrp () +.\"O always returns the PGID of the caller. +POSIX.1 ¥Ð¡¼¥¸¥ç¥ó¤Î +.BR getpgrp () +¤Ï¾ï¤Ë¸Æ¤Ó½Ð¤·¥×¥í¥»¥¹¤Î PGID ¤òÊÖ¤¹¡£ + +.\"O .BR getpgid (), +.\"O and the BSD-specific +.\"O .BR getpgrp () +.\"O return a process group on success. +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +.BR getpgid () +¤È BSD »ÅÍͤΠ+.BR getpgrp () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç¥×¥í¥»¥¹¥°¥ë¡¼¥×¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O An attempt was made to change the process group ID +.\"O of one of the children of the calling process and the child had +.\"O already performed an +.\"O .BR execve (2) +.\"O .RB ( setpgid (), +.\"O .BR setpgrp ()). +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿¤¬¡¢ +¤¹¤Ç¤Ë¤½¤Î»Ò¥×¥í¥»¥¹¤Ï +.BR execve (2) +¤ò¼Â¹Ô¤·¤Æ¤¤¤¿¡£ +.RB ( setpgid (), +.BR setpgrp ()) +.TP +.B EINVAL +.\"O .I pgid +.\"O is less than 0 +.\"O .RB ( setpgid (), +.\"O .BR setpgrp ()). +.I pgid +¤¬ 0 ¤è¤ê¾®¤µ¤¤¡£ +.RB ( setpgid (), +.BR setpgrp ()) +.TP +.B EPERM +.\"O An attempt was made to move a process into a process group in a +.\"O different session, or to change the process +.\"O group ID of one of the children of the calling process and the +.\"O child was in a different session, or to change the process group ID of +.\"O a session leader +.\"O .RB ( setpgid (), +.\"O .BR setpgrp ()). +¥×¥í¥»¥¹¤ò°Û¤Ê¤ë¥»¥Ã¥·¥ç¥ó¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë°ÜÆ°¤µ¤»¤è¤¦¤È¤·¤¿¡£ +¤Þ¤¿¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤òÊѹ¹¤·¤è¤¦¤È +¤·¤¿¤¬¡¢¤½¤Î»Ò¥×¥í¥»¥¹¤ÏÊ̤Υ»¥Ã¥·¥ç¥ó¤À¤Ã¤¿¡£ +¤Þ¤¿¤Ï¥»¥Ã¥·¥ç¥ó¥ê¡¼¥À¡¼¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿¡£ +.RB ( setpgid (), +.BR setpgrp ()) +.TP +.B ESRCH +.\"O For +.\"O .BR getpgid (): +.BR getpgid () +¤Î¾ì¹ç: +.I pid +¤¬¤É¤Î¥×¥í¥»¥¹¤Ë¤â°ìÃפ·¤Ê¤¤¡£ +.\"O For +.\"O .BR setpgid (): +.\"O .I pid +.\"O is not the calling process and not a child of the calling process. +.BR setpgid () +¤Î¾ì¹ç: +.I pid +¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ç¤Ï¤Ê¤¯¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Ç¤â¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR setpgid () +.\"O and the version of +.\"O .BR getpgrp () +.\"O with no arguments +.\"O conform to POSIX.1-2001. +.BR setpgid () +¤È¡¢°ú¤­¿ô¤Ê¤·¥Ð¡¼¥¸¥ç¥ó¤Î +.BR getpgrp () +¤Ï POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ + +.\"O POSIX.1-2001 also specifies +.\"O .BR getpgid () +.\"O and the version of +.\"O .BR setpgrp () +.\"O that takes no arguments. +POSIX.1-2001 ¤Ï¡¢ +.BR getpgid () +¤È¡¢°ú¤­¿ô¤Ê¤·¥Ð¡¼¥¸¥ç¥ó¤Î +.BR setpgrp () +¤âµ¬Äꤷ¤Æ¤¤¤ë¡£ +.\"O (POSIX.1-2008 marks this +.\"O .BR setpgrp () +.\"O specification as obsolete.) +POSIX.1-2008 ¤Ï¡¢¤³¤Î +.BR setpgrp () +¤Î»ÅÍͤòÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ + +.\"O The version of +.\"O .BR getpgrp () +.\"O with one argument and the version of +.\"O .BR setpgrp () +.\"O that takes two arguments derive from 4.2BSD, +.\"O and are not specified by POSIX.1. +°ú¤­¿ô 1 ¸Ä¥Ð¡¼¥¸¥ç¥ó¤Î +.BR getpgrp () +¤È°ú¤­¿ô 2 ¸Ä¥Ð¡¼¥¸¥ç¥ó¤Î +.BR setpgrp () +¤Ï 4.2BSD ¤ËͳÍ褷¡¢ +POSIX.1 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O A child created via +.\"O .BR fork (2) +.\"O inherits its parent's process group ID. +.\"O The PGID is preserved across an +.\"O .BR execve (2). +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Î PGID +¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç PGID ¤ÏÊݸ¤µ¤ì¤ë¡£ + +.\"O Each process group is a member of a session and each process is a +.\"O member of the session of which its process group is a member. +³Æ¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ï¥»¥Ã¥·¥ç¥ó¤Î¥á¥ó¥Ð¡¼¤Ç¤¢¤ê¡¢³Æ¥×¥í¥»¥¹¤Ï +¤½¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤¬½ê°¤·¤Æ¤¤¤ë¥»¥Ã¥·¥ç¥ó¤Î¥á¥ó¥Ð¡¼¤Ç¤¢¤ë¡£ + +.\"O A session can have a controlling terminal. +.\"O At any time, one (and only one) of the process groups +.\"O in the session can be the foreground process group +.\"O for the terminal; +.\"O the remaining process groups are in the background. +.\"O If a signal is generated from the terminal (e.g., typing the +.\"O interrupt key to generate +.\"O .BR SIGINT ), +.\"O that signal is sent to the foreground process group. +.\"O (See +.\"O .BR termios (3) +.\"O for a description of the characters that generate signals.) +¥»¥Ã¥·¥ç¥ó¤ÏÀ©¸æüËö (controlling terminal) ¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +¤¤¤Ä¤Ç¤â¡¢¥»¥Ã¥·¥ç¥ó¤Ë½ê°¤¹¤ë¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î°ì¤Ä (¤À¤±) ¤¬ +üËö¤Î¥Õ¥©¥¢¥°¥é¥ó¥É¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë¤Ê¤ë¤³¤È¤¬¤Ç¤­¡¢ +»Ä¤ê¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ï¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤Ë¤Ê¤ë¡£ +üËö¤«¤é¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤¿¾ì¹ç (Î㤨¤Ð¡¢ÃæÃÇ¥­¡¼¤òᤤ¤Æ +.B SIGINT +¤¬À¸À®¤µ¤ì¤ë¤Ê¤É)¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× +¤ËÁ÷¤é¤ì¤ë +(¥·¥°¥Ê¥ë¤òÀ¸À®¤¹¤ëʸ»ú¤ÎÀâÌÀ¤Ï +.BR termios (3) +¤ò»²¾È)¡£ +.\"O Only the foreground process group may +.\"O .BR read (2) +.\"O from the terminal; +.\"O if a background process group tries to +.\"O .BR read (2) +.\"O from the terminal, then the group is sent a +.\"O .B SIGTSTP +.\"O signal, which suspends it. +.\"O The +.\"O .BR tcgetpgrp (3) +.\"O and +.\"O .BR tcsetpgrp (3) +.\"O functions are used to get/set the foreground +.\"O process group of the controlling terminal. +¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤À¤±¤¬Ã¼Ëö¤«¤é¤Î +.BR read (2) +¤¬¤Ç¤­¤ë¡£ +¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤¬Ã¼Ëö¤«¤é¤Î +.BR read (2) +¤ò¹Ô¤ª¤¦¤È¤·¤¿¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë¤Ï¥·¥°¥Ê¥ë +.B SIGTSTP +¤¬Á÷¤é¤ì¡¢¤½¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ï°ì»þÄä»ß (suspend) ¤¹¤ë¡£ +´Ø¿ô +.BR tcgetpgrp (3) +¤È +.BR tcsetpgrp (3) +¤ò»È¤¦¤È¡¢À©¸æüËö¤Î¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ò +¼èÆÀ/ÀßÄê¤Ç¤­¤ë¡£ + +.\"O The +.\"O .BR setpgid () +.\"O and +.\"O .BR getpgrp () +.\"O calls are used by programs such as +.\"O .BR bash (1) +.\"O to create process groups in order to implement shell job control. +.BR setpgid () +¤È +.BR getpgrp () +¤Ï¡¢ +.BR bash (1) +¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¡¢¥·¥§¥ë¤Î¥¸¥ç¥ÖÀ©¸æ (job control) ¤Î¼ÂÁõ¤Î¤¿¤á¤Î +¥×¥í¥»¥¹¥°¥ë¡¼¥×¤òºîÀ®¤¹¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£ + +.\"O If a session has a controlling terminal, and the +.\"O .B CLOCAL +.\"O flag for that terminal is not set, +.\"O and a terminal hangup occurs, then the session leader is sent a +.\"O .BR SIGHUP . +.\"O If the session leader exits, then a +.\"O .B SIGHUP +.\"O signal will also be sent to each process in the foreground +.\"O process group of the controlling terminal. +¥»¥Ã¥·¥ç¥ó¤¬À©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤Æ¡¢¤½¤ÎüËö¤ËÂФ·¤Æ +.B CLOCAL +¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤ª¤é¤º¡¢Ã¼Ëö¤Î¥Ï¥ó¥°¥¢¥Ã¥×¤¬µ¯¤­¤¿¾ì¹ç¡¢ +¥»¥Ã¥·¥ç¥ó¡¦¥ê¡¼¥À¡¼¤Ë +.B SIGHUP +¤¬Á÷¤é¤ì¤ë¡£ +¥»¥Ã¥·¥ç¥ó¡¦¥ê¡¼¥À¡¼¤¬½ªÎ»¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÀ©¸æüËö¤Î +¥Õ¥©¥¢¥°¥é¥ó¥É¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë½ê°¤¹¤ë³Æ¥×¥í¥»¥¹¤Ë¤â +.B SIGHUP +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ + +.\"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, then a +.\"O .B SIGHUP +.\"O signal followed by a +.\"O .B SIGCONT +.\"O signal will be sent to each process +.\"O in the newly orphaned process group. +¥×¥í¥»¥¹¤Î½ªÎ»¤Ë¤è¤Ã¤Æ¥×¥í¥»¥¹¥°¥ë¡¼¥×¤¬¸É»ù (orphaned) ¤Ë¤Ê¤Ã¤¿ºÝ¤Ë¡¢ +¤½¤Î¿·¤¿¤Ë¸É»ù¤Ë¤Ê¤Ã¤¿¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ËÄä»ß¤·¤Æ¤¤¤ë¥á¥ó¥Ð¡¼¤¬¤¤¤ì¤Ð¡¢ +¤½¤Î¸É»ù¤Ë¤Ê¤Ã¤¿¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë°¤¹Á´¤Æ¤Î¥×¥í¥»¥¹¤Ë +.B SIGHUP +¥·¥°¥Ê¥ë¤Ë³¤±¤Æ +.B SIGCONT +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +.\" exit.3 refers to the following text: +.\"O An orphaned process group is one in which the parent of +.\"O every member of process group is either itself also a member +.\"O of the process group or is a member of a process group +.\"O in a different session (see also +.\"O .BR credentials (7)). +¸É»ù¤Ë¤Ê¤Ã¤¿ (orphaned) ¥×¥í¥»¥¹¥°¥ë¡¼¥×¤È¤Ï¡¢ +¤½¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¤Æ¤Î¥á¥ó¥Ð¡¼¤Ë¤Ä¤¤¤Æ¡¢¥á¥ó¥Ð¡¼¤Î¿Æ¥×¥í¥»¥¹¤¬¡¢ +¿Æ¥×¥í¥»¥¹¼«¿È¤â¤½¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤«¡¢ +Ê̤Υ»¥Ã¥·¥ç¥ó¤Ë°¤¹¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¤è¤¦¤Ê¡¢ +¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î¤³¤È¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getuid (2), +.BR setsid (2), +.BR tcgetpgrp (3), +.BR tcsetpgrp (3), +.BR termios (3), +.BR credentials (7) diff --git a/draft/man2/setresuid.2 b/draft/man2/setresuid.2 new file mode 100644 index 00000000..27d22a28 --- /dev/null +++ b/draft/man2/setresuid.2 @@ -0,0 +1,162 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1997 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. +.\" +.\" Modified, 2003-05-26, Michael Kerrisk, +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-08-30, HANATAKA Shinya +.\" Updated & Modified 2004-05-22, Yuichi SATO +.\" Updated & Modified 2005-01-04, Yuichi SATO +.\" Updated & Modified 2005-09-03, Akihiro MOTOKI +.\" Updated & Modified 2005-11-04, Akihiro MOTOKI +.\" +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: real user ID ¼Â¥æ¡¼¥¶¡¼ID +.\"WORD: saved set-user-ID Êݸ¥»¥Ã¥È¥æ¡¼¥¶¡¼ID +.\"WORD: effective group ID ¼Â¸ú¥°¥ë¡¼¥×ID +.\"WORD: real group ID ¼Â¥°¥ë¡¼¥×ID +.\"WORD: saved group ID Êݸ¥°¥ë¡¼¥×ID +.\" +.TH SETRESUID 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O setresuid, setresgid \- set real, effective and saved user or group ID +setresuid, setresgid \- ¥æ¡¼¥¶¤ä¥°¥ë¡¼¥×¤Î ¼Â¡¢¼Â¸ú¡¢Êݸ ID ¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int setresuid(uid_t " ruid ", uid_t " euid ", uid_t " suid ); +.br +.BI "int setresgid(gid_t " rgid ", gid_t " egid ", gid_t " sgid ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR setresuid () +.\"O sets the real user ID, the effective user ID, and the +.\"O saved set-user-ID of the calling process. +.BR setresuid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â (real) ¥æ¡¼¥¶¡¼ID¡¢¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ID¡¢ +Êݸ set-user-ID ¤òÀßÄꤹ¤ë¡£ + +.\"O Unprivileged user processes +.\"O may change the real UID, +.\"O effective UID and saved set-user-ID, each to one of: +.\"O the current real UID, the current effective UID or the +.\"O current saved set-user-ID. +ÈóÆø¢¥æ¡¼¥¶¡¼¤Î¥×¥í¥»¥¹¤Ï¡¢¤½¤Î¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤ò¡¢ +¸½ºß¤Î¼Â UID¡¢¸½ºß¤Î¼Â¸ú UID¡¢¸½ºß¤ÎÊݸ set-user-ID +¤Î¤É¤ì¤«¤ËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë: + +.\"O Privileged processes (on Linux, those having the \fBCAP_SETUID\fP capability) +.\"O may set the real UID, effective UID, and +.\"O saved set-user-ID to arbitrary values. +Æø¢¥×¥í¥»¥¹ (Linux ¤Ç¤Ï \fBCAP_SETUID\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ä +¥×¥í¥»¥¹) ¤Ï¡¢¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤òǤ°Õ¤ÎÃͤËÀßÄê¤Ç¤­¤ë¡£ + +.\"O If one of the arguments equals \-1, the corresponding value is not changed. +°ú¤­¿ô¤Î¤É¤ì¤«¤¬ \-1 ¤Î¾ì¹ç¤Ï¤½¤ÎÃͤÏÊѹ¹¤µ¤ì¤º¤Ë»Ä¤µ¤ì¤ë¡£ + +.\"O Regardless of what changes are made to the real UID, effective UID, +.\"O and saved set-user-ID, the file system UID is always set to the same +.\"O value as the (possibly new) effective UID. +¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤Ë¤É¤ó¤ÊÊѹ¹¤¬¹Ô¤ï¤ì¤¿¤«¤Ë´Ø¤ï¤é¤º¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤Ï¾ï¤Ë¼Â¸ú UID (²Äǽ¤Ç¤¢¤ì¤ÐÊѹ¹¸å¤Î¿·¤·¤¤¼Â¸ú UID) +¤ÈƱ¤¸ÃͤËÀßÄꤵ¤ì¤ë¡£ + +.\"O Completely analogously, +.\"O .BR setresgid () +.\"O sets the real GID, effective GID, and saved set-group-ID +.\"O of the calling process (and always modifies the file system GID +.\"O to be the same as the effective GID), +.\"O with the same restrictions for unprivileged processes. +Á´¤¯Æ±¤¸¤è¤¦¤Ë¡¢ +.BR setresgid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â GID¡¢¼Â¸ú GID¡¢Êݸ set-group-ID ¤òÀßÄꤹ¤ë +(¤µ¤é¤Ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à GID ¤ò¼Â¸ú GID ¤ÈƱ¤¸Ãͤ˽¤Àµ¤¹¤ë)¡£ +ÈóÆø¢¥×¥í¥»¥¹¤ÏƱÍͤÎÀ©¸Â¤ò¼õ¤±¤ë¡£ +.\"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 EAGAIN +.\"O .I uid +.\"O does not match the current UID and this call would +.\"O bring that user ID over its +.\"O .B RLIMIT_NPROC +.\"O resource limit. +.I uid +¤¬¸½ºß¤Î¥æ¡¼¥¶¡¼ ID ¤È°ã¤¦Ãͤǡ¢ +¤³¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ê ¥æ¡¼¥¶¡¼ ID ¤¬ +¥ê¥½¡¼¥¹¾å¸Â +.B RLIMIT_NPROC +¤òĶ¤¨¤Æ¤·¤Þ¤¦¡£ +.TP +.B EPERM +.\"O The calling process is not privileged (did not have the \fBCAP_SETUID\fP +.\"O capability) and tried to change the IDs to values that are not permitted. +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬Æø¢¤ò»ý¤¿¤Ê¤¤¤Î¤Ë +(\fBCAP_SETUID\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤¤Î¤Ë)¡¢ +ID ¤òµö¤µ¤ì¤Æ¤¤¤Ê¤¤ÃͤËÊѹ¹¤·¤è¤¦¤È¤·¤¿¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O It is available under Linux since Linux 2.1.44. +Linux ¤Ç¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1.44 ¤è¤êÍøÍѲÄǽ¤Ë¤Ê¤Ã¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These calls are nonstandard; +.\"O they also appear on HP-UX and some of the BSDs. +¤³¤ì¤é¤Î¥³¡¼¥ë¤ÏÈóɸ½à¤Ç¤¢¤ë¡£ +HP-UX ¤ä BSD ·Ï¤Î¤¤¤¯¤Ä¤«¤Ë¤â¸ºß¤¹¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Under HP-UX and FreeBSD the prototype is found in +.\"O .IR . +HP-UX ¤ä FreeBSD ¤Ç¤Ï +.I +¤Ë¥×¥í¥È¥¿¥¤¥×¤¬Â¸ºß¤¹¤ë¡£ +.\"O Under Linux the prototype is provided by glibc since version 2.3.2. +Linux ¤Ç¤Ï¡¢glibc 2.3.2 °Ê¹ß¤Ç +¥×¥í¥È¥¿¥¤¥×¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getresuid (2), +.BR getuid (2), +.BR setfsgid (2), +.BR setfsuid (2), +.BR setreuid (2), +.BR setuid (2), +.BR capabilities (7), +.BR credentials (7), +.BR feature_test_macros (7) diff --git a/draft/man2/setreuid.2 b/draft/man2/setreuid.2 new file mode 100644 index 00000000..8587991e --- /dev/null +++ b/draft/man2/setreuid.2 @@ -0,0 +1,225 @@ +.\" 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. +.\" +.\" @(#)setregid.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 09:08:49 1993 by Rik Faith +.\" Portions extracted from linux/kernel/sys.c: +.\" Copyright (C) 1991, 1992 Linus Torvalds +.\" May be distributed under the GNU General Public License +.\" Changes: 1994-07-29 by Wilf +.\" 1994-08-02 by Wilf due to change in kernel. +.\" 2004-07-04 by aeb +.\" 2004-05-27 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Fri Dec 12 00:18:45 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Mon Jun 4 19:11:44 JST 2001 +.\" by Yuichi SATO +.\" Updated & Modified Wed Jan 5 00:37:49 JST 2005 +.\" by Yuichi SATO +.\" Updated 2010-04-23, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: real user ID ¼Â¥æ¡¼¥¶¡¼ID +.\"WORD: saved user ID Êݸ¥æ¡¼¥¶¡¼ID +.\"WORD: super-user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\" +.TH SETREUID 2 2009-10-17 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O setreuid, setregid \- set real and/or effective user or group ID +setreuid, setregid \- ¼Â (real) ¤È¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int setreuid(uid_t " ruid ", uid_t " euid ); +.br +.BI "int setregid(gid_t " rgid ", gid_t " egid ); +.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 setreuid (), +.BR setregid (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR setreuid () +.\"O sets real and effective user IDs of the calling process. +.BR setreuid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â (real) ¥æ¡¼¥¶¡¼ ID ¤È +¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ ID ¤òÀßÄꤹ¤ë¡£ + +.\"O Supplying a value of \-1 for either the real or effective user ID forces +.\"O the system to leave that ID unchanged. +¼Â¥æ¡¼¥¶¡¼ ID ¤ä¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤Ë \-1 ¤òÍ¿¤¨¤¿¾ì¹ç¡¢ +¥·¥¹¥Æ¥à¤Ï¤½¤Î ID ¤òÊѹ¹¤·¤Ê¤¤¡£ + +.\"O Unprivileged processes may only set the effective user ID to the real user ID, +.\"O the effective user ID, or the saved set-user-ID. +ÈóÆø¢¥×¥í¥»¥¹¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ò¼Â¥æ¡¼¥¶¡¼ ID ¤Þ¤¿¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤Þ¤¿¤Ï +Êݸ set-user-ID ¤Ë¤·¤«ÀßÄê¤Ç¤­¤Ê¤¤¡£ + +.\"O Unprivileged users may only set the real user ID to +.\"O the real user ID or the effective user ID. +ÈóÆø¢¥æ¡¼¥¶¡¼¤Ï¡¢¼Â¥æ¡¼¥¶¡¼ ID ¤ò¼Â¥æ¡¼¥¶¡¼ ID ¤Þ¤¿¤Ï +¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤Ë¤·¤«ÀßÄê¤Ç¤­¤Ê¤¤¡£ + +.\"O If the real user ID is set or the effective user ID is set to a value +.\"O not equal to the previous real user ID, +.\"O the saved set-user-ID will be set to the new effective user ID. +¼Â¥æ¡¼¥¶¡¼ID ¤¬ÀßÄꤵ¤ì¤¿¤ê¡¢¼Â¸ú¥æ¡¼¥¶¡¼ID ¤¬Á°¤Î¼Â¥æ¡¼¥¶¡¼ID ¤È +°Û¤Ã¤¿ÃͤËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢Êݸ set-user-ID ¤Ë¤Ï¿·¤·¤¤¼Â¸ú¥æ¡¼¥¶¡¼ID +¤ÎÃͤ¬ÀßÄꤵ¤ì¤ë¡£ + +.\"O Completely analogously, +.\"O .BR setregid () +.\"O sets real and effective group ID's of the calling process, +.\"O and all of the above holds with "group" instead of "user". +¤³¤ì¤ÈÁ´¤¯Æ±Íͤˡ¢ +.BR setregid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¥°¥ë¡¼¥× ID ¤È¼Â¸ú¥°¥ë¡¼¥× ID ¤òÀßÄꤷ¡¢ +¾åµ­¤ÎÀâÌÀ¤Ç¡Ö¥æ¡¼¥¶¡¼¡×¤ò¡Ö¥°¥ë¡¼¥×¡×¤ËÆɤßÂؤ¨¤¿¤³¤È¤¬À®¤êΩ¤Ä¡£ +.\"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 EPERM +.\"O The calling process is not privileged +.\"O (Linux: does not have the +.\"O .B CAP_SETUID +.\"O capability in the case of +.\"O .BR setreuid (), +.\"O or the +.\"O .B CAP_SETGID +.\"O capability in the case of +.\"O .BR setregid ()) +.\"O and a change other than (i) +.\"O swapping the effective user (group) ID with the real user (group) ID, +.\"O or (ii) setting one to the value of the other or (iii) setting the +.\"O effective user (group) ID to the value of the +.\"O saved set-user-ID (saved set-group-ID) was specified. +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¯ +(Linux ¤Ç¤Ï +.BR setreuid () +¤Î¾ì¹ç¤Ë +.B CAP_SETUID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¤Ê¤¯¡¢ +.BR setregid () +¤Î¾ì¹ç¤Ë +.B CAP_SETGID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¤)¡¢ +°Ê²¼¤Î¤¤¤º¤ì¤Ç¤â¤Ê¤¤Êѹ¹¤¬»ØÄꤵ¤ì¤¿: +(i) ¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤È¼Â¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤òÆþ¤ì´¹¤¨¤ë¡£ +(ii) ÊÒÊý¤ÎÃͤò¾Êý¤ËÀßÄꤹ¤ë¡£ +(iii) ¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤ËÊݸ set-user-ID (Êݸ set-group-ID) +¤ÎÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O POSIX.1-2001, 4.3BSD (the +.\"O .BR setreuid () +.\"O and +.\"O .BR setregid () +.\"O function calls first appeared in 4.2BSD). +POSIX.1-2001, 4.3BSD +.RB ( setreuid () +¤È +.BR setregid () +´Ø¿ô¥³¡¼¥ë¤Ï 4.2BSD ¤ÇÅо줷¤¿)¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Setting the effective user (group) ID to the +.\"O saved set-user-ID (saved set-group-ID) is +.\"O possible since Linux 1.1.37 (1.1.38). +¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤òÊݸ¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤Ë +ÀßÄꤹ¤ë¤³¤È¤¬¡¢Linux 1.1.37 (1.1.38) ¤«¤é²Äǽ¤Ë¤Ê¤Ã¤¿¡£ + +.\"O POSIX.1 does not specify all of possible ID changes that are permitted +.\"O on Linux for an unprivileged process. +POSIX.1 ¤Ç¤Ï¡¢ÈóÆø¢¥×¥í¥»¥¹¤ËÂФ·¤Æ Linux ¾å¤Çǧ¤á¤é¤ì¤Æ¤¤¤ë ID ¤ÎÊѹ¹¤Î +Á´¥Ñ¥¿¡¼¥ó¤òµ¬Äꤷ¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.\"O For +.\"O .BR setreuid (), +.\"O the effective user ID can be made the same as the +.\"O real user ID or the save set-user-ID, +.\"O and it is unspecified whether unprivileged processes may set the +.\"O real user ID to the real user ID, the effective user ID, or the +.\"O saved set-user-ID. +.BR setreuid () +¤Ç¤Ï¡¢¼Â¸ú¥æ¡¼¥¶ ID ¤ò¼Â¥æ¡¼¥¶ ID ¤â¤·¤¯¤ÏÊݸ set-user-ID ¤È +Ʊ¤¸Ãͤˤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤¬¡¢ +ÈóÆø¢¥×¥í¥»¥¹¤¬¼Â¥æ¡¼¥¶ ID ¤ò¼Â¥æ¡¼¥¶ ID¡¢¼Â¸ú¥æ¡¼¥¶ ID¡¢ +Êݸ set-user-ID ¤Î¤É¤ÎÃͤˤâÀßÄê¤Ç¤­¤ë¤«¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O For +.\"O .BR setregid (), +.\"O the real group ID can be changed to the value of the saved set-group-ID, +.\"O and the effective group ID can be changed to the value of +.\"O the real group ID or the saved set-group-ID. +.BR setregid () +¤Ç¤Ï¡¢¼Â¥°¥ë¡¼¥× ID ¤òÊݸ set-group-ID ¤ÈƱ¤¸ÃͤËÊѹ¹¤Ç¤­¡¢ +¼Â¸ú¥°¥ë¡¼¥× ID ¤ò¼Â¥°¥ë¡¼¥× ID ¤äÊݸ set-group-ID ¤ÈƱ¤¸ÃͤËÊѹ¹¤Ç¤­¤ë¡£ +.\"O The precise details of what ID changes are permitted vary +.\"O across implementations. +¤É¤Î¤è¤¦¤Ê ID ¤ÎÊѹ¹¤¬Ç§¤á¤é¤ì¤Æ¤¤¤ë¤«¤ÎÀµ³Î¤Ê¾ÜºÙ¤Ï +¼ÂÁõ¤´¤È¤Ë°Û¤Ê¤ë¡£ + +.\"O POSIX.1 makes no specification about the effect of these calls +.\"O on the saved set-user-ID and saved set-group-ID. +POSIX.1 ¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Êݸ set-user-ID ¤ä +Êݸ set-group-ID ¤ËÍ¿¤¨¤ë±Æ¶Á¤Ë¤Ä¤¤¤Æ¤Ïµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getgid (2), +.BR getuid (2), +.BR seteuid (2), +.BR setgid (2), +.BR setresuid (2), +.BR setuid (2), +.BR capabilities (7) diff --git a/draft/man2/setsid.2 b/draft/man2/setsid.2 new file mode 100644 index 00000000..a620f034 --- /dev/null +++ b/draft/man2/setsid.2 @@ -0,0 +1,145 @@ +.\" Copyright Michael Haardt (michael@cantor.informatik.rwth-aachen.de) +.\" Sat Aug 27 20:43:50 MET DST 1994 +.\" +.\" 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 Sun Sep 11 19:19:05 1994 +.\" Modified Mon Mar 25 10:19:00 1996 (merged a few +.\" tiny changes from a man page by Charles Livingston). +.\" Modified Sun Jul 21 14:45:46 1996 +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Mar 1 16:46:43 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Mon May 5 19:43:49 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Thu Feb 10 22:45:24 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: session ¥»¥Ã¥·¥ç¥ó +.\"WORD: process group ID ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×ID +.\"WORD: process group leader ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼ +.\" +.TH SETSID 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O setsid \- creates a session and sets the process group ID +setsid \- ¥»¥Ã¥·¥ç¥ó (session) ¤òºîÀ®¤·¡¢¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.ad l +.B #include +.sp +.B pid_t setsid(void); +.br +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR setsid () +.\"O creates a new session if the calling process is not a +.\"O process group leader. +.\"O The calling process is the leader of the new +.\"O session, the process group leader of the new process group, and has no +.\"O controlling tty. +.\"O The process group ID and session ID of the calling +.\"O process are set to the PID of the calling process. +.\"O The calling process +.\"O will be the only process in this new process group and in this new session. +.BR setsid () +¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼ +(process group leader) ¤Ç¤Ê¤±¤ì¤Ð¡¢¿·¤·¤¤¥»¥Ã¥·¥ç¥ó¤òºîÀ®¤¹¤ë¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¿·¤·¤¤¥»¥Ã¥·¥ç¥ó¤Î¥ê¡¼¥À¡¼¡¢¿·¤·¤¤¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Î +¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼¤È¤Ê¤ê¡¢tty ¤ÎÀ©¸æ¤ò»ý¤¿¤Ê¤¤¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× ID ¤È¥»¥Ã¥·¥ç¥ó ID ¤Ë¤Ï¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î PID ¤¬ÀßÄꤵ¤ì¤ë¡£¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤³¤Î +¿·¤·¤¤¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¢¤³¤Î¿·¤·¤¤¥»¥Ã¥·¥ç¥ó¤ÎÍ£°ì¤Î¥×¥í¥»¥¹¤È¤Ê¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, the (new) session ID of the calling process is returned. +.\"O On error, +.\"O .I "(pid_t)\ \-1" +.\"O is returned, and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î (¿·¤·¤¤) ¥»¥Ã¥·¥ç¥ó ID ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢ +.I "(pid_t)\ \-1" +¤¬ÊÖ¤µ¤ì¡¢ +.I error +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.\"O .BR EPERM . +.B EPERM +.\"O The process group ID of any process +.\"O equals the PID of the calling process. +.\"O Thus, in particular, +.\"O .BR setsid () +.\"O fails if the calling process is already a process group leader. +¤¤¤º¤ì¤«¤Î¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× ID ¤¬¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î PID ¤ÈÅù¤·¤¤¡£ +¤³¤ì¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬´û¤Ë¥×¥í¥»¥¹¡¦¥ê¡¼¥À¡¼¤Î¾ì¹ç¤Ë¤Ï +.BR setsid () +¤Ï¼ºÇÔ¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O A child created via +.\"O .BR fork (2) +.\"O inherits its parent's session ID. +.\"O The session ID is preserved across an +.\"O .BR execve (2). +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¥»¥Ã¥·¥ç¥ó ID ¤ÏÊݸ¤µ¤ì¤ë¡£ + +.\"O A process group leader is a process with process group ID equal +.\"O to its PID. +.\"O In order to be sure that +.\"O .BR setsid () +.\"O will succeed, +.\"O .BR fork (2) +.\"O and +.\"O .BR exit (2), +.\"O and have the child do +.\"O .BR setsid (). +¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼¤È¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× ID ¤¬ +¤½¤Î PID ¤ËÅù¤·¤¤¥×¥í¥»¥¹¤Ç¤¢¤ë¡£ +.BR setsid () +¤ò³Î¼Â¤ËÀ®¸ù¤µ¤»¤ë¤¿¤á¤Ë¤Ï¡¢ +.BR fork (2) +¤·¤Æ +.BR exit (2) +¤·¡¢»Ò¥×¥í¥»¥¹¤Ç +.BR setsid () +¤ò¹Ô¤Ê¤¨¤ÐÎɤ¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getsid (2), +.BR setpgid (2), +.BR setpgrp (2), +.BR tcgetsid (3), +.BR credentials (7) diff --git a/draft/man2/setuid.2 b/draft/man2/setuid.2 new file mode 100644 index 00000000..6d280d4f --- /dev/null +++ b/draft/man2/setuid.2 @@ -0,0 +1,201 @@ +.\" Copyright (C), 1994, Graeme W. Wilford (Wilf). +.\" +.\" 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. +.\" +.\" Fri Jul 29th 12:56:44 BST 1994 Wilf. +.\" Changes inspired by patch from Richard Kettlewell +.\" , aeb 970616. +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Mar 1 16:32:11 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Sun Sep 28 20:26:49 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Sat May 22 18:21:45 JST 2004 +.\" by Yuichi SATO +.\" Updated & Modified Wed Jan 5 00:51:28 JST 2005 by Yuichi SATO +.\" Updated 2010-04-10, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: identity ¼±ÊÌ +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: real user ID ¼Â¥æ¡¼¥¶¡¼ID +.\"WORD: saved user ID Êݸ¥æ¡¼¥¶¡¼ID +.\"WORD: implement ¼ÂÁõ +.\"WORD: root ¥ë¡¼¥È +.\"WORD: super-user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\" +.TH SETUID 2 2010-02-21 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O setuid \- set user identity +setuid \- ¥æ¡¼¥¶¡¼¼±ÊÌ (identity) ¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int setuid(uid_t " uid ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR setuid () +.\"O sets the effective user ID of the calling process. +.\"O If the effective UID of the caller is root, +.\"O the real UID and saved set-user-ID are also set. +.BR setuid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ ID ¤òÀßÄꤹ¤ë¡£ +¤â¤·¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤¬ root ¤Ê¤é¤Ð¡¢ +¼Â (real) UID ¤ÈÊݸ (saved) set-user-ID ¤âÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O Under Linux, +.\"O .BR setuid () +.\"O is implemented like the POSIX version with the +.\"O .B _POSIX_SAVED_IDS +.\"O feature. +.\"O This allows a set-user-ID (other than root) program to drop all of its user +.\"O privileges, do some un-privileged work, and then reengage the original +.\"O effective user ID in a secure manner. +Linux ¤Ç¤Ï¡¢ +.BR setuid () +¤Ï +.B _POSIX_SAVED_IDS +¤ò¤â¤Ã¤¿ POSIX ÈǤΤ褦¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï (¥ë¡¼¥È°Ê³°¤Î) set-user-ID ¥×¥í¥°¥é¥à¤Ë¤½¤Î¥æ¡¼¥¶¡¼¤ÎÆø¢¤ò +Á´¤ÆÍ¿¤¨¡¢Æø¢¤ÎɬÍפʤ¤»Å»ö¤ò¤·¡¢ËÜÍè¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤Ë +°ÂÁ´¤ÊÊýË¡¤ÇºÆ¤ÓÌ᤹¤³¤È¤òµö¤¹¡£ +.PP +.\"O If the user is root or the program is set-user-ID root, special care must be +.\"O taken. +.\"O The +.\"O .BR setuid () +.\"O function checks the effective user ID of the caller and if it is +.\"O the superuser, all process-related user ID's are set to +.\"O .IR uid . +.\"O After this has occurred, it is impossible for the program to regain root +.\"O privileges. +¥æ¡¼¥¶¡¼¤¬ root ¤Þ¤¿¤Ï¥×¥í¥°¥é¥à¤¬ root ¤Ë set-user-ID ¤µ¤ì¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢ +ÆÃÊ̤ÎÃí°Õ¤¬Ê§¤ï¤ì¤ë¡£ +.BR setuid () +´Ø¿ô¤Ï¸Æ¤Ó½Ð¤·¼Ô¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ò¥Á¥§¥Ã¥¯¤·¡¢ +¤½¤ì¤¬¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ê¤é¤Ð¡¢ +¥×¥í¥»¥¹¤Ë´ØÏ¢¤¹¤ëÁ´¤Æ¤Î¥æ¡¼¥¶¡¼ ID ¤Ë +.I uid +¤òÀßÄꤹ¤ë¡£ +¤³¤ì¤¬¹Ô¤Ê¤ï¤ì¤¿¸å¤Ë¤Ï¥×¥í¥°¥é¥à¤¬ºÆ¤Ó¥ë¡¼¥È¤ÎÆø¢¤òÆÀ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.PP +.\"O Thus, a set-user-ID-root program wishing to temporarily drop root +.\"O privileges, assume the identity of an unprivileged user, and then regain +.\"O root privileges afterwards cannot use +.\"O .BR setuid (). +.\"O You can accomplish this with +.\"O .BR seteuid (2). +¤·¤¿¤¬¤Ã¤Æ¡¢set-user-ID-root ¥×¥í¥°¥é¥à¤Ç¡¢°ì»þŪ¤Ë¥ë¡¼¥ÈÆø¢¤ò²ò½ü¤·¡¢ +ÈóÆø¢¥æ¡¼¥¶¤Ç¤¢¤ë¤«¤Î¤è¤¦¤Ë¿¶Éñ¤¤¡¢¸å¤Ç¥ë¡¼¥È¸¢¸Â¤ò¤â¤¦°ìÅÙÆÀ¤è¤¦¤È +¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR setuid () +¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£¤½¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR seteuid (2) +¤ò»È¤¦É¬Íפ¬¤¢¤ë¡£ +.\"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 EAGAIN +.\"O The +.\"O .I uid +.\"O does not match the current uid and +.\"O .I uid +.\"O brings process over its +.\"O .B RLIMIT_NPROC +.\"O resource limit. +.I uid +¤¬¸½ºß¤Î¥æ¡¼¥¶¡¼ ID ¤È¥Þ¥Ã¥Á¤»¤º¡¢¤³¤Î +.I uid +¤Ë¤è¤Ã¤Æ¥×¥í¥»¥¹¤¬¥ê¥½¡¼¥¹¾å¸Â +.B RLIMIT_NPROC +¤òĶ¤¨¤¿¡£ +.TP +.B EPERM +.\"O The user is not privileged (Linux: does not have the +.\"O .B CAP_SETUID +.\"O capability) and +.\"O .I uid +.\"O does not match the real UID or saved set-user-ID of the calling process. +¥æ¡¼¥¶¡¼¤¬Æø¢¤ò»ý¤¿¤º +(Linux ¤Ç¤Ï +.B CAP_SETUID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤¿¤º)¡¢ +.I uid +¤¬¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â UID ¤Þ¤¿¤ÏÊݸ set-user-ID ¤È°ìÃפ·¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O SVr4, POSIX.1-2001. +.\"O Not quite compatible with the 4.4BSD call, which +.\"O sets all of the real, saved, and effective user IDs. +.\"O .\" SVr4 documents an additional EINVAL error condition. +SVr4, POSIX.1-2001. +4.4BSD ¤Î¥³¡¼¥ë¤È¤Ï´°Á´¤Ê¸ß´¹À­¤Ï¤Ê¤¤¡¢ +BSD ¤Î¥³¡¼¥ë¤Ï¼Â (real)¡¢Êݸ (saved)¡¢¼Â¸ú (effective) ID ¤ÎÁ´¤Æ¤òÀßÄꤹ¤ë¡£ +.\" SVr4 ¤Ë¤Ï¾¤Ë EINVAL ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.\"O .SH NOTES +.\"O .SS Linux Notes +.SH Ãí°Õ +.SS Linux ¤Ç¤ÎÃí°Õ +.\"O Linux has the concept of file system user ID, normally equal to the +.\"O effective user ID. +.\"O The +.\"O .BR setuid () +.\"O call also sets the file system user ID of the calling process. +.\"O See +.\"O .BR setfsuid (2). +Linux ¤Ï¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¡¦¥æ¡¼¥¶¡¼ ID ¤Î³µÇ°¤ò»ý¤Ä¡£ +Ä̾¤³¤ì¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ËÅù¤·¤¤¡£ +.BR setuid () +¥³¡¼¥ë¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¡¦¥æ¡¼¥¶¡¼ ID ¤âÀßÄꤹ¤ë¡£ +.BR setfsuid (2) +¤â»²¾È¤¹¤ë¤³¤È¡£ +.PP +.\"O If +.\"O .I uid +.\"O is different from the old effective uid, the process will +.\"O be forbidden from leaving core dumps. +.I uid +¤¬ÀΤμ¸ú uid ¤È°Û¤Ã¤Æ¤¤¤¿¾ì¹ç¡¢¥×¥í¥»¥¹¤Ï¥³¥¢¡¦¥À¥ó¥×¤¹¤ë¤³¤È¤ò +¶Ø»ß¤µ¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getuid (2), +.BR seteuid (2), +.BR setfsuid (2), +.BR setreuid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/draft/man2/setup.2 b/draft/man2/setup.2 new file mode 100644 index 00000000..1acfe342 --- /dev/null +++ b/draft/man2/setup.2 @@ -0,0 +1,122 @@ +.\" 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 Sun Jul 25 10:14:13 1993 by Rik Faith +.\" Modified 15 April 1995 by Michael Chastain +.\" Update calling parameters to Linux 1.2.4 values. +.\" Modified 10 June 1995 by Andries Brouwer +.\" Modified 3 May 1996 by Martin Schulze +.\" 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 ¥æ¡¼¥¶¡¼¥×¥í¥»¥¹ +.\" +.TH SETUP 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O setup \- setup devices and file systems, mount root file system +setup \- ¥Ç¥Ð¥¤¥¹¤È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î½é´ü²½¤ò¹Ô¤¤¡¢ +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B int setup(void); +.\"O .SH DESCRIPTION +.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 +¤ÎÃæ¤Ç°ìÅÙ¤À¤±¸Æ¤Ð¤ì¤ë¡£ +¥«¡¼¥Í¥ëÆâÉô¤Î¥Ç¥Ð¥¤¥¹¤È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î½é´ü²½´Ø¿ô¤ò¸Æ¤Ó¡¢ +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¤ò¹Ô¤¦¡£ +.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" +.SH ÊÖ¤êÃÍ +.\"O .BR setup () +.\"O always returns \-1 for a user process. +.BR setup () +¤Ï¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤ËÂФ·¤Æ¾ï¤Ë \-1 ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EPERM +.\"O Always, for a user process. +¥æ¡¼¥¶¥×¥í¥»¥¹¤ËÂФ·¤Æ¤Ï¡¢¾ï¤Ë¤³¤Î¥¨¥é¡¼¤È¤Ê¤ë¡£ +.\"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 +.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" +¤ò°ì¤Ä¤Î°ú¿ô¤È¤·¤Æ¼è¤Ã¤Æ¤¤¤¿¡£ diff --git a/draft/man2/setxattr.2 b/draft/man2/setxattr.2 new file mode 100644 index 00000000..84a43cef --- /dev/null +++ b/draft/man2/setxattr.2 @@ -0,0 +1,279 @@ +.\" +.\" Extended attributes system calls manual pages +.\" +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" 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) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 04:43:40 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: extended attributes ³Èĥ°À­ +.\"WORD: namespace ̾Á°¶õ´Ö +.\" +.TH SETXATTR 2 2001-12-31 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O setxattr, lsetxattr, fsetxattr \- set an extended attribute value +.SH ̾Á° +setxattr, lsetxattr, fsetxattr \- ³Èĥ°À­¤ÎÃͤòÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.fam C +.nf +.B #include +.B #include +.sp +.BI "int setxattr(const char\ *" path ", const char\ *" name , +.BI " const void\ *" value ", size_t " size ", int " flags ); +.BI "int lsetxattr(const char\ *" path ", const char\ *" name , +.BI " const void\ *" value ", size_t " size ", int " flags ); +.BI "int fsetxattr(int " fd ", const char\ *" name , +.BI " const void\ *" value ", size_t " size ", int " flags ); +.fi +.fam T +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Extended attributes are +.\"O .IR name :\c +.\"O .I value +.\"O pairs associated with inodes (files, directories, symbolic links, etc.). +.\"O They are extensions to the normal attributes which are associated +.\"O with all inodes in the system (i.e., the +.\"O .BR stat (2) +.\"O data). +.\"O A complete overview of extended attributes concepts can be found in +.\"O .BR attr (5). +³Èĥ°À­¤Ï¡¢inode (¥Õ¥¡¥¤¥ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯Åù) ¤Ë +´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +.IR name :\c +.I value +¤ÎÂФǤ¢¤ë¡£ +¤³¤ì¤é¤Ï¡¢¥·¥¹¥Æ¥à¾å¤Î¤¹¤Ù¤Æ¤Î inode ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ä̾ï¤Î°À­ +.RB ( stat (2) +¤¬ÊÖ¤¹¥Ç¡¼¥¿) ¤ò³ÈÄ¥¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +³Èĥ°À­¤Î¥³¥ó¥»¥×¥È¤Ï +.BR attr (5) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O .BR setxattr () +.\"O sets the +.\"O .I value +.\"O of the extended attribute identified by +.\"O .I name +.\"O and associated with the given +.\"O .I path +.\"O in the file system. +.\"O The +.\"O .I size +.\"O of the +.\"O .I value +.\"O must be specified. +.BR setxattr () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î»ØÄꤵ¤ì¤¿ +.I path +¤ËÂбþ¤¹¤ë¡¢Ì¾Á° +.I name +¤Î³Èĥ°À­¤ÎÃÍ +.I value +¤òÀßÄꤹ¤ë¡£ +.I value +¤Î +.I size +¤Ïɬ¤º»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O .BR lsetxattr () +.\"O is identical to +.\"O .BR setxattr (), +.\"O except in the case of a symbolic link, where the extended attribute is +.\"O set on the link itself, not the file that it refers to. +.BR lsetxattr () +¤Ï +.BR setxattr () +¤ÈƱ¤¸¤À¤¬¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¡¢¥ê¥ó¥¯¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë +¤Ç¤Ï¤Ê¤¯¡¢¥ê¥ó¥¯¤½¤Î¤â¤Î¤Î³Èĥ°À­¤òÀßÄꤹ¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +.PP +.\"O .BR fsetxattr () +.\"O is identical to +.\"O .BR setxattr (), +.\"O only the extended attribute is set on the open file referred to by +.\"O .I fd +.\"O (as returned by +.\"O .BR open (2)) +.\"O in place of +.\"O .IR path . +.BR fsetxattr () +¤Ï +.BR setxattr () +¤ÈƱ¤¸¤À¤¬¡¢ +.I path +¤ÎÂå¤ï¤ê¤Ë +.I fd +¤Ç»²¾È¤µ¤ì¤¿¥ª¡¼¥×¥óºÑ¤ß¥Õ¥¡¥¤¥ë¤Î¾ðÊó¤À¤±¤òÀßÄꤹ¤ëÅÀ¤¬°Û¤Ê¤ë +.RI ( filedes +¤Ï +.BR open (2) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë)¡£ +.PP +.\"O An extended attribute name is a simple null-terminated string. +.\"O The +.\"O .I name +.\"O includes a namespace prefix; there may be several, disjoint +.\"O namespaces associated with an individual inode. +.\"O The +.\"O .I value +.\"O of an extended attribute is a chunk of arbitrary textual or +.\"O binary data of specified length. +³Èĥ°À­¤Î̾Á° +¤ÏÉáÄ̤ΠNULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +.I name +¤Ë¤Ï¡¢Ì¾Á°¶õ´Ö¤òɽ¤¹ÀÜƬ¼­ (prefix) ¤¬´Þ¤Þ¤ì¤ë¡£ +¸Ä¡¹¤Î inode ¤ËÂФ·¤Æ¡¢¸ß¤¤¤ËÆÈΩ¤Ê̾Á°¶õ´Ö¤¬Ê£¿ô¤¢¤Ã¤Æ¤â¤è¤¤¡£ +³Èĥ°À­¤ÎÃÍ +.I value +¤Ï¡¢¤¢¤ë°ìÄê¤ÎŤµ¤ÎǤ°Õ¤Î¥Æ¥­¥¹¥È¡¦¥Ç¡¼¥¿¤Þ¤¿¤Ï +¥Ð¥¤¥Ê¥ê¡¦¥Ç¡¼¥¿¤Î½¸¹ç¤Ç¤¢¤ë¡£ +.PP +.\"O The +.\"O .I flags +.\"O argument can be used to refine the semantics of the operation. +Áàºî¤Î°ÕÌ£¤òÌÀ³Î¤Ë¤¹¤ë¤¿¤á¤Ë +.I flags +°ú¤­¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .B XATTR_CREATE +.\"O specifies a pure create, which fails if the named +.\"O attribute exists already. +.B XATTR_CREATE +¤Ï°À­¤ÎºîÀ®¤À¤±¤ò¹Ô¤¦¤³¤È¤ò»ØÄꤹ¤ë¡£ +»ØÄꤵ¤ì¤¿Ì¾Á°¤Î°À­¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ï¼ºÇÔ¤¹¤ë¡£ +.\"O .B XATTR_REPLACE +.\"O specifies a pure replace operation, which fails if the +.\"O named attribute does not already exist. +.B XATTR_REPLACE +¤Ï°À­¤ÎÃÖ´¹¤À¤±¤ò¹Ô¤¦¤³¤È¤ò»ØÄꤹ¤ë¡£ +»ØÄꤵ¤ì¤¿Ì¾Á°¤Î°À­¤¬¤Þ¤À¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¼ºÇÔ¤¹¤ë¡£ +.\"O By default (no flags), the extended attribute will be created if +.\"O need be, or will simply replace the value if the attribute exists. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï (¥Õ¥é¥°¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç)¡¢³Èĥ°À­¤ÏɬÍפʾì¹ç¤ÏºîÀ®¤µ¤ì¡¢ +°À­¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ï°À­ÃͤÎÃÖ´¹¤ò¹Ô¤¦¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, zero is returned. +.\"O On failure, \-1 is returned and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤·¤¿¾ì¹ç¡¢ 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O If +.\"O .B XATTR_CREATE +.\"O is specified, and the attribute exists already, +.\"O .I errno +.\"O is set to +.\"O .BR EEXIST . +.B XATTR_CREATE +¤¬»ØÄꤵ¤ì¡¢¤«¤Ä°À­¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢ +.I errno +¤Ë +.B EEXIST +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O If +.\"O .B XATTR_REPLACE +.\"O is specified, and the attribute does not exist, +.\"O .I errno +.\"O is set to +.\"O .BR ENOATTR . +.B XATTR_REPLACE +¤¬»ØÄꤵ¤ì¡¢Â°À­¤¬¤Þ¤À¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOATTR +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O If there is insufficient space remaining to store the extended attribute, +.\"O .I errno +.\"O is set to either +.\"O .BR ENOSPC , +.\"O or +.\"O .B EDQUOT +.\"O if quota enforcement was the cause. +³Èĥ°À­¤òµ­²±¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥¹¥Ú¡¼¥¹¤¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOSPC +¤Þ¤¿¤Ï +.B EDQUOT +(quota ¤Ë¤è¤ëÀ©¸Â¤¬¸¶°ø¤Î¾ì¹ç) ¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O If extended attributes are not supported by the file system, or are disabled, +.\"O .I errno +.\"O is set to +.\"O .BR ENOTSUP . +³Èĥ°À­¤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¤â¤·¤¯¤Ï̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOTSUP +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O The errors documented for the +.\"O .BR stat (2) +.\"O system call are also applicable here. +.BR stat (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀâÌÀ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ï +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤âŬÍѤµ¤ì¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These system calls have been available on Linux since kernel 2.4; +.\"O glibc support is provided since version 2.3. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.4 °Ê¹ß¤Î Linux ¤ÇÍøÍѤǤ­¤ë¡£ +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3 °Ê¹ß¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These system calls are Linux-specific. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\"O .\" .SH AUTHORS +.\" .SH Ãø¼Ô +.\"O .\" Andreas Gruenbacher, +.\"O .\" .RI < a.gruenbacher@computer.org > +.\"O .\" and the SGI XFS development team, +.\"O .\" .RI < linux-xfs@oss.sgi.com >. +.\"O .\" Please send any bug reports or comments to these addresses. +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" ¤È SGI XFS ³«È¯¥Á¡¼¥à, +.\" .RI < linux-xfs@oss.sgi.com >¡£ +.\" ¥Ð¥°¥ì¥Ý¡¼¥È¤ä¥³¥á¥ó¥È¤Ï¾åµ­¤Î¥¢¥É¥ì¥¹¤Þ¤ÇÁ÷¤Ã¤Æ²¼¤µ¤¤¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR getfattr (1), +.BR setfattr (1), +.BR getxattr (2), +.BR listxattr (2), +.BR open (2), +.BR removexattr (2), +.BR stat (2), +.BR attr (5), +.BR symlink (7) diff --git a/draft/man2/sgetmask.2 b/draft/man2/sgetmask.2 new file mode 100644 index 00000000..f87e21c6 --- /dev/null +++ b/draft/man2/sgetmask.2 @@ -0,0 +1,124 @@ +'\" t +.\" Copyright (c) 2007 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. +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-10-16, Akihiro MOTOKI , LDP v2.66 +.\" +.TH SGETMASK 2 2007-07-05 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sgetmask, ssetmask \- manipulation of signal mask (obsolete) +sgetmask, ssetmask \- ¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÎÁàºî (ÇÑ»ßͽÄê) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B "long sgetmask(void);" +.sp +.BI "long ssetmask(long " newmask ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These system calls are obsolete. +.\"O .IR "Do not use them" ; +.\"O use +.\"O .BR sigprocmask (2) +.\"O instead. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ê¡¢ +¡Ö»ÈÍѤ·¤Ê¤¤¤³¤È¡×¡£ +Âå¤ï¤ê¤Ë +.BR sigprocmask (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ + +.\"O .BR sgetmask () +.\"O returns the signal mask of the calling process. +.BR sgetmask () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ + +.\"O .BR ssetmask () +.\"O sets the signal mask of the calling process to the value given in +.\"O .IR newmask . +.\"O The previous signal mask is returned. +.BR ssetmask () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò +.I newmask +¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤷ¡¢Êѹ¹Á°¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ + +.\"O The signal masks dealt with by these two system calls +.\"O are plain bit masks (unlike the +.\"O .I sigset_t +.\"O used by +.\"O .BR sigprocmask (2)); +.\"O use +.\"O .BR sigmask (3) +.\"O to create and inspect these masks. +¤³¤ì¤éÆó¤Ä¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬°·¤¦¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï¡¢ +ñ½ã¤Ê¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë (¤³¤ÎÅÀ¤¬ +.BR sigprocmask (2) +¤Ç»ÈÍѤµ¤ì¤ë +.I sigset_t +¤È°Û¤Ê¤ë)¡£ +¤³¤ì¤é¤Î¥Þ¥¹¥¯¤òºîÀ®¤·¤¿¤ê¸¡ºº¤¹¤ë¤Ë¤Ï +.BR sigmask (3) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O .BR sgetmask () +.\"O always successfully returns the signal mask. +.\"O .BR ssetmask () +.\"O always succeeds, and returns the previous signal mask. +.BR sgetmask () +¤Ï¾ï¤ËÀ®¸ù¤·¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +.BR ssetmask () +¤Ï¾ï¤ËÀ®¸ù¤·¡¢Ä¾Á°¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O These system calls always succeed. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O These system calls are Linux-specific. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Glibc does not provide wrappers for these system calls; use +.\"O .BR syscall (2). +glibc ¤Ï¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ + +.\"O These system calls are unaware of signal numbers greater than 31 +.\"O (i.e., real-time signals). +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +31 ¤è¤êÂ礭¤¤¥·¥°¥Ê¥ëÈÖ¹æ (¤Ä¤Þ¤ê¡¢¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë) ¤ò°·¤¨¤Ê¤¤¡£ + +.\"O It is not possible to block +.\"O .B SIGSTOP +.\"O or +.\"O .BR SIGKILL . +.B SIGSTOP +¤ä +.B SIGKILL +¤ò¥Ö¥í¥Ã¥¯¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR sigprocmask (2), +.BR signal (7) diff --git a/draft/man2/shmctl.2 b/draft/man2/shmctl.2 new file mode 100644 index 00000000..8a65f94a --- /dev/null +++ b/draft/man2/shmctl.2 @@ -0,0 +1,714 @@ +.\" Copyright (c) 1993 Luigi P. Bai (lpb@softint.com) July 28, 1993 +.\" and Copyright 1993 Giorgio Ciucci +.\" and Copyright 2004, 2005 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-28, Rik Faith +.\" Modified 1993-11-28, Giorgio Ciucci +.\" Modified 1997-01-31, Eric S. Raymond +.\" Modified 2001-02-18, Andries Brouwer +.\" Modified 2002-01-05, 2004-05-27, 2004-06-17, +.\" Michael Kerrisk +.\" Modified 2004-10-11, aeb +.\" Modified, Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Updated shmid_ds structure definitions +.\" Added information on SHM_DEST and SHM_LOCKED flags +.\" Noted that CAP_IPC_LOCK is not required for SHM_UNLOCK +.\" since kernel 2.6.9 +.\" Modified, 2004-11-25, mtk, notes on 2.6.9 RLIMIT_MEMLOCK changes +.\" 2005-04-25, mtk -- noted aberrant Linux behavior w.r.t. new +.\" 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 µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\" +.TH SHMCTL 2 2008-08-07 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O shmctl \- shared memory control +shmctl \- ¶¦Í­¥á¥â¥ê (shared memory) ¤òÀ©¸æ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.ad l +.B #include +.br +.B #include +.sp +.BI "int shmctl(int " shmid ", int " cmd ", struct shmid_ds *" buf ); +.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 +¤Ç»Ø¼¨¤·¤¿À©¸æÌ¿Îá¤ò¼Â¹Ô¤¹¤ë¡£ +.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 ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +.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 +¤ò»È¤Ã¤ÆÀßÄê²Äǽ¤Ç¤¢¤ë): +.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 */ + uid_t cuid; /* ºîÀ®¼Ô¤Î¼Â¸ú UID */ + gid_t cgid; /* ºîÀ®¼Ô¤Î¼Â¸ú GID */ + unsigned short \fBmode\fP; /* \fBµö²Ä\fP + SHM_DEST ¤È + SHM_LOCKED ¥Õ¥é¥° */ + unsigned short __seq; /* ¥·¡¼¥±¥ó¥¹ÈÖ¹æ */ +}; +.fi +.in +.PP +.\"O Valid values for +.\"O .I cmd +.\"O are: +.I cmd +¤È¤·¤ÆÍ­¸ú¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.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 +.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 +¤Ç¼èÆÀ¤µ¤ì¤ë¡£ +.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 +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.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 +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.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; + /* Linux 2.4 °Ê¹ß¤Ç¤Ï̤»ÈÍÑ */ +}; +.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 +°ú¤­¿ô¤Ï¡¢¥»¥°¥á¥ó¥È¼±Ê̻ҤǤϤʤ¯¡¢¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¶¦Í­¥á¥â¥ê +¥»¥°¥á¥ó¥È¤Ë´Ø¤¹¤ë¾ðÊó¤ò´ÉÍý¤¹¤ë¥«¡¼¥Í¥ë¤ÎÆâÉôÇÛÎó¤Ø¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹ +¤Ç¤¢¤ë¡£ +.PP +.\"O The caller can prevent or allow swapping of a shared +.\"O memory segment with the following \fIcmd\fP values: +¸Æ¤Ó½Ð¤·¸µ¤Ï¡¢\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. +¥»¥°¥á¥ó¥È¤Î¥í¥Ã¥¯¤ò²ò½ü¤·¡¢¥¹¥ï¥Ã¥×¡¦¥¢¥¦¥È¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£ +.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" +.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 ¤òÊÖ¤¹¡£ + +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.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. +\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 +.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 +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤)¡£ + +.\"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" +.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 +.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 (8) +.\"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 (8) +¥×¥í¥°¥é¥à¤Ç³ä¤êÅö¤ÆºÑ¤Î»ñ¸»¤Ë´Ø¤¹¤ë¾ðÊó¤òÄ󶡤¹¤ë¤¿¤á¤Ë +»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£¾­Íè¡¢¤³¤ì¤é¤ÎÁàºî¤ÏÊѹ¹¤µ¤ì¤¿¤ê¡¢ +/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 ¤Î¼ÂÁõ¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +°Ü¿¢À­¤ò¹Íθ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤ì¤Ë°Í¸¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR mlock (2), +.BR setrlimit (2), +.BR shmget (2), +.BR shmop (2), +.BR capabilities (7), +.BR shm_overview (7), +.BR svipc (7) diff --git a/draft/man2/shmget.2 b/draft/man2/shmget.2 new file mode 100644 index 00000000..23272850 --- /dev/null +++ b/draft/man2/shmget.2 @@ -0,0 +1,525 @@ +.\" Copyright (c) 1993 Luigi P. Bai (lpb@softint.com) July 28, 1993 +.\" +.\" 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 Wed Jul 28 10:57:35 1993, Rik Faith +.\" Modified Sun Nov 28 16:43:30 1993, Rik Faith +.\" with material from Giorgio Ciucci +.\" Portions Copyright 1993 Giorgio Ciucci +.\" Modified Tue Oct 22 22:03:17 1996 by Eric S. Raymond +.\" Modified, 8 Jan 2003, Michael Kerrisk, +.\" Removed EIDRM from errors - that can't happen... +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" 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 ¼ÂÁõ +.\" +.TH SHMGET 2 2006-05-02 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O shmget \- allocates a shared memory segment +shmget \- ¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ò³ä¤êÅö¤Æ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.ad l +.B #include +.br +.B #include +.sp +.BI "int shmget(key_t " key ", size_t " size ", int " shmflg ); +.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 +¤ÎÇÜ¿ô¤Ø¤ÈÀÚ¤ê¾å¤²¤¿ (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 +¤ò»ØÄꤷ¤¿¾ì¹ç¤ÎÆ°ºî¤ÈƱ¤¸¤Ç¤¢¤ë)¡£ +.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 ¤ËÂбþ¤¹¤ë¥»¥°¥á¥ó¥È¤òõ¤·¡¢ +¥æ¡¼¥¶¤¬¤½¤Î¥»¥°¥á¥ó¥È¤Ë¥¢¥¯¥»¥¹¤¹¤ëµö²Ä¤¬¤¢¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +.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 +¥Õ¥¡¥¤¥ë¤Ë´Ø¤¹¤ëµÄÏÀ¤â»²¾È¤Î¤³¤È¡£ +.\" As at 2.6.17-rc2, this flag has no effect if SHM_HUGETLB was also +.\" specified. +.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 +¤Ï°Ê²¼¤Î¤è¤¦¤Ë½é´ü²½¤µ¤ì¤ë¡£ +.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 ¤òÀßÄꤹ¤ë¡£ +.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 ¤òÀßÄꤹ¤ë¡£ +.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 ¥Ó¥Ã¥È¤òÀßÄꤹ¤ë¡£ +.IP +.\"O .I shm_segsz +.\"O is set to the value of +.\"O .IR size . +.I shm_segsz +¤Ë +.I size +¤ÎÃͤòÀßÄꤹ¤ë¡£ +.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 ¤òÀßÄꤹ¤ë¡£ +.IP +.\"O .I shm_ctime +.\"O is set to the current time. +.I shm_ctime +¤Ë¸½ºß¤Î»þ¹ï¤òÀßÄꤹ¤ë¡£ +.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" +.SH ÊÖ¤êÃÍ +.\"O A valid segment identifier, +.\"O .IR shmid , +.\"O is returned on success, \-1 on error. +À®¸ù¤·¤¿¾ì¹ç¡¢Í­¸ú¤Ê¥»¥°¥á¥ó¥È¼±ÊÌ»Ò +.I shmid +¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢ \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.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. +.\" [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. +¥»¥°¥á¥ó¥È¤Î´ÉÍý¾ðÊó (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" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O .\" SVr4 documents an additional error condition EEXIST. +.\" SVr4 ¤Ë¤ÏÄÉ²Ã¤Ç EEXIST ¥¨¥é¡¼¾õÂ֤ε­½Ò¤¬¤¢¤ë¡£ + +.\"O .B SHM_HUGETLB +.\"O is a nonportable Linux extension. +.B SHM_HUGETLB +¤Ï Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢°Ü¿¢À­¤Ï¤Ê¤¤¡£ +.\"O .SH NOTES +.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 ¥Ó¥Ã¥È¤ò½ü¤¤¤¿Á´¤Æ¤ò̵»ë¤·¡¢ +(À®¸ù¤¹¤ì¤Ð) ¿·¤·¤¤¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤òºîÀ®¤¹¤ë¡£ +.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 +·Ðͳ¤Ç»²¾È¤·¤¿¤ê¡¢Êѹ¹¤·¤¿¤ê¤Ç¤­¤ë)¡£ +.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 +.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 +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR shmat (2), +.BR shmctl (2), +.BR shmdt (2), +.BR ftok (3), +.BR capabilities (7), +.BR shm_overview (7), +.BR svipc (7) diff --git a/draft/man2/shmop.2 b/draft/man2/shmop.2 new file mode 100644 index 00000000..3bf7171a --- /dev/null +++ b/draft/man2/shmop.2 @@ -0,0 +1,507 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 Nov 28 17:06:19 1993, Rik Faith +.\" with material from Luigi P. Bai +.\" Portions Copyright 1993 Luigi P. Bai +.\" Modified Tue Oct 22 22:04:23 1996 by Eric S. Raymond +.\" Modified, 5 Jan 2002, Michael Kerrisk +.\" Modified, 19 Sep 2002, Michael Kerrisk +.\" Added SHM_REMAP flag description +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Changed wording and placement of sentence regarding attachment +.\" of segments marked for destruction +.\" +.\" 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 +.\" +.\"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 +.SH ̾Á° +.\"O shmop, shmat, shmdt \- shared memory operations +shmat, shmdt \- ¶¦Í­¥á¥â¥ê (shared memory) ¤ÎÁàºî +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include + +.BI "void *shmat(int " shmid ", const void *" shmaddr ", int " shmflg ); + +.BI "int shmdt(const void *" shmaddr ); +.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 +¤Ë°Ê²¼¤Î¤É¤ì¤«¤Î·Á¼°¤Ç»ØÄꤹ¤ë: +.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 ¤Ê¤é¤Ð¡¢¥·¥¹¥Æ¥à¤Ï¥»¥°¥á¥ó¥È¤òÉղ乤뤿¤á¤Î +ŬÀÚ¤Ê (»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤) ¥¢¥É¥ì¥¹¤òÁªÂò¤¹¤ë¡£ +.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 +¤ÏÉղäò¹Ô¤Ê¤¦¥¢¥É¥ì¥¹¤Ç¡¢¥Ú¡¼¥¸¶­³¦¤ò»Ø¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +.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. +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¤½¤Î¥»¥°¥á¥ó¥È¤ÏÆɤ߹þ¤ß¤È½ñ¤­¹þ¤ß¤Î¤¿¤á¤ËÉղ䵤졢 +¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥°¥á¥ó¥È¤ËÆɤ߹þ¤ß¤È½ñ¤­¹þ¤ß¤Îµö²Ä¤ò»ý¤ÄɬÍפ¬¤¢¤ë¡£ +½ñ¤­¹þ¤ßÀìÍѤζ¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤È¤¤¤¦³µÇ°¤Ï¸ºß¤·¤Ê¤¤¡£ +.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 ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.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. +Ʊ¤¸¥»¥°¥á¥ó¥È¤ò¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¡¢Æɤ߹þ¤ßÀìÍѤª¤è¤ÓÆɤ߽ñ¤­Î¾ÍÑ +¤È¤·¤ÆÉղäǤ­¡¢¤Þ¤¿Ê£¿ô²óÉղ乤뤳¤È¤â¤Ç¤­¤ë¡£ +.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) +¤ò»²¾È) ¤Î¥á¥ó¥Ð¡¼¤ò°Ê²¼¤Î¤è¤¦¤Ë¹¹¿·¤¹¤ë: +.IP +.\"O .I shm_atime +.\"O is set to the current time. +.I shm_atime +¤Ë¤Ï¸½ºß¤Î»þ¹ï¤òÀßÄꤹ¤ë¡£ +.IP +.\"O .I shm_lpid +.\"O is set to the process-ID of the calling process. +.I shm_lpid +¤Ë¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤òÀßÄꤹ¤ë¡£ +.IP +.\"O .I shm_nattch +.\"O is incremented by one. +.I shm_nattch +¤ò 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 () +¤¬ÊÖ¤·¤¿ÃͤËÅù¤·¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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 +¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤ò°Ê²¼¤Î¤è¤¦¤Ë¹¹¿·¤¹¤ë: +.IP +.\"O .I shm_dtime +.\"O is set to the current time. +.I shm_dtime +¤Ë¤Ï¸½ºß¤Î»þ¹ï¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP +.\"O .I shm_lpid +.\"O is set to the process-ID of the calling process. +.I shm_lpid +¤Ë¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ 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 ¤Ë¤Ê¤ê¡¢ºï½ü¥Þ¡¼¥¯¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï +¤½¤Î¥»¥°¥á¥ó¥È¤Ïºï½ü¤µ¤ì¤ë¡£ +.PP +.\"O After a +.\"O .BR fork (2) +.\"O the child inherits the attached shared memory segments. +.BR fork (2) +¤·¤¿¸å¡¢»Ò¥×¥í¥»¥¹¤ÏÉղ䵤줿¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ò·Ñ¾µ¤¹¤ë¡£ + +.\"O After an +.\"O .BR exec (2) +.\"O all attached shared memory segments are detached from the process. +.BR exec (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" +.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 +¤Ë¥¨¥é¡¼¤Î¸¶°ø¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ + +.\"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 +.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) ¤ä¥Ú¡¼¥¸¡¦¥Æ¡¼¥Ö¥ë¤Î¤¿¤á¤Î¥á¥â¥ê¤ò +³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.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" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O .\" SVr4 documents an additional error condition EMFILE. +.\" SVr4 ¤Ë¤Ï¾¤Ë EMFILE ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ + +.\"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 +.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. +¤è¤Ã¤Æ¶¦Í­¥á¥â¥êÆâ¤Ç´ÉÍý¤µ¤ì¤ë¥Ý¥¤¥ó¥¿¤Ï¡¢ +ÀäÂÐ¥¢¥É¥ì¥¹¤Ç¤Ï¤Ê¤¯¡¢ +(°ìÈÌŪ¤Ë¤Ï¥»¥°¥á¥ó¥È¤Î³«»Ï¥¢¥É¥ì¥¹¤«¤é¤Î) +ÁêÂÐ¥¢¥É¥ì¥¹¤ÇºîÀ®¤¹¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.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 ¤Ç¤Ï¤³¤Î¤è¤¦¤ÊÆ°ºî¤ò»ØÄꤷ¤Æ¤ª¤é¤º¡¢ +¾¤Î¿¤¯¤Î¼ÂÁõ¤â¤³¤ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.LP +.\"O The following system parameter affects +.\"O .BR shmat (): +°Ê²¼¤Î¥·¥¹¥Æ¥à¡¦¥Ñ¥é¥á¡¼¥¿¡¼¤Ï¡¢ +.BR shmat () +¤Ë±Æ¶Á¤¹¤ë: +.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 +¤Ç¤¢¤ë¡£ +.\" FIXME That last sentence isn't true for all Linux +.\" architectures (i.e., SHMLBA != PAGE_SIZE for some architectures) +.\" -- MTK, Nov 04 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR brk (2), +.BR mmap (2), +.BR shmctl (2), +.BR shmget (2), +.BR capabilities (7), +.BR shm_overview (7), +.BR svipc (7) diff --git a/draft/man2/shutdown.2 b/draft/man2/shutdown.2 new file mode 100644 index 00000000..4980306b --- /dev/null +++ b/draft/man2/shutdown.2 @@ -0,0 +1,133 @@ +.\" 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. +.\" +.\" $Id: shutdown.2,v 1.2 2000/01/13 20:14:06 argrath Exp $ +.\" +.\" Modified Sat Jul 24 09:57:55 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Tue Oct 22 22:04:51 1996 by Eric S. Raymond +.\" Modified 1998 by Andi Kleen +.\" +.\" Japanese Version Copyright (c) 1996 Takeshi Hakamata +.\" all rights reserved. +.\" Translated into Japanese Fri Jul 5 14:02:15 1996 +.\" by Takeshi Hakamata (a93sj077@j.dendai.ac.jp) +.\" Modified Wed Nov 5 22:16:28 JST 1997 +.\" by HANATAKA Shinya (hanataka@abyss.rim.or.jp) +.\" Updated Mon Jan 13 01:03:18 JST 2000 by Kentaro Shirakata +.\" Updated Mon Oct 15 03:22:24 JST 2001 by Kentaro Shirakata +.\" +.TH SHUTDOWN 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +shutdown \- Á´Æó½ÅÀܳ¤Î°ìÉô¤òÊĤ¸¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int shutdown(int " sockfd ", int " how ); +.SH ÀâÌÀ +.\"O The +.\"O .BR shutdown () +.\"O call causes all or part of a full-duplex connection on the socket +.\"O associated with +.\"O .I sockfd +.\"O to be shut down. +.\"O If +.\"O .I how +.\"O is +.\"O .BR SHUT_RD , +.\"O further receptions will be disallowed. +.\"O If +.\"O .I how +.\"O is +.\"O .BR SHUT_WR , +.\"O further transmissions will be disallowed. +.\"O If +.\"O .I how +.\"O is +.\"O .BR SHUT_RDWR , +.\"O further receptions and transmissions will be disallowed. +.BR shutdown () +¤Ï¡¢ +.I sockfd +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¤Ë¤è¤ëÁ´Æó½ÅÀܳ (full-duplex connection) +¤Î°ìÉô¤Þ¤¿¤ÏÁ´¤Æ¤òÊĤ¸¤ë¡£ +.I how +¤¬ +.B SHUT_RD +¤Ê¤é¤Ð¡¢¤½¤ì°Ê¹ß¤Î¼õ¿®¤ò¶Ø»ß¤¹¤ë¡£ +.I how +¤¬ +.B SHUT_WR +¤Ê¤é¤Ð¡¢¤½¤ì°Ê¹ß¤ÎÁ÷¿®¤ò¶Ø»ß¤¹¤ë¡£ +.I how +¤¬ +.B SHUT_RDWR +¤Ê¤é¤Ð¡¢¤½¤ì°Ê¹ß¤ÎÁ÷¼õ¿®¤ò¶Ø»ß¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I sockfd +¤¬Í­¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ê¤¤¡£ +.TP +.B ENOTCONN +»ØÄꤵ¤ì¤¿¥½¥±¥Ã¥È¤ÏÀܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTSOCK +.I sockfd +¤¬¥½¥±¥Ã¥È¤Ç¤Ê¤¯¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2001, 4.4BSD +.RB ( shutdown () +´Ø¿ô¥³¡¼¥ë¤Ï 4.2BSD ¤Ç½é¤á¤ÆÅо줷¤¿)¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The constants +.\"O .BR SHUT_RD , +.\"O .BR SHUT_WR , +.\"O .B SHUT_RDWR +.\"O have the value 0, 1, 2, +.\"O respectively, and are defined in +.\"O .I +.\"O since glibc-2.1.91. +.BR SHUT_RD , +.BR SHUT_WR , +.B SHUT_RDWR +¤Î³ÆÄê¿ô (¤½¤ì¤¾¤ì 0, 1, 2 ¤ÎÃͤò»ý¤Ä) ¤Ï +glibc-2.1.91 °Ê¹ß¡¢ +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR connect (2), +.BR socket (2), +.BR socket (7) diff --git a/draft/man2/sigaction.2 b/draft/man2/sigaction.2 new file mode 100644 index 00000000..68cd72d6 --- /dev/null +++ b/draft/man2/sigaction.2 @@ -0,0 +1,1138 @@ +'\" t +.\" Copyright (c) 1994,1995 Mike Battersby +.\" and Copyright 2004, 2005 Michael Kerrisk +.\" based on work by faith@cs.unc.edu +.\" +.\" 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, aeb, 960424 +.\" Modified Fri Jan 31 17:31:20 1997 by Eric S. Raymond +.\" Modified Thu Nov 26 02:12:45 1998 by aeb - add SIGCHLD stuff. +.\" Modified Sat May 8 17:40:19 1999 by Matthew Wilcox +.\" add POSIX.1b signals +.\" Modified Sat Dec 29 01:44:52 2001 by Evan Jones +.\" SA_ONSTACK +.\" Modified 2004-11-11 by Michael Kerrisk +.\" Added mention of SIGCONT under SA_NOCLDSTOP +.\" Added SA_NOCLDWAIT +.\" Modified 2004-11-17 by Michael Kerrisk +.\" Updated discussion for POSIX.1-2001 and SIGCHLD and sa_flags. +.\" Formatting fixes +.\" 2004-12-09, mtk, added SI_TKILL + other minor changes +.\" 2005-09-15, mtk, split sigpending(), sigprocmask(), sigsuspend() +.\" out of this page into separate pages. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya all rights reserved. +.\" Translated 1997-03-03, HANATAKA Shinya +.\" Modified 2000-10-02, HANATAKA Shinya +.\" Modified 2001-10-18, Akihiro MOTOKI +.\" Updated 2005-03-15, Akihiro MOTOKI +.\" Updated 2005-10-05, Akihiro MOTOKI +.\" Updated 2007-09-08, Akihiro MOTOKI, LDP v2.64 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24 +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: signal handler ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é +.\"WORD: pointer ¥Ý¥¤¥ó¥¿¡¼ +.\"WORD: mask ¥Þ¥¹¥¯ +.\"WORD: block ¶Ø»ß(block) +.\"WORD: suspend Ää»ß(suspend) +.\"WORD: stop Ää»ß(stop) +.\"WORD: catch Êá³Í(catch) +.\"WORD: architecture ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¡¼ +.\"WORD: compatible ¸ß´¹À­ +.\"WORD: pottable °Ü¿¢À­ +.\" +.TH SIGACTION 2 2009-07-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigaction \- examine and change a signal action +sigaction \- ¥·¥°¥Ê¥ë¤ÎÆ°ºî¤Î³Îǧ¤ÈÊѹ¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sigaction(int " signum ", const struct sigaction *" act , +.BI " struct sigaction *" oldact ); +.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 sigaction (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR sigaction () +.\"O system call is used to change the action taken by a process on +.\"O receipt of a specific signal. +.\"O (See +.\"O .BR signal (7) +.\"O for an overview of signals.) +.BR sigaction () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ÆÃÄê¤Î¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤¿ºÝ¤Î +¥×¥í¥»¥¹¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë +(¥·¥°¥Ê¥ë¤Î³µÍפˤĤ¤¤Æ¤Ï +.BR signal (7) +¤ò»²¾È)¡£ +.PP +.\"O .I signum +.\"O specifies the signal and can be any valid signal except +.\"O .B SIGKILL +.\"O and +.\"O .BR SIGSTOP . +.I signum +¤Ë¤Ï¡¢ +.B SIGKILL +¤È +.B SIGSTOP +°Ê³°¤ÎÍ­¸ú¤Ê¥·¥°¥Ê¥ë¤ò¤É¤ì¤Ç¤â»ØÄê¤Ç¤­¤ë¡£ +.PP +.\"O If +.\"O .I act +.\"O is non-NULL, the new action for signal +.\"O .I signum +.\"O is installed from +.\"O .IR act . +.I act +¤¬ NULL °Ê³°¤Ç¤¢¤ì¤Ð¡¢¥·¥°¥Ê¥ë +.I signum +¤Î¿·¤·¤¤Æ°ºî (action) ¤È¤·¤Æ +.I act +¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O If +.\"O .I oldact +.\"O is non-NULL, the previous action is saved in +.\"O .IR oldact . +.I oldact +¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢º£¤Þ¤Ç¤ÎÆ°ºî¤¬ +.I oldact +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .I sigaction +.\"O structure is defined as something like: +.I sigaction +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤Ê´¶¤¸¤ËÄêµÁ¤µ¤ì¤ë¡£ +.sp +.in +4n +.nf +struct sigaction { + void (*sa_handler)(int); + void (*sa_sigaction)(int, siginfo_t *, void *); + sigset_t sa_mask; + int sa_flags; + void (*sa_restorer)(void); +}; +.fi +.in +.PP +.\"O On some architectures a union is involved: do not assign to both +.\"O .I sa_handler +.\"O and +.\"O .IR sa_sigaction . +¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤è¤Ã¤Æ¤Ï¶¦ÍÑÂÎ (union) ¤¬ÍѤ¤¤é¤ì¤Æ¤ª¤ê¡¢¤½¤Î¾ì¹ç¤Ë¤Ï +.I sa_handler +¤È +.I sa_sigaction +¤ÎξÊý¤òƱ»þ¤Ë³ä¤êÅö¤Æ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.PP +.\"O The +.\"O .I sa_restorer +.\"O element is obsolete and should not be used. +.I sa_restorer +Í×ÁǤÏÇÑ»ßͽÄê¤Ç¤¢¤ê»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\"O POSIX does not specify a +.\"O .I sa_restorer +.\"O element. +POSIX ¤Ë¤Ï +.I sa_restorer +Í×ÁǤ˴ؤ¹¤ëµ¬Äê¤Ï¤Ê¤¤¡£ +.PP +.\"O .I sa_handler +.\"O specifies the action to be associated with +.\"O .I signum +.\"O and may be +.\"O .B SIG_DFL +.\"O for the default action, +.\"O .B SIG_IGN +.\"O to ignore this signal, or a pointer to a signal handling function. +.\"O This function receives the signal number as its only argument. +.I sa_handler +¤Ï +.I signum +¤ËÂбþ¤¹¤ëÆ°ºî¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤ò¹Ô¤¦ +.BR SIG_DFL ¡¢ +¤½¤Î¥·¥°¥Ê¥ë¤ò̵»ë¤¹¤ë +.BR SIG_IGN ¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬ÀßÄê¤Ç¤­¤ë¡£ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Î°ú¤­¿ô¤Ï°ì¤Ä¤Ç¤¢¤ê¡¢¥·¥°¥Ê¥ëÈֹ椬°ú¤­¿ô¤È¤·¤Æ +ÅϤµ¤ì¤ë¡£ +.PP +.\"O If +.\"O .B SA_SIGINFO +.\"O is specified in +.\"O .IR sa_flags , +.\"O then +.\"O .I sa_sigaction +.\"O (instead of +.\"O .IR sa_handler ) +.\"O specifies the signal-handling function for +.\"O .IR signum . +.\"O This function receives the signal number as its first argument, a +.\"O pointer to a +.\"O .I siginfo_t +.\"O as its second argument and a pointer to a +.\"O .I ucontext_t +.\"O (cast to \fIvoid\ *\fP) as its third argument. +.I sa_flags +¤Ë +.B SA_SIGINFO +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.RI ( sa_handler +¤Ç¤Ï¤Ê¤¯) +.I sa_sigaction +¤Ë¤è¤ê +.I signum +¤ËÂбþ¤¹¤ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥ë´Ø¿ô¤¬»ØÄꤵ¤ì¤ë¡£ +»ØÄꤵ¤ì¤ë´Ø¿ô¤Ï¡¢ºÇ½é¤Î°ú¤­¿ô¤È¤·¤Æ¥·¥°¥Ê¥ëÈÖ¹æ¤ò¡¢ +ÆóÈÖÌܤΰú¤­¿ô¤È¤·¤Æ +.I siginfo_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò¡¢»°ÈÖÌܤΰú¤­¿ô¤È¤·¤Æ (\fIvoid\ *\fP ¤Ë¥­¥ã¥¹¥È¤·¤¿) +.I ucontext_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò¼õ¤±¤È¤ë¡£ +.PP +.\"O .I sa_mask +.\"O specifies a mask of signals which should be blocked +.\"O (i.e., added to the signal mask of the thread in which +.\"O the signal handler is invoked) +.\"O during execution of the signal handler. +.\"O In addition, the signal which triggered the handler +.\"O will be blocked, unless the +.\"O .B SA_NODEFER +.\"O flag is used. +.I sa_mask +¤Ï¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¼Â¹ÔÃæ¤Ë¶Ø»ß (block) ¤¹¤Ù¤­¥·¥°¥Ê¥ë¤Î¥Þ¥¹¥¯¤ò»ØÄꤹ¤ë +(¥Ï¥ó¥É¥é¼Â¹ÔÃæ¤Î¥·¥°¥Ê¥ë¤Î¶Ø»ß¤Ï¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤¿¥¹¥ì¥Ã¥É +¤Î¥·¥°¥Ê¥ë¤Î¥Þ¥¹¥¯¤ËÄɲ乤뤳¤È¤Ç¹Ô¤ï¤ì¤ë)¡£ +¤µ¤é¤Ë¡¢ +.B SA_NODEFER +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ï¥ó¥É¥é¤òµ¯Æ°¤¹¤ë¤­¤Ã¤«¤±¤È¤Ê¤ë +¥·¥°¥Ê¥ë¤Ë¤â +.I sa_mask +¤¬Å¬ÍѤµ¤ì¤ë¡£ +.PP +.\"O .I sa_flags +.\"O specifies a set of flags which modify the behavior of the signal. +.\"O It is formed by the bitwise OR of zero or more of the following: +.I sa_flags +¤Ï¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¤¿¤á¤Î¥Õ¥é¥°¤Î½¸¹ç¤ò»ØÄꤹ¤ë¡£ +.I sa_flags +¤Ë¤Ï¡¢°Ê²¼¤Ë¼¨¤¹¥Õ¥é¥°¤Î (0 ¸Ä°Ê¾å¤Î) ÏÀÍýϤò¤È¤Ã¤¿¤â¤Î¤ò»ØÄꤹ¤ë¡£ +.RS 4 +.TP +.B SA_NOCLDSTOP +.\"O If +.\"O .I signum +.\"O is +.\"O .BR SIGCHLD , +.\"O do not receive notification when child processes stop (i.e., when they +.\"O receive one of +.\"O .BR SIGSTOP ", " SIGTSTP ", " SIGTTIN +.\"O or +.\"O .BR SIGTTOU ) +.\"O or resume (i.e., they receive +.\"O .BR SIGCONT ) +.\"O (see +.\"O .BR wait (2)). +.\"O This flag is only meaningful when establishing a handler for +.\"O .BR SIGCHLD . +.I signum +¤¬ +.B SIGCHLD +¤Î¾ì¹ç¡¢ +»Ò¥×¥í¥»¥¹¤¬Ää»ß¤·¤¿¤ê +(»Ò¥×¥í¥»¥¹¤¬ +.BR SIGSTOP ", " SIGTSTP ", " SIGTTIN ", " SIGTTOU +¤ò¼õ¤±¤¿¤È¤­) ºÆ³«¤·¤¿¤ê (»Ò¥×¥í¥»¥¹¤¬ +.B SIGCONT +¤ò¼õ¤±¤¿¤È¤­) ¤·¤¿¤È¤­¤Ë +.B SIGCHLD +¤ÎÄÌÃΤò¼õ¤±¤Ê¤¤¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢ +.B SIGCHLD +¤ËÂФ·¤Æ¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +.TP +.\"O .BR SA_NOCLDWAIT " (Since Linux 2.6)" +.BR SA_NOCLDWAIT " (Linux 2.6 °Ê¹ß)" +.\"O .\" To be precise: Linux 2.5.60 -- MTK +(Linux 2.6 °Ê¹ß) +.\" Àµ³Î¤Ë¤Ï Linux 2.5.60 °Ê¹ß -- MTK +.\"O If +.\"O .I signum +.\"O is +.\"O .BR SIGCHLD , +.\"O do not transform children into zombies when they terminate. +.\"O See also +.\"O .BR waitpid (2). +.I signum +¤¬ +.B SIGCHLD +¤Î¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¤È¤­¤Ë +»Ò¥×¥í¥»¥¹¤ò¥¾¥ó¥Ó¥×¥í¥»¥¹¤ËÊѲ½¤µ¤»¤Ê¤¤ +.RB ( waitpid (2) +¤â»²¾È)¡£ +.\"O This flag is only meaningful when establishing a handler for +.\"O .BR SIGCHLD , +.\"O or when setting that signal's disposition to +.\"O .BR SIG_DFL . +¤³¤Î¥Õ¥é¥°¤Ï¡¢ +.B SIGCHLD +¤ËÂФ·¤Æ¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¡¢¤â¤·¤¯¤Ï¤½¤Î¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤ò +.B SIG_DFL +¤ËÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ + +.\"O If the +.\"O .B SA_NOCLDWAIT +.\"O flag is set when establishing a handler for +.\"O .BR SIGCHLD , +.\"O POSIX.1 leaves it unspecified whether a +.\"O .B SIGCHLD +.\"O signal is generated when a child process terminates. +.\"O On Linux, a +.\"O .B SIGCHLD +.\"O signal is generated in this case; +.\"O on some other implementations, it is not. +.BR SIGCHLD +¤ËÂФ·¤Æ¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë +.B SA_NOCLDWAIT +¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¤¿¾ì¹ç¡¢ +»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿ºÝ¤Ë +.B SIGCHLD +¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤ë¤«¤É¤¦¤«¤Ï¡¢ +POSIX.1 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +Linux ¤Ç¤Ï¡¢¤³¤Î¾õ¶·¤Ç +.B SIGCHLD +¥·¥°¥Ê¥ë¤ÏÀ¸À®¤µ¤ì¤ë¡£ +¤¤¤¯¤Ä¤«¤Î¾¤Î¼ÂÁõ¤Ç¤ÏÀ¸À®¤µ¤ì¤Ê¤¤¡£ +.TP +.B SA_NODEFER +.\"O Do not prevent the signal from being received from within its own signal +.\"O handler. +.\"O This flag is only meaningful when establishing a signal handler. +.\"O .B SA_NOMASK +.\"O is an obsolete, nonstandard synonym for this flag. +¤½¤ì¼«¿È¤Î¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¡¼¤ÎÆâÉô¤Ë¤¤¤ë»þ¤Ç¤â +¤½¤Î¥·¥°¥Ê¥ë¤ò¥Þ¥¹¥¯¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +.B SA_NOMASK +¤Ï¤³¤Î¥Õ¥é¥°¤ÈƱ¤¸°ÕÌ£¤À¤¬¡¢Çѻߤµ¤ì¤Æ¤ª¤ê¡¢Èóɸ½à¤Ç¤¢¤ë¡£ +.TP +.B SA_ONSTACK +.\"O Call the signal handler on an alternate signal stack provided by +.\"O .BR sigaltstack (2). +.\"O If an alternate stack is not available, the default stack will be used. +.\"O This flag is only meaningful when establishing a signal handler. +.BR sigaltstack (2) +¤ÇÄ󶡤µ¤ì¤ëÊ̤Υ·¥°¥Ê¥ë¡¦¥¹¥¿¥Ã¥¯¤Ç¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò¸Æ¤Ó½Ð¤¹¡£ +Ê̤Υ·¥°¥Ê¥ë¡¦¥¹¥¿¥Ã¥¯¤¬ÍøÍѲÄǽ¤Ç¤Ê¤±¤ì¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥¹¥¿¥Ã¥¯¤¬ +»ÈÍѤµ¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +.TP +.BR SA_RESETHAND +.\"O Restore the signal action to the default state once the signal handler +.\"O has been called. +.\"O This flag is only meaningful when establishing a signal handler. +.\"O .B SA_ONESHOT +.\"O is an obsolete, nonstandard synonym for this flag. +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬¸Æ¤Ð¤ì¤ëÅ٤ˡ¢¥·¥°¥Ê¥ë¤ÎÆ°ºî¤ò¥Ç¥Õ¥©¥ë¥È¤ËÌ᤹¡£ +¤³¤Î¥Õ¥é¥°¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +.B SA_ONESHOT +¤Ï¤³¤Î¥Õ¥é¥°¤ÈƱ¤¸°ÕÌ£¤À¤¬¡¢Çѻߤµ¤ì¤Æ¤ª¤ê¡¢Èóɸ½à¤Ç¤¢¤ë¡£ +.TP +.B SA_RESTART +.\"O Provide behavior compatible with BSD signal semantics by making certain +.\"O system calls restartable across signals. +.\"O This flag is only meaningful when establishing a signal handler. +.\"O See +.\"O .BR signal (7) +.\"O for a discussion of system call restarting. +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¥·¥°¥Ê¥ë¤ÎÄÌÃΤÎÁ°¸å¤ÇºÆ³«¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Æ¡¢ +BSD ¥·¥°¥Ê¥ëÊý¼° (semantics) ¤È¸ß´¹À­¤Î¤¢¤ëÆ°ºî¤òÄ󶡤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +.BR signal (7) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎºÆ³«¤Ë´Ø¤¹¤ëµÄÏÀ¤ò»²¾È¤Î¤³¤È¡£ +.TP +.\"O .BR SA_SIGINFO " (since Linux 2.2)" +.BR SA_SIGINFO " (Linux 2.2 °Ê¹ß)" +.\"O The signal handler takes 3 arguments, not one. +.\"O In this case, +.\"O .I sa_sigaction +.\"O should be set instead of +.\"O .IR sa_handler . +.\"O This flag is only meaningful when establishing a signal handler. +.\"O .\" (The +.\"O .\" .I sa_sigaction +.\"O .\" field was added in Linux 2.1.86.) +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ï°ì¤Ä¤Ç¤Ï¤Ê¤¯¡¢»°¤Ä¤Î°ú¤­¿ô¤ò»ý¤Ä¡£¤³¤Î¾ì¹ç¤Ï +.I sa_handler +¤Î¤«¤ï¤ê¤Ë +.I sa_sigaction +¤òÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +¤³¤Î¥Õ¥é¥°¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +.\" .RI ( sa_sigaction +.\" ¥Õ¥£¡¼¥ë¥É¤Ï Linux 2.1.86 ¤ÇÄɲ䵤줿)¡£ +.RE +.PP +.\"O The +.\"O .I siginfo_t +.\"O argument to +.\"O .I sa_sigaction +.\"O is a struct with the following elements: +.I sa_sigaction +¤Î¥Ñ¥é¥á¡¼¥¿ +.I siginfo_t +¤Ï°Ê²¼¤ÎÍ×ÁǤò»ý¤Ä¹½Â¤ÂΤǤ¢¤ë: +.sp +.in +4n +.nf +siginfo_t { + int si_signo; /* Signal number */ + int si_errno; /* An errno value */ + int si_code; /* Signal code */ + int si_trapno; /* Trap number that caused + hardware-generated signal + (unused on most architectures) */ +.\" FIXME +.\" si_trapno seems to be only used on SPARC and Alpha; +.\" this page could use a little more detail on its purpose there. + pid_t si_pid; /* Sending process ID */ + uid_t si_uid; /* Real user ID of sending process */ + int si_status; /* Exit value or signal */ + clock_t si_utime; /* User time consumed */ + clock_t si_stime; /* System time consumed */ + sigval_t si_value; /* Signal value */ + int si_int; /* POSIX.1b signal */ + void *si_ptr; /* POSIX.1b signal */ + int si_overrun; /* Timer overrun count; POSIX.1b timers */ + int si_timerid; /* Timer ID; POSIX.1b timers */ +.\" In the kernel: si_tid + void *si_addr; /* Memory location which caused fault */ + int si_band; /* Band event */ + int si_fd; /* File descriptor */ +} +.fi +.in + +.\"O .IR si_signo ", " si_errno " and " si_code +.\"O are defined for all signals. +.\"O .RI ( si_errno +.\"O is generally unused on Linux.) +.IR si_signo ", " si_errno ", " si_code +¤ÏÁ´¤Æ¤Î¥·¥°¥Ê¥ë¤ËÂФ·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë +.RI ( si_errno +¤Ï Linux ¤Ç¤Ï°ìÈÌŪ¤Ë¤Ï»ÈÍѤµ¤ì¤Ê¤¤)¡£ +.\"O The rest of the struct may be a union, so that one should only +.\"O read the fields that are meaningful for the given signal: +¹½Â¤ÂΤλĤê¤ÎÉôʬ¤Ï¡¢¶¦ÍÑÂÎ (union) ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤½¤Î¾ì¹ç¤Ï³ºÅö¤¹¤ë¥·¥°¥Ê¥ë¤Ë¤ª¤¤¤Æ°ÕÌ£¤Î¤¢¤ë¥Õ¥£¡¼¥ë¥É¤Î¤ß¤òÆɤ߹þ¤à +¤³¤È¤¬¤Ç¤­¤ë¡£ +.IP * 2 +.\"O POSIX.1b signals and +.\"O .B SIGCHLD +.\"O fill in +.\"O .IR si_pid " and " si_uid . +POSIX.1b ¥·¥°¥Ê¥ë¤È +.B SIGCHLD +¤Ï +.IR si_pid " ¤È " si_uid +¤òÀßÄꤹ¤ë¡£ +.IP * +.\"O POSIX.1b timers (since Linux 2.6) fill in +.\"O .I si_overrun +.\"O and +.\"O .IR si_timerid . +.\"O The +.\"O .I si_timerid +.\"O field is an internal ID used by the kernel to identify +.\"O the timer; it is not the same as the timer ID returned by +.\"O .BR timer_create (2). +POSIX.1b ¥¿¥¤¥Þ (Linux 2.6 °Ê¹ß) ¤Ï +.I si_overrun +¤È +.I si_timerid +¤òÀßÄꤹ¤ë¡£ +.I si_timerid +¥Õ¥£¡¼¥ë¥É¤Ï¥«¡¼¥Í¥ë¤¬¥¿¥¤¥Þ¤òÆÃÄꤹ¤ë¤Î¤Ë»ÈÍѤ¹¤ëÆâÉô ID ¤Ç¤¢¤ê¡¢ +.BR timer_create (2) +¤¬ÊÖ¤¹¥¿¥¤¥Þ ID ¤ÈƱ¤¸¤Ç¤Ï¤Ê¤¤¡£ +.IP * +.\"O .B SIGCHLD +.\"O fills in +.\"O .IR si_status ", " si_utime " and " si_stime . +.B SIGCHLD +¤Ï +.IR si_status ", " si_utime ", " si_stime +¤òÀßÄꤹ¤ë¡£ +.\"O The +.\"O .I si_utime +.\"O and +.\"O .I si_stime +.\"O fields do not include the times used by waited-for children (unlike +.\"O .BR getrusage (2) +.\"O and +.\"O .BR time (2)). +.\"O In kernels up to 2.6, and since 2.6.27, these fields report +.\"O CPU time in units of +.\"O .IR sysconf(_SC_CLK_TCK) . +.\"O In 2.6 kernels before 2.6.27, +.\"O a bug meant that these fields reported time in units +.\"O of the (configurable) system jiffy (see +.\"O .BR time (7)). +.RB ( getrusage (2) +¤ä +.BR time (2) +¤È°Û¤Ê¤ê) ¥Õ¥£¡¼¥ë¥É +.I si_utime +¤È +.I si_stime +¤Ë¤Ï wait ÂÔ¤Á¤Î»Ò¥×¥í¥»¥¹¤Ë¤è¤ê»ÈÍѤµ¤ì¤¿»þ´Ö¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +2.6 ¤è¤êÁ°¤È 2.6.27 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ë³ÊǼ¤µ¤ì¤ë CPU »þ´Ö¤Îñ°Ì¤Ï +.I sysconf(_SC_CLK_TCK) +¤Ç¤¢¤ë¡£ +2.6.27 ¤è¤êÁ°¤Î 2.6 ·Ï¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥Ð¥°¤¬¤¢¤ê¡¢ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Î CPU »þ´Ö¤Îñ°Ì¤¬ +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Õ¥£¥°¤Ç»ØÄꤵ¤ì¤ë) ¥·¥¹¥Æ¥à¤Î jiffy ¤Ç¤¢¤Ã¤¿ +.RB ( time (7) +»²¾È)¡£ +.\" FIXME . +.\" When si_utime and si_stime where originally implemented, the +.\" measurement unit was HZ, which was the same as clock ticks +.\" (sysconf(_SC_CLK_TCK)). In 2.6, HZ became configurable, and +.\" was *still* used as the unit to return the info these fields, +.\" with the result that the field values depended on the the +.\" configured HZ. Of course, the should have been measured in +.\" USER_HZ instead, so that sysconf(_SC_CLK_TCK) could be used to +.\" convert to seconds. I have a queued patch to fix this: +.\" http://thread.gmane.org/gmane.linux.kernel/698061/ . +.\" This patch made it into 2.6.27. +.\" But note that these fields still don't return the times of +.\" waited-for children (as is done by getrusage() and times() +.\" and wait4()). Solaris 8 does include child times. +.IP * +.\"O .IR si_int " and " si_ptr +.\"O are specified by the sender of the POSIX.1b signal. +.IR si_int " ¤È " si_ptr +¤Ï POSIX.1b ¥·¥°¥Ê¥ë¤ÎÁ÷¿®¼Ô¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤ë¡£ +.\"O See +.\"O .BR sigqueue (2) +.\"O for more details. +¾ÜºÙ¤Ï +.BR sigqueue (2) +¤ò»²¾È¤Î¤³¤È¡£ +.IP * +.\"O .BR SIGILL , +.\"O .BR SIGFPE , +.\"O .BR SIGSEGV , +.\"O and +.\"O .B SIGBUS +.\"O fill in +.\"O .I si_addr +.\"O with the address of the fault. +.BR SIGILL , +.BR SIGFPE , +.BR SIGSEGV , +.B SIGBUS +¤Ï +.I si_addr +¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¥¢¥É¥ì¥¹¤òÀßÄꤹ¤ë¡£ +.\"O .B SIGPOLL +.\"O fills in +.\"O .IR si_band " and " si_fd . +SIGPOLL ¤Ï +.IR si_band " ¤È " si_fd +¤òÀßÄꤹ¤ë¡£ +.PP +.\"O .I si_code +.\"O is a value (not a bit mask) +.\"O indicating why this signal was sent. +.I si_code +¤Ï¡¢¤½¤Î¥·¥°¥Ê¥ë¤¬Á÷¿®¤µ¤ì¤¿Íýͳ¤ò¼¨¤¹ÃͤǤ¢¤ë (¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤Ï¤Ê¤¤)¡£ +.\"O The following list shows the values which can be placed in +.\"O .I si_code +.\"O for any signal, along with reason that the signal was generated. +°Ê²¼¤Î¥ê¥¹¥È¤Ë¡¢¤É¤Î¥·¥°¥Ê¥ë¤Î¾ì¹ç¤Ç¤â +.I si_code +¤ËÆþ¤ê¤¦¤ëÃͤò¡¢¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤¿Íýͳ¤È¤È¤â¤Ëµ­ºÜ¤¹¤ë¡£ +.RS 4 +.TP 15 +.B SI_USER +.\"O .BR kill (2) +.\"O or +.\"O .BR raise (3) +.BR kill (2) +¤Þ¤¿¤Ï +.BR raise (3) +.TP +.B SI_KERNEL +.\"O Sent by the kernel. +¥«¡¼¥Í¥ë¤Ë¤è¤êÁ÷¿®¤µ¤ì¤¿ +.TP +.B SI_QUEUE +.BR sigqueue (2) +.TP +.B SI_TIMER +.\"O POSIX timer expired +POSIX ¥¿¥¤¥Þ¤¬Ëþλ¤·¤¿ +.TP +.B SI_MESGQ +.\"O POSIX message queue state changed (since Linux 2.6.6); see +.\"O .BR mq_notify (3) +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¾õÂÖ¤¬ÊѲ½¤·¤¿ (Linux 2.6.6 °Ê¹ß)¡£ +.BR mq_notify (3) »²¾È¡£ +.TP +.B SI_ASYNCIO +.\"O AIO completed +ÈóƱ´ü IO (AIO) ¤¬´°Î»¤·¤¿ +.TP +.B SI_SIGIO +.\"O queued SIGIO +¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤¿ SIGIO +.TP +.B SI_TKILL +.\"O .BR tkill (2) +.\"O or +.\"O .BR tgkill (2) +.\"O (since Linux 2.4.19) +.BR tkill (2) +¤Þ¤¿¤Ï +.BR tgkill (2) +(Linux 2.4.19 °Ê¹ß) +.\" SI_DETHREAD is defined in 2.6.9 sources, but isn't implemented +.\" It appears to have been an idea that was tried during 2.5.6 +.\" through to 2.5.24 and then was backed out. +.RE +.PP +.\"O The following values can be placed in +.\"O .I si_code +.\"O for a +.\"O .B SIGILL +.\"O signal: +.B SIGILL +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B ILL_ILLOPC +.\"O illegal opcode +ÉÔÀµ¤ÊÌ¿Îᥳ¡¼¥É (opcode) +.TP +.B ILL_ILLOPN +.\"O illegal operand +ÉÔÀµ¤Ê¥ª¥Ú¥é¥ó¥É +.TP +.B ILL_ILLADR +.\"O illegal addressing mode +ÉÔÀµ¤Ê¥¢¥É¥ì¥Ã¥·¥ó¥°¥â¡¼¥É +.TP +.B ILL_ILLTRP +.\"O illegal trap +ÉÔÀµ¤Ê¥È¥é¥Ã¥× +.TP +.B ILL_PRVOPC +.\"O privileged opcode +Æø¢¤¬É¬ÍפÊÌ¿Îᥳ¡¼¥É (opcode) +.TP +.B ILL_PRVREG +.\"O privileged register +Æø¢¤¬É¬Íפʥ쥸¥¹¥¿ +.TP +.B ILL_COPROC +.\"O coprocessor error +¥³¥×¥í¥»¥Ã¥µ¤Î¥¨¥é¡¼ +.TP +.B ILL_BADSTK +.\"O internal stack error +ÆâÉô¥¹¥¿¥Ã¥¯¥¨¥é¡¼ +.RE +.PP +.\"O The following values can be placed in +.\"O .I si_code +.\"O for a +.\"O .B SIGFPE +.\"O signal: +.B SIGFPE +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B FPE_INTDIV +.\"O integer divide by zero +À°¿ô¤Î 0 ¤Ë¤è¤ë½ü»» +.TP +.B FPE_INTOVF +.\"O integer overflow +À°¿ô¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.TP +.B FPE_FLTDIV +.\"O floating-point divide by zero +ÉâÆ°¾®¿ôÅÀ¤Î 0 ¤Ë¤è¤ë½ü»» +.TP +.B FPE_FLTOVF +.\"O floating-point overflow +ÉâÆ°¾®¿ôÅÀ¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.TP +.B FPE_FLTUND +.\"O floating-point underflow +ÉâÆ°¾®¿ôÅÀ¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.TP +.B FPE_FLTRES +.\"O floating-point inexact result +ÉâÆ°¾®¿ôÅÀ¤ÎÉÔÀµ³Î¤Ê±é»»·ë²Ì (inexact result) +.TP +.B FPE_FLTINV +.\"O floating-point invalid operation +ÉâÆ°¾®¿ôÅÀ¤ÎÉÔÀµ¤ÊÁàºî +.TP +.B FPE_FLTSUB +.\"O subscript out of range +Èϰϳ°¤Îź»ú (subscript) +.RE +.PP +.\"O The following values can be placed in +.\"O .I si_code +.\"O for a +.\"O .B SIGSEGV +.\"O signal: +.B SIGSEGV +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B SEGV_MAPERR +.\"O address not mapped to object +¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤Æ¤¤¤Ê¤¤¥¢¥É¥ì¥¹ +.TP +.B SEGV_ACCERR +.\"O invalid permissions for mapped object +¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ¹¤ë¥¢¥¯¥»¥¹µö²Ä¤¬¤Ê¤¤ +.RE +.PP +.\"O The following values can be placed in +.\"O .I si_code +.\"O for a +.\"O .B SIGBUS +.\"O signal: +.B SIGBUS +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B BUS_ADRALN +.\"O invalid address alignment +ÉÔÀµ¤Ê¥¢¥É¥ì¥¹¡¦¥¢¥é¥¤¥á¥ó¥È (alignment) +.TP +.B BUS_ADRERR +.\"O nonexistent physical address +¸ºß¤·¤Ê¤¤ÊªÍý¥¢¥É¥ì¥¹ +.TP +.B BUS_OBJERR +.\"O object-specific hardware error +¥ª¥Ö¥¸¥§¥¯¥È¸ÇÍ­¤Î¥Ï¡¼¥É¥¦¥§¥¢¥¨¥é¡¼ +.RE +.PP +.\"O The following values can be placed in +.\"O .I si_code +.\"O for a +.\"O .B SIGTRAP +.\"O signal: +.B SIGTRAP +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B TRAP_BRKPT +.\"O process breakpoint +¥×¥í¥»¥¹¤Î¥Ö¥ì¡¼¥¯¥Ý¥¤¥ó¥È +.TP +.B TRAP_TRACE +.\"O process trace trap +¥×¥í¥»¥¹¤Î¥È¥ì¡¼¥¹¡¦¥È¥é¥Ã¥× +.RE +.PP +.\"O The following values can be placed in +.\"O .I si_code +.\"O for a +.\"O .B SIGCHLD +.\"O signal: +.B SIGCHLD +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B CLD_EXITED +.\"O child has exited +»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿ (exited) +.TP +.B CLD_KILLED +.\"O child was killed +»Ò¥×¥í¥»¥¹¤¬ kill ¤µ¤ì¤¿ +.TP +.B CLD_DUMPED +.\"O child terminated abnormally +»Ò¥×¥í¥»¥¹¤¬°Û¾ï½ªÎ»¤·¤¿ +.TP +.B CLD_TRAPPED +.\"O traced child has trapped +¥È¥ì¡¼¥¹ÂÐ¾Ý¤Î»Ò¥×¥í¥»¥¹¤¬¥È¥é¥Ã¥×¤ò¾å¤²¤¿ +.TP +.B CLD_STOPPED +.\"O child has stopped +»Ò¥×¥í¥»¥¹¤¬Ää»ß (stop) ¤·¤¿ +.TP +.B CLD_CONTINUED +.\"O stopped child has continued (since Linux 2.6.9) +Ää»ß¤·¤Æ¤¤¤¿»Ò¥×¥í¥»¥¹¤¬ºÆ³«¤·¤¿ (Linux 2.6.9 °Ê¹ß) +.RE +.PP +.\"O The following values can be placed in +.\"O .I si_code +.\"O for a +.\"O .B SIGPOLL +.\"O signal: +.B SIGPOLL +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B POLL_IN +.\"O data input available +ÆþÎϥǡ¼¥¿¤¬ÍøÍѲÄǽ +.TP +.B POLL_OUT +.\"O output buffers available +½ÐÎϥХåե¡¤¬ÍøÍѲÄǽ +.TP +.B POLL_MSG +.\"O input message available +ÆþÎÏ¥á¥Ã¥»¡¼¥¸¤¬ÍøÍѲÄǽ +.TP +.B POLL_ERR +.\"O i/o error +I/O ¥¨¥é¡¼ +.TP +.B POLL_PRI +.\"O high priority input available +¹âÍ¥Àè¤ÎÆþÎϤ¬ÍøÍѲÄǽ +.TP +.B POLL_HUP +.\"O device disconnected +¥Ç¥Ð¥¤¥¹¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤ +.RE +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR sigaction () +.\"O returns 0 on success and \-1 on error. +.BR sigaction () +¤ÏÀ®¸ù¤¹¤ì¤Ð 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤Ê¤é¤Ð \-1 ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O .IR act " or " oldact +.\"O points to memory which is not a valid part of the process address space. +.IR act " ¤« " oldact +¤¬»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤¬Àµ¤·¤¤¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O An invalid signal was specified. +.\"O This will also be generated if an attempt +.\"O is made to change the action for +.\"O .BR SIGKILL " or " SIGSTOP ", " +.\"O which cannot be caught or ignored. +̵¸ú¤Ê¥·¥°¥Ê¥ë¤¬»ØÄꤵ¤ì¤¿¡£Êä­ (catch) ¤·¤¿¤ê̵»ë¤·¤¿¤ê¤Ç¤­¤Ê¤¤ +¥·¥°¥Ê¥ë¤Ç¤¢¤ë +.BR SIGKILL " ¤ä " SIGSTOP +¤ËÂФ¹¤ëÆ°ºî¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¤âȯÀ¸¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001, SVr4. +.\"O .\" SVr4 does not document the EINTR condition. +.\" SVr4 ¤Ë¤Ï EINTR ¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O A child created via +.\"O .BR fork (2) +.\"O inherits a copy of its parent's signal dispositions. +.\"O During an +.\"O .BR execve (2), +.\"O the dispositions of handled signals are reset to the default; +.\"O the dispositions of ignored signals are left unchanged. +.BR fork (2) +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Î +¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¡¢¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤µ¤ì¡¢ +̵»ë¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤ÏÊѹ¹¤µ¤ì¤º¤½¤Î¤Þ¤Þ¤È¤Ê¤ë¡£ + +.\"O According to POSIX, the behavior of a process is undefined after it +.\"O ignores a +.\"O .BR SIGFPE , +.\"O .BR SIGILL , +.\"O or +.\"O .B SIGSEGV +.\"O signal that was not generated by +.\"O .BR kill (2) +.\"O or +.\"O .BR raise (3). +.\"O Integer division by zero has undefined result. +.\"O On some architectures it will generate a +.\"O .B SIGFPE +.\"O signal. +.\"O (Also dividing the most negative integer by \-1 may generate +.\"O .BR SIGFPE .) +.\"O Ignoring this signal might lead to an endless loop. +POSIX ¤Ç¤Ï¡¢ +.BR kill (2) +¤ä +.BR raise (3) +´Ø¿ô¤ÇÀ¸À®¤Ç¤­¤Ê¤¤¥·¥°¥Ê¥ë +.BR SIGFPE , +.BR SIGILL , +.B SIGSEGV +¤ò̵»ë (ignore) ¤·¤¿¾ì¹ç¡¢¤½¤Î¸å¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +¥¼¥í¤Ë¤è¤ëÀ°¿ô³ä¤ê»»¤Î·ë²Ì¤Ï̤ÄêµÁ¤È¤Ê¤ë¡£ +¥¢¡¼¥­¥Æ¥¯¥Á¥ã¡¼¤Ë¤è¤Ã¤Æ¤Ï¡¢¤³¤Î¤È¤­ +.B SIGFPE +¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤ë¡£ +(ƱÍͤËÉé¤ÎºÇÂçÀ°¿ô¤ò \-1 ¤Ç³ä¤ë¤È +.B SIGFPE +¤¬À¸À®¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤) +¤³¤Î¥·¥°¥Ê¥ë¤ò̵»ë¤¹¤ë¤È̵¸Â¥ë¡¼¥×¤Ë´Ù¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +.\"O POSIX.1-1990 disallowed setting the action for +.\"O .B SIGCHLD +.\"O to +.\"O .BR SIG_IGN . +.\"O POSIX.1-2001 allows this possibility, so that ignoring +.\"O .B SIGCHLD +.\"O can be used to prevent the creation of zombies (see +.\"O .BR wait (2)). +.\"O Nevertheless, the historical BSD and System V behaviors for ignoring +.\"O .B SIGCHLD +.\"O differ, so that the only completely portable method of ensuring that +.\"O terminated children do not become zombies is to catch the +.\"O .B SIGCHLD +.\"O signal and perform a +.\"O .BR wait (2) +.\"O or similar. +POSIX.1-1990 ¤Ç¤Ï +.B SIGCHLD +¤Ë +.B SIG_IGN +¤òÀßÄꤹ¤ë¤³¤È¤òǧ¤á¤Æ¤¤¤Ê¤¤¡£ +POSIX.1-2001 ¤Ç¤Ïǧ¤á¤é¤ì¤Æ¤ª¤ê¡¢ +.B SIGCHLD +¤ò̵»ë¤¹¤ë¤³¤È¤Ç¥¾¥ó¥Ó¥×¥í¥»¥¹¤ÎÀ¸À®¤òËɻߤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.RB ( wait (2) +¤ò»²¾È)¡£ +¤µ¤é¤Ë¡¢BSD ¤È SystemV ¤Ç¤Ï +.B SIGCHLD +¤ò̵»ë¤·¤¿ºÝ¤ÎÆ°ºî¤¬°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤½¤Î¤¿¤á¡¢´°Á´¤Ë°Ü¿¢À­¤¬¤¢¤ëÊýË¡¤Ç¡¢½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤¬¥¾¥ó¥Ó¤Ë¤Ê¤é¤Ê¤¤¤³¤È +¤òÊݾڤ¹¤ë¤Ë¤Ï¡¢ +.B SIGCHLD +¥·¥°¥Ê¥ë¤òÊä­¤·¡¢ +.BR wait (2) +¤Ê¤É¤ò¼Â¹Ô¤¹¤ë¤·¤«¤Ê¤¤¡£ +.PP +.\"O POSIX.1-1990 only specified +.\"O .BR SA_NOCLDSTOP . +.\"O POSIX.1-2001 added +.\"O .BR SA_NOCLDWAIT , +.\"O .BR SA_RESETHAND , +.\"O .BR SA_NODEFER , +.\"O and +.\"O .BR SA_SIGINFO . +.\"O Use of these latter values in +.\"O .I sa_flags +.\"O may be less portable in applications intended for older +.\"O Unix implementations. +POSIX.1-1990 ¤Î»ÅÍÍ¤Ç¤Ï +.B SA_NOCLDSTOP +¤Î¤ß¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï +.BR SA_NOCLDWAIT , +.BR SA_RESETHAND , +.BR SA_NODEFER , +.B SA_SIGINFO +¤¬Äɲ䵤줿¡£ +Unix ¤Î¸Å¤¤¼ÂÁõ¤ÇÆ°¤«¤¹¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¡¢ +¾¤Î +.I sa_flags +¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¤È°Ü¿¢À­¤¬²¼¤¬¤ë¡£ +.PP +.\"O The +.\"O .B SA_RESETHAND +.\"O flag is compatible with the SVr4 flag of the same name. +.B SA_RESETHAND +¥Õ¥é¥°¤Ï SVr4 ¤ÎƱ¤¸Ì¾Á°¤Î¥Õ¥é¥°¤È¸ß´¹À­¤¬¤¢¤ë¡£ +.PP +.\"O The +.\"O .B SA_NODEFER +.\"O flag is compatible with the SVr4 flag of the same name under kernels +.\"O 1.3.9 and newer. +.\"O On older kernels the Linux implementation +.\"O allowed the receipt of any signal, not just the one we are installing +.\"O (effectively overriding any +.\"O .I sa_mask +.\"O settings). +.B SA_NODEFER +¥Õ¥é¥°¤Ï 1.3.9 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤ÏƱ¤¸Ì¾Á°¤Î SVr4 ¤Î¥Õ¥é¥°¤È¸ß´¹À­¤¬¤¢¤ë¡£ +¤¾¤ì°ÊÁ°¤Î Linux ¥«¡¼¥Í¥ë¤Î¼ÂÁõ¤Ç¤Ï¡¢¤³¤Î¥Õ¥é¥°¤òÀßÄꤷ¤Æ¤¤¤ë¥·¥°¥Ê¥ë +¤À¤±¤Ç¤Ê¤¯¡¢¤É¤Î¥·¥°¥Ê¥ë¤Ç¤â¼õ¤±¤ë¤³¤È¤òµö¤·¤Æ¤¤¤¿ (¼ÂºÝ¤Ë¤Ï +.I sa_mask +¤ÎÀßÄê¤Ë¤è¤ê̵¸ú¤Ë¤Ç¤­¤ë)¡£ +.PP +.\"O .BR sigaction () +.\"O can be called with a null second argument to query the current signal +.\"O handler. +.\"O It can also be used to check whether a given signal is valid for +.\"O the current machine by calling it with null second and third arguments. +.BR sigaction () +¤ÎÆóÈÖÌܤΰú¤­¿ô¤Ë NULL ¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤¹¤È¡¢¸½ºß¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò³Îǧ¤¹¤ë +¤³¤È¤¬¤Ç¤­¤ë¡£¤Þ¤¿¡¢ÆóÈÖÌܤȻ°ÈÖÌܤΰú¤­¿ô¤ò NULL ¤Ë¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢ +»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤¬¸½ºß¤Î¥Þ¥·¥ó¤Ç»È¤¨¤ë¤«¤É¤¦¤«¥Á¥§¥Ã¥¯¤Ç¤­¤ë¡£ +.PP +.\"O It is not possible to block +.\"O .BR SIGKILL " or " SIGSTOP +.\"O (by specifying them in +.\"O .IR sa_mask ). +.\"O Attempts to do so are silently ignored. +.B SIGKILL +¤ä +.B SIGSTOP +¤ò +.RI ( sa_mask +¤Ë»ØÄꤷ¤Æ) ¶Ø»ß¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¶Ø»ß¤·¤è¤¦¤È¤·¤Æ¤âÌۤäÆ̵»ë¤µ¤ì¤ë¡£ +.PP +.\"O See +.\"O .BR sigsetops (3) +.\"O for details on manipulating signal sets. +¥·¥°¥Ê¥ë½¸¹ç¤ÎÁàºî¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï +.BR sigsetops (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +.\"O See +.\"O .BR signal (7) +.\"O for a list of the async-signal-safe functions that can be +.\"O safely called inside from inside a signal handler. +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥éÆ⤫¤é°ÂÁ´¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡¢ +async-signal-safe functions (ÈóƱ´ü¥·¥ó¥°¥ë¤Ç°ÂÁ´¤Ê´Ø¿ô) ¤Î +¥ê¥¹¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR signal (7) +¤ò»²¾È¡£ +.\"O .SS Undocumented +.SS Èó¸ø¼° +.\"O Before the introduction of +.\"O .B SA_SIGINFO +.\"O it was also possible to get some additional information, +.\"O namely by using a +.\"O .I sa_handler +.\"O with second argument of type +.\"O .IR "struct sigcontext". +.\"O See the relevant kernel sources for details. +.\"O This use is obsolete now. +.B SA_SIGINFO +¤¬Æ³Æþ¤µ¤ì¤ëÁ°¤Ï¡¢ +.I "struct sigcontext" +·¿¤ÎÆóÈÖÌܤΰú¤­¿ô¤È°ì½ï¤Ë +.I sa_handler +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¡¢ +¤¤¤¯¤Ä¤«¤ÎÄɲäξðÊó¤òÆþ¼ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤¿¡£ +¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¥«¡¼¥Í¥ë¥½¡¼¥¹¤Î´ØÏ¢Éôʬ¤ò¸«¤Æ¤Û¤·¤¤¡£ +¸½ºß¤Ï¤³¤Î»ÈÍÑË¡¤ÏÇѻߤµ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O In kernels up to and including 2.6.13, specifying +.\"O .B SA_NODEFER +.\"O in +.\"O .I sa_flags +.\"O prevents not only the delivered signal from being masked during +.\"O execution of the handler, but also the signals specified in +.\"O .IR sa_mask . +.\"O This bug was fixed in kernel 2.6.14. +2.6.13 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.I sa_flags +¤Ë +.B SA_NODEFER +¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ +¥Ï¥ó¥É¥é¤¬¼Â¹ÔÃæ¤ËÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¼«¿È¤¬¥Þ¥¹¥¯¤µ¤ì¤Ê¤¯¤Ê¤ë¤À¤±¤Ç¤Ê¤¯¡¢ +.I sa_mask +¤Ë»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤â¥Þ¥¹¥¯¤µ¤ì¤Ê¤¯¤Ê¤ë¡£ +¤³¤Î¥Ð¥°¤Ï¡¢¥«¡¼¥Í¥ë 2.6.14 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O See +.\"O .BR mprotect (2). +.BR mprotect (2) +»²¾È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (1), +.BR kill (2), +.BR killpg (2), +.BR pause (2), +.BR sigaltstack (2), +.BR signal (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigqueue (2), +.BR sigsuspend (2), +.BR wait (2), +.BR raise (3), +.BR siginterrupt (3), +.BR sigsetops (3), +.BR sigvec (3), +.BR core (5), +.BR signal (7) diff --git a/draft/man2/sigaltstack.2 b/draft/man2/sigaltstack.2 new file mode 100644 index 00000000..c34f8bd8 --- /dev/null +++ b/draft/man2/sigaltstack.2 @@ -0,0 +1,380 @@ +'\" t +.\" Copyright (c) 2001, Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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. +.\" +.\" aeb, various minor fixes +.\" +.\" Japanese Version Copyright (c) 2001 Yuichi SATO +.\" all rights reserved. +.\" Translated 2001-11-04, Yuichi SATO +.\" Updated 2001-12-09, Yuichi SATO +.\" Updated 2005-11-04, Akihiro MOTOKI +.\" Updated 2006-01-04, Akihiro MOTOKI, Catch up to LDP 2.20 +.\" +.\"WORD: alternate signal stack ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯ +.\"WORD: establish (¥¹¥¿¥Ã¥¯¤Î) ³ÎΩ +.\" +.TH SIGALTSTACK 2 2008-10-04 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigaltstack \- set and/or get signal stack context +sigaltstack \- ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Î¥³¥ó¥Æ¥­¥¹¥È¤òÀßÄꡦ¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int sigaltstack(const stack_t *" ss ", stack_t *" oss ); +.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 sigaltstack (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\" .br +.\" .BR sigstack (): +.\" _BSD_SOURCE || _XOPEN_SOURCE >= 500 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sigaltstack () +.\"O allows a process to define a new alternate +.\"O signal stack and/or retrieve the state of an existing +.\"O alternate signal stack. +.\"O An alternate signal stack is used during the +.\"O execution of a signal handler if the establishment of that handler (see +.\"O .BR sigaction (2)) +.\"O requested it. +.BR sigaltstack () +¤ò»È¤¦¤È¡¢ +¥×¥í¥»¥¹¤Ï¿·¤·¤¤ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤òÄêµÁ¤·¤¿¤ê¡¢ +´û¸¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Î¾õÂÖ¤ò¼èÆÀ¤Ç¤­¤ë¡£ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤òÍ׵᤹¤ë¤è¤¦¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¤È +.RB ( sigaction (2) +»²¾È)¡¢¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¤½¤Î¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤¬»È¤ï¤ì¤ë¡£ + +.\"O The normal sequence of events for using an alternate signal stack +.\"O is the following: +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò»È¤¦ºÝ¤Î°ìÈÌŪ¤Ê¼ê½ç¤Ï¡¢°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.TP 3 +1. +.\"O Allocate an area of memory to be used for the alternate +.\"O signal stack. +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Ç»È¤¦¥á¥â¥êÎΰè¤ò³ÎÊݤ¹¤ë¡£ +.TP +2. +.\"O Use +.\"O .BR sigaltstack () +.\"O to inform the system of the existence and +.\"O location of the alternate signal stack. +.BR sigaltstack () +¤ò»È¤Ã¤Æ¡¢ +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Î¸ºß¤È¾ì½ê¤ò¥·¥¹¥Æ¥à¤ËÃΤ餻¤ë¡£ +.TP +3. +.\"O When establishing a signal handler using +.\"O .BR sigaction (2), +.\"O inform the system that the signal handler should be executed +.\"O on the alternate signal stack by +.\"O specifying the \fBSA_ONSTACK\fP flag. +.BR sigaction (2) +¤ò»È¤Ã¤Æ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò³ÎΩ¤¹¤ëºÝ¡¢ +\fBSA_ONSTACK\fP ¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¢ +¤½¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¼Â¹Ô¤¹¤ë¤³¤È¤ò +¥·¥¹¥Æ¥à¤ËÃΤ餻¤ë¡£ +.P +.\"O The \fIss\fP argument is used to specify a new +.\"O alternate signal stack, while the \fIoss\fP argument +.\"O is used to retrieve information about the currently +.\"O established signal stack. +\fIss\fP °ú¤­¿ô¤Ï¡¢¿·¤·¤¤¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò»ØÄꤹ¤ë¤¿¤á¤Ë»È¤¦¡£ +¤Þ¤¿ \fIoss\fP °ú¤­¿ô¤Ï¡¢¸½ºß³ÎΩ¤µ¤ì¤Æ¤¤¤ë +¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë»È¤¦¡£ +.\"O If we are interested in performing just one +.\"O of these tasks then the other argument can be specified as NULL. +.\"O Each of these arguments is a structure of the following type: +¤³¤ÎÁàºî¤Î¤¦¤Á 1 ¤Ä¤À¤±¤ò¼Â¹Ô¤µ¤»¤ë¤Ë¤Ï¡¢ +»ÈÍѤ·¤Ê¤¤°ú¤­¿ô¤ò NULL ¤Ë»ØÄꤹ¤ì¤Ð¤è¤¤¡£ +°ú¤­¿ô¤È¤Ê¤ë¹½Â¤ÂΤϡ¢°Ê²¼¤Î¤è¤¦¤Ê·¿¤Ç¤¢¤ë: +.sp +.in +4n +.nf +typedef struct { +.\"O void *ss_sp; /* Base address of stack */ + void *ss_sp; /* ¥¹¥¿¥Ã¥¯¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹ */ +.\"O int ss_flags; /* Flags */ + int ss_flags; /* ¥Õ¥é¥° */ +.\"O size_t ss_size; /* Number of bytes in stack */ + size_t ss_size; /* ¥¹¥¿¥Ã¥¯¤Î¥Ð¥¤¥È¿ô */ +} stack_t; +.fi +.in + +.\"O To establish a new alternate signal stack, +.\"O \fIss.ss_flags\fP is set to zero, and \fIss.ss_sp\fP and +.\"O \fIss.ss_size\fP specify the starting address and size of +.\"O the stack. +¿·µ¬¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò³ÎΩ¤¹¤ë¤Ë¤Ï¡¢ +\fIss.ss_flags\fP ¤ò 0 ¤ËÀßÄꤷ¡¢ +\fIss.ss_sp\fP ¤È \fIss.ss_size\fP ¤Ë +¥¹¥¿¥Ã¥¯¤Î³«»Ï¥¢¥É¥ì¥¹¤È¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤ò»ØÄꤹ¤ë¡£ +.\"O The constant \fBSIGSTKSZ\fP is defined to be large enough +.\"O to cover the usual size requirements for an alternate signal stack, +.\"O and the constant \fBMINSIGSTKSZ\fP defines the minimum +.\"O size required to execute a signal handler. +Äê¿ô \fBSIGSTKSZ\fP ¤Ï¡¢ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤¬Ä̾ïɬÍפ¹¤ë +¥µ¥¤¥º¤è¤ê¤â½¼Ê¬Â礭¤¯ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤Þ¤¿Äê¿ô \fBMINSIGSTKSZ\fP ¤Ï¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¼Â¹Ô¤ËɬÍפʺǾ®¥µ¥¤¥º¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"O When a signal handler is invoked on the alternate stack, +.\"O the kernel automatically aligns the address given in \fIss.ss_sp\fP +.\"O to a suitable address boundary for the underlying hardware architecture. +ÂåÂØ¥¹¥¿¥Ã¥¯¤Ç¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥«¡¼¥Í¥ë¤Ë¤è¤ê¼«Æ°Åª¤Ë¡¢\fIss.ss_sp\fP ¤Ç»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤Ï +Æ°ºî¤·¤Æ¤¤¤ë¥Ï¡¼¥É¥¦¥§¥¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ËŬ¤·¤¿¥¢¥É¥ì¥¹¶­³¦¤Ë +Ä´À°¤µ¤ì¤ë¡£ + +.\"O To disable an existing stack, specify \fIss.ss_flags\fP +.\"O as \fBSS_DISABLE\fP. +.\"O In this case, the remaining fields +.\"O in \fIss\fP are ignored. +´û¸¤Î¥¹¥¿¥Ã¥¯¤ò̵¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢ +\fIss.ss_flags\fP ¤ò \fBSS_DISABLE\fP ¤Ë»ØÄꤹ¤ë¡£ +¤³¤Î¾ì¹ç¡¢\fIss\fP ¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"O If \fIoss\fP is not NULL, then it is used to return information about +.\"O the alternate signal stack which was in effect prior to the +.\"O call to +.\"O .BR sigaltstack (). +\fIoss\fP ¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢ +\fIoss\fP ¤ËÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Î¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤ì¤Ï (¼Â¼ÁŪ¤Ë) +.BR sigaltstack () +¤Î¸Æ¤Ó½Ð¤·¤è¤êÀè¤Ë¹Ô¤ï¤ì¤ë¡£ +.\"O The \fIoss.ss_sp\fP and \fIoss.ss_size\fP fields return the starting +.\"O address and size of that stack. +.\"O The \fIoss.ss_flags\fP may return either of the following values: +\fIoss.ss_sp\fP ¤È \fIoss.ss_size\fP ¥Õ¥£¡¼¥ë¥É¤Ë +¥¹¥¿¥Ã¥¯¤Î³«»Ï¥¢¥É¥ì¥¹¤È¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤¬ÊÖ¤µ¤ì¤ë¡£ +\fIoss.ss_flags\fP ¤Ë¤Ï°Ê²¼¤Î¤É¤Á¤é¤«¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë: +.TP +.B SS_ONSTACK +.\"O The process is currently executing on the alternate signal stack. +.\"O (Note that it is not possible +.\"O to change the alternate signal stack if the process is +.\"O currently executing on it.) +¥×¥í¥»¥¹¤¬ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë +(¥×¥í¥»¥¹¤¬´û¤Ë¤½¤Î¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¤½¤ì¤ÈƱ¤¸¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Ë¤ÏÊѹ¹¤Ç¤­¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È)¡£ +.TP +.B SS_DISABLE +.\"O The alternate signal stack is currently disabled. +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤¬¸½ºß̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR sigaltstack () +.\"O returns 0 on success, or \-1 on failure with +.\"O \fIerrno\fP set to indicate the error. +.BR sigaltstack () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¤Æ¡¢ +¥¨¥é¡¼¤ò¼¨¤¹ÃÍ¤Ë \fIerrno\fP ¤òÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O Either \fIss\fP or \fIoss\fP is not NULL and points to an area +.\"O outside of the process's address space. +\fIss\fP ¤Þ¤¿¤Ï \fIoss\fP ¤Î¤É¤Á¤é¤¬¡¢NULL °Ê³°¤Ç¡¢ +¤«¤Ä¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O \fIss\fP is not NULL and the \fIss_flags\fP field contains +.\"O a nonzero value other than +.\"O .BR SS_DISABLE . +\fIss\fP ¤¬ NULL °Ê³°¤Ç¡¢\fIss_flags\fP ¥Õ¥£¡¼¥ë¥É¤¬ +.B SS_DISABLE +°Ê³°¤Î 0 ¤Ç¤Ê¤¤ÃͤˤʤäƤ¤¤ë¡£ +.TP +.B ENOMEM +.\"O The specified size of the new alternate signal stack +.\"O (\fIss.ss_size\fP) was less than \fBMINSTKSZ\fP. +¿·¤·¤¤ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯ (\fIss.ss_size\fP) ¤Ë»ØÄꤷ¤¿¥µ¥¤¥º¤¬ +\fBMINSTKSZ\fP ¤è¤ê¾®¤µ¤¤¡£ +.TP +.B EPERM +.\"O An attempt was made to change the alternate signal stack while +.\"O it was active (i.e., the process was already executing +.\"O on the current alternate signal stack). +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤¬Í­¸ú¤Ç¤¢¤ë¤È¤­¤ËÊѹ¹¤ò¹Ô¤ª¤¦¤È¤·¤¿ +(¤Ä¤Þ¤ê¡¢¥×¥í¥»¥¹¤¬´û¤Ë¸½ºß¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¼Â¹Ô¤µ¤ì¤Æ¤¤¤¿)¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SUSv2, SVr4, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The most common usage of an alternate signal stack is to handle the +.\"O .B SIGSEGV +.\"O signal that is generated if the space available for the +.\"O normal process stack is exhausted: in this case, a signal handler for +.\"O .B SIGSEGV +.\"O cannot be invoked on the process stack; if we wish to handle it, +.\"O we must use an alternate signal stack. +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò»ÈÍѤ¹¤ëºÇ¤â¤è¤¯¤¢¤ë¾ìÌ̤ϡ¢ +.B SIGSEGV +¥·¥°¥Ê¥ë¤ò°·¤¦¤È¤­¤Ç¤¢¤ë¡£ +.B SIGSEGV +¤Ï¥×¥í¥»¥¹¤ÎÄ̾ï¤Î¥¹¥¿¥Ã¥¯¤¬ÍøÍѤǤ­¤ë¶õ´Ö¤¬»È¤¤²Ì¤¿¤µ¤ì¤¿ºÝ¤Ë +À¸À®¤µ¤ì¤ë¥·¥°¥Ê¥ë¤Ç¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ +.B SIGSEGV +ÍѤΥ·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò¥×¥í¥»¥¹¤Î¥¹¥¿¥Ã¥¯¾å¤Ç¤Ïµ¯Æ°¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢¤³¤Î¥·¥°¥Ê¥ë¤ò°·¤ª¤¦¤È¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢ +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.P +.\"O Establishing an alternate signal stack is useful if a process +.\"O expects that it may exhaust its standard stack. +¥×¥í¥»¥¹¤¬É¸½à¤Î¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò»È¤¤²Ì¤¿¤¹¤³¤È¤¬Í½ÁÛ¤µ¤ì¤ë¾ì¹ç¤Ï¡¢ +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò³ÎΩ¤¹¤ë¤ÈÊØÍø¤Ç¤¢¤ë¡£ +.\"O This may occur, for example, because the stack grows so large +.\"O that it encounters the upwardly growing heap, or it reaches a +.\"O limit established by a call to \fBsetrlimit(RLIMIT_STACK, &rlim)\fP. +Î㤨¤Ð¡¢¥¹¥¿¥Ã¥¯¤¬ºÇ¾å°Ì¥¢¥É¥ì¥¹¤«¤é +²¼°Ì¥¢¥É¥ì¥¹Êý¸þ¤ËÈó¾ï¤Ë¤¿¤¯¤µ¤óÀѤޤì¤Æ¤·¤Þ¤¦¤³¤È¤Ç¡¢ +ºÇ²¼°Ì¥¢¥É¥ì¥¹¤«¤é¾å°Ì¥¢¥É¥ì¥¹Êý¸þ¤ËÀѤޤì¤ë¥Ò¡¼¥×¤È¤Ö¤Ä¤«¤Ã¤Æ¤·¤Þ¤¦¾ì¹ç¤ä¡¢ +\fBsetrlimit(RLIMIT_STACK, &rlim)\fP ¤Î¸Æ¤Ó½Ð¤·¤Ç³ÎΩ¤µ¤ì¤¿ +À©¸Â¤Ë㤷¤Æ¤·¤Þ¤Ã¤¿¾ì¹ç¤Ë¡¢¤³¤ÎÍͤʻö¤¬µ¯¤³¤ë¡£ +.\"O If the standard stack is exhausted, the kernel sends +.\"O the process a \fBSIGSEGV\fP signal. +.\"O In these circumstances the only way to catch this signal is +.\"O on an alternate signal stack. +ɸ½à¤Î¥¹¥¿¥Ã¥¯¤ò»È¤¤²Ì¤¿¤·¤Æ¤·¤Þ¤¦¤È¡¢ +¥«¡¼¥Í¥ë¤Ï¥×¥í¥»¥¹¤Ë \fBSIGSEGV\fP ¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +¤³¤Î¤è¤¦¤Ê¾õ¶·¤Ç¤Ï¡¢ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¤·¤«¥·¥°¥Ê¥ë¤ò¥­¥ã¥Ã¥Á¤Ç¤­¤Ê¤¤¡£ +.P +.\"O On most hardware architectures supported by Linux, stacks grow +.\"O downwards. +.\"O .BR sigaltstack () +.\"O automatically takes account +.\"O of the direction of stack growth. +Linux ¤¬¥µ¥Ý¡¼¥È¤¹¤ë¿¤¯¤Î¥Ï¡¼¥É¥¦¥§¥¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢ +¥¹¥¿¥Ã¥¯¤Ï²¼°Ì¥¢¥É¥ì¥¹Êý¸þ¤ËÀѤޤì¤ë¡£ +.BR sigaltstack () +¤Ï¥¹¥¿¥Ã¥¯¤¬ÀѤޤì¤ëÊý¸þ¤ò¼«Æ°Åª¤Ë·èÄꤹ¤ë¡£ +.P +.\"O Functions called from a signal handler executing on an alternate +.\"O signal stack will also use the alternate signal stack. +.\"O (This also applies to any handlers invoked for other signals while +.\"O the process is executing on the alternate signal stack.) +.\"O Unlike the standard stack, the system does not +.\"O automatically extend the alternate signal stack. +.\"O Exceeding the allocated size of the alternate signal stack will +.\"O lead to unpredictable results. +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤«¤é¸Æ¤Ð¤ì¤ë´Ø¿ô¤â¡¢ÂåÂØ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò»È¤¦ +(¥×¥í¥»¥¹¤¬ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¾¤Î¥·¥°¥Ê¥ë¤Ç¸Æ¤Ó½Ð¤µ¤ì¤ë¥Ï¥ó¥É¥é¤â¤³¤ÎÂåÂØ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò»È¤¦)¡£ +ɸ½à¤Î¥¹¥¿¥Ã¥¯¤È¤Ï°Û¤Ê¤ê¡¢ +¥·¥¹¥Æ¥à¤ÏÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò¼«Æ°Åª¤Ë³ÈÄ¥¤·¤Ê¤¤¡£ +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯ÍѤ˳ÎÊݤ·¤¿¥µ¥¤¥º¤ò±Û¤¨¤¿¾ì¹ç¡¢ +·ë²Ì¤ÏͽÁۤǤ­¤Ê¤¤¡£ +.P +.\"O A successful call to +.\"O .BR execve (2) +.\"O removes any existing alternate +.\"O signal stack. +.\"O A child process created via +.\"O .BR fork () +.\"O inherits a copy of its parent's alternate signal stack settings. +.BR execve (2) +¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤È¡¢ +´û¸¤ÎÁ´¤Æ¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤¬ºï½ü¤µ¤ì¤ë¡£ +.BR fork () +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Î +ÀßÄê¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.P +.\"O .BR sigaltstack () +.\"O supersedes the older +.\"O .BR sigstack () +.\"O call. +.\"O For backwards compatibility, glibc also provides +.\"O .BR sigstack (). +.\"O All new applications should be written using +.\"O .BR sigaltstack (). +.BR sigaltstack () +¤Ï°ÊÁ°¤Î +.BR sigstack () +¤òÃÖ¤­´¹¤¨¤ë¤â¤Î¤Ç¤¢¤ë¡£ +²áµî¥×¥í¥°¥é¥à¤È¤Î¸ß´¹À­¤Î¤¿¤á¡¢glibc ¤Ç¤Ï +.BR sigstack () +¤âÄ󶡤·¤Æ¤¤¤ë¡£ +¿·¤·¤¤¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÏÁ´¤Æ +.BR sigaltstack () +¤ò»È¤Ã¤Æ½ñ¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SS History +.SS Îò»Ë +.\"O 4.2BSD had a +.\"O .BR sigstack () +.\"O system call. +.\"O It used a slightly +.\"O different struct, and had the major disadvantage that the caller +.\"O had to know the direction of stack growth. +4.2BSD ¤Ë¤Ï +.BR sigstack () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤¢¤Ã¤¿¡£ +¤³¤Î´Ø¿ô¤Ï¾¯¤·°Û¤Ê¤Ã¤¿¹½Â¤ÂΤò»È¤Ã¤Æ¤ª¤ê¡¢ +¸Æ¤Ó½Ð¤·¤¿Â¦¤¬¥¹¥¿¥Ã¥¯¤ÎÀѤޤì¤ëÊý¸þ¤òÃΤäƤ¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤È¤¤¤¦ +Â礭¤Ê·çÅÀ¤¬¤¢¤Ã¤¿¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The following code segment demonstrates the use of +.\"O .BR sigaltstack (): +°Ê²¼¤Î¥³¡¼¥É¤Ç +.BR sigaltstack () +¤Î»ÈÍÑË¡¤Î°ìÉô¤ò¼¨¤¹: + +.in +4n +.nf +stack_t ss; + +ss.ss_sp = malloc(SIGSTKSZ); +if (ss.ss_sp == NULL) +.\"O /* Handle error */; + /* ¥Ï¥ó¥É¥ë¥¨¥é¡¼ */; +ss.ss_size = SIGSTKSZ; +ss.ss_flags = 0; +if (sigaltstack(&ss, NULL) == \-1) +.\"O /* Handle error */; + /* ¥Ï¥ó¥É¥ë¥¨¥é¡¼ */; +.fi +.in +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR execve (2), +.BR setrlimit (2), +.BR sigaction (2), +.BR siglongjmp (3), +.BR sigsetjmp (3), +.BR signal (7) diff --git a/draft/man2/signal.2 b/draft/man2/signal.2 new file mode 100644 index 00000000..bbea70c6 --- /dev/null +++ b/draft/man2/signal.2 @@ -0,0 +1,504 @@ +.\" Copyright (c) 2000 Andries Brouwer +.\" and Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" and Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" based on work by Rik Faith +.\" and Mike Battersby . +.\" +.\" 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 2004-11-19, mtk: +.\" added pointer to sigaction.2 for details of ignoring SIGCHLD +.\" 2007-06-03, mtk: strengthened portability warning, and rewrote +.\" various sections. +.\" 2008-07-11, mtk: rewrote and expanded portability discussion. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-03-03, HANATAKA Shinya +.\" Modified 2000-09-24, HANATAKA Shinya +.\" Updated & Modified 2002-01-14, Yuichi SATO +.\" Updated & Modified 2004-01-17, Yuichi SATO +.\" Updated & Modified 2005-01-07, Yuichi SATO +.\" Updated 2007-06-01, Akihiro MOTOKI , LDP v2.50 +.\" Updated 2007-06-13, Akihiro MOTOKI, LDP v2.55 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: signal handler ¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é +.\"WORD: library ¥é¥¤¥Ö¥é¥ê +.\"WORD: semantics Êý¼° +.\"WORD: prototype ·¿Àë¸À +.\"WORD: architecture ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¡¼ +.\"WORD: endless loop ̵¸Â¥ë¡¼¥× +.\"WORD: feature test macro µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\"WORD: disposition ½èÍýÊýË¡ +.\" +.TH SIGNAL 2 2008-07-11 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O signal \- ANSI C signal handling +signal \- ANSI C ¥·¥°¥Ê¥ëÁàºî +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.\"O .BI "sighandler_t signal(int " signum ", sighandler_t " handler ); +.BI "sighandler_t signal(int " signum ", sighandler_t " sighandler ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The behavior of +.\"O .BR signal () +.\"O varies across Unix versions, +.\"O and has also varied historically across different versions of Linux. +.\"O \fBAvoid its use\fP: use +.\"O .BR sigaction (2) +.\"O instead. +.\"O See \fIPortability\fP below. +.BR signal () +¤ÎÆ°ºî¤Ï Unix ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê°Û¤Ê¤ë¡£ +¤Þ¤¿¡¢Îò»ËŪ¤Ë¸«¤Æ Linux ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ¤â°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +\fB¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î»ÈÍѤÏÈò¤±¡¢\fP +Âå¤ï¤ê¤Ë +.BR sigaction (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +²¼µ­¤Î¡Ö°Ü¿¢À­¡×¤ò»²¾È¡£ + +.\"O .BR signal () +.\"O sets the disposition of the signal +.\"O .I signum +.\"O to +.\"O .IR handler , +.\"O which is either +.\"O .BR SIG_IGN , +.\"O .BR SIG_DFL , +.\"O or the address of a programmer-defined function (a "signal handler"). +.BR signal () +¤Ï¥·¥°¥Ê¥ë +.I signum +¤Î½èÍýÊýË¡¤ò +.I handler +¤ËÀßÄꤹ¤ë¡£ +.I handler +¤Ë¤Ï¡¢ +.BR SIG_IGN "¡¢" +.BR SIG_DFL "¡¢" +¥×¥í¥°¥é¥Þ¤¬ÄêµÁ¤·¤¿´Ø¿ô (¡Ö¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¡×) ¤Î¥¢¥É¥ì¥¹¤Î +¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ + +.\"O If the signal +.\"O .I signum +.\"O is delivered to the process, then one of the following happens: +¥·¥°¥Ê¥ë +.I signum +¤¬¥×¥í¥»¥¹¤ËÇÛÁ÷¤µ¤ì¤ë¤È¡¢°Ê²¼¤Î¤¤¤º¤ì¤«¤¬È¯À¸¤¹¤ë¡£ +.TP 3 +* +.\"O If the disposition is set to +.\"O .BR SIG_IGN , +.\"O then the signal is ignored. +½èÍýÊýË¡¤¬ +.B SIG_IGN +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +* +.\"O If the disposition is set to +.\"O .BR SIG_DFL , +.\"O then the default action associated with the signal (see +.\"O .BR signal (7)) +.\"O occurs. +½èÍýÊýË¡¤¬ +.B SIG_DFL +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥·¥°¥Ê¥ë¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿ +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤¬¹Ô¤ï¤ì¤ë +.RB ( signal (7) +»²¾È)¡£ +.TP +* +.\"O If the disposition is set to a function, +.\"O then first either the disposition is reset to +.\"O .BR SIG_DFL , +.\"O or the signal is blocked (see \fIPortability\fP below), and then +.\"O .I handler +.\"O is called with argument +.\"O .IR signum . +½èÍýÊýË¡¤È¤·¤Æ´Ø¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¤Þ¤ººÇ½é¤Ë½èÍýÊýË¡¤¬ +.B SIG_DFL +¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¤«¤½¤Î¥·¥°¥Ê¥ë¤Î¥Ö¥í¥Ã¥¯¤¬¼Â¹Ô¤µ¤ì¤¿¸å¡¢ +.I signum +¤ò°ú¤­¿ô¤È¤·¤Æ +.I handler +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.\"O If invocation of the handler caused the signal to be blocked, +.\"O then the signal is unblocked upon return from the handler. +¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤ëºÝ¤Ë¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¾ì¹ç¡¢ +¥Ï¥ó¥É¥é¤¬ÊÖ¤ëºÝ¤Ë¤½¤Î¥·¥°¥Ê¥ë¤Î¥Ö¥í¥Ã¥¯¤¬²ò½ü¤µ¤ì¤ë¡£ +.PP +.\"O The signals +.\"O .B SIGKILL +.\"O and +.\"O .B SIGSTOP +.\"O cannot be caught or ignored. +¥·¥°¥Ê¥ë +.B SIGKILL +¤È +.B SIGSTOP +¤ÏÊ᪤Ǥ­¤º¡¢Ìµ»ë¤¹¤ë¤³¤È¤â¤Ç¤­¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR signal () +.\"O returns the previous value of the signal handler, or +.\"O .B SIG_ERR +.\"O on error. +.BR signal () +¤Ï¡¢º£¤Þ¤Ç¤Î¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤ÎÃͤòÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï +.B SIG_ERR +¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O .I signum +.\"O is invalid. +.I signum +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C89, C99, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The effects of +.\"O .BR signal () +.\"O in a multithreaded process are unspecified. +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥»¥¹¤Ë¤ª¤±¤ë +.BR signal () +¤Î·ë²Ì¤Ï¡¢»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O According to POSIX, the behavior of a process is undefined after it +.\"O ignores a +.\"O .BR SIGFPE , +.\"O .BR SIGILL , +.\"O or +.\"O .B SIGSEGV +.\"O signal that was not generated by +.\"O .BR kill (2) +.\"O or +.\"O .BR raise (3). +POSIX ¤Ë¤è¤ë¤È¡¢ +.BR kill (2) +¤ä +.BR raise (3) +¤ÇÀ¸À®¤Ç¤­¤Ê¤¤ +.BR SIGFPE , +.BR SIGILL , +.B SIGSEGV +¥·¥°¥Ê¥ë¤ò̵»ë¤·¤¿¸å¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.\"O Integer division by zero has undefined result. +.\"O On some architectures it will generate a +.\"O .B SIGFPE +.\"O signal. +.\"O (Also dividing the most negative integer by \-1 may generate +.\"O .BR SIGFPE .) +.\"O Ignoring this signal might lead to an endless loop. +0 ¤Ë¤è¤ëÀ°¿ô³ä¤ê»»¤Î·ë²Ì¤Ï̤ÄêµÁ¤È¤Ê¤ë¡£ +¤¢¤ë¼ï¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢¤³¤ì¤Ï +.B SIGFPE +¥·¥°¥Ê¥ë¤òÀ¸À®¤¹¤ë¡£ +(ƱÍͤËÉé¤ÎºÇÂçÀ°¿ô¤ò \-1 ¤Ç³ä¤ë¤È +.B SIGFPE +¤¬À¸À®¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£) +¤³¤Î¥·¥°¥Ê¥ë¤ò̵»ë¤¹¤ë¤È̵¸Â¥ë¡¼¥×¤Ë´Ù¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +.\"O See +.\"O .BR sigaction (2) +.\"O for details on what happens when +.\"O .B SIGCHLD +.\"O is set to +.\"O .BR SIG_IGN . +.B SIGCHLD +¤ÎÆ°ºî¤È¤·¤Æ +.B SIG_IGN +¤òÀßÄꤷ¤¿¾ì¹ç¤Î¾ÜºÙ¤ÊÆ°ºî¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR sigaction (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +.\"O See +.\"O .BR signal (7) +.\"O for a list of the async-signal-safe functions that can be +.\"O safely called from inside a signal handler. +¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥éÆ⤫¤é°ÂÁ´¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡¢ +async-signal-safe functions (ÈóƱ´ü¥·¥ó¥°¥ë¤Ç°ÂÁ´¤Ê´Ø¿ô) ¤Î +¥ê¥¹¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR signal (7) +¤ò»²¾È¡£ +.PP +.\"O The use of +.\"O .I sighandler_t +.\"O is a GNU extension. +.I sighandler_t +¤Î»ÈÍÑ¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O Various versions of libc predefine this type; libc4 and libc5 define +.\"O .IR SignalHandler ; +.\"O glibc defines +.\"O .I sig_t +.\"O and, when +.\"O .B _GNU_SOURCE +.\"O is defined, also +.\"O .IR sighandler_t . +³Æ¼ï¥Ð¡¼¥¸¥ç¥ó¤Î libc ¤Ç¤³¤Î·¿¤ÏÄêµÁºÑ¤ß¤Ç¤¢¤ë; +libc4 ¤È libc5 ¤Ç¤Ï +.I SignalHandler +¤òÄêµÁ¤·¤Æ¤¤¤ë¡£ +glibc ¤Ç¤Ï +.I sig_t +¤òÄêµÁ¤·¤Æ¤ª¤ê¡¢ +.B _GNU_SOURCE +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï +.I sighandler_t +¤âÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O Without use of such a type, the declaration of +.\"O .BR signal () +.\"O is the somewhat harder to read: +¤³¤Î¤è¤¦¤Ê·¿¤ò»ÈÍѤ·¤Ê¤¤¤È¡¢ +.BR signal () +¤ÎÀë¸À¤ÏÆɤߤˤ¯¤¤¤â¤Î¤È¤Ê¤ë¡£ +.in +4n +.nf + +.BI "void ( *" signal "(int " signum ", void (*" handler ")(int)) ) (int);" +.fi +.in +.\"O .SS PORTABILITY +.SS °Ü¿¢À­ +.\"O The only portable use of +.\"O .BR signal () +.\"O is to set a signal's disposition to +.\"O .BR SIG_DFL +.\"O or +.\"O .BR SIG_IGN . +.\"O The semantics when using +.\"O .BR signal () +.\"O to establish a signal handler vary across systems +.\"O (and POSIX.1 explicitly permits this variation); +.\"O .B do not use it for this purpose. +°Ü¿¢À­¤Î¤¢¤ë +.BR signal () +¤Î»È¤¤Êý¤Ï¡¢¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤ò +.BR SIG_DFL +¤« +.BR SIG_IGN +¤ËÀßÄꤹ¤ëÊýË¡¤À¤±¤Ç¤¢¤ë¡£ +¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ë¤Î¤Ë +.BR signal () +¤ò»È¤Ã¤¿¤È¤­¤ÎÆ°ºî¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤ê°Û¤Ê¤ë +(POSIX.1 ¤ÏÌÀ¼¨Åª¤Ë¤³¤Î°ã¤¤¤òǧ¤á¤Æ¤¤¤ë)¡£ +.B "°Ü¿¢À­¤¬É¬ÍפʤȤ­¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ÈÍѤ·¤Ê¤¤¤³¤È¡£" + +.\"O POSIX.1 solved the portability mess by specifying +.\"O .BR sigaction (2), +.\"O which provides explicit control of the semantics when a +.\"O signal handler is invoked; use that interface instead of +.\"O .BR signal (). +POSIX.1 ¤Ï¡¢ +.BR sigaction (2) +¤òµ¬Äꤹ¤ë¤³¤È¤Ç°Ü¿¢À­¤Ë´Ø¤¹¤ëº®Íð¤ò²ò·è¤·¤¿¡£ +.BR sigaction (2) +¤Ï¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤ëºÝ¤ÎµóÆ°¤òÌÀ¼¨Åª¤ËÀ©¸æ¤Ç¤­¤ë¡£ +.BR signal () +¤ÎÂå¤ï¤ê¤Ë¤³¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤ò»È¤¦¤³¤È¡£ + +.\"O In the original Unix systems, when a handler that was established using +.\"O .BR signal () +.\"O was invoked by the delivery of a signal, +.\"O the disposition of the signal would be reset to +.\"O .BR SIG_DFL , +.\"O and the system did not block delivery of further instances of the signal. +.\"O System V also provides these semantics for +.\"O .BR signal (). +.\"O This was bad because the signal might be delivered again +.\"O before the handler had a chance to reestablish itself. +.\"O Furthermore, rapid deliveries of the same signal could +.\"O result in recursive invocations of the handler. +¥ª¥ê¥¸¥Ê¥ë¤Î Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR signal () +¤ò»È¤Ã¤ÆÀßÄꤵ¤ì¤¿¥Ï¥ó¥É¥é¤¬¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤Ë¤è¤êµ¯Æ°¤µ¤ì¤ë¤È¡¢ +¤½¤Î¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï +.B SIG_DFL +¤Ë¥ê¥»¥Ã¥È¤µ¤ì¡¢¥·¥¹¥Æ¥à¤ÏƱ¤¸¥·¥°¥Ê¥ë¤¬¤µ¤é¤ËÀ¸À®¤µ¤ì¤Æ¤â +¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤ò¥Ö¥í¥Ã¥¯¤·¤Ê¤«¤Ã¤¿¡£ +System V ¤Ç¤â¡¢ +.BR signal () +¤ËÂФ·¤Æ¤³¤ì¤é¤ÎµóÆ°¤òµ¬Äꤷ¤Æ¤¤¤ë¡£ +¤³¤¦¤·¤¿µóÆ°¤Ï¤Þ¤º¤¯¡¢¥Ï¥ó¥É¥é¤¬¥Ï¥ó¥É¥é¼«¿È¤òºÆÀßÄꤹ¤ëµ¡²ñ¤¬ +Íè¤ë¤è¤êÁ°¤Ë¡¢Æ±¤¸¥·¥°¥Ê¥ë¤¬¤Þ¤¿ÇÛÁ÷¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤µ¤é¤Ë¡¢Æ±¤¸¥·¥°¥Ê¥ë¤¬Î©¤Æ³¤±¤ËÇÛÁ÷¤µ¤ì¤ë¤È¡¢Æ±¤¸¥·¥°¥Ê¥ë¤¬ +¥Ï¥ó¥É¥é¤ò·«¤êÊÖ¤·µ¯Æ°¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ + +.\"O BSD improved on this situation by changing the semantics of +.\"O signal handling +.\"O (but, unfortunately, silently changed the semantics +.\"O when establishing a handler with +.\"O .BR signal ()). +.\"O On BSD, when a signal handler is invoked, +.\"O the signal disposition is not reset, +.\"O and further instances of the signal are blocked from +.\"O being delivered while the handler is executing. +BSD ¤Ç¤Ï¡¢¥·¥°¥Ê¥ë½èÍý¤ÎµóÆ°¤òÊѹ¹¤¹¤ë¤³¤È¤Ç¡¢¤³¤Î¾õ¶·¤ò²þÁ±¤·¤¿ +(¤·¤«¤·¡¢»ÄÇ°¤Ê¤³¤È¤Ë¡¢ +.BR signal () +¤ò»È¤Ã¤Æ¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤ËµóÆ°¤¬ÌۤäÆÊѹ¹¤µ¤ì¤ë)¡£ +BSD ¤Ç¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤¿ºÝ¡¢ +¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï¥ê¥»¥Ã¥È¤µ¤ì¤º¡¢ +¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¡¢Æ±¤¸¥·¥°¥Ê¥ë¤Î¤µ¤é¤Ê¤ëÀ¸À®¤ÏÇÛÁ÷¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¡£ + +.\"O The situation on Linux is as follows: +Linux ¤Ç¤Î¾õ¶·¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.IP * 2 +.\"O The kernel's +.\"O .BR signal () +.\"O system call provides System V semantics. +¥«¡¼¥Í¥ë¤Î +.BR signal () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï System V Êý¼°¤òÄ󶡤·¤Æ¤¤¤ë¡£ +.IP * +.\"O By default, in glibc 2 and later, the +.\"O .BR signal () +.\"O wrapper function does not invoke the kernel system call. +.\"O Instead, it calls +.\"O .BR sigaction (2) +.\"O using flags that supply BSD semantics. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢glibc 2 °Ê¹ß¤Ç¤Ï¡¢ +.BR signal () +¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¥«¡¼¥Í¥ë¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤·¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë¡¢¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï BSD Êý¼°¤ò¼¨¤¹¥Õ¥é¥°¤ò»È¤Ã¤Æ +.BR sigaction (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ +.\"O This default behavior is provided as long as the +.\"O .B _BSD_SOURCE +.\"O feature test macro is defined. +.\"O By default, +.\"O .B _BSD_SOURCE +.\"O is defined; +.\"O it is also implicitly defined if one defines +.\"O .BR _GNU_SOURCE , +.\"O and can of course be explicitly defined. +µ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _BSD_SOURCE +¤òÄêµÁ¤·¤Æ¤¤¤ì¤Ð¡¢¤³¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤È¤Ê¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.B _BSD_SOURCE +¤¬ÄêµÁ¤µ¤ì¤ë¡£ +.B _BSD_SOURCE +¤Ï +.B _GNU_SOURCE +¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï°ÅÌۤΤ¦¤Á¤ËÄêµÁ¤µ¤ì¡¢ +¤â¤Á¤í¤óÌÀ¼¨Åª¤ËÄêµÁ¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.sp +.\"O On glibc 2 and later, if the +.\"O .B _BSD_SOURCE +.\"O feature test macro is not defined, then +.\"O .BR signal () +.\"O provides System V semantics. +glibc 2 °Ê¹ß¤Ç¤Ï¡¢µ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _BSD_SOURCE +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +.BR signal () +¤Ï System V Êý¼°¤È¤Ê¤ë¡£ +.\"O (The default implicit definition of +.\"O .B _BSD_SOURCE +.\"O is not provided if one invokes +.\"O .BR gcc (1) +.\"O in one of its standard modes +.\"O .RI ( -std=xxx " or " -ansi ) +.\"O or defines various other feature test macros such as +.\"O .BR _POSIX_SOURCE , +.\"O .BR _XOPEN_SOURCE , +.\"O or +.\"O .BR _SVID_SOURCE ; +.\"O see +.\"O .BR feature_test_macros (7).) +.RB ( gcc (1) +¤¬É¸½à»ØÄê¥â¡¼¥É +.RI ( -std=xxx " or " -ansi ) +¤Çµ¯Æ°¤µ¤ì¤¿¾ì¹ç¡¢¤â¤·¤¯¤Ï +.BR _POSIX_SOURCE , +.BR _XOPEN_SOURCE , +.B _SVID_SOURCE +¤È¤¤¤Ã¤¿Â¾¤ÎÍÍ¡¹¤Êµ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤Î +.B _BSD_SOURCE +¤Î°ÅÌÛ¤ÎÄêµÁ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +.BR feature_test_macros (7) +¤ò»²¾È¤Î¤³¤È¡£) +.\" +.\" System V semantics are also provided if one uses the separate +.\" .BR sysv_signal (3) +.\" function. +.IP * +.\"O The +.\"O .BR signal () +.\"O function in Linux libc4 and libc5 provide System V semantics. +.\"O If one on a libc5 system includes +.\"O .I +.\"O instead of +.\"O .IR , +.\"O then +.\"O .BR signal () +.\"O provides BSD semantics. +Linux ¤Î libc4 ¤È libc5 ¤Î +.BR signal () +´Ø¿ô¤Ï System V Êý¼°¤Ç¤¢¤ë¡£ +libc5 ¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ +.I +¤Î¤«¤ï¤ê¤Ë +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤È¡¢ +.BR signal () +¤Ï +.BR __bsd_signal () +¤ËºÆÄêµÁ¤µ¤ì¡¢ +.BR signal () +¤Ï BSD Êý¼°¤È¤Ê¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (1), +.BR alarm (2), +.BR kill (2), +.BR killpg (2), +.BR pause (2), +.BR sigaction (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigqueue (2), +.BR sigsuspend (2), +.BR bsd_signal (3), +.BR raise (3), +.BR siginterrupt (3), +.BR sigsetops (3), +.BR sigvec (3), +.BR sysv_signal (3), +.BR feature_test_macros (7), +.BR signal (7) diff --git a/draft/man2/signalfd.2 b/draft/man2/signalfd.2 new file mode 100644 index 00000000..ceba3bb6 --- /dev/null +++ b/draft/man2/signalfd.2 @@ -0,0 +1,753 @@ +.\" Copyright (C) 2008 Michael Kerrisk +.\" starting from a version by 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 +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-04-06, Akihiro MOTOKI , LDP v2.79 +.\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.13 +.\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.18 +.\" +.TH SIGNALFD 2 2009-01-13 Linux "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O signalfd \- create a file descriptor for accepting signals +signalfd \- ¥·¥°¥Ê¥ë¼õ¤±ÉÕ¤±ÍѤΥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int signalfd(int " fd ", const sigset_t *" mask ", int " flags ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR signalfd () +.\"O creates a file descriptor that can be used to accept signals +.\"O targeted at the caller. +.\"O This provides an alternative to the use of a signal handler or +.\"O .BR sigwaitinfo (2), +.\"O and has the advantage that the file descriptor may be monitored by +.\"O .BR select (2), +.\"O .BR poll (2), +.\"O and +.\"O .BR epoll (7). +.BR signalfd () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ°¸¤Æ¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±ÉÕ¤±¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¥Õ¥¡¥¤¥ë +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤¹¤ë¡£ +¤³¤ÎÊýË¡¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ä +.BR sigwaitinfo (2) +¤òÍѤ¤¤ëÊýË¡¤ÎÂå¤ï¤ê¤È¤Ê¤ë¤â¤Î¤Ç¤¢¤ê¡¢¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +.BR select (2), +.BR poll (2), +.BR epoll (7) +¤Ç´Æ»ë¤Ç¤­¤ë¤È¤¤¤¦ÍøÅÀ¤¬¤¢¤ë¡£ + +.\"O The +.\"O .I mask +.\"O argument specifies the set of signals that the caller +.\"O wishes to accept via the file descriptor. +.\"O This argument is a signal set whose contents can be initialized +.\"O using the macros described in +.\"O .BR sigsetops (3). +.I mask +°ú¤­¿ô¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤¬¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤Ç¼õ¤±ÉÕ¤±¤¿¤¤ +¥·¥°¥Ê¥ë½¸¹ç¤ò»ØÄꤹ¤ë¡£¤³¤Î°ú¤­¿ô¤Ç»ØÄꤹ¤ë¥·¥°¥Ê¥ë½¸¹ç¤ÎÆâÍƤϡ¢ +.BR sigsetops (3) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥Þ¥¯¥í¤ò»È¤Ã¤Æ½é´ü²½¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O Normally, the set of signals to be received via the +.\"O file descriptor should be blocked using +.\"O .BR sigprocmask (2), +.\"O to prevent the signals being handled according to their default +.\"O dispositions. +Ä̾¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤Ç¼õ¿®¤¹¤ë¥·¥°¥Ê¥ë½¸¹ç¤Ï¡¢ +¤½¤Î¥·¥°¥Ê¥ë¤¬¥Ç¥Õ¥©¥ë¥È¤ÎÇÛÁ÷ÊýË¡¤Ë´ð¤¤¤Æ½èÍý¤µ¤ì¤ë¤Î¤òËɤ°¤¿¤á¤Ë¡¢ +.BR sigprocmask (2) +¤ò»È¤Ã¤Æ¥Ö¥í¥Ã¥¯¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O It is not possible to receive +.\"O .B SIGKILL +.\"O or +.\"O .B SIGSTOP +.\"O signals via a signalfd file descriptor; +.\"O these signals are silently ignored if specified in +.\"O .IR mask . +¥·¥°¥Ê¥ë +.B SIGKILL +¤È +.B SIGSTOP +¤ò signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤Ç¼õ¿®¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤¬ +.I mask +¤Ç»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤ÏÌۤäÆ̵»ë¤µ¤ì¤ë¡£ + +.\"O If the +.\"O .I fd +.\"O argument is \-1, +.\"O then the call creates a new file descriptor and associates the +.\"O signal set specified in +.\"O .I mask +.\"O with that descriptor. +.\"O If +.\"O .I fd +.\"O is not \-1, +.\"O then it must specify a valid existing signalfd file descriptor, and +.\"O .I mask +.\"O is used to replace the signal set associated with that descriptor. +.I fd +°ú¤­¿ô¤¬ \-1 ¤Î¾ì¹ç¡¢ +.BR signalfd () +¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤·¡¢ +.I mask +¤Ç»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤ò¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë´ØÏ¢ÉÕ¤±¤ë¡£ +.I fd +°ú¤­¿ô¤¬ \-1 °Ê³°¤Î¾ì¹ç¡¢ +.I fd +¤Ë¤ÏÍ­¸ú¤Ê´û¸¤Î signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤½¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë½¸¹ç¤Ï +.I mask +¤ò»È¤Ã¤ÆÃÖ¤­´¹¤¨¤é¤ì¤ë¡£ + +.\"O Starting with Linux 2.6.27, the following values may be bitwise ORed in +.\"O .IR flags +.\"O to change the behaviour of +.\"O .BR signalfd (): +Linux 2.6.27 °Ê¹ß¤Ç¤Ï¡¢ +°Ê²¼¤ÎÃͤΤ¤¤¯¤Ä¤«¤ò¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýÏ (OR) ¤Ç»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +.BR signalfd () +¤Î¿¶Éñ¤¤¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 14 +.B SFD_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) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.TP +.B SFD_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 +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O In Linux up to version 2.6.26, the +.\"O .I flags +.\"O argument is unused, and must be specified as zero. +¥Ð¡¼¥¸¥ç¥ó 2.6.26 °ÊÁ°¤Î Linux ¤Ç¤Ï¡¢ +.I flags +°ú¤­¿ô¤Ï̤»ÈÍѤǤ¢¤ê¡¢0 ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O .BR signalfd () +.\"O returns a file descriptor that supports the following operations: +.BR signalfd () +¤¬ÊÖ¤¹¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï°Ê²¼¤ÎÁàºî¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.TP +.BR read (2) +.\"O If one or more of the signals specified in +.\"O .I mask +.\"O is pending for the process, then the buffer supplied to +.\"O .BR read (2) +.\"O is used to return one or more +.\"O .I signalfd_siginfo +.\"O structures (see below) that describe the signals. +.\"O The +.\"O .BR read (2) +.\"O returns information for as many signals as are pending and will +.\"O fit in the supplied buffer. +.\"O The buffer must be at least +.\"O .I "sizeof(struct signalfd_siginfo)" +.\"O bytes. +.\"O The return value of the +.\"O .BR read (2) +.\"O is the total number of bytes read. +.I mask +¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î¤¦¤Á°ì¤Ä°Ê¾å¤¬¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ +½èÍýÂÔ¤Á (pending) ¤Ç¤¢¤ì¤Ð¡¢¤½¤ì¤é¤Î¥·¥°¥Ê¥ë¤Î¾ðÊó¤¬ +.BR read (2) +¤ËÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ò»È¤Ã¤Æ¡¢ +.I signalfd_siginfo +¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ +.BR read (2) +¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ²Äǽ¤ÊÈϰϤǤǤ­¤ë¤À¤±Â¿¤¯¤Î½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Ë +¤Ä¤¤¤Æ¤Î¾ðÊó¤òÊÖ¤¹¡£ +¥Ð¥Ã¥Õ¥¡¤ÏºÇÄã¤Ç¤â +.I "sizeof(struct signalfd_siginfo)" +¥Ð¥¤¥È¤ÎÂ礭¤µ¤¬¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BR read (2) +¤ÎÊÖ¤êÃͤÏÆɤ߽Фµ¤ì¤¿¥È¡¼¥¿¥ë¤Î¥Ð¥¤¥È¿ô¤Ç¤¢¤ë¡£ +.IP +.\"O As a consequence of the +.\"O .BR read (2), +.\"O the signals are consumed, +.\"O so that they are no longer pending for the process +.\"O (i.e., will not be caught by signal handlers, +.\"O and cannot be accepted using +.\"O .BR sigwaitinfo (2)). +.BR read (2) +¤¬¹Ô¤ï¤ì¤¿·ë²Ì¡¢¥·¥°¥Ê¥ë¤Ï¾ÃÈñ¤µ¤ì¡¢ +¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤Ï¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ¤Ï½èÍýÂÔ¤Á¤Ç¤Ï¤Ê¤¯¤Ê¤ë +(¤Ä¤Þ¤ê¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÇÊ᪤µ¤ì¤ë¤³¤È¤â¤Ê¤¯¡¢ +.BR sigwaitinfo (2) +¤ò»È¤Ã¤Æ¼õ¤±¼è¤ë¤³¤È¤â¤Ç¤­¤Ê¤¯¤Ê¤ë)¡£ +.IP +.\"O If none of the signals in +.\"O .I mask +.\"O is pending for the process, then the +.\"O .BR read (2) +.\"O either blocks until one of the signals in +.\"O .I mask +.\"O is generated for the process, +.\"O or fails with the error +.\"O .B EAGAIN +.\"O if the file descriptor has been made nonblocking. +.I mask +¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤¬¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ°ì¤Ä¤â½èÍýÂÔ¤Á¤Ç¤Ê¤±¤ì¤Ð¡¢ +.BR read (2) +¤Ï¡¢ +.I mask +¤Ç»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤Î¤¦¤Á¤¤¤º¤ì¤«°ì¤Ä¤¬¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤ÆȯÀ¸¤¹¤ë¤Þ¤Ç +Ää»ß (block) ¤¹¤ë¡¢¤â¤·¤¯¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÈóÄä»ß (nonblocking) +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.\"O .BR poll "(2), " select "(2) (and similar)" +.BR poll "(2), " select "(2) (¤ÈƱÍͤÎÁàºî)" +.\"O The file descriptor is readable +.\"O (the +.\"O .BR select (2) +.\"O .I readfds +.\"O argument; the +.\"O .BR poll (2) +.\"O .B POLLIN +.\"O flag) +.\"O if one or more of the signals in +.\"O .I mask +.\"O is pending for the process. +.I mask +¤Ë»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤Î¤¦¤Á°ì¤Ä°Ê¾å¤¬¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ½èÍýÂÔ¤Á¤Ç¤¢¤ì¤Ð¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÆɤ߽Ф·²Äǽ¤È¤Ê¤ë +.RB ( select (2) +¤Î +.I readfds +°ú¤­¿ô¤ä +.BR poll (2) +¤Î +.B POLLIN +¥Õ¥é¥°)¡£ +.IP +.\"O The signalfd file descriptor also supports the other file-descriptor +.\"O multiplexing APIs: +.\"O .BR pselect (2), +.\"O .BR ppoll (2), +.\"O and +.\"O .BR epoll (7). +signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤³¤ì°Ê³°¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +¿½Å API ¤Ç¤¢¤ë +.BR pselect (2), +.BR ppoll (2), +.BR epoll (7) +¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.TP +.BR close (2) +.\"O When the file descriptor is no longer required it should be closed. +.\"O When all file descriptors associated with the same signalfd object +.\"O have been closed, the resources for object are freed by the kernel. +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¤½¤ì°Ê¹ß¤ÏɬÍפʤ¯¤Ê¤Ã¤¿ºÝ¤Ë¤Ï¡¢¥¯¥í¡¼¥º¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Ʊ¤¸ signalfd ¥ª¥Ö¥¸¥§¥¯¥È¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Á´¤Æ +¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¡¢¤½¤Î¥ª¥Ö¥¸¥§¥¯¥ÈÍѤλñ¸»¤¬¥«¡¼¥Í¥ë¤Ë¤è¤ê²òÊü¤µ¤ì¤ë¡£ +.\"O .SS The signalfd_siginfo structure +.SS signalfd_siginfo ¹½Â¤ÂÎ +.\"O The format of the +.\"O .I signalfd_siginfo +.\"O structure(s) returned by +.\"O .BR read (2)s +.\"O from a signalfd file descriptor is as follows: +signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î +.BR read (2) +¤ÇÊÖ¤µ¤ì¤ë +.I signalfd_siginfo +¹½Â¤ÂΤΥե©¡¼¥Þ¥Ã¥È¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.in +4n +.nf + +struct signalfd_siginfo { +.\"O uint32_t ssi_signo; /* Signal number */ +.\"O int32_t ssi_errno; /* Error number (unused) */ +.\"O int32_t ssi_code; /* Signal code */ +.\"O uint32_t ssi_pid; /* PID of sender */ +.\"O uint32_t ssi_uid; /* Real UID of sender */ +.\"O int32_t ssi_fd; /* File descriptor (SIGIO) */ +.\"O uint32_t ssi_tid; /* Kernel timer ID (POSIX timers) +.\"O uint32_t ssi_band; /* Band event (SIGIO) */ +.\"O uint32_t ssi_overrun; /* POSIX timer overrun count */ +.\"O uint32_t ssi_trapno; /* Trap number that caused signal */ +.\"O .\" ssi_trapno is unused on most arches +.\"O int32_t ssi_status; /* Exit status or signal (SIGCHLD) */ +.\"O int32_t ssi_int; /* Integer sent by sigqueue(2) */ +.\"O uint64_t ssi_ptr; /* Pointer sent by sigqueue(2) */ +.\"O uint64_t ssi_utime; /* User CPU time consumed (SIGCHLD) */ +.\"O uint64_t ssi_stime; /* System CPU time consumed (SIGCHLD) */ +.\"O uint64_t ssi_addr; /* Address that generated signal +.\"O (for hardware-generated signals) */ +.\"O uint8_t pad[\fIX\fP]; /* Pad size to 128 bytes (allow for +.\"O additional fields in the future) */ +struct signalfd_siginfo { + uint32_t ssi_signo; /* ¥·¥°¥Ê¥ëÈÖ¹æ */ + int32_t ssi_errno; /* ¥¨¥é¡¼ÈÖ¹æ (̤»ÈÍÑ) */ + int32_t ssi_code; /* ¥·¥°¥Ê¥ë¥³¡¼¥É */ + uint32_t ssi_pid; /* Á÷¿®¸µ¤Î PID */ + uint32_t ssi_uid; /* Á÷¿®¸µ¤Î¼Â UID */ + int32_t ssi_fd; /* ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ (SIGIO) */ + uint32_t ssi_tid; /* ¥«¡¼¥Í¥ë¥¿¥¤¥Þ ID (POSIX ¥¿¥¤¥Þ) + uint32_t ssi_band; /* Band ¥¤¥Ù¥ó¥È (SIGIO) */ + uint32_t ssi_overrun; /* POSIX ¥¿¥¤¥Þ¤Î¥ª¡¼¥Ð¡¼¥é¥ó²ó¿ô */ + uint32_t ssi_trapno; /* ¥·¥°¥Ê¥ë¤Î¸¶°ø¤È¤Ê¤Ã¤¿¥È¥é¥Ã¥×ÈÖ¹æ */ +.\" ¤Û¤È¤ó¤É¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç ssi_trapno ¤Ï̤»ÈÍÑ + int32_t ssi_status; /* ½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤«¥·¥°¥Ê¥ë (SIGCHLD) */ + int32_t ssi_int; /* sigqueue(2) ¤«¤éÁ÷¤é¤ì¤¿À°¿ô */ + uint64_t ssi_ptr; /* sigqueue(2) ¤«¤éÁ÷¤é¤ì¤¿¥Ý¥¤¥ó¥¿ */ + uint64_t ssi_utime; /* ¾ÃÈñ¤·¤¿¥æ¡¼¥¶ CPU »þ´Ö (SIGCHLD) */ + uint64_t ssi_stime; /* ¾ÃÈñ¤·¤¿¥·¥¹¥Æ¥à CPU »þ´Ö (SIGCHLD) */ + uint64_t ssi_addr; /* ¥·¥°¥Ê¥ë¤òÀ¸À®¤·¤¿¥¢¥É¥ì¥¹ + (¥Ï¡¼¥É¥¦¥§¥¢¤¬À¸À®¤·¤¿¥·¥°¥Ê¥ë¤Î¾ì¹ç) */ + uint8_t pad[\fIX\fP]; /* pad ¤ÎÂ礭¤µ¤Ï 128 ¥Ð¥¤¥È + (¾­Íè¤Î¥Õ¥£¡¼¥ë¥ÉÄɲÃÍѤξì½ê¤Î³ÎÊÝ) */ +}; + +.fi +.in +.\"O Each of the fields in this structure +.\"O is analogous to the similarly named field in the +.\"O .I siginfo_t +.\"O structure. +.\"O The +.\"O .I siginfo_t +.\"O structure is described in +.\"O .BR sigaction (2). +.I signalfd_siginfo +¹½Â¤ÂΤγƥե£¡¼¥ë¥É¤Ï¡¢ +.I siginfo_t +¹½Â¤ÂΤÎƱ¤¸¤è¤¦¤Ê̾Á°¤Î¥Õ¥£¡¼¥ë¥É¤ÈƱÍͤǤ¢¤ë¡£ +.I siginfo_t +¹½Â¤ÂΤˤĤ¤¤Æ¤Ï +.BR sigaction (2) +¤ËÀâÌÀ¤¬¤¢¤ë¡£ +.\"O Not all fields in the returned +.\"O .I signalfd_siginfo +.\"O structure will be valid for a specific signal; +.\"O the set of valid fields can be determined from the value returned in the +.\"O .I ssi_code +.\"O field. +.\"O This field is the analog of the +.\"O .I siginfo_t +.\"O .I si_code +.\"O field; see +.\"O .BR sigaction (2) +.\"O for details. +ÊÖ¤µ¤ì¤¿ +.I signalfd_siginfo +¹½Â¤ÂΤÎÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤¬¤¢¤ë¥·¥°¥Ê¥ë¤ËÂФ·¤ÆÍ­¸ú¤Ê¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¤É¤Î¥Õ¥£¡¼¥ë¥É¤¬Í­¸ú¤«¤Ï¡¢ +.I ssi_code +¥Õ¥£¡¼¥ë¥É¤ÇÊÖ¤µ¤ì¤ëÃͤ«¤éȽÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï +.I siginfo_t +¤Î +.I si_code +¥Õ¥£¡¼¥ë¥É¤ÈƱÍͤǤ¢¤ë¡£¾ÜºÙ¤Ï +.BR sigaction (2) +¤ò»²¾È¡£ +.\"O .SS fork(2) semantics +.SS fork(2) ¤Ç¤Î°·¤¤ +.\"O After a +.\"O .BR fork (2), +.\"O the child inherits a copy of the signalfd file descriptor. +.\"O A +.\"O .BR read (2) +.\"O from the file descriptor in the child will return information +.\"O about signals queued to the child. +.BR fork (2) +¤¬¹Ô¤ï¤ì¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤Ï signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥³¥Ô¡¼¤ò +·Ñ¾µ¤¹¤ë¡£ +»Ò¥×¥í¥»¥¹¤Ç¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é +.BR read (2) +¤ò¹Ô¤¦¤È¡¢»Ò¥×¥í¥»¥¹¤ËÂФ¹¤ë¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë +¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SS execve(2) semantics +.SS execve(2) ¤Ç¤Î°·¤¤ +.\"O Just like any other file descriptor, +.\"O a signalfd file descriptor remains open across an +.\"O .BR execve (2), +.\"O unless it has been marked for close-on-exec (see +.\"O .BR fcntl (2)). +.\"O Any signals that were available for reading before the +.\"O .BR execve (2) +.\"O remain available to the newly loaded program. +.\"O (This is analogous to traditional signal semantics, +.\"O where a blocked signal that is pending remains pending across an +.\"O .BR execve (2).) +¾¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÈÁ´¤¯Æ±Íͤˡ¢ +signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤â +.BR execve (2) +¤ÎÁ°¸å¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤¿¤Þ¤Þ¤È¤Ê¤ë¡£Ã¢¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë +close-on-exec ¤Î¥Þ¡¼¥¯ +.RB ( fcntl (2) +»²¾È) ¤¬ÉÕ¤¤¤Æ¤¤¤ë¾ì¹ç¤Ï¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.BR execve (2) +¤ÎÁ°¤ËÆɤ߽Ф·²Äǽ¤È¤Ê¤Ã¤Æ¤¤¤¿Á´¤Æ¤Î¥·¥°¥Ê¥ë¤Ï¿·¤·¤¯µ¯Æ°¤µ¤ì¤¿¥×¥í¥°¥é¥à +¤Ç¤â°ú¤­Â³¤­Æɤ߽Ф·²Äǽ¤Ç¤¢¤ë +(¤³¤ì¤ÏÅÁÅýŪ¤Ê¥·¥°¥Ê¥ë¤Î°·¤¤¤ÈƱ¤¸¤Ç¤¢¤ê¡¢ +½èÍýÂÔ¤Á¤Î¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ï +.BR execve (2) +¤ÎÁ°¸å¤Ç½èÍýÂÔ¤Á¤Î¤Þ¤Þ¤È¤Ê¤ë)¡£ +.\"O .SS Thread semantics +.SS ¥¹¥ì¥Ã¥É¤Ç¤Î°·¤¤ +.\"O The semantics of signalfd file descriptors in a multithreaded program +.\"O mirror the standard semantics for signals. +.\"O In other words, +.\"O when a thread reads from a signalfd file descriptor, +.\"O it will read the signals that are directed to the thread +.\"O itself and the signals that are directed to the process +.\"O (i.e., the entire thread group). +.\"O (A thread will not be able to read signals that are directed +.\"O to other threads in the process.) +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥°¥é¥à¤Ë¤ª¤±¤ë signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î°·¤¤¤Ï +¥·¥°¥Ê¥ë¤Îɸ½àŪ¤Ê°·¤¤¤ÈÁ´¤¯Æ±¤¸¤Ç¤¢¤ë¡£ +¸À¤¤´¹¤¨¤ë¤È¡¢¤¢¤ë¥¹¥ì¥Ã¥É¤¬ signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é +Æɤ߽Ф·¤ò¹Ô¤¦¤È¡¢¤½¤Î¥¹¥ì¥Ã¥É¼«¿È°¸¤Æ¤Î¥·¥°¥Ê¥ë¤È¥×¥í¥»¥¹ (¤¹¤Ê¤ï¤Á +¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×Á´ÂÎ) °¸¤Æ¤Î¥·¥°¥Ê¥ë¤¬Æɤ߽Фµ¤ì¤ë¡£ +(¥¹¥ì¥Ã¥É¤ÏƱ¤¸¥×¥í¥»¥¹¤Î¾¤Î¥¹¥ì¥Ã¥É°¸¤Æ¤Î¥·¥°¥Ê¥ë¤òÆɤ߽Ф¹¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£) +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR signalfd () +.\"O returns a signalfd file descriptor; +.\"O this is either a new file descriptor (if +.\"O .I fd +.\"O was \-1), or +.\"O .I fd +.\"O if +.\"O .I fd +.\"O was a valid signalfd file descriptor. +.\"O On error, \-1 is returned and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR signalfd () +¤Ï signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +ÊÖ¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢ +.IR fd +¤¬ \-1 ¤Î¾ì¹ç¤Ï¿·µ¬¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ê¡¢ +.I fd +¤¬Í­¸ú¤Ê signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤À¤Ã¤¿¾ì¹ç¤Ï +.I fd +¼«¿È¤Ç¤¢¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O The +.\"O .I fd +.\"O file descriptor is not a valid file descriptor. +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O .I fd +.\"O is not a valid signalfd file descriptor. +.I fd +¤¬Í­¸ú¤Ê signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.\" or, the +.\" .I sizemask +.\" argument is not equal to +.\" .IR sizeof(sigset_t) ; +.TP +.B EINVAL +.\"O .I flags +.\"O is invalid; +.\"O or, in Linux 2.6.26 or earlier, +.\"O .I flags +.\"O is nonzero. +.I flags +¤¬Ìµ¸ú¡£ +Linux 2.6.26 °ÊÁ°¤Ç¤Ï¡¢ +.I flags +¤¬ 0 °Ê³°¤ÎÃÍ¡£ +.TP +.B EMFILE +.\"O The per-process limit of open file descriptors has been reached. +¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô¤¬¥×¥í¥»¥¹¤¢¤¿¤ê¤Î¾å¸Â¤Ë +㤷¤Æ¤¤¤¿¡£ +.TP +.B ENFILE +.\"O The system-wide limit on the total number of open files has been +.\"O reached. +¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ëÁí¿ô¤¬¥·¥¹¥Æ¥àÁ´ÂΤξå¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENODEV +.\"O Could not mount (internal) anonymous inode device. +(¥«¡¼¥Í¥ëÆâ¤Î) ̵̾ inode ¥Ç¥Ð¥¤¥¹¤ò¥Þ¥¦¥ó¥È¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O There was insufficient memory to create a new signalfd file descriptor. +¿·¤·¤¤ signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR signalfd () +.\"O is available on Linux since kernel 2.6.22. +.\"O Working support is provided in glibc since version 2.8. +.BR signalfd () +¤Ï¥«¡¼¥Í¥ë 2.6.22 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +Àµ¤·¤¯Æ°ºî¤¹¤ë glibc ¦¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.8 °Ê¹ß¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\" signalfd() is in glibc 2.7, but reportedly does not build +.\"O The +.\"O .BR signalfd4 () +.\"O system call (see NOTES) is available on Linux since kernel 2.6.27. +.BR signalfd4 () +¥·¥¹¥Æ¥à¥³¡¼¥ë (¡ÖÃí°Õ¡×»²¾È) ¤Ï +¥«¡¼¥Í¥ë 2.6.27 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O .BR signalfd () +.\"O and +.\"O .BR signalfd4 () +.\"O are Linux-specific. +.BR signalfd () +¤È +.BR signalfd4 () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The underlying Linux system call requires an additional argument, +.\"O .IR "size_t sizemask" , +.\"O which specifies the size of the +.\"O .I mask +.\"O argument. +.\"O The glibc +.\"O .BR signalfd () +.\"O wrapper function does not include this argument, +.\"O since it provides the required value for the underlying system call. +¼ÂºÝ¤Î Linux ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤Ï +.I "size_t sizemask" +¤È¤¤¤¦°ú¤­¿ô¤¬ÄɲäÇɬÍפǤ¢¤ë¡£¤³¤Î°ú¤­¿ô¤Ç +.I mask +¤Î¥µ¥¤¥º¤ò»ØÄꤹ¤ë¡£ +glibc ¤Î +.BR signalfd () +¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ë¤Ï¤³¤Î°ú¤­¿ô¤Ï´Þ¤Þ¤ì¤º¡¢ +¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬É¬ÍפÊÃͤò·×»»¤·¤ÆÆâÉô¤Ç¸Æ¤Ó½Ð¤¹¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÄ󶡤¹¤ë¡£ + +.\"O A process can create multiple signalfd file descriptors. +.\"O This makes it possible to accept different signals +.\"O on different file descriptors. +.\"O (This may be useful if monitoring the file descriptors using +.\"O .BR select (2), +.\"O .BR poll (2), +.\"O or +.\"O .BR epoll (7): +.\"O the arrival of different signals will make different descriptors ready.) +.\"O If a signal appears in the +.\"O .I mask +.\"O of more than one of the file descriptors, then occurrences +.\"O of that signal can be read (once) from any one of the descriptors. +°ì¤Ä¤Î¥×¥í¥»¥¹¤ÏÊ£¿ô¤Î signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢°Û¤Ê¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç°Û¤Ê¤ë¥·¥°¥Ê¥ë¤ò¼õ¤±¼è¤ë¤³¤È¤¬ +¤Ç¤­¤ë (¤³¤Îµ¡Ç½¤Ï +.BR select (2), +.BR poll (2), +.BR epoll (7) +¤ò»È¤Ã¤Æ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò´Æ»ë¤¹¤ë¾ì¹ç¤ËÍ­ÍѤ«¤â¤·¤ì¤Ê¤¤¡£ +°Û¤Ê¤ë¥·¥°¥Ê¥ë¤¬ÅþÃ夹¤ë¤È¡¢°Û¤Ê¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÍøÍѲÄǽ¤Ë +¤Ê¤ë¤«¤é¤À)¡£ +°ì¤Ä¤Î¥·¥°¥Ê¥ë¤¬Æó¤Ä°Ê¾å¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î +.I mask +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤Î¥·¥°¥Ê¥ë¤ÎȯÀ¸¤Ï¤½¤Î¥·¥°¥Ê¥ë¤ò +.I mask +¤Ë´Þ¤à¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¦¤Á¤¤¤º¤ì¤«°ì¤Ä¤«¤éÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SS Underlying Linux system calls +.SH ²¼Áؤˤ¢¤ë Linux ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë +.\"O There are two underlying Linux system calls: +.\"O .BR signalfd () +.\"O and the more recent +.\"O .BR signalfd4 (). +.\"O The former system call does not implement a +.\"O .I flags +.\"O argument. +.\"O The latter system call implements the +.\"O .I flags +.\"O values described above. +²¼Áؤˤ¢¤ë Linux ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÆó¼ïÎढ¤ê¡¢ +.BR signalfd () +¤È¡¢¤â¤Ã¤È¿·¤·¤¤ +.BR signalfd4 () +¤Ç¤¢¤ë¡£ +.BR signalfd () +¤Ï +.I flags +°ú¤­¿ô¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¡£ +.BR signalfd4 () +¤Ç¤Ï¾åµ­¤ÎÃͤΠ+.I flags +¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O Starting with glibc 2.9, the +.\"O .BR signalfd () +.\"O wrapper function will use +.\"O .BR signalfd4 () +.\"O where it is available. +glibc 2.9 °Ê¹ß¤Ç¤Ï¡¢ +.BR signalfd () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢ +.BR signalfd4 () +¤¬ÍøÍѲÄǽ¤Ç¤¢¤ì¤Ð¡¢¤³¤ì¤ò»ÈÍѤ¹¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O In kernels before 2.6.25, the +.\"O .I ssi_ptr +.\"O and +.\"O .I ssi_int +.\"O fields are not filled in with the data accompanying a signal sent by +.\"O .BR sigqueue (2). +¥«¡¼¥Í¥ë 2.6.25 ¤è¤êÁ°¤Ç¤Ï¡¢ +.BR sigqueue (2) +¤Ë¤è¤êÁ÷¿®¤µ¤ì¤¿¥·¥°¥Ê¥ë¤È°ì½ï¤ËÅϤµ¤ì¤ë¥Ç¡¼¥¿¤Ç¤Ï¡¢¥Õ¥£¡¼¥ë¥É +.I ssi_ptr +¤È +.I ssi_int +¤ÏÀßÄꤵ¤ì¤Ê¤¤¡£ +.\" The fix also was put into 2.6.24.5 +.\"O .SH EXAMPLE +.SH Îã +.\"O The program below accepts the signals +.\"O .B SIGINT +.\"O and +.\"O .B SIGQUIT +.\"O via a signalfd file descriptor. +.\"O The program terminates after accepting a +.\"O .B SIGQUIT +.\"O signal. +.\"O The following shell session demonstrates the use of the program: +²¼µ­¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥·¥°¥Ê¥ë +.B SIGINT +¤È +.B SIGQUIT +¤ò signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤Ç¼õ¿®¤¹¤ë¡£ +¥·¥°¥Ê¥ë +.B SIGQUIT +¼õ¿®¸å¤Ë¥×¥í¥°¥é¥à¤Ï½ªÎ»¤¹¤ë¡£ +°Ê²¼¤Ë¼¨¤¹¥·¥§¥ë¥»¥Ã¥·¥ç¥ó¤Ë¤³¤Î¥×¥í¥°¥é¥à¤Î»È¤¤Êý¤ò¼¨¤¹¡£ +.in +4n +.nf + +.RB "$" " ./signalfd_demo" +.BR "^C" " # Control\-C generates SIGINT" +Got SIGINT +.B ^C +Got SIGINT +\fB^\\\fP # Control\-\\ generates SIGQUIT +Got SIGQUIT +$ +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int +main(int argc, char *argv[]) +{ + sigset_t mask; + int sfd; + struct signalfd_siginfo fdsi; + ssize_t s; + + sigemptyset(&mask); + sigaddset(&mask, SIGINT); + sigaddset(&mask, SIGQUIT); + + /* Block signals so that they aren\(aqt handled + according to their default dispositions */ + + if (sigprocmask(SIG_BLOCK, &mask, NULL) == \-1) + handle_error("sigprocmask"); + + sfd = signalfd(\-1, &mask, 0); + if (sfd == \-1) + handle_error("signalfd"); + + for (;;) { + s = read(sfd, &fdsi, sizeof(struct signalfd_siginfo)); + if (s != sizeof(struct signalfd_siginfo)) + handle_error("read"); + + if (fdsi.ssi_signo == SIGINT) { + printf("Got SIGINT\\n"); + } else if (fdsi.ssi_signo == SIGQUIT) { + printf("Got SIGQUIT\\n"); + exit(EXIT_SUCCESS); + } else { + printf("Read unexpected signal\\n"); + } + } +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR eventfd (2), +.BR poll (2), +.BR read (2), +.BR select (2), +.BR sigaction (2), +.BR sigprocmask (2), +.BR sigwaitinfo (2), +.BR timerfd_create (2), +.BR sigsetops (3), +.BR sigwait (3), +.BR epoll (7), +.BR signal (7) diff --git a/draft/man2/sigpending.2 b/draft/man2/sigpending.2 new file mode 100644 index 00000000..1f6808c4 --- /dev/null +++ b/draft/man2/sigpending.2 @@ -0,0 +1,134 @@ +.\" Copyright (c) 2005 Michael Kerrisk +.\" based on earlier work by faith@cs.unc.edu and +.\" Mike Battersby +.\" +.\" 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-09-15, mtk, Created new page by splitting off from sigaction.2 +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-10-03, Akihiro MOTOKI +.\" Updated 2005-12-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.16 +.\" +.\"WORD: pending ½èÍýÂÔ¤Á¤Î +.\" +.TH SIGPENDING 2 2008-10-04 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigpending \- examine pending signals +sigpending \- ½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Î¸¡ºº +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int sigpending(sigset_t *" set ); +.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 sigpending (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.PP +.\"O .BR sigpending () +.\"O returns the set of signals that are pending for delivery to the calling +.\"O thread (i.e., the signals which have been raised while blocked). +.\"O The mask of pending signals is returned in +.\"O .IR set . +.BR sigpending () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤Ø¤ÎÇÛÁ÷¤òÂԤäƤ¤¤ë (pending) ¥·¥°¥Ê¥ë½¸¹ç +(¤¹¤Ê¤ï¤Á¡¢¶Ø»ßÃæ¤ËȯÀ¸¤·¤¿¥·¥°¥Ê¥ë) ¤òÊÖ¤¹¡£ +½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Î¥Þ¥¹¥¯¤¬ +.I set +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR sigpending () +.\"O returns 0 on success and \-1 on error. +.BR sigpending () +¤ÏÀ®¸ù¤¹¤ì¤Ð 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤Ê¤é¤Ð \-1 ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O .I set +.\"O points to memory which is not a valid part of the process address space. +.I set +¤¬»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤¬¡¢¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ÎÍ­¸ú¤ÊÉôʬ¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O See +.\"O .BR sigsetops (3) +.\"O for details on manipulating signal sets. +¥·¥°¥Ê¥ë½¸¹ç¤ÎÁàºî¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï +.BR sigsetops (3) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"O The set of signals that is pending for a thread +.\"O is the union of the set of signals that is pending for that thread +.\"O and the set of threads that is pending for the process as a whole; see +.\"O .BR signal (7). +¤¢¤ë¥¹¥ì¥Ã¥É¤ËÂФ¹¤ë½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Î½¸¹ç¤Ï¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¼«ÂΤؤνèÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤È¡¢¥×¥í¥»¥¹Á´ÂΤؤνèÍýÂÔ¤Á¤Î +¥·¥°¥Ê¥ë½¸¹ç¤ò¤¢¤ï¤»¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.BR signal (7) +»²¾È¡£ + +.\"O A child created via +.\"O .BR fork (2) +.\"O initially has an empty pending signal set; +.\"O the pending signal set is preserved across an +.\"O .BR execve (2). +.BR fork (2) +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Î½èÍýÂÔ¤Á¥·¥°¥Ê¥ë½¸¹ç¤ÏºÇ½é¤Ï¶õ¤Ç¤¢¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¡¢½èÍýÂÔ¤Á¥·¥°¥Ê¥ë½¸¹ç¤ÏÊÝ»ý¤µ¤ì¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O In versions of glibc up to and including 2.2.1, +.\"O there is a bug in the wrapper function for +.\"O .BR sigpending () +.\"O which means that information about pending real-time signals +.\"O is not correctly returned. +¥Ð¡¼¥¸¥ç¥ó 2.2.1 °ÊÁ°¤Î glibc ¤Ç¤Ï¡¢ +.BR sigpending () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ë¡¢½èÍýÂÔ¤Á¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤¬ +Àµ¤·¤¯ÊÖ¤µ¤ì¤Ê¤¤¤È¤¤¤¦¥Ð¥°¤¬¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigaction (2), +.BR signal (2), +.BR sigprocmask (2), +.BR sigsuspend (2), +.BR sigsetops (3), +.BR signal (7) diff --git a/draft/man2/sigprocmask.2 b/draft/man2/sigprocmask.2 new file mode 100644 index 00000000..aa8909a7 --- /dev/null +++ b/draft/man2/sigprocmask.2 @@ -0,0 +1,223 @@ +.\" Copyright (c) 2005 Michael Kerrisk +.\" based on earlier work by faith@cs.unc.edu and +.\" Mike Battersby +.\" +.\" 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-09-15, mtk, Created new page by splitting off from sigaction.2 +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-10-03, Akihiro MOTOKI +.\" +.TH SIGPROCMASK 2 2008-10-17 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigprocmask \- examine and change blocked signals +sigprocmask \- ¶Ø»ß¤¹¤ë¥·¥°¥Ê¥ë¤Î³Îǧ¤ÈÊѹ¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int sigprocmask(int " how ", const sigset_t *" set , +.BI "sigset_t *" oldset ); +.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 sigprocmask (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sigprocmask () +.\"O is used to fetch and/or change the signal mask of the calling thread. +.\"O The signal mask is the set of signals whose delivery is currently +.\"O blocked for the caller +.\"O (see also +.\"O .BR signal (7) +.\"O for more details). +.BR sigprocmask () +¤ò»È¤¦¤È¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Î¼èÆÀ/Êѹ¹¤¬¤Ç¤­¤ë¡£ +¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤ËÂФ·¤Æ¸½ºßÇÛÁ÷¤¬¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î +½¸¹ç¤Î¤³¤È¤Ç¤¢¤ë (¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR signal (7) +¤â»²¾È¤Î¤³¤È)¡£ + +.\"O The behavior of the call is dependent on the value of +.\"O .IR how , +.\"O as follows. +¤³¤Î¥³¡¼¥ë¤ÎÆ°ºî¤Ï +.I how +¤ÎÃͤˤè¤Ã¤Æ·è¤Þ¤ë: +.TP +.B SIG_BLOCK +.\"O The set of blocked signals is the union of the current set and the +.\"O .I set +.\"O argument. +¶Ø»ß¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î½¸¹ç¤Ï¸½ºß¤ÎÃÍ¤È +.I set +°ú¤­¿ô¤ò·ë¹ç¤·¤¿¤â¤Î¤È¤Ê¤ë¡£ +.TP +.B SIG_UNBLOCK +.\"O The signals in +.\"O .I set +.\"O are removed from the current set of blocked signals. +.\"O It is permissible to attempt to unblock a signal which is not blocked. +¸½ºß¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½¸¹ç¤«¤é +.I set +¤Ë¤¢¤ë¥·¥°¥Ê¥ë¤ò¼è¤ê½ü¤¯¡£¶Ø»ß¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤ò¼è¤ê½ü¤³¤¦¤È +¤¹¤ë¤³¤È¤âǧ¤á¤é¤ì¤Æ¤¤¤ë¡£ +.TP +.B SIG_SETMASK +.\"O The set of blocked signals is set to the argument +.\"O .IR set . +¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½¸¹ç¤Ë +.I set +°ú¤­¿ô¤òÀßÄꤹ¤ë¡£ +.PP +.\"O If +.\"O .I oldset +.\"O is non-NULL, the previous value of the signal mask is stored in +.\"O .IR oldset . +.I oldset +¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Îº£¤Þ¤Ç¤ÎÃͤò +.I oldset +¤Ë³ÊǼ¤¹¤ë¡£ + +.\"O If +.\"O .I set +.\"O is NULL, then the signal mask is unchanged (i.e., +.\"O .I how +.\"O is ignored), +.\"O but the current value of the signal mask is nevertheless returned in +.\"O .I oldset +.\"O (if it is not NULL). +.I set +¤¬ NULL ¤Ç¤¢¤ì¤Ð¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÏÊѹ¹¤µ¤ì¤Ê¤¤ (¤¹¤Ê¤ï¤Á¡¢ +.I how +¤Ï̵»ë¤µ¤ì¤ë)¡£ +.I set +¤ÎÃͤˤ«¤«¤ï¤é¤º¡¢¸½ºß¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÎÃÍ¤Ï +.I oldset +¤ËÆþ¤ì¤ÆÊÖ¤µ¤ì¤ë (⤷¡¢ +.I oldset +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç)¡£ + +.\"O The use of +.\"O .BR sigprocmask () +.\"O is unspecified in a multithreaded process; see +.\"O .BR pthread_sigmask (3). +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Î¥×¥í¥»¥¹¤Ç +.BR sigprocmask () +¤ò»ÈÍѤ·¤¿¾ì¹ç¤ÎÆ°ºî¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.BR pthread_sigmask (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR sigprocmask () +.\"O returns 0 on success and \-1 on error. +.BR sigprocmask () +¤ÏÀ®¸ù¤¹¤ì¤Ð 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤Ê¤é¤Ð \-1 ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.B EINVAL +.\"O The value specified in +.\"O .I how +.\"O was invalid. +.I how +¤Ë»ØÄꤵ¤ì¤¿Ãͤ¬Í­¸ú¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O It is not possible to block +.\"O .BR SIGKILL " or " SIGSTOP . +.\"O Attempts to do so are silently ignored. +.B SIGKILL +¤ä +.B SIGSTOP +¤ò¶Ø»ß¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¶Ø»ß¤·¤è¤¦¤È¤·¤Æ¤âÌۤäÆ̵»ë¤µ¤ì¤ë¡£ + +.\"O Each of the threads in a process has its own signal mask. +¥×¥í¥»¥¹Æâ¤Î³Æ¥¹¥ì¥Ã¥É¤Ï¤½¤ì¤¾¤ìÀìÍѤΥ·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò»ý¤Ä¡£ + +.\"O A child created via +.\"O .BR fork (2) +.\"O inherits a copy of its parent's signal mask; +.\"O the signal mask is preserved across +.\"O .BR execve (2). +.BR fork (2) +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÏÊÝ»ý¤µ¤ì¤ë¡£ + +.\"O If +.\"O .BR SIGBUS , +.\"O .BR SIGFPE , +.\"O .BR SIGILL , +.\"O or +.\"O .B SIGSEGV +.\"O are generated +.\"O while they are blocked, the result is undefined, +.\"O unless the signal was generated by the +.\"O .BR kill (2), +.\"O .BR sigqueue (2), +.\"O or +.\"O .BR raise (3). +¥·¥°¥Ê¥ë +.BR SIGBUS , +.BR SIGFPE , +.BR SIGILL , +.B SIGSEGV +¤¬¶Ø»ß¤µ¤ì¤Æ¤¤¤ë´Ö¤ËÀ¸À®¤µ¤ì¤¿¾ì¹ç¤Ç¡¢ +¤½¤Î¥·¥°¥Ê¥ë¤¬ +.BR kill (2), +.BR sigqueue (2), +.BR raise (3) +¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤Ê¤¤¤È¤­¤Ë¤Ï¡¢ +¤½¤Î¸å¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.PP +.\"O See +.\"O .BR sigsetops (3) +.\"O for details on manipulating signal sets. +¥·¥°¥Ê¥ë½¸¹ç¤ÎÁàºî¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï +.BR sigsetops (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR pause (2), +.BR sigaction (2), +.BR signal (2), +.BR sigpending (2), +.BR sigqueue (2), +.BR sigsuspend (2), +.BR pthread_sigmask (3), +.BR sigsetops (3), +.BR signal (7) diff --git a/draft/man2/sigqueue.2 b/draft/man2/sigqueue.2 new file mode 100644 index 00000000..a2a2c994 --- /dev/null +++ b/draft/man2/sigqueue.2 @@ -0,0 +1,256 @@ +.\" 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. +.\" +.\" added note on self-signaling, aeb, 2002-06-07 +.\" added note on CAP_KILL, mtk, 2004-06-16 +.\" +.\" Japanese Version Copyright (c) 2002, 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated 2002-08-06, Yuichi SATO +.\" Updated & Modified 2005-01-08, Yuichi SATO +.\" Updated 2007-09-08, Akihiro MOTOKI , LDP v2.64 +.\" +.TH SIGQUEUE 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigqueue, rt_sigqueueinfo \- queue a signal and data to a process +sigqueue, rt_sigqueueinfo \- ¥·¥°¥Ê¥ë¤È¥Ç¡¼¥¿¤ò¥×¥í¥»¥¹¤ËÁ÷¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int sigqueue(pid_t " pid ", int " sig ", const union sigval " value ); +.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 sigqueue (): +_POSIX_C_SOURCE\ >=\ 199309L +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sigqueue () +.\"O sends the signal specified in +.\"O .I sig +.\"O to the process whose PID is given in +.\"O .IR pid . +.BR sigqueue () +¤Ï +.I sig +¤Ç»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤ò¡¢PID ¤¬ +.I pid +¤Ç¤¢¤ë¥×¥í¥»¥¹¤ËÁ÷¤ë¡£ +.\"O The permissions required to send a signal are the same as for +.\"O .BR kill (2). +¥·¥°¥Ê¥ë¤òÁ÷¤ë¤Î¤ËɬÍפʸ¢¸Â¤Ï +.BR kill (2) +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.\"O As with +.\"O .BR kill (2), +.\"O the null signal (0) can be used to check if a process with a given +.\"O PID exists. +.BR kill (2) +¤ÈƱÍͤˡ¢¥Ì¥ë¡¦¥·¥°¥Ê¥ë (0) ¤ò»È¤Ã¤Æ +»ØÄꤷ¤¿ PID ¤Î¥×¥í¥»¥¹¤¬Â¸ºß¤¹¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O The +.\"O .I value +.\"O argument is used to specify an accompanying item of data (either an integer +.\"O or a pointer value) to be sent with the signal, and has the following type: +.I value +°ú¤­¿ô¤Ï¥·¥°¥Ê¥ë¤È°ì½ï¤ËÁ÷¤ë¥Ç¡¼¥¿¤ÎÉÕ°¥¢¥¤¥Æ¥à¤ò»ØÄꤹ¤ë¡£ +.I value +¤Ï (À°¿ô¤Þ¤¿¤Ï¥Ý¥¤¥ó¥¿¤ÎÃͤǤ¢¤ê) °Ê²¼¤Î¤è¤¦¤Ê·¿¤Ç¤¢¤ë¡£ +.sp +.in +4n +.nf +union sigval { + int sival_int; + void *sival_ptr; +}; +.fi +.in + +.\"O If the receiving process has installed a handler for this signal using the +.\"O .B SA_SIGINFO +.\"O flag to +.\"O .BR sigaction (2), +.\"O then it can obtain this data via the +.\"O .I si_value +.\"O field of the +.\"O .I siginfo_t +.\"O structure passed as the second argument to the handler. +¼õ¼èÀè¤Î¥×¥í¥»¥¹¤Ë¡¢¤³¤Î¥·¥°¥Ê¥ë¤ËÂФ¹¤ë¥Ï¥ó¥É¥é¤ò +.RB ( sigaction (2) +¤Ë +.B SA_SIGINFO +¤ò»ØÄꤷ¤Æ) ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤ª¤¯¤È¡¢ +¤½¤Î¥Ï¥ó¥É¥é¤ÎÂè 2 °ú¤­¿ô¤ËÅϤµ¤ì¤ë +.I siginfo_t +¹½Â¤ÂΤΠ+.I si_value +¥Õ¥£¡¼¥ë¥É¤Ë¤è¤Ã¤Æ¡¢¤³¤Î¥Ç¡¼¥¿¤ò¼èÆÀ¤Ç¤­¤ë¡£ +.\"O Furthermore, the +.\"O .I si_code +.\"O field of that structure will be set to +.\"O .BR SI_QUEUE . +¤µ¤é¤Ë¡¢¤³¤Î¹½Â¤ÂΤΠ+.I si_code +¥Õ¥£¡¼¥ë¥É¤Ï +.B SI_QUEUE +¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR sigqueue () +.\"O returns 0, indicating that the signal was successfully +.\"O queued to the receiving process. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR sigqueue () +¤Ï 0 ¤òÊÖ¤¹¡£ +¤³¤ì¤Ï¼õ¤±¼è¤ê¦¥×¥í¥»¥¹¤ÎÂÔ¤Á¹ÔÎó¤Ë +¥·¥°¥Ê¥ë¤¬Àµ¤·¤¯Æþ¤ì¤é¤ì¤¿¤³¤È¤ò¼¨¤¹¡£ +.\"O Otherwise \-1 is returned and +.\"O .I errno +.\"O is set to indicate the error. +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¥¨¥é¡¼¤òɽ¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.\"O The limit of signals which may be queued has been reached. +ÂÔ¤Á¹ÔÎó¤ËÆþ¤ì¤é¤ì¤ë¥·¥°¥Ê¥ë¤ÎºÇÂç¿ô¤Ë㤷¤¿ +.\"O (See +.\"O .BR signal (7) +.\"O for further information.) +(¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR signal (7) +¤ò»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EINVAL +.\"O .I sig +.\"O was invalid. +.I sig +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EPERM +.\"O The process does not have permission to send the signal +.\"O to the receiving process. +¤³¤Î¥×¥í¥»¥¹¤Ë¤Ï¡¢¼õ¤±¼è¤ê¦¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¸¢¸Â¤¬¤Ê¤¤¡£ +.\"O For the required permissions, see +.\"O .BR kill (2). +ɬÍפʸ¢¸Â¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR kill (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.B ESRCH +.\"O No process has a PID matching +.\"O .IR pid . +.I pid +¤Ë¥Þ¥Ã¥Á¤¹¤ë PID ¤Î¥×¥í¥»¥¹¤¬¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O This system call first appeared in Linux 2.2. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.2 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O If this function results in the sending of a signal to the process +.\"O that invoked it, and that signal was not blocked by the calling thread, +.\"O and no other threads were willing to handle this signal (either by +.\"O having it unblocked, or by waiting for it using +.\"O .BR sigwait (3)), +.\"O then at least some signal must be delivered to this thread before this +.\"O function returns. +.\"Osato: +.\"Osato: ¤³¤Îʸ¾Ï¤ÏŤ¹¤®¤ë¤Î¤È it ¤¬Â¿¤¹¤®¤ë¤¿¤á¤ËÎɤ¯Ê¬¤«¤ê¤Þ¤»¤ó¡£ +.\"Osato: that invoked it ( = this function) +.\"Osato: by having it ( = that signal) unblocked +.\"Osato: by waiting for it ( = that signal) using sigwait(3) +.\"Osato: ¤È¤·¤ÆÌõ¤·¤Æ¤ß¤Þ¤·¤¿¡£ +.\"Osato: ¾Ü¤·¤¤Êý¤«¤é¤Î¸æ»ØŦ¤ò¤ªÂÔ¤Á¤·¤Þ¤¹¡£ +.\"Osato: +¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ë¤³¤Î´Ø¿ô¤¬¥·¥°¥Ê¥ë¤òÁ÷¤Ã¤¿¤È¤­¤Ë¡¢ +¥·¥°¥Ê¥ë¤¬¸Æ¤Ó½Ð¤·Â¦¥¹¥ì¥Ã¥É¤Ë¥Ö¥í¥Ã¥¯¤µ¤ì¤º¡¢ +¤«¤Ä (¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Ê¤«¤Ã¤¿¡¢¤Þ¤¿¤Ï +.BR sigwait (3) +¤ò»ÈÍѤ¹¤ë¤Î¤òÂԤäƤ¤¤ë¤³¤È¤Ë¤è¤ê) +¤³¤Î¥·¥°¥Ê¥ë¤ò°·¤¦¥¹¥ì¥Ã¥É¤¬²¿¤â¤Ê¤¤¾ì¹ç¤Ï¡¢ +¤³¤Î´Ø¿ô¤¬¥ê¥¿¡¼¥ó¤¹¤ëÁ°¤Ë¡¢¾¯¤Ê¤¯¤È¤â +¤½¤Î¥¹¥ì¥Ã¥É¤ËÂФ·¤Æ¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O On Linux, the underlying system call is actually named +.\"O .BR rt_sigqueueinfo (), +.\"O and differs in its third argument, which is the +.\"O .I siginfo_t +.\"O structure that will be supplied to the receiving process's +.\"O signal handler or returned by the receiving process's +.\"O .BR sigtimedwait (2) +.\"O call. +.\"O Inside the glibc +.\"O .BR sigqueue () +.\"O wrapper, this argument, +.\"O .IR info , +.\"O is initialized as follows: +Linux ¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤µ¤ì¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î̾Á°¤Ï¼ÂºÝ¤Ë¤Ï +.BR rt_sigqueueinfo () +¤Ç¤¢¤ë¡£ +.BR rt_sigqueueinfo () +¤Ç¤Ï 3 ÈÖÌܤΰú¤­¿ô¤Ë°ã¤¤¤¬¤¢¤ê¡¢ +.I siginfo_t +¹½Â¤ÂΤǤ¢¤ë¡£ +.I siginfo_t +¹½Â¤ÂΤϡ¢¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ËÅϤµ¤ì¤¿¤ê¡¢ +¥·¥°¥Ê¥ë¼õ¿®¥×¥í¥»¥¹¤Î +.BR sigtimedwait (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤«¤éÊÖ¤µ¤ì¤¿¤ê¤¹¤ë¡£ +glibc ¤Î +.BR sigqueue () +¥é¥Ã¥Ñ¡¼´Ø¿ôÆâÉô¤Ç¤Ï¡¢ +¤³¤Î°ú¤­¿ô +.I info +¤Ï°Ê²¼¤Î¤è¤¦¤Ë½é´ü²½¤µ¤ì¤ë¡£ +.in +4n +.nf + +info.si_signo = sig; /* argument supplied to sigqueue() */ +info.si_code = SI_QUEUE; +info.si_pid = getpid(); /* Process ID of sender */ +info.si_uid = getuid(); /* Real UID of sender */ +info.si_value = val; /* argument supplied to sigqueue() */ +.fi +.in +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigaction (2), +.BR signal (2), +.BR sigwait (3), +.BR signal (7) diff --git a/draft/man2/sigreturn.2 b/draft/man2/sigreturn.2 new file mode 100644 index 00000000..13c91721 --- /dev/null +++ b/draft/man2/sigreturn.2 @@ -0,0 +1,123 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created Sat Aug 21 1995 Thomas K. Dyas +.\" Modified Tue Oct 22 22:09:03 1996 by Eric S. Raymond +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-03-03, HANATAKA Shinya +.\" Updated 2005-09-04, Akihiro MOTOKI +.\" Updated 2008-08-07, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: signal handler ¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é +.\"WORD: stack frame ¥¹¥¿¥Ã¥¯¡¦¥Õ¥ì¡¼¥à +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: interrupt ³ä¤ê¹þ¤ß +.\"WORD: architecture ¥¢¡¼¥­¥Æ¥¯¥Á¥ã +.\" +.TH SIGRETURN 2 2008-06-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigreturn \- return from signal handler and cleanup stack frame +sigreturn \- ¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤«¤éÊ֤ꡢ¥¹¥¿¥Ã¥¯¤òÁݽü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.BI "int sigreturn(unsigned long " __unused ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O When the Linux kernel creates the stack frame for a signal handler, a +.\"O call to +.\"O .BR sigreturn () +.\"O is inserted into the stack frame so that upon +.\"O return from the signal handler, +.\"O .BR sigreturn () +.\"O will be called. +Linux ¥«¡¼¥Í¥ë¤Ï¡¢ +¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥éÍѤ˥¹¥¿¥Ã¥¯¡¦¥Õ¥ì¡¼¥à¤òºîÀ®¤¹¤ëºÝ¡¢ +.BR sigreturn () +¤ò¥¹¥¿¥Ã¥¯¡¦¥Õ¥ì¡¼¥à¤ËÁÞÆþ¤·¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬ÊÖ¤ë¤È¤­¤Ë +.BR sigreturn () +¤¬¸Æ¤Ð¤ì¤ë¤è¤¦¤Ë¤¹¤ë¡£ + +.\"O This +.\"O .BR sigreturn () +.\"O call undoes everything that was +.\"O done\(emchanging the process's signal mask, switching stacks (see +.\"O .BR sigaltstack "(2))\(emin " +.\"O order to invoke the signal handler: +.\"O it restores the process's signal mask, switches stacks, +.\"O and restores the process's context (registers, processor flags), +.\"O so that the process directly resumes execution +.\"O at the point where it was interrupted by the signal. +.BR sigreturn () +¤Ï¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤òµ¯Æ°¤¹¤ë¤¿¤á¤Ë¹Ô¤Ã¤¿¤³¤È¤ÎÁ´¤Æ \(em +¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÎÊѹ¹¡¢¥¹¥¿¥Ã¥¯¤ÎÀÚ¤êÂؤ¨ +.RB ( sigaltstack (2) +»²¾È) \(em ¤Î¼è¤ê¾Ã¤·¤ò¹Ô¤¦¡£ +¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÎÉü¸µ¡¢¥¹¥¿¥Ã¥¯¤ÎÀÚ¤êÂؤ¨¡¢ +¥×¥í¥»¥¹¤Î¥³¥ó¥Æ¥­¥¹¥È (¥ì¥¸¥¹¥¿¡¢¥×¥í¥»¥Ã¥µ¡¦¥Õ¥é¥°) ¤ÎÉü¸µ¤ò¹Ô¤¤¡¢ +¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì½ê¤«¤é¤½¤Î¤Þ¤Þ¼Â¹Ô¤ò +ºÆ³«¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR sigreturn () +.\"O never returns. +.BR sigreturn () +¤¬Ê֤뤳¤È¤Ï¤Ê¤¤¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +/usr/src/linux/arch/i386/kernel/signal.c +.br +/usr/src/linux/arch/alpha/kernel/entry.S +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR sigreturn () +.\"O is specific to Linux and should not be used in programs intended to be +.\"O portable. +.BR sigreturn () +¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The +.\"O .BR sigreturn () +.\"O call is used by the kernel to implement signal handlers. +.\"O It should +.\"O .B never +.\"O be called directly. +.\"O Better yet, the specific use of the +.\"O .I __unused +.\"O argument varies depending on the architecture. +.BR sigreturn () +¥³¡¼¥ë¤Ï¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤ò¼ÂÁõ¤¹¤ë¤¿¤á¤Ë¥«¡¼¥Í¥ë¤Ë¤è¤ê»ÈÍѤµ¤ì¤ë¡£ +¤³¤ì¤òľÀܸƤӽФ·¤Æ¤Ï +.B ·è¤·¤Æ +¤¤¤±¤Ê¤¤¡£¤µ¤é¤Ë +.I __unused +°ú¤­¿ô¤¬¤É¤Î¤è¤¦¤Ë»È¤ï¤ì¤ë¤«¤Ï¤½¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë°Í¸¤·¤ÆÊѲ½¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigaltstack (2), +.BR signal (2), +.BR signal (7) diff --git a/draft/man2/sigsuspend.2 b/draft/man2/sigsuspend.2 new file mode 100644 index 00000000..9969a566 --- /dev/null +++ b/draft/man2/sigsuspend.2 @@ -0,0 +1,175 @@ +.\" Copyright (c) 2005 Michael Kerrisk +.\" based on earlier work by faith@cs.unc.edu and +.\" Mike Battersby +.\" +.\" 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-09-15, mtk, Created new page by splitting off from sigaction.2 +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-10-03, Akihiro MOTOKI +.\" +.TH SIGSUSPEND 2 2008-08-29 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigsuspend \- wait for a signal +sigsuspend \- ¥·¥°¥Ê¥ë¤òÂÔ¤Ä +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int sigsuspend(const sigset_t *" mask ); +.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 sigsuspend (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sigsuspend () +.\"O temporarily replaces the signal mask of the calling process with the +.\"O mask given by +.\"O .I mask +.\"O and then suspends the process until delivery of a signal whose +.\"O action is to invoke a signal handler or to terminate a process. +.BR sigsuspend () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò +.I mask +¤Ç»ØÄꤵ¤ì¤¿¥Þ¥¹¥¯¤Ë°ì»þŪ¤ËÃÖ¤­´¹¤¨¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Îµ¯Æ°¤â¤·¤¯¤Ï¥×¥í¥»¥¹¤Î½ªÎ»¤¬¥¢¥¯¥·¥ç¥ó¤È¤·¤Æ +ÀßÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤òÄä»ß¤¹¤ë¡£ + +.\"O If the signal terminates the process, then +.\"O .BR sigsuspend () +.\"O does not return. +.\"O If the signal is caught, then +.\"O .BR sigsuspend () +.\"O returns after the signal handler returns, +.\"O and the signal mask is restored to the state before the call to +.\"O .BR sigsuspend (). +¥·¥°¥Ê¥ë¤¬¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë¤â¤Î¤Î¾ì¹ç¡¢ +.BR sigsuspend () +¤ÏÊÖ¤é¤Ê¤¤¡£¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤¿¾ì¹ç¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î½èÍý¤¬½ª¤ï¤Ã¤¿¸å¤Ë +.BR sigsuspend () +¤ÏÊ֤ꡢ¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï +.BR sigsuspend () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ëÁ°¤Î¾õÂÖ¤ËÉü¸µ¤µ¤ì¤ë¡£ + +.\"O It is not possible to block +.\"O .B SIGKILL +.\"O or +.\"O .BR SIGSTOP ; +.\"O specifying these signals in +.\"O .IR mask , +.\"O has no effect on the process's signal mask. +.B SIGKILL +¤È +.B SIGSTOP +¤ò¶Ø»ß (block) ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤; +¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤ò +.I mask +¤Ë»ØÄꤷ¤Æ¤â¡¢¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR sigsuspend () +.\"O always returns \-1, normally with the error +.\"O .BR EINTR . +.BR sigsuspend () +¤Ï¾ï¤Ë \-1 ¤òÊÖ¤·¡¢Ä̾ï¤Ï +.B EINTR +¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O .I mask +.\"O points to memory which is not a valid part of the process address space. +.I mask +¤¬»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤¬¡¢¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ÎÍ­¸ú¤ÊÉôʬ¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINTR +.\"O The call was interrupted by a signal. +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥·¥°¥Ê¥ë¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.PP +.\"O Normally, +.\"O .BR sigsuspend () +.\"O is used in conjunction with +.\"O .BR sigprocmask (2) +.\"O in order to prevent delivery of a signal during the execution of a +.\"O critical code section. +.\"O The caller first blocks the signals with +.\"O .BR sigprocmask (2). +.\"O When the critical code has completed, the caller then waits for the +.\"O signals by calling +.\"O .BR sigsuspend () +.\"O with the signal mask that was returned by +.\"O .BR sigprocmask (2) +.\"O (in the +.\"O .I oldset +.\"O argument). +.BR sigsuspend () +¤Ï¡¢Ä̾¥¯¥ê¥Æ¥£¥«¥ë¡¦¥³¡¼¥É¡¦¥»¥¯¥·¥ç¥ó (critical code section) ¤Î +¼Â¹ÔÃæ¤Ë¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤Î¤òËɻߤ¹¤ë¤¿¤á¤Ë¡¢ +.BR sigprocmask (2) +¤ÈÁȤ߹ç¤ï¤»¤Æ»ÈÍѤµ¤ì¤ë¡£ +¤Þ¤ººÇ½é¤Ë¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï +.BR sigprocmask (2) +¤ò»È¤Ã¤Æ¥·¥°¥Ê¥ë¤ò¶Ø»ß¤¹¤ë¡£ +¥¯¥ê¥Æ¥£¥«¥ë¡¦¥³¡¼¥É¤¬´°Î»¤¹¤ë¤È¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï +.BR sigprocmask (2) +¤¬ +.RI ( oldset +°ú¤­¿ô¤Ç) ÊÖ¤¹¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò»ØÄꤷ¤Æ +.BR sigsuspend () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢¥¯¥ê¥Æ¥£¥«¥ë¡¦¥³¡¼¥É¼Â¹ÔÃæ¤ËȯÀ¸¤·¤¿ +¥·¥°¥Ê¥ë¤òÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O See +.\"O .BR sigsetops (3) +.\"O for details on manipulating signal sets. +¥·¥°¥Ê¥ë½¸¹ç¤ÎÁàºî¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï +.BR sigsetops (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR pause (2), +.BR sigaction (2), +.BR signal (2), +.BR sigprocmask (2), +.BR sigwaitinfo (2), +.BR sigsetops (3), +.BR sigwait (3), +.BR signal (7) diff --git a/draft/man2/sigwaitinfo.2 b/draft/man2/sigwaitinfo.2 new file mode 100644 index 00000000..bba571e6 --- /dev/null +++ b/draft/man2/sigwaitinfo.2 @@ -0,0 +1,310 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2003 Yuichi SATO +.\" all rights reserved. +.\" Translated 2003-02-16, Yuichi SATO +.\" Updated 2006-07-21, Akihiro MOTOKI , LDP v2.36 +.\" Updated 2008-08-07, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: pending ÂÔµ¡Ãæ¤Ç¤¢¤ë +.\" +.TH SIGWAITINFO 2 2008-10-04 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigwaitinfo, sigtimedwait \- synchronously wait for queued signals +sigwaitinfo, sigtimedwait \- ¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤¿¥·¥°¥Ê¥ë¤òƱ´ü¤·¤ÆÂÔ¤Ä +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sigwaitinfo(const sigset_t *" set ", siginfo_t *" info ");" +.sp +.BI "int sigtimedwait(const sigset_t *" set ", siginfo_t *" info ", " +.BI " const struct timespec *" timeout ");" +.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 sigwaitinfo (), +.BR sigtimedwait (): +_POSIX_C_SOURCE\ >=\ 199309L +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sigwaitinfo () +.\"O suspends execution of the calling thread until one of the signals in +.\"O .I set +.\"O is delivered. +.BR sigwaitinfo () +¤Ï +.I set +¤Î¤¦¤Á¤Î¤É¤ì¤«¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¡¢ +¸Æ¤Ó½Ð¤·¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤ò°ì»þÄä»ß¤¹¤ë +.\"O (If one of the signals in +.\"O .I set +.\"O is already pending for the calling thread, +.\"O .BR sigwaitinfo () +.\"O will return immediately with information about that signal.) +(¸Æ¤Ó½Ð¤·¥¹¥ì¥Ã¥É¤ËÂФ·¤Æ +.I set +¤Î¤¦¤Á¤Î¤É¤ì¤«¤Î¥·¥°¥Ê¥ë¤¬´û¤ËÂÔµ¡Ãæ (pending) ¤Ç¤¢¤ë¾ì¹ç¡¢ +.BR sigwaitinfo () +¤Ï¤½¤Î¥·¥°¥Ê¥ë¤Î¾ðÊó¤òÊÖ¤·¤Æ¤¹¤°¤ËÌá¤ë)¡£ +.PP +.\"O .BR sigwaitinfo () +.\"O removes the delivered signal from the set of pending +.\"O signals and returns the signal number as its function result. +.BR sigwaitinfo () +¤ÏÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¤òÂÔµ¡Ãæ¤Î¥·¥°¥Ê¥ë¤Î½¸¹ç¤«¤éºï½ü¤·¡¢ +´Ø¿ô¤Î·ë²Ì¤È¤·¤Æ¥·¥°¥Ê¥ëÈÖ¹æ¤òÊÖ¤¹¡£ +.\"O If the +.\"O .I info +.\"O argument is not NULL, +.\"O then it returns a structure of type +.\"O .I siginfo_t +.\"O (see +.\"O .BR sigaction (2)) +.\"O containing information about the signal. +.I info +°ú¤­¿ô¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î¾ðÊó¤¬Æþ¤Ã¤¿ +.I siginfo_t +·¿ +.RB ( sigaction (2) +¤ò»²¾È) ¤Î¹½Â¤ÂΤòÊÖ¤¹¡£ +.PP +.\"O Signals returned via +.\"O .BR sigwaitinfo () +.\"O are delivered in the usual order; see +.\"O .BR signal (7) +.\"O for further details. +.BR sigwaitinfo () +¤ÇÊÖ¤µ¤ì¤ë¥·¥°¥Ê¥ë¤Ï¡¢Ä̾ï¤Î½çÈÖ¤ÇÇÛÁ÷¤µ¤ì¤ë¡£ +¾ÜºÙ¤Ï +.BR signal (7) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +.\"O .BR sigtimedwait () +.\"O operates in exactly the same way as +.\"O .BR sigwaitinfo () +.\"O except that it has an additional argument, +.\"O .IR timeout , +.\"O which enables an upper bound to be placed on the time for which +.\"O the thread is suspended. +.BR sigtimedwait () +¤Ï¡¢ +.BR sigwaitinfo () +¤È¼¡¤ÎÅÀ¤ò½ü¤¤¤ÆÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ë¤Ï¤â¤¦ 1 ¤Ä¤Î°ú¤­¿ô +.I timeout +¤¬¤¢¤ê¡¢¥¹¥ì¥Ã¥É¤¬°ì»þÄä»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤òÄê¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O This argument is of the following type: +¤³¤Î°ú¤­¿ô¤Î·¿¤Ï°Ê²¼¤Î¤È¤ª¤ê¤Ç¤¢¤ë: +.sp +.in +4n +.nf +struct timespec { +.\"O long tv_sec; /* seconds */ + long tv_sec; /* Éà */ +.\"O long tv_nsec; /* nanoseconds */ + long tv_nsec; /* ¥Ê¥ÎÉà */ +} +.fi +.in +.sp +.\"O If both fields of this structure are specified as 0, a poll is performed: +¤³¤Î¹½Â¤ÂΤΠ2 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤¬¤È¤â¤Ë 0 ¤Î¾ì¹ç¡¢¥Ý¡¼¥ê¥ó¥°¤¬¹Ô¤ï¤ì¤ë: +.\"O .BR sigtimedwait () +.\"O returns immediately, either with information about a signal that +.\"O was pending for the caller, or with an error +.\"O if none of the signals in +.\"O .I set +.\"O was pending. +.BR sigtimedwait () +¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¥×¥í¥»¥¹¤ËÂФ·¤Æ +ÂÔµ¡¤·¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î¾ðÊó¤òÊÖ¤·¤ÆÌá¤ë¤«¡¢ +.I set +¤Î¤¦¤Á¤Î¤É¤Î¥·¥°¥Ê¥ë¤âÂÔµ¡¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¥¨¥é¡¼¤òÊÖ¤·¤ÆÌá¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, both +.\"O .BR sigwaitinfo () +.\"O and +.\"O .BR sigtimedwait () +.\"O return a signal number (i.e., a value greater than zero). +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR sigwaitinfo () +¤È +.BR sigtimedwait () +¤Ï¥·¥°¥Ê¥ëÈÖ¹æ (¤¹¤Ê¤ï¤Á 0 ¤è¤êÂ礭¤¤¿ô) ¤òÊÖ¤¹¡£ +.\"O On failure both calls return \-1, with +.\"O .I errno +.\"O set to indicate the error. +¼ºÇÔ¤·¤¿¾ì¹ç¡¢2 ¤Ä¤Î´Ø¿ô¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ï¥¨¥é¡¼¤òɽ¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.\"O No signal in +.\"O .I set +.\"O was delivered within the +.\"O .I timeout +.\"O period specified to +.\"O .BR sigtimedwait (). +.I set +¤Î¤¦¤Á¤Î¤É¤Î¥·¥°¥Ê¥ë¤â +.BR sigtimedwait () +¤Ë»ØÄꤵ¤ì¤¿ +.I timeout +¤Î´ü´ÖÆâ¤ËÇÛÁ÷¤µ¤ì¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINTR +.\"O The wait was interrupted by a signal handler; see +.\"O .BR signal (7). +.\"O (This handler was for a signal other than one of those in +.\"O .IR set .) +¥·¥°¥Ê¥ëÂÔ¤Á¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤ÆÃæÃÇ (interrupt) ¤µ¤ì¤¿ +(¤³¤Î¥Ï¥ó¥É¥é¤Ï +.I set +¤Ë¤¢¤ë¥·¥°¥Ê¥ë°Ê³°¤Î¤â¤Î¤Ç¤¢¤ë)¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.\"O .I timeout +.\"O was invalid. +.I timeout +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O In normal usage, the calling program blocks the signals in +.\"O .I set +.\"O via a prior call to +.\"O .BR sigprocmask (2) +.\"O (so that the default disposition for these signals does not occur if they +.\"O are delivered between successive calls to +.\"O .BR sigwaitinfo () +.\"O or +.\"O .BR sigtimedwait()) +.\"O and does not establish handlers for these signals. +Ä̾ï¤Î»ÈÍÑË¡¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¥×¥í¥»¥¹¤Ï¤³¤ì¤é¤Î´Ø¿ô¤è¤êÀè¤Ë +.BR sigprocmask (2) +¤Î¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤ê +.I set +¤Ë´Þ¤Þ¤ì¤ë¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤· +(¤½¤Î¤¿¤á¤Ë¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤¬¤³¤Î¸å¤Ë³¤¯ +.BR sigwaitinfo () +¤ä +.BR sigtimedwait () +¤Î¸Æ¤Ó½Ð¤·¤Î´Ö¤ËÇÛÁ÷¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥Ç¥Õ¥©¥ë¥È¤ÎÇÛÃ֤ϹԤï¤ì¤º)¡¢ +¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤ËÂФ¹¤ë¥Ï¥ó¥É¥é¤ÏÀßÄꤷ¤Ê¤¤¡£ +.\"O In a multithreaded program, +.\"O the signal should be blocked in all threads to prevent +.\"O the signal being delivered to a thread other than the one calling +.\"O .BR sigwaitinfo () +.\"O or +.\"O .BR sigtimedwait ()). +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +.BR sigwaitinfo () +¤ä +.BR sigtimedwait () +¤ò¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É°Ê³°¤Î¥¹¥ì¥Ã¥É¤Ë¤½¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¡¢ +Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤Ç³ºÅö¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O The set of signals that is pending for a given thread is the +.\"O union of the set of signals that is pending specifically for that thread +.\"O and the set of signals that is pending for the process as a whole (see +.\"O .BR signal (7)). +»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É¤ËÂФ¹¤ë½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Î½¸¹ç¤Ï¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¼«Âΰ¸¤Æ¤Î½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤È¡¢¥×¥í¥»¥¹Á´Âΰ¸¤Æ¤Î +½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤ò¤¢¤ï¤»¤¿¤â¤Î¤Ç¤¢¤ë +.RB ( signal (7) +»²¾È)¡£ + +.\"O If multiple threads of a process are blocked +.\"O waiting for the same signal(s) in +.\"O .BR sigwaitinfo () +.\"O or +.\"O .BR sigtimedwait (), +.\"O then exactly one of the threads will actually receive the +.\"O signal if it is delivered to the process as a whole; +.\"O which of the threads receives the signal is indeterminate. +°ì¤Ä¤Î¥×¥í¥»¥¹Æâ¤ÎÊ£¿ô¤Î¥¹¥ì¥Ã¥É¤¬ +.BR sigwaitinfo () +¤ä +.BR sigtimedwait () +¤ÇƱ¤¸¥·¥°¥Ê¥ë¤òÂԤäÆÄä»ß¤·¤¿¾ì¹ç¡¢ +¥×¥í¥»¥¹Á´Âΰ¸¤Æ¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤È¡¢Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤Î¤¦¤Á°ì¤Ä¤À¤±¤¬ +¼ÂºÝ¤Ë¤½¤Î¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£ +¤É¤Î¥¹¥ì¥Ã¥É¤¬¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¤«¤Ï·è¤Þ¤Ã¤Æ¤¤¤Ê¤¤¡£ + +.\"O POSIX leaves the meaning of a NULL value for the +.\"O .I timeout +.\"O argument of +.\"O .BR sigtimedwait () +.\"O unspecified, permitting the possibility that this has the same meaning +.\"O as a call to +.\"O .BR sigwaitinfo (), +.\"O and indeed this is what is done on Linux. +POSIX ¤Ç¤Ï +.BR sigtimedwait () +¤Î°ú¤­¿ô +.I timeout +¤ÎÃͤò NULL ¤Ë¤·¤¿¾ì¹ç¤Î°ÕÌ£¤ò̤ÄêµÁ¤È¤·¤Æ¤¤¤ë¡£ +.BR sigwaitinfo () +¤ò¸Æ¤Ó½Ð¤·¤¿¤Î¤ÈƱ¤¸°ÕÌ£¤È¤·¤Æ¤â¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +¼ÂºÝ Linux ¤Ç¤Ï¤³¤Î¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.\"O On Linux, +.\"O .BR sigwaitinfo () +.\"O is a library function implemented on top of +.\"O .BR sigtimedwait (). +Linux ¤Ç¤Ï¡¢ +.BR sigwaitinfo () +¤Ï +.BR sigtimedwait () +¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤¿¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigaction (2), +.BR signal (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigqueue (2), +.BR sigsetops (3), +.BR sigwait (3), +.BR signal (7), +.BR time (7) diff --git a/draft/man2/socket.2 b/draft/man2/socket.2 new file mode 100644 index 00000000..71cf588b --- /dev/null +++ b/draft/man2/socket.2 @@ -0,0 +1,697 @@ +'\" t +.\" 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. +.\" +.\" $Id: socket.2,v 1.4 1999/05/13 11:33:42 freitag Exp $ +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 1998, 1999 by Andi Kleen +.\" 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 ÈóƱ´ü +.\" +.TH SOCKET 2 2009-01-19 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O socket \- create an endpoint for communication +socket \- ÄÌ¿®¤Î¤¿¤á¤ÎüÅÀ(endpoint)¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.\"O .BR "#include " " /* See NOTES */" +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.br +.B #include +.sp +.BI "int socket(int " domain ", int " type ", int " protocol ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR socket () +.\"O creates an endpoint for communication and returns a descriptor. +.BR socket () +¤ÏÄÌ¿®¤Î¤¿¤á¤ÎüÅÀ(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 +¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¸½ºß¡¢Íý²ò¤Ç¤­¤ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï°Ê²¼¤ÎÄ̤ꡣ +.TS +tab(:); +l l l. +.\"O Name:Purpose:Man page +̾Á°:ÌÜŪ:¥Þ¥Ë¥å¥¢¥ë +T{ +.BR AF_UNIX ", " AF_LOCAL +T}:T{ +.\"O Local communication +¥í¡¼¥«¥ëÄÌ¿® +T}:T{ +.BR unix (7) +T} +T{ +.B AF_INET +.\"O T}:IPv4 Internet protocols:T{ +T}:IPv4 ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¡¦¥×¥í¥È¥³¥ë:T{ +.BR ip (7) +T} +T{ +.B AF_INET6 +.\"O T}:IPv6 Internet protocols:T{ +T}:IPv6 ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¡¦¥×¥í¥È¥³¥ë:T{ +.BR ipv6 (7) +T} +T{ +.B AF_IPX +.\"O T}:IPX \- Novell protocols: +T}:IPX \- Novell ¥×¥í¥È¥³¥ë: +T{ +.B AF_NETLINK +T}:T{ +.\"O Kernel user interface device +¥«¡¼¥Í¥ë¡¦¥æ¡¼¥¶¡¦¥Ç¥Ð¥¤¥¹ +T}:T{ +.BR netlink (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) +T} +T{ +.B AF_AX25 +T}:T{ +.\"O Amateur radio AX.25 protocol +¥¢¥Þ¥Á¥å¥¢ÌµÀþ AX.25 ¥×¥í¥È¥³¥ë +T}: +T{ +.B AF_ATMPVC +.\"O T}:Access to raw ATM PVCs: +T}:À¸¤Î ATM PVC ¤Ë¥¢¥¯¥»¥¹¤¹¤ë: +T{ +.B AF_APPLETALK +.\"O T}:Appletalk:T{ +T}:¥¢¥Ã¥×¥ë¥È¡¼¥¯:T{ +.BR ddp (7) +T} +T{ +.B AF_PACKET +T}:T{ +.\"O Low level packet interface +Äã¥ì¥Ù¥ë¤Î¥Ñ¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +T}:T{ +.BR packet (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. +¸ÇÄêºÇÂçĹ¤Î¥Ç¡¼¥¿¥°¥é¥àžÁ÷¥Ñ¥¹¤Ë´ð¤Å¤¤¤¿½ç½øÀ­¡¢¿®ÍêÀ­¤Î¤¢¤ë +ÁÐÊý¸þ¤ÎÀܳ¤Ë´ð¤Å¤¤¤¿ÄÌ¿®¤òÄ󶡤¹¤ë¡£¼õ¤±¼è¤ê¦¤Ç¤Ï¤½¤ì¤¾¤ì¤ÎÆþÎÏ +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ç¥Ñ¥±¥Ã¥ÈÁ´ÂΤòÆɤ߼è¤ë¤³¤È¤¬Í׵ᤵ¤ì¤ë¡£ +.TP +.B SOCK_RAW +.\"O Provides raw network protocol access. +À¸¤Î¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥×¥í¥È¥³¥ë¤Ø¤Î¥¢¥¯¥»¥¹¤òÄ󶡤¹¤ë¡£ +.TP +.B SOCK_RDM +.\"O Provides a reliable datagram layer that does not guarantee ordering. +¿®ÍêÀ­¤Ï¤¢¤ë¤¬¡¢½ç½ø¤ÏÊݾڤ·¤Ê¤¤¥Ç¡¼¥¿¥°¥é¥àÁؤòÄ󶡤¹¤ë¡£ +.TP +.B SOCK_PACKET +.\"O Obsolete and should not be used in new programs; +.\"O see +.\"O .BR packet (7). +Çѻߤµ¤ì¤Æ¤ª¤ê¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.BR packet (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 +¤Ë¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.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) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.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 +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.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) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.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) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.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) +¥³¡¼¥ë¤¬Í׵ᤵ¤ì¤¿Î̤Υǡ¼¥¿¤Î¤ß¤òÊÖ¤·¡¢ÅþÃ夷¤¿¥Ñ¥±¥Ã¥È¤Î»Ä¤ê¤ÎÉôʬ¤ò +¼Î¤Æ¤Æ¤·¤Þ¤¦¤³¤È¤Ç¤¢¤ë¡£Æ±ÍͤËÆþ¤Ã¤Æ¤¯¤ë¥Ç¡¼¥¿¥°¥é¥à¤ÎÁ´¤Æ¤Î¥á¥Ã¥»¡¼¥¸¶­³¦¤Ï +Êݸ¤µ¤ì¤ë¡£ +.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) +¤Ç¼õ¤±¤È¤ê¡¢ +¤³¤Î¥³¡¼¥ë¤Ï¼¡¤Î¥Ç¡¼¥¿¥°¥é¥à¤òÁ÷¿®¼Ô¤Î¥¢¥É¥ì¥¹¤È°ì½ï¤ËÊÖ¤¹¡£ +.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) +¤òÍѤ¤¤ë¤³¤È¡£ +.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) +¤ò»ÈÍѤ¹¤ë¤³¤È¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.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 +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.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" +.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 +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O Permission to create a socket of the specified type and/or protocol +.\"O is denied. +»ØÄꤵ¤ì¤¿¥¿¥¤¥×¤Þ¤¿¤Ï¥×¥í¥È¥³¥ë¤Î¥½¥±¥Ã¥È¤òºîÀ®¤¹¤ëµö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EAFNOSUPPORT +.\"O The implementation does not support the specified address family. +»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O Unknown protocol, or protocol family not available. +ÃΤé¤Ê¤¤¥×¥í¥È¥³¥ë¡¢¤Þ¤¿¤ÏÍøÍѤǤ­¤Ê¤¤¥×¥í¥È¥³¥ë¡¦¥Õ¥¡¥ß¥ê¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +.\" Since Linux 2.6.27 +.\"O Invalid flags in +.\"O .IR type . +.I type +¤Ë̵¸ú¤Ê¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EMFILE +.\"O Process file table overflow. +¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥Æ¡¼¥Ö¥ë¤¬°î¤ì¤Æ¤¤¤ë¡£ +.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. +¤³¤Î¥É¥á¥¤¥ó¤Ç¤Ï»ØÄꤵ¤ì¤¿¥×¥í¥È¥³¥ë¤Þ¤¿¤Ï¥×¥í¥È¥³¥ë¡¦¥¿¥¤¥×¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O Other errors may be generated by the underlying protocol modules. +²¼°Ì¤Î¥×¥í¥È¥³¥ë¡¦¥â¥¸¥å¡¼¥ë¤«¤é¾¤Î¥¨¥é¡¼¤¬À¸À®¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +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 ¸ÇÍ­¤Ç¤¢¤ë¡£ + +.\"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 +.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 ·Ï) ¤Ç¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬ +ɬÍפǤ¢¤ê¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò +¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬¸­ÌÀ¤Ç¤¢¤í¤¦¡£ + +.\"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 +.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" +.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) +.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 +¤È¤·¤ÆºÆÈǤµ¤ì¤¿¡£ +.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 +¤È¤·¤ÆºÆÈǤµ¤ì¤¿¡£ diff --git a/draft/man2/socketcall.2 b/draft/man2/socketcall.2 new file mode 100644 index 00000000..9e218bd2 --- /dev/null +++ b/draft/man2/socketcall.2 @@ -0,0 +1,110 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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 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 +.\" +.\"WORD: socket ¥½¥±¥Ã¥È +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: entry ¥¨¥ó¥È¥ê +.\"WORD: hacker ¥Ï¥Ã¥«¡¼ +.\"WORD: library ¥é¥¤¥Ö¥é¥ê +.\" +.TH SOCKETCALL 2 2007-06-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O socketcall \- socket system calls +socketcall \- ¥½¥±¥Ã¥È¡¦¥·¥¹¥Æ¥à¥³¡¼¥ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.BI "int socketcall(int " call ", unsigned long *" args ); +.\"O .SH DESCRIPTION +.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 +¤ÏŬÀڤʥ³¡¼¥ë¤ËÅϤ¹¤¿¤á¤Î¼ÂºÝ¤Î°ú¤­¿ô¤ò´Þ¤ó¤Ç¤¤¤ë¥Ö¥í¥Ã¥¯¤ò»Ø¤¹¡£ +.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" +.SH ½àµò +.\"O This call is specific to Linux, and should not be used in programs +.\"O intended to be portable. +¤³¤Î¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç +»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.\"O .SH NOTES +.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" +.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) diff --git a/draft/man2/socketpair.2 b/draft/man2/socketpair.2 new file mode 100644 index 00000000..73c147b4 --- /dev/null +++ b/draft/man2/socketpair.2 @@ -0,0 +1,207 @@ +.\" 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. +.\" +.\" @(#)socketpair.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 2002-07-22 by Michael Kerrisk +.\" 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 ¼ÂÁõ +.\" +.TH SOCKETPAIR 2 2008-10-11 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O socketpair \- create a pair of connected sockets +.SH ̾Á° +socketpair \- Àܳ¤µ¤ì¤¿¥½¥±¥Ã¥È¤Î¥Ú¥¢¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.\"O .BR "#include " " /* See NOTES */" +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.br +.B #include +.sp +.BI "int socketpair(int " domain ", int " type ", int " protocol \ +", int " sv [2]); +.\"O .SH DESCRIPTION +.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) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"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. +Æó¤Ä¤Î¥½¥±¥Ã¥È¤ÏÁ´¤¯Æ±¤¸¤Ç¤¢¤ë¡£ +.\"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 +.SH ¥¨¥é¡¼ +.TP +.B EAFNOSUPPORT +.\"O The specified address family is not supported on this machine. +¤³¤Î¥Þ¥·¥ó¤Ç¤Ï»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¡¦¥Õ¥¡¥ß¥ê¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.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 +.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 +.B EPROTONOSUPPORT +.\"O The specified protocol is not supported on this machine. +¤³¤Î¥Þ¥·¥ó¤Ç¤Ï»ØÄꤵ¤ì¤¿¥×¥í¥È¥³¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"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 +.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 ) +¤À¤±¤Ç¤¢¤ë¡£ +(¤Û¤È¤ó¤É¤Î¼ÂÁõ¤ÇƱ¤¸À©¸Â¤¬¤¢¤ë) + +.\"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) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR pipe (2), +.BR read (2), +.BR socket (2), +.BR write (2), +.BR socket (7), +.BR unix (7) diff --git a/draft/man2/splice.2 b/draft/man2/splice.2 new file mode 100644 index 00000000..0c434488 --- /dev/null +++ b/draft/man2/splice.2 @@ -0,0 +1,373 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 2006 Jens Axboe +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-02-04, Akihiro MOTOKI +.\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.13 +.\" +.TH SPLICE 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O splice \- splice data to/from a pipe +splice \- ¥Ñ¥¤¥×¤È¤Î´Ö¤Ç¥Ç¡¼¥¿¤ò·Ñ¤®¹ç¤ï¤»¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "ssize_t splice(int " fd_in ", loff_t *" off_in ", int " fd_out , +.BI " loff_t *" off_out ", size_t " len \ +", unsigned int " flags ); +.fi +.\" Return type was long before glibc 2.7 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR splice () +.\"O moves data between two file descriptors +.\"O without copying between kernel address space and user address space. +.\"O It transfers up to +.\"O .I len +.\"O bytes of data from the file descriptor +.\"O .I fd_in +.\"O to the file descriptor +.\"O .IR fd_out , +.\"O where one of the descriptors must refer to a pipe. +.BR splice () +¤Ï¡¢¥«¡¼¥Í¥ë¥¢¥É¥ì¥¹¶õ´Ö¤È¥æ¡¼¥¶¥¢¥É¥ì¥¹¶õ´Ö¤È¤Î´Ö¤Î¥³¥Ô¡¼¤òȼ¤ï¤º¤Ë¡¢ +2 ¤Ä¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿´Ö¤Ç¥Ç¡¼¥¿¤Î°ÜÆ°¤ò¹Ô¤¦¡£ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd_in +¤«¤é¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd_out +¤ØºÇÂç +.I len +¥Ð¥¤¥È¤òžÁ÷¤¹¤ë¡£ +2 ¤Ä¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¦¤Á°ì¤Ä¤Ï +¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O If +.\"O .I fd_in +.\"O refers to a pipe, then +.\"O .I off_in +.\"O must be NULL. +.I fd_in +¤¬¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.I off_in +¤Ï NULL ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O If +.\"O .I fd_in +.\"O does not refer to a pipe and +.\"O .I off_in +.\"O is NULL, then bytes are read from +.\"O .I fd_in +.\"O starting from the current file offset, +.\"O and the current file offset is adjusted appropriately. +.I fd_in +¤¬¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤ª¤é¤º¡¢ +.I off_in +¤¬ NULL ¤Î¾ì¹ç¡¢ +.I fd_in +¤Î¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤«¤é»Ï¤Þ¤ë¥Ð¥¤¥È¤òÆɤ߽Ф¹¡£ +¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ÏŬÀÚ¤ËÄ´À°¤µ¤ì¤ë¡£ +.\"O If +.\"O .I fd_in +.\"O does not refer to a pipe and +.\"O .I off_in +.\"O is not NULL, then +.\"O .I off_in +.\"O must point to a buffer which specifies the starting +.\"O offset from which bytes will be read from +.\"O .IR fd_in ; +.\"O in this case, the current file offset of +.\"O .I fd_in +.\"O is not changed. +.I fd_in +¤¬¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤ª¤é¤º¡¢ +.I off_in +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I off_in +¤Ï +.I fd_in +¤«¤é¤Î¥Ç¡¼¥¿Æɤ߽Ф·¤ò³«»Ï¤¹¤ëÀèƬ¥ª¥Õ¥»¥Ã¥È¤ò³ÊǼ¤·¤¿¥Ð¥Ã¥Õ¥¡ +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤Î¾ì¹ç¡¢ +.I fd_in +¤Î¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.\"O Analogous statements apply for +.\"O .I fd_out +.\"O and +.\"O .IR off_out . +.I fd_out +¤È +.I off_out +¤Ë´Ø¤·¤Æ¤âƱÍͤǤ¢¤ë¡£ +.PP +.\"O The +.\"O .I flags +.\"O argument is a bit mask that is composed by ORing together +.\"O zero or more of the following values: +.I flags +°ú¤­¿ô¤Ë¤Ï¡¢°Ê²¼¤ÎÃͤΠ0 ¸Ä°Ê¾å¤Î¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýϤò +¤È¤Ã¤¿¤â¤Î¤ò»ØÄꤹ¤ë: +.TP 1.9i +.B SPLICE_F_MOVE +.\"O Attempt to move pages instead of copying. +.\"O This is only a hint to the kernel: +.\"O pages may still be copied if the kernel cannot move the +.\"O pages from the pipe, or if +.\"O the pipe buffers don't refer to full pages. +¥Ú¡¼¥¸¤Î¥³¥Ô¡¼¤Ç¤Ê¤¯°ÜÆ°¤ò»î¤ß¤ë¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ë¤ËÂФ¹¤ë¥Ò¥ó¥È¤Ç¤·¤«¤Ê¤¤¡£ +¤Ä¤Þ¤ê¡¢¥«¡¼¥Í¥ë¤¬¥Ñ¥¤¥×¤«¤é¥Ú¡¼¥¸¤ò°ÜÆ°¤Ç¤­¤Ê¤¤¾ì¹ç¤ä¡¢ +¥Ñ¥¤¥×¥Ð¥Ã¥Õ¥¡¤¬¥Ú¡¼¥¸Á´Éô¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢ +¥Ú¡¼¥¸¤Î¥³¥Ô¡¼¤¬¹Ô¤ï¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +.\"O The initial implementation of this flag was buggy: +.\"O therefore starting in Linux 2.6.21 it is a no-op +.\"O (but is still permitted in a +.\"O .BR splice () +.\"O call); +.\"O in the future, a correct implementation may be restored. +¤³¤Î¥Õ¥é¥°¤ÎºÇ½é¤Î¼ÂÁõ¤Ë¤Ï¥Ð¥°¤¬¤¢¤Ã¤¿¡£¤½¤Î¤¿¤á¡¢ +Linux 2.6.21 °Ê¹ß¤Ç¤Ï¤³¤Î¥Õ¥é¥°¤ÎÁàºî¤Ï¤Ç¤­¤Ê¤¤¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë +(¤¿¤À¤·¡¢ +.BR splice () +¥³¡¼¥ë¤Ç¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤Ïº£¤âǧ¤á¤é¤ì¤Æ¤¤¤ë)¡£ +¾­Íè¡¢Àµ¤·¤¤¼ÂÁõ¤¬¹Ô¤ï¤ì¤ë¤³¤È¤À¤í¤¦¡£ +.TP +.B SPLICE_F_NONBLOCK +.\"O Do not block on I/O. +.\"O This makes the splice pipe operations nonblocking, but +.\"O .BR splice () +.\"O may nevertheless block because the file descriptors that +.\"O are spliced to/from may block (unless they have the +.\"O .B O_NONBLOCK +.\"O flag set). +Æþ½ÐÎÏ»þ¤ËÄä»ß (block) ¤·¤Ê¤¤¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢ +splice ¤Ë¤è¤ë¥Ñ¥¤¥×Áàºî¤òÈóÄä»ß¥â¡¼¥É (nonblocking) ¤Ç +¹Ô¤ª¤¦¤È¤¹¤ë¤¬¡¢¤½¤Î¾ì¹ç¤Ç¤â +.BR splice () +¤ÏÄä»ß¤¹¤ë¤³¤È¤â¤¢¤ë¡£¤Ê¤¼¤Ê¤é¡¢¥Ç¡¼¥¿¤Î¤ä¤ê¼è¤ê¤ò¹Ô¤¦ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.RB ( O_NONBLOCK +¥Õ¥é¥°¤ò¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç) Ää»ß¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¤«¤é¤Ç¤¢¤ë¡£ +.TP +.B SPLICE_F_MORE +.\"O More data will be coming in a subsequent splice. +.\"O This is a helpful hint when +.\"O the +.\"O .I fd_out +.\"O refers to a socket (see also the description of +.\"O .B MSG_MORE +.\"O in +.\"O .BR send (2), +.\"O and the description of +.\"O .B TCP_CORK +.\"O in +.\"O .BR tcp (7)) +¤³¤Î¸å¤Î splice ¤Ç¤µ¤é¤ËžÁ÷¤µ¤ì¤ë¥Ç¡¼¥¿¤¬¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î¥Õ¥é¥°¤Ï +.I fd_out +¤¬¥½¥±¥Ã¥È¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤ËÍ­ÍѤʥҥó¥È¤È¤Ê¤ë +.RB ( send (2) +¤Î +.B MSG_MORE +¤ä +.BR tcp (7) +¤Î +.B TCP_CORK +¤ÎÀâÌÀ¤â»²¾È)¡£ +.TP +.B SPLICE_F_GIFT +.\"O Unused for +.\"O .BR splice (); +.\"O see +.\"O .BR vmsplice (2). +.BR splice () +¤Ç¤Ï»ÈÍѤ·¤Ê¤¤¡£ +.BR vmsplice (2) +»²¾È¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O Upon successful completion, +.\"O .BR splice () +.\"O returns the number of bytes +.\"O spliced to or from the pipe. +.\"O A return value of 0 means that there was no data to transfer, +.\"O and it would not make sense to block, because there are no +.\"O writers connected to the write end of the pipe referred to by +.\"O .IR fd_in . +À®¸ù¤·¤Æ´°Î»¤¹¤ë¤È¡¢ +.BR splice () +¤Ï¥Ñ¥¤¥×¤«¤é½Ð¤·Æþ¤ì¤·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +ÊÖ¤êÃÍ 0 ¤Ï¥Ç¡¼¥¿¤ÎžÁ÷¤¬¹Ô¤ï¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î¾ì¹ç¡¢½èÍý¤òÄä»ß (block) ¤·¤Æ¤â̵°ÕÌ£¤Ç¤¢¤ë¡£ +¤Ê¤¼¤Ê¤é¡¢ +.I fd_in +¤¬»²¾È¤¹¤ë¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¼Ô¤¬¤¤¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.PP +.\"O On error, +.\"O .BR splice () +.\"O returns \-1 and +.\"O .I errno +.\"O is set to indicate the error. +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR splice () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O One or both file descriptors are not valid, +.\"O or do not have proper read-write mode. +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î°ìÊý¤Þ¤¿¤ÏξÊý¤¬Í­¸ú¤Ç¤Ï¤Ê¤¤¡¢ +¤â¤·¤¯¤ÏŬÀÚ¤Ê read-write ¥â¡¼¥É¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O Target file system doesn't support splicing; +.\"O target file is opened in append mode; +.\"O .\" The append-mode error is given since 2.6.27; in earlier kernels, +.\"O .\" splice() in append mode was broken +.\"O neither of the descriptors refers to a pipe; or +.\"O offset given for nonseekable device. +ÂоݤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ splice ¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤¡¢ +¤Þ¤¿¤ÏÂоݤΥե¡¥¤¥ë¤¬Äɵ­¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¡¢ +.\" Äɵ­¥â¡¼¥É¤Ç¤Î¥¨¥é¡¼¤Ï 2.6.27 °Ê¹ß¤ÇȯÀ¸¤¹¤ë¡£ +.\" ¤½¤ì¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤ÏÄɵ­¥â¡¼¥É¤Ç¤Î splice() ¤ÏÀµ¤·¤¯Æ°ºî¤·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤É¤Á¤é¤â¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡¢ +¤Þ¤¿¤Ï seek ¤Ç¤­¤Ê¤¤¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ¥ª¥Õ¥»¥Ã¥È¤¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B ENOMEM +.\"O Out of memory. +¥á¥â¥êÉÔ­¡£ +.TP +.B ESPIPE +.\"O Either +.\"O .I off_in +.\"O or +.\"O .I off_out +.\"O was not NULL, but the corresponding file descriptor refers to a pipe. +.I off_in +¤« +.I off_out +¤Î¤¤¤º¤ì¤«¤¬ NULL ¤Ç¤Ï¤Ê¤¤¤¬¡¢Âбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The +.\"O .BR splice () +.\"O system call first appeared in Linux 2.6.17. +.BR splice () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6.17 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This system call is Linux-specific. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The three system calls +.\"O .BR splice (), +.\"O .BR vmsplice (2), +.\"O and +.\"O .BR tee (2), +.\"O provide userspace programs with full control over an arbitrary +.\"O kernel buffer, implemented within the kernel using the same type +.\"O of buffer that is used for a pipe. +3 ¤Ä¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë +.RB ( splice (), +.BR vmsplice (2), +.BR tee (2)) +¤ò»È¤¦¤È¡¢¥æ¡¼¥¶¶õ´Ö¥×¥í¥°¥é¥à¤ÏǤ°Õ¤Î¥«¡¼¥Í¥ë¥Ð¥Ã¥Õ¥¡¤ËÂФ¹¤ë +´°Á´¤ÊÀ©¸æ¤¬¤Ç¤­¤ë¡£¥«¡¼¥Í¥ë¥Ð¥Ã¥Õ¥¡¤Ï¡¢¥Ñ¥¤¥×¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¤Î¤È +Ʊ¼ï¤Î¥Ð¥Ã¥Õ¥¡¤ò»È¤Ã¤Æ¥«¡¼¥Í¥ëÆâ¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O In overview, these system calls perform the following tasks: +Âç¤Þ¤«¤Ë¤¤¤¦¤È¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï°Ê²¼¤Î»Å»ö¤ò¹Ô¤¦: +.TP 1.2i +.BR splice () +.\"O moves data from the buffer to an arbitrary file descriptor, or vice versa, +.\"O or from one buffer to another. +¥Ð¥Ã¥Õ¥¡¤«¤éǤ°Õ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ä¡¢¤½¤ÎµÕÊý¸þ¡¢ +¤â¤·¤¯¤Ï¤¢¤ë¥Ð¥Ã¥Õ¥¡¤«¤éÊ̤ΥХåե¡¤Ø¤Î¡¢¥Ç¡¼¥¿°ÜÆ°¤ò¹Ô¤¦¡£ +.TP +.BR tee (2) +.\"O "copies" the data from one buffer to another. +¤¢¤ë¥Ð¥Ã¥Õ¥¡¤«¤éÊ̤ΥХåե¡¤Ø¤Î¥Ç¡¼¥¿¡Ö¥³¥Ô¡¼¡×¤ò¹Ô¤¦¡£ +.TP +.BR vmsplice (2) +.\"O "copies" data from user space into the buffer. +¥æ¡¼¥¶¶õ´Ö¤«¤é¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ç¡¼¥¿¡Ö¥³¥Ô¡¼¡×¤ò¹Ô¤¦¡£ +.PP +.\"O Though we talk of copying, actual copies are generally avoided. +.\"O The kernel does this by implementing a pipe buffer as a set +.\"O of reference-counted pointers to pages of kernel memory. +.\"O The kernel creates "copies" of pages in a buffer by creating new +.\"O pointers (for the output buffer) referring to the pages, +.\"O and increasing the reference counts for the pages: +.\"O only pointers are copied, not the pages of the buffer. +¤³¤³¤Ç¤Ï¥³¥Ô¡¼¤ÎÏäò¤·¤Æ¤¤¤ë¤¬¡¢¼ÂºÝ¤Î¥³¥Ô¡¼¤Ï°ìÈÌŪ¤Ë²óÈò¤µ¤ì¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¡¢¥Ñ¥¤¥×¡¦¥Ð¥Ã¥Õ¥¡¤ò¥«¡¼¥Í¥ë¥á¥â¥ê¤Î¥Ú¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿½¸¹ç¤È¤·¤Æ +¼ÂÁõ¤·¡¢¥Ú¡¼¥¸¤Ø¤Î»²¾È²ó¿ô¤ò´ÉÍý¤¹¤ë¤³¤È¤Ç¡¢¤³¤ì¤ò¼Â¸½¤·¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¡¢ÂоݤȤʤë¥Ú¡¼¥¸¤ò»²¾È¤¹¤ë (½ÐÎϥХåե¡ÍѤÎ) ¥Ý¥¤¥ó¥¿¤ò +¿·µ¬¤ËºîÀ®¤¹¤ë¤³¤È¤Ç¥Ð¥Ã¥Õ¥¡Æâ¤Î¥Ú¡¼¥¸¤Î¡Ö¥³¥Ô¡¼¡×¤òºîÀ®¤·¡¢ +¤½¤Î¥Ú¡¼¥¸¤Î»²¾È²ó¿ô¤òÁý¤ä¤¹¡£¤Ä¤Þ¤ê¡¢¥Ý¥¤¥ó¥¿¤À¤±¤¬¥³¥Ô¡¼¤µ¤ì¡¢ +¥Ð¥Ã¥Õ¥¡¤Î¥Ú¡¼¥¸¤Ï¥³¥Ô¡¼¤µ¤ì¤Ê¤¤¡£ +.\" +.\" Linus: Now, imagine using the above in a media server, for example. +.\" Let's say that a year or two has passed, so that the video drivers +.\" have been updated to be able to do the splice thing, and what can +.\" you do? You can: +.\" +.\" - splice from the (mpeg or whatever - let's just assume that the video +.\" input is either digital or does the encoding on its own - like they +.\" pretty much all do) video input into a pipe (remember: no copies - the +.\" video input will just DMA directly into memory, and splice will just +.\" set up the pages in the pipe buffer) +.\" - tee that pipe to split it up +.\" - splice one end to a file (ie "save the compressed stream to disk") +.\" - splice the other end to a real-time video decoder window for your +.\" real-time viewing pleasure. +.\" +.\" Linus: Now, the advantage of splice()/tee() is that you can +.\" do zero-copy movement of data, and unlike sendfile() you can +.\" do it on _arbitrary_ data (and, as shown by "tee()", it's more +.\" than just sending the data to somebody else: you can duplicate +.\" the data and choose to forward it to two or more different +.\" users - for things like logging etc.). +.\" +.\"O .SH EXAMPLE +.SH Îã +.\"O See +.\"O .BR tee (2). +.BR tee (2) +»²¾È¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR sendfile (2), +.BR tee (2), +.BR vmsplice (2), +.BR feature_test_macros (7) diff --git a/draft/man2/spu_create.2 b/draft/man2/spu_create.2 new file mode 100644 index 00000000..67c0189b --- /dev/null +++ b/draft/man2/spu_create.2 @@ -0,0 +1,273 @@ +.\" This is _*_ nroff _*_ source. Emacs, gimme all those colors :) +.\" +.\" Copyright (c) International Business Machines Corp., 2006 +.\" +.\" 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 +.\" +.\" HISTORY: +.\" 2005-09-28, created by Arnd Bergmann +.\" 2006-06-16, revised by Eduardo M. Fleury +.\" 2007-07-10, some polishing by mtk +.\" +.TH SPU_CREATE 2 2007-07-10 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O spu_create \- create a new spu context +spu_create \- ¿·¤·¤¤ SPU ¥³¥ó¥Æ¥­¥¹¥È¤òÀ¸À®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include + +.BI "int spu_create(const char *" pathname ", int " flags ", mode_t " mode ");" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR spu_create () +.\"O system call is used on PowerPC machines that implement the +.\"O Cell Broadband Engine Architecture in order to access Synergistic +.\"O Processor Units (SPUs). +.\"O It creates a new logical context for an +.\"O SPU in +.\"O .I pathname +.\"O and returns a file descriptor associated with it. +.\"O .I pathname +.\"O must point to a non-existing directory in the mount point of the +.\"O SPU file system (SPUFS). +.\"O If +.\"O .BR spu_create () +.\"O is successful, a directory is created in +.\"O .I pathname +.\"O and it is populated with the files described in +.\"O .BR spufs (7). +.BR spu_create () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢Cell Broadband Engine ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò¼ÂÁõ¤·¤¿ +PowerPC ¥Þ¥·¥ó¤Ë¤ª¤¤¤Æ¡¢Synergistic Processor Unit (SPU) ¤Ë¥¢¥¯¥»¥¹¤¹¤ë +¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢SPU ¤ËÂФ¹¤ë¿·¤·¤¤ÏÀÍý¥³¥ó¥Æ¥­¥¹¥È¤ò +.I pathname +¤ËÀ¸À®¤·¡¢¤½¤Î¥³¥ó¥Æ¥­¥¹¥È¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.I pathname +¤Ï SPU ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à (SPUFS) ¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥ÈÆâ¤Î +¸ºß¤·¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BR spu_create () +¤¬À®¸ù¤¹¤ë¤È¡¢ +.I pathname +¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤¬À¸À®¤µ¤ì¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë +.BR spufs (7) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë·²¤¬ÇÛÃÖ¤µ¤ì¤ë¡£ + +.\"O The returned file handler can only be passed to +.\"O .BR spu_run (2) +.\"O or closed; +.\"O other operations are not defined on it. +.\"O A logical SPU +.\"O context is destroyed when its file descriptor is closed as well as +.\"O all the file descriptors pointing to files inside it. +.\"O When an SPU context is destroyed all its directory entries in the +.\"O SPUFS are removed. +ÊÖ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥é¤Ï¡¢ +.BR spu_run (2) +¤ËÅϤ¹¤«¡¢¥¯¥í¡¼¥º¤¹¤ë¤«¤·¤«¤Ç¤­¤Ê¤¤¡£ +¾¤ÎÁàºî¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +ÏÀÍý SPU ¥³¥ó¥Æ¥­¥¹¥È¤¬ÇË´þ¤µ¤ì¤ë¤Î¤Ï¡¢ +¥³¥ó¥Æ¥­¥¹¥È¼«¿È¤Ø¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥¯¥í¡¼¥º¤µ¤ì¡¢ +¤½¤ÎÃæ¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Á´¤Æ¥¯¥í¡¼¥º¤µ¤ì¤¿¤È¤­¤Ç¤¢¤ë¡£ +SPU ¥³¥ó¥Æ¥­¥¹¥È¤¬ÇË´þ¤µ¤ì¤ë¤È¡¢SPUFS Æâ¤Î¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ÎÁ´¤Æ¤Î¥¨¥ó¥È¥ê +¤¬ºï½ü¤µ¤ì¤ë¡£ + +.\"O The argument +.\"O .I flags +.\"O can be zero or the following +.\"O constant: +°ú¤­¿ô +.I flags +¤Ë¤Ï¥¼¥í¤«°Ê²¼¤ÎÄê¿ô¤ò»ØÄê¤Ç¤­¤ë¡£ +.TP +.B SPU_RAWIO +.\"O Allow mapping of some of the hardware registers of the SPU into user +.\"O space. +.\"O This flag requires the +.\"O .B CAP_SYS_RAWIO +.\"O capability. +SPU ¤Î¥Ï¡¼¥É¥¦¥§¥¢¥ì¥¸¥¹¥¿¤Î¤¤¤¯¤Ä¤«¤ò¥æ¡¼¥¶¶õ´Ö¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¤³¤È¤ò +µö²Ä¤¹¤ë¡£¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤Ë¤Ï +.B CAP_SYS_RAWIO +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.PP +.\"O The new directory and files are created in the SPUFS with the +.\"O permissions set by the +.\"O .I mode +.\"O argument minus those set in the process's +.\"O .BR umask (2). +.\"O The actual permissions set for each file also depend on whether the +.\"O file supports read and/or write accesses. +SPUFS Æâ¤Ë¿·¤·¤¯À¸À®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤È¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹µö²Ä¤Ï¡¢ +.I mode +°ú¤­¿ô¤«¤é¤½¤Î¥×¥í¥»¥¹¤Î +.BR umask (2) +¤ò°ú¤¤¤¿ÃͤËÀßÄꤵ¤ì¤ë¡£ +³Æ¥Õ¥¡¥¤¥ë¤Î¼ÂºÝ¤Î¥¢¥¯¥»¥¹µö²Ä¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬Æɤ߽Ф·¥¢¥¯¥»¥¹¤ä +½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«¤â¹Íθ¤·¤Æ·è¤Þ¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR spu_create (2) +.\"O returns a new file descriptor. +.\"O On error, \-1 is returned and +.\"O .I errno +.\"O is set to one of the error codes listed below. +À®¸ù¤¹¤ë¤È¡¢ +.BR spu_create (2) +¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë°Ê²¼¤Î¥ê¥¹¥È¤Ëµ­ºÜ¤Î¥¨¥é¡¼¥³¡¼¥É¤Î¤¤¤º¤ì¤«¤òÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O The current user does not have write access to the SPUFS mount point. +¸½ºß¤Î¥æ¡¼¥¶¤¬ SPUFS ¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EEXIST +.\"O An SPU context already exists in the given path name. +»ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤Î SPU ¥³¥ó¥Æ¥­¥¹¥È¤¬¤¹¤Ç¤ËÀ¸À®¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EFAULT +.\"O .I pathname +.\"O is not a valid string pointer in the current address space. +.I pathname +¤¬¸½ºß¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ÇÍ­¸ú¤Êʸ»úÎó¥Ý¥¤¥ó¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O .I pathname +.\"O is not a directory in the SPUFS mount point. +.I pathname +¤¬ SPUFS ¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥¿Æâ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ELOOP +.\"O Too many symlinks were found while resolving +.\"O .IR pathname . +.I pathname +¤ò²ò·è¤¹¤ë¤Þ¤Ç¤Ëé¤Ã¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Â¿²á¤®¤¿¡£ +.TP +.B EMFILE +.\"O The process has reached its maximum open files limit. +¤½¤Î¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¾å¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENAMETOOLONG +.\"O .I pathname +.\"O is too long. +.I pathname +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENFILE +.\"O The system has reached the global open files limit. +¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¾å¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENOENT +.\"O Part of +.\"O .I pathname +.\"O could not be resolved. +.I pathname +¤Î°ìÉô¤¬²ò·è¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O The kernel could not allocate all resources required. +¥«¡¼¥Í¥ë¤¬É¬Íפʥ꥽¡¼¥¹¤ÎÁ´¤Æ¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOSPC +.\"O There are not enough SPU resources available to create +.\"O a new context or the user specific limit for the number +.\"O of SPU contexts has been reached. +¿·¤·¤¤¥³¥ó¥Æ¥­¥¹¥È¤òÀ¸À®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê SPU ¥ê¥½¡¼¥¹¤¬¤Ê¤«¤Ã¤¿¡¢ +¤Þ¤¿¤Ï SPU ¥³¥ó¥Æ¥­¥¹¥È¿ô¤¬¤½¤Î¥æ¡¼¥¶¤ÎÆÃÄê¤Î¾å¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENOSYS +.\"O The functionality is not provided by the current system, because +.\"O either the hardware does not provide SPUs or the spufs module is not +.\"O loaded. +µ¡Ç½¤¬Æ°ºîÃæ¤Î¥·¥¹¥Æ¥à¤ÇÄ󶡤µ¤ì¤Æ¤¤¤Ê¤¤¡£Íýͳ¤Ï¡¢ +¥Ï¡¼¥É¥¦¥§¥¢¤Ç SPU ¤¬Ä󶡤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +spufs ¥â¥¸¥å¡¼¥ë¤¬¥í¡¼¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢¤Î¤É¤Á¤é¤«¤Ç¤¢¤ë¡£ +.TP +.B ENOTDIR +.\"O A part of +.\"O .I pathname +.\"O is not a directory. +.I pathname +¤Î°ìÉô¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.\"O .I pathname +.\"O must point to a location beneath the mount point of the SPUFS. +.\"O By convention, it gets mounted in +.\"O .IR /spu . +.I pathname +¤Ï SPUFS ¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ÎÇÛ²¼¤Î¾ì½ê¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +´·Îã¤Ç¤Ï¡¢SPUFS ¤Ï +.I /spu +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The +.\"O .BR spu_create (2) +.\"O system call was added to Linux in kernel 2.6.16. +.BR spu_create (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.6.16 ¤Ç Linux ¤ËÄɲ䵤줿¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O This call is Linux specific and only implemented by the ppc64 +.\"O architecture. +.\"O Programs using this system call are not portable. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢ +ppc64 ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Î¤ß¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤¿¥×¥í¥°¥é¥à¤Ï°Ü¿¢À­¤¬¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Glibc does not provide a wrapper for this system call; call it using +.\"O .BR syscall (2). +.\"O Note however, that +.\"O .BR spu_create () +.\"O is meant to be used from libraries that implement a more abstract +.\"O interface to SPUs, not to be used from regular applications. +.\"O See +.\"O .I http://www.bsc.es/projects/deepcomputing/linuxoncell/ +.\"O for the recommended libraries. +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤¦¤³¤È¡£¤¿¤À¤·¡¢ +.BR spu_create () +¤Ï ¤è¤êÃê¾ÝÅ٤ι⤤ SPU ¤Ø¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¼ÂÁõ¤¹¤ë¥é¥¤¥Ö¥é¥ê¤«¤é +ÍøÍѤµ¤ì¤ë¤³¤È¤ò°Õ¿Þ¤·¤¿¤â¤Î¤Ç¤¢¤ê¡¢Ä̾ï¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é +»ÈÍѤϰտޤµ¤ì¤Æ¤¤¤Ê¤¤¡£¿ä¾©¤Î¥é¥¤¥Ö¥é¥ê¤Ë¤Ä¤¤¤Æ¤Ï +.I http://www.bsc.es/projects/deepcomputing/linuxoncell/ +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The code does not yet fully implement all features outlined here. +¼ÂºÝ¤Î¥³¡¼¥É¤Ç¤Ï¤³¤³¤Ç½Ò¤Ù¤¿Á´¤Æ¤Îµ¡Ç½¤¬´°Á´¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.\" .SH AUTHOR +.\" Arnd Bergmann +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR spu_run (2), +.BR capabilities (7), +.BR spufs (7) diff --git a/draft/man2/spu_run.2 b/draft/man2/spu_run.2 new file mode 100644 index 00000000..a9b0df73 --- /dev/null +++ b/draft/man2/spu_run.2 @@ -0,0 +1,394 @@ +.\" Copyright (c) International Business Machines Corp., 2006 +.\" +.\" 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 +.\" +.\" HISTORY: +.\" 2005-09-28, created by Arnd Bergmann +.\" 2006-06-16, revised by Eduardo M. Fleury +.\" 2007-07-10, some polishing by mtk +.\" 2007-09-28, updates for newer kernels, added example +.\" by Jeremy Kerr +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-10-19, Akihiro MOTOKI +.\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.04 +.\" +.TH SPU_RUN 2 2007-11-25 Linux "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O spu_run \- execute an SPU context +spu_run \- SPU ¥³¥ó¥Æ¥­¥¹¥È¤ò¼Â¹Ô¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "int spu_run(int " fd ", unsigned int *" npc \ +", unsigned int *" event ");" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR spu_run () +.\"O system call is used on PowerPC machines that implement the +.\"O Cell Broadband Engine Architecture in order to access Synergistic +.\"O Processor Units (SPUs). +.\"O The +.\"O .I fd +.\"O argument is a file descriptor returned by +.\"O .BR spu_create (2) +.\"O that refers to a specific SPU context. +.\"O When the context gets scheduled to a physical SPU, +.\"O it starts execution at the instruction pointer passed in +.\"O .IR npc . +.BR spu_run () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢Cell Broadband Engine ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò¼ÂÁõ¤·¤¿ +PowerPC ¥Þ¥·¥ó¤Ç Synergistic Processor Units (SPU) ¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Ë +»ÈÍѤµ¤ì¤ë¡£ +.I fd +°ú¤­¿ô¤Ï¡¢ +.BR spu_create (2) +¤¬ÊÖ¤¹¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¡¢ +ÆÃÄê¤Î SPU ¥³¥ó¥Æ¥­¥¹¥È¤ò»²¾È¤¹¤ë¡£ +¤½¤Î¥³¥ó¥Æ¥­¥¹¥È¤¬ÊªÍý SPU ¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¤È¡¢ +.I npc +¤ÇÅϤµ¤ì¤¿Ì¿Îá¥Ý¥¤¥ó¥¿ (instruction pointer) ¤«¤é¼Â¹Ô¤¬³«»Ï¤µ¤ì¤ë¡£ + +.\"O Execution of SPU code happens synchronously, meaning that +.\"O .BR spu_run () +.\"O blocks while the SPU is still running. +.\"O If there is a need +.\"O to execute SPU code in parallel with other code on either the +.\"O main CPU or other SPUs, a new thread of execution must be created +.\"O first (e.g., using +.\"O .BR pthread_create (3)). +SPU ¥³¡¼¥É¤Î¼Â¹Ô¤ÏƱ´üŪ (synchronously) ¤Ë¹Ô¤ï¤ì¤ë¡¢¤Ä¤Þ¤ê +SPU ¤¬¼Â¹ÔÃæ¤Ï +.BR spu_run () +¤ÏÄä»ß (block) ¤¹¤ë¡£ +SPU ¥³¡¼¥É¤Î¼Â¹Ô¤ò¥á¥¤¥ó CPU ¤ä¾¤Î SPU ¤ÈʹԤ·¤Æ¹Ô¤¦É¬Íפ¬¤¢¤ë¾ì¹ç¤Ï¡¢ +ºÇ½é¤Ë¡¢¤½¤Î SPU ¥³¡¼¥É¤ò¼Â¹Ô¤¹¤ë¿·¤·¤¤¥¹¥ì¥Ã¥É¤ò¡¢(Î㤨¤Ð +.BR pthread_create (3) +¤Ê¤É¤ò»È¤Ã¤Æ) À¸À®¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O When +.\"O .BR spu_run () +.\"O returns, the current value of the SPU program counter is written to +.\"O .IR npc , +.\"O so successive calls to +.\"O .BR spu_run () +.\"O can use the same +.\"O .I npc +.\"O pointer. +.BR spu_run () +¤¬ÊÖ¤ë¤È¤­¤Ë¤Ï¡¢SPU ¤Î¥×¥í¥°¥é¥à¥«¥¦¥ó¥¿¤Î¸½ºßÃͤ¬ +.I npc +¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢Ï¢Â³¤¹¤ë +.BR spu_run () +¤Î¸Æ¤Ó½Ð¤·¤ÇƱ¤¸ +.I npc +¥Ý¥¤¥ó¥¿¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O The +.\"O .I event +.\"O argument provides a buffer for an extended status code. +.\"O If the SPU +.\"O context was created with the +.\"O .B SPU_CREATE_EVENTS_ENABLED +.\"O flag, then this buffer is populated by the Linux kernel before +.\"O .BR spu_run () +.\"O returns. +.I event +°ú¤­¿ô¤Ë¤Ï¡¢³ÈÄ¥¥¹¥Æ¡¼¥¿¥¹¥³¡¼¥ÉÍѤΥХåե¡¤ò»ØÄꤹ¤ë¡£ +.B SPU_CREATE_EVENTS_ENABLED +¥Õ¥é¥°ÉÕ¤­¤Ç SPU ¥³¥ó¥Æ¥­¥¹¥È¤¬ºîÀ®¤µ¤ì¤ë¤È¡¢ +.BR spu_run () +¤¬ÊÖ¤ëÁ°¤Ë Linux ¥«¡¼¥Í¥ë¤Ë¤è¤ê¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ë +³ÈÄ¥¥¹¥Æ¡¼¥¿¥¹¥³¡¼¥É¤¬³ÊǼ¤µ¤ì¤ë¡£ + +.\"O The status code may be one (or more) of the following constants: +¥¹¥Æ¡¼¥¿¥¹¥³¡¼¥É¤Ë¤Ï°Ê²¼¤ÎÄê¿ô¤¬°ì¤Ä°Ê¾åÆþ¤ë¡£ +.TP +.B SPE_EVENT_DMA_ALIGNMENT +.\"O A DMA alignment error occurred. +DMA (direct memory access) ¤Î¥¢¥é¥¤¥á¥ó¥È¡¦¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B SPE_EVENT_INVALID_DMA +.\"O An invalid MFC DMA command was attempted. +̵¸ú¤Ê MFC (Memory Flow Controller) DMA ¥³¥Þ¥ó¥É¤ò¹Ô¤ª¤¦¤È¤·¤¿¡£ +.TP +.B SPE_EVENT_SPE_DATA_STORAGE +.\"O A DMA storage error occurred. +DMA ¥¹¥È¥ì¡¼¥¸¡¦¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B SPE_EVENT_SPE_ERROR +.\"O An illegal instruction was executed. +ÉÔÀµ¤ÊÌ¿Î᤬¼Â¹Ô¤µ¤ì¤¿¡£ +.PP +.\"O NULL +.\"O is a valid value for the +.\"O .I event +.\"O argument. +.\"O In this case, the events will not be reported to the calling process. +NULL ¤Ï +.I event +°ú¤­¿ô¤È¤·¤ÆÍ­¸ú¤ÊÃͤǤ¢¤ë¡£ +¤³¤Î¾ì¹ç¡¢¥¤¥Ù¥ó¥È¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÊó¹ð¤µ¤ì¤Ê¤¤¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR spu_run () +.\"O returns the value of the +.\"O .I spu_status +.\"O register. +.\"O On error it returns \-1 and sets +.\"O .I errno +.\"O to one of the error codes listed below. +À®¸ù¤¹¤ë¤È¡¢ +.BR spu_run () +¤Ï +.I spu_status +¥ì¥¸¥¹¥¿¤ÎÃͤòÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò²¼µ­¤Î¥¨¥é¡¼¥³¡¼¥É¤Î¤¤¤º¤ì¤«¤ËÀßÄꤹ¤ë¡£ + +.\"O The +.\"O .I spu_status +.\"O register value is a bit mask of status codes and +.\"O optionally a 14-bit code returned from the +.\"O .BR stop-and-signal +.\"O instruction on the SPU. +.\"O The bit masks for the status codes +.\"O are: +.I spu_status +¥ì¥¸¥¹¥¿¤ÎÃͤϡ¢¥¹¥Æ¡¼¥¿¥¹¥³¡¼¥É¤È SPU ¤Î +.B stop-and-signal +Ì¿Î᤬ÊÖ¤¹ 14 ¥Ó¥Ã¥È¤Î¥³¡¼¥É¤Î +¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¹½À®¤µ¤ì¤ë¡£ +¸å¼Ô¤Î 14 ¥Ó¥Ã¥È¤Î¥³¡¼¥É¤Ï¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +¥¹¥Æ¡¼¥¿¥¹¥³¡¼¥É¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ï²¼µ­¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.TP +.B 0x02 +.\"O SPU was stopped by a +.\"O .BR stop-and-signal +.\"O instruction. +SPU ¤¬ +.B stop-and-signal +Ì¿Îá¤ÇÄä»ß¤·¤¿¡£ +.TP +.B 0x04 +.\"O SPU was stopped by a +.\"O .BR halt +.\"O instruction. +SPU ¤¬ +.B "halt (Ää»ß)" +Ì¿Îá¤Ç»ß¤Þ¤Ã¤¿¡£ +.TP +.B 0x08 +.\"O SPU is waiting for a channel. +SPU ¤Ï¥Á¥ã¥ó¥Í¥ë¤Î¥¦¥§¥¤¥ÈÃæ¤Ç¤¢¤ë¡£ +.TP +.B 0x10 +.\"O SPU is in single-step mode. +SPU ¤Ï¥·¥ó¥°¥ë¥¹¥Æ¥Ã¥×¥â¡¼¥É¤Ç¤¢¤Ã¤¿¡£ +.TP +.B 0x20 +.\"O SPU has tried to execute an invalid instruction. +SPU ¤¬ÉÔÀµ¤ÊÌ¿Îá¤ò¼Â¹Ô¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B 0x40 +.\"O SPU has tried to access an invalid channel. +SPU ¤¬ÉÔÀµ¤Ê¥Á¥ã¥ó¥Í¥ë¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B 0x3fff0000 +.\"O The bits masked with this value contain the code returned from a +.\"O .BR stop-and-signal +.\"O instruction. +.\"O These bits are only valid if the 0x02 bit is set. +¤³¤ÎÃͤΥޥ¹¥¯¤òŬÍѤ·¤ÆÆÀ¤é¤ì¤¿¥Ó¥Ã¥ÈÃͤˤϡ¢ +stop-and-signal Ì¿Îᤫ¤éÊÖ¤µ¤ì¤¿¥³¡¼¥É¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥Ó¥Ã¥È¤Ï 0x02 ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +.PP +.\"O If +.\"O .BR spu_run () +.\"O has not returned an error, one or more bits among the lower eight +.\"O ones are always set. +.BR spu_run () +¤¬¥¨¥é¡¼¤òÊÖ¤µ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢²¼°Ì 8 ¥Ó¥Ã¥È¤Î¤¦¤Á 1 ¤Ä°Ê¾å¤Ï +¾ï¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O .I fd +.\"O is not a valid file descriptor. +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EFAULT +.\"O .I npc +.\"O is not a valid pointer, or +.\"O .I event +.\"O is non-NULL and an invalid pointer. +.I npc +¤¬Í­¸ú¤Ê¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¤¡£¤Þ¤¿¤Ï +.I event +¤¬ NULL °Ê³°¤Ç¡¢¤·¤«¤â̵¸ú¤Ê¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.TP +.B EINTR +.\"O A signal occurred while +.\"O .BR spu_run () +.\"O was in progress; see +.\"O .BR signal (7). +.\"O The +.\"O .I npc +.\"O value has been updated to the new program counter value if +.\"O necessary. +.BR spu_run () +¤Î¼Â¹ÔÃæ¤Ë¥·¥°¥Ê¥ë¤¬È¯À¸¤·¤¿¡£ +.BR signal (7) +»²¾È¡£ +ɬÍפǤ¢¤ì¤Ð¡¢ +.I npc +¤ÎÃͤϿ·¤·¤¤¥×¥í¥°¥é¥à¥«¥¦¥ó¥¿¤ÎÃͤ˹¹¿·¤µ¤ì¤ë¡£ +.TP +.B EINVAL +.\"O .I fd +.\"O is not a valid file descriptor returned from +.\"O .BR spu_create (2). +.I fd +¤¬ +.BR spu_create (2) +¤¬ÊÖ¤·¤¿Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B ENOMEM +.\"O There was not enough memory available to handle a page fault +.\"O resulting from a Memory Flow Controller (MFC) direct memory access. +Memory Flow Controller (MFC) DMA ¤Ë¤è¤êȯÀ¸¤·¤¿¥Ú¡¼¥¸¥Õ¥©¡¼¥ë¥È¤ò +½èÍý¤¹¤ë¤Î¤ËɬÍפʥá¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOSYS +.\"O The functionality is not provided by the current system, because +.\"O either the hardware does not provide SPUs or the spufs module is not +.\"O loaded. +µ¡Ç½¤¬Æ°ºîÃæ¤Î¥·¥¹¥Æ¥à¤ÇÄ󶡤µ¤ì¤Æ¤¤¤Ê¤¤¡£Íýͳ¤Ï¡¢ +¥Ï¡¼¥É¥¦¥§¥¢¤Ç SPU ¤¬Ä󶡤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +spufs ¥â¥¸¥å¡¼¥ë¤¬¥í¡¼¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢¤Î¤É¤Á¤é¤«¤Ç¤¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The +.\"O .BR spu_run () +.\"O system call was added to Linux in kernel 2.6.16. +.BR spu_run () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.6.16 ¤Ç Linux ¤ËÄɲ䵤줿¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O This call is Linux-specific and only implemented by the PowerPC +.\"O architecture. +.\"O Programs using this system call are not portable. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢ +PowerPC ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Î¤ß¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤¿¥×¥í¥°¥é¥à¤Ï°Ü¿¢À­¤¬¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Glibc does not provide a wrapper for this system call; call it using +.\"O .BR syscall (2). +.\"O Note however, that +.\"O .BR spu_run () +.\"O is meant to be used from libraries that implement a more abstract +.\"O interface to SPUs, not to be used from regular applications. +.\"O See +.\"O .I http://www.bsc.es/projects/deepcomputing/linuxoncell/ +.\"O for the recommended libraries. +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤¦¤³¤È¡£¤¿¤À¤·¡¢ +.BR spu_run () +¤Ï ¤è¤êÃê¾ÝÅ٤ι⤤ SPU ¤Ø¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¼ÂÁõ¤¹¤ë¥é¥¤¥Ö¥é¥ê¤«¤é +ÍøÍѤµ¤ì¤ë¤³¤È¤ò°Õ¿Þ¤·¤¿¤â¤Î¤Ç¤¢¤ê¡¢Ä̾ï¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é +»ÈÍѤϰտޤµ¤ì¤Æ¤¤¤Ê¤¤¡£¿ä¾©¤Î¥é¥¤¥Ö¥é¥ê¤Ë¤Ä¤¤¤Æ¤Ï +.I http://www.bsc.es/projects/deepcomputing/linuxoncell/ +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The following is an example of running a simple, one-instruction SPU +.\"O program with the +.\"O .BR spu_run () +.\"O system call. +°Ê²¼¤Ï¡¢´Êñ¤Ê 1 Ì¿Îá¤Î SPU ¥×¥í¥°¥é¥à¤ò +.BR spu_run () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¼Â¹Ô¤µ¤»¤ëÎã¤Ç¤¢¤ë¡£ + +.nf +#include +#include +#include +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int main(void) +{ + int context, fd, spu_status; + uint32_t instruction, npc; + + context = spu_create("/spu/example\-context", 0, 0755); + if (context == -1) + handle_error("spu_create"); + + /* write a \(aqstop 0x1234\(aq instruction to the SPU\(aqs + * local store memory + */ + instruction = 0x00001234; + + fd = open("/spu/example\-context/mem", O_RDWR); + if (fd == -1) + handle_error("open"); + write(fd, &instruction, sizeof(instruction)); + + /* set npc to the starting instruction address of the + * SPU program. Since we wrote the instruction at the + * start of the mem file, the entry point will be 0x0 + */ + npc = 0; + + spu_status = spu_run(context, &npc, NULL); + if (spu_status == -1) + handle_error("open"); + + /* we should see a status code of 0x1234002: + * 0x00000002 (spu was stopped due to stop\-and\-signal) + * | 0x12340000 (the stop\-and\-signal code) + */ + printf("SPU Status: 0x%08x\\n", spu_status); + + exit(EXIT_SUCCESS); +} +.fi +.\" .SH AUTHORS +.\" Arnd Bergmann , Jeremy Kerr +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR spu_create (2), +.BR capabilities (7), +.BR spufs (7) diff --git a/draft/man2/stat.2 b/draft/man2/stat.2 new file mode 100644 index 00000000..186abc47 --- /dev/null +++ b/draft/man2/stat.2 @@ -0,0 +1,1018 @@ +'\" t +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 +.\" Parts Copyright (c) 1995 Nicolai Langfeldt (janl@ifi.uio.no), 1/1/95 +.\" 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 by Michael Haardt +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1995-05-18 by Todd Larason +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 1995-01-09 by Richard Kettlewell +.\" Modified 1998-05-13 by Michael Haardt +.\" Modified 1999-07-06 by aeb & Albert Cahalan +.\" Modified 2000-01-07 by aeb +.\" Modified 2004-06-23 by Michael Kerrisk +.\" 2007-06-08 mtk: Added example program +.\" 2007-07-05 mtk: Added details on underlying system call interfaces +.\" +.\" Japanese Version Copyright (c) 1998-1999 HANATAKA Shinya +.\" and Copyright (c) 2005-2008 Akihiro MOTOKI +.\" +.\" Translated 1998-06-21, HANATAKA Shinya +.\" Modified 1999-04-16, HANATAKA Shinya +.\" Updated 2000-01-03, Kentaro Shirakata +.\" Updated 2000-10-06, Kentaro Shirakata +.\" Updated 2001-04-09, Kentaro Shirakata +.\" Updated 2001-06-25, Kentaro Shirakata +.\" Updated 2005-02-28, Akihiro MOTOKI +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2005-11-19, Akihiro MOTOKI, catch up to LDP v2.14 +.\" Updated 2006-07-21, Akihiro MOTOKI, LDP v2.36 +.\" Updated 2007-06-13, Akihiro MOTOKI, LDP v2.55 +.\" Updated 2008-09-19, Akihiro MOTOKI, LDP v3.08 +.\" +.\"WORD: status ¾õÂÖ +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: implement ¼ÂÁõ +.\"WORD: owner ½êÍ­¼Ô +.\"WORD: group ¥°¥ë¡¼¥× +.\"WORD: user ¥æ¡¼¥¶¡¼ +.\"WORD: other ¾¿Í +.\"WORD: hard link count ¥Ï¡¼¥É¡¦¥ê¥ó¥¯¿ô +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: socket ¥½¥±¥Ã¥È +.\"WORD: device ¥Ç¥Ð¥¤¥¹ +.\"WORD: sticky bit ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È +.\"WORD: mandatory locking ¶¯À©¥í¥Ã¥¯ +.\" +.TH STAT 2 2009-09-30 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O stat, fstat, lstat \- get file status +stat, fstat, lstat \- ¥Õ¥¡¥¤¥ë¤Î¾õÂÖ¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.br +.B #include +.sp +.BI "int stat(const char *" path ", struct stat *" buf ); +.br +.BI "int fstat(int " fd ", struct stat *" buf ); +.br +.BI "int lstat(const char *" path ", struct stat *" buf ); +.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 lstat (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.PP +.\"O These functions return information about a file. +.\"O No permissions are required on the file itself, but \(em in the case of +.\"O .BR stat () +.\"O and +.\"O .BR lstat () +.\"O \(em +.\"O execute (search) permission is required on all of the directories in +.\"O .I path +.\"O that lead to the file. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÊÖ¤¹¡£ +¥Õ¥¡¥¤¥ë¤½¤Î¤â¤Î¤ËÂФ¹¤ë¥¢¥¯¥»¥¹µö²Ä¤ÏɬÍפȤ·¤Ê¤¤¤¬¡¢ +\(em +.BR stat () +¤È +.BR lstat () +¤Î¾ì¹ç¤Ë¤Ï +\(em +¤½¤Î¥Õ¥¡¥¤¥ë¤Ø»ê¤ë +.I path +¤ò¹½À®¤¹¤ëÁ´¤Æ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ¹¤ë¼Â¹Ô (¸¡º÷) µö²Ä¤¬É¬ÍפǤ¢¤ë¡£ +.PP +.\"O .BR stat () +.\"O stats the file pointed to by +.\"O .I path +.\"O and fills in +.\"O .IR buf . +.BR stat () +¤Ï +.I path +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¾õÂÖ¤ò¼èÆÀ¤·¤Æ +.I buf +¤Ø³ÊǼ¤¹¤ë¡£ + +.\"O .BR lstat () +.\"O is identical to +.\"O .BR stat (), +.\"O except that if +.\"O .I path +.\"O is a symbolic link, then the link itself is stat-ed, +.\"O not the file that it refers to. +.BR lstat () +¤Ï +.BR stat () +¤ÈƱ¤¸¤Ç¤¢¤ë¤¬¡¢ +.I path +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¡¢¥ê¥ó¥¯¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Ç¤Ï¤Ê¤¯¡¢ +¥ê¥ó¥¯¼«¿È¤Î¾õÂÖ¤ò¼èÆÀ¤¹¤ëÅÀ¤¬°Û¤Ê¤ë¡£ + +.\"O .BR fstat () +.\"O is identical to +.\"O .BR stat (), +.\"O except that the file to be stat-ed is specified by the file descriptor +.\"O .IR fd . +.BR fstat () +¤Ï +.BR stat () +¤ÈƱ¤¸¤À¤¬¡¢ +¾õÂÖ¤ò¼èÆÀ¤¹¤ë¥Õ¥¡¥¤¥ë¤ò¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ç»ØÄꤹ¤ë¡£ +.PP +.\"O All of these system calls return a +.\"O .I stat +.\"O structure, which contains the following fields: +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤¤¤º¤ì¤â¡¢·ë²Ì¤ò +.I stat +¹½Â¤ÂΤËÆþ¤ì¤ÆÊÖ¤¹¡£ +.I stat +¹½Â¤ÂΤˤϰʲ¼¤Î¥Õ¥£¡¼¥ë¥É¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë: +.PP +.in +4n +.nf +struct stat { +.\"O dev_t st_dev; /* ID of device containing file */ +.\"O ino_t st_ino; /* inode number */ +.\"O mode_t st_mode; /* protection */ +.\"O nlink_t st_nlink; /* number of hard links */ +.\"O uid_t st_uid; /* user ID of owner */ +.\"O gid_t st_gid; /* group ID of owner */ +.\"O dev_t st_rdev; /* device ID (if special file) */ +.\"O off_t st_size; /* total size, in bytes */ +.\"O blksize_t st_blksize; /* blocksize for file system I/O */ +.\"O blkcnt_t st_blocks; /* number of 512B blocks allocated */ +.\"O time_t st_atime; /* time of last access */ +.\"O time_t st_mtime; /* time of last modification */ +.\"O time_t st_ctime; /* time of last status change */ + dev_t st_dev; /* ¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¥Ç¥Ð¥¤¥¹¤Î ID */ + ino_t st_ino; /* inode ÈÖ¹æ */ + mode_t st_mode; /* ¥¢¥¯¥»¥¹Êݸî */ + nlink_t st_nlink; /* ¥Ï¡¼¥É¥ê¥ó¥¯¤Î¿ô */ + uid_t st_uid; /* ½êÍ­¼Ô¤Î¥æ¡¼¥¶ ID */ + gid_t st_gid; /* ½êÍ­¼Ô¤Î¥°¥ë¡¼¥× ID */ + dev_t st_rdev; /* ¥Ç¥Ð¥¤¥¹ ID (Æüì¥Õ¥¡¥¤¥ë¤Î¾ì¹ç) */ + off_t st_size; /* Á´ÂΤΥµ¥¤¥º (¥Ð¥¤¥Èñ°Ì) */ + blksize_t st_blksize; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à I/O ¤Ç¤Î + ¥Ö¥í¥Ã¥¯¥µ¥¤¥º */ + blkcnt_t st_blocks; /* ³ä¤êÅö¤Æ¤é¤ì¤¿ 512B ¤Î¥Ö¥í¥Ã¥¯¿ô */ + time_t st_atime; /* ºÇ½ª¥¢¥¯¥»¥¹»þ¹ï */ + time_t st_mtime; /* ºÇ½ª½¤Àµ»þ¹ï */ + time_t st_ctime; /* ºÇ½ª¾õÂÖÊѹ¹»þ¹ï */ +}; +.fi +.in +.PP +.\"O The +.\"O .I st_dev +.\"O field describes the device on which this file resides. +.\"O (The +.\"O .BR major (3) +.\"O and +.\"O .BR minor (3) +.\"O macros may be useful to decompose the device ID in this field.) +.I st_dev +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¥Ç¥Ð¥¤¥¹¤ò¼¨¤¹ +(¥Þ¥¯¥í +.BR major (3), +.BR minor (3) +¤Ï¡¢¤³¤Î¥Õ¥£¡¼¥ë¥É¤Î¥Ç¥Ð¥¤¥¹ ID ¤òʬ²ò¤¹¤ë¤Î¤ËÌòΩ¤Ä¤À¤í¤¦)¡£ + +.\"O The +.\"O .I st_rdev +.\"O field describes the device that this file (inode) represents. +.I st_rdev +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë (inode) ¤¬É½¤¹¥Ç¥Ð¥¤¥¹¤ò¼¨¤¹¡£ + +.\"O The +.\"O .I st_size +.\"O field gives the size of the file (if it is a regular +.\"O file or a symbolic link) in bytes. +.\"O The size of a symlink is the length of the pathname +.\"O it contains, without a trailing null byte. +.I st_size +¥Õ¥£¡¼¥ë¥É¤Ï¡¢(Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤«¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ë) +¥Õ¥¡¥¤¥ë¤ÎÂ礭¤µ¤ò¥Ð¥¤¥Èñ°Ì¤Ç¼¨¤¹¡£ +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ÎÂ礭¤µ¤Ï¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë +¥Ñ¥¹Ì¾¤ÎŤµ (ºÇ¸å¤Î NULL ¥Ð¥¤¥È¤Ï´Þ¤Þ¤Ê¤¤) ¤Ç¤¢¤ë¡£ + +.\"O The +.\"O .I st_blocks +.\"O field indicates the number of blocks allocated to the file, 512-byte units. +.\"O (This may be smaller than +.\"O .IR st_size /512 +.\"O when the file has holes.) +.I st_blocks +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥Õ¥¡¥¤¥ë¤ÎÂ礭¤µ¤ò 512 ¥Ð¥¤¥È¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥ºÃ±°Ì¤Ç¼¨¤¹ +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥Õ¥¡¥¤¥ë¤Ë³ä¤êÅö¤Æ¤µ¤ì¤¿¥Ö¥í¥Ã¥¯¿ô¤ò 512 ¥Ð¥¤¥Èñ°Ì¤Ç¼¨¤¹¡£ +(¥Õ¥¡¥¤¥ë¤Ë·ê¤¬¤¢¤ë¤è¤¦¤Ê¾ì¹ç¡¢¤³¤ÎÃÍ¤Ï +.IR st_size /512 +¤è¤ê¾®¤µ¤¯¤Ê¤ë¤³¤È¤â¤¢¤ë)¡£ + +.\"O The +.\"O .I st_blksize +.\"O field gives the "preferred" blocksize for efficient file system I/O. +.\"O (Writing to a file in smaller chunks may cause +.\"O an inefficient read-modify-rewrite.) +.I st_blksize +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¸úΨŪ¤Ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à I/O ¤¬¤Ç¤­¤ë¡Ö¹¥¤Þ¤·¤¤¡× +¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ò¼¨¤¹ (¤â¤Ã¤È¾®¤µ¤¤Ã±°Ì¤Ç¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤È¡¢ +Æɤ߽Ф·--½¤Àµ--ºÆ½ñ¤­¹þ¤ß¤È¤¤¤Ã¤¿Èó¸úΨ¤ÊÆ°ºî¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¤«¤â¤·¤ì¤Ê¤¤)¡£ +.PP +.\"O Not all of the Linux file systems implement all of the time fields. +.\"O Some file system types allow mounting in such a way that file +.\"O and/or directory accesses do not cause an update of the +.\"O .I st_atime +.\"O field. +.\"O (See +.\"O .IR noatime , +.\"O .IR nodiratime , +.\"O and +.\"O .I relatime +.\"O in +.\"O .BR mount (8), +.\"O and related information in +.\"O .BR mount (2).) +Á´¤Æ¤Î Linux ¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬Á´¤Æ¤Î»þ´Ö¥Õ¥£¡¼¥ë¥É¤ò +¼ÂÁõ¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤Î¥¢¥¯¥»¥¹¤¬ +.I st_atime +¥Õ¥£¡¼¥ë¥É¤ò¹¹¿·¤·¤Ê¤¤¤è¤¦¤Ê¤«¤¿¤Á¤Ç¥Þ¥¦¥ó¥È¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.RB ( mount (8) +¤Î +.IR noatime , +.IR nodiratime , +.I relatime +¤ä +.BR mount (2) +¤Î´ØÏ¢¤¹¤ë¾ðÊó¤ò»²¾È)¡£ +.\"O In addition, +.\"O .I st_atime +.\"O is not updated if a file is opened with the +.\"O .BR O_NOATIME ; +.\"O see +.\"O .BR open (2). +¤Þ¤¿¡¢¥Õ¥¡¥¤¥ë¤¬ +.B O_NOATIME +ÉÕ¤­¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï +.I st_atime +¤Ï¹¹¿·¤µ¤ì¤Ê¤¤¡£ +.BR open (2) +»²¾È¡£ + +.\"O The field +.\"O .I st_atime +.\"O is changed by file accesses, for example, by +.\"O .BR execve (2), +.\"O .BR mknod (2), +.\"O .BR pipe (2), +.\"O .BR utime (2) +.\"O and +.\"O .BR read (2) +.\"O (of more than zero bytes). +.\"O Other routines, like +.\"O .BR mmap (2), +.\"O may or may not update +.\"O .IR st_atime . +.I st_atime +¥Õ¥£¡¼¥ë¥É¤Ï¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÊѹ¹¤µ¤ì¤ë +(Î㤨¤Ð¡¢ +.BR execve (2), +.BR mknod (2), +.BR pipe (2), +.BR utime (2) +¤ò»ÈÍѤ·¤¿¾ì¹ç¤ä +.BR read (2) +¤Ç 1 ¥Ð¥¤¥È°Ê¾åÆɤ߹þ¤ó¤À¾ì¹ç¤Ê¤É)¡£ +.BR mmap (2) +¤Ê¤É¤Î¾¤Î¥ë¡¼¥Á¥ó¤Ç¤Ï¡¢ +.I st_atime +¤Ï¹¹¿·¤µ¤ì¤ë¤³¤È¤â¤¢¤ì¤Ð¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤â¤¢¤ë¡£ + +.\"O The field +.\"O .I st_mtime +.\"O is changed by file modifications, for example, by +.\"O .BR mknod (2), +.\"O .BR truncate (2), +.\"O .BR utime (2) +.\"O and +.\"O .BR write (2) +.\"O (of more than zero bytes). +.I st_mtime +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥Õ¥¡¥¤¥ë¤¬½¤Àµ¤µ¤ì¤¿¾ì¹ç¤ËÊѹ¹¤µ¤ì¤ë +(Î㤨¤Ð¡¢ +.BR mknod (2), +.BR truncate (2), +.BR utime (2) +¤ò»ÈÍѤ·¤¿¾ì¹ç¤ä +.BR write (2) +¤Ç 1 ¥Ð¥¤¥È°Ê¾å½ñ¤­¹þ¤ß¤ò¤·¤¿¾ì¹ç¤Ê¤É)¡£ +.\"O Moreover, +.\"O .I st_mtime +.\"O of a directory is changed by the creation or deletion of files +.\"O in that directory. +¤µ¤é¤Ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Î +.I st_mtime +¤Ï¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç +¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤¿¤êºï½ü¤µ¤ì¤¿¤ê¤¹¤ë¤ÈÊѹ¹¤µ¤ì¤ë¡£ +.\"O The +.\"O .I st_mtime +.\"O field is +.\"O .I not +.\"O changed for changes in owner, group, hard link count, or mode. +.I st_mtime +¥Õ¥£¡¼¥ë¥É¤Ï +½êÍ­¼Ô¤ä¥°¥ë¡¼¥×¤ä¥Ï¡¼¥É¡¦¥ê¥ó¥¯¿ô¤ä¥â¡¼¥É¤ÎÊѹ¹¤Ç¤ÏÊѹ¹ +.I ¤µ¤ì¤Ê¤¤¡£ + +.\"O The field +.\"O .I st_ctime +.\"O is changed by writing or by setting inode information +.\"O (i.e., owner, group, link count, mode, etc.). +.I st_ctime +¥Õ¥£¡¼¥ë¥É¤Ï½ñ¤­¹þ¤ß¤ä inode ¾ðÊó +(½êÍ­¼Ô¡¢¥°¥ë¡¼¥×¡¢¥ê¥ó¥¯¿ô¡¢¥â¡¼¥É¤Ê¤É) ¤Î +ÀßÄê¤Ë¤è¤Ã¤ÆÊѹ¹¤µ¤ì¤ë¡£ +.PP +.\"O The following POSIX macros are defined to check the file type using the +.\"O .I st_mode +.\"O field: +°Ê²¼¤Î POSIX ¥Þ¥¯¥í¤Ï¡¢ +.I st_mode +¥Õ¥£¡¼¥ë¥É +¤Ç»ÈÍѤµ¤ì¤ë¥Õ¥¡¥¤¥ë¼ïÊ̤ΥÁ¥§¥Ã¥¯¤Î¤¿¤á¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë : +.RS 4 +.TP 1.2i +.BR S_ISREG (m) +.\"O is it a regular file? +Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤«? +.TP +.BR S_ISDIR (m) +.\"O directory? +¥Ç¥£¥ì¥¯¥È¥ê¤«? +.TP +.BR S_ISCHR (m) +.\"O character device? +¥­¥ã¥é¥¯¥¿¡¼¡¦¥Ç¥Ð¥¤¥¹¤«? +.TP +.BR S_ISBLK (m) +.\"O block device? +¥Ö¥í¥Ã¥¯¡¦¥Ç¥Ð¥¤¥¹¤«? +.TP +.BR S_ISFIFO (m) +.\"O FIFO (named pipe)? +FIFO (̾Á°ÉÕ¤­¥Ñ¥¤¥×) ¤«? +.TP +.BR S_ISLNK (m) +.\"O symbolic link? (Not in POSIX.1-1996.) +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤«? (POSIX.1-1996 ¤Ë¤Ï¤Ê¤¤) +.TP +.BR S_ISSOCK (m) +.\"O socket? (Not in POSIX.1-1996.) +¥½¥±¥Ã¥È¤«? (POSIX.1-1996 ¤Ë¤Ï¤Ê¤¤) +.RE +.PP +.\"O The following flags are defined for the +.\"O .I st_mode +.\"O field: +°Ê²¼¤Î¥Õ¥é¥°¤¬ +.I st_mode +¥Õ¥£¡¼¥ë¥ÉÍѤËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.TS +lB l l. +.\"O S_IFMT 0170000 bit mask for the file type bit fields +.\"O S_IFSOCK 0140000 socket +.\"O S_IFLNK 0120000 symbolic link +.\"O S_IFREG 0100000 regular file +.\"O S_IFBLK 0060000 block device +.\"O S_IFDIR 0040000 directory +.\"O S_IFCHR 0020000 character device +.\"O S_IFIFO 0010000 FIFO +S_IFMT 0170000 ¥Õ¥¡¥¤¥ë¼ïÊ̤ò¼¨¤¹¥Ó¥Ã¥ÈÎΰè¤òɽ¤¹¥Ó¥Ã¥È¥Þ¥¹¥¯ +S_IFSOCK 0140000 ¥½¥±¥Ã¥È +S_IFLNK 0120000 ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +S_IFREG 0100000 Ä̾ï¤Î¥Õ¥¡¥¤¥ë +S_IFBLK 0060000 ¥Ö¥í¥Ã¥¯¡¦¥Ç¥Ð¥¤¥¹ +S_IFDIR 0040000 ¥Ç¥£¥ì¥¯¥È¥ê +S_IFCHR 0020000 ¥­¥ã¥é¥¯¥¿¡¼¡¦¥Ç¥Ð¥¤¥¹ +S_IFIFO 0010000 FIFO +.\"O S_ISUID 0004000 set-user-ID bit +.\"O S_ISGID 0002000 set-group-ID bit (see below) +.\"O S_ISVTX 0001000 sticky bit (see below) +S_ISUID 0004000 set-user-ID bit +S_ISGID 0002000 set-group-ID bit (²¼µ­»²¾È) +S_ISVTX 0001000 ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È (²¼µ­»²¾È) +.\"O S_IRWXU 00700 mask for file owner permissions +.\"O S_IRUSR 00400 owner has read permission +.\"O S_IWUSR 00200 owner has write permission +.\"O S_IXUSR 00100 owner has execute permission +S_IRWXU 00700 ¥Õ¥¡¥¤¥ë½êÍ­¼Ô¤Î¥¢¥¯¥»¥¹µö²ÄÍѤΥӥåȥޥ¹¥¯ +S_IRUSR 00400 ½êÍ­¼Ô¤ÎÆɤ߹þ¤ßµö²Ä +S_IWUSR 00200 ½êÍ­¼Ô¤Î½ñ¤­¹þ¤ßµö²Ä +S_IXUSR 00100 ½êÍ­¼Ô¤Î¼Â¹Ôµö²Ä +.\"O S_IRWXG 00070 mask for group permissions +.\"O S_IRGRP 00040 group has read permission +.\"O S_IWGRP 00020 group has write permission +.\"O S_IXGRP 00010 group has execute permission +S_IRWXG 00070 ¥°¥ë¡¼¥×¤Î¥¢¥¯¥»¥¹µö²ÄÍѤΥӥåȥޥ¹¥¯ +S_IRGRP 00040 ¥°¥ë¡¼¥×¤ÎÆɤ߹þ¤ßµö²Ä +S_IWGRP 00020 ¥°¥ë¡¼¥×¤Î½ñ¤­¹þ¤ßµö²Ä +S_IXGRP 00010 ¥°¥ë¡¼¥×¤Î¼Â¹Ôµö²Ä +.\"O S_IRWXO 00007 mask for permissions for others (not in group) +.\"O S_IROTH 00004 others have read permission +.\"O S_IWOTH 00002 others have write permission +.\"O S_IXOTH 00001 others have execute permission +S_IRWXO 00007 ¾¿Í (others) ¤Î¥¢¥¯¥»¥¹µö²ÄÍѤΥӥåȥޥ¹¥¯ +S_IROTH 00004 ¾¿Í¤ÎÆɤ߹þ¤ßµö²Ä +S_IWOTH 00002 ¾¿Í¤Î½ñ¤­¹þ¤ßµö²Ä +S_IXOTH 00001 ¾¿Í¤Î¼Â¹Ôµö²Ä +.TE +.in +.P +.\"O The set-group-ID bit +.\"O .RB ( S_ISGID ) +.\"O has several special uses. +.\"O For a directory it indicates that BSD semantics is to be used +.\"O for that directory: files created there inherit their group ID from +.\"O the directory, not from the effective group ID of the creating process, +.\"O and directories created there will also get the +.\"O .B S_ISGID +.\"O bit set. +.\"O For a file that does not have the group execution bit +.\"O .RB ( S_IXGRP ) +.\"O set, +.\"O the set-group-ID bit indicates mandatory file/record locking. +set-group-ID bit +.RB ( S_ISGID ) +¤Ë¤Ï¤¤¤¯¤Ä¤«¤ÎÆüì¤Ê»ÈÍÑË¡¤¬¤¢¤ë: +¥Ç¥£¥ì¥¯¥È¥ê¤ËÀßÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤¬ BSD Êý¼°¤Ç»ÈÍѤµ¤ì¤ë +¤³¤È¤ò¼¨¤¹¡£¤Ä¤Þ¤ê¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×ID ¤Ï +ºîÀ®¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥°¥ë¡¼¥×ID ¤Ç¤Ï¤Ê¤¯¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Î +¥°¥ë¡¼¥×ID ¤ò·Ñ¾µ¤¹¤ë¡£¤Þ¤¿¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤â +.B S_ISGID +¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤ë¡£¥°¥ë¡¼¥×¼Â¹Ô¥Ó¥Ã¥È +.RB ( S_IXGRP ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +set-group-ID ¥Ó¥Ã¥È¤Ï¥Õ¥¡¥¤¥ë/¥ì¥³¡¼¥É¤Î +¶¯À©Åª¤Ê (mandatory) ¥í¥Ã¥¯¤òɽ¤¹¡£ +.P +.\"O The sticky bit (S_ISVTX) on a directory means that a file +.\"O in that directory can be renamed or deleted only by the owner +.\"O of the file, by the owner of the directory, and by a privileged +.\"O process. +¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¥Ó¥Ã¥È (S_ISVTX) ¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Õ¥¡¥¤¥ë¤Î̾Á°¤òÊѹ¹¤·¤¿¤ê¡¢ºï½ü¤·¤¿¤ê¤Ç¤­¤ë¤Î¤Ï¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤«¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î½êÍ­¼Ô¤«¡¢Æø¢¥×¥í¥»¥¹ +¤À¤±¤È¤Ê¤ë¡£ +.\"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 EACCES +.\"O Search permission is denied for one of the directories +.\"O in the path prefix of +.\"O .IR path . +.\"O (See also +.\"O .BR path_resolution (7).) +.I path +¤¬½ê°¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤È¤½¤Î¾å°Ì¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤¤¤º¤ì¤«¤Ë +ÂФ¹¤ë¸¡º÷µö²Ä¤¬¤Ê¤«¤Ã¤¿ +.RB ( path_resolution (7) +¤â»²¾È¤Î¤³¤È)¡£ +.TP +.B EBADF +.\"O .I fd +.\"O is bad. +.I fd +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EFAULT +.\"O Bad address. +¥¢¥É¥ì¥¹¤¬´Ö°ã¤Ã¤Æ¤¤¤ë¡£ +.TP +.B ELOOP +.\"O Too many symbolic links encountered while traversing the path. +¥Ñ¥¹¤òé¤ëºÝ¤Ë²ò·è¤¹¤Ù¤­¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤¿¡£ +.TP +.B ENAMETOOLONG +.\"O File name too long. +¥Õ¥¡¥¤¥ë̾¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +.\"O A component of +.\"O .I path +.\"O does not exist, or +.\"O .I path +.\"O is an empty string. +.I path +¤Î¹½À®Í×ÁǤ¬Â¸ºß¤·¤Ê¤¤¤«¡¢ +.I path +¤¬¶õʸ»úÎó¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +.\"O Out of memory (i.e., kernel memory). +¥«¡¼¥Í¥ë¤Î¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O A component of the path prefix of +.\"O .I path +.\"O is not a directory. +.I path +¤ÎÁ°È¾Éôʬ (prefix) ¤Î¹½À®Í×ÁǤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EOVERFLOW +.\"O .RB ( stat ()) +.\"O .I path +.\"O refers to a file whose size cannot be represented in the type +.\"O .IR off_t . +.\"O This can occur when an application compiled on a 32-bit platform without +.\"O .I -D_FILE_OFFSET_BITS=64 +.\"O calls +.\"O .BR stat () +.\"O on a file whose size exceeds +.\"O .I (2<<31)-1 +.\"O bits. +.RB ( stat ()) +.I path +¤¬¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ò +.I off_t +·¿¤Çɽ¸½¤Ç¤­¤Ê¤¤¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +¤³¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë¤Î¤Ï¡¢32 ¥Ó¥Ã¥È¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¾å¤Ç +.I -D_FILE_OFFSET_BITS=64 +¤ò»ØÄꤻ¤º¤Ë¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤¬ +.I (2<31)-1 +¥Ó¥Ã¥È¤òĶ¤¨¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +.BR stat () +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These system calls conform to SVr4, 4.3BSD, POSIX.1-2001. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï SVr4, 4.3BSD, POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.\"O .\" SVr4 documents additional +.\"O .\" .BR fstat () +.\"O .\" error conditions EINTR, ENOLINK, and EOVERFLOW. SVr4 +.\"O .\" documents additional +.\"O .\" .BR stat () +.\"O .\" and +.\"O .\" .BR lstat () +.\"O .\" error conditions EINTR, EMULTIHOP, ENOLINK, and EOVERFLOW. +.BR stat () +¤È +.BR fstat () +¥³¡¼¥ë¤Ï SVr4, SVID, POSIX, X/OPEN, 4.3BSD ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR lstat () +¥³¡¼¥ë¤Ï 4.3BSD ¤È SVr4 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.\" SVr4 ¤Ë¤Ï¾¤Ë +.\" .BR fstat () +.\" ¤Î¥¨¥é¡¼¤È¤·¤Æ EINTR, ENOLINK, EOVERFLOW ¤¬µ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" SVr4 ¤Ë¤Ï¾¤Ë +.\" .BR stat () +.\" ¤È +.\" .BR lstat () +.\" ¤Î¥¨¥é¡¼¤È¤·¤Æ EINTR, EMULTIHOP, ENOLINK, EOVERFLOW ¤¬µ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"O Use of the +.\"O .I st_blocks +.\"O and +.\"O .I st_blksize +.\"O fields may be less portable. +.\"O (They were introduced in BSD. +.\"O The interpretation differs between systems, +.\"O and possibly on a single system when NFS mounts are involved.) +.I st_blocks +¤È +.I st_blksize +¥Õ¥£¡¼¥ë¥É¤Î»ÈÍѤϤ¢¤Þ¤ê°Ü¿¢À­¤¬¤Ê¤¤¡£ +(¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï BSD ¤Ë¤è¤Ã¤ÆƳÆþ¤µ¤ì¤¿¡£ +¥·¥¹¥Æ¥à¤´¤È¤Ë²ò¼á¤¬°Û¤Ê¤Ã¤Æ¤ª¤ê¡¢ +NFS ¥Þ¥¦¥ó¥È¤Î¾ì¹ç¤Ë¤ÏƱ¤¸¥·¥¹¥Æ¥à¤Ç¤â°Û¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ë) +.LP +.\"O POSIX does not describe the +.\"O .BR S_IFMT , +.\"O .BR S_IFSOCK , +.\"O .BR S_IFLNK , +.\"O .BR S_IFREG , +.\"O .BR S_IFBLK , +.\"O .BR S_IFDIR , +.\"O .BR S_IFCHR , +.\"O .BR S_IFIFO , +.\"O .B S_ISVTX +.\"O bits, but instead demands the use of +.\"O the macros +.\"O .BR S_ISDIR (), +.\"O etc. +.\"O The +.\"O .BR S_ISLNK () +.\"O and +.\"O .BR S_ISSOCK () +.\"O macros are not in +.\"O POSIX.1-1996, but both are present in POSIX.1-2001; +.\"O the former is from SVID 4, the latter from SUSv2. +POSIX ¤Ë¤Ï +.BR S_IFMT , +.BR S_IFSOCK , +.BR S_IFLNK , +.BR S_IFREG , +.BR S_IFBLK , +.BR S_IFDIR , +.BR S_IFCHR , +.BR S_IFIFO , +.B S_ISVTX +¥Ó¥Ã¥È¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£¤«¤ï¤ê¤Ë +.BR S_ISDIR () +¤Î¤è¤¦¤Ê¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤è¤¦¤ËÍ׵ᤷ¤Æ¤¤¤ë¡£ +¥Þ¥¯¥í +.BR S_ISLNK () +¤È +.BR S_ISSOCK () +¤Ï POSIX.1-1996 ¤Ë¤Ï¤Ê¤¤¤¬¡¢ +POSIX.1-2001 ¤Ë¤ÏξÊý¤È¤â¸ºß¤¹¤ë¡£ +Á°¼Ô¤Ï SVID 4 ¤Ë¡¢¸å¼Ô¤Ï SUSv2 ¤ËͳÍ褷¤Æ¤¤¤ë¡£ +.LP +.\"O Unix V7 (and later systems) had S_IREAD, S_IWRITE, S_IEXEC, where POSIX +.\"O prescribes the synonyms S_IRUSR, S_IWUSR, S_IXUSR. +.\"O Unix V7 (and later systems) had +.\"O .BR S_IREAD , +.\"O .BR S_IWRITE , +.\"O .BR S_IEXEC , +.\"O where POSIX +.\"O prescribes the synonyms +.\"O .BR S_IRUSR , +.\"O .BR S_IWUSR , +.\"O .BR S_IXUSR . +Unix V7 (¤È¤½¤Î¸å¤Î¥·¥¹¥Æ¥à) ¤Ï +.BR S_IREAD , +.BR S_IWRITE , +.B S_IEXEC +¤ò»ý¤Ã¤Æ¤ª¤ê¡¢ +POSIX ¤Ï¤½¤ÎƱµÁ¸ì¤È¤·¤Æ +.BR S_IRUSR , +.BR S_IWUSR , +.B S_IXUSR +¤òµ¬Äꤷ¤Æ¤¤¤ë¡£ +.\"O .SS "Other Systems" +.SS ¾¤Î¥·¥¹¥Æ¥à +.\"O Values that have been (or are) in use on various systems: +³Æ¼ï¥·¥¹¥Æ¥à¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤¿(¤¤¤ë)ÃÍ: +.TS +l l l l l. +.\"O hex name ls octal description +16¿Ê ̾Á° ls 8¿Ê¿ô ÀâÌÀ +.\"O f000 S_IFMT 170000 mask for file type +.\"O 0000 000000 SCO out-of-service inode, BSD unknown +.\"O type; SVID-v2 and XPG2 have both +.\"O 0 and 0100000 for ordinary file +f000 S_IFMT 170000 ¥Õ¥¡¥¤¥ë¼ïÊÌ¥Õ¥£¡¼¥ë¥É¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯ +0000 000000 SCO ¤Ç¤Ï »ÈÍÑÉÔǽ inode; + BSD ¤Ç¤Ï̤ÃΤΥե¡¥¤¥ë¼ïÊÌ; + SVID-v2 ¤È XPG2 ¤Ç¤Ï 0 ¤È 0100000 ¤Î + ξÊý¤¬ÉáÄ̤Υե¡¥¤¥ë +.\"O 1000 S_IFIFO p| 010000 FIFO (named pipe) +.\"O 2000 S_IFCHR c 020000 character special (V7) +.\"O 3000 S_IFMPC 030000 multiplexed character special (V7) +.\"O 4000 S_IFDIR d/ 040000 directory (V7) +.\"O 5000 S_IFNAM 050000 XENIX named special file +.\"O with two subtypes, distinguished by +.\"O \fIst_rdev\fP values 1, 2 +.\"O 0001 S_INSEM s 000001 XENIX semaphore subtype of IFNAM +.\"O 0002 S_INSHD m 000002 XENIX shared data subtype of IFNAM +1000 S_IFIFO p| 010000 FIFO (̾Á°ÉÕ¤­¥Ñ¥¤¥×) +2000 S_IFCHR c 020000 ¥­¥ã¥é¥¯¥¿Æüì¥Õ¥¡¥¤¥ë (V7) +3000 S_IFMPC 030000 ¿½Å²½¤µ¤ì¤¿¥­¥ã¥é¥¯¥¿Æüì¥Õ¥¡¥¤¥ë (V7) +4000 S_IFDIR d/ 040000 ¥Ç¥£¥ì¥¯¥È¥ê (V7) +5000 S_IFNAM 050000 XENIX Æó¤Ä¤ÎÉû·¿¤ò»ý¤Ä̾Á°ÉÕ¤­¤Î + Æüì¥Õ¥¡¥¤¥ë + Éû·¿¤Ï \fIst_rdev\fP ¤ÎÃÍ 1,2 ¤Ç¶èÊ̤µ¤ì¤ë: +0001 S_INSEM s 000001 XENIX IFNAM¤Î¥»¥Þ¥Õ¥©¡¼Éû·¿ +0002 S_INSHD m 000002 XENIX IFNAM¤Î¶¦Í­¥Ç¡¼¥¿Éû·¿ +.\"O 6000 S_IFBLK b 060000 block special (V7) +.\"O 7000 S_IFMPB 070000 multiplexed block special (V7) +.\"O 8000 S_IFREG - 100000 regular (V7) +.\"O 9000 S_IFCMP 110000 VxFS compressed +.\"O 9000 S_IFNWK n 110000 network special (HP-UX) +.\"O a000 S_IFLNK l@ 120000 symbolic link (BSD) +6000 S_IFBLK b 060000 ¥Ö¥í¥Ã¥¯Æüì¥Õ¥¡¥¤¥ë (V7) +7000 S_IFMPB 070000 ¿½Å²½¤µ¤ì¤¿¥Ö¥í¥Ã¥¯Æüì¥Õ¥¡¥¤¥ë (V7) +8000 S_IFREG - 100000 Ä̾ï¥Õ¥¡¥¤¥ë (V7) +9000 S_IFCMP 110000 VxFS °µ½Ì¥Õ¥¡¥¤¥ë +9000 S_IFNWK n 110000 ¥Í¥Ã¥È¥ï¡¼¥¯Æüì¥Õ¥¡¥¤¥ë (HP-UX) +a000 S_IFLNK l@ 120000 ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ (BSD) +.\"O b000 S_IFSHAD 130000 Solaris shadow inode for ACL +.\"O (not seen by userspace) +.\"O c000 S_IFSOCK s= 140000 socket (BSD; also "S_IFSOC" on VxFS) +.\"O d000 S_IFDOOR D> 150000 Solaris door +.\"O e000 S_IFWHT w% 160000 BSD whiteout (not used for inode) +b000 S_IFSHAD 130000 Solaris ACL ¤Î¤¿¤á¤Î±£¤µ¤ì¤¿ inode + (¥æ¡¼¥¶¶õ´Ö¤«¤é¤Ï¸«¤¨¤Ê¤¤) +c000 S_IFSOCK s= 140000 ¥½¥±¥Ã¥È (BSD; VxFS ¤Î "S_IFSOC") +d000 S_IFDOOR D> 150000 Solaris ¥É¥¢¡¦¥Õ¥¡¥¤¥ë +e000 S_IFWHT w% 160000 BSD ¶õÇò¥Õ¥¡¥¤¥ë (inode ¤ò»ÈÍѤ·¤Ê¤¤) +.\"O 0200 S_ISVTX 001000 sticky bit: save swapped text even +.\"O after use (V7) +.\"O reserved (SVID-v2) +.\"O On nondirectories: don't cache this +.\"O file (SunOS) +.\"O On directories: restricted deletion +.\"O flag (SVID-v4.2) +.\"O 0400 S_ISGID 002000 set-group-ID on execution (V7) +.\"O for directories: use BSD semantics for +.\"O propagation of GID +.\"O 0400 S_ENFMT 002000 System V file locking enforcement (shared +.\"O with S_ISGID) +.\"O 0800 S_ISUID 004000 set-user-ID on execution (V7) +.\"O 0800 S_CDF 004000 directory is a context dependent +.\"O file (HP-UX) +0200 S_ISVTX 001000 `¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È':»ÈÍѸå¤â + ¥¹¥ï¥Ã¥×¤Ë»Ä¤¹ (V7) + ͽÌó (SVID-v2) + ¥Ç¥£¥ì¥¯¥È¥ê°Ê³°: ¥Õ¥¡¥¤¥ë¤ò¥­¥ã¥Ã¥·¥å + ¤·¤Ê¤¤ (SunOS) + ¥Ç¥£¥ì¥¯¥È¥ê: ºï½üÀ©¸Â¥Õ¥é¥° (SVID-v4.2) +0400 S_ISGID 002000 ¼Â¹Ô»þ¤Î set-group-ID (V7) + ¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ¤Ï GID ¤ÎÅÁã¤Ë + BSD Êý¼°¤ò»ÈÍѤ¹¤ë +0400 S_ENFMT 002000 System V ¥Õ¥¡¥¤¥ë¡¦¥í¥Ã¥¯¤ò¶¯À©¤¹¤ë + (S_ISGID ¤È¶¦Í­) +0800 S_ISUID 004000 ¼Â¹Ô»þ¤Î set-user-ID (V7) +0800 S_CDF 004000 ¥Ç¥£¥ì¥¯¥È¥ê¤¬¾õ¶·°Í¸¥Õ¥¡¥¤¥ë (HP-UX) +.TE + +.\"O A sticky command appeared in Version 32V AT&T UNIX. +¥¹¥Æ¥£¥Ã¥­¡¼ ¥³¥Þ¥ó¥É¤Ï Version 32V AT&T UNIX ¤ÇÅо줷¤¿¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Since kernel 2.5.48, the +.\"O .I stat +.\"O structure supports nanosecond resolution for the three +.\"O file timestamp fields. +.\"O Glibc exposes the nanosecond component of each field using names either +.\"O of the form +.\"O .IR st_atim.tv_nsec , +.\"O if the +.\"O .B _BSD_SOURCE +.\"O or +.\"O .B _SVID_SOURCE +.\"O feature test macro is defined, +.\"O or of the form +.\"O .IR st_atimensec , +.\"O if neither of these macros is defined. +.\"O On file systems that do not support subsecond timestamps, +.\"O these nanosecond fields are returned with the value 0. +¥«¡¼¥Í¥ë 2.5.48 °Ê¹ß¤Ç¤Ï¡¢ +.I stat +¹½Â¤ÂÎ¤Ï 3¤Ä¤Î¥Õ¥¡¥¤¥ë¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×´ØÏ¢¤Î¥Õ¥£¡¼¥ë¥É¤Ç +¥Ê¥ÎÉÃñ°Ì¤ÎÀºÅÙ¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +glibc ¤Ç¤Ï¡¢³Æ¥Õ¥£¡¼¥ë¥É¤Î¥Ê¥ÎÉäξðÊó¤ò +.I st_atim.tv_nsec +¤ä +.I st_atimensec +¤È¤¤¤Ã¤¿·Á¤Ç»²¾È¤Ç¤­¤ë¡£ +µ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï +.I st_atim.tv_nsec +¤Î·Á¼°¤Ç¡¢¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï +.I st_atimensec +¤Î·Á¼°¤È¤Ê¤ë¡£ +Éäè¤êºÙ¤«¤¤¥¿¥¤¥à¥¹¥¿¥ó¥×¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +¤³¤ì¤é¤Î¥Ê¥ÎÉäΥե£¡¼¥ë¥É¤Ï 0 ¤ËÀßÄꤵ¤ì¤ë¡£ +.\" As at kernel 2.6.25, XFS and JFS support nanosecond timestamps, +.\" but ext2, ext3, and Reiserfs do not. +.\" FIXME . SUSv4 specifies nanosecond timestamps. + +.\"O On Linux, +.\"O .BR lstat () +.\"O will generally not trigger automounter action, whereas +.\"O .BR stat () +.\"O will. +Linux ¤Ç¤Ï¡¢ +.BR lstat () +¤Ï°ìÈ̤ˤϼ«Æ°¥Þ¥¦¥ó¥ÈÆ°ºî (automounter action) ¤Î¤­¤Ã¤«¤±¤È¤Ê¤é¤Ê¤¤¤¬¡¢ +.BR stat () +¤Ï¤­¤Ã¤«¤±¤È¤Ê¤ë¡£ + +.\"O For most files under the +.\"O .I /proc +.\"O directory, +.\"O .BR stat () +.\"O does not return the file size in the +.\"O .I st_size +.\"O field; instead the field is returned with the value 0. +.I /proc +¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤Î¤Û¤È¤ó¤É¤Ç¤Ï¡¢ +.BR stat () +¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¡¢ +.I st_size +¥Õ¥£¡¼¥ë¥É¤Ë¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤¬ÊÖ¤µ¤ì¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë +.I st_size +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SS Underlying kernel interface +.SS Çظå¤Î¥«¡¼¥Í¥ë¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.\"O Over time, increases in the size of the +.\"O .I stat +.\"O structure have led to three successive versions of +.\"O .BR stat (): +»þ´Ö¤Î·Ð²á¤È¤È¤â¤Ë¡¢ +.I stat +¹½Â¤ÂΤΥµ¥¤¥º¤¬Â礭¤¯¤Ê¤ê¡¢¤³¤Î±Æ¶Á¤Ç +.BR stat () +¤Ë¤Ï 3¤Ä¤Î¥Ð¡¼¥¸¥ç¥ó¤¬Â¸ºß¤¹¤ë: +.\"O .IR sys_stat () +.\"O (slot +.\"O .IR __NR_oldstat ), +.\"O .IR sys_newstat () +.\"O (slot +.\"O .IR __NR_stat ), +.\"O and +.\"O .I sys_stat64() +.\"O (new in kernel 2.4; slot +.\"O .IR __NR_stat64 ). +.IR sys_stat () +(¥¹¥í¥Ã¥È¤Ï +.IR __NR_oldstat )¡¢ +.IR sys_newstat () +(¥¹¥í¥Ã¥È¤Ï +.IR __NR_stat )¡¢ +.IR sys_stat64 () +(¥«¡¼¥Í¥ë 2.4 ¤ÇƳÆþ; ¥¹¥í¥Ã¥È¤Ï +.IR __NR_stat64 ). +.\"O The glibc +.\"O .BR stat () +.\"O wrapper function hides these details from applications, +.\"O invoking the most recent version of the system call provided by the kernel, +.\"O and repacking the returned information if required for old binaries. +glibc ¤Î +.BR stat () +¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¤³¤ì¤é¤Î¾ÜºÙ¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é±£Ê䷤Ƥ¯¤ì¤ë¡£ +¶ñÂÎŪ¤Ë¤Ï¡¢¥«¡¼¥Í¥ë¤¬Ä󶡤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¤¦¤ÁºÇ¿·¤Î¥Ð¡¼¥¸¥ç¥ó¤ò +µ¯Æ°¤·¡¢¸Å¤¤¥Ð¥¤¥Ê¥ê¤Î¾ì¹ç¤Ë¤ÏɬÍפ˱þ¤¸¤ÆÊÖ¤µ¤ì¤¿¾ðÊó¤òºÆ¹½À® (repack) ¤¹¤ë¡£ +.\"O Similar remarks apply for +.\"O .BR fstat () +.\"O and +.\"O .BR lstat (). +.BR fstat () +¤È +.BR lstat () +¤Ë¤Ä¤¤¤Æ¤âƱÍͤǤ¢¤ë¡£ +.\" +.\" A note from Andries Brouwer, July 2007 +.\" +.\" > Is the story not rather more complicated for some calls like +.\" > stat(2)? +.\" +.\" Yes and no, mostly no. See /usr/include/sys/stat.h . +.\" +.\" The idea is here not so much that syscalls change, but that +.\" the definitions of struct stat and of the types dev_t and mode_t change. +.\" This means that libc (even if it does not call the kernel +.\" but only calls some internal function) must know what the +.\" format of dev_t or of struct stat is. +.\" The communication between the application and libc goes via +.\" the include file that defines a _STAT_VER and +.\" _MKNOD_VER describing the layout of the data that user space +.\" uses. Each (almost each) occurrence of stat() is replaced by +.\" an occurrence of xstat() where the first parameter of xstat() +.\" is this version number _STAT_VER. +.\" +.\" Now, also the definitions used by the kernel change. +.\" But glibc copes with this in the standard way, and the +.\" struct stat as returned by the kernel is repacked into +.\" the struct stat as expected by the application. +.\" Thus, _STAT_VER and this setup cater for the application-libc +.\" interface, rather than the libc-kernel interface. +.\" +.\" (Note that the details depend on gcc being used as c compiler.) +.\"O .SH EXAMPLE +.SH Îã +.\"O The following program calls +.\"O .BR stat () +.\"O and displays selected fields in the returned +.\"O .I stat +.\"O structure. +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï +.BR stat () +¤ò¸Æ¤Ó½Ð¤·¡¢Ê֤äƤ­¤¿ +.I stat +¹½Â¤ÂΤΥե£¡¼¥ë¥É¤Î¤¤¤¯¤Ä¤«¤òɽ¼¨¤¹¤ë¡£ +.nf + +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct stat sb; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + if (stat(argv[1], &sb) == \-1) { + perror("stat"); + exit(EXIT_FAILURE); + } + + printf("File type: "); + + switch (sb.st_mode & S_IFMT) { + case S_IFBLK: printf("block device\\n"); break; + case S_IFCHR: printf("character device\\n"); break; + case S_IFDIR: printf("directory\\n"); break; + case S_IFIFO: printf("FIFO/pipe\\n"); break; + case S_IFLNK: printf("symlink\\n"); break; + case S_IFREG: printf("regular file\\n"); break; + case S_IFSOCK: printf("socket\\n"); break; + default: printf("unknown?\\n"); break; + } + + printf("I\-node number: %ld\\n", (long) sb.st_ino); + + printf("Mode: %lo (octal)\\n", + (unsigned long) sb.st_mode); + + printf("Link count: %ld\\n", (long) sb.st_nlink); + printf("Ownership: UID=%ld GID=%ld\\n", + (long) sb.st_uid, (long) sb.st_gid); + + printf("Preferred I/O block size: %ld bytes\\n", + (long) sb.st_blksize); + printf("File size: %lld bytes\\n", + (long long) sb.st_size); + printf("Blocks allocated: %lld\\n", + (long long) sb.st_blocks); + + printf("Last status change: %s", ctime(&sb.st_ctime)); + printf("Last file access: %s", ctime(&sb.st_atime)); + printf("Last file modification: %s", ctime(&sb.st_mtime)); + + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR access (2), +.BR chmod (2), +.BR chown (2), +.BR fstatat (2), +.BR readlink (2), +.BR utime (2), +.BR capabilities (7), +.BR symlink (7) diff --git a/draft/man2/statfs.2 b/draft/man2/statfs.2 new file mode 100644 index 00000000..22a10556 --- /dev/null +++ b/draft/man2/statfs.2 @@ -0,0 +1,424 @@ +.\" Copyright (C) 2003 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. +.\" +.\" Modified 2003-08-17 by Walter Harms +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Fri Dec 12 00:25:54 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Sat Jun 2 20:25:46 JST 2001 +.\" by Yuichi SATO +.\" Updated & Modified Sat Jan 18 16:48:08 JST 2003 +.\" by Yuichi SATO +.\" Updated & Modified Sun Sep 7 00:52:44 JST 2003 by Yuichi SATO +.\" Updated & Modified Sun Jan 9 22:35:28 JST 2005 by Yuichi SATO +.\" Updated 2006-07-21, Akihiro MOTOKI , LDP v2.36 +.\" +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: mount ¥Þ¥¦¥ó¥È +.\"WORD: pointer ¥Ý¥¤¥ó¥¿¡¼ +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: open ¥ª¡¼¥×¥ó +.\" +.TH STATFS 2 2004-06-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O statfs, fstatfs \- get file system statistics +statfs, fstatfs \- ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ÎÅý·×¤òÆÀ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.\"O .BR "#include " "/* or */" +.BR "#include " "/* ¤Þ¤¿¤Ï */" +.sp +.BI "int statfs(const char *" path ", struct statfs *" buf ); +.br +.BI "int fstatfs(int " fd ", struct statfs *" buf ); +.\"O .SH DESCRIPTION +.SH ½ñ¼° +.\"O The function +.\"O .BR statfs () +.\"O returns information about a mounted file system. +´Ø¿ô +.BR statfs () +¤Ï¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÊÖ¤¹¡£ +.\"O .I path +.\"O is the pathname of any file within the mounted file system. +.I path +¤Ï¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤Ç¤¢¤ë¡£ +.\"O .I buf +.\"O is a pointer to a +.\"O .I statfs +.\"O structure defined approximately as follows: +.I buf +¤Ï +.I statfs +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡¼¤Ç¡¢¤ª¤è¤½°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: + +.in +4n +.nf +struct statfs { +.\"O long f_type; /* type of file system (see below) */ + long f_type; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î·¿ (²¼µ­»²¾È) */ +.\"O long f_bsize; /* optimal transfer block size */ + long f_bsize; /* ºÇŬ¤Ê¥Ö¥í¥Ã¥¯¥µ¥¤¥º */ +.\"O long f_blocks; /* total data blocks in file system */ + long f_blocks; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÁí¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¿ô */ +.\"O long f_bfree; /* free blocks in fs */ + long f_bfree; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¶õ¤­¥Ö¥í¥Ã¥¯¿ô */ +.\"O long f_bavail; /* free blocks avail to unprivileged user */ + long f_bavail; /* ÈóÆø¢¥æ¡¼¥¶¤¬»ÈÍѲÄǽ¤Ê¶õ¤­¥Ö¥í¥Ã¥¯¿ô */ +.\"O long f_files; /* total file nodes in file system */ + long f_files; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÁí¥Õ¥¡¥¤¥ë¥Î¡¼¥É¿ô */ +.\"O long f_ffree; /* free file nodes in fs */ + long f_ffree; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¶õ¤­¥Õ¥¡¥¤¥ë¥Î¡¼¥É¿ô */ +.\"O fsid_t f_fsid; /* file system id */ + fsid_t f_fsid; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î ID */ +.\"O long f_namelen; /* maximum length of filenames */ + long f_namelen; /* ¥Õ¥¡¥¤¥ë̾¤ÎºÇÂçĹ */ +}; + +.\"O File system types: +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î·¿: + + ADFS_SUPER_MAGIC 0xadf5 + AFFS_SUPER_MAGIC 0xADFF + BEFS_SUPER_MAGIC 0x42465331 + BFS_MAGIC 0x1BADFACE + CIFS_MAGIC_NUMBER 0xFF534D42 + CODA_SUPER_MAGIC 0x73757245 + COH_SUPER_MAGIC 0x012FF7B7 + CRAMFS_MAGIC 0x28cd3d45 + DEVFS_SUPER_MAGIC 0x1373 + EFS_SUPER_MAGIC 0x00414A53 + EXT_SUPER_MAGIC 0x137D + EXT2_OLD_SUPER_MAGIC 0xEF51 + EXT2_SUPER_MAGIC 0xEF53 + EXT3_SUPER_MAGIC 0xEF53 + HFS_SUPER_MAGIC 0x4244 + HPFS_SUPER_MAGIC 0xF995E849 + HUGETLBFS_MAGIC 0x958458f6 + ISOFS_SUPER_MAGIC 0x9660 + JFFS2_SUPER_MAGIC 0x72b6 + JFS_SUPER_MAGIC 0x3153464a +.\"O MINIX_SUPER_MAGIC 0x137F /* orig. minix */ + MINIX_SUPER_MAGIC 0x137F /* ¥ª¥ê¥¸¥Ê¥ë¤Î minix */ +.\"O MINIX_SUPER_MAGIC2 0x138F /* 30 char minix */ + MINIX_SUPER_MAGIC2 0x138F /* 30 ʸ»ú¥Õ¥¡¥¤¥ë̾¤Î minix */ + MINIX2_SUPER_MAGIC 0x2468 /* minix V2 */ +.\"O MINIX2_SUPER_MAGIC2 0x2478 /* minix V2, 30 char names */ + MINIX2_SUPER_MAGIC2 0x2478 /* minix V2, 30 ʸ»ú¥Õ¥¡¥¤¥ë̾ */ + MSDOS_SUPER_MAGIC 0x4d44 + NCP_SUPER_MAGIC 0x564c + NFS_SUPER_MAGIC 0x6969 + NTFS_SB_MAGIC 0x5346544e + OPENPROM_SUPER_MAGIC 0x9fa1 + PROC_SUPER_MAGIC 0x9fa0 + QNX4_SUPER_MAGIC 0x002f + REISERFS_SUPER_MAGIC 0x52654973 + ROMFS_MAGIC 0x7275 + SMB_SUPER_MAGIC 0x517B + SYSV2_SUPER_MAGIC 0x012FF7B6 + SYSV4_SUPER_MAGIC 0x012FF7B5 + TMPFS_MAGIC 0x01021994 + UDF_SUPER_MAGIC 0x15013346 + UFS_MAGIC 0x00011954 + USBDEVICE_SUPER_MAGIC 0x9fa2 + VXFS_SUPER_MAGIC 0xa501FCF5 + XENIX_SUPER_MAGIC 0x012FF7B4 + XFS_SUPER_MAGIC 0x58465342 + _XIAFS_SUPER_MAGIC 0x012FD16D +.fi +.in +.PP +.\"O Nobody knows what +.\"O .I f_fsid +.\"O is supposed to contain (but see below). +.I f_fsid +¤Ë¤É¤ó¤ÊÃͤ¬Æþ¤ë¤Ù¤­¤Ê¤Î¤«¤Ïï¤âÃΤé¤Ê¤¤ (⤷¡¢²¼µ­¤ò»²¾È)¡£ +.PP +.\"O Fields that are undefined for a particular file system are set to 0. +.\"O .BR fstatfs () +.\"O returns the same information about an open file referenced by descriptor +.\"O .IR fd . +¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ̤ÄêµÁ¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï 0 ¤¬ +ÀßÄꤵ¤ì¤ë¡£ +.BR fstatfs () +¤Ï¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.I fd +¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡¢Æ±¤¸¾ðÊó¤òÊÖ¤¹¡£ +.\"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 EACCES +.\"O .RB ( statfs ()) +.\"O Search permission is denied for a component of the path prefix of +.\"O .IR path . +.RB ( statfs () +¤Î¾ì¹ç) +.I path +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Ë¸¡º÷µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤ +.\"O (See also +.\"O .BR path_resolution (7).) +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EBADF +.\"O .RB ( fstatfs ()) +.\"O .I fd +.\"O is not a valid open file descriptor. +.RB ( fstatfs () +¤Î¾ì¹ç) +.I fd +¤ÏÍ­¸ú¤Ê¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EFAULT +.\"O .I buf +.\"O or +.\"O .I path +.\"O points to an invalid address. +.I buf +¤Þ¤¿¤Ï +.I path +¤¬ÉÔÀµ¤Ê¥¢¥É¥ì¥¹¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINTR +.\"O This call was interrupted by a signal. +¤³¤Î¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¤ÇÃæÃǤµ¤ì¤¿¡£ +.TP +.B EIO +.\"O An I/O error occurred while reading from the file system. +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ÎÆɤ߹þ¤ß¤Î´Ö¤Ë I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ELOOP +.\"O .RB ( statfs ()) +.\"O Too many symbolic links were encountered in translating +.\"O .IR path . +.RB ( statfs () +¤Î¾ì¹ç) +.I path +¤ò²ò·è¤¹¤ë¤Î¤Ëé¤ë¤Ù¤­¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.\"O .RB ( statfs ()) +.\"O .I path +.\"O is too long. +.RB ( statfs () +¤Î¾ì¹ç) +.I path +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +.\"O .RB ( statfs ()) +.\"O The file referred to by +.\"O .I path +.\"O does not exist. +.RB ( statfs () +¤Î¾ì¹ç) +.I path +¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +.\"O Insufficient kernel memory was available. +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOSYS +.\"O The file system does not support this call. +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬¤³¤Î¸Æ¤Ó½Ð¤·¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O .RB ( statfs ()) +.\"O A component of the path prefix of +.\"O .I path +.\"O is not a directory. +.RB ( statfs () +¤Î¾ì¹ç) +.I path +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EOVERFLOW +.\"O Some values were too large to be represented in the returned struct. +Ãͤ¬Â礭²á¤®¤ë¤¿¤á¡¢ÊÖ¤êÃͤι½Â¤ÂΤÇɽ¸½¤Ç¤­¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Linux-specific. +.\"O The Linux +.\"O .BR statfs () +.\"O was inspired by the 4.4BSD one +.\"O (but they do not use the same structure). +Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +Linux ¤Î +.BR statfs () +¤Ï 4.4BSD ¤Î¤â¤Î¤Ë±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£ +(¤·¤«¤·Æ±¤¸¹½Â¤ÂΤò»ÈÍѤ·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤) +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The kernel has system calls +.\"O .BR statfs (), +.\"O .BR fstatfs (), +.\"O .BR statfs64 (), +.\"O and +.\"O .BR fstatfs64 () +.\"O to support this library call. +¤³¤Î¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤¿¤á¡¢ +¥«¡¼¥Í¥ë¤Ë¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR statfs (), +.BR fstatfs (), +.BR statfs64 (), +.BR fstatfs64 () +¤¬¤¢¤ë¡£ + +.\"O Some systems only have \fI\fP, other systems also have +.\"O \fI\fP, where the former includes the latter. +.\"O So it seems +.\"O including the former is the best choice. +\fI\fP ¤·¤«»ý¤¿¤Ê¤¤¥·¥¹¥Æ¥à¤â¤¢¤ê¡¢ +\fI\fP ¤â»ý¤Ã¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +Á°¼Ô¤Ï¸å¼Ô¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤Ç¡¢ +Á°¼Ô¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬Îɤ¤¤È¹Í¤¨¤é¤ì¤ë¡£ + +.\"O LSB has deprecated the library calls +.\"O .BR statfs () +.\"O and +.\"O .BR fstatfs () +.\"O and tells us to use +.\"O .BR statvfs (2) +.\"O and +.\"O .BR fstatvfs (2) +.\"O instead. +LSB ¤Ç¤Ï¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë +.BR statfs (), +.BR fstatfs () +¤òÈó¿ä¾©¤È¤·¤Æ¡¢Âå¤ï¤ê¤Ë +.BR statvfs (2), +.BR fstatvfs (2) +¤ò»È¤¦¤è¤¦¤Ë»Ø¼¨¤·¤Æ¤¤¤ë¡£ +.\"O .SS The f_fsid field +.SS f_fsid ¥Õ¥£¡¼¥ë¥É +.\"O Solaris, Irix and POSIX have a system call +.\"O .BR statvfs (2) +.\"O that returns a +.\"O .I "struct statvfs" +.\"O (defined in +.\"O .IR ) +.\"O containing an +.\"O .I "unsigned long" +.\"O .IR f_fsid . +Solaris, Irix, POSIX ¤Ë¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR statvfs (2) +¤¬¤¢¤ê¡¢ +.I "struct statvfs" +¤òÊÖ¤¹ +.RI ( +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +¤³¤Î¹½Â¤ÂΤˤϡ¢ +.I "unsigned long" +.I f_fsid +¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.\"O Linux, SunOS, HP-UX, 4.4BSD have a system call +.\"O .BR statfs () +.\"O that returns a +.\"O .I "struct statfs" +.\"O (defined in +.\"O .IR ) +.\"O containing a +.\"O .I fsid_t +.\"O .IR f_fsid , +.\"O where +.\"O .I fsid_t +.\"O is defined as +.\"O .IR "struct { int val[2]; }" . +Linux, SunOS, HP-UX, 4.4BSD ¤Ë¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR statfs () +¤¬¤¢¤ê¡¢ +.I "struct statfs" +¤òÊÖ¤¹ +.RI ( +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +¤³¤Î¹½Â¤ÂÎ¤Ë¤Ï +.I fsid_t +.IR f_fsid , +¤¬´Þ¤Þ¤ì¤Æ¤ª¤ê¡¢ +.I fsid_t +¤Ï +.I "struct { int val[2]; }" +¤ÈÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O The same holds for FreeBSD, except that it uses the include file +.\"O .IR . +FreeBSD ¤Ç¤âƱ¤¸¤Ç¤¢¤ë¤¬¡¢¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ò»È¤¦¡£ + +.\"O The general idea is that +.\"O .I f_fsid +.\"O contains some random stuff such that the pair +.\"O .RI ( f_fsid , ino ) +.\"O uniquely determines a file. +.I f_fsid +¤Ï¤¢¤ë¥é¥ó¥À¥à¤ÊÃͤò»ý¤Á¡¢ +.RI ( f_fsid , ino ) +¤È¤¤¤¦ 1 ÁȤÎÃͤǥե¡¥¤¥ë¤ò°ì°Õ¤Ë·èÄê¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡¢ +¤È¤¤¤¦¤Î¤¬´ðËÜŪ¤Ê¹Í¤¨Êý¤Ç¤¢¤ë¡£ +.\"O Some OSes use (a variation on) the device number, or the device number +.\"O combined with the file-system type. +¤¤¤¯¤Ä¤«¤Î OS ¤Ç¤Ï¡¢¥Ç¥Ð¥¤¥¹ÈÖ¹æ (¤ÎÊѼï) ¤ò»È¤Ã¤¿¤ê¡¢ +¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤È¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¥¿¥¤¥×¤òÁȤ߹ç¤ï¤»¤Æ»È¤Ã¤¿¤ê¤·¤Æ¤¤¤ë¡£ +.\"O Several OSes restrict giving out the +.\"O .I f_fsid +.\"O field to the superuser only (and zero it for unprivileged users), +.\"O because this field is used in the filehandle of the file system +.\"O when NFS-exported, and giving it out is a security concern. +OS ¤ÎÃæ¤Ë¤Ï +.I f_fsid +¥Õ¥£¡¼¥ë¥É¤Î¼èÆÀ¤ò¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Ë¸ÂÄꤷ¤Æ¤¤¤ë¤â¤Î¤â¤¢¤ë +(ÈóÆø¢¥æ¡¼¥¶¤¬¼èÆÀ¤¹¤ë¤È 0 ¤È¤Ê¤ë)¡£ +NFS ¤Ç¥¨¥¯¥¹¥Ý¡¼¥È¤µ¤ì¤ë¾ì¹ç¡¢ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤Ç»È¤ï¤ì¤Æ¤ª¤ê¡¢ +¤³¤ÎÃͤòÄ󶡤¹¤ë¤È¥»¥­¥å¥ê¥Æ¥£¾å¤ÎÌäÂ꤬¤¢¤ë¡£ +.LP +.\"O Under some OSes the +.\"O .I fsid +.\"O can be used as second argument to the +.\"O .BR sysfs () +.\"O system call. +¤¤¤¯¤Ä¤«¤Î OS ¤Ç¤Ï¡¢ +.I fsid +¤ò +.BR sysfs () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÂè 2 °ú¤­¿ô¤È¤·¤Æ»ÈÍѤǤ­¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR stat (2), +.BR statvfs (2), +.BR path_resolution (7) diff --git a/draft/man2/statvfs.2 b/draft/man2/statvfs.2 new file mode 100644 index 00000000..f2efcc00 --- /dev/null +++ b/draft/man2/statvfs.2 @@ -0,0 +1,292 @@ +.\" Copyright (C) 2003 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. +.\" +.\" The pathconf note is from Walter Harms +.\" This is not a system call on Linux +.\" +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jun 29 23:36:41 JST 2004 +.\" by Yuichi SATO +.\" Updated & Modified Sun Jan 9 22:50:29 JST 2005 by Yuichi SATO +.\" +.TH STATVFS 2 2003-08-22 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O statvfs, fstatvfs \- get file system statistics +statvfs, fstatvfs \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÅý·×¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int statvfs(const char *" path ", struct statvfs *" buf ); +.br +.BI "int fstatvfs(int " fd ", struct statvfs *" buf ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The function +.\"O .BR statvfs () +.\"O returns information about a mounted file system. +´Ø¿ô +.BR statvfs () +¤Ï¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÊÖ¤¹¡£ +.\"O .I path +.\"O is the pathname of any file within the mounted file system. +.I path +¤Ï¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÃæ¤ÎǤ°Õ¤Î¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤Ç¤¢¤ë¡£ +.\"O .I buf +.\"O is a pointer to a +.\"O .I statvfs +.\"O structure defined approximately as follows: +.I buf +¤Ï¡¢¤À¤¤¤¿¤¤°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +.I statvfs +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë: + +.in +4n +.nf +struct statvfs { +.\"O unsigned long f_bsize; /* file system block size */ +.\"O unsigned long f_frsize; /* fragment size */ +.\"O fsblkcnt_t f_blocks; /* size of fs in f_frsize units */ +.\"O fsblkcnt_t f_bfree; /* # free blocks */ +.\"O fsblkcnt_t f_bavail; /* # free blocks for unprivileged users */ +.\"O fsfilcnt_t f_files; /* # inodes */ +.\"O fsfilcnt_t f_ffree; /* # free inodes */ +.\"O fsfilcnt_t f_favail; /* # free inodes for unprivileged users */ +.\"O unsigned long f_fsid; /* file system ID */ +.\"O unsigned long f_flag; /* mount flags */ +.\"O unsigned long f_namemax; /* maximum filename length */ + unsigned long f_bsize; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º */ + unsigned long f_frsize; /* ¥Õ¥é¥°¥á¥ó¥È¥µ¥¤¥º */ + fsblkcnt_t f_blocks; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥µ¥¤¥º (f_frsize ñ°Ì) */ + fsblkcnt_t f_bfree; /* ²òÊü¤µ¤ì¤Æ¤¤¤ë¥Ö¥í¥Ã¥¯¿ô */ + fsblkcnt_t f_bafvail; /* ÈóÆø¢¥æ¡¼¥¶ÍѤ˲òÊü¤µ¤ì¤Æ¤¤¤ë¥Ö¥í¥Ã¥¯¿ô */ + fsfilcnt_t f_files; /* inode ¿ô */ + fsfilcnt_t f_ffree; /* ²òÊü¤µ¤ì¤Æ¤¤¤ë inode ¤Î¿ô */ + fsfilcnt_t f_favail; /* ÈóÆø¢¥æ¡¼¥¶ÍѤ˲òÊü¤µ¤ì¤Æ¤¤¤ë inode ¤Î¿ô */ + unsigned long f_fsid; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID */ + unsigned long f_flag; /* ¥Þ¥¦¥ó¥È¥Õ¥é¥° */ + unsigned long f_namemax; /* ¥Õ¥¡¥¤¥ë̾¤ÎŤµ¤ÎºÇÂçÃÍ */ +}; +.fi +.in + +.\"O Here the types +.\"O .I fsblkcnt_t +.\"O and +.\"O .I fsfilcnt_t +.\"O are defined in +.\"O .IR . +¤³¤³¤Ç¡¢·¿ +.I fsblkcnt_t +¤È +.I fsfilcnt_t +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O Both used to be +.\"O .IR "unsigned long" . +¤«¤Ä¤Æ¡¢¤³¤ì¤é¤Ï¶¦¤Ë +.I "unsigned long" +¤Ç¤¢¤Ã¤¿¡£ + +.\"O The field +.\"O .I f_flag +.\"O is a bit mask (of mount flags, see +.\"O .BR mount (8)). +¥Õ¥£¡¼¥ë¥É +.I f_flag +¤Ï (¥Þ¥¦¥ó¥È¥Õ¥é¥°¤Î) ¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë +(¥Þ¥¦¥ó¥È¥Õ¥é¥°¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR mount (8) +¤ò»²¾È¤¹¤ë¤³¤È)¡£ +.\"O Bits defined by POSIX are +POSIX ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Ó¥Ã¥È¤Ï°Ê²¼¤ÎÄ̤ê: +.TP +.B ST_RDONLY +.\"O Read-only file system. +Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¡£ +.TP +.B ST_NOSUID +.\"O Set-user-id/set-group-ID bits are ignored by +.\"O .BR exec (3). +.BR exec (3) +¤Ë̵»ë¤µ¤ì¤ë set-user-id/set-group-ID ¥Ó¥Ã¥È¡£ +.LP +.\"O It is unspecified whether all members of the returned struct +.\"O have meaningful values on all file systems. +ÊÖ¤µ¤ì¤¿¹½Â¤ÂΤÎÁ´¤Æ¤Î¥á¥ó¥Ð¤¬Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç +°ÕÌ£¤Î¤¢¤ëÃͤǤ¢¤ë¤«Èݤ«¤Ï¡¢»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"O .BR fstatvfs () +.\"O returns the same information about an open file referenced by descriptor +.\"O .IR fd . +.BR fstatvfs () +¤Ï¡¢¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡¢Æ±¤¸¾ðÊó¤òÊÖ¤¹¡£ +.\"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 EACCES +.\"O .RB ( statvfs ()) +.\"O Search permission is denied for a component of the path prefix of +.\"O .IR path . +.\"O (See also +.\"O .BR path_resolution (7).) +.RB ( statvfs () +¤Î¾ì¹ç) +.I path +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Ë¸¡º÷µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EBADF +.\"O .RB ( fstatvfs ()) +.\"O .I fd +.\"O is not a valid open file descriptor. +.RB ( fstatvfs () +¤Î¾ì¹ç) +.I fd +¤¬Í­¸ú¤Ê¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EFAULT +.\"O .I Buf +.\"O or +.\"O .I path +.\"O points to an invalid address. +.I buf +¤Þ¤¿¤Ï +.I path +¤¬Ìµ¸ú¤Ê¥¢¥É¥ì¥¹¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINTR +.\"O This call was interrupted by a signal. +¤³¤Î¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤ÆÃæÃǤµ¤ì¤¿¡£ +.TP +.B EIO +.\"O An I/O error occurred while reading from the file system. +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤éÆɤ߽Ф·¤Æ¤¤¤ë´Ö¤Ë I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ELOOP +.\"O .RB ( statvfs ()) +.\"O Too many symbolic links were encountered in translating +.\"O .IR path . +.RB ( statvfs () +¤Î¾ì¹ç) +.I path +¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.\"O .RB ( statvfs ()) +.\"O .I path +.\"O is too long. +.RB ( statvfs () +¤Î¾ì¹ç) +.I path +¤¬Ä¹¤¹¤®¤ë¡£ +.TP +.B ENOENT +.\"O .RB ( statvfs ()) +.\"O The file referred to by +.\"O .I path +.\"O does not exist. +.RB ( statvfs () +¤Î¾ì¹ç) +.I path +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +.\"O Insufficient kernel memory was available. +½½Ê¬¤Ê¥«¡¼¥Í¥ë¥á¥â¥ê¤¬»ÈÍѤǤ­¤Ê¤¤¡£ +.TP +.B ENOSYS +.\"O The file system does not support this call. +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¤³¤Î¸Æ¤Ó½Ð¤·¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O .RB ( statvfs ()) +.\"O A component of the path prefix of +.\"O .I path +.\"O is not a directory. +.RB ( statvfs () +¤Î¾ì¹ç) +.I path +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EOVERFLOW +.\"O Some values were too large to be represented in the returned struct. +¤¤¤¯¤Ä¤«¤ÎÃͤϡ¢ÊÖ¤µ¤ì¤ë¹½Â¤ÂΤÇɽ¸½¤¹¤ë¤Ë¤ÏÂ礭¤¹¤®¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The Linux kernel has system calls +.\"O .BR statfs (2) +.\"O and +.\"O .BR fstatfs (2) +.\"O to support this library call. +Linux ¥«¡¼¥Í¥ë¤Ë¤Ï¡¢¤³¤Î¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤¿¤á¤Ë¡¢ +.BR statfs (2), +.BR fstatfs (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤¢¤ë¡£ + +.\"O The current glibc implementations of +¸½ºß¤Î glibc ¤Î¼ÂÁõ¤Ë¤ª¤¤¤Æ¡¢ +.sp +.nf + pathconf(path, _PC_REC_XFER_ALIGN); + pathconf(path, _PC_ALLOC_SIZE_MIN); + pathconf(path, _PC_REC_MIN_XFER_SIZE); +.fi +.sp +.\"O respectively use the +.\"O .IR f_frsize , +.\"O .IR f_frsize , +.\"O and +.\"O .I f_bsize +.\"O fields of the return value of +.\"O .IR "statvfs(path,buf)" . +¤Ï¡¢¤½¤ì¤¾¤ì +.I "statvfs(path,buf)" +¤ÎÊÖ¤êÃͤΠ+.IR f_frsize , +.IR f_frsize , +.I f_bsize +¥Õ¥£¡¼¥ë¥É¤ò»È¤¦¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR statfs (2) diff --git a/draft/man2/stime.2 b/draft/man2/stime.2 new file mode 100644 index 00000000..148f57f2 --- /dev/null +++ b/draft/man2/stime.2 @@ -0,0 +1,100 @@ +.\" 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 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 ¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼ +.\" +.TH STIME 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +stime \- »þ´Ö¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int stime(time_t *" t ); +.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 stime (): +_SVID_SOURCE +.\"O .SH DESCRIPTION +.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)¤¬»ÈÍѤµ¤ì¤ë) +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O Error in getting information from user space. +¥æ¡¼¥¶¡¼¶õ´Ö¤«¤é¾ðÊó¤òÆÀ¤ë¤È¤­¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.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 +¸¢¸Â¤¬É¬ÍפǤ¢¤ë¡£ +.SH ½àµò +SVr4. +.SH ´ØÏ¢¹àÌÜ +.BR date (1), +.BR settimeofday (2), +.BR capabilities (7) diff --git a/draft/man2/swapon.2 b/draft/man2/swapon.2 new file mode 100644 index 00000000..e77c8aee --- /dev/null +++ b/draft/man2/swapon.2 @@ -0,0 +1,294 @@ +.\" 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 2007-06-22 "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)). +»ÈÍѤǤ­¤ë¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤Î¿ô¤Ë¤Ï¾å¸Â¤¬¤¢¤ê¡¢¤½¤Î¾å¸Â¤Ï +¥«¡¼¥Í¥ëÄê¿ô +.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) +¤Î¥Ú¡¼¥¸¡¦¥Þ¥¤¥°¥ì¡¼¥·¥ç¥óµ¡Ç½ÍѤ˥¹¥ï¥Ã¥×¡¦¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¡¼¤¬ +Æó¤ÄͽÌ󤵤ì¤ë)¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mkswap (8), +.BR swapoff (8), +.BR swapon (8) diff --git a/draft/man2/symlink.2 b/draft/man2/symlink.2 new file mode 100644 index 00000000..4c836be8 --- /dev/null +++ b/draft/man2/symlink.2 @@ -0,0 +1,263 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 1996-04-26 by Nick Duffek +.\" Modified 1996-11-06 by Eric S. Raymond +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Fri Dec 12 00:32:12 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modifed Sat Feb 12 11:20:18 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: soft link ¥½¥Õ¥È¡¦¥ê¥ó¥¯ +.\"WORD: hard link ¥Ï¡¼¥É¡¦¥ê¥ó¥¯ +.\"WORD: dangling link ²õ¤ì¤¿¥ê¥ó¥¯ +.\"WORD: sticky bit ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È +.\"WORD: ownership ½êÍ­¸¢ +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: effective uid ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: entry ¥¨¥ó¥È¥ê +.\" +.TH SYMLINK 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O symlink \- make a new name for a file +symlink \- ¥Õ¥¡¥¤¥ë¤Ë¿·¤·¤¤Ì¾Á°¤òÉÕ¤±¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int symlink(const char *" oldpath ", const char *" newpath ); +.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 symlink (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _POSIX_C_SOURCE\ >=\ 200112L +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR symlink () +.\"O creates a symbolic link named +.\"O .I newpath +.\"O which contains the string +.\"O .IR oldpath . +.BR symlink () +¤Ï +.I oldpath +¤È¤¤¤¦Ê¸»úÎó¤ò¥Õ¥¡¥¤¥ë¤ÎÆâÍƤȤ·¤Æ»ý¤Ä +.I newpath +¤È¤¤¤¦¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ (symbolic link) ¤òºîÀ®¤¹¤ë¡£ + +.\"O Symbolic links are interpreted at run time as if the contents of the +.\"O link had been substituted into the path being followed to find a file or +.\"O directory. +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ï¼Â¹Ô»þ¤Ë²ò¼á¤µ¤ì¡¢ +¥ê¥ó¥¯¤ÎÆâÍƤǥѥ¹¤òÃÖ¤­´¹¤¨¤Æ¡¢¤½¤Î¥Ñ¥¹¤òé¤ë¤³¤È¤Ç¡¢ +¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤ËÅþ㤹¤ë¡£ + +.\"O Symbolic links may contain +.\"O .I .. +.\"O path components, which (if used at the start of the link) refer to the +.\"O parent directories of that in which the link resides. +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ï¥Ñ¥¹¤ÎÉôʬ¤Ë +.I .. +¤ò´Þ¤à¤«¤â¤·¤ì¤Ê¤¤¡£¤³¤ì¤Ï (¤â¤·¥ê¥ó¥¯¤ÎºÇ½é¤Ë»ÈÍѤµ¤ì¤¿¾ì¹ç¤Ï) ¥ê¥ó¥¯¤Î +¸ºß¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬»²¾È¤µ¤ì¤ë¡£ + +.\"O A symbolic link (also known as a soft link) may point to an existing +.\"O file or to a nonexistent one; the latter case is known as a dangling +.\"O link. +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ï (¥½¥Õ¥È¡¦¥ê¥ó¥¯ (soft link) ¤È¤â¸Æ¤Ð¤ì) +¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¤·¡¢ +¸ºß¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤; +¸å¼Ô¤Î¾ì¹ç¤Ï²õ¤ì¤¿¥ê¥ó¥¯ (dangling link) ¤È¤â¸Æ¤Ð¤ì¤ë¡£ + +.\"O The permissions of a symbolic link are irrelevant; the ownership is +.\"O ignored when following the link, but is checked when removal or +.\"O renaming of the link is requested and the link is in a directory with +.\"O the sticky bit +.\"O .RB ( S_ISVTX ) +.\"O set. +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Îµö²Ä (permission) ¤Ï̵°ÕÌ£¤Ç¤¢¤ë; +¥ê¥ó¥¯¤òÄÉÀפ¹¤ë¾ì¹ç¤Ë¤Ï½êÍ­¸¢ (ownership) ¤Ï̵»ë¤µ¤ì¤ë¡£ +¤¿¤À¤·¡¢¥ê¥ó¥¯¤Îºï½ü¤ä̾Á°¤ÎÊѹ¹¤¬Í׵ᤵ¤ì¡¢¤«¤Ä¥ê¥ó¥¯¤¬Â¸ºß¤¹¤ë +¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È (sticky bit) +.RB ( S_ISVTX ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢½êÍ­¸¢¤Î¥Á¥§¥Ã¥¯¤¬¹Ô¤ï¤ì¤ë¡£ + +.\"O If +.\"O .I newpath +.\"O exists it will +.\"O .I not +.\"O be overwritten. +.I newpath +¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¾å½ñ¤­¤Ï\fB¤µ¤ì¤Ê¤¤\fR¡£ +.\"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 EACCES +.\"O Write access to the directory containing +.\"O .I newpath +.\"O is denied, or one of the directories in the path prefix of +.\"O .I newpath +.\"O did not allow search permission. +.\"O (See also +.\"O .BR path_resolution (7).) +.I newpath +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î½ñ¤­¹þ¤ß¤¬µñÈݤµ¤ì¤¿¤«¡¢ +.I newpath +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EEXIST +.\"O .I newpath +.\"O already exists. +.I newpath +¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤ë¡£ +.TP +.B EFAULT +.\"O .IR oldpath " or " newpath " points outside your accessible address space." +.IR oldpath " ¤ä " newpath " ¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£" +.TP +.B EIO +.\"O An I/O error occurred. +I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ELOOP +.\"O Too many symbolic links were encountered in resolving +.\"O .IR newpath . +.I newpath +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.\"O .IR oldpath " or " newpath " was too long." +.IR oldpath " ¤Þ¤¿¤Ï " newpath " ¤¬Ä¹²á¤®¤ë¡£" +.TP +.B ENOENT +.\"O A directory component in +.\"O .I newpath +.\"O does not exist or is a dangling symbolic link, or +.\"O .I oldpath +.\"O is the empty string. +.I newpath +¤Ë´Þ¤Þ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢²õ¤ì¤¿¥ê¥ó¥¯¤Ç¤¢¤ë¤«¡¢ +.I oldpath +¤¬¶õʸ»úÎó¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +.\"O Insufficient kernel memory was available. +½½Ê¬¤Ê¥«¡¼¥Í¥ë (kernel) ¤Î¥á¥â¥ê¡¼¤¬¤Ê¤¤¡£ +.TP +.B ENOSPC +.\"O The device containing the file has no room for the new directory +.\"O entry. +¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¥Ð¥¤¥¹¤Ë¿·¤·¤¤¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê +(directory entry) ¤òºîÀ®¤¹¤ë¤À¤±¤Î½½Ê¬¤ÊÍÆÎ̤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O A component used as a directory in +.\"O .I newpath +.\"O is not, in fact, a directory. +.I newpath +¤Ë´Þ¤Þ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¡¢¼ÂºÝ¤Ë¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EPERM +.\"O The file system containing +.\"O .I newpath +.\"O does not support the creation of symbolic links. +.I newpath +¤ò´Þ¤ó¤Ç¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à (file system) ¤¬ +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ÎºîÀ®¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EROFS +.\"O .I newpath +.\"O is on a read-only file system. +.I newpath +¤¬Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .\" SVr4 documents additional error codes EDQUOT and ENOSYS. +.\" SVr4 ¤Ë¤Ï¾¤Ë EDQUOT, ENOSYS ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.\"O .\" See +.\"O .\" .BR open (2) +.\"O .\" re multiple files with the same name, and NFS. +.\" .BR open (2) +.\" ¤ò¸«¤Æ¡¢Æ±¤¸Ì¾Á°¤Î½ÅÊ£¤È NFS ¤Ë¤Ä¤¤¤Æ»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O No checking of +.\"O .I oldpath +.\"O is done. +.I oldpath +¤Ë¤Ä¤¤¤Æ¤Î¥Á¥§¥Ã¥¯¤Ï¹Ô¤Ê¤ï¤ì¤Ê¤¤¡£ + +.\"O Deleting the name referred to by a symlink will actually delete the +.\"O file (unless it also has other hard links). +.\"O If this behavior is not desired, use +.\"O .BR link (2). +symlink ¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤ë̾Á°¤òºï½ü¤¹¤ë¤È (¤½¤ì¤¬Â¾¤Ë¥Ï¡¼¥É¡¦¥ê¥ó¥¯ +(hard link) ¤ò»ý¤¿¤Ê¤±¤ì¤Ð) ¼ÂºÝ¤Ë¥Õ¥¡¥¤¥ë¤¬ºï½ü¤µ¤ì¤ë¡£ +¤³¤ÎÆ°ºî¤¬Ë¾¤ó¤À¤â¤Î¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢ +.BR link (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ln (1), +.BR lchown (2), +.BR link (2), +.BR lstat (2), +.BR open (2), +.BR readlink (2), +.BR rename (2), +.BR symlinkat (2), +.BR unlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/draft/man2/symlinkat.2 b/draft/man2/symlinkat.2 new file mode 100644 index 00000000..620e5c4d --- /dev/null +++ b/draft/man2/symlinkat.2 @@ -0,0 +1,191 @@ +.\" 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-08-29 by Yuichi SATO , LDP v2.39 +.\" +.TH SYMLINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "int symlinkat(const char *" oldpath ", int " newdirfd \ +", const char *" newpath ); +.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 symlinkat (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.\"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) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.\"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) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.\"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) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I newpath +.\"O is absolute, then +.\"O .I newdirfd +.\"O is ignored. +.I newpath +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I newdirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.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 +.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 () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR symlinkat () +.\"O was added to Linux in kernel 2.6.16. +.BR symlinkat () +¤Ï 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 symlinkat (). +.BR symlinkat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR openat (2), +.BR symlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/draft/man2/sync.2 b/draft/man2/sync.2 new file mode 100644 index 00000000..4c8745d8 --- /dev/null +++ b/draft/man2/sync.2 @@ -0,0 +1,110 @@ +.\" 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 Sat Jul 24 12:02:47 1993 by Rik Faith +.\" Modified 15 Apr 1995 by Michael Chastain : +.\" Added reference to `bdflush(2)'. +.\" Modified 960414 by Andries Brouwer : +.\" Added the fact that since 1.3.20 sync actually waits. +.\" Modified Tue Oct 22 22:27:07 1996 by Eric S. Raymond +.\" Modified 2001-10-10 by aeb, following Michael Kerrisk. +.\" +.\" Japanese Version Copyright (c) 1997 Daisuke Sato +.\" all rights reserved. +.\" Translated Sat Apr 19 15:22:53 JST 1997 +.\" by Daisuke Sato +.\" Modified Sun Mar 21 17:23:38 JST 1999 +.\" by HANATAKA Shinya +.\" Updated Tue Oct 16 JST 2001 by Kentaro Shirakata +.\" Updated Mon Sep 8 JST 2003 by Kentaro Shirakata +.\" +.\"WORD: buffer cache ¥Ð¥Ã¥Õ¥¡¡¦¥­¥ã¥Ã¥·¥å +.\"WORD: buffers ¥Ð¥Ã¥Õ¥¡ +.\"WORD: data integrity ¥Ç¡¼¥¿¤Î´°Á´À­ +.\" +.TH SYNC 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sync \- ¥Ð¥Ã¥Õ¥¡¥­¥ã¥Ã¥·¥å¤ò¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤à +.SH ½ñ¼° +.B #include +.sp +.B void sync(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 sync (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.BR sync () +¤Ï¤Þ¤º inode ¤ò¥Ð¥Ã¥Õ¥¡¤Ø½ñ¤­¹þ¤ß¡¢ +¤½¤ì¤«¤é¥Ð¥Ã¥Õ¥¡(buffer)¤ò¥Ç¥£¥¹¥¯¤Ø½ñ¤­¹þ¤à¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O This function is always successful. +¤³¤Î´Ø¿ô¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Since glibc 2.2.2 the Linux prototype is as listed above, +.\"O following the various standards. +.\"O In libc4, libc5, and glibc up to 2.2.1 +.\"O it was "int sync(void)", and +.\"O .BR sync () +.\"O always returned 0. +¤µ¤Þ¤¶¤Þ¤Êɸ½àµ¬³Ê¤Ç¤Îµ¬Äê¤Ë¤·¤¿¤¬¤Ã¤Æ¡¢ +glibc 2.2.2 ¤«¤é Linux ¤Ç¤Î¥×¥í¥È¥¿¥¤¥×¤Ï¾å½Ò¤Î¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +libc4, libc5 ¤È¡¢2.2.1 ¤Þ¤Ç¤Î glibc ¤Ç¤Ï "int sync(void)" ¤Ç¡¢ +.BR sync () +¤Ï¾ï¤Ë 0 ¤òÊÖ¤·¤Æ¤¤¤¿¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O According to the standard specification (e.g., POSIX.1-2001), +.\"O .BR sync () +.\"O schedules the writes, but may return before the actual +.\"O writing is done. +.\"O However, since version 1.3.20 Linux does actually wait. +.\"O (This still does not guarantee data integrity: modern disks have +.\"O large caches.) +ɸ½àµ¬³Ê (Î㤨¤Ð POSIX.1-2001) ¤Ë¤è¤ë¤È¡¢ +.BR sync () +¤Ï½ñ¤­¹þ¤à¤³¤È¤òͽÄê¤Ë +ÁȤ߹þ¤à¤Î¤ß¤Ç¼ÂºÝ¤Ë½ñ¤­¹þ¤ß¤¬½ªÎ»¤¹¤ëÁ°¤ËÌá¤Ã¤Æ¤â¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +°ìÊý¤Ç Linux ¤Ï¥Ð¡¼¥¸¥ç¥ó 1.3.20 ¤«¤é¤Ï½ñ¤­¹þ¤ß¤¬½ªÎ»¤¹¤ë¤Þ¤ÇÂԤġ£ +(ºÇ¶á¤Î¥Ç¥£¥¹¥¯¤ÏÂ礭¤Ê¥­¥ã¥Ã¥·¥å¤ò»ý¤Ã¤Æ¤¤¤ë¤¿¤á¡¢ + ¤³¤ì¤Ï¥Ç¡¼¥¿¤Î´°Á´À­ (data integrity) ¤Þ¤Ç¤ÏÊݾڤ·¤Æ¤¤¤Ê¤¤¡£) +.SH ´ØÏ¢¹àÌÜ +.BR bdflush (2), +.BR fdatasync (2), +.BR fsync (2), +.BR sync (8), +.BR update (8) diff --git a/draft/man2/sync_file_range.2 b/draft/man2/sync_file_range.2 new file mode 100644 index 00000000..6eaa1df6 --- /dev/null +++ b/draft/man2/sync_file_range.2 @@ -0,0 +1,302 @@ +.\" 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 +.B #define _GNU_SOURCE +.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), +.BR feature_test_macros (7) diff --git a/draft/man2/syscall.2 b/draft/man2/syscall.2 new file mode 100644 index 00000000..4267ead6 --- /dev/null +++ b/draft/man2/syscall.2 @@ -0,0 +1,113 @@ +.\" Copyright (c) 1980, 1991, 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. +.\" +.\" @(#)syscall.2 8.1 (Berkeley) 6/16/93 +.\" +.\" +.\" 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 +.SH ̾Á° +.\"O syscall \- indirect system call +syscall \- ´ÖÀÜ¥·¥¹¥Æ¥à¥³¡¼¥ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.BR "#define _GNU_SOURCE " " /* or _BSD_SOURCE or _SVID_SOURCE */" +.B #include +.BR "#include " "/* For SYS_xxx definitions */" + +.BI "int syscall(int " number ", ...);" +.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 +.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 +¤ËÆþ¤ì¤é¤ì¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O .BR syscall () +.\"O first appeared in +.\"O 4BSD. +.BR syscall () +¤Ï 4BSD ¤ÇºÇ½é¤ËÅо줷¤¿¡£ +.\"O .SH EXAMPLE +.SH Îã +.nf +#define _GNU_SOURCE +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + pid_t tid; + + tid = syscall(SYS_gettid); +} +.fi +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR _syscall (2), +.BR intro (2), +.BR syscalls (2) diff --git a/draft/man2/syscalls.2 b/draft/man2/syscalls.2 new file mode 100644 index 00000000..affdbb62 --- /dev/null +++ b/draft/man2/syscalls.2 @@ -0,0 +1,1065 @@ +.\" 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 2009-05-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.28 +.\"O (or in a few cases only on older kernels) is as follows: +¥«¡¼¥Í¥ë 2.6.28 ¤ÇÍøÍѲÄǽ¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥ê¥¹¥È¤ò°Ê²¼¤Ë¼¨¤¹ +(¤½¤ì°ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤À¤±ÍøÍѲÄǽ¤Ê¤â¤Î¤â¾¯¿ô¤À¤¬´Þ¤Þ¤ì¤ë): +.\" +.\" 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.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 +\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 +\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) +\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 +\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 +\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 +.\" \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.6 +\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 new file mode 100644 index 00000000..5f20505d --- /dev/null +++ b/draft/man2/sysctl.2 @@ -0,0 +1,249 @@ +.\" Copyright (C) 1996 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 April 1996 by Andries Brouwer +.\" 960412: Added comments from Stephen Tweedie +.\" 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 ¥Ä¥ê¡¼ +.\" +.TH SYSCTL 2 2008-11-20 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sysctl \- read/write system parameters +sysctl \- ¥·¥¹¥Æ¥à¡¦¥Ñ¥é¥á¡¼¥¿¡¼¤òÆɤ߽ñ¤­¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "int _sysctl(struct __sysctl_args *" args ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .B Do not use this system call! +.\"O See NOTES. +.B ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ÈÍѤ·¤Ê¤¤¤³¤È! +¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¡£ + +.\"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 () +¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë¥Ñ¥é¥á¡¼¥¿¡¼¤òÆɤ߽ñ¤­¤¹¤ë¡£Î㤨¤Ð¡¢ +¥Û¥¹¥È¥Í¡¼¥à¤äƱ»þ¤Ë¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤ÎºÇÂç¿ô¤Ê¤É¡£ +°ú¤­¿ô¤Ï°Ê²¼¤Î·Á¼°¤Ç¤¢¤ë¡£ +.PP +.in +4n +.nf +struct __sysctl_args { + int *name; /* integer vector describing variable */ + int nlen; /* length of this vector */ + void *oldval; /* 0 or address where to store old value */ + size_t *oldlenp; /* available room for old value, + overwritten by actual size of old value */ + void *newval; /* 0 or address of new value */ + size_t newlen; /* size of new value */ +}; +.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" +.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 +.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" +.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 () +´Ø¿ô¤ÎÀë¸À¤ÏξÊý¤ÇƱ¤¸¤Ç¤¢¤ë¡£ +.\"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 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 +.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 +.SH Îã +.nf +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +int _sysctl(struct __sysctl_args *args ); + +#define OSNAMESZ 100 + +int +main(void) +{ + struct __sysctl_args args; + char osname[OSNAMESZ]; + size_t osnamelth; + int name[] = { CTL_KERN, KERN_OSTYPE }; + + memset(&args, 0, sizeof(struct __sysctl_args)); + args.name = name; + args.nlen = sizeof(name)/sizeof(name[0]); + args.oldval = osname; + args.oldlenp = &osnamelth; + + osnamelth = sizeof(osname); + + if (syscall(SYS__sysctl, &args) == \-1) { + perror("_sysctl"); + exit(EXIT_FAILURE); + } + printf("This machine is running %*s\\n", osnamelth, osname); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR proc (5) diff --git a/draft/man2/sysfs.2 b/draft/man2/sysfs.2 new file mode 100644 index 00000000..acb431e0 --- /dev/null +++ b/draft/man2/sysfs.2 @@ -0,0 +1,175 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created Wed Aug 9 1995 Thomas K. Dyas +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Tue Mar 4 00:03:08 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Sat Jun 2 20:46:34 JST 2001 +.\" by Yuichi SATO +.\" +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: identifier string ¼±ÊÌʸ»úÎó +.\"WORD: type index ·¿¥¤¥ó¥Ç¥Ã¥¯¥¹ +.\" +.TH SYSFS 2 1995-08-09 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sysfs \- get file system type information +sysfs \- ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à (file system) ¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.BI "int sysfs(int " option ", const char *" fsname ); + +.BI "int sysfs(int " option ", unsigned int " fs_index ", char *" buf ); + +.BI "int sysfs(int " option ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sysfs () +.\"O returns information about the file system types currently present in +.\"O the kernel. +.\"O The specific form of the +.\"O .BR sysfs () +.\"O call and the information returned depends on the +.\"O .I option +.\"O in effect: +.BR sysfs () +¤Ï¸½ºß¥«¡¼¥Í¥ë (kernel) ¤Ë¸ºß¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î·¿ (type) ¾ðÊó¤òÊÖ¤¹¡£ +¤½¤ì¤¾¤ì¤Î +.BR sysfs () +¥³¡¼¥ë¤Î·Á¼°¤ÈÊÖ¤µ¤ì¤ë¾ðÊó¤Ï +.I option +¤Ë°Í¸¤·¤Æ¤ª¤ê¡¢¤½¤ì¤Ï: +.TP 3 +.B 1 +.\"O Translate the file-system identifier string +.\"O .I fsname +.\"O into a file-system type index. +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¼±ÊÌʸ»úÎó (identifier string) +.I fsname +¤ò¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î·¿¥¤¥ó¥Ç¥Ã¥¯¥¹ (type index) ¤ËËÝÌõ¤¹¤ë¡£ +.TP +.B 2 +.\"O Translate the file-system type index +.\"O .I fs_index +.\"O into a null-terminated file-system identifier string. +.\"O This string will +.\"O be written to the buffer pointed to by +.\"O .IR buf . +.\"O Make sure that +.\"O .I buf +.\"O has enough space to accept the string. +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î·¿¥¤¥ó¥Ç¥Ã¥¯¥¹ +.I fs_index +¤ò NULL ½ªÃ¼¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¼±ÊÌʸ»úÎó¤ËËÝÌõ¤¹¤ë¡£ +¤³¤Îʸ»úÎó¤Ï +.I buf +¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¡¼¤Ø½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.I buf +¤Ëʸ»úÎó¤òÆþ¤ì¤ë¤À¤±¤Î½½Ê¬¤ÊÍÆÎ̤¬¤¢¤ë¤³¤È¤ò³Î¤«¤á¤ë¤³¤È¡£ +.TP +.B 3 +.\"O Return the total number of file system types currently present in the +.\"O kernel. +¸½ºß¥«¡¼¥Í¥ë¤Ë¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à·¿¤Î¿ô¤Î¹ç·×¤òÊÖ¤¹¡£ +.PP +.\"O The numbering of the file-system type indexes begins with zero. +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î·¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î¿ô¤Ï¥¼¥í¤«¤é»Ï¤Þ¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR sysfs () +.\"O returns the file-system index for option +.\"O .BR 1 , +.\"O zero for option +.\"O .BR 2 , +.\"O and the number of currently configured file systems for option +.\"O .BR 3 . +À®¸ù¤·¤¿¾ì¹ç +.BR sysfs () +¤Ï¡¢ +¥ª¥×¥·¥ç¥ó +.B 1 +¤Ç¤Ï +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÖ¤¹¡£ +¥ª¥×¥·¥ç¥ó +.B 2 +¤Ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +¥ª¥×¥·¥ç¥ó +.B 3 +¤Ï¸½ºßÀßÄꤵ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¿ô¤òÊÖ¤¹¡£ +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O .RI "Either " fsname " or " buf +.\"O is outside your accessible address space. +.RI fsname " ¤È " buf +¤Î¤É¤Á¤é¤«¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Ë¤¢¤ë¡£ +.TP +.B EINVAL +.\"O .I fsname +.\"O is not a valid file-system type identifier; +.\"O .I fs_index +.\"O is out-of-bounds; +.\"O .I option +.\"O is invalid. +.I fsname +¤¬Àµ¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î·¿¼±Ê̻ҤǤϤʤ¤; +.I fs_index +¤¬ÈϰϤγ°¤Ë¤¢¤ë; +.I option +¤¬Àµ¤·¤¯¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O On Linux with the +.\"O .I proc +.\"O file system mounted on +.\"O .IR /proc , +.\"O the same information can be derived from +.\"O .IR /proc/filesystems . +Linux ¤Ç¤Ï +.I /proc +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë +.I proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»È¤Ã¤Æ¡¢ +.I /proc/filesystems +¤è¤êƱ¤¸¾ðÊó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O There is no libc or glibc support. +.\"O There is no way to guess how large \fIbuf\fP should be. +libc ¤Þ¤¿¤Ï glibc ¤Î¥µ¥Ý¡¼¥È¤Ï¸ºß¤·¤Ê¤¤¡£ +\fIbuf\fP ¤ÎÂ礭¤µ¤¬¤É¤ì¤À¤±É¬Íפ«¤ò¿ä¬¤¹¤ëÊýË¡¤¬¤Ê¤¤¡£ diff --git a/draft/man2/sysinfo.2 b/draft/man2/sysinfo.2 new file mode 100644 index 00000000..f12bc34e --- /dev/null +++ b/draft/man2/sysinfo.2 @@ -0,0 +1,137 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (C) 1993 by Dan Miner (dminer@nyx.cs.du.edu) +.\" +.\" Permission is granted to freely distribute or modify this file +.\" for the purpose of improving Linux or its documentation efforts. +.\" If you modify this file, please put a date stamp and HOW you +.\" changed this file. Thanks. -DM +.\" +.\" 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 +.\" +.\" 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 ·¿Àë¸À +.\" +.TH SYSINFO 2 2007-11-15 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sysinfo \- returns information on overall system statistics +sysinfo \- ¥·¥¹¥Æ¥àÁ´ÂΤÎÅý·×¾ðÊó¤òÊÖ¤¹¡£ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int sysinfo(struct sysinfo *" info ); +.\"O .SH DESCRIPTION +.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 () +¤Ï°Ê²¼¤Î¹½Â¤ÂΤ˾ðÊó¤òÆþ¤ì¤ÆÊÖ¤¹¡£ + +.nf +.in +4n +struct sysinfo { + long uptime; /* Seconds since boot */ + unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ + unsigned long totalram; /* Total usable main memory size */ + unsigned long freeram; /* Available memory size */ + unsigned long sharedram; /* Amount of shared memory */ + unsigned long bufferram; /* Memory used by buffers */ + unsigned long totalswap; /* Total swap space size */ + unsigned long freeswap; /* swap space still available */ + unsigned short procs; /* Number of current processes */ + char _f[22]; /* Pads structure to 64 bytes */ +}; +.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 +.in +4n +struct sysinfo { + long uptime; /* Seconds since boot */ + unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ + unsigned long totalram; /* Total usable main memory size */ + unsigned long freeram; /* Available memory size */ + unsigned long sharedram; /* Amount of shared memory */ + unsigned long bufferram; /* Memory used by buffers */ + unsigned long totalswap; /* Total swap space size */ + unsigned long freeswap; /* swap space still available */ + unsigned short procs; /* Number of current processes */ + unsigned long totalhigh; /* Total high memory size */ + unsigned long freehigh; /* Available high memory size */ + unsigned int mem_unit; /* Memory unit size in bytes */ + char _f[20\-2*sizeof(long)\-sizeof(int)]; /* Padding for libc5 */ +}; +.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" +.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 +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O pointer to \fIstruct\ sysinfo\fP is invalid +.I sysinfo ¹½Â¤ÂÎ +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is Linux-specific, and should not be used in programs +.\"O intended to be portable. +¤³¤Î´Ø¿ô¤Ï 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" +.SH ´ØÏ¢¹àÌÜ +.BR proc (5) diff --git a/draft/man2/syslog.2 b/draft/man2/syslog.2 new file mode 100644 index 00000000..cb2f06aa --- /dev/null +++ b/draft/man2/syslog.2 @@ -0,0 +1,460 @@ +.\" 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 +.\" 2008-02-15, Jeremy Kerr +.\" Add info on command type 10; add details on types 6, 7, 8, & 9. +.\" 2008-02-15, Michael Kerrisk +.\" Update LOG_BUF_LEN details; update RETURN VALUE section. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Mon Dec 16 11:16:34 JST 2001 +.\" by HANATAKA Shinya +.\" Updated Thu Mar 6 2003 by Akihiro MOTOKI +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2008-04-04, Akihiro MOTOKI, LDP v2.79 +.\" Updated 2008-07-31, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: message ring buffer ¥á¥Ã¥»¡¼¥¸¡¦¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡ +.\"WORD: library ¥é¥¤¥Ö¥é¥ê +.\"WORD: kernel log buffer ¥«¡¼¥Í¥ë¡¦¥í¥°¡¦¥Ð¥Ã¥Õ¥¡ +.\"WORD: console ¥³¥ó¥½¡¼¥ë +.\"WORD: kernel panic ¥«¡¼¥Í¥ë¡¦¥Ñ¥Ë¥Ã¥¯ +.\"WORD: loglevel ¥í¥°¥ì¥Ù¥ë +.\"WORD: debug message ¥Ç¥Ð¥Ã¥°¡¦¥á¥Ã¥»¡¼¥¸ +.\" +.TH SYSLOG 2 2008-06-20 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O syslog, klogctl \- read and/or clear kernel message ring buffer; +.\"O set console_loglevel +syslog, klogctl \- ¥«¡¼¥Í¥ë¤Î¥á¥Ã¥»¡¼¥¸¡¦¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¤òÆɤó¤À¤ê¾Ãµî¤·¤¿¤ê¤¹¤ë; +console_loglevel ¤ÎÀßÄê¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.BI "int syslog(int " type ", char *" bufp ", int " len ); +.\"O .B " /* No wrapper provided in glibc */" +.B " /* glibc ¤Ç¤Ï¥é¥Ã¥Ñ¡¼´Ø¿ô¤ÏÄ󶡤µ¤ì¤Æ¤¤¤Ê¤¤ */" +.sp +.\"O /* The glibc interface */ +/* glibc ¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹ */ +.br +.B "#include " +.sp +.BI "int klogctl(int " type ", char *" bufp ", int " len ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O If you need the C library function +.\"O .BR syslog () +.\"O (which talks to +.\"O .BR syslogd (8)), +.\"O then look at +.\"O .BR syslog (3). +.\"O The system call of this name is about controlling the kernel +.\"O .IR printk () +.\"O buffer, and the glibc version is called +.\"O .BR klogctl (). +.RB ( syslogd (8) +¤ÈÏä¹) C ¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î +.BR syslog () +¤¬É¬Íפʾì¹ç¤Ï¡¢ +.BR syslog (3) +¤ò¸«¤ë¤³¤È¡£ +¤³¤Î̾Á°¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë¤Î +.IR printk () +¥Ð¥Ã¥Õ¥¡¤òÀ©¸æ¤¹¤ë¤â¤Î¤Ç¤¢¤ê¡¢glibc ¤Ç¤Ï +.BR klogctl () +¤È¸Æ¤Ð¤ì¤Æ¤¤¤ë¡£ + +.\"O .The \fItype\fP argument determines the action taken by this function. +\fItype\fP °ú¤­¿ô¤Ï¤³¤Î´Ø¿ô¤ÎÆ°ºî¤ò·èÄꤹ¤ë¡£ + +.\"O Quoting from +.\"O .IR kernel/printk.c : +.I kernel/printk.c +¤«¤é¤Î°úÍÑ : +.nf +.\"O /* +.\"O * Commands to sys_syslog: +.\"O * +.\"O * 0 \-\- Close the log. Currently a NOP. +.\"O * 1 \-\- Open the log. Currently a NOP. +.\"O * 2 \-\- Read from the log. +.\"O * 3 \-\- Read all messages remaining in the ring buffer. +.\"O * 4 \-\- Read and clear all messages remaining in the ring buffer +.\"O * 5 \-\- Clear ring buffer. +.\"O * 6 \-\- Disable printk to console +.\"O * 7 \-\- Enable printk to console +.\"O * 8 \-\- Set level of messages printed to console +.\"O * 9 \-\- Return number of unread characters in the log buffer +.\"O * 10 \-\- Return size of the log buffer +.\"O */ +/* + * Commands to sys_syslog: + * + * 0 \-\- ¥í¥°¤òÊĤ¸¤ë¡£¸½ºß¤Î¼ÂÁõ¤Ç¤Ï²¿¤â¤·¤Ê¤¤ (NOP) ¡£ + * 1 \-\- ¥í¥°¤ò³«¤¯¡£¸½ºß¤Î¼ÂÁõ¤Ç¤Ï²¿¤â¤·¤Ê¤¤ (NOP) ¡£ + * 2 \-\- ¥í¥°¤«¤éÆɤ߽Ф¹¡£ + * 3 \-\- ¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¤Ë»Ä¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¤ò¤¹¤Ù¤ÆÆɤ߽Ф¹¡£ + * 4 \-\- ¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¤Ë»Ä¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¤ò¤¹¤Ù¤ÆÆɤ߽Ф·¡¢¾Ãµî¤¹¤ë¡£ + * 5 \-\- ¥ê¥ó¥°¥Ð¥Ã¥Õ¥¡¤ò¾Ãµî¤¹¤ë¡£ + * 6 \-\- ¥³¥ó¥½¡¼¥ë¤Ø¤Î printk ¤ò̵¸ú¤Ë¤¹¤ë¡£ + * 7 \-\- ¥³¥ó¥½¡¼¥ë¤Ø¤Î printk ¤òÍ­¸ú¤Ë¤¹¤ë¡£ + * 8 \-\- ¥³¥ó¥½¡¼¥ë¤Ëɽ¼¨¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¤Î¥ì¥Ù¥ë¤òÀßÄꤹ¤ë¡£ + * 9 \-\- ¥í¥°¥Ð¥Ã¥Õ¥¡¤Î̤ÆɤÎʸ»ú¿ô¤òÊÖ¤¹¡£ + * 10 \-\- ¥í¥°¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òÊÖ¤¹¡£ + */ +.fi + +.\"O Only command types 3 and 10 are allowed to unprivileged processes. +.\"O Type 9 was added in 2.4.10; type 10 in 2.6.6. +ÈóÆø¢¥×¥í¥»¥¹¤Ë¤Ï¥³¥Þ¥ó¥É 3 ¤È 10 ¤Î¤ß¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë +(¥³¥Þ¥ó¥É 9 ¤Ï Linux 2.4.10 ¤Ç¡¢¥³¥Þ¥ó¥É 10 ¤Ï Linux 2.6.6 ¤ÇÄɲ䵤줿)¡£ +.\"O .SS The kernel log buffer +.SS ¥«¡¼¥Í¥ë¡¦¥í¥°¡¦¥Ð¥Ã¥Õ¥¡ (kernel log buffer) +.\"O The kernel has a cyclic buffer of length +.\"O .B LOG_BUF_LEN +.\"O in which messages given as arguments to the kernel function +.\"O .BR printk () +.\"O are stored (regardless of their loglevel). +.\"O In early kernels, +.\"O .B LOG_BUF_LEN +.\"O had the value 4096; +.\"O from kernel 1.3.54, it was 8192; +.\"O from kernel 2.1.113 it was 16384; +.\"O since 2.4.23/2.6 the value is a kernel configuration option. +.\"O .\" Under "General setup" ==> "Kernel log buffer size" +.\"O .\" For 2.6, precisely the option seems to have appeared in 2.5.55. +.\"O In recent kernels the size can be queried with command type 10. +¥«¡¼¥Í¥ë¤ÏŤµ +.B LOG_BUF_LEN +¤Î½ä²ó¼°¤Î¥Ð¥Ã¥Õ¥¡¤ò»ý¤Ã¤Æ¤ª¤ê¡¢ +¤½¤ì¤Ë¤Ï¥«¡¼¥Í¥ë´Ø¿ô¤Î +.BR printk () +¤Î°ú¤­¿ô¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿ +¥á¥Ã¥»¡¼¥¸¤¬ (¤½¤Î¥í¥°¥ì¥Ù¥ë¤Ë¤«¤«¤ï¤é¤º) ³ÊǼ¤µ¤ì¤ë¡£ +½é´ü¤Î¥«¡¼¥Í¥ë¤Ç¤Ï +.B LOG_BUF_LEN +¤ÎÃÍ¤Ï 4096 ¤Ç¤¢¤Ã¤¿¡£ +¥«¡¼¥Í¥ë 1.3.54 ¤«¤é¤Ï 8192¡¢ +¥«¡¼¥Í¥ë 2.1.113 ¤«¤é¤Ï 16384 ¤Ë¤Ê¤ê¡¢ +¥«¡¼¥Í¥ë 2.4.23 °Ê¹ß¤ª¤è¤Ó 2.6 °Ê¹ß¤Ç¤Ï¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +ÃͤòÀßÄê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" Under "General setup" ==> "Kernel log buffer size" +.\" For 2.6, precisely the option seems to have appeared in 2.5.55. +ºÇ¶á¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥³¥Þ¥ó¥É 10 ¤Ç¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òÌ䤤¹ç¤ï¤»¤Ç¤­¤ë¡£ + +.\"O The call +.\"O .I "syslog(2,buf,len)" +.\"O waits until this kernel log buffer is nonempty, and then reads +.\"O at most \fIlen\fP bytes into the buffer \fIbuf\fP. +.\"O It returns +.\"O the number of bytes read. +.\"O Bytes read from the log disappear from +.\"O the log buffer: the information can only be read once. +.\"O This is the function executed by the kernel when a user program +.\"O reads +.\"O .IR /proc/kmsg . +.I "syslog(2,buf,len)" +¤Î¸Æ¤Ó½Ð¤·¤Ï¥«¡¼¥Í¥ë¡¦¥í¥°¡¦¥Ð¥Ã¥Õ¥¡¤¬¶õ¤Ç¤Ê¤¯¤Ê¤ë¤Þ¤ÇÂԤäơ¢ +ºÇÂç \fIlen\fP ¥Ð¥¤¥È¤Þ¤Ç \fIbuf\fP ¤Ø¤ÈÆɤ߽Ф·¡¢Æɤ߹þ¤ó¤À +¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¥í¥°¤«¤éÆɤޤ줿¥Ð¥¤¥È¤Ï¥í¥°¡¦¥Ð¥Ã¥Õ¥¡¤«¤é¾Ã¤¨¤ë: +¾ðÊó¤Ï°ìÅÙ¤·¤«Æɤळ¤È¤¬¤Ç¤­¤Ê¤¤¡£ +¤³¤ì¤Ï¥æ¡¼¥¶¡¼¤Î¥×¥í¥°¥é¥à¤¬ +.I /proc/kmsg +¤òÆɤó¤À»þ¤Ë¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¼Â¹Ô¤µ¤ì¤ë´Ø¿ô¤Ç¤â¤¢¤ë¡£ + +.\"O The call +.\"O .I syslog(3,buf,len) +.\"O will read the last \fIlen\fP bytes from the log buffer (nondestructively), +.\"O but will not read more than was written into the buffer since the +.\"O last "clear ring buffer" command (which does not clear the buffer at all). +.\"O It returns the number of bytes read. +.I syslog(3,buf,len) +¤Î¸Æ¤Ó½Ð¤·¤Ï¥í¥°¡¦¥Ð¥Ã¥Õ¥¡¤ÎºÇ¸å¤Î \fIlen\fP ¥Ð¥¤¥È¤ò +(ÈóÇ˲õŪ¤Ë)Æɤ߽Ф¹¡¢¤·¤«¤·¡¢Ä¾¶á¤Î¡Ö¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¾Ãµî¡×Ì¿Îá +(¤³¤ÎÌ¿Îá¤Ï¥Ð¥Ã¥Õ¥¡¤ò¾Ãµî¤¹¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤) +°Ê¹ß¤Ë¥Ð¥Ã¥Õ¥¡¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¾ðÊó¤·¤«Æɤ߽Ф»¤Ê¤¤¡£ +ÊÖ¤êÃͤÏÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤Ç¤¢¤ë¡£ + +.\"O The call +.\"O .I syslog(4,buf,len) +.\"O does precisely the same, but also executes the "clear ring buffer" command. +.I syslog(4,buf,len) +¸Æ¤Ó½Ð¤·¤Ï¡Ö¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¾Ãµî¡×Ì¿Îá¤â¼Â¹Ô¤¹¤ë°Ê³°¤Ï +µ¡Ç½ 3 ¤È´°Á´¤ËƱ¤¸¤Ç¤¢¤ë¡£ + +.\"O The call +.\"O .I syslog(5,dummy,dummy) +.\"O executes just the "clear ring buffer" command. +.\"O (In each call where +.\"O .I buf +.\"O or +.\"O .I len +.\"O is shown as "dummy", the value of the argument is ignored by the call.) +.I syslog(5,dummy,dummy) +¸Æ¤Ó½Ð¤·¤Ï¡Ö¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¾Ãµî¡×Ì¿Îá¤Î¤ß¤ò¼Â¹Ô¤¹¤ë +(¸Æ¤Ó½Ð¤·¤Î½ñ¼°¤Ç¡¢ +.I buf +¤ä +.I len +¤¬ "dummy" ¤Èµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤Î°ú¤­¿ô¤ÎÃͤ¬Ìµ»ë¤µ¤ì¤ë¤³¤È¤òɽ¤¹)¡£ + +.\"O The call +.\"O .I syslog(6,dummy,dummy) +.\"O sets the console log level to minimum, so that no messages are printed +.\"O to the console. +.I syslog(6,dummy,dummy) +¸Æ¤Ó½Ð¤·¤Ï¥³¥ó¥½¡¼¥ë¤Î¥í¥°¥ì¥Ù¥ë¤òºÇ¾®¤ËÀßÄꤷ¡¢ +¥³¥ó¥½¡¼¥ë¤Ë¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£ + +.\"O The call +.\"O .I syslog(7,dummy,dummy) +.\"O sets the console log level to default, so that messages are printed +.\"O to the console. +.I syslog(7,dummy,dummy) +¸Æ¤Ó½Ð¤·¤Ï¥³¥ó¥½¡¼¥ë¤Î¥í¥°¥ì¥Ù¥ë¤ò¥Ç¥Õ¥©¥ë¥È¤ËÀßÄꤷ¡¢ +¥³¥ó¥½¡¼¥ë¤Ë¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤ë¤è¤¦¤Ë¤¹¤ë¡£ + +.\"O The call +.\"O .I syslog(8,dummy,level) +.\"O sets the console log level to +.\"O .IR level , +.\"O which must be an integer between 1 and 8 (inclusive). +.\"O See the +.\"O .B loglevel +.\"O section for details. +.I syslog(8,dummy,level) +¸Æ¤Ó½Ð¤·¤Ï¥³¥ó¥½¡¼¥ë¤Î¥í¥°¥ì¥Ù¥ë¤ò +.I level +¤ËÀßÄꤹ¤ë¡£ +.I level +¤Ï 1 °Ê¾å 8 °Ê²¼¤ÎÀ°¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¾ÜºÙ¤Ï +.B ¥í¥°¥ì¥Ù¥ë (loglevel) +¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ + +.\"O The call +.\"O .I syslog(9,dummy,dummy) +.\"O returns the number of bytes currently available to be read +.\"O on the kernel log buffer. +.I syslog(9,dummy,dummy) +¸Æ¤Ó½Ð¤·¤Ï¥«¡¼¥Í¥ë¡¦¥í¥°¥Ð¥Ã¥Õ¥¡¤Ë¤¢¤ë¸½ºßÆɤ߽Ф·²Äǽ¤Ê¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ + +.\"O The call +.\"O .I syslog(10,dummy,dummy) +.\"O returns the total size of the kernel log buffer. +.I syslog(10,dummy,dummy) +¸Æ¤Ó½Ð¤·¤Ï¥«¡¼¥Í¥ë¡¦¥í¥°¥Ð¥Ã¥Õ¥¡¤ÎÁíÎ̤òÊÖ¤¹¡£ +.\"O .SS The loglevel +.SS ¥í¥°¥ì¥Ù¥ë (loglevel) +.\"O The kernel routine +.\"O .BR printk () +.\"O will only print a message on the +.\"O console, if it has a loglevel less than the value of the variable +.\"O .IR console_loglevel . +.\"O This variable initially has the value +.\"O .B DEFAULT_CONSOLE_LOGLEVEL +.\"O (7), but is set to 10 if the +.\"O kernel command line contains the word "debug", and to 15 in case +.\"O of a kernel fault (the 10 and 15 are just silly, and equivalent to 8). +¥«¡¼¥Í¥ë¡¦¥ë¡¼¥Á¥ó¤Î +.BR printk () +¤Ï¡¢¥í¥°¥ì¥Ù¥ë¤¬ +.I console_loglevel +ÊÑ¿ô¤è¤ê¾®¤µ¤¤¤È¤­¤Ë¤Î¤ß¡¢¥³¥ó¥½¡¼¥ë¤Ë¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£ +.I console_loglevel +¤ÏºÇ½é +.B DEFAULT_CONSOLE_LOGLEVEL +(7) ¤ËÀßÄꤵ¤ì¤ë¤¬¡¢µ¯Æ°»þ¤Ë¥«¡¼¥Í¥ë¤Î +¥³¥Þ¥ó¥É¡¦¥é¥¤¥ó¡¦¥ª¥×¥·¥ç¥ó¤Ë "debug" ¤È¤¤¤¦Ã±¸ì¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï +10 ¤ËÀßÄꤵ¤ì¡¢¥«¡¼¥Í¥ë¡¦¥Õ¥©¡¼¥ë¥È¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤Ï 15 ¤ËÀßÄꤵ¤ì¤ë +(⤷¡¢10 ¤ä 15 ¤È¤¤¤¦¿ô»ú¤Ë°ÕÌ£¤Ï¤Ê¤¯¡¢8 ¤ÈƱÅù¤Ç¤¢¤ë)¡£ +.\"O This variable is set (to a value in the range 1-8) by the call +.\"O .IR syslog(8,dummy,value) . +.\"O The calls +.\"O .I syslog(type,dummy,dummy) +.\"O with \fItype\fP equal to 6 or 7, set it to 1 (kernel panics only) +.\"O or 7 (all except debugging messages), respectively. +¤³¤ÎÊÑ¿ô¤Ï +.IR syslog(8,dummy,value) . +¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¡¢ÃͤÎÈÏ°Ï¤Ï 1-8 ¤Ç¤¢¤ë¡£ +.I syslog(type,dummy,dummy) +¸Æ¤Ó½Ð¤·¤Ç \fItype\fP ¤¬ 6 ¤â¤·¤¯¤Ï 7 ¤Î¾ì¹ç¡¢ +console_loglevel ¤Ï 1 (¥«¡¼¥Í¥ë¡¦¥Ñ¥Ë¥Ã¥¯¤Î¤ß)¡¢ +7 (¥Ç¥Ð¥Ã¥°¡¦¥á¥Ã¥»¡¼¥¸°Ê³°¤ÎÁ´¤Æ) ¤Ë¤½¤ì¤¾¤ìÀßÄꤵ¤ì¤ë¡£ + +.\"O Every text line in a message has its own loglevel. +.\"O This level is +.\"O .I "DEFAULT_MESSAGE_LOGLEVEL \- 1" +.\"O (6) unless the line starts with +.\"O where \fId\fP is a digit in the range 1-7, in which case the level +.\"O is \fId\fP. +.\"O The conventional meaning of the loglevel is defined in +.\"O .I +.\"O as follows: +¥á¥Ã¥»¡¼¥¸¤Î³Æ¹Ô¤Ï¤½¤ì¤¾¤ì¤Ë¥í¥°¥ì¥Ù¥ë¤ò»ý¤Ä¡£¤³¤Î¥í¥°¥ì¥Ù¥ë¤Ï +.I "DEFAULT_MESSAGE_LOGLEVEL \- 1" +(6) ¤Ç¤¢¤ë¤¬¡¢ (\fId\fP ¤Ï 1-7 ¤ÎÈϰϤοô»ú) ¤Ç»Ï¤Þ¤ë¹Ô¤Î +¥í¥°¥ì¥Ù¥ë¤Ï \fId\fP ¤Ç¤¢¤ë¡£ +¥í¥°¥ì¥Ù¥ë¤Î´·½¬Åª¤Ê°ÕÌ£¤Ï +.I +¤Ë°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: + +.nf +.\"O #define KERN_EMERG "<0>" /* system is unusable */ +.\"O #define KERN_ALERT "<1>" /* action must be taken immediately */ +.\"O #define KERN_CRIT "<2>" /* critical conditions */ +.\"O #define KERN_ERR "<3>" /* error conditions */ +.\"O #define KERN_WARNING "<4>" /* warning conditions */ +.\"O #define KERN_NOTICE "<5>" /* normal but significant condition */ +.\"O #define KERN_INFO "<6>" /* informational */ +.\"O #define KERN_DEBUG "<7>" /* debug-level messages */ +#define KERN_EMERG "<0>" /* ¥·¥¹¥Æ¥à¤¬»ÈÍÑÉÔǽ */ +#define KERN_ALERT "<1>" /* ľ¤Á¤ËÂн褬ɬÍ× */ +#define KERN_CRIT "<2>" /* Ã×̿Ū¤Ê¾õÂÖ */ +#define KERN_ERR "<3>" /* ¥¨¥é¡¼¾õÂÖ */ +#define KERN_WARNING "<4>" /* ·Ù¹ð¾õÂÖ */ +#define KERN_NOTICE "<5>" /* Ä̾ï¾õÂÖ¤À¤¬Âç»ö¤Ê¾ðÊó */ +#define KERN_INFO "<6>" /* ÄÌÃÎ */ +#define KERN_DEBUG "<7>" /* ¥Ç¥Ð¥Ã¥°¥ì¥Ù¥ë¤Î¾ðÊó */ +.fi +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O For \fItype\fP equal to 2, 3, or 4, a successful call to +.\"O .BR syslog () +.\"O returns the number +.\"O of bytes read. +.\"O For \fItype\fP 9, +.\"O .BR syslog () +.\"O returns the number of bytes currently +.\"O available to be read on the kernel log buffer. +.\"O For \fItype\fP 10, +.\"O .BR syslog () +.\"O returns the total size of the kernel log buffer. +.\"O For other values of \fItype\fP, 0 is returned on success. +\fItype\fP ¤¬ 2, 3, 4 ¤Î¾ì¹ç¡¢À®¸ù¤¹¤ë¤È +.BR syslog () +¤ÏÆɤ߽Ф·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +\fItype\fP ¤¬ 9 ¤Î¾ì¹ç¡¢ +¥«¡¼¥Í¥ë¡¦¥í¥°¥Ð¥Ã¥Õ¥¡¤Ë¤¢¤ë¸½ºßÆɤ߽Ф·²Äǽ¤Ê¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +\fItype\fP ¤¬ 10 ¤Î¾ì¹ç¡¢ +¥«¡¼¥Í¥ë¡¦¥í¥°¥Ð¥Ã¥Õ¥¡¤ÎÁíÎ̤òÊÖ¤¹¡£ +\fItype\fP ¤¬¤½¤ì°Ê³°¤ÎÃͤξì¹ç¡¢À®¸ù¤¹¤ë¤È 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O In case of error, \-1 is returned, +.\"O and \fIerrno\fP is set to indicate the error. +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1\ ¤¬Ê֤ꡢ +\fIerrno\fP ¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O Bad arguments (e.g., +.\"O bad +.\"O .IR type ; +.\"O or for +.\"O .I type +.\"O 2, 3, or 4, +.\"O .I buf +.\"O is NULL, +.\"O or +.\"O .I len +.\"O is less than zero; or for +.\"O .I type +.\"O 8, the +.\"O .I level +.\"O is outside the range 1 to 8). +ÉÔÀµ¤Ê°ú¤­¿ô +(¶ñÂÎŪ¤Ë¤Ï¡¢ +.I type +¤¬Àµ¤·¤¯¤Ê¤¤¡¢¤â¤·¤¯¤Ï +.I type +¤¬ 2, 3, 4 ¤Î¾ì¹ç¤Ë +.I buf +¤¬ NULL ¤« +.I len +¤¬ 0 ̤Ëþ¤Ç¤¢¤ë¡¢¤â¤·¤¯¤Ï +.I type +¤¬ 8 ¤Î¾ì¹ç¤Ë +.I level +¤¬ 1 °Ê¾å 8 °Ê²¼¤ÎÈϰϤËÆþ¤Ã¤Æ¤¤¤Ê¤¤)¡£ +.TP +.B EPERM +.\"O An attempt was made to change console_loglevel or clear the kernel +.\"O message ring buffer by a process without sufficient privilege +.\"O (more precisely: without the +.\"O .B CAP_SYS_ADMIN +.\"O capability). +½½Ê¬¤Ê¸¢¸Â¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹ (Àµ³Î¤Ë¤Ï +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹) ¤¬ console_loglevel¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿¤«¡¢ +¥«¡¼¥Í¥ë¡¦¥á¥Ã¥»¡¼¥¸¡¦¥ê¥ó¥°¤ò¾Ãµî¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B ERESTARTSYS +.\"O System call was interrupted by a signal - nothing was read. +.\"O (This can be seen only during a trace.) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¡¢²¿¤âÆɤ߽Ф»¤Ê¤«¤Ã¤¿¡£ +(¥È¥ì¡¼¥¹Ãæ¤Ë¤·¤«È¯À¸¤¹¤ë¤³¤È¤Ï¤Ê¤¤) +.TP +.B ENOSYS +.\"O This +.\"O .BR syslog () +.\"O system call is not available, because the kernel was compiled with the +.\"O .BR CONFIG_PRINTK +.\"O kernel-configuration option disabled. +¥«¡¼¥Í¥ë¤ÎÀßÄꥪ¥×¥·¥ç¥ó +.BR CONFIG_PRINTK +¤ò̵¸ú¤Ë¤·¤Æ¥«¡¼¥Í¥ë¤¬¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢ +.BR syslog () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÍøÍѤǤ­¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This system call is Linux-specific and should not be used in programs +.\"O intended to be portable. +¤³¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O From the very start people noted that it is unfortunate that +.\"O a system call and a library routine of the same name are entirely +.\"O different animals. +.\"O In libc4 and libc5 the number of this call was defined by +.\"O .BR SYS_klog . +.\"O In glibc 2.0 the syscall is baptized +.\"O .BR klogctl (). +¤«¤Ê¤ê½é´ü¤Îº¢¤«¤é¡¢Æ±¤¸Ì¾Á°¤ò»ý¤Ä¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤È +¥é¥¤¥Ö¥é¥ê¡¦¥ë¡¼¥Á¥ó¤¬Á´¤¯°Û¤Ê¤ëÂåʪ¤Ç¤¢¤ë¤Î¤ÏÉÔ¹¬¤Ê¤³¤È¤À¤È +µ¤ÉÕ¤«¤ì¤Æ¤¤¤¿¡£ +libc4 ¤È libc5 ¤Ç¤Ï¤³¤Î¥³¡¼¥ë¤ÎÈÖ¹æ¤Ï +.B SYS_klog +¤ÈÄêµÁ¤µ¤ì¤Æ¤¤¤¿¡£ +glibc2.0 ¤Ç¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.BR klogctl () +¤È¤¤¤¦Ì¾Á°¤Ë²þ¤á¤é¤ì¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR syslog (3) diff --git a/draft/man2/tee.2 b/draft/man2/tee.2 new file mode 100644 index 00000000..eb56254c --- /dev/null +++ b/draft/man2/tee.2 @@ -0,0 +1,290 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 2006 Jens Axboe +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-02-04, Akihiro MOTOKI +.\" +.TH TEE 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O tee \- duplicating pipe content +tee \- ¥Ñ¥¤¥×¤ÎÃæ¿È¤òÊ£À½¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "ssize_t tee(int " fd_in ", int " fd_out ", size_t " len \ +", unsigned int " flags ); +.fi +.\" Return type was long before glibc 2.7 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\" Example programs http://brick.kernel.dk/snaps +.\" +.\" +.\" add a "tee(in, out1, out2)" system call that duplicates the pages +.\" (again, incrementing their reference count, not copying the data) from +.\" one pipe to two other pipes. +.\"O .BR tee () +.\"O duplicates up to +.\"O .I len +.\"O bytes of data from the pipe referred to by the file descriptor +.\"O .I fd_in +.\"O to the pipe referred to by the file descriptor +.\"O .IR fd_out . +.\"O It does not consume the data that is duplicated from +.\"O .IR fd_in ; +.\"O therefore, that data can be copied by a subsequent +.\"O .BR splice (2). +.BR tee () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd_in +¤¬»²¾È¤¹¤ë¥Ñ¥¤¥×¤«¤é¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd_out +¤¬»²¾È¤¹¤ë¥Ñ¥¤¥×¤ØºÇÂç +.I len +¥Ð¥¤¥È¤Î¥Ç¡¼¥¿¤òÊ£À½¤¹¤ë¡£ +¤³¤ÎÁàºî¤Ç¤Ï¡¢Ê£À½¤µ¤ì¤ë¥Ç¡¼¥¿¤Ï +.I fd_in +¤«¤é¤Ï¾ÃÈñ¤µ¤ì¤Ê¤¤¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤ì¤é¤Î¥Ç¡¼¥¿¤ò¤³¤Î¸å¤Î +.BR splice (2) +¤Ç¥³¥Ô¡¼¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O .I flags +.\"O is a series of modifier flags, which share the name space with +.\"O .BR splice (2) +.\"O and +.\"O .BR vmsplice (2): +.I flags +¤Ï°ìÏ¢¤Î½¤¾þ¥Õ¥é¥°¤Ç¤¢¤ê¡¢ +.BR splice (2) +¤ä +.BR vmsplice (2) +¤È¶¦Ä̤Î̾Á°¤Ç¤¢¤ë¡£ +.TP 1.9i +.B SPLICE_F_MOVE +.\"O Currently has no effect for +.\"O .BR tee (); +.\"O see +.\"O .BR splice (2). +¸½ºß¤Î¤È¤³¤í +.BR tee () +¤Ç¤Ï²¿¤Î¸ú²Ì¤â¤Ê¤¤¡£ +.BR splice (2) +»²¾È¡£ +.TP +.B SPLICE_F_NONBLOCK +.\"O Do not block on I/O; see +.\"O .BR splice (2) +.\"O for further details. +Æþ½ÐÎÏ»þ¤ËÄä»ß (block) ¤·¤Ê¤¤¡£ +¾ÜºÙ¤Ï +.BR splice (2) +»²¾È¡£ +.TP +.B SPLICE_F_MORE +.\"O Currently has no effect for +.\"O .BR tee (), +.\"O but may be implemented in the future; see +.\"O .BR splice (2). +¸½ºß¤Î¤È¤³¤í +.BR tee () +¤Ç¤Ï²¿¤Î¸ú²Ì¤â¤Ê¤¤¤¬¡¢¾­ÍèŪ¤Ë¤Ï¼ÂÁõ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.BR splice (2) +»²¾È¡£ +.TP +.B SPLICE_F_GIFT +.\"O Unused for +.\"O .BR tee (); +.\"O see +.\"O .BR vmsplice (2). +.BR tee () +¤Ç¤Ï̤»ÈÍÑ¡£ +.BR vmsplice (2) +»²¾È¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O Upon successful completion, +.\"O .BR tee () +.\"O returns the number of bytes that were duplicated between the input +.\"O and output. +.\"O A return value of 0 means that there was no data to transfer, +.\"O and it would not make sense to block, because there are no +.\"O writers connected to the write end of the pipe referred to by +.\"O .IR fd_in . +À®¸ù¤·¤Æ´°Î»¤¹¤ë¤È¡¢ +.BR tee () +¤ÏÆþ½ÐÎÏ´Ö¤ÇÊ£À½¤µ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +ÊÖ¤êÃÍ 0 ¤Ï¥Ç¡¼¥¿¤ÎžÁ÷¤¬¹Ô¤ï¤ì¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î¾ì¹ç¡¢½èÍý¤òÄä»ß (block) ¤·¤Æ¤â̵°ÕÌ£¤Ç¤¢¤ë¡£ +¤Ê¤¼¤Ê¤é¡¢ +.I fd_in +¤¬»²¾È¤¹¤ë¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¼Ô¤¬¤¤¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ + +.\"O On error, +.\"O .BR tee () +.\"O returns \-1 and +.\"O .I errno +.\"O is set to indicate the error. +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR tee () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O .I fd_in +.\"O or +.\"O .I fd_out +.\"O does not refer to a pipe; or +.\"O .I fd_in +.\"O and +.\"O .I fd_out +.\"O refer to the same pipe. +.I fd_in +¤È +.I fd_out +¤Î¤É¤Á¤é¤«¤¬¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£¤â¤·¤¯¤Ï +.I fd_in +¤È +.I fd_out +¤¬Æ±¤¸¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.TP +.B ENOMEM +.\"O Out of memory. +¥á¥â¥êÉÔ­¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The +.\"O .BR tee () +.\"O system call first appeared in Linux 2.6.17. +.BR tee () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6.17 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This system call is Linux-specific. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Conceptually, +.\"O .BR tee () +.\"O copies the data between the two pipes. +.\"O In reality no real data copying takes place though: +.\"O under the covers, +.\"O .BR tee () +.\"O assigns data in the output by merely grabbing +.\"O a reference to the input. +³µÇ°¤È¤·¤Æ¤Ï¡¢ +.BR tee () +¤ÏÆó¤Ä¤Î¥Ñ¥¤¥×´Ö¤Ç¥Ç¡¼¥¿¤Î¥³¥Ô¡¼¤ò¹Ô¤¦¡£ +¤·¤«¤·¡¢¼ÂºÝ¤Ë¤Ï¼Â¥Ç¡¼¥¿¤Î¥³¥Ô¡¼¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +ÆâÉô¤Ç¤Ï¡¢ +.BR tee () +¤ÏÆþÎϦ¤ËÂФ¹¤ë»²¾È¤À¤±¤òºîÀ®¤¹¤ë¤³¤È¤Ç½ÐÎϦ¤Ë¥Ç¡¼¥¿¤ò +Äɲ乤롣 +.\"O .SH EXAMPLE +.SH Îã +.\"O The following example implements a basic +.\"O .BR tee (1) +.\"O program using the +.\"O .BR tee () +.\"O system call. +°Ê²¼¤ÎÎã¤Ï¡¢ +.BR tee () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¡¢ +´ðËÜŪ¤Ê +.BR tee (1) +¥×¥í¥°¥é¥à¤ò¼ÂÁõ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.nf + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int fd; + int len, slen; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd == \-1) { + perror("open"); + exit(EXIT_FAILURE); + } + + do { + /* + * tee stdin to stdout. + */ + len = tee(STDIN_FILENO, STDOUT_FILENO, + INT_MAX, SPLICE_F_NONBLOCK); + + if (len < 0) { + if (errno == EAGAIN) + continue; + perror("tee"); + exit(EXIT_FAILURE); + } else + if (len == 0) + break; + + /* + * Consume stdin by splicing it to a file. + */ + while (len > 0) { + slen = splice(STDIN_FILENO, NULL, fd, NULL, + len, SPLICE_F_MOVE); + if (slen < 0) { + perror("splice"); + break; + } + len \-= slen; + } + } while (1); + + close(fd); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR splice (2), +.BR vmsplice (2), +.BR feature_test_macros (7) diff --git a/draft/man2/time.2 b/draft/man2/time.2 new file mode 100644 index 00000000..62de235a --- /dev/null +++ b/draft/man2/time.2 @@ -0,0 +1,123 @@ +.\" 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 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 µª¸µ +.\" +.TH TIME 2 2010-02-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O time \- get time in seconds +time \- ÉÃñ°Ì¤Î»þ´Ö¤òÆÀ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "time_t time(time_t *" t ); +.\"O .SH DESCRIPTION +.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)) ¤«¤é¤ÎÉÿô¤ÇÊÖ¤¹¡£ + +.\"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" +.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 +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O .I t +.\"O points outside your accessible address space. +.I t +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR date (1), +.BR gettimeofday (2), +.BR ctime (3), +.BR ftime (3), +.BR time (7) diff --git a/draft/man2/timerfd_create.2 b/draft/man2/timerfd_create.2 new file mode 100644 index 00000000..88537055 --- /dev/null +++ b/draft/man2/timerfd_create.2 @@ -0,0 +1,829 @@ +.\" Copyright (C) 2008 Michael Kerrisk +.\" +.\" 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 +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-11-19, Akihiro MOTOKI , LDP v3.13 +.\" Updated 2009-04-24, Akihiro MOTOKI , LDP 3.20 +.\" +.TH TIMERFD_CREATE 2 2009-03-10 Linux "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O timerfd_create, timerfd_settime, timerfd_gettime \- +.\"O timers that notify via file descriptors +timerfd_create, timerfd_settime, timerfd_gettime \- +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤ÇÄÌÃΤ¹¤ë¥¿¥¤¥Þ¡¼ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int timerfd_create(int " clockid ", int " flags ); +.sp +.BI "int timerfd_settime(int " fd ", int " flags , +.BI " const struct itimerspec *" new_value , +.BI " struct itimerspec *" old_value ); +.sp +.BI "int timerfd_gettime(int " fd ", struct itimerspec *" curr_value ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These system calls create and operate on a timer +.\"O that delivers timer expiration notifications via a file descriptor. +.\"O They provide an alternative to the use of +.\"O .BR setitimer (2) +.\"O or +.\"O .BR timer_create (2), +.\"O with the advantage that the file descriptor may be monitored by +.\"O .BR select (2), +.\"O .BR poll (2), +.\"O and +.\"O .BR epoll (7). +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ËþλÄÌÃΤò¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤ÇÇÛÁ÷¤¹¤ë +¥¿¥¤¥Þ¡¼¤ÎÀ¸À®¤ÈÁàºî¤ò¹Ô¤¦¡£ +¤³¤ì¤é¤Ï¡¢ +.BR setitimer (2) +¤ä +.BR timer_create (2) +¤òÍѤ¤¤ëÊýË¡¤ÎÂå¤ï¤ê¤È¤Ê¤ë¤â¤Î¤Ç¤¢¤ê¡¢¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +.BR select (2), +.BR poll (2), +.BR epoll (7) +¤Ç´Æ»ë¤Ç¤­¤ë¤È¤¤¤¦ÍøÅÀ¤¬¤¢¤ë¡£ + +.\"O The use of these three system calls is analogous to the use of +.\"O .BR timer_create (2), +.\"O .BR timer_settime (2), +.\"O and +.\"O .BR timer_gettime (2). +.\"O (There is no analog of +.\"O .BR timer_getoverrun (2), +.\"O since that functionality is provided by +.\"O .BR read (2), +.\"O as described below.) +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Î¤Ï¡¢¤½¤ì¤¾¤ì +.BR timer_create (2), +.BR timer_settime (2), +.BR timer_gettime (2) +¤ò»È¤¦¤Î¤ÈƱÍͤǤ¢¤ë +.RB ( timer_getoverrun (2) +¤ËÂбþ¤¹¤ë¤â¤Î¤Ï¤Ê¤¯¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ë¤è¤¦¤Ë +¤³¤Îµ¡Ç½¤Ï +.BR read (2) +¤Ë¤è¤êÄ󶡤µ¤ì¤ë)¡£ +.\" +.SS timerfd_create() +.\"O .BR timerfd_create () +.\"O creates a new timer object, +.\"O and returns a file descriptor that refers to that timer. +.BR timerfd_create () +¤Ï¿·µ¬¤Î¥¿¥¤¥Þ¡¼¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¤·¡¢¤½¤Î¥¿¥¤¥Þ¡¼¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.\"O The +.\"O .I clockid +.\"O argument specifies the clock that is used to mark the progress +.\"O of the timer, and must be either +.\"O .B CLOCK_REALTIME +.\"O or +.\"O .BR CLOCK_MONOTONIC . +.\"O .B CLOCK_REALTIME +.\"O is a settable system-wide clock. +.\"O .B CLOCK_MONOTONIC +.\"O is a nonsettable clock that is not affected +.\"O by discontinuous changes in the system clock +.\"O (e.g., manual changes to system time). +.\"O The current value of each of these clocks can be retrieved using +.\"O .BR clock_gettime (2). +.I clockid +°ú¤­¿ô¤Ï¡¢¥¿¥¤¥Þ¡¼¤Î¿ÊĽ¤ò´ÉÍý¤¹¤ë¤¿¤á¤Î¥¯¥í¥Ã¥¯¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¡¢ +.B CLOCK_REALTIME +¤« +.B CLOCK_MONOTONIC +¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B CLOCK_REALTIME +¤Ï¥·¥¹¥Æ¥àÁ´ÂΤǻÈÍѤµ¤ì¤ë¥¯¥í¥Ã¥¯¤Ç¡¢¤³¤Î¥¯¥í¥Ã¥¯¤ÏÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +.B CLOCK_MONOTONIC +¤ÏÊѹ¹¤µ¤ì¤ë¤³¤È¤Î¤Ê¤¤¥¯¥í¥Ã¥¯¤Ç¡¢(¥·¥¹¥Æ¥à»þ¹ï¤Î¼êÆ°¤Ç¤ÎÊѹ¹¤Ê¤É¤Î) +¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤ÎÉÔϢ³¤ÊÊѲ½¤Î±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡£ +¤³¤ì¤é¤Î¥¯¥í¥Ã¥¯¤Î¸½ºß¤ÎÃÍ¤Ï +.BR clock_gettime (2) +¤ò»È¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£ + +.\"O Starting with Linux 2.6.27, the following values may be bitwise ORed in +.\"O .IR flags +.\"O to change the behavior of +.\"O .BR timerfd_create (): +Linux 2.6.27 °Ê¹ß¤Ç¤Ï¡¢ +°Ê²¼¤ÎÃͤΤ¤¤¯¤Ä¤«¤ò¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýÏ (OR) ¤Ç»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +.BR timerfd_create () +¤Î¿¶Éñ¤¤¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 14 +.B TFD_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) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.TP +.B TFD_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 +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O In Linux versions up to and including 2.6.26, +.\"O .I flags +.\"O must be specified as zero. +¥Ð¡¼¥¸¥ç¥ó 2.6.26 °ÊÁ°¤Î Linux ¤Ç¤Ï¡¢ +.I flags +°ú¤­¿ô¤Ï̤»ÈÍѤǤ¢¤ê¡¢0 ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SS timerfd_settime() +.\"O .BR timerfd_settime () +.\"O arms (starts) or disarms (stops) +.\"O the timer referred to by the file descriptor +.\"O .IR fd . +.BR timerfd_settime () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥¿¥¤¥Þ¡¼¤ò³«»Ï¤·¤¿¤êÄä»ß¤·¤¿¤ê¤¹¤ë¡£ + +.\"O The +.\"O .I new_value +.\"O argument specifies the initial expiration and interval for the timer. +.\"O The +.\"O .I itimer +.\"O structure used for this argument contains two fields, +.\"O each of which is in turn a structure of type +.\"O .IR timespec : +.I new_value +°ú¤­¿ô¤Ï¡¢¥¿¥¤¥Þ¡¼¤ÎËþλ»þ´Ö (expiration) ¤Î½é´üÃÍ¤È´Ö³Ö (interval) ¤ò +»ØÄꤹ¤ë¡£¤³¤Î°ú¤­¿ô¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë +.\"Omotoki: itimer structure ¤Ï itimerspec structure ¤Î´Ö°ã¤¤¤À¤í¤¦¡£ +.I itimerspec +¹½Â¤ÂÎ¤Ë¤Ï 2 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤¬¤¢¤ê¡¢³Æ¥Õ¥£¡¼¥ë¥É¤Ï +.I timespec +·¿¤Î¹½Â¤ÂΤǤ¢¤ë¡£ +.in +4n +.nf + +struct timespec { + time_t tv_sec; /* Seconds */ + long tv_nsec; /* Nanoseconds */ +}; + +struct itimerspec { + struct timespec it_interval; /* Interval for periodic timer */ + struct timespec it_value; /* Initial expiration */ +}; +.fi +.in +.PP +.\"O .I new_value.it_value +.\"O specifies the initial expiration of the timer, +.\"O in seconds and nanoseconds. +.\"O Setting either field of +.\"O .I new_value.it_value +.\"O to a nonzero value arms the timer. +.\"O Setting both fields of +.\"O .I new_value.it_value +.\"O to zero disarms the timer. +.I new_value.it_value +¤Ï¥¿¥¤¥Þ¡¼¤ÎËþλ»þ´Ö¤Î½é´üÃͤò¡¢ÉäȥʥÎÉäǻØÄꤹ¤ë¡£ +.I new_value.it_value +¤Î¥Õ¥£¡¼¥ë¥É¤Î¤¦¤Á¾¯¤Ê¤¯¤È¤â°ìÊý¤Ë 0 °Ê³°¤ÎÃͤòÀßÄꤹ¤ë¤È¡¢ +¥¿¥¤¥Þ¡¼¤¬³«»Ï¤µ¤ì¤ë¡£ +ξÊý¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤òÀßÄꤹ¤ë¤È¡¢¥¿¥¤¥Þ¡¼¤¬Ää»ß¤¹¤ë¡£ + +.\"O Setting one or both fields of +.\"O .I new_value.it_interval +.\"O to nonzero values specifies the period, in seconds and nanoseconds, +.\"O for repeated timer expirations after the initial expiration. +.\"O If both fields of +.\"O .I new_value.it_interval +.\"O are zero, the timer expires just once, at the time specified by +.\"O .IR new_value.it_value . +.I new_value.it_interval +¤Ï¥¿¥¤¥Þ¡¼¤Î°ì²óÌܤÎËþλ¸å¤Ë·«¤êÊÖ¤·¥¿¥¤¥Þ¡¼¤ÎËþλ´Ö³Ö¤ò¡¢ÉäȥʥÎÉäǻØÄꤹ¤ë¡£ +.I new_value.it_interval +¤Î¥Õ¥£¡¼¥ë¥É¤Î¤¦¤Á¾¯¤Ê¤¯¤È¤â°ìÊý¤Ë 0 °Ê³°¤ÎÃͤòÀßÄꤹ¤ë¤È¡¢ +·«¤êÊÖ¤·¥¿¥¤¥Þ¡¼¤¬Í­¸ú¤Ë¤Ê¤ë¡£ +ξÊý¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤òÀßÄꤷ¤¿¾ì¹ç¡¢¥¿¥¤¥Þ¡¼¤Ï +.I new_value.it_value +¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¸å¤Ë¡¢°ì²ó¤À¤±Ëþλ¤·¤ÆÄä»ß¤¹¤ë¡£ + +.\"O The +.\"O .I flags +.\"O argument is either 0, to start a relative timer +.\"O .RI ( new_value.it_interval +.\"O specifies a time relative to the current value of the clock specified by +.\"O .IR clockid ), +.\"O or +.\"O .BR TFD_TIMER_ABSTIME , +.\"O to start an absolute timer +.\"O .RI ( new_value.it_value +.\"O specifies an absolute time for the clock specified by +.\"O .IR clockid ; +.\"O that is, the timer will expire when the value of that +.\"O clock reaches the value specified in +.\"O .IR new_value.it_value ). +.I flags +°ú¤­¿ô¤Ë¤Ï 0 ¤« +.B TFD_TIMER_ABSTIME +¤ò»ØÄꤹ¤ë¡£ +0 ¤ÏÁêÂлþ¹ï¥¿¥¤¥Þ¡¼¤ò°ÕÌ£¤·¡¢ +.I new_value.it_interval +¤Ç¤Ï +.I clockid +¤Ç»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯¤Î¸½ºß¤ÎÃͤ«¤é¤ÎÁêÂÐŪ¤Ê»þ¹ï¤ò»ØÄꤹ¤ë¡£ +.B TFD_TIMER_ABSTIME +¤ÏÀäÂлþ¹ï¥¿¥¤¥Þ¡¼¤ò°ÕÌ£¤·¡¢ +.I new_value.it_interval +¤Ç¤Ï +.I clockid +¤Ç»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯¤ÎÀäÂлþ¹ï¤ò»ØÄꤹ¤ë¡£¤Ä¤Þ¤ê¡¢ +¥¯¥í¥Ã¥¯¤ÎÃͤ¬ +.I new_value.it_interval +¤Ç»ØÄꤵ¤ì¤¿»þ¹ï¤Ë㤷¤¿¤é¡¢¥¿¥¤¥Þ¡¼¤¬Ëþλ¤¹¤ë¡£ + +.\"O The +.\"O .I old_value +.\"O argument returns a structure containing the setting of the timer that +.\"O was current at the time of the call; see the description of +.\"O .BR timerfd_gettime () +.\"O following. +.I old_value +°ú¤­¿ô¤òÄ̤¸¤Æ¡¢ +.BR timerfd_settime () +¤ò¸Æ¤Ó½Ð¤·¤¿»þÅÀ¤Ç¤Î¥¿¥¤¥Þ¡¼¤ÎÀßÄê¤òÊÝ»ý¤·¤¿¹½Â¤ÂΤ¬ÊÖ¤µ¤ì¤ë¡£ +²¼µ­¤Î +.BR timerfd_gettime () +¤ÎÀâÌÀ¤ò»²¾È¡£ +.\" +.SS timerfd_gettime() +.\"O .BR timerfd_gettime () +.\"O returns, in +.\"O .IR curr_value , +.\"O an +.\"O .IR itimerspec +.\"O structure that contains the current setting of the timer +.\"O referred to by the file descriptor +.\"O .IR fd . +.BR timerfd_gettime () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥¿¥¤¥Þ¡¼¤Î¸½ºß¤ÎÀßÄ꤬Æþ¤Ã¤¿ +.I itimerspec +¹½Â¤ÂΤò¡¢ +.I curr_value +¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ + +.\"O The +.\"O .I it_value +.\"O field returns the amount of time +.\"O until the timer will next expire. +.\"O If both fields of this structure are zero, +.\"O then the timer is currently disarmed. +.\"O This field always contains a relative value, regardless of whether the +.\"O .BR TFD_TIMER_ABSTIME +.\"O flag was specified when setting the timer. +.I it_value +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥¿¥¤¥Þ¡¼¤¬¼¡¤ËËþλ¤¹¤ë¤Þ¤Ç¤Î»Ä¤ê»þ´Ö¤òÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂΤÎξÊý¤Î¥Õ¥£¡¼¥ë¥É¤¬ 0 ¤Ç¤¢¤ì¤Ð¡¢¥¿¥¤¥Þ¡¼¤Ï¸½ºßÄä»ß¤·¤Æ¤¤¤ë¡£ +¥¿¥¤¥Þ¡¼ÀßÄê»þ¤Ë +.B TFD_TIMER_ABSTIME +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿¤«¤Ë´Ø¤ï¤é¤º¡¢¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¾ï¤ËÁêÂÐÃͤ¬³ÊǼ¤µ¤ì¤ë¡£ + +.\"O The +.\"O .I it_interval +.\"O field returns the interval of the timer. +.\"O If both fields of this structure are zero, +.\"O then the timer is set to expire just once, at the time specified by +.\"O .IR curr_value.it_value . +.I it_interval +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥¿¥¤¥Þ¡¼¤Î´Ö³Ö¤òÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂΤÎξÊý¤Î¥Õ¥£¡¼¥ë¥É¤¬ 0 ¤Ç¤¢¤ì¤Ð¡¢¥¿¥¤¥Þ¡¼¤Ï +.I new_value.it_value +¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¸å¤Ë°ì²ó¤À¤±Ëþλ¤·¤ÆÄä»ß¤¹¤ë¤è¤¦¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS Operating on a timer file descriptor +.SS ¥¿¥¤¥Þ¡¼¡¦¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ëÁàºî +.\"O The file descriptor returned by +.\"O .BR timerfd_create () +.\"O supports the following operations: +.BR timerfd_create () +¤¬ÊÖ¤¹¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï°Ê²¼¤ÎÁàºî¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.TP +.BR read (2) +.\"O If the timer has already expired one or more times since +.\"O its settings were last modified using +.\"O .BR timerfd_settime (), +.\"O or since the last successful +.\"O .BR read (2), +.\"O then the buffer given to +.\"O .BR read (2) +.\"O returns an unsigned 8-byte integer +.\"O .RI ( uint64_t ) +.\"O containing the number of expirations that have occurred. +.\"O (The returned value is in host byte order, +.\"O i.e., the native byte order for integers on the host machine.) +.BR timerfd_settime () +¤ò»È¤Ã¤Æ¥¿¥¤¥Þ¡¼¤ÎÀßÄ꤬ºÇ¸åÊѹ¹¤µ¤ì¤Æ°Ê¹ß¡¢¤Þ¤¿¤Ï +.BR read (2) +¤Î¸Æ¤Ó½Ð¤·¤ËºÇ¸å¤ËÀ®¸ù¤·¤Æ°Ê¹ß¤Ë¡¢¥¿¥¤¥Þ¡¼¤ÎËþ뤬°ì²ó°Ê¾åȯÀ¸¤·¤Æ¤¤¤ì¤Ð¡¢ +.BR read (2) +¤ËÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë¡¢¥¿¥¤¥Þ¡¼Ëþλ²ó¿ô¤ò¼¨¤¹ 8 ¥Ð¥¤¥È¤Î unsigned ·¿¤ÎÀ°¿ô +.RI ( uint64_t ) +¤¬ÊÖ¤µ¤ì¤ë +(ÊÖ¤µ¤ì¤ëÃͤϥۥ¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¢¤Ä¤Þ¤ê¤½¤Î¥Û¥¹¥È¥Þ¥·¥ó¤Ë¤ª¤±¤ë +À°¿ô¤ÎÄ̾ï¤Î¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤¢¤ë)¡£ +.IP +.\"O If no timer expirations have occurred at the time of the +.\"O .BR read (2), +.\"O then the call either blocks until the next timer expiration, +.\"O or fails with the error +.\"O .B EAGAIN +.\"O if the file descriptor has been made nonblocking +.\"O (via the use of the +.\"O .BR fcntl (2) +.\"O .B F_SETFL +.\"O operation to set the +.\"O .B O_NONBLOCK +.\"O flag). +.BR read (2) +¤ò¹Ô¤Ã¤¿»þÅÀ¤Ç¥¿¥¤¥Þ¡¼¤ÎËþλ¤¬È¯À¸¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +.BR read (2) +¤ÏÄä»ß (block) ¤¹¤ë¡¢¤â¤·¤¯¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +ÈóÄä»ß (nonblocking) ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë (ÈóÄä»ß¥â¡¼¥É¤Ë¤¹¤ë¤Ë¤Ï¡¢ +.BR fcntl (2) +¤Î +.B F_SETFL +Ì¿Îá¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë)¡£ +.IP +.\"O A +.\"O .BR read (2) +.\"O will fail with the error +.\"O .B EINVAL +.\"O if the size of the supplied buffer is less than 8 bytes. +ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤¬ 8 ¥Ð¥¤¥È̤Ëþ¤Î¾ì¹ç¡¢ +.BR read (2) +¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.\"O .BR poll "(2), " select "(2) (and similar)" +.BR poll "(2), " select "(2) (¤ÈƱÍͤÎÁàºî)" +.\"O The file descriptor is readable +.\"O (the +.\"O .BR select (2) +.\"O .I readfds +.\"O argument; the +.\"O .BR poll (2) +.\"O .B POLLIN +.\"O flag) +.\"O if one or more timer expirations have occurred. +°ì¤Ä°Ê¾å¤Î¥¿¥¤¥Þ¡¼Ëþλ¤¬È¯À¸¤·¤Æ¤¤¤ì¤Ð¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÆɤ߽Ф·²Äǽ¤È¤Ê¤ë +.RB ( select (2) +¤Î +.I readfds +°ú¤­¿ô¤ä +.BR poll (2) +¤Î +.B POLLIN +¥Õ¥é¥°)¡£ +.IP +.\"O The file descriptor also supports the other file-descriptor +.\"O multiplexing APIs: +.\"O .BR pselect (2), +.\"O .BR ppoll (2), +.\"O and +.\"O .BR epoll (7). +¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢Â¾¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿Â¿½Å API ¤Ç¤¢¤ë +.BR pselect (2), +.BR ppoll (2), +.BR epoll (7) +¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.TP +.BR close (2) +.\"O When the file descriptor is no longer required it should be closed. +.\"O When all file descriptors associated with the same timer object +.\"O have been closed, +.\"O the timer is disarmed and its resources are freed by the kernel. +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¤½¤ì°Ê¹ß¤ÏɬÍפʤ¯¤Ê¤Ã¤¿ºÝ¤Ë¤Ï¡¢¥¯¥í¡¼¥º¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Ʊ¤¸ timer ¥ª¥Ö¥¸¥§¥¯¥È¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Á´¤Æ +¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¡¢¤½¤Î¥¿¥¤¥Þ¡¼¤Ï²ò½ü¤µ¤ì¡¢ +¤½¤Î¥ª¥Ö¥¸¥§¥¯¥ÈÍѤλñ¸»¤¬¥«¡¼¥Í¥ë¤Ë¤è¤ê²òÊü¤µ¤ì¤ë¡£ +.\" +.\"O .SS fork(2) semantics +.SS fork(2) ¤Ç¤Î°·¤¤ +.\"O After a +.\"O .BR fork (2), +.\"O the child inherits a copy of the file descriptor created by +.\"O .BR timerfd_create (). +.\"O The file descriptor refers to the same underlying +.\"O timer object as the corresponding file descriptor in the parent, +.\"O and +.\"O .BR read (2)s +.\"O in the child will return information about +.\"O expirations of the timer. +.BR fork (2) +¤¬¹Ô¤ï¤ì¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤Ï +.BR timerfd_create () +¤Ë¤è¤êÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥³¥Ô¡¼¤ò +·Ñ¾µ¤¹¤ë¡£¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¿Æ¥×¥í¥»¥¹¤ÎÂбþ¤¹¤ë +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÈƱ¤¸¥¿¥¤¥Þ¡¼¥ª¥Ö¥¸¥§¥¯¥È¤ò»²¾È¤·¤Æ¤ª¤ê¡¢ +»Ò¥×¥í¥»¥¹¤Î +.BR read (2) +¤Ç¤âƱ¤¸¥¿¥¤¥Þ¡¼¤ÎËþλ¤Ë´Ø¤¹¤ë¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£ +.\" +.\"O .SS execve(2) semantics +.SS execve(2) ¤Ç¤Î°·¤¤ +.\"O A file descriptor created by +.\"O .BR timerfd_create () +.\"O is preserved across +.\"O .BR execve (2), +.\"O and continues to generate timer expirations if the timer was armed. +.BR execve (2) +¤ÎÁ°¸å¤Ç +.BR timerfd_create () +¤Ë¤è¤êÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÊÝ»ý¤µ¤ì¡¢ +¥¿¥¤¥Þ¡¼¤¬³«»Ï¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¥¿¥¤¥Þ¡¼¤ÎËþλ¤¬È¯À¸¤·Â³¤±¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR timerfd_create () +.\"O returns a new file descriptor. +.\"O On error, \-1 is returned and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR timerfd_create () +¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ + +.\"O .BR timerfd_settime () +.\"O and +.\"O .BR timerfd_gettime () +.\"O return 0 on success; +.\"O on error they return \-1, and set +.\"O .I errno +.\"O to indicate the error. +.BR timerfd_settime () +¤È +.BR timerfd_gettime () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O .BR timerfd_create () +.\"O can fail with the following errors: +.BR timerfd_create () +¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.\"O The +.\"O .I clockid +.\"O argument is neither +.\"O .B CLOCK_MONOTONIC +.\"O nor +.\"O .BR CLOCK_REALTIME ; +.I clockid +°ú¤­¿ô¤¬ +.B CLOCK_MONOTONIC +¤Ç¤â +.B CLOCK_REALTIME +¤Ç¤â¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O .I flags +.\"O is invalid; +.\"O or, in Linux 2.6.26 or earlier, +.\"O .I flags +.\"O is nonzero. +.I flags +¤¬Ìµ¸ú¤Ç¤¢¤ë¡£¤â¤·¤¯¤Ï¡¢Linux 2.6.26 °ÊÁ°¤Î¾ì¹ç¤Ï +.I flags +¤¬ 0 °Ê³°¤Ç¤¢¤ë¡£ +.TP +.B EMFILE +.\"O The per-process limit of open file descriptors has been reached. +¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô¤¬¥×¥í¥»¥¹¤¢¤¿¤ê¤Î¾å¸Â¤Ë +㤷¤Æ¤¤¤¿¡£ +.TP +.B ENFILE +.\"O The system-wide limit on the total number of open files has been +.\"O reached. +¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ëÁí¿ô¤¬¥·¥¹¥Æ¥àÁ´ÂΤξå¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENODEV +.\"O Could not mount (internal) anonymous inode device. +(¥«¡¼¥Í¥ëÆâ¤Î) ̵̾ inode ¥Ç¥Ð¥¤¥¹¤ò¥Þ¥¦¥ó¥È¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O There was insufficient kernel memory to create the timer. +¥¿¥¤¥Þ¡¼¤òºîÀ®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥«¡¼¥Í¥ë¥á¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.PP +.\"O .BR timerfd_settime () +.\"O and +.\"O .BR timerfd_gettime () +.\"O can fail with the following errors: +.BR timerfd_settime () +¤È +.BR timerfd_gettime () +¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EBADF +.\"O .I fd +.\"O is not a valid file descriptor. +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EFAULT +.\"O .IR new_value , +.\"O .IR old_value , +.\"O or +.\"O .I curr_value +.\"O is not valid a pointer. +.IR new_value , +.IR old_value , +.I curr_value +¤¬Í­¸ú¤Ê¥Ý¥¤¥ó¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O .I fd +.\"O is not a valid timerfd file descriptor. +.I fd +¤¬Í­¸ú¤Ê timerfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.PP +.\"O .BR timerfd_settime () +.\"O can also fail with the following errors: +.BR timerfd_settime () +¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤â¤¢¤ë¡£ +.TP +.B EINVAL +.\"O .I new_value +.\"O is not properly initialized (one of the +.\"O .I tv_nsec +.\"O falls outside the range zero to 999,999,999). +.I new_value +¤¬Å¬Àڤ˽é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤ +.RI ( tv_nsec +¤Î°ì¤Ä¤¬ 0 ¤«¤é 999,999,999 ¤Þ¤Ç¤ÎÈϰϤËÆþ¤Ã¤Æ¤¤¤Ê¤¤)¡£ +.TP +.B EINVAL +.\" This case only checked since 2.6.29, and 2.2.2[78].some-stable-version. +.\" In older kernel versions, no check was made for invalid flags. +.\"O .I flags +.\"O is invalid. +.I flags +¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These system calls are available on Linux since kernel 2.6.25. +.\"O Library support is provided by glibc since version 2.8. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.6.25 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +¥é¥¤¥Ö¥é¥ê¦¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.8 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O These system calls are Linux-specific. +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The following program creates a timer and then monitors its progress. +.\"O The program accepts up to three command-line arguments. +.\"O The first argument specifies the number of seconds for +.\"O the initial expiration of the timer. +.\"O The second argument specifies the interval for the timer, in seconds. +.\"O The third argument specifies the number of times the program should +.\"O allow the timer to expire before terminating. +.\"O The second and third command-line arguments are optional. +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥¿¥¤¥Þ¡¼¤òºîÀ®¤·¡¢¤½¤Î¿ÊĽ¤ò¥â¥Ë¥¿¡¼¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥×¥í¥°¥é¥à¤ÏºÇÂç¤Ç 3 ¸Ä¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ò¼è¤ê¡¢ +Âè°ì°ú¤­¿ô¤Ç¤Ï¥¿¥¤¥Þ¡¼¤ÎËþλ»þ´Ö¤Î½é´üÃÍ (Éÿôñ°Ì) ¤ò¡¢ +ÂèÆó°ú¤­¿ô¤Ç¤Ï¥¿¥¤¥Þ¡¼¤Î´Ö³Ö (Éÿôñ°Ì) ¤ò¡¢ +Âè»°°ú¤­¿ô¤Ç¤Ï¥¿¥¤¥Þ¡¼¤¬²¿²óËþλ¤·¤¿¤é¥×¥í¥°¥é¥à¤¬½ªÎ»¤¹¤ë¤«¤ò»ØÄꤹ¤ë¡£ +ÂèÆó°ú¤­¿ô¤ÈÂè»°°ú¤­¿ô¤Ï¾Êά²Äǽ¤Ç¤¢¤ë¡£ + +.\"O The following shell session demonstrates the use of the program: +°Ê²¼¤Î¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥ó¤Ï¤³¤Î¥×¥í¥°¥é¥à¤Î»ÈÍÑÎã¤ò¼¨¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.in +4n +.nf + +.RB "$" " a.out 3 1 100" +0.000: timer started +3.000: read: 1; total=1 +4.000: read: 1; total=2 +.BR "^Z " " # type control-Z to suspend the program" +[1]+ Stopped ./timerfd3_demo 3 1 100 +.RB "$ " "fg" " # Resume execution after a few seconds" +a.out 3 1 100 +9.660: read: 5; total=7 +10.000: read: 1; total=8 +11.000: read: 1; total=9 +.BR "^C " " # type control-C to suspend the program" +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +.\" The commented out code here is what we currently need until +.\" the required stuff is in glibc +.\" +.\" +.\"/* Link with -lrt */ +.\"#define _GNU_SOURCE +.\"#include +.\"#include +.\"#include +.\"#if defined(__i386__) +.\"#define __NR_timerfd_create 322 +.\"#define __NR_timerfd_settime 325 +.\"#define __NR_timerfd_gettime 326 +.\"#endif +.\" +.\"static int +.\"timerfd_create(int clockid, int flags) +.\"{ +.\" return syscall(__NR_timerfd_create, clockid, flags); +.\"} +.\" +.\"static int +.\"timerfd_settime(int fd, int flags, struct itimerspec *new_value, +.\" struct itimerspec *curr_value) +.\"{ +.\" return syscall(__NR_timerfd_settime, fd, flags, new_value, +.\" curr_value); +.\"} +.\" +.\"static int +.\"timerfd_gettime(int fd, struct itimerspec *curr_value) +.\"{ +.\" return syscall(__NR_timerfd_gettime, fd, curr_value); +.\"} +.\" +.\"#define TFD_TIMER_ABSTIME (1 << 0) +.\" +.\"//////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include +#include /* Definition of uint64_t */ + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +static void +print_elapsed_time(void) +{ + static struct timespec start; + struct timespec curr; + static int first_call = 1; + int secs, nsecs; + + if (first_call) { + first_call = 0; + if (clock_gettime(CLOCK_MONOTONIC, &start) == \-1) + handle_error("clock_gettime"); + } + + if (clock_gettime(CLOCK_MONOTONIC, &curr) == \-1) + handle_error("clock_gettime"); + + secs = curr.tv_sec \- start.tv_sec; + nsecs = curr.tv_nsec \- start.tv_nsec; + if (nsecs < 0) { + secs\-\-; + nsecs += 1000000000; + } + printf("%d.%03d: ", secs, (nsecs + 500000) / 1000000); +} + +int +main(int argc, char *argv[]) +{ + struct itimerspec new_value; + int max_exp, fd; + struct timespec now; + uint64_t exp, tot_exp; + ssize_t s; + + if ((argc != 2) && (argc != 4)) { + fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\\n", + argv[0]); + exit(EXIT_FAILURE); + } + + if (clock_gettime(CLOCK_REALTIME, &now) == \-1) + handle_error("clock_gettime"); + + /* Create a CLOCK_REALTIME absolute timer with initial + expiration and interval as specified in command line */ + + new_value.it_value.tv_sec = now.tv_sec + atoi(argv[1]); + new_value.it_value.tv_nsec = now.tv_nsec; + if (argc == 2) { + new_value.it_interval.tv_sec = 0; + max_exp = 1; + } else { + new_value.it_interval.tv_sec = atoi(argv[2]); + max_exp = atoi(argv[3]); + } + new_value.it_interval.tv_nsec = 0; + + fd = timerfd_create(CLOCK_REALTIME, 0); + if (fd == \-1) + handle_error("timerfd_create"); + + if (timerfd_settime(fd, TFD_TIMER_ABSTIME, &new_value, NULL) == \-1) + handle_error("timerfd_settime"); + + print_elapsed_time(); + printf("timer started\\n"); + + for (tot_exp = 0; tot_exp < max_exp;) { + s = read(fd, &exp, sizeof(uint64_t)); + if (s != sizeof(uint64_t)) + handle_error("read"); + + tot_exp += exp; + print_elapsed_time(); + printf("read: %llu; total=%llu\\n", + (unsigned long long) exp, + (unsigned long long) tot_exp); + } + + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Currently, +.\"O .\" 2.6.29 +.\"O .BR timerfd_create () +.\"O supports fewer types of clock IDs than +.\"O .BR timer_create (2). +¸½ºß¤Î¤È¤³¤í¡¢ +.\" 2.6.29 +.BR timerfd_create () +¤¬Âбþ¤·¤Æ¤¤¤ë clockid ¤Î¼ïÎà¤Ï +.BR timer_create (2) +¤è¤ê¤â¾¯¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR eventfd (2), +.BR poll (2), +.BR read (2), +.BR select (2), +.BR setitimer (2), +.BR signalfd (2), +.BR timer_create (2), +.BR timer_gettime (2), +.BR timer_settime (2), +.BR epoll (7), +.BR time (7) diff --git a/draft/man2/times.2 b/draft/man2/times.2 new file mode 100644 index 00000000..aa1ad8f4 --- /dev/null +++ b/draft/man2/times.2 @@ -0,0 +1,356 @@ +.\" 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 Sat Jul 24 14:29:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 961203 and 001211 and 010326 by aeb@cwi.nl +.\" Modified 001213 by Michael Haardt (michael@moria.de) +.\" Modified 13 Jun 02, Michael Kerrisk +.\" Added note on nonstandard behavior when SIGCHLD is ignored. +.\" Modified 2004-11-16, mtk, Noted that the nonconformance when +.\" SIGCHLD is being ignored is fixed in 2.6.9; other minor changes +.\" Modified 2004-12-08, mtk, in 2.6 times() return value changed +.\" 2005-04-13, mtk +.\" 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 ¥¯¥í¥Ã¥¯¿ô +.\" +.TH TIMES 2 2008-06-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +times - ¥×¥í¥»¥¹»þ´Ö¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "clock_t times(struct tms *" buf ); +.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 +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct tms { + clock_t tms_utime; /* user time */ + clock_t tms_stime; /* system time */ + clock_t tms_cutime; /* user time of children */ + clock_t tms_cstime; /* system time of children */ +}; +.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 +¤Î¹ç·×¤Ç¤¢¤ë¡£ +.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 ¤òÊÖ¤·¤¿½Ö´Ö¤Ë²Ã»»¤µ¤ì¤ë¡£ +¤Ä¤Þ¤ê¡¢»Ò¤¬¤Þ¤À½ªÎ»¤òÂԤäƤ¤¤Ê¤¤¾õÂÖ¤Ç¤Ï +¹¥×¥í¥»¥¹¤Î»þ´Ö¤Ï·è¤·¤Æ¸½¤ì¤Ê¤¤¡£ +.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" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.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 ( +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë) ¤Ï¸Å¤¤¤â¤Î¤Ç¤¢¤ë¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +º£¤Ç¤Ï¤³¤ì¤Ï¸Å¤¤¤â¤Î¤Ç¤¢¤ë¡£ +.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. + +.\"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 ¤ÎÃͤòÍ׵᤹¤ë¡£ +.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 +¤¬Ã±°Ì¤Ç¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ + +.\"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" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR time (1), +.BR getrusage (2), +.BR wait (2), +.BR clock (3), +.BR sysconf (3), +.BR time (7) diff --git a/draft/man2/tkill.2 b/draft/man2/tkill.2 new file mode 100644 index 00000000..2acd721b --- /dev/null +++ b/draft/man2/tkill.2 @@ -0,0 +1,177 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2008 Michael Kerrisk +.\" and 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. +.\" +.\" 2004-05-31, added tgkill, ahu, aeb +.\" 2008-01-15 mtk -- rewote DESCRIPTION +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved. +.\" Translated 2003-03-05, Akihiro MOTOKI +.\" Updated 2005-02-28, Akihiro MOTOKI +.\" +.TH TKILL 2 2008-10-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O tkill, tgkill \- send a signal to a thread +.SH ̾Á° +tkill, tgkill \- ¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.BI "int tkill(int " tid ", int " sig ); +.sp +.BI "int tgkill(int " tgid ", int " tid ", int " sig ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR tgkill () +.\"O sends the signal +.\"O .I sig +.\"O to the thread with the thread ID +.\"O .I tid +.\"O in the thread group +.\"O .IR tgid . +.\"O (By contrast, +.\"O .BR kill (2) +.\"O can only be used to send a signal to a process (i.e., thread group) +.\"O as a whole, and the signal will be delivered to an arbitrary +.\"O thread within that process.) +.BR tgkill () +¤Ï¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥× +.I tgid +¤Ë°¤¹¤ë¥¹¥ì¥Ã¥É ID ¤¬ +.I tid +¤Î¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë +.I sig +¤òÁ÷¤ë¡£ +(¤³¤ì¤ËÂФ·¡¢ +.BR kill (2) +¤Ï°ì¤Ä¤Î¥×¥í¥»¥¹ (¤¹¤Ê¤ï¤Á¡¢¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×) ¤Ë¤Þ¤È¤á¤Æ¥·¥°¥Ê¥ë¤ò +Á÷¤ë¤Î¤Ë¤À¤±ÍøÍѤǤ­¤ë¡£ +.BR kill (2) +¤ÇÁ÷¿®¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ï¥×¥í¥»¥¹Æâ¤ÎǤ°Õ¤Î¥¹¥ì¥Ã¥É¤ËÇÛÁ÷¤µ¤ì¤ë¡£) + +.\"O .BR tkill () +.\"O is an obsolete predecessor to +.\"O .BR tgkill (). +.\"O It only allows the target thread ID to be specified, +.\"O which may result in the wrong thread being signaled if a thread +.\"O terminates and its thread ID is recycled. +.\"O Avoid using this system call. +.BR tkill () +¤Ï¤â¤¦»È¤ï¤ì¤Ê¤¯¤Ê¤Ã¤¿ +.BR tgkill () +¤ÎÀèÁĤǤ¢¤ë¡£ +.BR tkill () +¤Ç¤Ï¥·¥°¥Ê¥ë¤ÎÁ÷¤êÀè¤Î¥¹¥ì¥Ã¥É ID ¤·¤«»ØÄê¤Ç¤­¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢¥¹¥ì¥Ã¥É¤¬½ªÎ»¤·¤Æ¡¢¤½¤Î¥¹¥ì¥Ã¥É ID ¤¬ºÆÍøÍѤµ¤ì¤ë¾ì¹ç¤Ë¡¢ +°Õ¿Þ¤·¤Ê¤¤¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î»ÈÍѤÏÈò¤±¤ë¤³¤È¡£ + +.\"O If +.\"O .I tgid +.\"O is specified as \-1, +.\"O .BR tgkill () +.\"O is equivalent to +.\"O .BR tkill (). +.I tgid +¤Ë \-1 ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.BR tgkill () +¤Ï +.BR tkill () +¤ÈÅù²Á¤Ç¤¢¤ë¡£ + +.\"O These are the raw system call interfaces, meant for internal +.\"O thread library use. +¤³¤ì¤é¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ø¤ÎľÀܤΥ¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ê¡¢ +¥¹¥ì¥Ã¥É¡¦¥é¥¤¥Ö¥é¥êÆâÉô¤Ç¤Î»ÈÍѤò°Õ¿Þ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, zero is returned. +.\"O On error, \-1 is returned, and \fIerrno\fP +.\"O is set appropriately. +À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +\fIerrno\fP ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O An invalid thread ID, thread group ID, or signal was specified. +»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É ID¡¢¥¹¥ì¥Ã¥É¥°¥ë¡¼¥× ID¡¢¥·¥°¥Ê¥ë¤¬ÉÔÀµ¤Ç¤¢¤Ã¤¿¡£ +.TP +.B EPERM +.\"O Permission denied. +.\"O For the required permissions, see +.\"O .BR kill (2). +µö²Ä¤¬¤Ê¤«¤Ã¤¿¡£¤É¤Î¤è¤¦¤Êµö²Ä¤¬É¬Íפ«¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR kill (2) +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B ESRCH +.\"O No process with the specified thread ID (and thread group ID) exists. +»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥ÉID (¤È¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×ID) ¤ò»ý¤Ä¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR tkill () +.\"O is supported since Linux 2.4.19 / 2.5.4. +.\"O .BR tgkill () +.\"O was added in Linux 2.5.75. +.BR tkill () +¤Ï Linux 2.4.19 / 2.5.4 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¡¢ +.BR tgkill () +¤Ï Linux 2.5.75 ¤ÇÄɲ䵤줿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR tkill () +.\"O and +.\"O .BR tgkill () +.\"O are Linux-specific and should not be used +.\"O in programs that are intended to be portable. +.BR tkill () +¤È +.BR tgkill () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢ +°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O See the description of +.\"O .B CLONE_THREAD +.\"O in +.\"O .BR clone (2) +.\"O for an explanation of thread groups. +¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤ÎÀâÌÀ¤Ë¤Ä¤¤¤Æ¤Ï +.BR clone (2) +¤Î +.B CLONE_THREAD +¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ + +.\"O Glibc does not provide wrappers for these system calls; call them using +.\"O .BR syscall (2). +glibc ¤Ï¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR gettid (2), +.BR kill (2) diff --git a/draft/man2/truncate.2 b/draft/man2/truncate.2 new file mode 100644 index 00000000..2224dfba --- /dev/null +++ b/draft/man2/truncate.2 @@ -0,0 +1,350 @@ +.\" 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 2009-02-28 "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 +.sp +.BR truncate (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR ftruncate (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _POSIX_C_SOURCE\ >=\ 200112L +.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 "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 new file mode 100644 index 00000000..3835ddb3 --- /dev/null +++ b/draft/man2/umask.2 @@ -0,0 +1,192 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 2006, 2008, Michael Kerrisk (mtk.manpages@gmail.com) +.\" (A few fragments remain from an earlier (1992) version written in +.\" 1992 by Drew Eckhardt .) +.\" +.\" 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 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 +.\" 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 +.\" +.TH UMASK 2 2008-01-09 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O umask \- set file mode creation mask +umask \- ¥Õ¥¡¥¤¥ë¥â¡¼¥ÉºîÀ®¥Þ¥¹¥¯¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "mode_t umask(mode_t " mask ); +.\"O .SH DESCRIPTION +.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 +¤Î¥Õ¥¡¥¤¥ëµö²Ä¤ËÂбþ¤¹¤ë¥Ó¥Ã¥È¤Î¤ß¤ò»ÈÍѤ¹¤ë)¡¢ +Êѹ¹Á°¤Î¥Þ¥¹¥¯ÃͤòÊÖ¤¹¡£ + +.\"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 °ú¤­¿ô¤«¤é¼è¤ê¾Ã¤µ¤ì¤ë¡£ + +.\"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) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"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 +°ú¤­¿ô¤Ë +.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" +.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 +.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 ¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR chmod (2), +.BR mkdir (2), +.BR open (2), +.BR stat (2) +.\" FIXME . eventually: .BR acl (5) diff --git a/draft/man2/umount.2 b/draft/man2/umount.2 new file mode 100644 index 00000000..3957efc9 --- /dev/null +++ b/draft/man2/umount.2 @@ -0,0 +1,282 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1993 Rickard E. Faith +.\" and Copyright (C) 1994 Andries E. Brouwer +.\" and Copyright (C) 2002, 2005 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. +.\" +.\" 2008-10-06, mtk: Created this as a new page by splitting +.\" umount/umount2 material out of mount.2 +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-11-20, Akihiro MOTOKI , LDP v3.13 +.\" +.TH UMOUNT 2 2009-09-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O umount, umount2 \- unmount file system +umount, umount2 \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥¢¥ó¥Þ¥¦¥ó¥È¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int umount(const char *" target ); +.sp +.BI "int umount2(const char *" target ", int " flags ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR umount () +.\"O and +.\"O .BR umount2 () +.\"O remove the attachment of the (topmost) file system mounted on +.\"O .IR target . +.BR umount () +¤È +.BR umount2 () +¤Ï +.I target +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë (ºÇ¾å°Ì¤Î) ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò³°¤¹¡£ +.\" Note: the kernel naming differs from the glibc naming +.\" umount2 is the glibc name for what the kernel now calls umount +.\" and umount is the glibc name for oldumount + +.\"O Appropriate privilege (Linux: the +.\"O .B CAP_SYS_ADMIN +.\"O capability) is required to unmount file systems. +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¢¥ó¥Þ¥¦¥ó¥È¤ò¹Ô¤¦¤Ë¤Ï¡¢ +ŬÀڤʸ¢¸Â (Linux ¤Ç¤Ï +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤¬É¬ÍפǤ¢¤ë¡£ + +.\"O Linux 2.1.116 added the +.\"O .BR umount2 () +.\"O system call, which, like +.\"O .BR umount (), +.\"O unmounts a target, but allows additional +.\"O .I flags +.\"O controlling the behavior of the operation: +Linux 2.1.116 ¤«¤é¡¢ +.BR umount2 () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Äɲ䵤줿¡£¤³¤ì¤Ï +.BR umount () +¤ÈƱÍÍ¤Ë +.I target +¤ò¥¢¥ó¥Þ¥¦¥ó¥È¤¹¤ë¤¬¡¢ +.I flags +¤¬Äɲ䵤ì¤Æ¤ª¤ê¡¢Áàºî»þ¤Î¿¶¤ëÉñ¤¤¤òÀ©¸æ¤Ç¤­¤ë¡£ +.TP +.\"O .BR MNT_FORCE " (since Linux 2.1.116)" +.BR MNT_FORCE " (2.1.116 °Ê¹ß)" +.\"O Force unmount even if busy. +.\"O This can cause data loss. +.\"O (Only for NFS mounts.) +»ÈÍÑÃæ (busy) ¤Ç¤â¶¯À©Åª¤Ë¥¢¥ó¥Þ¥¦¥ó¥È¤ò¼Â¹Ô¤¹¤ë¡£ +¤³¤ì¤ò¹Ô¤¦¤È¥Ç¡¼¥¿¤ò¼º¤¦²ÄǽÀ­¤¬¤¢¤ë¡£ +(NFS ¥Þ¥¦¥ó¥ÈÀìÍÑ) +.TP +.\"O .BR MNT_DETACH " (since Linux 2.4.11)" +.BR MNT_DETACH " (2.4.11 °Ê¹ß)" +.\"O Perform a lazy unmount: make the mount point unavailable for +.\"O new accesses, and actually perform the unmount when the mount point +.\"O ceases to be busy. +Ãٱ䥢¥ó¥Þ¥¦¥ó¥È¤ò¹Ô¤¦¡£¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ËÂФ¹¤ë¿·µ¬¤Î¥¢¥¯¥»¥¹¤Ï +ÉÔ²Äǽ¤È¤Ê¤ê¡¢¼ÂºÝ¤Î¥¢¥ó¥Þ¥¦¥ó¥È¤Ï¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤¬¥Ó¥¸¡¼¤Ç +¤Ê¤¯¤Ê¤Ã¤¿»þÅÀ¤Ç¹Ô¤¦¡£ +.TP +.\"O .BR MNT_EXPIRE " (since Linux 2.6.8)" +.BR MNT_EXPIRE " (Linux 2.6.8 °Ê¹ß)" +.\"O Mark the mount point as expired. +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë´ü¸ÂÀÚ¤ì¤Î°õ¤ò¤Ä¤±¤ë¡£ +.\"O If a mount point is not currently in use, then an initial call to +.\"O .BR umount2 () +.\"O with this flag fails with the error +.\"O .BR EAGAIN , +.\"O but marks the mount point as expired. +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤¬¸½ºß»ÈÍÑÃæ¤Ç¤Ê¤¤¾ì¹ç¡¢¤³¤Î¥Õ¥é¥°¤ò¤Ä¤±¤Æ +.BR umount2 () +¤ò½é¤á¤Æ¸Æ¤Ó½Ð¤¹¤È +.B EAGAIN +¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¤¬¡¢¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë¤Ï´ü¸ÂÀÚ¤ì (expire) +¤Î°õ¤¬¤Ä¤±¤é¤ì¤ë¡£ +.\"O The mount point remains expired as long as it isn't accessed +.\"O by any process. +¤½¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ï¤¤¤º¤ì¤«¤Î¥×¥í¥»¥¹¤¬¥¢¥¯¥»¥¹¤·¤Ê¤¤¸Â¤ê +´ü¸ÂÀÚ¤ì¤Î°õ¤¬¤Ä¤¤¤¿¤Þ¤Þ¤È¤Ê¤ë¡£ +.\"O A second +.\"O .BR umount2 () +.\"O call specifying +.\"O .B MNT_EXPIRE +.\"O unmounts an expired mount point. +¤â¤¦°ìÅÙ +.B MNT_EXPIRE +¤ò¤Ä¤±¤Æ +.BR umount2 () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢´ü¸ÂÀÚ¤ì¤Î°õ¤Î¤Ä¤¤¤¿¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤¬ +¥¢¥ó¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +.\"O This flag cannot be specified with either +.\"O .B MNT_FORCE +.\"O or +.\"O .BR MNT_DETACH . +¤³¤Î¥Õ¥é¥°¤ò +.B MNT_FORCE +¤â¤·¤¯¤Ï +.B MNT_DETACH +¤ÈƱ»þ¤Ë»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\"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 The error values given below result from filesystem type independent +.\"O errors. +.\"O Each filesystem type may have its own special errors and its +.\"O own special behavior. +.\"O See the kernel source code for details. +°Ê²¼¤Ë¼¨¤¹¥¨¥é¡¼¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¿¥¤¥×¤Ë¤Ï¸ÇÍ­¤Î¥¨¥é¡¼¤¬Â¸ºß¤¹¤ë¾ì¹ç¤¬¤¢¤ê¡¢ +Æȼ«¤ÎÆ°ºî¤ò¤¹¤ë¤³¤È¤â¤¢¤ë¡£¾Ü¤·¤¯¤Ï¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¤ò¸«¤ÆÍߤ·¤¤¡£ +.TP +.B EAGAIN +.\"O A call to +.\"O .BR umount2 () +.\"O specifying +.\"O .B MNT_EXPIRE +.\"O successfully marked an unbusy file system as expired. +.B MNT_EXPIRE +¤ò»ØÄꤷ¤¿ +.BR umount2 () +¤Î¸Æ¤Ó½Ð¤·¤Ç¡¢Àµ¾ï¤Ë̤»ÈÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë´ü¸ÂÀÚ¤ì¤Î°õ¤ò +¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤¿¡£ +.TP +.B EBUSY +.\"O .I target +.\"O could not be unmounted because it is busy. +»ÈÍÑÃæ (busy) ¤Î¤¿¤á¡¢ +.I target +¤ò¥¢¥ó¥Þ¥¦¥ó¥È¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EFAULT +.\"O .I target +.\"O points outside the user address space. +.I target +¤¬¥æ¡¼¥¶¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O .I target +.\"O is not a mount point. +.\"O Or, +.\"O .BR umount2 () +.\"O was called with +.\"O .B MNT_EXPIRE +.\"O and either +.\"O .B MNT_DETACH +.\"O or +.\"O .BR MNT_FORCE . +.I target +¤¬¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤Ï¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.BR umount2 () +¤Ç¡¢ +.B MNT_EXPIRE +¤¬»ØÄꤵ¤ì¤¿ +.BR umount2 () +¤Ç¡¢ +.B MNT_DETACH +¤« +.B MNT_FORCE +¤¬Æ±»þ¤Ë»ØÄꤵ¤ì¤¿¡£ +.TP +.B ENAMETOOLONG +.\"O A pathname was longer than +.\"O .BR MAXPATHLEN . +¥Ñ¥¹Ì¾¤ÎŤµ¤¬ +.B MAXPATHLEN +¤è¤êŤ«¤Ã¤¿¡£ +.TP +.B ENOENT +.\"O A pathname was empty or had a nonexistent component. +¥Ñ¥¹Ì¾¤¬¶õ¤Ç¤¢¤ë¡£¤â¤·¤¯¤Ï»ØÄꤵ¤ì¤¿¥Ñ¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +.\"O The kernel could not allocate a free page to copy filenames or data into. +¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë̾¤ä¥Ç¡¼¥¿¤ò¥³¥Ô¡¼¤¹¤ë¤¿¤á¤Î¶õ¤­¥Ú¡¼¥¸¤ò³ÎÊݤǤ­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPERM +.\"O The caller does not have the required privileges. +¸Æ¤Ó½Ð¤·¸µ¤¬É¬Íפʸ¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR MNT_DETACH +.\"O and +.\"O .BR MNT_EXPIRE +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=10092 +.\"O are only available in glibc since version 2.11. +.BR MNT_DETACH +¤È +.BR MNT_EXPIRE +¤Ï¥Ð¡¼¥¸¥ç¥ó 2.11 °Ê¹ß¤Î glibc ¤Ç¤Î¤ßÍøÍѤǤ­¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These functions are Linux-specific and should not be used in +.\"O programs intended to be portable. +¤³¤Î´Ø¿ô¤Ï Linux ¸ÇÍ­¤Î´Ø¿ô¤Ç¤¢¤ê¡¢°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +»ÈÍѤ¹¤Ù¤­¤Ç¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The original +.\"O .BR umount () +.\"O function was called as \fIumount(device)\fP and would return +.\"O .B ENOTBLK +.\"O when called with something other than a block device. +¸µ¡¹¤Î +.BR umount () +´Ø¿ô¤Ï \fIumount(device)\fP ¤Î·Á¤Ç¸Æ¤Ó½Ð¤µ¤ì¡¢ +¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹°Ê³°¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤¹¤È +.B ENOTBLK +¤òÊÖ¤·¤¿¡£ +.\"O In Linux 0.98p4 a call \fIumount(dir)\fP was added, in order to +.\"O support anonymous devices. +Linux 0.98p4 ¤Ç¡¢ÌµÌ¾¥Ç¥Ð¥¤¥¹ (anonymous device) ¤ËÂбþ¤¹¤ë¤¿¤á¤Ë +\fIumount(dir)\fP ¤Î·Á¤Ç¤Î¸Æ¤Ó½Ð¤·¤¬²Ã¤¨¤é¤ì¤¿¡£ +.\"O In Linux 2.3.99-pre7 the call \fIumount(device)\fP was removed, +.\"O leaving only \fIumount(dir)\fP (since now devices can be mounted +.\"O in more than one place, so specifying the device does not suffice). +Linux 2.3.99-pre7 ¤Ç¡¢\fIumount(device)\fP ¤Ïºï½ü¤µ¤ì¡¢ +\fIumount(dir)\fP ¤À¤±¤¬»Ä¤µ¤ì¤¿ +(°ì¤Ä¤Î¥Ç¥Ð¥¤¥¹¤òÊ£¿ô¤Î°ÌÃ֤˥ޥ¦¥ó¥È½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤¿¤á¡¢ +¥Ç¥Ð¥¤¥¹¤ò»ØÄꤷ¤¿¤À¤±¤Ç¤ÏÉÔ½½Ê¬¤À¤«¤é¤Ç¤¢¤ë)¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mount (2), +.BR path_resolution (7), +.BR mount (8), +.BR umount (8) diff --git a/draft/man2/uname.2 b/draft/man2/uname.2 new file mode 100644 index 00000000..e1788d7f --- /dev/null +++ b/draft/man2/uname.2 @@ -0,0 +1,276 @@ +.\" 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. +.\" +.\" 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 +.SH ̾Á° +.\"O uname \- get name and information about current kernel +uname \- ¸½ºß²ÔƯÃæ¤Î¥«¡¼¥Í¥ë¤Ë¤Ä¤¤¤Æ¤Î̾Á°¤È¾ðÊó¤òÆÀ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int uname(struct utsname *" buf ); +.\"O .SH DESCRIPTION +.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 +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.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[]; /* ¡Ö¼ÂÁõ»þ¤ËÄêµÁ¤µ¤ì¤¿¡¢²¿¤é¤«¤Î + ¥Í¥Ã¥È¥ï¡¼¥¯¡×¤Ë¤ª¤±¤ë¥Þ¥·¥ó̾ */ + char release[]; /* OS ¤Î¥ê¥ê¡¼¥¹ (Îã: "2.6.28") */ + 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" +.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 EFAULT +.\"O .I buf +.\"O is not valid. +.I buf +¤¬Í­¸ú¤Ç¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O There is no +.\"O .BR uname () +.\"O call in 4.3BSD. +4.3BSD ¤Ë¤Ï +.BR uname () +¥³¡¼¥ë¤¬¤Ê¤¤¡£ +.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 +.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 ¤Ë¤Ä¤¤¤Æ¤âƱÍͤǤ¢¤ë¡£ +.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 ¥Õ¥£¡¼¥ë¥É¤Ë¤Ä¤¤¤Æ¤âƱ¤¸¤³¤È¤¬À®¤êΩ¤Ä¡£ +.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 ¤¬Áª¤Ð¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ +.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 +.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 () +¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¤³¤ì¤é¤Î¾ÜºÙ¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é±£Êä·¡¢ +¥«¡¼¥Í¥ë¤¬Ä󶡤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¤¦¤ÁºÇ¿·¤Î¥Ð¡¼¥¸¥ç¥ó¤òµ¯Æ°¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR uname (1), +.BR getdomainname (2), +.BR gethostname (2) diff --git a/draft/man2/unimplemented.2 b/draft/man2/unimplemented.2 new file mode 100644 index 00000000..19220085 --- /dev/null +++ b/draft/man2/unimplemented.2 @@ -0,0 +1,103 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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. +.\" +.\" 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 +.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 +.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 +.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) +¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ + +.\"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) +¤Î¤è¤¦¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÆÃÄê¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤Î¤ß¸ºß¤¹¤ë¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR syscalls (2) diff --git a/draft/man2/unlink.2 b/draft/man2/unlink.2 new file mode 100644 index 00000000..499d2ae0 --- /dev/null +++ b/draft/man2/unlink.2 @@ -0,0 +1,261 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Ian Jackson. +.\" +.\" 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 1996-09-08 by Arnt Gulbrandsen +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2001-05-17 by aeb +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Fri Dec 12 00:42:31 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Tue Sep 5 02:03:33 JST 2000 +.\" by Yuichi SATO +.\" Modified Sat Jun 2 08:48:36 JST 2001 by Yuichi SATO +.\" Modified Sun Jul 7 02:58:51 JST 2002 by Yuichi SATO +.\" Updated & Modified Sun Jan 9 23:28:11 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: file system ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.\"WORD: link ¥ê¥ó¥¯ +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: close ¥¯¥í¡¼¥º +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\"WORD: socket ¥½¥±¥Ã¥È +.\"WORD: device ¥Ç¥Ð¥¤¥¹ +.\"WORD: effective UID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: sticky-bit ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È +.\"WORD: dangling symbolic link ²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: memory ¥á¥â¥ê +.\"WORD: protocol ¥×¥í¥È¥³¥ë +.\" +.TH UNLINK 2 2004-06-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O unlink \- delete a name and possibly the file it refers to +unlink \- ̾Á°¤òºï½ü¤·¡¢¾ì¹ç¤Ë¤è¤Ã¤Æ¤Ï¤½¤ì¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤âºï½ü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int unlink(const char *" pathname ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR unlink () +.\"O deletes a name from the file system. +.\"O If that name was the +.\"O last link to a file and no processes have the file open the file is +.\"O deleted and the space it was using is made available for reuse. +.BR unlink () +¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î̾Á°¤òºï½ü¤¹¤ë¡£ +¤â¤·¤½¤Î̾Á°¤¬¥Õ¥¡¥¤¥ë¤Ø¤ÎºÇ¸å¤Î¥ê¥ó¥¯ (link) ¤Ç¤¢¤ê¡¢ +¤É¤Î¥×¥í¥»¥¹¤â¤½¤Î¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó (open) ¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +¥Õ¥¡¥¤¥ë¤Ïºï½ü¤µ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬»ÈÍѤ·¤Æ¤¤¤¿¥Ç¥£¥¹¥¯¾å¤ÎÎΰè¤ÏºÆÍøÍѤ¬²Äǽ¤Ë¤Ê¤ë¡£ + +.\"O If the name was the last link to a file but any processes still have +.\"O the file open the file will remain in existence until the last file +.\"O descriptor referring to it is closed. +¤â¤·ºï½ü¤¹¤ë̾Á°¤¬¥Õ¥¡¥¤¥ë¤Ø¤ÎºÇ¸å¤Î¥ê¥ó¥¯¤À¤¬¡¢¤É¤ì¤«¤Î¥×¥í¥»¥¹¤¬ +¤½¤Î¥Õ¥¡¥¤¥ë¤ò¤Þ¤À¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ëºÇ¸å¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ (file descriptor) +¤¬¥¯¥í¡¼¥º (close) ¤µ¤ì¤ë¤Þ¤Ç¥Õ¥¡¥¤¥ë¤Ï¸ºß¤·Â³¤±¤ë¡£ + +.\"O If the name referred to a symbolic link the link is removed. +¤â¤·¤½¤Î̾Á°¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ (symbolic link) ¤ò»²¾È¤·¤Æ¤¤¤ì¤Ð¡¢ +¥ê¥ó¥¯¤Ïºï½ü¤µ¤ì¤ë¡£ + +.\"O If the name referred to a socket, fifo or device the name for it is +.\"O removed but processes which have the object open may continue to use +.\"O it. +¤â¤·Ì¾Á°¤¬¥½¥±¥Ã¥È (socket) ¤ä fifo ¤ä¥Ç¥Ð¥¤¥¹ (device) ¤ò»²¾È¤·¤Æ¤¤¤ì¤Ð +̾Á°¤Ïºï½ü¤µ¤ì¤ë¤¬¤½¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¥ª¡¼¥×¥ó¤·¤Æ¤¤¤¿¥×¥í¥»¥¹¤Ï +¤½¤ì¤ò»È¤¤Â³¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"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 EACCES +.\"O Write access to the directory containing +.\"O .I pathname +.\"O is not allowed for the process's effective UID, or one of the +.\"O directories in +.\"O .I pathname +.\"O did not allow search permission. +.\"O (See also +.\"O .BR path_resolution (7).) +.I pathname +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¥×¥í¥»¥¹¤Î¼Â¸ú (effective) +¥æ¡¼¥¶¡¼ ID ¤ËÍ¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +.I pathname +¤ÎÃæ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.\"O .BR EBUSY " (not on Linux)" +.BR EBUSY " (Linux °Ê³°)" +.\"O The file +.\"O .I pathname +.\"O cannot be unlinked because it is being used by the system +.\"O or another process and the implementation considers this an error. +¥Õ¥¡¥¤¥ë +.I pathname +¤¬¥·¥¹¥Æ¥à¤Þ¤¿¤Ï¾¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤Æ +¥ê¥ó¥¯¤¬ºï½ü¤Ç¤­¤Ê¤«¤Ã¤¿¤Î¤Ç¡¢¤³¤Î¼ÂÁõ¤Ç¤Ï¥¨¥é¡¼¤È¤·¤¿¡£ +.TP +.B EFAULT +.\"O .I pathname +.\"O points outside your accessible address space. +.I pathname +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EIO +.\"O An I/O error occurred. +I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EISDIR +.\"O .I pathname +.\"O refers to a directory. +.\"O (This is the non-POSIX value returned by Linux since 2.1.132.) +.I pathname +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +(¤³¤ì¤Ï POSIX ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤Ãͤǡ¢Linux 2.1.132 °Ê¹ß¤ÇÊÖ¤µ¤ì¤ë¡£) +.TP +.B ELOOP +.\"O Too many symbolic links were encountered in translating +.\"O .IR pathname . +.I pathname +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.\"O .IR pathname " was too long." +.IR pathname " ¤¬Ä¹²á¤®¤ë¡£" +.TP +.B ENOENT +.\"O A component in +.\"O .I pathname +.\"O does not exist or is a dangling symbolic link, or +.\"O .I pathname +.\"O is empty. +.I pathname +¤ËÂбþ¤¹¤ë¤â¤Î¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¤«¡¢ +.I pathname +¤¬¶õ¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +.\"O Insufficient kernel memory was available. +½½Ê¬¤Ê¥«¡¼¥Í¥ë (kernel) ¤Î¥á¥â¥ê¡¼¤¬»ÈÍѤǤ­¤Ê¤¤¡£ +.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 system does not allow unlinking of directories, +.\"O or unlinking of directories requires privileges that the +.\"O calling process doesn't have. +.\"O (This is the POSIX prescribed error return; +.\"O as noted above, Linux returns +.\"O .B EISDIR +.\"O for this case.) +¥·¥¹¥Æ¥à¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ¹¤ë unlink Áàºî¤òµö²Ä¤·¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ¹¤ë unlink Áàºî¤Î¤¿¤á¤ËɬÍפÊÆø¢¤ò +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +(¤³¤ì¤Ï POSIX ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤ÎÊÖ¤·Êý¤Ç¤¢¤ë¡£ +¾å½Ò¤ÎÄ̤ꡢ¤³¤Î¾ì¹ç¤Ë¤Ï Linux ¤Ï +.B EISDIR +¤òÊÖ¤¹¡£) +.TP +.\"O .BR EPERM " (Linux only)" +.BR EPERM " (Linux ¤Î¤ß)" +.\"O The file system does not allow unlinking of files. +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë unlink Áàºî¤òµö¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.\"O .BR EPERM " or " EACCES +.BR EPERM " ¤Þ¤¿¤Ï " EACCES +.\"O The directory containing +.\"O .I pathname +.\"O has the sticky-bit +.\"O .RB ( S_ISVTX ) +.\"O set and the process's effective UID is neither the UID of the file to +.\"O be deleted nor that of the directory containing it, and +.\"O the process is not privileged (Linux: does not have the +.\"O .B CAP_FOWNER +.\"O capability). +.I pathname +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È (sticky-bit) +.RB ( S_ISVTX ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¡¢¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ºï½ü¤·¤è¤¦¤È¤¹¤ë¥Õ¥¡¥¤¥ë¤Î +UID ¤Ç¤â¤½¤ì¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¤â¤Î¤Ç¤â¤Ê¤¯¡¢ +¤«¤Ä¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¤ (Linux ¤Ç¤Ï +.B CAP_FOWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¤Ê¤¤)¡£ +.TP +.B EROFS +.\"O .I pathname +.\"O refers to a file on a read-only file system. +.I pathname +¤¬Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .\" SVr4 documents additional error +.\"O .\" conditions EINTR, EMULTIHOP, ETXTBSY, ENOLINK. +.\" SVr4 ¤Ë¤Ï¾¤Ë EINTR, EMULTIHOP, ETXTBSY, ENOLINK ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Î +.\" µ­½Ò¤¬¤¢¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Infelicities in the protocol underlying NFS can cause the unexpected +.\"O disappearance of files which are still being used. +NFS ¥×¥í¥È¥³¥ë (protocol) ¤ÎÀøºßŪ¤ÊÉÔÎɤˤè¤ê¡¢ +¤Þ¤À»ÈÍÑÃæ¤Î¥Õ¥¡¥¤¥ë¤ÎÆÍÁ³¤Î¾ÃÌǤò°ú¤­µ¯¤³¤¹¤³¤È¤¬¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR rm (1), +.BR chmod (2), +.BR link (2), +.BR mknod (2), +.BR open (2), +.BR rename (2), +.BR rmdir (2), +.BR unlinkat (2), +.BR mkfifo (3), +.BR remove (3), +.BR path_resolution (7), +.BR symlink (7) diff --git a/draft/man2/unlinkat.2 b/draft/man2/unlinkat.2 new file mode 100644 index 00000000..3d173bce --- /dev/null +++ b/draft/man2/unlinkat.2 @@ -0,0 +1,260 @@ +.\" 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-08-24 by Yuichi SATO , LDP v2.39 +.\" +.TH UNLINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O unlinkat \- remove a directory entry relative to a directory file descriptor +unlinkat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê¤òºï½ü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int unlinkat(int " dirfd ", const char *" pathname ", 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 unlinkat (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.\"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) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.\"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) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.\"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) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.\"O If the pathname given in +.\"O .I pathname +.\"O is absolute, then +.\"O .I dirfd +.\"O is ignored. +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÀäÂХѥ¹Ì¾¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"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" +.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 +.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 () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR unlinkat () +.\"O was added to Linux in kernel 2.6.16. +.BR unlinkat () +¤Ï 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 unlinkat (). +.BR unlinkat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR openat (2), +.BR rmdir (2), +.BR unlink (2), +.BR path_resolution (7) diff --git a/draft/man2/unshare.2 b/draft/man2/unshare.2 new file mode 100644 index 00000000..7649062e --- /dev/null +++ b/draft/man2/unshare.2 @@ -0,0 +1,285 @@ +.\" 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 2008-11-20 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O unshare \- disassociate parts of the process execution context +unshare \- ¥×¥í¥»¥¹¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Î°ìÉô¤òʬΥ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.\" 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 new file mode 100644 index 00000000..5209e5c9 --- /dev/null +++ b/draft/man2/uselib.2 @@ -0,0 +1,172 @@ +.\" 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 1996-10-22 by Eric S. Raymond +.\" 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 ÆÃÍ­ +.\" +.TH USELIB 2 2005-01-09 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O uselib \- select shared library +uselib \- ¶¦Í­¥é¥¤¥Ö¥é¥ê¤òÁªÂò¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int uselib(const char *" library ); +.\"O .SH DESCRIPTION +.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 () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬»ÈÍѤ¹¤ë +¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤¹¤ëºÝ¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤Ï¥é¥¤¥Ö¥é¥ê¤Î¥Ñ¥¹Ì¾¤ò»ØÄꤹ¤ë¡£ +¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤¹¤ë¥¢¥É¥ì¥¹¤Ï¥é¥¤¥Ö¥é¥ê¼«¿È¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¥é¥¤¥Ö¥é¥ê¤Ïǧ¼±²Äǽ¤Ê¥Ð¥¤¥Ê¥ê·Á¼°¤Ç¤¢¤ì¤Ð¤É¤ó¤Ê·Á¼°¤Ç¤â¤è¤¤¡£ +.\"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 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" +.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 +.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 () +¤ò»È¤Ã¤Æ¡¢ +¥Ð¥¤¥Ê¥êÃæ¤Î¥ê¥¹¥È¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò +¥ê¥¹¥ÈÃæ¤Î¤½¤Î¤Þ¤Þ¤Î̾Á°¤Ç¥í¡¼¥É¤·¤Æ¤¤¤¿¡£ +.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 +¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Çõ¤·¡¢¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð¡¢ +̾Á°¤ÎÁ°¤Ë "/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" ¤À¤±¤¬¥í¡¼¥É¤µ¤ì¡¢¤½¤Î¸å¤Ç +¤³¤ÎưŪ¥é¥¤¥Ö¥é¥ê¤¬ (¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¤â¤¦°ìÅٻȤäÆ) +ɬÍפʻĤê¤Î¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.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) diff --git a/draft/man2/ustat.2 b/draft/man2/ustat.2 new file mode 100644 index 00000000..98a832fc --- /dev/null +++ b/draft/man2/ustat.2 @@ -0,0 +1,189 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created 1995-08-09 Thomas K. Dyas +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2001-03-22 by aeb +.\" Modified 2003-08-04 by aeb +.\" +.\" Japanese Version Copyright (c) 1996 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Wed Dec 4 23:12:06 JST 1996 +.\" by HANATAKA Shinya +.\" Updated & Modified Sat May 22 19:00:40 JST 2004 +.\" by Yuichi SATO +.\" +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: mount ¥Þ¥¦¥ó¥È +.\"WORD: device ¥Ç¥Ð¥¤¥¹ +.\"WORD: member ¥á¥ó¥Ð¡¼ +.\"WORD: NUL character ¥Ì¥ëʸ»ú +.\"WORD: implement ¼ÂÁõ +.\"WORD: pointer ¥Ý¥¤¥ó¥¿¡¼ +.\" +.TH USTAT 2 2003-08-04 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ustat \- get file system statistics +ustat \- ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à (file system) ¤ÎÅý·×¤òÆÀ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.br +.BR "#include " " /* libc[45] */" +.br +.BR "#include " " /* glibc2 */" +.sp +.BI "int ustat(dev_t " dev ", struct ustat *" ubuf ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR ustat () +.\"O returns information about a mounted file system. +.\"O .I dev +.\"O is a device number identifying a device containing +.\"O a mounted file system. +.BR ustat () +¤Ï¥Þ¥¦¥ó¥È (mount) ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¾ðÊó¤òÊÖ¤¹¡£ +.I dev +¤ÏÄ´¤Ù¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥Ð¥¤¥¹ (device) ¤Î +¥Ç¥Ð¥¤¥¹Èֹ档 +.\"O .I ubuf +.\"O is a pointer to a \fIustat\fP structure that contains the following +.\"O members: +.I ubuf +¤Ï°Ê²¼¤Î¥á¥ó¥Ð¡¼¤ò´Þ¤à ustat ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡¼: +.in +4n +.nf + +daddr_t f_tfree; /* Total free blocks */ +ino_t f_tinode; /* Number of free inodes */ +char f_fname[6]; /* Filsys name */ +char f_fpack[6]; /* Filsys pack name */ +.fi +.in +.PP +.\"O The last two fields, +.\"O .I f_fname +.\"O and +.\"O .IR f_fpack , +.\"O are not implemented and will +.\"O always be filled with null bytes (\(aq\\0\(aq). +¸å¤ÎÆó¤Ä¤Î¥Õ¥£¡¼¥ë¥É +.I f_fname +¤È +.I f_fpack +¤Ï¼ÂÁõ¤µ¤ì¤Æ¤ª¤é¤º¡¢¾ï¤Ë NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤ÇËä¤á¤é¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, zero is returned and the +.\"O .I ustat +.\"O structure pointed to by +.\"O .I ubuf +.\"O will be filled in. +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¡¢ +.I ubuf +¤¬»Ø¤¹ +.I ustat +¹½Â¤ÂΤ¬Ëä¤á¤é¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"O .I ubuf +.\"O points outside of your accessible address space. +.I ubuf +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¶õ´Ö¤Î³°Â¦¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O .I dev +.\"O does not refer to a device containing a mounted file system. +.I dev +¤¬¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ò´Þ¤à¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOSYS +.\"O The mounted file system referenced by +.\"O .I dev +.\"O does not support this operation, or any version of Linux before +.\"O 1.3.16. +.I dev +¤Ç»²¾È¤µ¤ì¤ë¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬¤³¤ÎÁàºî (operation) ¤ò +¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤«¡¢Linux ¤Î¥Ð¡¼¥¸¥ç¥ó¤¬ 1.3.16 °ÊÁ°¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4. +.\"O .\" SVr4 documents additional error conditions ENOLINK, ECOMM, and EINTR +.\"O .\" but has no ENOSYS condition. +.\" SVr4 ¤Ë¤Ï¾¤Ë ENOLINK, ECOMM, EINTR ¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¤¬¡¢ +.\" ENOSYS ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O .BR ustat () +.\"O is deprecated and has only been provided for compatibility. +.BR ustat () +¤Ï¿ä¾©¤µ¤ì¤º¡¢¸ß´¹À­¤Î¤¿¤á¤À¤±¤ËÄ󶡤µ¤ì¤ë¡£ +.\"O All new programs should use +.\"O .BR statfs (2) +.\"O instead. +¿·¤·¤¤¥×¥í¥°¥é¥à¤ÏÁ´¤Æ¤³¤ì¤ÎÂå¤ê¤Ë +.BR statfs (2) +¤ò»ÈÍѤ¹¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SS "HP-UX Notes" +.SS "HP-UX ¤Ë¤ª¤±¤ëÃí°Õ" +.\"O The HP-UX version of the +.\"O .I ustat +.\"O structure has an additional field, +.\"O .I f_blksize +.\"O that is unknown elsewhere. +.\"O HP-UX warns: +.\"O For some file systems, the number of free inodes does not change. +.\"O Such file systems will return \-1 in the field +.\"O .IR f_tinode . +HP-UX ÈǤι½Â¤ÂÎ +.I ustat +¤Ë¤Ï¡¢¤½¤Î¾¤Ë¥Õ¥£¡¼¥ë¥É +.I f_blksize +¤¬Â¸ºß¤¹¤ë¤¬¡¢Â¾¤Ç¤Ï¸«¤«¤±¤Ê¤¤¡£ +HP-UX ¤Ï¼¡¤Î¤è¤¦¤Ë·Ù¹ð¤·¤Æ¤¤¤ë: +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÃæ¤Ë¤Ï¡¢²òÊü¤µ¤ì¤Æ¤¤¤ë inode ¤Î¿ô¤òÊѹ¹¤·¤Ê¤¤¤â¤Î¤â¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢¥Õ¥£¡¼¥ë¥É +.I f_tinode +¤Ë \-1 ¤òÊÖ¤¹¡£ +.\"O .\" Some software tries to use this in order to test whether the +.\"O .\" underlying file system is NFS. +.\" ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ NFS ¤Ç¤¢¤ë¤«Èݤ«¤ò¥Æ¥¹¥È¤¹¤ë¤¿¤á¤Ë +.\" ¤³¤ì¤ò»ÈÍѤ¹¤ë¥½¥Õ¥È¥¦¥§¥¢¤â¤¢¤ë¡£ +.\"O For some file systems, inodes are dynamically allocated. +.\"O Such file systems will return the current number of free inodes. +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÃæ¤Ë¤Ï¡¢inode ¤òưŪ¤Ë³ÎÊݤ¹¤ë¤â¤Î¤â¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢¸½ºß²òÊü¤µ¤ì¤Æ¤¤¤ë inode ¤Î¿ô¤òÊÖ¤¹¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR stat (2), +.BR statfs (2) diff --git a/draft/man2/utime.2 b/draft/man2/utime.2 new file mode 100644 index 00000000..7245301f --- /dev/null +++ b/draft/man2/utime.2 @@ -0,0 +1,290 @@ +.\" 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-06-10 by Andries Brouwer +.\" 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 +.SH ̾Á° +.\"O utime, utimes \- change file last access and modification times +utime, utimes \- ¥Õ¥¡¥¤¥ë¤ÎºÇ½ª¥¢¥¯¥»¥¹»þ¹ï¤È½¤Àµ»þ¹ï¤òÊѹ¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "int utime(const char *" filename ", const struct utimbuf *" times ); +.sp +.B #include +.sp +.BI "int utimes(const char *" filename ", const struct timeval " times [2]); +.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 +¤Ë¤½¤ì¤¾¤ìÊѹ¹¤¹¤ë¡£ + +.\"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 +¤Î¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹»þ¹ï¤È½¤Àµ»þ¹ï¤Ï¸½ºß¤Î»þ¹ï¤ËÀßÄꤵ¤ì¤ë¡£ + +.\"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 ¤«¤Ä¡¢¥×¥í¥»¥¹¤¬¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡£ + +.\"O The +.\"O .I utimbuf +.\"O structure is: +¹½Â¤ÂÎ +.I utimbuf +¤Ï°Ê²¼¤Ë¼¨¤¹¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ + +.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 ÉäÎʬ²òǽ¤Ç¥¿¥¤¥à¥¹¥¿¥ó¥×¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"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 +¤Ï°Ê²¼¤Ë¼¨¤¹Ä̤ê¤Ç¤¢¤ë¡£ + +.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" +.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 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" +.SH ½àµò +.BR utime (): +SVr4, POSIX.1-2001. +.\"O POSIX.1-2008 marks +.\"O .BR utime () +.\"O as obsolete. +POSIX.1-2008 ¤Ï +.BR utime () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +.br +.BR utimes (): +4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.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) ¤Î¥Õ¥¡¥¤¥ë¤Ë¸½ºß»þ¹ï°Ê³°¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤ò +ÀßÄꤷ¤¿¤ê¤¹¤ë¤³¤È¤Ï¡¢µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"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) ¤Ç¤¢¤ë¡£ +¤½¤Î¤¿¤áÉðʲ¼¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR chattr (1), +.BR futimesat (2), +.BR stat (2), +.BR utimensat (2), +.BR futimes (3), +.BR futimens (3) diff --git a/draft/man2/vfork.2 b/draft/man2/vfork.2 new file mode 100644 index 00000000..d0947670 --- /dev/null +++ b/draft/man2/vfork.2 @@ -0,0 +1,371 @@ +.\" 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 2009-06-21 "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 (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"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 will be 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 afterwards 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 are +.\"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 new file mode 100644 index 00000000..47c6aca0 --- /dev/null +++ b/draft/man2/vhangup.2 @@ -0,0 +1,103 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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, 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 üËö +.\" +.TH VHANGUP 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O vhangup \- virtually hangup the current tty +vhangup \- ¸½ºß¤Î tty ¤ò²¾ÁÛŪ¤Ë (virtualy) ¥Ï¥ó¥°¥¢¥Ã¥× (hangup) ¤µ¤»¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B int vhangup(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 +.ad l +.BR vhangup (): +_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" +.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 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" +.SH ½àµò +.\"O This call is Linux-specific, and should not be used in programs +.\"O intended to be portable. +¤³¤Î¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç +»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR capabilities (7), +.BR init (8) diff --git a/draft/man2/vm86.2 b/draft/man2/vm86.2 new file mode 100644 index 00000000..75c75ecb --- /dev/null +++ b/draft/man2/vm86.2 @@ -0,0 +1,116 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Copyright 1997 Andries E. 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. +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated Thu Jun 26 21:32:38 JST 1997 +.\" by SUTO, Mitsuaki +.\" Modified Sun Mar 21 17:23:16 JST 1999 +.\" by HANATAKA Shinya +.\" Updated & Modified Sat May 22 19:50:44 JST 2004 +.\" by Yuichi SATO +.\" +.TH VM86 2 2009-02-20 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O vm86old, vm86 \- enter virtual 8086 mode +vm86old, vm86 \- ²¾ÁÛ 8086 ¥â¡¼¥É¤Ø°Ü¹Ô¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int vm86old(struct vm86_struct *" info ); +.sp +.BI "int vm86(unsigned long " fn ", struct vm86plus_struct *" v86 ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The system call +.\"O .BR vm86 () +.\"O was introduced in Linux 0.97p2. +.\"O In Linux 2.1.15 and 2.0.28 it was renamed to +.\"O .BR vm86old (), +.\"O and a new +.\"O .BR vm86 () +.\"O was introduced. +.\"O The definition of \fIstruct vm86_struct\fP was changed +.\"O in 1.1.8 and 1.1.9. +.BR vm86 () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 0.97p2 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +¤³¤ì¤Ï Linux 2.1.15 ¤È 2.0.28 ¤Ç +.BR vm86old () +¤Ë̾Á°¤¬Êѹ¹¤µ¤ì¡¢ +¿·¤·¤¤ +.BR vm86 () +¤¬Æ³Æþ¤µ¤ì¤¿¡£ +\fIstruct vm86_struct\fP ¤ÎÄêµÁ¤Ï 1.1.8 ¤È 1.1.9 ¤ÇÊѹ¹¤µ¤ì¤¿¡£ +.LP +.\"O These calls cause the process to enter VM86 mode (virtual-8086 in Intel +.\"O literature), and are used by +.\"O .BR dosemu . +¤³¤ì¤é¤Î¥³¡¼¥ë¤Ë¤è¤Ã¤Æ¥×¥í¥»¥¹¤Ï VM86 ¥â¡¼¥É +(Intel ¤Îʸ½ñ¤Ç¤Ï²¾ÁÛ 8086 ¥â¡¼¥É) ¤Ø¤È°Ü¹Ô¤¹¤ë¡£ +¤³¤ì¤é¤Î¥³¡¼¥ë¤Ï +.B dosemu +¤Ç»ÈÍѤµ¤ì¤ë¡£ +.PP +.\"O VM86 mode is an emulation of real mode within a protected mode task. +VM86 ¥â¡¼¥É¤Ï¥×¥í¥Æ¥¯¥È¥â¡¼¥É¥¿¥¹¥¯¤Ë¤ª¤±¤ë +¥ê¥¢¥ë¥â¡¼¥É¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ç¤¢¤ë¡£ +.\"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 EFAULT +.\"O This return value is specific to i386 and indicates a problem with getting +.\"O userspace data. +¤³¤ÎÊÖ¤êÃÍ¤Ï i386 ¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢ +¥æ¡¼¥¶¡¼¶õ´Ö¤Î¥Ç¡¼¥¿¤ò¼èÆÀ¤¹¤ëºÝ¤ËÌäÂ꤬¤¢¤Ã¤¿¤³¤È¤ò¼¨¤¹¡£ +.TP +.B ENOSYS +.\"O This return value indicates the call is not implemented on the present +.\"O architecture. +¤³¤ÎÊÖ¤êÃͤϡ¢¤³¤Î¥³¡¼¥ë¤¬¸½ºß¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£ +.TP +.B EPERM +.\"O Saved kernel stack exists. +.\"O (This is a kernel sanity check; the saved +.\"O stack should only exist within vm86 mode itself.) +Êݸ¤µ¤ì¤¿¥«¡¼¥Í¥ë¥¹¥¿¥Ã¥¯¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤ë¡£(¤³¤ì¤Ï¥«¡¼¥Í¥ë¤¬Ä̾ï¤Î +¾õÂ֤Ǥ¢¤ë¤«¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¤¤ë¡£Êݸ¤µ¤ì¤¿¥¹¥¿¥Ã¥¯¤Ï vm86 ¥â¡¼¥É¤Ç +¤·¤«Â¸ºß¤·¤Ê¤¤¡£) +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This call is specific to Linux on 32-bit Intel processors, +.\"O and should not be used in programs intended to be portable. +¤³¤Î´Ø¿ô¤Ï 32 ¥Ó¥Ã¥È Intel ¥×¥í¥»¥Ã¥µ¾å¤Î Linux ÆÃÍ­¤Î´Ø¿ô¤Ç¤¢¤ê¡¢ +°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ê¤¤¡£ diff --git a/draft/man2/vmsplice.2 b/draft/man2/vmsplice.2 new file mode 100644 index 00000000..4919c8ed --- /dev/null +++ b/draft/man2/vmsplice.2 @@ -0,0 +1,247 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 2006 Jens Axboe +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-02-04, Akihiro MOTOKI +.\" +.TH VMSPLICE 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O vmsplice \- splice user pages into a pipe +.SH ̾Á° +vmsplice \- ¥æ¡¼¥¶¡¦¥Ú¡¼¥¸¤ò¥Ñ¥¤¥×¤Ë·Ñ¤®¹ç¤ï¤»¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.B #include + +.BI "ssize_t vmsplice(int " fd ", const struct iovec *" iov , +.BI " unsigned long " nr_segs ", unsigned int " flags ); +.fi +.\" Return type was long before glibc 2.7 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\" Linus: vmsplice() system call to basically do a "write to +.\" the buffer", but using the reference counting and VM traversal +.\" to actually fill the buffer. This means that the user needs to +.\" be careful not to reuse the user-space buffer it spliced into +.\" the kernel-space one (contrast this to "write()", which copies +.\" the actual data, and you can thus reuse the buffer immediately +.\" after a successful write), but that is often easy to do. +.\"O The +.\"O .BR vmsplice () +.\"O system call maps +.\"O .I nr_segs +.\"O ranges of user memory described by +.\"O .I iov +.\"O into a pipe. +.\"O The file descriptor +.\"O .I fd +.\"O must refer to a pipe. +.BR vmsplice () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +.I iov +¤Ç»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¡¦¥á¥â¥ê¤Î +.I nr_segs +¤ÎÈϰϤò¥Ñ¥¤¥×¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¡£ +.I fd +¤Ï¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O The pointer +.\"O .I iov +.\"O points to an array of +.\"O .I iovec +.\"O structures as defined in +.\"O .IR : +¥Ý¥¤¥ó¥¿ +.I iov +¤Ï +.I iovec +¹½Â¤ÂΤÎÇÛÎó¤ò»Ø¤¹¡£ +.I iovec +¹½Â¤ÂÎ¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: + +.in +4n +.nf +struct iovec { +.\"O void *iov_base; /* Starting address */ +.\"O size_t iov_len; /* Number of bytes */ + void *iov_base; /* ³«»Ï¥¢¥É¥ì¥¹ */ + size_t iov_len; /* ¥Ð¥¤¥È¿ô */ +}; +.in +.fi + +.\"O The +.\"O .I flags +.\"O argument is a bit mask that is composed by ORing together +.\"O zero or more of the following values: +.I flags +°ú¤­¿ô¤Ë¤Ï¡¢°Ê²¼¤ÎÃͤΠ0 ¸Ä°Ê¾å¤ò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýϤηÁ¤Ç»ØÄꤹ¤ë¡£ +.TP 1.9i +.B SPLICE_F_MOVE +.\"O Unused for +.\"O .BR vmsplice (); +.\"O see +.\"O .BR splice (2). +.BR vmsplice () +¤Ç¤Ï̤»ÈÍÑ¡£ +.BR splice (2) +»²¾È¡£ +.TP +.B SPLICE_F_NONBLOCK +.\" Not used for vmsplice +.\" May be in the future -- therefore EAGAIN +.\"O Do not block on I/O; see +.\"O .BR splice (2) +.\"O for further details. +Æþ½ÐÎϤÇÄä»ß (block) ¤·¤Ê¤¤¡£¾ÜºÙ¤Ï +.BR splice (2) +»²¾È¡£ +.TP +.B SPLICE_F_MORE +.\"O Currently has no effect for +.\"O .BR vmsplice (), +.\"O but may be implemented in the future; see +.\"O .BR splice (2). +¸½ºß¤Î¤È¤³¤í +.BR vmsplice () +¤Ç¤Ï²¿¤Î¸ú²Ì¤â¤Ê¤¤¤¬¡¢¾­ÍèŪ¤Ë¤Ï¼ÂÁõ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.BR splice (2) +»²¾È¡£ +.TP +.B SPLICE_F_GIFT +.\"O The user pages are a gift to the kernel. +.\"O The application may not modify this memory ever, +.\"O .\" FIXME Explain the following line in a little more detail: +.\"O or page cache and on-disk data may differ. +¥æ¡¼¥¶¡¦¥Ú¡¼¥¸¤¬¥«¡¼¥Í¥ë¤ØÅϤ¹¤â¤Î (gift) ¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤Î¥á¥â¥ê¤òÀäÂФËÊѹ¹¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.\" FIXME Explain the following line in a little more detail: +¤µ¤â¤Ê¤±¤ì¤Ð¡¢¥Ú¡¼¥¸¥­¥ã¥Ã¥·¥å¤È¥Ç¥£¥¹¥¯¾å¤Î¥Ç¡¼¥¿¤Ï +°ìÃפ·¤Ê¤¯¤Ê¤ë¤À¤í¤¦¡£ +.\"O Gifting pages to the kernel means that a subsequent +.\"O .BR splice (2) +.\"O .B SPLICE_F_MOVE +.\"O can successfully move the pages; +¥Ú¡¼¥¸¤ò¥«¡¼¥Í¥ë¤ËÅϤ¹¤È¡¢¤³¤Î¼¡¤Î +.BR splice (2) +.B SPLICE_F_MOVE +¤Ç¤½¤Î¥Ú¡¼¥¸¤Î°ÜÆ°¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O if this flag is not specified, then a subsequent +.\"O .BR splice (2) +.\"O .B SPLICE_F_MOVE +.\"O must copy the pages. +¤³¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¤³¤Î¼¡¤Î +.BR splice (2) +.B SPLICE_F_MOVE +¤Ç¤½¤Î¥Ú¡¼¥¸¤Î¥³¥Ô¡¼¤ò¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O Data must also be properly page aligned, both in memory and length. +¥Ç¡¼¥¿¤Ï¥á¥â¥ê¾å¤Ç¥Ú¡¼¥¸¶­³¦¤Ë¤¢¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +Ťµ¤â¥Ú¡¼¥¸¶­³¦¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" .... if we expect to later SPLICE_F_MOVE to the cache. +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O Upon successful completion, +.\"O .BR vmsplice () +.\"O returns the number of bytes transferred to the pipe. +.\"O On error, +.\"O .BR vmsplice () +.\"O returns \-1 and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤·¤Æ´°Î»¤¹¤ë¤È¡¢ +.BR vmsplice () +¤Ï¥Ñ¥¤¥×¤ËžÁ÷¤·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR vmplice () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O .I fd +.\"O either not valid, or doesn't refer to a pipe. +.I fd +¤¬Í­¸ú¤Ç¤Ê¤¤¡¢¤â¤·¤¯¤Ï¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O .I nr_segs +.\"O is 0 or greater than +.\"O .BR IOV_MAX ; +.\"O or memory not aligned if +.\"O .B SPLICE_F_GIFT +.\"O set. +.I nr_segs +¤¬ 0 ¤â¤·¤¯¤Ï +.B IOV_MAX +¤è¤ê¤âÂ礭¤¤¡£¤Þ¤¿¤Ï +.B SPLICE_F_GIFT +¤¬ÀßÄꤵ¤ì¤¿¤¬¥á¥â¥ê¤¬¥Ú¡¼¥¸¶­³¦¤Ë¤¢¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOMEM +.\"O Out of memory. +¥á¥â¥êÉÔ­¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The +.\"O .BR vmsplice () +.\"O system call first appeared in Linux 2.6.17. +.BR vmsplice () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6.17 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This system call is Linux-specific. +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH È÷¹Í +.\"O .BR vmsplice () +.\"O follows the other vectorized read/write type functions when it comes to +.\"O limitations on number of segments being passed in. +.\"O This limit is +.\"O .B IOV_MAX +.\"O as defined in +.\"O .IR . +.\"O At the time of this writing, that limit is 1024. +»ØÄꤵ¤ì¤¿¥»¥°¥á¥ó¥È¿ô¤¬¾å¸Â¤Ë㤷¤¿¾ì¹ç¡¢ +.BR vmsplice () +¤Ï¾¤Î¥Ù¥¯¥È¥ë·Á¼°¤Î read/write ¤ò¹Ô¤¦´Ø¿ô¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¡£ +¾å¸Â¤Ï +.B IOV_MAX +¤Ç¤¢¤ê¡¢ +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥É¥­¥å¥á¥ó¥È¤ò½ñ¤¤¤¿»þÅÀ¤Ç¤ÎÃÍ¤Ï 1024 ¤Ç¤¢¤ë¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR splice (2), +.BR tee (2), +.BR feature_test_macros (7) diff --git a/draft/man2/wait.2 b/draft/man2/wait.2 new file mode 100644 index 00000000..79701cb9 --- /dev/null +++ b/draft/man2/wait.2 @@ -0,0 +1,1026 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 by Thomas Koenig +.\" and Copyright (c) 2004 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. +.\" License. +.\" +.\" Modified Sat Jul 24 13:30:06 1993 by Rik Faith +.\" Modified Sun Aug 21 17:42:42 1994 by Rik Faith +.\" (Thanks to Koen Holtman ) +.\" Modified Wed May 17 15:54:12 1995 by Rik Faith +.\" To remove *'s from status in macros (Thanks to Michael Shields). +.\" Modified as suggested by Nick Duffek , aeb, 960426 +.\" Modified Mon Jun 23 14:09:52 1997 by aeb - add EINTR. +.\" Modified Thu Nov 26 02:12:45 1998 by aeb - add SIGCHLD stuff. +.\" Modified Mon Jul 24 21:37:38 2000 by David A. Wheeler +.\" - noted thread issues. +.\" Modified 26 Jun 01 by Michael Kerrisk +.\" Added __WCLONE, __WALL, and __WNOTHREAD descriptions +.\" Modified 2001-09-25, aeb +.\" Modified 26 Jun 01 by Michael Kerrisk, +.\" Updated notes on setting disposition of SIGCHLD to SIG_IGN +.\" 2004-11-11, mtk +.\" Added waitid(2); added WCONTINUED and WIFCONTINUED() +.\" Added text on SA_NOCLDSTOP +.\" Updated discussion of SA_NOCLDWAIT to reflect 2.6 behavior +.\" Much other text rewritten +.\" 2005-05-10, mtk, __W* flags can't be used with waitid() +.\" 2008-07-04, mtk, removed erroneous text about SA_NOCLDSTOP +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya all rights reserved. +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 1997-03-04, HANATAKA Shinya +.\" Modified 2000-09-23, HANATAKA Shinya +.\" Updated 2001-06-25, Kentaro Shirakata +.\" Updated 2001-10-15, Kentaro Shirakata +.\" Updated 2001-12-13, Kentaro Shirakata +.\" Updated 2002-10-21, Kentaro Shirakata +.\" Updated 2003-01-27, Kentaro Shirakata +.\" Updated 2003-09-12, Kentaro Shirakata +.\" Updated 2005-03-19, Akihiro MOTOKI +.\" Updated 2005-12-26, Akihiro MOTOKI +.\" Updated 2008-07-31, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: signal handling ¥·¥°¥Ê¥ë½èÍý +.\"WORD: suspend Ää»ß(suspend) +.\"WORD: zombie ¥¾¥ó¥Ó(zombie) +.\"WORD: child process »Ò¥×¥í¥»¥¹ +.\"WORD: process group ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× +.\"WORD: process group ID ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×ID +.\"WORD: stop Ää»ß(stop) +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: block ¶Ø»ß(block) +.\" +.TH WAIT 2 2009-04-21 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wait, waitpid, waitid \- wait for process to change state +wait, waitpid, waitid \- ¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤òÂÔ¤Ä +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "pid_t wait(int *" "status" ); + +.BI "pid_t waitpid(pid_t " pid ", int *" status ", int " options ); + +.BI "int waitid(idtype_t " idtype ", id_t " id \ +", siginfo_t *" infop ", int " options ); +.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 waitid (): +_SVID_SOURCE || _XOPEN_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O All of these system calls are used to wait for state changes +.\"O in a child of the calling process, and obtain information +.\"O about the child whose state has changed. +.\"O A state change is considered to be: the child terminated; +.\"O the child was stopped by a signal; or the child was resumed by a signal. +.\"O In the case of a terminated child, performing a wait allows +.\"O the system to release the resources associated with the child; +.\"O if a wait is not performed, then the terminated child remains in +.\"O a "zombie" state (see NOTES below). +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤¤¤º¤ì¤â¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î +¾õÂÖÊѲ½¤òÂÔ¤Á¡¢¾õÂÖ¤¬ÊѲ½¤·¤¿¤½¤Î»Ò¥×¥í¥»¥¹¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ë¤Î¤Ë +»ÈÍѤµ¤ì¤ë¡£ +¾õÂÖÊѲ½¤È¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë: +»Ò¥×¥í¥»¥¹¤Î½ªÎ»¡¢¥·¥°¥Ê¥ë¤Ë¤è¤ë»Ò¥×¥í¥»¥¹¤ÎÄä»ß¡¢ +¥·¥°¥Ê¥ë¤Ë¤è¤ë»Ò¥×¥í¥»¥¹¤ÎºÆ³«¡£ +»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¾ì¹ç¤Ï¡¢wait ¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¡¢ +¥·¥¹¥Æ¥à¤¬¤½¤Î»Ò¥×¥í¥»¥¹¤Ë´ØÏ¢¤¹¤ë¥ê¥½¡¼¥¹¤ò²òÊü¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +wait ¤¬¼Â¹Ô¤µ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤Ï +¡Ö¥¾¥ó¥Ó¡×¾õÂ֤ǻĤ곤±¤ë (²¼µ­¤ÎÃí°Õ¤Î¾Ï¤ò»²¾È¤Î¤³¤È)¡£ + +.\"O If a child has already changed state, then these calls return immediately. +.\"O Otherwise they block until either a child changes state or +.\"O a signal handler interrupts the call (assuming that system calls +.\"O are not automatically restarted using the +.\"O .B SA_RESTART +.\"O flag of +.\"O .BR sigaction (2)). +.\"O In the remainder of this page, a child whose state has changed +.\"O and which has not yet been waited upon by one of these system +.\"O calls is termed +.\"O .IR waitable . +»Ò¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤¬¤¹¤Ç¤ËȯÀ¸¤·¤Æ¤¤¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î¥³¡¼¥ë¤Ï +¤¹¤°¤ËÉüµ¢¤¹¤ë¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢»Ò¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤¬µ¯¤³¤ë¤«¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÃæÃǤµ¤ì¤ë¤Þ¤Ç¡¢ +Ää»ß (block) ¤¹¤ë (¸å¼Ô¤Ï¡¢ +.BR sigaction (2) +¤Î +.B SA_RESTART +¥Õ¥é¥°¤Ë¤è¤ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤ +¾ì¹ç¤ÎÆ°ºî¤Ç¤¢¤ë)¡£ +°Ê²¼¤ÎÀâÌÀ¤Ç¤Ï¡¢¾õÂÖÊѲ½¤¬µ¯¤³¤Ã¤¿¤¬¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¤¤¤º¤ì¤«¤Ë +¤è¤Ã¤ÆÂÔ¤¿¤ì¤Æ¤¤¤Ê¤¤»Ò¥×¥í¥»¥¹¤ò +.I waitable +(ÂÔ¤Á²Äǽ) ¤È¸Æ¤Ö¡£ +.\"O .SS "wait() and waitpid()" +.SS "wait() ¤È waitpid()" +.\"O The +.\"O .BR wait () +.\"O system call suspends execution of the calling process until one of its +.\"O children terminates. +.\"O The call +.\"O .I wait(&status) +.\"O is equivalent to: +.\"O .nf +.\"O +.\"O watpid(\-1, &status, 0); +.\"O .fi +.BR wait () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢»Ò¥×¥í¥»¥¹¤Î¤¤¤º¤ì¤«¤¬½ªÎ»¤¹¤ë¤Þ¤Ç +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò°ì»þÄä»ß¤¹¤ë¡£ +°Ê²¼¤ÎÆó¤Ä¤Î¸Æ¤Ó½Ð¤·¤ÏÅù²Á¤Ç¤¢¤ë: +.nf + + wait(&status); + + waitpid(\-1, &status, 0); +.fi + +.\"O The +.\"O .BR waitpid () +.\"O system call suspends execution of the calling process until a +.\"O child specified by +.\"O .I pid +.\"O argument has changed state. +.\"O By default, +.\"O .BR waitpid () +.\"O waits only for terminated children, but this behavior is modifiable +.\"O via the +.\"O .I options +.\"O argument, as described below. +.BR waitpid () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +.I pid +°ú¤­¿ô¤Ç»ØÄꤷ¤¿»Ò¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤¬µ¯¤³¤ë¤Þ¤Ç¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò°ì»þÄä»ß¤¹¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR waitpid () +¤Ï»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤À¤±¤òÂԤĤ¬¡¢¤³¤ÎÆ°ºî¤Ï +.I options +°ú¤­¿ô¤Ë¤è¤êÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ + +.\"O The value of +.\"O .I pid +.\"O can be: +.I pid +¤Ë»ØÄê¤Ç¤­¤ëÃͤϰʲ¼¤ÎÄ̤ê: +.IP "< \-1" +.\"O meaning wait for any child process whose process group ID is +.\"O equal to the absolute value of +.\"O .IR pid . +¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤¬ +.I pid +¤ÎÀäÂÐÃͤËÅù¤·¤¤»Ò¥×¥í¥»¥¹¤Î¤¤¤º¤ì¤«¤¬½ªÎ»¤¹¤ë¤Þ¤Ç¤òÂԤġ£ +.IP \-1 +.\"O meaning wait for any child process. +»Ò¥×¥í¥»¥¹¤Î¤É¤ì¤«¤¬½ªÎ»¤¹¤ë¤Þ¤ÇÂԤġ£ +.IP 0 +.\"O meaning wait for any child process whose process group ID is +.\"O equal to that of the calling process. +¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤¬¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¤â¤Î¤ÈÅù¤·¤¤ +»Ò¥×¥í¥»¥¹¤òÂԤġ£ +.IP "> 0" +.\"O meaning wait for the child whose process ID is equal to the +.\"O value of +.\"O .IR pid . +¥×¥í¥»¥¹ID ¤¬ +.I pid +¤ËÅù¤·¤¤»Ò¥×¥í¥»¥¹¤òÂԤġ£ +.PP +.\"O The value of +.\"O .I options +.\"O is an OR of zero or more of the following constants: +.I options +¤ÎÃͤϼ¡¤ÎÄê¿ô¤Î 0 ¸Ä°Ê¾å¤ÎÏÀÍýϤǤ¢¤ë: +.TP 12 +.B WNOHANG +.\"O return immediately if no child has exited. +¾õÂÖÊѲ½¤¬µ¯¤³¤Ã¤¿»Ò¥×¥í¥»¥¹¤¬¤Ê¤¤¾ì¹ç¤Ë¤¹¤°¤ËÉüµ¢¤¹¤ë¡£ +.TP +.B WUNTRACED +.\"O also return if a child has stopped +.\"O (but not traced via +.\"O .BR ptrace (2)). +.\"O Status for +.\"O .I traced +.\"O children which have stopped is provided +.\"O even if this option is not specified. +»Ò¥×¥í¥»¥¹¤¬Ää»ß¤·¤¿¾ì¹ç¤Ë¤âÉüµ¢¤¹¤ë (»Ò¥×¥í¥»¥¹¤¬ +.BR ptrace (2) +¤Ç¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï½ü¤¯)¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤â¡¢Ää»ß¤·¤¿¥×¥í¥»¥¹¤¬ +¡Ö¥È¥ì¡¼¥¹ (traced)¡×¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢»Ò¥×¥í¥»¥¹¤Î¾õÂÖ¤¬Êó¹ð¤µ¤ì¤ë¡£ +.TP +.\"O .BR WCONTINUED " (Since Linux 2.6.10)" +.BR WCONTINUED " (Linux 2.6.10 °Ê¹ß)" +.\"O also return if a stopped child has been resumed by delivery of +.\"O .BR SIGCONT . +Ää»ß¤·¤¿»Ò¥×¥í¥»¥¹¤¬ +.B SIGCONT +¤ÎÇÛÁ÷¤Ë¤è¤êºÆ³«¤·¤¿¾ì¹ç¤Ë¤âÉüµ¢¤¹¤ë¡£ +.PP +.\"O (For Linux-only options, see below.) +(Linux ÀìÍÑ¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò¤¹¤ë) +.PP +.\"O If +.\"O .I status +.\"O is not NULL, +.\"O .BR wait () +.\"O and +.\"O .BR waitpid () +.\"O store status information in the \fIint\fP to which it points. +.I status +¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢ +.BR wait () +¤ä +.BR waitpid () +¤Ï +.I status +¤Ç»Ø¤¹ \fIint\fP ¤Ë¾õÂÖ¾ðÊó¤ò³ÊǼ¤¹¤ë¡£ +.\"O This integer can be inspected with the following macros (which +.\"O take the integer itself as an argument, not a pointer to it, +.\"O as is done in +.\"O .BR wait () +.\"O and +.\"O .BR waitpid ()!): +¤³¤ÎÀ°¿ô¤Ï°Ê²¼¤Î¥Þ¥¯¥í¤ò»È¤Ã¤Æ¸¡ºº¤Ç¤­¤ë¡£ +(¤³¤ì¤é¤Î¥Þ¥¯¥í¤Î°ú¤­¿ô¤Ë¤Ï¡¢ +.BR wait () +¤ä +.BR waitpid () +¤¬½ñ¤­¹þ¤ó¤ÀÀ°¿ô¤½¤Î¤â¤Î¤ò»ØÄꤹ¤ë¡£¥Ý¥¤¥ó¥¿¤Ç¤Ï¤Ê¤¤!) +.TP +.BI WIFEXITED( status ) +.\"O returns true if the child terminated normally, that is, +.\"O by calling +.\"O .BR exit (3) +.\"O or +.\"O .BR _exit (2), +.\"O or by returning from main(). +»Ò¥×¥í¥»¥¹¤¬Àµ¾ï¤Ë½ªÎ»¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£ +¡ÖÀµ¾ï¤Ë¡×¤È¤Ï¡¢ +.BR exit (3) +¤« +.BR _exit (2) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢¤â¤·¤¯¤Ï +main() ¤«¤éÉüµ¢¤·¤¿¾ì¹ç¤Ç¤¢¤ë¡£ +.TP +.BI WEXITSTATUS( status ) +.\"O returns the exit status of the child. +.\"O This consists of the least significant 8 bits of the +.\"O .I status +.\"O argument that the child specified in a call to +.\"O .BR exit (3) +.\"O or +.\"O .BR _exit (2) +.\"O or as the argument for a return statement in main(). +.\"O This macro should only be employed if +.\"O .B WIFEXITED +.\"O returned true. +»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤òÊÖ¤¹¡£ +½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ï +.I status +°ú¤­¿ô¤Î²¼°Ì 8¥Ó¥Ã¥È¤Ç¹½À®¤µ¤ì¤Æ¤ª¤ê¡¢ +.BR exit (3) +¤ä +.BR _exit (2) +¤Î¸Æ¤Ó½Ð¤·»þ¤ËÅϤµ¤ì¤¿ÃÍ¡¢¤â¤·¤¯¤Ï main() ¤Î return ʸ¤Î +°ú¤­¿ô¤È¤·¤Æ»ØÄꤵ¤ì¤¿ÃͤǤ¢¤ë¡£ +¤³¤Î¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤Î¤Ï +.B WIFEXITED +¤¬¿¿¤òÊÖ¤·¤¿¾ì¹ç¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.BI WIFSIGNALED( status ) +.\"O returns true if the child process was terminated by a signal. +»Ò¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤Ë¤è¤ê½ªÎ»¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£ +.TP +.BI WTERMSIG( status ) +.\"O returns the number of the signal that caused the child process to +.\"O terminate. +.\"O This macro should only be employed if +.\"O .B WIFSIGNALED +.\"O returned true. +»Ò¥×¥í¥»¥¹½ªÎ»¤Î¸¶°ø¤È¤Ê¤Ã¤¿¥·¥°¥Ê¥ë¤ÎÈÖ¹æ¤òÊÖ¤¹¡£ +¤³¤Î¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤Î¤Ï +.B WIFSIGNALED +¤¬¿¿¤òÊÖ¤·¤¿¾ì¹ç¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.BI WCOREDUMP( status ) +.\"O returns true if the child produced a core dump. +.\"O This macro should only be employed if +.\"O .B WIFSIGNALED +.\"O returned true. +.\"O This macro is not specified in POSIX.1-2001 and is not available on +.\"O some Unix implementations (e.g., AIX, SunOS). +.\"O Only use this enclosed in #ifdef WCOREDUMP ... #endif. +»Ò¥×¥í¥»¥¹¤¬¥³¥¢¥À¥ó¥×¤òÀ¸À®¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£ +¤³¤Î¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤Î¤Ï +.B WIFSIGNALED +¤¬¿¿¤òÊÖ¤·¤¿¾ì¹ç¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤Î¥Þ¥¯¥í¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤ª¤é¤º¡¢ +(AIX, SunOS ¤Ê¤É¤Î) ¤¤¤¯¤Ä¤«¤Î Unix ¤Î¼ÂÁõ¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +ɬ¤º #ifdef WCOREDUMP ... #endif ¤Ç³ç¤Ã¤Æ»ÈÍѤ¹¤ë¤³¤È¡£ +.TP +.BI WIFSTOPPED( status ) +.\"O returns true if the child process was stopped by delivery of a signal; +.\"O this is only possible if the call was done using +.\"O .B WUNTRACED +.\"O or when the child is being traced (see +.\"O .BR ptrace (2)). +»Ò¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤Ë¤è¤êÄä»ß¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£ +¤³¤ì¤¬¿¿¤Ë¤Ê¤ë¤Î¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ +.B WUNTRACED +¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤«¡¢»Ò¥×¥í¥»¥¹¤¬¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤ë¾ì¹ç +.RB ( ptrace (2) +»²¾È) ¤À¤±¤Ç¤¢¤ë¡£ +.TP +.BI WSTOPSIG( status ) +.\"O returns the number of the signal which caused the child to stop. +.\"O This macro should only be employed if +.\"O .B WIFSTOPPED +.\"O returned true. +»Ò¥×¥í¥»¥¹¤òÄä»ß¤µ¤»¤¿¥·¥°¥Ê¥ë¤ÎÈÖ¹æ¤òÊÖ¤¹¡£ +¤³¤Î¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤Î¤Ï +.B WIFSTOPPED +¤¬ 0 °Ê³°¤òÊÖ¤·¤¿¾ì¹ç¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.BI WIFCONTINUED( status ) +.\"O (since Linux 2.6.10) +(Linux 2.6.10 °Ê¹ß) +.\"O returns true if the child process was resumed by delivery of +.\"O .BR SIGCONT . +»Ò¥×¥í¥»¥¹¤¬ +.B SIGCONT +¤ÎÇÛÁ÷¤Ë¤è¤êºÆ³«¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£ +.SS "waitid()" +.\"O The +.\"O .BR waitid () +.\"O system call (available since Linux 2.6.9) provides more precise +.\"O control over which child state changes to wait for. +.BR waitid () +¥·¥¹¥Æ¥à¥³¡¼¥ë (Linux 2.6.9 °Ê¹ß¤ÇÍøÍѲÄǽ) ¤ò»È¤¦¤È¡¢ +»Ò¥×¥í¥»¥¹¤Î¤É¤Î¾õÂÖÊѲ½¤òÂԤĤ«¤Ë¤Ä¤¤¤Æ¤è¤êºÙ¤«¤ÊÀ©¸æ¤¬¤Ç¤­¤ë¡£ + +.\"O The +.\"O .I idtype +.\"O and +.\"O .I id +.\"O arguments select the child(ren) to wait for, as follows: +°ú¤­¿ô +.I idtype +¤È +.I id +¤Ç¤É¤Î»Ò¥×¥í¥»¥¹¤òÂԤĤ«¤òÁªÂò¤¹¤ë: +.IP "\fIidtype\fP == \fBP_PID\fP" +.\"O Wait for the child whose process ID matches +.\"O .IR id . +¥×¥í¥»¥¹ID ¤¬ +.I id +¤È°ìÃפ¹¤ë»Ò¥×¥í¥»¥¹¤òÂԤġ£ +.IP "\fIidtype\fP == \fBP_PGID\fP" +.\"O Wait for any child whose process group ID matches +.\"O .IR id . +¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤¬ +.I id +¤È°ìÃפ¹¤ë»Ò¥×¥í¥»¥¹¤òÂԤġ£ +.IP "\fIidtype\fP == \fBP_ALL\fP" +.\"O Wait for any child; +.\"O .I id +.\"O is ignored. +»Ò¥×¥í¥»¥¹Á´Éô¤òÂоݤËÂԤġ£ +.I id +¤Ï̵»ë¤µ¤ì¤ë¡£ +.PP +.\"O The child state changes to wait for are specified by ORing +.\"O one or more of the following flags in +.\"O .IR options : +»Ò¥×¥í¥»¥¹¤Î¤É¤Î¾õÂÖÊѲ½¤òÂԤĤ«¤Ï°Ê²¼¤Î¥Õ¥é¥°¤Ç»ØÄꤹ¤ë +.RI ( options +¤Ë¤Ï 1¸Ä°Ê¾å¤Î¥Õ¥é¥°¤ÎÏÀÍýϤò¤È¤Ã¤Æ»ØÄꤹ¤ë): +.TP 12 +.B WEXITED +.\"O Wait for children that have terminated. +»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤òÂԤġ£ +.TP +.B WSTOPPED +.\"O Wait for children that have been stopped by delivery of a signal. +»Ò¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤Ë¤è¤êÄä»ß¤¹¤ë¤Î¤òÂԤġ£ +.TP +.B WCONTINUED +.\"O Wait for (previously stopped) children that have been +.\"O resumed by delivery of +.\"O .BR SIGCONT . +(Ää»ß¤·¤Æ¤¤¤¿) »Ò¥×¥í¥»¥¹¤¬ +.B SIGCONT +¤¬ÇÛÁ÷¤µ¤ì¤ÆºÆ³«¤¹¤ë¤Î¤òÂԤġ£ +.PP +.\"O The following flags may additionally be ORed in +.\"O .IR options : +¤µ¤é¤Ë°Ê²¼¤Î¥Õ¥é¥°¤òÏÀÍýϤηÁ¤Ç +.I options +¤Ë»ØÄê¤Ç¤­¤ë: +.TP 12 +.B WNOHANG +.\"O As for +.\"O .BR waitpid (). +.BR waitpid () +¤ÈƱÍÍ¡£ +.TP +.B WNOWAIT +.\"O Leave the child in a waitable state; a later wait call +.\"O can be used to again retrieve the child status information. +waitable ¾õÂÖ¤Î¥×¥í¥»¥¹¤ò¤½¤Î¤Þ¤Þ¤Ë¤¹¤ë¡£¤³¤Î¸å¤Ç wait ¥³¡¼¥ë¤ò +»È¤Ã¤Æ¡¢Æ±¤¸»Ò¥×¥í¥»¥¹¤Î¾õÂÖ¾ðÊó¤ò¤â¤¦°ìÅÙ¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O Upon successful return, +.\"O .BR waitid () +.\"O fills in the following fields of the +.\"O .I siginfo_t +.\"O structure pointed to by +.\"O .IR infop : +À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +.BR waitid () +¤Ï +.I infop +¤¬»Ø¤¹ +.I siginfo_t +¹½Â¤ÂΤΰʲ¼¤Î¥Õ¥£¡¼¥ë¥É¤òÀßÄꤹ¤ë: +.TP 12 +\fIsi_pid\fP +.\"O The process ID of the child. +»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ID¡£ +.TP +\fIsi_uid\fP +.\"O The real user ID of the child. +.\"O (This field is not set on most other implementations.) +»Ò¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ID +(¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¾¤Î¤Û¤È¤ó¤É¤Î¼ÂÁõ¤Ç¤ÏÀßÄꤵ¤ì¤Ê¤¤)¡£ +.TP +\fIsi_signo\fP +.\"O Always set to +.\"O .BR SIGCHLD . +¾ï¤Ë +.B SIGCHLD +¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +\fIsi_status\fP +.\"O Either the exit status of the child, as given to +.\"O .BR _exit (2) +.\"O (or +.\"O .BR exit (3)), +.\"O or the signal that caused the child to terminate, stop, or continue. +.\"O The +.\"O .I si_code +.\"O field can be used to determine how to interpret this field. +.BR _exit (2) +(¤« +.BR exit (3)) +¤Ë»ØÄꤵ¤ì¤¿»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¡¢¤â¤·¤¯¤Ï +»Ò¥×¥í¥»¥¹¤Î½ªÎ»¡¢Ää»ß¡¢ºÆ³«¤Î¸¶°ø¤È¤Ê¤Ã¤¿¥·¥°¥Ê¥ë¤¬ÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤ò¤É¤¦²ò¼á¤¹¤ë¤«¤Ï¡¢ +.I si_code +¥Õ¥£¡¼¥ë¥É¤ò»²¾È¤·¤Æ·è¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +\fIsi_code\fP +.\"O Set to one of: +.\"O .B CLD_EXITED +.\"O (child called +.\"O .BR _exit (2)); +.\"O .B CLD_KILLED +.\"O (child killed by signal); +.\"O .B CLD_DUMPED +.\"O (child killed by signal, and dumped core); +.\"O .B CLD_STOPPED +.\"O (child stopped by signal); +.\"O .B CLD_TRAPPED +.\"O (traced child has trapped); or +.\"O .B CLD_CONTINUED +.\"O (child continued by +.\"O .BR SIGCONT ). +°Ê²¼¤Î¤¤¤º¤ì¤«¤¬ÀßÄꤵ¤ì¤ë: +.B CLD_EXITED +(»Ò¥×¥í¥»¥¹¤¬ +.BR _exit (2) +¤ò¸Æ¤Ó½Ð¤·¤¿); +.B CLD_KILLED +(¥·¥°¥Ê¥ë¤Ë¤è¤ê»Ò¥×¥í¥»¥¹¤¬ kill ¤µ¤ì¤¿); +.B CLD_DUMPED +(¥·¥°¥Ê¥ë¤Ë¤è¤ê»Ò¥×¥í¥»¥¹¤¬ kill ¤µ¤ì¡¢¥³¥¢¡¦¥À¥ó¥×¤¬¹Ô¤ï¤ì¤¿); +.B CLD_STOPPED +(¥·¥°¥Ê¥ë¤Ë¤è¤ê»Ò¥×¥í¥»¥¹¤¬Ää»ß¤·¤¿); +.BR CLD_TRAPPED +(¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤¿»Ò¥×¥í¥»¥¹¤¬¥È¥é¥Ã¥×¤ò¼õ¿®¤·¤¿); +.B CLD_CONTINUED +.RB ( SIGCONT +¤Ë¤è¤ê»Ò¥×¥í¥»¥¹¤¬ºÆ³«¤µ¤ì¤¿)¡£ +.PP +.\"O If +.\"O .B WNOHANG +.\"O was specified in +.\"O .I options +.\"O and there were no children in a waitable state, then +.\"O .BR waitid () +.\"O returns 0 immediately and +.\"O the state of the +.\"O .I siginfo_t +.\"O structure pointed to by +.\"O .I infop +.\"O is unspecified. +.B WNOHANG +¤¬ +.I options +¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +waitable ¾õÂÖ¤Î»Ò¥×¥í¥»¥¹¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +.BR waitid () +¤Ï¤¹¤°¤Ë 0 ¤òÊÖ¤¹¡£¤³¤Î¤È¤­¡¢ +.I infop +¤¬»Ø¤¹ +.I siginfo_t +¹½Â¤ÂΤÎÆâÍƤÏÉÔÄê¤Ç¤¢¤ë¡£ +.\"O .\" POSIX.1-2001 leaves this possibility unspecified; most +.\"O .\" implementations (including Linux) zero out the structure +.\"O .\" in this case, but at at least one implementation (AIX 5.1) +.\"O .\" does not -- MTK Nov 04 +.\" POSIX.1-2001 ¤Ç¤Ï¡¢ÉÔÄê¤Î²ÄǽÀ­¤ò»Ä¤·¤Æ¤¤¤ë¡£ +.\" (Linux ¤ò´Þ¤à) ¤Û¤È¤ó¤É¤Î¼ÂÁõ¤Ç¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¹½Â¤ÂΤò 0 ¤ÇËä¤á¤ë¤¬¡¢ +.\" ¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¼ÂÁõ (AIX 5.1) ¤Ç¤Ï¤½¤¦¤Ê¤é¤Ê¤¤¡£ -- MTK Nov 04 +.\"O To distinguish this case from that where a child was in a +.\"O waitable state, zero out the +.\"O .I si_pid +.\"O field before the call and check for a nonzero value in this field +.\"O after the call returns. +¤³¤Î¾ì¹ç¤ò waitable ¾õÂÖ¤Î»Ò¥×¥í¥»¥¹¤¬¤¢¤Ã¤¿¾ì¹ç¤È¶èÊ̤¹¤ë¤Ë¤Ï¡¢ +.BR waitid () +¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë +.I si_pid +¤ò 0 ¤Ë¤·¤Æ¤ª¤­¡¢¥³¡¼¥ë¤¬Éüµ¢¤·¤¿¸å¤Ç¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬ 0 °Ê³°¤ÎÃͤ«¤É¤¦¤« +¤ò¥Á¥§¥Ã¥¯¤¹¤ì¤Ð¤è¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.BR wait (): +.\"O on success, returns the process ID of the terminated child; +.\"O on error, \-1 is returned. +À®¸ù¤¹¤ë¤È¡¢½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ID ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£ + +.BR waitpid (): +.\"O on success, returns the process ID of the child whose state has changed; +.\"O if +.\"O .B WNOHANG +.\"O was specified and one or more child(ren) specified by +.\"O.I pid +.\"O exist, but have not yet changed state, then 0 is returned. +.\"O On error, \-1 is returned. +À®¸ù¤¹¤ë¤È¡¢¾õÂÖ¤¬ÊѲ½¤·¤¿»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ID ¤òÊÖ¤¹¡£ +.B WNOHANG +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.I pid +¤Ç»Ø¼¨¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤¬°ì¤Ä°Ê¾å¸ºß¤¹¤ë¤¬¡¢¤É¤Î»Ò¥×¥í¥»¥¹¤Ç¤â +¾õÂÖÊѲ½¤¬µ¯¤³¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£ + +.BR waitid (): +.\"O returns 0 on success or +.\"O if +.\"O .B WNOHANG +.\"O was specified and no child(ren) specified by +.\"O .I id +.\"O has yet changed state; +.\"O on error, \-1 is returned. +À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +.B WNOHANG +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.I pid +¤Ç»Ø¼¨¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ç¾õÂÖÊѲ½¤¬µ¯¤³¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤â +0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£ +.\" FIXME: As reported by Vegard Nossum, if infop is NULL, then waitid() +.\" returns the PID of the child. Either this is a bug, or it is intended +.\" behavior that needs to be documented. See my Jan 2009 LKML mail +.\" "waitid() return value strangeness when infop is NULL". +.\"O Each of these calls sets +.\"O .I errno +.\"O to an appropriate value in the case of an error. +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤¤¤º¤ì¤â +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.\"O .B ECHILD +.\"O (for +.\"O .BR wait ()) +.B ECHILD +.RB ( wait () +¤Î¾ì¹ç) +.\"O The calling process does not have any unwaited-for children. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤Ï¡¢wait ¤ò¹Ô¤Ã¤Æ¤¤¤Ê¤¤»Ò¥×¥í¥»¥¹¤Ï¤Ê¤¤¡£ +.TP +.\"O .B ECHILD +.\"O (for +.\"O .BR waitpid () +.\"O or +.\"O .BR waitid ()) +.B ECHILD +.RB ( waitpid () +¤« +.BR waitid () +¤Î¾ì¹ç) +.\"O The process specified by +.\"O .I pid +.\"O .RB ( waitpid ()) +.\"O or +.\"O .I idtype +.\"O and +.\"O .I id +.\"O .RB ( waitid ()) +.\"O does not exist or is not a child of the calling process. +.\"O (This can happen for one's own child if the action for +.\"O .B SIGCHLD +.\"O is set to +.\"O .BR SIG_IGN . +.\"O See also the \fILinux Notes\fP section about threads.) +.I pid +.RB ( waitpid ()) +¤« +.I idtype +¤È +.I id +.RB ( waitid ()) +¤Ç»ØÄꤷ¤¿¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Ç¤Ê¤¤ +.RB ( SIGCHLD +¤ÎÆ°ºî¤Ë +.B SIG_IGN +¤òÀßÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢¼«Ê¬¼«¿È¤Î»Ò¥×¥í¥»¥¹¤Ç¤âµ¯¤³¤ê¤¦¤ë¡£ +¥¹¥ì¥Ã¥É¤Ë´Ø¤·¤Æ¤Ï¡ÖLinux ¤Ç¤ÎÃí°Õ¡×¤ÎÀá¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EINTR +.\"O .B WNOHANG +.\"O was not set and an unblocked signal or a +.\"O .B SIGCHLD +.\"O was caught; see. +.\"O .BR signal (7). +.B WNOHANG +¤¬ÀßÄꤵ¤ì¤Æ¤ª¤é¤º¡¢¶Ø»ß (block) ¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤ä +.B SIGCHLD +¤ò¼õ¿®¤·¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.\"O The +.\"O .I options +.\"O argument was invalid. +.I options +°ú¤­¿ô¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O A child that terminates, but has not been waited for becomes a "zombie". +.\"O The kernel maintains a minimal set of information about the zombie +.\"O process (PID, termination status, resource usage information) +.\"O in order to allow the parent to later perform a wait to obtain +.\"O information about the child. +.\"O As long as a zombie is not removed from the system via a wait, +.\"O it will consume a slot in the kernel process table, and if +.\"O this table fills, it will not be possible to create further processes. +.\"O If a parent process terminates, then its "zombie" children (if any) +.\"O are adopted by +.\"O .BR init (8), +.\"O which automatically performs a wait to remove the zombies. +½ªÎ»¤·¤¿¤¬¡¢wait ¤µ¤ì¤Æ¤¤¤Ê¤¤»Ò¥×¥í¥»¥¹¤Ï¡Ö¥¾¥ó¥Ó¡×¤Ë¤Ê¤ë¡£ +¸å¤Ç¿Æ¥×¥í¥»¥¹¤¬ wait ¤ò¼Â¹Ô¤·¤Æ»Ò¥×¥í¥»¥¹¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¼èÆÀ¤Ç¤­¤ë¤è¤¦¤Ë¡¢ +¥«¡¼¥Í¥ë¤Ï¥¾¥ó¥Ó¥×¥í¥»¥¹¤Ë¤Ä¤¤¤ÆºÇ¾®¸Â¤Î¾ðÊó (PID¡¢½ªÎ»¥¹¥Æ¡¼¥¿¥¹¡¢ +¥ê¥½¡¼¥¹»ÈÍѾõ¶·) ¤òÊÝ»ý¤¹¤ë¡£ +¥¾¥ó¥Ó¥×¥í¥»¥¹¤Ï¡¢ wait ¤Ë¤è¤Ã¤Æ¥·¥¹¥Æ¥à¤«¤éºï½ü¤µ¤ì¤Ê¤¤¸Â¤ê¡¢ +¥«¡¼¥Í¥ë¤Î¥×¥í¥»¥¹¥Æ¡¼¥Ö¥ë¤Î 1 ¥¨¥ó¥È¥ê¤ò¾ÃÈñ¤¹¤ë¡£¤³¤Î¥×¥í¥»¥¹¥Æ¡¼¥Ö¥ë¤¬ +°ìÇդˤʤë¤È¡¢¿·¤¿¤Ë¥×¥í¥»¥¹¤òºî¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +¿Æ¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤È¡¢¤½¤Î¿Æ¥×¥í¥»¥¹¤Î¡Ö¥¾¥ó¥Ó¡×¤Î +»Ò¥×¥í¥»¥¹¤Ï (¤â¤·¤¢¤ì¤Ð) +.BR init (8) +¤ÎÍܻҤȤʤ롣 +.BR init (8) +¤Ï wait ¤ò¼«Æ°Åª¤Ë¼Â¹Ô¤·¡¢¥¾¥ó¥Ó¤òºï½ü¤¹¤ë¡£ + +.\"O POSIX.1-2001 specifies that if the disposition of +.\"O .B SIGCHLD +.\"O is set to +.\"O .B SIG_IGN +.\"O or the +.\"O .B SA_NOCLDWAIT +.\"O flag is set for +.\"O .B SIGCHLD +.\"O (see +.\"O .BR sigaction (2)), +.\"O then children that terminate do not become zombies and a call to +.\"O .BR wait () +.\"O or +.\"O .BR waitpid () +.\"O will block until all children have terminated, and then fail with +.\"O .I errno +.\"O set to +.\"O .BR ECHILD . +POSIX.1-2001 ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.B SIGCHLD +¤ÎÆ°ºî¤¬ +.B SIG_IGN +¤ËÀßÄꤵ¤ì¤¿¤«¡¢ +.B SIGCHLD +¤ËÂФ·¤Æ +.B SA_NOCLDWAIT +¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç +.RB ( sigaction (2) +»²¾È)¡¢½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤Ï¥¾¥ó¥Ó¤Ë¤Ï¤Ê¤é¤º¡¢ +.BR wait () +¤ä +.BR waitpid () +¤Î¸Æ¤Ó½Ð¤·¤ÏÁ´¤Æ¤Î»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤Þ¤ÇÄä»ß¤·¡¢ +»Ò¥×¥í¥»¥¹¤¬Á´Éô½ªÎ»¤·¤¿¸å +.I errno +¤Ë +.B ECHILD +¤òÀßÄꤷ¤Æ¼ºÇÔ¤¹¤ë¡£ +.\"O (The original POSIX standard left the behavior of setting +.\"O .B SIGCHLD +.\"O to +.\"O .B SIG_IGN +.\"O unspecified. +.\"O Note that even though the default disposition of +.\"O .B SIGCHLD +.\"O is "ignore", explicitly setting the disposition to +.\"O .B SIG_IGN +.\"O results in different treatment of zombie process children.) +(¤â¤È¤â¤È¤Î POSIX ɸ½à¤Ï +.B SIGCHLD +¤Ë +.B SIG_IGN +¤òÀßÄꤷ¤¿¾ì¹ç¤Î¿¶¤ëÉñ¤¤¤ò̤µ¬Äê¤Î¤Þ¤Þ¤Ë¤·¤Æ¤¤¤ë¡£ +.B SIGCHLD +¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤¬¡Ö̵»ë¡×¤Ç¤¢¤ë¤Ë¤â¤«¤«¤ï¤é¤º¡¢ +.B SIGCHLD +¤ÎÆ°ºî¤È¤·¤Æ +.B SIG_IGN +¤òÌÀ¼¨Åª¤ËÀßÄꤷ¤¿¾ì¹ç¤Ë¤Ï¥¾¥ó¥Ó¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î°·¤¤¤¬ +°Û¤Ê¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£) +.\"O Linux 2.6 conforms to this specification. +.\"O However, Linux 2.4 (and earlier) does not: +Linux 2.6 ¤Ï¤³¤Î»ÅÍͤ˽àµò¤·¤Æ¤¤¤ë¡£ +¤·¤«¤·¡¢Linux 2.4 (¤È¤½¤ì°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó) ¤Ï¤½¤¦¤Ç¤Ï¤Ê¤¤: +.\"O if a +.\"O .BR wait () +.\"O or +.\"O .BR waitpid () +.\"O call is made while +.\"O .B SIGCHLD +.\"O is being ignored, the call behaves just as though +.\"O .B SIGCHLD +.\"O were not being ignored, that is, the call blocks until the next child +.\"O terminates and then returns the process ID and status of that child. +.B SIGCHLD +¤¬Ìµ»ë¤µ¤ì¤ë¾õÂÖ¤Ç +.BR wait () +¤Þ¤¿¤Ï +.BR waitpid () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢ +.B SIGCHLD +¤¬Ìµ»ë¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¤Î¤è¤¦¤Ë¿¶¤ëÉñ¤¦¡£ +¤Ä¤Þ¤ê¡¢¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ¼¡¤Î»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤Þ¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¡¢ +½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤Î PID ¤È¾õÂÖ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SS Linux Notes +.SS Linux ¤Ç¤ÎÃí°Õ +.\"O In the Linux kernel, a kernel-scheduled thread is not a distinct +.\"O construct from a process. +.\"O Instead, a thread is simply a process +.\"O that is created using the Linux-unique +.\"O .BR clone (2) +.\"O system call; other routines such as the portable +.\"O .BR pthread_create (3) +.\"O call are implemented using +.\"O .BR clone (2); +.\"O they cannot be used with +.\"O .BR waitid (): +Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¥¹¥±¥¸¥å¡¼¥ë¤µ¤ì¤ë¥¹¥ì¥Ã¥É¤Ï +¥×¥í¥»¥¹¤ÈÌÀ³Î¤Ë¶èÊ̤Ǥ­¤ë¹½À®Í×ÁǤǤϤʤ¤¡£¥¹¥ì¥Ã¥É¤Ï Linux ¸ÇÍ­¤Î +.BR clone (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ÈÍѤ·¤ÆÀ¸À®¤µ¤ì¤ë¥×¥í¥»¥¹¤Ë²á¤®¤Ê¤¤¡£ +°Ü¿¢À­¤Î¤¢¤ë +.BR pthread_create (3) +¥³¡¼¥ë¤Î¤è¤¦¤Ê¾¤Î¥ë¡¼¥Á¥ó¤Ï +.BR clone (2) +¤ò»ÈÍѤ·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë; +¤³¤ì¤é¤Ç¤Ï +.BR waitid () +¤ò»È¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\"O Before Linux 2.4, a thread was just a special case of a process, +.\"O and as a consequence one thread could not wait on the children +.\"O of another thread, even when the latter belongs to the same thread group. +Linux 2.4 ¤è¤êÁ°¤Ç¤Ï¡¢¥¹¥ì¥Ã¥É¤Ïñ¤ËÆüì¤Ê¥×¥í¥»¥¹¤Ç¤¢¤Ã¤¿¤Î¤Ç¡¢ +Î㤨Ʊ¤¸¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Ç¤¢¤Ã¤Æ¤â¡¢ +¤¢¤ë¥¹¥ì¥Ã¥É¤¬Ê̤Υ¹¥ì¥Ã¥É¤Î»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤Î¤òÂԤĤ³¤È¤Ï½ÐÍè¤Ê¤«¤Ã¤¿¡£ +.\"O However, POSIX prescribes such functionality, and since Linux 2.4 +.\"O a thread can, and by default will, wait on children of other threads +.\"O in the same thread group. +¤·¤«¤·¡¢POSIX ¤Ç¤Ï¤³¤Î¤è¤¦¤Êµ¡Ç½¤òµ¬Äꤷ¤Æ¤ª¤ê¡¢ +Linux 2.4 °Ê¹ß¤Ç¤Ï¡¢¤¢¤ë¥¹¥ì¥Ã¥É¤¬Æ±¤¸¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Î¾¤Î¥¹¥ì¥Ã¥É¤Î +»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤Î¤òÂԤĤ³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +¤½¤·¤Æ¾­Íè¤Ï¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ë¤Ê¤ë¤Ç¤¢¤í¤¦¡£ +.LP +.\"O The following Linux-specific +.\"O .I options +.\"O are for use with children created using +.\"O .BR clone (2). +.BR clone (2) +¤òÍѤ¤¤Æºî¤é¤ì¤¿»Ò¥×¥í¥»¥¹¤Ë¤Ï¡¢°Ê²¼¤Î Linux ¸ÇÍ­¤Î +.I options +¤¬»ÈÍѤǤ­¤ë¡£ +.TP +.B __WCLONE +.\" since 0.99pl10 +.\"O Wait for "clone" children only. +.\"O If omitted then wait +.\"O for "non-clone" children only. +.\"O (A "clone" child is one +.\"O which delivers no signal, or a signal other than +.\"O .B SIGCHLD +.\"O to its parent upon termination.) +"clone" ¤Ê»Ò¥×¥í¥»¥¹¤À¤±¤òÂԤġ£ +»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤ÏÈó "clone" ¤Ê»Ò¥×¥í¥»¥¹¤À¤±¤òÂÔ¤Ä +("clone" ¤Ê»Ò¥×¥í¥»¥¹¤Ï¡¢½ªÎ»»þ¤Ë¿Æ¥×¥í¥»¥¹¤ØÁ´¤¯¥·¥°¥Ê¥ë¤òÁ÷¤é¤Ê¤¤¤«¡¢ +.B SIGCHLD +°Ê³°¤Î¥·¥°¥Ê¥ë¤òÁ÷¤ë)¡£ +.\"O This option is ignored if +.\"O .B __WALL +.\"O is also specified. +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B __WALL +¤â»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.\"O .BR __WALL " (since Linux 2.4)" +.BR __WALL " (Linux 2.4 °Ê¹ß)" +.\" since patch-2.3.48 +.\"O Wait for all children, regardless of +.\"O type ("clone" or "non-clone"). +"clone" ¤Ç¤¢¤ë¤«¤Ê¤¤¤«¤Ë´Ø¤ï¤é¤º¡¢ +Á´¤Æ¤Î»Ò¥×¥í¥»¥¹¤òÂԤġ£ +.TP +.\"O .BR __WNOTHREAD " (since Linux 2.4)" +.BR __WNOTHREAD " (Linux 2.4 °Ê¹ß)" +.\" since patch-2.4.0-test8 +.\"O Do not wait for children of other threads in +.\"O the same thread group. +.\"O This was the default before Linux 2.4. +Ʊ¤¸¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Î¾¤Î¥¹¥ì¥Ã¥É¤Î»Ò¥×¥í¥»¥¹¤ÏÂÔ¤¿¤Ê¤¤¡£ +Linux 2.4 ¤è¤êÁ°¤Ç¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤¢¤Ã¤¿¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O .\" fork.2 refers to this example program. +.\" fork.2 ¤â¤³¤Î¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.\"O The following program demonstrates the use of +.\"O .BR fork (2) +.\"O and +.\"O .BR waitpid (). +.\"O The program creates a child process. +.\"O If no command-line argument is supplied to the program, +.\"O then the child suspends its execution using +.\"O .BR pause (2), +.\"O to allow the user to send signals to the child. +.\"O Otherwise, if a command-line argument is supplied, +.\"O then the child exits immediately, +.\"O using the integer supplied on the command line as the exit status. +.\"O The parent process executes a loop that monitors the child using +.\"O .BR waitpid (), +.\"O and uses the W*() macros described above to analyze the wait status value. +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +.BR fork (2) +¤È +.BR waitpid () +¤Î»ÈÍÑÊýË¡¤ÎÎã¤ò¼¨¤·¤Æ¤¤¤ë¡£ +¤³¤Î¥×¥í¥°¥é¥à¤Ç¤Ï»Ò¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¡£ +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¤È¤­¤Ï¡¢ +»Ò¥×¥í¥»¥¹¤Ï +.BR pause (2) +¤ò»È¤Ã¤Æ¤½¤Î¼Â¹Ô¤ò°ì»þÄä»ß¤·¡¢¥æ¡¼¥¶¤¬¤½¤Î»Ò¥×¥í¥»¥¹¤Ë +¥·¥°¥Ê¥ë¤òÁ÷¿®¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +»Ò¥×¥í¥»¥¹¤Ïľ¤Á¤Ë½ªÎ»¤·¡¢ +¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç»ØÄꤵ¤ì¤¿À°¿ô¤ò½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤È¤·¤Æ»ÈÍѤ¹¤ë¡£ +¿Æ¥×¥í¥»¥¹¤Ï¡¢ +.BR waitpid () +¤ò»È¤Ã¤Æ»Ò¥×¥í¥»¥¹¤ò´Æ»ë¤·¡¢ +wait ¤Î¥¹¥Æ¡¼¥¿¥¹Ãͤò¾åµ­¤Î W*() ¥Þ¥¯¥í¤ò»È¤Ã¤Æ²òÀϤ¹¤ë¤È¤¤¤¦ +¥ë¡¼¥×¤ò¼Â¹Ô¤¹¤ë¡£ + +.\"O The following shell session demonstrates the use of the program: +²¼µ­¤Î¤Î¥·¥§¥ë¡¦¥»¥Ã¥·¥ç¥ó¤Ï¥×¥í¥°¥é¥à¤Î¼Â¹ÔÎã¤Ç¤¢¤ë: +.in +4n +.nf + +.RB "$" " ./a.out &" +Child PID is 32360 +[1] 32359 +.RB "$" " kill \-STOP 32360" +stopped by signal 19 +.RB "$" " kill \-CONT 32360" +continued +.RB "$" " kill \-TERM 32360" +killed by signal 15 +[1]+ Done ./a.out +$ +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + pid_t cpid, w; + int status; + + cpid = fork(); + if (cpid == \-1) { + perror("fork"); + exit(EXIT_FAILURE); + } + + if (cpid == 0) { /* Code executed by child */ + printf("Child PID is %ld\\n", (long) getpid()); + if (argc == 1) + pause(); /* Wait for signals */ + _exit(atoi(argv[1])); + + } else { /* Code executed by parent */ + do { + w = waitpid(cpid, &status, WUNTRACED | WCONTINUED); + if (w == \-1) { + perror("waitpid"); + exit(EXIT_FAILURE); + } + + if (WIFEXITED(status)) { + printf("exited, status=%d\\n", WEXITSTATUS(status)); + } else if (WIFSIGNALED(status)) { + printf("killed by signal %d\\n", WTERMSIG(status)); + } else if (WIFSTOPPED(status)) { + printf("stopped by signal %d\\n", WSTOPSIG(status)); + } else if (WIFCONTINUED(status)) { + printf("continued\\n"); + } + } while (!WIFEXITED(status) && !WIFSIGNALED(status)); + exit(EXIT_SUCCESS); + } +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR _exit (2), +.BR clone (2), +.BR fork (2), +.BR kill (2), +.BR ptrace (2), +.BR sigaction (2), +.BR signal (2), +.BR wait4 (2), +.BR pthread_create (3), +.BR credentials (7), +.BR signal (7) diff --git a/draft/man2/wait4.2 b/draft/man2/wait4.2 new file mode 100644 index 00000000..7accc679 --- /dev/null +++ b/draft/man2/wait4.2 @@ -0,0 +1,246 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" and Copyright (c) 2004 by Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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 13:32:44 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon Jun 23 14:09:52 1997 by aeb - add EINTR. +.\" Modified Tue Jul 7 12:26:42 1998 by aeb - changed return value wait3 +.\" Modified 2004-11-11, Michael Kerrisk +.\" Rewrote much of this page, and removed much duplicated text, +.\" replacing with pointers to wait.2 +.\" +.\" Japanese Version Copyright (c) 1997,1998 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-03-04, HANATAKA Shinya +.\" Modified 1997-09-28, HANATAKA Shinya +.\" Modified 2001-08-17, HANATAKA Shinya +.\" Updated 2001-12-13, Kentaro Shirakata +.\" Updated 2003-09-12, Kentaro Shirakata +.\" Updated 2005-03-04, Akihiro MOTOKI +.\" +.\"WORD: signal handling ¥·¥°¥Ê¥ë½èÍý +.\"WORD: suspend Ää»ß(suspend) +.\"WORD: zombie ¥¾¥ó¥Ó(zombie) +.\"WORD: child process »Ò¥×¥í¥»¥¹ +.\"WORD: process group ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× +.\"WORD: process group ID ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×ID +.\"WORD: stop Ää»ß(stop) +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: block ¶Ø»ß(block) +.\"WORD: catch Êá³Í(catch) +.\"WORD: account ¥¢¥«¥¦¥ó¥È +.\" +.TH WAIT4 2 2008-09-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wait3, wait4 \- wait for process to change state, BSD style +wait3, wait4 \- BSD ¥¹¥¿¥¤¥ë¤Ç¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤òÂÔ¤Ä +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.B #include +.sp +.BI "pid_t wait3(int *" "status" ", int " options , +.BI " struct rusage *" rusage ); +.sp +.BI "pid_t wait4(pid_t " pid ", int *" status ", int " options , +.BI " struct rusage *" rusage ); +.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 wait3 (): +_BSD_SOURCE +.br +.BR wait4 (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wait3 () +.\"O and +.\"O .BR wait4 () +.\"O system calls are similar to +.\"O .BR waitpid (2), +.\"O but additionally return resource usage information about the +.\"O child in the structure pointed to by +.\"O .IR rusage . +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR wait3 () +¤È +.BR wait4 () +¤Ï +.BR waitpid (2) +¤ÈƱÍͤÎÆ°ºî¤ò¤¹¤ë¡£¤½¤ì¤Ë²Ã¤¨¡¢»Ò¥×¥í¥»¥¹¤Î¥ê¥½¡¼¥¹»ÈÍѾõ¶·¤Î¾ðÊó¤ò +.I rusage +¤¬»Ø¤¹¹½Â¤ÂΤËÆþ¤ì¤ÆÊÖ¤¹¡£ +.PP +.\"O Other than the use of the +.\"O .I rusage +.\"O argument, the following +.\"O .BR wait3 () +.\"O call: +.\"O .nf +.\"O +.\"O wait3(status, options, rusage); +.\"O +.\"O .fi +.\"O is equivalent to: +.\"O .nf +.\"O +.\"O waitpid(\-1, status, options); +.\"O +.\"O .fi +.I rusage +¤ò»ÈÍѤ¹¤ëÅÀ¤ò½ü¤±¤Ð¡¢°Ê²¼¤Î 2¤Ä¤ÏÅù²Á¤Ç¤¢¤ë¡£ +.nf + + wait3(status, options, rusage); + + waitpid(\-1, status, options); + +.fi +.\"O Similarly, the following +.\"O .BR wait4 () +.\"O call: +.\"O .nf +.\"O +.\"O wait4(pid, status, options, rusage); +.\"O +.\"O .fi +.\"O is equivalent to: +.\"O .nf +.\"O +.\"O waitpid(pid, status, options); +.\"O +.\"O .fi +ƱÍͤˡ¢°Ê²¼¤Î 2¤Ä¤âÅù²Á¤Ç¤¢¤ë¡£ +.nf + + wait4(pid, status, options, rusage); + + waitpid(pid, status, options); + +.fi +.\"O In other words, +.\"O .BR wait3 () +.\"O waits of any child, while +.\"O .BR wait4 () +.\"O can be used to select a specific child, or children, on which to wait. +.\"O See +.\"O .BR wait (2) +.\"O for further details. +¸À¤¤´¹¤¨¤ë¤È¡¢ +.BR wait3 () +¤ÏÁ´¤Æ¤Î»Ò¥×¥í¥»¥¹¤òÂоݤËÂԤĤ¬¡¢ +.BR wait4 () +¤Ç¤ÏÆÃÄê¤Î»Ò¥×¥í¥»¥¹ (Ê£¿ô²Ä) ¤òÁª¤ó¤ÇÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O If +.\"O .I rusage +.\"O is not NULL, the +.\"O .I struct rusage +.\"O to which it points will be filled with accounting information +.\"O about the child. +.\"O See +.\"O .BR getrusage (2) +.\"O for details. +.I rusage +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I rusage +¤¬»Ø¤¹ +.I rusage ¹½Â¤ÂÎ +¤Ë¤Ï»Ò¥×¥í¥»¥¹¤Î¥¢¥«¥¦¥ó¥È¾ðÊ󤬳ÊǼ¤µ¤ì¤ë¡£ +¾Ü¤·¤¯¤Ï +.BR getrusage (2) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O As for +.\"O .BR waitpid (2). +.BR waitpid (2) +¤ÈƱÍÍ¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O As for +.\"O .BR waitpid (2). +.BR waitpid (2) +¤ÈƱÍÍ¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Including +.\"O .I +.\"O is not required these days, but increases portability. +.\"O (Indeed, +.\"O .I +.\"O defines the +.\"O .I rusage +.\"O structure with fields of type +.\"O .I struct timeval +.\"O defined in +.\"O .IR .) +¸½ºß¤Ç¤Ï +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëɬÍפϤʤ¤¤¬¡¢¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ¤ª¤¯¤È +°Ü¿¢À­¤ò¹â¤á¤ë¤³¤È¤¬¤Ç¤­¤ë (¼ÂºÝ¤Ë¤Ï +.I +¤Ç +.I rusage +¹½Â¤ÂΤ¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¤½¤Î¥Õ¥£¡¼¥ë¥É¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë +.I struct timeval +·¿¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ + +.\"O On Linux, +.\"O .BR wait3 () +.\"O is a library function implemented on top of the +.\"O .BR wait4 () +.\"O system call. +Linux ¤Ç¤Ï¡¢ +.BR wait3 () +¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤¢¤ê¡¢ +.BR wait4 () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fork (2), +.BR getrusage (2), +.BR sigaction (2), +.BR signal (2), +.BR wait (2), +.BR signal (7) diff --git a/draft/man2/write.2 b/draft/man2/write.2 new file mode 100644 index 00000000..d2f30bb0 --- /dev/null +++ b/draft/man2/write.2 @@ -0,0 +1,381 @@ +.\" 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 Sat Jul 24 13:35:59 1993 by Rik Faith +.\" Modified Sun Nov 28 17:19:01 1993 by Rik Faith +.\" Modified Sat Jan 13 12:58:08 1996 by Michael Haardt +.\" +.\" Modified Sun Jul 21 18:59:33 1996 by Andries Brouwer +.\" 2001-12-13 added remark by Zack Weinberg +.\" 2007-06-18 mtk: +.\" Added details about seekable files and file offset. +.\" Noted that write() may write less than 'count' bytes, and +.\" gave some examples of why this might occur. +.\" Noted what happens if write() is interrupted by a signal. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Tue Mar 4 00:18:20 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Wed Jun 13 20:57:55 JST 2001 +.\" by Yuichi SATO +.\" Updated Mon Jun 25 JST 2001 by Kentaro Shirakata +.\" Updated Fri Dec 21 JST 2001 by Kentaro Shirakata +.\" Updated 2002-09-24 by Akihiro MOTOKI +.\" Updated 2005-10-14 by Akihiro MOTOKI +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" Updated 2007-09-01, Akihiro MOTOKI, LDP v2.64 +.\" Updated 2008-04-13, Akihiro MOTOKI, LDP v3.20 +.\" +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡¡¼ +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: object ¥ª¥Ö¥¸¥§¥¯¥È +.\"WORD: pipe ¥Ñ¥¤¥× +.\"WORD: socket ¥½¥±¥Ã¥È +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: catch Êá³Í(catch) +.\"WORD: block Ää»ß(block) +.\"WORD: interrupt ³ä¤ê¹þ¤ß +.\"WORD: nonblocking I/O ÈóÄä»ß I/O +.\"WORD: device ¥Ç¥Ð¥¤¥¹ +.\"WORD: low-level I/O Äã¥ì¤Ù¥ë I/O +.\" +.TH WRITE 2 2009-02-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O write \- write to a file descriptor +write \- ¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿ (file descriptor) ¤Ë½ñ¤­¹þ¤à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "ssize_t write(int " fd ", const void *" buf ", size_t " count ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR write () +.\"O writes up to +.\"O .I count +.\"O bytes from the buffer pointed +.\"O .I buf +.\"O to the file referred to by the file descriptor +.\"O .IR fd . +.BR write () +¤Ï¡¢ +.I buf +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤«¤é¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤¬»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¤Ø¡¢ºÇÂç +.I count +¥Ð¥¤¥È¤ò½ñ¤­¹þ¤à¡£ + +.\"O The number of bytes written may be less than +.\"O .I count +.\"O if, for example, +.\"O there is insufficient space on the underlying physical medium, or the +.\"O .B RLIMIT_FSIZE +.\"O resource limit is encountered (see +.\"O .BR setrlimit (2)), +.\"O or the call was interrupted by a signal +.\"O handler after having written less than +.\"O .I count +.\"O bytes. +.\"O (See also +.\"O .BR pipe (7).) +½ñ¤­¹þ¤Þ¤ì¤ë¥Ð¥¤¥È¿ô¤Ï +.I count +¤è¤ê¤â¾®¤µ¤¯¤Ê¤ë¤³¤È¤¬¤¢¤ë¡£ +Î㤨¤Ð¡¢½ñ¤­¹þ¤ßÂоݤÎʪÍý¥á¥Ç¥£¥¢¤Ë½½Ê¬¤ÊÎΰ褬¤Ê¤¤¾ì¹ç¡¢ +¥ê¥½¡¼¥¹¾å¸Â +.B RLIMIT_FSIZE +¤Ë㤷¤¿¾ì¹ç +.RB ( setrlimit (2) +»²¾È)¡¢ +.I count +¥Ð¥¤¥È̤Ëþ¤Î½ñ¤­¹þ¤ß¤¬¹Ô¤ï¤ì¤¿¸å¤Ç +¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢ +¤Ê¤É¤Ç¤¢¤ë¡£ +.RB ( pipe (7) +¤â»²¾È¤Î¤³¤È¡£) + +.\"O For a seekable file (i.e., one to which +.\"O .BR lseek (2) +.\"O may be applied, for example, a regular file) +.\"O writing takes place at the current file offset, +.\"O and the file offset is incremented by +.\"O the number of bytes actually written. +.\"O If the file was +.\"O .BR open (2)ed +.\"O with +.\"O .BR O_APPEND , +.\"O the file offset is first set to the end of the file before writing. +.\"O The adjustment of the file offset and the write operation +.\"O are performed as an atomic step. +seek ²Äǽ¤Ê¥Õ¥¡¥¤¥ë (¤Ä¤Þ¤ê +.BR lseek (2) +¤¬Å¬ÍѤǤ­¤ë¥Õ¥¡¥¤¥ë¡¢Î㤨¤ÐÄ̾ï¤Î¥Õ¥¡¥¤¥ë) ¤Ç¤Ï¡¢ +½ñ¤­¹þ¤ß¤Ï¸½ºß¤Î¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤«¤é¹Ô¤ï¤ì¡¢ +¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤Ï¼ÂºÝ¤Ë½ñ¤­¹þ¤ß¤¬¹Ô¤ï¤ì¤¿¥Ð¥¤¥È¿ôʬ +²Ã»»¤µ¤ì¤ë¡£¥Õ¥¡¥¤¥ë¤¬ +.B O_APPEND +¤Ç +.BR open (2) +¤µ¤ì¤¿¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤Ï½ñ¤­¹þ¤ßÁ°¤Ë +¥Õ¥¡¥¤¥ë¤ÎËöÈø¤ËÀßÄꤵ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤ÎÄ´À°¤È½ñ¤­¹þ¤ßÁàºî¤Ï¥¢¥È¥ß¥Ã¥¯¤Ê½èÍý¤È¤·¤Æ +¼Â¹Ô¤µ¤ì¤ë¡£ + +.\"O POSIX requires that a +.\"O .BR read (2) +.\"O which can be proved to occur after a +.\"O .BR write () +.\"O has returned returns the new data. +.\"O Note that not all file systems are POSIX conforming. +POSIX ¤Ï +.BR write () +¤¬¹Ô¤Ê¤ï¤ì¤¿¸å¤Ë¼Â¹Ô¤·¤¿ +.BR read (2) +¤¬ +¿·¤·¤¤¥Ç¡¼¥¿¤òÊÖ¤¹¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬ POSIX ½àµò¤Ç¤Ï¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, the number of bytes written is returned (zero indicates +.\"O nothing was written). +.\"O On error, \-1 is returned, and \fIerrno\fP is set +.\"O appropriately. +À®¸ù¤·¤¿¾ì¹ç¡¢½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë +(¥¼¥í¤Ï²¿¤â½ñ¤­¹þ¤Þ¤ì¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤¹)¡£ +¥¨¥é¡¼¤Ê¤é¤Ð \-1 ¤¬ÊÖ¤µ¤ì¡¢\fIerrno\fP ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ + +.\"O If \fIcount\fP is zero and +.\"O .I fd +.\"O refers to a regular file, then +.\"O .BR write () +.\"O may return a failure status if one of the errors below is detected. +.\"O If no errors are detected, +.\"O 0 will be returned without causing any other effect. +.\"O If +.\"O \fIcount\fP is zero and +.\"O .I fd +.\"O refers to a file other than a regular file, +.\"O the results are not specified. +\fIcount\fP ¤¬ 0 ¤Ç¡¢ +.I fd +¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë (regular file) ¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR write () +¤Ï¸å½Ò¤Î¥¨¥é¡¼¤Î¤¤¤º¤ì¤«¤ò¸¡½Ð¤·¤¿¾ì¹ç¡¢¼ºÇÔ¤òÊÖ¤¹¤³¤È¤¬¤¢¤ë¡£ +¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +0 ¤òÊÖ¤·¡¢Â¾¤Ë²¿¤Î±Æ¶Á¤âÍ¿¤¨¤Ê¤¤¡£ +\fIcount\fP ¤¬ 0 ¤Ç¡¢ +.I fd +¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +¤½¤Î·ë²Ì¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.\"O The file descriptor +.\"O .I fd +.\"O refers to a file other than a socket and has been marked nonblocking +.\"O .RB ( O_NONBLOCK ), +.\"O and the write would block. +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤¬¥½¥±¥Ã¥È°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤Æ¡¢ +ÈóÄä»ß (nonblocking) ¥â¡¼¥É +.RB ( O_NONBLOCK ) +¤ËÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤ÈÄä»ß¤¹¤ë¾õ¶·¤Ë¤¢¤ë¡£ +.TP +.\"O .BR EAGAIN " or " EWOULDBLOCK +.BR EAGAIN " ¤Þ¤¿¤Ï " EWOULDBLOCK +.\" Actually EAGAIN on Linux +.\"O The file descriptor +.\"O .I fd +.\"O refers to a socket and has been marked nonblocking +.\"O .RB ( O_NONBLOCK ), +.\"O and the write 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. +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤¬¥½¥±¥Ã¥È¤ò»²¾È¤·¤Æ¤¤¤Æ¡¢ÈóÄä»ß (nonblocking) ¥â¡¼¥É +.RB ( O_NONBLOCK ) +¤ËÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤ÈÄä»ß¤¹¤ë¾õ¶·¤Ë¤¢¤ë¡£ +POSIX.1-2001 ¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¤É¤Á¤é¤Î¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤âǧ¤á¤Æ¤ª¤ê¡¢ +¤³¤ì¤é 2 ¤Ä¤ÎÄê¿ô¤¬Æ±¤¸Ãͤò»ý¤Ä¤³¤È¤âµá¤á¤Æ¤¤¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢Î¾Êý¤Î²ÄǽÀ­¤ò +³Îǧ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B EBADF +.\"O .I fd +.\"O is not a valid file descriptor or is not open for writing. +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¤«½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó +(open) ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +.\"O .I buf +.\"O is outside your accessible address space. +.I buf +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö (address space) ¤Î³°¤Ë¤¢¤ë¡£ +.TP +.B EFBIG +.\"O An attempt was made to write a file that exceeds the implementation-defined +.\"O maximum file size or the process's file size limit, +.\"O or to write at a position past the maximum allowed offset. +¼ÂÁõÄêµÁ¤ÎºÇÂç¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Þ¤¿¤Ï¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥µ¥¤¥ºÀ©¸Â¤ò +Ķ¤¨¤Æ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤â¤¦¤È¤·¤¿¡£ +¤Þ¤¿¤Ïµö²Ä¤µ¤ì¤¿¥ª¥Õ¥»¥Ã¥ÈÃͤ賦¤òĶ¤¨¤¿Àè¤Î°ÌÃÖ¤Ë +½ñ¤­¹þ¤â¤¦¤È¤·¤¿¡£ +.TP +.B EINTR +.\"O The call was interrupted by a signal before any data was written; see +.\"O .BR signal (7). +²¿¤Î¥Ç¡¼¥¿¤â½ñ¤«¤Ê¤¤´Ö¤Ë¥·¥°¥Ê¥ë¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿ (interrupt)¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.\"O .I fd +.\"O is attached to an object which is unsuitable for writing; +.\"O or the file was opened with the +.\"O .B O_DIRECT +.\"O flag, and either the address specified in +.\"O .IR buf , +.\"O the value specified in +.\"O .IR count , +.\"O or the current file offset is not suitably aligned. +.I fd +¤¬½ñ¤­¹þ¤ß¤¬ÉÔŬÀڤʥª¥Ö¥¸¥§¥¯¥È¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +¤â¤·¤¯¤Ï¡¢¥Õ¥¡¥¤¥ë¤¬ +.B O_DIRECT +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +.I buf +¤Ë»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¡¢ +.I count +¤Ë»ØÄꤵ¤ì¤¿ÃÍ¡¢ +¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Î¤¤¤º¤ì¤«¤Î +¥¢¥é¥¤¥ó¥á¥ó¥È¤¬ÉÔŬÀڤǤ¢¤ë¡£ +.TP +.B EIO +.\"O A low-level I/O error occurred while modifying the inode. +inode ¤Î½¤ÀµÃæ¤ËÄã¥ì¤Ù¥ë (low-level) I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ENOSPC +.\"O The device containing the file referred to by +.\"O .I fd +.\"O has no room for the data. +.I fd +¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Ç¥Ð¥¤¥¹ (device) ¤Ë½½Ê¬¤Ê¶õ¤­¤¬¤Ê¤¤¡£ +.TP +.B EPIPE +.\"O .I fd +.\"O is connected to a pipe or socket whose reading end is closed. +.\"O When this happens the writing process will also receive a +.\"O .B SIGPIPE +.\"O signal. +.\"O (Thus, the write return value is seen only if the program +.\"O catches, blocks or ignores this signal.) +.I fd +¤¬¥Ñ¥¤¥× (pipe) ¤«¥½¥±¥Ã¥È (socket) ¤ËÀܳ¤µ¤ì¤Æ¤ª¤ê¡¢ +¤½¤ÎÈ¿ÂЦ (Æɤ߹þ¤ß¦) ¤¬¥¯¥í¡¼¥º (close) ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤Ï¡¢½ñ¤­¹þ¤ß¤ò¹Ô¤Ê¤¦¥×¥í¥»¥¹¤Ï +.B SIGPIPE +¥·¥°¥Ê¥ë (signal)¤â¼õ¤±¤ë¡£ +(¤·¤¿¤¬¤Ã¤Æ¡¢¥×¥í¥°¥é¥à¤¬¤³¤Î¥·¥°¥Ê¥ë¤òÊá³Í (catch)¡¢Ää»ß (block)¡¢Ìµ»ë (ignore) +¤·¤¿¾ì¹ç¤Î¤ß¡¢write ¤ÎÊÖ¤êÃͤò»²¾È¤Ç¤­¤ë¡£) +.PP +.\"O Other errors may occur, depending on the object connected to +.\"O .IR fd . +.I fd +¤ËÀܳ¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤è¤Ã¤Æ¤Ï¡¢Â¾¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .\" SVr4 documents additional error +.\"O .\" conditions EDEADLK, ENOLCK, ENOLNK, ENOSR, ENXIO, or ERANGE. +.\" SVr4 ¤Ë¤Ï¾¤Ë EDEADLK, ENOLCK, ENOLNK, +.\" ENOSR, ENXIO, ERANGE ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ + +.\"O Under SVr4 a write may be interrupted and return +.\"O .B EINTR +.\"O at any point, +.\"O not just before any data is written. +SVr4 ¤Ç¤Ï write ¤¬³ä¤ê¹þ¤Þ¤ì¤ë¤È¡¢¥Ç¡¼¥¿¤¬½ñ¤­¹þ¤Þ¤ì¤ëľÁ°¤Ç¤Ï¤Ê¤¯¡¢ +¤½¤Î»þÅÀ¤Ç +.B EINTR +¤¬Ê֤롣 +.\"O .SH NOTES +.SH Ãí°Õ +.\"O A successful return from +.\"O .BR write () +.\"O does not make any guarantee that data has been committed to disk. +.BR write () +¤¬À®¸ù¤·¤ÆÊ֤äƤ­¤Æ¤â¡¢¥Ç¡¼¥¿¤¬¥Ç¥£¥¹¥¯¤Ëµ­Ï¿¤µ¤ì¤¿¤³¤È¤ò +Êݾڤ¹¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +.\"O In fact, on some buggy implementations, it does not even guarantee +.\"O that space has successfully been reserved for the data. +¼ÂºÝ¡¢¥Ç¡¼¥¿¤Î¤¿¤á¤Î¥¹¥Ú¡¼¥¹¤¬³ÎÊݤµ¤ì¤¿¤³¤È¤¹¤éÊݾڤµ¤ì¤Ê¤¤¤È¤¤¤¦ +¥Ð¥°¤Ã¤Ý¤¤¼ÂÁõ¤â¤¢¤ë¡£ +.\"O The only way to be sure is to call +.\"O .BR fsync (2) +.\"O after you are done writing all your data. +¤³¤ì¤ò³Î¼Â¤Ë¤¹¤ëÍ£°ì¤ÎÊýË¡¤Ï¡¢ +Á´¤Æ¤Î¥Ç¡¼¥¿¤ò write ¤·¤¿¸å¤Ë +.BR fsync (2) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¤¢¤ë¡£ + +.\"O If a +.\"O .BR write () +.\"O is interrupted by a signal handler before any bytes are written, +.\"O then the call fails with the error +.\"O .BR EINTR ; +.\"O if it is interrupted after at least one byte has been written, +.\"O the call succeeds, and returns the number of bytes written. +.BR write () +¤¬ 1 ¥Ð¥¤¥È¤â½ñ¤­¹þ¤Þ¤Ê¤¤¤¦¤Á¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢ +.BR write () +¤Ï¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¡£ +1¥Ð¥¤¥È¤Ç¤â½ñ¤­¹þ¤ó¤À¸å¤Ç³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +.BR write () +¤ÏÀ®¸ù¤·¡¢½ñ¤­¹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR fcntl (2), +.BR fsync (2), +.BR ioctl (2), +.BR lseek (2), +.BR open (2), +.BR pwrite (2), +.BR read (2), +.BR select (2), +.BR writev (2), +.BR fwrite (3) diff --git a/draft/man3/INFINITY.3 b/draft/man3/INFINITY.3 new file mode 100644 index 00000000..eaf014ba --- /dev/null +++ b/draft/man3/INFINITY.3 @@ -0,0 +1,147 @@ +.\" Copyright 2004 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) 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 +.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 +.B #define _ISOC99_SOURCE +.br +.B #include +.sp +.B INFINITY +.sp +.B NAN +.sp +.B HUGE_VAL +.br +.B HUGE_VALF +.br +.B HUGE_VALL +.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 ·¿¤ÎÄê¿ô¤ËŸ³«¤µ¤ì¤ë¡£ + +.\"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 ¤ò»²¾È¤¹¤ë¤³¤È¡£ + +.\"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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR fpclassify (3), +.BR feature_test_macros (7), +.BR math_error (7) diff --git a/draft/man3/MB_CUR_MAX.3 b/draft/man3/MB_CUR_MAX.3 new file mode 100644 index 00000000..a75c6ad6 --- /dev/null +++ b/draft/man3/MB_CUR_MAX.3 @@ -0,0 +1,63 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" 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 +.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 +.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 +¥Þ¥¯¥í¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Ç°ì¤Ä¤Î¥ï¥¤¥Éʸ»ú¤òɽ¸½¤¹¤ë¤¿¤á¤ËɬÍ×¤Ê +ºÇÂç¥Ð¥¤¥È¿ô¤òɽ¤¹À°¿ôɽ¸½¤òÄêµÁ¤¹¤ë¡£ +¤³¤ì¤Ï¥í¥±¡¼¥ë°Í¸¤Ç¤¢¤ê¡¢¥³¥ó¥Ñ¥¤¥ë»þ¤Ë·è¤Þ¤ëÄê¿ô¤Ç¤Ï¤Ê¤¤¡£ +.\"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" +.SH ½àµò +C99, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR MB_LEN_MAX (3), +.BR mblen (3), +.BR mbstowcs (3), +.BR mbtowc (3), +.BR wcstombs (3), +.BR wctomb (3) diff --git a/draft/man3/MB_LEN_MAX.3 b/draft/man3/MB_LEN_MAX.3 new file mode 100644 index 00000000..714bc8de --- /dev/null +++ b/draft/man3/MB_LEN_MAX.3 @@ -0,0 +1,70 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" Modified, aeb, 990824 +.\" +.\" Japanese Version Copyright (c) 1999 HAYAKAWA Hitoshi +.\" all rights reserved. +.\" Translated Sep 11, 1999 HAYAKAWA Hitoshi +.\" +.\"WORD: locale ¥í¥±¡¼¥ë +.\" +.TH MB_LEN_MAX 3 1999-07-04 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O MB_LEN_MAX \- maximum multibyte length of a character across all locales +MB_LEN_MAX \- Á´¤Æ¤Î¥í¥±¡¼¥ë¤Ç¤Î£±Ê¸»ú¤ÎºÇÂç¥Þ¥ë¥Á¥Ð¥¤¥ÈĹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.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" +.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. +.SH Ãí°Õ +.B MB_LEN_MAX +¤È +.I sizeof(wchar_t) +¤ÎÃͤˤϤʤó¤Î´Ø·¸¤â¤Ê¤¤¡£ +glibc ¤Ç¤Ï +.B MB_LEN_MAX +¤ÏÄ̾ï¤Ï 6 ¤Ç¡¢ +.I sizeof(wchar_t) +¤Ï 4 ¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR MB_CUR_MAX (3) diff --git a/draft/man3/__setfpucw.3 b/draft/man3/__setfpucw.3 new file mode 100644 index 00000000..78a6f800 --- /dev/null +++ b/draft/man3/__setfpucw.3 @@ -0,0 +1,119 @@ +.\" Written Sat Mar 8 10:35:08 MEZ 1997 by +.\" J. "MUFTI" Scheurich (mufti@csv.ica.uni-stuttgart.de) +.\" This page is licensed under the GNU General Public License +.\" +.\" Japanese Version Copyright (c) 1998-2000 ISHIOKA Takashi and NAKANO Takeo +.\" all rights reserved. +.\" Translated Mon May 25 10:45:50 1998 +.\" by ISHIOKA Takashi +.\" Updated Wed Sep 20 2000 by NAKANO Takeo +.\" +.\"WORD: (floating-point) exception (ÉâÆ°¾®¿ôÅÀ) Îã³° +.\"WORD: rounding ´Ý¤á +.\" +.TH __SETFPUCW 3 1997-03-08 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O __setfpucw \- set FPU control word on i386 architecture (obsolete) +__setfpucw \- i386 ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤±¤ë FPU +¤Î¥³¥ó¥È¥í¡¼¥ë¥ï¡¼¥É¤ÎÀßÄê (obsolete) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "void __setfpucw(unsigned short " control_word ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR __setfpucw () +.\"O transfers +.\"O .I control_word +.\"O to the registers of the FPU (floating-point unit) on the i386 architecture. +.\"O This was used to control floating-point precision, +.\"O rounding and floating-point exceptions. +.BR __setfpucw () +¤Ï¡¢i386¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤¤¤Æ +.I control_word +¤ò FPU (floating-point unit) ¤Î¥ì¥¸¥¹¥¿¤ËžÁ÷¤¹¤ë¡£ +¤³¤ì¤ÏÉâÆ°¾®¿ôÅÀ±é»»¤ÎÀºÅÙ¡¢´Ý¤áÊý¡¢ +¤ª¤è¤ÓÉâÆ°¾®¿ôÅÀÎã³°¤òÀ©¸æ¤¹¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O This function was a nonstandard GNU extension. +¤³¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O As of glibc 2.1 this function does not exist anymore. +.\"O There are new functions from C99, with prototypes in +.\"O .IR , +.\"O to control FPU rounding modes, like +.\"O .IR fegetround , +.\"O .IR fesetround , +.\"O and the floating-point environment, like +.\"O .IR fegetenv , +.\"O .IR feholdexcept , +.\"O .IR fesetenv , +.\"O .I feupdateenv +.\"O and FPU exception handling, like +.\"O .IR feclearexcept , +.\"O .IR fegetexceptflag , +.\"O .IR feraiseexcept , +.\"O .IR fesetexceptflag , +.\"O .IR fetestexcept . +glibc 2.1 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ï¸ºß¤·¤Ê¤¤¡£ +¿·¤¿¤Ê´Ø¿ô·²¤¬ C99 ¤«¤éƳÆþ¤µ¤ì¤¿¡£¤³¤ì¤é¤Î¥×¥í¥È¥¿¥¤¥×¤Ï +.I +¤ËÃÖ¤«¤ì¤Æ¤¤¤ë¡£ FPU ¤Î´Ý¤á¥â¡¼¥É¤ÎÀ©¸æ¤Ë¤Ï +.IR fegetround , +.I fesetround +¤Ê¤É¤¬¡¢ÉâÆ°¾®¿ôÅÀ´ØÏ¢¤Î´Ä¶­¤Ë¤Ï +.IR fegetenv , +.IR feholdexcept , +.IR fesetenv , +.I feupdateenv +¤Ê¤É¤¬¡¢ FPU Îã³°½èÍý¤Ë¤Ï +.IR feclearexcept , +.IR fegetexceptflag , +.IR feraiseexcept , +.IR fesetexceptflag , +.I fetestexcept +¤Ê¤É¤¬Æ³Æþ¤µ¤ì¤¿¡£ +.PP +.\"O If direct access to the FPU control word is still needed, the +.\"O .B _FPU_GETCW +.\"O and +.\"O .B _FPU_SETCW +.\"O macros from +.\"O .I +.\"O can be used. +FPU ¤Î¥³¥ó¥È¥í¡¼¥ë¥ï¡¼¥É¤Ø¤É¤¦¤·¤Æ¤âľÀÜ¥¢¥¯¥»¥¹¤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢ +.I +¤Î +.B _FPU_GETCW +¥Þ¥¯¥í¤È +.B _FPU_SETCW +¥Þ¥¯¥í¤òÍѤ¤¤ë¤³¤È¤Ï²Äǽ¤Ç¤¢¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.B __setfpucw(0x1372) + +.\"O Set FPU control word on the i386 architecture to +.\"O .br +.\"O \- extended precision +.\"O .br +.\"O \- rounding to nearest +.\"O .br +.\"O \- exceptions on overflow, zero divide and NaN +¤Ï¡¢i386¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤±¤ë FPU ¤Î¥³¥ó¥È¥í¡¼¥ë¥ï¡¼¥É¤ò¡¢ +.br + \- ³ÈÄ¥ÀºÅÙ +.br + \- ºÇ¤â¶á¤¤À°¿ô¤Ø´Ý¤á¤ë¡¢Ãæ´Ö¤Î¾ì¹ç¤Ï¶ö¿ô¤òÁªÂò¤¹¤ë¡£ +.br + \- ·å°î¤ì¡¢0¤Ç½ü»»¡¢µÚ¤Ó̵¸úÃÍ(NaN)¤È¤­¤ËÎã³°¤òȯÀ¸ +.br +¤ËÀßÄꤹ¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR feclearexcept (3) +.br +.I diff --git a/draft/man3/a64l.3 b/draft/man3/a64l.3 new file mode 100644 index 00000000..dde18a9d --- /dev/null +++ b/draft/man3/a64l.3 @@ -0,0 +1,131 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" 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 Éä¹æ³ÈÄ¥ +.\" +.TH A64L 3 2007-07-26 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O a64l, l64a \- convert between long and base-64 +a64l, l64a \- long ¤È base-64 ¤òÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "long a64l(char *" str64 ); +.sp +.BI "char *l64a(long " value ); +.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 a64l (), +.BR l64a (): +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"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) ¤¹¤ë¡£ +.LP +.\"O The 64 digits in the base-64 system are: +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 ¤òɽ¤¹¡£ + +.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 +.SH Ãí°Õ +.\"O The value returned by +.\"O .BR a64l () +.\"O may be a pointer to a static buffer, possibly overwritten +.\"O by later calls. +.BR a64l () +¤ÇÊÖ¤µ¤ì¤ëÃͤÏÀÅŪ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç¡¢ +°Ê¹ß¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.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 ¤Î¾ì¹ç¤Ï¶õʸ»úÎó¤òÊÖ¤¹¡£ +.LP +.\"O These functions are broken in glibc before 2.2.5 +.\"O (puts most significant digit first). +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc 2.2.5 °ÊÁ°¤Ç¤Ï´Ö°ã¤Ã¤Æ¤¤¤ë +(ºÇ¾å°Ì¥Ç¥¸¥Ã¥È¤òºÇ½é¤Ë¤·¤Æ¤¤¤ë)¡£ +.LP +.\"O This is not the encoding used by +.\"O .BR uuencode (1). +¤³¤ì¤Ï +.BR uuencode (1) +¤Ç»È¤ï¤ì¤ë¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR uuencode (1), +.\" .BR itoa (3), +.BR strtoul (3) diff --git a/draft/man3/abort.3 b/draft/man3/abort.3 new file mode 100644 index 00000000..f98b36e2 --- /dev/null +++ b/draft/man3/abort.3 @@ -0,0 +1,114 @@ +.\" Copyright 2007 (C) Michael Kerrisk +.\" some parts 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 Sat Jul 24 21:46:21 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Aug 4 10:51:53 2000 - patch from Joseph S. Myers +.\" 2007-12-15, mtk, Mostly rewritten +.\" +.\" Japanese Version Copyright (c) 1996 Kentaro OGAWA +.\" all rights reserved. +.\" Translated 1996-07-13, Kentaro OGAWA +.\" Updated 2008-02-09, Akihiro MOTOKI +.\" +.TH ABORT 3 2007-12-15 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O abort \- cause abnormal process termination +abort \- ¥×¥í¥»¥¹¤Î°Û¾ï½ªÎ»¤òÀ¸¤¸¤µ¤»¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B void abort(void); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR abort () +.\"O first unblocks the +.\"O .B SIGABRT +.\"O signal, and then raises that signal for the calling process. +.\"O This results in the abnormal termination of the process unless the +.\"O .B SIGABRT +.\"O signal is caught and the signal handler does not return +.\"O (see +.\"O .BR longjmp (3)). +.BR abort () +´Ø¿ô¤Ï¡¢¤Þ¤º +.B SIGABRT +¤Î¶Ø»ß (block) ¤ò²ò½ü¤·¤Æ¤«¤é¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë +.B SIGABRT +¥·¥°¥Ê¥ë¤ò¾å¤²¤ë¡£¤½¤Î·ë²Ì¡¢ +.B SIGABRT +¥·¥°¥Ê¥ë¤¬¤òÊ᪠(caught) ¤µ¤ì¤Æ¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¡¼¤¬Ê֤äÆÍè¤Ê¤¤ +¾ì¹ç¤ò½ü¤¤¤Æ¡¢¥×¥í¥°¥é¥à¤Î°Û¾ï½ªÎ»¤¬µ¯¤³¤ë +.RB ( longjmp (3) +»²¾È)¡£ +.PP +.\"O If the +.\"O .BR abort () +.\"O function causes process termination, +.\"O all open streams are closed and flushed. +.BR abort () +´Ø¿ô¤Ë¤è¤Ã¤Æ¥×¥í¥»¥¹¤Î½ªÎ»¤¬°ú¤­µ¯¤³¤µ¤ì¤¿¤È¤­¤Ë¤Ï¡¢ +¤¹¤Ù¤Æ¤Î³«¤¤¤Æ¤¤¤ë¥¹¥È¥ê¡¼¥à¤ÏÊĤ¸¤é¤ì¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë¡£ +.PP +.\"O If the +.\"O .B SIGABRT +.\"O signal is ignored, or caught by a handler that returns, the +.\"O .BR abort () +.\"O function will still terminate the process. +.\"O It does this by restoring the default disposition for +.\"O .B SIGABRT +.\"O and then raising the signal for a second time. +.B SIGABRT +¥·¥°¥Ê¥ë¤¬Ìµ»ë¡¢¤Þ¤¿¤ÏÊ֤äÆÍè¤ë¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¡¼¤Ç +Ê᪤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢ +.BR abort () +´Ø¿ô¤Ï¤½¤Î¥×¥í¥»¥¹¤ò½ªÎ»¤¹¤ë¡£ +.B SIGABRT +¥·¥°¥Ê¥ë¤ËÂФ¹¤ë½èÍýÊýË¡¤ò¥Ç¥Õ¥©¥ë¥È¤ËÌᤷ¤Æ¤«¤é¡¢ºÆÅÙ +.B SIGABRT +¥·¥°¥Ê¥ë¤ò¾å¤²¤ë¤³¤È¤Ç¡¢¤³¤Î¤è¤¦¤ÊÆ°ºî¤Ë¤Ê¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR abort () +.\"O function never returns. +.BR abort () +´Ø¿ô¤Ï¡¢²¿¤âÊÖ¤µ¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD, C89, C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR gdb (1), +.BR sigaction (2), +.BR exit (3), +.BR longjmp (3), +.BR raise (3) diff --git a/draft/man3/abs.3 b/draft/man3/abs.3 new file mode 100644 index 00000000..85c66774 --- /dev/null +++ b/draft/man3/abs.3 @@ -0,0 +1,173 @@ +.\" 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 Mon Mar 29 22:31:13 1993, David Metcalfe +.\" Modified Sun Jun 6 23:27:50 1993, David Metcalfe +.\" 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 2007-07-26 "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 +.sp +.BI "int abs(int " j ); +.br +.BI "long int labs(long int " j ); +.br +.BI "long long int llabs(long long int " j ); +.sp +.B #include +.sp +.BI "intmax_t imaxabs(intmax_t " j ); +.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 llabs (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; ¤Þ¤¿¤Ï +.I cc\ -std=c99 +.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 ¤ÎÀäÂÐÃͤò·×»»¤¹¤ë¡£ +.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 ǯÈÇ) ¤Ï +.\" .BR abs () +.\" ´Ø¿ô¤Î¤ß¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +C89 ¤Ï +.BR abs () +´Ø¿ô¤È +.BR labs () +´Ø¿ô¤Î¤ß¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +.BR llabs () +´Ø¿ô¤È +.BR imaxabs () +´Ø¿ô¤Ï 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 ¤Ë´Þ¤Þ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +.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 ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +.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 () +¤â¥Ó¥ë¥É¥¤¥ó¤È¤·¤Æ°·¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR ceil (3), +.BR fabs (3), +.BR floor (3), +.BR rint (3) diff --git a/draft/man3/acos.3 b/draft/man3/acos.3 new file mode 100644 index 00000000..20a26e4d --- /dev/null +++ b/draft/man3/acos.3 @@ -0,0 +1,168 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O acos, acosf, acosl \- arc cosine function +acos, acosf, acosl \- µÕ;¸¹¡Êarc cosine¡Ë´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double acos(double " x ); +.BI "float acosf(float " x ); +.BI "long double acosl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR acosf (), +.BR acosl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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" +.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] ¤ÎÈϰϤȤʤ롣 + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is +1, +.\"O +0 is returned. +.I x +¤¬ +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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is outside the range [\-1,\ 1] +Îΰ襨¥é¡¼ (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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR asin (3), +.BR atan (3), +.BR atan2 (3), +.BR cacos (3), +.BR cos (3), +.BR sin (3), +.BR tan (3) diff --git a/draft/man3/acosh.3 b/draft/man3/acosh.3 new file mode 100644 index 00000000..f76b3cf6 --- /dev/null +++ b/draft/man3/acosh.3 @@ -0,0 +1,169 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O acosh, acoshf, acoshl \- inverse hyperbolic cosine function +acosh, acoshf, acoshl \- µÕÁжÊÀþ;¸¹¡Êinverse hyperbolic cosine¡Ë´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double acosh(double " x ); +.br +.BI "float acoshf(float " x ); +.br +.BI "long double acoshl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR acosh (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR acoshf (), +.BR acoshl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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" +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the inverse hyperbolic cosine of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎµÕÁжÊÀþ;¸¹¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is +1, +0 is returned. +.I x +¤¬ +1 ¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is positive infinity, positive infinity is returned. +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is less than 1 +Îΰ襨¥é¡¼ (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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR asinh (3), +.BR atanh (3), +.BR cacosh (3), +.BR cosh (3), +.BR sinh (3), +.BR tanh (3) diff --git a/draft/man3/addseverity.3 b/draft/man3/addseverity.3 new file mode 100644 index 00000000..941d151e --- /dev/null +++ b/draft/man3/addseverity.3 @@ -0,0 +1,129 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" adapted glibc info page +.\" +.\" polished a little, aeb +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Thu Jul 1 01:12:35 JST 2004 +.\" by Yuichi SATO +.\" +.\"WORD: severity class ½ÅÂçÅÙ +.\" +.TH ADDSEVERITY 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O addseverity \- introduce new severity classes +addseverity \- ¿·¤·¤¤½ÅÂçÅÙ (severity class) ¤òƳÆþ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.sp +.B #include +.sp +.BI "int addseverity(int " severity ", const char *" s ); +.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 addseverity (): +_SVID_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This function allows the introduction of new severity classes +.\"O which can be addressed by the +.\"O .I severity +.\"O argument of the +.\"O .BR fmtmsg (3) +.\"O function. +.\"O By default that latter function only knows how to +.\"O print messages for severity 0-4 (with strings (none), HALT, +.\"O ERROR, WARNING, INFO). +.\"O This call attaches the given string +.\"O .I s +.\"O to the given value +.\"O .IR severity . +¤³¤Î´Ø¿ô¤Ë¤è¤ê¡¢¿·¤·¤¤½ÅÂçÅÙ¤òƳÆþ¤Ç¤­¤ë¡£ +¤³¤Î½ÅÂçÅ٤ϡ¢ +.BR fmtmsg (3) +´Ø¿ô¤Î +.I severity +°ú¤­¿ô¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¸å¼Ô¤Î +.BR fmtmsg (3) +´Ø¿ô¤Ï½ÅÂçÅÙ 0-4 (ʸ»úÎó¤Ç¤Ï (none), HALT, ERROR, WARNING, INFO) ¤Î +¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ëÊýË¡¤·¤«ÃΤé¤Ê¤¤¡£ +¤³¤Î +.BR addseverity (3) +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ê¡¢»ØÄꤵ¤ì¤¿Ê¸»úÎó +.I s +¤Ë»ØÄꤵ¤ì¤¿ÃÍ +.I severity +¤òÉղ乤롣 +.\"O If +.\"O .I s +.\"O is NULL, the severity class with the numeric value +.\"O .I severity +.\"O is removed. +.I s +¤¬ NULL ¤Î¾ì¹ç¡¢¿ôÃÍ +.I severity +¤Î½ÅÂçÅÙ¤¬ºï½ü¤µ¤ì¤ë¡£ +.\"O It is not possible to overwrite or remove one of the default +.\"O severity classes. +.\"O The severity value must be nonnegative. +¥Ç¥Õ¥©¥ë¥È¤Î½ÅÂçÅ٤Τɤ줫¤ò¾å½ñ¤­¤·¤¿¤êºï½ü¤·¤¿¤ê¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +½ÅÂçÅÙ¤ÎÃͤÏÉé¤Ç¤Ê¤¤¿ô¤È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O Upon success, the value +.\"O .B MM_OK +.\"O is returned. +.\"O Upon error, the return value is +.\"O .BR MM_NOTOK . +À®¸ù¤·¤¿¾ì¹ç¡¢ÃÍ +.B MM_OK +¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ÊÖ¤êÃÍ¤Ï +.B MM_NOTOK +¤Ç¤¢¤ë¡£ +.\"O Possible errors include: out of memory, attempt to remove a +.\"O nonexistent or default severity class. +µ¯¤³¤ë²ÄǽÀ­¤¬¤¢¤ë¥¨¥é¡¼¤Ë¤Ï¡¢°Ê²¼¤Î¤â¤Î¤¬´Þ¤Þ¤ì¤ë: +¥á¥â¥ê¤ò»È¤¤²Ì¤¿¤·¤¿¡£ +¸ºß¤·¤Ê¤¤½ÅÂçÅÙ¤Þ¤¿¤Ï¥Ç¥Õ¥©¥ë¥È¤Î½ÅÂçÅÙ¤òºï½ü¤·¤è¤¦¤È¤·¤¿¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR addseverity () +.\"O is provided in glibc since version 2.1. +.BR addseverity () +¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is not specified in the X/Open Portability Guide +.\"O although the +.\"O .BR fmtmsg (3) +.\"O function is. +.\"O It is available on System V +.\"O systems. +.BR fmtmsg (3) +´Ø¿ô¤Ï X/Open Portability Guide ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¤¬¡¢ +¤³¤Î´Ø¿ô¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤Ï System V ¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O New severity classes can also be added by setting the environment variable +.\"O .BR SEV_LEVEL . +¿·¤·¤¤½ÅÂçÅ٤ϡ¢´Ä¶­ÊÑ¿ô +.B SEV_LEVEL +¤òÀßÄꤹ¤ë¤³¤È¤ÇÄɲ乤뤳¤È¤â¤Ç¤­¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fmtmsg (3) diff --git a/draft/man3/adjtime.3 b/draft/man3/adjtime.3 new file mode 100644 index 00000000..18441d6d --- /dev/null +++ b/draft/man3/adjtime.3 @@ -0,0 +1,228 @@ +.\" Copyright (c) 2006 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. +.\" +.\" 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 +.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 ); +.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 adjtime (): +_BSD_SOURCE +.\"O .SH DESCRIPTION +.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 +¤¬»Ø¤¹¹½Â¤ÂΤǻØÄꤵ¤ì¤ë¡£ +¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î·Á¤Ç¤¢¤ë: +.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 +¤ÎÄ´À°Î̤¬Éé¤Î¾ì¹ç¡¢Æ±ÍͤÎÊýË¡¤Ç¥¯¥í¥Ã¥¯¤òÃÙ¤¯¤¹¤ë¡£ + +.\"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 ¤Ç¤Ê¤¤¾ì¹ç¡¢¼Â¹ÔÃæ¤ÎÄ´À°¤ÏÄä»ß¤µ¤ì¤ë¡£ +¤·¤«¤·¡¢¤¹¤Ç¤Ë¼Â¹Ô¤µ¤ì¤¿Ä´À°¤Î¼è¤ê¾Ã¤·¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ + +.\"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 +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë¡¢²áµî¤ÎÄ´À°Í×µá¤Ç¤Þ¤À´°Î»¤»¤º»Ä¤Ã¤Æ¤¤¤ë»þ´ÖÎ̤¬ +³ÊǼ¤·¤ÆÊÖ¤µ¤ì¤ë¡£ +.\"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 +.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 +.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) +¤Ê¤É) ¤Ëµ¯¤³¤ëÌäÂê¤òËɤ°¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR adjtimex (2), +.BR gettimeofday (2), +.BR time (7) diff --git a/draft/man3/aio_cancel.3 b/draft/man3/aio_cancel.3 new file mode 100644 index 00000000..8d77d82b --- /dev/null +++ b/draft/man3/aio_cancel.3 @@ -0,0 +1,148 @@ +.\" 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 new file mode 100644 index 00000000..8e2294b1 --- /dev/null +++ b/draft/man3/aio_error.3 @@ -0,0 +1,111 @@ +.\" 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 new file mode 100644 index 00000000..965d5a6f --- /dev/null +++ b/draft/man3/aio_fsync.3 @@ -0,0 +1,152 @@ +.\" 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 new file mode 100644 index 00000000..089ce571 --- /dev/null +++ b/draft/man3/aio_read.3 @@ -0,0 +1,202 @@ +.\" 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 new file mode 100644 index 00000000..ee94c0ad --- /dev/null +++ b/draft/man3/aio_return.3 @@ -0,0 +1,101 @@ +.\" 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 new file mode 100644 index 00000000..4bfc7b9c --- /dev/null +++ b/draft/man3/aio_suspend.3 @@ -0,0 +1,136 @@ +.\" 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 new file mode 100644 index 00000000..06c00c04 --- /dev/null +++ b/draft/man3/aio_write.3 @@ -0,0 +1,208 @@ +.\" 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 new file mode 100644 index 00000000..50b5cd98 --- /dev/null +++ b/draft/man3/alloca.3 @@ -0,0 +1,258 @@ +.\" Copyright (c) 1980, 1991 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. +.\" +.\" @(#)alloca.3 5.1 (Berkeley) 5/2/91 +.\" +.\" Converted Mon Nov 29 11:05:55 1993 by Rik Faith +.\" Modified Tue Oct 22 23:41:56 1996 by Eric S. Raymond +.\" Modified 2002-07-17, aeb +.\" 2008-01-24, mtk: +.\" 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 +.SH ̾Á° +.\"O alloca \- allocate memory that is automatically freed +alloca \- ¼«Æ°Åª¤Ë²òÊü¤µ¤ì¤ë¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "void *alloca(size_t " size ); +.\"O .SH DESCRIPTION +.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 () +¤ò¸Æ¤Ó½Ð¤·¤¿´Ø¿ô¤¬¸Æ½Ð¸µ¤ËÊÖ¤ë¤È¤­¤Ë¼«Æ°Åª¤Ë²òÊü¤µ¤ì¤ë¡£ +.\"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 () +´Ø¿ô¤Ï¡¢³ä¤êÉÕ¤±¤¿Îΰè¤Î»Ï¤Þ¤ê¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +³ä¤êÉÕ¤±¤Ë¤è¤Ã¤Æ¥¹¥¿¥Ã¥¯¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬µ¯¤Ã¤¿¾ì¹ç¤Î +¥×¥í¥°¥é¥à¤ÎÆ°ºî¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is not in 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 +.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) +¤ò»È¤¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Î¥á¥â¥ê¤Î³«Êü¤ò´Êñ¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Î»ÈÍѤϿ侩¤µ¤ì¤Ê¤¤¡£ + +.\"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) +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ê¥¸¥ã¥ó¥×¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +³ä¤êÅö¤Æ¤é¤ì¤¿¶õ´Ö¤Ï¼«Æ°Åª¤Ë²òÊü¤µ¤ì¤ë¡£ + +.\"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 +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ¤ª¤ê¡¢¤³¤ì¤Ë¤Ï°Ê²¼¤Î¹Ô¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤Î¤ÇÃí°Õ¤¹¤ë¤³¤È¡£ +.nf + + #define alloca(size) __builtin_alloca (size) + +.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 +.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 +¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¤³¤È¤À¤í¤¦¡£) + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR brk (2), +.BR longjmp (3), +.BR malloc (3) diff --git a/draft/man3/argz_add.3 b/draft/man3/argz_add.3 new file mode 100644 index 00000000..114e3944 --- /dev/null +++ b/draft/man3/argz_add.3 @@ -0,0 +1,357 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" based on the description in glibc source and infopages +.\" +.\" Corrections and additions, aeb +.\" +.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI, all rights reserved. +.\" Translated Mon Feb 2 2003 by Akihiro MOTOKI +.\" +.TH ARGZ_ADD 3 2007-05-18 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O argz_add, argz_add_sep, argz_append, argz_count, argz_create, +.\"O argz_create_sep, argz_delete, argz_extract, argz_insert, +.\"O argz_next, argz_replace, argz_stringify \- functions to handle an argz list +argz_add, argz_add_sep, argz_append, argz_count, argz_create, +argz_create_sep, argz_delete, argz_extract, argz_insert, +argz_next, argz_replace, argz_stringify \- argz ¥ê¥¹¥È¤òÁàºî¤¹¤ë¤¿¤á¤Î´Ø¿ô·² +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "error_t argz_add(char **" argz ", size_t *" argz_len \ +", const char *" str ); +.sp +.BI "error_t argz_add_sep(char **" argz ", size_t *" argz_len , +.ti 20n +.BI "const char *" str ", int " delim ); +.sp +.BI "error_t argz_append(char **" argz ", size_t *" argz_len , +.ti 20n +.BI "const char *" buf ", size_t " buf_len ); +.sp +.BI "size_t argz_count(const char *" argz ", size_t " argz_len ); +.sp +.BI "error_t argz_create(char * const " argv "[], char **" argz , +.ti 20n +.BI "size_t *" argz_len ); +.sp +.BI "error_t argz_create_sep(const char *" str ", int " sep ", char **" argz , +.ti 20n +.BI "size_t *" argz_len ); +.sp +.BI "error_t argz_delete(char **" argz ", size_t *" argz_len ", char *" entry ); +.sp +.BI "void argz_extract(char *" argz ", size_t " argz_len ", char **" argv ); +.sp +.BI "error_t argz_insert(char **" argz ", size_t *" argz_len ", char *" before , +.ti 20n +.BI "const char *" entry ); +.sp +.BI "char *argz_next(char *" argz ", size_t " argz_len ", const char *" entry ); +.sp +.BI "error_t argz_replace(char **" argz ", size_t *" argz_len \ +", const char *" str , +.ti 20n +.BI "const char *" with ", unsigned int *" replace_count ); +.sp +.BI "void argz_stringify(char *" argz ", size_t " len ", int " sep ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These functions are glibc-specific. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¸ÇÍ­¤Ç¤¢¤ë¡£ +.LP +.\"O An argz vector is a pointer to a character buffer together with a length. +.\"O The intended interpretation of the character buffer is an array +.\"O of strings, where the strings are separated by null bytes (\\(aq\\0\\(aq). +.\"O If the length is nonzero, the last byte of the buffer must be a null byte. +argz vector ¤ÏŤµ¾ðÊóÉÕ¤­¤Îʸ»ú¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +ʸ»ú¥Ð¥Ã¥Õ¥¡¤Ç¤Ï¡¢Ê£¿ô¤Îʸ»úÎó¤¬ NULL ¥Ð¥¤¥È (\\(aq\\0\\(aq) ¤Ç¶èÀÚ¤é¤ì¤Æ¤ª¤ê¡¢ +ʸ»úÎó¤ÎÇÛÎó¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +Ťµ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢¥Ð¥Ã¥Õ¥¡¤ÎºÇ¸å¤Î¥Ð¥¤¥È¤Ï NULL ¥Ð¥¤¥È¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.LP +.\"O These functions are for handling argz vectors. +.\"O The pair (NULL,0) is an argz vector, and, conversely, +.\"O argz vectors of length 0 must have NULL pointer. +.\"O Allocation of nonempty argz vectors is done using +.\"O .BR malloc (3), +.\"O so that +.\"O .BR free (3) +.\"O can be used to dispose of them again. +¤³¤ì¤é¤Î´Ø¿ô¤Ï argz vector ¤òÁàºî¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¥Ú¥¢ (NULL,0) ¤Ï argz vector ¤Ç¤¢¤ê¡¢µÕ¤Ë¸À¤¨¤Ð +Ťµ 0 ¤Î argz vector¤Ï NULL ¥Ý¥¤¥ó¥¿¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¶õ¤Ç¤Ê¤¤ argz vector ¤Î³ä¤êÅö¤Æ¤Ï +.BR malloc (3) +¤ò»È¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢argz vector ¤ò²òÊü¤¹¤ë¤Î¤Ë +.BR free (3) +¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +.\"O .BR argz_add () +.\"O adds the string +.\"O .I str +.\"O at the end of the array +.\"O .IR *argz , +.\"O and updates +.\"O .IR *argz +.\"O and +.\"O .IR *argz_len . +.BR argz_add () +¤Ï¡¢Ê¸»úÎó +.I str +¤òÇÛÎó +.IR *argz +¤ÎËöÈø¤ËÄɲä·¡¢ +.IR *argz +¤È +.IR *argz_len +¤ò¹¹¿·¤¹¤ë¡£ +.LP +.\"O .BR argz_add_sep () +.\"O is similar, but splits the string +.\"O .I str +.\"O into substrings separated by the delimiter +.\"O .IR delim . +.\"O For example, one might use this on a Unix search path with +.\"O delimiter \\(aq:\\(aq. +.BR argz_add_sep () +¤âƱÍͤÎÆ°ºî¤ò¤¹¤ë¤¬¡¢¶èÀÚ¤êʸ»ú +.I delim +¤Ë¤·¤¿¤¬¤Ã¤Æʸ»úÎó +.I str +¤òÊ£¿ô¤Îʸ»úÎó¤Ëʬ³ä¤¹¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +Î㤨¤Ð¡¢¶èÀÚ¤êʸ»ú \\(aq:\\(aq ¤ò»ØÄꤷ¤Æ¡¢Unix ¥µ¡¼¥Á¡¦¥Ñ¥¹¤ËÂФ·¤Æ +¤³¤Î´Ø¿ô¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¤À¤í¤¦¡£ +.LP +.\"O .BR argz_append () +.\"O appends the argz vector +.\"O .RI ( buf ,\ buf_len ) +.\"O after +.\"O .RI (* argz ,\ *argz_len ) +.\"O and updates +.\"O .IR *argz +.\"O and +.\"O .IR *argz_len . +.\"O (Thus, +.\"O .I *argz_len +.\"O will be increased by +.\"O .IR buf_len .) +.BR argz_append () +¤Ï argz vector +.RI ( buf ,\ buf_len ) +¤Î¸å¤í¤Ë +.RI (* argz ,\ *argz_len ) +¤òÉÕ¤±²Ã¤¨¡¢ +.I *argz +¤È +.I *argz_len +¤ò¹¹¿·¤¹¤ë¡£ +(¤·¤¿¤¬¤Ã¤Æ¡¢ +.I *argz_len +¤Ï +.I buf_len +¤À¤±Áý²Ã¤¹¤ë¡£) +.LP +.\"O .BR argz_count () +.\"O counts the number of strings, that is, +.\"O the number of null bytes (\\(aq\\0\\(aq), in +.\"O .RI ( argz ,\ argz_len ). +.BR argz_count () +¤Ï +.RI ( argz ,\ argz_len ) +Æâ¤Îʸ»úÎó¤Î¿ô¤ò¿ô¤¨¤ë¡£¼ÂºÝ¤Ë¤Ï NULL ¥Ð¥¤¥È (\\(aq\\0\\(aq) ¤Î¿ô¤ò¿ô¤¨¤Æ¤¤¤ë¡£ +.LP +.\"O .BR argz_create () +.\"O converts a Unix-style argument vector +.\"O .IR argv , +.\"O terminated by +.\"O .IR "(char *) 0" , +.\"O into an argz vector +.\"O .RI ( *argz ,\ *argz_len ). +.BR argz_create () +¤Ï¡¢Unix ή¤Î°ú¤­¿ô¥Ù¥¯¥È¥ë¤Ç¤¢¤ë +.RI ( "(char *) 0" +¤Ç½ªÃ¼¤µ¤ì¤ë) +.I argv +¤ò¡¢argz vector +.RI ( *argz ,\ *argz_len ) +¤ËÊÑ´¹¤¹¤ë¡£ +.LP +.\"O .BR argz_create_sep () +.\"O converts the null-terminated string +.\"O .I str +.\"O into an argz vector +.\"O .RI (* argz ,\ *argz_len ) +.\"O by breaking it up at every occurrence of the separator +.\"O .IR sep . +.BR argz_create_sep () +¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó +.I str +¤ò¶èÀÚ¤êʸ»ú +.I sep +¤¬¸½¤ì¤ëËè¤Ëʬ³ä¤·¤Ê¤¬¤é¡¢argz vector +.RI (* argz ,\ *argz_len ) +¤ËÊÑ´¹¤¹¤ë¡£ +.LP +.\"O .BR argz_delete () +.\"O removes the substring pointed to by +.\"O .I entry +.\"O from the argz vector +.\"O .RI ( *argz ,\ *argz_len ) +.\"O and updates +.\"O .I *argz +.\"O and +.\"O .IR *argz_len . +.BR argz_delete () +¤Ï¡¢ +.I entry +¤Ç»Ø¤·¼¨¤µ¤ì¤¿Ê¸»úÎó¤ò argz vector +.RI ( *argz ,\ *argz_len ) +¤«¤éºï½ü¤·¡¢ +.I *argz +¤È +.I *argz_len +¤ò¹¹¿·¤¹¤ë¡£ +.LP +.\"O .BR argz_extract () +.\"O is the opposite of +.\"O .BR argz_create (). +.\"O It takes the argz vector +.\"O .RI ( argz ,\ argz_len ) +.\"O and fills the array starting at +.\"O .I argv +.\"O with pointers to the substrings, and a final NULL, +.\"O making a Unix-style argv vector. +.\"O The array +.\"O .I argv +.\"O must have room for +.\"O .IR argz_count ( argz , argz_len ") + 1" +.\"O pointers. +.BR argz_extract () +¤Ï +.BR argz_create () +¤ÎÈ¿ÂФÎÁàºî¤ò¹Ô¤¦¡£argz vector +.RI ( argz ,\ argz_len ) +¤òÄ´¤Ù¡¢ +.I argv +¤«¤é»Ï¤Þ¤ëÇÛÎó¤ò¥µ¥Öʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÇËä¤á¤Æ¤¤¤­¡¢ +°ìÈֺǸå¤Ë NULL ¤òÆþ¤ì¤Æ¡¢Unix ή¤Î argv ¥Ù¥¯¥È¥ë¤òºîÀ®¤¹¤ë¡£ +ÇÛÎó +.I argv +¤Ï +.IR argz_count ( argz , argz_len ") + 1" +¸Ä¤Î¥Ý¥¤¥ó¥¿¤ò¼ýÍƤǤ­¤ë¶õ´Ö¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.LP +.\"O .BR argz_insert () +.\"O is the opposite of +.\"O .BR argz_delete (). +.\"O It inserts the argument +.\"O .I entry +.\"O at position +.\"O .I before +.\"O into the argz vector +.\"O .RI ( *argz ,\ *argz_len ) +.\"O and updates +.\"O .I *argz +.\"O and +.\"O .I *argz_len . +.\"O If +.\"O .I before +.\"O is NULL, then +.\"O .I entry +.\"O will inserted at the end. +.BR argz_insert () +¤Ï +.BR argz_delete () +¤ÎÈ¿ÂФÎÁàºî¤ò¹Ô¤¦¡£argz vector +.RI ( *argz ,\ *argz_len ) +¤Î°ÌÃÖ +.I before +¤Ë°ú¤­¿ô +.I entry +¤òÁÞÆþ¤·¡¢ +.I *argz +¤È +.I *argz_len +¤ò¹¹¿·¤¹¤ë¡£ +.I before +¤¬ NULL ¤Î¾ì¹ç¡¢ +.I entry +¤ÏËöÈø¤ËÁÞÆþ¤µ¤ì¤ë¡£ +.LP +.\"O .BR argz_next () +.\"O is a function to step trough the argz vector. +.\"O If +.\"O .I entry +.\"O is NULL, the first entry is returned. +.\"O Otherwise, the entry +.\"O following is returned. +.\"O It returns NULL if there is no following entry. +.BR argz_next () +¤Ï argz vector ¤ò½çÈÖ¤ËÄ´¤Ù¤ë¤¿¤á¤Î´Ø¿ô¤Ç¤¢¤ë¡£ +.I entry +¤¬ NULL ¤Î¾ì¹ç¡¢ºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +¼¡¤Î¥¨¥ó¥È¥ê¤¬¤Ê¤¤¾ì¹ç¡¢NULL ¤òÊÖ¤¹¡£ +.LP +.\"O .BR argz_replace () +.\"O replaces each occurrence of +.\"O .I str +.\"O with +.\"O .IR with , +.\"O reallocating argz as necessary. +.\"O If +.\"O .I replace_count +.\"O is non-NULL, +.\"O .I *replace_count +.\"O will be incremented by the number of replacements. +.BR argz_replace () +¤Ï¡¢ +.I str +¤ò¤¹¤Ù¤Æ +.I with +¤ÇÃÖ¤­´¹¤¨¤ë (ɬÍפ˱þ¤¸¤Æ argz ¤ÎºÆ³ä¤êÅö¤Æ¤ò¹Ô¤¦)¡£ +.I replace_count +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I *replace_count +¤òÃÖ¤­´¹¤¨¤ò¹Ô¤Ã¤¿¿ô¤À¤±Áý¤ä¤¹¡£ +.LP +.\"O .BR argz_stringify () +.\"O is the opposite of +.\"O .BR argz_create_sep (). +.\"O It transforms the argz vector into a normal string by replacing +.\"O all null bytes (\\(aq\\0\\(aq) except the last by +.\"O .IR sep . +.BR argz_stringify () +¤Ï +.BR argz_create_sep () +¤ÎÈ¿ÂФÎÁàºî¤ò¹Ô¤¦¡£ +ËöÈø¤Î NULL ¥Ð¥¤¥È°Ê³°¤ÎÁ´¤Æ¤Î NULL ¥Ð¥¤¥È (\\(aq\\0\\(aq) ¤ò +.I sep +¤ÇÃÖ¤­´¹¤¨¤Æ¡¢ +argz vector ¤òÄ̾ï¤Îʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O All argz functions that do memory allocation have a return type of +.\"O \fIerror_t\fP, and return 0 for success, and \fBENOMEM\fP +.\"O if an allocation error occurs. +¥á¥â¥ê³ä¤êÅö¤Æ¤ò¹Ô¤¦ argz ´Ø¿ô·²¤Ï¤¹¤Ù¤Æ \fIerror_t\fP ·¿¤ÎÊÖ¤êÃͤò»ý¤Ä¡£ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤·¡¢³ä¤êÅö¤Æ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï +\fBENOMEM\fP ¤òÊÖ¤¹¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O These functions are a GNU extension. +.\"O Handle with care. +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£Ãí°Õ¤·¤Æ»ÈÍѤ¹¤ë¤³¤È¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Argz vectors without a terminating null byte may lead to +.\"O Segmentation Faults. +NULL ¥Ð¥¤¥È¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤ argz vector ¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢ +segmentation fault ¤òµ¯¤³¤¹¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR envz_add (3) diff --git a/draft/man3/asin.3 b/draft/man3/asin.3 new file mode 100644 index 00000000..82c3684d --- /dev/null +++ b/draft/man3/asin.3 @@ -0,0 +1,164 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O asin, asinf, asinl \- arc sine function +asin, asinf, asinl \- µÕÀµ¸¹¡Êarc sine¡Ë´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double asin(double " x ); +.br +.BI "float asinf(float " x ); +.br +.BI "long double asinl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR asinf (), +.BR asinl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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" +.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] ¤ÎÈϰϤȤʤ롣 + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is +0 (\-0), +.\"O +0 (\-0) is returned. +.I x +¤¬ +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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is outside the range [\-1,\ 1] +Îΰ襨¥é¡¼ (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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR acos (3), +.BR atan (3), +.BR atan2 (3), +.BR casin (3), +.BR cos (3), +.BR sin (3), +.BR tan (3) diff --git a/draft/man3/asinh.3 b/draft/man3/asinh.3 new file mode 100644 index 00000000..ed1e6396 --- /dev/null +++ b/draft/man3/asinh.3 @@ -0,0 +1,139 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2008-08-05 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O asinh, asinhf, asinhl \- inverse hyperbolic sine function +asinh, asinhf, asinhl \- µÕÁжÊÀþÀµ¸¹¡Êinverse hyperbolic sine¡Ë´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double asinh(double " x ); +.br +.BI "float asinhf(float " x ); +.br +.BI "long double asinhl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR asinh (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR asinhf (), +.BR asinhl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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" +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the inverse hyperbolic sine of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎµÕÁжÊÀþÀµ¸¹¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ 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 (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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR acosh (3), +.BR atanh (3), +.BR casinh (3), +.BR cosh (3), +.BR sinh (3), +.BR tanh (3) diff --git a/draft/man3/asprintf.3 b/draft/man3/asprintf.3 new file mode 100644 index 00000000..1ef5d182 --- /dev/null +++ b/draft/man3/asprintf.3 @@ -0,0 +1,106 @@ +.\" 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. +.\" +.\" Text fragments inspired by Martin Schulze . +.\" +.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. +.\" Translated Mon 14 Jan 2002 by NAKANO Takeo +.\" +.TH ASPRINTF 3 2001-12-18 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O asprintf, vasprintf \- print to allocated string +.SH ̾Á° +asprintf, vasprintf \- ʸ»úÎó¤ò³ä¤êÅö¤Æ¤Æ¤½¤ì¤Ë½ÐÎϤ¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int asprintf(char **" strp ", const char *" fmt ", ...);" +.sp +.BI "int vasprintf(char **" strp ", const char *" fmt ", va_list " ap ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The functions +.\"O .BR asprintf () +.\"O and +.\"O .BR vasprintf () +.\"O are analogs of +.\"O .BR sprintf (3) +.\"O and +.\"O .BR vsprintf (3), +.\"O except that they allocate a string large enough to hold the output +.\"O including the terminating null byte, +.\"O and return a pointer to it via the first argument. +.\"O This pointer should be passed to +.\"O .BR free (3) +.\"O to release the allocated storage when it is no longer needed. +.BR asprintf () +´Ø¿ô¤È +.BR vasprintf () +´Ø¿ô¤È¤Ï¡¢¤½¤ì¤¾¤ì +.BR sprintf (3) +´Ø¿ô¤È +.BR vsprintf (3) +´Ø¿ô¤È¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ +½ÐÎÏʸ»úÎó¤ò (½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤â´Þ¤á¤Æ) +ÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Î¥á¥â¥ê¤ò³ÎÊݤ·¡¢ +ºÇ½é¤Î°ú¿ô¤Ë¤½¤Îʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢ÉÔÍפˤʤ俤é +.BR free (3) +¤ËÅϤ·¡¢³ä¤êÅö¤Æ¤é¤ì¤¿µ­²±Îΰè¤ò²òÊü¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O When successful, these functions return the number of bytes printed, +.\"O just like +.\"O .BR sprintf (3). +.\"O If memory allocation wasn't possible, or some other error occurs, +.\"O these functions will return \-1, and the contents of +.\"O .I strp +.\"O is undefined. +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï½ÐÎϤµ¤ì¤¿¥Ð¥¤¥È¿ô¤ò +.RB ( sprintf (3) +¤Î¤è¤¦¤Ë) ÊÖ¤¹¡£ +¥á¥â¥ê¤Î³ä¤êÅö¤Æ¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¤ê¡¢ +¤½¤Î¾¥¨¥é¡¼¤¬À¸¤¸¤ë¤È¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤Ï \-1 ¤òÊÖ¤·¡¢ +.I strp +¤ÎÆâÍƤÏ̤ÄêµÁ¤È¤Ê¤ë¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O These functions are GNU extensions, not in C or POSIX. +.\"O They are also available under *BSD. +.\"O The FreeBSD implementation sets +.\"O .I strp +.\"O to NULL on error. +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢C ¤ä POSIX ¤Î¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +¤³¤ì¤é¤Ï *BSD ¤Ç¤âÍøÍѤǤ­¤ë¡£ +FreeBSD ¤Î¼ÂÁõ¤Ç¤Ï¡¢¥¨¥é¡¼¤ÎºÝ¤Ë¤Ï +.I strp +¤ò NULL ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR free (3), +.BR malloc (3), +.BR printf (3), +.BR feature_test_macros (7) diff --git a/draft/man3/assert.3 b/draft/man3/assert.3 new file mode 100644 index 00000000..25eec655 --- /dev/null +++ b/draft/man3/assert.3 @@ -0,0 +1,118 @@ +.\" 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 21:42:42 1993 by Rik Faith +.\" Modified Tue Oct 22 23:44:11 1996 by Eric S. Raymond +.\" +.\" Japanese Version Copyright (c) 1996 Kentaro OGAWA +.\" all rights reserved. +.\" Translated Sun, 14 Jul 1996 01:33:26 +0900 +.\" by Kentaro OGAWA +.\" Updated Fri 6 Oct JST 2000 by Kentaro Shirakata +.\" Updated Thu 19 Sep JST 2002 by Kentaro Shirakata +.\" +.TH ASSERT 3 2002-08-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +assert \- ¿ÇÃǤ¬µ¶¤Î»þ¤Ë¥×¥í¥°¥é¥à¤òÃæ»ß¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void assert(scalar " expression ); +.fi +.SH ÀâÌÀ +.\"O If the macro +.\"O .B NDEBUG +.\"O was defined at the moment +.\"O .I +.\"O was last included, the macro +.\"O .BR assert () +.\"O generates no code, and hence does nothing at all. +.I +¤¬ºÇ¸å¤Ë¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤¿»þÅÀ¤Ç¡¢ +.B NDEBUG +¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢ +.BR assert () +¥Þ¥¯¥í¤Ï²¿¤Î¥³¡¼¥É¤âÀ¸À®¤»¤º¡¢½¾¤Ã¤ÆÁ´¤¯²¿¤â¤·¤Ê¤¤¡£ +.\"O Otherwise, the macro +.\"O .BR assert () +.\"O prints an error message to standard error and terminates the program +.\"O by calling +.\"O .BR abort (3) +.\"O if +.\"O .I expression +.\"O is false (i.e., compares equal to zero). +¤µ¤â¤Ê¤±¤ì¤Ð¡¢ +.BR assert (3) +¥Þ¥¯¥í¤Ï +.I expression +¤¬µ¶¤Î»þ(¤¹¤Ê¤ï¤Á¡¢Èæ³Ó¤Î·ë²Ì¤¬0¤ÈÅù¤·¤¤»þ)¤Ë +ɸ½à¥¨¥é¡¼½ÐÎϤ˥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¡¢¤µ¤é¤Ë +.BR abort () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥×¥í¥°¥é¥à¤ò½ªÎ»¤µ¤»¤ë¡£ +.LP +.\"O The purpose of this macro is to help the programmer find bugs in +.\"O his program. +.\"O The message "assertion failed in file foo.c, function +.\"O do_bar(), line 1287" is of no help at all to a user. +¤³¤Î¥Þ¥¯¥í¤ÎÌÜŪ¤Ï¡¢¥×¥í¥°¥é¥Þ¡¼¤¬¥×¥í¥°¥é¥à¤Î¥Ð¥°¤òȯ¸«¤¹¤ë¼ê½õ¤±¤ò +¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£"assertion failed in file foo.c, function do_bar(), line 1287" +¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤Ï¥æ¡¼¥¶¡¼¤Ë¤Ï²¿¤Î½õ¤±¤Ë¤â¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +ÃͤÏÊÖ¤µ¤ì¤Ê¤¤¡£ +.SH ½àµò +.\"O POSIX.1-2001, C89, C99. +.\"O In C89, +.\"O .B expression +.\"O is required to be of type +.\"O .I int +.\"O and undefined behavior results if it is not, but in C99 +.\"O it may have any scalar type. +POSIX.1-2001, C89, C99. +C89 ¤Ç¤Ï +.B expression +¤Ï +.I int +·¿¤Ç¤¢¤ë¤³¤È¤¬É¬ÍפȤµ¤ì¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤ÎÆ°ºî¤Ï̤ÄêµÁ¤È¤µ¤ì¤Æ¤¤¤¿¡£ +¤·¤«¤· C99 ¤Ç¤Ï¤É¤Î¤è¤¦¤Ê¥¹¥«¥éÃͤǤâ¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤¿¡£ +.\"O .\" See Defect Report 107 for more details. +.\" ¾ÜºÙ¤ÏÉÔ¶ñ¹çÊó¹ð 107 ¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥Ð¥° +.\"O .BR assert () +.\"O is implemented as a macro; if the expression tested has side-effects, +.\"O program behavior will be different depending on whether +.\"O .B NDEBUG +.\"O is defined. +.\"O This may create Heisenbugs which go away when debugging +.\"O is turned on. +.BR assert () +¤Ï¡¢¥Þ¥¯¥í¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£¤¹¤Ê¤ï¤Á¡¢ +»î¤µ¤ì¤Æ¤¤¤ë¼°¤¬ÉûºîÍѤò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¥Þ¥¯¥í +.B NDEBUG +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ë°Í¸¤·¤Æ¡¢¥×¥í¥°¥é¥à¤Î¿¶Éñ¤¤¤Ï°Û¤Ê¤ë¤À¤í¤¦¡£ +¤³¤ì¤Ë¤è¤Ã¤Æ¡¢¥Ð¥°½Ð¤·¤¹¤ë¤È¤­¤Ë¤Ï¾Ã¤¨¤Æ¤·¤Þ¤¦ +¥Ï¥¤¥¼¥ó¥Ð¥°(Heisenbugs)¤òÀ¸¤ß½Ð¤¹¤À¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR abort (3), +.BR assert_perror (3), +.BR exit (3) diff --git a/draft/man3/assert_perror.3 b/draft/man3/assert_perror.3 new file mode 100644 index 00000000..295ff1d3 --- /dev/null +++ b/draft/man3/assert_perror.3 @@ -0,0 +1,115 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 05:09:37 JST 2003 +.\" by Akihiro MOTOKI +.\" +.TH ASSERT_PERROR 3 2002-08-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O assert_perror \- test errnum and abort +.SH ̾Á° +assert_perror \- test errnum and abort +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "void assert_perror(int " errnum ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O If the macro +.\"O .B NDEBUG +.\"O was defined at the moment +.\"O .I +.\"O was last included, the macro +.\"O .BR assert_perror () +.\"O generates no code, and hence does nothing at all. +ºÇ¸å¤Ë +.I +¤¬¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤¿»þ¤Ë¥Þ¥¯¥í +.B NDEBUG +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢¥Þ¥¯¥í +.BR assert_perror () +¤Ï²¿¤Î¥³¡¼¥É¤âÀ¸À®¤»¤º¡¢¤·¤¿¤¬¤Ã¤ÆÁ´¤¯²¿¤â¤·¤Ê¤¤¡£ +.\"O Otherwise, the macro +.\"O .BR assert_perror () +.\"O prints an error message to standard error and terminates the program +.\"O by calling +.\"O .BR abort (3) +.\"O if +.\"O .I errnum +.\"O is nonzero. +.\"O The message contains the filename, function name and +.\"O line number of the macro call, and the output of +.\"O .IR strerror(errnum) . +¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢¥Þ¥¯¥í +.BR assert_perror () +¤Ïɸ½à¥¨¥é¡¼¤Ë¥¨¥é¡¼¡¦¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¡¢ +.I errnum +¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï +.BR abort (3) +¤ò¸Æ¤Ó½Ð¤·¤Æ¥×¥í¥°¥é¥à¤ò½ªÎ»¤µ¤»¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ë̾¡¢¥Þ¥¯¥í¸Æ¤Ó½Ð¤·¤¬¤¢¤Ã¤¿´Ø¿ô̾¤È¹ÔÈֹ桢 +.I strerror(errnum) +¤Î½ÐÎϤ¬´Þ¤Þ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O No value is returned. +ÊÖ¤êÃͤϤʤ¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This is a GNU extension. +¤³¤ì¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The purpose of the assert macros is to help the programmer find bugs in +.\"O his program, things that cannot happen unless there was a coding mistake. +.\"O However, with system or library calls the situation is rather different, +.\"O and error returns can happen, and will happen, and should be tested for. +.\"O Not by an assert, where the test goes away when +.\"O .B NDEBUG +.\"O is defined, +.\"O but by proper error handling code. +.\"O Never use this macro. +assert ¥Þ¥¯¥í¤ÎÌÜŪ¤Ï¡¢¥×¥í¥°¥é¥Þ¤¬¥×¥í¥°¥é¥àÃæ¤Î¥Ð¥°¤òõ¤¹¼ê½õ¤±¤ò¤¹¤ë¤³¤È +¤Ç¤¢¤ê¡¢¥³¡¼¥Ç¥£¥ó¥°´Ö°ã¤¤¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï²¿¤¬µ¯¤³¤ë¤³¤È¤Ï¤¢¤ê¤¨¤Ê¤¤¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤Î¾ì¹ç¡¢¾õ¶·¤¬¤«¤Ê¤ê°ã¤Ã¤Æ¤¤¤Æ¡¢ +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ê¤¨¤ë¤·¡¢¼ÂºÝ¤¢¤ë¤À¤í¤¦¡£¤½¤·¤Æ¤½¤Î¤è¤¦¤Ê¾õ¶·¤Ç¤â +¥Æ¥¹¥È¤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ +.B NDEBUG +¤òÄêµÁ¤¹¤ë¤³¤È¤Ç̵¸ú¤Ë¤Ç¤­¤ë +assert ¤Ç¤Ï¤Ê¤¯¡¢Å¬Àڤʥ¨¥é¡¼½èÍý¥³¡¼¥É¤ÇÂн褹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤Î¥Þ¥¯¥í¤Ï·è¤·¤Æ»È¤ï¤Ê¤¤¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR abort (3), +.BR assert (3), +.BR exit (3), +.BR strerror (3), +.BR feature_test_macros (7) diff --git a/draft/man3/atan.3 b/draft/man3/atan.3 new file mode 100644 index 00000000..94f412f5 --- /dev/null +++ b/draft/man3/atan.3 @@ -0,0 +1,139 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2008-12-02 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O atan, atanf, atanl \- arc tangent function +atan, atanf, atanl \- µÕÀµÀÜ¡Êarc tangent¡Ë´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double atan(double " x ); +.br +.BI "float atanf(float " x ); +.br +.BI "long double atanl( long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR atanf (), +.BR atanl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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" +.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] ¤ÎÈϰϤȤʤ롣 + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is +0 (\-0), +.\"O +0 (\-0) is returned. +.I x +¤¬ +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 +.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" +.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) diff --git a/draft/man3/atan2.3 b/draft/man3/atan2.3 new file mode 100644 index 00000000..cd41e5db --- /dev/null +++ b/draft/man3/atan2.3 @@ -0,0 +1,253 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2008-11-20 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O atan2, atan2f, atan2l \- arc tangent function of two variables +atan2, atan2f, atan2l \- Æó¤Ä¤ÎÊÑ¿ô¤ËÂФ¹¤ëµÕÀµÀÜ¡Êarc tangent¡Ë´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "double atan2(double " y ", double " x ); +.BI "float atan2f(float " y ", float " x ); +.BI "long double atan2l(long double " y ", long double " x ); + +.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) +»²¾È): +.in +.sp +.ad l +.BR atan2f (), +.BR atan2l (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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) ¤Î¼çÃͤò·×»»¤¹¤ë¡£ +Æó¤Ä¤Î°ú¤­¿ô¤ÎÉä¹æ¤Ï·ë²Ì¤Î¾Ý¸Â¤ò·èÄꤹ¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.\"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] ¤ÎÈϰϤȤʤ롣 + +.\"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) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\" 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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\" 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) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR acos (3), +.BR asin (3), +.BR atan (3), +.BR carg (3), +.BR cos (3), +.BR sin (3), +.BR tan (3) diff --git a/draft/man3/atanh.3 b/draft/man3/atanh.3 new file mode 100644 index 00000000..5540ded7 --- /dev/null +++ b/draft/man3/atanh.3 @@ -0,0 +1,223 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O atanh, atanhf, atanhl \- inverse hyperbolic tangent function +atanh, atanhf, atanhl \- µÕÁжÊÀþÀµÀÜ¡Êinverse hyperbolic tangent¡Ë´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double atanh(double " x ); +.br +.BI "float atanhf(float " x ); +.br +.BI "long double atanhl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR atanh (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR atanhf (), +.BR atanhl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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" +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the inverse hyperbolic tangent of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎµÕÁжÊÀþÀµÀܤòÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ 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 +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 +¤¬¤½¤ì¤¾¤ìÊÖ¤µ¤ì¤ë¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP less than \-1 or greater than +1 +Îΰ襨¥é¡¼ (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 +¶Ë¥¨¥é¡¼ (pole error): \fIx\fP ¤¬ +1 ¤« \-1 +.\"O .I errno +.\"O is set to +.\"O .BR ERANGE +.\"O (but see BUGS). +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë (⤷¡Ö¥Ð¥°¡×¤ÎÀá¤â»²¾È)¡£ +.\" FIXME . glibc actually gives EDOM for this case +.\"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" +.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 +.SH ¥Ð¥° +.\"O For a pole error, +¶Ë¥¨¥é¡¼¤Î¾ì¹ç¤Ë¡¢ +.\" +.\" FIXME . this is as at glibc 2.8; check later if this bug is fixed +.\" This can be seen in sysdeps/ieee754/k_standard.c +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6759 +.\"O .I errno +.\"O is set to +.\"O .BR EDOM ; +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O POSIX.1 says it should be set to +.\"O .BR ERANGE . +POSIX.1 ¤Ç¤Ï¡¢ +.B ERANGE +¤òÀßÄꤹ¤Ù¤­¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR acosh (3), +.BR asinh (3), +.BR catanh (3), +.BR cosh (3), +.BR sinh (3), +.BR tanh (3) diff --git a/draft/man3/atexit.3 b/draft/man3/atexit.3 new file mode 100644 index 00000000..4a56970c --- /dev/null +++ b/draft/man3/atexit.3 @@ -0,0 +1,240 @@ +.\" 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-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 +.SH ̾Á° +.\"O atexit \- register a function to be called at normal process termination +atexit \- ¥×¥í¥»¥¹¤¬Àµ¾ï½ªÎ»¤·¤¿»þ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë´Ø¿ô¤òÅÐÏ¿¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int atexit(void (*" function )(void)); +.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. +¤³¤³¤ÇÄêµÁ¤µ¤ì¤¿´Ø¿ô¤Ï¡¢ÅÐÏ¿¤·¤¿½çÈ֤ȤϵդνçÈ֤ǸƤӽФµ¤ì¤ë¡£ +ÅÐÏ¿¤·¤¿´Ø¿ô¤Ë°ú¤­¿ô¤ÏÅϤµ¤ì¤Ê¤¤¡£ + +.\"O The same function may be registered multiple times: +.\"O it is called once for each registration. +Ʊ¤¸´Ø¿ô¤òÊ£¿ô²óÅÐÏ¿¤·¤Æ¤â¤è¤¤¡£ +ÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤ÏÅÐÏ¿ 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) +¤ò»È¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£ +.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" +.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" +.SH ½àµò +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.\"O .SH NOTES +.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)) +¤ò»È¤Ã¤ÆÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤Ï¡¢ +¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤Ë¤è¤ê¥×¥í¥»¥¹¤¬°Û¾ï½ªÎ»¤·¤¿¾ì¹ç¤Ë¤Ï¸Æ¤Ó½Ð¤µ¤ì¤Ê¤¤¡£ + +.\"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) +¤Ë¤è¤ê¼Â¹Ô¤µ¤ì¤ë¾¤Î¥×¥í¥»¥¹½ªÎ»¥¹¥Æ¥Ã¥×¤Ï¼Â¹Ô¤µ¤ì¤Ê¤¤¡£ + +.\"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 (3)) +.\"O is undefined. +POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR atexit (3) +¤ò»È¤Ã¤ÆÅÐÏ¿¤µ¤ì¤¿°ì¤Ä¤Î´Ø¿ôÆâ¤Ç¡¢Ê£¿ô²ó +.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 (3). +(Linux ¤Ç¤Ï¤Ê¤¤¤¬) ¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î¾ì¹ç¡¢ +·«¤êÊÖ¤·¤¬Ìµ¸Â¤Ëµ¯¤³¤ë¤³¤È¤Ë¤Ê¤ë¡£ +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +.BR atexit (3) +¤ÇÅÐÏ¿¤µ¤ì¤¿´Ø¿ôÆâ¤Ç +.BR exit (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) +¤Ï¡¢Æ±¤¸¥ê¥¹¥È¤ËÂФ·¤Æ´Ø¿ô¤òÅÐÏ¿¤¹¤ë¡£ +¥×¥í¥»¥¹¤¬Àµ¾ï¤Ë½ªÎ»¤·¤¿ºÝ¤Ë¤Ï¡¢ +¤³¤ì¤é¤ÎÆó¤Ä¤Î´Ø¿ô¤ÇÅÐÏ¿¤µ¤ì¤¿½ç½ø¤ÎµÕ½ç¤Ç¡¢ +ÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤¬µ¯Æ°¤µ¤ì¤ë¡£ + +.\"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 (3) +¤ÇÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤Î¼Â¹Ô¤ò½ªÎ»¤¹¤ë¤¿¤á¤Ë +.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 +.SH Îã +.nf +#include +#include +#include + +void +bye(void) +{ + printf("That was all, folks\en"); +} + +int +main(void) +{ + long a; + int i; + + a = sysconf(_SC_ATEXIT_MAX); + printf("ATEXIT_MAX = %ld\en", a); + + i = atexit(bye); + if (i != 0) { + fprintf(stderr, "cannot set exit function\en"); + exit(EXIT_FAILURE); + } + + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR _exit (2), +.BR exit (3), +.BR on_exit (3) diff --git a/draft/man3/atof.3 b/draft/man3/atof.3 new file mode 100644 index 00000000..e0808b07 --- /dev/null +++ b/draft/man3/atof.3 @@ -0,0 +1,89 @@ +.\" 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 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 +.\" +.TH ATOF 3 1993-03-29 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O atof \- convert a string to a double +atof \- ʸ»úÎó¤ò double ·¿¤Î¿ôÃͤËÊÑ´¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double atof(const char *" nptr ); +.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 () +´Ø¿ô¤¬¥¨¥é¡¼¤ò¸«¤Ä¤±¤Ê¤¤¤³¤È¤ò½ü¤¤¤Æ¤Ï¡¢ +.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" +.SH ´ØÏ¢¹àÌÜ +.BR atoi (3), +.BR atol (3), +.BR strtod (3), +.BR strtol (3), +.BR strtoul (3) diff --git a/draft/man3/atoi.3 b/draft/man3/atoi.3 new file mode 100644 index 00000000..4f70b1e6 --- /dev/null +++ b/draft/man3/atoi.3 @@ -0,0 +1,149 @@ +.\" 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 Mon Mar 29 22:39:41 1993, David Metcalfe +.\" 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 2007-07-26 "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 +.sp +.BI "int atoi(const char *" nptr ); +.br +.BI "long atol(const char *" nptr ); +.br +.BI "long long atoll(const char *" nptr ); +.br +.BI "long long atoq(const char *" nptr ); +.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 atoll (): +.\"O _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; +¤Þ¤¿¤Ï +.I cc\ -std=c99 +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.BR atoi () +´Ø¿ô¤Ï¡¢\fInptr\fP ¤Ë¤è¤Ã¤Æ»Ø¼¨¤µ¤ì¤ëʸ»úÎó¤Î¤Ï¤¸¤á¤ÎÉôʬ¤ò +.I int +·¿À°¿ô¤ËÊÑ´¹¤¹¤ë¡£ +¤³¤Î¿¶¤ëÉñ¤¤¤Ï¡¢ +.BR atoi () +´Ø¿ô¤¬¥¨¥é¡¼¤ò¸«¤Ä¤±¤Ê¤¤ÅÀ°Ê³°¤Ï¡¢ +.sp +.in +4n +strtol(nptr, (char **) NULL, 10); +.in +.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 () +¤Î¸Å¤¤Ì¾Á°¤Ç¤¢¤ë¡£ +.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" +.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 ¤Ë¤Ï¸ºß¤·¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR atof (3), +.BR strtod (3), +.BR strtol (3), +.BR strtoul (3) diff --git a/draft/man3/backtrace.3 b/draft/man3/backtrace.3 new file mode 100644 index 00000000..12d1bb8a --- /dev/null +++ b/draft/man3/backtrace.3 @@ -0,0 +1,378 @@ +.\" Copyright (C) 2007 Michael Kerrisk +.\" drawing on material by Justin Pryzby +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" References: +.\" glibc manual and source +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-10-16, Akihiro MOTOKI , LDP v2.66 +.\" +.TH BACKTRACE 3 2008-06-14 GNU "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O backtrace, backtrace_symbols, backtrace_symbols_fd \- support +.\"O for application self-debugging +backtrace, backtrace_symbols, backtrace_symbols_fd \- +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¼«¿È¤Ç¤Î¥Ç¥Ð¥Ã¥°¤Î¥µ¥Ý¡¼¥È +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include + +.B int backtrace(void +.BI ** buffer , +.B int +.IB size ); + +.B char **backtrace_symbols(void *const +.BI * buffer , +.B int +.IB size ); + +.B void backtrace_symbols_fd(void *const +.BI * buffer , +.B int +.IB size , +.B int +.IB fd ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR backtrace () +.\"O returns a backtrace for the calling program, +.\"O in the array pointed to by +.\"O .IR buffer . +.\"O A backtrace is the series of currently active function calls for +.\"O the program. +.\"O Each item in the array pointed to by +.\"O .I buffer +.\"O is of type \fIvoid *\fP, and is the return address from +.\"O the corresponding stack frame. +.BR backtrace () +¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥°¥é¥à¤Î¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤ò +.I buffer +¤¬»Ø¤¹ÇÛÎó¤ËÆþ¤ì¤ÆÊÖ¤¹¡£¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤Ï¡¢¥×¥í¥°¥é¥à¤Ç +¸½ºßÆ°ºîÃæ¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤ÎʤӤǤ¢¤ë¡£ +.I buffer +¤¬»Ø¤¹ÇÛÎó¤Î¸Ä¡¹¤ÎÍ×ÁÇ¤Ï \fIvoid *\fP ·¿¤Ç¡¢ +Âбþ¤¹¤ë¥¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤«¤é¤Î¥ê¥¿¡¼¥ó¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.\"O The +.\"O .I size +.\"O argument specifies the maximum number of addresses +.\"O that can be stored in +.\"O .IR buffer . +.\"O If the backtrace is larger than +.\"O .IR size , +.\"O then the addresses corresponding to the +.\"O .I size +.\"O most recent function calls are returned; +.\"O to obtain the complete backtrace, make sure that +.\"O .I buffer +.\"O and +.\"O .I size +.\"O are large enough. +.I size +°ú¤­¿ô¤Ï +.I buffer +¤Ë³ÊǼ¤Ç¤­¤ë¥¢¥É¥ì¥¹¤ÎºÇÂç¸Ä¿ô¤ò»ØÄꤹ¤ë¡£ +¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤¬ +.I size +¤è¤êÂ礭¤¤¾ì¹ç¡¢ +.I size +¸Ä¤Îľ¶á¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤ËÂбþ¤¹¤ë¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¤ë¡£ +´°Á´¤Ê¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë¤Ï¡¢³Î¼Â¤Ë +.I buffer +¤È +.I size +¤¬½½Ê¬Â礭¤¯¤Ê¤ë¤è¤¦¤Ë¤¹¤ë¤³¤È¡£ + +.\"O Given the set of addresses returned by +.\"O .BR backtrace () +.\"O in +.\"O .IR buffer , +.\"O .BR backtrace_symbols () +.\"O translates the addresses into an array of strings that describe +.\"O the addresses symbolically. +.BR backtrace () +¤Ë¤è¤Ã¤Æ +.I buffer +¤Ë¥¢¥É¥ì¥¹¤Î½¸¹ç¤¬ÆÀ¤é¤ì¤¿¤é¡¢ +.BR backtrace_symbols () +¤Ë¤è¤Ã¤Æ¡¢¥¢¥É¥ì¥¹½¸¹ç¤ò¡¢¤½¤Î¥¢¥É¥ì¥¹¤ò¥·¥ó¥Ü¥ë¤Çɽ¤·¤¿Ê¸»úÎó¤ÎÇÛÎó +¤ËËÝÌõ¤Ç¤­¤ë¡£ +.\"O The +.\"O .I size +.\"O argument specifies the number of addresses in +.\"O .IR buffer . +.I size +°ú¤­¿ô¤Ï +.I buffer +¤Ë³ÊǼ¤µ¤ì¤¿¥¢¥É¥ì¥¹¤Î¿ô¤ò»ØÄꤹ¤ë¡£ +.\"O The symbolic representation of each address consists of the function name +.\"O (if this can be determined), a hexadecimal offset into the function, +.\"O and the actual return address (in hexadecimal). +¸Ä¡¹¤Î¥¢¥É¥ì¥¹¤Î¥·¥ó¥Ü¥ëɽ¸½¤Ï¡¢´Ø¿ô̾ (ÆÃÄê¤Ç¤­¤¿¾ì¹ç)¡¢ +´Ø¿ô¤Ø¤Î¥ª¥Õ¥»¥Ã¥È (16¿Êɽµ­)¡¢¼ÂºÝ¤Î¥ê¥¿¡¼¥ó¥¢¥É¥ì¥¹ (16¿Êɽµ­) +¤«¤é¹½À®¤µ¤ì¤ë¡£ +.\"O The address of the array of string pointers is returned +.\"O as the function result of +.\"O .BR backtrace_symbols (). +.\"O This array is +.\"O .BR malloc (3)ed +.\"O by +.\"O .BR backtrace_symbols (), +.\"O and must be freed by the caller. +.\"O (The strings pointed to by the array of pointers +.\"O need not and should not be freed.) +.BR backtrace_symbols () +¤Î¼Â¹Ô·ë²Ì¤È¤·¤Æ¤Ï¡¢ +ʸ»úÎó¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Î¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤ÎÇÛÎó¤Ï +.BR backtrace_symbols () +¤Ë¤è¤Ã¤Æ +.BR malloc (3) +¤µ¤ì¡¢¸Æ¤Ó½Ð¤·Â¦¤Ç free ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(¥Ý¥¤¥ó¥¿¤ÎÇÛÎ󤬻ؤ¹¸Ä¡¹¤Îʸ»úÎó¤Ï free ¤¹¤ëɬÍפϤʤ¤¤·¡¢ +free ¤¹¤Ù¤­¤Ç¤â¤Ê¤¤)¡£ + +.\"O .BR backtrace_symbols_fd () +.\"O takes the same +.\"O .I buffer +.\"O and +.\"O .I size +.\"O arguments as +.\"O .BR backtrace_symbols (), +.\"O but instead of returning an array of strings to the caller, +.\"O it writes the strings, one per line, to the file descriptor +.\"O .IR fd . +.\"O .BR backtrace_symbols_fd () +.\"O does not call +.\"O .BR malloc (3), +.\"O and so can be employed in situations where the latter function might fail. +.BR backtrace_symbols_fd () +¤Ï¡¢ +.BR backtrace_symbols () +¤ÈƱ¤¸°ú¤­¿ô +.I buffer +¤È +.I size +¤ò¤È¤ë¤¬¡¢¸Æ¤Ó½Ð¤·Â¦¤Ëʸ»úÎó¤ÎÇÛÎó¤òÊÖ¤¹Âå¤ï¤ê¤Ë¡¢ +ʸ»úÎó¤ò¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë 1 ¹Ô¤Ë 1 ¥¨¥ó¥È¥ê¤Î·Á¤Ç½ñ¤­¹þ¤à¡£ +.BR backtrace_symbols_fd () +¤Ï +.BR malloc (3) +¤ò¸Æ¤Ó½Ð¤µ¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢¤³¤ì¤Ë³¤¯´Ø¿ô¤¬¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¾õ¶·¤Ç¤âÍøÍѤǤ­¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR backtrace () +.\"O returns the number of addresses returned in +.\"O .IR buffer , +.\"O which is not greater than +.\"O .IR size . +.\"O If the return value is less than +.\"O .IR size , +.\"O then the full backtrace was stored; if it is equal to +.\"O .IR size , +.\"O then it may have been truncated, in which case the addresses of the +.\"O oldest stack frames are not returned. +.BR backtrace () +¤Ï +.I buffer +¤Ë³ÊǼ¤·¤¿¥¢¥É¥ì¥¹¤Î¸Ä¿ô¤òÊÖ¤¹¡£¤½¤Î¸Ä¿ô¤Ï +.I size +¤è¤êÂ礭¤¯¤Ê¤ë¤³¤È¤Ï¤Ê¤¤¡£ +ÊÖ¤êÃͤ¬ +.I size +¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢¥Ð¥Ã¥¯¥È¥ì¡¼¥¹Á´ÂΤ¬³ÊǼ¤µ¤ì¤Æ¤¤¤ë¡£ÊÖ¤êÃͤ¬ +.I size +¤ÈÅù¤·¤¤¾ì¹ç¡¢¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤ÏÀÚ¤êµÍ¤á¤é¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +ÀÚ¤êµÍ¤á¤é¤ì¤¿¾ì¹ç¡¢ºÇ¤â¸Å¤¤¥¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤Î¥¢¥É¥ì¥¹¤Ï +ÊÖ¤µ¤ì¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£ + +.\"O On success, +.\"O .BR backtrace_symbols () +.\"O returns a pointer to the array +.\"O .BR malloc (3)ed +.\"O by the call; +.\"O on error, NULL is returned. +.BR backtrace_symbols () +¤Ï¡¢À®¸ù¤¹¤ë¤È¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤Ç +.BR malloc (3) +¤µ¤ì¤¿ÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ NULL ¤òÊÖ¤¹¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR backtrace (), +.\"O .BR backtrace_symbols (), +.\"O and +.\"O .BR backtrace_symbols_fd () +.\"O are provided in glibc since version 2.1. +.BR backtrace (), +.BR backtrace_symbols (), +.BR backtrace_symbols_fd () +¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O These functions are GNU extensions. +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O These functions make some assumptions about how a function's return +.\"O address is stored on the stack. +.\"O Note the following: +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢´Ø¿ô¤Î¥ê¥¿¡¼¥ó¥¢¥É¥ì¥¹¤¬¥¹¥¿¥Ã¥¯¾å¤Ç¤É¤Î¤è¤¦¤Ë³ÊǼ¤µ¤ì¤ë¤« +¤Ë´Ø¤·¤Æ¤¢¤ë²¾Äê¤òÃÖ¤¤¤Æ¤¤¤ë¡£ +°Ê²¼¤ÎÅÀ¤ËÃí°Õ¡£ +.IP * 3 +.\"O Omission of the frame pointers (as +.\"O implied by any of +.\"O .BR gcc (1)'s +.\"O nonzero optimization levels) may cause these assumptions to be +.\"O violated. +.RB ( gcc (1) +¤Î 0 °Ê³°¤ÎºÇŬ²½¥ì¥Ù¥ë¤Ç°ÅÌۤΤ¦¤Á¤Ë¹Ô¤ï¤ì¤ë) +¥Õ¥ì¡¼¥à¥Ý¥¤¥ó¥¿¤Î¾Êά¤ò¹Ô¤¦¤È¡¢¤³¤ì¤é¤ÎÁ°Äó¤¬Êø¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.IP * +.\"O Inlined functions do not have stack frames. +¥¤¥ó¥é¥¤¥ó´Ø¿ô¤Ï¥¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤ò»ý¤¿¤Ê¤¤¡£ +.IP * +.\"O Tail-call optimization causes one stack frame to replace another. +ËöÈø¸Æ¤Ó½Ð¤·¤ÎºÇŬ²½ (tail-call optimization) ¤ò¹Ô¤¦¤È¡¢ +¤¢¤ë¥¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤¬Ê̤Υ¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤òÃÖ¤­´¹¤¨¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.PP +.\"O The symbol names may be unavailable without the use of special linker +.\"O options. +.\"O For systems using the GNU linker, it is necessary to use the +.\"O .I \-rdynamic +.\"O linker option. +.\"O Note that names of "static" functions are not exposed, +.\"O and won't be available in the backtrace. +¥·¥ó¥Ü¥ë̾¤ÏÆÃÊ̤ʥê¥ó¥«¡¦¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤Ê¤¤¤ÈÍøÍѤǤ­¤Ê¤¤¾ì¹ç¤¬¤¢¤ë¡£ +GNU ¥ê¥ó¥«¤ò»ÈÍѤ¹¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I \-rdynamic +¥ê¥ó¥«¡¦¥ª¥×¥·¥ç¥ó¤ò»È¤¦É¬Íפ¬¤¢¤ë¡£ +"static" ¤Ê´Ø¿ô¤Î¥·¥ó¥Ü¥ë̾¤Ï¸ø³«¤µ¤ì¤º¡¢ +¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The program below demonstrates the use of +.\"O .BR backtrace () +.\"O and +.\"O .BR backtrace_symbols (). +.\"O The following shell session shows what we might see when running the +.\"O program: +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +.BR backtrace () +¤È +.BR backtrace_symbols () +¤Î»ÈÍÑÎã¤ò¼¨¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +°Ê²¼¤Ë¼¨¤¹¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥ó¤Ï¡¢ +¤³¤Î¥×¥í¥°¥é¥à¤òÆ°¤«¤·¤¿ºÝ¤Î¼Â¹ÔÎã¤Ç¤¢¤ë¡£ +.nf +.in +4n + +.RB "$" " cc \-rdynamic prog.c \-o prog" +.RB "$" " ./prog 3" +backtrace() returned 8 addresses +\&./prog(myfunc3+0x5c) [0x80487f0] +\&./prog [0x8048871] +\&./prog(myfunc+0x21) [0x8048894] +\&./prog(myfunc+0x1a) [0x804888d] +\&./prog(myfunc+0x1a) [0x804888d] +\&./prog(main+0x65) [0x80488fb] +\&/lib/libc.so.6(__libc_start_main+0xdc) [0xb7e38f9c] +\&./prog [0x8048711] +.in +.fi +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include + +void +myfunc3(void) +{ + int j, nptrs; +#define SIZE 100 + void *buffer[100]; + char **strings; + + nptrs = backtrace(buffer, SIZE); + printf("backtrace() returned %d addresses\\n", nptrs); + +.\"O /* The call backtrace_symbols_fd(buffer, nptrs, STDOUT_FILENO) +.\"O would produce similar output to the following: */ + /* backtrace_symbols_fd(buffer, nptrs, STDOUT_FILENO) ¤ò + ¸Æ¤Ó½Ð¤·¤Æ¤â¡¢°Ê²¼¤ÈƱÍͤνÐÎϤ¬ÆÀ¤é¤ì¤ë¡£ */ + + strings = backtrace_symbols(buffer, nptrs); + if (strings == NULL) { + perror("backtrace_symbols"); + exit(EXIT_FAILURE); + } + + for (j = 0; j < nptrs; j++) + printf("%s\\n", strings[j]); + + free(strings); +} + +.\"O static void /* "static" means don\(aqt export the symbol... */ +static void /* "static" ¤Ï¥·¥ó¥Ü¥ë¤ò¸ø³«¤·¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë */ +myfunc2(void) +{ + myfunc3(); +} + +void +myfunc(int ncalls) +{ + if (ncalls > 1) + myfunc(ncalls \- 1); + else + myfunc2(); +} + +int +main(int argc, char *argv[]) +{ + if (argc != 2) { + fprintf(stderr, "%s num\-calls\\n", argv[0]); + exit(EXIT_FAILURE); + } + + myfunc(atoi(argv[1])); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR gcc (1), +.BR ld (1), +.BR dlopen (3), +.BR malloc (3) diff --git a/draft/man3/basename.3 b/draft/man3/basename.3 new file mode 100644 index 00000000..9e9982fd --- /dev/null +++ b/draft/man3/basename.3 @@ -0,0 +1,284 @@ +.\" Copyright (c) 2000 by Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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. +.\" Created, 14 Dec 2000 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. +.\" Translated 2001-03-31, NAKANO Takeo +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" +.TH BASENAME 3 2009-03-30 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O basename, dirname \- parse pathname components +.SH ̾Á° +basename, dirname \- ¥Ñ¥¹Ì¾¤ò²òÀϤ·¤Æ³ÆÉôʬ¤ò¼è¤ê½Ð¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *dirname(char *" path ); + +.BI "char *basename(char *" path ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Warning: there are two different functions +.\"O .BR basename () +.\"O - see below. +·Ù¹ð: +.BR basename () +¤Ë¤Ï°Û¤Ê¤ë¥Ð¡¼¥¸¥ç¥ó¤¬ 2¤Ä¸ºß¤¹¤ë¡£²¼µ­¤Î¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ +.LP +.\"O The functions +.\"O .BR dirname () +.\"O and +.\"O .BR basename () +.\"O break a null-terminated pathname string into directory +.\"O and filename components. +.\"O In the usual case, +.\"O .BR dirname () +.\"O returns the string up to, but not including, the final \(aq/\(aq, and +.\"O .BR basename () +.\"O returns the component following the final \(aq/\(aq. +.\"O Trailing \(aq/\(aq characters are not counted as part of the pathname. +.BR dirname () +¤È +.BR basename () +¤Ï¡¢NULL ¤Ç½ªÃ¼¤µ¤ì¤¿¥Ñ¥¹Ì¾¤Îʸ»úÎó¤ò¡¢ +¥Ç¥£¥ì¥¯¥È¥êÉôʬ¡¦¥Õ¥¡¥¤¥ë̾Éôʬ¤Ëʬ³ä¤¹¤ë¡£ +Ä̾ï¤Ï¡¢ +.BR dirname () +¤ÏºÇ¸å¤Î \(aq/\(aq ¤Þ¤Ç¤ÎÉôʬ (ºÇ¸å¤Î \(aq/\(aq ¤Ï´Þ¤Þ¤Ê¤¤) ¤òÊÖ¤·¡¢ +.BR basename () +¤ÏºÇ¸å¤Î \(aq/\(aq °Ê¹ß¤ÎÉôʬ¤òÊÖ¤¹¡£ +ʸ»úÎó¤ÎËöÈø¤Ë¤Ä¤¤¤¿ \(aq/\(aq ʸ»ú¤Ï¡¢¥Ñ¥¹Ì¾¤Î°ìÉô¤È¤Ï¤ß¤Ê¤µ¤ì¤Ê¤¤¡£ +.PP +.\"O If +.\"O .I path +.\"O does not contain a slash, +.\"O .BR dirname () +.\"O returns the string "." while +.\"O .BR basename () +.\"O returns a copy of +.\"O .IR path . +.\"O If +.\"O .I path +.\"O is the string "/", then both +.\"O .BR dirname () +.\"O and +.\"O .BR basename () +.\"O return the string "/". +.\"O If +.\"O .I path +.\"O is a NULL pointer or points to an empty string, then both +.\"O .BR dirname () +.\"O and +.\"O .BR basename () +.\"O return the string ".". +.I path +¤Ë '/' ʸ»ú¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢ +.BR dirname () +¤Ïʸ»úÎó "." ¤òÊÖ¤·¡¢ +.BR basename () +¤Ï +.I path +¤ÈƱ¤¸ÆâÍƤòÊÖ¤¹¡£ +.I path +¤¬Ê¸»úÎó "/" ¤ËÅù¤·¤¤¾ì¹ç¤Ï¡¢ +.BR dirname () +¤â +.BR basename () +¤âʸ»úÎó "/" ¤òÊÖ¤¹¡£ +.I path +¤¬ NULL ¥Ý¥¤¥ó¥¿¤À¤Ã¤¿¤ê¡¢¶õ¤Îʸ»úÎó¤ò»Ø¤·¤Æ¤¤¤¿¾ì¹ç¤Ï¡¢ +.BR dirname () +¤â +.BR basename () +¤âʸ»úÎó "." ¤òÊÖ¤¹¡£ +.PP +.\"O Concatenating the string returned by +.\"O .BR dirname (), +.\"O a "/", and the string returned by +.\"O .BR basename () +.\"O yields a complete pathname. +.BR dirname () +¤ÎÊÖ¤·¤¿Ê¸»úÎó¡¢ "/"¡¢ +.BR basename () +¤ÎÊÖ¤·¤¿Ê¸»úÎó¡¢ +¤ò½ç¤Ë·ë¹ç¤¹¤ë¤È¡¢´°Á´¤Ê¥Ñ¥¹Ì¾¤¬ÆÀ¤é¤ì¤ë¡£ +.PP +.\"O Both +.\"O .BR dirname () +.\"O and +.\"O .BR basename () +.\"O may modify the contents of +.\"O .IR path , +.\"O so it may be desirable to pass a copy when calling one of +.\"O these functions. +.BR dirname () +¤È +.BR basename () +¤Ï¡¢¤¤¤º¤ì¤â +.I path +¤ÎÆâÍƤòÊѹ¹¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë¤Ï +¥³¥Ô¡¼¤òÅϤ¹¤Î¤¬Ë¾¤Þ¤·¤¤¡£ +.PP +.\"O These functions may return pointers to statically allocated memory +.\"O which may be overwritten by subsequent calls. +.\"O Alternatively, they may return a pointer to some part of +.\"O .IR path , +.\"O so that the string referred to by +.\"O .I path +.\"O should not be modified or freed until the pointer returned by +.\"O the function is no longer required. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¤³¤È¤¬¤¢¤ê¡¢ +¤³¤ì¤é¤ÎÎΰè¤Ï¸å¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤Þ¤¿¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I path +¤Î°ìÉôʬ¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¤³¤È¤â¤¢¤ë¡£¤½¤Î¤¿¤á¡¢ +.I path +¤Ç»²¾È¤µ¤ì¤ëʸ»úÎó¤Ï¡¢´Ø¿ô¤¬ÊÖ¤¹¥Ý¥¤¥ó¥¿¤¬ÉÔÍפˤʤë¤Þ¤Ç¤Ï +Êѹ¹¤·¤¿¤ê free ¤·¤¿¤ê¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.PP +.\"O The following list of examples (taken from SUSv2) +.\"O shows the strings returned by +.\"O .BR dirname () +.\"O and +.\"O .BR basename () +.\"O for different paths: +°Ê²¼¤Î°ìÏ¢¤ÎÎã (SUSv2 ¤«¤é°úÍÑ) ¤Ï¡¢ +¤¤¤í¤¤¤í¤Ê path ¤ËÂФ·¤Æ +.BR dirname () +¤È +.BR basename () +¤¬ÊÖ¤¹Ê¸»úÎó¤òɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.sp +.nf +.B "path dirname basename" +"/usr/lib" "/usr" "lib" +"/usr/" "/" "usr" +"usr" "." "usr" +"/" "/" "/" +"." "." "." +".." "." ".." +.fi +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O Both +.\"O .BR dirname () +.\"O and +.\"O .BR basename () +.\"O return pointers to null-terminated strings. +.\"O (Do not pass these pointers to +.\"O .BR free (3).) +.BR dirname () +¤È +.BR basename () +¤Ï¡¢¤¤¤º¤ì¤â NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +(¤³¤ì¤é¤Î¥Ý¥¤¥ó¥¿¤ò +.BR free (3) +¤ËÅϤµ¤Ê¤¤¤³¤È¡£) +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O There are two different versions of +.\"O .BR basename () +.\"O - the POSIX version described above, and the GNU version, which one gets +.\"O after +.BR basename () +¤Ë¤Ï 2¼ïÎà¤Î°Û¤Ê¤ë¥Ð¡¼¥¸¥ç¥ó¤¬¤¢¤ë¡£ +°ì¤Ä¤Ï¤¹¤Ç¤ËÀâÌÀ¤·¤¿ POSIX ¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ê¡¢ +¤â¤¦°ì¤Ä¤Ï GNU ¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë¡£ +GNU ¥Ð¡¼¥¸¥ç¥ó¤ò»ÈÍѤ¹¤ë¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¡£ +.br +.nf + +.B " #define _GNU_SOURCE" +.br +.B " #include " + +.fi +.\"O The GNU version never modifies its argument, and returns the +.\"O empty string when +.\"O .I path +.\"O has a trailing slash, and in particular also when it is "/". +.\"O There is no GNU version of +.\"O .BR dirname (). +GNU ¥Ð¡¼¥¸¥ç¥ó¤Ï°ú¤­¿ô¤òÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ê¤¯¡¢ +.I path +¤ÎËöÈø¤¬ '/'¤Î¾ì¹ç¤Ï¶õ¤Îʸ»úÎó¤òÊÖ¤¹¡£ +ÆÃ¤Ë +.I path +¤¬ "/" ¤Î¾ì¹ç¤â¶õʸ»úÎó¤òÊÖ¤¹¡£ +.BR dirname () +¤Ë¤Ï GNU ¥Ð¡¼¥¸¥ç¥ó¤Ï¤Ê¤¤¡£ +.LP +.\"O With glibc, one gets the POSIX version of +.\"O .BR basename () +.\"O when +.\"O .I +.\"O is included, and the GNU version otherwise. +glibc ¤Ç¤Ï¡¢ +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤È POSIX ¥Ð¡¼¥¸¥ç¥ó¤Î +.BR basename () +¤¬»ÈÍѤµ¤ì¡¢¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï GNU ¥Ð¡¼¥¸¥ç¥ó¤È¤Ê¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O In the glibc implementation of the POSIX versions of these functions +.\"O they modify their argument, and segfault when called with a static string +.\"O like "/usr/". +glibc ¤Î POSIX ¥Ð¡¼¥¸¥ç¥ó¤Î¼ÂÁõ¤Ç¤Ï¡¢°ú¤­¿ô¤ÎÆâÍƤ¬Êѹ¹¤µ¤ì¡¢ +°ú¤­¿ô¤Ë ("/usr/" ¤Ê¤É¤Î) Äê¿ôʸ»úÎó¤ò»ØÄꤵ¤ì¤ë¤È +¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó¥Õ¥©¡¼¥ë¥È¤òµ¯¤³¤¹¡£ +.\"O Before glibc 2.2.1, the glibc version of +.\"O .BR dirname () +.\"O did not correctly handle pathnames with trailing \(aq/\(aq characters, +.\"O and generated a segfault if given a NULL argument. +¥Ð¡¼¥¸¥ç¥ó 2.2.1 °ÊÁ°¤Î glibc ¤Ç¤Ï¡¢ glibc ¤Î +.BR dirname () +¤ÏËöÈø¤¬ \(aq/\(aq ʸ»ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥Ñ¥¹Ì¾¤òÀµ¤·¤¯°·¤¨¤º¡¢ +°ú¤­¿ô¤¬ NULL ¤À¤È¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó¥Õ¥©¡¼¥ë¥È¤òµ¯¤³¤·¤¿¡£ +.\"O .SH EXAMPLE +.SH Îã +.in +4n +.nf +char *dirc, *basec, *bname, *dname; +char *path = "/etc/passwd"; + +dirc = strdup(path); +basec = strdup(path); +dname = dirname(dirc); +bname = basename(basec); +printf("dirname=%s, basename=%s\\n", dname, bname); +.fi +.in +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR basename (1), +.BR dirname (1), +.BR feature_test_macros (7) diff --git a/draft/man3/bcmp.3 b/draft/man3/bcmp.3 new file mode 100644 index 00000000..43479a1c --- /dev/null +++ b/draft/man3/bcmp.3 @@ -0,0 +1,101 @@ +.\" +.\" 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 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 +.\" +.TH BCMP 3 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +.\"O bcmp \- compare byte sequences +bcmp \- ¥Ð¥¤¥ÈÎó¤òÈæ³Ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int bcmp(const void *" s1 ", const void *" s2 ", size_t " n ); +.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 °Ê³°¤òÊÖ¤¹¡£ +.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 () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR memcmp (3), +.BR strcasecmp (3), +.BR strcmp (3), +.BR strcoll (3), +.BR strncasecmp (3), +.BR strncmp (3) diff --git a/draft/man3/bcopy.3 b/draft/man3/bcopy.3 new file mode 100644 index 00000000..a3d4f3f0 --- /dev/null +++ b/draft/man3/bcopy.3 @@ -0,0 +1,102 @@ +.\" 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 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" +.SH ̾Á° +.\"O bcopy \- copy byte sequence +bcopy \- ¥Ð¥¤¥ÈÎó¤ò¥³¥Ô¡¼¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void bcopy(const void *" src ", void *" dest ", size_t " n ); +.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. +Îΰ褬½Å¤Ê¤Ã¤Æ¤¤¤Æ¤â¡¢·ë²Ì¤ÏÀµ¤·¤¤¤â¤Î¤Ç¤¢¤ë¡£ +.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" +.SH ´ØÏ¢¹àÌÜ +.BR memccpy (3), +.BR memcpy (3), +.BR memmove (3), +.BR strcpy (3), +.BR strncpy (3) diff --git a/draft/man3/bindresvport.3 b/draft/man3/bindresvport.3 new file mode 100644 index 00000000..ccd3517e --- /dev/null +++ b/draft/man3/bindresvport.3 @@ -0,0 +1,166 @@ +.\" Copyright (C) 2007, Michael Kerrisk +.\" and 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. +.\" +.\" 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 +.SH ̾Á° +.\"O bindresvport \- bind a socket to a privileged IP port +bindresvport \- ¥½¥±¥Ã¥È¤òÆø¢ IP ¥Ý¡¼¥È¤Ë¥Ð¥¤¥ó¥É¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.LP +.BI "int bindresvport(int " sockfd ", struct sockaddr_in *" sin ); +.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 + +.\"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 +¤ËÆþ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ + +.\"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 +.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 +.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. +Á´¤Æ¤ÎÆø¢¥Ý¡¼¥È¤¬»ÈÍÑÃæ¤Ç¤¢¤ë¡£ +.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" +.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 +.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 +¤ÇÅϤ·¤¿ÃͤϤɤó¤ÊÃͤǤ¢¤Ã¤Æ¤â̵»ë¤µ¤ì¤ë¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR bind (2), +.BR getsockname (2) diff --git a/draft/man3/bsd_signal.3 b/draft/man3/bsd_signal.3 new file mode 100644 index 00000000..c7f0d335 --- /dev/null +++ b/draft/man3/bsd_signal.3 @@ -0,0 +1,163 @@ +.\" 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 +.\" +.\"WORD: reliable ¿®ÍêÀ­¤Î¤¢¤ë +.\"WORD: unreliable ¿®ÍêÀ­¤Ë·ç¤±¤ë +.\"WORD: signal semantics ¥·¥°¥Ê¥ë½èÍýÊý¼° +.\" +.TH BSD_SIGNAL 3 2009-03-15 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O bsd_signal \- signal handling with BSD semantics +bsd_signal \- BSD Êý¼°¤Î¥·¥°¥Ê¥ë½èÍý +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "sighandler_t bsd_signal(int " signum ", sighandler_t " handler ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR bsd_signal () +.\"O function takes the same arguments, and performs the same task, as +.\"O .BR signal (2). +.BR bsd_signal () +´Ø¿ô¤Ï +.BR signal (2) +¤ÈƱ¤¸°ú¤­¿ô¤ò¤È¤ê¡¢Æ±¤¸½èÍý¤ò¼Â¹Ô¤¹¤ë¡£ + +.\"O The difference between the two is that +.\"O .BR bsd_signal () +.\"O is guaranteed to provide reliable signal semantics, that is: +.\"O a) the disposition of the signal is not reset to the default +.\"O when the handler is invoked; +.\"O b) delivery of further instances of the signal is blocked while +.\"O the signal handler is executing; and +.\"O c) if the handler interrupts a blocking system call, +.\"O then the system call is automatically restarted. +.\"O A portable application cannot rely on +.\"O .BR signal (2) +.\"O to provide these guarantees. +ξ¼Ô¤Î°ã¤¤¤Ï¡¢ +.BR bsd_signal () +¤Ç¤Ï¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤ÎÄ󶡤¬Êݾڤµ¤ì¤Æ¤¤¤ë¤³¤È¤Ç¤¢¤ë¡£ +¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤Ï°Ê²¼¤ÎÆÃħ¤ò»ý¤Ä¡£ +a) ¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤¿¾ì¹ç¤Ë¡¢¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡ (disposition) ¤¬ +¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤Ê¤¤¡¢ +b) ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¡¢¤½¤ì°Ê¹ß¤ËȯÀ¸¤·¤¿Æ±¤¸¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤¬ +¥Ö¥í¥Ã¥¯¤µ¤ì¤Ê¤¤¡¢ +c) ¥Ï¥ó¥É¥é¤¬Ää»ßÃæ¤Î (blocking ¤·¤Æ¤¤¤ë) ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò +ÃæÃǤ·¤¿¾ì¹ç¡¢¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¼«Æ°Åª¤ËºÆ³«¤µ¤ì¤ë¡£ +°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +.BR signal (2) +¤Ç¤³¤ì¤é¤¬Êݾڤµ¤ì¤ë¤³¤È¤òÁ°Äó¤Ë¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR bsd_signal () +.\"O function returns the previous value of the signal handler, or +.\"O .B SIG_ERR +.\"O on error. +.BR bsd_signal () +´Ø¿ô¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎľÁ°¤ÎÃͤòÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.B SIG_ERR +¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O As for +.\"O .BR signal (2). +.BR signal (2) +¤ÈƱ¤¸¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.2BSD, POSIX.1-2001. +.\"O POSIX.1-2008 removes the specification of +.\"O .BR bsd_signal (), +.\"O recommending the use of +.\"O .BR sigaction (2) +.\"O instead. +POSIX.1-2008 ¤Ç¤Ï +.BR bsd_signal () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +Âå¤ï¤ê¤Ë¡¢ +.BR sigaction (2) +¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Use of +.\"O .BR bsd_signal () +.\"O should be avoided; use +.\"O .BR sigaction (2) +.\"O instead. +.BR bsd_signal () +¤Î»ÈÍѤÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£Âå¤ï¤ê¤Ë +.BR sigaction (2) +¤ò»È¤¦¤³¤È¡£ + +.\"O On modern Linux systems, +.\"O .BR bsd_signal () +.\"O and +.\"O .BR signal (2) +.\"O are equivalent. +.\"O But on older systems, +.\"O .BR signal (2) +.\"O provided unreliable signal semantics; see +.\"O .BR signal (2) +.\"O for details. +ºÇ¶á¤Î Linux ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR bsd_signal () +¤È +.BR signal (2) +¤ÏÅù²Á¤Ç¤¢¤ë¡£¤·¤«¤·¡¢°ÊÁ°¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR signal (2) +¤Ï¿®ÍêÀ­¤Ë·ç¤±¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤òÄ󶡤·¤Æ¤¤¤¿¡£ +¾ÜºÙ¤Ï +.BR signal (2) +¤ò»²¾È¡£ + +.\"O The use of +.\"O .I sighandler_t +.\"O is a GNU extension; +.\"O this type is only defined if the +.\"O .B _GNU_SOURCE +.\"O feature test macro is defined. +.I sighandler_t +¤ò»È¤Ã¤Æ¤¤¤ë¤Î¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +¤³¤Î·¿¤Ïµ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _GNU_SOURCE +¤òÄêµÁ¤·¤¿¾ì¹ç¤Ë¤Î¤ßÄêµÁ¤µ¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sigaction (2), +.BR signal (2), +.BR sysv_signal (3), +.BR feature_test_macros (7), +.BR signal (7) diff --git a/draft/man3/bsearch.3 b/draft/man3/bsearch.3 new file mode 100644 index 00000000..be0c7c4d --- /dev/null +++ b/draft/man3/bsearch.3 @@ -0,0 +1,154 @@ +.\" 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 Mon Mar 29 22:41:16 1993, David Metcalfe +.\" Modified Sat Jul 24 21:35:16 1993, Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-03-18, NAKANO Takeo +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" +.TH BSEARCH 3 2003-11-01 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O bsearch \- binary search of a sorted array +bsearch \- ¥½¡¼¥È¤µ¤ì¤¿ÇÛÎó¤òÆóʬÌÚ¸¡º÷ (binary search) ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *bsearch(const void *" key ", const void *" base , +.BI " size_t " nmemb ", size_t " size , +.BI " int (*" compar ")(const void *, const void *));" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR bsearch () +.\"O function searches an array of \fInmemb\fP objects, +.\"O the initial member of which is pointed to by \fIbase\fP, for a member +.\"O that matches the object pointed to by \fIkey\fP. +.\"O The size of each member +.\"O of the array is specified by \fIsize\fP. +.BR bsearch () +´Ø¿ô¤Ï \fInmemb\fP ¸Ä¤Î¥ª¥Ö¥¸¥§¥¯¥È¤«¤é¤Ê¤ëÇÛÎó¤ò¸¡º÷ +¤¹¤ë¡£ÇÛÎó¤ÎºÇ½é¤Î¥á¥ó¥Ð¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï \fIbase\fP ¤Ë¤è¤Ã¤ÆÍ¿¤¨¤ë¡£ +¥Ý¥¤¥ó¥¿ \fIkey\fP ¤Ç»²¾È¤µ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È¤È°ìÃפ¹¤ë¥á¥ó¥Ð¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +ÇÛÎóÃæ¤Î³Æ¡¹¤Î¥á¥ó¥Ð¡¼¤Î¥µ¥¤¥º¤Ï \fIsize\fP ¤Ë¤è¤Ã¤Æ»ØÄꤹ¤ë¡£ +.PP +.\"O The contents of the array should be in ascending sorted order according +.\"O to the comparison function referenced by \fIcompar\fP. +.\"O The \fIcompar\fP +.\"O routine is expected to have two arguments which point to the \fIkey\fP +.\"O object and to an array member, in that order, and should return an integer +.\"O less than, equal to, or greater than zero if the \fIkey\fP object is found, +.\"O respectively, to be less than, to match, or be greater than the array +.\"O member. +ÇÛÎó¤ÎÆâÍƤÏÈæ³Ó´Ø¿ô \fIcompar\fP ¤Ë´ð¤Å¤­¡¢¾º½ç¤Ë¥½¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤±¤ì +¤Ð¤Ê¤é¤Ê¤¤¡£ \fIcompar\fP ¥ë¡¼¥Á¥ó¤ÏÆó¤Ä¤Î°ú¿ô¤ò¼è¤ë´Ø¿ô¤Ç¡¢°ì¤Ä +ÌÜ¤Ë \fIkey\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¡¢¼¡¤ËÇÛÎó¤Î¥á¥ó¥Ð¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò¼è¤ë¡£ +¤³¤Î½ç¤Ë»ØÄꤷ¤¿¤È¤­¡¢ \fIkey\fP ¤¬ÇÛÎó¥á¥ó¥Ð¡¼¤è¤ê¾®¤µ¤¤¤È¤­¤Ë¤Ï +Éé¤ÎÀ°¿ô¤ò¡¢Â礭¤¤¤È¤­¤Ë¤ÏÀµ¤ÎÀ°¿ô¤ò¡¢°ìÃפ·¤¿¤È¤­¤Ë¤Ï 0 ¤ò¡¢¤½¤ì¤¾¤ì +\fIcompar\fP ¤ÏÊÖ¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR bsearch () +.\"O function returns a pointer to a matching member of the +.\"O array, or NULL if no match is found. If there are multiple elements that +.\"O match the key, the element returned is unspecified. +.BR bsearch () +´Ø¿ô¤Ï¡¢ÇÛÎó¤Î¥á¥ó¥Ð¡¼¤Î¤¦¤Á¡¢°ìÃפ·¤¿¤â¤Î¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò +ÊÖ¤¹¡£¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¤È¤­¤Ï NULL ¤òÊÖ¤¹¡£ \fIkey\fP ¤È°ìÃפ·¤¿¥á¥ó¥Ð¡¼¤¬ +Ê£¿ô¤¢¤ë¤È¤­¡¢¤½¤Î¤¦¤Á¤Î¤É¤Î¥á¥ó¥Ð¡¼¤¬ÊÖ¤µ¤ì¤ë¤«¤Ï¤ï¤«¤é¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001, C89, C99. +.\"O .SH EXAMPLE +.SH Îã +.\"O The example below first sorts an array of structures using +.\"O .BR qsort (3), +.\"O then retrieves desired elements using +.\"O .BR bsearch (). +°Ê²¼¤ÎÎã¤Ï¡¢ +.BR qsort (3) +¤ò»È¤Ã¤Æ¹½Â¤ÂΤÎÇÛÎó¤ÎʤӴ¹¤¨¤ò¹Ô¤Ã¤¿¸å¡¢ +½ê˾¤ÎÍ×ÁǤò +.BR bsearch () +¤ò»È¤Ã¤Æ¼èÆÀ¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.sp +.nf +#include +#include +#include + +struct mi { + int nr; + char *name; +} months[] = { + { 1, "jan" }, { 2, "feb" }, { 3, "mar" }, { 4, "apr" }, + { 5, "may" }, { 6, "jun" }, { 7, "jul" }, { 8, "aug" }, + { 9, "sep" }, {10, "oct" }, {11, "nov" }, {12, "dec" } +}; + +#define nr_of_months (sizeof(months)/sizeof(months[0])) + +static int +compmi(const void *m1, const void *m2) +{ + struct mi *mi1 = (struct mi *) m1; + struct mi *mi2 = (struct mi *) m2; + return strcmp(mi1\->name, mi2\->name); +} + +int +main(int argc, char **argv) +{ + int i; + + qsort(months, nr_of_months, sizeof(struct mi), compmi); + for (i = 1; i < argc; i++) { + struct mi key, *res; + key.name = argv[i]; + res = bsearch(&key, months, nr_of_months, + sizeof(struct mi), compmi); + if (res == NULL) + printf("\(aq%s\(aq: unknown month\en", argv[i]); + else + printf("%s: month #%d\en", res\->name, res\->nr); + } + exit(EXIT_SUCCESS); +} +.fi +.\"O .\" this example referred to in qsort.3 +.\" ¤³¤ÎÎã¤Ï qsort.3 ¤Ç»²¾È¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR hsearch (3), +.BR lsearch (3), +.BR qsort (3), +.BR tsearch (3) diff --git a/draft/man3/bstring.3 b/draft/man3/bstring.3 new file mode 100644 index 00000000..10b3e7df --- /dev/null +++ b/draft/man3/bstring.3 @@ -0,0 +1,110 @@ +.\" 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-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 +.\" +.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 +.sp +.BI "int bcmp(const void *" s1 ", const void *" s2 ", int " n ); +.sp +.BI "void bcopy(const void *" src ", void *" dest ", int " n ); +.sp +.BI "void bzero(void *" s ", int " n ); +.sp +.BI "void *memccpy(void *" dest ", const void *" src ", int " c ", size_t " n ); +.sp +.BI "void *memchr(const void *" s ", int " c ", size_t " n ); +.sp +.BI "int memcmp(const void *" s1 ", const void *" s2 ", size_t " n ); +.sp +.BI "void *memcpy(void *" dest ", const void *" src ", size_t " n ); +.sp +.BI "void *memfrob(void *" s ", size_t " n ); +.sp +.BI "void *memmem(const void *" needle ", size_t " needlelen , +.BI " const void *" haystack ", size_t " haystacklen ); +.sp +.BI "void *memmove(void *" dest ", const void *" src ", size_t " n ); +.sp +.BI "void *memset(void *" s ", int " c ", size_t " n ); +.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 +.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 °Ê³°¤Î¥·¥¹¥Æ¥à¤Ç¤ÏÍÑ°Õ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤¹¤é¤¢¤ë¡£ +.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) diff --git a/draft/man3/btowc.3 b/draft/man3/btowc.3 new file mode 100644 index 00000000..4f56cba1 --- /dev/null +++ b/draft/man3/btowc.3 @@ -0,0 +1,112 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" Japanese Version Copyright (c) 1999 HAYAKAWA Hitoshi +.\" all rights reserved. +.\" Translated Sep 11, 1999 HAYAKAWA Hitoshi +.\" +.\"WORD: locale ¥í¥±¡¼¥ë +.\"WORD: convert ¥³¥ó¥Ð¡¼¥È +.\"WORD: single byte ¥·¥ó¥°¥ë¥Ð¥¤¥È +.\"WORD: wide character ¥ï¥¤¥É¥­¥ã¥é¥¯¥¿¡¼ +.\"WORD: state ¾õÂÖ +.\" +.TH BTOWC 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O btowc \- convert single byte to wide character +.SH ̾Á° +btowc \- ¥·¥ó¥°¥ë¥Ð¥¤¥È¤ò¥ï¥¤¥Éʸ»ú¤Ë¥³¥ó¥Ð¡¼¥È¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wint_t btowc(int " c ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR btowc () +.\"O function converts \fIc\fP, interpreted as a multibyte sequence +.\"O of length 1, starting in the initial shift state, to a wide character and +.\"O returns it. +.\"O If \fIc\fP is +.\"O .B EOF +.\"O or not a valid multibyte sequence of length 1, +.\"O the +.\"O .BR btowc () +.\"O function returns +.\"O .BR WEOF . +.BR btowc () +´Ø¿ô¤Ï½é´ü¥·¥Õ¥È¾õÂÖ¤«¤é»Ï¤Þ¤ëŤµ 1 ¤Î¥Þ¥ë¥Á¥Ð¥¤¥È¤Î¥·¡¼¥±¥ó¥¹¤È¤·¤Æ +²ò¼á¤µ¤ì¡¢\fIc\fP ¤ò¥ï¥¤¥Éʸ»ú¤Ë¥³¥ó¥Ð¡¼¥È¤·¤ÆÊÖ¤¹¡£ +\fIc\fP ¤¬ +.B EOF +¤â¤·¤¯¤ÏŤµ 1 ¤Î̵¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤Î¾ì¹ç¡¢ +.BR btowc () +´Ø¿ô¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR btowc () +.\"O function returns the wide character +.\"O converted from the single byte \fIc\fP. +.\"O If \fIc\fP is +.\"O .B EOF +.\"O or not a valid multibyte sequence of length 1, +.\"O it returns +.\"O .BR WEOF . +.BR btowc () +´Ø¿ô¤Ï¥·¥ó¥°¥ë¥Ð¥¤¥È \fIc\fP ¤«¤é¥³¥ó¥Ð¡¼¥È¤µ¤ì¤¿¥ï¥¤¥Éʸ»ú¤òÊÖ¤¹¡£ +\fIc\fP ¤¬ +.B EOF +¤â¤·¤¯¤ÏŤµ 1 ¤Î̵¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤Î¾ì¹ç¡¢ +.BR btowc () +´Ø¿ô¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99, POSIX.1-2001. +.\"O .SH NOTES +.\"O The behavior of +.\"O .BR btowc () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.\"O .PP +.\"O This function should never be used. +.\"O It does not work for encodings which have +.\"O state, and unnecessarily treats single bytes differently from multibyte +.\"O sequences. +.\"O Use the function +.\"O .BR mbtowc () +.\"O instead. +.SH Ãí°Õ +.BR btowc () +¤Î¿¶¤ëÉñ¤¤¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¡¼¤Ë°Í¸¤¹¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤Ï»ÈÍѤµ¤ì¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£¾õÂÖ(state)¤ò»ý¤Ã¤¿¥¨¥ó¥³¡¼¥É¤Ë¤Ï»È¤¨¤º¡¢ +¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤È¤Ï°ã¤¤¡¢É¬¤º¤·¤â¥·¥ó¥°¥ë¥Ð¥¤¥È +¤ò¼è¤ê°·¤¨¤ë¤È¤Ï¸Â¤é¤Ê¤¤¡£ +.BR mbtowc () +¤òÂå¤ï¤ê¤È¤·¤Æ»ÈÍѤ·¤Ê¤µ¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR wctob (3), +.BR mbtowc (3) diff --git a/draft/man3/btree.3 b/draft/man3/btree.3 new file mode 100644 index 00000000..1949cfd7 --- /dev/null +++ b/draft/man3/btree.3 @@ -0,0 +1,370 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)btree.3 8.4 (Berkeley) 8/18/94 +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito +.\" all rights reserved. +.\" Translated Mon Jul 26 21:43:11 JST 1999 +.\" by Shouichi Saito +.\" Proofed Mon Aug 16 1999 by NAKANO Takeo +.\" +.\"WORD: access method ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.\"WORD: prefix (comparison) Á°ÃÖÈæ³Ó +.TH BTREE 3 1994-08-18 "" "Linux Programmer's Manual" +.UC 7 +.SH ̾Á° +.\"O btree \- btree database access method +btree \- btree ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.SH ½ñ¼° +.nf +.ft B +#include +#include +.ft R +.fi +.SH ÀâÌÀ +.\"O The routine +.\"O .BR dbopen (3) +.\"O is the library interface to database files. +¥ë¡¼¥Á¥ó +.BR dbopen (3) +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +.\"O One of the supported file formats is btree files. +.\"O The general description of the database access methods is in +.\"O .BR dbopen (3), +.\"O this manual page describes only the btree specific information. +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¤Ò¤È¤Ä¤Ë btree ¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¡£ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ë´Ø¤¹¤ë°ìÈÌŪ¤Êµ­½Ò¤Ï +.BR dbopen (3) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï btree ÆÃÍ­¤Î¾ðÊó¤Ë¤Ä¤¤¤Æ¤Î¤ßµ­½Ò¤¹¤ë¡£ +.PP +.\"O The btree data structure is a sorted, balanced tree structure storing +.\"O associated key/data pairs. +btree ¥Ç¡¼¥¿¹½Â¤¤Ç¤Ï¡¢¥½¡¼¥È¤µ¤ì¤¿¥Ð¥é¥ó¥¹¥Ä¥ê¡¼¹½Â¤¤Ë +¸ß¤¤¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥­¡¼/¥Ç¡¼¥¿ÂФò³ÊǼ¤·¤Æ¤¤¤ë¡£ +.PP +.\"O The btree access method specific data structure provided to +.\"O .BR dbopen (3) +.\"O is defined in the +.\"O .I +.\"O include file as follows: +.BR dbopen (3) +¤ËÅϤµ¤ì¤ë btree ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤ËÆÃÍ­¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢ +.I +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ç¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf + +typedef struct { + unsigned long flags; + unsigned int cachesize; + int maxkeypage; + int minkeypage; + unsigned int psize; + int (*compare)(const DBT *key1, const DBT *key2); + size_t (*prefix)(const DBT *key1, const DBT *key2); + int lorder; +} BTREEINFO; +.fi +.in +.sp +.\"O The elements of this structure are as follows: +¤³¤Î¹½Â¤ÂΤÎÍ×ÁǤò°Ê²¼¤Ë¼¨¤¹¡£ +.TP +.I flags +.\"O The flag value is specified by +.\"O .IR or 'ing +.\"O any of the following values: +.I flags +¤ÎÃͤϰʲ¼¤ÎÃͤΤ¤¤º¤ì¤«¤«¡¢¤³¤ì¤é¤ÎÏÀÍýϤǻØÄꤵ¤ì¤ë¡£ +.RS +.TP +.B R_DUP +.\"O Permit duplicate keys in the tree, that is, +.\"O permit insertion if the key to be +.\"O inserted already exists in the tree. +.\"O The default behavior, as described in +.\"O .BR dbopen (3), +.\"O is to overwrite a matching key when inserting a new key or to fail if +.\"O the +.\"O .B R_NOOVERWRITE +.\"O flag is specified. +¥Ä¥ê¡¼¤ÎÃæ¤Ë¥­¡¼¤Î½ÅÊ£¤òµö¤¹¡£¤¹¤Ê¤ï¤Á¥Ä¥ê¡¼¤ÎÃæ¤ËÁÞÆþ¤µ¤ì¤è¤¦¤È¤·¤Æ¤¤¤ë +¥­¡¼¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤Æ¤â¡¢¤½¤ÎÁÞÆþ¤òµö²Ä¤¹¤ë¡£¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï +.BR dbopen (3) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¡¢¿·¤·¤¤¥­¡¼¤¬ÁÞÆþ¤µ¤ì¤ë¤È°ìÃפ·¤¿¥­¡¼¤ò¾å½ñ¤­¤¹¤ë¡£ +¤¢¤ë¤¤¤Ï +.B R_NOOVERWRITE +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤ÈÁÞÆþ¤Ë¼ºÇÔ¤¹¤ë¡£ +.\"O The +.\"O .B R_DUP +.\"O flag is overridden by the +.\"O .B R_NOOVERWRITE +.\"O flag, and if the +.\"O .B R_NOOVERWRITE +.\"O flag is specified, attempts to insert duplicate keys into +.\"O the tree will fail. +.B R_DUP +¥Õ¥é¥°¤Ï +.B R_NOOVERWRITE +¥Õ¥é¥°¤Ë¤è¤Ã¤Æ¾å½ñ¤­¤µ¤ì¤ë¡£¤Ä¤Þ¤ê +.B R_NOOVERWRITE +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥Ä¥ê¡¼¤ËÊ£À½¥­¡¼¤òÁÞÆþ¤·¤è¤¦¤È¤¹¤ë¤È¼ºÇÔ¤¹¤ë¡£ +.IP +.\"O If the database contains duplicate keys, the order of retrieval of +.\"O key/data pairs is undefined if the +.\"O .I get +.\"O routine is used, however, +.\"O .I seq +.\"O routine calls with the +.\"O .B R_CURSOR +.\"O flag set will always return the logical +.\"O "first" of any group of duplicate keys. +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥­¡¼¤Î½ÅÊ£¤¬¤¢¤ë¤È¡¢ +.I get +¥ë¡¼¥Á¥ó¤ò»È¤Ã¤¿¾ì¹ç¤Î¥­¡¼/¥Ç¡¼¥¿ÂФμèÆÀ½ç¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£¤½¤ì¤ËÂФ·¡¢ +.B R_CURSOR +¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¤Æ +.I seq +¥ë¡¼¥Á¥ó¤ò»È¤¦¤È¡¢Ê£À½¥­¡¼¤Î¥°¥ë¡¼¥×¤ÎÃæ¤Î +ÏÀÍýŪ¤Ë¡ÖºÇ½é¡×¤Î¥­¡¼¤òɬ¤ºÊÖ¤·¤Æ¤¯¤ë¡£ +.RE +.TP +.I cachesize +.\"O A suggested maximum size (in bytes) of the memory cache. +ÁÛÄꤵ¤ì¤ë¥á¥â¥ê¥­¥ã¥Ã¥·¥å¤ÎºÇÂ祵¥¤¥º (¥Ð¥¤¥Èñ°Ì)¡£ +.\"O This value is +.\"O .I only +.\"O advisory, and the access method will allocate more memory rather than fail. +.\"O Since every search examines the root page of the tree, caching the most +.\"O recently used pages substantially improves access time. +¤³¤ÎÃÍ¤Ï +.I ¤¢¤¯¤Þ¤Ç +»²¹Í¤Ç¤¢¤ê¡¢¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ï¤³¤ÎÃͤò±Û¤¨¤¿¥á¥â¥ê¤Î +³ä¤êÅö¤Æ¤ËÀ®¸ù¤¹¤ë¤³¤È¤â¤¢¤ë¡£ +.\"O In addition, physical writes are delayed as long as possible, so a moderate +.\"O cache can reduce the number of I/O operations significantly. +²Ã¤¨¤Æ¡¢ÊªÍýŪ¤Ê½ñ¤­¹þ¤ß¤Ï²Äǽ¤Ê¸Â¤êÃٱ䤵¤ì¤ë¤Î¤Ç¡¢ +¥­¥ã¥Ã¥·¥å¤ÎÂ礭¤µ¤òŬÅ٤ˤ·¤Æ¤ª¤±¤Ð I/O Áàºî¤Î²ó¿ô¤ò¤«¤Ê¤ê¸º¤é¤¹¤³¤È +¤¬¤Ç¤­¤ë¡£ +.\"O Obviously, using a cache increases (but only increases) the likelihood of +.\"O corruption or lost data if the system crashes while a tree is being modified. +¤¢¤­¤é¤«¤Ë¥­¥ã¥Ã¥·¥å¤ò»È¤¦¤È¡¢¥Ä¥ê¡¼¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤ëÅÓÃæ¤Ç +¥·¥¹¥Æ¥à¤¬¥¯¥é¥Ã¥·¥å¤·¤¿¾ì¹ç¤Î¥Ç¡¼¥¿Ç˲õ¤ä¥Ç¡¼¥¿¥í¥¹¥È¤Î²ÄǽÀ­¤Ï +Áý¤¨¤ë (¤Þ¤¢¤Ç¤â¤½¤ì¤À¤±¤Î¤³¤È)¡£ +.\"O If +.I cachesize +.\"O is 0 (no size is specified) a default cache is used. +¤¬ 0 (¥µ¥¤¥º¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥­¥ã¥Ã¥·¥å¤¬»È¤ï¤ì¤ë¡£ +.TP +.I maxkeypage +.\"O The maximum number of keys which will be stored on any single page. +.\"O Not currently implemented. +ñ°ì¥Ú¡¼¥¸¤ËǼ¤á¤é¤ì¤ëºÇÂ祭¡¼¿ô¤Ç¤¢¤ë¡£¸½ºß¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" The maximum number of keys which will be stored on any single page. +.\" Because of the way the btree data structure works, +.\" .I maxkeypage +.\" must always be greater than or equal to 2. +.\" If +.\" .I maxkeypage +.\" is 0 (no maximum number of keys is specified) the page fill factor is +.\" made as large as possible (which is almost invariably what is wanted). +.TP +.I minkeypage +.\"O The minimum number of keys which will be stored on any single page. +.\"O This value is used to determine which keys will be stored on overflow +.\"O pages, that is, if a key or data item is longer than the pagesize divided +.\"O by the minkeypage value, it will be stored on overflow pages instead +.\"O of in the page itself. +ñ°ì¥Ú¡¼¥¸¤ËǼ¤á¤é¤ì¤ëºÇ¾®¥­¡¼¿ô¤Ç¤¢¤ë¡£¤³¤ÎÃͤϡ¢¤É¤Î¥­¡¼¤ò +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¥Ú¡¼¥¸ +¤ËǼ¤á¤ë¤«·è¤á¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£¤¹¤Ê¤ï¤Á¥­¡¼¤Þ¤¿¤Ï¥Ç¡¼¥¿¤¬ +minkeypage ¤ÎÃͤÇʬ³ä¤µ¤ì¤¿¥Ú¡¼¥¸¥µ¥¤¥º¤è¤êÂ礭¤¤»þ¡¢¤½¤Î¥Ú¡¼¥¸¤ËǼ¤á +¤ëÂå¤ï¤ê¤Ë¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¥Ú¡¼¥¸¤ËǼ¤á¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.\"O If +.I minkeypage +.\"O is 0 (no minimum number of keys is specified) a value of 2 is used. +¤¬ 0 (¥­¡¼¤ÎºÇ¾®Ãͤ¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢ÃͤȤ·¤Æ 2 ¤¬»È¤ï¤ì¤ë¡£ +.TP +.I psize +.\"O Page size is the size (in bytes) of the pages used for nodes in the tree. +.\"O The minimum page size is 512 bytes and the maximum page size is 64K. +¥Ä¥ê¡¼¤ÎÃæ¤Î¥Î¡¼¥É¤Ë»È¤ï¤ì¤ë¥Ú¡¼¥¸¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì)¡£ +ºÇ¾®ÃÍ¤Ï 512 ¥Ð¥¤¥È¤Ç¡¢ºÇÂçÃÍ¤Ï 64K ¤Ç¤¢¤ë¡£ +.\"O If +.I psize +.\"O is 0 (no page size is specified) a page size is chosen based on the +.\"O underlying file system I/O block size. +¤¬ 0 (¥Ú¡¼¥¸¥µ¥¤¥º¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î I/O ¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤Ë´ð¤Å¤¤¤Æ·è¤á¤é¤ì¤ë¡£ +.TP +.I compare +.\"O Compare is the key comparison function. +.I compare +¤Ï¥­¡¼¤ÎÈæ³Ó´Ø¿ô¤Ç¤¢¤ë¡£ +.\"O It must return an integer less than, equal to, or greater than zero if the +.\"O first key argument is considered to be respectively less than, equal to, +.\"O or greater than the second key argument. +ºÇ½é¤Î¥­¡¼°ú¿ô¤ËÂФ·¡¢ÆóÈÖÌܤΥ­¡¼°ú¿ô¤¬Â礭¤¤¾ì¹ç¤Ë¤ÏÀµ¤ÎÀ°¿ô¤ò¡¢ +Ʊ¤¸¾ì¹ç¤Ë¤Ï¥¼¥í¤ò¡¢¾®¤µ¤¤¾ì¹ç¤Ë¤ÏÉé¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +.\"O The same comparison function must be used on a given tree every time it +.\"O is opened. +¥Ä¥ê¡¼¤ò³«¤¯ºÝ¤Ë¤Ï¡¢¾ï¤ËƱ¤¸Èæ³Ó´Ø¿ô¤¬»È¤ï¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O If +.I compare +.\"O is NULL (no comparison function is specified), the keys are compared +.\"O lexically, with shorter keys considered less than longer keys. +¤¬ NULL (Èæ³Ó´Ø¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢ +¼­½ñŪ¤ËÈæ³Ó¤µ¤ì¤ë¡£Ã»¤¤¥­¡¼¤ÏŤ¤¥­¡¼¤è¤ê¾®¤µ¤¤¤³¤È¤Ë¤Ê¤ë¡£ +.TP +.I prefix +.\"O Prefix is the prefix comparison function. +.I prefix +¤ÏÁ°ÃÖÈæ³Ó´Ø¿ô¤Ç¤¢¤ë¡£ +.\"O If specified, this routine must return the number of bytes of the second key +.\"O argument which are necessary to determine that it is greater than the first +.\"O key argument. +¤³¤Î¥ë¡¼¥Á¥ó¤Ï (»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï)¡¢ÆóÈÖÌܤΥ­¡¼°ú¿ô¤Î +¥Ð¥¤¥È¿ô¤òÊÖ¤µ¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¤³¤ì¤ÏÆóÈÖÌܤΥ­¡¼°ú¿ô¤¬ +°ìÈÖÌܤΥ­¡¼°ú¿ô¤è¤êÂ礭¤¤¤«¤É¤¦¤«·è¤á¤ë¤Î¤ËɬÍפǤ¢¤ë¡£ +.\"NAKANO ¤Á¤ç¤Ã¤È°ÕÌ£¤ï¤«¤é¤ó... +.\"O If the keys are equal, the key length should be returned. +.\"O Note, the usefulness of this routine is very data-dependent, but, in some +.\"O data sets can produce significantly reduced tree sizes and search times. +¥­¡¼¤¬Æ±¤¸¾ì¹ç¡¢¥­¡¼¤ÎŤµ¤¬Ê֤롣¤³¤Î¥ë¡¼¥Á¥ó¤¬Í­ÍѤ«¤É¤¦¤«¤Ï¡¢ +¥Ç¡¼¥¿¤Ë¶¯¤¯°Í¸¤¹¤ë¡£¤·¤«¤·¥Ç¡¼¥¿¥»¥Ã¥È¤Ë¤è¤Ã¤Æ¤Ï¡¢ÌÀ¤é¤«¤Ë¥Ä¥ê¡¼ +¤Î¥µ¥¤¥º¤È¸¡º÷»þ´Ö¤ò¸º¤é¤·¤Æ¤¯¤ì¤ë¡£ +.\"O If +.\"O .I prefix +.\"O is NULL (no prefix function is specified), +.\"O .I and +.\"O no comparison function is specified, a default lexical comparison routine +.\"O is used. +.I prefix +¤¬ NULL (prefix ´Ø¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Ç¡¢ +.I ¤«¤Ä +Èæ³Ó´Ø¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢¥Ç¥Õ¥©¥ë¥È¤Î¼­½ñÈæ³Ó¥ë¡¼¥Á¥ó¤¬»È¤ï¤ì¤ë¡£ +.\"O If +.\"O .I prefix +.\"O is NULL and a comparison routine is specified, no prefix comparison is +.\"O done. +.I prefix +¤¬ NULL ¤ÇÈæ³Ó´Ø¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢Á°ÃÖÈæ³Ó¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +.TP +.I lorder +.\"O The byte order for integers in the stored database metadata. +.\"O The number should represent the order as an integer; for example, +.\"O big endian order would be the number 4,321. +.\"O If +.\"O .I lorder +.\"O is 0 (no order is specified) the current host order is used. +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥á¥¿¥Ç¡¼¥¿¤ÎÀ°¿ôÃͤΥХ¤¥È¥ª¡¼¥À¡¼¡£ +¤³¤Î¿ô»ú¤Ï¡¢½ç½ø¤òÀ°¿ô¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +Î㤨¤Ð¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤Ê¤é¡¢¤³¤Î¿ôÃÍ¤Ï 4,321 ¤È¤Ê¤ë¡£ +.I lorder +¤¬ 0 (»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢¸½ºß¤Î¥Û¥¹¥È +¤Ç»È¤ï¤ì¤Æ¤¤¤ë¥Ð¥¤¥È¥ª¡¼¥À¡¼¤¬»È¤ï¤ì¤ë¡£ +.PP +.\"O If the file already exists (and the +.\"O .B O_TRUNC +.\"O flag is not specified), the +.\"O values specified for the arguments +.\"O .IR flags , +.\"O .I lorder +.\"O and +.\"O .I psize +.\"O are ignored +.\"O in favor of the values used when the tree was created. +¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤ë (¤Þ¤¿¤Ï +.B O_TRUCT +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤È¡¢ +°ú¤­¿ô +.IR flag , +.IR lorder , +.I psize +¤Ë»ØÄꤵ¤ì¤¿ÃͤÏ̵»ë¤µ¤ì¡¢ +¥Ä¥ê¡¼¤¬ºî¤é¤ì¤¿»þ¤Ë»È¤Ã¤¿Ãͤ¬ÍѤ¤¤é¤ì¤ë¡£ +.PP +.\"O Forward sequential scans of a tree are from the least key to the greatest. +¥Ä¥ê¡¼¤ÎÁ°Êý½ç¸¡º÷¤Ï¡¢ºÇ¾®¥­¡¼¤«¤éºÇÂ祭¡¼¤Ë¸þ¤«¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +.PP +.\"O Space freed up by deleting key/data pairs from the tree is never reclaimed, +.\"O although it is normally made available for reuse. +.\"O This means that the btree storage structure is grow-only. +.\"O The only solutions are to avoid excessive deletions, or to create a fresh +.\"O tree periodically from a scan of an existing one. +¥Ä¥ê¡¼¤«¤é¥­¡¼/¥Ç¡¼¥¿ÂФ¬ºï½ü¤µ¤ì¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤Ç¤­¤¿¥¹¥Ú¡¼¥¹¤Ï¡¢ +Ä̾ïºÆÍøÍѤǤ­¤ë·Á¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¬ºÆÍøÍѤµ¤ì¤ë¤³¤È¤Ï̵¤¤¡£ +¤Ä¤Þ¤ê brtee µ­²±¹½Â¤¤ÏÈîÂ礹¤ë°ìÊý¤Ç¤¢¤ë¡£ +Âкö¤Ï²áÅ٤κï½ü¤òÈò¤±¤ë¤«¡¢ +¸ºß¤¹¤ë¥Ä¥ê¡¼¤òÄ´¤Ù¤ÆÄê´üŪ¤Ë¿·¤·¤¤¥Ä¥ê¡¼¤òºî¤ë¤«¡¢¤À¤±¤Ç¤¢¤ë¡£ +.PP +.\"O Searches, insertions, and deletions in a btree will all complete in +.\"O O lg base N where base is the average fill factor. +.\"O Often, inserting ordered data into btrees results in a low fill factor. +.\"O This implementation has been modified to make ordered insertion the best +.\"O case, resulting in a much better than normal page fill factor. +.SH ¥¨¥é¡¼ +.\"O The +.\"O .I btree +.\"O access method routines may fail and set +.\"O .I errno +.\"O for any of the errors specified for the library routine +.\"O .BR dbopen (3). +.I btree +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¥ë¡¼¥Á¥ó¤Ï¼ºÇÔ¤¹¤ë¤È¡¢¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR dbopen (3) +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Î¤¤¤º¤ì¤«¤ò +.I errno +¤È¤·¤ÆÊÖ¤¹¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Only big and little endian byte order is supported. +¥Ð¥¤¥È¥ª¡¼¥À¡¼¤È¤·¤Æ¤Ï¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤È¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó¤Î¤ß¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR dbopen (3), +.BR hash (3), +.BR mpool (3), +.BR recno (3) +.sp +.IR "The Ubiquitous B-tree" , +Douglas Comer, ACM Comput. Surv. 11, 2 (June 1979), 121-138. +.sp +.IR "Prefix B-trees" , +Bayer and Unterauer, ACM Transactions on Database Systems, Vol. 2, 1 +(March 1977), 11-26. +.sp +.IR "The Art of Computer Programming Vol. 3: Sorting and Searching" , +D.E. Knuth, 1968, pp 471-480. diff --git a/draft/man3/byteorder.3 b/draft/man3/byteorder.3 new file mode 100644 index 00000000..11997590 --- /dev/null +++ b/draft/man3/byteorder.3 @@ -0,0 +1,110 @@ +.\" 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 Sat Jul 24 21:29:05 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Thu Jul 26 14:06:20 2001 by Andries Brouwer (aeb@cwi.nl) +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-05-18, NAKANO Takeo +.\" Updated 2005-11-04, Akihiro MOTOKI +.\" +.TH BYTEORDER 3 2009-01-15 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O htonl, htons, ntohl, ntohs \- convert values between host and network +.\"O byte order +htonl, htons, ntohl, ntohs \- ¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¼¤È¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Î´Ö¤ÇÃͤòÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "uint32_t htonl(uint32_t " hostlong ); +.sp +.BI "uint16_t htons(uint16_t " hostshort ); +.sp +.BI "uint32_t ntohl(uint32_t " netlong ); +.sp +.BI "uint16_t ntohs(uint16_t " netshort ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR htonl () +.\"O function converts the unsigned integer \fIhostlong\fP +.\"O from host byte order to network byte order. +.BR htonl () +´Ø¿ô¤Ï unsigned integer \fIhostlong\fP ¤ò +¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¼¤«¤é¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤ËÊÑ´¹¤¹¤ë¡£ +.PP +.\"O The +.\"O .BR htons () +.\"O function converts the unsigned short integer \fIhostshort\fP +.\"O from host byte order to network byte order. +.BR htons () +´Ø¿ô¤Ï unsigned short integer \fIhostshort\fP ¤ò +¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¼¤«¤é¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤ËÊÑ´¹¤¹¤ë¡£ +.PP +.\"O The +.\"O .BR ntohl () +.\"O function converts the unsigned integer \fInetlong\fP +.\"O from network byte order to host byte order. +.BR ntohl () +´Ø¿ô¤Ï unsigned integer \fInetlong\fP ¤ò +¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤«¤é¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¼¤ËÊÑ´¹¤¹¤ë¡£ +.PP +.\"O The +.\"O .BR ntohs () +.\"O function converts the unsigned short integer \fInetshort\fP +.\"O from network byte order to host byte order. +.BR ntohs () +´Ø¿ô¤Ï unsigned short integer \fInetshort\fP ¤ò +¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤«¤é¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¼¤ËÊÑ´¹¤¹¤ë¡£ +.PP +.\"O On the i386 the host byte order is Least Significant Byte first, +.\"O whereas the network byte order, as used on the Internet, is Most +.\"O Significant Byte first. +i80x86 ¤Î¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç¤ÏºÇ²¼°Ì¥Ð¥¤¥È¤¬¼ã¤¤¥¢¥É¥ì¥¹¤ËÇÛÃÖ¤µ¤ì¤ë¤¬¡¢ +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤ÇÍѤ¤¤é¤ì¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç¤ÏºÇ¾å°Ì¥Ð¥¤¥È +¤¬Àè¤ËÇÛÃÖ¤µ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. + +.\"O Some systems require the inclusion of +.\"O .I +.\"O instead of +.\"O .IR . +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I +¤ÎÂå¤ï¤ê¤Ë +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR endian (3), +.BR gethostbyname (3), +.BR getservent (3) diff --git a/draft/man3/bzero.3 b/draft/man3/bzero.3 new file mode 100644 index 00000000..ffe9f821 --- /dev/null +++ b/draft/man3/bzero.3 @@ -0,0 +1,88 @@ +.\" 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 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 +.\" +.TH BZERO 3 2008-08-06 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O bzero \- write zero-valued bytes +.SH ̾Á° +bzero \- ÃÍ 0 ¤Î¥Ð¥¤¥È¤ÇËä¤á¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void bzero(void *" s ", size_t " n ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR bzero () +.\"O function sets the first +.\"O .I n +.\"O bytes of the byte 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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR memset (3), +.BR swab (3) diff --git a/draft/man3/cabs.3 b/draft/man3/cabs.3 new file mode 100644 index 00000000..3cfeba4b --- /dev/null +++ b/draft/man3/cabs.3 @@ -0,0 +1,63 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Wed Jul 23 05:04:09 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: complex number Ê£ÁÇ¿ô +.\"WORD: alias ¥¨¥¤¥ê¥¢¥¹ +.\" +.TH CABS 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O cabs, cabsf, cabsl \- absolute value of a complex number +.SH ̾Á° +cabs, cabsf, cabsl \- Ê£ÁÇ¿ô¤ÎÀäÂÐÃÍ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double cabs(double complex " z ); +.br +.BI "float cabsf(float complex " z ); +.br +.BI "long double cabsl(long double complex " z ); +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR cabs () +.\"O function returns the absolute value of the complex number +.\"O .IR z . +.\"O The result is a real number. +.BR cabs () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎÀäÂÐÃͤòÊÖ¤¹¡£ +·ë²Ì¤Ï¼Â¿ô¤Ç¤¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH È÷¹Í +.\"O The function is actually an alias for +.\"O .I "hypot(a,\ b)" +.\"O (or, equivalently, +.\"O .IR "sqrt(a*a\ +\ b*b)" ). +¼ÂºÝ¤Ë¤Ï¡¢¤³¤Î´Ø¿ô¤Ï +.I "hypot(a,\ b)" +.RI ( "sqrt(a*a\ +\ b*b)" +¤ÈÅù²Á) ¤Ø¤Î¥¨¥¤¥ê¥¢¥¹¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR abs (3), +.BR cimag (3), +.BR hypot (3), +.BR complex (7) diff --git a/draft/man3/cacos.3 b/draft/man3/cacos.3 new file mode 100644 index 00000000..ddb0b073 --- /dev/null +++ b/draft/man3/cacos.3 @@ -0,0 +1,67 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Wed Jul 23 05:24:21 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: arc sine µÕÀµ¸¹ +.\"WORD: arc cosine µÕ;¸¹ +.\"WORD: arc tangent µÕÀµÀÜ +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CACOS 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O cacos, cacosf, cacosl \- complex arc cosine +.SH ̾Á° +cacos, cacosf, cacosl \- Ê£ÁÇ¿ô¤ÎµÕ;¸¹ (arc cosine) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex cacos(double complex " z ); +.br +.BI "float complex cacosf(float complex " z ); +.br +.BI "long double complex cacosl(long double complex " z ); +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR cacos () +.\"O function calculates the complex arc cosine of +.\"O .IR z . +.\"O If \fIy\ =\ cacos(z)\fP, then \fIz\ =\ ccos(y)\fP. +.\"O The real part of +.\"O .I y +.\"O is chosen in the interval [0,pi]. +.BR cacos () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµÕ;¸¹ (arc cosine) ¤ò·×»»¤¹¤ë¡£ +\fIy\ =\ cacos(z)\fP ¤Ê¤é¤Ð¡¢ \fIz\ =\ ccos(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤Î¼ÂÉô¤ÎÃͤ϶è´Ö [0,pi] ¤«¤éÁªÂò¤µ¤ì¤ë¡£ +.LP +.\"O One has: +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + cacos(z) = \-i clog(z + csqrt(z * z \- 1)) +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ccos (3), +.BR clog (3), +.BR complex (7) diff --git a/draft/man3/cacosh.3 b/draft/man3/cacosh.3 new file mode 100644 index 00000000..37b701e9 --- /dev/null +++ b/draft/man3/cacosh.3 @@ -0,0 +1,75 @@ +.\" Copyright 2002 Walter Harms(walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 00:26:52 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: hyperbolic ÁжÊ(Àþ¤Î) +.\"WORD: arc sine µÕÀµ¸¹ +.\"WORD: arc cosine µÕ;¸¹ +.\"WORD: arc tangent µÕÀµÀÜ +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CACOSH 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O cacosh, cacoshf, cacoshl \- complex arc hyperbolic cosine +cacosh, cacoshf, cacoshl \- Ê£ÁÇ¿ô¤ÎµÕÁжÊÀþ;¸¹ (arc hyperbolic cosine) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex cacosh(double complex " z ); +.br +.BI "float complex cacoshf(float complex " z ); +.br +.BI "long double complex cacoshl(long double complex " z ); +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR cacosh () +.\"O function calculates the complex arc hyperpolic cosine of +.\"O .IR z . +.\"O If \fIy\ =\ cacosh(z)\fP, then \fIz\ =\ ccosh(y)\fP. +.\"O The imaginary part of +.\"O .I y +.\"O is chosen in the interval [\-pi,pi]. +.\"O The real part of +.\"O .I y +.\"O is chosen nonnegative. +.BR cacosh () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµÕÁжÊÀþ;¸¹ (arc hyperbolic cosine) ¤ò·×»»¤¹¤ë¡£ +\fIy\ =\ cacosh(z)\fP ¤Ê¤é¤Ð¡¢ +\fIz\ =\ ccosh(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤ÎµõÉô¤ÎÃͤ϶è´Ö [\-pi,pi] ¤«¤éÁªÂò¤µ¤ì¡¢ +.I y +¤Î¼ÂÉô¤ÎÃͤÏÈóÉé¤ÎÃͤ¬ÁªÂò¤µ¤ì¤ë¡£ +.LP +.\"O One has: +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + cacosh(z) = (0.5) * clog((1 + z) / (1 \- z)) +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR acosh (3), +.BR cabs (3), +.BR cimag (3), +.BR complex (7) diff --git a/draft/man3/canonicalize_file_name.3 b/draft/man3/canonicalize_file_name.3 new file mode 100644 index 00000000..262e4e7b --- /dev/null +++ b/draft/man3/canonicalize_file_name.3 @@ -0,0 +1,37 @@ +.\" Copyright 2005 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" 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 +.SH ̾Á° +.\"O canonicalize_file_name \- return the canonicalized filename +canonicalize_file_name \- Àµµ¬²½¤µ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *canonicalize_file_name(const char *" path ");" +.\"O .SH DESCRIPTION +.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" +.SH ½àµò +.\"O The function is a GNU extension. +¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR realpath (3), +.BR feature_test_macros (7) diff --git a/draft/man3/carg.3 b/draft/man3/carg.3 new file mode 100644 index 00000000..0d634cf4 --- /dev/null +++ b/draft/man3/carg.3 @@ -0,0 +1,92 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-24, Akihiro MOTOKI +.\" Updated 2005-10-02, Akihiro MOTOKI +.\" +.\"WORD: argument (¶ËºÂɸ¤Î)ÊÐ³Ñ +.\"WORD: coordinates ºÂɸ +.\"WORD: rectangular coordinates ľ¸òºÂɸ +.\"WORD: polar coordinates ¶ËºÂɸ +.\" +.TH CARG 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O carg, cargf, cargl \- calculate the argument +carg, cargf, cargl \- Ê£ÁÇ¿ô¤ÎÊгѤò·×»»¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double carg(double complex " z ");" +.br +.BI "float cargf(float complex " z ");" +.br +.BI "long double cargl(long double complex " z ");" +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O A complex number can be described by two real coordinates. +.\"O One may use rectangular coordinates and gets +.\"O +.\"O .nf +.\"O z = x + I * y +.\"O .fi +.\"O +.\"O where \fIx\ =\ creal(z)\fP and \fIy\ =\ cimag(z)\fP. +Ê£ÁÇ¿ô¤Ï 2¤Ä¤Î¼Â¿ôÃͤ«¤é¤Ê¤ëºÂɸ¤Çɽ¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +ľ¸òºÂɸ¤ò»È¤¦¤È¡¢°Ê²¼¤Î¤è¤¦¤Ë½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ + +.nf + z = x + I * y +.fi + +¤³¤³¤Ç¡¢\fIx\ =\ creal(z)\fP, \fIy\ =\ cimag(z)\fP ¤Ç¤¢¤ë¡£ +.LP +.\"O Or one may use polar coordinates and gets +.\"O .nf +.\"O +.\"O z = r * cexp(I * a) +.\"O +.\"O .fi +.\"O where \fIr\ =\ cabs(z)\fP +.\"O is the "radius", the "modulus", the absolute value of \fIz\fP, and +.\"O \fIa\ =\ carg(z)\fP +.\"O is the "phase angle", the argument of \fIz\fP. +¤Þ¤¿¡¢¶ËºÂɸ¤ò»È¤¦¤È¡¢°Ê²¼¤Î¤è¤¦¤Ë½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ +.nf + + z = r * cexp(I * a) + +.fi +¤³¤³¤Ç¡¢ +\fIr\ =\ cabs(z)\fP ¤Ï¡ÖȾ·Â¡×¡¢¡Ö·¸¿ô¡×¤Ç¤¢¤ê¡¢ +\fIz\fP ¤ÎÀäÂÐÃͤǤ¢¤ë¡£ +\fIa\ =\ carg(z)\fP ¤Ï¡Ö°ÌÁê³Ñ¡×¤Ç¤¢¤ê¡¢ +\fIz\fP ¤ÎÊгѤǤ¢¤ë¡£ +.LP +.\"O One has: +¼¡¤Î´Ø·¸¤¬À°Íý¤¹¤ë: +.nf + + tan(carg(z)) = cimag(z) / creal(z) +.fi +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The return value is the range of [\-pi,pi]. +ÊÖ¤êÃÍ¤Ï [\-pi,pi] ¤ÎÈϰϤǤ¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR complex (7) diff --git a/draft/man3/casin.3 b/draft/man3/casin.3 new file mode 100644 index 00000000..903d745f --- /dev/null +++ b/draft/man3/casin.3 @@ -0,0 +1,67 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 00:07:40 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: arc sine µÕÀµ¸¹ +.\"WORD: arc cosine µÕ;¸¹ +.\"WORD: arc tangent µÕÀµÀÜ +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CASIN 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O casin, casinf, casinl \- complex arc sine +casin, casinf, casinl \- Ê£ÁÇ¿ô¤ÎµÕÀµ¸¹ (arc sine) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex casin(double complex " z ); +.br +.BI "float complex casinf(float complex " z ); +.br +.BI "long double complex casinl(long double complex " z ); +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR casin () +.\"O function calculates the complex arc sine of +.\"O .IR z . +.\"O If \fIy\ =\ casin(z)\fP, then \fIz\ =\ csin(y)\fP. +.\"O The real part of +.\"O .I y +.\"O is chosen in the interval [\-pi/2,pi/2]. +.BR casin () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµÕÀµ¸¹ (arg sine) ¤ò·×»»¤¹¤ë¡£ +\fIy\ =\ casin(z)\fP ¤Ê¤é¤Ð¡¢ \fIz\ =\ csin(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤Î¼ÂÉô¤ÎÃͤ϶è´Ö [\-pi/2,pi/2] ¤«¤éÁªÂò¤µ¤ì¤ë¡£ +.LP +.\"O One has: +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + casin(z) = \-i clog(iz + csqrt(1 \- z * z)) +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ccos (3), +.BR clog (3), +.BR complex (7) diff --git a/draft/man3/casinh.3 b/draft/man3/casinh.3 new file mode 100644 index 00000000..6ef4baa9 --- /dev/null +++ b/draft/man3/casinh.3 @@ -0,0 +1,69 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 00:41:13 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: hyperbolic ÁжÊ(Àþ¤Î) +.\"WORD: arc sine µÕÀµ¸¹ +.\"WORD: arc cosine µÕ;¸¹ +.\"WORD: arc tangent µÕÀµÀÜ +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CASINH 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O casinh, casinhf, casinhl \- complex arc sine hyperbolic +casinh, casinhf, casinhl \- Ê£ÁÇ¿ô¤ÎµÕÁжÊÀþÀµ¸¹ (arc sine hyperbolic) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex casinh(double complex " z ); +.br +.BI "float complex casinhf(float complex " z ); +.br +.BI "long double complex casinhl(long double complex " z ); +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR casinh () +.\"O function calculates the complex arc hyperbolic sine of +.\"O .IR z . +.\"O If \fIy\ =\ casinh(z)\fP, then \fIz\ =\ csinh(y)\fP. +.\"O The imaginary part of +.\"O .I y +.\"O is chosen in the interval [\-pi/2,pi/2]. +.BR casinh () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµÕÁжÊÀþÀµ¸¹ (arc hyperbolic sine) ¤ò·×»»¤¹¤ë¡£ +\fIy\ =\ casinh(z)\fP ¤Ê¤é¤Ð¡¢ \fIz\ =\ csinh(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤ÎµõÉô¤ÎÃͤ϶è´Ö [\-pi/2,pi/2] ¤«¤éÁªÂò¤µ¤ì¤ë¡£ +.LP +.\"O One has: +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + casinh(z) = clog(z + csqrt(z * z + 1)) +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR asinh (3), +.BR cabs (3), +.BR cimag (3), +.BR complex (7) diff --git a/draft/man3/catan.3 b/draft/man3/catan.3 new file mode 100644 index 00000000..96b26922 --- /dev/null +++ b/draft/man3/catan.3 @@ -0,0 +1,65 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 00:22:25 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: arc sine µÕÀµ¸¹ +.\"WORD: arc cosine µÕ;¸¹ +.\"WORD: arc tangent µÕÀµÀÜ +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CATAN 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O catan, catanf, catanl \- complex arc tangents +catan, catanf, catanl \- Ê£ÁÇ¿ô¤ÎµÕÀµÀÜ (arc tangent) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex catan(double complex " z ); +.br +.BI "float complex catanf(float complex " z ); +.br +.BI "long double complex catanl(long double complex " z ); +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR catan () +.\"O function calculates the complex arc tangent of +.\"O .IR z . +.\"O If \fIy\ =\ catan(z)\fP, then \fIz\ =\ ctan(y)\fP. +.\"O The real part of y is chosen in the interval [\-pi/2,pi/2]. +.BR catan () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµÕÀµÀÜ (arc tangent) ¤ò·×»»¤¹¤ë¡£ +\fIy = catan(z)\fP ¤Ê¤é¤Ð¡¢ \fIz = ctan(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤Î¼ÂÉô¤ÎÃͤ϶è´Ö [\-pi/2,pi/2] ¤«¤éÁªÂò¤µ¤ì¤ë¡£ +.LP +.\"O One has: +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + catan(z) = 1 / 2i clog((1 + iz) / (1 \- iz)) +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ccos (3), +.BR clog (3), +.BR complex (7) diff --git a/draft/man3/catanh.3 b/draft/man3/catanh.3 new file mode 100644 index 00000000..bd5cd3d9 --- /dev/null +++ b/draft/man3/catanh.3 @@ -0,0 +1,69 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 00:43:35 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: hyperbolic ÁжÊ(Àþ¤Î) +.\"WORD: arc sine µÕÀµ¸¹ +.\"WORD: arc cosine µÕ;¸¹ +.\"WORD: arc tangent µÕÀµÀÜ +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CATANH 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O catanh, catanhf, catanhl \- complex arc tangents hyperbolic +catanh, catanhf, catanhl \- Ê£ÁÇ¿ô¤ÎµÕÁжÊÀþÀµÀÜ (arc tangents hyperbolic) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex catanh(double complex " z ); +.br +.BI "float complex catanhf(float complex " z ); +.br +.BI "long double complex catanhl(long double complex " z ); +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR catanh () +.\"O function calculates the complex arc hyperbolic tangent of +.\"O .IR z . +.\"O If \fIy\ =\ catanh(z)\fP, then \fIz\ =\ ctanh(y)\fP. +.\"O The imaginary part of +.\"O .I y +.\"O is chosen in the interval [\-pi/2,pi/2]. +.BR catanh () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµÕÁжÊÀþÀµ¸¹ (arc hyperbolic tangent) ¤ò·×»»¤¹¤ë¡£ +\fIy = catanh(z)\fP ¤Ê¤é¤Ð¡¢ \fIz = ctanh(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤ÎµõÉô¤ÎÃͤ϶è´Ö [\-pi/2,pi/2] ¤«¤éÁªÂò¤µ¤ì¤ë¡£ +.LP +.\"O One has: +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + catanh(z) = 0.5 * clog((1 + z) / (1 \- z)) +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR atanh (3), +.BR cabs (3), +.BR cimag (3), +.BR complex (7) diff --git a/draft/man3/catgets.3 b/draft/man3/catgets.3 new file mode 100644 index 00000000..fb8063c0 --- /dev/null +++ b/draft/man3/catgets.3 @@ -0,0 +1,140 @@ +.\" Copyright 1993 Mitchum DSouza +.\" +.\" 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. +.\" +.\" Updated, aeb, 980809 +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Tue Dec 16 19:43:01 JST 1997 +.\" by HIROFUMI Nishizuka +.\" Updated & Modified Mon Mar 1 1999 +.\" by NAKANO Takeo +.\" +.TH CATGETS 3 1998-08-09 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O catgets \- get message from a message catalog +.SH ̾Á° +catgets \- ¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤«¤é¥á¥Ã¥»¡¼¥¸¤ò¼è¤ê½Ð¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "char *catgets(nl_catd " catalog ", int " set_number \ +", int " message_number , +.BI " const char *" message ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR catgets () +.\"O reads the message +.\"O .IR message_number , +.\"O in set +.\"O .IR set_number , +.\"O from the message catalog identified by +.\"O .IR catalog , +.\"O where +.\"O .I catalog +.\"O is a catalog descriptor returned from an earlier call to +.\"O .BR catopen (3). +.BR catgets () +¤Ï catalog ¤Ç»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤«¤é¡¢ +¥»¥Ã¥È +.I set_number +¤Î¥á¥Ã¥»¡¼¥¸ +.I message_number +¤òÆɤ߼è¤ë¡£ +.I catalog +¤Ï¡¢ +.BR catopen (3) +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤¿¥«¥¿¥í¥° +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»ØÄꤹ¤ë¡£ +.\"O The fourth argument +.\"O .I message +.\"O points to a default message string which will be returned by +.\"O .BR catgets () +.\"O if the identified message catalog is not currently available. +.\"O The +.\"O message-text is contained in an internal buffer area and should be copied by +.\"O the application if it is to be saved or modified. +.\"O The return string is +.\"O always terminated with a null byte. +4ÈÖÌܤΰú¿ô +.I message +¤Ï¡¢»ØÄê¤Î¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤¬¸½ºßÍøÍѤǤ­¤Ê¤¤ +¾ì¹ç¤Ë +.BR catgets () +¤¬ÊÖ¤¹¥Ç¥Õ¥©¥ë¥È¤Î¥á¥Ã¥»¡¼¥¸¤ò»Ø¤¹¡£ +¥á¥Ã¥»¡¼¥¸¥Æ¥­¥¹¥È¤ÏÆâÉô¤Î¥Ð¥Ã¥Õ¥¡Îΰè¤Ë³ÊǼ¤µ¤ì¤Æ¤ª¤ê¡¢ +Êݸ¤äÊѹ¹¤ò¹Ô¤¦¾ì¹ç¤Ë¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¦¤Ç¥³¥Ô¡¼¤¹¤ëɬÍפ¬¤¢¤ë¡£ +ÊÖ¤µ¤ì¤ëʸ»úÎó¤Ï¾ï¤Ë¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.LP +.\"O On success, +.\"O .BR catgets () +.\"O returns a pointer to an internal buffer area +.\"O containing the null-terminated message string. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR catgets () +¤ÏÆâÉô¤Î¥Ð¥Ã¥Õ¥¡Îΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤³¤Ë¤Ï¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸Ê¸»úÎ󤬳ÊǼ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O On failure, +.\"O .BR catgets () +.\"O returns the value +.\"O .IR message . +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï +.I message +¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O These functions are only available in libc.so.4.4.4c and above. +.\"O The Jan 1987 X/Open Portability Guide specifies a more subtle +.\"O error return: +.\"O .I message +.\"O is returned if the message catalog specified by +.\"O .I catalog +.\"O is not available, while an empty string is returned +.\"O when the message catalog is available but does not contain +.\"O the specified message. +¤³¤ì¤é¤Î´Ø¿ô¤Ï libc.so.4.4.4c °Ê¹ß¤Ç¤·¤«»È¤¨¤Ê¤¤¡£ +Jan 1987 X/Open Portability Guide ¤Ç¤Ï¡¢¥¨¥é¡¼¤Î»þ¤Ë +ÊÖ¤µ¤ì¤ëÃͤˤè¤êÈù̯¤Ê»ØÄê¤ò¤·¤Æ¤¤¤ë¡£ +.I catalog +¤Ç»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤¬ÍøÍѤǤ­¤Ê¤¤¾ì¹ç¤Ï +.I message +¤òÊÖ¤·¡¢°ìÊý¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤Ï¤¢¤ë¤¬»ØÄꤷ¤¿¥á¥Ã¥»¡¼¥¸¤¬¤Ê¤¤¾ì¹ç¤Ï +¶õ¤Îʸ»úÎó¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O These two possible error returns seem to be discarded in SUSv2 +.\"O in favor of always returning +.\"O .IR message . +SUSv2 ¤Ç¤Ï¤³¤ÎÆó¼ïÎà¤Î¥¨¥é¡¼¥ê¥¿¡¼¥ó¤ÏÇѻߤµ¤ì¡¢ +¾ï¤Ë +.I message +¤òÊÖ¤¹¤³¤È¤Ë¤·¤¿¤è¤¦¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR catopen (3), +.BR setlocale (3) diff --git a/draft/man3/catopen.3 b/draft/man3/catopen.3 new file mode 100644 index 00000000..d2459bd0 --- /dev/null +++ b/draft/man3/catopen.3 @@ -0,0 +1,340 @@ +.\" Copyright 1993 Mitchum DSouza +.\" +.\" 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 Thu Dec 13 22:51:19 2001 by Martin Schulze +.\" Modified 2001-12-14 aeb +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Tue Dec 16 19:43:18 JST 1997 +.\" by HIROFUMI Nishizuka +.\" Updated & Modified Mon Jan 14 06:48:39 JST 2002 +.\" by Yuichi SATO +.\" +.TH CATOPEN 3 2001-12-14 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O catopen, catclose \- open/close a message catalog +catopen, catclose \- ¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤Î¥ª¡¼¥×¥ó/¥¯¥í¡¼¥º +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "nl_catd catopen(const char *" name ", int " flag ); + +.BI "int catclose(nl_catd " catalog ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The function +.\"O .BR catopen () +.\"O opens a message catalog and returns a catalog descriptor. +´Ø¿ô +.BR catopen () +¤Ï¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤ò¥ª¡¼¥×¥ó¤·¡¢¥«¥¿¥í¥°¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.\"O The descriptor remains valid until +.\"O .BR catclose () +.\"O or +.\"O .BR execve (2). +.\"O If a file descriptor is used to implement catalog descriptors +.\"O then the +.\"O .B FD_CLOEXEC +.\"O flag will be set. +¤³¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.BR catclose () +¤Þ¤¿¤Ï +.BR execve (2) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤Þ¤ÇÍ­¸ú¤Ç¤¢¤ë¡£ +¥«¥¿¥í¥°¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¼ÂÁõ¤¹¤ë¤¿¤á¤Ë +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»ÈÍѤ¹¤ë¤È¡¢ +.B FD_CLOEXEC +¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤ë¡£ +.LP +.\"O The argument +.\"O .I name +.\"O specifies the name of the message catalog to be opened. +°ú¤­¿ô +.I name +¤Ï¥ª¡¼¥×¥ó¤¹¤ë¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤Î̾Á°¤ò»ØÄꤹ¤ë¡£ +.\"O If +.\"O .I name +.\"O specifies and absolute path (i.e., contains a \(aq/\(aq), +.\"O then +.\"O .I name +.\"O specifies a pathname for the message catalog. +.I name +¤¬ÀäÂХѥ¹¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç (¤¹¤Ê¤ï¤Á \(aq/\(aq ¤ò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç)¡¢ +.I name +¤Ï¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤Ø¤Î¥Ñ¥¹Ì¾¤Ç¤¢¤ë¡£ +.\"O Otherwise, the environment variable +.\"O .B NLSPATH +.\"O is used with +.\"O .I name +.\"O substituted for +.\"O .B %N +.\"O (see +.\"O .BR locale (7)). +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢´Ä¶­ÊÑ¿ô +.B NLSPATH +¤¬ +.I name +¤È¤È¤â¤Ë»ÈÍѤµ¤ì +.B %N +¤òÃÖ¤­´¹¤¨¤ë +.RB ( locale (7) +»²¾È)¡£ +.\"O It is unspecified whether +.\"O .B NLSPATH +.\"O will be used when the process has root privileges. +¥×¥í¥»¥¹¤¬ root ¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤ë¤È¤­¤Ë +.B NLSPATH +¤¬»È¤ï¤ì¤ë¤«¤É¤¦¤«¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O If +.\"O .B NLSPATH +.\"O does not exist in the environment, +.\"O or if a message catalog cannot be opened +.\"O in any of the paths specified by it, +.\"O then an implementation defined path is used. +.B NLSPATH +´Ä¶­ÊÑ¿ô¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢ +.B NLSPATH +¤Ç»ØÄꤵ¤ì¤¿¥Ñ¥¹¤ÎÃæ¤Î +¤É¤Î¥Ñ¥¹¤Ë¤ª¤¤¤Æ¤â¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤ò¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤¾ì¹ç¡¢ +¼ÂÁõ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Ñ¥¹¤¬»È¤ï¤ì¤ë¡£ +.\"O This latter default path may depend on the +.\"O .B LC_MESSAGES +.\"O locale setting when the +.\"O .I flag +.\"O argument is +.\"O .B NL_CAT_LOCALE +.\"O and on the +.\"O .B LANG +.\"O environment variable when the +.\"O .I flag +.\"O argument is 0. +¸å¼Ô¤Î¥Ç¥Õ¥©¥ë¥È¥Ñ¥¹¤Ï¡¢ +.I flag +°ú¤­¿ô¤¬ +.B NL_CAT_LOCALE +¤Î¾ì¹ç¤Ë¤Ï +.B LC_MESSAGES +¤Î¥í¥±¡¼¥ëÀßÄê¤Ë°Í¸¤·¡¢ +.I flag +°ú¤­¿ô¤¬ 0 ¤Î¾ì¹ç¤Ë¤Ï +.B LANG +´Ä¶­ÊÑ¿ô¤Ë°Í¸¤¹¤ë¡£ +.\"O Changing the +.\"O .B LC_MESSAGES +.\"O part of the locale may invalidate +.\"O open catalog descriptors. +¥í¥±¡¼¥ë¤Î +.B LC_MESSAGES +¤òÊѹ¹¤¹¤ë¤È¡¢ +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥«¥¿¥í¥°¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Ìµ¸ú¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +.\"O The +.\"O .I flag +.\"O argument to +.\"O .BR catopen () +.\"O is used to indicate the source for the language to use. +.BR catopen () +¤Î +.I flag +°ú¤­¿ô¤Ï¡¢»ÈÍѤµ¤ì¤ë¸À¸ì¤Î¥½¡¼¥¹¤ò¼¨¤¹¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.\"O If it is set to +.\"O .B NL_CAT_LOCALE +.\"O then it will use the current locale setting for +.\"O .BR LC_MESSAGES . +.B NL_CAT_LOCALE +¤ËÀßÄꤵ¤ì¤ë¤È¡¢ +.B LC_MESSAGES +¤Î¸½ºß¤Î¥í¥±¡¼¥ëÀßÄ꤬»È¤ï¤ì¤ë¡£ +.\"O Otherwise it will use the +.\"O .B LANG +.\"O environment variable. +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï +.B LANG +´Ä¶­ÊÑ¿ô¤¬»È¤ï¤ì¤ë¡£ +.LP +.\"O The function +.\"O .BR catclose () +.\"O closes the message catalog identified by +.\"O .IR catalog . +´Ø¿ô +.BR catclose () +¤Ï +.I catalog +¤Ç»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.\"O It invalidates any subsequent references to the message catalog +.\"O defined by +.\"O .IR catalog . +¤³¤ì¤Ï¡¢°Ê¹ß¤Î +.I catalog +¤Ç»ØÄꤵ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤Ø¤ÎÁ´¤Æ¤Î»²¾È¤ò̵¸ú¤Ë¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The function +.\"O .BR catopen () +.\"O returns a message catalog descriptor of type +.\"O .I nl_catd +.\"O on success. +´Ø¿ô +.BR catopen () +¤¬À®¸ù¤¹¤ë¤È¡¢ +.I nl_catd +·¿¤Î¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.\"O On failure, it returns \fI(nl_catd)\ \-1\fP +.\"O and sets +.\"O .I errno +.\"O to indicate the error. +.\"O The possible error values include all +.\"O possible values for the +.\"O .BR open (2) +.\"O call. +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \fI(nl_catdv) \-1\fP ¤òÊÖ¤·¡¢ +.I errno +¤òÀßÄꤷ¤Æ¥¨¥é¡¼¤ò¼¨¤¹¡£ +¤³¤³¤Çµ¯¤³¤êÆÀ¤ë¥¨¥é¡¼¤ÎÃͤˤϡ¢ +.BR open (2) +¤Î¸Æ¤Ó½Ð¤·¤ÎºÝ¤Ëµ¯¤³¤êÆÀ¤ëÁ´¤Æ¤Î¥¨¥é¡¼¤ÎÃͤ¬´Þ¤Þ¤ì¤ë¡£ +.LP +.\"O The function +.\"O .BR catclose () +.\"O returns 0 on success, or \-1 on failure. +´Ø¿ô +.BR catclose () +¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç 0 ¤ò¡¢¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤òÊÖ¤¹¡£ +.\"O .SH ENVIRONMENT +.SH ´Ä¶­ÊÑ¿ô +.TP +.B LC_MESSAGES +.\"O May be the source of the +.\"O .B LC_MESSAGES +.\"O locale setting, and thus +.\"O determine the language to use if +.\"O .I flag +.\"O is set to +.\"O .BR NL_CAT_LOCALE . +.B LC_MESSAGES +¥í¥±¡¼¥ëÀßÄê¤Î¥½¡¼¥¹¤Ë¤Ê¤ë¤³¤È¤â²Äǽ¤Ê¤Î¤Ç¡¢ +.I flag +¤¬ +.B NL_CAT_LOCALE +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢»ÈÍѤ¹¤ë¸À¸ì¤ò·èÄꤹ¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£ +.TP +.B LANG +.\"O The language to use if +.\"O .I flag +.\"O is 0. +.I flag +¤¬ 0 ¤Î¾ì¹ç¡¢»ÈÍѤ¹¤ë¸À¸ì¤ò·èÄꤹ¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .\" In XPG 1987, Vol. 3 it says: +.\"O .\" .I "The flag argument of catopen is reserved for future use" +.\"O .\" .IR "and should be set to 0" . +.\"O It is unclear what the source was for the constants +.\"O .B MCLoadBySet +.\"O and +.\"O .B MCLoadAll +.\"O (see below). +.\" XPG 1987, Vol. 3 ¤Ë¤Ï¡¢¡Ö\fIcatopen ¤Î flag °ú¤­¿ô¤Ï +.\" ¾­Íè»ÈÍѤ¹¤ë¤¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¤Î¤Ç¡¢ +.\" 0 ¤ËÀßÄꤷ¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£\fR¡×¤È½ñ¤«¤ì¤Æ¤¤¤ë¡£ +Äê¿ô +.B MCLoadBySet +¤È +.B MCLoadAll +¤ËÂбþ¤¹¤ë¥½¡¼¥¹¤¬²¿¤Ç¤¢¤ë¤Î¤«¤¬¤Ï¤Ã¤­¤ê¤·¤Æ¤¤¤Ê¤¤ (²¼µ­»²¾È)¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The above is the POSIX.1-2001 description. +.\"O The glibc value for +.\"O .B NL_CAT_LOCALE +.\"O is 1. +.\"O (Compare +.\"O .B MCLoadAll +.\"O below.) +.\"O The default path varies, but usually looks at a number of places below +.\"O .IR /usr/share/locale . +°Ê¾å¤Ï POSIX.1-2001 ¤Ë¤ª¤±¤ëÀâÌÀ¤Ç¤¢¤ë¡£ +glibc ¤Ç¤Ï +.B NL_CAT_LOCALE +¤ÎÃÍ¤Ï 1 ¤Ç¤¢¤ë +(°Ê²¼¤Î +.B MCLoadAll +¤ÈÈæ³Ó¤Î¤³¤È)¡£ +¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¤Ï¾ì¹ç¤Ë¤è¤Ã¤ÆÍÍ¡¹¤Ç¤¢¤ë¤¬¡¢Ä̾ï¤Ï +.I /usr/share/locale +°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤¬Ä´¤Ù¤é¤ì¤ë¡£ +.\"O .SS Linux Notes +.SS Linux ¤Ë¤ª¤±¤ëÃí°Õ +.\"O These functions are available for Linux since libc 4.4.4c. +¤³¤ì¤é¤Î´Ø¿ô¤Ï libc.so.4.4.4c °Ê¹ß¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O In the case of linux libc4 and libc5, the catalog descriptor +.\"O .I nl_catd +.\"O is a +.\"O .BR mmap (2)'ed +.\"O area of memory and not a file descriptor. +linux ¤Î libc4 ¤È libc5 ¤Ë¤ª¤¤¤Æ¤Ï¡¢¥«¥¿¥í¥°¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I nl_catd +¤Ï +.BR mmap (2) +¤µ¤ì¤¿¥á¥â¥ê¤ÎÎΰè¤Ç¤¢¤Ã¤Æ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.\"O The +.\"O .I flag +.\"O argument to +.\"O .BR catopen () +.\"O should be either +.\"O .B MCLoadBySet +.\"O (=0) or +.\"O .B MCLoadAll +.\"O (=1). +.BR catopen () +¤Î +.I flag +¤Ï¡¢ +.B MCLoadBySet +(=0) ¤« +.B MCLoadAll +(=1) ¤Î¤É¤Á¤é¤«¤Ç¤¢¤ë¡£ +.\"O The former value indicates that a set from the catalog is to be +.\"O loaded when needed, whereas the latter causes the initial call to +.\"O .BR catopen () +.\"O to load the entire catalog into memory. +Á°¼Ô¤Î¾ì¹ç¡¢¥«¥¿¥í¥°¤Î¥»¥Ã¥È¤ÏɬÍ×»þ¤Ë¥í¡¼¥É¤µ¤ì¤ë¡£ +¸å¼Ô¤Î¾ì¹ç¡¢ºÇ½é¤Î +.BR catopen () +¤Î¸Æ¤Ó½Ð¤·¤Î¤È¤­¤ËÁ´¤Æ¤Î¥«¥¿¥í¥°¤¬¥á¥â¥êÆâ¤Ë¥í¡¼¥É¤µ¤ì¤ë¡£ +.\"O The default search path varies, but usually looks at a number of places below +.\"O .I /etc/locale +.\"O and +.\"O .IR /usr/lib/locale . +¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¤Ï¾ì¹ç¤Ë¤è¤Ã¤ÆÍÍ¡¹¤Ç¤¢¤ë¤¬¡¢Ä̾ï¤Ï +.I /etc/locale +¤È +.I /usr/share/locale +°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤¬Ä´¤Ù¤é¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR catgets (3), +.BR setlocale (3) diff --git a/draft/man3/cbrt.3 b/draft/man3/cbrt.3 new file mode 100644 index 00000000..c20bdfec --- /dev/null +++ b/draft/man3/cbrt.3 @@ -0,0 +1,121 @@ +.\" Copyright 1995 Jim Van Zandt +.\" +.\" 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. +.\" +.\" changed `square root' into `cube root' - aeb, 950919 +.\" +.\" 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 ¤Ë¤è¤ë³ÈÄ¥ +.\" +.TH CBRT 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O cbrt, cbrtf, cbrtl \- cube root function +.SH ̾Á° +cbrt, cbrtf, cbrtl \- ΩÊýº¬¤ò·×»»¤¹¤ë´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double cbrt(double " x ); +.br +.BI "float cbrtf(float " x ); +.br +.BI "long double cbrtl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR cbrt (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR cbrtf (), +.BR cbrtl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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 +.SH ÊÖ¤êÃÍ +.\"O These functions return the cube root of +.\"O .IR x . +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎΩÊýº¬¤òÊÖ¤¹¡£ + +.\"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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR pow (3), +.BR sqrt (3) diff --git a/draft/man3/ccos.3 b/draft/man3/ccos.3 new file mode 100644 index 00000000..2a41224e --- /dev/null +++ b/draft/man3/ccos.3 @@ -0,0 +1,50 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Wed Jul 23 05:24:15 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: sine Àµ¸¹ +.\"WORD: cosine ;¸¹ +.\"WORD: tangent ÀµÀÜ +.\" +.TH CCOS 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O ccos, ccosf, ccosl \- complex cosine function +.SH ̾Á° +ccos, ccosf, ccosl \- Ê£ÁÇ¿ô¤Î;¸¹ (cosine) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex ccos(double complex " z ");" +.br +.BI "float complex ccosf(float complex " z ");" +.br +.BI "long double complex ccosl(long double complex " z ");" +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The complex cosine function is defined as: +Ê£ÁÇ¿ô¤Î;¸¹ (cosine) ´Ø¿ô ccos(z) ¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.nf + + ccos(z) = (exp(i * z) + exp(\-i * z)) / 2 +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR csin (3), +.BR ctan (3), +.BR complex (7) diff --git a/draft/man3/ccosh.3 b/draft/man3/ccosh.3 new file mode 100644 index 00000000..25951c8d --- /dev/null +++ b/draft/man3/ccosh.3 @@ -0,0 +1,52 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Mon Jul 28 23:42:41 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: hyperbolic ÁжÊ(Àþ¤Î) +.\"WORD: sine Àµ¸¹ +.\"WORD: cosine ;¸¹ +.\"WORD: tangent ÀµÀÜ +.\" +.TH CCOSH 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ccosh, ccoshf, ccoshl \- complex hyperbolic cosine +ccosh, ccoshf, ccoshl \- Ê£ÁÇ¿ô¤ÎÁжÊÀþ;¸¹ (hyperbolic cosine) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex ccosh(double complex " z ");" +.br +.BI "float complex ccoshf(float complex " z ");" +.br +.BI "long double complex ccoshl(long double complex " z ");" +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The complex hyperbolic cosine function is defined as: +Ê£ÁÇ¿ô¤ÎÁжÊÀþ;¸¹ (hyperbolic cosine) ´Ø¿ô ccosh(z) ¤Ï +°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.nf + + ccosh(z) = (exp(z)+exp(\-z))/2 +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR csinh (3), +.BR ctanh (3), +.BR complex (7) diff --git a/draft/man3/ceil.3 b/draft/man3/ceil.3 new file mode 100644 index 00000000..f349103e --- /dev/null +++ b/draft/man3/ceil.3 @@ -0,0 +1,171 @@ +.\" Copyright 2001 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. +.\" +.\" 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 ²¾¿ô +.\" +.TH CEIL 3 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "double ceil(double " x ); +.br +.BI "float ceilf(float " x ); +.br +.BI "long double ceill(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR ceilf (), +.BR ceill (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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" +.SH ÊÖ¤êÃÍ +.\"O These functions return the ceiling of +.\"O .IR x . +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ò²¼²ó¤é¤Ê¤¤À°¿ôÃͤòÊÖ¤¹¡£ + +.\"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 +.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" +.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 +.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 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 +¤Ê¤É) ¤Ë³ÊǼ¤¹¤ë¤Ë¤ÏÂ礭²á¤®¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Î·ë²Ì¤Ïʬ¤«¤é¤Ê¤¤¤Î¤Ç¡¢ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òÈò¤±¤ë¤¿¤á¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤ÏÀ°¿ô·¿¤ËÂåÆþ¤¹¤ëÁ°¤Ë +ÊÖ¤µ¤ì¤¿ÃͤÎÈϰϳÎǧ¤ò¼Â¹Ô¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR floor (3), +.BR lrint (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3), +.BR trunc (3) diff --git a/draft/man3/cerf.3 b/draft/man3/cerf.3 new file mode 100644 index 00000000..0bbdb945 --- /dev/null +++ b/draft/man3/cerf.3 @@ -0,0 +1,66 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-24, Akihiro MOTOKI +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" +.\"WORD: error function ¸íº¹´Ø¿ô +.\" +.TH CERF 3 2007-12-26 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O cerf, cerff, cerfl, cerfc, cerfcf, cerfcl \- complex error function +cerf, cerff, cerfl, cerfc, cerfcf, cerfcl \- Ê£ÁÇ¿ô¤Î¸íº¹´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex cerf(double complex " z ); +.br +.BI "float complex cerff(float complex " z ); +.br +.BI "long double complex cerfl(long double complex " z ); +.sp +.BI "double complex cerfc(double complex " z ); +.br +.BI "float complex cerfcf(float complex " z ); +.br +.BI "long double complex cerfcl(long double complex " z ); +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The function +.\"O .BR cerf () +.\"O is the complex version of the error function. +.\"O erf(z) = 2/sqrt(pi) * integral from 0 to z of exp(\-t*t) dt. +.BR cerf () +´Ø¿ô¤Ï¸íº¹´Ø¿ô¤ÎÊ£ÁÇ¿ôÈǤǤ¢¤ê¡¢ +.TP +erf(z) = 2/sqrt(pi) * exp(\-t*t) dt ¤Î 0 ¤«¤é z ¤Þ¤Ç¤ÎÀÑʬ +.PP +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O The function +.\"O .BR cerfc () +.\"O is defined as cerfc(z) = 1\-cerf(z). +.BR cerfc () +´Ø¿ô¤ÎÄêµÁ¤Ï cerfc(z) = 1-cerf(z) ¤Ç¤¢¤ë¡£ +.\"O .\" must check 1/sqrt(2*pi) ? +.\" 1/sqrt(2*pi) ¤Î¥Á¥§¥Ã¥¯¤ò¤·¤Ê¤¯¤Æ¤â¤¤¤¤¤Î¡© +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The function names are reserved for future use in C99. +´Ø¿ô̾¤Ï C99 ¤Çº£¸å»ÈÍѤ¹¤ë¤¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.\"O .SH AVAILABILITY +.SH ²ÄÍÑÀ­ +.\"O Not yet in glibc, as at version 2.8. +.\"O .\" But reserved in NAMESPACE. +¥Ð¡¼¥¸¥ç¥ó 2.8 »þÅÀ¤Ç¤Ï¡¢glibc ¤Ë¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" ¤·¤«¤·¡¢Ì¾Á°¶õ´Ö¤ÏͽÌóºÑ¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR erf (3), +.BR complex (7) diff --git a/draft/man3/cexp.3 b/draft/man3/cexp.3 new file mode 100644 index 00000000..061df3f3 --- /dev/null +++ b/draft/man3/cexp.3 @@ -0,0 +1,55 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 02:05:20 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: exponential »Ø¿ô +.\"WORD: natural logarithm ¼«Á³Âпô +.\"WORD: base Äì +.\" +.TH CEXP 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O cexp, cexpf, cexpl \- complex exponential function +cexp, cexpf, cexpl \- Ê£ÁÇ¿ô¤Î»Ø¿ô´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex cexp(double complex " z ");" +.br +.BI "float complex cexpf(float complex " z ");" +.br +.BI "long double complex cexpl(long double complex " z ");" +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The function calculates e (2.71828..., the base of natural logarithms) +.\"O raised to the power of +.\"O .IR z . +¤³¤Î´Ø¿ô¤Ï e (2.71828..., ¼«Á³Âпô¤ÎÄì) ¤Î \fIz\fR ¾è¤ò·×»»¤¹¤ë¡£ +.LP +.\"O One has: +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + cexp(I * z) = ccos(z) + I * csin(z) +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR clog (3), +.BR cpow (3), +.BR complex (7) diff --git a/draft/man3/cexp2.3 b/draft/man3/cexp2.3 new file mode 100644 index 00000000..eaca165e --- /dev/null +++ b/draft/man3/cexp2.3 @@ -0,0 +1,48 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-24, Akihiro MOTOKI +.\" Updated 2005-02-24, Akihiro MOTOKI +.\" +.\"WORD: exponent Îß¾è +.\" +.TH CEXP2 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O cexp2, cexp2f, cexp2l \- base-2 exponent of a complex number +cexp2, cexp2f, cexp2l \- Ê£ÁÇ¿ô¤Î 2 ¤ÎÎß¾è +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex cexp2(double complex " z ");" +.br +.BI "float complex cexp2f(float complex " z ");" +.br +.BI "long double complex cexp2l(long double complex " z ");" +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The function returns 2 raised to the power of +.\"O .IR z . +¤³¤Î´Ø¿ô¤Ï 2 ¤Î \fIz\fR ¾è¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These function names are reserved for future use in C99. +´Ø¿ô̾¤Ï C99 ¤Çº£¸å»ÈÍѤ¹¤ë¤¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.\"O .SH AVAILABILITY +.SH ²ÄÍÑÀ­ +.\"O Not yet in glibc, as at version 2.8. +.\"O .\" But reserved in NAMESPACE. +¥Ð¡¼¥¸¥ç¥ó 2.8 »þÅÀ¤Ç¤Ï¡¢glibc ¤Ë¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" ¤·¤«¤·¡¢Ì¾Á°¶õ´Ö¤ÏͽÌóºÑ¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR cexp (3), +.BR clog10 (3), +.BR complex (7) diff --git a/draft/man3/cfree.3 b/draft/man3/cfree.3 new file mode 100644 index 00000000..d0f322b8 --- /dev/null +++ b/draft/man3/cfree.3 @@ -0,0 +1,194 @@ +.\" 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 19 04:38:03 JST 2004 +.\" by Yuichi SATO +.\" +.TH CFREE 3 2007-07-26 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O cfree \- free allocated memory +cfree \- ³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.sp +.B "#include " +.sp +.\"O /* In SunOS 4 */ +/* SunOS 4 ¤Ç¤Ï */ +.BI "int cfree(void *" ptr ); +.sp +.\"O /* In glibc or FreeBSD libcompat */ +/* glibc ¤È FreeBSD libcompat ¤Ç¤Ï */ +.BI "void cfree(void *" ptr ); +.sp +.\"O /* In SCO OpenServer */ +/* SCO OpenServer ¤Ç¤Ï */ +.BI "void cfree(char *" ptr ", unsigned " num ", unsigned " size ); +.sp +.\"O /* In Solaris watchmalloc.so.1 */ +/* Solaris watchmalloc.so.1 ¤Ç¤Ï */ +.BI "void cfree(void *" ptr ", size_t " nelem ", size_t " elsize ); +.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 cfree (): +_BSD_SOURCE || _SVID_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This function should never be used. +.\"O Use +.\"O .BR free (3) +.\"O instead. +¤³¤Î´Ø¿ô¤Ï·è¤·¤Æ»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë +.BR free (3) +¤ò»È¤¦¤³¤È¡£ +.\"O .SS "1-arg cfree" +.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 ¤È¤Î¸ß´¹À­¤Î¤¿¤á¤ËÄɲ䵤줿¡×¡£ +.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" +.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) +¤ËÎà»÷¤·¤Æ¤¤¤ë¡£ +.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) +¤ò»È¤¦¤³¤È¡£ +.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" +.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" +.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 +.SH ´ØÏ¢¹àÌÜ +.BR malloc (3) diff --git a/draft/man3/cimag.3 b/draft/man3/cimag.3 new file mode 100644 index 00000000..675a19e8 --- /dev/null +++ b/draft/man3/cimag.3 @@ -0,0 +1,63 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 01:37:31 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CIMAG 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O cimag, cimagf, cimagl \- get imaginary part of a complex number +cimag, cimagf, cimagl \- Ê£ÁÇ¿ô¤ÎµõÉô¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double cimag(double complex " z ");" +.br +.BI "float cimagf(float complex " z ");" +.br +.BI "long double cimagl(long double complex " z ");" +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR cimag () +.\"O function returns the imaginary part of the complex number +.\"O .IR z . +.BR cimag () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµõÉô¤òÊÖ¤¹¡£ +.LP +.\"O One has: +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + z = creal(z) + I * cimag(z) +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O gcc also supports __imag__. +.\"O That is a GNU extension. +gcc ¤Ç¤Ï __imag__ ¤ò»È¤¦¤³¤È¤â¤Ç¤­¤ë¤¬¡¢ +¤³¤ì¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR creal (3), +.BR complex (7) diff --git a/draft/man3/clearenv.3 b/draft/man3/clearenv.3 new file mode 100644 index 00000000..72b20ac6 --- /dev/null +++ b/draft/man3/clearenv.3 @@ -0,0 +1,158 @@ +.\" Copyright 2001 John Levon +.\" +.\" 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, 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 +.\" +.TH CLEARENV 3 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O clearenv \- clear the environment +clearenv \- ´Ä¶­ (environment) ¤ò¥¯¥ê¥¢¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B "int clearenv(void);" +.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 clearenv (): +_SVID_SOURCE || _XOPEN_SOURCE +.\"O .SH DESCRIPTION +.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" +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O Not in libc4, libc5. +.\"O In glibc since glibc 2.0. +libc4, libc5 ¤Ç¤Ï»ÈÍѤǤ­¤Ê¤¤¡£ +glibc 2.0 °Ê¹ß¤Î glibc ¤Ç»ÈÍѤǤ­¤ë¡£ +.\"O .SH "CONFORMING TO" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR getenv (3), +.BR putenv (3), +.BR setenv (3), +.BR unsetenv (3), +.BR environ (7) diff --git a/draft/man3/clock.3 b/draft/man3/clock.3 new file mode 100644 index 00000000..2198a42a --- /dev/null +++ b/draft/man3/clock.3 @@ -0,0 +1,143 @@ +.\" 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 21:27:01 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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. +.\" Tranlated 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 +.\" +.\"WORD: processor time ¥×¥í¥»¥Ã¥µ»þ´Ö +.\"WORD: CPU time CPU»þ´Ö +.\" +.TH CLOCK 3 2008-08-28 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O clock \- Determine processor time +clock \- ¥×¥í¥»¥Ã¥µ»þ´Ö¤Î¼èÆÀ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B clock_t clock(void); +.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" +.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" +.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 +.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 () +¤ò¸Æ¤Ó½Ð¤·¤Æ¤½¤ÎÃͤòº¹¤·°ú¤¯¤³¤È¡£ +.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 ¥Ó¥Ã¥È¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +¤³¤Î´Ø¿ô¤ÏÌó 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" +.SH ´ØÏ¢¹àÌÜ +.BR clock_gettime (2), +.BR getrusage (2), +.BR times (2) diff --git a/draft/man3/clog.3 b/draft/man3/clog.3 new file mode 100644 index 00000000..0af2fa82 --- /dev/null +++ b/draft/man3/clog.3 @@ -0,0 +1,75 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 01:47:42 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: natural logarithm ¼«Á³Âпô +.\"WORD: logarithm Âпô +.\"WORD: exponential »Ø¿ô +.\"WORD: inverse function µÕ´Ø¿ô +.\" +.TH CLOG 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O clog, clogf, clogl \- natural logarithm of a complex number +clog, clogf, clogl \- Ê£ÁÇ¿ô¤Î¼«Á³Âпô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex clog(double complex " z ); +.br +.BI "float complex clogf(float complex " z ); +.br +.BI "long double complex clogl(long double complex " z ); +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The logarithm +.\"O .BR clog () +.\"O is the inverse function of the exponential +.\"O .BR cexp (3). +.\"O Thus, if \fIy = clog(z)\fP, then \fIz = cexp(y)\fP. +.\"O The imaginary part of +.\"O .I y +.\"O is chosen in the interval [\-pi,pi]. +Âпô +.BR clog () +¤Ï»Ø¿ô´Ø¿ô +.BR cexp () +¤ÎµÕ´Ø¿ô¤Ç¤¢¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢ \fIy = clog(z)\fP ¤Ê¤é¤Ð¡¢ \fIz = cexp(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤Îµõ¿ôÉô¤ÎÃͤ϶è´Ö [\-pi,pi] ¤«¤éÁªÂò¤µ¤ì¤ë¡£ +.LP +.\"O One has: +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + clog(z) = log(cabs(z)) + I * carg(z) +.fi +.LP +.\"O Note that +.\"O .I z +.\"O close to zero will cause an overflow. +.I z +¤È¤·¤Æ 0 ¤Ë¶á¤¤ÃͤòÆþ¤ì¤ë¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤¹¤¿¤á¡¢ +Ãí°Õ¤¬É¬ÍפǤ¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR cexp (3), +.BR clog10 (3), +.BR complex (7) diff --git a/draft/man3/clog10.3 b/draft/man3/clog10.3 new file mode 100644 index 00000000..3592dc26 --- /dev/null +++ b/draft/man3/clog10.3 @@ -0,0 +1,75 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-24, Akihiro MOTOKI +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" Updated 2007-01-05, Akihiro MOTOKI, catch up to LDP v2.43 +.\" +.\"WORD: logarithm Âпô +.\"WORD: base Äì +.\" +.TH CLOG10 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O clog10, clog10f, clog10l \- base-10 logarithm of a complex number +clog10, clog10f, clog10l \- Ä줬 10 ¤ÎÊ£ÁÇ¿ô¤ÎÂпô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "double complex clog10(double complex " z ); +.br +.BI "float complex clog10f(float complex " z ); +.br +.BI "long double complex clog10l(long double complex " z ); +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The call +.\"O .I clog10(z) +.\"O is equivalent to +.\"O .IR clog(z)/log(10) . +.I clog10(z) +¤Î¸Æ¤Ó½Ð¤·¤Ï +.I clog(z)/log(10) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.\"O The other functions perform the same task for +.\"O .I float +.\"O and +.\"O .IR "long double" . +¾¤Î´Ø¿ô¤ÏƱ¤¸µ¡Ç½¤ò»ý¤Ä +.I float +ÈÇ¤È +.I "long double" +ÈǤǤ¢¤ë¡£ + +.\"O Note that +.\"O .I z +.\"O close to zero will cause an overflow. +.I z +¤È¤·¤Æ 0 ¤Ë¶á¤¤ÃͤòÆþ¤ì¤ë¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤¹¤¿¤á¡¢ +Ãí°Õ¤¬É¬ÍפǤ¢¤ë¡£ +.\"O .SH VERSIONS +.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. +.\"O It is reserved for future use in C99. +¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +C99 ¤Ç¤Ïº£¸å¤Î¤¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR cexp (3), +.BR clog (3), +.BR clog2 (3), +.BR complex (7), +.BR feature_test_macros (7) diff --git a/draft/man3/clog2.3 b/draft/man3/clog2.3 new file mode 100644 index 00000000..05de6b54 --- /dev/null +++ b/draft/man3/clog2.3 @@ -0,0 +1,73 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-24, Akihiro MOTOKI +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" Updated 2007-01-05, Akihiro MOTOKI, catch up to LDP v2.43 +.\" +.\"WORD: logarithm ¼«Á³Âпô +.\"WORD: base Äì +.\" +.TH CLOG2 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O clog2, clog2f, clog2l \- base-2 logarithm of a complex number +clog2, clog2f, clog2l \- Ä줬 2 ¤ÎÊ£ÁÇ¿ô¤ÎÂпô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex clog2(double complex " z ); +.br +.BI "float complex clog2f(float complex " z ); +.br +.BI "long double complex clog2l(long double complex " z ); +.\" .sp +.\"O .\" Link with \fI\-lm\fP. +.\" \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The call +.\"O .I clog2(z) +.\"O is equivalent to +.\"O .IR clog(z)/log(2) . +.I clog2(z) +¤Î¸Æ¤Ó½Ð¤·¤Ï +.I clog(z)/log(2) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ + +.\"O The other functions perform the same task for +.\"O .I float +.\"O and +.\"O .IR "long double" . +¾¤Î´Ø¿ô¤ÏƱ¤¸µ¡Ç½¤ò»ý¤Ä +.I float +ÈÇ¤È +.I "long double" +ÈǤǤ¢¤ë¡£ + +.\"O Note that +.\"O .I z +.\"O close to zero will cause an overflow. +.I z +¤È¤·¤Æ 0 ¤Ë¶á¤¤ÃͤòÆþ¤ì¤ë¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤¹¤¿¤á¡¢ +Ãí°Õ¤¬É¬ÍפǤ¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These function names are reserved for future use in C99. +¤³¤ì¤é¤Î´Ø¿ô̾¤Ï C99 ¤Çº£¸å»ÈÍѤ¹¤ë¤¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.\"O .SH AVAILABILITY +.SH ²ÄÍÑÀ­ +.\"O Not yet in glibc, as at version 2.8. +.\"O .\" But reserved in NAMESPACE. +¥Ð¡¼¥¸¥ç¥ó 2.8 »þÅÀ¤Ç¤Ï¡¢glibc ¤Ë¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" ¤·¤«¤·¡¢Ì¾Á°¶õ´Ö¤ÏͽÌóºÑ¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR cexp (3), +.BR clog (3), +.BR clog10 (3), +.BR complex (7) diff --git a/draft/man3/closedir.3 b/draft/man3/closedir.3 new file mode 100644 index 00000000..9e7e8069 --- /dev/null +++ b/draft/man3/closedir.3 @@ -0,0 +1,105 @@ +.\" Copyright (C) 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 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 +.\" +.\"WORD: directory stream descriptor ¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\" +.TH CLOSEDIR 3 2008-09-23 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O closedir \- close a directory +closedir \- ¥Ç¥£¥ì¥¯¥È¥ê¤ò¥¯¥í¡¼¥º¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B #include +.sp +.BI "int closedir(DIR *" dirp ); +.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 ¤Ï¡¢ +¤³¤Î¸Æ¤Ó½Ð¤·¤Î¸å¤Ç¤Ï»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.\"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 +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O Invalid directory stream descriptor \fIdirp\fP. +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ \fIdirp\fP ¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR opendir (3), +.BR readdir (3), +.BR rewinddir (3), +.BR scandir (3), +.BR seekdir (3), +.BR telldir (3) diff --git a/draft/man3/cmsg.3 b/draft/man3/cmsg.3 new file mode 100644 index 00000000..78487b67 --- /dev/null +++ b/draft/man3/cmsg.3 @@ -0,0 +1,343 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: cmsg.3,v 1.3 2001/01/14 05:30:39 hanataka Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito +.\" all rights reserved. +.\" Translated Mon Jul 26 21:58:26 JST 1999 +.\" by Shouichi Saito +.\" Proofed Tue Aug 17 1999 by NAKANO Takeo +.\" +.TH CMSG 3 2008-11-20 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +.\"O CMSG_ALIGN, CMSG_SPACE, CMSG_NXTHDR, CMSG_FIRSTHDR \- Access ancillary data +CMSG_ALIGN, CMSG_SPACE, CMSG_NXTHDR, CMSG_FIRSTHDR \- Êä½õ¥Ç¡¼¥¿¤Ë¥¢¥¯¥»¥¹¤¹¤ë¡£ +.SH ½ñ¼° +.B #include +.sp +.BI "struct cmsghdr *CMSG_FIRSTHDR(struct msghdr *" msgh ); +.br +.BI "struct cmsghdr *CMSG_NXTHDR(struct msghdr *" msgh ", struct cmsghdr *" cmsg ); +.br +.BI "size_t CMSG_ALIGN(size_t " length ); +.br +.BI "size_t CMSG_SPACE(size_t " length ); +.br +.BI "size_t CMSG_LEN(size_t " length ); +.br +.BI "unsigned char *CMSG_DATA(struct cmsghdr *" cmsg ); +.sp +.nf +struct cmsghdr { + socklen_t cmsg_len; /* data byte count, including header */ + int cmsg_level; /* originating protocol */ + int cmsg_type; /* protocol-specific type */ + /* followed by unsigned char cmsg_data[]; */ +}; +.fi +.SH ÀâÌÀ +.\"O These macros are used to create and access control messages (also called +.\"O ancillary data) that are not a part of the socket payload. +¤³¤ì¤é¤Î¥Þ¥¯¥í¤ÏÀ©¸æ¥á¥Ã¥»¡¼¥¸ +(Êä½õ¥Ç¡¼¥¿ (ancillary data) ¤È¤â¸Æ¤Ð¤ì¤ë) ¤òºî¤ê¡¢ +¤½¤ì¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +À©¸æ¥á¥Ã¥»¡¼¥¸¤Ï¥½¥±¥Ã¥È¤Ë¤Î¤ë¥Ç¡¼¥¿¤Ç¤Ï¤Ê¤¤¡£ +.\"O This control information may +.\"O include the interface the packet was received on, various rarely used header +.\"O fields, an extended error description, a set of file descriptors or Unix +.\"O credentials. +.\"O For instance, control messages can be used to send +.\"O additional header fields such as IP options. +¤³¤ÎÀ©¸æ¾ðÊó¤Ï¡¢ÅþÃ夷¤¿¥Ñ¥±¥Ã¥È¤Ø¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¡¢ÍÍ¡¹¤Ê¤¢¤Þ¤ê +»È¤ï¤ì¤Ê¤¤¥Ø¥Ã¥À¡¼¥Õ¥£¡¼¥ë¥É¡¢¥¨¥é¡¼µ­½Ò¤Î³ÈÄ¥¡¢¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê +¥×¥¿¤Î½¸¹ç¤ä¡¢Unix¤Ë¤ª¤±¤ë¿®Íê¾ðÊó (credential) ¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +À©¸æ¥á¥Ã¥»¡¼¥¸¤Ï¡¢Î㤨¤Ð IP ¥ª¥×¥·¥ç¥ó¤Î¤è¤¦¤ÊÄɲåإåÀ¡¼¥Õ¥£¡¼¥ë¥É¤ò +Á÷¤ë¤Î¤Ë»È¤¦»ö¤¬¤Ç¤­¤ë¡£ +.\"O Ancillary data is sent by calling +.\"O .BR sendmsg (2) +.\"O and received by calling +.\"O .BR recvmsg (2). +.\"O See their manual pages for more information. +Êä½õ¥Ç¡¼¥¿¤Ï¡¢ +.BR sendmsg (2) +¤ò¸Æ¤Ó½Ð¤·¤ÆÁ÷¤ê¡¢ +.BR recvmsg (2) +¤ò¸Æ¤Ó½Ð¤·¤Æ¼õ¤±¼è¤ë¡£ +¾ÜºÙ¤Ï¤½¤ì¤é¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¡£ +.PP +.\"O Ancillary data is a sequence of +.\"O .I struct cmsghdr +.\"O structures with appended data. +.\"O This sequence should only be accessed +.\"O using the macros described in this manual page and never directly. +Êä½õ¥Ç¡¼¥¿¤Ï +.I struct cmsghdr +¹½Â¤ÂΤΥ·¡¼¥±¥ó¥¹¤ËÄɲåǡ¼¥¿¤¬Éղ䵤줿¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥·¡¼¥±¥ó¥¹¤Ë¤Ï¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë½ñ¤«¤ì¤Æ¤¤¤ë +¥Þ¥¯¥í¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤¹¤Ù¤­¤Ç¡¢Ä¾ÀÜ¥¢¥¯¥»¥¹¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\"O See the specific protocol man pages for the available control message types. +»ÈÍѲÄǽ¤ÊÀ©¸æ¥á¥Ã¥»¡¼¥¸¤Î¥¿¥¤¥×¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +¤½¤ì¤¾¤ì¤Î¥×¥í¥È¥³¥ë¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤Î¤³¤È¡£ +.\"O The maximum ancillary buffer size allowed per socket can be set using +.\"O .IR /proc/sys/net/core/optmem_max ; +.\"O see +.\"O .BR socket (7). +ÀܳËè¤ÎºÇÂçÊä½õÍѥХåե¡¥µ¥¤¥º¤Ï +.I /proc/sys/net/core/optmem_max +¤ò»È¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡£ +.BR socket (7) +¤ò»²¾È¡£ +.PP +.\"O .BR CMSG_FIRSTHDR () +.\"O returns a pointer to the first +.\"O .I cmsghdr +.\"O in the ancillary +.\"O data buffer associated with the passed +.\"O .IR msghdr . +.BR CMSG_FIRSTHDR () +¤Ï¡¢ÅϤ·¤¿ +.I msghdr +¤Ë´ØÏ¢¤·¤¿Êä½õ¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡Ãæ¤Î¡¢ºÇ½é¤Î +.I cmsghdr +¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.\"O .BR CMSG_NXTHDR () +.\"O returns the next valid +.\"O .I cmsghdr +.\"O after the passed +.\"O .IR cmsghdr . +.BR CMSG_NXTHDR () +¤Ï¡¢ÅϤ·¤¿ +.I cmsghdr +¤Î¼¡¤Ë¤¯¤ë (Í­¸ú¤Ê) +.I cmsghdr +¤òÊÖ¤¹¡£ +.\"O It returns NULL when there isn't enough space left in the buffer. +¥Ð¥Ã¥Õ¥¡¤Ë½½Ê¬¤Ê¶õ¤­¤¬Ìµ¤¤¾ì¹ç¡¢NULL ¤òÊÖ¤¹¡£ +.PP +.\"O .BR CMSG_ALIGN (), +.\"O given a length, returns it including the required alignment. +.\"O This is a +.\"O constant expression. +.BR CMSG_ALIGN () +¤ËŤµ¤òÍ¿¤¨¤ë¤È¡¢É¬Íפʥ¢¥é¥¤¥ó¥á¥ó¥È¤ò²ÃÌ£¤·¤¿Ä¹¤µ¤òÊÖ¤·¤Æ¤¯¤ë¡£ +¤³¤ì¤ÏÄê¿ô¼°¤Ç¤¢¤ë¡£ +.PP +.\"O .BR CMSG_SPACE () +.\"O returns the number of bytes an ancillary element with payload of the +.\"O passed data length occupies. +.\"O This is a constant expression. +.BR CMSG_SPACE () +¤Ï¡¢Í¿¤¨¤¿¥Ç¡¼¥¿Ä¹¤¬Àê¤á¤ë¤Î¤ËɬÍפÊÊä½õÍ×ÁÇ (ancillary element) ¤Î +¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¤³¤ì¤ÏÄê¿ô¼°¤Ç¤¢¤ë¡£ +.PP +.\"O .BR CMSG_DATA () +.\"O returns a pointer to the data portion of a +.\"O .IR cmsghdr . +.BR CMSG_DATA () +¤Ï¡¢ +.I cmsghdr +¤Î¥Ç¡¼¥¿Éôʬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.\"O .BR CMSG_LEN () +.\"O returns the value to store in the +.\"O .I cmsg_len +.\"O member of the +.\"O .I cmsghdr +.\"O structure, taking into account any necessary +.\"O alignment. +.\"O It takes the data length as an argument. +.\"O This is a constant +.\"O expression. +.BR CMSG_LEN () +¤Ï¡¢ +.I cmsghdr +¹½Â¤ÂΤΠ+.I cmsg_len +¥á¥ó¥Ð¤Ë¥Ç¡¼¥¿¤ò³ÊǼ¤¹¤ëºÝ¤ËɬÍפÊÃͤòÊÖ¤¹¡£¥¢¥é¥¤¥ó¥á¥ó¥È¤â¹Íθ¤ËÆþ¤ì +¤é¤ì¤ë¡£ +°ú¿ô¤È¤·¤Æ¥Ç¡¼¥¿Ä¹¤ò¤È¤ë¡£¤³¤ì¤ÏÄê¿ô¼°¤Ç¤¢¤ë¡£ +.PP +.\"O To create ancillary data, first initialize the +.\"O .I msg_controllen +.\"O member of the +.\"O .I msghdr +.\"O with the length of the control message buffer. +.\"O Use +.\"O .BR CMSG_FIRSTHDR () +.\"O on the +.\"O .I msghdr +.\"O to get the first control message and +.\"O .BR CMSG_NEXTHDR () +.\"O to get all subsequent ones. +Êä½õ¥Ç¡¼¥¿¤òºî¤ë¤¿¤á¤Ë¤ÏºÇ½é¤Ë +.I msghdr +¤Î¥á¥ó¥Ð¡¼ +.I msg_controllen +¤ò¡¢À©¸æ¥á¥Ã¥»¡¼¥¸¥Ð¥Ã¥Õ¥¡¤ÎŤµ¤Ç½é´ü²½¤¹¤ë¡£ +.BR CMSG_FIRSTHDR () +¤ò +.I msghdr +¤ËÍѤ¤¤ë¤ÈºÇ½é¤ÎÀ©¸æ¥á¥Ã¥»¡¼¥¸¤¬ÆÀ¤é¤ì¡¢ +.BR CMSG_NEXTHDR () +¤ò»È¤¦¤È¼¡¤ÎÀ©¸æ¥á¥Ã¥»¡¼¥¸¤¬ÆÀ¤é¤ì¤ë¡£ +.\"O In each control message, initialize +.\"O .I cmsg_len +.\"O (with +.\"O .BR CMSG_LEN ()), +.\"O the other +.\"O .I cmsghdr +.\"O header fields, and the data portion using +.\"O .BR CMSG_DATA (). +¤½¤ì¤¾¤ì¤ÎÀ©¸æ¥á¥Ã¥»¡¼¥¸¤Ç¤Ï¡¢ +.I cmsg_len +¤ò½é´ü²½¤¹¤ë +.RB ( CMSG_LEN () +¤ò»È¤¦)¡£ +¤½¤Î¾¤Î +.I cmsghdr +¥Ø¥Ã¥À¡¼¥Õ¥£¡¼¥ë¥É¡¢¤½¤·¤Æ¥Ç¡¼¥¿Éôʬ¤ËÂФ·¤Æ¤â +.BR CMSG_DATA () +¤ò»È¤Ã¤Æ½é´ü²½¤ò¤¹¤ë¡£ +.\"O Finally, the +.\"O .I msg_controllen +.\"O field of the +.\"O .I msghdr +.\"O should be set to the sum of the +.\"O .BR CMSG_SPACE () +.\"O of the length of +.\"O all control messages in the buffer. +.\"O For more information on the +.\"O .IR msghdr , +.\"O see +.\"O .BR recvmsg (2). +ºÇ¸å¤Ë +.I msghdr +¤Î +.I msg_controllen +¥Õ¥£¡¼¥ë¥É¤Ë¡¢¥Ð¥Ã¥Õ¥¡Ãæ¤ÎÀ©¸æ¥á¥Ã¥»¡¼¥¸¤ÎŤµ¤Î +.BR CMSG_SPACE () +¤Î¹ç·×¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.I msghdr +¤Ë¤Ä¤¤¤Æ¤Î¾ÜºÙ¤Ï +.BR recvmsg (2) +¤ò»²¾È¡£ +.PP +.\"O When the control message buffer is too short to store all messages, the +.\"O .B MSG_CTRUNC +.\"O flag is set in the +.\"O .I msg_flags +.\"O member of the +.\"O .IR msghdr . +À©¸æ¥á¥Ã¥»¡¼¥¸¥Ð¥Ã¥Õ¥¡¤¬Á´¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤òǼ¤á¤ë¤Î¤Ë¤Ïû¤¹¤®¤ë¾ì¹ç¡¢ +.I msghdr +¤Î +.I msg_flags +¥á¥ó¥Ð¡¼¤Ë +.B MSG_CTRUNC +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This ancillary data model conforms to the POSIX.1g draft, 4.4BSD-Lite, +.\"O the IPv6 advanced API described in RFC\ 2292 and the SUSv2. +.\"O .BR CMSG_ALIGN () +.\"O is a Linux extension. +¤³¤ÎÊä½õ¥Ç¡¼¥¿¥â¥Ç¥ë¤Ï¡¢POSIX.1g draft, 4.4BSD-Lite, RFC\ 2292 ¤Ë +µ­½Ò¤µ¤ì¤Æ¤¤¤ë IPv6 advanced API, ¤½¤·¤Æ SUSv2 +¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR CMSG_ALIGN () +¤Ï Linux ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.\"O For portability, ancillary data should be accessed only using the macros +.\"O described here. +°Ü¿¢À­¤Î¤¿¤á¤Ë¡¢Êä½õ¥Ç¡¼¥¿¤Ø¤Î¥¢¥¯¥»¥¹¤Ë¤Ï¡¢ +¤³¤³¤Ç½Ò¤Ù¤é¤ì¤Æ¤¤¤ë¥Þ¥¯¥í¤ò»È¤¦¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.BR CMSG_ALIGN () +.\"O is a Linux extension and should be not used in portable programs. +¤Ï Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢°Ü¿¢À­¤ò¹Í¤¨¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»È¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.PP +.\"O In Linux, +.\"O .BR CMSG_LEN (), +.\"O .BR CMSG_DATA (), +.\"O and +.\"O .BR CMSG_ALIGN () +.\"O are constant expressions (assuming their argument is constant); +.\"O this could be used to declare the size of global +.\"O variables. +.\"O This may be not portable, however. +Linux ¤Ç¤Ï +.BR CMSG_LEN (), +.BR CMSG_DATA (), +.BR CMSG_ALIGN () +¤ÏÄê¿ô¼°¤Ç¤¢¤ë (¤½¤ì¤é¤Î°ú¿ô¤¬Äê¿ô¤È¤ß¤Ê¤µ¤ì¤ë)¡£ +¤³¤Î¤³¤È¤Ï¡¢Âç°èÊÑ¿ô¤Î¥µ¥¤¥º¤òÀë¸À¤¹¤ë¤Î¤Ë»È¤¨¤ë¡£ +¤·¤«¤·°Ü¿¢À­¤Ï¤Ê¤¯¤Ê¤ë¤À¤í¤¦¡£ +.SH Îã +.\"O This code looks for the +.\"O .B IP_TTL +.\"O option in a received ancillary buffer: +¼¡¤Î¥³¡¼¥É¤Ï¡¢¼õ¤±¼è¤Ã¤¿Êä½õ¥Ð¥Ã¥Õ¥¡¤«¤é +.B IP_TTL +¥ª¥×¥·¥ç¥ó¤òõ¤¹¤â¤Î¤Ç¤¢¤ë¡£ +.PP +.in +4n +.nf +struct msghdr msgh; +struct cmsghdr *cmsg; +int *ttlptr; +int received_ttl; + +/* Receive auxiliary data in msgh */ +for (cmsg = CMSG_FIRSTHDR(&msgh); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msgh,cmsg)) { + if (cmsg\->cmsg_level == IPPROTO_IP + && cmsg\->cmsg_type == IP_TTL) { + ttlptr = (int *) CMSG_DATA(cmsg); + received_ttl = *ttlptr; + break; + } +} +if (cmsg == NULL) { + /* + * Error: IP_TTL not enabled or small buffer + * or I/O error. + */ +} +.fi +.in +.PP +.\"O The code below passes an array of file descriptors over a Unix socket using +.\"O .BR SCM_RIGHTS : +°Ê²¼¤Î¥³¡¼¥É¤Ï¡¢ +.B SCM_RIGHTS +¤ò»È¤¤¡¢¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤ÎÇÛÎó¤ò Unix ¥½¥±¥Ã¥È¤òÄ̤·¤ÆÁ÷¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.PP +.in +4n +.nf +struct msghdr msg = {0}; +struct cmsghdr *cmsg; +int myfds[NUM_FD]; /* Contains the file descriptors to pass. */ +char buf[CMSG_SPACE(sizeof myfds)]; /* ancillary data buffer */ +int *fdptr; + +msg.msg_control = buf; +msg.msg_controllen = sizeof buf; +cmsg = CMSG_FIRSTHDR(&msg); +cmsg\->cmsg_level = SOL_SOCKET; +cmsg\->cmsg_type = SCM_RIGHTS; +cmsg\->cmsg_len = CMSG_LEN(sizeof(int) * NUM_FD); +/* Initialize the payload: */ +fdptr = (int *) CMSG_DATA(cmsg); +memcpy(fdptr, myfds, NUM_FD * sizeof(int)); +/* Sum of the length of all control messages in the buffer: */ +msg.msg_controllen = cmsg\->cmsg_len; +.fi +.in +.SH ´ØÏ¢¹àÌÜ +.BR recvmsg (2), +.BR sendmsg (2) +.PP +RFC\ 2292 diff --git a/draft/man3/confstr.3 b/draft/man3/confstr.3 new file mode 100644 index 00000000..7468ad75 --- /dev/null +++ b/draft/man3/confstr.3 @@ -0,0 +1,230 @@ +.\" 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:53:02 1993 by Rik Faith (faith@cs.unc.edu) +.\" FIXME Many more values for 'name' are supported, some of which +.\" are documented under 'info confstr'. +.\" 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 +.\" +.TH CONFSTR 3 2010-02-03 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O confstr \- get configuration dependent string variables +confstr \- ¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥ó¤Ë°Í¸¤·¤¿Ê¸»úÎóÊÑ¿ô¤Î¼èÆÀ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t confstr(int " "name" ", char *" buf ", size_t " len ); +.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 confstr (): +_POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR confstr () +.\"O gets the value of configuration-dependent string variables. +.BR confstr () +¤Ï¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥ó¤Ë°Í¸¤·¤¿Ê¸»úÎóÊÑ¿ô¤ÎÃͤò¼èÆÀ¤¹¤ë¡£ +.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 +¤ÎÃÍ¡£ +.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 +¤ÈÈæ³Ó¤¹¤ì¤Ð¤è¤¤¡£ +.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" +.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 +¤Ë³ÊǼ¤µ¤ì¤¿ÃͤÎËöÈø¤¬ÀÚ¤êµÍ¤á¤é¤ì¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ + +.\"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 +¤òÀßÄꤹ¤ë¡£ +.\"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" +.SH ½àµò +POSIX.1-2001. +.\"O .SH EXAMPLE +.SH Îã +.\"O The following code fragment determines the path where to find +.\"O the POSIX.2 system utilities: +¼¡¤ÎÉôʬŪ¤Ê¥³¡¼¥É¤Ï¡¢ POSIX.2 ¥·¥¹¥Æ¥à¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤¬¤¢¤ë¥Ñ¥¹ +¤ò¼èÆÀ¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.br +.nf +.in +4n + +char *pathbuf; +size_t n; + +n = confstr(_CS_PATH,NULL,(size_t) 0); +pathbuf = malloc(n); +if (pathbuf == NULL) + abort(); +confstr(_CS_PATH, pathbuf, n); +.in +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sh (1), +.BR exec (3), +.BR system (3) diff --git a/draft/man3/conj.3 b/draft/man3/conj.3 new file mode 100644 index 00000000..6b5fe265 --- /dev/null +++ b/draft/man3/conj.3 @@ -0,0 +1,57 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 02:38:18 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: complex conjugate Ê£ÁǶ¦Ìò +.\"WORD: imaginary part µõÉô +.\" +.TH CONJ 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O conj, conjf, conjl \- calculate the complex conjugate +conj, conjf, conjl \- Ê£ÁǶ¦Ìò¤ò·×»»¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex conj(double complex " z ); +.br +.BI "float complex conjf(float complex " z ); +.br +.BI "long double complex conjl(long double complex " z ); +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR conj () +.\"O function returns the complex conjugate value of +.\"O .IR z . +.\"O That is the value obtained by changing the sign of the imaginary part. +.BR conj () +´Ø¿ô¤Ï \fIz\fR ¤ÎÊ£ÁǶ¦Ìò¤òÊÖ¤¹¡£ +¤½¤ÎÃͤϵõÉô¤ÎÉä¹æ¤òȿž¤·¤ÆÆÀ¤é¤ì¤ë¡£ +.LP +.\"O One has: +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + cabs(z) = csqrt(z * conj(z)) +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR sqrt (3), +.BR complex (7) diff --git a/draft/man3/copysign.3 b/draft/man3/copysign.3 new file mode 100644 index 00000000..7ae686da --- /dev/null +++ b/draft/man3/copysign.3 @@ -0,0 +1,120 @@ +.\" 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-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 +.\" +.TH COPYSIGN 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O copysign, copysignf, copysignl \- copy sign of a number +.SH ̾Á° +copysign, copysignf, copysignl \- ¿ô¤ÎÉä¹æ¤ò¥³¥Ô¡¼¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double copysign(double " x ", double " y ); +.br +.BI "float copysignf(float " x ", float " y ); +.br +.BI "long double copysignl(long double " x ", long double " y ); +.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) +»²¾È): +.in +.sp +.ad l +.BR copysign (), +.BR copysignf (), +.BR copysignl (): +.\"O _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; +¤Þ¤¿¤Ï +.I cc\ -std=c99 +.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 +.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 +¤ËÅù¤·¤¤ÃͤòÊÖ¤¹¡£ + +.\"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 ½àµò +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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR signbit (3) diff --git a/draft/man3/cos.3 b/draft/man3/cos.3 new file mode 100644 index 00000000..4ac03a0c --- /dev/null +++ b/draft/man3/cos.3 @@ -0,0 +1,159 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 +.\" +.TH COS 3 2009-02-04 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O cos, cosf, cosl \- cosine function +cos, cosf, cosl \- ;¸¹ (¥³¥µ¥¤¥ó) ´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double cos(double " x ); +.br +.BI "float cosf(float " x ); +.br +.BI "long double cosl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR cosf (), +.BR cosl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the cosine of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤Î;¸¹¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ 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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is an infinity +Îΰ襨¥é¡¼ (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 ) +¤¬¾å¤¬¤ë¡£ +.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=6780 +.\"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" +.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) diff --git a/draft/man3/cosh.3 b/draft/man3/cosh.3 new file mode 100644 index 00000000..f8eaad7e --- /dev/null +++ b/draft/man3/cosh.3 @@ -0,0 +1,186 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" 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) +.\" +.\" 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 2008-08-10 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O cosh, coshf, coshl \- hyperbolic cosine function +cosh, coshf, coshl \- ÁжÊÀþ;¸¹ (¥Ï¥¤¥Ñ¥Ü¥ê¥Ã¥¯¥³¥µ¥¤¥ó) ´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double cosh(double " x ); +.br +.BI "float coshf(float " x ); +.br +.BI "long double coshl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR coshf (), +.BR coshl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 () +´Ø¿ô¤ÏÁжÊÀþ;¸¹ (¥Ï¥¤¥Ñ¥Ü¥ê¥Ã¥¯¥³¥µ¥¤¥ó) ¤ÎÃͤòÊÖ¤¹¡£ +¿ô³ØŪ¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë. +.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 +¤ÎÁжÊÀþ;¸¹¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is +0 or \-0, 1 is returned. +.I x +¤¬ +0 ¤« \-0 ¤Î¾ì¹ç¡¢ 1 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is positive infinity or negative infinity, +.\"O positive infinity is returned. +.I x +¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.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" +.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 +.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 ) +¤¬¾å¤¬¤é¤Ê¤«¤Ã¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR acosh (3), +.BR asinh (3), +.BR atanh (3), +.BR ccos (3), +.BR sinh (3), +.BR tanh (3) diff --git a/draft/man3/cpow.3 b/draft/man3/cpow.3 new file mode 100644 index 00000000..37439755 --- /dev/null +++ b/draft/man3/cpow.3 @@ -0,0 +1,55 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\"WORD: power Îß¾è +.\"WORD: branch cut ʬ»ÞÀÚÃÇ +.\" +.TH CPOW 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O cpow, cpowf, cpowl \- complex power function +.SH ̾Á° +cpow, cpowf, cpowl \- Ê£ÁÇ¿ô¤ÎÎß¾è´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double complex cpow(double complex " x ", complex double " z ");" +.br +.BI "float complex cpowf(float complex " x ", complex float " z ");" +.br +.BI "long double complex cpowl(long double complex " x , +.BI " complex long double " z ");" +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The function calculates +.\"O .I x +.\"O raised to the power +.\"O .IR z . +.\"O (With a branch cut for +.\"O .I x +.\"O along the negative real axis.) +¤³¤Î´Ø¿ô¤Ï +.I x +¤Î +.I z +¾è¤ò·×»»¤¹¤ë +(¼Â¼´¤ÎÉé¤ÎÉôʬ¤Ë±è¤Ã¤Æ +.I x +¤Îʬ»ÞÀÚÃÇ (branch cut) ¤¬¤¢¤ë)¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR pow (3), +.BR complex (7) diff --git a/draft/man3/cproj.3 b/draft/man3/cproj.3 new file mode 100644 index 00000000..8bdc0d57 --- /dev/null +++ b/draft/man3/cproj.3 @@ -0,0 +1,65 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-24, Akihiro MOTOKI +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" +.\"WORD: Riemann Sphere ¥ê¡¼¥Þ¥óµå +.\"WORD: project ¼Í±Æ +.\"WORD: complex plane Ê£ÁÇÊ¿ÌÌ +.\"WORD: compactification ¥³¥ó¥Ñ¥¯¥È(´°Á´Ï¢Â³)¤Ë¤Ê¤ë(¤Î̾»ì·Á) +.\" +.TH CPROJ 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O cproj, cprojf, cprojl \- project into Riemann Sphere +cproj, cprojf, cprojl \- ¥ê¡¼¥Þ¥óµå¤Ø¤Î¼Í±Æ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex cproj(double complex " z ");" +.br +.BI "float complex cprojf(float complex " z ");" +.br +.BI "long double complex cprojl(long double complex " z ");" +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This function projects a point in the plane onto the surface of a +.\"O Riemann Sphere, the one-point compactification of the complex plane. +.\"O Each finite point +.\"O .I z +.\"O projects to +.\"O .I z +.\"O itself. +.\"O Every complex infinite value is projected to a single infinite value, +.\"O namely to positive infinity on the real axis. +¤³¤Î´Ø¿ô¤Ï¡¢Ê¿Ì̾å¤ÎÅÀ¤ò¥ê¡¼¥Þ¥óµå¤ÎɽÌ̤˼ͱƤ¹¤ë¡¢¤Ä¤Þ¤ê +Ê£ÁÇÊ¿Ì̤ΰì¤Ä¤Î¼´¤Ø¤Î¥³¥ó¥Ñ¥¯¥È²½ (one-point compactification) ¤ò¹Ô¤¦¡£ +Í­¸Â¤ÊÅÀ +.I z +¤Ï¤¤¤º¤ì¤â +.I z +¼«¿È¤Ø¼Í±Æ¤µ¤ì¤ë¡£ +̵¸Â¤ÎÃͤò»ý¤ÄÁ´¤Æ¤ÎÊ£ÁÇ¿ô¤Ï¡¢°ì¤Ä¤Î̵¸ÂÃͤ˼ͱƤµ¤ì¤ë¡£ +¤â¤Ã¤È¾Ü¤·¤¯¸À¤¦¤È¡¢¼Â¿ô¼´¤ÎÀµ¤Î̵¸ÂÂç¤Ë¼Í±Æ¤µ¤ì¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The glibc implementation is broken and does something entirely different. +glibc ¤Î¼ÂÁõ¤Ï¤ª¤«¤·¤¯¡¢Á´¤¯°ã¤Ã¤¿¤³¤È¤ò¤·¤Æ¤·¤Þ¤¦¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR complex (7) diff --git a/draft/man3/creal.3 b/draft/man3/creal.3 new file mode 100644 index 00000000..0b7742a5 --- /dev/null +++ b/draft/man3/creal.3 @@ -0,0 +1,63 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 01:33:13 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CREAL 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O creal, crealf, creall \- get real part of a complex number +creal, crealf, creall \- Ê£ÁÇ¿ô¤Î¼ÂÉô¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double creal(double complex " z ); +.br +.BI "float crealf(float complex " z ); +.br +.BI "long double creall(long double complex " z ); +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR creal () +.\"O function returns the real part of the complex number +.\"O .IR z . +.BR creal () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤Î¼ÂÉô¤òÊÖ¤¹¡£ +.LP +.\"O One has: +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + z = creal(z) + I * cimag(z) +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The gcc supports also __real__. +.\"O That is a GNU extension. +gcc ¤Ç¤Ï __real__ ¤ò»È¤¦¤³¤È¤â¤Ç¤­¤ë¤¬¡¢ +¤³¤ì¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR cimag (3), +.BR complex (7) diff --git a/draft/man3/crypt.3 b/draft/man3/crypt.3 new file mode 100644 index 00000000..dbb253ab --- /dev/null +++ b/draft/man3/crypt.3 @@ -0,0 +1,366 @@ +.\" Michael Haardt (michael@cantor.informatik.rwth.aachen.de) +.\" Sat Sep 3 22:00:30 MET DST 1994 +.\" +.\" 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. +.\" +.\" Sun Feb 19 21:32:25 1995, faith@cs.unc.edu edited details away +.\" +.\" TO DO: This manual page should go more into detail how DES is perturbed, +.\" which string will be encrypted, and what determines the repetition factor. +.\" Is a simple repetition using ECB used, or something more advanced? I hope +.\" the presented explanations are at least better than nothing, but by no +.\" means enough. +.\" +.\" 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 2008-08-25 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O crypt, crypt_r \- password and data encryption +crypt, crypt_r \- ¥Ñ¥¹¥ï¡¼¥É¤È¥Ç¡¼¥¿¤Î°Å¹æ²½ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "char *crypt(const char *" key ", const char *" salt ); +.sp +.BI "char *crypt_r(const char *" key ", const char *" salt , +.BI " struct crypt_data *" data ); +.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 ¥¢¥ë¥´¥ê¥º¥à¤ò¸µ¤Ë¤·¤Æ¤¤¤ë¡£ +.PP +.\"O .I key +.\"O is a user's typed password. +.I key +¤Ï¥æ¡¼¥¶¤¬ÆþÎϤ¹¤ë¥Ñ¥¹¥ï¡¼¥É¤Ç¤¢¤ë¡£ +.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 ʸ»ú¤Îʸ»úÎó¤Ç¤¢¤ë¡£ +¤³¤Îʸ»úÎó¤Ï¥¢¥ë¥´¥ê¥º¥à¤Î½ÐÎϤò 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 ¤½¤Î¤â¤Î)¡£ +ÊÖ¤êÃͤϡ¢´Ø¿ô¸Æ½Ð¤·¤Î¤¿¤Ó¤Ë¾å½ñ¤­¤µ¤ì¤ëÀÅŪ¤Ê¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.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) +¤ò»È¤¦»þ¤Ë¤Ï¥¯¥é¥Ã¥¯¤µ¤ì¤¦¤ë¥Ñ¥¹¥ï¡¼¥É¤Ë¤Ä¤¤¤Æ¤Î¸¡ºº¤ò¤¹¤ë¤³¤È¤¬ +¿ä¾©¤µ¤ì¤ë¡£ +.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 ¥é¥¤¥Ö¥é¥ê¤Î¤Ò¤È¤Ä¤ò +¼ê¤Ë¤¤¤ì¤ë¤Ù¤­¤À¡£ + +.\"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" +.SH ÊÖ¤êÃÍ +.\"O On success, a pointer to the encrypted password is returned. +.\"O On error, NULL is returned. +À®¸ù¤Î¾ì¹ç¤Ë¤Ï¡¢°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï NULL ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.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 ¤µ¤ó¤ÎÌõ) +.\" .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" +.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 +.SH Ãí°Õ +.SS glibc ¤Ç¤ÎÃí°Õ +.\"O The glibc2 version of this function supports additional +.\"O encryption algorithms. +¤³¤Î´Ø¿ô¤Î 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$" ¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Æ¡¢"$" ¤Ç½ª¤ï¤Ã¤Æ¤¤¤ëʸ»úÎó¤¬ +³¤¤¤Æ¤¤¤ë¾ì¹ç: +.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 +¤ÎÃͤȤ·¤Æ¡¢°Ê²¼¤ÎÃͤËÂбþ¤·¤Æ¤¤¤ë: +.RS +.TS +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 +.\" natively by glibc -- mtk, Jul 08 +.\" +.\" 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 °Ê¹ß) +.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 ¤Ç +¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ç¤¢¤ë¡£ + +.\"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 ʸ»ú°Ê²¼¤Î +ʸ»úÎó¤Ç¤¢¤ë¡£ +¥Ñ¥¹¥ï¡¼¥Éʸ»úÎó¤Î°Å¹æ²½Éôʬ¤Ï¼ÂºÝ¤Ë·×»»¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ç¤¢¤ë¡£ +¤³¤Îʸ»úÎó¤Î¥µ¥¤¥º¤Ï¸ÇÄê¤Ç¤¢¤ë: +.TS +l l. +MD5 | 22 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 SHA implementation the entire +.\"O .I key +.\"O is significant (instead of only the first +.\"O 8 bytes). +SHA ¼ÂÁõ¤Ç¤Ï¡¢(ºÇ½é¤Î 8 ʸ»ú¤Ç¤Ï¤Ê¤¯) +.I ¥­¡¼ +Á´ÂΤ¬°ÕÌ£¤¬¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR login (1), +.BR passwd (1), +.BR encrypt (3), +.BR getpass (3), +.BR passwd (5), +.BR feature_test_macros (7) diff --git a/draft/man3/csin.3 b/draft/man3/csin.3 new file mode 100644 index 00000000..5b7ce6f5 --- /dev/null +++ b/draft/man3/csin.3 @@ -0,0 +1,50 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Wed Jul 23 05:24:36 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: sine Àµ¸¹ +.\"WORD: cosine ;¸¹ +.\"WORD: tangent ÀµÀÜ +.\" +.TH CSIN 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O csin, csinf, csinl \- complex sine function +.SH ̾Á° +csin, csinf, csinl \- Ê£ÁÇ¿ô¤ÎÀµ¸¹ (sine) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex csin(double complex " z ");" +.br +.BI "float complex csinf(float complex " z ); +.br +.BI "long double complex csinl(long double complex " z ");" +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The complex sine function is defined as: +Ê£ÁÇ¿ô¤ÎÀµ¸¹ (sine) ´Ø¿ô csin(z) ¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.nf + + csin(z) = (exp(i * z) \- exp(\-i * z)) / (2 * i) +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR ccos (3), +.BR ctan (3), +.BR complex (7) diff --git a/draft/man3/csinh.3 b/draft/man3/csinh.3 new file mode 100644 index 00000000..a20bf764 --- /dev/null +++ b/draft/man3/csinh.3 @@ -0,0 +1,51 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Wed Jul 23 05:54:24 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: hyperbolic ÁжÊ(Àþ¤Î) +.\"WORD: sine Àµ¸¹ +.\"WORD: cosine ;¸¹ +.\"WORD: tangent ÀµÀÜ +.\" +.TH CSINH 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O csinh, csinhf, csinhl \- complex hyperbolic sine +csinh, csinhf, csinhl \- Ê£ÁÇ¿ô¤ÎÁжÊÀþÀµ¸¹ (hyperbolic sine) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex csinh(double complex " z ");" +.br +.BI "float complex csinhf(float complex " z ");" +.br +.BI "long double complex csinhl(long double complex " z ");" +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The complex hyperbolic sine function is defined as: +Ê£ÁÇ¿ô¤ÎÁжÊÀþÀµ¸¹ (hyperbolic sine) ´Ø¿ô sinh(z) ¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.nf + + csinh(z) = (exp(z)\-exp(\-z))/2 +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR ccosh (3), +.BR ctanh (3), +.BR complex (7) diff --git a/draft/man3/csqrt.3 b/draft/man3/csqrt.3 new file mode 100644 index 00000000..f3727ed2 --- /dev/null +++ b/draft/man3/csqrt.3 @@ -0,0 +1,55 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 00:47:23 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: square root Ê¿Êýº¬ +.\"WORD: branch cut ʬ»ÞÀÚÃÇ +.\" +.TH CSQRT 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O csqrt, csqrtf, csqrtl \- complex square root +csqrt, csqrtf, csqrtl \- Ê£ÁÇ¿ô¤ÎÊ¿Êýº¬ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex csqrt(double complex " z ");" +.br +.BI "float complex csqrtf(float complex " z ");" +.br +.BI "long double complex csqrtl(long double complex " z ");" +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Calculate the square root of a given complex number, +.\"O with nonnegative real part, and +.\"O with a branch cut along the negative real axis. +.\"O (That means that \fIcsqrt(\-1+eps*I)\fP will be close to I while +.\"O \fIcsqrt(\-1\-eps*I)\fP will be close to \-I, \fIif eps\fP is a small positive +.\"O real number.) +Í¿¤¨¤é¤ì¤¿Ê£ÁÇ¿ô¤ÎÊ¿Êýº¬¤ò·×»»¤¹¤ë¡£ +⤷¡¢Ê¿Êýº¬¤Î¤¦¤Á¼Â¿ôÉô¤¬ÈóÉé¤ÎÃͤòÊÖ¤¹¡£ +¼Â¼´¤ÎÉé¤ÎÉôʬ¤Ë±è¤Ã¤Æʬ»ÞÀÚÃÇ (branch cut) ¤¬¤¢¤ë¡£ +(¤Ä¤Þ¤ê¡¢ \fIeps\fP ¤ò¾®¤µ¤ÊÀµ¤Î¼Â¿ô¤È¤·¤¿¾ì¹ç¡¢ +\fIcsqrt(\-1+eps*I)\fP ¤¬ I ¤Ë¶áÉÕ¤¤¤Æ¤¤¤­¡¢ +°ìÊý \fIcsqrt(\-1\-eps*I)\fP ¤Ï \-I ¤Ë¶áÉÕ¤¤¤Æ¤¤¤¯¡¢ +¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£) +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR cexp (3), +.BR complex (7) diff --git a/draft/man3/ctan.3 b/draft/man3/ctan.3 new file mode 100644 index 00000000..b91ec578 --- /dev/null +++ b/draft/man3/ctan.3 @@ -0,0 +1,50 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-23, Akihiro MOTOKI +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" +.\"WORD: sine Àµ¸¹ +.\"WORD: cosine ;¸¹ +.\"WORD: tangent ÀµÀÜ +.\" +.TH CTAN 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O ctan, ctanf, ctanl \- complex tangent function +.SH ̾Á° +ctan, ctanf, ctanl \- Ê£ÁÇ¿ô¤ÎÀµÀÜ (tangent) ´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex ctan(double complex " z ");" +.br +.BI "float complex ctanf(float complex " z ); +.br +.BI "long double complex ctanl(long double complex " z ");" +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The complex tangent function is defined as: +Ê£ÁÇ¿ô¤ÎÀµÀÜ (tangent) ´Ø¿ô ctan(z) ¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.nf + + ctan(z) = csin(z) / ccos(z) +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR ccos (3), +.BR csin (3), +.BR complex (7) diff --git a/draft/man3/ctanh.3 b/draft/man3/ctanh.3 new file mode 100644 index 00000000..ee792f70 --- /dev/null +++ b/draft/man3/ctanh.3 @@ -0,0 +1,52 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-23, Akihiro MOTOKI +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" +.\"WORD: hyperbolic ÁжÊ(Àþ¤Î) +.\"WORD: sine Àµ¸¹ +.\"WORD: cosine ;¸¹ +.\"WORD: tangent ÀµÀÜ +.\" +.TH CTANH 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O ctanh, ctanhf, ctanhl \- complex hyperbolic tangent +.SH ̾Á° +ctanh, ctanhf, ctanhl \- Ê£ÁÇ¿ô¤ÎÁжÊÀþÀµÀÜ (hyperbolic tangent) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double complex ctanh(double complex " z ");" +.br +.BI "float complex ctanhf(float complex " z ); +.br +.BI "long double complex ctanhl(long double complex " z ");" +.sp +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The complex hyperbolic tangent function is defined +.\"O mathematically as: +Ê£ÁÇ¿ô¤ÎÁжÊÀþÀµÀÜ (hyperbolic tangent) ´Ø¿ô¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.nf + + ctanh(z) = csinh(z) / ccosh(z) +.fi +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR ccosh (3), +.BR csinh (3), +.BR complex (7) diff --git a/draft/man3/ctermid.3 b/draft/man3/ctermid.3 new file mode 100644 index 00000000..e8d9df54 --- /dev/null +++ b/draft/man3/ctermid.3 @@ -0,0 +1,99 @@ +.\" 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:51:06 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 +.\" +.TH CTERMID 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ctermid \- get controlling terminal name +ctermid \- À©¸æüËö̾¤Î¼èÆÀ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *ctermid(char *" "s" ); +.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 ctermid (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.\" From : _XOPEN_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR ctermid () +.\"O returns a string which is the pathname for the current +.\"O controlling terminal for this process. +.\"O If +.\"O .I s +.\"O is NULL, +.\"O a static buffer is used, otherwise +.\"O .I s +.\"O points to a buffer used to hold the terminal pathname. +.\"O The symbolic constant +.\"O .B L_ctermid +.\"O is the maximum number of characters in the returned pathname. +.BR ctermid () +¤Ï¥×¥í¥»¥¹¤Î¸½ºß¤ÎÀ©¸æüËö¤Î¥Ñ¥¹Ì¾¤òÊÖ¤¹¡£ +.I s +¤¬ NULL ¤Î¾ì¹ç¡¢ÀÅŪ¤Ê¥Ð¥Ã¥Õ¥¡¤òÍѤ¤¤ë¡£¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.I s +¤ÏüËö¥Ñ¥¹Ì¾¤òÊÝ»ý¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ë¡£ +¥·¥ó¥Ü¥ëÄê¿ô +.B L_ctermid +¤ÏÊÖ¤µ¤ì¤ë¥Ñ¥¹Ì¾¤ÎºÇÂçʸ»ú¿ô¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The pointer to the pathname. +¥Ñ¥¹Ì¾¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The path returned may not uniquely identify the controlling +.\"O terminal; it may, for example, be +.\"O .IR /dev/tty . +ÊÖ¤µ¤ì¤¿¥Ñ¥¹¤Ï¤¿¤Ö¤óÀ©¸æüËö¤ò°ì°Õ¤Ë¤ÏÆÃÄê¤Ç¤­¤Ê¤¤¡£ +¤¿¤È¤¨¤Ð +.I /dev/tty +¤Î¤è¤¦¤Ë¡£ +.PP +.\"O It is not assured that the program can open the terminal. +¥×¥í¥°¥é¥à¤¬Ã¼Ëö¤ò¥ª¡¼¥×¥ó¤Ç¤­¤ë¤³¤È¤ÏÊݾڤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" in glibc 2.3.x, x >= 4, the glibc headers threw an error +.\" if ctermid() was given an argument; fixed in 2.4. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ttyname (3) diff --git a/draft/man3/ctime.3 b/draft/man3/ctime.3 new file mode 100644 index 00000000..a10b8ec5 --- /dev/null +++ b/draft/man3/ctime.3 @@ -0,0 +1,618 @@ +.\" 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 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 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 Í×ÁÇÊ̤λþ¹ï +.\" +.TH CTIME 3 2010-02-25 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "char *asctime(const struct tm *" tm ); +.br +.BI "char *asctime_r(const struct tm *" tm ", char *" buf ); +.sp +.BI "char *ctime(const time_t *" timep ); +.br +.BI "char *ctime_r(const time_t *" timep ", char *" buf ); +.sp +.BI "struct tm *gmtime(const time_t *" timep ); +.br +.BI "struct tm *gmtime_r(const time_t *" timep ", struct tm *" result ); +.sp +.BI "struct tm *localtime(const time_t *" timep ); +.br +.BI "struct tm *localtime_r(const time_t *" timep ", struct tm *" result ); +.sp +.BI "time_t mktime(struct tm *" tm ); +.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 asctime_r (), +.BR ctime_r (), +.BR gmtime_r (), +.BR localtime_r (): +.br +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.\"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)) ¤«¤é¤Î·Ð²áÉÿô¤È²ò¼á¤µ¤ì¤ë¡£ +.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 () +¤Ï +ǯ¡¦·î¡¦Æü¤Ê¤É¤ËʬΥ¤µ¤ì¤¿Í×ÁÇÊ̤λþ¹ï¤ò°ú¤­¿ô¤È¤¹¤ë¡£ +.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 ¹½Â¤ÂΤËÊÝ»ý¤µ¤ì¤ë¡£ +.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; /* »þ´Ö */ + int tm_mday; /* Æü */ + int tm_mon; /* ·î */ + int tm_year; /* ǯ */ + int tm_wday; /* ÍËÆü */ + int tm_yday; /* ǯÆâÄÌ»»Æü */ + int tm_isdst; /* ²Æ»þ´Ö */ +}; +.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. +ʬ¿ô¡¢0 ¤«¤é 59 ¤Þ¤Ç¤ÎÃÍ¡£ +.TP +.I tm_hour +.\"O The number of hours past midnight, in the range 0 to 23. +¿¿ÌëÃ椫¤é¤ÎÄÌ»»»þ´Ö¡¢0 ¤«¤é 23 ¤Þ¤Ç¤ÎÃÍ¡£ +.TP +.I tm_mday +.\"O The day of the month, in the range 1 to 31. +·î¤Ï¤¸¤á¤«¤é¤ÎÆü¿ô¡¢1 ¤«¤é 31 ¤Þ¤Ç¤ÎÃÍ¡£ +.TP +.I tm_mon +.\"O The number of months since January, in the range 0 to 11. +1·î¤«¤é¤ÎÄÌ»»·î¿ô¡¢0 ¤«¤é 11 ¤Þ¤Ç¤ÎÃÍ¡£ +.TP +.I tm_year +.\"O The number of years since 1900. +1900 ǯ¤«¤é¤ÎÄÌ»»Ç¯¿ô¡£ +.TP +.I tm_wday +.\"O The number of days since Sunday, in the range 0 to 6. +ÆüÍËÆü¤«¤é¤ÎÄÌ»»Æü¿ô(ÍËÆü)¡£0 ¤«¤é 6 ¤Þ¤Ç¤ÎÃÍ¡£ +.TP +.I tm_yday +.\"O The number of days since January 1, in the range 0 to 365. +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 ¤Ê¤é¤Ð̵¸ú¡¢Éé¤ÎÃͤʤé¤Ð¤³¤Î¾ðÊó¤Ë¤Ï +°ÕÌ£¤¬¤Ê¤¤¡£ +.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 ¤ò +.sp +.RS +"Wed Jun 30 21:49:08 1993\\n" +.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 +¤òÀßÄꤹ¤ëɬÍפϤʤ¤¡£ +.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 () +¤âƱÍͤÀ¤¬¡¢ +¥Ç¡¼¥¿¤Ï¥æ¡¼¥¶¡¼¤¬ÍÑ°Õ¤·¤¿¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR localtime () +.\"O function converts the calendar time \fItimep\fP to +.\"O broken-time representation, expressed relative to the user's specified +.\"O 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 () +¤Ï¡¢¥æ¡¼¥¶¤¬»ØÄꤷ¤¿¥¿¥¤¥à¥¾¡¼¥ó¤Ç¤Î»þ¹ïÍ×ÁǤØÊÑ´¹¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï +.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 +¤òÀßÄꤹ¤ëɬÍפϤʤ¤¡£ +.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 ¥Ð¥¤¥È°Ê¾å¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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 () +¤Ï (¥¿¥¤¥à¥¾¡¼¥ó¾ðÊó¤È¥·¥¹¥Æ¥à¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»È¤Ã¤Æ) +»ØÄꤵ¤ì¤¿»þ¹ï¤Ç²Æ»þ´Ö¤¬Í­¸ú¤«¤É¤¦¤«¤òȽÃǤ¹¤ëɬÍפ¬¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ + +.\"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 ¤¬¸½ºß¤Î¥¿¥¤¥à¥¾¡¼¥ó¤ËÀßÄꤵ¤ì¤ë¡£ + +.\"O If the specified broken-down +.\"O time cannot be represented as calendar time (seconds since the Epoch), +.\"O .BR mktime () +.\"O returns a value of +.\"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" +.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) ¤òÊÖ¤¹¡£ +.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) +¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.\"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 °Ê¹ß¤ÇÍøÍѤǤ­¤ë¡£ + +.\"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 ¤Î¼ÂÁõ¤Çµ¯¤³¤ê¤¦¤ë¡£ +.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 ¤ò»ØÄꤹ¤ë¤ÈÁ°·î¤ÎºÇ½ªÆü¤ò°ÕÌ£¤·¤Æ¤¤¤ë¤È²ò¼á¤µ¤ì¤ë¡£ +.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 ¤Ë°Ê²¼¤Î¥Õ¥£¡¼¥ë¥É¤¬Äɲ䵤ì¤ë¡£ +.sp +.RS +.nf +long tm_gmtoff; /* Seconds east of UTC */ +const char *tm_zone; /* Timezone abbreviation */ +.fi +.RE +.sp +.\"O This is a BSD extension, present in 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 () +.\"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 () +.\"O should be called before +.\"O .BR localtime_r (). +POSIX.1-2004 ¤Ë¤è¤ë¤È¡¢ +.BR localtime () +¤Ï¤¢¤¿¤«¤â +.BR tzset () +¤¬¸Æ¤Ð¤ì¤¿¤«¤Î¤è¤¦¤Ë¿¶Éñ¤¦¤³¤È¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë¤¬¡¢ +.BR localtime_r () +¤Ë¤Ï¤³¤ÎÍ×·ï¤Ï¤Ê¤¤¡£ +.\" http://thread.gmane.org/gmane.comp.time.tz/2034/ ¤ò»²¾È¡£ +°Ü¿¢À­¤¬É¬Íפʥ³¡¼¥É¤Ç¤Ï¡¢ +.BR localtime_r () +¤ÎÁ°¤Ë +.BR tzset () +¤ò¸Æ¤Ó½Ð¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.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) diff --git a/draft/man3/daemon.3 b/draft/man3/daemon.3 new file mode 100644 index 00000000..2e2b117d --- /dev/null +++ b/draft/man3/daemon.3 @@ -0,0 +1,172 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)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 +.\" +.\"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 +.SH ̾Á° +.\"O daemon \- run in the background +daemon \- ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤ÇÆ°ºî¤µ¤»¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.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 +.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 () +¤Ï¡¢À©¸æüËö¤«¤éʬΥ¤µ¤»¤Æ¥·¥¹¥Æ¥à¥Ç¡¼¥â¥ó¤È¤·¤ÆÆ°ºî¤µ¤»¤¿¤¤ +¥×¥í¥°¥é¥à¤Î¤¿¤á¤Î´Ø¿ô¤Ç¤¢¤ë¡£ +.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) +¤ò¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê ("/") ¤ËÊѹ¹¤¹¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.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 ¤Ë¥ê¥À¥¤¥ì¥¯¥È¤¹¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.\"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) +¤Ë´Ø¤·¤Æµ¬Äꤵ¤ì¤¿¥¨¥é¡¼¤òÀßÄꤹ¤ë¡£ +.\"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 +.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 +.SH ´ØÏ¢¹àÌÜ +.BR fork (2), +.BR setsid (2) diff --git a/draft/man3/dbopen.3 b/draft/man3/dbopen.3 new file mode 100644 index 00000000..357b95c8 --- /dev/null +++ b/draft/man3/dbopen.3 @@ -0,0 +1,887 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)dbopen.3 8.5 (Berkeley) 1/2/94 +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito +.\" all rights reserved. +.\" Translated Thu Jul 22 00:00:00 JST 1999 +.\" by Shouichi Saito +.\" Proofed Tue Aug 19 1999 by NAKANO Takeo +.\" +.\"WORD: descriptor ¥Ç¥¹¥¯¥ê¥×¥¿ +.TH DBOPEN 3 1994-01-02 "" "Linux Programmer's Manual" +.UC 7 +.\"O .SH NAME +.SH ̾Á° +.\"O dbopen \- database access methods +dbopen \- ¥Ç¡¼¥¿¥Ù¡¼¥¹¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include + +.BI "DB *dbopen(const char *" file ", int " flags ", int " mode \ +", DBTYPE " type , +.BI " const void *" openinfo ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR dbopen () +.\"O is the library interface to database files. +.BR dbopen () +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +.\"O The supported file formats are btree, hashed and UNIX file oriented. +.\"O The btree format is a representation of a sorted, balanced tree structure. +.\"O The hashed format is an extensible, dynamic hashing scheme. +.\"O The flat-file format is a byte stream file with fixed or variable length +.\"O records. +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï btree, hash, +UNIX ¥Õ¥¡¥¤¥ë¤Ë»Ø¸þ¤·¤¿¥Õ¥©¡¼¥Þ¥Ã¥È, ¤Î 3 ¤Ä¤Ç¤¢¤ë¡£ +btree ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢¥½¡¼¥È¤µ¤ì¤¿¥Ð¥é¥ó¥¹¥Ä¥ê¡¼¹½Â¤¤Ç¤¢¤ë¡£ +hashed ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢³ÈÄ¥²Äǽ¤ÊưŪ hash ¥¹¥­¡¼¥à¤Ç¤¢¤ë¡£ +¥Õ¥é¥Ã¥È¥Õ¥¡¥¤¥ë (flat-file) ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢ +¸ÇÄêĹ/²ÄÊÑĹ¤Î¥ì¥³¡¼¥É¤«¤é¤Ê¤ë¥Ð¥¤¥È¥¹¥È¥ê¡¼¥à¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.\"O The formats and file format specific information are described in detail +.\"O in their respective manual pages +.\"O .BR btree (3), +.\"O .BR hash (3) +.\"O and +.\"O .BR recno (3). +¤½¤ì¤¾¤ì¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤È¡¢¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤ËÆÃÍ­¤Î¾ðÊó¤Ï +¤½¤ì¤¾¤ìÂбþ¤¹¤ë¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸ +.BR btree (3), +.BR hash (3), +.BR recno (3) +¤Ë¾ÜºÙ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O .BR dbopen () +.\"O opens +.\"O .I file +.\"O for reading and/or writing. +.BR dbopen () +¤Ï +.I file +¤òÆɤ߹þ¤ß (Æɤ߽ñ¤­) ¤¹¤ë¤¿¤á¤Ë¥ª¡¼¥×¥ó¤¹¤ë¡£ +.\"O Files never intended to be preserved on disk may be created by setting +.\"O the +.\"O .I file +.\"O argument to NULL. +.I file +°ú¤­¿ô¤ò NULL ¤Ë¤¹¤ì¤Ð¡¢ +¥Ç¥£¥¹¥¯¾å¤ËÊݸ¤·¤¿¤¯¤Ê¤¤¥Õ¥¡¥¤¥ë¤òºî¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.PP +.\"O The +.\"O .I flags +.\"O and +.\"O .I mode +.\"O arguments are as specified to the +.\"O .BR open (2) +.\"O routine, however, only the +.\"O .BR O_CREAT , +.\"O .BR O_EXCL , +.\"O .BR O_EXLOCK , +.\"O .BR O_NONBLOCK , +.\"O .BR O_RDONLY , +.\"O .BR O_RDWR , +.\"O .BR O_SHLOCK , +.\"O and +.\"O .B O_TRUNC +.\"O flags are meaningful. +.I flags +¤È +.I mode +°ú¤­¿ô¤Ï +.BR open (2) +¥ë¡¼¥Á¥ó¤Ç»ØÄꤹ¤ë¤Î¤ÈƱÍͤǤ¢¤ë¡£¤¿¤À¤· +°ÕÌ£¤ò»ý¤Ä¥Õ¥é¥°¤Ï +.BR O_CREAT , +.BR O_EXCL , +.BR O_EXLOCK , +.BR O_NONBLOCK , +.BR O_RDONLY , +.BR O_RDWR , +.BR O_SHLOCK , +.B O_TRUNC +¤À¤±¤Ç¤¢¤ë¡£ +.\"O (Note, opening a database file +.\"O .B O_WRONLY +.\"O is not possible.) +(Ãí°Õ: +.B O_WRONLY +¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ò³«¤¯»ö¤Ï½ÐÍè¤Ê¤¤) +.\"Three additional options may be specified by +.\".IR or 'ing +.\"them into the +.\".I flags +.\"argument. +.\".TP +.\"DB_LOCK +.\"Do the necessary locking in the database to support concurrent access. +.\"If concurrent access isn't needed or the database is read-only this +.\"flag should not be set, as it tends to have an associated performance +.\"penalty. +.\".TP +.\"DB_SHMEM +.\"Place the underlying memory pool used by the database in shared +.\"memory. +.\"Necessary for concurrent access. +.\".TP +.\"DB_TXN +.\"Support transactions in the database. +.\"The DB_LOCK and DB_SHMEM flags must be set as well. +.PP +.\"O The +.\"O .I type +.\"O argument is of type +.\"O .I DBTYPE +.\"O (as defined in the +.\"O .I +.\"O include file) and +.\"O may be set to +.\"O .BR DB_BTREE , +.\"O .BR DB_HASH , +.\"O or +.\"O .BR DB_RECNO . +.I type +°ú¤­¿ô¤Ï +.I DBTYPE +·¿¤Ç¤¢¤ë (¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +.BR DB_BTREE , +.BR DB_HASH , +.B DB_RECNO +¤Î¤¤¤º¤ì¤«¤ò¥»¥Ã¥È¤Ç¤­¤ë¡£ +.PP +.\"O The +.\"O .I openinfo +.\"O argument is a pointer to an access method specific structure described +.\"O in the access method's manual page. +.\"O If +.\"O .I openinfo +.\"O is NULL, each access method will use defaults appropriate for the system +.\"O and the access method. +.I openinfo +°ú¤­¿ô¤Ï¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ë¸ÇÍ­¤Ê¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¹½Â¤ÂΤ˴ؤ·¤Æ¤Ï³Æ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Î +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.I openinfo +¤¬ NULL ¤Î¾ì¹ç¡¢¤½¤ì¤¾¤ì¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤È¥·¥¹¥Æ¥à¤È¤ËŬ¹ç¤·¤¿ +¥Ç¥Õ¥©¥ë¥È¤¬ÍѤ¤¤é¤ì¤ë¡£ +.PP +.\"O .BR dbopen () +.\"O returns a pointer to a +.\"O .I DB +.\"O structure on success and NULL on error. +.\"O The +.\"O .I DB +.\"O structure is defined in the +.\"O .I +.\"O include file, and contains at +.\"O least the following fields: +.BR dbopen () +¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç +.I DB +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò¡¢¥¨¥é¡¼¤Î¾ì¹ç NULL ¤òÊÖ¤¹¡£ +.I DB +¹½Â¤ÂÎ¤Ï +.I +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤ÎÃæ¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +¾¯¤Ê¤¯¤È¤â°Ê²¼¤Î¤è¤¦¤Ê¥Õ¥£¡¼¥ë¥É¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +typedef struct { + DBTYPE type; + int (*close)(const DB *db); + int (*del)(const DB *db, const DBT *key, unsigned int flags); + int (*fd)(const DB *db); + int (*get)(const DB *db, DBT *key, DBT *data, + unsigned int flags); + int (*put)(const DB *db, DBT *key, const DBT *data, + unsigned int flags); + int (*sync)(const DB *db, unsigned int flags); + int (*seq)(const DB *db, DBT *key, DBT *data, + unsigned int flags); +} DB; +.fi +.in +.PP +.\"O These elements describe a database type and a set of functions performing +.\"O various actions. +.\"O These functions take a pointer to a structure as returned by +.\"O .BR dbopen (), +.\"O and sometimes one or more pointers to key/data structures and a flag value. +³ÆÍ×ÁǤˤϡ¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¿¥¤¥×¤È¡¢ +ÍÍ¡¹¤ÊÆ°ºî¤ò¤¹¤ë´Ø¿ô¤Î¥»¥Ã¥È¤¬µ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.BR dbopen () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò°ú¤­¿ô¤Ë¤È¤ë¡£ +¥­¡¼/¥Ç¡¼¥¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ä¥Õ¥é¥°Ãͤò¼è¤ë¤â¤Î¤â¤¢¤ë¡£ +.TP +.I type +.\"O The type of the underlying access method (and file format). +ÍѤ¤¤é¤ì¤Æ¤¤¤ë¥¢¥¯¥»¥¹¥á¥½¥Ã¥É (¤È¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È) ¤Î·¿¡£ +.TP +.I close +.\"O A pointer to a routine to flush any cached information to disk, free any +.\"O allocated resources, and close the underlying file(s). +¥­¥ã¥Ã¥·¥å¤µ¤ì¤¿¾ðÊó¤ò¥Ç¥£¥¹¥¯¤ËÁݤ­¤À¤¹¤¿¤á¤Î¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +³ä¤êÅö¤Æ¤é¤ì¤¿¥ê¥½¡¼¥¹¤ò²òÊü¤·¡¢ÍøÍѤ·¤¿¥Õ¥¡¥¤¥ë(·²)¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.\"O Since key/data pairs may be cached in memory, failing to sync the file +.\"O with a +.\"O .I close +.\"O or +.\"O .I sync +.\"O function may result in inconsistent or lost information. +¥­¡¼/¥Ç¡¼¥¿ÂФ¬¥á¥â¥ê¤Ë¥­¥ã¥Ã¥·¥å¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.I close +¤ä +.I sync +´Ø¿ô¤Ç¤ÎƱ´ü¤Ë¼ºÇÔ¤¹¤ë¤È¡¢¾ðÊó¤ËÌ·½â¤¬À¸¤¸¤ë¤«¾ðÊó¤ò¼º¤¦²ÄǽÀ­¤¬¤¢¤ë¡£ +.\"O .I close +.\"O routines return \-1 on error (setting +.\"O .IR errno ) +.\"O and 0 on success. +.I close +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +.TP +.I del +.\"O A pointer to a routine to remove key/data pairs from the database. +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥­¡¼/¥Ç¡¼¥¿ÂФòºï½ü¤¹¤ë¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.IP +.\"O The argument +.\"O .I flag +.\"O may be set to the following value: +.I flag +°ú¤­¿ô¤Ï¼¡¤ÎÃͤ¬¥»¥Ã¥È¤Ç¤­¤ë¡£ +.RS +.TP +.B R_CURSOR +.\"O Delete the record referenced by the cursor. +.\"O The cursor must have previously been initialized. +¥«¡¼¥½¥ë (cursor) ¤¬»²¾È¤·¤Æ¤¤¤ë¥ì¥³¡¼¥É¤òºï½ü¤¹¤ë¡£ +¥«¡¼¥½¥ë¤ÏÁ°¤â¤Ã¤Æ½é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.RE +.IP +.\"O .I delete +.\"O routines return \-1 on error (setting +.\"O .IR errno ), +.\"O 0 on success, and 1 if the specified +.\"O .I key +.\"O was not in the file. +.I delete +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¤Þ¤¿»ØÄê¤Î +.I key +¤¬¥Õ¥¡¥¤¥ëÃæ¤Ë̵¤¤¾ì¹ç 1 ¤òÊÖ¤¹¡£ +.TP +.I fd +.\"O A pointer to a routine which returns a file descriptor representative +.\"O of the underlying database. +ÍѤ¤¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¥ë¡¼¥Á¥ó +¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.\"O A file descriptor referencing the same file will be returned to all +.\"O processes which call +.\"O .BR dbopen () +.\"O with the same +.\"O .I file +.\"O name. +Ʊ¤¸¥Õ¥¡¥¤¥ë̾ +.I file +¤Ç +.BR dbopen () +¤ò¸Æ¤Ó½Ð¤·¤¿Á´¤Æ¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤ò¼¨¤¹Ã±°ì¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O This file descriptor may be safely used as an argument to the +.\"O .BR fcntl (2) +.\"O and +.\"O .BR flock (2) +.\"O locking functions. +¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤Ï¥í¥Ã¥¯´Ø¿ô +.BR fcntl (2) +¤È +.BR flock (2) +¤Ø¤Î°ú¤­¿ô¤È¤·¤Æ°ÂÁ´¤Ë»ÈÍѤǤ­¤ë¡£ +.\"O The file descriptor is not necessarily associated with any of the +.\"O underlying files used by the access method. +.\"O No file descriptor is available for in memory databases. +.\"O .I fd +.\"O routines return \-1 on error (setting +.\"O .IR errno ), +.\"O and the file descriptor on success. +¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤Ï¡¢É¬¤º¤·¤â¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ç +ÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Î¤¤¤º¤ì¤«¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤Ê¤¯¤Æ¤âÎɤ¤¡£ +¥á¥â¥êÆâ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ï¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤Ï̵¤¤¡£ +.I fd +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢À®¸ù¤¹¤ë¤È¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.TP +.I get +.\"O A pointer to a routine which is the interface for keyed retrieval from +.\"O the database. +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥­¡¼¤òÍѤ¤¤Æ¥Ç¡¼¥¿¤ò¼è¤ê½Ð¤¹¤¿¤á¤Î +¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.\"O The address and length of the data associated with the specified +.\"O .I key +.\"O are returned in the structure referenced by +.\"O .IR data . +»ØÄꤷ¤¿ +.I key +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥Ç¡¼¥¿¤Î¥¢¥É¥ì¥¹¤ÈŤµ¤¬ +.I data +¤¬»²¾È¤¹¤ë¹½Â¤ÂΤËÊÖ¤µ¤ì¤ë¡£ +.\"O .I get +.\"O routines return \-1 on error (setting +.\"O .IR errno ), +.\"O 0 on success, and 1 if the +.\"O .I key +.\"O was not in the file. +.I get +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¤Þ¤¿ +.I key +¤¬¥Õ¥¡¥¤¥ëÃæ¤Ë̵¤¤¾ì¹ç 1 ¤òÊÖ¤¹¡£ +.TP +.I put +.\"O A pointer to a routine to store key/data pairs in the database. +¥­¡¼/¥Ç¡¼¥¿ÂФò¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËǼ¤á¤ë¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.IP +.\"O The argument +.\"O .I flag +.\"O may be set to one of the following values: +.I flag +°ú¤­¿ô¤Ë¤Ï¼¡¤ÎÃͤΤ¦¤Á¤Î¤É¤ì¤«°ì¤Ä¤¬¥»¥Ã¥È¤Ç¤­¤ë¡£ +.RS +.TP +.B R_CURSOR +.\"O Replace the key/data pair referenced by the cursor. +.\"O The cursor must have previously been initialized. +¥«¡¼¥½¥ë¤¬»²¾È¤·¤Æ¤¤¤ë¥­¡¼/¥Ç¡¼¥¿ÂФòÃÖ¤­´¹¤¨¤ë¡£ +¥«¡¼¥½¥ë¤ÏÁ°¤â¤Ã¤Æ½é´ü²½¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +.TP +.B R_IAFTER +.\"O Append the data immediately after the data referenced by +.\"O .IR key , +.\"O creating a new key/data pair. +.\"O The record number of the appended key/data pair is returned in the +.\"O .I key +.\"O structure. +.\"O (Applicable only to the +.\"O .B DB_RECNO +.\"O access method.) +.I key +¤Ç»²¾È¤µ¤ì¤ë¥Ç¡¼¥¿¤Îľ¸å¤Ë¡¢ +¿·¤·¤¤¥­¡¼/¥Ç¡¼¥¿ÂФòºî¤Ã¤Æ¥Ç¡¼¥¿¤òÄɲ乤롣 +Äɲ䵤줿¥­¡¼/¥Ç¡¼¥¿ÂФΥ쥳¡¼¥ÉÈÖ¹æ¤Ï +.I key +¹½Â¤ÂΤËÊÖ¤µ¤ì¤ë¡£ +.RB ( DB_RECNO +¥¢¥¯¥»¥¹ÊýË¡¤Ç¤Î¤ß»È¤¨¤ë¡£) +.TP +.B R_IBEFORE +.\"O Insert the data immediately before the data referenced by +.\"O .IR key , +.\"O creating a new key/data pair. +.\"O The record number of the inserted key/data pair is returned in the +.\"O .I key +.\"O structure. +.\"O (Applicable only to the +.\"O .B DB_RECNO +.\"O access method.) +.I key +¤Ç»²¾È¤µ¤ì¤ë¥Ç¡¼¥¿¤ÎľÁ°¤Ë¡¢ +¿·¤·¤¤¥­¡¼/¥Ç¡¼¥¿ÂФòºî¤Ã¤Æ¥Ç¡¼¥¿¤òÁÞÆþ¤¹¤ë¡£ +Äɲ䵤줿¥­¡¼/¥Ç¡¼¥¿ÂФΥ쥳¡¼¥ÉÈÖ¹æ¤Ï +.I key +¹½Â¤ÂΤËÊÖ¤µ¤ì¤ë¡£ +.RB ( DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ç¤Î¤ß»È¤¨¤ë¡£) +.TP +.B R_NOOVERWRITE +.\"O Enter the new key/data pair only if the key does not previously exist. +¥­¡¼¤¬¤¢¤é¤«¤¸¤á¸ºß¤·¤Ê¤¤¾ì¹ç¤Ë¸Â¤ê¡¢¿·¤·¤¤¥­¡¼/¥Ç¡¼¥¿ÂФò¤¤¤ì¤ë¡£ +.TP +.B R_SETCURSOR +.\"O Store the key/data pair, setting or initializing the position of the +.\"O cursor to reference it. +.\"O (Applicable only to the +.\"O .B DB_BTREE +.\"O and +.\"O .B DB_RECNO +.\"O access methods.) +¥­¡¼/¥Ç¡¼¥¿ÂФòǼ¤á¡¢¤½¤ì¤ò»Ø¤¹¤è¤¦¤Ë¥«¡¼¥½¥ë°ÌÃÖ¤ò¥»¥Ã¥È¤¢¤ë¤¤¤Ï½é´ü +²½¤¹¤ë¡£ +.RB ( DB_BTREE +¤È +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ç¤Î¤ß»È¤¨¤ë¡£) +.RE +.IP +.\"O .B R_SETCURSOR +.\"O is available only for the +.\"O .B DB_BTREE +.\"O and +.\"O .B DB_RECNO +.\"O access +.\"O methods because it implies that the keys have an inherent order +.\"O which does not change. +.B R_SETCURSOR +¤Ï +.B DB_BTREE +¤È +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ç¤·¤«ÍøÍѤǤ­¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é +.B R_SETCURSOR +¤òÍѤ¤¤ë¤Ë¤Ï¡¢Êѹ¹¤µ¤ì¤ë»ö¤Î̵¤¤¸ÇÍ­¤Î½ç½ø¤ò¥­¡¼ +¤¬»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.IP +.\"O .B R_IAFTER +.\"O and +.\"O .B R_IBEFORE +.\"O are available only for the +.\"O .B DB_RECNO +.\"O access method because they each imply that the access method is able to +.\"O create new keys. +.\"O This is only true if the keys are ordered and independent, record numbers +.\"O for example. +.B R_IAFTER +¤È +.B R_IBEFORE +¤Ï +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ç¤·¤«ÍøÍѤǤ­¤Ê¤¤¡£ +¤³¤ì¤é¤ò¼Â¸½¤¹¤ë¤Ë¤Ï¡¢¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤¬ +¿·¤·¤¤¥­¡¼¤òºî¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +¤³¤ì¤¬À®Î©¤¹¤ë¤Î¤Ï¡¢Î㤨¤Ð¡¢½ç½ø¤Å¤±¤é¤¿ÆÈΩ¤Ê¥ì¥³¡¼¥ÉÈֹ椬 +¥­¡¼¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤è¤¦¤Ê¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +.IP +.\"O The default behavior of the +.I put +.\"O routines is to enter the new key/data pair, replacing any previously +.\"O existing key. +¥ë¡¼¥Á¥ó¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¡¢¿·¤·¤¤¥­¡¼/¥Ç¡¼¥¿ÂФò +´û¤Ë¸ºß¤¹¤ë¥­¡¼¤òÃÖ¤­´¹¤¨¤ë»ö¤Æ³ÊǼ¤¹¤ëÆ°ºî¤Ç¤¢¤ë¡£ +.IP +.I put +.\"O routines return \-1 on error (setting +.\"O .IR errno ), +.\"O 0 on success, and 1 if the +.\"O .B R_NOOVERWRITE +.\"O .I flag +.\"O was set and the key already exists in the file. +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¤Þ¤¿ +.I flag +¤Ë +.B R_NOOVERWRITE +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Æ¥­¡¼¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç 1 ¤òÊÖ¤¹¡£ +.TP +.I seq +.\"O A pointer to a routine which is the interface for sequential +.\"O retrieval from the database. +.\"O The address and length of the key are returned in the structure +.\"O referenced by +.\"O .IR key , +.\"O and the address and length of the data are returned in the +.\"O structure referenced +.\"O by +.\"O .IR data . +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥·¡¼¥±¥ó¥·¥ã¥ë¤Ë¥Ç¡¼¥¿¤ò¼è¤ê½Ð¤¹¤¿¤á¤Î +¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +¥­¡¼¤Î¥¢¥É¥ì¥¹¤ÈŤµ¤¬ +.I key +¤¬»²¾È¤¹¤ë¹½Â¤ÂΤËÊÖ¤µ¤ì¤ë¡£¥Ç¡¼¥¿¤Î¥¢¥É¥ì¥¹¤ÈŤµ¤¬ +.I data +¤¬»²¾È¤¹¤ë¹½Â¤ÂΤËÊÖ¤µ¤ì¤ë¡£ +.IP +.\"O Sequential key/data pair retrieval may begin at any time, and the +.\"O position of the "cursor" is not affected by calls to the +¥·¡¼¥±¥ó¥·¥ã¥ë¤Ê¥­¡¼/¥Ç¡¼¥¿ÂФμèÆÀ¤Ï¤¤¤Ä¤Ç¤â¹Ô¤¨¤ë¡£¤Þ¤¿ +¡Ö¥«¡¼¥½¥ë¡×¤Î°ÌÃÖ¤Ï +.IR del , +.IR get , +.IR put , +.\"O or +.I sync +.\"O routines. +¥ë¡¼¥Á¥ó¤Î¸Æ¤Ó½Ð¤·¤Ë¤Ï±Æ¶Á¤µ¤ì¤Ê¤¤¡£ +.\"O Modifications to the database during a sequential scan will be reflected +.\"O in the scan, that is, +.\"O records inserted behind the cursor will not be returned +.\"O while records inserted in front of the cursor will be returned. +¥·¡¼¥±¥ó¥·¥ã¥ë¤Ê¥¹¥­¥ã¥ó¤ÎÅÓÃæ¤Ë¹Ô¤ï¤ì¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÊѹ¹¤Ï +¥¹¥­¥ã¥ó¤ËÈ¿±Ç¤µ¤ì¤ë¡£¤¹¤Ê¤ï¤Á¡¢¥«¡¼¥½¥ë¤Î¸å¤í¤ËÁÞÆþ¤µ¤ì¤¿¥ì¥³¡¼¥É¤Ï +ÊÖ¤µ¤ì¤Ê¤¤¤¬¡¢¥«¡¼¥½¥ë¤ÎÁ°¤ËÁÞÆþ¤µ¤ì¤¿¥ì¥³¡¼¥É¤ÏÊÖ¤µ¤ì¤ë¡£ +.IP +.\"O The flag value +.\"O .B must +.\"O be set to one of the following values: +¥Õ¥é¥°ÃͤˤÏ\fBɬ¤º\fP°Ê²¼¤Ë¼¨¤¹¤¦¤Á¤Î +¤É¤ì¤«°ì¤Ä¤ò¥»¥Ã¥È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.RS +.TP +.B R_CURSOR +.\"O The data associated with the specified key is returned. +.\"O This differs from the +.\"O .I get +.\"O routines in that it sets or initializes the cursor to the location of +.\"O the key as well. +.\"O (Note, for the +.\"O .B DB_BTREE +.\"O access method, the returned key is not necessarily an +.\"O exact match for the specified key. +.\"O The returned key is the smallest key greater than or equal to the specified +.\"O key, permitting partial key matches and range searches.) +»ØÄꤷ¤¿¥­¡¼¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥Ç¡¼¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +.I get +¥ë¡¼¥Á¥ó¤È¤Î°ã¤¤¤Ï¡¢¥«¡¼¥½¥ë¤¬¥­¡¼¤Î°ÌÃ֤˥»¥Ã¥È¤¢¤ë¤¤¤Ï +½é´ü²½¤µ¤ì¤ëÅÀ¤Ç¤¢¤ë¡£ +(Ãí°Õ: +.B DB_BTREE +¥¢¥¯¥»¥¹ÊýË¡¤Ç¤Ï¡¢ÊÖ¤µ¤ì¤¿¥­¡¼¤¬ +ɬ¤º¤·¤â»ØÄꤷ¤¿¥­¡¼¤ËÀµ¤·¤¯¥Þ¥Ã¥Á¤·¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +ÊÖ¤µ¤ì¤¿¥­¡¼¤Ï¡¢»ØÄꤵ¤ì¤¿¥­¡¼¤ËÅù¤·¤¤¤«¤è¤êÂ礭¤¤¤â¤Î¤Î¤¦¤Á +ºÇ¾®¤Î¤â¤Î¤Ë¤Ê¤ë +(Éôʬ¥­¡¼¥Þ¥Ã¥Á¤«Èϰϸ¡º÷¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë¾ì¹ç)¡£) +.TP +.B R_FIRST +.\"O The first key/data pair of the database is returned, and the cursor +.\"O is set or initialized to reference it. +¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎºÇ½é¤Î¥­¡¼/¥Ç¡¼¥¿ÂФ¬ÊÖ¤µ¤ì¤ë¡£ +¥«¡¼¥½¥ë¤Ï¤½¤ì¤ò»²¾È¤¹¤ë¤è¤¦¤Ë¥»¥Ã¥È¤Þ¤¿¤Ï½é´ü²½¤µ¤ì¤ë¡£ +.TP +.B R_LAST +.\"O The last key/data pair of the database is returned, and the cursor +.\"O is set or initialized to reference it. +.\"O (Applicable only to the +.\"O .B DB_BTREE +.\"O and +.\"O .B DB_RECNO +.\"O access methods.) +¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎºÇ¸å¤Î¥­¡¼/¥Ç¡¼¥¿ÂФ¬ÊÖ¤µ¤ì¤ë¡£¥«¡¼¥½¥ë¤Ï¤½¤ì¤ò»²¾È¤¹¤ë +¤è¤¦¤Ë¥»¥Ã¥È¤Þ¤¿¤Ï½é´ü²½¤µ¤ì¤ë¡£ +.RB ( DB_BTREE +¤È +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤À¤±¤Ç»È¤¨¤ë¡£) +.TP +.B R_NEXT +.\"O Retrieve the key/data pair immediately after the cursor. +.\"O If the cursor is not yet set, this is the same as the +.\"O .B R_FIRST +.\"O flag. +¥«¡¼¥½¥ëľ¸å¤Î¥­¡¼/¥Ç¡¼¥¿ÂФò¼èÆÀ¤¹¤ë¡£ +¥«¡¼¥½¥ë¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï +.B R_FIRST +¥Õ¥é¥°¤ÈƱ¤¸¡£ +.TP +.B R_PREV +.\"O Retrieve the key/data pair immediately before the cursor. +.\"O If the cursor is not yet set, this is the same as the +.\"O .B R_LAST +.\"O flag. +.\"O (Applicable only to the +.\"O .B DB_BTREE +.\"O and +.\"O .B DB_RECNO +.\"O access methods.) +¥«¡¼¥½¥ëľÁ°¤Î¥­¡¼/¥Ç¡¼¥¿ÂФò¼èÆÀ¤¹¤ë¡£ +¥«¡¼¥½¥ë¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï +.B R_LAST +¥Õ¥é¥°¤ÈƱ¤¸¡£ +.RB ( DB_BTREE +¤È +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤À¤±¤Ç»È¤¨¤ë¡£) +.RE +.IP +.\"O .B R_LAST +.\"O and +.\"O .B R_PREV +.\"O are available only for the +.\"O .B DB_BTREE +.\"O and +.\"O .B DB_RECNO +.\"O access methods because they each imply that the keys have an inherent +.\"O order which does not change. +.B R_LAST +¤È +.B R_PREV +¤Ï¡¢ +.B DB_BTREE +¤È +.B DB_RECNO +¥¢¥¯¥»¥¹ÊýË¡¤Ç¤·¤«»È¤¨¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é +.B R_SETCURSOR +¤òÍѤ¤¤ë¤Ë¤Ï¡¢Êѹ¹¤µ¤ì¤ë»ö¤Î̵¤¤¸ÇÍ­¤Î½ç½ø¤ò¥­¡¼¤¬»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.IP +.I seq +.\"O routines return \-1 on error (setting +.\"O .IR errno ), +.\"O 0 on success and 1 if there are no key/data pairs less than or greater +.\"O than the specified or current key. +.\"O If the +.\"O .B DB_RECNO +.\"O access method is being used, and if the database file +.\"O is a character special file and no complete key/data pairs are currently +.\"O available, the +.\"O .I seq +.\"O routines return 2. +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢ +À®¸ù¤Î¾ì¹ç 0 ¤òÊÖ¤¹¡£ +»ØÄꤷ¤¿¥­¡¼¤ä¥«¥ì¥ó¥È¥­¡¼¤è¤ê¤âÂ礭¤¤/¾®¤µ¤¤¥­¡¼/¥Ç¡¼¥¿ÂФ¬¤Ê¤¤¾ì¹ç¤Ï +1 ¤òÊÖ¤¹¡£ +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤ò»È¤Ã¤Æ¤¤¤Æ¡¢ +¤«¤Ä¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤¬Ê¸»ú·¿¤Î¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ç¡¢ +´°À®¤·¤Æ¤¤¤ë¥­¡¼/¥Ç¡¼¥¿ÂФ¬Ìµ¤¤¾ì¹ç¤Ë¤Ï¡¢ +.I seq +¥ë¡¼¥Á¥ó¤Ï 2 ¤òÊÖ¤¹¡£ +.TP +.I sync +.\"O A pointer to a routine to flush any cached information to disk. +.\"O If the database is in memory only, the +.\"O .I sync +.\"O routine has no effect and will always succeed. +¥­¥ã¥Ã¥·¥å¤µ¤ì¤¿¾ðÊó¤ò¥Ç¥£¥¹¥¯¤ËÁݤ­½Ð¤¹¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¥á¥â¥ê¤ÎÃæ¤À¤±¤Ë¤¢¤ë¾ì¹ç¡¢ +.I sync +¥ë¡¼¥Á¥ó¤Ï²¿¤Î¸ú²Ì¤â¤Ê¤¯¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.IP +.\"O The flag value may be set to the following value: +flag ¤Ë¤Ï°Ê²¼¤ÎÃͤ¬¥»¥Ã¥È¤Ç¤­¤ë¡£ +.RS +.TP +.B R_RECNOSYNC +.\"O If the +.\"O .B DB_RECNO +.\"O access method is being used, this flag causes +.\"O the sync routine to apply to the btree file which underlies the +.\"O recno file, not the recno file itself. +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë +¤³¤Î¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢ +recno ¥Õ¥¡¥¤¥ë¤½¤Î¤â¤Î¤Ë¤Ç¤Ï¤Ê¤¯¡¢ +¤½¤Î¥Ù¡¼¥¹¤Ë¤Ê¤Ã¤Æ¤¤¤ë btree ¥Õ¥¡¥¤¥ë¤Ë sync ¤¬¹Ô¤ï¤ì¤ë¡£ +.\"O (See the +.\"O .I bfname +.\"O field of the +.\"O .BR recno (3) +.\"O manual page for more information.) +(¾ÜºÙ¤Ï +.BR recno (3) +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç +.I bfname +¥Õ¥£¡¼¥ë¥É¤òÀâÌÀ¤·¤Æ¤¤¤ëÉôʬ¤ò»²¾È¤Î¤³¤È¡£) +.RE +.IP +.I sync +.\"O routines return \-1 on error (setting +.\"O .IR errno ) +.\"O and 0 on success. +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +.\"O .SS "Key/Data Pairs" +.SS ¥­¡¼/¥Ç¡¼¥¿ÂÐ +.\"O Access to all file types is based on key/data pairs. +.\"O Both keys and data are represented by the following data structure: +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤Ë¤ª¤¤¤Æ¡¢ +¥­¡¼/¥Ç¡¼¥¿ÂФò¥Ù¡¼¥¹¤Ë¤·¤Æ¥¢¥¯¥»¥¹¤¬¹Ô¤ï¤ì¤ë¡£ +¥­¡¼¤È¥Ç¡¼¥¿¤Î¤¤¤º¤ì¤â¡¢¼¡¤Î¥Ç¡¼¥¿¹½Â¤¤Çµ­½Ò¤µ¤ì¤ë¡£ +.in +4n +.nf + +typedef struct { + void *data; + size_t size; +} DBT; +.fi +.in +.\"O The elements of the +.\"O .I DBT +.\"O structure are defined as follows: +.I DBT +¹½Â¤ÂΤγÆÍ×ÁǤϼ¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.I data +.\"O A pointer to a byte string. +¥Ð¥¤¥Èʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.TP +.I size +.\"O The length of the byte string. +¥Ð¥¤¥Èʸ»úÎó¤ÎŤµ¡£ +.PP +.\"O Key and data byte strings may reference strings of essentially unlimited +.\"O length although any two of them must fit into available memory at the same +.\"O time. +¥­¡¼¤È¥Ç¡¼¥¿¤Î¥Ð¥¤¥Èʸ»úÎó¤Ï¡¢ +´ðËÜŪ¤Ë¤Ï̵À©¸Â¤ÎŤµ¤Îʸ»úÎó¤ò»²¾È¤Ç¤­¤ë¤¬¡¢ +¤·¤«¤·¤¤¤º¤ì¤â»ÈÍѲÄǽ¤Ê¥á¥â¥ê¤Ë¼ý¤Þ¤Ã¤Æ¤¤¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.\"O It should be noted that the access methods provide no guarantees about +.\"O byte string alignment. +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ï¥Ð¥¤¥Èʸ»úÎó¤Î¥¢¥é¥¤¥ó¥á¥ó¥È¤Ë¤Ä¤¤¤Æ¤Ï +²¿¤âÊݾڤ·¤Æ¤¤¤Ê¤¤»ö¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH ¥¨¥é¡¼ +.\"O The +.\"O .BR dbopen () +.\"O routine may fail and set +.\"O .I errno +.\"O for any of the errors specified for the library routines +.\"O .BR open (2) +.\"O and +.\"O .BR malloc (3) +.\"O or the following: +.BR dbopen () +¥ë¡¼¥Á¥ó¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR open (2) +¤È +.BR malloc (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£¤¢¤ë¤¤¤Ï°Ê²¼¤ò¥»¥Ã¥È¤¹¤ë¡£ +.TP +.B [EFTYPE] +.\"O A file is incorrectly formatted. +¥Õ¥¡¥¤¥ë¤¬Àµ¤·¤¯¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B [EINVAL] +.\"O A parameter has been specified (hash function, pad byte etc.) that is +.\"O incompatible with the current file specification or which is not +.\"O meaningful for the function (for example, use of the cursor without +.\"O prior initialization) or there is a mismatch between the version +.\"O number of file and the software. +»ØÄꤷ¤¿¥Ñ¥é¥á¡¼¥¿(¥Ï¥Ã¥·¥å´Ø¿ô¡¢¥Ð¥¤¥ÈËä¤á¤Ê¤É)¤¬¸½ºß¤Î¥Õ¥¡¥¤¥ë»ÅÍÍ¤Ë +¹ç¤Ã¤Æ¤¤¤Ê¤¤¡¢¥Ñ¥é¥á¡¼¥¿¤¬´Ø¿ô¤Ë¤È¤Ã¤Æ̵°ÕÌ£ +(Î㤨¤Ð¤¢¤é¤«¤¸¤á½é´ü²½¤·¤Ê¤¤¤Ç¥«¡¼¥½¥ë¤ò»È¤¦¤È¤«)¡¢ +¥Õ¥¡¥¤¥ë¤È¥½¥Õ¥È¥¦¥§¥¢¤Î¥Ð¡¼¥¸¥ç¥ó¤¬¹ç¤Ã¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O The +.I close +.\"O routines may fail and set +¥ë¡¼¥Á¥ó¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.\"O .I errno +.\"O for any of the errors specified for the library routines +.BR close (2), +.BR read (2), +.BR write (2), +.BR free (3), +.\"O or +.BR fsync (2) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.\"O The +.IR del , +.IR get , +.I put +.\"O and +¤È +.I seq +.\"O routines may fail and set +¥ë¡¼¥Á¥ó¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.\"O .I errno +.\"O for any of the errors specified for the library routines +.BR read (2), +.BR write (2), +.BR free (3), +.\"O or +.BR malloc (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.\"O The +.\"O .I fd +.\"O routines will fail and set +.\"O .I errno +.\"O to +.\"O .B ENOENT +.\"O for in memory databases. +.I fd +¥ë¡¼¥Á¥ó¤Ï¥á¥â¥êÆâ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ·¼ºÇÔ¤¹¤ë¤È +.I errno +¤Ë +.B ENOENT +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.\"O The +.I sync +.\"O routines may fail and set +¥ë¡¼¥Á¥ó¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.\"O .I errno +.\"O for any of the errors specified for the library routine +.BR fsync (2) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥Ð¥° +.\"O The typedef +.\"O .I DBT +.\"O is a mnemonic for "data base thang", and was used +.\"O because no-one could think of a reasonable name that wasn't already used. +typedef +.I DBT +¤Ï ``data base thang''¤Îά¸ì¤Ç¤¢¤ë¤¬¡¢¤³¤ì¤¬»È¤ï¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢ +¤Þ¤À»È¤ï¤ì¤Æ¤¤¤Ê¤¤ÂÅÅö¤Ê̾Á°¤¬»×¤¤ÉÕ¤«¤Ê¤«¤Ã¤¿¤¿¤á¤Ç¤¢¤ë¡£ +.PP +.\"O The file descriptor interface is a kludge and will be deleted in a +.\"O future version of the interface. +¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤ò»È¤Ã¤¿¤ä¤ê¤È¤ê¤Ï¤Ò¤É¤¤Âåʪ¤Ç¤¢¤ê¡¢ +¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ïºï½ü¤µ¤ì¤ë¤À¤í¤¦¡£ +.PP +.\"O None of the access methods provide any form of concurrent access, +.\"O locking, or transactions. +¤É¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤â¡¢Æ±»þ¥¢¥¯¥»¥¹¡¢¥í¥Ã¥¯¡¢¥È¥é¥ó¥¶¥¯¥·¥ç¥ó +¤Î»ÅÁȤߤÏÈ÷¤¨¤Æ¤¤¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR btree (3), +.BR hash (3), +.BR mpool (3), +.BR recno (3) +.sp +.IR "LIBTP: Portable, Modular Transactions for UNIX" , +Margo Seltzer, Michael Olson, USENIX proceedings, Winter 1992. diff --git a/draft/man3/des_crypt.3 b/draft/man3/des_crypt.3 new file mode 100644 index 00000000..6c54b5b1 --- /dev/null +++ b/draft/man3/des_crypt.3 @@ -0,0 +1,237 @@ +.\" @(#)des_crypt.3 2.1 88/08/11 4.0 RPCSRC; from 1.16 88/03/02 SMI; +.\" +.\" Taken from libc4 sources, which say: +.\" Copyright (C) 1993 Eric Young - can be distributed under GPL. +.\" +.\" However, the above header line suggests that this file in fact is +.\" 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 +.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 ¤Î¾ì¹ç¤Ï +.\" .B #include +.B #include +.LP +.BI "int ecb_crypt(char *" key ", char *" data ", unsigned " datalen , +.BI " unsigned " mode ); +.LP +.BI "int cbc_crypt(char *" key ", char *" data ", unsigned " datalen , +.BI " unsigned " mode ", char *" ivec ); +.LP +.BI "void des_setparity(char *" key ); +.LP +.BI "int DES_FAILED(int " status ); +.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 +¤Ï¥Ö¥í¥Ã¥¯¤ÎÁÞÆþ¡¦ºï½ü¡¦ÃÖ¤­´¹¤¨¤«¤éÊݸ¤ë¡£ +¤Þ¤¿Ê¿Ê¸¤Îµ¬Â§À­¤¬°Å¹æʸ¤Ë¸½¤ì¤Ê¤¤¡£ +.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 +.\"O OR'ing +.\"O 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 +.SH ÊÖ¤êÃÍ +.PD 0 +.TP 20 +.\"O .BR DESERR_NONE +.B DESERR_NONE +.\"O No error. +¥¨¥é¡¼¤Ê¤·¡£ +.TP +.\"O .BR DESERR_NOHWDEVICE +.B DESERR_NOHWDEVICE +.\"O Encryption succeeded, but done in software instead of the requested hardware. +°Å¹æ²½¤ÏÀ®¸ù¤·¤¿¤¬¡¢Í׵ᤵ¤ì¤¿¥Ï¡¼¥É¥¦¥§¥¢¤ÎÂå¤ï¤ê¤Ë¥½¥Õ¥È¥¦¥§¥¢¤Ç¼Â¹Ô¤µ¤ì¤¿¡£ +.TP +.\"O .BR DESERR_HWERROR +.B DESERR_HWERROR +.\"O An error occurred in the hardware or driver. +¥Ï¡¼¥É¥¦¥§¥¢¤Þ¤¿¤Ï¥É¥é¥¤¥Ð¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.\"O .BR DESERR_BADPARAM +.B DESERR_BADPARAM +.\"O Bad argument to routine. +¥ë¡¼¥Á¥ó¤Ø¤Î°ú¤­¿ô¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR des (1), +.BR crypt (3), +.BR xcrypt (3) diff --git a/draft/man3/difftime.3 b/draft/man3/difftime.3 new file mode 100644 index 00000000..c2f68564 --- /dev/null +++ b/draft/man3/difftime.3 @@ -0,0 +1,104 @@ +.\" 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 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 +.\" +.\"WORD: epoch µª¸µ +.\" +.TH DIFFTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O difftime \- calculate time difference +difftime \- »þ¹ï¤Î´Ö³Ö¤Î·×»» +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double difftime(time_t " time1 ", time_t " time0 ); +.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)) ¤«¤é¤Î +·Ð²á»þ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.\"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 +¤Ï¿ôÃÍ·¿¤Ê¤Î¤Ç¡¢°ú¤­»»¤ÎºÝ¤Ëµ¯¤³¤ë²ÄǽÀ­¤Î¤¢¤ë¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ò +µ¤¤Ë¤·¤Ê¤¤¾ì¹ç¤Ï¡¢Ã±½ã¤Ë +.RS +.nf + +#define difftime(t1,t0) (double)(t1 \- t0) + +.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 +¤Ë²¿¤«Ê̤Υ¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤¬»È¤ï¤ì¤Æ¤¤¤ë¤³¤È¤¬¤¢¤ê¡¢ +¤½¤Î¾ì¹ç¤Ë¤ÏľÀÜ°ú¤­»»¤ò¹Ô¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR date (1), +.BR gettimeofday (2), +.BR time (2), +.BR ctime (3), +.BR gmtime (3), +.BR localtime (3) diff --git a/draft/man3/dirfd.3 b/draft/man3/dirfd.3 new file mode 100644 index 00000000..ea1b24cf --- /dev/null +++ b/draft/man3/dirfd.3 @@ -0,0 +1,143 @@ +.\" Copyright (C) 2002 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. +.\" +.\" +.\" 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 +.\" +.TH DIRFD 3 2008-08-21 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O dirfd \- get directory stream file descriptor +dirfd \- ¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¹¥È¥ê¡¼¥à¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int dirfd(DIR *" dirp ); +.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 dirfd (): +_BSD_SOURCE || _SVID_SOURCE +.\"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 +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.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) +¤¬¸Æ¤Ð¤ì¤¿¤È¤­¤Ë¼«Æ°Åª¤Ë¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, a nonnegative file descriptor is returned. +.\"O On error, \-1 is returned. +À®¸ù¤¹¤ë¤È¡¢Éé¤Ç¤Ê¤¤ÃͤΥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.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" +.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 +.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 +¤¬ÄêµÁ¤µ¤ì¤¿¤È¤­¤Î¤ß¤Ç¤¢¤ë¡£ +.\"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) diff --git a/draft/man3/div.3 b/draft/man3/div.3 new file mode 100644 index 00000000..d893d951 --- /dev/null +++ b/draft/man3/div.3 @@ -0,0 +1,140 @@ +.\" 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-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 2007-07-26 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "div_t div(int " numerator ", int " denominator ); +.br +.BI "ldiv_t ldiv(long " numerator ", long " denominator ); +.br +.BI "lldiv_t lldiv(long long " numerator ", long long " denominator ); +.sp +.B #include +.sp +.BI "imaxdiv_t imaxdiv(intmax_t " numerator ", intmax_t " denominator ); +.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 lldiv (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.\"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 towards zero. +¾¦¤Ï 0 ¤Ë¶á¤¤Êý¤Ë´Ý¤á¤é¤ì¤ë¡£ +.\"O The result satisfies \fIquot\fP*\fIdenominator\fP+\fIrem\fP = \fInumerator\fP. +·ë²Ì¤Ï \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 ¤Ï¡¢ +´Ø¿ô¤Î°ú¤­¿ô¤ÈƱ¤¸·¿¤Ç¤¢¤ë¡£ +.\"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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR abs (3), +.BR remainder (3) diff --git a/draft/man3/dl_iterate_phdr.3 b/draft/man3/dl_iterate_phdr.3 new file mode 100644 index 00000000..f6d35d9c --- /dev/null +++ b/draft/man3/dl_iterate_phdr.3 @@ -0,0 +1,309 @@ +.\" Copyright (c) 2003 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. +.\" 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 +.SH ̾Á° +.\"O dl_iterate_phdr \- walk through list of shared objects +dl_iterate_phdr \- ¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Î¥ê¥¹¥È¤òé¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +\fBint dl_iterate_phdr(\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 () +´Ø¿ô¤ò»È¤¦¤È¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¼Â¹Ô»þ¤Ë +¤É¤Î¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤ò¥í¡¼¥É¤·¤¿¤«¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"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 °Ê³°¤ÎÃͤòÊÖ¤¹¤Þ¤Ç¹Ô¤ï¤ì¤ë¡£ + +.\"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 °ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¤ëÃͤΥ³¥Ô¡¼¤Ç¤¢¤ë¡£ + +.\"O The +.\"O .I info +.\"O argument is a structure of the following type: +.I info +°ú¤­¿ô¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê·¿¤Î¹½Â¤ÂΤǤ¢¤ë¡£ + +.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 " ¤È " +¤Ë¤¢¤ë¡£ + +.\"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 ʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ê¡¢ +¤³¤Î¥Ñ¥¹Ì¾¤Î¥Õ¥¡¥¤¥ë¤«¤é¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤¬¥í¡¼¥É¤µ¤ì¤ë¡£ + +.\"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 +¤Ï¡¢¤³¤ÎÇÛÎó¤Î¥µ¥¤¥º¤òɽ¤¹¡£ + +.\"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 +¤Î²¾ÁÛ¥á¥â¥ê¤Ë¤ª¤±¤ë°ÌÃ֤ϡ¢°Ê²¼¤Î¼°¤Ç·×»»¤Ç¤­¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È: + +.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 +.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" +.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 +.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 ¥»¥°¥á¥ó¥È¤¬¥í¡¼¥É¤µ¤ì¤¿ +²¾ÁÛ¥¢¥É¥ì¥¹¤Î°ìÍ÷¤òɽ¼¨¤¹¤ë¡£ + +.nf +#define _GNU_SOURCE +#include +#include +#include + +static int +callback(struct dl_phdr_info *info, size_t size, void *data) +{ + int j; + + printf("name=%s (%d segments)\\n", info\->dlpi_name, + info\->dlpi_phnum); + + for (j = 0; j < info\->dlpi_phnum; j++) + printf("\\t\\t header %2d: address=%10p\\n", j, + (void *) (info\->dlpi_addr + info\->dlpi_phdr[j].p_vaddr)); + return 0; +} + +int +main(int argc, char *argv[]) +{ + dl_iterate_phdr(callback, NULL); + + 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 feature_test_macros (7), +.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" diff --git a/draft/man3/dlopen.3 b/draft/man3/dlopen.3 new file mode 100644 index 00000000..2ca1af9b --- /dev/null +++ b/draft/man3/dlopen.3 @@ -0,0 +1,885 @@ +.\" -*- nroff -*- +.\" Copyright 1995 Yggdrasil Computing, Incorporated. +.\" written by Adam J. Richter (adam@yggdrasil.com), +.\" with typesetting help from Daniel Quinlan (quinlan@yggdrasil.com). +.\" and Copyright 2003 Michael Kerrisk (mtk.manpages@gmail.com). +.\" +.\" 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. +.\" +.\" Modified by David A. Wheeler 2000-11-28. +.\" Applied patch by Terran Melconian, aeb, 2001-12-14. +.\" Modified by Hacksaw 2003-03-13. +.\" Modified by Matt Domsch, 2003-04-09: _init and _fini obsolete +.\" Modified by Michael Kerrisk 2003-05-16. +.\" 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 ưŪ¥é¥¤¥Ö¥é¥ê +.\" +.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 +.SH ̾Á° +dlclose, dlerror, dlopen, dlsym \- ưŪ¥ê¥ó¥¯¤ò¹Ô¤¦¥í¡¼¥À¤Ø¤Î +¥×¥í¥°¥é¥ß¥ó¥°¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "void *dlopen(const char *" filename ", int " flag ); +.sp +.B "char *dlerror(void);" +.sp +.BI "void *dlsym(void *" handle ", const char *" symbol ); +.sp +.BI "int dlclose(void *" handle ); +.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 () +¤Î¤¤¤º¤ì¤«¤ÇºÇ¸å¤ËȯÀ¸¤·¤¿¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀ¥á¥Ã¥»¡¼¥¸¤òÊÖ¤¹¡£ +½é´ü²½¸å¤Þ¤¿¤ÏÁ°²ó¸Æ¤Ó½Ð¤µ¤ì¤¿¸å¤Ç¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤¤¤Ê¤±¤ì¤Ð 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) +¤ò»²¾È): +.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 ¥¿¥°¤Ë½ñ¤«¤ì¤Æ¤¤¤ë +¥Ç¥£¥ì¥¯¥È¥ê¡¦¥ê¥¹¥È¤ò¸¡º÷¤¹¤ë¡£ +.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 ¤µ¤ì¤¿ +¥×¥í¥°¥é¥à¤Î¾ì¹ç¤Ï̵»ë¤µ¤ì¤ë)¡£ +.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) +¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤Æ¤¤¤ë)¡£ +.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 +¤ò¤³¤Î½çÈ֤Ǹ¡º÷¤¹¤ë¡£ +.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 () +¤ÏÉüµ¢¤¹¤ë¡£²ò·è¤Ç¤­¤Ê¤«¤Ã¤¿¤È¤­¤Ë¤Ï¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.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 °Ê¹ß)" +.\" 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 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.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 +¥Õ¥é¥°ÉÕ¤­¤Ç¥í¡¼¥É¤µ¤ì¤¿Á´¤Æ¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¡¢¤Î½ç½ø¤Ç¹Ô¤ï¤ì¤ë¡£ +.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" ¤âƱµÁ) +ÉÕ¤­¤Ç¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¼Â¹Ô¥Õ¥¡¥¤¥ëÃæ¤Î¥°¥í¡¼¥Ð¥ë¥·¥ó¥Ü¥ë¤â¡¢ +ưŪ¤Ë¥í¡¼¥É¤µ¤ì¤ë¥é¥¤¥Ö¥é¥êÆâ¤Î»²¾È²ò·è¤ËÍѤ¤¤é¤ì¤ë¡£ +.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 +¤Ç°ÊÁ°¤Ë¥í¡¼¥É¤µ¤ì¤¿¥é¥¤¥Ö¥é¥ê¤Î¥·¥ó¥Ü¥ë²ò·è¤¬¼Â¹Ô¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.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 ¤Ç¤¢¤ë¤«È½Äꤹ¤ë¡£ +.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 +¤Ï¡¢¥é¥¤¥Ö¥é¥ê¸¡º÷½ç½ø¤ÎÃæ¤Ç¸½ºß¤Î¥é¥¤¥Ö¥é¥ê°Ê¹ß¤ÇºÇ½é¤Ë +´Ø¿ô¤¬¸½¤ì¤ë¤È¤³¤í¤òõ¤¹¡£¤³¤Îµ¡Ç½¤ò»È¤¦¤³¤È¤Ç¡¢Ê̤ζ¦Í­¥é¥¤¥Ö¥é¥ê¤Î +´Ø¿ô¤Ø¤Î¥é¥Ã¥Ñ¡¼¤òÄ󶡤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.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 ¤Ë¤Ê¤ê¡¢¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë +¾¤Î¥é¥¤¥Ö¥é¥ê¤«¤é¤½¤Î¥é¥¤¥Ö¥é¥êÆâ¤Î¥·¥ó¥Ü¥ë¤¬»È¤ï¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +¤½¤ÎưŪ¥é¥¤¥Ö¥é¥ê¤ò¥¢¥ó¥í¡¼¥É¤¹¤ë¡£ +.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()" +.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 +¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ì¤Ð¤è¤¤¡£ +.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)); +.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¤ÄÄɲ䵤ì¤Æ¤¤¤ë¡£ +¥×¥í¥È¥¿¥¤¥×¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.sp +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int dladdr(void *" addr ", Dl_info *" info ); +.sp +.BI "void *dlvsym(void *" handle ", char *" symbol ", char *" version ); +.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 +¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ë¡£ +.sp +.in +4n +.nf +typedef struct { + const char *dli_fname; /* Pathname of shared object that + contains address */ + void *dli_fbase; /* Address at which shared object + is loaded */ + const char *dli_sname; /* Name of nearest symbol with address + lower than \fIaddr\fP */ + void *dli_saddr; /* Exact address of symbol named + in \fIdli_sname\fP */ +} Dl_info; +.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 ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O .BR dladdr () +.\"O returns 0 on error, and nonzero on success. +.BR dladdr () +¤Ï¡¢¥¨¥é¡¼»þ¤Ë¤Ï 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" +.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 (). +¤Îµ­ºÜ¤¬¤¢¤ë¡£ +.\"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 +.\" .BR dlerror () +.\" ¤¬ÊÖ¤¹Ê¸»úÎó¤ÏÊѹ¹¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢ +.\" °Ê²¼¤Î¤è¤¦¤Ê¥×¥í¥È¥¿¥¤¥×¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" .sp +.\" .in +5 +.\" .B "const char *dlerror(void);" +.\" .in + +.\"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 +.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 () +¤Ï¤Ê¤«¤Ã¤¿¡£ +.\"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 () +¤ò¸Æ¤Ó½Ð¤·¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ò»²¾È¤·¤¿¾õÂ֤ǽª¤ï¤Ã¤Æ¤¤¤ë¤³¤È¤¬¤¢¤ë¡£ +.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) ¤«¤éºÇ½ªÅª¤Ê¥·¥ó¥Ü¥ë¤Î¥¢¥É¥ì¥¹¤ò¥í¡¼¥É¤¹¤ë¤À¤±¤Î +¥³¡¼¥É¤¬À¸À®¤µ¤ì¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O Load the math library, and print the cosine of 2.0: +math ¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤·¡¢2.0 ¤Î;¸¹¤òɽ¼¨¤¹¤ë +.nf + +#include +#include +#include + +int +main(int argc, char **argv) +{ + void *handle; + double (*cosine)(double); + char *error; + + handle = dlopen("libm.so", RTLD_LAZY); + if (!handle) { + fprintf(stderr, "%s\en", dlerror()); + exit(EXIT_FAILURE); + } + + dlerror(); /* Clear any existing error */ + + /* Writing: cosine = (double (*)(double)) dlsym(handle, "cos"); + would seem more natural, but the C99 standard leaves + casting from "void *" to a function pointer undefined. + The assignment used below is the POSIX.1\-2003 (Technical + 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. + + if ((error = dlerror()) != NULL) { + fprintf(stderr, "%s\en", error); + exit(EXIT_FAILURE); + } + + printf("%f\en", (*cosine)(2.0)); + dlclose(handle); + exit(EXIT_SUCCESS); +} +.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" ¤Ë½ñ¤¤¤¿¤È¤¹¤ë¤È¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤Ç¥×¥í¥°¥é¥à¤ò +¥Ó¥ë¥É¤Ç¤­¤ë¡£ +.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 ¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¾ì¹ç: +.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 feature_test_macros (7), +.BR rtld-audit (7), +.BR ld.so (8), +.BR ldconfig (8), +ld.so info pages, gcc info pages, ld info pages diff --git a/draft/man3/dprintf.3 b/draft/man3/dprintf.3 new file mode 100644 index 00000000..cc61a593 --- /dev/null +++ b/draft/man3/dprintf.3 @@ -0,0 +1,130 @@ +.\" 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. +.\" +.\" Text fragments inspired by Martin Schulze . +.\" +.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. +.\" Translated Sat 12 Jan 2002 by NAKANO Takeo +.\" +.TH DPRINTF 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O dprintf, vdprintf \- print to a file descriptor +dprintf, vdprintf \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ëʸ»ú½ÐÎϤ¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int dprintf(int " fd ", const char *" format ", ...);" +.sp +.BI "int vdprintf(int " fd ", const char *" format ", va_list " ap ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The functions +.\"O .BR dprintf () +.\"O and +.\"O .BR vdprintf () +.\"O (as found in the glibc2 library) are exact analogs of +.\"O .BR fprintf (3) +.\"O and +.\"O .BR vfprintf (3), +.\"O except that they output to a file descriptor +.\"O .I fd +.\"O instead of to a +.\"O .I stdio +.\"O stream. +(glibc2 ¥é¥¤¥Ö¥é¥ê¤Ë¤ª¤±¤ë) +.BR dprintf () +´Ø¿ô¤È +.BR vdprintf () +´Ø¿ô¤È¤Ï¡¢¤½¤ì¤¾¤ì +.BR fprintf (3) +´Ø¿ô¤È +.BR vfprintf (3) +´Ø¿ô¤È¤Ë¤Á¤ç¤¦¤ÉÂбþ¤¹¤ë¤¬¡¢ +¤³¤ì¤é¤Ï +.I stdio +¥¹¥È¥ê¡¼¥à¤Ç¤Ï¤Ê¤¯¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.I fd +¤ËÂФ·¤Æ½ÐÎϤò¹Ô¤¦¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These functions are GNU extensions that are nowadays specified in +.\"O POSIX.1-2008 +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ê¡¢ +¸½ºß¤Ç¤Ï POSIX.1-2008 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.\"O .\" .SH NOTES +.\" .SH Ãí°Õ +.\"O .\" These functions are GNU extensions, not in C or POSIX. +.\"O .\" Clearly, the names were badly chosen. +.\"O .\" Many systems (like MacOS) have incompatible functions called +.\"O .\" .BR dprintf (), +.\"O .\" usually some debugging version of +.\"O .\" .BR printf (3), +.\"O .\" perhaps with a prototype like +.\"O .\" +.\"O .\" .BI "void dprintf(int level, const char *" format ", ...);" +.\"O .\" +.\"O .\" where the first parameter is a debugging level (and output is to +.\"O .\" .IR stderr ). +.\" ¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢C ¤ä POSIX ¤Î¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +.\" ¸«¤Æ¤ï¤«¤ë¤È¤ª¤ê¡¢Ì¾Á°¤ÎÉÕ¤±Êý¤Ï¤¢¤Þ¤êÎɤ¯¤Ê¤¤¡£ +.\" ¿¤¯¤Î¥·¥¹¥Æ¥à (MacOS ¤Ê¤É) ¤Ë¤Ï¡¢ +.\" .BR dprintf () +.\" ¤È¤¤¤¦Ì¾Á°¤Î¡¢¤³¤ì¤È¤Ï¸ß´¹¤Ç¤Ê¤¤´Ø¿ô¤¬¤¢¤ê¡¢ +.\" ¤¿¤¤¤Æ¤¤¤Ï¤Ê¤ó¤é¤«¤Î¥Ç¥Ð¥Ã¥°ÍѤΠ+.\" .BR printf (3) +.\" ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£¥×¥í¥È¥¿¥¤¥×¤Ï +.\" +.\" .BI "void dprintf(int level, const char *" format ", ...);" +.\" +.\" ¤Ç¡¢ºÇ½é¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¥Ç¥Ð¥Ã¥°¥ì¥Ù¥ë¤Ë¤Ê¤Ã¤Æ¤¤¤ë +.\" (¤Þ¤¿½ÐÎÏ¤Ï +.\" .I stderr +.\" ¤Ë¹Ô¤ï¤ì¤ë)¡£ +.\"O .\" Moreover, +.\"O .\" .BR dprintf () +.\"O .\" (or +.\"O .\" .BR DPRINTF ) +.\"O .\" is also a popular macro name for a debugging printf. +.\"O .\" So, probably, it is better to avoid this function in programs +.\"O .\" intended to be portable. +.\"O .\" +.\"O .\" A better name would have been +.\"O .\" .BR fdprintf (). +.\" ¤µ¤é¤Ë¡¢ +.\" .BR dprintf () +.\" (¤¢¤ë¤¤¤Ï +.\" .BR DPRINTF ) +.\" ¤Ï¥Ç¥Ð¥Ã¥°½èÍýÍѤΠprintf ¤Î¥Þ¥¯¥í¤È¤·¤Æ¤âÎɤ¯ÍѤ¤¤é¤ì¤ë¡£ +.\" ¤·¤¿¤¬¤Ã¤Æ¶²¤é¤¯¡¢°Ü¿¢À­¤òɬÍפȤ¹¤ë¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +.\" ¤³¤Î´Ø¿ô¤ÏÍѤ¤¤Ê¤¤¤Û¤¦¤¬Îɤ¤¤À¤í¤¦¡£ +.\" +.\" ¤è¤êÎɤ¤Ì¾Á°¤Ï +.\" .BR fdprintf () +.\" ¤À¤Ã¤¿¤«¤È»×¤ï¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR printf (3), +.BR feature_test_macros (7) diff --git a/draft/man3/drand48.3 b/draft/man3/drand48.3 new file mode 100644 index 00000000..2fbe0268 --- /dev/null +++ b/draft/man3/drand48.3 @@ -0,0 +1,332 @@ +.\" 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 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 +.\" +.\" WORD: internal buffer ÆâÉô¥Ð¥Ã¥Õ¥¡ +.\" +.TH DRAND48 3 2007-07-26 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.B double drand48(void); +.sp +.BI "double erand48(unsigned short " xsubi [3]); +.sp +.B long int lrand48(void); +.sp +.BI "long int nrand48(unsigned short " xsubi [3]); +.sp +.B long int mrand48(void); +.sp +.BI "long int jrand48(unsigned short " xsubi [3]); +.sp +.BI "void srand48(long int " seedval ); +.sp +.BI "unsigned short *seed48(unsigned short " seed16v [3]); +.sp +.BI "void lcong48(unsigned short " param [7]); +.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 +.\"O All functions shown above: +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô: +.\" .BR drand48 (), +.\" .BR erand48 (), +.\" .BR lrand48 (), +.\" .BR nrand48 (), +.\" .BR mrand48 (), +.\" .BR jrand48 (), +.\" .BR srand48 (), +.\" .BR seed48 (), +.\" .BR lcong48 (): +_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¥Ó¥Ã¥ÈÀ°¿ô±é»»¤òÍѤ¤¤Æ +µ¿»÷Íð¿ô¤òÀ¸À®¤¹¤ë¡£ +.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) ¤Ç +°ìÍÍʬÉÛ¤¹¤ëÈóÉé¤ÎÇÜÀºÅÙÉâÆ°¾®¿ôÅÀ¼Â¿ôÃͤòÊÖ¤¹¡£ +.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 ¤Î´Ö¤Ç°ìÍÍʬÉÛ¤¹¤ë +ÈóÉé¤Î¥í¥ó¥°À°¿ô¤òÊÖ¤¹¡£ +.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 ¤Î´Ö¤Ç°ìÍÍʬÉÛ¤¹¤ëÉä¹æÉÕ¤­¥í¥ó¥°À°¿ô¤òÊÖ¤¹¡£ +.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 () +¤Ï½é¤á¤Ë +½é´ü²½´Ø¿ô¤ò¸Æ¤Ö¤³¤È¤òɬÍפȤ·¤Ê¤¤¡£ +.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) ¤òÀ¸À®¤¹¤ë¤³¤È¤Ç +µ¡Ç½¤·¤Æ¤¤¤ë¡£À¸À®ÊýË¡¤Ï°Ê²¼¤ÎÀþ·Á¹çƱ¤Î¼°¤Ë¤è¤ë¡£ +.sp +.nf +.RS +.B Xn+1 = (aXn + c) mod m, +.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 () +¤¬¸Æ¤Ð¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢\fIa\fP ¤È \fIc\fP ¤Ï°Ê²¼¤Î¼°¤ÇÍ¿¤¨¤é¤ì¤ë¡£ +.sp +.nf +.RS +.B a = 0x5DEECE66D +.B c = 0xB +.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 ¤Î¾å°Ì¥Ó¥Ã¥È¤«¤é¥³¥Ô¡¼¤µ¤ì¤ë¡£ +ºÇ¸å¤Ë¡¢¤³¤ÎÃͤòÊÖ¤êÃͤËÊÑ´¹¤¹¤ë¡£ +.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 ¤Î½é´üÃͤòÇÛÎó¤Ë +ÂåÆþ¤¹¤ë¤³¤È¤Ç½é´ü²½¤µ¤ì¤ë¡£ +.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 ¤ËÀßÄꤹ¤ë¡£ +²¼°Ì¤Î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 () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë¡£ +.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 ¤Î +ɸ½àÃͤ¬ºÆ¤ÓÀßÄꤵ¤ì¤ë¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O .SH NOTES +.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" +.SH ´ØÏ¢¹àÌÜ +.BR rand (3), +.BR random (3) diff --git a/draft/man3/drand48_r.3 b/draft/man3/drand48_r.3 new file mode 100644 index 00000000..9009a0e9 --- /dev/null +++ b/draft/man3/drand48_r.3 @@ -0,0 +1,132 @@ +.\" Copyright 2003 Walter Harms, 2004 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. +.\" +.\" 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 +.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 +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int drand48_r(struct drand48_data *" buffer ", double *" result ); +.sp +.BI "int erand48_r(unsigned short " xsubi [3] "," +.br +.BI " struct drand48_data *"buffer ", double *" result ");" +.sp +.BI "int lrand48_r(struct drand48_data *" buffer ", long int *" result ); +.sp +.BI "int nrand48_r(unsigned short int " xsubi[3] "," +.br +.BI " struct drand48_data *"buffer ", long int *" result ");" +.sp +.BI "int mrand48_r(struct drand48_data *" buffer ",long int *" result ");" +.sp +.BI "int jrand48_r(unsigned short int " xsubi[3] "," +.br +.BI " struct drand48_data *" buffer ", long int *" result ");" +.sp +.BI "int srand48_r(long int " seedval ", struct drand48_data *" buffer ");" +.sp +.BI "int seed48_r(unsigned short int " seed16v[3] "," +.br +.BI " struct drand48_data *" buffer ");" +.sp +.BI "int lcong48_r(unsigned short int " param[7] "," +.br +.BI " struct drand48_data *" buffer ");" +.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 +.\"O All functions shown above: +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô: +.\" .BR drand48_r (), +.\" .BR erand48_r (), +.\" .BR lrand48_r (), +.\" .BR nrand48_r (), +.\" .BR mrand48_r (), +.\" .BR jrand48_r (), +.\" .BR srand48_r (), +.\" .BR seed48_r (), +.\" .BR lcong48_r (): +_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 +¤ò»È¤¦¡£ + +.\"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" +.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) diff --git a/draft/man3/dysize.3 b/draft/man3/dysize.3 new file mode 100644 index 00000000..bdd1fd56 --- /dev/null +++ b/draft/man3/dysize.3 @@ -0,0 +1,80 @@ +.\" Copyright 2001 Walter Harms (walter.harms@informatik.uni-oldenburg.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. +.\" +.\" aeb: some corrections +.\" +.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. +.\" Translated Sun 6 Jan 2002 by NAKANO Takeo +.\" +.TH DYSIZE 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O dysize \- get number of days for a given year +.SH ̾Á° +dysize \- Í¿¤¨¤¿Ç¯¤ÎÆü¿ô¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B "#include " +.sp +.BI "int dysize(int " year ); +.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 dysize (): +_BSD_SOURCE || _SVID_SOURCE +.\"O .SH DESCRIPTION +.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 ¤òÊÖ¤¹¡£ +¤¦¤ë¤¦Ç¯¤Î·×»»¤Ï¼¡¤Î¼°¤Ë¤è¤ë: +.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" +.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. +¤³¤ì¤Ï¸ß´¹ÍѤδؿô¤Ë²á¤®¤Ê¤¤¡£¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï»È¤ï¤Ê¤¤¤³¤È¡£ +¤³¤Î´Ø¿ô¤Î SCO ÈÇ¤Ë¤Ï 2000 ǯÌäÂ꤬´Þ¤Þ¤ì¤Æ¤¤¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strftime (3) diff --git a/draft/man3/ecvt.3 b/draft/man3/ecvt.3 new file mode 100644 index 00000000..4c23dbd3 --- /dev/null +++ b/draft/man3/ecvt.3 @@ -0,0 +1,182 @@ +.\" 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 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 2009-03-15 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ecvt, fcvt \- convert a floating-point number to a string +ecvt, fcvt \- ÉâÆ°¾®¿ôÅÀ¿ô¤Îʸ»úÎó¤Ø¤ÎÊÑ´¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "char *ecvt(double " number ", int " ndigits ", int *" decpt , +.BI "int *" sign ); +.sp +.BI "char *fcvt(double " number ", int " ndigits ", int *" decpt , +.BI "int *" sign ); +.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 ecvt (), +.BR fcvt (): +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"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 ¤«¤Ï̤µ¬Äê¤Ç¤¢¤ë¡£ +.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" +.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" +.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) +¤¬¤è¤êŬÀÚ¤«¤â¤·¤ì¤Ê¤¤)¡£ +.\"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"). +¾®¿ôÅÀ¤Ë¥Ô¥ê¥ª¥É¤ò»È¤ï¤Ê¤¤¥í¥±¡¼¥ë¤â¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ecvt_r (3), +.BR gcvt (3), +.BR qecvt (3), +.BR setlocale (3), +.BR sprintf (3) diff --git a/draft/man3/ecvt_r.3 b/draft/man3/ecvt_r.3 new file mode 100644 index 00000000..b2ba3aa9 --- /dev/null +++ b/draft/man3/ecvt_r.3 @@ -0,0 +1,136 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.\" +.\" 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 Çѻߤµ¤ì¤¿ +.\" +.TH ECVT_R 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "int ecvt_r(double " number ", int " ndigits ", int *" decpt , +.BI " int *" sign ", char *" buf ", size_t " len ); +.sp +.BI "int fcvt_r(double " number ", int " ndigits ", int *" decpt , +.BI " int *" sign ", char *" buf ", size_t " len ); +.sp +.BI "int qecvt_r(long double " number ", int " ndigits ", int *" decpt , +.BI " int *" sign ", char *" buf ", size_t " len ); +.sp +.BI "int qfcvt_r(long double " number ", int " ndigits ", int *" decpt , +.BI " int *" sign ", char *" buf ", size_t " len ); +.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 ecvt_r (), +.BR fcvt_r (), +.BR qecvt_r (), +.BR qfcvt_r (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR ecvt (3), +.BR qecvt (3), +.BR sprintf (3) diff --git a/draft/man3/encrypt.3 b/draft/man3/encrypt.3 new file mode 100644 index 00000000..3421bdc5 --- /dev/null +++ b/draft/man3/encrypt.3 @@ -0,0 +1,239 @@ +.\" Copyright 2000 Nicolas Lichtmaier +.\" Created 2000-07-22 00:52-0300 +.\" +.\" 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. +.\" +.\" Modified 2002-07-23 19:21:35 CEST 2002 Walter Harms +.\" +.\" +.\" 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 Éü¹æ²½ +.\" +.TH ENCRYPT 3 2003-04-04 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O encrypt, setkey, encrypt_r, setkey_r \- encrypt 64-bit messages +encrypt, setkey, encrypt_r, setkey_r \- 64 ¥Ó¥Ã¥È¤Î¥á¥Ã¥»¡¼¥¸¤ò°Å¹æ²½¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "void encrypt(char " block "[64], int " edflag ); +.sp +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "void setkey(const char *" key ); +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "void setkey_r(const char *" key ", struct crypt_data *" data ); +.br +.BI "void encrypt_r(char *" block ", int " edflag \ +", struct crypt_data *" data ); +.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 ¥Ó¥Ã¥È¤Ë¤Ê¤ë¡£ +.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 +¤Ï¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿¼ÂºÝ¤ÎÃͤòɽ¸½¤¹¤ë¥Ó¥Ã¥È¤ÎÇÛÎó¤Ç¤¢¤ë¡£ +·ë²Ì¤Ï¤³¤ÎƱ¤¸ÇÛÎó¤ò»È¤Ã¤ÆÊÖ¤µ¤ì¤ë¡£ +.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 () +¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï°Å¹æ¸°¥Ç¡¼¥¿¤òÊÝ»ý¤¹¤ë¤¿¤á¤Ë°Ê²¼¤Î¤è¤¦¤Ê¹½Â¤ÂΤò»È¤¦¡£ +.in +4n +.nf + +struct crypt_data { + char keysched[16 * 8]; + char sb0[32768]; + char sb1[32768]; + char sb2[32768]; + char sb3[32768]; + char crypt_3_buf[14]; + char current_salt[2]; + long int current_saltbits; + int direction; + int initialized; +}; +.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" +.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" +.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 +.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[] +¤ËÍ­¸ú¤Ê¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.sp +.nf +#define _XOPEN_SOURCE +#include +#include + +int +main(void) +{ + char key[64]; /* bit pattern for key */ + char txt[64]; /* bit pattern for messages */ + + setkey(key); + encrypt(txt, 0); /* encode */ + encrypt(txt, 1); /* decode */ +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cbc_crypt (3), +.BR crypt (3), +.BR ecb_crypt (3), +.\" .BR fcrypt (3), +.BR feature_test_macros (7) diff --git a/draft/man3/end.3 b/draft/man3/end.3 new file mode 100644 index 00000000..4c1fa57d --- /dev/null +++ b/draft/man3/end.3 @@ -0,0 +1,153 @@ +.\" Copyright (c) 2008, Linux Foundation, written by 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. +.\" 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 +.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" ; +.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 +.I edata +.\"O This is the first address past the end of the +.\"O initialized data segment. +½é´ü²½¤µ¤ì¤¿¥Ç¡¼¥¿¤Î¥»¥°¥á¥ó¥È¤ÎËöÈø¤Î¼¡¤Î¥¢¥É¥ì¥¹¡£ +.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 +.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 +.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 ¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤Ç¤âÄêµÁ¤µ¤ì¤ë¡£ + +.\"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 +.SH Îã +.\"O When run, the program below produces output such as the following: +²¼µ­¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤È¡¢¼¡¤Î¤è¤¦¤Ê½ÐÎϤ¬ÆÀ¤é¤ì¤ë¡£ +.in +4n +.nf + +.RB "$" " ./a.out" +First address past: + program text (etext) 0x8048568 + initialized data (edata) 0x804a01c + uninitialized data (end) 0x804a024 +.fi +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.in +.nf +#include +#include + +extern char etext, edata, end; /* The symbols must have some type, + or "gcc -Wall" complains */ + +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); + + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR objdump (1), +.BR readelf (1), +.BR sbrk (2), +.BR elf (5) diff --git a/draft/man3/envz_add.3 b/draft/man3/envz_add.3 new file mode 100644 index 00000000..34962aa2 --- /dev/null +++ b/draft/man3/envz_add.3 @@ -0,0 +1,223 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" based on the description in glibc source and infopages +.\" +.\" Corrections and additions, aeb +.\" +.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI, all rights reserved. +.\" Translated Mon Feb 2 2003 by Akihiro MOTOKI +.\" +.TH ENVZ_ADD 3 2007-05-18 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O envz_add, envz_entry, envz_get, envz_merge, +.\"O envz_remove, envz_strip \- environment string support +envz_add, envz_entry, envz_get, envz_merge, +envz_remove, envz_strip \- ´Ä¶­ÊÑ¿ôʸ»úÎó¤ÎÁàºî +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B "#include " + +.BI "error_t envz_add(char **" envz ", size_t *" envz_len , +.ti 20n +.BI "const char *" name ", const char *" value ); + +.BI "char *envz_entry(const char *" envz ", size_t *" envz_len \ +", const char *" name ); + +.BI "char *envz_get(const char *" envz ", size_t *" envz_len \ +", const char *" name ); + +.BI "error_t envz_merge(char **" envz ", size_t *" envz_len , +.ti 20n +.BI "const char *" envz2 ", size_t " envz2_len ", int " override ); + +.BI "void envz_remove(char **" envz ", size_t *" envz_len \ +", const char *" name ); + +.BI "void envz_strip(char **" envz ", size_t *" envz_len ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These functions are glibc-specific. +¤³¤ì¤é¤Î´Ø¿ô glibc ¸ÇÍ­¤Ç¤¢¤ë¡£ +.LP +.\"O An argz vector is a pointer to a character buffer together with a length, +.\"O see +.\"O .BR argz_add (3). +.\"O An envz vector is a special argz vector, namely one where the strings +.\"O have the form "name=value". +.\"O Everything after the first \(aq=\(aq is considered +.\"O to be the value. +.\"O If there is no \(aq=\(aq, the value is taken to be NULL. +.\"O (While the value in case of a trailing \(aq=\(aq is the empty string "".) +argz vector ¤ÏŤµ¾ðÊóÉÕ¤­¤Îʸ»ú¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.BR argz_add (3) +¤ò»²¾È¤Î¤³¤È¡£ +envz vector ¤Ï¡¢Ê¸»úÎó¤¬ "name=value (̾Á°=ÃÍ)" ¤Î·Á¼°¤Ë¤Ê¤Ã¤Æ¤¤¤ëÆÃÊÌ¤Ê +argz vector ¤Ç¤¢¤ë¡£ +ºÇ½é¤Î \(aq=\(aq °Ê¹ß¤Ï¤¹¤Ù¤ÆÃͤȤߤʤµ¤ì¤ë¡£\(aq=\(aq ¤¬¤Ê¤±¤ì¤Ð¡¢ +ÃÍ¤Ï NULL ¤È²ò¼á¤µ¤ì¤ë¡£(ʸ»úÎó¤Î°ìÈֺǸå¤Îʸ»ú¤¬ \(aq=\(aq ¤Î¾ì¹ç¡¢Ãͤ϶õʸ»úÎó +"" ¤È²ò¼á¤µ¤ì¤ë¡£) +.LP +.\"O These functions are for handling envz vectors. +¤³¤ì¤é¤Î´Ø¿ô¤Ï envz vector ¤òÁàºî¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.LP +.\"O .BR envz_add () +.\"O adds the string +.\"O .RI \&" name = value \&" +.\"O (in case +.\"O .I value +.\"O is non-NULL) or +.\"O .RI \&" name \&" +.\"O (in case +.\"O .I value +.\"O is NULL) to the envz vector +.\"O .RI ( *envz ,\ *envz_len ) +.\"O and updates +.\"O .I *envz +.\"O and +.\"O .IR *envz_len . +.\"O If an entry with the same +.\"O .I name +.\"O existed, it is removed. +.BR envz_add () +¤Ï¡¢Ê¸»úÎó +.RI \&" name = value \&" +.RI ( value +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç) ¤Þ¤¿¤Ï +.RI \&" name \&" +.RI ( value +¤¬ NULL ¤Î¾ì¹ç) ¤ò +envz vector +.RI ( *envz ,\ *envz_len ) +¤ËÄɲä·¡¢ +.I *envz +¤È +.I *envz_len +¤ò¹¹¿·¤¹¤ë¡£ +.I name +¤ÈƱ¤¸Ì¾Á°¤ò»ý¤Ä¥¨¥ó¥È¥ê¤¬¤¢¤Ã¤¿¾ì¹ç¡¢¸µ¤Î¥¨¥ó¥È¥ê¤Ïºï½ü¤µ¤ì¤ë¡£ +.LP +.\"O .BR envz_entry () +.\"O looks for +.\"O .I name +.\"O in the envz vector +.\"O .RI ( envz ,\ envz_len ) +.\"O and returns the entry if found, or NULL if not. +.BR envz_entry () +¤Ï¡¢envz vector +.RI ( envz ,\ envz_len ) +¤«¤é̾Á°¤¬ +.I name +¤Î¥¨¥ó¥È¥ê¤ò¸¡º÷¤¹¤ë¡£ +¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ï¤½¤Î¥¨¥ó¥È¥ê¤òÊÖ¤·¡¢¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.LP +.\"O .BR envz_get () +.\"O looks for +.\"O .I name +.\"O in the envz vector +.\"O .RI ( envz ,\ envz_len ) +.\"O and returns the value if found, or NULL if not. +.\"O (Note that the value can also be NULL, namely when there is +.\"O an entry for +.\"O .I name +.\"O without \(aq=\(aq sign.) +.BR envz_get () +¤Ï¡¢envz vector +.RI ( envz ,\ envz_len ) +¤«¤é̾Á°¤¬ +.I name +¤Î¥¨¥ó¥È¥ê¤ò¸¡º÷¤¹¤ë¡£ +¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ï¥¨¥ó¥È¥ê¤ÎÃͤòÊÖ¤·¡¢¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +(ÃÍ¤Ï NULL ¤Î¾ì¹ç¤â¤¢¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£Ì¾Á°¤¬ +.I name +¤Î¥¨¥ó¥È¥ê¤Ë \(aq=\(aq Éä¹æ¤¬¤Ê¤¤¾ì¹ç¤¬³ºÅö¤¹¤ë¡£) +.LP +.\"O .BR envz_merge () +.\"O adds each entry in +.\"O .I envz2 +.\"O to +.\"O .IR *envz , +.\"O as if with +.\"O .BR envz_add (). +.\"O If +.\"O .I override +.\"O is true, then values in +.\"O .I envz2 +.\"O will supersede those with the same name in +.\"O .IR *envz , +.\"O otherwise not. +.BR envz_merge () +¤Ï¡¢ +.BR envz_add () +¤ÈƱ¤¸¤è¤¦¤Ë +.I envz2 +¤Î³Æ¥¨¥ó¥È¥ê¤ò +.I *envz +¤ËÄɲ乤롣 +.I override +¤¬¿¿¤Î¾ì¹ç¡¢ +.I envz2 +¤ÎÃÍ¤Ç +.I *envz +Æâ¤ÎƱ¤¸Ì¾Á°¤ò¤â¤ÄÃͤϾå½ñ¤­¤µ¤ì¤ë¡£ +µ¶¤Î¾ì¹ç¤Ï¾å½ñ¤­¤µ¤ì¤Ê¤¤¡£ +.LP +.\"O .BR envz_remove () +.\"O removes the entry for +.\"O .I name +.\"O from +.\"O .RI ( *envz ,\ *envz_len ) +.\"O if there was one. +.BR envz_remove () +¤Ï¡¢Ì¾Á°¤¬ +.I name +¤Î¥¨¥ó¥È¥ê¤¬¤¢¤ì¤Ð +.RI ( *envz ,\ *envz_len ) +¤«¤éºï½ü¤¹¤ë¡£ +.LP +.\"O .BR envz_strip () +.\"O removes all entries with value NULL. +.BR envz_strip () +¤Ï¡¢Ãͤ¬ NULL ¤Î¥¨¥ó¥È¥ê¤ò¤¹¤Ù¤Æºï½ü¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O All envz functions that do memory allocation have a return type of +.\"O \fIerror_t\fP, and return 0 for success, and \fBENOMEM\fP +.\"O if an allocation error occurs. +¥á¥â¥ê³ä¤êÅö¤Æ¤ò¹Ô¤¦ envz ´Ø¿ô·²¤Ï¤¹¤Ù¤Æ \fIerror_t\fP ·¿¤ÎÊÖ¤êÃͤò»ý¤Ä¡£ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤·¡¢³ä¤êÅö¤Æ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï +\fBENOMEM\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These functions are a GNU extension. +.\"O Handle with care. +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£Ãí°Õ¤·¤Æ»ÈÍѤ¹¤ë¤³¤È¡£ +.\"O .SH EXAMPLE +.SH Îã +.nf +#include +#include +#include + +int +main(int argc, char *argv[], char *envp[]) +{ + int i, e_len = 0; + char *str; + + for (i = 0; envp[i] != NULL; i++) + e_len += strlen(envp[i]) + 1; + + str = envz_entry(*envp, e_len, "HOME"); + printf("%s\en", str); + str = envz_get(*envp, e_len, "HOME"); + printf("%s\en", str); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR argz_add (3) diff --git a/draft/man3/erf.3 b/draft/man3/erf.3 new file mode 100644 index 00000000..d3a6a0c1 --- /dev/null +++ b/draft/man3/erf.3 @@ -0,0 +1,173 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 ÈóÀµµ¬²½¤Î +.\" +.TH ERF 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O erf, erff, erfl, \- error function +erf, erff, erfl \- ¸íº¹´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "double erf(double " x ); +.BI "float erff(float " x ); +.BI "long double erfl(long double " x ); + +.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) +»²¾È): +.in +.sp +.ad l +.BR erf (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR erff (), +.BR erfl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600|| _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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 + 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] ¤ÎÈϰϤȤʤ롣 + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ 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 (negative infinity), +.\"O +1 (\-1) is returned. +.I x +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Î¾ì¹ç¡¢+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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Range error: result underflow (\fIx\fP is subnormal) +ÈÏ°Ï¥¨¥é¡¼ (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 ) +¤¬¾å¤¬¤ë¡£ +.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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR cerf (3), +.BR erfc (3), +.BR exp (3) diff --git a/draft/man3/erfc.3 b/draft/man3/erfc.3 new file mode 100644 index 00000000..c54d5da1 --- /dev/null +++ b/draft/man3/erfc.3 @@ -0,0 +1,185 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-09-15, Akihiro MOTOKI +.\" +.\"WORD: subnormal ÈóÀµµ¬²½¤Î +.\" +.TH ERFC 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O erfc, erfcf, erfcl \- complementary error function +erfc, erfcf, erfcl \- ÁêÊä¸íº¹´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "double erfc(double " x ); +.BI "float erfcf(float " x ); +.BI "long double erfcl(long double " x ); + +.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) +»²¾È): +.in +.sp +.ad l +.BR erfc (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR erfcf (), +.BR erfcl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600|| _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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 +.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] ¤ÎÈϰϤȤʤ롣 + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is +0 or \-0, 1 is returned. +.I x +¤¬ +0 ¤« \-0 ¤Î¾ì¹ç¡¢1 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is positive infinity, +.\"O +0 is returned. +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is negative infinity, +.\"O +2 is returned. +.I x +¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢+2 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If the function result underflows and produces an unrepresentable value, +.\"O the return value is 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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Range error: result underflow (result is subnormal) +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼ (·ë²Ì¤¬ÈóÀµµ¬²½¿ô) +.\" .I errno +.\" is set to +.\" .BR ERANGE . +.\"O An underflow floating-point exception +.\"O .RB ( FE_UNDERFLOW ) +.\"O is raised. +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +.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" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR cerf (3), +.BR erf (3), +.BR exp (3) diff --git a/draft/man3/err.3 b/draft/man3/err.3 new file mode 100644 index 00000000..437c4da5 --- /dev/null +++ b/draft/man3/err.3 @@ -0,0 +1,232 @@ +.\" Copyright (c) 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. +.\" +.\" From: @(#)err.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/gen/err.3,v 1.11.2.5 2001/08/17 15:42:32 ru Exp $ +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.TH ERR 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O err, verr, errx, verrx, warn, vwarn, warnx, vwarnx \- formatted error messages +.SH ̾Á° +err, verr, errx, verrx, warn, vwarn, warnx, vwarnx \- ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÀ°·Á¤¹¤ë +.Nd +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void err(int " eval ", const char *" fmt ", ...);" +.sp +.BI "void errx(int " eval ", const char *" fmt ", ...);" +.sp +.BI "void warn(const char *" fmt ", ...);" +.sp +.BI "void warnx(const char *" fmt ", ...);" +.sp +.B #include +.sp +.BI "void verr(int " eval ", const char *" fmt ", va_list " args ); +.sp +.BI "void verrx(int " eval ", const char *" fmt ", va_list " args ); +.sp +.BI "void vwarn(const char *" fmt ", va_list " args ); +.sp +.BI "void vwarnx(const char *" fmt ", va_list " args ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR err () +.\"O and +.\"O .BR warn () +.\"O family of functions display a formatted error message on the standard +.\"O error output. +.BR err () +´Ø¿ô·²¤È +.BR warn () +´Ø¿ô·²¤Ï¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÀ°·Á¤·¤Æɸ½à¥¨¥é¡¼½ÐÎϤËɽ¼¨¤¹¤ë¡£ +.\"O In all cases, the last component of the program name, a colon character, +.\"O and a space are output. +¤É¤Î´Ø¿ô¤Î¾ì¹ç¤â¡¢(¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤ò¾Ê¤¤¤¿)¥×¥í¥°¥é¥à̾¡¢ +¥³¥í¥ó 1¸Ä¡¢¥¹¥Ú¡¼¥¹ 1¸Ä¤¬½ÐÎϤµ¤ì¤ë¡£ +.\"O If the +.\"O .I fmt +.\"O argument is not NULL, the +.\"O .BR printf (3)-like +.\"O formatted error message is output. +.I fmt +°ú¤­¿ô¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.BR printf (3) +¤ÈƱÍͤËÀ°·Á¤¬¹Ô¤ï¤ì¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½ÐÎϤµ¤ì¤ë¡£ +.\"O The output is terminated by a newline character. +½ÐÎϤϲþ¹Ôʸ»ú¤Ç½ª¤ï¤ë¡£ +.PP +.\"O The +.\"O .BR err (), +.\"O .BR verr (), +.\"O .BR warn (), +.\"O and +.\"O .BR vwarn () +.\"O functions append an error message obtained from +.\"O .BR strerror (3) +.\"O based on a code or the global variable +.\"O .IR errno , +.\"O preceded by another colon and space unless the +.\"O .I fmt +.\"O argument is +.\"O NULL. +\"O motoki: based on a code or ¡Á ¤Î¡Öa code¡×¤È¤Ï¡© +´Ø¿ô +.BR err (), +.BR verr (), +.BR warn (), +.BR vwarn () +¤Ï¡¢¥³¡¼¥É¤Þ¤¿¤Ï¥°¥í¡¼¥Ð¥ëÊÑ¿ô +.I errno +¤Ë´ð¤Å¤¤¤Æ +.BR strerror (3) +¤«¤éÆÀ¤¿¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ¹¤ë¡£ +.I fmt +°ú¤­¿ô¤¬ NULL +¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢°ì¸Ä¤º¤Ä¤Î¥³¥í¥ó¤È¥¹¥Ú¡¼¥¹¤Ë³¤±¤Æ½ÐÎϤ¹¤ë¡£ +.PP +.\"O The +.\"O .BR err (), +.\"O .BR verr (), +.\"O .BR warn (), +.\"O and +.\"O .BR vwarn () +.\"O functions use the global variable +.\"O .I errno +.\"O to look up the error message. +´Ø¿ô +.BR err (), +.BR verr (), +.BR warn (), +.BR vwarn () +¤Ï¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òõ¤¹¤¿¤á¤Ë¥°¥í¡¼¥Ð¥ëÊÑ¿ô +.I errno +¤ò»ÈÍѤ¹¤ë¡£ +.PP +.\"O The +.\"O .BR errx () +.\"O and +.\"O .BR warnx () +.\"O functions do not append an error message. +´Ø¿ô +.BR errx (), +.BR warnx () +¤Ï¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÉÕ¤±²Ã¤¨¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR err (), +.\"O .BR verr (), +.\"O .BR errx (), +.\"O and +.\"O .BR verrx () +.\"O functions do not return, but exit with the value of the argument +.\"O .I eval . +´Ø¿ô +.BR err (), +.BR verr (), +.BR errx (), +.BR verrx () +¤ÏÊÖ¤êÃͤòÊÖ¤µ¤Ê¤¤¤¬¡¢°ú¤­¿ô +.I eval +¤ÎÃͤò exit status ¤ËÀßÄꤷ½ªÎ»¤¹¤ë¡£ +.\"O .SH EXAMPLES +.SH Îã +.\"O Display the current +.\"O .I errno +.\"O information string and exit: +¸½ºß¤Î +.I errno +¤Î¾ðÊó¤òɽ¼¨¤·¡¢½ªÎ»¤¹¤ë: +.in +4n +.nf + +if ((p = malloc(size)) == NULL) + err(1, NULL); +if ((fd = open(file_name, O_RDONLY, 0)) == \-1) + err(1, "%s", file_name); +.fi +.in +.PP +.\"O Display an error message and exit: +¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¡¢½ªÎ»¤¹¤ë: +.in +4n +.nf + +if (tm.tm_hour < START_TIME) + errx(1, "too early, wait until %s", start_time_string); +.fi +.in +.PP +.\"O Warn of an error: +¥¨¥é¡¼¤ò·Ù¹ðɽ¼¨¤¹¤ë: +.in +4n +.nf + +if ((fd = open(raw_device, O_RDONLY, 0)) == \-1) + warnx("%s: %s: trying the block device", + raw_device, strerror(errno)); +if ((fd = open(block_device, O_RDONLY, 0)) == \-1) + err(1, "%s", block_device); +.fi +.in +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These functions are nonstandard BSD extensions. +¤³¤ì¤é¤Î´Ø¿ô¤ÏÈóɸ½à¤Î BSD ³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .\" .SH HISTORY +.\" .SH Îò»Ë +.\"O .\" The +.\"O .\" .BR err () +.\"O .\" and +.\"O .\" .BR warn () +.\"O .\" functions first appeared in +.\"O .\" 4.4BSD. +.\" ´Ø¿ô +.\" .BR err () +.\" ¤È +.\" .BR warn () +.\" ¤Ï +.\" 4.4BSD +.\" ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR error (3), +.BR exit (3), +.BR perror (3), +.BR printf (3), +.BR strerror (3) diff --git a/draft/man3/errno.3 b/draft/man3/errno.3 new file mode 100644 index 00000000..1e1839a7 --- /dev/null +++ b/draft/man3/errno.3 @@ -0,0 +1,756 @@ +.\" Copyright (c) 1996 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. +.\" +.\" 5 Oct 2002, Modified by Michael Kerrisk +.\" Updated for POSIX.1 2001 +.\" 2004-12-17 Martin Schulze , mtk +.\" Removed errno declaration prototype, added notes +.\" 2006-02-09 Kurt Wall, mtk +.\" Added non-POSIX errors +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-24, HIROFUMI Nishizuka +.\" Updated 1999-03-01, NAKANO Takeo +.\" Updated 1999-08-21, NAKANO Takeo +.\" Updated 2003-07-03, Akihiro MOTOKI +.\" Updated 2005-03-15, Akihiro MOTOKI +.\" Updated 2006-02-15, Akihiro MOTOKI, Catch up to LDP v2.23 +.\" Updated 2006-07-14, Akihiro MOTOKI, Catch up to LDP v2.34 +.\" Updated 2008-08-07, Akihiro MOTOKI, Catch up to LDP v3.05 +.\" +.TH ERRNO 3 2008-07-09 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O errno \- number of last error +errno \- ľ¶á¤ËȯÀ¸¤·¤¿¥¨¥é¡¼¤ÎÈÖ¹æ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.\".sp +.\".BI "extern int " errno ; +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .I +.\"O header file defines the integer variable +.\"O .IR errno , +.\"O which is set by system calls and some library functions in the event +.\"O of an error to indicate what went wrong. +.\"O Its value is significant only when the return value of +.\"O the call indicated an error +.\"O (i.e., \-1 from most system calls; +.\"O \-1 or NULL from most library functions); +.\"O a function that succeeds +.\"O .I is +.\"O allowed to change +.\"O .IR errno . +¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.I +¤ÇÀ°¿ô·¿¤ÎÊÑ¿ô +.I errno +¤¬ÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¤¤¤¯¤Ä¤«¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿ºÝ¤Ë +¤³¤ÎÊÑ¿ô¤Ë¤½¤Î¸¶°ø¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +¤³¤ÎÃͤϸƤӽФ·¤ÎÊÖ¤êÃͤ¬¥¨¥é¡¼ (¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤Ï +\-1 ¤Ç¡¢¤Û¤È¤ó¤É¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤Ï \-1 ¤« NULL) ¤ò¼¨¤·¤¿¤È¤­¤Ë +¤Î¤ß°ÕÌ£¤ò»ý¤Ä¤¬¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤â +.I errno +¤òÊѹ¹¤¹¤ë¤³¤È¤¬µö¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"O Valid error numbers are all nonzero; \fIerrno\fP is never set to zero +.\"O by any system call or library function. +Í­¸ú¤Ê¥¨¥é¡¼ÈÖ¹æ¤Ï¤¤¤º¤ì¤â 0 °Ê³°¤ÎÃͤò»ý¤Ä¡£ +¤É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤â¥é¥¤¥Ö¥é¥ê´Ø¿ô¤â +\fIerrno\fP ¤ò 0 ¤ËÀßÄꤹ¤ë¤³¤È¤Ï¤Ê¤¤¡£ + +.\"O For some system calls and library functions (e.g., +.\"O .BR getpriority (2)), +.\"O \-1 is a valid return on success. +.\"O In such cases, a successful return can be distinguished from an error +.\"O return by setting +.\"O .I errno +.\"O to zero before the call, and then, +.\"O if the call returns a status that indicates that an error +.\"O may have occurred, checking to see if +.\"O .I errno +.\"O has a nonzero value. +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô (Î㤨¤Ð +.BR getpriority (2)) +¤Ç¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤ÎÍ­¸ú¤ÊÊÖ¤êÃͤȤ·¤Æ \-1 ¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¾ì¹ç¡¢À®¸ù¤Ê¤Î¤«¥¨¥é¡¼¤Ê¤Î¤«¤ò¶èÊ̤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë +.I errno +¤ò 0 ¤ËÀßÄꤷ¤Æ¤ª¤±¤Ð¤è¤¤¡£¸Æ¤Ó½Ð¤·¤ÎÊÖ¤êÃͤ¬¥¨¥é¡¼È¯À¸¤Î²ÄǽÀ­¤ò +¼¨¤¹¤â¤Î¤À¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +.I errno +¤¬ 0 °Ê³°¤ÎÃͤ«¤ò¸«¤Æ³Îǧ¤¹¤ì¤Ð¤è¤¤¡£ + +.\"O \fIerrno\fP is defined by the ISO C standard to be a modifiable lvalue +.\"O of type \fIint\fP, and must not be explicitly declared; \fIerrno\fP +.\"O may be a macro. +.\"O \fIerrno\fP is thread-local; setting it in one thread +.\"O does not affect its value in any other thread. +\fIerrno\fP ¤Ï¡¢ISO C standard ¤Ç \fIint\fP ·¿¤ÎÊѹ¹²Äǽ¤Êº¸ÊÕÃÍ +¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ÌÀ¼¨Åª¤ËÀë¸À¤ò¹Ô¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤; +\fIerrno\fP ¤Ï¥Þ¥¯¥í¤Î¾ì¹ç¤â¤¢¤ê¤¨¤ë¡£ +\fIerrno\fP ¤Ï¥¹¥ì¥Ã¥ÉËè¤ËÃͤò»ý¤Ä¡£ +¤Ä¤Þ¤ê¤¢¤ë¥¹¥ì¥Ã¥É¤Ç \fIerrno\fP ¤¬ÀßÄꤵ¤ì¤Æ¤â¡¢ +¾¤Î¥¹¥ì¥Ã¥É¤Î \fIerrno\fP ¤Ë¤Ï±Æ¶Á¤·¤Ê¤¤¡£ + +.\"O All the error names specified by POSIX.1 +.\"O must have distinct values, with the exception of +.\"O .B EAGAIN +.\"O and +.\"O .BR EWOULDBLOCK , +.\"O which may be the same. +POSIX.1 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î¥¨¥é¡¼Ì¾¤Ë¤Ï¡¢ +¤½¤ì¤¾¤ì°Û¤Ê¤ëÃͤ¬Âбþ¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +⤷¡¢ +.B EAGAIN +¤È +.B EWOULDBLOCK +¤ÏÎã³°¤Ç¡¢¤³¤ì¤é¤ÏƱ¤¸Ãͤò»ý¤Ã¤Æ¤â¤è¤¤¡£ + +.\" The following is now +.\"O .\" POSIX.1 (2001 edition) lists the following symbolic error names. Of +.\"O .\" these, \fBEDOM\fP and \fBERANGE\fP are in the ISO C standard. ISO C +.\"O .\" Amendment 1 defines the additional error number \fBEILSEQ\fP for +.\"O .\" coding errors in multibyte or wide characters. +.\" POSIX.1 (2001 ǯÈÇ) ¤Ç¤Î¥¨¥é¡¼Ì¾¥·¥ó¥Ü¥ë¤Î¥ê¥¹¥È¤ò°Ê²¼¤Ë¼¨¤¹¡£ +.\" ¤³¤ì¤é¤Î¤¦¤Á¡¢ \fBEDOM\fP ¤È \fBERANGE\fP ¤Ï ISO C standard ¤Ë¤¢¤ë¡£ +.\" ¤µ¤é¤Ë¡¢ISO C Amendment 1 ¤Ç¤Ï¡¢¥¨¥é¡¼ÈÖ¹æ \fBEILSEQ\fP ¤¬ +.\" ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ä¥ï¥¤¥Éʸ»ú¤Ç¤ÎÉä¹æ²½¥¨¥é¡¼¤òɽ¤¹¤¿¤á¤Ë +.\" ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" +.\"O Below is a list of the symbolic error names that are defined on Linux. +.\"O Some of these are marked +.\"O .IR POSIX.1 , +.\"O indicating that the name is defined by POSIX.1-2001, or +.\"O .IR C99 , +.\"O indicating that the name is defined by C99. +.TP 16 +.B E2BIG +.\"O Argument list too long (POSIX.1) +°ú¤­¿ô¥ê¥¹¥È¤¬Ä¹²á¤®¤ë (POSIX.1) +.TP +.B EACCES +.\"O Permission denied (POSIX.1) +µö²Ä¤¬¤Ê¤¤ (POSIX.1) +.TP +.B EADDRINUSE +.\"O Address already in use (POSIX.1) +¥¢¥É¥ì¥¹¤¬¤¹¤Ç¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë (POSIX.1) +.TP +.B EADDRNOTAVAIL +.\"O Address not available (POSIX.1) +¥¢¥É¥ì¥¹¤¬»ÈÍѤǤ­¤Ê¤¤ (POSIX.1) +.\"O .\" EADV is only an error on HURD(?) +.\" EADV ¤Ï HURD ¤Ë¤ª¤¤¤Æ¤À¤±¤Î¥¨¥é¡¼(?) +.TP +.B EAFNOSUPPORT +.\"O Address family not supported (POSIX.1) +¥¢¥É¥ì¥¹¡¦¥Õ¥¡¥ß¥ê¡¼¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1) +.TP +.B EAGAIN +.\"O Resource temporarily unavailable (may be the same value as +.\"O .BR EWOULDBLOCK ) +.\"O (POSIX.1) +¥ê¥½¡¼¥¹¤¬°ì»þŪ¤ËÍøÍÑÉÔ²Ä +.RB ( EWOULDBLOCK +¤ÈƱ¤¸ÃͤǤâ¤è¤¤) (POSIX.1) +.TP +.B EALREADY +.\"O Connection already in progress (POSIX.1) +Àܳ¤¬´û¤Ë½èÍýÃæ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EBADE +.\"O Invalid exchange +ÉÔÀµ¤Ê¤ä¤ê¼è¤ê (exchange) ¤Ç¤¢¤ë +.TP +.B EBADF +.\"O Bad file descriptor (POSIX.1) +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EBADFD +.\"O File descriptor in bad state +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¤Ê¾õÂ֤Ǥ¢¤ë +.TP +.B EBADMSG +.\"O Bad message (POSIX.1) +¥á¥Ã¥»¡¼¥¸¤¬ÉÔÀµ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EBADR +.\"O Invalid request descriptor +ÉÔÀµ¤Ê¥ê¥¯¥¨¥¹¥È¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.TP +.B EBADRQC +.\"O Invalid request code +ÉÔÀµ¤Ê¥ê¥¯¥¨¥¹¥È¥³¡¼¥É +.TP +.B EBADSLT +.\"O Invalid slot +ÉÔÀµ¤Ê¥¹¥í¥Ã¥È +.\" EBFONT is defined but appears not to be used by kernel or glibc. +.TP +.B EBUSY +.\"O Device or resource busy (POSIX.1) +¥ê¥½¡¼¥¹¤¬»ÈÍÑÃæ¤Ç¤¢¤ë (POSIX.1) +.TP +.B ECANCELED +.\"O Operation canceled (POSIX.1) +Áàºî¤¬¥­¥ã¥ó¥»¥ë¤µ¤ì¤¿ (POSIX.1) +.TP +.B ECHILD +.\"O No child processes (POSIX.1) +»Ò¥×¥í¥»¥¹¤¬Ìµ¤¤ (POSIX.1) +.TP +.B ECHRNG +.\"O Channel number out of range +¥Á¥ã¥ó¥Í¥ëÈֹ椬Èϰϳ°¤Ç¤¢¤ë +.TP +.B ECOMM +.\"O Communication error on send +Á÷¿®»þ¤ËÄÌ¿®¥¨¥é¡¼¤¬È¯À¸¤·¤¿ +.TP +.B ECONNABORTED +.\"O Connection aborted (POSIX.1) +Àܳ¤¬Ãæ»ß¤µ¤ì¤¿ (POSIX.1) +.TP +.B ECONNREFUSED +.\"O Connection refused (POSIX.1) +Àܳ¤¬µñÈݤµ¤ì¤¿ (POSIX.1) +.TP +.B ECONNRESET +.\"O Connection reset (POSIX.1) +Àܳ¤¬¥ê¥»¥Ã¥È¤µ¤ì¤¿ (POSIX.1) +.TP +.B EDEADLK +.\"O Resource deadlock avoided (POSIX.1) +¥ê¥½¡¼¥¹¤Î¥Ç¥Ã¥É¥í¥Ã¥¯¤ò²óÈò¤·¤¿ (POSIX.1) +.TP +.B EDEADLOCK +.\"O Synonym for +.\"O .B EDEADLK +.B EDEADLK +¤ÎƱµÁ¸ì +.TP +.B EDESTADDRREQ +.\"O Destination address required (POSIX.1) +°¸À襢¥É¥ì¥¹¤¬É¬ÍפǤ¢¤ë (POSIX.1) +.TP +.B EDOM +.\"O Mathematics argument out of domain of function (POSIX.1, C99) +¿ô³Ø´Ø¿ô¤Ç°ú¤­¿ô¤¬Îΰ賰¤Ç¤¢¤ë (out of domain) +.\" EDOTDOT is defined but appears to be unused +.TP +.B EDQUOT +.\" POSIX just says "Reserved" +.\"O Disk quota exceeded (POSIX.1) +¥Ç¥£¥¹¥¯¡¦¥¯¥©¡¼¥¿ (quota) ¤òĶ²á¤·¤¿ (POSIX.1) +.TP +.B EEXIST +.\"O File exists (POSIX.1) +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë (POSIX.1) +.TP +.B EFAULT +.\"O Bad address (POSIX.1) +¥¢¥É¥ì¥¹¤¬ÉÔÀµ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EFBIG +.\"O File too large (POSIX.1) +¥Õ¥¡¥¤¥ë¤¬Â礭²á¤®¤ë (POSIX.1) +.TP +.B EHOSTDOWN +.\"O Host is down +¥Û¥¹¥È¤¬¥À¥¦¥ó¤·¤Æ¤¤¤ë +.TP +.B EHOSTUNREACH +.\"O Host is unreachable (POSIX.1) +¥Û¥¹¥È¤ËÅþãÉÔǽ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EIDRM +.\"O Identifier removed (POSIX.1) +¼±Ê̻Ҥ¬ºï½ü¤µ¤ì¤¿ (POSIX.1) +.TP +.B EILSEQ +.\"O Illegal byte sequence (POSIX.1, C99) +ÉÔÀµ¤Ê¥Ð¥¤¥ÈÎó (POSIX.1, C99) +.TP +.B EINPROGRESS +.\"O Operation in progress (POSIX.1) +Áàºî¤¬¼Â¹ÔÃæ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EINTR +.\"O Interrupted function call (POSIX.1); see +.\"O .BR signal (7). +´Ø¿ô¸Æ¤Ó½Ð¤·¤¬³ä¤ê¹þ¤Þ¤ì¤¿ (POSIX.1); +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.\"O Invalid argument (POSIX.1) +°ú¿ô¤¬Ìµ¸ú¤Ç¤¢¤ë (POSIX.1) +.TP +.B EIO +.\"O Input/output error (POSIX.1) +Æþ½ÐÎÏ¥¨¥é¡¼ (POSIX.1) +.TP +.B EISCONN +.\"O Socket is connected (POSIX.1) +¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤ë (POSIX.1) +.TP +.B EISDIR +.\"O Is a directory (POSIX.1) +¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë (POSIX.1) +.TP +.B EISNAM +.\"O Is a named type file +̾Á°ÉÕ¤­¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë +.TP +.B EKEYEXPIRED +.\"O Key has expired +¸°¤¬´ü¸ÂÀÚ¤ì¤È¤Ê¤Ã¤¿ +.TP +.B EKEYREJECTED +.\"O Key was rejected by service +¸°¤¬¥µ¡¼¥Ð¤Ë¤è¤êµñÈݤµ¤ì¤¿ +.TP +.B EKEYREVOKED +.\"O Key has been revoked +¸°¤¬Ìµ¸ú¤È¤Ê¤Ã¤¿ +.TP +.B EL2HLT +.\"O Level 2 halted +Ää»ß (¥ì¥Ù¥ë 2) +.TP +.B EL2NSYNC +.\"O Level 2 not synchronized +Ʊ´ü¤Ç¤­¤Æ¤¤¤Ê¤¤ (¥ì¥Ù¥ë 2) +.TP +.B EL3HLT +.\"O Level 3 halted +Ää»ß (¥ì¥Ù¥ë 3) +.TP +.B EL3RST +.\"O Level 3 halted +¥ê¥»¥Ã¥È (¥ì¥Ù¥ë 3) +.TP +.B ELIBACC +.\"O Cannot access a needed shared library +ɬÍפʶ¦Í­¥é¥¤¥Ö¥é¥ê¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿ +.TP +.B ELIBBAD +.\"O Accessing a corrupted shared library +²õ¤ì¤¿¶¦Í­¥é¥¤¥Ö¥é¥ê¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤¿ +.TP +.B ELIBMAX +.\"O Attempting to link in too many shared libraries +¥ê¥ó¥¯¤·¤è¤¦¤È¤·¤¿¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬Â¿²á¤®¤ë +.TP +.B ELIBSCN +.\"O lib section in a.out corrupted +a.out ¤Î¥é¥¤¥Ö¥é¥ê¥»¥¯¥·¥ç¥ó¤¬²õ¤ì¤Æ¤¤¤ë (corrupted) +.TP +.B ELIBEXEC +.\"O Cannot exec a shared library directly +¶¦Í­¥é¥¤¥Ö¥é¥ê¤òľÀܼ¹ԤǤ­¤Ê¤«¤Ã¤¿ +.TP +.B ELOOP +.\"O Too many levels of symbolic links (POSIX.1) +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î²ó¿ô¤¬Â¿²á¤®¤ë (POSIX.1) +.\" ELNRNG is defined but appears to be unused +.TP +.B EMEDIUMTYPE +.\"O Wrong medium type +´Ö°ã¤Ã¤¿¥á¥Ç¥£¥¢¼ïÊ̤Ǥ¢¤ë +.TP +.B EMFILE +.\"O Too many open files (POSIX.1) +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬Â¿²á¤®¤ë (POSIX.1) +.TP +.B EMLINK +.\"O Too many links (POSIX.1) +¥ê¥ó¥¯¤¬Â¿²á¤®¤ë (POSIX.1) +.TP +.B EMSGSIZE +.\"O Message too long (POSIX.1) +¥á¥Ã¥»¡¼¥¸¤¬Ä¹²á¤®¤ë (POSIX.1) +.TP +.B EMULTIHOP +.\" POSIX says "Reserved" +.\"O Multihop attempted (POSIX.1) +¥Þ¥ë¥Á¥Û¥Ã¥× (multihop) ¤ò»î¤ß¤¿ (POSIX.1) +.TP +.B ENAMETOOLONG +.\"O Filename too long (POSIX.1) +¥Õ¥¡¥¤¥ë̾¤¬Ä¹²á¤®¤ë (POSIX.1) +.\" ENAVAIL is defined, but appears not to be used +.TP +.B ENETDOWN +.\"O Network is down (POSIX.1) +¥Í¥Ã¥È¥ï¡¼¥¯¤¬ÉÔÄ̤Ǥ¢¤ë (POSIX.1) +.TP +.B ENETRESET +.\"O Connection aborted by network (POSIX.1) +Àܳ¤¬¥Í¥Ã¥È¥ï¡¼¥¯Â¦¤«¤éÃæ»ß¤µ¤ì¤¿ (POSIX.1) +.TP +.B ENETUNREACH +.\"O Network unreachable (POSIX.1) +¥Í¥Ã¥È¥ï¡¼¥¯¤¬ÅþãÉÔǽ¤Ç¤¢¤ë (POSIX.1) +.TP +.B ENFILE +.\"O Too many open files in system (POSIX.1) +¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬Â¿²á¤®¤ë (POSIX.1) +.\" ENOANO is defined but appears to be unused. +.TP +.B ENOBUFS +.\"O No buffer space available (POSIX.1 (XSI STREAMS option)) +»ÈÍѲÄǽ¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬¤Ê¤¤ (POSIX.1 (XSI STREAMS option)) +.\" ENOCSI is defined but appears to be unused. +.TP +.B ENODATA +.\"O No message is available on the STREAM head read queue (POSIX.1) +¥¹¥È¥ê¡¼¥à¤ÎÆɤ߽Ф·¥­¥å¡¼¤ÎÀèƬ¤ËÆɤ߽Ф·²Äǽ¤Ê¥á¥Ã¥»¡¼¥¸¤¬¤Ê¤¤ +(POSIX.1) +.TP +.B ENODEV +.\"O No such device (POSIX.1) +¤½¤Î¤è¤¦¤Ê¥Ç¥Ð¥¤¥¹¤Ï̵¤¤ (POSIX.1) +.TP +.B ENOENT +.\"O No such file or directory (POSIX.1) +¤½¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤Ï̵¤¤ (POSIX.1) +.TP +.B ENOEXEC +.\"O Exec format error (POSIX.1) +¼Â¹Ô¥Õ¥¡¥¤¥ë·Á¼°¤Î¥¨¥é¡¼ (POSIX.1) +.TP +.B ENOKEY +.\"O Required key not available +Í׵ᤵ¤ì¤¿¸°¤¬ÍøÍѤǤ­¤Ê¤¤ +.TP +.B ENOLCK +.\"O No locks available (POSIX.1) +ÍøÍѤǤ­¤ë¥í¥Ã¥¯¤¬Ìµ¤¤ (POSIX.1) +.TP +.B ENOLINK +.\" POSIX says "Reserved" +.\"O Link has been severed (POSIX.1) +¥ê¥ó¥¯¤¬ÀÚ¤ì¤Æ¤¤¤ë (POSIX.1) +.TP +.B ENOMEDIUM +.\"O No medium found +¥á¥Ç¥£¥¢¤¬¸«¤Ä¤«¤é¤Ê¤¤ +.TP +.B ENOMEM +.\"O Not enough space (POSIX.1) +½½Ê¬¤Ê¶õ¤­¥á¥â¥êÎΰ褬̵¤¤ (POSIX.1) +.TP +.B ENOMSG +.\"O No message of the desired type (POSIX.1) +Í׵ᤵ¤ì¤¿·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬Â¸ºß¤·¤Ê¤¤ (POSIX.1) +.TP +.B ENONET +.\"O Machine is not on the network +¥Þ¥·¥ó¤¬¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Ë¤Ê¤¤ +.TP +.B ENOPKG +.\"O Package not installed +¥Ñ¥Ã¥±¡¼¥¸¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤Ê¤¤ +.TP +.B ENOPROTOOPT +.\"O Protocol not available (POSIX.1) +»ØÄꤵ¤ì¤¿¥×¥í¥È¥³¥ë¤¬ÍøÍѤǤ­¤Ê¤¤ (POSIX.1) +.TP +.B ENOSPC +.\"O No space left on device (POSIX.1) +¥Ç¥Ð¥¤¥¹¤Ë¶õ¤­Îΰ褬̵¤¤ (POSIX.1) +.TP +.B ENOSR +.\"O No STREAM resources (POSIX.1 (XSI STREAMS option)) +»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¡¦¥ê¥½¡¼¥¹¤¬Â¸ºß¤·¤Ê¤¤ (POSIX.1 (XSI STREAMS option)) +.TP +.B ENOSTR +.\"O Not a STREAM (POSIX.1 (XSI STREAMS option)) +¥¹¥È¥ê¡¼¥à¤Ç¤Ï¤Ê¤¤ (POSIX.1 (XSI STREAMS option)) +.TP +.B ENOSYS +.\"O Function not implemented (POSIX.1) +´Ø¿ô¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1) +.TP +.B ENOTBLK +.\"O Block device required +¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤¬É¬ÍפǤ¢¤ë +.TP +.B ENOTCONN +.\"O The socket is not connected (POSIX.1) +¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1) +.TP +.B ENOTDIR +.\"O Not a directory (POSIX.1) +¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤ (POSIX.1) +.TP +.B ENOTEMPTY +.\"O Directory not empty (POSIX.1) +¥Ç¥£¥ì¥¯¥È¥ê¤¬¶õ¤Ç¤Ï¤Ê¤¤ (POSIX.1) +.\" ENOTNAM is defined but appears to be unused. +.TP +.B ENOTSOCK +.\"O Not a socket (POSIX.1) +¥½¥±¥Ã¥È¤Ç¤Ï¤Ê¤¤ (POSIX.1) +.TP +.B ENOTSUP +.\"O Operation not supported (POSIX.1) +Áàºî¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1) +.TP +.B ENOTTY +.\"O Inappropriate I/O control operation (POSIX.1) +I/O À©¸æÁàºî¤¬Å¬ÀڤǤʤ¤ (POSIX.1) +.TP +.B ENOTUNIQ +.\"O Name not unique on network +̾Á°¤¬¥Í¥Ã¥È¥ï¡¼¥¯¤Ç°ì°Õ¤Ç¤Ï¤Ê¤¤ +.TP +.B ENXIO +.\"O No such device or address (POSIX.1) +¤½¤Î¤è¤¦¤Ê¥Ç¥Ð¥¤¥¹¤ä¥¢¥É¥ì¥¹¤Ï¤Ê¤¤ (POSIX.1) +.TP +.B EOPNOTSUPP +.\"O Operation not supported on socket (POSIX.1) +¥½¥±¥Ã¥È¤Ç¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤Áàºî¤Ç¤¢¤ë (POSIX.1) +.sp +.\"O .RB ( ENOTSUP +.\"O and +.\"O .B EOPNOTSUPP +.\"O have the same value on Linux, but +.\"O according to POSIX.1 these error values should be distinct.) +(Linux ¤Ç¤Ï +.B ENOTSUP +¤È +.B EOPNOTSUPP +¤ÏƱ¤¸Ãͤò»ý¤Ä¤¬¡¢ +POSIX.1 ¤Ë½¾¤¨¤Ðξ¼Ô¤Î¥¨¥é¡¼Ãͤ϶èÊ̤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£) +.TP +.B EOVERFLOW +.\"O Value too large to be stored in data type (POSIX.1) +»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿·¿¤Ë³ÊǼ¤¹¤ë¤Ë¤ÏÃͤ¬Â礭²á¤®¤ë (POSIX.1) +.TP +.B EPERM +.\"O Operation not permitted (POSIX.1) +Áàºî¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1) +.TP +.B EPFNOSUPPORT +.\"O Protocol family not supported +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥×¥í¥È¥³¥ë¥Õ¥¡¥ß¥ê¡¼¤Ç¤¢¤ë +.TP +.B EPIPE +.\"O Broken pipe (POSIX.1) +¥Ñ¥¤¥×¤¬²õ¤ì¤Æ¤¤¤ë (POSIX.1) +.TP +.B EPROTO +.\"O Protocol error (POSIX.1) +¥×¥í¥È¥³¥ë¡¦¥¨¥é¡¼ (POSIX.1) +.TP +.B EPROTONOSUPPORT +.\"O Protocol not supported (POSIX.1) +¥×¥í¥È¥³¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1) +.TP +.B EPROTOTYPE +.\"O Protocol wrong type for socket (POSIX.1) +¥½¥±¥Ã¥È¤Ë»ØÄê¤Ç¤­¤Ê¤¤¥×¥í¥È¥³¥ë¡¦¥¿¥¤¥×¤Ç¤¢¤ë (POSIX.1) +.TP +.B ERANGE +.\"O Result too large (POSIX.1, C99) +·ë²Ì¤¬Â礭²á¤®¤ë (POSIX.1, C99) +.TP +.B EREMCHG +.\"O Remote address changed +¥ê¥â¡¼¥È¥¢¥É¥ì¥¹¤¬ÊѤï¤Ã¤¿ +.TP +.B EREMOTE +.\"O Object is remote +¥ª¥Ö¥¸¥§¥¯¥È¤¬¥ê¥â¡¼¥È¤Ë¤¢¤ë +.TP +.B EREMOTEIO +.\"O Remote I/O error +¥ê¥â¡¼¥È I/O ¥¨¥é¡¼ +.TP +.B ERESTART +.\"O Interrupted system call should be restarted +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÃæÃǤµ¤ìºÆ¥¹¥¿¡¼¥È¤¬É¬ÍפǤ¢¤ë +.TP +.B EROFS +.\"O Read-only file system (POSIX.1) +Æɤ߽Ф·ÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë (POSIX.1) +.TP +.B ESHUTDOWN +.\"O Cannot send after transport endpoint shutdown +ÄÌ¿®Áê¼ê¤¬¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤ÆÁ÷¿®¤Ç¤­¤Ê¤¤ +.TP +.B ESPIPE +.\"O Invalid seek (POSIX.1) +̵¸ú¤Ê¥·¡¼¥¯ (POSIX.1) +.TP +.B ESOCKTNOSUPPORT +.\"O Socket type not supported +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¼ïÊ̤Ǥ¢¤ë +.TP +.B ESRCH +.\"O No such process (POSIX.1) +¤½¤Î¤è¤¦¤Ê¥×¥í¥»¥¹¤Ï̵¤¤ (POSIX.1) +.\" ESRMNT is defined but appears not to be used +.TP +.B ESTALE +.\"O Stale file handle (POSIX.1) +¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤¬¸Å¤¤¾õÂ֤ˤʤäƤ¤¤ë (POSIX.1) +.sp +.\"O This error can occur for NFS and for other file systems +NFS ¤ä¾¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Çµ¯¤³¤ê¤¦¤ë¡£ +.TP +.B ESTRPIPE +.\"O Streams pipe error +¥¹¥È¥ê¡¼¥à¡¦¥Ñ¥¤¥×¡¦¥¨¥é¡¼ +.TP +.B ETIME +.\"O Timer expired +.\"O (POSIX.1 (XSI STREAMS option)) +»þ´Ö¤¬·Ð²á¤·¤¿ +(POSIX.1 (XSI STREAMS option)) +.sp +.\"O (POSIX.1 says "STREAM +.\"O .BR ioctl (2) +.\"O timeout") +(POSIX.1 ¤Ç¤Ï "STREAM +.BR ioctl (2) +timeout" ¤È½ñ¤«¤ì¤Æ¤¤¤ë) +.TP +.B ETIMEDOUT +.\"O Connection timed out (POSIX.1) +Áàºî¤¬¥¿¥¤¥à¥¢¥¦¥È¤·¤¿ (POSIX.1) +.\" ETOOMANYREFS is defined, but appears not to be used. +.TP +.B ETXTBSY +.\"O Text file busy (POSIX.1) +¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤¬»ÈÍÑÃæ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EUCLEAN +.\"Omotoki: °ÕÌ£¤¬Ê¬¤«¤é¤Ê¤¤¤Î¤Ç¡¢¤½¤Î¤Þ¤Þ¸¶Ê¸¤ò»Ä¤·¤Æ¤¢¤ë¡£ +.\"O Structure needs cleaning +Structure needs cleaning +.TP +.B EUNATCH +.\"O Protocol driver not attached +¥×¥í¥È¥³¥ë¤Î¥É¥é¥¤¥Ð¤¬ÉÕÍ¿ (attach) ¤µ¤ì¤Æ¤¤¤Ê¤¤ +.TP +.B EUSERS +.\"O Too many users +¥æ¡¼¥¶¿ô¤¬Â¿²á¤®¤ë +.TP +.B EWOULDBLOCK +.\"O Operation would block (may be same value as +.\"O .BR EAGAIN ) +.\"O (POSIX.1) +Áàºî¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¸«¹þ¤ß¤Ç¤¢¤ë +.RB ( EAGAIN +¤ÈƱ¤¸ÃͤǤâ¤è¤¤) (POSIX.1) +.TP +.B EXDEV +.\"O Improper link (POSIX.1) +ÉÔŬÀڤʥê¥ó¥¯ (POSIX.1) +.TP +.B EXFULL +.\"O Exchange full +ÊÑ´¹¥Æ¡¼¥Ö¥ë¤¬°ìÇդǤ¢¤ë +.\"O .SH NOTES +.SH Ãí°Õ +.\"O A common mistake is to do +°Ê²¼¤Ï¤è¤¯¤ä¤ë´Ö°ã¤¤¤Ç¤¢¤ë¡£ +.in +4n +.nf + +if (somecall() == \-1) { + printf("somecall() failed\en"); + if (errno == ...) { ... } +} + +.fi +.in +.\"O where +.\"O .I errno +.\"O no longer needs to have the value it had upon return from +.\"O .IR somecall () +.\"O (i.e., it may have been changed by the +.\"O .BR printf (3)). +¤³¤Î¤è¤¦¤Ë¤¹¤ë¤È¡¢»²¾È¤·¤Æ¤¤¤ë»þÅÀ¤Ç¤Ï +.I errno +¤Ï¤â¤Ï¤ä +.IR somecall () +¤«¤éÊÖ¤µ¤ì¤¿ÃͤòÊÝ»ý¤·¤Æ¤¤¤ë¤È¤Ï¸Â¤é¤Ê¤¤ +.RB ( printf (3) +¤Ë¤è¤êÊѹ¹¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤)¡£ +.\"O If the value of +.\"O .I errno +.\"O should be preserved across a library call, it must be saved: +¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤ò¤Þ¤¿¤¤¤Ç +.I errno +¤ÎÃͤòÊݸ¤·¤¿¤¤¾ì¹ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤ËÊݸ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤: +.in +4n +.nf + +if (somecall() == \-1) { + int errsv = errno; + printf("somecall() failed\en"); + if (errsv == ...) { ... } +} +.fi +.in +.PP +.\"O It was common in traditional C to declare +.\"O .I errno +.\"O manually +.\"O (i.e., +.\"O .IR "extern int errno" ) +.\"O instead of including +.\"O .IR . +.\"O .BR "Do not do this" . +.\"O It will not work with modern versions of the C library. +.\"O However, on (very) old Unix systems, there may be no +.\"O .I +.\"O and the declaration is needed. +ÀΤΠC ¤Ç¤Ï¡¢ +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯ +.I errno +¤ò¼êÆ°¤Ç +.RI ( "extern int errno" +¤Î¤è¤¦¤Ë) ÄêµÁ¤¹¤ë¤Î¤¬°ìÈÌŪ¤Ç¤¢¤Ã¤¿¡£ +.BR "¤³¤Î¤è¤¦¤Ê¤³¤È¤Ï¤·¤Ê¤¤¤³¤È" "¡£" +¤³¤¦¤¹¤ë¤È¡¢ºÇ¶á¤Î¥Ð¡¼¥¸¥ç¥ó¤Î C ¥é¥¤¥Ö¥é¥ê¤Ç¤ÏÀµ¤·¤¯Æ°ºî¤·¤Ê¤¤¤À¤í¤¦¡£ +¤·¤«¤·¡¢(Èó¾ï¤Ë) ¸Å¤¤ Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I +¤¬¤Ê¤¯¡¢Àë¸À¤¬É¬Íפʤ³¤È¤¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.BR err (3), +.BR error (3), +.BR perror (3), +.BR strerror (3) diff --git a/draft/man3/error.3 b/draft/man3/error.3 new file mode 100644 index 00000000..6846216c --- /dev/null +++ b/draft/man3/error.3 @@ -0,0 +1,215 @@ +.\" Copyright (C) 2006 Justin Pryzby +.\" and Copyright (C) 2006 Michael Kerrisk +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" References: +.\" glibc manual and source +.\" +.\" Japanese Version Copyright (c) 2006 Yuichi SATO +.\" all rights reserved. +.\" Translated 2006-08-04 by Yuichi SATO , LDP v2.36 +.\" +.TH ERROR 3 2006-04-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O error, error_at_line, error_message_count, error_on_per_line, \ +.\"O error_print_progname \- glibc error reporting functions +error, error_at_line, error_message_count, error_on_per_line, error_print_progname \- glibc ¤Î¥¨¥é¡¼½ñ¤­½Ð¤·´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +\fB#include + +\fBvoid error(int \fIstatus, \fBint\fI errnum, \ +\fBconst char *\fIformat, \fB...); + +\fBvoid error_at_line(int \fIstatus, \fBint \fIerrnum, \ +\fBconst char *\fIfilename, + \fBunsigned int \fIlinenum, \ +\fBconst char *\fIformat, \fB...); + +\fBextern unsigned int \fIerror_message_count\fP; + +\fBextern int \fIerror_one_per_line\fP; + +\fBextern void (* \fIerror_print_progname\fB) (void); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR error () +.\"O is a general error reporting function. +.BR error () +¤ÏÈÆÍÑŪ¤Ê¥¨¥é¡¼½ñ¤­½Ð¤·´Ø¿ô¤Ç¤¢¤ë¡£ +.\"O It flushes +.\"O .IR stdout , +.\"O and then outputs to +.\"O .I stderr +.\"O the program name, a colon and a space, the message specified by the +.\"O .BR printf (3)-style +.\"O format string \fIformat\fP, and, if \fIerrnum\fP is +.\"O nonzero, a second colon and a space followed by the string given by +.\"O \fBperror(\fIerrnum\fB)\fP. +¤³¤Î´Ø¿ô¤Ïɸ½à½ÐÎÏ +.RI ( stdout ) +¤Ë½ñ¤­½Ð¤·¤Æ¤«¤é¡¢É¸½à¥¨¥é¡¼½ÐÎÏ +.RI ( stderr ) +¤Ë½ñ¤­½Ð¤¹¡£ +½ñ¤­½Ð¤¹ÆâÍƤϡ¢¥×¥í¥°¥é¥à̾¡¦¥³¥í¥ó¡¦¥¹¥Ú¡¼¥¹¡¦ +.BR printf (3) +·Á¼°¤Î +¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó \fIformat\fP ¤Ç»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤Ç¤¢¤ë¡£ +\fIerrnum\fP ¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢2 ¤ÄÌܤΥ³¥í¥ó¤È¥¹¥Ú¡¼¥¹¤Î¸å¤Ë +\fBperror(\fIerrnum\fB)\fP +¤Ç»ØÄꤵ¤ì¤¿Ê¸»úÎó¤â½ñ¤­½Ð¤¹¡£ +.\"O Any arguments required for +.\"O .I format +.\"O should follow +.\"O .I format +.\"O in the argument list. +.I format +¤ËɬÍפÊǤ°Õ¤Î°ú¤­¿ô¤¬¡¢°ú¤­¿ô¥ê¥¹¥È¤Î +.I format +¤Î¸å¤Ë³¤¯¡£ +.\"O The output is terminated by a newline character. +½ÐÎϤνªÃ¼¤Ë¤Ï²þ¹Ôʸ»ú¤¬ÉÕ¤¯¡£ + +.\"O The program name printed by +.\"O .BR error () +.\"O is the value of the global variable +.\"O .BR program_invocation_name (3). +.BR error () +¤Ç½ÐÎϤµ¤ì¤ë¥×¥í¥°¥é¥à̾¤Ï¡¢Âç°èÊÑ¿ô +.BR program_invocation_name (3) +¤ÎÃͤǤ¢¤ë¡£ +.\"O .I program_invocation_name +.\"O initially has the same value as +.\"O .IR main ()'s +.\"O .IR argv[0] . +.I program_invocation_name +¤Î½é´üÃÍ¤Ï +.IR main () +¤Î +.I argv[0] +¤ÎÃͤÈÅù¤·¤¤¡£ +.\"O The value of this variable can be modified to change the output of +.\"O .BR error (). +¤³¤ÎÊÑ¿ô¤ÎÃͤÏÊѹ¹²Äǽ¤Ç¤¢¤ê¡¢Êѹ¹¤¹¤ë¤È +.BR error () +¤Î½ÐÎϤ¬ÊѤï¤ë¡£ + +.\"O If \fIstatus\fP has a nonzero value, then +.\"O .BR error () +.\"O calls +.\"O .BR exit (3) +.\"O to terminate the program using the given value as the exit status. +\fIstatus\fP ¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢ +.BR error () +¤Ï +.BR exit (3) +¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢»ØÄꤵ¤ì¤¿½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ç¥×¥í¥°¥é¥à¤ò½ªÎ»¤µ¤»¤ë¡£ + +.\"O The +.\"O .BR error_at_line () +.\"O function is exactly the same as +.\"O .BR error (), +.\"O except for the addition of the arguments +.\"O .I filename +.\"O and +.\"O .IR linenum . +.BR error_at_line () +´Ø¿ô¤Ï¡¢°ú¤­¿ô +.I filename +¤È +.I linenum +¤¬Äɲ䵤ì¤Æ¤¤¤ë°Ê³°¤Ï¡¢ +.BR error () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.\"O The output produced is as for +.\"O .BR error (), +.\"O except that after the program name are written: a colon, the value of +.\"O .IR filename , +.\"O a colon, and the value of +.\"O .IR linenum . +À¸À®¤µ¤ì¤ë½ÐÎϤϡ¢¥×¥í¥°¥é¥à̾¤Î¸å¤Ë +¥³¥í¥ó¡¦\fIfilename\fR ¤ÎÃÍ¡¦¥³¥í¥ó¡¦\fIlinenum\fR ¤ÎÃͤ¬½ñ¤­½Ð¤µ¤ì¤ë°Ê³°¤Ï¡¢ +.BR error () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.\"O The preprocessor values \fB__LINE__\fP and +.\"O \fB__FILE__\fP may be useful when calling +.\"O .BR error_at_line (), +.\"O but other values can also be used. +.\"O For example, these arguments could refer to a location in an input file. +¥×¥ê¥×¥í¥»¥Ã¥µ¤ÎÃÍ \fB__LINE__\fP ¤È \fB__FILE__\fP ¤Ï¡¢ +.BR error_at_line () +¤ò¸Æ¤Ó½Ð¤¹¤È¤­¤ËÌò¤ËΩ¤Ä¡£ +¤½¤Î¾¤Î¥×¥ê¥×¥í¥»¥Ã¥µ¤ÎÃͤâ»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +Î㤨¤Ð¡¢¤³¤ì¤é¤Î°ú¤­¿ô¤ÇÆþÎÏ¥Õ¥¡¥¤¥ë¤Ë¤ª¤±¤ë°ÌÃÖ¤ò»²¾È¤Ç¤­¤ë¡£ + +.\"O If the global variable \fIerror_one_per_line\fP is set nonzero, +.\"O a sequence of +.\"O .BR error_at_line () +.\"O calls with the +.\"O same value of \fIfilename\fP and \fIlinenum\fP will result in only +.\"O one message (the first) being output. +Âç°èÊÑ¿ô \fIerror_one_per_line\fP ¤¬ 0 °Ê³°¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +\fIfilename\fP ¤È \fIlinenum\fP ¤ÎÃͤ¬¶¦¤ËÅù¤·¤¤ +.BR error_at_line () +¤Î¸Æ¤Ó½Ð¤·¤Ï¡¢ +1 ¤Ä¤Î (ºÇ½é¤Î) ¥á¥Ã¥»¡¼¥¸¤Î½ÐÎϤˤޤȤá¤é¤ì¤ë¡£ + +.\"O The global variable \fIerror_message_count\fP counts the number of +.\"O messages that have been output by +.\"O .BR error () +.\"O and +.\"O .BR error_at_line (). +Âç°èÊÑ¿ô \fIerror_message_count\fP ¤Ï¡¢ +.BR error () +¤È +.BR error_at_line () +¤Ç½ÐÎϤµ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤Î¿ô¤òɽ¤¹¡£ + +.\"O If the global variable \fIerror_print_progname\fP +.\"O is assigned the address of a function +.\"O (i.e., is not NULL), then that function is called +.\"O instead of prefixing the message with the program name and colon. +.\"O The function should print a suitable string to +.\"O .IR stderr . +Âç°èÊÑ¿ô \fIerror_print_progname\fP ¤Ë +´Ø¿ô¤Î¥¢¥É¥ì¥¹¤¬³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¾ì¹ç (¤Ä¤Þ¤ê NULL ¤Ç¤Ï¤Ê¤¤¾ì¹ç)¡¢ +¥á¥Ã¥»¡¼¥¸¤ÎÁ°¤Ë¥×¥í¥°¥é¥à̾¤È¥³¥í¥ó¤ò½ñ¤­½Ð¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¡£ +¤³¤Î´Ø¿ô¤Ïɸ½à¥¨¥é¡¼½ÐÎÏ +.RI ( stderr ) +¤ËÂФ·¤Æ¤ÎŬÀÚ¤Êʸ»úÎó¤ò½ñ¤­½Ð¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These functions and variables are GNU extensions, and should not be +.\"O used in programs intended to be portable. +¤³¤ì¤é¤Î´Ø¿ô¤ÈÊÑ¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ê¡¢ +°Ü¿¢À­¤ò¹Í¤¨¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR err (3), +.BR errno (3), +.BR exit (3), +.BR perror (3), +.BR program_invocation_name (3), +.BR strerror (3) diff --git a/draft/man3/ether_aton.3 b/draft/man3/ether_aton.3 new file mode 100644 index 00000000..7495d31f --- /dev/null +++ b/draft/man3/ether_aton.3 @@ -0,0 +1,200 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 2002 Ian Redfern (redferni@logica.com) +.\" +.\" 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 +.\" FreeBSD 4.4 man pages +.\" +.\" Minor additions, aeb, 2002-07-20 +.\" +.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Aug 22 2002 by Akihiro MOTOKI +.\" +.TH ETHER_ATON 3 2002-07-20 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ether_aton, ether_ntoa, ether_ntohost, ether_hostton, ether_line, +.\"O ether_ntoa_r, ether_aton_r \- Ethernet address manipulation routines +ether_aton, ether_ntoa, ether_ntohost, ether_hostton, ether_line, +ether_ntoa_r, ether_aton_r \- Ethernet ¥¢¥É¥ì¥¹¤ÎÁàºîÍÑ´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *ether_ntoa(const struct ether_addr *" addr ); +.sp +.BI "struct ether_addr *ether_aton(const char *" asc ); +.sp +.BI "int ether_ntohost(char *" hostname ", const struct ether_addr *" addr ); +.sp +.BI "int ether_hostton(const char *" hostname ", struct ether_addr *" addr ); +.sp +.BI "int ether_line(const char *" line ", struct ether_addr *" addr , +.BI " char *" hostname ); +.sp +.\"O /* GNU extensions */ +/* GNU ³ÈÄ¥ */ +.br +.BI "char *ether_ntoa_r(const struct ether_addr *" addr ", char *" buf ); +.sp +.BI "struct ether_addr *ether_aton_r(const char *" asc , +.BI " struct ether_addr *" addr ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR ether_aton () +.\"O converts the 48-bit Ethernet host address \fIasc\fP +.\"O from the standard hex-digits-and-colons notation into binary data in +.\"O network byte order and returns a pointer to it in a statically +.\"O allocated buffer, which subsequent calls will +.\"O overwrite. +.\"O .BR ether_aton () +.\"O returns NULL if the address is invalid. +´Ø¿ô +.BR ether_aton () +¤Ï¡¢É¸½àŪ¤Ê 16¿Ê¿ô¤È¥³¥í¥ó¤Î·Á¼°¤Ç½ñ¤«¤ì¤¿ 48¥Ó¥Ã¥È¤Î +Ethernet ¥Û¥¹¥È¥¢¥É¥ì¥¹ \fIasc\fP ¤ò¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤Ç¤Î¥Ð¥¤¥È½ç (byte order) +¤Î¥Ð¥¤¥Ê¥ê¥Ç¡¼¥¿¤ËÊÑ´¹¤·¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤¿¥Ç¡¼¥¿ +¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¡¢¤³¤ì°Ê¹ß¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¡£ +¥¢¥É¥ì¥¹¤¬ÉÔÀµ¤Ê¾ì¹ç¡¢ +.BR ether_aton () +¤Ï NULL ¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR ether_ntoa () +.\"O function converts the Ethernet host address +.\"O \fIaddr\fP given in network byte order to a string in standard +.\"O hex-digits-and-colons notation, omitting leading zeros. +.\"O The string is returned in a statically allocated buffer, +.\"O which subsequent calls will overwrite. +´Ø¿ô +.BR ether_ntoa () +¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤Î¥Ð¥¤¥È½ç¤Çɽ¤µ¤ì¤¿ Ethernet +¥Û¥¹¥È¥¢¥É¥ì¥¹ \fIaddr\fP ¤ò¡¢É¸½àŪ¤Ê 16¿Ê¿ô¤È¥³¥í¥ó¤Î·Á¼°¤Îʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£ +⤷¡¢ÀèƬ¤Î 0 ¤Ï¾Êά¤µ¤ì¤ë¡£ÊÑ´¹¸å¤Îʸ»úÎó¤ÏÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡ +¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¡¢¤³¤ì°Ê¹ß¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR ether_ntohost () +.\"O function maps an Ethernet address to the +.\"O corresponding hostname in +.\"O .I /etc/ethers +.\"O and returns nonzero if it cannot be found. +´Ø¿ô +.BR ether_ntohost () +¤Ï¡¢Ethernet ¥¢¥É¥ì¥¹¤ËÂбþ¤¹¤ë¥Û¥¹¥È̾¤ò +.I /etc/ethers +¤ò¸¡º÷¤·¤Æ³ä¤êÅö¤Æ¤ë¡£Âбþ¤¹¤ë¥Û¥¹¥È̾¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +Èó 0 ¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR ether_hostton () +.\"O function maps a hostname to the +.\"O corresponding Ethernet address in +.\"O .I /etc/ethers +.\"O and returns nonzero if it cannot be found. +´Ø¿ô +.BR ether_hostton () +¤Ï¡¢¥Û¥¹¥È̾¤ËÂбþ¤¹¤ë Ethernet ¥¢¥É¥ì¥¹¤ò +.I /etc/ethers +¤ò¸¡º÷¤·¤Æ³ä¤êÅö¤Æ¤ë¡£Âбþ¤¹¤ë¥Û¥¹¥È̾¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +Èó 0 ¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR ether_line () +.\"O function parses a line in +.\"O .I /etc/ethers +.\"O format (ethernet address followed by whitespace followed by +.\"O hostname; \(aq#\(aq introduces a comment) and returns an address +.\"O and hostname pair, or nonzero if it cannot be parsed. +.\"O The buffer pointed to by +.\"O .I hostname +.\"O must be sufficiently long, for example, have the same length as +.\"O .IR line . +´Ø¿ô +.BR ether_line () +¤Ï¡¢ +.I /etc/ethers +·Á¼°¤Ë¤Ê¤Ã¤¿¹Ô¤ò²òÀϤ·¡¢ +¥¢¥É¥ì¥¹¤È¥Û¥¹¥È̾¤ÎÁȤòÊÖ¤¹ +.RI ( /etc/ethers +·Á¼°¤Ï¡¢Ethernet ¥¢¥É¥ì¥¹¡¢¥Û¥¹¥È̾¤¬¶õÇòʸ»ú (whitespace) +¤Ç¶èÀÚ¤é¤ì¤¿½ñ¼°¤Ç¡¢\(aq#\(aq °Ê¹ß¤Ï¥³¥á¥ó¥È¤È¤ß¤Ê¤µ¤ì¤ë)¡£ +²òÀϤǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢Èó 0 ¤òÊÖ¤¹¡£ +.I hostname +¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ï½½Ê¬¤ÊŤµ¤¬É¬ÍפǤ¢¤ë¡£¤Ä¤Þ¤ê¡¢ +.I line +¤ÈƱ¤¸Ä¹¤µ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The functions +.\"O .BR ether_ntoa_r () +.\"O and +.\"O .BR ether_aton_r () +.\"O are reentrant +.\"O thread-safe versions of \fBether_ntoa\fP() and +.\"O .BR ether_aton () +.\"O respectively, and do not use static buffers. +´Ø¿ô +.BR ether_ntoa_r () +¤È +.BR ether_aton_r () +¤Ï¡¢ +¤½¤ì¤¾¤ì +.BR ether_ntoa () +¤È +.BR ether_aton () +¤Î +¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ê¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ê¡¢ +ÀÅŪ¤Ê¥Ð¥Ã¥Õ¥¡¤ò»ÈÍѤ·¤Ê¤¤¡£ +.PP +.\"O The structure \fIether_addr\fP is defined in +.\"O .I +.\"O as: +\fIether_addr\fP ¹½Â¤ÂÎ¤Ï +.I +¤Ç¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct ether_addr { + uint8_t ether_addr_octet[6]; +} +.fi +.in +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD, SunOS. +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The glibc 2.2.5 implementation of +.\"O .BR ether_line () +.\"O is broken. +glibc 2.2.5 ¤Ç¤Î +.BR ether_line () +¤Î¼ÂÁõ¤Ï¤ª¤«¤·¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ethers (5) diff --git a/draft/man3/euidaccess.3 b/draft/man3/euidaccess.3 new file mode 100644 index 00000000..8097aef9 --- /dev/null +++ b/draft/man3/euidaccess.3 @@ -0,0 +1,140 @@ +.\" 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 2007-07-26 "" "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 +.B #define _GNU_SOURCE +.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 new file mode 100644 index 00000000..6968dd31 --- /dev/null +++ b/draft/man3/exec.3 @@ -0,0 +1,359 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)exec.3 6.4 (Berkeley) 4/19/91 +.\" +.\" Converted for Linux, Mon Nov 29 11:12:48 1993, faith@cs.unc.edu +.\" Updated more for Linux, Tue Jul 15 11:54:18 1997, pacman@cqc.com +.\" 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 +.\" +.\"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 (¥×¥í¥°¥é¥à¤Î)Æ°ºî +.\" +.TH EXEC 3 2009-02-22 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O execl, execlp, execle, execv, execvp \- execute a file +execl, execlp, execle, execv, execvp \- ¥Õ¥¡¥¤¥ë¤ò¼Â¹Ô¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B extern char **environ; +.sp +.BI "int execl(const char *" path ", const char *" arg ", ...);" +.br +.BI "int execlp(const char *" file ", const char *" arg ", ...);" +.br +.BI "int execle(const char *" path ", const char *" arg , +.br +.BI " ..., char * const " envp "[]);" +.br +.BI "int execv(const char *" path ", char *const " argv "[]);" +.br +.BI "int execvp(const char *" file ", char *const " argv "[]);" +.\"O .SH DESCRIPTION +.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) +¤Î¥Þ¥Ë¥å¥¢¥ë¤ò»²¾È) +.PP +.\"O The initial argument for these functions is the pathname of a file which 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" +¤È¥­¥ã¥¹¥È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR execv () +.\"O and +.\"O .BR execvp () +.\"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 () +¤Ï¡¢ÍøÍѲÄǽ¤Ê°ú¤­¿ô¥ê¥¹¥È (NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î +¥Ý¥¤¥ó¥¿¤ÎÇÛÎó) ¤ò¿·¤·¤¤¥×¥í¥°¥é¥à¤ËÅϤ¹¡£ +´·½¬¤È¤·¤Æ¡¢ºÇ½é¤Î°ú¤­¿ô¤Ï¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë̾¤Ø +¤Î¥Ý¥¤¥ó¥¿¤Ë¤¹¤ë¡£¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Ïɬ¤º +NULL ¤Ç½ª¤ï¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR execle () +.\"O function also specifies the environment of the executed process by following +.\"O the NULL +.\"O pointer that terminates the list of arguments in the argument list or the +.\"O pointer to the +.\"O .I argv +.\"O array with an additional argument. +.\"O This additional +.\"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 current process. +´Ø¿ô +.BR execle () +¤Ç¤Ï¿·¤·¤¤¥×¥í¥»¥¹¤Î´Ä¶­¤â»ØÄꤹ¤ë¡£ +´Ä¶­¤Ï°ú¤­¿ô¥ê¥¹¥È (°ú¤­¿ô¥ê¥¹¥È¤â¤·¤¯¤ÏÄɲäΰú¤­¿ô¤ò»ý¤Ã¤¿ +.I argv +ÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿) ¤ÎºÇ¸å¤Î NULL ¥Ý¥¤¥ó¥¿¤Ë³¤±¤Æ»ØÄꤹ¤ë¡£ +Äɲäΰú¤­¿ô¤Ï¡¢NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Ç¤¢¤ê¡¢ +NULL ¥Ý¥¤¥ó¥¿¤Ç½ª¤ï¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¾¤Î´Ø¿ô¤Ç¤Ï¡¢¸½ºß¤Î¥×¥í¥»¥¹¤Î³°ÉôÊÑ¿ô +.B environ +¤«¤é¿·¤·¤¤¥×¥í¥»¥¹ÍѤδĶ­¤òÍ¿¤¨¤ë¡£ +.\"O .SS Special semantics for execlp() and execvp() +.SS execlp() ¤È execvp() ¤ÎÆÃÊ̤ÊÆ°ºî +.PP +.\"O The functions +.\"O .BR execlp () +.\"O and +.\"O .BR execvp () +.\"O will duplicate the actions of the shell in searching for an executable file +.\"O if the specified filename does not contain a slash (/) character. +.\"O The search path is the path specified in the environment by the +.\"O .B PATH +.\"O variable. +.\"O If this variable isn't specified, the default path +.\"O ":/bin:/usr/bin" is used. +.\"O In addition, certain +.\"O errors are treated specially. +´Ø¿ô +.BR execlp () +¤È +.BR execvp () +¤Ï¡¢»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤¬¥¹¥é¥Ã¥·¥å (/) ¤ò´Þ¤ó¤Ç¤¤¤Ê¤¤¾ì¹ç¡¢ +¥·¥§¥ë¤ÈƱ¤¸Æ°ºî¤Ç¼Â¹Ô²Äǽ¤Ê¥Õ¥¡¥¤¥ë¤òõº÷¤¹¤ë¡£ +¸¡º÷¥Ñ¥¹¤Ï´Ä¶­ÊÑ¿ô +.B PATH +¤Ç»ØÄꤵ¤ì¤¿¥Ñ¥¹¤Ç¤¢¤ë¡£ +¤³¤ÎÊÑ¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥ÈPATH¤È¤·¤Æ +":/bin:/usr/bin" ¤¬»ÈÍѤµ¤ì¤ë¡£ +¤Þ¤¿¡¢¤¤¤¯¤Ä¤«¤Î¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Î°·¤¤¤¬Æüì¤Ç¤¢¤ë¡£ +.PP +.\"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 +¤òÀßÄꤷÉüµ¢¤¹¤ë¡£ +.\" fujiwara: ¸Ä¿ÍŪ¤Ë¤Ï¡ÖÉüµ¢¤¹¤ë¡×¤ÎÊý¤¬¹¥¤­(^_^; +.PP +.\"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" +.SH ÊÖ¤êÃÍ +.\"O If any of the +.\"O .BR exec () +.\"O functions returns, an error will have occurred. +.\"O The return value is \-1, and +.\"O .I errno +.\"O will be set to indicate the error. +¤â¤· +.BR exec () +¥Õ¥¡¥ß¥ê¡¼¤¬Éüµ¢¤·¤Æ¤­¤¿¾ì¹ç¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤¤¤ë¡£ +ÊÖ¤êÃÍ¤Ï \-1 ¤Ç¡¢ +.I errno +¤Ë¤½¤Î¥¨¥é¡¼¤ÎÆâÍƤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O All of these functions may fail and set +.\"O .I errno +.\"O for any of the errors specified for the library function +.\"O .BR execve (2). +¤³¤ì¤éÁ´¤Æ¤Î´Ø¿ô¤Ï¼ºÇÔ¤¹¤ë¾ì¹ç¤¬¤¢¤ë¡£¤½¤Î¾ì¹ç¥é¥¤¥Ö¥é¥ê´Ø¿ô +.BR execve (2) +¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥¨¥é¡¼¤ò +.I errno +¤ËÀßÄꤹ¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.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 ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¤Ë¡¢ÀΤʤ¬¤é¤Î¡Ö¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò +Àè¤Ëõº÷¡×¤È¤¤¤¦¥ë¡¼¥ë¤ò»È¤Ã¤Æ¤¤¤ë¡£ +.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 ¤Ï¤½¤ì¤ò¥Ï¡¼¥É¥¨¥é¡¼¤È¤·¤Æ¼è¤ê°·¤¤Â¨ºÂ¤ËÉüµ¢¤¹¤ë¡£ +.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" +.SH ´ØÏ¢¹àÌÜ +.BR sh (1), +.BR execve (2), +.BR fork (2), +.BR ptrace (2), +.BR fexecve (3), +.BR environ (7) diff --git a/draft/man3/exit.3 b/draft/man3/exit.3 new file mode 100644 index 00000000..da4a80da --- /dev/null +++ b/draft/man3/exit.3 @@ -0,0 +1,300 @@ +.\" 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 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 +.SH ̾Á° +.\"O exit \- cause normal process termination +exit \- ¥×¥í¥»¥¹¤ÎÀµ¾ï½ªÎ» +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void exit(int " status ); +.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) +¤ò»²¾È)¡£ +.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) +¤ò»È¤Ã¤ÆÊ£¿ô²óÅÐÏ¿¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢ +¤½¤Î´Ø¿ô¤ÏÅÐÏ¿¤µ¤ì¤¿¤Î¤ÈƱ¤¸²ó¿ô¤À¤±¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.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) +¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ïºï½ü¤µ¤ì¤ë¡£ +.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" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR exit () +.\"O function does not return. +.BR exit () +´Ø¿ô¤ÏÊÖ¤é¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001, C89, C99. +.\"O .SH NOTES +.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) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢ +²¿¤¬µ¯¤³¤ë¤«¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.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 ¤ÏÊ̤ÎÊý¼°¤òÍѤ¤¤Æ¤¤¤ë¡£ +.LP +.\"O BSD has attempted to standardize exit codes; see the file +.\"O .IR . +BSD ¤Ï½ªÎ»¥³¡¼¥É¤òɸ½à²½¤·¤è¤¦¤È¤·¤Æ¤¤¤ë; +.I +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.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) +´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢ +¿Æ¥×¥í¥»¥¹¤Ï½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤òÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.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 +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¤«¤É¤¦¤«¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.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 +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¡¢Ã¼Ëö¤¬¥»¥Ã¥·¥ç¥ó¤«¤éÀÚ¤êÎ¥¤µ¤ì¤ë¡£ +¤³¤ì¤Ë¤è¤ê¿·¤·¤¤À©¸æ¥×¥í¥»¥¹¤ò¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.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" +.SH ´ØÏ¢¹àÌÜ +.BR _exit (2), +.BR setpgid (2), +.BR wait (2), +.BR atexit (3), +.BR on_exit (3), +.BR tmpfile (3) diff --git a/draft/man3/exp.3 b/draft/man3/exp.3 new file mode 100644 index 00000000..66c336ba --- /dev/null +++ b/draft/man3/exp.3 @@ -0,0 +1,191 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 Mon Sep 7 23:27:52 JST 2003 +.\" by Akihiro MOTOKI +.\" Updated 2008-09-16, Akihiro MOTOKI +.\" +.TH EXP 3 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O exp, expf, expl \- base-e exponential function +exp, expf, expl \- Ä줬 e ¤Î»Ø¿ô´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double exp(double " x ); +.br +.BI "float expf(float " x ); +.br +.BI "long double expl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR expf (), +.BR expl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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 +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the exponential value of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï e ¤Î +.I x +¾è¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, +.\"O a NaN is returned. +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is positive infinity, +.\"O positive infinity is returned. +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is negative infinity, +.\"O +0 is returned. +.I x +¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If the result underflows, +.\"O a range error occurs, +.\"O and zero is returned. +·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ +ÈÏ°Ï¥¨¥é¡¼ (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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Range error, 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 ) +¤¬¾å¤¬¤ë¡£ +.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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR cexp (3), +.BR exp10 (3), +.BR exp2 (3), +.BR sqrt (3) diff --git a/draft/man3/exp10.3 b/draft/man3/exp10.3 new file mode 100644 index 00000000..a9ab4def --- /dev/null +++ b/draft/man3/exp10.3 @@ -0,0 +1,115 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 +.\" +.TH EXP10 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O exp10, exp10f, exp10l \- base-10 exponential function +exp10, exp10f, exp10l \- ´ð¿ô¤¬ 10 ¤Î»Ø¿ô´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "double exp10(double " x ); +.br +.BI "float exp10f(float " x ); +.br +.BI "long double exp10l(long double " x ); +.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 +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the base-10 exponential value of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï 10 ¤Î +.I x +¾è¤òÊÖ¤¹¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"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 +.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), +.BR feature_test_macros (7) diff --git a/draft/man3/exp2.3 b/draft/man3/exp2.3 new file mode 100644 index 00000000..fc691a1a --- /dev/null +++ b/draft/man3/exp2.3 @@ -0,0 +1,131 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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:27:35 JST 2003 +.\" by Akihiro MOTOKI +.\" +.TH EXP2 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O exp2, exp2f, exp2l \- base-2 exponential function +exp2, exp2f, exp2l \- Ä줬 2 ¤Î»Ø¿ô´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double exp2(double " x ); +.br +.BI "float exp2f(float " x ); +.br +.BI "long double exp2l(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR exp2 (), +.BR exp2f (), +.BR exp2l (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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 +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the base-2 exponential value of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï 2 ¤Î +.I x +¾è¤òÊÖ¤¹¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"O For a discussion of the errors that can occur for these functions, see +.\"O .BR exp (3). +¤³¤ì¤é¤Î´Ø¿ô¤ÇȯÀ¸¤¹¤ë¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR exp (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"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 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" +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR cexp2 (3), +.BR exp (3), +.BR exp10 (3), +.BR sqrt (3) diff --git a/draft/man3/expm1.3 b/draft/man3/expm1.3 new file mode 100644 index 00000000..592111e4 --- /dev/null +++ b/draft/man3/expm1.3 @@ -0,0 +1,213 @@ +.\" Copyright 1995 Jim Van Zandt +.\" 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. +.\" +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O expm1, expm1f, expm1l \- exponential minus 1 +expm1, expm1f, expm1l \- °ú¤­¿ô¤Î»Ø¿ô¤«¤é 1 ¤ò°ú¤¤¤¿ÃÍ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double expm1(double " x ); +.br +.BI "float expm1f(float " x ); +.br +.BI "long double expm1l(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR expm1 (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR expm1f (), +.BR expm1l (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .I expm1(x) +.\"O returns a value equivalent to +.BI expm1( x ) +¤Ï°Ê²¼¤ÈÅù¤·¤¤ÃͤòÊÖ¤¹¡£ +.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. +\fIx\fP ¤¬ 0 ¤Ë¶á¤¯¡¢ +.I "exp(x) \- 1" +¤¬°ú¤­»»»þ¤Î·åÍî¤Á¤Î¤¿¤á¤ËÉÔÀµ³Î¤È¤Ê¤ë¤è¤¦¤Ê¾ì¹ç¤Ç¤â¡¢ +Àµ³Î¤ÊÃͤ¬·×»»¤Ç¤­¤ëÊýË¡¤¬ÍѤ¤¤é¤ì¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return +.\"O .IR "exp(x)\ \-\ 1" . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I "exp(x)\ \-\ 1" +¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, +.\"O a NaN is returned. +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is +0 (\-0), +.\"O +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 +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is negative infinity, \-1 is returned. +.I x +¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢\-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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Range error, overflow +ÈÏ°Ï¥¨¥é¡¼ (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 ) +¤¬¾å¤¬¤ë¡£ +.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=6788 +.\" +.\" +.\" POSIX.1 specifies an optional range error (underflow) if +.\" x is subnormal. Glibc does not implement this. +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99, POSIX.1-2001. +.\" BSD. +.\"O .SH BUGS +.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 + +.\"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. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR exp (3), +.BR log (3), +.BR log1p (3) diff --git a/draft/man3/fabs.3 b/draft/man3/fabs.3 new file mode 100644 index 00000000..f14daf03 --- /dev/null +++ b/draft/man3/fabs.3 @@ -0,0 +1,127 @@ +.\" 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 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 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fabs, fabsf, fabsl \- absolute value of floating-point number +fabs, fabsf, fabsl \- ÉâÆ°¾®¿ôÅÀ¼Â¿ô¤ÎÀäÂÐÃÍ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double fabs(double " x ); +.br +.BI "float fabsf(float " x ); +.br +.BI "long double fabsl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR fabsf (), +.BR fabsl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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 +.SH ÊÖ¤êÃÍ +.\"O These functions return the absolute value of +.\"O .IR x . +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÀäÂÐÃͤòÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is \-0, +0 is returned. +.I x +¤¬ \-0 ¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is negative infinity or positive infinity, positive infinity is returned. +.I x +¤¬Éé¤Î̵¸ÂÂ礫Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.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" +.SH ´ØÏ¢¹àÌÜ +.BR abs (3), +.BR cabs (3), +.BR ceil (3), +.BR floor (3), +.BR labs (3), +.BR rint (3) diff --git a/draft/man3/fclose.3 b/draft/man3/fclose.3 new file mode 100644 index 00000000..24f9f736 --- /dev/null +++ b/draft/man3/fclose.3 @@ -0,0 +1,165 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fclose.3 6.7 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:19:14 1993, faith@cs.unc.edu +.\" +.\" Modified 2000-07-22 by Nicolas Lichtmaier +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated Mon Jan 20 18:30:47 JST 1997 +.\" by Takashi Yoshino +.\" Updated Mon Sep 25 01:58:44 JST 2000 +.\" by Kentaro Shirakata +.\" Updated & Modified Tue Apr 3 20:49:00 JST 2001 +.\" by Yuichi SATO +.\" Updated & Modified Mon Jan 10 08:08:29 JST 2005 +.\" by Yuichi SATO +.\" +.TH FCLOSE 3 2009-02-23 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fclose \- close a stream +fclose \- ¥¹¥È¥ê¡¼¥à¤òÊĤ¸¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int fclose(FILE *" fp ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR fclose () +.\"O function will flushes the stream pointed to by +.\"O .I fp +.\"O (writing any buffered output data using +.\"O .BR fflush (3)) +.\"O and closes the underlying file descriptor. +.BR fclose () +´Ø¿ô¤Ï +.I fp +¤Ç»Ø¤µ¤ì¤ë¥¹¥È¥ê¡¼¥à¤ò (¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤¿Á´¤Æ¤Î½ÐÎϥǡ¼¥¿¤ò +.BR fflush (3) +¤òÍѤ¤¤Æ½ñ¤­¹þ¤ó¤Ç) ¥Õ¥é¥Ã¥·¥å¤·¡¢ +¤½¤Î´ð¤È¤Ê¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.\"O .SH "RETURN VALUES" +.SH ÊÖ¤êÃÍ +.\"O Upon successful completion 0 is returned. +´Ø¿ô¤¬Àµ¾ï¤Ë½ªÎ»¤¹¤ë¤È 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O Otherwise, +.\"O .B EOF +.\"O is returned and +.\"O .I errno +.\"O is set to indicate the error. +Àµ¾ï¤Ë½ªÎ»¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï +.B EOF +¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¥¨¥é¡¼¤ò¼¨¤¹¤¿¤á¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O In either case any further access +.\"O (including another call to +.\"O .BR fclose ()) +.\"O to the stream results in undefined behavior. +¤É¤Á¤é¤Î¾ì¹ç¤â¡¢¤½¤Î¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ë +.RB ( fclose () +¤Ø¤Î¤µ¤é¤Ê¤ë¸Æ¤Ó½Ð¤·¤ò´Þ¤à) ¤½¤ì°Ê¾å¤Î¥¢¥¯¥»¥¹¤Ï +̤ÄêµÁ¤ÎÆ°ºî¤òÀ¸¤¸¤µ¤»¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O The file descriptor underlying +.\"O .I fp +.\"O is not valid. +.I fp +¤Î´ð¤È¤Ê¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.\"O .\" This error cannot occur unless you are mixing ANSI C stdio operations and +.\"O .\" low-level file operations on the same stream. If you do get this error, +.\"O .\" you must have closed the stream's low-level file descriptor using +.\"O .\" something like close(fileno(fp)). +.\" Ʊ¤¸¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ ANSI C stdio ¤ÎÁàºî¤ÈÄã¥ì¥Ù¥ë¥Õ¥¡¥¤¥ëÁàºî¤ò +.\" ¼è¤êº®¤¼¤Æ¹Ô¤ï¤Ê¤¤¸Â¤ê¡¢¤³¤Î¥¨¥é¡¼¤Ïµ¯¤³¤é¤Ê¤¤¡£ +.\" ¤³¤Î¥¨¥é¡¼¤ò¼õ¤±¼è¤Ã¤¿¤Î¤Ï¡¢¥¹¥È¥ê¡¼¥à¤ÎÄã¥ì¥Ù¥ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¡¢ +.\" close(fileno(fp)) ¤Ê¤É¤Ç¡¢´û¤Ë¥¯¥í¡¼¥º¤·¤Æ¤·¤Þ¤Ã¤¿¤«¤é¤Ë°ã¤¤¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR fclose () +.\"O function may also fail and set +.\"O .I errno +.\"O for any of the errors specified for the routines +.\"O .BR close (2), +.\"O .BR write (2) +.\"O or +.\"O .BR fflush (3). +.BR fclose () +´Ø¿ô¤Ï¤³¤ì°Ê³°¤Ë¤â +.BR close (2), +.BR write (2), +.BR fflush (3) +¤Î¥ë¡¼¥Á¥ó¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ë¡£¤½¤Î¾ì¹ç¤Ï +.I errno +¤¬¡¢¼ºÇÔ¤·¤¿¥ë¡¼¥Á¥ó¤ÇÀßÄꤵ¤ì¤¿ÃͤËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C89, C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Note that +.\"O .BR fclose () +.\"O only flushes the user space buffers provided by the +.\"O C library. +.\"O To ensure that the data is physically stored +.\"O on disk the kernel buffers must be flushed too, for example, with +.\"O .BR sync (2) +.\"O or +.\"O .BR fsync (2). +.BR fclose () +¤Ï C ¥é¥¤¥Ö¥é¥ê¤ÇÄ󶡤µ¤ì¤¿¥æ¡¼¥¶¡¼¶õ´Ö¥Ð¥Ã¥Õ¥¡¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¤À¤±¤Ç +¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¥Ç¡¼¥¿¤ò³Î¼Â¤ËʪÍýŪ¤Ë¥Ç¥£¥¹¥¯¤Ëµ­Ï¿¤¹¤ë¤¿¤á¤Ë¤Ï +¥«¡¼¥Í¥ë¥Ð¥Ã¥Õ¥¡¤â +.RB ( sync (2) +¤ä +.BR fsync (2) +¤òÍѤ¤¤Æ) ¥Õ¥é¥Ã¥·¥å¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR fcloseall (3), +.BR fflush (3), +.BR fopen (3), +.BR setbuf (3) diff --git a/draft/man3/fcloseall.3 b/draft/man3/fcloseall.3 new file mode 100644 index 00000000..29cea476 --- /dev/null +++ b/draft/man3/fcloseall.3 @@ -0,0 +1,92 @@ +.\" Copyright (c) 2006 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. +.\" License. +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated 2000-06-24, Yuichi SATO +.\" Updated 2007-05-04, Akihiro MOTOKI , LDP v2.46 +.\" +.\"WORD: standard streams ɸ½àÆþ½ÐÎÏ +.\" +.TH FCLOSEALL 3 2006-12-27 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fcloseall \- close all open streams +fcloseall \- ³«¤¤¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î¥¹¥È¥ê¡¼¥à¤òÊĤ¸¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.B int fcloseall(void); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR fcloseall () +.\"O function closes all of the calling process's open streams. +.\"O Buffered output for each stream is written before it is closed +.\"O (as for +.\"O .BR fflush (3)); +.\"O buffered input is discarded. +.BR fcloseall () +´Ø¿ô¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬³«¤¤¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î¥¹¥È¥ê¡¼¥à¤òÊĤ¸¤ë¡£ +¥¹¥È¥ê¡¼¥à¤òÊĤ¸¤ëÁ°¤Ë¡¢ +.RB ( fflush (3) +¤ÈƱ¤¸¤è¤¦¤Ë) ³Æ¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¤Ëί¤Ã¤Æ¤¤¤ë½ÐÎϥǡ¼¥¿¤Ï½ñ¤­½Ð¤µ¤ì¤ë¡£ +ÆþÎϥХåե¡Æâ¤Î¥Ç¡¼¥¿¤ÏÇË´þ¤µ¤ì¤ë¡£ + +.\"O The standard streams, +.\"O .IR stdin , +.\"O .IR stdout , +.\"O and +.\"O .I stderr +.\"O are also closed. +ɸ½àÆþ½ÐÎÏ +.IR stdin , +.IR stdout , +.I stderr +¤âÊĤ¸¤é¤ì¤ë¡£ +.\"O .SH "RETURN VALUES" +.SH ÊÖ¤êÃÍ +.\"O This function returns 0 if all files were successfully closed; +.\"O on error, +.\"O .B EOF +.\"O is returned. +¤³¤Î´Ø¿ô¤Ï¡¢¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤¬Àµ¾ï¤ËÊĤ¸¤é¤ì¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.B EOF +¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is a GNU extension. +¤³¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR fclose (3), +.BR fflush (3), +.BR fopen (3), +.BR setbuf (3), +.BR feature_test_macros (7) diff --git a/draft/man3/fdim.3 b/draft/man3/fdim.3 new file mode 100644 index 00000000..829404da --- /dev/null +++ b/draft/man3/fdim.3 @@ -0,0 +1,120 @@ +.\" Copyright 2003 Walter Harms, Andries Brouwer +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fdim, fdimf, fdiml \- positive difference +fdim, fdimf, fdiml \- Àµ¤Îº¹Ê¬¤ò·×»»¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double fdim(double " x ", double " y ); +.br +.BI "float fdimf(float " x ", float " y ); +.br +.BI "long double fdiml(long double " x ", long double " y ); +.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) +»²¾È): +.in +.sp +.ad l +.BR fdimf (), +.BR fdiml (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 +.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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Range error: result overflow +ÈÏ°Ï¥¨¥é¡¼ (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 ) +¤¬¾å¤¬¤ë¡£ +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR fmax (3) diff --git a/draft/man3/fenv.3 b/draft/man3/fenv.3 new file mode 100644 index 00000000..603a9ba8 --- /dev/null +++ b/draft/man3/fenv.3 @@ -0,0 +1,564 @@ +.\" Copyright (c) 2000 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. +.\" +.\" 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 ÆâÉô¤Î +.\" +.TH FENV 3 2008-08-11 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int feclearexcept(int " excepts ); +.br +.BI "int fegetexceptflag(fexcept_t *" flagp ", int " excepts ); +.br +.BI "int feraiseexcept(int " excepts ); +.br +.BI "int fesetexceptflag(const fexcept_t *" flagp ", int " excepts ); +.br +.BI "int fetestexcept(int " excepts ); +.sp +.B "int fegetround(void);" +.br +.BI "int fesetround(int " rounding_mode ); +.sp +.BI "int fegetenv(fenv_t *" envp ); +.br +.BI "int feholdexcept(fenv_t *" envp ); +.br +.BI "int fesetenv(const fenv_t *" envp ); +.br +.BI "int feupdateenv(const fenv_t *" envp ); +.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 +.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 +Îã³°¤Ï¡¢Í­¸Â¤Î¿ôÃͤËÂФ¹¤ë±é»»¤¬¡¢ +̵¸ÂÂç¤ÎÅú¤¨¤òÀ¸À®¤¹¤ë¤è¤¦¤Ê¾ì¹ç¤Ëµ¯¤³¤ë¡£ +.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 +Îã³°¤Ï¡¢·ë²Ì¤¬ÉâÆ°¾®¿ôÅÀ¿ôÃͤÇɽµ­¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Î¤Ë¡¢ +¤½¤ÎÀäÂÐÃͤ¬É½¸½²Äǽ¤ÊÉâÆ°¾®¿ôÅÀ¿ô¤Î (Í­¸Â¤Î) ºÇÂçÃͤè¤ê¤â +(¤º¤Ã¤È) Â礭¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤è¤¦¤Ê¾ì¹ç¤Ëµ¯¤³¤ë¡£ +.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 +Îã³°¤Ï¡¢·ë²Ì¤¬ÉâÆ°¾®¿ôÅÀ¿ôÃͤÇɽµ­¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Î¤Ë¡¢ +¤½¤ÎÀäÂÐÃͤ¬Àµ¤ÎÀµµ¬²½ÉâÆ°¾®¿ôÅÀ¿ô¤ÎºÇ¾®Ãͤè¤ê¤â +¾®¤µ¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦ +(¤½¤·¤Æ ÈóÀµµ¬²½¿ô¤Çɽ¸½¤·¤¿¾ì¹ç¤ËÈó¾ï¤ËÀºÅÙ¤ò¼º¤Ã¤Æ¤·¤Þ¤¦) +¤è¤¦¤Ê¾ì¹ç¤Ëµ¯¤³¤ë¡£ +.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 +Îã³°¤¬µ¯¤­¤¿¤È¤­¤Ë¤Ï¡¢¾ï¤Ë¤³¤ÎÎã³°¤âµ¯¤³¤ë¡£ +.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" +.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 +¥Þ¥¯¥í¤Ï¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÎã³°¤ËÂбþ¤¹¤ë¥Ó¥Ã¥È¤¬Á´¤Æ¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë +(¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÎã³°Á´¤Æ¤ÎÏÀÍýϤǤ¢¤ë)¡£ +.PP +.\"O The +.\"O .BR feclearexcept () +.\"O function clears the supported exceptions represented by the bits +.\"O in its argument. +.BR feclearexcept () +´Ø¿ô¤Ï¡¢°ú¤­¿ô +.I excepts +¤Î¥Ó¥Ã¥ÈÎó¤Ç»ØÄꤵ¤ì¤¿Îã³°¤ò¥¯¥ê¥¢¤¹¤ë +(½èÍý¤Ï¼ÂÁõ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÎã³°¤Ë¤Ä¤¤¤Æ¤Î¤ß¹Ô¤ï¤ì¤ë)¡£ +.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 +¤¬»Ø¤¹ÆâÉô¥ª¥Ö¥¸¥§¥¯¥È¤ËÊݸ¤¹¤ë¡£ +.LP +.\"O The +.\"O .BR feraiseexcept () +.\"O function raises the supported exceptions represented by the bits in +.\"O .IR excepts . +.BR feraiseexcept () +´Ø¿ô¤Ï¡¢ +.I excepts +¤Î¥Ó¥Ã¥ÈÎó¤Ç»ØÄꤵ¤ì¤¿Îã³°¤Î¤¦¤Á¡¢ +¼ÂÁõ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤â¤Î¤òȯÀ¸¤µ¤»¤ë¡£ +.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 +¤Î¤¹¤Ù¤Æ¤Î¥Ó¥Ã¥È¤ò´Þ¤àÃͤò»ØÄꤹ¤ë¤³¤È)¡£ +.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 +.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 signifcand. +.\"O Various rounding modes may be provided: +.\"O round to nearest (the default), +.\"O round up (towards positive infinity), +.\"O round down (towards negative infinity), and +.\"O round towards zero. +´Ý¤á¥â¡¼¥É¤Ï¡¢·ë²Ì¤¬²¾¿ôÉô¤À¤±¤ÇÀµ³Î¤Ëɽ¸½¤Ç¤­¤Ê¤¤ºÝ¤Ë¡¢ +ÉâÆ°¾®¿ôÅÀÁàºî¤Î·ë²Ì¤ò¤É¤Î¤è¤¦¤Ë°·¤¦¤«¤ò·è¤á¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤µ¤Þ¤¶¤Þ¤Ê´Ý¤á¥â¡¼¥É¤òÄ󶡤¹¤ë¤³¤È¤¬¤Ç¤­¤ë: +ºÇ¤â¶á¤¤Ãͤ˴ݤá¤ë (¥Ç¥Õ¥©¥ë¥È)¡¢ +(Àµ¤Î̵¸ÂÂç¤Ë¸þ¤«¤Ã¤Æ) Â礭¤¯¤Ê¤ëÊý¸þ¤Ë´Ý¤á¤ë¡¢ +(Éé¤Î̵¸ÂÂç¤Ë¸þ¤«¤Ã¤Æ) ¾®¤µ¤¯¤Ê¤ëÊý¸þ¤Ë´Ý¤á¤ë¡¢ +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 +¤Î³Æ¥Þ¥¯¥í¤Ï¡¢¤½¤ì¤¾¤ìÂбþ¤¹¤ë´Ý¤á¤ÎÊý¸þ¤ò +¼ÂÁõ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç¤ËÄêµÁ¤µ¤ì¤ë¡£ +.LP +.\"O The +.\"O .BR fegetround () +.\"O function returns the macro corresponding to the current +.\"O rounding mode. +.BR fegetround () +´Ø¿ô¤Ï¸½ºß¤Î´Ý¤á¥â¡¼¥É¤ËÂбþ¤¹¤ë¥Þ¥¯¥í¤òÊÖ¤¹¡£ +.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 () +´Ø¿ô¤Ï´Ý¤á¥â¡¼¥É¤ò°ú¤­¿ô¤ËÍ¿¤¨¤é¤ì¤¿Ãͤˤ·¡¢ +À®¸ù¤·¤¿¤é¥¼¥í¤òÊÖ¤¹¡£ + +.\"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 +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£¤³¤Î¼±ÊÌ»Ò¤Ï +ÉâÆ°¾®¿ôÅÀ¿ô¤Î²Ã»»¤Ë¤Ä¤¤¤Æ¤Î¼ÂÁõÄêµÁ¤µ¤ì¤¿´Ý¤áÆ°ºî¤òɽ¤·¡¢ +°Ê²¼¤Î¤¤¤º¤ì¤«¤ÎÃͤò»ý¤Ä¡£ +.IP \-1 +.\"O The rounding mode is not determinable. +´Ý¤á¥â¡¼¥É¤Ï·è¤á¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +.IP 0 +.\"O Rounding is towards 0. +0 ¤Ë¸þ¤±¤Æ´Ý¤á¤ë¡£ +.IP 1 +.\"O Rounding is towards nearest number. +ºÇ¤â¶á¤¤¿ô¤Ë´Ý¤á¤ë¡£ +.IP 2 +.\"O Rounding is towards positive infinity. +Àµ¤Î̵¸ÂÂç¤Ë¸þ¤±¤Æ´Ý¤á¤ë¡£ +.IP 3 +.\"O Rounding is towards 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 () +¤ÇÀßÄꤵ¤ì¤¿¸½ºß¤Î´Ý¤á¥â¡¼¥É¤¬È¿±Ç¤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë +(⤷¡¢¡Ö¥Ð¥°¡×¤ÎÀá¤ò»²¾È)¡£ +.\"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) +(Îã³°¤¬µ¯¤­¤Æ¤â·Ñ³¤¹¤ë) ¥â¡¼¥É¤È¤¹¤ë¤è¤¦¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.LP +.\"O The +.\"O .BR fegetenv () +.\"O function saves the current floating-point environment in the object +.\"O .IR *envp . +.BR fegetenv () +´Ø¿ô¤Ï¡¢¸½ºß¤ÎÉâÆ°¾®¿ôÅÀ´Ä¶­¤ò¡¢¥ª¥Ö¥¸¥§¥¯¥È +.I *envp +¤ËÊݸ¤¹¤ë¡£ +.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 (Îã³°»þ¤Ë¤â¼Â¹Ô¤ò·Ñ³) ¥â¡¼¥É¤ËÀßÄꤹ¤ë¡£ +.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 +¤ËÅù¤·¤¤¤È¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤ÏÎã³°¤òȯÀ¸¤·¤Ê¤¤¡£ +.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" +.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. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢À®¸ù¤Î¾ì¹ç 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 +.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 glibc 2.2 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 ɸ½à¤ÏÉâÆ°¾®¿ôÅÀ¥Þ¥¹¥¯ (Î㤨¤ÐÆÃÄê¤Î¥Õ¥é¥°¤Ç¤Î¥È¥é¥Ã¥×¤Ê¤É) +¤Î³Æ¥Ó¥Ã¥È¤ÎÀßÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤ÏÄêµÁ¤·¤Æ¤¤¤Ê¤¤¡£ +glibc 2.2 ¤Ï +.BR feenableexcept () +´Ø¿ô¤È +.BR fedisableexcept () +´Ø¿ô¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤ª¤ê¡¢ +³Æ¡¹¤ÎÉâÆ°¾®¿ôÅÀ¥È¥é¥Ã¥×¤òÀßÄê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤Þ¤¿ +.BR fegetexcept () +¤Ë¤è¤Ã¤Æ¾õÂÖ¤ÎÌ䤤¹ç¤ï¤»¤â¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.sp +.nf +.B "#define _GNU_SOURCE" +.br +.B "#include " +.sp +.BI "int feenableexcept(int " excepts ); +.br +.BI "int fedisableexcept(int " excepts ); +.br +.B "int fegetexcept(void);" +.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 feenebleexcept () +´Ø¿ô¤È +.BR fedisableexcept () +´Ø¿ô¤Ï +.I excepts +¤Ë¤è¤Ã¤Æɽ¸½¤µ¤ì¤ë³ÆÎã³°¤Î¥È¥é¥Ã¥×¤òÍ­¸ú (̵¸ú) ¤Ë¤¹¤ë¡£ +À®¸ù¤·¤¿¾ì¹ç¤ÏľÁ°¤ËÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤¿Îã³°¤Î¥»¥Ã¥È¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.BR fegetexcept () +´Ø¿ô¤Ï¸½ºßÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëÎã³°Á´¤Æ¤«¤é¤Ê¤ë¥»¥Ã¥È¤òÊÖ¤¹¡£ +.\"O .SH BUGS +.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" +.SH ´ØÏ¢¹àÌÜ +.BR feature_test_macros (7), +.BR math_error (7) diff --git a/draft/man3/ferror.3 b/draft/man3/ferror.3 new file mode 100644 index 00000000..f62c4c66 --- /dev/null +++ b/draft/man3/ferror.3 @@ -0,0 +1,180 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)ferror.3 6.8 (Berkeley) 6/29/91 +.\" +.\" +.\" Converted for Linux, Mon Nov 29 14:24:40 1993, faith@cs.unc.edu +.\" Added remark on EBADF for fileno, aeb, 2001-03-22 +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Fri Dec 26 10:49:26 JST 1997 +.\" by HIROFUMI Nishizuka +.\" Updated Sat May 19 JST 2001 by Kentaro Shirakata +.\" Updated Fri Nov 2 JST 2001 by Kentaro Shirakata +.\" +.TH FERROR 3 2008-08-29 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O clearerr, feof, ferror, fileno \- check and reset stream status +clearerr, feof, ferror, fileno \- ¥¹¥È¥ê¡¼¥à¥¹¥Æ¡¼¥¿¥¹¤Î¥Á¥§¥Ã¥¯¤È¥ê¥»¥Ã¥È +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "void clearerr(FILE *" stream ); + +.BI "int feof(FILE *" stream ); + +.BI "int ferror(FILE *" stream ); + +.BI "int fileno(FILE *" stream ); +.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 fileno (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The function +.\"O .BR clearerr () +.\"O clears the end-of-file and error indicators for the stream pointed to by +.\"O .IR stream . +´Ø¿ô +.BR clearerr () +¤Ï +.I stream +¤Ç¼¨¤µ¤ì¤ë¥¹¥È¥ê¡¼¥à¤Î EOF(end-of-file) »Ø¼¨»Ò¤È¥¨¥é¡¼»Ø¼¨»Ò¤ò¥¯¥ê¥¢¤¹¤ë¡£ +.PP +.\"O The function +.\"O .BR feof () +.\"O tests the end-of-file indicator for the stream pointed to by +.\"O .IR stream , +.\"O returning nonzero if it is set. +.\"O The end-of-file indicator can only be +.\"O cleared by the function +.\"O .BR clearerr (). +´Ø¿ô +.BR feof () +¤Ï +.I stream +¤Ç¼¨¤µ¤ì¤ë¥¹¥È¥ê¡¼¥à¤Î EOF »Ø¼¨»Ò¤ò¥Æ¥¹¥È¤·¡¢ +¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð 0 °Ê³°¤Î¿ô¤òÊÖ¤¹¡£ +EOF »Ø¼¨»Ò¤Ï¡¢´Ø¿ô +.BR clearerr () +¤Ë¤è¤Ã¤Æ¤Î¤ß¥¯¥ê¥¢¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O The function +.\"O .BR ferror () +.\"O tests the error indicator for the stream pointed to by +.\"O .IR stream , +.\"O returning nonzero if it is set. +.\"O The error indicator can only be reset by the +.\"O .BR clearerr () +.\"O function. +´Ø¿ô +.BR ferror () +¤Ï +.I stream +¤Ç¼¨¤µ¤ì¤ë¥¹¥È¥ê¡¼¥à¤Î¥¨¥é¡¼»Ø¼¨»Ò¤ò¥Æ¥¹¥È¤·¡¢ +¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð 0 °Ê³°¤Î¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼»Ø¼¨»Ò¤Ï¡¢´Ø¿ô +.BR clearerr () +¤Ë¤è¤Ã¤Æ¤Î¤ß¥ê¥»¥Ã¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O The function +.\"O .BR fileno () +.\"O examines the argument +.\"O .I stream +.\"O and returns its integer descriptor. +´Ø¿ô +.BR fileno () +¤Ï¡¢°ú¿ô +.I stream +¤òÄ´¤Ù¡¢¤½¤ÎÀ°¿ô¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤òÊÖ¤¹¡£ +.PP +.\"O For nonlocking counterparts, see +.\"O .BR unlocked_stdio (3). +¥í¥Ã¥¯¤»¤º¤Ë¤³¤ì¤é¤Î½èÍý¤ò¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O These functions should not fail and do not set the external variable +.\"O .IR errno . +¤³¤ì¤é¤Î´Ø¿ô¤Ï¼ºÇÔ¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¯¡¢¤Þ¤¿¡¢³°ÉôÊÑ¿ô +.I errno +¤ËÃͤò¥»¥Ã¥È¤·¤Ê¤¤¡£ +.\"O (However, in case +.\"O .BR fileno () +.\"O detects that its argument is not a valid stream, it must +.\"O return \-1 and set +.\"O .I errno +.\"O to +.\"O .BR EBADF .) +(¤·¤«¤·¡¢ +.BR fileno () +´Ø¿ô¤Î¾ì¹ç¤Ç¡¢°ú¿ô¤¬Í­¸ú¤Ê¥¹¥È¥ê¡¼¥à¤Ç¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +´Ø¿ô¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B EBADF +¤òÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£) +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The functions +.\"O .BR clearerr (), +.\"O .BR feof (), +.\"O and +.\"O .BR ferror () +.\"O conform to C89 and C99. +´Ø¿ô +.BR clearerr (), +.BR feof (), +.BR ferror () +¤Ï C89 ¤È C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR open (2), +.BR fdopen (3), +.BR stdio (3), +.BR unlocked_stdio (3) diff --git a/draft/man3/fexecve.3 b/draft/man3/fexecve.3 new file mode 100644 index 00000000..9adf360a --- /dev/null +++ b/draft/man3/fexecve.3 @@ -0,0 +1,144 @@ +.\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-31, Akihiro MOTOKI +.\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.18 +.\" +.TH FEXECVE 3 2009-02-04 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fexecve \- execute program specified via file descriptor +fexecve \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int fexecve(int " fd ", char *const " argv "[], char *const " envp []); +.fi +.\"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" +.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 +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\"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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR fexecve () +.\"O is implemented since glibc 2.3.2. +.BR fexecve () +¤Ï glibc 2.3.2 °Ê¹ß¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR execve (2) diff --git a/draft/man3/fflush.3 b/draft/man3/fflush.3 new file mode 100644 index 00000000..ee159747 --- /dev/null +++ b/draft/man3/fflush.3 @@ -0,0 +1,181 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fflush.3 5.4 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu +.\" +.\" Modified 2000-07-22 by NicoláÔ Lichtmaier +.\" Modified 2001-10-16 by John Levon +.\" +.\" Japanese Version Copyright (c) 1997-2000 YOSHINO Takashi and NAKANO Takeo +.\" all rights reserved. +.\" Translated 1997-02-13,YOSHINO Takashi +.\" Update & Modified 1999-03-01, NAKANO Takeo +.\" Update & Modified 2000-09-21, NAKANO Takeo +.\" Updated 2001-11-02, Kentaro Shirakata +.\" Updated 2010-04-10, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: global variable Âç°èÊÑ¿ô +.\"WORD: buffered ¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤¿ +.\" +.TH FFLUSH 3 2009-09-06 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O fflush \- flush a stream +.SH ̾Á° +fflush \- ¥¹¥È¥ê¡¼¥à¤ÎÆâÍƤò¶¯À©Åª¤Ë½ÐÎÏ(¥Õ¥é¥Ã¥·¥å)¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int fflush(FILE *" stream ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O For output streams, +.\"O .BR fflush () +.\"O forces a write of all user-space buffered data for the given output or update +.\"O .I stream +.\"O via the stream's underlying write function. +.\"O For input streams, +.\"O .BR fflush () +.\"O discards any buffered data that has been fetched from the underlying file, +.\"O but has not been by the application. +.\"O The open status of the stream +.\"O is unaffected. +½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ë´Ø¤·¤Æ¤Ï¡¢ +.BR fflush () +¤Ï¡¢¥æ¡¼¥¶¡¼¶õ´Ö¤Ç¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¤ò +»ØÄꤵ¤ì¤¿½ÐÎϤ˽ñ¤­½Ð¤¹ (¥Õ¥é¥Ã¥·¥å¤¹¤ë)¡¢ +¤â¤·¤¯¤Ï¥¹¥È¥ê¡¼¥à +.I stream +¤Î²¼°Ì¤Ë¤¢¤ë½ñ¤­¹þ¤ß´Ø¿ô¤òÍѤ¤¤Æ¤³¤Î¥¹¥È¥ê¡¼¥à¤ò¹¹¿·¤¹¤ë¡£ +ÆþÎÏ¥¹¥È¥ê¡¼¥à¤Ë´Ø¤·¤Æ¤Ï¡¢ +.BR fflush () +¤Ï¡¢Âбþ¤¹¤ë¥Õ¥¡¥¤¥ë¤«¤é¼èÆÀ¤µ¤ì¤¿¤¬¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é¤Ï +Æɤ߽Фµ¤ì¤Æ¤¤¤Ê¤¤¥Ð¥Ã¥Õ¥¡¥Ç¡¼¥¿¤òÁ´¤ÆÇË´þ¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Ï³«¤¤¤¿¾õÂ֤ΤޤޤǤ¢¤ê¡¢ +¤³¤Î´Ø¿ô¤Ë¤è¤Ã¤Æ²¿¤Î±Æ¶Á¤â¼õ¤±¤Ê¤¤¡£ +.PP +.\"O If the +.\"O .I stream +.\"O argument is NULL, +.\"O .BR fflush () +.\"O flushes +.\"O .I all +.\"O open output streams. +.I stream +°ú¿ô¤¬ .BR NULL ¤Ê¤é¤Ð¡¢ +.BR fflush () +¤Ï³«¤¤¤Æ¤¤¤ë\fI¤¹¤Ù¤Æ¤Î\fR½ÐÎÏ¥¹¥È¥ê¡¼¥à¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.PP +.\"O For nonlocking counterparts, see +.\"O .BR unlocked_stdio (3). +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "RETURN VALUES" +.SH ÊÖ¤êÃÍ +.\"O Upon successful completion 0 is returned. +.\"O Otherwise, +.\"O .B EOF +.\"O is returned and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï +.B EOF +¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¡¢¥¨¥é¡¼¤ËÂбþ¤·¤¿ÃͤËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O .I Stream +.\"O is not an open stream, or is not open for writing. +.I Stream +¤Ï³«¤¤¤Æ¤¤¤ë¥¹¥È¥ê¡¼¥à¤Ç¤Ï¤Ê¤¤¡£ +¤¢¤ë¤¤¤Ï¥¹¥È¥ê¡¼¥à¤Ï½ñ¤­¹þ¤ßÍѤǤϤʤ¤¡£ +.PP +.\"O The function +.\"O .BR fflush () +.\"O may also fail and set +.\"O .I errno +.\"O for any of the errors specified for +.\"O .BR write (2). +.BR fflush () +´Ø¿ô¤Ï +.BR write (2) +¤Ë´Ø¤·¤Æµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤â¤¢¤ë¡£ +¤³¤Î¾ì¹ç +.I errno +¤â¤½¤ÎÃͤËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C89, C99, POSIX.1-2001, POSIX.1-2008. + +.\"O The standards do not specify the behavior for input streams. +.\"O Most other implementations behave the same as Linux. +ɸ½à¤Ç¤Ï¡¢ÆþÎÏ¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ëÆ°ºî¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¾¤Î¤Û¤È¤ó¤É¤Î¼ÂÁõ¤Ï Linux ¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¡£ +.\" Verified on: Solaris 8. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Note that +.\"O .BR fflush () +.\"O only flushes the user space buffers provided by the C library. +.\"O To ensure that the data is physically stored on disk +.\"O the kernel buffers must be flushed too, for example, with +.\"O .BR sync (2) +.\"O or +.\"O .BR fsync (2). +.BR fflush () +¤Ï¡¢ C ¥é¥¤¥Ö¥é¥ê¤¬Í¿¤¨¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¶õ´Ö¤Î¥Ð¥Ã¥Õ¥¡¤·¤«¥Õ¥é¥Ã¥·¥å¤·¤Ê¤¤¡£ +¥Ç¡¼¥¿¤¬ÊªÍýŪ¤Ë¥Ç¥£¥¹¥¯¤ËÊݸ¤µ¤ì¤ë¤³¤È¤òÊݾڤ·¤¿¤±¤ì¤Ð¡¢ +¥«¡¼¥Í¥ë¥Ð¥Ã¥Õ¥¡¤â¥Õ¥é¥Ã¥·¥å¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤Ë¤ÏÎ㤨¤Ð +.BR sync (2) +¤ä +.BR fsync (2) +¤òÍѤ¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fsync (2), +.BR sync (2), +.BR write (2), +.BR fclose (3), +.BR fopen (3), +.BR setbuf (3), +.BR unlocked_stdio (3) diff --git a/draft/man3/ffs.3 b/draft/man3/ffs.3 new file mode 100644 index 00000000..702d8102 --- /dev/null +++ b/draft/man3/ffs.3 @@ -0,0 +1,107 @@ +.\" 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 Sat Jul 24 19:39:35 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" 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 +.\" +.TH FFS 3 2009-08-27 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +.\"O ffs, ffsl, ffsll \- find first bit set in a word +ffs, ffsl, ffsll \- ¥ï¡¼¥É¤ÎÃæ¤ÇºÇ½é¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Ó¥Ã¥È¤Î¸¡½Ð +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int ffs(int " i ); +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int ffsl(long int " i ); +.sp +.BI "int ffsll(long long int " i ); +.fi +.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 () +´Ø¿ô¤âƱÍͤÀ¤¬¡¢ +°Û¤Ê¤Ã¤¿¥µ¥¤¥º¤Î°ú¿ô¤ò¤È¤ë¡£ +.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 ¤òÊÖ¤¹¡£ +.SH ½àµò +.BR ffs (): 4.3BSD, POSIX.1-2001. +.\"O The +.\"O .BR ffsl () +.\"O and +.\"O .BR ffsll () +.\"O are glibc extensions. +.BR ffsl () +¤È +.BR ffsll () +¤Ï glibc ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O BSD systems have a prototype in +.\"O .IR . +BSD ¥·¥¹¥Æ¥à¤Ç¤Ï +.I +¤Ë¥×¥í¥È¥¿¥¤¥×¤¬¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR memchr (3), +.BR feature_test_macros (7) diff --git a/draft/man3/fgetgrent.3 b/draft/man3/fgetgrent.3 new file mode 100644 index 00000000..b4207953 --- /dev/null +++ b/draft/man3/fgetgrent.3 @@ -0,0 +1,138 @@ +.\" 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 Sat Jul 24 19:38:44 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-19, HIROFUMI Nishizuka +.\" Updated 2008-08-01, Akihiro MOTOKI +.\" +.TH FGETGRENT 3 2008-07-10 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fgetgrent \- get group file entry +fgetgrent \- ¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤Î¼è¤ê½Ð¤· +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "struct group *fgetgrent(FILE *" stream ); +.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 fgetgrent (): +_SVID_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR fgetgrent () +.\"O function returns a pointer to a structure containing +.\"O the group information from the file referred to by +.\"O .IR stream . +.\"O The first time it is called +.\"O it returns the first entry; thereafter, it returns successive entries. +.\"O The file referred to by +.\"O .I stream +.\"O must have the same format as +.\"O .I /etc/group +.\"O (see +.\"O .BR group (5)). +.BR fgetgrent () +´Ø¿ô¤Ï¡¢ +.I stream +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤«¤é¼è¤ê½Ð¤·¤¿¥°¥ë¡¼¥×¾ðÊó +¤ò´Þ¤à¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤Ï +ºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤·¡¢¤½¤ì°Ê¹ß¤Ï¡¢¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +.I stream +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ï¡¢ +.I /etc/group +¤ÈƱ¤¸·Á¼°¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.RB ( group (5) +»²¾È)¡£ +.PP +.\"O The \fIgroup\fP structure is defined in \fI\fP as follows: +\fIgroup\fP ¹½Â¤ÂΤϡ¢\fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct group { +.\"O char *gr_name; /* group name */ +.\"O char *gr_passwd; /* group password */ +.\"O gid_t gr_gid; /* group ID */ +.\"O char **gr_mem; /* group members */ + char *gr_name; /* ¥°¥ë¡¼¥×̾ */ + char *gr_passwd; /* ¥°¥ë¡¼¥×¤Î¥Ñ¥¹¥ï¡¼¥É */ + gid_t gr_gid; /* ¥°¥ë¡¼¥× ID */ + char **gr_mem; /* ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð */ +}; +.fi +.in +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR fgetgrent () +.\"O function returns a pointer to a +.\"O .I group +.\"O structure, +.\"O or NULL if there are no more entries or an error occurs. +.BR fgetgrent () +´Ø¿ô¤Ï +.I group +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ì°Ê¾å¥¨¥ó¥È¥ê¤¬Ìµ¤¤¤«¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +.\"O Insufficient memory to allocate +.\"O .I group +.\"O structure. +.I group +¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4. +.SH ´ØÏ¢¹àÌÜ +.BR endgrent (3), +.BR fgetgrent_r (3), +.BR fopen (3), +.BR getgrent (3), +.BR getgrgid (3), +.BR getgrnam (3), +.BR putgrent (3), +.BR setgrent (3), +.BR group (5) diff --git a/draft/man3/fgetpwent.3 b/draft/man3/fgetpwent.3 new file mode 100644 index 00000000..8d070d32 --- /dev/null +++ b/draft/man3/fgetpwent.3 @@ -0,0 +1,152 @@ +.\" 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 Sat Jul 24 19:37:37 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon May 27 22:40:48 1996 by Martin Schulze (joey@linux.de) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-18, HIROFUMI Nishizuka +.\" Updated 2008-08-01, Akihiro MOTOKI +.\" +.TH FGETPWENT 3 2008-07-10 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fgetpwent \- get password file entry +fgetpwent \- ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤Î¼è¤ê½Ð¤· +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "struct passwd *fgetpwent(FILE *" stream ); +.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 fgetpwent (): +_SVID_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR fgetpwent () +.\"O function returns a pointer to a structure containing +.\"O the broken out fields of a line in the file \fIstream\fP. +.\"O The first time it is called it returns the first entry; +.\"O thereafter, it returns successive entries. +.\"O The file referred to by +.\"O .I stream +.\"O must have the same format as +.\"O .I /etc/passwd +.\"O (see +.\"O .BR passwd (5)). +.BR fgetpwent () +´Ø¿ô¤Ï¡¢\fIstream\fP ¤«¤éÆÀ¤é¤ì¤¿¹Ô¤òʬ²ò¤·¤¿¥Õ¥£¡¼¥ë¥É +¤ò´Þ¤à¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +ºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤Ë¤ÏºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤·¡¢¤½¤ì°Ê¹ß¤Ï +¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +.I stream +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ï +.I /etc/passwd +¤ÈƱ¤¸·Á¼°¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.RB ( passwd (5) +»²¾È)¡£ +.PP +.\"O The \fIpasswd\fP structure is defined in \fI\fP as follows: +\fIpasswd\fP ¹½Â¤ÂΤϡ¢\fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.nf +.in +4n +struct passwd { +.\"O char *pw_name; /* username */ +.\"O char *pw_passwd; /* user password */ +.\"O uid_t pw_uid; /* user ID */ +.\"O gid_t pw_gid; /* group ID */ +.\"O char *pw_gecos; /* real name */ +.\"O char *pw_dir; /* home directory */ +.\"O char *pw_shell; /* shell program */ + char *pw_name; /* ¥æ¡¼¥¶Ì¾ */ + char *pw_passwd; /* ¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É */ + uid_t pw_uid; /* ¥æ¡¼¥¶ ID */ + gid_t pw_gid; /* ¥°¥ë¡¼¥× ID */ + char *pw_gecos; /* ËÜ̾ */ + char *pw_dir; /* ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê */ + char *pw_shell; /* ¥·¥§¥ë¥×¥í¥°¥é¥à */ +}; +.fi +.in +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR fgetpwent () +.\"O function returns a pointer to a +.\"O .I passwd +.\"O structure, or NULL if +.\"O there are no more entries or an error occurs. +.BR fgetpwent () +´Ø¿ô¤Ï¡¢ +.I passwd +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ì°Ê¾å¥¨¥ó¥È¥ê¤¬Ìµ¤¤¤«¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +.\"O Insufficient memory to allocate +.\"O .I passwd +.\"O structure. +.I passwd +¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/passwd +.\"O password database file +¥Ñ¥¹¥ï¡¼¥É¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR endpwent (3), +.BR fgetpwent_r (3), +.BR fopen (3), +.BR getpw (3), +.BR getpwent (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR putpwent (3), +.BR setpwent (3), +.BR passwd (5) diff --git a/draft/man3/fgetwc.3 b/draft/man3/fgetwc.3 new file mode 100644 index 00000000..0bfa6086 --- /dev/null +++ b/draft/man3/fgetwc.3 @@ -0,0 +1,140 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon +.\"O +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Aug 29 15:03:27 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 JST 1999 by Kentaro Shirakata +.\" Updated Fri Nov 2 JST 2001 by Kentaro Shirakata +.\" +.TH FGETWC 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\") .SH NAME +.SH ̾Á° +.\"O fgetwc, getwc \- read a wide character from a FILE stream +fgetwc, getwc \- ¥ï¥¤¥Éʸ»ú¤ò FILE ¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "wint_t fgetwc(FILE *" stream ); +.BI "wint_t getwc(FILE *" stream ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR fgetwc () +.\"O function is the wide-character equivalent +.\"O of the +.\"O .BR fgetc (3) +.\"O function. +.\"O It reads a wide character from \fIstream\fP and returns it. +.\"O If the end of stream is reached, or if \fIferror(stream)\fP becomes true, +.\"O it returns +.\"O .BR WEOF . +.\"O If a wide character conversion error occurs, it sets +.\"O \fIerrno\fP to \fBEILSEQ\fP and returns +.\"O .BR WEOF . +.BR fgetwc () +´Ø¿ô¤Ï¡¢ +.BR fgetc (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï \fIstream\fP ¤«¤é¥ï¥¤¥Éʸ»ú¤ò 1 ʸ»úÆɤ߹þ¤ß¡¢¤³¤ì¤òÊÖ¤¹¡£ +¥¹¥È¥ê¡¼¥à¤Î½ªÃ¼¤Ë㤹¤ë¤«¡¢\fIferror(stream)\fP ¤¬¿¿¤Ë¤Ê¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +¤³¤Î´Ø¿ô¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +¥ï¥¤¥Éʸ»úÊÑ´¹¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï¡¢ +\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤ò¥»¥Ã¥È¤·¡¢ +.B WEOF +¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR getwc () +.\"O function or macro functions identically to +.\"O .BR fgetwc (). +.BR getwc () +´Ø¿ô¤¢¤ë¤¤¤Ï¥Þ¥¯¥í¤Ï¡¢ +.BR fgetwc () +¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë¡£ +.\"O It may be implemented as a macro, and may evaluate its argument +.\"O more than once. +.\"O There is no reason ever to use it. +¤³¤Î´Ø¿ô¤Ï¥Þ¥¯¥í¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç¡¢°ú¤­¿ô¤¬Ê£¿ô²óɾ²Á¤µ +¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£¤³¤Î´Ø¿ô¤ò»È¤¦Íýͳ¤Ï¤â¤Ï¤ä¸ºß¤·¤Ê¤¤¡£ +.PP +.\"O For nonlocking counterparts, see +.\"O .BR unlocked_stdio (3). +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR fgetwc () +.\"O function returns the next wide-character +.\"O from the stream, or +.\"O .BR WEOF . +.BR fgetwc () +´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤Î¼¡¤Î¥ï¥¤¥Éʸ»ú¤«¡¢¤¢¤ë¤¤¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O Apart from the usual ones, there is +Ä̾ï¤Î¥¨¥é¡¼¤Ë²Ã¤¨¤Æ¡¢°Ê²¼¤Î¥¨¥é¡¼¤¬¤¢¤ë: +.TP +.B EILSEQ +.\"O The data obtained from the input stream does not +.\"O form a valid character. +ÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é¼èÆÀ¤·¤¿¥Ç¡¼¥¿¤¬¡¢Àµ¤·¤¤Ê¸»ú¤Ç¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR fgetwc () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR fgetwc () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.\"O In the absence of additional information passed to the +.\"O .BR fopen (3) +.\"O call, it is +.\"O reasonable to expect that +.\"O .BR fgetwc () +.\"O will actually read a multibyte sequence +.\"O from the stream and then convert it to a wide character. +.BR fopen (3) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ÄɲþðÊ󤬤ʤ¤¾ì¹ç¤Ë¤Ï¡¢ +.BR fgetwc () +¤¬¼ÂºÝ +¤Ë¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤ò¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤ß¡¢¤³¤ì¤ò¥ï¥¤¥Éʸ»ú¤Ë +ÊÑ´¹¤¹¤ë¤È´üÂÔ¤¹¤ë¤³¤È¤ÏŬÀڤǤ¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fgetws (3), +.BR fputwc (3), +.BR ungetwc (3), +.BR unlocked_stdio (3) diff --git a/draft/man3/fgetws.3 b/draft/man3/fgetws.3 new file mode 100644 index 00000000..b6188029 --- /dev/null +++ b/draft/man3/fgetws.3 @@ -0,0 +1,117 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Aug 29 15:03:42 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sat Oct 27 09:01:41 JST 2001 +.\" by Yuichi SATO +.\" +.\" WORD: null wide characters ¥Ê¥ë¥ï¥¤¥Éʸ»ú +.\" +.TH FGETWS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fgetws \- read a wide-character string from a FILE stream +fgetws \- ¥ï¥¤¥Éʸ»ú¤Îʸ»úÎó¤ò FILE ¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *fgetws(wchar_t *" ws ", int " n ", FILE *" stream ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR fgetws () +.\"O function is the wide-character equivalent +.\"O of the +.\"O .BR fgets (3) +.\"O function. +.\"O It reads a string of at most \fIn\-1\fP wide characters into the +.\"O wide-character array pointed to by \fIws\fP, +.\"O and adds a terminating L\(aq\\0\(aq character. +.\"O It stops reading wide characters after it has encountered and +.\"O stored a newline wide character. +.\"O It also stops when end of stream is reached. +.BR fgetws () +´Ø¿ô¤Ï +.BR fgets (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢ºÇÂç \fIn\-1\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤ò +\fIws\fP ¤¬¼¨¤¹¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤ËÆɤ߹þ¤ß¡¢½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤òÄɲ乤롣 +¤³¤Î´Ø¿ô¤Ï¡¢¥ï¥¤¥Éʸ»ú¤Î²þ¹Ôʸ»ú¤ò¸«¤Ä¤±¡¢¤³¤ì¤ò³ÊǼ¤¹¤ë¤ÈÆɤ߹þ¤à¤Î¤ò»ß¤á¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤Î½ª¤ï¤ê¤Ë㤷¤¿¾ì¹ç¤âÆɤ߹þ¤ß¤ò»ß¤á¤ë¡£ +.PP +.\"O The programmer must ensure that there is room for at least \fIn\fP wide +.\"O characters at \fIws\fP. +¥×¥í¥°¥é¥Þ¤Ï¡¢\fIws\fP ¤Ë¤Ï¾¯¤Ê¤¯¤È¤â \fIn\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤ò +³ÊǼ¤Ç¤­¤ëÎΰè¤òɬ¤º³ÎÊݤ·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O For a nonlocking counterpart, see +.\"O .BR unlocked_stdio (3). +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR fgetws () +.\"O function, if successful, returns \fIws\fP. +.\"O If end of stream +.\"O was already reached or if an error occurred, it returns NULL. +.BR fgetws () +¤ÏÀ®¸ù¤¹¤ë¤È \fIws\fP ¤òÊÖ¤¹¡£ +´û¤Ë¥¹¥È¥ê¡¼¥à¤Î½ª¤ï¤ê¤Ë㤷¤Æ¤¤¤ë¤«¡¢¥¨¥é¡¼¤¬µ¯¤­¤¿¾ì¹ç¤Ë¤Ï NULL ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR fgetws () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR fgetws () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.\"O In the absence of additional information passed to the +.\"O .BR fopen (3) +.\"O call, it is +.\"O reasonable to expect that +.\"O .BR fgetws () +.\"O will actually read a multibyte string +.\"O from the stream and then convert it to a wide-character string. +.BR fopen (3) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ÄɲäξðÊ󤬤ʤ¤¾ì¹ç¤Ë¤Ï¡¢ +.BR fgetws () +¤¬¼ÂºÝ¤Ë¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤ò¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤ß¡¢ +¤³¤ì¤ò¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤¹¤ë¤È´üÂÔ¤¹¤ë¤³¤È¤ÏŬÀڤǤ¢¤ë¡£ +.PP +.\"O This function is unreliable, +.\"O because it does not permit to deal properly with +.\"O null wide characters that may be present in the input. +¤³¤Î´Ø¿ô¤Ï¿®Íê¤Ç¤­¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢ÆþÎϤ˴ޤޤì¤ë¤«¤â¤·¤ì¤Ê¤¤ +¥Ê¥ë¥ï¥¤¥Éʸ»ú¤òŬÀڤ˽èÍý¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fgetwc (3), +.BR unlocked_stdio (3) diff --git a/draft/man3/finite.3 b/draft/man3/finite.3 new file mode 100644 index 00000000..43d3a4ac --- /dev/null +++ b/draft/man3/finite.3 @@ -0,0 +1,160 @@ +.\" Copyright 2004 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) 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 ̵¸úÃÍ +.\" +.TH FINITE 3 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int finite(double " x ); +.br +.BI "int finitef(float " x ); +.br +.BI "int finitel(long double " x ); +.sp +.BI "int isinf(double " x ); +.br +.BI "int isinff(float " x ); +.br +.BI "int isinfl(long double " x ); +.sp +.BI "int isnan(double " x ); +.br +.BI "int isnanf(float " x ); +.br +.BI "int isnanl(long double " x ); +.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 finite (), +.BR finitef (), +.BR finitel (): +_BSD_SOURCE || _SVID_SOURCE +.br +.BR isinf (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; +.I cc\ -std=c99 +.br +.BR isinff (), +.BR isinfl (): +_BSD_SOURCE || _SVID_SOURCE +.br +.BR isnan (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; +.I cc\ -std=c99 +.br +.BR isnanf (), +.BR isnanl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.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 ¤òÊÖ¤¹¡£ + +.\"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 ¤òÊÖ¤¹¡£ + +.\"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 +.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 +.\" .BR finite () +.\" ´Ø¿ô¤Ï 4.3BSD ¤ÇÅо줷¤¿¡£ +.\" 4.3BSD ¤Î¥Þ¥Ë¥å¥¢¥ë¤Î IEEE.3 ¤ò»²¾È +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fpclassify (3) diff --git a/draft/man3/flockfile.3 b/draft/man3/flockfile.3 new file mode 100644 index 00000000..aacb8a05 --- /dev/null +++ b/draft/man3/flockfile.3 @@ -0,0 +1,204 @@ +.\" 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) 2001 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Nov 4 14:09:45 2001 +.\" by Akihiro MOTOKI +.\" +.\"WORD: lockcount ¥í¥Ã¥¯¿ô +.\"WORD: owner thread ½êÍ­¼Ô¥¹¥ì¥Ã¥É +.\" +.TH FLOCKFILE 3 2008-08-29 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O flockfile, ftrylockfile, funlockfile \- lock FILE for stdio +.SH ̾Á° +flockfile, ftrylockfile, funlockfile \- ɸ½àÆþ½ÐÎÏ FILE ¤Î¥í¥Ã¥¯¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void flockfile(FILE *" filehandle ); +.br +.BI "int ftrylockfile(FILE *" filehandle ); +.br +.BI "void funlockfile(FILE *" filehandle ); +.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 +.ad l +.sp +.\"O All functions shown above: +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô: +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The stdio functions are thread-safe. +.\"O This is achieved by assigning +.\"O to each +.\"O .I FILE +.\"O object a lockcount and (if the lockcount is nonzero) +.\"O an owning thread. +ɸ½àÆþ½ÐÎÏ´Ø¿ô¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤¢¤ë¡£¤³¤ì¤Ï¡¢³Æ +.I FILE +¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ·¡¢¥í¥Ã¥¯¿ô (lockcount) ¤È +(¥í¥Ã¥¯¿ô¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¤Ï) ½êÍ­¼Ô¥¹¥ì¥Ã¥É (owner thread) +¤ò´ÉÍý¤¹¤ë¤³¤È¤Ç¼Â¸½¤µ¤ì¤ë¡£ +.\"O For each library call, these functions wait until the +.\"O .I FILE +.\"O object +.\"O is no longer locked by a different thread, then lock it, do the +.\"O requested I/O, and unlock the object again. +¥é¥¤¥Ö¥é¥ê¤Î¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤ëËè¤Ë¡¢É¸½àÆþ½ÐÎÏ´Ø¿ô¤Ï +.I FILE +¥ª¥Ö¥¸¥§¥¯¥È¤¬Â¾¤Î¥¹¥ì¥Ã¥É¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¾õÂ֤ˤʤë¤Þ¤ÇÂÔ¤Á¡¢ +.I FILE +¥ª¥Ö¥¸¥§¥¯¥È¤ò¥í¥Ã¥¯¤·¡¢Í׵ᤵ¤ì¤ÆÆþ½ÐÎϤò¹Ô¤¤¡¢ +¥ª¥Ö¥¸¥§¥¯¥È¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë¡£ +.LP +.\"O (Note: this locking has nothing to do with the file locking done +.\"O by functions like +.\"O .BR flock (2) +.\"O and +.\"O .BR lockf (3).) +(Ãí: ¤³¤Î¥í¥Ã¥¯¤Ï¡¢ +.BR flock (2) +¤ä +.BR lockf (3) +¤È¤¤¤Ã¤¿´Ø¿ô¤¬¹Ô¤¦¥í¥Ã¥¯¤È¤ÏÁ´¤¯Ìµ´Ø·¸¤Ç¤¢¤ë¡£) +.LP +.\"O All this is invisible to the C-programmer, but there may be two +.\"O reasons to wish for more detailed control. +.\"O On the one hand, maybe +.\"O a series of I/O actions by one thread belongs together, and should +.\"O not be interrupted by the I/O of some other thread. +.\"O On the other hand, maybe the locking overhead should be avoided +.\"O for greater efficiency. +¤³¤ì¤é¤Î¤³¤È¤Ï¤¹¤Ù¤Æ C ¥×¥í¥°¥é¥Þ¤Ë¤Ï¸«¤¨¤Ê¤¤Éôʬ¤Ç¹Ô¤ï¤ì¤ë¤¬¡¢ +¤è¤êºÙ¤«¤¤À©¸æ¤¬¤Ç¤­¤¿Êý¤¬¤è¤¤Íýͳ¤¬2¤Ä¤¢¤ë¤À¤í¤¦¡£°ì¤Ä¤Ï¡¢°ì¤Ä¤Î¥¹¥ì¥Ã¥É¤¬ +¹Ô¤¦°ìÏ¢¤ÎÆþ½ÐÎÏÆ°ºî¤Ï°ì½ï¤Ë¹Ô¤ï¤ì¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤ÎÆþ½ÐÎϤˤè¤Ã¤ÆÃæÃǤµ¤ì¤Ê¤¤ +Êý¤¬¤è¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤í¤¦¡£¤â¤¦°ì¤Ä¤Ï¡¢¸úΨ¤òÂ礭¤¯¾å¤²¤ë¤¿¤á¤Ë¤Ï +¥í¥Ã¥¯¤Î¥ª¡¼¥Ð¥Ø¥Ã¥É¤òÈò¤±¤ëɬÍפ¬¤¢¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤í¤¦¡£ +.LP +.\"O To this end, a thread can explicitly lock the +.\"O .I FILE +.\"O object, +.\"O then do its series of I/O actions, then unlock. +.\"O This prevents +.\"O other threads from coming in between. +.\"O If the reason for doing +.\"O this was to achieve greater efficiency, one does the I/O with +.\"O the nonlocking versions of the stdio functions: with +.\"O .BR getc_unlocked (3) +.\"O and +.\"O .BR putc_unlocked (3) +.\"O instead of +.\"O .BR getc (3) +.\"O and +.\"O .BR putc (3). +¤³¤ÎÌÜŪ¤ò¼Â¸½¤¹¤ë¤¿¤á¤Ë¡¢ +.I FILE +¥ª¥Ö¥¸¥§¥¯¥È¤Î¥í¥Ã¥¯¡¢°ìÏ¢¤ÎÆþ½ÐÎÏÆ°ºî¤Î¼Â¹Ô¡¢ +¥í¥Ã¥¯¤Î²ò½ü¤ò¥¹¥ì¥Ã¥É¤¬ÌÀ¼¨Åª¤Ë»Ø¼¨¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤¬ÅÓÃæ¤ÇÆþ½ÐÎϤò¹Ô¤¦¤Î¤òËɻߤ¹¤ë¡£ +¤³¤Î¤è¤¦¤Ê¤³¤È¤ò¹Ô¤¦Íýͳ¤¬¸úΨ¤Î¸þ¾å¤Ç¤¢¤ë¤Ê¤é¤Ð¡¢ +¥í¥Ã¥¯¤ò¹Ô¤ï¤Ê¤¤¥Ð¡¼¥¸¥ç¥ó¤Îɸ½àÆþ½ÐÎÏ´Ø¿ô¤ò»È¤¦¤³¤È¤â¤Ç¤­¤ë¡£ +Î㤨¤Ð¡¢ +.BR getc (3) +¤ä +.BR putc (3) +¤ÎÂå¤ï¤ê¤Ë +.BR getc_unlocked (3) +¤ä +.BR putc_unlocked (3) +¤ò»ÈÍѤ¹¤ë¡£ +.LP +.\"O The +.\"O .BR flockfile () +.\"O function waits for \fI*filehandle\fP to be +.\"O no longer locked by a different thread, then makes the +.\"O current thread owner of \fI*filehandle\fP, and increments +.\"O the lockcount. +.BR flockfile () +´Ø¿ô¤Ï¡¢\fI*filehandle\fP ¤¬Â¾¤Î¥¹¥ì¥Ã¥É¤Ë¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê +¤¤¾õÂ֤ˤʤë¤Þ¤ÇÂԤ俤ΤÁ¡¢¸½ºß¤Î¥¹¥ì¥Ã¥É¤ò \fI*filehandle\fP ¤Î¥ª¡¼¥Ê¤ËÀß +Äꤷ¡¢¥í¥Ã¥¯¿ô¤ò²Ã»»¤¹¤ë¡£ +.LP +.\"O The +.\"O .BR funlockfile () +.\"O function decrements the lock count. +.BR funlockfile () +´Ø¿ô¤Ï¡¢¥í¥Ã¥¯¿ô¤ò¸º»»¤¹¤ë¡£ +.LP +.\"O The +.\"O .BR ftrylockfile () +.\"O function is a nonblocking version +.\"O of +.\"O .BR flockfile (). +.\"O It does nothing in case some other thread +.\"O owns \fI*filehandle\fP, and it obtains ownership and increments +.\"O the lockcount otherwise. +.BR ftrylockfile () +´Ø¿ô¤Ï +.BR flockfile () +¤Î¥Ö¥í¥Ã¥­¥ó¥°¤ò¹Ô¤ï¤Ê¤¤ +¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë¡£Â¾¤Î¥¹¥ì¥Ã¥É¤¬ \fI*filehandle\fP ¤ò¥í¥Ã¥¯¤·¤Æ¤¤¤ë»þ¤Ï +²¿¤â¹Ô¤ï¤º¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï \fI*filehandle\fP ¤Î½êÍ­¸¢¤ò³ÍÆÀ¤·¡¢ +¥í¥Ã¥¯¿ô¤ò²Ã»»¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR ftrylockfile () +.\"O function returns zero for success +.\"O (the lock was obtained), and nonzero for failure. +.BR ftrylockfile () +´Ø¿ô¤Ï¥í¥Ã¥¯¤ËÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +.\"O .SH ERRORS +.\"O None. +.SH ¥¨¥é¡¼ +¤Ê¤·¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH AVAILABILITY +.SH ²ÄÍÑÀ­ +.\"O These functions are available when +.\"O .B _POSIX_THREAD_SAFE_FUNCTIONS +.\"O is defined. +.\"O They are in libc since libc 5.1.1 and in glibc +.\"O since glibc 2.0. +.B _POSIX_THREAD_SAFE_FUNCTIONS +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ë¤³¤ì¤é¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +5.1.1 °Ê¹ß¤Î libc ¤È 2.0 °Ê¹ß¤Î glibc ¤Ë¸ºß¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR unlocked_stdio (3) diff --git a/draft/man3/floor.3 b/draft/man3/floor.3 new file mode 100644 index 00000000..09bb089a --- /dev/null +++ b/draft/man3/floor.3 @@ -0,0 +1,156 @@ +.\" Copyright 2001 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. +.\" +.\" 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 ²¾¿ô +.\" +.TH FLOOR 3 2008-10-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O floor, floorf, floorl \- largest integral value not greater than argument +floor, floorf, floorl \- °ú¤­¿ô¤ò±Û¤¨¤Ê¤¤ºÇÂç¤ÎÀ°¿ôÃÍ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double floor(double " x ); +.br +.BI "float floorf(float " x ); +.br +.BI "long double floorl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR floorf (), +.BR floorl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These functions return the largest integral value that is not greater than +.\"O .IR x . +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤è¤êÂ礭¤¯¤Ê¤¤ºÇÂç¤ÎÀ°¿ôÃͤòÊÖ¤¹¡£ + +.\"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" +.SH ÊÖ¤êÃÍ +.\"O These functions return the floor of +.\"O .IR x . +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ò±Û¤¨¤Ê¤¤ºÇ¾®¤ÎÀ°¿ôÃͤòÊÖ¤¹¡£ + +.\"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 +.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" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR ceil (3), +.BR lrint (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3), +.BR trunc (3) diff --git a/draft/man3/fma.3 b/draft/man3/fma.3 new file mode 100644 index 00000000..7994b9ed --- /dev/null +++ b/draft/man3/fma.3 @@ -0,0 +1,235 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" Distributed under GPL, 2002-07-27 Walter Harms +.\" 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 2008-10-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fma, fmaf, fmal \- floating-point multiply and add +fma, fmaf, fmal \- ÉâÆ°¾®¿ôÅÀ¿ô¤ÎÀѤÈϤò·×»»¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double fma(double " x ", double " y ", double " z ); +.br +.BI "float fmaf(float " x ", float " y ", float " z ); +.br +.BI "long double fmal(long double " x ", long double " y ", long double " z ); +.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) +»²¾È): +.in +.sp +.ad l +.BR fma (), +.BR fmaf (), +.BR fmal (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 +.SH ÊÖ¤êÃÍ +.\"O These functions return the value of +.\"O .IR x " * " y " + " z , +.\"O rounded as one ternary operation. +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.IR x " * " y " + " z +¤Î¡¢°ì¤Ä¤Î»°¹à±é»»¤È¤·¤Æ´Ý¤á¤é¤ì¤¿ÃͤòÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O or +.\"O .I y +.\"O is a NaN, a NaN is returned. +.I x +¤« +.I y +¤¬ 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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\" 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. + +.\"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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If the result overflows, +.\"O a range error occurs, and +.\"O an infinity with the correct sign is returned. +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢ +Àµ¤·¤¤Éä¹æ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If the result underflows, +.\"O a range error occurs, and +.\"O a signed 0 is returned. +·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ +ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢Éä¹æÉÕ¤­¤Î 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.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 ¤Ç¤Ï¤Ê¤¤ +.\" .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 +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.\" .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 +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.\" .I errno +.\" is set to +.\" .BR ERANGE . +.\"O An underflow floating-point exception +.\"O .RB ( FE_UNDERFLOW ) +.\"O is raised. +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR remainder (3), +.BR remquo (3) diff --git a/draft/man3/fmax.3 b/draft/man3/fmax.3 new file mode 100644 index 00000000..d609ded2 --- /dev/null +++ b/draft/man3/fmax.3 @@ -0,0 +1,87 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fmax, fmaxf, fmaxl \- determine maximum of two floating-point numbers +fmax, fmaxf, fmaxl \- Æó¤Ä¤ÎÉâÆ°¾®¿ôÅÀ¿ô¤ÎºÇÂçÃͤòµá¤á¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double fmax(double " x ", double " y ); +.br +.BI "float fmaxf(float " x ", float " y ); +.br +.BI "long double fmaxl(long double " x ", long double " y ); +.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) +»²¾È): +.in +.sp +.ad l +.BR fmax (), +.BR fmaxf (), +.BR fmaxl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 +.SH ÊÖ¤êÃÍ +.\"O These functions return the maximum of +.\"O .I x +.\"O and +.\"O .IR y . +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤È +.I y +¤ÎºÇÂçÃͤòÊÖ¤¹¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR fmin (3) diff --git a/draft/man3/fmemopen.3 b/draft/man3/fmemopen.3 new file mode 100644 index 00000000..a4f6ce83 --- /dev/null +++ b/draft/man3/fmemopen.3 @@ -0,0 +1,427 @@ +.\" Copyright 2005 walter harms (walter.harms@informatik.uni-oldenburg.de), +.\" and Copyright 2005 Michael Kerrisk +.\" Distributed under the GPL. +.\" 2008-12-04, Petr Baudis : Document open_wmemstream() +.\" +.\" Japanese Version Copyright (c) 2005, 2006 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2005-12-26, Akihiro MOTOKI +.\" Updated 2006-01-20, Akihiro MOTOKI +.\" Updated 2006-07-20, Akihiro MOTOKI +.\" Updated 2008-11-08, Akihiro MOTOKI, LDP v3.13 +.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24 +.\" +.TH FMEMOPEN 3 2009-09-15 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fmemopen, open_memstream, open_wmemstream \- open memory as stream +fmemopen, open_memstream, open_wmemstream \- ¥á¥â¥ê¤ò¥¹¥È¥ê¡¼¥à¤È¤·¤Æ¥ª¡¼¥×¥ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "FILE *fmemopen(void *"buf ", size_t "size ", const char *" mode ");" + +.BI "FILE *open_memstream(char **" ptr ", size_t *" sizeloc ); + +.B #define _GNU_SOURCE +.B #include + +.BI "FILE *open_wmemstream(wchar_t **" ptr ", size_t *" sizeloc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR fmemopen () +.\"O function opens a stream that permits the access specified by +.\"O .IR mode . +.\"O The stream allows I/O to be performed on the string or memory buffer +.\"O pointed to by +.\"O .IR buf . +.\"O This buffer must be at least +.\"O .I size +.\"O bytes long. +.BR fmemopen () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤·¡¢¤½¤Î¥¹¥È¥ê¡¼¥à¤Ë +.I mode +¤Ç»ØÄꤵ¤ì¤¿¥¢¥¯¥»¥¹µö²Ä¤òÀßÄꤹ¤ë¡£ +¤½¤Î¥¹¥È¥ê¡¼¥à¤òÄ̤¸¤Æ¡¢ +.I buf +¤Ç»ØÄꤵ¤ì¤¿Ê¸»úÎó¤ä¥á¥â¥ê¥Ð¥Ã¥Õ¥¡¤Ø¤ÎÆɤ߽ñ¤­¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¾¯¤Ê¤¯¤È¤â +.I size +¥Ð¥¤¥È¤ÎŤµ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The argument +.\"O .I mode +.\"O is the same as for +.\"O .BR fopen (3). +.\"O If +.\"O .I mode +.\"O specifies an append mode, then the initial file position is set to +.\"O the location of the first null byte (\(aq\\0\(aq) in the buffer; +.\"O otherwise the initial file position is set to the start of the buffer. +°ú¤­¿ô +.I mode +¤Ï +.BR fopen (3) +¤Î¾ì¹ç¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.I mode +¤ÇÄɵ­¥â¡¼¥É (append mode) ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥Õ¥¡¥¤¥ë°ÌÃ֤νé´üÃÍ¤Ï +¥Ð¥Ã¥Õ¥¡Ãæ¤ÎºÇ½é¤Î NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Î°ÌÃÖ¤ËÀßÄꤵ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¥Õ¥¡¥¤¥ë°ÌÃ֤νé´üÃͤϥХåե¡¤ÎÀèƬ¤Ë¤Ê¤ë¡£ +.\"O Since glibc 2.9, +.\"O the letter 'b' may be specified as the second character in +.\"O .IR mode . +.\"O This provides "binary" mode: +.\"O writes don't implicitly add a terminating null byte, and +.\"O .BR fseek (3) +.\"O .B SEEK_END +.\"O is relative to the end of the buffer (i.e., the value specified by the +.\"O .I size +.\"O argument), rather than the current string length. +glibc 2.9 °Ê¹ß¤Ç¤Ï¡¢Ê¸»ú 'b' ¤ò +.I mode +¤ÎÆóÈÖÌܤÎʸ»ú¤È¤·¤Æ»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Îʸ»ú¤Ï¡Ö¥Ð¥¤¥Ê¥ê¡×¥â¡¼¥É¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥â¡¼¥É¤Ç¤Ï¡¢½ñ¤­¹þ¤ß»þ¤Ëʸ»úÎó½ªÃ¼¤Î¥Ì¥ë¥Ð¥¤¥È¤¬ÌۤäÆÄɲà +¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£¤Þ¤¿¡¢ +.BR fseek (3) +.B SEEK_END +¤Ï¡¢Ê¸»úÎó¤ÎŤµ¤«¤é¤ÎÁêÂÐÃͤǤϤʤ¯¡¢¥Ð¥Ã¥Õ¥¡¤ÎËöÈø +.RI ( size +¤Ç»ØÄꤷ¤¿ÃÍ) ¤«¤é¤ÎÁêÂÐÃͤȤʤ롣 +.PP +.\"O When a stream that has been opened for writing is flushed +.\"O .RB ( fflush (3)) +.\"O or closed +.\"O .RB ( fclose (3)), +.\"O a null byte is written at the end of the buffer if there is space. +.\"O The caller should ensure that an extra byte is available in the +.\"O buffer +.\"O (and that +.\"O .I size +.\"O counts that byte) +.\"O to allow for this. +½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ò¥Õ¥é¥Ã¥·¥å +.RB ( fflush (3)) +¤ä¥¯¥í¡¼¥º +.RB ( fclose (3)) +¤·¤¿»þ¤Ë¡¢ +(¥Ð¥Ã¥Õ¥¡¤Ë¶õ¤­¤¬¤¢¤ì¤Ð) NULL ¥Ð¥¤¥È¤¬¥Ð¥Ã¥Õ¥¡¤ÎËöÈø¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +¤³¤Î¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï +¥Ð¥Ã¥Õ¥¡¤Ë 1¥Ð¥¤¥È;͵¤òºî¤ë +.RI ( size +¤Ë¤³¤Î 1¥Ð¥¤¥È¤ò´Þ¤á¤¿Ãͤò»ØÄꤹ¤ë) ɬÍפ¬¤¢¤ë¡£ + +.\"O Attempts to write more than +.\"O .I size +.\"O bytes to the buffer result in an error. +¥Ð¥Ã¥Õ¥¡¤Ë +.I size +¥Ð¥¤¥È¤è¤ê¤¿¤¯¤µ¤ó½ñ¤­¹þ¤â¤¦¤È¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¥¨¥é¡¼¤È¤Ê¤ë¡£ +.\"O (By default, such errors will only be visible when the +.\"O .I stdio +.\"O buffer is flushed. +.\"O Disabling buffering with +.\"O .I setbuf(fp,\ NULL) +.\"O may be useful to detect errors at the time of an output operation. +.\"O Alternatively, the caller can explicitly set +.\"O .I buf +.\"O as the stdio stream buffer, at the same time informing stdio +.\"O of the buffer's size, using +.\"O .IR "setbuffer(fp, buf, size)" .) +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤Ê¥¨¥é¡¼¤¬¸«¤¨¤ë¤Î¤Ï +.I stdio +¥Ð¥Ã¥Õ¥¡¤¬¥Õ¥é¥Ã¥·¥å¤µ¤ì¤¿»þ¤À¤±¤Ç¤¢¤ë¡£ +.I setbuf(fp,\ NULL) +¤ò»È¤Ã¤Æ¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ò̵¸ú¤Ë¤¹¤ëÊýË¡¤Ï¡¢ +½ÐÎÏÁàºî¤ò¹Ô¤Ã¤¿»þÅÀ¤Ç¥¨¥é¡¼¤ò¸¡½Ð¤¹¤ë¤Î¤ËÌòΩ¤Ä¡£ +Ê̤ÎÊýË¡¤È¤·¤Æ¤Ï¡¢ +.IR "setbuffer(fp, buf, size)" +¤ò»È¤Ã¤Æ¡¢¸Æ¤Ó½Ð¤·Â¦¤¬ÌÀ¼¨Åª¤Ë +stdio ¥¹¥È¥ê¡¼¥à¥Ð¥Ã¥Õ¥¡¤È¤·¤Æ +.I buf +¤ò»ØÄꤷ¡¢¥Ð¥Ã¥Õ¥¡¤Î»ØÄê»þ¤Ë¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò +stdio ¤Ë¶µ¤¨¤ëÊýË¡¤¬¤¢¤ë¡£) +.\" See http://sourceware.org/bugzilla/show_bug.cgi?id=1995 +.\" and +.\" http://sources.redhat.com/ml/libc-alpha/2006-04/msg00064.html +.PP +.\"O In a stream opened for reading, +.\"O null bytes (\(aq\\0\(aq) in the buffer do not cause read +.\"O operations to return an end-of-file indication. +.\"O A read from the buffer will only indicate end-of-file +.\"O when the file pointer advances +.\"O .I size +.\"O bytes past the start of the buffer. +Æɤ߽Ф·ÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ç¤Ï¡¢ +¥Ð¥Ã¥Õ¥¡Æâ¤Ë NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤¬¤¢¤Ã¤Æ¤â +Æɤ߽Ф·Áàºî¤¬¥Õ¥¡¥¤¥ëËöÈø (end-of-file) ¤òÊÖ¤¹¤³¤È¤Ï¤Ê¤¤¡£ +¥Ð¥Ã¥Õ¥¡¤«¤é¤ÎÆɤ߽Ф·¤Ç¥Õ¥¡¥¤¥ëËöÈø¤¬ÊÖ¤ë¤Î¤Ï¡¢ +¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤¬¥Ð¥Ã¥Õ¥¡¤ÎÀèƬ¤«¤é +.I size +¥Ð¥¤¥È¤ò±Û¤¨¤ÆÀè¤Ë¿Ê¤â¤¦¤È¤·¤¿¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +.PP +.\"O If +.\"O .I buf +.\"O is specified as NULL, then +.\"O .BR fmemopen () +.\"O dynamically allocates a buffer +.\"O .I size +.\"O bytes long. +.I buf +¤Ë NULL ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.BR fmemopen () +¤ÏưŪ¤Ë +.I size +¥Ð¥¤¥È¤ÎŤµ¤Î¥Ð¥Ã¥Õ¥¡¤ò³ÎÊݤ¹¤ë¡£ +.\"O This is useful for an application that wants to write data to +.\"O a temporary buffer and then read it back again. +.\"O The buffer is automatically freed when the stream is closed. +.\"O Note that the caller has no way to obtain a pointer to the +.\"O temporary buffer allocated by this call (but see +.\"O .BR open_memstream () +.\"O below). +¤³¤ÎÊýË¡¤Ï¡¢°ì»þ¥Ð¥Ã¥Õ¥¡¤Ë¥Ç¡¼¥¿¤Î½ñ¤­¹þ¤ß¤ò¹Ô¤Ã¤Æ¤«¤é¡¢ +¤½¤ÎÆâÍƤòºÆÅÙÆɤ߽Ф¹¤è¤¦¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÍ­ÍѤǤ¢¤ë¡£ +¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¥¹¥È¥ê¡¼¥à¤¬¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¤­¤Ë¼«Æ°Åª¤Ë²òÊü¤µ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¤«¤é¤Ï¤³¤Î´Ø¿ô¤¬³ä¤êÅö¤Æ¤¿°ì»þ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿Ãͤò +ÃΤëÊýË¡¤Ï¸ºß¤·¤Ê¤¤ÅÀ¤ËÃí°Õ (²¼µ­¤Î +.BR open_memstream () +¤â»²¾È)¡£ + +.\"O The +.\"O .BR open_memstream () +.\"O function opens a stream for writing to a buffer. +.\"O The buffer +.\"O is dynamically allocated (as with +.\"O .BR malloc (3)), +.\"O and automatically grows as required. +.\"O After closing the stream, the caller should +.\"O .BR free (3) +.\"O this buffer. +.BR open_memstream () +´Ø¿ô¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Ø¤Î½ñ¤­¹þ¤ßÍѤ˥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +¥Ð¥Ã¥Õ¥¡¤Ï +.RB ( malloc (3) +¤ò»È¤Ã¤Æ) ưŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¡¢É¬Íפ˱þ¤¸¤Æ¼«Æ°Åª¤Ë¿­Ä¹¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤ò¥¯¥í¡¼¥º¤·¤¿¸å¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï¤³¤Î¥Ð¥Ã¥Õ¥¡¤ò +.BR free (3) +¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O When the stream is closed +.\"O .RB ( fclose (3)) +.\"O or flushed +.\"O .RB ( fflush (3)), +.\"O the locations pointed to by +.\"O .I ptr +.\"O and +.\"O .I sizeloc +.\"O are updated to contain, respectively, a pointer to the buffer and the +.\"O current size of the buffer. +.\"O These values remain valid only as long as the caller +.\"O performs no further output on the stream. +.\"O If further output is performed, then the stream +.\"O must again be flushed before trying to access these variables. +¤³¤Î¥¹¥È¥ê¡¼¥à¤¬ +¥¯¥í¡¼¥º +.RB ( fclose (3)) +¤µ¤ì¤¿¤ê¥Õ¥é¥Ã¥·¥å +.RB ( fflush (3)) +¤µ¤ì¤¿»þ¤Ë¡¢ +.I ptr +¤È +.I sizeloc +¤ÎÃͤϤ½¤ì¤¾¤ì¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤½¤Î¥µ¥¤¥º¤Ë¹¹¿·¤µ¤ì¤ë¡£ +¤³¤ì¤é¤ÎÃͤϡ¢¸Æ¤Ó½Ð¤·¸µ¤¬¤½¤Î¥¹¥È¥ê¡¼¥à¤Ë¿·¤¿¤Ê½ñ¤­¹þ¤ß¤ò +¹Ô¤ï¤Ê¤¤¾ì¹ç¤Ë¸Â¤êÍ­¸ú¤Ç¤¢¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤Ã¤¿ºÝ¤Ë¤Ï¡¢¤³¤ì¤é¤ÎÊÑ¿ô¤ò»²¾È¤¹¤ëÁ°¤Ë +¥¹¥È¥ê¡¼¥à¤òºÆÅÙ¥Õ¥é¥Ã¥·¥å¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O A null byte is maintained at the end of the buffer. +.\"O This byte is +.\"O .I not +.\"O included in the size value stored at +.\"O .IR sizeloc . +¥Ð¥Ã¥Õ¥¡ËöÈø¤Î NULL ¥Ð¥¤¥È¤ÏÊÝ»ý¤µ¤ì¤ë¡£ +¤³¤Î NULL ¥Ð¥¤¥È¤Ï +.I sizeloc +¤Ë³ÊǼ¤µ¤ì¤ë¥µ¥¤¥º¤Ë¤Ï¡Ö´Þ¤Þ¤ì¤Ê¤¤¡×¡£ + +.\"O The stream's file position can be changed with +.\"O .BR fseek (3) +.\"O or +.\"O .BR fseeko (3). +.\"O Moving the file position past the end +.\"O of the data already written fills the intervening space with +.\"O zeros. +¥¹¥È¥ê¡¼¥à¤Î¥Õ¥¡¥¤¥ë°ÌÃÖ¤Ï +.BR fseek (3) +¤ä +.BR fseeko (3) +¤ÇÊѹ¹¤Ç¤­¤ë¡£ +¤¹¤Ç¤Ë¥Ç¡¼¥¿¤¬½ñ¤­¹þ¤Þ¤ì¤¿Îΰè¤ÎËöÈø¤è¤êÀè¤Ë¥Õ¥¡¥¤¥ë°ÌÃÖ¤òÆ°¤«¤¹¤È¡¢ +¤½¤Î´Ö¤ÎÎΰè¤Ï 0 ¤ÇËä¤á¤é¤ì¤ë¡£ + +.\"O The +.\"O .BR open_wmemstream () +.\"O is similar to +.\"O .BR open_memstream (), +.\"O but operates on wide characters instead of bytes. +.BR open_wmemstream () +¤Ï +.BR open_memstream () +¤ÈƱÍͤÀ¤¬¡¢¥Ð¥¤¥È¤Ç¤Ï¤Ê¤¯¥ï¥¤¥Éʸ»ú¤ËÂФ·¤ÆÁàºî¤ò¹Ô¤¦ÅÀ¤¬°Û¤Ê¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O Upon successful completion +.\"O .BR fmemopen (), +.\"O .BR open_memstream () +.\"O and +.\"O .BR open_wmemstream () +.\"O return a +.\"O .I FILE +.\"O pointer. +.\"O Otherwise, NULL is returned and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤·¤Æ½ªÎ»¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +.BR fmemopen (), +.BR open_memstream (), +.BR open_wmemstream () +¤Ï +.I FILE +¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢ NULL ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR fmemopen () +.\"O and +.\"O .BR open_memstream () +.\"O were already available in glibc 1.0.x. +.\"O .BR open_wmemstream () +.\"O is available since glibc 2.4. +.BR fmemopen () +¤È +.BR open_memstream () +¤Ï glibc 1.0.x ¤Ç¤¹¤Ç¤ËÍøÍѲÄǽ¤Ç¤¢¤Ã¤¿¡£ +.BR open_wmemstream () +¤Ï glibc 2.4 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2008. +.\"O These functions are not specified in POSIX.1-2001, +.\"O and are not widely available on other systems. +¤³¤ì¤é¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äê¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +Linux °Ê³°¤Î¥·¥¹¥Æ¥à¤Ç¹­¤¯ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O There is no file descriptor associated with the file stream +.\"O returned by these functions +.\"O (i.e., +.\"O .BR fileno (3) +.\"O will return an error if called on the returned stream). +¤³¤ì¤é¤Î´Ø¿ô¤¬ÊÖ¤¹¥Õ¥¡¥¤¥ë¥¹¥È¥ê¡¼¥à¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¤Ê¤¤ (¤Ä¤Þ¤ê¡¢ÊÖ¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ +.BR fileno (3) +¤ò¸Æ¤Ó½Ð¤¹¤È¥¨¥é¡¼¤¬Ê֤뤳¤È¤Ë¤Ê¤ë)¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O In glibc before version 2.7, seeking past the end of a stream created by +.\"O .BR open_memstream () +.\"O does not enlarge the buffer; instead the +.\"O .BR fseek () +.\"O call fails, returning \-1. +.\"O .\" http://sourceware.org/bugzilla/show_bug.cgi?id=1996 +¥Ð¡¼¥¸¥ç¥ó 2.7 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢ +.BR open_memstream () +¤ÇºîÀ®¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ÎËöÈø¤è¤êÀè¤Ë¥Õ¥¡¥¤¥ë°ÌÃÖ¤òÆ°¤«¤·¤Æ¤â¡¢ +¥Ð¥Ã¥Õ¥¡¤¬¿­Ä¹¤µ¤ì¤º¡¢ +.BR fseek () +¤¬¼ºÇÔ¤· \-1 ¤¬Ê֤롣 +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=1996 +.\"O .SH "EXAMPLE" +.SH Îã +.\"O The program below uses +.\"O .BR fmemopen () +.\"O to open an input buffer, and +.\"O .BR open_memstream () +.\"O to open a dynamically sized output buffer. +.\"O The program scans its input string (taken from the program's +.\"O first command-line argument) reading integers, +.\"O and writes the squares of these integers to the output buffer. +.\"O An example of the output produced by this program is the following: +¤³¤Î¥×¥í¥°¥é¥à¤Ï +.BR fmemopen () +¤ò»È¤Ã¤Æ½ÐÎϥХåե¡¤ò¥ª¡¼¥×¥ó¤·¡¢ +.BR open_memstream () +¤ò»È¤Ã¤ÆưŪ¤Ë¥µ¥¤¥º¤¬ÊѲ½¤¹¤ë½ÐÎϥХåե¡¤ò¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¡£ +(¥×¥í¥°¥é¥à¤ÎÂè°ì¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤«¤é¼è¤Ã¤¿) ÆþÎÏʸ»úÎó¤ò +¥¹¥­¥ã¥ó¤·¤ÆÀ°¿ô¤òÆɤ߹þ¤ß¡¢¤³¤ì¤é¤ÎÀ°¿ô¤ÎÆó¾è¤ò½ÐÎϥХåե¡¤Ë½ñ¤­½Ð¤¹¡£ +¤³¤Î¥×¥í¥°¥é¥à¤Î¼Â¹ÔÎã¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£ +.in +4n +.nf + +.RB "$" " ./a.out \(aq1 23 43\(aq" +size=11; ptr=1 529 1849 +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#define _GNU_SOURCE +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int +main(int argc, char *argv[]) +{ + FILE *out, *in; + int v, s; + size_t size; + char *ptr; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + in = fmemopen(argv[1], strlen(argv[1]), "r"); + if (in == NULL) + handle_error("fmemopen"); + + out = open_memstream(&ptr, &size); + if (out == NULL) + handle_error("fmemopen"); + + for (;;) { + s = fscanf(in, "%d", &v); + if (s <= 0) + break; + + s = fprintf(out, "%d ", v * v); + if (s == \-1) + handle_error("fprintf"); + } + fclose(in); + fclose(out); + printf("size=%ld; ptr=%s\\n", (long) size, ptr); + free(ptr); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fopen (3), +.BR fopencookie (3), +.BR feature_test_macros (7) diff --git a/draft/man3/fmin.3 b/draft/man3/fmin.3 new file mode 100644 index 00000000..3ccfa490 --- /dev/null +++ b/draft/man3/fmin.3 @@ -0,0 +1,87 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fmin, fminf, fminl \- determine minimum of two floating-point numbers +fmin, fminf, fminl \- Æó¤Ä¤ÎÉâÆ°¾®¿ôÅÀ¿ô¤ÎºÇ¾®Ãͤòµá¤á¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double fmin(double " x ", double " y ); +.br +.BI "float fminf(float " x ", float " y ); +.br +.BI "long double fminl(long double " x ", long double " y ); +.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) +»²¾È): +.in +.sp +.ad l +.BR fmin (), +.BR fminf (), +.BR fminl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 +.SH ÊÖ¤êÃÍ +.\"O These functions return the minimum of +.\"O .I x +.\"O and +.\"O .IR y . +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤È +.I y +¤ÎºÇ¾®ÃͤòÊÖ¤¹¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR fmax (3) diff --git a/draft/man3/fmod.3 b/draft/man3/fmod.3 new file mode 100644 index 00000000..7efc37b9 --- /dev/null +++ b/draft/man3/fmod.3 @@ -0,0 +1,205 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 ¾ê;´Ø¿ô +.\" +.TH FMOD 3 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fmod, fmodf, fmodl \- floating-point remainder function +fmod, fmodf, fmodl \- ÉâÆ°¾®¿ôÅÀ¾ê;´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double fmod(double " x ", double " y ); +.br +.BI "float fmodf(float " x ", float " y ); +.br +.BI "long double fmodl(long double " x ", long double " y ); +.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) +»²¾È): +.in +.sp +.ad l +.BR fmodf (), +.BR fmodl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 towards 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" +.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 +¤ÎÀäÂÐÃͤè¤ê¤â¾®¤µ¤¯¤Ê¤ë¤è¤¦¤ÊÀ°¿ô¤Ç¤¢¤ë¡£ + +.\"O If +.\"O .I x +.\"O or +.\"O .I y +.\"O is a NaN, a NaN is returned. +.I x +¤« +.I y +¤¬ 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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I y +.\"O is zero, +.\"O a domain error occurs, and +.\"O a NaN is returned. +.I y +¤¬ 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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is an infinity +Îΰ襨¥é¡¼: \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 ) +¤¬¾å¤¬¤ë¡£ +.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=6784 +.TP +.\"O Domain error: \fIy\fP is zero +Îΰ襨¥é¡¼: \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 "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" +.SH ´ØÏ¢¹àÌÜ +.BR remainder (3) diff --git a/draft/man3/fmtmsg.3 b/draft/man3/fmtmsg.3 new file mode 100644 index 00000000..65675d57 --- /dev/null +++ b/draft/man3/fmtmsg.3 @@ -0,0 +1,471 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" adapted glibc info page +.\" +.\" This should run as 'Guru Meditation' (amiga joke :) +.\" The function is quite complex and deserves an example +.\" +.\" Polished, aeb, 2003-11-01 +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Sat Jul 24 20:19:54 JST 2004 +.\" by Yuichi SATO +.\" +.TH FMTMSG 3 2008-06-14 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fmtmsg \- print formatted error messages +fmtmsg \- À°·Á¤µ¤ì¤¿¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fmtmsg(long " classification ", const char *" label , +.br +.BI " int " severity ", const char *" text , +.br +.BI " const char *" action ", const char *" tag ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This function displays a message described by its arguments on the device(s) +.\"O specified in the +.\"O .I classification +.\"O argument. +.\"O For messages written to +.\"O .IR stderr , +.\"O the format depends on the +.\"O .B MSGVERB +.\"O environment variable. +¤³¤Î´Ø¿ô¤Ï¡¢°ú¤­¿ô¤Çµ­½Ò¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤ò¡¢ +.I classification +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿¥Ç¥Ð¥¤¥¹¾å¤Ëɽ¼¨¤¹¤ë¡£ +.I stderr +¤Ë½ñ¤­½Ð¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢ +.B MSGVERB +´Ä¶­ÊÑ¿ô¤Ë°Í¸¤¹¤ë¡£ +.LP +.\"O The +.\"O .I label +.\"O argument identifies the source of the message. +.\"O The string must consist +.\"O of two colon separated parts where the first part has not more +.\"O than 10 and the second part not more than 14 characters. +.I label +°ú¤­¿ô¤Ï¥á¥Ã¥»¡¼¥¸¤ÎȯÀ¸¸»¤ò¼±Ê̤¹¤ë¡£ +¤³¤Îʸ»úÎó¤Ï¥³¥í¥ó¤Ç¶èÀÚ¤é¤ì¤¿ 2 ¤Ä¤ÎÉôʬ¤«¤é¹½À®¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +1 ¤ÄÌܤÎÉôʬ¤Ï 10 ʸ»ú°ÊÆâ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +2 ¤ÄÌܤÎÉôʬ¤Ï 14 ʸ»ú°ÊÆâ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.LP +.\"O The +.\"O .I text +.\"O argument describes the condition of the error. +.I text +°ú¤­¿ô¤Ë¤Ï¥¨¥é¡¼¾ò·ï¤òµ­½Ò¤¹¤ë¡£ +.LP +.\"O The +.\"O .I action +.\"O argument describes possible steps to recover from the error. +.\"O If it is printed, it is prefixed by "TO FIX: ". +.I action +°ú¤­¿ô¤Ë¤Ï¥¨¥é¡¼¤«¤é²óÉü¤¹¤ë¤¿¤á¤ËÍøÍѲÄǽ¤Ê¥¹¥Æ¥Ã¥×¤òµ­½Ò¤¹¤ë¡£ +¤³¤ì¤¬É½¼¨¤µ¤ì¤ë¾ì¹ç¡¢"TO FIX: " ¤¬Á°¤ËÉÕ¤¯¡£ +.LP +.\"O The +.\"O .I tag +.\"O argument is a reference to the online documentation where more +.\"O information can be found. +.\"O It should contain the +.\"O .I label +.\"O value and a unique identification number. +.I tag +°ú¤­¿ô¤Ï¤è¤ê¿¤¯¤Î¾ðÊó¤ò¸«¤Ä¤±¤ë¤¿¤á¤Î¥ª¥ó¥é¥¤¥ó¥É¥­¥å¥á¥ó¥È¤Ø¤Î»²¾È¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï +.I label +Ãͤȥæ¥Ë¡¼¥¯¤Ê¼±ÊÌÈÖ¹æ¤ò´Þ¤ó¤Ç¤¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SS "Dummy arguments" +.SS ¥À¥ß¡¼°ú¤­¿ô +.\"O Each of the arguments can have a dummy value. +.\"O The dummy classification value +.\"O .B MM_NULLMC +.\"O (0L) does not specify any output, so nothing is printed. +³Æ°ú¤­¿ô¤Ë¤Ï¥À¥ß¡¼¤ÎÃͤòÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥À¥ß¡¼¤Î +.I classification +ÃÍ +.B MM_NULLMC +(0L) ¤Ï½ÐÎϤò²¿¤â»ØÄꤷ¤Ê¤¤¡£¤½¤Î¤¿¤á²¿¤âɽ¼¨¤µ¤ì¤Ê¤¤¡£ +.\"O The dummy severity value +.\"O .B NO_SEV +.\"O (0) says that no severity is supplied. +¥À¥ß¡¼¤Î +.I severity +ÃÍ +.B NO_SEV +(0) ¤Ï½ÅÂçÅÙ (severity) ¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤òɽ¤¹¡£ +.\"O The values +.\"O .BR MM_NULLLBL , +.\"O .BR MM_NULLTXT , +.\"O .BR MM_NULLACT , +.\"O .B MM_NULLTAG +.\"O are synonyms for +.\"O .IR "((char *) 0)" , +.\"O the empty string, and +.\"O .B MM_NULLSEV +.\"O is a synonym for +.\"O .BR NO_SEV . +ÃÍ +.BR MM_NULLLBL , +.BR MM_NULLTXT , +.BR MM_NULLACT , +.B MM_NULLTAG +¤Ï +.I "((char *) 0)" +¤È¶õʸ»úÎó¤ÎÊÌ̾¤Ç¤¢¤ê¡¢ +.B MM_NULLSEV +¤Ï +.B NO_SEV +¤ÎÊÌ̾¤Ç¤¢¤ë¡£ +.\"O .SS "The classification argument" +.SS "classification °ú¤­¿ô" +.\"O The +.\"O .I classification +.\"O argument is the sum of values describing 4 types of information. +.I classification +°ú¤­¿ô¤Ï 4 ¼ïÎà¤Î¾ðÊó¤òµ­½Ò¤¹¤ëÃͤÎϤǤ¢¤ë¡£ +.br +.sp +.\"O The first value defines the output channel. +ºÇ½é¤ÎÃͤϽÐÎÏ¥Á¥ã¥ó¥Í¥ë¤òÄêµÁ¤¹¤ë¡£ +.TP 12n +.B MM_PRINT +.\"O Output to +.\"O .IR stderr . +.I stderr +¤Ë½ÐÎϤ¹¤ë¡£ +.TP +.B MM_CONSOLE +.\"O Output to the system console. +¥·¥¹¥Æ¥à¥³¥ó¥½¡¼¥ë¤Ë½ÐÎϤ¹¤ë¡£ +.TP +.B "MM_PRINT | MM_CONSOLE" +.\"O Output to both. +ξÊý¤Ë½ÐÎϤ¹¤ë¡£ +.PP +.\"O The second value is the source of the error: +2 ÈÖÌܤÎÃͤϥ¨¥é¡¼¤ÎȯÀ¸¸»¤Ç¤¢¤ë: +.TP 12n +.B MM_HARD +.\"O A hardware error occurred. +¥Ï¡¼¥É¥¦¥§¥¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B MM_FIRM +.\"O A firmware error occurred. +¥Õ¥¡¡¼¥à¥¦¥§¥¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B MM_SOFT +.\"O A software error occurred. +¥½¥Õ¥È¥¦¥§¥¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.PP +.\"O The third value encodes the detector of the problem: +3 ÈÖÌܤÎÃͤÏÌäÂê¤Î¸¡ÃΤò¹Ô¤Ã¤¿¤â¤Î¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë: +.TP 12n +.B MM_APPL +.\"O It is detected by an application. +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¸¡ÃΤµ¤ì¤¿¡£ +.TP +.B MM_UTIL +.\"O It is detected by a utility. +¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ë¤è¤Ã¤Æ¸¡ÃΤµ¤ì¤¿¡£ +.TP +.B MM_OPSYS +.\"O It is detected by the operating system. +¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¸¡ÃΤµ¤ì¤¿¡£ +.PP +.\"O The fourth value shows the severity of the incident: +4 ÈÖÌܤÎÃͤÏÌäÂê¤Î½ÅÂçÅÙ¤òɽ¤¹: +.TP 12n +.B MM_RECOVER +.\"O It is a recoverable error. +²óÉü²Äǽ¤Ê¥¨¥é¡¼¤Ç¤¢¤ë¡£ +.TP +.B MM_NRECOV +.\"O It is a nonrecoverable error. +²óÉüÉÔ²Äǽ¤Ê¥¨¥é¡¼¤Ç¤¢¤ë¡£ +.\"O .SS "The severity argument" +.SS "severity °ú¤­¿ô" +.\"O The +.\"O .I severity +.\"O argument can take one of the following values: +.I severity +°ú¤­¿ô¤Ï°Ê²¼¤Î 1 ¤Ä¤ÎÃͤò¤È¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 12n +.B MM_NOSEV +.\"O No severity is printed. +½ÅÂçÅÙ¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¡£ +.TP +.B MM_HALT +.\"O This value is printed as HALT. +¤³¤ÎÃÍ¤Ï HALT ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ +.TP +.B MM_ERROR +.\"O This value is printed as ERROR. +¤³¤ÎÃÍ¤Ï ERROR ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ +.TP +.B MM_WARNING +.\"O This value is printed as WARNING. +¤³¤ÎÃÍ¤Ï WARNING ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ +.TP +.B MM_INFO +.\"O This value is printed as INFO. +¤³¤ÎÃÍ¤Ï INFO ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ +.PP +.\"O The numeric values are between 0 and 4. +.\"O Using +.\"O .BR addseverity (3) +.\"O or the environment variable +.\"O .B SEV_LEVEL +.\"O you can add more levels and strings to print. +¿ôÃͤξì¹ç¤Ï 0 ¤«¤é 4 ¤Ç¤¢¤ë¡£ +.BR addseverity (3) +¤Þ¤¿¤Ï´Ä¶­ÊÑ¿ô +.B SEV_LEVEL +¤ò»È¤¦¤³¤È¤Ë¤è¤ê¡¢É½¼¨¤¹¤ë¥ì¥Ù¥ë¤Èʸ»úÎó¤ò¹¹¤ËÄɲäǤ­¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The function can return 4 values: +´Ø¿ô¤Ï 4 ¤Ä¤ÎÃͤòÊÖ¤¹: +.TP 12n +.B MM_OK +.\"O Everything went smooth. +Á´¤Æ¤¬¤¦¤Þ¤¯¤¤¤Ã¤¿¡£ +.TP +.B MM_NOTOK +.\"O Complete failure. +´°Á´¤Ë¼ºÇÔ¤·¤¿¡£ +.TP +.B MM_NOMSG +.\"O Error writing to +.\"O .IR stderr . +.I stderr +¤Ë½ñ¤­¹þ¤à¤È¤­¤Ë¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B MM_NOCON +.\"O Error writing to the console. +¥³¥ó¥½¡¼¥ë¤Ë½ñ¤­¹þ¤à¤È¤­¤Ë¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.\"O .SH ENVIRONMENT +.SH ´Ä¶­ÊÑ¿ô +.\"O The environment variable +.\"O .B MSGVERB +.\"O ("message verbosity") can be used to suppress parts of +.\"O the output to +.\"O .IR stderr . +´Ä¶­ÊÑ¿ô +.B MSGVERB +("message verbosity") ¤Ï +.I stderr +¤Ø¤Î½ÐÎϤΰìÉô¤òÍÞÀ©¤¹¤ë¤Î¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O (It does not influence output to the console.) +(¥³¥ó¥½¡¼¥ë¤Ø¤Î½ÐÎϤˤϱƶÁ¤·¤Ê¤¤¡£) +.\"O When this variable is defined, is non-NULL, and is a colon-separated +.\"O list of valid keywords, then only the parts of the message corresponding +.\"O to these keywords is printed. +¤³¤ÎÊÑ¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¡¢NULL ¤Ç¤Ê¤¯¡¢ +¥³¥í¥ó¤Ç¶èÀÚ¤é¤ì¤¿Í­¸ú¤Ê¥­¡¼¥ï¡¼¥É¤Î¥ê¥¹¥È¤Ç¤¢¤ë¾ì¹ç¡¢ +¥­¡¼¥ï¡¼¥É¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¤Î°ìÉô¤Î¤ß¤¬É½¼¨¤µ¤ì¤ë¡£ +.\"O Valid keywords are "label", "severity", "text", "action" and "tag". +Í­¸ú¤Ê¥­¡¼¥ï¡¼¥É¤Ï "label", "severity", "text", "action", "tag" ¤Ç¤¢¤ë¡£ +.PP +.\"O The environment variable +.\"O .B SEV_LEVEL +.\"O can be used to introduce new severity levels. +´Ä¶­ÊÑ¿ô +.B SEV_LEVEL +¤Ï¿·¤·¤¤½ÅÂçÅÙ¥ì¥Ù¥ë¤òƳÆþ¤¹¤ë¤Î¤Ë»ÈÍѤǤ­¤ë¡£ +.\"O By default, only the five severity levels described +.\"O above are available. +.\"O Any other numeric value would make +.\"O .BR fmtmsg () +.\"O print nothing. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¾åµ­¤Î 5 ¤Ä¤Î½ÅÂçÅÙ¥ì¥Ù¥ë¤Î¤ß¤¬ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +¾¤Î¿ôÃͤξì¹ç¡¢ +.BR fmtmsg () +¤Ï²¿¤âɽ¼¨¤·¤Ê¤¤¡£ +.\"O If the user puts +.\"O .B SEV_LEVEL +.\"O with a format like +.\"O .sp +.\"O .RS +.\"O SEV_LEVEL=[description[:description[:...]]] +.\"O .RE +.\"O .sp +.\"O in the environment of the process before the first call to +.\"O .BR fmtmsg (), +.\"O where each description is of the form +.\"O .sp +.\"O .RS +.\"O severity-keyword,level,printstring +.\"O .RE +.\"O .sp +.\"O then +.\"O .BR fmtmsg () +.\"O will also accept the indicated values for the level (in addition to +.\"O the standard levels 0-4), and use the indicated printstring when +.\"O such a level occurs. +.BR fmtmsg () +¤ò½é¤á¤Æ¸Æ¤Ó½Ð¤¹Á°¤Ë¡¢¥æ¡¼¥¶¤¬ +.B SEV_LEVEL +¤ò +.sp +.RS +SEV_LEVEL=[description[:description[:...]]] +.RE +.sp +¤Î¤è¤¦¤Ê·Á¼°¤Ç¥×¥í¥»¥¹¤Î´Ä¶­¤ËÀßÄꤹ¤ë¤È¡¢ +.BR fmtmsg () +¤Ï (ɸ½à¤Î¥ì¥Ù¥ë 0-4 ¤Ë²Ã¤¨¤Æ) level ¤Ë»ØÄꤵ¤ì¤¿Ãͤâ¼õ¤±ÉÕ¤±¡¢ +¤½¤Î¤è¤¦¤Ê¥ì¥Ù¥ë¤ÎÌäÂ꤬ȯÀ¸¤¹¤ë¤È»ØÄꤵ¤ì¤¿ printstring ¤òɽ¼¨¤¹¤ë¡£ +³Æ description ¤Ï +.sp +.RS +severity-keyword,level,printstring +.RE +.sp +¤È¤¤¤¦·Á¼°¤Ç¤¢¤ë¡£ +.LP +.\"O The severity-keyword part is not used by +.\"O .BR fmtmsg () +.\"O but it has to be present. +severity-keyword Éô¤Ï +.BR fmtmsg () +¤Ë»ÈÍѤµ¤ì¤Ê¤¤¤¬¡¢Â¸ºß¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O The level part is a string representation of a number. +level Éô¤Ï¿ôÃͤòʸ»úÎó¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.\"O The numeric value must be a number greater than 4. +¿ôÃÍ¤Ï 4 ¤è¤êÂ礭¤¤ÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O This value must be used in the severity argument of +.\"O .BR fmtmsg () +.\"O to select this class. +.\"O It is not possible to overwrite +.\"O any of the predefined classes. +.\"O The printstring +.\"O is the string printed when a message of this class is processed by +.\"O .BR fmtmsg (). +¤³¤ÎÃÍ¤Ï +.BR fmtmsg () +¤Î severity °ú¤­¿ô¤Ç»ÈÍѤµ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¤³¤Î½ÅÂçÅÙ¤òÁªÂò¤¹¤ë¡£ +Á°¤â¤Ã¤ÆÀë¸À¤µ¤ì¤¿½ÅÂçÅÙ¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +printstring ¤Ï¡¢ +¤³¤Î½ÅÂçÅ٤Υá¥Ã¥»¡¼¥¸¤¬ +.BR fmtmsg () +¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤¿¾ì¹ç¤Ëɽ¼¨¤µ¤ì¤ëʸ»úÎó¤Ç¤¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR fmtmsg () +.\"O is provided in glibc since version 2.1. +.BR fmtmsg () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The functions +.\"O .BR fmtmsg () +.\"O and +.\"O .BR addseverity (3), +.\"O and environment variables +.\"O .B MSGVERB +.\"O and +.\"O .B SEV_LEVEL +.\"O come from System V. +´Ø¿ô +.BR fmtmsg () +¤È +.BR addseverity (3) +¤È´Ä¶­ÊÑ¿ô +.B MSGVERB +¤È +.B SEV_LEVEL +¤Ï System V ¤ËͳÍ褷¤Æ¤¤¤ë¡£ +.\"O The function +.\"O .BR fmtmsg () +.\"O and the environment variable +.\"O .B MSGVERB +.\"O are described in POSIX.1-2001. +´Ø¿ô +.BR fmtmsg () +¤È´Ä¶­ÊÑ¿ô +.B MSGVERB +¤Ï POSIX.1-2001 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O System V and Unixware man pages tell us that these functions +.\"O have been replaced by "pfmt() and addsev()" or by "pfmt(), +.\"O vpfmt(), lfmt(), and vlfmt()", and will be removed later. +System V ¤È Unixware ¤Î man ¥Ú¡¼¥¸¤Ë¤Ï¡¢ +¡Ö¤³¤ì¤é¤Î´Ø¿ô¤Ï "pfmt() ¤È addsev()" +¤Þ¤¿¤Ï "pfmt(), vpfmt(), lfmt(), vlfmt()" ¤ÇÃÖ¤­´¹¤¨¤é¤ì¤Æ¤ª¤ê¡¢ +¾­Íè¤Ïºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¢¤ë¡×¤È½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.nf +#include +#include +#include + +int +main(void) +{ + long class = MM_PRINT | MM_SOFT | MM_OPSYS | MM_RECOVER; + int err; + + err = fmtmsg(class, "util\-linux:mount", MM_ERROR, + "unknown mount option", "See mount(8).", + "util\-linux:mount:017"); + switch (err) { + case MM_OK: + break; + case MM_NOTOK: + printf("Nothing printed\en"); + break; + case MM_NOMSG: + printf("Nothing printed to stderr\en"); + break; + case MM_NOCON: + printf("No console output\en"); + break; + default: + printf("Unknown error from fmtmsg()\en"); + } + exit(EXIT_SUCCESS); +} +.fi +.PP +.\"O The output should be: +½ÐÎÏ¤Ï +.nf + + util\-linux:mount: ERROR: unknown mount option + TO FIX: See mount(8). util\-linux:mount:017 + +.fi +.\"O and after +¤Î¤è¤¦¤Ë¤Ê¤ê¡¢ +.nf + + MSGVERB=text:action; export MSGVERB + +.fi +.\"O the output becomes: +¤ò¼Â¹Ô¤·¤¿¸å¤Ç¤Ï +.nf + + unknown mount option + TO FIX: See mount(8). + +.fi +¤È¤Ê¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR addseverity (3), +.BR perror (3) diff --git a/draft/man3/fnmatch.3 b/draft/man3/fnmatch.3 new file mode 100644 index 00000000..fa9f1610 --- /dev/null +++ b/draft/man3/fnmatch.3 @@ -0,0 +1,163 @@ +.\" 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:35:54 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon Oct 16 00:16:29 2000 following Joseph S. Myers +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-03-18, NAKANO Takeo +.\" Modified 1998-12-18, NAKANO Takeo +.\" Updated 2006-03-05, Akihiro MOTOKI, catch up to LDP v2.25 +.\" +.TH FNMATCH 3 2000-10-15 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fnmatch \- match filename or pathname +fnmatch \- ¥Õ¥¡¥¤¥ë̾¤Þ¤¿¤Ï¥Ñ¥¹Ì¾¤Ø¤Î¥Þ¥Ã¥Á¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fnmatch(const char *" "pattern" ", const char *" string ", int " flags ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR fnmatch () +.\"O function checks whether the +.\"O .I string +.\"O argument matches the +.\"O .I pattern +.\"O argument, which is a shell wildcard pattern. +.BR fnmatch () +´Ø¿ô¤Ï +.I strings +°ú¤­¿ô¤¬ +.I pattern +°ú¤­¿ô¤Ë¥Þ¥Ã¥Á¤¹¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +.I pattern +¤Ë¤Ï¥·¥§¥ë¤Î¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤òÍ¿¤¨¤ë¡£ +.PP +.\"O The +.\"O .I flags +.\"O argument modifies the behavior; it is the bitwise OR of zero or more +.\"O of the following flags: +.I flags +°ú¤­¿ô¤Ë¤è¤êÆ°ºî¤òÊѹ¹¤Ç¤­¤ë¡£ +.I flags +¤Ï°Ê²¼¤Î¥Õ¥é¥°¤Î¥Ó¥Ã¥ÈËè¤Î OR ¤Ç»ØÄꤹ¤ë¡£ +.TP +.B FNM_NOESCAPE +.\"O If this flag is set, treat backslash as an ordinary character, +.\"O instead of an escape character. +¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å (\\) ¤ò¥¨¥¹¥±¡¼¥×ʸ»ú +¤Ç¤Ï¤Ê¤¯Ä̾ï¤Îʸ»ú¤È¤·¤Æ°·¤¦¡£ +.TP +.B FNM_PATHNAME +.\"O If this flag is set, match a slash in +.\"O .I string +.\"O only with a slash in +.\"O .I pattern +.\"O and not by an asterisk (*) or a question mark (?) metacharacter, +.\"O nor by a bracket expression ([]) containing a slash. +¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +.I string +Ãæ¤Î¥¹¥é¥Ã¥·¥å (/) ¤ò +.I pattern +¤Ë¤¢¤ë¥¹¥é¥Ã¥·¥å¤½¤Î¤â¤Î¤Ë¤À¤±¥Þ¥Ã¥Á¤µ¤»¡¢ +¥¢¥¹¥¿¥ê¥¹¥¯ (*) ¤äµ¿ÌäÉä (?) ¤Î¥á¥¿¥­¥ã¥é¥¯¥¿¤ä¡¢ +¥¹¥é¥Ã¥·¥å¤ò´Þ¤à¥Ö¥é¥±¥Ã¥Èɽ¸½ ([]) ¤Ë¤Ï¥Þ¥Ã¥Á¤µ¤»¤Ê¤¤¡£ +.TP +.B FNM_PERIOD +.\"O If this flag is set, a leading period in +.\"O .I string +.\"O has to be matched exactly by a period in +.\"O .IR pattern . +.\"O A period is considered to be leading if it is the first character in +.\"O .IR string , +.\"O or if both +.\"O .B FNM_PATHNAME +.\"O is set and the period immediately follows a slash. +¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +.I string +¤ÎÀèƬ¥Ô¥ê¥ª¥É (leading period) ¤Ï +.I pattern +Ãæ¤Î¥Ô¥ê¥ª¥É¤½¤Î¤â¤Î¤Ë¤·¤«¥Þ¥Ã¥Á¤·¤Ê¤¤¡£ÀèƬ¥Ô¥ê¥ª¥É¤È¤Ï¡¢ +.I string +¤ÎºÇ½é¤Îʸ»ú°ÌÃ֤ˤ¢¤ë¥Ô¥ê¥ª¥É¤Î¤³¤È¤Ç¤¢¤ë¡£¤¿¤À¤· +.B FNM_PATHNAME +¥Õ¥é¥°¤¬Æ±»þ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¥¹¥é¥Ã¥·¥å¤Îľ¸å¤Ë³¤¯¥Ô¥ê¥ª¥É +¤âÀèƬ¥Ô¥ê¥ª¥É¤È¤ß¤Ê¤µ¤ì¤ë¡£ +.TP +.B FNM_FILE_NAME +.\"O This is a GNU synonym for \fBFNM_PATHNAME\fR. +¤³¤ì¤Ï \fBFNM_PATHNAME\fR ¤ËÂФ¹¤ë GNU ¤Ç¤ÎƱµÁ¸ì¤Ç¤¢¤ë. +.TP +.B FNM_LEADING_DIR +.\"O If this flag (a GNU extension) is set, the pattern is considered to be +.\"O matched if it matches an initial segment of +.\"O .I string +.\"O which is followed by a slash. +.\"O This flag is mainly for the internal +.\"O use of glibc and is only implemented in certain cases. +¤³¤Î¥Õ¥é¥°¤Ï GNU ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£¤³¤ì¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¥Ñ¥¿¡¼¥ó¤¬ +.I string +¤ÎºÇ½é¤ÎÉôʬ (¤Ë¥¹¥é¥Ã¥·¥å¤òÉÕ¤±¤¿¤â¤Î) ¤Ë¥Þ¥Ã¥Á¤¹¤ì¤Ð¡¢ +¥Þ¥Ã¥Á¤·¤¿¤â¤Î¤È¤ß¤Ê¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¼ç¤È¤·¤Æ glibc ¤ÇÆâÉôŪ¤Ë»ÈÍѤ·¡¢¤½¤Î¤¿¤á¤Î¤ß¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B FNM_CASEFOLD +.\"O If this flag (a GNU extension) is set, the pattern is matched +.\"O case-insensitively. +¤³¤Î¥Õ¥é¥°¤Ï GNU ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£¤³¤ì¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¥Ñ¥¿¡¼¥ó¤Î¥Þ¥Ã¥Á¤ËÂçʸ»ú¾®Ê¸»ú¤¬¶èÊ̤µ¤ì¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O Zero if +.\"O .I string +.\"O matches +.\"O .IR pattern , +.\"O .B FNM_NOMATCH +.\"O if there is no match or another nonzero value if there is an error. +.I string +¤¬ +.I pattern +¤Ë¥Þ¥Ã¥Á¤¹¤ì¤Ð 0 ¤òÊÖ¤¹¡£¥Þ¥Ã¥Á¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï +.B FNM_NOMATCH +¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï¤½¤ì°Ê³°¤ÎÈó¥¼¥íÃͤòÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.2. +.\"O The +.\"O .BR FNM_FILE_NAME ", " FNM_LEADING_DIR ", and " FNM_CASEFOLD +.\"O flags are GNU extensions. +.BR FNM_FILE_NAME ", " FNM_LEADING_DIR ", " FNM_CASEFOLD +¥Õ¥é¥°¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sh (1), +.BR glob (3), +.BR scandir (3), +.BR wordexp (3), +.BR glob (7) diff --git a/draft/man3/fopen.3 b/draft/man3/fopen.3 new file mode 100644 index 00000000..440bf77c --- /dev/null +++ b/draft/man3/fopen.3 @@ -0,0 +1,530 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fopen.3 6.8 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu +.\" Modified, aeb, 960421, 970806 +.\" Modified, joey, aeb, 2002-01-03 +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated Thu Feb 13 12:10:38 JST 1997 +.\" by YOSHINO Takashi +.\" Updated & Modified Mon Mar 1 1999 +.\" by NAKANO Takeo +.\" Updated 1999-12-08, Kentaro Shirakata +.\" Updated 2001-12-13, Kentaro Shirakata +.\" Updated 2002-03-23, Kentaro Shirakata +.\" Updated 2005-10-15, Kentaro Shirakata +.\" Updated 2006-07-20, Akihiro MOTOKI +.\" +.\"WORD: file descriptor ¥Õ¥¡¥¤¥ëµ­½Ò»Ò +.\"WORD: file position indicator ¥Õ¥¡¥¤¥ë°ÌÃֻؼ¨»Ò +.\"WORD: indicator »Ø¼¨»Ò +.\"WORD: global variable Âç°èÊÑ¿ô +.\"WORD: cancellation points ¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È +.\" +.TH FOPEN 3 2009-02-23 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +.\"O fopen, fdopen, freopen \- stream open functions +fopen, fdopen, freopen \- ¥¹¥È¥ê¡¼¥à¤ò³«¤¯´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "FILE *fopen(const char *" path ", const char *" mode ); + +.BI "FILE *fdopen(int " fd ", const char *" mode ); + +.BI "FILE *freopen(const char *" path ", const char *" mode ", FILE *" stream ); +.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 fdopen (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.SH ÀâÌÀ +.\"O The +.\"O .BR fopen () +.\"O function opens the file whose name is the string pointed to by +.\"O .I path +.\"O and associates a stream with it. +.BR fopen () +´Ø¿ô¤Ï¡¢ +.I path +¤Ç»ØÄꤵ¤ì¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤ò³«¤­¡¢¥¹¥È¥ê¡¼¥à¤È·ë¤Ó¤Ä¤±¤ë¡£ +.PP +.\"O The argument +.\"O .I mode +.\"O points to a string beginning with one of the following sequences +.\"O (Additional characters may follow these sequences.): +°ú¿ô +.I mode +¤Ï¡¢°Ê²¼¤Ë³¤¯Ê¸»ú¤Î¤Ò¤È¤Ä¤«¤é»Ï¤Þ¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë +(ÄɲäÎʸ»ú¤¬¤³¤Îʸ»ú¤Î¸å¤Ë³¤¯¤³¤È¤â¤¢¤ë): +.TP +.B r +.\"O Open text file for reading. +.\"O The stream is positioned at the beginning of the file. +¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤òÆɤ߽Ф¹¤¿¤á¤Ë³«¤¯¡£ +¥¹¥È¥ê¡¼¥à¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë°ÌÃÖ¤µ¤ì¤ë¡£ +.TP +.B r+ +.\"O Open for reading and writing. +.\"O The stream is positioned at the beginning of the file. +Æɤ߽Ф·¤ª¤è¤Ó½ñ¤­¹þ¤ß¤¹¤ë¤¿¤á¤Ë³«¤¯¡£ +¥¹¥È¥ê¡¼¥à¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë°ÌÃÖ¤µ¤ì¤ë¡£ +.TP +.B w +.\"O Truncate file to zero length or create text file for writing. +.\"O The stream is positioned at the beginning of the file. +¥Õ¥¡¥¤¥ë¤ò½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë³«¤¯¡£ +¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ë¤ÏŤµ¥¼¥í¤ËÀÚ¤êµÍ¤á¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¿·¤¿¤ËºîÀ®¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë°ÌÃÖ¤µ¤ì¤ë¡£ +.TP +.B w+ +.\"O Open for reading and writing. +.\"O The file is created if it does not exist, otherwise it is truncated. +.\"O The stream is positioned at the beginning of the file. +Æɤ߽Ф·¤ª¤è¤Ó½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë³«¤¯¡£ +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¿·¤¿¤ËºîÀ®¤¹¤ë¡£ +¸ºß¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤ÏŤµ¥¼¥í¤ËÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë°ÌÃÖ¤µ¤ì¤ë¡£ +.TP +.B a +.\"O Open for appending (writing at end of file). +.\"O The file is created if it does not exist. +.\"O The stream is positioned at the end of the file. +Äɲà (¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë½ñ¤­¹þ¤à) ¤Î¤¿¤á¤Ë³«¤¯¡£ +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¿·¤¿¤ËºîÀ®¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Ï¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë°ÌÃÖ¤µ¤ì¤ë¡£ +.TP +.B a+ +.\"O Open for reading and appending (writing at end of file). +.\"O The file is created if it does not exist. +.\"O The initial file position for reading is at the beginning of the file, +.\"O but output is always appended to the end of the file. +Æɤ߽Ф·¤ª¤è¤ÓÄɲà (¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë½ñ¤­¹þ¤à) ¤Î¤¿¤á¤Ë³«¤¯¡£ +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¿·¤¿¤ËºîÀ®¤¹¤ë¡£ +Æɤ߽Ф·¤Î½é´ü¥Õ¥¡¥¤¥ë°ÌÃ֤ϥե¡¥¤¥ë¤ÎÀèƬ¤Ç¤¢¤ë¤¬¡¢ +½ñ¤­¹þ¤ß¤Ï¾ï¤Ë¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤ËÄɲ䵤ì¤ë¡£ +.PP +.\"O The +.\"O .I mode +.\"O string can also include the letter \(aqb\(aq either as a last character or as +.\"O a character between the characters in any of the two-character strings +.\"O described above. +.\"O This is strictly for compatibility with C89 +.\"O and has no effect; the \(aqb\(aq is ignored on all POSIX +.\"O conforming systems, including Linux. +.I mode +ʸ»úÎó¤Ë¤Ïʸ»ú \(aqb\(aq ¤òÄɲûØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¡¢ +.I mode +ʸ»úÎó¤ÎºÇ¸å¤Îʸ»ú¤È¤·¤Æ»ØÄꤹ¤ë¡£ +¾åµ­¤Î¤¦¤Á 2 ʸ»ú¤Î¥â¡¼¥É¤Î¾ì¹ç¤Ë¤Ï 2 ¤Ä¤Îʸ»ú¤Î´Ö¤Ë»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤ì¤Ï C89 ¤È¤Î¸ß´¹À­¤Î¤¿¤á¤À¤±¤ËÍÑ°Õ¤µ¤ì¤¿ +¤â¤Î¤Ç¤¢¤ê¡¢´Ø¿ô¤Î¼Â¹Ô¤ËÂФ·¤Æ¤Ï¤¤¤«¤Ê¤ë±Æ¶Á¤â»ý¤¿¤Ê¤¤¡£ +¤¹¤Ê¤ï¤Á¡¢Linux ¤ò´Þ¤àÁ´¤Æ¤Î POSIX ½àµò¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +¤³¤Î \(aqb\(aq ¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O (Other systems may treat text files and binary files differently, +.\"O and adding the \(aqb\(aq may be a good idea if you do I/O to a binary +.\"O file and expect that your program may be ported to non-Unix +.\"O environments.) +(¤½¤Î¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤È¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë¤òÊÌ¡¹¤Ë°·¤¦¤â¤Î¤â¤¢¤ë¤Î¤Ç¡¢ +¤â¤·¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë¤ÎÆþ½ÐÎϤò¹Ô¤¤¡¢ +¤½¤Î¥×¥í¥°¥é¥à¤¬Èó UNIX ´Ä¶­¤Ø°Ü¿¢¤µ¤ì¤ë¤Èͽ¬¤¹¤ë¤Ê¤é¡¢ +\(aqb\(aq¤òÉÕ¤±¤Æ¤ª¤¯¤Î¤ÏÎɤ¤¹Í¤¨¤Ç¤¢¤ë) +.PP +.\"O See NOTES below for details of glibc extensions for +.\"O .IR mode . +.I mode +¤Î glibc ¤Ë¤è¤ë³ÈÄ¥¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï²¼µ­¤Î¡ÖÃí°Õ¡×¤ò»²¾È¡£ +.PP +.\"O Any created files will have mode +.\"O .BR S_IRUSR " | " S_IWUSR " | " S_IRGRP " | " S_IWGRP " | " S_IROTH " | " S_IWOTH +.\"O (0666), as modified by the process's umask value (see +.\"O .BR umask (2)). +¤¹¤Ù¤Æ¤ÎÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¡¢ +.BR S_IRUSR " | " S_IWUSR " | " S_IRGRP " | " S_IWGRP " | " S_IROTH " | " S_IWOTH +(0666) ¤Î¥â¡¼¥É¤ò +¤½¤Î¥×¥í¥»¥¹¤Î umask Ãͤˤè¤Ã¤Æ½¤Àµ¤·¤¿¥â¡¼¥É¤ò»ý¤Ä +.RB ( umask (2) +¤ò¸«¤è)¡£ +.PP +.\"O Reads and writes may be intermixed on read/write streams in any order. +.\"O Note that ANSI C requires that a file positioning function intervene +.\"O between output and input, unless an input operation encounters end-of-file. +.\"O (If this condition is not met, then a read is allowed to return the +.\"O result of writes other than the most recent.) +.\"O Therefore it is good practice (and indeed sometimes necessary +.\"O under Linux) to put an +.\"O .BR fseek (3) +.\"O or +.\"O .BR fgetpos (3) +.\"O operation between write and read operations on such a stream. +.\"O This operation may be an apparent no-op +.\"O (as in \fIfseek(..., 0L, SEEK_CUR)\fP +.\"O called for its synchronizing side effect. +Æɤ߽Ф·/½ñ¤­¹þ¤ß¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¤ÏǤ°Õ¤Î½ç½ø¤ÇÆɤ߽ñ¤­¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤¿¤À¤· ANSI C ¤Ç¤Ï¡¢ +(ÆþÎÏÁàºî¤¬¥Õ¥¡¥¤¥ë¤ÎËöÈø¤ËÅþ㤷¤¿¾ì¹ç¤ò½ü¤¤¤Æ) +½ÐÎϤÈÆþÎϤδ֤ˤϥե¡¥¤¥ë¤Î°ÌÃÖ·è¤á´Ø¿ô¤ò +¶´¤Þ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ¤µ¤ì¤¿¤¤ +(¤³¤Î¾ò·ï¤òËþ­¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢Æɤ߹þ¤ßÁàºî¤Ï¡¢ +ºÇ¸å¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¤â¤Î¤Ç¤Ê¤¯¡¢°ÊÁ°¤Ë½ñ¤­¹þ¤Þ¤ì¤¿ +ÃͤòÊÖ¤¹¤³¤È¤òµö¤µ¤ì¤Æ¤¤¤ë)¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Î¤è¤¦¤Ê¥¹¥È¥ê¡¼¥à¤Ç¤ÎÆɤ߽ñ¤­Áàºî¤Î´Ö¤Ë¤Ï +.BR fseek (3) +¤Þ¤¿¤Ï +.BR fgetpos (3) +Áàºî¤ò¶´¤ó¤Ç¤ª¤¯¤ÈÎɤ¤¤À¤í¤¦ +(Linux ¤Ç¤ÏËÜÅö¤ËɬÍפȤʤ뤳¤È¤â¤È¤­¤É¤­¤¢¤ë)¡£ +¤³¤ÎÁàºî¤Ï¸«¤«¤±¾å²¿¤â¤·¤Ê¤¤Áàºî (no-op) ¤Ç¤âÎɤ¤ +(Î㤨¤Ð \fIfseek(..., 0L, SEEK_CUR)\fP ¤ò +¤½¤ÎÉû¼¡Åª¸ú²Ì¤Ç¤¢¤ëƱ´ü¤Î¤¿¤á¤À¤±¤Ë¸Æ¤Ù¤ÐÎɤ¤)¡£ +.PP +.\"O Opening a file in append mode (\fBa\fP as the first character of +.\"O .IR mode ) +.\"O causes all subsequent write operations to this stream to occur +.\"O at end-of-file, as if preceded by an +.\"O .nf +.\"O +.\"O fseek(stream,0,SEEK_END); +.\"O .fi +.\"O .PP +.\"O call. +¥Õ¥¡¥¤¥ë¤òÄɲå⡼¥É +.RI ( mode +¤ÎºÇ½é¤Îʸ»ú¤ò \fBa\fP ¤Ë¤¹¤ë) ¤Ç³«¤¯¤È¡¢ +¤³¤Î¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ë½ñ¤­¹þ¤ßÁàºî¤Ï (Àè¤Ë +.nf + + fseek(stream,0,SEEK_END); + +.fi +¤Î¸Æ¤Ó½Ð¤·¤ò¼Â¹Ô¤·¤¿¤«¤Î¤è¤¦¤Ë) ¥Õ¥¡¥¤¥ëËöÈø¤ËÂФ·¤Æ¹Ô¤ï¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR fdopen () +.\"O function associates a stream with the existing file descriptor, +.\"O .IR fd . +.BR fdopen () +´Ø¿ô¤Ï¡¢´û¸¤Î¥Õ¥¡¥¤¥ëµ­½Ò»Ò +.I fd +¤Ë¥¹¥È¥ê¡¼¥à¤ò·ë¤Ó¤Ä¤±¤ë¡£ +.\"O The +.\"O .I mode +.\"O of the stream (one of the values "r", "r+", "w", "w+", "a", "a+") +.\"O must be compatible with the mode of the file descriptor. +¥¹¥È¥ê¡¼¥à¤Î +.I mode +("r", "r+", "w", "w+", "a", "a+" ¤Î¤¤¤º¤ì¤«) ¤Ï +¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Î¥â¡¼¥É¤È¸ß´¹¤Î¤â¤Î¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O The file position indicator of the new stream is set to that +.\"O belonging to +.\"O .IR fd , +.\"O and the error and end-of-file indicators are cleared. +.\"O Modes "w" or "w+" do not cause truncation of the file. +¿·¤·¤¤¥¹¥È¥ê¡¼¥à¤Î¥Õ¥¡¥¤¥ë°ÌÃֻؼ¨»Ò¤Ï +.I fd +¤Ë°¤·¤Æ¤¤¤ëÃͤËÀßÄꤵ¤ì¤ë¡£ +error ¤È end-of-file ¤Î³Æ»Ø¼¨»Ò¤Ï¥¯¥ê¥¢¤µ¤ì¤ë¡£ +"w" ¤ª¤è¤Ó "w+" ¥â¡¼¥É¤Ç¤Î¥Õ¥¡¥¤¥ë¤ÎÀÚ¤êµÍ¤á¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +.\"O The file descriptor is not dup'ed, and will be closed when +.\"O the stream created by +.\"O .BR fdopen () +.\"O is closed. +.\"O The result of applying +.\"O .BR fdopen () +.\"O to a shared memory object is undefined. +¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤ÎÊ£À½¤Ï¹Ô¤Ê¤ï¤ì¤Ê¤¤¡£ +.BR fdopen () +¤ÇºîÀ®¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤¬ÊĤ¸¤é¤ì¤¿¤È¤­¤Ë¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤â +ÊĤ¸¤é¤ì¤ë¡£ +¶¦Í­¥á¥â¥ê¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ø +.BR fdopen () +¤ò¹Ô¤Ã¤¿¤È¤­¤Î·ë²Ì¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR freopen () +.\"O function opens the file whose name is the string pointed to by +.\"O .I path +.\"O and associates the stream pointed to by +.\"O .I stream +.\"O with it. +.\"O The original stream (if it exists) is closed. +.\"O The +.\"O .I mode +.\"O argument is used just as in the +.\"O .BR fopen () +.\"O function. +.\"O The primary use of the +.\"O .BR freopen () +.\"O function is to change the file associated with a standard text stream +.\"O .RI ( stderr ", " stdin ", or " stdout ). +.BR freopen () +´Ø¿ô¤Ï +.I path +¤Ç̾Á°¤¬»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò³«¤­¡¢ +.I stream +¤Ç»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ë¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤ò·ë¤Ó¤Ä¤±¤ë¡£ +¤â¤È¤Î¥¹¥È¥ê¡¼¥à¤Ï (¤â¤·Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï) ÊĤ¸¤é¤ì¤ë¡£ +.I mode +°ú¿ô¤Ï +.BR fopen () +´Ø¿ô¤ÈƱ¤¸·Á¤Ç»È¤ï¤ì¤ë¡£ +.BR freopen () +´Ø¿ô¤Î¼ç¤ÊÍÑÅӤϡ¢É¸½à¥Æ¥­¥¹¥È¥¹¥È¥ê¡¼¥à +.RI ( stderr ", " stdin ", " stdout ) +¤ÈÂбþÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤òÊѹ¹¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.\"O Upon successful completion +.\"O .BR fopen (), +.\"O .BR fdopen () +.\"O and +.\"O .BR freopen () +.\"O return a +.\"O .I FILE +.\"O pointer. +.\"O Otherwise, NULL is returned and +.\"O .I errno +.\"O is set to indicate the error. +.BR fopen (), +.BR fdopen (), +.BR freopen () +¤ÏÀ®¸ù¤¹¤ë¤È +.I FILE +·¿¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È NULL ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¥¨¥é¡¼¤ò¼¨¤¹Ãͤ˥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O The +.\"O .I mode +.\"O provided to +.\"O .BR fopen (), +.\"O .BR fdopen (), +.\"O or +.\"O .BR freopen () +.\"O was invalid. +.BR fopen (), +.BR fdopen (), +.BR freopen () +¤ÇÍ¿¤¨¤é¤ì¤¿ +.I mode +¤¬ÉÔŬÀڤǤ¢¤ë¡£ +.PP +.\"O The +.\"O .BR fopen (), +.\"O .BR fdopen () +.\"O and +.\"O .BR freopen () +.\"O functions may also fail and set +.\"O .I errno +.\"O for any of the errors specified for the routine +.\"O .BR malloc (3). +.BR fopen (), +.BR fdopen (), +.BR freopen () +´Ø¿ô¤Ï +.BR malloc (3) +¥ë¡¼¥Á¥ó¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ç¤â¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ê¡¢ +¤½¤Î»þ¤ÏÂбþ¤¹¤ëÃÍ¤Ë +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.\"O The +.\"O .BR fopen () +.\"O function may also fail and set +.\"O .I errno +.\"O for any of the errors specified for the routine +.\"O .BR open (2). +.BR fopen () +´Ø¿ô¤Ï +.BR open (2) +¥ë¡¼¥Á¥ó¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ç¤â¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ê¡¢ +¤½¤Î»þ¤ÏÂбþ¤¹¤ëÃÍ¤Ë +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.\"O The +.\"O .BR fdopen () +.\"O function may also fail and set +.\"O .I errno +.\"O for any of the errors specified for the routine +.\"O .BR fcntl (2). +.BR fdopen () +´Ø¿ô¤Ï +.BR fcntl (2) +¥ë¡¼¥Á¥ó¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ç¤â¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ê¡¢ +¤½¤Î»þ¤ÏÂбþ¤¹¤ëÃÍ¤Ë +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.\"O The +.\"O .BR freopen () +.\"O function may also fail and set +.\"O .I errno +.\"O for any of the errors specified for the routines +.\"O .BR open (2), +.\"O .BR fclose (3) +.\"O and +.\"O .BR fflush (3). +.BR freopen () +´Ø¿ô¤Ï +.BR open (2), +.BR fclose (3), +.BR fflush (3) +³Æ¥ë¡¼¥Á¥ó¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ç¤â¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ê¡¢ +¤½¤Î»þ¤ÏÂбþ¤¹¤ëÃÍ¤Ë +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.SH ½àµò +.\"O The +.\"O .BR fopen () +.\"O and +.\"O .BR freopen () +.\"O functions conform to C89. +.\"O The +.\"O .BR fdopen () +.\"O function conforms to POSIX.1-1990. +.BR fopen () +´Ø¿ô¤È +.BR freopen () +´Ø¿ô¤Ï C89¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR fdopen () +´Ø¿ô¤Ï POSIX.1-1990 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.\"O .SS Glibc Notes +.SH Ãí°Õ +.SS glibc ¤Ç¤ÎÃí°Õ +.\"O The GNU C library allows the following extensions for the string specified in +.\"O .IR mode : +GNU C ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢ +.I mode +¤Ë»ØÄê¤Ç¤­¤ëʸ»úÎó¤È¤·¤Æ¡¢°Ê²¼¤Î³ÈÄ¥¤¬¹Ô¤ï¤ì¤Æ¤¤¤ë: +.TP +.\"O .BR c " (since glibc 2.3.3)" +.BR c " (glibc 2.3.3 °Ê¹ß)" +.\"O Do not make the open operation, +.\"O or subsequent read and write operations, +.\"O thread cancellation points. +open Áàºî¡¢¤½¤ì¤Ë³¤¯ read/write Áàºî¤Î¡¢ +¥¹¥ì¥Ã¥É¤Î¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È (cancellation points) +¤òºîÀ®¤·¤Ê¤¤¡£ +.TP +.\"O .BR e " (since glibc 2.7)" +.BR e " (glibc 2.7 °Ê¹ß)" +.\"O Open the file with the +.\"O .B O_CLOEXEC +.\"O flag. +.\"O See +.\"O .BR open (2) +.\"O for more information. +.B O_CLOEXEC +¥Õ¥é¥°¤òÍ­¸ú¤Ë¤·¤Æ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +¾ÜºÙ¤Ï +.BR open (2) +¤ò»²¾È¡£ +.TP +.\"O .BR m " (since glibc 2.3)" +.BR m " (glibc 2.3 °Ê¹ß)" +.\"O Attempt to access the file using +.\"O .BR mmap (2), +.\"O rather than I/O system calls +.\"O .RB ( read (2), +.\"O .BR write (2)). +.\"O Currently, +.\"O .\" As at glibc 2.4: +.\"O use of +.\"O .BR mmap (2) +.\"O is only attempted for a file opened for reading. +I/O ¥·¥¹¥Æ¥à¥³¡¼¥ë +.RB ( read (2), +.BR write (2)) +¤Ç¤Ï¤Ê¤¯¡¢ +.BR mmap (2) +¤ò»È¤Ã¤Æ¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤¹¤ë¡£ +.\" glibc 2.4 ¤Ç¤Ï +.BR mmap (2) +¤ò»È¤ª¤¦¤È¤¹¤ë¤Î¤Ï¡¢Æɤ߽Ф·ÍѤ˥ª¡¼¥×¥ó¤¹¤ë¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤À¤±¤Ç¤¢¤ë¡£ +.TP +.B x +.\"O Open the file exclusively +.\"O (like the +.\"O .B O_EXCL +.\"O flag of +.\"O .BR open (2)). +.\"O If the file already exists, +.\"O .BR fopen () +.\"O fails, and sets +.\"O .I errno +.\"O to +.\"O .BR EEXIST . +¥Õ¥¡¥¤¥ë¤òÇÓ¾Ū¤Ë¥ª¡¼¥×¥ó¤¹¤ë +.RB ( open (2) +¤Î +.B O_EXCL +¥Õ¥é¥°¤ÈƱÍÍ)¡£ +¥Õ¥¡¥¤¥ë¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢ +.BR fopen () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EEXIST +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O This flag is ignored for +.\"O .BR fdopen (). +¤³¤Î¥Õ¥é¥°¤Ï +.BR fdopen () +¤Ç¤Ï̵»ë¤µ¤ì¤ë¡£ +.\" FIXME document /,ccs= charset/ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR open (2), +.BR fclose (3), +.BR fileno (3), +.BR fmemopen (3), +.BR fopencookie (3) diff --git a/draft/man3/fpathconf.3 b/draft/man3/fpathconf.3 new file mode 100644 index 00000000..2a380f17 --- /dev/null +++ b/draft/man3/fpathconf.3 @@ -0,0 +1,284 @@ +.\" 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 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 +.\" +.TH FPATHCONF 3 1993-04-04 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fpathconf, pathconf \- get configuration values for files +fpathconf, pathconf \- ¥Õ¥¡¥¤¥ë¤ÎÀßÄêÃͤò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long fpathconf(int " fd ", int " name ); +.br +.BI "long pathconf(char *" path ", int " name ); +.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 +¤ÎÃͤò¼èÆÀ¤¹¤ë¡£ +.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 +¤ÎÃͤò¼èÆÀ¤¹¤ë¡£ +.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 () +¤Ï¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£¤³¤Î¾ì¹ç¤Ï¤è¤êÂ礭¤ÊÃͤ¬Ê֤뤳¤È¤Ë¤Ê¤í¤¦¡£ +.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 +¤Ç¤¢¤ë¡£ +.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 +¤ÏüËö¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"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" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.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 +¤òÆþ¤ì¤ÆÊÖ¤µ¤ì¤¿Ãͤè¤ê¤âŤ¤¥Õ¥¡¥¤¥ë̾¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤¬¡¢Í¿¤¨¤é¤ì¤¿¥Ç¥£ +¥ì¥¯¥È¥ê¤Ë¸ºß¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.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) diff --git a/draft/man3/fpclassify.3 b/draft/man3/fpclassify.3 new file mode 100644 index 00000000..0cf8c1c8 --- /dev/null +++ b/draft/man3/fpclassify.3 @@ -0,0 +1,181 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL, 2002-07-27 Walter Harms +.\" 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 +.\" +.TH FPCLASSIFY 3 2008-08-07 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fpclassify, isfinite, isnormal, isnan, isinf \- floating-point +.\"O classification macros +fpclassify, isfinite, isnormal, isnan, isinf \- ÉâÆ°¾®¿ôÅÀ¿ô¤ÎʬÎà¥Þ¥¯¥í +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fpclassify(" x ); +.sp +.BI "int isfinite(" x ); +.sp +.BI "int isnormal(" x ); +.sp +.BI "int isnan(" x ); +.sp +.BI "int isinf(" x ); +.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) +»²¾È): +.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 (): +.\"O _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; ¤Þ¤¿¤Ï +.I cc\ -std=c99 +.br +.BR isnan (): +.\"O _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; ¤Þ¤¿¤Ï +.I cc\ -std=c99 +.br +.BR isinf (): +.\"O _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; +¤Þ¤¿¤Ï +.I cc\ -std=c99 +.ad b +.\"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. +¾åµ­¤Î¤É¤ì¤Ë¤âÅö¤Æ¤Ï¤Þ¤é¤Ê¤¤¾ì¹ç¤Ç¤¢¤ê¡¢ +ÃͤÏÄ̾ï¤ÎÉâÆ°¾®¿ôÅÀ¿ô¤Ç¤¢¤ë¤Ï¤º¤À¡£ +.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) +(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" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR finite (3), +.BR INFINITY (3), +.BR isgreater (3), +.BR signbit (3) diff --git a/draft/man3/fpurge.3 b/draft/man3/fpurge.3 new file mode 100644 index 00000000..f77dfac0 --- /dev/null +++ b/draft/man3/fpurge.3 @@ -0,0 +1,122 @@ +.\" 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) 2002 NAKANO Takeo all rights reserved. +.\" Translated Sat 12 Jan 2002 by NAKANO Takeo +.\" +.TH FPURGE 3 2001-12-15 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O fpurge, __fpurge \- purge a stream +.SH ̾Á° +fpurge, __fpurge \- ¥¹¥È¥ê¡¼¥à¤ò°ìÁÝ (purge) ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +/* unsupported */ +.B #include +.sp +.BI "int fpurge(FILE *" stream ); +.sp +/* supported */ +.B #include +.br +.B #include +.sp +.BI "void __fpurge(FILE *" stream ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The function +.\"O .BR fpurge () +.\"O clears the buffers of the given stream. +.\"O For output streams this discards any unwritten output. +.\"O For input streams this discards any input read from the underlying object +.\"O but not yet obtained via +.\"O .BR getc (3); +.\"O this includes any text pushed back via +.\"O .BR ungetc (3). +.\"O See also +.\"O .BR fflush (3). +.BR fpurge () +´Ø¿ô¤Ï¡¢Í¿¤¨¤é¤ì¤¿¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¤ò¥¯¥ê¥¢¤¹¤ë¡£ +½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ç¤³¤ì¤ò¹Ô¤¦¤È¡¢½ñ¤­½Ð¤µ¤ì¤Æ¤¤¤Ê¤¤½ÐÎϤϼΤƤé¤ì¤ë¡£ +ÆþÎÏ¥¹¥È¥ê¡¼¥à¤Ç¤³¤ì¤ò¹Ô¤¦¤È¡¢ +²¼Áؤˤ¢¤ë¥ª¥Ö¥¸¥§¥¯¥È¤«¤éÆɤ߹þ¤Þ¤ì +.BR getc (3) +¤Ë¤è¤ë¼èÆÀ¤òÂԤäƤ¤¤ëÆþÎϤ¬¡¢¤¹¤Ù¤Æ¼Î¤Æ¤é¤ì¤ë¡£ +¤³¤ì¤Ë¤Ï +.BR ungetc (3) +¤Ë¤è¤Ã¤ÆÌᤵ¤ì¤¿¥Æ¥­¥¹¥È¤â´Þ¤Þ¤ì¤ë¡£ +.BR fflush (3) +¤â»²¾È¤Î¤³¤È¡£ +.LP +.\"O The function +.\"O .BR __fpurge () +.\"O does precisely the same, but without returning a value. +.BR __fpurge () +´Ø¿ô¤âÁ´¤¯Æ±¤¸¤³¤È¤ò¹Ô¤¦¤¬¡¢¤¿¤À¤·ÊÖ¤êÃͤòÊÖ¤µ¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O Upon successful completion +.\"O .BR fpurge () +.\"O returns 0. +.\"O On error, it returns \-1 and sets +.\"O .I errno +.\"O appropriately. +À®¸ù¤¹¤ë¤È +.BR fpurge () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤ë¤È \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ÊÃͤËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O .I stream +.\"O is not an open stream. +.I stream +¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These functions are nonstandard and not portable. +.\"O The function +.\"O .BR fpurge () +.\"O was introduced in 4.4BSD and is not available under Linux. +.\"O The function +.\"O .BR __fpurge () +.\"O was introduced in Solaris, and is present in glibc 2.1.95 and later. +¤³¤ì¤é¤Î´Ø¿ô¤Ïɸ½à¤Ç¤Ï¤Ê¤¯¡¢¤è¤Ã¤Æ°Ü¿¢À­¤â¤Ê¤¤¡£ +.BR fpurge () +´Ø¿ô¤Ï 4.4BSD ¤ÇƳÆþ¤µ¤ì¤¿¤¬¡¢Linux ¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +.BR __fpurge () +´Ø¿ô¤Ï Solaris ¤ÇƳÆþ¤µ¤ì¡¢glibc 2.1.95 °Ê¹ß¤Ë¤Ï¸ºß¤·¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Usually it is a mistake to want to discard input buffers. +Ä̾ï¤ÏÆþÎϥХåե¡¤ò¼Î¤Æ¤è¤¦¤È¤¹¤ë¤Î¤Ï´Ö°ã¤Ã¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.\" .BR fclean (3), +.BR fflush (3), +.BR setbuf (3), +.BR stdio_ext (3) diff --git a/draft/man3/fputwc.3 b/draft/man3/fputwc.3 new file mode 100644 index 00000000..c2529d67 --- /dev/null +++ b/draft/man3/fputwc.3 @@ -0,0 +1,136 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Aug 29 15:03:11 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sat Jan 8 JST 2000 by Kentaro Shirakata +.\" Updated Fri Nov 2 JST 2001 by Kentaro Shirakata +.\" +.TH FPUTWC 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fputwc, putwc \- write a wide character to a FILE stream +fputwc, putwc \- ¥ï¥¤¥Éʸ»ú¤ò FILE ¥¹¥È¥ê¡¼¥à¤Ë½ñ¤­¹þ¤à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "wint_t fputwc(wchar_t " wc ", FILE *" stream ); +.BI "wint_t putwc(wchar_t " wc ", FILE *" stream ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR fputwc () +.\"O function is the wide-character +.\"O equivalent of the +.\"O .BR fputc (3) +.\"O function. +.\"O It writes the wide character \fIwc\fP to \fIstream\fP. +.\"O If +.\"O \fIferror(stream)\fP becomes true, it returns +.\"O .BR WEOF . +.\"O If a wide character conversion error occurs, +.\"O it sets \fIerrno\fP to \fBEILSEQ\fP and returns +.\"O .BR WEOF . +.\"O Otherwise it returns \fIwc\fP. +.BR fputwc () +´Ø¿ô¤Ï¡¢ +.BR fputc (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£¤³¤Î +´Ø¿ô¤Ï¡¢¥ï¥¤¥Éʸ»ú \fIwc\fP ¤ò \fIstream\fP ¤Ë½ñ¤­¹þ¤à¡£ +\fIferror(stream)\fP ¤¬¿¿¤Ë¤Ê¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +¥ï¥¤¥Éʸ»úÊÑ´¹¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï¡¢ +\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤ò¥»¥Ã¥È¤·¡¢ +.B WEOF +¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ï \fIwc\fP ¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR putwc () +.\"O function or macro functions identically to +.\"O .BR fputwc (). +.\"O It may be implemented as a macro, and may evaluate its argument +.\"O more than once. +.\"O There is no reason ever to use it. +.BR putwc () +´Ø¿ô¤¢¤ë¤¤¤Ï¥Þ¥¯¥í¤Ï¡¢ +.BR fputwc () +¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥Þ¥¯¥í¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç¡¢°ú¤­¿ô¤¬Ê£¿ô²óɾ²Á¤µ +¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£¤³¤Î´Ø¿ô¤ò»È¤¦Íýͳ¤Ï¤â¤Ï¤ä¸ºß¤·¤Ê¤¤¡£ +.PP +.\"O For nonlocking counterparts, see +.\"O .BR unlocked_stdio (3). +¤³¤ì¤é¤Î½èÍý¤òÄä»ß¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR fputwc () +.\"O function returns \fIwc\fP if no error occurred, or +.\"O .B WEOF +.\"O to indicate an error. +.BR fputwc () +´Ø¿ô¤Ï¡¢¥¨¥é¡¼¤¬µ¯¤­¤Ê¤±¤ì¤Ð \fIwc\fP ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O Apart from the usual ones, there is +ÉáÄ̤Τâ¤Î¤Î¾¤Ë¡¢°Ê²¼¤Î¤â¤Î¤¬¤¢¤ë¡£ +.TP +.B EILSEQ +.\"O Conversion of \fIwc\fP to the stream's encoding fails. +\fIwc\fP ¤«¤é¥¹¥È¥ê¡¼¥à¤ÎÉä¹æ¤Ø¤ÎÊÑ´¹¤Ë¼ºÇÔ¤·¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR fputwc () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR fputwc () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.\"O In the absence of additional information passed to the +.\"O .BR fopen (3) +.\"O call, it is +.\"O reasonable to expect that +.\"O .BR fputwc () +.\"O will actually write the multibyte +.\"O sequence corresponding to the wide character \fIwc\fP. +.BR fopen (3) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ÄɲþðÊ󤬤ʤ¤¾ì¹ç¤Ë¤Ï¡¢ +.BR fputwc () +¤Ï +¼ÂºÝ¤Ë¤Ï¥ï¥¤¥Éʸ»ú \fIwc\fP ¤ËÂбþ¤¹¤ë¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤ò½ñ¤­¹þ¤à¤È +´üÂÔ¤·¤Æ¤è¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fgetwc (3), +.BR fputws (3), +.BR unlocked_stdio (3) diff --git a/draft/man3/fputws.3 b/draft/man3/fputws.3 new file mode 100644 index 00000000..f062f9e1 --- /dev/null +++ b/draft/man3/fputws.3 @@ -0,0 +1,95 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Aug 29 15:09:40 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Fri Nov 2 JST 2001 by Kentaro Shirakata +.\" +.TH FPUTWS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fputws \- write a wide-character string to a FILE stream +fputws \- ¥ï¥¤¥Éʸ»ú¤Îʸ»úÎó¤ò FILE ¥¹¥È¥ê¡¼¥à¤Ë½ñ¤­¹þ¤à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fputws(const wchar_t *" ws ", FILE *" stream ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR fputws () +.\"O function is the wide-character equivalent of +.\"O the +.\"O .BR fputs (3) +.\"O function. +.\"O It writes the wide character string starting at \fIws\fP, up to but +.\"O not including the terminating L\(aq\\0\(aq character, to \fIstream\fP. +.BR fputws () +´Ø¿ô¤Ï¡¢ +.BR fputs (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIws\fP ¤«¤é»Ï¤Þ¤ë¥ï¥¤¥Éʸ»úÎó¤ò½ªÃ¼¤Î L'\\0' ¤Þ +¤Ç \fIstream\fP ¤Ë½ñ¤­½Ð¤¹¡£¤¿¤À¤·½ªÃ¼¤Î L\(aq\\0\(aq ¤Ï½ÐÎϤ·¤Ê¤¤¡£ +.PP +.\"O For nonlocking counterparts, see +.\"O .BR unlocked_stdio (3). +¤³¤ì¤é¤Î½èÍý¤òÄä»ß¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR fputws () +.\"O function returns a +.\"O nonnegative integer if the operation was +.\"O successful, or \-1 to indicate an error. +.BR fputws () +¤Ï¡¢Áàºî¤¬À®¸ù¤·¤¿»þ¤Ë¤ÏÉé¤Ç¤Ê¤¤À°¿ôÃͤòÊÖ¤¹¡£¥¨¥é¡¼¤Î»þ +¤Ë¤Ï \-1 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR fputws () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR fputws () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.\"O In the absence of additional information passed to the +.\"O .BR fopen (3) +.\"O call, it is +.\"O reasonable to expect that +.\"O .BR fputws () +.\"O will actually write the multibyte +.\"O string corresponding to the wide-character string \fIws\fP. +.BR fopen (3) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ÄɲþðÊ󤬤ʤ¤¾ì¹ç¤Ë¤Ï¡¢ +.BR fputws () +¤¬¼ÂºÝ +¤Ë¤Ï¥ï¥¤¥Éʸ»ú¤Îʸ»úÎó¤Ç¤¢¤ë \fIws\fP ¤ËÂбþ¤¹¤ë¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹ +¤ò½ñ¤­¹þ¤à¤È´üÂÔ¤¹¤ë¤³¤È¤ÏŬÀڤǤ¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fputwc (3), +.BR unlocked_stdio (3) diff --git a/draft/man3/fread.3 b/draft/man3/fread.3 new file mode 100644 index 00000000..d81603b2 --- /dev/null +++ b/draft/man3/fread.3 @@ -0,0 +1,117 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fread.3 6.6 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:37:33 1993, faith@cs.unc.edu +.\" Sun Feb 19 21:26:54 1995 by faith, return values +.\" Modified Thu Apr 20 20:43:53 1995 by Jim Van Zandt +.\" Modified Fri May 17 10:21:51 1996 by Martin Schulze +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated Tue Jan 21 21:57:33 JST 1997 +.\" by YOSHINO Takashi +.\" Updated & Modified Mon Mar 1 1999 +.\" by NAKANO Takeo +.\" Updated Sat Nov 3 JST 2001 by Kentaro Shirakata +.\" +.TH FREAD 3 1996-05-17 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fread, fwrite \- ¥Ð¥¤¥Ê¥ê¥¹¥È¥ê¡¼¥à¤ÎÆþ½ÐÎÏ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t fread(void *" ptr ", size_t " size ", size_t " nmemb \ +", FILE *" stream ); +.sp +.BI "size_t fwrite(const void *" ptr ", size_t " size ", size_t " nmemb , +.BI " FILE *" stream ); +.fi +.SH ÀâÌÀ +.BR fread () +´Ø¿ô¤Ï +.I stream +¥Ý¥¤¥ó¥¿¤Ç»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤«¤é +.I nmemb +¸Ä¤Î¥Ç¡¼¥¿¤òÆɤ߹þ¤ß¡¢ +.I ptr +¤ÇÍ¿¤¨¤é¤ì¤¿¾ì½ê¤Ë³ÊǼ¤¹¤ë¡£ +¸Ä¡¹¤Î¥Ç¡¼¥¿¤Ï +.I size +¥Ð¥¤¥È¤ÎŤµ¤ò»ý¤Ä¡£ +.PP +.BR fwrite () +´Ø¿ô¤Ï +.I ptr +¤Ç»ØÄꤵ¤ì¤¿¾ì½ê¤«¤éÆÀ¤¿ +.I nmemb +¸Ä¤Î¥Ç¡¼¥¿¤ò¡¢ +.I stream +¥Ý¥¤¥ó¥¿¤Ç»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ë½ñ¤­¹þ¤à¡£ +¸Ä¡¹¤Î¥Ç¡¼¥¿¤Ï +.I size +¥Ð¥¤¥È¤ÎŤµ¤ò»ý¤Ä¡£ +.PP +.\"O For nonlocking counterparts, see +.\"O .BR unlocked_stdio (3). +¤³¤ì¤é¤Î½èÍý¤òÄä»ß¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR fread () +¤È +.BR fwrite () +¤ÏÆɤ߽ñ¤­¤ËÀ®¸ù¤·¤¿Í×ÁǤθĿô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬À¸¤¸¤¿¾ì¹ç¤ä¡¢end-of-file(¥Õ¥¡¥¤¥ë¤ÎºÇ¸å)¤Ë㤷¤¿¾ì¹ç¡¢ +ÊÖ¤êÃͤϻØÄꤷ¤¿¸Ä¿ô¤è¤ê¤â¾®¤µ¤¤ÃÍ(¤Þ¤¿¤Ï¥¼¥í)¤È¤Ê¤ë¡£ +.PP +.BR fread () +¤Ï end-of-file ¤È¥¨¥é¡¼¤ò¶èÊ̤·¤Ê¤¤¤Î¤Ç¡¢ +¤É¤Á¤é¤¬À¸¤¸¤¿¤«¤òȽÃǤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +¸Æ¤Ó½Ð¤·Â¦¤Ç +.BR feof (3) +¤È +.BR ferror (3) +¤È¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ½àµò +C89, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR read (2), +.BR write (2), +.BR feof (3), +.BR ferror (3), +.BR unlocked_stdio (3) diff --git a/draft/man3/frexp.3 b/draft/man3/frexp.3 new file mode 100644 index 00000000..b2d2014c --- /dev/null +++ b/draft/man3/frexp.3 @@ -0,0 +1,175 @@ +.\" 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-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) 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 2008-10-29 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "double frexp(double " x ", int *" exp ); +.br +.BI "float frexpf(float " x ", int *" exp ); +.br +.BI "long double frexpl(long double " x ", int *" exp ); +.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) +»²¾È): +.in +.sp +.ad l +.BR frexpf (), +.BR frexpl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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" +.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) ¤È¤Ê¤ë¡£ + +.\"O If \fIx\fP is zero, then the normalized fraction is +.\"O zero and zero is stored in \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 +¤ÎÃͤÏÉÔÄê¤Ç¤¢¤ë¡£ + +.\"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 +.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 +.SH Îã +.\"O The program below produces results such as the following: +¤³¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤È°Ê²¼¤Î¤è¤¦¤Ê·ë²Ì¤È¤Ê¤ë: +.sp +.nf +.in +4n +.RB "$" " ./a.out 2560" +frexp(2560, &e) = 0.625: 0.625 * 2^12 = 2560 +.RB "$" " ./a.out \-4" +frexp(\-4, &e) = \-0.5: \-0.5 * 2^3 = -4 +.in +.fi +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + double x, r; + int exp; + + x = strtod(argv[1], NULL); + r = frexp(x, &exp); + + printf("frexp(%g, &e) = %g: %g * %d^%d = %g\\n", + x, r, r, FLT_RADIX, exp, x); + exit(EXIT_SUCCESS); +} /* main */ +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ldexp (3), +.BR modf (3) diff --git a/draft/man3/fseek.3 b/draft/man3/fseek.3 new file mode 100644 index 00000000..1e24018e --- /dev/null +++ b/draft/man3/fseek.3 @@ -0,0 +1,288 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fseek.3 6.11 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu +.\" +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Mon Apr 27 1998 by NAKANO Takeo +.\" +.\" WORD: file position indicator ¥Õ¥¡¥¤¥ë°ÌÃÖɽ¼¨»Ò +.\" WORD: error indicator ¥¨¥é¡¼É½¼¨»Ò +.\" +.TH FSEEK 3 1993-11-29 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O fgetpos, fseek, fsetpos, ftell, rewind \- reposition a stream +.SH ̾Á° +fgetpos, fseek, fsetpos, ftell, rewind \- ¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ¤òÊѹ¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int fseek(FILE *" stream ", long " offset ", int " whence ); + +.BI "long ftell(FILE *" stream ); + +.BI "void rewind(FILE *" stream ); + +.BI "int fgetpos(FILE *" stream ", fpos_t *" pos ); +.br +.BI "int fsetpos(FILE *" stream ", fpos_t *" pos ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR fseek () +.\"O function sets the file position indicator for the stream pointed to by +.\"O .IR stream . +.\"O The new position, measured in bytes, is obtained by adding +.\"O .I offset +.\"O bytes to the position specified by +.\"O .IR whence . +.BR fseek () +´Ø¿ô¤Ï +.I stream +¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ë¤ª¤¤¤Æ¡¢¥Õ¥¡¥¤¥ë°ÌÃÖɽ¼¨»Ò +(file position indicator) ¤ò¥»¥Ã¥È¤¹¤ë¡£¿·¤¿¤Ê°ÌÃÖ (¥Ð¥¤¥Èñ°Ì) +¤Ï +.I whence +¤Ç»ØÄꤵ¤ì¤¿°ÌÃÖ¤Ë +.I offset +¥Ð¥¤¥È¤ò²Ã¤¨¤ë¤³¤È¤Ë¤è¤Ã¤ÆÍ¿¤¨¤é¤ì¤ë¡£ +.\"O If +.\"O .I whence +.\"O is set to +.\"O .BR SEEK_SET , +.\"O .BR SEEK_CUR , +.\"O or +.\"O .BR SEEK_END , +.\"O the offset is relative to the start of the file, the current position +.\"O indicator, or end-of-file, respectively. +.\"O A successful call to the +.\"O .BR fseek () +.\"O function clears the end-of-file indicator for the stream and undoes +.\"O any effects of the +.\"O .BR ungetc (3) +.\"O function on the same stream. +.I whence +¤¬ +.BR SEEK_SET , +.BR SEEK_CUR , +.B SEEK_END +¤Î¤É¤ì¤«¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤½¤ì¤¾¤ì¥Õ¥¡¥¤¥ë¤ÎÀèƬ¡¢¸½ºß¤Î°ÌÃÖɽ¼¨»Ò¡¢ +¥Õ¥¡¥¤¥ë¤ÎËöÈø¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤¬¼è¤é¤ì¤ë¡£ +.BR fseek () +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤È¡¢¥¹¥È¥ê¡¼¥à¤Î end-of-file ɽ¼¨»Ò¤Ï +¥¯¥ê¥¢¤µ¤ì¡¢¤½¤ì¤Þ¤Ç¤Ë +.BR ungetc (3) +´Ø¿ô¤ÇÌᤷ¤¿¥Ç¡¼¥¿¤Ï¤Ê¤«¤Ã¤¿¤³¤È¤Ë¤Ê¤ë¡£ +.PP +.\"O The +.\"O .BR ftell () +.\"O function obtains the current value of the file position indicator for the +.\"O stream pointed to by +.\"O .IR stream . +.BR ftell () +´Ø¿ô¤Ï +.I stream +¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ë¤ª¤±¤ë¡¢¥Õ¥¡¥¤¥ë°ÌÃÖɽ¼¨»Ò +¤Î¸½»þÅÀ¤Ç¤ÎÃͤòÍ¿¤¨¤ë¡£ +.PP +.\"O The +.\"O .BR rewind () +.\"O function sets the file position indicator for the stream pointed to by +.\"O .I stream +.\"O to the beginning of the file. +.\"O It is equivalent to: +.BR rewind () +´Ø¿ô¤Ï +.I stream +¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ë¤ª¤¤¤Æ¡¢¥Õ¥¡¥¤¥ë°ÌÃÖɽ¼¨»Ò +¤ò¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë¥»¥Ã¥È¤¹¤ë¡£¤³¤Î´Ø¿ô¤Ï°Ê²¼¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.PP +.RS +(void) fseek(stream, 0L, SEEK_SET) +.RE +.PP +.\"O except that the error indicator for the stream is also cleared (see +.\"O .BR clearerr (3)). +¤¿¤À¤· +.BR rewind () +¤Ç¤Ï¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ë¥¨¥é¡¼É½¼¨»Ò (error indicator) ¤âƱ»þ¤Ë +¥¯¥ê¥¢¤µ¤ì¤ë ( +.BR clearerr (3) +¤ò¸«¤è)¡£ +.PP +.\"O The +.\"O .BR fgetpos () +.\"O and +.\"O .BR fsetpos () +.\"O functions are alternate interfaces equivalent to +.\"O .BR ftell () +.\"O and +.\"O .BR fseek () +.\"O (with whence set to +.\"O .BR SEEK_SET ), +.\"O setting and storing the current value of the file offset into or from the +.\"O object referenced by +.\"O .IR pos . +.BR fgetpos () +´Ø¿ô¤È +.BR fsetpos () +´Ø¿ô¤Ï¡¢¤½¤ì¤¾¤ì +.BR ftell () +¤È +.BR fseek () +¤Ç +.I whence +¤Ë +.B SEEK_SET +¤ò»ØÄꤷ¤¿¾ì¹ç¤ÈƱÍͤε¡Ç½¤ò¡¢°Û¤Ê¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÇÄ󶡤¹¤ë¡£ +.BR fgetpos () +¤Ï¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Î¸½ºß¤ÎÃͤò +.I pos +¤¬»²¾È¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤ËÊݸ¤·¡¢ +.BR fsetpos () +¤Ï¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ò +.I pos +¤ËÀßÄꤹ¤ë¡£ +.\"O On some non-Unix systems an +.\"O .I fpos_t +.\"O object may be a complex object and these routines may be the only way to +.\"O portably reposition a text stream. +Unix °Ê³°¤Î¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¤Ï¡¢ +.I fpos_t +¤¬¹½Â¤ÂΤʤɤÎÊ£»¨¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¡¢¤³¤ì¤é¤Î¥ë¡¼¥Á¥ó¤¬¥Æ¥­¥¹ +¥È¥¹¥È¥ê¡¼¥à¤Ç¥Õ¥¡¥¤¥ë°ÌÃÖ¤òÊѹ¹¤¹¤ëÊýË¡¤Î¤¦¤Á¡¢°Ü¿¢À­¤Î¤¢¤ëÍ£°ì¤Î¤â¤Î +¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤â¤¢¤ë¡£ +.\"O .SH "RETURN VALUES" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR rewind () +.\"O function returns no value. +.\"O Upon successful completion, +.\"O .BR fgetpos (), +.\"O .BR fseek (), +.\"O .BR fsetpos () +.\"O return 0, +.\"O and +.\"O .BR ftell () +.\"O returns the current offset. +.\"O Otherwise, \-1 is returned and +.\"O .I errno +.\"O is set to indicate the error. +.BR rewind () +¤ÏÊÖ¤êÃͤò»ý¤¿¤Ê¤¤¡£ +.BR fgetpos (), +.BR fseek (), +.BR fsetpos () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +.BR ftell () +¤Ï¸½ºß¤Î¥ª¥Õ¥»¥Ã¥È¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤ÏÊÖ¤êÃÍ¤Ï \-1 ¤È¤Ê¤ê¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O The +.\"O .I stream +.\"O specified is not a seekable stream. +»ØÄꤷ¤¿ +.I stream +¤¬¥·¡¼¥¯¤Ç¤­¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O The +.\"O .I whence +.\"O argument to +.\"O .BR fseek () +.\"O was not +.\"O .BR SEEK_SET , +.\"O .BR SEEK_END , +.\"O or +.\"O .BR SEEK_CUR . +.BR fseek () +´Ø¿ô¤ËÂФ·¤ÆÍ¿¤¨¤¿ +.I whence +°ú¿ô¤¬ +.BR SEEK_SET , +.BR SEEK_END , +.B SEEK_CUR +°Ê³°¤ÎÃͤǤ¢¤Ã¤¿¡£ +.PP +.\"O The function +.\"O .BR fgetpos (), +.\"O .BR fseek (), +.\"O .BR fsetpos (), +.\"O and +.\"O .BR ftell () +.\"O may also fail and set +.\"O .I errno +.\"O for any of the errors specified for the routines +.\"O .BR fflush (3), +.\"O .BR fstat (2), +.\"O .BR lseek (2), +.\"O and +.\"O .BR malloc (3). +.BR fgetpos (), +.BR fseek (), +.BR fsetpos (), +.BR ftell () +¤Ï¡¢¤½¤ì¤¾¤ì +.BR fflush (3), +.BR fstat (2), +.BR lseek (2), +.BR malloc (3) +¤Ê¤É¤Î¥ë¡¼¥Á¥ó¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ï +¤½¤ì¤¾¤ìÂбþ¤·¤¿ +.I errno +¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O .SH STANDARDS +.\"O The +.\"O .BR fgetpos (), +.\"O .BR fsetpos (), +.\"O .BR fseek (), +.\"O .BR ftell (), +.\"O and +.\"O .BR rewind () +.\"O functions conform to ANSI C3.159-1989 (``ANSI C''). +.SH ½àµò +C89, C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR lseek (2), +.BR fseeko (3) diff --git a/draft/man3/fseeko.3 b/draft/man3/fseeko.3 new file mode 100644 index 00000000..d4d21b60 --- /dev/null +++ b/draft/man3/fseeko.3 @@ -0,0 +1,128 @@ +.\" Copyright 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) 2002 NAKANO Takeo all rights reserved. +.\" Translated 2002-01-06, NAKANO Takeo +.\" Updated 2006-01-18, Akihiro MOTOKI +.\" +.TH FSEEKO 3 2001-11-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O fseeko, ftello \- seek to or report file position +.SH ̾Á° +fseeko, ftello \- ¥Õ¥¡¥¤¥ë°ÌÃÖ¤òõ¤¹/Êó¹ð¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fseeko(FILE *" stream ", off_t " offset ", int " whence ); +.sp +.BI "off_t ftello(FILE *" stream ); +.BI +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR fseeko () +.\"O and +.\"O .BR ftello () +.\"O functions are identical to +.\"O .BR fseek (3) +.\"O and +.\"O .BR ftell (3) +.\"O (see +.\"O .BR fseek (3)), +.\"O respectively, except that the \fIoffset\fP argument of +.\"O .BR fseeko () +.\"O and the return value of +.\"O .BR ftello () +.\"O is of type \fIoff_t\fP +.\"O instead of \fIlong\fP. +.BR fseeko () +´Ø¿ô¤ª¤è¤Ó +.BR ftello () +´Ø¿ô¤Ï¡¢ +¤½¤ì¤¾¤ì +.BR fseek (3) +¤ª¤è¤Ó +.BR ftell (3) +¤ÈƱ°ì¤Îµ¡Ç½¤ò»ý¤Ä +.RB ( fseek (3) +¤ò¸«¤è) ¤¬¡¢¤¿¤À¤· +.BR fseeko () +´Ø¿ô¤Î \fIoffset\fP °ú¿ô¤È +.BR ftello () +¤ÎÊÖ¤êÃͤ¬¡¢ +\fIlong\fP ¤Ç¤Ï¤Ê¤¯ \fIoff_t\fP ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.LP +.\"O On many architectures both \fIoff_t\fP and \fIlong\fP are 32-bit types, +.\"O but compilation with +¿¤¯¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï +\fIoff_t\fP ¤â \fIlong\fP ¤â¶¦¤Ë 32 ¥Ó¥Ã¥È¤Î·¿¤Ç¤¢¤ë¤¬¡¢ +.RS +.nf + +#define _FILE_OFFSET_BITS 64 + +.fi +.RE +.\"O .PP +.\"O will turn \fIoff_t\fP into a 64-bit type. +¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤È \fIoff_t\fP ¤Ï 64 ¥Ó¥Ã¥È·¿¤È¤Ê¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On successful completion, +.\"O .BR fseeko () +.\"O returns 0, while +.\"O .BR ftello () +.\"O returns the current offset. +.\"O Otherwise, \-1 is returned and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR fseeko () +¤Ï 0 ¤ò¡¢ +.BR ftello () +¤Ï¸½ºß¤Î¥ª¥Õ¥»¥Ã¥È¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O See the ERRORS in +.\"O .BR fseek (3). +.BR fseek (3) +¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SUSv2, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O These functions are found on System V-like systems. +.\"O They are not present in libc4, libc5, glibc 2.0 +.\"O but are available since glibc 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï System V Ū¤Ê¥·¥¹¥Æ¥à¤Ë¤¢¤ë¡£ +libc4, libc5, glibc 2.0 ¤Ë¤Ï¤Ê¤«¤Ã¤¿¤¬¡¢ +glibc 2.1 ¤«¤é»È¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fseek (3) diff --git a/draft/man3/ftime.3 b/draft/man3/ftime.3 new file mode 100644 index 00000000..529c5042 --- /dev/null +++ b/draft/man3/ftime.3 @@ -0,0 +1,151 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (u31b3hs@pool.informatik.rwth-aachen.de) +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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. +.\" +.\" 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 +.\" +.TH FTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O ftime \- return date and time +.SH ̾Á° +ftime \- ÆüÉդȻþ´Ö¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.\"O .B "#include " +.\"O .sp +.\"O .BI "int ftime(struct timeb *" tp ); +.SH ½ñ¼° +.B "#include " +.sp +.BI "int ftime(struct timeb *" tp ); +.\"O .SH DESCRIPTION +.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 +¤ÇÊÖ¤µ¤ì¡¢¤³¤ì¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct timeb { + time_t time; + unsigned short millitm; + short timezone; + short dstflag; +}; +.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 ¤Ç¤Ê¤±¤ì¤Ð°ìǯ¤Î°ìÉô¤Ç²Æ»þ´Ö¤¬ +¸ºß¤¹¤ë¤³¤È¤ò¼¨¤¹¥Õ¥é¥°¤Ç¤¢¤ë¡£ +.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" +.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" +.SH ½àµò +4.2BSD, POSIX.1-2001. +.\"O POSIX.1-2008 removes the specification of +.\"O .BR ftime (). +POSIX.1-2008 ¤Ç¤Ï +.BR ftime () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"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 +.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 Îò»Ë +.\" .BR ftime () +.\" ´Ø¿ô¤Ï 4.2BSD ¤Ë¸½¤ì¤¿¡£ +\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR gettimeofday (2), +.BR time (2) diff --git a/draft/man3/ftok.3 b/draft/man3/ftok.3 new file mode 100644 index 00000000..6e832488 --- /dev/null +++ b/draft/man3/ftok.3 @@ -0,0 +1,168 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 2001-11-28, by Michael Kerrisk, +.\" Changed data type of proj_id; minor fixes +.\" aeb: further fixes; added notes. +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Tue Apr 28 1998 by NAKANO Takeo +.\" Updated Sun 6 Jan 2002 by NAKANO Takeo +.\" +.TH FTOK 3 2001-11-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O ftok \- convert a pathname and a project identifier to a System V IPC key +.SH ̾Á° +ftok \- ¥Ñ¥¹Ì¾¤È¥×¥í¥¸¥§¥¯¥È¼±Ê̻Ҥò System V IPC ¥­¡¼¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.fi +.sp +.BI "key_t ftok(const char *" pathname ", int " proj_id ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR ftok () +.\"O function uses the identity of the file named by the given +.\"O .I pathname +.\"O (which must refer to an existing, accessible file) +.\"O and the least significant 8 bits of +.\"O .I proj_id +.\"O (which must be nonzero) to generate a +.\"O .I key_t +.\"O type System V IPC key, suitable for use with +.\"O .BR msgget (2), +.\"O .BR semget (2), +.\"O or +.\"O .BR shmget (2). +.BR ftok () +´Ø¿ô¤Ï +.I pathname +¤ÇÍ¿¤¨¤é¤ì¤¿¥Õ¥¡¥¤¥ë (¸ºß¤·¡¢¥¢¥¯¥»¥¹²Äǽ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤) +¤Î¥Õ¥¡¥¤¥ë̾¤Î¼±Ê̾ðÊó (identity) ¤È¡¢ +.I proj_id +(0 ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤) ¤ÎÄã°Ì 8 ¥Ó¥Ã¥È¤È¤òÍѤ¤¤Æ¡¢ +.I key_t +·¿¤Î System V IPC ¥­¡¼¤òÀ¸À®¤¹¤ë¡£ +¤³¤Î¥­¡¼¤Ï +.BR msgget (2), +.BR semget (2), +.BR shmget (2) +¤Ê¤É¤Ç¤ÎÍøÍѤËŬ¤·¤Æ¤¤¤ë¡£ +.LP +.\"O The resulting value is the same for all pathnames that +.\"O name the same file, when the same value of +.\"O .I proj_id +.\"O is used. +.\"O The value returned should be different when the +.\"O (simultaneously existing) files or the project IDs differ. +Ʊ¤¸¥Õ¥¡¥¤¥ë¤ò¼¨¤¹¤¢¤é¤æ¤ë¥Ñ¥¹Ì¾¤È¡¢Æ±¤¸ +.I proj_id +¤ËÂФ·¤Æ¤Ï¡¢·ë²Ì¤ÎÃͤÏÅù¤·¤¯¤Ê¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬°ã¤Ã¤¿¤ê (¤³¤Î¾ì¹çξ¼Ô¤ÏƱ»þ¤Ë¸ºß¤·¤Æ¤¤¤ë¤Ï¤º)¡¢ +.I proj_id +¤¬°Û¤Ê¤ë¤È¡¢ÊÖ¤êÃͤâ°Û¤Ê¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success the generated +.\"O .I key_t +.\"O value is returned. +.\"O On failure \-1 is returned, with +.\"O .I errno +.\"O indicating the error as for the +.\"O .BR stat (2) +.\"O system call. +À®¸ù¤·¤¿¾ì¹ç¤ÏÀ¸À®¤µ¤ì¤¿ +.I key_t +¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤¹¤ë¤È \-1 ¤¬ÊÖ¤µ¤ì¡¢¥¨¥é¡¼¤ÎÆâÍƤ¬ +.B errno +¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£¤³¤ÎÆâÍƤϥ·¥¹¥Æ¥à¥³¡¼¥ë +.BR stat (2) +¤Î¤â¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Under libc4 and libc5 (and under SunOS 4.x) the prototype was: +libc4 ¤È libc5 (¤ª¤è¤Ó SunOS 4.x) ¤Ç¤Ï¡¢ +¥×¥í¥È¥¿¥¤¥×¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.sp +.RS +.BI "key_t ftok(char *" pathname ", char " proj_id ); +.RE +.PP +.\"O Today +.\"O .I proj_id +.\"O is an +.\"O .IR int , +.\"O but still only 8 bits are used. +.\"O Typical usage has an ASCII character +.\"O .IR proj_id , +.\"O that is why the behavior is said to be undefined when +.\"O .I proj_id +.\"O is zero. +¸½ºß¤Ç¤Ï +.I proj_id +¤Ï +.I int +¤À¤¬¡¢°ÍÁ³¤È¤·¤Æ 8 ¥Ó¥Ã¥È¤·¤«ÍѤ¤¤é¤ì¤Ê¤¤¡£ +Ä̾ï¤Ï ASCII ¥­¥ã¥é¥¯¥¿¤¬ +.I proj_id +¤ËÍѤ¤¤é¤ì¤ë¡£ +.I proj_id +¤¬ 0 ¤Î¤È¤­¤Î¿¶¤ëÉñ¤¤¤¬Ì¤ÄêµÁ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ï¡¢¤³¤ì¤¬Íýͳ¤Ç¤¢¤ë¡£ +.LP +.\"O Of course no guarantee can be given that the resulting +.\"O .I key_t +.\"O is unique. +.\"O Typically, a best effort attempt combines the given +.\"O .I proj_id +.\"O byte, the lower 16 bits of the inode number, and the +.\"O lower 8 bits of the device number into a 32-bit result. +.\"O Collisions may easily happen, for example between files on +.\"O .I /dev/hda1 +.\"O and files on +.\"O .IR /dev/sda1 . +¤â¤Á¤í¤ó +.I key_t +¤¬Â¾¤È½Å¤Ê¤é¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¤«¤É¤¦¤«¤ÏÊݾڤµ¤ì¤Ê¤¤¡£ +ºÇÁ±¤Î¾ì¹ç¤ÎÁȤ߹ç¤ï¤»¤ò¹Í¤¨¤Æ¤â¡¢ +.I proj_id +¤Î 1 ¥Ð¥¤¥È¡¢i ¥Î¡¼¥ÉÈÖ¹æ¤ÎÄã°Ì 16 ¥Ó¥Ã¥È¡¢¤ª¤è¤Ó +¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤ÎÄã°Ì 8 ¥Ó¥Ã¥È¤Ê¤Î¤Ç¡¢·ë²Ì¤Ï 32 ¥Ó¥Ã¥È¤Ë²á¤®¤Ê¤¤¡£ +Î㤨¤Ð +.I /dev/hda1 +¤È +.I /dev/sda1 +¤½¤ì¤¾¤ì¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¡¢¾×ÆͤÏÍưפ˵¯¤³¤ê¤¦¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR msgget (2), +.BR semget (2), +.BR shmget (2), +.BR stat (2), +.BR svipc (7) diff --git a/draft/man3/fts.3 b/draft/man3/fts.3 new file mode 100644 index 00000000..1eb9cde6 --- /dev/null +++ b/draft/man3/fts.3 @@ -0,0 +1,1368 @@ +.\" $NetBSD: fts.3,v 1.13.2.1 1997/11/14 02:09:32 mrg Exp $ +.\" +.\" Copyright (c) 1989, 1991, 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. +.\" 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. +.\" +.\" @(#)fts.3 8.5 (Berkeley) 4/16/94 +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jul 11 19:02:58 JST 2000 +.\" by Yuichi SATO +.\" +.\"WORD: hierarchy ³¬ÁØ +.\"WORD: traverse ¤¿¤É¤ë +.\"WORD: pointer ¥Ý¥¤¥ó¥¿ +.\"WORD: restore Éü¸µ¤¹¤ë +.\"WORD: null-terminated NULL ½ªÃ¼¤µ¤ì¤¿ +.\" +.TH FTS 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fts, fts_open, fts_read, fts_children, fts_set, fts_close \- \ +.\"O traverse a file hierarchy +fts, fts_open, fts_read, fts_children, fts_set, fts_close \- \ +¥Õ¥¡¥¤¥ë³¬Áؤò¤¿¤É¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "FTS *fts_open(char * const *" path_argv ", int " options ", " +.BI " int (*" compar ")(const FTSENT **, const FTSENT **));" +.sp +.BI "FTSENT *fts_read(FTS *" ftsp ); +.sp +.BI "FTSENT *fts_children(FTS *" ftsp ", int " options ); +.sp +.BI "int fts_set(FTS *" ftsp ", FTSENT *" f ", int " options ); +.sp +.BI "int fts_close(FTS *" ftsp ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O fts functions are provided for traversing +.\"O file hierarchies. +.\"O A simple overview is that the +.\"O .BR fts_open () +.\"O function returns a "handle" on a file hierarchy, which is then supplied to +.\"O the other +.\"O fts functions. +fts ´Ø¿ô·²¤Ï¡¢¥Õ¥¡¥¤¥ë³¬Áؤò¤¿¤É¤ë¤¿¤á¤ËÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +´Êñ¤Ë³µÎ¬¤¹¤ë¤È¼¡¤Î¤è¤¦¤Ë¤Ê¤ë¡£ +.BR fts_open () +´Ø¿ô¤Ï¡¢Â¾¤Î fts ´Ø¿ô·²¤ËÅϤ¹¤¿¤á¤Î¡¢¥Õ¥¡¥¤¥ë³¬ÁؤΡ֥ϥó¥É¥ë¡×¤òÊÖ¤¹¡£ +.\"O The function +.\"O .BR fts_read () +.\"O returns a pointer to a structure describing one of the files in the file +.\"O hierarchy. +.\"O The function +.\"O .BR fts_children () +.\"O returns a pointer to a linked list of structures, each of which describes +.\"O one of the files contained in a directory in the hierarchy. +.\"O In general, directories are visited two distinguishable times; in preorder +.\"O (before any of their descendants are visited) and in postorder (after all +.\"O of their descendants have been visited). +.\"O Files are visited once. +.\"O It is possible to walk the hierarchy "logically" (ignoring symbolic links) +.\"O or physically (visiting symbolic links), order the walk of the hierarchy or +.\"O prune and/or revisit portions of the hierarchy. +.BR fts_read () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë³¬ÁØÃæ¤Ë¤¢¤ë 1 ¤Ä¤Î¥Õ¥¡¥¤¥ë¤òµ­½Ò¤¹¤ë¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.BR fts_children () +´Ø¿ô¤Ï¡¢³¬ÁØÃæ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤òµ­½Ò¤¹¤ë¹½Â¤ÂΤΠ+¥ê¥ó¥¯¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +°ìÈ̤˥ǥ£¥ì¥¯¥È¥ê¤Ï¡¢ +preorder (ÀµÊý¸þ¡§²¼¤Î³¬ÁؤΥǥ£¥ì¥¯¥È¥ê¤ò¤¿¤É¤ëÁ°) ¤È +postorder (µÕÊý¸þ¡§²¼¤Î³¬ÁؤΥǥ£¥ì¥¯¥È¥ê¤ò¤¹¤Ù¤Æ¤¿¤É¤Ã¤¿¸å) ¤È¤¤¤¦¡¢ +°Û¤Ê¤ëÊý¸þ¤Ç 2 ²ó¤¿¤É¤é¤ì¤ë¡£¥Õ¥¡¥¤¥ë¤Ï 1 ²ó¤¿¤É¤é¤ì¤ë¡£ +¥Ç¥£¥ì¥¯¥È¥ê³¬Áؤò¡ÖÏÀÍýŪ¤Ë¡×(¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥°¤ò̵»ë¤·¤Æ) °ÜÆ°¤¹¤ë¤³¤È¤â¡¢ +ʪÍýŪ¤Ë (¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò¤¿¤É¤Ã¤Æ) °ÜÆ°¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¢¤ë¡£ +¤Þ¤¿¡¢³¬ÁØÃæ¤Î°ÜÆ°¤ÎÆ»¶Ú¤ò»Ø¼¨¤¹¤ë¤³¤È¡¦ +;ʬ¤Ê¤â¤Î¤ò¼è¤ê½ü¤¯¤³¤È¡¦³¬ÁؤΰìÉô¤òºÆ¤Ó¤¿¤É¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¡£ +.PP +.\"O Two structures are defined (and typedef'd) in the include file +.\"O .IR . +.\"O The first is +.\"O .IR FTS , +.\"O the structure that represents the file hierarchy itself. +.\"O The second is +.\"O .IR FTSENT , +.\"O the structure that represents a file in the file +.\"O hierarchy. +.\"O Normally, an +.\"O .I FTSENT +.\"O structure is returned for every file in the file +.\"O hierarchy. +.\"O In this manual page, "file" and +.\"O "FTSENT structure" +.\"O are generally interchangeable. +.\"O The +.\"O .I FTSENT +.\"O structure contains at least the following fields, which are +.\"O described in greater detail below: +2 ¤Ä¤Î¹½Â¤ÂΤ¬¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë (¤µ¤é¤Ë typedef ¤µ¤ì¤Æ¤¤¤ë)¡£ +1 ¤ÄÌܤϡ¢¥Õ¥¡¥¤¥ë³¬Áؤ½¤Î¤â¤Î¤òɽ¸½¤¹¤ë +.I FTS +¹½Â¤ÂΤǤ¢¤ë¡£ +2 ¤ÄÌܤϡ¢¥Õ¥¡¥¤¥ë³¬ÁØÃæ¤Î¥Õ¥¡¥¤¥ë¤òɽ¸½¤¹¤ë +.I FTSENT +¹½Â¤ÂΤǤ¢¤ë¡£ +.I FTSENT +¹½Â¤ÂΤÏÄ̾¥Õ¥¡¥¤¥ë³¬ÁØÃæ¤Î¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤ÆÊÖ¤µ¤ì¤ë¡£ +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ï¡¢¡Ö¥Õ¥¡¥¤¥ë¡×¤È +.RI ¡Ö FTSENT +¹½Â¤ÂΡפò°ìÈ̤ËÆɤßÊѤ¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.I FTSENT +¹½Â¤ÂΤϡ¢¾¯¤Ê¤¯¤È¤â¼¡¤Î¤è¤¦¤Ê¥Õ¥£¡¼¥ë¥É¤ò»ý¤Ã¤Æ¤ª¤ê¡¢ +°Ê²¼¤Ç¤è¤ê¾Ü¤·¤¯ÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +.in +4n +.nf + +.\"O typedef struct _ftsent { +.\"O unsigned short fts_info; /* flags for FTSENT structure */ +.\"O char *fts_accpath; /* access path */ +.\"O char *fts_path; /* root path */ +.\"O short fts_pathlen; /* strlen(fts_path) */ +.\"O char *fts_name; /* filename */ +.\"O short fts_namelen; /* strlen(fts_name) */ +.\"O short fts_level; /* depth (\-1 to N) */ +.\"O int fts_errno; /* file errno */ +.\"O long fts_number; /* local numeric value */ +.\"O void *fts_pointer; /* local address value */ +.\"O struct ftsent *fts_parent; /* parent directory */ +.\"O struct ftsent *fts_link; /* next file structure */ +.\"O struct ftsent *fts_cycle; /* cycle structure */ +.\"O struct stat *fts_statp; /* stat(2) information */ +.\"O } FTSENT; +typedef struct _ftsent { + unsigned short fts_info; /* FTSENT ¹½Â¤ÂΤΤ¿¤á¤Î¥Õ¥é¥° */ + char *fts_accpath; /* ¥¢¥¯¥»¥¹¥Ñ¥¹ */ + char *fts_path; /* ¥ë¡¼¥È¥Ñ¥¹ */ + short fts_pathlen; /* fts_path ¤ÎŤµ */ + char *fts_name; /* ¥Õ¥¡¥¤¥ë̾ */ + short fts_namelen; /* fts_name ¤ÎŤµ */ + short fts_level; /* ¿¼¤µ (\-1 ¡Á N) */ + int fts_errno; /* ¥Õ¥¡¥¤¥ë¤Î¥¨¥é¡¼ÈÖ¹æ */ + long fts_number; /* ¥í¡¼¥«¥ë¤ÊÈÖ¹æ */ + void *fts_pointer; /* ¥í¡¼¥«¥ë¤Ê¥¢¥É¥ì¥¹ÈÖ¹æ */ + struct ftsent *fts_parent; /* ¿Æ¥Ç¥£¥ì¥¯¥È¥ê */ + struct ftsent *fts_link; /* ¼¡¤Î¥Õ¥¡¥¤¥ë¹½Â¤ÂÎ */ + struct ftsent *fts_cycle; /* ½Û´Ä¤·¤Æ¤¤¤ë¹½Â¤ÂÎ */ + struct stat *fts_statp; /* stat(2) ¤Î¾ðÊó */ +} FTSENT; +.fi +.in +.PP +.\"O These fields are defined as follows: +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" .Bl -tag -width "fts_namelen" +.TP 12 +.IR fts_info +.\"O One of the following flags describing the returned +.\"O .I FTSENT +.\"O structure and +.\"O the file it represents. +.\"O With the exception of directories without errors +.\"O .RB ( FTS_D ), +.\"O all of these +.\"O entries are terminal, that is, they will not be revisited, nor will any +.\"O of their descendants be visited. +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢ÊÖ¤µ¤ì¤¿ +.I FTSENT +¹½Â¤ÂΤȥե¡¥¤¥ë¤òÀâÌÀ¤¹¤ë°Ê²¼¤Î¥Õ¥é¥°¤Î¤¤¤º¤ì¤«¤òɽ¤·¤Æ¤¤¤ë¡£ +¥¨¥é¡¼¤Î¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê +.RB ( FTS_D ), +¤Î¾ì¹ç¤ÏÎã³°¤È¤·¤Æ¡¢¤½¤ì°Ê³°¤Î¤¹¤Ù¤Æ¤Î¥¨¥ó¥È¥ê¤Ï½ªÃ¼¤Ç¤¢¤ë¡£ +¤Ä¤Þ¤ê¡¢¥¨¥ó¥È¥ê¤ÏºÆ¤Ó¤¿¤É¤é¤ì¤ë¤³¤È¤â¤Ê¤¯¡¢ +¤½¤ì¤è¤ê²¼¤Î³¬Áؤ¬¤¿¤É¤é¤ì¤ë¤³¤È¤â¤Ê¤¤¡£ +.\" .Bl -tag -width FTS_DEFAULT +.RS 12 +.TP 12 +.BR FTS_D +.\"O A directory being visited in preorder. +preorder ¤Ç¤¿¤É¤é¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¡£ +.TP +.BR FTS_DC +.\"O A directory that causes a cycle in the tree. +.\"O (The +.\"O .I fts_cycle +.\"O field of the +.\"O .I FTSENT +.\"O structure will be filled in as well.) +¥Ä¥ê¡¼¤ÎÃæ¤Ç½Û´Ä¤·¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¡£ +.RI ( FTSENT +¹½Â¤ÂΤΠ+.I fts_cycle +¥Õ¥£¡¼¥ë¥É¤âƱÍͤËËä¤á¤é¤ì¤ë¡£) +.TP +.BR FTS_DEFAULT +.\"O Any +.\"O .I FTSENT +.\"O structure that represents a file type not explicitly described +.\"O by one of the other +.\"O .I fts_info +.\"O values. +¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤òɽ¸½¤¹¤ë +.I FTSENT +¹½Â¤ÂΤ¬¡¢ +.I fts_info +¤Î¾¤Î¤¤¤º¤ì¤«¤ÎÃͤÇÌÀ¼¨Åª¤ËÀâÌÀ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.BR FTS_DNR +.\"O A directory which cannot be read. +.\"O This is an error return, and the +.\"O .I fts_errno +.\"O field will be set to indicate what caused the error. +Æɤ߹þ¤ß¤¬¤Ç¤­¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¡£ +¤³¤ì¤Ï¥¨¥é¡¼¤Î¾ì¹ç¤ÎÊÖ¤êÃͤǤ¢¤ê¡¢ +²¿¤¬¥¨¥é¡¼¤òµ¯¤³¤·¤¿¤«¤ò¼¨¤¹¤¿¤á¤Ë +.I fts_errno +¥Õ¥£¡¼¥ë¥É¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +.BR FTS_DOT +.\"O A file named +.\"O "." +.\"O or +.\"O ".." +.\"O which was not specified as a filename to +.\"O .BR fts_open () +.\"O (see +.\"O .BR FTS_SEEDOT ). +.BR fts_open () +¤Ø¤Î¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿ +"." ¤Þ¤¿¤Ï ".." +¤È¤¤¤¦Ì¾Á°¤Î¥Õ¥¡¥¤¥ë +.RB ( FTS_SEEDOT +¤ò»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.BR FTS_DP +.\"O A directory being visited in postorder. +.\"O The contents of the +.\"O .I FTSENT +.\"O structure will be unchanged from when +.\"O it was returned in preorder, that is, with the +.\"O .I fts_info +.\"O field set to +.\"O .BR FTS_D . +postorder ¤Ç¤¿¤É¤é¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¡£ +.I FTSENT +¹½Â¤ÂΤÎÆâÍƤϡ¢preorder ¤Î¤È¤­¤ËÊÖ¤µ¤ì¤¿¾õÂÖ +(¤Ä¤Þ¤ê¡¢ +.I fts_info +¥Õ¥£¡¼¥ë¥É¤¬ +.B FTS_D +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾õÂÖ) ¤«¤éÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.TP +.B FTS_ERR +.\"O This is an error return, and the +.\"O .I fts_errno +.\"O field will be set to indicate what caused the error. +¤³¤ì¤Ï¥¨¥é¡¼¤Î¾ì¹ç¤ÎÊÖ¤êÃͤǤ¢¤ê¡¢ +.I fts_errno +¥Õ¥£¡¼¥ë¥É¤Ï¡¢²¿¤¬¥¨¥é¡¼¤òµ¯¤³¤·¤¿¤«¤ò¼¨¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£ +.TP +.B FTS_F +.\"O A regular file. +Ä̾ï¤Î¥Õ¥¡¥¤¥ë¡£ +.TP +.B FTS_NS +.\"O A file for which no +.\"O .BR stat (2) +.\"O information was available. +.\"O The contents of the +.\"O .I fts_statp +.\"O field are undefined. +.\"O This is an error return, and the +.\"O .I fts_errno +.\"O field will be set to indicate what caused the error. +.BR stat (2) +¾ðÊó¤¬ÆÀ¤é¤ì¤Ê¤«¤Ã¤¿¥Õ¥¡¥¤¥ë¡£ +.I fts_statp +¥Õ¥£¡¼¥ë¥É¤ÎÆâÍƤÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ +¤³¤ì¤Ï¥¨¥é¡¼¤Î¾ì¹ç¤ÎÊÖ¤êÃͤǤ¢¤ê¡¢ +.I fts_errno +¥Õ¥£¡¼¥ë¥É¤Ï¡¢²¿¤¬¥¨¥é¡¼¤òµ¯¤³¤·¤¿¤«¤ò¼¨¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£ +.TP +.B FTS_NSOK +.\"O A file for which no +.\"O .BR stat (2) +.\"O information was requested. +.\"O The contents of the +.\"O .I fts_statp +.\"O field are undefined. +.BR stat (2) +¾ðÊó¤¬Í׵ᤵ¤ì¤Ê¤«¤Ã¤¿¥Õ¥¡¥¤¥ë¡£ +.I fts_statp +¥Õ¥£¡¼¥ë¥É¤ÎÆâÍƤÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ +.TP +.B FTS_SL +.\"O A symbolic link. +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¡£ +.TP +.B FTS_SLNONE +.\"O A symbolic link with a non-existent target. +.\"O The contents of the +.\"O .I fts_statp +.\"O field reference the file characteristic information for the symbolic link +.\"O itself. +¥ê¥ó¥¯Àè¤Î¸ºß¤·¤Ê¤¤¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¡£ +.I fts_statp +¥Õ¥£¡¼¥ë¥É¤ÎÆâÍƤϡ¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤½¤Î¤â¤Î¤Î¥Õ¥¡¥¤¥ëÆÃÀ­¾ðÊó¤ò»²¾È¤¹¤ë¡£ +.\" .El +.RE +.TP +.IR fts_accpath +.\"O A path for accessing the file from the current directory. +¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î¥Ñ¥¹¡£ +.TP +.IR fts_path +.\"O The path for the file relative to the root of the traversal. +.\"O This path contains the path specified to +.\"O .BR fts_open () +.\"O as a prefix. +³¬Áؤò¤¿¤É¤ë¤È¤­¤Î¥ë¡¼¥È¤«¤é¤ß¤¿¥Õ¥¡¥¤¥ë¤ÎÁêÂÐŪ¤Ê¥Ñ¥¹¡£ +¤³¤Î¥Ñ¥¹¤Ë¤Ï¡¢ +.BR fts_open () +¤Ë»ØÄꤷ¤¿¥Ñ¥¹¤¬¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤È¤·¤Æ´Þ¤Þ¤ì¤ë¡£ +.TP +.IR fts_pathlen +.\"O The length of the string referenced by +.\"O .IR fts_path . +.I fts_path +¤Ç»²¾È¤µ¤ì¤ëʸ»úÎó¤ÎŤµ¡£ +.TP +.IR fts_name +.\"O The name of the file. +¥Õ¥¡¥¤¥ë¤Î̾Á°¡£ +.TP +.IR fts_namelen +.\"O The length of the string referenced by +.\"O .IR fts_name . +.I fts_name +¤Ç»²¾È¤µ¤ì¤ëʸ»úÎó¤ÎŤµ¡£ +.TP +.IR fts_level +.\"O The depth of the traversal, numbered from \-1 to N, where this file +.\"O was found. +.\"O The +.\"O .I FTSENT +.\"O structure representing the parent of the starting point (or root) +.\"O of the traversal is numbered \-1, and the +.\"O .I FTSENT +.\"O structure for the root +.\"O itself is numbered 0. +³¬Áؤò¤¿¤É¤Ã¤Æ¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤¬¤ß¤Ä¤«¤Ã¤¿¿¼¤µ¡£ +\-1 ¡Á N ¤Î¿ôÃͤÇɽ¤µ¤ì¤ë¡£ +³¬Áؤò¤¿¤É¤ë¤È¤­¤Î½ÐȯÅÀ (¥ë¡¼¥È) ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤òɽ¤¹ +.I FTSENT +¹½Â¤ÂÎ¤Ç¤Ï \-1 ¤È¤Ê¤ë¡£ +¤Þ¤¿¡¢¥ë¡¼¥È¼«¿È¤Î +.I FTSENT +¹½Â¤ÂÎ¤Ç¤Ï 0 ¤Ë¤Ê¤ë¡£ +.TP +.IR fts_errno +.\"O Upon return of a +.\"O .I FTSENT +.\"O structure from the +.\"O .BR fts_children () +.\"O or +.\"O .BR fts_read () +.\"O functions, with its +.\"O .I fts_info +.\"O field set to +.\"O .BR FTS_DNR , +.\"O .B FTS_ERR +.\"O or +.\"O .BR FTS_NS , +.\"O the +.\"O .I fts_errno +.\"O field contains the value of the external variable +.\"O .I errno +.\"O specifying the cause of the error. +.\"O Otherwise, the contents of the +.\"O .I fts_errno +.\"O field are undefined. +´Ø¿ô +.BR fts_children () +¤È +.BR fts_read () +¤«¤éÊÖ¤µ¤ì¤ë +.I FTSENT +¹½Â¤ÂΤΠ+.I fts_info +¥Õ¥£¡¼¥ë¥É¤¬ +.BR FTS_DNR , +.BR FTS_ERR , +.B FTS_NS +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.I fts_errno +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥¨¥é¡¼¤Î¸¶°ø¤ò¼¨¤¹³°ÉôÊÑ¿ô +.I errno +¤ÎÃͤ¬Æþ¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.I fts_errno +¥Õ¥£¡¼¥ë¥É¤ÎÆâÍƤÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ +.TP +.IR fts_number +.\"O This field is provided for the use of the application program and is +.\"O not modified by the +.\"O fts functions. +.\"O It is initialized to 0. +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é»ÈÍѤ¹¤ë¤¿¤á¤ËÄ󶡤µ¤ì¡¢ +fts ´Ø¿ô·²¤Ç¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï 0 ¤Ç½é´ü²½¤µ¤ì¤ë¡£ +.TP +.IR fts_pointer +.\"O This field is provided for the use of the application program and is +.\"O not modified by the +.\"O fts functions. +.\"O It is initialized to +.\"O .BR NULL . +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é»ÈÍѤ¹¤ë¤¿¤á¤ËÄ󶡤µ¤ì¡¢ +fts ´Ø¿ô·²¤Ç¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï +.B NULL +¤Ç½é´ü²½¤µ¤ì¤ë¡£ +.TP +.IR fts_parent +.\"O A pointer to the +.\"O .I FTSENT +.\"O structure referencing the file in the hierarchy +.\"O immediately above the current file, that is, the directory of which this +.\"O file is a member. +.\"O A parent structure for the initial entry point is provided as well, +.\"O however, only the +.\"O .IR fts_level , +.\"O .I fts_number +.\"O and +.\"O .I fts_pointer +.\"O fields are guaranteed to be initialized. +¸½ºß¤Î¥Õ¥¡¥¤¥ë¤Î¤¹¤°¾å¤Î³¬Áؤˤ¢¤ë¥Õ¥¡¥¤¥ë +(¤Ä¤Þ¤ê¡¢¸½ºß¤Î¥Õ¥¡¥¤¥ë¤¬¥á¥ó¥Ð¡¼¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê) ¤ò»²¾È¤¹¤ë +.I FTSENT +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡£ +ºÇ½é¤Î½ÐȯÅÀ¤ËÂФ·¤Æ¤â¡¢¿Æ¤È¤Ê¤ë¹½Â¤ÂΤÏÍ¿¤¨¤é¤ì¤ë¡£ +¤·¤«¤·¡¢ +.IR fts_level , +.IR fts_number , +.I fts_pointer +¥Õ¥£¡¼¥ë¥É¤Î¤ß¤Î½é´ü²½¤·¤«Êݾڤµ¤ì¤Ê¤¤¡£ +.TP +.IR fts_link +.\"O Upon return from the +.\"O .BR fts_children () +.\"O function, the +.\"O .I fts_link +.\"O field points to the next structure in the NULL-terminated linked list of +.\"O directory members. +.\"O Otherwise, the contents of the +.\"O .I fts_link +.\"O field are undefined. +.BR fts_children () +¤«¤éÊÖ¤µ¤ì¤ë¾ì¹ç¡¢ +.I fts_link +¥Õ¥£¡¼¥ë¥É¤Ï¥Ç¥£¥ì¥¯¥È¥ê¥á¥ó¥Ð¡¼¤Î NUL ½ªÃ¼¤µ¤ì¤¿¥ê¥ó¥¯¥ê¥¹¥È¤Î·Á¼°¤Ç¡¢ +¼¡¤Î¹½Â¤ÂΤò»Ø¤·¼¨¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.I fts_link +¥Õ¥£¡¼¥ë¥É¤ÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ +.TP +.IR fts_cycle +.\"O If a directory causes a cycle in the hierarchy (see +.\"O .BR FTS_DC ), +.\"O either because +.\"O of a hard link between two directories, or a symbolic link pointing to a +.\"O directory, the +.\"O .I fts_cycle +.\"O field of the structure will point to the +.\"O .I FTSENT +.\"O structure in the hierarchy that references the same file as the current +.\"O .I FTSENT +.\"O structure. +.\"O Otherwise, the contents of the +.\"O .I fts_cycle +.\"O field are undefined. +2 ¤Ä¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥Ï¡¼¥É¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤ë¤¿¤á¡¢ +¤Þ¤¿¤Ï¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò»Ø¤·¤Æ¤¤¤ë¤¿¤á¤Ë¡¢ +¥Ç¥£¥ì¥¯¥È¥ê¤¬½Û´Ä¤¹¤ë³¬Áع½Â¤¤òºî¤Ã¤Æ¤¤¤ë¾ì¹ç +.RB ( FTS_DC +¤ò»²¾È)¡¢ +¹½Â¤ÂΤΠ+.I fts_cycle +¥Õ¥£¡¼¥ë¥É¤Ï¡¢³¬ÁØÃæ¤Ç¸½ºß¤Î +.I FTSENT +¹½Â¤ÂΤÈƱ¤¸¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë +.I FTSENT +¹½Â¤ÂΤò»Ø¤·¼¨¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.I fts_cycle +¥Õ¥£¡¼¥ë¥É¤ÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ +.TP +.IR fts_statp +.\"O A pointer to +.\"O .BR stat (2) +.\"O information for the file. +¤³¤Î¥Õ¥¡¥¤¥ë¤Î +.BR stat (2) +¾ðÊó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.\" .El +.PP +.\"O A single buffer is used for all of the paths of all of the files in the +.\"O file hierarchy. +.\"O Therefore, the +.\"O .I fts_path +.\"O and +.\"O .I fts_accpath +.\"O fields are guaranteed to be +.\"O null-terminated +.\"O .I only +.\"O for the file most recently returned by +.\"O .BR fts_read (). +.\"O To use these fields to reference any files represented by other +.\"O .I FTSENT +.\"O structures will require that the path buffer be modified using the +.\"O information contained in that +.\"O .I FTSENT +.\"O structure's +.\"O .I fts_pathlen +.\"O field. +.\"O Any such modifications should be undone before further calls to +.\"O .BR fts_read () +.\"O are attempted. +.\"O The +.\"O .I fts_name +.\"O field is always +.\"O null-terminated. +¥Õ¥¡¥¤¥ë³¬ÁØÃæ¤Î¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¤ËÂФ·¤Æ¡¢ +¤¿¤À 1 ¤Ä¤Î¥Ð¥Ã¥Õ¥¡¡¼¤¬»È¤ï¤ì¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢ +.I fts_path +¤È +.I fts_accpath +¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +.BR fts_read () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤¿ºÇ¤â¿·¤·¤¤¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¡Ö¤Î¤ß¡× +NULL ½ªÃ¼¤µ¤ì¤ë¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤ò¡¢Â¾¤Î +.I FTSENT +¹½Â¤ÂΤÇɽ¸½¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¤¿¤á¤Ë»È¤¦¤Ë¤Ï¡¢ +.I FTSENT +¹½Â¤ÂΤΠ+.I fts_pathlen +¥Õ¥£¡¼¥ë¥É¤Ë¤¢¤ë¾ðÊó¤ò»È¤Ã¤Æ¥Ñ¥¹¤Î¥Ð¥Ã¥Õ¥¡¡¼¤ò½¤Àµ¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤ì¤é¤Î½¤Àµ¤Ï¡¢¤µ¤é¤Ë +.BR fts_read () +¤ò¸Æ¤Ó½Ð¤½¤¦¤È¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢¸µ¤ËÌᤷ¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I fts_name +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¾ï¤Ë +.B NUL +½ªÃ¼¤µ¤ì¤ë¡£ +.SS fts_open() +.\"O The +.\"O .BR fts_open () +.\"O function takes a pointer to an array of character pointers naming one +.\"O or more paths which make up a logical file hierarchy to be traversed. +.\"O The array must be terminated by a +.\"O .B NULL +.\"O pointer. +.BR fts_open () +´Ø¿ô¤Ï¡¢Ê¸»úÎó¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò°ú¤­¿ô¤Ë¼è¤ë¡£ +¤³¤Îʸ»úÎó¥Ý¥¤¥ó¥¿¤Ï¡¢ÏÀÍý¥Õ¥¡¥¤¥ë³¬Áؤò¤Ä¤¯¤ë 1 ¤Ä°Ê¾å¤Î¥Ñ¥¹¤Î̾Á°¤Ë¤Ê¤ë¡£ +ÇÛÎó¤Ï¡¢ +.B NULL +¥Ý¥¤¥ó¥¿¤Ç½ªÃ¼¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O There are +.\"O a number of options, at least one of which (either +.\"O .B FTS_LOGICAL +.\"O or +.\"O .BR FTS_PHYSICAL ) +.\"O must be specified. +.\"O The options are selected by +.\"O .IR or ing +.\"O the following values: +¿¤¯¤Î¥ª¥×¥·¥ç¥ó¤¬¤¢¤ê¡¢¾¯¤Ê¤¯¤È¤â 1 ¤Ä +.RB ( FTS_LOGICAL +¤Þ¤¿¤Ï +.BR FTS_PHYSICAL ) +¤¬»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¼¡¤Î¥ª¥×¥·¥ç¥ó¤¬ +.I or +¤ò¤È¤Ã¤ÆÁªÂò¤µ¤ì¤ë¡£ +.\" .Bl -tag -width "FTS_PHYSICAL" +.TP +.B FTS_COMFOLLOW +.\"O This option causes any symbolic link specified as a root path to be +.\"O followed immediately whether or not +.\"O .B FTS_LOGICAL +.\"O is also specified. +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.B FTS_LOGICAL +¤Î»ØÄê¤Ë¤«¤«¤ï¤é¤º¡¢ +¥ë¡¼¥È¥Ñ¥¹¤Ë»ØÄꤵ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò¤¹¤°¤Ë¤¿¤É¤é¤»¤ë¡£ +.TP +.B FTS_LOGICAL +.\"O This option causes the +.\"O fts routines to return +.\"O .I FTSENT +.\"O structures for the targets of symbolic links +.\"O instead of the symbolic links themselves. +.\"O If this option is set, the only symbolic links for which +.\"O .I FTSENT +.\"O structures +.\"O are returned to the application are those referencing non-existent files. +.\"O Either +.\"O .B FTS_LOGICAL +.\"O or +.\"O .B FTS_PHYSICAL +.\"O .I must +.\"O be provided to the +.\"O .BR fts_open () +.\"O function. +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +fts ¥ë¡¼¥Á¥ó¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤½¤Î¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬»Ø¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Î +.I FTSENT +¹½Â¤ÂΤòÊÖ¤µ¤»¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +.I FTSENT +¹½Â¤ÂΤ¬¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÊÖ¤µ¤ì¤ë¤è¤¦¤Ê +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¤ß¤¬¡¢Â¸ºß¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.B FTS_LOGICAL +¤Þ¤¿¤Ï +.B FTS_PHYSICAL +¤Î¤É¤Á¤é¤«¤ò¡¢ +.BR fts_open () +´Ø¿ô¤ËÍ¿¤¨¤Ê¤±¤ì¤Ð¡Ö¤Ê¤é¤Ê¤¤¡×¡£ +.TP +.B FTS_NOCHDIR +.\"O As a performance optimization, the +.\"O fts functions change directories as they walk the file hierarchy. +.\"O This has the side-effect that an application cannot rely on being +.\"O in any particular directory during the traversal. +.\"O The +.\"O .B FTS_NOCHDIR +.\"O option turns off this optimization, and the +.\"O fts functions will not change the current directory. +.\"O Note that applications should not themselves change their current directory +.\"O and try to access files unless +.\"O .B FTS_NOCHDIR +.\"O is specified and absolute +.\"O pathnames were provided as arguments to +.\"O .BR fts_open (). +¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ÎºÇŬ²½¤Î¤¿¤á¡¢ +fts ´Ø¿ô·²¤Ï¥Õ¥¡¥¤¥ë³¬Áؤò¤¿¤É¤ë¤È¤­¥Ç¥£¥ì¥¯¥È¥ê¤òÊѤ¨¤ë¡£ +¤³¤ì¤Ë¤Ï¡¢³¬Áؤò¤¿¤É¤Ã¤Æ¤¤¤ë´Ö¤Ï +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¤¢¤ëÆÃÄê¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¤¤ë¤È¤¤¤¦¤³¤È¤Ë +°Í¸¤Ç¤­¤Ê¤¤¡¢¤È¤¤¤¦ÉûºîÍѤ¬¤¢¤ë¡£ +.B FTS_NOCHDIR +¥ª¥×¥·¥ç¥ó¤ÇºÇŬ²½¤ò̵¸ú¤Ë¤¹¤ë¤È¡¢ +fts ´Ø¿ô·²¤Ï¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤·¤Ê¤¤¡£ +.B FTS_NOCHDIR +¤¬»ØÄꤵ¤ì¡¢¤«¤Ä +.BR fts_open () +¤Î°ú¤­¿ô¤È¤·¤ÆÀäÂХѥ¹Ì¾¤¬Í¿¤¨¤é¤ì¤¿¤È¤­°Ê³°¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢ +¼«¤é¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤·¤¿¤ê¡¢ +¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤·¤¿¤ê¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡¢¤È¤¤¤¦ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.TP +.B FTS_NOSTAT +.\"O By default, returned +.\"O .I FTSENT +.\"O structures reference file characteristic information (the +.\"O .I statp +.\"O field) for each file visited. +.\"O This option relaxes that requirement as a performance optimization, +.\"O allowing the +.\"O fts functions to set the +.\"O .I fts_info +.\"O field to +.\"O .B FTS_NSOK +.\"O and leave the contents of the +.\"O .I statp +.\"O field undefined. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ÊÖ¤µ¤ì¤¿ +.I FTSENT +¹½Â¤ÂΤϡ¢¤¿¤É¤é¤ì¤¿³Æ¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤Î¥Õ¥¡¥¤¥ëÆÃħ¾ðÊó +.I ( statp +¥Õ¥£¡¼¥ë¥É) ¤ò»²¾È¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +fts ´Ø¿ô·²¤¬ +.I fts_info +¥Õ¥£¡¼¥ë¥É¤ò +.B FTS_NSOK +¤ËÀßÄꤷ +.I statp +¤ÎÆâÍƤòÄêµÁ¤µ¤ì¤Ê¤¤¤Þ¤Þ¤Ë¤¹¤ë¤³¤È¤òµö¤¹¤³¤È¤Ë¤è¤ê¡¢ +¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ÎºÇŬ²½¤ËɬÍפʤâ¤Î¤ò´ËϤ¹¤ë¡£ +.TP +.B FTS_PHYSICAL +.\"O This option causes the +.\"O fts routines to return +.\"O .I FTSENT +.\"O structures for symbolic links themselves instead +.\"O of the target files they point to. +.\"O If this option is set, +.\"O .I FTSENT +.\"O structures for all symbolic links in the +.\"O hierarchy are returned to the application. +.\"O Either +.\"O .B FTS_LOGICAL +.\"O or +.\"O .B FTS_PHYSICAL +.\"O .I must +.\"O be provided to the +.\"O .BR fts_open () +.\"O function. +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +fts ¥ë¡¼¥Á¥ó¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬»Ø¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Ç¤Ï¤Ê¤¯¡¢ +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¼«¿È¤Î +.I FTSENT +¹½Â¤ÂΤòÊÖ¤µ¤»¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤ë¤È¡¢³¬ÁØÃæ¤Î¤¹¤Ù¤Æ¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î +.I FTSENT +¹½Â¤ÂΤ¬¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÊÖ¤µ¤ì¤ë¡£ +.B FTS_LOGICAL +¤Þ¤¿¤Ï +.B FTS_PHYSICAL +¤Î¤É¤Á¤é¤«¤ò +.BR fts_open () +´Ø¿ô¤ËÍ¿¤¨¤Ê¤±¤ì¤Ð¡Ö¤Ê¤é¤Ê¤¤¡×¡£ +.TP +.B FTS_SEEDOT +.\"O By default, unless they are specified as path arguments to +.\"O .BR fts_open (), +.\"O any files named +.\"O "." +.\"O or +.\"O ".." +.\"O encountered in the file hierarchy are ignored. +.\"O This option causes the +.\"O fts routines to return +.\"O .I FTSENT +.\"O structures for them. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR fts_open () +¤Î¥Ñ¥¹°ú¤­¿ô¤È¤·¤Æ»ØÄꤵ¤ì¤Ê¤¤¸Â¤ê¡¢¥Õ¥¡¥¤¥ë³¬ÁØÃæ¤Ë¤¢¤ë +"." ¤Þ¤¿¤Ï ".." ¤È¤¤¤¦Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤Ï̵»ë¤µ¤ì¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +fts ¥ë¡¼¥Á¥ó¤Ë¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î +.I FTSENT +¹½Â¤ÂΤòÊÖ¤µ¤»¤ë¡£ +.TP +.B FTS_XDEV +.\"O This option prevents +.\"O fts from descending into directories that have a different device number +.\"O than the file from which the descent began. +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +fts ¤¬²¼¤ê»Ï¤á¤Î¥Õ¥¡¥¤¥ë¤È¤Ï°Û¤Ê¤ë¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤ò»ý¤Ã¤Æ¤¤¤ë +¥Ç¥£¥ì¥¯¥È¥ê¤Ë²¼¤ê¤ë¤Î¤òÁ˻ߤ¹¤ë¡£ +.\" .El +.PP +.\"O The argument +.\"O .BR compar () +.\"O specifies a user-defined function which may be used to order the traversal +.\"O of the hierarchy. +.\"O It +.\"O takes two pointers to pointers to +.\"O .I FTSENT +.\"O structures as arguments and +.\"O should return a negative value, zero, or a positive value to indicate +.\"O if the file referenced by its first argument comes before, in any order +.\"O with respect to, or after, the file referenced by its second argument. +.\"O The +.\"O .IR fts_accpath , +.\"O .I fts_path +.\"O and +.\"O .I fts_pathlen +.\"O fields of the +.\"O .I FTSENT +.\"O structures may +.\"O .I never +.\"O be used in this comparison. +.\"O If the +.\"O .I fts_info +.\"O field is set to +.\"O .B FTS_NS +.\"O or +.\"O .BR FTS_NSOK , +.\"O the +.\"O .I fts_statp +.\"O field may not either. +.\"O If the +.\"O .BR compar () +.\"O argument is +.\"O .BR NULL , +.\"O the directory traversal order is in the order listed in +.\"O .I path_argv +.\"O for the root paths, and in the order listed in the directory for +.\"O everything else. +°ú¤­¿ô +.BR compar () +¤Ï¡¢³¬Áؤò¤¿¤É¤ë½çÈÖ¤ò·è¤á¤ë¤Î¤Ë»È¤ï¤ì¤ë¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô¤ò»ØÄꤹ¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢°ú¤­¿ô¤È¤·¤Æ +.I FTSENT +¹½Â¤ÂΤΥݥ¤¥ó¥¿¤Î¥Ý¥¤¥ó¥¿¤ò 2 ¤Ä¤È¤ê¡¢ +1 ÈÖÌܤΰú¤­¿ô¤Ç»²¾È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬ +2 ÈÖÌܤΰú¤­¿ô¤Ç»²¾È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤è¤ê +Á°¤Ë¤¢¤ë¾ì¹ç¤ÏÉé¤ÎÃÍ¡¦Æ±¤¸¾ì¹ç¤Ï¥¼¥í¡¦¸å¤Ë¤¢¤ë¾ì¹ç¤ÏÀµ¤ÎÃͤò +ÊÖ¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I FTSENT +¹½Â¤ÂΤΠ+.IR fts_accpath , +.IR fts_path , +.I fts_pathlen +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤³¤ÎÈæ³Ó¤Ë¡ÖÀäÂС׻ȤäƤϤ¤¤±¤Ê¤¤¡£ +.I fts_info +¥Õ¥£¡¼¥ë¥É¤¬ +.B FTS_NS +¤Þ¤¿¤Ï +.B FTS_NSOK +¤ËÀßÄꤵ¤ì¤ë¾ì¹ç¡¢ +.I fts_statp +¥Õ¥£¡¼¥ë¥É¤Ï¤³¤ì¤é¤Î¤É¤Á¤é¤Ç¤â¤Ê¤¤¡£ +.BR compar () +°ú¤­¿ô¤¬ +.B NULL +¤Î¾ì¹ç¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ò¤¿¤É¤ë½çÈ֤ϡ¢¥ë¡¼¥È¥Ñ¥¹¤Ë¤Ä¤¤¤Æ¤Ï +.I path_argv +¤Î¤Ê¤«¤Ç¥ê¥¹¥È¤µ¤ì¤¿½çÈ֤ǡ¢ +¤½¤Î¾¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤Ï¥Ç¥£¥ì¥¯¥È¥êÆâ¤Ç¥ê¥¹¥È¤µ¤ì¤¿½çÈ֤Ȥʤ롣 +.SS fts_read() +.\"O The +.\"O .BR fts_read () +.\"O function returns a pointer to an +.\"O .I FTSENT +.\"O structure describing a file in +.\"O the hierarchy. +.\"O Directories (that are readable and do not cause cycles) are visited at +.\"O least twice, once in preorder and once in postorder. +.\"O All other files are visited at least once. +.\"O (Hard links between directories that do not cause cycles or symbolic +.\"O links to symbolic links may cause files to be visited more than once, +.\"O or directories more than twice.) +.BR fts_read () +´Ø¿ô¤Ï¡¢³¬ÁØÃæ¤Î¥Õ¥¡¥¤¥ë¤òµ­½Ò¤¹¤ë +.I FTSENT +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +(Æɤ߹þ¤ß²Äǽ¤Ç¡¢½Û´Ä¤·¤Æ¤¤¤Ê¤¤) ¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢ +1 ²ó¤Ï preorder ¤Ç¡¢¤â¤¦ 1 ²ó¤Ï postorder ¤Ç¡¢¾¯¤Ê¤¯¤È¤â 2 ²ó¤¿¤É¤é¤ì¤ë¡£ +¾¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¾¯¤Ê¤¯¤È¤â 1 ²ó¤¿¤É¤é¤ì¤ë¡£ +(¥Ç¥£¥ì¥¯¥È¥ê´Ö¤Î¥Ï¡¼¥É¥ê¥ó¥¯¤Ë¤è¤Ã¤Æ +½Û´Ä¤ä¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬µ¯¤³¤é¤Ê¤¤¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¤Ï 2 ²ó°Ê¾å¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ï 3 ²ó°Ê¾å¤¿¤É¤é¤ì¤ë¡£) +.PP +.\"O If all the members of the hierarchy have been returned, +.\"O .BR fts_read () +.\"O returns +.\"O .B NULL +.\"O and sets the external variable +.\"O .I errno +.\"O to 0. +.\"O If an error unrelated to a file in the hierarchy occurs, +.\"O .BR fts_read () +.\"O returns +.\"O .B NULL +.\"O and sets +.\"O .I errno +.\"O appropriately. +.\"O If an error related to a returned file occurs, a pointer to an +.\"O .I FTSENT +.\"O structure is returned, and +.\"O .I errno +.\"O may or may not have been set (see +.\"O .IR fts_info ). +³¬ÁØÃæ¤Î¤¹¤Ù¤Æ¤Î¥á¥ó¥Ð¡¼¤¬ÊÖ¤µ¤ì¤¿¾ì¹ç¡¢ +.BR fts_read () +¤Ï +.B NULL +¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô +.I errno +¤ò 0 ¤Ë¤¹¤ë¡£ +³¬ÁØÃæ¤Î¥Õ¥¡¥¤¥ë¤Ë´Ø·¸¤·¤Ê¤¤¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.BR fts_read () +¤Ï +.B NULL +¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ËÂбþ¤·¤¿Ãͤˤ¹¤ë¡£ +³¬ÁØÃæ¤Î¥Õ¥¡¥¤¥ë¤Ë´Ø·¸¤·¤¿¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.I FTSENT +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ÏÀßÄꤵ¤ì¤ë¾ì¹ç¤ÈÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¤¬¤¢¤ë +.RI ( fts_info +¤ò»²¾È¤¹¤ë¤³¤È)¡£ +.PP +.\"O The +.\"O .I FTSENT +.\"O structures returned by +.\"O .BR fts_read () +.\"O may be overwritten after a call to +.\"O .BR fts_close () +.\"O on the same file hierarchy stream, or, after a call to +.\"O .BR fts_read () +.\"O on the same file hierarchy stream unless they represent a file of type +.\"O directory, in which case they will not be overwritten until after a call to +.\"O .BR fts_read () +.\"O after the +.\"O .I FTSENT +.\"O structure has been returned by the function +.\"O .BR fts_read () +.\"O in postorder. +.BR fts_read () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë +.I FTSENT +¹½Â¤ÂΤϡ¢Æ±¤¸¥Õ¥¡¥¤¥ë³¬ÁØ¥¹¥È¥ê¡¼¥à¤Ø¤Î +.BR fts_close () +¤Î¸Æ½Ð¤·¤Î¸å¤Ë¾å½ñ¤­¤µ¤ì¤ë¡£ +¤Þ¤¿¡¢Æ±¤¸¥Õ¥¡¥¤¥ë³¬ÁØ¥¹¥È¥ê¡¼¥à¤Ø¤Î +.BR fts_read () +¤Î¸Æ½Ð¤·¤Î¸å¤Ç¤â¡¢¹½Â¤ÂΤ¬¥Ç¥£¥ì¥¯¥È¥ê¤òɽ¸½¤·¤Æ¤¤¤Ê¤¤¸Â¤ê¾å½ñ¤­¤µ¤ì¤ë¡£ +¤³¤Î¾ì¹ç¡¢ +.BR fts_read () +´Ø¿ô¤Ë¤è¤Ã¤Æ postorder ¤Ç +.I FTSENT +¹½Â¤ÂΤ¬ÊÖ¤µ¤ì¤¿¸å¡¢ +.BR fts_read () +¤Î¸Æ½Ð¤·¤¬¤¢¤ë¤Þ¤Ç¡¢ +¤³¤ì¤é¤Î¹½Â¤ÂΤϾå½ñ¤­¤µ¤ì¤Ê¤¤¡£ +.SS fts_children() +.\"O The +.\"O .BR fts_children () +.\"O function returns a pointer to an +.\"O .I FTSENT +.\"O structure describing the first entry in a NULL-terminated linked list of +.\"O the files in the directory represented by the +.\"O .I FTSENT +.\"O structure most recently returned by +.\"O .BR fts_read (). +.\"O The list is linked through the +.\"O .I fts_link +.\"O field of the +.\"O .I FTSENT +.\"O structure, and is ordered by the user-specified comparison function, if any. +.\"O Repeated calls to +.\"O .BR fts_children () +.\"O will recreate this linked list. +.BR fts_children () +´Ø¿ô¤Ï¡¢ +.I FTSENT +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂΤϡ¢( +.BR fts_read () +¤ÇºÇ¤â¿·¤·¤¯ÊÖ¤µ¤ì¤¿ +.I FTSENT +¹½Â¤ÂΤÇɽ¸½¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤Î) +NUL ½ªÃ¼¤µ¤ì¤¿¥ê¥ó¥¯¥ê¥¹¥È¤ÎºÇ½é¤Î¥¨¥ó¥È¥ê¤òµ­½Ò¤¹¤ë¡£ +¤³¤Î¥ê¥¹¥È¤Ï¡¢ +.I FTSENT +¹½Â¤ÂΤΠ+.I fts_link +¥Õ¥£¡¼¥ë¥É¤ò»È¤Ã¤Æ¥ê¥ó¥¯¤µ¤ì¡¢ +¥æ¡¼¥¶¡¼»ØÄê¤ÎÈæ³Ó´Ø¿ô¤¬¤¢¤ë¾ì¹ç¤Ï¡¢¤½¤ì¤Ç½ç½ø¤Å¤±¤é¤ì¤ë¡£ +.BR fts_children () +¤Î¸Æ½Ð¤·¤ò·«¤êÊÖ¤¹¤³¤È¤Ç¡¢ +¤³¤Î¥ê¥ó¥¯¥ê¥¹¥È¤ÏºÆÀ¸À®¤µ¤ì¤ë¡£ +.PP +.\"O As a special case, if +.\"O .BR fts_read () +.\"O has not yet been called for a hierarchy, +.\"O .BR fts_children () +.\"O will return a pointer to the files in the logical directory specified to +.\"O .BR fts_open (), +.\"O that is, the arguments specified to +.\"O .BR fts_open (). +.\"O Otherwise, if the +.\"O .I FTSENT +.\"O structure most recently returned by +.\"O .BR fts_read () +.\"O is not a directory being visited in preorder, +.\"O or the directory does not contain any files, +.\"O .BR fts_children () +.\"O returns +.\"O .B NULL +.\"O and sets +.\"O .I errno +.\"O to zero. +.\"O If an error occurs, +.\"O .BR fts_children () +.\"O returns +.\"O .B NULL +.\"O and sets +.\"O .I errno +.\"O appropriately. +ÆÃÊ̤ʾì¹ç¤È¤·¤Æ¡¢ +.BR fts_read () +¤¬¥Õ¥¡¥¤¥ë³¬ÁؤˤĤ¤¤Æ¸Æ¤Ð¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.BR fts_children () +¤Ï +.BR fts_open () +¤Ë»ØÄꤵ¤ì¤¿ÏÀÍý¥Ç¥£¥ì¥¯¥È¥ê (¤Ä¤Þ¤ê¡¢ +.BR fts_open () +¤Ë»ØÄꤵ¤ì¤¿°ú¤­¿ô) ¤ÎÃæ¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ç¡¢ +.BR fts_read () +¤Ë¤è¤Ã¤ÆºÇ¤â¿·¤·¤¯ÊÖ¤µ¤ì¤¿ +.I FTSENT +¹½Â¤ÂΤ¬ preorder ¤Ç¤¿¤É¤é¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¾ì¹ç¤ä +²¿¤â´Þ¤ó¤Ç¤¤¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¤Ï¡¢ +.BR fts_children () +¤Ï +.B NULL +¤òÊÖ¤·¡¢ +.I errno +¤ò 0 ¤Ë¤¹¤ë¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.BR fts_children () +¤Ï +.B NULL +¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ËÂбþ¤·¤¿Ãͤˤ¹¤ë¡£ +.PP +.\"O The +.\"O .I FTSENT +.\"O structures returned by +.\"O .BR fts_children () +.\"O may be overwritten after a call to +.\"O .BR fts_children (), +.\"O .BR fts_close () +.\"O or +.\"O .BR fts_read () +.\"O on the same file hierarchy stream. +.BR fts_children () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë +.I FTSENT +¹½Â¤ÂΤϡ¢Æ±¤¸¥Õ¥¡¥¤¥ë³¬ÁØ¥¹¥È¥ê¡¼¥à¤Ø¤Î +.BR fts_children (), +.BR fts_close (), +.BR fts_read () +¤Î¸Æ½Ð¤·¤Î¸å¤Ë¾å½ñ¤­¤µ¤ì¤ë¾ì¹ç¤¬¤¢¤ë¡£ +.PP +.\"O .I Option +.\"O may be set to the following value: +.I option +¤Ï¡¢¼¡¤ÎÃͤËÀßÄê¤Ç¤­¤ë¡£ +.\" .Bl -tag -width FTS_NAMEONLY +.TP +.B FTS_NAMEONLY +.\"O Only the names of the files are needed. +.\"O The contents of all the fields in the returned linked list of structures +.\"O are undefined with the exception of the +.\"O .I fts_name +.\"O and +.\"O .I fts_namelen +.\"O fields. +¥Õ¥¡¥¤¥ë̾¤Î¤ß¤¬É¬ÍפȤµ¤ì¤Æ¤¤¤ë¡£ +ÊÖ¤µ¤ì¤¿¹½Â¤ÂΤΥê¥ó¥¯¥ê¥¹¥È¤Î +.IR fts_name , +.I fts_namelen +¥Õ¥£¡¼¥ë¥É°Ê³°¤Î +¤¹¤Ù¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤ÎÆâÍƤÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ +.\" .El +.SS fts_set() +.\"O The function +.\"O .BR fts_set () +.\"O allows the user application to determine further processing for the +.\"O file +.\"O .I f +.\"O of the stream +.\"O .IR ftsp . +.\"O The +.\"O .BR fts_set () +.\"O function +.\"O returns 0 on success, and \-1 if an error occurs. +.\"O .I Option +.\"O must be set to one of the following values: +´Ø¿ô +.BR fts_set () +¤Ï¡¢¥æ¡¼¥¶¡¼¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ +¥¹¥È¥ê¡¼¥à +.I ftsp +¤Î¥Õ¥¡¥¤¥ë +.I f +¤Ë¤Ä¤¤¤Æ¹¹¤Ê¤ë½èÍý¤ò·èÄꤹ¤ë¤³¤Èµö¤¹¡£ +.BR fts_set () +´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤ò¡¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.I option +¤Ï¡¢¼¡¤ÎÃͤΤ¤¤º¤ì¤« 1 ¤Ä¤ËÀßÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" .Bl -tag -width FTS_PHYSICAL +.TP +.B FTS_AGAIN +.\"O Re-visit the file; any file type may be revisited. +.\"O The next call to +.\"O .BR fts_read () +.\"O will return the referenced file. +.\"O The +.\"O .I fts_stat +.\"O and +.\"O .I fts_info +.\"O fields of the structure will be reinitialized at that time, +.\"O but no other fields will have been changed. +.\"O This option is meaningful only for the most recently returned +.\"O file from +.\"O .BR fts_read (). +.\"O Normal use is for postorder directory visits, where it causes the +.\"O directory to be revisited (in both preorder and postorder) as well as all +.\"O of its descendants. +¥Õ¥¡¥¤¥ë¤òºÆ¤Ó¤¿¤É¤ë¡£¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤¬ºÆ¤Ó¤¿¤É¤é¤ì¤ë¡£ +¼¡¤Î +.BR fts_read () +¤Î¸Æ½Ð¤·¤Ë¤è¤ê¡¢»²¾È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬ÊÖ¤µ¤ì¤ë¡£ +¹½Â¤ÂΤΠ+.IR fts_stat , +.I fts_info +¥Õ¥£¡¼¥ë¥É¤Ï¤³¤Î»þ¤Ë½é´ü²½¤µ¤ì¤ë¤¬¡¢Â¾¤Î¥Õ¥£¡¼¥ë¥É¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.BR fts_read () +¤Ë¤è¤Ã¤ÆºÇ¤â¿·¤·¤¯ÊÖ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +Ä̾ï¤Ï¡¢postorder ¤Ç¥Ç¥£¥ì¥¯¥È¥ê¤ò¤¿¤É¤ë¾ì¹ç¤Ë»ÈÍѤ·¡¢ +¤½¤Î²¼¤Î³¬ÁؤÈƱÍͤˡ¢ +¥Ç¥£¥ì¥¯¥È¥ê¤ò (preorder ¤È postorder ¤ÎξÊý¤Ç) ºÆ¤Ó¤¿¤É¤é¤»¤ë¡£ +.TP +.B FTS_FOLLOW +.\"O The referenced file must be a symbolic link. +.\"O If the referenced file is the one most recently returned by +.\"O .BR fts_read (), +.\"O the next call to + +.\"O .BR fts_read () +.\"O returns the file with the +.\"O .I fts_info +.\"O and +.\"O .I fts_statp +.\"O fields reinitialized to reflect the target of the symbolic link instead +.\"O of the symbolic link itself. +.\"O If the file is one of those most recently returned by +.\"O .BR fts_children (), +.\"O the +.\"O .I fts_info +.\"O and +.\"O .I fts_statp +.\"O fields of the structure, when returned by +.\"O .BR fts_read (), +.\"O will reflect the target of the symbolic link instead of the symbolic link +.\"O itself. +.\"O In either case, if the target of the symbolic link does not exist the +.\"O fields of the returned structure will be unchanged and the +.\"O .I fts_info +.\"O field will be set to +.\"O .BR FTS_SLNONE . +.\"O .PP +.\"O If the target of the link is a directory, the preorder return, followed +.\"O by the return of all of its descendants, followed by a postorder return, +.\"O is done. +»²¾È¤µ¤ì¤Æ¤ë¥Õ¥¡¥¤¥ë¤Ï¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +»²¾È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬ +.BR fts_read () +¤Ë¤è¤Ã¤ÆºÇ¤â¿·¤·¤¯ÊÖ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¾ì¹ç¡¢¼¡¤Î +.BR fts_read () +¤Î¸Æ½Ð¤·¤Ç¤Ï¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤½¤Î¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬»Ø¤·¤Æ¤¤¤ëÀè¤òÈ¿±Ç¤¹¤ë¤è¤¦¤Ë +.IR fts_info , +.I fts_statp +¤òºÆ¤Ó½é´ü²½¤·¤¿¥Õ¥¡¥¤¥ë¤¬ÊÖ¤µ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬ +.BR fts_children () +¤Ë¤è¤Ã¤ÆºÇ¤â¿·¤·¤¯ÊÖ¤µ¤ì¤¿¤â¤Î¤Î 1 ¤Ä¤Ç¤¢¤ë¾ì¹ç¡¢ +.BR fts_read () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤¿¤È¤­¡¢¹½Â¤ÂΤΠ+.IR fts_info , +.I fts_statp +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤½¤Î¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬»Ø¤·¤Æ¤¤¤ëÀè¤òÈ¿±Ç¤¹¤ë¡£ +¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬»Ø¤·¤Æ¤¤¤ëÀ褬¤Ê¤¤¤È¤­¤Ï¡¢ +ÊÖ¤µ¤ì¤¿¹½Â¤ÂΤΥե£¡¼¥ë¥É¤ÏÊѹ¹¤µ¤ì¤º¡¢ +.I fts_info +¥Õ¥£¡¼¥ë¥É¤¬ +.B FTS_SLNONE +¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O If the target of the link is a directory, the preorder return, followed +.\"O by the return of all of its descendants, followed by a postorder return, +.\"O is done. +¥ê¥ó¥¯À褬¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¤¬ preorder ¤ÇÊÖ¤µ¤ì¤¿¸å¡¢²¼¤Î³¬ÁؤΤ¹¤Ù¤Æ¥Õ¥¡¥¤¥ë¤¬ÊÖ¤µ¤ì¡¢ +¤½¤Î¸å¤Ç postorder ¤ÇÊÖ¤µ¤ì¤ë¡£ +.TP +.B FTS_SKIP +.\"O No descendants of this file are visited. +.\"O The file may be one of those most recently returned by either +.\"O .BR fts_children () +.\"O or +.\"O .BR fts_read (). +¤³¤Î¥Õ¥¡¥¤¥ë¤Î²¼¤Î³¬ÁؤϤ¿¤É¤é¤ì¤Ê¤¤¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢ +.BR fts_children () +¤Þ¤¿¤Ï +.BR fts_read () +¤Î¤É¤Á¤é¤«¤Ë¤è¤Ã¤ÆºÇ¤â¿·¤·¤¯ÊÖ¤µ¤ì¤¿¤â¤Î¤Î 1 ¤Ä¤Ç¤¢¤ë¡£ +.\" .El +.SS fts_close() +.\"O The +.\"O .BR fts_close () +.\"O function closes a file hierarchy stream +.\"O .I ftsp +.\"O and restores the current directory to the directory from which +.\"O .BR fts_open () +.\"O was called to open +.\"O .IR ftsp . +.\"O The +.\"O .BR fts_close () +.\"O function +.\"O returns 0 on success, and \-1 if an error occurs. +.BR fts_close () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë³¬ÁØ¥¹¥È¥ê¡¼¥à +.I ftsp +¤òÊĤ¸¤ë¡£¤½¤·¤Æ¡¢¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò +.I ftsp +¤ò³«¤¯¤¿¤á¤Ë +.BR fts_open () +¤¬¸Æ¤Ð¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÉü¸µ¤¹¤ë¡£ +.BR fts_close () +´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤ò¡¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.\"O .SS ERRORS +.SS ¥¨¥é¡¼ +.\"O The function +.\"O .BR fts_open () +.\"O may fail and set +.\"O .I errno +.\"O for any of the errors specified for the library functions +.\"O .BR open (2) +.\"O and +.\"O .BR malloc (3). +´Ø¿ô +.BR fts_open () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ï¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô +.BR open (2) +¤È +.BR malloc (3) +¤ËÂФ·¤Æ»ØÄꤵ¤ì¤ë¥¨¥é¡¼¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O The function +.\"O .BR fts_close () +.\"O may fail and set +.\"O .I errno +.\"O for any of the errors specified for the library functions +.\"O .BR chdir (2) +.\"O and +.\"O .BR close (2). +´Ø¿ô +.BR fts_close () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ï¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô +.BR chdir (2) +¤È +.BR close (2) +¤ËÂФ·¤Æ»ØÄꤵ¤ì¤ë¥¨¥é¡¼¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O The functions +.\"O .BR fts_read () +.\"O and +.\"O .BR fts_children () +.\"O may fail and set +.\"O .I errno +.\"O for any of the errors specified for the library functions +.\"O .BR chdir (2), +.\"O .BR malloc (3), +.\"O .BR opendir (3), +.\"O .BR readdir (3) +.\"O and +.\"O .BR stat (2). +´Ø¿ô +.BR fts_read () +¤È +.BR fts_children () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ï¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô +.BR chdir (2), +.BR malloc (3), +.BR opendir (3), +.BR readdir (3), +.BR stat (2) +¤ËÂФ·¤Æ»ØÄꤵ¤ì¤ë¥¨¥é¡¼¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O In addition, +.\"O .BR fts_children (), +.\"O .BR fts_open () +.\"O and +.\"O .BR fts_set () +.\"O may fail and set +.\"O .I errno +.\"O as follows: +¹¹¤Ë¡¢ +.BR fts_children (), +.BR fts_open (), +.BR fts_set () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤¬¼¡¤ÎÃͤˤµ¤ì¤ë¡£ +.TP +.B EINVAL +.\"O The options were invalid. +¥ª¥×¥·¥ç¥ó¤¬Ìµ¸ú¤Ç¤¢¤Ã¤¿¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions are available in Linux since glibc2. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢Linux ¤Ç¤Ï glibc2 ¤«¤é»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O SH "CONFORMING TO" +.SH ½àµò +4.4BSD. +.\" The following statement is years old, and seems no closer to +.\" being true -- mtk +.\"O .\" The +.\"O .\" .I fts +.\"O .\" utility is expected to be included in a future +.\"O .\" POSIX.1 +.\"O .\" revision. +.\" .I fts +.\" ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ï¡¢¾­Íè¤Î +.\" POSIX.1 +.\" ¥ê¥Ó¥¸¥ç¥ó¤Ë´Þ¤Þ¤ì¤ë¤È´üÂÔ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR find (1), +.BR chdir (2), +.BR stat (2), +.BR ftw (3), +.BR qsort (3) diff --git a/draft/man3/ftw.3 b/draft/man3/ftw.3 new file mode 100644 index 00000000..59af2f98 --- /dev/null +++ b/draft/man3/ftw.3 @@ -0,0 +1,686 @@ +.\" Copyright (c) 1993 Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de) +.\" and copyright (c) 1999 Andries Brouwer (aeb@cwi.nl) +.\" and copyright (c) 2006 Justin Pryzby +.\" and copyright (c) 2006 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., 675 Mass Ave, Cambridge, MA 02139, +.\" USA. +.\" +.\" Modified Sun Jul 25 11:02:22 1993 by Rik Faith (faith@cs.unc.edu) +.\" 2006-05-24, Justin Pryzby +.\" document FTW_ACTIONRETVAL; include .SH "RETURN VALUE"; +.\" 2006-05-24, Justin Pryzby and +.\" Michael Kerrisk +.\" reorganized and rewrote much of the page +.\" 2006-05-24, Michael Kerrisk +.\" Added an example program. +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-04-28, NAKANO Takeo +.\" Updated & Modified 1999-09-14, NAKANO Takeo +.\" Updated & Modified 2005-11-04, Akihiro MOTOKI +.\" Updated 2006-07-26, Akihiro MOTOKI , LDP v2.36 +.\" +.\" WORD: file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\" +.TH FTW 3 2008-08-06 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ftw, nftw \- file tree walk +ftw, nftw \- ¥Õ¥¡¥¤¥ë¥Ä¥ê¡¼¤òÊ⤭¤Þ¤ï¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int ftw(const char *" dirpath , +.BI " int (*" fn ") (const char *" fpath ", const struct stat *" sb , +.BI " int " typeflag ), +.BI " int " nopenfd ); +.sp +.B #define _XOPEN_SOURCE 500 +.B #include +.sp +.BI "int nftw(const char *" dirpath , +.BI " int (*" fn ") (const char *" fpath ", const struct stat *" sb , +.BI " int " typeflag ", struct FTW *" ftwbuf ), +.BI " int " nopenfd ", int " flags ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR ftw () +.\"O walks through the directory tree that is +.\"O located under the directory \fIdirpath\fP, +.\"O and calls \fIfn\fP() once for each entry in the tree. +.\"O By default, directories are handled before the files and +.\"O subdirectories they contain (preorder traversal). +.BR ftw () +¤Ï¡¢ +.I dirpath +¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼Á´ÂΤòÊ⤭¤Þ¤ï¤ê¡¢ +¥Ä¥ê¡¼Ãæ¤Ç¥¨¥ó¥È¥ê¤¬¸«ÉÕ¤«¤ë¤´¤È¤Ë¡¢ +.IR fn () +¤ò¸Æ¤Ó½Ð¤¹¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤½¤Î¤â¤Î¤¬¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤ä +¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤è¤ê¤âÀè¤Ë½èÍý¤µ¤ì¤ë (¹Ô¤­¤¬¤±½çõº÷; preorder traversal)¡£ + +.\"O To avoid using up all of the calling process's file descriptors, +.\"O \fInopenfd\fP specifies the maximum number of directories that +.\"O .BR ftw () +.\"O will hold open simultaneously. +.\"O When +.\"O the search depth exceeds this, +.\"O .BR ftw () +.\"O will become slower because +.\"O directories have to be closed and reopened. +.\"O .BR ftw () +.\"O uses at most +.\"O one file descriptor for each level in the directory tree. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»È¤¤ÀÚ¤Ã¤Æ +¤·¤Þ¤ï¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤¿¤á¡¢ +.BR ftw () +¤¬Æ±»þ¤Ë¥ª¡¼¥×¥ó¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÎºÇÂç¿ô¤ò +.I nopenfd +¤Ç»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +õº÷¤Î¿¼¤µ¤¬¤³¤ÎÃͤò±Û¤¨¤ë¤È¡¢ +°ì¤Ä¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òÊĤ¸¤Æ¤«¤é¾¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¥ª¡¼¥×¥ó¤·Ä¾¤¹¤³¤È +¤Ë¤Ê¤ë¤Î¤Ç¡¢ +.BR ftw () +¤ÎÆ°ºî¤ÏÃÙ¤¯¤Ê¤ë¡£ +.BR ftw () +¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤Î³¬ÁØ 1 ¥ì¥Ù¥ë¤Ë¤Ä¤­¡¢ +ºÇÂç¤Ç¤â°ì¤Ä¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤·¤«»ÈÍѤ·¤Ê¤¤¡£ + +.\"O For each entry found in the tree, +.\"O .BR ftw () +.\"O calls +.\"O \fIfn\fP() with three arguments: +.\"O .IR fpath , +.\"O .IR sb , +.\"O and +.\"O .IR typeflag . +¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤Ç¸«¤Ä¤«¤Ã¤¿¥¨¥ó¥È¥êËè¤Ë¡¢ +.BR ftw () +¤Ï +.IR fpath , +.IR sb , +.I typeflag +¤Î 3¤Ä¤ò°ú¤­¿ô¤È¤·¤Æ +.IR fn () +¤ò¸Æ¤Ó½Ð¤¹¡£ +.\"O .I fpath +.\"O is the pathname of the entry relative to +.\"O .IR dirpath . +.I fpath +¤Ï¥¨¥ó¥È¥ê¤Î +.I dirpath +¤«¤é¤ÎÁêÂХѥ¹Ì¾¤Ç¤¢¤ë¡£ +.\"O .I sb +.\"O is a pointer to the +.\"O .I stat +.\"O structure returned by a call to +.\"O .BR stat (2) +.\"O for +.\"O .IR fpath . +.I sb +¤Ï +.I fpath +¤ËÂФ¹¤ë +.BR stat (2) +¤Î¸Æ¤Ó½Ð¤·¤ÇÊÖ¤µ¤ì¤ë +.I stat +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +.\"O .I typeflag +.\"O is an integer that has one of the following values: +.I typeflag +¤ÏÀ°¿ô¤Ç¡¢°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤Ç¤¢¤ë: +.TP +.B FTW_F +.\"O .I fpath +.\"O is a regular file. +.I fpath +¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë +.TP +.B FTW_D +.\"O .I fpath +.\"O is a directory. +.I fpath +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë +.TP +.B FTW_DNR +.\"O .I fpath +.\"O is a directory which can't be read. +.I fpath +¤¬Æɤ߹þ¤ß¤Ç¤­¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë +.TP +.B FTW_NS +.\"O The +.\"O .BR stat (2) +.\"O call failed on +.\"O .IR fpath , +.\"O which is not a symbolic link. +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤Ï¤Ê¤¤ +.I fpath +¤ËÂФ¹¤ë +.BR stat (2) +¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤·¤¿¡£ +.sp +.\"O If +.\"O .I fpath +.\"O is a symbolic link and +.\"O .BR stat (2) +.\"O failed, POSIX.1-2001 states +.\"O that it is undefined whether \fBFTW_NS\fP or \fBFTW_SL\fP (see below) +.\"O is passed in +.\"O .IR typeflag . +.I fpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¡¢¤«¤Ä +.BR stat (2) +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.B FTW_NS +¤È +.B FTW_SL +(¸å½Ò) ¤Î¤É¤Á¤é¤¬ +.I typeflag +¤ËÅϤµ¤ì¤ë¤«¤Ï̤ÄêµÁ¤Ç¤¢¤ë¤È¡¢POSIX.1-2001 ¤Ë¤Ï½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O To stop the tree walk, \fIfn\fP() returns a nonzero value; this +.\"O value will become the return value of +.\"O .BR ftw (). +.\"O As long as \fIfn\fP() returns 0, +.\"O .BR ftw () +.\"O will continue either until it has traversed the entire tree, +.\"O in which case it will return zero, +.\"O or until it encounters an error (such as a +.\"O .BR malloc (3) +.\"O failure), in which case it will return \-1. +¥Ä¥ê¡¼¤Îõº÷¤ò»ß¤á¤¿¤¤¾ì¹ç¤Ï¡¢ +.IR fn () +¤¬ 0 °Ê³°¤ÎÃͤòÊÖ¤»¤ÐÎɤ¤ +(¤³¤ÎÃÍ¤Ï +.BR ftw () +¼«¿È¤ÎÌá¤êÃͤȤʤë)¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï +.BR ftw () +¤Ï¥Ä¥ê¡¼Á´ÂΤÎõº÷¤ò³¤±¡¢¤¹¤Ù¤Æ¤Î¥Ä¥ê¡¼¤òõº÷¤·½ª¤¨¤¿¤È¤³¤í¤Ç +0 ¤òÊÖ¤¹¡£Ãµº÷Ãæ¤Ë +.RB ( malloc (3) +¤Î¼ºÇԤʤɤÎ) ¥¨¥é¡¼¤¬µ¯¤³¤ë¤È \-1 ¤òÊÖ¤¹¡£ +.PP +.\"O Because +.\"O .BR ftw () +.\"O uses dynamic data structures, the only safe way to +.\"O exit out of a tree walk is to return a nonzero value from \fIfn\fP(). +.\"O To allow a signal to terminate the walk without causing a memory leak, +.\"O have the handler set a global flag that is checked by \fIfn\fP(). +.\"O \fIDon't\fP use +.\"O .BR longjmp (3) +.\"O unless the program is going to terminate. +.BR ftw () +¤ÏưŪ¤Ê¥Ç¡¼¥¿¹½Â¤¤òÍѤ¤¤ë¤Î¤Ç¡¢¥Ä¥ê¡¼Ãµº÷¤ò°ÂÁ´¤ËÃæÃǤ¹¤ëÍ£°ì¤ÎÊýË¡¤Ï +0 °Ê³°¤ÎÃͤò +.IR fn () +¤ÎÊÖ¤êÃͤȤ¹¤ë¤³¤È¤Ç¤¢¤ë¡£³ä¤ê¹þ¤ß¤ò°·¤¦¤Ë¤Ï¡¢ +Î㤨¤ÐȯÀ¸¤·¤¿³ä¤ê¹þ¤ß¤ò¥Þ¡¼¥¯¤·¤Æ¤ª¤¤¤Æ¡¢ 0 °Ê³°¤ÎÃͤòÊÖ¤¹¤è¤¦¤Ë¤¹¤ë +¥·¥°¥Ê¥ë¤Ë¤è¤ê¥á¥â¥ê¥ê¡¼¥¯¤òµ¯¤³¤µ¤º¤Ëõº÷¤ò½ªÎ»¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ç +.IR fn () +¤¬¥Á¥§¥Ã¥¯¤¹¤ë¥°¥í¡¼¥Ð¥ë¤Ê¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤è¤¦¤Ë¤¹¤ì¤Ð¤è¤¤¡£ +¥×¥í¥°¥é¥à¤ò½ªÎ»¤µ¤»¤ë¾ì¹ç°Ê³°¤Ï¡¢ +.BR longjmp (3) +¤ò»ÈÍѤ·¤Ê¤¤¤³¤È¡£ +.SS nftw() +.\"O The function \fBnftw\fP() is the same as +.\"O .BR ftw (), +.\"O except that it has one additional argument, \fIflags\fP, +.\"O and calls \fIfn\fP() with one more argument, \fIftwbuf\fP. +´Ø¿ô +.BR nftw () +¤Ï +.BR ftw () +¤ÈƱ¤¸¤À¤¬¡¢°ú¤­¿ô +.I flags +¤¬Äɲ䵤ì¤ëÅÀ¤È¡¢ +.IR fn () +¤Î°ú¤­¿ô¤Ë +.I ftwbuf +¤¬Äɲ䵤ì¤ëÅÀ¤¬°Û¤Ê¤ë¡£ + +.\"O This \fIflags\fP argument is formed by ORing zero or more of the +.\"O following flags: +¤³¤Î +.I flags +°ú¤­¿ô¤Ï²¼µ­¤Î¥Õ¥é¥°¤Î 0 ¸Ä°Ê¾å¤ÎÏÀÍýϤò¼è¤Ã¤¿¤â¤Î¤Ç¤¢¤ë: +.TP +.\"O .BR FTW_ACTIONRETVAL " (since glibc 2.3.3)" +.BR FTW_ACTIONRETVAL " (glibc 2.3.3 °Ê¹ß)" +.\"O If this glibc-specific flag is set, then +.\"O .BR nftw () +.\"O handles the return value from +.\"O .IR fn () +.\"O differently. +.\"O .IR fn () +.\"O should return one of the following values: +¤³¤Î¥Õ¥é¥°¤Ï glibc ¸ÇÍ­¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢ +.BR nftw () +¤Î +.IR fn () +¤ÎÊÖ¤êÃͤΰ·¤¤¤¬ÊѤï¤ë¡£ +.IR fn () +¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤òÊÖ¤¹É¬Íפ¬¤¢¤ë¡£ +.RS +.TP +.B FTW_CONTINUE +.\"O Instructs +.\"O .BR nftw () +.\"O to continue normally. +.BR nftw () +¤ÏÄ̾ïÄ̤ê½èÍý¤ò³¤±¤ë¡£ +.TP +.B FTW_SKIP_SIBLINGS +.\"O If \fIfn\fP() returns this value, then +.\"O siblings of the current entry will be skipped, +.\"O and processing continues in the parent. +.IR fn () +¤¬¤³¤ÎÃͤòÊÖ¤·¤¿¾ì¹ç¡¢½èÍýÃæ¤Î¥¨¥ó¥È¥ê¤Î·»Äï (Ʊ¤¸³¬ÁؤΥ¨¥ó¥È¥ê) +¤Î½èÍý¤Ï¥¹¥­¥Ã¥×¤µ¤ì¡¢¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ç³¤­¤Î½èÍý¤¬¹Ô¤ï¤ì¤ë¡£ +.\" If \fBFTW_DEPTH\fP +.\" is set, the entry's parent directory is processed next (with +.\" \fIflag\fP set to \fBFTW_DP\fP). +.TP +.B FTW_SKIP_SUBTREE +.\"O If \fIfn\fP() is called with an entry that is a directory +.\"O (\fItypeflag\fP is \fBFTW_D\fP), this return +.\"O value will prevent objects within that directory from being passed as +.\"O arguments to \fIfn\fP(). +.\"O .BR nftw () +.\"O continues processing with the next sibling of the directory. +.IR fn () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¥¨¥ó¥È¥ê¤¬¥Ç¥£¥ì¥¯¥È¥ê +.RI ( typeflag +¤¬ +.BR FTW_D ) +¤Î¾ì¹ç¤Ë¡¢¤³¤ÎÃͤòÊÖ¤¹¤È +.IR fn () +¤Î°ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥¨¥ó¥È¥ê¤Î½èÍý¤¬¹Ô¤ï¤ì¤Ê¤¯¤Ê¤ë¡£ +.BR nftw () +¤Ï½èÍýÃæ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î·»Äï (Ʊ¤¸³¬ÁؤΥ¨¥ó¥È¥ê) ¤«¤é½èÍý¤ò³¤±¤ë¡£ +.TP +.B FTW_STOP +.\"O Causes +.\"O .BR nftw () +.\"O to return immediately with the return value +.\"O \fBFTW_STOP\fP. +.B nftw () +¤Ï¡¢ÊÖ¤êÃÍ +.B FTW_STOP +¤Ç¤¹¤°¤ËÉüµ¢¤¹¤ë¡£ +.PP +.\"O Other return values could be associated with new actions in the future; +.\"O \fIfn\fP() should not return values other than those listed above. +¾¤ÎÊÖ¤êÃͤϾ­Íè¿·¤·¤¤Æ°ºî¤ËÂбþÉÕ¤±¤é¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.IR fn () +¤Ï¾åµ­¤Î¥ê¥¹¥È¤Ë¤¢¤ëÃͰʳ°¤òÊÖ¤µ¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O The feature test macro +.\"O .B _GNU_SOURCE +.\"O must be defined in order to +.\"O obtain the definition of \fBFTW_ACTIONRETVAL\fP from \fI\fP. +.I +¤Ç +.B FTW_ACTIONRETVAL +¤¬ÄêµÁ¤µ¤ì¤ë¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¡¢ +µ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _GNU_SOURCE +¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.RE +.TP +.B FTW_CHDIR +.\"O If set, do a +.\"O .BR chdir (2) +.\"O to each directory before handling its contents. +.\"O This is useful if the program needs to perform some action +.\"O in the directory in which \fIfpath\fP resides. +¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍƤò½èÍý¤¹¤ëÁ°¤Ë +¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë +.BR chdir (2) +¤¹¤ë¡£¤³¤Î¥Õ¥é¥°¤Ï¡¢ +.I fpath +¤¬Â°¤¹¥Ç¥£¥ì¥¯¥È¥ê¤Ç²¿¤é¤«¤ÎÆ°ºî¤ò¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ë +ÊØÍø¤Ç¤¢¤ë¡£ +.TP +.B FTW_DEPTH +.\"O If set, do a post-order traversal, that is, call \fIfn\fP() for +.\"O the directory itself \fIafter\fP handling the contents of the directory +.\"O and its subdirectories. +.\"O (By default, each directory is handled \fIbefore\fP its contents.) +¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢µ¢¤ê¤¬¤±½çõº÷ (post-order traversal) ¤ò¹Ô¤¦¡£ +¤Ä¤Þ¤ê¡¢¥Ç¥£¥ì¥¯¥È¥ê¤½¤Î¤â¤Î¤ò°ú¤­¿ô¤È¤·¤¿ +.IR fn () +¸Æ½Ð¤·¤Ï¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤È¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë +ÂФ¹¤ë½èÍý¤Î¡Ö¸å¤Ç¡×¹Ô¤ï¤ì¤ë +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¼«¿È¤Î½èÍý¤Ï¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥¨¥ó¥È¥ê +¤è¤ê¡ÖÁ°¤Ë¡×¹Ô¤Ê¤ï¤ì¤ë)¡£ +.TP +.B FTW_MOUNT +.\"O If set, stay within the same file system +.\"O (i.e., do not cross mount points). +¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÃæ¤À¤±¤òõº÷ÂоݤȤ¹¤ë +(¤Ä¤Þ¤ê¡¢¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò¤Þ¤¿¤°¤³¤È¤Ï¤Ê¤¤)¡£ +.TP +.B FTW_PHYS +.\"O If set, do not follow symbolic links. +.\"O (This is what you want.) +.\"O If not set, symbolic links are followed, but no file is reported twice. +¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òé¤é¤Ê¤¤ (¤ª¤½¤é¤¯¤³¤Á¤é¤¬ +Ä̾ï˾¤Þ¤·¤¤Æ°ºî¤À¤í¤¦)¡£¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò +é¤ë¤¬¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¤¬Æó²óÊó¹ð¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.sp +.\"O If \fBFTW_PHYS\fP is not set, but \fBFTW_DEPTH\fP is set, +.\"O then the function +.\"O .IR fn () +.\"O is never called for a directory that would be a descendant of itself. +.B FTW_PHYS +¤¬¥»¥Ã¥È¤µ¤ì¤º¤Ë +.B FTW_DEPTH +¤¬¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢¼«Ê¬¼«¿È¤ËÂФ¹¤ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òÇÛ²¼¤Ë»ý¤Ä +¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ +.IR fn () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£ +.LP +.\"O For each entry in the directory tree, +.\"O .BR nftw () +.\"O calls +.\"O .IR fn () +.\"O with four arguments. +.\"O .I fpath +.\"O and +.\"O .I sb +.\"O are as for +.\"O .BR ftw (). +.\"O .I typeflag +.\"O may receive any of the same values as with +.\"O .BR ftw (), +.\"O or any of the following values: +¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤Î¥¨¥ó¥È¥êËè¤Ë¡¢ +.BR nftw () +¤Ï 4¤Ä¤Î°ú¤­¿ô¤Ç +.IR fn () +¤ò¸Æ¤Ó½Ð¤¹¡£ +.I fpath +¤È +.I sb +¤Ï +.BR ftw () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.I typeflag +¤Ë¤Ï¡¢ +.BR ftw () +¤Ç¼è¤êÆÀ¤ëÃͤΤ¤¤º¤ì¤«¡¢¤Þ¤¿¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤¬ÅϤµ¤ì¤ë: +.TP +.B FTW_DP +.\"O .I fpath +.\"O is a directory, and \fBFTW_DEPTH\fP was specified in \fIflags\fP. +.\"O All of the files +.\"O and subdirectories within \fIfpath\fP have been processed. +.I fpath +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¡¢¤«¤Ä +.I flags +¤Ç +.B FTW_DEPTH +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¡£ +.I fpath +ÇÛ²¼¤Î¥Õ¥¡¥¤¥ë¤È¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ÏÁ´¤Æ½èÍý¤¬½ª¤ï¤Ã¤Æ¤¤¤ë¡£ +.TP +.B FTW_SL +.\"O .I fpath +.\"O is a symbolic link, and \fBFTW_PHYS\fP was set in \fIflags\fP. +.I fpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¡¢¤«¤Ä \fBFTW_PHYS\fP ¤¬ \fIflags\fP ¤Ë +¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¡£ +.\" To obtain the definition of this constant from +.\" .IR , +.\" either +.\" .B _BSD_SOURCE +.\" must be defined, or +.\" .BR _XOPEN_SOURCE +.\" must be defined with a value of 500 or more. +.TP +.B FTW_SLN +.\"O .I fpath +.\"O is a symbolic link pointing to a nonexistent file. +.\"O (This occurs only if \fBFTW_PHYS\fP is not set.) +.I fpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¡¢Â¸ºß¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë +(¤³¤ì¤¬¥»¥Ã¥È¤µ¤ì¤ë¤Î¤Ï +.B FTW_PHYS +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤À¤±¤Ç¤¢¤ë)¡£ +.LP +.\"O The fourth argument that +.\"O .BR nftw () +.\"O supplies when calling +.\"O \fIfn\fP() +.\"O is a structure of type \fIFTW\fP: +.BR nftw () +¤¬ +.IR fn () +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤ËÅϤ¹ 4¤Ä¤á¤Î°ú¤­¿ô¤Ï +.I FTW +·¿¤Î¹½Â¤ÂΤǤ¢¤ë¡£ +.in +4n +.nf + +struct FTW { + int base; + int level; +}; + +.fi +.in +.\"O .I base +.\"O is the offset of the filename (i.e., basename component) +.\"O in the pathname given in +.\"O .IR fpath . +.\"O .I level +.\"O is the depth of +.\"O .I fpath +.\"O in the directory tree, relative to the root of the tree +.\"O .RI ( dirpath , +.\"O which has depth 0). +.I base +¤Ï¡¢¥Õ¥¡¥¤¥ë̾ (basename Í×ÁÇ) ¤Î¡¢ +.I fpath +¤ÇÅϤµ¤ì¤ë¥Ñ¥¹Ì¾¤ÎÃæ¤Ç¤Î¥ª¥Õ¥»¥Ã¥È¤Ç¤¢¤ë¡£ +.I level +¤Ï¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤Ç¤Î +.I fpath +¤Î¿¼¤µ¤ò¼¨¤¹¡£¿¼¤µ¤Ï¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤Î¥È¥Ã¥× (root) ¤«¤é¤Î +ÁêÂÐÃͤǤ¢¤ë +.RI ( dirpath +¤Ï¿¼¤µ 0 ¤Ç¤¢¤ë)¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O These functions return 0 on success, and \-1 if an error occurs. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤ò¡¢¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È \-1 ¤òÊÖ¤¹¡£ + +.\"O If \fIfn\fP() returns nonzero, +.\"O then the tree walk is terminated and the value returned by \fIfn\fP() +.\"O is returned as the result of \fBftw\fP() or +.\"O .BR nftw (). +.IR fn () +¤¬ 0 °Ê³°¤òÊÖ¤·¤¿¾ì¹ç¡¢¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤Îõº÷¤ò½ªÎ»¤·¡¢ +.IR fn () +¤¬ÊÖ¤·¤¿Ãͤò +.BR ftw () +¤ä +.BR nftw () +¤Î·ë²Ì¤È¤·¤ÆÊÖ¤¹¡£ + +.\"O If +.\"O .BR nftw () +.\"O is called with the \fBFTW_ACTIONRETVAL\fP flag, +.\"O then the only nonzero value that should be used by \fIfn\fP() +.\"O to terminate the tree walk is \fBFTW_STOP\fP, +.\"O and that value is returned as the result of +.\"O .BR nftw (). +.BR nftw () +¤¬ +.B FTW_ACTIONRETVAL +¥Õ¥é¥°ÉÕ¤­¤Ç¸Æ¤Ð¤ì¤¿¾ì¹ç¡¢¥Ä¥ê¡¼¤Îõº÷¤ò½ªÎ»¤µ¤»¤ë¤¿¤á¤Ë +.IR fn () +¤¬»ÈÍѤǤ­¤ë¡¢Èó 0 ¤ÎÃÍ¤Ï +.B FTW_STOP +¤À¤±¤Ç¤¢¤ê¡¢ +¤³¤ÎÃÍ¤Ï +.BR nftw () +¤ÎÊÖ¤êÃͤȤ·¤ÆÊÖ¤µ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001, SVr4, SUSv1. +.\"O POSIX.1-2008 marks +.\"O .BR ftw () +.\"O as obsolete. +POSIX.1-2008 ¤Ï +.BR ftw () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The function +.\"O .BR nftw () +.\"O and the use of \fBFTW_SL\fP with +.\"O .BR ftw () +.\"O were introduced in SUSv1. +.BR nftw () +´Ø¿ô¤È¡¢ +.BR ftw () +¤Ë¤ª¤±¤ë +.B FTW_SL +¤Ï¡¢SUSv1 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.LP +.\"O On some systems +.\"O .BR ftw () +.\"O will never use \fBFTW_SL\fP, on other systems \fBFTW_SL\fP occurs only +.\"O for symbolic links that do not point to an existing file, +.\"O and again on other systems +.\"O .BR ftw () +.\"O will use \fBFTW_SL\fP for each symbolic link. +.\"O For predictable control, use +.\"O .BR nftw (). +.BR ftw () +¤Ç +.B FTW_SL +¤ò°ìÀڻȤï¤Ê¤¤¥·¥¹¥Æ¥à¤ä¡¢ +¸ºß¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¤Î¤ß +.B FTW_SL +¤ò»È¤¦¥·¥¹¥Æ¥à¡¢¤Þ¤¿ +.BR ftw () +¤¬Á´¤Æ¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ËÂФ·¤Æ +.B FTW_SL +¤ò»È¤¦¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +ͽ¬²Äǽ¤ÊÆ°ºî¤ò¤µ¤»¤ë¤¿¤á¤Ë¤Ï¡¢ +.BR nftw () +¤ò»È¤¦¤³¤È¡£ +.LP +.\"O Under Linux, libc4 and libc5 and glibc 2.0.6 will +.\"O use \fBFTW_F\fP for all objects (files, symbolic links, FIFOs, etc.) +.\"O that can be stat'ed but are not a directory. +Linux ¤Ç¤Ï¡¢ libc4, libc5, glibc 2.0.6 ¤Ï +¡Östat ¤Ç¤­¤ë¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¥ª¥Ö¥¸¥§¥¯¥È¡× +(¥Õ¥¡¥¤¥ë, ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯, fifo Åù) +¤ËÂФ·¤Æ¤Ï¤¹¤Ù¤Æ +.B FTW_F +¤ò»È¤¦¡£ + +.\"O The function +.\"O .BR nftw () +.\"O is available since glibc 2.1. +.BR nftw () +´Ø¿ô¤Ï glibc 2.1 °Ê¹ß¤ÇÍøÍѤǤ­¤ë¡£ + +.\"O \fBFTW_ACTIONRETVAL\fP is glibc-specific. +.B FTW_ACTIONRETVAL +¤Ï glibc ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The following program traverses the directory tree under the path named +.\"O in its first command-line argument, or under the current directory +.\"O if no argument is supplied. +.\"O It displays various information about each file. +.\"O The second command-line argument can be used to specify characters that +.\"O control the value assigned to the \fIflags\fP +.\"O argument when calling +.\"O .BR nftw (). +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢°ì¤ÄÌܤΥ³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ò̾Á°¤Ë»ý¤Ä¥Ñ¥¹°Ê²¼¤Î +¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤òõº÷¤¹¤ë¡£°ú¤­¿ô¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤òõº÷¤¹¤ë¡£ +³Æ¡¹¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤ÆÍÍ¡¹¤Î¾ðÊó¤¬É½¼¨¤µ¤ì¤ë¡£ +ÆóÈÖÌܤΥ³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ëʸ»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +.BR nftw () +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë +.I flags +°ú¤­¿ô¤ËÅϤ¹ÃͤòÀ©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.nf + +#define _XOPEN_SOURCE 500 +#include +#include +#include +#include +#include + +static int +display_info(const char *fpath, const struct stat *sb, + int tflag, struct FTW *ftwbuf) +{ + printf("%\-3s %2d %7jd %\-40s %d %s\\n", + (tflag == FTW_D) ? "d" : (tflag == FTW_DNR) ? "dnr" : + (tflag == FTW_DP) ? "dp" : (tflag == FTW_F) ? "f" : + (tflag == FTW_NS) ? "ns" : (tflag == FTW_SL) ? "sl" : + (tflag == FTW_SLN) ? "sln" : "???", + ftwbuf\->level, (intmax_t) sb\->st_size, + fpath, ftwbuf\->base, fpath + ftwbuf\->base); + return 0; /* To tell nftw() to continue */ +} + +int +main(int argc, char *argv[]) +{ + int flags = 0; + + if (argc > 2 && strchr(argv[2], \(aqd\(aq) != NULL) + flags |= FTW_DEPTH; + if (argc > 2 && strchr(argv[2], \(aqp\(aq) != NULL) + flags |= FTW_PHYS; + + if (nftw((argc < 2) ? "." : argv[1], display_info, 20, flags) + == \-1) { + perror("nftw"); + exit(EXIT_FAILURE); + } + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR stat (2), +.BR fts (3), +.BR readdir (3), +.BR feature_test_macros (7) diff --git a/draft/man3/futimes.3 b/draft/man3/futimes.3 new file mode 100644 index 00000000..e290cb5c --- /dev/null +++ b/draft/man3/futimes.3 @@ -0,0 +1,150 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 2006, 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. +.\" +.\" 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 ½¤Àµ»þ¹ï +.\" +.TH FUTIMES 3 2008-04-07 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O futimes, lutimes \- change file timestamps +futimes, lutimes \- ¥Õ¥¡¥¤¥ë¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÊѹ¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "int futimes(int " fd ", const struct timeval " tv [2]); + +.BI "int lutimes(const char *" filename ", const struct timeval " tv [2]); +.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 futimes (), +.BR lutimes (): +_BSD_SOURCE +.\"O .SH DESCRIPTION +.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 +¤òÍѤ¤¤Æ»ØÄꤹ¤ëÅÀ¤Ç¤¢¤ë¡£ + +.\"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" +.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 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 +.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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR utimensat (2), +.BR utime (2), +.BR symlink (7) diff --git a/draft/man3/fwide.3 b/draft/man3/fwide.3 new file mode 100644 index 00000000..2004340e --- /dev/null +++ b/draft/man3/fwide.3 @@ -0,0 +1,142 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:36 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH FWIDE 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fwide \- set and determine the orientation of a FILE stream +fwide \- FILE ¥¹¥È¥ê¡¼¥à¤ÎÆþ½ÐÎÏñ°Ì¤òÀßÄê¤Þ¤¿¤Ï¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fwide(FILE *" stream ", int " mode ); +.fi +.sp +.in -4n +.\"O Feature Test Macro Requirements for glibc (see +.\"O .BR feature_test_macros (7)): +.in +.sp +.BR fwide (): +.\"O _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +_XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; ¤Þ¤¿¤Ï +.I cc\ -std=c99 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O When \fImode\fP is zero, the +.\"O .BR fwide () +.\"O function determines the current +.\"O orientation of \fIstream\fP. +.\"O It returns a positive value if \fIstream\fP is +.\"O wide-character oriented, that is, if wide-character I/O is permitted but char +.\"O I/O is disallowed. +.\"O It returns a negative value if \fIstream\fP is byte oriented, +.\"O i.e., if char I/O is permitted but wide-character I/O is disallowed. +.\"O It +.\"O returns zero if \fIstream\fP has no orientation yet; in this case the next +.\"O I/O operation might change the orientation (to byte oriented if it is a char +\fImode\fP ¤¬¥¼¥í¤Ê¤é¤Ð +.BR fwide () +´Ø¿ô¤Ï \fIstream\fP ¤Î¸½ºß¤Î +.\"O I/O operation, or to wide-character oriented if it is a wide-character I/O +.\"O operation). +Æþ½ÐÎÏñ°Ì¤ò·èÄꤷ¤ÆÊÖ¤¹¡£\fIstream\fP ¤¬¥ï¥¤¥Éʸ»úñ°Ì¤Î¤È¤­¡¢ +¤¹¤Ê¤ï¤Á¥ï¥¤¥Éʸ»ú I/O ¤Ïµö¤µ¤ì¤Æ¥Ð¥¤¥È (char) I/O ¤Ïµö¤µ¤ì¤Æ¤¤¤Ê¤¤ +¤È¤­¤Ë¤Ï¡¢Àµ¤ÎÃͤòÊÖ¤¹¡£ +\fIstream\fP ¤¬¥Ð¥¤¥Èñ°Ì¤Î¤È¤­¡¢¤¹¤Ê¤ï¤Á¥Ð¥¤¥È I/O ¤Ïµö¤µ¤ì¤Æ +¥ï¥¤¥Éʸ»ú I/O ¤Ïµö¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¤Ë¤Ï¡¢Éé¤ÎÃͤòÊÖ¤¹¡£ +\fIstream\fP ¤ÎÆþ½ÐÎÏñ°Ì¤¬¤Þ¤À·èÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤Î¾ì¹ç¤Ë¤Ï¼¡¤Î I/O Áàºî¤Ë¤è¤Ã¤ÆÆþ½ÐÎÏñ°Ì¤¬Êѹ¹¤µ¤ì¤ë +(¥Ð¥¤¥È I/O Áàºî¤Î¾ì¹ç¤Ë¤Ï¥Ð¥¤¥Èñ°Ì¤Ë¡¢¥ï¥¤¥Éʸ»ú I/O Áàºî¤Î¾ì¹ç¤Ë¤Ï +¥ï¥¤¥Éʸ»úñ°Ì¤Ë¤Ê¤ë)¡£ +.PP +.\"O Once a stream has an orientation, it cannot be changed and persists until +.\"O the stream is closed. +°ìÅÙ¥¹¥È¥ê¡¼¥à¤ÎÆþ½ÐÎÏñ°Ì¤¬·è¤Þ¤ë¤È¡¢Êѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤º¡¢ +¥¹¥È¥ê¡¼¥à¤¬¥¯¥í¡¼¥º (close) ¤µ¤ì¤ë¤Þ¤ÇÊÝ»ý¤µ¤ì¤ë¡£ +.PP +.\"O When \fImode\fP is nonzero, the +.\"O .BR fwide () +.\"O function first attempts to set +.\"O \fIstream\fP's orientation (to wide-character oriented +.\"O if \fImode\fP is greater than 0, or +.\"O to byte oriented if \fImode\fP is less than 0). +.\"O It then returns a value denoting the +.\"O current orientation, as above. +\fImode\fP ¤¬¥¼¥í¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï +.BR fwide () +´Ø¿ô¤ÏºÇ½é¤Ë \fIstream\fP +¤ÎÆþ½ÐÎÏñ°Ì¤òÀßÄꤷ¤è¤¦¤È¤¹¤ë +(\fImode\fP ¤¬ 0 ¤è¤êÂ礭¤¤¾ì¹ç¤Ë¤Ï¥ï¥¤¥Éʸ»úñ°Ì¤Ë¡¢ +\fImode\fP ¤¬ 0 ¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ë¤Ï¥Ð¥¤¥Èñ°Ì¤ËÀßÄꤷ¤è¤¦¤È¤¹¤ë)¡£ +¤½¤·¤Æ¾åµ­¤ÈƱÍͤ˸½ºß¤ÎÆþ½ÐÎÏñ°Ì¤òÊÖ¤¹¡£ + +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR fwide () +.\"O function returns the stream's orientation, after possibly +.\"O changing it. +.\"O A positive return value means wide-character oriented. +.\"O A negative return value means byte oriented. +.\"O A return value of zero means undecided. +.BR fwide () +´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤ÎÆþ½ÐÎÏñ°Ì¤ÎÀßÄê¤ò»î¤ß¤¿¸å¤Ë¤½¤ÎÃͤòÊÖ¤¹¡£ +Àµ¤ÎÊÖ¤êÃͤϥ磻¥Éʸ»úñ°Ì¤ò¡¢Éé¤ÎÊÖ¤êÃͤϥХ¤¥Èñ°Ì¤ò°ÕÌ£¤¹¤ë¡£ +ÊÖ¤êÃͤ¬ 0 ¤Ê¤é¤Ð̤·èÄê¤ò°ÕÌ£¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Wide-character output to a byte oriented stream can be performed through the +.\"O .BR fprintf (3) +.\"O function with the +.\"O .B %lc +.\"O and +.\"O .B %ls +.\"O directives. +¥Ð¥¤¥Èñ°Ì¤Î¥¹¥È¥ê¡¼¥à¤Ë¥ï¥¤¥Éʸ»ú¤ò½ÐÎϤˤ¹¤ë¤Ë¤Ï +.BR fprintf (3) +´Ø¿ô¤Î +.B %lc +ÊÑ´¹¤ä +.B %ls +ÊÑ´¹¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O Char oriented output to a wide-character oriented stream can be performed +.\"O through the +.\"O .BR fwprintf (3) +.\"O function with the +.\"O .B %c +.\"O and +.\"O .B %s +.\"O directives. +¥ï¥¤¥Éʸ»úñ°Ì¤Î¥¹¥È¥ê¡¼¥à¤Ë¥Ð¥¤¥Èñ°Ì¤Î½ÐÎϤò¹Ô¤¦¤Ë¤Ï +.BR fwprintf (3) +´Ø¿ô¤Î +.B %c +ÊÑ´¹¤ä +.B %s +ÊÑ´¹¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fprintf (3), +.BR fwprintf (3) diff --git a/draft/man3/gamma.3 b/draft/man3/gamma.3 new file mode 100644 index 00000000..e4c78c10 --- /dev/null +++ b/draft/man3/gamma.3 @@ -0,0 +1,171 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" 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 +.SH ̾Á° +gamma, gammaf, gammal \- ¥¬¥ó¥Þ´Ø¿ô (¤Î¼«Á³Âпô) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double gamma(double " x ");" +.br +.BI "float gammaf(float " x ");" +.br +.BI "long double gammal(long double " x ");" +.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) +»²¾È): +.in +.sp +.ad l +.BR gamma (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.br +.BR gammaf (), +.BR gammal (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.\" Also seems to work: -std=c99 -D_XOPEN_SOURCE +.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) +¤ò»È¤¦¤³¤È¡£ + +.\"O For the definition of the Gamma function, see +.\"O .BR tgamma (3). +¥¬¥ó¥Þ´Ø¿ô¤ÎÄêµÁ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR tgamma (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SS "*BSD version" +.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 () +¤¬´Þ¤Þ¤ì¤Æ¤ª¤ê¡¢´üÂÔÄ̤ꥬ¥ó¥Þ´Ø¿ô¤ò·×»»¤Ç¤­¤ë¡£ +.\"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 +.SH ÊÖ¤êÃÍ +.\"O See +.\"O .BR lgamma (3). +.BR lgamma (3) +¤ò»²¾È¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O See +.\"O .BR lgamma (3). +.BR lgamma (3) +¤ò»²¾È¡£ +.\"O .SH "CONFORMING TO" +.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) +¤È¤Ê¤ê¡¢¤½¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï +.sp +.in +4n +¡Ö¤¤¤Ä¤ÎÆü¤« 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) +¤È¤¤¤¦¡ÖËÜÅö¤Î¥¬¥ó¥Þ´Ø¿ô¡×¤¬¤¹¤Ç¤Ë¸ºß¤·¤Æ¤¤¤ë¤Î¤Ç¤¢¤ë¡£ +.\" 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) diff --git a/draft/man3/gcvt.3 b/draft/man3/gcvt.3 new file mode 100644 index 00000000..307bb4fc --- /dev/null +++ b/draft/man3/gcvt.3 @@ -0,0 +1,109 @@ +.\" 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 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 +.\" +.TH GCVT 3 2009-03-15 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O gcvt \- convert a floating-point number to a string +gcvt \- ÉâÆ°¾®¿ôÅÀ¿ô¤òʸ»úÎó¤ØÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *gcvt(double " number ", size_t " ndigit ", char *" buf ); +.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 gcvt (): +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"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" +.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" +.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) +¤ÎÊý¤¬Å¬ÀÚ¤«¤â¤·¤ì¤Ê¤¤¤¬)¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ecvt (3), +.BR fcvt (3), +.BR sprintf (3) diff --git a/draft/man3/getaddrinfo.3 b/draft/man3/getaddrinfo.3 new file mode 100644 index 00000000..8401ed52 --- /dev/null +++ b/draft/man3/getaddrinfo.3 @@ -0,0 +1,1293 @@ +.\" Copyright (c) 2007, 2008 Michael Kerrisk +.\" and Copyright (c) 2006 Ulrich Drepper +.\" A few pieces of an earlier version remain: +.\" Copyright 2000, Sam Varshavchik +.\" +.\" 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: RFC 2553 +.\" +.\" 2005-08-09, mtk, added AI_ALL, AI_ADDRCONFIG, AI_V4MAPPED, +.\" and AI_NUMERICSERV. +.\" 2006-11-25, Ulrich Drepper +.\" Add text describing Internationalized Domain Name extensions. +.\" 2007-06-08, mtk: added example programs +.\" 2008-02-26, mtk; clarify discussion of NULL 'hints' argument; other +.\" minor rewrites. +.\" 2008-06-18, mtk: many parts rewritten +.\" 2008-12-04, Petr Baudis +.\" Describe results ordering and reference /etc/gai.conf. +.\" FIXME . glibc's 2.9 NEWS file documents DCCP and UDP-lite support +.\" and is SCTP support now also there? +.\" +.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. +.\" Translated Sun Jan 14 2001 by NAKANO Takeo +.\" Updated 2005-10-09 by Kentaro Shirakata +.\" Updated 2007-01-01 by Kentaro Shirakata +.\" Updated 2007-06-13, Akihiro MOTOKI , LDP v2.55 +.\" Updated 2008-04-04, Akihiro MOTOKI, LDP v2.79 +.\" Updated 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" Updated 2008-12-26, Akihiro MOTOKI, LDP v3.15 +.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24 +.\" +.\"WORD: null pointer ¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿ +.\" +.TH GETADDRINFO 3 2009-09-03 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O getaddrinfo, freeaddrinfo, gai_strerror \- network address and +.\"O service translation +.SH ̾Á° +getaddrinfo, freeaddrinfo, gai_strerror \- +¥Í¥Ã¥È¥ï¡¼¥¯¤Î¥¢¥É¥ì¥¹¤È¥µ¡¼¥Ó¥¹¤òÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int getaddrinfo(const char *" "node" ", const char *" "service" , +.BI " const struct addrinfo *" "hints" , +.BI " struct addrinfo **" "res" ); +.sp +.BI "void freeaddrinfo(struct addrinfo *" "res" ); +.sp +.BI "const char *gai_strerror(int " "errcode" ); +.fi +.sp +.in -4n +.\"O Feature Test Macro Requirements for glibc (see +.\"O .BR feature_test_macros (7)): +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.ad l +.in +.sp +.BR getaddrinfo (), +.BR freeaddrinfo (), +.BR gai_strerror (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Given +.\"O .I node +.\"O and +.\"O .IR service , +.\"O which identify an Internet host and a service, +.\"O .BR getaddrinfo () +.\"O returns one or more +.\"O .I addrinfo +.\"O structures, each of which contains an Internet address +.\"O that can be specified in a call to +.\"O .BR bind (2) +.\"O or +.\"O .BR connect (2). +.BR getaddrinfo () +¤Ï¡¢(¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î¥Û¥¹¥È¤È¥µ¡¼¥Ó¥¹¤ò¼±Ê̤¹¤ë) +.I node +¤È +.I service +¤òÅϤ¹¤È¡¢°ì¤Ä°Ê¾å¤Î +.I addrinfo +¹½Â¤ÂΤòÊÖ¤¹¡£¤½¤ì¤¾¤ì¤Î +.I addrinfo +¹½Â¤ÂΤˤϡ¢ +.BR bind (2) +¤ä +.BR connect (2) +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë»ØÄê¤Ç¤­¤ë¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹¤¬³ÊǼ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O The +.\"O .BR getaddrinfo () +.\"O function combines the functionality provided by the +.\"O .\" .BR getipnodebyname (3), +.\"O .\" .BR getipnodebyaddr (3), +.\"O .BR getservbyname (3) +.\"O and +.\"O .BR getservbyport (3) +.\"O functions into a single interface, but unlike the latter functions, +.\"O .BR getaddrinfo () +.\"O is reentrant and allows programs to eliminate IPv4-versus-IPv6 dependencies. +.BR getaddrinfo () +´Ø¿ô¤Ï¡¢ +.\" .BR getipnodebyname (3), +.\" .BR getipnodebyaddr (3), +.BR getservbyname (3) +¤È +.BR getservbyport (3) +¤Îµ¡Ç½¤ò¤Þ¤È¤á¤Æ°ì¤Ä¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¤¬¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤È°ã¤¤¡¢ +.BR getaddrinfo () +¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤¢¤ê¡¢ +.BR getaddrinfo () +¤ò»È¤¦¤³¤È¤Ç¥×¥í¥°¥é¥à¤Ï IPv4 ¤È IPv6 ¤Î°ã¤¤¤Ë´Ø¤¹¤ë°Í¸´Ø·¸¤ò +¤Ê¤¯¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O The +.\"O .I addrinfo +.\"O structure used by +.\"O .BR getaddrinfo () +.\"O contains the following fields: +.BR getaddrinfo () +¤¬ÍѤ¤¤ë +.I addrinfo +¹½Â¤ÂΤϰʲ¼¤Î¥Õ¥£¡¼¥ë¥É¤ò´Þ¤à¡£ +.sp +.in +4n +.nf +struct addrinfo { + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + size_t ai_addrlen; + struct sockaddr *ai_addr; + char *ai_canonname; + struct addrinfo *ai_next; +}; +.fi +.in +.PP +.\"O The +.\"O .I hints +.\"O argument points to an +.\"O .I addrinfo +.\"O structure that specifies criteria for selecting the socket address +.\"O structures returned in the list pointed to by +.\"O .IR res . +.\"O If +.\"O .I hints +.\"O is not NULL it points to an +.\"O .I addrinfo +.\"O structure whose +.\"O .IR ai_family , +.\"O .IR ai_socktype , +.\"O and +.\"O .I ai_protocol +.\"O specify criteria that limit the set of socket addresses returned by +.\"O .BR getaddrinfo (), +.\"O as follows: +.I hints +°ú¤­¿ô¤Ï +.I addrinfo +¹½Â¤ÂΤò»Ø¤·¼¨¤·¡¢¤³¤Î¹½Â¤ÂΤòÍѤ¤¤Æ +.I res +¤¬»Ø¤¹¥ê¥¹¥È¤ËÆþ¤ì¤ÆÊÖ¤¹¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¹½Â¤ÂΤòÁªÂò¤¹¤ë¤¿¤á¤Î´ð½à¤ò»ØÄꤹ¤ë¡£ +.I hints +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I hints +¤Ï +.I addrinfo +¹½Â¤ÂΤò»Ø¤·¼¨¤·¡¢¤½¤Î¹½Â¤ÂΤΥե£¡¼¥ë¥É +.IR ai_family , +.IR ai_socktype , +.I ai_protocol +¤Ç +.BR getaddrinfo () +¤¬ÊÖ¤¹¥½¥±¥Ã¥È¥¢¥É¥ì¥¹½¸¹ç¤ËÂФ¹¤ë´ð½à¤ò»ØÄꤹ¤ë¡£ +.TP 12 +.I ai_family +.\"O This field specifies the desired address family for the returned addresses. +.\"O Valid values for this field include +.\"O .BR AF_INET +.\"O and +.\"O .BR AF_INET6 . +.\"O The value +.\"O .B AF_UNSPEC +.\"O indicates that +.\"O .BR getaddrinfo () +.\"O should return socket addresses for any address family +.\"O (either IPv4 or IPv6, for example) that can be used with +.\"O .I node +.\"O and +.\"O .IR service . +¤³¤Î¥Õ¥£¡¼¥ë¥É¤ÏÊÖ¤µ¤ì¤ë¥¢¥É¥ì¥¹¤Î´õ˾¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë»ØÄê¤Ç¤­¤ëÍ­¸ú¤ÊÃͤȤ·¤Æ¤Ï +.B AF_INET +¤È +.B AF_INET6 +¤¬¤¢¤ë¡£ +¤Þ¤¿¡¢ÃÍ +.B AF_UNSPEC +¤ò»ØÄꤹ¤ë¤È¡¢ +.BR getaddrinfo () +¤Ï +.I node +¤È +.I service +¤Ç»ÈÍѤǤ­¤ë¤¤¤º¤ì¤«¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼ (Î㤨¤Ð IPv4 ¤« IPv6) ¤Î +¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤òÊÖ¤¹¤³¤È¤òµá¤á¤é¤ì¤ë¡£ +.TP +.I ai_socktype +.\"O This field specifies the preferred socket type, for example +.\"O .BR SOCK_STREAM +.\"O or +.\"O .BR SOCK_DGRAM . +.\"O Specifying 0 in this field indicates that socket addresses of any type +.\"O can be returned by +.\"O .BR getaddrinfo (). +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¿ä¾©¤Î¥½¥±¥Ã¥È·¿ (Î㤨¤Ð +.B SOCK_STREAM +¤ä +.BR SOCK_DGRAM ) +¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤ò»ØÄꤹ¤ë¤È¡¢Ç¤°Õ¤Î¥½¥±¥Ã¥È·¿¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ò +.BR getaddrinfo () +¤¬ÊÖ¤·¤Æ¤è¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.TP +.I ai_protocol +.\"O This field specifies the protocol for the returned socket addresses. +.\"O Specifying 0 in this field indicates that socket addresses with +.\"O any protocol can be returned by +.\"O .BR getaddrinfo (). +¤³¤Î¥Õ¥£¡¼¥ë¥É¤ÏÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Î¥×¥í¥È¥³¥ë¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤ò»ØÄꤹ¤ë¤È¡¢Ç¤°Õ¤Î¥×¥í¥È¥³¥ë¤Î¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ò +.BR getaddrinfo () +¤¬ÊÖ¤·¤Æ¤è¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.TP +.I ai_flags +.\"O This field specifies additional options, described below. +.\"O Multiple flags are specified by logically OR-ing them together. +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢ÄɲäΥª¥×¥·¥ç¥ó (²¼µ­) ¤ò»ØÄꤹ¤ë¡£ +Ê£¿ô¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ëºÝ¤Ë¤Ï¡¢¤½¤ì¤é¤ÎÏÀÍý OR ¤ò¤È¤Ã¤Æ»ØÄꤹ¤ë¡£ +.PP +.\"O All the other fields in the structure pointed to by +.\"O .I hints +.\"O must contain either 0 or a null pointer, as appropriate. +.I hints +¤¬»Ø¤·¼¨¤¹¹½Â¤ÂΤξ¤Î¤¹¤Ù¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï +0 ¤« NULL ¥Ý¥¤¥ó¥¿¤òŬÀÚ¤ËÆþ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O Specifying +.\"O .I hints +.\"O as NULL is equivalent to setting +.\"O .I ai_socktype +.\"O and +.\"O .I ai_protocol +.\"O to 0; +.\"O .I ai_family +.\"O to +.\"O .BR AF_UNSPEC ; +.\"O and +.\"O .I ai_flags +.\"O to +.\"O .BR "(AI_V4MAPPED\ |\ AI_ADDRCONFIG)" . +.I hints +¤Ë NULL ¤ò»ØÄꤹ¤ë¤Î¤Ï¡¢ +.I ai_socktype +¤È +.I ai_protocol +¤Ë 0 ¤ò¡¢ +.I ai_family +¤Ë +.B AF_UNSPEC +¤ò¡¢ +.I ai_flags +¤Ë +.B "(AI_V4MAPPED\ |\ AI_ADDRCONFIG)" +¤òÀßÄꤹ¤ë¤Î¤ÈÅù²Á¤Ç¤¢¤ë¡£ + +.\"O .I node +.\"O specifies either a numerical network address +.\"O (for IPv4, numbers-and-dots notation as supported by +.\"O .BR inet_aton (3); +.\"O for IPv6, hexadecimal string format as supported by +.\"O .BR inet_pton (3)), +.\"O or a network hostname, whose network addresses are looked up and resolved. +.\"O If +.\"O .I hints.ai_flags +.\"O contains the +.\"O .B AI_NUMERICHOST +.\"O flag then +.\"O .I node +.\"O must be a numerical network address. +.\"O The +.\"O .B AI_NUMERICHOST +.\"O flag suppresses any potentially lengthy network host address lookups. +.I node +¤Ë¤Ï¡¢¿ôÃÍ·Á¼°¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹ +(IPv4 ¤Î¾ì¹ç¤Ï +.BR inet_aton (3) +¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥É¥Ã¥È¶èÀÚ¤ê¤Î¿ô»ú¤Ë¤è¤ëɽµ­¡¢ +IPv6 ¤Î¾ì¹ç¤Ï +.BR inet_pton (3) +¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë 16 ¿Ê¿ô¤Îʸ»úÎó·Á¼°) ¤â¤·¤¯¤Ï +¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È̾¤ò»ØÄꤹ¤ë¡£ +¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È̾¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¸¡º÷¤µ¤ì¡¢ +̾Á°²ò·è¤¬¹Ô¤Ê¤ï¤ì¤ë¡£ +.I hints.ai_flags +¤Ë +.B AI_NUMERICHOST +¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.I node +¤Ï¿ôÃÍ·Á¼°¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B AI_NUMERICHOST +¥Õ¥é¥°¤ò»È¤¦¤È¡¢»þ´Ö¤Î³Ý¤«¤ë²ÄǽÀ­¤Î¤¢¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¥¢¥É¥ì¥¹¤Î¸¡º÷¤Ï +¤¹¤Ù¤ÆÍÞÀ©¤µ¤ì¤ë¡£ +.PP +.\"O If the +.\"O .B AI_PASSIVE +.\"O flag is specified in +.\"O .IR hints.ai_flags , +.\"O and +.\"O .I node +.\"O is NULL, +.\"O then the returned socket addresses will be suitable for +.\"O .BR bind (2)ing +.\"O a socket that will +.\"O .BR accept (2) +.\"O connections. +.\"O The returned socket address will contain the "wildcard address" +.\"O .RB ( INADDR_ANY +.\"O for IPv4 addresses, +.\"O .BR IN6ADDR_ANY_INIT +.\"O for IPv6 address). +.\"O The wildcard address is used by applications (typically servers) +.\"O that intend to accept connections on any of the hosts's network addresses. +.\"O If +.\"O .I node +.\"O is not NULL, then the +.\"O .B AI_PASSIVE +.\"O flag is ignored. +.IR hints.ai_flags +¤Ë +.B AI_PASSIVE +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¡¢¤«¤Ä +.I node +¤¬ NULL ¤Î¾ì¹ç¡¢ +ÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï +¥³¥Í¥¯¥·¥ç¥ó¤ò +.BR accept (2) +¤¹¤ë¤¿¤á¤Î¥½¥±¥Ã¥È¤ò +.BR bind (2) +¤¹¤ë¤Î¤ËŬ¤·¤¿¤â¤Î¤È¤Ê¤ë¡£ +ÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ë¤Ï¡Ö¥ï¥¤¥ë¥É¥«¡¼¥É¡¦¥¢¥É¥ì¥¹¡× +(IPv4 ¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï +.BR INADDR_ANY ¡¢ +IPv6 ¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï +.BR IN6ADDR_ANY_INIT ) +¤¬Æþ¤ë¡£ +¥ï¥¤¥ë¥É¥«¡¼¥É¡¦¥¢¥É¥ì¥¹¤Ï¡¢Ç¤°Õ¤Î¥Û¥¹¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ÇÀܳ¤ò +¼õ¤±ÉÕ¤±¤è¤¦¤È¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó (Ä̾ï¤Ï¥µ¡¼¥Ð¡¼) ¤ÇÍѤ¤¤é¤ì¤ë¡£ +.I node +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.B AI_PASSIVE +¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë¡£ +.PP +.\"O If the +.\"O .B AI_PASSIVE +.\"O flag is not set in +.\"O .IR hints.ai_flags , +.\"O then the returned socket addresses will be suitable for use with +.\"O .BR connect (2), +.\"O .BR sendto (2), +.\"O or +.\"O .BR sendmsg (2). +.\"O If +.\"O .I node +.\"O is NULL, +.\"O then the network address will be set to the loopback interface address +.\"O .RB ( INADDR_LOOPBACK +.\"O for IPv4 addresses, +.\"O .BR IN6ADDR_LOOPBACK_INIT +.\"O for IPv6 address); +.\"O this is used by applications that intend to communicate +.\"O with peers running on the same host. +.I hints.ai_flags +¤Ë +.B AI_PASSIVE +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +ÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï +.BR connect (2), +.BR sendto (2), +.BR sendmsg (2) +¤Ç¤Î»ÈÍѤËŬ¤·¤¿¤â¤Î¤È¤Ê¤ë¡£ +.I node +¤¬ NULL ¤Î¾ì¹ç¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ë¤Ï¥ë¡¼¥×¥Ð¥Ã¥¯¡¦¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Î +¥¢¥É¥ì¥¹ (IPv4 ¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï +.BR INADDR_LOOPBACK +IPv6 ¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï +.BR IN6ADDR_LOOPBACK_INIT ) ¤¬ÀßÄꤵ¤ì¤ë¡£ +¤³¤ì¤ÏƱ¤¸¥Û¥¹¥È¾å¤ÇÆ°ºî¤·¤Æ¤¤¤ëÀܳÁê¼ê¤ÈÄÌ¿®¤¹¤ë¤è¤¦¤Ê +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÍѤ¤¤é¤ì¤ë¡£ +.PP +.\"O .I service +.\"O sets the port in each returned address structure. +.\"O If this argument is a service name (see +.\"O .BR services (5)), +.\"O it is translated to the corresponding port number. +.\"O This argument can also be specified as a decimal number, +.\"O which is simply converted to binary. +.I service +¤Ë¤è¤ê¡¢ÊÖ¤µ¤ì¤ë³Æ¥¢¥É¥ì¥¹¹½Â¤ÂΤΥݡ¼¥ÈÈֹ椬·è¤Þ¤ë¡£ +¤³¤Î°ú¤­¿ô¤¬¥µ¡¼¥Ó¥¹Ì¾ +.RB ( services (5) +»²¾È) ¤Î¾ì¹ç¡¢Âбþ¤¹¤ë¥Ý¡¼¥ÈÈÖ¹æ¤ËËÝÌõ¤µ¤ì¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ë¤Ï 10 ¿Ê¿ô¤â»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¡¢ +¤³¤Î¾ì¹ç¤Ë¤Ï¥Ð¥¤¥Ê¥ê¤Ø¤ÎÊÑ´¹¤À¤±¤¬¹Ô¤ï¤ì¤ë¡£ +.\"O If +.\"O .I service +.\"O is NULL, then the port number of the returned socket addresses +.\"O will be left uninitialized. +.I service +¤¬ NULL ¤Î¾ì¹ç¡¢ÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Î¥Ý¡¼¥ÈÈÖ¹æ¤Ï +½é´ü²½¤µ¤ì¤Ê¤¤¤Þ¤Þ¤È¤Ê¤ë¡£ +.\"O If +.\"O .B AI_NUMERICSERV +.\"O is specified in +.\"O .I hints.ai_flags +.\"O and +.\"O .I service +.\"O is not NULL, then +.\"O .I service +.\"O must point to a string containing a numeric port number. +.I hints.ai_flags +¤Ë +.B AI_NUMERICSERV +¤¬»ØÄꤵ¤ì¡¢¤«¤Ä +.I service +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I service +¤Ï¿ôÃͤΥݡ¼¥ÈÈÖ¹æ¤ò´Þ¤àʸ»úÎó¤ò»Ø¤·¼¨¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O This flag is used to inhibit the invocation of a name resolution service +.\"O in cases where it is known not to be required. +¤³¤Î¥Õ¥é¥°¤Ï¡¢Ì¾Á°²ò·è¥µ¡¼¥Ó¥¹¤¬ÉÔÍפǤ¢¤ë¤³¤È¤¬Ê¬¤«¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +¥µ¡¼¥Ó¥¹¤Îµ¯Æ°¤òÍÞÀ©¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +.\"O Either +.\"O .I node +.\"O or +.\"O .IR service , +.\"O but not both, may be NULL. +.I node +¤È +.I service +¤Î¤É¤Á¤é¤«¤Ï NULL ¤Ë¤·¤Æ¤è¤¤¤¬¡¢Î¾ÊýƱ»þ¤Ë NULL ¤Ë¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR getaddrinfo () +.\"O function allocates and initializes a linked list of +.\"O .I addrinfo +.\"O structures, one for each network address that matches +.\"O .I node +.\"O and +.\"O .IR service , +.\"O subject to any restrictions imposed by +.\"O .IR hints , +.\"O and returns a pointer to the start of the list in +.\"O .IR res . +.\"O The items in the linked list are linked by the +.\"O .I ai_next +.\"O field. +.BR getaddrinfo () +´Ø¿ô¤Ï¡¢ +.I addrinfo +¹½Â¤ÂΤΥá¥â¥ê³ÎÊݤò¹Ô¤¤¡¢ +.I addrinfo +¹½Â¤ÂΤΥê¥ó¥¯¥ê¥¹¥È¤ò½é´ü²½¤·¡¢ +.I res +¤Ë¥ê¥¹¥È¤ÎÀèƬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÆþ¤ì¤ÆÊÖ¤¹¡£ +¤³¤Î¤È¤­¡¢³Æ¹½Â¤ÂΤΥͥåȥ¥¯¥¢¥É¥ì¥¹¤Ï +.I node +¤È +.I service +¤Ë°ìÃפ·¡¢ +.I hints +¤Ç²Ý¤µ¤ì¤¿¤¹¤Ù¤Æ¤ÎÀ©¸Â¤òËþ¤¿¤¹¤â¤Î¤È¤Ê¤ë¡£ +¥ê¥ó¥¯¥ê¥¹¥È¤ÎÍ×ÁÇ¤Ï +.I ai_next +¥Õ¥£¡¼¥ë¥É¤Ë¤è¤êÏ¢·ë¤µ¤ì¤ë¡£ + +.\"O There are several reasons why +.\"O the linked list may have more than one +.\"O .I addrinfo +.\"O structure, including: the network host is multihomed, accessible +.\"O over multiple protocols (e.g. both +.\"O .BR AF_INET +.\"O and +.\"O .BR AF_INET6 ); +.\"O or the same service is available from multiple socket types (one +.\"O .B SOCK_STREAM +.\"O address and another +.\"O .B SOCK_DGRAM +.\"O address, for example). +¥ê¥ó¥¯¥ê¥¹¥È¤Î +.I addrinfo +¹½Â¤ÂΤÏÊ£¿ô¸Ä¤Ë¤Ê¤ë¤³¤È¤â¤¢¤ê¡¢¤½¤ÎÍýͳ¤Ï¤¤¤¯¤Ä¤«¤¢¤ë¡£ +¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤¬¥Þ¥ë¥Á¥Û¡¼¥à¤Ç¤¢¤ë¡¢ +Ê£¿ô¤Î¥×¥í¥È¥³¥ë¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë (Î㤨¤Ð +.B AF_INET +¤È +.B AF_INET6 +¤ÎξÊý) ¡¢ +Ê£¿ô¤Î¥½¥±¥Ã¥È¼ïÊ̤ÇƱ¤¸¥µ¡¼¥Ó¥¹¤¬ÍøÍѤǤ­¤ë +(Î㤨¤Ð¡¢¤Ò¤È¤Ä¤¬ +.B SOCK_STREM +¥¢¥É¥ì¥¹¤Ç¡¢¤â¤¦¤Ò¤È¤Ä¤¬ +.B SOCK_DGRAM +¥¢¥É¥ì¥¹¤Ç¤¢¤ë)¡¢¤¬¤¢¤ë¡£ +.\"O Normally, the application should try +.\"O using the addresses in the order in which they are returned. +.\"O The sorting function used within +.\"O .BR getaddrinfo () +.\"O is defined in RFC\ 3484; the order can be tweaked for a particular +.\"O system by editing +.\"O .IR /etc/gai.conf +.\"O (available since glibc 2.5). +Ä̾ï¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÏÊÖ¤µ¤ì¤¿½ç½ø¤Ç¥¢¥É¥ì¥¹¤ò»î¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.BR getaddrinfo () +¤ÎÃæ¤Ç»ÈÍѤµ¤ì¤ëʤÙÂؤ¨´Ø¿ô¤Ï RFC\ 3484 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +Æüì¤Ê¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I /etc/gai.conf +¤òÊÔ½¸¤¹¤ë¤³¤È¤Ç¡¢¤³¤Î½ç½ø¤òÈùÄ´À°¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.RI ( /etc/gai.conf +¤Ï glibc 2.5 °Ê¹ß¤ÇÍøÍѤǤ­¤ë)¡£ +.PP +.\"O If +.\"O .I hints.ai_flags +.\"O includes the +.\"O .B AI_CANONNAME +.\"O flag, then the +.\"O .I ai_canonname +.\"O field of the first of the +.\"O .I addrinfo +.\"O structures in the returned list is set to point to the +.\"O official name of the host. +.I hints.ai_flags +¤Ë +.B AI_CANONNAME +¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ÊÖ¤µ¤ì¤ë¥ê¥¹¥È¤ÎºÇ½é¤Î +.I addrinfo +¹½Â¤ÂΤΠ+.I ai_canonname +¥Õ¥£¡¼¥ë¥É¤Ï¥Û¥¹¥È¤Î¸ø¼°¤Ê̾Á°¤ò»Ø¤¹¤è¤¦¤ËÀßÄꤵ¤ì¤ë¡£ +.\" In glibc prior to 2.3.4, the ai_canonname of each addrinfo +.\" structure was set pointing to the canonical name; that was +.\" more than POSIX.1-2001 specified, or other implementations provided. +.\" MTK, Aug 05 + +.\"O The remaining fields of each returned +.\"O .I addrinfo +.\"O structure are initialized as follows: +ÊÖ¤µ¤ì¤ë³Æ¡¹¤Î +.I addrinfo +¹½Â¤ÂΤλĤê¤Î¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤Î¤è¤¦¤Ë½é´ü²½¤µ¤ì¤ë¡£ +.IP * 2 +.\"O The +.\"O .IR ai_family , +.\"O .IR ai_socktype , +.\"O and +.\"O .I ai_protocol +.\"O fields return the socket creation parameters (i.e., these fields have +.\"O the same meaning as the corresponding arguments of +.\"O .BR socket (2)). +.IR ai_family , +.IR ai_socktype , +.I ai_protocol +¥Õ¥£¡¼¥ë¥É¤Ï¥½¥±¥Ã¥ÈÀ¸À®¥Ñ¥é¥á¡¼¥¿¤òÊÖ¤¹ +(¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Î°ÕÌ£¤Ï +.BR socket (2) +¤ÎƱ¤¸Ì¾Á°¤Î°ú¤­¿ô¤ÈƱ¤¸¤Ç¤¢¤ë)¡£ +.\"O For example, +.\"O .I ai_family +.\"O might return +.\"O .B AF_INET +.\"O or +.\"O .BR AF_INET6 ; +.\"O .I ai_socktype +.\"O might return +.\"O .B SOCK_DGRAM +.\"O or +.\"O .BR SOCK_STREAM ; +.\"O and +.\"O .I ai_protocol +.\"O returns the protocol for the socket. +Î㤨¤Ð¡¢ +.I ai_family +¤Ï +.B AF_INET +¤ä +.B AF_INET6 +¤òÊÖ¤·¡¢ +.I ai_socktype +¤Ï +.B SOCK_DGRAM +¤ä +.BR SOCK_STREAM +¤òÊÖ¤·¡¢ +.I ai_protocol +¤Ï¤½¤Î¥½¥±¥Ã¥È¤Î¥×¥í¥È¥³¥ë¤òÊÖ¤¹¡£ +.IP * +.\"O A pointer to the socket address is placed in the +.\"O .I ai_addr +.\"O field, and the length of the socket address, in bytes, +.\"O is placed in the +.\"O .I ai_addrlen +.\"O field. +.I ai_addr +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬½ñ¤­¹þ¤Þ¤ì¡¢ +.I ai_addrlen +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ÎŤµ¤¬¥Ð¥¤¥Èñ°Ì¤Ç½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.PP +.\"O If +.\"O .I hints.ai_flags +.\"O includes the +.\"O .B AI_ADDRCONFIG +.\"O flag, then IPv4 addresses are returned in the list pointed to by +.\"O .I res +.\"O only if the local system has at least one +.\"O IPv4 address configured, and IPv6 addresses are only returned +.\"O if the local system has at least one IPv6 address configured. +.I hints.ai_flags +¤¬ +.B AI_ADDRCONFIG +¤ò´Þ¤à¾ì¹ç¡¢ +.I res +¤¬»Ø¤¹¥ê¥¹¥È¤Ë¤Ï¡¢ +¥í¡¼¥«¥ë¥·¥¹¥Æ¥à¤ËºÇÄã°ì¤Ä¤Î IPv4 ¥¢¥É¥ì¥¹¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï +IPv4 ¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¡¢ +¥í¡¼¥«¥ë¥·¥¹¥Æ¥à¤ËºÇÄã°ì¤Ä¤Î IPv6 ¥¢¥É¥ì¥¹¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï +IPv6 ¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O If +.\"O .I hint.ai_flags +.\"O specifies the +.\"O .B AI_V4MAPPED +.\"O flag, and +.\"O .I hints.ai_family +.\"O was specified as +.\"O .BR AF_INET6 , +.\"O and no matching IPv6 addresses could be found, +.\"O then return IPv4-mapped IPv6 addresses in the list pointed to by +.\"O .IR res . +.I hint.ai_flags +¤Ë +.B AI_V4MAPPED +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.I hints.ai_family +¤Ë +.B AF_INET6 +¤¬»ØÄꤵ¤ì¡¢ +¥Þ¥Ã¥Á¤¹¤ë IPv6 ¥¢¥É¥ì¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.I res +¤¬»Ø¤¹¥ê¥¹¥È¤Ë¤Ï IPv4-mapped IPv6 ¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O If both +.\"O .B AI_V4MAPPED +.\"O and +.\"O .B AI_ALL +.\"O are specified in +.\"O .IR hints.ai_family , +.\"O then return both IPv6 and IPv4-mapped IPv6 addresses +.\"O in the list pointed to by +.\"O .IR res . +.I hints.ai_family +¤Ë +.B AI_V4MAPPED +¤È +.B AI_ALL +¤ÎξÊý¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.I res +¤¬»Ø¤¹¥ê¥¹¥È¤Ë¤Ï IPv6 ¥¢¥É¥ì¥¹¤È IPv4-mapped IPv6 ¥¢¥É¥ì¥¹¤Î +ξÊý¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .B AI_ALL +.\"O is ignored if +.\"O .B AI_V4MAPPED +.\"O is not also specified. +.B AI_V4MAPPED +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.B AI_ALL +¤Ï̵»ë¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR freeaddrinfo () +.\"O function frees the memory that was allocated +.\"O for the dynamically allocated linked list +.\"O .IR res . +.BR freeaddrinfo () +´Ø¿ô¤Ï¡¢ +¥ê¥ó¥¯¥ê¥¹¥È +.I res +¤ËÂФ·¤ÆưŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£ +.\"O .SS "Extensions to getaddrinfo() for Internationalized Domain Names" +.SS "¹ñºÝ²½¥É¥á¥¤¥ó̾¤Î¤¿¤á¤Î getaddrinfo() ¤Î³ÈÄ¥" +.PP +.\"O Starting with glibc 2.3.4, +.\"O .BR getaddrinfo () +.\"O has been extended to selectively allow the incoming and outgoing +.\"O hostnames to be transparently converted to and from the +.\"O Internationalized Domain Name (IDN) format (see RFC 3490, +.\"O .IR "Internationalizing Domain Names in Applications (IDNA)" ). +.\"O Four new flags are defined: +glibc 2.3.4 ¤«¤é¡¢ +.BR getaddrinfo () +¤ÏÆþ½ÐÎϤ¹¤ë¥Û¥¹¥È̾¤òÆ©²áŪ¤Ë¹ñºÝ²½¥É¥á¥¤¥ó̾ (IDN) ·Á¼° (RFC 3490 ¤Î +.I "Internationalizing Domain Names in Applications (IDNA)" +¤ò»²¾È¤Î¤³¤È) ¤ÈÊÑ´¹¤¹¤ë¤³¤È¤òÁªÂòŪ¤Ëǧ¤á¤ë¤è¤¦¤Ë³ÈÄ¥¤µ¤ì¤Æ¤¤¤ë¡£ +4 ¤Ä¤Î¿·¤·¤¤¥Õ¥é¥°¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.TP +.B AI_IDN +.\"O If this flag is specified, then the node name given in +.\"O .I node +.\"O is converted to IDN format if necessary. +.\"O The source encoding is that of the current locale. +¤³¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤ë¤È¡¢ +.I node +¤ÇÍ¿¤¨¤é¤ì¤¿¥Î¡¼¥É̾¤ÏɬÍפ¬¤¢¤ì¤Ð IDN ·Á¼°¤ËÊÑ´¹¤µ¤ì¤ë¡£ +¥½¡¼¥¹Éä¹æ²½·Á¼°¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î¤â¤Î¤Ç¤¢¤ë¡£ + +.\"O If the input name contains non-ASCII characters, then the IDN encoding +.\"O is used. +.\"O Those parts of the node name (delimited by dots) that contain +.\"O non-ASCII characters are encoded using ASCII Compatible Encoding (ACE) +.\"O before being passed to the name resolution functions. +ÆþÎÏ̾¤ËÈó ASCII ʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +IDN Éä¹æ²½·Á¼°¤¬»È¤ï¤ì¤ë¡£ +Èó ASCII ʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë(¥Ô¥ê¥ª¥É¤Ç¶èÀÚ¤é¤ì¤ë)Éôʬ¥Î¡¼¥É̾¤Ï¡¢ +̾Á°²ò·èµ¡Ç½¤ËÅϤµ¤ì¤ëÁ°¤Ë ASCII ¸ß´¹Éä¹æ²½·Á¼° (ACE) ¤ò»È¤Ã¤Æ +Éä¹æ²½¤µ¤ì¤ë¡£ +.\" Implementation Detail: +.\" To minimize effects on system performance the implementation might +.\" want to check whether the input string contains any non-ASCII +.\" characters. If there are none the IDN step can be skipped completely. +.\" On systems which allow not-ASCII safe encodings for a locale this +.\" might be a problem. +.TP +.B AI_CANONIDN +.\"O After a successful name lookup, and if the +.\"O .B AI_CANONNAME +.\"O flag was specified, +.\"O .BR getaddrinfo () +.\"O will return the canonical name of the +.\"O node corresponding to the +.\"O .I addrinfo +.\"O structure value passed back. +.\"O The return value is an exact copy of the value returned by the name +.\"O resolution function. +.B AI_CANONNAME +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR getaddrinfo () +¤Ï̾Á°¤Î¸¡º÷¤ËÀ®¸ù¤·¤¿¸å¡¢ +ÊÖ¤µ¤ì¤¿ +.I addrinfo +¹½Â¤ÂΤËÂбþ¤¹¤ë¥Î¡¼¥É¤ÎÀµµ¬Ì¾¤òÊÖ¤¹¡£ +ÊÖ¤êÃͤÏ̾Á°²ò·èµ¡Ç½¤«¤éÊÖ¤µ¤ì¤¿ÃͤÎÀµ³Î¤Ê¥³¥Ô¡¼¤Ç¤¢¤ë¡£ + +.\"O If the name is encoded using ACE, then it will contain the +.\"O .I xn\-\- +.\"O prefix for one or more components of the name. +.\"O To convert these components into a readable form the +.B AI_CANONIDN +.\"O flag can be passed in addition to +.\"O .BR AI_CANONNAME . +.\"O The resulting string is encoded using the current locale's encoding. +̾Á°¤¬ ACE ¤ÇÉä¹æ²½¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢°ì¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î̾Á°¤Î¹½À®Í×ÁǤÎÀèƬ¤Ë +.I xn\-\- +¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +¤³¤ì¤é¤Î¹½À®Í×ÁǤòÆɤ߹þ¤ß²Äǽ¤Ê·Á¤ËÊÑ´¹¤¹¤ë¤¿¤á¤Ë¡¢ +.B AI_CANONNAME +¤È¶¦¤Ë +.B AI_CANONIDN +¥Õ¥é¥°¤òÅϤ¹¤³¤È¤â½ÐÍè¤ë¡£ +ÊÖ¤µ¤ì¤ëʸ»úÎó¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤ÎÉä¹æ²½·Á¼°¤ÇÉä¹æ²½¤µ¤ì¤Æ¤¤¤ë¡£ +.\" +.\"Implementation Detail: +.\"If no component of the returned name starts with xn\-\- the IDN +.\"step can be skipped, therefore avoiding unnecessary slowdowns. +.TP +.BR AI_IDN_ALLOW_UNASSIGNED ", " AI_IDN_USE_STD3_ASCII_RULES +.\"O Setting these flags will enable the +.\"O IDNA_ALLOW_UNASSIGNED (allow unassigned Unicode code points) and +.\"O IDNA_USE_STD3_ASCII_RULES (check output to make sure it is a STD3 +.\"O conforming hostname) +.\"O flags respectively to be used in the IDNA handling. +¤³¤ì¤é¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤ë¤È¡¢ +IDNA ¥Ï¥ó¥É¥ê¥ó¥°¤ò»È¤¦¤È¤­¤Ë¤½¤ì¤¾¤ì +IDNA_ALLOW_UNASSIGNED (Èó³ä¤êÅö¤Æ Unicode ¥³¡¼¥É¥Ý¥¤¥ó¥È¤òµö²Ä¤¹¤ë) ¤È +IDNA_USE_STD3_ASCII_RULES (½ÐÎϤ¬ STD3 ½àµò¥Û¥¹¥È̾¤Ç¤¢¤ë¤³¤È¤ò³Îǧ¤¹¤ë) +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤ë¡£ + +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\" FIXME glibc defines the following additional errors, some which +.\" can probably be returned by getaddrinfo(); they need to +.\" be documented. +.\" #ifdef __USE_GNU +.\" #define EAI_INPROGRESS -100 /* Processing request in progress. */ +.\" #define EAI_CANCELED -101 /* Request canceled. */ +.\" #define EAI_NOTCANCELED -102 /* Request not canceled. */ +.\" #define EAI_ALLDONE -103 /* All requests done. */ +.\" #define EAI_INTR -104 /* Interrupted by a signal. */ +.\" #define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ +.\" #endif +.\"O .BR getaddrinfo () +.\"O returns 0 if it succeeds, or one of the following nonzero error codes: +.BR getaddrinfo () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤¹¤ë¤È°Ê²¼¤ÎÈó 0 ¤Î¥¨¥é¡¼¥³¡¼¥É¤Î¤¤¤º¤ì¤«¤òÊÖ¤¹¡£ +.TP +.B EAI_ADDRFAMILY +.\" Not in SUSv3 +.\"O The specified network host does not have any network addresses in the +.\"O requested address family. +»ØÄꤵ¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Ë¤Ï¡¢ +Í׵ᤵ¤ì¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¤Ê¤¤¡£ +.TP +.B EAI_AGAIN +.\"O The name server returned a temporary failure indication. +.\"O Try again later. +¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é°ì»þŪ¤Ê¼ºÇÔ (temporary failure) +¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£¸å¤Ç¤â¤¦°ìÅٻ¤Æ¤ß¤è¡£ +.TP +.B EAI_BADFLAGS +.\"O .I hints.ai_flags +.\"O contains invalid flags; or, +.\"O .I hints.ai_flags +.\"O included +.\"O .B AI_CANONNAME +.\"O and +.\"O .I name +.\"O was NULL. +.I hints.ai_flags +¤Î¥Õ¥é¥°¤ËÉÔÀµ¤Ê¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£¤Þ¤¿¤Ï¡¢ +.I hints.ai_flags +¤Ë +.B AI_CANONNAME +¤¬´Þ¤Þ¤ì¤Æ¤¤¤Æ¡¢¤«¤Ä +.I name +¤¬ NULL ¤Ç¤¢¤Ã¤¿¡£ +.TP +.B EAI_FAIL +.\"O The name server returned a permanent failure indication. +¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é¹±µ×Ū¤Ê¼ºÇÔ (permanent failure) +¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£ +.TP +.B EAI_FAMILY +.\"O The requested address family is not supported. +Í׵ᤵ¤ì¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EAI_MEMORY +.\"O Out of memory. +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B EAI_NODATA +.\" Not in SUSv3 +.\"O The specified network host exists, but does not have any +.\"O network addresses defined. +»ØÄꤵ¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Ï¸ºß¤¹¤ë¤¬¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¤Ò¤È¤Ä¤âÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EAI_NONAME +.\"O The +.\"O .I node +.\"O or +.\"O .I service +.\"O is not known; or both +.\"O .I node +.\"O and +.\"O .I service +.\"O are NULL; or +.\"O .B AI_NUMERICSERV +.\"O was specified in +.\"O .I hints.ai_flags +.\"O and +.\"O .I service +.\"O was not a numeric port-number string. +.I node +¤È +.I service +¤Î¤É¤Á¤é¤«¤¬ÉÔÌÀ¡¢¤Þ¤¿¤Ï +.I node +¤È +.I service +¤ÎξÊý¤¬ NULL ¤À¤Ã¤¿¾ì¹ç¡¢¤Þ¤¿¤Ï +.B AI_NUMERICSERV +¤¬ +.I hints.ai_flags +¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.I hints.ai_flags +¤È +.I service +¤¬¿ôÃͤΥݡ¼¥ÈÈÖ¹æ¤Îʸ»úÎó¤Ç¤Ê¤¤¡£ +.TP +.B EAI_SERVICE +.\"O The requested service is not available for the requested socket type. +.\"O It may be available through another socket type. +Í׵ᤵ¤ì¤¿¥µ¡¼¥Ó¥¹¤Ï¡¢Í׵ᤵ¤ì¤¿¥½¥±¥Ã¥È¥¿¥¤¥×¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +¾¤Î¥½¥±¥Ã¥È¥¿¥¤¥×¤Ç¤Ê¤éÍøÍѲÄǽ¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O For example, this error could occur if +.\"O .I service +.\"O was "shell" (a service only available on stream sockets), and either +.\"O .I hints.ai_protocol +.\"O was +.\"O .BR IPPROTO_UDP , +.\"O or +.\"O .I hints.ai_socktype +.\"O was +.\"O .BR SOCK_DGRAM ; +.\"O or the error could occur if +.\"O .I service +.\"O was not NULL, and +.\"O .I hints.ai_socktype +.\"O was +.\"O .BR SOCK_RAW +.\"O (a socket type that does not support the concept of services). +¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ëÎã¤È¤·¤Æ¤Ï¡¢ +.I service +¤¬ "shell" (¥¹¥È¥ê¡¼¥à¡¦¥½¥±¥Ã¥È¤Ç¤Î¤ßÍøÍѤǤ­¤ë¥µ¡¼¥Ó¥¹) ¤Ç¡¢ +.I hints.ai_protocol +¤Ë +.B IPPROTO_UDP +¤¬»ØÄꤵ¤ì¤¿¤ê¡¢ +.I hints.ai_socktype +¤Ë +.B SOCK_DGRAM +¤¬»ØÄꤵ¤ì¤¿¤ê¤·¤¿¾ì¹ç¤¬¤¢¤ë¡£ +¤Þ¤¿¡¢ +.I service +¤¬ NULL °Ê³°¤Ç¡¢ +.I hints.ai_socktype +¤Ë +.B SOCK_RAW +(¥µ¡¼¥Ó¥¹¤Î¹Í¤¨Êý¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¼ïÊÌ) +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤â¡¢¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¡£ +.TP +.B EAI_SOCKTYPE +.\"O The requested socket type is not supported. +Í׵ᤵ¤ì¤¿¥½¥±¥Ã¥È¥¿¥¤¥×¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O This could occur, for example, if +.\"O .I hints.ai_socktype +.\"O and +.\"O .I hints.ai_protocol +.\"O are inconsistent (e.g., +.\"O .BR SOCK_DGRAM +.\"O and +.\"O .BR IPPROTO_TCP , +.\"O respectively). +¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ëÎã¤È¤·¤Æ¤Ï¡¢ +.I hints.ai_socktype +¤È +.I hints.ai_protocol +¤¬Ì·½â¤·¤Æ¤¤¤ë¾ì¹ç (Î㤨¤Ð +.I hints.ai_socktype +¤¬ +.B SOCK_DGRAM +¤Ç +.I hints.ai_protocol +¤¬ +.BR IPPROTO_TCP ) +¤¬¤¢¤ë¡£ +.TP +.B EAI_SYSTEM +.\"O Other system error, check +.\"O .I errno +.\"O for details. +¤½¤Î¾¤Î¥·¥¹¥Æ¥à¥¨¥é¡¼¡£¾Ü¤·¤¯¤Ï +.I errno +¤òÄ´¤Ù¤ë¤³¤È¡£ +.PP +.\"O The +.\"O .BR gai_strerror () +.\"O function translates these error codes to a human readable string, +.\"O suitable for error reporting. +.BR gai_strerror () +´Ø¿ô¤òÍѤ¤¤ë¤È¡¢¤³¤ì¤é¤Î¥¨¥é¡¼¥³¡¼¥É¤ò¿Í´Ö¤Ë²ÄÆɤÊʸ»úÎó¤ËÊÑ´¹¤Ç¤­¤ë¤Î¤Ç¡¢ +¥¨¥é¡¼Êó¹ð¤ËŬ¤¹¤ë¤À¤í¤¦¡£ +.\"O .SH "FILES" +.SH ¥Õ¥¡¥¤¥ë +.I /etc/gai.conf +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O POSIX.1-2001. +.\"O The +.\"O .BR getaddrinfo () +.\"O function is documented in RFC\ 2553. +POSIX.1-2001. +.BR getaddrinfo () +´Ø¿ô¤Ï RFC 2553 ¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "NOTES" +.SH Ãí°Õ +.\"O .BR getaddrinfo () +.\"O supports the +.\"O .IB address % scope-id +.\"O notation for specifying the IPv6 scope-ID. +.BR getaddrinfo () +¤Ï¡¢IPv6 scope-ID ¤ò»ØÄꤹ¤ë¤¿¤á¤Ë +.IB address % scope-id +µ­Ë¡¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ + +.\"O .BR AI_ADDRCONFIG , +.\"O .BR AI_ALL , +.\"O and +.\"O .B AI_V4MAPPED +.\"O are available since glibc 2.3.3. +.\"O .B AI_NUMERICSERV +.\"O is available since glibc 2.3.4. +.BR AI_ADDRCONFIG , +.BR AI_ALL , +.B AI_V4MAPPED +¤Ï glibc 2.3.3 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.B AI_NUMERICSERV +¤Ï glibc 2.3.4 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ + +.\"O According to POSIX.1-2001, specifying +.\"O .I hints +.\"O as NULL should cause +.\"O .I ai_flags +.\"O to be assumed as 0. +.\"O The GNU C library instead assumes a value of +.\"O .BR "(AI_V4MAPPED\ |\ AI_ADDRCONFIG)" +.\"O for this case, +.\"O since this value is considered an improvement on the specification. +POSIX.1-2001 ¤Ë¤è¤ë¤È¡¢ +.I hints +¤Ë NULL ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.I ai_flags +¤ò 0 ¤È¤ß¤Ê¤¹¤Ù¤­¤È¤µ¤ì¤Æ¤¤¤ë¡£ +GNU C ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¡¢Âå¤ï¤ê¤Ë +.I ai_flags +¤ò +.BR "(AI_V4MAPPED\ |\ AI_ADDRCONFIG)" +¤È¤ß¤Ê¤¹¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤³¤ÎÃͤÎÊý¤¬É¸½àµ¬³Ê¤Î²þÁ±¤Ë¤Ê¤ë¤È¹Í¤¨¤é¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\" getnameinfo.3 refers to this example +.\" socket.2 refers to this example +.\" bind.2 refers to this example +.\" connect.2 refers to this example +.\" recvfrom.2 refers to this example +.\" sendto.2 refers to this example +.\"O The following programs demonstrate the use of +.\"O .BR getaddrinfo (), +.\"O .BR gai_strerror (), +.\"O .BR freeaddrinfo (), +.\"O and +.\"O .BR getnameinfo (3). +.\"O The programs are an echo server and client for UDP datagrams. +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +.BR getaddrinfo (), +.BR gai_strerror (), +.BR freeaddrinfo (), +.BR getnameinfo (3) +¤Î»È¤¤Êý¤ò¼¨¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¥×¥í¥°¥é¥à¤Ï UDP ¥Ç¡¼¥¿¥°¥é¥à¤Î echo ¥µ¡¼¥Ð¤È¥¯¥é¥¤¥¢¥ó¥È¤Ç¤¢¤ë¡£ +.\"O .SS Server program +.SS ¥µ¡¼¥Ð¤Î¥×¥í¥°¥é¥à +\& +.nf +#include +#include +#include +#include +#include +#include +#include + +#define BUF_SIZE 500 + +int +main(int argc, char *argv[]) +{ + struct addrinfo hints; + struct addrinfo *result, *rp; + int sfd, s; + struct sockaddr_storage peer_addr; + socklen_t peer_addr_len; + ssize_t nread; + char buf[BUF_SIZE]; + + if (argc != 2) { + fprintf(stderr, "Usage: %s port\\n", argv[0]); + exit(EXIT_FAILURE); + } + + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ + hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */ + hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */ + hints.ai_protocol = 0; /* Any protocol */ + hints.ai_canonname = NULL; + hints.ai_addr = NULL; + hints.ai_next = NULL; + + s = getaddrinfo(NULL, argv[1], &hints, &result); + if (s != 0) { + fprintf(stderr, "getaddrinfo: %s\\n", gai_strerror(s)); + exit(EXIT_FAILURE); + } + + /* getaddrinfo() returns a list of address structures. + Try each address until we successfully bind(2). + If socket(2) (or bind(2)) fails, we (close the socket + and) try the next address. */ + + for (rp = result; rp != NULL; rp = rp\->ai_next) { + sfd = socket(rp\->ai_family, rp\->ai_socktype, + rp\->ai_protocol); + if (sfd == \-1) + continue; + + if (bind(sfd, rp\->ai_addr, rp\->ai_addrlen) == 0) + break; /* Success */ + + close(sfd); + } + + if (rp == NULL) { /* No address succeeded */ + fprintf(stderr, "Could not bind\\n"); + exit(EXIT_FAILURE); + } + + freeaddrinfo(result); /* No longer needed */ + + /* Read datagrams and echo them back to sender */ + + for (;;) { + peer_addr_len = sizeof(struct sockaddr_storage); + nread = recvfrom(sfd, buf, BUF_SIZE, 0, + (struct sockaddr *) &peer_addr, &peer_addr_len); + if (nread == \-1) + continue; /* Ignore failed request */ + + char host[NI_MAXHOST], service[NI_MAXSERV]; + + s = getnameinfo((struct sockaddr *) &peer_addr, + peer_addr_len, host, NI_MAXHOST, + service, NI_MAXSERV, NI_NUMERICSERV); + if (s == 0) + printf("Received %ld bytes from %s:%s\\n", + (long) nread, host, service); + else + fprintf(stderr, "getnameinfo: %s\\n", gai_strerror(s)); + + if (sendto(sfd, buf, nread, 0, + (struct sockaddr *) &peer_addr, + peer_addr_len) != nread) + fprintf(stderr, "Error sending response\\n"); + } +} +.fi +.\"O .SS Client program +.SS ¥¯¥é¥¤¥¢¥ó¥È¤Î¥×¥í¥°¥é¥à +\& +.nf +#include +#include +#include +#include +#include +#include +#include + +#define BUF_SIZE 500 + +int +main(int argc, char *argv[]) +{ + struct addrinfo hints; + struct addrinfo *result, *rp; + int sfd, s, j; + size_t len; + ssize_t nread; + char buf[BUF_SIZE]; + + if (argc < 3) { + fprintf(stderr, "Usage: %s host port msg...\\n", argv[0]); + exit(EXIT_FAILURE); + } + + /* Obtain address(es) matching host/port */ + + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ + hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */ + hints.ai_flags = 0; + hints.ai_protocol = 0; /* Any protocol */ + + s = getaddrinfo(argv[1], argv[2], &hints, &result); + if (s != 0) { + fprintf(stderr, "getaddrinfo: %s\\n", gai_strerror(s)); + exit(EXIT_FAILURE); + } + + /* getaddrinfo() returns a list of address structures. + Try each address until we successfully connect(2). + If socket(2) (or connect(2)) fails, we (close the socket + and) try the next address. */ + + for (rp = result; rp != NULL; rp = rp\->ai_next) { + sfd = socket(rp\->ai_family, rp\->ai_socktype, + rp\->ai_protocol); + if (sfd == \-1) + continue; + + if (connect(sfd, rp\->ai_addr, rp\->ai_addrlen) != \-1) + break; /* Success */ + + close(sfd); + } + + if (rp == NULL) { /* No address succeeded */ + fprintf(stderr, "Could not connect\\n"); + exit(EXIT_FAILURE); + } + + freeaddrinfo(result); /* No longer needed */ + + /* Send remaining command\-line arguments as separate + datagrams, and read responses from server */ + + for (j = 3; j < argc; j++) { + len = strlen(argv[j]) + 1; + /* +1 for terminating null byte */ + + if (len + 1 > BUF_SIZE) { + fprintf(stderr, + "Ignoring long message in argument %d\\n", j); + continue; + } + + if (write(sfd, argv[j], len) != len) { + fprintf(stderr, "partial/failed write\\n"); + exit(EXIT_FAILURE); + } + + nread = read(sfd, buf, BUF_SIZE); + if (nread == \-1) { + perror("read"); + exit(EXIT_FAILURE); + } + + printf("Received %ld bytes: %s\\n", (long) nread, buf); + } + + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.\" .BR getipnodebyaddr (3), +.\" .BR getipnodebyname (3) +.BR gethostbyname (3), +.BR getnameinfo (3), +.BR inet (3), +.BR hostname (7), +.BR ip (7) diff --git a/draft/man3/getcwd.3 b/draft/man3/getcwd.3 new file mode 100644 index 00000000..3c288d51 --- /dev/null +++ b/draft/man3/getcwd.3 @@ -0,0 +1,411 @@ +.\" 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 Wed Jul 21 22:35:42 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 18 Mar 1996 by Martin Schulze (joey@infodrom.north.de): +.\" Corrected description of getwd(). +.\" Modified Sat Aug 21 12:32:12 MET 1999 by aeb - applied fix by aj +.\" 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)¡× +.\" +.TH GETCWD 3 2009-03-31 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "char *getcwd(char *" buf ", size_t " size ); +.sp +.BI "char *getwd(char *" buf ); +.sp +.B "char *get_current_dir_name(void);" +.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 getcwd (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR get_current_dir_name (): +_GNU_SOURCE +.\"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 +·Ðͳ¤Ç¤âÊÖ¤µ¤ì¤ë¡£ + +.\"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 +ŤÎÇÛÎó¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +.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 +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤Î¥¨¥é¡¼¤ò¥Á¥§¥Ã¥¯¤·¡¢ +ɬÍפ˱þ¤¸¤Æ¤è¤êŤ¤¥Ð¥Ã¥Õ¥¡¤òÍÑ°Õ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.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) +¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"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) +¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"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 () +¤ÎÍøÍѤϿ侩¤µ¤ì¤Ê¤¤¡£ +.\"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 +¤ÈƱ¤¸Ãͤˤʤ롣 + +.\"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 +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O Permission to read or search a component of the filename was denied. +¥Õ¥¡¥¤¥ë̾¤Î¹½À®Í×ÁǤËÂФ¹¤ëÆɤ߹þ¤ß¤¢¤ë¤¤¤Ï¸¡º÷¤Î¸¢¸Â¤¬¤Ê¤¤¡£ +.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 +.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 +°ú¿ô¤ÎÃͤ¬¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ÎÀäÂХѥ¹Ì¾¤ÎŤµ¤è¤ê¾®¤µ¤¤¡£ +Ťµ¤Ë¤Ïʸ»úÎó¤Î½ªÃ¼¥Ð¥¤¥È¤â´Þ¤Þ¤ì¤ë¡£ +¤è¤êÂ礭¤¤ÇÛÎó¤ò³ÎÊݤ·¤Æ¤â¤¦°ìÅټ¹Ԥ¹¤ëɬÍפ¬¤¢¤ë¡£ +.\"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 () +¤ÎÆ°ºî¤òµ¬Äꤷ¤Ê¤¤¤Þ¤Þ¤È¤·¤Æ¤¤¤ë¡£ + +.\"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 () +¤Ë´Ø¤¹¤ë¥¨¥é¡¼¤òÄêµÁ¤·¤Æ¤¤¤Ê¤¤¡£ + +.\"O .BR get_current_dir_name () +.\"O is a GNU extension. +.BR get_current_dir_name () +¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.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 +¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.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" +.SH ´ØÏ¢¹àÌÜ +.BR chdir (2), +.BR fchdir (2), +.BR open (2), +.BR unlink (2), +.BR free (3), +.BR malloc (3) diff --git a/draft/man3/getdate.3 b/draft/man3/getdate.3 new file mode 100644 index 00000000..6530d965 --- /dev/null +++ b/draft/man3/getdate.3 @@ -0,0 +1,426 @@ +.\" Copyright 2001 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" 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. +.\" +.\" 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 +.\" +.\"WORD: broken-down time Í×ÁÇÊ̤λþ¹ï +.\" +.TH GETDATE 3 2008-09-07 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getdate, getdate_r \- convert a date-plus-time string to broken-down time +getdate, getdate_r \- ÆüÉդȻþ¹ï¤Îʸ»úÎó¤òÍ×ÁÇÊ̤λþ¹ï¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B "#define _XOPEN_SOURCE 500" +.br +.B "#include " +.sp +.BI "struct tm *getdate(const char *" string ); +.sp +.B "extern int getdate_err;" +.sp +.B "#define _GNU_SOURCE" +.br +.B "#include " +.sp +.BI "int getdate_r(const char *" string ", struct tm *" res ); +.\"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 ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.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) +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤ÈƱ¤¸)¡£ +.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) ¤À¤±»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +¸½ºß¤Î»þ´Ö¤Þ¤¿¤Ï¤½¤ì°Ê¹ß¤Ç¡¢¤½¤Î»ØÄê¤Ë¹çÃפ¹¤ëºÇ½é¤Î»þ´Ö¤¬ºÎÍѤµ¤ì¤ë¡£ + +.\"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" +.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 +¤ÎÊѹ¹¤Ë¤Ä¤¤¤Æ¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"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 +.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. +¥Õ¥¡¥¤¥ë¤Î¥¹¥Æ¡¼¥¿¥¹¾ðÊ󤬼èÆÀ¤Ç¤­¤Ê¤¤¡£ +.\" stat() +.TP +.B 4 +.\"O The template file is not a regular file. +¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤Ê¤¤¡£ +.TP +.B 5 +.\"O An error was encountered while reading the template file. +¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ßÃæ¤Ë¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B 6 +.\"O Memory allocation failed (not enough memory available). +.\"O .\" 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 +.B 8 +.\"O Invalid input specification. +ÆþÎÏ»ØÄ꤬Àµ¤·¤¯¤Ê¤¤¡£ +.\"O .SH ENVIRONMENT +.SH ´Ä¶­ÊÑ¿ô +.TP +.B DATEMSK +.\"O File containing format patterns. +½ñ¼°¥Ñ¥¿¡¼¥ó¤ò´Þ¤à¥Õ¥¡¥¤¥ë¡£ +.TP +.BR TZ ", " LC_TIME +.\"O Variables used by +.\"O .BR strptime (3). +.BR strptime (3) +¤¬ÍѤ¤¤ëÊÑ¿ô¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.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 +.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 +¹½Â¤ÂΤΥե£¡¼¥ë¥ÉÃͤòɽ¼¨¤¹¤ë¡£ +¼¡¤Î¥·¥§¥ë¡¦¥»¥Ã¥·¥ç¥ó¤Ï¡¢¥×¥í¥°¥é¥à¤ÎÆ°ºîÎã¤Ç¤¢¤ë¡£ + +.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" +Sun Sep 7 06:03:36 CEST 2008 +Call 1 ("Tuesday") succeeded: + tm_sec = 36 + tm_min = 3 + tm_hour = 6 + tm_mday = 9 + tm_mon = 8 + tm_year = 108 + tm_wday = 2 + tm_yday = 252 + tm_isdst = 1 +Call 2 ("2009-12-28") succeeded: + tm_sec = 36 + tm_min = 3 + tm_hour = 6 + tm_mday = 28 + tm_mon = 11 + tm_year = 109 + tm_wday = 1 + tm_yday = 361 + tm_isdst = 0 +Call 3 ("12:22:33") succeeded: + tm_sec = 33 + tm_min = 22 + tm_hour = 12 + tm_mday = 7 + tm_mon = 8 + tm_year = 108 + tm_wday = 0 + tm_yday = 250 + tm_isdst = 1 +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#define _GNU_SOURCE 500 +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct tm *tmp; + int j; + + for (j = 1; j < argc; j++) { + tmp = getdate(argv[j]); + + if (tmp == NULL) { + printf("Call %d failed; getdate_err = %d\\n", + 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); + } + + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR time (2), +.BR localtime (3), +.BR setlocale (3), +.BR strftime (3), +.BR strptime (3), +.BR feature_test_macros (7) diff --git a/draft/man3/getdirentries.3 b/draft/man3/getdirentries.3 new file mode 100644 index 00000000..914c42bb --- /dev/null +++ b/draft/man3/getdirentries.3 @@ -0,0 +1,111 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from /usr/include/dirent.h are: +.\" Copyright 1991, 1992 Free Software Foundation +.\" +.\" 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 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 +.SH ̾Á° +getdirentries \- ¥Ç¥£¥ì¥¯¥È¥ê¤Î¥¨¥ó¥È¥ê¤ò¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Ê¤¤·Á¼°¤Ç¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.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 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 +.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" +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR lseek (2), +.BR open (2) diff --git a/draft/man3/getenv.3 b/draft/man3/getenv.3 new file mode 100644 index 00000000..cfa4f24d --- /dev/null +++ b/draft/man3/getenv.3 @@ -0,0 +1,124 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's "POSIX Programmer's Guide" (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" 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 +.SH ̾Á° +getenv \- ´Ä¶­ÊÑ¿ô¤òÆÀ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *getenv(const char *" name ); +.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" +.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" +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD, C89, C99. +.\"O .SH NOTES +.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 () +¤Ï´Ä¶­¥ê¥¹¥ÈÆâ¤Îʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï¤³¤Îʸ»úÎó¤òÊѹ¹¤·¤Ê¤¤¤è¤¦¤ËÃí°Õ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Îʸ»úÎó¤òÊѹ¹¤¹¤ë¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Î´Ä¶­¤òÊѲ½¤µ¤»¤ë¤³¤È¤Ë¤Ê¤ë¤«¤é¤Ç¤¢¤ë¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR clearenv (3), +.BR putenv (3), +.BR setenv (3), +.BR unsetenv (3), +.BR environ (7) diff --git a/draft/man3/getfsent.3 b/draft/man3/getfsent.3 new file mode 100644 index 00000000..dded3597 --- /dev/null +++ b/draft/man3/getfsent.3 @@ -0,0 +1,212 @@ +.\" Copyright (C) 2002 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. +.\" +.\" Inspired by a page written by Walter Harms. +.\" +.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. +.\" Translated Wed 7 Aug 2002 by NAKANO Takeo +.\" +.TH GETFSENT 3 2002-02-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O getfsent, getfsspec, getfsfile, setfsent, endfsent \- handle fstab entries +.SH ̾Á° +getfsent, getfsspec, getfsfile, setfsent, endfsent \- fstab ¥¨¥ó¥È¥ê¤Î½èÍý +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B "void endfsent(void);" +.sp +.B "struct fstab *getfsent(void);" +.sp +.BI "struct fstab *getfsfile(const char *" mount_point ); +.sp +.BI "struct fstab *getfsspec(const char *" special_file ); +.sp +.B "int setfsent(void);" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These functions read from the file +.\"O .IR /etc/fstab . +.\"O The \fIstruct fstab\fP is defined by: +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I /etc/fstab +¥Õ¥¡¥¤¥ë¤«¤é¾ðÊó¤òÆɤ߹þ¤à¡£\fIfstab\fP ¹½Â¤ÂΤϼ¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +.in +4n +.nf +struct fstab { + char *fs_spec; /* block device name */ + char *fs_file; /* mount point */ + char *fs_vfstype; /* file-system type */ + char *fs_mntops; /* mount options */ + const char *fs_type; /* rw/rq/ro/sw/xx option */ + int fs_freq; /* dump frequency, in days */ + int fs_passno; /* pass number on parallel dump */ +}; +.fi +.in +.PP +.\"O Here the field +.\"O .I fs_type +.\"O contains (on a *BSD system) +.\"O one of the five strings "rw", "rq", "ro", "sw", "xx" +.\"O (read-write, read-write with quota, read-only, swap, ignore). +*BSD ¥·¥¹¥Æ¥à¤Î¾ì¹ç¡¢ +.I fs_type +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢5 ¤Ä¤Îʸ»úÎó +"rw", "rq", "ro", "sw", "xx" +¤Î¤¤¤º¤ì¤«¤¬Æþ¤ë +(¤½¤ì¤¾¤ì read-write, quota ÉÕ¤­ read-write, read-only, swap, ignore)¡£ + +.\"O The function +.\"O .BR setfsent () +.\"O opens the file when required and positions it at the first line. +´Ø¿ô +.BR setfsent () +¤Ï¸Æ¤Ó½Ð¤µ¤ì¤ë¤È fstab ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¡¢ +ºÇ½é¤Î¹Ô¤Ë°ÜÆ°¤¹¤ë¡£ +.LP +.\"O The function +.\"O .BR getfsent () +.\"O parses the next line from the file. +.\"O (After opening it when required.) +´Ø¿ô +.BR getfsent () +¤Ï fstab ¥Õ¥¡¥¤¥ë¤«¤é¼¡¤Î¹Ô¤ò¥Ñ¡¼¥¹¤¹¤ë +(ɬÍפʾì¹ç¤Ï¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë)¡£ +.LP +.\"O The function +.\"O .BR endfsent () +.\"O closes the file when required. +´Ø¿ô +.BR endfsent () +¤Ï¸Æ¤Ó½Ð¤µ¤ì¤ë¤È fstab ¥Õ¥¡¥¤¥ë¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.LP +.\"O The function +.\"O .BR getfsspec () +.\"O searches the file from the start and returns the first entry found +.\"O for which the +.\"O .I fs_spec +.\"O field matches the +.\"O .I special_file +.\"O argument. +´Ø¿ô +.BR getfsspec () +¤Ï fstab ¥Õ¥¡¥¤¥ë¤òÀèƬ¤«¤é¸¡º÷¤·¡¢ +.I fs_spec +¥Õ¥£¡¼¥ë¥É¤¬ +.I special_file +°ú¿ô¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤Ã¤¿¤é¡¢¤½¤ÎºÇ½é¤Î¤â¤Î¤òÊÖ¤¹¡£ +.LP +.\"O The function +.\"O .BR getfsfile () +.\"O searches the file from the start and returns the first entry found +.\"O for which the +.\"O .I fs_file +.\"O field matches the +.\"O .I mount_point +.\"O argument. +´Ø¿ô +.BR getfsfile () +¤Ï fstab ¥Õ¥¡¥¤¥ë¤òÀèƬ¤«¤é¸¡º÷¤·¡¢ +.I fs_file +¥Õ¥£¡¼¥ë¥É¤¬ +.I mount_point +°ú¿ô¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤Ã¤¿¤é¡¢¤½¤ÎºÇ½é¤Î¤â¤Î¤òÊÖ¤¹¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O Upon success, the functions +.\"O .BR getfsent (), +.\"O .BR getfsfile (), +.\"O and +.\"O .BR getfsspec () +.\"O return a pointer to a \fIstruct fstab\fP, while +.\"O .BR setfsent () +.\"O returns 1. +.\"O Upon failure or end-of-file, these functions return NULL and 0, respectively. +À®¸ù¤¹¤ë¤È¡¢ +.BR getfsent (), +.BR getfsfile (), +.BR getfsspec () +¤Î³Æ´Ø¿ô¤Ï \fIfstab\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤·¡¢ +.BR setfsent () +´Ø¿ô¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È¤³¤ì¤é¤Î´Ø¿ô¤Ï NULL ¤òÊÖ¤·¡¢ +end-of-file ¤Ë¤Ê¤Ã¤¿¤é 0 ¤òÊÖ¤¹¡£ +.\"O .\" .SH HISTORY +.\" .SH ÍúÎò +.\"O .\" The +.\"O .\" .BR getfsent () +.\"O .\" function appeared in 4.0BSD; the other four functions appeared in 4.3BSD. +.\" .BR getfsent () +.\" ´Ø¿ô¤Ï 4.0BSD ¤ÇÅо줷¤¿¡£ +.\" ¾¤Î 4 ¤Ä¤Î´Ø¿ô¤Ï 4.3BSD ¤ÇÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These functions are not in POSIX.1-2001. +.\"O Several operating systems have them, +.\"O e.g., *BSD, SunOS, Digital Unix, AIX (which also has a +.\"O .BR getfstype ()). +.\"O HP-UX has functions of the same names, +.\"O that however use a \fIstruct checklist\fP +.\"O instead of a \fIstruct fstab\fP, +.\"O and calls these functions obsolete, superseded by +.\"O .BR getmntent (3). +POSIX.1-2001 ¤Ë¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Ï¸ºß¤·¤Ê¤¤¡£ +¤³¤ì¤é¤Î´Ø¿ô¤ò¤â¤Ä OS ¤Ï¤¤¤¯¤Ä¤«¤¢¤ê¡¢ +*BSD, SunOS, Digital Unix, AIX Åù¤Ç¤¢¤ë +(AIX ¤Ë¤Ï +.BR getfstype () +¤â¤¢¤ë)¡£ +HP-UX ¤Ë¤âƱ̾¤Î´Ø¿ô·²¤¬¤¢¤ë¤¬¡¢ +HP-UX ¤Î¤â¤Î¤Ï \fIfstab\fP ¹½Â¤ÂΤǤϤʤ¯ \fIchecklist\fP ¹½Â¤ÂΤòÍѤ¤¤ë¡£ +¤Þ¤¿¤³¤ì¤é¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤Ï obsolete ¤Ç¡¢ +.BR getmntent (3) +¤Ë¼è¤Ã¤ÆÂå¤ï¤é¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O These functions are not thread-safe. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¡£ +.LP +.\"O Since Linux allows mounting a block special device in several places, +.\"O and since several devices can have the same mount point, where the +.\"O last device with a given mount point is the interesting one, +.\"O while +.\"O .BR getfsfile () +.\"O and +.\"O .BR getfsspec () +.\"O only return the first occurrence, these two functions are not suitable +.\"O for use under Linux. +Linux ¤Ç¤Ï¥Ö¥í¥Ã¥¯¥¹¥Ú¥·¥ã¥ë¥Ç¥Ð¥¤¥¹¤òÊ£¿ô¤Î¾ì½ê¤Ë¥Þ¥¦¥ó¥È¤Ç¤­¡¢ +¤Þ¤¿Ê£¿ô¤Î¥Ç¥Ð¥¤¥¹¤¬Æ±¤¸¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò¶¦Í­¤Ç¤­¤ë +(¤³¤Î¾ì¹ç¤Ï¤½¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ËºÇ¸å¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Ç¥Ð¥¤¥¹¤¬°ÕÌ£¤ò»ý¤Ä) +¤¬¡¢ +.BR getfsfile () +¤È +.BR getfsspec () +¤Ï¥Þ¥Ã¥Á¤·¤¿ºÇ½é¤Î¥¨¥ó¥È¥ê¤·¤«ÊÖ¤µ¤Ê¤¤¤Î¤Ç¡¢ +¤³¤ì¤é¤Î 2 ¤Ä¤Î´Ø¿ô¤Ï Linux ¤Ç¤ÎÍøÍѤˤÏŬ¤·¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getmntent (3), +.BR fstab (5) diff --git a/draft/man3/getgrent.3 b/draft/man3/getgrent.3 new file mode 100644 index 00000000..d14ec5fb --- /dev/null +++ b/draft/man3/getgrent.3 @@ -0,0 +1,212 @@ +.\" 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 Sat Jul 24 19:29:54 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-19, HIROFUMI Nishizuka +.\" Updated & Modified 2004-05-30, Yuichi SATO +.\" Updated & Modified 2005-09-06, Akihiro MOTOKI +.\" +.TH GETGRENT 3 2009-03-30 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getgrent, setgrent, endgrent \- get group file entry +getgrent, setgrent, endgrent \- ¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤Î¼èÆÀ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.B struct group *getgrent(void); +.sp +.B void setgrent(void); +.sp +.B void endgrent(void); +.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 getgrent (), +.BR setgrent (), +.BR endgrent (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR getgrent () +.\"O function returns a pointer to a structure containing +.\"O the broken-out fields of a record in the group database +.\"O (e.g., the local group file +.\"O .IR /etc/group , +.\"O NIS, and LDAP). +.\"O The first time it is called +.\"O it returns the first entry; thereafter, it returns successive entries. +.BR getgrent () +´Ø¿ô¤Ï¡¢¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¼èÆÀ¤·¤¿¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹ +(¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÎã: +¥í¡¼¥«¥ë¤Î¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë +.IR /etc/group , +NIS, LDAP)¡£ +ºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤ÏºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤·¡¢¤½¤ì°Ê¹ß¤Ï +¸Æ¤Ó½Ð¤µ¤ì¤ëËè¤Ë¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR setgrent () +.\"O function rewinds to the beginning +.\"O of the group database, to allow repeated scans. +.BR setgrent () +´Ø¿ô¤ò»È¤¦¤È¡¢¤â¤¦°ìÅÙÆɤ߹þ¤á¤ë¤è¤¦¤Ë¡¢ +¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀèƬ¤ËÌá¤ë¡£ +.PP +.\"O The +.\"O .BR endgrent () +.\"O function is used to close the group database +.\"O after all processing has been performed. +.BR endgrent () +´Ø¿ô¤Ï¡¢Á´¤Æ¤Î½èÍý¤¬½ª¤ï¤Ã¤¿¸å¤Ë¥°¥ë¡¼¥×¡¦ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +.\"O The \fIgroup\fP structure is defined in \fI\fP as follows: +\fIgroup\fP ¹½Â¤ÂΤϡ¢\fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct group { +.\"O char *gr_name; /* group name */ +.\"O char *gr_passwd; /* group password */ +.\"O gid_t gr_gid; /* group ID */ +.\"O char **gr_mem; /* group members */ + char *gr_name; /* ¥°¥ë¡¼¥×̾ */ + char *gr_passwd; /* ¥°¥ë¡¼¥×¤Î¥Ñ¥¹¥ï¡¼¥É */ + gid_t gr_gid; /* ¥°¥ë¡¼¥× ID */ + char **gr_mem; /* ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð */ +}; +.fi +.in +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR getgrent () +.\"O function returns a pointer to a +.\"O .I group +.\"O structure, +.\"O or NULL if there are no more entries or an error occurs. +.BR getgrent () +´Ø¿ô¤Ï +.I group +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ì°Ê¾å¥¨¥ó¥È¥ê¤¬Ìµ¤¤¤«¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.LP +.\"O Upon error, +.\"O .I errno +.\"O may be set. +.\"O If one wants to check +.\"O .I errno +.\"O after the call, it should be set to zero before the call. +¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +¤³¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¸å¤Ë +.I errno +¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢¸Æ¤Ó½Ð¤·Á°¤Ë +.I errno +¤ò 0 ¤ËÀßÄꤷ¤Æ¤ª¤«¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£ + +.\"O The return value may point to a static area, and may be overwritten +.\"O by subsequent calls to +.\"O .BR getgrent (), +.\"O .BR getgrgid (3), +.\"O or +.\"O .BR getgrnam (3). +.\"O (Do not pass the returned pointer to +.\"O .BR free (3).) +ÊÖ¤êÃͤÏÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤½¤Î¸å¤Î +.BR getgrent (), +.BR getgrgid (3), +.BR getgrnam (3) +¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +(ÊÖ¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤ò +.BR free (3) +¤ËÅϤµ¤Ê¤¤¤³¤È¡£) +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINTR +.\"O A signal was caught. +¥·¥°¥Ê¥ë¤¬¥­¥ã¥Ã¥Á¤µ¤ì¤¿¡£ +.TP +.B EIO +.\"O I/O error. +I/O ¥¨¥é¡¼¡£ +.TP +.B EMFILE +.\"O The calling process already has too many open files. +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬´û¤Ë¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·²á¤®¤Æ¤¤¤ë¡£ +.TP +.B ENFILE +.\"O Too many open files in the system. +¥·¥¹¥Æ¥à¾å¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¿²á¤®¤ë¡£ +.TP +.B ENOMEM +.\"O .\" not in POSIX +.\"O Insufficient memory to allocate +.\"O .I group +.\"O structure. +.\" POSIX ¤Ë¤Ï¤Ê¤¤¡£ +.I group +¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£ +.TP +.B ERANGE +.\"O Insufficient buffer space supplied. +½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/group +.\"O local group database file +¥í¡¼¥«¥ë¤Î¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fgetgrent (3), +.BR getgrent_r (3), +.BR getgrgid (3), +.BR getgrnam (3) +.BR getgrouplist (3), +.BR putgrent (3) diff --git a/draft/man3/getgrent_r.3 b/draft/man3/getgrent_r.3 new file mode 100644 index 00000000..5437c3ba --- /dev/null +++ b/draft/man3/getgrent_r.3 @@ -0,0 +1,264 @@ +.\" 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 29 02:26:07 JST 2004 +.\" by Yuichi SATO +.\" +.TH GETGRENT_R 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getgrent_r, fgetgrent_r \- get group file entry reentrantly +getgrent_r, fgetgrent_r \- ¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤ò¥ê¥¨¥ó¥È¥é¥ó¥È (reentrant) ¤Ë¼è¤ê½Ð¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getgrent_r(struct group *" gbuf ", char *" buf , +.br +.BI " size_t " buflen ", struct group **" gbufp ); +.sp +.BI "int fgetgrent_r(FILE *" fp ", struct group *" gbuf ", char *" buf , +.br +.BI " size_t " buflen ", struct group **" gbufp ); +.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 getgrent_r (): +_GNU_SOURCE +.\" FIXME . The FTM requirements seem inconsistent here. File a glibc bug? +.br +.BR fgetgrent_r (): +_SVID_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The functions +.\"O .BR getgrent_r () +.\"O and +.\"O .BR fgetgrent_r () +.\"O are the reentrant versions of +.\"O .BR getgrent (3) +.\"O and +.\"O .BR fgetgrent (3). +´Ø¿ô +.BR getgrent_r () +¤È +.BR fgetgrent_r () +¤Ï +.BR getgrent (3) +¤È +.BR fgetgrent (3) +¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤ¢¤ë¡£ +.\"O The former reads the next group entry from the stream initialized by +.\"O .BR setgrent (3). +Á°¼Ô¤Ï¡¢ +.BR setgrent (3) +¤Ë¤è¤Ã¤Æ½é´ü²½¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤«¤é¡¢¼¡¤Î¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à¡£ +.\"O The latter reads the next group entry from the stream +.\"O .IR fp . +¸å¼Ô¤Ï¡¢¥¹¥È¥ê¡¼¥à +.I fp +¤«¤é¼¡¤Î¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à¡£ +.PP +.\"O The \fIgroup\fP structure is defined in +.\"O .I +.\"O as follows: +\fIgroup\fP ¹½Â¤ÂÎ¤Ï +.I +¤Ë¤ª¤¤¤Æ°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct group { +.\"O char *gr_name; /* group name */ +.\"O char *gr_passwd; /* group password */ +.\"O gid_t gr_gid; /* group ID */ +.\"O char **gr_mem; /* group members */ + char *gr_name; /* ¥°¥ë¡¼¥×̾ */ + char *gr_passwd; /* ¥°¥ë¡¼¥×¥Ñ¥¹¥ï¡¼¥É */ + gid_t gr_gid; /* ¥°¥ë¡¼¥× ID */ + char **gr_mem; /* ¥°¥ë¡¼¥×¥á¥ó¥Ð */ +}; +.fi +.in +.sp +.\"O The nonreentrant functions return a pointer to static storage, +.\"O where this static storage contains further pointers to group +.\"O name, password and members. +¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ê¤¤´Ø¿ô¤ÏÀÅŪ¤Ê³ÊǼÎΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ÎÀÅŪ¤Ê³ÊǼÎΰè¤Ë¤Ï¡¢¹¹¤Ë¥°¥ë¡¼¥×̾¡¦¥Ñ¥¹¥ï¡¼¥É¡¦ +¥á¥ó¥Ð¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬´Þ¤Þ¤ì¤ë¡£ +.\"O The reentrant functions described here return all of that in +.\"O caller-provided buffers. +.\"O First of all there is the buffer +.\"O .I gbuf +.\"O that can hold a \fIstruct group\fP. +.\"O And next the buffer +.\"O .I buf +.\"O of size +.\"O .I buflen +.\"O that can hold additional strings. +¤³¤³¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê´Ø¿ô¤Ï¡¢ +¸Æ¤Ó½Ð¤·Â¦¤«¤éÄ󶡤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë¥°¥ë¡¼¥×̾¤Ê¤ÉÁ´¤Æ¤òÊÖ¤¹¡£ +ºÇ½é¤Î°ú¤­¿ô¤È¤·¤Æ \fIstruct group\fP ¤òÊÝ»ý¤Ç¤­¤ë¥Ð¥Ã¥Õ¥¡ +.I gbuf +¤¬¤¢¤ë¡£ +¼¡¤Ë¤½¤Î¾¤Îʸ»úÎó¤òÊÝ»ý¤Ç¤­¤ë¥µ¥¤¥º +.I buflen +¤Î¥Ð¥Ã¥Õ¥¡ +.I buf +¤¬¤¢¤ë¡£ +.\"O The result of these functions, the \fIstruct group\fP read from the stream, +.\"O is stored in the provided buffer +.\"O .IR *gbuf , +.\"O and a pointer to this \fIstruct group\fP is returned in +.\"O .IR *gbufp . +¤³¤ì¤é¤Î´Ø¿ô¤Î·ë²Ì (¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤Þ¤ì¤¿ \fIstruct group\fP) ¤Ï¡¢ +Ä󶡤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡ +.IR *gbuf +¤Ë³ÊǼ¤µ¤ì¡¢¤³¤Î \fIstruct group\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï +.IR *gbufp +¤ËÊÖ¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return 0 and +.\"O .RI * gbufp +.\"O is a pointer to the \fIstruct group\fP. +À®¸ù¤·¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï 0 ¤òÊÖ¤·¡¢ +.RI * gbufp +¤Ï \fIstruct group\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ë¡£ +.\"O On error, these functions return an error value and +.\"O .RI * gbufp +.\"O is NULL. +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¨¥é¡¼ÃͤòÊÖ¤·¡¢ +.RI * gbufp +¤Ï NULL ¤Ë¤Ê¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ENOENT +.\"O No more entries. +¼¡¤Î¥¨¥ó¥È¥ê¤¬¤Ê¤¤¡£ +.TP +.B ERANGE +.\"O Insufficient buffer space supplied. +.\"O Try again with larger buffer. +½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +¤â¤Ã¤ÈÂ礭¤Ê¥Ð¥Ã¥Õ¥¡¤ÇºÆÅټ¹Ԥ¹¤ë¤³¤È¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These functions are GNU extensions, done in a style resembling +.\"O the POSIX version of functions like +.\"O .BR getpwnam_r (3). +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ê¡¢POSIX ÈǤδؿô +.BR getpwnam_r (3) +¤Î·Á¼°¤Ë»÷¤»¤Æ¤¢¤ë¡£ +.\"O Other systems use prototype +¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï°Ê²¼¤Î¥×¥í¥È¥¿¥¤¥×¤¬»È¤ï¤ì¤Æ¤¤¤ë¡£ +.sp +.nf +.in +4n +struct group *getgrent_r(struct group *grp, char *buf, + int buflen); +.in +.fi +.sp +.\"O or, better, +¤è¤êÎɤ¤¤â¤Î¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.sp +.nf +.in +4n +int getgrent_r(struct group *grp, char *buf, int buflen, + FILE **gr_fp); +.in +.fi +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The function +.\"O .BR getgrent_r () +.\"O is not really reentrant since it shares the reading position +.\"O in the stream with all other threads. +´Ø¿ô +.BR getgrent_r () +¤ÏËÜÅö¤Î¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ï¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢¥¹¥È¥ê¡¼¥à¤ÎÆɤ߹þ¤ß°ÌÃÖ¤ò +¾¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤È¶¦Í­¤·¤Æ¤¤¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.nf +#define _GNU_SOURCE +#include +#include +#include +#define BUFLEN 4096 + +int +main(void) +{ + struct group grp, *grpp; + char buf[BUFLEN]; + int i; + + setgrent(); + while (1) { + i = getgrent_r(&grp, buf, BUFLEN, &grpp); + if (i) + break; + printf("%s (%d):", grpp\->gr_name, grpp\->gr_gid); + for (i = 0; ; i++) { + if (grpp\->gr_mem[i] == NULL) + break; + printf(" %s", grpp\->gr_mem[i]); + } + printf("\en"); + } + endgrent(); + exit(EXIT_SUCCESS); +} +.fi +.\"O .\" perhaps add error checking - should use strerror_r +.\" ¤¿¤Ö¤ó¥¨¥é¡¼¥Á¥§¥Ã¥¯¤òÄɲ䷤ơ¢strerror_r ¤ò»È¤¦¤Ù¤­¤À¤í¤¦¡£ +.\" #include +.\" #include +.\" if (i) { +.\" if (i == ENOENT) +.\" break; +.\" printf("getgrent_r: %s", strerror(i)); +.\" exit(EXIT_FAILURE); +.\" } +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fgetgrent (3), +.BR getgrent (3), +.BR getgrgid (3), +.BR getgrnam (3), +.BR putgrent (3), +.BR group (5) diff --git a/draft/man3/getgrnam.3 b/draft/man3/getgrnam.3 new file mode 100644 index 00000000..ade52368 --- /dev/null +++ b/draft/man3/getgrnam.3 @@ -0,0 +1,371 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" 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-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2003-11-15 by aeb +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-19, HIROFUMI Nishizuka +.\" Updated & Modefied 1999-02-26, Shouichi Saito +.\" Updated & Modified 2004-06-05, Yuichi SATO +.\" Updated & Modified 2005-09-06, Akihiro MOTOKI +.\" Updated 2008-12-24, Akihiro MOTOKI, LDP v3.14 +.\" +.TH GETGRNAM 3 2009-03-30 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getgrnam, getgrnam_r, getgrgid, getgrgid_r \- get group file entry +getgrnam, getgrnam_r, getgrgid, getgrgid_r \- ¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤Î¼è¤ê½Ð¤· +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "struct group *getgrnam(const char *" name ); +.sp +.BI "struct group *getgrgid(gid_t " gid ); +.sp +.BI "int getgrnam_r(const char *" name ", struct group *" grp , +.br +.BI " char *" buf ", size_t " buflen ", struct group **" result ); +.sp +.BI "int getgrgid_r(gid_t " gid ", struct group *" grp , +.br +.BI " char *" buf ", size_t " buflen ", struct group **" result ); +.fi +.sp +.in -4n +.\"O Feature Test Macro Requirements for glibc (see +.\"O .BR feature_test_macros (7)): +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.ad l +.in +.sp +.BR getgrnam_r (), +.BR getgrgid_r (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR getgrnam () +.\"O function returns a pointer to a structure containing +.\"O the broken-out fields of the record in the group database +.\"O (e.g., the local group file +.\"O .IR /etc/group , +.\"O NIS, and LDAP) +.\"O that matches the group name +.\"O .IR name . +.BR getgrnam () +´Ø¿ô¤Ï¡¢¥°¥ë¡¼¥×̾ +.I name +¤Ë¥Þ¥Ã¥Á¤¹¤ë¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹ +(¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÎã: +¥í¡¼¥«¥ë¤Î¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë +.IR /etc/group , +NIS, LDAP)¡£ +.PP +.\"O The +.\"O .BR getgrgid () +.\"O function returns a pointer to a structure containing +.\"O the broken-out fields of the record in the group database +.\"O that matches the group ID +.\"O .IR gid . +.BR getgrgid () +´Ø¿ô¤Ï¡¢¥°¥ë¡¼¥× ID +.I uid +¤Ë¥Þ¥Ã¥Á¤¹¤ë¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR getgrnam_r () +.\"O and +.\"O .BR getgrgid_r () +.\"O functions obtain the same information, but store the retrieved +.\"O .I group +.\"O structure +.\"O in the space pointed to by +.\"O .IR grp . +.BR getgrnam_r () +¤È +.BR getgrgid_r () +´Ø¿ô¤Ï (¾åµ­¤Î´Ø¿ô¤È) Ʊ¤¸¾ðÊó¤ò¼èÆÀ¤¹¤ë¤¬¡¢ +¼èÆÀ¤·¤¿ +.I group +¹½Â¤ÂΤò +.I grp +¤¬»Ø¤¹Îΰè¤Ë³ÊǼ¤¹¤ë¡£ +.\"O This +.\"O .I group +.\"O structure contains pointers to strings, and these strings +.\"O are stored in the buffer +.\"O .I buf +.\"O of size +.\"O .IR buflen . +¤³¤Î +.I group +¹½Â¤ÂΤˤÏʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬´Þ¤Þ¤ì¡¢ +¤³¤ì¤é¤Îʸ»úÎó¤Ï¥µ¥¤¥º +.I buflen +¤Î¥Ð¥Ã¥Õ¥¡ +.I buf +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.\"O A pointer to the result (in case of success) or NULL (in case no entry +.\"O was found or an error occurred) is stored in +.\"O .IR *result . +À®¸ù¤·¤¿¾ì¹ç +.I *gbufp +¤Ë¤Ï·ë²Ì¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬³ÊǼ¤µ¤ì¤ë¡£ +¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤ä¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤Ï +.I *result +¤Ë¤Ï NULL ¤¬Æþ¤ë¡£ +.PP +.\"O The \fIgroup\fP structure is defined in \fI\fP as follows: +\fIgroup\fP ¹½Â¤ÂΤϡ¢\fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct group { +.\"O char *gr_name; /* group name */ +.\"O char *gr_passwd; /* group password */ +.\"O gid_t gr_gid; /* group ID */ +.\"O char **gr_mem; /* group members */ + char *gr_name; /* ¥°¥ë¡¼¥×̾ */ + char *gr_passwd; /* ¥°¥ë¡¼¥×¤Î¥Ð¥¹¥ï¡¼¥É */ + gid_t gr_gid; /* ¥°¥ë¡¼¥× ID */ + char **gr_mem; /* ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð */ +}; +.fi +.in +.PP +.\"O The maximum needed size for +.\"O .I buf +.\"O can be found using +.\"O .BR sysconf (3) +.\"O with the argument +.\"O .BR _SC_GETGR_R_SIZE_MAX . +.I buf +¤ËºÇÂçɬÍפʥµ¥¤¥º¤Ï¡¢ +.BR sysconf (3) +¤Ë°ú¤­¿ô +.B _SC_GETGR_R_SIZE_MAX +¤ò»ØÄꤷ¤Æ¼Â¹Ô¤¹¤ë¤³¤È¤Çʬ¤«¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR getgrnam () +.\"O and +.\"O .BR getgrgid () +.\"O functions return a pointer to a +.\"O .I group +.\"O structure, or NULL if the matching entry +.\"O is not found or an error occurs. +.BR getgrnam () +¤È +.BR getgrgid () +´Ø¿ô¤Ï¡¢ +.I group +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤ä¡¢ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.\"O If an error occurs, +.\"O .I errno +.\"O is set appropriately. +.\"O If one wants to check +.\"O .I errno +.\"O after the call, it should be set to zero before the call. +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¤Î¸å¤Ç +.I errno +¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢ +¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë (¤³¤ÎÃͤò) 0 ¤ËÀßÄꤷ¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.LP +.\"O The return value may point to a static area, and may be overwritten +.\"O by subsequent calls to +.\"O .BR getgrent (3), +.\"O .BR getgrgid (), +.\"O or +.\"O .BR getgrnam (). +.\"O (Do not pass the returned pointer to +.\"O .BR free (3).) +ÊÖ¤êÃͤÏÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤½¤Î¸å¤Î +.BR getgrent (3), +.BR getgrgid (), +.BR getgrnam () +¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +(ÊÖ¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤ò +.BR free (3) +¤ËÅϤµ¤Ê¤¤¤³¤È¡£) +.LP +.\"O On success, +.\"O .BR getgrnam_r () +.\"O and +.\"O .BR getgrgid_r () +.\"O return zero, and set +.\"O .IR *result +.\"O to +.\"O .IR grp . +.\"O If no matching group record was found, +.\"O these functions return 0 and store NULL in +.\"O .IR *result . +.\"O In case of error, an error number is returned, and NULL is stored in +.\"O .IR *result . +À®¸ù¤¹¤ë¤È¡¢ +.BR getgrnam_r () +¤È +.BR getgrgid_r () +¤Ï 0 ¤òÊÖ¤·¡¢ +.I *result +¤Ë +.I grp +¤òÀßÄꤹ¤ë¡£ +¥Þ¥Ã¥Á¤¹¤ë¥°¥ë¡¼¥×¡¦¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +0 ¤òÊÖ¤·¡¢ +.I *result +¤Ë NULL ¤òÀßÄꤹ¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤·¡¢ +.I *result +¤Ë NULL ¤òÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.\"O .BR 0 " or " ENOENT " or " ESRCH " or " EBADF " or " EPERM " or ... " +.BR 0 " ¤Þ¤¿¤Ï " ENOENT " ¤Þ¤¿¤Ï " ESRCH " ¤Þ¤¿¤Ï " EBADF " ¤Þ¤¿¤Ï " EPERM " ¤Þ¤¿¤Ï ... " +.\"O The given +.\"O .I name +.\"O or +.\"O .I gid +.\"O was not found. +»ØÄꤵ¤ì¤¿ +.I name +¤Þ¤¿¤Ï +.I gid +¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINTR +.\"O A signal was caught. +¥·¥°¥Ê¥ë¤¬¥­¥ã¥Ã¥Á¤µ¤ì¤¿¡£ +.TP +.B EIO +.\"O I/O error. +I/O ¥¨¥é¡¼¡£ +.TP +.B EMFILE +.\"O The maximum number +.\"O .RB ( OPEN_MAX ) +.\"O of files was open already in the calling process. +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ë¤ª¤¤¤Æ¡¢ +´û¤ËºÇÂç¿ô +.RB ( OPEN_MAX ) +¤Î¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ENFILE +.\"O The maximum number of files was open already in the system. +¥·¥¹¥Æ¥à¾å¤Ç´û¤ËºÇÂç¿ô¤Î¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ENOMEM +.\"O .\" not in POSIX +.\"O Insufficient memory to allocate +.\"O .I group +.\"O structure. +.\"O .\" to allocate the group structure, or to allocate buffers +.\" POSIX ¤Ë¤Ï¤Ê¤¤ +.I group +¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£ +.\" ¥°¥ë¡¼¥×¾ðÊó¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¡¢¤Þ¤¿¤Ï¥Ð¥Ã¥Õ¥¡¤ò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î +.TP +.B ERANGE +.\"O Insufficient buffer space supplied. +Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬ÉÔ½½Ê¬¤Ç¤¢¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/group +.\"O local group database file +¥í¡¼¥«¥ë¤Î¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The formulation given above under "RETURN VALUE" is from POSIX.1-2001. +¾åµ­¤Î¡ÖÊÖ¤êÃ͡װʲ¼¤Îµ­½Ò¤Ï POSIX.1-2001 ¤Ëµò¤ë¡£ +.\"O It does not call "not found" an error, hence does not specify what value +.\"O .I errno +.\"O might have in this situation. +.\"O But that makes it impossible to recognize +.\"O errors. +.\"O One might argue that according to POSIX +.\"O .I errno +.\"O should be left unchanged if an entry is not found. +.\"O Experiments on various +.\"O Unix-like systems shows that lots of different values occur in this +.\"O situation: 0, ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM and probably others. +¤³¤Îɸ½à¤Ï¡Ö(¥¨¥ó¥È¥ê¤¬) ¸«¤Ä¤«¤é¤Ê¤¤¤³¤È¡×¤ò¥¨¥é¡¼¤È¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢ +¤½¤Î¤è¤¦¤Ê¾ì¹ç¤Ë +.I errno +¤¬¤É¤Î¤è¤¦¤ÊÃͤˤʤ뤫¤òÄê¤á¤Æ¤¤¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢¥¨¥é¡¼¤òǧ¼±¤¹¤ë¤³¤È¤ÏÉÔ²Äǽ¤Ç¤¢¤ë¡£ +POSIX ¤Ë½àµò¤·¤Æ¡¢¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï +.I errno +¤òÊѹ¹¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡¢¤È¼çÄ¥¤¹¤ë¿Í¤â¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +ÍÍ¡¹¤Ê Unix ·Ï¤Î¥·¥¹¥Æ¥à¤Ç»î¤·¤Æ¤ß¤ë¤È¡¢¤½¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï +0, ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM ¤È¤¤¤Ã¤¿ÍÍ¡¹¤ÊÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +¾¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .\" more precisely: +.\"O .\" AIX 5.1 - gives ESRCH +.\"O .\" OSF1 4.0g - gives EWOULDBLOCK +.\"O .\" libc, glibc up to version 2.6, Irix 6.5 - give ENOENT +.\"O .\" glibc since version 2.7 - give 0 +.\"O .\" FreeBSD 4.8, OpenBSD 3.2, NetBSD 1.6 - give EPERM +.\"O .\" SunOS 5.8 - gives EBADF +.\"O .\" Tru64 5.1b, HP-UX-11i, SunOS 5.7 - give 0 +.\" ¤è¤êÀµ³Î¤Ë¤Ï: +.\" AIX 5.1 ¤Ï ESRCH ¤òÊÖ¤¹¡£ +.\" OSF1 4.0g ¤Ï EWOULDBLOCK ¤òÊÖ¤¹¡£ +.\" libc, glibc (¥Ð¡¼¥¸¥ç¥ó 2.6 ¤Þ¤Ç), Irix 6.5 ¤Ï ENOENT ¤òÊÖ¤¹¡£ +.\" glibc (¥Ð¡¼¥¸¥ç¥ó 2.7 °Ê¹ß) ¤Ï 0 ¤òÊÖ¤¹¡£ +.\" FreeBSD 4.8, OpenBSD 3.2, NetBSD 1.6 ¤Ï EPERM ¤òÊÖ¤¹¡£ +.\" SunOS 5.8 ¤Ï EBADF ¤òÊÖ¤¹¡£ +.\" Tru64 5.1b, HP-UX-11i, SunOS 5.7 ¤Ï 0 ¤òÊÖ¤¹¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR endgrent (3), +.BR fgetgrent (3), +.BR getgrent (3), +.BR getpwnam (3), +.BR setgrent (3), +.BR group (5) diff --git a/draft/man3/getgrouplist.3 b/draft/man3/getgrouplist.3 new file mode 100644 index 00000000..b4ac3cc4 --- /dev/null +++ b/draft/man3/getgrouplist.3 @@ -0,0 +1,281 @@ +.\" 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. +.\" +.\" A few pieces remain from an earlier version written in +.\" 2002 by Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated 2004-08-07, Yuichi SATO +.\" Updated 2008-08-11, Akihiro MOTOKI , LDP v3.05 +.\" +.TH GETGROUPLIST 3 2009-07-03 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getgrouplist \- get list of groups to which a user belongs +getgrouplist \- ¥æ¡¼¥¶¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤Î¥ê¥¹¥È¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int getgrouplist(const char *" user ", gid_t " group , +.br +.BI " gid_t *" groups ", int *" ngroups ); +.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 getgrouplist (): +_BSD_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR getgrouplist () +.\"O function scans the group database (see +.\"O .BR group (5)) +.\"O to obtain the list of groups that +.\"O .I user +.\"O belongs to. +.\"O Up to +.\"O .I *ngroups +.\"O of these groups are returned in the array +.\"O .IR groups . +.BR getgrouplist () +´Ø¿ô¤Ï¡¢¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹ +.RB ( group (5) +»²¾È) ¤òÄ´¤Ù¤Æ¡¢ +.I user +¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤Î¥ê¥¹¥È¤ò¼èÆÀ¤¹¤ë¡£ +¸«¤Ä¤«¤Ã¤¿¥°¥ë¡¼¥×¤Î¤¦¤ÁºÇÂç +.I *ngroups +¸Ä¤Î¥°¥ë¡¼¥×¤¬¡¢ÇÛÎó +.I groups +¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ + +.\"O If it was not among the groups defined for +.\"O .I user +.\"O in the group database, then +.\"O .I group +.\"O is included in the list of groups returned by +.\"O .BR getgrouplist (); +.\"O typically this argument is specified as the group ID from +.\"O the password record for +.\"O .IR user . +°ú¤­¿ô +.I group +¤¬¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë +.I user +¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.BR getgrouplist () +¤¬ÊÖ¤¹¥°¥ë¡¼¥×¤Î¥ê¥¹¥È¤Ë°ú¤­¿ô +.I group +¤âÄɲ䵤ì¤ë¡£ +Ä̾ï¤Ï¡¢¤³¤Î°ú¤­¿ô¤Ë¤Ï¥æ¡¼¥¶ +.I user +¤Î¥Ñ¥¹¥ï¡¼¥É¥ì¥³¡¼¥É¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥°¥ë¡¼¥× ID ¤ò»ØÄꤹ¤ë¡£ + +.\"O The +.\"O .I ngroups +.\"O argument is a value-result argument: +.\"O on return it always contains the number of groups found for +.\"O .IR user , +.\"O including +.\"O .IR group ; +.\"O this value may be greater than the number of groups stored in +.\"O .IR groups . +°ú¤­¿ô +.I ngroups +¤Ï¡¢ÃÍÅϤ·¤È·ë²Ì¤ÎξÊý¤Ë»ÈÍѤµ¤ì¤ë°ú¤­¿ô (value-result argument) ¤Ç¤¢¤ê¡¢ +¥ê¥¿¡¼¥ó»þ¤Ë¤Ï¡¢¾ï¤Ë +.I group +¤â´Þ¤á¤¿ +.I user +¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¿ô¤¬³ÊǼ¤µ¤ì¤ë¡£ +¤³¤ÎÃÍ¤Ï +.I groups +¤Ë³ÊǼ¤µ¤ì¤¿¥°¥ë¡¼¥×¿ô¤è¤êÂ礭¤¯¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O If the number of groups of which +.\"O .I user +.\"O is a member is less than or equal to +.\"O .IR *ngroups , +.\"O then the value +.\"O .I *ngroups +.\"O is returned. +.I user +¤¬½ê°¤·¤Æ¤¤¤ë¥°¥ë¡¼¥×¿ô¤¬ +.I *ngroups +°Ê²¼¤Î¾ì¹ç¡¢ +.I *ngroups +¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If the user is a member of more than +.\"O .I *ngroups +.\"O groups, then +.\"O .BR getgrouplist () +.\"O returns \-1. +»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¤¬ +.I *ngroups +¤è¤ê¿¤¯¤Î¥°¥ë¡¼¥×¤Ë½ê°¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR getgrouplist () +¤Ï \-1 ¤òÊÖ¤¹¡£ +.\"O In this case the value returned in +.\"O .IR *ngroups +.\"O can be used to resize the buffer passed to a further call +.\"O .BR getgrouplist (). +¤³¤Î¾ì¹ç¡¢ +.I *ngroups +¤ÇÊÖ¤µ¤ì¤ëÃͤò»È¤Ã¤Æ¡¢¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òÊѹ¹¤·¤Æ¤«¤é¡¢ +.BR getgrouplist () +¤ò¤â¤¦°ìÅٸƤӽФ¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SH "VERSIONS" +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O This function is present since glibc 2.2.4. +¤³¤Î´Ø¿ô¤Ï glibc 2.2.4 ¤«¤é¸ºß¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is nonstandard; it appears on most BSDs. +¤³¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç¤¢¤ë¡£¤Û¤È¤ó¤É¤Î BSD ¤Ë¸ºß¤¹¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O In glibc versions before 2.3.3, +.\"O the implementation of this function contains a buffer-overrun bug: +.\"O it returns the complete list of groups for +.\"O .IR user +.\"O in the array +.\"O .IR groups , +.\"O even when the number of groups exceeds +.\"O .IR *ngroups . +¥Ð¡¼¥¸¥ç¥ó 2.3.3 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢ +¤³¤Î´Ø¿ô¤Î¼ÂÁõ¤Ë¤Ï¥Ð¥Ã¥Õ¥¡¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Î¥Ð¥°¤¬¤¢¤ê¡¢ +.I user +¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¿ô¤¬ +.I *ngroups +¤è¤ê¿¤¤¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢ +.I user +¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤ÎÁ´¥ê¥¹¥È¤òÇÛÎó +.I groups +¤Ë³ÊǼ¤·¤Æ¤·¤Þ¤¦¡£ +.\"O .SH EXAMPLE +.SH Îã +.PP +.\"O The program below displays the group list for the user named in its +.\"O first command-line argument. +.\"O The second command-line argument specifies the +.\"O .I ngroups +.\"O value to be supplied to +.\"O .BR getgrouplist (). +.\"O The following shell session shows examples of the use of this program: +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢°ì¤ÄÌܤΥ³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿Ì¾Á°¤Î¥æ¡¼¥¶ +¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤Î¥ê¥¹¥È¤òɽ¼¨¤¹¤ë¡£ +ÆóÈÖÌܤΥ³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ë¤Ï¡¢ +.BR getgrouplist () +¤ËÅϤ¹ +.I ngroups +¤ÎÃͤò»ØÄꤹ¤ë¡£ +°Ê²¼¤Î¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥ó¤Ï¤³¤Î¥×¥í¥°¥é¥à¤Î»ÈÍÑÎã¤ò¼¨¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.in +4n +.nf + +.RB "$" " ./a.out cecilia 0" +getgrouplist() returned -1; ngroups = 3 +.RB "$" " ./a.out cecilia 3" +ngroups = 3 +16 (dialout) +33 (video) +100 (users) +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int j, ngroups; + gid_t *groups; + struct passwd *pw; + struct group *gr; + + if (argc != 3) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + ngroups = atoi(argv[2]); + + groups = malloc(ngroups * sizeof (gid_t)); + if (groups == NULL) { + perror("malloc"); + exit(EXIT_FAILURE); + } + + /* Fetch passwd structure (contains first group ID for user) */ + + pw = getpwnam(argv[1]); + if (pw == NULL) { + perror("getpwnam"); + exit(EXIT_SUCCESS); + } + + /* Retrieve group list */ + + if (getgrouplist(argv[1], pw\->pw_gid, groups, &ngroups) == \-1) { + fprintf(stderr, "getgrouplist() returned \-1; ngroups = %d\\n", + ngroups); + exit(EXIT_FAILURE); + } + + /* Display list of retrieved groups, along with group names */ + + fprintf(stderr, "ngroups = %d\\n", ngroups); + for (j = 0; j < ngroups; j++) { + printf("%d", groups[j]); + gr = getgrgid(groups[j]); + if (gr != NULL) + printf(" (%s)", gr\->gr_name); + printf("\\n"); + } + + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getgroups (2), +.BR setgroups (2), +.BR getgrent (3), +.BR group (5), +.BR passwd (5) diff --git a/draft/man3/gethostbyname.3 b/draft/man3/gethostbyname.3 new file mode 100644 index 00000000..a15264c1 --- /dev/null +++ b/draft/man3/gethostbyname.3 @@ -0,0 +1,737 @@ +.\" 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-05-22, David Metcalfe +.\" Modified 1993-07-25, Rik Faith (faith@cs.unc.edu) +.\" Modified 1997-02-16, Andries Brouwer (aeb@cwi.nl) +.\" Modified 1998-12-21, Andries Brouwer (aeb@cwi.nl) +.\" Modified 2000-08-12, Andries Brouwer (aeb@cwi.nl) +.\" Modified 2001-05-19, Andries Brouwer (aeb@cwi.nl) +.\" Modified 2002-08-05, Michael Kerrisk +.\" Modified 2004-10-31, Andries Brouwer +.\" +.\" Japanese Version Copyright (c) 1998-2000 NAKANO Takeo all rights reserved. +.\" Translated 1998-04-30, NAKANO Takeo +.\" Modified 1998-12-06, NAKANO Takeo +.\" Updated & Modified 1999-10-12, NAKANO Takeo +.\" Updated & Modified 2001-07-01, Yuichi SATO +.\" Updated & Modified 2002-01-03, Yuichi SATO +.\" Updated & Modified 2003-11-27, Yuichi SATO +.\" Updated & Modified 2005-01-10, Yuichi SATO +.\" Updated 2006-01-18, Akihiro MOTOKI +.\" Updated 2007-06-11, Akihiro MOTOKI, LDP v2.54 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" +.TH GETHOSTBYNAME 3 2009-12-03 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O gethostbyname, gethostbyaddr, sethostent, gethostent, endhostent, +.\"O h_errno, +.\"O herror, hstrerror, +.\"O gethostbyaddr_r, +.\"O gethostbyname2, gethostbyname2_r, gethostbyname_r, +.\"O gethostent_r \- get network host entry +.SH ̾Á° +gethostbyname, gethostbyaddr, sethostent, gethostent, endhostent, +h_errno, +herror, hstrerror, +gethostbyaddr_r, +gethostbyname2, gethostbyname2_r, gethostbyname_r, +gethostent_r \- ¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î¥Û¥¹¥È¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B extern int h_errno; +.sp +.BI "struct hostent *gethostbyname(const char *" name ); +.sp +.\"O .BR "#include " " /* for AF_INET */" +.BR "#include " " /* AF_INET ¤ò»È¤¦¾ì¹ç */" +.BI "struct hostent *gethostbyaddr(const void *" addr , +.BI " socklen_t " len ", int " type ); +.sp +.BI "void sethostent(int " stayopen ); +.sp +.B void endhostent(void); +.sp +.BI "void herror(const char *" s ); +.sp +.BI "const char *hstrerror(int " err ); +.sp +.\"O /* System V/POSIX extension */ +/* System V/POSIX ³ÈÄ¥ */ +.br +.B struct hostent *gethostent(void); +.sp +.\"O /* GNU extensions */ +/* GNU ³ÈÄ¥ */ +.br +.BI "struct hostent *gethostbyname2(const char *" name ", int " af ); +.sp +.B "int gethostent_r(" +.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , +.BI " struct hostent **" result ", int *" h_errnop ); +.sp +.BI "int gethostbyaddr_r(const void *" addr ", socklen_t " len ", int " type , +.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , +.BI " struct hostent **" result ", int *" h_errnop ); +.sp +.BI "int gethostbyname_r(const char *" name , +.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , +.BI " struct hostent **" result ", int *" h_errnop ); +.sp +.BI "int gethostbyname2_r(const char *" name ", int " af, +.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , +.BI " struct hostent **" result ", int *" h_errnop ); +.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 gethostbyname2 (), +.BR gethostent_r (), +.BR gethostbyaddr_r (), +.BR gethostbyname_r (), +.BR gethostbyname2_r (): +_BSD_SOURCE || _SVID_SOURCE + +.BR herror (), +.BR hstrerror () +.\"O (since glibc 2.8): _BSD_SOURCE || _SVID_SOURCE || _GNU_SOURCE +(glibc 2.8 °Ê¹ß): _BSD_SOURCE || _SVID_SOURCE || _GNU_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR gethostbyname* () +.\"O and +.\"O .BR gethostbyaddr* () +.\"O functions are obsolete. +.\"O Applications should use +.\"O .BR getaddrinfo (3) +.\"O and +.\"O .BR getnameinfo (3) +.\"O instead. +.BR gethostbyname* () +¤È +.BR gethostbyaddr* () +¤Ï²áµî¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢Âå¤ï¤ê¤Ë +.BR getaddrinfo (3) +¤È +.BR getnameinfo (3) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ + +.\"O The +.\"O .BR gethostbyname () +.\"O function returns a structure of type +.\"O .I hostent +.\"O for the given host +.\"O .IR name . +.\"O Here +.\"O .I name +.\"O is either a hostname, or an IPv4 address in standard dot notation (as for +.\"O .BR inet_addr (3)), +.\"O or an IPv6 address in colon (and possibly dot) notation. +.\"O (See RFC\ 1884 for the description of IPv6 addresses.) +.BR gethostbyname () +´Ø¿ô¤ÏÍ¿¤¨¤é¤ì¤¿¥Û¥¹¥È̾ +.I name +¤ËÂбþ¤¹¤ë¹½Â¤ÂÎ +.I hostent +¤òÊÖ¤¹¡£ +.I name +¤Ë¤Ï¥Û¥¹¥È̾¡¢¥É¥Ã¥È¶èÀÚ¤ê¤Î IPv4 ¥¢¥É¥ì¥¹ +.RB ( inet_addr (3) +»²¾È)¡¢¥³¥í¥ó¶èÀÚ¤ê¤Î IPv6 ¥¢¥É¥ì¥¹ (¤ª¤½¤é¤¯¥É¥Ã¥È¶èÀÚ¤ê¤Ç¤âÂç¾æÉ×) +¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë +(IPv6 ¥¢¥É¥ì¥¹¤Îµ­½ÒÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï RFC\ 1884 ¤ò»²¹Í¤Ë¤·¤Æ¤Û¤·¤¤)¡£ +.\"O If +.\"O .I name +.\"O is an IPv4 or IPv6 address, no lookup is performed and +.\"O .BR gethostbyname () +.\"O simply copies +.\"O .I name +.\"O into the +.\"O .I h_name +.\"O field and its +.\"O .I struct in_addr +.\"O equivalent into the +.\"O .I h_addr_list[0] +.\"O field of the returned +.\"O .I hostent +.\"O structure. +.I name +¤¬ IPv4 ¤« IPv6 ¤Î¥¢¥É¥ì¥¹¤À¤Ã¤¿¾ì¹ç¡¢ +̾Á°²ò·è (lookup) ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£¤½¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR gethostbyname () +¤Ï +.I name +¤ò¤½¤Î¤Þ¤Þ +.I hostent +¹½Â¤ÂΤΠ+.I h_name +¥Õ¥£¡¼¥ë¥É¤Ë¥³¥Ô¡¼¤·¡¢ +¤µ¤é¤Ë +.I name +¤ò +.I struct in_addr +·Á¼°¤Çɽ¤·¤¿¥Ç¡¼¥¿¤ò +.I hostent +¹½Â¤ÂΤΠ+.I h_addr_list[0] +¥Õ¥£¡¼¥ë¥É¤ËÆþ¤ì¤Æ¡¢¤½¤Î +.I hostent +¹½Â¤ÂΤòÊÖ¤¹¡£ +.\"O If +.\"O .I name +.\"O doesn't end in a dot and the environment variable +.\"O .B HOSTALIASES +.\"O is set, the alias file pointed to by +.\"O .B HOSTALIASES +.\"O will first be searched for +.\"O .I name +.\"O (see +.\"O .BR hostname (7) +.\"O for the file format). +.I name +¤¬¥É¥Ã¥È¤Ç½ªÎ»¤·¤Æ¤¤¤Æ¡¢¤«¤Ä´Ä¶­ÊÑ¿ô +.B HOSTALIASES +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤Þ¤º +.B HOSTALIASES +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥¤¥ê¥¢¥¹¥Õ¥¡¥¤¥ë¤«¤é +.I name +¤Î¥¨¥ó¥È¥ê¤¬¸¡º÷¤µ¤ì¤ë (¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR hostname (7) +¤ò»²¾È¤Î¤³¤È)¡£ +.\"O The current domain and its parents are searched unless \fIname\fP +.\"O ends in a dot. +.I name +¤¬¥É¥Ã¥È¤Ç½ªÎ»¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¸½ºß¤Î¥É¥á¥¤¥ó¤È¤½¤Î¿Æ¥É¥á¥¤¥ó¤¬¸¡º÷¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR gethostbyaddr () +.\"O function returns a structure of type \fIhostent\fP +.\"O for the given host address \fIaddr\fP of length \fIlen\fP and address type +.\"O \fItype\fP. +.\"O Valid address types are +.\"O .B AF_INET +.\"O and +.\"O .BR AF_INET6 . +.BR gethostbyaddr () +´Ø¿ô¤ÏÍ¿¤¨¤é¤ì¤¿¥Û¥¹¥È¥¢¥É¥ì¥¹ +.I addr +(Ťµ \fIlen\fP¡¢ ¥¿¥¤¥× \fItype\fP) ¤ËÂбþ¤¹¤ë¹½Â¤ÂÎ +.I hostent +¤òÊÖ¤¹¡£ +ÍѤ¤¤ë¤³¤È¤Î¤Ç¤­¤ë¥¿¥¤¥×¤Ï +.B AF_INET +¤È +.B AF_INET6 +¤Ç¤¢¤ë¡£ +.\"O The host address argument is a pointer to a struct of a type depending +.\"O on the address type, for example a \fIstruct in_addr *\fP (probably +.\"O obtained via a call to +.\"O .BR inet_addr (3)) +.\"O for address type +.\"O .BR AF_INET . +¥Û¥¹¥È¥¢¥É¥ì¥¹°ú¤­¿ô¤Ï¥¢¥É¥ì¥¹¥¿¥¤¥×¤Ë°Í¸¤·¤¿ +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢¥¢¥É¥ì¥¹¥¿¥¤¥× +.B AF_INET +¤ËÂФ·¤Æ¤Ï +.RB ( inet_addr (3) +¤Î¸Æ¤Ó½Ð¤·¤ÇÆÀ¤é¤ì¤ë) +\fIstruct in_addr *\fP ¤Ç¤¢¤ë¡£ +.PP +.\"O The +.\"O .BR sethostent () +.\"O function specifies, if \fIstayopen\fP is true (1), +.\"O that a connected TCP socket should be used for the name server queries and +.\"O that the connection should remain open during successive queries. +.\"O Otherwise, name server queries will use UDP datagrams. +.BR sethostent () +´Ø¿ô¤Ï¡¢¥Í¡¼¥à¥µ¡¼¥Ð¤Ø¤ÎÀܳ·ÁÂÖ¤ò»ØÄꤹ¤ë¡£ +.I stayopen +¤¬¿¿ (1) ¤Ê¤é¤Ð¡¢¥Í¡¼¥à¥µ¡¼¥Ð¤Ø¤ÎÌ䤤¹ç¤ï¤»¤Ë¤Ï¡¢ +Àܳ¤µ¤ì¤¿ TCP ¥½¥±¥Ã¥È¤òÍѤ¤¡¢Ï¢Â³¤·¤¿Ì䤤¹ç¤ï¤»¤Î´Ö¤ËÀܳ¤ò°Ý»ý¤¹¤ë¡£ +µ¶¤Ê¤é¤Ð¥Í¡¼¥à¥µ¡¼¥Ð¤Ø¤ÎÌ䤤¹ç¤ï¤»¤Ë UDP ¥Ç¡¼¥¿¥°¥é¥à¤òÍѤ¤¤ë¡£ +.PP +.\"O The +.\"O .BR endhostent () +.\"O function ends the use of a TCP connection for name +.\"O server queries. +.BR endhostent () +´Ø¿ô¤Ï¥Í¡¼¥à¥µ¡¼¥Ð¤Ø¤ÎÌ䤤¹ç¤ï¤»¤ËÍѤ¤¤¿ TCP Àܳ¤ÎÍøÍѤò½ªÎ»¤¹¤ë¡£ +.PP +.\"O The (obsolete) +.\"O .BR herror () +.\"O function prints the error message associated +.\"O with the current value of \fIh_errno\fP on \fIstderr\fP. +(ÇÑ»ßͽÄê¤Î) +.BR herror () +´Ø¿ô¤Ï¸½ºß¤Î +.I h_errno +¤ËÂбþ¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɸ½à¥¨¥é¡¼ \fIstderr\fP ¤Ë½ÐÎϤ¹¤ë¡£ +.PP +.\"O The (obsolete) +.\"O .BR hstrerror () +.\"O function takes an error number +.\"O (typically \fIh_errno\fP) and returns the corresponding message string. +(ÇÑ»ßͽÄê¤Î) +.BR hstrerror () +´Ø¿ô¤Ï¥¨¥é¡¼ÈÖ¹æ (Ä̾ï¤Ï \fIh_errno\fP) ¤ò°ú¤­¿ô¤Ë¼è¤ê¡¢ +Âбþ¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸Ê¸»úÎó¤òÊÖ¤¹¡£ +.PP +.\"O The domain name queries carried out by +.\"O .BR gethostbyname () +.\"O and +.\"O .BR gethostbyaddr () +.\"O use a combination of any or all of the name server +.\"O .BR named (8), +.\"O a broken out line from \fI/etc/hosts\fP, and the Network +.\"O Information Service (NIS or YP), depending upon the contents of the +.\"O \fIorder\fP line in +.\"O .IR /etc/host.conf . +.\"O .\" (See +.\"O .\" .BR resolv+ (8)). +.\"O The default action is to query +.\"O .BR named (8), +.\"O followed by +.\"O .IR /etc/hosts . +.BR gethostbyname () +¤È +.BR gethostbyaddr () +¤Ë¤è¤Ã¤Æ¼Â¹Ô¤µ¤ì¤ë¥É¥á¥¤¥ó̾¤ÎÌ䤤¹ç¤ï¤»¤Ç¤Ï¡¢¥Í¡¼¥à¥µ¡¼¥Ð +.BR named (8)¡¢ +.I /etc/hosts +¤Î¥Ç¡¼¥¿¹Ô¡¢¤ª¤è¤Ó +Network Information Service (NIS ¤Þ¤¿¤Ï YP) +¤¬ÁȤ߹ç¤ï¤»¤Æ»ÈÍѤµ¤ì¤ë¡£²¿¤¬»ÈÍѤµ¤ì¤ë¤«¤Ï¡¢ +.I /etc/host.conf +¤Î +.I order +¹Ô¤ÎÆâÍƤˤè¤ê·è¤Þ¤ë¡£ +.\" (¾Ü¤·¤¯¤Ï +.\" .BR resolv+ (8) +.\" ¤ò»²¾È)¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤Þ¤º +.BR named (8) +¤ËÌ䤤¹ç¤ï¤»¤ò¹Ô¤¤¡¢¼¡¤¤¤Ç +.I /etc/hosts +¤ò»²¾È¤¹¤ë¡£ +.PP +.\"O The \fIhostent\fP structure is defined in \fI\fP as follows: +.I hostent +¹½Â¤ÂÎ¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +.ne 7 +struct hostent { + char *h_name; /* official name of host */ + char **h_aliases; /* alias list */ + int h_addrtype; /* host address type */ + int h_length; /* length of address */ + char **h_addr_list; /* list of addresses */ +} +.\"O #define h_addr h_addr_list[0] /* for backward compatibility */ +#define h_addr h_addr_list[0] /* ²áµî¤È¤Î¸ß´¹À­¤Î¤¿¤á */ +.fi +.in +.PP +.\"O The members of the \fIhostent\fP structure are: +.I hostent +¹½Â¤ÂΤΥá¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ +.TP +.I h_name +.\"O The official name of the host. +¥Û¥¹¥È¤ÎÀµ¼°Ì¾ (official name)¡£ +.TP +.I h_aliases +.\"O An array of alternative names for the host, terminated by a NULL pointer. +¥Û¥¹¥È¤ÎÊÌ̾¤ÎÇÛÎó¡£ÇÛÎó¤Ï NULL ¥Ý¥¤¥ó¥¿¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.TP +.I h_addrtype +.\"O The type of address; always +.\"O .B AF_INET +.\"O or +.\"O .B AF_INET6 +.\"O at present. +¥¢¥É¥ì¥¹¤Î¥¿¥¤¥×¡£¸½ºß¤Ï¤¹¤Ù¤Æ +.B AF_INET +¤Þ¤¿¤Ï +.B AF_INET6 +¤Ç¤¢¤ë¡£ +.TP +.I h_length +.\"O The length of the address in bytes. +¥Ð¥¤¥Èñ°Ì¤Çɽ¤·¤¿¥¢¥É¥ì¥¹¤ÎŤµ¡£ +.TP +.I h_addr_list +.\"O An array of pointers to network addresses for the host (in network byte +.\"O order), terminated by a NULL pointer. +¥Û¥¹¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¡£ +ÇÛÎó¤Ï NULL ¥Ý¥¤¥ó¥¿¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À·Á¼°¤Ç¤¢¤ë¡£ +.TP +.I h_addr +.\"O The first address in \fIh_addr_list\fP for backward compatibility. +.I h_addr_list +¤ÎºÇ½é¤Î¥¢¥É¥ì¥¹¡£²áµî¤È¤Î¸ß´¹À­¤òÊݤĤ¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR gethostbyname () +.\"O and +.\"O .BR gethostbyaddr () +.\"O functions return the +.\"O .I hostent +.\"O structure or a NULL pointer if an error occurs. +.\"O On error, the +.\"O .I h_errno +.\"O variable holds an error number. +.BR gethostbyname () +¤ª¤è¤Ó +.BR gethostbyaddr () +´Ø¿ô¤Ï +.I hostent +¹½Â¤ÂΤòÊÖ¤¹¡£¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤é NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¥¨¥é¡¼¤ÎºÝ¤Ë¤Ï +.I h_errno +ÊÑ¿ô¤¬¥¨¥é¡¼¤ÎÈÖ¹æ¤òÊÝ»ý¤¹¤ë¡£ +.\"O When non-NULL, the return value may point at static data, see the notes below. +ÊÖ¤êÃͤ¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ÀÅŪ¥Ç¡¼¥¿¤ò¥Ý¥¤¥ó¥¿¤Ç»Ø¤·¤Æ¤¤¤ë¤³¤È¤â¤¢¤ë¡£ +°Ê²¼¤Î¡ÖÃí°Õ¡×¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "ERRORS" +.SH ¥¨¥é¡¼ +.\"O The variable \fIh_errno\fP can have the following values: +.I h_errno +ÊÑ¿ô¤Ï°Ê²¼¤ÎÃͤò¼è¤ê¤¦¤ë¡£ +.TP +.B HOST_NOT_FOUND +.\"O The specified host is unknown. +»ØÄꤷ¤¿¥Û¥¹¥È¤¬¸«¤Ä¤«¤é¤Ê¤¤¡£ +.TP +.\"O .B NO_ADDRESS " or " NO_DATA +.B NO_ADDRESS " ¤Þ¤¿¤Ï " NO_DATA +.\"O The requested name is valid but does not have an IP address. +»ØÄꤷ¤¿Ì¾Á°¤ÏÍ­¸ú¤À¤¬ IP ¥¢¥É¥ì¥¹¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B NO_RECOVERY +.\"O A nonrecoverable name server error occurred. +¥Í¡¼¥à¥µ¡¼¥Ð¤ÎÉüµìÉÔǽ¤Ê¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B TRY_AGAIN +.\"O A temporary error occurred on an authoritative name server. +.\"O Try again later. +authoritative ¤Ê¥Í¡¼¥à¥µ¡¼¥Ð¤Ç°ì»þŪ¤Ê¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +»þ´Ö¤ò¤ª¤¤¤Æ¤â¤¦°ìÅٻ¤³¤È¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/host.conf +.\"O resolver configuration file +̾Á°²ò·è¤ÎÀßÄê¥Õ¥¡¥¤¥ë +.TP +.I /etc/hosts +.\"O host database file +¥Û¥¹¥È¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.TP +.I /etc/nsswitch.conf +.\"O name service switch configuration +¥Í¡¼¥à¥µ¡¼¥Ó¥¹ÀÚÂØÀßÄê +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O POSIX.1-2001 specifies +.\"O .BR gethostbyname (), +.\"O .BR gethostbyaddr (), +.\"O .BR sethostent (), +.\"O .BR endhostent (), +.\"O .BR gethostent (), +.\"O and +.\"O .IR h_errno ; +.\"O .BR gethostbyname (), +.\"O .BR gethostbyaddr (), +.\"O and +.\"O .IR h_errno +.\"O are marked obsolescent in that standard. +POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR gethostbyname (), +.BR gethostbyaddr (), +.BR sethostent (), +.BR endhostent (), +.BR gethostent (), +.I h_errno +¤¬µ¬Äꤵ¤ì¤Æ¤ª¤ê¡¢ +.BR gethostbyaddr () +¤È +.BR gethostbyname () +¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¤È¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O POSIX.1-2008 removes the specifications of +.\"O .BR gethostbyname (), +.\"O .BR gethostbyaddr (), +.\"O and +.\"O .IR h_errno , +.\"O recommending the use of +.\"O .BR getaddrinfo (3) +.\"O and +.\"O .BR getnameinfo (3) +.\"O instead. +POSIX.1-2008 ¤Ç¤Ï +.BR gethostbyname (), +.BR gethostbyaddr (), +.I h_errno +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +Âå¤ï¤ê¤Ë¡¢ +.BR getaddrinfo (3) +¤È +.BR getnameinfo (3) +¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The functions +.\"O .BR gethostbyname () +.\"O and +.\"O .BR gethostbyaddr () +.\"O may return pointers to static data, which may be overwritten by +.\"O later calls. +.\"O Copying the +.\"O .I struct hostent +.\"O does not suffice, since it contains pointers; a deep copy is required. +.BR gethostbyname () +¤ª¤è¤Ó +.BR gethostbyaddr () +´Ø¿ô¤ÏÀÅŪ¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢¤½¤Î¸å¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.I hostent +¹½Â¤ÂΤϥݥ¤¥ó¥¿¤ò´Þ¤ó¤Ç¤¤¤ë¤Î¤Ç¡¢¹½Â¤ÂΤΥ³¥Ô¡¼¤À¤±¤Ç¤ÏÉÔ½½Ê¬¤Ç¤¢¤ë; +¤è¤ê¿¼¤¤¥³¥Ô¡¼¤¬É¬ÍפǤ¢¤ë¡£ +.LP +.\"O In the original BSD implementation the +.\"O .I len +.\"O argument +.\"O of +.\"O .BR gethostbyname () +.\"O was an +.\"O .IR int . +¥ª¥ê¥¸¥Ê¥ë¤Î BSD ¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.BR gethostbyname () +¤Î +.I len +°ú¤­¿ô¤Ï +.I int +¤Ç¤¢¤Ã¤¿¡£ +.\"O The SUSv2 standard is buggy and declares the +.\"O .I len +.\"O argument of +.\"O .BR gethostbyaddr () +.\"O to be of type +.\"O .IR size_t . +.\"O (That is wrong, because it has to be +.\"O .IR int , +.\"O and +.\"O .I size_t +.\"O is not. +.\"O POSIX.1-2001 makes it +.\"O .IR socklen_t , +.\"O which is OK.) +.\"O See also +.\"O .BR accept (2). +SUSv2 ɸ½à¤Ï¥Ð¥°¤¬Â¿¤¯¡¢ +.BR gethostbyaddr () +¤Î +.I len +¥Ñ¥é¥á¡¼¥¿¤ò +.I size_t +·¿¤È¤·¤ÆÀë¸À¤·¤Æ¤¤¤ë¡£ +(¤³¤ì¤Ï¸í¤ê¤Ç¡¢ +.I size_t +·¿¤Ç¤Ï¤Ê¤¯ +.I int +·¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +POSIX.1-2001 ¤Ç¤Ï¤³¤ì¤ò +.I socklen_t +¤È¤·¤Æ¤¤¤ë¤¬¡¢¤³¤ì¤Ï OK¡£) +.BR accept (2) +¤â»²¾È¡£ +.LP +.\"O The BSD prototype for +.\"O .BR gethostbyaddr () +.\"O uses +.\"O .I const char * +.\"O for the first argument. +.BR gethostbyaddr () +¤Î BSD ¤Î¥×¥í¥È¥¿¥¤¥×¤Ï¡¢ºÇ½é¤Î°ú¤­¿ô¤È¤·¤Æ +.I const char * +¤ò»È¤¦¡£ +.\"O .SS "System V/POSIX Extension" +.SS "System V/POSIX ³ÈÄ¥" +.\"O POSIX requires the +.\"O .BR gethostent () +.\"O call, that should return the next entry in the host data base. +POSIX ¤Ç¤Ï¡¢ +.BR gethostent () +¤¬É¬¿Ü¤È¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥Û¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +.\"O When using DNS/BIND this does not make much sense, but it may +.\"O be reasonable if the host data base is a file that can be read +.\"O line by line. +.\"O On many systems a routine of this name reads +.\"O from the file +.\"O .IR /etc/hosts . +DNS/BIND ¤ò»È¤¦¾ì¹ç¤Ï¤¢¤Þ¤ê°ÕÌ£¤ò»ý¤¿¤Ê¤¤¤¬¡¢ +¥Û¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ 1 ¹Ô¤º¤ÄÆɤ߹þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¾ì¹ç¤Ï°ÕÌ£¤¬¤¢¤ë¡£ +¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î̾Á°¤Î¥ë¡¼¥Á¥ó¤Ï¥Õ¥¡¥¤¥ë +.I /etc/hosts +¤òÆɤ߹þ¤à¡£ +.\"O .\" e.g., Linux, FreeBSD, Unixware, HP-UX +.\"O It may be available only when the library was built without DNS support. +.\"O .\" e.g., FreeBSD, AIX +.\"O The glibc version will ignore ipv6 entries. +.\"O This function is not reentrant, +.\"O and glibc adds a reentrant version +.\"O .BR gethostent_r (). +.\" Î㤨¤Ð¡¢Linux, FreeBSD, Unixware, HP-UX +DNS ¥µ¥Ý¡¼¥È¤Ê¤·¤Ç¥é¥¤¥Ö¥é¥ê¤¬¥Ó¥ë¥É¤µ¤ì¤¿¾ì¹ç¤Ë¤Î¤ßÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\" Î㤨¤Ð¡¢FreeBSD, AIX +glibc ÈÇ¤Ï ipv6 ¥¨¥ó¥È¥ê¤ò̵»ë¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È (reentrant) ¤Ç¤Ï¤Ê¤¯¡¢ +glibc ¤Ë¤Ï¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤΠ+.BR gethostent_r () +¤¬Äɲ䵤줿¡£ +.\"O .SS "GNU Extensions" +.SS "GNU ³ÈÄ¥" +.\"O Glibc2 also has a +.\"O .BR gethostbyname2 () +.\"O that works like +.\"O .BR gethostbyname (), +.\"O but permits to specify the address family to which the address must belong. +glibc2 ¤Ë¤Ï +.BR gethostbyname2 () +¤â¤¢¤ê¡¢ +.BR gethostbyname () +¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¤¬¡¢ +¤³¤Á¤é¤Ï¥¢¥É¥ì¥¹¤¬Â°¤¹¤ë¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +.\"O Glibc2 also has reentrant versions +.\"O .BR gethostent_r (), +.\"O .BR gethostbyaddr_r (), +.\"O .BR gethostbyname_r () +.\"O and +.\"O .BR gethostbyname2_r (). +glibc2 ¤Ë¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê +.BR gethostent_r (), +.BR gethostbyaddr_r (), +.BR gethostbyname_r () +¤È +.BR gethostbyname2_r () +¤â¤¢¤ë¡£ +.\"O The caller supplies a +.\"O .I hostent +.\"O structure +.\"O .I ret +.\"O which will be filled in on success, and a temporary work buffer +.\"O .I buf +.\"O of size +.\"O .IR buflen . +¸Æ¤Ó½Ð¤·Â¦¤Ï¡¢À®¸ù»þ¤Ë·ë²Ì¤¬³ÊǼ¤µ¤ì¤ë +.I hostent +¹½Â¤ÂÎ +.I ret +¤È¡¢Â礭¤µ +.I buflen +¤Î°ì»þŪ¤Êºî¶È¥Ð¥Ã¥Õ¥¡ +.I buf +¤òÄ󶡤¹¤ë¡£ +.\"O After the call, +.\"O .I result +.\"O will point to the result on success. +.\"O In case of an error +.\"O or if no entry is found +.\"O .I result +.\"O will be NULL. +¥³¡¼¥ë½ªÎ»¸å¡¢À®¸ù¤·¤¿¾ì¹ç +.I result +¤Ï·ë²Ì¤ò»Ø¤·¤Æ¤¤¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤Þ¤¿¤Ï¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.I result +¤Ï NULL ¤Ë¤Ê¤ë¡£ +.\"O The functions return 0 on success and a nonzero error number on failure. +.\"O In addition to the errors returned by the nonreentrant +.\"O versions of these functions, if +.\"O .I buf +.\"O is too small, the functions will return +.\"O .BR ERANGE , +.\"O and the call should be retried with a larger buffer. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤·¡¢¼ºÇԤξì¹ç¤Ï 0 °Ê³°¤Î¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Î¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ê¤¤¥Ð¡¼¥¸¥ç¥ó¤¬ÊÖ¤¹¥¨¥é¡¼¤Ë²Ã¤¨¤Æ¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ +.I buf +¤¬¾®¤µ¤¹¤®¤¿¾ì¹ç¤Ë +.B ERANGE +¤òÊÖ¤¹¡£¤³¤Î¾ì¹ç¤Ï¤â¤Ã¤ÈÂ礭¤Ê¥Ð¥Ã¥Õ¥¡¤òÍÑ°Õ¤·¤Æ +´Ø¿ô¸Æ¤Ó½Ð¤·¤òºÆÅÙ¹Ô¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O The global variable +.\"O .I h_errno +.\"O is not modified, but the address of a variable in which to store error numbers +.\"O is passed in +.\"O .IR h_errnop . +Âç°èÊÑ¿ô +.I h_errno +¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¤¬¡¢¥¨¥é¡¼ÈÖ¹æ¤ò³ÊǼ¤¹¤ëÊÑ¿ô¤Î¥¢¥É¥ì¥¹¤¬ +.I h_errnop +¤ËÅϤµ¤ì¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O .BR gethostbyname () +.\"O does not recognize components of a dotted IPv4 address string +.\"O that are expressed in hexadecimal. +.BR gethostbyname () +¤Ï¡¢16¿Ê¿ôɽ¸½¤Î¥É¥Ã¥È¶èÀÚ¤ê¤Î IPv4 ¥¢¥É¥ì¥¹Ê¸»úÎó¤ÎÍ×ÁǤòǧ¼±¤·¤Ê¤¤¡£ +.\" http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=482973 +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getaddrinfo (3), +.\" .BR getipnodebyaddr (3), +.\" .BR getipnodebyname (3), +.BR getnameinfo (3), +.BR inet (3), +.BR inet_ntop (3), +.BR inet_pton (3), +.BR resolver (3), +.BR hosts (5), +.BR nsswitch.conf (5), +.BR hostname (7), +.BR named (8) +.\" .BR resolv+ (8) diff --git a/draft/man3/gethostid.3 b/draft/man3/gethostid.3 new file mode 100644 index 00000000..817f2e3b --- /dev/null +++ b/draft/man3/gethostid.3 @@ -0,0 +1,197 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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. +.\" +.\" Updated with additions from Mitchum DSouza +.\" 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 +.\" +.\" (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 2009-01-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O gethostid, sethostid \- get or set the unique identifier of the current host +gethostid, sethostid \- ¸½ºß¤Î¥Û¥¹¥È¤Î¸ÇÍ­¤Î¼±Ê̻Ҥò¼èÆÀ/ÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B long gethostid(void); +.br +.BI "int sethostid(long " hostid ); +.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 sethostid (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.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 ¥¢¥É¥ì¥¹¤¬Âå¤ï¤ê¤Ë»ÈÍѤµ¤ì¡¢ +ÉáÄ̤ϼ±Ê̻Ҥò¤¢¤¨¤ÆÀßÄꤹ¤ëɬÍפϤʤ¤¡£ + +.\"O The +.\"O .BR sethostid () +.\"O call is restricted to the superuser. +.BR sethostid () +¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤·¤«»ÈÍѤǤ­¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.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 ¥Ó¥Ã¥È¤Î¼±Ê̻ҤÎÃͤòÊÖ¤¹¡£ + +.\"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 +.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. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú 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 +.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 + +.\"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 +.SH ¥Ð¥° +.\"O It is impossible to ensure that the identifier is globally unique. +¼±Ê̻Ҥ¬À¤³¦Ãæ¤Ç°ì°Õ¤Ç¤¢¤ë¤³¤È¤òÊݾڤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR hostid (1), +.BR gethostbyname (3) diff --git a/draft/man3/getipnodebyname.3 b/draft/man3/getipnodebyname.3 new file mode 100644 index 00000000..f872eb80 --- /dev/null +++ b/draft/man3/getipnodebyname.3 @@ -0,0 +1,438 @@ +.\" Copyright 2000 Sam Varshavchik +.\" +.\" 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: RFC 2553 +.\" +.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. +.\" Translated Sun Jan 14 2001 by NAKANO Takeo +.\" Updated Tue Nov 26 2002 by Kentaro Shirakata +.\" +.\"WORD: null pointer ¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿¡¼ +.\" +.TH GETIPNODEBYNAME 3 2007-11-15 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O getipnodebyname, getipnodebyaddr, freehostent \- get network +.\"O hostnames and addresses +.SH ̾Á° +getipnodebyname, getipnodebyaddr, freehostent \- ¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î̾Á°¤È¥¢¥É¥ì¥¹¤Î¼èÆÀ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "struct hostent *getipnodebyname(const char *" name ", int " af , +.BI " int " flags ", int *" error_num ); +.sp +.BI "struct hostent *getipnodebyaddr(const void *" addr ", size_t " len , +.BI " int " af ", int *" "error_num" ); +.sp +.BI "void freehostent(struct hostent *" "ip" ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These functions are deprecated (and unavailable in glibc). +.\"O Use +.\"O .BR getaddrinfo (3) +.\"O and +.\"O .BR getnameinfo (3) +.\"O instead. +¤³¤ì¤é¤Î´Ø¿ô¤ÏÈó¿ä¾©¤Ç¤¢¤ë (glibc ¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤)¡£ +Âå¤ï¤ê¤Ë +.BR getaddrinfo (3) +¤È +.BR getnameinfo (3) +¤ò»È¤¦¤³¤È¡£ +.LP +.\"O The +.\"O .BR getipnodebyname () +.\"O and +.\"O .BR getipnodebyaddr () +.\"O functions return the names and addresses of a network host. +.\"O These functions return a pointer to the +.\"O following structure: +.BR getipnodebyname () +¤È +.BR getipnodebyaddr () +¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î̾Á°¤È¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢°Ê²¼¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.sp +.in +4n +.nf +struct hostent { + char *h_name; + char **h_aliases; + int h_addrtype; + int h_length; + char **h_addr_list; +}; +.fi +.in +.PP +.\"O These functions replace the +.\"O .BR gethostbyname (3) +.\"O and +.\"O .BR gethostbyaddr (3) +.\"O functions, which could only access the IPv4 network address family. +.\"O The +.\"O .BR getipnodebyname () +.\"O and +.\"O .BR getipnodebyaddr () +.\"O functions can access multiple network address families. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ IPv4 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¤Ë¤·¤«¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤ +.BR gethostbyname (3) +¤ä +.BR gethostbyaddr (3) +¤òÃÖ¤­´¹¤¨¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.BR getipnodebyname () +´Ø¿ô¤È +.BR getipnodebyaddr () +´Ø¿ô¤ÏÊ£¿ô¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ë¥¢¥¯¥»¥¹²Äǽ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.PP +.\"O Unlike the +.\"O .B gethostby +.\"O functions, +.\"O these functions return pointers to dynamically allocated memory. +.\"O The +.\"O .BR freehostent () +.\"O function is used to release the dynamically allocated memory +.\"O after the caller no longer needs the +.\"O .I hostent +.\"O structure. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ +.B gethostby +¤Î´Ø¿ô·²¤È°Û¤Ê¤ê¡¢Æ°Åª¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¸µ¤¬¤³¤ì¤é¤Î +.I hostent +¹½Â¤ÂΤòɬÍפȤ·¤Ê¤¯¤Ê¤Ã¤¿¸å¤Ï¡¢ +.BR freehostent () +´Ø¿ô¤òÍѤ¤¤ì¤ÐưŪ¤Ê³ä¤êÅö¤Æ¥á¥â¥ê¤ò²òÊü¤Ç¤­¤ë¡£ +.\"O .SS getipnodebyname() arguments +.SS getipnodebyname() ¤Î°ú¤­¿ô +.\"O The +.\"O .BR getipnodebyname () +.\"O function +.\"O looks up network addresses for the host +.\"O specified by the +.\"O .I name +.\"O argument. +.\"O The +.\"O .I af +.\"O argument specifies one of the following values: +.BR getipnodebyname () +´Ø¿ô¤Ï +.I name +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿¥Û¥¹¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ò°ú¤¯¡£ +.I af +°ú¤­¿ô¤Ë¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ +.TP +.B AF_INET +.\"O The +.\"O .I name +.\"O argument points to a dotted-quad IPv4 address or a name +.\"O of an IPv4 network host. +.I name +°ú¤­¿ô¤Ï¡¢¥É¥Ã¥È¤Ç 4 ¤Ä¤Ë¶èÀÚ¤é¤ì¤¿ IPv4 ¥¢¥É¥ì¥¹¤«¡¢ +IPv4 ¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î̾Á°¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.TP +.B AF_INET6 +.\"O The +.\"O .I name +.\"O argument points to a hexadecimal IPv6 address or a name +.\"O of an IPv6 network host. +.I name +°ú¤­¿ô¤Ï¡¢16 ¿Ê¤Î IPv6 ¥¢¥É¥ì¥¹¤«¡¢ +IPv6 ¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î̾Á°¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.PP +.\"O The +.\"O .I flags +.\"O argument specifies additional options. +.\"O More than one option can be specified by logically OR-ing +.\"O them together. +.\"O .I flags +.\"O should be set to 0 +.\"O if no options are desired. +.I flags +¥Ñ¥é¥á¡¼¥¿¤Ë¤ÏÄɲäΥª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¡£ +Ê£¿ô¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤Ë¤Ï¡¢¤½¤ì¤é¤ÎÏÀÍý OR ¤ò¤È¤Ã¤Æ»ØÄꤹ¤ì¤Ð¤è¤¤¡£ +¥ª¥×¥·¥ç¥ó¤ò¤Ò¤È¤Ä¤â»ØÄꤷ¤¿¤¯¤Ê¤¤¤È¤­¤Ë¤Ï¡¢ +.I flags +¤Ë 0 ¤òÀßÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ +.TP +.B AI_V4MAPPED +.\"O This flag is used with +.\"O .B AF_INET6 +.\"O to request a query for IPv4 addresses instead of +.\"O IPv6 addresses; the IPv4 addresses will +.\"O be mapped to IPv6 addresses. +¤³¤Î¥Õ¥é¥°¤Ï +.B AF_INET6 +¤È¶¦¤ËÍѤ¤¤é¤ì¡¢IPv6 ¥¢¥É¥ì¥¹¤ÎÂå¤ï¤ê¤Ë IPv4 ¥¢¥É¥ì¥¹¤òÌ䤤¹ç¤ï¤»¤ë¡£ +Ì䤤¹ç¤ï¤»¤ë IPv4 ¥¢¥É¥ì¥¹¤Ï IPv6 ¥¢¥É¥ì¥¹¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¡£ +.TP +.B AI_ALL +.\"O This flag is used with +.\"O .B AI_V4MAPPED +.\"O to request a query for both IPv4 and IPv6 addresses. +.\"O Any IPv4 address found will be mapped to an IPv6 address. +¤³¤Î¥Õ¥é¥°¤Ï +.B AI_V4MAPPED +¤È¶¦¤ËÍѤ¤¤é¤ì¡¢IPv4 ¥¢¥É¥ì¥¹¤È IPv6 ¥¢¥É¥ì¥¹¤ÎξÊý¤òÌ䤤¹ç¤ï¤»¤ë¡£ +¸«¤Ä¤«¤Ã¤¿ IPv4 ¥¢¥É¥ì¥¹¤Ï¡¢¤¹¤Ù¤Æ IPv6 ¥¢¥É¥ì¥¹¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¡£ +.TP +.B AI_ADDRCONFIG +.\"O This flag is used with +.\"O .B AF_INET6 +.\"O to +.\"O further request that queries for IPv6 addresses should not be made unless +.\"O the system has at least one IPv6 address assigned to a network interface, +.\"O and that queries for IPv4 addresses should not be made unless the +.\"O system has at least one IPv4 address assigned to a network interface. +.\"O This flag may be used by itself or with the +.\"O .B AI_V4MAPPED +.\"O flag. +¤³¤Î¥Õ¥é¥°¤Ï +.B AF_INET6 +¤È¶¦¤ËÍѤ¤¤é¤ì¡¢ +IPv6 ¤¬³ä¤êÅö¤Æ¤é¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ +¥·¥¹¥Æ¥à¤Ë¤Ò¤È¤Ä¤â¤Ê¤±¤ì¤Ð IPv6 ¥¢¥É¥ì¥¹¤ÎÌ䤤¹ç¤ï¤»¤ò¹Ô¤ï¤º¡¢ +IPv4 ¤¬³ä¤êÅö¤Æ¤é¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ +¥·¥¹¥Æ¥à¤Ë¤Ò¤È¤Ä¤â¤Ê¤±¤ì¤Ð IPv4 ¥¢¥É¥ì¥¹¤ÎÌ䤤¹ç¤ï¤»¤ò¹Ô¤ï¤Ê¤¤¤è¤¦¤ËÍ׵᤹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ÏñÆȤǤ⡢¤¢¤ë¤¤¤Ï +.B AI_V4MAPPED +¥Õ¥é¥°¤È¶¦¤Ë¤Ç¤âÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B AI_DEFAULT +.\"O This flag is equivalent to +.\"O .BR "(AI_ADDRCONFIG | AI_V4MAPPED)" . +¤³¤Î¥Õ¥é¥°¤Ï +.BR (AI_ADDRCONFIG | AI_V4MAPPED) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.\"O .SS getipnodebyaddr() arguments +.SS "getipnodebyaddr() ¤Î°ú¤­¿ô" +.\"O The +.\"O .BR getipnodebyaddr () +.\"O function +.\"O looks up the name of the host whose +.\"O network address is +.\"O specified by the +.\"O .I addr +.\"O argument. +.\"O The +.\"O .I af +.\"O argument specifies one of the following values: +.BR getipnodebyaddr () +´Ø¿ô¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬ +.I addr +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿¥Û¥¹¥È¤Î̾Á°¤ò°ú¤¯¡£ +.I af +°ú¤­¿ô¤Ë¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ +.TP +.B AF_INET +.\"O The +.\"O .I addr +.\"O argument points to a +.\"O .I struct in_addr +.\"O and +.\"O .I len +.\"O must be set to +.\"O .IR "sizeof(struct in_addr)" . +.I addr +°ú¤­¿ô¤Ï +.I struct in_addr +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ê¡¢ +.I len +°ú¤­¿ô¤Ï +.I sizeof(struct in_addr) +¤ËÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B AF_INET6 +.\"O The +.\"O .I addr +.\"O argument points to a +.\"O .I struct in6_addr +.\"O and +.\"O .I len +.\"O must be set to +.\"O .IR "sizeof(struct in6_addr)" . +.I addr +°ú¤­¿ô¤Ï +.I struct in6_addr +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ê¡¢ +.I len +°ú¤­¿ô¤Ï +.I sizeof(struct in6_addr) +¤ËÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O A null pointer is returned if an error occurred, and +.\"O .I error_num +.\"O will contain an error code from the following list: +¥¨¥é¡¼¤¬µ¯¤³¤ë¤È¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿¡¼¤¬ÊÖ¤µ¤ì¡¢ +.I error_num +¤Ë°Ê²¼¤Ë¥ê¥¹¥È¤µ¤ì¤¿¥¨¥é¡¼¥³¡¼¥É¤Î¤¤¤º¤ì¤«¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +.B HOST_NOT_FOUND +.\"O The hostname or network address was not found. +¥Û¥¹¥È̾¤Þ¤¿¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.TP +.B NO_ADDRESS +.\"O The domain name server recognized the network address or name, +.\"O but no answer was returned. +.\"O This can happen if the network host has only IPv4 addresses and +.\"O a request has been made for IPv6 information only, or vice versa. +¥É¥á¥¤¥ó¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤Ï +¤½¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Þ¤¿¤Ï¥Í¥Ã¥È¥ï¡¼¥¯Ì¾¤òǧ¼±¤·¤¿¤¬¡¢ +ÊÖ»ö¤¬Ê֤äƤ³¤Ê¤«¤Ã¤¿¡£¸¶°ø¤È¤·¤Æ¤Ï¡¢ +Î㤨¤Ð IPv4 ¥¢¥É¥ì¥¹¤·¤«»ý¤¿¤Ê¤¤¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤ËÂФ·¤Æ +IPv6 ¤Î¾ðÊó¤ÎÌ䤤¹ç¤ï¤»¤¬¹Ô¤ï¤ì¤¿ (¤ª¤è¤Ó¤½¤ÎµÕ) ¤Ê¤É¤¬¹Í¤¨¤é¤ì¤ë¡£ +.TP +.B NO_RECOVERY +.\"O The domain name server returned a permanent failure response. +¥É¥á¥¤¥ó¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é¹±µ×Ū¤Ê¼ºÇÔ (permanent failure) +¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£ +.TP +.B TRY_AGAIN +.\"O The domain name server returned a temporary failure response. +.\"O You might have better luck next time. +¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é°ì»þŪ¤Ê¼ºÇÔ (temporary failure) +¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£¼¡¤Ë¤Ï¤â¤¦¤Á¤ç¤Ã¤È±¿¤¬É¬Íפ«¤â¡£ +.PP +.\"O A successful query returns a pointer to a +.\"O .I hostent +.\"O structure that contains the following fields: +Ì䤤¹ç¤ï¤»¤ËÀ®¸ù¤¹¤ë¤È¡¢ +.I hostent +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¥Õ¥£¡¼¥ë¥É¤«¤é¤Ê¤ë¡£ +.TP +.I h_name +.\"O This is the official name of this network host. +¤³¤ì¤Ï¤³¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î¥ª¥Õ¥£¥·¥ã¥ë¤Ê̾Á°¤Ç¤¢¤ë¡£ +.TP +.I h_aliases +.\"O This is an array of pointers to unofficial aliases for the same host. +.\"O The array is terminated by a null pointer. +¤³¤ì¤Ï¡¢¤½¤Î¥Û¥¹¥È¤Î¥ª¥Õ¥£¥·¥ã¥ë¤Ç¤Ê¤¤ÊÌ̾¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤ÎÇÛÎó¤Ç¤¢¤ë¡£ +ÇÛÎó¤Ï¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿¡¼¤Ç½ªÃ¼¤¹¤ë¡£ +.TP +.I h_addrtype +.\"O This is a copy of the +.\"O .I af +.\"O argument to +.\"O .BR getipnodebyname () +.\"O or +.\"O .BR getipnodebyaddr (). +.\"O .I h_addrtype +.\"O will always be +.\"O .B AF_INET +.\"O if the +.\"O .I af +.\"O argument was +.\"O .BR AF_INET . +.\"O .I h_addrtype +.\"O will always be +.\"O .B AF_INET6 +.\"O if the +.\"O .I af +.\"O argument was +.\"O .BR AF_INET6 . +¤³¤ì¤Ï +.BR getipnodebyname () +¤Þ¤¿¤Ï +.BR getipnodebyaddr () +¤ËÍ¿¤¨¤é¤ì¤¿ +.I af +°ú¤­¿ô¤Î¥³¥Ô¡¼¤Ç¤¢¤ë¡£ +.I af +°ú¤­¿ô¤¬ +.B AF_INET +¤Ê¤é +.I h_addrtype +¤Ï¾ï¤Ë +.B AF_INET +¤Ë¤Ê¤ê¡¢ +.I af +°ú¤­¿ô¤¬ +.B AF_INET6 +¤Ê¤é +.I h_addrtype +¤â¾ï¤Ë +.B AF_INET6 +¤Ë¤Ê¤ë¡£ +.TP +.I h_length +.\"O This field will be set to +.\"O .I sizeof(struct in_addr) +.\"O if +.\"O .I h_addrtype +.\"O is +.\"O .BR AF_INET , +.\"O and to +.\"O .I sizeof(struct in6_addr) +.\"O if +.\"O .I h_addrtype +.\"O is +.\"O .BR AF_INET6 . +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +.I h_addrtype +¤¬ +.B AF_INET +¤Ê¤é +.I sizeof(struct in_addr) +¤Ë¡¢ +.I h_addrtype +¤¬ +.B AF_INET6 +¤Ê¤é +.I sizeof(struct in6_addr) +¤ËÀßÄꤵ¤ì¤ë¡£ +.TP +.I h_addr_list +.\"O This is an array of one or more pointers to network address structures for the +.\"O network host. +.\"O The array is terminated by a null pointer. +¤³¤ì¤Ï¤Ò¤È¤Ä°Ê¾å¤Î¥Ý¥¤¥ó¥¿¡¼¤ÎÇÛÎó¤Ç¡¢ +¤½¤ì¤¾¤ì¤Î¥Ý¥¤¥ó¥¿¡¼¤Ï¡¢ +¤½¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤ËÂбþ¤¹¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¹½Â¤ÂΤò»Ø¤¹¡£ +¤³¤ÎÇÛÎó¤Ï¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿¡¼¤Ç½ªÃ¼¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +RFC\ 2553. +.\"O .\" Not in POSIX.1-2001. +.\" POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O These functions were present in glibc 2.1.91-95, but were +.\"O removed again. +.\"O Several Unix-like systems support them, but all +.\"O call them deprecated. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc 2.1.91-95 ¤Ë¸ºß¤·¤¿¤¬¡¢ºÆ¤Óºï½ü¤µ¤ì¤¿¡£ +¤¤¤¯¤Ä¤«¤Î Unix É÷¥·¥¹¥Æ¥à¤Ï¤³¤ì¤é¤Î´Ø¿ô¤ËÂбþ¤·¤Æ¤¤¤ë¤¬¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÁ´¤Æ¿ä¾©¤µ¤ì¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getaddrinfo (3), +.BR getnameinfo (3), +.BR inet_ntop (3), +.BR inet_pton (3) diff --git a/draft/man3/getline.3 b/draft/man3/getline.3 new file mode 100644 index 00000000..63c8667b --- /dev/null +++ b/draft/man3/getline.3 @@ -0,0 +1,263 @@ +.\" Copyright (c) 2001 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. +.\" +.\" Japanese Version Copyright (c) 2001 Yuichi SATO +.\" all rights reserved. +.\" Translated 2001-11-09, Yuichi SATO +.\" Updated 2006-07-20, Akihiro MOTOKI , LDP v2.34 +.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24 +.\" +.\"WORD: delimiter ¶èÀÚ¤êʸ»ú +.\" +.TH GETLINE 3 2009-12-05 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getline, getdelim \- delimited string input +getline, getdelim \- ¶èÀÚ¤êʸ»ú¤Þ¤Ç¤Îʸ»úÎóÆþÎϤòÆɤ߹þ¤à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "ssize_t getline(char **" lineptr ", size_t *" n ", FILE *" stream ); + +.BI "ssize_t getdelim(char **" lineptr ", size_t *" n ", int " delim \ +", FILE *" stream ); +.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 + +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +.br +.BR getline (), +.BR getdelim (): +_GNU_SOURCE + +.\"O Since glibc 2.10: +glibc 2.10 °Ê¹ß: +.br +.BR getline (), +.BR getdelim (): +_POSIX_C_SOURCE >= 200809 || _XOPEN_SOURCE >= 700 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR getline () +.\"O reads an entire line from \fIstream\fP, +.\"O storing the address of the buffer containing the text into +.\"O .IR "*lineptr" . +.BR getline () +¤Ï \fIstream\fP ¤«¤é 1 ¹ÔÁ´¤Æ¤òÆɤ߹þ¤ß¡¢¥Æ¥­¥¹¥È¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡¤Î¥¢¥É¥ì¥¹¤ò +.I "*lineptr" +¤Ë³ÊǼ¤¹¤ë¡£ +.\"O The buffer is null-terminated and includes the newline character, if +.\"O one was found. +¥Ð¥Ã¥Õ¥¡¤Ï¥Ì¥ëʸ»ú (\e0) ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +²þ¹Ôʸ»ú¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ï¡¢²þ¹Ôʸ»ú¤â¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I "*lineptr" +.\"O is NULL, then +.\"O .BR getline () +.\"O will allocate a buffer for storing the line, +.\"O which should be freed by the user program. +.\"O (The value in +.\"O .I *n +.\"O is ignored.) +.I "*lineptr" +¤¬ NULL ¤Î¾ì¹ç¡¢ +.BR getline () +¤Ï¹Ô¤ÎÆâÍƤò³ÊǼ¤¹¤ë¤¿¤á¤Î¥Ð¥Ã¥Õ¥¡¤ò³ÎÊݤ¹¤ë¡£ +¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¥æ¡¼¥¶¡¼¤Î¥×¥í¥°¥é¥à¤Ç²òÊü¤¹¤Ù¤­¤Ç¤¢¤ë +.RI ( *n +¤ÎÃͤÏ̵»ë¤µ¤ì¤ë)¡£ + +.\"O Alternatively, before calling +.\"O .BR getline (), +.\"O .I "*lineptr" +.\"O can contain a pointer to a +.\"O .BR malloc (3)\-allocated +.\"O buffer +.\"O .I "*n" +.\"O bytes in size. +Ê̤ÎÊýË¡¤È¤·¤Æ¡¢ +.BR getline () +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë¡¢ +.I "*lineptr" +¤Ë +.BR malloc (3) +¤Ç³ÎÊݤ·¤¿Â礭¤µ +.I "*n" +¥Ð¥¤¥È¤Î¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÆþ¤ì¤ÆÅϤ¹¤³¤È¤â¤Ç¤­¤ë¡£ +.\"O If the buffer is not large enough to hold the line, +.\"O .BR getline () +.\"O resizes it with +.\"O .BR "realloc(3)" , +.\"O updating +.\"O .I "*lineptr" +.\"O and +.\"O .I "*n" +.\"O as necessary. +Æɤ߹þ¤ó¤À¹Ô¤òÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¤¬¤Ê¤¤¾ì¹ç¡¢ +.BR getline () +¤Ï +.BR realloc (3) +¤ò»È¤Ã¤Æ¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òÊѹ¹¤·¡¢É¬Íפ˱þ¤¸¤Æ +.I "*lineptr" +¤È +.I "*n" +¤ò¹¹¿·¤¹¤ë¡£ + +.\"O In either case, on a successful call, +.\"O .I "*lineptr" +.\"O and +.\"O .I "*n" +.\"O will be updated to reflect the buffer address and allocated size respectively. +¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢¸Æ¤Ó½Ð¤·¤ËÀ®¸ù¤·¤¿¤È¤­¤Ë¤Ï¡¢ +.I "*lineptr" +¤È +.I "*n" +¤¬¥Ð¥Ã¥Õ¥¡¤Î¥¢¥É¥ì¥¹¤È³ä¤êÅö¤Æ¤¿¥µ¥¤¥º¤òÈ¿±Ç¤·¤¿Ãͤ˹¹¿·¤µ¤ì¤ë¡£ + +.\"O .BR getdelim () +.\"O works like +.\"O .BR getline (), +.\"O except a line delimiter other than newline can be specified as the +.\"O .I delimiter +.\"O argument. +.BR getdelim () +¤Ï +.BR getline () +¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¤¬¡¢²þ¹Ôʸ»ú°Ê³°¤Î¶èÀÚ¤êʸ»ú¤ò°ú¤­¿ô +.I delim +¤Ë»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O As with +.\"O .BR getline (), +.\"O a delimiter character is not added if one was not present +.\"O in the input before end of file was reached. +.BR getline () +¤ÈƱÍͤˡ¢¥Õ¥¡¥¤¥ë½ªÃ¼¤Ë㤹¤ë¤Þ¤Ç¤ËÆþÎϹԤ˶èÀÚ¤êʸ»ú¤¬¸«ÉÕ¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢ +¶èÀÚ¤êʸ»ú¤ò¥Ð¥Ã¥Õ¥¡¤ËÄɲ䷤ʤ¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR getline () +.\"O and +.\"O .BR getdelim () +.\"O return the number of characters read, including the delimiter character, +.\"O but not including the terminating null byte. +.\"O This value can be used +.\"O to handle embedded null bytes in the line read. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR getline () +¤È +.BR getdelim () +¤ÏÆɤ߹þ¤ó¤Àʸ»ú¿ô¤òÊÖ¤¹¡£ +ʸ»ú¿ô¤Ë¤Ï¶èÀÚ¤êʸ»ú¤Ï´Þ¤Þ¤ì¤ë¤¬¡¢½ªÃ¼¤Ë»È¤¦ NULL ¥Ð¥¤¥È¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +¤³¤ÎÃͤˤè¤Ã¤Æ¡¢Æɤ߹þ¤ó¤À¹Ô¤Ë´Þ¤Þ¤ì¤ë NULL ¥Ð¥¤¥È¤òÁàºî¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O Both functions return \-1 on failure to read a line (including end of file +.\"O condition). +¤É¤Á¤é¤Î´Ø¿ô¤â¡¢¹Ô¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤¹ +(¥Õ¥¡¥¤¥ë¤Î½ªÃ¼¤Ë㤷¤¿¾ì¹ç¤Ë¤â \-1 ¤òÊÖ¤¹)¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O Bad arguments +.\"O .RI ( n +.\"O or +.\"O .I lineptr +.\"O is NULL, or +.\"O .I stream +.\"O is not valid). +°ú¤­¿ô¤¬ÉÔÀµ¤Ç¤¢¤ë +.RI ( n +¤Þ¤¿¤Ï +.I lineptr +¤¬ NULL ¤Ç¤¢¤ë¡£ +¤â¤·¤¯¤Ï +.I stream +¤¬Í­¸ú¤Ç¤Ê¤¤)¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions are available since libc 4.6.27. +¤³¤ì¤é¤Î´Ø¿ô¤Ï libc 4.6.27 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Both +.\"O .BR getline () +.\"O and +.\"O .BR getdelim () +.\"O were originally GNU extensions. +.\"O They were standardized in POSIX.1-2008. +.BR getline () +¤È +.BR getdelim () +¤Ï¡¢¤É¤Á¤é¤â¸µ¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤Ã¤¿¤¬¡¢ +POSIX.1-2008 ¤Çɸ½à²½¤µ¤ì¤¿¡£ +.\"O .SH "EXAMPLE" +.SH Îã +.nf +#define _GNU_SOURCE +#include +#include + +int +main(void) +{ + FILE * fp; + char * line = NULL; + size_t len = 0; + ssize_t read; + + fp = fopen("/etc/motd", "r"); + if (fp == NULL) + exit(EXIT_FAILURE); + + while ((read = getline(&line, &len, fp)) != \-1) { + printf("Retrieved line of length %zu :\en", read); + printf("%s", line); + } + + if (line) + free(line); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR read (2), +.BR fgets (3), +.BR fopen (3), +.BR fread (3), +.BR gets (3), +.BR scanf (3), +.BR feature_test_macros (7) diff --git a/draft/man3/getloadavg.3 b/draft/man3/getloadavg.3 new file mode 100644 index 00000000..15b08a2d --- /dev/null +++ b/draft/man3/getloadavg.3 @@ -0,0 +1,102 @@ +.\" Copyright (c) 1989, 1991, 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. 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. +.\" +.\" @(#)getloadavg.3 8.1 (Berkeley) 6/4/93 +.\" +.\" 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 Éé²ÙÊ¿¶Ñ +.\" +.TH GETLOADAVG 3 2007-12-08 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getloadavg \- ¥·¥¹¥Æ¥à¤ÎÉé²ÙÊ¿¶Ñ¤ò¼èÆÀ¤¹¤ë +getloadavg \- get system load averages +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _BSD_SOURCE +.B #include +.sp +.BI "int getloadavg(double " loadavg[] ", int " nelem ); +.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 +.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 ¥Ð¡¼¥¸¥ç¥ó +.\"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 +.SH ´ØÏ¢¹àÌÜ +.BR uptime (1), +.BR proc (5), +.BR feature_test_macros (7) diff --git a/draft/man3/getlogin.3 b/draft/man3/getlogin.3 new file mode 100644 index 00000000..2bcaadcf --- /dev/null +++ b/draft/man3/getlogin.3 @@ -0,0 +1,319 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1995 James R. Van Zandt +.\" +.\" 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. +.\" +.\" 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 +.\" +.TH GETLOGIN 3 2008-06-29 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O getlogin, getlogin_r, cuserid \- get username +.SH ̾Á° +getlogin, getlogin_r, cuserid \- ¥æ¡¼¥¶¡¼Ì¾¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B "char *getlogin(void);" +.br +.BI "int getlogin_r(char *" buf ", size_t " bufsize ); +.sp +.B #include +.sp +.BI "char *cuserid(char *" string ); +.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 getlogin_r (): +_REENTRANT || _POSIX_C_SOURCE\ >=\ 199506L +.br +.BR cuserid (): +_XOPEN_SOURCE +.\"O .SH DESCRIPTION +.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 () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿ºÝ¤Ë¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.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 +¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +.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 () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿ºÝ¤Ë¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.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 ¤ÇÀë¸À¤µ¤ì¤Æ +¤¤¤ë¡£ +.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 ¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¾õ¶·¤¬°ã¤¦¤³¤È¤â¤¢¤ë)¡£ +.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 ÊÑ¿ô¤Ï¥æ¡¼¥¶¡¼¤¬¼«Í³¤ËÀßÄê¤Ç¤­¤ë¤Î¤Ç +¤è¤ê½ÀÆð¤ÊÂбþ¤¬²Äǽ¤Ë¤Ê¤ë¡£ +.\"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 () +¤ÏÀ®¸ù¤¹¤ë¤È 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 +.B ENXIO +.\"O The calling process has no controlling tty. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤ÏÀ©¸æüËö¤¬¤Ê¤¤¡£ +.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 +¤è¤ê¤âŤ¤¡£ +.LP +.\"O Linux/glibc also has +Linux/glibc ¤Ë¤Ï°Ê²¼¤Î¥¨¥é¡¼¤â¤¢¤ë¡£ +.TP +.B ENOENT +.\"O There was no corresponding entry in the utmp-file. +utmp ¥Õ¥¡¥¤¥ë¤ËÂбþ¤¹¤ë¥¨¥ó¥È¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O Insufficient memory to allocate passwd structure. +passwd ¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOTTY +.\"O Standard input didn't refer to a terminal. +.\"O (See BUGS.) +ɸ½àÆþÎϤ¬Ã¼Ëö¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤ (¡Ö¥Ð¥°¡×¤ÎÀá¤ò»²¾È)¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +\fI/etc/passwd\fP +.\"O password database file +¥Ñ¥¹¥ï¡¼¥É¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Õ¥¡¥¤¥ë +.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" +.SH ½àµò +.\"O .BR getlogin () +.\"O and +.\"O .BR getlogin_r () +.\"O specified in POSIX.1-2001. +.BR getlogin () +¤È +.BR getlogin_r () +¤Ï 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 ¤Çºï½ü¤µ¤ì¤¿¡£ +.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 () +¤¬¤¢¤ê¡¢ +¥»¥Ã¥·¥ç¥ó¤ËÂбþ¤·¤¿¥æ¡¼¥¶Ì¾¤¬¤¢¤ë¡£À©¸æüËö¤¬¤Ê¤¤ +¥»¥Ã¥·¥ç¥ó¤Î¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢Âбþ¤¹¤ë¥æ¡¼¥¶Ì¾¤¬¤¢¤ë¡£ +.\"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 () +¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.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 ɸ½àÆþÎÏ +¤¬¥ê¥À¥¤¥ì¥¯¥È¤µ¤ì¤¿¾ì¹ç¤Ç¤â¥í¥°¥¤¥ó̾¤òÊÖ¤¹¡£) +.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" +.SH ´ØÏ¢¹àÌÜ +.BR geteuid (2), +.BR getuid (2), +.BR utmp (5) diff --git a/draft/man3/getmntent.3 b/draft/man3/getmntent.3 new file mode 100644 index 00000000..f14118c2 --- /dev/null +++ b/draft/man3/getmntent.3 @@ -0,0 +1,303 @@ +.\" 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 Sat Jul 24 21:46:57 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 961109, 031115, aeb +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-03-01, NAKANO Takeo +.\" Updated 2000-09-03, Kentaro Shirakata +.\" Updated 2005-03-18, Akihiro MOTOKI +.\" +.TH GETMNTENT 3 2009-09-15 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O getmntent, setmntent, addmntent, endmntent, hasmntopt, +.\"O getmntent_r \- get file system descriptor file entry +.SH ̾Á° +getmntent, setmntent, addmntent, endmntent, hasmntopt, +getmntent_r \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àµ­½Ò¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "FILE *setmntent(const char *" filename ", const char *" type ); +.sp +.BI "struct mntent *getmntent(FILE *" fp ); +.sp +.BI "int addmntent(FILE *" fp ", const struct mntent *" mnt ); +.sp +.BI "int endmntent(FILE *" fp ); +.sp +.BI "char *hasmntopt(const struct mntent *" mnt ", const char *" opt ); +.sp +.\"O /* GNU extension */ +/* GNU ¤Ë¤è¤ë³ÈÄ¥ */ +.B #include +.sp +.BI "struct mntent *getmntent_r(FILE *" fp ", struct mntent *" mntbuf , +.BI " char *" buf ", int " buflen ); +.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 getmntent_r (): +_BSD_SOURCE || _SVID_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These routines are used to access the file system description file +.\"O \fI/etc/fstab\fP and the mounted file system description file +.\"O \fI/etc/mtab\fP. +¤³¤ì¤é¤Î¥ë¡¼¥Á¥ó¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òµ­½Ò¤·¤¿¥Õ¥¡¥¤¥ë \fI/etc/fstab\fP +¤È¡¢¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òµ­½Ò¤·¤¿¥Õ¥¡¥¤¥ë +\fI/etc/mtab\fP ¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR setmntent () +.\"O function opens the file system description file +.\"O \fIfilename\fP and returns a file pointer which can be used by +.\"O .BR getmntent (). +.\"O The argument \fItype\fP is the type of access +.\"O required and can take the same values as the \fImode\fP argument of +.\"O .BR fopen (3). +.BR setmntent () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Îµ­½Ò¥Õ¥¡¥¤¥ë \fIfilename\fP ¤ò¥ª¡¼¥×¥ó¤·¤Æ¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¤³¤Î¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤Ï +.BR getmntent () +¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£°ú¤­¿ô \fItype\fP ¤ÏÍ׵᤹¤ë¥¢¥¯¥»¥¹·Á¼°¤Ç¡¢ +.BR fopen (3) +¤Î \fImode\fP °ú¤­¿ô¤ÈƱ¤¸Ãͤò¼è¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O The +.\"O .BR getmntent () +.\"O function reads the next line from the file system +.\"O description file \fIfp\fP and returns a pointer to a structure +.\"O containing the broken out fields from a line in the file. +.\"O The pointer +.\"O points to a static area of memory which is overwritten by subsequent +.\"O calls to +.\"O .BR getmntent (). +.BR getmntent () +´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Îµ­½Ò¥Õ¥¡¥¤¥ë \fIfp\fP ¤«¤é¿·¤·¤¤¹Ô¤òÆÉ +¤ß¹þ¤ß¡¢¹Ô¤ò¥Õ¥£¡¼¥ë¥É¤Ëʬ³ä¤·¤¿ÆâÍƤò¼ý¤á¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¥Ý¥¤¥ó¥¿¤Ï¥á¥â¥ê¤ÎÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤³¤ÎÎΰè¤Ï +.BR getmntent () +¤ò¼¡¤Ë¸Æ¤Ó½Ð¤·¤¿¤È¤­¤Ë¾å½ñ¤­¤µ¤ì¤Æ¤·¤Þ¤¦¡£ +.PP +.\"O The +.\"O .BR addmntent () +.\"O function adds the +.\"O .I mntent +.\"O structure \fImnt\fP to +.\"O the end of the open file \fIfp\fP. +.BR addmntent () +´Ø¿ô¤Ï +.I mntent +¹½Â¤ÂÎ \fImnt\fP ¤ÎÆâÍƤò¡¢¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë +\fIfp\fP ¤ÎºÇ¸å¤ËÄɲ乤롣 +.PP +.\"O The +.\"O .BR endmntent () +.\"O function closes the file system description file +.\"O \fIfp\fP. +.BR endmntent () +´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Îµ­½Ò¥Õ¥¡¥¤¥ë \fIfp\fP ¤òÊĤ¸¤ë¡£ +.PP +.\"O The +.\"O .BR hasmntopt () +.\"O function scans the \fImnt_opts\fP field (see below) +.\"O of the +.\"O .I mntent +.\"O structure \fImnt\fP for a substring that matches \fIopt\fP. +.\"O See \fI\fP and +.\"O .BR mount (8) +.\"O for valid mount options. +.BR hasmntopt () +´Ø¿ô¤Ï +.I mntent +¹½Â¤ÂÎ \fImnt\fP ¤Î \fImnt_opts\fP ¥Õ¥£¡¼¥ë¥É (²¼µ­ +»²¾È) ¤ò¥¹¥­¥ã¥ó¤·¡¢ \fIopt\fP ¤Ë°ìÃפ¹¤ëÉôʬʸ»úÎ󤬤¢¤ë¤«¤òÄ´¤Ù¤ë¡£ +Í­¸ú¤Ê¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ï \fI\fP ¤È +.BR mount (8) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The reentrant \fBgetmntent_r\fP() function is similar to +.\"O .BR getmntent (), +.\"O but stores the \fIstruct mount\fP in the provided +.\"O .I *mntbuf +.\"O and stores the strings pointed to by the entries in that struct +.\"O in the provided array +.\"O .I buf +.\"O of size +.\"O .IR buflen . +¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê´Ø¿ô +.BR getmntent_r () +¤Ï +.BR getmntent () +¤ÈƱ¤¸¤À¤¬¡¢ +¥æ¡¼¥¶¤¬ÍÑ°Õ¤·¤¿ +.I *mntbuf +¤Ë \fIstruct mount\fP ¤ò³ÊǼ¤·¡¢¤½¤Î¹½Â¤ÂΤγƥ¨¥ó¥È¥ê¤¬»Ø¤·¼¨¤¹Ê¸»úÎó¤ò +¥æ¡¼¥¶¤¬ÍÑ°Õ¤·¤¿Â礭¤µ +.I buflen +¤ÎÇÛÎó +.I buf +¤Ë½ñ¤­¹þ¤à¡£ + +.PP +.\"O The \fImntent\fP structure is defined in \fI\fP as follows: +\fImntent\fP ¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +struct mntent { + char *mnt_fsname; /* name of mounted file system */ + char *mnt_dir; /* file system path prefix */ + char *mnt_type; /* mount type (see mntent.h) */ + char *mnt_opts; /* mount options (see mntent.h) */ + int mnt_freq; /* dump frequency in days */ + int mnt_passno; /* pass number on parallel fsck */ +}; +.fi +.in + +.\"O Since fields in the mtab and fstab files are separated by whitespace, +.\"O octal escapes are used to represent the four characters space (\e040), +.\"O tab (\e011), newline (\e012) and backslash (\e134) in those files +.\"O when they occur in one of the four strings in a +.\"O .I mntent +.\"O structure. +.\"O The routines +.\"O .BR addmntent () +.\"O and +.\"O .BR getmntent () +.\"O will convert +.\"O from string representation to escaped representation and back. +mtab ¤ä fstab ¥Õ¥¡¥¤¥ë¤Ç¤Ï¡¢³Æ¥Õ¥£¡¼¥ë¥É¤Ï¶õÇò¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢ +¥¹¥Ú¡¼¥¹¡¢¥¿¥Ö¡¢²þ¹Ô¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Î 4ʸ»ú¤ò¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ç +»È¤¤¤¿¤¤¾ì¹ç¤Ç¡¢¤«¤Ä +.I mntent +¹½Â¤ÂΤΠ4¤Ä¤Îʸ»úÎó¥á¥ó¥Ð¡¼¤Î¤¤¤º¤ì¤«¤ËÂбþ¤¹¤ë¥Õ¥£¡¼¥ë¥ÉÆâ¤Ç +»È¤¤¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢8¿Ê¤Î¥¨¥¹¥±¡¼¥×ɽµ­¤ò»È¤Ã¤Æɽ¸½¤¹¤ë: +¥¹¥Ú¡¼¥¹ (\e040), ¥¿¥Ö (\e011), ²þ¹Ô (\e012), ¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å (\e134)¡£ +.BR addmntent () +¤È +.BR getmntent () +¤Ï¡¢Ê¸»úÎóɽ¸½¤«¤é +¥¨¥¹¥±¡¼¥×ɽ¸½¤Ø¤ÎÊÑ´¹¡¢¤ª¤è¤Ó¤½¤ÎµÕ¤ò¹Ô¤¦¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR getmntent () +.\"O and +.\"O .BR getmntent_r () +.\"O functions return +.\"O a pointer to the +.\"O .I mntent +.\"O structure or NULL on failure. +.BR getmntent () +¤È +.BR getmntent_r () +¤Ï +.I mntent +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR addmntent () +.\"O function returns 0 on success and 1 on failure. +.\Baddmntent\fP() ´Ø¿ô¤ÏÀ®¸ù¤·¤¿¤é 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤·¤¿¤é 1 ¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR endmntent () +.\"O function always returns 1. +.BR endmntent () +´Ø¿ô¤Ï¤Ä¤Í¤Ë 1 ¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR hasmntopt () +.\"O function returns the address of the substring if +.\"O a match is found and NULL otherwise. +.BR hasmntopt () +´Ø¿ô¤Ï¡¢¥Þ¥Ã¥Á¤·¤¿¾ì¹ç¤ÏÉôʬʸ»úÎó¤Ø¤Î¥¢¥É¥ì¥¹¤òÊÖ¤·¡¢ +¥Þ¥Ã¥Á¤·¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.nf +.\"O /etc/fstab file system description file +.\"O /etc/mtab mounted file system description file +/etc/fstab ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àµ­½Ò¥Õ¥¡¥¤¥ë +/etc/mtab ¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Îµ­½Ò¥Õ¥¡¥¤¥ë +.fi +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The nonreentrant functions are from SunOS 4.1.3. +.\"O A routine +.\"O .BR getmntent_r () +.\"O was introduced in HP-UX 10, but it returns an int. +.\"O The prototype shown above is glibc-only. +¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ê¤¤´Ø¿ô¤Ï SunOS 4.1.3 ͳÍè¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.BR getmntent_r () +´Ø¿ô¤Ï HPUX 10 ¤ÇƳÆþ¤µ¤ì¤¿¤¬¡¢¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï int ¤òÊÖ¤¹¡£ +¾åµ­¤Ë¼¨¤·¤¿¥×¥í¥È¥¿¥¤¥×¤Ï glibc Æȼ«¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O System V also has a +.\"O .BR getmntent () +.\"O function but the calling sequence +.\"O differs, and the returned structure is different. +.\"O Under System V +.\"O .I /etc/mnttab +.\"O is used. +System V ¤Ë¤â +.BR getmntent () +´Ø¿ô¤Ï¤¢¤ë¤¬¡¢ +¸Æ¤Ó½Ð¤·¼ê½ç¤¬°Û¤Ê¤ê¡¢ÊÖ¤µ¤ì¤ë¹½Â¤ÂΤâ°Û¤Ê¤ë¡£ +System V ¤Ç¤Ï +.I /etc/mnttab +¤¬ÍѤ¤¤é¤ì¤ë¡£ +.\"O 4.4BSD and Digital Unix have a routine +.\"O .BR getmntinfo (), +.\"O a wrapper around the system call +.\"O .BR getfsstat (). +4.4BSD ¤È Digital Unix ¤Ë¤Ï +.BR getmntinfo () +¤¬¤¢¤ë¤¬¡¢ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR getfsstat () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fopen (3), +.BR fstab (5), +.BR mount (8) diff --git a/draft/man3/getnameinfo.3 b/draft/man3/getnameinfo.3 new file mode 100644 index 00000000..ee882e39 --- /dev/null +++ b/draft/man3/getnameinfo.3 @@ -0,0 +1,459 @@ +.\" This page is in the public domain. +.\" Almost all details are from RFC 2553. +.\" +.\" 2004-12-14, mtk, Added EAI_OVERFLOW error +.\" 2004-12-14 Fixed description of error return +.\" +.\" Translated 2005-02-26, Akihiro MOTOKI +.\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2010-04-10, Akihiro MOTOKI, LDP v3.24 +.\" +.TH GETNAMEINFO 3 2009-12-03 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getnameinfo \- address-to-name translation in protocol-independent manner +getnameinfo \- ¥¢¥É¥ì¥¹¤«¤é̾Á°¤Ø¤ÎÊÑ´¹¤ò¥×¥í¥È¥³¥ë¤Ë°Í¸¤·¤Ê¤¤¤«¤¿¤Á¤Ç¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "int getnameinfo(const struct sockaddr *" "sa" ", socklen_t " "salen" , +.BI " char *" "host" ", size_t " "hostlen" , +.BI " char *" "serv" ", size_t " "servlen" ", 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) +»²¾È): +.ad l +.in +.sp +.BR getnameinfo (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR getnameinfo () +.\"O function is the inverse of +.\"O .BR getaddrinfo (3): +.\"O it converts a socket address to a corresponding host and service, +.\"O in a protocol-independent manner. +.\"O It combines the functionality of +.\"O .BR gethostbyaddr (3) +.\"O and +.\"O .BR getservbyport (3), +.\"O but unlike those functions, +.\"O .BR getaddrinfo (3) +.\"O is reentrant and allows programs to eliminate +.\"O IPv4-versus-IPv6 dependencies. +.BR getnameinfo () +´Ø¿ô¤Ï¡¢ +.BR getaddrinfo (3) +¤ÎµÕ¤ÎÆ°ºî¤ò¹Ô¤¦¡£¤Ä¤Þ¤ê¡¢¥×¥í¥È¥³¥ë¤Ë°Í¸¤·¤Ê¤¤¤«¤¿¤Á¤Ç +¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤«¤éÂбþ¤¹¤ë¥Û¥¹¥È̾¤È¥µ¡¼¥Ó¥¹¤Ø¤ÎÊÑ´¹¤ò¹Ô¤¦¡£ +¤³¤Î´Ø¿ô¤Ï +.BR gethostbyaddr (3) +¤È +.BR getservbyport (3) +¤Îµ¡Ç½¤ò°ì¤Ä¤Ë¤·¤¿¤â¤Î¤À¤¬¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤È°ã¤¤¡¢ +.BR getnameinfo (3) +¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤¢¤ê¡¢IPv4 ¤È IPv6 ¤Îº¹Ê¬¤Ë°Í¸¤·¤Ê¤¤¤«¤¿¤Á¤Ç +¥×¥í¥°¥é¥à¤ò½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O The +.\"O .I sa +.\"O argument is a pointer to a generic socket address structure +.\"O (of type +.\"O .I sockaddr_in +.\"O or +.\"O .IR sockaddr_in6 ) +.\"O of size +.\"O .I salen +.\"O that holds the input IP address and port number. +.I sa +°ú¤­¿ô¤Ï¡¢ +IP ¥¢¥É¥ì¥¹¤È¥Ý¡¼¥ÈÈÖ¹æ¤Î¾ðÊó¤òÊÝ»ý¤·¤Æ¤¤¤ë +ÈÆÍÑŪ¤Ê¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¹½Â¤ÂÎ +.RI ( sockaddr_in +·¿¤Þ¤¿¤Ï +.I sockaddr_in6 +·¿) ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I salen +¤Ï +.I sa +¤Î¥µ¥¤¥º¤Ç¤¢¤ë¡£ +.\"O The arguments +.\"O .I host +.\"O and +.\"O .I serv +.\"O are pointers to caller-allocated buffers (of size +.\"O .I hostlen +.\"O and +.\"O .I servlen +.\"O respectively) into which +.\"O .BR getnameinfo () +.\"O places null-terminated strings containing the host and +.\"O service names respectively. +.I host +¤È +.I serv +°ú¤­¿ô¤Ï¡¢(¤½¤ì¤¾¤ì¥µ¥¤¥º¤¬ +.I hostlen +¤È +.I servlen +¤Î) ¸Æ¤Ó½Ð¤·Â¦¤Ç³ÎÊݤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ê¡¢ +¥Û¥¹¥È̾¤È¥µ¡¼¥Ó¥¹Ì¾¤ò´Þ¤à NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤¬ +¤½¤ì¤¾¤ì¤Î¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ë¡£ + +.\"O The caller can specify that no hostname (or no service name) +.\"O is required by providing a NULL +.\"O .I host +.\"O (or +.\"O .IR serv ) +.\"O argument or a zero +.\"O .I hostlen +.\"O (or +.\"O .IR servlen ) +.\"O argument. +.\"O However, at least one of hostname or service name +.\"O must be requested. +¥Û¥¹¥È̾¤¬ÉÔÍפǤ¢¤ë¤³¤È¤ò¤³¤Î´Ø¿ô¤ËÅÁ¤¨¤ë¤Ë¤Ï¡¢ +.I host +¤Ë NULL ¤ò»ØÄꤹ¤ë¤«¡¢ +.I hostlen +¤Ë 0 ¤ò»ØÄꤹ¤ë¡£Æ±Íͤˡ¢¥µ¡¼¥Ó¥¹Ì¾¤¬ÉÔÍפʾì¹ç¤Ï¡¢ +.I serv +¤Ë NULL ¤ò»ØÄꤹ¤ë¤«¡¢ +.I servlen +¤Ë 0 ¤ò»ØÄꤹ¤ë¡£ +¤·¤«¤·¡¢¥Û¥¹¥È̾¤È¥µ¡¼¥Ó¥¹Ì¾¤ÎξÊý¤òÉÔÍפÀ¤È»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤ +(¤¤¤º¤ì¤«°ìÊý¤ÏÍ׵᤹¤ë¤³¤È)¡£ + +.\"O The +.\"O .I flags +.\"O argument modifies the behavior of +.\"O .BR getnameinfo () +.\"O as follows: +.I flags +°ú¤­¿ô¤Ç +.BR getnameinfo () +¤ÎÆ°ºî¤òÊѤ¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£»ØÄê¤Ç¤­¤ëÃͤϰʲ¼¤ÎÄ̤ê: +.TP +.B NI_NAMEREQD +.\"O If set, then an error is returned if the hostname cannot be determined. +»ØÄꤹ¤ë¤È¡¢¥Û¥¹¥È̾¤¬·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¥¨¥é¡¼¤òÊÖ¤¹¡£ +.TP +.B NI_DGRAM +.\"O If set, then the service is datagram (UDP) based rather than +.\"O stream (TCP) based. +.\"O This is required for the few ports (512-514) +.\"O that have different services for UDP and TCP. +»ØÄꤹ¤ë¤È¡¢¥¹¥È¥ê¡¼¥à¥Ù¡¼¥¹ (TCP) ¤Ç¤Ê¤¯¥Ç¡¼¥¿¥°¥é¥à¥Ù¡¼¥¹ (UDP) +¤Î¥µ¡¼¥Ó¥¹¤òÂоݤˤ¹¤ë¡£¿ô¤Ï¾¯¤Ê¤¤¤¬¡¢ +UDP ¤È TCP ¤Ç°ã¤¦¥µ¡¼¥Ó¥¹¤òÄ󶡤·¤Æ¤¤¤ë¥Ý¡¼¥È +(512-514) ¤ËÂФ·¤ÆɬÍפȤʤ롣 +.TP +.B NI_NOFQDN +.\"O If set, return only the hostname part of the fully qualified domain name +.\"O for local hosts. +»ØÄꤹ¤ë¤È¡¢¥í¡¼¥«¥ë¤Ê¥Û¥¹¥È¤Ë¤Ï fully qualified domain name (FQDN) ¤Î +¥Û¥¹¥È̾¤ÎÉôʬ¤Î¤ß¤òÊÖ¤¹¡£ +.TP +.B NI_NUMERICHOST +.\"O If set, then the numeric form of the hostname is returned. +.\"O .\" For example, by calling +.\"O .\" .BR inet_ntop () +.\"O .\" instead of +.\"O .\" .BR gethostbyaddr (). +.\"O (When not set, this will still happen in case the node's name +.\"O cannot be determined.) +»ØÄꤹ¤ë¤È¡¢¿ôÃÍ·Á¼°¤Î¥Û¥¹¥È̾¤¬ÊÖ¤µ¤ì¤ë¡£ +.\" Î㤨¤Ð +.\" .BR gethostbyaddr () +.\" ¤ÎÂå¤ï¤ê¤Ë +.\" .BR inet_ntop () +.\" ¤ò¸Æ¤Ö +(»ØÄꤷ¤Ê¤¯¤Æ¤â¡¢¥Î¡¼¥É¤Î̾Á°¤¬·èÄê¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¿ôÃÍ·Á¼°¤¬Ê֤뤳¤È¤¬¤¢¤ë)¡£ +.\" POSIX.1-2003 has NI_NUMERICSCOPE, but glibc doesn't have it. +.TP +.B NI_NUMERICSERV +.\"O If set, then the numeric form of the service address is returned. +.\"O (When not set, this will still happen in case the service's name +.\"O cannot be determined.) +»ØÄꤹ¤ë¤È¡¢¿ôÃÍ·Á¼°¤Î¥µ¡¼¥Ó¥¹Ì¾ (Î㤨¤Ð¥Ý¡¼¥ÈÈÖ¹æ) ¤¬ÊÖ¤µ¤ì¤ë +(»ØÄꤷ¤Ê¤¯¤Æ¤â¡¢¥µ¡¼¥Ó¥¹Ì¾¤¬·èÄê¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¿ôÃÍ·Á¼°¤¬Ê֤뤳¤È¤¬¤¢¤ë)¡£ +.\"O .SS "Extensions to getaddrinfo() for Internationalized Domain Names" +.SS "¹ñºÝ²½¥É¥á¥¤¥ó̾¤Î¤¿¤á¤Î getnameinfo() ¤Î³ÈÄ¥" +.\"O motoki: ¸¶Ê¸¤Î getaddrinfo() ¤Ï getnameinfo() ¤Î´Ö°ã¤¤¤È»×¤ï¤ì¤ë¡£ +.PP +.\"O Starting with glibc 2.3.4, +.\"O .BR getnameinfo () +.\"O has been extended to selectively allow +.\"O hostnames to be transparently converted to and from the +.\"O Internationalized Domain Name (IDN) format (see RFC 3490, +.\"O .IR "Internationalizing Domain Names in Applications (IDNA)" ). +.\"O Three new flags are defined: +glibc 2.3.4 ¤«¤é¡¢ +.BR getnameinfo () +¤Ë³ÈÄ¥¤¬¹Ô¤ï¤ì¡¢¥Û¥¹¥È̾¤È +¹ñºÝ²½¥É¥á¥¤¥ó̾ (Internationalized Domain Name; IDN) ·Á¼°¤È¤Î´Ö¤Ç +Æ©²áŪ¤ÊÊÑ´¹¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë +(IDN ·Á¼°¤Ë¤Ä¤¤¤Æ¤Ï RFC 3490 ¤Î +.I "Internationalizing Domain Names in Applications (IDNA)" +¤ò»²¾È)¡£3¤Ä¤Î¥Õ¥é¥°¤¬¿·¤¿¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.TP +.B NI_IDN +.\"O If this flag is used, then the name found in the lookup process is +.\"O converted from IDN format to the locale's encoding if necessary. +.\"O ASCII-only names are not affected by the conversion, which +.\"O makes this flag usable in existing programs and environments. +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢É¬ÍפǤ¢¤ì¤Ð¡¢¸¡º÷½èÍý¤Ç¸«¤Ä¤«¤Ã¤¿Ì¾Á°¤Ï +IDN ·Á¼°¤«¤é¥í¥±¡¼¥ë¤Ë±þ¤¸¤¿Éä¹æ²½·Á¼°¤ËÊÑ´¹¤µ¤ì¤ë¡£ +ASCII ʸ»ú¤À¤±¤Î̾Á°¤Ï¤³¤ÎÊÑ´¹¤Ç¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡£¤³¤Î¤¿¤á¡¢ +´û¸¤Î¥×¥í¥°¥é¥à¤ä´Ä¶­¤Ç¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR NI_IDN_ALLOW_UNASSIGNED ", " NI_IDN_USE_STD3_ASCII_RULES +.\"O Setting these flags will enable the +.\"O IDNA_ALLOW_UNASSIGNED (allow unassigned Unicode code points) and +.\"O IDNA_USE_STD3_ASCII_RULES (check output to make sure it is a STD3 +.\"O conforming host name) +.\"O flags respectively to be used in the IDNA handling. +¤³¤ì¤é¤Î¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢IDNA ½èÍý¤Ç»ÈÍѤµ¤ì¤ë¥Õ¥é¥° +IDNA_ALLOW_UNASSIGNED (̤³ä¤êÅö¤Æ¤Î Unicode ¤Î¥³¡¼¥É¥Ý¥¤¥ó¥È¤òµöÍÆ) ¤È +IDNA_USE_STD3_ASCII_RULES (½ÐÎϤ¬ STD3 ½àµò¤Î¥Û¥¹¥È̾¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë) +¤¬¤½¤ì¤¾¤ìÍ­¸ú¤Ë¤Ê¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\" FIXME glibc defines the following additional errors, some which +.\" can probably be returned by getnameinfo(); they need to +.\" be documented. +.\" #ifdef __USE_GNU +.\" #define EAI_INPROGRESS -100 /* Processing request in progress. */ +.\" #define EAI_CANCELED -101 /* Request canceled. */ +.\" #define EAI_NOTCANCELED -102 /* Request not canceled. */ +.\" #define EAI_ALLDONE -103 /* All requests done. */ +.\" #define EAI_INTR -104 /* Interrupted by a signal. */ +.\" #define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ +.\" #endif +.\"O On success 0 is returned, and node and service names, if requested, +.\"O are filled with null-terminated strings, possibly truncated to fit +.\"O the specified buffer lengths. +.\"O On error one of the following nonzero error codes is returned: +À®¸ù¤¹¤ë¤È 0 ¤¬Ê֤ꡢ(Í׵ᤵ¤ì¤Æ¤¤¤ì¤Ð) ¥Î¡¼¥É¤È¥µ¡¼¥Ó¥¹¤Î̾Á°¤¬ +NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Î·Á¼°¤Ç¤½¤ì¤¾¤ì¤Î»ØÄê¥Ð¥Ã¥Õ¥¡¤ËÊÖ¤µ¤ì¤ë +(¥Ð¥Ã¥Õ¥¡¤ÎŤµ¤Ë¤¢¤¦¤è¤¦¤Ë½Ì¤á¤é¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤)¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢°Ê²¼¤Î 0 °Ê³°¤Î¥¨¥é¡¼¡¦¥³¡¼¥É¤¬ÊÖ¤µ¤ì¤ë: +.TP +.B EAI_AGAIN +.\"O The name could not be resolved at this time. +.\"O Try again later. +»ØÄꤵ¤ì¤¿Ì¾Á°¤¬¸½»þÅÀ¤Ç¤Ï²ò·è¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +¸å¤ÇºÆ»î¹Ô¤·¤Æ¤ß¤ë¤³¤È¡£ +.TP +.B EAI_BADFLAGS +.\"O The +.\"O .I flags +.\"O argument has an invalid value. +.I flags +°ú¤­¿ô¤ËÉÔÀµ¤ÊÃͤ¬Í¿¤¨¤é¤ì¤¿¡£ +.TP +.B EAI_FAIL +.\"O A nonrecoverable error occurred. +²óÉü¤Ç¤­¤Ê¤¤¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EAI_FAMILY +.\"O The address family was not recognized, +.\"O or the address length was invalid for the specified family. +»ØÄꤷ¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤¬Ç§¼±¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +¤¢¤ë¤¤¤Ï¥¢¥É¥ì¥¹¤ÎŤµ¤¬»ØÄꤵ¤ì¤¿¥Õ¥¡¥ß¥ê¡¼¤Ë¹ç¤¦¤â¤Î¤Ç¤Ê¤«¤Ã¤¿¡£ +.TP +.B EAI_MEMORY +.\"O Out of memory. +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B EAI_NONAME +.\"O The name does not resolve for the supplied arguments. +.\"O .B NI_NAMEREQD +.\"O is set and the host's name cannot be located, +.\"O or neither hostname nor service name were requested. +Í¿¤¨¤é¤ì¤¿¥Ñ¥é¥á¡¼¥¿¤Ç¤Ï̾Á°¤¬²ò·è¤Ç¤­¤Ê¤¤¡£ +.B NI_NAMEREQD +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤¿¤¬¥Û¥¹¥È̾¤¬·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿¤«¡¢ +¥Û¥¹¥È̾¤â¥µ¡¼¥Ó¥¹Ì¾¤âÍ׵ᤵ¤ì¤Ê¤«¤Ã¤¿¡£ +.TP +.B EAI_OVERFLOW +.\"O The buffer pointed to by +.\"O .I host +.\"O or +.\"O .I serv +.\"O was too small. +.I host +¤Þ¤¿¤Ï +.I serv +¤¬»Ø¤·¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ¤¹¤®¤¿¡£ +.TP +.B EAI_SYSTEM +.\"O A system error occurred. +.\"O The error code can be found in +.\"O .IR errno . +¥·¥¹¥Æ¥à¥¨¥é¡¼¤¬µ¯¤Ã¤¿¡£ +¥¨¥é¡¼¥³¡¼¥É¤Ï +.I errno +¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR gai_strerror (3) +.\"O function translates these error codes to a human readable string, +.\"O suitable for error reporting. +.BR gai_strerror (3) +´Ø¿ô¤ò»È¤¦¤È¡¢¤³¤ì¤é¤Î¥¨¥é¡¼¡¦¥³¡¼¥É¤ò¡¢¥¨¥é¡¼¡¦¥ì¥Ý¡¼¥È¤ËŬ¤·¤¿ +¿Í´Ö¤¬Æɤߤ䤹¤¤Ê¸»úÎó¤ËËÝÌõ¤·¤Æ¤¯¤ì¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +/etc/hosts +.br +/etc/nsswitch.conf +.br +/etc/resolv.conf +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR getnameinfo () +.\"O is provided in glibc since version 2.1. +.BR getnameinfo () +¤Ï¡¢glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +RFC\ 2553, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O In order to assist the programmer in choosing reasonable sizes +.\"O for the supplied buffers, +.\"O .I +.\"O defines the constants +ŬÀڤʥХåե¡¥µ¥¤¥º¤òÁªÂò¤Ç¤­¤ë¤è¤¦¤Ë¡¢ +.I +¤Ë°Ê²¼¤ÎÄê¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.in +4n +.nf + +#define NI_MAXHOST 1025 +#define NI_MAXSERV 32 +.fi +.in + +.\"O Since glibc 2.8, +.\"O these definitions are exposed only if one of the feature test macros +.\"O .BR _BSD_SOURCE , +.\"O .BR _SVID_SOURCE , +.\"O or +.\"O .BR _GNU_SOURCE +.\"O is defined. +glibc 2.8 °Ê¹ß¤Ç¤Ï¡¢µ¡Ç½¸¡ºº¥Þ¥¯¥í +.BR _BSD_SOURCE , +.BR _SVID_SOURCE , +.BR _GNU_SOURCE +¤Î¤¤¤º¤ì¤«¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë¤Î¤ß¡¢¤³¤ì¤é¤ÎÄêµÁ¤¬¸ø³«¤µ¤ì¤ë¡£ +.PP +.\"O The former is the constant +.\"O .B MAXDNAME +.\"O in recent versions of BIND's +.\"O .I +.\"O header file. +.\"O The latter is a guess based on the services listed +.\"O in the current Assigned Numbers RFC. +Á°¼Ô¤Ï¡¢ºÇ¶á¤Î¥Ð¡¼¥¸¥ç¥ó¤Î BIND ¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.I +Ãæ¤ÎÄê¿ô +.B MAXDNAME +¤ÈƱ¤¸ÃͤǤ¢¤ë¡£ +¸å¼Ô¤Ï¡¢³ä¤êÅö¤ÆºÑ¤Î¿ôÃͤˤĤ¤¤Æµ­¤·¤¿¸½ºß¤Î RFC ¤Ë +Îóµó¤µ¤ì¤Æ¥µ¡¼¥Ó¥¹¤«¤é¿äÎ̤·¤¿ÃͤǤ¢¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The following code tries to get the numeric hostname and service name, +.\"O for a given socket address. +.\"O Note that there is no hardcoded reference to +.\"O a particular address family. +°Ê²¼¤Î¥³¡¼¥É¤Ï¡¢»ØÄꤵ¤ì¤¿¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ËÂФ¹¤ë +¥Û¥¹¥È¤È¥µ¡¼¥Ó¥¹¤Î¿ôÃÍɽ¼°¤ò¼èÆÀ¤·¤è¤¦¤È»î¤ß¤ë¡£ +ÆÃÄê¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤ËÂФ¹¤ë»²¾È¾ðÊó¤Ï +°ìÀڥϡ¼¥É¥³¡¼¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ËÃåÌܤ·¤Æ¤Û¤·¤¤¡£ + +.in +4n +.nf +struct sockaddr *sa; /* input */ +socklen_t len; /* input */ +char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV]; + +if (getnameinfo(sa, len, hbuf, sizeof(hbuf), sbuf, + sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV) == 0) + printf("host=%s, serv=%s\en", hbuf, sbuf); +.fi +.in + +.\"O The following version checks if the socket address has a +.\"O reverse address mapping. +°Ê²¼¤Ç¤Ï¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ë +µÕ¸þ¤­¤Î¥¢¥É¥ì¥¹¥Þ¥Ã¥Ô¥ó¥°¤¬Â¸ºß¤¹¤ë¤«¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct sockaddr *sa; /* input */ +socklen_t len; /* input */ +char hbuf[NI_MAXHOST]; + +if (getnameinfo(sa, len, hbuf, sizeof(hbuf), + NULL, 0, NI_NAMEREQD)) + printf("could not resolve hostname"); +else + printf("host=%s\en", hbuf); +.fi +.in +.PP +.\"O An example program using +.\"O .BR getnameinfo () +.\"O can be found in +.\"O .BR getaddrinfo (3). +.BR getnameinfo () +¤ò»È¤Ã¤¿¥×¥í¥°¥é¥àÎ㤬 +.BR getaddrinfo (3) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR accept (2), +.BR getpeername (2), +.BR getsockname (2), +.BR recvfrom (2), +.BR socket (2), +.BR getaddrinfo (3), +.BR gethostbyaddr (3), +.BR getservbyname (3), +.BR getservbyport (3), +.BR inet_ntop (3), +.BR hosts (5), +.BR services (5), +.BR hostname (7), +.BR named (8) +.LP +R. Gilligan, S. Thomson, J. Bound and W. Stevens, +.IR "Basic Socket Interface Extensions for IPv6" , +RFC\ 2553, March 1999. +.LP +Tatsuya Jinmei and Atsushi Onoe, +.IR "An Extension of Format for IPv6 Scoped Addresses" , +internet draft, work in progress. +ftp://ftp.ietf.org/internet\-drafts/draft\-ietf\-ipngwg\-scopedaddr\-format\-02.txt +.LP +Craig Metz, +.IR "Protocol Independence Using the Sockets API" , +Proceedings of the freenix track: +2000 USENIX annual technical conference, June 2000. +http://www.usenix.org/publications/library/proceedings/usenix2000/freenix/metzprotocol.html diff --git a/draft/man3/getnetent.3 b/draft/man3/getnetent.3 new file mode 100644 index 00000000..5eea8ba3 --- /dev/null +++ b/draft/man3/getnetent.3 @@ -0,0 +1,201 @@ +.\" 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 Sat Jul 24 21:48:06 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-03-01, NAKANO Takeo +.\" Modified 1998-06-22, NAKANO Takeo +.\" Updated 2008-09-19, Akihiro MOTOKI +.\" +.TH GETNETENT 3 2008-08-19 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \- +.\"O get network entry +getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \- ¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B struct netent *getnetent(void); +.sp +.BI "struct netent *getnetbyname(const char *" name ); +.sp +.BI "struct netent *getnetbyaddr(uint32_t " net ", int " type ); +.sp +.BI "void setnetent(int " stayopen ); +.sp +.B void endnetent(void); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR getnetent () +.\"O function reads the next entry from the networks database +.\"O and returns a \fInetent\fP structure containing +.\"O the broken-out fields from the entry. +.\"O A connection is opened to the database if necessary. +.BR getnetent () +´Ø¿ô¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¼¡¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤ß¡¢ +¤½¤Î¥¨¥ó¥È¥ê¤ò \fInetent\fP ¹½Â¤ÂΤÎÍ×ÁÇÊ̤Υե£¡¼¥ë¥É¤Ë³ÊǼ¤·¡¢ +¤½¤Î¹½Â¤ÂΤòÊÖ¤¹¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR getnetbyname () +.\"O function returns a \fInetent\fP structure +.\"O for the entry from the database +.\"O that matches the network \fIname\fP. +.BR getnetbyname () +´Ø¿ô¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯Ì¾ \fIname\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fInetent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR getnetbyaddr () +.\"O function returns a \fInetent\fP structure +.\"O for the entry from the database +.\"O that matches the network number \fInet\fP of type +.\"O \fItype\fP. +.\"O The +.\"O .I net +.\"O argument must be in host byte order. +.BR getnetbyaddr () +´Ø¿ô¤Ï¡¢\fItype\fP ·¿¤Î¥Í¥Ã¥È¥ï¡¼¥¯ÈÖ¹æ \fInet\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fInetent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£ +.I net +°ú¤­¿ô¤Ï¥Û¥¹¥È¡¦¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR setnetent () +.\"O function opens a connection to the database, +.\"O and sets the next entry to the first entry. +.\"O If \fIstayopen\fP is nonzero, +.\"O then the connection to the database +.\"O will not be closed between calls to one of the +.\"O .BR getnet* () +.\"O functions. +.BR setnetent () +´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥ª¡¼¥×¥ó¤·¡¢ +¼¡¤ÎÆɤ߹þ¤ß¥¨¥ó¥È¥ê¤òÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤹ¤ë¡£ +\fIstayopen\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢ +°ì¤Ä°ì¤Ä¤Î +.BR getnet* () +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR endnetent () +.\"O function closes the connection to the database. +.BR endnetent () +´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +.\"O The \fInetent\fP structure is defined in \fI\fP as follows: +\fInetent\fP ¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +struct netent { + char *n_name; /* official network name */ + char **n_aliases; /* alias list */ + int n_addrtype; /* net address type */ + uint32_t n_net; /* network number */ +} +.fi +.in +.PP +.\"O The members of the \fInetent\fP structure are: +\fInetent\fP ¹½Â¤ÂΤΥá¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ +.RS +.TP 12 +.I n_name +.\"O The official name of the network. +¥Í¥Ã¥È¥ï¡¼¥¯¤ÎÀµ¼°Ì¾ (official name)¡£ +.TP +.I n_aliases +.\"O A NULL-terminated list of alternative names for the network. +¥Í¥Ã¥È¥ï¡¼¥¯¤ÎÊÌ̾¤«¤é¤Ê¤ë¥ê¥¹¥È¡£ +¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.TP +.I n_addrtype +.\"O The type of the network number; always +.\"O .BR AF_INET . +¥Í¥Ã¥È¥ï¡¼¥¯ÈÖ¹æ¤Î·Á¼°¡£¸½ºß¤Ï +.B AF_INET +¤Î¤ß¡£ +.TP +.I n_net +.\"O The network number in host byte order. +¥Û¥¹¥È¡¦¥Ð¥¤¥È¥ª¡¼¥À·Á¼°¤Î¥Í¥Ã¥È¥ï¡¼¥¯Èֹ档 +.RE +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR getnetent (), +.\"O .BR getnetbyname () +.\"O and +.\"O .BR getnetbyaddr () +.\"O functions return a pointer to a +.\"O statically allocated \fInetent\fP structure, or a NULL pointer if an +.\"O error occurs or the end of the file is reached. +.BR getnetent (), +.BR getnetbyname (), +.BR getnetbyaddr () +´Ø¿ô¤Ï¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ \fInetent\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.\"O .I /etc/networks +.\"O networks database file +.I /etc/networks +¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O In glibc versions before 2.2, the +.\"O .I net +.\"O argument of +.\"O .BR getnetbyaddr () +.\"O was of type +.\"O .IR long . +¥Ð¡¼¥¸¥ç¥ó 2.2 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢ +.BR getnetbyaddr () +¤Î°ú¤­¿ô +.I net +¤Ï +.I long +·¿¤À¤Ã¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getnetent_r (3), +.BR getprotoent (3), +.BR getservent (3) +.\" .BR networks (5) +.br +RFC\ 1101 diff --git a/draft/man3/getopt.3 b/draft/man3/getopt.3 new file mode 100644 index 00000000..d5d3e23c --- /dev/null +++ b/draft/man3/getopt.3 @@ -0,0 +1,800 @@ +.\" 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:27:50 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon Aug 30 22:02:34 1995 by Jim Van Zandt +.\" longindex is a pointer, has_arg can take 3 values, using consistent +.\" names for optstring and longindex, "\n" in formats fixed. Documenting +.\" opterr and getopt_long_only. Clarified explanations (borrowing heavily +.\" from the source code). +.\" 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 +.\" 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 Í×ÁÇ +.\" +.TH GETOPT 3 2010-02-03 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getopt(int " argc ", char * const " argv[] , +.BI " const char *" optstring ); +.sp +.BI "extern char *" optarg ; +.BI "extern int " optind ", " opterr ", " optopt ; +.sp +.B #include +.sp +.BI "int getopt_long(int " argc ", char * const " argv[] , +.BI " const char *" optstring , +.BI " const struct option *" longopts ", int *" longindex ); +.sp +.BI "int getopt_long_only(int " argc ", char * const " argv[] , +.BI " const char *" optstring , +.BI " const struct option *" longopts ", int *" longindex ); +.fi +.sp +.in -4n +.\"O Feature Test Macro Requirements for glibc (see +.\"O .BR feature_test_macros (7)): +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.ad l +.in +.sp +.BR getopt (): +_POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE +.br +.BR getopt_long (), +.BR getopt_long_only (): +_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 () +¤Ï¡¢·«¤êÊÖ¤·¸Æ¤Ó½Ð¤µ¤ì¤ë¤´¤È¤Ë¡¢¼¡¤Î¥ª¥×¥·¥ç¥óʸ»ú¤òÊÖ¤¹¡£ +.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 +¤Î¥¹¥­¥ã¥ó¤ò¤ä¤êľ¤·¤¿¤ê¡¢¿·¤·¤¤°ú¤­¿ô¥Ù¥¯¥È¥ë¤ò¥¹¥­¥ã¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.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 Í×ÁǤΥ¹¥­¥ã¥ó¤ò·Ñ³¤Ç¤­¤ë¡£ +.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 ¤ÎÍ×ÁǤΤ¦¤Á¡¢ +¥ª¥×¥·¥ç¥ó¤Ç¤Ê¤¤ºÇ½é¤ÎÍ×ÁǤò¼¨¤¹¤è¤¦¤Ë¤Ê¤ë¡£ +.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 °ÊÁ°¤Î¥é¥¤¥Ö¥é¥ê¤Ç¤Ï +ÍøÍѤǤ­¤Ê¤¤¡£ +.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 Í×ÁǤòǤ°Õ¤Î½ç½ø¤Ç¼õ¤±Æþ¤ì¡¢¤«¤Ä¤½¤ì¤é¤Î½ç½ø¤¬ +°ÕÌ£¤ò»ý¤Ä¤è¤¦¤Ë½ñ¤«¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë)¡£ +"\-\-" ¤ÏÆüì¤Ê°ú¤­¿ô¤Ç¡¢¥¹¥­¥ã¥ó¤Î¥â¡¼¥É¤Ë¤è¤é¤º¡¢ +¥ª¥×¥·¥ç¥ó¤Î¥¹¥­¥ã¥ó¤ò¶¯À©Åª¤Ë½ªÎ»¤µ¤»¤ë¡£ +.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 ¤Ë¤·¤Æ¤ª¤±¤Ð¡¢ +¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Îɽ¼¨¤òÍÞÀ©¤Ç¤­¤ë¡£ +.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" +¤È¸À¤¦·Á¼°¤Ç»ØÄꤹ¤ë¡£ +.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 +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.in +4n +.nf +.sp +struct option { + const char *name; + int has_arg; + int *flag; + int val; +}; +.fi +.in +.PP +.\"O The meanings of the different fields are: +¤½¤ì¤¾¤ì¤Î¥Õ¥£¡¼¥ë¥É¤Î°ÕÌ£¤Ï°Ê²¼¤ÎÄ̤ꡣ +.TP +.I name +.\"O is the name of the long option. +Ť¤¥ª¥×¥·¥ç¥ó¤Î̾Á°¡£ +.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 +\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 +¤«¤é¤ÎÁêÂаÌÃ֤Ȥ·¤ÆÊÝ»ý¤·¤Æ¤¤¤ëÊÑ¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ë¡£ +.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 ¤Ç»Ï¤Þ¤ë +("\-\-" °Ê³°¤Î) ¥ª¥×¥·¥ç¥ó¤¬¡¢Ä¹¤¤¤â¤Î¤Ë¤Ï¥Þ¥Ã¥Á¤·¤Ê¤¤¤¬Ã»¤¤¤â¤Î¤Ë +¥Þ¥Ã¥Á¤¹¤ë¾ì¹ç¤Ë¤ª¤¤¤Æ¤Ï¡¢¤½¤ì¤Ïû¤¤¥ª¥×¥·¥ç¥ó¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +.\"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 ¤òÊÖ¤¹¡£ +.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 +.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" +.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 ¤ÎÍ×ÁǤÏËÜÅö¤Î°ÕÌ£¤Ç¤ÎÄê¿ô¤Ë¤Ï¤Ê¤é¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é½ç½ø¤¬Êѹ¹¤µ¤ì¤Æ¤·¤Þ¤¦¤«¤é¤Ç¤¢¤ë¡£ +¤¿¤À¤·¤½¤ì¤é¤Ï¡¢¥×¥í¥È¥¿¥¤¥×¤Ç¤ÏÄê¿ô¤Ç¤¢¤ë¤«¤Î¤è¤¦¤Ë¤·¤Æ¤¢¤ë¡£ +¤³¤ì¤Ï¾¤Î¥·¥¹¥Æ¥à¤È¤Î¸ß´¹À­¤Î¤¿¤á¤Ç¤¢¤ë¡£ + +.\"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 ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë. + +.\"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 (): +¤³¤ì¤é¤Î´Ø¿ô¤Ï 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 +¤Î 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 +.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" +¤Ç¤¢¤ë¡£ +.nf +.sp +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int flags, opt; + int nsecs, tfnd; + + nsecs = 0; + tfnd = 0; + flags = 0; + while ((opt = getopt(argc, argv, "nt:")) != \-1) { + switch (opt) { + case \(aqn\(aq: + flags = 1; + break; + case \(aqt\(aq: + nsecs = atoi(optarg); + tfnd = 1; + break; + default: /* \(aq?\(aq */ + fprintf(stderr, "Usage: %s [\-t nsecs] [\-n] name\\n", + argv[0]); + exit(EXIT_FAILURE); + } + } + + printf("flags=%d; tfnd=%d; optind=%d\\n", flags, tfnd, optind); + + if (optind >= argc) { + fprintf(stderr, "Expected argument after options\\n"); + exit(EXIT_FAILURE); + } + + printf("name argument = %s\\n", argv[optind]); + + /* Other code omitted */ + + exit(EXIT_SUCCESS); +} +.fi +.PP +.\"O The following example program illustrates the use of +.\"O .BR getopt_long () +.\"O with most of its features. +°Ê²¼¤Ï¡¢ +.BR getopt_long () +¤Î»ÈÍÑË¡¤ò¡¢¤Û¤Ü¤¹¤Ù¤Æ¤Îµ¡Ç½¤Ë¤Ä¤¤¤Æ¼¨¤·¤¿¥×¥í¥°¥é¥à¤ÎÎã¤Ç¤¢¤ë¡£ +.nf +.sp +#include /* for printf */ +#include /* for exit */ +#include + +int +main(int argc, char **argv) { + int c; + int digit_optind = 0; + + while (1) { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 1, 0, \(aqc\(aq}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long(argc, argv, "abc:d:012", + long_options, &option_index); + if (c == \-1) + break; + + switch (c) { + case 0: + printf("option %s", long_options[option_index].name); + if (optarg) + printf(" with arg %s", optarg); + printf("\\n"); + 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"); + digit_optind = this_option_optind; + printf("option %c\\n", c); + break; + + case \(aqa\(aq: + printf("option a\\n"); + break; + + case \(aqb\(aq: + printf("option b\\n"); + break; + + case \(aqc\(aq: + printf("option c with value \(aq%s\(aq\\n", optarg); + break; + + case \(aqd\(aq: + printf("option d with value \(aq%s\(aq\\n", optarg); + break; + + case \(aq?\(aq: + break; + + default: + printf("?? getopt returned character code 0%o ??\\n", c); + } + } + + if (optind < argc) { + printf("non-option ARGV\-elements: "); + while (optind < argc) + printf("%s ", argv[optind++]); + printf("\\n"); + } + + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getsubopt (3), +.BR feature_test_macros (7) diff --git a/draft/man3/getpass.3 b/draft/man3/getpass.3 new file mode 100644 index 00000000..e783e409 --- /dev/null +++ b/draft/man3/getpass.3 @@ -0,0 +1,231 @@ +.\" Copyright (c) 2000 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) 1997 Hiroaki Nagoya +.\" all rights reserved. +.\" Translated Mon Sep 21 20:47:50 JST 1998 by Hiroaki Nagoya +.\" Updated&Modified Fri 9 Feb 2001 by NAKANO Takeo +.\" +.TH GETPASS 3 2000-12-05 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O getpass \- get a password +.SH ̾Á° +getpass \- ¥Ñ¥¹¥ï¡¼¥É¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "char *getpass( const char *" prompt ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This function is obsolete. +.\"O Do not use it. +¤³¤Î´Ø¿ô¤Ï obsolete ¤Ç¤¢¤ë¡£ÍѤ¤¤Ê¤¤¤³¤È¡£ +.PP +.\"O The +.\"O .BR getpass () +.\"O function opens +.\"O .I /dev/tty +.\"O (the controlling terminal of the process), outputs the string +.\"O .IR prompt , +.\"O turns off echoing, reads one line (the "password"), +.\"O restores the terminal state and closes +.\"O .I /dev/tty +.\"O again. +.BR getpass () +´Ø¿ô¤Ï +.I /dev/tty +(¥×¥í¥»¥¹¤ÎÀ©¸æüËö) ¤ò¥ª¡¼¥×¥ó¤·¡¢Ê¸»úÎó +.I prompt +¤ò½ÐÎϤ¹¤ë¡£¤½¤·¤Æ echo ¤ò¥ª¥Õ¤Ë¤·¡¢°ì¹Ô (¡Ö¥Ñ¥¹¥ï¡¼¥É¡×) +¤òÆɤ߹þ¤ß¡¢Ã¼Ëö¤Î¾õÂÖ¤ò¸µ¤ËÌᤷ¤Æ¡¢ºÆ¤Ó +.I /dev/tty +¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The function +.\"O .BR getpass () +.\"O returns a pointer to a static buffer containing (the first +.\"O .B PASS_MAX +.\"O bytes of) the password without the trailing +.\"O newline, terminated by a null byte (\(aq\\0\(aq). +.\"O This buffer may be overwritten by a following call. +.\"O On error, the terminal state is restored, +.\"O .I errno +.\"O is set appropriately, and NULL is returned. +.BR getpass () +´Ø¿ô¤ÏÆþÎϤµ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É +(¤ÎºÇ½é¤Î +.B PASS_MAX +¥Ð¥¤¥È¤Þ¤Ç) ¤¬½ñ¤­¤³¤Þ¤ì¤¿¡¢ +¥¹¥¿¥Æ¥£¥Ã¥¯¤Ê¥Ð¥Ã¥Õ¥¡¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +ËöÈø¤Î²þ¹Ô¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£¤³¤Îʸ»úÎó¤Ï NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +¤³¤Î¥Ð¥Ã¥Õ¥¡¡¼¤Ï¡¢°Ê¹ß¤Î´Ø¿ô¥³¡¼¥ë¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¥¨¥é¡¼¤¬µ¯¤³¤ë¤È¡¢Ã¼Ëö¤Î¾õÂÖ¤òÉü¸µ¤·¡¢ +.I errno +¤òŬÀÚ¤ÊÃͤËÀßÄꤷ¤Æ¡¢NULL ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O The function may fail if +¤³¤Î´Ø¿ô¤Ï°Ê²¼¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¼ºÇÔ¤·¤¦¤ë¡£ +.TP +.B ENXIO +.\"O The process does not have a controlling terminal. +¥×¥í¥»¥¹¤¬À©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.I /dev/tty +.\"O .\" .SH HISTORY +.\" .SH ÍúÎò +.\"O .\" A +.\"O .\" .BR getpass () +.\"O .\" function appeared in Version 7 AT&T UNIX. +.\" .BR getpass () +.\" ´Ø¿ô¤Ï Version 7 AT&T UNIX ¤ÇÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Present in SUSv2, but marked LEGACY. +.\"O Removed in POSIX.1-2001. +SUSv2 ¤Ë¤Ï¸ºß¤¹¤ë¤¬¡¢²áµî¤Î̾»Ä (LEGACY) ¤È°ÌÃÖÉÕ¤±¤é¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Çºï½ü¤µ¤ì¤¿¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O For libc4 and libc5, the prompt is not written to +.\"O .I /dev/tty +.\"O but to +.\"O .IR stderr . +.\"O Moreover, if +.\"O .I /dev/tty +.\"O cannot be opened, the password is read from +.\"O .IR stdin . +.\"O The static buffer has length 128 so that only the first 127 +.\"O bytes of the password are returned. +.\"O While reading the password, signal generation +.\"O .RB ( SIGINT , +.\"O .BR SIGQUIT , +.\"O .BR SIGSTOP , +.\"O .BR SIGTSTOP ) +.\"O is disabled and the corresponding characters +.\"O (usually control-C, control-\e, control-Z and control-Y) +.\"O are transmitted as part of the password. +.\"O Since libc 5.4.19 also line editing is disabled, so that also +.\"O backspace and the like will be seen as part of the password. +libc4 ¤È libc5 ¤Ç¤Ï¡¢ +.I prompt +¤Ï +.I /dev/tty +¤Ë¤Ç¤Ï¤Ê¤¯ +.I stderr +¤Ë½ÐÎϤµ¤ì¤¿¡£¤µ¤é¤Ë¡¢ +.I /dev/tty +¤¬¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ñ¥¹¥ï¡¼¥É¤Ï +.I stdin +¤«¤éÆɤ߹þ¤Þ¤ì¤¿¡£ +¥¹¥¿¥Æ¥£¥Ã¥¯¤Ê¥Ð¥Ã¥Õ¥¡¡¼¤ÎŤµ¤Ï 128 ¥Ð¥¤¥È¤À¤Ã¤¿¤Î¤Ç¡¢ +¥Ñ¥¹¥ï¡¼¥É¤ÎºÇ½é¤Î 127 ʸ»ú¤À¤±¤¬ÊÖ¤µ¤ì¤¿¡£ +¥Ñ¥¹¥ï¡¼¥É¤òÆɤó¤Ç¤¤¤ëÅÓÃæ¤Ë¤Ï¡¢¥·¥°¥Ê¥ë¤Îȯ¹Ô +.RB ( SIGINT , +.BR SIGQUIT , +.BR SIGSTOP , +.BR SIGTSTOP ) +¤Ï̵¸ú¤Ë¤µ¤ì¡¢ +¤½¤ì¤¾¤ì¤ËÂбþ¤¹¤ëʸ»ú (Ä̾ï¤Ï Ctrl-C, Ctrl-\e, Ctrl-Z, Ctrl-Y) +¤Ï¤½¤Î¤Þ¤Þ¥Ñ¥¹¥ï¡¼¥É¤Î°ìÉô¤È¤·¤ÆÅϤµ¤ì¤¿¡£ +libc 5.4.19 ¤«¤é¤Ï¹ÔÊÔ½¸¤¬Ìµ¸ú¤Ë¤µ¤ì¡¢ +¤·¤¿¤¬¤Ã¤Æ¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤Ê¤É¤â¥Ñ¥¹¥ï¡¼¥É¤Î°ìÉô¤È¤ß¤Ê¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +.PP +.\"O For glibc2, if +.\"O .I /dev/tty +.\"O cannot be opened, the prompt is written to +.\"O .I stderr +.\"O and the password is read from +.\"O .IR stdin . +.\"O There is no limit on the length of the password. +.\"O Line editing is not disabled. +glibc2 ¤Ç¤Ï¡¢ +.I /dev/tty +¤¬¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï +.I prompt +¤Ï +.I stderr +¤Ë½ñ¤­½Ð¤µ¤ì¡¢¥Ñ¥¹¥ï¡¼¥É¤Ï +.I stdin +¤«¤éÆɤ߹þ¤Þ¤ì¤¿¡£ +¥Ñ¥¹¥ï¡¼¥É¤ÎŤµ¤Ë¤ÏÀ©¸Â¤Ï¤Ê¤¯¡¢ +¹ÔÊÔ½¸¤â̵¸ú¤Ë¤Ï¤µ¤ì¤Ê¤«¤Ã¤¿¡£ +.PP +.\"O According to the SUSv2, the value of +.\"O .B PASS_MAX +.\"O must be defined in +.\"O .I +.\"O in case it is smaller than 8, and can in any case be obtained using +.\"O .IR sysconf(_SC_PASS_MAX) . +.\"O However, POSIX.2 withdraws the constants +.\"O .B PASS_MAX +.\"O and +.\"O .BR _SC_PASS_MAX , +.\"O and the function +.\"O .BR getpass (). +.\"O Libc4 and libc5 have never supported +.\"O .B PASS_MAX +.\"O or +.\"O .BR _SC_PASS_MAX . +.\"O Glibc2 accepts +.\"O .B _SC_PASS_MAX +.\"O and returns +.\"O .B BUFSIZ +.\"O (e.g., 8192). +SUSv2 ¤Ë¤è¤ì¤Ð¡¢ +.B PASS_MAX +¤ÎÃͤ¬ 8 °Ê²¼¤Î¾ì¹ç¤Ï¡¢¤³¤ÎÃÍ¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤¤¤º¤ì¤Î¾ì¹ç¤Ç¤â¤³¤ÎÃÍ¤Ï +.I sysconf(_SC_PASS_MAX) +¤Ë¤è¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£ +¤·¤«¤·¡¢POSIX.2 ¤ÏÄê¿ô +.BR PASS_MAX , +.B _SC_PASS_MAX +¤È´Ø¿ô +.BR getpass () +¤ò¼è¤ê²¼¤²¤¿¡£ +libc4 ¤È libc5 ¤Ç¤Ï¡¢ +.B PASS_MAX +¤È +.B _SC_PASS_MAX +¤Ï°ìÅ٤⥵¥Ý¡¼¥È¤µ¤ì¤¿¤³¤È¤Ï¤Ê¤¤¡£ +glibc2 ¤Ï +.B _SC_PASS_MAX +¤ò¼õÉÕ¤±¡¢ +.B BUFSIZE +(Î㤨¤Ð 8192) ¤òÊÖ¤¹¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The calling process should zero the password as soon as possible to avoid +.\"O leaving the cleartext password visible in the process's address space. +¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¡¢ +¤Ç¤­¤ë¸Â¤êÁ᤯¤½¤Î¥Ñ¥¹¥ï¡¼¥É¤ò¾Ãµî (¥¼¥í¥¯¥ê¥¢) ¤·¡¢ +¥¯¥ê¥¢¥Æ¥­¥¹¥È¤Î¥Ñ¥¹¥ï¡¼¥É¤¬ +¤½¤Î¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ç¸«¤¨¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR crypt (3) diff --git a/draft/man3/getprotoent.3 b/draft/man3/getprotoent.3 new file mode 100644 index 00000000..4c18aca8 --- /dev/null +++ b/draft/man3/getprotoent.3 @@ -0,0 +1,178 @@ +.\" 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 Sat Jul 24 19:26:03 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Fri Mar 15 1998 by NAKANO Takeo +.\" Updated 2008-09-19, Akihiro MOTOKI +.\" +.TH GETPROTOENT 3 2008-08-19 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O getprotoent, getprotobyname, getprotobynumber, setprotoent, +.\"O endprotoent \- get protocol entry +.SH ̾Á° +getprotoent, getprotobyname, getprotobynumber, setprotoent, endprotoent \- +¥×¥í¥È¥³¥ë¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B struct protoent *getprotoent(void); +.sp +.BI "struct protoent *getprotobyname(const char *" name ); +.sp +.BI "struct protoent *getprotobynumber(int " proto ); +.sp +.BI "void setprotoent(int " stayopen ); +.sp +.B void endprotoent(void); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR getprotoent () +.\"O function reads the next entry from the protocols database (see +.\"O .BR protocols (5)) +.\"O and returns a \fIprotoent\fP structure +.\"O containing the broken-out fields from the entry. +.\"O A connection is opened to the database if necessary. +.BR getprotoent () +´Ø¿ô¤Ï¡¢¥×¥í¥È¥³¥ë¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.RB ( protocols (5) +»²¾È) ¤«¤é¼¡¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤ß¡¢ +¤½¤Î¥¨¥ó¥È¥ê¤ò \fIprotoent\fP ¹½Â¤ÂΤÎÍ×ÁÇÊ̤Υե£¡¼¥ë¥É¤Ë³ÊǼ¤·¡¢ +¤½¤Î¹½Â¤ÂΤòÊÖ¤¹¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR getprotobyname () +.\"O function returns a \fIprotoent\fP structure +.\"O for the entry from the database +.\"O that matches the protocol name \fIname\fP. +.\"O A connection is opened to the database if necessary. +.BR getprotobyname () +´Ø¿ô¤Ï¡¢¥×¥í¥È¥³¥ë̾ \fIname\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fIprotoent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR getprotobynumber () +.\"O function returns a \fIprotoent\fP structure +.\"O for the entry from the database +.\"O that matches the protocol number \fInumber\fP. +.\"O A connection is opened to the database if necessary. +.BR getprotobynumber () +´Ø¿ô¤Ï¡¢¥×¥í¥È¥³¥ëÈÖ¹æ \fInumber\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fIprotoent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR setprotoent () +.\"O function opens a connection to the database, +.\"O and sets the next entry to the first entry. +.\"O If \fIstayopen\fP is nonzero, +.\"O then the connection to the database +.\"O will not be closed between calls to one of the +.\"O .BR getproto* () +.\"O functions. +.BR setprotoent () +´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥ª¡¼¥×¥ó¤·¡¢ +¼¡¤ÎÆɤ߹þ¤ß¥¨¥ó¥È¥ê¤òÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤹ¤ë¡£ +\fIstayopen\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢ +°ì¤Ä°ì¤Ä¤Î +.BR getproto* () +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR endprotoent () +.\"O function closes the connection to the database. +.BR endprotoent () +´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +.\"O The \fIprotoent\fP structure is defined in \fI\fP as follows: +\fIprotoent\fP ¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +struct protoent { + char *p_name; /* official protocol name */ + char **p_aliases; /* alias list */ + int p_proto; /* protocol number */ +} +.fi +.in +.PP +.\"O The members of the \fIprotoent\fP structure are: +\fIprotoent\fP ¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Ï°Ê²¼¤ÎÄ̤ꡣ +.RS +.TP 12 +.I p_name +.\"O The official name of the protocol. +¥×¥í¥È¥³¥ë¤ÎÀµ¼°Ì¾ (official name)¡£ +.TP +.I p_aliases +.\"O A NULL-terminated list of alternative names for the protocol. +¥×¥í¥È¥³¥ë¤ÎÊÌ̾¤Î¥ê¥¹¥È¡£ +¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.TP +.I p_proto +.\"O The protocol number. +¥×¥í¥È¥³¥ë¤ÎÈÖ¹æ +.RE +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR getprotoent (), +.\"O .BR getprotobyname () +.\"O and +.\"O .BR getprotobynumber () +.\"O functions return a pointer to a +.\"O statically allocated \fIprotoent\fP structure, or a NULL pointer if an +.\"O error occurs or the end of the file is reached. +.BR getprotoent (), +.BR getprotobyname (), +.BR getprotobynumber () +´Ø¿ô¤Ï¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ \fIprotoent\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë㤷¤¿¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.PD 0 +.TP +.I /etc/protocols +.\"O protocol database file +¥×¥í¥È¥³¥ë¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.PD +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getnetent (3), +.BR getprotoent_r (3), +.BR getservent (3), +.BR protocols (5) diff --git a/draft/man3/getpt.3 b/draft/man3/getpt.3 new file mode 100644 index 00000000..37704d7c --- /dev/null +++ b/draft/man3/getpt.3 @@ -0,0 +1,95 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This man page was written by Jeremy Phelps . +.\" Redistribute and modify at will. +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 01:44:54 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: pseudo-terminal µ¼»÷üËö +.\"WORD: specific Æȼ«¤Î +.\" +.TH GETPT 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O getpt \- open the pseudo-terminal master (PTM) +.SH ̾Á° +getpt \- µ¼»÷üËö¥Þ¥¹¥¿ (PTM) ¤ò¥ª¡¼¥×¥ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.B "int getpt(void);" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR getpt () +.\"O opens a pseudo-terminal master and returns its file descriptor. +.BR getpt () +¤Ï¡¢µ¼»÷üËö¥Þ¥¹¥¿¤ò¥ª¡¼¥×¥ó¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.\"O It is equivalent to +.\"O .nf +.\"O +.\"O open(/dev/ptmx, O_RDWR | O_NOCTTY); +.\"O +.\"O .fi +.\"O on Linux systems, though the pseudo-terminal master is located +.\"O elsewhere on some systems that use GNU Libc. +¤³¤ì¤Ï¡¢ Linux ¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¤Ï +.nf + + open(/dev/ptmx, O_RDWR | O_NOCTTY); + +.fi +¤ÈÅù²Á¤Ç¤¢¤ë¡£Ã¢¤·¡¢ GNU Libc ¤ò»ÈÍѤ·¤Æ¤¤¤Æ¤â¡¢ +µ¼»÷üËö¥Þ¥¹¥¿¤¬¤É¤³¤«Â¾¤Î¾ì½ê¤Ë¤¢¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR getpt () +.\"O returns an open file descriptor upon successful completion. +.\"O Otherwise, it +.\"O returns \-1 and sets +.\"O .I errno +.\"O to indicate the error. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR getpt () +¤Ï¥ª¡¼¥×¥ó¤·¤¿¥Õ¥¡¥¤¥ë¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O .BR getpt () +.\"O can fail with various errors described in +.\"O .BR open (2). +.BR getpt () +¤Ï +.BR open (2) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¼ï¡¹¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR getpt () +.\"O is provided in glibc since version 2.1. +.BR getpt () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O .BR getpt () +.\"O is glibc-specific; +.\"O use +.\"O .BR posix_openpt (3) +.\"O instead. +.BR getpt () +¤Ï glibc Æȼ«¤Ç¤¢¤ë¡£Âå¤ï¤ê¤Ë +.BR posix_openpt (3) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR grantpt (3), +.BR posix_openpt (3), +.BR ptsname (3), +.BR unlockpt (3), +.BR ptmx (4), +.BR pty (7) diff --git a/draft/man3/getpw.3 b/draft/man3/getpw.3 new file mode 100644 index 00000000..94bad7f4 --- /dev/null +++ b/draft/man3/getpw.3 @@ -0,0 +1,150 @@ +.\" 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 Sat Jul 24 19:23:25 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon May 27 21:37:47 1996 by Martin Schulze (joey@linux.de) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-19, HIROFUMI Nishizuka +.\" Modified 1999-12-08, Kentaro Shirakata +.\" Modified 2005-09-04, Akihiro MOTOKI +.\" Modified 2008-07-23, Kentaro Shirakata +.\" +.TH GETPW 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getpw \- Re-construct password line entry +getpw \- ¥Ñ¥¹¥ï¡¼¥É¹Ô¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.B #include +.sp +.BI "int getpw(uid_t " uid ", char *" buf ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR getpw () +.\"O function reconstructs the password line entry for +.\"O the given user ID \fIuid\fP in the buffer \fIbuf\fP. +.\"O The returned buffer contains a line of format +.BR getpw () +´Ø¿ô¤Ï¡¢¥Ð¥Ã¥Õ¥¡ \fIbuf\fP ¤Ë»ØÄê¥æ¡¼¥¶ ID \fIuid\fP ¤Î +¥Ñ¥¹¥ï¡¼¥É¹Ô¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë¡£ +ÊÖ¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ï¡¢°Ê²¼¤Î·Á¼°¤Î¹Ô¤ò´Þ¤à¡£ +.sp +.in +4n +.B name:passwd:uid:gid:gecos:dir:shell +.in +.PP +.\"O The \fIpasswd\fP structure is defined in \fI\fP as follows: +\fIpasswd\fP ¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct passwd { + char *pw_name; /* username */ + char *pw_passwd; /* user password */ + uid_t pw_uid; /* user ID */ + gid_t pw_gid; /* group ID */ + char *pw_gecos; /* real name */ + char *pw_dir; /* home directory */ + char *pw_shell; /* shell program */ +}; +.fi +.in +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR getpw () +.\"O function returns 0 on success; on error, it returns \-1, and +.\"O .I errno +.\"O is set to indicate the error. +.BR getpw () +´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹; ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç \-1 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤ò +¼¨¤¹¤¿¤á¤Ë +.I error +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O .I buf +.\"O is NULL. +.I buf +¤¬ NULL¡£ +.TP +.B ENOENT +.\"O No user corresponding to +.\"O .IR uid . +.I uid +¤ËÂбþ¤¹¤ë¥æ¡¼¥¶¤¬¤¤¤Ê¤¤¡£ +.TP +.B ENOMEM +.\"O Insufficient memory to allocate +.\"O .I passwd +.\"O structure. +.I passwd +¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/passwd +.\"O password database file +¥Ñ¥¹¥ï¡¼¥É¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O SVr2. +SVr2 +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The +.\"O .BR getpw () +.\"O function is dangerous as it may overflow the provided buffer +.\"O .IR buf . +.BR getpw () +´Ø¿ô¤Ï¡¢Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡ +.I buf +¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç´í¸±¤Ç¤¢¤ë¡£ +.\"O It is obsoleted by +.\"O .BR getpwuid (3). +¤³¤Î´Ø¿ô¤Ï +.BR getpwuid (3) +¤Ë¤è¤Ã¤Æ¸Å¤¤¤â¤Î¤È¤Ê¤Ã¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR endpwent (3), +.BR fgetpwent (3), +.BR getpwent (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR putpwent (3), +.BR setpwent (3), +.BR passwd (5) diff --git a/draft/man3/getpwent.3 b/draft/man3/getpwent.3 new file mode 100644 index 00000000..285ad6f5 --- /dev/null +++ b/draft/man3/getpwent.3 @@ -0,0 +1,226 @@ +.\" 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 Sat Jul 24 19:22:14 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon May 27 21:37:47 1996 by Martin Schulze (joey@linux.de) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-18, HIROFUMI Nishizuka +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" +.TH GETPWENT 3 2009-03-30 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getpwent, setpwent, endpwent \- get password file entry +getpwent, setpwent, endpwent \- ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤Î¼èÆÀ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.B struct passwd *getpwent(void); +.sp +.B void setpwent(void); +.sp +.B void endpwent(void); +.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 getpwent (), +.BR setpwent (), +.BR endpwent (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE > = 500 +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR getpwent () +.\"O function returns a pointer to a structure containing +.\"O the broken-out fields of a record from the password database +.\"O (e.g., the local password file +.\"O .IR /etc/passwd , +.\"O NIS, and LDAP). +.\"O The first time it +.\"O is called it returns the first entry; thereafter, it returns successive +.\"O entries. +.BR getpwent () +´Ø¿ô¤Ï¡¢¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¼èÆÀ¤·¤¿¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹ +(¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÎã: +¥í¡¼¥«¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë +.IR /etc/passwd , +NIS, LDAP)¡£ +ºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤ÏºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤·¡¢¤½¤ì°Ê¹ß¤Ï +¸Æ¤Ó½Ð¤µ¤ì¤ëËè¤Ë¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR setpwent () +.\"O function rewinds to the beginning +.\"O of the password database. +.BR setpwent () +´Ø¿ô¤ò»È¤¦¤È¡¢¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀèƬ¤ËÌá¤ë¡£ +.PP +.\"O The +.\"O .BR endpwent () +.\"O function is used to close the password database +.\"O after all processing has been performed. +.BR endpwent () +´Ø¿ô¤Ï¡¢Á´¤Æ¤Î½èÍý¤¬½ª¤ï¤Ã¤¿¸å¤Ë¥Ñ¥¹¥ï¡¼¥É¡¦ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +.\"O The \fIpasswd\fP structure is defined in \fI\fP as follows: +\fIpasswd\fP ¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct passwd { +.\"O char *pw_name; /* username */ +.\"O char *pw_passwd; /* user password */ +.\"O uid_t pw_uid; /* user ID */ +.\"O gid_t pw_gid; /* group ID */ +.\"O char *pw_gecos; /* real name */ +.\"O char *pw_dir; /* home directory */ +.\"O char *pw_shell; /* shell program */ +.\"O char *pw_name; /* ¥æ¡¼¥¶Ì¾ */ + char *pw_passwd; /* ¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É */ + uid_t pw_uid; /* ¥æ¡¼¥¶ ID */ + gid_t pw_gid; /* ¥°¥ë¡¼¥× ID */ + char *pw_gecos; /* ¼Â̾ */ + char *pw_dir; /* ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê */ + char *pw_shell; /* ¥·¥§¥ë¥×¥í¥°¥é¥à */ +}; +.fi +.in +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR getpwent () +.\"O function returns a pointer to a +.\"O .I passwd +.\"O structure, or NULL if +.\"O there are no more entries or an error occurs. +.\"O If an error occurs, +.\"O .I errno +.\"O is set appropriately. +.\"O If one wants to check +.\"O .I errno +.\"O after the call, it should be set to zero before the call. +.BR getpwent () +´Ø¿ô¤Ï +.I passwd +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ì°Ê¾å¥¨¥ó¥È¥ê¤¬Ìµ¤¤¤«¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +¤³¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¸å¤Ë +.I errno +¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢¸Æ¤Ó½Ð¤·Á°¤Ë +.I errno +¤ò 0 ¤ËÀßÄꤷ¤Æ¤ª¤«¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£ + +.\"O The return value may point to a static area, and may be overwritten +.\"O by subsequent calls to +.\"O .BR getpwent (), +.\"O .BR getpwnam (3), +.\"O or +.\"O .BR getpwuid (3). +.\"O (Do not pass the returned pointer to +.\"O .BR free (3).) +ÊÖ¤êÃͤÏÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤½¤Î¸å¤Î +.BR getpwent (), +.BR getpwnam (3), +.BR getpwuid (3) +¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +(ÊÖ¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤ò +.BR free (3) +¤ËÅϤµ¤Ê¤¤¤³¤È¡£) +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINTR +.\"O A signal was caught. +¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤¿¡£ +.TP +.B EIO +.\"O I/O error. +Æþ½ÐÎÏ¥¨¥é¡¼¡£ +.TP +.B EMFILE +.\"O The maximum number +.\"O .RB ( OPEN_MAX ) +.\"O of files was open already in the calling process. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤¬ +¤¹¤Ç¤Ë¾å¸Â +.RB ( OPEN_MAX ) +¤Ç¤¢¤Ã¤¿¡£ +.TP +.B ENFILE +.\"O The maximum number of files was open already in the system. +¥·¥¹¥Æ¥à¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤¬¤¹¤Ç¤Ë¾å¸Â¤Ç¤¢¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O .\" not in POSIX +.\"O Insufficient memory to allocate +.\"O .I passwd +.\"O structure. +.\"O .\" to allocate the passwd structure, or to allocate buffers +.\" POSIX ¤Ë¤Ï¤Ê¤¤¡£ +.I passwd +¹½Â¤ÂΤ˳ä¤êÅö¤Æ¤ë¥á¥â¥ê¤¬½½Ê¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B ERANGE +.\"O Insufficient buffer space supplied. +½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬¤Ê¤¤¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/passwd +.\"O local password database file +¥í¡¼¥«¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fgetpwent (3), +.BR getpw (3), +.BR getpwent_r (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR putpwent (3), +.BR passwd (5) diff --git a/draft/man3/getpwent_r.3 b/draft/man3/getpwent_r.3 new file mode 100644 index 00000000..a5eecbbb --- /dev/null +++ b/draft/man3/getpwent_r.3 @@ -0,0 +1,263 @@ +.\" 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 Aug 8 00:53:40 JST 2004 +.\" by Yuichi SATO +.\" +.TH GETPWENT_R 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getpwent_r, fgetpwent_r \- get passwd file entry reentrantly +getpwent_r, fgetpwent_r \- ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤ò +¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¼è¤ê½Ð¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getpwent_r(struct passwd *" pwbuf ", char *" buf , +.br +.BI " size_t " buflen ", struct passwd **" pwbufp ); +.sp +.BI "int fgetpwent_r(FILE *" fp ", struct passwd *" pwbuf ", char *" buf , +.br +.BI " size_t " buflen ", struct passwd **" pwbufp ); +.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 getpwent_r (), +_BSD_SOURCE || _SVID_SOURCE +.br +.BR fgetpwent_r (): +_SVID_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The functions +.\"O .BR getpwent_r () +.\"O and +.\"O .BR fgetpwent_r () +.\"O are the reentrant versions of +.\"O .BR getpwent (3) +.\"O and +.\"O .BR fgetpwent (3). +´Ø¿ô +.BR getpwent_r () +¤È +.BR fgetpwent_r () +¤Ï +.BR getpwent (3) +¤È +.BR fgetpwent (3) +¤Î¥ê¥¨¥ó¥È¥é¥ó¥È (reentrant) ÈǤǤ¢¤ë¡£ +.\"O The former reads the next passwd entry from the stream initialized by +.\"O .BR setpwent (3). +Á°¼Ô¤Ï¡¢ +.BR setpwent (3) +¤Ë¤è¤Ã¤Æ½é´ü²½¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤«¤é¡¢¼¡¤Î¥Ñ¥¹¥ï¡¼¥É¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à¡£ +.\"O The latter reads the next passwd entry from the stream +.\"O .IR fp . +¸å¼Ô¤Ï¡¢¥¹¥È¥ê¡¼¥à +.I fp +¤«¤é¼¡¤Î¥Ñ¥¹¥ï¡¼¥É¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à¡£ +.PP +.\"O The \fIpasswd\fP structure is defined in +.\"O .I +.\"O as follows: +\fIpasswd\fP ¹½Â¤ÂÎ¤Ï +.I +¤Ë¤ª¤¤¤Æ°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +struct passwd { +.\"O char *pw_name; /* username */ +.\"O char *pw_passwd; /* user password */ +.\"O uid_t pw_uid; /* user ID */ +.\"O gid_t pw_gid; /* group ID */ +.\"O char *pw_gecos; /* real name */ +.\"O char *pw_dir; /* home directory */ +.\"O char *pw_shell; /* shell program */ + char *pw_name; /* ¥æ¡¼¥¶Ì¾ */ + char *pw_passwd; /* ¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É */ + uid_t pw_uid; /* ¥æ¡¼¥¶ ID */ + gid_t pw_gid; /* ¥°¥ë¡¼¥× ID */ + char *pw_gecos; /* ¼ÂºÝ¤Î̾Á° */ + char *pw_dir; /* ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê */ + char *pw_shell; /* ¥·¥§¥ë¥×¥í¥°¥é¥à */ +}; +.fi +.in +.sp +.\"O The nonreentrant functions return a pointer to static storage, +.\"O where this static storage contains further pointers to user +.\"O name, password, gecos field, home directory and shell. +¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ê¤¤´Ø¿ô¤ÏÀÅŪ¤Ê³ÊǼÎΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ÎÀÅŪ¤Ê³ÊǼÎΰè¤Ë¤Ï¡¢¹¹¤Ë¥æ¡¼¥¶Ì¾¡¦¥Ñ¥¹¥ï¡¼¥É¡¦gecos ¥Õ¥£¡¼¥ë¥É¡¦ +¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¡¦¥·¥§¥ë¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬´Þ¤Þ¤ì¤ë¡£ +.\"O The reentrant functions described here return all of that in +.\"O caller-provided buffers. +.\"O First of all there is the buffer +.\"O .I pwbuf +.\"O that can hold a \fIstruct passwd\fP. +.\"O And next the buffer +.\"O .I buf +.\"O of size +.\"O .I buflen +.\"O that can hold additional strings. +¤³¤³¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤδؿô¤Ï¡¢ +¸Æ¤Ó½Ð¤·Â¦¤«¤éÄ󶡤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë¥æ¡¼¥¶Ì¾¤Ê¤ÉÁ´¤Æ¤òÊÖ¤¹¡£ +ºÇ½é¤Î°ú¤­¿ô¤È¤·¤Æ \fIstruct passwd\fP ¤òÊÝ»ý¤Ç¤­¤ë¥Ð¥Ã¥Õ¥¡ +.I pwbuf +¤¬¤¢¤ë¡£ +¼¡¤Ë¤½¤Î¾¤Îʸ»úÎó¤òÊÝ»ý¤Ç¤­¤ë¥µ¥¤¥º +.I buflen +¤Î¥Ð¥Ã¥Õ¥¡ +.I buf +¤¬¤¢¤ë¡£ +.\"O The result of these functions, the \fIstruct passwd\fP read from the stream, +.\"O is stored in the provided buffer +.\"O .IR *pwbuf , +.\"O and a pointer to this \fIstruct passwd\fP is returned in +.\"O .IR *pwbufp . +¤³¤ì¤é¤Î´Ø¿ô¤Î·ë²Ì (¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤Þ¤ì¤¿ \fIstruct passwd\fP) ¤Ï¡¢ +Ä󶡤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡ +.I *pwbuf +¤Ë³ÊǼ¤µ¤ì¡¢¤³¤Î \fIstruct passwd\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï +.I *pwbufp +¤ËÊÖ¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return 0 and +.\"O .I *pwbufp +.\"O is a pointer to the \fIstruct passwd\fP. +À®¸ù¤·¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï 0 ¤òÊÖ¤·¡¢ +.I *pwbufp +¤Ï \fIstruct passwd\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¨¥é¡¼ÃͤòÊÖ¤·¡¢ +.I *pwbufp +¤Ï NULL ¤Ë¤Ê¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ENOENT +.\"O No more entries. +¼¡¤Î¥¨¥ó¥È¥ê¤¬¤Ê¤¤¡£ +.TP +.B ERANGE +.\"O Insufficient buffer space supplied. +.\"O Try again with larger buffer. +½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +¤â¤Ã¤ÈÂ礭¤Ê¥Ð¥Ã¥Õ¥¡¤ÇºÆÅټ¹Ԥ¹¤ë¤³¤È¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These functions are GNU extensions, done in a style resembling +.\"O the POSIX version of functions like +.\"O .BR getpwnam_r (3). +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ê¡¢POSIX ÈǤδؿô +.BR getpwnam_r (3) +¤Î·Á¼°¤Ë»÷¤»¤Æ¤¢¤ë¡£ +.\"O Other systems use prototype +¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï°Ê²¼¤Î¥×¥í¥È¥¿¥¤¥×¤¬»È¤ï¤ì¤Æ¤¤¤ë¡£ +.sp +.nf +.in +4n +struct passwd * +getpwent_r(struct passwd *pwd, char *buf, int buflen); +.in +.fi +.sp +.\"O or, better, +¤è¤êÎɤ¤¤â¤Î¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.sp +.nf +.in +4n +int +getpwent_r(struct passwd *pwd, char *buf, int buflen, + FILE **pw_fp); +.in +.fi +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The function +.\"O .BR getpwent_r () +.\"O is not really reentrant since it shares the reading position +.\"O in the stream with all other threads. +´Ø¿ô +.BR getpwent_r () +¤ÏËÜÅö¤Î¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ï¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢¥¹¥È¥ê¡¼¥à¤ÎÆɤ߹þ¤ß°ÌÃÖ¤ò +¾¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤È¶¦Í­¤·¤Æ¤¤¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.nf +#define _GNU_SOURCE +#include +#include +#define BUFLEN 4096 + +int +main(void) +{ + struct passwd pw, *pwp; + char buf[BUFLEN]; + int i; + + setpwent(); + while (1) { + i = getpwent_r(&pw, buf, BUFLEN, &pwp); + if (i) + break; + printf("%s (%d)\etHOME %s\etSHELL %s\en", pwp\->pw_name, + pwp\->pw_uid, pwp\->pw_dir, pwp\->pw_shell); + } + endpwent(); + exit(EXIT_SUCCESS); +} +.fi +.\"O .\" perhaps add error checking - should use strerror_r +.\" ¤¿¤Ö¤ó¥¨¥é¡¼¥Á¥§¥Ã¥¯¤òÄɲ䷤ơ¢strerror_r ¤ò»È¤¦¤Ù¤­¤À¤í¤¦¡£ +.\" #include +.\" #include +.\" if (i) { +.\" if (i == ENOENT) +.\" break; +.\" printf("getpwent_r: %s", strerror(i)); +.\" exit(EXIT_SUCCESS); +.\" } +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fgetpwent (3), +.BR getpw (3), +.BR getpwent (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR putpwent (3), +.BR passwd (5) diff --git a/draft/man3/getpwnam.3 b/draft/man3/getpwnam.3 new file mode 100644 index 00000000..d830120f --- /dev/null +++ b/draft/man3/getpwnam.3 @@ -0,0 +1,474 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's "POSIX Programmer's Guide" (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1996-05-27 by Martin Schulze (joey@linux.de) +.\" Modified 2003-11-15 by aeb +.\" 2008-11-07, mtk, Added an example program for getpwnam_r(). +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-18, HIROFUMI Nishizuka +.\" Updated & Modified 2004-01-06, Yuichi SATO +.\" Updated & Modified 2005-09-06, Akihiro MOTOKI +.\" Updated & Modified 2005-10-08, Akihiro MOTOKI +.\" Updated 2008-12-24, Akihiro MOTOKI, LDP v3.14 +.\" +.TH GETPWNAM 3 2009-03-30 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getpwnam, getpwnam_r, getpwuid, getpwuid_r \- get password file entry +getpwnam, getpwnam_r, getpwuid, getpwuid_r \- ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤Î¼èÆÀ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "struct passwd *getpwnam(const char *" name ); +.sp +.BI "struct passwd *getpwuid(uid_t " uid ); +.sp +.BI "int getpwnam_r(const char *" name ", struct passwd *" pwd , +.br +.BI " char *" buf ", size_t " buflen ", struct passwd **" result ); +.sp +.BI "int getpwuid_r(uid_t " uid ", struct passwd *" pwd , +.br +.BI " char *" buf ", size_t " buflen ", struct passwd **" result ); +.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 getpwnam_r (), +.BR getpwuid_r (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR getpwnam () +.\"O function returns a pointer to a structure containing +.\"O the broken-out fields of the record in the password database +.\"O (e.g., the local password file +.\"O .IR /etc/passwd , +.\"O NIS, and LDAP) +.\"O that matches the username +.\"O .IR name . +.BR getpwnam () +´Ø¿ô¤Ï¡¢¥æ¡¼¥¶Ì¾ +.I name +¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹ +(¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÎã: +¥í¡¼¥«¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë +.IR /etc/passwd , +NIS, LDAP)¡£ +.PP +.\"O The +.\"O .BR getpwuid () +.\"O function returns a pointer to a structure containing +.\"O the broken-out fields of the record in the password database +.\"O that matches the user ID +.\"O .IR uid . +.BR getpwuid () +´Ø¿ô¤Ï¡¢¥æ¡¼¥¶ ID +.I uid +¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR getpwnam_r () +.\"O and +.\"O .BR getpwuid_r () +.\"O functions obtain the same information, but store the retrieved +.\"O .I passwd +.\"O structure in the space pointed to by +.\"O .IR pwd . +.BR getpwnam_r () +¤È +.BR getpwuid_r () +´Ø¿ô¤Ï (¾åµ­¤Î´Ø¿ô¤È) Ʊ¤¸¾ðÊó¤ò¼èÆÀ¤¹¤ë¤¬¡¢ +¼èÆÀ¤·¤¿ +.I passwd +¹½Â¤ÂΤò +.I pwd +¤¬»Ø¤¹Îΰè¤Ë³ÊǼ¤¹¤ë¡£ +.\"O This +.\"O .I passwd +.\"O structure contains pointers to strings, and these strings +.\"O are stored in the buffer +.\"O .I buf +.\"O of size +.\"O .IR buflen . +¤³¤Î +.I passwd +¹½Â¤ÂΤˤÏʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬´Þ¤Þ¤ì¡¢ +¤³¤ì¤é¤Îʸ»úÎó¤Ï¥µ¥¤¥º +.I buflen +¤Î¥Ð¥Ã¥Õ¥¡ +.I buf +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.\"O A pointer to the result (in case of success) or NULL (in case no entry +.\"O was found or an error occurred) is stored in +.\"O .IR *result . +À®¸ù¤·¤¿¾ì¹ç +.I *result +¤Ë¤Ï·ë²Ì¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬³ÊǼ¤µ¤ì¤ë¡£ +¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤ä¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤Ï +.I *result +¤Ë¤Ï NULL ¤¬Æþ¤ë¡£ +.PP +.\"O The \fIpasswd\fP structure is defined in \fI\fP as follows: +\fIpasswd\fP ¹½Â¤ÂΤϡ¢\fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct passwd { +.\"O char *pw_name; /* username */ +.\"O char *pw_passwd; /* user password */ +.\"O uid_t pw_uid; /* user ID */ +.\"O gid_t pw_gid; /* group ID */ +.\"O char *pw_gecos; /* real name */ +.\"O char *pw_dir; /* home directory */ +.\"O char *pw_shell; /* shell program */ + char *pw_name; /* ¥æ¡¼¥¶Ì¾ */ + char *pw_passwd; /* ¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É */ + uid_t pw_uid; /* ¥æ¡¼¥¶ ID */ + gid_t pw_gid; /* ¥°¥ë¡¼¥× ID */ + char *pw_gecos; /* ¼Â̾ */ + char *pw_dir; /* ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê */ + char *pw_shell; /* ¥·¥§¥ë¥×¥í¥°¥é¥à */ +}; +.fi +.in +.PP +.\"O The maximum needed size for +.\"O .I buf +.\"O can be found using +.\"O .BR sysconf (3) +.\"O with the argument +.\"O .BR _SC_GETPW_R_SIZE_MAX . +.I buf +¤ËºÇÂçɬÍפʥµ¥¤¥º¤Ï¡¢ +.BR sysconf (3) +¤Ë°ú¤­¿ô +.B _SC_GETPW_R_SIZE_MAX +¤ò»ØÄꤷ¤Æ¼Â¹Ô¤¹¤ë¤³¤È¤Çʬ¤«¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR getpwnam () +.\"O and +.\"O .BR getpwuid () +.\"O functions return a pointer to a +.\"O .I passwd +.\"O structure, or NULL if the matching entry is not found or +.\"O an error occurs. +.BR getpwnam () +¤È +.BR getpwuid () +´Ø¿ô¤Ï¡¢ +.I passwd +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +°ìÃפ¹¤ë¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤ä¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.\"O If an error occurs, +.\"O .I errno +.\"O is set appropriately. +.\"O If one wants to check +.\"O .I errno +.\"O after the call, it should be set to zero before the call. +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¤Î¸å¤Ç +.I errno +¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢ +¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë (¤³¤ÎÃͤò) 0 ¤ËÀßÄꤷ¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.LP +.\"O The return value may point to a static area, and may be overwritten +.\"O by subsequent calls to +.\"O .BR getpwent (3), +.\"O .BR getpwnam (), +.\"O or +.\"O .BR getpwuid (). +.\"O (Do not pass the returned pointer to +.\"O .BR free (3).) +ÊÖ¤êÃͤÏÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤½¤Î¸å¤Î +.BR getpwent (3), +.BR getpwnam (), +.BR getpwuid () +¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +(ÊÖ¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤ò +.BR free (3) +¤ËÅϤµ¤Ê¤¤¤³¤È¡£) +.LP +.\"O On success, +.\"O .BR getpwnam_r () +.\"O and +.\"O .BR getpwuid_r () +.\"O return zero, and set +.\"O .IR *result +.\"O to +.\"O .IR pwd . +.\"O If no matching password record was found, +.\"O these functions return 0 and store NULL in +.\"O .IR *result . +.\"O In case of error, an error number is returned, and NULL is stored in +.\"O .IR *result . +À®¸ù¤¹¤ë¤È¡¢ +.BR getpwnam_r () +¤È +.BR getpwuid_r () +¤Ï 0 ¤òÊÖ¤·¡¢ +.I *result +¤Ë +.I pwd +¤òÀßÄꤹ¤ë¡£ +¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹¥ï¡¼¥É¡¦¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +0 ¤òÊÖ¤·¡¢ +.I *result +¤Ë NULL ¤òÀßÄꤹ¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤·¡¢ +.I *result +¤Ë NULL ¤òÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.\"O .BR 0 " or " ENOENT " or " ESRCH " or " EBADF " or " EPERM " or ... " +.BR 0 " ¤Þ¤¿¤Ï " ENOENT " ¤Þ¤¿¤Ï " ESRCH " ¤Þ¤¿¤Ï " EBADF " ¤Þ¤¿¤Ï " EPERM " ¤Þ¤¿¤Ï ... " +.\"O The given +.\"O .I name +.\"O or +.\"O .I uid +.\"O was not found. +»ØÄꤵ¤ì¤¿ +.I name +¤Þ¤¿¤Ï +.I uid +¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINTR +.\"O A signal was caught. +¥·¥°¥Ê¥ë¤¬¥­¥ã¥Ã¥Á¤µ¤ì¤¿¡£ +.TP +.B EIO +.\"O I/O error. +I/O ¥¨¥é¡¼¡£ +.TP +.B EMFILE +.\"O The maximum number +.\"O .RB ( OPEN_MAX ) +.\"O of files was open already in the calling process. +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ë¤ª¤¤¤Æ¡¢ +´û¤ËºÇÂç¿ô (OPEN_MAX) ¤Î¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ENFILE +.\"O The maximum number of files was open already in the system. +¥·¥¹¥Æ¥à¾å¤Ç´û¤ËºÇÂç¿ô¤Î¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ENOMEM +.\" not in POSIX +.\"O Insufficient memory to allocate +.\"O .I passwd +.\"O structure. +.\"O .\" This structure is static, allocated 0 or 1 times. No memory leak. (libc45) +.\" POSIX ¤Ë¤Ï¤Ê¤¤¡£ +.I passwd +¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£ +.\" ¤³¤Î¹½Â¤ÂΤÏÀÅŪ¤Ç¤¢¤ê¡¢0 ²ó¤Þ¤¿¤Ï 1 ²ó³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +.\" ¥á¥â¥ê¥ê¡¼¥¯¤Ï̵¤¤¡£(libc45) +.TP +.B ERANGE +.\"O Insufficient buffer space supplied. +Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬ÉÔ½½Ê¬¤Ç¤¢¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/passwd +.\"O local password database file +¥í¡¼¥«¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The formulation given above under "RETURN VALUE" is from POSIX.1-2001. +¾åµ­¤Î¡ÖÊÖ¤êÃ͡װʲ¼¤Îµ­½Ò¤Ï POSIX.1-2001 ¤Ëµò¤ë¡£ +.\"O It does not call "not found" an error, and hence does not specify what value +.\"O .I errno +.\"O might have in this situation. +.\"O But that makes it impossible to recognize +.\"O errors. +.\"O One might argue that according to POSIX +.\"O .I errno +.\"O should be left unchanged if an entry is not found. +.\"O Experiments on various +.\"O Unix-like systems show that lots of different values occur in this +.\"O situation: 0, ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM and probably others. +¤³¤Îɸ½à¤Ï¡Ö(¥¨¥ó¥È¥ê¤¬) ¸«¤Ä¤«¤é¤Ê¤¤¤³¤È¡×¤ò¥¨¥é¡¼¤È¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢ +¤½¤Î¤è¤¦¤Ê¾ì¹ç¤Ë +.I errno +¤¬¤É¤Î¤è¤¦¤ÊÃͤˤʤ뤫¤òÄê¤á¤Æ¤¤¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢¥¨¥é¡¼¤òǧ¼±¤¹¤ë¤³¤È¤ÏÉÔ²Äǽ¤Ç¤¢¤ë¡£ +POSIX ¤Ë½àµò¤·¤Æ¡¢¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï +.I errno +¤òÊѹ¹¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡¢¤È¼çÄ¥¤¹¤ë¿Í¤â¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +ÍÍ¡¹¤Ê Unix ·Ï¤Î¥·¥¹¥Æ¥à¤Ç»î¤·¤Æ¤ß¤ë¤È¡¢¤½¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï +0, ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM ¤È¤¤¤Ã¤¿ÍÍ¡¹¤ÊÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +¾¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .\" more precisely: +.\"O .\" AIX 5.1 - gives ESRCH +.\"O .\" OSF1 4.0g - gives EWOULDBLOCK +.\"O .\" libc, glibc up to version 2.6, Irix 6.5 - give ENOENT +.\"O .\" glibc since version 2.7 - give 0 +.\"O .\" FreeBSD 4.8, OpenBSD 3.2, NetBSD 1.6 - give EPERM +.\"O .\" SunOS 5.8 - gives EBADF +.\"O .\" Tru64 5.1b, HP-UX-11i, SunOS 5.7 - give 0 +.\" ¤è¤êÀµ³Î¤Ë¤Ï: +.\" AIX 5.1 ¤Ï ESRCH ¤òÊÖ¤¹¡£ +.\" OSF1 4.0g ¤Ï EWOULDBLOCK ¤òÊÖ¤¹¡£ +.\" libc, glibc (¥Ð¡¼¥¸¥ç¥ó 2.6 ¤Þ¤Ç), Irix 6.5 ¤Ï ENOENT ¤òÊÖ¤¹¡£ +.\" glibc (¥Ð¡¼¥¸¥ç¥ó 2.7 °Ê¹ß) ¤Ï 0 ¤òÊÖ¤¹¡£ +.\" FreeBSD 4.8, OpenBSD 3.2, NetBSD 1.6 ¤Ï EPERM ¤òÊÖ¤¹¡£ +.\" SunOS 5.8 ¤Ï EBADF ¤òÊÖ¤¹¡£ +.\" Tru64 5.1b, HP-UX-11i, SunOS 5.7 ¤Ï 0 ¤òÊÖ¤¹¡£ + +.\"O The +.\"O .I pw_dir +.\"O field contains the name of the initial working directory of the user. +¥Õ¥£¡¼¥ë¥É +.I pw_dir +¤Ë¤Ï¡¢¥æ¡¼¥¶¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê̾¤Î½é´üÃͤ¬³ÊǼ¤µ¤ì¤ë¡£ +.\"O Login programs use the value of this field to initialize the +.\"O .B HOME +.\"O environment variable for the login shell. +.\"O An application that wants to determine its user's home directory +.\"O should inspect the value of +.\"O .B HOME +.\"O (rather than the value +.\"O .IR getpwuid(getuid())\->pw_dir ) +.\"O since this allows the user to modify their notion of +.\"O "the home directory" during a login session. +.\"O To determine the (initial) home directory of another user, +.\"O it is necessary to use +.\"O .I getpwnam("username")\->pw_dir +.\"O or similar. +¥í¥°¥¤¥ó¥×¥í¥»¥¹¤Ï¡¢¤³¤Î¥Õ¥£¡¼¥ë¥É¤ÎÃͤò»È¤Ã¤Æ¡¢ +¥í¥°¥¤¥ó¥·¥§¥ë¤Î +.B HOME +´Ä¶­ÊÑ¿ô¤ò½é´ü²½¤¹¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¡¢¥æ¡¼¥¶¤Î¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ò·èÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ +.RI ( getpwuid(getuid())\->pw_dir +¤ÎÃͤǤϤʤ¯) +.B HOME +¤ÎÃͤò¸¡ºº¤¹¤ë¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤Ê¤¼¤Ê¤é¡¢¤³¤Î¤è¤¦¤Ë¤¹¤ë¤³¤È¤Ç¡¢¥æ¡¼¥¶¤¬¥í¥°¥¤¥ó¡¦¥»¥Ã¥·¥ç¥óÃæ¤Ç +¡Ö¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê¡×¤Î°ÕÌ£¤òÊѹ¹¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¤«¤é¤Ç¤¢¤ë¡£ +Ê̤Υ桼¥¶¤Î¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê (¤Î½é´üÃÍ) ¤òÃΤë¤Ë¤Ï +.I getpwnam("username")\->pw_dir +¤«Æ±ÍͤÎÊýË¡¤ò»È¤¦É¬Íפ¬¤¢¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The program below demonstrates the use of +.\"O .BR getpwnam_r () +.\"O to find the full username and user ID for the username +.\"O supplied as a command-line argument. +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï +.BR getpwnam_r () +¤Î»ÈÍÑÎã¤ò¼¨¤·¤¿¤â¤Î¤Ç¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ÇÅϤµ¤ì¤¿¥æ¡¼¥¶Ì¾¤ËÂФ¹¤ë +´°Á´¤Ê¥æ¡¼¥¶Ì¾¤È¥æ¡¼¥¶ ID ¤òõ¤¹¤â¤Î¤Ç¤¢¤ë¡£ + +.nf +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct passwd pwd; + struct passwd *result; + char *buf; + size_t bufsize; + int s; + + if (argc != 2) { + fprintf(stderr, "Usage: %s username\\n", argv[0]); + exit(EXIT_FAILURE); + } + + bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); +.\"O if (bufsize == \-1) /* Value was indeterminate */ +.\"O bufsize = 16384; /* Should be more than enough */ + if (bufsize == \-1) /* Ãͤò·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿ */ + bufsize = 16384; /* ½½Ê¬Â礭¤ÊÃͤˤ¹¤Ù¤­ */ + + buf = malloc(bufsize); + if (buf == NULL) { + perror("malloc"); + exit(EXIT_FAILURE); + } + + s = getpwnam_r(argv[1], &pwd, buf, bufsize, &result); + if (result == NULL) { + if (s == 0) + printf("Not found\\n"); + else { + errno = s; + perror("getpwnam_r"); + } + exit(EXIT_FAILURE); + } + + printf("Name: %s; UID: %ld\\n", pwd.pw_gecos, (long) pwd.pw_uid); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR endpwent (3), +.BR fgetpwent (3), +.BR getgrnam (3), +.BR getpw (3), +.BR getpwent (3), +.BR getspnam (3), +.BR putpwent (3), +.BR setpwent (3), +.BR passwd (5) diff --git a/draft/man3/getrpcent.3 b/draft/man3/getrpcent.3 new file mode 100644 index 00000000..a0a9e64f --- /dev/null +++ b/draft/man3/getrpcent.3 @@ -0,0 +1,158 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 2000-01-11, HANATAKA Shinya +.\" Updated 2008-09-19, Akihiro MOTOKI +.\" +.TH GETRPCENT 3 2008-08-19 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent \- get +.\"O RPC entry +getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent \- +RPC ¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "struct rpcent *getrpcent(void);" + +.BI "struct rpcent *getrpcbyname(char *" name ); + +.BI "struct rpcent *getrpcbynumber(int " number ); + +.BI "void setrpcent(int " stayopen ); + +.BI "void endrpcent(void);" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.LP +.BR getrpcent (), +.BR getrpcbyname (), +.\"O and +.BR getrpcbynumber () +.\"O each return a pointer to an object with the +.\"O following structure containing the broken-out +.\"O fields of an entry in the RPC program number data base. +¤Ï¤½¤ì¤¾¤ì°Ê²¼¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï RPC ¥×¥í¥°¥é¥àÈÖ¹æ¥Ç¡¼¥¿¥Ù¡¼¥¹ +¤Î³Æ¹Ô¤Î¥Õ¥£¡¼¥ë¥É¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +.in +4n +.nf + +struct rpcent { + char *r_name; /* name of server for this RPC program */ + char **r_aliases; /* alias list */ + long r_number; /* RPC program number */ +}; +.fi +.in +.LP +.\"O The members of this structure are: +¤³¤Î¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Ï°Ê²¼¤ÎÄ̤ꡣ +.RS 4 +.TP 12 +.I r_name +.\"O The name of the server for this RPC program. +¤³¤Î RPC ¥×¥í¥°¥é¥à¤Î¥µ¡¼¥Ð¤Î̾Á° +.TP +.I r_aliases +.\"O A zero terminated list of alternate names for the RPC program. +RPC ¥×¥í¥°¥é¥à¤ÎÊÌ̾¤Î¥ê¥¹¥È¡£¥¼¥í¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.I r_number +.\"O The RPC program number for this service. +¤³¤Î¥µ¡¼¥Ó¥¹¤Î RPC ¥×¥í¥°¥é¥àÈֹ档 +.RE +.LP +.\"O .BR getrpcent () +.\"O reads the next entry from the database. +.\"O A connection is opened to the database if necessary. +.BR getrpcent () +¤Ï¥Õ¥¡¥¤¥ë¤Î¼¡¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à¡£ +ɬÍפʤé¤Ð¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.LP +.\"O .BR setrpcent () +.\"O function opens a connection to the database, +.\"O and sets the next entry to the first entry. +.\"O If \fIstayopen\fP is nonzero, +.\"O then the connection to the database +.\"O will not be closed between calls to one of the +.\"O .BR getrpc* () +.\"O functions. +.BR setrpcent () +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥ª¡¼¥×¥ó¤·¡¢ +¼¡¤ÎÆɤ߹þ¤ß¥¨¥ó¥È¥ê¤òÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤹ¤ë¡£ +\fIstayopen\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢ +°ì¤Ä°ì¤Ä¤Î +.BR getrpc* () +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¡£ +.LP +.\"O The +.\"O .BR endrpcent () +.\"O function closes the connection to the database. +.BR endrpcent () +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.LP +.\"O .BR getrpcbyname () +.\"O and +.\"O .BR getrpcbynumber () +.\"O sequentially search from the beginning +.\"O of the file until a matching RPC program name or +.\"O program number is found, or until end-of-file is encountered. +.BR getrpcbyname () +¤È +.BR getrpcbynumber () +¤Ï¥Õ¥¡¥¤¥ë¤ÎºÇ½é¤«¤é°ìÃפ¹¤ë RPC ¥×¥í¥°¥é¥à̾¤«¥×¥í¥°¥é¥àÈֹ椬 +¸«¤Ä¤«¤ë¤«¡¢¥Õ¥¡¥¤¥ë¤ÎºÇ¸å (end-of-file) ¤ËÅþ㤹¤ë¤Þ¤Ç¡¢½çÈÖ¤Ë +õ¤·¤Æ¤¤¤¯¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR getrpcent (), +.\"O .BR getrpcbyname (), +.\"O and +.\"O .BR getrpcbynumber () +.\"O return a pointer to a statically allocated +.\"O .I rpcent +.\"O structure. +À®¸ù¤¹¤ë¤È¡¢ +.BR getrpcent (), +.BR getrpcbyname (), +.BR getrpcbynumber () +¤Ï¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ +.I rpcent +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O A NULL pointer is returned on EOF or error. +EOF ¤« ¥¨¥é¡¼¤ËÁø¶ø¤·¤¿¾ì¹ç¤Ë¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/rpc +.\"O RPC program number database. +RPC ¥×¥í¥°¥é¥àÈÖ¹æ¥Ç¡¼¥¿¥Ù¡¼¥¹ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Not in POSIX.1-2001. +.\"O Present on the BSDs, Solaris, and many other systems. +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¡¢Solaris ¤ä¾¤Î¿¤¯¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O All information +.\"O is contained in a static area +.\"O so it must be copied if it is +.\"O to be saved. +Á´¤Æ¤Î¾ðÊó¤ÏÀÅŪÎΰè¤Ë³ÊǼ¤µ¤ì¤ë¡£ +Êݸ¤¹¤ë¤¿¤á¤Ë¤ÏÁ´¤Æ¤ò¥³¥Ô¡¼¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getrpcent_r (3), +.BR rpc (5), +.BR rpcinfo (8), +.BR ypserv (8) diff --git a/draft/man3/getrpcport.3 b/draft/man3/getrpcport.3 new file mode 100644 index 00000000..61430d22 --- /dev/null +++ b/draft/man3/getrpcport.3 @@ -0,0 +1,65 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)getrpcport.3r 2.2 88/08/02 4.0 RPCSRC; from 1.12 88/02/26 SMI +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Tue Jan 11 00:56:31 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH GETRPCPORT 3 2007-12-23 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getrpcport \- get RPC port number +getrpcport \- RPC ¥Ý¡¼¥ÈÈÖ¹æ¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.BI "int getrpcport(char *" host ", int " prognum ", int " versnum \ +", int " proto ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.BR getrpcport () +.\"O returns the port number for version +.\"O .I versnum +.\"O of the RPC program +.\"O .I prognum +.\"O running on +.\"O .I host +.\"O and using protocol +.\"O .IR proto . +¤Ï +.I host +¾å¤Ç +.I proto +¥×¥í¥È¥³¥ë¤ò»ÈÍѤ·¤Æ¤¤¤ë¥Ð¡¼¥¸¥ç¥ó +.I versnum +¤Î RPC ¥×¥í¥°¥é¥à +.I prognum +¤Î¥Ý¡¼¥ÈÈÖ¹æ¤òÊÖ¤¹¡£ +.\"O It returns 0 if it cannot contact the portmapper, or if +.\"O .I prognum +.\"O is not registered. +.\"O If +.\"O .I prognum +.\"O is registered but not with version +.\"O .IR versnum , +.\"O it will still return a port number (for some version of the program) +.\"O indicating that the program is indeed registered. +.\"O The version mismatch will be detected upon the first call to the service. +¥Ý¡¼¥È¥Þ¥Ã¥Ñ¡¼¤ÈÏ¢Íí¤¬¼è¤ì¤Ê¤¤¾ì¹ç¤ä +.I prognum +¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.I prognum +¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¥Ð¡¼¥¸¥ç¥ó +.I versnum +¤Ç¤Ê¤¤¾ì¹ç¤Ë¤â¡¢¤½¤Î¥×¥í¥°¥é¥à¤¬¼ÂºÝ¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò¼¨¤¹¤¿¤á¤Ë +(¤½¤Î¥×¥í¥°¥é¥à¤Î¥Ð¡¼¥¸¥ç¥ó¤Î)¥Ý¡¼¥ÈÈÖ¹æ¤òÊÖ¤¹¡£ +¥Ð¡¼¥¸¥ç¥ó¤ÎÉÔ°ìÃפϺǽé¤Ë¤½¤Î¥µ¡¼¥Ó¥¹¤ò¸Æ¤Ó½Ð¤·¤¿»þ¤Ë¸¡½Ð¤µ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Not in POSIX.1-2001. +.\"O Present on the BSDs, Solaris, and many other systems. +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¡¢Solaris ¤ä¾¤Î¿¤¯¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ diff --git a/draft/man3/gets.3 b/draft/man3/gets.3 new file mode 100644 index 00000000..2c372be7 --- /dev/null +++ b/draft/man3/gets.3 @@ -0,0 +1,306 @@ +.\" 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 Wed Jul 28 11:12:07 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1997 IMAMURA Nobutaka +.\" all rights reserved. +.\" Translated 1997-02-14, IMAMURA Nobutaka +.\" Updated 1999-08-29, Kentaro Shirakata +.\" Updated 2001-11-02, Kentaro Shirakata +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" +.TH GETS 3 2008-08-06 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fgetc, fgets, getc, getchar, gets, ungetc \- input of characters and strings +fgetc, fgets, getc, getchar, gets, ungetc \- ʸ»ú¤Èʸ»úÎó¤ÎÆþÎÏ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fgetc(FILE *" stream ); + +.BI "char *fgets(char *" "s" ", int " "size" ", FILE *" "stream" ); + +.BI "int getc(FILE *" stream ); + +.B "int getchar(void);" + +.BI "char *gets(char *" "s" ); + +.BI "int ungetc(int " c ", FILE *" stream ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR fgetc () +.\"O reads the next character from +.\"O .I stream +.\"O and returns it as an +.\"O .I unsigned char +.\"O cast to an +.\"O .IR int , +.\"O or +.\"O .B EOF +.\"O on end of file or error. +.BR fgetc () +¤Ï¡¢ +.I stream +¤«¤é¼¡¤Îʸ»ú¤ò +.I unsigned char +¤È¤·¤ÆÆɤߡ¢ +.I int +¤Ë¥­¥ã¥¹¥È¤·¤ÆÊÖ¤¹¡£¥Õ¥¡¥¤¥ë¤Î½ª¤ï¤ê¤ä¥¨¥é¡¼¤È¤Ê¤Ã¤¿¾ì¹ç¤Ï +.B EOF +¤òÊÖ¤¹¡£ +.PP +.\"O .BR getc () +.\"O is equivalent to +.\"O .BR fgetc () +.\"O except that it may be implemented as a macro which evaluates +.\"O .I stream +.\"O more than once. +.BR getc () +¤Ï +.BR fgetc () +¤ÈƱÍͤÀ¤¬¡¢ +.I stream +¤òÊ£¿ô²óɾ²Á¤¹¤ë¥Þ¥¯¥í¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +.\"O .BR getchar () +.\"O is equivalent to +.\"O .BI "getc(" stdin ) \fR. +.BR getchar () +¤Ï +.BI "getc(" stdin ) \fR +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.PP +.\"O .BR gets () +.\"O reads a line from +.\"O .I stdin +.\"O into the buffer pointed to by +.\"O .I s +.\"O until either a terminating newline or +.\"O .BR EOF , +.\"O which it replaces with +.\"O .BR \(aq\e0\(aq . +.BR gets () +¤Ï¡¢²þ¹Ôʸ»ú¤« +.B EOF +¤Þ¤Ç¤Î 1¹Ô¤ò +.I stdin +¤«¤éÆɤ߹þ¤ß +.I s +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤¹¤ë +(ËöÈø¤Î²þ¹Ôʸ»ú¤ä +.B EOF +¤Ï +.B \(aq\e0\(aq +¤ËÃÖ¤­´¹¤¨¤é¤ì¤ë)¡£ +.\"O No check for buffer overrun is performed (see BUGS below). +¥Ð¥Ã¥Õ¥¡¡¦¥ª¡¼¥Ð¡¼¥é¥ó¤Î¥Á¥§¥Ã¥¯¤Ï¹Ô¤ï¤ì¤Ê¤¤ (²¼µ­¤Î¡Ö¥Ð¥°¡×¤ò»²¾È)¡£ +.PP +.\"O .BR fgets () +.\"O reads in at most one less than +.\"O .I size +.\"O characters from +.\"O .I stream +.\"O and stores them into the buffer pointed to by +.\"O .IR s . +.\"O Reading stops after an +.\"O .B EOF +.\"O or a newline. +.\"O If a newline is read, it is stored into the buffer. +.\"O A +.\"O .B \(aq\e0\(aq +.\"O is stored after the last character in the buffer. +.BR fgets () +¤Ï +.I stream +¤«¤éºÇÂç¤Ç +.IR size " - 1" +¸Ä¤Îʸ»ú¤òÆɤ߹þ¤ß¡¢ +.I s +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤¹¤ë¡£Æɤ߹þ¤ß¤Ï +.B EOF +¤Þ¤¿¤Ï²þ¹Ôʸ»ú¤òÆɤ߹þ¤ó¤À¸å¤ÇÄä»ß¤¹¤ë¡£ +Æɤ߹þ¤Þ¤ì¤¿²þ¹Ôʸ»ú¤Ï¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.B \(aq\e0\(aq +ʸ»ú¤¬°ì¤Ä¥Ð¥Ã¥Õ¥¡¤ÎÃæ¤ÎºÇ¸å¤Îʸ»ú¤Î¸å¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.PP +.\"O .BR ungetc () +.\"O pushes +.\"O .I c +.\"O back to +.\"O .IR stream , +.\"O cast to +.\"O .IR "unsigned char" , +.\"O where it is available for subsequent read operations. +.\"O Pushed-back characters +.\"O will be returned in reverse order; only one pushback is guaranteed. +.BR ungetc () +¤Ï¡¢¸å¤Î read Áàºî¤ÇÆɤá¤ë¤è¤¦¤Ë¡¢ +.I c +¤ò +.I "unsigned char" +¤Ë¥­¥ã¥¹¥È¤·¤Æ +.I stream +¤Ë½ñ¤­Ì᤹¡£ +½ñ¤­Ìᤵ¤ì¤¿Ê¸»ú¤ÏµÕ½ç¤ËÌᤵ¤ì¤ë; +½ñ¤­Ìᤷ¤È¤·¤ÆÊݾڤµ¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢°ìʸ»ú¤À¤±¤Ç¤¢¤ë¡£ +.PP +.\"O Calls to the functions described here can be mixed with each other and with +.\"O calls to other input functions from the +.\"O .I stdio +.\"O library for the same input stream. +¤³¤³¤Ç½Ò¤Ù¤¿´Ø¿ô¤ä +.I stdio +¥é¥¤¥Ö¥é¥ê¤ÎÆþÎÏ´Ø¿ô¤òƱ¤¸ÆþÎÏ¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¸ß¤¤¤Ëº®¤¼¤Æ»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O For nonlocking counterparts, see +.\"O .BR unlocked_stdio (3). +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "RETURN VALUES" +.SH ÊÖ¤êÃÍ +.\"O .BR fgetc (), +.\"O .BR getc () +.\"O and +.\"O .BR getchar () +.\"O return the character read as an +.\"O .I unsigned char +.\"O cast to an +.\"O .I int +.\"O or +.\"O .B EOF +.\"O on end of file or error. +.BR fgetc (), +.BR getc (), +.BR getchar () +¤Ï¡¢Ê¸»ú¤ò +.I unsigned char +¤È¤·¤ÆÆɤó¤Ç +.I int +¤Ë¥­¥ã¥¹¥È¤·¤ÆÊÖ¤¹¡£¥Õ¥¡¥¤¥ë¤Î½ª¤ï¤ê¤ä¥¨¥é¡¼¤Î¾ì¹ç¤Ï +.B EOF +¤òÊÖ¤¹¡£ +.PP +.\"O .BR gets () +.\"O and +.\"O .BR fgets () +.\"O return +.\"O .I s +.\"O on success, and NULL +.\"O on error or when end of file occurs while no characters have been read. +.BR gets () +¤È +.BR fgets () +¤Ï¡¢À®¸ù¤¹¤ë¤È +.I s +¤òÊÖ¤·¡¢¥¨¥é¡¼¤ä 1 ʸ»ú¤âÆɤ߹þ¤ó¤Ç¤¤¤Ê¤¤¤Î¤Ë¥Õ¥¡¥¤¥ë¤Î½ª¤ï¤ê¤Ë¤Ê¤Ã¤¿ +¾ì¹ç¤Ë NULL ¤òÊÖ¤¹¡£ +.PP +.\"O .BR ungetc () +.\"O returns +.\"O .I c +.\"O on success, or +.\"O .B EOF +.\"O on error. +.BR ungetc () +¤ÏÀ®¸ù¤¹¤ë¤È +.I c +¤òÊÖ¤·¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ï +.B EOF +¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMS TO" +.SH ½àµò +C89, C99, POSIX.1-2001. +.\"O LSB deprecates +.\"O .BR gets (). +LSB ¤Ç¤Ï +.BR gets () +¤ÏÈó¿ä¾©¤Ç¤¢¤ë¡£ +.\"O POSIX.1-2008 removes the specification of +.\"O .BR gets (). +POSIX.1-2008 ¤Ç¤Ï +.BR gets () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "BUGS" +.SH ¥Ð¥° +.\"O Never use +.\"O .BR gets (). +.\"O Because it is impossible to tell without knowing the data in advance how many +.\"O characters +.\"O .BR gets () +.\"O will read, and because +.\"O .BR gets () +.\"O will continue to store characters past the end of the buffer, +.\"O it is extremely dangerous to use. +.\"O It has been used to break computer security. +.\"O Use +.\"O .BR fgets () +.\"O instead. +.BR gets () +¤ÏÀäÂФ˻ÈÍѤ·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +Á°¤â¤Ã¤Æ¥Ç¡¼¥¿¤òÃΤ뤳¤È¤Ê¤·¤Ë +.BR gets () +¤¬²¿Ê¸»úÆɤफ¤òÃΤ뤳¤È¤Ï¤Ç¤­¤º¡¢ +.BR gets () +¤¬¥Ð¥Ã¥Õ¥¡¤Î½ª¤ï¤ê¤ò±Û¤¨¤Æ½ñ¤­¹þ¤ß³¤±¤ë¤¿¤á¡¢ +.BR gets () +¤ò»È¤¦¤Î¤Ï¶Ë¤á¤Æ´í¸±¤Ç¤¢¤ë¡£ +¤³¤ì¤òÍøÍѤ·¤Æ¥³¥ó¥Ô¥å¡¼¥¿¤Î¥»¥­¥å¥ê¥Æ¥£¤¬Çˤé¤ì¤Æ¤­¤¿¡£ +Âå¤ï¤ê¤Ë +.BR fgets () +¤ò»È¤¦¤³¤È¡£ +.PP +.\"O It is not advisable to mix calls to input functions from the +.\"O .I stdio +.\"O library with low-level calls to +.\"O .BR read (2) +.\"O for the file descriptor associated with the input stream; the results +.\"O will be undefined and very probably not what you want. +ÆþÎÏ¥¹¥È¥ê¡¼¥à¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ¡¢ +.I stdio +¥é¥¤¥Ö¥é¥ê¤ÎÆþÎÏ´Ø¿ô¤È¡¢Äã¥ì¥Ù¥ë¸Æ¤Ó½Ð¤·¤Î +.BR read (2) +¤òº®¤¼¤Æ¸Æ¤Ó½Ð¤¹»ö¤Ï´«¤á¤é¤ì¤Ê¤¤¡£ +·ë²Ì¤¬¤É¤¦¤Ê¤ë¤«¤Ïʬ¤«¤é¤º¡¢¤ª¤½¤é¤¯¤¢¤Ê¤¿¤Î +˾¤ó¤Ç¤¤¤ë·ë²Ì¤Ë¤Ï¤Ê¤é¤Ê¤¤¤À¤í¤¦¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR read (2), +.BR write (2), +.BR ferror (3), +.BR fgetwc (3), +.BR fgetws (3), +.BR fopen (3), +.BR fread (3), +.BR fseek (3), +.BR getline (3), +.BR getwchar (3), +.BR puts (3), +.BR scanf (3), +.BR ungetwc (3), +.BR unlocked_stdio (3) diff --git a/draft/man3/getservent.3 b/draft/man3/getservent.3 new file mode 100644 index 00000000..8afe0782 --- /dev/null +++ b/draft/man3/getservent.3 @@ -0,0 +1,195 @@ +.\" 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 Sat Jul 24 19:19:11 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Wed Oct 18 20:23:54 1995 by Martin Schulze +.\" Modified Mon Apr 22 01:50:54 1996 by Martin Schulze +.\" 2001-07-25 added a clause about NULL proto (Martin Michlmayr or David N. Welton) +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Fri Mar 15 1998 by NAKANO Takeo +.\" Updated Thu 16 Aug 2001 by NAKANO Takeo +.\" Updated 2008-09-19, Akihiro MOTOKI +.\" +.TH GETSERVENT 3 2008-08-19 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O getservent, getservbyname, getservbyport, setservent, endservent \- +.\"O get service entry +.SH ̾Á° +getservent, getservbyname, getservbyport, setservent, endservent \- ¥µ¡¼¥Ó¥¹¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B struct servent *getservent(void); +.sp +.BI "struct servent *getservbyname(const char *" name ", const char *" proto ); +.sp +.BI "struct servent *getservbyport(int " port ", const char *" proto ); +.sp +.BI "void setservent(int " stayopen ); +.sp +.B void endservent(void); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR getservent () +.\"O function reads the next entry from the services database (see +.\"O .BR services (5)) +.\"O and returns a \fIservent\fP structure containing +.\"O the broken-out fields from the entry. +.\"O A connection is opened to the database if necessary. +.BR getservent () +´Ø¿ô¤Ï¥µ¡¼¥Ó¥¹¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.RB ( services (5) +»²¾È) ¤«¤é¼¡¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤ß¡¢ +¤½¤Î¥¨¥ó¥È¥ê¤ò \fIservent\fP ¹½Â¤ÂΤÎÍ×ÁÇÊ̤Υե£¡¼¥ë¥É¤Ë³ÊǼ¤·¡¢ +¤½¤Î¹½Â¤ÂΤòÊÖ¤¹¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR getservbyname () +.\"O function returns a \fIservent\fP structure +.\"O for the entry from the database +.\"O that matches the service \fIname\fP using protocol \fIproto\fP. +.\"O If \fIproto\fP is NULL, any protocol will be matched. +.\"O A connection is opened to the database if necessary. +.BR getservbyname () +´Ø¿ô¤Ï¡¢ +¥×¥í¥È¥³¥ë \fIproto\fP ¤òÍѤ¤¤ë¥µ¡¼¥Ó¥¹¤Î̾Á° \fIname\fP +¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢ +¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fIservent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£ +\fIproto\fP ¤¬ NULL ¤Î¾ì¹ç¤Ï¡¢Ç¤°Õ¤Î¥×¥í¥È¥³¥ë¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR getservbyport () +.\"O function returns a \fIservent\fP structure +.\"O for the entry from the database +.\"O that matches the port \fIport\fP (given in network byte order) +.\"O using protocol \fIproto\fP. +.\"O If \fIproto\fP is NULL, any protocol will be matched. +.\"O A connection is opened to the database if necessary. +.BR getservbyport () +´Ø¿ô¤Ï¡¢ +¥×¥í¥È¥³¥ë \fIproto\fP ¤òÍѤ¤¤ë¥µ¡¼¥Ó¥¹¤Î¥Ý¡¼¥ÈÈÖ¹æ \fIport\fP +¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢ +¤½¤Î¥¨¥ó¥È¥ê¤ÎÆâÍƤò¼ý¤á¤¿ \fIservent\fP ¹½Â¤ÂΤòÊÖ¤¹ +(¥Ý¡¼¥ÈÈÖ¹æ \fIport\fP ¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥Ð¥¤¥È¥ª¡¼¥À¤Ç»ØÄꤹ¤ë)¡£ +\fIproto\fP ¤¬ NULL ¤Î¾ì¹ç¤ÏǤ°Õ¤Î¥×¥í¥È¥³¥ë¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR setservent () +.\"O function opens a connection to the database, +.\"O and sets the next entry to the first entry. +.\"O If \fIstayopen\fP is nonzero, +.\"O then the connection to the database +.\"O will not be closed between calls to one of the +.\"O .BR getserv* () +.\"O functions. +.BR setservent () +´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥ª¡¼¥×¥ó¤·¡¢ +¼¡¤ÎÆɤ߹þ¤ß¥¨¥ó¥È¥ê¤òÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤹ¤ë¡£ +\fIstayopen\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢ +°ì¤Ä°ì¤Ä¤Î +.BR getserv* () +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR endservent () +.\"O function closes the connection to the database. +.BR endservent () +´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +.\"O The \fIservent\fP structure is defined in \fI\fP as follows: +\fIservent\fP ¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +struct servent { + char *s_name; /* official service name */ + char **s_aliases; /* alias list */ + int s_port; /* port number */ + char *s_proto; /* protocol to use */ +} +.fi +.in +.PP +.\"O The members of the \fIservent\fP structure are: +\fIservent\fP ¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Ï°Ê²¼¤ÎÄ̤ꡣ +.RS +.TP 12 +.I s_name +.\"O The official name of the service. +¥µ¡¼¥Ó¥¹¤ÎÀµ¼°Ì¾ (official name)¡£ +.TP +.I s_aliases +.\"O A NULL-terminated list of alternative names for the service. +¥µ¡¼¥Ó¥¹¤ÎÊÌ̾¤Î¥ê¥¹¥È¡£ +¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.TP +.I s_port +.\"O The port number for the service given in network byte order. +¥µ¡¼¥Ó¥¹¤Î¥Ý¡¼¥ÈÈֹ档¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Ç»ØÄꤵ¤ì¤ë¡£ +.TP +.I s_proto +.\"O The name of the protocol to use with this service. +¤³¤Î¥µ¡¼¥Ó¥¹¤È¶¦¤ËÍѤ¤¤ë¥×¥í¥È¥³¥ë¤Î̾Á°¡£ +.RE +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR getservent (), +.\"O .BR getservbyname () +.\"O and +.\"O .BR getservbyport () +.\"O functions return a pointer to a +.\"O statically allocated \fIservent\fP structure, or a NULL pointer if an +.\"O error occurs or the end of the file is reached. +.BR getservent (), +.BR getservbyname (), +.BR getservbyport () +´Ø¿ô¤Ï¡¢ +ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ \fIservent\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/services +.\"O services database file +¥µ¡¼¥Ó¥¹¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getnetent (3), +.BR getprotoent (3), +.BR getservent_r (3), +.BR services (5) diff --git a/draft/man3/getspnam.3 b/draft/man3/getspnam.3 new file mode 100644 index 00000000..5c35a1d9 --- /dev/null +++ b/draft/man3/getspnam.3 @@ -0,0 +1,406 @@ +.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) and +.\" Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated 2004-08-20, Yuichi SATO +.\" +.TH GETSPNAM 3 2010-02-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getspnam, getspnam_r, getspent, getspent_r, setspent, endspent, +.\"O fgetspent, fgetspent_r, sgetspent, sgetspent_r, putspent, +.\"O lckpwdf, ulckpwdf \- get shadow password file entry +getspnam, getspnam_r, getspent, getspent_r, setspent, endspent,fgetspent, fgetspent_r, sgetspent, sgetspent_r, putspent, lckpwdf, ulckpwdf \- shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.\"O /* General shadow password file API */ +/* °ìÈÌŪ¤Ê shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë API */ +.br +.B #include +.sp +.BI "struct spwd *getspnam(const char *" name ); +.sp +.B struct spwd *getspent(void); +.sp +.B void setspent(void); +.sp +.B void endspent(void); +.sp +.BI "struct spwd *fgetspent(FILE *" fp ); +.sp +.BI "struct spwd *sgetspent(const char *" s ); +.sp +.BI "int putspent(struct spwd *" p ", FILE *" fp ); +.sp +.B int lckpwdf(void); +.sp +.B int ulckpwdf(void); +.sp +.\"O /* GNU extension */ +/* GNU ÈǤˤª¤±¤ë³ÈÄ¥ */ +.br +.B #include +.sp +.BI "int getspent_r(struct spwd *" spbuf , +.br +.BI " char *" buf ", size_t " buflen ", struct spwd **" spbufp ); +.sp +.BI "int getspnam_r(const char *" name ", struct spwd *" spbuf , +.br +.BI " char *" buf ", size_t " buflen ", struct spwd **" spbufp ); +.sp +.BI "int fgetspent_r(FILE *" fp ", struct spwd *" spbuf , +.br +.BI " char *" buf ", size_t " buflen ", struct spwd **" spbufp ); +.sp +.BI "int sgetspent_r(const char *" s ", struct spwd *" spbuf , +.br +.BI " char *" buf ", size_t " buflen ", struct spwd **" spbufp ); +.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 getspent_r (), +.BR getspnam_r (), +.BR fgetspent_r (), +.BR sgetspent_r (): +_BSD_SOURCE || _SVID_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Long ago it was considered safe to have encrypted passwords openly +.\"O visible in the password file. +.\"O When computers got faster and people +.\"O got more security-conscious, this was no longer acceptable. +ÀΤϰŹ沽¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤ò¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Ë +¸«¤¨¤ë¤è¤¦¤Ë¸ø³«¤·¤Æ¤ª¤¤¤Æ¤â°ÂÁ´¤À¤È¹Í¤¨¤é¤ì¤Æ¤¤¤¿¡£ +.\"O Julianne Frances Haugh implemented the shadow password suite +.\"O that keeps the encrypted passwords in +.\"O the shadow password database +.\"O (e.g., the local shadow password file +.\"O .IR /etc/shadow , +.\"O NIS, and LDAP), +.\"O readable only by root. +Julianne Frances Haugh ¤Ï shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥¹¥¤¡¼¥È¤ò¼ÂÁõ¤·¤¿¡£ +¤³¤ì¤Ï°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤ò¡¢root ¤Î¤ß¤¬Æɤळ¤È¤¬¤Ç¤­¤ë +shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹ (Î㤨¤Ð¡¢ +¥í¡¼¥«¥ë¤Î shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë +.IR /etc/shadow , +NIS, LDAP) +¤ËÊÝ»ý¤¹¤ë¡£ +.LP +.\"O The functions described below resemble those for +.\"O the traditional password database +.\"O (e.g., see +.\"O .BR getpwnam (3) +.\"O and +.\"O .BR getpwent (3)). +°Ê²¼¤ÇÀâÌÀ¤¹¤ë´Ø¿ô¤Ï¡¢ÅÁÅýŪ¤Ê¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë +´Ø¿ô¤Ë»÷¤Æ¤¤¤ë (Î㤨¤Ð +.BR getpwnam (3) +¤ä +.BR getpwent (3) +¤ò»²¾È)¡£ +.\"O .\" FIXME I've commented out the following for the +.\"O .\" moment. The relationship between PAM and nsswitch.conf needs +.\"O .\" to be clearly documented in one place, which is pointed to by +.\"O .\" the pages for the user, group, and shadow password functions. +.\"O .\" (Jul 2005, mtk) +.\"O .\" +.\"O .\" This shadow password setup has been superseded by PAM +.\"O .\" (pluggable authentication modules), and the file +.\"O .\" .I /etc/nsswitch.conf +.\"O .\" now describes the sources to be used. +.\" FIXME °Ê²¼¤ò°ì»þŪ¤Ë¥³¥á¥ó¥È¥¢¥¦¥È¤·¤¿¡£ +.\" PAM ¤È nsswitch.conf ¤Î´Ø·¸¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥æ¡¼¥¶¡¢¥°¥ë¡¼¥×¡¢shadow +.\" ¥Ñ¥¹¥ï¡¼¥É¤Î´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Î¥Ú¡¼¥¸¤«¤é»²¾È¤µ¤ì¤ë¤É¤³¤«¤Ë¤Ï¤Ã¤­¤ê¤È +.\" µ­ºÜ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +.\" (Jul 2005, mtk) +.\" +.\" ¤³¤Î shadow ¥Ñ¥¹¥ï¡¼¥É¤ÎÀßÄê¤Ï +.\" PAM (pluggable authentication modules) ¤Ç¼è¤êÂؤ¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\" ¸½ºß¤Î¤È¤³¤í¡¢¤É¤Î¾ðÊ󸻤ò»ÈÍѤ¹¤ë¤«¤Ï +.\" .I /etc/nsswitch.conf +.\" ¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤ë¡£ +.LP +.\"O The +.\"O .BR getspnam () +.\"O function returns a pointer to a structure containing +.\"O the broken-out fields of the record in the shadow password database +.\"O that matches the username +.\"O .IR name . +.BR getspnam () +´Ø¿ô¤Ï¡¢¥æ¡¼¥¶Ì¾ +.I name +¤Ë¥Þ¥Ã¥Á¤¹¤ë shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.LP +.\"O The +.\"O .BR getspent () +.\"O function returns a pointer to the next entry in the shadow password +.\"O database. +.BR getspent () +´Ø¿ô¤Ï shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤ª¤±¤ë¼¡¤Î¥¨¥ó¥È¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O The position in the input stream is initialized by +.\"O .BR setspent (). +ÆþÎÏ¥¹¥È¥ê¡¼¥à¤Ë¤ª¤±¤ë°ÌÃ֤ϡ¢ +.BR setspent () +¤Ç½é´ü²½¤µ¤ì¤ë¡£ +.\"O When done reading, the program may call +.\"O .BR endspent () +.\"O so that resources can be deallocated. +Æɤ߹þ¤ß¤¬½ª¤ï¤Ã¤¿¸å¤Ë¡¢ +.BR endspent () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¥ê¥½¡¼¥¹¤ò²òÊü¤Ç¤­¤ë¡£ +.\"O .\" some systems require a call of setspent() before the first getspent() +.\"O .\" glibc does not +.\" ºÇ½é¤Ë getspent() ¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë¡¢ +.\" setspent() ¤ò¸Æ¤Ó½Ð¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.\" glibc ¤Ç¤Ï¤½¤ÎɬÍפ¬¤Ê¤¤¡£ +.LP +.\"O The +.\"O .BR fgetspent () +.\"O function is similar to +.\"O .BR getspent () +.\"O but uses the supplied stream instead of the one implicitly opened by +.\"O .BR setspent (). +.BR fgetspent () +´Ø¿ô¤Ï +.BR getspent () +¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ +.BR setspent () +¤Ç°ÅÌۤΤ¦¤Á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤ë¥¹¥È¥ê¡¼¥à¤Ç¤Ï¤Ê¤¯¡¢Í¿¤¨¤é¤ì¤¿¥¹¥È¥ê¡¼¥à¤ò»È¤¦¡£ +.LP +.\"O The +.\"O .BR sgetspent () +.\"O function parses the supplied string +.\"O .I s +.\"O into a struct +.\"O .IR spwd . +.BR sgetspent () +´Ø¿ô¤ÏÍ¿¤¨¤é¤ì¤¿Ê¸»úÎó +.I s +¤ò²òÀϤ· struct +.I spwd +¤Ë³ÊǼ¤¹¤ë¡£ +.LP +.\"O The +.\"O .BR putspent () +.\"O function writes the contents of the supplied struct +.\"O .I spwd +.\"O .I *p +.\"O as a text line in the shadow password file format to the stream +.\"O .IR fp . +.BR putspent () +´Ø¿ô¤ÏÍ¿¤¨¤é¤ì¤¿ struct +.I spwd +.I *p +¤ÎÆâÍƤò shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë·Á¼°¤Î¥Æ¥­¥¹¥È¹Ô¤Ç¥¹¥È¥ê¡¼¥à +.I fp +¤Ë½ñ¤­½Ð¤¹¡£ +.\"O String entries with value NULL and numerical entries with value \-1 +.\"O are written as an empty string. +¶õʸ»úÎó¤È¤·¤Æ¡¢ +Ãͤ¬ NULL ¤Îʸ»úÎ󥨥ó¥È¥ê¤ÈÃͤ¬ \-1 ¤Î¿ôÃÍ¥¨¥ó¥È¥ê¤¬ +½ñ¤­½Ð¤µ¤ì¤ë¡£ +.LP +.\"O The +.\"O .BR lckpwdf () +.\"O function is intended to protect against multiple simultaneous accesses +.\"O of the shadow password database. +.\"O It tries to acquire a lock, and returns 0 on success, +.\"O or \-1 on failure (lock not obtained within 15 seconds). +.BR lckpwdf () +´Ø¿ô¤Ï¡¢ shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò +¿½ÅƱ»þ¥¢¥¯¥»¥¹¤«¤é¼é¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥í¥Ã¥¯¤Î³ÍÆÀ¤ò»î¤ß¡¢ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç (15 ÉðÊÆâ¤Ë¥í¥Ã¥¯¤¬¼èÆÀ¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç) ¤Ï \-1 ¤òÊÖ¤¹¡£ +.\"O The +.\"O .BR ulckpwdf () +.\"O function releases the lock again. +.BR ulckpwdf () +´Ø¿ô¤Ï¥í¥Ã¥¯¤òºÆ¤Ó²òÊü¤¹¤ë¡£ +.\"O Note that there is no protection against direct access of the shadow +.\"O password file. +.\"O Only programs that use +.\"O .BR lckpwdf () +.\"O will notice the lock. +shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Ø¤ÎľÀÜ¥¢¥¯¥»¥¹¤«¤é +Êݸ¤ë¼êÃʤ¬¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.BR lckpwdf () +¤ò»È¤¦¥×¥í¥°¥é¥à¤À¤±¤¬¥í¥Ã¥¯¤òÄÌÃΤǤ­¤ë¡£ +.LP +.\"O These were the functions that formed the original shadow API. +.\"O They are widely available. +.\"O .\" Also in libc5 +.\"O .\" SUN doesn't have sgetspent() +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥ª¥ê¥¸¥Ê¥ë¤Î shadow API ¤ò¹½À®¤·¤Æ¤¤¤¿´Ø¿ô¤Ç¤¢¤ê¡¢ +¤¤¤í¤¤¤í¤Ê¥·¥¹¥Æ¥à¤Ç¹­¤¯ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\" libc5 ¤Ç¤âÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\" SUN ¤Ë¤Ï sgetspent() ¤¬¤Ê¤¤¡£ +.\"O .SS "Reentrant versions" +.SS ¥ê¥¨¥ó¥È¥é¥ó¥ÈÈÇ +.\"O Analogous to the reentrant functions for the password database, glibc +.\"O also has reentrant functions for the shadow password database. +¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤÈƱ¤¸¤è¤¦¤Ë¡¢ +glibc ¤Ë¤Ï shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤ¬¤¢¤ë¡£ +.\"O The +.\"O .BR getspnam_r () +.\"O function is like +.\"O .BR getspnam () +.\"O but stores the retrieved shadow password structure in the space pointed to by +.\"O .IR spbuf . +.BR getspnam_r () +´Ø¿ô¤Ï +.BR getspnam () +¤È»÷¤Æ¤¤¤ë¤¬¡¢¼èÆÀ¤·¤¿ shadow ¥Ñ¥¹¥ï¡¼¥É¹½Â¤ÂΤò +.I spbuf +¤¬»Ø¤¹Îΰè¤Ë³ÊǼ¤¹¤ë¡£ +.\"O This shadow password structure contains pointers to strings, and these strings +.\"O are stored in the buffer +.\"O .I buf +.\"O of size +.\"O .IR buflen . +shadow ¥Ñ¥¹¥ï¡¼¥É¹½Â¤ÂΤÏʸ»úÎ󷲤ؤΥݥ¤¥ó¥¿¤ò´Þ¤ß¡¢ +¤³¤ì¤é¤Îʸ»úÎ󷲤ϥµ¥¤¥º +.I buflen +¤Î¥Ð¥Ã¥Õ¥¡ +.I buf +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.\"O A pointer to the result (in case of success) or NULL (in case no entry +.\"O was found or an error occurred) is stored in +.\"O .IR *spbufp . +.I *spbufp +¤Ë¤Ï (À®¸ù¤·¤¿¾ì¹ç¤Ï) ·ë²Ì¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬³ÊǼ¤µ¤ì¡¢ +(¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Þ¤¿¤Ï¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ï) +NULL ¤¬³ÊǼ¤µ¤ì¤ë¡£ +.LP +.\"O The functions +.\"O .BR getspent_r (), +.\"O .BR fgetspent_r (), +.\"O and +.\"O .BR sgetspent_r () +.\"O are similarly analogous to their nonreentrant counterparts. +´Ø¿ô +.BR getspent_r (), +.BR fgetspent_r (), +.BR sgetspent_r () +¤Ï¤½¤ì¤¾¤ì¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ê¤¤¥Ð¡¼¥¸¥ç¥ó¤ÈƱÍͤε¡Ç½¤ò»ý¤Ä¡£ +.LP +.\"O Some non-glibc systems also have functions with these names, +.\"O often with different prototypes. +.\"O .\" SUN doesn't have sgetspent_r() +glibc ¤Ç¤Ê¤¤¥·¥¹¥Æ¥à¤Ë¤â¤³¤ì¤é¤ÈƱ¤¸Ì¾Á°¤Î´Ø¿ô¤¬¤¢¤ë¤¬¡¢ +¥×¥í¥È¥¿¥¤¥×¤¬°Û¤Ê¤ë¤³¤È¤â¿¤¤¡£ +.\" SUN ¤Ë¤Ï sgetspent_r() ¤¬¤Ê¤¤¡£ +.\"O .SS Structure +.SS ¹½Â¤ÂÎ +.\"O The shadow password structure is defined in \fI\fP as follows: +shadow ¥Ñ¥¹¥ï¡¼¥É¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct spwd { +.\"O char *sp_namp; /* Login name */ +.\"O char *sp_pwdp; /* Encrypted password */ +.\"O long sp_lstchg; /* Date of last change (measured +.\"O in days since 1970-01-01 00:00:00 +0000 (UTC)) */ +.\"O long sp_min; /* Min # of days between changes */ +.\"O long sp_max; /* Max # of days between changes */ +.\"O long sp_warn; /* # of days before password expires +.\"O to warn user to change it */ +.\"O long sp_inact; /* # of days after password expires +.\"O until account is disabled */ +.\"O long sp_expire; /* Date when account expires (measured +.\"O in days since 1970-01-01 00:00:00 +0000 (UTC)) */ +.\"O unsigned long sp_flag; /* Reserved */ + char *sp_namp; /* ¥í¥°¥¤¥ó̾ */ + char *sp_pwdp; /* °Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É */ + long sp_lstchg; /* ºÇ½ª¹¹¿·Æü + (1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤ÎÆü¿ô) */ + long sp_min; /* Êѹ¹¤¬½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤ë¤Þ¤Ç¤ÎºÇûÆü¿ô */ + long sp_max; /* Êѹ¹¤ò¤·¤Ê¤¯¤Æ¤â¤è¤¤ºÇĹÆü¿ô */ + long sp_warn; /* ¥Ñ¥¹¥ï¡¼¥É¤¬´ü¸ÂÀÚ¤ì¤Ë¤Ê¤ëÁ°¤Ë + ¥æ¡¼¥¶¤ËÊѹ¹¤Î·Ù¹ð¤ò½Ð¤¹Æü¿ô */ + long sp_inact; /* ¥Ñ¥¹¥ï¡¼¥É¤¬´ü¸ÂÀÚ¤ì¤Ë¤Ê¤Ã¤Æ¤«¤é + ¥¢¥«¥¦¥ó¥È¤¬Ìµ¸ú¤Ë¤Ê¤ë¤Þ¤Ç¤ÎÆü¿ô */ + long sp_expire; /* ¥¢¥«¥¦¥ó¥È¤¬Ìµ¸ú¤Ë¤Ê¤ëÆüÉÕ + (1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤ÎÆü¿ô) */ + unsigned long sp_flag; /* ͽÌó¥Õ¥£¡¼¥ë¥É */ +}; +.fi +.in +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The functions that return a pointer return NULL if no more entries +.\"O are available or if an error occurs during processing. +¥Ý¥¤¥ó¥¿¤òÊÖ¤¹´Ø¿ô¤Ï¡¢¤³¤ì°Ê¾å¥¨¥ó¥È¥ê¤¬¤Ê¤¤¾ì¹ç¤ä +½èÍýÃæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç NULL ¤òÊÖ¤¹¡£ +.\"O The functions which have \fIint\fP as the return value return 0 for +.\"O success and \-1 for failure. +\fIint\fP ¤òÊÖ¤êÃͤȤ·¤Æ»ý¤Ä´Ø¿ô¤Ï¡¢ +À®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤òÊÖ¤¹¡£ +.LP +.\"O For the nonreentrant functions, the return value may point to static area, +.\"O and may be overwritten by subsequent calls to these functions. +¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤʤ¤´Ø¿ô¤Ç¤Ï¡¢ÊÖ¤êÃͤ¬ÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢ +°ú¤­Â³¤¤¤Æ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤Ë¾å½ñ¤­¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.LP +.\"O The reentrant functions return zero on success. +¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤδؿô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ë 0 ¤òÊÖ¤¹¡£ +.\"O In case of error, an error number is returned. +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢¥¨¥é¡¼Èֹ椬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ERANGE +.\"O Supplied buffer is too small. +Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ¤¹¤®¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/shadow +.\"O local shadow password database file +¥í¡¼¥«¥ë¤Î shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.TP +.I /etc/.pwd.lock +.\"O lock file +¥í¥Ã¥¯¥Õ¥¡¥¤¥ë +.LP +.\"O The include file +.\"O .I +.\"O defines the constant +.\"O .B _PATH_SHADOW +.\"O to the pathname of the shadow password file. +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ÏÄê¿ô +.B _PATH_SHADOW +¤òÄêµÁ¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The shadow password database and its associated API are +.\"O not specified in POSIX.1-2001. +.\"O However, many other systems provide a similar API. +shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤È´ØÏ¢ API ¤Ï POSIX.1-2001 +¤Ë¤Ïµ­ºÜ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£¤·¤«¤·¤Ê¤¬¤é¡¢Â¿¤¯¤Î¾¤Î¥·¥¹¥Æ¥à¤Ç¤â +ƱÍͤΠAPI ¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getgrnam (3), +.BR getpwnam (3), +.BR getpwnam_r (3), +.BR shadow (5) diff --git a/draft/man3/getsubopt.3 b/draft/man3/getsubopt.3 new file mode 100644 index 00000000..52a66fc0 --- /dev/null +++ b/draft/man3/getsubopt.3 @@ -0,0 +1,301 @@ +.\" Copyright (C) 2007 Michael Kerrisk +.\" and Copyright (C) 2007 Justin Pryzby +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" 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 2008-05-29 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getsubopt \- parse suboption arguments from a string +getsubopt \- ʸ»úÎóÃæ¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó°ú¤­¿ô¤Î²ò¼á¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _XOPEN_SOURCE 500 +.br +.B #include + +.BI "int getsubopt(char **"optionp ", char * const *" tokens \ +", char **" valuep ); +.\"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 +¤ËÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.sp +.in +4n +.B ro,name=xyz +.in + +.\"O The +.\"O .I tokens +.\"O argument is a pointer to a NULL-terminated list of 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ʸ»ú°Ê¾å¤Îʸ»úÎó¤Ç¡¢ +¾¤Î¥È¡¼¥¯¥ó¤È¶èÊ̤Ǥ­¤ëɬÍפ¬¤¢¤ë¡£ +¤Þ¤¿¡¢Åù¹æ¤È¥«¥ó¥Þ¤ò´Þ¤ó¤Ç¤Ï¤Ê¤é¤Ê¤¤¡£ + +.\"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 +¤Ï¤½¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤Î¡ÖÃͤÎʸ»úÎó¡×¤½¤Î¤â¤Î¤È¤Ê¤ë¡£ + +.\"O If the suboption is recognized, but no value string was found, +.\"O .RI * valuep +.\"O is set to NULL. +¥µ¥Ö¥ª¥×¥·¥ç¥ó¤¬Ç§¼±¤µ¤ì¤¿¤¬¡¢Ãͤòɽ¤¹Ê¸»úÎ󤬸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.RI * valuep +¤Ï NULL ¤ËÀßÄꤵ¤ì¤ë¡£ + +.\"O When +.\"O .BR getsubopt () +.\"O returns, +.\"O .I optionp +.\"O points to the next suboption, or to the null character at the end of the +.\"O string if the last suboption was just processed. +.BR getsubopt () +¤¬ÊÖ¤ë»þ¡¢ +.I optionp +¤Ï¼¡¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤ò»Ø¤·¤Æ¤¤¤ë¡£ +¤Á¤ç¤¦¤ÉºÇ¸å¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤¬½èÍý¤µ¤ì¤¿¾ì¹ç¤Ï¡¢ +ʸ»úÎóËöÈø¤Î¥Ì¥ëʸ»ú¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.\"O .SH RETURN VALUE +.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 ] +¤Îʸ»úÎóÁ´ÂΤȤʤ롣 + +.\"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 () +¤ò¸Æ¤Ó½Ð¤·¸å¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤Èɬ¤º¤·¤âƱ¤¸¤È¤Ï¸Â¤é¤Ê¤¤¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.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 +.SH Îã +.\"O The following program expects suboptions following a "\-o" option. +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï "\-o" ¥ª¥×¥·¥ç¥ó¤Ë³¤¤¤Æ¥µ¥Ö¥ª¥×¥·¥ç¥ó¤¬¤¢¤ë¤³¤È¤ò +´üÂÔ¤·¤Æ¤¤¤ë¡£ + +.nf +#define _XOPEN_SOURCE 500 +#include +#include +#include + +int main(int argc, char **argv) +{ + enum { + RO_OPT = 0, + RW_OPT, + NAME_OPT + }; + char *const token[] = { + [RO_OPT] = "ro", + [RW_OPT] = "rw", + [NAME_OPT] = "name", + NULL + }; + char *subopts; + char *value; + int opt; + + int readonly = 0; + int readwrite = 0; + char *name = NULL; + int errfnd = 0; + + while ((opt = getopt(argc, argv, "o:")) != \-1) { + switch (opt) { + case \(aqo\(aq: + subopts = optarg; + while (*subopts != \(aq\\0\(aq && !errfnd) { + + switch (getsubopt(&subopts, token, &value)) { + case RO_OPT: + readonly = 1; + break; + + case RW_OPT: + readwrite = 1; + break; + + case NAME_OPT: + if (value == NULL) { + fprintf(stderr, "Missing value for " + "suboption \(aq%s\(aq\\n", token[NAME_OPT]); + errfnd = 1; + continue; + } + + name = value; + break; + + default: + fprintf(stderr, "No match found " + "for token: /%s/\\n", 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]); + errfnd = 1; + } + break; + + default: + errfnd = 1; + } + } + + if (errfnd || argc == 1) { + fprintf(stderr, "\\nUsage: %s \-o \\n", argv[0]); + fprintf(stderr, "suboptions are \(aqro\(aq, \(aqrw\(aq, " + "and \(aqname=\(aq\\n"); + exit(EXIT_FAILURE); + } + + /* Remainder of program... */ + + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR getopt (3), +.BR feature_test_macros (7) diff --git a/draft/man3/getttyent.3 b/draft/man3/getttyent.3 new file mode 100644 index 00000000..c118babd --- /dev/null +++ b/draft/man3/getttyent.3 @@ -0,0 +1,131 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Fri Aug 20 03:27:22 JST 2004 +.\" by Yuichi SATO +.\" +.TH GETTTYENT 3 2002-07-18 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getttyent, getttynam, setttyent, endttyent \- get ttys file entry +getttyent, getttynam, setttyent, endttyent \- ttys ¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B "#include " +.sp +.B "struct ttyent *getttyent(void);" +.sp +.BI "struct ttyent *getttynam(const char *" name ); +.sp +.B "int setttyent(void);" +.sp +.B "int endttyent(void);" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These functions provide an interface to the file +.\"O .B _PATH_TTYS +.\"O (e.g., +.\"O .IR /etc/ttys ). +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë +.B _PATH_TTYS +(Î㤨¤Ð +.IR /etc/ttys ) +¤Ø¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ + +.\"O The function +.\"O .BR setttyent () +.\"O opens the file or rewinds it if already open. +´Ø¿ô +.BR setttyent () +¤Ï¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +¤Þ¤¿´û¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢´¬¤­Ì᤹¡£ + +.\"O The function +.\"O .BR endttyent () +.\"O closes the file. +´Ø¿ô +.BR endttyent () +¤Ï¥Õ¥¡¥¤¥ë¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ + +.\"O The function +.\"O .BR getttynam () +.\"O searches for a given ttyname in the file. +.\"O It returns a pointer to a +.\"O .I ttyent +.\"O structure (description below). +´Ø¿ô +.BR getttynam () +¤Ï»ØÄꤵ¤ì¤¿Ã¼Ëö̾¤Ë¤Ä¤¤¤Æ¥Õ¥¡¥¤¥ë¤ò¸¡º÷¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï (°Ê²¼¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë) +.I ttyent +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ + +.\"O The function +.\"O .BR getttyent () +.\"O opens the file +.\"O .B _PATH_TTYS +.\"O (if necessary) and returns the first entry. +.\"O If the file is already open, the next entry. +´Ø¿ô +.BR getttyent () +¤Ï (¤â¤·É¬ÍפǤ¢¤ì¤Ð) ¥Õ¥¡¥¤¥ë +.B _PATH_TTYS +¤ò¥ª¡¼¥×¥ó¤·¡¢ºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +¥Õ¥¡¥¤¥ë¤¬´û¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +.\"O The +.\"O .I ttyent +.\"O structure has the form: +.I ttyent +¹½Â¤ÂΤϰʲ¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.in +4n +.nf + +struct ttyent { +.\"O char *ty_name; /* terminal device name */ +.\"O char *ty_getty; /* command to execute, usually getty */ +.\"O char *ty_type; /* terminal type for termcap */ +.\"O int ty_status; /* status flags */ +.\"O char *ty_window; /* command to start up window manager */ +.\"O char *ty_comment; /* comment field */ + char *ty_name; /* üËö¥Ç¥Ð¥¤¥¹Ì¾ */ + char *ty_getty; /* ¼Â¹Ô¤¹¤ë¥³¥Þ¥ó¥É¡£Ä̾ï¤Ï getty */ + char *ty_type; /* termcap ¤Î¤¿¤á¤ÎüËö¥¿¥¤¥× */ + int ty_status; /* ¾õÂ֥ե饰 */ + char *ty_window; /* ¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¤òµ¯Æ°¤¹¤ë¥³¥Þ¥ó¥É */ + char *ty_comment; /* ¥³¥á¥ó¥È¥Õ¥£¡¼¥ë¥É */ +}; +.fi +.in + +.\"O .I ty_status +.\"O can be: +.I ty_status +¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«Ãͤò¤È¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.nf + +.\"O #define TTY_ON 0x01 /* enable logins (start ty_getty program) */ +.\"O #define TTY_SECURE 0x02 /* allow UID 0 to login */ +#define TTY_ON 0x01 /* ¥í¥°¥¤¥ó¤òÍ­¸ú¤Ë¤¹¤ë (ty_getty ¥×¥í¥°¥é¥à¤ò³«»Ï¤¹¤ë) */ +#define TTY_SECURE 0x02 /* ¥æ¡¼¥¶ ID 0 ¤Ç¤Î¥í¥°¥¤¥ó¤òµö²Ä¤¹¤ë */ +.fi +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Not in POSIX.1-2001. +.\"O Present on the BSDs, and perhaps other systems. +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¤Ë¸ºß¤·¡¢¤ª¤½¤é¤¯Â¾¤Î¥·¥¹¥Æ¥à¤Ë¤â¤¢¤ë¤À¤í¤¦¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Under Linux the file +.\"O .IR /etc/ttys , +.\"O and the functions described above, are not used. +Linux ¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë +.I /etc/ttys +¤È¾å¤ÇÀâÌÀ¤·¤¿´Ø¿ô¤Ï»È¤ï¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ttyname (3), +.BR ttyslot (3) diff --git a/draft/man3/getumask.3 b/draft/man3/getumask.3 new file mode 100644 index 00000000..20e5bd73 --- /dev/null +++ b/draft/man3/getumask.3 @@ -0,0 +1,82 @@ +.\" Copyright (C) 2002 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. +.\" +.\" 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 2009-01-20 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getumask \- get file creation mask +getumask \- ¥Õ¥¡¥¤¥ëºîÀ®¥Þ¥¹¥¯¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B "#include " +.br +.B "#include " +.sp +.B "mode_t getumask(void);" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This function returns the current file creation mask. +¤³¤Î´Ø¿ô¤Ï¸½ºß¤Î¥Õ¥¡¥¤¥ëºîÀ®¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +.\"O It is equivalent to +´ðËÜŪ¤Ë¤Ï°Ê²¼¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.in +4n +.nf + +mode_t getumask(void) +{ + mode_t mask = umask( 0 ); + umask(mask); + return mask; +} + +.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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR umask (2) diff --git a/draft/man3/getusershell.3 b/draft/man3/getusershell.3 new file mode 100644 index 00000000..bcb6f8d3 --- /dev/null +++ b/draft/man3/getusershell.3 @@ -0,0 +1,115 @@ +.\" 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 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 +.SH ̾Á° +.\"O getusershell, setusershell, endusershell \- get permitted user shells +getusershell, setusershell, endusershell \- µö²Ä¤µ¤ì¤¿¥æ¡¼¥¶¥·¥§¥ë¤òÆÀ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B char *getusershell(void); +.sp +.B void setusershell(void); +.sp +.B void endusershell(void); +.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 getusershell (), +.BR setusershell (), +.BR endusershell (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.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 +¤¬¥Õ¥¡¥¤¥ë¤Ëµ­¤µ¤ì¤Æ¤¤¤ë¤«¤Î¤è¤¦¤Ë¤Õ¤ë¤Þ¤¦¡£ +.PP +.\"O The +.\"O .BR setusershell () +.\"O function rewinds \fI/etc/shells\fP. +.BR setusershell () +´Ø¿ô¤Ï \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" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR getusershell () +.\"O function returns a NULL pointer on end-of-file. +.BR getusershell () +´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¤Î½ªÃ¼¤Ç¤ÏNULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.nf +/etc/shells +.fi +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR shells (5) diff --git a/draft/man3/getutent.3 b/draft/man3/getutent.3 new file mode 100644 index 00000000..dc0efadf --- /dev/null +++ b/draft/man3/getutent.3 @@ -0,0 +1,438 @@ +.\" Copyright 1995 Mark D. Roth (roth@uiuc.edu) +.\" +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Solaris manpages +.\" +.\" Modified Thu Jul 25 14:43:46 MET DST 1996 by Michael Haardt +.\" +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-03-15, NAKANO Takeo +.\" Updated 2001-10-16, Kentaro Shirakata +.\" Updated 2002-01-03, Kentaro Shirakata +.\" Updated 2005-03-18, Akihiro MOTOKI +.\" Updated 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" +.TH GETUTENT 3 2008-06-29 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getutent, getutid, getutline, pututline, setutent, endutent, +.\"O utmpname \- access utmp file entries +getutent, getutid, getutline, pututline, setutent, endutent, utmpname \- +utmp ¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤Ë¥¢¥¯¥»¥¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B struct utmp *getutent(void); +.br +.BI "struct utmp *getutid(struct utmp *" ut ); +.br +.BI "struct utmp *getutline(struct utmp *" ut ); +.sp +.BI "struct utmp *pututline(struct utmp *" ut ); +.sp +.B void setutent(void); +.br +.B void endutent(void); +.sp +.BI "int utmpname(const char *" file ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O New applications should use the POSIX.1-specified "utmpx" versions of +.\"O these functions; see CONFORMING TO. +¿·¤·¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤Î "utmpx" ÈǤò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Ï POSIX.1 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£¡Ö½àµò¡×¤ÎÀá¤ò»²¾È¡£ + +.\"O .BR utmpname () +.\"O sets the name of the utmp-format file for the other utmp +.\"O functions to access. +.\"O If +.\"O .BR utmpname () +.\"O is not used to set the filename +.\"O before the other functions are used, they assume \fB_PATH_UTMP\fP, as +.\"O defined in \fI\fP. +.BR utmpname () +¤Ï¡¢Â¾¤Î utmp ´Ø¿ô¤¬¥¢¥¯¥»¥¹¤¹¤ë (utmp ¥Õ¥©¡¼¥Þ¥Ã¥È¤Î) +¥Õ¥¡¥¤¥ë¤Î̾Á°¤ò»ØÄꤹ¤ë¡£Â¾¤Î´Ø¿ô¤ò»È¤¦Á°¤Ë +.BR utmpname () +¤ò»È¤Ã¤Æ +¥Õ¥¡¥¤¥ë̾¤Î»ØÄê¤ò¹Ô¤ï¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ \fI\fP ¤Ç +ÄêµÁ¤µ¤ì¤Æ¤¤¤ë \fB_PATH_UTMP\fP ¤¬¥Õ¥¡¥¤¥ë̾¤È¤ß¤Ê¤µ¤ì¤ë¡£ +.PP +.\"O .BR setutent () +.\"O rewinds the file pointer to the beginning of the utmp file. +.\"O It is generally a good idea to call it before any of the other +.\"O functions. +.BR setutent () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤ò utmp ¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë°ÜÆ°¤¹¤ë¡£ +°ìÈÌŪ¤Ë¤Ï¡¢Â¾¤Î´Ø¿ô¤ò»È¤¦Á°¤Ë¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤Æ¤ª¤¯¤ÈÎɤ¤¤À¤í¤¦¡£ +.PP +.\"O .BR endutent () +.\"O closes the utmp file. +.\"O It should be called when the user +.\"O code is done accessing the file with the other functions. +.BR endutent () +¤Ï utmp ¥Õ¥¡¥¤¥ë¤ò¥¯¥í¡¼¥º¤¹¤ë¡£¥æ¡¼¥¶¡¼¥³¡¼¥É¤Ç +¾¤Î´Ø¿ô¤ò»È¤Ã¤Æ¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤ò¹Ô¤Ã¤¿»þ¤Ï¡¢ºÇ¸å¤Ë¤³¤Î´Ø¿ô¤ò +¸Æ¤Ó½Ð¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.\"O .BR getutent () +.\"O reads a line from the current file position in the utmp file. +.\"O It returns a pointer to a structure containing the fields of +.\"O the line. +.BR getutent () +¤Ï utmp ¥Õ¥¡¥¤¥ë¤Î¸½ºß¤Î¥Õ¥¡¥¤¥ë°ÌÃÖ¤«¤é°ì¹ÔÆɤ߹þ¤ß¡¢ +¹Ô¤Î³Æ¥Õ¥£¡¼¥ë¥É¤ÎÆâÍƤò¼ý¤á¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O The definition of this structure is shown in +.\"O .BR utmp (5). +¤³¤Î¹½Â¤ÂΤÎÄêµÁ¤Ï +.BR utmp (5) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O .BR getutid () +.\"O searches forward from the current file position in the utmp +.\"O file based upon \fIut\fP. +.\"O If \fIut\fP\->ut_type is one of \fBRUN_LVL\fP, +.\"O \fBBOOT_TIME\fP, \fBNEW_TIME\fP, or \fBOLD_TIME\fP, +.\"O .BR getutid () +.\"O will +.\"O find the first entry whose \fIut_type\fP field matches \fIut\fP\->ut_type. +.\"O If \fIut\fP\->ut_type is one of \fBINIT_PROCESS\fP, \fBLOGIN_PROCESS\fP, +.\"O \fBUSER_PROCESS\fP, or \fBDEAD_PROCESS\fP, +.\"O .BR getutid () +.\"O will find the +.\"O first entry whose +.\"O .I ut_id +.\"O field matches \fIut\fP\->ut_id. +.BR getutid () +¤Ï¡¢ utmp ¥Õ¥¡¥¤¥ëÃæ¤Î¸½ºß¤Î°ÌÃÖ¤«¤é½çÊý¸þ +(ËöÈø¤Ë¸þ¤«¤¦Êý¸þ) ¤Ø \fIut\fP ¤Ë´ð¤¯¸¡º÷¤ò¹Ô¤¦¡£ \fIut\fP\->ut_type ¤¬ +\fBRUN_LVL\fP, \fBBOOT_TIME\fP, \fBNEW_TIME\fP, \fBOLD_TIME\fP ¤Î +¤¤¤º¤ì¤«¤Ê¤é¡¢ +.BR getutid () +¤Ï \fBut_type\fP ¥Õ¥£¡¼¥ë¥É¤¬ +\fIut\fP\->ut_type ¤Ë°ìÃפ¹¤ëºÇ½é¤Î¥¨¥ó¥È¥ê¤òõ¤¹¡£ +\fIut\fP\->ut_type ¤¬ \fBINIT_PROCESS\fP, \fBLOGIN_PROCESS\fP, +\fBUSER_PROCESS\fP, \fBDEAD_PROCESS\fP ¤Î¤¤¤º¤ì¤«¤Ê¤é¡¢ +.BR getutid () +¤Ï +.I ut_id +¥Õ¥£¡¼¥ë¥É¤¬ \fIut\fP\->ut_id ¤Ë +°ìÃפ¹¤ëºÇ½é¤Î¥¨¥ó¥È¥ê¤òõ¤¹¡£ +.PP +.\"O .BR getutline () +.\"O searches forward from the current file position in the utmp file. +.\"O It scans entries whose +.\"O .I ut_type +.\"O is \fBUSER_PROCESS\fP +.\"O or \fBLOGIN_PROCESS\fP and returns the first one whose +.\"O .I ut_line +.\"O field +.\"O matches \fIut\->ut_line\fP. +.BR getutline () +¤Ï¡¢ utmp ¥Õ¥¡¥¤¥ë¤Î¸½ºß¤Î°ÌÃÖ¤«¤éËöÈø¤Ë¸þ¤«¤Ã¤Æ¸¡º÷¤ò¹Ô¤¦¡£ +.I ut_type +¤¬ \fBUSER_PROCESS\fP ¤Þ¤¿¤Ï \fBLOGIN_PROCESS\fP ¤Ç¡¢ +.I ut_line +¥Õ¥£¡¼¥ë¥É¤¬ \fIut\fP->ut_line ¤Ë¥Þ¥Ã¥Á¤¹¤ëºÇ½é¤Î¹Ô¤òÊÖ¤¹¡£ +.PP +.\"O .BR pututline () +.\"O writes the +.\"O .I utmp +.\"O structure \fIut\fP into the utmp file. +.\"O It uses +.\"O .BR getutid () +.\"O to search for the proper place in the file to insert +.\"O the new entry. +.\"O If it cannot find an appropriate slot for \fIut\fP, +.\"O .BR pututline () +.\"O will append the new entry to the end of the file. +.BR pututline () +¤Ï +.I utmp +¹½Â¤ÂÎ \fIut\fP ¤ÎÆâÍƤò utmp ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹¡£ +.BR pututline () +¤Ï +.BR getutid () +¤òÍѤ¤¤Æ¡¢¿·¤¿¤Ê¥¨¥ó¥È¥ê¤ò +ÁÞÆþ¤¹¤ë¤Î¤Ë¤Õ¤µ¤ï¤·¤¤¾ì½ê¤òõ¤¹¡£ \fIut\fP ¤òÁÞÆþ¤¹¤ë¤Õ¤µ¤ï¤·¤¤¾ì½ê¤¬ +¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢¿·¤¿¤Ê¥¨¥ó¥È¥ê¤ò¥Õ¥¡¥¤¥ë¤ÎËöÈø¤ËÄɲ乤롣 +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR getutent (), +.\"O .BR getutid (), +.\"O and +.\"O .BR getutline () +.\"O return a pointer to a \fIstruct utmp\fP on success, +.\"O and NULL on failure (which includes the "record not found" case). +.\"O This \fIstruct utmp\fP is allocated in static storage, and may be +.\"O overwritten by subsequent calls. +.BR getutent (), +.BR getutid (), +.BR getutline () +¤Ï¡¢À®¸ù¤¹¤ë¤È \fIstruct utmp\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È NULL ¤òÊÖ¤¹ (¥ì¥³¡¼¥É¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤â¼ºÇԤȤʤë)¡£ +¤³¤Î \fIstruct utmp\fP ¤ÏÀÅŪ¤Êµ­²±Îΰè¤Ë³ÎÊݤµ¤ì¡¢¼¡¤Ë¤³¤ì¤é¤Î´Ø¿ô¤ò +¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + +.\"O On success +.\"O .BR pututline () +.\"O returns +.\"O .IR ut ; +.\"O on failure, it returns NULL. +.BR pututline () +¤ÏÀ®¸ù¤¹¤ë¤È +.I ut +¤òÊÖ¤¹¡£¼ºÇÔ¤¹¤ë¤È NULL ¤òÊÖ¤¹¡£ + +.\"O .BR utmpname () +.\"O returns 0 if the new name was successfully stored, or \-1 on failure. +.BR utmpname () +¤Ï¡¢¿·¤·¤¤Ì¾Á°¤Î³ÊǼ¤ËÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤¹¤ë¤È \-1 ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +.\"O Out of memory. +¥á¥â¥êÉÔ­¡£ +.TP +.B ESRCH +.\"O Record not found. +¥ì¥³¡¼¥É¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.PP +.\"O .BR setutent (), +.\"O .BR pututent (), +.\"O and the +.\"O .B getut* () +.\"O functions can also fail for the reasons described in +.\"O .BR open (2). +´Ø¿ô +.BR setutent (), +.BR pututent (), +.BR getut* () +¤Ï +.BR open (2) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ëÍýͳ¤Ç¤â¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.\"O /var/run/utmp database of currently logged-in users +.\"O .br +.\"O /var/log/wtmp database of past user logins +/var/run/utmp ¸½ºß¥í¥°¥¤¥óÃæ¤Î¥æ¡¼¥¶¡¼¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.br +/var/log/wtmp ²áµî¤Î¥æ¡¼¥¶¡¼¥í¥°¥¤¥ó¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.\"O .SH "CONFORMING TO" +.SH ½àµò +XPG2, SVr4. +.LP +.\"O In XPG2 and SVID 2 the function +.\"O .BR pututline () +.\"O is documented +.\"O to return void, and that is what it does on many systems +.\"O (AIX, HP-UX, Linux libc5). +XPG2 ¤È SVID 2 ¤Ç¤Ï¡¢ +.BR pututline () +´Ø¿ô¤ÏÃͤòÊÖ¤µ¤Ê¤¤¤È¤µ¤ì¤Æ¤ª¤ê¡¢ +(AIX, HP-UX, Linux libc5 ¤Ê¤É¤Î) ¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¤½¤¦¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O HP-UX introduces a new function +.\"O .BR _pututline () +.\"O with the prototype given above for +.\"O .BR pututline () +.\"O (also found in Linux libc5). +HP-UX ¤Ç¤Ï¡¢¾å½Ò¤Î +.BR pututline () +¤ÈƱ¤¸¥×¥í¥È¥¿¥¤¥×¤ò»ý¤Ä +¿·¤·¤¤´Ø¿ô +.BR _pututline () +¤¬Æ³Æþ¤µ¤ì¤Æ¤¤¤ë +(¤³¤Î´Ø¿ô¤Ï Linux libc5 ¤Ë¤â¤¢¤ë)¡£ +.LP +.\"O All these functions are obsolete now on non-Linux systems. +¸½ºß¤Ç¤Ï¡¢Linux °Ê³°¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤ÏÁ´¤ÆÇѻߤµ¤ì¤Æ¤¤¤ë¡£ +.\"O POSIX.1-2001, following SUSv1, +.\"O does not have any of these functions, but instead uses +SUSv1 ¤Î¸å¤Ë½Ð¤Æ¤­¤¿ POSIX.1-2001 ¤Ç¤Ï¡¢¤â¤Ï¤ä¤³¤ì¤é¤Î´Ø¿ô¤Ï¤Ê¤¯¡¢ +Âå¤ï¤ê¤Ë°Ê²¼¤Î¤â¤Î¤ò»È¤¦¡£ +.sp +.B #include +.sp +.B struct utmpx *getutxent(void); +.br +.B struct utmpx *getutxid(const struct utmpx *); +.br +.B struct utmpx *getutxline(const struct utmpx *); +.br +.B struct utmpx *pututxline(const struct utmpx *); +.br +.B void setutxent(void); +.br +.B void endutxent(void); +.PP +.\"O These functions are provided by glibc, +.\"O and perform the same task as their equivalents without the "x", but use +.\"O .IR "struct utmpx" , +.\"O defined on Linux to be the same as +.\"O .IR "struct utmp" . +.\"O For completeness, glibc also provides +.\"O .BR utmpxname (), +.\"O although this function is not specified by POSIX.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¤Ë¤è¤êÄ󶡤µ¤ì¤Æ¤ª¤ê¡¢ +"x" ¤¬¤Ê¤¤´Ø¿ô¤ÈƱ¤¸½èÍý¤ò¹Ô¤¦¤¬¡¢ +.I "struct utmpx" +¤ò»ÈÍѤ¹¤ë¡£ +Linux ¤Ç¤Ï¡¢¤³¤Î¹½Â¤ÂΤÎÄêµÁ¤Ï +.I "struct utmp" +¤ÈƱ¤¸¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +´°Á´¤ò´ü¤¹¤¿¤á¤Ë¡¢glibc ¤Ç¤Ï +.BR utmpxname () +¤âÄ󶡤·¤Æ¤¤¤ë¡£¤³¤Î´Ø¿ô¤Ï POSIX.1 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O On some other systems, +.\"O the \fIutmpx\fP structure is a superset of the \fIutmp\fP structure, +.\"O with additional fields, and larger versions of the existing fields, +.\"O and parallel files are maintained, often +.\"O .I /var/*/utmpx +.\"O and +.\"O .IR /var/*/wtmpx . +Linux °Ê³°¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +\fIutmpx\fP ¹½Â¤ÂÎ¤Ï \fIutmp\fP ¹½Â¤ÂΤξå°Ì½¸¹ç (superset) ¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¡¢ +ÄɲäΥե£¡¼¥ë¥É¤¬¤¢¤Ã¤¿¤ê¡¢´û¸¤Î¥Õ¥£¡¼¥ë¥É¤Î¥µ¥¤¥º¤¬Â礭¤¯¤Ê¤Ã¤Æ¤¤¤¿¤ê +¤¹¤ë¤â¤Î¤â¤¢¤ë¡£Ê£¿ô¤Î¥Õ¥¡¥¤¥ë¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¾ì¹ç¤â¤¢¤ê¡¢Â¿¤¯¤Î¾ì¹ç +.I /var/*/utmpx +¤È +.I /var/*/wtmpx +¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬»È¤ï¤ì¤ë¡£ +.LP +.\"O Linux glibc on the other hand does not use a parallel \fIutmpx\fP file +.\"O since its \fIutmp\fP structure is already large enough. +.\"O The functions \fBgetutxent\fP() +.\"O etc. are aliases for \fBgetutent\fP() etc. +°ìÊý¡¢ Linux glibc ¤Ç¤ÏÊ£¿ô¤Î \fIutmpx\fP ¥Õ¥¡¥¤¥ë ¤Ï»È¤ï¤ì¤Æ¤¤¤Ê¤¤¡£ +\fIutmp\fP ¹½Â¤ÂΤ¬½½Ê¬¤ËÂ礭¤¤¤«¤é¤Ç¤¢¤ë¡£ +\fIgetutxent\fP() ¤Ê¤É¤Î´Ø¿ô¤Ï \fIgetutent\fP() ¤Ê¤É¤ÎÊÌ̾¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O .SS Glibc Notes +.SS glibc ¤Ç¤ÎÃí°Õ +.\"O The above functions are not thread-safe. +.\"O Glibc adds reentrant versions +¾åµ­¤Î´Ø¿ô·²¤Ï¥¹¥ì¥Ã¥É¡¦¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¡£ +glibc ¤Ë¤Ï¥ê¥¨¥ó¥È¥é¥ó¥ÈÈÇ (reentrant) ¤¬Äɲ䵤ì¤Æ¤¤¤ë¡£ +.sp +.nf +.BR "#define _GNU_SOURCE" " /* or _SVID_SOURCE or _BSD_SOURCE */" +.B #include +.sp +.BI "int getutent_r(struct utmp *" ubuf ", struct utmp **" ubufp ); +.sp +.BI "int getutid_r(struct utmp *" ut , +.BI " struct utmp *" ubuf ", struct utmp **" ubufp ); +.sp +.BI "int getutline_r(struct utmp *" ut , +.BI " struct utmp *" ubuf ", struct utmp **" ubufp ); +.fi +.sp +.\"O These functions are GNU extensions, analogs of the functions of the +.\"O same name without the _r suffix. +.\"O The +.\"O .I ubuf +.\"O argument gives these functions a place to store their result. +.\"O On success they return 0, and a pointer to the result is written in +.\"O .IR *ubufp . +.\"O On error these functions return \-1. +.\"O There are no utmpx equivalents of the above functions. +.\"O (POSIX.1 does not specify such functions.) +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢ËöÈø¤Î _r ¤ò¤È¤Ã¤¿Ì¾Á°¤Î´Ø¿ô¤È +ƱÍͤε¡Ç½¤ò»ý¤Ä¡£ +.I ubuf +¥Ñ¥é¥á¡¼¥¿¤Ï·ë²Ì¤ò³ÊǼ¤¹¤ë¾ì½ê¤ò»ØÄꤹ¤ë¡£ +À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢·ë²Ì¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò +.I *ubufp +¤Ë½ñ¤­¹þ¤à¡£¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£ +¾åµ­¤Î´Ø¿ô¤ËÂбþ¤¹¤ë utmpx ÈǤϸºß¤·¤Ê¤¤ +(POSIX.1 ¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤òµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤)¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The following example adds and removes a utmp record, assuming it is run +.\"O from within a pseudo terminal. +.\"O For usage in a real application, you +.\"O should check the return values of +.\"O .BR getpwuid (3) +.\"O and +.\"O .BR ttyname (3). +°Ê²¼¤ÎÎã¤Ç¤Ï¡¢ utmp ¤Î¥ì¥³¡¼¥É¤ÎÄɲᦺï½ü¤ò¹Ô¤Ã¤Æ¤¤¤ë¡£¤³¤Î¥³¡¼¥É¤Ï¡¢ +µ¼»÷üËö (pseudo terminal) ¤«¤é¼Â¹Ô¤µ¤ì¤ë¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤ë¡£ +¼ÂºÝ¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï +.BR getpwuid (3) +¤È +.BR ttyname (3) +¤ÎÌá¤êÃͤò¸¡ºº¤¹¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.nf +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct utmp entry; + + system("echo before adding entry:;who"); + + entry.ut_type = USER_PROCESS; + entry.ut_pid = getpid(); + strcpy(entry.ut_line, ttyname(STDIN_FILENO) + strlen("/dev/")); + /* only correct for ptys named /dev/tty[pqr][0\-9a\-z] */ + strcpy(entry.ut_id, ttyname(STDIN_FILENO) + strlen("/dev/tty")); + time(&entry.ut_time); + strcpy(entry.ut_user, getpwuid(getuid())\->pw_name); + memset(entry.ut_host, 0, UT_HOSTSIZE); + entry.ut_addr = 0; + setutent(); + pututline(&entry); + + system("echo after adding entry:;who"); + + entry.ut_type = DEAD_PROCESS; + memset(entry.ut_line, 0, UT_LINESIZE); + entry.ut_time = 0; + memset(entry.ut_user, 0, UT_NAMESIZE); + setutent(); + pututline(&entry); + + system("echo after removing entry:;who"); + + endutent(); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getutmp (3), +.BR utmp (5), +.BR feature_test_macros (7) diff --git a/draft/man3/getw.3 b/draft/man3/getw.3 new file mode 100644 index 00000000..47468a6a --- /dev/null +++ b/draft/man3/getw.3 @@ -0,0 +1,102 @@ +.\" Copyright (c) 1995 by Jim Van Zandt +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Wed Dec 24 12:33:19 JST 1997 +.\" by HIROFUMI Nishizuka +.\" Updated Sun Jun 18 16:38:02 JST 2000 +.\" by Kentaro Shirakata +.\" +.\" 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. +.TH GETW 3 2007-12-20 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getw, putw \- input and output of words (ints) +getw, putw \- ¥ï¡¼¥É(int)¤ÎÆþ½ÐÎÏ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getw(FILE *" stream ); + +.BI "int putw(int " w ", FILE *" stream ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR getw () +.\"O reads a word (that is, an \fIint\fP) from \fIstream\fP. +.\"O It's provided for compatibility with SVr4. +.\"O We recommend you use +.\"O .BR fread (3) +.\"O instead. +.BR getw () +¤Ï \fIstream\fP ¤«¤é¥ï¡¼¥É (\fIint\fP·¿) ¤òÆɤ߹þ¤à¡£ +¤³¤Î´Ø¿ô¤Ï¡¢SVr4 ¤È¤Î¸ß´¹À­¤Î¤¿¤á¤ËÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î´Ø¿ô¤ÎÂå¤ï¤ê¤Ë +.BR fread (3) +¤ò»ÈÍѤ¹¤ë¤³¤È¤ò´«¤á¤ë¡£ +.P +.\"O .BR putw () +.\"O writes the word \fIw\fP (that is, +.\"O an \fIint\fP) to \fIstream\fP. +.\"O It is provided for compatibility with SVr4, but we recommend you use +.\"O .BR fwrite (3) +.\"O instead. +.BR putw () +¤Ï \fIstream\fP ¤Ë¥ï¡¼¥É \fIw\fP (\fIint\fP·¿) ¤ò½ñ¤­¹þ¤à¡£ +¤³¤Î´Ø¿ô¤Ï SVr4 ¤È¤Î¸ß´¹À­¤Î¤¿¤á¤ËÄ󶡤µ¤ì¤Æ¤¤¤ë¤¬¡¢¤³¤Î´Ø¿ô¤ÎÂå¤ï¤ê¤Ë +.BR fwrite (3) +¤ò»ÈÍѤ¹¤ë¤³¤È¤ò´«¤á¤ë¡£ +.\"O .SH "RETURN VALUES" +.SH ÊÖ¤êÃÍ +.\"O Normally, +.\"O .BR getw () +.\"O returns the word read, and +.\"O .BR putw () +.\"O returns 0. +Ä̾ +.BR getw () +¤ÏÆɤ߹þ¤ó¤À¥ï¡¼¥É¤òÊÖ¤·¡¢ +.BR putw () +¤Ï 0 ¤òÊÖ¤¹¡£ +.\"O On error, they return \fBEOF\fP. +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï \fBEOF\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O SVr4, SUSv2. Not present in POSIX.1-2001. +SVr4, SUSv2. POSIX.1-2001 ¤Ë¤Ï¸ºß¤·¤Ê¤¤¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The value returned on error is also a legitimate data value. +¥¨¥é¡¼¤Î»þ¤ËÊÖ¤µ¤ì¤ëÃͤϡ¢Àµ¤·¤¤¥Ç¡¼¥¿¤È¤·¤ÆÊÖ¤µ¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +.\"O .BR ferror (3) +.\"O can be used to distinguish between the two cases. +.BR ferror (3) +¤òÍѤ¤¤ë¤È¡¢¤³¤ÎÆó¤Ä¤Î¾ì¹ç¤ò¶èÊ̤¹¤ë¤³¤È¤¬½ÐÍè¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ferror (3), +.BR fread (3), +.BR fwrite (3), +.BR getc (3), +.BR putc (3) diff --git a/draft/man3/getwchar.3 b/draft/man3/getwchar.3 new file mode 100644 index 00000000..4a313aa5 --- /dev/null +++ b/draft/man3/getwchar.3 @@ -0,0 +1,102 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:29 JST 2000 +.\" by HANATAKA Shinya +.\" Updated Sat Nov 3 JST 2001 by Kentaro Shirakata +.\" +.TH GETWCHAR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O getwchar \- read a wide character from standard input +getwchar \- ɸ½àÆþÎϤè¤ê¥ï¥¤¥Éʸ»ú¤òÆɤ߹þ¤à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B "wint_t getwchar(void);" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR getwchar () +.\"O function is the wide-character equivalent of the +.\"O .BR getchar (3) +.\"O function. +.\"O It reads a wide character from \fIstdin\fP and returns +.\"O it. +.\"O If the end of stream is reached, or if \fIferror(stdin)\fP becomes +.\"O true, it returns +.\"O .BR WEOF . +.\"O If a wide character conversion error occurs, it sets +.\"O \fIerrno\fP to \fBEILSEQ\fP and returns +.\"O .BR WEOF . +.BR getwchar () +´Ø¿ô¤Ï +.BR getchar (3) +´Ø¿ô¤Î¥ï¥¤¥Éʸ»úÈǤǤ¢¤ë¡£ +\fBstdin\fP ¤«¤é¥ï¥¤¥Éʸ»ú¤òÆɤ߹þ¤ó¤Ç¤½¤ì¤òÊÖ¤¹¡£ +¥¹¥È¥ê¡¼¥à¤ÎºÇ¸å¤Ë㤷¤Æ¤¤¤ë¾ì¹ç¤ä \fIferror(stdin)\fP ¤¬¿¿¤Î¾ì¹ç¤Ë¤Ï +.B WEOF +¤òÊÖ¤¹¡£¥ï¥¤¥Éʸ»úÊÑ´¹¤Ç¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ë¤Ï \fIerrno\fP ¤Ë +\fBEILSEQ\fP ¤òÀßÄꤷ¤Æ +.B WEOF +¤òÊÖ¤¹¡£ +.PP +.\"O For nonlocking counterparts, see +.\"O .BR unlocked_stdio (3). +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR getwchar () +.\"O function returns the next wide-character from +.\"O standard input, or +.\"O .BR WEOF . +.BR getwchar () +´Ø¿ô¤Ïɸ½àÆþÎϤμ¡¤Î¥ï¥¤¥Éʸ»ú¤òÊÖ¤¹¤«¡¢ +.B WEOF +¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR getwchar () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR getwchar () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +.\"O It is reasonable to expect that +.\"O .BR getwchar () +.\"O will actually read a multibyte +.\"O sequence from standard input and then convert it to a wide character. +.BR getwchar () +¤¬¼ÂºÝ¤Ë¤Ïɸ½àÆþÎϤ«¤é¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤òÆɤ߹þ¤ó¤Ç +¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤¹¤ë¤³¤È¤ò´üÂÔ¤·¤Æ¤âÎɤ¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fgetwc (3), +.BR unlocked_stdio (3) diff --git a/draft/man3/glob.3 b/draft/man3/glob.3 new file mode 100644 index 00000000..c2bfb79e --- /dev/null +++ b/draft/man3/glob.3 @@ -0,0 +1,528 @@ +.\" 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 Wed Jul 28 11:12:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon May 13 23:08:50 1996 by Martin Schulze (joey@linux.de) +.\" Modified 11 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) +.\" Modified 990912 by aeb +.\" 2007-10-10 mtk +.\" Added description of GLOB_TILDE_NOMATCH +.\" Expanded the description of various flags +.\" Various wording fixes. +.\" +.\" Japanese Version Copyright (c) 1998 Ken Wakasa all rights reserved. +.\" Translated 1998-06-24, Ken Wakasa +.\" Updated 1999-01-04, Kentaro Shirakata +.\" Updated 2008-02-12, Akihiro MOTOKI , LDP v2.77 +.\" +.TH GLOB 3 2007-10-10 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O glob, globfree \- find pathnames matching a pattern, free memory from glob() +glob, globfree \- ¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹Ì¾¤ò¸«ÉÕ¤±¤ë¡£glob() ¤Ë¤è¤Ã +¤Æ³ÎÊݤµ¤ì¤¿¥á¥â¥êÎΰè¤ò²òÊü¤¹¤ë¡£ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int glob(const char *" pattern ", int " flags , +.br +.BI " int (*" errfunc ") (const char *" epath ", int " eerrno ), +.br +.BI " glob_t *" pglob ); +.br +.BI "void globfree(glob_t *" pglob ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR glob () +.\"O function searches for all the pathnames matching +.\"O .I pattern +.\"O according to the rules used by the shell (see +.\"O .BR glob (7)). +.BR glob () +´Ø¿ô¤Ï¥·¥§¥ë¤¬ÍѤ¤¤Æ¤¤¤ë¥ë¡¼¥ë +.RB ( glob (7) +»²¾È) ¤Ë´ð¤Å¤¤¤Æ¥Ñ¥¿¡¼¥ó +.I pattern +¤Ë¥Þ¥Ã¥Á¤¹¤ë¤¹¤Ù¤Æ¤Î¥Ñ¥¹Ì¾¤ò¸¡º÷¤¹¤ë¡£ +.\"O No tilde expansion or parameter substitution is done; if you want +.\"O these, use +.\"O .BR wordexp (3). +¥Á¥ë¥À (~) ¤ÎŸ³«¤ä¥Ñ¥é¥á¡¼¥¿ÃÖ´¹¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£¤½¤ì¤é¤ò¹Ô¤¤¤¿¤¤¾ì¹ç¤Ï +.BR wordexp (3) +¤ò»È¤¦¤È¤è¤¤¡£ +.PP +.\"O The +.\"O .BR globfree () +.\"O function frees the dynamically allocated storage from an earlier call +.\"O to +.\"O .BR glob (). +.BR globfree () +´Ø¿ô¤ÏÁ°¤Ë¸Æ¤Ð¤ì¤¿ +.BR glob () +¤Ë¤è¤êưŪ¤Ë³ÎÊݤµ¤ì¤¿µ­²±Îΰè¤ò²òÊü¤¹¤ë¡£ +.PP +.\"O The results of a +.\"O .BR glob () +.\"O call are stored in the structure pointed to by +.\"O .IR pglob . +.\"O This structure is of type +.\"O .I glob_t +.\"O (declared in +.\"O .IR ) +.\"O and includes the following elements defined by POSIX.2 (more may be +.\"O present as an extension): +.BR glob () +¤Î·ë²Ì¤Ï +.I pglob +¤¬¥Ý¥¤¥ó¥È¤¹¤ë¹½Â¤ÂΤËÊÖ¤µ¤ì¤ë¡£ +.I pglob +¤Ï +.I glob_t +·¿¤Î¹½Â¤ÂΤǤ¢¤ë¡£ +.I glob_t +·¿¤Ï +.I +Æâ¤ÇÀë¸À¤µ¤ì¤Æ¤ª¤ê¡¢°Ê²¼¤ÎÍ×ÁǤò´Þ¤ó¤Ç¤¤¤ë¡£¤³¤ì¤é¤ÎÍ×ÁÇ¤Ï POSIX.2 ¤ÇÄêµÁ +¤µ¤ì¤Æ¤¤¤ë (¤µ¤é¤Ë¿¤¯¤ÎÍ×ÁǤ¬³ÈÄ¥¤È¤·¤ÆÆþ¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤)¡£ +.PP +.br +.in +4n +.nf +typedef struct { +.\"O size_t gl_pathc; /* Count of paths matched so far */ +.\"O char **gl_pathv; /* List of matched pathnames. */ +.\"O size_t gl_offs; /* Slots to reserve in \fIgl_pathv\fP. */ + size_t gl_pathc; /* º£¤Þ¤Ç¤Ë¥Þ¥Ã¥Á¤·¤¿¥Ñ¥¹¤Î¿ô */ + char **gl_pathv; /* ¥Þ¥Ã¥Á¤·¤¿¥Ñ¥¹Ì¾¤Î¥ê¥¹¥È */ + size_t gl_offs; /* \fIgl_pathv\fP Æâ¤Ë³ÎÊݤ¹¤ë¥¹¥í¥Ã¥È¿ô */ +} glob_t; +.fi +.in +.PP +.\"O Results are stored in dynamically allocated storage. +·ë²Ì¤ÏưŪ¤Ë³ÎÊݤµ¤ì¤¿µ­²±Îΰè¤ËÆþ¤ì¤é¤ì¤ë¡£ +.PP +.\"O The argument +.\"O .I flags +.\"O is made up of the bitwise OR of zero or more the following symbolic +.\"O constants, which modify the behavior of +.\"O .BR glob (): +¥Ñ¥é¥á¡¼¥¿ +.I flags +¤Ë¤Ï°Ê²¼¤Î¼¨¤¹Äê¿ô¤Î¤¦¤Á¡¢»ØÄꤷ¤¿¤¤¤â¤Î¤ò¥Ó¥Ã¥È¤´¤È¤Î OR ¤ÇÍ¿¤¨¤ë +(°ì¤Ä¤â +»ØÄꤷ¤Ê¤¯¤Æ¤â¤è¤¤)¡£¤³¤ì¤Ë¤è¤Ã¤Æ +.BR glob () +¤ÎÆ°ºî¤òÊѹ¹¤Ç¤­¤ë¡£ +.TP +.B GLOB_ERR +.\"O Return upon a read error (because a directory does not +.\"O have read permission, for example). +.\"O By default, +.\"O .BR glob () +.\"O attempts carry on despite errors, +.\"O reading all of the directories that it can. +(Î㤨¤Ð¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ËÆɤ߼è¤êµö²Ä°À­¤¬Ìµ¤¤¾ì¹ç¤Ê¤É¤Ç) +Æɤ߼è¤ê¥¨¥é¡¼¤¬È¯À¸¤·¤¿ºÝ¤Ë´Ø¿ô¤«¤éÌá¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥¨¥é¡¼¤Ë´Ø¤ï¤é¤º +Æɤ߼è¤ê²Äǽ¤Ê¥Ç¥£¥ì¥¯¥È¥ê¤òÁ´¤Æ¤Ë¤Ä¤¤¤ÆÆɤ߼è¤ê¤ò¼Â¹Ô¤·¤è¤¦¤È¤¹¤ë¡£ +.TP +.B GLOB_MARK +.\"O Append a slash to each path which corresponds to a directory. +¥Ç¥£¥ì¥¯¥È¥ê¤ËÂбþ¤¹¤ë³Æ¡¹¤Î¥Ñ¥¹¤Ë¥¹¥é¥Ã¥·¥å¤òÉղ乤롣 +.TP +.B GLOB_NOSORT +.\"O Don't sort the returned pathnames. +.\"O The only reason to do this is to save processing time. +.\"O By default, the returned pathnames are sorted. +ÊÖ¤µ¤ì¤ë¥Ñ¥¹Ì¾¤Î¥½¡¼¥È¤ò¹Ô¤ï¤Ê¤¤¡£ +¥½¡¼¥È¤ò¹Ô¤ï¤Ê¤¤Íýͳ¤Ï¡¢½èÍý»þ´Ö¤òÀáÌ󤹤뤿¤á¤À¤±¤Ç¤¢¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ÊÖ¤µ¤ì¤ë¥Ñ¥¹Ì¾¤Ï¥½¡¼¥È¤µ¤ì¤ë¡£ +.TP +.B GLOB_DOOFFS +.\"O Reserve +.\"O .I pglob\->gl_offs +.\"O slots at the beginning of the list of strings in +.\"O .IR pglob\->pathv . +.\"O The reserved slots contain NULL pointers. +.I pglob->pathv +¤Îʸ»úÎó¥ê¥¹¥È¤ÎÀèƬ¤Ë +.I pglob->gl_offs +¥¹¥í¥Ã¥Èʬ¤ÎÎΰè¤òͽÌ󤹤롣 +ͽÌ󤵤줿¥¹¥í¥Ã¥È¤Ë¤Ï NULL ¥Ý¥¤¥ó¥¿¤¬Æþ¤ë¡£ +.TP +.B GLOB_NOCHECK +.\"O If no pattern matches, return the original pattern. +.\"O By default, +.\"O .BR glob () +.\"O returns +.\"O .B GLOB_NOMATCH +.\"O if there are no matches. +¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¿¡¼¥ó¤¬¤Ê¤±¤ì¤Ð¡¢¸µ¤Î¥Ñ¥¿¡¼¥ó¤òÊÖ¤¹¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR glob () +¤Ï¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¿¡¼¥ó¤¬¤Ê¤±¤ì¤Ð +.B GLOB_NOMATCH +¤òÊÖ¤¹¡£ +.TP +.B GLOB_APPEND +.\"O Append the results of this call to the vector of results +.\"O returned by a previous call to +.\"O .BR glob (). +.\"O Do not set this flag on the first invocation of +.\"O .BR glob (). +¤³¤Î¸Æ¤Ó½Ð¤·¤Ç¤Î·ë²Ì¤òľÁ°¤Î +.BR glob () +¤Î¸Æ¤Ó½Ð¤·¤ÇÊÖ¤µ¤ì¤¿·ë²Ì¤Î¥Ù¥¯¥È¥ë¤ËÄɲ乤롣ºÇ½é¤Î +.BR glob () +¤Î¸Æ¤Ó½Ð¤·¤ÎºÝ¤Ë¤Ï¤³¤Î¥Õ¥é¥°¤òÀßÄꤷ¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.TP +.B GLOB_NOESCAPE +.\"O Don't allow backslash (\(aq\\\(aq) to be used as an escape +.\"O character. +.\"O Normally, a backslash can be used to quote the following character, +.\"O providing a mechanism to turn off the special meaning +.\"O metacharacters. +¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å (\(aq\\\(aq) ¤ò¥¨¥¹¥±¡¼¥×ÍÑʸ»ú¤È¤·¤Æ»ÈÍѤǤ­¤Ê¤¤¡£ +Ä̾ï¤Ï¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤ò»È¤Ã¤Æ¡¢¼¡¤Ë³¤¯Ê¸»ú¤ò¥¯¥©¡¼¥È¤¹¤ë¤³¤È¤Ç¡¢ +ÆÃÊ̤ʰÕÌ£¤ò»ý¤Ä¥á¥¿¥­¥ã¥é¥¯¥¿¤ò̵¸ú¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O .I flags +.\"O may also include any of the following, which are GNU +.\"O extensions and not defined by POSIX.2: +.I flags +¤Ë¤Ï°Ê²¼¤Ë¼¨¤¹¤â¤Î¤â»ØÄê¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Ï GNU ¤Ç³ÈÄ¥¤µ¤ì¤¿¤â¤Î¤Ç¡¢POSIX.2 ¤Ç¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B GLOB_PERIOD +.\"O Allow a leading period to be matched by metacharacters. +.\"O By default, metacharacters can't match a leading period. +ÀèƬ¤Î¥Ô¥ê¥ª¥É¤¬¥á¥¿¥­¥ã¥é¥¯¥¿¤Ë¥Þ¥Ã¥Á¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥á¥¿¥­¥ã¥é¥¯¥¿¤ÏÀèƬ¤Î¥Ô¥ê¥ª¥É¤Ë¤Ï¥Þ¥Ã¥Á¤Ç¤­¤Ê¤¤¡£ +.TP +.B GLOB_ALTDIRFUNC +.\"O Use alternative functions +.\"O .IR pglob\->gl_closedir , +.\"O .IR pglob\->gl_readdir , +.\"O .IR pglob\->gl_opendir , +.\"O .IR pglob\->gl_lstat ", and" +.\"O .I pglob\->gl_stat +.\"O for file system access instead of the normal library +.\"O functions. +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¢¥¯¥»¥¹¤¹¤ëºÝ¤Ë¡¢Ä̾ï¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ÎÂå¤ï¤ê¤Ë +ÂåÂشؿô +.IR pglob\->gl_closedir , +.IR pglob\->gl_readdir , +.IR pglob\->gl_opendir , +.IR pglob\->gl_lstat , +.I pglob\->gl_stat +¤¬ÍѤ¤¤é¤ì¤ë¡£ +.TP +.B GLOB_BRACE +.\"O Expand +.\"O .BR csh (1) +.\"O style brace expressions of the form \fB{a,b}\fR. +.\"O Brace expressions can be nested. +.\"O Thus, for example, specifying the pattern +.\"O "{foo/{,cat,dog},bar}" would return the same results as four separate +.\"O .BR glob () +.\"O calls using the strings: +.\"O "foo/", +.\"O "foo/cat", +.\"O "foo/dog", +.\"O and +.\"O "bar". +\fB{a,b}\fR +¤È¤¤¤¦·Á¼°¤Î +.BR csh (1) +¥¹¥¿¥¤¥ë¤Î³ç¸Ìɽ¸½¤òŸ³«¤¹¤ë¡£ +³ç¸Ìɽ¸½¤ÏÆþ¤ì»Ò¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢Î㤨¤Ð¡¢"{foo/{,cat,dog},bar}" ¤È¤¤¤¦¥Ñ¥¿¡¼¥ó¤ò +»ØÄꤷ¤¿¾ì¹ç¤ËÆÀ¤é¤ì¤ë·ë²Ì¤Ï¡¢ +4¤Ä¤Îʸ»úÎó "foo/", "foo/cat", "foo/dog", "bar" ¤Î¤½¤ì¤¾¤ì¤Ë¤Ä¤¤¤Æ +.BR glob () +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ +.TP +.B GLOB_NOMAGIC +.\"O If the pattern contains no metacharacters +.\"O then it should be returned as the sole matching word, +.\"O even if there is no file with that name. +¥Ñ¥¿¡¼¥ó¤Ë¥á¥¿¥­¥ã¥é¥¯¥¿¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¥Þ¥Ã¥Á·ë²Ì¤È¤·¤Æ»ØÄꤵ¤ì¤¿¥Ñ¥¿¡¼¥ó¤À¤±¤òÊÖ¤¹¡£ +¥Ñ¥¿¡¼¥ó¤Ç»ØÄꤵ¤ì¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢ +¤½¤Î¥Ñ¥¿¡¼¥ó¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.B GLOB_TILDE +.\"O Carry out tilde expansion. +.\"O If a tilde (\(aq~\(aq) is the only character in the pattern, +.\"O or an initial tilde is followed immediately by a slash (\(aq/\(aq), +.\"O then the home directory of the caller is substituted for +.\"O the tilde. +.\"O If an initial tilde is followed by a username (e.g., "~andrea/bin"), +.\"O then the tilde and username are substituted by the home directory +.\"O of that user. +.\"O If the username is invalid, or the home directory cannot be +.\"O determined, then no substitution is performed. +¥Á¥ë¥À¤ÎŸ³«¤ò¹Ô¤¦¡£ +¥Á¥ë¥À (\(aq~\(aq) ¤¬¥Ñ¥¿¡¼¥óÆâ¤ÎÍ£°ì¤Îʸ»ú¤Î¾ì¹ç¤«¡¢ÀèƬ¤Î¥Á¥ë¥À¤Îľ¸å¤Îʸ»ú¤¬ +¥¹¥é¥Ã¥·¥å (\(aq/\(aq) ¤Î¾ì¹ç¡¢¥Á¥ë¥À¤ò¸Æ¤Ó½Ð¤·¼Ô¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ÇÃÖ´¹¤¹¤ë¡£ +ÀèƬ¤Î¥Á¥ë¥À¤Ë¥æ¡¼¥¶Ì¾¤¬Â³¤¯¾ì¹ç (Î㤨¤Ð "~andrea/bin")¡¢ +¥Á¥ë¥À¤È¥æ¡¼¥¶Ì¾¤ò¤½¤Î¥æ¡¼¥¶¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ÇÃÖ´¹¤¹¤ë¡£ +¥æ¡¼¥¶Ì¾¤¬Ìµ¸ú¤Ê¾ì¹ç¤ä¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤¬·èÄê¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¡¢ +ÃÖ´¹¤Ï¼Â¹Ô¤µ¤ì¤Ê¤¤¡£ +.TP +.B GLOB_TILDE_CHECK +.\"O This provides behavior similar to that of +.\"O .BR GLOB_TILDE . +.\"O The difference is that if the username is invalid, or the +.\"O home directory cannot be determined, then +.\"O instead of using the pattern itself as the name, +.\"O .BR glob () +.\"O returns +.\"O .BR GLOB_NOMATCH +.\"O to indicate an error. +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È +.B GLOB_TILDE +¤ÈƱÍͤο¶Éñ¤¤¤ò¤¹¤ë¡£ +.B GLOB_TILDE +¤È¤Î°ã¤¤¤Ï¡¢¥æ¡¼¥¶Ì¾¤¬Ìµ¸ú¤À¤Ã¤¿¾ì¹ç¤ä +¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤¬·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¡¢ +¥Ñ¥¿¡¼¥ó¼«¿È¤ò»ÈÍѤ¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +.BR glob () +¤¬¥¨¥é¡¼¤ò¼¨¤¹ +.B GLOB_NOMATCH +¤òÊÖ¤¹¤³¤È¤Ç¤¢¤ë¡£ +.TP +.B GLOB_ONLYDIR +.\"O This is a +.\"O .I hint +.\"O to +.\"O .BR glob () +.\"O that the caller is interested only in directories that match the pattern. +.\"O If the implementation can easily determine file-type information, +.\"O then nondirectory files are not returned to the caller. +.\"O However, the caller must still check that returned files +.\"O are directories. +.\"O (The purpose of this flag is merely to optimize performance when +.\"O the caller is interested only in directories.) +¤³¤Î¥Õ¥é¥°¤Ï¡¢ +.BR glob () +¤ËÂФ¹¤ë¡Ö¥Ò¥ó¥È¡×¤Ç¤¢¤ê¡¢ +¸Æ¤Ó½Ð¤·Â¦¤¬¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤·¤«¶½Ì£¤¬¤Ê¤¤¤³¤È¤òÃΤ餻¤ë¡£ +¼ÂÁõ¤Ë¤ª¤¤¤Æ¥Õ¥¡¥¤¥ë¤Î¼ïÊ̾ðÊó¤ò´Êñ¤Ë·èÄê¤Ç¤­¤ë¾ì¹ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤ +¥Õ¥¡¥¤¥ë¤Ï¸Æ¤Ó½Ð¤·Â¦¤ËÊÖ¤µ¤ì¤Ê¤¤¡£¤·¤«¤·¤Ê¤¬¤é¡¢¸Æ¤Ó½Ð¤·Â¦¤Ç¤Ï¡¢ÊÖ¤µ¤ì¤¿ +¥Õ¥¡¥¤¥ë¥ê¥¹¥È¤¬¥Ç¥£¥ì¥¯¥È¥ê¤«¤É¤¦¤«¤ò³Îǧ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +(¤³¤Î¥Õ¥é¥°¤¬Â¸ºß¤¹¤ë¤Î¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤·¤«¶½Ì£¤¬¤Ê¤¤ºÝ¤Ë +À­Ç½¤òºÇŬ²½¤¹¤ëÌÜŪ¤Î¤¿¤á¤À¤±¤Ç¤¢¤ë¡£) +.PP +.\"O If +.\"O .I errfunc +.\"O is not NULL, +.\"O it will be called in case of an error with the arguments +.\"O .IR epath , +.\"O a pointer to the path which failed, and +.\"O .IR eerrno , +.\"O the value of +.\"O .I errno +.\"O as returned from one of the calls to +.\"O .BR opendir (3), +.\"O .BR readdir (3), +.\"O or +.\"O .BR stat (2). +.I errfunc +¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ë¤Ï´Ø¿ô +.I errfunc +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£´Ø¿ô¤Î°ú¿ô¤Ë¤Ï¡¢¼ºÇÔ¤·¤¿¥Ñ¥¹Ì¾ +.I epath +¤È +.I errno +.RB ( opendir (3), +.BR readdir (3), +.BR stat (2). +¤Î¤¤¤º¤ì¤«¤Ë¤è¤Ã¤Æ¥»¥Ã¥È¤µ¤ì¤¿ÃÍ) ¤¬Í¿¤¨¤é¤ì¤ë¡£ +.\"O If +.\"O .I errfunc +.\"O returns nonzero, or if +.\"O .B GLOB_ERR +.\"O is set, +.\"O .BR glob () +.\"O will terminate after the call to +.\"O .IR errfunc . +.I errfunc +¤¬ 0 °Ê³°¤ÎÃͤòÊÖ¤¹¤«¤â¤·¤¯¤Ï +.B GLOB_ERR +¤¬¥»¥Ã¥È¤µ¤ì¤¿¾ì¹ç +.BR glob () +¤Ï +.I errfunc +¤Î¸Æ¤Ó½Ð¤·¸å¤Ë½ªÎ»¤¹¤ë¡£ +.PP +.\"O Upon successful return, +.\"O .I pglob\->gl_pathc +.\"O contains the number of matched pathnames and +.\"O .I pglob\->gl_pathv +.\"O contains a pointer to the list of pointers to matched pathnames. +.\"O The list of pointers is terminated by a NULL pointer. +¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤ÆÌá¤Ã¤¿¾ì¹ç +.I pglob\->gl_pathc +¤Ë¤Ï¥Þ¥Ã¥Á¤·¤¿¥Ñ¥¹Ì¾¤¬´Þ¤Þ¤ì¡¢ +.I pglob\->gl_pathv +¤Ï¥Þ¥Ã¥Á¤·¤¿¥Ñ¥¹Ì¾¤Ø¤Î¥Ý¥¤¥ó¥¿¤Î¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ë¡£ +¥Ý¥¤¥ó¥¿¤Î¥ê¥¹¥È¤Ï NULL ¥Ý¥¤¥ó¥¿¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.PP +.\"O It is possible to call +.\"O .BR glob () +.\"O several times. +.\"O In that case, the +.\"O .B GLOB_APPEND +.\"O flag has to be set in +.\"O .I flags +.\"O on the second and later invocations. +.BR glob () +¤ò²¿ÅÙ¤«Â³¤±¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£¤½¤ÎºÝ2²óÌܰʹߤθƤӽФ·¤Ç¤Ï +.B GLOB_APPEND +¥Õ¥é¥°¤¬ +.I flags +¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O As a GNU extension, +.\"O .I pglob\->gl_flags +.\"O is set to the flags specified, \fBor\fRed with +.\"O .B GLOB_MAGCHAR +.\"O if any metacharacters were found. +GNU ¤Î³ÈÄ¥¤È¤·¤Æ¡¢ +.I pglob\->gl_flags +¤Ë¤Ï»ØÄꤷ¤¿¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£¤â¤·°ì¤Ä¤Ç¤â¥á¥¿¥­¥ã¥é¥¯¥¿¤¬¸«ÉÕ¤«¤ì¤Ð +¤³¤Î¥Õ¥é¥°¤È +.B GLOB_MAGCHAR +¤È¤Î \fBOR\fR ¤ò¼è¤Ã¤¿·ë²Ì¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On successful completion, +.\"O .BR glob () +.\"O returns zero. +.\"O Other possible returns are: +¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤Æ´°Î»¤¹¤ë¤È +.BR glob () +¤Ï 0 ¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤ÎÊÖ¤êÃͤϰʲ¼¤ÎÄ̤ê: +.TP +.B GLOB_NOSPACE +.\"O for running out of memory, +¥á¥â¥ê¤ò»È¤¤²Ì¤¿¤·¤¿ +.TP +.B GLOB_ABORTED +.\"O for a read error, and +Æɤ߼è¤ê¥¨¥é¡¼ +.TP +.B GLOB_NOMATCH +.\"O for no found matches. +°ì¤Ä¤â¥Þ¥Ã¥Á¤·¤Ê¤«¤Ã¤¿ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.2, POSIX.1-2001. +.\"O .SH BUGS +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The structure elements +.\"O .I gl_pathc +.\"O and +.\"O .I gl_offs +.\"O are declared as +.\"O .I size_t +.\"O in glibc 2.1, as they should be according to POSIX.2, +.\"O but are declared as +.\"O .I int +.\"O in libc4, libc5 and glibc 2.0. +glibc 2.1 ¤Ç¤Ï¡¢ +.I gl_pathc +¤È +.I gl_offs +¤Ï POSIX.2 ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë +.I size_t +¤È¤·¤ÆÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£ +libc4, libc5, glibc 2.0 ¤Ç¤Ï¡¢ +.I int +¤È¤·¤ÆÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +.\"O .BR glob () +.\"O function may fail due to failure of underlying function calls, such as +.\"O .BR malloc (3) +.\"O or +.\"O .BR opendir (3). +.\"O These will store their error code in +.\"O .IR errno . +.BR glob () +´Ø¿ô¤Ï¤½¤ÎÃæ¤Ç¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë +.BR malloc (3) +¤ä +.BR opendir (3) +¤Ê¤É¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤Ç¼ºÇÔ¤¬µ¯¤³¤ë¤È¼ºÇÔ¤¹¤ë¡£ +¤³¤ì¤Ë¤è¤ê +.I errno +¤Ë¤½¤Î¥¨¥é¡¼¥³¡¼¥É¤¬Æþ¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O One example of use is the following code, which simulates typing +.\"O .sp +.\"O .in +4n +.\"O ls \-l *.c ../*.c +.\"O .in +.\"O .sp +.\"O in the shell: +»ÈÍÑË¡¤Î°ìÎã¤ò°Ê²¼¤Ë¼¨¤¹¡£°Ê²¼¤Ï¥·¥§¥ë¤Ç +.sp +.in +4n +ls \-l *.c ../*.c +.in +.sp +¤ò¥¿¥¤¥×¤·¤¿¾ì¹ç¤ò¥·¥ß¥å¥ì¡¼¥È¤·¤Æ¤¤¤ë¡£ +.nf +.in +4n + +glob_t globbuf; + +globbuf.gl_offs = 2; +glob("*.c", GLOB_DOOFFS, NULL, &globbuf); +glob("../*.c", GLOB_DOOFFS | GLOB_APPEND, NULL, &globbuf); +globbuf.gl_pathv[0] = "ls"; +globbuf.gl_pathv[1] = "\-l"; +execvp("ls", &globbuf.gl_pathv[0]); +.in +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ls (1), +.BR sh (1), +.BR stat (2), +.BR exec (3), +.BR fnmatch (3), +.BR malloc (3), +.BR opendir (3), +.BR readdir (3), +.BR wordexp (3), +.BR glob (7) diff --git a/draft/man3/gnu_get_libc_version.3 b/draft/man3/gnu_get_libc_version.3 new file mode 100644 index 00000000..58bbab19 --- /dev/null +++ b/draft/man3/gnu_get_libc_version.3 @@ -0,0 +1,100 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 +.\" +.TH GNU_GET_LIBC_VERSION 3 2008-07-02 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O gnu_get_libc_version, gnu_get_libc_release \- get glibc version and release +gnu_get_libc_version, gnu_get_libc_release \- glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤È +¥ê¥ê¡¼¥¹¾õÂÖ¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +.B const char *gnu_get_libc_version(void); +.B const char *gnu_get_libc_release(void); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The function +.\"O .BR gnu_get_libc_version () +.\"O returns a string that identifies the glibc version available on the system. +.BR gnu_get_libc_version () +´Ø¿ô¤Ï¡¢¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ê glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤òÆÃÄꤹ¤ëʸ»úÎó¤òÊÖ¤¹¡£ + +.\"O The function +.\"O .BR gnu_get_libc_release () +.\"O returns a string indicates the release status of the glibc version +.\"O available on the system. +.\"O This will be a string such as +.\"O .IR "stable" . +.BR gnu_get_libc_release () +´Ø¿ô¤Ï¡¢¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ê glibc ¥Ð¡¼¥¸¥ç¥ó¤Î¥ê¥ê¡¼¥¹¾õÂÖ¤ò¼¨¤¹ +ʸ»úÎó¤òÊÖ¤¹¡£ +.I "stable" +¤È¤¤¤Ã¤¿Ê¸»úÎó¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions first appeared in glibc in version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O These functions are glibc-specific. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O When run, the program below will produce output such as the following: +²¼µ­¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤È¡¢¼¡¤Î¤è¤¦¤Ê½ÐÎϤ¬ÆÀ¤é¤ì¤ë¡£ +.in +4n +.nf + +.RB "$" " ./a.out" +GNU libc version: 2.8 +GNU libc release: stable +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + printf("GNU libc version: %s\\n", gnu_get_libc_version()); + printf("GNU libc release: %s\\n", gnu_get_libc_release()); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR confstr (3) diff --git a/draft/man3/grantpt.3 b/draft/man3/grantpt.3 new file mode 100644 index 00000000..c41255f3 --- /dev/null +++ b/draft/man3/grantpt.3 @@ -0,0 +1,119 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This page is in the public domain. - aeb +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 01:56:27 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: pseudo-terminal µ¼»÷üËö +.\"WORD: pseudotty µ¼»÷üËö +.\" +.TH GRANTPT 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O grantpt \- grant access to the slave pseudo-terminal +.SH ̾Á° +grantpt \- ¥¹¥ì¡¼¥Öµ¼»÷üËö¤Ø¤Î¥¢¥¯¥»¥¹¤òµö²Ä¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "int grantpt(int " fd ");" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR grantpt () +.\"O function changes the mode and owner of the slave pseudo-terminal device +.\"O (pty) corresponding to the master pty referred to by +.\"O .IR fd . +.BR grantpt () +´Ø¿ô¤Ï¡¢ +.I fd +¤Ç»²¾È¤µ¤ì¤¿¥Þ¥¹¥¿µ¼»÷üËö¤ËÂбþ¤¹¤ë¥¹¥ì¡¼¥Öµ¼»÷üËö¥Ç¥Ð¥¤¥¹ (pty) +¤Î¥â¡¼¥É¤È½êÍ­¼Ô¤òÊѹ¹¤¹¤ë¡£ +.\"O The user ID of the slave is set to the real UID of the calling process. +.\"O The group ID is set to an unspecified value (e.g., \fItty\fP). +.\"O The mode of the slave is set to 0620 (crw\-\-w\-\-\-\-). +¥¹¥ì¡¼¥Ö¤Î¥æ¡¼¥¶ID ¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â UID ¤ËÀßÄꤵ¤ì¤ë¡£ +¥°¥ë¡¼¥×ID ¤È¤·¤ÆÀßÄꤵ¤ì¤ëÃͤϵ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤ (Î㤨¤Ð \fItty\fP ¤Ë¤Ê¤ë)¡£ +¥¹¥ì¡¼¥Ö¤Î¥â¡¼¥É¤Ï 0620 (crw\-\-w\-\-\-\-) ¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O The behavior of +.\"O .BR grantpt () +.\"O is unspecified if a signal handler is installed to catch +.\"O .B SIGCHLD +.\"O signals. +.B SIGCHLD +¥·¥°¥Ê¥ë¤òÊ᪤¹¤ë¤¿¤á¤Ë¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î +.BR grantpt () +¤ÎÆ°ºî¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O When successful, +.\"O .BR grantpt () +.\"O returns 0. +.\"O Otherwise, it returns \-1 and sets +.\"O .I errno +.\"O appropriately. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR grantpt () +¤Ï 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O The corresponding slave pty could not be accessed. +Âбþ¤¹¤ë¥¹¥ì¡¼¥Öµ¼»÷üËö¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EBADF +.\"O The +.\"O .I fd +.\"O argument is not a valid open file descriptor. +°ú¤­¿ô +.I fd +¤¬Í­¸ú¤Ê¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O The +.\"O .I fd +.\"O argument is valid but not associated with a master pty. +°ú¤­¿ô +.I fd +¤ÏÍ­¸ú¤À¤¬¡¢¥Þ¥¹¥¿µ¼»÷üËö¤ËÂбþ¤¹¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR grantpt () +.\"O is provided in glibc since version 2.1. +.BR grantpt () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH È÷¹Í +.\"O This is part of the Unix98 pty support, see +.\"O .BR pts (4). +.\"O Many systems implement this function via a set-user-ID helper binary +.\"O called "pt_chown". +.\"O With Linux devpts no such helper binary is required. +¤³¤ì¤Ï Unix98 pty »ÅÍͤΰìÉô¤Ç¤¢¤ë¡£ +.BR pts (4) +¤ò»²¾È¤Î¤³¤È¡£ +¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ï "pt_chown" ¤È¸Æ¤Ð¤ì¤ë set-user-ID ¤µ¤ì¤¿ +Êä½õ¥Ð¥¤¥Ê¥ê¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +Linux ¤Î devpts ¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤ÊÊä½õ¥Ð¥¤¥Ê¥ê¤òɬÍפȤ·¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR open (2), +.BR posix_openpt (3), +.BR ptsname (3), +.BR unlockpt (3), +.BR pts (4), +.BR feature_test_macros (7), +.BR pty (7) diff --git a/draft/man3/gsignal.3 b/draft/man3/gsignal.3 new file mode 100644 index 00000000..74fb2404 --- /dev/null +++ b/draft/man3/gsignal.3 @@ -0,0 +1,170 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.\" +.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI, all rights reserved. +.\" Translated Mon Feb 2 2003 by Akihiro MOTOKI +.\" +.\"WORD: broken Àµ¤·¤¯¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤ +.\" +.TH GSIGNAL 3 2007-07-26 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O gsignal, ssignal \- software signal facility +.SH ̾Á° +gsignal, ssignal \- ¥½¥Õ¥È¥¦¥§¥¢¡¦¥·¥°¥Ê¥ëµ¡Ç½ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "int gsignal(int " signum ); +.sp +.BI "sighandler_t ssignal(int " signum ", sighandler_t " action ); +.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 gsignal (), +.BR ssignal (): +_SVID_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Don't use these functions under Linux. +Linux ¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤ò»ÈÍѤ·¤Ê¤¤¤³¤È¡£ +.\"O Due to a historical mistake, under Linux these functions are +.\"O aliases for +.\"O .BR raise (3) +.\"O and +.\"O .BR signal (2), +.\"O respectively. +²áµî¤Ë´Ö°ã¤¤¤¬¤¢¤ê¡¢Linux ¤Ç¤Ï +.BR gsignal () +¤È +.BR ssignal () +¤Ï¤½¤ì¤¾¤ì +.BR raise (3) +¤È +.BR signal (2) +¤ÎÊÌ̾¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.LP +.\"O Elsewhere, on System V-like systems, these functions implement +.\"O software signaling, entirely independent of the classical +.\"O .BR signal (2) +.\"O and +.\"O .BR kill (2) +.\"O functions. +.\"O The function +.\"O .BR ssignal () +.\"O defines the action to take when the software signal with +.\"O number +.\"O .I signum +.\"O is raised using the function +.\"O .BR gsignal (), +.\"O and returns the previous such action or +.\"O .BR SIG_DFL . +°ìÊý¡¢System V É÷¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ç¡¢ +½¾Íè¤Î +.BR signal (2) +¤ä +.BR kill (2) +¤Î´Ø¿ô·²¤È¤Ï´°Á´¤ËÆÈΩ¤Ê¡¢ +¥½¥Õ¥È¥¦¥§¥¢¡¦¥·¥°¥Ê¥ê¥ó¥°¤ò¼Â¸½¤·¤Æ¤¤¤ë¡£ +.BR ssignal () +´Ø¿ô¤Ï¡¢ÈÖ¹æ +.I signum +¤Î¥½¥Õ¥È¥¦¥§¥¢¡¦¥·¥°¥Ê¥ë¤¬ +.BR gsignal () +´Ø¿ô¤ò»È¤Ã¤ÆȯÀ¸¤µ¤ì¤¿»þ¤Ë¤È¤ë¤Ù¤­¥¢¥¯¥·¥ç¥ó¤òÄêµÁ¤¹¤ë¡£ +.BR gsignal () +¤ÎÊÖ¤êÃͤϡ¢°ì¤ÄÁ°¤Ë»ØÄꤵ¤ì¤Æ¤¤¤¿¥¢¥¯¥·¥ç¥ó¡¢¤â¤·¤¯¤Ï +.B SIG_DFL +¤Ç¤¢¤ë¡£ +.\"O The function +.\"O .BR gsignal () +.\"O does the following: if no action (or the action +.\"O .BR SIG_DFL ) +.\"O was +.\"O specified for +.\"O .IR signum , +.\"O then it does nothing and returns 0. +.\"O If the action +.\"O .B SIG_IGN +.\"O was specified for +.\"O .IR signum , +.\"O then it does nothing and returns 1. +.\"O Otherwise, it resets the action to +.\"O .B SIG_DFL +.\"O and calls +.\"O the action function with argument +.\"O .IR signum , +.\"O and returns the value returned by that function. +.\"O The range of possible values +.\"O .I signum +.\"O varies (often 1-15 or 1-17). +.BR gsignal () +¤Ï°Ê²¼¤Î¤è¤¦¤ÊÆ°ºî¤ò¹Ô¤¦: +.I signum +¤ËÂФ·¤Æ¥¢¥¯¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢¥¢¥¯¥·¥ç¥ó +.B SIG_DFL +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢²¿¤â¤»¤º¤Ë 0 ¤òÊÖ¤¹¡£ +.I signum +¤ËÂФ·¤Æ ¥¢¥¯¥·¥ç¥ó +.B SIG_IGN +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢²¿¤â¤»¤º¤Ë 1 ¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥¢¥¯¥·¥ç¥ó¤ò +.B SIG_DFL +¤Ë¥ê¥»¥Ã¥È¤·¡¢°ú¤­¿ô¤Ë +.I signum +¤ò»ØÄꤷ¤Æ¥¢¥¯¥·¥ç¥ó´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢¥¢¥¯¥·¥ç¥ó´Ø¿ô¤ÎÊÖ¤êÃͤòÊÖ¤¹¡£ +.I signum +¤¬¤È¤êÆÀ¤ëÃͤÎÈϰϤϼÂÁõ¤Ë¤è¤ê°Û¤Ê¤ë (¿¤¯¤Î¾ì¹ç 1¡Á15 ¤« 1¡Á17 ¤Ç¤¢¤ë)¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris, Tru64. +.\"O They are called obsolete under most of these systems, and are +.\"O broken under Linux libc and glibc. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢AIX, DG/UX, HP-UX, SCO, Solaris, Tru64 ¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¤Î¤Û¤È¤ó¤É¤ÇÇѻߤµ¤ì¤¿¤³¤È¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +Linux ¤Î libc ¤ª¤è¤Ó glibc ¤Ç¤ÏÀµ¤·¤¯¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O Some systems also have +.\"O .BR gsignal_r () +.\"O and +.\"O .BR ssignal_r (). +.BR gsignal_r () +¤È +.BR ssignal_r () +¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR signal (2), +.BR raise (3) diff --git a/draft/man3/hash.3 b/draft/man3/hash.3 new file mode 100644 index 00000000..ef2e5d33 --- /dev/null +++ b/draft/man3/hash.3 @@ -0,0 +1,243 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)hash.3 8.6 (Berkeley) 8/18/94 +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito +.\" all rights reserved. +.\" Translated Mon Jul 26 14:22:49 JST 1999 +.\" by Shouichi Saito +.\" Proofed Tue Aug 17 1999 by NAKANO Takeo +.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 +.\" +.\"WORD: access method ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.\"WORD: bucket ¥Ð¥±¥Ã¥È +.\" +.TH HASH 3 1994-08-18 "" "Linux Programmer's Manual" +.UC 7 +.SH ̾Á° +.\"O hash \- hash database access method +hash \- hash ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.SH ½ñ¼° +.nf +.ft B +#include +#include +.ft R +.fi +.SH ÀâÌÀ +.\"O The routine +.\"O .BR dbopen (3) +.\"O is the library interface to database files. +.\"O One of the supported file formats is hash files. +¥ë¡¼¥Á¥ó +.BR dbopen (3) +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¤Ò¤È¤Ä¤Ë hash ¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¡£ +.\"O The general description of the database access methods is in +.\"O .BR dbopen (3), +.\"O this manual page describes only the hash specific information. +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ë´Ø¤¹¤ë°ìÈÌŪ¤Êµ­½Ò¤Ï +.BR dbopen (3) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï hash ÆÃÍ­¤Î¾ðÊó¤Ë¤Ä¤¤¤Æ¤Î¤ßµ­½Ò¤¹¤ë¡£ +.PP +.\"O The hash data structure is an extensible, dynamic hashing scheme. +hash ¥Ç¡¼¥¿¹½Â¤¤Ï¡¢³ÈÄ¥²Äǽ¤ÊưŪ¥Ï¥Ã¥·¥å¥¹¥­¡¼¥à¤Ç¤¢¤ë¡£ +.PP +.\"O The access method specific data structure provided to +.\"O .BR dbopen (3) +.\"O is defined in the +.\"O .I +.\"O include file as follows: +.BR dbopen (3) +¤ËÅϤµ¤ì¤ë hash ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤ËÆÃÍ­¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢ +.I +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.in +4n +.nf + +typedef struct { + unsigned int bsize; + unsigned int ffactor; + unsigned int nelem; + unsigned int cachesize; + uint32_t (*hash)(const void *, size_t); + int lorder; +} HASHINFO; +.fi +.in +.PP +.\"O The elements of this structure are as follows: +¤³¤Î¹½Â¤ÂΤÎÍ×ÁǤò°Ê²¼¤Ë¼¨¤¹¡£ +.TP 10 +.I bsize +.\"O defines the hash table bucket size, and is, by default, 256 bytes. +.\"O It may be preferable to increase the page size for disk-resident tables +.\"O and tables with large data items. +hash ¥Æ¡¼¥Ö¥ë¥Ð¥±¥Ã¥È (table bucket) ¤Î¥µ¥¤¥º¤òÄêµÁ¤¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 256 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +¥Ç¥£¥¹¥¯¤ËÃÖ¤«¤ì¤ë¥Æ¡¼¥Ö¥ë¤ä¥Ç¡¼¥¿¥¢¥¤¥Æ¥à¤¬Â礭¤¤¥Æ¡¼¥Ö¥ë¤Ç¤Ï +¥Ú¡¼¥¸¥µ¥¤¥º¤òÂ礭¤¯¤¹¤ë¤Û¤¦¤¬Îɤ¤¤À¤í¤¦¡£ +.TP +.I ffactor +.\"O indicates a desired density within the hash table. +.\"O It is an approximation of the number of keys allowed to accumulate in any +.\"O one bucket, determining when the hash table grows or shrinks. +.\"O The default value is 8. +¥æ¡¼¥¶¤¬Ë¾¤à hash ¥Æ¡¼¥Ö¥ëÃæ¤ÎÌ©Å٤Ǥ¢¤ë¡£ +¤³¤ì¤Ï¤½¤ì¤¾¤ì¤Î¥Ð¥±¥Ã¥È¤Ë³ÊǼ¤Ç¤­¤ë¥­¡¼¤Î³µ¿ô¤Ç¤¢¤ê¡¢ +hash ¥Æ¡¼¥Ö¥ë¤ò³ÈÂ硦½Ì¾®¤òºîÍѤ¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 8 ¤Ç¤¢¤ë¡£ +.TP +.I nelem +.\"O is an estimate of the final size of the hash table. +.\"O If not set or set too low, hash tables will expand gracefully as keys +.\"O are entered, although a slight performance degradation may be noticed. +.\"O The default value is 1. +hash ¥Æ¡¼¥Ö¥ë¤ÎºÇ½ª¥µ¥¤¥º¤òÂç¤Þ¤«¤Ë¸«ÀѤâ¤Ã¤¿ÃͤǤ¢¤ë¡£ +¤³¤ÎÃͤ¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤ê¡¢¤¢¤Þ¤ê¤ËÄ㤯¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +hash ¥Æ¡¼¥Ö¥ë¤Ï¥­¡¼¤¬Æþ¤Ã¤Æ¤¯¤ë¤Ë±þ¤¸¤Æ³ÈÄ¥¤µ¤ì¤ë¡£ +¤·¤«¤·¾¯¤·¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤¬ (¤ª¤½¤é¤¯µ¤ÉÕ¤¯ÄøÅÙ¤Ë) Íî¤Á¤ë¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 1 ¤Ç¤¢¤ë¡£ +.TP +.I cachesize +.\"O is the suggested maximum size, in bytes, of the memory cache. +.\"O This value is +.\"O .IR "only advisory" , +.\"O and the access method will allocate more memory rather than fail. +¥á¥â¥ê¥­¥ã¥Ã¥·¥å¤ÎºÇÂçÃÍ (¥Ð¥¤¥Èñ°Ì) ¤Î»²¹ÍÃÍ¡£ +¤³¤ÎÃÍ¤Ï +.BR ¤¢¤¯¤Þ¤Ç»²¹Í¤Ç¤¢¤ê ¡¢ +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ï¤³¤ÎÃͤò±Û¤¨¤¿¥á¥â¥ê¤Î³ä¤êÅö¤Æ¤ËÀ®¸ù¤¹¤ë¤³¤È¤â¤¢¤ë¡£ +.TP +.I hash +.\"O is a user-defined hash function. +.\"O Since no hash function performs equally well on all possible data, the +.\"O user may find that the built-in hash function does poorly on a particular +.\"O data set. +¤Ï¥æ¡¼¥¶¡¼ÄêµÁ¤Î hash ´Ø¿ô¤Ç¤¢¤ë¡£ +Á´¤Æ¤Î¥Ç¡¼¥¿¤ËÂФ·¤Æ¤¦¤Þ¤¯ºîÍѤ¹¤ë hash ´Ø¿ô¤È¸À¤¦¤Î¤Ï¤Ê¤¤¤«¤é¡¢ +ÆÃÄê¤Î¥Ç¡¼¥¿¥»¥Ã¥È¤ËÂФ·¤Æ¤ÏÁȤ߹þ¤ß¤Î hash ´Ø¿ô¤Ç¤Ï +¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤¬Ä㤤¤³¤È¤â¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O A user-specified hash functions must take two arguments (a pointer to a byte +.\"O string and a length) and return a 32-bit quantity to be used as the hash +.\"O value. +¥æ¡¼¥¶¡¼ÄêµÁ¤Î hash ´Ø¿ô¤ÏÆó¤Ä¤Î°ú¿ô¤ò¤È¤é¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤ (¥Ð¥¤¥Èʸ»ú +Îó¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¡¢Ä¹¤µ)¡£ +¤½¤·¤Æ hash ÃͤȤ·¤Æ»È¤ï¤ì¤ë 32¥Ó¥Ã¥È¤ÎÃͤòÊÖ¤µ¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.I lorder +.\"O is the byte order for integers in the stored database metadata. +.\"O The number should represent the order as an integer; for example, +.\"O big endian order would be the number 4,321. +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥á¥¿¥Ç¡¼¥¿¤ÎÀ°¿ôÃͤΥХ¤¥È¥ª¡¼¥À¡¼¡£ +¤³¤Î¿ô»ú¤Ï¡¢½ç½ø¤òÀ°¿ô¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +Î㤨¤Ð¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤Ê¤é¡¢¤³¤Î¿ôÃÍ¤Ï 4,321 ¤È¤Ê¤ë¡£ +.\"O If +.I lorder +.\"O is 0 (no order is specified) the current host order is used. +.\"O If the file already exists, the specified value is ignored and the +.\"O value specified when the tree was created is used. +¤¬ 0 (»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤)¾ì¹ç¡¢¸½ºß¤Î¥Û¥¹¥È +¤Ç»È¤ï¤ì¤Æ¤¤¤ëʤӽ礬»È¤ï¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢»ØÄꤷ¤¿ÃͤÏ̵»ë¤µ¤ì¥Ä¥ê¡¼¤¬ºî¤é¤ì +¤¿»þ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤¿Ãͤ¬»È¤ï¤ì¤ë¡£ +.PP +.\"O If the file already exists (and the +.\"O .B O_TRUNC +.\"O flag is not specified), the +.\"O values specified for +.\"O .IR bsize , +.\"O .IR ffactor , +.\"O .IR lorder , +.\"O and +.\"O .I nelem +.\"O are +.\"O ignored and the values specified when the tree was created are used. +.\"NAKANO the tree ¢ª the hash, ¤Ç¤·¤ç¤¦. +¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤ë (¤Þ¤¿¤Ï +.B O_TRUNC +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤È¡¢ +.IR bsize , +.IR ffactor , +.IR lorder , +.I nelem +¤Ë»ØÄꤵ¤ì¤¿ÃͤÏ̵»ë¤µ¤ì¡¢ +¥Ï¥Ã¥·¥å¤¬ºî¤é¤ì¤¿»þ¤Ë»È¤Ã¤¿Ãͤ¬»È¤ï¤ì¤ë¡£ +.PP +.\"O If a hash function is specified, +hash ´Ø¿ô¤¬»ØÄꤵ¤ì¤ë¤È¡¢ +.I hash_open +.\"O will attempt to determine if the hash function specified is the same as +.\"O the one with which the database was created, and will fail if it is not. +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ºî¤é¤ì¤¿»þ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤¿ +hash ´Ø¿ô¤Èº£²ó»ØÄꤵ¤ì¤¿ hash ´Ø¿ô¤¬Æ±¤¸¤«¤É¤¦¤«¤òÄ´¤Ù¡¢ +Ʊ¤¸¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¼ºÇÔ¤¹¤ë¡£ +.PP +.\"O Backward compatible interfaces to the routines described in +.BR dbm (3), +¤È +.\"O and +.BR ndbm (3) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥ë¡¼¥Á¥ó¤Ø¤Î²áµî¸ß´¹¤ò¼è¤ë¤¿¤á¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤¬ +¸ºß¤¹¤ë¡£¤·¤«¤·¤³¤ì¤é¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï°ÊÁ°¤Î¥Õ¥¡¥¤¥ë¥Õ¥©¡¼ +¥Þ¥Ã¥È¤È¤Ï¸ß´¹À­¤¬¤Ê¤¤¡£ +.\"O are provided, however these interfaces are not compatible with +.\"O previous file formats. +.SH ¥¨¥é¡¼ +.\"O The +.\"O .I hash +.\"O access method routines may fail and set +.\"O .I errno +.\"O for any of the errors specified for the library routine +.\"O .BR dbopen (3). +.I hash +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¥ë¡¼¥Á¥ó¤Ï¡¢¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR dbopen (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥Ð¥° +.\"O Only big and little endian byte order are supported. +¥Ð¥¤¥È¥ª¡¼¥À¡¼¤È¤·¤Æ¤Ï¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤È¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó¤Î¤ß¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR btree (3), +.BR dbopen (3), +.BR mpool (3), +.BR recno (3) +.sp +.IR "Dynamic Hash Tables" , +Per-Ake Larson, Communications of the ACM, April 1988. +.sp +.IR "A New Hash Package for UNIX" , +Margo Seltzer, USENIX Proceedings, Winter 1991. diff --git a/draft/man3/hsearch.3 b/draft/man3/hsearch.3 new file mode 100644 index 00000000..097d4d66 --- /dev/null +++ b/draft/man3/hsearch.3 @@ -0,0 +1,552 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" Copyright 1993 Ulrich Drepper (drepper@karlsruhe.gmd.de) +.\" and Copyright 2008, Linux Foundation, written by 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. +.\" +.\" References consulted: +.\" SunOS 4.1.1 man pages +.\" Modified Sat Sep 30 21:52:01 1995 by Jim Van Zandt +.\" Remarks from dhw@gamgee.acad.emich.edu Fri Jun 19 06:46:31 1998 +.\" Modified 2001-12-26, 2003-11-28, 2004-05-20, aeb +.\" 2008-09-02, mtk: various additions and rewrites +.\" 2008-09-03, mtk, restructured somewhat, in part after suggestions from +.\" Timothy S. Nelson +.\" +.\" Japanese Version Copyright (c) 1998 George Momma, +.\" Copyright (c) 2001-2005 Yuichi SATO, +.\" and Copyright (c) 2008 Akihiro MOTOKI +.\" Translated 1998-05-23, George Momma +.\" Updated & Modified 2001-10-15, Yuichi SATO +.\" Updated & Modified 2002-01-03, Yuichi SATO +.\" Updated & Modified 2004-01-17, Yuichi SATO +.\" Updated & Modified 2005-01-10, Yuichi SATO +.\" Updated 2008-09-20, Akihiro MOTOKI +.\" +.\"WORD: hash table ¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë +.\"WORD: entry ¥¨¥ó¥È¥ê¡¼ +.\"WORD: allocate ³ä¤êÅö¤Æ +.\"WORD: NUL-terminated ¥Ì¥ëʸ»ú \0 ¤Ç½ªÃ¼¤µ¤ì¤¿ +.\"WORD: pointer ¥Ý¥¤¥ó¥¿ +.\"WORD: character ʸ»ú·¿ +.\"WORD: item ¹àÌÜ +.\" +.TH HSEARCH 3 2008-10-06 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O hcreate, hdestroy, hsearch, hcreate_r, hdestroy_r, +.\"O hsearch_r \- hash table management +hcreate, hdestroy, hsearch, hcreate_r, hdestroy_r, +hsearch_r \- ¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Î´ÉÍý +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int hcreate(size_t " nel ); +.sp +.BI "ENTRY *hsearch(ENTRY " item ", ACTION " action ); +.sp +.B "void hdestroy(void);" +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int hcreate_r(size_t " nel ", struct hsearch_data *" htab ); +.sp +.BI "int hsearch_r(ENTRY " item ", ACTION " action ", ENTRY **" retval , +.BI " struct hsearch_data *" htab ); +.sp +.BI "void hdestroy_r(struct hsearch_data *" htab ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The three functions +.\"O .BR hcreate (), +.\"O .BR hsearch (), +.\"O and +.\"O .BR hdestroy () +.\"O allow the caller to create and manage a hash search table +.\"O containing entries consisting of a key (a string) and associated data. +.\"O Using these functions, only one hash table can be used at a time. +.BR hcreate (), +.BR hsearch (), +.BR hdestroy () +¤Î 3 ¤Ä¤Î´Ø¿ô¤òÍøÍѤ¹¤ë¤È¡¢¥­¡¼ (ʸ»úÎó) ¤ÈÂбþ¤¹¤ë¥Ç¡¼¥¿¤«¤é¹½À®¤µ¤ì¤ë +¥¨¥ó¥È¥ê¤ò³ÊǼ¤Ç¤­¤ë¥Ï¥Ã¥·¥å¸¡º÷¥Æ¡¼¥Ö¥ë¤òºîÀ®¡¢´ÉÍý¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤ò»È¤Ã¤Æ¡¢°ìÅ٤˻ÈÍѤǤ­¤ë¤Î¤Ï°ì¤Ä¤Î¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤À¤±¤Ç¤¢¤ë¡£ + +.\"O The three functions +.\"O .BR hcreate_r (), +.\"O .BR hsearch_r (), +.\"O .BR hdestroy_r () +.\"O are reentrant versions that allow a program to use +.\"O more than one hash search table at the same time. +.\"O The last argument, +.\"O .IR htab , +.\"O points to a structure that describes the table +.\"O on which the function is to operate. +.\"O The programmer should treat this structure as opaque +.\"O (i.e., do not attempt to directly access or modify +.\"O the fields in this structure). +.BR hcreate_r (), +.BR hsearch_r (), +.BR hdestroy_r () +¤Î 3 ¤Ä¤Î´Ø¿ô¤Ï¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǡ¢¤³¤ì¤é¤òÍøÍѤ¹¤ë¤È¡¢ +°ì¤Ä¤Î¥×¥í¥°¥é¥à¤ÇƱ»þ¤ËÊ£¿ô¤Î¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +ºÇ¸å¤Î°ú¤­¿ô +.I htab +¤Ï´Ø¿ô¤ÎÁàºîÂоݤȤʤë¥Æ¡¼¥Ö¥ë¤ò¼¨¤¹¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +¥×¥í¥°¥é¥Þ¤Ï¤³¤Î¹½Â¤ÂΤò¥Ö¥é¥Ã¥¯¥Ü¥Ã¥¯¥¹¤È¤·¤Æ°·¤¦¤Ù¤­¤Ç¤¢¤ë +(¤Ä¤Þ¤ê¡¢¤³¤Î¹½Â¤ÂΤΥե£¡¼¥ë¥É¤ËľÀÜ¥¢¥¯¥»¥¹¤·¤¿¤êÊѹ¹¤·¤¿¤ê +¤·¤Ê¤¤¤³¤È)¡£ + +.\"O First a hash table must be created using +.\"O .BR hcreate (). +.\"O The argument \fInel\fP specifies the maximum number of entries +.\"O in the table. +.\"O (This maximum cannot be changed later, so choose it wisely.) +.\"O The implementation may adjust this value upward to improve the +.\"O performance of the resulting hash table. +ºÇ½é¤Ë¡¢ +.BR hcreate () +´Ø¿ô¤Ë¤è¤Ã¤Æ¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤òºîÀ®¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +°ú¤­¿ô \fInel\fP ¤Ç¥Æ¡¼¥Ö¥ë¤ÎºÇÂ票¥ó¥È¥ê¿ô¤ò»ØÄꤹ¤ë +(¤³¤ÎºÇÂçÃͤϸå¤ÇÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¤Î¤Ç¡¢¤è¤¯¹Í¤¨¤ÆÁªÂò¤¹¤ë¤³¤È)¡£ +ºîÀ®¤µ¤ì¤ë¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ÎÀ­Ç½¤ò¸þ¾å¤µ¤»¤ë¤¿¤á¤Ë¡¢ +´Ø¿ôÆâÉô¤Î¼ÂÁõ¤Ë¤è¤ê¤³¤ÎÃͤÏÁý¤ä¤µ¤ì¤ë¾ì¹ç¤â¤¢¤ë¡£ +.\" e.g., in glibc it is raised to the next higher prime number + +.\"O The +.\"O .BR hcreate_r () +.\"O function performs the same task as +.\"O .BR hcreate (), +.\"O but for the table described by the structure +.\"O .IR *htab . +.\"O The structure pointed to by +.\"O .I htab +.\"O must be zeroed before the first call to +.\"O .BR hcreate_r (). +.BR hcreate_r () +´Ø¿ô¤Ï +.BR hcreate () +¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¤¬¡¢¹½Â¤ÂÎ +.I *htab +¤Ç¼¨¤µ¤ì¤ë¥Æ¡¼¥Ö¥ë¤òÂоݤȤ·¤ÆÆ°ºî¤¹¤ë¡£ +.I htab +¤¬»Ø¤·¼¨¤¹¹½Â¤ÂΤϡ¢ +.BR hcreate_r () +¤ò½é¤á¤Æ¸Æ¤Ó½Ð¤¹Á°¤Ë 0 ¤ÇËä¤á¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O The function +.\"O .BR hdestroy () +.\"O frees the memory occupied by the hash table that was created by +.\"O .BR hcreate (). +.\"O After calling +.\"O .BR hdestroy () +.\"O a new hash table can be created using +.\"O .BR hcreate (). +.\"O The +.\"O .BR hdestroy_r () +.\"O function performs the analogous task for a hash table described by +.\"O .IR *htab , +.\"O which was previously created using +.\"O .BR hcreate_r (). +.BR hdestroy () +´Ø¿ô¤Ï¡¢ +.BR hcreate () +¤ÇºîÀ®¤µ¤ì¤¿¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤¬ÀêÍ­¤·¤Æ¤¤¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£ +¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Ë¤è¤Ã¤ÆÀêÍ­¤µ¤ì¤Æ¤¤¤¿¥á¥â¥ê¤ò²òÊü¤·¡¢ +¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤òºîÀ®¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +.BR hdestroy () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¤½¤Î¸å¤Ï +.BR hcreate () +¤ò»È¤Ã¤Æ¿·¤·¤¤¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR hdestroy_r () +´Ø¿ô¤Ï¡¢Æ±ÍͤνèÍý¤ò¡¢¤½¤ì°ÊÁ°¤Ë +.BR hcreate_r () +¤ò»È¤Ã¤ÆºîÀ®¤·¤¿ +.I *htab +¤Ç¼¨¤µ¤ì¤ë¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¼Â¹Ô¤¹¤ë¡£ + +.\"O The +.\"O .BR hsearch () +.\"O function searches the hash table for an +.\"O item with the same key as \fIitem\fP (where "the same" is determined using +.\"O .BR strcmp (3)), +.\"O and if successful returns a pointer to it. +.BR hsearch () +´Ø¿ô¤Ï¡¢\fIitem\fP ¤ÈƱ¤¸¥­¡¼¤ò»ý¤Ä¹àÌܤò¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤«¤é +¸¡º÷¤·¡¢¹àÌܤ¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¤½¤Î¹àÌܤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹ +(¡ÖƱ¤¸¡×¤«¤É¤¦¤«¤Ï +.BR strcmp (3) +¤ò»È¤Ã¤ÆȽÄꤹ¤ë)¡£ + +.\"O The argument \fIitem\fP is of type \fIENTRY\fP, which is defined in +.\"O \fI\fP as follows: +°ú¤­¿ô \fIitem\fP ¤Ï \fBENTRY\fP ·¿¤Ç¤¢¤ê¡¢\fI\fP ¤ÎÃæ¤Ç +°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.in +4n +.sp +.nf +typedef struct entry { + char *key; + void *data; +} ENTRY; +.in +.fi +.sp +.\"O The field \fIkey\fP points to a null-terminated string which is the +.\"O search key. +.\"O The field \fIdata\fP points to data that is associated with that key. +¥Õ¥£¡¼¥ë¥É \fIkey\fP ¤Ï¸¡º÷¥­¡¼¤È¤Ê¤ë NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤ò»Ø¤¹¡£ +¥Õ¥£¡¼¥ë¥É \fIdata\fP ¤Ï¡¢¤³¤Î¥­¡¼¤ËÂбþ¤¹¤ë¥Ç¡¼¥¿¤ò»Ø¤¹¡£ + +.\"O The argument \fIaction\fP determines what +.\"O .BR hsearch () +.\"O does after an unsuccessful search. +¸¡º÷¤¬¼ºÇÔ¤·¤¿¸å¤ÎÆ°ºî¤Ï¡¢°ú¤­¿ô \fIaction\fP ¤Ë¤è¤ê·è¤Þ¤ë¡£ +.\"O This argument must either have the value +.\"O .BR ENTER , +.\"O meaning insert a copy of +.\"O .IR item +.\"O (and return a pointer to the new hash table entry as the function result), +.\"O or the value +.\"O .BR FIND , +.\"O meaning that NULL should be returned. +.\"O (If +.\"O .I action +.\"O is +.\"O .BR FIND , +.\"O then +.\"O .I data +.\"O is ignored.) +¤³¤Î°ú¤­¿ô¤Ë¤Ï +.B ENTER +¤« +.B FIND +¤Î¤¤¤º¤ì¤«¤ÎÃͤò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B ENTER +¤Ï +.I item +¤Î¥³¥Ô¡¼¤òÁÞÆþ¤¹¤ë¤³¤È¤ò +(´Ø¿ô¤Î·ë²Ì¤È¤·¤Æ¿·¤·¤¤¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹)¡¢ +.B FIND +¤Ï NULL ¤òÊÖ¤¹¤³¤È¤ò°ÕÌ£¤¹¤ë +.RI ( action +¤¬ +.B FIND +¤Î¾ì¹ç¡¢ +.I data +¤Ï̵»ë¤µ¤ì¤ë)¡£ + +.\"O The +.\"O .BR hsearch_r () +.\"O function is like +.\"O .BR hsearch () +.\"O but operates on the hash table described by +.\"O .IR *htab . +.\"O The +.\"O .BR hsearch_r () +.\"O function differs from +.\"O .BR hsearch () +.\"O in that a pointer to the found item is returned in +.\"O .IR *retval , +.\"O rather than as the function result. +.BR hsearch_r () +´Ø¿ô¤Ï +.BR hsearch () +¤ÈƱÍͤÀ¤¬¡¢ +.I *htab +¤Ç¼¨¤µ¤ì¤ë¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ½èÍý¤ò¹Ô¤¦¡£ +.BR hsearch_r () +´Ø¿ô¤¬ +.BR hsearch () +¤È°Û¤Ê¤ë¤Î¤Ï¡¢¸«¤Ä¤«¤Ã¤¿¹àÌܤؤΥݥ¤¥ó¥¿¤ò¡¢ +´Ø¿ô¤Î·ë²Ì¤È¤·¤Æ¤Ç¤Ï¤Ê¤¯¡¢ +.I *retval +¤Ë³ÊǼ¤·¤ÆÊÖ¤¹ÅÀ¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR hcreate () +.\"O and +.\"O .BR hcreate_r () +.\"O return nonzero on success. +.\"O They return 0 on error. +.BR hcreate () +¤È +.BR hcreate_r () +¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç 0 °Ê³°¤ÎÃͤòÊÖ¤·¡¢ +¥¨¥é¡¼¤Î¾ì¹ç 0 ¤òÊÖ¤¹¡£ + +.\"O On success, +.\"O .BR hsearch () +.\"O returns a pointer to an entry in the hash table. +.\"O .BR hsearch () +.\"O returns NULL on error, that is, +.\"O if \fIaction\fP is \fBENTER\fP and +.\"O the hash table is full, or \fIaction\fP is \fBFIND\fP and \fIitem\fP +.\"O cannot be found in the hash table. +À®¸ù¤¹¤ë¤È¡¢ +.BR hsearch () +¤Ï¡¢¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ëÆâ¤Î¥¨¥ó¥È¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR hsearch () +¤Ï NULL ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤È¤Ê¤ë¤Î¤Ï¡¢ +\fIaction\fP ¤¬ \fBENTER\fP ¤Ç¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤¬¤¤¤Ã¤Ñ¤¤¤Î¾ì¹ç¤«¡¢ +\fIaction\fP ¤¬ \fBFIND\fP ¤Ç \fIitem\fP ¤¬¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ëÆâ¤Ë +¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ç¤¢¤ë¡£ +.\"O .BR hsearch_r () +.\"O returns nonzero on success, and 0 on error. +.BR hsearch_r () +¤Ï¡¢À®¸ù¤¹¤ë¤È 0 °Ê³°¤òÊÖ¤·¡¢¥¨¥é¡¼¤Î¾ì¹ç 0 ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.LP +.\"O .BR hcreate () +.\"O and +.\"O .BR hcreate_r () +.\"O can fail for the following reasons: +.BR hcreate () +¤È +.BR hcreate_r () +¤Ï°Ê²¼¤ÎÍýͳ¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.\"O .RB ( hcreate_r ()) +.\"O .I htab +.\"O is NULL. +.RB ( hcreate_r ()) +.I htab +¤¬ NULL ¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +.\"O Table full with \fIaction\fP set to \fBENTER\fP. +\fBENTER\fP ¤ËÀßÄꤵ¤ì¤¿ \fIaction\fP ¤Ç¡¢ +¥Æ¡¼¥Ö¥ë¤¬¤¤¤Ã¤Ñ¤¤¤Ë¤Ê¤Ã¤¿¡£ +.TP +.B ESRCH +.\"O The \fIaction\fP argument is \fBFIND\fP and no corresponding element +.\"O is found in the table. +\fIaction\fP °ú¤­¿ô¤¬ \fBFIND\fP ¤Ç¡¢ +¤«¤ÄÂбþ¤¹¤ëÍ×ÁǤ¬¥Æ¡¼¥Ö¥ë¤Ë¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.\"O .\" hdestroy_r() can set errno to EINVAL if 'tab' is NULL. +.\" hdestroy_r() ¤Ï 'tab' ¤¬ NULL ¤Î¾ì¹ç errno ¤Ë EINVAL ¤òÀßÄꤹ¤ë¾ì¹ç¤¬¤¢¤ë¡£ +.PP +.\"O .BR hsearch () +.\"O and +.\"O .BR hsearch_r () +.\"O can fail for the following reasons: +.BR hsearch () +¤È +.BR hsearch_r () +¤Ï°Ê²¼¤ÎÍýͳ¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B ENOMEM +.\"O .I action +.\"O was +.\"O .BR ENTER , +.\"O .I key +.\"O was not found in the table, +.\"O and there was no room in the table to add a new entry. +.I action +¤¬ +.B ENTER +¤Ç¡¢ +.I key +¤¬¥Æ¡¼¥Ö¥ëÆâ¤Ë¸«¤Ä¤«¤é¤º¡¢ +¥Æ¡¼¥Ö¥ë¤Ë¿·¤·¤¤¥¨¥ó¥È¥ê¤òÄɲ乤ë;ÃϤ¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B ESRCH +.\"O .I action +.\"O was +.\"O .BR FIND , +.\"O and +.\"O .I key +.\"O was not found in the table. +.I action +¤¬ +.B FIND +¤Ç¡¢ +.I key +¤¬¥Æ¡¼¥Ö¥ëÆâ¤Ë¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.PP +.\"O POSIX.1-2001 only specifies the +.\"O .B ENOMEM +.\"O error. +POSIX.1-2001 ¤¬µ¬Äꤷ¤Æ¤¤¤ë¤Î¤Ï¡¢¥¨¥é¡¼ +.B ENOMEM +¤À¤±¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The functions +.\"O .BR hcreate (), +.\"O .BR hsearch (), +.\"O and +.\"O .BR hdestroy () +.\"O are from SVr4, and are described in POSIX.1-2001. +´Ø¿ô +.BR hcreate (), +.BR hsearch (), +.BR hdestroy () +¤Ï SVr4 ¤«¤éƳÆþ¤µ¤ì¤¿¤â¤Î¤Ç¡¢POSIX.1-2001 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O The functions +.\"O .BR hcreate_r , +.\"O .BR hsearch_r , +.\"O and +.\"O .BR hdestroy_r +.\"O are GNU extensions. +´Ø¿ô +.BR hcreate_r , +.BR hsearch_r , +.B hdestroy_r +¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Hash table implementations are usually more efficient when the +.\"O table contains enough free space to minimize collisions. +.\"O Typically, this means that +.\"O .I nel +.\"O should be at least 25% larger than the maximum number of elements +.\"O that the caller expects to store in the table. +Ä̾¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Î¼ÂÁõ¤Ï¡¢¾×ÆͤòºÇ¾®¸Â¤Ë¤¹¤ë¤¿¤á¤Ë +¥Æ¡¼¥Ö¥ë¤Ë½½Ê¬¤Ê¶õ¤­Îΰ褬¤¢¤ë¾ì¹ç¤Ë¸úΨ¤¬¤è¤¯¤Ê¤ë¡£ +¤³¤Î¤¿¤á¡¢ÉáÄ̤ϡ¢ +.I nel +¤ò¡¢¸Æ¤Ó½Ð¤·Â¦¤¬¥Æ¡¼¥Ö¥ë¤Ë³ÊǼ¤·¤è¤¦¤È»×¤Ã¤Æ¤¤¤ë +¥¨¥ó¥È¥ê¤ÎºÇÂç¿ô¤è¤ê¾¯¤Ê¤¯¤È¤â 25% ¤ÏÂ礭¤ÊÃͤˤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O The +.\"O .BR hdestroy () +.\"O and +.\"O .BR hdestroy _r() +.\"O functions do not free the buffers pointed to by the +.\"O .I key +.\"O and +.\"O .I data +.\"O elements of the hash table entries. +.\"O (It can't do this because it doesn't know +.\"O whether these buffers were allocated dynamically.) +.BR hdestroy () +¤È +.BR hdestroy_r () +¤Ï¡¢¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¤ÎÍ×ÁǤǤ¢¤ë +.I key +¤È +.I data +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤ò²òÊü¤·¤Ê¤¤ +(¤³¤ì¤¬¤Ç¤­¤Ê¤¤¤Î¤Ï¡¢¤³¤ì¤é¤Î¥Ð¥Ã¥Õ¥¡¤¬Æ°Åª¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¤Î¤«¤ò +ÃΤ뤳¤È¤¬¤Ç¤­¤Ê¤¤¤«¤é¤Ç¤¢¤ë)¡£ +.\"O If these buffers need to be freed (perhaps because the program +.\"O is repeatedly creating and destroying hash tables, +.\"O rather than creating a single table whose lifetime +.\"O matches that of the program), +.\"O then the program must maintain bookkeeping data structures that +.\"O allow it to free them. +¤³¤ì¤é¤Î¥Ð¥Ã¥Õ¥¡¤ò²òÊü¤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¡¢ +¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥Ð¥Ã¥Õ¥¡¤ò²òÊü¤Ç¤­¤ë¤è¤¦¤Ë´ÉÍýÍѤΥǡ¼¥¿¹½Â¤¤ò +Àߤ±¤Æ¡¢¤³¤ì¤ò´ÉÍý¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(²òÊü¤¬É¬ÍפȤʤëÍýͳ¤Ï¡¢¤¿¤¤¤Æ¤¤¤Ï¡¢¥×¥í¥°¥é¥à¼«¿È¤ÈÀ¸Â¸´ü´Ö¤¬Æ±¤¸ +¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ò°ì¤Ä¤À¤±ºîÀ®¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢¤½¤Î¥×¥í¥°¥é¥à¤Ç¤ÏÊ£¿ô¤Î +¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ò·«¤êÊÖ¤·¤ÆºîÀ®¤·¤¿¤êÇË´þ¤·¤¿¤ê¤¹¤ë¤«¤é¤Ç¤¢¤í¤¦)¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O SVr4 and POSIX.1-2001 specify that \fIaction\fP +.\"O is significant only for unsuccessful searches, so that an \fBENTER\fP +.\"O should not do anything for a successful search. +.\"O In libc and glibc (before version 2.3), the +.\"O implementation violates the specification, +.\"O updating the \fIdata\fP for the given \fIkey\fP in this case. +SVr4 ¤È POSIX.1-2001 ¤Îµ¬Äê¤Ç¤Ï¡¢ +\fIaction\fP ¤Ï¸¡º÷¤¬¼ºÇÔ¤·¤¿¤È¤­¤Ë¤À¤±°ÕÌ£¤ò»ý¤Ä¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤è¤Ã¤Æ¡¢¸¡º÷¤¬À®¸ù¤·¤¿¾ì¹ç¡¢\fIaction\fP ¤ÎÃͤ¬ \fBENTER\fP ¤Ç¤â +²¿¤â¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +(¥Ð¡¼¥¸¥ç¥ó 2.3 ¤è¤êÁ°¤Î) libc ¤È glibc ¤Î¼ÂÁõ¤Ï¤³¤Îµ¬³Ê¤Ë°ãÈ¿¤·¤Æ¤ª¤ê¡¢ +¤³¤Î¾õ¶·¤Ç¡¢»ØÄꤵ¤ì¤¿ \fIkey\fP ¤ËÂбþ¤¹¤ë \fIdata\fP ¤¬¹¹¿·¤µ¤ì¤ë¡£ + +.\"O Individual hash table entries can be added, but not deleted. +¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¡¼¤ÎÄɲäϤǤ­¤ë¤¬¡¢ºï½ü¤¬¤Ç¤­¤Ê¤¤¡£ +.\"O .SH EXAMPLE +.SH Îã +.PP +.\"O The following program inserts 24 items into a hash table, then prints +.\"O some of them. +¼¡¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Ë 24 ¸Ä¤Î¹àÌܤòÁÞÆþ¤·¡¢ +¤½¤ì¤«¤é¤½¤Î¤¦¤Á¤Î¤¤¤¯¤Ä¤«¤òɽ¼¨¤¹¤ë¡£ +.nf + +#include +#include +#include + +char *data[] = { "alpha", "bravo", "charlie", "delta", + "echo", "foxtrot", "golf", "hotel", "india", "juliet", + "kilo", "lima", "mike", "november", "oscar", "papa", + "quebec", "romeo", "sierra", "tango", "uniform", + "victor", "whisky", "x\-ray", "yankee", "zulu" +}; + +int main() +{ + ENTRY e, *ep; + int i; + + hcreate(30); + + for (i = 0; i < 24; i++) { + e.key = data[i]; +.\"O /* data is just an integer, instead of a +.\"O pointer to something */ + /* ¥Ç¡¼¥¿¤Ï¡¢¥Ý¥¤¥ó¥¿¤Ç¤Ï¤Ê¤¯¡¢Ã±¤Ê¤ëÀ°¿ôÃͤǤ¢¤ë¡£ */ + e.data = (void *) i; + ep = hsearch(e, ENTER); +.\"O /* there should be no failures */ + /* ¥¨¥é¡¼¤Ïµ¯¤³¤é¤Ê¤¤¤Ï¤º¤Ç¤¢¤ë¡£ */ + if (ep == NULL) { + fprintf(stderr, "entry failed\\n"); + exit(EXIT_FAILURE); + } + } + + for (i = 22; i < 26; i++) { +.\"O /* print two entries from the table, and +.\"O show that two are not in the table */ + /* ¥Æ¡¼¥Ö¥ë¤Ë¤¢¤ë 2 ¤Ä¤Î¥¨¥ó¥È¥ê¤òɽ¼¨¤·¡¢ + ¤¢¤È¤Î 2 ¤Ä¤¬¥Æ¡¼¥Ö¥ë¤Ë¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£ */ + e.key = data[i]; + ep = hsearch(e, FIND); + printf("%9.9s \-> %9.9s:%d\\n", e.key, + ep ? ep\->key : "NULL", ep ? (int)(ep\->data) : 0); + } + hdestroy(); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bsearch (3), +.BR lsearch (3), +.BR malloc (3), +.BR tsearch (3), +.BR feature_test_macros (7) diff --git a/draft/man3/hypot.3 b/draft/man3/hypot.3 new file mode 100644 index 00000000..234d9968 --- /dev/null +++ b/draft/man3/hypot.3 @@ -0,0 +1,235 @@ +.\" 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-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: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 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O hypot, hypotf, hypotl \- Euclidean distance function +hypot, hypotf, hypotl \- ¥æ¡¼¥¯¥ê¥Ã¥Éµ÷Î¥´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double hypot(double " x ", double " y ); +.br +.BI "float hypotf(float " x ", float " y ); +.br +.BI "long double hypotl(long double " x ", long double " y ); +.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) +»²¾È): +.in +.sp +.ad l +.BR hypot (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR hypotf (), +.BR hypotl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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 ) +¤È¤Îµ÷Î¥¤Ç¤¢¤ë¡£ + +.\"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 +¤Ç¤¢¤ëľ³Ñ»°³Ñ·Á¤Î¼ÐÊÕ¤ÎŤµ¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O or +.\"O .I y +.\"O is an infinity, +.\"O positive infinity is returned. +.I x +¤« +.I y +¤¬Ìµ¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +¤òÊÖ¤¹¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.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 +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.\" .I errno +.\" is set to +.\" .BR ERANGE . +.\"O An underflow floating-point exception +.\"O .RB ( FE_UNDERFLOW ) +.\"O is raised. +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +.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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR sqrt (3) diff --git a/draft/man3/iconv.3 b/draft/man3/iconv.3 new file mode 100644 index 00000000..28313291 --- /dev/null +++ b/draft/man3/iconv.3 @@ -0,0 +1,219 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" 2000-06-30 correction by Yuichi SATO +.\" 2000-11-15 aeb, fixed prototype +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated 2000-07-11, Yuichi SATO +.\" Updated 2008-09-14, Akihiro MOTOKI , LDP v3.09 +.\" +.\"WORD: conversion ÊÑ´¹ +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\"WORD: sequence ʸ»úÎó +.\"WORD: +.\" +.TH ICONV 3 2008-09-08 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iconv \- perform character set conversion +iconv \- ʸ»ú¥»¥Ã¥ÈÊÑ´¹¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t iconv(iconv_t " cd , +.BI " char **" inbuf ", size_t *" inbytesleft , +.BI " char **" outbuf ", size_t *" outbytesleft ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The argument \fIcd\fP must be a conversion descriptor created using the +.\"O function +.\"O .BR iconv_open (3). +°ú¤­¿ô \fIcd\fP ¤Ï¡¢´Ø¿ô +.BR iconv_open (3) +¤ò»È¤Ã¤ÆÀ¸À®¤µ¤ì¤ë +ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The main case is when \fIinbuf\fP is not NULL and \fI*inbuf\fP is not NULL. +.\"O In this case, the +.\"O .BR iconv () +.\"O function converts the multibyte sequence +.\"O starting at \fI*inbuf\fP to a multibyte sequence starting at \fI*outbuf\fP. +.\"O At most \fI*inbytesleft\fP bytes, starting at \fI*inbuf\fP, will be read. +.\"O At most \fI*outbytesleft\fP bytes, starting at \fI*outbuf\fP, will be written. +¼ç¤Ë»È¤ï¤ì¤ë¤Î¤Ï¡¢ +¡Ö\fIinbuf\fP ¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä \fI*inbuf\fP ¤¬ NULL ¤Ç¤Ê¤¤¡× +¤È¤¤¤¦¾ì¹ç¤Ç¤¢¤ë¡£ +¤³¤Î¾ì¹ç¡¢ +.BR iconv () +´Ø¿ô¤Ï¡¢ +\fI*inbuf\fP ¤Ç»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò +\fI*outbuf\fP ¤Ç»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£ +\fI*inbuf\fP ¤òÀèƬ¤È¤·¤ÆºÇÂç \fI*inbytesleft\fP ¥Ð¥¤¥È¤¬Æɤ߹þ¤Þ¤ì¡¢ +\fI*outbuf\fP ¤òÀèƬ¤È¤·¤ÆºÇÂç \fI*outbytesleft\fP ¥Ð¥¤¥È¤¬½ñ¤­½Ð¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR iconv () +.\"O function converts one multibyte character at a time, and for +.\"O each character conversion it increments \fI*inbuf\fP and decrements +.\"O \fI*inbytesleft\fP by the number of converted input bytes, it increments +.\"O \fI*outbuf\fP and decrements \fI*outbytesptr\fP by the number of converted +.\"O output bytes, and it updates the conversion state contained in \fIcd\fP. +.\"O If the character encoding of the input is stateful, the +.\"O .BR iconv () +.\"O function can also convert a sequence of input bytes +.\"O to an update to the conversion state without producing any output bytes; +.\"O such input is called a \fIshift sequence\fP. +.\"O The conversion can stop for four reasons: +.BR iconv () +´Ø¿ô¤Ï 1 ÅÙ¤Ë 1 ¤Ä¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤òÊÑ´¹¤¹¤ë¡£ +¤½¤·¤Æ¡¢³Æʸ»úÊÑ´¹Ëè¤Ë¡¢ÊÑ´¹¤µ¤ì¤¿ÆþÎϥХ¤¥È¤Î¿ô¤À¤± +\fI*inbuf\fP ¤òÁý²Ã¤µ¤»¡¢\fI*inbytesleft\fP ¤ò¸º¾¯¤µ¤»¤ë¡£ +¤Þ¤¿¡¢ÊÑ´¹¤µ¤ì¤¿½ÐÎϥХ¤¥È¤Î¿ô¤À¤± +\fI*outbuf\fP ¤òÁý²Ã¤µ¤»¡¢\fI*outbytesleft\fP ¤ò¸º¾¯¤µ¤»¤ë¡£ +¤µ¤é¤Ë¡¢\fIcd\fP ¤Ë´Þ¤Þ¤ì¤ëÊÑ´¹¾õÂÖ¤ò¹¹¿·¤¹¤ë¡£ +ÆþÎϤÎʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤¬¤¬¾õÂÖ¤ò»ý¤Ä¾ì¹ç¡¢ +.BR iconv () +´Ø¿ô¤ÏÆþÎϥХ¤¥È¤ÎÎó¤ËÂФ·¤ÆÊÑ´¹¤Ë¤âÂбþ¤·¤Æ¤ª¤ê¡¢ +¥Ð¥¤¥È½ÐÎϤòȼ¤ï¤º¤ËÊÑ´¹¾õÂÖ¤ò¹¹¿·¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +ÊÑ´¹¤Ï¡¢¼¡¤Î 4 ¤Ä¤Î¾ì¹ç¤ËÄä»ß¤¹¤ë¡£ +.PP +.\"O 1. An invalid multibyte sequence is encountered in the input. +.\"O In this case +.\"O it sets \fIerrno\fP to \fBEILSEQ\fP and returns +.\"O .IR (size_t)\ \-1 . +.\"O \fI*inbuf\fP +.\"O is left pointing to the beginning of the invalid multibyte sequence. +1. ÆþÎϤË̵¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬤¢¤Ã¤¿¾ì¹ç¡£ +¤³¤Î¾ì¹ç¡¢´Ø¿ô¤Ï \fIerrno\fP ¤ò \fBEILSEQ\fP ¤ËÀßÄꤷ¡¢ +.I (size_t)\ \-1 +¤òÊÖ¤¹¡£ +\fI*inbuf\fP ¤Ï¡¢Ìµ¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ÎÀèƬ¤ò»Ø¤·¤¿¤Þ¤Þ¤Ë¤Ê¤ë¡£ +.PP +.\"O 2. The input byte sequence has been entirely converted, +.\"O that is, \fI*inbytesleft\fP has gone down to 0. +.\"O In this case +.\"O .BR iconv () +.\"O returns the number of +.\"O nonreversible conversions performed during this call. +2. ÆþÎϥХ¤¥Èʸ»úÎ󤬴°Á´¤ËÊÑ´¹¤µ¤ì¡¢\fI*inbytesleft\fP ¤¬ 0 ¤Ë¤Ê¤Ã¤¿¾ì¹ç¡£ +¤³¤Î¾ì¹ç¡¢ +.BR iconv () +¤Ï¡¢¸Æ½Ð¤·¤Î´Ö¤ËÈó²ÄµÕÊÑ´¹¤¬¹Ô¤ï¤ì¤¿²ó¿ô¤òÊÖ¤¹¡£ +.PP +.\"O 3. An incomplete multibyte sequence is encountered in the input, and the +.\"O input byte sequence terminates after it. +.\"O In this case it sets \fIerrno\fP to +.\"O \fBEINVAL\fP and returns +.\"O .IR (size_t)\ \-1 . +.\"O \fI*inbuf\fP is left pointing to the +.\"O beginning of the incomplete multibyte sequence. +3. ÆþÎϤËÉÔ´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬤¢¤ê¡¢ +ÆþÎϥХ¤¥Èʸ»úÎ󤬤½¤Î¸å¤Ç½ªÎ»¤·¤Æ¤¤¤ë¾ì¹ç¡£ +¤³¤Î¾ì¹ç¡¢´Ø¿ô¤Ï¡¢\fIerrno\fP ¤ò \fBEINVAL\fP ¤ËÀßÄꤷ¡¢ +.I (size_t)\ \-1 +¤òÊÖ¤¹¡£ +\fI*inbuf\fP ¤Ï¡¢ÉÔ´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ÎÀèƬ¤ò»Ø¤·¤¿¤Þ¤Þ¤Ë¤µ¤ì¤ë¡£ +.PP +.\"O 4. The output buffer has no more room for the next converted character. +.\"O In this case it sets \fIerrno\fP to \fBE2BIG\fP and returns +.\"O .IR (size_t)\ \-1 . +4. ½ÐÎϥХåե¡¡¼¤Ë¼¡¤ÎÊÑ´¹¤µ¤ì¤¿Ê¸»úÎó¤Î¤¿¤á¤Î¶õ¤­¤¬¤Ê¤¤¾ì¹ç¡£ +¤³¤Î¾ì¹ç¡¢\fIerrno\fP ¤¬ \fBE2BIG\fP ¤ËÀßÄꤵ¤ì¡¢ +.I (size_t)\ \-1 +¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O A different case is when \fIinbuf\fP is NULL or \fI*inbuf\fP is NULL, but +.\"O \fIoutbuf\fP is not NULL and \fI*outbuf\fP is not NULL. +.\"O In this case, the +.\"O .BR iconv () +.\"O function attempts to set \fIcd\fP's conversion state to the +.\"O initial state and store a corresponding shift sequence at \fI*outbuf\fP. +.\"O At most \fI*outbytesleft\fP bytes, starting at \fI*outbuf\fP, will be written. +.\"O If the output buffer has no more room for this reset sequence, it sets +.\"O \fIerrno\fP to \fBE2BIG\fP and returns +.\"O .IR (size_t)\ \-1 . +.\"O Otherwise it increments +.\"O \fI*outbuf\fP and decrements \fI*outbytesptr\fP by the number of bytes +.\"O written. +Ê̤Υ±¡¼¥¹¤È¤·¤Æ¤Ï¡¢ +¡Ö\fIinbuf\fP ¤¬ NULL¡¢¤Þ¤¿¤Ï \fI*inbuf\fP ¤¬ NULL ¤Ç¤¢¤ë¡£ +¤·¤«¤·¡¢\fIoutbuf\fP ¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä \fI*outbuf\fP ¤¬ NULL ¤Ç¤Ê¤¤¡× +¤È¤¤¤¦¾ì¹ç¤¬¤¢¤ë¡£ +¤³¤Î¾ì¹ç¡¢ +.BR iconv () +´Ø¿ô¤Ï¡¢\fIcd\fP ¤ÎÊÑ´¹¾õÂÖ¤ò½é´ü¾õÂ֤ˤ·¤Æ¡¢ +Âбþ¤¹¤ë¥·¥Õ¥Èʸ»úÎó¤ò \fI*outbuf\fP ¤ËÊݸ¤·¤è¤¦¤È¤¹¤ë¡£ +ºÇÂç \fI*outbytesleft\fP ¥Ð¥¤¥È¤¬¡¢\fI*outbuf\fP ¤ò»Ï¤á¤È¤·¤Æ½ñ¤­½Ð¤µ¤ì¤ë¡£ +¤³¤Î¥ê¥»¥Ã¥È¤µ¤ì¤¿Ê¸»úÎó¤ËÂФ·¤Æ¡¢½ÐÎϥХåե¡¡¼¤Ë¶õ¤­¤¬¤Ê¤¤¾ì¹ç¡¢ +¤³¤Î´Ø¿ô¤Ï \fIerrno\fP ¤ò \fBE2BIG\fP ¤ËÀßÄꤷ¡¢ +.I (size_t)\ \-1 +¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï¡¢½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¤Î¿ô¤À¤± +\fI*outbuf\fP ¤òÁý²Ã¤µ¤»¡¢\fI*outbytesleft\fP ¤ò¸º¾¯¤µ¤»¤ë¡£ +.PP +.\"O A third state is when \fIinbuf\fP is NULL or \fI*inbuf\fP is NULL, and +.\"O \fIoutbuf\fP is NULL or \fI*outbuf\fP is NULL. +.\"O In this case, the +.\"O .BR iconv () +.\"O function sets \fIcd\fP's conversion state to the initial state. +3 ÈÖÌܤΥ±¡¼¥¹¤·¤Æ¤Ï¡¢ +¡Ö\fIinbuf\fP ¤¬ NULL¡¢¤Þ¤¿¤Ï \fI*inbuf\fP ¤¬ NULL ¤Ç¤¢¤ë¡£ +¤«¤Ä¡¢\fIoutbuf\fP ¤¬ NULL¡¢¤Þ¤¿¤Ï \fI*outbuf\fP ¤¬ NULL ¤Ç¤¢¤ë¡× +¤È¤¤¤¦¾ì¹ç¤¬¤¢¤ë¡£ +¤³¤Î¾ì¹ç¡¢ +.BR iconv () +´Ø¿ô¤Ï¡¢\fIcd\fP ¤ÎÊÑ´¹¾õÂÖ¤ò½é´ü¾õÂ֤ˤ¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iconv () +.\"O function returns the number of characters converted in a +.\"O nonreversible way during this call; reversible conversions are not counted. +.\"O In case of error, it sets \fIerrno\fP and returns +.\"O .IR (size_t)\ \-1 . +.BR iconv () +´Ø¿ô¤Ï¡¢¸Æ½Ð¤·¤Î´Ö¤ËÈó²ÄµÕ¤ÊÊýË¡¤ÇÊÑ´¹¤µ¤ì¤¿Ê¸»ú¿ô¤òÊÖ¤¹¡£ +¤Ä¤Þ¤ê¡¢²ÄµÕÊÑ´¹¤Ï¥«¥¦¥ó¥È¤µ¤ì¤Ê¤¤¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï \fIerrno\fP ¤òÀßÄꤷ¡¢ +.I (size_t)\ \-1 +¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O The following errors can occur, among others: +¾¤Î¤¤¤í¤¤¤í¤Ê¥¨¥é¡¼¤Î¤¦¤Á¤«¤é¡¢°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ê¤¦¤ë¡£ +.TP +.B E2BIG +.\"O There is not sufficient room at \fI*outbuf\fP. +\fI*outbuf\fP ¤Ë½½Ê¬¤Ê¶õ¤­¤¬¤Ê¤¤¡£ +.TP +.B EILSEQ +.\"O An invalid multibyte sequence has been encountered in the input. +ÆþÎϤË̵¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬤¢¤Ã¤¿¡£ +.TP +.B EINVAL +.\"O An incomplete multibyte sequence has been encountered in the input. +ÆþÎϤËÉÔ´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬤¢¤Ã¤¿¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O This function is available in glibc since version 2.1. +¤³¤Î´Ø¿ô¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iconv_close (3), +.BR iconv_open (3) diff --git a/draft/man3/iconv_close.3 b/draft/man3/iconv_close.3 new file mode 100644 index 00000000..c2a92a6e --- /dev/null +++ b/draft/man3/iconv_close.3 @@ -0,0 +1,70 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jul 11 19:02:58 JST 2000 +.\" by Yuichi SATO +.\" +.\"WORD: conversion ÊÑ´¹ +.\"WORD: deallocate ²òÊü¤¹¤ë +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\"WORD: +.\" +.TH ICONV_CLOSE 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iconv_close \- deallocate descriptor for character set conversion +iconv_close \- ʸ»ú¥»¥Ã¥ÈÊÑ´¹¤Î¤¿¤á¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤ò²òÊü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iconv_close(iconv_t " cd ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iconv_close () +.\"O function deallocates a conversion descriptor \fIcd\fP +.\"O previously allocated using +.\"O .BR iconv_open (3). +.BR iconv_close () +´Ø¿ô¤Ï¡¢ +.BR iconv_open (3) +¤ò»È¤Ã¤Æ°ÊÁ°¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ +ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ \fIcd\fP ¤ò²òÊü¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O When successful, the +.\"O .BR iconv_close () +.\"O function returns 0. +.\"O In case of error, it sets +.\"O .I errno +.\"O and returns \-1. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR iconv_close () +´Ø¿ô¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï +.I errno +¤òÀßÄꤷ \-1 ¤òÊÖ¤¹¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O This function is available in glibc since version 2.1. +¤³¤Î´Ø¿ô¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +UNIX98, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iconv (3), +.BR iconv_open (3) diff --git a/draft/man3/iconv_open.3 b/draft/man3/iconv_open.3 new file mode 100644 index 00000000..c81c1677 --- /dev/null +++ b/draft/man3/iconv_open.3 @@ -0,0 +1,154 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" +.\" 2007-03-31 Bruno Haible, Describe the glibc/libiconv //TRANSLIT +.\" and //IGNORE extensions for 'tocode'. +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jul 11 19:02:58 JST 2000 +.\" by Yuichi SATO +.\" Updated 2007-06-01, Akihiro MOTOKI , LDP v2.50 +.\" +.\"WORD: allocate ³ä¤êÅö¤Æ¤ë +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: conversion ÊÑ´¹ +.\"WORD: sequence ʸ»úÎó +.\" +.TH ICONV_OPEN 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iconv_open \- allocate descriptor for character set conversion +iconv_open \- ʸ»ú¥»¥Ã¥ÈÊÑ´¹¤Î¤¿¤á¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò³ä¤êÅö¤Æ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "iconv_t iconv_open(const char *" tocode ", const char *" fromcode ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iconv_open () +.\"O function allocates a conversion descriptor suitable +.\"O for converting byte sequences from character encoding \fIfromcode\fP to +.\"O character encoding \fItocode\fP. +.BR iconv_open () +´Ø¿ô¤Ï¡¢Ê¸»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥° \fIfromcode\fP ¤«¤é +ʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥° \fItocode\fP ¤Ø¤Î¥Ð¥¤¥Èʸ»úÎóÊÑ´¹¤ËŬ¤·¤¿ +ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò³ä¤êÅö¤Æ¤ë¡£ +.PP +.\"O The values permitted for \fIfromcode\fP and \fItocode\fP and the supported +.\"O combinations are system-dependent. +.\"O For the GNU C library, the permitted +.\"O values are listed by the \fBiconv \-\-list\fP command, and all combinations +.\"O of the listed values are supported. +\fIfromcode\fP ¤È \fItocode\fP ¤Ë»È¤¦¤³¤È¤Î¤Ç¤­¤ëÃͤȡ¢ +¥µ¥Ý¡¼¥È¤µ¤ì¤ëÁȤ߹ç¤ï¤»¤Ï¡¢¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¡£ +GNU C ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢»È¤¦¤³¤È¤Î¤Ç¤­¤ëÃÍ¤Ï +\fBiconv \-\-list\fP ¥³¥Þ¥ó¥É¤Ç¥ê¥¹¥È¤µ¤ì¡¢ +¥ê¥¹¥È¤µ¤ì¤¿¤¹¤Ù¤Æ¤ÎÃͤÎÁȤ߹ç¤ï¤»¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤ë¡£ +.\"O Furthermore the GNU C library and the +.\"O GNU libiconv library support the following two suffixes: +¤µ¤é¤Ë¡¢ GNU C ¥é¥¤¥Ö¥é¥ê¤È GNU libiconv ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢ +°Ê²¼¤ÎÀÜÈø¼­¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +//TRANSLIT +.\"O When the string "//TRANSLIT" is appended to \fItocode\fP, transliteration +.\"O is activated. +.\"O This means that when a character cannot be represented in the +.\"O target character set, it can be approximated through one or several +.\"O similarly looking characters. +\fItocode\fP ¤Î¸å¤í¤Ëʸ»úÎó "//TRANSLIT" ¤¬ÉÕ¤¤¤Æ¤¤¤ë¾ì¹ç¡¢ +ËÝÌõ (transliteration) ¤¬Í­¸ú¤Ë¤Ê¤ë¡£¤³¤Î¾ì¹ç¡¢ +ÊÑ´¹Àè¤Îʸ»ú¥»¥Ã¥È¤Çɽ¸½¤Ç¤­¤Ê¤¤Ê¸»ú¤ò¡¢¤½¤Îʸ»ú¤ÈƱ¤¸¤è¤¦¤Ë¸«¤¨¤ë +ʸ»ú (Ê£¿ôʸ»ú¤Î¾ì¹ç¤â¤¢¤ë) ¤Çɽ¸½¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +//IGNORE +.\"O When the string "//IGNORE" is appended to \fItocode\fP, characters that +.\"O cannot be represented in the target character set will be silently discarded. +\fItocode\fP ¤Î¸å¤í¤Ëʸ»úÎó "//IGNORE" ¤¬ÉÕ¤¤¤Æ¤¤¤ë¾ì¹ç¡¢ +ÊÑ´¹Àè¤Îʸ»ú¥»¥Ã¥È¤Çɽ¸½¤Ç¤­¤Ê¤¤Ê¸»ú¤ÏÌۤäÆ̵»ë¤µ¤ì¤ë¡£ +.PP +.\"O The resulting conversion descriptor can be used with +.\"O .BR iconv (3) +.\"O any number of times. +.\"O It remains valid until deallocated using +.\"O .BR iconv_close (3). +¤³¤Î´Ø¿ô¤òÆɤó¤ÇÆÀ¤é¤ì¤¿ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢ +.BR iconv (3) +¤Ç +²¿Å٤Ǥâ»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ï +.BR iconv_close (3) +¤ò»È¤Ã¤Æ²òÊü¤µ¤ì¤ë¤Þ¤ÇÍ­¸ú¤Ç¤¢¤ë¡£ +.PP +.\"O A conversion descriptor contains a conversion state. +.\"O After creation using +.\"O .BR iconv_open (), +.\"O the state is in the initial state. +.\"O Using +.\"O .BR iconv (3) +.\"O modifies the descriptor's conversion state. +.\"O (This implies that a conversion +.\"O descriptor can not be used in multiple threads simultaneously.) +.\"O To bring the state back to the initial state, use +.\"O .BR iconv (3) +.\"O with NULL as \fIinbuf\fP argument. +ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÊÑ´¹¾õÂÖ¤ò»ý¤Ä¡£ +.BR iconv_open () +¤òÍѤ¤¤ÆÀ¸À®¤µ¤ì¤¿¸å¡¢ÊÑ´¹¾õÂ֤Ͻé´ü¾õÂ֤Ǥ¢¤ë¡£ +.BR iconv (3) +¤ò»È¤¦¤³¤È¤Ë¤è¤ê¡¢¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÊÑ´¹¾õÂÖ¤¬Êѹ¹¤µ¤ì¤ë¡£ +(ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Ç +Ʊ»þ¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤Ê¤¤¤³¤È¤ò°ÕÌ£¤·¤Æ¤¤¤ë¡£) +ÊÑ´¹¾õÂÖ¤ò½é´ü¾õÂÖ¤ËÌ᤹¤Ë¤Ï¡¢ +\fIinbuf\fP °ú¤­¿ô¤ò NULL ¤È¤·¤Æ +.BR iconv (3) +¤òÍѤ¤¤ë¤³¤È¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iconv_open () +.\"O function returns a freshly allocated conversion +.\"O descriptor. +.\"O In case of error, it sets \fIerrno\fP and returns +.\"O .IR (iconv_t)\ \-1 . +.BR iconv_open () +´Ø¿ô¤Ï¡¢¿·¤¿¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï \fIerrno\fP ¤òÀßÄꤷ¡¢ +.I (iconv_t)\ \-1 +¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O The following error can occur, among others: +.\"O .TP +.\"O .B EINVAL +.\"O The conversion from \fIfromcode\fP to \fItocode\fP is not supported by the +.\"O implementation. +¾¤Î¤¤¤í¤¤¤í¤Ê¥¨¥é¡¼¤Î¤¦¤Á¡¢°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ê¤¦¤ë¡£ +.TP +.B EINVAL +\fIfromcode\fP ¤«¤é \fItocode\fP ¤Ø¤ÎÊÑ´¹¤Ï¡¢¤³¤Î¼ÂÁõ¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O This function is available in glibc since version 2.1. +¤³¤Î´Ø¿ô¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +UNIX98, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iconv (1), +.BR iconv (3), +.BR iconv_close (3) diff --git a/draft/man3/ilogb.3 b/draft/man3/ilogb.3 new file mode 100644 index 00000000..d0212f48 --- /dev/null +++ b/draft/man3/ilogb.3 @@ -0,0 +1,192 @@ +.\" 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. +.\" +.\" 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 2009-02-04 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ilogb, ilogbf, ilogbl \- get integer exponent of a floating-point value +ilogb, ilogbf, ilogbl \- ÉâÆ°¾®¿ôÅÀ¿ô¤Î»Ø¿ôÉô¤òÀ°¿ô¤È¤·¤Æ¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int ilogb(double " x ); +.br +.BI "int ilogbf(float " x ); +.br +.BI "int ilogbl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR ilogb (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR ilogbf (), +.BR ilogbl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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 +¤Ç¥­¥ã¥¹¥È¤·¤¿¤â¤Î¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the exponent of +.\"O .IR x , +.\"O as a signed integer. +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤Î»Ø¿ôÉô¤òÉä¹æÉÕ¤­À°¿ô¤È¤·¤ÆÊÖ¤¹¡£ + +.\"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 +¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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} +.\" shall be returned and a domain error shall occur. +.\" +.\" If the correct value is less than {INT_MIN}, {INT_MIN} +.\" shall be returned and a domain error shall occur. +.\"O .SH ERRORS +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is 0 or a NaN +Îΰ襨¥é¡¼: \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 ) +¤¬¾å¤¬¤ë¡£ +.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 ¤¬Ìµ¸ÂÂç +.\" .I errno +.\" is set to +.\" .BR EDOM . +.\" An invalid floating-point exception +.\" .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" +.SH ½àµò +C99, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR log (3), +.BR logb (3), +.BR significand (3) diff --git a/draft/man3/index.3 b/draft/man3/index.3 new file mode 100644 index 00000000..a60e44b6 --- /dev/null +++ b/draft/man3/index.3 @@ -0,0 +1,115 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Fri Dec 12 12:41:35 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. +.\" +.\" 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 Mon Apr 12 12:54:34 1993, David Metcalfe +.\" Modified Sat Jul 24 19:13:52 1993, Rik Faith (faith@cs.unc.edu) +.TH INDEX 3 2009-03-15 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O index, rindex \- locate character in string +index, rindex \- ʸ»úÎóÃæ¤Îʸ»ú¤Î°ÌÃÖ¤ò¼¨¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *index(const char *" s ", int " c ); +.sp +.BI "char *rindex(const char *" s ", int " c ); +.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 ¤¬ +¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.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 ¤¬ +¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.\"O The terminating NULL character is considered to be a part of the +.\"O strings. +ʸ»úÎó¤ò½ªÃ¼¤¹¤ë NULL ʸ»ú¤Ï¡¢Ê¸»úÎó¤Î°ìÉô¤È¤ß¤Ê¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.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" +.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) +¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR memchr (3), +.BR strchr (3), +.BR strpbrk (3), +.BR strrchr (3), +.BR strsep (3), +.BR strspn (3), +.BR strstr (3), +.BR strtok (3) diff --git a/draft/man3/inet.3 b/draft/man3/inet.3 new file mode 100644 index 00000000..a94205c5 --- /dev/null +++ b/draft/man3/inet.3 @@ -0,0 +1,463 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" libc.info (from glibc distribution) +.\" Modified Sat Jul 24 19:12:00 1993 by Rik Faith +.\" Modified Sun Sep 3 20:29:36 1995 by Jim Van Zandt +.\" Changed network into host byte order (for inet_network), +.\" Andreas Jaeger , 980130. +.\" 2008-06-19, mtk +.\" Describe the various address forms supported by inet_aton(). +.\" Clarify discussion of inet_lnaof(), inet_netof(), and inet_makeaddr(). +.\" Add discussion of Classful Addressing, noting that it is obsolete. +.\" Added an EXAMPLE program. +.\" +.\" Japanese Version Copyright (c) 1998 Ueyama Rui +.\" all rights reserved. +.\" Translated 1998-05-23, Ueyama Rui +.\" Updated & Modefied 1999-02-26, Shouichi Saito +.\" Updated 1999-12-26, Kentaro Shirakata +.\" Updated 2005-10-04, Kentaro Shirakata +.\" Updated 2007-05-01, Akihiro MOTOKI , LDP v2.46 +.\" Updated 2008-08-13, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: numbers-and-dots notation ¿ôÃͤȥɥåȤˤè¤ëµ­Ë¡ +.\"WORD: dotted-decimal notation ¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ôµ­Ë¡ +.\"WORD: feature test macro µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\" +.TH INET 3 2008-06-19 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O inet_aton, inet_addr, inet_network, inet_ntoa, inet_makeaddr, inet_lnaof, +.\"O inet_netof \- Internet address manipulation routines +inet_aton, inet_addr, inet_network, inet_ntoa, inet_makeaddr, inet_lnaof, +inet_netof \- ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹Áàºî¥ë¡¼¥Á¥ó +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int inet_aton(const char *" cp ", struct in_addr *" inp ); +.sp +.BI "in_addr_t inet_addr(const char *" cp ); +.sp +.BI "in_addr_t inet_network(const char *" cp ); +.sp +.BI "char *inet_ntoa(struct in_addr " in ); +.sp +.BI "struct in_addr inet_makeaddr(int " net ", int " host ); +.sp +.BI "in_addr_t inet_lnaof(struct in_addr " in ); +.sp +.BI "in_addr_t inet_netof(struct in_addr " in ); +.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 inet_aton (), +.BR inet_ntoa (): +_BSD_SOURCE || _SVID_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR inet_aton () +.\"O converts the Internet host address \fIcp\fP from the +.\"O IPv4 numbers-and-dots notation into binary form (in network byte order) +.\"O and stores it in the structure that \fIinp\fP points to. +.\"O .BR inet_aton () +.\"O returns nonzero if the address is valid, zero if not. +.\"O The address supplied in +.\"O .I cp +.\"O can have one of the following forms: +.BR inet_aton () +¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Û¥¹¥È¤Î¥¢¥É¥ì¥¹ \fIcp\fP ¤ò¡¢ +IPv4 ¤Î¿ôÃͤȥɥåȤˤè¤ëɽµ­¤«¤é (¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Î) ¥Ð¥¤¥Ê¥êÃÍ¤Ø +ÊÑ´¹¤·¡¢ÊÑ´¹·ë²Ì¤ò \fIinp\fP ¤¬»Ø¤·¤Æ¤¤¤ë¹½Â¤ÂΤ˳ÊǼ¤¹¤ë¡£ +¥¢¥É¥ì¥¹¤¬Í­¸ú¤Ê¾ì¹ç 0 °Ê³°¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.I cp +¤ÇÅϤ¹¥¢¥É¥ì¥¹¤È¤·¤Æ¡¢°Ê²¼¤Î·Á¼°¤òÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 10 +.I a.b.c.d +.\"O Each of the four numeric parts specifies a byte of the address; +.\"O the bytes are assigned in left-to-right order to produce the binary address. +4 ¤Ä¤Î¿ô»ú¤Î¤½¤ì¤¾¤ì¤Ï¥¢¥É¥ì¥¹¤Î³Æ¥Ð¥¤¥È¤ò¼¨¤¹¡£ +¤³¤ì¤é¤Î¥Ð¥¤¥È¤Ïº¸¤«¤é±¦¤Î½ç½ø¤Ç¥Ð¥¤¥Ê¥ê¥¢¥É¥ì¥¹¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +.TP +.I a.b.c +.\"O Parts +.\"O .I a +.\"O and +.\"O .I b +.\"O specify the first two bytes of the binary address. +.\"O Part +.\"O .I c +.\"O is interpreted as a 16-bit value that defines the rightmost two bytes +.\"O of the binary address. +.\"O This notation is suitable for specifying (outmoded) Class B +.\"O network addresses. +.I a +¤È +.I b +¤Ï¥Ð¥¤¥Ê¥ê¥¢¥É¥ì¥¹¤ÎºÇ½é¤Î 2 ¥Ð¥¤¥È¤ò¼¨¤¹¡£ +.I c +¤Ï 16 ¥Ó¥Ã¥ÈÃͤȲò¼á¤µ¤ì¡¢¥Ð¥¤¥Ê¥ê¥¢¥É¥ì¥¹¤Î±¦Â¦¤Î 2 ¥Ð¥¤¥È¤òɽ¤¹¡£ +¤³¤Îɽµ­¤Ï¡¢(²áµî¤Î¤â¤Î¤È¤Ê¤Ã¤¿) ¥¯¥é¥¹ B ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ò +»ØÄꤹ¤ë¤Î¤ËŬ¤·¤Æ¤¤¤ë¡£ +.TP +.I a.b +.\"O Part +.\"O .I a +.\"O specifies the first byte of the binary address. +.\"O Part +.\"O .I b +.\"O is interpreted as a 24-bit value that defines the rightmost three bytes +.\"O of the binary address. +.\"O This notation is suitable for specifying (outmoded) Class C +.\"O network addresses. +.I a +¤Ï¥Ð¥¤¥Ê¥ê¥¢¥É¥ì¥¹¤ÎºÇ½é¤Î¥Ð¥¤¥È¤ò¼¨¤¹¡£ +.I b +¤Ï 24 ¥Ó¥Ã¥ÈÃͤȲò¼á¤µ¤ì¡¢¥Ð¥¤¥Ê¥ê¥¢¥É¥ì¥¹¤Î±¦Â¦¤Î 3 ¥Ð¥¤¥È¤òɽ¤¹¡£ +¤³¤Îɽµ­¤Ï¡¢(²áµî¤Î¤â¤Î¤È¤Ê¤Ã¤¿) ¥¯¥é¥¹ C ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ò +»ØÄꤹ¤ë¤Î¤ËŬ¤·¤Æ¤¤¤ë¡£ +.TP +.I a +.\"O The value +.\"O .I a +.\"O is interpreted as a 32-bit value that is stored directly +.\"O into the binary address without any byte rearrangement. +ÃÍ +.I a +¤Ï 32 ¥Ó¥Ã¥ÈÃͤȲò¼á¤µ¤ì¡¢¥Ð¥¤¥È¤ÎºÆÇÛÃ֤ϹԤï¤ì¤º¡¢ +¤½¤Î¤Þ¤Þ¥Ð¥¤¥Ê¥ê¥¢¥É¥ì¥¹¤È¤·¤Æ³ÊǼ¤µ¤ì¤ë¡£ +.PP +.\"O In all of the above forms, +.\"O components of the dotted address can be specified in decimal, +.\"O octal (with a leading +.\"O .IR 0 ), +.\"O or hexadecimal, with a leading +.\"O .IR 0X ). +.\"O Addresses in any of these forms are collectively termed +.\"O .IR "IPV4 numbers-and-dots notation" . +.\"O The form that uses exactly four decimal numbers is referred to as +.\"O .IR "IPv4 dotted-decimal notation" +.\"O (or sometimes: +.\"O .IR "IPv4 dotted-quad notation" ). +¾åµ­¤ÎÁ´¤Æ¤Î·Á¼°¤Ç¡¢¥É¥Ã¥È¶èÀÚ¤ê¤Î¥¢¥É¥ì¥¹¤Î³ÆÍ×ÁǤϡ¢10 ¿Ê¿ô¡¢ +8 ¿Ê¿ô (ÀèƬ¤Ë +.I 0 +¤òÉÕ¤±¤ë)¡¢ +16 ¿Ê¿ô (ÀèƬ¤Ë +.I 0X +¤òÉÕ¤±¤ë) ¤Ç»ØÄê¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î·Á¼°¤Î¥¢¥É¥ì¥¹¤ò¤Þ¤È¤á¤Æ +.I "IPv4 ¤Î¿ôÃͤȥɥåȤˤè¤ëɽµ­ (IPv4 numbers-and-dots notation)" +¤È¸Æ¤Ö¡£ +¤Þ¤¿¡¢10 ¿Ê¿ô 4 ¤Ä¤À¤±¤ò»È¤Ã¤¿·Á¼°¤ò +.I "IPv4 ¤Î¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ôɽµ­ (IPv4 dotted-decimal notation)" +¤È¸Æ¤Ö +.RI ( "IPv4 ¤Î¥É¥Ã¥È¶èÀÚ¤ê 4 ʬ³äɽµ­ (IPv4 dotted-decimal notation)" +¤È¸Æ¤Ö¤³¤È¤â¤¢¤ë)¡£ +.PP +.\"O The +.\"O .BR inet_addr () +.\"O function converts the Internet host address +.\"O \fIcp\fP from IPv4 numbers-and-dots notation into binary data in network +.\"O byte order. +.\"O If the input is invalid, +.\"O .B INADDR_NONE +.\"O (usually \-1) is returned. +.\"O Use of this function is problematic because \-1 is a valid address +.\"O (255.255.255.255). +.\"O Avoid its use in favor of +.\"O .BR inet_aton (), +.\"O .BR inet_pton (3), +.\"O or +.\"O .BR getaddrinfo (3) +.\"O which provide a cleaner way to indicate error return. +.BR inet_addr () +´Ø¿ô¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Û¥¹¥È¤Î¥¢¥É¥ì¥¹ \fIcp\fP ¤ò¡¢ +IPv4 ¤Î¿ôÃͤȥɥåȤˤè¤ëɽµ­¤«¤é¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤Î +¥Ð¥¤¥Ê¥êÃͤØÊÑ´¹¤·¤ÆÊÖ¤¹¡£ +ÆþÎϤ¬ÉÔÀµ¤Ê¾ì¹ç¡¢ +.B INADDR_NONE +(ÉáÄÌ¤Ï \-1) ¤òÊÖ¤¹¡£ +\-1 ¤ÏÍ­¸ú¤Ê¥¢¥É¥ì¥¹ (255.255.255.255) ¤Ê¤Î¤Ç¡¢¤³¤Î´Ø¿ô¤ò»È¤¦¤È +ÌäÂê¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤ò»È¤¦¤Î¤ÏÈò¤±¡¢Âå¤ï¤ê¤Ë +.BR inet_aton (), +.BR inet_pton (3), +.BR getaddrinfo (3) +¤ò»È¤¦¤Î¤¬¤è¤¤¡£ +¤³¤ì¤é¤Î´Ø¿ô¤ÎÊý¤¬¡¢¥¨¥é¡¼¤ÎÄÌÃΤ¬¤è¤ê¤­¤ì¤¤¤ÊÊýË¡¤Ç¹Ô¤ï¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR inet_network () +.\"O function converts +.\"O .IR cp , +.\"O a string in IPv4 numbers-and-dots notation, +.\"O into a number in host byte order suitable for use as an +.\"O Internet network address. +.\"O On success, the converted address is returned. +.\"O If the input is invalid, \-1 is returned. +.BR inet_network () +´Ø¿ô¤Ï¡¢ +IPv4 ¤Î¿ôÃͤȥɥåȤˤè¤ëɽµ­¤Îʸ»úÎó \fIcp\fP ¤ò¡¢ +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹¤È¤·¤Æ¤Î»ÈÍѤËŬ¤·¤¿ +¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¤Î¿ôÃͤËÊÑ´¹¤¹¤ë¡£ +À®¸ù¤¹¤ë¤È¡¢ÊÑ´¹¤µ¤ì¤¿¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£ +ÆþÎϤ¬ÉÔÀµ¤Ê¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR inet_ntoa () +.\"O function converts the Internet host address +.\"O \fIin\fP, given in network byte order, to a string in IPv4 +.\"O dotted-decimal notation. +.\"O The string is returned in a statically +.\"O allocated buffer, which subsequent calls will overwrite. +.BR inet_ntoa () +´Ø¿ô¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤ÇÅϤµ¤ì¤¿¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Û¥¹¥È¥¢¥É¥ì¥¹ +\fIin\fP ¤ò¡¢ IPv4 ¤Î¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ôɽµ­¤Îʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£ +ʸ»úÎó¤ÏÀÅŪ¤Ë³äÅö¤Æ¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¤Î¤Ç¡¢ +¤³¤Î¸å¤Ç¤³¤Î´Ø¿ô¤òºÆÅٸƤӽФ¹¤Èʸ»úÎó¤Ï¾å½ñ¤­¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR inet_lnaof () +.\"O function returns the local network address part +.\"O of the Internet address \fIin\fP. +.\"O The returned value is in host byte order. +.BR inet_lnaof () +´Ø¿ô¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹ \fIin\fP ¤Î¥í¡¼¥«¥ë¥Í¥Ã¥È¥ï¡¼¥¯Éôʬ¤òÊÖ¤¹¡£ +¤³¤ÎÊÖ¤êÃͤϥۥ¹¥È¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤¢¤ë¡£ +.PP +.\"O The +.\"O .BR inet_netof () +.\"O function returns the network number part of +.\"O the Internet address \fIin\fP. +.\"O The returned value is in host byte order. +.BR inet_netof () +´Ø¿ô¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹ \fIin\fP ¤Î¥Í¥Ã¥È¥ï¡¼¥¯Éôʬ¤òÊÖ¤¹¡£ +¤³¤ÎÊÖ¤êÃͤϥۥ¹¥È¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤¢¤ë¡£ +.PP +.\"O The +.\"O .BR inet_makeaddr () +.\"O function is the converse of +.\"O .BR inet_netof () +.\"O and +.\"O .BR inet_lnaof (). +.\"O It returns an Internet host address in network byte order, +.\"O created by combining the network number \fInet\fP +.\"O with the local address \fIhost\fP, both in +.\"O host byte order. +.BR inet_makeaddr () +´Ø¿ô¤Ï +.BR inet_netof () +¤È +.BR inet_lnaof () +¤ÎµÕ¤Îµ¡Ç½¤ò»ý¤Ä¡£ +¥Í¥Ã¥È¥ï¡¼¥¯ÈÖ¹æ \fInet\fP ¤È¡¢¥í¡¼¥«¥ë¥¢¥É¥ì¥¹ \fIhost\fP ¤ò +ÁȤ߹ç¤ï¤»¤ÆÀ¸À®¤·¤¿¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Û¥¹¥È¥¢¥É¥ì¥¹¤ò +¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤ÇÊÖ¤¹¡£ +\fIhost\fP, \fInet\fP ¤Ï¤È¤â¤Ë¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤¢¤ë¡£ +.PP +.\"O The structure \fIin_addr\fP as used in +.\"O .BR inet_ntoa (), +.\"O .BR inet_makeaddr (), +.\"O .BR inet_lnaof () +.\"O and +.\"O .BR inet_netof () +.\"O is defined in +.\"O .I +.\"O as: +.BR inet_ntoa (), +.BR inet_makeaddr (), +.BR inet_lnaof (), +.BR inet_netof () +¤Ç»ÈÍѤ¹¤ë¹½Â¤ÂÎ \fIin_addr\fP ¤Ï +.I +¤Ç¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +typedef uint32_t in_addr_t; + +struct in_addr { + in_addr_t s_addr; +}; +.fi +.in +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD. +.\"O .BR inet_addr () +.\"O and +.\"O .BR inet_ntoa () +.\"O are specified in POSIX.1-2001. +.BR inet_addr (), +.BR inet_ntoa () +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.\"O .BR inet_aton () +.\"O is not specified in POSIX.1-2001, but is available on most systems. +.BR inet_aton () +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O On the i386 the host byte order is Least Significant Byte +.\"O first (little endian), whereas the network byte order, as used on the +.\"O Internet, is Most Significant Byte first (big endian). +i386 ¤Ç¤Ï¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¤Ï Least Significant Byte (LSB) first +(¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó) ¤À¤¬¡¢ +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ç»È¤ï¤ì¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Ï +Most Significant Byte (MSB) first (¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó) +¤Ç¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ + +.\"O .BR inet_lnaof (), +.\"O .BR inet_netof (), +.\"O and +.\"O .BR inet_makeaddr () +.\"O are legacy functions that assume they are dealing with +.\"O .IR "classful network addresses" . +.\"O Classful networking divides IPv4 network addresses into host and network +.\"O components at byte boundaries, as follows: +.BR inet_lnaof (), +.BR inet_netof (), +.BR inet_makeaddr () +¤Ï²áµî¤Î̾»Ä¤Ç¤¢¤ê¡¢ÅϤµ¤ì¤¿¥¢¥É¥ì¥¹¤¬ +.I "¥¯¥é¥¹¥Õ¥ë¡¦¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹ (classful network addresses)" +¤Ç¤¢¤ë¤È²¾Äꤷ¤Æ½èÍý¤ò¹Ô¤¦¡£ +¥¯¥é¥¹¥Õ¥ë¡¦¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ç¤Ï¡¢°Ê²¼¤Ë¤¢¤ë¤è¤¦¤Ë¡¢ +IPv4 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ò¥Ð¥¤¥È¶­³¦¤Ç¥Í¥Ã¥È¥ï¡¼¥¯Éô¤È¥Û¥¹¥ÈÉô¤Ëʬ³ä¤¹¤ë¡£ +.TP 10 +Class A +.\"O This address type is indicated by the value 0 in the +.\"O most significant bit of the (network byte ordered) address. +.\"O The network address is contained in the most significant byte, +.\"O and the host address occupies the remaining three bytes. +(¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Î) ¥¢¥É¥ì¥¹¤ÎºÇ¾å°Ì¥Ó¥Ã¥È¤¬ 0 ¤Î¾ì¹ç¡¢ +¤³¤Î¥¢¥É¥ì¥¹¼ïÊ̤Ȥʤ롣¤³¤Î¥¢¥É¥ì¥¹¼ïÊ̤Ǥϡ¢ +ºÇ¾å°Ì¥Ð¥¤¥È¤¬¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤òɽ¤·¡¢ +»Ä¤ê¤Î 3 ¥Ð¥¤¥È¤¬¥Û¥¹¥È¥¢¥É¥ì¥¹¤òɽ¤¹¡£ +.TP +Class B +.\"O This address type is indicated by the binary value 10 in the +.\"O most significant two bits of the address. +.\"O The network address is contained in the two most significant bytes, +.\"O and the host address occupies the remaining two bytes. +(¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Î) ¥¢¥É¥ì¥¹¤Î¾å°Ì¦ 2 ¥Ó¥Ã¥È¤¬¥Ð¥¤¥Ê¥êÃÍ¤Ç +10 ¤Î¾ì¹ç¡¢¤³¤Î¥¢¥É¥ì¥¹¼ïÊ̤Ȥʤ롣¤³¤Î¥¢¥É¥ì¥¹¼ïÊ̤Ǥϡ¢ +¾å°Ì 2 ¥Ð¥¤¥È¤¬¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤òɽ¤·¡¢ +»Ä¤ê¤Î 2 ¥Ð¥¤¥È¤¬¥Û¥¹¥È¥¢¥É¥ì¥¹¤òɽ¤¹¡£ +.TP +Class C +.\"O This address type is indicated by the binary value 110 in the +.\"O most significant three bits of the address. +.\"O The network address is contained in the three most significant bytes, +.\"O and the host address occupies the remaining byte. +(¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Î) ¥¢¥É¥ì¥¹¤Î¾å°Ì¦ 3 ¥Ó¥Ã¥È¤¬¥Ð¥¤¥Ê¥êÃÍ¤Ç +110 ¤Î¾ì¹ç¡¢¤³¤Î¥¢¥É¥ì¥¹¼ïÊ̤Ȥʤ롣¤³¤Î¥¢¥É¥ì¥¹¼ïÊ̤Ǥϡ¢ +¾å°Ì 3 ¥Ð¥¤¥È¤¬¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤òɽ¤·¡¢ +»Ä¤ê¤Î 1 ¥Ð¥¤¥È¤¬¥Û¥¹¥È¥¢¥É¥ì¥¹¤òɽ¤¹¡£ +.PP +.\"O Classful network addresses are now obsolete, +.\"O having been superseded by Classless Inter-Domain Routing (CIDR), +.\"O which divides addresses into network and host components at +.\"O arbitrary bit (rather than byte) boundaries. +¥¯¥é¥¹¥Õ¥ë¡¦¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ï¸½ºß¤Ç¤ÏÇѻߤµ¤ì¡¢ +¥¯¥é¥¹¥ì¥¹¡¦¥É¥á¥¤¥ó´Ö¥ë¡¼¥Á¥ó (CIDR) ¤Ë¼è¤Ã¤ÆÂå¤ï¤é¤ì¤¿¡£ +CIDR ¤Ç¤Ï¡¢¥¢¥É¥ì¥¹¤òǤ°Õ¤Î¥Ó¥Ã¥È¶­³¦ (¥Ð¥¤¥È¶­³¦¤Ç¤Ï¤Ê¤¤) ¤Ç +¥Í¥Ã¥È¥ï¡¼¥¯Éô¤È¥Û¥¹¥ÈÉô¤Ëʬ³ä¤¹¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O An example of the use of +.\"O .BR inet_aton () +.\"O and +.\"O .BR inet_ntoa () +.\"O is shown below. +.\"O Here are some example runs: +°Ê²¼¤Ï +.BR inet_aton () +¤È +.BR inet_ntoa () +¤Î»ÈÍÑÎã¤Ç¤¢¤ë¡£¤³¤Î¤è¤¦¤Ë¼Â¹Ô¤¹¤ë¡£ +.in +4n +.nf + +.RB "$" " ./a.out 226.000.000.037" " # Last byte is in octal" +226.0.0.31 +.RB "$" " ./a.out 0x7f.1 " " # First byte is in hex" +127.0.0.1 +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#define _BSD_SOURCE +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct in_addr addr; + + if (argc != 2) { + fprintf(stderr, "%s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + if (inet_aton(argv[1], &addr) == 0) { + perror("inet_aton"); + exit(EXIT_FAILURE); + } + + printf("%s\\n", inet_ntoa(addr)); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR byteorder (3), +.BR getaddrinfo (3), +.BR gethostbyname (3), +.BR getnameinfo (3), +.BR getnetent (3), +.BR inet_ntop (3), +.BR inet_pton (3), +.BR hosts (5), +.BR networks (5) diff --git a/draft/man3/inet_ntop.3 b/draft/man3/inet_ntop.3 new file mode 100644 index 00000000..a0a9639b --- /dev/null +++ b/draft/man3/inet_ntop.3 @@ -0,0 +1,213 @@ +.\" Copyright 2000 Sam Varshavchik +.\" +.\" 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: RFC 2553 +.\" +.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. +.\" Translated 2001-01-14, NAKANO Takeo +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" +.TH INET_NTOP 3 2008-11-11 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O inet_ntop \- convert IPv4 and IPv6 addresses from binary to text form +inet_ntop \- IPv4/IPv6 ¥¢¥É¥ì¥¹¤ò¥Ð¥¤¥Ê¥ê·Á¼°¤«¤é¥Æ¥­¥¹¥È·Á¼°¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "const char *inet_ntop(int " "af" ", const void *" "src" , +.BI " char *" "dst" ", socklen_t " "size" ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This function converts the network address structure +.\"O .I src +.\"O in the +.\"O .I af +.\"O address family into a character string. +.\"O The resulting string is copied to the buffer pointed to by +.\"O .IR dst , +.\"O which must be a non-NULL pointer. +.\"O The caller specifies the number of bytes available in this buffer in +.\"O the argument +.\"O .IR size . +¤³¤Î´Ø¿ô¤Ï¡¢ +.I af +¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¹½Â¤ÂÎ +.I src +¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£ +ÊÑ´¹·ë²Ì¤Îʸ»úÎó¤Ï¡¢ +.I dst +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ +.I dst +¤Ï NULL ¤Ç¤Ê¤¤¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¸Æ¤Ó½Ð¤·»þ¤Ë¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡¤ÇÍøÍѤǤ­¤ë¥Ð¥¤¥È¿ô¤ò +°ú¤­¿ô +.I size +¤Ë»ØÄꤹ¤ë¡£ +.PP +.\"O .BR inet_ntop () +.\"O extends the +.\"O .BR inet_ntoa (3) +.\"O function to support multiple address families, +.\"O .BR inet_ntoa (3) +.\"O is now considered to be deprecated in favor of +.\"O .BR inet_ntop (). +.\"O The following address families are currently supported: +.BR inet_ntop () +¤Ï +.BR inet_ntoa (3) +´Ø¿ô¤ò³ÈÄ¥¤·¤ÆÊ£¿ô¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤ò°·¤¨¤ë¤è¤¦¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +º£¸å¤Ï +.BR inet_ntoa (3) +¤Ï»È¤ï¤º¡¢ +.BR inet_ntop () +¤ò»È¤¦¤è¤¦¤Ë¤¹¤ë¤ÈÎɤ¤¤À¤í¤¦¡£ +¸½ºß¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ï°Ê²¼¤ÎÄ̤ê: +.TP +.B AF_INET +.\"O .I src +.\"O points to a +.\"O .I struct in_addr +.\"O (in network byte order) +.\"O which is converted to an IPv4 network address in +.\"O the dotted-decimal format, "\fIddd.ddd.ddd.ddd\fP". +.\"O The buffer +.\"O .I dst +.\"O must be at least +.\"O .B INET_ADDRSTRLEN +.\"O bytes long. +¤³¤Î¾ì¹ç +.I src +¤Ï (¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Î) +.I "struct in_addr" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤ß¤Ê¤µ¤ì¡¢¤³¤Î¹½Â¤ÂΤÎÆâÍƤ¬ +¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ô·Á¼° "\fIddd.ddd.ddd.ddd\fP" ¤Î +IPv4 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ËÊÑ´¹¤µ¤ì¤ë¡£ +¥Ð¥Ã¥Õ¥¡ +.I dst +¤Ï¾¯¤Ê¤¯¤È¤â +.B INET_ADDRSTRLEN +¥Ð¥¤¥È¤ÎŤµ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B AF_INET6 +.\"O .I src +.\"O points to a +.\"O .I struct in6_addr +.\"O (in network byte order) +.\"O which is converted to a representation of this address in the +.\"O most appropriate IPv6 network address format for this address. +.\"O The buffer +.\"O .I dst +.\"O must be at least +.\"O .B INET6_ADDRSTRLEN +.\"O bytes long. +¤³¤Î¾ì¹ç +.I src +¤Ï (¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Î) +.I "struct in6_addr" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤ß¤Ê¤µ¤ì¡¢¤³¤Î¹½Â¤ÂΤÎÆâÍƤ¬¡¢ +(¤³¤Î¥¢¥É¥ì¥¹¤ËÂФ·¤Æ¤â¤Ã¤È¤âŬÀÚ¤Ê) +IPv6 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Îɽ¼¨·Á¼°¤ËÊÑ´¹¤µ¤ì¤ë¡£ +¥Ð¥Ã¥Õ¥¡ +.I dst +¤Ï¾¯¤Ê¤¯¤È¤â +.B INET6_ADDRSTRLEN +¥Ð¥¤¥È¤ÎŤµ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR inet_ntop () +.\"O returns a non-NULL pointer to +.\"O .IR dst . +.\"O NULL is returned if there was an error, with +.\"O .I errno +.\"O set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR inet_ntop () +¤Ï +.I dst +¤Ø¤Î (NULL ¤Ç¤Ê¤¤) ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EAFNOSUPPORT +.\"O .I af +.\"O was not a valid address family. +.I af +¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ç¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOSPC +.\"O The converted address string would exceed the size given by +.\"O .IR size . +ÊÑ´¹¤µ¤ì¤¿¥¢¥É¥ì¥¹Ê¸»úÎó¤ÎŤµ¤¬ +.I size +¤Ç»ØÄꤵ¤ì¤¿¥µ¥¤¥º¤òĶ²á¤·¤Æ¤·¤Þ¤¦¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O Note that RFC\ 2553 defines a prototype where the last argument +.\"O .I size +.\"O is of type +.\"O .IR size_t . +.\"O Many systems follow RFC\ 2553. +.\"O Glibc 2.0 and 2.1 have +.\"O .IR size_t , +.\"O but 2.2 and later have +.\"O .IR socklen_t . +.\"O .\" 2.1.3: size_t, 2.1.91: socklen_t +RFC\ 2553 ¤Ç¤ÏºÇ¸å¤Î°ú¤­¿ô +.I size +¤Î¥×¥í¥È¥¿¥¤¥×¤ò +.I size_t +·¿¤ÈÄêµÁ¤·¤Æ¤¤¤ë¡£Â¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï RFC\ 2553 ¤Ë¤·¤¿¤¬¤Ã¤Æ¤¤¤ë¡£ +glibc 2.0 ¤È 2.1 ¤Ç¤Ï +.I size_t +¤À¤¬¡¢ +glibc 2.2 °Ê¹ß¤Ç¤Ï +.I socklen_t +¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" 2.1.3: size_t, 2.1.91: socklen_t +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O .B AF_INET6 +.\"O converts IPv6-mapped IPv4 addresses into an IPv6 format. +.B AF_INET6 +¤Ï IPv4 ¤¬¥Þ¥Ã¥×¤µ¤ì¤¿ IPv6 ¥¢¥É¥ì¥¹¤ò +IPv6 ·Á¼°¤ËÊÑ´¹¤·¤Æ¤·¤Þ¤¦¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O See +.\"O .BR inet_pton (3). +.BR inet_pton (3) +¤ò»²¾È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getnameinfo (3), +.BR inet (3), +.BR inet_pton (3) diff --git a/draft/man3/inet_pton.3 b/draft/man3/inet_pton.3 new file mode 100644 index 00000000..f93ba07d --- /dev/null +++ b/draft/man3/inet_pton.3 @@ -0,0 +1,348 @@ +.\" Copyright 2000 Sam Varshavchik +.\" 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: RFC 2553 +.\" +.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. +.\" Translated 2001-01-14, NAKANO Takeo +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" +.TH INET_PTON 3 2008-06-18 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O inet_pton \- convert IPv4 and IPv6 addresses from text to binary form +.SH ̾Á° +inet_pton \- IPv4/IPv6 ¥¢¥É¥ì¥¹¤ò¥Æ¥­¥¹¥È·Á¼°¤«¤é¥Ð¥¤¥Ê¥ê·Á¼°¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "int inet_pton(int " "af" ", const char *" "src" ", void *" "dst" ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This function converts the character string +.\"O .I src +.\"O into a network address structure in the +.\"O .I af +.\"O address family, then +.\"O copies +.\"O the network address structure to +.\"O .IR dst . +¤³¤Î´Ø¿ô¤Ïʸ»úÎó +.I src +¤ò¡¢¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼ +.I af +¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¹½Â¤ÂΤËÊÑ´¹¤·¡¢ +.I dst +¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +.\"O The +.\"O .I af +.\"O argument must be either +.\"O .B AF_INET +.\"O or +.\"O .BR AF_INET6 . +.I af +°ú¤­¿ô¤Ï +.B AF_INET +¤« +.B AF_INET6 +¤Î¤É¤Á¤é¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The following address families are currently supported: +¸½ºß¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.TP +.B AF_INET +.\"O .I src +.\"O points to a character string containing an IPv4 network address in +.\"O dotted-decimal format, "\fIddd.ddd.ddd.ddd\fP", where +.\"O .I ddd +.\"O is a decimal number of up to three digits in the range 0 to 255. +.\"O The address is converted to a +.\"O .I struct in_addr +.\"O and copied to +.\"O .IR dst , +.\"O which must be +.\"O .I sizeof(struct in_addr) +.\"O (4) bytes (32 bits) long. +.I src +¤Ï¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ô·Á¼° "\fIddd.ddd.ddd.ddd\fP" +¤Î IPv4 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I ddd +¤Ï 0 ¤«¤é 255 ¤Þ¤Ç¤ÎÈϰϤκÇÂç 3 ·å¤Î 10 ¿Ê¿ô¤Ç¤¢¤ë¡£ +¤³¤Î¥¢¥É¥ì¥¹¤Ï +.I "struct in_addr" +¤ËÊÑ´¹¤µ¤ì¤Æ +.I dst +¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ +.I dst +¤ÎŤµ¤Ï +.I "sizeof(struct in_addr)" +(4) ¥Ð¥¤¥È (32¥Ó¥Ã¥È) ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B AF_INET6 +.\"O .I src +.\"O points to a character string containing an IPv6 network address. +.\"O The address is converted to a +.\"O .I struct in6_addr +.\"O and copied to +.\"O .IR dst , +.\"O which must be +.\"O .I sizeof(struct in6_addr) +.\"O (16) bytes (128 bits) long. +.I src +¤Ï IPv6 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬³ÊǼ¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤³¤Î¥¢¥É¥ì¥¹¤Ï +.I "struct in6_addr" +¤ËÊÑ´¹¤µ¤ì¤Æ +.I dst +¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ +.I dst +¤ÎŤµ¤Ï +.I "sizeof(struct in6_addr)" +(16) ¥Ð¥¤¥È (128 ¥Ó¥Ã¥È) ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O The allowed formats for IPv6 addresses follow these rules: +°Ê²¼¤Î 3 ¤Ä¤Î¥ë¡¼¥ë¤Ë¤·¤¿¤¬¤Ã¤¿·Á¼°¤¬ IPv6 ¥¢¥É¥ì¥¹¤È¤·¤ÆÆþÎϤǤ­¤ë¡£ +.RS +.IP 1. 3 +.\"O The preferred format is +.\"O .IR x:x:x:x:x:x:x:x . +.\"O This form consists of eight hexadecimal numbers, +.\"O each of which expresses a 16-bit value (i.e., each +.\"O .I x +.\"O can be up to 4 hex digits). +¿ä¾©·Á¼°¤Ï +.I x:x:x:x:x:x:x:x +¤Ç¤¢¤ë¡£¤³¤Î·Á¼°¤Ï 8 ¸Ä¤Î 16 ¿Ê¿ô¤«¤é¹½À®¤µ¤ì¡¢ +³Æ¡¹¤Î 16 ¿Ê¿ô¤Ï 16 ¥Ó¥Ã¥ÈÃͤòɽ¤¹ +.RI ( x +¤ÏºÇÂç 4 ·å¤Î 16 ¿Ê¿ô¤Ç¤¢¤ë)¡£ +.IP 2. +.\"O A series of contiguous zero values in the preferred format +.\"O can be abbreviated to +.\"O .IR :: . +.\"O Only one instance of +.\"O .I :: +.\"O can occur in an address. +.\"O For example, the loopback address +.\"O .I 0:0:0:0:0:0:0:1 +.\"O can be abbreviated as +.\"O .IR ::1 . +.\"O The wildcard address, consisting of all zeroes, can be written as +.\"O .IR :: . +¿ä¾©·Á¼°¤ÎÃæ¤ÎϢ³¤¹¤ë 0 ¤ÎÎó¤Ï +.I :: +¤Ëû½Ì¤Ç¤­¤ë¡£¥¢¥É¥ì¥¹Ãæ¤Ç»ÈÍѤǤ­¤ë +.I :: +¤Ï 1 ¸Ä¤À¤±¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢¥ë¡¼¥×¥Ð¥Ã¥¯¥¢¥É¥ì¥¹ +.I 0:0:0:0:0:0:0:1 +¤Ï +.I ::1 +¤Èû½Ì¤Ç¤­¤ë¡£ +Á´¥Ó¥Ã¥È¤¬ 0 ¤Ç¹½À®¤µ¤ì¤ë¥ï¥¤¥ë¥É¥«¡¼¥É¥¢¥É¥ì¥¹¤Ï +.I :: +¤Èµ­ºÜ¤Ç¤­¤ë¡£ +.IP 3. +.\"O An alternate format is useful for expressing IPv4-mapped IPv6 addresses. +.\"O This form is written as +.\"O .IR x:x:x:x:x:x:d.d.d.d , +.\"O where the six leading +.\"O .IR x s +.\"O are hexadecimal values that define the six most-significant +.\"O 16-bit pieces of the address (i.e., 96 bits), and the +.\"O .IR d s +.\"O express a value in dotted-decimal notation that +.\"O defines the least significant 32 bits of the address. +.\"O An example of such an address is +.\"O .IR ::FFFF:204.152.189.116 . +IPv4 ¤ò¥Þ¥Ã¥Ô¥ó¥°¤·¤¿ IPv6 ¥¢¥É¥ì¥¹¤òɽµ­¤¹¤ë¤Ë¤ÏÊ̤ηÁ¼°¤¬ÊØÍø¤Ç¤¢¤ë¡£ +¤³¤ÎÊ̤ηÁ¼°¤Ï +.I x:x:x:x:x:x:d.d.d.d +¤È½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ +ºÇ½é¤Î 6 ¸Ä¤Î +.I x +¤Ï¥¢¥É¥ì¥¹¤ò 16 ¥Ó¥Ã¥Èñ°Ì¤Ë¶èÀڤ俤Ȥ­¤Î¾å°Ì¦ 6 ¸Äʬ (¤Ä¤Þ¤ê 96 ¥Ó¥Ã¥Èʬ) +¤òÄêµÁ¤¹¤ë 16 ¿Ê¿ô¤Ç¤¢¤ê¡¢ +.I d +¤ÎÉôʬ¤Ï¥¢¥É¥ì¥¹¤Î²¼°Ì 32 ¥Ó¥Ã¥È¤ò¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ôɽµ­¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.I ::FFFF:204.152.189.116 +¤Ï¤³¤Î·Á¼°¤ÎÎã¤Ç¤¢¤ë¡£ +.RE +.IP +.\"O See RFC 2373 for further details on the representation of IPv6 addresses. +IPv6 ¥¢¥É¥ì¥¹¤Îɽ¸½ÊýË¡¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï RFC 2373 ¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR inet_pton () +.\"O returns 1 on success (network address was successfully converted). +.\"O 0 is returned if +.\"O .I src +.\"O does not contain a character string representing a valid network +.\"O address in the specified address family. +.\"O If +.\"O .I af +.\"O does not contain a valid address family, \-1 is returned and +.\"O .I errno +.\"O is set to +.\"O .BR EAFNOSUPPORT . +À®¸ù¤¹¤ë (¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬Àµ¾ï¤ËÊÑ´¹¤µ¤ì¤ë) ¤È¡¢ +.BR inet_pton () +¤Ï 1 ¤òÊÖ¤¹¡£ +.I src +¤¬»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤ËÂФ¹¤ë +Àµ¤·¤¤¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹É½µ­¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +0 ¤òÊÖ¤¹¡£ +.I af +¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B EAFNOSUPPORT +¤òÀßÄꤹ¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Unlike +.\"O .BR inet_aton (3) +.\"O and +.\"O .BR inet_addr (3), +.\"O .BR inet_pton () +.\"O supports IPv6 addresses. +.BR inet_aton (3) +¤ä +.BR inet_addr (3) +¤È°Û¤Ê¤ê¡¢ +.BR inet_pton () +¤Ï IPv6 ¥¢¥É¥ì¥¹¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +.\"O On the other hand, +.\"O .BR inet_pton () +.\"O only accepts IPv4 addresses in dotted-decimal notation, whereas +.\"O .BR inet_aton (3) +.\"O and +.\"O .BR inet_addr (3) +.\"O allow the more general numbers-and-dots notation (hexadecimal +.\"O and octal number formats, and formats that don't require all +.\"O four bytes to be explicitly written). +.\"O For an interface that handles both IPv6 addresses, and IPv4 +.\"O addresses in numbers-and-dots notation, see +.\"O .BR getaddrinfo (3). +°ìÊý¤Ç¡¢ +.BR inet_pton () +¤¬¼õ¤±ÉÕ¤±¤ë IPv4 ¥¢¥É¥ì¥¹¤Ï¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ôɽµ­¤À¤±¤Ç¤¢¤ë¡£ +¤³¤ì¤ËÂФ·¡¢ +.BR inet_aton (3) +¤ä +.BR inet_addr (3) +¤Ç¤Ï¤â¤Ã¤È°ìÈÌŪ¤Ê¥É¥Ã¥È¶èÀÚ¤ê¤Î¿ô»úɽµ­ (16 ¿Ê¿ô¤ä 8 ¿Ê¿ô¤Î·Á¼°¤ä¡¢ +4 ¥Ð¥¤¥ÈÁ´¤Æ¤òÌÀ¼¨Åª¤Ë½ñ¤«¤Ê¤¯¤Æ¤â¤è¤¤·Á¼°) ¤¬»ÈÍѤǤ­¤ë¡£ +¥É¥Ã¥È¶èÀÚ¤ê¤Î¿ô»úɽµ­¤Ç IPv6 ¥¢¥É¥ì¥¹¤È IPv4 ¥¢¥É¥ì¥¹¤ÎξÊý¤ò°·¤¨¤ë +¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR getaddrinfo (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O .B AF_INET6 +.\"O does not recognize IPv4 addresses. +.\"O An explicit IPv4-mapped IPv6 address must be supplied in +.\"O .I src +.\"O instead. +.B AF_INET6 +¤Ï IPv4 ¥¢¥É¥ì¥¹¤òǧ¼±¤·¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë IPv4 ¥¢¥É¥ì¥¹¤ò¥Þ¥Ã¥Ô¥ó¥°¤·¤¿ IPv6 ¥¢¥É¥ì¥¹¤ò +.I src +¤ËÍ¿¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The program below demonstrates the use of +.\"O .BR inet_pton () +.\"O and +.\"O .BR inet_ntop (3). +.\"O Here are some example runs: +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï +.BR inet_pton () +¤È +.BR inet_ntop (3) +¤Î»ÈÍÑÎã¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£ +¼Â¹Ô¤¹¤ë¤È°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£ +.in +4n +.nf + +.RB "$" " ./a.out i6 0:0:0:0:0:0:0:0" +:: +.RB "$" " ./a.out i6 1:0:0:0:0:0:0:8" +1::8 +.RB "$" " ./a.out i6 0:0:0:0:0:FFFF:204.152.189.116" +::ffff:204.152.189.116 +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + unsigned char buf[sizeof(struct in6_addr)]; + int domain, s; + char str[INET6_ADDRSTRLEN]; + + if (argc != 3) { + fprintf(stderr, "Usage: %s {i4|i6|} string\\n", argv[0]); + exit(EXIT_FAILURE); + } + + domain = (strcmp(argv[1], "i4") == 0) ? AF_INET : + (strcmp(argv[1], "i6") == 0) ? AF_INET6 : atoi(argv[1]); + + s = inet_pton(domain, argv[2], buf); + if (s <= 0) { + if (s == 0) + fprintf(stderr, "Not in presentation format"); + else + perror("inet_pton"); + exit(EXIT_FAILURE); + } + + if (inet_ntop(domain, buf, str, INET6_ADDRSTRLEN) == NULL) { + perror("inet_ntop"); + exit(EXIT_FAILURE); + } + + printf("%s\\n", str); + + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getaddrinfo (3), +.BR inet (3), +.BR inet_ntop (3) diff --git a/draft/man3/infnan.3 b/draft/man3/infnan.3 new file mode 100644 index 00000000..a68a3ad1 --- /dev/null +++ b/draft/man3/infnan.3 @@ -0,0 +1,109 @@ +.\" 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 Sat Jul 24 19:11:11 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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 +.SH ̾Á° +.\"O infnan \- deal with infinite or not-a-number (NaN) result +infnan \- ̵¸ÂÂç¤È̵¸úÃÍ (NaN) ¤ò¼è°·¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "double infnan(int " error ); +.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" +.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 +¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O If \fIerror\fP is \-\fBERANGE\fP (\-Infinity), \-\fBHUGE_VAL\fP is returned. +\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). +\fIerror\fP ¤ÎÃͤ¬Ìµ¸úÃÍ (NaN) ¤Ç¤¢¤ë¡£ +.TP +.B ERANGE +.\"O The value of \fIerror\fP is positive infinity or negative infinity. +\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 ¤Ç¤ÏÄ󶡤µ¤ì¤Æ¤¤¤Ê¤¤¡£ diff --git a/draft/man3/initgroups.3 b/draft/man3/initgroups.3 new file mode 100644 index 00000000..289eb755 --- /dev/null +++ b/draft/man3/initgroups.3 @@ -0,0 +1,121 @@ +.\" 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-07-24 by Rik Faith +.\" Modified 2004-10-10 by aeb +.\" +.\" Japanese Version Copyright (c) 1998 +.\" ISHIKAWA Mutsumi, all rights reserved. +.\" Translated 1998-05-23, ISHIKAWA Mutsumi +.\" Updated 2002-01-09, Kentaro Shirakata +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" +.TH INITGROUPS 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O initgroups \- initialize the supplementary group access list +initgroups \- ÄɲäΥ°¥ë¡¼¥×¥¢¥¯¥»¥¹¥ê¥¹¥È¤Î½é´ü²½ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "int initgroups(const char *" user ", gid_t " group ); +.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 initgroups (): +_BSD_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR initgroups () +.\"O function initializes the group access list by +.\"O reading the group database \fI/etc/group\fP and using all groups of +.\"O which \fIuser\fP is a member. +.\"O The additional group \fIgroup\fP is +.\"O also added to the list. +.BR initgroups () +´Ø¿ô¤Ï¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹ \fI/etc/group\fP ¤òÆÉ¤ß +¹þ¤ó¤Ç¡¢\fIuser\fP ¤¬½ê°¤·¤Æ¤¤¤ëÁ´¤Æ¤Î¥°¥ë¡¼¥×¤ò»È¤Ã¤Æ¡¢¥°¥ë¡¼¥×¥¢¥¯ +¥»¥¹¥ê¥¹¥È¤ò½é´ü²½¤¹¤ë¡£¤µ¤é¤Ë¡¢\fIgroup\fP ¤Ë¼¨¤µ¤ì¤ë¥°¥ë¡¼¥×¤â¥°¥ë¡¼ +¥×¥¢¥¯¥»¥¹¥ê¥¹¥È¤ËÄɲ䵤ì¤ë¡£ + +.\"O The +.\"O .I user +.\"O argument must be non-NULL. +.I user +°ú¿ô¤Ï NULL ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR initgroups () +.\"O function returns 0 on success. +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +.BR initgroups () +´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +.\"O Insufficient memory to allocate group information structure. +¥°¥ë¡¼¥×¾ðÊó¹½Â¤ÂΤòÇÛÃÖ¤¹¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ­¤·¤Æ¤¤¤ë¡£ +.TP +.B EPERM +.\"O The calling process has insufficient privilege. +.\"O See the underlying system call +.\"O .BR setgroups (2). +¸Æ½Ð¤·¥×¥í¥»¥¹¤¬½½Ê¬¤ÊÆø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤Î΢¤Ç¼Â¹Ô¤µ¤ì¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR setgroups (2) +¤â»²¾È¤Î¤³¤È¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.nf +.\"O \fI/etc/group\fP group database file +\fI/etc/group\fP ¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.fi +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getgroups (2), +.BR setgroups (2), +.BR credentials (7) diff --git a/draft/man3/insque.3 b/draft/man3/insque.3 new file mode 100644 index 00000000..ce78ef58 --- /dev/null +++ b/draft/man3/insque.3 @@ -0,0 +1,120 @@ +.\" peter memishian -- meem@gnu.ai.mit.edu +.\" $Id: insque.3,v 1.2 1996/10/30 21:03:39 meem Exp meem $ +.\" +.\" 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 (5.4.7) +.\" Solaris 2.x, OSF/1, and HP-UX manpages +.\" Curry's "UNIX Systems Programming for SVR4" (O'Reilly & Associates 1996) +.\" +.\" Changed to POSIX, 2003-08-11, aeb+wh +.\" +.\" Japanese Version Copyright (c) 1998 AKAMATSU Kazuo +.\" all rights reserved. +.\" Translated Thu Jan 7 16:00 JST 1999 +.\" by AKAMATSU Kazuo +.\" Updated Sun Sep 14 JST 2003 by Kentaro Shirakata +.\" +.TH INSQUE 3 2008-07-11 "" "Linux Programmer's Manual" +.SH ̾Á° +insque, remque \- ¥­¥å¡¼¤Ë¥¢¥¤¥Æ¥à¤òÁÞÆþ/ºï½ü¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void insque(void *" elem ", void *" prev ); + +.BI "void remque(void *" elem ); +.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 insque (), +.BR remque (): +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.\"O .BR insque () +.\"O and +.\"O .BR remque () +.\"O are functions for manipulating +.\"O doubly-linked lists. +.\"O Each element in the list is a structure of +.\"O which the first two structure elements are a forward and a +.\"O backward pointer. +.BR insque () +¤È +.BR remque () +¤ÏÁÐÊý¸þÏ¢·ë¥ê¥¹¥È (doubly-linked list) ¤òÁàºî¤¹¤ë´Ø¿ô¤Ç¤¢¤ë¡£ +¥ê¥¹¥ÈÃæ¤Î¤½¤ì¤¾¤ì¤ÎÍ×ÁǤϡ¢ºÇ½é¤ÎÆó¤Ä¤Î¹½Â¤ÂÎÍ×ÁǤ¬ +¼¡¤ÈÁ°¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤è¤¦¤Ê¹½Â¤ÂΤǤ¢¤ë¡£ + +.BR insque () +¤Ï \fIelem\fP ¤Ç¼¨¤µ¤ì¤ëÍ×ÁǤò \fIprev\fP ¤Ç¼¨¤µ¤ì¤ë +Í×ÁǤÎľ¸å¤ËÁÞÆþ¤¹¤ë¡£ \fIprev\fP ¤Ï NULL ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +.BR remque () +¤Ï \fIelem\fP ¤Ç¼¨¤µ¤ì¤ëÍ×ÁǤòÁÐÊý¸þÏ¢·ë¥ê¥¹¥È¤«¤é¼è¤ê½ü¤¯¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH "NOTES" +.SH Ãí°Õ +.\"O Traditionally (e.g., SunOS, Linux libc 4 and libc 5), +.\"O the arguments of these functions were of type \fIstruct qelem *\fP, +.\"O defined as: +ÅÁÅýŪ¤Ë (SunOS, Linux libc 4,5 ¤Ç¤Ï) ¤³¤ì¤é¤Î´Ø¿ô¤Î°ú¿ô¤Ï +\fIstruct qelem *\fP·¿¤Ç¤¢¤ê¡¢¤³¤ì¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct qelem { + struct qelem *q_forw; + struct qelem *q_back; + char q_data[1]; +}; +.fi +.in + +.\"O This is still what you will get if +.\"O .B _GNU_SOURCE +.\"O is defined before +.\"O including \fI\fP. +¤³¤ÎÄêµÁ¤Ï \fI\fP ¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëÁ°¤Ë +.B _GNU_SOURCE +¤òÄêµÁ¤¹¤ë¤³¤È¤ÇÆÀ¤é¤ì¤ë¡£ + +.\"O The location of the prototypes for these functions differs among several +.\"O versions of Unix. +.\"O The above is the POSIX version. +.\"O Some systems place them in \fI\fP. +.\"O Linux libc4 and libc 5 placed them +.\"O in \fI\fP. +¤³¤ì¤é¤Î´Ø¿ô¤Î¥×¥í¥È¥¿¥¤¥×¤ÎÃÖ¤«¤ì¤ë¾ì½ê¤Ï¡¢Unix ¤Î¼ïÎà¤Ë¤è¤ê°Û¤Ê¤ë¡£ +¾åµ­¤Ï POSIX ÈǤǤ¢¤ë¡£ +\fI\fP ¤Ë¤¢¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +Linux libc4 ¤È libc5 ¤Ï \fI\fP ¤Ë¥×¥í¥È¥¿¥¤¥×¤òÃÖ¤¤¤Æ¤¤¤ë¡£ diff --git a/draft/man3/intro.3 b/draft/man3/intro.3 new file mode 100644 index 00000000..79f300d5 --- /dev/null +++ b/draft/man3/intro.3 @@ -0,0 +1,156 @@ +.\" 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. +.\" +.\" 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-02-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O intro \- Introduction to library functions +.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 ¾Ï¤ÇÀâÌÀ¤µ¤ì¤¿ +¥é¥¤¥Ö¥é¥ê´Ø¿ô (¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥é¥Ã¥Ñ¡¼) ¤ò½ü¤¤¤¿ +Á´¤Æ¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤ë¡£ + +.\"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 +¤Ç¤¢¤ë)¡£ + +.\"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 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: +.\" ¾ÏÈÖ¹æ¤ËÉÕ¤±²Ã¤¨¤é¤ì¤Æ¤¤¤ëʸ»ú¤Ë¤è¤Ã¤Æ¼±Ê̤Ǥ­¤ëÍÍ¡¹¤Ê´Ø¿ô¤Î¥°¥ë¡¼¥×¤¬¤¢¤ë: +.\" .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 Ãæ¤Ë´Þ¤Þ¤ì¤ë¤â¤Î¤Ç¤¢¤ê¡¢ +.\" ¥Ç¥Õ¥©¥ë¥È¤Ç +.\" .BR cc (1) +.\" ¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¤Ç¤¢¤í¤¦¡£ +.\" .IP (3S) +.\"O .\" These functions are parts of the +.\"O .\" .BR stdio (3) +.\"O .\" library. They are contained in the standard C library libc. +.\" ¤³¤ì¤é¤Î´Ø¿ô¤Ï +.\" .BR stdio (3) +.\" ¥é¥¤¥Ö¥é¥ê¤Î°ìÉô¤Ç¤¢¤ë¡£É¸½àC¥é¥¤¥Ö¥é¥ê 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 ¤Ë´Þ¤Þ¤ì¤ë¡£¤³¤ì¤é¤Ï +.\" ¥Ç¥Õ¥©¥ë¥È¤Ç +.\" .BR f77 (1) +.\" ¥Õ¥©¡¼¥È¥é¥ó¥³¥ó¥Ñ¥¤¥é¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¡¢¤·¤«¤· +.\" .BR cc (1) +.\" C¥³¥ó¥Ñ¥¤¥é¤Ç»ÈÍѤ¹¤ë¤È¤­¤Ï¡¢\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 ¤Î°ìÉô¤Ç¤¢¤ë¡£ +.\" ¤³¤ì¤é¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤¿¤á¤ËÆÃÊ̤ʥ³¥ó¥Ñ¥¤¥é¥Õ¥é¥°¤ÏɬÍפʤ¤¡£ +.\" .IP (3X) +.\"O .\" Various special libraries. The manual pages documenting their functions +.\"O .\" specify the library names. +.\" ÍÍ¡¹¤ÊÆÃÊ̤ʥ饤¥Ö¥é¥ê¤Ç¤¢¤ë¡£¤³¤ì¤é¤Î´Ø¿ô¤òʸ½ñ²½¤·¤¿¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï +.\" ¥é¥¤¥Ö¥é¥ê̾¤ò»ØÄꤹ¤ë¡£ +.\"O .SH "CONFORMING TO" +.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 +.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 feature_test_macros (7), +.BR libc (7), +.BR standards (7) diff --git a/draft/man3/isalpha.3 b/draft/man3/isalpha.3 new file mode 100644 index 00000000..e9b5094e --- /dev/null +++ b/draft/man3/isalpha.3 @@ -0,0 +1,293 @@ +.\" 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:10:00 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Aug 21 17:51:50 1994 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sat Sep 2 21:52:01 1995 by Jim Van Zandt +.\" Modified Mon May 27 22:55:26 1996 by Martin Schulze (joey@linux.de) +.\" +.\" Japanese Version Copyright (c) 1997 Ueyama Rui +.\" all rights reserved. +.\" Translated 1997-08-29, Ueyama Rui +.\" Updated 1999-07-16, Kentaro Shirakata +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" +.TH ISALPHA 3 2009-03-15 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower, +.\"O isprint, ispunct, isspace, isupper, isxdigit \- character +.\"O classification routines +isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower, +isprint, ispunct, isspace, isupper, isxdigit \- ʸ»ú¤òʬÎह¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int isalnum(int " "c" ); +.br +.BI "int isalpha(int " "c" ); +.br +.BI "int isascii(int " "c" ); +.br +.BI "int isblank(int " "c" ); +.br +.BI "int iscntrl(int " "c" ); +.br +.BI "int isdigit(int " "c" ); +.br +.BI "int isgraph(int " "c" ); +.br +.BI "int islower(int " "c" ); +.br +.BI "int isprint(int " "c" ); +.br +.BI "int ispunct(int " "c" ); +.br +.BI "int isspace(int " "c" ); +.br +.BI "int isupper(int " "c" ); +.br +.BI "int isxdigit(int " "c" ); +.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 isascii (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.br +.BR isblank (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These functions check whether +.\"O .IR c , +.\"O which must have the value of an +.\"O .I unsigned char +.\"O or +.\"O .BR EOF , +.\"O falls into a certain character class according to the current locale. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Ë½¾¤Ã¤Æ +.I c +¤òʬÎह¤ë¡£ +.I c +¤Ï +.I unsigned char +¤« +.B EOF +¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BR isalnum () +.\"O checks for an alphanumeric character; it is equivalent to +.\"O .BI "(isalpha(" c ") || isdigit(" c "))" \fR. +±Ñ»ú¤Þ¤¿¤Ï¿ô»ú¤Ç¤¢¤ë¤«¤òÄ´¤Ù¤ë¡£ +.BI "(isalpha(" c ") || isdigit(" c "))" \fR +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.TP +.BR isalpha () +.\"O checks for an alphabetic character; in the standard \fB"C"\fP +.\"O locale, it is equivalent to +.\"O .BI "(isupper(" c ") || islower(" c "))" \fR. +.\"O In some locales, there may be additional characters for which +.\"O .BR isalpha () +.\"O is true\-\-letters which are neither upper case nor lower +.\"O case. +¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤«¤É¤¦¤«Ä´¤Ù¤ë¡£É¸½à¤Î \fB"C"\fP ¥í¥±¡¼¥ë¤Ç¤Ï +.BI "(isupper(" c ") || islower(" c "))" \fR +¤ÈÅù²Á¤Ç¤¢¤ë¡£Â¾¤Î¥í¥±¡¼¥ë¤Ç¤Ï¡¢Âçʸ»ú¤Ç¤â¾®Ê¸»ú¤Ç¤â¤Ê¤¤Â¾¤Îʸ»ú¤Ç¤â +.BR isalpha () +¤¬ true ¤òÊÖ¤¹¤³¤È¤¬¤¢¤ë¡£ +.TP +.BR isascii () +.\"O checks whether \fIc\fP is a 7-bit +.\"O .I unsigned char +.\"O value that fits into +.\"O the ASCII character set. +\fIc\fP ¤¬¡¢ASCIIʸ»ú¥»¥Ã¥È¤Ë¹çÃפ¹¤ë 7¥Ó¥Ã¥È¤Î +.I unsigned char +¤Ç¤¢¤ë¤«¤òÄ´¤Ù¤ë¡£ +.TP +.BR isblank () +.\"O checks for a blank character; that is, a space or a tab. +¶õÇòʸ»ú (¥¹¥Ú¡¼¥¹¤«¥¿¥Ö) ¤Ç¤¢¤ë¤«¤òÄ´¤Ù¤ë¡£ +.TP +.BR iscntrl () +.\"O checks for a control character. +À©¸æʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.TP +.BR isdigit () +.\"O checks for a digit (0 through 9). +¿ô»ú (0¡Á9) ¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.TP +.BR isgraph () +.\"O checks for any printable character except space. +ɽ¼¨²Äǽ¤Êʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£¥¹¥Ú¡¼¥¹¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +.TP +.BR islower () +.\"O checks for a lower-case character. +¾®Ê¸»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.TP +.BR isprint () +.\"O checks for any printable character including space. +ɽ¼¨²Äǽ¤Êʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£¥¹¥Ú¡¼¥¹¤â´Þ¤Þ¤ì¤ë¡£ +.TP +.BR ispunct () +.\"O checks for any printable character which is not a space or an +.\"O alphanumeric character. +ɽ¼¨²Äǽ¤Êʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£¥¹¥Ú¡¼¥¹¤È±Ñ¿ô»ú¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +.TP +.BR isspace () +.\"O checks for white-space characters. +.\"O In the +.\"O .B """C""" +.\"O and +.\"O .B """POSIX""" +.\"O locales, these are: space, form-feed +.\"O .RB ( \(aq\ef\(aq ), +.\"O newline +.\"O .RB ( \(aq\en\(aq ), +.\"O carriage return +.\"O .RB ( \(aq\er\(aq ), +.\"O horizontal tab +.\"O .RB ( \(aq\et\(aq ), +.\"O and vertical tab +.\"O .RB ( \(aq\ev\(aq ). +.\"O .TP +.\"O .BR isupper () +.\"O checks for an uppercase letter. +¶õÇòʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.B """C""" +¥í¥±¡¼¥ë¤« +.B """POSIX""" +¥í¥±¡¼¥ë¤Ç¤Ï¡¢¶õÇòʸ»ú¤È¤Ï¡¢¥¹¥Ú¡¼¥¹¡¢¥Õ¥©¡¼¥à¥Õ¥£¡¼¥É +.RB ( \(aq\ef\(aq ) +¡¢²þ¹Ô(newline) +.RB ( \(aq\en\(aq ) +¡¢Éüµ¢(carriage return) +.RB ( \(aq\er\(aq ) +¡¢¿åÊ¿¥¿¥Ö +.RB ( \(aq\et\(aq ) +¡¢¿âľ¥¿¥Ö +.RB ( \(aq\ev\(aq ) +¤Ç¤¢¤ë¡£ +.TP +.BR isupper () +.\"O checks for an uppercase letter. +¾®Ê¸»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.TP +.BR isxdigit () +.\"O checks for a hexadecimal digits, that is, one of +.\"O .br +.\"O .BR "0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F" . +16¿Ê¿ô¤Ç¤Î¿ô»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.br +.B "0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F" +¤Îʸ»ú¤Ç¤¢¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¤³¤È¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The values returned are nonzero if the character +.\"O .I c +.\"O falls into the tested class, and a zero value +.\"O if not. +ʸ»ú +.I c +¤¬Ä´¤Ù¤¿Ê¸»ú¤Î¼ïÎà¤Ë¹ç¤Ã¤Æ¤¤¤ì¤Ð 0 °Ê³°¤òÊÖ¤¹¡£ +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O C99, 4.3BSD. +.\"O C89 specifies all of these functions except +.\"O .BR isascii () +.\"O and +.\"O .BR isblank (). +.\"O .BR isascii () +.\"O is a BSD extension +.\"O and is also an SVr4 extension. +.\"O .BR isblank () +.\"O conforms to POSIX.1-2001 and C99 7.4.1.3. +C99, 4.3BSD. +C89 ¤Ç¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤Î¤¦¤Á +.BR isascii () +¤È +.BR isblank () +°Ê³°¤Î +¤¹¤Ù¤Æ¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.BR isascii () +¤Ï BSD ¤ä SVr4 ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.BR isblank () +¤Ï POSIX.1-2001 ¤È C99 7.4.1.3 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.\"O POSIX.1-2008 marks +.\"O .BR isascii () +.\"O as obsolete, +.\"O noting that it cannot be used portably in a localized application. +POSIX.1-2008 ¤Ï¡¢ +.BR isascii () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +¥í¡¼¥«¥é¥¤¥º¤µ¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢°Ü¿¢À­¤ò³ÎÊݤ·¤Ä¤Ä¡¢ +¤³¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The details of what characters belong into which class depend on the current +.\"O locale. +.\"O For example, +.\"O .BR isupper () +.\"O will not recognize an A-umlaut (\(:A) as an uppercase letter in the default +.\"O .B "C" +.\"O locale. +¤¢¤ëʸ»ú¤¬¤É¤Î¼ïÎà¤ËÆþ¤ë¤«¤È¤¤¤¦¤³¤È¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Ë°Í¸¤¹¤ë¡£ +¤¿¤È¤¨¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤Î +.B "C" +¥í¥±¡¼¥ë¤Ç¤Ï +.BR isupper () +¤Ï A ¤Î¥¦¥à¥é¥¦¥È¤òǧ¼±¤Ç¤­¤Ê¤¤¤Î¤Ç¡¢¤½¤ì¤¬Âçʸ»ú¤À¤È¤¤¤¦¤³¤È¤¬¤ï¤«¤é¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iswalnum (3), +.BR iswalpha (3), +.BR iswblank (3), +.BR iswcntrl (3), +.BR iswdigit (3), +.BR iswgraph (3), +.BR iswlower (3), +.BR iswprint (3), +.BR iswpunct (3), +.BR iswspace (3), +.BR iswupper (3), +.BR iswxdigit (3), +.BR setlocale (3), +.BR toascii (3), +.BR tolower (3), +.BR toupper (3), +.BR ascii (7), +.BR locale (7) diff --git a/draft/man3/isatty.3 b/draft/man3/isatty.3 new file mode 100644 index 00000000..f59a1868 --- /dev/null +++ b/draft/man3/isatty.3 @@ -0,0 +1,95 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya +.\" all rights reserved. +.\" Translated Mon Feb 10 1997 by Hiroaki Nagoya +.\" +.TH ISATTY 3 2008-12-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O isatty \- test whether a file descriptor refers to a terminal +isatty \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Ã¼Ëö¤ò»²¾È¤·¤Æ¤¤¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int isatty(int " fd ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR isatty () +.\"O function tests whether +.\"O .I fd +.\"O is an open file descriptor referring to a terminal. +.BR isatty () +´Ø¿ô¤Ï¡¢ +.I fd +¤¬Ã¼Ëö¤ò»²¾È¤¹¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤É¤¦¤«¤ò +¥Á¥§¥Ã¥¯¤¹¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O .BR isatty () +.\"O returns 1 if +.\"O .I fd +.\"O is an open file descriptor referring to a terminal; +.\"O otherwise 0 is returned, and +.\"O .I errno +.\"O is set to indicate the error. +.BR isatty () +¤Ï¡¢ +.I fd +¤¬Ã¼Ëö¤ò»²¾È¤¹¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ì¤Ð 1 ¤òÊÖ¤¹¡£ +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O .I fd +.\"O is not a valid file descriptor. +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O .I fd +.\"O refers to a file other than a terminal. +.\"O POSIX.1-2001 specifies the error +.\"O .BR ENOTTY +.\" FIXME File a bug for this? +.\"O for this case. +.I fd +¤¬Ã¼Ëö°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¥¨¥é¡¼ +.B ENOTTY +¤òÊÖ¤¹¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fstat (2), +.BR ttyname (3) diff --git a/draft/man3/isgreater.3 b/draft/man3/isgreater.3 new file mode 100644 index 00000000..ebd168ed --- /dev/null +++ b/draft/man3/isgreater.3 @@ -0,0 +1,146 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "int isgreater(" x ", " y ); +.sp +.BI "int isgreaterequal(" x ", " y ); +.sp +.BI "int isless(" x ", " y ); +.sp +.BI "int islessequal(" x ", " y ); +.sp +.BI "int islessgreater(" x ", " y ); +.sp +.BI "int isunordered(" x ", " y ); +.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) +»²¾È): +.in +.sp +.ad l +.\"O All functions described here: +¤³¤³¤ÇÀâÌÀ¤¹¤ëÁ´¤Æ¤Î´Ø¿ô: +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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 +.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 ¤òÊÖ¤¹¡£ + +.\"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 +.SH ¥¨¥é¡¼ +.\"O No errors occur. +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99, POSIX.1-2001. +.\"O .SH NOTES +.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" +.SH ´ØÏ¢¹àÌÜ +.BR fpclassify (3), +.BR isnan (3) diff --git a/draft/man3/iswalnum.3 b/draft/man3/iswalnum.3 new file mode 100644 index 00000000..2e532a85 --- /dev/null +++ b/draft/man3/iswalnum.3 @@ -0,0 +1,111 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Aug 30 21:33:06 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:08 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWALNUM 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iswalnum \- test for alphanumeric wide character +iswalnum \- ±Ñ¿ô»ú¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswalnum(wint_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iswalnum () +.\"O function is the wide-character equivalent of the +.\"O .BR isalnum (3) +.\"O function. +.\"O It tests whether \fIwc\fP is a wide character +.\"O belonging to the wide character class "alnum". +.BR iswalnum () +´Ø¿ô¤Ï¡¢ +.BR isalnum (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢¤¢¤ë¥ï¥¤¥Éʸ»ú¤¬Ê¸»ú¥¯¥é¥¹ "alnum" ¤Ë°¤¹¤ë¤«¤É¤¦¤«¤òÄ´¤Ù +¤ë¡£ +.PP +.\"O The wide-character class "alnum" is a subclass of the wide-character class +.\"O "graph", and therefore also a subclass of the wide-character class "print". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢ +¤ê¡¢¤·¤¿¤¬¤Ã¤Æ¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +.\"O Being a subclass of the wide-character class "print", +.\"O the wide-character class +.\"O "alnum" is disjoint from the wide-character class "cntrl". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "graph", +.\"O the wide-character class "alnum" is disjoint from +.\"O the wide-character class "space" and its subclass "blank". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O The wide-character class "alnum" is disjoint from the wide-character class +.\"O "punct". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O The wide-character class "alnum" is the union of the wide character classes +.\"O "alpha" and "digit". +.\"O As such, it also contains the wide character class +.\"O "xdigit". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤È "digit" ¤ÎÏ +½¸¹ç¤Ç¤¢¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Î¥¯¥é¥¹¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" ¤â´Þ¤à¡£ +.PP +.\"O The wide-character class "alnum" always contains at least the letters \(aqA\(aq +.\"O to \(aqZ\(aq, \(aqa\(aq to \(aqz\(aq and the digits \(aq0\(aq to \(aq9\(aq. +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \(aqA\(aq ¤«¤é \(aqZ\(aq, +\(aqa\(aq ¤«¤é \(aqz\(aq ¤Þ¤Ç¤Îʸ»ú¤È \(aq0\(aq ¤«¤é \(aq9\(aq ¤Þ¤Ç¤Î¿ô»ú¤ò +¾ï¤Ë´Þ¤à¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iswalnum () +.\"O function returns nonzero +.\"O if \fIwc\fP is a wide character +.\"O belonging to the wide-character class "alnum". +.\"O Otherwise it returns zero. +.BR iswalnum () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬Ê¸»ú¥¯¥é¥¹ "alnum" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú +¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR iswalnum () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR iswalnum () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR isalnum (3), +.BR iswctype (3) diff --git a/draft/man3/iswalpha.3 b/draft/man3/iswalpha.3 new file mode 100644 index 00000000..f604040e --- /dev/null +++ b/draft/man3/iswalpha.3 @@ -0,0 +1,116 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Wed Aug 31 22:40:19 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:18 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWALPHA 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iswalpha \- test for alphabetic wide character +iswalpha \- ±Ñ»ú¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswalpha(wint_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iswalpha () +.\"O function is the wide-character equivalent of the +.\"O .BR isalpha (3) +.\"O function. +.\"O It tests whether \fIwc\fP is a wide character +.\"O belonging to the wide-character class "alpha". +.BR iswalpha () +´Ø¿ô¤Ï +.BR isalpha (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï \fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +.\"O The wide-character class "alpha" is a subclass of the +.\"O wide-character class "alnum", +.\"O and therefore also a subclass of the wide-character class "graph" and +.\"O of the wide-character class "print". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢ +¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤È¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î +¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +.\"O Being a subclass of the wide-character class "print", +.\"O the wide-character class +.\"O "alpha" is disjoint from the wide-character class "cntrl". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "graph", +.\"O the wide-character class "alpha" is disjoint from +.\"O the wide-character class "space" and its subclass "blank". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "alnum", +.\"O the wide-character class "alpha" is disjoint from +.\"O the wide-character class "punct". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O The wide-character class "alpha" is disjoint from the wide-character class +.\"O "digit". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O The wide-character class "alpha" contains the wide-character classes "upper" +.\"O and "lower". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" ¤È "lower" ¤ò´Þ +¤à¡£ +.PP +.\"O The wide-character class "alpha" always contains at least the +.\"O letters \(aqA\(aq to \(aqZ\(aq and \(aqa\(aq to \(aqz\(aq. +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \(aqA\(aq ¤«¤é \(aqZ\(aq, +\(aqa\(aq ¤«¤é \(aqz\(aq ¤Þ¤Ç¤Îʸ»ú¤ò¾ï¤Ë´Þ¤à¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iswalpha () +.\"O function returns nonzero +.\"O if \fIwc\fP is a wide character +.\"O belonging to the wide-character class "alpha". +.\"O Otherwise it returns zero. +.BR iswalpha () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Ë°¤¹¤ë +¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR iswalpha () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR iswalpha () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR isalpha (3), +.BR iswctype (3) diff --git a/draft/man3/iswblank.3 b/draft/man3/iswblank.3 new file mode 100644 index 00000000..2b174745 --- /dev/null +++ b/draft/man3/iswblank.3 @@ -0,0 +1,110 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Wed Sep 1 22:40:19 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:26 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWBLANK 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iswblank \- test for whitespace wide character +iswblank \- ¶õÇò¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswblank(wint_t " wc ); +.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 iswblank (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iswblank () +.\"O function is the wide-character equivalent of the +.\"O .BR isblank (3) +.\"O function. +.\"O It tests whether \fIwc\fP is a wide character +.\"O belonging to the wide-character class "blank". +.BR iswblank () +´Ø¿ô¤Ï¡¢ +.BR isblank (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "blank" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +.\"O The wide-character class "blank" is a subclass of the wide-character class +.\"O "space". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "blank" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë¡£ +.PP +.\"O Being a subclass of the wide-character class "space", +.\"O the wide-character class "blank" is disjoint from the +.\"O wide-character class "graph" and therefore also disjoint +.\"O from its subclasses "alnum", "alpha", "upper", "lower", "digit", +.\"O "xdigit", "punct". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "blank" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤È¤Ï¶¦ÄÌÉôʬ¤ò»ý¤¿¤º¡¢¤·¤¿¤¬¤Ã¤Æ¤½¤Î¥µ¥Ö¥¯¥é¥¹ +¤Ç¤¢¤ë "alnum", "alpha", "upper", "lower", "digit", "xdigit", "punct" +¤È¤â¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O The wide-character class "blank" always contains +.\"O at least the space character +.\"O and the control character \(aq\\t\(aq. +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "blank" ¤Ï¡¢¾¯¤Ê¤¯¤È¤â¶õÇòʸ»ú¤ÈÀ©¸æʸ»ú \(aq\\t\(aq ¤ò¾ï¤Ë +´Þ¤à¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iswblank () +.\"O function returns nonzero +.\"O if \fIwc\fP is a wide character +.\"O belonging to the wide-character class "blank". +.\"O Otherwise it returns zero. +.BR iswblank () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "blank" ¤Ë°¤¹¤ë +¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR iswblank () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR iswblank () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR isblank (3), +.BR iswctype (3) diff --git a/draft/man3/iswcntrl.3 b/draft/man3/iswcntrl.3 new file mode 100644 index 00000000..a4ac7123 --- /dev/null +++ b/draft/man3/iswcntrl.3 @@ -0,0 +1,87 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Wed Sep 1 22:51:30 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH ISWCNTRL 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iswcntrl \- test for control wide character +iswcntrl \- ¥ï¥¤¥ÉÀ©¸æʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswcntrl(wint_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iswcntrl () +.\"O function is the wide-character equivalent of the +.\"O .BR iscntrl (3) +.\"O function. +.\"O It tests whether \fIwc\fP is a wide character +.\"O belonging to the wide-character class "cntrl". +.BR iswcntrl () +´Ø¿ô¤Ï¡¢ +.BR iscntrl (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +.\"O The wide-character class "cntrl" is disjoint from the wide-character class +.\"O "print" and therefore also disjoint from its subclasses "graph", "alpha", +.\"O "upper", "lower", "digit", "xdigit", "punct". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤È¤Ï¶¦ÄÌÉôʬ¤ò»ý¤¿ +¤º¡¢¤·¤¿¤¬¤Ã¤Æ¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "graph", "alpha", "upper", "lower", +"digit", "xdigit", "punct" ¤È¤â¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O For an unsigned char \fIc\fP, \fIiscntrl(c)\fP +.\"O implies \fIiswcntrl(btowc(c))\fP, +.\"O but not vice versa. +unsigned char ·¿¤Ç¤¢¤ë \fIc\fP ¤ËÂФ·¤Æ¤Ï¡¢\fIiscntrl(c)\fP ¤Ï°ÅÌÛŪ¤Ë +\fIiswcntrl(btowc(c))\fP ¤ò¹Ô¤¦¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iswcntrl () +.\"O function returns nonzero if \fIwc\fP is a +.\"O wide character belonging to the wide-character class "cntrl". +.\"O Otherwise it returns zero. +´Ø¿ô +.BR iswcntrl () +¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤Ë°¤¹¤ë +¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR iswcntrl () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR iswcntrl () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iscntrl (3), +.BR iswctype (3) diff --git a/draft/man3/iswctype.3 b/draft/man3/iswctype.3 new file mode 100644 index 00000000..73b5e510 --- /dev/null +++ b/draft/man3/iswctype.3 @@ -0,0 +1,100 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Thu Sep 2 21:47:20 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.\" WORD: character property descriptor ʸ»ú°À­»Ø¼¨»Ò +.\" +.TH ISWCTYPE 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iswctype \- wide-character classification +iswctype \- ¥ï¥¤¥Éʸ»ú¤ÎʬÎà +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswctype(wint_t " wc ", wctype_t " desc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O If \fIwc\fP is a wide character having the character property designated by +.\"O \fIdesc\fP (or in other words: belongs to the character class designated by +.\"O \fIdesc\fP), the +.\"O .BR iswctype () +.\"O function returns nonzero. +.\"O Otherwise it +.\"O returns zero. +.\"O If \fIwc\fP is +.\"O .BR WEOF , +.\"O zero is returned. +\fIwc\fP ¤¬ +\fIdesc\fP ¤Ç»Ø¼¨¤µ¤ì¤¿Ê¸»ú°À­¤ò»ý¤Ä (¸À¤¤´¹¤¨¤ë¤È¡¢\fIdesc\fP ¤Ç»Ø¼¨ +¤µ¤ì¤¿Ê¸»ú¥¯¥é¥¹¤Ë°¤¹¤ë) ¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð¡¢ +.BR iswctype () +´Ø¿ô¤Ï 0 ¤Ç +¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¤³¤Î´Ø¿ô¤Ï 0 ¤òÊÖ¤¹¡£\fIwc\fP ¤¬ +.B WEOF +¤Ê¤é¤Ð 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O \fIdesc\fP must be a character property descriptor +.\"O returned by the +.\"O .BR wctype () +.\"O function. +\fIdesc\fP ¤Ï +.BR wctype () +´Ø¿ô¤¬ÊÖ¤¹Ê¸»ú°À­»Ø¼¨»Ò¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iswctype () +.\"O function returns nonzero if +.\"O the \fIwc\fP has the designated +.\"O property. +.\"O Otherwise it returns 0. +.BR iswctype () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬»Ø¼¨¤µ¤ì¤¿Â°À­¤ò»ý¤Ä¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ +ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR iswctype () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR iswctype () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iswalnum (3), +.BR iswalpha (3), +.BR iswblank (3), +.BR iswcntrl (3), +.BR iswdigit (3), +.BR iswgraph (3), +.BR iswlower (3), +.BR iswprint (3), +.BR iswpunct (3), +.BR iswspace (3), +.BR iswupper (3), +.BR iswxdigit (3), +.BR wctype (3) diff --git a/draft/man3/iswdigit.3 b/draft/man3/iswdigit.3 new file mode 100644 index 00000000..e1854955 --- /dev/null +++ b/draft/man3/iswdigit.3 @@ -0,0 +1,116 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Thu Sep 2 21:56:46 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:32 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWDIGIT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iswdigit \- test for decimal digit wide character +iswdigit \- ¿ô»ú¥ï¥¤¥Éʸ»ú¤Ç¤¢¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswdigit(wint_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iswdigit () +.\"O function is the wide-character equivalent of the +.\"O .BR isdigit (3) +.\"O function. +.\"O It tests whether \fIwc\fP is a wide character +.\"O belonging to the wide-character class "digit". +.BR iswdigit () +´Ø¿ô¤Ï¡¢ +.BR isdigit (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +.\"O The wide-character class "digit" is a subclass of the wide-character class +.\"O "xdigit", and therefore also a subclass +.\"O of the wide-character class "alnum", of +.\"O the wide-character class "graph" and of the wide-character class "print". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢ +¤ë¡£¤·¤¿¤¬¤Ã¤Æ¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤ä¡¢¤½¤Î¿Æ¥¯¥é¥¹¤Ç¤¢¤ë "graph", +¤µ¤é¤Ë¤½¤Î¿Æ¥¯¥é¥¹¤Ç¤¢¤ë "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +.\"O Being a subclass of the wide-character +.\"O class "print", the wide-character class +.\"O "digit" is disjoint from the wide-character class "cntrl". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "graph", +.\"O the wide-character class +.\"O "digit" is disjoint from the wide-character class "space" and its subclass +.\"O "blank". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character +.\"O class "alnum", the wide-character class +.\"O "digit" is disjoint from the wide-character class "punct". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O The wide-character class "digit" is +.\"O disjoint from the wide-character class +.\"O "alpha" and therefore also disjoint from its subclasses "lower", "upper". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿ +¤Ê¤¤¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "lower", "upper" ¤È¤â¶¦ÄÌÉôʬ¤ò +»ý¤¿¤Ê¤¤¡£ +.PP +.\"O The wide-character class "digit" always +.\"O contains exactly the digits \(aq0\(aq to \(aq9\(aq. +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤Ïɬ¤º¡¢\(aq0\(aq ¤«¤é \(aq9\(aq ¤Þ¤Ç¤Î +¿ô»ú¤À¤±¤«¤é¤Ê¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iswdigit () +.\"O function returns nonzero +.\"O if \fIwc\fP is a wide character +.\"O belonging to the wide-character class "digit". +.\"O Otherwise it returns zero. +.BR iswdigit () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤Ë°¤¹¤ë¥ï +¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR iswdigit () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR iswdigit () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR isdigit (3), +.BR iswctype (3) diff --git a/draft/man3/iswgraph.3 b/draft/man3/iswgraph.3 new file mode 100644 index 00000000..ea98734d --- /dev/null +++ b/draft/man3/iswgraph.3 @@ -0,0 +1,105 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Sep 4 21:22:34 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:38 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWGRAPH 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iswgraph \- test for graphic wide character +iswgraph \- ¥°¥é¥Õ¥£¥Ã¥¯¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswgraph(wint_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iswgraph () +.\"O function is the wide-character equivalent of the +.\"O .BR isgraph (3) +.\"O function. +.\"O It tests whether \fIwc\fP is a wide character +.\"O belonging to the wide-character class "graph". +.BR iswgraph () +´Ø¿ô¤Ï¡¢ +.BR isgraph (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +.\"O The wide-character class "graph" is disjoint from the wide-character class +.\"O "space" and therefore also disjoint from its subclass "blank". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿ +¤Ê¤¤¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¤â¶¦ÄÌÉôʬ¤ò +»ý¤¿¤Ê¤¤¡£ +.\" Note: UNIX98 (susv2/xbd/locale.html) says that "graph" and "space" may +.\" have characters in common, except U+0020. But C99 (ISO/IEC 9899:1999 +.\" section 7.25.2.1.10) says that "space" and "graph" are disjoint. +.PP +.\"O The wide-character class "graph" is a subclass of the wide-character class +.\"O "print". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢ +¤ë¡£ +.PP +.\"O Being a subclass of the wide-character class "print", +.\"O the wide-character class +.\"O "graph" is disjoint from the wide-character class "cntrl". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¤Ï¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O The wide-character class "graph" contains all the wide characters from the +.\"O wide-character class "print" except the space character. +.\"O It therefore contains +.\"O the wide-character classes "alnum" and "punct". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Ë°¤¹¤ëʸ»ú¤Î¤¦ +¤Á¶õÇòʸ»ú¤ò½ü¤¯Á´¤Æ¤Î¥ï¥¤¥Éʸ»ú¤ò´Þ¤ó¤Ç¤¤¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Ë¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "almun" ¤È "punct" ¤¬´Þ +¤Þ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iswgraph () +.\"O function returns nonzero +.\"O if \fIwc\fP is a wide character +.\"O belonging to the wide-character class "graph". +.\"O Otherwise it returns zero. +.BR iswgraph () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Ë°¤¹¤ë¥ï +¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR iswgraph () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR iswgraph () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR isgraph (3), +.BR iswctype (3) diff --git a/draft/man3/iswlower.3 b/draft/man3/iswlower.3 new file mode 100644 index 00000000..c24070d7 --- /dev/null +++ b/draft/man3/iswlower.3 @@ -0,0 +1,129 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Sep 4 21:40:16 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sat Jan 8 01:52:20 JST 2000 +.\" by Kentaro Shirakata +.\" +.TH ISWLOWER 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iswlower \- test for lowercase wide character +iswlower \- ¾®Ê¸»ú¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswlower(wint_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iswlower () +.\"O function is the wide-character equivalent of the +.\"O .BR islower (3) +.\"O function. +.\"O It tests whether \fIwc\fP is a wide character +.\"O belonging to the wide-character class "lower". +.BR iswlower () +´Ø¿ô¤Ï¡¢ +.BR islower (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬Ê¸»ú¥¯¥é¥¹ "lower" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤ò +Ä´¤Ù¤ë¡£ +.PP +.\"O The wide-character class "lower" is a subclass of the wide-character class +.\"O "alpha", and therefore also a subclass +.\"O of the wide-character class "alnum", of +.\"O the wide-character class "graph" and of the wide-character class "print". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ê¡¢ +¤·¤¿¤¬¤Ã¤Æ¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤È¤½¤Î¿Æ¥¯¥é¥¹¤Ç¤¢¤ë "graph", ¤µ¤é¤Ë +¤½¤Î¿Æ¥¯¥é¥¹¤Ç¤¢¤ë "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +.\"O Being a subclass of the wide-character class "print", +.\"O the wide-character class +.\"O "lower" is disjoint from the wide-character class "cntrl". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "graph", +.\"O the wide-character class "lower" is disjoint from the +.\"O wide-character class "space" and its subclass +.\"O "blank". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "alnum", +.\"O the wide-character class +.\"O "lower" is disjoint from the wide-character class "punct". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "alpha", +.\"O the wide-character class +.\"O "lower" is disjoint from the wide-character class "digit". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O The wide-character class "lower" contains at least +.\"O those characters \fIwc\fP +.\"O which are equal to \fItowlower(wc)\fP and different +.\"O from \fItowupper(wc)\fP. +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" ¤Ï¾¯¤Ê¤¯¤È¤â¡¢\fIwc\fP ¤È \fItowlower(wc)\fP +¤¬Åù¤·¤¯¤Ê¤ê¡¢¤«¤Ä \fItowupper(wc)\fP ¤È°Û¤Ê¤ë¤è¤¦¤Êʸ»ú¤ò´Þ¤à¡£ +.PP +.\"O The wide-character class "lower" always contains +.\"O at least the letters \(aqa\(aq to \(aqz\(aq. +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" ¤Ï¾¯¤Ê¤¯¤È¤â \(aqa\(aq ¤«¤é \(aqz\(aq ¤òɬ¤º´Þ¤à¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iswlower () +.\"O function returns nonzero +.\"O if \fIwc\fP is a wide character +.\"O belonging to the wide-character class "lower". +.\"O Otherwise it returns zero. +.BR iswlower () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" ¤Ë°¤¹¤ë¥ï +¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR iswlower () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR iswlower () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.\"O This function is not very appropriate for dealing with Unicode characters, +.\"O because Unicode knows about three cases: upper, lower and title case. +¤³¤Î´Ø¿ô¤Ç Unicode ¤ò°·¤¦¤Î¤Ï¤¢¤Þ¤êŬÀڤǤʤ¤¡£ +¤Ê¤¼¤Ê¤é¡¢Unicode ¤Ë¤Ï +Âçʸ»ú (upper case)¡¦¾®Ê¸»ú (lower case)¡¦¥¿¥¤¥È¥ëʸ»ú (title case) +¤Î 3 ¤Ä¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR islower (3), +.BR iswctype (3), +.BR towlower (3) diff --git a/draft/man3/iswprint.3 b/draft/man3/iswprint.3 new file mode 100644 index 00000000..21efc87f --- /dev/null +++ b/draft/man3/iswprint.3 @@ -0,0 +1,81 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Sep 4 23:03:32 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH ISWPRINT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iswprint \- test for printing wide character +iswprint \- °õ»ú²Äǽ¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswprint(wint_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iswprint () +.\"O function is the wide-character equivalent of the +.\"O .BR isprint (3) +.\"O function. +.\"O It tests whether \fIwc\fP is a wide character +.\"O belonging to the wide-character class "print". +.BR iswprint () +´Ø¿ô¤Ï¡¢ +.BR isprint (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +.\"O The wide-character class "print" is disjoint from the wide-character class +.\"O "cntrl". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿ +¤Ê¤¤¡£ +.PP +.\"O The wide-character class "print" contains the wide-character class "graph". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤ò´Þ¤à¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iswprint () +.\"O function returns nonzero if \fIwc\fP is a +.\"O wide character belonging to the wide-character class "print". +.\"O Otherwise it returns zero. +.BR iswprint () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Ë°¤¹¤ë¥ï +¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR iswprint () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR iswprint () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR isprint (3), +.BR iswctype (3) diff --git a/draft/man3/iswpunct.3 b/draft/man3/iswpunct.3 new file mode 100644 index 00000000..cb4a57fe --- /dev/null +++ b/draft/man3/iswpunct.3 @@ -0,0 +1,109 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Sep 5 21:47:49 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:52 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWPUNCT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iswpunct \- test for punctuation or symbolic wide character +iswpunct \- ¶çÆÉÅÀ¡¦µ­¹æ¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswpunct(wint_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iswpunct () +.\"O function is the wide-character equivalent of the +.\"O .BR ispunct (3) +.\"O function. +.\"O It tests whether \fIwc\fP is a wide character +.\"O belonging to the wide-character class "punct". +.BR iswpunct () +´Ø¿ô¤Ï¡¢ +.BR ispunct (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +.\"O The wide-character class "punct" is a subclass of the wide-character class +.\"O "graph", and therefore also a subclass of the wide-character class "print". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +.\"O The wide-character class "punct" is disjoint from the wide-character class +.\"O "alnum" and therefore also disjoint from its subclasses "alpha", "upper", +.\"O "lower", "digit", "xdigit". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê +¤¤¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "alpha", "upper", "lower", "digit", "xdigit" +¤È¤â¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "print", +.\"O the wide-character class +.\"O "punct" is disjoint from the wide-character class "cntrl". +¥ï¥¤¥Éʸ»ú "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤Ï +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "graph", +.\"O the wide-character class +.\"O "punct" is disjoint from the wide-character class "space" and its subclass +.\"O "blank". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iswpunct () +.\"O function returns nonzero +.\"O if \fIwc\fP is a wide character +.\"O belonging to the wide-character class "punct". +.\"O Otherwise it returns zero. +.BR iswpunct () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤Ë°¤¹¤ë +¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR iswpunct () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR iswpunct () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.\"O This function's name is a misnomer when dealing with Unicode characters, +.\"O because the wide-character class "punct" contains both punctuation characters +.\"O and symbol (math, currency, etc.) characters. +¤³¤Î´Ø¿ô¤Î̾Á°¤Ï Unicode ʸ»ú¤ò°·¤¦ºÝ¤Ë¤ÏÀµ¤·¤¯¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢¥ï¥¤¥É +ʸ»ú¥¯¥é¥¹ "punct" ¤Ï¶çÆÉÅÀʸ»ú¤Èµ­¹æʸ»ú(¿ô³Øµ­¹æ¡¢²ßʾµ­¹æ¤Ê¤É)¤Îξ +Êý¤ò´Þ¤à¤«¤é¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ispunct (3), +.BR iswctype (3) diff --git a/draft/man3/iswspace.3 b/draft/man3/iswspace.3 new file mode 100644 index 00000000..ca02ddff --- /dev/null +++ b/draft/man3/iswspace.3 @@ -0,0 +1,94 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Sep 5 22:05:50 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:58 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWSPACE 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iswspace \- test for whitespace wide character +iswspace \- ¶õÇò¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswspace(wint_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iswspace () +.\"O function is the wide-character equivalent of the +.\"O .BR isspace (3) +.\"O function. +.\"O It tests whether \fIwc\fP is a wide character +.\"O belonging to the wide-character class "space". +.BR iswspace () +´Ø¿ô¤Ï¡¢ +.BR isspace (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +.\"O The wide-character class "space" is disjoint from the wide-character class +.\"O "graph" and therefore also disjoint from its subclasses "alnum", "alpha", +.\"O "upper", "lower", "digit", "xdigit", "punct". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "alnum", "alpha", "upper", "lower", +"digit", "xdigit", "punct" ¤È¤â¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.\" Note: UNIX98 (susv2/xbd/locale.html) says that "space" and "graph" may +.\" have characters in common, except U+0020. But C99 (ISO/IEC 9899:1999 +.\" section 7.25.2.1.10) says that "space" and "graph" are disjoint. +.PP +.\"O The wide-character class "space" contains the wide-character class "blank". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "blank" ¤ò´Þ¤à¡£ +.PP +.\"O The wide-character class "space" always contains at least the space character +.\"O and the control +.\"O characters \(aq\\f\(aq, \(aq\\n\(aq, \(aq\\r\(aq, \(aq\\t\(aq, \(aq\\v\(aq. +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Ï¾¯¤Ê¤¯¤È¤â¡¢¶õÇòʸ»ú¤ª¤è¤ÓÀ©¸æʸ»ú \(aq\\f\(aq, +\(aq\\n\(aq, \(aq\\r\(aq, \(aq\\t\(aq, \(aq\\v\(aq ¤òɬ¤º´Þ¤à¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iswspace () +.\"O function returns nonzero if \fIwc\fP is a wide character +.\"O belonging to the wide-character class "space". +.\"O Otherwise it returns zero. +.BR iswspace () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Ë´Þ¤Þ¤ì¤ë +¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR iswspace () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR iswspace () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR isspace (3), +.BR iswctype (3) diff --git a/draft/man3/iswupper.3 b/draft/man3/iswupper.3 new file mode 100644 index 00000000..df758378 --- /dev/null +++ b/draft/man3/iswupper.3 @@ -0,0 +1,119 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Sep 5 22:21:05 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:32:06 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWUPPER 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iswupper \- test for uppercase wide character +iswupper \- Âçʸ»ú¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswupper(wint_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iswupper () +.\"O function is the wide-character equivalent of the +.\"O .BR isupper (3) +.\"O function. +.\"O It tests whether \fIwc\fP is a wide character +.\"O belonging to the wide-character class "upper". +.BR iswupper () +´Ø¿ô¤Ï¡¢ +.BR isupper (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +.\"O The wide-character class "upper" is a subclass of the wide-character class +.\"O "alpha", and therefore also a subclass of the wide-character class "alnum", of +.\"O the wide-character class "graph" and of the wide-character class "print". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ê¡¢ +¤·¤¿¤¬¤Ã¤Æ¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤È¤½¤Î¿Æ¥¯¥é¥¹¤Ç¤¢¤ë "graph", ¤µ¤é¤Ë +¤½¤Î¿Æ¥¯¥é¥¹¤Ç¤¢¤ë "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +.\"O Being a subclass of the wide-character class "print", the wide-character class +.\"O "upper" is disjoint from the wide-character class "cntrl". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "graph", the wide-character class +.\"O "upper" is disjoint from the wide-character class "space" and its subclass +.\"O "blank". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "alnum", the wide-character class +.\"O "upper" is disjoint from the wide-character class "punct". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "alpha", the wide-character class +.\"O "upper" is disjoint from the wide-character class "digit". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O The wide-character class "upper" contains at least those characters \fIwc\fP +.\"O which are equal to \fItowupper(wc)\fP and different from \fItowlower(wc)\fP. +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" ¤Ï¾¯¤Ê¤¯¤È¤â¡¢\fIwc\fP ¤È \fItowupper(wc)\fP +¤¬Åù¤·¤¯¤Ê¤ê¡¢¤«¤Ä \fItowupper(wc)\fP ¤È°Û¤Ê¤ë¤è¤¦¤Êʸ»ú¤ò´Þ¤à¡£ +.PP +.\"O The wide-character class "upper" always contains at least the +.\"O letters \(aqA\(aq to \(aqZ\(aq. +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" ¤Ï¾¯¤Ê¤¯¤È¤â \(aqA\(aq ¤«¤é \(aqZ\(aq ¤òɬ¤º´Þ¤à¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iswupper () +.\"O function returns nonzero if \fIwc\fP is a wide character +.\"O belonging to the wide-character class "upper". +.\"O Otherwise it returns zero. +.BR iswupper () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð +0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR iswupper () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR iswupper () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.\"O This function is not very appropriate for dealing with Unicode characters, +.\"O because Unicode knows about three cases: upper, lower and title case. +¤³¤Î´Ø¿ô¤Ç Unicode ¤ò°·¤¦¤Î¤Ï¤¢¤Þ¤êŬÀڤǤʤ¤¡£¤Ê¤¼¤Ê¤é¡¢Unicode ¤Ë¤Ï +Âçʸ»ú¡¦¾®Ê¸»ú¡¦¥¿¥¤¥È¥ëʸ»ú¤Î 3 ¤Ä¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR isupper (3), +.BR iswctype (3), +.BR towupper (3) diff --git a/draft/man3/iswxdigit.3 b/draft/man3/iswxdigit.3 new file mode 100644 index 00000000..72e37c58 --- /dev/null +++ b/draft/man3/iswxdigit.3 @@ -0,0 +1,105 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Sep 5 22:21:05 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:32:14 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWXDIGIT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O iswxdigit \- test for hexadecimal digit wide character +iswxdigit \- 16 ¿Ê¿ô¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswxdigit(wint_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR iswxdigit () +.\"O function is the wide-character equivalent of the +.\"O .BR isxdigit (3) +.\"O function. +.\"O It tests whether \fIwc\fP is a wide character +.\"O belonging to the wide-character class "xdigit". +.BR iswxdigit () +´Ø¿ô¤Ï¡¢ +.BR isxdigit (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤« +¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +.\"O The wide-character class "xdigit" is a subclass of the wide-character class +.\"O "alnum", and therefore also a subclass of the wide-character class "graph" and +.\"O of the wide-character class "print". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç +¤¢¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤È¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" +¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +.\"O Being a subclass of the wide-character class "print", the wide-character class +.\"O "xdigit" is disjoint from the wide-character class "cntrl". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "graph", the wide-character class +.\"O "xdigit" is disjoint from the wide-character class "space" and its subclass +.\"O "blank". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O Being a subclass of the wide-character class "alnum", the wide-character class +.\"O "xdigit" is disjoint from the wide-character class "punct". +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +.\"O The wide-character class "xdigit" always contains at least the +.\"O letters \(aqA\(aq to \(aqF\(aq, \(aqa\(aq to \(aqf\(aq +.\"O and the digits \(aq0\(aq to \(aq9\(aq. +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" ¤Ï¾¯¤Ê¤¯¤È¤â¡¢Ê¸»ú \(aqA\(aq ¤«¤é \(aqF\(aq, +\(aqa\(aq ¤«¤é \(aqf\(aq ¤È¿ô»ú \(aq0\(aq ¤«¤é \(aq9\(aq ¤òɬ¤º´Þ¤à¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR iswxdigit () +.\"O function returns nonzero if \fIwc\fP is a wide character +.\"O belonging to the wide-character class "xdigit". +.\"O Otherwise it returns zero. +.BR iswxdigit () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" ¤Ë°¤¹¤ë +¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR iswxdigit () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR iswxdigit () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iswctype (3), +.BR isxdigit (3) diff --git a/draft/man3/j0.3 b/draft/man3/j0.3 new file mode 100644 index 00000000..914f8178 --- /dev/null +++ b/draft/man3/j0.3 @@ -0,0 +1,219 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified Sat Jul 24 19:08:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-08-25, aeb +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.fi +.BI "double j0(double " x ); +.br +.BI "double j1(double " x ); +.br +.BI "double jn(int " n ", double " x ); +.sp +.BI "float j0f(float " x ); +.br +.BI "float j1f(float " x ); +.br +.BI "float jnf(int " n ", float " x ); +.sp +.BI "long double j0l(long double " x ); +.br +.BI "long double j1l(long double " x ); +.br +.BI "long double jnl(int " n ", long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR j0 (), +.BR j1 (), +.BR jn (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE +.br +.BR j0f (), +.BR j0l (), +.BR j1f (), +.BR j1l (), +.BR jnf (), +.BR jnl (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.\" Also seems to work: -std=c99 -D_XOPEN_SOURCE +.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 ¼¡¤Î +Âè°ì¼ï¥Ù¥Ã¥»¥ë´Ø¿ô¤ÎÃͤòÊÖ¤¹¡£ +.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 +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the appropriate +.\"O Bessel value of the first kind for +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ËÂФ¹¤ëÂè°ì¼ï¥Ù¥Ã¥»¥ë´Ø¿ô¤ÎÃͤòÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ 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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Range error: result underflow, or \fIx\fP is too large in magnitude +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼¤ä¡¢\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. +.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" +.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 +.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 +.SH ´ØÏ¢¹àÌÜ +.BR y0 (3) diff --git a/draft/man3/key_setsecret.3 b/draft/man3/key_setsecret.3 new file mode 100644 index 00000000..49c9795a --- /dev/null +++ b/draft/man3/key_setsecret.3 @@ -0,0 +1,110 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" I had no way the check the functions out +.\" be careful +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI all rights reserved. +.\" Translated Mon Jan 27 2003 by Akihiro MOTOKI +.\" +.\"WORD: authentication ǧ¾Ú +.\"WORD: asymmetric ÈóÂоθ°(°Å¹æ) +.\"WORD: symmetric Âоθ°(°Å¹æ) +.\" +.TH KEY_SETSECRET 3 2002-07-18 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O key_decryptsession, key_encryptsession, key_setsecret, key_gendes, +.\"O key_secretkey_is_set \- interfaces to rpc keyserver daemon +key_decryptsession, key_encryptsession, key_setsecret, key_gendes, +key_secretkey_is_set \- rpc ¸°¥µ¡¼¥Ð¡¦¥Ç¡¼¥â¥ó¤È¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B "#include " +.sp +.BI "int key_decryptsession(const char *" remotename , +.BI "des_block *" deskey ); +.sp +.BI "int key_encryptsession(const char *" remotename , +.BI "des_block *" deskey ); +.sp +.BI "int key_gendes(des_block *" deskey ); +.sp +.BI "int key_setsecret(const char *" key ); +.sp +.B "int key_secretkey_is_set(void);" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The functions here are used within the RPC's secure authentication +.\"O mechanism (AUTH_DES). +.\"O There should be no need for user programs to +.\"O use this functions. +¤³¤ì¤é¤Î´Ø¿ô¤Ï RPC ¤Î°ÂÁ´¤Êǧ¾Úµ¡¹½ (AUTH_DES) ¤Ç»ÈÍѤµ¤ì¤ë¡£ +¥æ¡¼¥¶¡¦¥×¥í¥°¥é¥à¤Ç¤³¤ì¤é¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ëɬÍפϤʤ¤¡£ + +.\"O The function +.\"O .BR key_decryptsession () +.\"O uses the (remote) server netname and takes the DES key +.\"O for decrypting. +.\"O It uses the public key of the server and the +.\"O secret key associated with the effective UID of the calling process. +´Ø¿ô +.BR key_decryptsession () +¤Ï(¥ê¥â¡¼¥È)¥µ¡¼¥Ð¤Î¥Í¥Ã¥È̾¤òÍѤ¤¤Æ¡¢Éü¹æÍѤΠDES ¸°¤ò¼èÆÀ¤¹¤ë¡£ +¥µ¡¼¥Ð¤Î¸ø³«¸°¤È¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤ËÂбþ¤¹¤ëÈëÌ©¸°¤¬»ÈÍѤµ¤ì¤ë¡£ + +.\"O The function +.\"O .BR key_encryptsession () +.\"O is the inverse of +.\"O .BR key_decryptsession (). +.\"O It encrypts the DES keys with the public key of the server and +.\"O the secret key associated with the effective UID of the calling process. +´Ø¿ô +.BR key_encryptsession () +¤Ï +.BR key_decryptsession () +¤ÎµÕ¤Î½èÍý¤ò¹Ô¤¦¡£ +¥µ¡¼¥Ð¤Î¸ø³«¸°¤È¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤ËÂбþ¤¹¤ëÈëÌ©¸°¤Ç +DES ¸°¤ò°Å¹æ¤¹¤ë¡£ + +.\"O The function +.\"O .BR key_gendes () +.\"O is used to ask the keyserver for a secure conversation key. +´Ø¿ô +.BR key_gendes () +¤Ï¡¢¸°¥µ¡¼¥Ð¤Ë°ÂÁ´¤ÊÄÌ¿®¤ò¹Ô¤¦¤¿¤á¤Î¸°¤òÍ׵᤹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ + +.\"O The function +.\"O .BR key_setsecret () +.\"O is used to set the key for the effective UID of the calling process. +´Ø¿ô +.BR key_setsecret () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤ËÂФ·¤Æ¸°¤òÀßÄꤹ¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ + +.\"O The function +.\"O .BR key_secretkey_is_set () +.\"O can be used to determine whether a key has been +.\"O set for the effective UID of the calling process. +´Ø¿ô +.BR key_secretkey_is_set () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤ËÂФ·¤Æ¸°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò +Ä´¤Ù¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O These functions return 1 on success and 0 on failure. +¤³¤ì¤é¤Î´Ø¿ô¤ÏÀ®¸ù¤·¤¿¾ì¹ç 1 ¤ò¡¢¼ºÇÔ¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Note that we talk about two types of encryption here. +.\"O One is asymmetric using a public and secret key. +.\"O The other is symmetric, the +.\"O 64-bit DES. +¤³¤³¤Ç¤Ï 2 ¼ïÎà¤Î°Å¹æÊý¼°¤¬Åо줹¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +°ì¤Ä¤Ï¸ø³«¸°¤ÈÈëÌ©¸°¤ò»ÈÍѤ¹¤ëÈóÂоθ°°Å¹æ¤Ç¤¢¤ê¡¢ +¤â¤¦°ì¤Ä¤ÏÂоθ°°Å¹æ¤Ç¤¢¤ë 64 ¥Ó¥Ã¥È DES ¤Ç¤¢¤ë¡£ +.PP +.\"O These routines were part of the Linux/Doors-project, abandoned by now. +¤³¤ì¤é¤Î´Ø¿ô¤Ï Linux/Doors-project ¤ÎÀ®²Ì¤Î°ìÉô¤À¤Ã¤¿¤¬¡¢ +¸½ºß¤Þ¤Ç¤Ë³ºÅö²Õ½ê¤Ï¤¹¤Ù¤ÆÇË´þ¤µ¤ì¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR crypt (3) diff --git a/draft/man3/ldexp.3 b/draft/man3/ldexp.3 new file mode 100644 index 00000000..e17cb952 --- /dev/null +++ b/draft/man3/ldexp.3 @@ -0,0 +1,202 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "double ldexp(double " x ", int " exp ); +.br +.BI "float ldexpf(float " x ", int " exp ); +.br +.BI "long double ldexpl(long double " x ", int " exp ); +.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) +»²¾È): +.in +.sp +.ad l +.BR ldexpf (), +.BR ldexpl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return +.\"O .IR "x * (2^exp)" . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I "x * (2^exp)" +¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I exp +.\"O is zero, then +.\"O .I x +.\"O is returned. +.I exp +¤¬¥¼¥í¤Î¾ì¹ç¡¢ +.I x +¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, +.\"O a NaN is returned. +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is positive infinity (negative infinity), +.\"O positive infinity (negative infinity) is returned. +.I x +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Î¾ì¹ç¡¢ +Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If the result underflows, +.\"O an range error occurs, +.\"O and zero is returned. +·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ +ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR frexp (3), +.BR modf (3), +.BR scalbln (3) diff --git a/draft/man3/lgamma.3 b/draft/man3/lgamma.3 new file mode 100644 index 00000000..6a4349b8 --- /dev/null +++ b/draft/man3/lgamma.3 @@ -0,0 +1,259 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" based on glibc infopages +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O lgamma, lgammaf, lgammal, lgamma_r, lgammaf_r, lgammal_r, signgam \- +.\"O log gamma function +.SH ̾Á° +lgamma, lgammaf, lgammal, lgamma_r, lgammaf_r, lgammal_r, signgam \- +¥¬¥ó¥Þ´Ø¿ô¤ÎÂпô¤ò·×»»¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double lgamma(double " x ); +.br +.BI "float lgammaf(float " x ); +.br +.BI "long double lgammal(long double " x ); +.sp +.BI "double lgamma_r(double " x ", int *" signp ); +.br +.BI "float lgammaf_r(float " x ", int *" signp ); +.br +.BI "long double lgammal_r(long double " x ", int *" signp ); +.sp +.BI "extern int " signgam ; +.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) +»²¾È): +.in +.sp +.ad l +.BR lgamma (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR lgammaf (), +.BR lgammal (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR lgamma_r (), +.BR lgammaf_r (), +.BR lgammal_r (): +_BSD_SOURCE || _SVID_SOURCE +.br +.IR signgam : +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.ad b +.\"O .SH DESCRIPTION +.\"O For the definition of the Gamma function, see +.\"O .BR tgamma (3). +.\"O .PP +.SH ÀâÌÀ +¥¬¥ó¥Þ´Ø¿ô¤ÎÄêµÁ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR tgamma (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 ¤Ç¤¢¤ë¡£ +.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 +.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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is 1 or 2, +0 is returned. +.I x +¤¬ 1 ¤« 2 ¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is positive infinity or negative infinity, +.\"O positive infinity is returned. +.I x +¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ +Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +¤òÊÖ¤¹¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Pole error: \fIx\fP is a nonpositive integer +¶Ë¥¨¥é¡¼: \fIx\fP ¤¬Àµ¤Ç¤Ê¤¤À°¿ô +.\"O .I errno +.\"O is set to +.\" FIXME . glibc 2.8 gives EDOM! +.\"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 ) +¤¬¾å¤¬¤ë¡£ +.\" glibc (as at 2.8) also supports an inexact +.\" exception for various cases. +.\"O .SH "CONFORMING TO" +.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 +.SH ¥Ð¥° +.\"O For a pole error, +¶Ë¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.\" +.\" FIXME . this is as at glibc 2.8; check later if this bug is fixed +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6777 +.\"O .I errno +.\"O is set to +.\"O .BR EDOM ; +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O POSIX.1 says it should be set to +.\"O .BR ERANGE . +POSIX.1 ¤Ç¤Ï¡¢ +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¤Ù¤­¤È¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR tgamma (3) diff --git a/draft/man3/localeconv.3 b/draft/man3/localeconv.3 new file mode 100644 index 00000000..bd05ee5a --- /dev/null +++ b/draft/man3/localeconv.3 @@ -0,0 +1,97 @@ +.\" 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:01:20 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated Tue May 26 00:11:13 JST 1998 +.\" by YOSHINO Takashi +.\" +.TH LOCALECONV 3 1993-04-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O localeconv \- get numeric formatting information +localeconv \- ¿ôÃͤ˴ؤ¹¤ë½ñ¼°¾ðÊó¤òÆÀ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B struct lconv *localeconv(void); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR localeconv () +.\"O function returns a pointer to a +.\"O .I struct lconv +.\"O for the current locale. +.\"O This structure is shown in +.\"O .BR locale (7), +.\"O and contains all values associated with the locale categories +.\"O .B LC_NUMERIC +.\"O and +.\"O .BR LC_MONETARY . +.BR localeconv () +´Ø¿ô¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¾ðÊó¤òɽ¤¹ +.I struct lconv +¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï +.BR locale (7) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤ª¤ê¡¢¥í¥±¡¼¥ë¡¦¥«¥Æ¥´¥ê +.B LC_NUMERIC +¤È +.B LC_MONETARY +¤Ë´ØÏ¢¤¹¤ë¤¹¤Ù¤Æ¤ÎÃͤò´Þ¤ó¤Ç¤¤¤ë¡£ +.\"O Programs may also use the functions +.\"O .BR printf (3) +.\"O and +.\"O .BR strfmon (3) +.\"O which behave according to the actual locale in use. +¤³¤Î´Ø¿ô¤òÍѤ¤¤ë¥×¥í¥°¥é¥à¤Ï¡¢¤ª¤½¤é¤¯Æ±»þ¤Ë +.BR printf (3) +¤ä +.BR strfmon (3) +¤Î¤è¤¦¤Ê´Ø¿ô¤âÍѤ¤¤ë¤À¤í¤¦¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¸½ºß»ÈÍѤµ¤ì¤Æ¤¤¤ë¥í¥±¡¼¥ë¤Ë½¾¤Ã¤¿Æ°ºî¤ò¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C89, C99 +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The +.\"O .BR printf (3) +.\"O family of functions may or may not honor the current locale. +.BR printf (3) +¥°¥ë¡¼¥×¤Î´Ø¿ô¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤òÈ¿±Ç¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¤·¡¢ +¤·¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR locale (1), +.BR localedef (1), +.BR isalpha (3), +.BR nl_langinfo (3), +.BR setlocale (3), +.BR strcoll (3), +.BR strftime (3), +.BR locale (7) diff --git a/draft/man3/lockf.3 b/draft/man3/lockf.3 new file mode 100644 index 00000000..b08ef5cf --- /dev/null +++ b/draft/man3/lockf.3 @@ -0,0 +1,280 @@ +.\" Copyright 1997 Nicolas Lichtmaier +.\" Created Thu Aug 7 00:44:00 ART 1997 +.\" +.\" 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. +.\" +.\" 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: +.\" +.TH LOCKF 3 2009-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O lockf \- apply, test or remove a POSIX lock on an open file +lockf \- ¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë POSIX ¥í¥Ã¥¯¤ÎŬÍÑ¡¦¥Æ¥¹¥È¡¦²ò½ü¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int lockf(int " fd ", int " cmd ", off_t " len ); +.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 lockf (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"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. +¤É¤Î¾ì¹ç¤Ë¤ª¤¤¤Æ¤â¡¢¥»¥¯¥·¥ç¥ó¤Ï°ÊÁ°¤Î¥Õ¥¡¥¤¥ë½ªÃ¼¤è¤ê¤â³ÈÂ礵¤ì¤¦¤ë¡£ +.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) +¤Î¥í¥Ã¥¯¤òº®¤¼¤Æ¸Æ¤Ó½Ð¤¹¤Î¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤í¤¦¡£ +.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 +.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 ) +¤ËÀßÄꤹ¤ë¡£ +.\"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 +.\"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. +.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. +Èó¾ï¤Ë¿¤¯¤Î¥»¥°¥á¥ó¥È¥í¥Ã¥¯¤¬³«¤«¤ì¡¢¥í¥Ã¥¯¥Æ¡¼¥Ö¥ë¤¬°ìÇդǤ¢¤ë¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.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) +.br +¥«¡¼¥Í¥ë¥½¡¼¥¹¤Î +.I Documentation/filesystems +¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë +.I locks.txt +¤È +.I mandatory-locking.txt +(°ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï +.I Documentation +¥Ç¥£¥ì¥¯¥È¥êľ²¼¤Ë¤¢¤ê¡¢ +.I mandatory-locking.txt +¤Ï +.I mandatory.txt +¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤Ã¤¿¡£) diff --git a/draft/man3/log.3 b/draft/man3/log.3 new file mode 100644 index 00000000..38d37f33 --- /dev/null +++ b/draft/man3/log.3 @@ -0,0 +1,205 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 Wed Aug 6 00:35:20 JST 2003 +.\" by Akihiro MOTOKI +.\" Updated 2008-09-16, Akihiro MOTOKI +.\" +.TH LOG 3 2008-08-10 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O log, logf, logl \- natural logarithmic function +.SH ̾Á° +log, logf, logl \- ¼«Á³Âпô´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double log(double " x ); +.br +.BI "float logf(float " x ); +.br +.BI "long double logl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR logf (), +.BR logl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the natural logarithm of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤Î¼«Á³Âпô¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, +.\"O a NaN is returned. +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is 1, the result is +0. +.I x +¤¬ 1 ¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is positive infinity, +.\"O positive infinity is returned. +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +¤òÊÖ¤¹¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is negative +Îΰ襨¥é¡¼ (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 +¶Ë¥¨¥é¡¼ (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" +.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 +.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 ) +¤¬È¯À¸¤·¤Æ¤¤¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR clog (3), +.BR log1p (3), +.BR sqrt (3) diff --git a/draft/man3/log10.3 b/draft/man3/log10.3 new file mode 100644 index 00000000..3006d7f8 --- /dev/null +++ b/draft/man3/log10.3 @@ -0,0 +1,126 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 Wed Aug 6 00:35:20 JST 2003 +.\" by Akihiro MOTOKI +.\" Updated 2008-09-16, Akihiro MOTOKI +.\" +.TH LOG10 3 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O log10, log10f, log10l \- base-10 logarithmic function +log10, log10f, log10l \- Ä줬 10 ¤ÎÂпô´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double log10(double " x ); +.br +.BI "float log10f(float " x ); +.br +.BI "long double log10l(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR log10f (), +.BR log10l (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the base 10 logarithm of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤Î¾ïÍÑÂпô (Ä줬 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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR clog10 (3), +.BR exp10 (3), +.BR sqrt (3) diff --git a/draft/man3/log1p.3 b/draft/man3/log1p.3 new file mode 100644 index 00000000..20a9ba39 --- /dev/null +++ b/draft/man3/log1p.3 @@ -0,0 +1,188 @@ +.\" Copyright 1995 Jim Van Zandt +.\" 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. +.\" +.\" 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 LOG1P 3 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O log1p, log1pf, log1pl \- logarithm of 1 plus argument +log1p, log1pf, log1pl \- °ú¤­¿ô¤Ë 1 ¤ò²Ã¤¨¤¿ÃͤÎÂпô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double log1p(double " x ); +.br +.BI "float log1pf(float " x ); +.br +.BI "long double log1pl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR log1p (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR log1pf (), +.BR log1pl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .I log1p(x) +.\"O returns a value equivalent to +.I log1p(x) +¤Ï°Ê²¼¤ÈÅù²Á¤ÊÃͤòÊÖ¤¹¡£ +.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)" +¤Î¼«Á³Âпô¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, +.\"O a NaN is returned. +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is positive infinity, positive infinity is returned. +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +¤òÊÖ¤¹¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is less than \-1 +Îΰ襨¥é¡¼ (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 +¶Ë¥¨¥é¡¼ (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 ) +¤¬¾å¤¬¤ë¡£ +.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" +.SH ½àµò +C99, POSIX.1-2001. +.\" BSD +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR exp (3), +.BR expm1 (3), +.BR log (3) diff --git a/draft/man3/log2.3 b/draft/man3/log2.3 new file mode 100644 index 00000000..f10f8424 --- /dev/null +++ b/draft/man3/log2.3 @@ -0,0 +1,131 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995-08-14 by Arnt Gulbrandsen +.\" 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 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O log2, log2f, log2l \- base-2 logarithmic function +log2, log2f, log2l \- Ä줬 2 ¤ÎÂпô´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double log2(double " x ); +.br +.BI "float log2f(float " x ); +.br +.BI "long double log2l(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR log2 (), +.BR log2f (), +.BR log2l (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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 +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the base 2 logarithm of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÄì¤ò 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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"O For a discussion of the errors that can occur for these functions, see +.\"O .BR log (3). +¤³¤ì¤é¤Î´Ø¿ô¤ÇȯÀ¸¤¹¤ë¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR log (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"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 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" +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR clog2 (3), +.BR sqrt (3) diff --git a/draft/man3/logb.3 b/draft/man3/logb.3 new file mode 100644 index 00000000..215e4d66 --- /dev/null +++ b/draft/man3/logb.3 @@ -0,0 +1,208 @@ +.\" 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. +.\" +.\" 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 ÈóÀµµ¬²½¤Î +.\" +.TH LOGB 3 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O logb, logbf, logbl \- get exponent of a floating-point value +logb, logbf, logbl \- ÉâÆ°¾®¿ôÅÀ¿ô¤Î»Ø¿ô¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double logb(double " x ); +.br +.BI "float logbf(float " x ); +.br +.BI "long double logbl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR logb (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR logbf (), +.BR logbl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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 +¤ÈÅù¤·¤¤¤¬¡¢¸å¼Ô¤ÎÊý¤¬¤¿¤Ö¤ó¹â®¤Ç¤¢¤ë¡£ +.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 +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the exponent of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤Î»Ø¿ôÉô¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, +.\"O a NaN is returned. +.I x +¤¬ 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 +¤òÊÖ¤¹¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Pole error: \fIx\fP is 0 +¶Ë¥¨¥é¡¼ (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 ) +¤¬¾å¤¬¤ë¡£ +.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 +.\" .BR logb () +.\" ´Ø¿ô¤Ï 4.3BSD ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.\" 4.3BSD ¥Þ¥Ë¥å¥¢¥ë¤Î IEEE.3 ¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ilogb (3), +.BR log (3) diff --git a/draft/man3/login.3 b/draft/man3/login.3 new file mode 100644 index 00000000..f7c1b697 --- /dev/null +++ b/draft/man3/login.3 @@ -0,0 +1,220 @@ +.\" 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. +.\" +.\" Derived from text written by Martin Schulze (or taken from glibc.info) +.\" and text written by Paul Thompson - both copyright 2002. +.\" +.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO +.\" all rights reserved. +.\" Translated Thu Aug 26 06:04:53 JST 2004 +.\" by Yuichi SATO +.\" Updated & Modified Sat Jan 15 06:38:41 JST 2005 by Yuichi SATO +.\" +.TH LOGIN 3 2004-05-06 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O login, logout \- write utmp and wtmp entries +login, logout \- utmp ¤È wtmp ¥¨¥ó¥È¥ê¤ò½ñ¤­¹þ¤à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "void login(const struct utmp *" ut ); +.sp +.BI "int logout(const char *" ut_line ); +.sp +.\"O Link with \fI\-lutil\fP. +\fI\-lutil\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The utmp file records who is currently using the system. +utmp ¥Õ¥¡¥¤¥ë¤Ï¸½ºß¥·¥¹¥Æ¥à¤ò»ÈÍѤ·¤Æ¤¤¤ë¥æ¡¼¥¶¤òµ­Ï¿¤¹¤ë¡£ +.\"O The wtmp file records all logins and logouts. +.\"O See +.\"O .BR utmp (5). +wtmp ¥Õ¥¡¥¤¥ë¤Ï¤¹¤Ù¤Æ¤Î¥í¥°¥¤¥ó¤È¥í¥°¥¢¥¦¥È¤òµ­Ï¿¤¹¤ë¡£ +.BR utmp (5) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.LP +.\"O The function +.\"O .BR login () +.\"O takes the supplied \fIstruct utmp\fP +.\"O .IR ut , +.\"O and writes it to both the utmp and the wtmp file. +´Ø¿ô +.BR login () +¤ÏÍ¿¤¨¤é¤ì¤¿ \fIstruct utmp\fP +.I ut +¤ò utmp ¤È wtmp ¥Õ¥¡¥¤¥ë¤ÎξÊý¤Ë½ñ¤­¹þ¤à¡£ +.LP +.\"O The function +.\"O .BR logout () +.\"O clears the entry in the utmp file again. +´Ø¿ô +.BR logout () +¤Ï utmp ¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë¥¨¥ó¥È¥ê¤ò¥¯¥ê¥¢¤¹¤ë¡£ +.\"O .SS "GNU Details" +.SS "GNU ÈǤξܺÙ" +.\"O More precisely, +.\"O .BR login () +.\"O takes the argument +.\"O .I ut +.\"O struct, fills the field +.\"O .I ut\->ut_type +.\"O (if there is such a field) with the value +.\"O .BR USER_PROCESS , +.\"O and fills the field +.\"O .I ut\->ut_pid +.\"O (if there is such a field) with the process ID of the calling process. +¤è¤êÀµ³Î¤Ë¤Ï¡¢ +.BR login () +¤Ï°ú¤­¿ô +.I ut +¹½Â¤ÂΤò¤È¤ê¡¢(¤â¤·Â¸ºß¤¹¤ë¤Ê¤é¤Ð) ¥Õ¥£¡¼¥ë¥É +.I ut\->ut_type +¤ò +.B USER_PROCESS +¤È¤¤¤¦Ãͤˤ·¡¢(¤â¤·Â¸ºß¤¹¤ë¤Ê¤é¤Ð) ¥Õ¥£¡¼¥ë¥É +.I ut\->ut_pid +¤ò¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤ÎÃͤˤ¹¤ë¡£ +.\"O Then it tries to fill the field +.\"O .IR ut\->ut_line . +¼¡¤Ë¥Õ¥£¡¼¥ë¥É +.I ut\->ut_line +¤ÎÃͤòÀßÄꤷ¤è¤¦¤È¤¹¤ë¡£ +.\"O It takes the first of \fIstdin\fP, \fIstdout\fP, \fIstderr\fP +.\"O that is a tty, and +.\"O stores the corresponding pathname minus a possible leading \fI/dev/\fP +.\"O into this field, and then writes the struct to the utmp file. +¤³¤Î´Ø¿ô¤Ï¡¢É¸½àÆþÎÏ¡¦É¸½à½ÐÎÏ¡¦É¸½à¥¨¥é¡¼½ÐÎϤÎÃ椫¤é +üËö (tty) ¤Ç¤¢¤ëºÇ½é¤Î¤â¤Î¤ò¤È¤ê¡¢ +Âбþ¤¹¤ë¥Ñ¥¹Ì¾¤«¤éÀèƬ¤Î \fI/dev/\fP ¤ò°ú¤¤¤¿¤â¤Î¤ò +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë³ÊǼ¤·¤Æ¡¢¤³¤Î¹½Â¤ÂΤò utmp ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à¡£ +.\"O On the other hand, if no tty name was found, this field is filled with "???" +.\"O and the struct is not written to the utmp file. +.\"O After this, the struct is written to the wtmp file. +°ìÊý¡¢Ã¼Ëö̾¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï "???" ¤È¤µ¤ì¤Æ¡¢ +¤³¤Î¹½Â¤ÂÎ¤Ï utmp ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤Ê¤¤¡£ +¤½¤Î¸å¤Ë¤³¤Î¹½Â¤ÂÎ¤Ï wtmp ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.LP +.\"O The +.\"O .BR logout () +.\"O function searches the utmp file for an entry matching the +.\"O .I ut_line +.\"O argument. +.\"O If a record is found, it is updated by zeroing out the +.\"O .I ut_name +.\"O and +.\"O .I ut_host +.\"O fields, updating the +.\"O .I ut_tv +.\"O timestamp field and setting +.\"O .I ut_type +.\"O (if there is such a field) to +.\"O .BR DEAD_PROCESS . +.BR logout () +´Ø¿ô¤Ï utmp ¥Õ¥¡¥¤¥ë¤«¤é +.I ut_line +°ú¤­¿ô¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤òõ¤¹¡£ +¥ì¥³¡¼¥É¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¡¢ +.I ut_name +¤È +.I ut_host +¥Õ¥£¡¼¥ë¥É¤ò¥¯¥ê¥¢¤·¤Æ¡¢ +.I ut_tv +¥¿¥¤¥à¥¹¥¿¥ó¥×¥Õ¥£¡¼¥ë¥É¤ò¹¹¿·¤·¡¢ +(¤â¤·Â¸ºß¤¹¤ë¤Ê¤é¤Ð) +.I ut_type +¥Õ¥£¡¼¥ë¥É¤ò +.B DEAD_PROCESS +¤Ë¹¹¿·¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR logout () +.\"O function returns 1 if the entry was successfully written to the +.\"O database, or 0 if an error occurred. +¥¨¥ó¥È¥ê¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë½ñ¤­¹þ¤à¤Î¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ +.BR logout () +´Ø¿ô¤Ï 1 ¤òÊÖ¤¹¡£ +¤Þ¤¿¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢0 ¤òÊÖ¤¹¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /var/run/utmp +.\"O user accounting database, configured through +.\"O .B _PATH_UTMP +.\"O in +.\"O .I +¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¡£ +.I +¤Ë¤ª¤±¤ë +.B _PATH_UTMP +¤ÇÀßÄꤵ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /var/log/wtmp +.\"O user accounting log file, configured through +.\"O .B _PATH_WTMP +.\"O in +.\"O .I +¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È¥í¥°¥Õ¥¡¥¤¥ë¡£ +.I +¤Ë¤ª¤±¤ë +.B _PATH_WTMP +¤ÇÀßÄꤵ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Not in POSIX.1-2001. +.\"O Present on the BSDs. +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¤Ë¸ºß¤¹¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Note that the +.\"O member +.\"O .I ut_user +.\"O of +.\"O .I struct utmp +.\"O is called +.\"O .I ut_name +.\"O in BSD. +.\"O Therefore, +.\"O .I ut_name +.\"O is defined as an alias for +.\"O .I ut_user +.\"O in +.\"O .IR . +.I struct utmp +¤Î¥á¥ó¥Ð +.I ut_user +¤Ï¡¢BSD ¤Ç¤Ï +.I ut_name +¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤½¤Î¤¿¤á +.I ut_name +¤Ï +.I +¤Ë¤ª¤¤¤Æ +.I ut_user +¤Î¥¨¥¤¥ê¥¢¥¹¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getutent (3), +.BR utmp (5) diff --git a/draft/man3/longjmp.3 b/draft/man3/longjmp.3 new file mode 100644 index 00000000..7f384c7b --- /dev/null +++ b/draft/man3/longjmp.3 @@ -0,0 +1,215 @@ +.\" Written by Michael Haardt, Fri Nov 25 14:51:42 MET 1994 +.\" +.\" 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. +.\" +.\" Added siglongjmp, Sun Mar 2 22:03:05 EST 1997, jrv@vanzandt.mv.com +.\" Modifications, Sun Feb 26 14:39:45 1995, faith@cs.unc.edu +.\" " +.\" Japanese Version Copyright (c) 1998 Seiiti Obara +.\" all rights reserved. +.\" Translated 1998-05-27, Seiiti Obara +.\" Updated 2009-02-24, Akihiro MOTOKI, LDP v3.19 +.\" +.\"WORD: stack context ¥¹¥¿¥Ã¥¯¥³¥ó¥Æ¥­¥¹¥È +.\"WORD: signal masks ¥·¥°¥Ê¥ë¥Þ¥¹¥¯ +.\"WORD: signal context ¥·¥°¥Ê¥ë¥³¥ó¥Æ¥­¥¹¥È +.\"WORD: flag ¥Õ¥é¥° +.\"WORD: low-level Äã¥ì¥Ù¥ë +.\" +.TH LONGJMP 3 2009-01-13 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O longjmp, siglongjmp \- nonlocal jump to a saved stack context +longjmp, siglongjmp \- Êݸ¤µ¤ì¤¿¥¹¥¿¥Ã¥¯¥³¥ó¥Æ¥­¥¹¥È (stack context) +¤Ø¤ÎÈó¶É½êŪ¤Ê¥¸¥ã¥ó¥× +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "void longjmp(jmp_buf " env ", int " val ); + +.BI "void siglongjmp(sigjmp_buf " env ", int " val ); +.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 siglongjmp (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_C_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR longjmp () +.\"O and +.\"O .BR setjmp (3) +.\"O are useful for dealing with errors +.\"O and interrupts encountered in a low-level subroutine of a program. +.\"O .BR longjmp () +.\"O restores the environment saved by the last call of +.\"O .BR setjmp (3) +.\"O with the corresponding \fIenv\fP argument. +.\"O After +.\"O .BR longjmp () +.\"O is completed, program execution continues as if the +.\"O corresponding call of +.\"O .BR setjmp (3) +.\"O had just returned the value +.\"O \fIval\fP. +.\"O .BR longjmp () +.\"O cannot cause 0 to be returned. +.\"O If +.\"O .BR longjmp () +.\"O is invoked with a second argument of 0, 1 will be returned instead. +.BR longjmp () +¤È +.BR setjmp (3) +¤Ï¡¢¥×¥í¥°¥é¥à¤ÎÄã¥ì¥Ù¥ë¤Ê¥µ¥Ö¥ë¡¼¥Á¥ó¤Ë¤ª¤¤¤Æ¡¢ +¥¨¥é¡¼¤ä³ä¤ê¹þ¤ß¤¬È¯À¸¤·¤¿»þ¤Î½èÍý¤ËÊØÍø¤Ç¤¢¤ë¡£ +.BR longjmp () +¤Ï¡¢\fIenv\fP °ú¤­¿ô¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿ºÇ¸å¤Î +.BR setjmp (3) +¤Ë¤è¤Ã¤ÆÊݸ¤µ¤ì¤¿´Ä¶­¤òÉü¸µ¤¹¤ë¡£ +.BR longjmp () +¤Î´°Î»¸å¡¢¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤Ï¡¢¤Þ¤ë¤ÇÂбþ¤¹¤ë +.BR setjmp (3) +¤Î¸Æ¤Ó½Ð¤·¤¬ÃÍ \fIval\fP ¤ÇÊ֤äÆÍ褿¤«¤è¤¦¤Ë³¹Ô¤µ¤ì¤ë¡£ +.BR longjmp () +¤Ï 0 ¤òÊÖ¤¹¤è¤¦¤Ë»Ø¼¨¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +ÆóÈÖÌܤΰú¤­¿ô¤Ë 0 ¤ò»ØÄꤷ¤Æ +.BR longjmp () +¤¬¸Æ¤Ð¤ì¤¿¾ì¹ç¤Ï¡¢Âå¤ï¤ê¤Ë 1 ¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.P +.\"O .BR siglongjmp () +.\"O is similar to +.\"O .BR longjmp () +.\"O except for the type of +.\"O its \fIenv\fP argument. +.\"O If, and only if, the +.\"O .BR sigsetjmp (3) +.\"O call that set this +.\"O \fIenv\fP used a nonzero \fIsavesigs\fP flag, +.\"O .BR siglongjmp () +.\"O also restores the signal mask that was saved by +.\"O .BR sigsetjmp (3). +.BR siglongjmp () +¤Ï¡¢°ú¤­¿ô \fIenv\fP ¤Î·¿¤¬°Û¤Ê¤ëÅÀ°Ê³°¤Ï¡¢ +.BR longjmp () +¤ÈƱÍͤǤ¢¤ë¡£ +\fIenv\fP ¤òÊݸ¤·¤¿ +.BR sigsetjmp (3) +¤¬ 0 °Ê³°¤Î \fIsavesigs\fP ¥Õ¥é¥°¤Ç¸Æ¤Ó½Ð¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ç¡¢ +¤«¤Ä¡¢¤½¤Î¾ì¹ç¤Ë¤Î¤ß¡¢ +.BR siglongjmp (3) +¤Ï +.BR sigsetjmp (3) +¤è¤êÊݸ¤µ¤ì¤Æ¤¤¤¿¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÎÉü¸µ¤ò¹Ô¤¦¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O These functions never return. +¤³¤ì¤é¤Î´Ø¿ô¤¬Ê֤뤳¤È¤Ï¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O C89, C99, and POSIX.1-2001 specify +.\"O .BR longjmp (). +.\"O POSIX.1-2001 specifies +.\"O .BR siglongjmp (). +.BR longjmp () +¤Ï C89, C99, POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.BR siglongjmp () +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O POSIX does not specify whether +.\"O .BR longjmp () +.\"O will restore the signal context (see +.\"O .BR setjmp (3) +.\"O for some more details). +.\"O If you want to portably save and restore signal masks, use +.\"O .BR sigsetjmp () +.\"O and +.\"O .BR siglongjmp (). +POSIX ¤Ç¤Ï¡¢ +.BR longjmp () +¤¬¥·¥°¥Ê¥ë¥³¥ó¥Æ¥­¥¹¥È (signal context) ¤òÉü¸µ¤¹¤ë¤«¤É¤¦¤«µ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤ +.RB ( setjmp (3) +¤Ë¤â¾¯¤·¾Ü¤·¤¤¾ðÊ󤬤¢¤ë)¡£ +°Ü¿¢À­¤Î¤¢¤ëÊýË¡¤Ç¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊݸ¤·Éü¸µ¤µ¤»¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +.BR sigsetjmp (3) +¤È +.BR siglongjmp () +¤ò»È¤¦¤³¤È¡£ +.P +.\"O The values of automatic variables are unspecified after a call to +.\"O .BR longjmp () +.\"O if they meet all the following criteria: +°Ê²¼¤Î¾ò·ï¤¬Á´¤ÆÀ®Î©¤¹¤ë¾ì¹ç¡¢ +.BR longjmp () +¤Î¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤¿¸å¤Î¼«Æ°ÊÑ¿ô¤ÎÃͤÏ̤ÄêµÁ (unspecified) ¤È¤Ê¤ë¡£ +.IP \(bu 3 +.\"O they are local to the function that made the corresponding +.\"O .BR setjmp (3) +.\"O call; +¤½¤Î¼«Æ°ÊÑ¿ô¤¬¡¢Âбþ¤¹¤ë +.BR setjmp (3) +¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ã¤¿´Ø¿ô¤Î¥í¡¼¥«¥ëÊÑ¿ô¤Ç¤¢¤ë¡£ +.IP \(bu +.\"O their values are changed between the calls to +.\"O .BR setjmp (3) +.\"O and +.\"O .BR longjmp (); +.\"O and +¼«Æ°ÊÑ¿ô¤ÎÃͤ¬ +.BR setjmp (3) +¤È +.BR longjmp () +¤Î´Ö¤ÇÊѹ¹¤µ¤ì¤Æ¤¤¤ë¡£ +.IP \(bu +.\"O they are not declared as +.\"O .IR volatile . +.I volatile +¤È¤·¤ÆÀë¸À¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.P +.\"O Analogous remarks apply for +.\"O .BR siglongjmp (). +ƱÍͤÎÃí°Õ¤¬ +.BR siglongjmp () +¤Ë¤â¤¢¤Æ¤Ï¤Þ¤ë¡£ +.P +.\"O .BR longjmp () +.\"O and +.\"O .BR siglongjmp () +.\"O make programs hard to +.\"O understand and maintain. +.\"O If possible an alternative should be used. +.BR longjmp () +¤ä +.BR siglongjmp () +¤ò»È¤¦¤È¡¢¥×¥í¥°¥é¥à¤ÏÍý²ò¤·¤Å¤é¤¯¡¢Êݼ餷¤Ë¤¯¤¤¤â¤Î¤Ë¤Ê¤ë¡£ +Ê̤ÎÊýË¡¤¬²Äǽ¤Ê¤é¡¢¤½¤ì¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR setjmp (3), +.BR sigsetjmp (3) diff --git a/draft/man3/lrint.3 b/draft/man3/lrint.3 new file mode 100644 index 00000000..ab9275a0 --- /dev/null +++ b/draft/man3/lrint.3 @@ -0,0 +1,158 @@ +.\" Copyright 2001 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. +.\" +.\" 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 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "long int lrint(double " x ); +.br +.BI "long int lrintf(float " x ); +.br +.BI "long int lrintl(long double " x ); +.sp +.BI "long long int llrint(double " x ); +.br +.BI "long long int llrintf(float " x ); +.br +.BI "long long int llrintl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +All functions shown above: +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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) +¤ò»²¾È)¡£ + +.\"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" +.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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.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 ¤«Ìµ¸ÂÂç¡¢¤â¤·¤¯¤Ï´Ý¤á¤¿Ãͤ¬Â礭²á¤®¤ë +.\" .I errno +.\" is set to +.\" .BR EDOM . +.\"O An invalid floating-point exception +.\"O .RB ( FE_INVALID ) +.\"O is raised. +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR ceil (3), +.BR floor (3), +.BR lround (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3) diff --git a/draft/man3/lround.3 b/draft/man3/lround.3 new file mode 100644 index 00000000..71ff3ed8 --- /dev/null +++ b/draft/man3/lround.3 @@ -0,0 +1,165 @@ +.\" Copyright 2001 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. +.\" +.\" 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 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.nf +.B #include +.sp +.BI "long int lround(double " x ); +.br +.BI "long int lroundf(float " x ); +.br +.BI "long int lroundl(long double " x ); +.sp +.BI "long long int llround(double " x ); +.br +.BI "long long int llroundf(float " x ); +.br +.BI "long long int llroundl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.\"O All functions shown above: +¤³¤³¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î´Ø¿ô: +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +\"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) +»²¾È)¡£ + +.\"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" +.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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.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 +Îΰ襨¥é¡¼ (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 ) +¤¬¾å¤¬¤ë¡£ +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR ceil (3), +.BR floor (3), +.BR lrint (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3) diff --git a/draft/man3/lsearch.3 b/draft/man3/lsearch.3 new file mode 100644 index 00000000..6ce9d631 --- /dev/null +++ b/draft/man3/lsearch.3 @@ -0,0 +1,130 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" Copyright 1995 Jim Van Zandt +.\" +.\" 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. +.\" +.\" Corrected prototype and include, aeb, 990927 +.\" +.\" Japanese Version Copyright (c) 1998 Ueyama Rui +.\" all rights reserved. +.\" Translated 1998-05-23, Ueyama Rui +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" +.\"WORD: linear search Àþ·Á¸¡º÷ +.\" +.TH LSEARCH 3 1999-09-27 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O lfind, lsearch \- linear search of an array +lfind, lsearch \- ÇÛÎó¤òÀþ·Á¸¡º÷¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *lfind(const void *" key ", const void *" base ", size_t *" nmemb , +.BI " size_t " size ", int(*" compar ")(const void *, const void *));" +.sp +.BI "void *lsearch(const void *" key ", void *" base ", size_t *" nmemb , +.BI " size_t " size ", int(*" compar ")(const void *, const void *));" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR lfind () +.\"O and +.\"O .BR lsearch () +.\"O perform a linear search for +.\"O \fIkey\fP in the array \fIbase\fP which has \fI*nmemb\fP elements of +.\"O \fIsize\fP bytes each. +.\"O The comparison function referenced by +.\"O \fIcompar\fP is expected to have two arguments which point to the +.\"O \fIkey\fP object and to an array member, in that order, and which +.\"O returns zero if the \fIkey\fP object matches the array member, and +.\"O nonzero otherwise. +.BR lfind () +¤È +.BR lsearch () +¤Ï¡¢ +.I size +¥Ð¥¤¥È¤ÎÍ×ÁÇ +.I *nmemb +¸Ä¤«¤é¤Ê¤ëÇÛÎó +.I base +¤«¤é¡¢ +.I key +¤òÀþ·Á¸¡º÷¤¹¤ë¡£Èæ³Ó¤ò¹Ô¤¦¤Î¤Ï +.I compar +¤¬»²¾È¤·¤Æ¤¤¤ë´Ø¿ô¤Ç¡¢ +¤³¤ì¤Ï 2¤Ä¤Î°ú¤­¿ô¤ò»ý¤Á¡¢1¤Ä¤á¤Î°ú¤­¿ô¤¬ +.I key +¤ò¡¢2¤Ä¤á¤Î°ú¤­¿ô¤ÏÇÛÎó¥á¥ó¥Ð¡¼¤ò»Ø¤¹¡£¤Þ¤¿ +.I compar +¤Ï¡¢ +.I key +¤¬ÇÛÎó¤Î¥á¥ó¥Ð¡¼¤È¥Þ¥Ã¥Á¤·¤¿¤Ê¤é 0¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð +0 °Ê³°¤òÊÖ¤¹¤³¤È¤¬´üÂÔ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O If +.\"O .BR lsearch () +.\"O does not find a matching element, then the \fIkey\fP +.\"O object is inserted at the end of the table, and \fI*nmemb\fP is +.\"O incremented. +.BR lsearch () +¤Ï¡¢¥Þ¥Ã¥Á¤¹¤ëÍ×ÁǤò¸«¤Ä¤±¤é¤ì¤Ê¤«¤Ã¤¿¤È¤­¡¢ +ÇÛÎó¤ÎºÇ¸å¤Ë +.I key +¤ò¤Ä¤±²Ã¤¨¤ë¡£¤½¤·¤Æ +.I *nmemb +¤ò 1 ¤Õ¤ä¤¹¡£ +.\"O In particular, one should know that a matching element +.\"O exists, or that more room is available. +¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ëºÝ¤Ë¤Ï¡¢¥Þ¥Ã¥Á¤¹¤ëÍ×ÁǤ¬Â¸ºß¤¹¤ë¤«¡¢ +¤â¤·¤¯¤ÏÇÛÎó¤ËÍ×ÁǤòÄɲ乤뤿¤á¤ÎÎΰ褬¤¢¤ë¤«¡¢¤òÇÄ°®¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR lfind () +.\"O returns a pointer to a matching member of the array, or +.\"O NULL if no match is found. +.\"O .BR lsearch () +.\"O returns a pointer to +.\"O a matching member of the array, or to the newly added member if no +.\"O match is found. +.BR lfind () +¤ÎÊÖ¤êÃͤϡ¢ÇÛÎó¤Î¥Þ¥Ã¥Á¤·¤¿¥á¥ó¥Ð¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤â¤·¥Þ¥Ã¥Á¤¹¤ë¥á¥ó¥Ð¡¼¤¬¸«¤Ä¤«¤é¤Ê¤¤¤È NULL ¤òÊÖ¤¹¡£ +.BR lsearch () +¤ÎÊÖ¤êÃͤ⡢ÇÛÎó¤Î¥Þ¥Ã¥Á¤·¤¿¥á¥ó¥Ð¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +¥Þ¥Ã¥Á¤¹¤ë¥á¥ó¥Ð¡¼¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¤È¤­¤Ï¡¢ +¿·¤¿¤Ë¤Ä¤±²Ã¤¨¤¿¥á¥ó¥Ð¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O Present in libc since libc-4.6.27. +libc ¤Ë¤Ï libc-4.6.27 °Ê¹ß¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The naming is unfortunate. +´Ø¿ô¤Î̾Á°¤ÎÁª¤ÓÊý¤¬¤è¤¯¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bsearch (3), +.BR hsearch (3), +.BR tsearch (3) diff --git a/draft/man3/lseek64.3 b/draft/man3/lseek64.3 new file mode 100644 index 00000000..9f9c84d7 --- /dev/null +++ b/draft/man3/lseek64.3 @@ -0,0 +1,241 @@ +.\" Copyright 2004 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) 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Jan 30 03:23:04 JST 2005 +.\" by Yuichi SATO +.\" +.TH LSEEK64 3 2004-12-11 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O lseek64 \- reposition 64-bit read/write file offset +lseek64 \- ¥Õ¥¡¥¤¥ë¤Î 64 ¥Ó¥Ã¥È¤ÎÆɤ߽ñ¤­¥ª¥Õ¥»¥Ã¥È¤Î°ÌÃÖ¤òÊѤ¨¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _LARGEFILE64_SOURCE +.br +.B #include +.br +.B #include +.sp +.BI "off64_t lseek64(int " fd ", off64_t " offset ", int " whence ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR lseek (2) +.\"O family of functions reposition the offset of the open file associated +.\"O with the file descriptor +.\"O .I fd +.\"O to +.\"O .I offset +.\"O bytes relative to the start, current position, or end of the file, +.\"O when +.\"O .I whence +.\"O has the value +.\"O .BR SEEK_SET , +.\"O .BR SEEK_CUR , +.\"O or +.\"O .BR SEEK_END , +.\"O respectively. +.BR lseek (2) +´Ø¿ô¥Õ¥¡¥ß¥ê¡¼¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë´ØÏ¢¤¹¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥ª¥Õ¥»¥Ã¥È¤ò¡¢ +¥Õ¥¡¥¤¥ë¤Î³«»Ï°ÌÃÖ¡¦¸½ºß°ÌÃÖ¡¦½ªÃ¼¤«¤é +.I offset +¤Î°ÌÃÖ¤ØÊѹ¹¤¹¤ë¡£ +¤³¤ì¤Ï +.I whence +¤¬¤½¤ì¤¾¤ì +.BR SEEK_SET , +.BR SEEK_CUR , +.B SEEK_END +¤Î¾ì¹ç¤ËÂбþ¤¹¤ë¡£ +.LP +.\"O For more details, return value, and errors, see +.\"O .BR lseek (2). +¹¹¤Ë¾Ü¤·¤¤ÀâÌÀ¡¦ÊÖ¤êÃÍ¡¦¥¨¥é¡¼¤Ï¡¢ +.BR lseek (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +.\"O Four interfaces are available: +.\"O .BR lseek (2), +.\"O .BR lseek64 (), +.\"O .BR llseek (2), +.\"O and the raw system call +.\"O .BR _llseek (2). +4 ¤Ä¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬»ÈÍѲÄǽ¤Ç¤¢¤ë: +.BR lseek (2), +.BR lseek64 (), +.BR llseek (2) +¤È¸µ¤È¤Ê¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR _llseek (2) +¤Ç¤¢¤ë¡£ +.SS lseek +.\"O Prototype: +¥×¥í¥È¥¿¥¤¥×: +.nf +.sp +.in +4n +.BI "off_t lseek(int " fd ", off_t " offset ", int " whence ); +.in +.fi +.sp +.\"O .BR lseek (2) +.\"O uses the type +.\"O .IR off_t . +.BR lseek (2) +¤Ï·¿ +.I off_t +¤ò»È¤¦¡£ +.\"O This is a 32-bit signed type on 32-bit architectures, unless one +.\"O compiles with +¤³¤ì¤Ï 32 ¥Ó¥Ã¥È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¾å¤Ç¤Ï 32 ¥Ó¥Ã¥ÈÉä¹æÉÕ¤­·¿¤Ç¤¢¤ë¡£ +¤¿¤À¤·¡¢ +.nf +.sp +.in +4n +#define _FILE_OFFSET_BITS 64 +.in +.sp +.fi +.\"O in which case it is a 64-bit signed type. +¤òÄêµÁ¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤¿¾ì¹ç¤Ï 64 ¥Ó¥Ã¥ÈÉä¹æÉÕ¤­·¿¤Ç¤¢¤ë¡£ +.SS lseek64 +.\"O Prototype: +¥×¥í¥È¥¿¥¤¥×: +.nf +.sp +.in +4n +.BI "off64_t lseek64(int " fd ", off64_t " offset ", int " whence ); +.in +.fi +.sp +.\"O The library routine +.\"O .BR lseek64 () +.\"O uses a 64-bit type even when +.\"O .I off_t +.\"O is a 32-bit type. +.\"O Its prototype (and the type +.\"O .IR off64_t ) +.\"O is available only when one compiles with +¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR lseek64 () +¤Ï +.I off_t +¤¬ 32 ¥Ó¥Ã¥È·¿¤Ç¤¢¤Ã¤Æ¤â 64 ¥Ó¥Ã¥È·¿¤ò»È¤¦¡£ +¤³¤Î¥×¥í¥È¥¿¥¤¥× (¤È·¿ +.IR off64_t ) +¤Ï¡¢°Ê²¼¤ÎÄêµÁ¤ò¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤¿¾ì¹ç¤Ë¤Î¤ß»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.nf +.sp +.in +4n +#define _LARGEFILE64_SOURCE +.in +.sp +.fi +.\"O The function +.\"O .BR lseek64 () +.\"O .\" in glibc 2.0.94, not in 2.0.6 +.\"O is available since glibc 2.1, and is defined to be an alias for +.\"O .BR llseek (). +´Ø¿ô +.BR lseek64 () +.\" glibc 2.0.94 ¤Ë¤Ï¸ºß¤¹¤ë¤¬ 2.0.6 ¤Ë¤Ï¸ºß¤·¤Ê¤¤ +¤Ï glibc 2.1 °Ê¹ß¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ê¡¢ +.BR llseek () +¤Î¥¨¥¤¥ê¥¢¥¹¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SS llseek +.\"O Prototype: +¥×¥í¥È¥¿¥¤¥×: +.nf +.sp +.in +4n +.BI "loff_t llseek(int " fd ", loff_t " offset ", int " whence ); +.in +.fi +.sp +.\"O The type +.\"O .I loff_t +.\"O is a 64-bit signed type. +·¿ +.I loff_t +¤Ï 64 ¥Ó¥Ã¥ÈÉä¹æÉÕ¤­·¿¤Ç¤¢¤ë¡£ +.\"O The library routine +.\"O .BR llseek () +.\"O .\" in libc 5.0.9, not in 4.7.6 +.\"O is available in libc5 and glibc and works without special defines. +¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR llseek () +.\" libc 5.0.9 ¤Ë¤Ï¸ºß¤¹¤ë¤¬ 4.7.6 ¤Ï¸ºß¤·¤Ê¤¤ +¤Ï libc5 ¤È glibc ¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ê¡¢ÆÃÊ̤ÊÄêµÁ¤Ê¤·¤ËÆ°ºî¤¹¤ë¡£ +.\"O Its prototype was given in +.\"O .I +.\"O with libc5, but glibc does not provide a prototype. +¤³¤Î¥×¥í¥È¥¿¥¤¥×¤Ï¡¢libc5 ¤Ç¤Ï +.I +¤ÇÍ¿¤¨¤é¤ì¤ë¤¬¡¢glibc ¤Ï¥×¥í¥È¥¿¥¤¥×¤òÄ󶡤·¤Ê¤¤¡£ +.\"O This is bad, since a prototype is needed. +.\"O Users should add +.\"O the above prototype, or something equivalent, to their own source. +¤³¤ì¤Ï¥×¥í¥È¥¿¥¤¥×¤¬É¬Íפˤʤë¤Î¤ÇÎɤ¯¤Ê¤¤¡£ +¥æ¡¼¥¶¤Ï¾åµ­¤Î¥×¥í¥È¥¿¥¤¥×¤Þ¤¿¤Ï¤½¤ì¤ÈƱÅù¤Î¤â¤Î¤ò¡¢ +¼«¿È¤Î¥½¡¼¥¹¤ËÄɲ䷤ʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O When users complained about data loss caused by a miscompilation of +.\"O .BR e2fsck (8), +.\"O glibc 2.1.3 added the link-time warning +¤³¤Î¥Ç¡¼¥¿¤¬¤Ê¤¤¤³¤È¤Ë¤è¤Ã¤Æ +.BR e2fsck (8) +¤Î¥³¥ó¥Ñ¥¤¥ë¤¬¼ºÇÔ¤¹¤ë¤È¤¤¤¦¶ì¾ð¤¬¥æ¡¼¥¶¤«¤é½Ð¤¿¤Î¤Ç¡¢ +glibc 2.1.3 ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ê¥ê¥ó¥¯»þ¤Î·Ù¹ð¤¬Äɲ䵤줿¡£ +.sp +.in +4n +"the \`llseek\' function may be dangerous; use \`lseek64\' instead." +.in +.sp +.\"O This makes this function unusable if one desires a warning-free +.\"O compilation. +¤³¤ì¤Ë¤è¤ê¡¢·Ù¹ð¤Ê¤·¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢¤³¤Î´Ø¿ô¤ò»ÈÍÑÉԲĤˤǤ­¤ë¡£ +.SS _llseek +.\"O All the above functions are implemented in terms of this system call. +.\"O The prototype is: +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô¤Ï¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë´ð¤Å¤¤¤Æ¼ÂÁõ¤µ¤ì¤ë¡£ +¥×¥í¥È¥¿¥¤¥×¤Ï°Ê²¼¤ÎÄ̤ê: +.nf +.sp +.in +4n +.BI "int _llseek(int " fd ", off_t " offset_hi ", off_t " offset_lo , +.BI " loff_t *" result ", int " whence ); +.in +.fi +.sp +.\"O For more details, see +.\"O .BR llseek (2). +¹¹¤Ë¾Ü¤·¤¤¾ðÊó¤Ï¡¢ +.BR llseek (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR llseek (2), +.BR lseek (2), +.BR feature_test_macros (7) diff --git a/draft/man3/makecontext.3 b/draft/man3/makecontext.3 new file mode 100644 index 00000000..c09f5fe6 --- /dev/null +++ b/draft/man3/makecontext.3 @@ -0,0 +1,332 @@ +.\" Copyright (C) 2001 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. +.\" 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 +.\" +.TH MAKECONTEXT 3 2009-03-31 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O makecontext, swapcontext \- manipulate user context +.SH ̾Á° +makecontext, swapcontext \- ¥æ¡¼¥¶¥³¥ó¥Æ¥­¥¹¥È¤òÁàºî¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "void makecontext(ucontext_t *" ucp ", void (*" func )(), +.BI "int " argc ", ...);" +.sp +.BI "int swapcontext(ucontext_t *" oucp ", ucontext_t *" ucp ); +.\"O .SH DESCRIPTION +.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 +¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢¤¢¤ë¥×¥í¥»¥¹ÆâÉô¤ÇÀ©¸æ²¼¤Ë¤¢¤ëÊ£¿ô¤Î¥¹¥ì¥Ã¥É´Ö¤Ç¡¢ +¥æ¡¼¥¶¥ì¥Ù¥ë¤Î¥³¥ó¥Æ¥­¥¹¥ÈÀÚÂؤ¨¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.LP +.\"O For the type and the first two functions, see +.\"O .BR getcontext (2). +¤³¤ì¤é¤Î·¿¤È¡¢ºÇ½é¤Î 2 ¤Ä¤Î´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR getcontext (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 ¤Ë +ÂåÆþ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"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 ¤Î¾ì¹ç¡¢¤½¤Î¥¹¥ì¥Ã¥É¤¬½ªÎ»¤¹¤ë¡£ +.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" +.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 ¤òÊÖ¤·¡¢ +\fIerrno\fP ¤ò¥¨¥é¡¼¤Ë±þ¤¸¤ÆÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +.\"O Insufficient stack space left. +¥¹¥¿¥Ã¥¯¤Ë³ä¤êÅö¤Æ¤ë¶õ´Ö¤¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£ +.\"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" +.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 +.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) +¤Î¾ì¹ç¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +¤¹¤Ê¤ï¤Á¤³¤Î¹½Â¤ÂΤˤϡ¢ +¥¹¥¿¥Ã¥¯¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¥á¥â¥êÎΰè¤Î³«»Ï¥¢¥É¥ì¥¹¤ÈŤµ¤¬´Þ¤Þ¤ì¡¢ +¤³¤ì¤Ï¥¹¥¿¥Ã¥¯¤¬¿­¤Ó¤ëÊý¸þ¤¬¤É¤Á¤é¤Ç¤¢¤ë¤«¤Ë¤Ï´Ø·¸¤·¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥æ¡¼¥¶¥×¥í¥°¥é¥à¤Ï¤³¤Î·ï¤Ë¤Ä¤¤¤Æ¤Ï¿´ÇÛ¤·¤Ê¤¯¤Æ¤è¤¤¡£ + +.\"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 (3), +.\"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 (3) +¤ËÊѹ¹¤¬¹Ô¤ï¤ì¡¢(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 () +¤Î»ÈÍÑÊýË¡¤ÎÎã¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤È¡¢°Ê²¼¤Î¤è¤¦¤Ê½ÐÎϤ¬ÆÀ¤é¤ì¤ë: +.in +4n +.nf + +.RB "$" " ./a.out" +main: swapcontext(&uctx_main, &uctx_func2) +func2: started +func2: swapcontext(&uctx_func2, &uctx_func1) +func1: started +func1: swapcontext(&uctx_func1, &uctx_func2) +func2: returning +func1: returning +main: exiting +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include + +static ucontext_t uctx_main, uctx_func1, uctx_func2; + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +static void +func1(void) +{ + printf("func1: started\\n"); + printf("func1: swapcontext(&uctx_func1, &uctx_func2)\\n"); + if (swapcontext(&uctx_func1, &uctx_func2) == \-1) + handle_error("swapcontext"); + printf("func1: returning\\n"); +} + +static void +func2(void) +{ + printf("func2: started\\n"); + printf("func2: swapcontext(&uctx_func2, &uctx_func1)\\n"); + if (swapcontext(&uctx_func2, &uctx_func1) == \-1) + handle_error("swapcontext"); + printf("func2: returning\\n"); +} + +int +main(int argc, char *argv[]) +{ + char func1_stack[16384]; + char func2_stack[16384]; + + if (getcontext(&uctx_func1) == \-1) + handle_error("getcontext"); + uctx_func1.uc_stack.ss_sp = func1_stack; + uctx_func1.uc_stack.ss_size = sizeof(func1_stack); + uctx_func1.uc_link = &uctx_main; + makecontext(&uctx_func1, func1, 0); + + if (getcontext(&uctx_func2) == \-1) + handle_error("getcontext"); + uctx_func2.uc_stack.ss_sp = func2_stack; + uctx_func2.uc_stack.ss_size = sizeof(func2_stack); + /* Successor context is f1(), unless argc > 1 */ + uctx_func2.uc_link = (argc > 1) ? NULL : &uctx_func1; + makecontext(&uctx_func2, func2, 0); + + printf("main: swapcontext(&uctx_main, &uctx_func2)\\n"); + if (swapcontext(&uctx_main, &uctx_func2) == \-1) + handle_error("swapcontext"); + + printf("main: exiting\\n"); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getcontext (2), +.BR sigaction (2), +.BR sigaltstack (2), +.BR sigprocmask (2), +.BR sigsetjmp (3) diff --git a/draft/man3/malloc.3 b/draft/man3/malloc.3 new file mode 100644 index 00000000..bdc37fa5 --- /dev/null +++ b/draft/man3/malloc.3 @@ -0,0 +1,484 @@ +.\" 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 new file mode 100644 index 00000000..e066dc43 --- /dev/null +++ b/draft/man3/malloc_hook.3 @@ -0,0 +1,195 @@ +.\" 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/mblen.3 b/draft/man3/mblen.3 new file mode 100644 index 00000000..695064ef --- /dev/null +++ b/draft/man3/mblen.3 @@ -0,0 +1,132 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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 +.\" +.\" +.TH MBLEN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mblen \- determine number of bytes in next multibyte character +mblen \- ¼¡¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int mblen(const char *" s ", size_t " n ); +.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 ¤«¤é¾ÃÈñ¤µ¤ì¤ë +¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤¬¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð 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 °Ê¾å¤Î¾ì¹ç¤Ë¤â +¤³¤Î¤è¤¦¤Ê¤³¤È¤¬µ¯¤³¤ê¤¨¤ë¡£ +.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 ¤òÊÖ¤¹¡£ +.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" +.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" +.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 +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.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" +.SH ´ØÏ¢¹àÌÜ +.BR mbrlen (3) diff --git a/draft/man3/mbrlen.3 b/draft/man3/mbrlen.3 new file mode 100644 index 00000000..865e7ef9 --- /dev/null +++ b/draft/man3/mbrlen.3 @@ -0,0 +1,127 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:19 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH MBRLEN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mbrlen \- determine number of bytes in next multibyte character +mbrlen \- ¼¡¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ÎŤµ¤ò¥Ð¥¤¥È¿ô¤ÇÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t mbrlen(const char *" s ", size_t " n ", mbstate_t *" ps ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR mbrlen () +.\"O function inspects at most \fIn\fP bytes of the multibyte +.\"O string starting at \fIs\fP and extracts the next complete multibyte character. +.\"O It updates the shift state \fI*ps\fP. +.\"O If the multibyte character is not the +.\"O null wide character, it returns the number of bytes that were consumed from +.\"O \fIs\fP. +.\"O If the multibyte character is the null wide character, it resets the +.\"O shift state \fI*ps\fP to the initial state and returns 0. +.BR mbrlen () +´Ø¿ô¤Ï \fIs\fP ¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò +ºÇÂç \fIn\fP ¥Ð¥¤¥ÈÄ´¤Ù¤Æ¼¡¤Î´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò¼è¤ê½Ð¤¹¡£ +Ʊ»þ¤Ë¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò¹¹¿·¤¹¤ë¡£ +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤¬¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ç¤Ê¤±¤ì¤Ð \fIs\fP ¤«¤é +¾ÃÈñ¤¹¤ë¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò +½é´ü¾õÂÖ¤ËÌᤷ¤Æ¡¢0 ¤òÊÖ¤¹¡£ +.PP +.\"O If the \fIn\fP bytes starting at \fIs\fP do not contain a complete multibyte +.\"O character, +.\"O .BR mbrlen () +.\"O returns \fI(size_t)\ \-2\fP. +.\"O This can happen even if +.\"O \fIn\fP >= \fIMB_CUR_MAX\fP, if the multibyte string contains redundant shift +.\"O sequences. +\fIs\fP ¤«¤é»Ï¤Þ¤ë \fIn\fP ¥Ð¥¤¥È¤Îʸ»úÎ󤬴°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò´Þ¤ó¤Ç +¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï +.BR mbrlen () +¤Ï \fI(size_t)\ \-2\fP ¤òÊÖ¤¹¡£ +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤Ë¾éĹ¤Ê¥·¥Õ¥È¥·¡¼¥±¥ó¥¹¤ò´Þ¤Þ¤ì¤Æ¤¤¤ë¤È +\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 mbrlen () +.\"O returns +.\"O \fI(size_t)\ \-1\fP and sets \fIerrno\fP to \fBEILSEQ\fP. +.\"O In this case, +.\"O the effects on \fI*ps\fP are undefined. +\fIs\fP ¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬡¢¼¡¤Î´°Á´¤Êʸ»ú¤ÎÁ°¤Ë +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR mbrlen () +¤Ï +\fI(size_t)\ \-1\fP ¤òÊÖ¤· \fIerrno\fP ¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¾ì¹ç¤Î \fI*ps\fP ¤Ø¤Î±Æ¶Á¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.PP +.\"O If \fIps\fP is a NULL pointer, a static anonymous state only known to the +.\"O .BR mbrlen () +.\"O function is used instead. +\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ê¤é¤Ð¡¢Âå¤ê¤Ë +.BR mbrlen () +´Ø¿ô¤Î¤ß¤¬»ÈÍѤ¹¤ëÀÅŪ¤Ç̾Á°¤Î¤Ê¤¤¾õÂÖ¤¬»ÈÍѤµ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR mbrlen () +.\"O function returns the number of bytes +.\"O parsed from the multibyte +.\"O sequence starting at \fIs\fP, if a non-null wide character was recognized. +¥Ê¥ë¥ï¥¤¥Éʸ»ú°Ê³°¤Îʸ»ú¤ò³Îǧ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +.BR mbrlen () +´Ø¿ô¤Ï \fIs\fP +¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥ÈÎ󤫤é»ÈÍѤ·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +.\"O It returns 0, if a null wide character was recognized. +.\"O It returns +.\"O .I "(size_t)\ \-1" +.\"O and sets \fIerrno\fP to \fBEILSEQ\fP, if an invalid multibyte sequence was +.\"O encountered. +.\"O It returns \fI(size_t)\ \-2\fP if it couldn't parse a complete multibyte +.\"O character, meaning that \fIn\fP should be increased. +¥Ê¥ë¥ï¥¤¥Éʸ»ú¤¬³Îǧ¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¾ì¹ç¤Ë¤Ï +.I "(size_t)\ \-1" +¤òÊÖ¤· +\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£ +´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò²òÀϤǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï \fI(size_t)\ \-2\fP ¤òÊÖ¤¹¡£ +¤³¤ì¤Ï \fIn\fP ¤òÁý¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR mbrlen () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR mbrlen () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mbrtowc (3) diff --git a/draft/man3/mbrtowc.3 b/draft/man3/mbrtowc.3 new file mode 100644 index 00000000..2c9e08be --- /dev/null +++ b/draft/man3/mbrtowc.3 @@ -0,0 +1,182 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:16 JST 2000 +.\" by HANATAKA Shinya +.\" Updated Thu Dec 13 JST 2001 by Kentaro Shirakata +.\" +.TH MBRTOWC 3 2001-11-22 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mbrtowc \- convert a multibyte sequence to a wide character +mbrtowc \- ¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t mbrtowc(wchar_t *" pwc ", const char *" s ", size_t " n \ +", mbstate_t *" ps ); +.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 mbrtowc () +.\"O function inspects at most \fIn\fP +.\"O bytes of the multibyte string starting at \fIs\fP, extracts the next complete +.\"O multibyte character, converts it to a wide character and stores it at +.\"O \fI*pwc\fP. +.\"O It updates the shift state \fI*ps\fP. +.\"O If the converted wide +.\"O character is not L\(aq\\0\(aq, it returns the number of bytes that were consumed +.\"O from \fIs\fP. +.\"O If the converted wide character is L\(aq\\0\(aq, it resets the shift +.\"O state \fI*ps\fP to the initial state and returns 0. +¤³¤Î´Ø¿ô¤¬ÍѤ¤¤é¤ì¤ë¾ì¹ç¡¢Ä̾ï \fIs\fP ¤¬ NULL ¤Ç¤Ê¤¯ \fIpwc\fP ¤â NULL ¤Ç +¤Ê¤¤¡£¤³¤Î¾ì¹ç¤Ï¡¢ +.BR mbrtowc () +´Ø¿ô¤Ï \fIs\fP ¤«¤é»Ï¤Þ¤ëºÇÂç \fIn\fP ¥Ð¥¤¥È¤Î +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò¸¡ºº¤·¤Æ¡¢¼¡¤Î´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò¼è¤ê½Ð¤·¡¢ +¤½¤ì¤ò¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤·¤Æ \fI*pwc\fP ¤Ë³ÊǼ¤¹¤ë¡£ +Ʊ»þ¤Ë¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò¹¹¿·¤¹¤ë¡£ÊÑ´¹¤·¤¿¥ï¥¤¥Éʸ»ú¤¬ L\(aq\\0\(aq ¤Ç +¤Ê¤±¤ì¤Ð¡¢\fIs\fP ¤«¤é¾ÃÈñ¤¹¤ë¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +ÊÑ´¹¤·¤¿¥ï¥¤¥Éʸ»ú¤¬ L\(aq\\0\(aq ¤Î¾ì¹ç¤Ë¤Ï¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò +½é´ü¾õÂÖ¤ËÌᤷ¤Æ 0 ¤òÊÖ¤¹¡£ +.PP +.\"O If the \fIn\fP bytes starting at \fIs\fP do not contain a complete multibyte +.\"O character, +.\"O .BR mbrtowc () +.\"O returns \fI(size_t)\ \-2\fP. +.\"O This can happen even if +.\"O \fIn\fP >= \fIMB_CUR_MAX\fP, if the multibyte string contains redundant shift +.\"O sequences. +\fIs\fP ¤«¤é»Ï¤Þ¤ë \fIn\fP ¥Ð¥¤¥È¤¬´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò´Þ¤ó¤Ç¤¤¤Ê¤¤ +¾ì¹ç¤Ë¤Ï¡¢ +.BR mbrtowc () +¤Ï \fI(size_t)\ \-2\fP ¤òÊÖ¤¹¡£ +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤Ë¾éĹ¤Ê¥·¥Õ¥È¥·¡¼¥±¥ó¥¹¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤È¡¢ +\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 mbrtowc () +.\"O returns +.\"O \fI(size_t)\ \-1\fP and sets \fIerrno\fP to \fBEILSEQ\fP. +.\"O In this case, +.\"O the effects on \fI*ps\fP are undefined. +\fIs\fP ¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬡¢¼¡¤Î´°Á´¤Êʸ»ú¤ÎÁ°¤Ë +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR mbrtowc () +¤Ï +\fI(size_t)\ \-1\fP ¤òÊÖ¤·¡¢\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£ +¤³¤Î¾ì¹ç¤Ï \fI*ps\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 mbrtowc () +.\"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 mbrtowc () +´Ø¿ô¤Ï +¾åµ­¤ÈƱÍͤËÆ°ºî¤¹¤ë¤¬¡¢ÊÑ´¹¤·¤¿¥ï¥¤¥Éʸ»ú¤Ï¥á¥â¥ê¤Ë¤Ï½ñ¤­¹þ¤Þ¤ì¤Ê¤¤¡£ +.PP +.\"O A third case is when \fIs\fP is NULL. +.\"O In this case, \fIpwc\fP and \fIn\fP are +.\"O ignored. +.\"O If the conversion state represented by \fI*ps\fP denotes an +.\"O incomplete multibyte character conversion, the +.\"O .BR mbrtowc () +.\"O function +.\"O returns \fI(size_t)\ \-1\fP, sets \fIerrno\fP to \fBEILSEQ\fP, and +.\"O leaves \fI*ps\fP in an undefined state. +.\"O Otherwise, the +.\"O .BR mbrtowc () +.\"O function +puts \fI*ps\fP in the initial state and returns 0. +»°ÈÖÌܤξì¹ç¤È¤·¤Æ \fIs\fP ¤¬ NULL ¤Î¾ì¹ç¡¢ \fIpwc\fP ¤È \fIn\fP ¤Ï +̵»ë¤µ¤ì¤ë¡£ +\fI*ps\fP ¤¬É½¸½¤¹¤ëÊÑ´¹¾õÂÖ¤¬ÉÔ´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÊÑ´¹¤ò¼¨¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.BR mbrtowc () +´Ø¿ô¤Ï \fI(size_t)\ \-1\fP ¤òÊÖ¤·¡¢ +\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤ò¥»¥Ã¥È¤·¡¢ +\fI*ps\fP ¤Ï̤ÄêµÁ¾õÂ֤Τޤޤˤ¹¤ë¡£ +¤µ¤â¤Ê¤±¤ì¤Ð¡¢ +.BR mbrtowc () +´Ø¿ô¤Ï \fI*ps\fP ¤ò½é´ü¾õÂ֤ˤ·¤Æ 0 ¤òÊÖ¤¹¡£ +.PP +.\"O In all of the above cases, if \fIps\fP is a NULL pointer, a static anonymous +.\"O state only known to the mbrtowc function is used instead. +¾åµ­¤ÎÁ´¤Æ¤Î¾ì¹ç¤Ë¤ª¤¤¤Æ¡¢\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ê¤é¤ÐÂå¤ï¤ê¤Ë +mbrtowc ´Ø¿ô¤Î¤ß¤¬»ÈÍѤ¹¤ëÀÅŪ¤Ç̾Á°¤Î¤Ê¤¤¾õÂÖ¤¬»ÈÍѤµ¤ì¤ë¡£ +.\"O Otherwise, \fI*ps\fP must be a valid \fImbstate_t\fP object. +¤µ¤â¤Ê¤±¤ì¤Ð¡¢\fI*ps\fP ¤ÏÍ­¸ú¤Ê \fImbstate_t\fP ¥ª¥Ö¥¸¥§¥¯¥È¤Ç +¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O An \fImbstate_t\fP object \fIa\fP can be initialized to the initial state +.\"O by zeroing it, for example using +\fImbstate_t\fP ¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ë \fIa\fP ¤Ï¥¼¥í¤ÇËä¤á¤ë¤³¤È¤Ë¤è¤Ã¤Æ +½é´ü¾õÂ֤˽é´ü²½¤Ç¤­¤ë¡£°Ê²¼¤ËÎã¤ò¼¨¤¹¡£ +.sp +.in +4n +memset(&a, 0, sizeof(a)); +.in +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR mbrtowc () +.\"O function returns the number of bytes parsed from the +.\"O multibyte sequence starting at \fIs\fP, if a non-L\(aq\\0\(aq wide character +.\"O was recognized. +L\(aq\\0\(aq °Ê³°¤Î¥ï¥¤¥Éʸ»ú¤òǧ¼±¤·¤¿¾ì¹ç¤Ë¤Ï +.BR mbrtowc () +´Ø¿ô¤Ï \fIs\fP +¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥ÈÎ󤫤é²òÀϤ·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +.\"O It returns 0, if a L\(aq\\0\(aq wide character was recognized. +.\"O It returns +.\"O .I (size_t)\ \-1 +.\"O and sets \fIerrno\fP to \fBEILSEQ\fP, if an invalid multibyte sequence was +.\"O encountered. +.\"O It returns \fI(size_t)\ \-2\fP if it couldn't parse a complete multibyte +.\"O character, meaning that \fIn\fP should be increased. +L\(aq\\0\(aq ¥ï¥¤¥Éʸ»ú¤òǧ¼±¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤òÊÖ¤·¡¢ +\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò +²òÀϤǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-2 +¤òÊÖ¤· \fIn\fP ¤òÁý²Ã¤µ¤»¤ëɬÍפ¬¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR mbrtowc () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR mbrtowc () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mbsrtowcs (3) diff --git a/draft/man3/mbsinit.3 b/draft/man3/mbsinit.3 new file mode 100644 index 00000000..a354077e --- /dev/null +++ b/draft/man3/mbsinit.3 @@ -0,0 +1,136 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:13 JST 2000 +.\" by HANATAKA Shinya +.\" +.\"WORD: initial shift state ½é´ü¥·¥Õ¥È¾õÂÖ +.\" +.TH MBSINIT 3 2000-11-20 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mbsinit \- test for initial shift state +mbsinit \- ½é´ü¥·¥Õ¥È¾õÂÖ¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int mbsinit(const mbstate_t *" ps ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Character conversion between the multibyte representation and the wide +.\"O character representation uses conversion state, of type \fImbstate_t\fP. +.\"O Conversion of a string uses a finite-state machine; when it is interrupted +.\"O after the complete conversion of a number of characters, it may need to +.\"O save a state for processing the remaining characters. +.\"O Such a conversion +.\"O state is needed for the sake of encodings such as ISO-2022 and UTF-7. +ʸ»ú¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èɽ¸½¤È¥ï¥¤¥Éʸ»úɽ¸½¤Î´Ö¤ÇÊÑ´¹¤¹¤ë¾ì¹ç¤Ë¤Ï +\fImbstate_t\fP ·¿¤ÎÊÑ´¹¾õÂÖ¤ò»ÈÍѤ¹¤ë¡£Ê¸»úÎó¤ÎÊÑ´¹¤ÏÍ­¸Â¾õÂÖ¥Þ¥·¥ó +¤ò»ÈÍѤ¹¤ë¡£¤¤¤¯¤é¤«¤Îʸ»ú¤ÎÊÑ´¹¤ò´°Î»¤·¤¿¸å¤Ë¡¢»Ä¤ê¤Îʸ»ú¤ò½èÍý¤¹¤ë +¤¿¤á¤Ë¾õÂÖ¤òÊݸ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£¤³¤Î¤è¤¦¤ÊÊÑ´¹¾õÂÖ¤Ï +ISO-2022 ¤ä UTF-7 ¤Î¤è¤¦¤ÊÉä¹æ¤ò°·¤¦¤Î¤ËɬÍפȤµ¤ì¤ë¡£ +.PP +.\"O The initial state is the state at the beginning of conversion of a string. +.\"O There are two kinds of state: The one used by multibyte to wide character +.\"O conversion functions, such as +.\"O .BR mbsrtowcs (3), +.\"O and the one used by wide +.\"O character to multibyte conversion functions, such as +.\"O .BR wcsrtombs (3), +.\"O but they both fit in a \fImbstate_t\fP, and they both have the same +.\"O representation for an initial state. +½é´ü¾õÂ֤ȤÏʸ»úÎó¤ÎÊÑ´¹¤ò³«»Ï¤¹¤ë»þ¤Î¾õÂ֤Ǥ¢¤ë¡£¾õÂ֤ˤÏÆó¼ïÎब +¸ºß¤·¡¢°ì¤Ä¤Ï +.BR mbsrtowcs (3) +¤Î¤è¤¦¤Ê¥Þ¥ë¥Á¥Ð¥¤¥È¤ò¥ï¥¤¥Éʸ»ú¤Ë +ÊÑ´¹¤¹¤ë´Ø¿ô¤Ç»ÈÍѤµ¤ì¤ë¡£¤â¤¦°ì¤Ä¤Ï +.BR wcsrtombs (3) +¤Î¤è¤¦¤Ê +¥ï¥¤¥Éʸ»ú¤ò¥Þ¥ë¥Á¥Ð¥¤¥È¤ËÊÑ´¹¤¹¤ë´Ø¿ô¤Ç»ÈÍѤµ¤ì¤ë¡£¤·¤«¤·Î¾Êý¤È¤â +\fImbstate_t\fP ¤Ë³ÊǼ¤µ¤ì¡¢½é´ü¾õÂ֤Ȥ·¤ÆƱ¤¸É½¸½¤ò»ý¤Ä¡£ +.PP +.\"O For 8-bit encodings, all states are equivalent to the initial state. +.\"O For multibyte encodings like UTF-8, EUC-*, BIG5 or SJIS, the wide character +.\"O to multibyte conversion functions never produce non-initial states, but the +.\"O multibyte to wide-character conversion functions like +.\"O .BR mbrtowc (3) +.\"O do +.\"O produce non-initial states when interrupted in the middle of a character. +8¥Ó¥Ã¥ÈÉä¹æ¤Ë¤ª¤¤¤Æ¤ÏÁ´¤Æ¤Î¾õÂ֤Ͻé´ü¾õÂÖ¤ÈÅù²Á¤Ç¤¢¤ë¡£ +UTF-8, EUC-*, BIG5, SJIS ¤Î¤è¤¦¤Ê¿¥Ð¥¤¥ÈÉä¹æ¤Ë¤ª¤¤¤Æ¥ï¥¤¥Éʸ»ú¤«¤é +¿¥Ð¥¤¥Èʸ»ú¤Ø¤ÎÊÑ´¹´Ø¿ô¤ÏÈó½é´ü¾õÂ֤ˤϤʤé¤Ê¤¤¡£ +¤·¤«¤· +.BR mbrtowc (3) +¤Î¤è¤¦¤Ê¿¥Ð¥¤¥Èʸ»ú¤«¤é¥ï¥¤¥Éʸ»ú¤Ø¤ÎÊÑ´¹´Ø¿ô¤Ç¤Ï +ʸ»ú¤Î²ò¼á¤ÎÅÓÃæ¤ÇÈó½é´ü¾õÂ֤Ȥʤë¾ì¹ç¤¬¤¢¤ë¡£ +.PP +.\"O One possible way to create an +.\"O .I mbstate_t +.\"O in initial +.\"O state is to set it to zero: +½é´ü¾õÂ֤Π+.I mbstate_t +¤òºîÀ®¤¹¤ëÊýË¡¤Î°ì¤Ä¤Ï¡¢¤½¤ì¤ò¥¼¥í¤ËÀßÄꤹ¤ë¤³¤È¤Ç¤¢¤ë: +.nf + + mbstate_t state; + memset(&state,0,sizeof(mbstate_t)); +.fi +.PP +.\"O On Linux, the following works as well, but might generate compiler warnings: +Linux ¤Ë¤ª¤¤¤Æ¤Ï°Ê²¼¤ÎÊýË¡¤Ç¤âƱÍͤǤ¢¤ë¤¬¡¢¥³¥ó¥Ñ¥¤¥é¡¼¤Î·Ù¹ð¤¬ +À¸À®¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.nf + + mbstate_t state = { 0 }; +.fi +.PP +.\"O The function +.\"O .BR mbsinit () +.\"O tests whether \fI*ps\fP corresponds to an +.\"O initial state. +.BR mbsinit () +¤Ï \fI*ps\fP ¤¬½é´ü¾õÂ֤˰ìÃפ¹¤ë¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR mbsinit () +.\"O returns nonzero if \fI*ps\fP is an initial state, or if +.\"O \fIps\fP is a null pointer. +.\"O Otherwise it returns 0. +.BR mbsinit () +¤Ï \fI*ps\fP ¤¬½é´ü¾õÂ֤ξì¹ç¤ä NULL ¥Ý¥¤¥ó¥¿¡¼¤Î¾ì¹ç¤Ë¤Ï +¥¼¥í°Ê³°¤òÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR mbsinit () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR mbsinit () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mbsrtowcs (3), +.BR wcsrtombs (3) diff --git a/draft/man3/mbsnrtowcs.3 b/draft/man3/mbsnrtowcs.3 new file mode 100644 index 00000000..2bd81ecf --- /dev/null +++ b/draft/man3/mbsnrtowcs.3 @@ -0,0 +1,168 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Tue Jan 11 00:56:10 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH MBSNRTOWCS 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mbsnrtowcs \- convert a multibyte string to a wide-character string +mbsnrtowcs \- ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "size_t mbsnrtowcs(wchar_t *" dest ", const char **" src , +.BI " size_t " nms ", size_t " len ", mbstate_t *" ps ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR mbsnrtowcs () +.\"O function is like the +.\"O .BR mbsrtowcs (3) +.\"O function, except that +.\"O the number of bytes to be converted, starting at \fI*src\fP, is limited to +.\"O \fInms\fP. +.BR mbsnrtowcs () +´Ø¿ô¤Ï +.BR mbsrtowcs (3) +´Ø¿ô¤Ë»÷¤Æ¤¤¤ë¤¬ +ÊÑ´¹¤¹¤ë¥Ð¥¤¥È¿ô¤¬ \fI*src\fP ¤«¤é»Ï¤Þ¤ë \fInms\fP ¥Ð¥¤¥È¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë +ÅÀ¤¬°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +.PP +.\"O If \fIdest\fP is not a NULL pointer, the +.\"O .BR mbsnrtowcs () +.\"O function converts at +.\"O most \fInms\fP bytes from the +.\"O multibyte string \fI*src\fP to a wide-character string starting at \fIdest\fP. +.\"O At most \fIlen\fP wide characters are written to \fIdest\fP. +.\"O The shift state +.\"O \fI*ps\fP is updated. +.\"O The conversion is effectively performed by repeatedly +.\"O calling +.\"O .I "mbrtowc(dest, *src, n, ps)" +.\"O where \fIn\fP is some +.\"O positive number, as long as this call succeeds, and then incrementing +.\"O \fIdest\fP by one and \fI*src\fP by the number of bytes consumed. +.\"O The +.\"O conversion can stop for three reasons: +\fIdest\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ç¤Ê¤±¤ì¤Ð +.BR mbsnrtowcs () +´Ø¿ô¤Ï +\fI*src\fP ¤«¤é¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ÎºÇÂç \fInms\fP ¤Þ¤Ç¤ò +\fIdest\fP ¤«¤é¤Î¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£ +ºÇÂç \fIlen\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤¬ \fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +Ʊ»þ¤Ë¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò¹¹¿·¤¹¤ë¡£ +ÊÑ´¹¤Ï +.I "mbrtowc(dest, *src, n, ps)" +¤ò¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¸Â¤ê¡¢·«¤êÊÖ¤·¼Â¹Ô¤·¤¿¤Î¤È¼Â¼ÁŪ¤ËƱÍͤǤ¢¤ë¡£ +¤³¤³¤Ç¤Î \fIn\fP ¤ÏÀµ¤Î¿ô¤Ç¤¢¤ê¡¢·«¤êÊÖ¤·¤´¤È¤Ë \fIdest\fP ¤¬ 1 Áý²Ã¤µ¤»¤é¤ì¡¢ +\fI*src\fP ¤¬¾ÃÈñ¤·¤¿¥Ð¥¤¥È¿ô¤À¤±Áý²Ã¤µ¤»¤é¤ì¤ë¡£ÊÑ´¹¤Ï°Ê²¼¤Î»°¤Ä¤Î +¤¤¤º¤ì¤«¤Î¾ò·ï¤ÇÄä»ß¤¹¤ë: +.IP 1. 3 +.\"O An invalid multibyte sequence has been encountered. +.\"O In this case \fI*src\fP +.\"O is left pointing to the invalid multibyte sequence, +.\"O .I (size_t)\ \-1 +.\"O is returned, +.\"O and \fIerrno\fP is set to \fBEILSEQ\fP. +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¡£¤³¤Î¾ì¹ç¤Ë¤Ï \fI*src\fP ¤ÏÉÔÀµ¤Ê +¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò»Ø¤¹¤è¤¦¤Ë¤·¤Æ¡¢ +.I (size_t)\ \-1 +¤òÊÖ¤·¡¢\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£ +.IP 2. +.\"O The \fInms\fP limit forces a stop, +.\"O or \fIlen\fP non-L\(aq\\0\(aq wide characters +.\"O have been stored at \fIdest\fP. +.\"O In this case \fI*src\fP is left pointing to the +.\"O next multibyte sequence to be converted, and the number of wide characters +.\"O written to \fIdest\fP is returned. +\fInms\fP À©¸Â¤Ë¤è¤Ã¤Æ¶¯À©Åª¤ËÄä»ß¤¹¤ë¤«¡¢\fIlen\fP ʸ»ú¤Î L\(aq\\0\(aq °Ê³°¤Î +¥ï¥¤¥Éʸ»ú¤ò \fIdest\fP ¤Ë³ÊǼ¤·¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ï \fI*src\fP ¤Ï +¼¡¤ËÊÑ´¹¤µ¤ì¤ë¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò»Ø¤¹¤è¤¦¤Ë¤·¤Æ¡¢\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿ +¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +.IP 3. +.\"O The multibyte string has been completely converted, including the +.\"O terminating \(aq\\0\(aq +.\"O (which has the side effect of bringing back \fI*ps\fP to the +.\"O initial state). +.\"O In this case \fI*src\fP is set to NULL, and the number of wide +.\"O characters written to \fIdest\fP, +.\"O excluding the terminating L\(aq\\0\(aq character, +.\"O is returned. +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬽ªÃ¼¤Î \(aq\\0\(aq ¤Þ¤Ç´Þ¤á¤Æ´°Á´¤ËÊÑ´¹¤µ¤ì¤¿¾ì¹ç¡£ +(¤³¤Î»þ¡¢ÉûºîÍѤȤ·¤Æ \fI*ps\fP ¤¬½é´ü¾õÂÖ¤ËÌᤵ¤ì¤ë¡£) +¤³¤Î¾ì¹ç¤Ï \fI*src\fP ¤Ë¤Ï NULL ¤¬ÀßÄꤵ¤ì¡¢½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤ò½ü¤¤¤Æ +\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¿ô¤òÊÖ¤¹¡£ +.PP +.\"O If \fIdest\fP is NULL, \fIlen\fP is ignored, and the conversion proceeds as +.\"O above, except that the converted wide characters +.\"O are not written out to memory, +.\"O and that no destination length limit exists. +\fIdest\fP ¤¬ NULL ¤Î¾ì¹ç¡¢\fIlen\fP ¤Ï̵»ë¤µ¤ì¡¢¾åµ­¤ÈƱÍͤÎÊÑ´¹¤¬ +¹Ô¤ï¤ì¤ë¤¬¡¢ÊÑ´¹¤µ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Ï¥á¥â¥ê¤Ë½ñ¤­¹þ¤Þ¤ì¤º¡¢ÊÑ´¹Àè¤Î¾å¸Â +¤¬Â¸ºß¤·¤Ê¤¤¡£ +.PP +.\"O In both of the above cases, if \fIps\fP is a NULL pointer, a static anonymous +.\"O state only known to the mbsnrtowcs function is used instead. +¾åµ­¤Î¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ê¤é¤Ð¡¢Âå¤ê¤Ë +mbsnrtowcs ´Ø¿ô¤Î¤ß¤¬»ÈÍѤ¹¤ëÀÅŪ¤Ç̾Á°¤Î¤Ê¤¤¾õÂÖ¤¬»ÈÍѤµ¤ì¤ë¡£ +.PP +.\"O The programmer must ensure that there is room for at least \fIlen\fP wide +.\"O characters at \fIdest\fP. +¥×¥í¥°¥é¥Þ¡¼¤Ï \fIdest\fP ¤ËºÇÄã¤Ç¤â \fIlen\fP ¥ï¥¤¥Éʸ»ú¤ò½ñ¤­¹þ¤à¤³ +¤È¤¬¤Ç¤­¤ë¶õ´Ö¤¬¤¢¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR mbsnrtowcs () +.\"O function returns the number of wide characters +.\"O that make up the converted part of the wide-character string, +.\"O not including the terminating null wide character. +.\"O If an invalid multibyte sequence was +.\"O encountered, +.\"O .I (size_t)\ \-1 +.\"O is returned, and \fIerrno\fP set to \fBEILSEQ\fP. +.BR mbsnrtowcs () +´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹´°Î»¤·¤¿¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +½ªÃ¼¤Î¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ï´Þ¤Þ¤Ê¤¤¡£ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤òÊÖ¤·¡¢\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is a GNU extension. +¤³¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR mbsnrtowcs () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR mbsnrtowcs () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +.\"O Passing NULL as \fIps\fP is not multithread safe. +\fIps\fP ¤È¤·¤Æ NULL ¤òÅϤ¹¤³¤È¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Ç¤Ï°ÂÁ´¤Ç¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iconv (3), +.BR mbsrtowcs (3) diff --git a/draft/man3/mbsrtowcs.3 b/draft/man3/mbsrtowcs.3 new file mode 100644 index 00000000..ee662d89 --- /dev/null +++ b/draft/man3/mbsrtowcs.3 @@ -0,0 +1,153 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:08 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH MBSRTOWCS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mbsrtowcs \- convert a multibyte string to a wide-character string +mbsrtowcs \- ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t mbsrtowcs(wchar_t *" dest ", const char **" src , +.BI " size_t " len ", mbstate_t *" ps ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O If \fIdest\fP is not a NULL pointer, the +.\"O .BR mbsrtowcs () +.\"O function converts the +.\"O multibyte string \fI*src\fP to a wide-character string starting at \fIdest\fP. +.\"O At most \fIlen\fP wide characters are written to \fIdest\fP. +.\"O The shift state +.\"O \fI*ps\fP is updated. +.\"O The conversion is effectively performed by repeatedly +.\"O calling +.\"O .I "mbrtowc(dest, *src, n, ps)" +.\"O where \fIn\fP is some +.\"O positive number, as long as this call succeeds, and then incrementing +.\"O \fIdest\fP by one and \fI*src\fP by the number of bytes consumed. +.\"O The conversion can stop for three reasons: +\fIdest\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ç¤Ê¤±¤ì¤Ð¡¢ +.BR mbsrtowcs () +´Ø¿ô¤Ï +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó \fI*src\fP ¤ò \fIdest\fP ¤«¤é»Ï¤Þ¤ë¥ï¥¤¥Éʸ»úÎó¤Ë +ÊÑ´¹¤¹¤ë¡£\fIdest\fP ¤Ë¤ÏºÇÂç¤Ç \fIlen\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤¬ +½ñ¤­¹þ¤Þ¤ì¤ë¡£Æ±»þ¤Ë¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò¹¹¿·¤¹¤ë¡£ +ÊÑ´¹¤Ï +.I "mbrtowc(dest, *src, n, ps)" +¤ò¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¸Â¤ê·«¤êÊÖ¤·¼Â¹Ô¤·¤¿¤Î¤È¼Â¼ÁŪ¤ËƱÍͤǤ¢¤ë¡£ +¤³¤³¤Ç \fIn\fP ¤ÏÀµ¤Î¿ô¤Ç¤¢¤ê¡¢·«¤êÊÖ¤·¤´¤È¤Ë \fIdest\fP ¤¬ 1 Áý²Ã¤µ¤»¤é¤ì¡¢ +\fI*src\fP ¤¬¾ÃÈñ¤·¤¿¥Ð¥¤¥È¿ô¤À¤±Áý²Ã¤µ¤»¤é¤ì¤ë¡£ÊÑ´¹¤Ï°Ê²¼¤Î»°¤Ä¤Î +¤¤¤º¤ì¤«¤Î¾ò·ï¤ÇÄä»ß¤¹¤ë: +.IP 1. 3 +.\"O An invalid multibyte sequence has been encountered. +.\"O In this case \fI*src\fP +.\"O is left pointing to the invalid multibyte sequence, +.\"O .I (size_t)\ \-1 +.\"O is returned, +.\"O and \fIerrno\fP is set to \fBEILSEQ\fP. +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¡£¤³¤Î¾ì¹ç¤Ë¤Ï \fI*src\fP ¤ÏÉÔÀµ¤Ê +¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò»Ø¤¹¤è¤¦¤Ë¤·¤Æ¡¢ +.I (size_t)\ \-1 +¤òÊÖ¤·¡¢\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£ +.IP 2. +.\"O \fIlen\fP non-L\(aq\\0\(aq wide characters have been stored at \fIdest\fP. +.\"O In this +.\"O case \fI*src\fP is left pointing to the next +.\"O multibyte sequence to be converted, +.\"O and the number of wide characters written to \fIdest\fP is returned. +\fIlen\fP ʸ»ú¤Î L\(aq\\0\(aq °Ê³°¤Î¥ï¥¤¥Éʸ»ú¤ò \fIdest\fP ¤Ë³ÊǼ¤·¤¿¾ì¹ç¡£ +¤³¤Î¾ì¹ç¤Ï \fI*src\fP ¤Ï¼¡¤ËÊÑ´¹¤µ¤ì¤ë¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò»Ø¤¹¤è¤¦¤Ë¤·¤Æ¡¢ +\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +.IP 3. +.\"O The multibyte string has been completely converted, including the +.\"O terminating \(aq\\0\(aq (which has the side +.\"O effect of bringing back \fI*ps\fP to the +.\"O initial state). +.\"O In this case \fI*src\fP is set to NULL, and the number of wide +.\"O characters written to \fIdest\fP, +.\"O excluding the terminating L\(aq\\0\(aq character, is returned. +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬽ªÃ¼¤Î \(aq\\0\(aq ¤Þ¤Ç´Þ¤á¤Æ´°Á´¤ËÊÑ´¹¤µ¤ì¤¿¾ì¹ç¡£ +(¤³¤Î»þ¡¢ÉûºîÍѤȤ·¤Æ \fI*ps\fP ¤¬½é´ü¾õÂÖ¤ËÌᤵ¤ì¤ë¡£) +¤³¤Î¾ì¹ç¤Ï \fI*src\fP ¤Ë¤Ï NULL ¤¬ÀßÄꤵ¤ì¡¢½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤ò½ü¤¤¤Æ +\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¿ô¤òÊÖ¤¹¡£ +.PP +.\"O If \fIdest\fP is NULL, \fIlen\fP is ignored, +.\"O and the conversion proceeds as above, +.\"O except that the converted wide characters are not written out to memory, +.\"O and that no length limit exists. +\fIdest\fP ¤¬ NULL ¤Î¾ì¹ç¡¢\fIlen\fP ¤Ï̵»ë¤µ¤ì¡¢¾åµ­¤ÈƱÍͤÎÊÑ´¹¤¬ +¹Ô¤ï¤ì¤ë¤¬¡¢ÊÑ´¹¤µ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Ï¥á¥â¥ê¤Ë½ñ¤­¹þ¤Þ¤ì¤º¡¢ÊÑ´¹Àè¤Î¾å¸Â +¤¬Â¸ºß¤·¤Ê¤¤¡£ +.PP +.\"O In both of the above cases, +.\"O if \fIps\fP is a NULL pointer, a static anonymous +.\"O state only known to the +.\"O .BR mbsrtowcs () +.\"O function is used instead. +¾åµ­¤Î¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ê¤é¤Ð¡¢ +Âå¤ê¤Ë +.BR mbsrtowcs () +´Ø¿ô¤Î¤ß¤¬»ÈÍѤ¹¤ëÀÅŪ¤Ç̾Á°¤Î¤Ê¤¤¾õÂÖ¤¬»ÈÍѤµ¤ì¤ë¡£ +.PP +.\"O The programmer must ensure that there is room for at least \fIlen\fP wide +.\"O characters at \fIdest\fP. +¥×¥í¥°¥é¥Þ¡¼¤Ï \fIdest\fP ¤ËºÇÄã¤Ç¤â \fIlen\fP ¥ï¥¤¥Éʸ»ú¤ò½ñ¤­¹þ¤à¤³ +¤È¤¬¤Ç¤­¤ë¶õ´Ö¤¬¤¢¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR mbsrtowcs () +.\"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, and \fIerrno\fP set to \fBEILSEQ\fP. +.BR mbsrtowcs () +´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹´°Î»¤·¤¿¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +½ªÃ¼¤Î¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ï´Þ¤Þ¤Ê¤¤¡£ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤òÊÖ¤·¡¢\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR mbsrtowcs () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR mbsrtowcs () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +.\"O Passing NULL as \fIps\fP is not multithread safe. +\fIps\fP ¤È¤·¤Æ NULL ¤òÅϤ¹¤³¤È¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Ç¤Ï°ÂÁ´¤Ç¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iconv (3), +.BR mbsnrtowcs (3), +.BR mbstowcs (3) diff --git a/draft/man3/mbstowcs.3 b/draft/man3/mbstowcs.3 new file mode 100644 index 00000000..c0276189 --- /dev/null +++ b/draft/man3/mbstowcs.3 @@ -0,0 +1,130 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mbstowcs \- convert a multibyte string to a wide-character string +mbstowcs \- ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t mbstowcs(wchar_t *" dest ", const char *" src ", size_t " n ); +.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 ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤¬ +½ñ¤­¹þ¤Þ¤ì¤ë¡£ÊÑ´¹¤Ï½é´ü¾õÂ֤dz«»Ï¤µ¤ì¡¢ +°Ê²¼¤Î»°¤Ä¤Î¤¤¤º¤ì¤«¤Î¾ò·ï¤ÇÄä»ß¤¹¤ë: +.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 +¤òÊÖ¤¹¡£ +.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 ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£¤·¤«¤·¤³¤Î»Ø¤·¤Æ¤¤¤ë +¾ì½ê¤Î¥·¥Õ¥È¾õÂ֤ϼº¤ï¤ì¤ë¡£ +.IP 3. +.\"O The multibyte string has been completely converted, including the +.\"O terminating \(aq\\0\(aq. +.\"O In this case the number of wide characters written to +.\"O \fIdest\fP, excluding the terminating L\(aq\\0\(aq character, is returned. +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬽ªÃ¼¤Î \(aq\\0\(aq ¤Þ¤Ç´Þ¤á¤Æ´°Á´¤ËÊÑ´¹¤µ¤ì¤¿¾ì¹ç¡£ +¤³¤Î¾ì¹ç¤Ï½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤ò½ü¤¤¤Æ +\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 ¥ï¥¤¥Éʸ»ú¤ò½ñ¤­¹þ¤à¤³ +¤È¤¬¤Ç¤­¤ë¶õ´Ö¤¬¤¢¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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 ¤Ï̵»ë¤µ¤ì¡¢¾åµ­¤ÈƱÍͤÎÊÑ´¹¤¬ +¹Ô¤ï¤ì¤ë¤¬¡¢ÊÑ´¹¤µ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Ï¥á¥â¥ê¤Ë½ñ¤­¹þ¤Þ¤ì¤º¡¢ÊÑ´¹Àè¤Î¾å¸Â +¤¬Â¸ºß¤·¤Ê¤¤¡£ +.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" +.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" +.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 +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.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" +.SH ´ØÏ¢¹àÌÜ +.BR mbsrtowcs (3) diff --git a/draft/man3/mbtowc.3 b/draft/man3/mbtowc.3 new file mode 100644 index 00000000..32ccf10f --- /dev/null +++ b/draft/man3/mbtowc.3 @@ -0,0 +1,150 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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 2001-07-04 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mbtowc \- convert a multibyte sequence to a wide character +mbtowc \- ¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int mbtowc(wchar_t *" pwc ", const char *" s ", size_t " n ); +.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 \(aq\\0\(aq byte, 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 ¤¬ \(aq\\0\(aq +°Ê³°¤Î¥Ð¥¤¥È¤ò»Ø¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢\fIs\fP ¤«¤é¾ÃÈñ¤¹¤ë¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +\fIs\fP ¤¬ \(aq\\0\(aq ¤ò»Ø¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï 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 ¤Î¾ì¹ç¤â¤³¤Î¤è¤¦¤Ê¤³¤È¤¬ +µ¯¤³¤ê¤¨¤ë¡£ +.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 () +´Ø¿ô¤Ï +¾åµ­¤ÈƱÍͤËÆ°ºî¤¹¤ë¤¬¡¢ÊÑ´¹¤·¤¿¥ï¥¤¥Éʸ»ú¤Ï¥á¥â¥ê¤Ë¤Ï½ñ¤­¹þ¤Þ¤ì¤Ê¤¤¡£ +.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" +.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 ¤¬¥Ê¥ëʸ»ú¤ò»Ø¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¥¼¥í¤ò¡¢ +ÊÑ´¹¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-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" +.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 +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.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" +.SH ´ØÏ¢¹àÌÜ +.BR MB_CUR_MAX (3), +.BR mbrtowc (3), +.BR mbstowcs (3) diff --git a/draft/man3/memccpy.3 b/draft/man3/memccpy.3 new file mode 100644 index 00000000..355a34cf --- /dev/null +++ b/draft/man3/memccpy.3 @@ -0,0 +1,81 @@ +.\" 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 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 +.SH ̾Á° +.\"O memccpy \- copy memory area +memccpy \- ¥á¥â¥êÎΰè¤ò¥³¥Ô¡¼¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *memccpy(void *" dest ", const void *" src ", int " c ", size_t " n ); +.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 ¤¬¸«¤Ä¤«¤ë¤È¡¢ +¤½¤³¤Ç¥³¥Ô¡¼¤òÃæ»ß¤¹¤ë¡£ + +.\"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 ¤Î +¼¡¤Ë¤¢¤ë¥­¥ã¥é¥¯¥¿¡¼·¿¤ÎÊÑ¿ô¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢NULL ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bcopy (3), +.BR memcpy (3), +.BR memmove (3), +.BR strcpy (3), +.BR strncpy (3) diff --git a/draft/man3/memchr.3 b/draft/man3/memchr.3 new file mode 100644 index 00000000..96aaef24 --- /dev/null +++ b/draft/man3/memchr.3 @@ -0,0 +1,213 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" 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 +.\" +.\" 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 Mon Apr 12 12:49:57 1993, David Metcalfe +.\" Modified Sat Jul 24 18:56:22 1993, Rik Faith (faith@cs.unc.edu) +.\" Modified Wed Feb 20 21:09:36 2002, Ian Redfern (redferni@logica.com) +.\" 2008-07-09, mtk, add rawmemchr() +.\" +.TH MEMCHR 3 2009-12-04 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O memchr, memrchr, rawmemchr \- scan memory for a character +memchr, memrchr, rawmemchr \- ʸ»ú¤òõ¤¹¤¿¤á¤Ë¥á¥â¥ê¤ò¥¹¥­¥ã¥ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "void *memchr(const void *" s ", int " c ", size_t " n ); + +.BI "void *memrchr(const void *" s ", int " c ", size_t " n ); + +.BI "void *rawmemchr(const void *" s ", int " c ); +.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 memrchr (): +.BR rawmemchr (): +_GNU_SOURCE +.\"O .SH DESCRIPTION +.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 ¤È²ò¼á¤µ¤ì¤ë) ¤¬¸«¤Ä¤«¤Ã¤¿»þÅÀ¤ÇÆ°ºî¤¬Ää»ß¤¹¤ë¡£ +.PP +.\"O The +.\"O .BR memrchr () +.\"O function is like the +.\"O .BR memchr () +.\"O function, +.\"O except that it searches backwards from the end of the \fIn\fP bytes +.\"O pointed to by \fIs\fP instead of forwards from the beginning. +.BR memrchr () +´Ø¿ô¤Ï +.BR memchr () +´Ø¿ô¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ +ÀèƬ¤«¤é½çÊý¸þ¤Ëõ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥Ý¥¤¥ó¥¿ \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 () +¤Ïʸ»úÎóËöÈø¤ò±Û¤¨¤Æ¸¡º÷¤ò¼Â¹Ô¤¹¤ë¤«¤â¤·¤ì¤º¡¢·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¡£ +.\"O The folowing call is a fast means of locating a string's +.\"O terminating null byte: +¼¡¤Ë¼¨¤¹¸Æ¤Ó½Ð¤·¤Ï¡¢Ê¸»úÎó½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤Î°ÌÃÖ¤òÆÃÄꤹ¤ë +¹â®¤Ê¼êÃʤǤ¢¤ë¡£ +.in +4n +.nf + +char *p = rawmemchr(s,\ \(aq\\0\(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 ¤òÊÖ¤¹¡£ + +.\"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 () +´Ø¿ô¤Ï¥Þ¥Ã¥Á¤¹¤ë¥Ð¥¤¥È¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ï¥Þ¥Ã¥Á¤·¤¿¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥Þ¥Ã¥Á¤¹¤ë¥Ð¥¤¥È¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR rawmemchr () +.\"O first appeared in glibc in version 2.1. +.BR rawmemchr () +¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ + +.\"O .BR memrchr () +.\"O first appeared in glibc in version 2.2. +.BR memrchr () +¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.2 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.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 ¤Ë½àµò¤¹¤ë¡£ + +.\"O The +.\"O .BR memrchr () +.\"O function is a GNU extension, available since glibc 2.1.91. +.BR memrchr () +´Ø¿ô¤Ï 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" +.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) diff --git a/draft/man3/memcmp.3 b/draft/man3/memcmp.3 new file mode 100644 index 00000000..68a25fda --- /dev/null +++ b/draft/man3/memcmp.3 @@ -0,0 +1,84 @@ +.\" 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 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 +.\" +.TH MEMCMP 3 1993-04-10 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O memcmp \- compare memory areas +memcmp \- ¥á¥â¥êÎΰè¤òÈæ³Ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int memcmp(const void *" s1 ", const void *" s2 ", size_t " n ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR memcmp () +.\"O function compares the first \fIn\fP bytes of the +.\"O 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 +¥Ð¥¤¥È¤òÈæ³Ó¤¹¤ë¡£ +\fIs1\fP ¤¬ \fIs2\fP ¤è¤ê¾®¤µ¤¤¤«¡¢Æ±¤¸¤«¡¢¤¢¤ë¤¤¤ÏÂ礭¤¤¤«¤Ë¤è¤Ã¤Æ +¤½¤ì¤¾¤ì¡¢Éé¤ÎÀ°¿ô¡¢0¡¢Àµ¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +.\"O .SH "RETURN VALUE" +.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" +.SH ½àµò +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bcmp (3), +.BR strcasecmp (3), +.BR strcmp (3), +.BR strcoll (3), +.BR strncasecmp (3), +.BR strncmp (3), +.BR wmemcmp (3) diff --git a/draft/man3/memcpy.3 b/draft/man3/memcpy.3 new file mode 100644 index 00000000..baed9994 --- /dev/null +++ b/draft/man3/memcpy.3 @@ -0,0 +1,80 @@ +.\" 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 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 +.\" +.TH MEMCPY 3 1993-04-10 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O memcpy \- copy memory area +memcpy \- ¥á¥â¥êÎΰè¤ò¥³¥Ô¡¼¤¹¤ë¡£ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *memcpy(void *" dest ", const void *" src ", size_t " n ); +.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 should 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" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR memcpy () +.\"O function returns a pointer to \fIdest\fP. +.BR memcpy () +¤Ï \fIdest\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bcopy (3), +.BR memccpy (3), +.BR memmove (3), +.BR mempcpy (3), +.BR strcpy (3), +.BR strncpy (3), +.BR wmemcpy (3) diff --git a/draft/man3/memfrob.3 b/draft/man3/memfrob.3 new file mode 100644 index 00000000..113e7652 --- /dev/null +++ b/draft/man3/memfrob.3 @@ -0,0 +1,88 @@ +.\" 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 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 +.\" +.TH MEMFROB 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O memfrob \- frobnicate (encrypt) a memory area +.SH ̾Á° +memfrob \- ¥á¥â¥ê¥¨¥ê¥¢¤ÎÁàºî (°Å¹æ²½) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "void *memfrob(void *" s ", size_t " n ); +.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 () +´Ø¿ô¤ò»Ü¤¹¤³¤È¤Ç¡¢¸µ¤ËÌ᤹¤³¤È¤¬¤Ç¤­¤ë¡£ +.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 ¤ò¤È¤ëÄê¿ô¤ò¸ÇÄꤷ¤Æ¤¤¤ë¤Î¤Ç¡¢¤»¤¤¤¼¤¤¡¢Ê¸»úÎó¤ò±£¤¹ÄøÅÙ¤ÎÍÑË¡¤Ë¤· +¤«¸þ¤¤¤Æ¤¤¤Ê¤¤¡£ +.\"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" +.SH ½àµò +.\"O The +.\"O .BR memfrob () +.\"O function is unique to the +.\"O GNU C Library. +.BR memfrob () +´Ø¿ô¤Ï GNU C ¥é¥¤¥Ö¥é¥ê¤Ë¸ÇÍ­¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strfry (3) diff --git a/draft/man3/memmem.3 b/draft/man3/memmem.3 new file mode 100644 index 00000000..f24c984c --- /dev/null +++ b/draft/man3/memmem.3 @@ -0,0 +1,99 @@ +.\" 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 +.\" 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 +.\" +.TH MEMMEM 3 2008-12-05 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O memmem \- locate a substring +memmem \- Éôʬʸ»úÎó¤Î°ÌÃÖ¤ò¼¨¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "void *memmem(const void *" haystack ", size_t " haystacklen , +.BI " const void *" needle ", size_t " needlelen ); +.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" +.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" +.SH ½àµò +.\"O This function is a GNU extension. +¤³¤Î´Ø¿ô¤Ï GNU extension ¤Ç¤¢¤ë¡£ +.\"O .SH BUGS +.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 ¤¬ºÇ½é¤Ë½Ð¸½¤¹¤ëÉôʬ¤ÎºÇ¸å¤ò +¼¨¤¹¥Ý¥¤¥ó¥¿¤¬ÊÖ¤µ¤ì¤Æ¤¤¤¿¤Î¤Ç¤¢¤ë¡£ + +.\"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 ¤ÎºÇ¸å¤Î¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ì¤Ï glibc 2.1 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strstr (3), +.BR feature_test_macros (7) diff --git a/draft/man3/memmove.3 b/draft/man3/memmove.3 new file mode 100644 index 00000000..592472f6 --- /dev/null +++ b/draft/man3/memmove.3 @@ -0,0 +1,92 @@ +.\" 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 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 +.\" +.TH MEMMOVE 3 1993-04-10 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O memmove \- copy memory area +memmove \- ¥á¥â¥êÎΰè¤ò¥³¥Ô¡¼¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *memmove(void *" dest ", const void *" src ", size_t " n ); +.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" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR memmove () +.\"O function returns a pointer to \fIdest\fP. +.BR memmove () +¤Ï \fIdest\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bcopy (3), +.BR memccpy (3), +.BR memcpy (3), +.BR strcpy (3), +.BR strncpy (3), +.BR wmemmove (3) diff --git a/draft/man3/mempcpy.3 b/draft/man3/mempcpy.3 new file mode 100644 index 00000000..6544edd0 --- /dev/null +++ b/draft/man3/mempcpy.3 @@ -0,0 +1,113 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" 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 +.\" +.TH MEMPCPY 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mempcpy, wmempcpy \- copy memory area +mempcpy, wmempcpy \- ¥á¥â¥êÎΰè¤ò¥³¥Ô¡¼¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n ); +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.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 +¤ÎÃͤòÊÖ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢ +ºÇ¸å¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¤Î¸å¤Ë³¤¯¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.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" +.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" +.SH ½àµò +.\"O This function is a GNU extension. +¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤ª¤±¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH "EXAMPLE" +.SH Îã +.nf +void * +combine (void *o1, size_t s1, void *o2, size_t s2) +{ + void *result = malloc(s1 + 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), +.BR feature_test_macros (7) diff --git a/draft/man3/memset.3 b/draft/man3/memset.3 new file mode 100644 index 00000000..704c5a87 --- /dev/null +++ b/draft/man3/memset.3 @@ -0,0 +1,55 @@ +.\" 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 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 +.\" +.TH MEMSET 3 1993-04-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +memset \- ¤¢¤ë°ìÄê¤Î¥Ð¥¤¥È¤Ç¥á¥â¥êÎΰè¤òËä¤á¤ë¡£ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *memset(void *" s ", int " c ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR memset () +¤Ï \fIs\fP ¤Ç¼¨¤µ¤ì¤ë¥á¥â¥êÎΰè¤ÎÀèƬ¤«¤é \fIn\fP ¥Ð¥¤¥È¤ò +\fIc\fP ¤ÇËä¤á¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR memset () +¤Ï \fIs\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR bzero (3), +.BR swab (3), +.BR wmemset (3) diff --git a/draft/man3/mkdtemp.3 b/draft/man3/mkdtemp.3 new file mode 100644 index 00000000..69f3f0f2 --- /dev/null +++ b/draft/man3/mkdtemp.3 @@ -0,0 +1,126 @@ +.\" Copyright 2001 John Levon +.\" Based on mkstemp(3), Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and 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. +.\" +.\" Japanese Version Copyright (c) 2001 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Oct 21 03:28:34 JST 2001 +.\" by Yuichi SATO +.\" +.TH MKDTEMP 3 2008-08-21 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mkdtemp \- create a unique temporary directory +mkdtemp \- ¾¤È½Å¤Ê¤é¤Ê¤¤°ì»þŪ¤Ê¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *mkdtemp(char *" template ); +.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 mkdtemp (): +_BSD_SOURCE +.\"O .SH DESCRIPTION +.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" +.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 +.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 ¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.PP +.\"O Also see +.\"O .BR mkdir (2) +.\"O for other possible values for \fIerrno\fP. +\fIerrno\fP ¤ËÀßÄꤵ¤ì¤ë¾¤ÎÃͤˤĤ¤¤Æ¤Ï¡¢ +.BR mkdir (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH VERSIONS +.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" +.SH ´ØÏ¢¹àÌÜ +.BR mkdir (2), +.BR mkstemp (3), +.BR mktemp (3), +.BR tempnam (3), +.BR tmpfile (3), +.BR tmpnam (3) diff --git a/draft/man3/mkfifo.3 b/draft/man3/mkfifo.3 new file mode 100644 index 00000000..a8fd6b2c --- /dev/null +++ b/draft/man3/mkfifo.3 @@ -0,0 +1,168 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1995 James R. Van Zandt +.\" +.\" 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. +.\" +.\" changed section from 2 to 3, aeb, 950919 +.\" +.\" Japanese Version Copyright (c) 1998 George Momma +.\" all rights reserved. +.\" Translated Mon May 25 23:11:03 JST 1998 +.\" by George Momma +.\" Updated 1999-12-11 by Kentaro Shirakata +.\" Updated 2008-07-30 by Kentaro Shirakata +.\" +.\"WORD: named pipe ̾Á°ÉÕ¤­¥Ñ¥¤¥× +.\"WORD: permission µö²Ä¥â¡¼¥É +.\"WORD: filename ¥Õ¥¡¥¤¥ë̾ +.\"WORD: filename component ¥Õ¥¡¥¤¥ë̾Éôʬ +.\"WORD: directory component ¥Ç¥£¥ì¥¯¥È¥êÉôʬ +.TH MKFIFO 3 2008-06-12 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mkfifo \- make a FIFO special file (a named pipe) +mkfifo \- FIFO¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë(̾Á°ÉÕ¤­¥Ñ¥¤¥×)¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "int mkfifo(const char *" pathname ", mode_t " mode ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR mkfifo () +.\"O makes a FIFO special file with name \fIpathname\fP. +.\"O \fImode\fP specifies the FIFO's permissions. +.\"O It is modified by the +.\"O process's \fBumask\fP in the usual way: the permissions of the created +.\"O file are \fB(\fP\fImode\fP\fB & ~umask)\fP. +.BR mkfifo () +¤Ï̾Á° \fIpathname\fP ¤ò»ý¤ÄFIFO¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤òºîÀ® +¤¹¤ë¡£FIFO¤Îµö²Ä¥â¡¼¥É¤Ï \fImode\fP ¤Ç»ØÄꤵ¤ì¡¢¥×¥í¥»¥¹¤Î +\fBumask\fP ¤Ë¤è¤Ã¤ÆÄ̾ï¤ÎÊý¼°¤ÇÊѹ¹¤ò¼õ¤±¤ë: ºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Îµö²Ä +¥â¡¼¥É¤Ï \fB(\fP\fImode\fP\fB & ~umask)\fP ¤È¤Ê¤ë¡£ +.PP +.\"O A FIFO special file is similar to a pipe, except that it is created +.\"O in a different way. +.\"O Instead of being an anonymous communications +.\"O channel, a FIFO special file is entered into the file system by +.\"O calling +.\"O .BR mkfifo (). +FIFO¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ï¥Ñ¥¤¥×¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ºîÀ®¤Î¤µ¤ìÊý¤Î¤ß¤¬°Û¤Ê¤Ã¤Æ +¤¤¤ë¡£FIFO¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ï̾Á°¤Î¤Ê¤¤ÄÌ¿®Ï©¤Ç¤Ï¤Ê¤¯¡¢ +.BR mkfifo () +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÃæ¤Ë²Ã¤¨¤é¤ì¤ë¡£ +.PP +.\"O Once you have created a FIFO special file in this way, any process can +.\"O open it for reading or writing, in the same way as an ordinary file. +.\"O However, it has to be open at both ends simultaneously before you can +.\"O proceed to do any input or output operations on it. +.\"O Opening a FIFO for reading normally blocks until some +.\"O other process opens the same FIFO for writing, and vice versa. +.\"O See +.\"O .BR fifo (7) +.\"O for nonblocking handling of FIFO special files. +¤Ò¤È¤¿¤Ó¤³¤Î¤è¤¦¤Ë¤·¤ÆFIFO¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤ë¤È¡¢Ä̾ï¤Î¥Õ¥¡ +¥¤¥ë¤ÈƱ¤¸¤è¤¦¤Ë¡¢¤É¤Î¥×¥í¥»¥¹¤«¤é¤Ç¤âÆɤ߽Ф·¡¢½ñ¤­¹þ¤ßÍѤˤ³¤ì¤ò¥ª¡¼ +¥×¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤¿¤À¤·¡¢¤³¤ì¤ËÂФ¹¤ëÁ´¤Æ¤ÎÆþ½ÐÎÏÁàºî¤ËÀèΩ¤Ã¤Æ +¤½¤Îξü¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£FIFO¤òÆɤ߽Ф·ÍѤ˥ª¡¼¥×¥ó¤¹¤ë +¤È¡¢Ä̾ï¾¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤ÆƱ¤¸FIFO¤¬½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤ë¤Þ¤Ç¥Ö +¥í¥Ã¥¯¤µ¤ì¡¢µÕ¤Î¾ì¹ç¤âƱÍͤǤ¢¤ë¡£ +FIFO¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤ò¥Ö¥í¥Ã¥¯¤»¤º¤Ë°·¤¦ÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï +.BR fifo (7) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success +.\"O .BR mkfifo () +.\"O returns 0. +.\"O In the case of an error, \-1 is returned (in which case, \fIerrno\fP +.\"O is set appropriately). +À®¸ù¤·¤¿¾ì¹ç +.BR mkfifo () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹ (¤Þ¤¿ \fIerrno\fP ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë)¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O One of the directories in \fIpathname\fP did not allow search +.\"O (execute) permission. +\fIpathname\fP ¤ÎÃæ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î°ì¤Ä¤ËÂФ·¸¡º÷(¼Â¹Ô)µö²Ä¤¬¤Ê¤¤¡£ +.TP +.B EEXIST +.\"O \fIpathname\fP already exists. +.\"O This includes the case where +.\"O .I pathname +.\"O is a symbolic link, dangling or not. +\fIpathname\fP ¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¡£ +¤³¤ì¤Ë¤Ï¡¢ +.I pathname +¤¬(¥ê¥ó¥¯Àڤ줫¤É¤¦¤«¤Ë´Ø¤ï¤é¤º)¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¤â´Þ¤à¡£ +.TP +.B ENAMETOOLONG +.\"O Either the total length of \fIpathname\fP is greater than +.\"O \fBPATH_MAX\fP, or an individual filename component has a length +.\"O greater than \fBNAME_MAX\fP. +.\"O In the GNU system, there is no imposed +.\"O limit on overall filename length, but some file systems may place +.\"O limits on the length of a component. +\fIpathname\fP ¤ÎŤµ¤¬ \fBPATH_MAX\fP ¤òĶ¤¨¤Æ¤¤¤ë¤«¡¢¸Ä¡¹¤Î¥Õ¥¡¥¤¥ë +̾Éôʬ¤ÎŤµ¤¬ \fBNAME_MAX\fP ¤òĶ¤¨¤Æ¤¤¤ë¡£GNU¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¤Ï¡¢¥Õ¥¡ +¥¤¥ë̾¤ÎÁ´ÂΤÎŤµ¤ËÂФ·¤Æ¤ÏÀ©¸Â¤Ï²Ý¤»¤é¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +¤Ë¤è¤Ã¤Æ¤Ï³ÆÉôʬ¤ÎŤµ¤ËÀ©¸Â¤Î¤¢¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B ENOENT +.\"O A directory component in \fIpathname\fP does not exist or is a +.\"O dangling symbolic link. +\fIpathname\fP ¤ÎÃæ¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢¥ê¥ó¥¯Àè¤Î¤Ê¤¤¥· +¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¡£ +.TP +.B ENOSPC +.\"O The directory or file system has no room for the new file. +¥Ç¥£¥ì¥¯¥È¥ê¤Þ¤¿¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¿·µ¬¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë;ÃϤ¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O A component used as a directory in \fIpathname\fP is not, in fact, a +.\"O directory. +\fIpathname\fP Ãæ¤Ç¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤ëÉôʬ¤¬¼ÂºÝ¤Ë¤Ï¥Ç¥£ +¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EROFS +.\"O \fIpathname\fP refers to a read-only file system. +\fIpathname\fP ¤¬Æɤ߼è¤êÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mkfifo (1), +.BR close (2), +.BR open (2), +.BR read (2), +.BR stat (2), +.BR umask (2), +.BR write (2), +.BR mkfifoat (3), +.BR fifo (7) diff --git a/draft/man3/mkfifoat.3 b/draft/man3/mkfifoat.3 new file mode 100644 index 00000000..3e5480bf --- /dev/null +++ b/draft/man3/mkfifoat.3 @@ -0,0 +1,196 @@ +.\" 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-08-04 by Yuichi SATO , LDP v2.36 +.\" +.TH MKFIFOAT 3 2009-12-13 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "int mkfifoat(int " dirfd ", const char *" pathname ", mode_t " mode ); +.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 mkfifoat (): +.br +.\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +.\"O Before glibc 2.10: +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.\"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) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.\"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) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.\"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) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I pathname +.\"O is absolute, then +.\"O .I dirfd +.\"O is ignored. +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.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 +.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 () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.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 +.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" +.SH ½àµò +POSIX.1-2008. +.\"O .SH NOTES +.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" +.SH ´ØÏ¢¹àÌÜ +.BR openat (2), +.BR mkfifo (3), +.BR path_resolution (7) diff --git a/draft/man3/mkstemp.3 b/draft/man3/mkstemp.3 new file mode 100644 index 00000000..872410f5 --- /dev/null +++ b/draft/man3/mkstemp.3 @@ -0,0 +1,243 @@ +.\" 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 new file mode 100644 index 00000000..43d59b3a --- /dev/null +++ b/draft/man3/mktemp.3 @@ -0,0 +1,160 @@ +.\" Copyright (C) 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 Sat Jul 24 18:48:06 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Jun 23 01:26:34 1995 by Andries Brouwer (aeb@cwi.nl) +.\" (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 ´Ø¿ô +.\" +.TH MKTEMP 3 2008-08-06 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mktemp \- make a unique temporary filename +mktemp \- ¾¤È½Å¤Ê¤é¤Ê¤¤¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë̾¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *mktemp(char *" template ); +.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 mktemp (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +\"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" +.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 +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O The last six characters of \fItemplate\fP were not XXXXXX. +°ú¿ô \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 +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR mkstemp (3), +.BR tempnam (3), +.BR tmpfile (3), +.BR tmpnam (3) diff --git a/draft/man3/modf.3 b/draft/man3/modf.3 new file mode 100644 index 00000000..b3ad91f3 --- /dev/null +++ b/draft/man3/modf.3 @@ -0,0 +1,125 @@ +.\" 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-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) 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 2008-08-05 "" "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 +.sp +.BI "double modf(double " x ", double *" iptr ); +.br +.BI "float modff(float " x ", float *" iptr ); +.br +.BI "long double modfl(long double " x ", long double *" iptr ); +.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) +»²¾È): +.in +.sp +.ad l +.BR modf (), +.BR modl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR modf () +.\"O function returns the fractional part of \fIx\fP. +.BR modf () +´Ø¿ô¤Ï \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 ¤¬ÀßÄꤵ¤ì¤ë¡£ + +.\"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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR frexp (3), +.BR ldexp (3) diff --git a/draft/man3/mpool.3 b/draft/man3/mpool.3 new file mode 100644 index 00000000..1fb9fd4f --- /dev/null +++ b/draft/man3/mpool.3 @@ -0,0 +1,369 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)mpool.3 8.1 (Berkeley) 6/4/93 +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito +.\" all rights reserved. +.\" Translated Mon Jul 26 21:51:36 JST 1999 +.\" by Shouichi Saito +.\" Proofed Tue Aug 19 1999 by NAKANO Takeo +.\" +.\"WORD: descriptor ¥Ç¥¹¥¯¥ê¥×¥¿ +.TH MPOOL 3 1993-06-04 "" "Linux Programmer's Manual" +.UC 7 +.SH ̾Á° +.\"O mpool \- shared memory buffer pool +mpool \- ¶¦Í­¥á¥â¥ê¥Ð¥Ã¥Õ¥¡¥×¡¼¥ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "MPOOL *mpool_open(DBT *" key ", int " fd ", pgno_t " pagesize \ +", pgno_t " maxcache ); +.sp +.BI "void mpool_filter(MPOOL *" mp ", void (*pgin)(void *, pgno_t, void *)," +.BI " void (*" pgout ")(void *, pgno_t, void *)," +.BI " void *" pgcookie ); +.sp +.BI "void *mpool_new(MPOOL *" mp ", pgno_t *" pgnoaddr ); +.sp +.BI "void *mpool_get(MPOOL *" mp ", pgno_t " pgno ", unsigned int " flags ); +.sp +.BI "int mpool_put(MPOOL *" mp ", void *" pgaddr ", unsigned int " flags ); +.sp +.BI "int mpool_sync(MPOOL *" mp ); +.sp +.BI "int mpool_close(MPOOL *" mp ); +.fi +.SH ÀâÌÀ +.\"O .I Mpool +.\"O is the library interface intended to provide page oriented buffer management +.\"O of files. +.\"O The buffers may be shared between processes. +.I mpool +¤Ï¡¢¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥Ú¡¼¥¸»Ø¸þ¤Î¥Ð¥Ã¥Õ¥¡´ÉÍý¤ò¼ÂÁõ¤·¤¿ +¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ç¤¢¤ë¡£ +.PP +.\"O The function +.\"O .BR mpool_open () +.\"O initializes a memory pool. +´Ø¿ô +.BR mpool_open () +¤Ï¥á¥â¥ê¥×¡¼¥ë¤ò½é´ü²½¤¹¤ë¡£ +.\"O The +.\"O .I key +.\"O argument is the byte string used to negotiate between multiple +.\"O processes wishing to share buffers. +.\"O If the file buffers are mapped in shared memory, all processes using +.\"O the same key will share the buffers. +.I key +°ú¿ô¤Ï¥Ð¥¤¥Èʸ»úÎó¤Ç¤¢¤ê¡¢¥Ð¥Ã¥Õ¥¡¤ò¶¦Í­¤·¤¿¤¤Ê£¿ô¥×¥í¥»¥¹´Ö +¤Ç¤Î¥Í¥´¥·¥¨¡¼¥·¥ç¥ó¤Ë»È¤ï¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¥Ð¥Ã¥Õ¥¡¤¬¶¦Í­¥á¥â¥ê¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¤È¡¢ +Ʊ¤¸¥­¡¼¤ò»È¤¦¥×¥í¥»¥¹¤ÏÁ´¤Æ¥Ð¥Ã¥Õ¥¡¤ò¶¦Í­¤¹¤ë¡£ +.\"O If +.\"O .I key +.\"O is NULL, the buffers are mapped into private memory. +.I key +¤¬ NULL ¤À¤È¡¢¥Ð¥Ã¥Õ¥¡¤Ï¥×¥é¥¤¥Ù¡¼¥È¤Ê¥á¥â¥ê¤Ë³ä¤êÉÕ¤±¤é¤ì¤ë¡£ +.\"O The +.\"O .I fd +.\"O argument is a file descriptor for the underlying file, which must be seekable. +.I fd +°ú¿ô¤Ï¤â¤È¤Ë¤Ê¤ë¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤Ï¥·¡¼¥¯²Äǽ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.\"O If +.\"O .I key +.\"O is non-NULL and matches a file already being mapped, the +.\"O .I fd +.\"O argument is ignored. +.I key +¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä´û¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Ë¥Þ¥Ã¥Á¤·¤¿¾ì¹ç¡¢ +.I fd +°ú¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .I pagesize +.\"O argument is the size, in bytes, of the pages into which the file is broken up. +.I pagesize +°ú¿ô¤Ï¥Ð¥¤¥Èñ°Ì¤Ç¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤Ç¤¢¤ê¡¢¥Õ¥¡¥¤¥ë¤Ï¤³¤Î¥µ¥¤¥º¤Ëʬ³ä¤µ¤ì¤ë¡£ +.\"O The +.\"O .I maxcache +.\"O argument is the maximum number of pages from the underlying file to cache +.\"O at any one time. +.I maxcache +°ú¿ô¤Ï´ð¥Õ¥¡¥¤¥ë¤ò¥­¥ã¥Ã¥·¥å¤¹¤ë¤È¤­¤ËÍѤ¤¤ëºÇÂç¥Ú¡¼¥¸¿ô¤Ç¤¢¤ë¡£ +.\"NAKANO "at any one time" ¤Ï¡Ö¤É¤ó¤Ê½Ö´Ö¤Ë¤ª¤¤¤Æ¤â (ºÇÂç)¡×¤Ç¤¹¤¬¡¢ +.\"NAKANO ¾Êά²Äǽ¤Ç¤·¤ç¤¦¡£ +.\"O This value is not relative to the number of processes which share a file's +.\"O buffers, but will be the largest value specified by any of the processes +.\"O sharing the file. +¤³¤ÎÃͤϥե¡¥¤¥ë¥Ð¥Ã¥Õ¥¡¤ò¶¦Í­¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î¿ô¤Ë¤Ï´Ø·¸¤Ê¤¤¤¬¡¢ +¥Õ¥¡¥¤¥ë¤ò¶¦Í­¤¹¤ë¥×¥í¥»¥¹¤¬»ØÄꤷ¤¿¤¦¤Á¤ÎºÇÂçÃͤ¬¼ÂºÝ¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR mpool_filter () +.\"O function is intended to make transparent input and output processing of the +.\"O pages possible. +´Ø¿ô +.BR mpool_filter () +¤ÏÆ©²áŪ¤Ê¥Ú¡¼¥¸Æþ½ÐÎϽèÍý¤ò²Äǽ¤Ë¤¹¤ë¡£ +.\"O If the +.\"O .I pgin +.\"O function is specified, it is called each time a buffer is read into the memory +.\"O pool from the backing file. +´Ø¿ô +.I pgin +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢ +¥Õ¥¡¥¤¥ë¤«¤é¥á¥â¥ê¥×¡¼¥ë¤ËÆɤ߹þ¤Þ¤ì¤ëÅ٤ˤ³¤Î´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.\"O If the +.\"O .I pgout +.\"O function is specified, it is called each time a buffer is written into the +.\"O backing file. +´Ø¿ô +.I pgout +¤¬»ØÄꤵ¤ì¤Æ¤¤¤È¡¢ +¥Ð¥Ã¥Õ¥¡¤«¤é¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤µ¤ì¤ëÅ٤ˤ³¤Î´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.\"O Both functions are called with the +.\"O .I pgcookie +.\"O pointer, the page number and a pointer to the page to being read or written. +¤É¤Á¤é¤Î´Ø¿ô¤â¡¢ +.I pgcookie +¥Ý¥¤¥ó¥¿¡¢¥Ú¡¼¥¸¿ô¡¢Æɤ߽ñ¤­¤µ¤ì¤ë¥Ú¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò°ú¿ô¤Ë¤È¤ë¡£ +.PP +.\"O The function +.\"O .BR mpool_new () +.\"O takes an +.\"O .I MPOOL +.\"O pointer and an address as arguments. +´Ø¿ô +.BR mpool_new () +¤Ï +.I MPOOL +¥Ý¥¤¥ó¥¿¤È¥¢¥É¥ì¥¹¤ò°ú¿ô¤Ë¤È¤ë¡£ +.\"O If a new page can be allocated, a pointer to the page is returned and +.\"O the page number is stored into the +.\"O .I pgnoaddr +.\"O address. +¿·¤·¤¤¥Ú¡¼¥¸¤¬³ä¤êÅö¤Æ²Äǽ¤Ê¾ì¹ç¡¢¥Ú¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬ÊÖ¤µ¤ì¡¢ +¥Ú¡¼¥¸¿ô¤¬ +.I pgnoaddr +¥¢¥É¥ì¥¹¤ËǼ¤á¤é¤ì¤ë¡£ +.\"O Otherwise, NULL is returned and +.\"O .I errno +.\"O is set. +³ä¤êÅö¤Æ¤¬ÉÔ²Äǽ¤Ê¾ì¹ç¤Ï NULL ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O The function +.\"O .BR mpool_get () +.\"O takes a +.\"O .I MPOOL +.\"O pointer and a page number as arguments. +.\"O If the page exists, a pointer to the page is returned. +.\"O Otherwise, NULL is returned and +.\"O .I errno +.\"O is set. +.\"O The +.\"O .I flags +.\"O argument is not currently used. +´Ø¿ô +.BR mpool_get () +¤Ï +.I MPOOL +¥Ý¥¤¥ó¥¿¤È¥Ú¡¼¥¸¿ô¤ò°ú¿ô¤Ë¤È¤ë¡£¥Ú¡¼¥¸¤¬Â¸ºß¤·¤Æ¤¤¤ë¤È¡¢ +¥Ú¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +¸ºß¤·¤Æ¤¤¤Ê¤¤¤È NULL ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.I flags +°ú¤­¿ô¤Ï¸½ºß»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O The function +.\"O .BR mpool_put () +.\"O unpins the page referenced by +.\"O .IR pgaddr . +´Ø¿ô +.BR mpool_put () +¤Ï +.I pgaddr +¤¬»²¾È¤¹¤ë¥Ú¡¼¥¸¤ò²òÊü¤¹¤ë¡£ +.\"O .I pgaddr +.\"O must be an address previously returned by +.\"O .BR mpool_get () +.\"O or +.\"O .BR mpool_new (). +.I pgaddr +¤Ï°ÊÁ°¤Ë +.BR mpool_get () +¤« +.BR mpool_new () +¤¬ÊÖ¤·¤¿¥¢¥É¥ì¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O The flag value is specified by +.\"O .IR or 'ing +.\"O any of the following values: +flag ¤ÎÃͤϰʲ¼¤ÎÃͤΤ¤¤º¤ì¤«¤«¡¢¤³¤ì¤é¤ÎÏÀÍýϤǤ¢¤ë¡£ +.TP +.B MPOOL_DIRTY +.\"O The page has been modified and needs to be written to the backing file. +¥Ú¡¼¥¸¤ÏÊѹ¹¤µ¤ì¤Æ¤ª¤ê¡¢¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹É¬Íפ¬¤¢¤ë¡£ +.PP +.\"O .BR mpool_put () +.\"O returns 0 on success and \-1 if an error occurs. +.BR mpool_put () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤ò¡¢¥¨¥é¡¼¤¬¤¢¤ë¤È \-1 ¤òÊÖ¤¹¡£ +.PP +.\"O The function +.\"O .BR mpool_sync () +.\"O writes all modified pages associated with the +.\"O .I MPOOL +.\"O pointer to the +.\"O backing file. +´Ø¿ô +.BR mpool_sync () +¤Ï +.I MPOOL +¥Ý¥¤¥ó¥¿¤Î¼¨¤¹¥Ú¡¼¥¸¤Î¤¦¤Á¡¢ +Êѹ¹¤µ¤ì¤¿¤â¤Î¤òÁ´¤Æ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹¡£ +.\"O .BR mpool_sync () +.\"O returns 0 on success and \-1 if an error occurs. +.BR mpool_sync () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤ò¡¢¥¨¥é¡¼¤¬¤¢¤ë¤È \-1 ¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR mpool_close () +.\"O function free's up any allocated memory associated with the memory pool +.\"O cookie. +´Ø¿ô +.BR mpool_close () +¤Ï¥á¥â¥ê¥×¡¼¥ë¥¯¥Ã¥­¡¼¤Î¼¨¤¹³ä¤êÅö¤ÆºÑ¤ß¤Î¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£ +.\"O Modified pages are +.\"O .B not +.\"O written to the backing file. +Êѹ¹¤µ¤ì¤¿¥Ú¡¼¥¸¤Ï¥Õ¥¡¥¤¥ë¤Ë\fB½ñ¤­½Ð¤µ¤ì¤Ê¤¤\fP¡£ +.\"O .BR mpool_close () +.\"O returns 0 on success and \-1 if an error occurs. +.I mpool_close () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤ò¡¢¥¨¥é¡¼¤¬¤¢¤ë¤È \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.\"O The +.\"O .BR mpool_open () +.\"O function may fail and set +.\"O .I errno +.\"O for any of the errors specified for the library routine +.\"O .BR malloc (3). +´Ø¿ô +.BR mpool_open () +¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR malloc (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.\"O The +.\"O .BR mpool_get () +.\"O function may fail and set +.\"O .I errno +.\"O for the following: +´Ø¿ô +.BR mpool_get () +¤Ï¼ºÇÔ¤¹¤ë¤È¼¡¤Î¤è¤¦¤Ê +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.TP 15 +.B EINVAL +.\"O The requested record doesn't exist. +Í×µá¤Î¤¢¤Ã¤¿¥ì¥³¡¼¥É¤Ï¸ºß¤·¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR mpool_new () +.\"O and +.\"O .BR mpool_get () +.\"O functions may fail and set +.\"O .I errno +.\"O for any of the errors specified for the library routines +.\"O .BR read (2), +.\"O .BR write (2), +.\"O and +.\"O .BR malloc (3). +´Ø¿ô +.BR mpool_new () +¤È +.BR mpool_get () +¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR read (2), +.BR write (2), +.BR malloc (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.\"O The +.\"O .BR mpool_sync () +.\"O function may fail and set +.\"O .I errno +.\"O for any of the errors specified for the library routine +.\"O .BR write (2). +´Ø¿ô +.BR mpool_sync () +¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR write (2) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.\"O The +.\"O .BR mpool_close () +.\"O function may fail and set +.\"O .I errno +.\"O for any of the errors specified for the library routine +.\"O .BR free (3). +´Ø¿ô +.BR mpool_close () +¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR free (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Not in POSIX.1-2001. +.\"O Present on the BSDs. +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¤Ë¸ºß¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR btree (3), +.BR dbopen (3), +.BR hash (3), +.BR recno (3) diff --git a/draft/man3/mq_close.3 b/draft/man3/mq_close.3 new file mode 100644 index 00000000..6118698d --- /dev/null +++ b/draft/man3/mq_close.3 @@ -0,0 +1,106 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-23, Akihiro MOTOKI +.\" +.TH MQ_CLOSE 3 2006-02-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mq_close \- close a message queue descriptor +mq_close \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò¤ò¥¯¥í¡¼¥º¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "mqd_t mq_close(mqd_t " mqdes ); +.fi +.sp +.\"O Link with \fI\-lrt\fP. +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR mq_close () +.\"O closes the message queue descriptor +.\"O .IR mqdes . +.BR mq_close () +¤Ï¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò (message queue descriptor) +.I mqdes +¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ + +.\"O If the calling process has attached a notification request +.\"O to this message queue via +.\"O .IR mqdes , +.\"O then this request is removed, +.\"O and another process can now attach a notification request. +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬ +.I mqdes +·Ðͳ¤Ç¤³¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ËÄÌÃÎÍ×µá (notification request) +¤òÀßÄꤷ¤Æ¤¤¤ë¾ì¹ç¡¢ÄÌÃÎÍ×µá¤Ïºï½ü¤µ¤ì¡¢Â¾¤Î¥×¥í¥»¥¹¤¬¤½¤Î¥­¥å¡¼¤Ë +ÂФ·¤ÆÄÌÃÎÍ×µá¤òÀßÄê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success +.\"O .BR mq_close () +.\"O returns 0; on error, \-1 is returned, with +.\"O .I errno +.\"O set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR mq_close () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O The descriptor specified in +.\"O .I mqdes +.\"O is invalid. +.I mqdes +¤Ç»ØÄꤵ¤ì¤¿µ­½Ò»Ò¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O All open message queues are automatically closed on process termination, +.\"O or upon +.\"O .BR execve (2). +.\"Omotoki: ¼«Æ°Åª¤Ë¥¯¥í¡¼¥º¤µ¤ì¤ë¤Î¤Ï message queue ¤Ç¤Ï¤Ê¤¯ +.\"Omotoki: message queue descriptor ¡© (cf. mq_overview(7)) +¥×¥í¥»¥¹½ªÎ»»þ¡¢¤â¤·¤¯¤Ï +.BR execve (2) +¼Â¹Ô»þ¤Ë¡¢Á´¤Æ¤Î¥ª¡¼¥×¥ó¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï¼«Æ°Åª¤Ë¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR mq_overview (7) diff --git a/draft/man3/mq_getattr.3 b/draft/man3/mq_getattr.3 new file mode 100644 index 00000000..dd69bb8f --- /dev/null +++ b/draft/man3/mq_getattr.3 @@ -0,0 +1,257 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-23, Akihiro MOTOKI +.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" +.TH MQ_GETATTR 3 2008-09-29 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mq_getattr, mq_setattr \- get/set message queue attributes +mq_getattr, mq_setattr \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î°À­¤òÀßÄê/¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "mqd_t mq_getattr(mqd_t " mqdes ", struct mq_attr *" attr ); + +.BI "mqd_t mq_setattr(mqd_t " mqdes ", struct mq_attr *" newattr "," +.BI " struct mq_attr *" oldattr ); +.fi +.sp +.\"O Link with \fI\-lrt\fP. +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR mq_getattr () +.\"O and +.\"O .BR mq_setattr () +.\"O respectively retrieve and modify attributes of the message queue +.\"O referred to by the descriptor +.\"O .IR mqdes . +.BR mq_getattr () +¤È +.BR mq_setattr () +¤Ï¡¢µ­½Ò»Ò +.I mqdes +¤Ç»²¾È¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î°À­¤Î¼èÆÀ¤ÈÊѹ¹¤ò¤½¤ì¤¾¤ì¹Ô¤¦¡£ + +.\"O .BR mq_getattr () +.\"O returns an +.\"O .I mq_attr +.\"O structure in the buffer pointed by +.\"O .IR attr . +.\"O This structure is defined as: +.BR mq_getattr () +¤Ï¡¢ +.I attr +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë +.I mq_attr +¹½Â¤ÂΤò³ÊǼ¤·¤ÆÊÖ¤¹¡£¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +struct mq_attr { +.\"O long mq_flags; /* Flags: 0 or O_NONBLOCK */ +.\"O long mq_maxmsg; /* Max. # of messages on queue */ +.\"O long mq_msgsize; /* Max. message size (bytes) */ +.\"O long mq_curmsgs; /* # of messages currently in queue */ + long mq_flags; /* ¥Õ¥é¥°: 0 ¤« O_NONBLOCK */ + long mq_maxmsg; /* ¥­¥å¡¼¤ÎºÇÂç¥á¥Ã¥»¡¼¥¸¿ô */ + long mq_msgsize; /* ºÇÂç¥á¥Ã¥»¡¼¥¸¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) */ + long mq_curmsgs; /* ¥­¥å¡¼¤Ë¸½ºßÆþ¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¿ô */ +}; +.fi +.in +.PP +.\"O The +.\"O .I mq_flags +.\"O field contains flags associated with the open message queue description. +.\"O This field is initialized when the queue is created by +.\"O .BR mq_open (3). +.\"O The only flag that can appear in this field is +.\"O .BR O_NONBLOCK . +.I mq_flags +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢¥ª¡¼¥×¥ó¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò (open message queue +description) ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Õ¥é¥°¤¬³ÊǼ¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï +.BR mq_open (3) +¤Ç¥­¥å¡¼¤¬ºîÀ®¤µ¤ì¤ëºÝ¤Ë½é´ü²½¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë¸½¤ì¤ë¥Õ¥é¥°¤Ï +.B O_NONBLOCK +¤À¤±¤Ç¤¢¤ë¡£ + +.\"O The +.\"O .I mq_maxmsg +.\"O and +.\"O .I mq_msgsize +.\"O fields are set when the message queue is created by +.\"O .BR mq_open (3). +.I mq_maxmsg +¤È +.I mq_msgsize +¥Õ¥£¡¼¥ë¥É¤Ï +.BR mq_open (3) +¤Ç¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬ºîÀ®¤µ¤ì¤ëºÝ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O The +.\"O .I mq_maxmsg +.\"O field is an upper limit on the number of messages +.\"O that may be placed on the queue using +.\"O .BR mq_send (3). +.I mq_maxmsg +¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +.BR mq_send (3) +¤ò»È¤Ã¤Æ¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¥á¥Ã¥»¡¼¥¸¿ô¤Î¾å¸Â¤Ç¤¢¤ë¡£ +.\"O The +.\"O .I mq_msgsize +.\"O field is an upper limit on the size of messages +.\"O that may be placed on the queue. +.I mq_msgsize +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¥á¥Ã¥»¡¼¥¸¤Î +¾å¸Â¥µ¥¤¥º¤Ç¤¢¤ë¡£ +.\"O Both of these fields must have a value greater than zero. +.\"O Two +.\"O .I /proc +.\"O files that place ceilings on the values for these fields are described in +.\"O .BR mq_open (3). +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï¤É¤Á¤é¤â 0 ¤è¤êÂ礭¤ÊÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤ËÀßÄê¤Ç¤­¤ëÃͤξå¸Â¤Ï +.I /proc +¥Õ¥¡¥¤¥ë¤Ë¤è¤ê·è¤Þ¤ë¡£ +.I /proc +¥Õ¥¡¥¤¥ë¤Î¾ÜºÙ¤Ï +.BR mq_open (3) +¤ËÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"O The +.\"O .I mq_curmsgs +.\"O field returns the number of messages currently held in the queue. +.I mq_curmsgs +¥Õ¥£¡¼¥ë¥É¤Ï¥­¥å¡¼¤Ë¸½ºß³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¿ô¤òÊÖ¤¹¡£ + +.\"O .BR mq_setattr () +.\"O sets message queue attributes using information supplied in the +.\"O .I mq_attr +.\"O structure pointed to by +.\"O .IR newattr . +.BR mq_setattr () +¤Ï¡¢ +.I newattr +¤¬»Ø¤¹ +.I mq_attr +¹½Â¤ÂΤÇÍ¿¤¨¤é¤ì¤¿¾ðÊó¤ò»È¤Ã¤Æ¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î°À­¤òÀßÄꤹ¤ë¡£ +.\"O The only attribute that can be modified is the setting of the +.\"O .B O_NONBLOCK +.\"O flag in +.\"O .IR mq_flags . +.\"O The other fields in +.\"O .I newattr +.\"O are ignored. +Êѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë°À­¤Ï¡¢ +.I mq_flags +¤Î +.B O_NONBLOCK +¥Õ¥é¥°¤ÎÀßÄê¤À¤±¤Ç¤¢¤ë¡£ +.I newattr +¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O If the +.\"O .I oldattr +.\"O field is not NULL, +.\"O then the buffer that it points to is used to return an +.\"O .I mq_attr +.\"O structure that contains the same information that is returned by +.\"O .BR mq_getattr (). +.I oldattr +¥Õ¥£¡¼¥ë¥É¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢ +.BR mq_getattr () +¤¬ÊÖ¤¹¤Î¤ÈƱ¤¸¾ðÊó¤ò³ÊǼ¤·¤¿ +.I mq_attr +¹½Â¤ÂΤò +.I oldattr +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success +.\"O .BR mq_getattr () +.\"O and +.\"O .BR mq_setattr () +.\"O return 0; on error, \-1 is returned, with +.\"O .I errno +.\"O set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.I mq_getattr () +¤È +.I mq_setattr () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O The descriptor specified in +.\"O .I mqdes +.\"O is invalid. +.I mqdes +¤Ç»ØÄꤵ¤ì¤¿µ­½Ò»Ò¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +.\"O .I newattr\->mq_flags +.\"O contained set bits other than +.\"O .BR O_NONBLOCK . +.I newattr\->mq_flags +¤Ë +.B O_NONBLOCK +°Ê³°¤Î¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O On Linux, +.\"O .BR mq_getattr () +.\"O and +.\"O .BR mq_setattr () +.\"O are library functions layered on top of the +.\"O .BR mq_getsetattr (2) +.\"O system call. +Linux ¤Ç¤Ï¡¢ +.BR mq_getattr () +¤È +.BR mq_setattr () +¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤¢¤ê¡¢ +.BR mq_getsetattr (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mq_close (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR mq_overview (7) diff --git a/draft/man3/mq_notify.3 b/draft/man3/mq_notify.3 new file mode 100644 index 00000000..836a0a18 --- /dev/null +++ b/draft/man3/mq_notify.3 @@ -0,0 +1,429 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-31, Akihiro MOTOKI +.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24 +.\" +.TH MQ_NOTIFY 3 2009-09-15 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mq_notify \- register for notification when a message is available +mq_notify \- ¥á¥Ã¥»¡¼¥¸ÅþÃå»þ¤ËÄÌÃΤò¹Ô¤¦¤è¤¦ÅÐÏ¿¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "mqd_t mq_notify(mqd_t " mqdes ", const struct sigevent *" notification ); +.fi +.sp +.\"O Link with \fI\-lrt\fP. +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR mq_notify () +.\"O allows the calling process to register or unregister for delivery of +.\"O an asynchronous notification when a new message arrives on +.\"O the empty message queue referred to by the descriptor +.\"O .IR mqdes . +.BR mq_notify () +¤ò»È¤¦¤È¡¢¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I mqdes +¤Ç»²¾È¤µ¤ì¤ë¶õ¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ë¿·¤·¤¯¥á¥Ã¥»¡¼¥¸¤¬ÅþÃ夷¤¿»þ¤Ë +ÈóƱ´ü¤ÎÄÌÃÎ (notification) ¤ÎÇÛÁ÷¤¬¹Ô¤ï¤ì¤ë¤è¤¦¤ËÅÐÏ¿¤·¤¿¤ê¡¢ +¤½¤Î²ò½ü¤ò¹Ô¤Ã¤¿¤ê¤Ç¤­¤ë¡£ + +.\"O The +.\"O .I notification +.\"O argument is a pointer to a +.\"O .I sigevent +.\"O structure that is defined something like the following: +.I notification +°ú¤­¿ô¤Ï +.I sigevent +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I sigevent +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤Ê´¶¤¸¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.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 for thread + notification */ + void *sigev_notify_attributes; + /* Thread function attributes */ +}; +.fi +.in +.PP +.\"O If +.\"O .I notification +.\"O is a non-NULL pointer, then +.\"O .BR mq_notify () +.\"O registers the calling process to receive message notification. +.I notification +¤¬ NULL ¤Ç¤Ê¤¤¥Ý¥¤¥ó¥¿¤Ç¤¢¤ì¤Ð¡¢ +.BR mq_notify () +¤Ï¥á¥Ã¥»¡¼¥¸ÄÌÃΤò¼õ¤±¼è¤ë¤è¤¦¤Ë¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤òÅÐÏ¿¤¹¤ë¡£ +.\"O The +.\"O .I sigev_notify +.\"O field of the +.\"O .I sigevent +.\"O to which +.\"O .I notification +.\"O points specifies how notification is to be performed. +.\"O This field has one of the following values: +.I notification +¤¬»Ø¤¹ +.I sigevent +¤Î +.I sigev_notify +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤É¤Î¤è¤¦¤ÊÄÌÃΤò¹Ô¤¦¤Î¤«¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤ò»ý¤Ä¡£ +.TP +.B SIGEV_NONE +.\"O A "null" notification: the calling process is registered as the target +.\"O for notification, but when a message arrives, no notification is sent. +¡Ö¶õ¤Î (null)¡×¤ÎÄÌÃÎ: ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤òÄÌÃΤΰ¸Àè¤È¤·¤ÆÅÐÏ¿¤¹¤ë¤¬¡¢ +¼ÂºÝ¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬ÅþÃ夷¤¿»þ¤ËÄÌÃΤÏÁ÷¤é¤ì¤Ê¤¤¡£ +.\" When is SIGEV_NONE useful? +.TP +.B SIGEV_SIGNAL +.\"O Notify the process by sending the signal specified in +.\"O .IR sigev_signo . +.\"O If the signal is caught with a signal handler that +.\"O was registered using the +.\"O .BR sigaction (2) +.\"O .B SA_SIGINFO +.\"O flag, then the following fields are set in the +.\"O .I siginfo_t +.\"O structure that is passed as the second argument of the handler: +.I sigev_signo +¤Ç»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤òÁ÷¤Ã¤Æ¡¢¥×¥í¥»¥¹¤ËÄÌÃΤ¹¤ë¡£ +.BR sigaction (2) +¤Î +.B SA_SIGINFO +¥Õ¥é¥°¤Ç¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÅÐÏ¿¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +¤½¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ç¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÂèÆó°ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¤ë +.I siginfo_t +¹½Â¤ÂΤγƥե£¡¼¥ë¥É¤Ï°Ê²¼¤Î¤è¤¦¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .I si_code +.\"O is set to +.\"O .BR SI_MESGQ ; +.\"O .I si_signo +.\"O is set to the signal number; +.\"O .I si_value +.\"O is set to the value specified in +.\"O .IR notification\->sigev_value ; +.I si_code +¤Ë¤Ï +.B SI_MESGQ +¤¬¡¢ +.I si_signo +¤Ë¤Ï¥·¥°¥Ê¥ëÈֹ椬¡¢ +.I si_value +¤Ë¤Ï +.I notification\->sigev_value +¤Ç»ØÄꤷ¤¿Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.\" I don't know of other implementations that set +.\" si_pid and si_uid -- MTK +.\"O .I si_pid +.\"O is set to the PID of the process that sent the message; and +.\"O .I si_uid +.\"O is set to the real user ID of the sending process. +.\"O The same information is available if the signal is accepted using +.\"O .BR sigwaitinfo (2). +.I si_pid +¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤·¤¿¥×¥í¥»¥¹¤Î PID ¤¬¡¢ +.I si_uid +¤Ë¤ÏÁ÷¿®¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID ¤¬ÀßÄꤵ¤ì¤ë¡£ +.BR sigwaitinfo (2) +¤ò»È¤Ã¤Æ¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¾ì¹ç¤â¡¢Æ±¤¸¾ðÊó¤¬ÆÀ¤é¤ì¤ë¡£ +.TP +.B SIGEV_THREAD +.\"O Deliver notification by invoking +.\"O .I notification\->sigev_notify_function +.\"O as the start function of a new thread. +.\"O The function is invoked with +.\"O .I notification\->sigev_value +.\"O as its sole argument. +.\"O If +.\"O .I notification\->sigev_notify_attributes +.\"O is not NULL, then it should point to a +.\"O .I pthread_attr_t +.\"O structure that defines attributes for the thread (see +.\"O .BR pthread_attr_init (3)). +¿·¤·¤¤¥¹¥ì¥Ã¥É¤Î³«»Ï´Ø¿ô¤È¤·¤Æ +.I notification\->sigev_thread_function +¤òµ¯Æ°¤¹¤ë¤³¤È¤ÇÄÌÃΤò¹Ô¤¦¡£ +µ¯Æ°»þ¤Î´Ø¿ô¤Î°ú¤­¿ô¤È¤·¤Æ¤Ï +.I notification\->sigev_value +¤À¤±¤¬ÅϤµ¤ì¤ë¡£ +.I notification\->sigev_notify_attributes +¤Ï¡¢NULL °Ê³°¤Î¾ì¹ç¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¤Î°À­¤òÄêµÁ¤¹¤ë +.I pthread_attr_t +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤È¤Ê¤Ã¤Æ¤¤¤ëɬÍפ¬¤¢¤ë +.RB ( pthread_attr_init (3) +»²¾È)¡£ +.PP +.\"O Only one process can be registered to receive notification +.\"O from a message queue. +°ì¤Ä¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤«¤éÄÌÃΤò¼õ¿®¤¹¤ë¤è¤¦¤ËÅÐÏ¿¤Ç¤­¤ë¥×¥í¥»¥¹¤Ï +°ì¤Ä¤À¤±¤Ç¤¢¤ë¡£ + +.\"O If +.\"O .I notification +.\"O is NULL, and the calling process is currently registered to receive +.\"O notifications for this message queue, then the registration is removed; +.\"O another process can then register to receive a message notification +.\"O for this queue. +.I notification +¤¬ NULL ¤Ç¡¢¤«¤Ä¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¤³¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤«¤é¤Î +ÄÌÃΤò¼õ¿®¤¹¤ë¤Ë¸½ºßÅÐÏ¿¤·¤Æ¤¤¤ë¾ì¹ç¡¢ÅÐÏ¿¤òºï½ü¤¹¤ë¡£ +¤³¤ì°Ê¹ß¡¢ÊÌ¤Î¥×¥í¥»¥¹¤¬¤³¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤«¤éÄÌÃΤò¼õ¿®¤¹¤ë¤è¤¦¤Ë +ÅÐÏ¿¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + +.\"O Message notification only occurs when a new message arrives and +.\"O the queue was previously empty. +.\"O If the queue was not empty at the time +.\"O .BR mq_notify () +.\"O was called, then a notification will only occur after +.\"O the queue is emptied and a new message arrives. +¥á¥Ã¥»¡¼¥¸ÄÌÃΤϡ¢¤½¤ì¤Þ¤Ç¶õ¤Î¥­¥å¡¼¤Ë¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¤¬ÅþÃ夷¤¿ +¾ì¹ç¤Ë¤Î¤ß¹Ô¤ï¤ì¤ë¡£ +.BR mq_notify () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤Ë¤½¤Î¥­¥å¡¼¤¬¶õ¤Ç¤Ê¤¤¾ì¹ç¡¢ +¤½¤Î¥­¥å¡¼¤¬¶õ¤Ë¤Ê¤ê¡¢¤½¤Î¸å¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¤¬ÅþÃ夷¤¿»þ¤Ë +½é¤á¤ÆÄÌÃΤ¬¹Ô¤ï¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ + +.\"O If another process or thread is waiting to read a message +.\"O from an empty queue using +.\"O .BR mq_receive (3), +.\"O then any message notification registration is ignored: +.\"O the message is delivered to the process or thread calling +.\"O .BR mq_receive (3), +.\"O and the message notification registration remains in effect. +ÊÌ¤Î¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤¬ +.BR mq_receive (3) +¤ò»È¤Ã¤Æ¡¢¶õ¤Î¥­¥å¡¼¤«¤é¥á¥Ã¥»¡¼¥¸¤ÎÆɤ߽Ф·¤òÂԤäƤ¤¤ë¾ì¹ç¡¢ +¥á¥Ã¥»¡¼¥¸ÄÌÃΤÎÅÐÏ¿¤ÏÁ´¤Æ̵»ë¤µ¤ì¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤Ï +.BR mq_receive (3) +¤ò¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤ËÇÛÁ÷¤µ¤ì¡¢ +¥á¥Ã¥»¡¼¥¸ÄÌÃΤÎÅÐÏ¿¤Ï¸úÎϤò»ý¤Ã¤¿¤Þ¤Þ¤È¤Ê¤ë¡£ + +.\"O Notification occurs once: after a notification is delivered, +.\"O the notification registration is removed, +.\"O and another process can register for message notification. +.\"O If the notified process wishes to receive the next notification, +.\"O it can use +.\"O .BR mq_notify () +.\"O to request a further notification. +.\"O This should be done before emptying all unread messages from the queue. +.\"O (Placing the queue in nonblocking mode is useful for emptying +.\"O the queue of messages without blocking once it is empty.) +ÄÌÃΤϰìÅÙ¤À¤±¹Ô¤ï¤ì¤ë¡£ÄÌÃΤ¬Á÷¤é¤ì¤¿¸å¤Ï¡¢ÄÌÃÎÍ×µá¤ÎÅÐÏ¿¤Ïºï½ü¤µ¤ì¡¢ +ÊÌ¤Î¥×¥í¥»¥¹¤¬¥á¥Ã¥»¡¼¥¸ÄÌÃΤò¼õ¿®¤¹¤ë¤è¤¦¤ËÅÐÏ¿¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +ÄÌÃΤò¼õ¤±¤¿¥×¥í¥»¥¹¤¬¼¡¤ÎÄÌÃΤâ¼õ¿®¤·¤¿¤¤¾ì¹ç¤Ï¡¢ +.BR mq_notify () +¤ò»È¤Ã¤Æ¤½¤Î¸å¤ÎÄÌÃΤâ¼õ¤±¤ë¤è¤¦¤ËÍ׵᤹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR mq_notify () +¤òºÆÅٸƤӽФ¹¤Î¤Ï¡¢Æɤ߽Ф·¤Æ¤¤¤Ê¤¤¥á¥Ã¥»¡¼¥¸¤òÁ´ÉôÆɤ߽Ф·¤Æ +¥­¥å¡¼¤¬¶õ¤Ë¤Ê¤ëÁ°¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë +(¥­¥å¡¼¤«¤é¤Î¥á¥Ã¥»¡¼¥¸Æɤ߽Ф·¤ò¥­¥å¡¼¤¬¶õ¤Ë¤Ê¤Ã¤¿»þ¤Ë +Ää»ß (block) ¤»¤º¤Ë¹Ô¤¦¤Ë¤Ï¡¢¥­¥å¡¼¤òÈóÄä»ß¥â¡¼¥É (non-blocking mode) +¤ËÀßÄꤷ¤Æ¤ª¤¯¤È¤è¤¤)¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success +.\"O .BR mq_notify () +.\"O returns 0; on error, \-1 is returned, with +.\"O .I errno +.\"O set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR mq_notify () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O The descriptor specified in +.\"O .I mqdes +.\"O is invalid. +.I mqdes +¤Ë»ØÄꤵ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EBUSY +.\"O Another process has already registered to receive notification +.\"O for this message queue. +ÊÌ¤Î¥×¥í¥»¥¹¤¬¤¹¤Ç¤Ë +¤³¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ËÂФ¹¤ëÄÌÃΤò¼õ¿®¤¹¤ë¤è¤¦¤ËÅÐÏ¿¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O .I notification\->sigev_notify +.\"O is not one of the permitted values; or +.\"O .I notification\->sigev_notify +.\"O is +.\"O .B SIGEV_SIGNAL +.\"O and +.\"O .I notification\->sigev_signo +.\"O is not a valid signal number. +.I notification\->sigev_notify +¤¬µö²Ä¤µ¤ì¤¿ÃͤΤ¤¤º¤ì¤Ç¤â¤Ê¤¤¡£¤â¤·¤¯¤Ï +.I notification\->sigev_notify +¤¬ +.B SIGEV_SIGNAL +¤À¤¬ +.I notification\->sigev_signo +¤¬Í­¸ú¤Ê¥·¥°¥Ê¥ëÈÖ¹æ¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ENOMEM +.\"O Insufficient memory. +ɬÍפʥá¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.PP +.\"O POSIX.1-2008 says that an implementation +.\"O .I may +.\"O generate an +.\"O .B EINVAL +.\"O .\" Linux does not do this +.\"O error if +.\"O .I notification +.\"O is NULL, and the caller is not currently registered to receive +.\"O notifications for the queue +.\"O .IR mqdes . +POSIX.1-2008 ¤Ç¤Ï¡¢ +.I notifications +¤¬ NULL ¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¥­¥å¡¼ +.I mqdes +¤Ë´Ø¤¹¤ëÄÌÃΤò¼õ¿®¤¹¤ë¤è¤¦¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥¨¥é¡¼ +.B EINVAL +¤òÀ¸À®¤¹¤ë¤è¤¦¤Ê¼ÂÁõ¤ò¹Ô¤Ã¤Æ¤â¡Ö¤è¤¤¡×¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" Linux ¤Î¼ÂÁõ¤Ç¤Ï EINVAL ¤ÏÀ¸À®¤µ¤ì¤Ê¤¤ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH EXAMPLE +.SH Îã +.\"O The following program registers a notification request for the +.\"O message queue named in its command-line argument. +.\"O Notification is performed by creating a thread. +.\"O The thread executes a function which reads one message from the +.\"O queue and then terminates the process. +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿Ì¾Á°¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ø¤Î +ÄÌÃÎÍ×µá¤òÅÐÏ¿¤·¡¢ÄÌÃΤϥ¹¥ì¥Ã¥É¤ÎºîÀ®¤Ë¤è¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +¤½¤Î¥¹¥ì¥Ã¥É¤Ï¡¢¤½¤Î¥­¥å¡¼¤«¤é¥á¥Ã¥»¡¼¥¸¤ò°ì¤ÄÆɤ߽Ф·¤Æ¤«¤é¡¢ +¥×¥í¥»¥¹¤ò½ªÎ»¤¹¤ë´Ø¿ô¤ò¼Â¹Ô¤¹¤ë¡£ +.nf + +#include +#include +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +.\"O static void /* Thread start function */ +static void /* ¥¹¥ì¥Ã¥É³«»Ï´Ø¿ô */ +tfunc(union sigval sv) +{ + struct mq_attr attr; + ssize_t nr; + void *buf; + mqd_t mqdes = *((mqd_t *) sv.sival_ptr); + +.\"O /* Determine max. msg size; allocate buffer to receive msg */ + /* ºÇÂç¥á¥Ã¥»¡¼¥¸¥µ¥¤¥º¤ò·èÄꤷ¡¢ + ¥á¥Ã¥»¡¼¥¸¼õ¿®ÍѤΥХåե¡¤ò³ÎÊݤ¹¤ë */ + + if (mq_getattr(mqdes, &attr) == \-1) + handle_error("mq_getattr"); + buf = malloc(attr.mq_msgsize); + if (buf == NULL) + handle_error("malloc"); + + nr = mq_receive(mqdes, buf, attr.mq_msgsize, NULL); + if (nr == \-1) + handle_error("mq_receive"); + + printf("Read %ld bytes from MQ\\n", (long) nr); + free(buf); +.\"O exit(EXIT_SUCCESS); /* Terminate the process */ + exit(EXIT_SUCCESS); /* ¥×¥í¥»¥¹¤ò½ªÎ»¤¹¤ë */ +} + +int +main(int argc, char *argv[]) +{ + mqd_t mqdes; + struct sigevent not; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + mqdes = mq_open(argv[1], O_RDONLY); + if (mqdes == (mqd_t) \-1) + handle_error("mq_open"); + + not.sigev_notify = SIGEV_THREAD; + not.sigev_notify_function = tfunc; + not.sigev_notify_attributes = NULL; +.\"O not.sigev_value.sival_ptr = &mqdes; /* Arg. to thread func. */ + not.sigev_value.sival_ptr = &mqdes; /* ¥¹¥ì¥Ã¥É´Ø¿ô¤ËÅϤ¹°ú¤­¿ô */ + if (mq_notify(mqdes, ¬) == \-1) + handle_error("mq_notify"); + +.\"O pause(); /* Process will be terminated by thread function */ + pause(); /* ¥×¥í¥»¥¹¤Ï¥¹¥ì¥Ã¥É´Ø¿ô¤Ë¤è¤ê½ªÎ»¤µ¤ì¤ë */ +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR mq_overview (7) diff --git a/draft/man3/mq_open.3 b/draft/man3/mq_open.3 new file mode 100644 index 00000000..e761cb40 --- /dev/null +++ b/draft/man3/mq_open.3 @@ -0,0 +1,386 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-23, Akihiro MOTOKI +.\" +.TH MQ_OPEN 3 2009-02-20 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mq_open \- open a message queue +mq_open \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ò¥ª¡¼¥×¥ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.BR "#include " " /* For O_* constants */" +.BR "#include " " /* For mode constants */" +.B #include +.sp +.BI "mqd_t mq_open(const char *" name ", int " oflag ); +.BI "mqd_t mq_open(const char *" name ", int " oflag ", mode_t " mode , +.BI " struct mq_attr *" attr ); +.fi +.sp +.\"O Link with \fI\-lrt\fP. +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR mq_open () +.\"O creates a new POSIX message queue or opens an existing queue. +.\"O The queue is identified by +.\"O .IR name . +.\"O For details of the construction of +.\"O .IR name , +.\"O see +.\"O .BR mq_overview (7). +.BR mq_open () +¤Ï¡¢¿·¤·¤¤ POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òºîÀ®¤¹¤ë¤«¡¢´û¸¤Î¥­¥å¡¼¤ò +¥ª¡¼¥×¥ó¤¹¤ë¡£¥­¥å¡¼¤Ï +.I name +¤Ç¼±Ê̤µ¤ì¤ë¡£ +.I name +¤Î¹½À®¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.B mq_overview (7) +¤ò»²¾È¡£ + +.\"O The +.\"O .I oflag +.\"O argument specifies flags that control the operation of the call. +.\"O (Definitions of the flags values can be obtained by including +.\"O .IR .) +.\"O Exactly one of the following must be specified in +.\"O .IR oflag : +.I oflag +°ú¤­¿ô¤Ë¤Ï¡¢´Ø¿ô¸Æ¤Ó½Ð¤·¤ÎÁàºî¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°¤ò»ØÄꤹ¤ë +(oflag ¤ÎÃͤÎÄêµÁ¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ë¤è¤êÆÀ¤é¤ì¤ë)¡£ +.I oflag +¤Ë¤Ï¡¢°Ê²¼¤Î¤¦¤Á¤¤¤º¤ì¤«°ì¤Ä¤òɬ¤º»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B O_RDONLY +.\"O Open the queue to receive messages only. +¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®ÀìÍѤȤ·¤Æ¥­¥å¡¼¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +.TP +.B O_WRONLY +.\"O Open the queue to send messages only. +¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®ÀìÍѤȤ·¤Æ¥­¥å¡¼¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +.TP +.B O_RDWR +.\"O Open the queue to both send and receive messages. +¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¼õ¿®Î¾ÍѤȤ·¤Æ¥­¥å¡¼¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +.PP +.\"O Zero or more of the following flags can additionally be +.\"O .IR OR ed +.\"O in +.\"O .IR oflag : +0 ¸Ä°Ê¾å¤Î²¼µ­¤Î¥Õ¥é¥°¤ò¡¢¥Ó¥Ã¥Èñ°Ì¤Î OR (ÏÀÍýÏÂ) ¤Ç +.I oflag +¤ËÄɲäǻØÄê¤Ç¤­¤ë¡£ +.TP +.B O_NONBLOCK +.\"O Open the queue in nonblocking mode. +.\"O In circumstances where +.\"O .BR mq_receive (3) +.\"O and +.\"O .BR mq_send (3) +.\"O would normally block, these functions instead fail with the error +.\"O .BR EAGAIN . +ÈóÄä»ß (nonblocking) ¥â¡¼¥É¤Ç¥­¥å¡¼¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +.BR mq_receive (3) +¤È +.BR mq_send (3) +¤Ï¡¢Ä̾ï¤ÏÄä»ß (block) ¤¹¤ë¾õ¶·¤Ë¤ª¤¤¤Æ¡¢¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.TP +.B O_CREAT +.\"O Create the message queue if it does not exist. +.\"O The owner (user ID) of the message queue is set to the effective +.\"O user ID of the calling process. +.\"O The group ownership (group ID) is set to the effective group ID +.\"O of the calling process. +.\"O .\" In reality the file system IDs are used on Linux. +¸ºß¤·¤Ê¤¤¾ì¹ç¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òºîÀ®¤¹¤ë¡£ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î½êÍ­¼Ô (¥æ¡¼¥¶ ID) ¤È¥°¥ë¡¼¥×½êÍ­¸¢ (¥°¥ë¡¼¥× ID) ¤Ï¡¢ +¤½¤ì¤¾¤ì¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤È¼Â¸ú¥°¥ë¡¼¥× ID ¤ËÀßÄꤵ¤ì¤ë¡£ +.\" ¼ÂºÝ¤Ï¡¢Linux ¤Ç¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID ¤¬»ÈÍѤµ¤ì¤ë¡£ +.TP +.B O_EXCL +.\"O If +.\"O .B O_CREAT +.\"O was specified in +.\"O .IR oflag , +.\"O and a queue with the given +.\"O .I name +.\"O already exists, then fail with the error +.\"O .BR EEXIST . +.B O_CREAT +¤¬ +.I oflag +¤Ë»ØÄꤵ¤ì¡¢¤«¤Ä»ØÄꤵ¤ì¤¿Ì¾Á° +.I name +¤ò»ý¤Ä¥­¥å¡¼¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢¥¨¥é¡¼ +.B EEXIST +¤Ç¼ºÇÔ¤¹¤ë¡£ +.PP +.\"O If +.\"O .B O_CREAT +.\"O is specified in +.\"O .IR oflag , +.\"O then two additional arguments must be supplied. +.I oflag +¤Ë +.B O_CREAT +¤ò»ØÄꤹ¤ë¾ì¹ç¡¢ÄÉ²Ã¤Ç 2¤Ä¤Î°ú¤­¿ô¤òÍ¿¤¨¤ëɬÍפ¬¤¢¤ë¡£ +.\"O The +.\"O .I mode +.\"O argument specifies the permissions to be placed on the new queue, +.\"O as for +.\"O .BR open (2). +.\"O (Symbolic definitions for the permissions bits can be obtained by including +.\"O .IR .) +.\"O The permissions settings are masked against the process umask. +.I mode +°ú¤­¿ô¤Ï¡¢¿·¤·¤¤¥­¥å¡¼¤ËŬÍѤµ¤ì¤ëµö²ÄÀßÄê (permission) ¤ò¡¢ +.BR open (2) +¤ÈƱ¤¸¤è¤¦¤Ë»ØÄꤹ¤ë +(µö²Ä¥Ó¥Ã¥È¤Î¥·¥ó¥Ü¥ëÄêµÁ¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ë¤è¤êÆÀ¤é¤ì¤ë)¡£ +µö²ÄÀßÄê¤Ï¥×¥í¥»¥¹¤Î umask ¤Ç¥Þ¥¹¥¯¤µ¤ì¤ë¡£ +.\"O The +.\"O .I attr +.\"O argument specifies attributes for the queue. +.\"O See +.\"O .BR mq_getattr (3) +.\"O for details. +.\"O If +.\"O .I attr +.\"O is NULL, then the queue is created with implementation-defined +.\"O default attributes. +.I attr +°ú¤­¿ô¤Ï¡¢¥­¥å¡¼¤Î°À­¤ò»ØÄꤹ¤ë¡£¾ÜºÙ¤Ï¡¢ +.BR mq_getattr (3) +¤ò»²¾È¡£ +.I attr +¤¬ NULL ¤Î¾ì¹ç¡¢¥­¥å¡¼¤Ï¼ÂÁõ¤ÇÄêµÁ¤µ¤ì¤¿¥Ç¥Õ¥©¥ë¥È°À­¤ÇºîÀ®¤µ¤ì¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR mq_open () +.\"O returns a message queue descriptor for use by other +.\"O message queue functions. +À®¸ù¤¹¤ë¤È¡¢ +.BR mq_open () +¤Ï¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò (message queue descriptor) ¤òÊÖ¤¹¡£ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò¤Ï¾¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼´ØÏ¢¤Î´Ø¿ô¤Ç»ÈÍѤµ¤ì¤ë¡£ +.\"O On error, +.\"O .BR mq_open () +.\"O returns +.\"O .IR "(mqd_t)\ \-1", +.\"O with +.\"O .I errno +.\"O set to indicate the error. +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR mq_open () +¤Ï +.I "(mqd_t)\ \-1" +¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O The queue exists, but the caller does not have permission to +.\"O open it in the specified mode. +¥­¥å¡¼¤Ï¸ºß¤¹¤ë¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¤¬»ØÄꤵ¤ì¤¿¥â¡¼¥É¤Ç¤½¤Î¥­¥å¡¼ +¤ò¥ª¡¼¥×¥ó¤¹¤ëµö²Ä¤ò»ý¤¿¤Ê¤¤¡£ +.TP +.B EACCES +.\"O .I name +.\"O contained more than one slash. +.I name +¤Ë¥¹¥é¥Ã¥·¥å¤¬ 2 ¸Ä°Ê¾å´Þ¤Þ¤ì¤Æ¤¤¤¿¡£ +.\" Note that this isn't consistent with the same case for sem_open() +.TP +.B EEXIST +.\"O Both +.\"O .B O_CREAT +.\"O and +.\"O .B O_EXCL +.\"O were specified in +.\"O .IR oflag , +.\"O but a queue with this +.\"O .I name +.\"O already exists. +.I oflag +¤Ë +.B O_CREAT +¤È +.B O_EXCL +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¤¬¡¢»ØÄꤵ¤ì¤¿Ì¾Á° +.I name +¤ò»ý¤Ä¥­¥å¡¼¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¡£ +.TP +.B EINVAL +.\"O .B O_CREAT +.\"O was specified in +.\"O .IR oflag , +.\"O and +.\"O .I attr +.\"O was not NULL, but +.\"O .I attr\->mq_maxmsg +.\"O or +.\"O .I attr\->mq_msqsize +.\"O was invalid. +.\"O Both of these fields must be greater than zero. +.I oflag +¤Ë +.B O_CREAT +¤¬»ØÄꤵ¤ì¡¢¤«¤Ä +.I attr +¤¬ NULL °Ê³°¤À¤¬¡¢ +.I attr\->mq_maxmsg +¤« +.I attr\->mq_msqsize +¤¬ÉÔÀµ¤Ç¤¢¤Ã¤¿¡£ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤ÏξÊý¤È¤â 0 ¤è¤êÂ礭¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O In a process that is unprivileged (does not have the +.\"O .B CAP_SYS_RESOURCE +.\"O capability), +.\"O .I attr\->mq_maxmsg +.\"O must be less than or equal to the +.\"O .I msg_max +.\"O limit, and +.\"O .I attr\->mq_msgsize +.\"O must be less than or equal to the +.\"O .I msgsize_max +.\"O limit. +.\"O In addition, even in a privileged process, +.\"O .I attr\->mq_maxmsg +.\"O cannot exceed the +.\"O .B HARD_MAX +.\"O limit. +.\"O (See +.\"O .BR mq_overview (7) +.\"O for details of these limits.) +¥×¥í¥»¥¹¤¬Æø¢¤ò»ý¤¿¤Ê¤¤ +.RB ( CAP_SYS_RESOURCE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤) ¾ì¹ç¡¢ +.I attr\->mq_maxmsg +¤È +.I attr\->mq_msgsize +¤Ï¡¢¤½¤ì¤¾¤ì¾å¸Â +.IR msg_max ¡¢ +.I msgsize_max +°Ê²¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤Þ¤¿¡¢Æø¢¥×¥í¥»¥¹¤Î¾ì¹ç¤Ç¤â¡¢ +.I attr\->mq_maxmsg +¤Ï +.B HARD_MAX +¾å¸Â¤òĶ¤¨¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +(¤³¤ì¤é¤Î¾å¸Â¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï +.BR mq_overview (7) +¤ò»²¾È¡£) +.TP +.B EMFILE +.\"O The process already has the maximum number of files and +.\"O message queues open. +¤½¤Î¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤È¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¿ô¤¬ +¥×¥í¥»¥¹Ëè¤Î¾å¸Â¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENAMETOOLONG +.\"O .I name +.\"O was too long. +.I name +¤¬Ä¹¤¹¤®¤ë¡£ +.TP +.B ENFILE +.\"O The system limit on the total number of open files and message queues +.\"O has been reached. +¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤È¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¹ç·×¿ô¤¬ +¥·¥¹¥Æ¥à¾å¸Â¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENOENT +.\"O The +.\"O .B O_CREAT +.\"O flag was not specified in +.\"O .IR oflag , +.\"O and no queue with this +.\"O .I name +.\"O exists. +.B O_CREAT +¥Õ¥é¥°¤¬ +.I oflag +¤Ë»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¤¬¡¢»ØÄꤵ¤ì¤¿Ì¾Á° +.I name +¤ò»ý¤Ä¥­¥å¡¼¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOENT +.\"O .I name +.\"O was just "/" followed by no other characters. +.I name +¤¬ "/" ¤À¤±¤Ç¡¢¤½¤Î¸å¤í¤Ë¾¤Îʸ»ú¤¬Â³¤¤¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.\" Note that this isn't consistent with the same case for sem_open() +.TP +.B ENOMEM +.\"O Insufficient memory. +½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOSPC +.\"O Insufficient space for the creation of a new message queue. +.\"O This probably occurred because the +.\"O .I queues_max +.\"O limit was encountered; see +.\"O .BR mq_overview (7). +¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òºîÀ®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¶õ´Ö¤¬¤Ê¤¤¡£ +¤³¤Î¥¨¥é¡¼¤Ï¤ª¤½¤é¤¯ +.I queues_max +¾å¸Â¤ËÄñ¿¨¤·¤¿¤¿¤áµ¯¤³¤Ã¤¿¤Î¤À¤í¤¦¡£ +.BR mq_overview (7) +¤ò»²¾È¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O In kernels before 2.6.14, +.\"O the process umask was not applied to the permissions specified in +.\"O .IR mode . +2.6.14 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¡¢ +¥×¥í¥»¥¹¤Î umask ¤¬ +.I mode +¤Ç»ØÄꤵ¤ì¤¿µö²ÄÀßÄê¤ËŬÍѤµ¤ì¤Ê¤«¤Ã¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR mq_overview (7) diff --git a/draft/man3/mq_receive.3 b/draft/man3/mq_receive.3 new file mode 100644 index 00000000..3e747cfc --- /dev/null +++ b/draft/man3/mq_receive.3 @@ -0,0 +1,262 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-23, Akihiro MOTOKI +.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" +.TH MQ_RECEIVE 3 2010-02-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mq_receive, mq_timedreceive \- receive a message from a message queue +mq_receive, mq_timedreceive \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤«¤é¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "ssize_t mq_receive(mqd_t " mqdes ", char *" msg_ptr , +.BI " size_t " msg_len ", unsigned *" msg_prio ); +.sp +.B #define _XOPEN_SOURCE 600 +.B #include +.B #include +.sp +.BI "ssize_t mq_timedreceive(mqd_t " mqdes ", char *" msg_ptr , +.BI " size_t " msg_len ", unsigned *" msg_prio , +.BI " const struct timespec *" abs_timeout ); +.fi +.sp +.\"O Link with \fI\-lrt\fP. +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR mq_receive () +.\"O removes the oldest message with the highest priority from +.\"O the message queue referred to by the descriptor +.\"O .IR mqdes , +.\"O and places it in the buffer pointed to by +.\"O .IR msg_ptr . +.BR mq_receive () +¤Ï¡¢µ­½Ò»Ò +.I mqdes +¤Ç»²¾È¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤«¤éºÇ¤â¹â¤¤Í¥ÀèÅÙ¤ò»ý¤Ä +ºÇ¤â¸Å¤¤¥á¥Ã¥»¡¼¥¸¤òºï½ü¤·¡¢¤½¤Î¥á¥Ã¥»¡¼¥¸¤ò +.I msg_ptr +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤¹¤ë¡£ +.\"O The +.\"O .I msg_len +.\"O argument specifies the size of the buffer pointed to by +.\"O .IR msg_ptr ; +.\"O this must be greater than the +.\"O .I mq_msgsize +.\"O attribute of the queue (see +.\"O .BR mq_getattr (3)). +.I msg_len +°ú¤­¿ô¤Ï¡¢ +.I msg_ptr +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤ò¼¨¤¹¡£¤³¤ÎÃͤϥ­¥å¡¼¤Î +.I mq_msgsize +°À­¤è¤ê¤âÂ礭¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.RB ( mq_getattr (3) +»²¾È)¡£ +.\"O If +.\"O .I prio +.\"O is not NULL, then the buffer to which it points is used +.\"O to return the priority associated with the received message. +.I prio +¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢ +.I prio +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë¼õ¿®¤·¤¿¥á¥Ã¥»¡¼¥¸¤ÎÍ¥ÀèÅÙ¤¬³ÊǼ¤µ¤ì¤ë¡£ + +.\"O If the queue is empty, then, by default, +.\"O .BR mq_receive () +.\"O blocks until a message becomes available, +.\"O or the call is interrupted by a signal handler. +.\"O If the +.\"O .B O_NONBLOCK +.\"O flag is enabled for the message queue description, +.\"O then the call instead fails immediately with the error +.\"O .BR EAGAIN . +¥­¥å¡¼¤¬¶õ¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR mq_receive () +¤Ï¡¢¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¤¬ÆϤ¯¤«¡¢´Ø¿ô¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê +ÃæÃǤµ¤ì¤ë¤Þ¤Ç¡¢Ää»ß (block) ¤¹¤ë¡£ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò (message queue description) ¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.BR mq_receive () +¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¤¹¤°¤Ë¼ºÇÔ¤¹¤ë¡£ + +.\"O .BR mq_timedreceive () +.\"O behaves just like +.\"O .BR mq_receive (), +.\"O except that if the queue is empty and the +.\"O .B O_NONBLOCK +.\"O flag is not enabled for the message queue description, then +.\"O .I abs_timeout +.\"O points to a structure which specifies a ceiling on the time for which +.\"O the call will block. +.\"O This ceiling is an absolute timeout in seconds and nanoseconds +.\"O since the Epoch, 1970-01-01 00:00:00 +0000 (UTC), and it is +.\"O specified in the following structure: +.BR mq_timedreceive () +¤Ï +.BR mq_receive () +¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë¤¬¡¢ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬¶õ¤Ç¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤¬Ää»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤ò +.I abs_timeout +¤¬»Ø¤¹¹½Â¤ÂΤǻØÄꤹ¤ëÅÀ¤¬°Û¤Ê¤ë¡£¤³¤Î¾å¸Â¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥È¤Î»þ¹ï¤ò¡¢ +»þ¹ïµª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤Î·Ð²á»þ´Ö +(ÉäȥʥÎÉäÎÁÈ) ¤Ç»ØÄꤹ¤ë¡£¥¿¥¤¥à¥¢¥¦¥È»þ¹ï¤Ï°Ê²¼¤Î¹½Â¤ÂΤǻØÄꤹ¤ë: +.sp +.in +4n +.nf +struct timespec { +.\"O time_t tv_sec; /* seconds */ +.\"O long tv_nsec; /* nanoseconds */ + time_t tv_sec; /* Éà */ + long tv_nsec; /* ¥Ê¥ÎÉà */ +}; + +.fi +.in +.\"O If no message is available, +.\"O and the timeout has already expired by the time of the call, +.\"O .BR mq_timedreceive () +.\"O returns immediately. +¥á¥Ã¥»¡¼¥¸¤¬¥­¥å¡¼¤Ë¤Ê¤¯¡¢´Ø¿ô¸Æ¤Ó½Ð¤·»þ¤Ë¤¹¤Ç¤Ë¥¿¥¤¥à¥¢¥¦¥È»þ¹ï¤¬ +²á¤®¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR mq_timedreceive () +¤Ï¤¹¤°¤ËÊ֤롣 +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR mq_receive () +.\"O and +.\"O .BR mq_timedreceive () +.\"O return the number of bytes in the received message; +.\"O on error, \-1 is returned, with +.\"O .I errno +.\"O set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR mq_receive () +¤È +.BR mq_timedreceive () +¤Ï¼õ¿®¤·¤¿¥á¥Ã¥»¡¼¥¸¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.\"O The queue was empty, and the +.\"O .B O_NONBLOCK +.\"O flag was set for the message queue description referred to by +.\"O .IR mqdes . +¥­¥å¡¼¤¬¶õ¤Ç¡¢¤«¤Ä +.I mqdes +¤Ç»²¾È¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¡£ +.TP +.B EBADF +.\"O The descriptor specified in +.\"O .I mqdes +.\"O was invalid. +.I mqdes +¤Ç»ØÄꤵ¤ì¤¿µ­½Ò»Ò¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EINTR +.\"O The call was interrupted by a signal handler; see +.\"O .BR signal (7). +´Ø¿ô¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤êÃæÃǤµ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.\"O The call would have blocked, and +.\"O .I abs_timeout +.\"O was invalid, either because +.\"O .I tv_sec +.\"O was less than zero, or because +.\"O .I tv_nsec +.\"O was less than zero or greater than 1000 million. +´Ø¿ô¸Æ¤Ó½Ð¤·¤ÏÄä»ß¤¹¤ë¤Ï¤º¤Ç¤¢¤Ã¤¿¤¬¡¢ +.I abs_timeout +¤¬ÉÔÀµ¤Ç¤¢¤Ã¤¿¡£ +.I abs_timeout +¤¬ÉÔÀµ¤È¤Ï¡¢ +.I tv_sec +¤¬ 0 ̤Ëþ¡¢¤â¤·¤¯¤Ï +.I tv_nsec +¤¬ 0 ̤Ëþ¤« 1,000,000,000 ¤è¤êÂ礭¤¤¡¢¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.TP +.B EMSGSIZE +.\"O .I msg_len +.\"O was less than the +.\"O .I mq_msgsize +.\"O attribute of the message queue. +.I msg_len +¤¬¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î +.I mq_msgsize +°À­¤è¤ê¤â¾®¤µ¤«¤Ã¤¿¡£ +.TP +.B ETIMEDOUT +.\"O The call timed out before a message could be transferred. +¥á¥Ã¥»¡¼¥¸¤¬Å¾Á÷¤µ¤ì¤ëÁ°¤Ë´Ø¿ô¸Æ¤Ó½Ð¤·¤¬¥¿¥¤¥à¥¢¥¦¥È¤·¤¿¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O On Linux, +.\"O .BR mq_timedreceive () +.\"O is a system call, and +.\"O .BR mq_receive () +.\"O is a library function layered on top of that system call. +Linux ¤Ç¤Ï¡¢ +.BR mq_timedreceive () +¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£ +.BR mq_receive () +¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¡¢ +.BR mq_timedreceive () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR feature_test_macros (7), +.BR mq_overview (7), +.BR time (7) diff --git a/draft/man3/mq_send.3 b/draft/man3/mq_send.3 new file mode 100644 index 00000000..08f9e8da --- /dev/null +++ b/draft/man3/mq_send.3 @@ -0,0 +1,269 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-23, Akihiro MOTOKI +.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" +.TH MQ_SEND 3 2010-02-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mq_send, mq_timedsend \- send a message to a message queue +mq_send, mq_timedsend \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ë¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "mqd_t mq_send(mqd_t " mqdes ", const char *" msg_ptr , +.BI " size_t " msg_len ", unsigned " msg_prio ); +.sp +.B #define _XOPEN_SOURCE 600 +.B #include +.B #include +.sp +.BI "mqd_t mq_timedsend(mqd_t " mqdes ", const char *" msg_ptr , +.BI " size_t " msg_len ", unsigned " msg_prio , +.BI " const struct timespec *" abs_timeout ); +.fi +.sp +.\"O Link with \fI\-lrt\fP. +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR mq_send () +.\"O adds the message pointed to by +.\"O .I msg_ptr +.\"O to the message queue referred to by the descriptor +.\"O .IR mqdes . +.\"O The +.\"O .I msg_len +.\"O argument specifies the length of the message pointed to by +.\"O .IR msg_ptr ; +.\"O this length must be less than or equal to the queue's +.\"O .I mq_msgsize +.\"O attribute. +.\"O Zero-length messages are allowed. +.BR mq_send () +¤Ï¡¢µ­½Ò»Ò +.I mqdes +¤Ç»²¾È¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ë +.I msg_ptr +¤¬»Ø¤¹¥á¥Ã¥»¡¼¥¸¤òÄɲ乤롣 +.I msg_len +°ú¤­¿ô¤Ï¡¢ +.I msg_ptr +¤¬»Ø¤¹¥á¥Ã¥»¡¼¥¸¤ÎŤµ¤ò¼¨¤¹¡£¤³¤ÎŤµ¤Ï¥­¥å¡¼¤Î +.I mq_msgsize +°À­°Ê²¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Ťµ¤¬ 0 ¤Î¥á¥Ã¥»¡¼¥¸¤âǧ¤á¤é¤ì¤Æ¤¤¤ë¡£ + +.\"O The +.\"O .I msg_prio +.\"O argument is a nonnegative integer that specifies the priority +.\"O of this message. +.\"O Messages are placed on the queue in decreasing order of priority, +.\"O with newer messages of the same priority being placed after +.\"O older messages with the same priority. +.I msg_prio +°ú¤­¿ô¤Ï¡¢¥á¥Ã¥»¡¼¥¸¤ÎÍ¥ÀèÅÙ¤ò»ØÄꤹ¤ëÉé¤Ç¤Ê¤¤À°¿ô¤Ç¤¢¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤ÏÍ¥ÀèÅ٤ι߽ç¤Ç¥­¥å¡¼¤Ë³ÊǼ¤µ¤ì¡¢Æ±¤¸Í¥ÀèÅ٤ο·¤·¤¤¥á¥Ã¥»¡¼¥¸¤Ï +Ʊ¤¸Í¥ÀèÅ٤θŤ¤¥á¥Ã¥»¡¼¥¸¤Î¸å¤í¤Ë³ÊǼ¤µ¤ì¤ë¡£ + +.\"O If the message queue is already full +.\"O (i.e., the number of messages on the queue equals the queue's +.\"O .I mq_maxmsg +.\"O attribute), then, by default, +.\"O .BR mq_send () +.\"O blocks until sufficient space becomes available to allow the message +.\"O to be queued, or until the call is interrupted by a signal handler. +.\"O If the +.\"O .B O_NONBLOCK +.\"O flag is enabled for the message queue description, +.\"O then the call instead fails immediately with the error +.\"O .BR EAGAIN . +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬¤¹¤Ç¤Ë°ìÇդξì¹ç +(¤¹¤Ê¤ï¤Á¡¢¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¿ô¤¬¥­¥å¡¼¤Î +.I mq_maxmsg +°À­¤ÈÅù¤·¤¤¾ì¹ç)¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.B mq_send () +¤Ï¡¢¥á¥Ã¥»¡¼¥¸¤ò¥­¥å¡¼¥¤¥ó¥°¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¶õ´Ö¤¬¤Ç¤­¤ë¤«¡¢ +´Ø¿ô¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤êÃæÃǤµ¤ì¤ë¤Þ¤Ç¡¢Ää»ß (block) ¤¹¤ë¡£ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò (message queue description) ¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.BR mq_send () +¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¤¹¤°¤Ë¼ºÇÔ¤¹¤ë¡£ + +.\"O .BR mq_timedsend () +.\"O behaves just like +.\"O .BR mq_send (), +.\"O except that if the queue is full and the +.\"O .B O_NONBLOCK +.\"O flag is not enabled for the message queue description, then +.\"O .I abs_timeout +.\"O points to a structure which specifies a ceiling on the time for which +.\"O the call will block. +.\"O This ceiling is an absolute timeout in seconds and nanoseconds +.\"O since the Epoch, 1970-01-01 00:00:00 +0000 (UTC), and it is +.\"O specified in the following structure: +.BR mq_timedsend () +¤Ï +.BR mq_send () +¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë¤¬¡¢ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬°ìÇդǡ¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤¬Ää»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤ò +.I abs_timeout +¤¬»Ø¤¹¹½Â¤ÂΤǻØÄꤹ¤ëÅÀ¤¬°Û¤Ê¤ë¡£¤³¤Î¾å¸Â¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥È¤Î»þ¹ï¤ò +»þ¹ïµª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤Î·Ð²á»þ´Ö +(ÉäȥʥÎÉäÎÁÈ) ¤Ç»ØÄꤹ¤ë¡£¥¿¥¤¥à¥¢¥¦¥È»þ¹ï¤Ï°Ê²¼¤Î¹½Â¤ÂΤǻØÄꤹ¤ë: +.sp +.in +4n +.nf +struct timespec { +.\"O time_t tv_sec; /* seconds */ +.\"O long tv_nsec; /* nanoseconds */ + time_t tv_sec; /* Éà */ + long tv_nsec; /* ¥Ê¥ÎÉà */ +}; + +.fi +.in +.\"O If the message queue is full, +.\"O and the timeout has already expired by the time of the call, +.\"O .BR mq_timedsend () +.\"O returns immediately. +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬°ìÇդǡ¢´Ø¿ô¸Æ¤Ó½Ð¤·»þ¤Ë¤¹¤Ç¤Ë¥¿¥¤¥à¥¢¥¦¥È»þ¹ï¤¬ +²á¤®¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR mq_timedsend () +¤Ï¤¹¤°¤ËÊ֤롣 +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR mq_send () +.\"O and +.\"O .BR mq_timedsend () +.\"O return zero; on error, \-1 is returned, with +.\"O .I errno +.\"O set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR mq_send () +¤È +.BR mq_timedsend () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.\"O The queue was empty, and the +.\"O .B O_NONBLOCK +.\"O flag was set for the message queue description referred to by +.\"O .IR mqdes . +.\"O motoki: mq_send() ¤¬ block ¤¹¤ë¤Î¤Ï ¥­¥å¡¼¤¬ full ¤Î¤È¤­¡£ +¥­¥å¡¼¤¬°ìÇդǡ¢¤«¤Ä +.I mqdes +¤Ç»²¾È¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¡£ +.TP +.B EBADF +.\"O The descriptor specified in +.\"O .I mqdes +.\"O was invalid. +.I mqdes +¤Ç»ØÄꤵ¤ì¤¿µ­½Ò»Ò¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EINTR +.\"O The call was interrupted by a signal handler; see +.\"O .BR signal (7). +´Ø¿ô¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤êÃæÃǤµ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.\"O The call would have blocked, and +.\"O .I abs_timeout +.\"O was invalid, either because +.\"O .I tv_sec +.\"O was less than zero, or because +.\"O .I tv_nsec +.\"O was less than zero or greater than 1000 million. +´Ø¿ô¸Æ¤Ó½Ð¤·¤ÏÄä»ß¤¹¤ë¤Ï¤º¤Ç¤¢¤Ã¤¿¤¬¡¢ +.I abs_timeout +¤¬ÉÔÀµ¤Ç¤¢¤Ã¤¿¡£ +.I abs_timeout +¤¬ÉÔÀµ¤È¤Ï¡¢ +.I tv_sec +¤¬ 0 ̤Ëþ¡¢¤â¤·¤¯¤Ï +.I tv_nsec +¤¬ 0 ̤Ëþ¤« 1,000,000,000 ¤è¤êÂ礭¤¤¡¢¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.TP +.B EMSGSIZE +.\"O .I msg_len +.\"O was greater than the +.\"O .I mq_msgsize +.\"O attribute of the message queue. +.I msg_len +¤¬¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î +.I mq_msgsize +°À­¤è¤ê¤âÂ礭¤«¤Ã¤¿¡£ +.TP +.B ETIMEDOUT +.\"O The call timed out before a message could be transferred. +¥á¥Ã¥»¡¼¥¸¤¬Å¾Á÷¤µ¤ì¤ëÁ°¤Ë´Ø¿ô¸Æ¤Ó½Ð¤·¤¬¥¿¥¤¥à¥¢¥¦¥È¤·¤¿¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O On Linux, +.\"O .BR mq_timedsend () +.\"O is a system call, and +.\"O .BR mq_send () +.\"O is a library function layered on top of that system call. +Linux ¤Ç¤Ï¡¢ +.BR mq_timedsend () +¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£ +.BR mq_send () +¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¡¢ +.BR mq_timedsend () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_unlink (3), +.BR feature_test_macros (7), +.BR mq_overview (7), +.BR time (7) diff --git a/draft/man3/mq_unlink.3 b/draft/man3/mq_unlink.3 new file mode 100644 index 00000000..6581a266 --- /dev/null +++ b/draft/man3/mq_unlink.3 @@ -0,0 +1,102 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-23, Akihiro MOTOKI +.\" +.TH MQ_UNLINK 3 2006-02-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mq_unlink \- remove a message queue +mq_unlink \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òºï½ü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "mqd_t mq_unlink(const char *" name ); +.fi +.sp +.\"O Link with \fI\-lrt\fP. +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR mq_unlink () +.\"O removes the specified message queue +.\"O .IR name . +.\"O The message queue name is removed immediately. +.\"O The queue itself is destroyed once any other processes that have +.\"O the queue open close their descriptors referring to the queue. +.BR mq_unlink () +¤Ï»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¥­¥å¡¼ +.I name +¤òºï½ü¤¹¤ë¡£ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼Ì¾¤Ïľ¤Á¤Ëºï½ü¤µ¤ì¤ë¡£ +¥­¥å¡¼¼«ÂΤϡ¢¤½¤Î¥­¥å¡¼¤ò¥ª¡¼¥×¥ó¤·¤¿Â¾¤Î¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤¬ +¤½¤Î¥­¥å¡¼¤ò»²¾È¤¹¤ëµ­½Ò»Ò¤ò¥¯¥í¡¼¥º¤·¤¿»þÅÀ¤ÇÇË´þ¤µ¤ì¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success +.\"O .BR mq_unlink () +.\"O returns 0; on error, \-1 is returned, with +.\"O .I errno +.\"O set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR mq_unlink () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O The caller does not have permission to unlink this message queue. +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¤³¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òºï½ü (unlink) ¤¹¤ë +µö²Ä¤ò»ý¤¿¤Ê¤¤¡£ +.TP +.B ENAMETOOLONG +.\"O .I name +.\"O was too long. +.I name +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +.\"O There is no message queue with the given +.\"O .IR name . +»ØÄꤵ¤ì¤¿Ì¾Á° +.I name +¤ò»ý¤Ä¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬Â¸ºß¤·¤Ê¤¤¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_overview (7) diff --git a/draft/man3/mtrace.3 b/draft/man3/mtrace.3 new file mode 100644 index 00000000..f82271d7 --- /dev/null +++ b/draft/man3/mtrace.3 @@ -0,0 +1,81 @@ +.\" 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 new file mode 100644 index 00000000..e0ff1eae --- /dev/null +++ b/draft/man3/nan.3 @@ -0,0 +1,122 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" 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 +.\" +.\"WORD: NaN ̵¸úÃÍ +.\"WORD: quiet NaN SIGFPE ¥·¥°¥Ê¥ë¤Ê¤·¤Î̵¸úÃÍ +.\" +.TH NAN 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O nan, nanf, nanl \- return 'Not a Number' +.SH ̾Á° +nan, nanf, nanl \- ̵¸úÃÍ ('Not a Number') ¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double nan(const char *" tagp ); +.br +.BI "float nanf(const char *" tagp ); +.br +.BI "long double nanl(const char *" tagp ); +.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) +»²¾È): +.in +.sp +.BR nan (), +.BR nanf (), +.BR nanl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.\"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 ¤òÊÖ¤¹¡£ +.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") +¤ò¸Æ¤Ó½Ð¤¹¤Î¤Ï¡¢ +.nf + + 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 () +¤ò¸Æ¤Ö¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR isnan (3), +.BR strtod (3), +.BR math_error (7) diff --git a/draft/man3/netlink.3 b/draft/man3/netlink.3 new file mode 100644 index 00000000..57e31631 --- /dev/null +++ b/draft/man3/netlink.3 @@ -0,0 +1,139 @@ +.\" 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 $ +.\" +.\" 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 +.\" +.\"WORD: payload ³ÊǼÎΰè +.\"WORD: lvalue º¸ÊÕÃÍ +.\" +.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 +.br +.B #include +.sp +.BI "int NLMSG_ALIGN(size_t " len ); +.br +.BI "int NLMSG_LENGTH(size_t " len ); +.br +.BI "int NLMSG_SPACE(size_t " len ); +.br +.BI "void *NLMSG_DATA(struct nlmsghdr *" nlh ); +.br +.BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len ); +.br +.BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len ); +.br +.BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len ); +.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. +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 +¥Õ¥£¡¼¥ë¥É¤ËÂåÆþ¤Ç¤­¤ë +·¤¨¤é¤ì¤¿Ä¹¤µ (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 +.\" 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 \(em this 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 ok to parse. +Netlink ¥á¥Ã¥»¡¼¥¸¤¬ÅÓÀÚ¤ì¤Æ¤ª¤é¤º¡¢¥Ñ¡¼¥º²Äǽ¤Ç¤¢¤ì¤Ð¿¿¤òÊÖ¤¹¡£ +.TP +.B NLMSG_PAYLOAD +.\"O Return the length of the payload associated with the +.\"O .IR nlmsghdr . +.I nlmsghdr +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿³ÊǼÎΰè¤ÎŤµ¤òÊÖ¤¹¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O These macros are nonstandard Linux extensions. +¤³¤ì¤é¤Î¥Þ¥¯¥í¤ÏÈóɸ½à¤Ç 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 ¤òÍѤ¤¤ë¤Û¤¦¤¬Îɤ¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR netlink (7) +.br +.\"O and ftp://ftp.inr.ac.ru/ip-routing/iproute2* for libnetlink +¤ª¤è¤Ó libnetlink ¤Ë´Ø¤·¤Æ¤Ï ftp://ftp.inr.ac.ru/ip-routing/iproute2* diff --git a/draft/man3/nextafter.3 b/draft/man3/nextafter.3 new file mode 100644 index 00000000..9f5d9db3 --- /dev/null +++ b/draft/man3/nextafter.3 @@ -0,0 +1,244 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 +.\" +.\"WORD: mantissa ²¾¿ôÉô +.\"WORD: normalized Àµµ¬²½¤µ¤ì¤¿ +.\"WORD: subnormal ÈóÀµµ¬²½¤Î +.\" +.TH NEXTAFTER 3 2009-12-05 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \- +.\"O floating-point number manipulation +.SH ̾Á° +nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \- +ÉâÆ°¾®¿ôÅÀ¿ô¤ÎÁàºî +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double nextafter(double " x ", double " y ); +.br +.BI "float nextafterf(float " x ", float " y ); +.br +.BI "long double nextafterl(long double " x ", long double " y ); +.sp +.BI "double nexttoward(double " x ", long double " y ); +.br +.BI "float nexttowardf(float " x ", long double " y ); +.br +.BI "long double nexttowardl(long double " x ", long double " y ); +.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) +»²¾È): +.in +.sp +.ad l +.BR nextafter (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR nextafterf (), +.BR nextafterl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR nexttoward (), +.BR nexttowardf (), +.BR nexttowardl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; +.I cc\ -std=c99 +.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 +¤è¤ê¾®¤µ¤¤ºÇÂç¤ÎÉâÆ°¾®¿ôÅÀɽ¸½¤ÎÃͤòÊÖ¤¹¡£ + +.\"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 () +´Ø¿ô·²¤ÈƱ¤¸¤Ï¤¿¤é¤­¤ò¤¹¤ë¡£ +.\"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 ¤Î +¤¹¤°¼¡¤ÎÉâÆ°¾®¿ôÅÀ¿ôɽ¸½¤òÊÖ¤¹¡£ + +.\"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 +¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +¤òÊÖ¤¹¡£ÊÖ¤êÃͤˤϿô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Range error: result overflow +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.\" 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 +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤¬ÈóÀµµ¬²½¿ô¤«¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.\" 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 ) +¤¬¾å¤¬¤ë¡£ +.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" +.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 +.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 ) +¤ò¾å¤¬¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR nearbyint (3) diff --git a/draft/man3/nl_langinfo.3 b/draft/man3/nl_langinfo.3 new file mode 100644 index 00000000..62634d41 --- /dev/null +++ b/draft/man3/nl_langinfo.3 @@ -0,0 +1,186 @@ +.\" Copyright (c) 2001 Markus Kuhn +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 manual +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" Corrected prototype, 2002-10-18, aeb +.\" +.\" Japanese Version Copyright (c) 2001 +.\" UCHIDA Norihiro all rights reserved. +.\" Translated Sun Jul 15 2001 +.\" by UCHIDA Norihiro +.\" +.TH NL_LANGINFO 3 2001-05-11 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O nl_langinfo \- query language and locale information +.SH ̾Á° +nl_langinfo \- ¸À¸ì¤È¥í¥±¡¼¥ë¤Î¾ðÊó¤òÌ䤤¹ç¤ï¤»¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *nl_langinfo(nl_item " item ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR nl_langinfo () +.\"O function provides access to locale information +.\"O in a more flexible way than +.\"O .BR localeconv (3) +.\"O does. +.\"O Individual and additional elements of the locale categories can +.\"O be queried. +.BR nl_langinfo () +´Ø¿ô¤Ï¡¢ +.BR localeconv (3) +¤è¤ê½ÀÆð¤Ê¥í¥±¡¼¥ë¾ðÊó¤Ø¤Î¥¢¥¯¥»¥¹ÊýË¡¤òÄ󶡤¹¤ë¡£ +¥í¥±¡¼¥ë¥«¥Æ¥´¥ê¤Î¸Ä¡¹¤ÎÍ×ÁǤäÄɲäÎÍ×ÁǤòÌ䤤¹ç¤ï¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O Examples for the locale elements that can be specified in \fIitem\fP +.\"O using the constants defined in \fI\fP are: +\fI\fP ¤ËÄê¿ô¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤Æ¡¢ +\fIitem\fP ¤Ë»ØÄê¤Ç¤­¤ë¥í¥±¡¼¥ëÍ×ÁǤÎÎã¤ò°Ê²¼¤Ë¼¨¤¹: +.TP +.BR CODESET \ (LC_CTYPE) +.\"O Return a string with the name of the character encoding used in the +.\"O selected locale, such as "UTF-8", "ISO-8859-1", or "ANSI_X3.4-1968" +.\"O (better known as US-ASCII). +.\"O This is the same string that you get with +.\"O "locale charmap". +.\"O For a list of character encoding names, +.\"O try "locale \-m", cf.\& +.\"O .BR locale (1). +ÁªÂò¤µ¤ì¤¿¥í¥±¡¼¥ë¤ÇÍѤ¤¤é¤ì¤ëʸ»ú¥¨¥ó¥³¡¼¥É̾¤ò¼¨¤¹Ê¸»úÎó¤òÊÖ¤¹¡£ +ʸ»ú¥¨¥ó¥³¡¼¥É̾¤È¤·¤Æ¤Ï¡¢"UTF-8" ¤ä "ISO-8859-1"¡¢"ANSI_X3.4-1968" +(¤³¤ì¤Ï US-ASCII ¤È¤¤¤¦Ì¾Á°¤ÎÊý¤¬¤è¤¯ÃΤé¤ì¤Æ¤¤¤ë) ¤Ê¤É¤¬¤¢¤ë¡£ +¤³¤Îʸ»úÎó¤Ï¡¢"locale charmap" ¤ò¼Â¹Ô¤·¤ÆÆÀ¤é¤ì¤ë¤â¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +ʸ»ú¥¨¥ó¥³¡¼¥É̾¤Î¥ê¥¹¥È¤òÆÀ¤ë¤Ë¤Ï¡¢"locale \-m" ¤ò¼Â¹Ô¤¹¤ë¤È¤è¤¤¡£ +»²¹Í: +.BR locale (1) +.TP +.BR D_T_FMT \ (LC_TIME) +.\"O Return a string that can be used as a format string for +.\"O .BR strftime (3) +.\"O to represent time and date in a locale-specific way. +¥í¥±¡¼¥ë¸ÇÍ­¤Î»þ´Ö¤ÈÆüÉÕ¤òɽ¸½¤¹¤ë¤È¤­¤Ë¡¢ +.BR strftime (3) +¤Ç»ÈÍѤǤ­¤ë½ñ¼°ÉÕ¤­Ê¸»úÎó¤òÊÖ¤¹¡£ +.TP +.BR D_FMT \ (LC_TIME) +.\"O Return a string that can be used as a format string for +.\"O .BR strftime (3) +.\"O to represent a date in a locale-specific way. +¥í¥±¡¼¥ë¸ÇÍ­¤ÎÆüÉÕ¤òɽ¸½¤¹¤ë¤È¤­¤Ë¡¢ +.BR strftime (3) +¤Ç»ÈÍѤǤ­¤ë½ñ¼°ÉÕ¤­Ê¸»úÎó¤òÊÖ¤¹¡£ +.TP +.BR T_FMT \ (LC_TIME) +.\"O Return a string that can be used as a format string for +.\"O .BR strftime (3) +.\"O to represent a time in a locale-specific way. +¥í¥±¡¼¥ë¸ÇÍ­¤Î»þ´Ö¤òɽ¸½¤¹¤ë¤È¤­¤Ë¡¢ +.BR strftime (3) +¤Ç»ÈÍѤǤ­¤ë½ñ¼°ÉÕ¤­Ê¸»úÎó¤òÊÖ¤¹¡£ +.TP +.BR DAY_ "{1\(en7} (LC_TIME)" +.\"O Return name of the \fIn\fP-th day of the week. [Warning: this follows +.\"O the US convention DAY_1 = Sunday, not the international convention +.\"O (ISO 8601) that Monday is the first day of the week.] +ÍËÆü̾ (½µ¤Î \fIn\fP ÈÖÌܤÎÆü¤Î̾Á°) ¤òÊÖ¤¹¡£[·Ù¹ð: ¤³¤ÎÍ×ÁǤϥ¢¥á¥ê¥«¤Î +´·½¬¤Ë½¾¤Ã¤Æ DAY_1 ¤¬ ÆüÍËÆü¤È¤Ê¤ë¡£¹ñºÝŪ¤Ê´·½¬ (ISO 8601) ¤Ç¤Ï·îÍËÆü¤¬ +½µ¤ÎºÇ½é¤ÎÆü¤Ç¤¢¤ë¡£] +.TP +.BR ABDAY_ "{1\(en7} (LC_TIME)" +.\"O Return abbreviated name of the \fIn\fP-th day of the week. +ÍËÆü (½µ¤Î \fIn\fP ÈÖÌܤÎÆü) ¤Î¾Êά̾¤òÊÖ¤¹¡£ +.TP +.BR MON_ "{1\(en12} (LC_TIME)" +.\"O Return name of the \fIn\fP-th month. +\fIn\fP ÈÖÌܤηî¤Î̾Á°¤òÊÖ¤¹¡£ +.TP +.BR ABMON_ "{1\(en12} (LC_TIME)" +.\"O Return abbreviated name of the \fIn\fP-th month. +\fIn\fP ÈÖÌܤηî¤Î¾Êά̾¤òÊÖ¤¹¡£ +.TP +.BR RADIXCHAR \ (LC_NUMERIC) +.\"O Return radix character (decimal dot, decimal comma, etc.). +´ð¿ôµ­¹æ (¾®¿ôÅÀ¤ä¥³¥ó¥Þ¤Ê¤É) ¤òÊÖ¤¹¡£ +.TP +.BR THOUSEP \ (LC_NUMERIC) +.\"O Return separator character for thousands (groups of three digits). +Àé¤Î°Ì (3 ·å¤Î¿ôÃÍ) ¤Î¶èÀÚ¤êʸ»ú¤òÊÖ¤¹¡£ +.TP +.BR YESEXPR \ (LC_MESSAGES) +.\"O Return a regular expression that can be used with the +.\"O .BR regex (3) +.\"O function to recognize a positive response to a yes/no question. +yes/no ¤Î¼ÁÌä¤ËÂФ¹¤ë¹ÎÄê¤Î±þÅú¤òǧ¼±¤¹¤ë¤¿¤á¤Ë¡¢ +.BR regex (3) +´Ø¿ô¤Ç»ÈÍѤǤ­¤ëÀµµ¬É½¸½¤òÊÖ¤¹¡£ +.TP +.BR NOEXPR \ (LC_MESSAGES) +.\"O Return a regular expression that can be used with the +.\"O .BR regex (3) +.\"O function to recognize a negative response to a yes/no question. +yes/no ¤Î¼ÁÌä¤ËÂФ¹¤ëÈÝÄê¤Î±þÅú¤òǧ¼±¤¹¤ë¤¿¤á¤Ë +.BR regex (3) +´Ø¿ô¤Ç»ÈÍѤǤ­¤ëÀµµ¬É½¸½¤òÊÖ¤¹¡£ +.TP +.BR CRNCYSTR \ (LC_MONETARY) +.\"O Return the currency symbol, preceded by "\-" if the symbol should +.\"O appear before the value, "+" if the symbol should appear after the +.\"O value, or "." if the symbol should replace the radix character. +Ä̲ߵ­¹æ¤òÊÖ¤¹¡£ +µ­¹æ¤¬¿ôÃͤÎÁ°¤ËÇÛÃÖ¤µ¤ì¤ë¾ì¹ç¤Ï¡¢"\-" ¤¬Ä̲ߵ­¹æ¤ËÁ°ÃÖ¤µ¤ì¤ë¡£ +¿ôÃͤθå¤Ëµ­¹æ¤¬ÇÛÃÖ¤µ¤ì¤ë¾ì¹ç¤Ï "+" ¤¬¡¢ +µ­¹æ¤¬´ð¿ôʸ»ú¤ÈÃÖ¤­´¹¤ï¤ë¾ì¹ç¤Ï "." ¤¬Á°ÃÖ¤µ¤ì¤ë¡£ +.PP +.\"O The above list covers just some examples of items that can be requested. +.\"O For a more detailed list, consult +.\"O .IR "The GNU C Library Reference Manual" . +¾åµ­¤Î¥ê¥¹¥È¤Ï¡¢Í×µá¤Ç¤­¤ëÄêµÁ¤Î¤´¤¯°ìÉô¤Ç¤¢¤ë¡£ +¾ÜºÙ¤Ê¥ê¥¹¥È¤Ï¡¢ +.I "GNU C ¥é¥¤¥Ö¥é¥ê¡¦¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë" +¤ò»²¾È¤·¤Æ¤Û¤·¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O If no locale has been selected for the appropriate category, +.\"O .BR nl_langinfo () +.\"O returns a pointer to the corresponding string in the +.\"O "C" locale. +ŬÀڤʥ«¥Æ¥´¥ê¤Î¥í¥±¡¼¥ë¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢ +.BR nl_langinfo () +¤Ï "C" ¥í¥±¡¼¥ë¤Î¤È¤­¤ËÁêÅö¤¹¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.\"O If \fIitem\fP is not valid, a pointer to an empty string is returned. +̵¸ú¤Ê \fIitem\fP ¤Î¾ì¹ç¤Ï¡¢¶õʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O This pointer may point to static data that may be overwritten on the +.\"O next call to \fBnl_langinfo\fP() or +.\"O .BR setlocale (3). +¤³¤Î¥Ý¥¤¥ó¥¿¤ÏÀÅŪ¤Ê¥Ç¡¼¥¿Îΰè¤ò»Ø¤·¡¢¤½¤ÎÆâÍƤϼ¡²ó¤Î +.BR nl_langinfo () +¤ä +.BR setlocale (3) +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ½ñ¤­Âؤï¤ë¤³¤È¤¬¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SUSv2, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR locale (1), +.BR localeconv (3), +.BR setlocale (3), +.BR charsets (7), +.BR locale (7) +.br +.\"O The GNU C Library Reference Manual +GNU C ¥é¥¤¥Ö¥é¥ê¡¦¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë diff --git a/draft/man3/offsetof.3 b/draft/man3/offsetof.3 new file mode 100644 index 00000000..3a12533c --- /dev/null +++ b/draft/man3/offsetof.3 @@ -0,0 +1,136 @@ +.\" Copyright (C) 2006 Justin Pryzby +.\" and Copyright (C) 2006 Michael Kerrisk +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" References: +.\" /usr/lib/gcc/i486-linux-gnu/4.1.1/include/stddef.h +.\" glibc-doc +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2006-07-25, Akihiro MOTOKI, Catch up to LDP v2.34 +.\" +.TH OFFSETOF 3 2008-07-12 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O offsetof \- offset of a structure member +offsetof \- ¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Î¥ª¥Õ¥»¥Ã¥È¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t offsetof(" type ", " member ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The macro +.\"O .BR offsetof () +.\"O returns the offset of the field +.\"O \fImember\fP from the start of the structure \fItype\fP. +.BR offsetof () +¥Þ¥¯¥í¤Ï¡¢¥Õ¥£¡¼¥ë¥É \fImember\fP ¤Î +¹½Â¤ÂÎ \fItype\fP ¤ÎÀèƬ¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤òÊÖ¤¹¡£ + +.\"O This macro is useful because the sizes of the fields that compose +.\"O a structure can vary across implementations, +.\"O and compilers may insert different numbers of padding +.\"O bytes between fields. +.\"O Consequently, an element's offset is not necessarily +.\"O given by the sum of the sizes of the previous elements. +¤³¤Î¥Þ¥¯¥í¤¬Í­ÍѤʤΤϡ¢ +¹½Â¤ÂΤò¹½À®¤¹¤ë¥Õ¥£¡¼¥ë¥É¤Î¥µ¥¤¥º¤Ï¼ÂÁõ¤Ë¤è¤Ã¤ÆÊѲ½¤¹¤ë¤·¡¢ +¥³¥ó¥Ñ¥¤¥é¤Ë¤è¤ê¥Õ¥£¡¼¥ë¥É´Ö¤ËÁÞÆþ¤¹¤ë¥Ñ¥Ç¥£¥ó¥°¤Î¥Ð¥¤¥È¿ô¤â +°ã¤¦²ÄǽÀ­¤¬¤¢¤ë¤«¤é¤Ç¤¢¤ë¡£ +¤½¤Î·ë²Ì¡¢¤¢¤ë¥¨¥ì¥á¥ó¥È¤Î¥ª¥Õ¥»¥Ã¥È¤Ïɬ¤º¤·¤â¤½¤ì¤è¤êÁ°¤Î +¥¨¥ì¥á¥ó¥È¤Î¥µ¥¤¥º¤Î¹ç·×¤È¤Ï¤Ê¤é¤Ê¤¤¡£ + +.\"O A compiler error will result if +.\"O \fImember\fP is not aligned to a byte boundary +.\"O (i.e., it is a bit field). +\fImember\fP ¤¬¥Ð¥¤¥È¶­³¦¤Ë°ÌÃÖ¤·¤Æ¤¤¤Ê¤¤¾ì¹ç +(¤¹¤Ê¤ï¤Á¡¢¥Ó¥Ã¥È¥Õ¥£¡¼¥ë¥É¤Î¾ì¹ç) ¤Ë¤Ï¡¢ +¥³¥ó¥Ñ¥¤¥é¤Ç¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR offsetof () +.\"O returns the offset of the given +.\"O .I member +.\"O within the given +.\"O .IR type , +.\"O in units of bytes. +.BR offsetof () +¤Ï¡¢»ØÄꤵ¤ì¤¿ +.I member +¤Î»ØÄꤵ¤ì¤¿ +.I type +¤ÎÃæ¤Ç¤Î¥ª¥Õ¥»¥Ã¥È¤ò¡¢¥Ð¥¤¥Èñ°Ì¤ÇÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C89, C99, POSIX.1-2001. +.\"O .SH EXAMPLE +.SH Îã +.\"O On a Linux/i386 system, when compiled using the default +.\"O .BR gcc (1) +.\"O options, the program below produces the following output: +Linux/i386 ¥·¥¹¥Æ¥à¤Ç¡¢ +.BR gcc (1) +¤Î¥Ç¥Õ¥©¥ë¥È¥ª¥×¥·¥ç¥ó¤Ç +¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¾ì¹ç¡¢²¼µ­¤Î¥×¥í¥°¥é¥à¤Ï°Ê²¼¤Î¤è¤¦¤Ê½ÐÎϤòÊÖ¤¹¡£ +.in +4n +.nf + +.RB "$" " ./a.out" +offsets: i=0; c=4; d=8 a=16 +sizeof(struct s)=16 +.fi +.nf +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include + +int +main(void) +{ + struct s { + int i; + char c; + double d; + char a[]; + }; + +.\"O /* Output is compiler dependent */ + /* ½ÐÎϤϥ³¥ó¥Ñ¥¤¥é°Í¸¤Ç¤¢¤ë */ + + printf("offsets: i=%ld; c=%ld; d=%ld a=%ld\\n", + (long) offsetof(struct s, i), + (long) offsetof(struct s, c), + (long) offsetof(struct s, d), + (long) offsetof(struct s, a)); + printf("sizeof(struct s)=%ld\\n", (long) sizeof(struct s)); + + exit(EXIT_SUCCESS); +} +.fi diff --git a/draft/man3/on_exit.3 b/draft/man3/on_exit.3 new file mode 100644 index 00000000..ef22b935 --- /dev/null +++ b/draft/man3/on_exit.3 @@ -0,0 +1,124 @@ +.\" 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-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 +.\" +.TH ON_EXIT 3 2008-12-05 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O on_exit \- register a function to be called at normal process termination +on_exit \- ¥×¥í¥»¥¹¤¬Àµ¾ï¤Ë½ªÎ»¤·¤¿ºÝ¤Ë¸Æ¤Ð¤ì¤ë´Ø¿ô¤òÅÐÏ¿¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int on_exit(void (*" function ")(int , void *), void *" arg ); +.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 on_exit (): +_BSD_SOURCE || _SVID_SOURCE +.\"O .SH DESCRIPTION +.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 °ú¿ô¤¬ÅϤµ¤ì¤ë¡£ + +.\"O The same function may be registered multiple times: +.\"O it is called once for each registration. +Ʊ¤¸´Ø¿ô¤òÊ£¿ô²óÅÐÏ¿¤·¤Æ¤â¤è¤¤¡£ +ÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤ÏÅÐÏ¿ 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" +.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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR _exit (2), +.BR atexit (3), +.BR exit (3) diff --git a/draft/man3/opendir.3 b/draft/man3/opendir.3 new file mode 100644 index 00000000..79c92707 --- /dev/null +++ b/draft/man3/opendir.3 @@ -0,0 +1,204 @@ +.\" Copyright (C) 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 Sat Jul 24 18:46:01 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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 +.\" +.\"WORD: directory stream ¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à +.\"WORD: entry ¥¨¥ó¥È¥ê +.\"WORD: Permission denied ¥¢¥¯¥»¥¹¸¢¸Â¤¬¤Ê¤¤ +.\"WORD: file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\" +.TH OPENDIR 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O opendir, fdopendir \- open a directory +opendir, fdopendir \- ¥Ç¥£¥ì¥¯¥È¥ê¤ò¥ª¡¼¥×¥ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "DIR *opendir(const char *" name ); +.BI "DIR *fdopendir(int " fd ); +.fi +.\"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 ¤ËÂбþ¤¹¤ë +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤·¡¢¤½¤Î¥¹¥È¥ê¡¼¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¹¥È¥ê¡¼¥à¤Î°ÌÃ֤ϥǥ£¥ì¥¯¥È¥ê¤ÎÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤵ¤ì¤ë¡£ + +.\"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" +.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 +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O Permission denied. +¥¢¥¯¥»¥¹¸¢¸Â¤¬¤Ê¤¤¡£ +.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 +.B ENFILE +.\"O Too many files are currently open in the system. +¥·¥¹¥Æ¥à¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENOENT +.\"O Directory does not exist, or \fIname\fP is an empty string. +¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢¤Þ¤¿¤Ï \fIname\fP ¤¬¶õʸ»úÎó¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +.\"O Insufficient memory to complete the operation. +Ì¿Îá¤ò¼Â¹Ô¤¹¤ë¤Î¤Ë½¼Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O \fIname\fP is not a directory. +\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" +.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 +.SH Ãí°Õ +.\"O The underlying file descriptor of the directory stream can be obtained using +.\"O .BR dirfd (3). +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.BR dirfd (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" +.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) diff --git a/draft/man3/openpty.3 b/draft/man3/openpty.3 new file mode 100644 index 00000000..091ed0f0 --- /dev/null +++ b/draft/man3/openpty.3 @@ -0,0 +1,299 @@ +.\" Copyright (c) OpenBSD Group +.\" 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. 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. +.\" +.\" Converted into a manpage again by Martin Schulze +.\" +.\" Added -lutil remark, 030718 +.\" +.\" Japanese Version Copyright (c) 2002 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jan 22 21:42:05 JST 2002 +.\" by Yuichi SATO +.\" Updated Mon Mar 8 2003 by Akihiro MOTOKI +.\" Updated Sun Sep 14 2003 by Akihiro MOTOKI +.\" +.\"WORD: tty üËö +.\"WORD: pseudo-tty µ¿»÷üËö +.\" +.TH OPENPTY 3 2003-07-18 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O openpty, login_tty, forkpty \- tty utility functions +openpty, login_tty, forkpty \- üËö (tty) ¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int openpty(int *" amaster ", int *" aslave ", char *" name , +.BI " struct termios *" termp ", struct winsize *" winp ); +.sp +.BI "pid_t forkpty(int *" amaster ", char *" name ", struct termios *" termp , +.BI " struct winsize *" winp ); +.sp +.B #include +.sp +.BI "int login_tty(int " fd ); +.sp +.\"O Link with \fI\-lutil\fP. +\fI\-lutil\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR openpty () +.\"O function finds an available pseudo-terminal and returns file descriptors +.\"O for the master and slave in +.\"O .I amaster +.\"O and +.\"O .IR aslave . +.BR openpty () +´Ø¿ô¤Ï¡¢»ÈÍѲÄǽ¤Êµ¿»÷üËö (pseudo-terminal) ¤ò¸«¤Ä¤±¤Æ¡¢ +¥Þ¥¹¥¿¤È¥¹¥ì¡¼¥Ö¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +.I amaster +¤È +.I aslave +¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +.\"O If +.\"O .I name +.\"O is not NULL, the filename of the slave is returned in +.\"O .IR name . +.I name +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢¥¹¥ì¡¼¥Ö¤Î¥Õ¥¡¥¤¥ë̾¤¬ +.I name +¤ËÊÖ¤µ¤ì¤ë¡£ +.\"O If +.\"O .I termp +.\"O is not NULL, the terminal parameters of the slave will be set to the +.\"O values in +.\"O .IR termp . +.I termp +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢¥¹¥ì¡¼¥Ö¤ÎüËö¥Ñ¥é¥á¡¼¥¿¤Ï +.I termp +¤ÎÃͤËÀßÄꤵ¤ì¤ë¡£ +.\"O If +.\"O .I winp +.\"O is not NULL, the window size of the slave will be set to the values in +.\"O .IR winp . +.I winp +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢¥¹¥ì¡¼¥Ö¤Î¥¦¥¤¥ó¥É¥¦¥µ¥¤¥º¤Ï +.I winp +¤ËÀßÄꤵ¤ì¤ë¡£ + +.\"O The +.\"O .BR login_tty () +.\"O function prepares for a login on the tty +.\"O .I fd +.\"O (which may be a real tty device, or the slave of a pseudo-terminal as +.\"O returned by +.\"O .BR openpty ()) +.\"O by creating a new session, making +.\"O .I fd +.\"O the controlling terminal for the calling process, setting +.\"O .I fd +.\"O to be the standard input, output, and error streams of the current +.\"O process, and closing +.\"O .IR fd . +.BR login_tty () +´Ø¿ô¤Ï¡¢Ã¼Ëö +.I fd +¤Ë¥í¥°¥¤¥ó¤¹¤ë½àÈ÷¤ò¤¹¤ë +.RI ( fd +¤Ï¼ÂºÝ¤ÎüËö¥Ç¥Ð¥¤¥¹¤Ç¤â¡¢ +.BR openpty () +¤ÇÊÖ¤µ¤ì¤ëµ¿»÷üËö¤Î¥¹¥ì¡¼¥Ö¤Ç¤â¤è¤¤)¡£ +¶ñÂÎŪ¤Ë¤Ï¡¢¿·¤·¤¤¥»¥Ã¥·¥ç¥ó¤òºîÀ®¤·¡¢ +.I fd +¤ò¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤È¤·¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Îɸ½àÆþÎÏ¡¦É¸½à½ÐÎÏ¡¦É¸½à¥¨¥é¡¼¤Î¥¹¥È¥ê¡¼¥à¤ò +.I fd +¤ËÀßÄꤷ¤¿¸å¡¢ +.I fd +¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ + +.\"O The +.\"O .BR forkpty () +.\"O function combines +.\"O .BR openpty (), +.\"O .BR fork (2), +.\"O and +.\"O .BR login_tty () +.\"O to create a new process operating in a pseudo-terminal. +.BR forkpty () +´Ø¿ô¤Ï +.BR openpty (), +.BR fork (2), +.BR login_tty () +¤òÁȤ߹ç¤ï¤»¡¢µ¿»÷üËö¤òÁàºî¤¹¤ë¿·¤·¤¤¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¡£ +.\"O The file +.\"O descriptor of the master side of the pseudo-terminal is returned in +.\"O .IR amaster , +.\"O and the filename of the slave in +.\"O .I name +.\"O if it is not NULL. +µ¿»÷üËö¤Î¥Þ¥¹¥¿Â¦¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.I amaster +¤ËÊÖ¤µ¤ì¡¢ +.I name +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥¹¥ì¡¼¥Ö¤Î¥Õ¥¡¥¤¥ë̾¤¬ +.I name +¤ËÊÖ¤µ¤ì¤ë¡£ +.\"O The +.\"O .I termp +.\"O and +.\"O .I winp +.\"O arguments, if not NULL, +.\"O will determine the terminal attributes and window size of the slave +.\"O side of the pseudo-terminal. +.I termp +¤È +.I winp +°ú¤­¿ô¤Ï¡¢NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢ +µ¿»÷üËö¤Î¥¹¥ì¡¼¥Ö¦¤ÎüËö°À­¤È¥¦¥¤¥ó¥É¥¦¥µ¥¤¥º¤ò·èÄꤹ¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O If a call to +.\"O .BR openpty (), +.\"O .BR login_tty (), +.\"O or +.\"O .BR forkpty () +.\"O is not successful, \-1 is returned and +.\"O .I errno +.\"O is set to indicate the error. +.BR openpty (), +.BR login_tty (), +.BR forkpty () +¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ï¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£ +.\"O Otherwise, +.\"O .BR openpty (), +.\"O .BR login_tty (), +.\"O and the child process of +.\"O .BR forkpty () +.\"O return 0, and the parent process of +.\"O .BR forkpty () +.\"O returns the process ID of the child process. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR openpty (), +.BR login_tty () +¤ª¤è¤Ó +.BR forkpty () +¤Î»Ò¥×¥í¥»¥¹¤Ï 0 ¤òÊÖ¤·¡¢ +.BR forkpty () +¤Î¿Æ¥×¥í¥»¥¹¤Ï»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O .BR openpty () +.\"O will fail if: +°Ê²¼¤Î¾ì¹ç¤Ë +.BR openpty () +¤Ï¼ºÇÔ¤¹¤ë: +.TP +.B ENOENT +.\"O There are no available ttys. +»ÈÍѲÄǽ¤ÊüËö¤¬¤Ê¤¤¡£ +.LP +.\"O .BR login_tty () +.\"O will fail if +.\"O .BR ioctl (2) +.\"O fails to set +.\"O .I fd +.\"O to the controlling terminal of the calling process. +.BR ioctl (2) +¤¬ +.I fd +¤ò¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤ËÀßÄꤹ¤ë¤Î¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.BR login_tty () +¤Ï¼ºÇÔ¤¹¤ë¡£ +.LP +.\"O .BR forkpty () +.\"O will fail if either +.\"O .BR openpty () +.\"O or +.\"O .BR fork (2) +.\"O fails. +.BR openpty () +¤Þ¤¿¤Ï +.BR fork (2) +¤Î¤É¤Á¤é¤«¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.BR forkpty () +¤Ï¼ºÇÔ¤¹¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These are BSD functions, present in libc5 and glibc2. +¤³¤ì¤é¤Ï BSD ¤Î´Ø¿ô¤Ç¤¢¤ê¡¢libc5 ¤È glibc2 ¤Ë¸ºß¤¹¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O .\" These functions are included in libutil, hence you'll need to add +.\"O .\" .B \-lutil +.\"O .\" to your compiler command line. +.\" ¤³¤ì¤é¤Î´Ø¿ô¤Ï libutil ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢¥³¥ó¥Ñ¥¤¥ë»þ¤Î +.\" ¥ª¥×¥·¥ç¥ó¤Ë +.\" .B \-lutil +.\" ¤ò²Ã¤¨¤ëɬÍפ¬¤¢¤ë¡£ +.\" +.\"O In versions of glibc before 2.0.92, +.\"O .BR openpty () +.\"O returns file descriptors for a BSD pseudo-terminal pair; +.\"O since glibc 2.0.92, +.\"O it first attempts to open a Unix 98 pseudo-terminal pair, +.\"O and falls back to opening a BSD pseudo-terminal pair if that fails. +2.0.92 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢ +.BR openpty () +¤Ï BSD µ¿»÷üËö¥Ú¥¢¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +2.0.92 °Ê¹ß¤Î glibc ¤Ç¤Ï¡¢ +.BR openpty () +¤Ï¤Þ¤º Unix 98 µ¿»÷üËö¥Ú¥¢¤ò¥ª¡¼¥×¥ó¤·¤è¤¦¤È¤·¡¢¤½¤ì¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë +BSD µ¿»÷üËö¥Ú¥¢¤Î¥ª¡¼¥×¥ó¤Ø¤È°Ü¹Ô¤¹¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Nobody knows how much space should be reserved for +.\"O .IR name . +ï¤â +.I name +¤ËÂФ·¤Æ¤É¤Î¤¯¤é¤¤Â礭¤µ¤òͽÌ󤷤Ƥª¤±¤Ð¤¤¤¤¤«Ê¬¤«¤é¤Ê¤¤¡£ +.\"O So, calling +.\"O .BR openpty () +.\"O or +.\"O .BR forkpty () +.\"O with non-NULL +.\"O .I name +.\"O may not be secure. +¤·¤¿¤¬¤Ã¤Æ¡¢NULL ¤Ç¤Ê¤¤ +.I name +¤ò°ú¤­¿ô¤È¤·¤Æ +.BR openpty () +¤ä +.BR forkpty () +¤ò¸Æ¤Ó½Ð¤¹¤Î¤Ï°ÂÁ´¤Ç¤¢¤ë¤È¤Ï¸À¤¨¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fork (2), +.BR ttyname (3), +.BR pty (7) diff --git a/draft/man3/perror.3 b/draft/man3/perror.3 new file mode 100644 index 00000000..d0305903 --- /dev/null +++ b/draft/man3/perror.3 @@ -0,0 +1,230 @@ +.\" Copyright (c) 1994 Michael Haardt (michael@moria.de), 1994-06-04 +.\" Copyright (c) 1995 Michael Haardt +.\" (michael@cantor.informatik.rwth-aachen.de), 1995-03-16 +.\" Copyright (c) 1996 Andries Brouwer (aeb@cwi.nl), 1996-01-13 +.\" +.\" 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-01-13 aeb: merged in some text contributed by Melvin Smith +.\" (msmith@falcon.mercer.peachnet.edu) and various other changes. +.\" Modified 1996-05-16 by Martin Schulze (joey@infodrom.north.de) +.\" +.\" Japanese Version Copyright (c) 1998 TACHIBANA Akira +.\" all rights reserved. +.\" Translated 1998-05-28, TACHIBANA Akira +.\" Updated 2001-12-21, Kentaro Shirakata +.\" Updated 2005-03-15, Akihiro MOTOKI +.\" +.TH PERROR 3 2007-07-26 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O perror \- print a system error message +perror \- ¥·¥¹¥Æ¥à¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "void perror(const char " *s ); +.sp +.B #include +.sp +.BI "const char *" sys_errlist []; +.br +.BI "int " sys_nerr ; +.br +.BI "int " errno ; +.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 +.IR sys_errlist , +.IR sys_nerr : +_BSD_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The routine +.\"O .BR perror () +.\"O produces a message on the standard error output, describing the last +.\"O error encountered during a call to a system or library function. +´Ø¿ô +.BR perror () +¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤Ë¤ª¤¤¤Æ¡¢ºÇ¸å¤ËȯÀ¸¤·¤¿ +¥¨¥é¡¼¤Ë´Ø¤¹¤ëÀâÌÀ¥á¥Ã¥»¡¼¥¸¤òÀ¸À®¤·¡¢É¸½à¥¨¥é¡¼½ÐÎϤ˽ÐÎϤ¹¤ë¡£ +.\"O First (if +.\"O .I s +.\"O is not NULL and +.\"O .I *s +.\"O is not a null byte (\(aq\\0\(aq)) the argument string +.\"O .I s +.\"O is printed, followed by a colon and a blank. +.\"O Then the message and a new-line. +.RI ( s +¤¬ NULL ¤Ç¤Ê¤¯¡¢ +.I *s +¤¬ NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï) °ú¤­¿ô¤Îʸ»úÎó +.I s +¤¬¤Þ¤º½ÐÎϤµ¤ì¡¢Â³¤¤¤Æ¥³¥í¥ó¡¢¶õÇò¤¬½ÐÎϤµ¤ì¡¢ +¤½¤ì¤«¤é¥á¥Ã¥»¡¼¥¸¤È²þ¹Ô¤¬½ÐÎϤµ¤ì¤ë¡£ + +.\"O To be of most use, the argument string should include the name +.\"O of the function that incurred the error. +.\"O The error number is taken from +.\"O the external variable +.\"O .IR errno , +.\"O which is set when errors occur but not +.\"O cleared when successful calls are made. +¤³¤Î¥á¥Ã¥»¡¼¥¸¤òºÇÂç¸Â³èÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢°ú¤­¿ôʸ»úÎó¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿ +´Ø¿ô̾¤òÆþ¤ì¤Æ¤ª¤¯¤È¤è¤¤¡£ +¥¨¥é¡¼ÈÖ¹æ¤Ï³°ÉôÊÑ¿ô +.I errno +¤«¤é¼èÆÀ¤µ¤ì¤ë¡£ +.I errno +¤Ï¥¨¥é¡¼¤¬È¯À¸¤·¤¿»þ¤ËÀßÄꤵ¤ì¡¢ +À®¸ù¤·¤¿¸Æ¤Ó½Ð¤·¤Ç¤Ï¥¯¥ê¥¢¤µ¤ì¤Ê¤¤¡£ + +.\"O The global error list +.\"O .IR sys_errlist "[]" +.\"O indexed by +.\"O .I errno +.\"O can be used to obtain the error message without the newline. +.\"O The largest message number provided in the table is +.\"O .IR sys_nerr " \-1." +.\"O Be careful when directly accessing this list because new error values +.\"O may not have been added to +.\"O .IR sys_errlist "[]." +Âç°èÊÑ¿ô¤Î¥¨¥é¡¼¥ê¥¹¥È +.IR sys_errlist "[]" +¤Ï +.I errno +¤òź»ú¤È¤¹¤ëÇÛÎó¤Ç¡¢¤³¤ÎÇÛÎ󤫤é²þ¹Ô̵¤·¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬¼èÆÀ¤µ¤ì¤ë¡£ +¥Æ¡¼¥Ö¥ë¤Ç¤ÎºÇÂç¤Î¥á¥Ã¥»¡¼¥¸ÈÖ¹æ¤Ï +.IR sys_nerr " \-1" +¤È¤Ê¤ë¡£ +¤³¤Î¥Æ¡¼¥Ö¥ë¤òľÀÜ»²¾È¤¹¤ëºÝ¤Ë¤ÏÃí°Õ¤¹¤ë¤³¤È¡£¤Ê¤¼¤Ê¤é¡¢¿·¤·¤¤¥¨¥é¡¼Èֹ椬 +.IR sys_errlist "[]" +¤ËÄɲúѤȤϸ¤é¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ + +.\"O When a system call fails, it usually returns \-1 and sets the +.\"O variable +.\"O .I errno +.\"O to a value describing what went wrong. +.\"O (These values can be found in +.\"O .IR .) +.\"O Many library functions do likewise. +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢Ä̾ÊÖ¤êÃͤȤ·¤Æ \-1 ¤¬Ê֤ꡢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼±Ê̤¹¤ëÃͤ¬ÀßÄꤵ¤ì¤ë (ÀßÄꤵ¤ì¤ë¥¨¥é¡¼ÈÖ¹æ¤Ï +.I +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë)¡£ +¿¤¯¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤âƱÍͤÎÆ°ºî¤È¤Ê¤ë¡£ +.\"O The function +.\"O .BR perror () +.\"O serves to translate this error code into human-readable form. +.\"O Note that +.\"O .I errno +.\"O is undefined after a successful library call: +.\"O this call may well change this variable, even though it succeeds, +.\"O for example because it internally used some other library function that failed. +´Ø¿ô +.BR perror () +¤Ï¡¢¤³¤Î¥¨¥é¡¼¥³¡¼¥É¤Î²ÄÆɤʥá¥Ã¥»¡¼¥¸¤Ø¤ÎÊÑ´¹¤ò¹Ô¤¦¡£ +.I errno +¤Ï¡¢¥é¥¤¥Ö¥é¥ê¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿¸å¤Ë¤Ï̤ÄêµÁ¤Ç¤¢¤ë¤³¤È¤ËÃí°Õ¤¬É¬ÍפǤ¢¤ë: +¤½¤Î¸Æ¤Ó½Ð¤·¼«¿È¤ÏÀ®¸ù¤·¤¿¤È¤·¤Æ¤â¡¢ÆâÉô¤Ç¸Æ¤Ó½Ð¤·¤¿Â¾¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤¬ +¼ºÇÔ¤·¤Æ¡¢¤½¤Î·ë²Ì¤ò¤³¤ÎÊÑ¿ô¤ËÀßÄꤹ¤ë¤³¤È¤¬¤¢¤ë¤«¤é¤À¡£ +.\"O Thus, if a failing call is not immediately followed by a call to +.\"O .BR perror (), +.\"O the value of +.\"O .I errno +.\"O should be saved. +¤è¤Ã¤Æ¡¢¼ºÇÔ¤·¤¿¸Æ¤Ó½Ð¤·¤Îľ¸å¤Ë +.BR perror () +¤ò¸Æ¤Ð¤Ê¤¤¾ì¹ç¤Ë¤Ï +.I errno +¤ÎÃͤò +Êݸ¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The function +.\"O .BR perror () +.\"O and the external +.\"O .I errno +.\"O (see +.\"O .BR errno (3)) +.\"O conform to C89, C99, 4.3BSD, POSIX.1-2001. +.\"O The externals +.\"O .I sys_nerr +.\"O and +.\"O .I sys_errlist +.\"O conform to BSD. +´Ø¿ô +.BR perror () +¤È³°ÉôÊÑ¿ô +.I errno +.RB ( errno (3) +»²¾È) ¤Ï C89, 4.3BSD, POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +³°ÉôÊÑ¿ô +.I sys_nerr +¤È +.I sys_errlist +¤Ï BSD ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The externals +.\"O .I sys_nerr +.\"O and +.\"O .I sys_errlist +.\"O are defined by glibc, but in +.\"O .IR . +³°ÉôÊÑ¿ô +.I sys_nerr +¤È +.I sys_errlist +¤Ï glibc ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +.I +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.\"O .\" and only when _BSD_SOURCE is defined. +.\"O .\" When +.\"O .\" .B _GNU_SOURCE +.\"O .\" is defined, the symbols +.\"O .\" .I _sys_nerr +.\"O .\" and +.\"O .\" .I _sys_errlist +.\"O .\" are provided. +.\" .B _BSD_SOURCE +.\" ¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë¤Î¤ß¡¢¤³¤ì¤é¤ÎÊÑ¿ô¤ÏÄêµÁ¤µ¤ì¤ë¡£ +.\" .B _GNU_SOURCE +.\" ¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ï¡¢ +.\" .I _sys_nerr +.\" ¤È +.\" .I _sys_errlist +.\" ¤È¤¤¤¦¥·¥ó¥Ü¥ë¤¬Ä󶡤µ¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR err (3), +.BR errno (3), +.BR error (3), +.BR strerror (3) diff --git a/draft/man3/popen.3 b/draft/man3/popen.3 new file mode 100644 index 00000000..b1983cff --- /dev/null +++ b/draft/man3/popen.3 @@ -0,0 +1,340 @@ +.\" Copyright 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. +.\" +.\" @(#)popen.3 6.4 (Berkeley) 4/30/91 +.\" +.\" Converted for Linux, Mon Nov 29 14:45:38 1993, faith@cs.unc.edu +.\" Modified Sat May 18 20:37:44 1996 by Martin Schulze (joey@linux.de) +.\" Modified 7 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) +.\" +.\" Japanese Version Copyright (c) 1997 Takashi Yoshino +.\" all rights reserved. +.\" Translated 1997-01-21, Takashi Yoshino +.\" Modified 2007-05-03, Akihiro MOTOKI +.\" Modified 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" +.TH POPEN 3 2010-02-03 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O popen, pclose \- pipe stream to or from a process +.SH ̾Á° +popen, pclose \- ¥×¥í¥»¥¹¤È¤ÎÆþÎÏ/½ÐÎÏÍѤΥѥ¤¥×¡¦¥¹¥È¥ê¡¼¥à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "FILE *popen(const char *" command ", const char *" type ); +.sp +.BI "int pclose(FILE *" stream ); +.fi +.sp +.in -4n +.\"O Feature Test Macro Requirements for glibc (see +.\"O .BR feature_test_macros (7)): +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.ad l +.in +.sp +.BR popen (), +.BR pclose (): +_POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR popen () +.\"O function opens a process by creating a pipe, forking, and invoking the +.\"O shell. +.\"O Since a pipe is by definition unidirectional, the +.\"O .I type +.\"O argument may specify only reading or writing, not both; the resulting +.\"O stream is correspondingly read-only or write-only. +.BR popen () +´Ø¿ô¤Ï¡¢¥×¥í¥»¥¹¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£¶ñÂÎŪ¤Ë¤Ï¡¢ +¥Ñ¥¤¥×¤òÀ¸À®¤·¡¢¥Õ¥©¡¼¥¯¤ò¹Ô¤¤¡¢¥·¥§¥ë¤òµ¯Æ°¤¹¤ë¡£ +ÄêµÁ¤«¤éʬ¤«¤ë¤è¤¦¤Ë¡¢¥Ñ¥¤¥×¤Ï°ìÊý¸þ¤Ê¤Î¤Ç¡¢ +.I type +°ú¤­¿ô¤Ë¤ÏÆɤ߹þ¤ß¤«½ñ¤­¹þ¤ß¤Î¤É¤Á¤é¤«°ìÊý¤À¤±¤ò»ØÄê¤Ç¤­¤ë +(ξÊý¤Ï»ØÄê¤Ç¤­¤Ê¤¤)¡£ +À¸À®¤µ¤ì¤ë¥¹¥È¥ê¡¼¥à¤Ï¡¢¤³¤Î»ØÄê¤ËÂбþ¤·¤Æ¡¢Æɤ߼è¤êÀìÍѤޤ¿¤Ï +½ñ¤­¹þ¤ßÀìÍѤΤ¤¤º¤ì¤«¤È¤Ê¤ë¡£ +.PP +.\"O The +.\"O .I command +.\"O argument is a pointer to a null-terminated string containing a shell +.\"O command line. +.\"O This command is passed to +.\"O .I /bin/sh +.\"O using the +.\"O .B \-c +.\"O flag; interpretation, if any, is performed by the shell. +.\"O The +.\"O .I type +.\"O argument is a pointer to a null-terminated string which must contain +.\"O either the letter \(aqr\(aq for reading or the letter \(aqw\(aq for writing. +.I command +°ú¤­¿ô¤Ï¡¢¥·¥§¥ë¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤ò´Þ¤à +NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤³¤Î¥³¥Þ¥ó¥É¤Ï +.B \-c +¥Õ¥é¥°¤òÍѤ¤¤Æ +.I /bin/sh +¤ËÅϤµ¤ì¤ë¡£ +¥³¥Þ¥ó¥É¤Î²ò¼á¤Ï (¤â¤·É¬Íפʤé¤Ð) ¥·¥§¥ë¤Ë¤è¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +.I type +°ú¤­¿ô¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¡¢ +Æɤ߹þ¤ß¤ò¼¨¤¹Ê¸»ú \(aqr\(aq ¤«¡¢½ñ¤­¹þ¤ß¤ò¼¨¤¹Ê¸»ú \(aqw\(aq ¤Î +¤É¤Á¤é¤«°ìÊý¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O Since glibc 2.9, +.\"O this argument can additionally include the letter \(aqe\(aq, +.\"O which causes the close-on-exec flag +.\"O .RB ( FD_CLOEXEC ) +.\"O to be set on the underlying 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. +glibc 2.9 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î°ú¤­¿ô¤Ëʸ»ú \(aqe\(aq ¤òÄɲäǻØÄê¤Ç¤­¤ë¡£ +ʸ»ú \(aqe\(aq ¤ò»ØÄꤹ¤ë¤È¡¢ +Âбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤ª¤¤¤Æ¡¢ +close-on-exec ¥Õ¥é¥° +.RB ( FD_CLOEXEC ) +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +¤³¤ì¤¬Ìò¤ËΩ¤ÄÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR open (2) +¤Î +.B O_CLOEXEC +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The return value from +.\"O .BR popen () +.\"O is a normal standard I/O stream in all respects save that it must be closed +.\"O with +.\"O .BR pclose () +.\"O rather than +.\"O .BR fclose (3). +.BR popen () +¤«¤é¤ÎÊÖ¤êÃͤϡ¢Ä̾ï¤Îɸ½à I/O ¥¹¥È¥ê¡¼¥à¤ÈƱ¤¸¤Ç¤¢¤ë¤¬¡¢ +.BR fclose (3) +¤Ç¤Ï¤Ê¤¯ +.BR pclose () +¤ÇÊĤ¸¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¤³¤È¤À¤±¤¬°Û¤Ê¤ë¡£ +.\"O Writing to such a stream writes to the standard input of the command; the +.\"O command's standard output is the same as that of the process that called +.\"O .BR popen (), +.\"O unless this is altered by the command itself. +.\"O Conversely, reading from a +.\"O "popened" stream reads the command's standard output, and the command's +.\"O standard input is the same as that of the process that called +.\"O .BR popen (). +¤³¤Î¥¹¥È¥ê¡¼¥à¤Ø½ñ¤­¹þ¤ó¤À·ë²Ì¤Ï¥³¥Þ¥ó¥É¤Îɸ½àÆþÎϤ˽ñ¤­¹þ¤Þ¤ì¤ë¡£ +¤½¤·¤Æ¡¢¥³¥Þ¥ó¥É¤Îɸ½à½ÐÎϤϡ¢ +¥³¥Þ¥ó¥É¤½¤Î¤â¤Î¤¬ÃÖ¤­´¹¤ï¤Ã¤Æ¤·¤Þ¤ï¤Ê¤¤¸Â¤ê¡¢ +.BR popen () +¤ò¸Æ¤ó¤À¥×¥í¥»¥¹¤Îɸ½à½ÐÎϤÈƱ¤¸¤³¤È¤Ë¤Ê¤ë¡£ +µÕ¤Ë¡¢"popened" +.RB ( popen () +¤Ë¤è¤Ã¤Æ³«¤«¤ì¤¿) ¥¹¥È¥ê¡¼¥à¤«¤é¤ÎÆɤ߹þ¤ß¤Ï¡¢ +¤½¤Î¥³¥Þ¥ó¥É¤Îɸ½à½ÐÎϤòÆɤ߹þ¤à¤³¤È¤Ë¤Ê¤ë¡£ +¤½¤·¤Æ¡¢¤½¤Î¥³¥Þ¥ó¥É¤Îɸ½àÆþÎÏ¤Ï +.BR popen () +¤ò¸Æ¤ó¤À¥×¥í¥»¥¹¤Îɸ½àÆþÎϤÈƱ°ì¤Ç¤¢¤ë¡£ +.PP +.\"O Note that output +.\"O .BR popen () +.\"O streams are fully buffered by default. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR popen () +¤Î½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ï´°Á´¤Ë¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤ë¤³¤È¤ËÃí°Õ¤·¤è¤¦¡£ +.PP +.\"O The +.\"O .BR pclose () +.\"O function waits for the associated process to terminate and returns the exit +.\"O status of the command as returned by +.\"O .BR wait4 (2). +.BR pclose () +´Ø¿ô¤Ï¡¢(¥Ñ¥¤¥×¤Ë) ´ØÏ¢¤Å¤±¤é¤ì¤¿¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤Î¤òÂÔ¤Á¡¢ +.BR wait4 (2) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤¿¥³¥Þ¥ó¥É¤Î½ªÎ»¾õÂÖ¤òÊÖ¤¹¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR popen () +.\"O function returns NULL if the +.\"O .BR fork (2) +.\"O or +.\"O .BR pipe (2) +.\"O calls fail, or if it cannot allocate memory. +.BR popen () +´Ø¿ô¤Ï¡¢ +.BR fork (2) +¤Þ¤¿¤Ï +.BR pipe (2) +¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤ä¡¢ +¥á¥â¥ê³ä¤êÅö¤Æ¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ NULL ¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR pclose () +.\"O function returns \-1 if +.\"O .\" These conditions actually give undefined results, so I commented +.\"O .\" them out. +.\"O .\" .I stream +.\"O .\" is not associated with a "popen()ed" command, if +.\"O .\".I stream +.\"O .\" already "pclose()d", or if +.\"O .BR wait4 (2) +.\"O returns an error, or some other error is detected. +.BR pclose () +´Ø¿ô¤Ï¡¢ +.BR wait4 (2) +¤¬¥¨¥é¡¼¤òÊÖ¤·¤¿¤ê¡¢²¿¤«Â¾¤Î¥¨¥é¡¼¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¡¢ +\-1 ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O The +.\"O .BR popen () +.\"O function does not set +.\"O .I errno +.\"O if memory allocation fails. +.\"O If the underlying +.\"O .BR fork (2) +.\"O or +.\"O .BR pipe (2) +.\"O fails, +.\"O .I errno +.\"O is set appropriately. +.\"O If the +.\"O .I type +.\"O argument is invalid, and this condition is detected, +.\"O .I errno +.\"O is set to +.\"O .BR EINVAL . +.BR popen () +´Ø¿ô¤Ï¡¢¥á¥â¥ê¥¢¥í¥±¡¼¥·¥ç¥ó¤Ë¼ºÇÔ¤·¤Æ¤â +.I errno +¤ò¥»¥Ã¥È¤·¤Ê¤¤¡£ +.BR popen () +¤¬Ãæ¤Ç¸Æ¤Ó½Ð¤¹ +.BR fork (2) +¤ä +.BR pipe (2) +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +.I errno +¤¬Å¬Àڤ˥»¥Ã¥È¤µ¤ì¤ë¡£ +°ú¤­¿ô +.I type +¤¬Ìµ¸ú¤Ç¤¢¤ê¡¢¤³¤Î¾õÂÖ¤¬¸¡ÃΤµ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +.I errno +¤¬ +.B EINVAL +¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.\"O If +.\"O .BR pclose () +.\"O cannot obtain the child status, +.\"O .I errno +.\"O is set to +.\"O .BR ECHILD . +.BR pclose () +¤¬¡¢»Ò¥×¥í¥»¥¹¤Î¾õÂÖ¤ò¼èÆÀ¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.I errno +¤¬ +.B ECHILD +¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. + +.\"O The \(aqe\(aq value for +.\"O .I type +.\"O is a Linux extension. +.I type +¤Ë»ØÄê¤Ç¤­¤ë \(aqe\(aq ¤Ï Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Since the standard input of a command opened for reading shares its seek +.\"O offset with the process that called +.\"O .BR popen (), +.\"O if the original process has done a buffered read, the command's input +.\"O position may not be as expected. +.\"O Similarly, the output from a command +.\"O opened for writing may become intermingled with that of the original +.\"O process. +.\"O The latter can be avoided by calling +.\"O .BR fflush (3) +.\"O before +.\"O .BR popen (). +Æɤ߹þ¤ß¤Î¤¿¤á¤Ë³«¤«¤ì¤¿¥³¥Þ¥ó¥É¤Îɸ½àÆþÎÏ¤Ï +.BR popen (), +¤ò¸Æ¤ó¤À¥×¥í¥»¥¹¤È°ì½ï¤Ë¡¢¤½¤ÎÆɤ߼è¤ê°ÌÃÖ¤ò¶¦Í­¤¹¤ë¡£ +¤½¤Î¤¿¤á¡¢¤â¤È¤Î¥×¥í¥»¥¹¤¬¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤¿Æɤ߼è¤ê¤ò½ªÎ»¤·¤¿¤é¡¢ +¤½¤Î¥³¥Þ¥ó¥É¤ÎÆþÎÏ°ÌÃÖ¤ÏͽÁÛ¤µ¤ì¤¿¤â¤Î¤Ë¤Ï +¤Ê¤Ã¤Æ¤¤¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +ƱÍͤˡ¢½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë³«¤«¤ì¤¿¥³¥Þ¥ó¥É¤«¤é¤Î½ÐÎϤϡ¢ +¤â¤È¤Î¥×¥í¥»¥¹¤Î½ÐÎϤȺ®¤¶¤ê¹ç¤¦¤³¤È¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¸å¼Ô¤Ï +.BR popen () +¤ÎÁ°¤Ë +.BR fflush (3) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤Æ²óÈò²Äǽ¤Ç¤¢¤ë¡£ +.PP +.\"O Failure to execute the shell is indistinguishable from the shell's failure +.\"O to execute command, or an immediate exit of the command. +.\"O The only hint is an exit status of 127. +¥·¥§¥ë¤Î¼Â¹Ô¤Î¼ºÇԤϡ¢ +¥·¥§¥ë¤¬¥³¥Þ¥ó¥É¤Î¼Â¹Ô¤Ë¼ºÇÔ¤·¤¿¤³¤È¤ä¡¢ +¥³¥Þ¥ó¥É¤¬¤¹¤°¤Ë½ªÎ»¤·¤Æ¤·¤Þ¤Ã¤¿¤³¤È¤È¡¢¶èÊ̤¬¤Ä¤«¤Ê¤¤¡£ +Í£°ì¤Î¥Ò¥ó¥È¤Ï½ªÎ»¾õÂÖ¤¬ 127 ¤Ë¤Ê¤ë¤³¤È¤Ç¤¢¤ë¡£ +.\"O .\" .SH HISTORY +.\" .SH ÍúÎò +.\"O .\" A +.\"O .\" .BR popen () +.\"O .\" and a +.\"O .\" .BR pclose () +.\"O .\" function appeared in Version 7 AT&T UNIX. +.\" .BR popen () +.\" ´Ø¿ô¤È +.\" .BR pclose () +.\" ´Ø¿ô¤Ï AT&T UNIX ¤Î Version 7 ¤«¤éƳÆþ¤µ¤ì¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sh (1), +.BR fork (2), +.BR pipe (2), +.BR wait4 (2), +.BR fclose (3), +.BR fflush (3), +.BR fopen (3), +.BR stdio (3), +.BR system (3) diff --git a/draft/man3/posix_fallocate.3 b/draft/man3/posix_fallocate.3 new file mode 100644 index 00000000..d9aebfde --- /dev/null +++ b/draft/man3/posix_fallocate.3 @@ -0,0 +1,190 @@ +.\" 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-07-13, Yuichi SATO . LDP v2.29 +.\" Updated 2010-04-11, Akihiro MOTOKI , LDP v3.24 +.\" +.TH POSIX_FALLOCATE 3 2009-09-30 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O posix_fallocate \- allocate file space +posix_fallocate \- ¥Õ¥¡¥¤¥ë¤Î¥¹¥Ú¡¼¥¹¤ò³ÎÊݤ¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE 600 +.B #include +.sp +.BI "int posix_fallocate(int " fd ", off_t " offset ", off_t " len ); +.fi +.\"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 () +¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿¸å¡¢»ØÄꤵ¤ì¤¿ÈϰϤΥХ¤¥È¤ËÂФ¹¤ë½ñ¤­¹þ¤ß¤Ï¡¢ +¥Ç¥£¥¹¥¯¥¹¥Ú¡¼¥¹¤ÎÉÔ­¤Ç¼ºÇÔ¤·¤Ê¤¤¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ + +.\"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 +¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤Ï¤³¤Î¥µ¥¤¥º¤Ë¤Ê¤ë¤è¤¦¤Ë³ÈÂ礵¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ÏÊѤï¤é¤Ê¤¤¡£ +.\"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 +¤¬ÀßÄꤵ¤ì¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.\"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 of file descriptor. +.I fd +¤¬¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR posix_fallocate () +.\"O is available since glibc 2.1.94. +.BR posix_fallocate () +¤Ï glibc 2.1.94 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +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" +.SH ´ØÏ¢¹àÌÜ +.BR fallocate (2), +.BR lseek (2), +.BR posix_fadvise (2), +.BR feature_test_macros (7) diff --git a/draft/man3/posix_memalign.3 b/draft/man3/posix_memalign.3 new file mode 100644 index 00000000..3814782d --- /dev/null +++ b/draft/man3/posix_memalign.3 @@ -0,0 +1,388 @@ +.\" 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 2009-03-30 "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 (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.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 (). +.I size +¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR posix_memalign () +¤Ï NULL ¤«°ì°Õ¤Ê¥Ý¥¤¥ó¥¿ÃͤòÊÖ¤¹¡£ +¤³¤Î¥Ý¥¤¥ó¥¿Ãͤϡ¢¸å¤Ç +.BR free () +¤ËÌäÂê¤Ê¤¯ÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"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/posix_openpt.3 b/draft/man3/posix_openpt.3 new file mode 100644 index 00000000..a494906e --- /dev/null +++ b/draft/man3/posix_openpt.3 @@ -0,0 +1,148 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2004 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) 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Jan 30 08:55:16 JST 2005 +.\" by Yuichi SATO +.\" +.TH POSIX_OPENPT 3 2007-07-26 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O posix_openpt \- open a pseudo-terminal device +posix_openpt \- µ¿»÷üËö (pseudo-terminal) ¥Ç¥Ð¥¤¥¹¤ò¥ª¡¼¥×¥ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "int posix_openpt(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 +.ad l +.BR posix_openpt (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR posix_openpt () +.\"O function opens an unused pseudo-terminal master device, returning a +.\"O file descriptor that can be used to refer to that device. +.BR posix_openpt () +´Ø¿ô¤Ï»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤µ¿»÷üËö¥Þ¥¹¥¿¥Ç¥Ð¥¤¥¹¤ò¥ª¡¼¥×¥ó¤·¡¢ +¤½¤Î¥Ç¥Ð¥¤¥¹¤ò»²¾È¤¹¤ë¤¿¤á¤Ë»È¤¦¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.\"O The +.\"O .I flags +.\"O argument is a bit mask that ORs together zero or more of +.\"O the following flags: +.I flags +°ú¤­¿ô¤Ï¡¢°Ê²¼¤Î¥Õ¥é¥°¤Î¤¦¤Á 0 ¸Ä°Ê¾å¤Î OR ¤ò¤È¤Ã¤¿¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +.TP +.B O_RDWR +.\"O Open the device for both reading and writing. +.\"O It is usual to specify this flag. +Æɤ߽ñ¤­¤Î¤¿¤á¤Ë¥Ç¥Ð¥¤¥¹¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +ÉáÄ̤Ϥ³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¡£ +.TP +.B O_NOCTTY +.\"O Do not make this device the controlling terminal for the process. +¤³¤Î¥Ç¥Ð¥¤¥¹¤ò¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤È¤·¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR posix_openpt () +.\"O returns a nonnegative file descriptor which is the lowest +.\"O numbered unused descriptor. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR posix_openpt () +¤ÏÉé¤Ç¤Ï¤Ê¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¤³¤ì¤Ï»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¦¤ÁºÇ¾®¤ÎÃͤǤ¢¤ë¡£ +.\"O On failure, \-1 is returned, and +.\"O .I errno +.\"O is set to indicate the error. +¼ºÇÔ¤·¤¿¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢¥¨¥é¡¼¤ò¼¨¤¹¤¿¤á¤Ë +.I errno +¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O See +.\"O .BR open (2). +.BR open (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O Glibc support for +.\"O .BR posix_openpt () +.\"O has been provided since version 2.2.1. +.BR posix_openpt () +¤Î glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.2.1 °Ê¹ß¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR posix_openpt () +.\"O is part of the Unix98 pseudo-terminal support (see +.\"O .BR pts (4)). +.\"O This function is specified in POSIX.1-2001. +.BR posix_openpt () +¤Ï Unix98 µ¿»÷üËö¥µ¥Ý¡¼¥È +.RB ( pts (4) +¤ò»²¾È) ¤Î°ìÉô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O This function is a recent invention in POSIX. +.\"O Some Unix implementations that support System V +.\"O (aka Unix 98) pseudo-terminals don't have this function, but it +.\"O is easy to implement: +¤³¤Î´Ø¿ô¤Ï POSIX ¤Ë¤ª¤¤¤ÆºÇ¶áºî¤é¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ +System V (ÊÌ̾ Unix 98) µ¿»÷üËö¤ò¥µ¥Ý¡¼¥È¤¹¤ë Unix ¼ÂÁõ¤ÎÃæ¤Ë¤Ï¡¢ +¤³¤Î´Ø¿ô¤ò»ý¤¿¤Ê¤¤¤â¤Î¤â¤¢¤ë¤¬¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ´Êñ¤Ë¼ÂÁõ¤Ç¤­¤ë: +.in +4n +.nf + +int +posix_openpt(int flags) +{ + return open("/dev/ptmx", flags); +} +.fi +.in +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR open (2), +.BR getpt (3), +.BR grantpt (3), +.BR ptsname (3), +.BR unlockpt (3), +.BR pts (4), +.BR pty (7) diff --git a/draft/man3/pow.3 b/draft/man3/pow.3 new file mode 100644 index 00000000..b2aded60 --- /dev/null +++ b/draft/man3/pow.3 @@ -0,0 +1,552 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 +.\" +.TH POW 3 2008-08-10 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O pow, powf, powl \- power functions +pow, powf, powl \- Îß¾è´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double pow(double " x ", double " y ); +.br +.BI "float powf(float " x ", float " y ); +.br +.BI "long double powl(long double " x ", long double " y ); +.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) +»²¾È): +.in +.sp +.ad l +.BR powf (), +.BR powl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 +.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 +¾è¤ÎÃͤòÊÖ¤¹¡£ + +.\"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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +¤òÊÖ¤¹¡£ÊÖ¤êÃͤˤϿô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£ + +.\"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. + +.\"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 ¤È¤Ê¤ë¡£ + +.\"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 ¤È¤Ê¤ë¡£ + +.\"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 ¤È¤Ê¤ë¡£ + +.\"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) ¤È¤Ê¤ë¡£ + +.\"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 ¤È¤Ê¤ë¡£ + +.\"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 ¤È¤Ê¤ë¡£ + +.\"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 +¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£ + +.\"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 ¤È¤Ê¤ë¡£ + +.\"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 ¤È¤Ê¤ë¡£ + +.\"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 +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£ + +.\"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 ¤È¤Ê¤ë¡£ + +.\"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 ¤È¤Ê¤ë¡£ + +.\"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 ¤è¤êÂ礭¤¤´ñ¿ô¤Î¾ì¹ç¡¢ÊÖ¤êÃͤÏÉé¤Î̵¸ÂÂç¤È¤Ê¤ë¡£ + +.\"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 ¤è¤êÂ礭¤¯´ñ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£ + +.\"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 ¤È¤Ê¤ë¡£ + +.\"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 ¤è¤êÂ礭¤¤¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£ + +.\"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 +¤ÈƱ¤¸Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£ + +.\"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 +.SH ¥¨¥é¡¼ +.\" FIXME . review status of this error +.\" longstanding bug report for glibc: +.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=369 +.\" For negative x, and -large and +large y, glibc 2.8 gives incorrect +.\" results +.\" pow(-0.5,-DBL_MAX)=nan +.\" EDOM FE_INVALID nan; fail-errno fail-except fail-result; +.\" FAIL (expected: range-error-overflow (ERANGE, FE_OVERFLOW); +INF) +.\" +.\" pow(-1.5,-DBL_MAX)=nan +.\" EDOM FE_INVALID nan; fail-errno fail-except fail-result; +.\" FAIL (expected: range-error-underflow (ERANGE, FE_UNDERFLOW); +0) +.\" +.\" pow(-0.5,DBL_MAX)=nan +.\" EDOM FE_INVALID nan; fail-errno fail-except fail-result; +.\" FAIL (expected: range-error-underflow (ERANGE, FE_UNDERFLOW); +0) +.\" +.\" 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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is negative, and \fIy\fP is a finite noninteger +Îΰ襨¥é¡¼: \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 +¶Ë¥¨¥é¡¼: \fIx\fP ¤¬¥¼¥í¤Ç¡¢\fIy\fP ¤¬Éé +.\"O .I errno +.\"O is set to +.\"O .BR ERANGE +.\"O (but see BUGS). +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +.\" FIXME . glibc 2.8 gives EDOM +.\"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 +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.\"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 +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.\"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" +.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 +.SH ¥Ð¥° +.\"O For a pole error, +¶Ë¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.\" +.\" FIXME . this is as at glibc 2.8; check later if this bug is fixed +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776 +.\"O .I errno +.\"O is set to +.\"O .BR EDOM ; +.\"O POSIX.1 says it should be set to +.\"O .BR ERANGE . +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +POSIX.1 ¤Îµ¬Äê¤Ç¤Ï¡¢ +.B ERANGE +¤òÀßÄꤹ¤Ù¤­¤È¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"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 + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR cpow (3), +.BR sqrt (3) diff --git a/draft/man3/pow10.3 b/draft/man3/pow10.3 new file mode 100644 index 00000000..55aee747 --- /dev/null +++ b/draft/man3/pow10.3 @@ -0,0 +1,75 @@ +.\" Copyright 2004 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. +.\" +.\" 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 +.SH ̾Á° +.\"O pow10, pow10f, pow10l \- base-10 power functions +pow10, pow10f, pow10l \- Ä줬 10 ¤ÎÎß¾è´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "double pow10(double " x ); +.br +.BI "float pow10f(float " x ); +.br +.BI "long double pow10l(long double " x ); +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR exp10 (3), +.BR pow (3), +.BR feature_test_macros (7) diff --git a/draft/man3/printf.3 b/draft/man3/printf.3 new file mode 100644 index 00000000..14f6ea29 --- /dev/null +++ b/draft/man3/printf.3 @@ -0,0 +1,1848 @@ +.\" Copyright (c) 1999 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. +.\" +.\" +.\" Earlier versions of this page influenced the present text. +.\" It was derived from a Berkeley page with version +.\" @(#)printf.3 6.14 (Berkeley) 7/30/91 +.\" converted for Linux by faith@cs.unc.edu, updated by +.\" Helmut.Geyer@iwr.uni-heidelberg.de, agulbra@troll.no and Bruno Haible. +.\" +.\" 1999-11-25 aeb - Rewritten, using SUSv2 and C99. +.\" 2000-07-26 jsm28@hermes.cam.ac.uk - three small fixes +.\" 2000-10-16 jsm28@hermes.cam.ac.uk - more fixes +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi all rights reserved. +.\" Translated 1998-02-17, YOSHINO Takashi +.\" Updated 2000-10-02, Kentaro Shirakata +.\" Updated 2001-01-29, Kentaro Shirakata +.\" Updated 2002-01-03, Kentaro Shirakata +.\" Updated 2002-10-17, Kentaro Shirakata +.\" Updated 2005-03-15, Akihiro MOTOKI +.\" Updated 2006-07-20, Akihiro MOTOKI +.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 +.\" Updated 2009-03-03, Akihiro MOTOKI , LDP v3.19 +.\" +.\" WORD: conversion specifier ÊÑ´¹»ØÄê»Ò +.\" WORD: length modifier Ťµ½¤¾þ»Ò +.\" +.TH PRINTF 3 2008-12-19 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, +.\"O vsnprintf \- formatted output conversion +printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, +vsnprintf \- »ØÄꤵ¤ì¤¿½ñ¼°¤ËÊÑ´¹¤·¤Æ½ÐÎϤò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int printf(const char *" format ", ...);" +.br +.BI "int fprintf(FILE *" stream ", const char *" format ", ...);" +.br +.BI "int sprintf(char *" str ", const char *" format ", ...);" +.br +.BI "int snprintf(char *" str ", size_t " size ", const char *" format ", ...);" +.sp +.B #include +.sp +.BI "int vprintf(const char *" format ", va_list " ap ); +.br +.BI "int vfprintf(FILE *" stream ", const char *" format ", va_list " ap ); +.br +.BI "int vsprintf(char *" str ", const char *" format ", va_list " ap ); +.br +.BI "int vsnprintf(char *" str ", size_t " size ", const char *" format \ +", va_list " ap ); +.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 snprintf (), +.BR vsnprintf (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I "cc -std=c99" +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The functions in the +.\"O .BR printf () +.\"O family produce output according to a +.\"O .I format +.\"O as described below. +.BR printf () +´Ø¿ô¥°¥ë¡¼¥×¤Ï¡¢°Ê²¼¤Ç½Ò¤Ù¤ë¤è¤¦¤Ë¡¢ +.I format +¤Ë½¾¤Ã¤Æ½ÐÎϤòÀ¸À®¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.\"O The functions +.\"O .BR printf () +.\"O and +.\"O .BR vprintf () +.\"O write output to +.\"O .IR stdout , +.\"O the standard output stream; +.\"O .BR fprintf () +.\"O and +.\"O .BR vfprintf () +.\"O write output to the given output +.\"O .IR stream ; +.\"O .BR sprintf (), +.\"O .BR snprintf (), +.\"O .BR vsprintf () +.\"O and +.\"O .BR vsnprintf () +.\"O write to the character string +.\"O .IR str . +.BR printf () +¤È +.BR vprintf () +¤Ï½ÐÎϤò +.I stdout +(ɸ½à½ÐÎÏ¥¹¥È¥ê¡¼¥à) ¤Ë½ñ¤­½Ð¤¹¡£ +.BR fprintf () +¤È +.BR vfprintf () +¤Ï½ÐÎϤò»ØÄꤵ¤ì¤¿½ÐÎÏ +.I stream +¤Ë½ñ¤­½Ð¤¹¡£ +.BR sprintf (), +.BR snprintf (), +.BR vsprintf (), +.BR vsnprintf () +¤Ï½ÐÎϤòʸ»úÎó +.IR str +¤Ë½ñ¤­¹þ¤à¡£ +.PP +.\"O The functions +.\"O .BR snprintf () +.\"O and +.\"O .BR vsnprintf () +.\"O write at most +.\"O .I size +.\"O bytes (including the trailing null byte (\(aq\e0\(aq)) to +.\"O .IR str . +.BR snprintf () +¤È +.BR vsnprintf () +¤ÏºÇÂç¤Ç +.I size +¥Ð¥¤¥È¤ò +.I str +¤Ë½ñ¤­¹þ¤à +.RI ( size +¤Ë¤Ïʸ»úÎó¤ò½ªÃ¼¤¹¤ë \(aq\e0\(aq ¤â¤ò´Þ¤Þ¤ì¤ë)¡£ +.PP +.\"O The functions +.\"O .BR vprintf (), +.\"O .BR vfprintf (), +.\"O .BR vsprintf (), +.\"O .BR vsnprintf () +.\"O are equivalent to the functions +.\"O .BR printf (), +.\"O .BR fprintf (), +.\"O .BR sprintf (), +.\"O .BR snprintf (), +.\"O respectively, except that they are called with a +.\"O .I va_list +.\"O instead of a variable number of arguments. +.\"O These functions do not call the +.\"O .I va_end +.\"O macro. +.\"O Because they invoke the +.\"O .I va_arg +.\"O macro, the value of +.\"O .I ap +.\"O is undefined after the call. +.\"O See +.\"O .BR stdarg (3). +.BR vprintf (), +.BR vfprintf (), +.BR vsprintf (), +.BR vsnprintf () +¤Î³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.BR printf (), +.BR fprintf (), +.BR sprintf (), +.BR snprintf (), +¤Î³Æ´Ø¿ô¤ÈÅù²Á¤Ç¤¢¤ê¡¢²ÄÊÑ¿ô°ú¤­¿ô¤ÎÂå¤ï¤ê¤Ë +.I va_list +¤ò°ú¤­¿ô¤È¤·¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ç¤Ï +.I va_end +¥Þ¥¯¥í¤Ï¸Æ¤Ó½Ð¤µ¤ì¤Ê¤¤¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I va_arg +¤ò¸Æ¤Ó½Ð¤¹¤Î¤Ç¡¢¸Æ¤Ó½Ð¤·¸å¤Î +.I ap +¤ÎÃͤÏ̤ÄêµÁ¤Ç¤¢¤ë¡£ +.BR stdarg (3) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O These eight functions write the output under the control of a +.\"O .I format +.\"O string that specifies how subsequent arguments (or arguments accessed via +.\"O the variable-length argument facilities of +.\"O .BR stdarg (3)) +.\"O are converted for output. +¤³¤ì¤é¤Î 8 ¤Ä¤Î´Ø¿ô¤Ï +.I format +ʸ»úÎó¤ÎÀ©¸æ¤Ë½¾¤Ã¤Æ½ÐÎϤò½ñ¤­½Ð¤¹¡£ +.I format +ʸ»úÎó¤Ï¡¢¤³¤ì¤Ë³¤¯°ú¤­¿ô (¤Þ¤¿¤Ï +.BR stdarg (3) +¤Î²ÄÊÑĹ°ú¤­¿ôµ¡¹½¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤Ç¤­¤ë°ú¤­¿ô) +¤ò¤É¤Î¤è¤¦¤ËÊÑ´¹¤·¤Æ½ÐÎϤ¹¤ë¤«¤ò»ØÄꤹ¤ë¡£ + +.\"O C99 and POSIX.1-2001 specify that the results are undefined if a call to +.\"O .BR sprintf (), +.\"O .BR snprintf (), +.\"O .BR vsprintf (), +.\"O or +.\"O .BR vsnprintf () +.\"O would cause copying to take place between objects that overlap +.\"O (e.g., if the target string array and one of the supplied input arguments +.\"O refer to the same buffer). +.\"O See NOTES. +C99 ¤È POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR sprintf (), +.BR snprintf (), +.BR vsprintf (), +.BR vsnprintf () +¤Î¸Æ¤Ó½Ð¤·¤Ç¡¢ÈϰϤ¬½ÅÊ£¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È´Ö¤Ç¥³¥Ô¡¼¤¬È¯À¸¤¹¤ë¾ì¹ç¤Î +·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë (Î㤨¤Ð¡¢½ÐÎÏÀè¤Îʸ»úÎó¤ÈÆþÎϤµ¤ì¤¿ +°ú¤­¿ô¤Î°ì¤Ä¤¬Æ±¤¸¥Ð¥Ã¥Õ¥¡¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤Ê¤É¤Ç¤¢¤ë)¡£ +¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¡£ +.\"O .SS "Return value" +.SS ÊÖ¤êÃÍ +.\"O Upon successful return, these functions return the number of characters +.\"O printed (not including the +.\"O trailing \(aq\e0\(aq used to end output to strings). +À®¸ù»þ¤Ë¤Ï¡¢¾åµ­¤Î´Ø¿ô¤Ï½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¿ô¤òÊÖ¤¹ +(ʸ»úÎó¤ÎºÇ¸å¤ò¼¨¤¹¤¿¤á¤Ë»ÈÍѤ¹¤ë \(aq\e0\(aq ¤Ï¿ô¤Ë´Þ¤Þ¤ì¤Ê¤¤)¡£ + +.\"O The functions +.\"O .BR snprintf () +.\"O and +.\"O .BR vsnprintf () +.\"O do not write more than +.\"O .I size +.\"O bytes (including the trailing \(aq\e0\(aq). +.\"O If the output was truncated due to this limit then the return value +.\"O is the number of characters (not including the trailing \(aq\e0\(aq) +.\"O which would have been written to the final string if enough space +.\"O had been available. +.\"O Thus, a return value of +.\"O .I size +.\"O or more means that the output was truncated. +.\"O (See also below under NOTES.) +.BR snprintf () +¤È +.BR vsnprintf () +¤Ï¡¢ +.I size +¥Ð¥¤¥È¤ò±Û¤¨¤ëʸ»ú¿ô¤ò½ñ¤­¹þ¤Þ¤Ê¤¤ +.RI ( size +¤Ë¤Ïʸ»úÎó¤ò½ªÃ¼¤¹¤ë \(aq\e0\(aq ¤â¤ò´Þ¤Þ¤ì¤ë)¡£ +¤³¤ÎÀ©¸Â¤Ë¤è¤Ã¤Æ½ÐÎϤ¬ÀÚ¤êµÍ¤á¤é¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +¤â¤·½½Ê¬¤Ê¥¹¥Ú¡¼¥¹¤¬¤¢¤ì¤Ð½ñ¤­¹þ¤Þ¤ì¤¿¤Ç¤¢¤í¤¦Ê¸»ú¤Î¸Ä¿ô +(ʸ»úÎó¤ò½ªÃ¼¤¹¤ë \(aq\e0\(aq ¤ò½ü¤¯) ¤òÊÖ¤¹¡£ +½¾¤Ã¤Æ¡¢ÊÖ¤êÃͤ¬ +.I size +°Ê¾å¤À¤Ã¤¿¾ì¹ç¡¢½ÐÎϤ¬ÀÚ¤êµÍ¤á¤é¤ì¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë +(¸å½Ò¤ÎÃí°Õ¤â»²¾È¤Î¤³¤È)¡£ + +.\"O If an output error is encountered, a negative value is returned. +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï¡¢Éé¤Î¿ô¤òÊÖ¤¹¡£ +.\"O .SS "Format of the format string" +.SS ¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.\"O The format string is a character string, beginning and ending +.\"O in its initial shift state, if any. +¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Ïʸ»ú¤ÎÎó¤Ç¡¢ +(¤â¤·¤¢¤ë¤Ê¤é) ½é´ü¥·¥Õ¥È¾õÂ֤ǻϤޤꡢ½é´ü¥·¥Õ¥È¾õÂ֤ǽª¤ï¤ë¡£ +.\"O The format string is composed of zero or more directives: ordinary +.\"O characters (not +.\"O .BR % ), +.\"O which are copied unchanged to the output stream; +.\"O and conversion specifications, each of which results in fetching zero or +.\"O more subsequent arguments. +¥Õ¥©¡¼¥Þ¥Ã¥ÈÍѤÎʸ»úÎó¤Ï 0 ¸Ä°Ê¾å¤ÎÌ¿Îá (directives) ¤Ë¤è¤Ã¤Æ¹½À®¤µ¤ì¤ë¡£ +Ì¿Îá¤Ë¤Ï¡¢Ä̾ïʸ»ú¤ÈÊÑ´¹»ØÄê (conversion specifications) ¤¬¤¢¤ë¡£ +Ä̾ïʸ»ú¤Ï +.B % +°Ê³°¤Îʸ»ú¤Ç¡¢½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ë¤½¤Î¤Þ¤Þ¥³¥Ô¡¼¤µ¤ì¤ë¡£ +ÊÑ´¹»ØÄê¤Ï¡¢¤½¤ì¤¾¤ì¤¬ 0 ¸Ä°Ê¾å¤Î°ú¤­¿ô¤ò¼è¤ë¡£ +.\"O Each conversion specification is introduced by +.\"O the character +.\"O .BR % , +.\"O and ends with a +.\"O .IR "conversion specifier" . +³ÆÊÑ´¹»ØÄê¤Ïʸ»ú +.B % +¤Ç»Ï¤Þ¤ê¡¢ +.I "ÊÑ´¹»ØÄê»Ò (conversion specifier)" +¤Ç½ª¤ï¤ë¡£ +.\"O In between there may be (in this order) zero or more +.\"O .IR flags , +.\"O an optional minimum +.\"O .IR "field width" , +.\"O an optional +.\"O .I precision +.\"O and an optional +.\"O .IR "length modifier" . +.B % +¤ÈÊÑ´¹»ØÄê»Ò¤Î´Ö¤Ë¤Ï¡¢0 ¸Ä°Ê¾å¤Î +.I ¥Õ¥é¥° ¡¢ +ºÇ¾® +.I ¥Õ¥£¡¼¥ë¥ÉÉý ¡¢ +.I ÀºÅÙ ¡¢ +.I Ťµ½¤¾þ»Ò +¤ò (¤³¤Î½ç½ø¤Ç) ÃÖ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O The arguments must correspond properly (after type promotion) with the +.\"O conversion specifier. +.\"O By default, the arguments are used in the order +.\"O given, where each \(aq*\(aq and each conversion specifier asks for the next +.\"O argument (and it is an error if insufficiently many arguments are given). +°ú¤­¿ô¤Ï (·¿¤Î³Ê¾å¤²¤Î¸å¤Ï) ÊÑ´¹»ØÄê»Ò¤¬É½¤¹·¿¤ÈÀµ³Î¤ËÂбþ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢\(aq*\(aq ¤äÊÑ´¹»ØÄê»Ò¤¬½Ð¤Æ¤¯¤ëËè¤Ë¼¡¤Î°ú¤­¿ô¤òÍ׵ᤵ¤ì¡¢ +°ú¤­¿ô¤Ï»ØÄꤵ¤ì¤¿½ç½ø¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤¯ +(»ØÄꤵ¤ì¤¿°ú¤­¿ô¤Î¸Ä¿ô¤¬ÉÔ½½Ê¬¤Ê¤é¥¨¥é¡¼¤È¤Ê¤ë)¡£ +.\"O One can also specify explicitly which argument is taken, +.\"O at each place where an argument is required, by writing "%m$" instead +.\"O of \(aq%\(aq and "*m$" instead of \(aq*\(aq, +.\"O where the decimal integer m denotes +.\"O the position in the argument list of the desired argument, indexed starting +.\"O from 1. +.\"O Thus, +.\"O .in +4n +.\"O .nf +.\"O +.\"O printf("%*d", width, num); +.\"O +.\"O .fi +.\"O .in +.\"O and +.\"O .in +4n +.\"O .nf +.\"O +.\"O printf("%2$*1$d", width, num); +.\"O +.\"O .fi +.\"O .in +¤Þ¤¿¡¢°ú¤­¿ô¤¬É¬Íפʲսê¤Ç \(aq%\(aq ¤ÎÂå¤ï¤ê¤Ë "%m$"¡¢ +\(aq*\(aq¤ÎÂå¤ï¤ê¤Ë "*m$" ¤È½ñ¤¯¤³¤È¤Ç¡¢ +ÌÀ¼¨Åª¤Ë¤É¤Î°ú¤­¿ô¤ò»ÈÍѤ¹¤ë¤«¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤³¤Ç 10¿Ê¤ÎÀ°¿ô m ¤Ï´õ˾¤Î°ú¤­¿ô¤Î°ú¤­¿ô¥ê¥¹¥È¤Ç¤Î°ÌÃÖ¤ò¼¨¤¹ +(ºÇ½é¤Î°ú¤­¿ô¤ÎÈֹ椬 1 ¤Ç¤¢¤ë)¡£ +½¾¤Ã¤Æ¡¢°Ê²¼¤ÎÆó¤Ä¤ÏÅù²Á¤Ç¤¢¤ë¡£ +.in +4n +.nf + +printf("%*d", width, num); + +printf("%2$*1$d", width, num); + +.fi +.in +¤ÏÅù²Á¤Ç¤¢¤ë¡£ +.\"O are equivalent. +.\"O The second style allows repeated references to the +.\"O same argument. +.\"O The C99 standard does not include the style using \(aq$\(aq, +.\"O which comes from the Single Unix Specification. +.\"O If the style using +.\"O \(aq$\(aq is used, it must be used throughout for all conversions taking an +.\"O argument and all width and precision arguments, but it may be mixed +.\"O with "%%" formats which do not consume an argument. +.\"O There may be no +.\"O gaps in the numbers of arguments specified using \(aq$\(aq; for example, if +.\"O arguments 1 and 3 are specified, argument 2 must also be specified +.\"O somewhere in the format string. +ÆóÈÖÌܤνñ¤­Êý¤Ç¤ÏƱ¤¸°ú¤­¿ô¤ò·«¤êÊÖ¤·»²¾È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +C99 ɸ½à¤Ë¤Ï¡¢ Single Unix Specification ͳÍè¤Î \(aq$\(aq ¤ò»È¤Ã¤¿½ñ¤­Êý¤Ï´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£ +\(aq$\(aq ¤ò»È¤Ã¤¿¥¹¥¿¥¤¥ë¤ò»È¤¦¤È¡¢°ú¤­¿ô¤ò¼è¤ëÊÑ´¹µÚ¤ÓÉý¤ÈÀºÅ٤ΰú¤­¿ô¤ò +Á´¤Æ¤³¤Î¥¹¥¿¥¤¥ë¤Ç»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤¬¡¢ +°ú¤­¿ô¤ò¾ÃÈñ¤·¤Ê¤¤ "%%" ¥Õ¥©¡¼¥Þ¥Ã¥È¤Èº®¤¶¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +\(aq$\(aq ¤Ç»ØÄꤵ¤ì¤ë°ú¤­¿ô¤ÎÈÖ¹æ¤Ë¶õ¤­¤¬¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +Î㤨¤Ð¡¢¤â¤·°ú¤­¿ô 1 ¤È 3 ¤¬»ØÄꤵ¤ì¤ë¤È¡¢°ú¤­¿ô 2 ¤â¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Î¤É¤³¤«¤Ç +»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O For some numeric conversion a radix character ("decimal point") or +.\"O thousands' grouping character is used. +.\"O The actual character used +.\"O depends on the +.\"O .B LC_NUMERIC +.\"O part of the locale. +.\"O The POSIX locale +.\"O uses \(aq.\(aq as radix character, and does not have a grouping character. +¿ôÃÍÊÑ´¹¤Ë¤Ï¾®¿ôÅÀ¤ä 1000 ñ°Ì¤Î¶èÀÚ¤êʸ»ú¤ò»È¤¦¤â¤Î¤â¤¢¤ë¡£ +¼ÂºÝ¤Ë¤É¤Îʸ»ú¤ò»È¤¦¤«¤Ï¥í¥±¡¼¥ë¤Î +.B LC_NUMERIC +¤Ë¤è¤ë¡£ +POSIX ¥í¥±¡¼¥ë¤Ç¤Ï¾®¿ôÅÀ¤Ë \(aq.\(aq ¤òÍѤ¤¡¢ +¶èÀÚ¤êʸ»ú¤Ï»È¤ï¤Ê¤¤¡£ +.\"O Thus, +½¾¤Ã¤Æ¡¢ +.in +4n +.nf + +printf("%\(aq.2f", 1234567.89); + +.fi +.in +.\"O results in "1234567.89" in the POSIX locale, in "1234567,89" in the +.\"O nl_NL locale, and in "1.234.567,89" in the da_DK locale. +¤Ï¡¢ POSIX ¥í¥±¡¼¥ë¤Ç¤Ï "1234567.89" ¡¢ nl_NL ¥í¥±¡¼¥ë¤Ç¤Ï "1234567,89"¡¢ +da_DK ¥í¥±¡¼¥ë¤Ç¤Ï "1.234.567,89" ¤È¤Ê¤ë¡£ +.\"O .SS "The flag characters" +.SS ¥Õ¥é¥°Ê¸»ú +.\"O The character % is followed by zero or more of the following flags: +% ʸ»ú¤Î¸å¤í¤Ë¤Ï 0 ¸Ä°Ê¾å¤Î¥Õ¥é¥°Ê¸»ú¤¬Â³¤¯¡£ +.TP +.\"O .B # +.\"O The value should be converted to an "alternate form". +.B # +ÃͤϡÖÊ̤ηÁ¼°¡×¤ËÊÑ´¹¤µ¤ì¤ë¡£ +.\"O For +.\"O .B o +.\"O conversions, the first character of the output string is made zero +.\"O (by prefixing a 0 if it was not zero already). +.B o +ÊÑ´¹¤Î¾ì¹ç¡¢(ÀèƬʸ»ú¤¬ 0 ¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤ËÀèƬ¤Ë 0 ¤òÄɲ乤뤳¤È¤Ç) +½ÐÎÏʸ»úÎó¤ÎºÇ½é¤Îʸ»ú¤ò 0 ¤Ë¤¹¤ë¡£ +.\"O For +.\"O .B x +.\"O and +.\"O .B X +.\"O conversions, a nonzero result has the string "0x" (or "0X" for +.\"O .B X +.\"O conversions) prepended to it. +.B x +¤È +.B X +ÊÑ´¹¤Î¾ì¹ç¡¢¿ôÃͤ¬ 0 ¤Ç¤Ê¤¤¤È¤­¤Ë¤Ïʸ»úÎó "0x" +.RB ( X +ÊÑ´¹¤Î¾ì¹ç¤Ë¤Ï "0X") ¤¬Á°¤ËÉÕÍ¿¤µ¤ì¤ë¡£ +.\"O For +.\"O .BR a , +.\"O .BR A , +.\"O .BR e , +.\"O .BR E , +.\"O .BR f , +.\"O .BR F , +.\"O .BR g , +.\"O and +.\"O .B G +.\"O conversions, the result will always contain a decimal point, even if no +.\"O digits follow it (normally, a decimal point appears in the results of those +.\"O conversions only if a digit follows). +.\"O For +.BR a , +.BR A , +.BR e , +.BR E , +.BR f , +.BR F , +.BR g , +.B G +ÊÑ´¹¤Ç¤Ï¡¢ ¾®¿ôÅÀ¤Ë³¤¯¿ô»ú¤¬¤Ê¤¯¤Æ¤â¡¢ +½ÐÎϤˤϾï¤Ë¾®¿ôÅÀ¤¬´Þ¤Þ¤ì¤ë +(Ä̾ï¤Ï¡¢¾®¿ôÅÀ¤Î¸å¤Ë¿ô»ú¤¬Â³¤¯¾ì¹ç¤Ë¤Î¤ß¡¢ +¾®¿ôÅÀ¤¬É½¼¨¤µ¤ì¤ë)¡£ +.\"O .B g +.\"O and +.\"O .B G +.\"O conversions, trailing zeros are not removed from the result as they would +.\"O otherwise be. +.B g +¤È +.B G +ÊÑ´¹¤Î¾ì¹ç¡¢Â¾¤ÎÊÑ´¹¤È¤Ï°Û¤Ê¤ê¡¢ËöÈø¤Î¥¼¥í¤¬ÊÑ´¹·ë²Ì¤«¤éºï½ü¤µ¤ì¤Ê¤¤¡£ +.\"O For other conversions, the result is undefined. +¤½¤Î¾¤ÎÊÑ´¹¤Ç¤Ï¡¢·ë²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.TP +.B \&0 +.\"O The value should be zero padded. +.\"O For +.\"O .BR d , +.\"O .BR i , +.\"O .BR o , +.\"O .BR u , +.\"O .BR x , +.\"O .BR X , +.\"O .BR a , +.\"O .BR A , +.\"O .BR e , +.\"O .BR E , +.\"O .BR f , +.\"O .BR F , +.\"O .BR g , +.\"O and +.\"O .B G +.\"O conversions, the converted value is padded on the left with zeros rather +.\"O than blanks. +Ãͤò¥¼¥í¤ÇËä¤á¤ë¡£ +.BR d , +.BR i , +.BR o , +.BR u , +.BR x , +.BR X , +.BR a , +.BR A , +.BR e , +.BR E , +.BR f , +.BR F , +.BR g , +.B G +ÊÑ´¹¤Ç¤Ï¡¢ÊÑ´¹¤·¤¿Ãͤκ¸Â¦¤ò¶õÇòʸ»ú¤ÎÂå¤ï¤ê¤Ë¥¼¥í¤ÇËä¤á¤ë¡£ +.\"O If the +.\"O .B \&0 +.\"O and +.\"O .B \- +.\"O flags both appear, the +.\"O .B \&0 +.\"O flag is ignored. +.B \&0 +¤È +.B \- +¤¬Î¾Êý¤È¤â»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +.B \&0 +¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O If a precision is given with a numeric conversion +.\"O .RB ( d , +.\"O .BR i , +.\"O .BR o , +.\"O .BR u , +.\"O .BR x , +.\"O and +.\"O .BR X ), +.\"O the +.\"O .B \&0 +.\"O flag is ignored. +ÀºÅÙ¤¬¿ôÃÍÊÑ´¹ +.RB ( d , +.BR i , +.BR o , +.BR u , +.BR x , +.BR X ) +¤ÈƱ»þ¤Ë»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +.B \&0 +¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O For other conversions, the behavior is undefined. +¤½¤Î¾¤ÎÊÑ´¹¤Ç¤Ï¡¢Æ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.TP +.B \- +.\"O The converted value is to be left adjusted on the field boundary. +.\"O (The default is right justification.) +.\"O Except for +.\"O .B n +.\"O conversions, the converted value is padded on the right with blanks, rather +.\"O than on the left with blanks or zeros. +.\"O A +ÊÑ´¹Ãͤò¥Õ¥£¡¼¥ë¥É¶­³¦¤Çº¸Â·¤¨¤Ë¤¹¤ë +(¥Ç¥Õ¥©¥ë¥È¤Ï±¦Â·¤¨¤Ç¤¢¤ë)¡£ +.B n +ÊÑ´¹°Ê³°¤Ç¤Ï¡¢ÊÑ´¹¤µ¤ì¤¿ÃÍ¤Ï +º¸Â¦¤Ç¤Ï¤Ê¤¯±¦Â¦¤ò¶õÇòʸ»ú¤ä¥¼¥í¤ÇËä¤á¤é¤ì¤ë¡£ +.\"O .B \- +.\"O overrides a +.\"O .B \&0 +.\"O if both are given. +.B \- +¤È +.B \&0 +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +.B \- +¤¬Í¥À褵¤ì¤ë¡£ +.TP +.\"O .B \(aq \(aq +.B ' ' +.\"O (a space) A blank should be left before a positive number +.\"O (or empty string) produced by a signed conversion. +(1¸Ä¤ÎȾ³Ñ¥¹¥Ú¡¼¥¹) +Éä¹æÉÕ¤­ÊÑ´¹¤ÇÀ¸À®¤µ¤ì¤¿Àµ¤Î¿ô»ú¤ÎÁ°¤Ë¶õÇò (¤Þ¤¿¤Ï¶õʸ»úÎó) ¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.\"O .B + +.\"O A sign (+ or \-) should always be placed before a number produced by a signed +.\"O conversion. +.\"O By default a sign is used only for negative numbers. +.\"O A +.\"O .B + +.\"O overrides a space if both are used. +.B + +Éä¹æÉÕ¤­ÊÑ´¹¤Ë¤è¤Ã¤Æ½ÐÎϤµ¤ì¤ë¿ô»ú¤ÎÁ°¤Ë¡¢¾ï¤ËÉä¹æ (+ ¤« \-) ¤¬ÃÖ¤«¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢Éä¹æ¤ÏÉé¤Î¿ô»ú¤Î¾ì¹ç¤Î¤ßÉÕÍ¿¤µ¤ì¤ë¡£ +.B + +¤ÈȾ³Ñ¥¹¥Ú¡¼¥¹¤Î +ξÊý¤¬»È¤ï¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +.B + +¤¬Í¥À褵¤ì¤ë¡£ +.PP +.\"O The five flag characters above are defined in the C standard. +.\"O The SUSv2 specifies one further flag character. +¾åµ­¤Î 5 ¤Ä¤Î¥Õ¥é¥°¤Ï C ɸ½à¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +SUSv2 ¤Ç¤Ï¡¢¤µ¤é¤Ë¤â¤¦°ì¤Ä¥Õ¥é¥°Ê¸»ú¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.TP +.B \(aq +.\"O For decimal conversion +.\"O .RB ( i , +.\"O .BR d , +.\"O .BR u , +.\"O .BR f , +.\"O .BR F , +.\"O .BR g , +.\"O .BR G ) +.\"O the output is to be grouped with thousands' grouping characters +.\"O if the locale information indicates any. +.\"O Note that many versions of +.\"O .BR gcc (1) +.\"O cannot parse this option and will issue a warning. +.\"O SUSv2 does not +.\"O include %\(aqF. +10¿Ê¿ôÊÑ´¹ +.RB ( i , +.BR d , +.BR u , +.BR f , +.BR F , +.BR g , +.BR G ) +¤Ë¤ª¤¤¤Æ¡¢¥í¥±¡¼¥ë¾ðÊó¤Ë»ØÄ꤬¤¢¤ì¤Ð 1000 ñ°Ì¤Î¶èÀÚ¤êʸ»ú¤ò½ÐÎϤ¹¤ë¡£ +.BR gcc (1) +¤Î¿¤¯¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò²ò¼á¤¹¤ë¤³¤È¤¬¤Ç¤­¤º¡¢ +·Ù¹ð¤ò½ÐÎϤ¹¤ë¤³¤È¤ËÃí°Õ¤»¤è¡£ +%\(aqF ¤Ï SUSv2 ¤Ë¤Ï´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O glibc 2.2 adds one further flag character. +glibc 2.2 ¤Ç¤Ï¡¢¤µ¤é¤Ë°ì¤Ä¥Õ¥é¥°Ê¸»ú¤¬Äɲ䵤ì¤Æ¤¤¤ë¡£ +.TP +.B I +.\"O For decimal integer conversion +.\"O .RB ( i , +.\"O .BR d , +.\"O .BR u ) +.\"O the output uses the locale's alternative output digits, if any. +.\"O For example, since glibc 2.2.3 this will give Arabic-Indic digits +.\"O in the Persian ("fa_IR") locale. +.\"O .\" outdigits keyword in locale file +10¿ÊÀ°¿ôÊÑ´¹ +.RB ( i , +.BR d , +.BR u ) +¤Ë¤ª¤¤¤Æ¡¢¥í¥±¡¼¥ë¤ÎÂåÂؽÐÎÏ¿ô»ú¤¬¤¢¤ì¤Ð¡¢¤½¤ì¤òÍѤ¤¤Æ½ÐÎϤ¹¤ë¡£ +Î㤨¤Ð¡¢ glibc 2.2.3 °Ê¹ß¤Ç¤Ï¡¢¥Ú¥ë¥·¥¢ ("fa_IR") ¥í¥±¡¼¥ë¤Ç +¥¢¥é¥Ó¥¢¿ô»ú (Arabic-Indic digits) ¤ò½ÐÎϤǤ­¤ë¡£ +.\" ¥í¥±¡¼¥ë¥Õ¥¡¥¤¥ë¤Ë¤Ï outdigits ¤È¤¤¤¦¥­¡¼¥ï¡¼¥É¤¬¤¢¤ë¡£ +.\"O .SS "The field width" +.SS ¥Õ¥£¡¼¥ë¥ÉÉý +.\"O An optional decimal digit string (with nonzero first digit) specifying +.\"O a minimum field width. +.\"O If the converted value has fewer characters +.\"O than the field width, it will be padded with spaces on the left +.\"O (or right, if the left-adjustment flag has been given). +ºÇ¾®¤Î¥Õ¥£¡¼¥ë¥ÉÉý¤ò»ØÄꤹ¤ë 10¿Ê¿ô¤Î¿ôÃÍʸ»úÎó (ʸ»úÎó¤ÎºÇ½é¤Îʸ»ú¤Ï +¥¼¥í°Ê³°)¡£ËܹàÌܤϥª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +ÊÑ´¹¤µ¤ì¤¿ÃͤÎʸ»ú¿ô¤¬¥Õ¥£¡¼¥ë¥ÉŤè¤ê¤â¾¯¤Ê¤¤¾ì¹ç¡¢ +¥Õ¥£¡¼¥ë¥É¤Îº¸Â¦¤ò¥¹¥Ú¡¼¥¹¤ÇËä¤á¤ë +(º¸Â·¤¨¤Î¥Õ¥é¥°¤¬¤¢¤ë¾ì¹ç¤Ï±¦Â¦¤òËä¤á¤ë)¡£ +.\"O Instead of a decimal digit string one may write "*" or "*m$" +.\"O (for some decimal integer \fIm\fP) to specify that the field width +.\"O is given in the next argument, or in the \fIm\fP-th argument, respectively, +.\"O which must be of type +.\"O .IR int . +10¿Ê¿ô¤Îʸ»úÎó¤ÎÂå¤ï¤ê¤Ë "*" ¤ä "*m$" (\fIm\fP ¤Ï 10¿ÊÀ°¿ô) ¤ò½ñ¤¯¤³¤È¤â¤Ç¤­¤ë¡£ +"*" ¤È "*m$" ¤Ï¤½¤ì¤¾¤ì¡¢¼¡¤Î°ú¤­¿ô¤È \fIm\fP ÈÖÌܤΰú¤­¿ô¤ò¥Õ¥£¡¼¥ë¥ÉÉý¤È¤·¤Æ +»È¤¦¤³¤È¤ò»ØÄꤹ¤ë (¤³¤ì¤é¤Î°ú¤­¿ô¤Ï +.I int +·¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ +.\"O A negative field width is taken as a \(aq\-\(aq flag followed by a +.\"O positive field width. +¥Õ¥£¡¼¥ë¥ÉÉý¤ËÉé¤Î¿ô¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +\(aq\-\(aq ¥Õ¥é¥°¤ÈÀµ¤Î¿ô¤Î¥Õ¥£¡¼¥ë¥ÉÉý¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +.\"O In no case does a nonexistent or small field width cause truncation of a +.\"O field; if the result of a conversion is wider than the field width, the +.\"O field is expanded to contain the conversion result. +¥Õ¥£¡¼¥ë¥ÉÉý¤¬¾®¤µ¤«¤Ã¤¿¤ê»ØÄ꤬¤Ê¤«¤Ã¤¿¤ê¤·¤Æ¤â¡¢¥Õ¥£¡¼¥ë¥É¤¬ÀÚ¤êµÍ¤á¤é¤ì¤ë +¤³¤È¤Ï¤Ê¤¤¡£¤â¤·ÊÑ´¹·ë²Ì¤¬¥Õ¥£¡¼¥ë¥ÉÉý¤è¤ê¤â¹­¤«¤Ã¤¿¾ì¹ç¡¢ +¥Õ¥£¡¼¥ë¥É¤ÏÊÑ´¹·ë²Ì¤¬Æþ¤ëÉý¤Ë¹­¤²¤é¤ì¤ë¡£ +.\"O .SS "The precision" +.SS ÀºÅÙ +.\"O An optional precision, in the form of a period (\(aq.\(aq) followed by an +.\"O optional decimal digit string. +¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ëÀºÅ٤ϡ¢¥Ô¥ê¥ª¥É (\(aq.\(aq) ¤È¤½¤ì¤Ë³¤¯10¿Ê¿ô¤È¤¤¤¦ +·Á¼°¤Ç»ØÄꤹ¤ë (10¿Ê¿ô¤Ï¥ª¥×¥·¥ç¥ó) ¡£ +.\"O Instead of a decimal digit string one may write "*" or "*m$" +.\"O (for some decimal integer m) to specify that the precision +.\"O is given in the next argument, or in the m-th argument, respectively, +.\"O which must be of type +.\"O .IR int . +10¿Ê¿ô¤Îʸ»úÎó¤ÎÂå¤ï¤ê¤Ë "*" ¤ä "*m$" (m ¤Ï 10 ¿ÊÀ°¿ô)¤ò½ñ¤¯¤³¤È¤â¤Ç¤­¤ë¡£ +"*" ¤È "*m$" ¤Ï¤½¤ì¤¾¤ì¡¢¼¡¤Î°ú¤­¿ô¤È m ÈÖÌܤΰú¤­¿ô¤òÀºÅ٤Ȥ·¤Æ +»È¤¦¤³¤È¤ò»ØÄꤹ¤ë (¤³¤ì¤é¤Î°ú¤­¿ô¤Ï +.I int +·¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ +.\"O If the precision is given as just \(aq.\(aq, or the precision is negative, +.\"O the precision is taken to be zero. +ÀºÅ٤Ȥ·¤Æ \(aq.\(aq ¤À¤±¤¬»ØÄꤵ¤ì¤¿¤ê¡¢ÀºÅÙ¤¬Éé¤Î¿ô¤À¤Ã¤¿¾ì¹ç¡¢ +ÀºÅ٤ϥ¼¥í¤È¤ß¤Ê¤µ¤ì¤ë¡£ +.\"O This gives the minimum number of digits to appear for +.\"O .BR d , +.\"O .BR i , +.\"O .BR o , +.\"O .BR u , +.\"O .BR x , +.\"O and +.\"O .B X +.\"O conversions, the number of digits to appear after the radix character for +.\"O .BR a , +.\"O .BR A , +.\"O .BR e , +.\"O .BR E , +.\"O .BR f , +.\"O and +.\"O .B F +.\"O conversions, the maximum number of significant digits for +.\"O .B g +.\"O and +.\"O .B G +.\"O conversions, or the maximum number of characters to be printed from a +.\"O string for +.\"O .B s +.\"O and +.\"O .B S +.\"O conversions. +.BR d , +.BR i , +.BR o , +.BR u , +.BR x , +.B X +ÊÑ´¹¤Ç¤Ï¡¢É½¼¨¤µ¤ì¤ëºÇ¾®¤Î·å¿ô¤ò»ØÄꤹ¤ë¡£ +.BR a , +.BR A , +.BR e , +.BR E , +.BR f , +.B F +ÊÑ´¹¤Ç¤Ï¡¢¾®¿ôÅÀ°Ê²¼¤Ëɽ¼¨¤µ¤ì¤ë¿ô»ú¤Î·å¿ô¤ò»ØÄꤹ¤ë¡£ +.B g +¤È +.B G +ÊÑ´¹¤Ç¤Ï¡¢Í­¸ú¿ô»ú¤ÎºÇÂç·å¿ô¤ò»ØÄꤹ¤ë¡£ +.B s +¤È +.B S +ÊÑ´¹¤Ç¤Ï¡¢Ê¸»úÎ󤫤é½ÐÎϤµ¤ì¤ëºÇÂçʸ»ú¿ô¤ò»ØÄꤹ¤ë¡£ +.\"O .SS "The length modifier" +.SS Ťµ½¤¾þ»Ò +.\"O Here, "integer conversion" stands for +.\"O .BR d , +.\"O .BR i , +.\"O .BR o , +.\"O .BR u , +.\"O .BR x , +.\"O or +.\"O .B X +.\"O conversion. +¡ÖÀ°¿ôÊÑ´¹¡×¤È¤Ï¡¢ +.BR d , +.BR i , +.BR o , +.BR u , +.BR x , +.B X +ÊÑ´¹¤Î¤³¤È¤Ç¤¢¤ë¡£ +.TP +.B hh +.\"O A following integer conversion corresponds to a +.\"O .I signed char +.\"O or +.\"O .I unsigned char +.\"O argument, or a following +.\"O .B n +.\"O conversion corresponds to a pointer to a +.\"O .I signed char +.\"O argument. +À°¿ôÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I signed char +¤« +.I unsigned char +¤Ç¡¢ +.B n +ÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I signed char +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.B h +.\"O A following integer conversion corresponds to a +.\"O .I short int +.\"O or +.\"O .I unsigned short int +.\"O argument, or a following +.\"O .B n +.\"O conversion corresponds to a pointer to a +.\"O .I short int +.\"O argument. +À°¿ôÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I short int +¤« +.I unsigned short int +¤Ç¡¢ +.B n +ÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I short int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.\"O .B l +.\"O (ell) A following integer conversion corresponds to a +.\"O .I long int +.\"O or +.\"O .I unsigned long int +.\"O argument, or a following +.\"O .B n +.\"O conversion corresponds to a pointer to a +.\"O .I long long int +.\"O argument, or a following +.\"O .B c +.\"O conversion corresponds to a +.\"O .I wint_t +.\"O argument, or a following +.\"O .B s +.\"O conversion corresponds to a pointer to +.\"O .I wchar_t +.\"O argument. +.BR l " (¥¨¥ë)" +³ÆÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬¡¢ +À°¿ôÊÑ´¹¤Ç¤Ï +.IR "long int" ¤« +.IR "unsigned long int" ¡¢ +.B n +ÊÑ´¹¤Ç¤Ï +.I long long int +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¢ +.B c +ÊÑ´¹¤Ç¤Ï +.IR wint_t ¡¢ +.B s +ÊÑ´¹¤Ç¤Ï +.I wchar_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ + +.TP +.\"O .B ll +.\"O (ell-ell). +.\"O A following integer conversion corresponds to a +.\"O .I long long int +.\"O or +.\"O .I unsigned long long int +.\"O argument, or a following +.\"O .B n +.\"O conversion corresponds to a pointer to a +.\"O .I long int +.\"O argument. +.BR ll " (¥¨¥ë¥¨¥ë)" +À°¿ôÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I long long int +¤« +.I unsigned long long int +¤Ç¡¢ +.B n +ÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I long int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.B L +.\"O A following +.\"O .BR a , +.\"O .BR A , +.\"O .BR e , +.\"O .BR E , +.\"O .BR f , +.\"O .BR F , +.\"O .BR g , +.\"O or +.\"O .B G +.\"O conversion corresponds to a +.\"O .I long double +.\"O argument. +.BR a , +.BR A , +.BR e , +.BR E , +.BR f , +.BR F , +.BR g , +.B G +ÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I long double +¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.\"O (C99 allows %LF, but SUSv2 does not.) +(C99 ¤Ç¤Ï %LF ¤ò»È¤¦¤³¤È¤òǧ¤á¤Æ¤¤¤ë¤¬¡¢SUSv2 ¤Ç¤Ïǧ¤á¤é¤ì¤Æ¤¤¤Ê¤¤¡£) +.TP +.B q +.\"O ("quad". 4.4BSD and Linux libc5 only. +.\"O Don't use.) +.\"O This is a synonym for +.\"O .BR ll . +("quad"¡£ 4.4BSD ¤È Linux libc5 ¤Î¤ßÍ­¸ú¡£»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£) +.B ll +¤ÈƱ¤¸°ÕÌ£¤Ç¤¢¤ë¡£ +.TP +.B j +.\"O A following integer conversion corresponds to an +.\"O .I intmax_t +.\"O or +.\"O .I uintmax_t +.\"O argument. +À°¿ôÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I intmax_t +¤« +.I uintmax_t +¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.B z +.\"O A following integer conversion corresponds to a +.\"O .I size_t +.\"O or +.\"O .I ssize_t +.\"O argument. +.\"O (Linux libc5 has +.\"O .B Z +.\"O with this meaning. +.\"O Don't use it.) +À°¿ôÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I size_t +¤« +.I ssize_t +¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +(Linux libc5 ¤Ç¤Ï¡¢¤³¤ì¤ò»ØÄꤹ¤ë¤Î¤Ë +.B Z +¤òÍѤ¤¤ë¡£»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£) +.TP +.B t +.\"O A following integer conversion corresponds to a +.\"O .I ptrdiff_t +.\"O argument. +À°¿ôÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I ptrdiff_t +¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.PP +.\"O The SUSv2 only knows about the length modifiers +.\"O .B h +.\"O (in +.\"O .BR hd , +.\"O .BR hi , +.\"O .BR ho , +.\"O .BR hx , +.\"O .BR hX , +.\"O .BR hn ) +.\"O and +.\"O .B l +.\"O (in +.\"O .BR ld , +.\"O .BR li , +.\"O .BR lo , +.\"O .BR lx , +.\"O .BR lX , +.\"O .BR ln , +.\"O .BR lc , +.\"O .BR ls ) +.\"O and +.\"O .B L +.\"O (in +.\"O .BR Le , +.\"O .BR LE , +.\"O .BR Lf , +.\"O .BR Lg , +.\"O .BR LG ). +SUSv2 ¤ÇŤµ½¤¾þ»Ò¤È¤·¤Æ»ÈÍѤǤ­¤ë¤Î¤Ï¡¢ +.B h +.RB ( hd , +.BR hi , +.BR ho , +.BR hx , +.BR hX , +.BR hn ), +.B l +.RB ( ld , +.BR li , +.BR lo , +.BR lx , +.BR lX , +.BR ln , +.BR lc , +.BR ls ), +.B L +.RB ( Le , +.BR LE , +.BR Lf , +.BR Lg , +.BR LG ) +¤À¤±¤Ç¤¢¤ë¡£ +.\"O .SS "The conversion specifier" +.SS ÊÑ´¹»ØÄê»Ò +.\"O A character that specifies the type of conversion to be applied. +ŬÍѤµ¤ì¤ëÊÑ´¹¤Î·¿¤ò»ØÄꤹ¤ëʸ»ú¡£ +.PP +.\"O The conversion specifiers and their meanings are: +ÊÑ´¹»ØÄê»Ò¤È¤½¤Î°ÕÌ£¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.TP +.BR d ", " i +.\"O The +.\"O .I int +.\"O argument is converted to signed decimal notation. +.I int +°ú¤­¿ô¤òÉä¹æÉÕ¤­ 10 ¿Êɽµ­¤ËÊÑ´¹¤¹¤ë¡£ +.\"O The precision, if any, gives the minimum number of digits +.\"O that must appear; if the converted value requires fewer digits, it is +.\"O padded on the left with zeros. +.\"O The default precision is 1. +ÀºÅÙ»ØÄ꤬¤¢¤ì¤Ð¡¢ÀºÅ٤ǻØÄꤷ¤¿·å¿ô¤Ïɬ¤º½ÐÎϤµ¤ì¤ë¡£ÊÑ´¹¸å¤ÎÃͤ¬ +»ØÄꤵ¤ì¤¿·å¿ô¤Ë­¤ê¤Ê¤¤¾ì¹ç¤Ï¡¢º¸Â¦¤¬ 0 ¤ÇËä¤á¤é¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÀºÅÙ¤Ï 1 ¤Ç¤¢¤ë¡£ +.\"O When 0 is printed with an explicit precision 0, the output is empty. +0 ¤òɽ¼¨¤·¤è¤¦¤È¤·¤¿»þ¤Ë¡¢ÌÀ¼¨Åª¤ËÀºÅ٤Ȥ·¤Æ 0 ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢ +½ÐÎϤ϶õʸ»úÎó¤È¤Ê¤ë¡£ +.TP +.BR o ", " u ", " x ", " X +.\"O The +.\"O .I "unsigned int" +.\"O argument is converted to unsigned octal +.\"O .RB ( o ), +.\"O unsigned decimal +.\"O .RB ( u ), +.\"O or unsigned hexadecimal +.\"O .RB ( x +.\"O and +.\"O .BR X ) +.\"O notation. +.I "unsigned int" +°ú¤­¿ô¤ò¡¢ +Éä¹æ¤Ê¤·8¿Ê¿ô +.RB ( o ), +Éä¹æ¤Ê¤·10¿Ê¿ô +.RB ( u ), +Éä¹æ¤Ê¤·16¿Ê¿ô +.RB ( x +¤È +.BR X ) +¤ËÊÑ´¹¤¹¤ë¡£ +.\"O The letters +.\"O .B abcdef +.\"O are used for +.\"O .B x +.\"O conversions; the letters +.\"O .B ABCDEF +.\"O are used for +.\"O .B X +.\"O conversions. +.B x +ÊÑ´¹¤Ç¤Ï +.B abcdef +¤¬»ÈÍѤµ¤ì¡¢ +.B X +ÊÑ´¹¤Ç¤Ï +.B ABCDEF +¤¬»ÈÍѤµ¤ì¤ë¡£ +.\"O The precision, if any, gives the minimum number of digits +.\"O that must appear; if the converted value requires fewer digits, it is +.\"O padded on the left with zeros. +ÀºÅÙ»ØÄ꤬¤¢¤ì¤Ð¡¢ÀºÅ٤ǻØÄꤷ¤¿·å¿ô¤Ïɬ¤º½ÐÎϤµ¤ì¤ë¡£ÊÑ´¹¸å¤ÎÃͤ¬ +»ØÄꤵ¤ì¤¿·å¿ô¤Ë­¤ê¤Ê¤¤¾ì¹ç¤Ï¡¢º¸Â¦¤¬ 0 ¤ÇËä¤á¤é¤ì¤ë¡£ +.TP +.BR e ", " E +.\"O The +.\"O .I double +.\"O argument is rounded and converted in the style +.\"O .if \w'\*(Pm'=0 .ds Pm \(+- +.\"O .RB [\-]d \&. ddd e \\*(Pmdd +.\"O where there is one digit before the decimal-point character and the number +.\"O of digits after it is equal to the precision; if the precision is missing, +.\"O it is taken as 6; if the precision is zero, no decimal-point character +.\"O appears. +.\"O An +.I double +°ú¤­¿ô¤ò´Ý¤á¤Æ +.if \w'\*(Pm'=0 .ds Pm \(+- +.RB [\-]d \&. ddd e \\*(Pmdd +¤Î·Á¤ËÊÑ´¹¤¹¤ë¡£ +¾®¿ôÅÀ¤ÎÁ°¤Ë¤Ï°ì·å¤Î¿ô»ú¤¬¤¢¤ê¡¢¾®¿ôÅÀ°Ê²¼¤Î·å¿ô¤ÏÀºÅ٤ǻØÄꤵ¤ì¤¿ +·å¿ô¤Ë¤Ê¤ë¡£ÀºÅ٤ϻØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç 6 ¤È¤ß¤Ê¤µ¤ì¤ë¡£ +ÀºÅÙ¤¬ 0 ¤Î¾ì¹ç¤Ë¤Ï¡¢¾®¿ôÅÀ°Ê²¼¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¡£ +.\"O .B E +.\"O conversion uses the letter +.\"O .B E +.\"O (rather than +.\"O .BR e ) +.\"O to introduce the exponent. +.B E +ÊÑ´¹¤Ç¤Ï¡¢»Ø¿ô¤òɽ¸½¤¹¤ë¤È¤­¤Ë +.RB ( e +¤Ç¤Ï¤Ê¤¯) +.B E +¤¬»È¤ï¤ì¤ë¡£ +.\"O The exponent always contains at least two +.\"O digits; if the value is zero, the exponent is 00. +»Ø¿ôÉôʬ¤Ï¾¯¤Ê¤¯¤È¤â 2·åɽ¼¨¤µ¤ì¤ë¡£ +¤Ä¤Þ¤ê¡¢»Ø¿ô¤ÎÃͤ¬ 0 ¤Î¾ì¹ç¤Ë¤Ï¡¢00 ¤Èɽ¼¨¤µ¤ì¤ë¡£ +.TP +.BR f ", " F +.\"O The +.\"O .I double +.\"O argument is rounded and converted to decimal notation in the style +.\"O .RB [\-]ddd \&. ddd, +.\"O where the number of digits after the decimal-point character is equal to +.\"O the precision specification. +.I double +°ú¤­¿ô¤ò´Ý¤á¤Æ +.RB [\-]ddd \&. ddd +¤Î·Á¤Î10¿Êɽ¸½¤ËÊÑ´¹¤¹¤ë¡£ +¾®¿ôÅÀ¤Î¸å¤Î·å¿ô¤Ï¡¢ÀºÅ٤ǻØÄꤵ¤ì¤¿ÃͤȤʤ롣 +.\"O If the precision is missing, it is taken as +.\"O 6; if the precision is explicitly zero, no decimal-point character appears. +ÀºÅÙ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï 6 ¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +ÀºÅ٤Ȥ·¤ÆÌÀ¼¨Åª¤Ë 0 ¤¬»ØÄꤵ¤ì¤¿¤È¤­¤Ë¤Ï¡¢¾®¿ôÅÀ°Ê²¼¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¡£ +.\"O If a decimal point appears, at least one digit appears before it. +¾®¿ôÅÀ¤òɽ¼¨¤¹¤ëºÝ¤Ë¤Ï¡¢¾®¿ôÅÀ¤ÎÁ°¤Ë¾¯¤Ê¤¯¤È¤â°ì·å¤Ï¿ô»ú¤¬É½¼¨¤µ¤ì¤ë¡£ + +.\"O (The SUSv2 does not know about +.\"O .B F +.\"O and says that character string representations for infinity and NaN +.\"O may be made available. +.\"O The C99 standard specifies "[\-]inf" or "[\-]infinity" +.\"O for infinity, and a string starting with "nan" for NaN, in the case of +.\"O .B f +.\"O conversion, and "[\-]INF" or "[\-]INFINITY" or "NAN*" in the case of +.\"O .B F +.\"O conversion.) +(SUSv2 ¤Ç¤Ï¡¢ +.B F +¤Ïµ¬Äꤵ¤ì¤Æ¤ª¤é¤º¡¢Ìµ¸Â¤ä NaN ¤Ë´Ø¤¹¤ëʸ»úÎóɽ¸½¤ò +¹Ô¤Ã¤Æ¤â¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ + C99 ɸ½à¤Ç¤Ï¡¢ +.B f +ÊÑ´¹¤Ç¤Ï¡¢Ìµ¸Â¤Ï "[\-]inf" ¤« "[\-]infinity" ¤Èɽ¼¨¤·¡¢ +NaN ¤Ïʸ»úÎó¤ÎÀèƬ¤Ë `nan' ¤ò¤Ä¤±¤Æɽ¼¨¤¹¤ë¤è¤¦¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.B F +ÊÑ´¹¤Î¾ì¹ç¤Ï "[\-]INF", "[\-]INFINITY", "NAN*" ¤Èɽ¼¨¤µ¤ì¤ë¡£) +.TP +.BR g ", " G +.\"O The +.\"O .I double +.\"O argument is converted in style +.\"O .B f +.\"O or +.\"O .B e +.\"O (or +.\"O .B F +.\"O or +.\"O .B E +.\"O for +.\"O .B G +.\"O conversions). +.I double +°ú¤­¿ô¤ò +.B f +¤« +.B e +.RB ( G +ÊÑ´¹¤Î¾ì¹ç¤Ï +.B F +¤« +.BR E ) +¤Î·Á¼°¤ËÊÑ´¹¤¹¤ë¡£ +.\"O The precision specifies the number of significant digits. +ÀºÅÙ¤Ïɽ¼¨¤¹¤ë·å¿ô¤ò»ØÄꤹ¤ë¡£ +.\"O If the precision is missing, 6 digits are given; if the precision is zero, +.\"O it is treated as 1. +ÀºÅÙ¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢6·å¤È¤ß¤Ê¤µ¤ì¤ë¡£ +ÀºÅÙ¤¬ 0 ¤Î¾ì¹ç¤Ï¡¢1·å¤È¤ß¤Ê¤µ¤ì¤ë¡£ +.\"O Style +.\"O .B e +.\"O is used if the exponent from its conversion is less than \-4 or greater +.\"O than or equal to the precision. +ÊÑ´¹¤µ¤ì¤ëÃͤλؿô¤¬¡¢ \-4 ¤è¤ê¾®¤µ¤¤¤«¡¢ÀºÅٰʾå¤Î¾ì¹ç¤Ë¡¢ +.B e +·Á¼°¤¬»ÈÍѤµ¤ì¤ë¡£ +.\"O Trailing zeros are removed from the +.\"O fractional part of the result; a decimal point appears only if it is +.\"O followed by at least one digit. +ÊÑ´¹¤µ¤ì¤¿·ë²Ì¤Î¾®¿ôÉôʬ¤ÎËöÈø¤Î 0 ¤Ïºï½ü¤µ¤ì¤ë¡£¾®¿ôÅÀ¤¬É½¼¨¤µ¤ì¤ë¤Î¤Ï¡¢ +¾®¿ôÅÀ°Ê²¼¤Ë¿ô»ú¤¬¾¯¤Ê¤¯¤È¤â°ì¤Ä¤¢¤ë¾ì¹ç¤Ë¤À¤±¤Ç¤¢¤ë¡£ +.TP +.BR a ", " A +.\"O (C99; not in SUSv2) For +.\"O .B a +.\"O conversion, the +.\"O .I double +.\"O argument is converted to hexadecimal notation (using the letters abcdef) +.\"O in the style +.\"O .RB [\-] 0x h \&. hhhh p \\*(Pmd; +.\"O for +.\"O .B A +.\"O conversion the prefix +.\"O .BR 0X , +.\"O the letters ABCDEF, and the exponent separator +.\"O .B P +.\"O is used. +(C99 ¤Ë¤Ï¤¢¤ë¤¬ SUSv2 ¤Ë¤Ï¤Ê¤¤) +.B a +ÊÑ´¹¤Ç¤Ï¡¢ +.I double +°ú¤­¿ô¤ò (abcdef ¤Îʸ»ú¤ò»È¤Ã¤Æ) +.RB [\-] 0x h \&. hhhh p \\*(Pmd; +·Á¼°¤Î 16 ¿Êɽµ­¤ËÊÑ´¹¤¹¤ë¡£ +.B A +ÊÑ´¹¤Ç¤Ï¡¢Á°ÃÖʸ»úÎó +.BR 0X , +ʸ»ú ABCDEF, »Ø¿ôʸ»ú +.B P +¤òÍѤ¤¤ë¡£ +.\"O There is one hexadecimal digit before the decimal point, +.\"O and the number of digits after it is equal to the precision. +¾®¿ôÅÀ¤ÎÁ°¤Ë¤Ï 1·å¤Î16¿Ê¿ô¤¬ÃÖ¤«¤ì¡¢¾®¿ôÅÀ¤Î¸å¤í¤Î·å¿ô¤Ï +ÀºÅ٤ǻØÄꤵ¤ì¤¿ÃͤȤʤ롣 +.\"O The default precision suffices for an exact representation of the value +.\"O if an exact representation in base 2 exists +.\"O and otherwise is sufficiently large to distinguish values of type +.\"O .IR double . +¥Ç¥Õ¥©¥ë¥È¤ÎÀºÅ٤ϡ¢¤½¤ÎÃͤ¬ 2¿Ê¿ô¤ÇÀµ³Î¤Ëɽ¸½¤Ç¤­¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤½¤ÎÃͤòÀµ³Î¤Ëɽ¸½¤Ç¤­¤ë·å¿ô¤È¤Ê¤ë¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢ +.I double +·¿¤ÎÃͤò¶èÊ̤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤È¤Ê¤ë¡£ +.\"O The digit before the decimal point is unspecified for nonnormalized +.\"O numbers, and nonzero but otherwise unspecified for normalized numbers. +.\" motoki 2005/03/19: ¹ç¤Ã¤Æ¤¤¤ë¤«¤Ê¡© +¾®¿ôÅÀ¤ÎÁ°¤Î¿ô»ú¤Ï¡¢Àµµ¬²½¤µ¤ì¤Æ¤¤¤Ê¤¤¿ô¤Î¾ì¹ç¤Ï¤¤¤¯¤Ä¤Ë¤Ê¤ë¤«Ê¬¤«¤é¤Ê¤¤¡£ +Àµµ¬²½¤µ¤ì¤¿¿ô¤Î¾ì¹ç¤Ï¡¢ 0 °Ê³°¤ÎÃͤˤʤ뤬¡¢¤¤¤¯¤Ä¤Ë¤Ê¤ë¤«¤Ïʬ¤«¤é¤Ê¤¤¡£ +.TP +.B c +.\"O If no +.\"O .B l +.\"O modifier is present, the +.\"O .I int +.\"O argument is converted to an +.\"O .IR "unsigned char" , +.\"O and the resulting character is written. +.B l +½¤¾þ»Ò¤¬¤Ê¤±¤ì¤Ð¡¢ +.I int +°ú¤­¿ô¤ò +.IR "unsigned char" +¤ËÊÑ´¹¤·¤Æ¡¢¤½¤Î·ë²Ì¤ËÂбþ¤¹¤ëʸ»ú¤ò½ÐÎϤ¹¤ë¡£ +.\"O If an +.\"O .B l +.\"O modifier is present, the +.\"O .I wint_t +.\"O (wide character) argument is converted to a multibyte sequence by a call +.\"O to the +.\"O .BR wcrtomb (3) +.\"O function, with a conversion state starting in the initial state, and the +.\"O resulting multibyte string is written. +.B l +½¤¾þ»Ò¤¬¤¢¤ì¤Ð¡¢ +.I wint_t +(¥ï¥¤¥Éʸ»ú) °ú¤­¿ô¤ò¡¢ +.BR wcrtomb (3) +´Ø¿ô¤ò½é´ü¥·¥Õ¥È¾õÂ֤ǸƤӽФ·¤Æ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤·¡¢ +ÊÑ´¹¤µ¤ì¤¿¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò½ÐÎϤ¹¤ë¡£ +.TP +.B s +.\"O If no +.\"O .B l +.\"O modifier is present: The +.\"O .I "const char *" +.\"O argument is expected to be a pointer to an array of character type (pointer +.\"O to a string). +.\"O Characters from the array are written up to (but not +.\"O including) a terminating null byte (\(aq\\0\(aq); +.\"O if a precision is specified, no more than the number specified +.\"O are written. +.\"O If a precision is given, no null byte need be present; +.\"O if the precision is not specified, or is greater than the size of the +.\"O array, the array must contain a terminating null byte. +.B l +½¤¾þ»Ò¤¬¤Ê¤¤¾ì¹ç¡¢ +°ú¤­¿ô¤Ï +.I "const char *" +·¿¤Çʸ»ú·¿¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ (ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿) ¤Ç¤¢¤ë¤³¤È¤¬ +´üÂÔ¤µ¤ì¤Æ¤¤¤ë¡£ÇÛÎóÃæ¤Îʸ»ú¤Ï¡¢½ªÃ¼¤Î NULL ¥Ð¥¤¥È (\(aq\\0\(aq) +¤¬½Ð¤Æ¤¯¤ë¤Þ¤Ç½ÐÎϤµ¤ì¤ë (½ªÃ¼Ê¸»ú¤Ï½ÐÎϤµ¤ì¤Ê¤¤)¡£ +ÀºÅÙ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢»ØÄꤵ¤ì¤¿»ú¿ô°Ê¾å¤Ï½ÐÎϤµ¤ì¤Ê¤¤¡£ +ÀºÅÙ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢½ªÃ¼¥Ð¥¤¥È¤¬Â¸ºß¤¹¤ëɬÍפϤʤ¤¡£ +ÀºÅÙ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤ê¡¢ÀºÅÙ¤ÎÃͤ¬ÇÛÎó¤ÎÂ礭¤µ¤è¤êÂ礭¤¤¾ì¹ç¤Ë¤Ï¡¢ +ÇÛÎó¤Ï½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ò´Þ¤ó¤Ç¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O If an +.\"O .B l +.\"O modifier is present: The +.\"O .I "const wchar_t *" +.\"O argument is expected to be a pointer to an array of wide characters. +.B l +½¤¾þ»Ò¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +°ú¤­¿ô¤Ï +.I "const wchar_t *" +·¿¤Ç¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤¬´üÂÔ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O Wide characters from the array are converted to multibyte characters +.\"O (each by a call to the +.\"O .BR wcrtomb (3) +.\"O function, with a conversion state starting in the initial state before +.\"O the first wide character), up to and including a terminating null +.\"O wide character. +.\"O The resulting multibyte characters are written up to +.\"O (but not including) the terminating null byte. +.\"O If a precision is +.\"O specified, no more bytes than the number specified are written, but +.\"O no partial multibyte characters are written. +.\"O Note that the precision +.\"O determines the number of +.\"O .I bytes +.\"O written, not the number of +.\"O .I wide characters +.\"O or +.\"O .IR "screen positions" . +ÇÛÎóÃæ¤Î¥ï¥¤¥Éʸ»ú¤Ï (1ʸ»úËè¤Ë +.BR wcrtomb (3) +¤ò¸Æ¤Ó½Ð¤·¤Æ) ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ËÊÑ´¹¤µ¤ì¤ë +(ºÇ½é¤Î¥ï¥¤¥Éʸ»ú¤ÎÊÑ´¹¤ÎÁ°¤Ë +.BR wcrtomb () +¤Î¥·¥Õ¥È¾õÂÖ¤ò½é´ü¾õÂÖ¤ËÌᤷ¤Æ¤«¤éÊÑ´¹¤Ï¹Ô¤ï¤ì¤ë)¡£ +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Ø¤ÎÊÑ´¹¤Ï¡¢Ê¸»úÎó¤ò½ªÃ¼¤¹¤ë NULL ¥ï¥¤¥Éʸ»ú¤¬ +½Ð¤Æ¤¯¤ë¤Þ¤Ç¹Ô¤ï¤ì¡¢½ªÃ¼ NULL ¥ï¥¤¥Éʸ»ú¤â´Þ¤á¤ÆÊÑ´¹¤µ¤ì¤ë¡£ +·ë²Ì¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤Ï¡¢½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤¬½Ð¤Æ¤¯¤ë¤Þ¤Ç +½ÐÎϤµ¤ì¤ë (½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤Ï½ÐÎϤµ¤ì¤Ê¤¤)¡£ +ÀºÅÙ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢»ØÄꤵ¤ì¤¿¥Ð¥¤¥È¿ô°Ê¾å¤Ë¤Ï½ÐÎϤµ¤ì¤Ê¤¤¡£ +⤷¡¢¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Î°ìÉôʬ¤À¤±¤¬½ÐÎϤµ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +ÀºÅ٤ϡ֥Х¤¥È¡×¿ô¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ê¡¢¡Ö¥ï¥¤¥Éʸ»ú¡×¿ô¤ä +¡Ö²èÌ̤ǤΰÌÃ֡פò»ØÄꤹ¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¤³¤È¤ËÃí°Õ¡£ +.\"O The array must contain a terminating null wide character, unless a +.\"O precision is given and it is so small that the number of bytes written +.\"O exceeds it before the end of the array is reached. +ÀºÅÙ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢¤µ¤é¤Ë½ÐÎϤ¬ÇÛÎó¤ÎËöÈø¤Ë㤹¤ëÁ°¤Ë½ÐÎϥХ¤¥È¿ô¤¬ +ÀºÅÙ¤ÎÃͤòĶ¤¨¤ë¾ì¹ç¤À¤±¤Ï¡¢ÇÛÎó¤Ï NULL ¥ï¥¤¥Éʸ»ú¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤â¤è¤¤¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢É¬¤ºÇÛÎó¤Ï NULL ¥ï¥¤¥Éʸ»ú¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B C +.\"O (Not in C99, but in SUSv2.) +.\"O Synonym for +.\"O .BR lc . +.\"O Don't use. +(C99 ¤Ë¤Ï¤Ê¤¤¤¬ SUSv2 ¤Ë¤Ï¤¢¤ë) +.B lc +¤ÈƱ¤¸¡£»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.B S +.\"O (Not in C99, but in SUSv2.) +.\"O Synonym for +.\"O .BR ls . +.\"O Don't use. +(C99 ¤Ë¤Ï¤Ê¤¤¤¬ SUSv2 ¤Ë¤Ï¤¢¤ë) +.B ls +¤ÈƱ¤¸¡£»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.B p +.\"O The +.\"O .I "void *" +.\"O pointer argument is printed in hexadecimal (as if by +.\"O .B %#x +.\"O or +.\"O .BR %#lx ). +.I "void *" +¥Ý¥¤¥ó¥¿°ú¤­¿ô¤ò +.RB ( %#x +¤ä +.BR %#lx +¤Î¤è¤¦¤Ê) 16 ¿Ê¿ô¤Ç½ÐÎϤ¹¤ë¡£ +.TP +.B n +.\"O The number of characters written so far is stored into the integer +.\"O indicated by the +.\"O .I "int *" +.\"O (or variant) pointer argument. +.\"O No argument is converted. +¤³¤ì¤Þ¤Ç¤Ë½ÐÎϤµ¤ì¤¿Ê¸»ú¿ô¤ò +.I "int *" +(¤Þ¤¿¤ÏÎà»÷¤Î·¿) ¤Î¥Ý¥¤¥ó¥¿°ú¤­¿ô¤¬»Ø¤¹À°¿ô¤ËÊݸ¤¹¤ë¡£ +°ú¤­¿ô¤ÎÊÑ´¹¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +.TP +.B m +.\"O (Glibc extension.) +.\"O Print output of +.\"O .IR strerror(errno) . +.\"O No argument is required. +(glibc ¤Ç¤Î³ÈÄ¥) +.I strerror(errno) +¤Î½ÐÎϤòɽ¼¨¤¹¤ë¡£°ú¤­¿ô¤ÏɬÍפʤ¤¡£ +.TP +.B % +.\"O A \(aq%\(aq is written. +.\"O No argument is converted. +.\"O The complete conversion +.\"O specification is \(aq%%\(aq. +\(aq%\(aq ʸ»ú¤ò½ÐÎϤ¹¤ë¡£ÊÑ´¹¤µ¤ì¤ë°ú¤­¿ô¤Ï̵¤¤¡£ +ÊÑ´¹»ØÄêÁ´ÂΤò½ñ¤¯¤È "%%" ¤È¤Ê¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The +.\"O .BR fprintf (), +.\"O .BR printf (), +.\"O .BR sprintf (), +.\"O .BR vprintf (), +.\"O .BR vfprintf (), +.\"O and +.\"O .BR vsprintf () +.\"O functions conform to C89 and C99. +.BR fprintf (), +.BR printf (), +.BR sprintf (), +.BR vprintf (), +.BR vfprintf (), +.BR vsprintf () +´Ø¿ô¤Ï¡¢C89 ¤È C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.\"O The +.\"O .BR snprintf () +.\"O and +.\"O .BR vsnprintf () +.\"O functions conform to C99. +.BR snprintf () +¤È +.BR vsnprintf () +¤Ï C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.PP +.\"O Concerning the return value of +.\"O .BR snprintf (), +.\"O SUSv2 and C99 standard contradict each other: when +.\"O .BR snprintf () +.\"O is called with +.\"O .IR size =0 +.\"O then SUSv2 stipulates an unspecified return value less than 1, +.\"O while C99 allows +.\"O .I str +.\"O to be NULL in this case, and gives the return value (as always) +.\"O as the number of characters that would have been written in case +.\"O the output string has been large enough. +.BR snprintf () +¤ÎÊÖ¤êÃͤò¸«¤ë¤È¡¢ +SUSv2 ¤È C99 ɸ½à¤Ï¸ß¤¤¤ËÌ·½â¤·¤Æ¤¤¤ë¡£ +SUSv2 ¤Ç¤Ï¡¢ +.BR snprintf () +¤¬ +.IR size =0 +¤Ç¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢ 1 ̤Ëþ¤ÎÃͤò²¿¤«ÊÖ¤êÃͤȤ¹¤ë¤è¤¦¤Ëµ¬Äꤷ¤Æ¤¤¤ë¡£ +°ìÊý C99 ¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤Ê¾ì¹ç +.I str +¤ò NULL ¤È¤·¡¢ÊÖ¤êÃͤȤ·¤Æ (Ä̾ïÄ̤ê) ½ÐÎϥХåե¡¤¬½½Ê¬¤ÊÂ礭¤µ¤¬ +¤¢¤Ã¤¿¾ì¹ç¤Ë½ÐÎϤµ¤ì¤ë¤Ç¤¢¤í¤¦Ê¸»ú¿ô¤òÊÖ¤¹¡£ +.PP +.\"O Linux libc4 knows about the five C standard flags. +.\"O It knows about the length modifiers \fBh\fP, \fBl\fP, \fBL\fP, +.\"O and the conversions +.\"O \fBc\fP, \fBd\fP, \fBe\fP, \fBE\fP, \fBf\fP, \fBF\fP, +.\"O \fBg\fP, \fBG\fP, \fBi\fP, \fBn\fP, \fBo\fP, \fBp\fP, +.\"O \fBs\fP, \fBu\fP, \fBx\fP, and \fBX\fP, +.\"O where \fBF\fP is a synonym for \fBf\fP. +Linux libc4 ¤Ç¤Ï¡¢ 5 ¤Ä¤Î C ɸ½à¤Î¥Õ¥é¥°¡¢ +Ťµ½¤¾þ»Ò \fBh\fP, \fBl\fP, \fBL\fP¡¢ÊÑ´¹ +\fBc\fP, \fBd\fP, \fBe\fP, \fBE\fP, \fBf\fP, \fBF\fP, +\fBg\fP, \fBG\fP, \fBi\fP, \fBn\fP, \fBo\fP, \fBp\fP, +\fBs\fP, \fBu\fP, \fBx\fP, \fBX\fP +¤¬»È¤¨¤ë¡£ +⤷ \fBF\fP ¤Ï \fBf\fP ¤ÈƱµÁ¤Ç¤¢¤ë¡£ +.\"O Additionally, it accepts \fBD\fP, \fBO\fP, and \fBU\fP as synonyms +.\"O for \fBld\fP, \fBlo\fP, and \fBlu\fP. +.\"O (This is bad, and caused serious bugs later, when +.\"O support for \fB%D\fP disappeared.) +.\"O No locale-dependent radix character, +.\"O no thousands' separator, no NaN or infinity, no "%m$" and "*m$". +¤Þ¤¿¡¢ \fBD\fP, \fBO\fP, and \fBU\fP ¤ò \fBld\fP, \fBlo\fP, and \fBlu\fP +¤ÈƱ¤¸¤â¤Î¤È¤·¤Æ»È¤¨¤ë +(¤³¤ì¤Ï¤Þ¤º¤¤»ÅÍͤǡ¢ ¸å¤Ë \fB%D\fP ¤ÎÂбþ¤¬ÂǤÁÀÚ¤é¤ì¤¿»þ¤Ë¿¼¹ï¤Ê¥Ð¥°¤ò +°ú¤­µ¯¤³¤·¤¿)¡£¥í¥±¡¼¥ë°Í¸¤Î¾®¿ôÅÀ¡¢1000 ¶èÀڤꡢ NaN ¤È̵¸Â¡¢ +"%m$" ¤È "*m$" ¤Ï»È¤¨¤Ê¤¤¡£ +.PP +.\"O Linux libc5 knows about the five C standard flags and the \(aq flag, +.\"O locale, "%m$" and "*m$". +.\"O It knows about the length modifiers \fBh\fP, \fBl\fP, \fBL\fP, +.\"O \fBZ\fP, and \fBq\fP, but accepts \fBL\fP and \fBq\fP +.\"O both for \fIlong double\fP and for \fIlong long int\fP (this is a bug). +Linux libc5 ¤Ç¤Ï¡¢ 5 ¤Ä¤Î C ɸ½à¤Î¥Õ¥é¥°¤È \(aq ¥Õ¥é¥°¡¢¥í¥±¡¼¥ë¡¢ +"%m$" ¤È "*m$" ¤¬»È¤¨¤ë¡£ +¤Þ¤¿¡¢Ä¹¤µ½¤¾þ»Ò \fBh\fP, \fBl\fP, \fBL\fP, \fBZ\fP, iand \fBq\fP ¤¬»È¤¨¤ë¤¬¡¢ +\fBL\fP ¤È \fBq\fP ¤ÏξÊý¤È¤â +\fIlong double\fP ¤È \fIlong long int\fP ¤ËÂбþ¤·¤Æ¤¤¤ë (¤³¤ì¤Ï¥Ð¥°¤Ç¤¢¤ë)¡£ +.\"O It no longer recognizes \fBF\fP, \fBD\fP, \fBO\fP, and \fBU\fP, +.\"O but adds the conversion character +.\"O .BR m , +.\"O which outputs +.\"O .IR strerror(errno) . +¸½ºß¤Ç¤ÏÊÑ´¹ \fBF\fP, \fBD\fP, \fBO\fP, \fBU\fP ¤Ïǧ¼±¤µ¤ì¤Ê¤¤¤¬¡¢ÊÑ´¹Ê¸»ú +.B m +¤¬Äɲ䵤줿¡£¤³¤ì¤Ï +.I strerror(errno) +¤ò½ÐÎϤ¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.PP +.\"O glibc 2.0 adds conversion characters \fBC\fP and \fBS\fP. +glibc 2.0 ¤Ç¤Ï¡¢ÊÑ´¹Ê¸»ú \fBC\fP ¤È \fBS\fP ¤¬Äɲ䵤줿¡£ +.PP +.\"O glibc 2.1 adds length modifiers \fBhh\fP, \fBj\fP, \fBt\fP, and \fBz\fP +.\"O and conversion characters \fBa\fP and \fBA\fP. +glibc 2.1 ¤Ç¤Ï¡¢Ä¹¤µ½¤¾þ»Ò \fBhh\fP, \fBj\fP, \fBt\fP, \fBz\fP +¤ÈÊÑ´¹Ê¸»ú \fBa\fP, \fBA\fP ¤¬Äɲ䵤줿¡£ +.PP +.\"O glibc 2.2 adds the conversion character \fBF\fP with C99 semantics, +.\"O and the flag character \fBI\fP. +glibc 2.2 ¤Ç¤Ï¡¢ C99 ¤Çµ¬Äꤵ¤ì¤¿°ÕÌ£¤Ç¤ÎÊÑ´¹Ê¸»ú \fBF\fP ¤È +¥Õ¥é¥°Ê¸»ú \fBI\fP ¤¬Äɲ䵤줿¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Some programs imprudently rely on code such as the following +.\"O +.\"O sprintf(buf, "%s some further text", buf); +.\"O +.\"O to append text to +.\"O .IR buf . +¥Æ¥­¥¹¥È¤ò +.I buf +¤ËÄɲ乤ë¤Î¤Ë¡¢·ÚΨ¤Ë¤â¼¡¤Î¤è¤¦¤Ê¥³¡¼¥É¤ò»È¤Ã¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤¬¤¢¤ë¡£ + + sprintf(buf, "%s some further text", buf); + +.\"O However, the standards explicitly note that the results are undefined +.\"O if source and destination buffers overlap when calling +.\"O .BR sprintf (), +.\"O .BR snprintf (), +.\"O .BR vsprintf (), +.\"O and +.\"O .BR vsnprintf (). +¤·¤«¤·¤Ê¤¬¤é¡¢É¸½àµ¬³Ê¤Ç¤Ï¡¢ +.BR sprintf (), +.BR snprintf (), +.BR vsprintf (), +.BR vsnprintf () +¤Î¸Æ¤Ó½Ð¤·¤Ë¤ª¤¤¤Æ¡¢¥³¥Ô¡¼¸µ¤È¥³¥Ô¡¼Àè¤Î¥Ð¥Ã¥Õ¥¡¤¬½Å¤Ê¤Ã¤Æ¤¤¤¿¾ì¹ç¤Î +·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¡¢¤ÈÌÀµ­¤µ¤ì¤Æ¤¤¤ë¡£ +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=7075 +.\"O Depending on the version of +.\"O .BR gcc (1) +.\"O used, and the compiler options employed, calls such as the above will +.\"O .B not +.\"O produce the expected results. +»ÈÍѤ¹¤ë +.BR gcc (1) +¤Î¥Ð¡¼¥¸¥ç¥ó¤ä»ØÄꤷ¤¿¥³¥ó¥Ñ¥¤¥é¤Î¥ª¥×¥·¥ç¥ó¼¡Âè¤Ç¤Ï¡¢ +¾åµ­¤Î¤è¤¦¤Ê¸Æ¤Ó½Ð¤·¤Ç¡¢´üÂÔ¤·¤¿·ë²Ì¤¬ÆÀ¤é¤ì¡Ö¤Ê¤¤¡×¤³¤È¤¬¤¢¤ë¡£ + +.\"O The glibc implementation of the functions +.\"O .BR snprintf () +.\"O and +.\"O .BR vsnprintf () +.\"O conforms to the C99 standard, that is, behaves as described above, +.\"O since glibc version 2.1. +.\"O Until glibc 2.0.6 they would return \-1 +.\"O when the output was truncated. +glibc ¤Î +.BR snprintf () +¤È +.BR vsnprintf () +¤Î¼ÂÁõ¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Ï C99 ɸ½à¤Ë½àµò¤·¤Æ¤ª¤ê¡¢ +¾åµ­¤ÎÄ̤ê¤ÎÆ°ºî¤ò¤¹¤ë¡£ +glibc 2.0.6 ¤Þ¤Ç¤Ï¡¢½ÐÎϤ¬ÀÚ¤êµÍ¤á¤é¤ì¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.\"O .\" .SH HISTORY +.\" .SH Îò»Ë +.\"O .\" Unix V7 defines the three routines +.\"O .\" .BR printf (), +.\"O .\" .BR fprintf (), +.\"O .\" .BR sprintf (), +.\"O .\" and has the flag \-, the width or precision *, the length modifier l, +.\"O .\" and the conversions doxfegcsu, and also D,O,U,X as synonyms for ld,lo,lu,lx. +.\" Unix V7 ¤Ç¤Ï +.\" .BR printf (), +.\" .BR fprintf (), +.\" .BR sprintf () +.\" ¤Î 3 ¤Ä¤Î´Ø¿ô¤È¡¢¥Õ¥é¥° \-¡¢Éý¤ÈÀºÅ٤ǤΠ*¡¢Ä¹¤µ½¤¾þ»Ò l¡¢ +.\" ÊÑ´¹ doxfegcsu¡¢¤½¤·¤Æ ld,ld,lu,lx ¤ÎƱµÁ¸ì¤È¤·¤Æ D,O,U,X ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .\" This is still true for 2.9.1BSD, but 2.10BSD has the flags +.\"O .\" #, + and and no longer mentions D,O,U,X. +.\" 2.9.1BSD ¤Ç¤â¤³¤ì¤ÏƱ¤¸¤À¤Ã¤¿¤¬¡¢ 2.10BSD ¤Ç¤Ï +.\" ¥Õ¥é¥° #, +, ¶õÇò¤¬Äɲ䵤졢 D,O,U,X ¤Ë¤Ä¤¤¤Æ¤Ïµ­ºÜ¤µ¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£ +.\"O .\" 2.11BSD has +.\"O .\" .BR vprintf (), +.\"O .\" .BR vfprintf (), +.\"O .\" .BR vsprintf (), +.\"O .\" and warns not to use D,O,U,X. +.\" 2.11BSD ¤Ç¤Ï +.\" .BR vprintf (), +.\" .BR vfprintf (), +.\" .BR vsprintf () +.\" ¤¬Äɲ䵤졢 D,O,U,X ¤ò»È¤ï¤Ê¤¤¤è¤¦¤Ë·Ù¹ð¤µ¤ì¤¿¡£ +.\"O .\" 4.3BSD Reno has the flag 0, the length modifiers h and L, +.\"O .\" and the conversions n, p, E, G, X (with current meaning) +.\"O .\" and deprecates D,O,U. +.\" 4.3BSD Reno ¤Ç¤Ï¥Õ¥é¥° 0¡¢Ä¹¤µ½¤¾þ»Ò h ¤È L¡¢ +.\" ÊÑ´¹ n, p, E, G, (¸½ºß¤Î°ÕÌ£¤Ç¤Î) X ¤¬Äɲ䵤졢 +.\" D,O,U ¤ÏÈó¿ä¾©°·¤¤¤È¤Ê¤Ã¤¿¡£ +.\"O .\" 4.4BSD introduces the functions +.\"O .\" .BR snprintf () +.\"O .\" and +.\"O .\" .BR vsnprintf (), +.\"O .\" and the length modifier q. +.\" 4.4BSD ¤Ç¤Ï¡¢´Ø¿ô +.\" .BR snprintf ()¤È +.\" .BR vsnprintf ()¡¢ +.\" Ťµ½¤¾þ»Ò q ¤¬Æ³Æþ¤µ¤ì¤¿¡£ +.\"O .\" FreeBSD also has functions +.\"O .\" .BR asprintf () +.\"O .\" and +.\"O .\" .BR vasprintf (), +.\"O .\" that allocate a buffer large enough for +.\"O .\" .BR sprintf (). +.\" FreeBSD ¤Ç¤Ï¡¢ +.\" .BR sprintf () +.\" ¤Î¤¿¤á¤Ë½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¤ò³ÎÊݤ¹¤ë +.\" .BR asprintf () +.\" ¤È +.\" .BR vasprintf () +.\" ¤¬Äɲ䵤ì¤Æ¤¤¤ë¡£ +.\"O .\" In glibc there are functions +.\"O .\" .BR dprintf () +.\"O .\" and +.\"O .\" .BR vdprintf () +.\"O .\" that print to a file descriptor instead of a stream. +.\" glibc ¤Ë¤Ï¡¢´Ø¿ô +.\" .BR dprintf (), +.\" .BR vdprintf () +.\" ¤¬¤¢¤ê¡¢¤³¤ì¤é¤Ï¥¹¥È¥ê¡¼¥à¤Ç¤Ï¤Ê¤¯¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë½ÐÎϤ¹¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Because +.\"O .BR sprintf () +.\"O and +.\"O .BR vsprintf () +.\"O assume an arbitrarily long string, callers must be careful not to overflow +.\"O the actual space; this is often impossible to assure. +.\"O Note that the length +.\"O of the strings produced is locale-dependent and difficult to predict. +.BR sprintf () +¤È +.BR vsprintf () +¤Ï¾¡¼ê¤Ë½½Ê¬¤ËŤ¤Ê¸»úÎóÎΰ褬¤¢¤ë¤È²¾Äꤹ¤ë¤Î¤Ç¡¢¸Æ¤Ó½Ð¤·Â¦¤Ï +¼ÂºÝ¤ÎÎΰ褫¤é¤¢¤Õ¤ì¤Ê¤¤¤è¤¦¤ËÃí°Õ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤·¤«¤·¡¢¤³¤ì¤òÊݾڤ¹¤ë¤³¤È¤¬ÉÔ²Äǽ¤Ê¾ì¹ç¤¬Â¿¤¤¡£ +À¸À®¤µ¤ì¤ëʸ»úÎó¤ÎŤµ¤Ï¥í¥±¡¼¥ë°Í¸¤Ç¤¢¤ê¡¢Í½Â¬¤¬Æñ¤·¤¤¤³¤È¤ËÃí°Õ¡£ +.\"O Use +.\"O .BR snprintf () +.\"O and +.\"O .BR vsnprintf () +.\"O instead (or +.\"O .BR asprintf (3) +.\"O and +.\"O .BR vasprintf (3)). +Âå¤ï¤ê¤Ë +.BR snprintf () +¤È +.BR vsnprintf () +(¤Þ¤¿¤Ï +.BR asprintf (3) +¤È +.BR vasprintf (3)) +¤ò»È¤¦¤³¤È¡£ +.PP +.\"O Linux libc4.[45] does not have a +.\"O .BR snprintf (), +.\"O but provides a libbsd that contains an +.\"O .BR snprintf () +.\"O equivalent to +.\"O .BR sprintf (), +.\"O that is, one that ignores the +.\"O .I size +.\"O argument. +Linux libc4.[45] ¤Ë¤Ï +.BR snprintf () +¤Ï¤Ê¤¤¤¬¡¢ libbsd ¤¬Ä󶡤µ¤ì¤Æ¤ª¤ê¡¢ +¤½¤ÎÃæ¤Ë¤Ï +.BR sprintf () +¤ÈÅù²Á¤Ê (¤Ä¤Þ¤ê +.I size +°ú¤­¿ô¤ò̵»ë¤¹¤ë) +.BR snprintf () +¤¬¤¢¤ë¡£ +.\"O Thus, the use of +.\"O .BR snprintf () +.\"O with early libc4 leads to serious security problems. +¤·¤¿¤¬¤Ã¤Æ¡¢½é´ü¤Î libc4 ¤Ç +.BR snprintf () +¤ò»È¤¦¤È¡¢¿¼¹ï¤Ê¥»¥­¥å¥ê¥Æ¥£ÌäÂê¤ò°ú¤­µ¯¤³¤¹¤³¤È¤¬¤¢¤ë¡£ +.PP +.\"O Code such as +.\"O .BI printf( foo ); +.\"O often indicates a bug, since +.\"O .I foo +.\"O may contain a % character. +.\"O If +.\"O .I foo +.\"O comes from untrusted user input, it may contain \fB%n\fP, causing the +.\"O .BR printf () +.\"O call to write to memory and creating a security hole. +.BI printf( foo ); +¤Î¤è¤¦¤Ê¥³¡¼¥É¤Ï¤·¤Ð¤·¤Ð¥Ð¥°¤ò°ú¤­µ¯¤³¤¹¡£ +¤Ê¤¼¤Ê¤é +.I foo +¤Ë % ʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤ë¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.I foo +¤¬¿®Íê¤Ç¤­¤Ê¤¤¥æ¡¼¥¶¡¼ÆþÎϤ«¤éºî¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤½¤ÎÃæ¤Ë \fB%n\fP ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤³¤È¤¬¤¢¤ê¡¢ +.BR printf () +¸Æ¤Ó½Ð¤·»þ¤Ë¥á¥â¥ê¤Ø¤Î½ñ¤­¹þ¤ß¤¬µ¯¤³¤ê¡¢ +¥»¥­¥å¥ê¥Æ¥£¡¼¥Û¡¼¥ë¤òºî¤ë¤³¤È¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\".PP +.\".\"O Some floating-point conversions under early libc4 +.\".\"O caused memory leaks. +.\"½é´ü¤Î libc4 ¤Ç¤Î¼Â¿ôÊÑ´¹¤Ë¤Ï¥á¥â¥ê¥ê¡¼¥¯¤ò°ú¤­µ¯¤³¤¹¤³¤È¤¬¤¢¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.if \w'\*(Pi'=0 .ds Pi pi +.\"O To print \*(Pi to five decimal places: +\*(Pi ¤ò 5 ·å¤Ç½ÐÎϤ¹¤ë¡£ +.in +4n +.nf + +#include +#include +fprintf(stdout, "pi = %.5f\en", 4 * atan(1.0)); +.fi +.in +.PP +.\"O To print a date and time in the form "Sunday, July 3, 10:02", +.\"O where +.\"O .I weekday +.\"O and +.\"O .I month +.\"O are pointers to strings: +ÆüÉդȻþ´Ö¤ò "Sunday, July 3, 10:02" ¤Î·Á¼°¤Ç½ÐÎϤ¹¤ë¡£ +.RI ( weekday +¤È +.I month +¤Ïʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë) +.in +4n +.nf + +#include +fprintf(stdout, "%s, %s %d, %.2d:%.2d\en", + weekday, month, day, hour, min); +.fi +.in +.PP +.\"O Many countries use the day-month-year order. +.\"O Hence, an internationalized version must be able to print +.\"O the arguments in an order specified by the format: +Æü - ·î - ǯ ¤Î½ç½ø¤Çɽ¼¨¤ò¹Ô¤¦¹ñ¤â¿¤¤¡£ +½¾¤Ã¤Æ¡¢¹ñºÝÈǤǤϽñ¼°¤Ç»ØÄꤵ¤ì¤¿½çÈÖ¤Ç +°ú¤­¿ô¤òɽ¼¨¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.in +4n +.nf + +#include +fprintf(stdout, format, + weekday, month, day, hour, min); + +.fi +.in +.\"O where +.\"O .I format +.\"O depends on locale, and may permute the arguments. +.\"O With the value: +.I format +¤Ï¥í¥±¡¼¥ë¤Ë°Í¸¤·¤Æ¤ª¤ê¡¢°ú¤­¿ô¤Î½çÈÖ¤òÊѤ¨¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.I format +¤¬ +.in +4n +.nf + +"%1$s, %3$d. %2$s, %4$d:%5$.2d\en" + +.fi +.in +.\"O one might obtain "Sonntag, 3. Juli, 10:02". +¤Ç¤¢¤ì¤Ð¡¢ "Sonntag, 3. Juli, 10:02" ¤È¤¤¤¦·ë²Ì¤Ë¤Ê¤ë¡£ +.PP +.\"O To allocate a sufficiently large string and print into it +.\"O (code correct for both glibc 2.0 and glibc 2.1): +½½Ê¬¤ËÂ礭¤Êʸ»úÎóÎΰè¤ò³ÎÊݤ·¤Æ¡¢¤½¤³¤Ë¥á¥Ã¥»¡¼¥¸¤ò³ÊǼ¤¹¤ë¤Ë¤Ï +(glibc 2.0 ¤È glibc 2.1 ¤ÎξÊý¤ÇÀµ¤·¤¯Æ°ºî¤¹¤ë¥³¡¼¥É): +.nf + +#include +#include +#include +char * +make_message(const char *fmt, ...) +{ + /* Guess we need no more than 100 bytes. */ + int n, size = 100; + char *p, *np; + va_list ap; + + if ((p = malloc(size)) == NULL) + return NULL; + + while (1) { + /* Try to print in the allocated space. */ + va_start(ap, fmt); + n = vsnprintf(p, size, fmt, ap); + va_end(ap); + /* If that worked, return the string. */ + if (n > \-1 && n < size) + return p; + /* Else try again with more space. */ + if (n > \-1) /* glibc 2.1 */ + size = n+1; /* precisely what is needed */ + else /* glibc 2.0 */ + size *= 2; /* twice the old size */ + if ((np = realloc (p, size)) == NULL) { + free(p); + return NULL; + } else { + p = np; + } + } +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR printf (1), +.BR asprintf (3), +.BR dprintf (3), +.BR scanf (3), +.BR setlocale (3), +.BR wcrtomb (3), +.BR wprintf (3), +.BR locale (5) diff --git a/draft/man3/profil.3 b/draft/man3/profil.3 new file mode 100644 index 00000000..4819f0a0 --- /dev/null +++ b/draft/man3/profil.3 @@ -0,0 +1,143 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 Fri Jun 23 01:35:19 1995 Andries Brouwer +.\" (prompted by Bas V. de Bakker ) +.\" Corrected (and moved to man3), 980612, aeb +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated San Feb 23 20:40:50 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Sun Jun 21 17:30:21 JST 1998 +.\" by HANATAKA Shinya +.\" Updated & Modified Thu Feb 17 00:57:49 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: profile ¥×¥í¥Õ¥¡¥¤¥ë +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: implement ¼ÂÁõ +.\"WORD: library ¥é¥¤¥Ö¥é¥ê +.\"WORD: core ¥á¥â¥ê +.\"WORD: virtual ²¾ÁÛ +.\"WORD: word ¥ï¡¼¥É +.\"WORD: increment ¥¤¥ó¥¯¥ê¥á¥ó¥È +.\"WORD: core dump ¥³¥¢¡¦¥À¥ó¥× +.\" +.TH PROFIL 3 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O profil \- execution time profile +profil \- ¼Â¹Ô»þ´Ö¥×¥í¥Õ¥¡¥¤¥ë (profile) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int profil(unsigned short *" buf ", size_t " bufsiz \ +", size_t " offset ", unsigned int " scale ); +.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 profil (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This routine provides a means to find out in what areas your program +.\"O spends most of its time. +.\"O The argument +.\"O .I buf +.\"O points to +.\"O .I bufsiz +.\"O bytes of core. +.\"O Every virtual 10 milliseconds, the user's program counter (PC) +.\"O is examined: +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥×¥í¥°¥é¥à¤Î¤É¤³¤ÎÉôʬ¤Ç»þ´Ö¤òÈñ¤ä¤·¤Æ¤¤¤ë¤«¤òÄ´¤Ù¤ë +¼êÃʤòÄ󶡤¹¤ë¡£°ú¤­¿ô +.I buf +¤Ï +.I bufsiz +¥Ð¥¤¥È¤Î¥á¥â¥ê¤ò»Ø¤·¤Æ¤¤¤ë¡£²¾ÁۤΠ10 ¥ß¥êÉ䴤Ȥˡ¢¥æ¡¼¥¶¡¼¤Î +¥×¥í¥°¥é¥à¡¦¥«¥¦¥ó¥¿¡¼ (PC) ¤¬¸¡ºº¤µ¤ì¤ë: +.\"O .I offset +.\"O is subtracted and the result is multiplied by +.\"O .I scale +.\"O and divided by 65536. +.I offset +¤¬°ú¤«¤ì¡¢¤½¤Î·ë²Ì¤¬ +.I scale +Çܤµ¤ì 65536 ¤Ç³ä¤é¤ì¤ë¡£ +.\"O If the resulting value is less than +.\"O .IR bufsiz , +.\"O then the corresponding entry in +.\"O .I buf +.\"O is incremented. +·ë²Ì¤¬ +.I bufsiz +¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ï +.I buf +¤ÎÂбþ¤¹¤ë¥¨¥ó¥È¥ê¤¬¥¤¥ó¥¯¥ê¥á¥ó¥È¤µ¤ì¤ë¡£ +.\"O If +.\"O .I buf +.\"O is NULL, profiling is disabled. +.I buf +¤¬ NULL ¤Ê¤é¤Ð¡¢¥×¥í¥Õ¥¡¥¤¥ë (profile) ¤Ï̵¸ú¤Ë¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O Zero is always returned. +¾ï¤Ë 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Similar to a call in SVr4 (but not POSIX.1-2001). +SVr4 ¤Î¥³¡¼¥ë¤Ë»÷¤Æ¤¤¤ë (¤·¤«¤· POSIX.1-2001 ¤Ç¤Ï¤Ê¤¤)¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O .BR profil () +.\"O cannot be used on a program that also uses +.\"O .B ITIMER_PROF +.\"O interval timers (see +.\"O .BR setitimer (2)). +.BR profil () +¤Ï +.B ITIMER_PROF +¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¡¼¤â»ÈÍѤ·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤǤ­¤Ê¤¤ +.RB ( setitimer (2) +»²¾È)¡£ + +.\"O True kernel profiling provides more accurate results. +.\"O Libc 4.4 contained a kernel patch providing a system call profil. +ËÜÅö¤Î¥«¡¼¥Í¥ë¡¦¥×¥í¥Õ¥¡¥¤¥ë¤Ï¤è¤êÀµ³Î¤Ê·ë²Ì¤òÍ¿¤¨¤ë¡£ +libc 4.4 ¤Ë¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë profil ¤òÄ󶡤¹¤ë¤¿¤á¤Î +¥«¡¼¥Í¥ë¥Ñ¥Ã¥Á¤¬´Þ¤Þ¤ì¤Æ¤¤¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR gprof (1), +.BR setitimer (2), +.BR sigaction (2), +.BR signal (2) diff --git a/draft/man3/program_invocation_name.3 b/draft/man3/program_invocation_name.3 new file mode 100644 index 00000000..55c9bed1 --- /dev/null +++ b/draft/man3/program_invocation_name.3 @@ -0,0 +1,96 @@ +.\" Copyright (C) 2006 Michael Kerrisk +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" 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) 2006 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-03-13, Akihiro MOTOKI +.\" +.TH INVOCATION_NAME 3 2006-04-29 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O program_invocation_name, program_invocation_short_name \- \ +.\"O obtain name used to invoke calling program +program_invocation_name, program_invocation_short_name \- \ +¥×¥í¥°¥é¥à¤Îµ¯Æ°¤Ë»È¤ï¤ì¤¿Ì¾Á°¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "extern char *" program_invocation_name ; +.BI "extern char *" program_invocation_short_name ; +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .I program_invocation_name +.\"O contains the name that was used to invoke the calling program. +.\"O This is the same as the value of +.\"O .I argv[0] +.\"O in +.\"O .IR main (), +.\"O with the difference that the scope of +.\"O .I program_invocation_name +.\"O is global. +.I program_invocation_name +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥°¥é¥à¤Îµ¯Æ°¤Ë»ÈÍѤµ¤ì¤¿Ì¾Á°¤òÊÝ»ý¤¹¤ë¡£ +ÆâÍÆ¤Ï +.IR main () +¤Î +.I argv[0] +¤ÎÃͤÈƱ¤¸¤À¤¬¡¢ +.I program_invocation_name +¤ÎÊý¤Ï¥¹¥³¡¼¥×¤¬¥°¥í¡¼¥Ð¥ë¤Ç¤¢¤ëÅÀ¤¬°Û¤Ê¤ë¡£ + +.\"O .I program_invocation_short_name +.\"O contains the basename component of name that was used to invoke +.\"O the calling program. +.\"O That is, it is the same value as +.\"O .IR program_invocation_name , +.\"O with all text up to and including the final slash (/), if any, removed. +.I program_invocation_short_name +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥°¥é¥à¤Îµ¯Æ°¤Ë»ÈÍѤµ¤ì¤¿Ì¾Á°¤Î basename Éôʬ¤ò +ÊÝ»ý¤¹¤ë¡£¤Ä¤Þ¤ê¡¢¤³¤ÎÊÑ¿ô¤ÎÆâÍƤϡ¢ºÇ¸å¤Î¥¹¥é¥Ã¥·¥å (/) ¤È¤½¤ì¤è¤êÁ°¤Î +Éôʬ¤¬¤¢¤ë¾ì¹ç¡¢ +.I program_invocation_name +¤«¤é¤³¤ÎÉôʬ¤òºï½ü¤·¤¿¤â¤Î¤È¤Ê¤ë¡£ + +.\"O These variables are automatically initialized by the glibc run-time +.\"O startup code. +¤³¤ì¤é¤ÎÊÑ¿ô¤Ï glibc ¤Î¥é¥ó¥¿¥¤¥à¡¦¥¹¥¿¡¼¥È¥¢¥Ã¥×¡¦¥³¡¼¥É¤Ç +¼«Æ°Åª¤Ë½é´ü²½¤µ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These variables are GNU extensions, and should not be +.\"O used in programs intended to be portable. +¤³¤ì¤é¤ÎÊÑ¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢ +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ê¤¤¡£ +.\"O .SH NOTES +.SH È÷¹Í +.\"O The Linux-specific +.\"O .I /proc/[number]/cmdline +.\"O file provides access to similar information. +Linux Æȼ«¤Î¥Õ¥¡¥¤¥ë +.I /proc/[number]/cmdline +¤Ç¤âƱÍͤξðÊó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR proc (5), +.BR feature_test_macros (7) diff --git a/draft/man3/psignal.3 b/draft/man3/psignal.3 new file mode 100644 index 00000000..10fd6fae --- /dev/null +++ b/draft/man3/psignal.3 @@ -0,0 +1,95 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Fri Dec 26 13:19:15 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. +.\" +.\" 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:45:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" FIXME glibc 2.10 adds psiginfo(), specified in SUSv4. This function +.\" should be documented, probably on this page. +.TH PSIGNAL 3 2008-08-21 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O psignal \- print signal message +psignal \- ¥·¥°¥Ê¥ë¥á¥Ã¥»¡¼¥¸¤òɽ¼¨ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void psignal(int " sig ", const char *" s ); +.sp +.BI "extern const char *const " sys_siglist []; +.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 psignal (): +_SVID_SOURCE || _BSD_SOURCE +.br +.IR sys_siglist : +_BSD_SOURCE +\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR psignal () +.\"O function displays a message on \fIstderr\fP +.\"O consisting of the string \fIs\fP, a colon, a space, and a string +.\"O describing the signal number \fIsig\fP. +.\"O If \fIsig\fP is invalid, +.\"O the message displayed will indicate an unknown signal. +.BR psignal () +´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP¡¢¥³¥í¥ó¡¢¥¹¥Ú¡¼¥¹¡¢ +¥·¥°¥Ê¥ëÈÖ¹æ \fIsig\fP ¤òÀâÌÀ¤¹¤ëʸ»úÎ󤫤鹽À®¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¤ò +\fIstderr\fP ¤Ëɽ¼¨¤¹¤ë¡£¤â¤· \fIsig\fP ¤¬ÉÔÀµ¤Ê¤é¤Ð¡¢É½¼¨¤µ¤ì¤ë +¥á¥Ã¥»¡¼¥¸¤Ï̤ÃΤΥ·¥°¥Ê¥ë¤ò¼¨¤¹¡£ +.PP +.\"O The array \fIsys_siglist\fP holds the signal description strings +.\"O indexed by signal number. +ÇÛÎó \fIsys_siglist\fP ¤Ï¥·¥°¥Ê¥ë¤òÀâÌÀ¤¹¤ëʸ»úÎó¤òÊÝ»ý¤·¤Æ¤ª¤ê¡¢ +ÇÛÎó¤Ø¤Î¥¢¥¯¥»¥¹¤Ë¤Ï¥·¥°¥Ê¥ëÈÖ¹æ¤òź¤¨»ú¤È¤·¤ÆÍѤ¤¤ë»ö¤¬¤Ç¤­¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR psignal () +.\"O function returns no value. +.BR psignal () +´Ø¿ô¤Ï¡¢ÃͤòÊÖ¤µ¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2008, 4.3BSD. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR perror (3), +.BR strsignal (3) diff --git a/draft/man3/ptsname.3 b/draft/man3/ptsname.3 new file mode 100644 index 00000000..b90267ea --- /dev/null +++ b/draft/man3/ptsname.3 @@ -0,0 +1,169 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This page is in the public domain. - aeb +.\" +.\" 2004-12-17, mtk, added description of ptsname_r() + ERRORS +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-08, Akihiro MOTOKI +.\" Updated 2005-02-27, Akihiro MOTOKI +.\" +.\"WORD: pseudo-terminal µ¼»÷üËö +.\" +.TH PTSNAME 3 2008-09-03 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O ptsname, ptsname_r \- get the name of the slave pseudo-terminal +.SH ̾Á° +ptsname, ptsname_r \- ¥¹¥ì¡¼¥Öµ¼»÷üËö¤Î̾Á°¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "char *ptsname(int " fd ");" +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int ptsname_r(int " fd ", char *" buf ", size_t " buflen ");" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR ptsname () +.\"O function returns the name of the slave pseudo-terminal (pty) device +.\"O corresponding to the master referred to by +.\"O .IR fd . +.BR ptsname () +´Ø¿ô¤Ï +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥Þ¥¹¥¿µ¼»÷üËö (pts) ¥Ç¥Ð¥¤¥¹¤ËÂбþ¤¹¤ë +¥¹¥ì¡¼¥Öµ¼»÷üËö¥Ç¥Ð¥¤¥¹¤Î̾Á°¤òÊÖ¤¹¡£ + +.\"O The +.\"O .BR ptsname_r () +.\"O function is the reentrant equivalent of +.\"O .BR ptsname (). +.\"O It returns the name of the slave pseudo-terminal device as a +.\"O null-terminated string in the buffer pointed to by +.\"O .IR buf . +.\"O The +.\"O .I buflen +.\"O argument specifies the number of bytes available in +.\"O .IR buf . +.BR ptsname_r () +´Ø¿ô¤Ï +.BR ptsname () +¤Î¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢¥¹¥ì¡¼¥Öµ¿»÷üËö¥Ç¥Ð¥¤¥¹¤Î̾Á°¤ò¡¢ +NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Î·Á¤Ç +.I buf +¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.I buflen +°ú¤­¿ô¤Ë¤Ï +.I buf +¤Î¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR ptsname () +.\"O returns a pointer to a string in static storage which will be +.\"O overwritten by subsequent calls. +.\"O This pointer must not be freed. +.\"O On failure, a NULL pointer is returned. +À®¸ù¤Î¾ì¹ç¡¢ +.BR ptsname () +¤ÏÀÅŪµ­²±Îΰè¤Îʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Îµ­²±Îΰè¤Ï¤³¤Î¸å¤Î +.BR ptsname () +¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¡£ +¤³¤Î¥Ý¥¤¥ó¥¿¤ò free ¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ + +.\"O On success, +.\"O .BR ptsname_r () +.\"O returns 0. +.\"O On failure, a nonzero value is returned +.\"O and +.\"O .I errno +.\"O is set to indicate the error. +.\"O .\" In fact the errno value is also returned as the function +.\"O .\" result -- MTK, Dec 04 +À®¸ù¤Î¾ì¹ç¡¢ +.BR ptsname_r () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢0 °Ê³°¤ÎÃͤòÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£ +.\" ¼ÂºÝ¤Ë¤Ï¡¢errno ¤ÎÃͤ¬´Ø¿ô¤Î·ë²Ì¤ÎÊÖ¤êÃͤȤ·¤Æ¤âÊÖ¤µ¤ì¤ë¡£-- MTK, Dec 04 +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O .RB ( ptsname_r () +.\"O only) +.\"O .I buf +.\"O is NULL. +.RB ( ptsname_r () +¤Î¤ß) +.I buf +¤¬ NULL ¤Ç¤¢¤ë¡£ +.TP +.B ENOTTY +.\"O .I fd +.\"O does not refer to a pseudo-terminal master device. +.I fd +¤¬¥Þ¥¹¥¿µ¿»÷üËö¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ERANGE +.\"O .RB ( ptsname_r () +.\"O only) +.\"O .I buf +.\"O is too small. +.RB ( ptsname_r () +¤Î¤ß) +.I buf +¤¬¾®¤µ¤¹¤®¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR ptsname () +.\"O is provided in glibc since version 2.1. +.BR ptsname () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O .BR ptsname () +.\"O is part of the Unix98 pseudo-terminal support (see +.\"O .BR pts (4)). +.\"O This function is specified in POSIX.1-2001. +.BR ptsname () +¤Ï Unix98 µ¿»÷üËö»ÅÍͤΰìÉô¤Ç¤¢¤ë +.RB ( pts (4) +¤ò»²¾È¤Î¤³¤È)¡£¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +.\"O .BR ptsname_r () +.\"O is a Linux extension. +.\"O A version of this function is documented on Tru64 and HP-UX, but +.\"O on those implementations, \-1 is returned on error, with +.\"O .I errno +.\"O set to indicate the error. +.\"O Avoid using this function in portable programs. +.BR ptsname_r () +¤Ï Linux ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Îµ­ºÜ¤¬¤¢¤ë¤â¤Î¤È¤·¤Æ Tru64 ¤È HP-UX ¤¬¤¢¤ë¤¬¡¢ +¤³¤ì¤é¤Î OS ¤Ç¤Î¼ÂÁõ¤Ç¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î´Ø¿ô¤Î»ÈÍѤÏÈò¤±¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR grantpt (3), +.BR posix_openpt (3), +.BR ttyname (3), +.BR unlockpt (3), +.BR pts (4), +.BR feature_test_macros (7), +.BR pty (7) diff --git a/draft/man3/putenv.3 b/draft/man3/putenv.3 new file mode 100644 index 00000000..a3a71596 --- /dev/null +++ b/draft/man3/putenv.3 @@ -0,0 +1,176 @@ +.\" 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 +.\" Single UNIX Specification, Version 2 +.\" Modified Thu Apr 8 15:00:12 1993, David Metcalfe +.\" Modified Sat Jul 24 18:44:45 1993, Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Feb 14 21:47:50 1997 by Andries Brouwer (aeb@cwi.nl) +.\" 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 +.\" +.TH PUTENV 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O putenv \- change or add an environment variable +putenv \- ´Ä¶­ÊÑ¿ô¤ÎÊѹ¹¤Þ¤¿¤ÏÄɲà +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int putenv(char *" string ); +.\" Not: const char * +.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 putenv (): +_SVID_SOURCE || _XOPEN_SOURCE +\"O .SH DESCRIPTION +.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 ¤¬»Ø¤·¤Æ¤¤¤ëʸ»úÎó¤Ï´Ä¶­¤Î°ìÉô¤È¤Ê¤ë¤Î¤Ç¡¢ +ʸ»úÎó¤òÊѹ¹¤¹¤ë¤È´Ä¶­¤âÊѹ¹¤µ¤ì¤ë¡£ +.\"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 +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +.\"O Insufficient space to allocate new environment. +¿·¤·¤¤´Ä¶­¤ò³ä¤êÅö¤Æ¤ë¤Î¤Ë½½Ê¬¤Ê¶õ¤­¤¬¤Ê¤¤¡£ +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD. +.\"O .SH NOTES +.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 ¤Ç¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ï¤Ê¤¤¡£ +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 () +¤Ë¤è¤Ã¤Æ³ÎÊݤµ¤ì¤¿¤â¤Î¤Ê¤é¤Ð¡¢ +¤½¤ì¤Ï²òÊü¤µ¤ì¤ë¡£ +´Ä¶­ÊÑ¿ô¤½¤Î¤â¤Î¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¸Å¤¤µ­²±Îΰ褬²òÊü¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.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 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ +.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 ¤â¤½¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR clearenv (3), +.BR getenv (3), +.BR setenv (3), +.BR unsetenv (3), +.BR environ (7) diff --git a/draft/man3/putgrent.3 b/draft/man3/putgrent.3 new file mode 100644 index 00000000..e14a7c00 --- /dev/null +++ b/draft/man3/putgrent.3 @@ -0,0 +1,71 @@ +.\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Sat Aug 28 14:07:20 JST 2004 +.\" by Yuichi SATO +.\" +.TH PUTGRENT 3 2003-09-09 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O putgrent \- write a group database entry to a file +putgrent \- ¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¥¨¥ó¥È¥ê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int putgrent(const struct group *" grp ", FILE *" fp ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR putgrent () +.\"O function is the counterpart for +.\"O .BR fgetgrent (3). +.BR putgrent () +´Ø¿ô¤Ï +.BR fgetgrent (3) +¤ÎµÕ¤Ç¤¢¤ë¡£ +.\"O The function writes the content of the provided \fIstruct group\fP into the +.\"O file pointed to by +.\"O .IR fp . +¤³¤Î´Ø¿ô¤ÏÍ¿¤¨¤é¤ì¤¿ \fIstruct group\fP ¤ò +.I fp +¤Ç»Ø¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à¡£ +.\"O The list of group members must be NULL-terminated or NULL-initialized. +¥°¥ë¡¼¥×¥á¥ó¥Ð¤Î¥ê¥¹¥È¤Ï¡¢NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¤«¡¢ +NULL ¤Ç½é´ü²½¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.sp +.\"O The \fIstruct group\fP is defined as follows: +\fIstruct group\fP ¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.sp +.in +4n +.nf +struct group { +.\"O char *gr_name; /* group name */ +.\"O char *gr_passwd; /* group password */ +.\"O gid_t gr_gid; /* group ID */ +.\"O char **gr_mem; /* group members */ + char *gr_name; /* ¥°¥ë¡¼¥×̾ */ + char *gr_passwd; /* ¥°¥ë¡¼¥×¥Ñ¥¹¥ï¡¼¥É */ + gid_t gr_gid; /* ¥°¥ë¡¼¥× ID */ + char **gr_mem; /* ¥°¥ë¡¼¥×¥á¥ó¥Ð */ +}; +.fi +.in +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The function returns zero on success, and a nonzero value on error. +¤³¤Î´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ï 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is a GNU extension. +¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fgetgrent (3), +.BR getgrent (3), +.BR group (5), +.BR feature_test_macros (7) diff --git a/draft/man3/putpwent.3 b/draft/man3/putpwent.3 new file mode 100644 index 00000000..e8e0d408 --- /dev/null +++ b/draft/man3/putpwent.3 @@ -0,0 +1,100 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Thu Dec 18 17:43:46 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. +.\" +.\" 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:43:46 1993 by Rik Faith (faith@cs.unc.edu) +.TH PUTPWENT 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +putpwent \- ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤Î½ñ¤­¹þ¤ß +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int putpwent(const struct passwd *" p ", FILE *" stream ); +.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 putpwent (): +_SVID_SOURCE +.SH ÀâÌÀ +.BR putpwent () +´Ø¿ô¤Ï¡¢¹½Â¤ÂÎ \fIp\fP ¤«¤é¤Î¥Ñ¥¹¥ï¡¼¥É¥¨¥ó¥È¥ê¤ò +\fIstream\fP ¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à¡£ + +.PP +\fIpasswd\fP ¹½Â¤ÂΤϡ¢\fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct passwd { +.\"O char *pw_name; /* username */ +.\"O char *pw_passwd; /* user password */ +.\"O uid_t pw_uid; /* user ID */ +.\"O gid_t pw_gid; /* group ID */ +.\"O char *pw_gecos; /* real name */ +.\"O char *pw_dir; /* home directory */ +.\"O char *pw_shell; /* shell program */ + char *pw_name; /* ¥æ¡¼¥¶Ì¾ */ + char *pw_passwd; /* ¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É */ + uid_t pw_uid; /* ¥æ¡¼¥¶ ID */ + gid_t pw_gid; /* ¥°¥ë¡¼¥× ID */ + char *pw_gecos; /* ËÜ̾ */ + char *pw_dir; /* ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê */ + char *pw_shell; /* ¥·¥§¥ë¥×¥í¥°¥é¥à */ +}; +.fi +.in +.SH ÊÖ¤êÃÍ +.BR putpwent () +´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤ò¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï +\-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +̵¸ú¤Ê(NULL)°ú¿ô¤¬ÅϤµ¤ì¤¿¡£ +.SH ½àµò +SVr4. +.SH ´ØÏ¢¹àÌÜ +.BR endpwent (3), +.BR fgetpwent (3), +.BR getpw (3), +.BR getpwent (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR setpwent (3) diff --git a/draft/man3/puts.3 b/draft/man3/puts.3 new file mode 100644 index 00000000..2b31b08c --- /dev/null +++ b/draft/man3/puts.3 @@ -0,0 +1,201 @@ +.\" 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 18:42:59 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Wed Dec 24 12:33:40 JST 1997 +.\" by HIROFUMI Nishizuka +.\" Updated Fri Nov 2 JST 2001 by Kentaro Shirakata +.\" +.TH PUTS 3 1993-04-04 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fputc, fputs, putc, putchar, puts \- output of characters and strings +fputc, fputs, putc, putchar, puts \- ʸ»ú¤Èʸ»úÎó¤Î½ÐÎÏ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fputc(int " c ", FILE *" stream ); + +.BI "int fputs(const char *" "s" ", FILE *" "stream" ); + +.BI "int putc(int " c ", FILE *" stream ); + +.BI "int putchar(int " c ); + +.BI "int puts(const char *" "s" ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR fputc () +.\"O writes the character +.\"O .IR c , +.\"O cast to an +.\"O .IR "unsigned char" , +.\"O to +.\"O .IR stream . +.BR fputc () +¤Ï¡¢¥­¥ã¥é¥¯¥¿ +.I c +¤ò +.I "unsigned char" +¤Ë¥­¥ã¥¹¥È¤·¡¢ +.I stream +¤Ë½ñ¤­¹þ¤à¡£ +.PP +.\"O .BR fputs () +.\"O writes the string +.\"O .I s +.\"O to +.\"O .IR stream , +.\"O without its trailing +.\"O .BR \(aq\e0\(aq . +.BR fputs () +¤Ï¡¢Ê¸»úÎó +.I s +¤ò +.I stream +¤Ë½ñ¤­¹þ¤à¡£ +ʸ»úÎó¤Ë³¤¯ +.B \(aq\e0\(aq +¤Ï½ÐÎϤ·¤Ê¤¤¡£ +.PP +.\"O .BR putc () +.\"O is equivalent to +.\"O .BR fputc () +.\"O except that it may be implemented as a macro which evaluates +.\"O .I stream +.\"O more than once. +.BR putc () +¤Ï¡¢ +.I stream +¤ò°ìÅٰʾåɾ²Á¤¹¤ë¥Þ¥¯¥í¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤«¤âÃΤì¤Ê¤¤¤È¤¤¤¦ÅÀ¤ò½ü¤­¡¢ +.BR fputc () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.PP +.\"O .BI "putchar(" c ); +.\"O is equivalent to +.\"O .BI "putc(" c , stdout ). +.BI "putchar(" c ); +¤Ï¡¢ +.BI "putc(" c , stdout ) +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.PP +.\"O .BR puts () +.\"O writes the string +.\"O .I s +.\"O and a trailing newline +.\"O to +.\"O .IR stdout . +.BR puts () +¤Ï¡¢Ê¸»úÎó +.I s +¤È²þ¹Ô¤ò +.I stdout +¤Ë½ñ¤­¹þ¤à¡£ +.PP +.\"O Calls to the functions described here can be mixed with each other and with +.\"O calls to other output functions from the +.\"O .I stdio +.\"O library for the same output stream. +¤³¤³¤ÇÀâÌÀ¤µ¤ì¤¿´Ø¿ô¤Ï¤ª¸ß¤¤¤Ëº®ºß¤·¤Æ»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¡¢¤Þ¤¿¡¢ +.I stdio +¥é¥¤¥Ö¥é¥ê¤Ë´Þ¤Þ¤ì¤ë¾¤Î½ÐÎÏ´Ø¿ô¤òƱ¤¸½ÐÎÏ¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ +¸Æ¤Ó½Ð¤¹»ö¤¬½ÐÍè¤ë¡£ +.PP +.\"O For nonlocking counterparts, see +.\"O .BR unlocked_stdio (3). +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR fputc (), +.\"O .BR putc () +.\"O and +.\"O .BR putchar () +.\"O return the character written as an +.\"O .I unsigned char +.\"O cast to an +.\"O .I int +.\"O or +.\"O .B EOF +.\"O on error. +.BR fputc (), +.BR putc (), +.BR putchar () +¤Ï +.I unsigned char +¤È¤·¤Æ½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¤ò +.I int +¤Ë¥­¥ã¥¹¥È¤·¤ÆÊÖ¤¹¡£ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï +.B EOF +¤òÊÖ¤¹¡£ +.PP +.\"O .BR puts () +.\"O and +.\"O .BR fputs () +.\"O return a nonnegative number on success, or +.\"O .B EOF +.\"O on error. +.BR puts () +¤È +.BR fputs () +¤Ï¡¢À®¸ù¤¹¤ë¤ÈÉé¤Ç¤Ï¤Ê¤¤¿ô¤ò¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï +.B EOF +¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C89, C99. +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O It is not advisable to mix calls to output functions from the +.\"O .I stdio +.\"O library with low-level calls to +.\"O .BR write (2) +.\"O for the file descriptor associated with the same output stream; the results +.\"O will be undefined and very probably not what you want. +.I stdio +¥é¥¤¥Ö¥é¥ê¤Ë´Þ¤Þ¤ì¤ë½ÐÎÏ´Ø¿ô¤È¡¢Æ±¤¸½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤¿ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ë +.BR write (2) +¤ÎÄã¥ì¥Ù¥ë¸Æ¤Ó½Ð¤·¤òº®ºß¤·¤Æ +»ÈÍѤ¹¤ë¤³¤È¤Ï¸­ÌÀ¤Ç¤Ï¤Ê¤¤¡£ +¤½¤Î·ë²Ì¤ÏÄêµÁ¤µ¤ì¤Æ¤ª¤é¤º¡¢Ë¾¤à·ë²Ì¤¬ÆÀ¤é¤ì¤Ê¤¤²ÄǽÀ­¤¬¹â¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR write (2), +.BR ferror (3), +.BR fopen (3), +.BR fputwc (3), +.BR fputws (3), +.BR fseek (3), +.BR fwrite (3), +.BR gets (3), +.BR putwchar (3), +.BR scanf (3), +.BR unlocked_stdio (3) diff --git a/draft/man3/putwchar.3 b/draft/man3/putwchar.3 new file mode 100644 index 00000000..8bb913a7 --- /dev/null +++ b/draft/man3/putwchar.3 @@ -0,0 +1,103 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:58 JST 2000 +.\" by HANATAKA Shinya +.\" Updated Sat Nov 3 JST 2001 by Kentaro Shirakata +.\" +.TH PUTWCHAR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O putwchar \- write a wide character to standard output +putwchar \- ¥ï¥¤¥Éʸ»ú¤òɸ½à½ÐÎϤؽñ¤­½Ð¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wint_t putwchar(wchar_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR putwchar () +.\"O function is the wide-character equivalent of the +.\"O .BR putchar (3) +.\"O function. +.\"O It writes the wide character \fIwc\fP to \fIstdout\fP. +.\"O If \fIferror(stdout)\fP becomes true, it returns +.\"O .BR WEOF . +.\"O If a wide character +.\"O conversion error occurs, it sets \fIerrno\fP to \fBEILSEQ\fP and returns +.\"O .BR WEOF . +.\"O Otherwise it returns \fIwc\fP. +.BR putwchar () +´Ø¿ô¤Ï +.BR putchar () +¤Î¥ï¥¤¥Éʸ»úÈǤǤ¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï \fIwc\fP ¤ò \fIstdout\fP ¤Ø¤È½ñ¤­½Ð¤¹¡£\fIferror(stdout)\fP ¤¬ +¿¿¤Ê¤é¤Ð +.B WEOF +¤òÊÖ¤¹¡£¥ï¥¤¥Éʸ»ú¤ÎÊÑ´¹¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï \fIerrno\fP ¤Ë +\fBEILSEQ\fP ¤òÀßÄꤷ¤Æ +.B WEOF +¤òÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï \fIwc\fP ¤òÊÖ¤¹¡£ +.PP +.\"O For nonlocking counterparts, see +.\"O .BR unlocked_stdio (3). +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR putwchar () +.\"O function returns \fIwc\fP if no error occurred, or +.\"O .B WEOF +.\"O to indicate an error. +¥¨¥é¡¼¤¬µ¯¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.BR putwchar () +´Ø¿ô¤Ï \fIwc\fP ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤­¤¿¾ì¹ç¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR putwchar () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR putwchar () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +.\"O It is reasonable to expect that +.\"O .BR putwchar () +.\"O will actually write +.\"O the multibyte sequence corresponding to the wide character \fIwc\fP. +.BR putwchar () +¤¬¼ÂºÝ¤Ë¤Ï¥ï¥¤¥Éʸ»ú \fIwc\fP ¤ÈÅù²Á¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò +½ñ¤­½Ð¤¹¤³¤È¤ò´üÂÔ¤·¤Æ¤â¤è¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fputwc (3), +.BR unlocked_stdio (3) diff --git a/draft/man3/qecvt.3 b/draft/man3/qecvt.3 new file mode 100644 index 00000000..b1503094 --- /dev/null +++ b/draft/man3/qecvt.3 @@ -0,0 +1,120 @@ +.\" Copyright (C) 2002 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. +.\" +.\" 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 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O qecvt, qfcvt, qgcvt \- convert a floating-point number to a string +qecvt, qfcvt, qgcvt \- ÉâÆ°¾®¿ôÅÀ¿ô¤Îʸ»úÎó¤Ø¤ÎÊÑ´¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "char *qecvt(long double " number ", int " ndigits ", int *" decpt , +.BI "int *" sign ); +.sp +.BI "char *qfcvt(long double " number ", int " ndigits ", int *" decpt , +.BI "int *" sign ); +.sp +.BI "char *qgcvt(long double " number ", int " ndigit ", char *" buf ); +.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 qecvt (), +.BR qfcvt (), +.BR qgcvt (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.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" +.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 +.SH Ãí°Õ +.\"O These functions are obsolete. +.\"O Instead, +.\"O .BR sprintf (3) +.\"O is recommended. +¤³¤ì¤é¤Î´Ø¿ô¤ÏÇѻߤµ¤ì¤¿¡£Âå¤ï¤ê¤Ë +.BR sprintf (3) +¤Î»ÈÍѤò¿ä¾©¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ecvt (3), +.BR ecvt_r (3), +.BR gcvt (3), +.BR sprintf (3) diff --git a/draft/man3/qsort.3 b/draft/man3/qsort.3 new file mode 100644 index 00000000..d3a9112a --- /dev/null +++ b/draft/man3/qsort.3 @@ -0,0 +1,166 @@ +.\" 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-07-24, Rik Faith (faith@cs.unc.edu) +.\" 2006-01-15, mtk, Added example program. +.\" +.\" FIXME glibc 2.8 added qsort_r(), which needs to be documented. +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated 1997-01-21, YOSHINO Takashi +.\" Updated & Modified 2004-06-06, Yuichi SATO +.\" Updated 2006-01-18, Akihiro MOTOKI +.\" +.TH QSORT 3 2009-09-15 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O qsort \- sorts an array +qsort \- ÇÛÎó¤òʤÙÊѤ¨¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void qsort(void *" base ", size_t " nmemb ", size_t " size , +.BI " int(*" compar ")(const void *, const void *));" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR qsort () +.\"O function sorts an array with \fInmemb\fP elements of +.\"O size \fIsize\fP. +.\"O The \fIbase\fP argument points to the start of the +.\"O array. +.BR qsort () +´Ø¿ô¤Ï¡¢ +\fInmemb\fP ¸Ä¤ÎÂ礭¤µ \fIsize\fP ¤ÎÍ×ÁǤò¤â¤ÄÇÛÎó¤òʤÙÊѤ¨¤ë¡£ +\fIbase\fP °ú¤­¿ô¤ÏÇÛÎó¤ÎÀèƬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.PP +.\"O The contents of the array are sorted in ascending order according to a +.\"O comparison function pointed to by \fIcompar\fP, which is called with two +.\"O arguments that point to the objects being compared. +\fIcompar\fP ¤ò¥Ý¥¤¥ó¥¿¤È¤¹¤ëÈæ³Ó´Ø¿ô¤Ë¤è¤Ã¤Æ¡¢ +ÇÛÎó¤ÎÃæ¿È¤Ï¾º½ç (ÃͤÎÂ礭¤¤¤â¤Î¤Û¤É¸å¤ËʤֽçÈÖ) ¤Ëʤ٤é¤ì¤ë¡£ +Èæ³Ó´Ø¿ô¤Î°ú¤­¿ô¤ÏÈæ³Ó¤µ¤ì¤ë¤Õ¤¿¤Ä¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.PP +.\"O The comparison function must return an integer less than, equal to, or +.\"O greater than zero if the first argument is considered to be respectively +.\"O less than, equal to, or greater than the second. +.\"O If two members compare +.\"O as equal, their order in the sorted array is undefined. +Èæ³Ó´Ø¿ô¤Ï¡¢Âè°ì°ú¤­¿ô¤¬ÂèÆó°ú¤­¿ô¤ËÂФ·¤Æ¡¢ +1) ¾®¤µ¤¤¡¢2) Åù¤·¤¤¡¢3) Â礭¤¤¤Î¤½¤ì¤¾¤ì¤Ë±þ¤¸¤Æ¡¢ +1) ¥¼¥í¤è¤ê¾®¤µ¤¤À°¿ô¡¢2) ¥¼¥í¡¢3) ¥¼¥í¤è¤êÂ礭¤¤À°¿ô¤Î +¤¤¤º¤ì¤«¤òÊÖ¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Æó¤Ä¤ÎÍ×ÁǤÎÈæ³Ó·ë²Ì¤¬Åù¤·¤¤¤È¤­¡¢ +ʤÙÊѤ¨¤¿¸å¤ÎÇÛÎó¤Ç¤Ï¡¢¤³¤ì¤éÆó¤Ä¤Î½ç½ø¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR qsort () +.\"O function returns no value. +.BR qsort () +¤ÏÃͤòÊÖ¤µ¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Library routines suitable for use as the +.\"O .I compar +.\"O argument include +.\"O .BR alphasort (3) +.\"O and +.\"O .BR versionsort (3). +.I compar +°ú¤­¿ô¤Ë»ÈÍѤ¹¤ë¤Î¤ËŬ¤·¤Æ¤¤¤ë¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó¤È¤·¤Æ¤Ï +.BR alphasort (3), +.BR versionsort (3) +¤¬¤¢¤ë¡£ +.\"O To compare C strings, the comparison function can call +.\"O .BR strcmp (3), +.\"O as shown in the example below. +C ¤Îʸ»úÎó¤òÈæ³Ó¤¹¤ë¾ì¹ç¡¢°Ê²¼¤ÎÎã¤Ë¤¢¤ë¤è¤¦¤ËÈæ³Ó´Ø¿ô¤Ç +.BR strcmp (3) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤â¤Ç¤­¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O For one example of use, see the example under +.\"O .BR bsearch (3). +»ÈÍÑÎã¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR bsearch (3) +¤Ë¤¢¤ëÎã¤ò»²¾È¤¹¤ë¤³¤È¡£ + +.\"O Another example is the following program, +.\"O which sorts the strings given in its command-line arguments: +°Ê²¼¤Î¥×¥í¥°¥é¥à¤ËÊ̤λÈÍÑÎã¤ò¼¨¤¹¡£¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿Ê¸»úÎó¤ÎʤӴ¹¤¨¤ò¹Ô¤¦¡£ +.sp +.nf +#include +#include +#include + +static int +cmpstringp(const void *p1, const void *p2) +{ +.\"O /* The actual arguments to this function are "pointers to +.\"O pointers to char", but strcmp(3) arguments are "pointers +.\"O to char", hence the following cast plus dereference */ + /* ¤³¤Î´Ø¿ô¤Î¼ÂºÝ¤Î°ú¤­¿ô¤Ï "char ·¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤Î¥Ý¥¤¥ó¥¿" ¤À¤¬¡¢ + strcmp(3) ¤Î°ú¤­¿ô¤Ï "char ·¿¤Ø¤Î¥Ý¥¤¥ó¥¿" ¤Ç¤¢¤ë¡£ + ¤½¤³¤Ç¡¢°Ê²¼¤Î¤è¤¦¤Ë¥­¥ã¥¹¥È¤ò¤·¤Æ¤«¤é¥Ý¥¤¥ó¥¿¤ÎµÕ»²¾È¤ò¹Ô¤¦¡£*/ + + return strcmp(* (char * const *) p1, * (char * const *) p2); +} + +int +main(int argc, char *argv[]) +{ + int j; + + if (argc < 2) { + fprintf(stderr, "Usage: %s ...\\n", argv[0]); + exit(EXIT_FAILURE); + } + + qsort(&argv[1], argc \- 1, sizeof(char *), cmpstringp); + + for (j = 1; j < argc; j++) + puts(argv[j]); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sort (1), +.BR alphasort (3), +.BR strcmp (3), +.BR versionsort (3) diff --git a/draft/man3/queue.3 b/draft/man3/queue.3 new file mode 100644 index 00000000..ba4d56a0 --- /dev/null +++ b/draft/man3/queue.3 @@ -0,0 +1,746 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)queue.3 8.2 (Berkeley) 1/24/94 +.\" +.\" hch, 2002-03-25 +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Thu Sep 2 04:41:11 JST 2004 +.\" by Yuichi SATO +.\" +.\"WORD: circular queue ½Û´Ä¥­¥å¡¼ +.\" +.TH QUEUE 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O LIST_ENTRY, LIST_HEAD, LIST_INIT, LIST_INSERT_AFTER, \ +.\"O LIST_INSERT_HEAD, LIST_REMOVE, TAILQ_ENTRY, TAILQ_HEAD, \ +.\"O TAILQ_INIT, TAILQ_INSERT_AFTER, TAILQ_INSERT_HEAD, TAILQ_INSERT_TAIL, \ +.\"O TAILQ_REMOVE, CIRCLEQ_ENTRY, CIRCLEQ_HEAD, CIRCLEQ_INIT, \ +.\"O CIRCLEQ_INSERT_AFTER, CIRCLEQ_INSERT_BEFORE, \ +.\"O CIRCLEQ_INSERT_HEAD, CIRCLEQ_INSERT_TAIL, \ +.\"O CIRCLEQ_REMOVE \- implementations of lists, tail queues, and circular queues +LIST_ENTRY, LIST_HEAD, LIST_INIT, LIST_INSERT_AFTER, \ +LIST_INSERT_HEAD, LIST_REMOVE, TAILQ_ENTRY, TAILQ_HEAD, \ +TAILQ_INIT, TAILQ_INSERT_AFTER, TAILQ_INSERT_HEAD, TAILQ_INSERT_TAIL, \ +TAILQ_REMOVE, CIRCLEQ_ENTRY, CIRCLEQ_HEAD, CIRCLEQ_INIT, \ +CIRCLEQ_INSERT_AFTER, CIRCLEQ_INSERT_BEFORE, \ +CIRCLEQ_INSERT_HEAD, CIRCLEQ_INSERT_TAIL, \ +CIRCLEQ_REMOVE \- ¥ê¥¹¥È¡¦¥Æ¡¼¥ë (tail) ¥­¥å¡¼¡¦½Û´Ä¥­¥å¡¼¤Î¼ÂÁõ +.\"Osato: +.\"Osato: tail queue ¤ÎÎɤ¤Ìõ¸ì¤¬Ê¬¤«¤é¤Ê¤¤¤Î¤Ç¡¢¤È¤ê¤¢¤¨¤º¥«¥¿¥«¥Ê¤Ë¤¹¤ë¡£ +.\"Osato: +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "LIST_ENTRY(" TYPE ); +.BI "LIST_HEAD(" HEADNAME ", " TYPE ); +.BI "LIST_INIT(LIST_HEAD *" head ); +.BI "LIST_INSERT_AFTER(LIST_ENTRY *" listelm ", " +.BI " TYPE *" elm ", LIST_ENTRY " NAME ); +.BI "LIST_INSERT_HEAD(LIST_HEAD *" head ", " +.BI " TYPE *" elm ", LIST_ENTRY " NAME ); +.BI "LIST_REMOVE(TYPE *" elm ", LIST_ENTRY " NAME ); + +.BI "TAILQ_ENTRY(" TYPE ); +.BI "TAILQ_HEAD("HEADNAME ", " TYPE ); +.BI "TAILQ_INIT(TAILQ_HEAD *" head ); +.BI "TAILQ_INSERT_AFTER(TAILQ_HEAD *" head ", TYPE *" listelm ", " +.BI " TYPE *" elm ", TAILQ_ENTRY " NAME ); +.BI "TAILQ_INSERT_HEAD(TAILQ_HEAD *" head ", " +.BI " TYPE *" elm ", TAILQ_ENTRY " NAME ); +.BI "TAILQ_INSERT_TAIL(TAILQ_HEAD *" head ", " +.BI " TYPE *" elm ", TAILQ_ENTRY " NAME ); +.BI "TAILQ_REMOVE(TAILQ_HEAD *" head ", TYPE *" elm ", TAILQ_ENTRY " NAME ); + +.BI CIRCLEQ_ENTRY( TYPE ); +.BI "CIRCLEQ_HEAD(" HEADNAME ", " TYPE ); +.BI "CIRCLEQ_INIT(CIRCLEQ_HEAD *" head ); +.BI "CIRCLEQ_INSERT_AFTER(CIRCLEQ_HEAD *" head ", TYPE *" listelm ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.BI "CIRCLEQ_INSERT_BEFORE(CIRCLEQ_HEAD *" head ", TYPE *" listelm ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.BI "CIRCLEQ_INSERT_HEAD(CIRCLEQ_HEAD *" head ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.BI "CIRCLEQ_INSERT_TAIL(CIRCLEQ_HEAD *" head ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.BI "CIRCLEQ_REMOVE(CIRCLEQ_HEAD *" head ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These macros define and operate on three types of data structures: +.\"O lists, tail queues, and circular queues. +.\"O All three structures support the following functionality: +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï¡¢¼¡¤Î 3 ¤Ä¤Î¥Ç¡¼¥¿¹½Â¤¤òÄêµÁ¤·¤ÆÁàºî¤¹¤ë: +¥ê¥¹¥È¡¦¥Æ¡¼¥ë¥­¥å¡¼¡¦½Û´Ä¥­¥å¡¼¡£ +3 ¤Ä¤Î¥Ç¡¼¥¿¹½Â¤¤¹¤Ù¤Æ¤Ë¤ª¤¤¤Æ°Ê²¼¤Îµ¡Ç½¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë: +.sp +.RS 4 +.PD 0 +.IP * 4 +.\"O Insertion of a new entry at the head of the list. +¿·¤¿¤Ê¥¨¥ó¥È¥ê¤ò¥ê¥¹¥È¤ÎÀèƬ¤ËÁÞÆþ¤¹¤ë¡£ +.IP * +.\"O Insertion of a new entry after any element in the list. +¿·¤¿¤Ê¥¨¥ó¥È¥ê¤ò¥ê¥¹¥È¤Î¤É¤ÎÍ×ÁǤè¤ê¤â¸å¤ËÁÞÆþ¤¹¤ë¡£ +.IP * +.\"O Removal of any entry in the list. +¥ê¥¹¥È¤ÎǤ°Õ¤Î¥¨¥ó¥È¥ê¤òºï½ü¤¹¤ë¡£ +.IP * +.\"O Forward traversal through the list. +¥ê¥¹¥È¤ò½çÊý¸þ¤Ëé¤ë¡£ +.PD +.RE +.PP +.\"O Lists are the simplest of the three data structures and support +.\"O only the above functionality. +¥ê¥¹¥È¤Ï 3 ¤Ä¤Î¥Ç¡¼¥¿¹½Â¤¤ÎÃæ¤ÇºÇ¤âñ½ã¤Ç¤¢¤ê¡¢ +¾åµ­¤Îµ¡Ç½¤Î¤ß¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ + +.\"O Tail queues add the following functionality: +¥Æ¡¼¥ë¥­¥å¡¼¤Ï°Ê²¼¤Îµ¡Ç½¤òÄɲ乤ë: +.RS 4 +.IP * 4 +.\"O Entries can be added at the end of a list. +¥¨¥ó¥È¥ê¤ò¥ê¥¹¥È¤ÎºÇ¸å¤ËÄɲäǤ­¤ë¡£ +.RE +.PP +.\"O However: +¤¿¤À¤·: +.sp +.RS 4 +.PD 0 +.IP 1. 4 +.\"O All list insertions and removals must specify the head of the list. +Á´¤Æ¤Î¥ê¥¹¥ÈÁÞÆþ¤Èºï½ü¤Ë¤ª¤¤¤Æ¡¢¥ê¥¹¥È¤ÎÀèƬ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP 2. +.\"O Each head entry requires two pointers rather than one. +³ÆÀèƬ¥¨¥ó¥È¥ê¤Ï 1 ¤Ä¤Ç¤Ï¤Ê¤¯ 2 ¤Ä¤Î¥Ý¥¤¥ó¥¿¤òɬÍפȤ¹¤ë¡£ +.IP 3. +.\"O Code size is about 15% greater and operations run about 20% slower +.\"O than lists. +¥ê¥¹¥È¤ÈÈæ¤Ù¤Æ¡¢¥³¡¼¥É¥µ¥¤¥º¤Ï 15% Â礭¤¯¤Ê¤ê¡¢Áàºî¤Ï 20% ÃÙ¤¯¤Ê¤ë¡£ +.PD +.RE +.PP +.\"O Circular queues add the following functionality: +½Û´Ä¥­¥å¡¼¤Ï°Ê²¼¤Îµ¡Ç½¤òÄɲ乤ë: +.sp +.RS 4 +.PD 0 +.IP * 4 +.\"O Entries can be added at the end of a list. +¥¨¥ó¥È¥ê¤ò¥ê¥¹¥È¤ÎºÇ¸å¤ËÄɲäǤ­¤ë¡£ +.IP * +.\"O Entries can be added before another entry. +¥¨¥ó¥È¥ê¤ò¾¤Î¥¨¥ó¥È¥ê¤ÎÁ°¤ËÄɲäǤ­¤ë¡£ +.IP * +.\"O They may be traversed backwards, from tail to head. +µÕÊý¸þ¤ËËöÈø¤«¤éÀèƬ¤Øé¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PD +.RE +.PP +.\"O However: +¤¿¤À¤·: +.sp +.RS 4 +.PD 0 +.IP 1. 4 +.\"O All list insertions and removals must specify the head of the list. +Á´¤Æ¤Î¥ê¥¹¥ÈÁÞÆþ¤Èºï½ü¤Ë¤ª¤¤¤Æ¡¢¥ê¥¹¥È¤ÎÀèƬ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP 2. +.\"O Each head entry requires two pointers rather than one. +³ÆÀèƬ¥¨¥ó¥È¥ê¤Ï 1 ¤Ä¤Ç¤Ï¤Ê¤¯ 2 ¤Ä¤Î¥Ý¥¤¥ó¥¿¤òɬÍפȤ¹¤ë¡£ +.IP 3. +.\"O The termination condition for traversal is more complex. +é¤ëºÝ¤Î½ªÎ»¾ò·ï¤¬¤è¤êÊ£»¨¤Ç¤¢¤ë¡£ +.IP 4. +.\"O Code size is about 40% greater and operations run about 45% slower +.\"O than lists. +¥ê¥¹¥È¤ÈÈæ¤Ù¤Æ¡¢¥³¡¼¥É¥µ¥¤¥º¤Ï 40% Â礭¤¯¤Ê¤ê¡¢Áàºî¤Ï 45% ÃÙ¤¯¤Ê¤ë¡£ +.PD +.RE +.PP +.\"O In the macro definitions, +.\"O .I TYPE +.\"O is the name of a user-defined structure, +.\"O that must contain a field of type +.\"O .BR LIST_ENTRY , +.\"O .BR TAILQ_ENTRY , +.\"O or +.\"O .BR CIRCLEQ_ENTRY , +.\"O named +.\"O .IR NAME . +¥Þ¥¯¥íÄêµÁ¤Ë¤ª¤¤¤Æ +.I TYPE +¤Ï¥æ¡¼¥¶ÄêµÁ¹½Â¤ÂΤÎ̾Á°¤Ç¤¢¤ê¡¢ +.BR LIST_ENTRY , +.BR TAILQ_ENTRY , +.BR CIRCLEQ_ENTRY +¤Î²¿¤ì¤«·¿¤Î¥Õ¥£¡¼¥ë¥É¤È +»ØÄꤵ¤ì¤¿ +.I NAME +¤ò´Þ¤Þ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O The argument +.\"O .I HEADNAME +.\"O is the name of a user-defined structure that must be declared +.\"O using the macros +.\"O .BR LIST_HEAD , +.\"O .BR TAILQ_HEAD , +.\"O or +.\"O .BR CIRCLEQ_HEAD . +°ú¤­¿ô +.I HEADNAME +¤Ï¥æ¡¼¥¶ÄêµÁ¹½Â¤ÂΤÎ̾Á°¤Ç¤¢¤ê¡¢ +¥Þ¥¯¥í +.BR LIST_HEAD , +.BR TAILQ_HEAD , +.BR CIRCLEQ_HEAD +¤òÍѤ¤¤ÆÀë¸À¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O See the examples below for further explanation of how these +.\"O macros are used. +¤³¤ì¤é¤Î¥Þ¥¯¥í¤¬¤É¤Î¤è¤¦¤Ë»È¤ï¤ì¤ë¤«¤Ë¤Ä¤¤¤Æ¤Î¹¹¤Ê¤ëÀâÌÀ¤Ï¡¢ +°Ê²¼¤ÎÎã¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SS LISTS +.SS ¥ê¥¹¥È +.\"O A list is headed by a structure defined by the +.\"O .B LIST_HEAD +.\"O macro. +¥ê¥¹¥È¤ÎÀèƬ¤Ë¤Ï¡¢ +.B LIST_HEAD +¥Þ¥¯¥í¤ÇÄêµÁ¤µ¤ì¤ë¹½Â¤ÂΤ¬ÃÖ¤«¤ì¤ë¡£ +.\"O This structure contains a single pointer to the first element +.\"O on the list. +¤³¤Î¹½Â¤ÂΤϥꥹ¥È¤ÎºÇ½é¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿¤ò 1 ¤Ä´Þ¤à¡£ +.\"O The elements are doubly linked so that an arbitrary element can be +.\"O removed without traversing the list. +Í×ÁÇ¤Ï 2 ½Å¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤ª¤ê¡¢ +Ǥ°Õ¤ÎÍ×ÁǤϥꥹ¥È¤òé¤é¤º¤Ëºï½ü¤Ç¤­¤ë¡£ +.\"O New elements can be added to the list after an existing element or +.\"O at the head of the list. +¿·¤·¤¤Í×ÁǤϴû¸¤ÎÍ×ÁǤθå¤Þ¤¿¤Ï¥ê¥¹¥È¤ÎÀèƬ¤ËÄɲäǤ­¤ë¡£ +.\"O A +.\"O .B LIST_HEAD +.\"O structure is declared as follows: +.B LIST_HEAD +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +LIST_HEAD(HEADNAME, TYPE) head; +.fi +.in +.PP +.\"O where +.\"O .I HEADNAME +.\"O is the name of the structure to be defined, and +.\"O .I TYPE +.\"O is the type of the elements to be linked into the list. +¤³¤³¤Ç +.I HEADNAME +¤ÏÄêµÁ¤µ¤ì¤ë¹½Â¤ÂΤÎ̾Á°¤Ç¤¢¤ê¡¢ +.I TYPE +¤Ï¥ê¥ó¥¯Æâ¤Ç¥ê¥ó¥¯¤µ¤ì¤ëÍ×ÁǤη¿¤Ç¤¢¤ë¡£ +.\"O A pointer to the head of the list can later be declared as: +¥ê¥¹¥È¤ÎÀèƬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢¤½¤Î¸å¤Ç¼¡¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤ë: +.in +4n +.nf + +struct HEADNAME *headp; +.fi +.in +.PP +.\"O (The names +.\"O .IR "head" +.\"O and +.\"O .IR "headp" +.\"O are user selectable.) +(̾Á° +.IR "head" +¤È +.IR "headp" +¤Ï¥æ¡¼¥¶¤¬ÁªÂò¤Ç¤­¤ë¡£) +.PP +.\"O The macro +.\"O .B LIST_ENTRY +.\"O declares a structure that connects the elements in +.\"O the list. +¥Þ¥¯¥í +.B LIST_ENTRY +¤Ï¥ê¥¹¥È¤ÎÍ×ÁǤòÀܳ¤¹¤ë¹½Â¤ÂΤòÀë¸À¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B LIST_INIT +.\"O initializes the list referenced by +.\"O .IR head . +¥Þ¥¯¥í +.B LIST_INIT +¤Ï +.I head +¤Ç»²¾È¤µ¤ì¤ë¥ê¥¹¥È¤ò½é´ü²½¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B LIST_INSERT_HEAD +.\"O inserts the new element +.\"O .I elm +.\"O at the head of the list. +¥Þ¥¯¥í +.B LIST_INSERT_HEAD +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤ò¥ê¥¹¥È¤ÎÀèƬ¤ËÁÞÆþ¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B LIST_INSERT_AFTER +.\"O inserts the new element +.\"O .I elm +.\"O after the element +.\"O .I listelm . +¥Þ¥¯¥í +.B LIST_INSERT_AFTER +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤òÍ×ÁÇ +.I listelm +¤Î¸å¤ËÁÞÆþ¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B LIST_REMOVE +.\"O removes the element +.\"O .I elm +.\"O from the list. +¥Þ¥¯¥í +.B LIST_REMOVE +¤ÏÍ×ÁÇ +.I elm +¤ò¥ê¥¹¥È¤«¤éºï½ü¤¹¤ë¡£ +.\"O .SS LIST EXAMPLE +.SS ¥ê¥¹¥È¤ÎÎã +.nf + +LIST_HEAD(listhead, entry) head; +.\"O struct listhead *headp; /* List head. */ +struct listhead *headp; /* ¥ê¥¹¥È¤ÎÀèƬ¡£*/ +struct entry { +.\"O ... +.\"O LIST_ENTRY(entry) entries; /* List. */ +.\"O ... + ... + LIST_ENTRY(entry) entries; /* ¥ê¥¹¥È¡£ */ + ... +} *n1, *n2, *np; + +.\"O LIST_INIT(&head); /* Initialize the list. */ +LIST_INIT(&head); /* ¥ê¥¹¥È¤ò½é´ü²½¤¹¤ë¡£*/ + +.\"O n1 = malloc(sizeof(struct entry)); /* Insert at the head. */ +n1 = malloc(sizeof(struct entry)); /* ÀèƬ¤ËÁÞÆþ¤¹¤ë¡£*/ +LIST_INSERT_HEAD(&head, n1, entries); + +.\"O n2 = malloc(sizeof(struct entry)); /* Insert after. */ +n2 = malloc(sizeof(struct entry)); /* ¸å¤í¤ËÁÞÆþ¤¹¤ë¡£*/ +LIST_INSERT_AFTER(n1, n2, entries); +.\"O /* Forward traversal. */ + /* ½çÊý¸þ¤Ëé¤ë¡£*/ +for (np = head.lh_first; np != NULL; np = np\->entries.le_next) + np\-> ... + +.\"O while (head.lh_first != NULL) /* Delete. */ +while (head.lh_first != NULL) /* ºï½ü¤¹¤ë¡£*/ + LIST_REMOVE(head.lh_first, entries); +.fi +.\"O .SS Tail Queues +.SS ¥Æ¡¼¥ë¥­¥å¡¼ +.\"O A tail queue is headed by a structure defined by the +.\"O .B TAILQ_HEAD +.\"O macro. +¥Æ¡¼¥ë¥­¥å¡¼¤ÎÀèƬ¤Ë¤Ï +.B TAILQ_HEAD +¥Þ¥¯¥í¤ÇÄêµÁ¤µ¤ì¤ë¹½Â¤ÂΤ¬ÃÖ¤«¤ì¤ë¡£ +.\"O This structure contains a pair of pointers, +.\"O one to the first element in the tail queue and the other to +.\"O the last element in the tail queue. +¤³¤Î¹½Â¤ÂÎ¤Ï 1 ÁȤΥݥ¤¥ó¥¿¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +1 ¤Ä¤Ï¥Æ¡¼¥ë¥­¥å¡¼¤ÎºÇ½é¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ê¡¢ +¤â¤¦ 1 ¤Ä¤Ï¥Æ¡¼¥ë¥­¥å¡¼¤ÎºÇ¸å¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +.\"O The elements are doubly linked so that an arbitrary element can be +.\"O removed without traversing the tail queue. +Í×ÁÇ¤Ï 2 ½Å¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤ª¤ê¡¢ +Ǥ°Õ¤ÎÍ×ÁǤϥơ¼¥ë¥­¥å¡¼¤òé¤é¤º¤Ëºï½ü¤Ç¤­¤ë¡£ +.\"O New elements can be added to the tail queue after an existing element, +.\"O at the head of the tail queue, or at the end of the tail queue. +¿·¤·¤¤Í×ÁǤϴû¸¤ÎÍ×ÁǤθå¤Þ¤¿¤Ï¥Æ¡¼¥ë¥­¥å¡¼¤ÎÀèƬ¤Þ¤¿¤ÏËöÈø¤ËÄɲäǤ­¤ë¡£ +.\"O A +.\"O .B TAILQ_HEAD +.\"O structure is declared as follows: +.B TAILQ_HEAD +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +TAILQ_HEAD(HEADNAME, TYPE) head; +.fi +.in +.PP +.\"O where +.\"O .IR "HEADNAME" +.\"O is the name of the structure to be defined, and +.\"O .IR "TYPE" +.\"O is the type of the elements to be linked into the tail queue. +¤³¤³¤Ç +.Li HEADNAME +¤ÏÄêµÁ¤µ¤ì¤ë¹½Â¤ÂΤÎ̾Á°¤Ç¤¢¤ê¡¢ +.Li TYPE +¤Ï¥Æ¡¼¥ë¥­¥å¡¼Æâ¤Ç¥ê¥ó¥¯¤µ¤ì¤ëÍ×ÁǤη¿¤Ç¤¢¤ë¡£ +.\"O A pointer to the head of the tail queue can later be declared as: +¥Æ¡¼¥ë¥­¥å¡¼¤ÎÀèƬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢¤½¤Î¸å¤Ç¼¡¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤ë: +.in +4n +.nf + +struct HEADNAME *headp; +.fi +.in +.PP +.\"O (The names +.\"O .IR "head" +.\"O and +.\"O .IR "headp" +.\"O are user selectable.) +(̾Á° +.IR "head" +¤È +.IR "headp" +¤Ï¥æ¡¼¥¶¤¬ÁªÂò¤Ç¤­¤ë¡£) +.PP +.\"O The macro +.\"O .B TAILQ_ENTRY +.\"O declares a structure that connects the elements in +.\"O the tail queue. +¥Þ¥¯¥í +.B TAILQ_ENTRY +¤Ï¥Æ¡¼¥ë¥­¥å¡¼¤ÎÍ×ÁǤòÀܳ¤¹¤ë¹½Â¤ÂΤòÀë¸À¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B TAILQ_INIT +.\"O initializes the tail queue referenced by +.\"O .IR head . +¥Þ¥¯¥í +.B TAILQ_INIT +¤Ï +.I head +¤Ç»²¾È¤µ¤ì¤ë¥Æ¡¼¥ë¥­¥å¡¼¤ò½é´ü²½¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B TAILQ_INSERT_HEAD +.\"O inserts the new element +.\"O .I elm +.\"O at the head of the tail queue. +¥Þ¥¯¥í +.B TAILQ_INSERT_HEAD +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤ò¥Æ¡¼¥ë¥­¥å¡¼¤ÎÀèƬ¤ËÁÞÆþ¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B TAILQ_INSERT_TAIL +.\"O inserts the new element +.\"O .I elm +.\"O at the end of the tail queue. +¥Þ¥¯¥í +.B TAILQ_INSERT_TAIL +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤ò¥Æ¡¼¥ë¥­¥å¡¼¤ÎËöÈø¤ËÁÞÆþ¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B TAILQ_INSERT_AFTER +.\"O inserts the new element +.\"O .I elm +.\"O after the element +.\"O .I listelm . +¥Þ¥¯¥í +.B TAILQ_INSERT_AFTER +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤òÍ×ÁÇ +.Fa listelm +¤Î¸å¤ËÁÞÆþ¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B TAILQ_REMOVE +.\"O removes the element +.\"O .I elm +.\"O from the tail queue. +¥Þ¥¯¥í +.B TAILQ_REMOVE +¤ÏÍ×ÁÇ +.I elm +¤ò¥Æ¡¼¥ë¥­¥å¡¼¤«¤éºï½ü¤¹¤ë¡£ +.\"O .SS Tail Queue Example +.SS ¥Æ¡¼¥ë¥­¥å¡¼¤ÎÎã +.nf + +TAILQ_HEAD(tailhead, entry) head; +.\"O struct tailhead *headp; /* Tail queue head. */ +struct tailhead *headp; /* ¥Æ¡¼¥ë¥­¥å¡¼¤ÎÀèƬ¡£*/ +struct entry { + ... +.\"O TAILQ_ENTRY(entry) entries; /* Tail queue. */ + TAILQ_ENTRY(entry) entries; /* ¥Æ¡¼¥ë¥­¥å¡¼¡£*/ + ... +} *n1, *n2, *np; + +.\"O TAILQ_INIT(&head); /* Initialize the queue. */ +TAILQ_INIT(&head); /* ¥­¥å¡¼¤ò½é´ü²½¤¹¤ë¡£*/ + +.\"O n1 = malloc(sizeof(struct entry)); /* Insert at the head. */ +n1 = malloc(sizeof(struct entry)); /* ÀèƬ¤ËÁÞÆþ¤¹¤ë¡£*/ +TAILQ_INSERT_HEAD(&head, n1, entries); + +.\"O n1 = malloc(sizeof(struct entry)); /* Insert at the tail. */ +n1 = malloc(sizeof(struct entry)); /* ËöÈø¤ËÁÞÆþ¤¹¤ë¡£*/ +TAILQ_INSERT_TAIL(&head, n1, entries); + +.\"O n2 = malloc(sizeof(struct entry)); /* Insert after. */ +n2 = malloc(sizeof(struct entry)); /* ¸å¤í¤ËÁÞÆþ¤¹¤ë¡£*/ +TAILQ_INSERT_AFTER(&head, n1, n2, entries); +.\"O /* Forward traversal. */ + /* ½çÊý¸þ¤Ëé¤ë¡£*/ +for (np = head.tqh_first; np != NULL; np = np\->entries.tqe_next) + np\-> ... +.\"O /* Delete. */ + /* ºï½ü¤¹¤ë¡£*/ +while (head.tqh_first != NULL) + TAILQ_REMOVE(&head, head.tqh_first, entries); +.fi +.\"O .SS Circular Queues +.SS ½Û´Ä¥­¥å¡¼ +.\"O A circular queue is headed by a structure defined by the +.\"O .B CIRCLEQ_HEAD +.\"O macro. +½Û´Ä¥­¥å¡¼¤ÎÀèƬ¤Ë¤Ï +.B CIRCLEQ_HEAD +¥Þ¥¯¥í¤ÇÄêµÁ¤µ¤ì¤ë¹½Â¤ÂΤ¬ÃÖ¤«¤ì¤ë¡£ +.\"O This structure contains a pair of pointers, +.\"O one to the first element in the circular queue and the other to the +.\"O last element in the circular queue. +¤³¤Î¹½Â¤ÂÎ¤Ï 1 ÁȤΥݥ¤¥ó¥¿¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +1 ¤Ä¤Ï½Û´Ä¥­¥å¡¼¤ÎºÇ½é¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ê¡¢ +¤â¤¦ 1 ¤Ä¤Ï½Û´Ä¥­¥å¡¼¤ÎºÇ¸å¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +.\"O The elements are doubly linked so that an arbitrary element can be +.\"O removed without traversing the queue. +Í×ÁÇ¤Ï 2 ½Å¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤ª¤ê¡¢ +Ǥ°Õ¤ÎÍ×ÁǤϥ­¥å¡¼¤òé¤é¤º¤Ëºï½ü¤Ç¤­¤ë¡£ +.\"O New elements can be added to the queue after an existing element, +.\"O before an existing element, at the head of the queue, or at the end +.\"O of the queue. +¿·¤·¤¤Í×ÁǤϡ¢´û¸¤ÎÍ×ÁǤθå¤Þ¤¿¤ÏÁ°¡¢¤Þ¤¿¤Ï¥­¥å¡¼¤ÎÀèƬ¤Þ¤¿¤ÏËöÈø¤ËÄɲäǤ­¤ë¡£ +A +.\"O .B CIRCLEQ_HEAD +.\"O structure is declared as follows: +.B CIRCLEQ_HEAD +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +CIRCLEQ_HEAD(HEADNAME, TYPE) head; +.fi +.in +.PP +.\"O where +.\"O .IR "HEADNAME" +.\"O is the name of the structure to be defined, and +.\"O .IR "TYPE" +.\"O is the type of the elements to be linked into the circular queue. +¤³¤³¤Ç +.IR "HEADNAME" +¤ÏÄêµÁ¤µ¤ì¤ë¹½Â¤ÂΤÎ̾Á°¤Ç¤¢¤ê¡¢ +.IR "TYPE" +¤Ï½Û´Ä¥­¥å¡¼Æâ¤Ç¥ê¥ó¥¯¤µ¤ì¤ëÍ×ÁǤη¿¤Ç¤¢¤ë¡£ +.\"O A pointer to the head of the circular queue can later be declared as: +½Û´Ä¥­¥å¡¼¤ÎÀèƬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢¤½¤Î¸å¤Ç¼¡¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤ë: +.in +4n +.nf + +struct HEADNAME *headp; +.fi +.in +.PP +.\"O (The names +.\"O .IR "head" +.\"O and +.\"O .IR "headp" +.\"O are user selectable.) +(̾Á° +.I head +¤È +.I headp +¤Ï¥æ¡¼¥¶¤¬ÁªÂò¤Ç¤­¤ë¡£) +.PP +.\"O The macro +.\"O .B CIRCLEQ_ENTRY +.\"O declares a structure that connects the elements in +.\"O the circular queue. +¥Þ¥¯¥í +.B CIRCLEQ_ENTRY +¤Ï½Û´Ä¥­¥å¡¼¤ÎÍ×ÁǤòÀܳ¤¹¤ë¹½Â¤ÂΤòÀë¸À¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B CIRCLEQ_INIT +.\"O initializes the circular queue referenced by +.\"O .IR head . +¥Þ¥¯¥í +.B CIRCLEQ_INIT +¤Ï +.I head +¤Ç»²¾È¤µ¤ì¤ë½Û´Ä¥­¥å¡¼¤ò½é´ü²½¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B CIRCLEQ_INSERT_HEAD +.\"O inserts the new element +.\"O .I elm +.\"O at the head of the circular queue. +¥Þ¥¯¥í +.B CIRCLEQ_INSERT_HEAD +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤ò½Û´Ä¥­¥å¡¼¤ÎÀèƬ¤ËÁÞÆþ¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B CIRCLEQ_INSERT_TAIL +.\"O inserts the new element +.\"O .I elm +.\"O at the end of the circular queue. +¥Þ¥¯¥í +.B CIRCLEQ_INSERT_TAIL +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤ò½Û´Ä¥­¥å¡¼¤ÎËöÈø¤ËÁÞÆþ¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B CIRCLEQ_INSERT_AFTER +.\"O inserts the new element +.\"O .I elm +.\"O after the element +.\"O .IR listelm . +¥Þ¥¯¥í +.B CIRCLEQ_INSERT_AFTER +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤òÍ×ÁÇ +.I listelm +¤Î¸å¤ËÁÞÆþ¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B CIRCLEQ_INSERT_BEFORE +.\"O inserts the new element +.\"O .I elm +.\"O before the element +.\"O .IR listelm . +¥Þ¥¯¥í +.B CIRCLEQ_INSERT_AFTER +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤òÍ×ÁÇ +.I listelm +¤ÎÁ°¤ËÁÞÆþ¤¹¤ë¡£ +.PP +.\"O The macro +.\"O .B CIRCLEQ_REMOVE +.\"O removes the element +.\"O .I elm +.\"O from the circular queue. +¥Þ¥¯¥í +.B CIRCLEQ_REMOVE +¤ÏÍ×ÁÇ +.I elm +¤ò½Û´Ä¥­¥å¡¼¤«¤éºï½ü¤¹¤ë¡£ +.\"O .SS Circular Queue Example +.SS ½Û´Ä¥­¥å¡¼¤ÎÎã +.nf + +CIRCLEQ_HEAD(circleq, entry) head; +.\"O struct circleq *headp; /* Circular queue head. */ +struct circleq *headp; /* ½Û´Ä¥­¥å¡¼¤ÎÀèƬ¡£*/ +struct entry { + ... +.\"O CIRCLEQ_ENTRY(entry) entries; /* Circular queue. */ + CIRCLEQ_ENTRY(entry) entries; /* ½Û´Ä¥­¥å¡¼¡£*/ + ... +} *n1, *n2, *np; + +.\"O CIRCLEQ_INIT(&head); /* Initialize the circular queue. */ +CIRCLEQ_INIT(&head); /* ½Û´Ä¥­¥å¡¼¤ò½é´ü²½¤¹¤ë¡£*/ + +.\"O n1 = malloc(sizeof(struct entry)); /* Insert at the head. */ +n1 = malloc(sizeof(struct entry)); /* ÀèƬ¤ËÁÞÆþ¤¹¤ë¡£*/ +CIRCLEQ_INSERT_HEAD(&head, n1, entries); + +.\"O n1 = malloc(sizeof(struct entry)); /* Insert at the tail. */ +n1 = malloc(sizeof(struct entry)); /* ËöÈø¤ËÁÞÆþ¤¹¤ë¡£*/ +CIRCLEQ_INSERT_TAIL(&head, n1, entries); + +.\"O n2 = malloc(sizeof(struct entry)); /* Insert after. */ +n2 = malloc(sizeof(struct entry)); /* ¸å¤í¤ËÁÞÆþ¤¹¤ë¡£*/ +CIRCLEQ_INSERT_AFTER(&head, n1, n2, entries); + +.\"O n2 = malloc(sizeof(struct entry)); /* Insert before. */ +n2 = malloc(sizeof(struct entry)); /* Á°¤ËÁÞÆþ¤¹¤ë¡£*/ +CIRCLEQ_INSERT_BEFORE(&head, n1, n2, entries); +.\"O /* Forward traversal. */ + /* ½çÊý¸þ¤Ëé¤ë¡£*/ +for (np = head.cqh_first; np != (void *)&head; np = np\->entries.cqe_next) + np\-> ... +.\"O /* Reverse traversal. */ + /* µÕÊý¸þ¤Ëé¤ë¡£*/ +for (np = head.cqh_last; np != (void *)&head; np = np\->entries.cqe_prev) + np\-> ... +.\"O /* Delete. */ + /* ºï½ü¤¹¤ë¡£*/ +while (head.cqh_first != (void *)&head) + CIRCLEQ_REMOVE(&head, head.cqh_first, entries); +.fi +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Not in POSIX.1-2001. +.\"O Present on the BSDs. +.\"O The +.\"O queue functions first appeared in +.\"O 4.4BSD. +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¤Ë¸ºß¤¹¤ë¡£ +queue ´Ø¿ô¤Ï 4.4BSD ¤Ç½é¤á¤ÆÅо줷¤¿¡£ diff --git a/draft/man3/raise.3 b/draft/man3/raise.3 new file mode 100644 index 00000000..09e4c5f9 --- /dev/null +++ b/draft/man3/raise.3 @@ -0,0 +1,90 @@ +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" and Copyright (C) 2008 Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-25, HIROFUMI Nishizuka +.\" Updated 2008-08-08, Akihiro MOTOKI , LDP v3.05 +.\" +.\" 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 18:40:56 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995 by Mike Battersby (mib@deakin.edu.au) +.\" +.TH RAISE 3 2008-10-17 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O raise \- send a signal to the caller +raise \- ¸Æ¤Ó½Ð¤·¸µ¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int raise(int " sig ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR raise () +.\"O function sends a signal to the calling process or thread. +.\"O In a single-threaded program it is equivalent to +.BR raise () +´Ø¿ô¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤â¤·¤¯¤Ï¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +¥·¥ó¥°¥ë¥¹¥ì¥Ã¥É¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¡¢°Ê²¼¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.sp +.in +4n +.nf +kill(getpid(), sig); +.fi +.in +.PP +.\"O In a multithreaded program it is equivalent to +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¡¢°Ê²¼¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.sp +.in +4n +.nf +pthread_kill(pthread_self(), sig); +.fi +.in +.PP +.\"O If the signal causes a handler to be called, +.\"O .BR raise () +.\"O will only return after the signal handler has returned. +¥·¥°¥Ê¥ë¤Ëµ¯°ø¤·¤Æ¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR raise () +¤¬ÊÖ¤ë¤Î¤Ïɬ¤º¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬Ê֤俸å¤Ë¤Ê¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR raise () +.\"O returns 0 on success, and nonzero for failure. +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤ò¡¢¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C89, C99, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getpid (2), +.BR kill (2), +.BR sigaction (2), +.BR signal (2), +.BR pthread_kill (3), +.BR signal (7) diff --git a/draft/man3/rand.3 b/draft/man3/rand.3 new file mode 100644 index 00000000..adbbe044 --- /dev/null +++ b/draft/man3/rand.3 @@ -0,0 +1,260 @@ +.\" 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 () +¤Î¼ÂÁõÎã¤È¤·¤Æ°Ê²¼¤òµó¤²¤Æ¤¤¤ë¡£¤³¤ì¤Ï¡¢°Û¤Ê¤ë£²¤Ä¤Î¥Þ¥·¥ó¤ÇƱ¤¸Íð¿ô·ÏÎó¤¬ +ɬÍפʾì¹ç¤Ë¤ÏÊØÍø¤Ç¤¢¤í¤¦¡£ +.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 new file mode 100644 index 00000000..23e6d5b4 --- /dev/null +++ b/draft/man3/random.3 @@ -0,0 +1,271 @@ +.\" 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 Sun Mar 28 00:25:51 1993, David Metcalfe +.\" 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 ¾õÂÖÇÛÎó +.\" +.TH RANDOM 3 2009-02-03 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O random, srandom, initstate, setstate \- random number generator +random, srandom, initstate, setstate \- Íð¿ô¤òÀ¸À®¤¹¤ë´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B long int random(void); +.br +.BI "void srandom(unsigned int " seed ); + +.BI "char *initstate(unsigned int " seed ", char *" state ", size_t " n ); + +.BI "char *setstate(char *" state ); +.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 random (), +.BR srandom (), +.BR initstate (), +.BR setstate (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.ad b +.\"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)" +¤Ç¤¢¤ë¡£ +.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 ¤ò¼ï¤ËÀßÄꤹ¤ë¡£ +.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 \(em the 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 ¤Ï½é´ü²½¤Î¤¿¤á¤Î¼ï¤Ç¤¢¤ë¡£ +¤³¤ì¤ÏÍð¿ô·ÏÎó¤Î³«»Ï°ÌÃÖ¤ò·èÄꤹ¤ë¤â¤Î¤Ç¤¢¤ê¡¢ +¤³¤ÎÃͤò»ØÄꤹ¤ë¤³¤È¤ÇƱ°ì¤Î³«»Ï°ÌÃÖ¤«¤éÍð¿ô¤ÎÀ¸À®¤ò +ºÆ³«¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.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" +.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 and +.\"O .BR setstate () +.\"O functions return a pointer to the previous state +.\"O array, or NULL on error. +.BR random () +´Ø¿ô¤Ï 0 ¤È +.B RAND_MAX +¤Î´Ö¤ÎÃͤòÊÖ¤¹¡£ +.BR srandom () +´Ø¿ô¤ÏÃͤòÊÖ¤µ¤Ê¤¤¡£ +.BR initstate () +´Ø¿ô¤È +.BR setstate () +´Ø¿ô¤Ï +ľÁ°¤Î¾õÂÖÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Þ¤¿¤Ï 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 +.SH ½àµò +4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.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) +¤ò»È¤¦¤³¤È¡£ + +.\"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 +(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" +.SH ´ØÏ¢¹àÌÜ +.BR drand48 (3), +.BR rand (3), +.BR random_r (3), +.BR srand (3) diff --git a/draft/man3/random_r.3 b/draft/man3/random_r.3 new file mode 100644 index 00000000..dc1bbc33 --- /dev/null +++ b/draft/man3/random_r.3 @@ -0,0 +1,197 @@ +.\" Copyright 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. +.\" +.\" 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 +.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 +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int random_r(struct random_data *" buf ", int32_t *" result ); + +.BI "int srandom_r(unsigned int " seed ", struct random_data *" buf ); + +.BI "int initstate_r(unsigned int " seed ", char *" statebuf , +.BI " size_t " statelen ", struct random_data *" buf ); +.br +.BI "int setstate_r(char *" statebuf ", struct random_data *" buf ); +.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 random_r (), +.BR srandom_r (), +.BR initstate_r (), +.BR setstate_r (): +_SVID_SOURCE || _BSD_SOURCE +.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) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǡ¢Åù²Á¤Êµ¡Ç½¤ò»ý¤Ä¡£ +¤³¤ì¤é¤Ï¡¢ÆÈΩ¤·¤¿ºÆ¸½²Äǽ¤ÊÍð¿ôÎó¤ò³Æ¥¹¥ì¥Ã¥É¤¬ÆÀ¤ëɬÍפ¬¤¢¤ë¤è¤¦¤Ê +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¡¦¥×¥í¥°¥é¥à¤Ç¤Î»ÈÍѤËŬ¤·¤Æ¤¤¤ë¡£ + +.\"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 +¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ + +.\"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 +¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¤ËÂбþ¤¹¤ëÍð¿ôÀ¸À®´ï¤Î¼ï¤ò +½é´ü²½¤¹¤ë¡£ + +.\"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 +¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥ÈÆâ¤Î¾õÂÖ¤ò½é´ü²½¤¹¤ë¡£ + +.\"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 +¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥ÈÆâ¤Î¾õÂÖ¤òÊѹ¹¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O All of these functions return 0 on success, or \-1 on error. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR drand48 (3), +.BR rand (3), +.BR random (3) diff --git a/draft/man3/rcmd.3 b/draft/man3/rcmd.3 new file mode 100644 index 00000000..c9abcc74 --- /dev/null +++ b/draft/man3/rcmd.3 @@ -0,0 +1,232 @@ +.\" $NetBSD: rcmd.3,v 1.9 1996/05/28 02:07:39 mrg Exp $ +.\" +.\" Copyright (c) 1983, 1991, 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. +.\" +.\" @(#)rcmd.3 8.1 (Berkeley) 6/4/93 +.\" +.\" Contributed as Linux man page by David A. Holland, 970908 +.\" I have not checked whether the Linux situation is exactly the same. +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated Mon Mar 1 1999 by NAKANO Takeo +.\" +.\"WORD: standard name (¥Û¥¹¥È¤Î) ɸ½à̾ +.\"WORD: regular file Ä̾ï¥Õ¥¡¥¤¥ë +.\" +.TH RCMD 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O rcmd, rresvport, iruserok, ruserok \- routines for returning a +.\"O stream to a remote command +.SH ̾Á° +rcmd, rresvport, iruserok, ruserok \- ¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Ë¥¹¥È¥ê¡¼¥à¤òÊÖ¤¹´Ø¿ô·² +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include \ \ \fP/* Or on some systems */ +.sp +.BI "int rcmd(char **" ahost ", int " inport ", const char *" locuser ", " +.BI " const char *" remuser ", const char *" cmd ", int *" fd2p ); +.sp +.BI "int rresvport(int *" port ); +.sp +.BI "int iruserok(uint32_t " raddr ", int " superuser ", " +.BI " const char *" ruser ", const char *" luser ); +.sp +.BI "int ruserok(const char *" rhost ", int " superuser ", " +.BI " const char *" ruser ", const char *" luser ); +.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 rcmd (), +.BR rresvport (), +.BR ruserok (): +_BSD_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.BR rcmd () +´Ø¿ô¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤¬¥ê¥â¡¼¥È¥Þ¥·¥ó¤Ç¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë +ÍѤ¤¤é¤ì¤ë¡£¤³¤Î¤È¤­Æø¢¥Ý¡¼¥ÈÈÖ¹æ¤ò¤â¤È¤Ë¤·¤¿Ç§¾Ú¥¹¥­¡¼¥à¤¬ +ÍѤ¤¤é¤ì¤ë¡£ +.BR rresvport () +´Ø¿ô¤Ï¡¢Æø¢¥Ý¡¼¥È¶õ´Ö¤Î¥¢¥É¥ì¥¹¤ò»ý¤Ä¥½¥±¥Ã¥È¤Î +¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤òÊÖ¤¹¡£ +.BR iruserok () +´Ø¿ô¤È +.BR ruserok () +´Ø¿ô¤Ï¡¢ +.BR rcmd () +¤Ç¥µ¡¼¥Ó¥¹Í×µá¤ò¹Ô¤Ã¤¿¥¯¥é¥¤¥¢¥ó¥È¤Îǧ¾Ú¤ò¹Ô¤¦¤¿¤á¤Ë +¥µ¡¼¥Ð¡¼¤¬ÍѤ¤¤ë´Ø¿ô¤Ç¤¢¤ë¡£ +°Ê¾å¤Î 4 ¤Ä¤Î´Ø¿ô¤Ï¡¢¤¹¤Ù¤ÆƱ¤¸¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤Æ¤ª¤ê¡¢ +.BR rshd (8) +¥µ¡¼¥Ð¡¼¤Ë¤è¤Ã¤Æ (¾¤Î´Ø¿ô¤È¤È¤â¤Ë) ÍøÍѤµ¤ì¤ë¡£ +.PP +.BR rcmd () +´Ø¿ô¤Ï +.BR gethostbyname (3) +¤òÍѤ¤¤Æ +.I *ahost +¤Î»²¾È¤ò¹Ô¤¦¡£¥Û¥¹¥È¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ï +.I *ahost +¤Ë¥Û¥¹¥È¤Îɸ½à̾ (standard name) ¤ò¥»¥Ã¥È¤·¤Æ¡¢ +ͽÌ󤵤ì¤Æ¤¤¤ë¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Ý¡¼¥È +.I inport +·Ðͳ¤Ç¥µ¡¼¥Ð¡¼¤Ø¤ÎÀܳ¤ò³ÎΩ¤¹¤ë¡£ +.PP +Àܳ¤ËÀ®¸ù¤·¤¿¤é¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥É¥á¥¤¥ó¤Ë¸ºß¤¹¤ë¥¿¥¤¥× +.B SOCK_STREAM +¤Î¥½¥±¥Ã¥È¤¬¸Æ¤Ó½Ð¤·¤â¤È¤ËÊÖ¤µ¤ì¤ë¡£ +¤³¤Î¥½¥±¥Ã¥È¤ÎÁê¼ê¦¤Ï¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Î +.I stdin +¤ª¤è¤Ó +.I stdout +¤ËÀܳ¤µ¤ì¤ë¡£ +.I fd2p +¤¬¥¼¥í¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢À©¸æ¥×¥í¥»¥¹¤Ø¤ÎÀܳ¤¬¤â¤¦°ì¤ÄÍÑ°Õ¤µ¤ì¡¢ +¤½¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤¬ +.I *fd2p +¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +À©¸æ¥×¥í¥»¥¹¤Ï¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤«¤é¤Îɸ½à¥¨¥é¡¼½ÐÎÏ (unit 2) ¤ò +¤³¤Î¥Á¥ã¥ó¥Í¥ë¤ËÊÖ¤¹¡£ +¤Þ¤¿À©¸æ¥×¥í¥»¥¹¤Ï¤³¤ÎÀܳ¤«¤é¼õ¤±¼è¤Ã¤¿¥Ð¥¤¥È¥Ç¡¼¥¿¤ò +Unix ¥·¥°¥Ê¥ë¤ÎÈÖ¹æ¤È¤·¤Æ°·¤¤¡¢¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Î¥×¥í¥»¥¹ +¥°¥ë¡¼¥×¤Ø¤È¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.I fd2p +¤¬¥¼¥í¤Î¾ì¹ç¤Ï¡¢ +.I stderr +(¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Î unit 2) ¤Ï +.I stdout +¤È°ì½ï¤Ë¤Þ¤È¤á¤é¤ì¤ë¡£¤Þ¤¿¤³¤Î¾ì¹ç¤Ï¥ê¥â¡¼¥È¥×¥í¥»¥¹¤Ø +Ǥ°Õ¤Î¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +¤¿¤À¤·ÂÓ°è³° (out-of-band) ¥Ç¡¼¥¿¤òÍѤ¤¤ì¤Ð¡¢ +¥ê¥â¡¼¥È¥×¥í¥»¥¹¤ÎÃí°Õ¤ò°ú¤¯¤³¤È¤Ï¤Ç¤­¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +¥×¥í¥È¥³¥ë¤Î¾ÜºÙ¤Ï +.BR rshd (8) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.BR rresvport () +´Ø¿ô¤ÏÆø¢¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤¿¥½¥±¥Ã¥È¤ò¼èÆÀ¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +¤³¤Î¥½¥±¥Ã¥È¤Ï +.BR rcmd () +¤Ê¤É¤Î´Ø¿ô¤Ç¤ÎÍøÍѤËŬ¤·¤Æ¤¤¤ë¡£¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Ý¡¼¥È¤ÎÆø¢¥Ý¡¼¥È¤Ï¡¢ +0 ¤«¤é 1023 ¤ÎÈϰϤǤ¢¤ë¡£¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤À¤±¤¬¤³¤ì¤é¤Î¥¢¥É¥ì¥¹¤ò +¥½¥±¥Ã¥È¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.BR iruserok () +¤È +.BR ruserok () +´Ø¿ô¤Ï¡¢¤Þ¤º°Ê²¼¤Î°ú¿ô¤ò¼è¤ë: ¥ê¥â¡¼¥È¥Û¥¹¥È ( +.BR iruserok () +¤Ï IP ¥¢¥É¥ì¥¹¤Ç¡¢ +.BR ruserok () +¤Ï¥Û¥¹¥È̾¤Ç»ØÄê)¡¢ 2 ¤Ä¤Î¥æ¡¼¥¶¡¼Ì¾¡¢¥í¡¼¥«¥ë¥æ¡¼¥¶¡¼¤Î̾Á°¤¬ +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤Î¤â¤Î¤Ç¤¢¤ë¤«¤É¤¦¤«¤ò¼¨¤¹¥Õ¥é¥°¡¢¤Ç¤¢¤ë¡£ +¤â¤·¥æ¡¼¥¶¡¼¤¬\fB¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤Ç¤Ï¤Ê¤¤\fP¾ì¹ç¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I /etc/hosts.equiv +¥Õ¥¡¥¤¥ë¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¤ê¡¢ +ÆâÍƤΥÁ¥§¥Ã¥¯¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥í¡¼¥«¥ë¥æ¡¼¥¶¡¼¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë +.I .rhosts +¥Õ¥¡¥¤¥ë¤ò¥Á¥§¥Ã¥¯¤·¤Æ¡¢¥µ¡¼¥Ó¥¹Í׵᤬µö²Ä¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«Ä´¤Ù¤ë¡£ +.PP +¤³¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¤ê¡¢ +Ä̾ï¥Õ¥¡¥¤¥ë (regular file) ¤Ç¤Ï¤Ê¤«¤Ã¤¿¤ê¡¢ +»ØÄê¥æ¡¼¥¶¡¼¤Þ¤¿¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼°Ê³°¤Î½êÍ­¤À¤Ã¤¿¤ê¡¢ +½êÍ­¼Ô°Ê³°¤«¤é½ñ¤­¹þ¤ß²Äǽ¤À¤Ã¤¿¤ê¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +¤³¤Î¥Á¥§¥Ã¥¯¤Ï¼«Æ°Åª¤Ë¼ºÇÔ¤¹¤ë¡£ +¥Þ¥·¥ó¤Î̾Á°¤¬ +.I hosts.equiv +¤Ë¥ê¥¹¥È¤µ¤ì¤Æ¤¤¤¿¤ê¡¢ +¥Û¥¹¥È¤È¥ê¥â¡¼¥È¥æ¡¼¥¶¡¼¤Î̾Á°¤¬ +.I .rhosts +¥Õ¥¡¥¤¥ë¤Ë½ñ¤«¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR iruserok () +¤È +.BR ruserok () +¤Ï \-1 ¤òÊÖ¤¹¡£ +.RB ( gethostname (2) +¤Ë¤è¤Ã¤Æ¼èÆÀ¤µ¤ì¤ë) ¥í¡¼¥«¥ë¥É¥á¥¤¥ó¤¬¥ê¥â¡¼¥È¤Î¥É¥á¥¤¥ó¤ÈƱ¤¸¾ì¹ç¤Ï¡¢ +¥Þ¥·¥ó¤Î̾Á°¤À¤±¤ò»ØÄꤹ¤ì¤Ð¤è¤¤¡£ +.PP +¥ê¥â¡¼¥È¥Û¥¹¥È¤Î IP ¥¢¥É¥ì¥¹¤¬¤ï¤«¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.BR ruserok () +¤è¤ê¤â +.BR iruserok () ¤òÍѤ¤¤ëÊý¤¬Îɤ¤¤À¤í¤¦¡£ +.BR ruserok () +¤Ï¥ê¥â¡¼¥È¥Û¥¹¥È¤Î½ê°¤¹¤ë¥É¥á¥¤¥ó¤Î DNS ¥µ¡¼¥Ð¡¼¤¬¿®Íê¤Ç¤­¤Ê¤¯¤Æ¤â +»ÈÍѤǤ­¤ë¤«¤é¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR rcmd () +´Ø¿ô¤ÏÀ®¸ù¤¹¤ë¤ÈÍ­¸ú¤Ê¥½¥±¥Ã¥È¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È \-1 ¤òÊÖ¤·¡¢É¸½à¥¨¥é¡¼½ÐÎϤ˿ÇÃÇ¥á¥Ã¥»¡¼¥¸¤ò +ɽ¼¨¤¹¤ë¡£ +.PP +.BR rresvport () +´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È¥Ð¥¤¥ó¥É¤µ¤ì¤¿Í­¸ú¤Ê¥½¥±¥Ã¥È¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È \-1 ¤òÊÖ¤·¡¢¥°¥í¡¼¥Ð¥ëÊÑ¿ô +.I errno +¤ò¥¨¥é¡¼¤Î¸¶°ø¤ËÂбþ¤¹¤ëÃͤ˥»¥Ã¥È¤¹¤ë¡£ +¥¨¥é¡¼¥³¡¼¥É +.B EAGAIN +¤Ï¡¢¤³¤Î´Ø¿ô¤Ë¤ª¤¤¤Æ¤Ï¡Ö¤¹¤Ù¤Æ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥Ý¡¼¥È¤¬»ÈÍÑÃæ¡× +¤È¤¤¤¦°ÕÌ£¤òɽ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Not in POSIX.1-2001. +.\"O Present on the BSDs, Solaris, and many other systems. +.\"O These +.\"O functions appeared in +.\"O 4.2BSD. +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¡¢Solaris ¤ä¾¤Î¿¤¯¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï 4.2BSD ¤ÇÅо줷¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR rlogin (1), +.BR rsh (1), +.BR intro (2), +.BR rexec (3), +.BR rexecd (8), +.BR rlogind (8), +.BR rshd (8) diff --git a/draft/man3/re_comp.3 b/draft/man3/re_comp.3 new file mode 100644 index 00000000..5233452d --- /dev/null +++ b/draft/man3/re_comp.3 @@ -0,0 +1,85 @@ +.\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Thu Dec 18 15:06:31 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. +.\" +.\" 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. +.\" +.\" Wed Jun 14 16:10:28 BST 1995 Wilf. (G.Wilford@@ee.surrey.ac.uk) +.\" +.TH RE_COMP 3 1995-07-14 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +re_comp, re_exec \- BSD ¤ÎÀµµ¬É½¸½´Ø¿ô +.SH ½ñ¼° +.B #define _REGEX_RE_COMP +.br +.B #include +.br +.B #include +.sp +.BI "char *re_comp(char *" regex ); +.sp +.BI "int re_exec(char *" string ); +.SH ÀâÌÀ +.BR re_comp () +¤Ï¡¢ +.I regex +¤Ç¼¨¤µ¤ì¤ë NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Àµµ¬É½¸½¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¤ÏÀÅŪ¤ÊÎΰè¤ò»ÈÍѤ·¤Æ¤ª¤ê¡¢¤½¤Î¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡ +¤Ï°Ê¹ß¤Î +.BR re_comp () +¤Î»ÈÍѤˤè¤Ã¤Æ¾å½ñ¤­¤µ¤ì¤ë¡£ +¤â¤· +.I regex +¤¬ NULL ¤Ê¤é¤Ð²¿¤ÎÁàºî¤â¹Ô¤ï¤ì¤º¡¢¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤ÎÆâÍÆ¤Ï +ÃÖ¤­´¹¤¨¤é¤ì¤Ê¤¤¡£ + +.BR re_exec () +¤Ï¡¢ +.I string +¤¬»Ø¤¹ NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤¬Á°²ó¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ +.I regex +¤Ë¥Þ¥Ã¥Á¤¹¤ë¤«¤É¤¦¤«¤òɾ²Á¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR re_comp () +¤Ï¡¢ +.I regex +¤Î¥³¥ó¥Ñ¥¤¥ë¤ËÀ®¸ù¤·¤¿¾ì¹ç NULL ¤òÊÖ¤·¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤ÏŬÀڤʥ¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ + +.BR re_exec () +¤Ï¡¢°ìÃפ·¤¿¾ì¹ç 1 ¤ò¡¢¼ºÇÔ¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +4.3BSD. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O These functions are obsolete; the functions documented in +.\"O .BR regcomp (3) +.\"O should be used instead. +¤³¤ì¤é¤Î´Ø¿ô¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£Âå¤ï¤ê¤Ë +.BR regcomp (3) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë´Ø¿ô¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR regcomp (3), +.BR regex (7), +GNU regex manual diff --git a/draft/man3/readdir.3 b/draft/man3/readdir.3 new file mode 100644 index 00000000..9a2acff3 --- /dev/null +++ b/draft/man3/readdir.3 @@ -0,0 +1,408 @@ +.\" Copyright (C) 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 Sat Jul 24 16:09:49 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl) +.\" Modified 22 July 1996 by Andries Brouwer (aeb@cwi.nl) +.\" 2007-07-30 Ulrich Drepper , mtk: +.\" 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 2009-07-04 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O readdir, readdir_r \- read a directory +readdir, readdir_r \- ¥Ç¥£¥ì¥¯¥È¥ê¤òÆɤ߹þ¤à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "struct dirent *readdir(DIR *" dirp ); +.sp +.BI "int readdir_r(DIR *" dirp ", struct dirent *" entry \ +", struct dirent **" result ); +.fi +.sp +.in -4n +.\"O Feature Test Macro Requirements for glibc (see +.\"O .BR feature_test_macros (7)): +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.ad l +.in +.sp +.BR readdir_r (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.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 ¤òÊÖ¤¹¡£ +.PP +.\"O On Linux, the +.\"O .I dirent +.\"O structure is defined as follows: +Linux ¤Ç¤Ï +.I dirent +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.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; /* ¤³¤Î¥ì¥³¡¼¥É¤ÎŤµ */ + unsigned char d_type; /* ¥Õ¥¡¥¤¥ë¼ïÊÌ¡£Á´¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à */ + ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤ */ + char d_name[256]; /* ¥Õ¥¡¥¤¥ë̾ */ +}; +.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. +¾¤Î¥Õ¥£¡¼¥ë¥É¤ÏÈóɸ½à¤Ç¤¢¤ê¡¢Á´¤Æ¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢²¼µ­¤Î¡ÖÃí°Õ¡×¤ò»²¾È¤Î¤³¤È¡£ +.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 () +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ¾å½ñ¤­¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ + +.\"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" +.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 +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ + +.\"O The +.\"O .BR readdir_r () +.\"O function returns 0 on success. +.\"O On error, it returns a positive error number. +.\"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 +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O Invalid directory stream descriptor \fIdirp\fP. +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¥Ç¥£¥¹¥¯¥ê¥×¥¿ \fIdirp\fP ¤¬Ìµ¸ú¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.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 +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤«¤ò¥Æ¥¹¥È¤¹¤ì¤Ð¤è¤¤¡£ + +.\"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. +¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¡£ +.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. +¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤¬ÉÔÌÀ¤Ç¤¢¤ë¡£ +.\" 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 +¤¬Æþ¤ë¡£ + +.\"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 +¤¬ÊÖ¤µ¤ì¤¿ºÝ¤ËŬÀڤ˽èÍý¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"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 +¤ËÅϤ¹¥Ð¥Ã¥Õ¥¡¤ò¼¡¤Î¤è¤¦¤Ë¤·¤Æ³ä¤êÅö¤Æ¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.in +4n +.nf + +len = offsetof(struct dirent, d_name) + + pathconf(dirpath, _PC_NAME_MAX) + 1 +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" +.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), +.BR feature_test_macros (7) diff --git a/draft/man3/realpath.3 b/draft/man3/realpath.3 new file mode 100644 index 00000000..68cb49e7 --- /dev/null +++ b/draft/man3/realpath.3 @@ -0,0 +1,360 @@ +.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.) +.\" +.\" 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. +.\" +.\" Rewritten old page, 990824, aeb@cwi.nl +.\" 2004-12-14, mtk, added discussion of resolved_path == NULL +.\" +.\" Japanese Version Copyright (c) 1998 SHOJI Yasushi all rights reserved. +.\" Translated 1998-03-22, SHOJI Yasushi +.\" Updated 1999-03-07, Shouichi Saito +.\" Updated 2003-01-17, Akihiro MOTOKI +.\" Updated 2005-02-27, Akihiro MOTOKI +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2009-04-24, Akihiro MOTOKI, LDP v3.20 +.\" +.\"WORD: bounded À©¸Â¤¬¤Ê¤¤ +.\" +.TH REALPATH 3 2009-02-23 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O realpath \- return the canonicalized absolute pathname +.SH ̾Á° +realpath \- Àµµ¬²½¤µ¤ì¤¿ÀäÂХѥ¹Ì¾¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "char *realpath(const char *" path ", char *" resolved_path ); +.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 realpath (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR realpath () +.\"O expands all symbolic links and resolves references +.\"O to +.\"O .IR "/./" ", " "/../" +.\"O and extra \(aq/\(aq +.\"O characters in the null-terminated string named by +.\"O .I path +.\"O to produce a canonicalized absolute pathname. +.\"O The resulting pathname is stored as a null-terminated string, +.\"O up to a maximum of +.\"O .B PATH_MAX +.\"O bytes, +.\"O in the buffer pointed to by +.\"O .IR resolved_path . +.BR realpath () +¤Ï +.I path +¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿ NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎóÃæ¤Î +¤¹¤Ù¤Æ¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òŸ³«¤·¡¢ +.IR "/./" ", " "/../" +¤Ë¤è¤ë»²¾È¤ä;ʬ¤Ê \(aq/\(aq +¤ò²ò·è¤·¤Æ¡¢Àµµ¬²½¤µ¤ì¤¿ÀäÂХѥ¹Ì¾¤òÀ¸À®¤¹¤ë¡£ +ÆÀ¤é¤ì¤¿ÀäÂХѥ¹Ì¾¤Ï¡¢ºÇÂç¤Ç +.B PATH_MAX +¥Ð¥¤¥È¤Î NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤È¤·¤Æ¡¢ +.I resolved_path +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.\"O The resulting path will have no symbolic link, +.\"O .I "/./" +.\"O or +.\"O .I "/../" +.\"O components. +·ë²Ì¤È¤·¤ÆÊÖ¤ë¥Ñ¥¹¤ÎÃæ¤Ë¤Ï¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ä +.IR "/./" ", " "/../" +¤È¤¤¤Ã¤¿Í×ÁǤϴޤޤì¤Ê¤¤¡£ +.\"O If +.\"O .I resolved_path +.\"O is specified as NULL, then +.\"O .BR realpath () +.\"O uses +.\"O .BR malloc (3) +.\"O to allocate a buffer of up to +.\"O .B PATH_MAX +.\"O bytes to hold the resolved pathname, +.\"O and returns a pointer to this buffer. +.\"O The caller should deallocate this buffer using +.\"O .BR free (3). +.I resolved_path +¤Ë NULL ¤¬»ØÄꤵ¤ì¤ë¤È¡¢ +.BR realpath () +¤Ï +.BR malloc (3) +¤ò»È¤Ã¤Æ²ò·è¤·¤¿¥Ñ¥¹Ì¾¤òÊÝ»ý¤¹¤ë¤¿¤á¤Î¥Ð¥Ã¥Õ¥¡¤ò +ºÇÂç¤Ç +.B PATH_MAX +¥Ð¥¤¥È¤Þ¤Ç³ä¤êÅö¤Æ¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï¡¢ +.BR free (3) +¤ò»È¤Ã¤Æ¤³¤Î¥Ð¥Ã¥Õ¥¡¤ò²òÊü¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .\" Even if we use resolved_path == NULL, then realpath() will still +.\"O .\" return ENAMETOOLONG if the resolved pathname would exceed PATH_MAX +.\"O .\" bytes -- MTK, Dec 04 +.\" resolved_path == NULL ¤ò»ØÄꤷ¤¿¾ì¹ç¤Ç¤â¡¢²ò·è¤·¤¿¥Ñ¥¹Ì¾¤ÎŤµ¤¬ +.\" PATH_MAX ¥Ð¥¤¥È¤òĶ¤¨¤¿¤È¤­¤Ë¤Ï¡¢realpath() ¤ÏÁ°¤ÈƱ¤¸¤¯ +.\" ENAMETOOLONG ¤òÊÖ¤¹¡£-- MTK, Dec 04 +.\"O .\" .SH HISTORY +.\" .SH Îò»Ë +.\"O .\" The +.\"O .\" .BR realpath () +.\"O .\" function first appeared in 4.4BSD, contributed by Jan-Simon Pendry. +.\" .BR realpath () +.\" ´Ø¿ô¤Ï 4.4BSD ¤Ç½é¤á¤ÆÅо줷¤¿ (Jan-Simon Pendry ¤Ë¤è¤êÄ󶡤µ¤ì¤¿)¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O If there is no error, +.\"O .BR realpath () +.\"O returns a pointer to the +.\"O .IR resolved_path . +¥¨¥é¡¼¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.BR realpath () +¤Ï +.I resolved_path +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ + +.\"O Otherwise it returns a NULL pointer, and the contents +.\"O of the array +.\"O .I resolved_path +.\"O are undefined, and +.\"O .I errno +.\"O is set to indicate the error. +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¥Ì¥ë (NULL) ¥Ý¥¤¥ó¥¿¡¼¤¬Ê֤ꡢÇÛÎó +.I resolved_path +¤ÎÆâÍƤÏÉÔÄê¤È¤Ê¤ê¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ÎÆâÍƤò¼¨¤¹Ãͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O Read or search permission was denied for a component of the path prefix. +¥Ñ¥¹¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Ë¡¢Æɤ߽Ф·µö²Ä¤Þ¤¿¤Ï¸¡º÷µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O Either +.\"O .I path +.\"O or +.\"O .I resolved_path +.\"O is NULL. +.\"O (In libc5 this would just cause a segfault.) +.\"O But, see NOTES below. +.I path +¤« +.I resolved_path +¤Î¤¤¤º¤ì¤«¤¬ NULL ¤Ç¤¢¤ë¡£ +(libc5 ¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤Ê¾ì¹ç segfault ¤òµ¯¤³¤¹¤À¤±¤Ç¤¢¤í¤¦) +⤷¡¢²¼µ­¤Î¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B EIO +.\"O An I/O error occurred while reading from the file system. +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÆɤà¤È¤­¤Ë¡¢I/O¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B ELOOP +.\"O Too many symbolic links were encountered in translating the pathname. +¥Ñ¥¹Ì¾¤ÎÊÑ´¹¤Ë¤¢¤¿¤ê¡¢²ò·è¤¹¤Ù¤­¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î¿ô¤¬Â¿²á¤®¤¿¡£ +.TP +.B ENAMETOOLONG +.\"O A component of a pathname exceeded +.\"O .B NAME_MAX +.\"O characters, or an entire pathname exceeded +.\"O .B PATH_MAX +.\"O characters. +¥Ñ¥¹Ì¾¤Î°ìÍ×ÁǤÎʸ»ú¿ô¤¬ +.B NAME_MAX +¤ò±Û¤¨¤Æ¤¤¤ë¡¢¤Þ¤¿¤Ï¥Ñ¥¹Ì¾Á´ÂΤÎʸ»ú¿ô¤¬ +.B PATH_MAX +¤ò±Û¤¨¤Æ¤¤¤ë¡£ +.TP +.B ENOENT +.\"O The named file does not exist. +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOTDIR +.\"O A component of the path prefix is not a directory. +¥Ñ¥¹¤Î¥Ç¥£¥ì¥¯¥È¥êÍ×ÁǤ¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O On Linux this function appeared in libc 4.5.21. +¤³¤Î´Ø¿ô¤¬ Linux ¤ËÅо줷¤¿¤Î¤Ï libc 4.5.21 ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.4BSD, POSIX.1-2001. + +.\"O POSIX.1-2001 says that the behavior if +.\"O .I resolved_path +.\"O is NULL is implementation-defined. +.\"O POSIX.1-2008 specifies the behavior described in this page. +POSIX.1-2001 ¤Ç¤Ï +.I resolved_path +¤¬ NULL ¤Î¾ì¹ç¤ÎÆ°ºî¤Ï¼ÂÁõ¤Ë°Í¸¤¹¤ë¤È¤·¤Æ¤¤¤ë¡£ +POSIX.1-2008 ¤Ç¤Ï¡¢¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë½ñ¤«¤ì¤Æ¤¤¤ëÆ°ºî¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O In 4.4BSD and Solaris the limit on the pathname length is +.\"O .B MAXPATHLEN +.\"O (found in \fI\fP). +.\"O SUSv2 prescribes +.\"O .B PATH_MAX +.\"O and +.\"O .BR NAME_MAX , +.\"O as found in \fI\fP or provided by the +.\"O .BR pathconf (3) +.\"O function. +.\"O A typical source fragment would be +.\"O .LP +.\"O .in +4n +.\"O .nf +.\"O #ifdef PATH_MAX +.\"O path_max = PATH_MAX; +.\"O #else +.\"O path_max = pathconf(path, _PC_PATH_MAX); +.\"O if (path_max <= 0) +.\"O path_max = 4096; +.\"O #endif +.\"O .fi +.\"O .in +4.4BSD ¤È Solaris ¤Ç¤Ï¡¢¥Ñ¥¹Ì¾¤ÎŤµ¤Î¾å¸Â¤Ï +(\fI\fP ¤ÎÃæ¤Ë¤¢¤ë) +.B MAXPATHLEN +¤Ç¤¢¤ë¡£SUSv2 ¤Ç¤Ï +.B PATH_MAX +¤È +.B NAME_MAX +¤¬µ¬Äꤵ¤ì¤Æ¤ª¤ê¡¢ +¤³¤ì¤é¤Ï \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤«¡¢ +.BR pathconf (3) +´Ø¿ô¤«¤éÆÀ¤é¤ì¤ë¡£°Ê²¼¤Î¤è¤¦¤Ê¥½¡¼¥¹¥³¡¼¥É¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¤¡£ +.LP +.in +4n +.nf +#ifdef PATH_MAX + path_max = PATH_MAX; +#else + path_max = pathconf(path, _PC_PATH_MAX); + if (path_max <= 0) + path_max = 4096; +#endif +.fi +.in +.LP +.\"O (But see the BUGS section.) +(¥Ð¥°¤Î¾Ï¤â»²¾È¤Î¤³¤È¡£) +.LP +.\"O The 4.4BSD, Linux and SUSv2 versions always return an absolute +.\"O pathname. +.\"O Solaris may return a relative pathname when the +.\"O .I path +.\"O argument is relative. +4.4BSD¡¢Linux¡¢SUSv2 ¤Ç¤Ï¡¢ÊÖ¤êÃͤϾï¤ËÀäÂХѥ¹Ì¾¤Ç¤¢¤ë¡£ +Solaris ¤Ç¤Ï¡¢ +°ú¤­¿ô +.I path +¤¬ÁêÂХѥ¹¤Î¾ì¹ç¡¢ÊÖ¤êÃͤ¬ÁêÂХѥ¹¤Ë¤Ê¤ë¤³¤È¤¬¤¢¤ë¡£ +.\"O The prototype of +.\"O .BR realpath () +.\"O is given in \fI\fP in libc4 and libc5, +.\"O but in \fI\fP everywhere else. +.BR realpath () +¤Î¥×¥í¥È¥¿¥¤¥×Àë¸À¤Ï¡¢ +libc4 ¤È libc5 ¤Ç¤Ï \fI\fP ¤Ë¤¢¤ë¤¬¡¢ +¤½¤ì°Ê³°¤Î´Ä¶­¤Ç¤Ï¤¤¤º¤ì¤â \fI\fP ¤Ë¤¢¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The POSIX.1-2001 standard version of this function is broken by design, +.\"O since it is impossible to determine a suitable size for the output buffer, +.\"O .IR resolved_path . +.\"O According to POSIX.1-2001 a buffer of size +.\"O .B PATH_MAX +.\"O suffices, but +.\"O .B PATH_MAX +.\"O need not be a defined constant, and may have to be obtained using +.\"O .BR pathconf (3). +¤³¤Î´Ø¿ô¤Î POSIX.1-2001 ÈǤϡ¢Àß·×Ãʳ¬¤«¤éÌäÂ꤬¤¢¤ë¡£ +½ÐÎϥХåե¡ +.I resolved_path +¤ÎŬÀڤʥµ¥¤¥º¤ò·èÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï¥Ð¥Ã¥Õ¥¡¡¦¥µ¥¤¥º¤È¤·¤Æ +.B PATH_MAX +¤Ï½½Ê¬¤À¤È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +.B PATH_MAX +¤ÏÄêµÁºÑ¤ÎÄê¿ô¤Ç¤¢¤ëɬÍפϤʤ¯¡¢ +.BR pathconf (3) +¤ò»È¤Ã¤ÆÆÀ¤é¤ì¤ëÃͤǤ¢¤Ã¤Æ¤â¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O And asking +.\"O .BR pathconf (3) +.\"O does not really help, since, on the one hand POSIX warns that +.\"O the result of +.\"O .BR pathconf (3) +.\"O may be huge and unsuitable for mallocing memory, +.\"O and on the other hand +.\"O .BR pathconf (3) +.\"O may return \-1 to signify that +.\"O .B PATH_MAX +.\"O is not bounded. +.BR pathconf (3) +¤«¤é¥Ð¥Ã¥Õ¥¡¡¦¥µ¥¤¥º¤ò¼èÆÀ¤·¤¿¤È¤·¤Æ¤âɬ¤º¤·¤â½½Ê¬¤Ç¤Ï¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢POSIX ¤Ç·Ù¹ð¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¡¢ +.BR pathconf (3) +¤ÎÊÖ¤êÃͤ¬Â礭²á¤®¤ÆŬÀڤ˥á¥â¥ê¤ò³ÎÊݤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤ +¤«¤â¤·¤ì¤Ê¤¤°ìÊý¤Ç¡¢ +.BR pathconf (3) +¤Ï +.B PATH_MAX +¤ËÀ©¸Â¤¬¤Ê¤¤¤³¤È¤ò¼¨¤¹ \-1 ¤òÊÖ¤¹¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.\"O The +.\"O .I "resolved_path\ ==\ NULL" +.\"O feature, not standardized in POSIX.1-2001, +.\"O but standardized in POSIX.1-2008, allows this design problem to be avoided. +.I "resolved_path\ ==\ NULL" +¤Îµ¡Ç½¤ò»È¤¦¤È¡¢¤³¤ÎÀß·×¾å¤ÎÌäÂê¤ò²óÈò¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Îµ¡Ç½¤Ï POSIX.1-2001 ¤Ç¤Ïɸ½à²½¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +POSIX.1-2008 ¤Ç¤Ïɸ½à²½¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +.\"O The libc4 and libc5 implementation contains a buffer overflow +.\"O (fixed in libc-5.4.13). +.\"O Thus, set-user-ID programs like +.\"O .BR mount (8) +.\"O need a private version. +libc4 ¤È libc5 ¤Î¼ÂÁõ¤Ï¥Ð¥Ã¥Õ¥¡¡¦¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Î²ÄǽÀ­¤ò»ý¤Ã¤Æ¤¤¤ë +(libc-5.4.13 ¤Ç½¤Àµ¤µ¤ì¤¿¤¬)¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +.BR mount (8) +¤Î¤è¤¦¤Ê set-user-ID ¤µ¤ì¤ë¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +¤³¤Î´Ø¿ôÁêÅö¤Î´Ø¿ô¤ò¼«Á°¤Ç»ý¤ÄɬÍפ¬¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR readlink (2), +.BR canonicalize_file_name (3), +.BR getcwd (3), +.BR pathconf (3), +.BR sysconf (3) diff --git a/draft/man3/recno.3 b/draft/man3/recno.3 new file mode 100644 index 00000000..f9f86393 --- /dev/null +++ b/draft/man3/recno.3 @@ -0,0 +1,354 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)recno.3 8.5 (Berkeley) 8/18/94 +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito +.\" all rights reserved. +.\" Translated Mon Jul 26 12:18:39 JST 1999 +.\" by Shouichi Saito +.\" Proofed Tue Aug 19 1999 by NAKANO Takeo +.\" +.\"WORD: access method ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.\"WORD: pad character Ëä¤áʸ»ú +.TH RECNO 3 1994-08-18 "" "Linux Programmer's Manual" +.UC 7 +.SH ̾Á° +.\"O recno \- record number database access method +recno \- ¥ì¥³¡¼¥ÉÈÖ¹æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.SH ½ñ¼° +.nf +.ft B +#include +#include +.ft R +.fi +.SH ÀâÌÀ +.\"O The routine +.\"O .BR dbopen (3) +.\"O is the library interface to database files. +¥ë¡¼¥Á¥ó +.BR dbopen (3) +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +.\"O One of the supported file formats is record number files. +.\"O The general description of the database access methods is in +.\"O .BR dbopen (3), +.\"O this manual page describes only the recno specific information. +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Î°ì¤Ä¤Ë¡¢ +¥ì¥³¡¼¥ÉÈÖ¹æ¥Õ¥¡¥¤¥ë (record number file: recno file) ¤¬¤¢¤ë¡£ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ë´Ø¤¹¤ë°ìÈÌŪ¤Êµ­½Ò¤Ï +.BR dbopen (3), +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï recno ÆÃÍ­¤Î¾ðÊó¤Ë¤Ä¤¤¤Æ¤Î¤ßµ­½Ò¤¹¤ë¡£ +.PP +.\"O The record number data structure is either variable or fixed-length +.\"O records stored in a flat-file format, accessed by the logical record +.\"O number. +¥ì¥³¡¼¥ÉÈÖ¹æ¥Ç¡¼¥¿¹½Â¤¤Ï¡¢¥Õ¥é¥Ã¥È¤Ê¥Õ¥¡¥¤¥ë·Á¼°¤Ë³ÊǼ¤µ¤ì¤¿ +²ÄÊÑĹ/¸ÇÄêĹ¥ì¥³¡¼¥É¤«¤é¤Ê¤ê¡¢ÏÀÍý¥ì¥³¡¼¥ÉÈÖ¹æ¤Ç¥¢¥¯¥»¥¹¤µ¤ì¤ë¡£ +.\"O The existence of record number five implies the existence of records +.\"O one through four, and the deletion of record number one causes +.\"O record number five to be renumbered to record number four, as well +.\"O as the cursor, if positioned after record number one, to shift down +.\"O one record. +¥ì¥³¡¼¥ÉÈÖ¹æ 5 ¤¬¤¢¤ì¤Ð¡¢¥ì¥³¡¼¥ÉÈÖ¹æ 1 ¤«¤é 4 ¤â¸ºß¤¹¤ë¡£ +¥ì¥³¡¼¥ÉÈÖ¹æ 1 ¤òºï½ü¤¹¤ë¤È¡¢¥ì¥³¡¼¥ÉÈÖ¹æ 5 ¤Ï 4 ¤ËÉÕ¤±Âؤ¨¤é¤ì¡¢ +¥«¡¼¥½¥ë¤â°ÜÆ°¤¹¤ë¡£¥ì¥³¡¼¥ÉÈÖ¹æ 1 °Ê¹ß¤Î¤â¤Î¤Ï°ì¤Ä·«¤ê¾å¤¬¤ë¤ï¤±¤Ç¤¢¤ë¡£ +.PP +.\"O The recno access method specific data structure provided to +.\"O .BR dbopen (3) +.\"O is defined in the +.\"O .I +.\"O include file as follows: +.BR dbopen (3) +¤Ç»È¤¦ recno ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤ËÆÃÍ­¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢ +.I +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ç¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.in +4n +.nf +typedef struct { + unsigned long flags; + unsigned int cachesize; + unsigned int psize; + int lorder; + size_t reclen; + unsigned char bval; + char *bfname; +} RECNOINFO; +.fi +.in +.PP +.\"O The elements of this structure are defined as follows: +¤³¤Î¹½Â¤ÂΤÎÍ×ÁǤò°Ê²¼¤Ë¼¨¤¹¡£ +.TP +flags +.\"O The flag value is specified by +.\"O .IR or 'ing +.\"O any of the following values: +flag ¤ÎÃÍ¤Ï +°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤«¡¢¤³¤ì¤é¤ÎÏÀÍýϤǻØÄꤵ¤ì¤ë¡£ +.RS +.TP +.B R_FIXEDLEN +.\"O The records are fixed-length, not byte delimited. +¥ì¥³¡¼¥ÉŤ¬¸ÇÄê¤Ç¤¢¤ê¡¢¥Ð¥¤¥È¶èÀÚ¤ê¤Ç¤Ï¤Ê¤¤¡£ +.\"O The structure element +.\"O .I reclen +.\"O specifies the length of the record, and the structure element +.\"O .I bval +.\"O is used as the pad character. +¹½Â¤ÂΤÎÍ×ÁÇ +.I reclen +¤Ï¥ì¥³¡¼¥É¤ÎŤµ¤ò»ØÄꤹ¤ë¡£¤Þ¤¿¡¢Í×ÁÇ +.I bval +¤ÏËä¤áʸ»ú (pad character) ¤ò»ØÄꤹ¤ë¡£ +.\"O Any records, inserted into the database, that are less than +.\"O .I reclen +.\"O bytes long are automatically padded. +¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÆþ¤ì¤é¤ì¤¿¥ì¥³¡¼¥É¤ÎÆâ +.I reclen +¥Ð¥¤¥È¤ËËþ¤¿¤Ê¤¤¤â¤Î¤Ç¤Ï¡¢»Ä¤ê¤ÎÉôʬ¤ËËä¤áʸ»ú¤¬¼«Æ°Åª¤ËÆþ¤ë¡£ +.TP +.B R_NOKEY +.\"O In the interface specified by +.\"O .BR dbopen (3), +.\"O the sequential record retrieval fills in both the caller's key and +.\"O data structures. +.BR dbopen (3) +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ç¤Ï¡¢¥·¡¼¥±¥ó¥·¥ã¥ë¤Ê¥ì¥³¡¼¥É¼èÆÀ¤Ï +¸Æ¤Ó½Ð¤·¥­¡¼¤È¥Ç¡¼¥¿¹½Â¤ÂΤÎξÊý¤òËä¤á¤Æ¤¤¤¯¡£ +.\"O If the +.\"O .B R_NOKEY +.\"O flag is specified, the +.\"O .I cursor +.\"O routines are not required to fill in the key structure. +.\"O This permits applications to retrieve records at the end of files without +.\"O reading all of the intervening records. +.B R_NOKEY +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢¥­¡¼¹½Â¤ÂΤòËä¤á¤ë¤Î¤Ë +.I cursor +¥ë¡¼¥Á¥ó¤òɬÍפȤ·¤Ê¤¤¡£ +¤³¤ì¤òÍѤ¤¤ì¤Ð¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¥Õ¥¡¥¤¥ë¤Î½ª¤ê¤ÎÊý¤ò¼èÆÀ¤¹¤ëºÝ¤Ë¡¢ +¤½¤ÎÅÓÃæ¤Î¥ì¥³¡¼¥É¤òÆɤޤʤ¯¤Æ¤âºÑ¤à»ö¤Ë¤Ê¤ë¡£ +.TP +.B R_SNAPSHOT +.\"O This flag requires that a snapshot of the file be taken when +.\"O .BR dbopen (3) +.\"O is called, instead of permitting any unmodified records to be read from +.\"O the original file. +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢ +.BR dbopen (3) +¤Î¸Æ¤Ó½Ð¤·¤ÎºÝ¡¢ +¥ª¥ê¥¸¥Ê¥ë¥Õ¥¡¥¤¥ë¤«¤éÊѹ¹¤µ¤ì¤Æ¤¤¤Ê¤¤¥ì¥³¡¼¥É¤òÆɤàÂå¤ï¤ê¤Ë¡¢ +¥Õ¥¡¥¤¥ë¤Î snapshot ¤òÍѤ¤¤ë¡£ +.RE +.TP +.I cachesize +.\"O A suggested maximum size, in bytes, of the memory cache. +.\"O This value is +.\"O .B only +.\"O advisory, and the access method will allocate more memory rather than fail. +.\"O If +.\"O .I cachesize +.\"O is 0 (no size is specified) a default cache is used. +ÁÛÄꤵ¤ì¤ë¥á¥â¥ê¥­¥ã¥Ã¥·¥å¤ÎºÇÂ祵¥¤¥º (¥Ð¥¤¥Èñ°Ì)¡£ +¤³¤ÎÃÍ¤Ï +.B ¤¢¤¯¤Þ¤Ç +»²¹Í¤Ç¤¢¤ê¡¢¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ï¤³¤ÎÃͤò±Û¤¨¤¿¥á¥â¥ê¤Î +³ä¤êÅö¤Æ¤ËÀ®¸ù¤¹¤ë¤³¤È¤â¤¢¤ë¡£ +.I cachesize +¤¬ 0 (¤¢¤ë¤¤¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥­¥ã¥Ã¥·¥å¤¬»È¤ï¤ì¤ë¡£ +.TP +.I psize +.\"O The recno access method stores the in-memory copies of its records +.\"O in a btree. +.\"O This value is the size (in bytes) of the pages used for nodes in that tree. +recno ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ï¡¢¼«¿È¤Î¥ì¥³¡¼¥É¤Î¥³¥Ô¡¼¤ò¥á¥â¥êÆâÉô¤Ë +btree ¤ÇÊݸ¤·¤Æ¤¤¤ë¡£ +¤³¤ÎÃͤϡ¢¤½¤Î btree Ãæ¤Î¥Î¡¼¥É¤ËÂФ·¤ÆÍѤ¤¤é¤ì¤ë +¥Ú¡¼¥¸¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤Ç¤¢¤ë¡£ +.\"O If +.\"O .I psize +.\"O is 0 (no page size is specified) a page size is chosen based on the +.\"O underlying file system I/O block size. +.\"O See +.\"O .BR btree (3) +.\"O for more information. +.I psize +¤¬ 0 (¤¢¤ë¤¤¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î I/O ¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ò´ð¤Ë¤·¤Æ +¥Ú¡¼¥¸¥µ¥¤¥º¤¬·è¤á¤é¤ì¤ë¡£ +¾ÜºÙ¤Ï +.BR btree (3) +¤ò»²¾È¡£ +.TP +.I lorder +.\"O The byte order for integers in the stored database metadata. +.\"O The number should represent the order as an integer; for example, +.\"O big endian order would be the number 4,321. +.\"O If +.\"O .I lorder +.\"O is 0 (no order is specified) the current host order is used. +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥á¥¿¥Ç¡¼¥¿¤ÎÀ°¿ôÃͤΥХ¤¥È¥ª¡¼¥À¡¼¡£ +¤³¤Î¿ô»ú¤Ï¡¢½ç½ø¤òÀ°¿ô¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +Î㤨¤Ð¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤Ê¤é¡¢¤³¤Î¿ôÃÍ¤Ï 4,321 ¤È¤Ê¤ë¡£ +.I lorder +¤¬ 0 (»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢¸½ºß¤Î¥Û¥¹¥È +¤Ç»È¤ï¤ì¤Æ¤¤¤ë¥Ð¥¤¥È¥ª¡¼¥À¡¼¤¬»È¤ï¤ì¤ë¡£ +.TP +.I reclen +.\"O The length of a fixed-length record. +¸ÇÄê¥ì¥³¡¼¥ÉŤÎŤµ¡£ +.TP +.I bval +.\"O The delimiting byte to be used to mark the end of a record for +.\"O variable-length records, and the pad character for fixed-length +.\"O records. +²ÄÊѥ쥳¡¼¥ÉŤˤª¤¤¤Æ¡¢ +¥ì¥³¡¼¥É¤Î½ª¤ê¤ò¼¨¤¹¶èÀÚ¤ê¥Ð¥¤¥È (¶èÀÚ¤êʸ»ú) ¤Ç¤¢¤ë¡£ +¸ÇÄê¥ì¥³¡¼¥ÉŤǤÏËä¤áʸ»ú¤È¤·¤Æ»È¤ï¤ì¤ë¡£ +.\"O If no value is specified, newlines ("\en") are used to mark the end +.\"O of variable-length records and fixed-length records are padded with +.\"O spaces. +Ãͤ¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢ +²ÄÊѥ쥳¡¼¥ÉĹ¤Î¥ì¥³¡¼¥É¤Î½ª¤ê¤Ë¤Ï²þ¹Ô ("\en") ¤¬»È¤ï¤ì¤ë¡£ +¸ÇÄê¥ì¥³¡¼¥ÉĹ¤Î¥ì¥³¡¼¥É¤Ï¶õÇò (space) ¤ÇËä¤á¤é¤ì¤ë¡£ +.TP +.I bfname +.\"O The recno access method stores the in-memory copies of its records +.\"O in a btree. +.\"O If +.\"O .I bfname +.\"O is non-NULL, it specifies the name of the btree file, +.\"O as if specified as the filename for a +.\"O .BR dbopen (3) +.\"O of a btree file. +recno ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ï¡¢ +¼«¿È¤Î¥ì¥³¡¼¥É¤Î¥³¥Ô¡¼¤ò¥á¥â¥êÆâÉô¤Ç btree ¤ËÊݸ¤·¤Æ¤¤¤ë¡£ +.I bfname +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢¤³¤ì¤Ï btree ¥Õ¥¡¥¤¥ë̾ +(btree ¥Õ¥¡¥¤¥ë¤ò +.BR dbopen (3) +¤¹¤ë»þ¤Ë»ØÄꤹ¤ë¥Õ¥¡¥¤¥ë̾) ¤ò»ØÄꤹ¤ë¡£ +.PP +.\"O The data part of the key/data pair used by the +.\"O .I recno +.\"O access method +.\"O is the same as other access methods. +.I recno +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ç»È¤ï¤ì¤ë¥­¡¼/¥Ç¡¼¥¿ÂФΥǡ¼¥¿Éôʬ¤Ï¡¢ +¾¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.\"O The key is different. +.\"O The +.\"O .I data +.\"O field of the key should be a pointer to a memory location of type +.\"O .IR recno_t , +.\"O as defined in the +.\"O .I +.\"O include file. +¤·¤«¤·¥­¡¼¤Ï°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +¥­¡¼¤Î +.I data +¥Õ¥£¡¼¥ë¥É¤Ï +.I recno_t +·¿¤Î¡¢¥á¥â¥ê°ÌÃ֤ؤΥݥ¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I recno_t +¤Ï +.I +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O This type is normally the largest unsigned integral type available to +.\"O the implementation. +¤³¤Î·¿¤ÏÄ̾¤½¤Î¼ÂÁõ¤ÇÍøÍѲÄǽ¤ÊºÇÂç¤ÎÉä¹æ̵¤·À°¿ô¤Ç¤¢¤ë¡£ +.\"O The +.\"O .I size +.\"O field of the key should be the size of that type. +¥­¡¼¤Î +.I size +¥Õ¥£¡¼¥ë¥É¤Ï¤½¤Î·¿¤Î¥µ¥¤¥º¤È¤Ê¤ë¡£ +.PP +.\"O Because there can be no metadata associated with the underlying +.\"O recno access method files, any changes made to the default values +.\"O (e.g., fixed record length or byte separator value) must be explicitly +.\"O specified each time the file is opened. +recno ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Î¥Õ¥¡¥¤¥ë¤Ë´ØÏ¢¤Å¤±¤é¤ì¤ë +¥á¥¿¥Ç¡¼¥¿¤Ï¸ºß¤Ç¤­¤Ê¤¤¤«¤é¡¢ +¥Ç¥Õ¥©¥ë¥ÈÃÍ (¸ÇÄê¥ì¥³¡¼¥ÉĹ¤ä¥»¥Ñ¥ì¡¼¥¿Ê¸»ú¤Ê¤É) +¤ËÂФ¹¤ëÊѹ¹¤Ï¥Õ¥¡¥¤¥ë¤ò³«¤¯Ëè¤ËÌÀ¼¨Åª¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O In the interface specified by +.\"O .BR dbopen (3), +.\"O using the +.\"O .I put +.\"O interface to create a new record will cause the creation of multiple, +.\"O empty records if the record number is more than one greater than the +.\"O largest record currently in the database. +.BR dbopen (3) +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ç¤Ï¡¢ +.I put +¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤ò»È¤Ã¤Æ¿·¤·¤¤¥ì¥³¡¼¥É¤òºîÀ®¤¹¤ë¤È¤­¤Ë¡¢ +»ØÄꤷ¤¿¥ì¥³¡¼¥ÉÈֹ椬¥Ç¡¼¥¿¥Ù¡¼¥¹Ãæ¤Ë¸ºß¤·¤Æ¤¤¤ëºÇÂç¥ì¥³¡¼¥ÉÈÖ¹æ¤è¤ê +°ì¤Ä°Ê¾åÂ礭¤¤¤È¡¢ +¶õ¤Î¥ì¥³¡¼¥É¤¬Æ±»þ¤Ë¤Ç¤­¤Æ¤·¤Þ¤¦¡£ +.SH ¥¨¥é¡¼ +.\"O The +.\"O .I recno +.\"O access method routines may fail and set +.\"O .I errno +.\"O for any of the errors specified for the library routine +.\"O .BR dbopen (3) +.\"O or the following: +.I recno +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¥ë¡¼¥Á¥ó¤Ï¼ºÇÔ¤¹¤ë¤È +.BR dbopen (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.IR errno " ¤«¡¢" +¤¢¤ë¤¤¤Ï°Ê²¼¤Ë¼¨¤¹ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.TP +.B EINVAL +.\"O An attempt was made to add a record to a fixed-length database that +.\"O was too large to fit. +¸ÇÄêĹ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥ì¥³¡¼¥É¤òÄɲ乤ë¤È¤­¡¢¥Ç¡¼¥¿¤¬Ä¹¤¹¤®¤¿¡£ +.SH ¥Ð¥° +.\"O Only big and little endian byte order is supported. +¥Ð¥¤¥È¥ª¡¼¥À¡¼¤È¤·¤Æ¤Ï¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤È¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó¤Î¤ß¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR btree (3), +.BR dbopen (3), +.BR hash (3), +.BR mpool (3) +.sp +.IR "Document Processing in a Relational Database System" , +Michael Stonebraker, Heidi Stettner, Joseph Kalash, Antonin Guttman, +Nadene Lynn, Memorandum No. UCB/ERL M82/32, May 1982. diff --git a/draft/man3/regex.3 b/draft/man3/regex.3 new file mode 100644 index 00000000..45139c09 --- /dev/null +++ b/draft/man3/regex.3 @@ -0,0 +1,505 @@ +.\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.) +.\" +.\" 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. +.\" +.\" Wed Jun 14 16:10:28 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk) +.\" Tiny change in formatting - aeb, 950812 +.\" Modified 8 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) +.\" +.\" Japanese Version Copyright (c) 1998 Takatsugu Nokubi +.\" all rights reserved. +.\" Translated 1998-06-30, Takatsugu Nokubi +.\" Updated & Modified 2001-11-05, Yuichi SATO +.\" Updated & Modified 2005-02-24, Yuichi SATO +.\" Updated 2008-08-02, Akihiro MOTOKI , LDP v3.05 +.\" +.\"WORD: bitwise-or ¥Ó¥Ã¥È¤´¤È¤ÎOR +.\"WORD: element (¹½Â¤ÂÎ)Í×ÁÇ +.\"WORD: collating element ¾È¹ç½ç½ø¤ÎÍ×ÁÇ +.\" +.\" show the synopsis section nicely +.de xx +.in \\n(INu+\\$1 +.ti -\\$1 +.. +.TH REGEX 3 2008-05-29 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O regcomp, regexec, regerror, regfree \- POSIX regex functions +regcomp, regexec, regerror, regfree \- POSIX regex ´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include + +.BI "int regcomp(regex_t *" preg ", const char *" regex ", int " cflags ); + +.BI "int regexec(const regex_t *" preg ", const char *" string \ +", size_t " nmatch , +.BI " regmatch_t " pmatch[] ", int " eflags ); + +.BI "size_t regerror(int " errcode ", const regex_t *" preg ", char *" errbuf , +.BI " size_t " errbuf_size ); + +.BI "void regfree(regex_t *" preg ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .SS "POSIX Regex Compiling" +.SS "POSIX regex ¥³¥ó¥Ñ¥¤¥ë" +.\"O .BR regcomp () +.\"O is used to compile a regular expression into a form that is suitable +.\"O for subsequent +.\"O .BR regexec () +.\"O searches. +.BR regcomp () +¤Ï¡¢Àµµ¬É½¸½¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¡¢ +.BR regexec () +¤Ç¤Î¸¡º÷½èÍý¤ËŬ¹ç¤¹¤ë·ÁÂ֤ˤ¹¤ë¡£ + +.\"O .BR regcomp () +.\"O is supplied with +.\"O .IR preg , +.\"O a pointer to a pattern buffer storage area; +.\"O .IR regex , +.\"O a pointer to the null-terminated string and +.\"O .IR cflags , +.\"O flags used to determine the type of compilation. +.BR regcomp () +¤Ï¥Ñ¥¿¡¼¥ó¤òµ­²±¤¹¤ë¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ +.IR preg ¡¢ +¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó +.IR regex ¡¢ +¤½¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤Î·Á¼°¤ò·è¤á¤ë¤¿¤á¤Î¥Õ¥é¥° +.I cflag +¤ò°ú¿ô¤Ëȼ¤¦¡£ + +.\"O All regular expression searching must be done via a compiled pattern +.\"O buffer, thus +.\"O .BR regexec () +.\"O must always be supplied with the address of a +.\"O .BR regcomp () +.\"O initialized pattern buffer. +Á´¤Æ¤ÎÀµµ¬É½¸½¸¡º÷¤Ï¡¢¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¤Ë¤è¤Ã¤Æ¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤è¤Ã¤Æ¡¢ +.BR regexec () +¤Ë»ØÄꤹ¤ë¤Î¤Ï¡¢É¬¤º +.RB ( regcomp () +¤Ë¤è¤Ã¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿) ¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥¢¥É¥ì¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O .I cflags +.\"O may be the +.\"O .RB bitwise- or +.\"O of one or more of the following: +.I cflags +¤Ë¤Ï°Ê²¼¤Ë¼¨¤¹Äê¿ô°ì¤Ä°Ê¾å¤Î¥Ó¥Ã¥È¤´¤È¤Î OR (bitwise-or) ¤ò»ØÄꤹ¤ë¡£ +.TP +.B REG_EXTENDED +.\"O Use +.\"O .B POSIX +.\"O Extended Regular Expression syntax when interpreting +.\"O .IR regex . +.\"O If not set, +.\"O .B POSIX +.\"O Basic Regular Expression syntax is used. +.I regex +¤Ë +.B POSIX +³ÈÄ¥Àµµ¬É½¸½¤ò»ÈÍѤ¹¤ë¡£¤â¤·¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢ +.B POSIX +ɸ½àÀµµ¬É½¸½¤¬»È¤ï¤ì¤ë¡£ +.TP +.B REG_ICASE +.\"O Do not differentiate case. +.\"O Subsequent +.\"O .BR regexec () +.\"O searches using this pattern buffer will be case insensitive. +Âçʸ»ú¾®Ê¸»ú¤Î°ã¤¤¤ò̵»ë¤¹¤ë¡£¤³¤Î¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ +¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤òÍѤ¤¤Æ +.BR regexec () +´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¤È¡¢Âçʸ»ú¾®Ê¸»ú¤Î¶èÊ̤òÉÕ¤±¤º¤Ë¸¡º÷¤¬¹Ô¤ï¤ì¤ë¡£ +.TP +.B REG_NOSUB +.\"O Support for substring addressing of matches is not required. +.\"O The +.\"O .I nmatch +.\"O and +.\"O .I pmatch +.\"O arguments to +.\"O .BR regexec () +.\"O are ignored if the pattern buffer supplied was compiled with this flag set. +¤³¤Î¥Õ¥é¥°¤òÀßÄꤷ¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤¬ +.BR regexec () +¤Î°ú¿ô¤Ë»ØÄꤵ¤ì¤ë¤È¡¢°ú¤­¿ô +.IR nmatch , +.I pmatch +¤¬Ìµ»ë¤µ¤ì¤ë¡£ +.TP +.B REG_NEWLINE +.\"O Match-any-character operators don't match a newline. +Á´¤Æ¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿¤Ë²þ¹Ô¤ò¥Þ¥Ã¥Á¤µ¤»¤Ê¤¤¡£ + +.\"O A nonmatching list +.\"O .RB ( [^...] ) +.\"O not containing a newline does not match a newline. +²þ¹Ô¤ò´Þ¤Þ¤Ê¤¤Èó¥Þ¥Ã¥Á¥ó¥°Ê¸»ú¥ê¥¹¥È +.RB ( [^...] ) +¤Ë²þ¹Ô¤ò¥Þ¥Ã¥Á¤µ¤»¤Ê¤¤¡£ + +.\"O Match-beginning-of-line operator +.\"O .RB ( ^ ) +.\"O matches the empty string immediately after a newline, regardless of +.\"O whether +.\"O .IR eflags , +.\"O the execution flags of +.\"O .BR regexec (), +.\"O contains +.\"O .BR REG_NOTBOL . +.BR regexec () +¤Î¼Â¹Ô»þ¤Ë»ØÄꤹ¤ë¥Õ¥é¥° +.I eflags +¤Ë +.B REG_NOTBOL +¤ò´Þ¤à¤«¤É¤¦¤«¤Ë¤«¤«¤ï¤é¤º¡¢¹ÔƬ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿ +.RB ( ^ ) +¤ò²þ¹Ôľ¸å¤Î¶õʸ»úÎó¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¡£ + +.\"O Match-end-of-line operator +.\"O .RB ( $ ) +.\"O matches the empty string immediately before a newline, regardless of +.\"O whether +.\"O .I eflags +.\"O contains +.\"O .BR REG_NOTEOL . +.I eflags +¤Ë +.B REG_NOTEOL +¤ò´Þ¤à¤«¤É¤¦¤«¤Ë¤«¤«¤ï¤é¤º¡¢¹ÔËö¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿ +.RB ( $ ) +¤ò²þ¹ÔľÁ°¤Î¶õʸ»úÎó¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¡£ +.\"O .SS "POSIX Regex Matching" +.SS "POSIX regex ¥Þ¥Ã¥Á¥ó¥°" +.\"O .BR regexec () +.\"O is used to match a null-terminated string +.\"O against the precompiled pattern buffer, +.\"O .IR preg . +.BR regexec () +¤Ï¡¢ +¥×¥ê¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡ +.I preg +¤ò¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¡£ +.\"O .I nmatch +.\"O and +.\"O .I pmatch +.\"O are used to provide information regarding the location of any matches. +.I nmatch +¤È +.I pmatch +¤Ï¥Þ¥Ã¥Á¥ó¥°¤Î°ÌÃ֤˴ؤ¹¤ë¾ðÊó¤ò¼èÆÀ¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +.\"O .I eflags +.\"O may be the +.\"O .RB bitwise- or +.\"O of one or both of +.\"O .B REG_NOTBOL +.\"O and +.\"O .B REG_NOTEOL +.\"O which cause changes in matching behavior described below. +.I eflags +¤Ë¤Ï +.B REG_NOTBOL +¤È +.B REG_NOTEOL +¤Î¤É¤Á¤é¤«¡¢¤â¤·¤¯¤ÏξÊý¤Î¥Ó¥Ã¥È¤´¤È¤Î +.BR OR " (bitwise-" or ) +¤ò»ØÄꤷ¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ë¤è¤¦¤Ë¥Þ¥Ã¥Á¥ó¥°Æ°ºî¤òÊѲ½¤µ¤»¤ë¡£ +.TP +.\"O .B REG_NOTBOL +.\"O The match-beginning-of-line operator always fails to match (but see the +.\"O compilation flag +.\"O .B REG_NEWLINE +.\"O above) +.B REG_NOTBOL +¹ÔƬ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿¤Ï¡¢É¬¤º¥Þ¥Ã¥Á¤Ë¼ºÇÔ¤¹¤ë (¥³¥ó¥Ñ¥¤¥ë»þ¤Î¥Õ¥é¥° +.B REG_NEWLINE +¤Î¹àÌܤ⻲¾È)¡£ +.\"O This flag may be used when different portions of a string are passed to +.\"O .BR regexec () +.\"O and the beginning of the string should not be interpreted as the +.\"O beginning of the line. +¤³¤Î¥Õ¥é¥°¤Ï¡¢Ê£¿ô¹Ô¤Ë¤Þ¤¿¤¬¤ëʸ»úÎó¤ò +.BR regexec () +¤Ç¸¡º÷¤¹¤ëºÝ¤Ë¡¢Ê¸»úÎó¤ÎÀèƬ¤ò¹Ô¤ÎÀèƬ¤È¤·¤Æ²ò¼á¤µ¤»¤Ê¤¤¾ì¹ç¤ËÍѤ¤¤ë¡£ +.TP +.\"O .B REG_NOTEOL +.\"O The match-end-of-line operator always fails to match (but see the +.\"O compilation flag +.\"O .B REG_NEWLINE +.\"O above) +.B REG_NOTEOL +¹ÔËö¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿¤Ï¡¢É¬¤º¥Þ¥Ã¥Á¤Ë¼ºÇÔ¤¹¤ë (¥³¥ó¥Ñ¥¤¥ë»þ¤Î¥Õ¥é¥° +.B REG_NEWLINE +¤Î¹àÌܤ⻲¾È)¡£ +.\"O .SS "Byte Offsets" +.SS ¥Ð¥¤¥È¥ª¥Õ¥»¥Ã¥È +.\"O Unless +.\"O .B REG_NOSUB +.\"O was set for the compilation of the pattern buffer, it is possible to +.\"O obtain substring match addressing information. +¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B REG_NOSUB +¤¬ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢Éôʬʸ»úÎó¤Î¥Þ¥Ã¥Á¥ó¥°°ÌÃÖ¾ðÊó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .I pmatch +.\"O must be dimensioned to have at least +.\"O .I nmatch +.\"O elements. +.I pmatch +¤Ï¡¢¾¯¤Ê¤¯¤È¤â +.I nmatch +¤ÎÂ礭¤µ¤ò»ý¤Ä¤è¤¦¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O These are filled in by +.\"O .BR regexec () +.\"O with substring match addresses. +.\"O Any unused structure elements +.\"O will contain the value \-1. +.BR regexec () +¤Î¼Â¹Ô¤Ë¤è¤Ã¤Æ¡¢¤½¤ì¤é¤ËÉôʬʸ»úÎó¥Þ¥Ã¥Á¥ó¥°°ÌÃÖ¾ðÊó¤¬ÂåÆþ¤µ¤ì¤ë¡£ +̤»ÈÍѤι½Â¤ÂÎÍ×ÁÇ¤Ë¤Ï \-1 ¤¬ÃͤȤ·¤ÆÂåÆþ¤µ¤ì¤ë¡£ + +.\"O The +.\"O .I regmatch_t +.\"O structure which is the type of +.\"O .I pmatch +.\"O is defined in +.\"O .IR . +.I pmatch +¤Î·¿¤Ç¤¢¤ë +.I regmatch_t +¹½Â¤ÂΤϡ¢ +.I +Æâ¤ÇÄêµÁ¤µ¤ì¤ë¡£ + +.in +4n +.nf +typedef struct { + regoff_t rm_so; + regoff_t rm_eo; +} regmatch_t; +.fi +.in + +.\"O Each +.\"O .I rm_so +.\"O element that is not \-1 indicates the start offset of the next largest +.\"O substring match within the string. +.\"O The relative +.\"O .I rm_eo +.\"O element indicates the end offset of the match, +.\"O which is the offset of the first character after the matching text. +¹½Â¤ÂÎÍ×ÁÇ +.I rm_so +¤ÎÃͤ¬ \-1 ¤Ç¤Ê¤¤¾ì¹ç¡¢¤½¤ì¤Ïʸ»úÎóÆâ¤Ç¤Î¼¡¤ÎºÇÂç¤Î¥Þ¥Ã¥Á¥ó¥°Éôʬ¤Î³«»Ï +¥ª¥Õ¥»¥Ã¥È°ÌÃÖ¤ò¼¨¤¹¡£¤½¤ì¤ËÂФ·¡¢¹½Â¤ÂÎÍ×ÁÇ +.I rm_eo +¤Ï¥Þ¥Ã¥Á¥ó¥°Éôʬ¤Î½ªÎ»¥ª¥Õ¥»¥Ã¥È°ÌÃÖ¤ò¼¨¤·¡¢ +¥Þ¥Ã¥Á¥ó¥°Éôʬ¤Îľ¸å¤Îʸ»ú¤Î¥ª¥Õ¥»¥Ã¥È°ÌÃÖ¤¬»ÈÍѤµ¤ì¤ë¡£ +.\"O .SH "POSIX Error Reporting" +.SS "POSIX ¥¨¥é¡¼¥ì¥Ý¡¼¥È" +.\"O .BR regerror () +.\"O is used to turn the error codes that can be returned by both +.\"O .BR regcomp () +.\"O and +.\"O .BR regexec () +.\"O into error message strings. +.BR regerror () +¤Ï¡¢ +.BR regcomp () +¤È +.BR regexec () +¤Î¼Â¹Ô¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤ë¥¨¥é¡¼¥³¡¼¥É¤«¤é¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸Ê¸»úÎó¤ò +ÆÀ¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ + +.\"O .BR regerror () +.\"O is passed the error code, +.\"O .IR errcode , +.\"O the pattern buffer, +.\"O .IR preg , +.\"O a pointer to a character string buffer, +.\"O .IR errbuf , +.\"O and the size of the string buffer, +.\"O .IR errbuf_size . +.BR regerror () +¤Ï¥¨¥é¡¼¥³¡¼¥É +.IR errcode ¡¢ +¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡ +.IR preg ¡¢ +ʸ»úÎó¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ +.IR errbuf ¡¢ +ʸ»úÎó¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º +.I errbuf_size +¤ò°ú¿ô¤Ë¤È¤ë¡£ +.\"O It returns the size of the +.\"O .I errbuf +.\"O required to contain the null-terminated error message string. +.\"O If both +.\"O .I errbuf +.\"O and +.\"O .I errbuf_size +.\"O are nonzero, +.\"O .I errbuf +.\"O is filled in with the first +.\"O .I "errbuf_size \- 1" +.\"O characters of the error message and a terminating null. +¤³¤Î´Ø¿ô¤Ï¡¢¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸Ê¸»úÎó¤ò³ÊǼ¤¹¤ë¤Î¤ËɬÍ×¤Ê +.I errbuf +¤Î¥µ¥¤¥º¤òÊÖ¤¹¡£¤â¤· +.I errbuf +¤È +.I errbuf_size +¤ÎξÊý¤¬Èó 0 ÃͤǤ¢¤ì¤Ð¡¢ +.I errbuf +¤Ë¤ÏºÇ½é¤Î +.I "errbuf_size \- 1" +ʸ»úʬ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤È½ªÃ¼¤Î¥Ì¥ëʸ»ú¤¬¼ý¤Þ¤ë¤è¤¦¤ËÂåÆþ¤µ¤ì¤ë¡£ +.\"O .SS "POSIX Pattern Buffer Freeing" +.SS "POSIX ¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡²òÊü" +.\"O Supplying +.\"O .BR regfree () +.\"O with a precompiled pattern buffer, +.\"O .I preg +.\"O will free the memory allocated to the pattern buffer by the compiling +.\"O process, +.\"O .BR regcomp (). +°ú¿ô¤Ë¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡ +.I preg +¤òÍ¿¤¨¤Æ +.BR regfree () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢ +.BR regcomp () +¤Ë¤è¤ë¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤¬²òÊü¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR regcomp () +.\"O returns zero for a successful compilation or an error code for failure. +.BR regcomp () +¤Ï¡¢¥³¥ó¥Ñ¥¤¥ë¤ÎÀ®¸ù»þ¤Ë¤Ï 0 ¤òÊÖ¤·¡¢¼ºÇÔ»þ¤Ë¤Ï¥¨¥é¡¼¥³¡¼¥É¤òÊÖ¤¹¡£ + +.\"O .BR regexec () +.\"O returns zero for a successful match or +.\"O .B REG_NOMATCH +.\"O for failure. +.BR regexec () +¤Ï¡¢¥Þ¥Ã¥Á¥ó¥°¤ÎÀ®¸ù»þ¤Ë¤Ï 0 ¤òÊÖ¤·¡¢¼ºÇÔ»þ¤Ë¤Ï +.B REG_NOMATCH +¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O The following errors can be returned by +.\"O .BR regcomp (): +.BR regcomp () +¤Ï°Ê²¼¤Î¥¨¥é¡¼¤òÊÖ¤¹¡£ +.TP +.B REG_BADBR +.\"O Invalid use of back reference operator. +̵¸ú¤Ê¸åÊý»²¾È¥ª¥Ú¥ì¡¼¥¿¤Î»ÈÍÑ¡£ +.TP +.B REG_BADPAT +.\"O Invalid use of pattern operators such as group or list. +¥°¥ë¡¼¥×¤ä¥ê¥¹¥È¤Ê¤É¤Î¡¢¥Ñ¥¿¡¼¥ó¥ª¥Ú¥ì¡¼¥¿¤Î̵¸ú¤Ê»ÈÍÑ¡£ +.TP +.B REG_BADRPT +.\"O Invalid use of repetition operators such as using \(aq*\(aq +.\"O as the first character. +\(aq*\(aq ¤¬ºÇ½é¤Îʸ»ú¤È¤·¤Æ¤¯¤ë¤è¤¦¤Ê¡¢Ìµ¸ú¤Ê·«¤êÊÖ¤·¥ª¥Ú¥ì¡¼¥¿¤Î»ÈÍÑ¡£ +.TP +.B REG_EBRACE +.\"O Un-matched brace interval operators. +¥¤¥ó¥¿¡¼¥Ð¥ë¥ª¥Ú¥ì¡¼¥¿ +.B {} +(brace interval operators) ¤¬ÊĤ¸¤Æ¤¤¤Ê¤¤¡£ +.TP +.B REG_EBRACK +.\"O Un-matched bracket list operators. +¥ê¥¹¥È¥ª¥Ú¥ì¡¼¥¿ +.B [] +(bracket list operators) ¤¬ÊĤ¸¤Æ¤¤¤Ê¤¤¡£ +.TP +.B REG_ECOLLATE +.\"O Invalid collating element. +¾È¹ç½ç½ø¤ÎÍ×ÁÇ (collating element) ¤È¤·¤ÆÍ­¸ú¤Ç¤Ï¤Ê¤¤¡£ + +(ÌõÃí) ¾È¹ç½ç½ø¤ÎÍ×ÁÇ (collating element) ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR regex (7) +¤ò»²¾È¡£ +.TP +.B REG_ECTYPE +.\"O Unknown character class name. +̤ÃΤΥ­¥ã¥é¥¯¥¿¥¯¥é¥¹Ì¾¡£ +.TP +.B REG_EEND +.\"O Non specific error. +.\"O This is not defined by POSIX.2. +̤ÄêµÁ¥¨¥é¡¼¡£¤³¤ì¤Ï POSIX.2 ¤Ë¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B REG_EESCAPE +.\"O Trailing backslash. +Àµµ¬É½¸½¤¬¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Ç½ª¤Ã¤Æ¤¤¤ë¡£ + +(ÌõÃí) ÆüËܸì´Ä¶­¤Î¾ì¹ç¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤È¤Ê¤ë¤Ù¤­½ê¤¬±ßµ­¹æ¤Ç +ɽ¼¨¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¤¬¡¢¤³¤ì¤Ïñ¤Ëɽ¼¨¥Õ¥©¥ó¥È¤ÎÌäÂê¤Ç¡¢ +ÆâÉôŪ¤Ë¤ÏƱ¤¸°ÕÌ£¤Ç¤¢¤ë¡£ +.TP +.B REG_EPAREN +.\"O Un-matched parenthesis group operators. +¥°¥ë¡¼¥×¥ª¥Ú¥ì¡¼¥¿ +.B () +(parenthesis group operators) ¤¬ÊĤ¸¤Æ¤¤¤Ê¤¤¡£ +.TP +.B REG_ERANGE +.\"O Invalid use of the range operator, e.g., the ending point of the range +.\"O occurs prior to the starting point. +̵¸ú¤ÊÈÏ°Ï¥ª¥Ú¥ì¡¼¥¿¤Î»ÈÍÑ¡£ +Î㤨¤Ð¡¢ÈϰϤνªÎ»°ÌÃÖ¤¬³«»Ï°ÌÃÖ¤è¤ê¤âÁ°¤Ë¤¢¤ë¤è¤¦¤Ê¾ì¹ç¡£ +.TP +.B REG_ESIZE +.\"O Compiled regular expression requires a pattern buffer larger than 64Kb. +.\"O This is not defined by POSIX.2. +Àµµ¬É½¸½¤Î¥³¥ó¥Ñ¥¤¥ë¤Ë¡¢64Kb °Ê¾å¤Î¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤¬É¬Íס£ +¤³¤ì¤Ï POSIX.2 ¤Ë¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B REG_ESPACE +.\"O The regex routines ran out of memory. +regex ¥ë¡¼¥Á¥ó¤¬¥á¥â¥ê¤ò»È¤¤¤Ï¤¿¤·¤Æ¤¤¤ë¡£ +.TP +.B REG_ESUBREG +.\"O Invalid back reference to a subexpression. +¥µ¥Ö¥¨¥¯¥¹¥×¥ì¥Ã¥·¥ç¥ó +.RB \e (...\e ) +(subexpression) ¤Ø¤Î̵¸ú¤Ê¸åÊý»²¾È¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR grep (1), +.BR regex (7), +.\"O GNU regex manual +GNU regex ¥Þ¥Ë¥å¥¢¥ë diff --git a/draft/man3/remainder.3 b/draft/man3/remainder.3 new file mode 100644 index 00000000..5bec3c29 --- /dev/null +++ b/draft/man3/remainder.3 @@ -0,0 +1,310 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-08-10 Walter Harms +.\" (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 2009-02-04 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.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 ); +.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 ); +.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) +»²¾È): +.in +.sp +.ad l +.BR remainder (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR remainderf (), +.BR remainderl (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR drem (), +.BR dremf (), +.BR dreml (): +_SVID_SOURCE || _BSD_SOURCE +.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 +¤¬Áª¤Ð¤ì¤ë¡£ + +.\"O These functions are unaffected by the current rounding mode (see +.\"O .BR fenv (3)). +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¸½ºß¤Î´Ý¤á¥â¡¼¥É¤Î±Æ¶Á¤ò¼õ¤±¤Ê¤¤ (´Ý¤á¥â¡¼¥É¤Ë¤Ä¤¤¤Æ¤Ï +.BR fenv (3) +¤ò»²¾È)¡£ +.LP +.\"O The +.\"O .BR drem () +.\"O function does precisely the same thing. +.BR drem () +´Ø¿ô¤Ï¤³¤ì¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.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 +¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ + +.\"O If +.\"O .I x +.\"O or +.\"O .I y +.\"O is a NaN, a NaN is returned. +.I x +¤« +.I y +¤¬ 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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is an infinity and \fIy\fP is not a NaN +Îΰ襨¥é¡¼ (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 ) +¤¬¾å¤¬¤ë¡£ +.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" +.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 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +.\"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 +.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 +.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) diff --git a/draft/man3/remove.3 b/draft/man3/remove.3 new file mode 100644 index 00000000..7c6770c9 --- /dev/null +++ b/draft/man3/remove.3 @@ -0,0 +1,140 @@ +.\" This file is derived from unlink.2, which has the following copyright: +.\" +.\" --snip-- +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Ian Jackson. +.\" +.\" 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. +.\" --snip-- +.\" +.\" Edited into remove.3 shape by: +.\" Graeme W. Wilford (G.Wilford@ee.surrey.ac.uk) on 13th July 1994 +.\" +.\" Japanese Version Copyright (c) 1998 Ueyama Rui +.\" all rights reserved. +.\" Translated Wed Feb 20 15:01:46 JST 1998 +.\" by Ueyama Rui +.\" Updated Sat Dec 11 JST 1999 by Kentaro Shirakata +.\" Updated Mon Feb 17 JST 2003 by Kentaro Shirakata +.\" +.TH REMOVE 3 2008-12-03 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O remove \- remove a file or directory +remove \- ¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int remove(const char *" pathname ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR remove () +.\"O deletes a name from the filesystem. +.\"O It calls +.\"O .BR unlink (2) +.\"O for files, and +.\"O .BR rmdir (2) +.\"O for directories. +.BR remove () +¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤é¥Õ¥¡¥¤¥ë̾¤òºï½ü¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¤Ï +.BR unlink (2) +¤ò¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ¤Ï +.BR rmdir (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ + +.\"O If the removed name was the +.\"O last link to a file and no processes have the file open, the file is +.\"O deleted and the space it was using is made available for reuse. +¤â¤·¤½¤Î̾Á°¤¬ +¥Õ¥¡¥¤¥ë¤Ø¤ÎºÇ¸å¤Î¥ê¥ó¥¯¤Ç¡¢¤«¤Ä¡¢¤É¤Î¥×¥í¥»¥¹¤â¤½¤Î¥Õ¥¡¥¤¥ë¤ò +³«¤¤¤Æ¤¤¤Ê¤¤¤Ê¤é¡¢¥Õ¥¡¥¤¥ë¤âºï½ü¤¹¤ë¡£¥Õ¥¡¥¤¥ë¤ÎÀê¤á¤Æ¤¤¤¿ +Îΰè¤Ï¾¤Ç»È¤¦¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + +.\"O If the name was the last link to a file, +.\"O but any processes still have the file open, +.\"O the file will remain in existence until the last file +.\"O descriptor referring to it is closed. +̾Á°¤¬¥Õ¥¡¥¤¥ë¤Ø¤ÎºÇ¸å¤Î¥ê¥ó¥¯¤Ç¤¢¤Ã¤Æ¤â¡¢¤É¤³¤«¤Î¥×¥í¥»¥¹¤¬ +¤½¤Î¥Õ¥¡¥¤¥ë¤ò³«¤¤¤Æ¤¤¤ë¤Ê¤é¡¢¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Î¥Õ¥¡¥¤¥ëµ­½Ò»Ò +(file descriptor) ¤¬ÊĤ¸¤é¤ì¤ë¤Þ¤Ç¥Õ¥¡¥¤¥ë¤Ï¸ºß¤·Â³¤±¤ë¡£ + +.\"O If the name referred to a symbolic link, the link is removed. +̾Á°¤¬»Ø¤·¤Æ¤¤¤ë¤Î¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ê¤é¡¢¤½¤Î¥ê¥ó¥¯¤òºï½ü¤¹¤ë¡£ + +.\"O If the name referred to a socket, FIFO, or device, the name is removed, +.\"O but processes which have the object open may continue to use it. +̾Á°¤¬»Ø¤·¤Æ¤¤¤ë¤Î¤¬¥½¥±¥Ã¥È¡¢FIFO¡¢¥Ç¥Ð¥¤¥¹¤Î¾ì¹ç¡¢Ì¾Á°¤Ïºï½ü¤µ¤ì¤ë¤¬¡¢ +¤½¤Î¥½¥±¥Ã¥È¤Ê¤É¤ò³«¤¤¤Æ¤¤¤ë¥×¥í¥»¥¹¤Ï¤½¤Î¤Þ¤Þ»È¤¤Â³¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"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 The errors that occur are those for +.\"O .BR unlink (2) +.\"O and +.\"O .BR rmdir (2). +ȯÀ¸¤¹¤ë¥¨¥é¡¼¤Ï +.BR unlink (2) +¤ª¤è¤Ó +.BR rmdir (2) +¤ÈƱ¤¸¤â¤Î¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C89, C99, 4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Under libc4 and libc5, +.\"O .BR remove () +.\"O was an alias for +.\"O .BR unlink (2) +.\"O (and hence would not remove directories). +libc4 ¤È libc5 ¤Ë¤ª¤¤¤Æ¤Ï¡¢ +.BR remove () +¤Ï +.BR unlink (2) +¤ÎÊÌ̾¤Ç¤¢¤Ã¤¿ (½¾¤Ã¤Æ¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤Ç¤­¤Ê¤«¤Ã¤¿)¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O In-felicities in the protocol underlying NFS can cause the unexpected +.\"O disappearance of files which are still being used. +NFS ¥×¥í¥È¥³¥ë¤Îº¬ËÜŪ¤ÊÉÔÅÔ¹ç¤Ë¤è¤ê¡¢»ÈÍÑÃæ¤Î¥Õ¥¡¥¤¥ë¤¬¡¢ +ÁÛÄê¤Ç¤­¤Ê¤¤·Á¤Çºï½ü¤µ¤ì¤ë¤³¤È¤¬¤¢¤ê¤¨¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR rm (1), +.BR unlink (1), +.BR link (2), +.BR mknod (2), +.BR open (2), +.BR rename (2), +.BR rmdir (2), +.BR unlink (2), +.BR mkfifo (3), +.BR symlink (7) diff --git a/draft/man3/remquo.3 b/draft/man3/remquo.3 new file mode 100644 index 00000000..64d0809c --- /dev/null +++ b/draft/man3/remquo.3 @@ -0,0 +1,193 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 +.\" +.TH REMQUO 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O remquo, remquof, remquol \- remainder and part of quotient +remquo, remquof, remquol \- ¾¦¤Î°ìÉô¤È¾ê;¤òµá¤á¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double remquo(double " x ", double " y ", int *" quo ); +.br +.BI "float remquof(float " x ", float " y ", int *" quo ); +.br +.BI "long double remquol(long double " x ", long double " y ", int *" quo ); +.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) +»²¾È): +.in +.sp +.ad l +.BR remquo (), +.BR remquof (), +.BR remquol (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 +¥Ý¥¤¥ó¥¿¤ò»È¤Ã¤Æ³ÊǼ¤µ¤ì¤ë¡£ +¾ê;¤Ï´Ø¿ô¤Î·ë²Ì¤È¤·¤ÆÊÖ¤µ¤ì¤ë¡£ + +.\"O The value of the remainder is the same as that computed by the +.\"O .BR remainder (3) +.\"O function. +¾ê;¤ÎÃÍ¤Ï +.BR remainder (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 ¥Ó¥Ã¥È¤¬´Þ¤Þ¤ì¤ë¡£ + +.\"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) ¤Ê¤É¤ò·×»»¤¹¤ë¡£ +.\" +.\"O .\" glibc, UnixWare: return 3 bits +.\"O .\" MacOS 10: return 7 bits +.\" glibc, UnixWare: 3 ¥Ó¥Ã¥È¤òÊÖ¤¹¡£ +.\" MacOS 10: 7 ¥Ó¥Ã¥È¤òÊÖ¤¹¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the same value as +.\"O the analogous functions described in +.\"O .BR remainder (3). +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.BR remainder (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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.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 ¤Ç¤Ê¤¤ +.\" .I errno +.\" is set to +.\" .BR EDOM . +.\"O An invalid floating-point exception +.\"O .RB ( FE_INVALID ) +.\"O is raised. +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR fmod (3), +.BR logb (3), +.BR remainder (3) diff --git a/draft/man3/resolver.3 b/draft/man3/resolver.3 new file mode 100644 index 00000000..14a8aec0 --- /dev/null +++ b/draft/man3/resolver.3 @@ -0,0 +1,417 @@ +.\" 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-07-25 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2004-10-31 by aeb +.\" +.\" Japanese Version Copyright (c) 1998 Shinji Orito all rights reserved. +.\" Translated Mon May 25 21:27:03 JST 1998 +.\" by Shinji Orito +.\" Updated & Modified Thu Feb 17 03:58:45 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: resolver ¥ì¥¾¥ë¥Ð (¥ê¥¾¥ë¥Ð) +.\"WORD: override ¥ª¡¼¥Ð¡¼¥é¥¤¥É +.\"WORD: call ¸Æ¤Ó½Ð¤·¡¢¸Æ¤Ó½Ð¤¹ +.\"WORD: fully qualified domain name ´°Á´½¤¾þ¥É¥á¥¤¥ó̾(FQDN) +.\"WORD: type ·¿ +.\"WORD: class ¥¯¥é¥¹ +.\"WORD: query Ì䤤¹ç¤ï¤»¡¢Ì䤤¹ç¤ï¤»¤ë +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡¡¼ +.\"WORD: lower-level routines ²¼°Ì¥ë¡¼¥Á¥ó +.\"WORD: limit of the array ÇÛÎó¤ÎÈÏ°Ï +.\"WORD: state information ¾õÂ֤ξðÊó +.\"WORD: bitwise ``or'' ¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýÏ +.\"WORD: True ¿¿ÃÍ +.\"WORD: authoritative ¸¢°ÒÉÕ¤±¤µ¤ì¤¿ +.\"WORD: recursion desired bit ºÆµ¢Í×µá¥Ó¥Ã¥È +.\"WORD: single component names °ìÉôʬ¤«¤é¤Ê¤ë̾Á° +.\" +.TH RESOLVER 3 2008-11-07 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O res_init, res_query, res_search, res_querydomain, res_mkquery, res_send, +.\"O dn_comp, dn_expand \- resolver routines +res_init, res_query, res_search, res_querydomain, res_mkquery, res_send, dn_comp, dn_expand \- ¥ì¥¾¥ë¥Ð¡¦¥ë¡¼¥Á¥ó +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.B extern struct state _res; +.sp +.B int res_init(void); +.sp +.BI "int res_query(const char *" dname ", int " class ", int " type , +.RS +.BI "unsigned char *" answer ", int " anslen ); +.RE +.sp +.BI "int res_search(const char *" dname ", int " class ", int " type , +.RS +.BI "unsigned char *" answer ", int " anslen ); +.RE +.sp +.BI "int res_querydomain(const char *" name ", const char *" domain , +.RS +.BI "int " class ", int " type ", unsigned char *" answer , +.BI "int " anslen ); +.RE +.sp +.BI "int res_mkquery(int " op ", const char *" dname ", int " class , +.RS +.BI "int " type ", char *" data ", int " datalen ", struct rrec *" newrr , +.BI "char *" buf ", int " buflen ); +.RE +.sp +.BI "int res_send(const char *" msg ", int " msglen ", char *" answer , +.RS +.BI "int " anslen ); +.RE +.sp +.BI "int dn_comp(unsigned char *" exp_dn ", unsigned char *" comp_dn , +.RS +.BI "int " length ", unsigned char **" dnptrs ", unsigned char *" exp_dn , +.BI "unsigned char **" lastdnptr ); +.RE +.sp +.BI "int dn_expand(unsigned char *" msg ", unsigned char *" eomorig , +.RS +.BI "unsigned char *" comp_dn ", char *" exp_dn , +.BI "int " length ); +.RE +.fi +.sp +.\"O Link with \fI\-lresolv\fP. +\fI\-lresolv\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These functions make queries to and interpret the responses from Internet +.\"O domain name servers. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î¥É¥á¥¤¥ó¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤ËÌ䤤¹ç¤ï¤»¡¢ +¤½¤Î±þÅú¤ò²ò¼á¤¹¤ë¡£ +.PP +.\"O The +.\"O .BR res_init () +.\"O function reads the configuration files (see +.\"O resolv.conf(5)) to get the default domain name, search order and name +.\"O server address(es). +.\"O If no server is given, the local host is tried. +.BR res_init () +´Ø¿ô¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥É¥á¥¤¥ó̾¡¢¸¡º÷½ç¡¢¥Í¡¼¥à¥µ¡¼¥Ð¡¼ +¥¢¥É¥ì¥¹¤òÆÀ¤ë¤¿¤á¤ËÀßÄê¥Õ¥¡¥¤¥ë (resolv.conf(5) »²¾È) ¤òÆɤࡣ +¤â¤·¥µ¡¼¥Ð¡¼¤¬¼¨¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¥í¡¼¥«¥ë¥Û¥¹¥È¤ò»î¤¹¡£ +.\"O If no domain is given, that associated with the local host is used. +.\"O It can be overridden with the environment variable +.\"O .BR LOCALDOMAIN . +.\"O .BR res_init () +.\"O is normally executed by the first call to one of the +.\"O other functions. +¥É¥á¥¤¥ó¤¬¼¨¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¥í¡¼¥«¥ë¥Û¥¹¥È¤ËÉÕ¤±¤é¤ì¤¿¥É¥á¥¤¥ó¤òÍѤ¤¤ë¡£ +´Ä¶­ÊÑ¿ô +.B LOCALDOMAIN +¤Ç¥ª¡¼¥Ð¡¼¥é¥¤¥É¤Ç¤­¤ë¡£ +.BR res_init () +¤Ï¡¢¸å½Ò¤¹¤ë´Ø¿ô¤Î¤É¤ì¤«¤¬ºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¡¢¤½¤Î´Ø¿ô +¤«¤é¼Â¹Ô¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR res_query () +.\"O function queries the name server for the +.\"O fully qualified domain name \fIname\fP of specified \fItype\fP and +.\"O \fIclass\fP. +.\"O The reply is left in the buffer \fIanswer\fP of length +.\"O \fIanslen\fP supplied by the caller. +.BR res_query () +´Ø¿ô¤Ï¡¢»ØÄꤵ¤ì¤¿ \fItype\fP ¤È \fIclass\fP ¤Î +´°Á´½¤¾þ¥É¥á¥¤¥ó̾ (FQDN) \fIname\fP ¤ò¡¢¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤ØÌ䤤¹ç¤ï¤»¤ë¡£ +±þÅú¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿Â¦¤Ë¤è¤Ã¤ÆÍÑ°Õ¤µ¤ì¤ëŤµ \fIanslen\fP ¤Î \fIanswer\fP +¥Ð¥Ã¥Õ¥¡¡¼¤Ë»Ä¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR res_search () +.\"O function makes a query and waits for the response +.\"O like +.\"O .BR res_query (), +.\"O but in addition implements the default and search +.\"O rules controlled by +.\"O .B RES_DEFNAMES +.\"O and +.\"O .B RES_DNSRCH +.\"O (see description of +.\"O \fI_res\fP options below). +.BR res_search () +´Ø¿ô¤Ï¡¢Ì䤤¹ç¤ï¤»¤ò¹Ô¤¤ +.BR res_query () +ƱÍͤ½¤Î±þÅú¤ò +ÂԤĤ¬¡¢¤µ¤é¤Ë¥Ç¥Õ¥©¥ë¥È¤ò¼ÂÁõ¤·¤Æ¤ª¤ê +.B RES_DEFNAMES +¤È +.B RES_DNSRCH +¤Ë¤è¤Ã¤Æµ¬Äꤵ¤ì¤ë¸¡º÷¥ë¡¼¥ë¤òŬÍѤ¹¤ë¡£ +(²¼µ­ \fI_res\fP ¥ª¥×¥·¥ç¥ó¤ÎÀâÌÀ¤ò»²¾È) +.PP +.\"O The \fBres_querydomain\fP() function makes a query using +.\"O .BR res_query () +.\"O on the concatenation of \fIname\fP and \fIdomain\fP. +.BR res_querydomain () +´Ø¿ô¤Ï \fIname\fP ¤È \fIdomain\fP ¤Î·ë¹ç¤Ë +.BR res_query () +¤òÍѤ¤¤ÆÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦¡£ +.PP +.\"O The following functions are lower-level routines used by +.\"O .BR res_query (). +¼¡¤Î´Ø¿ô¤Ï¡¢ +.BR res_query () +¤Ç»È¤ï¤ì¤ë²¼°Ì¥ë¡¼¥Á¥ó¤Ç¤¢¤ë¡£ +.PP +.\"O The +.\"O .BR res_mkquery () +.\"O function constructs a query message in \fIbuf\fP +.\"O of length \fIbuflen\fP for the domain name \fIdname\fP. +.\"O The query type +.\"O \fIop\fP is usually +.\"O .BR QUERY , +.\"O but can be any of the types defined in +.\"O \fI\fP. \fInewrr\fP is currently unused. +.BR res_mkquery () +´Ø¿ô¤Ï¡¢¥É¥á¥¤¥ó̾ \fIdname\fP ¤Î°Ù¤Ë¡¢Ä¹¤µ \fIbuflen\fP +¤Î \fIbuf\fP ¤ËÌ䤤¹ç¤ï¤»¤ë¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤¹¤ë¡£ +Ì䤤¹ç¤ï¤»¤Î·¿ \fIop\fP ¤ÏÄ̾ï +.B QUERY +¤À¤¬¡¢ \fI\fP ¤ÇÄêµÁ¤µ¤ì¤¿·¿¤Î¤É¤ì¤Ç¤âÎɤ¤¡£ +\fInewrr\fP ¤Ï¸½ºß»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR res_send () +.\"O function sends a preformatted query given in +.\"O \fImsg\fP of length \fImsglen\fP and returns the answer in \fIanswer\fP +.\"O which is of length \fIanslen\fP. +.\"O It will call +.\"O .BR res_init (), +.\"O if it +.\"O has not already been called. +.BR res_send () +´Ø¿ô¤Ï¡¢Ä¹¤µ \fImsglen\fP ¤Î \fImsg\fP ¤Ë·è¤á¤é¤ì¤¿½ñ¼° +¤ÇÌ䤤¹ç¤ï¤»¡¢\fIanswer\fP ¤ËŤµ \fIanslen\fP ¤Î²óÅú¤òÊÖ¤¹¡£ +¤Þ¤À¸Æ¤Ó½Ð¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð +.BR res_init () +¤ò¸Æ¤Ó½Ð¤¹¡£ +.PP +.\"O The +.\"O .BR dn_comp () +.\"O function compresses the domain name \fIexp_dn\fP +.\"O and stores it in the buffer \fIcomp_dn\fP of length \fIlength\fP. +.\"O The compression uses an array of pointers \fIdnptrs\fP to previously +.\"O compressed names in the current message. +.\"O The first pointer points +.\"O to the beginning of the message and the list ends with NULL. +.\"O The limit of the array is specified by \fIlastdnptr\fP. +.\"O If \fIdnptr\fP is NULL, domain names are not compressed. +.\"O If \fIlastdnptr\fP is NULL, the list +.\"O of labels is not updated. +.BR dn_comp () +´Ø¿ô¤Ï¥É¥á¥¤¥ó̾ \fIexp_dn\fP ¤ò°µ½Ì¤·¤Æ¡¢Ä¹¤µ \fIlength\fP +¤Î¥Ð¥Ã¥Õ¥¡¡¼ \fIcomp_dn\fP ¤ËÊݸ¤¹¤ë¡£ +°µ½Ì¤Ë¤Ï¥Ý¥¤¥ó¥¿¡¼ÇÛÎó \fIdnptrs\fP ¤òÍѤ¤¤ë¡£ +¤³¤ì¤é¤Î¥Ý¥¤¥ó¥¿¡¼¤Ï¡¢¸½ºß¤Î¥á¥Ã¥»¡¼¥¸¤ÎÃæ¤Ë¤¢¤ë°ÊÁ°¤Ë°µ½Ì¤µ¤ì¤¿Ì¾Á°¤ò»Ø¤¹¡£ +ºÇ½é¤Î¥Ý¥¤¥ó¥¿¡¼¤Ï¥á¥Ã¥»¡¼¥¸¤ÎËÁƬ¤ò»Ø¤·¡¢¤½¤Î¥ê¥¹¥È¤Ï NULL ¤Ç½ª¤ï¤ë¡£ +ÇÛÎó¤ÎÈÏ°Ï¤Ï \fIlastdnptr\fP ¤Ç·è¤á¤é¤ì¤ë¡£ +\fIdnptr\fP ¤¬ NULL ¤Ê¤é¤Ð¥É¥á¥¤¥ó̾¤Ï°µ½Ì¤µ¤ì¤Ê¤¤¡£ +\fIlastdnptr\fP ¤¬ NULL ¤Ê¤é¤Ð¡¢¤½¤Î¥é¥Ù¥ë¤Î¥ê¥¹¥È¤Ï¥¢¥Ã¥×¥Ç¡¼¥È¤µ¤ì¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR dn_expand () +.\"O function expands the compressed domain name +.\"O \fIcomp_dn\fP to a full domain name, which is placed in the buffer +.\"O \fIexp_dn\fP of size \fIlength\fP. +.\"O The compressed name is contained +.\"O in a query or reply message, and \fImsg\fP points to the beginning of +.\"O the message. +.BR dn_expand () +´Ø¿ô¤Ï¡¢°µ½Ì¤µ¤ì¤¿¥É¥á¥¤¥ó̾ \fIcomp_dn\fP ¤«¤é¥µ¥¤¥º +¤¬ \fIlength\fP ¤Î \fIexp_dn\fP ¥Ð¥Ã¥Õ¥¡¡¼¤ËÀµ¼°¤Ê¥É¥á¥¤¥ó̾¤òŸ³«¤¹¤ë¡£ +¤½¤Î°µ½Ì¤µ¤ì¤¿Ì¾Á°¤Ï¡¢Ì䤤¹ç¤ï¤»¡¢¤Þ¤¿¤Ï±þÅú¥á¥Ã¥»¡¼¥¸¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Æ¡¢ +\fImsg\fP ¤¬¥á¥Ã¥»¡¼¥¸¤ÎËÁƬ¤ò»Ø¤¹¡£ +.PP +.\"O The resolver routines use global configuration and state information +.\"O contained in the structure \fI_res\fP, which is defined in +.\"O \fI\fP. +.\"O The only field that is normally manipulated by the +.\"O user is \fI_res.options\fP. +.\"O This field can contain the bitwise "OR" +.\"O of the following options: +¥ì¥¾¥ë¥Ð¡¦¥ë¡¼¥Á¥ó¤Ï¡¢\fI\fP ¤ËÄêµÁ¤µ¤ì¤¿ \fI_res\fP ¹½Â¤ÂÎ¤Ë +´Þ¤Þ¤ì¤Æ¤¤¤ëÁ´ÂÎŪ¤ÊÀßÄê¤È¾õÂ֤ξðÊó¤ò»ÈÍѤ¹¤ë¡£ +Ä̾ï¥æ¡¼¥¶¡¼¤ËÁàºî¤Ç¤­¤ë¹àÌÜ¤Ï \fI_res.options\fP ¤À¤±¤Ç¤¢¤ë¡£ +¤³¤Î¹àÌܤϰʲ¼¤Î¥ª¥×¥·¥ç¥ó¤Î¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýϤˤǤ­¤ë¡£ +.TP +.B RES_INIT +.\"O True if +.\"O .BR res_init () +.\"O has been called. +.BR res_init () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤Æ¤¤¤ì¤Ð¿¿¡£ +.TP +.B RES_DEBUG +.\"O Print debugging messages. +¥Ç¥Ð¥Ã¥°¡¦¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ¹¤ë¡£ +.TP +.B RES_AAONLY +.\"O Accept authoritative answers only. +.\"O .BR res_send () +.\"O continues until +.\"O it fins an authoritative answer or returns an error. [Not currently +.\"O implemented]. +¸¢°ÒÉÕ¤±¤µ¤ì¤¿ (authoritative) ²óÅú¤Î¤ß¼õ¤±Æþ¤ì¤ë¡£ +.BR res_send () +¤Ï¡¢ºÇ½ªÅª¤Ë¸¢°ÒÉÕ¤±¤µ¤ì¤¿²óÅú¤òÆÀ¤é¤ì¤ë¤«¡¢¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë +¤Þ¤Ç³¹Ô¤¹¤ë¡£ +[¸½ºß¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤] +.TP +.B RES_USEVC +.\"O Use TCP connections for queries rather than UDP datagrams. +Ì䤤¹ç¤ï¤»¤Ë UDP ¥Ç¡¼¥¿¥°¥é¥à¤Ç¤Ï¤Ê¤¯ TCP Àܳ¤òÍѤ¤¤ë¡£ +.TP +.B RES_PRIMARY +.\"O Query primary domain name server only. +¥×¥é¥¤¥Þ¥ê¡¦¥É¥á¥¤¥ó¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤Î¤ßÌ䤤¹ç¤ï¤»¤ë¡£ +.TP +.B RES_IGNTC +.\"O Ignore truncation errors. +.\"O Don't retry with TCP. [Not currently +.\"O implemented]. +ÀÚ¤êµÍ¤á¥¨¥é¡¼ (truncation error) ¤ò̵»ë¤¹¤ë¡£TCP ¤Ç¥ê¥È¥é¥¤¤·¤Ê¤¤¡£ +[¸½ºß¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤] +.TP +.B RES_RECURSE +.\"O Set the recursion desired bit in queries. +.\"O Recursion is carried out +.\"O by the domain name server, not by +.\"O .BR res_send (). +.\"O [Enabled by default]. +.\"Osato: +.\"Osato: recursion desired ¤Ï¡ÖºÆµ¢Í×µá¡×¡ÖºÆµ¢Í×˾¡×¡ÖºÆµ¢Í×ÀÁ¡×¤Ê¤É¤È +.\"Osato: Ìõ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤·¤¿¡£ +.\"Osato: +ºÆµ¢Í×µá (recursion desired) ¥Ó¥Ã¥È¤òÌ䤤¹ç¤ï¤»¤ËÀßÄꤹ¤ë¡£ +ºÆµ¢¤Ï +.BR res_send () +¤Ç¤Ï¤Ê¤¯¥É¥á¥¤¥ó¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤Ë¤è¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +[¥Ç¥Õ¥©¥ë¥È¤ÇÍ­¸ú] +.TP +.B RES_DEFNAMES +.\"O If set, +.\"O .BR res_search () +.\"O will append the default domain name to +.\"O single component names, i.e., those that do not contain a dot. +.\"O [Enabled by default]. +.\"Osato: +.\"Osato: single component ¤Ï¡Ö1 ¤Ä¤ÎÍ×ÁǤ«¤é¤Ê¤ë¡×¤ÎÊý¤¬¤è¤¤¤Ç¤·¤ç¤¦¤«? +.\"Osato: +ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢ +.BR res_search () +¤Ï¥Ç¥Õ¥©¥ë¥È¤Î¥É¥á¥¤¥ó̾¤ò°ìÉôʬ +¤Î¤ß¤«¤é¤Ê¤ë̾Á°¡¢¤¹¤Ê¤ï¤Á¥É¥Ã¥È¤ò´Þ¤Þ¤Ê¤¤Ì¾Á°¤ËÉÕ¤±²Ã¤¨¤ë¡£ +[¥Ç¥Õ¥©¥ë¥È¤ÇÍ­¸ú] +.TP +.B RES_STAYOPEN +.\"O Used with +.\"O .B RES_USEVC +.\"O to keep the TCP connection open between queries. +Ì䤤¹ç¤ï¤»Ãæ¤Ë TCP Àܳ¤òÊݤĤ¿¤á +.B RES_USEVC +¤È¶¦¤ËÍѤ¤¤é¤ì¤ë¡£ +.TP +.B RES_DNSRCH +.\"O If set, +.\"O .BR res_search () +.\"O will search for hostnames in the current +.\"O domain and in parent domains. +.\"O This option is used by +.\"O .BR gethostbyname (3). +.\"O [Enabled by default]. +ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢ +.BR res_search () +¤Ï¸½ºß¤Î¥É¥á¥¤¥ó¤ª¤è¤Ó¿Æ¥É¥á¥¤¥ó¤Î +¥Û¥¹¥È̾¤òõ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.BR gethostbyname (3) +¤ÇÍѤ¤¤é¤ì¤ë¡£ +[¥Ç¥Õ¥©¥ë¥È¤ÇÍ­¸ú] +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR res_init () +.\"O function returns 0 on success, or \-1 if an error +.\"O occurs. +.BR res_init () +´Ø¿ô¤ÏÀ®¸ù¤¹¤ì¤Ð 0 ¤ò¡¢¥¨¥é¡¼¤¬È¯À¸¤¹¤ì¤Ð \-1 ¤òÊÖ¤¹¡£ +.PP +.\"O The \fBres_query\fP(), \fBres_search\fP(), +.\"O .BR res_querydomain (), +.\"O .BR res_mkquery () +.\"O and +.\"O .BR res_send () +.\"O functions return the length +.\"O of the response, or \-1 if an error occurs. +.BR res_query (), +.BR res_search (), +.BR res_querydomain (), +.BR res_mkquery (), +.BR res_send () +´Ø¿ô¤Ï±þÅú¤ÎŤµ¤òÊÖ¤¹¡£ +¤Þ¤¿¡¢¥¨¥é¡¼¤¬È¯À¸¤¹¤ì¤Ð \-1 ¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR dn_comp () +.\"O and +.\"O .BR dn_expand () +.\"O functions return the length +.\"O of the compressed name, or \-1 if an error occurs. +.BR dn_comp () +¤È +.BR dn_expand () +´Ø¿ô¤Ï°µ½Ì¤µ¤ì¤¿¥É¥á¥¤¥ó̾¤ÎŤµ¤òÊÖ¤¹¡£ +¤Þ¤¿¡¢¥¨¥é¡¼¤¬È¯À¸¤¹¤ì¤Ð \-1 ¤òÊÖ¤¹¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.nf +.\"O /etc/resolv.conf resolver configuration file +/etc/resolv.conf ¥ì¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë +.\"O /etc/host.conf resolver configuration file +/etc/host.conf ¥ì¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë +.fi +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR gethostbyname (3), +.BR resolv.conf (5), +.BR resolver (5), +.BR hostname (7), +.BR named (8) diff --git a/draft/man3/rewinddir.3 b/draft/man3/rewinddir.3 new file mode 100644 index 00000000..ae0377e5 --- /dev/null +++ b/draft/man3/rewinddir.3 @@ -0,0 +1,74 @@ +.\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Wed Dec 24 12:34:00 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. +.\" +.\" 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:29:11 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl) +.TH REWINDDIR 3 1995-06-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O rewinddir \- reset directory stream +rewinddir \- ¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤Î½é´ü²½ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B #include +.sp +.BI "void rewinddir(DIR *" dirp ); +.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" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR rewinddir () +.\"O function returns no value. +.BR rewinddir () +´Ø¿ô¤Ï¡¢ÃͤòÊÖ¤µ¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR closedir (3), +.BR opendir (3), +.BR readdir (3), +.BR scandir (3), +.BR seekdir (3), +.BR telldir (3) diff --git a/draft/man3/rexec.3 b/draft/man3/rexec.3 new file mode 100644 index 00000000..8852272e --- /dev/null +++ b/draft/man3/rexec.3 @@ -0,0 +1,203 @@ +.\" Copyright (c) 1983, 1991, 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. +.\" +.\" @(#)rexec.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libcompat/4.3/rexec.3,v 1.12 2004/07/02 23:52:14 ru Exp $ +.\" +.\" Taken from FreeBSD 5.4; not checked against Linux reality (mtk) +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-11-20, Akihiro MOTOKI +.\" +.TH REXEC 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O rexec \- return stream to a remote command +rexec \- ¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Ø¤Î¥¹¥È¥ê¡¼¥à¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.sp +.BI "int rexec(char **" ahost ", int " inport ", char *" user ", " +.BI " char *" passwd ", char *" cmd ", int *" fd2p ); +.\" This function requires _BSD_SOURCE on Linux +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This interface is obsoleted by +.\"O .BR rcmd (3). +¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï +.BR rcmd (3) +¤Ë¤è¤Ã¤ÆÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ + +.\"O The +.\"O .BR rexec () +.\"O function +.\"O looks up the host +.\"O .IR *ahost +.\"O using +.\"O .BR gethostbyname (3), +.\"O returning \-1 if the host does not exist. +.\"O Otherwise +.\"O .IR *ahost +.\"O is set to the standard name of the host. +.\"O If a username and password are both specified, then these +.\"O are used to authenticate to the foreign host; otherwise +.\"O the environment and then the user's +.\"O .I .netrc +.\"O file in his +.\"O home directory are searched for appropriate information. +.\"O If all this fails, the user is prompted for the information. +.BR rexec () +´Ø¿ô¤Ï +.BR gethostbyname (3) +¤ò»È¤Ã¤Æ¥Û¥¹¥È +.I *ahost +¤òõ¤¹¡£¥Û¥¹¥È¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï +.I *ahost +¤Ë¤½¤Î¥Û¥¹¥È¤Îɸ½àŪ¤Ê̾Á°¤òÀßÄꤹ¤ë¡£ +¥æ¡¼¥¶Ì¾¤È¥Ñ¥¹¥ï¡¼¥É¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢¤³¤ì¤é¤Ï +ÀܳÀè¤Î¥Û¥¹¥È¤Ø¤Îǧ¾Ú¤ËÍøÍѤµ¤ì¤ë¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +ŬÀڤʾðÊó¤òÆþ¼ê¤¹¤ë¤¿¤á¤Ë¡¢´Ä¶­ÊÑ¿ô¤È¡¢¤½¤Î¥æ¡¼¥¶¤Î +¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Î +.I .netrc +¥Õ¥¡¥¤¥ë¤¬¸¡º÷¤µ¤ì¤ë¡£¾ðÊ󤬸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿»þ¤Ë¤Ï¡¢ +¥æ¡¼¥¶¤ËÂФ·¤Æ¾ðÊó¤òÆþÎϤ¹¤ë¥×¥í¥ó¥×¥È¤¬É½¼¨¤µ¤ì¤ë¡£ +.PP +.\"O The port +.\"O .I inport +.\"O specifies which well-known DARPA Internet port to use for +.\"O the connection; the call +.\"O .I "getservbyname(""exec"", ""tcp"")" +.\"O (see +.\"O .BR getservent (3)) +.\"O will return a pointer to a structure, which contains the necessary port. +.\"O The protocol for connection is described in detail in +.\"O .BR rexecd (8). +¥Ý¡¼¥È +.I inport +¤Ë¤Ï¡¢Àܳ¤Ë»ÈÍѤ¹¤ë DARPA Internet ¤Î well-known ¥Ý¡¼¥È¤ò»ØÄꤹ¤ë¡£ +.I "getservbyname(""exec"", ""tcp"")" +¤ò¸Æ¤Ó½Ð¤¹¤È¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤¬ÊÖ¤µ¤ì +.RB ( getservent (3) +»²¾È)¡¢¤³¤Î¹½Â¤ÂΤˤÏɬÍפʥݡ¼¥È¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +Àܳ¤Ë»ÈÍѤµ¤ì¤ë¥×¥í¥È¥³¥ë¤Ë¤Ä¤¤¤Æ¤Î¾ÜºÙ¤Ï +.BR rexecd (8) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë (ÌõÃí: ¸½ºß¤Î¤È¤³¤í¸ºß¤·¤Ê¤¤)¡£ +.PP +.\"O If the connection succeeds, +.\"O a socket in the Internet domain of type +.\"O .BR SOCK_STREAM +.\"O is returned to +.\"O the caller, and given to the remote command as +.\"O .IR stdin +.\"O and +.\"O .IR stdout . +.\"O If +.\"O .I fd2p +.\"O is nonzero, then an auxiliary channel to a control +.\"O process will be setup, and a descriptor for it will be placed +.\"O in +.\"O .IR *fd2p . +Àܳ¤ËÀ®¸ù¤¹¤ë¤È¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥É¥á¥¤¥ó¤Î +.B SOCK_STREAM +·¿¤Î¥½¥±¥Ã¥È¤¬ÊÖ¤µ¤ì¡¢¤½¤Î¥½¥±¥Ã¥È¤Ï¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Î +ɸ½àÆþÎϤª¤è¤Óɸ½à½ÐÎϤȤʤ롣 +.I fd2p +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢À©¸æ¥×¥í¥»¥¹¤Ø¤ÎÊä½õ¥Á¥ã¥ó¥Í¥ë¤¬¥»¥Ã¥È¥¢¥Ã¥×¤µ¤ì¡¢ +Êä½õ¥Á¥ã¥ó¥Í¥ë¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.I *fd2p +¤Ë½ñ¤«¤ì¤ë¡£ +.\"O The control process will return diagnostic +.\"O output from the command (unit 2) on this channel, and will also +.\"O accept bytes on this channel as being +.\"O Unix +.\"O signal numbers, to be +.\"O forwarded to the process group of the command. +.\"O The diagnostic +.\"O information returned does not include remote authorization failure, +.\"O as the secondary connection is set up after authorization has been +.\"O verified. +À©¸æ¥×¥í¥»¥¹¤Ï¥³¥Þ¥ó¥É¤«¤é¤Î¿ÇÃÇ¥á¥Ã¥»¡¼¥¸½ÐÎÏ (¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ 2) +¤ò¤³¤Î¥Á¥ã¥ó¥Í¥ë¤ÇÊÖ¤¹¡£¤Þ¤¿¡¢¤³¤Î¥Á¥ã¥ó¥Í¥ë·Ðͳ¤Ç +Unix ¤Î¥·¥°¥Ê¥ëÈÖ¹æ¤ò¼¨¤¹¥Ð¥¤¥È¤ò¼õ¿®¤¹¤ë¡£¼õ¿®¤·¤¿¥·¥°¥Ê¥ë¤Ï +¥³¥Þ¥ó¥É¤¬Â°¤¹¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ËžÁ÷¤µ¤ì¤ë¡£ +¿ÇÃǾðÊó¤Ë¤Ï¥ê¥â¡¼¥È¤Îǧ¾Ú¼ºÇԤϴޤޤì¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢Ç§¾Ú¤Î³Îǧ¤¬¹Ô¤ï¤ì¤¿ +¸å¤ÇÊä½õ¥Á¥ã¥ó¥Í¥ë¤ÎÀܳ¤Ï¥»¥Ã¥È¥¢¥Ã¥×¤µ¤ì¤ë¤«¤é¤Ç¤¢¤ë¡£ +.\"O If +.\"O .I fd2p +.\"O is 0, then the +.\"O .IR stderr +.\"O (unit 2 of the remote +.\"O command) will be made the same as the +.\"O .IR stdout +.\"O and no +.\"O provision is made for sending arbitrary signals to the remote process, +.\"O although you may be able to get its attention by using out-of-band data. +.I fd2p +¤¬ 0 ¤Î¾ì¹ç¡¢É¸½à¥¨¥é¡¼ (¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ 2) ¤Ï +ɸ½à½ÐÎϤÈƱÍͤ˰·¤ï¤ì¡¢¥ê¥â¡¼¥È¥×¥í¥»¥¹¤ËǤ°Õ¤Î¥·¥°¥Ê¥ë¤òÁ÷¤ë¤¿¤á¤Î +¼êÃʤÏÄ󶡤µ¤ì¤Ê¤¤¡£Ã¢¤·¡¢¥ê¥â¡¼¥È¥×¥í¥»¥¹¤ËÂФ·¤Æ¥È¥ê¥¬¤ò¤«¤±¤ë¤¿¤á¤Ë¡¢ +ÂÓ°è³°¥Ç¡¼¥¿ (out-of-band data) ¤ò»È¤¦¤³¤È¤Ï¤Ç¤­¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Not in POSIX.1-2001. +.\"O Present on the BSDs, Solaris, and many other systems. +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¡¢Solaris ¤ä¾¤Î¿¤¯¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +.\"O The +.\"O .BR rexec () +.\"O function appeared in +.\"O 4.2BSD. +.BR rexec () +´Ø¿ô¤Ï 4.2BSD ¤Ç»Ï¤á¤ÆÅо줷¤¿¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The +.\"O .BR rexec () +.\"O function sends the unencrypted password across the network. +.BR rexec () +´Ø¿ô¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¤Ë°Å¹æ²½¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ñ¥¹¥ï¡¼¥É¤òÁ÷¿®¤¹¤ë¡£ +.PP +.\"O The underlying service is considered a big security hole and therefore +.\"O not enabled on many sites, see +.\"O .BR rexecd (8) +.\"O for explanations. +´ðÁÃŪ¤Ê¥µ¡¼¥Ó¥¹¤Ë¤ª¤¤¤Æ¤ÏÂ礭¤Ê¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤È¹Í¤¨¤é¤ì¤ë¤¿¤á¡¢ +¿¤¯¤Î¥µ¥¤¥È¤Ç̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£¾ÜºÙ¤Ï +.BR rexecd (8) +¤ò»²¾È¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR rcmd (3), +.BR rexecd (8) diff --git a/draft/man3/rint.3 b/draft/man3/rint.3 new file mode 100644 index 00000000..a2150cff --- /dev/null +++ b/draft/man3/rint.3 @@ -0,0 +1,187 @@ +.\" Copyright 2001 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. +.\" +.\" 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 ²¾¿ô +.\" +.TH RINT 3 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "double nearbyint(double " x ); +.br +.BI "float nearbyintf(float " x ); +.br +.BI "long double nearbyintl(long double " x ); +.sp +.BI "double rint(double " x ); +.br +.BI "float rintf(float " x ); +.br +.BI "long double rintl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR nearbyint (), +.BR nearbyintf (), +.BR nearbyintl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR rint (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR rintf (), +.BR rintl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.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 +Îã³°¤ò½Ð¤µ¤Ê¤¤¡£ +.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" +.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 +.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" +.SH ½àµò +C99, POSIX.1-2001. +.\"O .SH NOTES +.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 ¤Ç¤¢¤ë¡£) + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR ceil (3), +.BR floor (3), +.BR lrint (3), +.BR round (3), +.BR trunc (3) diff --git a/draft/man3/round.3 b/draft/man3/round.3 new file mode 100644 index 00000000..0611482c --- /dev/null +++ b/draft/man3/round.3 @@ -0,0 +1,167 @@ +.\" Copyright 2001 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. +.\" +.\" 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 ²¾¿ô +.\" +.TH ROUND 3 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O round, roundf, roundl \- round to nearest integer, away from zero +round, roundf, roundl \- ºÇ¤â¶á¤¤À°¿ôÃͤ˴ݤá¤ë (2 ¤Ä¤ÎÀ°¿ô¤ÎÃæ´ÖÃͤξì¹ç¤Ï 0 ¤«¤é±ó¤¤Êý¤Ë´Ý¤á¤ë) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double round(double " x ); +.br +.BI "float roundf(float " x ); +.br +.BI "long double roundl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR round (), +.BR roundf (), +.BR roundl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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) +¤ò»²¾È)¡£ + +.\"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" +.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 +.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 +.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 +.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 ¤Ç¤¢¤ê¡¢ +²¾¿ôÉô¤Î¥Ó¥Ã¥È¿ô¤Ï¤½¤ì¤¾¤ì 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" +.SH ´ØÏ¢¹àÌÜ +.BR ceil (3), +.BR floor (3), +.BR lround (3), +.BR nearbyint (3), +.BR rint (3), +.BR trunc (3) diff --git a/draft/man3/rpc.3 b/draft/man3/rpc.3 new file mode 100644 index 00000000..ff1ec446 --- /dev/null +++ b/draft/man3/rpc.3 @@ -0,0 +1,1779 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)rpc.3n 2.4 88/08/08 4.0 RPCSRC; from 1.19 88/06/24 SMI +.\" +.\" 2007-12-30, mtk, Convert function prototypes to modern C syntax +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Tue Jan 4 20:48:23 JST 2000 +.\" by HANATAKA Shinya +.\" Updated & Modified Sun Oct 21 01:07:09 JST 2001 +.\" by Yuichi SATO +.\" +.TH RPC 3 2008-07-17 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O rpc \- library routines for remote procedure calls +rpc \- ±ó³Ö¼ê³¤­¸Æ¤Ó½Ð¤·(RPC)¤Î¤¿¤á¤Î¥é¥¤¥Ö¥é¥ê¡¦¥ë¡¼¥Æ¥£¥ó +.\"O .SH SYNOPSIS AND DESCRIPTION +.SH ½ñ¼°¤ÈÀâÌÀ +.\"O These routines allow C programs to make procedure +.\"O calls on other machines across the network. +.\"O First, the client calls a procedure to send a data packet to the server. +.\"O Upon receipt of the packet, the server calls a dispatch routine +.\"O to perform the requested service, and then sends back a reply. +.\"O Finally, the procedure call returns to the client. +¤³¤ì¤é¤Î¥ë¡¼¥Æ¥£¥ó¤Ï C ¥×¥í¥°¥é¥à¤Ç¥Í¥Ã¥È¥ï¡¼¥¯¤òÄ̤·¤Æ +¾¤Î¥Þ¥·¥ó¤Ë¥¢¥¯¥»¥¹¤¹¤ë¥×¥í¥·¥¸¥ã¤òºîÀ®¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£ +ºÇ½é¤Ë¥¯¥é¥¤¥¢¥ó¥È¤Ï¥Ç¡¼¥¿¥Ñ¥±¥Ã¥È¤ò¥µ¡¼¥Ð¤ËÁ÷¤ë¤¿¤á¤Ë +¥×¥í¥·¥¸¥ã¤ò¸Æ¤Ó½Ð¤¹¡£ +¥µ¡¼¥Ð¤Ï¥Ñ¥±¥Ã¥È¤ò¼õ¤±¼è¤ë¤È¡¢ÇÛʬ¥ë¡¼¥Á¥ó¤ò¸Æ¤Ó½Ð¤·¤Æ +Í׵ᤵ¤ì¤¿¥µ¡¼¥Ó¥¹¤Ë¼Â¹Ô¤·¡¢ÊÖÅú¤òÁ÷¤êÊÖ¤¹¡£ +ºÇ¸å¤Ë¥×¥í¥·¥¸¥ã¡¦¥³¡¼¥ë¤Ï¥¯¥é¥¤¥¢¥ó¥È¤Ø¤ÈÌá¤ë¡£ +.\" .LP +.\"O .\" We don't have an rpc_secure.3 page at the moment -- MTK, 19 Sep 05 +.\"O .\" Routines that are used for Secure RPC (DES authentication) are described in +.\"O .\" .BR rpc_secure (3). +.\"O .\" Secure RPC can be used only if DES encryption is available. +.\" º£¸½ºß¤Ï rpc_secure.3 ¤ÏÆþ¤Ã¤Æ¤¤¤Ê¤¤ -- MTK, 19 Sep 05 +.\" (DES ǧ¾Ú¤Ë¤è¤ë) Secure RPC ¤Ç»ÈÍѤµ¤ì¤ë¥ë¡¼¥Æ¥£¥ó¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀ¤Ï +.\" .BR rpc_secure (3) +.\" ¤Ë¸ºß¤¹¤ë¡£ Secure RPC ¤Ï DES ǧ¾Ú¤¬ÍøÍѲÄǽ¤Ê¾ì¹ç¤Ë¤Î¤ß»ÈÍѤǤ­¤ë¡£ +.LP +.\"O To take use of these routines, include the header file +.\"O .IR "" . +¤³¤ì¤é¤Î¥ë¡¼¥Æ¥£¥ó¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.I "" +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤³¤È¡£ + +.\"O The prototypes below make use of the following types: +²¼µ­¤Î¥×¥í¥È¥¿¥¤¥×¤Ç¤Ï¼¡¤Î·¿¤ò»ÈÍѤ·¤Æ¤¤¤ë¡£ +.in +4n +.nf + +typedef int \fIbool_t\fP; + +typedef bool_t (*\fIxdrproc_t\fP) (XDR *, void *,...); + +typedef bool_t (*\fIresultproc_t\fP) (caddr_t resp, + struct sockaddr_in *raddr); +.fi +.in +.LP +.\"O See the header files for the declarations of the +.\"O .IR AUTH , +.\"O .IR CLIENT , +.\"O .IR SVCXPRT , +.\"O and +.\"O .IR XDR +.\"O types. +·¿ +.IR AUTH , +.IR CLIENT , +.IR SVCXPRT , +.IR XDR +¤ÎÀë¸À¤Ë¤Ä¤¤¤Æ¤Ï¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ò»²¾È¡£ +.LP +.nf +.BI "void auth_destroy(AUTH *" auth ); +.fi +.IP +.\"O A macro that destroys the authentication information associated with +.\"O .IR auth . +.\"O Destruction usually involves deallocation of private data structures. +.\"O The use of +.\"O .I auth +.\"O is undefined after calling +.\"O .BR auth_destroy (). +¤³¤Î¥Þ¥¯¥í¤Ï +.I auth +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ç§¾Ú¾ðÊó¤òÇ˲õ¤¹¤ë¡£Ç˲õ¤ÏÄ̾ï¤Ï»äŪ¤Ê¥Ç¡¼¥¿¹½Â¤¤Î +ÇË´þ¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +.BR auth_destroy () +¤ò¸Æ¤Ó½Ð¤·¤¿¸å¤Ë +.I auth +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "AUTH *authnone_create(void);" +.fi +.IP +.\"O Create and returns an RPC +.\"O authentication handle that passes nonusable authentication +.\"O information with each remote procedure call. +.\"O This is the default authentication used by RPC. +³Æ¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¡¦¥³¡¼¥ë¤Ç»ÈÍѤǤ­¤Ê¤¤²¾¤Îǧ¾Ú¾ðÊó¤È¤·¤ÆÅϤµ¤ì¤ë +RPC ǧ¾Ú¥Ï¥ó¥É¥ë¤òºîÀ®¤·¤ÆÊÖ¤¹¡£ +¤³¤ì¤Ï RPC ¤Ç»ÈÍѤµ¤ì¤ë¥Ç¥Õ¥©¥ë¥È¤Îǧ¾Ú¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "AUTH *authunix_create(char *" host ", int " uid ", int " gid , +.BI " int " len ", int *" aup_gids ); +.fi +.IP +.\"O Create and return an RPC authentication handle that contains +.\"O authentication information. +.\"O The parameter +.\"O .I host +.\"O is the name of the machine on which the information was created; +.\"O .I uid +.\"O is the user's user ID; +.\"O .I gid +.\"O is the user's current group ID; +.\"O .I len +.\"O and +.\"O .I aup_gids +.\"O refer to a counted array of groups to which the user belongs. +.\"O It is easy to impersonate a user. +ǧ¾Ú¾ðÊó¤ò´Þ¤ó¤À RPC ǧ¾Ú¥Ï¥ó¥É¥ë¤òºîÀ®¤·¤ÆÊÖ¤¹¡£ +.I host +¥Ñ¥é¥á¡¼¥¿¡¼¤Ï¾ðÊ󤬺îÀ®¤µ¤ì¤¿¥Þ¥·¥ó¤Î̾Á°¤Ç¤¢¤ë¡£ +.I uid +¤Ï¤½¤Î¥æ¡¼¥¶¤Î¥æ¡¼¥¶ +.SM ID +¡¢ +.I gid +¤Ï¤½¤Î¥æ¡¼¥¶¤Î¸½ºß¤Î¥°¥ë¡¼¥× +.SM ID +¤Ç¤¢¤ë¡£ +.I len +¤È +.I aup_gids +¤Ï¤½¤Î¥æ¡¼¥¶¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤ÎÇÛÎó¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +¾¤Î¥æ¡¼¥¶¤Ë¤Ê¤ê¤¹¤Þ¤¹¤³¤È¤Ï´Êñ¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "AUTH *authunix_create_default(void);" +.fi +.IP +.\"O Calls +.\"O .BR authunix_create () +.\"O with the appropriate parameters. +ŬÀڤʥѥé¥á¡¼¥¿¡¼¤Ç +.BR authunix_create () +¤ò¸Æ¤Ó½Ð¤¹¡£ +.LP +.nf +.BI "int callrpc(char *" host ", unsigned long " prognum , +.BI " unsigned long " versnum ", unsigned long " procnum , +.BI " xdrproc_t " inproc ", char *" in , +.BI " xdrproc_t " outproc ", char *" out ); +.fi +.IP +.\"O Call the remote procedure associated with +.\"O .IR prognum , +.\"O .IR versnum , +.\"O and +.\"O .I procnum +.\"O on the machine, +.\"O .IR host . +.\"O The parameter +.\"O .I in +.\"O is the address of the procedure's argument(s), and +.\"O .I out +.\"O is the address of where to place the result(s); +.\"O .I inproc +.\"O is used to encode the procedure's parameters, and +.\"O .I outproc +.\"O is used to decode the procedure's results. +.\"O This routine returns zero if it succeeds, or the value of +.\"O .B "enum clnt_stat" +.\"O cast to an integer if it fails. +.\"O The routine +.\"O .BR clnt_perrno () +.\"O is handy for translating failure statuses into messages. +¥Þ¥·¥ó +.I host +¾å¤Ç +.IR prognum , +.IR versnum , +.I procnum +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¤ò¸Æ¤Ó½Ð¤¹¡£ +¥Ñ¥é¥á¡¼¥¿¡¼ +.I in +¤Ï¥×¥í¥·¥¸¥ã¤Î°ú¤­¿ô¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ê +.I out +¤Ï·ë²Ì¤ò³ÊǼ¤¹¤ë¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I inproc +¤Ï¥×¥í¥·¥¸¥ã¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¡¢ +.I outproc +¤Ï·ë²Ì¤ò¥Ç¥³¡¼¥É¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï +.B "enum clnt_stat" +¤òÀ°¿ô¤Ë¥­¥ã¥¹¥È¤·¤¿ÃͤòÊÖ¤¹¡£ +.BR clnt_perrno () +¥ë¡¼¥Æ¥£¥ó¤¬¼ºÇԤξõÂÖ¤ò¥á¥Ã¥»¡¼¥¸¤ËÊÑ´¹¤¹¤ë¤Î¤Ë»ÈÍѤǤ­¤ë¡£ +.IP +.\"O Warning: calling remote procedures with this routine +.\"O uses UDP/IP as a transport; see +.\"O .BR clntudp_create () +.\"O for restrictions. +.\"O You do not have control of timeouts or authentication using this routine. +·Ù¹ð: ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ç¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¤ò¸Æ¤Ó½Ð¤¹¤ÈÄÌ¿®¤Ë¤Ï +UDP/IP ¤¬»ÈÍѤµ¤ì¤ë¡£¤³¤ÎºÝ¤ÎÀ©¸Â¤Ë¤Ä¤¤¤Æ¤Ï +.BR clntudp_create () +¤ò»²¾È¤¹¤ë¤³¤È¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ò»ÈÍѤ·¤Æǧ¾Ú¤ä»þ´ÖÀÚ¤ì¤ÎÀ©¸æ¤ò +¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.LP +.nf +.BI "enum clnt_stat clnt_broadcast(unsigned long " prognum , +.BI " unsigned long " versnum ", unsigned long " procnum , +.BI " xdrproc_t " inproc ", char *" in , +.BI " xdrproc_t " outproc ", char *" out , +.BI " resultproc_t " eachresult ); +.fi +.IP +.\"O Like +.\"O .BR callrpc (), +.\"O except the call message is broadcast to all locally +.\"O connected broadcast nets. +.\"O Each time it receives a response, this routine calls +.\"O .BR eachresult (), +.\"O whose form is: +.BR callrpc () +¤ÈƱÍͤǤ¢¤ë¤¬¡¢¥á¥Ã¥»¡¼¥¸¤¬¥í¡¼¥«¥ë¤Î¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¡¦¥Í¥Ã¥È¥ï¡¼¥¯ +Á´ÂÎ¤Ø¤È¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤µ¤ì¤ëÅÀ¤¬°Û¤Ã¤Æ¤¤¤ë¡£²óÅú¤ò¼õ¤±¼è¤ëÅÙ¤Ë +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï°Ê²¼¤Î·Á¼°¤Î +.BR eachresult () +¤ò¸Æ¤Ó½Ð¤¹¡£ +.IP +.in +4n +.nf +.BI "eachresult(char *" out ", struct sockaddr_in *" addr ); +.fi +.in +.IP +.\"O where +.\"O .I out +.\"O is the same as +.\"O .I out +.\"O passed to +.\"O .BR clnt_broadcast (), +.\"O except that the remote procedure's output is decoded there; +.\"O .I addr +.\"O points to the address of the machine that sent the results. +.\"O If +.\"O .BR eachresult () +.\"O returns zero, +.\"O .BR clnt_broadcast () +.\"O waits for more replies; otherwise it returns with appropriate status. +¤³¤³¤Ç +.I out +¤Ï +.BR clnt_broadcast () +¤ËÅϤµ¤ì¤ë +.I out +¤ÈƱ¤¸¤Ç¤¢¤ë¤¬¡¢¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¤«¤é¤Î½ÐÎϤ¬¥Ç¥³¡¼¥É¤µ¤ì¤Æ¤¤¤ë +ÅÀ¤Î¤ß¤¬°Û¤Ã¤Æ¤¤¤ë¡£ +.I addr +¤Ï·ë²Ì¤òÁ÷¤Ã¤ÆÍ褿¥Þ¥·¥ó¤Î¥¢¥É¥ì¥¹¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.BR eachresult () +¤¬¥¼¥í¤òÊÖ¤·¤¿¾ì¹ç¡¢ +.BR clnt_broadcast () +¤Ï¤µ¤é¤Ê¤ë²óÅú¤òÂԤġ£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐŬÀڤʾõÂ֤ǽªÎ»¤¹¤ë¡£ +.IP +.\"O Warning: broadcast sockets are limited in size to the +.\"O maximum transfer unit of the data link. +.\"O For ethernet, this value is 1500 bytes. +·Ù¹ð: ¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¡¦¥½¥±¥Ã¥È¤Ï¥Ç¡¼¥¿¥ê¥ó¥¯ÁؤκÇÂçžÁ÷ñ°Ì¤Ë +À©¸Â¤µ¤ì¤Æ¤¤¤ë¡£¥¤¡¼¥µ¥Í¥Ã¥È¤Î¾ì¹ç¡¢ºÇÂçÃÍ¤Ï 1500 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "enum clnt_stat clnt_call(CLIENT *" clnt ", unsigned long " procnum , +.BI " xdrproc_t " inproc ", char *" in , +.BI " xdrproc_t " outproc ", char *" out , +.BI " struct timeval " tout ); +.fi +.IP +.\"O A macro that calls the remote procedure +.\"O .I procnum +.\"O associated with the client handle, +.\"O .IR clnt , +.\"O which is obtained with an RPC client creation routine such as +.\"O .BR clnt_create (). +¤³¤Î¥Þ¥¯¥í¤Ï¥¯¥é¥¤¥¢¥ó¥È¡¦¥Ï¥ó¥É¥ë +.I clnt +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +.I procnum +¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¤ò¸Æ¤Ó½Ð¤¹¡£ +¥¯¥é¥¤¥¢¥ó¥È¡¦¥Ï¥ó¥É¥ë¤Ï +.BR clnt_create () +¤Î¤è¤¦¤Ê +.SM RPC +¥¯¥é¥¤¥¢¥ó¥ÈºîÀ®¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤ë¡£ +.\"O The parameter +.\"O .I in +.\"O is the address of the procedure's argument(s), and +.\"O .I out +.\"O is the address of where to place the result(s); +.\"O .I inproc +.\"O is used to encode the procedure's parameters, and +.\"O .I outproc +.\"O is used to decode the procedure's results; +.\"O .I tout +.\"O is the time allowed for results to come back. +¥Ñ¥¿¥á¡¼¥¿ +.I in +¤Ï¥×¥í¥·¥¸¥ã¤Î°ú¤­¿ô¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I out +¤Ï¥×¥í¥·¥¸¥ã¤ÎÊÖ¤êÃͤò³ÊǼ¤¹¤ë¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I inproc +¤Ï¥×¥í¥·¥¸¥ã¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +.I outproc +¤Ï¥×¥í¥·¥¸¥ã¤ÎÊÖ¤êÃͤò¥Ç¥³¡¼¥É¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +.I tout +¤Ï·ë²Ì¤¬ÊÖ¤µ¤ì¤ë¤Î¤òÂԤĻþ´Ö¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "clnt_destroy(CLIENT *" clnt ); +.fi +.IP +.\"O A macro that destroys the client's RPC handle. +.\"O Destruction usually involves deallocation +.\"O of private data structures, including +.\"O .I clnt +.\"O itself. +.\"O Use of +.\"O .I clnt +.\"O is undefined after calling +.\"O .BR clnt_destroy (). +.\"O If the RPC library opened the associated socket, it will close it also. +.\"O Otherwise, the socket remains open. +¤³¤Î¥Þ¥¯¥í¤Ï¥¯¥é¥¤¥¢¥ó¥È¤Î RPC ¥Ï¥ó¥É¥ë¤òÇ˲õ¤¹¤ë¡£Ç˲õ¤Ë¤ÏÄ̾ï¤Ï +.I clnt +¼«¿È¤â´Þ¤á¤Æ»äŪ¤Ê¥Ç¡¼¥¿¹½Â¤ÂΤÎÇË´þ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.BR clnt_destroy () +¤Î¸Æ¤Ó½Ð¤·¤Î¸å¤Ë +.I clnt +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +RPC ¥é¥¤¥Ö¥é¥ê¤¬´ØÏ¢¤¹¤ë¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +¤½¤ì¤âÊĤ¸¤é¤ì¤ë¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¥½¥±¥Ã¥È¤Ï¥ª¡¼¥×¥ó¤µ¤ì¤¿¤Þ¤Þ¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "CLIENT *clnt_create(char *" host ", unsigned long " prog , +.BI " unsigned long " vers ", char *" proto ); +.fi +.IP +.\"O Generic client creation routine. +.\"O .I host +.\"O identifies the name of the remote host where the server is located. +.\"O .I proto +.\"O indicates which kind of transport protocol to use. +.\"O The currently supported values for this field are \(lqudp\(rq +.\"O and \(lqtcp\(rq. +.\"O Default timeouts are set, but can be modified using +.\"O .BR clnt_control (). +°ìÈÌŪ¤Ê¥¯¥é¥¤¥¢¥ó¥È¤ÎºîÀ®¥ë¡¼¥Æ¥£¥ó¤Ç¤¢¤ë¡£ +.I host +¤Ï¥µ¡¼¥Ð¤Î¤¢¤ë¥ê¥â¡¼¥È¥Û¥¹¥È¤Î̾Á°¤ò»ØÄꤹ¤ë¡£ +.I proto +¤É¤Î¤è¤¦¤ÊÄÌ¿®¥×¥í¥È¥³¥ë¤ò»ÈÍѤ¹¤ë¤«¤ò»ØÄꤹ¤ë¡£¸½ºß¤³¤³¤Ë +»ÈÍѤǤ­¤ëÃÍ¤Ï \(lqudp\(rq ¤È \(lqtcp\(rq ¤Ç¤¢¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î»þ´ÖÀڤ줬ÀßÄꤵ¤ì¤ë¤¬¡¢ +.BR clnt_control () +¤ò»ÈÍѤ·¤ÆÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +.IP +.\"O Warning: Using UDP has its shortcomings. +.\"O Since UDP-based RPC messages can only hold up to 8 Kbytes of encoded data, +.\"O this transport cannot be used for procedures that take +.\"O large arguments or return huge results. +·Ù¹ð: +UDP ¤ò»ÈÍѤ·¤¿¾ì¹ç¤Ë¤Ï·çÅÀ¤¬¤¢¤ë¡£ +UDP ¤Ë´ð¤Å¤¤¤¿ RPC ¥á¥Ã¥»¡¼¥¸¤Ï +ºÇÂç¤Ç¤â 8 KByte ¤Î¥¨¥ó¥³¡¼¥É¥Ç¡¼¥¿¤·¤«ÊÝ»ý¤¹¤ë +¤³¤È¤¬¤Ç¤­¤Ê¤¤¤¿¤á¡¢Â礭¤Ê°ú¤­¿ô¤äµðÂç¤Ê·ë²Ì¤ò¼è¤ë¥×¥í¥·¥¸¥ã¤Ë +¤Ï»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.LP +.nf +.BI "bool_t clnt_control(CLIENT *" cl ", int " req ", char *" info ); +.fi +.IP +.\"O A macro used to change or retrieve various information +.\"O about a client object. +.\"O .I req +.\"O indicates the type of operation, and +.\"O .I info +.\"O is a pointer to the information. +.\"O For both UDP and TCP, the supported values of +.\"O .I req +.\"O and their argument types and what they do are: +¤³¤Î¥Þ¥¯¥í¤Ï³Æ¼ï¥¯¥é¥¤¥¢¥ó¥È¤Ë¤Ä¤¤¤Æ¾ðÊó¤òÊѹ¹¤·¤¿¤ê¡¢¼èÆÀ¤·¤¿¤ê +¤¹¤ë¤Î¤Ë»ÈÍѤ¹¤ë¡£ +.I req +¤ÏÁàºî¤Î¼ïÎà¤ò»ØÄꤹ¤ë¡£ +.I info +¤Ï¾ðÊó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +UDP ¤È TCP ¤É¤Á¤é¤Î¾ì¹ç¤â»ÈÍѲÄǽ¤Ê +.I req +¤ÎÃͤȡ¢¤½¤Î°ú¤­¿ô¤Î·¿¡¢¤ª¤è¤Ó¤½¤ÎÆâÍƤϰʲ¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.IP +.in +4n +.nf +.ta +2.0i +2.0i +2.0i +.\"O \fBCLSET_TIMEOUT\fP \fIstruct timeval\fP // set total timeout +.\"O \fBCLGET_TIMEOUT\fP \fIstruct timeval\fP // get total timeout +\fBCLSET_TIMEOUT\fP \fIstruct timeval\fP // »þ´ÖÀÚ¤ì¤òÀßÄꤹ¤ë +\fBCLGET_TIMEOUT\fP \fIstruct timeval\fP // »þ´ÖÀÚ¤ì¤ò¼èÆÀ¤¹¤ë +.fi +.in +.IP +.\"O Note: if you set the timeout using +.\"O .BR clnt_control (), +.\"O the timeout parameter passed to +.\"O .BR clnt_call () +.\"O will be ignored in all future calls. +Ãí°Õ: +.BR clnt_control () +¤ò»ÈÍѤ·¤Æ»þ´ÖÀÚ¤ì¤òÀßÄꤷ¤¿¾ì¹ç¤Ë¤Ï¤½¤ì°Ê¸å¤Ï +.BR clnt_call () +¤ËÅϤµ¤ì¤ë»þ´ÖÀÚ¤ì¥Ñ¥é¥á¡¼¥¿¡¼¤ÏÁ´¤Æ̵»ë¤µ¤ì¤ë¡£ +.IP +.in +4n +.nf +.\"O \fBCLGET_SERVER_ADDR\fP \fIstruct sockaddr_in \fP // get server's address +\fBCLGET_SERVER_ADDR\fP \fIstruct sockaddr_in \fP // ¥µ¡¼¥Ð¥¢¥É¥ì¥¹¤ò¼èÆÀ¤¹¤ë +.fi +.in +.IP +.\"O The following operations are valid for UDP only: +°Ê²¼¤ÎÁàºî¤Ï UDP ¤Î¾ì¹ç¤Ë¤Î¤ßÍ­¸ú¤Ç¤¢¤ë: +.IP +.in +4n +.nf +.\"O \fBCLSET_RETRY_TIMEOUT\fP \fIstruct timeval\fP // set the retry timeout +.\"O \fBCLGET_RETRY_TIMEOUT\fP \fIstruct timeval\fP // get the retry timeout +\fBCLSET_RETRY_TIMEOUT\fP \fIstruct timeval\fP // ºÆÁ÷´Ö³Ö¤òÀßÄꤹ¤ë +\fBCLGET_RETRY_TIMEOUT\fP \fIstruct timeval\fP // ºÆÁ÷´Ö³Ö¤ò¼èÆÀ¤¹¤ë +.fi +.in +.IP +.\"O The retry timeout is the time that "UDP RPC" +.\"O waits for the server to reply before +.\"O retransmitting the request. +ºÆÁ÷´Ö³Ö¤Ï¼¡¤ËÍ×µá¤òºÆÁ÷¤¹¤ëÁ°¤Ë +"UDP RPC" ¤¬¥µ¡¼¥Ð¤Î²óÅú¤òÂԤĻþ´Ö¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "clnt_freeres(CLIENT * " clnt ", xdrproc_t " outproc ", char *" out ); +.fi +.IP +.\"O A macro that frees any data allocated by the RPC/XDR +.\"O system when it decoded the results of an RPC call. +.\"O The parameter +.\"O .I out +.\"O is the address of the results, and +.\"O .I outproc +.\"O is the XDR routine describing the results. +.\"O This routine returns one if the results were successfully freed, +.\"O and zero otherwise. +¤³¤Î¥Þ¥¯¥í¤Ï RPC ¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤Î¥Ç¥³¡¼¥É¤ÎºÝ¤Ë +RPC/XDR ¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ³äÅö¤Æ¤é¤ì¤¿¥Ç¡¼¥¿¤ò²òÊü¤¹¤ë¡£ +¥Ñ¥é¥á¡¼¥¿¡¼ +.I out +¤Ï·ë²Ì¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I outproc +¤Ï·ë²Ì¤òµ­½Ò¤·¤Æ¤¤¤ë XDR ¥ë¡¼¥Æ¥£¥ó¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï·ë²Ì¤Î²òÊü¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "void clnt_geterr(CLIENT *" clnt ", struct rpc_err *" errp ); +.fi +.IP +.\"O A macro that copies the error structure out of the client +.\"O handle to the structure at address +.\"O .IR errp . +¤³¤Î¥Þ¥¯¥í¤Ï¥¯¥é¥¤¥¢¥ó¥È¡¦¥Ï¥ó¥É¥ë¤Î¥¨¥é¡¼¹½Â¤ÂΤò +.I errp +¥¢¥É¥ì¥¹¤Ç»ØÄꤵ¤ì¤¿¹½Â¤ÂΤإ³¥Ô¡¼¤¹¤ë¡£ +.LP +.nf +.BI "void clnt_pcreateerror(char *" s ); +.fi +.IP +.\"O Print a message to standard error indicating why a client RPC +.\"O handle could not be created. +.\"O The message is prepended with string +.\"O .I s +.\"O and a colon. +.\"O Used when a +.\"O .BR clnt_create (), +.\"O .BR clntraw_create (), +.\"O .BR clnttcp_create (), +.\"O or +.\"O .BR clntudp_create () +.\"O call fails. +ɸ½à¥¨¥é¡¼½ÐÎϤˡ¢¤Ê¤¼¥¯¥é¥¤¥¢¥ó¥È RPC ¥Ï¥ó¥É¥ë¤ÎºîÀ®¤¬ +¤Ç¤­¤Ê¤«¤Ã¤¿¤«¤Ë¤Ä¤¤¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤ÎÁ°¤Ëʸ»úÎó +.I s +¤È¥³¥í¥ó(:)¤¬É½¼¨¤µ¤ì¤ë¡£ +.BR clnt_create (), +.BR clntraw_create (), +.BR clnttcp_create (), +.BR clntudp_create () +¤Î¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤·¤¿»þ¤Ë»ÈÍѤ¹¤ë¤³¤È¡£ +.LP +.nf +.BI "void clnt_perrno(enum clnt_stat " stat ); +.fi +.IP +.\"O Print a message to standard error corresponding +.\"O to the condition indicated by +.\"O .IR stat . +.\"O Used after +.\"O .BR callrpc (). +ɸ½à¥¨¥é¡¼½ÐÎÏ¤Ë +.I stat +¤Ë¤è¤Ã¤Æ»Ø¼¨¤µ¤ì¤ë¥¨¥é¡¼¾õÂÖ¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£ +.BR callrpc () +¤Î¸å¤Ë»ÈÍѤ¹¤ë¤³¤È¡£ +.LP +.nf +.BI "clnt_perror(CLIENT *" clnt ", char *" s ); +.fi +.IP +.\"O Print a message to standard error indicating why an RPC call failed; +.\"O .I clnt +.\"O is the handle used to do the call. +.\"O The message is prepended with string +.\"O .I s +.\"O and a colon. +.\"O Used after +.\"O .BR clnt_call (). +ɸ½à¥¨¥é¡¼½ÐÎϤˡ¢¤Ê¤¼ RPC ¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤·¤¿¤«¤Ë¤Ä¤¤¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£ +.I clnt +¤Ï¥³¡¼¥ë¤Ë»ÈÍѤ·¤¿¥Ï¥ó¥É¥ë¤Ç¤¢¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤ÎÁ°¤Ëʸ»úÎó +.I s +¤È¥³¥í¥ó(:)¤¬É½¼¨¤µ¤ì¤ë¡£ +.BR clnt_call () +¤¬¼ºÇÔ¤·¤¿¸å¤Ë»ÈÍѤ¹¤ë¤³¤È¡£ +.LP +.nf +.BI "char *clnt_spcreateerror(char *" s ); +.fi +.IP +.\"O Like +.\"O .BR clnt_pcreateerror (), +.\"O except that it returns a string instead of printing to the standard error. +.BR clnt_pcreateerror () +¤ÈƱÍͤǤ¢¤ë¤¬¡¢É¸½à¥¨¥é¡¼½ÐÎϤØɽ¼¨¤¹¤ë¤«¤ï¤ê¤Ëʸ»úÎó¤òÊÖ¤¹ÅÀ¤¬°Û¤Ã¤Æ¤¤¤ë¡£ +.IP +.\"O Bugs: returns pointer to static data that is overwritten on each call. +¥Ð¥°: ÀÅŪ¤ÊÎΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¤¿¤á¡¢¸Æ¤Ó½Ð¤·¤´¤È¤Ë¾å½ñ¤­¤µ¤ì¤ë¡£ +.LP +.nf +.BI "char *clnt_sperrno(enum clnt_stat " stat ); +.fi +.IP +.\"O Take the same arguments as +.\"O .BR clnt_perrno (), +.\"O but instead of sending a message to the standard error indicating why an RPC +.\"O call failed, return a pointer to a string which contains the message. +.\"O The string ends with a NEWLINE. +.BR clnt_perrno () +¤ÈƱ¤¸°ú¤­¿ô¤ò¼è¤ë¤¬¡¢¤Ê¤¼ +RPC ¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤·¤¿¤«¤Ë¤Ä¤¤¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤òɸ½à¥¨¥é¡¼½ÐÎϤËɽ¼¨¤¹¤ë +¤«¤ï¤ê¤Ë¡¢¥á¥Ã¥»¡¼¥¸¤ò³ÊǼ¤·¤Æ¤¤¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +ʸ»úÎó¤Ï NEWLINE(²þ¹Ô) ¤Ç½ª¤Ã¤Æ¤¤¤ë¡£ +.IP +.\"O .BR clnt_sperrno () +.\"O is used instead of +.\"O .BR clnt_perrno () +.\"O if the program does not have a standard error (as a program +.\"O running as a server quite likely does not), or if the programmer +.\"O does not want the message to be output with +.\"O .BR printf (3), +.\"O or if a message format different than that supported by +.\"O .BR clnt_perrno () +.\"O is to be used. +.\"O Note: unlike +.\"O .BR clnt_sperror () +.\"O and +.\"O .BR clnt_spcreaterror (), +.\"O .BR clnt_sperrno () +.\"O returns pointer to static data, but the +.\"O result will not get overwritten on each call. +.BR clnt_sperrno () +¤Ï¥×¥í¥°¥é¥à¤¬É¸½à¥¨¥é¡¼½ÐÎϤò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç(¥×¥í¥°¥é¥à¤¬¥µ¡¼¥Ð¤È¤· +¤ÆÁö¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¤è¤¯¤¢¤ê¤¨¤ë)¤ä¡¢¥×¥í¥°¥é¥Þ¡¼¤¬¥á¥Ã¥»¡¼¥¸¤ò +.BR printf (3) +¤Ç½ÐÎϤ¹¤ë¤³¤È¤ò˾¤Þ¤Ê¤¤¾ì¹ç¤ä¡¢¥á¥Ã¥»¡¼¥¸¤Î·Á¼°¤¬ +.BR clnt_perrno () +¤¬¥µ¥Ý¡¼¥È¤¹¤ë¤â¤Î¤È¤Ï°Û¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ê¤É¤Ë +.BR clnt_perrno () +¤Î¤«¤ï¤ê¤Ë»ÈÍѤµ¤ì¤ë¡£ +Ãí°Õ: +.BR clnt_sperror () +¤ä +.BR clnt_spcreaterror () +¤È¤Ï°ã¤Ã¤Æ +.BR clnt_sperrno () +¤ÏÀÅŪ¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£¤·¤«¤·¸Æ¤Ó½Ð¤·¤´¤È¤Ë¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.LP +.nf +.BI "char *clnt_sperror(CLIENT *" rpch ", char *" s ); +.fi +.IP +.\"O Like +.\"O .BR clnt_perror (), +.\"O except that (like +.\"O .BR clnt_sperrno ()) +.\"O it returns a string instead of printing to standard error. +.BR clnt_perror () +¤ÈƱÍͤǤ¢¤ë¤¬¡¢É¸½à¥¨¥é¡¼½ÐÎϤËɽ¼¨¤¹¤ëÂå¤ê¤Ë +.RB ( clnt_sperrno () +¤Î¤è¤¦¤Ë) ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹ÅÀ¤¬°Û¤Ã¤Æ¤¤¤ë¡£ +.IP +.\"O Bugs: returns pointer to static data that is overwritten on each call. +¥Ð¥°: ¸Æ¤Ó½Ð¤·¤´¤È¤Ë¾å½ñ¤­¤µ¤ì¤ëÀÅŪ¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +.LP +.nf +.BI "CLIENT *clntraw_create(unsigned long " prognum \ +", unsigned long " versnum ); +.fi +.IP +.\"O This routine creates a toy RPC client for the remote program +.\"O .IR prognum , +.\"O version +.\"O .IR versnum . +.\"O The transport used to pass messages to the service is +.\"O actually a buffer within the process's address space, so the +.\"O corresponding RPC server should live in the same address space; see +.\"O .BR svcraw_create (). +.\"O This allows simulation of RPC and acquisition of RPC +.\"O overheads, such as round trip times, without any kernel interference. +.\"O This routine returns NULL if it fails. +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à +.IR prognum ¡¢ +¥Ð¡¼¥¸¥ç¥ó +.I versnum +¤Î¤¿¤á¤Îµ¼»÷ RPC ¥¯¥é¥¤¥¢¥ó¥È¤òºîÀ®¤¹¤ë¡£¥á¥Ã¥»¡¼¥¸¤ò¥µ¡¼¥Ó¥¹¤ËÅϤ¹¤¿¤á¤Ë»ÈÍѤ¹¤ë +ÄÌ¿®¤Ï¼ÂºÝ¤Ë¤Ï¤½¤Î¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤¢¤ë¥Ð¥Ã¥Õ¥¡¡¼¤Ç¤¢¤ë¡£ +¤½¤ì¤Ç¡¢Âбþ¤¹¤ë RPC ¥µ¡¼¥Ð¤¬Æ±¤¸¥¢¥É¥ì¥¹¶õ´Ö¤ÎÃæ¤Ë¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BR svcraw_create () +¤ò»²¾È¤¹¤ë¤³¤È¡£ +¤³¤ì¤Ë¤è¤ê RPC ¤Î¥·¥ß¥å¥ì¡¼¥·¥ç¥ó¤ä¡¢¥«¡¼¥Í¥ë¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë±Æ¶Á¤µ¤ì¤º¤Ë +±þÅú»þ´Ö¤Ê¤É¤Î RPC ¥ª¡¼¥Ð¥Ø¥Ã¥É¤Î³ÍÆÀ¤¬¤Ç¤­¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï NULL ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "CLIENT *clnttcp_create(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " int *" sockp ", unsigned int " sendsz \ +", unsigned int " recvsz ); +.fi +.IP +.\"O This routine creates an RPC client for the remote program +.\"O .IR prognum , +.\"O version +.\"O .IR versnum ; +.\"O the client uses TCP/IP as a transport. +.\"O The remote program is located at Internet +.\"O address +.\"O .IR *addr . +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à +.IR prognum ¡¢ +¥Ð¡¼¥¸¥ç¥ó +.I versnum +¤Î¤¿¤á¤Î RPC ¥¯¥é¥¤¥¢¥ó¥È¤òºîÀ®¤¹¤ë¡£¥¯¥é¥¤¥¢¥ó¥È¤ÏÄÌ¿®¤Ë +TCP/IP ¤ò»ÈÍѤ¹¤ë¡£¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à¤Ï¥¤¥ó¥¿¡¼¥Í¥Ã¥È¡¦¥¢¥É¥ì¥¹¤Î +.I *addr +¤Ë¤¢¤ë¡£ +.\"O If +.\"The following inline font conversion is necessary for the hyphen indicator +.\"O \fIaddr\->sin_port\fR +.\"O is zero, then it is set to the actual port that the remote +.\"O program is listening on (the remote +.\"O .B portmap +.\"O service is consulted for this information). +.\"O The parameter +.\"O .I sockp +.\"O is a socket; if it is +.\"O .BR RPC_ANYSOCK , +.\"O then this routine opens a new one and sets +.\"O .IR sockp . +\fIaddr\->sin_port\fR ¤¬¥¼¥í¤Ê¤é¤Ð¡¢¼ÂºÝ¤Ë¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à¤¬ +listen ¤·¤Æ¤¤¤ë¥Ý¡¼¥È¤¬ÀßÄꤵ¤ì¤ë¡£(¤³¤Î¾ðÊó¤Î¤¿¤á¤Ë¥ê¥â¡¼¥È¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤¬ÍøÍѤµ¤ì¤ë¡£) ¥Ñ¥é¥á¡¼¥¿¡¼ +.I sockp +¤Ï¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£¤â¤·¤³¤ì¤¬ +.B RPC_ANYSOCK +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤³¤Î¥ë¡¼¥Æ¥£¥ó¤¬¿·¤·¤¤¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤·¤Æ +.I sockp +¤ËÀßÄꤹ¤ë¡£ +.\"O Since TCP-based RPC uses buffered I/O, +.\"O the user may specify the size of the send and receive buffers +.\"O with the parameters +.\"O .I sendsz +.\"O and +.\"O .IR recvsz ; +.\"O values of zero choose suitable defaults. +.\"O This routine returns NULL if it fails. +TCP ¤Ë´ð¤Å¤¤¤¿ RPC ¤Ï¥Ð¥Ã¥Õ¥¡¤µ¤ì¤¿ I/O +¤ò»ÈÍѤ¹¤ë¤¿¤á¡¢¥æ¡¼¥¶¤Ï¥Ñ¥é¥á¡¼¥¿¡¼ +.I sendsz +¤È +.I recvsz +¤ò»ÈÍѤ·¤ÆÁ÷¿®¥Ð¥Ã¥Õ¥¡¤È¼õ¿®¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥¼¥í¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤ÏŬÀڤʥǥե©¥ë¥È¤¬ÁªÂò¤µ¤ì¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¼ºÇÔ¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "CLIENT *clntudp_create(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " struct timeval " wait ", int *" sockp ); +.fi +.IP +.\"O This routine creates an RPC client for the remote program +.\"O .IR prognum , +.\"O version +.\"O .IR versnum ; +.\"O the client uses use UDP/IP as a transport. +.\"O The remote program is located at Internet address +.\"O .IR addr . +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à +.IR prognum ¡¢ +¥Ð¡¼¥¸¥ç¥ó +.I versnum +¤Î¤¿¤á¤Î RPC ¥¯¥é¥¤¥¢¥ó¥È¤òºîÀ®¤¹¤ë¡£¥¯¥é¥¤¥¢¥ó¥È¤ÏÄÌ¿®¤Ë +UDP/IP ¤ò»ÈÍѤ¹¤ë¡£¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à¤Ï¥¤¥ó¥¿¡¼¥Í¥Ã¥È¡¦¥¢¥É¥ì¥¹¤Î +.I *addr +¤Ë¤¢¤ë¡£ +.\"O If +.\"O \fIaddr\->sin_port\fR +.\"O is zero, then it is set to actual port that the remote +.\"O program is listening on (the remote +.\"O .B portmap +.\"O service is consulted for this information). +.\"O The parameter +.\"O .I sockp +.\"O is a socket; if it is +.\"O .BR RPC_ANYSOCK , +.\"O then this routine opens a new one and sets +.\"O .IR sockp . +\fIaddr\->sin_port\fR ¤¬¥¼¥í¤Ê¤é¤Ð¡¢¼ÂºÝ¤Ë¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à¤¬ +listen ¤·¤Æ¤¤¤ë¥Ý¡¼¥È¤¬ÀßÄꤵ¤ì¤ë¡£(¤³¤Î¾ðÊó¤Î¤¿¤á¤Ë¥ê¥â¡¼¥È¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤¬ÍøÍѤµ¤ì¤ë¡£) ¥Ñ¥é¥á¡¼¥¿¡¼ +.I sockp +¤Ï¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£¤â¤·¤³¤ì¤¬ +.B RPC_ANYSOCK +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤³¤Î¥ë¡¼¥Æ¥£¥ó¤¬¿·¤·¤¤¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤·¤Æ +.I sockp +¤ËÀßÄꤹ¤ë¡£ +.\"O The UDP transport resends the call message in intervals of +.\"O .B wait +.\"O time until a response is received or until the call times out. +.\"O The total time for the call to time out is specified by +.\"O .BR clnt_call (). +UDP ÄÌ¿®¤Ï²óÅú¤¬¤¢¤ë¤«¡¢»þ´ÖÀڤ줬µ¯¤³¤ë¤Þ¤Ç +.B wait +´Ö³Ö¤Ç¸Æ¤Ó½Ð¤·¥á¥Ã¥»¡¼¥¸¤òºÆÁ÷¤¹¤ë¡£»þ´ÖÀڤ줬µ¯¤³¤ë¤Þ¤Ç¤Î¹ç·×»þ´Ö¤Ï +.BR clnt_call () +¤Ç»ØÄꤹ¤ë¡£ +.IP +.\"O Warning: since UDP-based RPC messages can only hold up to 8 Kbytes +.\"O of encoded data, this transport cannot be used for procedures +.\"O that take large arguments or return huge results. +·Ù¹ð: UDP ¤Ë´ð¤Å¤¤¤¿ +RPC ¥á¥Ã¥»¡¼¥¸¤ÏºÇÂç¤Ç¤â 8 Kbyte ¤Þ¤Ç¤Î¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿¥Ç¡¼¥¿¤·¤« +ÊÝ»ý¤Ç¤­¤Ê¤¤¤¿¤á¡¢¤³¤ÎÄÌ¿®¤ÏÂ礭¤Ê°ú¤­¿ô¤äµðÂç¤Ê·ë²Ì¤ò¼è¤ë +¥×¥í¥·¥¸¥ã¤Ë¤Ï»ÈÍѤǤ­¤Ê¤¤¡£ +.LP +.nf +.BI "CLIENT *clntudp_bufcreate(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " struct timeval " wait ", int *" sockp , +.BI " unsigned int " sendsize ", unsigned int "recosize ); +.fi +.IP +.\"O This routine creates an RPC client for the remote program +.\"O .IR prognum , +.\"O on +.\"O .IR versnum ; +.\"O the client uses use UDP/IP as a transport. +.\"O The remote program is located at Internet address +.\"O .IR addr . +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à +.IR prognum ¡¢ +¥Ð¡¼¥¸¥ç¥ó +.I versnum +¤Î¤¿¤á¤Î RPC ¥¯¥é¥¤¥¢¥ó¥È¤òºîÀ®¤¹¤ë¡£¥¯¥é¥¤¥¢¥ó¥È¤ÏÄÌ¿®¤Ë +UDP/IP ¤ò»ÈÍѤ¹¤ë¡£¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à¤Ï¥¤¥ó¥¿¡¼¥Í¥Ã¥È¡¦¥¢¥É¥ì¥¹¤Î +.I *addr +¤Ë¤¢¤ë¡£ +.\"O If +.\"O \fIaddr\->sin_port\fR +.\"O is zero, then it is set to actual port that the remote +.\"O program is listening on (the remote +.\"O .B portmap +.\"O service is consulted for this information). +.\"O The parameter +.\"O .I sockp +.\"O is a socket; if it is +.\"O .BR RPC_ANYSOCK , +.\"O then this routine opens a new one and sets +.\"O .I sockp . +\fIaddr\->sin_port\fR ¤¬¥¼¥í¤Ê¤é¤Ð¡¢¼ÂºÝ¤Ë¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à¤¬ +listen ¤·¤Æ¤¤¤ë¥Ý¡¼¥È¤¬ÀßÄꤵ¤ì¤ë¡£(¤³¤Î¾ðÊó¤Î¤¿¤á¤Ë¥ê¥â¡¼¥È¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤¬ÍøÍѤµ¤ì¤ë¡£) ¥Ñ¥é¥á¡¼¥¿¡¼ +.I sockp +¤Ï¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£¤â¤·¤³¤ì¤¬ +.B RPC_ANYSOCK +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤³¤Î¥ë¡¼¥Æ¥£¥ó¤¬¿·¤·¤¤¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤·¤Æ +.I sockp +¤ËÀßÄꤹ¤ë¡£ +.\"O The UDP transport resends the call message in intervals of +.\"O .I wait +.\"O time until a response is received or until the call times out. +.\"O The total time for the call to time out is specified by +.\"O .BR clnt_call (). +UDP ÄÌ¿®¤Ï²óÅú¤¬¤¢¤ë¤«¡¢»þ´ÖÀڤ줬µ¯¤³¤ë¤Þ¤Ç +.B wait +´Ö³Ö¤Ç¸Æ¤Ó½Ð¤·¥á¥Ã¥»¡¼¥¸¤òºÆÁ÷¤¹¤ë¡£»þ´ÖÀڤ줬µ¯¤³¤ë¤Þ¤Ç¤Î¹ç·×»þ´Ö¤Ï +.BR clnt_call () +¤Ç»ØÄꤹ¤ë¡£ +.IP +.\"O This allows the user to specify the maximum packet +.\"O size for sending and receiving UDP-based RPC messages. +¤³¤ì¤ò»ÈÍѤ¹¤ë¤È UDP ¤Ë´ð¤Å¤¤¤¿ RPC ¥á¥Ã¥»¡¼¥¸¤Ë¤ª¤¤¤ÆÁ÷¿®¥Ñ¥±¥Ã¥È¤ä +¼õ¿®¥Ñ¥±¥Ã¥È¤ÎºÇÂ祵¥¤¥º¤ò»ØÄꤹ¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤ë¡£ +.LP +.nf +.BI "void get_myaddress(struct sockaddr_in *" addr ); +.fi +.IP +.\"O Stuff the machine's IP address into +.\"O .IR *addr , +.\"O without consulting the library routines that deal with +.\"O .IR /etc/hosts . +.\"O The port number is always set to +.\"O .BR htons(PMAPPORT) . +¤³¤Î¥Þ¥·¥ó¤Î IP ¥¢¥É¥ì¥¹¤ò +.I *addr +¤Ë³ÊǼ¤¹¤ë¡£ +.I /etc/hosts +¤ò°·¤¦¥é¥¤¥Ö¥é¥ê¡¦¥ë¡¼¥Æ¥£¥ó¤Ï»ÈÍѤ·¤Ê¤¤¡£¥Ý¡¼¥ÈÈÖ¹æ¤Ï¾ï¤Ë +.B htons(PMAPPORT) +¤ËÀßÄꤵ¤ì¤ë¡£ +.LP +.nf +.BI "struct pmaplist *pmap_getmaps(struct sockaddr_in *" addr ); +.fi +.IP +.\"O A user interface to the +.\"O .B portmap +.\"O service, which returns a list of the current RPC +.\"O program-to-port mappings on the host located at IP address +.\"O .IR *addr . +.\"O This routine can return NULL. +.\"O The command +.\"O .IR "rpcinfo\ \-p" +.\"O uses this routine. +.B portmap +¥µ¡¼¥Ó¥¹¤Î¤¿¤á¤Î¥æ¡¼¥¶¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ê¡¢ +IP ¥¢¥É¥ì¥¹ +.I *addr +¤Ë¤¢¤ë¥Û¥¹¥È¤Î¸½ºß¤Î RPC ¥×¥í¥°¥é¥à¤«¤é¥Ý¡¼¥ÈÈÖ¹æ¤Ø¤Î¥Þ¥Ã¥Ô¥ó¥°¤Î°ìÍ÷¤òÊÖ¤¹¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤¬ NULL ¤òÊÖ¤¹¾ì¹ç¤â¤¢¤ë¡£ +.RB ` "rpcinfo \-p" ' +¥³¥Þ¥ó¥É¤Ï¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ò»ÈÍѤ·¤Æ¤¤¤ë¡£ +.LP +.nf +.BI "unsigned short pmap_getport(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " unsigned int " protocol ); +.fi +.IP +.\"O A user interface to the +.\"O .B portmap +.\"O service, which returns the port number +.\"O on which waits a service that supports program number +.\"O .IR prognum , +.\"O version +.\"O .IR versnum , +.\"O and speaks the transport protocol associated with +.\"O .IR protocol . +.B portmap +¥µ¡¼¥Ó¥¹¤Î¤¿¤á¤Î¥æ¡¼¥¶¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¡¢ +¥×¥í¥°¥é¥àÈÖ¹æ +.IR prognum ¡¢ +¥Ð¡¼¥¸¥ç¥ó +.IR versnum ¡¢ +´ØÏ¢ÉÕ¤±¤é¤ì¤¿ÄÌ¿®¥×¥í¥È¥³¥ë +.I protocol +¤ò¥µ¥Ý¡¼¥È¤¹¤ë¥µ¡¼¥Ó¥¹¤¬ÂԤäƤ¤¤ë¥Ý¡¼¥ÈÈÖ¹æ¤òÊÖ¤¹¡£ +.\"O The value of +.\"O .I protocol +.\"O is most likely +.\"O .B IPPROTO_UDP +.\"O or +.\"O .BR IPPROTO_TCP . +.\"O A return value of zero means that the mapping does not exist +.\"O or that the RPC system failed to contact the remote +.\"O .B portmap +.\"O service. +.\"O In the latter case, the global variable +.\"O .I rpc_createerr +.\"O contains the RPC status. +.I protocol +¤ÎÃͤϤۤȤó¤É¤Î¾ì¹ç IPPROTO_UDP ¤« IPPROTO_TCP ¤Ç¤¢¤ë¡£ +ÊÖ¤êÃÍ¥¼¥í¤Ï¥Þ¥Ã¥Ô¥ó¥°¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢ +RPC ¥·¥¹¥Æ¥à¤¬¥ê¥â¡¼¥È¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤Î»²¾È¤Ë¼ºÇÔ¤·¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë¡£¸å¼Ô¤Î¾ì¹ç¤ÏÂç°èÊÑ¿ô +.I rpc_createerr +¤¬ RPC ¾õÂÖ¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£ +.LP +.nf +.BI "enum clnt_stat pmap_rmtcall(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " unsigned long " procnum , +.BI " xdrproc_t " inproc ", char *" in , +.BI " xdrproc_t " outproc ", char *" out , +.BI " struct timeval " tout ", unsigned long *" portp ); +.fi +.IP +.\"O A user interface to the +.\"O .B portmap +.\"O service, which instructs +.\"O .B portmap +.\"O on the host at IP address +.\"O .I *addr +.\"O to make an RPC call on your behalf to a procedure on that host. +.B portmap +¥µ¡¼¥Ó¥¹¤Î¤¿¤á¤Î¥æ¡¼¥¶¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¡¢ +IP ¥¢¥É¥ì¥¹ +.I *addr +¤Î¥Û¥¹¥È¤Î +.B portmap +¤ò»²¾È¤·¤Æ¡¢ +RPC ¸Æ¤Ó½Ð¤·¤òÀ¸À®¤·¡¢¤½¤Î¥Û¥¹¥È¾å¤Î¥×¥í¥·¥¸¥ã¤ò¸Æ¤Ó½Ð¤¹¡£ +.\"O The parameter +.\"O .I *portp +.\"O will be modified to the program's port number if the procedure succeeds. +.\"O The definitions of other parameters are discussed +.\"O in +.\"O .BR callrpc () +.\"O and +.\"O .BR clnt_call (). +.\"O This procedure should be used for a \(lqping\(rq and nothing else. +.\"O See also +.\"O .BR clnt_broadcast (). +¥Ñ¥é¥á¡¼¥¿¡¼ +.I *portp +¤Ï¥×¥í¥·¥¸¥ã¤¬À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¥×¥í¥°¥é¥à¤Î¥Ý¡¼¥ÈÈÖ¹æ¤Ë½¤Àµ¤µ¤ì¤ë¡£ +¾¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ÎÄêµÁ¤Ë¤Ä¤¤¤Æ¤Ï +.BR callrpc () +¤ä +.BR clnt_call () +¤ÇÀâÌÀ¤·¤Æ¤¢¤ë¡£ +¤³¤Î¥×¥í¥·¥¸¥ã¤Ï \(lqping\(rq ¤Î¤ß¤Ë»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.BR clnt_broadcast () +¤â»²¾È¤¹¤ë¤³¤È¡£ +.LP +.nf +.BI "bool_t pmap_set(unsigned long " prognum ", unsigned long " versnum , +.BI " unsigned int " protocol ", unsigned short " port ); +.fi +.IP +.\"O A user interface to the +.\"O .B portmap +.\"O service, which establishes a mapping between the triple +.\"O .RI [ prognum , versnum , protocol\fR] +.\"O and +.\"O .I port +.\"O on the machine's +.\"O .B portmap +.\"O service. +.\"O The value of +.\"O .I protocol +.\"O is most likely +.\"O .B IPPROTO_UDP +.\"O or +.\"O .BR IPPROTO_TCP . +.\"O This routine returns one if it succeeds, zero otherwise. +.\"O Automatically done by +.\"O .BR svc_register (). +.B portmap +¥µ¡¼¥Ó¥¹¤Î¤¿¤á¤Î¥æ¡¼¥¶¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¡¢ +.RI [ prognum , versnum , protocol\fR] +¤ÎÁȤ߹ç¤ï¤»¤È +.I port +¤È¤Î´Ö¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¡¢¤½¤Î¥Þ¥·¥ó¾å¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤ËÅÐÏ¿¤¹¤ë¡£ +.I protocol +¤Ï¤Û¤È¤ó¤É¤Î¾ì¹ç +.B IPPROTO_UDP +¤« +.B IPPROTO_TCP +¤Î¤É¤Á¤é¤«¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.BR svc_register () +¤Ë¤è¤Ã¤Æ¼«Æ°Åª¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ +.LP +.nf +.BI "bool_t pmap_unset(unsigned long " prognum ", unsigned long " versnum ); +.fi +.IP +.\"O A user interface to the +.\"O .B portmap +.\"O service, which destroys all mapping between the triple +.\"O .RI [ prognum , versnum , *\fR] +.\"O and +.\"O .B ports +.\"O on the machine's +.\"O .B portmap +.\"O service. +.\"O This routine returns one if it succeeds, zero otherwise. +.B portmap +¥µ¡¼¥Ó¥¹¤Î¤¿¤á¤Î¥æ¡¼¥¶¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¡¢ +.RI [ prognum , versnum , *\fR] +¤ÎÁȤ߹ç¤ï¤»¤È +.B ports +¤Î´Ö¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¤½¤Î¥Þ¥·¥ó¾å¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤«¤éºï½ü¤¹¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "int registerrpc(unsigned long " prognum ", unsigned long " versnum , +.BI " unsigned long " procnum ", char *(*" procname ")(char *)," +.BI " xdrproc_t " inproc ", xdrproc_t " outproc ); +.fi +.IP +.\"O Register procedure +.\"O .I procname +.\"O with the RPC service package. +.\"O If a request arrives for program +.\"O .IR prognum , +.\"O version +.\"O .IR versnum , +.\"O and procedure +.\"O .IR procnum , +.\"O .I procname +.\"O is called with a pointer to its parameter(s); +.\"O .I progname +.\"O should return a pointer to its static result(s); +.\"O .I inproc +.\"O is used to decode the parameters while +.\"O .I outproc +.\"O is used to encode the results. +.\"O This routine returns zero if the registration succeeded, \-1 otherwise. +RPC ¥µ¡¼¥Ó¥¹¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ·¤Æ +.I procname +¥×¥í¥·¥¸¥ã¤òÅÐÏ¿¤¹¤ë¡£¥×¥í¥°¥é¥à +.IR prognum ¡¢ +¥Ð¡¼¥¸¥ç¥ó +.IR versnum ¡¢ +¥×¥í¥·¥¸¥ã +.I procnum +¤Ø¤ÎÍ׵᤬ÆϤ¤¤¿¾ì¹ç¡¢ +.I procname +¤¬¥Ñ¥é¥á¡¼¥¿¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤ò»ý¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.I progname +¤ÏÀÅŪ¤Ê·ë²Ì¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹É¬Íפ¬¤¢¤ë¡£ +.I inproc +¤Ï¥Ñ¥é¥á¡¼¥¿¡¼¤ò¥Ç¥³¡¼¥É¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +.I outproc +¤Ï·ë²Ì¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÅÐÏ¿¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤¹¡£ +.IP +.\"O Warning: remote procedures registered in this form +.\"O are accessed using the UDP/IP transport; see +.\"O .BR svcudp_create () +.\"O for restrictions. +·Ù¹ð: ¤³¤Î·Á¼°¤ÇÅÐÏ¿¤µ¤ì¤¿¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¤Ï +UDP/IP ÄÌ¿®¤ò»ÈÍѤ¹¤ë¡£À©¸Â¤Ë´Ø¤·¤Æ¤Ï +.BR svcudp_create () +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.LP +.nf +.BI "struct rpc_createerr " rpc_createerr ; +.fi +.IP +.\"O A global variable whose value is set by any RPC client creation routine +.\"O that does not succeed. +.\"O Use the routine +.\"O .BR clnt_pcreateerror () +.\"O to print the reason why. +À®¸ù¤·¤Ê¤«¤Ã¤¿ RPC ¥¯¥é¥¤¥¢¥ó¥ÈÀ¸À®¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ëÂç°èÊÑ¿ô¡£ +.BR clnt_pcreateerror () +¥ë¡¼¥Æ¥£¥ó¤¬Íýͳ¤òɽ¼¨¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ +.LP +.nf +.BI "void svc_destroy(SVCXPRT *" xprt ); +.fi +.IP +.\"O A macro that destroys the RPC service transport handle, +.\"O .IR xprt . +.\"O Destruction usually involves deallocation +.\"O of private data structures, including +.\"O .I xprt +.\"O itself. +.\"O Use of +.\"O .I xprt +.\"O is undefined after calling this routine. +¤³¤Î¥Þ¥¯¥í¤ÏÄÌ¿®¥Ï¥ó¥É¥ë +.I xprt +¤Î RPC ¥µ¡¼¥Ó¥¹¤òÇ˲õ¤¹¤ë¡£Ç˲õ¤Ë¤ÏÄ̾ +.I xprt +¤ò´Þ¤á¤Æ¡¢»äŪ¤Ê¥Ç¡¼¥¿¹½Â¤ÂΤÎÇË´þ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤·¤¿¸å¤Ë +.I xprt +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "fd_set " svc_fdset ; +.fi +.IP +.\"O A global variable reflecting the RPC service side's +.\"O read file descriptor bit mask; it is suitable as a parameter to the +.\"O .BR select (2) +.\"O system call. +.\"O This is only of interest if a service implementor does not call +.\"O .BR svc_run (), +.\"O but rather does his own asynchronous event processing. +.\"O This variable is read-only (do not pass its address to +.\"O .BR select (2)!), +.\"O yet it may change after calls to +.\"O .BR svc_getreqset () +.\"O or any creation routines. +RPC ¥µ¡¼¥Ó¥¹Â¦¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤òÈ¿±Ç¤·¤¿Âç°èÊÑ¿ô¡£ +.BR select (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤Î¤¿¤á¤ËÍøÍѤǤ­¤ë¡£¤³¤ì¤Ï +¥µ¡¼¥Ó¥¹¤Î¼ÂÁõ¼Ô¤¬ +.BR svc_run () +¤ò¸Æ¤Ó½Ð¤µ¤Ê¤º¤Ë¡¢Æȼ«¤ÎÈóƱ´ü¥¤¥Ù¥ó¥È½èÍý¤òÍѤ¤¤ë¾ì¹ç¤Ë¤Î¤ß°ÕÌ£¤¬¤¢¤ë¡£ +¤³¤ÎÊÑ¿ô¤ÏÆɤ߹þ¤ßÀìÍÑ¤Ç (¤½¤Î¤Þ¤Þ +.BR select (2) +¤ØÅϤ·¤Æ¤Ï¤Ê¤é¤Ê¤¤!)¡¢ +.BR svc_getreqset () +¸Æ¤Ó½Ð¤·¤äÀ¸À®¥ë¡¼¥Æ¥£¥ó¤Î¸å¤ËÊѹ¹¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +.nf +.BI "int " svc_fds ; +.fi +.IP +.\"O Similar to +.\"O .BR svc_fdset , +.\"O but limited to 32 descriptors. +.\"O This interface is obsoleted by +.\"O .BR svc_fdset . +.B svc_fdset +¤Ë»÷¤Æ¤¤¤ë¤¬¡¢32 ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï +.B svc_fdset +¤Ë¤è¤Ã¤ÆÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +.LP +.nf +.BI "svc_freeargs(SVCXPRT *" xprt ", xdrproc_t " inproc ", char *" in ); +.fi +.IP +.\"O A macro that frees any data allocated by the RPC/XDR +.\"O system when it decoded the arguments to a service procedure using +.\"O .BR svc_getargs (). +.\"O This routine returns 1 if the results were successfully +.\"O freed, +.\"O and zero otherwise. +¤³¤Î¥Þ¥¯¥í¤Ï¥µ¡¼¥Ó¥¹¡¦¥×¥í¥·¥¸¥ã¤¬ +.BR svc_getargs () +¤ò»ÈÍѤ·¤Æ°ú¤­¿ô¤ò¥Ç¥³¡¼¥É¤·¤¿»þ¤Ë +RPC/XDR ¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ³ä¤êÅö¤Æ¤é¤ì¤¿¥Ç¡¼¥¿¤ò²òÊü¤¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï²òÊü¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "svc_getargs(SVCXPRT *" xprt ", xdrproc_t " inproc ", char *" in ); +.fi +.IP +.\"O A macro that decodes the arguments of an RPC request +.\"O associated with the RPC service transport handle, +.\"O .IR xprt . +.\"O The parameter +.\"O .I in +.\"O is the address where the arguments will be placed; +.\"O .I inproc +.\"O is the XDR routine used to decode the arguments. +.\"O This routine returns one if decoding succeeds, and zero otherwise. +¤³¤Î¥Þ¥¯¥í¤Ï RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¥Ï¥ó¥É¥ë +.I xprt +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿ RPC Í×µá¤Î°ú¤­¿ô¤ò¥Ç¥³¡¼¥É¤¹¤ë¡£¥Ñ¥é¥á¡¼¥¿¡¼ +.I in +¤Ï°ú¤­¿ô¤Î³ÊǼ¤µ¤ì¤¿¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I inproc +¤Ï°ú¤­¿ô¤ò¥Ç¥³¡¼¥É¤¹¤ë¤¿¤á¤Î XDR ¥ë¡¼¥Æ¥£¥ó¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥Ç¥³¡¼¥É¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "struct sockaddr_in *svc_getcaller(SVCXPRT *" xprt ); +.fi +.IP +.\"O The approved way of getting the network address of the caller +.\"O of a procedure associated with the RPC service transport handle, +.\"O .IR xprt . +RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¥Ï¥ó¥É¥ë +.I xprt +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥×¥í¥·¥¸¥ã¤Î¸Æ¤Ó½Ð¤·¸µ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥¢¥É¥ì¥¹¤ò +¼èÆÀ¤¹¤ë¤¿¤á¤Îɸ½àŪ¤Ê¼êÃÊ¡£ +.LP +.nf +.BI "void svc_getreqset(fd_set *" rdfds ); +.fi +.IP +.\"O This routine is only of interest if a service implementor does not call +.\"O .BR svc_run (), +.\"O but instead implements custom asynchronous event processing. +.\"O It is called when the +.\"O .BR select (2) +.\"O system call has determined that an RPC request has arrived on some +.\"O RPC socket(s); +.\"O .I rdfds +.\"O is the resultant read file descriptor bit mask. +.\"O The routine returns when all sockets associated with the value of +.\"O .I rdfds +.\"O have been serviced. +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥µ¡¼¥Ó¥¹¤Î¼ÂÁõ¼Ô¤¬ +.BR svc_run () +¤ò¸Æ¤Ó½Ð¤µ¤º¡¢Æȼ«¤ÎÈóƱ´ü¥¤¥Ù¥ó¥È½èÍý¤ò¼ÂÁõ¤¹¤ë¾ì¹ç¤Ë¤Î¤ß°ÕÌ£¤¬¤¢¤ë¡£ +¤³¤ì¤Ï +.BR select (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ RPC ¥½¥±¥Ã¥È¤Ë +RPC Í׵᤬ÅþÃ夷¤¿¤ÈÊÖ¤·¤¿¾ì¹ç¤Ë¤Î¤ß¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.I rdfds +¤Ï·ë²Ì¤ÎÆɤ߹þ¤ß¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.I rdfds +¤ÎÃͤ˴ØÏ¢ÉÕ¤±¤é¤ì¤¿Á´¤Æ¤Î¥½¥±¥Ã¥È¤Î¥µ¡¼¥Ó¥¹¤¬¹Ô¤Ê¤ï¤ì¤¿»þ¤Ë +Ê֤äƤ¯¤ë¡£ +.LP +.nf +.BI "void svc_getreq(int " rdfds ); +.fi +.IP +.\"O Similar to +.\"O .BR svc_getreqset (), +.\"O but limited to 32 descriptors. +.\"O This interface is obsoleted by +.\"O .BR svc_getreqset (). +.BR svc_getreqset () +¤Ë»÷¤Æ¤¤¤ë¤¬¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Î¿ô¤¬ 32 ¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï +.BR svc_getreqset () +¤Ë¤è¤Ã¤ÆÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +.LP +.nf +.BI "bool_t svc_register(SVCXPRT *" xprt ", unsigned long " prognum , +.BI " unsigned long " versnum , +.BI " void (*" dispatch ")(svc_req *, SVCXPRT *)," +.BI " unsigned long " protocol ); +.fi +.IP +.\"O Associates +.\"O .I prognum +.\"O and +.\"O .I versnum +.\"O with the service dispatch procedure, +.\"O .IR dispatch . +.I prognum +¤È +.I versnum +¤ò¥µ¡¼¥Ó¥¹ÇÛʬ¥×¥í¥·¥¸¥ã +.I dispatch +¤Ç´ØÏ¢ÉÕ¤±¤ë¡£ +.\"O If +.\"O .I protocol +.\"O is zero, the service is not registered with the +.\"O .B portmap +.\"O service. +.\"O If +.\"O .I protocol +.\"O is nonzero, then a mapping of the triple +.\"O .RI [ prognum , versnum , protocol\fR] +.\"O to +.\"O \fIxprt\->xp_port\fR +.\"O is established with the local +.\"O .B portmap +.\"O service (generally +.\"O .I protocol +.\"O is zero, +.\"O .B IPPROTO_UDP +.\"O or +.\"O .BR IPPROTO_TCP ). +.I protocol +¤¬¥¼¥í¤Î¾ì¹ç¡¢¥µ¡¼¥Ó¥¹¤Ï +.B portmap +¥µ¡¼¥Ó¥¹¤Ë¤ÏÅÐÏ¿¤µ¤ì¤Ê¤¤¡£ +.I protocol +¤¬¥¼¥í°Ê³°¤Î¾ì¹ç¡¢ +.RI [ prognum , versnum , protocol\fR] +¤ÎÁȤ߹ç¤ï¤»¤È \fIxprt\->xp_port\fR ¤È¤Î¥Þ¥Ã¥Ô¥ó¥°¤¬¥í¡¼¥«¥ë¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤ËÅÐÏ¿¤µ¤ì¤ë¡£(°ìÈÌŪ¤Ë +.I protocol +¤Ï¥¼¥í¡¢ +.BR IPPROTO_UDP ¡¢ +.B IPPROTO_TCP +¤Î¤É¤ì¤«¤Ç¤¢¤ë¡£) +.\"O The procedure +.\"O .I dispatch +.\"O has the following form: +¥×¥í¥·¥¸¥ã +.I dispatch +¤Ï°Ê²¼¤Î·Á¼°¤Ç¤¢¤ë: +.in +4n +.nf + +dispatch(struct svc_req *request, SVCXPRT *xprt); +.fi +.in +.IP +.\"O The +.\"O .BR svc_register () +.\"O routine returns one if it succeeds, and zero otherwise. +.BR svc_register () +¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.B "void svc_run(void);" +.fi +.IP +.\"O This routine never returns. +.\"O It waits for RPC requests to arrive, and calls the appropriate service +.\"O procedure using +.\"O .BR svc_getreq () +.\"O when one arrives. +.\"O This procedure is usually waiting for a +.\"O .BR select (2) +.\"O system call to return. +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÌá¤Ã¤Æ¤³¤Ê¤¤¡£¤³¤ì¤Ï +.SM RPC +Í×µá¤ÎÅþÃå¤òÂÔ¤Á¡¢¤É¤ì¤«¤¬ÆϤ¤¤¿¾ì¹ç¤Ë +.BR svc_getreq () +¤ò»ÈÍѤ·¤ÆŬÀڤʥµ¡¼¥Ó¥¹¡¦¥×¥í¥·¥¸¥ã¤ò¸Æ¤Ó½Ð¤¹¡£ +¤³¤Î¥×¥í¥·¥¸¥ã¤ÏÄ̾ï¤Ï +.BR select (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤«¤éÊÖ¤ë¤Î¤òÂԤäƤ¤¤ë¡£ +.LP +.nf +.BI "bool_t svc_sendreply(SVCXPRT *" xprt ", xdrproc_t " outproc \ +", char *" out ); +.fi +.IP +.\"O Called by an RPC service's dispatch routine to send the results of a +.\"O remote procedure call. +.\"O The parameter +.\"O .I xprt +.\"O is the request's associated transport handle; +.\"O .I outproc +.\"O is the XDR routine which is used to encode the results; and +.\"O .I out +.\"O is the address of the results. +.\"O This routine returns one if it succeeds, zero otherwise. +RPC ¥µ¡¼¥Ó¥¹ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤Æ¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¡¦¥³¡¼¥ë¤Î·ë²Ì¤ò +ÊÖ¤¹¤¿¤á¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +¥Ñ¥é¥á¡¼¥¿¡¼ +.I xprt +¤Ï¤½¤ÎÍ×µá¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿ÄÌ¿®¥Ï¥ó¥É¥ë¤Ç¤¢¤ë¡£ +.I outproc +¤Ï·ë²Ì¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë XDR ¥ë¡¼¥Æ¥£¥ó¤Ç¤¢¤ë¡£ +.I out +¤Ï·ë²Ì¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "void svc_unregister(unsigned long " prognum ", unsigned long " versnum ); +.fi +.IP +.\"O Remove all mapping of the double +.\"O .RI [ prognum , versnum ] +.\"O to dispatch routines, and of the triple +.\"O .RI [ prognum , versnum , *\fR] +.\"O to port number. +ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤«¤é +.RI [ prognum , versnum ] +¤ª¤è¤Ó +.RI [ prognum , versnum , *\fR] +¤ÎÁȤ߹ç¤ï¤»¤«¤é¥Ý¡¼¥ÈÈÖ¹æ¤Ø¤Î¥Þ¥Ã¥Ô¥ó¥°¤òÁ´¤Æºï½ü¤¹¤ë¡£ +.LP +.nf +.BI "void svcerr_auth(SVCXPRT *" xprt ", enum auth_stat " why ); +.fi +.IP +.\"O Called by a service dispatch routine that refuses to perform +.\"O a remote procedure call due to an authentication error. +ǧ¾Ú¥¨¥é¡¼¤Ë¤è¤ê¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¡¦¥³¡¼¥ë¤Î¼Â¹Ô¤òµñÈݤµ¤ì¤¿ +¾ì¹ç¤Ë¥µ¡¼¥Ó¥¹ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.LP +.nf +.BI "void svcerr_decode(SVCXPRT *" xprt ); +.fi +.IP +.\"O Called by a service dispatch routine that cannot successfully +.\"O decode its parameters. +.\"O See also +.\"O .BR svc_getargs (). +¥Ñ¥é¥á¡¼¥¿¤Î¥Ç¥³¡¼¥É¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë +¥µ¡¼¥Ó¥¹ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.BR svc_getargs () +¤â»²¾È¤¹¤ë¤³¤È¡£ +.LP +.nf +.BI "void svcerr_noproc(SVCXPRT *" xprt ); +.fi +.IP +.\"O Called by a service dispatch routine that does not implement +.\"O the procedure number that the caller requests. +Í×µá¤Î¤¢¤Ã¤¿¥×¥í¥·¥¸¥ãÈֹ椬¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë +¥µ¡¼¥Ó¥¹ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤è¤ê¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.LP +.nf +.BI "void svcerr_noprog(SVCXPRT *" xprt ); +.fi +.IP +.\"O Called when the desired program is not registered with the RPC package. +.\"O Service implementors usually do not need this routine. +RPC ¥Ñ¥Ã¥±¡¼¥¸¤ËÍ׵ᤵ¤ì¤¿¥×¥í¥°¥é¥à¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +¥µ¡¼¥Ó¥¹¤Î¼ÂÁõ¤Ë¤ÏÄ̾¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏɬÍפʤ¤¡£ +.LP +.nf +.BI "void svcerr_progvers(SVCXPRT *" xprt ); +.fi +.IP +.\"O Called when the desired version of a program is not registered +.\"O with the RPC package. +.\"O Service implementors usually do not need this routine. +RPC ¥Ñ¥Ã¥±¡¼¥¸¤ËÍ׵ᤵ¤ì¤¿¥Ð¡¼¥¸¥ç¥ó¤Î¥×¥í¥°¥é¥à¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë +¸Æ¤Ó½Ð¤µ¤ì¤ë¡£¥µ¡¼¥Ó¥¹¤Î¼ÂÁõ¤Ë¤ÏÄ̾¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏɬÍפʤ¤¡£ +.LP +.nf +.BI "void svcerr_systemerr(SVCXPRT *" xprt ); +.fi +.IP +.\"O Called by a service dispatch routine when it detects a system +.\"O error not covered by any particular protocol. +.\"O For example, if a service can no longer allocate storage, +.\"O it may call this routine. +ÆÃÄê¤Î¥×¥í¥È¥³¥ë¤Ë¤è¤Ã¤Æ¥«¥Ð¡¼¤µ¤ì¤Æ¤¤¤Ê¥·¥¹¥Æ¥à¡¦¥¨¥é¡¼¤¬ +¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ë¥µ¡¼¥Ó¥¹ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +Î㤨¤Ð¡¢¥µ¡¼¥Ó¥¹¤¬¤½¤ì°Ê¾å¡¢µ­²±ÁõÃÖ¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¾ì¹ç¤Ë¤Ï +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +.nf +.BI "void svcerr_weakauth(SVCXPRT *" xprt ); +.fi +.IP +.\"O Called by a service dispatch routine that refuses to perform +.\"O a remote procedure call due to insufficient authentication parameters. +.\"O The routine calls +.\"O .BR "svcerr_auth(xprt, AUTH_TOOWEAK)" . +ǧ¾Ú¥Ñ¥é¥á¡¼¥¿¤¬Â­¤ê¤Ê¤¤¤¿¤á¤Ë¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¡¦¥³¡¼¥ë¤Î¼Â¹Ô¤ò +µñÈݤµ¤ì¤¿¾ì¹ç¤Ë¥µ¡¼¥Ó¥¹ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.B "svcerr_auth(xprt, AUTH_TOOWEAK)" +¤ò¸Æ¤Ó½Ð¤¹¡£ +.LP +.nf +.BI "SVCXPRT *svcfd_create(int " fd ", unsigned int " sendsize , +.BI " unsigned int " recvsize ); +.fi +.IP +.\"O Create a service on top of any open descriptor. +.\"O Typically, this descriptor is a connected socket for a stream protocol such +.\"O as TCP. +.\"O .I sendsize +.\"O and +.\"O .I recvsize +.\"O indicate sizes for the send and receive buffers. +.\"O If they are zero, a reasonable default is chosen. +Ǥ°Õ¤Î¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¾å¤Ë¥µ¡¼¥Ó¥¹¤òºîÀ®¤¹¤ë¡£ +ŵ·¿Åª¤Ë¡¢¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ï +TCP ¤Î¤è¤¦¤Ê¥¹¥È¥ê¡¼¥à¡¦¥×¥í¥È¥³¥ë¤ÇÀܳ¤µ¤ì¤¿¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£ +.I sendsize +¤È +.I recvsize +¤Ë¤ÏÁ÷¿®¥Ð¥Ã¥Õ¥¡¤È¼õ¿®¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤ò»ØÄꤹ¤ë¡£¤â¤·¥¼¥í¤¬»ØÄꤵ¤ì¤¿ +¾ì¹ç¤ÏŬÀڤʥǥե©¥ë¥È¤¬ÁªÂò¤µ¤ì¤ë¡£ +.LP +.nf +.BI "SVCXPRT *svcraw_create(void);" +.fi +.IP +.\"O This routine creates a toy RPC +.\"O service transport, to which it returns a pointer. +.\"O The transport is really a buffer within the process's address space, +.\"O so the corresponding RPC client should live in the same address space; see +.\"O .BR clntraw_create (). +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ïµ¼»÷ RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¤òÀ¸À®¤·¤Æ¡¢¤½¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +ÄÌ¿®¤Ï¼ÂºÝ¤Ë¤Ï¤½¤Î¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤¢¤ë¥Ð¥Ã¥Õ¥¡¤Ê¤Î¤Ç +Âбþ¤¹¤ë RPC ¥¯¥é¥¤¥¢¥ó¥È¤ÏƱ¤¸¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤¤¤ëɬÍפ¬¤¢¤ë¡£ +.BR clntraw_create () +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O This routine allows simulation of RPC and acquisition of RPC +.\"O overheads (such as round trip times), without any kernel interference. +.\"O This routine returns NULL if it fails. +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ç +RPC ¤Î¥·¥ß¥å¥ì¡¼¥·¥ç¥ó¤ä¡¢¥«¡¼¥Í¥ë¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë±Æ¶Á¤µ¤ì¤º¤Ë±þÅú»þ´Ö¤Ê¤É¤Î +RPC ¥ª¡¼¥Ð¥Ø¥Ã¥É¤ò¼èÆÀ¤¬¤Ç¤­¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¼ºÇÔ¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "SVCXPRT *svctcp_create(int " sock ", unsigned int " send_buf_size , +.BI " unsigned int " recv_buf_size ); +.fi +.IP +.\"O This routine creates a TCP/IP-based RPC +.\"O service transport, to which it returns a pointer. +.\"O The transport is associated with the socket +.\"O .IR sock , +.\"O which may be +.\"O .BR RPC_ANYSOCK , +.\"O in which case a new socket is created. +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï TCP/IP ¤Ë´ð¤Å¤¯ +RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¤òºîÀ®¤·¡¢¤½¤ì¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +ÄÌ¿®¤Ï¥½¥±¥Ã¥È +.I sock +¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤ë¡£ +.I sock +¤Ï +.B RPC_ANYSOCK +¤Ç¤âÎɤ¤¡£¤³¤Î¾ì¹ç¤Ï¿·¤·¤¤¥½¥±¥Ã¥È¤¬ºîÀ®¤µ¤ì¤ë¡£ +.\"O If the socket is not bound to a local TCP +.\"O port, then this routine binds it to an arbitrary port. +.\"O Upon completion, +.\"O \fIxprt\->xp_sock\fR +.\"O is the transport's socket descriptor, and +.\"O \fIxprt\->xp_port\fR +.\"O is the transport's port number. +¤â¤·¥½¥±¥Ã¥È¤¬¥í¡¼¥«¥ë¤Ê TCP ¥Ý¡¼¥È¤Ë bind ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤¬Å¬Åö¤Ê¥Ý¡¼¥È¤Ë bind ¤¹¤ë¡£ +Êä´°¤µ¤ì¤¿¾ì¹ç¡¢\fIxprt\->xp_sock\fR ¤Ë¤ÏÄÌ¿®¤Î¥½¥±¥Ã¥È¡¦ +¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤¬¡¢\fIxprt\->xp_port\fR ¤Ë¤ÏÄÌ¿®¤Î¥Ý¡¼¥ÈÈֹ椬 +ÀßÄꤵ¤ì¤ë¡£ +.\"O This routine returns NULL if it fails. +.\"O Since TCP-based RPC uses buffered I/O, +.\"O users may specify the size of buffers; values of zero +.\"O choose suitable defaults. +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¼ºÇÔ¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +TCP ¤Ë´ð¤Å¤¤¤¿ RPC ¤Ï¥Ð¥Ã¥Õ¥¡¤µ¤ì¤¿ I/O ¤ò»ÈÍѤ¹¤ë¤¿¤á¡¢ +¥æ¡¼¥¶¤Ï¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤ò»ØÄê¤Ç¤­¤ë¡£ +¥¼¥í¤ò»ØÄꤷ¤¿¾ì¹ç¤ÏŬÀڤʥǥե©¥ë¥È¤¬ÁªÂò¤µ¤ì¤ë¡£ +.LP +.nf +.BI "SVCXPRT *svcudp_bufcreate(int " sock ", unsigned int " sendsize , +.BI " unsigned int " recosize ); +.fi +.IP +.\"O This routine creates a UDP/IP-based RPC +.\"O service transport, to which it returns a pointer. +.\"O The transport is associated with the socket +.\"O .IR sock , +.\"O which may be +.\"O .BR RPC_ANYSOCK , +.\"O in which case a new socket is created. +.\"O If the socket is not bound to a local UDP +.\"O port, then this routine binds it to an arbitrary port. +.\"O Upon completion, +.\"O \fIxprt\->xp_sock\fR +.\"O is the transport's socket descriptor, and +.\"O \fIxprt\->xp_port\fR +.\"O is the transport's port number. +.\"O This routine returns NULL if it fails. +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï UDP/IP ¤Ë´ð¤Å¤¤¤¿ RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¤òºîÀ®¤·¡¢ +¤½¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ÄÌ¿®¤Ï¥½¥±¥Ã¥È +.I sock +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤ë¡£ +.I sock +¤Ï +.B RPC_ANYSOCK +¤Ç¤âÎɤ¤¡£¤³¤Î¾ì¹ç¤Ï¿·¤·¤¤¥½¥±¥Ã¥È¤¬ºîÀ®¤µ¤ì¤ë¡£ +¥½¥±¥Ã¥È¤¬¥í¡¼¥«¥ë¤Î UDP ¥Ý¡¼¥È¤Ë bind ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏŬÅö¤Ê¥Ý¡¼¥È¤Ë bind ¤¹¤ë¡£ +Êä´°¤µ¤ì¤¿¾ì¹ç¡¢\fIxprt\->xp_sock\fR ¤ËÄÌ¿®¤Î¥½¥±¥Ã¥È¤Î +¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤¬¡¢\fIxprt\->xp_port\fR ¤ËÄÌ¿®¤Î¥Ý¡¼¥ÈÈֹ椬 +ÀßÄꤵ¤ì¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï NULL ¤òÊÖ¤¹¡£ +.IP +.\"O This allows the user to specify the maximum packet size for sending and +.\"O receiving UDP-based RPC messages. +¤³¤ì¤Ë¤è¤ê¥æ¡¼¥¶¤Ï UDP ¤Ë´ð¤Å¤¤¤¿ RPC ¥á¥Ã¥»¡¼¥¸¤Ç +»ÈÍѤǤ­¤ëÁ÷¿®¥Ñ¥±¥Ã¥È¤ª¤è¤Ó¼õ¿®¥Ñ¥±¥Ã¥È¤ÎºÇÂ祵¥¤¥º¤ò»ØÄê¤Ç¤­¤ë¡£ +.LP +.nf +.BI "SVCXPRT *svcudp_create(int " sock ); +.fi +.IP +.\"O This call is equivalent to +.\"O \fIsvcudp_bufcreate(sock,SZ,SZ)\fP +.\"O for some default size \fISZ\fP. +Á÷¿®¥Ñ¥±¥Ã¥È¤È¼õ¿®¥Ñ¥±¥Ã¥È¤Î¥µ¥¤¥º¤òƱ¤¸¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ \fISZ\fP ¤Ë»ØÄꤷ¤¿ +\fIsvcudp_bufcreate(sock,SZ,SZ)\fP ¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_accepted_reply(XDR *" xdrs ", struct accepted_reply *" ar ); +.fi +.IP +.\"O Used for encoding RPC reply messages. +.\"O This routine is useful for users who wish to generate +.\"O RPC-style messages without using the RPC package. +RPC ±þÅú¥á¥Ã¥»¡¼¥¸¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë¤Î¤Ë»ÈÍѤ¹¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +RPC ¥Ñ¥Ã¥±¡¼¥¸¤òÍѤ¤¤º¤Ë +RPC-·Á¼°¤Î¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_authunix_parms(XDR *" xdrs ", struct authunix_parms *" aupp ); +.fi +.IP +.\"O Used for describing Unix credentials. +.\"O This routine is useful for users +.\"O who wish to generate these credentials without using the RPC +.\"O authentication package. +Unix ·Á¼°¤Î¾ÚÌÀ½ñ¤òµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +RPC ǧ¾Ú¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ»¤º¤Ë¤³¤ì¤é¤Î¾ÚÌÀ½ñ¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "void xdr_callhdr(XDR *" xdrs ", struct rpc_msg *" chdr ); +.fi +.IP +.\"O Used for describing RPC call header messages. +.\"O This routine is useful for users who wish to generate +.\"O RPC-style messages without using the RPC package. +RPC ¸Æ¤Ó½Ð¤·¤Î¥Ø¥Ã¥À¡¼¡¦¥á¥Ã¥»¡¼¥¸¤òµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï RPC ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ»¤º¤Ë +RPC-·Á¼°¤Î¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_callmsg(XDR *" xdrs ", struct rpc_msg *" cmsg ); +.fi +.IP +.\"O Used for describing RPC call messages. +.\"O This routine is useful for users who wish to generate RPC-style +.\"O messages without using the RPC package. +RPC ¸Æ¤Ó½Ð¤·¥á¥Ã¥»¡¼¥¸¤òµ­½Ò¤¹¤ë¤Î¤Ë»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï RPC ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ»¤º¤Ë +RPC-·Á¼°¤Î¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_opaque_auth(XDR *" xdrs ", struct opaque_auth *" ap ); +.fi +.IP +.\"O Used for describing RPC authentication information messages. +.\"O This routine is useful for users who wish to generate +.\"O RPC-style messages without using the RPC package. +PRC ǧ¾Ú¾ðÊó¥á¥Ã¥»¡¼¥¸¤òµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï RPC ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ»¤º¤Ë +RPC-·Á¼°¤Î¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_pmap(XDR *" xdrs ", struct pmap *" regs ); +.fi +.IP +.\"O Used for describing parameters to various +.\"O .B portmap +.\"O procedures, externally. +.\"O This routine is useful for users who wish to generate +.\"O these parameters without using the +.\"O .B pmap +.\"O interface. +³Æ¼ï¤Î +.B portmap +¥×¥í¥·¥¸¥ã¤Ø¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ò³°ÉôŪ¤Ëµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.B pmap +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»ÈÍѤ»¤º¤Ë¡¢¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ò +ºîÀ®¤·¤¿¤¤¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_pmaplist(XDR *" xdrs ", struct pmaplist **" rp ); +.fi +.IP +.\"O Used for describing a list of port mappings, externally. +.\"O This routine is useful for users who wish to generate +.\"O these parameters without using the +.\"O .B pmap +.\"O interface. +¥Ý¡¼¥È¤Î¥Þ¥Ã¥Ô¥ó¥°¤Î¥ê¥¹¥È¤ò³°ÉôŪ¤Ëµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.B pmap +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»ÈÍѤ»¤º¤Ë¡¢¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ò +ºîÀ®¤·¤¿¤¤¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_rejected_reply(XDR *" xdrs ", struct rejected_reply *" rr ); +.fi +.IP +.\"O Used for describing RPC reply messages. +.\"O This routine is useful for users who wish to generate +.\"O RPC-style messages without using the RPC package. +RPC ±þÅú¥á¥Ã¥»¡¼¥¸¤òµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +RPC ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ»¤º¤Ë¡¢ +RPC-·Á¼°¤Î¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤·¤¿¤¤¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_replymsg(XDR *" xdrs ", struct rpc_msg *" rmsg ); +.fi +.IP +.\"O Used for describing RPC reply messages. +.\"O This routine is useful for users who wish to generate +.\"O RPC style messages without using the RPC package. +RPC ±þÅú¥á¥Ã¥»¡¼¥¸¤òµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï RPC ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ»¤º¤Ë¡¢ +RPC ·Á¼°¤Î¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤·¤¿¤¤¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "void xprt_register(SVCXPRT *" xprt ); +.fi +.IP +.\"O After RPC service transport handles are created, +.\"O they should register themselves with the RPC service package. +.\"O This routine modifies the global variable +.\"O .IR svc_fds . +.\"O Service implementors usually do not need this routine. +RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¥Ï¥ó¥É¥ë¤òÀ¸À®¤·¤¿¸å¤Ë¡¢¤½¤ì¤é¼«¿È¤ò +RPC ¥µ¡¼¥Ó¥¹¡¦¥Ñ¥Ã¥±¡¼¥¸¤ËÅÐÏ¿¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÂç°èÊÑ¿ô +.I svc_fds +¤ò½¤Àµ¤¹¤ë¡£¥µ¡¼¥Ó¥¹¤Î¼ÂÁõ¼Ô¤ÏÄ̾¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏɬÍפʤ¤¡£ +.LP +.nf +.BI "void xprt_unregister(SVCXPRT *" xprt ); +.fi +.IP +.\"O Before an RPC service transport handle is destroyed, +.\"O it should unregister itself with the RPC service package. +.\"O This routine modifies the global variable +.\"O .IR svc_fds . +.\"O Service implementors usually do not need this routine. +RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¥Ï¥ó¥É¥ë¤òÇ˲õ¤¹¤ëÁ°¤Ë¡¢¤½¤ì¤ò +RPC ÄÌ¿®¥Ñ¥Ã¥±¡¼¥¸¤«¤éÅÐÏ¿²ò½ü¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÂç°èÊÑ¿ô +.I svc_fds +¤ò½¤Àµ¤¹¤ë¡£¥µ¡¼¥Ó¥¹¤Î¼ÂÁõ¼Ô¤ÏÄ̾¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏɬÍפʤ¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.\"O .\" We don't have an rpc_secure.3 page in the set at the moment -- MTK, 19 Sep 05 +.\"O .\" .BR rpc_secure (3), +.\" º£¸½ºß¤Ï¡¢¤³¤ÎÇÛÉÛʪ (LDP_man-pages) ¤Ë¤Ï rpc_secure.3 ¤ÏÆþ¤Ã¤Æ¤¤¤Ê¤¤ +.\" -- MTK, 19 Sep 05 +.\" .BR rpc_secure (3), +.BR xdr (3) +.br +.\"O The following manuals: +°Ê²¼¤Î¥Þ¥Ë¥å¥¢¥ë: +.RS +Remote Procedure Calls: Protocol Specification +.br +Remote Procedure Call Programming Guide +.br +rpcgen Programming Guide +.br +.RE +.IR "RPC: Remote Procedure Call Protocol Specification" , +RFC\ 1050, Sun Microsystems, Inc., +USC-ISI. diff --git a/draft/man3/rpmatch.3 b/draft/man3/rpmatch.3 new file mode 100644 index 00000000..c21a6a9c --- /dev/null +++ b/draft/man3/rpmatch.3 @@ -0,0 +1,209 @@ +.\" Copyright (C) 2006 Justin Pryzby +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" References: +.\" glibc manual and source +.\" +.\" 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 +.SH ̾Á° +.\"O rpmatch \- determine if the answer to a question is affirmative or negative +rpmatch \- ¼ÁÌä¤Ø¤Î±þÅú¤¬¹ÎÄ꤫ÈÝÄ꤫¤òȽÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "int rpmatch(const char *" response ); +.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 rpmatch (): +_SVID_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR rpmatch () +.\"O handles a user response to yes or no questions, with +.\"O support for internationalization. +.BR rpmatch () +¤Ï 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) +¤Ç¼è¤ê¹þ¤ó¤À¤â¤Î¤Ç¤¢¤í¤¦¡£ + +.\"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 ¤¬ +¥æ¡¼¥¶¤Î¸À¸ìÀßÄê¤È¤·¤Æ¹Í褵¤ì¤ë¡£ + +.\"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" +.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 +.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 °Ê³°¤«¤É¤¦¤«¤ò³Îǧ¤¹¤ë¤À¤±¤Ç¤Ï +½½Ê¬¤Ç¤Ï¤Ê¤¤¡£ + +.\"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" +.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 +.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)$ +¤Ç²ò¼á¤¹¤ë¤Ê¤É¡£ +.\"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 () +¤ËÅϤ·¤¿¾ì¹ç¤Î·ë²Ì¤òɽ¼¨¤¹¤ë¡£ +.nf + +#define _SVID_SOURCE +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + if (argc != 2 || strcmp(argv[1], "\-\-help") == 0) { + fprintf(stderr, "%s response\\n", argv[0]); + exit(EXIT_FAILURE); + } + + setlocale(LC_ALL, ""); + printf("rpmatch() returns: %d\\n", 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) diff --git a/draft/man3/rtime.3 b/draft/man3/rtime.3 new file mode 100644 index 00000000..a5b102f2 --- /dev/null +++ b/draft/man3/rtime.3 @@ -0,0 +1,187 @@ +.\" Copyright 2003 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" Modified 2003-04-04 Walter Harms +.\" +.\" +.\" Slightly polished, aeb, 2003-04-06 +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Thu Sep 2 07:40:48 JST 2004 +.\" by Yuichi SATO +.\" +.TH RTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O rtime \- get time from a remote machine +rtime \- ¥ê¥â¡¼¥È¥Þ¥·¥ó¤«¤é»þ¹ï¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int rtime(struct sockaddr_in *" addrp ", struct rpc_timeval *" timep , +.BI " struct rpc_timeval *" timeout ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This function uses the Time Server Protocol as described in +.\"O RFC\ 868 to obtain the time from a remote machine. +¤³¤Î´Ø¿ô¤Ï RFC\ 868 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥¿¥¤¥à¥µ¡¼¥Ð¥×¥í¥È¥³¥ë¤ò»ÈÍѤ·¡¢ +¥ê¥â¡¼¥È¥Þ¥·¥ó¤«¤é»þ¹ï¤ò¼èÆÀ¤¹¤ë¡£ +.LP +.\"O The Time Server Protocol gives the time in seconds since +.\"O 00:00:00 UTC, 1 Jan 1900, +.\"O and this function subtracts the appropriate constant in order to +.\"O convert the result to seconds since the +.\"O Epoch, 1970-01-01 00:00:00 +0000 (UTC). +¥¿¥¤¥à¥µ¡¼¥Ð¥×¥í¥È¥³¥ë¤Ï 00:00:00 UTC, 1 Jan 1900 ¤«¤éÉÿô¤òÄ󶡤¹¤ë¤Î¤Ç¡¢ +¤³¤Î´Ø¿ô¤ÏŬÀÚ¤ÊÄê¿ôÃͤò°ú¤¯¤³¤È¤Ë¤è¤ê¡¢ +Ä󶡤µ¤ì¤¿Ãͤò Unix ¤Ë¤ª¤±¤ë»þ¹ïµª¸µ (1970-01-01 00:00:00 +0000 (UTC)) +¤«¤éÉÿô¤ËÊÑ´¹¤¹¤ë¡£ +.LP +.\"O When +.\"O .I timeout +.\"O is non-NULL, the udp/time socket (port 37) is used. +.I timeout +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢udp/time ¥½¥±¥Ã¥È (¥Ý¡¼¥È 37) ¤¬»ÈÍѤµ¤ì¤ë¡£ +.\"O Otherwise, the tcp/time socket (port 37) is used. +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢tcp/time ¥½¥±¥Ã¥È (¥Ý¡¼¥È 37) ¤¬»ÈÍѤµ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, 0 is returned, and the obtained 32-bit time value is stored in +.\"O .IR timep\->tv_sec . +À®¸ù¤·¤¿¾ì¹ç¤Ï¡¢0 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ÆÀ¤é¤ì¤¿ 32 ¥Ó¥Ã¥È¤Î»þ¹ïÃÍ¤Ï +.I timep\->tv_sec +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.\"O In case of error \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O All errors for underlying functions +.\"O .RB ( sendto (2), +.\"O .BR poll (2), +.\"O .BR recvfrom (2), +.\"O .BR connect (2), +.\"O .BR read (2)) +.\"O can occur. +.\"O Moreover: +ÆâÉô¤Ç»ÈÍѤ·¤Æ¤¤¤ë´Ø¿ô +.RB ( sendto (2), +.BR poll (2), +.BR recvfrom (2), +.BR connect (2), +.BR read (2)) +¤ÎÁ´¤Æ¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¹¹¤Ë¼¡¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë²ÄǽÀ­¤¬¤¢¤ë: +.TP +.B EIO +.\"O The number of returned bytes is not 4. +ÊÖ¤µ¤ì¤¿¥Ð¥¤¥È¿ô¤¬ 4 ¥Ð¥¤¥È¤Ç¤Ê¤¤¡£ +.TP +.B ETIMEDOUT +.\"O The waiting time as defined in timeout has expired. +timeout ¤ÇÄêµÁ¤µ¤ì¤¿ÂÔ¤Á»þ´Ö¤Î´ü¸Â¤¬Àڤ줿¡£ +.\"O .SH "NOTES" +.SH Ãí°Õ +.\"O Only IPv4 is supported. +IPv4 ¤Î¤ß¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +.\"O Some +.\"O .I in.timed +.\"O versions only support TCP. +.\"O Try the example program with +.\"O .I use_tcp +.\"O set to 1. +.I in.timed +¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï TCP ¤·¤«¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤â¤Î¤â¤¢¤ë¡£ +.I use_tcp +¤ò 1 ¤ËÀßÄꤷ¤Æ¡¢Îã¤Ë¤¢¤ë¥×¥í¥°¥é¥à¤ò»î¤¹¤³¤È¡£ +.LP +.\"O Libc5 uses the prototype +.\"O .br +.\"O int rtime(struct sockaddr_in *, struct timeval *, struct timeval *); +.\"O .br +.\"O and requires +.\"O .I +.\"O instead of +.\"O .IR . +libc5 ¤Ï¥×¥í¥È¥¿¥¤¥× +.br +int rtime(struct sockaddr_in *, struct timeval *, struct timeval *); +.br +¤ò»È¤¤¡¢ +.I +¤ÎÂå¤ï¤ê¤Ë +.I +¤òɬÍפȤ¹¤ë¡£ +.\"O .SH "BUGS" +.SH ¥Ð¥° +.\"O .BR rtime () +.\"O in glibc and earlier does not work properly on 64-bit machines. +glibc 2.2.5 °ÊÁ°¤Î +.BR rtime () +¤Ï¡¢64 ¥Ó¥Ã¥È¥Þ¥·¥ó¤ÇÀµ³Î¤ËÆ°ºî¤·¤Ê¤¤¡£ +.\"O .SH "EXAMPLE" +.SH Îã +.\"O This example requires that port 37 is up and open. +.\"O You may check +.\"O that the time entry within +.\"O .I /etc/inetd.conf +.\"O is not commented out. +¤³¤ÎÎã¤Ç¤Ï¥Ý¡¼¥È 37 ¤¬¥¢¥Ã¥×¤µ¤ì¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +.I /etc/inetd.conf +¤Î time ¥¨¥ó¥È¥ê¤¬¥³¥á¥ó¥È¥¢¥¦¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò³Îǧ¤·¤Æ¤Û¤·¤¤¡£ +.br +.\"O The program connects to a computer called "linux". +.\"O Using "localhost" does not work. +.\"O The result is the localtime of the computer "linux". +¤³¤Î¥×¥í¥°¥é¥à¤Ï "linux" ¤È¤¤¤¦¥³¥ó¥Ô¥å¡¼¥¿¤ËÀܳ¤¹¤ë¡£ +"localhost" ¤ò»È¤Ã¤¿¾ì¹ç¤ÏÆ°ºî¤·¤Ê¤¤¡£ +·ë²Ì¤Ï¥³¥ó¥Ô¥å¡¼¥¿ "linux" ¤Î¥í¡¼¥«¥ë»þ¹ï¤Ç¤¢¤ë¡£ +.sp +.nf +#include +#include +#include +#include +#include +#include +#include + +int use_tcp = 0; +char *servername = "linux"; + +int +main(void) +{ + struct sockaddr_in name; + struct rpc_timeval time1 = {0,0}; + struct rpc_timeval timeout = {1,0}; + struct hostent *hent; + int ret; + + memset((char *) &name, 0, sizeof(name)); + sethostent(1); + hent = gethostbyname(servername); + memcpy((char *) &name.sin_addr, hent\->h_addr, hent\->h_length); + + ret = rtime(&name, &time1, use_tcp ? NULL : &timeout); + if (ret < 0) + perror("rtime error"); + else + printf("%s\\n", ctime((time_t *) &time1.tv_sec)); + + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.\" .BR netdate (1), +.BR ntpdate (1), +.\" .BR rdate (1), +.BR inetd (8) diff --git a/draft/man3/rtnetlink.3 b/draft/man3/rtnetlink.3 new file mode 100644 index 00000000..0280a913 --- /dev/null +++ b/draft/man3/rtnetlink.3 @@ -0,0 +1,173 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: rtnetlink.3,v 1.3 1999/08/20 04:10:17 nakano 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 +.\" +.\"WORD: running length ¼ÂÆ°»þ¤ÎŤµ +.\" +.TH RTNETLINK 3 2010-01-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +.\"O rtnetlink \- macros to manipulate rtnetlink messages +rtnetlink \- rtnetlink ¥á¥Ã¥»¡¼¥¸¤òÁàºî¤¹¤ë¥Þ¥¯¥í +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.br +.B #include +.br +.B #include + +.BI "rtnetlink_socket = socket(AF_NETLINK, int " socket_type \ +", NETLINK_ROUTE);" +.sp +.BI "int RTA_OK(struct rtattr *" rta ", int " rtabuflen ); +.sp +.BI "void *RTA_DATA(struct rtattr *" rta ); +.sp +.BI "unsigned int RTA_PAYLOAD(struct rtattr *" rta ); +.sp +.BI "struct rtattr *RTA_NEXT(struct rtattr *" rta \ +", unsigned int " rtabuflen ); +.sp +.BI "unsigned int RTA_LENGTH(unsigned int " length ); +.sp +.BI "unsigned int RTA_SPACE(unsigned int "length ); +.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) +¥á¥Ã¥»¡¼¥¸¥Ø¥Ã¥À¤ÈÄɲðÀ­¤«¤é¤Ê¤ë¡£ +°À­¤ÎÁàºî¤Ï¡¢É¬¤º¤³¤³¤Ëµó¤²¤¿¥Þ¥¯¥í¤òÄ̤·¤Æ¹Ô¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.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 +¤¬¥¼¥í¤Ç¤Ê¤¯¤Æ¤â¡¢ +¥á¥Ã¥»¡¼¥¸Ãæ¤Ë¤Ï¤â¤¦¤½¤ì°Ê¾å°À­¤Ï̵¤¤¤È¹Í¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O .BI RTA_DATA( rta ) +.\"O returns a pointer to the start of this attribute's data. +.BI RTA_DATA( rta ) +¤Ï¤³¤Î°À­¥Ç¡¼¥¿¤ÎÀèƬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.\"O .BI RTA_PAYLOAD( rta ) +.\"O returns the length of this attribute's data. +.BI RTA_PAYLOAD( rta ) +¤Ï¤³¤Î°À­¥Ç¡¼¥¿¤ÎŤµ¤òÊÖ¤¹¡£ +.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 +¤ò»È¤Ã¤Æ¡¢ÊÖ¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤¬Àµ¤·¤¤¤«¤ò¥Á¥§¥Ã¥¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.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 +¥Ð¥¤¥È¤Î¥Ç¡¼¥¿ + ¥Ø¥Ã¥À¤ËɬÍפÊŤµ¤òÊÖ¤¹¡£ +.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 +.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 + + ... + + struct { + struct nlmsghdr nh; + struct ifinfomsg if; + char attrbuf[512]; + } req; + + struct rtattr *rta; + unsigned int mtu = 1000; + + int rtnetlink_sk = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); + + memset(&req, 0, sizeof(req)); + req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); + req.nh.nlmsg_flags = NLM_F_REQUEST; + req.nh.nlmsg_type = RTM_NEWLINK; + req.if.ifi_family = AF_UNSPEC; + req.if.ifi_index = INTERFACE_INDEX; + req.if.ifi_change = 0xffffffff; /* ???*/ + rta = (struct rtattr *)(((char *) &req) + + NLMSG_ALIGN(req.nh.nlmsg_len)); + rta\->rta_type = IFLA_MTU; + rta\->rta_len = 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) diff --git a/draft/man3/scalb.3 b/draft/man3/scalb.3 new file mode 100644 index 00000000..d7674727 --- /dev/null +++ b/draft/man3/scalb.3 @@ -0,0 +1,297 @@ +.\" 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. +.\" +.\" 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 2009-03-15 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.sp +.BI "double scalb(double " x ", double " exp ); +.br +.BI "float scalbf(float " x ", double " exp ); +.br +.BI "long double scalbl(long double " x ", double " exp ); +.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 scalb (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR scalbf (), +.BR scalbl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.ad b +.\"O Link with \fI\-lm\fP. +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"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 ¤Ç¤¢¤ë)¡£¤Ä¤Þ¤ê¡¢°Ê²¼¤Î¼°¤ÎÃͤòÊÖ¤¹¡£ +.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 +.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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +¤¬Éé¤Î̵¸ÂÂç¤Ç¤Ê¤¤¾ì¹ç¡¢Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.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 ¤¬Éé¤Î̵¸ÂÂç +.\" .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)¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.\" .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)¡¢¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.\" .I errno +.\" is set to +.\" .BR ERANGE . +.\"O An underflow floating-point exception +.\"O .RB ( FE_UNDERFLOW ) +.\"O is raised. +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +.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" +.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 ¤ËͳÍ褹¤ë¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR ldexp (3), +.BR scalbln (3) diff --git a/draft/man3/scandir.3 b/draft/man3/scandir.3 new file mode 100644 index 00000000..49d9cbf0 --- /dev/null +++ b/draft/man3/scandir.3 @@ -0,0 +1,269 @@ +.\" Copyright (C) 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 Sat Jul 24 18:26:16 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Thu Apr 11 17:11:33 1996 by Andries Brouwer (aeb@cwi.nl): +.\" Corrected type of compar routines, as suggested by +.\" Miguel Barreiro (enano@avalon.yaix.es). Added example. +.\" Modified Sun Sep 24 20:15:46 2000 by aeb, following Petter Reinholdtsen. +.\" Modified 2001-12-26 by aeb, following Joey. Added versionsort. +.\" +.\" 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 +.\" +.TH SCANDIR 3 2009-02-10 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O scandir, alphasort, versionsort \- scan a directory for matching entries +scandir, alphasort, versionsort \- ¥Ç¥£¥ì¥¯¥È¥ê¤òÁöºº¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int scandir(const char *" dirp ", struct dirent ***" namelist , +.RS +.BI "int (*" filter ")(const struct dirent *)," +.BI "int (*" compar ")(const struct dirent **, const struct dirent **));" +.RE +.sp +.BI "int alphasort(const void *" a ", const void *" b ); +.sp +.BI "int versionsort(const void *" a ", const void *" b ); +.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 scandir (), +.BR alphasort (): +_BSD_SOURCE || _SVID_SOURCE +.br +.BR versionsort (): +_GNU_SOURCE +.\"O .SH DESCRIPTION +.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 ¤Ê¤é¤Ð¡¢¤¹¤Ù¤Æ¤Î¥¨¥ó¥È¥ê¤¬ÁªÂò¤µ¤ì¤ë¡£ +.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" +.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 ¤òÊÖ¤¹¡£ +.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 ÈÖÌܤΰú¤­¿ô¤ËÂФ·¤Æ¡¢ +[¾®¤µ¤¤/Åù¤·¤¤/Â礭¤¤] ¤«¤Ë±þ¤¸¤Æ¡¢0 ¤è¤ê [¾®¤µ¤¤/Åù¤·¤¤/Â礭¤¤] ÃͤòÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +.\"O Insufficient memory to complete the operation. +Æ°ºî¤ò´°¿ë¤¹¤ë¤Ë¤Ï¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR versionsort () +.\"O was added to glibc in version 2.1. +.BR versionsort () +¤Ï¡¢glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤ÇÄɲ䵤줿¡£ +.\"O .SH "CONFORMING TO" +.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 ³ÈÄ¥¤Ç¤¢¤ë¡£ +.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 ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Ã¤È¾ÜºÙ¤Ê¥×¥í¥È¥¿¥¤¥×¤ò»È¤Ã¤Æ¤¤¤ë¡£ +.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 °Ê¹ß¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.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 +.SH Îã +.nf +#define _SVID_SOURCE +.\"O /* print files in current directory in reverse order */ +/* ¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Õ¥¡¥¤¥ë¤òµÕ½ç¤Ë½ÐÎϤ¹¤ë */ +#include + +int +main(void) +{ + struct dirent **namelist; + int n; + + n = scandir(".", &namelist, 0, alphasort); + if (n < 0) + perror("scandir"); + else { + while (n\-\-) { + printf("%s\en", namelist[n]\->d_name); + free(namelist[n]); + } + free(namelist); + } +} +.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) diff --git a/draft/man3/scanf.3 b/draft/man3/scanf.3 new file mode 100644 index 00000000..da564838 --- /dev/null +++ b/draft/man3/scanf.3 @@ -0,0 +1,1258 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)scanf.3 6.14 (Berkeley) 1/8/93 +.\" +.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu +.\" modified to resemble the GNU libio setup used in the Linux libc +.\" used in versions 4.x (x>4) and 5 Helmut.Geyer@iwr.uni-heidelberg.de +.\" Modified, aeb, 970121 +.\" 2005-07-14, mtk, added description of %n$ form; various text +.\" incorporated from the GNU C library documentation ((C) The +.\" Free Software Foundation); other parts substantially rewritten. +.\" +.\" 2008-06-23, mtk +.\" Add ERRORS section. +.\" Document the 'a' and 'm' modifiers for dynamic string allocation. +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated 1998-02-17, YOSHINO Takashi +.\" Updated 2003-02-23, Kentaro Shirakata +.\" Updated 2005-09-18, Akihiro MOTOKI +.\" Updated 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: conversion specifications ÊÑ´¹»ØÄê +.\"WORD: type modifier ·¿½¤¾þ»Ò +.\" +.TH SCANF 3 2008-07-12 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf \- input format conversion +scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf \- ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "int scanf(const char *" format ", ...);" +.BI "int fscanf(FILE *" stream ", const char *" format ", ...);" +.BI "int sscanf(const char *" str ", const char *" format ", ...);" +.sp +.B #include + +.BI "int vscanf(const char *" format ", va_list " ap ); +.BI "int vsscanf(const char *" str ", const char *" format ", va_list " ap ); +.BI "int vfscanf(FILE *" stream ", const char *" format ", va_list " ap ); +.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 vscanf (), +.BR vsscanf (), +.BR vfscanf (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I "cc -std=c99" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR scanf () +.\"O family of functions scans input according to +.\"O .I format +.\"O as described below. +.\"O This format may contain +.\"O .IR "conversion specifications" ; +.\"O the results from such conversions, if any, +.\"O are stored in the locations pointed to by the +.\"O .I pointer +.\"O arguments that follow +.\"O .IR format . +.\"O Each +.\"O .I pointer +.\"O argument must be of a type that is appropriate for the value returned +.\"O by the corresponding conversion specification. +.BR scanf () +´Ø¿ô¥°¥ë¡¼¥×¤Ï¡¢°Ê²¼¤Ë½Ò¤Ù¤ë¤è¤¦¤Ë¡¢ +.I format +¤Ë½¾¤Ã¤ÆÆþÎϤòÆɤ߹þ¤à¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î½ñ¼°¤Ë¤Ï +.I "¡ÖÊÑ´¹»ØÄê¡× (conversion specifications)" +¤ò´Þ¤á¤ë¤³¤È¤¬¤Ç¤­¡¢ÊÑ´¹»ØÄ꤬¤¢¤ì¤Ð¡¢¤½¤ÎÊÑ´¹¤Î·ë²Ì¤Ï +.I format +¤Ë³¤¯ +.I pointer +°ú¤­¿ô¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤µ¤ì¤ë¡£ +¤½¤ì¤¾¤ì¤Î +.I pointer +°ú¤­¿ô¤Î·¿¤Ï¡¢Âбþ¤¹¤ëÊÑ´¹»ØÄ꤬ÊÖ¤¹ÃÍ¤Ë +Ŭ¹ç¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O If the number of conversion specifications in +.\"O .I format +.\"O exceeds the number of +.\"O .I pointer +.\"O arguments, the results are undefined. +.\"O If the number of +.\"O .I pointer +.\"O arguments exceeds the number of conversion specifications, then the excess +.\"O .I pointer +.\"O arguments are evaluated, but are otherwise ignored. +.I format +Ãæ¤ÎÊÑ´¹»ØÄê¤Î¸Ä¿ô¤¬ +.I pointer +°ú¤­¿ô¤Î¿ô¤è¤ê¿¤«¤Ã¤¿¾ì¹ç¤Î·ë²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.I pointer +°ú¤­¿ô¤Î¿ô¤¬ÊÑ´¹»ØÄê¤Î¸Ä¿ô¤è¤ê¤â¿¤«¤Ã¤¿¾ì¹ç¡¢ +;ʬ¤Ê +.I pointer +°ú¤­¿ô¤Îɾ²Á¤Ï¹Ô¤ï¤ì¤ë¤¬¡¢¤½¤ì°Ê³°¤Ï¹Ô¤ï¤ì¤ºÌµ»ë¤µ¤ì¤ë¡£ + +.\"O The +.\"O .BR scanf () +.\"O function reads input from the standard input stream +.\"O .IR stdin , +.\"O .BR fscanf () +.\"O reads input from the stream pointer +.\"O .IR stream , +.\"O and +.\"O .BR sscanf () +.\"O reads its input from the character string pointed to by +.\"O .IR str . +.BR scanf () +´Ø¿ô¤Ïɸ½àÆþÎÏ¥¹¥È¥ê¡¼¥à +.I stdin +¤«¤é¤ÎÆþÎϤòÆɤ߹þ¤à¡£ +.BR fscanf () +¤Ï¥¹¥È¥ê¡¼¥à¥Ý¥¤¥ó¥¿ +.I stream +¤«¤é¤ÎÆþÎϤòÆɤ߹þ¤à¡£ +.BR sscanf () +¤Ïʸ»úÎó¥Ý¥¤¥ó¥¿ +.I str +¤Ç¼¨¤µ¤ì¤¿Ê¸»úÎ󤫤é¤ÎÆþÎϤòÆɤ߹þ¤à¡£ +.PP +.\"O The +.\"O .BR vfscanf () +.\"O function is analogous to +.\"O .BR vfprintf (3) +.\"O and reads input from the stream pointer +.\"O .I stream +.\"O using a variable argument list of pointers (see +.\"O .BR stdarg (3). +.BR vfscanf () +´Ø¿ô¤Ï +.BR vfprintf (3) +¤ÈƱÍͤˡ¢¥¹¥È¥ê¡¼¥à¥Ý¥¤¥ó¥¿ +.I stream +¤«¤é¤ÎÆþÎϤò¥Ý¥¤¥ó¥¿¤Î²ÄÊÑĹ°ú¤­¿ô¥ê¥¹¥È¤òÍѤ¤¤ÆÆɤ߹þ¤à +.RB ( stdarg (3) +¤ò»²¾È)¡£ +.\"O The +.\"O .BR vscanf () +.\"O function scans a variable argument list from the standard input and the +.\"O .BR vsscanf () +.\"O function scans it from a string; these are analogous to the +.\"O .BR vprintf (3) +.\"O and +.\"O .BR vsprintf (3) +.\"O functions respectively. +.BR vscanf () +´Ø¿ô¤Ï¡¢²ÄÊÑĹ°ú¤­¿ô¤Î¥ê¥¹¥È¤Ë´ð¤Å¤­É¸½àÆþÎϤ«¤é¤ÎÆɤ߼è¤ê¤ò¹Ô¤¦¡£ +.BR vsscanf () +´Ø¿ô¤Ï¤½¤Î¥ê¥¹¥È¤Ë´ð¤Å¤­Ê¸»úÎ󤫤éÆɤ߼è¤ë¡£ +¤³¤ì¤é¤Î´Ø·¸¤Ï +.BR vprintf (3) +¤È +.BR vsprintf (3) +´Ø¿ô¤Î´Ø·¸¤ÈƱÍͤǤ¢¤ë¡£ +.PP +.\"O The +.\"O .I format +.\"O string consists of a sequence of +.\"O .I directives +.\"O which describe how to process the sequence of input characters. +.\"O If processing of a directive fails, no further input is read, and +.\"O .BR scanf () +.\"O returns. +.\"O A "failure" can be either of the following: +.\"O .IR "input failure" , +.\"O meaning that input characters were unavailable, or +.\"O .IR "matching failure" , +.\"O meaning that the input was inappropriate (see below). +.I format +ʸ»úÎó¤Ï +.I "¡ÖÌ¿Îá¡× (directive)" +¤ÎÎó¤Ç¹½À®¤µ¤ì¤ë¡£Ì¿Îá¤ÏÆþÎÏʸ»ú¤Î·ÏÎó¤ò¤É¤Î¤è¤¦¤Ë½èÍý¤¹¤ë¤«¤ò»Ø¼¨¤¹¤ë +¤â¤Î¤Ç¤¢¤ë¡£¤¢¤ëÌ¿Îá¤Î½èÍý¤¬¼ºÇÔ¤¹¤ë¤È¡¢ÆþÎϤϤ½¤ì°Ê¾åÆɤ߹þ¤Þ¤ì¤º¡¢ +.BR scanf () +¤ÏÊ֤롣¡Ö¼ºÇÔ¡×¤Ï +.I "¡ÖÆþÎϤμºÇÔ¡× (input failure)" +¤È +.I "¡Ö°ìÃפμºÇÔ¡× (matching failure)" +¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ +ÆþÎϤμºÇÔ¤ÏÆþÎÏʸ»ú¤¬»ÈÍѤǤ­¤Ê¤«¤Ã¤¿¤³¤È¤ò°ÕÌ£¤·¡¢ +°ìÃפμºÇÔ¤ÏÆþÎϤ¬ÉÔŬÀڤǤ¢¤Ã¤¿¤³¤È (²¼µ­»²¾È) ¤ò°ÕÌ£¤¹¤ë¡£ + +.\"O A directive is one of the following: +Ì¿Îá¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë: +.TP +\(bu +.\"O A sequence of white-space characters (space, tab, newline, etc.; see +.\"O .BR isspace (3)). +.\"O This directive matches any amount of white space, +.\"O including none, in the input. +¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹ (¥¹¥Ú¡¼¥¹¡¢¥¿¥Ö¡¢²þ¹Ô¤Ê¤É; +.BR isspace (3) +»²¾È) ¤ÎÎó¡£ +¤³¤ÎÌ¿Îá¤Ï¡¢ÆþÎÏÃæ¤ÎǤ°Õ¤Î¸Ä¿ô¤Î¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤Ë°ìÃפ¹¤ë¡£ +(¡Ö²¿¤â¤Ê¤·¡×¤Ë¤â°ìÃפ¹¤ë)¡£ +.TP +\(bu +.\"O An ordinary character (i.e., one other than white space or \(aq%\(aq). +.\"O This character must exactly match the next character of input. +Ä̾ïʸ»ú (¤Ä¤Þ¤ê¡¢¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤È \(aq%\(aq °Ê³°¤Îʸ»ú)¡£ +¤³¤Îʸ»ú¤ÏÆþÎϤμ¡¤Îʸ»ú¤ËÀµ³Î¤Ë°ìÃפ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +\(bu +.\"O A conversion specification, +.\"O which commences with a \(aq%\(aq (percent) character. +.\"O A sequence of characters from the input is converted according to +.\"O this specification, and the result is placed in the corresponding +.\"O .I pointer +.\"O argument. +.\"O If the next item of input does not match the conversion specification, +.\"O the conversion fails \(em this is a +.\"O .IR "matching failure" . +ÊÑ´¹»ØÄê¡£ÊÑ´¹»ØÄê¤Ï \(aq%\(aq (¥Ñ¡¼¥»¥ó¥È) ʸ»ú¤Ç»Ï¤Þ¤ë¡£ +ÆþÎϤµ¤ì¤¿Ê¸»ú¤Î·ÏÎó¤Ï¤³¤Î»ØÄê¤Ë¤â¤È¤Å¤¤¤ÆÊÑ´¹¤µ¤ì¡¢ +ÊÑ´¹·ë²Ì¤ÏÂбþ¤¹¤ë +.I pointer +°ú¤­¿ô¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤µ¤ì¤ë¡£ +ÆþÎϤμ¡¤Îʸ»ú¤¬ÊÑ´¹»ØÄê¤È°ìÃפ·¤Ê¤¤¾ì¹ç¤Ï¡¢ÊÑ´¹¤Ï¼ºÇÔ¤¹¤ë +\(em ¤³¤ì¤¬ +.I "¡Ö°ìÃפμºÇÔ¡× (matching failure)" +¤Ç¤¢¤ë¡£ +.PP +.\"O Each +.\"O .I conversion specification +.\"O in +.\"O .I format +.\"O begins with either the character \(aq%\(aq or the character sequence +.\"O "\fB%\fP\fIn\fP\fB$\fP" +.\"O (see below for the distinction) followed by: +.I format +Ãæ¤Î³Æ¡¹¤Î +.I "¡ÖÊÑ´¹»ØÄê¡×" +¤Ïʸ»ú \(aq%\(aq ¤«Ê¸»ú·ÏÎó "\fB%\fP\fIn\fP\fB$\fP" +(°ã¤¤¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò) ¤Ç»Ï¤Þ¤ê¡¢°Ê²¼¤ÎÍ×ÁǤ¬Â³¤¯¡£ +.TP +\(bu +.\"O An optional \(aq*\(aq assignment-suppression character: +.\"O .BR scanf () +.\"O reads input as directed by the conversion specification, +.\"O but discards the input. +.\"O No corresponding +.\"O .I pointer +.\"O argument is required, and this specification is not +.\"O included in the count of successful assignments returned by +.\"O .BR scanf (). +ÂåÆþÍÞÀ©Ê¸»ú \(aq*\(aq (¾Êά²Äǽ)¡£ +.BR scanf () +¤ÏÊÑ´¹»ØÄê¤Ë»Ø¼¨¤µ¤ì¤¿Ä̤êÆþÎϤòÆɤ߹þ¤à¤¬¡¢¤½¤ÎÆþÎϤϼΤƤé¤ì¤ë¡£ +Âбþ¤¹¤ë +.I pointer +°ú¤­¿ô¤ÏɬÍפʤ¯¡¢ +.BR scanf () +¤¬ÊÖ¤¹ÂåÆþ¤¬À®¸ù¤·¤¿¿ô¤Ë¤³¤Î»ØÄê¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +.TP +\(bu +.\"O An optional \(aqa\(aq character. +.\"O This is used with string conversions, and relieves the caller of the +.\"O need to allocate a corresponding buffer to hold the input: instead, +.\"O .BR scanf () +.\"O allocates a buffer of sufficient size, +.\"O and assigns the address of this buffer to the corresponding +.\"O .I pointer +.\"O argument, which should be a pointer to a +.\"O .I "char *" +.\"O variable (this variable does not need to be initialized before the call). +.\"O The caller should subsequently +.\"O .BR free (3) +.\"O this buffer when it is no longer required. +.\"O This is a GNU extension; +.\"O C99 employs the \(aqa\(aq character as a conversion specifier (and +.\"O it can also be used as such in the GNU implementation). +ʸ»ú \(aqa\(aq (¾Êά²Äǽ)¡£¤³¤ì¤Ïʸ»úÎóÊÑ´¹¤È¤È¤â¤Ë»ÈÍѤµ¤ì¡¢¤³¤ì¤ò»È¤¦¤È +¸Æ¤Ó½Ð¤·¸µ¤¬ÆþÎϤòÊÝ»ý¤¹¤ëÂбþ¤¹¤ë¥Ð¥Ã¥Õ¥¡¤ò³ÎÊݤ¹¤ëɬÍפ¬¤Ê¤¯¤Ê¤ë¡£ +Âå¤ï¤ê¤Ë +.BR scanf () +¤¬É¬ÍפÊÂ礭¤µ¤Î¥Ð¥Ã¥Õ¥¡¤ò³ÎÊݤ·¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡¤Î¥¢¥É¥ì¥¹¤ò +Âбþ¤¹¤ë +.I pointer +°ú¤­¿ô¤ËÂåÆþ¤¹¤ë¡£ +.I pointer +°ú¤­¿ô¤Ï +.I "char *" +·¿¤ÎÊÑ¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(ÊÑ¿ô¼«ÂΤϸƤӽФ·Á°¤Ë½é´ü²½¤µ¤ì¤Æ¤¤¤ëɬÍפϤʤ¤)¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï¡¢ÉÔÍפˤʤä¿»þÅÀ¤Ç¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡¤ò +.BR free (3) +¤¹¤Ù¤­¤Ç¤¢¤ë¡£¤³¤Îµ¡Ç½¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +C99 ¤Ï \(aqa\(aq ʸ»ú¤òÊÑ´¹»ØÄê¤È¤·¤Æ»ÈÍѤ·¤Æ¤¤¤ë +(¤³¤Á¤é¤â GNU ¤Î¼ÂÁõ¤ÈƱ¤¸¤è¤¦¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë)¡£ +.TP +\(bu +.\"O An optional decimal integer which specifies the +.\"O .IR "maximum field width" . +.\"O Reading of characters stops either when this maximum is reached or +.\"O when a nonmatching character is found, whichever happens first. +.\"O Most conversions discard initial white space characters (the exceptions +.\"O are noted below), +.\"O and these discarded characters don't count towards the maximum field width. +.\"O String input conversions store a null terminator (\(aq\\0\(aq) +.\"O to mark the end of the input; +.\"O the maximum field width does not include this terminator. +.I "¡ÖºÇÂç¥Õ¥£¡¼¥ë¥ÉÉý¡×" +¤ò»ØÄꤹ¤ë 10¿Ê¿ô (¾Êά²Äǽ)¡£ +¤³¤ÎºÇÂçÃͤË㤹¤ë¤«¡¢°ìÃפ·¤Ê¤¤Ê¸»ú¤¬¸«¤Ä¤«¤ë¤«¡¢¤Î¤É¤Á¤é¤«¤Ë +¤Ê¤ë¤È¡¢Ê¸»ú¤ÎÆɤ߹þ¤ß¤òÄä»ß¤¹¤ë¡£ +¤Û¤È¤ó¤É¤ÎÊÑ´¹¤Ç¤Ï¡¢ÀèƬ¤Î¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹Ê¸»ú¤Ï¼Î¤Æ¤é¤ì +(Îã³°¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò¤¹¤ë)¡¢ +¼Î¤Æ¤é¤ì¤¿¤³¤ì¤é¤Îʸ»ú¤ÏºÇÂç¥Õ¥£¡¼¥ë¥ÉÉý¤Î·×»»¤Ë¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +ʸ»úÎó¤ÎÆþÎÏÊÑ´¹¤Ç¤Ï¡¢ÆþÎϤÎËöÈø¤ò¼¨¤¹¥Ì¥ë½ªÃ¼Ê¸»ú (\(aq\\0\(aq) +¤â³ÊǼ¤µ¤ì¤ë¤¬¡¢ºÇÂç¥Õ¥£¡¼¥ë¥ÉÉý¤Ë¤Ï¤³¤Î½ªÃ¼Ê¸»ú¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +.TP +\(bu +.\"O An optional +.\"O .IR "type modifier character" . +.\"O For example, the +.\"O .B l +.\"O type modifier is used with integer conversions such as +.\"O .B %d +.\"O to specify that the corresponding +.\"O .I pointer +.\"O argument refers to a +.\"O .I "long int" +.\"O rather than a pointer to an +.\"O .IR int . +.I "¡Ö·¿½¤¾þ»Ò¡× (type modifier characters)" +(¾Êά²Äǽ)¡£ +Î㤨¤Ð¡¢·¿½¤¾þ»Ò +.B l +¤ò +.B %d +¤Ê¤É¤ÎÀ°¿ôÊÑ´¹¤È°ì½ï¤Ë»È¤¦¤È¡¢Âбþ¤¹¤ë +.I pointer +°ú¤­¿ô¤¬ +.I int +¤Ç¤Ï¤Ê¤¯ +.I "long int" +¤ò»²¾È¤·¤Æ¤¤¤ë¤³¤È¤ò»ØÄê¤Ç¤­¤ë¡£ +.TP +\(bu +.\"O A +.\"O .I "conversion specifier" +.\"O that specifies the type of input conversion to be performed. +.I "¡ÖÊÑ´¹»ØÄê¡×" +: ¼Â¹Ô¤¹¤Ù¤­ÆþÎÏÊÑ´¹¤Î¼ïÎà¤ò»ØÄꤹ¤ë¡£ +.PP +.\"O The conversion specifications in +.\"O .I format +.\"O are of two forms, either beginning with \(aq%\(aq or beginning with +.\"O "\fB%\fP\fIn\fP\fB$\fP". +.\"O The two forms should not be mixed in the same +.\"O .I format +.\"O string, except that a string containing +.\"O "\fB%\fP\fIn\fP\fB$\fP" +.\"O specifications can include +.\"O .B %% +.\"O and +.\"O .BR %* . +.I format +Ãæ¤ÎÊÑ´¹»ØÄê¤Ï¡¢\(aq%\(aq ¤Ç»Ï¤Þ¤ë¤«¡¢ +"\fB%\fP\fIn\fP\fB$\fP" ¤Ç»Ï¤Þ¤ë¤«¤Î¡¢¤¤¤º¤ì¤«¤Î·Á¼°¤Ç¤¢¤ë¡£ +¤³¤ì¤é 2¤Ä¤Î·Á¼°¤òƱ¤¸ +.I format +ʸ»úÎó¤Ëº®¤¼¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£Ã¢¤·¡¢"\fB%\fP\fIn\fP\fB$\fP" ¤ò +´Þ¤àʸ»úÎó¤Ë +.B %% +¤È +.B %* +¤ò´Þ¤á¤ë¤³¤È¤Ï¤Ç¤­¤ë¡£ +.\"O If +.\"O .I format +.\"O contains \(aq%\(aq +.\"O specifications then these correspond in order with successive +.\"O .I pointer +.\"O arguments. +.I format +¤Ë \(aq%\(aq »ØÄ꤬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢³Æ¡¹¤Î \(aq%\(aq »ØÄê¤È +¸å³¤Î +.I pointer +°ú¤­¿ô¤Ï¤½¤Î½çÈÖÄ̤ê¤ËÂбþ¤¹¤ë¡£ +.\"O In the +.\"O "\fB%\fP\fIn\fP\fB$\fP" +.\"O form (which is specified in POSIX.1-2001, but not C99), +.\"O .I n +.\"O is a decimal integer that specifies that the converted input should +.\"O be placed in the location referred to by the +.\"O .IR n -th +.\"O .I pointer +.\"O argument following +.\"O .IR format . +"\fB%\fP\fIn\fP\fB$\fP" ·Á¼° +(POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤ë¤¬¡¢C99 ¤Ë¤Ï¤Ê¤¤) +¤Ç¤Ï¡¢ +.I n +¤Ï 10¿Ê¿ô¤Ç¤¢¤ê¡¢ÊÑ´¹¸å¤ÎÆþÎϤò +.I format +¤Î¸å¤í¤Î +.I n +ÈÖÌܤΠ+.I pointer +°ú¤­¿ô¤¬»²¾È¤¹¤ë¾ì½ê¤Ë³ÊǼ¤¹¤ë¤³¤È¤ò»ØÄꤹ¤ë¡£ +.\"O .SS Conversions +.SS ÊÑ´¹ +.\"O The following +.\"O .I "type modifier characters" +.\"O can appear in a conversion specification: +ÊÑ´¹»ØÄê¤Ë¤Ï¡¢°Ê²¼¤Î +.I "¡Ö·¿½¤¾þ»Ò¡×" +¤òÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B h +.\"O Indicates that the conversion will be one of +.\"O \fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP, or \fBn\fP +.\"O and the next pointer is a pointer to a +.\"O .I short int +.\"O or +.\"O .I unsigned short int +.\"O (rather than +.\"O .IR int ). +ÊÑ´¹¤¬ +\fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP, \fBn\fP +¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ê¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.RI ( int +¤Ç¤Ï¤Ê¤¯) +.I short int +¤« +.I unsigned short int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.B hh +.\"O As for +.\"O .BR h , +.\"O but the next pointer is a pointer to a +.\"O .I signed char +.\"O or +.\"O .IR "unsigned char" . +.B h +¤ÈƱ¤¸¤À¤¬¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.I signed char +¤« +.I unsigned char +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.B j +.\"O As for +.\"O .BR h , +.\"O but the next pointer is a pointer to an +.\"O .I intmax_t +.\"O or a +.\"O .IR uintmax_t . +.\"O This modifier was introduced in C99. +.B h +¤ÈƱ¤¸¤À¤¬¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.I intmax_t +¤« +.I uintmax_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î½¤¾þ»Ò¤Ï C99 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.TP +.B l +.\"O Indicates either that the conversion will be one of +.\"O \fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP, or \fBn\fP +.\"O and the next pointer is a pointer to a +.\"O .I long int +.\"O or +.\"O .I unsigned long int +.\"O (rather than +.\"O .IR int ), +.\"O or that the conversion will be one of +.\"O \fBe\fP, \fBf\fP, or \fBg\fP +.\"O and the next pointer is a pointer to +.\"O .I double +.\"O (rather than +.\"O .IR float ). +ÊÑ´¹¤¬ +\fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP, \fBn\fP +¤« +.B n +¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ê¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.RI ( int +¤Ç¤Ï¤Ê¤¯) +.I long int +¤« +.I unsigned long int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¡¢¤Þ¤¿¤Ï¡¢ÊÑ´¹¤¬ +\fBe\fP, \fBf\fP, \fBg\fP +¤Î¤¦¤Á¤Î¤Ò¤È¤Ä¤Ç¤¢¤ê¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.RI ( float +¤Ç¤Ï¤Ê¤¯) +.I double +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.\"O Specifying two +.\"O .B l +.\"O characters is equivalent to +.\"O .BR L . +.\"O If used with +.\"O .B %c +.\"O or +.\"O .B %s +.\"O the corresponding parameter is considered +.\"O as a pointer to a wide character or wide-character string respectively. +.\"O .\" This use of l was introduced in Amendment 1 to ISO C90. +.B l +ʸ»ú¤òÆó¤Ä»ØÄꤹ¤ë¤È¡¢ +.B L +¤ÈƱ¤¸°ÕÌ£¤È¤Ê¤ë¡£ +.B %c +¤ä +.B %s +¤È¤È¤â¤Ë»ÈÍѤ¹¤ë¤È¡¢ +¥Ñ¥é¥á¡¼¥¿¤Ï¤½¤ì¤¾¤ì¥ï¥¤¥Éʸ»ú¤ä¥ï¥¤¥Éʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤È +¤ß¤Ê¤µ¤ì¤ë¡£ +.\" l ¤Î¤³¤Î»ÈÍÑË¡¤Ï ISO C90 ¤Î Amendment 1 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.TP +.B L +.\"O Indicates that the conversion will be either +.\"O \fBe\fP, \fBf\fP, or \fBg\fP +.\"O and the next pointer is a pointer to +.\"O .I "long double" +.\"O or the conversion will be +.\"O \fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, or \fBx\fP +.\"O and the next pointer is a pointer to +.\"O .IR "long long" . +\fBe\fP, \fBf\fP, \fBg\fP +ÊÑ´¹¤Ç¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.I "long double" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£¤â¤·¤¯¤Ï¡¢ +\fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP +ÊÑ´¹¤Ç¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.I "long long" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.\"O .\" MTK, Jul 05: The following is no longer true for modern +.\"O .\" ANSI C (i.e., C99): +.\"O .\" (Note that long long is not an +.\"O .\" ANSI C +.\"O .\" type. Any program using this will not be portable to all +.\"O .\" architectures). +.\" MTK, Jul 05: °Ê²¼¤ÎÆâÍƤϿ·¤·¤¤ ANSI C (¤Ä¤Þ¤ê C99) ¤Ç¤Ï +.\" ¤â¤Ï¤äÀµ¤·¤¯¤Ê¤¤¡£ +.\" (long long ¤Ï +.\" .I ANSI C +.\" ¤Çµ¬Äꤵ¤ì¤¿·¿¤Ç¤Ï¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤è¤¦¡£ +.\" ¤³¤ì¤òÍѤ¤¤¿¥×¥í¥°¥é¥à¤ÏÁ´¤Æ¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ËÂФ·¤Æ +.\" °Ü¿¢²Äǽ¤Ç¤Ï¤Ê¤¤¡£) +.TP +.B q +.\"O equivalent to +.\"O .BR L . +.\"O This specifier does not exist in ANSI C. +.B L +¤ÈƱ°ì¤Ç¤¢¤ë¡£ +¤³¤Î½¤¾þ»Ò¤Ï ANSI C ¤Ë¤Ï¸ºß¤·¤Ê¤¤¡£ +.TP +.B t +.\"O As for +.\"O .BR h , +.\"O but the next pointer is a pointer to a +.\"O .IR ptrdiff_t . +.\"O This modifier was introduced in C99. +.B h +¤ÈƱÍͤÀ¤¬¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.I ptrdiff_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î½¤¾þ»Ò¤Ï C99 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.TP +.B z +.\"O As for +.\"O .BR h , +.\"O but the next pointer is a pointer to a +.\"O .IR size_t . +.\"O This modifier was introduced in C99. +.B h +¤ÈƱÍͤÀ¤¬¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.I size_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î½¤¾þ»Ò¤Ï C99 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.PP +.\"O The following +.\"O .I "conversion specifiers" +.\"O are available: +°Ê²¼¤Î +.I ¡ÖÊÑ´¹»ØÄê»Ò¡× +¤¬ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.TP +.B % +.\"O Matches a literal \(aq%\(aq. +.\"O That is, +.\"O .B %\&% +.\"O in the format string matches a +.\"O single input \(aq%\(aq character. +.\"O No conversion is done (but initial white space characters are discarded), +.\"O and assignment does not occur. +ʸ»ú \(aq%\(aq ¤ËÂбþ¤¹¤ë¡£ +½ñ¼°Ê¸»úÎó¤ÎÃæ¤Î +.B %\&% +¤Ïñ°ì¤Îʸ»ú \(aq%\(aq ¤ËÂбþ¤¹¤ë¡£ +ÊÑ´¹¤Ï¹Ô¤ï¤ì¤º (⤷¡¢ÀèƬ¤Î¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹Ê¸»ú¤Ï¼Î¤Æ¤é¤ì¤ë)¡¢ +ÊÑ¿ô¤Ø¤ÎÂåÆþ¤ÏÀ¸¤¸¤Ê¤¤¡£ +.TP +.B d +.\"O Matches an optionally signed decimal integer; +.\"O the next pointer must be a pointer to +.\"O .IR int . +Éä¹æ¤Ä¤­¤Î 10¿Ê¤ÎÀ°¿ô¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B D +.\"O Equivalent to +.\"O .IR ld ; +.\"O this exists only for backwards compatibility. +.\"O (Note: thus only in libc4. +.\"O In libc5 and glibc the +.\"O .B %D +.\"O is silently ignored, causing old programs to fail mysteriously.) +.I ld +¤ÈƱ°ì¤Ç¤¢¤ë¡£¤³¤ì¤Ï°ÊÁ°¤Î»ÅÍͤȤθߴ¹À­¤À¤±¤Î¤¿¤á¤Ë¤¢¤ë¡£ +(Ãí°Õ: ¤³¤ì¤Ï libc4 ¤Î¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ libc5 ¤ä glibc ¤Ç¤Ï +.B %D +¤Ï°ÅÌۤΤ¦¤Á¤Ë̵»ë¤µ¤ì¡¢¸Å¤¤¥×¥í¥°¥é¥à¤Ë¤ª¤¤¤ÆÆæ¤ËËþ¤Á¤¿¼ºÇԤθ¶°ø¤È¤Ê¤ë¡£) +.TP +.B i +.\"O Matches an optionally signed integer; the next pointer must be a pointer to +.\"O .IR int . +.\"O The integer is read in base 16 if it begins with +.\"O .I 0x +.\"O or +.\"O .IR 0X , +.\"O in base 8 if it begins with +.\"O .IR 0 , +.\"O and in base 10 otherwise. +.\"O Only characters that correspond to the base are used. +Éä¹æ¤Ä¤­À°¿ô¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ÎÀ°¿ô¤Ï +.I 0x +¤Þ¤¿¤Ï +.I 0X +¤Ç³«»Ï¤¹¤ë¾ì¹ç¤Ë¤Ï 16 ¿Ê¿ô¡¢ +.I 0 +¤Ç³«»Ï¤¹¤ë¾ì¹ç¤Ë¤Ï 8 ¿Ê¿ô¡¢¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï 10¿Ê¿ô¤È¤·¤ÆÆɤ߹þ¤Þ¤ì¤ë¡£ +¤³¤ÎÊÑ´¹¤Ç»ÈÍѤµ¤ì¤ëʸ»ú¤Ï¡¢¤³¤ì¤é¤Î´ð¿ô¤ËÂбþ¤·¤Æ¤¤¤ë¤â¤Î¤À¤±¤Ç¤¢¤ë¡£ +.TP +.B o +.\"O Matches an unsigned octal integer; the next pointer must be a pointer to +.\"O .IR "unsigned int" . +Éä¹æ¤Ê¤·¤Î 8 ¿Ê¤ÎÀ°¿ô¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I "unsigned int" +¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B u +.\"O Matches an unsigned decimal integer; the next pointer must be a +.\"O pointer to +.\"O .IR "unsigned int" . +Éä¹æ¤Ê¤·¤Î 10¿Ê¤ÎÀ°¿ô¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I "unsigned int" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B x +.\"O Matches an unsigned hexadecimal integer; the next pointer must +.\"O be a pointer to +.\"O .IR "unsigned int" . +Éä¹æ¤Ê¤·¤Î 16 ¿Ê¤ÎÀ°¿ô¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I "unsigned int" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B X +.\"O Equivalent to +.\"O .BR x . +.B x +¤ÈƱ°ì¤Ç¤¢¤ë¡£ +.TP +.B f +.\"O Matches an optionally signed floating-point number; the next pointer must +.\"O be a pointer to +.\"O .IR float . +Éä¹æ¤Ä¤­ÉâÆ°¾®¿ôÅÀ¼Â¿ô¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I float +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B e +.\"O Equivalent to +.\"O .BR f . +.B f +¤ÈƱ°ì¤Ç¤¢¤ë¡£ +.TP +.B g +.\"O Equivalent to +.\"O .BR f . +.B f +¤ÈƱ°ì¤Ç¤¢¤ë¡£ +.TP +.B E +.\"O Equivalent to +.\"O .BR f . +.B f +¤ÈƱ°ì¤Ç¤¢¤ë¡£ +.TP +.B a +.\"O (C99) Equivalent to +.\"O .BR f . +(C99) +.B f +¤ÈƱ°ì¤Ç¤¢¤ë¡£ +.TP +.B s +.\"O Matches a sequence of non-white-space characters; +.\"O the next pointer must be a pointer to character array that is +.\"O long enough to hold the input sequence and the terminating null +.\"O character (\(aq\\0\(aq), which is added automatically. +.\"O The input string stops at white space or at the maximum field +.\"O width, whichever occurs first. +¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤Ç¤Ï¤Ê¤¤Ê¸»ú¤Ç¹½À®¤µ¤ì¤¿Ê¸»úÎó¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ïʸ»ú¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤½¤Îʸ»úÇÛÎó¤Ï¡¢ÆþÎϤµ¤ì¤¿Ê¸»úÎó¤È (¼«Æ°Åª¤ËÄɲ䵤ì¤ë) +¥Ì¥ë½ªÃ¼Ê¸»ú (\(aq\\0\(aq) ¤ò³ÊǼ¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ʸ»úÎó¤ÎÆþÎϤϡ¢¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤¬ÆþÎϤµ¤ì¤ë¤«¡¢ºÇÂç¥Õ¥£¡¼¥ë¥ÉÉý¤Ë +㤹¤ë¤«¡¢¤Î¤É¤Á¤é¤«¤¬µ¯¤³¤ë¤ÈÄä»ß¤µ¤ì¤ë¡£ +.TP +.B c +.\"O Matches a sequence of characters whose length is specified by the +.\"O .I maximum field width +.\"O (default 1); the next pointer must be a pointer to +.\"O .IR char , +.\"O and there must be enough room for all the characters (no terminating +.\"O null byte +.\"O is added). +.\"O The usual skip of leading white space is suppressed. +.\"O To skip white space first, use an explicit space in the format. +.I "¡ÖºÇÂç¥Õ¥£¡¼¥ë¥ÉÉý¡×" +(¥Ç¥Õ¥©¥ë¥È¤Ï 1) ¤Ç»ØÄꤵ¤ì¤¿Éý¤Îʸ»ú¤ÎÎó¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I char +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¡¢¤¹¤Ù¤Æ¤Îʸ»ú¤ò³ÊǼ¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÎΰ褬 +¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ (½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ÏÄɲ䵤ì¤Ê¤¤)¡£ +Ä̾ï¹Ô¤ï¤ì¤ëÀèƬ¤Î¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤ÎÆɤßÈô¤Ð¤·¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +ÀèƬ¤Î¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤òÆɤßÈô¤Ð¤¹¤¿¤á¤Ë¤Ï¡¢ +¥Õ¥©¡¼¥Þ¥Ã¥Èʸ¤ÎÃæ¤ÇÌÀ¼¨Åª¤Ë¥¹¥Ú¡¼¥¹¤ò»ÈÍѤ¹¤ì¤ÐÎɤ¤¡£ +.TP +.B \&[ +.\"O Matches a nonempty sequence of characters from the specified set of +.\"O accepted characters; the next pointer must be a pointer to +.\"O .IR char , +.\"O and there must be enough room for all the characters in the string, plus a +.\"O terminating null byte. +.\"O The usual skip of leading white space is suppressed. +³ÊǼ¤µ¤ì¤¿Ê¸»úÎó¤Î¤¦¤Á¤«¤é¼è¤ê½Ð¤µ¤ì¤¿¡¢ +»ØÄꤵ¤ì¤¿Ê¸»ú¤Î½¸¹ç¤Ç¹½À®¤µ¤ì¤ë¶õ¤Ç¤Ï¤Ê¤¤Ê¸»ú¤ÎÎó¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I char +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤½¤³¤Ë¤Ïʸ»úÎóÃæ¤Î¤¹¤Ù¤Æ¤Îʸ»ú¤È½ªÃ¼¤Î NULL ¥Ð¥¤¥È +¤ò³ÊǼ¤¹¤ë¤¿¤á¤Î½½Ê¬¤ÊÎΰ褬¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Ä̾ï¹Ô¤ï¤ì¤ëÀèƬ¤Î¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤ÎÆɤßÈô¤Ð¤·¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +.\"O The string is to be made up of characters in (or not in) a particular set; +.\"O the set is defined by the characters between the open bracket +.\"O .B [ +.\"O character and a close bracket +.\"O .B ] +.\"O character. +.\"O The set +.\"O .I excludes +.\"O those characters if the first character after the open bracket is a +.\"O circumflex +.\"O .RB ( ^ ). +¤³¤Îʸ»úÎó¤ÏÆÃÊ̤ʽ¸¹ç¤ÎÃæ¤Îʸ»ú¤Ç¹½À®¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î½¸¹ç¤Ï +³«¤­³ç¸Ì +.B [ +¤ÈÊĤ¸³ç¸Ì +.B ] +¤Î´Ö¤Îʸ»ú¤ÇÄêµÁ¤µ¤ì¤ë¡£ +³«¤­³ç¸Ì¤Î¤¢¤È¤ÎºÇ½é¤Îʸ»ú¤¬¶Ê¥¢¥¯¥»¥ó¥Èµ­¹æ +.RB ( ^ ) +¤Î¾ì¹ç¡¢½¸¹ç¤Ï¤³¤ì¤é¤Îʸ»ú¤ò´Þ¤Þ¤Ê¤¤¤â¤Î¤È¤Ê¤ë¡£ +.\"O To include a close bracket in the set, make it the first character after +.\"O the open bracket or the circumflex; any other position will end the set. +.\"O The hyphen character +.\"O .B \- +.\"O is also special; when placed between two other characters, it adds all +.\"O intervening characters to the set. +.\"O To include a hyphen, make it the last +.\"O character before the final close bracket. +ÊĤ¸³ç¸Ì¤ò½¸¹ç¤Ë´Þ¤Þ¤»¤ë¤¿¤á¤Ë¤Ï¡¢¤³¤Îʸ»ú¤ò³«¤­³ç¸Ì¤Þ¤¿¤Ï +¶Ê¥¢¥¯¥»¥ó¥Èµ­¹æ¤Î¤¢¤È¤ÎºÇ½é¤Îʸ»ú¤Ë¤¹¤ì¤Ð¤è¤¤¡£ +¤Ä¤Þ¤ê¡¢Â¾¤Î°ÌÃÖ¤ËÊĤ¸³ç¸Ì¤òÃÖ¤¯¤Èʸ»ú¤Î½¸¹ç¤¬½ª¤ë¡£ +¥Ï¥¤¥Õ¥ó +.B \- +¤â¤Þ¤¿Æüìʸ»ú¤Ç¤¢¤ë¡£ +Æó¤Ä¤Î°Û¤Ê¤ëʸ»ú¤Î´Ö¤ËÃÖ¤«¤ì¤¿»þ¡¢¤³¤Îʸ»ú¤Ï¡¢ +¤½¤Î´Ö¤Ë¤¢¤ëÁ´¤Æ¤Îʸ»ú¤ò½¸¹ç¤Ë²Ã¤¨¤ë¡£ +¥Ï¥¤¥Õ¥ó¼«ÂΤò´Þ¤Þ¤»¤ë¤¿¤á¤Ë¤Ï¡¢ +³ç¸Ì¤¬ÊĤ¸¤ëÁ°¤ÎºÇ¸å¤Î°ìʸ»ú¤ò¥Ï¥¤¥Õ¥ó¤Ë¤¹¤ì¤Ð¤è¤¤¡£ +.\"O For instance, +.\"O .B [^]0\-9\-] +.\"O means +.\"O the set "everything except close bracket, zero through nine, and hyphen". +.\"O The string ends with the appearance of a character not in the (or, with a +.\"O circumflex, in) set or when the field width runs out. +Î㤨¤Ð¡¢ +.B [^]0\-9\-] +¤Ï¡ÖÊĤ¸³ç¸Ì¡¢0 ¡Á 9¡¢¥Ï¥¤¥Õ¥ó¤Î 3 ¼ïÎà¤ò½ü¤¯Á´¤Æ¤Îʸ»ú¡×¤Î½¸¹ç¤ò°ÕÌ£¤¹¤ë¡£ +¤³¤Îʸ»úÎó¤Ï +½¸¹ç¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤ (¶Ê¥¢¥¯¥»¥ó¥È¤Î¾ì¹ç¤Ë¤Ï´Þ¤Þ¤ì¤ë) ʸ»ú¤Î +½Ð¸½¤Þ¤¿¤Ï³ÎÊݤµ¤ì¤¿Îΰ褬»È¤¤ÀÚ¤é¤ì¤¿»þ¤Ë½ªÎ»¤¹¤ë¡£ +.TP +.B p +.\"O Matches a pointer value (as printed by +.\"O .B %p +.\"O in +.\"O .BR printf (3); +.\"O the next pointer must be a pointer to a pointer to +.\"O .IR void . +.RB ( printf (3) +¤Î +.B %p +¤Ç°õ»ú¤µ¤ì¤ë¤è¤¦¤Ê) ¥Ý¥¤¥ó¥¿ÃͤËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I void +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B n +.\"O Nothing is expected; instead, the number of characters consumed thus far +.\"O from the input is stored through the next pointer, which must be a pointer +.\"O to +.\"O .IR int . +¤É¤ó¤ÊÆþÎϤâɬÍפȤ·¤Ê¤¤¡£ +¤½¤Î¤«¤ï¤ê¤Ë¡¢ +ÆþÎϤ«¤é¤³¤³¤Þ¤Ç¾ÃÈñ¤µ¤ì¤¿Ê¸»ú¿ô¤¬¼¡¤Î¥Ý¥¤¥ó¥¿¤Ç»ØÄꤵ¤ì¤¿¾ì½ê¤Ë +³ÊǼ¤µ¤ì¤ë¡£ +¤³¤Î¥Ý¥¤¥ó¥¿¤Ï +.I int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O This is +.\"O .I not +.\"O a conversion, although it can be suppressed with the +.\"O .B * +.\"O assignment-suppression character. +ÊÑ´¹¤òÍÞÀ©¤¹¤ë¤Î¤Ç¤¢¤ì¤Ð +.B * +ÂåÆþÍÞÀ©Ê¸»ú¤ò»È¤Ã¤ÆÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤Î¤À¤¬¡¢ +¤³¤ÎÊÑ´¹»ØÄê»Ò¤ÏÊÑ´¹¤Ç¤Ï¡Ö¤Ê¤¤¡×¡£ +.\"O The C standard says: "Execution of a +.\"O .B %n +.\"O directive does not increment +.\"O the assignment count returned at the completion of execution" +.\"O but the Corrigendum seems to contradict this. +.\"O Probably it is wise +.\"O not to make any assumptions on the effect of +.\"O .B %n +.\"O conversions on the return value. +C ¸À¸ì¤Îɸ½àµ¬³Ê¤Ç¤Ï¡Ö¼Â¹Ô¤Î´°Î»»þ¤ËÊÖ¤µ¤ì¤ëÂåÆþ¤Î²ó¿ô¤Ï +.B %n +Ì¿Îá¤Î¼Â¹Ô¤Ç¤ÏÁý²Ã¤·¤Ê¤¤¡×¤È¤Ê¤Ã¤Æ¤¤¤ë¤¬¡¢ +Àµ¸íɽ¤ÎÆâÍƤϤ³¤ì¤ÈÌ·½â¤¹¤ë¤è¤¦¤Ç¤¢¤ë¡£¤ª¤½¤é¤¯¡¢ +.B %n +ÊÑ´¹¤¬ÊÖ¤êÃͤËÍ¿¤¨¤ë±Æ¶Á¤Ë¤Ä¤¤¤Æ¤Ï¤É¤Î¤è¤¦¤Ê²¾Äê¤â¤·¤Ê¤¤¤Î¤¬ +¸­ÌÀ¤Ç¤¢¤í¤¦¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O These functions return the number of input items +.\"O successfully matched and assigned, +.\"O which can be fewer than provided for, +.\"O or even zero in the event of an early matching failure. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢°ìÃפÈÂåÆþ¤¬À®¸ù¤·¤¿ÆþÎÏÍ×ÁǤθĿô¤òÊÖ¤¹¡£ +ÊÖ¤µ¤ì¤ëÃͤÏÅϤµ¤ì¤¿ÊÑ´¹¤Î¸Ä¿ô¤è¤ê¤â¾¯¤Ê¤¤¤³¤È¤â¤¢¤ê¡¢ +ºÇ½é¤Ë°ìÃפμºÇÔ¤¬¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï 0 ¤Ë¤Ê¤ë¤³¤È¤â¤¢¤ë¡£ + +.\"O The value +.\"O .B EOF +.\"O is returned if the end of input is reached before either the first +.\"O successful conversion or a matching failure occurs. +.\"O .B EOF +.\"O is also returned if a read error occurs, +.\"O in which case the error indicator for the stream (see +.\"O .BR ferror (3)) +.\"O is set, and +.\"O .I errno +.\"O is set indicate the error. +ºÇ½é¤ÎÊÑ´¹¤¬À®¸ù¤¹¤ëÁ°¤ËÆþÎϤκǸå¤Ë㤷¤Æ¡¢°ìÃפμºÇÔ¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +.B EOF +¤¬ÊÖ¤µ¤ì¤ë¡£¤Þ¤¿¡¢ +Æɤ߹þ¤ß¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤â +.B EOF +¤¬ÊÖ¤µ¤ì¤ë¡£Æɤ߹þ¤ß¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥¹¥È¥ê¡¼¥à¤Î +¥¨¥é¡¼»Ø¼¨»Ò¤¬¥»¥Ã¥È¤µ¤ì +.RB ( ferror (3) +»²¾È)¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.\"O The file descriptor underlying +.\"O .I stream +.\"O is marked nonblocking, and the read operation would block. +.I stream +¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ nonblocking ¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢ +Æɤ߹þ¤ßÁàºî¤ÏÄä»ß (block) ¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.TP +.B EBADF +.\"O The file descriptor underlying +.\"O .I stream +.\"O is invalid, or not open for reading. +.I stream +¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Ìµ¸ú¤Ç¤¢¤ë¤¬¡¢ +Æɤ߹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EILSEQ +.\"O Input byte sequence does not form a valid character. +ÆþÎϤµ¤ì¤¿¥Ð¥¤¥ÈÎó¤¬Í­¸ú¤Êʸ»ú¤ò¹½À®¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EINTR +.\"O The read operation was interrupted by a signal; see +.\"O .BR signal (7). +Æɤ߹þ¤ßÁàºî¤¬¥·¥°¥Ê¥ë¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.\"O Not enough arguments; or +.\"O .I format +.\"O is NULL. +°ú¤­¿ô¤¬½½Ê¬¤Ç¤Ê¤¤¡£¤Þ¤¿¤Ï +.I format +¤¬ NULL ¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +.\"O Out of memory. +¥á¥â¥êÉÔ­¡£ +.TP +.B ERANGE +.\"O The result of an integer conversion would exceed the size +.\"O that can be stored in the corresponding integer type. +À°¿ôÊÑ´¹¤Î·ë²Ì¤¬¡¢Âбþ¤¹¤ëÀ°¿ô·¿¤Ë³ÊǼ¤Ç¤­¤ë¥µ¥¤¥º¤ò±Û¤¨¤Æ¤·¤Þ¤¦¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The functions +.\"O .BR fscanf (), +.\"O .BR scanf (), +.\"O and +.\"O .BR sscanf () +.\"O conform to C89 and C99 and POSIX.1-2001. +.\"O These standards do not specify the +.\"O .B ERANGE +.\"O error. +.BR fscanf (), +.BR scanf (), +.BR sscanf () +´Ø¿ô¤Ï C89, C99, POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Îɸ½à¤Ç¤Ï¡¢¥¨¥é¡¼ +.B ERANGE +¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O The +.\"O .B q +.\"O specifier is the 4.4BSD notation for +.\"O .IR "long long" , +.B q +»ØÄê»Ò¤Ï +.I "long long" +¤Î 4.4BSD ¤Ç¤Îµ­½ÒÊýË¡¤Ç¤¢¤ë¡£ +.\"O while +.\"O .B ll +.\"O or the usage of +.\"O .B L +.\"O in integer conversions is the GNU notation. +°ìÊý¡¢À°¿ôÊÑ´¹¤Ç¤Î +.B ll +¤Þ¤¿¤Ï +.B L +¤Î»ÈÍÑ¤Ï GNU ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.PP +.\"O The Linux version of these functions is based on the +.\"O .I GNU +.\"O .I libio +.\"O library. +.\"O Take a look at the +.\"O .I info +.\"O documentation of +.\"O .I GNU +.\"O .I libc (glibc-1.08) +.\"O for a more concise description. +¤³¤ì¤é¤Î´Ø¿ô¤Î Linux ÈÇ¤Ï +.I GNU +.I libio +¥é¥¤¥Ö¥é¥ê¡¼¤ò¸µ¤Ë¤·¤Æ¤¤¤ë¡£ +¤è¤ê´Ê·é¤ÊÀâÌÀ¤Ë¤Ï +.I GNU +.I libc (glibc-1.08) +¤Î +.I info +ʸ½ñ¤ËÌܤòÄ̤¹¤³¤È¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The GNU C library supports a nonstandard extension that causes +.\"O the library to dynamically allocate a string of sufficient size +.\"O for input strings for the +.\"O .B %s +.\"O and +.\"O \fB%a[\fP\fIrange\fP\fB]\fP +.\"O conversion specifiers. +GNU C ¥é¥¤¥Ö¥é¥ê (glibc) ¤Ç¤ÏÈóɸ½à¤Î¥ª¥×¥·¥ç¥ó¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤ª¤ê¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤ÈÊÑ´¹»ØÄê»Ò +.B %s +¤ä +\fB%a[\fP\fIrange\fP\fB]\fP +¤Ø¤ÎÆþÎÏʸ»úÎó¤ËÂФ·¤Æ½½Ê¬¤ÊÂ礭¤µ¤Îʸ»úÎó¤ò¥é¥¤¥Ö¥é¥ê¤¬Æ°Åª¤Ë³ÎÊݤ¹¤ë +¤è¤¦¤Ë¤Ê¤ë¡£ +.\"O .\" This feature seems to be present at least as far back as glibc 2.0. +.\" ¤³¤Îµ¡Ç½¤Ï¾¯¤Ê¤¯¤È¤â glibc 2.0 »þÅÀ¤«¤é¸ºß¤·¤Æ¤¤¤ë¤è¤¦¤À¡£ +.\"O To make use of this feature, specify +.\"O .B a +.\"O as a length modifier (thus +.\"O .B %as +.\"O or +.\"O \fB%a[\fP\fIrange\fP\fB]\fP). +.\"O The caller must +.\"O .BR free (3) +.\"O the returned string, as in the following example: +¤³¤Îµ¡Ç½¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢Ä¹¤µ½¤¾þ»Ò¤È¤·¤Æ +.B a +¤ò»ØÄꤹ¤ë (¤·¤¿¤¬¤Ã¤Æ¡¢Á´ÂΤȤ·¤Æ¤Ï +.B %as +¤ä +\fB%a[\fP\fIrange\fP\fB]\fP ¤È¤Ê¤ë)¡£ +°Ê²¼¤ÎÎã¤Ë¤¢¤ë¤è¤¦¤Ë¡¢¸Æ¤Ó½Ð¤·Â¦¤ÏÊÖ¤µ¤ì¤¿Ê¸»úÎó¤ò +.BR free (3) +¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.in +4n +.nf + +char *p; +int n; + +errno = 0; +n = scanf("%a[a-z]", &p); +if (n == 1) { + printf("read: %s\\n", p); + free(p); +} else if (errno != 0) { + perror("scanf"); +} else { + fprintf(stderr, "No matching characters\\n"): +} +.fi +.in +.PP +.\"O As shown in the above example, it is only necessary to call +.\"O .BR free (3) +.\"O if the +.\"O .BR scanf () +.\"O call successfully read a string. +¾åµ­¤ÎÎã¤Ë¤¢¤ë¤è¤¦¤Ë¡¢ +.BR scanf () +¤¬Ê¸»úÎó¤ÎÆɤ߹þ¤ß¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤À¤±¡¢ +.BR free (3) +¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢¤ë¡£ +.PP +.\"O The +.\"O .B a +.\"O modifier is not available if the program is compiled with +.\"O .I "gcc -std=c99" +.\"O or +.\"O .IR "gcc -D_ISOC99_SOURCE" +.\"O (unless +.\"O .B _GNU_SOURCE +.\"O is also specified), in which case the +.\"O .B a +.\"O is interpreted as a specifier for floating-point numbers (see above). +.I "gcc -std=c99" +¤ä +.I "gcc -D_ISOC99_SOURCE" +¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +.RB ( _GNU_SOURCE +¤âƱ»þ¤Ë»ØÄꤷ¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢ +.B a +½¤¾þ»Ò¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +¾åµ­¤Î¾ì¹ç¡¢ +.B a +¤Ï (¾å½Ò¤ÎÄ̤ê) ÉâÆ°¾®¿ôÅÀ¿ô¤ò¼¨¤¹ÊÑ´¹»ØÄê»Ò¤È²ò¼á¤µ¤ì¤ë¡£ + +.\"O Since version 2.7, glibc also provides the +.\"O .B m +.\"O modifier for the same purpose as the +.\"O .BR a +.\"O modifier. +.\"O The +.\"O .B m +.\"O modifier has the following advantages: +¥Ð¡¼¥¸¥ç¥ó 2.7 °Ê¹ß¤Ç¤Ï¡¢glibc ¤Ï +.B a +½¤¾þ»Ò¤ÈƱ¤¸ÌÜŪ¤Ç +.B m +½¤¾þ»Ò¤âÄ󶡤·¤Æ¤¤¤ë¡£ +.B m +½¤¾þ»Ò¤Ï°Ê²¼¤ÎÍøÅÀ¤¬¤¢¤ë¡£ +.IP * 2 +.\"O It may also be applied to +.\"O .B %c +.\"O conversion specifiers (e.g., +.\"O .BR %3mc ). +.B %c +ÊÑ´¹»ØÄê»Ò¤Ë¤âŬÍѤǤ­¤ë (Î㤨¤Ð +.BR %3mc )¡£ +.IP * +.\"O It avoids ambiguity with respect to the +.\"O .B %a +.\"O floating-point conversion specifier (and is unaffected by +.\"O .IR "gcc -std=c99" +.\"O etc.) +ÉâÆ°¾®¿ôÅÀÊÑ´¹»ØÄê»Ò¤È¤·¤Æ¤Î +.B %a +¤È¤Îʶ¤é¤ï¤·¤µ¤¬Èò¤±¤é¤ì¤ë (¤Þ¤¿ +.I "gcc -std=c99" +¤Ê¤É¤Î±Æ¶Á¤âÈò¤±¤é¤ì¤ë)¡£ +.IP * +.\"O It is specified in the upcoming revision of the POSIX.1 standard. +POSIX.1 ɸ½à¤Î¼¡¤Î²þÄûÈǤǵ¬Äꤵ¤ì¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O All functions are fully C89 conformant, but provide the +.\"O additional specifiers +.\"O .B q +.\"O and +.\"O .B a +.\"O as well as an additional behavior of the +.\"O .B L +.\"O and +.\"O .B l +.\"O specifiers. +.\"O The latter may be considered to be a bug, as it changes the +.\"O behavior of specifiers defined in C89. +Á´¤Æ¤Î´Ø¿ô¤Ï¡¢´°Á´¤Ë C89 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£¤·¤«¤· +ÄÉ²Ã¤Ç +.B q +¤È +.B a +»ØÄê»Ò¤¬Ä󶡤µ¤ì¤Æ¤ª¤ê¡¢Æ±ÍÍ¤Ë +.B L +¤È +.B l +»ØÄê»Ò¤ÎÉÕ²ÃŪ¤Ê¿¶¤ëÉñ¤¤¤â¤¢¤ë¡£¸å¼Ô¤Ï¡¢ +C89 ¤ÇÄêµÁ¤µ¤ì¤¿»ØÄê»Ò¤Î¿¶¤ëÉñ¤¤¤òÊѹ¹¤¹¤ë¤â¤Î¤Ê¤Î¤Ç¡¢ +¥Ð¥°¤È¤ß¤Ê¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +.\"O Some combinations of the type modifiers and conversion +.\"O specifiers defined by ANSI C do not make sense +.\"O (e.g. +.\"O .BR "%Ld" ). +ANSI C ¤ÇÄêµÁ¤µ¤ì¤¿·¿½¤¾þ»Ò¤ÈÊÑ´¹»ØÄê»Ò¤ÎÁȤ߹ç¤ï¤»¤ÎÃæ¤Ë¤Ï +°ÕÌ£¤ò¤Ê¤µ¤Ê¤¤¤â¤Î¤¬¤¢¤ë +(Î㤨¤Ð¡¢ +.BR "%Ld" )¡£ +.\"O While they may have a well-defined behavior on Linux, this need not +.\"O to be so on other architectures. +.\"O Therefore it usually is better to use +.\"O modifiers that are not defined by ANSI C at all, that is, use +.\"O .B q +.\"O instead of +.\"O .B L +.\"O in combination with +.\"O \fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, and \fBX\fP +.\"O conversions or +.\"O .BR ll . +¤³¤ì¤é¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +Linux ¾å¤Ç¤Ï¤Ï¤Ã¤­¤ê¤ÈÄêµÁ¤µ¤ì¤¿¿¶¤ëÉñ¤¤¤ò¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¤¬¡¢ +¾¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤âƱÍͤˤʤäƤ¤¤ë¤È¤Ï¸Â¤é¤Ê¤¤¡£ +¤½¤ì¤æ¤¨¤Ë¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢ +ANSI C ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤½¤¾þ»Ò¤ò»ÈÍѤ·¤¿Êý¤¬Îɤ¤¡£ +¤¹¤Ê¤ï¤Á¡¢ +\fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP +ÊÑ´¹¤ä +.B ll +¤ÈÁȤ߹ç¤ï¤»¤ë¾ì¹ç¤Ë¤Ï¡¢ +.B L +¤ÎÂå¤ï¤ê¤Ë +.B q +¤ò»ÈÍѤ·¤¿Êý¤¬Îɤ¤¡£ +.PP +.\"O The usage of +.\"O .B q +.\"O is not the same as on 4.4BSD, +.\"O as it may be used in float conversions equivalently to +.\"O .BR L . +.B q +¤Î»ÈÍÑÊýË¡¤Ï 4.4BSD ¤ÈƱ¤¸¤Ç¤Ï¤Ê¤¤¡£ +4.4BSD ¤Ç¤Ï +.B q +¤Ï +.B L +¤ÈƱÅù¤ËÉâÆ°¾®¿ô¤ÎÊÑ´¹¤Ë»ÈÍѤµ¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getc (3), +.BR printf (3) +.BR setlocale (3), +.BR strtod (3), +.BR strtol (3), +.BR strtoul (3), diff --git a/draft/man3/sched_getcpu.3 b/draft/man3/sched_getcpu.3 new file mode 100644 index 00000000..ad09e3a8 --- /dev/null +++ b/draft/man3/sched_getcpu.3 @@ -0,0 +1,117 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 +.\" +.TH SCHED_GETCPU 3 2009-12-08 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sched_getcpu \- determine CPU on which the calling thread is running +sched_getcpu \- ¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë CPU ¤òÃΤë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +.B int sched_getcpu(void); +.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 sched_getcpu (): +_BSD_SOURCE || _SVID_SOURCE +.\"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 +.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 +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ENOSYS +.\"O This kernel does not implement +.\"O .BR getcpu (2). +¤³¤Î¥«¡¼¥Í¥ë¤Ç¤Ï +.BR getcpu (2) +¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH VERSIONS +.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 +.SH Ãí°Õ +.\"O The call +.in +4n +.nf + +cpu = sched_getcpu(); + +.fi +.in +.\"O is equivalent to the following +.\"O .BR getcpu (2) +.\"O call: +¤Ï¡¢°Ê²¼¤Î +.BR getcpu (2) +¤Î¸Æ¤Ó½Ð¤·¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.in +4n +.nf + +int c, s; +s = getcpu(&c, NULL, NULL); +cpu = (s == -1) ? s : c; +.fi +.in +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR getcpu (2) diff --git a/draft/man3/seekdir.3 b/draft/man3/seekdir.3 new file mode 100644 index 00000000..a0a12225 --- /dev/null +++ b/draft/man3/seekdir.3 @@ -0,0 +1,121 @@ +.\" 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 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 +.\" +.TH SEEKDIR 3 2009-03-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O seekdir \- set the position of the next readdir() call in the directory +.\"O stream. +seekdir \- ¼¡¤Î readdir() ¸Æ¤Ó½Ð¤·¤Î¤¿¤á¤Ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥àÃæ¤Î°ÌÃÖ¤ò +ÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void seekdir(DIR *" dirp ", long " offset ); +.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 seekdir (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.\"O .SH DESCRIPTION +.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" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR seekdir () +.\"O function returns no value. +.BR seekdir () +´Ø¿ô¤Ï¡¢ÃͤòÊÖ¤µ¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.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" +.SH ´ØÏ¢¹àÌÜ +.BR lseek (2), +.BR closedir (3), +.BR opendir (3), +.BR readdir (3), +.BR rewinddir (3), +.BR scandir (3), +.BR telldir (3) diff --git a/draft/man3/sem_close.3 b/draft/man3/sem_close.3 new file mode 100644 index 00000000..816183f5 --- /dev/null +++ b/draft/man3/sem_close.3 @@ -0,0 +1,95 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_CLOSE 3 2006-03-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sem_close \- close a named semaphore +sem_close \- ̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤ò¥¯¥í¡¼¥º¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_close(sem_t *" sem ); +.fi +.sp +.\"O Link with \fI\-lrt\fP or \fI\-pthread\fP. +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sem_close () +.\"O closes the named semaphore referred to by +.\"O .IR sem , +.\"O allowing any resources that the system has allocated to +.\"O the calling process for this semaphore to be freed. +.BR sem_close () +¤Ï +.I sem +¤¬»²¾È¤¹¤ë̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤ò¥¯¥í¡¼¥º¤·¡¢ +¤³¤Î¥»¥Þ¥Õ¥©ÍѤ˸ƤӽФ·¸µ¥×¥í¥»¥¹¤Ë¥·¥¹¥Æ¥à¤¬³ä¤êÅö¤Æ¤Æ¤¤¤¿ +¥ê¥½¡¼¥¹¤ò²òÊü¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success +.\"O .BR sem_close () +.\"O returns 0; on error, \-1 is returned, with +.\"O .I errno +.\"O set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_close () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O .I sem +.\"O is not a valid semaphore. +.I sem +¤ÏÍ­¸ú¤Ê¥»¥Þ¥Õ¥©¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O All open named semaphores are automatically closed on process +.\"O termination, or upon +.\"O .BR execve (2). +¥ª¡¼¥×¥ó¤µ¤ì¤¿¤¹¤Ù¤Æ¤Î̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤Ï¡¢¥×¥í¥»¥¹½ªÎ»»þ¡¢¤â¤·¤¯¤Ï +.BR execve (2) +¼Â¹Ô»þ¤Ë¼«Æ°Åª¤Ë¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sem_getvalue (3), +.BR sem_open (3), +.BR sem_post (3), +.BR sem_unlink (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/draft/man3/sem_destroy.3 b/draft/man3/sem_destroy.3 new file mode 100644 index 00000000..1ab32d8d --- /dev/null +++ b/draft/man3/sem_destroy.3 @@ -0,0 +1,117 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_DESTROY 3 2006-03-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sem_destroy \- destroy an unnamed semaphore +sem_destroy \- ̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤òÇË´þ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_destroy(sem_t *" sem ); +.fi +.sp +.\"O Link with \fI\-lrt\fP or \fI\-pthread\fP. +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sem_destroy () +.\"O destroys the unnamed semaphore at the address pointed to by +.\"O .IR sem . +.BR sem_destroy () +¤Ï +.I sem +¤¬»Ø¤¹¥¢¥É¥ì¥¹¤Ë¤¢¤ë̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤òÇË´þ¤¹¤ë¡£ + +.\"O Only a semaphore that has been initialized by +.\"O .BR sem_init (3) +.\"O should be destroyed using +.\"O .BR sem_destroy (). +.BR sem_destroy () +¤ò»È¤Ã¤ÆÇË´þ¤¹¤ë¤Î¤Ï¡¢ +.BR sem_init (3) +¤Ç½é´ü²½¤·¤¿¥»¥Þ¥Õ¥©¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O Destroying a semaphore that other processes or threads are +.\"O currently blocked on (in +.\"O .BR sem_wait (3)) +.\"O produces undefined behavior. +¾¤Î¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤¬ +.RB ( sem_wait (3) +¤Ç) ÂÔ¤Á¾õÂ֤ˤʤäƤ¤¤ë¥»¥Þ¥Õ¥©¤òÇË´þ¤·¤¿¾ì¹ç¤ÎµóÆ°¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"O Using a semaphore that has been destroyed produces undefined results, +.\"O until the semaphore has been reinitialized using +.\"O .BR sem_init (3). +¤¹¤Ç¤ËÇË´þ¤µ¤ì¤¿¥»¥Þ¥Õ¥©¤ò¡¢ +.BR sem_init (3) +¤ò»È¤Ã¤ÆºÆ½é´ü²½¤µ¤ì¤ëÁ°¤Ë»ÈÍѤ·¤¿¾ì¹ç¡¢¤½¤Î·ë²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O .BR sem_destroy () +.\"O returns 0 on success; +.\"O on error, \-1 is returned, and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_destroy () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O .I sem +.\"O is not a valid semaphore. +.I sem +¤ÏÍ­¸ú¤Ê¥»¥Þ¥Õ¥©¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O An unnamed semaphore should be destroyed with +.\"O .BR sem_destroy () +.\"O before the memory in which it is located is deallocated. +.\"O Failure to do this can result in resource leaks on some implementations. +.\"O .\" But not on NPTL, where sem_destroy () is a no-op.. +̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤Ï¡¢¤½¤Î¥»¥Þ¥Õ¥©¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¥á¥â¥ê¤¬²òÊü¤µ¤ì¤ëÁ°¤Ë¡¢ +.BR sem_destroy () +¤ò»È¤Ã¤ÆÇË´þ¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£¤³¤ì¤ò¹Ô¤ï¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¼ÂÁõ¤Ë¤è¤Ã¤Æ¤Ï +¥ê¥½¡¼¥¹¤Î¥ê¡¼¥¯¤¬µ¯¤³¤ê¤¨¤ë¡£ +.\" NPTL ¤Ç¤Ï¥ê¡¼¥¯¤Ïµ¯¤³¤é¤Ê¤¤¡£sem_destroy () ¤Ï²¿¤â¤·¤Ê¤¤¤À¤±.. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sem_init (3), +.BR sem_post (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/draft/man3/sem_getvalue.3 b/draft/man3/sem_getvalue.3 new file mode 100644 index 00000000..527340bc --- /dev/null +++ b/draft/man3/sem_getvalue.3 @@ -0,0 +1,112 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_GETVALUE 3 2006-03-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sem_getvalue \- get the value of a semaphore +sem_getvalue \- ¥»¥Þ¥Õ¥©¤ÎÃͤò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_getvalue(sem_t *" sem ", int *" sval ); +.fi +.sp +.\"O Link with \fI\-lrt\fP or \fI\-pthread\fP. +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sem_getvalue () +.\"O places the current value of the semaphore pointed to +.\"O .I sem +.\"O into the integer pointed to by +.\"O .IR sval . +.BR sem_getvalue () +¤Ï¡¢ +.I sem +¤¬»Ø¤¹¥»¥Þ¥Õ¥©¤Î¸½ºß¤ÎÃͤò +.I sval +¤Ç»Ø¤¹À°¿ô¤Ë³ÊǼ¤¹¤ë¡£ + +.\"O If one or more processes or threads are blocked +.\"O waiting to lock the semaphore with +.\"O .BR sem_wait (3), +.\"O POSIX.1-2001 permits two possibilities for the value returned in +.\"O .IR sval : +.\"O either 0 is returned; +.\"O or a negative number whose absolute value is the count +.\"O of the number of processes and threads currently blocked in +.\"O .BR sem_wait (3). +.\"O Linux adopts the former behavior. +POSIX.1-2001 ¤Ë¤è¤ë¤È¡¢ +1¤Ä°Ê¾å¤Î¥×¥í¥»¥¹¤«¥¹¥ì¥Ã¥É¤¬ +.BR sem_wait (3) +¤Ç¥»¥Þ¥Õ¥©¤Î¥í¥Ã¥¯ÂÔ¤Á¤ÇÄä»ß¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.I sval +¤ÇÊÖ¤µ¤ì¤ëÃÍ¤Ï 0 ¤â¤·¤¯¤ÏÉé¤ÎÃͤΤ¤¤º¤ì¤«¤È¤Ê¤ë¡£ +Éé¤ÎÃͤξì¹ç¡¢¤½¤ÎÀäÂÐÃÍ¤Ï +.BR sem_wait (3) +¤Ç¸½ºßÄä»ß¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤«¥¹¥ì¥Ã¥É¤Î¹ç·×¿ô¤ËÅù¤·¤¤¡£ +Linux ¤ÏÁ°¼Ô¤ÎÆ°ºî (0 ¤òÊÖ¤¹Æ°ºî) ¤òºÎÍѤ·¤Æ¤¤¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O .BR sem_getvalue () +.\"O returns 0 on success; +.\"O on error, \-1 is returned and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_getvalue () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O .I sem +.\"O is not a valid semaphore. +.I sem +¤ÏÍ­¸ú¤Ê¥»¥Þ¥Õ¥©¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The value of the semaphore may already have changed by the time +.\"O .BR sem_getvalue () +.\"O returns. +.BR sem_getvalue () +¤¬ÊÖ¤ë¤È¤­¤Ë¤Ï¡¢¤¹¤Ç¤Ë¥»¥Þ¥Õ¥©¤ÎÃͤÏÊѲ½¤·¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sem_post (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/draft/man3/sem_init.3 b/draft/man3/sem_init.3 new file mode 100644 index 00000000..5f18bcf2 --- /dev/null +++ b/draft/man3/sem_init.3 @@ -0,0 +1,165 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_INIT 3 2008-07-27 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sem_init \- initialize an unnamed semaphore +sem_init \- ̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤ò½é´ü²½¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_init(sem_t *" sem ", int " pshared ", unsigned int " value ); +.fi +.sp +.\"O Link with \fI\-lrt\fP or \fI\-pthread\fP. +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sem_init () +.\"O initializes the unnamed semaphore at the address pointed to by +.\"O .IR sem . +.\"O The +.\"O .I value +.\"O argument specifies the initial value for the semaphore. +.BR sem_init () +¤Ï¡¢ +.I sem +¤¬»Ø¤¹¥¢¥É¥ì¥¹¤Ë¤¢¤ë̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤ò½é´ü²½¤¹¤ë¡£ +.I value +°ú¤­¿ô¤Ï¤½¤Î¥»¥Þ¥Õ¥©¤Î½é´üÃͤò»ØÄꤹ¤ë¡£ + +.\"O The +.\"O .I pshared +.\"O argument indicates whether this semaphore is to be shared +.\"O between the threads of a process, or between processes. +.I pshared +°ú¤­¿ô¤Ï¡¢¤³¤Î¥»¥Þ¥Õ¥©¤¬¥×¥í¥»¥¹Æâ¤Î¥¹¥ì¥Ã¥É´Ö¤Ç¶¦Í­¤µ¤ì¤ë¤Î¤«¡¢ +¥×¥í¥»¥¹´Ö¤Ç¶¦Í­¤µ¤ì¤ë¤Î¤«¡¢¤ò¼¨¤¹¡£ + +.\"O If +.\"O .I pshared +.\"O has the value 0, +.\"O then the semaphore is shared between the threads of a process, +.\"O and should be located at some address that is visible to all threads +.\"O (e.g., a global variable, or a variable allocated dynamically on +.\"O the heap). +.I pshared +¤¬ 0 ¤Î¾ì¹ç¡¢¥»¥Þ¥Õ¥©¤Ï¥×¥í¥»¥¹Æâ¤Î¥¹¥ì¥Ã¥É´Ö¤Ç¶¦Í­¤µ¤ì¤ë¡£ +¥»¥Þ¥Õ¥©¤Ï¤¹¤Ù¤Æ¤Î¥¹¥ì¥Ã¥É¤«¤é»²¾È²Äǽ¤Ê¥¢¥É¥ì¥¹¤ËÇÛÃÖ¤¹¤Ù¤­¤Ç¤¢¤ë +(Î㤨¤Ð¡¢Âç°èÊÑ¿ô¤ä¡¢¥Ò¡¼¥×¾å¤ËưŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ÊÑ¿ô¤Ê¤É)¡£ + +.\"O If +.\"O .I pshared +.\"O is nonzero, then the semaphore is shared between processes, +.\"O and should be located in a region of shared memory (see +.\"O .BR shm_open (3), +.\"O .BR mmap (2), +.\"O and +.\"O .BR shmget (2)). +.\"O (Since a child created by +.\"O .BR fork (2) +.\"O inherits its parent's memory mappings, it can also access the semaphore.) +.\"O Any process that can access the shared memory region +.\"O can operate on the semaphore using +.\"O .BR sem_post (3), +.\"O .BR sem_wait (3), +.\"O etc. +.I pshared +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢¥»¥Þ¥Õ¥©¤Ï¥×¥í¥»¥¹´Ö¤Ç¶¦Í­¤µ¤ì¤ë¡£¥»¥Þ¥Õ¥©¤Ï +¶¦Í­¥á¥â¥êÎΰè¤ËÇÛÃÖ¤¹¤Ù¤­¤Ç¤¢¤ë +.RB ( shm_open (3), +.BR mmap (2), +.BR shmget (2) +»²¾È)¡£ +.RB ( fork (2) +¤ÇÀ¸À®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥á¥â¥ê¥Þ¥Ã¥Ô¥ó¥°¤ò·Ñ¾µ¤¹¤ë¤¿¤á¡¢ +»Ò¥×¥í¥»¥¹¤â¥»¥Þ¥Õ¥©¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£) +¶¦Í­¥á¥â¥êÎΰè¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¥×¥í¥»¥¹¤Ê¤é¤Ð¡¢¤É¤Î¥×¥í¥»¥¹¤Ç¤â +.BR sem_post (3) +¤ä +.BR sem_wait (3) +¤Ê¤É¤ò»È¤Ã¤Æ¥»¥Þ¥Õ¥©¤òÁàºî¤Ç¤­¤ë¡£ + +.\"O Initializing a semaphore that has already been initialized +.\"O results in undefined behavior. +¤¹¤Ç¤Ë½é´ü²½ºÑ¤Î¥»¥Þ¥Õ¥©¤ò½é´ü²½¤·¤¿¾ì¹ç¤ÎµóÆ°¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O .BR sem_init () +.\"O returns 0 on success; +.\"O on error, \-1 is returned, and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_init () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O .I value +.\"O exceeds +.\"O .BR SEM_VALUE_MAX . +.I value +¤¬ +.B SEM_VALUE_MAX +¤òĶ¤¨¤Æ¤¤¤ë¡£ +.TP +.B ENOSYS +.\"O .I pshared +.\"O is nonzero, +.\"O but the system does not support process-shared semaphores (see +.\"O .BR sem_overview (7)). +.I pshared +¤¬ 0 °Ê³°¤À¤¬¡¢¥·¥¹¥Æ¥à¤¬¥×¥í¥»¥¹¶¦Í­¥»¥Þ¥Õ¥©¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤ +.RB ( sem_overview (7) +»²¾È)¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Bizarrely, POSIX.1-2001 does not specify the value that should +.\"O be returned by a successful call to +.\"O .BR sem_init (). +.\"O POSIX.1-2008 rectifies this, specifying the zero return on success. +̯¤Ê¤³¤È¤Ë¡¢POSIX.1-2001 ¤Ï +.BR sem_init () +¤¬À®¸ù¤·¤¿¾ì¹ç¤ËÊÖ¤¹¤Ù¤­Ãͤòµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£ +POSIX.1-2008 ¤Ç¤Ï¤³¤ì¤¬½¤Àµ¤µ¤ì¡¢À®¸ù»þ¤Ë¤Ï 0 ¤òÊÖ¤¹¤³¤È¤¬µ¬Äꤵ¤ì¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sem_destroy (3), +.BR sem_post (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/draft/man3/sem_open.3 b/draft/man3/sem_open.3 new file mode 100644 index 00000000..4f1ceba8 --- /dev/null +++ b/draft/man3/sem_open.3 @@ -0,0 +1,289 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.19 +.\" +.TH SEM_OPEN 3 2009-02-20 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sem_open \- initialize and open a named semaphore +sem_open \- ̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤ò½é´ü²½¤·¡¢¥ª¡¼¥×¥ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.BR "#include " " /* For O_* constants */" +.BR "#include " " /* For mode constants */" +.B #include +.sp +.BI "sem_t *sem_open(const char *" name ", int " oflag ); +.BI "sem_t *sem_open(const char *" name ", int " oflag ", " +.BI " mode_t " mode ", unsigned int " value ); +.fi +.sp +.\"O Link with \fI\-lrt\fP or \fI\-pthread\fP. +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sem_open () +.\"O creates a new POSIX semaphore or opens an existing semaphore. +.\"O The semaphore is identified by +.\"O .IR name . +.\"O For details of the construction of +.\"O .IR name , +.\"O see +.\"O .BR sem_overview (7). +.BR sem_open () +¤Ï¡¢¿·µ¬¤Î POSIX ¥»¥Þ¥Õ¥©¤òºîÀ®¤¹¤ë¤«¡¢´û¸¤Î¥»¥Þ¥Õ¥©¤Î¥ª¡¼¥×¥ó¤ò¹Ô¤¦¡£ +¥»¥Þ¥Õ¥©¤Ï +.I name +¤Ç¼±Ê̤µ¤ì¤ë¡£ +.I name +¤Î¹½À®¤Î¾ÜºÙ¤Ï +.BR sem_overview (7) +¤ò»²¾È¡£ + +.\"O The +.\"O .I oflag +.\"O argument specifies flags that control the operation of the call. +.\"O (Definitions of the flags values can be obtained by including +.\"O .IR .) +.I oflag +°ú¤­¿ô¤Ë¤Ï¡¢ +.BR sem_open () +¤ÎÆ°ºî¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°¤ò»ØÄꤹ¤ë +(oflag ¤ÎÃͤÎÄêµÁ¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ë¤è¤êÆÀ¤é¤ì¤ë)¡£ +.\"O If +.\"O .B O_CREAT +.\"O is specified in +.\"O .IR oflag , +.\"O then the semaphore is created if +.\"O it does not already exist. +.\"O The owner (user ID) of the semaphore is set to the effective +.\"O user ID of the calling process. +.\"O The group ownership (group ID) is set to the effective group ID +.\"O of the calling process. +.\"O .\" In reality the file system IDs are used on Linux. +.I oflag +¤Ë +.B O_CREAT +¤¬»ØÄꤵ¤ì¤ë¤È¡¢¤Þ¤À¸ºß¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï¤½¤Î¥»¥Þ¥Õ¥©¤¬ºîÀ®¤µ¤ì¤ë¡£ +¥»¥Þ¥Õ¥©¤Î½êÍ­¼Ô (¥æ¡¼¥¶ ID)¡¢¥°¥ë¡¼¥×½êÍ­¸¢ (¥°¥ë¡¼¥× ID) ¤Ë¤Ï¡¢ +¤½¤ì¤¾¤ì¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID¡¢¼Â¸ú GID ¤¬ÀßÄꤵ¤ì¤ë¡£ +.\" ¼ÂºÝ¤Ï¡¢Linux ¤Ç¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID ¤¬»ÈÍѤµ¤ì¤ë¡£ +.\"O If both +.\"O .B O_CREAT +.\"O and +.\"O .B O_EXCL +.\"O are specified in +.\"O .IR oflag , +.\"O then an error is returned if a semaphore with the given +.\"O .I name +.\"O already exists. +.I oflag +¤Ë +.B O_CREAT +¤È +.B O_EXCL +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢»ØÄꤵ¤ì¤¿Ì¾Á° +.I name +¤Î¥»¥Þ¥Õ¥©¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¤È¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O If +.\"O .B O_CREAT +.\"O is specified in +.\"O .IR oflag , +.\"O then two additional arguments must be supplied. +.I oflag +¤Ë +.B O_CREAT +¤ò»ØÄꤹ¤ë¾ì¹ç¡¢¤µ¤é¤Ë°ú¤­¿ô¤¬ 2 ¤ÄɬÍפǤ¢¤ë¡£ +.\"O The +.\"O .I mode +.\"O argument specifies the permissions to be placed on the new semaphore, +.\"O as for +.\"O .BR open (2). +.\"O (Symbolic definitions for the permissions bits can be obtained by including +.\"O .IR .) +.\"O The permissions settings are masked against the process umask. +.\"O Both read and write permission should be granted to each class of +.\"O user that will access the semaphore. +.I mode +°ú¤­¿ô¤Ï¡¢ +.BR open (2) +¤ÈƱ¤¸¤è¤¦¤Ë¡¢¿·¤·¤¤¥»¥Þ¥Õ¥©¤ËÀßÄꤵ¤ì¤ë¥¢¥¯¥»¥¹µö²Ä (permission) ¤ò +»ØÄꤹ¤ë¡£µö²ÄÀßÄê¤Ï¥×¥í¥»¥¹¤Î umask ¤Ç¥Þ¥¹¥¯¤µ¤ì¤ë +(µö²Ä¥Ó¥Ã¥È¤Î¥·¥ó¥Ü¥ëÄêµÁ¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ë¤è¤êÆÀ¤é¤ì¤ë)¡£ +¥»¥Þ¥Õ¥©¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤¹¤ë¥æ¡¼¥¶¤Ï¡¢Æɤ߽Ф·µö²Ä¤È½ñ¤­¹þ¤ßµö²Ä¤Î +ξÊý¤òÆÀ¤ëɬÍפ¬¤¢¤ë¡£ +.\"O The +.\"O .I value +.\"O argument specifies the initial value for the new semaphore. +.\"O If +.\"O .B O_CREAT +.\"O is specified, and a semaphore with the given +.\"O .I name +.\"O already exists, then +.\"O .I mode +.\"O and +.\"O .I value +.\"O are ignored. +.I value +°ú¤­¿ô¤Ï¿·¤·¤¤¥»¥Þ¥Õ¥©¤Î½é´üÃͤò»ØÄꤹ¤ë¡£ +.B O_CREAT +¤¬»ØÄꤵ¤ì¡¢»ØÄꤷ¤¿Ì¾Á° +.I name +¤Î¥»¥Þ¥Õ¥©¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢ +.I mode +¤È +.I value +¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR sem_open () +.\"O returns the address of the new semaphore; +.\"O this address is used when calling other semaphore-related functions. +.\"O On error, +.\"O .BR sem_open () +.\"O returns +.\"O .BR SEM_FAILED , +.\"O with +.\"O .I errno +.\"O set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_open () +¤Ï¿·¤·¤¤¥»¥Þ¥Õ¥©¤Î¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£ +¤³¤Î¥¢¥É¥ì¥¹¤Ï¾¤Î¥»¥Þ¥Õ¥©´ØÏ¢¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë»ÈÍѤµ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR sem_open () +¤Ï +.B SEM_FAILED +¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O The semaphore exists, but the caller does not have permission to +.\"O open it. +¤½¤Î¥»¥Þ¥Õ¥©¤¬Â¸ºß¤¹¤ë¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¤Ë¤Ï¤½¤Î¥»¥Þ¥Õ¥©¤ò¥ª¡¼¥×¥ó¤¹¤ë +µö²Ä¤¬¤Ê¤¤¡£ +.TP +.B EEXIST +.\"O Both +.\"O .B O_CREAT +.\"O and +.\"O .B O_EXCL +.\"O were specified in +.\"O .IR oflag , +.\"O but a semaphore with this +.\"O .I name +.\"O already exists. +.I oflag +¤Ë +.B O_CREAT +¤È +.B O_EXCL +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¤¬¡¢ +.I name +¤È¤¤¤¦Ì¾Á°¤Î¥»¥Þ¥Õ¥©¤Ï¤¹¤Ç¤Ë¸ºß¤¹¤ë¡£ +.TP +.B EINVAL +.\"O .I value +.\"O was greater than +.\"O .BR SEM_VALUE_MAX . +.I value +¤¬ +.B SEM_VALUE_MAX +¤è¤ê¤âÂ礭¤¤¡£ +.TP +.B EINVAL +.\"O .I name +.\"O consists of just "/", followed by no other characters. +.I name +¤¬ "/" ¤À¤±¤Ç¹½À®¤µ¤ì¡¢¤½¤Î¸å¤í¤Ë¾¤Îʸ»ú¤¬Â³¤¤¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B EMFILE +.\"O The process already has the maximum number of files and open. +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¿ô¤¬¤¹¤Ç¤Ë¤½¤Î¥×¥í¥»¥¹¤Ë¤ª¤±¤ë¾å¸Â¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENAMETOOLONG +.\"O .I name +.\"O was too long. +.I name +¤¬Ä¹¤¹¤®¤ë¡£ +.TP +.B ENFILE +.\"O The system limit on the total number of open files has been reached. +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ëÁí¿ô¤¬¥·¥¹¥Æ¥àÁ´ÂΤǤξå¸Â¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENOENT +.\"O The +.\"O .B O_CREAT +.\"O flag was not specified in +.\"O .IR oflag +.\"O and no semaphore with this +.\"O .I name +.\"O exists; +.I oflag +¤Ë +.B O_CREAT +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤ª¤é¤º¡¢ +.I name +¤È¤¤¤¦Ì¾Á°¤Î¥»¥Þ¥Õ¥©¤â¸ºß¤·¤Ê¤¤¡£ +.\"O or, +¤Þ¤¿¤Ï¡¢ +.\" this error can occur if we have a name of the (nonportable) form +.\" /dir/name, and the directory /dev/shm/dir does not exist. +.\"O .B O_CREAT +.\"O was specified, but +.\"O .I name +.\"O wasn't well formed. +.B O_CREAT +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢ +.I name +¤¬Å¬ÀڤʷÁ¼°¤Ç¤Ï¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O Insufficient memory. +½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sem_close (3), +.BR sem_getvalue (3), +.BR sem_post (3), +.BR sem_unlink (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/draft/man3/sem_post.3 b/draft/man3/sem_post.3 new file mode 100644 index 00000000..9a15edab --- /dev/null +++ b/draft/man3/sem_post.3 @@ -0,0 +1,108 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_POST 3 2009-03-30 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sem_post \- unlock a semaphore +sem_post \- ¥»¥Þ¥Õ¥©¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_post(sem_t *" sem ); +.fi +.sp +.\"O Link with \fI\-lrt\fP or \fI\-pthread\fP. +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sem_post () +.\"O increments (unlocks) the semaphore pointed to by +.\"O .IR sem . +.\"O If the semaphore's value consequently becomes greater than zero, +.\"O then another process or thread blocked in a +.\"O .BR sem_wait (3) +.\"O call will be woken up and proceed to lock the semaphore. +.BR sem_post () +¤Ï¡¢ +.I sem +¤¬»Ø¤¹¥»¥Þ¥Õ¥©¤ÎÃͤò 1 Áý¤ä¤¹ (¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë)¡£¤½¤Î·ë²Ì¡¢ +¥»¥Þ¥Õ¥©¤ÎÃÍ¤Ï 0 ¤è¤êÂ礭¤ÊÃͤËÊѲ½¤·¡¢ +.BR sem_wait (3) +¤ÇÄä»ß¤·¤Æ¤¤¤ëÊÌ¤Î¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤¬¸Æ¤Óµ¯¤³¤µ¤ì¡¢ +¥»¥Þ¥Õ¥©¤ò¥í¥Ã¥¯¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O .BR sem_post () +.\"O returns 0 on success; +.\"O on error, the value of the semaphore is left unchanged, +.\"O \-1 is returned, and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_post () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢¥»¥Þ¥Õ¥©¤ÎÃͤÏÊѹ¹¤»¤º¤Ë¡¢ \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O .I sem +.\"O is not a valid semaphore. +.I sem +¤ÏÍ­¸ú¤Ê¥»¥Þ¥Õ¥©¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EOVERFLOW +.\" Added in POSIX.1-2008 TC1 (Austin Interpretation 213) +.\"O The maximum allowable value for a semaphore would be exceeded. +°ì¤Ä¤Î¥»¥Þ¥Õ¥©¤Ç»ÈÍѤǤ­¤ëºÇÂçÃͤòĶ¤¨¤Æ¤·¤Þ¤¦¤È¤³¤í¤Ç¤¢¤Ã¤¿¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O .BR sem_post () +.\"O is async-signal-safe: +.\"O it may be safely called within a signal handler. +.BR sem_post () +¤Ï async-signal-safe ¤Ç¤¢¤ë¡£ +¤Ä¤Þ¤ê¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÃæ¤Ç¤â°ÂÁ´¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O See +.\"O .BR sem_wait (3). +.BR sem_wait (3) +»²¾È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sem_getvalue (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/draft/man3/sem_unlink.3 b/draft/man3/sem_unlink.3 new file mode 100644 index 00000000..c37cefa2 --- /dev/null +++ b/draft/man3/sem_unlink.3 @@ -0,0 +1,99 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_UNLINK 3 2006-03-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sem_unlink \- remove a named semaphore +sem_unlink \- ̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤òºï½ü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_unlink(const char *" name ); +.fi +.sp +.\"O Link with \fI\-lrt\fP or \fI\-pthread\fP. +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sem_unlink () +.\"O removes the named semaphore referred to by +.\"O .IR name . +.\"O The semaphore name is removed immediately. +.\"O The semaphore is destroyed once all other processes that have +.\"O the semaphore open close it. +.BR sem_unlink () +¤Ï¡¢ +.I name +¤Ç»²¾È¤µ¤ì¤ë̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤òºï½ü¤¹¤ë¡£ +¥»¥Þ¥Õ¥©¤Î̾Á°¤Ïľ¤Á¤Ëºï½ü¤µ¤ì¤ë¡£ +¤³¤Î¥»¥Þ¥Õ¥©¤ò¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¾¤Î¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤¬¥»¥Þ¥Õ¥©¤ò +ÊĤ¸¤Æ½é¤á¤Æ¥»¥Þ¥Õ¥©¤Îºï½ü¤¬¹Ô¤ï¤ì¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success +.\"O .BR sem_unlink () +.\"O returns 0; on error, \-1 is returned, with +.\"O .I errno +.\"O set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_unlink () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O The caller does not have permission to unlink this semaphore. +¸Æ¤Ó½Ð¤·¸µ¤Ë¤Ï¤³¤Î¥»¥Þ¥Õ¥©¤òºï½ü¤¹¤ëµö²Ä¤¬¤Ê¤¤¡£ +.TP +.B ENAMETOOLONG +.\"O .I name +.\"O was too long. +.I name +¤¬Ä¹¤¹¤®¤ë¡£ +.TP +.B ENOENT +.\"O There is no semaphore with the given +.\"O .IR name . +»ØÄꤵ¤ì¤¿Ì¾Á° +.I name +¤Î¥»¥Þ¥Õ¥©¤¬Â¸ºß¤·¤Ê¤¤¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sem_getvalue (3), +.BR sem_open (3), +.BR sem_post (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/draft/man3/sem_wait.3 b/draft/man3/sem_wait.3 new file mode 100644 index 00000000..87dc9292 --- /dev/null +++ b/draft/man3/sem_wait.3 @@ -0,0 +1,375 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_WAIT 3 2010-02-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sem_wait, sem_timedwait, sem_trywait \- lock a semaphore +sem_wait, sem_timedwait, sem_trywait \- ¥»¥Þ¥Õ¥©¤ò¥í¥Ã¥¯¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_wait(sem_t *" sem ); +.sp +.BI "int sem_trywait(sem_t *" sem ); +.sp +.BI "int sem_timedwait(sem_t *" sem ", const struct timespec *" abs_timeout ); +.fi +.sp +.sp +.\"O Link with \fI\-lrt\fP or \fI\-pthread\fP. +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.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 sem_timedwait (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR sem_wait () +.\"O decrements (locks) the semaphore pointed to by +.\"O .IR sem . +.\"O If the semaphore's value is greater than zero, +.\"O then the decrement proceeds, and the function returns, immediately. +.\"O If the semaphore currently has the value zero, +.\"O then the call blocks until either it becomes possible to perform +.\"O the decrement (i.e., the semaphore value rises above zero), +.\"O or a signal handler interrupts the call. +.BR sem_wait () +¤Ï +.I sem +¤¬»Ø¤¹¥»¥Þ¥Õ¥©¤ÎÃͤò 1 ¸º¤é¤¹ (¥í¥Ã¥¯¤¹¤ë)¡£ +¥»¥Þ¥Õ¥©¤ÎÃͤ¬ 0 ¤è¤êÂ礭¤¤¾ì¹ç¡¢¸º»»¤¬¼Â¹Ô¤µ¤ì¡¢´Ø¿ô¤Ïľ¤Á¤ËÉüµ¢¤¹¤ë¡£ +¥»¥Þ¥Õ¥©¤Î¸½ºßÃͤ¬ 0 ¤Î¾ì¹ç¤Ë¤Ï¡¢¸º»»¤ò¼Â¹Ô¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë +(¤Ä¤Þ¤ê¡¢¥»¥Þ¥Õ¥©¤ÎÃͤ¬ 0 ¤è¤êÂ礭¤ÊÃͤˤʤë) ¤Þ¤Ç¡¢¤â¤·¤¯¤Ï +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤·¤¬ÃæÃǤµ¤ì¤ë¤Þ¤Ç¡¢ +´Ø¿ô¸Æ¤Ó½Ð¤·¤ÏÄä»ß (block) ¤¹¤ë¡£ + +.\"O .BR sem_trywait () +.\"O is the same as +.\"O .BR sem_wait (), +.\"O except that if the decrement cannot be immediately performed, +.\"O then call returns an error +.\"O .RI ( errno +.\"O set to +.\"O .BR EAGAIN ) +.\"O instead of blocking. +.BR sem_trywait () +¤Ï +.BR sem_wait () +¤ÈƱ¤¸¤À¤¬¡¢¥»¥Þ¥Õ¥©Ãͤθº»»¤ò¤¹¤°¤Ë¼Â¹Ô¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¡¢ +Ää»ß (block) ¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¥¨¥é¡¼¤ÇÉüµ¢¤¹¤ë +.RI ( errno +¤Ë +.B EAGAIN +¤¬¥»¥Ã¥È¤µ¤ì¤ë) ÅÀ¤¬°Û¤Ê¤ë¡£ + +.\"O .BR sem_timedwait () +.\"O is the same as +.\"O .BR sem_wait (), +.\"O except that +.\"O .I abs_timeout +.\"O specifies a limit on the amount of time that the call +.\"O should block if the decrement cannot be immediately performed. +.\"O The +.\"O .I abs_timeout +.\"O argument points to a structure that specifies an absolute timeout +.\"O in seconds and nanoseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). +.\"O This structure is defined as follows: +.BR sem_timedwait () +¤Ï +.BR sem_wait () +¤ÈƱ¤¸¤À¤¬¡¢¥»¥Þ¥Õ¥©Ãͤθº»»¤ò¤¹¤°¤Ë¼Â¹Ô¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë +´Ø¿ô¸Æ¤Ó½Ð¤·¤¬Ää»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤ò +.I abs_timeout +¤Ç»ØÄꤹ¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +.I abs_timeout +°ú¤­¿ô¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥È»þ¹ï¤ò»ØÄꤹ¤ë¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤³¤Î¹½Â¤ÂΤˤϡ¢¥¿¥¤¥à¥¢¥¦¥È»þ¹ï¤ò»þ¹ïµª¸µ (Epoch; +1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤Î +·Ð²á»þ´Ö (ÉáܥʥÎÉÃ) ¤Ç»ØÄꤹ¤ë¡£ +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: + +.nf +.in +4n +struct timespec { + time_t tv_sec; /* Seconds */ + long tv_nsec; /* Nanoseconds [0 .. 999999999] */ +}; +.in +.fi +.PP +.\"O If the timeout has already expired by the time of the call, +.\"O and the semaphore could not be locked immediately, +.\"O then +.\"O .BR sem_timedwait () +.\"O fails with a timeout error +.\"O .RI ( errno +.\"O set to +.\"O .BR ETIMEDOUT ). +´Ø¿ô¸Æ¤Ó½Ð¤·»þÅÀ¤Ç¤¹¤Ç¤Ë¥¿¥¤¥à¥¢¥¦¥È¤Ë»ØÄꤷ¤¿»þ¹ï¤¬²á¤®¤Æ¤ª¤ê¡¢ +¤«¤Ä¥»¥Þ¥Õ¥©¤ò¤¹¤°¤Ë¥í¥Ã¥¯¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +.BR sem_timedwait () +¤Ï¥¿¥¤¥à¥¢¥¦¥È¥¨¥é¡¼ +.RI ( errno +¤Ë +.B ETIMEDOUT +¤¬¥»¥Ã¥È¤µ¤ì¤ë) ¤Ç¼ºÇÔ¤¹¤ë¡£ + +.\"O If the operation can be performed immediately, then +.\"O .BR sem_timedwait () +.\"O never fails with a timeout error, regardless of the value of +.\"O .IR abs_timeout . +.\"O Furthermore, the validity of +.\"O .I abs_timeout +.\"O is not checked in this case. +¥»¥Þ¥Õ¥©Áàºî¤¬¤¹¤°¤Ë¼Â¹Ô¤Ç¤­¤ë¤È¤­¤Ï¡¢ +.I abs_timeout +¤¬¤É¤ó¤ÊÃͤǤ¢¤Ã¤Æ¤â +.BR sem_timedwait () +¤¬¼ºÇÔ¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£¤µ¤é¤Ë¤¤¤¦¤È¡¢¤³¤Î¾ì¹ç¤Ë¤Ï +.I abs_timeout +¤ÎÀµÅöÀ­¤Î¸¡ºº¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O All of these functions return 0 on success; +.\"O on error, the value of the semaphore is left unchanged, +.\"O \-1 is returned, and +.\"O .I errno +.\"O is set to indicate the error. +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¥»¥Þ¥Õ¥©¤ÎÃͤòÊѹ¹¤»¤º¤Ë¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINTR +.\"O The call was interrupted by a signal handler; see +.\"O .BR signal (7). +¸Æ¤Ó½Ð¤·¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤êÃæÃǤµ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.\"O .I sem +.\"O is not a valid semaphore. +.I sem +¤ÏÍ­¸ú¤Ê¥»¥Þ¥Õ¥©¤Ç¤Ê¤¤¡£ +.PP +.\"O The following additional error can occur for +.\"O .BR sem_trywait (): +.BR sem_trywait () +¤Î¾ì¹ç¤Ë¤Ï¡¢¾åµ­¤Ë²Ã¤¨¤Æ°Ê²¼¤Î¥¨¥é¡¼¤âµ¯¤³¤ë¡£ +.TP +.B EAGAIN +.\"O The operation could not be performed without blocking (i.e., the +.\"O semaphore currently has the value zero). +Ää»ß (block) ¤»¤º¤Ë¥í¥Ã¥¯Áàºî¤ò´°Î»¤Ç¤­¤Ê¤«¤Ã¤¿ (¤Ä¤Þ¤ê¡¢ +¥»¥Þ¥Õ¥©¤Î¸½ºß¤ÎÃͤ¬ 0 ¤Ç¤¢¤Ã¤¿)¡£ +.PP +.\"O The following additional errors can occur for +.\"O .BR sem_timedwait (): +.BR sem_timedwait () +¤Î¾ì¹ç¡¢°Ê²¼¤Î¥¨¥é¡¼¤âµ¯¤³¤ë¡£ +.TP +.B EINVAL +.\"O The value of +.\"O .I abs_timeout.tv_nsecs +.\"O is less than 0, or greater than or equal to 1000 million. +.I abs_timeout.tv_nsecs +¤ÎÃͤ¬ 0 ̤Ëþ¡¢¤â¤·¤¯¤Ï 1,000,000,000 °Ê¾å¤Ç¤¢¤ë¡£ +.TP +.B ETIMEDOUT +.\"O The call timed out before the semaphore could be locked. +¥»¥Þ¥Õ¥©¤Î¥í¥Ã¥¯¤ËÀ®¸ù¤¹¤ëÁ°¤Ë»þ´ÖÀÚ¤ì¤È¤Ê¤Ã¤¿¡£ +.\"O .\" POSIX.1-2001 also allows EDEADLK -- "A deadlock condition +.\"O .\" was detected", but this does not occur on Linux(?). +.\" POSIX.1-2001 ¤Ç¤Ï¥¨¥é¡¼¤È¤·¤Æ EDEADLK ¤âÍÑ°Õ¤·¤Æ¤¤¤ë¡£ +.\" ¤³¤ì¤Ï¥Ç¥Ã¥É¥í¥Ã¥¯¾ò·ï¤ò¸¡½Ð¤·¤¿¤³¤È¤ò¼¨¤¹¤â¤Î¤À¤¬¡¢ +.\" Linux ¤ÇȯÀ¸¤¹¤ë¤³¤È¤Ï¤Ê¤¤(?) +.\"O .SH CONFORMING TO +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O A signal handler always interrupts a blocked call to +.\"O one of these functions, regardless of the use of the +.\"O .BR sigaction (2) +.\"O .B SA_RESTART +.\"O flag. +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ï¡¢ +.BR sigaction (2) +¤Î +.B SA_RESTART +¥Õ¥é¥°¤ò»ÈÍѤ·¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ë´Ø¤ï¤é¤º¡¢¤³¤ì¤é¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤¬ +Ää»ß¤·¤Æ¤¤¤ë¾ì¹ç¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê¾ï¤ËÃæÃǤµ¤ì¤ë¡£ +.\"O .\" sem_wait() is always interrupted on most other implementations, +.\"O .\" but on FreeBSD 5.4 SA_RESTART does cause restarting. +.\" sem_wait() ¤Ï¾¤Î¤Û¤È¤ó¤É¤Î¼ÂÁõ¤Ç¤Ï¾ï¤ËÃæÃǤµ¤ì¤ë¤¬¡¢ +.\" FreeBSD 5.4 ¤Ç¤Ï SA_RESTART ¤ò»ØÄꤷ¤Æ¤ª¤¯¤È¼Â¹Ô¤¬ºÆ³«¤µ¤ì¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.PP +.\"O The (somewhat trivial) program shown below operates on an +.\"O unnamed semaphore. +.\"O The program expects two command-line arguments. +.\"O The first argument specifies a seconds value that is used to +.\"O set an alarm timer to generate a +.\"O .B SIGALRM +.\"O signal. +.\"O This handler performs a +.\"O .BR sem_post (3) +.\"O to increment the semaphore that is being waited on in +.\"O .I main() +.\"O using +.\"O .BR sem_timedwait (). +.\"O The second command-line argument specifies the length +.\"O of the timeout, in seconds, for +.\"O .BR sem_timedwait (). +.\"O The following shows what happens on two different runs of the program: +°Ê²¼¤Ë¼¨¤¹ (¤Á¤ç¤Ã¤È¤·¤¿) ¥×¥í¥°¥é¥à¤Ï̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤ÎÁàºî¤ò¹Ô¤¦¡£ +¥×¥í¥°¥é¥à¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ò 2 ¤Ä¼è¤ë¡£ +ºÇ½é¤Î°ú¤­¿ô¤Ë¤Ï¡¢ +.B SIGALRM +¥·¥°¥Ê¥ë¤òÀ¸À®¤¹¤ë¤¿¤á¤Î¥¢¥é¡¼¥à¥¿¥¤¥Þ¡¼¤ÎÀßÄê¤Ë»È¤ï¤ì¤ëÃͤò +ÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£¤³¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ï¡¢ +.I main() +Æâ¤Ç +.BR sem_timedwait () +¤ò»È¤Ã¤ÆÂԤäƤ¤¤ë¥»¥Þ¥Õ¥©¤ò¡¢ +.BR sem_post (3) +¤ò»È¤Ã¤Æ²Ã»»¤¹¤ë¡£ +2ÈÖÌܤΰú¤­¿ô¤Ë¤Ï¡¢ +.BR sem_timedwait () +¤ËÅϤ¹¥¿¥¤¥à¥¢¥¦¥È¤Þ¤Ç¤Î»þ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ + +.in +4n +.nf +.RB "$" " ./a.out 2 3" +About to call sem_timedwait() +sem_post() from handler +sem_getvalue() from handler; value = 1 +sem_timedwait() succeeded +.RB "$" " ./a.out 2 1" +About to call sem_timedwait() +sem_timedwait() timed out +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include +#include +#include +#include +#include + +sem_t sem; + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +static void +handler(int sig) +{ + write(STDOUT_FILENO, "sem_post() from handler\\n", 24); + if (sem_post(&sem) == \-1) { + write(STDERR_FILENO, "sem_post() failed\\n", 18); + _exit(EXIT_FAILURE); + } +} + +int +main(int argc, char *argv[]) +{ + struct sigaction sa; + struct timespec ts; + int s; + + if (argc != 3) { + fprintf(stderr, "Usage: %s \\n", + argv[0]); + exit(EXIT_FAILURE); + } + + if (sem_init(&sem, 0, 0) == \-1) + handle_error("sem_init"); + + /* Establish SIGALRM handler; set alarm timer using argv[1] */ + + sa.sa_handler = handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + if (sigaction(SIGALRM, &sa, NULL) == \-1) + handle_error("sigaction"); + + alarm(atoi(argv[1])); + + /* Calculate relative interval as current time plus + number of seconds given argv[2] */ + + if (clock_gettime(CLOCK_REALTIME, &ts) == \-1) + handle_error("clock_gettime"); + + ts.tv_sec += atoi(argv[2]); + + printf("main() about to call sem_timedwait()\\n"); + while ((s = sem_timedwait(&sem, &ts)) == \-1 && errno == EINTR) + continue; /* Restart if interrupted by handler */ + + /* Check what happened */ + + if (s == \-1) { + if (errno == ETIMEDOUT) + printf("sem_timedwait() timed out\\n"); + else + perror("sem_timedwait"); + } else + printf("sem_timedwait() succeeded\\n"); + + exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR clock_gettime (2), +.BR sem_getvalue (3), +.BR sem_post (3), +.BR sem_overview (7), +.BR time (7) diff --git a/draft/man3/setaliasent.3 b/draft/man3/setaliasent.3 new file mode 100644 index 00000000..325d278a --- /dev/null +++ b/draft/man3/setaliasent.3 @@ -0,0 +1,220 @@ +.\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Polished a bit, added a little, aeb +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Sep 5 20:44:27 JST 2004 +.\" by Yuichi SATO +.\" +.TH SETALIASENT 3 2003-09-09 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O setaliasent, endaliasent, getaliasent, getaliasent_r, +.\"O getaliasbyname, getaliasbyname_r \- read an alias entry +setaliasent, endaliasent, getaliasent, getaliasent_r, getaliasbyname, getaliasbyname_r \- ¥¨¥¤¥ê¥¢¥¹¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B "void setaliasent(void);" +.sp +.B "void endaliasent(void);" +.sp +.B "struct aliasent *getaliasent(void);" +.sp +.BI "int getaliasent_r(struct aliasent *" result "," +.br +.BI " char *" buffer ", size_t " buflen ", struct aliasent **" res ); +.sp +.BI "struct aliasent *getaliasbyname(const char *" name ); +.sp +.BI "int getaliasbyname_r(const char *" name ", struct aliasent *" result , +.br +.BI " char *" buffer ", size_t " buflen ", struct aliasent **" res ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O One of the databases available with the Name Service Switch (NSS) +.\"O is the aliases database, that contains mail aliases. +.\"O (To find out which databases are supported, try getent \-\-help .) +¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥¹¥¤¥Ã¥Á (Name Service Switch, NSS) ¤Ç +ÍøÍѲÄǽ¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î 1 ¤Ä¤È¤·¤Æ¡¢ +¥á¡¼¥ë¥¨¥¤¥ê¥¢¥¹¤òÊÝ»ý¤¹¤ë¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¤¢¤ë¡£ +(¤É¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤òÄ´¤Ù¤ë¤Ë¤Ï¡¢ +getent \-\-help ¤ò¼Â¹Ô¤¹¤ë¤³¤È¡£) +.\"O Six functions are provided to access the aliases database. +¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Ë¡¢ +6 ¤Ä¤Î´Ø¿ô¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O The +.\"O .BR getaliasent () +.\"O function returns a pointer to a structure containing +.\"O the group information from the aliases database. +.BR getaliasent () +´Ø¿ô¤Ï¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¼è¤ê½Ð¤·¤¿ +¥°¥ë¡¼¥×¾ðÊó¤ò´Þ¤à¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O The first time it is called it returns the first entry; +.\"O thereafter, it returns successive entries. +1 ²óÌܤ˴ؿô¤¬¸Æ¤Ð¤ì¤¿¤È¤­¤Ë¤Ï¡¢ºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹; +¤½¤ì°Ê¹ß¤Ï¤½¤Î¸å¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR setaliasent () +.\"O function rewinds the file pointer to the beginning of the +.\"O aliases database. +.BR setaliasent () +´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤ò¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀèƬ¤Ë´¬¤­Ì᤹¡£ +.PP +.\"O The +.\"O .BR endaliasent () +.\"O function closes the aliases database. +.BR endaliasent () +´Ø¿ô¤Ï¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +.\"O .BR getaliasent_r () +.\"O is the reentrant version of the previous function. +.\"O The requested structure +.\"O is stored via the first argument but the programmer needs to fill the other +.\"O arguments also. +.\"O Not providing enough space causes the function to fail. +.BR getaliasent_r () +´Ø¿ô¤Ï¾åµ­¤Î´Ø¿ô¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤ¢¤ë¡£ +Í׵ᤵ¤ì¤¿¹½Â¤ÂΤÏÂè 1 °ú¤­¿ô¤Ë³ÊǼ¤µ¤ì¤ë¤¬¡¢ +¥×¥í¥°¥é¥Þ¤Ï¾¤Î°ú¤­¿ô¤âËä¤á¤Æ¤ä¤ëɬÍפ¬¤¢¤ë¡£ +½¼Ê¬¤ÊÎΰ褬Ϳ¤¨¤é¤ì¤Ê¤¤¤È¡¢¤³¤Î´Ø¿ô¤Ï¼ºÇÔ¤¹¤ë¡£ +.PP +.\"O The function +.\"O .BR getaliasbyname () +.\"O takes the name argument and searches the aliases database. +.\"O The entry is returned as a pointer to a +.\"O .IR "struct aliasent" . +´Ø¿ô +.BR getaliasbyname () +¤Ï name °ú¤­¿ô¤ò¤È¤ê¡¢¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¸¡º÷¤¹¤ë¡£ +¥¨¥ó¥È¥ê¤Ï +.I "struct aliasent" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤·¤ÆÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O .BR getaliasbyname_r () +.\"O is the reentrant version of the previous function. +.\"O The requested structure +.\"O is stored via the second argument but the programmer needs to fill the other +.\"O arguments also. +.\"O Not providing enough space causes the function to fail. +.BR getaliasbyname_r () +¤Ï¾åµ­¤Î´Ø¿ô¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤ¢¤ë¡£ +Í׵ᤵ¤ì¤¿¹½Â¤ÂΤÏÂè 2 °ú¤­¿ô¤Ë³ÊǼ¤µ¤ì¤ë¤¬¡¢ +¥×¥í¥°¥é¥Þ¤Ï¾¤Î°ú¤­¿ô¤âËä¤á¤Æ¤ä¤ëɬÍפ¬¤¢¤ë¡£ +½¼Ê¬¤ÊÎΰ褬Ϳ¤¨¤é¤ì¤Ê¤¤¤È¡¢¤³¤Î´Ø¿ô¤Ï¼ºÇÔ¤¹¤ë¡£ +.PP +.\"O The +.\"O .I "struct aliasent" +.\"O is defined in +.\"O .IR : +.I "struct aliasent" +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.in +4n +.nf + +struct aliasent { +.\"O char *alias_name; /* alias name */ +.\"O size_t alias_members_len; +.\"O char **alias_members; /* alias name list */ +.\"O int alias_local; + char *alias_name; /* ¥¨¥¤¥ê¥¢¥¹Ì¾ */ + size_t alias_members_len; + char **alias_members; /* ¥¨¥¤¥ê¥¢¥¹Ì¾¤Î¥ê¥¹¥È */ + int alias_local; +}; +.fi +.in +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The functions +.\"O .BR getaliasent_r () +.\"O and +.\"O .BR getaliasbyname_r () +.\"O return a nonzero value on error. +´Ø¿ô +.BR getaliasent_r () +¤È +.BR getaliasbyname_r () +¤Ï¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.\"O The default alias database is the file +.\"O .IR /etc/aliases . +¥Ç¥Õ¥©¥ë¥È¤Î¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ï¡¢¥Õ¥¡¥¤¥ë +.I /etc/aliases +¤Ç¤¢¤ë¡£ +.\"O This can be changed in the +.\"O .I /etc/nsswitch.conf +.\"O file. +¤³¤ì¤Ï +.I /etc/nsswitch.conf +¥Õ¥¡¥¤¥ë¤ÇÊѹ¹¤Ç¤­¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These routines are glibc-specific. +¤³¤Î¥ë¡¼¥Á¥ó¤Ï glibc ¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.\"O The NeXT has similar routines: +NeXT ¤Ë¤ÏƱÍͤΥ롼¥Á¥ó¤¬¤¢¤ë¡£ +.in +4n +.sp +.nf + +#include + +void alias_setent(void); +void alias_endent(void); +alias_ent *alias_getent(void); +alias_ent *alias_getbyname(char *name); +.fi +.in +.\"O .SH EXAMPLE +.SH Îã +.\"O The following example compiles with +.\"O .IR "gcc example.c -o example" . +°Ê²¼¤ÎÎã¤Ï +.I "gcc example.c -o example" +¤Ç¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤ë¡£ +.\"O It will dump all names in the alias database. +¤³¤ì¤Ï¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤¢¤ëÁ´¤Æ¤Î̾Á°¤ò¥À¥ó¥×¤¹¤ë¡£ +.sp +.nf +#include +#include +#include +#include + +int +main(void) +{ + struct aliasent *al; + setaliasent(); + for (;;) { + al = getaliasent(); + if (al == NULL) + break; + printf("Name: %s\\n", al\->alias_name); + } + if (errno) { + perror("reading alias"); + exit(EXIT_FAILURE); + } + endaliasent(); + exit(EXIT_SUCCESS); +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getgrent (3), +.BR getpwent (3), +.BR getspent (3), +.BR aliases (5) +.\" +.\" /etc/sendmail/aliases +.\" Yellow Pages +.\" newaliases, postalias diff --git a/draft/man3/setbuf.3 b/draft/man3/setbuf.3 new file mode 100644 index 00000000..ca51bc22 --- /dev/null +++ b/draft/man3/setbuf.3 @@ -0,0 +1,312 @@ +.\" +.\" Japanese Version Copyright (c) 1999 ishikawa, keisuke +.\" all rights reserved. +.\" Translated Thu Jan 7 00:03:12 JST 1999 +.\" by ishikawa, keisuke +.\" Updated Sat May 19 JST 2001 by Kentaro Shirakata +.\" Updated & Modified Sun Jul 1 15:48:32 JST 2001 +.\" by Yuichi SATO +.\" +.\" Copyright (c) 1980, 1991 Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)setbuf.3 6.10 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 14:55:24 1993, faith@cs.unc.edu +.\" Added section to BUGS, Sun Mar 12 22:28:33 MET 1995, +.\" Thomas.Koenig@ciw.uni-karlsruhe.de +.\" Correction, Sun, 11 Apr 1999 15:55:18, +.\" Martin Vicente +.\" Correction, 2000-03-03, Andreas Jaeger +.\" Added return value for setvbuf, aeb, +.\" +.TH SETBUF 3 2008-06-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O setbuf, setbuffer, setlinebuf, setvbuf \- stream buffering operations +.SH ̾Á° +setbuf, setbuffer, setlinebuf, setvbuf \- ¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ÎÁàºî +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "void setbuf(FILE *" stream ", char *" buf ); + +.BI "void setbuffer(FILE *" stream ", char *" buf ", size_t " size ); + +.BI "void setlinebuf(FILE *" stream ); + +.BI "int setvbuf(FILE *" stream ", char *" buf ", int " mode \ +", 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 +.BR setbuffer (), +.BR setlinebuf (): +_BSD_SOURCE +.\"O .SH DESCRIPTION +.\"O The three types of buffering available are unbuffered, block buffered, and +.\"O line buffered. +.\"O When an output stream is unbuffered, information appears on +.\"O the destination file or terminal as soon as written; when it is block +.\"O buffered many characters are saved up and written as a block; when it is +.\"O line buffered characters are saved up until a newline is output or input is +.\"O read from any stream attached to a terminal device (typically \fIstdin\fP). +.\"O The function +.\"O .BR fflush (3) +.\"O may be used to force the block out early. +.\"O (See +.\"O .BR fclose (3).) +.\"O Normally all files are block buffered. +.\"O When the first I/O operation occurs +.\"O on a file, +.\"O .BR malloc (3) +.\"O is called, and a buffer is obtained. +.\"O If a stream refers to a terminal (as +.\"O .I stdout +.\"O normally does) it is line buffered. +.\"O The standard error stream +.\"O .I stderr +.\"O is always unbuffered by default. +.SH ÀâÌÀ +¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤Ë¤Ï unbuffered, block buffered, line buffered ¤Î3¤Ä¤Î¥¿¥¤¥×¤¬ +¤¢¤ë¡£½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Î¥¿¥¤¥×¤¬ unbuffered ¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¤ò½ñ¤­¹þ¤à¤È¤¹¤°¤Ë½Ð +ÎÏÀè¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¤«¥¿¡¼¥ß¥Ê¥ë¤Ëɽ¼¨¤µ¤ì¤ë¡£block buffered ¤Î¾ì¹ç¡¢Ê¸ +»ú¤ÎÆɤ߽ñ¤­¤Ï¥Ö¥í¥Ã¥¯Ã±°Ì¤Ç¤¤¤Ã¤Ú¤ó¤Ë¹Ô¤ï¤ì¤ë¡£line buffered ¤Î¾ì¹ç¡¢ +¿·¤·¤¤¹Ô¤¬½ÐÎϤµ¤ì¤ë¤«¡¢¥¿¡¼¥ß¥Ê¥ë¥Ç¥Ð¥¤¥¹¤ËÀܳ¤·¤Æ¤¤¤ë¥¹¥È¥ê¡¼¥à +(Ä̾\fIstdin\fP) ¤«¤é¿·¤·¤¤¹Ô¤¬ÆþÎϤµ¤ì¤ë¤Þ¤Çʸ»ú¤¬¤¿¤¯¤ï¤¨¤é¤ì¤ë¡£ +¥Ö¥í¥Ã¥¯¤ò¶¯À©Åª¤Ë½ÐÎϤ¹¤ë¤Ë¤Ï +.BR fflush (3) +´Ø¿ô¤ò»È¤¦¡£ +.RB ( fclose (3) +¤ò»²¾È¤Î¤³¤È) Ä̾¥Õ¥¡¥¤¥ë¤Ï¤¹¤Ù¤Æ block buffered ¤Ç¤¢¤ë¡£¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +½é¤á¤ÆÆþ½ÐÎϽèÍý¤ò¹Ô¤¦¤È +.BR malloc (3) +¤¬¸Æ¤Ó½Ð¤µ¤ì¥Ð¥Ã¥Õ¥¡¤¬³ÍÆÀ¤µ¤ì¤ë¡£¤â¤· ¥¹¥È¥ê¡¼¥à¤¬ (Ä̾ +.I stdout +¤¬¤½¤¦¤Ç¤¢¤ë¤è¤¦¤Ë) ¥¿¡¼¥ß¥Ê¥ë¤ò»²¾È¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤Ï line buffered ¤È +¤Ê¤ë¡£É¸½à¥¨¥é¡¼½ÐÎÏ +.I stderr +¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¾ï¤Ë unbuffered ¤Ç¤¢¤ë¡£ +.PP +.\"O The +.\"O .BR setvbuf () +.\"O function may be used on any open stream to change its buffer. +.BR setvbuf () +´Ø¿ô¤Ï¡¢¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ëǤ°Õ¤Î¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¥Ð¥Ã¥Õ¥¡¤òÊѹ¹¤Ç¤­¤ë¡£ +.\"O The +.\"O .I mode +.\"O argument must be one of the following three macros: +°ú¤­¿ô +.I mode +¤Ï¡¢¼¡¤Î 3 ¤Ä¤Î¥Þ¥¯¥í¤Î¤¦¤Á¤¤¤º¤ì¤«¤Ç¤¢¤ë: +.RS +.TP +.B _IONBF +unbuffered +.TP +.B _IOLBF +line buffered +.TP +.B _IOFBF +fully buffered +.RE +.PP +.\"O Except for unbuffered files, the +.\"O .I buf +.\"O argument should point to a buffer at least +.\"O .I size +.\"O bytes long; this buffer will be used instead of the current buffer. +.\"O If the argument +.\"O .I buf +.\"O is NULL, +.\"O only the mode is affected; a new buffer will be allocated on the next read +.\"O or write operation. +.\"O The +.\"O .BR setvbuf () +.\"O function may only be used after opening a stream and before any other +.\"O operations have been performed on it. +unbuffered ¤Î¥Õ¥¡¥¤¥ë¤ò½ü¤­¡¢ +.I buf +°ú¿ô¤Ï +.I size +¥Ð¥¤¥È°Ê¾å¤ÎÂ礭¤µ¤Î¥Ð¥Ã¥Õ¥¡¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¸½ºß¤Î +¥Ð¥Ã¥Õ¥¡¤ÎÂå¤ï¤ê¤ËÍѤ¤¤é¤ì¤ë¡£¤â¤·¡¢°ú¿ô +.I buf +¤¬ NULL ¤Ê¤é¤Ð¡¢¥â¡¼¥É¤À¤±¤¬Êѹ¹¤µ¤ì¤ë¡£ +¿·¤·¤¤¥Ð¥Ã¥Õ¥¡¤Ï¼¡¤ËÆɤ߽ñ¤­¤·¤¿ºÝ¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +.BR setvbuf () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤·¤¿¸å¡¢ +¤½¤Î¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ²¿¤é¤«¤ÎÁàºî¤ò¤¹¤ëÁ°¤Ë¤Î¤ß»ÈÍѤǤ­¤ë¡£ +.PP +.\"O The other three calls are, in effect, simply aliases for calls to +.\"O .BR setvbuf (). +.\"O The +.\"O .BR setbuf () +.\"O function is exactly equivalent to the call +.\"O .PP +.\"O .in +4n +.\"O setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ); +.\"O .in +.\"O .PP +.\"O The +.\"O .BR setbuffer () +.\"O function is the same, except that the size of the buffer is up to the +.\"O caller, rather than being determined by the default +.\"O .BR BUFSIZ . +.\"O The +.\"O .BR setlinebuf () +.\"O function is exactly equivalent to the call: +.\"O .PP +.\"O .in +4n +.\"O setvbuf(stream, (char *) NULL, _IOLBF, 0); +.\"O .in +¾¤Î 3 ¤Ä¤Î´Ø¿ô¤Ï +.BR setvbuf () +¤Î¸Æ¤Ó½Ð¤·¤Ëñ½ã¤ËÃÖ¤­´¹¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR setbuf () +´Ø¿ô¤Ï¡¢ +.PP +.in +4n +setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ); + +.in +¤ÈÁ´¤¯Æ±Åù¤À¤·¡¢ +.BR setbuffer () +´Ø¿ô¤Ï¡¢¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤¬¥Ç¥Õ¥©¥ë¥ÈÃÍ +.B BUFSIZ +¤Ç¤Ï¤Ê¤¯°ú¿ô¤ÇÍ¿¤¨¤é¤ì¤ëÅÀ°Ê³°¤ÏƱ¤¸¤Ç¤¢¤ë¡£ +.BR setlinebuf () +´Ø¿ô¤Ï +.PP +.in +4n +setvbuf(stream, (char *) NULL, _IOLBF, 0); + +.in +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The function +.\"O .BR setvbuf () +.\"O returns 0 on success. +.\"O It returns nonzero on failure +.\"O .RI ( mode +.\"O is invalid or the request cannot be honored). +.\"O It may set +.\"O .I errno +.\"O on failure. +.BR setvbuf () +´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢0 °Ê³°¤ÎÃͤòÊÖ¤¹ +(¼ºÇԤȤϡ¢ +.I mode +¤¬ÉÔÀµ¤Ê¾ì¹ç¤Þ¤¿¤Ï¥ê¥¯¥¨¥¹¥È¤¬¾ò·ï¤òËþ¤¿¤µ¤Ê¤¤¾ì¹ç¤Ç¤¢¤ë)¡£ +.BR setvbuf () +´Ø¿ô¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ï +.I errno +¤òÀßÄꤹ¤ë¤³¤È¤â¤¢¤ë¡£ + +.\"O The other functions do not return a value. +¤½¤Î¾¤Î´Ø¿ô¤ÏÃͤòÊÖ¤µ¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The +.\"O .BR setbuf () +.\"O and +.\"O .BR setvbuf () +.\"O functions conform to C89 and C99. +.BR setbuf () +´Ø¿ô¤ª¤è¤Ó +.BR setvbuf () +´Ø¿ô¤Ï C89 ¤È C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The +.\"O .BR setbuffer () +.\"O and +.\"O .BR setlinebuf () +.\"O functions are not portable to versions of BSD before 4.2BSD, and may not be +.\"O available under Linux. +.\"O On 4.2BSD and 4.3BSD systems, +.\"O .BR setbuf () +.\"O always uses a suboptimal buffer size and should be avoided. +.BR setbuffer () +´Ø¿ô¤ª¤è¤Ó +.BR setlinebuf () +´Ø¿ô¤Ï 4.2BSD ¤è¤êÁ°¤Î BSD ¤È¤Ï¸ß´¹À­¤¬¤Ê¤¤¡£¤Þ¤¿ Linux ¤Ç¤â(¸Å¤¤¥Ð¡¼¥¸¥ç¥ó +¤Ç¤Ï)ÍøÍѤǤ­¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£4.2BSD ¤ª¤è¤Ó 4.3BSD ¤Î¥·¥¹¥Æ¥à¤Ç¤Ï +.BR setbuf () +¤Ïɬ¤ºÄɲäΥХåե¡¡¼¤Î¥µ¥¤¥º¤ò»ÈÍѤ¹¤ë¤Î¤Ç¡¢¤³¤ì¤â»È¤¦¤Ù¤­¤Ç¤Ê¤¤¡£ +.P +.\"O You must make sure that the space that +.\"O .I buf +.\"O points to still exist by the time +.\"O .I stream +.\"O is closed, which also happens at program termination. +.\"O For example, the following is invalid: +.I stream +¤òÊĤ¸¤ë»þ (¥×¥í¥°¥é¥à¤ò½ªÎ»¤¹¤ëºÝ¤Ë¤â¤³¤ì¤Ïµ¯¤­¤ë) ¤Ë¤Ï¡¢ +.I buf +¤¬»Ø¤·¼¨¤¹¶õ´Ö¤È¤¬Â¸ºß¤·¤Æ¤¤¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Î㤨¤Ð¡¢¼¡¤Î¤è¤¦¤Ê»È¤¤Êý¤Ïµö¤µ¤ì¤Ê¤¤: +.nf +.sp +#include + +int +main(void) +{ + char buf[BUFSIZ]; + setbuf(stdin, buf); + printf("Hello, world!\\n"); + return 0; +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fclose (3), +.BR fflush (3), +.BR fopen (3), +.BR fread (3), +.BR malloc (3), +.BR printf (3), +.BR puts (3) diff --git a/draft/man3/setenv.3 b/draft/man3/setenv.3 new file mode 100644 index 00000000..a8793836 --- /dev/null +++ b/draft/man3/setenv.3 @@ -0,0 +1,205 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and Copyright (C) 2004, 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified Sat Jul 24 18:20:58 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Feb 14 21:47:50 1997 by Andries Brouwer (aeb@cwi.nl) +.\" Modified 9 Jun 2004, Michael Kerrisk +.\" Changed unsetenv() prototype; added EINVAL error +.\" 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 +.SH ̾Á° +.\"O setenv \- change or add an environment variable +setenv \- ´Ä¶­ÊÑ¿ô¤òÊѹ¹¤Þ¤¿¤ÏÄɲ乤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int setenv(const char *" name ", const char *" value ", int " overwrite ); +.sp +.BI "int unsetenv(const char *" name ); +.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 setenv (), +.BR unsetenv (): +_BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.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 +¤Ë¤è¤ê»²¾È¤µ¤ì¤ëʸ»úÎó¤Î¥³¥Ô¡¼¤ò¹Ô¤¦¡£ +.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 +¤¬´Ä¶­¤Ë¤Ê¤¤¾ì¹ç¡¢¤³¤Î´Ø¿ô¤ÏÀ®¸ù¤·¡¢´Ä¶­¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.\"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 +¤Ë¥¨¥é¡¼¤Î¸¶°ø¤ò¼¨¤¹Ãͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ + +.\"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" +.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. +´Ä¶­¤Ë¿·¤·¤¤ÊÑ¿ô¤òÄɲ乤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD, POSIX.1-2001. +.\"O .SH "NOTES" +.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 () +¤¬¥ê¥¨¥ó¥È¥é¥ó¥È (ºÆÆþ²Äǽ) ¤Ç¤¢¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤Ê¤¤¡£ + +.\"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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR clearenv (3), +.BR getenv (3), +.BR putenv (3), +.BR environ (7) diff --git a/draft/man3/setjmp.3 b/draft/man3/setjmp.3 new file mode 100644 index 00000000..309f826d --- /dev/null +++ b/draft/man3/setjmp.3 @@ -0,0 +1,204 @@ +.\" Written by Michael Haardt, Fri Nov 25 14:51:42 MET 1994 +.\" +.\" 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. +.\" +.\" Added sigsetjmp, Sun Mar 2 22:03:05 EST 1997, jrv@vanzandt.mv.com +.\" Modifications, Sun Feb 26 14:39:45 1995, faith@cs.unc.edu +.\" +.\" Japanese Version Copyright (c) 1998 Seiiti Obara +.\" all rights reserved. +.\" Translated 1998-05-27, Seiiti Obara +.\" Updated 1999-12-11, Kentaro Shirakata +.\" Modified 2007-12-20, Akihiro MOTOKI +.\" Updated 2009-02-12, Kentaro Shirakata +.\" +.\"WORD: stack context ¥¹¥¿¥Ã¥¯¥³¥ó¥Æ¥­¥¹¥È +.\"WORD: signal masks ¥·¥°¥Ê¥ë¥Þ¥¹¥¯ +.\"WORD: signal context ¥·¥°¥Ê¥ë¥³¥ó¥Æ¥­¥¹¥È +.\"WORD: low-level Äã¥ì¥Ù¥ë +.\" +.TH SETJMP 3 2009-06-26 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O setjmp, sigsetjmp \- save stack context for nonlocal goto +setjmp, sigsetjmp \- Èó¶É½êŪ¤Ê¥¸¥ã¥ó¥×¤Î¤¿¤á¤Ë¡¢¥¹¥¿¥Ã¥¯¥³¥ó¥Æ¥­¥¹¥È (stack context) ¤òÊݸ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.nf +.BI "int setjmp(jmp_buf " env ); + +.BI "int sigsetjmp(sigjmp_buf " env ", int " savesigs ); +.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 setjmp (): +.\"O see NOTES. +¡ÖÃí°Õ¡×»²¾È¡£ +.br +.BR sigsetjmp (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_C_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR setjmp () +.\"O and +.\"O .BR longjmp (3) +.\"O are useful for dealing with errors +.\"O and interrupts encountered in a low-level subroutine of a program. +.\"O .BR setjmp () +.\"O saves the stack context/environment in \fIenv\fP for +.\"O later use by +.\"O .BR longjmp (3). +.\"O The stack context will be invalidated +.\"O if the function which called +.\"O .BR setjmp () +.\"O returns. +.BR setjmp () +¤È +.BR longjmp (3) +¤Ï¡¢¥×¥í¥°¥é¥à¤ÎÄã¥ì¥Ù¥ë¤Ê¥µ¥Ö¥ë¡¼¥Á¥ó +¤Ë¤ª¤¤¤Æ¡¢¥¨¥é¡¼¤ä³ä¤ê¹þ¤ß¤¬È¯À¸¤·¤¿»þ¤Î½èÍý¤ËÊØÍø¤Ç¤¢¤ë¡£ +.BR setjmp () +¤Ï¡¢ +.BR longjmp (3) +¤Ë¤è¤Ã¤Æ»È¤ï¤ì¤ë \fIenv\fP ¤Ë +¥¹¥¿¥Ã¥¯¥³¥ó¥Æ¥­¥¹¥È/¥¹¥¿¥Ã¥¯´Ä¶­¤òÊݸ¤¹¤ë¡£ +.BR setjmp () +¤ò¸Æ¤Ó½Ð¤·¤¿ +´Ø¿ô¤¬ÊÖ¤ë¤È¤­¤Ë¡¢¤½¤Î¥¹¥¿¥Ã¥¯¥³¥ó¥Æ¥­¥¹¥È¤Ï̵¸ú¤Ë¤Ê¤ë¡£ +.P +.\"O .BR sigsetjmp () +.\"O is similar to +.\"O .BR setjmp (). +.\"O If, and only if, \fIsavesigs\fP is nonzero, +.\"O the process's current signal mask is saved in \fIenv\fP +.\"O and will be restored if a +.\"O .BR siglongjmp (3) +.\"O is later performed with this \fIenv\fP. +.BR sigsetjmp () +¤â +.BR setjmp () +¤ÈƱÍͤǤ¢¤ë¡£ +\fIsavesigs\fP ¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢ +¤³¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤â \fIenv\fP ¤ËÊݸ¤µ¤ì¡¢ +¤³¤Î¥·¥°¥Ê¥ë¤Ï¸å¤Ç +.BR siglongjmp (3) +¤¬¤³¤Î \fIenv\fP ¤Ç¼Â¹Ô¤µ¤ì¤¿ºÝ¤ËÉü¸µ¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR setjmp () +.\"O and +.\"O .BR sigsetjmp () +.\"O return 0 if returning directly, and +.\"O nonzero when returning from +.\"O .BR longjmp (3) +.\"O or +.\"O .BR siglongjmp (3) +.\"O using the saved context. +ľÀÜÊ֤äƤ¯¤ë¤È¤­¤Ï¡¢ +.BR setjmp () +¤È +.BR sigsetjmp () +¤Ï 0 ¤òÊÖ¤·¡¢Êݸ¤·¤¿¥³¥ó¥Æ¥­¥¹¥È¤ò»È¤Ã¤Æ +.BR longjmp (3) +¤ä +.BR siglongjmp (3) +¤«¤éÊ֤äƤ¯¤ë¤È¤­¤Ï 0 °Ê³°¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O C89, C99, and POSIX.1-2001 specify +.\"O .BR setjmp (). +.\"O POSIX.1-2001 specifies +.\"O .BR sigsetjmp (). +.BR setjmp () +¤Ï C89, C99, POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.BR sigsetjmp () +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O POSIX does not specify whether +.\"O .BR setjmp () +.\"O will save the signal mask. +.\"O In System V it will not. +.\"O In 4.3BSD it will, and there +.\"O is a function \fB_setjmp\fP that will not. +POSIX ¤Ï¡¢ +.BR setjmp () +¤¬¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊݸ¤¹¤Ù¤­¤«¤É¤¦¤«¤òµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£ +System V ¤Ç¤ÏÊݸ¤·¤Ê¤¤¡£ +4.3BSD ¤Ç¤ÏÊݸ¤¹¤ë; +4.3BSD ¤Ë¤Ï¥·¥°¥Ê¥ë¥³¥ó¥Æ¥­¥¹¥È¤òÊݸ¤·¤Ê¤¤´Ø¿ô \fB_setjmp\fP ¤â¤¢¤ë¡£ +.\"O By default, Linux/glibc follows the System V behavior, +.\"O but the BSD behavior is provided if the +.\"O .BR _BSD_SOURCE +.\"O feature test macro is defined and none of +.\"O .BR _POSIX_SOURCE , +.\"O .BR _POSIX_C_SOURCE , +.\"O .BR _XOPEN_SOURCE , +.\"O .BR _XOPEN_SOURCE_EXTENDED , +.\"O .BR _GNU_SOURCE , +.\"O or +.\"O .B _SVID_SOURCE +.\"O is defined. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢Linux/glibc ¤Ï System V ¤Î¿¶¤ëÉñ¤¤¤Ë½¾¤¦¤¬¡¢ +.B _BSD_SOURCE +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¡¢ +.BR _POSIX_SOURCE , +.BR _POSIX_C_SOURCE , +.BR _XOPEN_SOURCE , +.BR _XOPEN_SOURCE_EXTENDED , +.BR _GNU_SOURCE , +.B _SVID_SOURCE +¤Î¤¤¤º¤ì¤âÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤»þ¤Ï BSD ¤Î¿¶¤ëÉñ¤¤¤È¤Ê¤ë¡£ + +.\"O If you want to portably save and restore signal masks, use +.\"O .BR sigsetjmp () +.\"O and +.\"O .BR siglongjmp (). +°Ü¿¢À­¤Î¤¢¤ë·Á¤Ç¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊݸ¤ª¤è¤ÓÉü¸µ¤·¤¿¤¤¤Î¤Ê¤é¡¢ +.BR sigsetjmp () +¤È +.BR siglongjmp () +¤ò»È¤¦¤³¤È¡£ +.P +.\"O .BR setjmp () +.\"O and +.\"O .BR sigsetjmp () +.\"O make programs hard to understand +.\"O and maintain. +.\"O If possible an alternative should be used. +.BR setjmp () +¤ä +.BR sigsetjmp () +¤ò»È¤¦¤È¡¢¥×¥í¥°¥é¥à¤ÏÍý²ò¤·¤Å¤é¤¯¡¢Êݼ餷¤Ë¤¯¤¤¤â¤Î¤Ë¤Ê¤ë¡£ +Ê̤ÎÊýË¡¤¬²Äǽ¤Ê¤é¡¢¤½¤ì¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR longjmp (3), +.BR siglongjmp (3) diff --git a/draft/man3/setlocale.3 b/draft/man3/setlocale.3 new file mode 100644 index 00000000..28121eaa --- /dev/null +++ b/draft/man3/setlocale.3 @@ -0,0 +1,329 @@ +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" and Copyright 1999 by Bruno Haible (haible@clisp.cons.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. +.\" License. +.\" Modified Sat Jul 24 18:20:12 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Tue Jul 15 16:49:10 1997 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Sun Jul 4 14:52:16 1999 by Bruno Haible (haible@clisp.cons.org) +.\" Modified Tue Aug 24 17:11:01 1999 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Tue Feb 6 03:31:55 2001 by Andries Brouwer (aeb@cwi.nl) +.\" +.\" Japanese Version Copyright (c) 1998 Tanoshima Hidetohsi +.\" all rights reserved. +.\" May 29, 1998 Tanoshima Hidetoshi +.\" Modified Mon Oct 2 11:09:18 JST 2000 +.\" by HANATAKA Shinya +.\" Updated Fri May 4 01:49:48 JST 2001 +.\" by Kentaro Shirakata +.\" Updated Sat Oct 12 2002 by NAKANO Takeo +.\" +.\"WORD: locale ¥í¥±¡¼¥ë +.\"WORD: portable ¸ß´¹À­¤Î¤¢¤ë +.\"WORD: regular expression Àµµ¬É½¸½ +.\"WORD: range expressions ÈÏ°Ïɽ¸½ +.\"WORD: equivalence classes Åù²Á¥¯¥é¥¹ +.\"WORD: collation ¾È¹ç +.\"WORD: multibyte character ¿¥Ð¥¤¥Èʸ»ú +.\"WORD: wide character ¥ï¥¤¥Éʸ»ú +.\"WORD: opaque string ÆâÉôʸ»úÎó +.\" +.TH SETLOCALE 3 2008-12-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +.\"O setlocale \- set the current locale +setlocale \- ¸½ºß¤Î¥í¥±¡¼¥ë (locale) ¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *setlocale(int " category ", const char *" locale ); +.fi +.SH ÀâÌÀ +.\"O .BR setlocale () +.\"O function is used to set or query the program's current locale. +.BR setlocale () +´Ø¿ô¤Ï¥×¥í¥°¥é¥à¤Î¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤òÀßÄꤷ¤¿¤ê +Ì䤤¹ç¤ï¤»¤¿¤ê¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +.\"O If +.\"O .I locale +.\"O is not NULL, +.\"O the program's current locale is modified according to the arguments. +.I locale +¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢¥×¥í¥°¥é¥à¤Î¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤Ï°ú¤­¿ô¤Ë½¾¤Ã¤ÆÊѹ¹¤µ¤ì¤ë¡£ +.\"O The argument +.\"O .I category +.\"O determines which parts of the program's current locale should be modified. +°ú¤­¿ô +.I category +¤Ï¥×¥í¥°¥é¥à¤Î¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤Î¤É¤ÎÉôʬ¤òÊѹ¹¤¹¤ë¤«¤ò·è¤á¤ë¡£ +.TP +.B LC_ALL +.\"O for all of the locale. +Á´¤Æ¤Î¥í¥±¡¼¥ë +.TP +.B LC_COLLATE +.\"O for regular expression matching (it determines the meaning +.\"O of range expressions and equivalence classes) and string collation. +Àµµ¬É½¸½¤Î¥Þ¥Ã¥Á¥ó¥° (ÈÏ°Ïɽ¸½¤ÈÅù²Á¥¯¥é¥¹¤Î¥Þ¥Ã¥Á¥ó¥°¤ò·èÄꤹ¤ë) +¤Èʸ»úÎó¤Î¾È¹ç (collation) +.TP +.B LC_CTYPE +.\"O for regular expression matching, character classification, conversion, +.\"O case-sensitive comparison, and wide character functions. +Àµµ¬É½¸½¤Î¥Þ¥Ã¥Á¥ó¥°¡¢Ê¸»ú¤ÎʬÎࡢʸ»ú¤ÎÊÑ´¹¡¢Âçʸ»ú¾®Ê¸»úÈæ³Ó¡¢ +¥ï¥¤¥Éʸ»ú´Ø¿ô +.TP +.B LC_MESSAGES +.\"O for localizable natural-language messages. +ÃÏ°è²½²Äǽ¤Ê¼«Á³¸À¸ì¥á¥Ã¥»¡¼¥¸ +.TP +.B LC_MONETARY +.\"O for monetary formatting. +Ä̲ߤνñ¼° +.TP +.B LC_NUMERIC +.\"O for number formatting (such as the decimal point and the thousands separator). +¿ôÃͤνñ¼° (¾®¿ôÅÀ¤ä 3 ·å¤´¤È¤Î¶èÀÚ¤ê) +.TP +.B LC_TIME +.\"O for time and date formatting. +»þ¹ï¤ÈÆüÉÕ¤±¤Î½ñ¼° +.PP +.\"O The argument +.\"O .I locale +.\"O is a pointer to a character string containing the +.\"O required setting of +.\"O .IR category . +°ú¤­¿ô +.I locale +¤Ï +.I category +¤ËÀßÄꤹ¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.\"O Such a string is either a well-known constant like "C" or "da_DK" +.\"O (see below), or an opaque string that was returned by another call of +.\"O .BR setlocale (). +¤³¤Îʸ»úÎó¤Ï¤è¤¯ÃΤé¤ì¤¿Äê¿ô¤Ç¤¢¤ë "C" ¤ä "da_DK" ¤Ê¤É¤Ç¤âÎɤ¤¤· +(°Ê²¼¤ò»²¾È)¡¢Â¾¤Î¤È¤­¤Ë +.BR setlocale () +¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤ËÊÖ¤µ¤ì¤¿¡¢ÆâÉôÍѤÎʸ»úÎó¤Ç¤âÎɤ¤¡£ +.PP +.\"O If +.\"O .I locale +.\"O is +.\"O .BR """""" , +.\"O each part of the locale that should be modified is set according to the +.\"O environment variables. +.\"O The details are implementation-dependent. +.I locale +¤¬ \fB""\fP ¤Î¾ì¹ç¡¢¥í¥±¡¼¥ë¤Î³ÆÉôʬ¤ÎÀßÄê¤Ë¤Ï´Ä¶­ÊÑ¿ô¤¬»²¾È¤µ¤ì¤ë¡£ +¤½¤Î¾ÜºÙ¤Ï¼ÂÁõ°Í¸¤Ç¤¢¤ë¡£ +.\"O For glibc, first (regardless of +.\"O .IR category ), +.\"O the environment variable +.\"O .B LC_ALL +.\"O is inspected, +.\"O next the environment variable with the same name as the category +.\"O .RB ( LC_COLLATE , +.\"O .BR LC_CTYPE , +.\"O .BR LC_MESSAGES , +.\"O .BR LC_MONETARY , +.\"O .BR LC_NUMERIC , +.\"O .BR LC_TIME ) +.\"O and finally the environment variable +.\"O .BR LANG . +.\"O The first existing environment variable is used. +.\"O If its value is not a valid locale specification, the locale +.\"O is unchanged, and +.\"O .BR setlocale () +.\"O returns NULL. +glibc ¤Î¾ì¹ç¡¢¤Þ¤ººÇ½é¤Ë (¤É¤ó¤Ê +.I category +¤ËÂФ·¤Æ¤â) ´Ä¶­ÊÑ¿ô +.B LC_ALL +¤¬¸¡ºº¤µ¤ì¤ë¡£ +¼¡¤Ë¥«¥Æ¥´¥ê (category) ¤ÈƱ¤¸Ì¾Á°¤Î´Ä¶­ÊÑ¿ô +.RB ( LC_COLLATE , +.BR LC_CTYPE , +.BR LC_MESSAGES , +.BR LC_MONETARY , +.BR LC_NUMERIC , +.BR LC_TIME ) +¤¬¸¡ºº¤µ¤ì¡¢ºÇ¸å¤Ë´Ä¶­ÊÑ¿ô +.B LANG +¤¬¸¡ºº¤µ¤ì¤ë¡£ +ºÇ½é¤Ë¸«¤Ä¤«¤Ã¤¿´Ä¶­ÊÑ¿ô¤ò»ÈÍѤ¹¤ë¡£ +¤½¤ÎÃͤ¬¥í¥±¡¼¥ë»ØÄê¤È¤·¤ÆÀµ¤·¤¯¤Ê¤±¤ì¤Ð¡¢¥í¥±¡¼¥ë¤ÏÊѹ¹¤µ¤ì¤º¡¢ +.BR setlocale () +¤Ï NULL ¤òÊÖ¤¹¡£ +.PP +.\"O The locale +.\"O .B """C""" +.\"O or +.\"O .B """POSIX""" +.\"O is a portable locale; its +.\"O .B LC_CTYPE +.\"O part corresponds to the 7-bit ASCII +.\"O character set. +\fB"C"\fP ¥í¥±¡¼¥ë¤ä \fB"POSIX"\fP ¥í¥±¡¼¥ë¤Ï¸ß´¹À­¤Î¤¢¤ë¥í¥±¡¼¥ë¤Ç¤¢¤ë¡£ +¤³¤Î +.B LC_CTYPE +¤ÎÉôʬ¤Ï 7 ¥Ó¥Ã¥È ASCII ʸ»ú½¸¹ç¤ËÁêÅö¤·¤Æ¤¤¤ë¡£ +.PP +.\"O A locale name is typically of the form +.\"O .IR language "[_" territory "][." codeset "][@" modifier "]," +.\"O where +.\"O .I language +.\"O is an ISO 639 language code, +.\"O .I territory +.\"O is an ISO 3166 country code, and +.\"O .I codeset +.\"O is a character set or encoding identifier like +.\"O .B "ISO-8859-1" +.\"O or +.\"O .BR "UTF-8" . +¥í¥±¡¼¥ë̾¤Î½ñ¼°¤Ï¡¢Ä̾ï +.IR language "[_" territory "][." codeset "][@" modifier "]" +¤È¤¤¤¦¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤³¤Ç +.I language +¤Ï ISO 639 ¤Î¸À¸ì¥³¡¼¥É¤Ç¤¢¤ë¡£ +.I territory +¤Ï ISO 3166 ¤Î¹ñ̾¥³¡¼¥É¤Ç¤¢¤ë¡£ +.I codeset +¤Ï +.B "ISO-8859-1" +¤ä +.B "UTF-8" +¤Î¤è¤¦¤Êʸ»ú½¸¹ç¤äʸ»úÉä¹æ²½¼±Ê̻ҤǤ¢¤ë¡£ +.\"O For a list of all supported locales, try "locale \-a", cf.\& +.\"O .BR locale (1). +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥í¥±¡¼¥ë¤Î°ìÍ÷¤òÆÀ¤ë¤Ë¤Ï¡¢ +"locale \-a" ¤ò¼Â¹Ô¤·¤Æ¤ß¤è +.RB ( locale (1) +»²¾È¤Î¤³¤È)¡£ +.PP +.\"O If +.\"O .I locale +.\"O is NULL, the current locale is only queried, not modified. +.I locale +¤¬ NULL ¤Ê¤é¤Ð¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤òÌ䤤¹ç¤ï¤»¤ë¤Î¤ß¤ÇÊѹ¹¤Ï¤·¤Ê¤¤¡£ +.PP +.\"O On startup of the main program, the portable +.\"O .B """C""" +.\"O locale is selected as default. +main ¥×¥í¥°¥é¥à¤Îµ¯Æ°»þ¤Ë¤Ï¡¢ +¸ß´¹À­¤Î¤¢¤ë \fB"C"\fP ¥í¥±¡¼¥ë¤¬¥Ç¥Õ¥©¥ë¥È¤ÇÁªÂò¤µ¤ì¤ë¡£ +.\"O A program may be made portable to all locales by calling: +.\"O .nf +.\"O +.\"O setlocale(LC_ALL, ""); +.\"O +.\"O .fi +.\"O after program initialization, by using the values returned +.\"O from a +.\"O .BR localeconv (3) +.\"O call +.\"O for locale-dependent information, by using the multibyte and wide +.\"O character functions for text processing if +.\"O .BR "MB_CUR_MAX > 1" , +.\"O and by using +.\"O .BR strcoll (3), +.\"O .BR wcscoll (3) +.\"O or +.\"O .BR strxfrm (3), +.\"O .BR wcsxfrm (3) +.\"O to compare strings. +¥×¥í¥°¥é¥à¤ò¤¹¤Ù¤Æ¤Î¥í¥±¡¼¥ë¤ËÂФ·¤Æ¸ß´¹¤Ë¤·¤¿¤±¤ì¤Ð¡¢ +¥×¥í¥°¥é¥à¤Î½é´ü²½¤Î¸å¤Ë +.nf + + setlocale(LC_ALL, ""); + +.fi +¤ò¸Æ¤Ó½Ð¤·¡¢¥í¥±¡¼¥ë°Í¸¤Î¾ðÊó¤Ë¤Ï +.BR localeconv (3) +¤ÎÊÖ¤êÃͤòÍѤ¤¡¢ +.BR "MB_CUR_MAX > 1" +¤Î¾ì¹ç¤Ë¤Ïʸ»úÎó¤ÎÁàºî¤Ë¤Ï¿¥Ð¥¤¥Èʸ»ú¡¢¥ï¥¤¥Éʸ»ú´Ø¿ô¤ò»ÈÍѤ·¡¢ +ʸ»úÎó¤ÎÈæ³Ó¤Ë¤Ï +.BR strcoll (3), +.BR wcscoll (3) +¤ä +.BR strxfrm (3), +.BR wcsxfrm (3) +¤òÍѤ¤¤ë¡£ +.SH ÊÖ¤êÃÍ +.\"O A successful call to +.\"O .BR setlocale () +.\"O returns an opaque string that corresponds to the locale set. +.\"O This string may be allocated in static storage. +.\"O The string returned is such that a subsequent call with that string +.\"O and its associated category will restore that part of the process's +.\"O locale. +.\"O The return value is NULL if the request cannot be honored. +.BR setlocale () +¤Î¸Æ¤Ó½Ð¤·¤ËÀ®¸ù¤¹¤ë¤È¡¢ +¤½¤Î¥í¥±¡¼¥ë½¸¹ç¤ËÂбþ¤¹¤ëÆâÉôʸ»úÎó (opaque string) ¤òÊÖ¤¹¡£ +¤³¤Îʸ»úÎó¤ÏÀÅŪ¤Êµ­²±°è¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤ÎÊ֤äÆÍ褿ʸ»úÎó¤ò¡¢¥«¥Æ¥´¥ê»ØÄê¤È¶¦¤Ë¡¢ +¤Î¤Á¤Î setlocale ¤Î¸Æ¤Ó½Ð¤·¤Ë»ØÄꤹ¤ì¤Ð¡¢ +¥×¥í¥»¥¹¤Î¤½¤ÎÉôʬ¤Î¥í¥±¡¼¥ë¤¬Éü¸µ¤µ¤ì¤ë¡£ +ÀßÄê¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ÊÖ¤êÃÍ¤Ï NULL ¤Ë¤Ê¤ë¡£ +.SH ½àµò +C89, C99, POSIX.1-2001. +.SH Ãí°Õ +.\"O Linux (that is, glibc) supports the portable locales +Linux (¤È¤¤¤¦¤« glibc) ¤Ï¸ß´¹À­¤Î¤¢¤ë¥í¥±¡¼¥ë¤È¤·¤Æ +\fB"C"\fP ¤È \fB"POSIX"\fP ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.\"O In the good old days there used to be support for +.\"O the European Latin-1 +.\"O .B """ISO-8859-1""" +.\"O locale (e.g., in libc-4.5.21 and libc-4.6.27), and the Russian +.\"O .B """KOI-8""" +.\"O (more precisely, "koi-8r") locale (e.g., in libc-4.6.27), +.\"O so that having an environment variable \fILC_CTYPE=ISO-8859-1\fP +.\"O sufficed to make +.\"O .BR isprint (3) +.\"O return the right answer. +.\"O These days non-English speaking Europeans have to work a bit harder, +.\"O and must install actual locale files. +¸Å¤­¤è¤­»þÂå¤Ë¤Ï (Î㤨¤Ð libc-4.5.21 ¤È libc-4.6.27 ¤Ê¤É¤Ç¤Ï)¡¢ +European Latin-1 ¸þ¤±¤Ë +\fB"ISO-8859-1"\fP ¥í¥±¡¼¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤ª¤ê¡¢ +¥í¥·¥¢¸ì (Russian) ¸þ¤±¤Ë \fB"KOI-8"\fP +(¤è¤êÀµ³Î¤Ë¤Ï "koi-8r") ¥í¥±¡¼¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤¿¡£ +½¾¤Ã¤Æ´Ä¶­ÊÑ¿ô¤ò \fILC_CTYPE=ISO-8859-1\fP ¤È»ØÄꤹ¤ë¤À¤±¤Ç +.BR isprint (3) +¤ÏÀµ¤·¤¤Åú¤¨¤òÊÖ¤·¤¿¡£ +ºÇ¶á¤Ç¤Ï¡¢±Ñ¸ì°Ê³°¤ò»È¤¦¥è¡¼¥í¥Ã¥Ñ¿Í¤Ï¤â¤¦¾¯¡¹¤ä¤Ã¤«¤¤¤Êºî¶È¤òɬÍפȤ·¡¢ +¼ÂºÝ¤Î¥í¥±¡¼¥ë¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR locale (1), +.BR localedef (1), +.BR isalpha (3), +.BR localeconv (3), +.BR nl_langinfo (3), +.BR rpmatch (3), +.BR strcoll (3), +.BR strftime (3), +.BR charsets (7), +.BR locale (7) diff --git a/draft/man3/setlogmask.3 b/draft/man3/setlogmask.3 new file mode 100644 index 00000000..4a412e4e --- /dev/null +++ b/draft/man3/setlogmask.3 @@ -0,0 +1,119 @@ +.\" 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) 2001 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Sat Nov 3 01:46:03 JST 2001 +.\" by Akihiro MOTOKI +.\" +.\"WORD: logging ¥í¥°¼ý½¸ +.\" +.TH SETLOGMASK 3 2001-10-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O setlogmask \- set log priority mask +setlogmask \- ¥í¥°¤ÎÍ¥ÀèÅÙ¥Þ¥¹¥¯¤òÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int setlogmask(int " mask ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O A process has a log priority mask that determines which calls to +.\"O .BR syslog (3) +.\"O may be logged. +.\"O All other calls will be ignored. +¥×¥í¥»¥¹¤Ë¤Ï¥í¥°Í¥ÀèÅÙ¥Þ¥¹¥¯(log priority mask)¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤Æ¡¢ +¤³¤ì¤òÍѤ¤¤Æ +.BR syslog (3) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤Ë¥í¥°µ­Ï¿¤ò¹Ô¤¦¤«¤É¤¦¤«¤ò·èÄꤹ¤ë¡£ +¾¤Î¤¹¤Ù¤Æ¤Î´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤Ï¥í¥°µ­Ï¿¤¬¹Ô¤ï¤ì¤Ê¤¤¡£ +.\"O Logging is enabled for the priorities that have the corresponding +.\"O bit set in +.\"O .IR mask . +.I mask +¤Î³Æ¥Ó¥Ã¥È¤ÏÍ¥ÀèÅÙ¤ËÂбþ¤·¤Æ¤ª¤ê¡¢Âбþ¤¹¤ë¥Ó¥Ã¥È¤¬ 1 ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë +Í¥ÀèÅÙ¤ËÂФ·¤Æ¥í¥°¼ý½¸(logging)¤¬Í­¸ú¤Ë¤Ê¤ë¡£ +.\"O The initial mask is such that logging is enabled for all priorities. +¥Þ¥¹¥¯¤Î½é´üÃͤϡ¢¤¹¤Ù¤Æ¤ÎÍ¥ÀèÅÙ¤ËÂФ·¤Æ¥í¥°¼ý½¸¤¬Í­¸ú¤Ë¤Ê¤ë¤è¤¦¤ÊÃͤǤ¢¤ë¡£ +.LP +.\"O The +.\"O .BR setlogmask () +.\"O function sets this logmask for the calling process, +.\"O and returns the previous mask. +.BR setlogmask () +´Ø¿ô¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÂФ¹¤ë¥í¥°¥Þ¥¹¥¯¤òÀßÄꤷ¡¢ +Êѹ¹Á°¤Î¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +.\"O If the mask argument is 0, the current logmask is not modified. +.I mask +°ú¤­¿ô¤¬ 0 ¤Ê¤é¤Ð¡¢¸½ºß¤Î¥í¥°¥Þ¥¹¥¯¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.LP +.\"O The eight priorities are +.\"O .BR LOG_EMERG , +.\"O .BR LOG_ALERT , +.\"O .BR LOG_CRIT , +.\"O .BR LOG_ERR , +.\"O .BR LOG_WARNING , +.\"O .BR LOG_NOTICE , +.\"O .BR LOG_INFO , +.\"O and +.\"O .BR LOG_DEBUG . +.\"O The bit corresponding to a priority \fIp\fP is \fBLOG_MASK\fP(\fIp\fP). +.\"O Some systems also provide a macro \fBLOG_UPTO\fP(\fIp\fP) for the mask +.\"O of all priorities in the above list up to and including \fIp\fP. +°Ê²¼¤Î8¥ì¥Ù¥ë¤ÎÍ¥ÀèÅÙ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë(Í¥ÀèÅ٤ι⤤½ç)¡§ +.BR LOG_EMERG , +.BR LOG_ALERT , +.BR LOG_CRIT , +.BR LOG_ERR , +.BR LOG_WARNING , +.BR LOG_NOTICE , +.BR LOG_INFO , +.BR LOG_DEBUG ¡£ +Í¥ÀèÅÙ \fIp\fP ¤ËÂбþ¤¹¤ë¥Ó¥Ã¥ÈÎó¤Ï \fBLOG_MASK\fP(\fIp\fP) ¤Ë¤è¤Ã¤Æµá¤á¤é¤ì¤ë¡£ +Í¥ÀèÅÙ \fIp\fP °Ê¾å¤Î¤¹¤Ù¤Æ¤ÎÍ¥ÀèÅÙ (\fIp\fP ¤ò´Þ¤à) ¤Î¥Þ¥¹¥¯¥Ó¥Ã¥È¤ò +µá¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¥Þ¥¯¥í \fBLOG_UPTO\fP(\fIp\fP) ¤ò»ÈÍѤǤ­¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O This function returns the previous log priority mask. +Êѹ¹Á°¤Î¥í¥°Í¥ÀèÅÙ¥Þ¥¹¥¯¤ÎÃͤòÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O None. +¤Ê¤·¡£ +.\"O .\" .SH NOTES +.SH Ãí°Õ +.\"O .\" The glibc logmask handling was broken in versions before glibc 2.1.1. +glibc 2.1.1 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï glibc ¤Î¥í¥°¥Þ¥¹¥¯¤Î°·¤¤¤ËÉÔ¶ñ¹ç¤¬¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O Note that the description in POSIX.1-2001 is flawed. +POSIX.1-2001 ¤Ç¤ÎÀâÌÀ¤Ë¤Ï·ç´Ù¤¬¤¢¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR closelog (3), +.BR openlog (3), +.BR syslog (3) diff --git a/draft/man3/setnetgrent.3 b/draft/man3/setnetgrent.3 new file mode 100644 index 00000000..9db699d6 --- /dev/null +++ b/draft/man3/setnetgrent.3 @@ -0,0 +1,171 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" based on glibc infopages +.\" polished - aeb +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2005-02-20, Akihiro MOTOKI +.\" +.TH SETNETGRENT 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O setnetgrent, endnetgrent, getnetgrent, getnetgrent_r, innetgr \- +.\"O handle network group entries +setnetgrent, endnetgrent, getnetgrent, getnetgrent_r, innetgr \- +¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥°¥ë¡¼¥×¤Î¥¨¥ó¥È¥ê¤òÁàºî¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "int setnetgrent(const char *" netgroup ); + +.B "void endnetgrent(void);" + +.BI "int getnetgrent(char **" host ", char **" user ", char **" domain ); + +.BI "int getnetgrent_r(char **" host ", char **" user "," +.BI " char **" domain ", char *" buf ", int " buflen ); + +.BI "int innetgr(const char *" netgroup ", const char *" host "," +.BI " const char *" user ", const char *" domain ); +.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 setnetgrent (), +.BR endnetgrent (), +.BR getnetgrent (), +.BR getnetgrent_r (), +.BR innetgr (): +_BSD_SOURCE || _SVID_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .I netgroup +.\"O is a SunOS invention. +.\"O A netgroup database is a list of string triples +.\"O .RI ( hostname ", " username ", " domainname ) +.\"O or other netgroup names. +.\"O Any of the elements in a triple can be empty, +.\"O which means that anything matches. +.\"O The functions described here allow access to the netgroup databases. +.\"O The file +.\"O .I /etc/nsswitch.conf +.\"O defines what database is searched. +.I netgroup +¤Ï SunOS ¤Ç¹Í°Æ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£¥Í¥Ã¥È¥°¥ë¡¼¥×¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î +¥¨¥ó¥È¥ê¤Ï¡¢ 3 ¤Ä¤Îʸ»úÎó¤Î¥ê¥¹¥È +.RI ( hostname ", " username ", " domainname ) +¤â¤·¤¯¤Ï¥Í¥Ã¥È¥°¥ë¡¼¥×̾¤Ç¤¢¤ë¡£ +Á°µ­¤Î¥ê¥¹¥È¤Î³ÆÍ×ÁǤ϶õ¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¡£ +¶õ¤Ï²¿¤È¤Ç¤â°ìÃפ¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +ËÜ¥Ú¡¼¥¸¤ÇÀâÌÀ¤¹¤ë´Ø¿ô¤ò»È¤¦¤³¤È¤Ç¡¢¥Í¥Ã¥È¥°¥ë¡¼¥×¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë +¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤É¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¸¡º÷¤µ¤ì¤ë¤«¤Ï +.I /etc/nsswitch.conf +¥Õ¥¡¥¤¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O The +.\"O .BR setnetgrent () +.\"O call defines the netgroup that will be searched by subsequent +.\"O .BR getnetgrent () +.\"O calls. +.\"O The +.\"O .BR getnetgrent () +.\"O function retrieves the next netgroup entry, and returns pointers in +.\"O .IR host , +.\"O .IR user , +.\"O .IR domain . +.BR setnetgrent () +¥³¡¼¥ë¤Ï¡¢¤³¤Î¸å¤Ç¸Æ¤Ð¤ì¤ë +.BR getnetgrent () +¥³¡¼¥ë¤¬¸¡º÷¤¹¤ë¥Í¥Ã¥È¥°¥ë¡¼¥×¤òÄê¤á¤ë¡£ +.BR getnetgrent () +´Ø¿ô¤Ï¥Í¥Ã¥È¥°¥ë¡¼¥×¤Î¼¡¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤·¡¢ +.IR host , +.IR user , +.I domain +¤Ë¥Ý¥¤¥ó¥¿¤òÆþ¤ì¤ÆÊ֤롣 +.\"O A NULL pointer means that the corresponding entry matches any string. +.\"O The pointers are valid only as long as there is no call to other +.\"O netgroup-related functions. +.\"O To avoid this problem you can use the GNU function +.\"O .BR getnetgrent_r () +.\"O that stores the strings in the supplied buffer. +.\"O To free all allocated buffers use +.\"O .BR endnetgrent (). +NULL ¥Ý¥¤¥ó¥¿¤Ï¡¢Âбþ¤¹¤ë¥¨¥ó¥È¥ê¤¬¤É¤ó¤Êʸ»úÎó¤È¤â°ìÃפ¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +ÆÀ¤é¤ì¤¿¥Ý¥¤¥ó¥¿¤Ï¡¢¥Í¥Ã¥È¥°¥ë¡¼¥×´Ø·¸¤Î´Ø¿ô¤Î¤¤¤º¤ì¤«¤¬¸Æ¤Ð¤ì¤ë¤Þ¤Ç¤Î +´Ö¤À¤±Í­¸ú¤Ç¤¢¤ë¡£¤³¤ÎÌäÂê¤òÈò¤±¤ë¤¿¤á¤Ë¤Ï GNU ³ÈÄ¥¤Î´Ø¿ô +.BR getnetgrent_r () +¤ò»È¤¦¤È¤è¤¤¡£¤³¤Î´Ø¿ô¤Ï¸Æ¤Ó½Ð¤·Â¦¤¬ÍÑ°Õ¤·¤¿¥Ð¥Ã¥Õ¥¡¤Ë +ʸ»úÎó¤ò³ÊǼ¤¹¤ë¡£³ä¤êÅö¤ÆºÑ¤Î¥Ð¥Ã¥Õ¥¡¤òÁ´¤Æ²òÊü¤¹¤ë¤Ë¤Ï +.BR endnetgrent () +¤ò»ÈÍѤ¹¤ë¡£ +.PP +.\"O In most cases you only want to check if the triplet +.\"O .RI ( hostname ", " username ", " domainname ) +.\"O is a member of a netgroup. +.\"O The function +.\"O .BR innetgr () +.\"O can be used for this without calling the above three functions. +.\"O Again, a NULL pointer is a wildcard and matches any string. +.\"O The function is thread-safe. +¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢ +.RI ( hostname ", " username ", " domainname ) +¤Î3Í×ÁǤÎÁȤ¬¥Í¥Ã¥È¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤«¤É¤¦¤«¤ò³Îǧ¤·¤¿¤¤¤À¤±¤Ç¤¢¤í¤¦¡£ +.BR innetgr () +´Ø¿ô¤ò»È¤¦¤È¡¢¾åµ­¤Î3¤Ä¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤µ¤º¤Ë¤³¤ÎÌÜŪ¤òãÀ®¤Ç¤­¤ë¡£ +¤â¤¦°ìÅÙ½ñ¤¤¤Æ¤ª¤¯¤¬¡¢NULL ¥Ý¥¤¥ó¥¿¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É¤Ç¤¢¤ê¡¢ +¤¢¤é¤æ¤ëʸ»úÎó¤È°ìÃפ¹¤ë¡£¤³¤Î´Ø¿ô¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O These functions return 1 on success and 0 for failure. +¤³¤ì¤é¤Î´Ø¿ô¤ÏÀ®¸ù¤¹¤ë¤È 1 ¤ò¡¢¼ºÇÔ¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.I /etc/netgroup +.br +.I /etc/nsswitch.conf +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O These functions are not in POSIX.1-2001, but +.\"O .BR setnetgrent (), +.\"O .BR endnetgrent (), +.\"O .BR getnetgrent (), +.\"O and +.\"O .BR innetgr () +.\"O are available on most Unix systems. +.\"O .BR getnetgrent_r () +.\"O is not widely available on other systems. +¤³¤ì¤é¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¤¬¡¢ +setnetgrent (), +endnetgrent (), +getnetgrent (), +innetgr () +¤Ï¤Û¤È¤ó¤É¤Î Unix ¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.BR getnetgrent_r () +¤Ï¹­¤¯Â¾¤Î¥·¥¹¥Æ¥à¤ÇÍøÍѤǤ­¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.\" getnetgrent_r() is on Solaris 8 and AIX 5.1, but not the BSDs. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O In the BSD implementation, +.\"O .BR setnetgrent () +.\"O returns void. +BSD ¤Î¼ÂÁõ¤Ç¤Ï +.BR setnetgrent () +¤Ï void ¤òÊÖ¤¹¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sethostent (3), +.BR setprotoent (3), +.BR setservent (3) diff --git a/draft/man3/shm_open.3 b/draft/man3/shm_open.3 new file mode 100644 index 00000000..98085417 --- /dev/null +++ b/draft/man3/shm_open.3 @@ -0,0 +1,477 @@ +.\" 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. +.\" +.\" 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 +.\" +.TH SHM_OPEN 3 2009-02-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O shm_open, shm_unlink \- Create/open or unlink POSIX shared memory objects +shm_open, shm_unlink \- POSIX ¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ÎºîÀ®/¥ª¡¼¥×¥ó¡¢ +ºï½ü¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.\"O .BR "#include " " /* For mode constants */" +.BR "#include " " /* mode Äê¿ôÍÑ */" +.br +.\"O .BR "#include " " /* For O_* constants */" +.BR "#include " " /* O_* Äê¿ô¤ÎÄêµÁÍÑ */" +.sp +.BI "void * shm_open(const char *" name ", int " oflag ", mode_t " mode ); +.sp +.BI "int shm_unlink(const char *" name ); +.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 () +¤ÇºîÀ®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤Îºï½ü¤ò¹Ô¤¦¡£ +.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. +.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 +¤Î¤¤¤º¤ì¤«°ìÊý¤È¡¢°Ê²¼¤Ë½Ò¤Ù¤ë¾¤Î¥Õ¥é¥°¤ÎÏÀÍýϤò¤È¤Ã¤¿¤â¤Î +¤ò»ØÄꤹ¤ë¡£ +.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 +.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 +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ë¤è¤êÆÀ¤é¤ì¤ë)¡£ +.sp +.\"O A new shared memory object initially has zero length \(em the 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 ¥Ð¥¤¥È¤ËÀÚ¤êµÍ¤á¤ë¡£ +.LP +.\"O Definitions of these flag values can be obtained by including +.\"O .IR . +¤³¤ì¤é¤Î¥Õ¥é¥°ÃͤÎÄêµÁ¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ë¤è¤êÆÀ¤é¤ì¤ë¡£ +.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) +¤ò¸Æ¤Ó½Ð¤·¤¿¸å¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤·¤Æ¤â¤è¤¯¡¢ +¥¯¥í¡¼¥º¤·¤Æ¤â¥á¥â¥ê¡¦¥Þ¥Ã¥Ô¥ó¥°¤Ë±Æ¶Á¤òÍ¿¤¨¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.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 +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¿·¤·¤¯Ê̤Υª¥Ö¥¸¥§¥¯¥È¤¬ºîÀ®¤µ¤ì¤ë)¡£ +.\"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 +.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 +¤Ç»ØÄꤵ¤ì¤¿¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤¬´û¤Ë¸ºß¤·¤¿¡£ +.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 +.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 +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O These functions are provided in glibc 2.2 and later. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc 2.2 °Ê¹ß¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +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" +.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 \(em this may not be so on other Unix systems. +POSIX ¤Ï +.B O_RDONLY +¤È +.B O_TRUNC +¤¬°ì½ï¤Ë»ØÄꤵ¤ì¤¿¾ì¹ç¤ÎÆ°ºî¤ò̤ÄêµÁ¤Ë¤·¤Æ¤¤¤ë¡£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" +.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) diff --git a/draft/man3/siginterrupt.3 b/draft/man3/siginterrupt.3 new file mode 100644 index 00000000..5958ba55 --- /dev/null +++ b/draft/man3/siginterrupt.3 @@ -0,0 +1,132 @@ +.\" 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 Sun Jul 25 10:40:51 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Apr 14 16:20:34 1996 by Andries Brouwer (aeb@cwi.nl) +.\" +.\" Japanese Version Copyright (c) 1998 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sun May 24 13:44:00 JST 1998 +.\" by HANATAKA Shinya +.\" +.TH SIGINTERRUPT 3 2009-03-15 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O siginterrupt \- allow signals to interrupt system calls +siginterrupt \- ¥·¥°¥Ê¥ë¤Ç¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ë³ä¤ê¹þ¤à¤³¤È¤òµö¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int siginterrupt(int " sig ", int " flag ); +.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 siginterrupt (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR siginterrupt () +.\"O function changes the restart behavior when +.\"O a system call is interrupted by the signal \fIsig\fP. +.\"O If the \fIflag\fP +.\"O argument is false (0), then system calls will be restarted if interrupted +.\"O by the specified signal \fIsig\fP. +.\"O This is the default behavior in Linux. +.\"O However, when a new signal handler is specified with the +.\"O .BR signal (2) +.\"O function, the system call is interrupted by default. +.BR siginterrupt () +´Ø¿ô¤Ï¡¢¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬¥·¥°¥Ê¥ë \fIsig\fP +¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¸å¡¢ºÆ¼Â¹Ô¤ÎºÝ¤Î¿¶¤ëÉñ¤¤¤òÊѹ¹¤¹¤ë¡£ +\fIflag\fP °ú¤­¿ô¤¬µ¶ (0) ¤Ê¤é¤Ð¡¢¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬»ØÄꤷ¤¿ +¥·¥°¥Ê¥ë \fIsig\fP ¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¸å¤Ë¡¢¤½¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï +ºÆ¼Â¹Ô¤µ¤ì¤ë¡£¤³¤ì¤Ï Linux ¤Ë¤ª¤¤¤Æ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ç¤¢¤ë¡£°ìÊý¡¢ +.BR signal (2) +´Ø¿ô¤Ç¿·¤·¤¤¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¡¼¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï +¥Ç¥Õ¥©¥ë¥È¤Ç¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ÏÃæÃǤµ¤ì¤ë¡£ +.PP +.\"O If the \fIflag\fP argument is true (1) and no data has been transferred, +.\"O then a system call interrupted by the signal \fIsig\fP will return \-1 +.\"O and \fIerrno\fP will be set to +.\"O .BR EINTR . +\fIflag\fP °ú¤­¿ô¤¬¿¿ (1) ¤Ç¥Ç¡¼¥¿¤ÎžÁ÷¤¬Á´¤¯¹Ô¤Ê¤ï¤ì¤Æ¤¤¤Ê¤¤¤Ê¤é¤Ð¡¢ +¥·¥°¥Ê¥ë \fIsig\fP ¤Ç¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ÏÃæÃǤµ¤ì¤Æ¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +\fIerrno\fP ¤Ë +.B EINTR +¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O If the \fIflag\fP argument is true (1) and data transfer has started, +.\"O then the system call will be interrupted and will return the actual +.\"O amount of data transferred. +\fIflag\fP °ú¤­¿ô¤¬¿¿ (1) ¤Ç¥Ç¡¼¥¿¤ÎžÁ÷¤¬³«»Ï¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢ +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ÏÃæÃǤµ¤ì¡¢¤½¤ì¤Þ¤Ç¤Ë¼ÂºÝ¤ËžÁ÷¤µ¤ì¤¿¥Ç¡¼¥¿ +¤ÎÎ̤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR siginterrupt () +.\"O function returns 0 on success, or \-1 if the +.\"O signal number \fIsig\fP is invalid. +.BR siginterrupt () +´Ø¿ô¤ÏÀ®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£ +¥·¥°¥Ê¥ëÈÖ¹æ \fIsig\fP ¤¬ÉÔÀµ¤Ê¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O The specified signal number is invalid. +»ØÄꤷ¤¿¥·¥°¥Ê¥ëÈֹ椬ÉÔÀµ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD, POSIX.1-2001. +.\"O POSIX.1-2008 marks +.\"O .BR siginterrupt () +.\"O as obsolete, recommending the use of +.\"O .BR sigaction (2) +.\"O with the +.\"O .B SA_RESTART +.\"O flag instead. +POSIX.1-2008 ¤Ï¡¢ +.BR siginterrupt () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +Âå¤ï¤ê¤Ë¡¢ +.BR sigaction (2) +¤Ë +.B SA_RESTART +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ»È¤¦¤³¤È¤ò¿ä¾©¤·¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR signal (2) diff --git a/draft/man3/signbit.3 b/draft/man3/signbit.3 new file mode 100644 index 00000000..e44ff375 --- /dev/null +++ b/draft/man3/signbit.3 @@ -0,0 +1,96 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 +.\" +.TH SIGNBIT 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O signbit \- test sign of a real floating-point number +signbit \- ÉâÆ°¾®¿ôÅÀ¼Â¿ô¤ÎÉä¹æ (sign) ¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B "#include " +.sp +.BI "int signbit(" x ");" +.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) +»²¾È): +.in +.sp +.ad l +.BR signbit (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 +¤ÎÃͤÎÉä¹æ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢Èó 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 ¤ÎÃͤòÊÖ¤¹¡£ + +.\"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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR copysign (3) diff --git a/draft/man3/significand.3 b/draft/man3/significand.3 new file mode 100644 index 00000000..bafbfe0e --- /dev/null +++ b/draft/man3/significand.3 @@ -0,0 +1,79 @@ +.\" 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 +.\" +.TH SIGNIFICAND 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O significand, significandf, significandl \- +.\"O get mantissa of floating-point number +significand, significandf, significandl \- ÉâÆ°¾®¿ôÅÀ¿ô¤Î²¾¿ô (mantissa) ¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double significand(double " x ); +.br +.BI "float significandf(float " x ); +.br +.BI "long double significandl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR significand (), +.BR significandf (), +.BR significandl (): +_SVID_SOURCE || _BSD_SOURCE +.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 +¤³¤ì¤Ï¡¢°Ê²¼¤ÈÅù¤·¤¤¡£ +.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 ´ØÏ¢¹àÌÜ +.BR ilogb (3), +.BR scalb (3) diff --git a/draft/man3/sigpause.3 b/draft/man3/sigpause.3 new file mode 100644 index 00000000..72874e09 --- /dev/null +++ b/draft/man3/sigpause.3 @@ -0,0 +1,183 @@ +.\" Copyright (C) 2004 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. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-03-03, HANATAKA Shinya +.\" Updated 2005-12-05, Akihiro MOTOKI +.\" Catch up to LDP man-pages 2.16 +.\" Rename sigpause.2 to sigpause.3, and modified a little. +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: interrupt ³ä¤ê¹þ¤ß +.\"WORD: mask ¥Þ¥¹¥¯ +.\"WORD: block ¥Ö¥í¥Ã¥¯¤¹¤ë +.\" +.TH SIGPAUSE 3 2005-12-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigpause \- atomically release blocked signals and wait for interrupt +sigpause \- ¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤ò¥¢¥È¥ß¥Ã¥¯¤Ë²òÊü¤·¤Æ³ä¤ê¹þ¤ß¤òÂÔ¤Ä +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sigpause(int " sigmask "); /* BSD */" +.sp +.BI "int sigpause(int " sig "); /* System V / Unix95 */" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Don't use this function. +.\"O Use +.\"O .BR sigsuspend (2) +.\"O instead. +¤³¤Î´Ø¿ô¤ò»È¤ï¤Ê¤¤¤³¤È¡£ +Âå¤ï¤ê¤Ë +.BR sigsuspend (2) +¤ò»È¤¦¤³¤È¡£ +.LP +.\"O The function +.\"O .BR sigpause () +.\"O is designed to wait for some signal. +´Ø¿ô +.BR sigpause () +¤Ï¥·¥°¥Ê¥ë¤òÂԤĤ褦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +.\"O It changes the process's signal mask (set of blocked signals), +.\"O and then waits for a signal to arrive. +.\"O Upon arrival of a signal, the original signal mask is restored. +¤³¤Î´Ø¿ô¤Ï¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯ (¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î¥»¥Ã¥È) ¤òÊѹ¹¤·¡¢ +¥·¥°¥Ê¥ë¤¬ÅþÃ夹¤ë¤Î¤òÂԤġ£ +¥·¥°¥Ê¥ë¤¬ÅþÃ夹¤ë¤È¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï¸µ¤ËÌᤵ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O If +.\"O .BR sigpause () +.\"O returns, it was interrupted by a signal and the return value is \-1 +.\"O with +.\"O .I errno +.\"O set to +.\"O .BR EINTR . +.BR sigpause () +¤¬Ê֤俾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤Æ¤¤¤ë¡£ +ÊÖ¤êÃÍ¤Ï \-1 ¤Ç¡¢ +.I errno +¤Ï +.B EINTR +¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O The System V version of +.\"O .BR sigpause () +.\"O is standardized in POSIX.1-2001. +System V ÈǤΠ+.BR sigpause () +¤Ï POSIX.1-2001 ¤Çɸ½à²½¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH È÷¹Í +.\"O .SS History +.SS Îò»Ë +.\"O The classical BSD version of this function appeared in 4.2BSD. +.\"O It sets the process's signal mask to +.\"O .IR sigmask . +.\"O Unix95 standardized the incompatible System V version of +.\"O this function, which removes only the specified signal +.\"O .I sig +.\"O from the process's signal mask. +.\"O .\" __xpg_sigpause: Unix 95, spec 1170, SVID, SVr4, XPG +.\"O The unfortunate situation with two incompatible functions with the +.\"O same name was solved by the +.\"O .BR \%sigsuspend (2) +.\"O function, that takes a +.\"O .I "sigset_t *" +.\"O argument (instead of an +.\"O .IR int ). +¤³¤Î´Ø¿ô¤Î¸ÅŵŪ¤Ê BSD ÈÇ¤Ï 4.2BSD ¤ÇÅо줷¤¿¡£ +¤³¤Î´Ø¿ô¤Ï¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò +.I sigmask +¤ËÀßÄꤹ¤ë¡£ +Unix95 ¤Ç¤Ï BSD ÈǤȸߴ¹À­¤Î¤Ê¤¤ System V ÈǤΤ³¤Î´Ø¿ô¤¬É¸½à²½¤µ¤ì¤¿¡£ +Unix95 ÈǤϡ¢»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë +.I sig +¤ò¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤«¤éºï½ü¤¹¤ë¤À¤±¤Ç¤¢¤ë¡£ +.\" __xpg_sigpause: Unix 95, spec 1170, SVID, SVr4, XPG +Ʊ¤¸Ì¾Á°¤Ç¸ß´¹À­¤Î¤Ê¤¤ 2 ¤Ä¤Î´Ø¿ô¤¬¤¢¤ë¤È¤¤¤¦ÉÔ¹¬¤Ê»öÂ֤ϡ¢ +.BR \%sigsuspend (2) +´Ø¿ô¤Ë¤è¤Ã¤Æ²ò¾Ã¤µ¤ì¤¿¡£ +¤³¤Î´Ø¿ô¤Ï +.RI ( int +¤ÎÂå¤ï¤ê¤Ë) +.B "sigset_t *" +°ú¤­¿ô¤ò¤È¤ë¡£ +.\"O .SS Linux Notes +.SS Linux ¤Ç¤ÎÃí°Õ +.\"O On Linux, this routine is a system call only on the Sparc (sparc64) +.\"O architecture. +Linux ¤Ç¤Ï¡¢¤³¤Î¥ë¡¼¥Á¥ó¤Ï Sparc (sparc64) ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Î¤ß +¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ + +.\"O Libc4 and libc5 only know about the BSD version. +libc4 ¤È libc5 ¤Ë¤Ï BSD ÈǤ·¤«¤Ê¤¤¡£ + +.\"O Glibc uses the BSD version if the +.\"O .B _BSD_SOURCE +.\"O feature test macro is defined and none of +.\"O .BR _POSIX_SOURCE , +.\"O .BR _POSIX_C_SOURCE , +.\"O .BR _XOPEN_SOURCE , +.\"O .BR _GNU_SOURCE , +.\"O or +.\"O .B _SVID_SOURCE +.\"O is defined. +.\"O The System V version is used if +.\"O .B _XOPEN_SOURCE +.\"O is defined. +µ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _BSD_SOURCE +¤¬ÄêµÁ¤µ¤ì¡¢ +.BR _POSIX_SOURCE , +.BR _POSIX_C_SOURCE , +.BR _XOPEN_SOURCE , +.BR _GNU_SOURCE , +.B _SVID_SOURCE +¤Î¤¤¤º¤ì¤âÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +glibc ¤Ï BSD ÈǤò»È¤¦¡£ +.B _XOPEN_SOURCE +¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¡¢System V ÈǤò»ÈÍѤ¹¤ë¡£ +.\" +.\"O .\" For the BSD version, one usually uses a zero +.\"O .\" .I sigmask +.\"O .\" to indicate that no signals are to be blocked. +.\" BSD ÈǤǤϡ¢ +.\" .RI ¡Ö sigmask +.\" ¤ò 0 ¤Ë¤·¤Æ¡¢¤É¤Î¥·¥°¥Ê¥ë¤â¥Ö¥í¥Ã¥¯¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡× +.\" ¤È¤¤¤¦¤Î¤¬¤è¤¯»È¤ï¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigaction (2), +.BR sigprocmask (2), +.BR sigsuspend (2), +.BR sigblock (3), +.BR sigvec (3), +.BR feature_test_macros (7) diff --git a/draft/man3/sigset.3 b/draft/man3/sigset.3 new file mode 100644 index 00000000..0cad3296 --- /dev/null +++ b/draft/man3/sigset.3 @@ -0,0 +1,452 @@ +'\" t +.\" Copyright (c) 2005 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. +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-12-04, Akihiro MOTOKI +.\" +.TH SIGSET 3 2009-03-15 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigset, sighold, sigrelse, sigignore \- System V signal API +sigset, sighold, sigrelse, sigignore \- System V ÈÇ¥·¥°¥Ê¥ë API +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _XOPEN_SOURCE 500 +.br +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "sighandler_t sigset(int " sig ", sighandler_t " disp ); +.sp +.BI "int sighold(int " sig ); +.sp +.BI "int sigrelse(int " sig ); +.sp +.BI "int sigignore(int " sig ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These functions are provided in glibc as a compatibility interface +.\"O for programs that make use of the historical System V signal API. +.\"O This API is obsolete: new applications should use the POSIX signal API +.\"O .RB ( sigaction (2), +.\"O .BR sigprocmask (2), +.\"O etc.) +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ÀΤʤ¬¤é¤Î System V ÈÇ¥·¥°¥Ê¥ë API ¤ò»ÈÍѤ·¤Æ¤¤¤ë¥×¥í¥°¥é¥à +¤ËÂФ·¤Æ¸ß´¹À­¤Î¤¢¤ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò glibc ¤ÇÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î API ¤Ï²áµî¤Î¤â¤Î¤Ç¤¢¤ê¡¢¿·¤·¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï +POSIX ¥·¥°¥Ê¥ë API +.RB ( sigaction (2), +.BR sigprocmask (2) +¤Ê¤É) ¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O The +.\"O .BR sigset () +.\"O function modifies the disposition of the signal +.\"O .IR sig . +.\"O The +.\"O .I disp +.\"O argument can be the address of a signal handler function, +.\"O or one of the following constants: +´Ø¿ô +.BR sigset () +¤Ï¥·¥°¥Ê¥ë +.I sig +¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¡£ +.I disp +°ú¤­¿ô¤Ë¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Î¥¢¥É¥ì¥¹¤«¡¢ +°Ê²¼¤ÎÄê¿ô¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄê¤Ç¤­¤ë¡£ +.TP +.B SIG_DFL +.\"O Reset the disposition of +.\"O .I sig +.\"O to the default. +.I sig +¤ÎÆ°ºî¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤¹¤ë¡£ +.TP +.B SIG_IGN +.\"O Ignore +.\"O .IR sig . +.I sig +¤ò̵»ë¤¹¤ë¡£ +.TP +.B SIG_HOLD +.\"O Add +.\"O .I sig +.\"O to the process's signal mask, but leave the disposition of +.\"O .I sig +.\"O unchanged. +¤½¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë +.I sig +¤òÄɲ乤뤬¡¢ +.I sig +¤ÎÆ°ºî¤ÏÊѹ¹¤·¤Ê¤¤¡£ +.PP +.\"O If +.\"O .I disp +.\"O specifies the address of a signal handler, then +.\"O .I sig +.\"O is added to the process's signal mask during execution of the handler. +.I disp +¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¥¢¥É¥ì¥¹¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë +.I sig +¤¬Äɲ䵤ì¤ë¡£ +.PP +.\"O If +.\"O .I disp +.\"O was specified as a value other than +.\"O .BR SIG_HOLD , +.\"O then +.\"O .I sig +.\"O is removed from the process's signal mask. +.I disp +¤Ë +.B SIG_HOLD +°Ê³°¤ÎÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +¤½¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤«¤é +.I sig +¤¬ºï½ü¤µ¤ì¤ë¡£ +.PP +.\"O The dispositions for +.\"O .B SIGKILL +.\"O and +.\"O .B SIGSTOP +.\"O cannot be changed. +¥·¥°¥Ê¥ë +.B SIGKILL +¤È +.B SIGSTOP +¤ËÂФ¹¤ëÆ°ºî¤ÏÊѹ¹¤Ç¤­¤Ê¤¤¡£ +.PP +.\"O The +.\"O .BR sighold () +.\"O function adds +.\"O .I sig +.\"O to the calling process's signal mask. +´Ø¿ô +.BR sighold () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë +.I sig +¤òÄɲ乤롣 + +.\"O The +.\"O .BR sigrelse () +.\"O function removes +.\"O .I sig +.\"O from the calling process's signal mask. +´Ø¿ô +.BR sigrelse () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤«¤é +.I sig +¤òºï½ü¤¹¤ë¡£ + +.\"O The +.\"O .BR sigignore () +.\"O function sets the disposition of +.\"O .I sig +.\"O to +.\"O .BR SIG_IGN . +´Ø¿ô +.BR sigignore () +¤Ï¡¢ +.I sig +¤ÎÆ°ºî¤ò +.B SIG_IGN +¤ËÀßÄꤹ¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR sigset () +.\"O returns +.\"O .B SIG_HOLD +.\"O if +.\"O .I sig +.\"O was blocked before the call, +.\"O or the signal's previous disposition +.\"O if it was not blocked before the call. +.BR sigset () +¤ÏÀ®¸ù¤¹¤ë¤È¡¢ +¸Æ¤Ó½Ð¤·Á°¤Ë +.I sig +¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï +.B SIG_HOLD +¤òÊÖ¤·¡¢ +¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï +Êѹ¹Á°¤Î¤½¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤òÊÖ¤¹¡£ +.\"O On error, +.\"O .BR sigset () +.\"O returns \-1, with +.\"O .I errno +.\"O set to indicate the error. +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR sigset () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O (But see BUGS below.) +⤷¡¢°Ê²¼¤Î¡Ö¥Ð¥°¡×¤ÎÀá¤â»²¾È¤Î¤³¤È¡£ + +.\"O The +.\"O .BR sighold (), +.\"O .BR sigrelse (), +.\"O and +.\"O .BR sigignore () +.\"O functions return 0 on success; on error, these functions return \-1 and set +.\"O .I errno +.\"O to indicate the error. +´Ø¿ô +.BR sighold (), +.BR sigrelse (), +.BR sigignore () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O For +.\"O .BR sigset () +.\"O see the ERRORS under +.\"O .BR sigaction (2) +.\"O and +.\"O .BR sigprocmask (2). +.BR sigset () +¤Ë´Ø¤·¤Æ¤Ï¡¢ +.BR sigaction (2) +¤È +.BR sigprocmask (2) +¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£ + +.\"O For +.\"O .BR sighold () +.\"O and +.\"O .BR sigrelse () +.\"O see the ERRORS under +.\"O .BR sigprocmask (2). +.BR sighold () +¤È +.BR sigrelse () +¤Ë´Ø¤·¤Æ¤Ï¡¢ +.BR sigprocmask (2) +¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£ + +.\"O For +.\"O .BR sigignore (), +.\"O see the errors under +.\"O .BR sigaction (2). +.BR sigignore () +¤Ë´Ø¤·¤Æ¤Ï¡¢ +.BR sigaction (2) +¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O These functions are obsolete: do not use them in new programs. +¤³¤ì¤é¤Î´Ø¿ô¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ·¤Ê¤¤¤³¤È¡£ +.\"O POSIX.1-2008 marks +.\"O .BR sighold (), +.\"O .BR sigignore (), +.\"O .BR sigpause (), +.\"O .BR sigrelse (), +.\"O and +.\"O .BR sigset () +.\"O as obsolete, recommending the use of +.\"O .BR sigaction (2), +.\"O .BR sigprocmask (2), +.\"O .BR pthread_sigmask (3), +.\"O and +.\"O .BR sigsuspend (2) +.\"O instead. +POSIX.1-2008 ¤Ï¡¢ +.BR sighold (), +.BR sigignore (), +.BR sigpause (), +.BR sigrelse (), +.BR sigset () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +Âå¤ï¤ê¤Ë¡¢ +.BR sigaction (2), +.BR sigprocmask (2), +.BR pthread_sigmask (3), +.BR sigsuspend (2) +¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O These functions appeared in glibc version 2.1. +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc 2.1 ¤ÇÅо줷¤¿¡£ + +.\"O The +.\"O .I sighandler_t +.\"O type is a GNU extension; it is only used on this page to make the +.\"O .BR sigset () +.\"O prototype more easily readable. +.I sighandler_t +·¿¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ê¡¢¤³¤Î man page ¤Ç +.BR sigset () +¤Î¥×¥í¥È¥¿¥¤¥×¤ò¤è¤êÆɤߤ䤹¤¯¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤Æ¤¤¤ë¤À¤±¤Ç¤¢¤ë¡£ + +.\"O The +.\"O .BR sigset () +.\"O function provides reliable signal handling semantics (as when calling +.\"O .BR sigaction (2) +.\"O with +.\"O .I sa_mask +.\"O equal to 0). +´Ø¿ô +.BR sigset () +¤Ï¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýµ¡¹½¤òÄ󶡤¹¤ë +.RI ( sa_mask +¤ò 0 ¤Ç +.BR sigaction (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤­¤ÈƱÍÍ)¡£ + +.\"O On System V, the +.\"O .BR signal () +.\"O function provides unreliable semantics (as when calling +.\"O .BR sigaction (2) +.\"O with +.\"O .I sa_mask +.\"O equal to +.\"O .IR "SA_RESETHAND | SA_NODEFER" ). +System V ¤Ç¤Ï¡¢´Ø¿ô +.BR signal () +¤¬Ä󶡤¹¤ë½èÍýµ¡¹½¤Ï¿®ÍêÀ­¤Î¤Ê¤¤¤â¤Î¤Ç¤¢¤ë +.RI ( sa_mask +¤ò +.IR "SA_RESETHAND | SA_NODEFER" +¤È¤·¤Æ +.BR sigaction (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤­¤ÈƱÍÍ)¡£ +.\"O On BSD, +.\"O .BR signal () +.\"O provides reliable semantics. +BSD ¤Ç¤Ï¡¢ +.BR signal () +¤Ï¿®ÍêÀ­¤Î¤¢¤ë½èÍýµ¡¹½¤òÄ󶡤¹¤ë¡£ +.\"O POSIX.1-2001 leaves these aspects of +.\"O .BR signal () +.\"O unspecified. +POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR signal () +¤Î¤³¤ÎÅÀ¤Ïµ¬Äꤷ¤Ê¤¤¤Þ¤Þ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O See +.\"O .BR signal (2) +.\"O for further details. +¤µ¤é¤Ê¤ë¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR signal (2) +¤ò»²¾È¡£ + +.\"O In order to wait for a signal, +.\"O BSD and System V both provided a function named +.\"O .BR sigpause (3), +.\"O but this function has a different argument on the two systems. +.\"O See +.\"O .BR sigpause (3) +.\"O for details. +BSD ¤È System V ¤Î¤É¤Á¤é¤Î¥·¥¹¥Æ¥à¤Ç¤â +¥·¥°¥Ê¥ë¤òÂԤĤ¿¤á¤Ë¡¢ +.BR sigpause (3) +¤È¤¤¤¦Ì¾Á°¤Î´Ø¿ô¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +¤³¤Î´Ø¿ô¤Î°ú¤­¿ô¤ÏξÊý¤Î¥·¥¹¥Æ¥à¤Ç°Û¤Ê¤ë¡£ +¾ÜºÙ¤Ï +.BR sigpause (3) +¤ò»²¾È¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O In versions of glibc before 2.2, +.\"O .BR sigset () +.\"O did not unblock +.\"O .I sig +.\"O if +.\"O .I disp +.\"O was specified as a value other than +.\"O .BR SIG_HOLD . +2.2 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢ +.I disp +¤Ë +.B SIG_HOLD +°Ê³°¤ÎÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.I sig +¤Î¥Ö¥í¥Ã¥¯²ò½ü¤ò¹Ô¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ + +.\"O In all versions of glibc up to and including 2.3.5, +.\"O .BR sigset () +.\"O does not correctly return the previous disposition of the signal +.\"O in two cases. +2.3.5 °ÊÁ°¤ÎÁ´¤Æ¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢ +.BR sigset () +¤¬Êѹ¹Á°¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤òÀµ¤·¤¯ÊÖ¤µ¤Ê¤¤¾ì¹ç¤¬ 2¤Ä¤¢¤ë¡£ +.\"O First, if +.\"O .I disp +.\"O is specified as +.\"O .BR SIG_HOLD , +.\"O then a successful +.\"O .BR sigset () +.\"O always returns +.\"O .BR SIG_HOLD . +.\"O Instead, it should return the previous disposition of the signal +.\"O (unless the signal was blocked, in which case +.\"O .B SIG_HOLD +.\"O should be returned). +°ì¤Ä¤á¤Ï¡¢ +.I disp +¤Ë +.B SIG_HOLD +¤¬»ØÄꤵ¤ì¤ë¤È¡¢À®¸ù¤·¤¿¾ì¹ç +.BR sigset () +¤Ï¾ï¤Ë +.B SIG_HOLD +¤òÊÖ¤¹¤³¤È¤Ç¤¢¤ë¡£ +Àµ¤·¤¯¤Ï¡¢(¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï) +Êѹ¹Á°¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤òÊÖ¤¹¤Ù¤­¤Ç¤¢¤ë +(¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¡¢ +.B SIG_HOLD +¤¬ÊÖ¤µ¤ì¤ë)¡£ +.\"O Second, if the signal is currently blocked, then +.\"O the return value of a successful +.\"O .BR sigset () +.\"O should be +.\"O .BR SIG_HOLD . +.\"O Instead, the previous disposition of the signal is returned. +¤â¤¦°ì¤Ä¤Ï¡¢¥·¥°¥Ê¥ë¤¬¸½ºß¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +À®¸ù¤·¤¿¾ì¹ç¤Î +.BR sigset () +¤ÎÊÖ¤êÃÍ¤Ï +.B SIG_HOLD +¤Ë¤Ê¤ë¤Ù¤­¤Ç¤¢¤ë¤¬¡¢¼ÂºÝ¤Ë¤Ï +Êѹ¹Á°¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤Ç¤¢¤ë¡£ +.\"O These problems have been fixed since glibc 2.5. +¤³¤ì¤é¤ÎÌäÂê¤Ï glibc 2.5 °Ê¹ß¤Ç½¤Àµ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" See http://sourceware.org/bugzilla/show_bug.cgi?id=1951 +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR pause (2), +.BR sigaction (2), +.BR signal (2), +.BR sigprocmask (2), +.BR raise (3), +.BR sigpause (3), +.BR sigvec (3), +.BR feature_test_macros (7), +.BR signal (7) diff --git a/draft/man3/sigsetops.3 b/draft/man3/sigsetops.3 new file mode 100644 index 00000000..53301da2 --- /dev/null +++ b/draft/man3/sigsetops.3 @@ -0,0 +1,270 @@ +.\" Copyright (c) 1994 Mike Battersby +.\" +.\" 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 aeb, 960721 +.\" 2005-11-21, mtk, added descriptions of sigisemptyset(), sigandset(), +.\" and sigorset() +.\" 2007-10-26 mdw added wording that a sigset_t must be initialized +.\" prior to use +.\" +.\"WORD: signal set ¥·¥°¥Ê¥ë½¸¹ç +.\" +.\" Japanese Version Copyright (c) 1998 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1998-05-24, HANATAKA Shinya +.\" Updated 2005-12-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.16 +.\" Updated 2008-02-09, Akihiro MOTOKI , LDP v2.77 +.\" +.TH SIGSETOPS 3 2008-09-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigemptyset, sigfillset, sigaddset, sigdelset, sigismember \- POSIX +.\"O signal set operations. +sigemptyset, sigfillset, sigaddset, sigdelset, sigismember \- POSIX +¥·¥°¥Ê¥ë½¸¹ç¤ÎÁàºî +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int sigemptyset(sigset_t *" set ); +.sp +.BI "int sigfillset(sigset_t *" set ); +.sp +.BI "int sigaddset(sigset_t *" set ", int " signum ); +.sp +.BI "int sigdelset(sigset_t *" set ", int " signum ); +.sp +.BI "int sigismember(const sigset_t *" set ", int " signum ); +.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 sigemptyset (), +.BR sigfillset (), +.BR sigaddset (), +.BR sigdelset (), +.BR sigismember (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These functions allow the manipulation of POSIX signal sets. +¤³¤ì¤é¤Î´Ø¿ô¤Ï POSIX ¥·¥°¥Ê¥ë½¸¹ç(signal set)¤òÁàºî¤¹¤ë¤¿¤á»ÈÍѤ¹¤ë¡£ +.PP +.\"O .BR sigemptyset () +.\"O initializes the signal set given by +.\"O .I set +.\"O to empty, with all signals excluded from the set. +.BR sigemptyset () +¤Ï +.I set +¤ÇÍ¿¤¨¤é¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤ò¶õ¤Ë½é´ü²½¤·¡¢¥·¥°¥Ê¥ë¤¬°ì¤Ä¤â +´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾õÂ֤ˤ¹¤ë¡£ +.PP +.\"O .BR sigfillset () +.\"O initializes +.\"O .I set +.\"O to full, including all signals. +.BR sigfillset () +¤Ï +.I set +¤ÇÍ¿¤¨¤é¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤¬Á´¤Æ¤Î¥·¥°¥Ê¥ë¤ò´Þ¤à¤è¤¦¤Ë¤¹¤ë¡£ +.PP +.\"O .BR sigaddset () +.\"O and +.\"O .BR sigdelset () +.\"O add and delete respectively signal +.\"O .I signum +.\"O from +.\"O .IR set . +.BR sigaddset () +¤È +.BR sigdelset () +¤Ï +.I set +¤Ë +.I signum +¥·¥°¥Ê¥ë¤ò¤½¤ì¤¾¤ì²Ã¤¨¤¿¤ê¡¢ºï½ü¤·¤¿¤ê¤¹¤ë¡£ +.PP +.\"O .BR sigismember () +.\"O tests whether +.\"O .I signum +.\"O is a member of +.\"O .I set . +.BR sigismember () +¤Ï +.I signum +¤¬ +.I set +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¥Æ¥¹¥È¤¹¤ë¡£ +.PP +.\"O Objects of type +.\"O .I sigset_t +.\"O must be initialized by a call to either +.\"O .BR sigemptyset () +.\"O or +.\"O .BR sigfillset () +.\"O before being passed to the functions +.\"O .BR sigaddset (), +.\"O .BR sigdelset () +.\"O and +.\"O .BR sigismember () +.\"O or the additional glibc functions described below +.\"O .RB ( sigisemptyset (), +.\"O .BR sigandset (), +.\"O and +.\"O .BR sigorset ()). +.\"O The results are undefined if this is not done. +.I sigset_t +·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢´Ø¿ô +.BR sigaddset (), +.BR sigdelset (), +.BR sigismember () +¤ä¸å½Ò¤Î glibc ¤ÎÄɲôؿô +.RB ( sigisemptyset (), +.BR sigandset (), +.BR sigorset ()) +¤ËÅϤ¹Á°¤Ë¡¢ +.BR sigemptyset () +¤« +.BR sigfillset () +¤ò¸Æ¤Ó½Ð¤·¤Æ½é´ü²½¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +½é´ü²½¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Î·ë²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR sigemptyset (), +.\"O .BR sigfillset (), +.\"O .BR sigaddset (), +.\"O and +.\"O .BR sigdelset () +.\"O return 0 on success and \-1 on error. +.BR sigemptyset (), +.BR sigfillset (), +.BR sigaddset (), +.BR sigdelset () +¤ÏÀ®¸ù¤¹¤ì¤Ð 0 ¤ò¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.PP +.\"O .BR sigismember () +.\"O returns 1 if +.\"O .I signum +.\"O is a member of +.\"O .IR set , +.\"O 0 if +.\"O .I signum +.\"O is not a member, and \-1 on error. +.BR sigismember () +¤Ï +.I signum +¤¬ +.I set +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ì¤Ð 1 ¤òÊÖ¤·¡¢´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O .I sig +.\"O is not a valid signal. +.I sig +¤¬Í­¸ú¤Ê¥·¥°¥Ê¥ë¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.\"O .SS Glibc Notes +.SH Ãí°Õ +.SS glibc ¤Ç¤ÎÃí°Õ +.\"O If the +.\"O .B _GNU_SOURCE +.\"O feature test macro is defined, then \fI\fP +.\"O exposes three other functions for manipulating signal +.\"O sets. +.B _GNU_SOURCE +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +\fI\fP ¤Ç¥·¥°¥Ê¥ë½¸¹ç¤òÁàºî¤¹¤ë 3¤Ä¤Î´Ø¿ô¤¬ÄɲäǸø³«¤µ¤ì¤ë¡£ +.TP +.BI "int sigisemptyset(sigset_t *" set ); +.\"O returns 1 if +.\"O .I set +.\"O contains no signals, and 0 otherwise. +.I set +¤Ë¥·¥°¥Ê¥ë¤¬°ì¤Ä¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð 1 ¤òÊÖ¤·¡¢ +¤½¤ì°Ê³°¤Ï 0 ¤òÊÖ¤¹¡£ +.TP +.BI "int sigorset(sigset_t *" dest ", sigset_t *" left \ +", sigset_t *" right ); +.\"O places the union of the sets +.\"O .I left +.\"O and +.\"O .I right +.\"O in +.\"O .IR dest . +¥·¥°¥Ê¥ë½¸¹ç +.I left +¤È +.I left +¤ÎϽ¸¹ç¤ò +.I dest +¤Ë½ñ¤­¹þ¤à¡£ +.TP +.BI "int sigandset(sigset_t *" dest ", sigset_t *" left \ +", sigset_t *" right ); +.\"O places the intersection of the sets +.\"O .I left +.\"O and +.\"O .I right +.\"O in +.\"O .IR dest . +¥·¥°¥Ê¥ë½¸¹ç +.I left +¤È +.I left +¤ÎÀѽ¸¹ç¤ò +.I dest +¤Ë½ñ¤­¹þ¤à¡£ +.PP +.\"O .BR sigorset () +.\"O and +.\"O .BR sigandset () +.\"O return 0 on success, and \-1 on failure. +.BR sigorset () +¤È +.BR sigandset () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤ò¡¢¼ºÇÔ¤¹¤ë¤È \-1 ¤òÊÖ¤¹¡£ +.PP +.\"O These functions are nonstandard (a few other systems provide similar +.\"O functions) and their use should be avoided in portable applications. +¤³¤ì¤é¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç¤¢¤ê¡¢(¾¤Ë¤âƱÍͤδؿô¤òÄ󶡤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â +¤¤¤¯¤Ä¤«¤Ï¤¢¤ë¤¬) °Ü¿¢À­¤ò¹Íθ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï»ÈÍѤòÈò¤±¤ë¤Ù¤­ +¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sigaction (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigsuspend (2) diff --git a/draft/man3/sigvec.3 b/draft/man3/sigvec.3 new file mode 100644 index 00000000..03fe7504 --- /dev/null +++ b/draft/man3/sigvec.3 @@ -0,0 +1,431 @@ +'\" t +.\" Copyright (c) 2005 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. +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-12-04, Akihiro MOTOKI +.\" +.TH SIGVEC 3 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigvec, sigblock, sigsetmask, siggetmask, sigmask \- BSD signal API +sigvec, sigblock, sigsetmask, siggetmask, sigmask \- BSD ÈÇ¥·¥°¥Ê¥ë API +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int sigvec(int " sig ", struct sigvec *" vec ", struct sigvec *" ovec ); +.sp +.BI "int sigmask(int " signum ); +.sp +.BI "int sigblock(int " mask ); +.sp +.BI "int sigsetmask(int " mask ); +.sp +.B int siggetmask(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 +.\"O All functions shown above: +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô: +_BSD_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These functions are provided in glibc as a compatibility interface +.\"O for programs that make use of the historical BSD signal API. +.\"O This API is obsolete: new applications should use the POSIX signal API +.\"O .RB ( sigaction (2), +.\"O .BR sigprocmask (2), +.\"O etc.) +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ÀΤʤ¬¤é¤Î BSD ÈÇ¥·¥°¥Ê¥ë API ¤ò»ÈÍѤ·¤Æ¤¤¤ë¥×¥í¥°¥é¥à +¤ËÂФ·¤Æ¸ß´¹À­¤Î¤¢¤ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò glibc ¤ÇÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î API ¤Ï²áµî¤Î¤â¤Î¤Ç¤¢¤ê¡¢¿·¤·¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï +POSIX ¥·¥°¥Ê¥ë API +.RB ( sigaction (2), +.BR sigprocmask (2) +¤Ê¤É) ¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O The +.\"O .BR sigvec () +.\"O function sets and/or gets the disposition of the signal +.\"O .I sig +.\"O (like the POSIX +.\"O .BR sigaction (2)). +´Ø¿ô +.BR sigvec () +¤Ï¡¢(POSIX ¤Î +.BR sigaction (2) +¤ÈƱÍͤË) ¥·¥°¥Ê¥ë +.I sig +¤ÎÆ°ºî¤ÎÀßÄꡦ¼èÆÀ¤ò¹Ô¤¦¡£ +.\"O If +.\"O .I vec +.\"O is not NULL, it points to a +.\"O .I sigvec +.\"O structure that defines the new disposition for +.\"O .IR sig . +.I vec +¤Ï¡¢NULL °Ê³°¤Î¾ì¹ç¡¢ +.I sig +¤Î¿·¤·¤¤Æ°ºî¤òÄêµÁ¤·¤¿ +.I sigvec +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +.\"O If +.\"O .I ovec +.\"O is not NULL, it points to a +.\"O .I sigvec +.\"O structure that is used to return the previous disposition of +.\"O .IR sig . +.I ovec +¤Ï¡¢NULL °Ê³°¤Î¾ì¹ç¡¢ +.I sig +¤ÎÊѹ¹Á°¤ÎÆ°ºî¤òÊÖ¤¹¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë +.I sigvec +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +.\"O To obtain the current disposition of +.\"O .I sig +.\"O without changing it, specify NULL for +.\"O .IR vec , +.\"O and a non-NULL pointer for +.\"O .IR ovec . +.I sig +¤ÎÆ°ºî¤òÊѹ¹¤»¤º¤Ë¸½ºß¤ÎÆ°ºî¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.I vec +¤Ë NULL ¤ò»ØÄꤷ¡¢ +.I ovec +¤Ë NULL ¤Ç¤Ê¤¤¥Ý¥¤¥ó¥¿¤ò»ØÄꤹ¤ì¤Ð¤è¤¤¡£ + +.\"O The dispositions for +.\"O .B SIGKILL +.\"O and +.\"O .B SIGSTOP +.\"O cannot be changed. +.B SIGKILL +¤È +.B SIGSTOP +¤ÎÆ°ºî¤ÏÊѹ¹¤Ç¤­¤Ê¤¤¡£ + +.\"O The +.\"O .I sigvec +.\"O structure has the following form: +.I sigvec +¹½Â¤ÂΤϰʲ¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.in +4n +.nf + +struct sigvec { + void (*sv_handler)(); /* Signal disposition */ + int sv_mask; /* Signals to be blocked in handler */ + int sv_flags; /* Flags */ +}; + +.fi +.in +.\"O The +.\"O .I sv_handler +.\"O field specifies the disposition of the signal, and is either: +.\"O the address of a signal handler function; or +.\"O .B SIG_DFL +.\"O meaning the default disposition applies for the signal; or +.\"O .B SIG_IGN +.\"O meaning that the signal is ignored. +.I sv_handler +¥Õ¥£¡¼¥ë¥É¤Ï¥·¥°¥Ê¥ë¤ÎÆ°ºî¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Î¥¢¥É¥ì¥¹¤«¡¢ +.B SIG_DFL +¤È +.B SIG_IGN +¤Î¤¤¤º¤ì¤«¤ò»ØÄê¤Ç¤­¤ë¡£ +.B SIG_DFL +¤Ï¥·¥°¥Ê¥ë¤ËŬÍѤµ¤ì¤ë¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤ò°ÕÌ£¤·¡¢ +.B SIG_IGN +¤Ï¥·¥°¥Ê¥ë¤ò̵»ë¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ + +.\"O If +.\"O .I sv_handler +.\"O specifies the address of a signal handler, then +.\"O .I sv_mask +.\"O specifies a mask of signals that are to be blocked while +.\"O the handler is executing. +.\"O In addition, the signal for which the handler is invoked is +.\"O also blocked by default. +.\"O Attempts to block +.\"O .B SIGKILL +.\"O or +.\"O .B SIGSTOP +.\"O are silently ignored. +.I sv_handler +¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ +.I sv_mask +¤Ï¥Ï¥ó¥É¥é¤¬¼Â¹ÔÃæ¤Ë¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¤Ù¤­¥·¥°¥Ê¥ë¤Î¥Þ¥¹¥¯¤ò»ØÄꤹ¤ë¡£ +¤Þ¤¿¡¢¥Ï¥ó¥É¥é¤òµ¯Æ°¤·¤¿¥·¥°¥Ê¥ë¼«¿È¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¡£ +.B SIGKILL +¤« +.B SIGSTOP +¤ò¥Ö¥í¥Ã¥¯¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ÌۤäÆ̵»ë¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I sv_handler +.\"O specifies the address of a signal handler, then the +.\"O .I sv_flags +.\"O field specifies flags controlling what happens when the handler is called. +.\"O This field may contain zero or more of the following flags: +.I sv_handler +¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ +.I sv_flags +¥Õ¥£¡¼¥ë¥É¤Ï¥Ï¥ó¥É¥é¤¬¸Æ¤Ð¤ì¤¿ºÝ¤ÎµóÆ°¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢0 ¤«¡¢°Ê²¼¤Î¥Õ¥é¥°¤ò 1¸Ä°Ê¾å»ØÄê¤Ç¤­¤ë: +.TP +.B SV_INTERRUPT +.\"O If the signal handler interrupts a blocking system call, +.\"O then upon return from the handler the system call will not be restarted: +.\"O instead it will fail with the error +.\"O .BR EINTR . +.\"O If this flag is not specified, then system calls are restarted +.\"O by default. +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬Ää»ßÃæ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÃæÃǤ·¤¿¾ì¹ç¡¢ +¥Ï¥ó¥É¥é¤«¤éÉüµ¢¤·¤Æ¤â¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏºÆ³«¤µ¤ì¤º¡¢ +¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +¥Ç¥Õ¥©¥ë¥È¤ÇºÆ³«¤µ¤ì¤ë¡£ +.TP +.B SV_RESETHAND +.\"O Reset the disposition of the signal to the default +.\"O before calling the signal handler. +.\"O If this flag is not specified, then the handler remains established +.\"O until explicitly removed by a later call to +.\"O .BR sigvec () +.\"O or until the process performs an +.\"O .BR execve (2). +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë¥·¥°¥Ê¥ë¤ÎÆ°ºî¤ò +¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¤â¤¦°ìÅÙ +.BR sigvec () +¤ò¸Æ¤Ó½Ð¤·¤ÆÌÀ¼¨Åª¤Ëºï½ü¤µ¤ì¤ë¤«¡¢¥×¥í¥»¥¹¤¬ +.BR execve (2) +¤ò¼Â¹Ô¤¹¤ë¤Þ¤Ç¡¢¥Ï¥ó¥É¥é¤ÏÀßÄꤵ¤ì¤¿¤Þ¤Þ¤È¤Ê¤ë¡£ +.TP +.B SV_ONSTACK +.\"O Handle the signal on the alternate signal stack +.\"O (historically established under BSD using the obsolete +.\"O .BR sigstack () +.\"O function; the POSIX replacement is +.\"O .BR sigaltstack (2)). +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò¼Â¹Ô¤¹¤ë +(Îò»ËŪ¤Ë¡¢BSD ¤Ç¤ÏÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ÏÇѻߤµ¤ì¤¿´Ø¿ô +.BR sigstack () +¤ò»È¤Ã¤ÆÀßÄꤹ¤ë¡£POSIX ¤Ç¤Ï¡¢Âå¤ï¤ê¤Ë +.BR sigaltstack (2) +¤ò»ÈÍѤ¹¤ë)¡£ +.PP +.\"O The +.\"O .BR sigmask () +.\"O function constructs and returns a "signal mask" for +.\"O .IR signum . +.\"O For example, we can initialize the +.\"O .I vec.sv_mask +.\"O field given to +.\"O .BR sigvec () +.\"O using code such as the following: +´Ø¿ô +.BR sigmask () +¤Ï +.I signum +¤ËÂФ¹¤ë¡Ö¥·¥°¥Ê¥ë¥Þ¥¹¥¯¡×¤ò¹½À®¤·¤ÆÊÖ¤¹¡£ +Î㤨¤Ð¡¢°Ê²¼¤Î¤è¤¦¤Ê¥³¡¼¥É¤ò»È¤¦¤È¡¢ +.BR sigvec () +¤ËÅϤ¹ +.I vec.sv_mask +¤ò½é´ü²½¤Ç¤­¤ë¡£ +.nf + + vec.sv_mask = sigmask(SIGQUIT) | sigpause(SIGABRT); + /* Block SIGQUIT and SIGABRT during + handler execution */ +.fi +.PP +.\"O The +.\"O .BR sigblock () +.\"O function adds the signals in +.\"O .I mask +.\"O to the process's signal mask +.\"O (like POSIX +.\"O .IR sigprocmask(SIG_BLOCK) ), +.\"O and returns the process's previous signal mask. +.\"O Attempts to block +.\"O .B SIGKILL +.\"O or +.\"O .B SIGSTOP +.\"O are silently ignored. +.BR sigblock () +´Ø¿ô¤Ï¡¢ +.I mask +¤Ë¤¢¤ë¥·¥°¥Ê¥ë¤ò¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ËÄɲä· +(POSIX ¤Î +.I sigprocmask(SIG_BLOCK) +¤ÈƱÍÍ)¡¢Êѹ¹Á°¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +.B SIGKILL +¤ä +.B SIGSTOP +¤ò¥Ö¥í¥Ã¥¯¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ÌۤäÆ̵»ë¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR sigsetmask () +.\"O function sets the process's signal mask to the value given in +.\"O .I mask +.\"O (like POSIX +.\"O .IR sigprocmask(SIG_SETMASK) ), +.\"O and returns the process's previous signal mask. +.BR sigsetmask () +´Ø¿ô¤Ï¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò +.I mask +¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤷ (POSIX ¤Î +.I sigprocmask(SIG_SETMASK) +¤ÈƱÍÍ)¡¢Êѹ¹Á°¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +.PP +.\"O The +.\"O .BR siggetmask () +.\"O function returns the process's current signal mask. +.\"O This call is equivalent to +.\"O .IR sigblock(0) . +.BR siggetmask () +´Ø¿ô¤Ï¥×¥í¥»¥¹¤Î¸½ºß¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£¤³¤Î´Ø¿ô¤Ï +.I sigblock(0) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR sigvec () +.\"O function returns 0 on success; on error, it returns \-1 and sets +.\"O .I errno +.\"O to indicate the error. +.BR sigvec () +´Ø¿ô¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ + +.\"O The +.\"O .BR sigblock () +.\"O and +.\"O .BR sigsetmask () +.\"O functions return the previous signal mask. +.BR sigblock () +¤È +.BR sigsetmask () +¤ÏÊѹ¹Á°¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ + +.\"O The +.\"O .BR sigmask () +.\"O function returns the signal mask for +.\"O .IR signum . +.BR sigmask () +´Ø¿ô¤Ï +.I signum +¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O See the ERRORS under +.\"O .BR sigaction (2) +.\"O and +.\"O .BR sigprocmask (2). +.BR sigaction (2) +¤È +.BR sigprocmask (2) +¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O All of these functions were in +.\"O 4.3BSD, except +.\"O .BR siggetmask (), +.\"O whose origin is unclear. +.\"O These functions are obsolete: do not use them in new programs. +¤³¤ì¤é¤Î´Ø¿ô¤Î¤¦¤Á +.BR siggetmask () +°Ê³°¤ÎÁ´¤Æ¤Ï 4.3BSD ¤Ë¤¢¤Ã¤¿¡£ +.BR siggetmask () +¤Î½Ð¼«¤Ï¤Ï¤Ã¤­¤ê¤·¤Ê¤¤¡£ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ê¡¢¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ·¤Ê¤¤¤³¤È¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O On 4.3BSD, the +.\"O .BR signal () +.\"O function provided reliable semantics (as when calling +.\"O .BR sigvec () +.\"O with +.\"O .I vec.sv_mask +.\"O equal to 0). +4.3BSD ¤Ç¤Ï¡¢¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýµ¡¹½¤òÄ󶡤¹¤ë +.RI ( vec.sv_mask +¤ò 0 ¤Ç +.BR sigvec () +¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤­¤ÈƱÍÍ)¡£ +.\"O On System V, +.\"O .BR signal () +.\"O provides unreliable semantics. +System V ¤¬Ä󶡤¹¤ë½èÍýµ¡¹½¤Ï¿®ÍêÀ­¤Î¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¡£ +.\"O POSIX.1-2001 leaves these aspects of +.\"O .BR signal () +.\"O unspecified. +.\"O See +.\"O .BR signal (2) +.\"O for further details. +POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR signal () +¤Î¤³¤ÎÅÀ¤Ïµ¬Äꤷ¤Ê¤¤¤Þ¤Þ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤µ¤é¤Ê¤ë¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR signal (2) +¤ò»²¾È¡£ + +.\"O In order to wait for a signal, +.\"O BSD and System V both provided a function named +.\"O .BR sigpause (3), +.\"O but this function has a different argument on the two systems. +.\"O See +.\"O .BR sigpause (3) +.\"O for details. +BSD ¤È System V ¤Î¤É¤Á¤é¤Î¥·¥¹¥Æ¥à¤Ç¤â +¥·¥°¥Ê¥ë¤òÂԤĤ¿¤á¤Ë¡¢ +.BR sigpause (3) +¤È¤¤¤¦Ì¾Á°¤Î´Ø¿ô¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +¤³¤Î´Ø¿ô¤Î°ú¤­¿ô¤ÏξÊý¤Î¥·¥¹¥Æ¥à¤Ç°Û¤Ê¤ë¡£ +¾ÜºÙ¤Ï +.BR sigpause (3) +¤ò»²¾È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR pause (2), +.BR sigaction (2), +.BR signal (2), +.BR sigprocmask (2), +.BR raise (3), +.BR sigpause (3), +.BR sigset (3), +.BR signal (7) diff --git a/draft/man3/sigwait.3 b/draft/man3/sigwait.3 new file mode 100644 index 00000000..bc77d365 --- /dev/null +++ b/draft/man3/sigwait.3 @@ -0,0 +1,142 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 +.\" +.TH SIGWAIT 3 2009-02-10 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigwait \- wait for a signal +sigwait \- ¥·¥°¥Ê¥ë¤òÂÔ¤Ä +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI " int sigwait(const sigset_t *" set ", int *" sig ); +.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 sigwait (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR sigwait () +.\"O function suspends execution of the calling thread until the +.\"O delivery of one of the signals specified in the signal set +.\"O .IR set . +.\"O The function accepts the signal +.\"O (removes it from the pending list of signals), +.\"O and returns the signal number in +.\"O .IR sig . +.BR sigwait () +´Ø¿ô¤Ï¡¢¥·¥°¥Ê¥ë½¸¹ç +.I set +¤Ç»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤Î°ì¤Ä¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¡¢ +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤òÃæÃǤ¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¤½¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±¼è¤ê (¤Ä¤Þ¤ê¡¢½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Î¥ê¥¹¥È +¤«¤é¤½¤Î¥·¥°¥Ê¥ë¤òºï½ü¤·)¡¢¤½¤Î¥·¥°¥Ê¥ëÈÖ¹æ¤ò +.I sig +¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ + +.\"O The operation of +.\"O .BR sigwait () +.\"O is the same as +.\"O .BR sigwaitinfo (), +.\"O except that: +.BR sigwait () +¤ÎÆ°ºî¤Ï +.BR sigwaitinfo () +¤ÈƱ¤¸¤À¤¬¡¢°Ê²¼¤ÎÅÀ¤¬°Û¤Ê¤ë¡£ +.IP * 2 +.\"O .BR sigwait () +.\"O only returns the signal number, rather than a +.\"O .I siginfo_t +.\"O structure describing the signal. +.BR sigwait () +¤Ï¡¢¥·¥°¥Ê¥ë¤ÎÆâÍƤòɽ¤¹ +.I siginfo_t +¹½Â¤ÂΤòÊÖ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢Ã±¤Ë¥·¥°¥Ê¥ëÈÖ¹æ¤òÊÖ¤¹¡£ +.IP * +.\"O The return values of the two functions are different. +ÊÖ¤êÃͤ¬ +.BR sigwaitinfo () +¤È¤Ï°Û¤Ê¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR sigwait () +.\"O returns 0. +.\"O On error, it returns a positive error number. +À®¸ù¤¹¤ë¤È¡¢ +.BR sigwait () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢Ä¾Á°¤Î¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\" Does not occur for glibc. +.\"O .I set +.\"O contains an invalid signal number. +.I set +¤Ë̵¸ú¤Ê¥·¥°¥Ê¥ëÈֹ椬Æþ¤Ã¤Æ¤¤¤ë¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O .BR sigwait () +.\"O is implemented using +.\"O .BR sigtimedwait (2). +.BR sigwait () +¤Ï +.BR sigtimedwait (2) +¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH EXAMPLES +.SH Îã +.\"O See +.\"O .BR pthread_sigmask (3). +.BR pthread_sigmask (3) +¤ò»²¾È¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR sigaction (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigsuspend (2), +.BR sigwaitinfo (2), +.BR sigsetops (3), +.BR signal (7) diff --git a/draft/man3/sin.3 b/draft/man3/sin.3 new file mode 100644 index 00000000..1f48bf70 --- /dev/null +++ b/draft/man3/sin.3 @@ -0,0 +1,160 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2009-02-04 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sin, sinf, sinl \- sine function +sin, sinf, sinl \- Àµ¸¹ (¥µ¥¤¥ó) ´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double sin(double " x ); +.br +.BI "float sinf(float " x ); +.br +.BI "long double sinl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR sinf (), +.BR sinl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the sine of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÀµ¸¹¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ 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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is an infinity +Îΰ襨¥é¡¼ (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 ) +¤¬¾å¤¬¤ë¡£ +.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=6781 +.\"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" +.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) diff --git a/draft/man3/sincos.3 b/draft/man3/sincos.3 new file mode 100644 index 00000000..0add0545 --- /dev/null +++ b/draft/man3/sincos.3 @@ -0,0 +1,130 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL, 2002-07-27 Walter Harms +.\" 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 +.SH ̾Á° +.\"O sincos, sincosf, sincosl \- calculate sin and cos simultaneously +sincos, sincosf, sincosl \- Àµ¸¹¤È;¸¹¤òƱ»þ¤Ë·×»»¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void sincos(double " x ", double *" sin ", double *" cos ); +.br +.BI "void sincosf(float " x ", float *" sin ", float *" cos ); +.br +.BI "void sincosl(long double " x ", long double *" sin ", long double *" cos ); +.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 +¤Ë³ÊǼ¤¹¤ë¡£ + +.\"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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +.SH ÊÖ¤êÃÍ +.\"O These functions return +.\"O .IR void . +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I void +¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is an infinity +Îΰ襨¥é¡¼ (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 ) +¤¬¾å¤¬¤ë¡£ +.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 +.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), +.BR feature_test_macros (7) diff --git a/draft/man3/sinh.3 b/draft/man3/sinh.3 new file mode 100644 index 00000000..7e28f4ee --- /dev/null +++ b/draft/man3/sinh.3 @@ -0,0 +1,182 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" 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) +.\" +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sinh, sinhf, sinhl \- hyperbolic sine function +sinh, sinhf, sinhl \- ÁжÊÀþÀµ¸¹ (¥Ï¥¤¥Ñ¥Ü¥ê¥Ã¥¯¥µ¥¤¥ó) ´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double sinh(double " x ); +.br +.BI "float sinhf(float " x ); +.br +.BI "long double sinhl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR sinhf (), +.BR sinhl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 () +´Ø¿ô¤ÏÁжÊÀþÀµ¸¹ (¥Ï¥¤¥Ñ¥Ü¥ê¥Ã¥¯¥µ¥¤¥ó) ´Ø¿ô¤ÎÃͤòÊÖ¤¹¡£ +¿ô³ØŪ¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.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 +¤ÎÁжÊÀþÀµ¸¹¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ 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 (negative infinity), +.\"O positive infinity (negative infinity) is returned. +.I x +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.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" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR acosh (3), +.BR asinh (3), +.BR atanh (3), +.BR cosh (3), +.BR csinh (3), +.BR tanh (3) diff --git a/draft/man3/sleep.3 b/draft/man3/sleep.3 new file mode 100644 index 00000000..5aac44bc --- /dev/null +++ b/draft/man3/sleep.3 @@ -0,0 +1,94 @@ +.\" 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 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 +.\" +.\" WORD: signal handler ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¡¼ +.\" +.TH SLEEP 3 2010-02-03 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +sleep \- »ØÄê¤ÎÉÿô¤Î´Ö¤À¤±µÙ»ß¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "unsigned int sleep(unsigned int " "seconds" ); +.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 +Éô֤ޤ¿¤Ï̵»ë¤µ¤ì¤Ê¤¤¥·¥°¥Ê¥ë¤¬ÅþÃ夹¤ë¤Þ¤ÇµÙ»ß¤¹¤ë¡£ +.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 +.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 () +¤òº®¤¼¤Æ»ÈÍѤ¹¤ë¤Î¤Ï¡¢¤Þ¤º¤¤¹Í¤¨¤Ç¤¢¤ë¡£ +.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 +¤Î¥Ï¥ó¥É¥ê¥ó¥°¤òÊѹ¹¤¹¤ë¤³¤È¤Ï¡¢ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤·ë²Ì¤òÀ¸¤à¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR alarm (2), +.BR nanosleep (2), +.BR signal (2), +.BR signal (7) diff --git a/draft/man3/sockatmark.3 b/draft/man3/sockatmark.3 new file mode 100644 index 00000000..eccf2fcd --- /dev/null +++ b/draft/man3/sockatmark.3 @@ -0,0 +1,196 @@ +.\" Copyright (c) 2006, Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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-08-01 by Yuichi SATO , LDP v2.36 +.\" +.TH SOCKATMARK 3 2008-12-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sockatmark \- determine whether socket is at out-of-band mark +sockatmark \- ¤É¤Î¥½¥±¥Ã¥È¤ËÂÓ°è³° (out-of-band) ¥Þ¡¼¥¯¤¬ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¤«¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int sockatmark(int " sockfd ); +.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 sockatmark (): +_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 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤Î´Ø¿ô¤ÏÂÓ°è³°¥Þ¡¼¥¯¤òºï½ü¤·¤Ê¤¤¡£ +.\"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 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-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 +.\" 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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR sockatmark () +.\"O was added to glibc in version 2.2.4. +.BR sockatmark () +¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.2.4 ¤ÇÄɲ䵤줿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.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) +¤ÇÆɤ߹þ¤à¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"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 +¥·¥°¥Ê¥ë¤Î¥Ï¥ó¥É¥é¤«¤é°ÂÁ´¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"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 +.SH ¥Ð¥° +.\"O Prior to glibc 2.4, +.\"O .BR sockatmark () +.\"O did not work. +glibc 2.4 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ +.BR sockatmark () +¤ÏÆ°ºî¤·¤Ê¤¤¡£ +.\"O .SH EXAMPLE +.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 +¥·¥°¥Ê¥ë¤ò¼õ¤±¼è¤Ã¤¿¸å¤Ë¥Þ¡¼¥¯¤Þ¤Ç¤ÎÁ´¤Æ¤Î¥Ç¡¼¥¿¤òÆɤ߹þ¤ó¤Ç (ÇË´þ¤·)¡¢ +¥Þ¡¼¥¯¤µ¤ì¤¿¥Ç¡¼¥¿¤Î¥Ð¥¤¥È¤òÆɤ߹þ¤à¤Î¤Ë»ÈÍѤǤ­¤ë¡£ +.nf + + char buf[BUF_LEN]; + char oobdata; + int atmark, s; + + for (;;) { + atmark = sockatmark(sockfd); + if (atmark == \-1) { + perror("sockatmark"); + break; + } + + if (atmark) + break; + + s = read(sockfd, buf, BUF_LEN) <= 0); + if (s == \-1) + perror("read"); + if (s <= 0) + break; + } + + if (atmark == 1) { + if (recv(sockfd, &oobdata, 1, MSG_OOB) == \-1) { + perror("recv"); + ... + } + } +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fcntl (2), +.BR recv (2), +.BR send (2), +.BR tcp (7) diff --git a/draft/man3/sqrt.3 b/draft/man3/sqrt.3 new file mode 100644 index 00000000..0bc40971 --- /dev/null +++ b/draft/man3/sqrt.3 @@ -0,0 +1,153 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 +.\" +.TH SQRT 3 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +sqrt, sqrtf, sqrtl \- Ê¿Êýº¬´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double sqrt(double " x ); +.br +.BI "float sqrtf(float " x ); +.br +.BI "long double sqrtl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR sqrtf (), +.BR sqrtl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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" +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the square root of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÊ¿Êýº¬¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ 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 +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP less than \-0 +Îΰ襨¥é¡¼ (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" +.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 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR csqrt (3), +.BR hypot (3) diff --git a/draft/man3/stdarg.3 b/draft/man3/stdarg.3 new file mode 100644 index 00000000..66c0fe3f --- /dev/null +++ b/draft/man3/stdarg.3 @@ -0,0 +1,457 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)stdarg.3 6.8 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:11:11 1993, faith@cs.unc.edu +.\" Additions, 2001-10-14, aeb +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Fri Mar 22 1998 by NAKANO Takeo +.\" Updated Tue Oct 16 2001 by Kentaro Shirakata +.\" +.TH STDARG 3 2001-10-14 "" "Linux Programmer's Manual" +.SH ̾Á° +stdarg, va_start, va_arg, va_end, va_copy \- ¸Ä¿ô¡¦·¿¤¬²ÄÊѤʰú¿ô¥ê¥¹¥È +.SH ½ñ¼° +.B #include +.sp +.BI "void va_start(va_list " ap ", " last ); +.br +.IB type " va_arg(va_list " ap ", " type ); +.br +.BI "void va_end(va_list " ap ); +.br +.BI "void va_copy(va_list " dest ", va_list " src ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O A function may be called with a varying number of arguments of varying +.\"O types. +.\"O The include file +.\"O .I +.\"O declares a type +.\"O .I va_list +.\"O and defines three macros for stepping through a list of arguments whose +.\"O number and types are not known to the called function. +´Ø¿ô¤Ï¸Æ¤Ó½Ð¤·¤ËºÝ¤·¤Æ¡¢¸Ä¿ô¤ä·¿¤¬²ÄÊѤʰú¿ô¤ò¤È¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤Ç¤Ï +.I va_list +·¿¤¬Àë¸À¤µ¤ì¤Æ¤ª¤ê¡¢3 ¤Ä¤Î¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£¤³¤ì¤é¤òÍѤ¤¤ë¤È¡¢ +¸Æ¤Ó½Ð¤µ¤ì¤¿´Ø¿ô¦¤Ç¤Ï¸Ä¿ô¤ä·¿¤òÃΤé¤Ê¤¤°ú¤­¿ô¤Î¥ê¥¹¥È¤ò¡¢½ç¤Ë°ì +¤Ä¤Å¤ÄÆɤ߹þ¤à¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O The called function must declare an object of type +.\"O .I va_list +.\"O which is used by the macros +.\"O .BR va_start (), +.\"O .BR va_arg (), +.\"O and +.\"O .BR va_end (). +¸Æ¤Ó½Ð¤µ¤ì¤ë´Ø¿ô¤Ç¤Ï¡¢ +.I va_list +·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬Àë¸À¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬ +.BR va_start (), +.BR va_arg (), +.BR va_end () +¤Î³Æ¥Þ¥¯¥í¤Ë¤è¤Ã¤Æ°·¤ï¤ì¤ë¡£ +.SS va_start() +.\"O The +.\"O .BR va_start () +.\"O macro initializes +.\"O .I ap +.\"O for subsequent use by +.\"O .BR va_arg () +.\"O and +.\"O .BR va_end (), +.\"O and must be called first. +.BR va_start () +¥Þ¥¯¥í¤ÏºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤ì¤Ï +.I ap +¤ò½é´ü²½¤·¡¢ +.BR va_arg () +¤È +.BR va_end () +¤ÇÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +.PP +.\"O The argument +.\"O .I last +.\"O is the name of the last argument before the variable argument list, that is, +.\"O the last argument of which the calling function knows the type. +°ú¤­¿ô +.I last +¤Ï°ú¤­¿ô¥ê¥¹¥È¤Î¤¦¤Á¡¢²ÄÊѤÊÉôʬ¤ÎľÁ°¤ËÃÖ¤«¤ì¤ë°ú¤­¿ô¤Î̾Á°¤Ç¤¢ +¤ë¡£¤Ä¤Þ¤ê¸Æ¤Ó½Ð¤µ¤ì¤¿´Ø¿ô¤¬·¿¤òÃΤäƤ¤¤ëºÇ¸å¤Î°ú¤­¿ô¤Ç¤¢¤ë¡£ +.PP +.\"O Because the address of this argument may be used in the +.\"O .BR va_start () +.\"O macro, it should not be declared as a register variable, +.\"O or as a function or an array type. +¤³¤Î°ú¤­¿ô¤Ï¥ì¥¸¥¹¥¿ÊÑ¿ô¤ä´Ø¿ô¡¢ÇÛÎó¤È¤·¤Æ +Àë¸À¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¤³¤Î°ú¤­¿ô¤Î¥¢¥É¥ì¥¹¤¬ +.BR va_start () +¥Þ¥¯¥í¤ÇÍѤ¤¤é¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.SS va_arg() +.\"O The +.\"O .BR va_arg () +.\"O macro expands to an expression that has the type and value of the next +.\"O argument in the call. +.\"O The argument +.\"O .I ap +.\"O is the +.\"O .I va_list +.\"O .I ap +.\"O initialized by +.\"O .BR va_start (). +.BR va_arg () +¥Þ¥¯¥í¤Ï¡¢¸Æ¤Ó½Ð¤·»þ¤Ë»ØÄꤵ¤ì¤¿°ú¤­¿ô¤Î¤¦¤Á¡¢ +¼¡¤Î°ÌÃ֤ˤ¢¤ë¤â¤Î¤ò»ØÄꤷ¤¿·¿ +.I type +¤ÎÃͤȤ·¤Æ¼èÆÀ¤¹¤ë¡£ +°ú¤­¿ô +.I ap +¤Ï +.I va_list +.I ap +¤Ç¡¢ +.BR va_start () +¤Ë¤è¤Ã¤Æ½é´ü²½¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +.\"O Each call to +.\"O .BR va_arg () +.\"O modifies +.\"O .I ap +.\"O so that the next call returns the next argument. +.\"O The argument +.\"O .I type +.\"O is a type name specified so that the type of a pointer to an object that +.\"O has the specified type can be obtained simply by adding a * to +.\"O .IR type . +.BR va_arg () +¤ò¸Æ¤Ó½Ð¤¹¤´¤È¤Ë +.I ap +¤ÏÊѹ¹¤µ¤ì¡¢¼¡²ó¤Î¸Æ¤Ó½Ð¤·¤ÎºÝ¤Ë¡¢¤µ¤é¤Ë¼¡¤Î°ú¤­¿ô¤òÊÖ¤¹¤è¤¦¤Ë¤Ê¤ë¡£ +°ú¤­¿ô +.I type +¤Ï·¿¤Î̾Á°¤Ç¤¢¤ë¡£ +.I type +¤ÎÁ°¤Ë * ¤òÉÕ¤±¤ì¤Ð¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î·¿ÉÕ¤­¥Ý¥¤¥ó¥¿¤¬ÆÀ¤é¤ì¤ë¡£ +.PP +.\"O The first use of the +.\"O .BR va_arg () +.\"O macro after that of the +.\"O .BR va_start () +.\"O macro returns the argument after +.\"O .IR last . +.\"O Successive invocations return the values of the remaining arguments. +.BR va_start () +¥Þ¥¯¥í¤Îľ¸å¤Ë +.BR va_arg () +¤òºÇ½é¤Ë¼Â¹Ô¤¹¤ë¤È¡¢ +.I last +¤Î¼¡¤Î°ú¤­¿ô¤¬Ê֤롣³¤±¤Æ¼Â¹Ô¤¹¤ë¤È¡¢»Ä¤ê¤Î°ú¤­¿ô¤¬¤½¤ì¤¾¤ìÊ֤롣 +.PP +.\"O If there is no next argument, or if +.\"O .I type +.\"O is not compatible with the type of the actual next argument (as promoted +.\"O according to the default argument promotions), random errors will occur. +¼¡¤Î°ú¤­¿ô¤¬¤Ê¤«¤Ã¤¿¤ê¡¢ +.I type +¤¬¼¡¤Î°ú¤­¿ô¤Î¼ÂºÝ¤Î·¿¤È¸ß´¹¤Ç¤Ê¤¤¾ì¹ç (¥Ç¥Õ¥©¥ë¥È¤Î°ú¤­¿ôÊÑ´¹¤Ç°· +¤¨¤Ê¤«¤Ã¤¿¾ì¹ç) ¤Ë¤Ï¡¢Í½Â¬¤Ç¤­¤Ê¤¤¥¨¥é¡¼¤¬µ¯¤³¤ë¡£ +.PP +.\"O If +.\"O .I ap +.\"O is passed to a function that uses +.\"O .BI va_arg( ap , type ) +.\"O then the value of +.\"O .I ap +.\"O is undefined after the return of that function. +.I ap +¤¬ +.BI va_arg( ap , type ) +¤Î·Á¤Ç´Ø¿ô¤ËÅϤµ¤ì¤ë¤È¡¢ +.I ap +¤ÎÃͤϴؿô¤«¤éÊ֤äÆÍ褿¸å¤ÏÉÔÄê¤È¤Ê¤ë¡£ +.SS va_end() +.\"O Each invocation of +.\"O .BR va_start () +.\"O must be matched by a corresponding invocation of +.\"O .BR va_end () +.\"O in the same function. +.\"O After the call +.\"O .BI va_end( ap ) +.\"O the variable +.\"O .I ap +.\"O is undefined. +.\"O Multiple traversals of the list, each +.\"O bracketed by +.\"O .BR va_start () +.\"O and +.\"O .BR va_end () +.\"O are possible. +.BR va_start () +¤¬¼Â¹Ô¤µ¤ì¤ëËè¤Ë¡¢Æ±¤¸´Ø¿ôÆâ¤ÇÂбþ¤¹¤ë +.BR va_end () +¤¬¼Â¹Ô¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BI va_end( ap ) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¸å¡¢ÊÑ¿ô +.I ap +¤ÎÃͤÏÉÔÄê¤È¤Ê¤ë¡£ +.BR va_start () +¤È +.BR va_end () +¤ÎÁȤò²¿²ó¤âʤ٤ƻȤ¦¤³¤È¤â²Äǽ¤Ç¤¢¤ë¡£ +.\"O .BR va_end () +.\"O may be a macro or a function. +.BR va_end () +¤Ï¥Þ¥¯¥í¤«¤â¤·¤ì¤Ê¤¤¤·´Ø¿ô¤«¤â¤·¤ì¤Ê¤¤¡£ +.SS va_copy() +.\"O .\" Proposal from clive@demon.net, 1997-02-28 +.\"O An obvious implementation would have a +.\"O .I va_list +.\"O be a pointer to the stack frame of the variadic function. +¤¹¤°Ê¬¤«¤ë +.I va_list +¤Î¼ÂÁõ¤Ï¡¢variadic ¤Ê´Ø¿ô¤Î¥¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.\"argrath: variadic? +.\"O In such a setup (by far the most common) there seems +.\"O nothing against an assignment +¤³¤Î¤è¤¦¤Ê¾ì¹ç(¤Û¤È¤ó¤É¤Ï¤½¤¦¤Ç¤¢¤ë)¡¢ +ñ¤Ë°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ì¤Ð¤¤¤¤¤è¤¦¤Ë»×¤¨¤ë¡£ +.in +4n +.nf + +va_list aq = ap; + +.fi +.in +.\"O Unfortunately, there are also systems that make it an +.\"O array of pointers (of length 1), and there one needs +»ÄÇ°¤Ê¤¬¤é¡¢(Ťµ 1¤Î)¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤È¤·¤Æ°·¤¦¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +¤½¤Î¤è¤¦¤Ê¾ì¹ç¡¢°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.in +4n +.nf + +va_list aq; +*aq = *ap; + +.fi +.in +.\"O Finally, on systems where arguments are passed in registers, +.\"O it may be necessary for +.\"O .BR va_start () +.\"O to allocate memory, store the arguments there, and also +.\"O an indication of which argument is next, so that +.\"O .BR va_arg () +.\"O can step through the list. +.\"O Now +.\"O .BR va_end () +.\"O can free the allocated memory again. +ºÇ¸å¤Ë¡¢°ú¤­¿ô¤ò¥ì¥¸¥¹¥¿¤ÇÅϤ¹¥·¥¹¥Æ¥à¤Î¾ì¹ç¡¢ +.BR va_start () +¤Ç¥á¥â¥ê¤ò³ä¤êÅö¤Æ¡¢°ú¤­¿ô¤ò³ÊǼ¤·¡¢ +¼¡¤Î°ú¤­¿ô¤¬¤É¤ì¤«¤ò»Ø¤·¼¨¤¹¤è¤¦¤Ë¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¤½¤·¤Æ +.BR va_arg () +¤Ç¥ê¥¹¥È¤ò½çÈ֤ˤ¿¤É¤ê¡¢ +.BR va_end () +¤Ç³ä¤êÅö¤Æ¤¿¥á¥â¥ê¤ò³«Êü¤¹¤ë¡£ +.\"O To accommodate this situation, C99 adds a macro +.\"O .BR va_copy (), +.\"O so that the above assignment can be replaced by +¤³¤Î¤è¤¦¤Ê¾õ¶·¤ËÂбþ¤¹¤ë¤¿¤á¡¢C99 ¤Ç¤Ï +.BR va_copy () +¥Þ¥¯¥í¤òÄɲä·¡¢ +Á°½Ò¤Î¤è¤¦¤Ê³ä¤êÅö¤Æ¤Ï°Ê²¼¤Î¤è¤¦¤ËÃÖ¤­´¹¤¨¤é¤ì¤ë¤è¤¦¤Ë¤·¤¿¡£ +.in +4n +.nf + +va_list aq; +va_copy(aq, ap); +\&... +va_end(aq); + +.fi +.in +.RE +.\"O Each invocation of +.\"O .BR va_copy () +.\"O must be matched by a corresponding invocation of +.\"O .BR va_end () +.\"O in the same function. +.BR va_copy () +¤¬¼Â¹Ô¤µ¤ì¤ë¤´¤È¤Ë¡¢ +Âбþ¤¹¤ë +.BR va_end () +¤òƱ¤¸´Ø¿ôÆâ¤Ç¼Â¹Ô¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O Some systems that do not supply +.\"O .BR va_copy () +.\"O have +.\"O .B __va_copy +.\"O instead, since that was the name used in the draft proposal. +¤³¤Î̾Á°¤Ï¤Þ¤À draft proposal ¤Ê¤Î¤Ç¡¢ +.BR va_copy () +¤ÎÂå¤ï¤ê¤Ë +.B __va_copy +¤òÍѤ¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.SH ½àµò +.BR va_start (), +.BR va_arg (), +.BR va_end () +¥Þ¥¯¥í¤Ï C89 ½àµò¤Ç¤¢¤ë¡£ +.\"O C99 defines the +.\"O .BR va_copy () +.\"O macro. +.BR va_copy () +¤Ï C99 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O These macros are +.\"O .I not +.\"O compatible with the historic macros they replace. +.\"O A backward compatible version can be found in the include file +.\"O .IR . +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï¡¢°ÊÁ°¤«¤éÍѤ¤¤é¤ì¤Æ¤­¤¿Æ±Åù¤Î¥Þ¥¯¥í·²¤È +¸ß´¹¤Ç¤Ï\fI¤Ê¤¤\fP¡£²áµî¤Î¤â¤Î¤È¸ß´¹¤Ê¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢ +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤Ë¸ºß¤¹¤ë¡£ +.PP +.\"O The historic setup is: +Îò»ËŪ¤Ê¥»¥Ã¥È¥¢¥Ã¥×¤Ï°Ê²¼¤Î¤È¤ª¤ê¤Ç¤¢¤ë¡£ +.in +4n +.nf + +#include + +void +foo(va_alist) + va_dcl +{ + va_list ap; + + va_start(ap); + while (...) { + ... + x = va_arg(ap, type); + ... + } + va_end(ap); +} + +.fi +.in +.\"O On some systems, +.\"O .I va_end +.\"O contains a closing \(aq}\(aq matching a \(aq{\(aq in +.\"O .IR va_start , +.\"O so that both macros must occur in the same function, and in a way +.\"O that allows this. +.I va_start +¥Þ¥¯¥í¤Ë \(aq}\(aq ¤ò´Þ¤ß¡¢ +.I va_end +¥Þ¥¯¥í¤ËÂбþ¤¹¤ë \(aq{\(aq ¤ò´Þ¤à¥·¥¹¥Æ¥à¤â¤¢¤ë¤Î¤Ç¡¢ +¤³¤ÎÆó¤Ä¤Î¥Þ¥¯¥í¤ÏƱ¤¸´Ø¿ô¤Ë¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Unlike the +.\"O .B varargs +.\"O macros, the +.\"O .B stdarg +.\"O macros do not permit programmers to code a function with no fixed +.\"O arguments. +.\"O This problem generates work mainly when converting +.\"O .B varargs +.\"O code to +.\"O .B stdarg +.\"O code, but it also creates difficulties for variadic functions that wish to +.\"O pass all of their arguments on to a function that takes a +.\"O .I va_list +.\"O argument, such as +.\"O .BR vfprintf (3). +.B varargs +¥Þ¥¯¥í¤È¤Ï°Û¤Ê¤ê¡¢ +.B stdarg +¥Þ¥¯¥í¤Ç¤Ï¸ÇÄê°ú¤­¿ô¤Ê¤·¤Ç´Ø¿ô¤ò»ØÄꤹ¤ë¤³¤È¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤ì¤Ï +.B varargs +¥Ù¡¼¥¹¤Î¥³¡¼¥É¤ò +.B stdarg +¤Î¥³¡¼¥É¤Ë½ñ¤­´¹¤¨¤ë¤È¤­¤Ë¡¢ÌÌÅݤʺî¶È¤Î¤â¤È¤Ë¤Ê¤ë¡£ +¤Þ¤¿¡¢¤¹¤Ù¤Æ¤Î°ú¤­¿ô¤ò +.I va_list +¤È¤·¤Æ²ÄÊѸĻØÄꤷ¤¿¤¤¤è¤¦¤Ê¾ì¹ç +.RB ( vfprintf (3) +¤Ê¤É) ¤Ë¤â¾ã³²¤È¤Ê¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +´Ø¿ô +.I foo +¤Ï½ñ¼°Ê¸»ú¤«¤é¤Ê¤ëʸ»úÎó¤ò¼õ¤±Æþ¤ì¡¢¤½¤Î½ñ¼°Ê¸»ú¤ËÂбþ¤¹¤ë·¿¤Ç²ÄÊѸĤΠ+°ú¤­¿ô¤òÆɤ߹þ¤ß¡¢°õ»ú¤¹¤ë¡£ +.nf + +#include +#include + +void +foo(char *fmt, ...) +{ + va_list ap; + int d; + char c, *s; + + va_start(ap, fmt); + while (*fmt) + switch (*fmt++) { + case \(aqs\(aq: /* string */ + s = va_arg(ap, char *); + printf("string %s\en", s); + break; + case \(aqd\(aq: /* int */ + d = va_arg(ap, int); + printf("int %d\en", d); + break; + case \(aqc\(aq: /* char */ + /* need a cast here since va_arg only + takes fully promoted types */ + c = (char) va_arg(ap, int); + printf("char %c\en", c); + break; + } + va_end(ap); +} +.fi diff --git a/draft/man3/stdin.3 b/draft/man3/stdin.3 new file mode 100644 index 00000000..e3816d0a --- /dev/null +++ b/draft/man3/stdin.3 @@ -0,0 +1,273 @@ +.\" From dholland@burgundy.eecs.harvard.edu Tue Mar 24 18:08:15 1998 +.\" +.\" This man page was written in 1998 by David A. Holland +.\" and placed in the Public Domain. Polished a bit by aeb. +.\" 2005-06-16 mtk, mentioned freopen() +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-03-22, NAKANO Takeo +.\" Updated 2005-09-04, Akihiro MOTOKI +.\" +.TH STDIN 3 2008-07-14 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O stdin, stdout, stderr \- standard I/O streams +.SH ̾Á° +stdin, stdout, stderr \- ɸ½àÆþ½ÐÎÏ¥¹¥È¥ê¡¼¥à +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "extern FILE *" stdin ; +.BI "extern FILE *" stdout ; +.BI "extern FILE *" stderr ; +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Under normal circumstances every Unix program has three streams opened +.\"O for it when it starts up, one for input, one for output, and one for +.\"O printing diagnostic or error messages. +.\"O These are typically attached to +.\"O the user's terminal (see +.\"O .BR tty (4)) +.\"O but might instead refer to files or other devices, depending on what +.\"O the parent process chose to set up. +.\"O (See also the "Redirection" section of +.\"O .BR sh (1).) +ɸ½à¤Î´Ä¶­¤Ç¤Ï¡¢ Unix ¥×¥í¥°¥é¥à¤Ïµ¯Æ°»þ¤Ë¡¢¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥¹¥È¥ê¡¼ +¥à¤ò 3 ¤ÄÍ¿¤¨¤é¤ì¤ë¡£¤½¤ì¤¾¤ìÆþÎÏÍÑ¡¢½ÐÎÏÍÑ¡¢¿ÇÃÇ¥á¥Ã¥»¡¼¥¸¤ä¥¨¥é¡¼¥á¥Ã +¥»¡¼¥¸¤Îɽ¼¨ÍѤΤâ¤Î¤Ç¤¢¤ë¡£¤³¤ì¤é¤ÏÄ̾ï¥æ¡¼¥¶¤ÎüËö +.RB ( tty (4) +¤ò¸«¤è) ¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¿Æ¥×¥í¥»¥¹¤Ç¤ÎÁªÂò¡¦ÀßÄê¤Ë¤è¤Ã¤Æ¥Õ¥¡¥¤¥ë +¤ä¾¤Î¥Ç¥Ð¥¤¥¹¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤ë¤³¤È¤â¤¢¤ë +.RB ( sh (1) +¤Î¡Ö¥ê¥À¥¤¥ì¥¯¥·¥ç¥ó¡×¥»¥¯¥·¥ç¥ó¤â»²¾È¤Î¤³¤È)¡£ +.PP +.\"O The input stream is referred to as "standard input"; the output stream is +.\"O referred to as "standard output"; and the error stream is referred to +.\"O as "standard error". +.\"O These terms are abbreviated to form the symbols +.\"O used to refer to these files, namely +.\"O .IR stdin , +.\"O .IR stdout , +.\"O and +.\"O .IR stderr . +ÆþÎÏ¥¹¥È¥ê¡¼¥à¤Ï "standard input" ¤È¸Æ¤Ð¤ì¤ë¡£½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ï +"standard output"¡¢¥¨¥é¡¼¥¹¥È¥ê¡¼¥à¤Ï "standard error" ¤È¸Æ¤Ð¤ì¤ë¡£ +¤³¤ì¤é¤ÎÍѸì¤òû½Ì¤·¤¿¤â¤Î¤¬¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ë¤ò¼¨¤¹¥·¥ó¥Ü¥ë¤È¤Ê¤ë¡£¤Ä +¤Þ¤ê +.IR stdin , +.IR stdout , +.I stderr +¤Ç¤¢¤ë¡£ +.PP +.\"O Each of these symbols is a +.\"O .BR stdio (3) +.\"O macro of type pointer to FILE, and can be used with functions like +.\"O .BR fprintf (3) +.\"O or +.\"O .BR fread (3). +¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤Ï +.BR stdio (3) +¤Î¥Þ¥¯¥í¤Ç¡¢ FILE ¤Ø¤Î¥Ý¥¤¥ó¥¿·¿¤Ç¤¢¤ë¡£¤·¤¿¤¬¤Ã¤Æ +.BR fprintf (3) +¤ä +.BR fread (3) +¤Ê¤É¤Î´Ø¿ô¤È¤È¤â¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O Since +.\"O .IR FILE s +.\"O are a buffering wrapper around Unix file descriptors, the +.\"O same underlying files may also be accessed using the raw Unix file +.\"O interface, that is, the functions like +.\"O .BR read (2) +.\"O and +.\"O .BR lseek (2). +.I FILE +¤Ï Unix ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¥Ð¥Ã¥Õ¥¡µ¡Ç½¤òÄɲä·¤¿¥é¥Ã¥Ñ¡¼ +¤Ç¤¢¤ë¤«¤é¡¢¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ë¤âÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¡¢ Unix ¤Î raw ¥Õ¥¡ +¥¤¥ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.RB ( read (2) +¤ä +.BR lseek (2) +¤Ê¤É) ¤Ë¤è¤Ã¤Æ¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.PP +.\"O On program startup, the integer file descriptors +.\"O associated with the streams +.\"O .IR stdin , +.\"O .IR stdout , +.\"O and +.\"O .I stderr +.\"O are 0, 1, and 2, respectively. +.\"O The preprocessor symbols +.\"O .BR STDIN_FILENO , +.\"O .BR STDOUT_FILENO , +.\"O and +.\"O .B STDERR_FILENO +.\"O are defined with these values in +.\"O \fI\fP. +.\"O (Applying +.\"O .BR freopen (3) +.\"O to one of these streams can change the file descriptor number +.\"O associated with the stream.) +¥×¥í¥°¥é¥à¤Îµ¯Æ°»þ¤Ë¤Ï¡¢ +¥¹¥È¥ê¡¼¥à +.IR stdin , +.IR stdout , +.I stderr +¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÈÖ¹æ¤Ï¡¢ +¤½¤ì¤¾¤ì 0, 1, 2 ¤Ç¤¢¤ë¡£ +¥×¥ê¥×¥í¥»¥Ã¥µ¥·¥ó¥Ü¥ë +.BR STDIN_FILENO , +.BR STDOUT_FILENO , +.B STDERR_FILENO +¤Ï +.I +Ãæ¤Ç¤½¤ì¤¾¤ì¤³¤ì¤é¤ÎÃͤËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +(¤³¤ì¤é¤Î¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ +.BR freopen (3) +¤òŬÍѤ¹¤ë¤³¤È¤Ç¡¢¤½¤Î¥¹¥È¥ê¡¼¥à¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +¤ÎÈÖ¹æ¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£) +.PP +.\"O Note that mixing use of +.\"O .IR FILE s +.\"O and raw file descriptors can produce +.\"O unexpected results and should generally be avoided. +.\"O (For the masochistic among you: POSIX.1, section 8.2.3, describes +.\"O in detail how this interaction is supposed to work.) +.\"O A general rule is that file descriptors are handled in the kernel, +.\"O while stdio is just a library. +.\"O This means for example, that after an +.\"O .BR exec (3), +.\"O the child inherits all open file descriptors, but all old streams +.\"O have become inaccessible. +.I FILE +¤È raw ¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÊ»ÍѤϡ¢Í½´ü¤Ç¤­¤Ê¤¤·ë²Ì¤òÀ¸¤¸ +¤ë¤³¤È¤¬¤¢¤ë¤Î¤Ç¡¢Ä̾ï¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ (¥Þ¥¾¥Ò¥¹¥Æ¥£¥Ã¥¯¤Ê¿Í¤Ë: +POSIX.1 ¤Î¥»¥¯¥·¥ç¥ó 8.2.3 ¤Ë¤Ï¡¢¤³¤Îº®ÍѤÇÆ°ºî¤¬¤É¤Î¤è¤¦¤Ë¤Ê¤ê¤½¤¦ +¤«¤¬¾Ü¤·¤¯µ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£) +°ìÈÌŪ¤Ê¥ë¡¼¥ë¤Ï°Ê²¼¤ÎÄ̤ê: ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ +°·¤ï¤ì¡¢ stdio ¤Ïñ¤Ë¥é¥¤¥Ö¥é¥ê¤Ë¤è¤Ã¤Æ°·¤ï¤ì¤ë¤Î¤Ç¤¢¤ë¡£¤¹¤Ê¤ï¤ÁÎ㤨¤Ð +.BR exec (3) +¤Î¸å¤Ë¤Ï¡¢»Ò¥×¥í¥»¥¹¤Ï¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +¤ò¤¹¤Ù¤Æ·Ñ¾µ¤¹¤ë¤¬¡¢¿Æ¤«¤é¤Î¥¹¥È¥ê¡¼¥à¤Ï¤¹¤Ù¤Æ¥¢¥¯¥»¥¹ÉԲĤȤʤ롣 +.PP +.\"O Since the symbols +.\"O .IR stdin , +.\"O .IR stdout , +.\"O and +.\"O .I stderr +.\"O are specified to be macros, assigning to them is nonportable. +.\"O The standard streams can be made to refer to different files +.\"O with help of the library function +.\"O .BR freopen (3), +.\"O specially introduced to make it possible to reassign +.\"O .IR stdin , +.\"O .IR stdout , +.\"O and +.\"O .IR stderr . +.\"O The standard streams are closed by a call to +.\"O .BR exit (3) +.\"O and by normal program termination. +¥·¥ó¥Ü¥ë +.IR stdin , +.IR stdout , +.I stderr +¤Ï¤¹¤Ù¤Æ¥Þ¥¯¥í¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢¤³¤ì¤é¤Ø¤ÎÂåÆþ +¤Ï°Ü¿¢À­¤òÊݾڤµ¤ì¤Ê¤¤¡£É¸½à¥¹¥È¥ê¡¼¥à¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô +.BR freopen (3) +¤òÍѤ¤¤ì¤Ð¡¢Ê̤Υե¡¥¤¥ë¤ò¼¨¤¹¤è¤¦¤ËÊѹ¹¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï +.IR stdin , +.IR stdout , +.I stderr +¤ÎºÆ³ä¤êÅö¤Æ¤¬²Äǽ¤Ê¤è¤¦¤ËÆÃÊ̤ËƳÆþ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ +ɸ½à¥¹¥È¥ê¡¼¥à¤Ï +.BR exit (3) +¤Î¸Æ¤Ó½Ð¤·¤È¡¢¥×¥í¥°¥é¥à¤ÎÀµ¾ï½ªÎ»¤Ë¤è¤Ã¤Æ¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The +.\"O .IR stdin , +.\"O .IR stdout , +.\"O and +.\"O .I stderr +.\"O macros conform to C89 +.\"O and this standard also stipulates that these three +.\"O streams shall be open at program startup. +.IR stdin , +.IR stdout , +.I stderr +¥Þ¥¯¥í¤Ï C89 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +¤Þ¤¿ C89 ¤Ç¤Ï¡¢¤³¤ì¤é 3 ¤Ä¤Î¥¹¥È¥ê¡¼¥à¤¬¥×¥í¥°¥é¥à +¤Îµ¯Æ°»þ¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤Ù¤­¤Ç¤¢¤ë¤³¤È¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The stream +.\"O .I stderr +.\"O is unbuffered. +.\"O The stream +.\"O .I stdout +.\"O is line-buffered when it points to a terminal. +.\"O Partial lines will not +.\"O appear until +.\"O .BR fflush (3) +.\"O or +.\"O .BR exit (3) +.\"O is called, or a newline is printed. +.\"O This can produce unexpected +.\"O results, especially with debugging output. +.I stderr +¥¹¥È¥ê¡¼¥à¤Ï¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.I stdout +¥¹¥È¥ê¡¼¥à¤Ï¡¢Ã¼Ëö¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ë¤Ï¹Ôñ°Ì¤Ç¥Ð¥Ã¥Õ¥¡¥ê¥ó¥° +¤µ¤ì¤Æ¤¤¤ë¡£°ì¹Ô¤ËËþ¤¿¤Ê¤¤ÆâÍƤϡ¢ +.BR fflush (3) +¤« +.BR exit (3) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤«¡¢²þ¹Ôʸ»ú¤¬°õ»ú¤µ¤ì¤ë¤Þ¤Çɽ¼¨¤µ¤ì¤Ê¤¤¡£¤³¤ì¤Ï¡¢ +Æä˥ǥХå°»þ¤Ë¤ª¤¤¤Æ¡¢Í½´ü¤·¤Ê¤¤·ë²Ì¤òÀ¸¤¸¤ë¸¶°ø¤È¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O The buffering mode of the standard streams (or any other stream) +.\"O can be changed using the +.\"O .BR setbuf (3) +.\"O or +.\"O .BR setvbuf (3) +.\"O call. +ɸ½à¥¹¥È¥ê¡¼¥à¤Î (¤¢¤ë¤¤¤Ï¾¤Î¤¹¤Ù¤Æ¤Î¥¹¥È¥ê¡¼¥à¤Î) +¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¥â¡¼¥É¤Ï¡¢ +.BR setbuf (3) +¤Þ¤¿¤Ï +.BR setvbuf (3) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤ÆÊѹ¹¤Ç¤­¤ë¡£ +.\"O Note that in case +.\"O .I stdin +.\"O is associated with a terminal, there may also be input buffering +.\"O in the terminal driver, entirely unrelated to stdio buffering. +.\"O (Indeed, normally terminal input is line buffered in the kernel.) +.\"O This kernel input handling can be modified using calls like +.\"O .BR tcsetattr (3); +.\"O see also +.\"O .BR stty (1), +.\"O and +.\"O .BR termios (3). +¤¿¤À¤·¡¢ +.I stdin +¤¬Ã¼Ëö¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ï¡¢Ã¼Ëö¤Î¥É¥é¥¤¥Ð¤Ç¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤ë +²ÄǽÀ­¤¬¤¢¤ëÅÀ¤Ë¤âÃí°Õ¤¹¤ë¤³¤È¡£¤³¤ì¤Ï stdio ¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤È¤ÏÁ´¤¯ +´Ø·¸¤Ê¤¯Â¸ºß¤·¤¦¤ë¡£ (¼ÂºÝ¡¢Ä̾ï¤À¤ÈüËöÆþÎϤϥ«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¹Ôñ°Ì +¤Ç¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤ë¡£) ¤³¤Î¥«¡¼¥Í¥ë¤Ë¤è¤ëÆþÎϤΰ·¤¤¤Ï +.BR tcsetattr (3) +¤Ê¤É¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤ÆÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR stty (1) +¤È +.BR termios (3) +¤â»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR csh (1), +.BR sh (1), +.BR open (2), +.BR fopen (3), +.BR stdio (3) diff --git a/draft/man3/stdio.3 b/draft/man3/stdio.3 new file mode 100644 index 00000000..6e558260 --- /dev/null +++ b/draft/man3/stdio.3 @@ -0,0 +1,435 @@ +.\" Copyright (c) 1990, 1991 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. +.\" +.\" @(#)stdio.3 6.5 (Berkeley) 5/6/91 +.\" +.\" Converted for Linux, Mon Nov 29 16:07:22 1993, faith@cs.unc.edu +.\" Modified, 2001-12-26, aeb +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated Mon Jan 20 23:06:18 JST 1997 +.\" by YOSHINO Takashi +.\" Updated & Modified Thu Feb 14 21:39:49 JST 2002 +.\" by Yuichi SATO +.\" Updated & Modified Sun Sep 7 14:36:19 JST 2003 +.\" by Yuichi SATO +.\" Updated & Modified Sat Jan 17 03:18:29 JST 2004 by Yuichi SATO +.\" +.\"WORD: position indicator °ÌÃֻؼ¨»Ò +.\"WORD: positioning requests °ÌÃÖ»ØÄê¥ê¥¯¥¨¥¹¥È +.\" +.TH STDIO 3 2001-12-26 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O stdio \- standard input/output library functions +stdio \- ɸ½àÆþ½ÐÎϥ饤¥Ö¥é¥ê´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "FILE *" stdin ; +.br +.BI "FILE *" stdout ; +.br +.BI "FILE *" stderr ; +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The standard I/O library provides a simple and efficient buffered stream +.\"O I/O interface. +ɸ½àÆþ½ÐÎϥ饤¥Ö¥é¥ê¤Ï¡¢´Êñ¤«¤Ä¸ú²Ì¤Î¤è¤¤¡¢ +¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤¿¥¹¥È¥ê¡¼¥àÆþ½ÐÎÏ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +.\"O Input and output is mapped into logical data streams and the +.\"O physical I/O characteristics are concealed. +ÆþÎϤȽÐÎϤÏÏÀÍý¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥à¤Ë³ä¤êÉÕ¤±¤é¤ì¡¢ +Æþ½ÐÎϤÎʪÍýŪ¤ÊÆÃħ¤Ï±£Ê䵤ì¤ë¡£ +.\"O The functions and macros are +.\"O listed below; more information is available from the individual man pages. +¤³¤Î¥é¥¤¥Ö¥é¥ê¤Ë°¤¹¤ë´Ø¿ô¤È¥Þ¥¯¥í¤ò°Ê²¼¤Ëµó¤²¤ë¡£ +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¸Ä¡¹¤Î man ¥Ú¡¼¥¸¤«¤éÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O A stream is associated with an external file (which may be a physical +.\"O device) by +.\"O .I opening +.\"O a file, which may involve creating a new file. +.\"O Creating an existing file +.\"O causes its former contents to be discarded. +¥Õ¥¡¥¤¥ë¤ò +.I ¥ª¡¼¥×¥ó (open) ¤¹¤ë +¤³¤È¤Ë¤è¤Ã¤Æ¡¢ +¥¹¥È¥ê¡¼¥à¤Ï³°Éô¥Õ¥¡¥¤¥ë (Ä̾ï¤ÏʪÍý¥Ç¥Ð¥¤¥¹) ¤ËÏ¢·ë¤µ¤ì¤ë¡£ +¤³¤ÎÁàºî¤Ë¤Ï¿·¤·¤¯¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¤³¤È¤â´Þ¤Þ¤ì¤ë¡£ +´û¸¤Î¥Õ¥¡¥¤¥ë¤ÈƱ¤¸Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤ò¿·¤¿¤Ëºî¤ë¤È¡¢ +¤â¤È¤Î¥Õ¥¡¥¤¥ë¤ÎÃæ¿È¤¬¼Î¤Æ¤é¤ì¤Æ¤·¤Þ¤¦¡£ +.\"O If a file can support +.\"O positioning requests (such as a disk file, as opposed to a terminal) then a +.\"O .I file position indicator +.\"O associated with the stream is positioned at the start of the file (byte +.\"O zero), unless the file is opened with append mode. +¥Õ¥¡¥¤¥ë¤¬°ÌÃÖ»ØÄê¥ê¥¯¥¨¥¹¥È¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë +(¥Ç¥£¥¹¥¯¥Õ¥¡¥¤¥ë¤Ê¤É¤¬ÁêÅö¤¹¤ë¡£µÕ¤ÎÎã¤È¤·¤Æ¤ÏüËö¤¬µó¤²¤é¤ì¤ë) ¾ì¹ç¡¢ +¤½¤Î¥¹¥È¥ê¡¼¥à¤ËÏ¢·ë¤µ¤ì¤¿ +.I ¥Õ¥¡¥¤¥ë°ÌÃֻؼ¨»Ò (file position indicator) +¤Ï¡¢Äɲå⡼¥É¤Ç³«¤«¤ì¤Ê¤¤¸Â¤ê¥Õ¥¡¥¤¥ë¤ÎÀèƬ (0 ¥Ð¥¤¥ÈÌÜ) ¤Ë°ÌÃÖ¤¹¤ë¡£ +.\"O If append mode is used, +.\"O it is unspecified whether the position indicator will be placed at the +.\"O start or the end of the file. +Äɲå⡼¥É¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢ +°ÌÃֻؼ¨»Ò¤ò¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤ËÃÖ¤«¤ì¤ë¤«ËöÈø¤ËÃÖ¤«¤ì¤ë¤«¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O The position indicator is maintained by +.\"O subsequent reads, writes and positioning requests. +°ÌÃֻؼ¨»Ò¤Ï¡¢ +°Ê¹ß¤ÎÆɤ߽ñ¤­¤ä°ÌÃÖ»ØÄê¥ê¥¯¥¨¥¹¥È¤Ë¤è¤Ã¤ÆÊѹ¹¤µ¤ì¤ë¡£ +.\"O All input occurs +.\"O as if the characters were read by successive calls to the +.\"O .BR fgetc (3) +.\"O function; all output takes place as if all characters were written by +.\"O successive calls to the +.\"O .BR fputc (3) +.\"O function. +¤¹¤Ù¤Æ¤ÎÆþÎϤϡ¢ +.BR fgetc (3) +´Ø¿ô¤ò¼¡¡¹¤Ë¸Æ¤Ó½Ð¤·¤Æʸ»ú¤òÆɤ߹þ¤ó¤À¤«¤Î¤è¤¦¤Ë¹Ô¤ï¤ì¤ë¡£ +°ìÊý¤¹¤Ù¤Æ¤Î½ÐÎϤϡ¢ +.BR fputc (3) +´Ø¿ô¤ò¼¡¡¹¤Ë¸Æ¤Ó½Ð¤·¤Æʸ»ú¤ò½ñ¤­¹þ¤ó¤À¤«¤Î¤è¤¦¤Ë¹Ô¤ï¤ì¤ë¡£ +.PP +.\"O A file is disassociated from a stream by +.\"O .I closing +.\"O the file. +¥Õ¥¡¥¤¥ë¤ò +.I ¥¯¥í¡¼¥º (close) ¤¹¤ë +¤³¤È¤Ë¤è¤Ã¤Æ¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ï¥¹¥È¥ê¡¼¥à¤«¤éÀÚ¤êÎ¥¤µ¤ì¤ë¡£ +.\"O Output streams are flushed (any unwritten buffer contents are +.\"O transferred to the host environment) before the stream is disassociated from +.\"O the file. +½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ï¡¢¤½¤Î¥¹¥È¥ê¡¼¥à¤¬¥Õ¥¡¥¤¥ë¤«¤éÀÚ¤êÎ¥¤µ¤ì¤ëÁ°¤Ë¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë +(½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤¹¤Ù¤Æ¤Î¥Ð¥Ã¥Õ¥¡¤ÎÆâÍƤ¬¥Û¥¹¥È´Ä¶­¤ËžÁ÷¤µ¤ì¤ë)¡£ +.\"O The value of a pointer to a +.\"O .I FILE +.\"O object is indeterminate after a file is closed (garbage). +.I FILE +¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÎÃͤϡ¢ +¥Õ¥¡¥¤¥ë¤òÊĤ¸¤¿¸å¤Ç¤ÏÉÔ³ÎÄê¤Ë¤Ê¤ë (¥´¥ß¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦)¡£ +.PP +.\"O A file may be subsequently reopened, by the same or another program +.\"O execution, and its contents reclaimed or modified (if it can be +.\"O repositioned at the start). +¥Õ¥¡¥¤¥ë¤Ï¤½¤Î¸å (Ʊ¤¸¤Þ¤¿¤ÏÊÌ¤Î¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ) +ºÆ¤Ó¥ª¡¼¥×¥ó¤µ¤ì¤ë¤³¤È¤â¤¢¤ê¡¢ +¤½¤ÎÆâÍƤ¬½¤Àµ¤µ¤ì¤¿¤êÊѹ¹¤µ¤ì¤¿¤ê¤¹¤ë +(¤½¤Î¥Õ¥¡¥¤¥ë¤ÇÀèƬ¤Ø¤Î°ÌÃÖ°ÜÆ°¤¬²Äǽ¤Ç¤¢¤ì¤Ð)¡£ +.\"O If the main function returns to its original caller, or the +.\"O .BR exit (3) +.\"O function is called, all open files are closed +.\"O (hence all output streams are +.\"O flushed) before program termination. +main ´Ø¿ô¤¬¤â¤È¤Î¸Æ¤Ó½Ð¤·Â¦¤ËÊ֤俤ꡢ +.BR exit (3) +´Ø¿ô¤¬¸Æ¤Ð¤ì¤¿¾ì¹ç¡¢ +¥×¥í¥°¥é¥à¤Î½ªÎ»¤ÎÁ°¤Ë +¸½ºß³«¤¤¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤ÏÊĤ¸¤é¤ì¤ë +(¤½¤Î·ë²Ì¡¢¤¹¤Ù¤Æ¤Î½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ï¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë)¡£ +.\"O Other methods of program termination, +.\"O such as +.\"O .BR abort (3) +.\"O do not bother about closing files properly. +¥×¥í¥°¥é¥à¤ÎÄä»ß¤Ë +.BR abort (3) +¤Î¤è¤¦¤Ê¾¤ÎÊýË¡¤òÍѤ¤¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥Õ¥¡¥¤¥ë¤¬Àµ¤·¤¯ÊĤ¸¤é¤ì¤ëÊݾڤϤʤ¤¡£ +.PP +.\"O At program startup, three text streams are predefined and need not be +.\"O opened explicitly \(em +.\"O .I standard input +.\"O (for reading conventional input), \(em +.\"O .I standard output +.\"O (for writing conventional input), and +.\"O .I standard error +.\"O (for writing diagnostic output). +¥×¥í¥°¥é¥à¤Îµ¯Æ°»þ¤Ë 3 ¸Ä¤Î¥Æ¥­¥¹¥È¥¹¥È¥ê¡¼¥à¤¬Í½¤áÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +¤½¤ì¤é¤ÏÌÀ¼¨Åª¤Ë³«¤¯É¬Íפ¬¤Ê¤¤¡£ +\(em +.I ɸ½àÆþÎÏ (standard input) +(Ä̾ï¤ÎÆþÎϤòÆɤ߼è¤ë¤Î¤Ë»È¤¦)¡¢\(em +.I ɸ½à½ÐÎÏ (standard output) +(Ä̾ï¤Î½ÐÎϤò½ñ¤­¹þ¤à¤Î¤Ë»È¤¦)¡¢ +.I ɸ½à¥¨¥é¡¼½ÐÎÏ (standard error) +(¿ÇÃǽÐÎϤò½ñ¤­¹þ¤à¤Î¤Ë»È¤¦) ¤Ç¤¢¤ë¡£ +.\"O These streams are abbreviated +.\"O .IR stdin , stdout +.\"O and +.\"O .IR stderr . +¤³¤ì¤é¤Î¥¹¥È¥ê¡¼¥à¤Ï +.IR stdin , +.IR stdout , +.I stderr +¤Èû½Ì¤·¤Æɽ¸½¤µ¤ì¤ë¡£ +.\"O When opened, the standard error stream is not fully buffered; the standard +.\"O input and output streams are fully buffered if and only if the streams do +.\"O not to refer to an interactive device. +¥ª¡¼¥×¥ó¤µ¤ì¤¿¤È¤­¤Ë¤Ï¡¢ +ɸ½à¥¨¥é¡¼¥¹¥È¥ê¡¼¥à¤Ï +´°Á´¤Ë¤Ï¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +ɸ½àÆþÎÏ¥¹¥È¥ê¡¼¥à¤Èɸ½à½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ï¡¢ +¥¹¥È¥ê¡¼¥à¤¬¥¤¥ó¥¿¥é¥¯¥Æ¥£¥Ö¤Ê¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +´°Á´¤Ë¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O Output streams that refer to terminal devices are always line buffered by +.\"O default; pending output to such streams is written automatically whenever +.\"O an input stream that refers to a terminal device is read. +üËö¥Ç¥Ð¥¤¥¹¤ò»²¾È¤¹¤ë½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ï¡¢ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¾ï¤Ë¹Ôñ°Ì¤Ç¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤ë¡£ +¤¿¤À¤·¤½¤Î¤è¤¦¤Ê¥¹¥È¥ê¡¼¥à¤Ë¤ª¤±¤ë¥Ð¥Ã¥Õ¥¡Æâ¤Î½ÐÎϤϡ¢ +üËö¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤ëÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é¤ÎÆɤ߹þ¤ß¤¬¤¢¤ë¤¿¤Ó¤Ë¡¢ +¼«Æ°Åª¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.\"O In cases where a +.\"O large amount of computation is done after printing part of a line on an +.\"O output terminal, it is necessary to +.\"O .BR fflush (3) +.\"O the standard output before going off and computing so that the output will +.\"O appear. +½ÐÎÏüËö¤Ë¹Ô¤Î°ìÉô¤ò½ñ¤­¹þ¤ó¤À¸å¤ÇÂçÎ̤η׻»¤ò¹Ô¤¦¾ì¹ç¡¢ +½ÐÎϤ¬É½¼¨¤µ¤ì¤ë¤è¤¦¤Ë¡¢·×»»¤Ë¼è¤ê¤«¤«¤ëÁ°¤Ëɸ½à½ÐÎϤËÂФ·¤Æ +.BR fflush (3) +¤ò¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.PP +.\"O The +.\"O .I stdio +.\"O library is a part of the library +.\"O .B libc +.\"O and routines are automatically loaded as needed by the compilers +.\"O .BR cc (1) +.\"O and +.\"O .BR pc (1). +.I stdio +¥é¥¤¥Ö¥é¥ê¤Ï +.B libc +¥é¥¤¥Ö¥é¥ê¤Î°ìÉô¤Ç¤¢¤ê¡¢¥ë¡¼¥Á¥ó¤Ï +¥³¥ó¥Ñ¥¤¥é¡¼ +.BR cc (1) +¤È +.BR pc (1) +¤Ë¤è¤Ã¤ÆɬÍפʻþ¤Ë¼«Æ°Åª¤ËÆɤ߹þ¤Þ¤ì¤ë¡£ +.\"O The +.\"O SYNOPSIS +.\"O sections of the following manual pages indicate which include files are to +.\"O be used, what the compiler declaration for the function looks like and +.\"O which external variables are of interest. +¸å½Ò¤¹¤ë man ¥Ú¡¼¥¸Ãæ¤Î¡Ö½ñ¼°¡×¤ÎÀá¤Ë¤Ï¡¢ +¤É¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤«¡¢ +¤½¤Î´Ø¿ô¤Î¥³¥ó¥Ñ¥¤¥é¡¼Àë¸À¤Ï¤É¤Î¤è¤¦¤Ê¤â¤Î¤«¡¢ +¤É¤Î¤è¤¦¤Ê³°ÉôÊÑ¿ô¤¬´Ø·¸¤¹¤ë¤Î¤«¤¬¼¨¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O The following are defined as macros; these names may not be reused without +.\"O first removing their current definitions with +.\"O .BR #undef : +.BR BUFSIZ , +.BR EOF , +.BR FILENAME_MAX , +.BR FOPEN_MAX , +.BR L_cuserid , +.BR L_ctermid , +.BR L_tmpnam , +.BR NULL , +.BR SEEK_END , +.BR SEEK_SET , +.BR SEEK_CUR , +.BR TMP_MAX , +.BR clearerr , +.BR feof , +.BR ferror , +.BR fileno , +.\" Not on Linux: .BR fropen , +.\" Not on Linux: .BR fwopen , +.BR getc , +.BR getchar , +.BR putc , +.BR putchar , +.BR stderr , +.BR stdin , +.\"O .BR stdout . +.B stdout +¤Ï¥Þ¥¯¥í¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î̾Á°¤Ï¡¢¸½ºß¤ÎÄêµÁ¤ò +.B #undef +¤Çºï½ü¤·¤Ê¤¤¸Â¤ê¡¢ºÆÍøÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\"O Function versions of the macro functions +¥Þ¥¯¥í´Ø¿ô¤Î´Ø¿ôÈǤȤ·¤Æ¡¢ +.BR feof , +.BR ferror , +.BR clearerr , +.BR fileno , +.BR getc , +.BR getchar , +.BR putc , +.B putchar +.\"O exist and will be used if the macros definitions are explicitly removed. +¤¬¤¢¤ë¡£ +¥Þ¥¯¥í¤ÎÄêµÁ¤¬ÌÀ¼¨Åª¤Ë¾Ãµî¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤³¤ì¤é¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë¤Ê¤ë¤À¤í¤¦¡£ +.\"O .SS "List of Functions" +.SS ´Ø¿ô¤Î¥ê¥¹¥È +.TS +; +lb lb +lb l. +.\"O Function Description +´Ø¿ô ÀâÌÀ +_ +.\"O clearerr check and reset stream status +.\"O fclose close a stream +.\"O fdopen stream open functions +.\"O feof check and reset stream status +.\"O ferror check and reset stream status +.\"O fflush flush a stream +clearerr ¥¹¥È¥ê¡¼¥à¤Î¾õÂ֤γÎǧ¤È¥ê¥»¥Ã¥È +fclose ¥¹¥È¥ê¡¼¥à¤ò¥¯¥í¡¼¥º¤¹¤ë +fdopen ¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤¹¤ë +feof ¥¹¥È¥ê¡¼¥à¤Î¾õÂ֤γÎǧ¤È¥ê¥»¥Ã¥È +ferror ¥¹¥È¥ê¡¼¥à¤Î¾õÂ֤γÎǧ¤È¥ê¥»¥Ã¥È +fflush ¥¹¥È¥ê¡¼¥à¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë +.\"O fgetc get next character or word from input stream +.\"O fgetpos reposition a stream +.\"O fgets get a line from a stream +.\"O fileno return the integer descriptor of the argument stream +.\"O fopen stream open functions +.\"O fprintf formatted output conversion +.\"O fpurge flush a stream +.\"O fputc output a character or word to a stream +.\"O fputs output a line to a stream +.\"O fread binary stream input/output +.\"O freopen stream open functions +fgetc ¼¡¤Îʸ»ú¤Þ¤¿¤Ï¸ì¤òÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é³ÍÆÀ¤¹¤ë +fgetpos ¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ¤ò¼èÆÀ¤¹¤ë +.\"nakano ¢¬¸¶Ê¸°ã¤¦¤Î¤Ç¤Ï? +fgets ¥¹¥È¥ê¡¼¥à¤«¤é¹Ô¤ò¼èÆÀ¤¹¤ë +fileno °ú¤­¿ô¤Ç¤¢¤ë¥¹¥È¥ê¡¼¥à¤ÎÀ°¿ôÃͤΥǥ£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹ +fopen ¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤¹¤ë +fprintf ½ñ¼°ÉÕ¤­½ÐÎÏÊÑ´¹ +fpurge ¥¹¥È¥ê¡¼¥à¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë +fputc ʸ»ú¤Þ¤¿¤Ï¸ì¤ò¥¹¥È¥ê¡¼¥à¤Ë½ÐÎϤ¹¤ë +fputs ¹Ô¤ò¥¹¥È¥ê¡¼¥à¤Ë½ÐÎϤ¹¤ë +fread ¥Ð¥¤¥Ê¥ê¡¼¥¹¥È¥ê¡¼¥àÆþ½ÐÎÏ +freopen ¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤¹¤ë +.\"O fscanf input format conversion +.\"O fseek reposition a stream +.\"O fsetpos reposition a stream +.\"O ftell reposition a stream +.\"O fwrite binary stream input/output +.\"O getc get next character or word from input stream +.\"O getchar get next character or word from input stream +.\"O gets get a line from a stream +.\"O getw get next character or word from input stream +fscanf ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +fseek ¥¹¥È¥ê¡¼¥à¤Î°ÌÃֻؼ¨»Ò¤ò°ÜÆ°¤¹¤ë +fsetpos ¥¹¥È¥ê¡¼¥à¤Î°ÌÃֻؼ¨»Ò¤ò°ÜÆ°¤¹¤ë +ftell ¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ¤ò¼èÆÀ¤¹¤ë +.\"nakano ¢¬¤³¤ì¤â¡£ +fwrite ¥Ð¥¤¥Ê¥ê¡¼¥¹¥È¥ê¡¼¥àÆþ½ÐÎÏ +getc ¼¡¤Îʸ»ú¤Þ¤¿¤Ï¸ì¤òÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é¼èÆÀ¤¹¤ë +getchar ¼¡¤Îʸ»ú¤Þ¤¿¤Ï¸ì¤òÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é¼èÆÀ¤¹¤ë +gets ¹Ô¤òÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é¼èÆÀ¤¹¤ë +getw ¼¡¤Îʸ»ú¤Þ¤¿¤Ï¸ì¤òÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é¼èÆÀ¤¹¤ë +.\"O mktemp make temporary filename (unique) +.\"O perror system error messages +.\"O printf formatted output conversion +.\"O putc output a character or word to a stream +.\"O putchar output a character or word to a stream +.\"O puts output a line to a stream +.\"O putw output a character or word to a stream +.\"O remove remove directory entry +.\"O rewind reposition a stream +.\"O scanf input format conversion +mktemp ¾¤È½Å¤Ê¤é¤Ê¤¤¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë̾¤òºî¤ë +perror ¥·¥¹¥Æ¥à¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ +printf ½ñ¼°ÉÕ¤­½ÐÎÏÊÑ´¹ +putc ʸ»ú¤Þ¤¿¤Ï¸ì¤ò¥¹¥È¥ê¡¼¥à¤Ë½ÐÎϤ¹¤ë +putchar ʸ»ú¤Þ¤¿¤Ï¸ì¤ò¥¹¥È¥ê¡¼¥à¤Ë½ÐÎϤ¹¤ë +puts ¹Ô¤ò¥¹¥È¥ê¡¼¥à¤Ë½ÐÎϤ¹¤ë +putw ʸ»ú¤Þ¤¿¤Ï¸ì¤ò¥¹¥È¥ê¡¼¥à¤Ë½ÐÎϤ¹¤ë +remove ¥Ç¥£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê¤òºï½ü¤¹¤ë +rewind ¥¹¥È¥ê¡¼¥à¤Î°ÌÃֻؼ¨»Ò¤ò°ÜÆ°¤¹¤ë +scanf ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +.\"O setbuf stream buffering operations +.\"O setbuffer stream buffering operations +.\"O setlinebuf stream buffering operations +.\"O setvbuf stream buffering operations +.\"O sprintf formatted output conversion +.\"O sscanf input format conversion +.\"O strerror system error messages +.\"O sys_errlist system error messages +.\"O sys_nerr system error messages +.\"O tempnam temporary file routines +.\"O tmpfile temporary file routines +.\"O tmpnam temporary file routines +.\"O ungetc un-get character from input stream +setbuf ¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ÎÁàºî +setbuffer ¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ÎÁàºî +setlinebuf ¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ÎÁàºî +setvbuf ¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ÎÁàºî +sprintf ½ñ¼°ÉÕ¤­½ÐÎÏÊÑ´¹ +sscanf ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +strerror ¥·¥¹¥Æ¥à¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ +sys_errlist ¥·¥¹¥Æ¥à¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ +sys_nerr ¥·¥¹¥Æ¥à¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ +tempnam ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤ÎÁàºî +tmpfile ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤ÎÁàºî +tmpnam ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤ÎÁàºî +ungetc ÆþÎÏ¥¹¥È¥ê¡¼¥à¤Ø 1 ʸ»úÌ᤹¡£ +.\"O vfprintf formatted output conversion +.\"O vfscanf input format conversion +.\"O vprintf formatted output conversion +.\"O vscanf input format conversion +.\"O vsprintf formatted output conversion +.\"O vsscanf input format conversion +vfprintf ½ñ¼°ÉÕ¤­½ÐÎÏÊÑ´¹ +vfscanf ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +vprintf ½ñ¼°ÉÕ¤­½ÐÎÏÊÑ´¹ +vscanf ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +vsprintf ½ñ¼°ÉÕ¤­½ÐÎÏÊÑ´¹ +vsscanf ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +.TE +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The +.\"O .I stdio +.\"O library conforms to C89. +.I stdio +¥é¥¤¥Ö¥é¥ê¤Ï C89 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR open (2), +.BR read (2), +.BR write (2), +.BR stdout (3), +.BR unlocked_stdio (3) diff --git a/draft/man3/stdio_ext.3 b/draft/man3/stdio_ext.3 new file mode 100644 index 00000000..a57d6cb6 --- /dev/null +++ b/draft/man3/stdio_ext.3 @@ -0,0 +1,192 @@ +.\" 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) 2002 Akihiro MOTOKI all rights reserved. +.\" Translated Nov 2 2002 by Akihiro MOTOKI +.TH STDIO_EXT 3 2001-12-16 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O __fbufsize, __flbf, __fpending, __fpurge, __freadable, +.\"O __freading, __fsetlocking, __fwritable, __fwriting, _flushlbf \- +.\"O interfaces to stdio FILE structure +__fbufsize, __flbf, __fpending, __fpurge, __freadable, +__freading, __fsetlocking, __fwritable, __fwriting, _flushlbf \- +ɸ½àÆþ½ÐÎÏ¥Õ¥¡¥¤¥ë¹½Â¤ÂΤؤΥ¤¥ó¥¿¥Õ¥§¡¼¥¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "size_t __fbufsize(FILE *" stream ); +.br +.BI "size_t __fpending(FILE *" stream ); +.br +.BI "int __flbf(FILE *" stream ); +.br +.BI "int __freadable(FILE *" stream ); +.br +.BI "int __fwritable(FILE *" stream ); +.br +.BI "int __freading(FILE *" stream ); +.br +.BI "int __fwriting(FILE *" stream ); +.br +.BI "int __fsetlocking(FILE *" stream ", int " type ); +.br +.B "void _flushlbf(void);" +.br +.BI "void __fpurge(FILE *" stream ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Solaris introduced routines to allow portable access to the +.\"O internals of the +.\"O .I FILE +.\"O structure, and glibc also implemented these. +Solaris ¤Ç¤Ï¡¢ +.I FILE +¹½Â¤ÂΤÎÆâÉô¤Ø¥Ý¡¼¥¿¥Ö¥ë¤Ê¤«¤¿¤Á¤Ç +¥¢¥¯¥»¥¹¤Ç¤­¤ë¼êÃʤ¬Æ³Æþ¤µ¤ì¤Æ¤ª¤ê¡¢¤³¤ì¤é¤Ï glibc ¤Ç¤â¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +.\"O The +.\"O .BR __fbufsize () +.\"O function returns the size of the buffer currently used +.\"O by the given stream. +.BR __fbufsize () +´Ø¿ô¤Ï¡¢»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤¬»ÈÍѤ·¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡¡¦¥µ¥¤¥º¤òÊÖ¤¹¡£ +.LP +.\"O The +.\"O .BR __fpending () +.\"O function returns the number of bytes in the output buffer. +.\"O For wide-oriented streams the unit is wide characters. +.\"O This function is undefined on buffers in reading mode, +.\"O or opened read-only. +.BR __fpending () +´Ø¿ô¤Ï¡¢½ÐÎϥХåե¡¤ËÆþ¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥ï¥¤¥É¥­¥ã¥é¥¯¥¿¤ò°·¤¦¥¹¥È¥ê¡¼¥à¤Î¾ì¹ç¡¢¥ï¥¤¥É¥­¥ã¥é¥¯¥¿Ã±°Ì¤Ç·×»»¤µ¤ì¤ë¡£ +¥Ð¥Ã¥Õ¥¡¤¬Æɤ߽Ф·¥â¡¼¥É¤Î¾ì¹ç¤äÆɤ߽Ф·ÀìÍѤdz«¤«¤ì¤Æ¤¤¤ë¾ì¹ç¤Î +¤³¤Î´Ø¿ô¤Î¿¶Éñ¤¤¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.LP +.\"O The +.\"O .BR __flbf () +.\"O function returns a nonzero value if the stream is line-buffered, +.\"O and zero otherwise. +.BR __flbf () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬¥é¥¤¥ó¥Ð¥Ã¥Õ¥¡¤Î¾ì¹ç¤Ï 0 °Ê³°¤ò¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.\"O The +.\"O .BR __freadable () +.\"O function returns a nonzero value if the stream allows reading, +.\"O and zero otherwise. +.BR __freadable () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬Æɤ߽Ф·²Äǽ¤Ê¾ì¹ç¤Ï 0 °Ê³°¤ò¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.\"O The +.\"O .BR __fwritable () +.\"O function returns a nonzero value if the stream allows writing, +.\"O and zero otherwise. +.BR __fwritable () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬½ñ¤­¹þ¤ß²Äǽ¤Ê¾ì¹ç¤Ï 0 °Ê³°¤ò¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.\"O The +.\"O .BR __freading () +.\"O function returns a nonzero value if the stream is read-only, or +.\"O if the last operation on the stream was a read operation, +.\"O and zero otherwise. +.BR __freading () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬Æɤ߽Ф·ÀìÍѤξì¹ç¡¢¤Þ¤¿¤Ï¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ëľÁ°¤ÎÁàºî¤¬ +Æɤ߽Ф·Áàºî¤Ç¤¢¤Ã¤¿¾ì¹ç¤Ï 0 °Ê³°¤òÊÖ¤·¡¢¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.\"O The +.\"O .BR __fwriting () +.\"O function returns a nonzero value if the stream is write-only (or +.\"O append-only), or if the last operation on the stream was a write +.\"O operation, and zero otherwise. +.BR __fwriting () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬½ñ¤­¹þ¤ßÀìÍÑ(¤â¤·¤¯¤ÏÄɲÃÀìÍÑ)¤Î¾ì¹ç¡¢ +¤Þ¤¿¤Ï¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ëľÁ°¤ÎÁàºî¤¬½ñ¤­¹þ¤ßÁàºî¤Ç¤¢¤Ã¤¿¾ì¹ç¤Ï 0 °Ê³°¤òÊÖ¤·¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.\"O The +.\"O .BR __fsetlocking () +.\"O function can be used to select the desired type of locking on the stream. +.\"O It returns the current type. +.\"O The +.\"O .I type +.\"O argument can take the following three values: +.BR __fsetlocking () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤Î¥í¥Ã¥¯·Á¼°¤òÁªÂò¤¹¤ë¤¿¤á¤Ë»ÈÍѤǤ­¤ë¡£ +ÊÖ¤êÃͤϡ¢¸½ºß¤Î¥í¥Ã¥¯·Á¼°¤Ç¤¢¤ë¡£ +.I type +°ú¤­¿ô¤Ï°Ê²¼¤Î 3 ¼ïÎà¤ÎÃͤò¤È¤ë¤³¤È¤¬¤Ç¤­¤ë : +.TP +.B FSETLOCKING_INTERNAL +.\"O Perform implicit locking around every operation on the given stream +.\"O (except for the *_unlocked ones). +.\"O This is the default. +»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤ÆÁàºî¤¬¹Ô¤ï¤ì¤ëÅ٤ˡ¢Áàºî¤ÎÁ°¸å¤Ç +ÌÀ¼¨Åª¤Ë»Ø¼¨¤·¤Ê¤¯¤Æ¤â¥¹¥È¥ê¡¼¥à¤Î¥í¥Ã¥¯½èÍý¤ò¹Ô¤¦ +(⤷¡¢*_unlocked ´Ø¿ô¤ò»ÈÍѤ·¤¿¾ì¹ç¤ÏÎã³°¤Ç¤¢¤ë)¡£ +¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤Î¥í¥Ã¥¯·Á¼°¤Ç¤¢¤ë¡£ +.TP +.B FSETLOCKING_BYCALLER +.\"O The caller will take care of the locking (possibly using +.\"O .BR flockfile (3) +.\"O in case there is more than one thread), and the stdio routines +.\"O will not do locking until the state is reset to +.\"O .BR FSETLOCKING_INTERNAL . +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¸µ¤Ç¥í¥Ã¥¯¤ÎÌÌÅݤò¤ß¤ë¡£ +(¤ª¤½¤é¤¯¡¢Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤¬Â¸ºß¤¹¤ë¾õ¶·¤Ç¤Ï +.BR flockfile (3) +¤ò»È¤¦¤³¤È¤Ë¤Ê¤ë¤À¤í¤¦) +¥í¥Ã¥¯·Á¼°¤¬ +.B FSETLOCKING_INTERNAL +¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¤Þ¤Ç¤Ïɸ½àÆþ½ÐÎÏ´ØÏ¢¤Î´Ø¿ô¤Ï¥í¥Ã¥¯½èÍý¤ò¹Ô¤ï¤Ê¤¤¡£ +.TP +.B FSETLOCKING_QUERY +.\"O Don't change the type of locking. +.\"O (Only return it.) +¥í¥Ã¥¯·Á¼°¤ÎÊѹ¹¤ò¹Ô¤ï¤Ê¤¤¡£(¸½ºß¤Î·Á¼°¤òÊÖ¤¹¤À¤±¤Ç¤¢¤ë) +.LP +.\"O The +.\"O .BR _flushlbf () +.\"O function flushes all line-buffered streams. +.\"O (Presumably so that +.\"O output to a terminal is forced out, say before reading keyboard input.) +.BR _flushlbf () +´Ø¿ô¤Ï¡¢¤¹¤Ù¤Æ¤Î¥é¥¤¥ó¥Ð¥Ã¥Õ¥¡ (line-buffered) ¥¿¥¤¥×¤Î¥¹¥È¥ê¡¼¥à¤Î +ÆâÍƤò½ÐÎÏ(¥Õ¥é¥Ã¥·¥å)¤¹¤ë¡£ +(ÅöÁ³¤Ê¤¬¤é¡¢Ã¼Ëö¤Ø¤Î½ÐÎϤ¬¶¯À©Åª¤Ë¹Ô¤ï¤ì¤ë¤³¤È¤Ë¤Ê¤ë¤Î¤Ç¡¢ +¥­¡¼¥Ü¡¼¥É¤«¤é¤ÎÆþÎϤòÆɤߤ³¤àÁ°¤Ë¤³¤Î´Ø¿ô¤ò¸Æ¤ó¤ÀÊý¤¬¤¤¤¤¤À¤í¤¦) +.LP +.\"O The +.\"O .BR __fpurge () +.\"O function discards the contents of the stream's buffer. +.BR __fpurge () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¤ÎÆâÍƤòÇÑ´þ¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR flockfile (3), +.BR fpurge (3) diff --git a/draft/man3/stpcpy.3 b/draft/man3/stpcpy.3 new file mode 100644 index 00000000..12f4cb25 --- /dev/null +++ b/draft/man3/stpcpy.3 @@ -0,0 +1,121 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" 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. +.\" +.\" 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. +.\" +.TH STPCPY 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O stpcpy \- copy a string returning a pointer to its end +stpcpy \- ʸ»úÎó¤ò¥³¥Ô¡¼¤·¡¢¥³¥Ô¡¼¤·¤¿Ê¸»úÎó¤Î½ª¤ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *stpcpy(char *" dest ", const char *" src ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR stpcpy () +.\"O function copies the string pointed to by \fIsrc\fP +.\"O (including the terminating \(aq\\0\(aq character) 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 ¤Ç»Ø¤µ¤ì¤¿Ê¸»úÎó¤ò (ʸ»úÎó¤ò½ªÃ¼¤¹¤ë \(aq\\0\(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" +.SH ½àµò +.\"O This function is not part of the C or POSIX.1 standards, and is +.\"O not customary on Unix systems, but is not a GNU invention either. +.\"O Perhaps it comes from MS-DOS. +.\"O Nowadays, it is also present on the BSDs. +¤³¤Î´Ø¿ô¤Ï¡¢C ¤ä POSIX.1 ɸ½à¤Î°ìÉô¤Ç¤Ï¤Ê¤¯¡¢Unix ¥·¥¹¥Æ¥à¤Î´·½¬Åª¤Ê +¤â¤Î¤Ç¤â¤Ê¤¤¤¬¡¢GNU ¤ÎȯÌÀ¤È¤¤¤¦¤ï¤±¤Ç¤â¤Ê¤¤¡£ +¤Ò¤ç¤Ã¤È¤·¤¿¤é MS-DOS ͳÍè¤Î¤â¤Î¤«¤â¤·¤ì¤Ê¤¤¡£ +¸½ºß¤Ç¤Ï¡¢BSD ·Ï¤Ë¤â¸ºß¤¹¤ë¡£ +.\"O .SH EXAMPLE +.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 () +¤ò»ÈÍѤ·¡¢¤½¤Î¸åɽ¼¨¤¹¤ë¡£ +.in +4n +.nf + +#define _GNU_SOURCE +#include +#include + +int +main(void) +{ + char buffer[20]; + char *to = buffer; + + to = stpcpy(to, "foo"); + to = stpcpy(to, "bar"); + printf("%s\\n", 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 strcpy (3), +.BR wcpcpy (3), +.BR feature_test_macros (7) diff --git a/draft/man3/stpncpy.3 b/draft/man3/stpncpy.3 new file mode 100644 index 00000000..ef260953 --- /dev/null +++ b/draft/man3/stpncpy.3 @@ -0,0 +1,78 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" 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 +.\" +.TH STPNCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O stpncpy \- copy a fixed-size string, returning a pointer to its end +stpncpy \- ¸ÇÄêŤÎʸ»úÎó¤ò¥³¥Ô¡¼¤·¤Æ¡¢¤½¤ÎºÇ¸å¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *stpncpy(char *" dest ", const char *" src ", size_t " n ); +.fi +.\"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 \(aq\\0\(aq character, +.\"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 \(aq\\0\(aq characters. +.\"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 \(aq\\0\(aq terminated. +.BR stpncpy () +´Ø¿ô¤Ï \fIsrc\fP ¤¬»Ø¤·¤Æ¤¤¤ëʸ»úÎ󤫤齪ü¤Î \(aq\\0\(aq ʸ»ú¤ò +´Þ¤á¤ÆºÇÂç \fIn\fP ¥Ð¥¤¥È¤ò \fIdest\fP ¤Ë¥³¥Ô¡¼¤¹¤ë¡£Ä¹¤µ +\fIstrlen(src)\fP ¤¬ \fIn\fP ¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ë¤Ï \fIdest\fP ¤Î»Ä¤ê¤Î +Éôʬ¤Ë¤Ï \(aq\\0\(aq ʸ»ú¤¬Ëä¤á¤é¤ì¤ë¡£Ä¹¤µ \fIstrlen(src)\fP ¤¬ \fIn\fP °Ê¾å +¤Ê¤é¤Ð¡¢\fIdest\fP ¤¬»Ø¤¹Ê¸»úÎó¤Ï \(aq\\0\(aq ¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.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" +.SH ÊÖ¤êÃÍ +.\"O .BR stpncpy () +.\"O returns a pointer to the terminating null +.\"O in \fIdest\fP, or, if \fIdest\fP is not null-terminated, +.\"O \fIdest + n\fP. +.BR stpncpy () +¤Ï \fIdest\fP ¤Î½ªÃ¼¤Î¥Ê¥ëʸ»ú¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¤«¡¢ +\fIdest\fP ¤¬¥Ê¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï \fIdest + n\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is a GNU extension. +¤³¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strncpy (3), +.BR wcpncpy (3), +.BR feature_test_macros (7) diff --git a/draft/man3/strcasecmp.3 b/draft/man3/strcasecmp.3 new file mode 100644 index 00000000..f5b54b1e --- /dev/null +++ b/draft/man3/strcasecmp.3 @@ -0,0 +1,96 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Thu Dec 25 10:54:13 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. +.\" +.\" 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:12:45 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRCASECMP 3 1993-04-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O strcasecmp, strncasecmp \- compare two strings ignoring case +strcasecmp, strncasecmp \- Æó¤Ä¤Îʸ»úÎó¤òÂçʸ»ú¾®Ê¸»ú¤ò¶èÊ̤»¤ºÈæ³Ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int strcasecmp(const char *" s1 ", const char *" s2 ); +.sp +.BI "int strncasecmp(const char *" s1 ", const char *" s2 ", size_t " n ); +.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¡¢Àµ¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +.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" +.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" +.SH ½àµò +4.4BSD, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bcmp (3), +.BR memcmp (3), +.BR strcmp (3), +.BR strcoll (3), +.BR strncmp (3), +.BR wcscasecmp (3), +.BR wcsncasecmp (3) diff --git a/draft/man3/strcat.3 b/draft/man3/strcat.3 new file mode 100644 index 00000000..e8939156 --- /dev/null +++ b/draft/man3/strcat.3 @@ -0,0 +1,150 @@ +.\" 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 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 +.\" +.TH STRCAT 3 2008-06-13 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O strcat, strncat \- concatenate two strings +strcat, strncat \- Æó¤Ä¤Îʸ»úÎó¤òÏ¢·ë¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strcat(char *" dest ", const char *" src ); +.sp +.BI "char *strncat(char *" dest ", const char *" src ", size_t " n ); +.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, 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 ¤ÎºÇ¸å¤Ë¤¢¤ë¥Ì¥ë¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ï¾å½ñ¤­¤µ¤ì¡¢ +¿·¤¿¤ËÀ¸À®¤µ¤ì¤¿Ê¸»úÎó¤ÎËöÈø¤Ë½ªÃ¼¤Î¥Ì¥ë¥Ð¥¤¥È¤¬ÉÕÍ¿¤µ¤ì¤ë¡£ +Æó¤Ä¤Îʸ»úÎó \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 () +¤âƱÍͤÀ¤¬¡¢°Ê²¼¤ÎÅÀ¤¬°Û¤Ê¤ë¡£ +.IP * 3 +\fIsrc\fP ¤Î¤¦¤ÁºÇÂç \fIn\fP ʸ»ú¤¬»ÈÍѤµ¤ì¤ë¡£ +.IP * +\fIsrc\fP ¤¬ \fIn\fP ʸ»ú°Ê¾å¤Î¾ì¹ç¡¢ +\fIsrc\fP ¤Ï¥Ì¥ë½ªÃ¼¤µ¤ì¤Æ¤¤¤ëɬÍפϤʤ¤¡£ +.PP +.\"O As with +.\"O .BR strcat (), +.\"O the resulting string in \fIdest\fP is always null-terminated. +.BR strcat () +¤ÈƱ¤¸¤¯¡¢\fIdest\fP ¤Ë³ÊǼ¤µ¤ì¤ë·ë²Ì¤Îʸ»úÎó¤Ï¾ï¤Ë¥Ì¥ë½ªÃ¼¤µ¤ì¤ë¡£ +.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 ʸ»ú¤È½ªÃ¼¤Î¥Ì¥ë¥Ð¥¤¥È¤Ç¤¢¤ë)¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢\fIdest\fP ¤ÎÂ礭¤µ¤ÏºÇÄã¤Ç¤â +\fIstrlen(dest)+n+1\fP ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O A simple implementation of +.\"O .BR strncat () +.\"O might be: +.BR strncat () +¤Î´Êñ¤Ê¼ÂÁõ¤Ï°Ê²¼¤Î¤è¤¦¤Ê´¶¤¸¤Ç¤¢¤í¤¦: +.in +4n +.nf + +char* +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++) + dest[dest_len + i] = src[i]; + dest[dest_len + i] = \(aq\\0\(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" +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bcopy (3), +.BR memccpy (3), +.BR memcpy (3), +.BR strcpy (3), +.BR strncpy (3), +.BR wcscat (3), +.BR wcsncat (3) diff --git a/draft/man3/strchr.3 b/draft/man3/strchr.3 new file mode 100644 index 00000000..985e3f73 --- /dev/null +++ b/draft/man3/strchr.3 @@ -0,0 +1,150 @@ +.\" 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 Mon Apr 12 12:51:24 1993, David Metcalfe +.\" 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 +.\" +.TH STRCHR 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O strchr, strrchr, strchrnul \- locate character in string +strchr, strrchr, strchrnul \- ʸ»úÎóÃæ¤Îʸ»ú¤Î°ÌÃÖ¤òÆÃÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strchr(const char *" s ", int " c ); +.sp +.BI "char *strrchr(const char *" s ", int " c ); +.sp +.B #define _GNU_SOURCE +.B #include +.sp +.BI "char *strchrnul(const char *" s ", int " c ); +.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 +¤¬¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.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 +¤¬¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.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 Ãæ¤Ë¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¡¢ÊÖ¤êÃͤȤ·¤Æ +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 ¤òÊÖ¤¹¡£ + +.\"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 +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR strchrnul () +.\"O first appeared in glibc in version 2.1.1. +.BR strchrnul () +¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "CONFORMING TO" +.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" +.SH ´ØÏ¢¹àÌÜ +.BR index (3), +.BR memchr (3), +.BR rindex (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), +.BR feature_test_macros (7) diff --git a/draft/man3/strcmp.3 b/draft/man3/strcmp.3 new file mode 100644 index 00000000..51b1c410 --- /dev/null +++ b/draft/man3/strcmp.3 @@ -0,0 +1,101 @@ +.\" 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 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 2009-04-21 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O strcmp, strncmp \- compare two strings +.SH ̾Á° +strcmp, strncmp \- Æó¤Ä¤Îʸ»úÎó¤òÈæ¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int strcmp(const char *" s1 ", const char *" s2 ); +.sp +.BI "int strncmp(const char *" s1 ", const char *" s2 ", size_t " n ); +.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)Â礭¤¤À°¿ô¤òÊÖ¤¹¡£ +.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. +.SH ÊÖ¤êÃÍ +.BR strcmp () +´Ø¿ô¤È +.BR strncmp () +´Ø¿ô¤ÏÀ°¿ô¤òÊÖ¤¹¡£ +¤³¤ÎÀ°¿ô¤Ï¡¢¥¼¥í¤è¤ê¤â¡¢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 strncasecmp (3), +.BR strverscmp (3), +.BR wcscmp (3), +.BR wcsncmp (3) diff --git a/draft/man3/strcoll.3 b/draft/man3/strcoll.3 new file mode 100644 index 00000000..39a214da --- /dev/null +++ b/draft/man3/strcoll.3 @@ -0,0 +1,99 @@ +.\" 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 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 +.\" +.TH STRCOLL 3 1993-04-12 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O strcoll \- compare two strings using the current locale +strcoll \- ¸½ºß¤Î¥í¥±¡¼¥ë¤ò»ÈÍѤ·¤ÆÆó¤Ä¤Îʸ»úÎó¤òÈæ³Ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int strcoll(const char *" s1 ", const char *" s2 ); +.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" +.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¡¢Àµ¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +¤É¤Á¤é¤Îʸ»úÎó¤â¸½ºß¤Î¥í¥±¡¼¥ë¤Ë±þ¤¸¤Æ²ò¼á¤µ¤ì¤¿¤â¤Î¤¬»ÈÍѤµ¤ì¤ë¡£ +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR bcmp (3), +.BR memcmp (3), +.BR setlocale (3), +.BR strcasecmp (3), +.BR strcmp (3), +.BR strxfrm (3) diff --git a/draft/man3/strcpy.3 b/draft/man3/strcpy.3 new file mode 100644 index 00000000..abcc3303 --- /dev/null +++ b/draft/man3/strcpy.3 @@ -0,0 +1,211 @@ +.\" Copyright (C) 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 Sat Jul 24 18:06:49 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Aug 25 23:17:51 1995 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Wed Dec 18 00:47:18 1996 by Andries Brouwer (aeb@cwi.nl) +.\" 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 +.\" +.TH STRCPY 3 2009-12-04 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O strcpy, strncpy \- copy a string +strcpy, strncpy \- ʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strcpy(char *" dest ", const char *" src ); +.sp +.BI "char *strncpy(char *" dest ", const char *" src ", size_t " n ); +.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 ¤Ï +¥³¥Ô¡¼¤ò¼õ¤±¼è¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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 ¤Ë³ÊǼ¤µ¤ì¤ëʸ»úÎó¤Ï¥Ì¥ë¤Ç½ªÃ¼¤µ¤ì¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£ +.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 +¤Î»Ä¤ê¤ò¥Ì¥ë¥Ð¥¤¥È¤ÇËä¤á¤ë¡£ +.PP +.\"O A simple implementation of +.\"O .BR strncpy () +.\"O might be: +.BR strncpy () +¤Î´Êñ¤Ê¼ÂÁõ¤Ï°Ê²¼¤Î¤è¤¦¤Ê´¶¤¸¤Ç¤¢¤í¤¦: +.in +4n +.nf + +char* +strncpy(char *dest, const char *src, size_t n){ + size_t i; + + for (i = 0 ; i < n && src[i] != \(aq\\0\(aq ; i++) + dest[i] = src[i]; + for ( ; i < n ; i++) + dest[i] = \(aq\\0\(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" +.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() +¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"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 ¤Ë½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤Ê¸»úÎó¤òÀ¸À®¤¹¤ë¡£ +¥×¥í¥°¥é¥Þ¤Ï´Ö°ã¤¤¤òËɻߤ¹¤ë¤¿¤á¤Ë¡¢ +°Ê²¼¤Î¤è¤¦¤Ë¶¯À©Åª¤Ë½ªÃ¼¤ò¹Ô¤¦¤³¤È¤¬¤è¤¯¤¢¤ë¡£ +.in +4n +.nf + +strncpy(buf, str, n); +if (n > 0) + buf[n \- 1]= \(aq\\0\(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" +.SH ´ØÏ¢¹àÌÜ +.BR bcopy (3), +.BR memccpy (3), +.BR memcpy (3), +.BR memmove (3), +.BR stpcpy (3), +.BR strdup (3), +.BR wcscpy (3), +.BR wcsncpy (3) diff --git a/draft/man3/strdup.3 b/draft/man3/strdup.3 new file mode 100644 index 00000000..4c404da7 --- /dev/null +++ b/draft/man3/strdup.3 @@ -0,0 +1,140 @@ +.\" 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 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 +.\" +.TH STRDUP 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +.\"O strdup, strndup, strdupa, strndupa \- duplicate a string +strdup, strndup, strdupa, strndupa \- ʸ»úÎó¤òÊ£À½¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strdup(const char *" s ); +.sp +.BI "char *strndup(const char *" s ", size_t " n ); +.br +.BI "char *strdupa(const char *" s ); +.br +.BI "char *strndupa(const char *" s ", size_t " n ); +.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 strdup (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR strndup (), +.BR strdupa (), +.BR strndupa (): +_GNU_SOURCE +.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) +¤Ç²òÊü¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"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)) ¤¬Äɲ䵤ì¤ë¡£ + +.\"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 ¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤Î¤ÈƱÍͤÎÀ©¸Â¤ò¼õ¤±¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR strdup () +´Ø¿ô¤ÏÊ£À½¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¢¤Þ¤¿¤Ï +½½Ê¬¤Ê¥á¥â¥ê¤¬³ÎÊݤǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤ÏNULL¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +Ê£À½¤µ¤ì¤¿Ê¸»úÎó¤ò³ä¤êÅö¤Æ¤ë½½Ê¬¤Ê¥á¥â¥ê¤¬³ÎÊݤǤ­¤Ê¤«¤Ã¤¿¡£ +.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 .BR strdupa (), +.\"O and +.\"O .BR strndupa () +.\"O are GNU extensions. +.BR strndup (), +.BR strdupa (), +.BR strndupa () +¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR alloca (3), +.BR calloc (3), +.BR free (3), +.BR malloc (3), +.BR realloc (3), +.BR wcsdup (3) diff --git a/draft/man3/strerror.3 b/draft/man3/strerror.3 new file mode 100644 index 00000000..5a754e0d --- /dev/null +++ b/draft/man3/strerror.3 @@ -0,0 +1,302 @@ +.\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and Copyright (C) 2005, 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:05:30 1993 by Rik Faith +.\" Modified Fri Feb 16 14:25:17 1996 by Andries Brouwer +.\" Modified Sun Jul 21 20:55:44 1996 by Andries Brouwer +.\" Modified Mon Oct 15 21:16:25 2001 by John Levon +.\" Modified Tue Oct 16 00:04:43 2001 by Andries Brouwer +.\" Modified Fri Jun 20 03:04:30 2003 by Andries Brouwer +.\" 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 ½àµò¤Î +.\" +.TH STRERROR 3 2009-03-30 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O strerror, strerror_r \- return string describing error number +strerror, strerror_r \- ¥¨¥é¡¼ÈÖ¹æ¤òÀâÌÀ¤¹¤ëʸ»úÎó¤òÊÖ¤¹¡£ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strerror(int " errnum ); +.sp +.BI "char *strerror_r(int " errnum ", char *" buf ", size_t " buflen ); +.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 +.\"O The XSI-compliant version of +.\"O .BR strerror_r () +.\"O is provided if: +¼¡¤Î¾ì¹ç¤Ë¤Ï +XSI ½àµò¤Î¥Ð¡¼¥¸¥ç¥ó¤Î +.BR strerror_r () +¤¬Ä󶡤µ¤ì¤ë: +.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. +.SH ÀâÌÀ +.BR strerror () +´Ø¿ô¤Ï¡¢°ú¤­¿ô \fIerrnum\fP ¤ÇÅϤµ¤ì¤¿¥¨¥é¡¼¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤Î +ÀâÌÀ¤¬Æþ¤Ã¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +²Äǽ¤Ç¤¢¤ë¤Ê¤é¤Ð¡¢Å¬ÀڤʸÀ¸ì¤òÁªÂò¤¹¤ë¤¿¤á¤Ë¡¢ +¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_MESSAGES +¤ò»È¤¦¡£ +¤³¤Îʸ»úÎó¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÊѹ¹¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¤¬¡¢ +¤½¤Î¸å¤Ëµ¯¤³¤ë +.BR perror (3) +¤ä +.BR strerror () +¤Î¸Æ¤Ó½Ð¤·¤Ç +Êѹ¹¤µ¤ì¤Æ¤â¹½¤ï¤Ê¤¤¡£ +¤³¤Îʸ»úÎó¤òÊѹ¹¤¹¤ë¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï¤Ê¤¤¡£ + +.\"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 () +¤¬¥Ç¥Õ¥©¥ë¥È¤ÇÄ󶡤µ¤ì¤ë¡£ + +.\"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 +¤Ë¥¨¥é¡¼Ê¸»úÎó¤òÊÖ¤¹¡£ + +.\"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" +.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" ¤È¤¤¤¦ +¥á¥Ã¥»¡¼¥¸¤òÊÖ¤¹¡£ + +.\"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 +¤Ë¥¨¥é¡¼ÆâÍƤò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"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. +¥¨¥é¡¼¥³¡¼¥É¤òÀâÌÀ¤¹¤ëʸ»úÎó¤Î¤¿¤á¤Ë¡¢½¼Ê¬¤ÊÎΰ褬³ÎÊݤǤ­¤Ê¤«¤Ã¤¿¡£ +.\"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 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +.\"O The GNU-specific +.\"O .BR strerror_r () +.\"O function is a nonstandard extension. +GNU »ÅÍͤΠ+.BR strerror_r () +´Ø¿ô¤ÏÈóɸ½à¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR err (3), +.BR errno (3), +.BR error (3), +.BR perror (3), +.BR strsignal (3) diff --git a/draft/man3/strfmon.3 b/draft/man3/strfmon.3 new file mode 100644 index 00000000..751f82d5 --- /dev/null +++ b/draft/man3/strfmon.3 @@ -0,0 +1,279 @@ +.\" Copyright (c) 2000 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) 2001 NAKANO Takeo all rights reserved. +.\" Translated Thu Fri 08 2001 by NAKANO Takeo +.\" +.\"WORD: numeric fill character ¿ôÃÍËä¤áʸ»ú +.\"WORD: grouping character ¥°¥ë¡¼¥×²½Ê¸»ú +.\"WORD: left precision º¸ÀºÅÙ +.\"WORD: right precision º¸ÀºÅÙ +.\"WORD: radix (character) ´ð¿ôÅÀ(ʸ»ú) +.\"WORD: conversion character ÊÑ´¹Ê¸»ú +.\"WORD: international currency format ¹ñºÝÄ̲ߥե©¡¼¥Þ¥Ã¥È +.\"WORD: national currency format ¹ñÆâÄ̲ߥե©¡¼¥Þ¥Ã¥È +.\" +.TH STRFMON 3 2000-12-05 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O strfmon \- convert monetary value to a string +.SH ̾Á° +strfmon \- ¶â³Û¤ÎÃͤòʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "ssize_t strfmon(char *" s ", size_t " max ", const char *" format , +.B "...);" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR strfmon () +.\"O function formats the specified amounts +.\"O according to the format specification \fIformat\fP and places the +.\"O result in the character array \fIs\fP of size \fImax\fP. +.BR strfmon () +´Ø¿ô¤Ï¡¢»ØÄꤵ¤ì¤¿¿ôÎ̤ò +.I format +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤·¤¿¤¬¤Ã¤ÆÀ°·Á¤·¡¢ +·ë²Ì¤ò¥µ¥¤¥º +.I max +¤Îʸ»úÇÛÎó +.I s +¤Ë½ñ¤­¤³¤à¡£ +.PP +.\"O Ordinary characters in \fIformat\fP are copied to \fIs\fP +.\"O without conversion. +.\"O Conversion specifiers are introduced by a \(aq%\(aq +.\"O character. +.\"O Immediately following it there can be zero or more +.\"O of the following flags: +.I format +Ãæ¤ÎÄ̾ï¤Îʸ»ú¤Ï¡¢ÊÑ´¹¤µ¤ì¤º¤Ë¤½¤Î¤Þ¤Þ +.I s +¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ÊÑ´¹»ØÄê¤Ï \(aq%\(aq ʸ»ú¤Ç»Ï¤Þ¤ë¡£ +¤³¤Îľ¸å¤Ë¤Ï¡¢°Ê²¼¤Î¥Õ¥é¥°¤ò 0 ¸Ä°Ê¾å³¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BI = f +.\"O The single-byte character +.\"O .I f +.\"O is used as the numeric fill character (to be used with +.\"O a left precision, see below). +.\"O When not specified, the space character is used. +1 ¥Ð¥¤¥Èʸ»ú +.I f +¤ò¿ôÃÍËä¤áʸ»ú (numeric fill character) ¤Ë¤¹¤ë +(º¸ÀºÅ٤ȶ¦¤ËÍѤ¤¤ë¡£°Ê²¼¤ò»²¾È)¡£ +»ØÄꤵ¤ì¤Ê¤¤¤È¡¢¥¹¥Ú¡¼¥¹Ê¸»ú¤¬ÍѤ¤¤é¤ì¤ë¡£ +.TP +.B ^ +.\"O Do not use any grouping characters that might be defined +.\"O for the current locale. +.\"O By default, grouping is enabled. +¸½ºß¤Î¥í¥±¡¼¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤Ç¤¢¤í¤¦¥°¥ë¡¼¥×²½Ê¸»ú (grouping character) +¤ò°ìÀڻȤï¤Ê¤¤¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥°¥ë¡¼¥×²½¤ÏÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.TP +.\"O .BR ( " or " + +.BR ( " ¤Þ¤¿¤Ï " + +.\"O The ( flag indicates that negative amounts should be enclosed between +.\"O parentheses. +.\"O The + flag indicates that signs should be handled +.\"O in the default way, that is, amounts are preceded by the locale's +.\"O sign indication, for example, nothing for positive, "\-" for negative. +( ¥Õ¥é¥°¤Ï¡¢Éé¤Î¿ôÃͤò³ç¸Ì¤Ç³ç¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ ++ ¥Õ¥é¥°¤ÏÉä¹æ¤ò¥Ç¥Õ¥©¥ë¥È¤Î¤è¤¦¤Ë¼è¤ê°·¤¦¤³¤È¤ò°ÕÌ£¤¹¤ë +(¤¹¤Ê¤ï¤Á¿ôÃͤÎÁ°¤Ë¥í¥±¡¼¥ë¤ÎÉä¹æ¥Þ¡¼¥¯¤¬ÃÖ¤«¤ì¤ë¡£ +Î㤨¤ÐÀµ¤Ê¤é¤Ê¤Ë¤â¤Ê¤¯¡¢Éé¤Ê¤é \(aq\-\(aq ¤òÃÖ¤¯¡¢¤Ê¤É)¡£ +.TP +.B ! +.\"O Omit the currency symbol. +Ä̲ߥ·¥ó¥Ü¥ë¤ò¾Êά¤¹¤ë¡£ +.TP +.B \- +.\"O Left justify all fields. +.\"O The default is right justification. +¤¹¤Ù¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤òº¸µÍ¤á¤Ë¤¹¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ï±¦µÍ¤á¡£ +.LP +.\"O Next, there may be a field width: a decimal digit string specifying +.\"O a minimum field width in bytes. +.\"O The default is 0. +.\"O A result smaller than this width is padded with spaces +.\"O (on the left, unless the left-justify flag was given). +¼¡¤Î°ÌÃ֤ˤϡ¢¥Õ¥£¡¼¥ë¥É¤ÎÉý¤ò»ØÄê¤Ç¤­¤ë¡£ +10 ¿Ê¤Î¿ôÃÍʸ»úÎó¤Ç¡¢¥Õ¥£¡¼¥ë¥É¤ÎºÇ¾®Éý¤ò¥Ð¥¤¥Èñ°Ì¤Ç»ØÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 0¡£ +·ë²Ì¤¬¤³¤ÎÉý¤è¤ê¤â¶¹¤¯¤Ê¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +ÉÔ­ʬ¤¬¥¹¥Ú¡¼¥¹¤ÇËä¤á¤é¤ì¤ë +(º¸µÍ¤á¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ðº¸Â¦¤¬Ëä¤á¤é¤ì¤ë)¡£ +.LP +.\"O Next, there may be a left precision of the form "#" followed by +.\"O a decimal digit string. +.\"O If the number of digits left of the +.\"O radix character is smaller than this, the representation is +.\"O padded on the left with the numeric fill character. +.\"O Grouping characters are not counted in this field width. +¼¡¤Î°ÌÃ֤ˤϡ¢"#" ¤Ë 10 ¿Ê¿ôÃÍʸ»úÎó¤ò³¤±¤¿·Á¼°¤Ç¡¢ +º¸ÀºÅÙ (left precision) ¤ò»ØÄê¤Ç¤­¤ë¡£ +Ä̲ߤδð¿ôÅÀ (radix) ¤è¤êº¸Â¦¤Î¿ôÃͤηå¿ô¤¬¤³¤Î»ØÄê¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ï¡¢ +¿ôÃÍËä¤áʸ»ú¤Çº¸Â¦¤¬Ëä¤á¤é¤ì¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥ÉÉý¤Î»ØÄê¤Ç¤Ï¡¢¥°¥ë¡¼¥×²½Ê¸»ú¤Ï¥«¥¦¥ó¥È¤µ¤ì¤Ê¤¤¡£ +.LP +.\"O Next, there may be a right precision of the form "." followed by +.\"O a decimal digit string. +.\"O The amount being formatted is rounded to +.\"O the specified number of digits prior to formatting. +.\"O The default is specified in the +.\"O .I frac_digits +.\"O and +.\"O .I int_frac_digits +.\"O items of the current locale. +.\"O If the right precision is 0, no radix character is printed. +.\"O (The radix character here is determined by +.\"O .BR LC_MONETARY , +.\"O and may differ from that specified by +.\"O .BR LC_NUMERIC .) +¼¡¤Î°ÌÃ֤ˤϡ¢"." ¤Ë 10 ¿Ê¿ôÃÍʸ»úÎó¤ò³¤±¤¿·Á¼°¤Ç¡¢ +±¦ÀºÅÙ (right precision) ¤ò»ØÄê¤Ç¤­¤ë¡£ +À°·Á¤µ¤ì¤ë¿ôÃͤϡ¢À°·ÁÁ°¤Ë¤³¤Î·å¿ô¤Ë´Ý¤á¤é¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤Î +.I frac_digits +¤È +.I int_frac_digits +¤Î»ØÄê¤òÍѤ¤¤ë¡£ +±¦ÀºÅÙ¤¬ 0 ¤Î¾ì¹ç¤Ï¡¢´ð¿ôÅÀʸ»ú (radix character) ¤Ï°õ»ú¤µ¤ì¤Ê¤¤ +(¤³¤³¤Ç¤Î´ð¿ôÅÀʸ»ú¤Ï +.B LC_MONETARY +¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +.B LC_NUMERIC +¤Î»ØÄê¤È¤Ï°Û¤Ê¤Ã¤Æ¤¤¤Æ¤â¤è¤¤)¡£ +.LP +.\"O Finally, the conversion specification must be ended with a +.\"O conversion character. +.\"O The three conversion characters are +ºÇ¸å¤Ë¡¢ÊÑ´¹»ØÄê¤ÏÊÑ´¹Ê¸»ú (conversion character) +¤Ç½ªÎ»¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ÊÑ´¹Ê¸»ú¤Ë¤Ï°Ê²¼¤Î 3 ¤Ä¤¬¤¢¤ë¡£ +.TP +.B % +.\"O (In this case the entire specification must be exactly "%%".) +.\"O Put a \(aq%\(aq character in the result string. +(¤³¤Î¾ì¹ç¤Ï»ØÄêÁ´ÂΤ¬ "%%" ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£) +·ë²Ì¤Îʸ»úÎó¤Ë \(aq%\(aq ʸ»ú¤ò½ñ¤­¤³¤à¡£ +.TP +.B i +.\"O One argument of type +.\"O .I double +.\"O is converted using the locale's international currency format. +.I double +·¿¤Î°ú¤­¿ô¤Ò¤È¤Ä¤¬¡¢ +¥í¥±¡¼¥ë¤Î¹ñºÝÄ̲ߥե©¡¼¥Þ¥Ã¥È (international currency format) +¤òÍѤ¤¤ÆÊÑ´¹¤µ¤ì¤ë¡£ +.TP +.B n +.\"O One argument of type +.\"O .I double +.\"O is converted using the locale's national currency format. +.I double +·¿¤Î°ú¤­¿ô¤Ò¤È¤Ä¤¬¡¢ +¥í¥±¡¼¥ë¤Î¹ñÆâÄ̲ߥե©¡¼¥Þ¥Ã¥È (national currency format) +¤òÍѤ¤¤ÆÊÑ´¹¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR strfmon () +.\"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. +.\"O Otherwise, it sets +.\"O .I errno +.\"O to +.\"O .BR E2BIG , +.\"O returns \-1, and the contents of the array is undefined. +.BR strfmon () +´Ø¿ô¤Ï¡¢·ë²Ì¤Îʸ»úÎ󤬽ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ò´Þ¤á¤ÆÇÛÎó +.I s +¤Ë¼ý¤Þ¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +.I s +¤Ë½ñ¤­¤³¤Þ¤ì¤¿Ê¸»ú¿ô¤òÊÖ¤¹¡£NULL ¥Ð¥¤¥È¤Ïʸ»ú¿ô¤ËÆþ¤é¤Ê¤¤¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I errno +¤Ë +.B E2BIG +¤òÀßÄꤷ¤Æ \-1 ¤òÊÖ¤¹¡£ +¤³¤Î¾ì¹ç¤ÎÇÛÎó¤ÎÆâÍƤÏ̤ÄêµÁ¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Not in POSIX.1-2001. +.\"O Present on several other systems. +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +¾¤Î¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The call +.in +4n +.nf + +strfmon(buf, sizeof(buf), "[%^=*#6n] [%=*#6i]", + 1234.567, 1234.567); + +.fi +.in +¤Î¤è¤¦¤Ê´Ø¿ô¥³¡¼¥ë¤Î½ÐÎϤϡ¢¥ª¥é¥ó¥À¤Î¥í¥±¡¼¥ë¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ê½ÐÎϤˤʤ롣 +.\"O outputs +.in +4n + +[ fl **1234,57] [ NLG **1 234,57] + +.in +.\"O in the Dutch locale (with fl for "florijnen" and NLG for Netherlands Guilders). +(fl ¤Ï "florijnen" ¤Î°Õ¡£NLG ¤Ï Netherlands Guilder¡£) +.\"O The grouping character is very ugly because it takes as much space +.\"O as a digit, while it should not take more than half that, +.\"O and will no doubt cause confusion. +.\"O Surprisingly, the "fl" is preceded and followed by a space, +.\"O and "NLG" is preceded by one and followed by two spaces. +.\"O This may be a bug in the locale files. +.\"O The Italian, Australian, Swiss +.\"O and Portuguese locales yield +¥°¥ë¡¼¥×²½Ê¸»ú¤òÍѤ¤¤ë¤ÈÈó¾ï¤Ë½¹¤¯¤Ê¤ë¡£ +Ʊ»þ¤Ë´Ö°ã¤¤¤Ê¤¯º®Íð¤Î¸¶°ø¤Ë¤â¤Ê¤Ã¤Æ¤·¤Þ¤¦¤À¤í¤¦¡£ +¤³¤ì¤Ï¿ôÃͤÎȾʬ°Ê²¼¤ÎÉý¤Ç¤¢¤ë¤Ù¤­¤À¤¬¡¢ +¿ôÃͤÈƱ¤¸¤À¤±¤ÎÉý¤ò¼è¤Ã¤Æ¤·¤Þ¤¦¤«¤é¤Ç¤¢¤ë¡£ +¤Ò¤É¤¤¤³¤È¤Ë¡¢ "fl" ¤ÎÁ°¸å¤Ë¤Ï¥¹¥Ú¡¼¥¹¤¬Æþ¤Ã¤Æ¤·¤Þ¤¤¡¢ +¤Þ¤¿ "NLG" ¤ÎÁ°¤Ë¤Ï 1 ¤Ä¡¢¸å¤Ë¤Ï 2 ¤Ä¤Î¥¹¥Ú¡¼¥¹¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¥í¥±¡¼¥ë¥Õ¥¡¥¤¥ë¤Î¥Ð¥°¤Ç¤¢¤í¤¦¡£ +¥¤¥¿¥ê¥¢¡¦¥ª¡¼¥¹¥È¥é¥ê¥¢¡¦¥¹¥¤¥¹¡¦¥Ý¥ë¥È¥¬¥ë¤Î +³Æ¥í¥±¡¼¥ë¤Ç¤Î·ë²Ì¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£ +.in +4n + +[ L. **1235] [ ITL **1.235] +.br +[ $**1234.57] [ AUD **1,234.57] +.br +[Fr. **1234,57] [CHF **1.234,57] +.br +[ **1234$57Esc] [ **1.234$57PTE ] +.in +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR setlocale (3), +.BR sprintf (3), +.BR locale (7) diff --git a/draft/man3/strfry.3 b/draft/man3/strfry.3 new file mode 100644 index 00000000..840390d4 --- /dev/null +++ b/draft/man3/strfry.3 @@ -0,0 +1,80 @@ +.\" 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 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 +.\" +.TH STRFRY 3 1993-04-12 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O strfry \- randomize a string +strfry \- ʸ»úÎó¤ò¥é¥ó¥À¥à¤ËʤÙÊѤ¨¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *strfry(char *" string ); +.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" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR strfry () +.\"O functions returns a pointer to the randomized +.\"O string. +.BR strfry () +´Ø¿ô¤Ï¡¢¥é¥ó¥À¥à¤ËʤӴ¹¤¨¤é¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The +.\"O .BR strfry () +.\"O function is unique to the +.\"O GNU C Library. +.BR strfry () +´Ø¿ô¤Ï GNU C ¥é¥¤¥Ö¥é¥ê¤ËÆÃÍ­¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR memfrob (3), +.BR feature_test_macros (7) diff --git a/draft/man3/strftime.3 b/draft/man3/strftime.3 new file mode 100644 index 00000000..302c412b --- /dev/null +++ b/draft/man3/strftime.3 @@ -0,0 +1,834 @@ +.\" 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 +.\" GNU texinfo documentation on glibc date/time functions. +.\" Modified Sat Jul 24 18:03:44 1993 by Rik Faith (faith@cs.unc.edu) +.\" Applied fix by Wolfgang Franke, aeb, 961011 +.\" Corrected return value, aeb, 970307 +.\" Added Single Unix Spec conversions and %z, aeb/esr, 990329. +.\" 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 ¤Î½µÃ±°Ìɽµ­ +.\" +.TH STRFTIME 3 2010-01-17 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +.\"O strftime \- format date and time +strftime \- ÆüÉÕ¤ª¤è¤Ó»þ¹ï¤Îʸ»úÎó¤Ø¤ÎÊÑ´¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t strftime(char *" s ", size_t " max ", const char *" format , +.BI " const struct tm *" tm ); +.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 +.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)¡×¤È¤Ê¤ë¡£ +.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 ¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ +°ìÊý¡¢ÊÑ´¹»ØÄê¤Îʸ»ú¤Ï°Ê²¼¤Î¤è¤¦¤ËÃÖ´¹¤µ¤ì¤ë¡£ +.TP +.B %a +.\"O The abbreviated weekday name according to the current locale. +¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤±¤ëÍËÆü¤Î¾Êά̾¡£ +.TP +.B %A +.\"O The full weekday name according to the current locale. +¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤±¤ëÍËÆü¤Î´°Á´¤Ê̾Á°¡£ +.TP +.B %b +.\"O The abbreviated month name according to the current locale. +¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤±¤ë·î¤Î¾Êά̾¡£ +.TP +.B %B +.\"O The full month name according to the current locale. +¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤±¤ë·î¤Î´°Á´¤Ê̾Á°¡£ +.TP +.B %c +.\"O The preferred date and time representation for the current locale. +¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤¤¤Æ°ìÈÌŪ¤ÊÆüÉÕ¡¦»þ¹ï¤Îɽµ­¡£ +.TP +.B %C +.\"O The century number (year/100) as a 2-digit integer. (SU) +À¤µª (À¾Îñǯ¤Î¾å 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 \(em for 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 +¤ÎÊý¤¬°ìÈÌŪ¤À¡£Ê¶¤é¤ï¤·¤¤¤Î¤Ç¡¢»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£) (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) +ÊÌ·Á¼°¤ò»ÈÍѤ¹¤ëºÝ¤Î½¤¾þ»Ò¡£²¼µ­»²¾È¡£ (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 ½µ¿ô¤¬Á°Ç¯¤äÍâǯ¤Ë¤Ê¤ë +¾ì¹ç¤Ë¤Ï¤½¤Îǯ¤¬»ÈÍѤµ¤ì¤ëÅÀ¤¬°Û¤Ê¤ë¡£(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) +²þ¹Ô¡£ (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 +.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) +¥¿¥Öʸ»ú (SU) +.TP +.B %T +.\"O The time in 24-hour notation (\fB%H:%M:%S\fP). (SU) +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 +.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 +.B %X +.\"O The preferred time representation for the current locale without the date. +¸½ºß¤Î¥í¥±¡¼¥ë¤Ç°ìÈÌŪ¤Ê»þ¹ïɽµ­¡£ÆüÉդϴޤޤʤ¤¡£ +.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. +À¤µªÉôʬ¤ò´Þ¤á¤¿ ( 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 +.B %+ +.\" 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. +\(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 °Ê¹ß¤Ç¤Î¤ßÍ­¸ú) +.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" +.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 ¤¬ÊÖ¤µ¤ì¤ë¡£) +.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 +.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" +.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 ¤Ë¤¢¤ë¡£ + +.\"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 +.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 +½¤¾þ»Ò¤ÎÁ°¤ËÃÖ¤¯)¡£ + +.\"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 +.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 +¤Î¾ì¹ç¤À¤±¤Ç¤¢¤ë)¡£ +.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¿Ê¿ô¤ÎÉý»ØÄê»Ò¤Ï¥Õ¥é¥°¤Î¸å¤í¤ËÃÖ¤¯¤³¤È¤¬¤Ç¤­¤ë +(¥Õ¥é¥°¤Ï¤Ê¤¯¤Æ¤â¤è¤¤)¡£¥Õ¥£¡¼¥ë¥É¤ÎËÜÍè¤ÎÂ礭¤µ¤¬»ØÄꤵ¤ì¤¿Éý¤è¤ê¤â +¾®¤µ¤¤¾ì¹ç¡¢·ë²Ìʸ»úÎó¤Îº¸Â¦¤Ï»ØÄꤵ¤ì¤¿Éý¤Þ¤Ç¥Ñ¥Ç¥£¥ó¥°¤µ¤ì¤ë¡£ +.\"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) +¤Î¤³¤ÎÌäÂê¤ò²óÈò¤·¤è¤¦¤È¤¹¤ë¤È¡¢²¿¤«¤¹¤Ã¤­¤ê¤·¤Ê¤¤µ¤Ê¬¤Ë¤Ê¤ë¤À¤í¤¦¡£ +Èæ³ÓŪ¤­¤ì¤¤¤Ê²ò·èÊýË¡¤Ï°Ê²¼¤Î¤è¤¦¤ÊÃæ´Ö´Ø¿ô¤òÄɲ乤뤳¤È¤Ç¤¢¤ë¡£ +.in +4n +.nf + +size_t +my_strftime(char *s, size_t max, const char *fmt, + const struct tm *tm) +{ + return strftime(s, max, fmt, tm); +} +.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 ¥ª¥×¥·¥ç¥ó¤ò +Ä󶡤·¤Æ¤ª¤ê¡¢¾åµ­¤Î²óÈòºö¤Ï¤â¤Ï¤äɬÍפʤ¤¡£ +.\"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 ¤Ï±Ñ¸ì¥í¥±¡¼¥ë) +.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 ¤Ï±Ñ¸ì¥í¥±¡¼¥ë) +.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 () +¤Î¼Â¸³¤¬¤Ç¤­¤ë¡£ +.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 + +.RB "$" " ./a.out \(aq%m\(aq" +Result string is "11" +.RB "$" " ./a.out \(aq%5m\(aq" +Result string is "00011" +.RB "$" " ./a.out \(aq%_5m\(aq" +Result string is " 11" +.fi +.in +.PP +.\"O Here's the program source: +¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹¤Ï°Ê²¼¤ÎÄ̤ê: +.nf + +#include +#include +#include + +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; + + t = time(NULL); + tmp = localtime(&t); + if (tmp == NULL) { + perror("localtime"); + exit(EXIT_FAILURE); + } + + if (strftime(outstr, sizeof(outstr), argv[1], tmp) == 0) { + fprintf(stderr, "strftime returned 0"); + exit(EXIT_FAILURE); + } + + printf("Result string is \\"%s\\"\\n", 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) diff --git a/draft/man3/string.3 b/draft/man3/string.3 new file mode 100644 index 00000000..e94d160d --- /dev/null +++ b/draft/man3/string.3 @@ -0,0 +1,130 @@ +.\" 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 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 +.\" +.TH STRING 3 2010-02-25 "" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int strcasecmp(const char *" s1 ", const char *" s2 ); +.sp +.BI "int strncasecmp(const char *" s1 ", const char *" s2 ", size_t " n ); +.sp +.BI "char *index(const char *" s ", int " c ); +.sp +.BI "char *rindex(const char *" s ", int " c ); +.sp +.B #include +.sp +.BI "char *stpcpy(char *" dest ", const char *" src ); +.sp +.BI "char *strcat(char *" dest ", const char *" src ); +.sp +.BI "char *strchr(const char *" s ", int " c ); +.sp +.BI "int strcmp(const char *" s1 ", const char *" s2 ); +.sp +.BI "int strcoll(const char *" s1 ", const char *" s2 ); +.sp +.BI "char *strcpy(char *" dest ", const char *" src ); +.sp +.BI "size_t strcspn(const char *" s ", const char *" reject ); +.sp +.BI "char *strdup(const char *" s ); +.sp +.BI "char *strfry(char *" string ); +.sp +.BI "size_t strlen(const char *" s ); +.sp +.BI "char *strncat(char *" dest ", const char *" src ", size_t " n ); +.sp +.BI "int strncmp(const char *" s1 ", const char *" s2 ", size_t " n ); +.sp +.BI "char *strncpy(char *" dest ", const char *" src ", size_t " n ); +.sp +.BI "char *strpbrk(const char *" s ", const char *" accept ); +.sp +.BI "char *strrchr(const char *" s ", int " c ); +.sp +.BI "char *strsep(char **" stringp ", const char *" delim ); +.sp +.BI "size_t strspn(const char *" s ", const char *" accept ); +.sp +.BI "char *strstr(const char *" haystack ", const char *" needle ); +.sp +.BI "char *strtok(char *" s ", const char *" delim ); +.sp +.BI "size_t strxfrm(char *" dest ", const char *" src ", size_t " n ); +.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" +.SH ´ØÏ¢¹àÌÜ +.BR index (3), +.BR rindex (3), +.BR strcasecmp (3), +.BR stpcpy (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) diff --git a/draft/man3/strlen.3 b/draft/man3/strlen.3 new file mode 100644 index 00000000..bb8af3b1 --- /dev/null +++ b/draft/man3/strlen.3 @@ -0,0 +1,55 @@ +.\" 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 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 +.\" +.TH STRLEN 3 1993-04-12 "" "Linux Programmer's Manual" +.SH ̾Á° +strlen \- ʸ»úÎó¤ÎŤµ¤ò·×»»¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t strlen(const char *" s ); +.fi +.SH ÀâÌÀ +.BR strlen () +´Ø¿ô¤Ïʸ»úÎó \fIs\fP ¤ÎŤµ¤ò·×»»¤¹¤ë¡£ +¤³¤Î¤È¤­¡¢½ªÃ¼Ê¸»ú \(aq\\0\(aq ¤Ï·×»»¤Ë´Þ¤Þ¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR strlen () +´Ø¿ô¤Ï \fIs\fP ¤ÎÃæ¤Îʸ»ú¿ô¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.SH ´ØÏ¢¹àÌÜ +.BR string (3), +.BR wcslen (3), +.BR wcsnlen (3) diff --git a/draft/man3/strnlen.3 b/draft/man3/strnlen.3 new file mode 100644 index 00000000..591c244a --- /dev/null +++ b/draft/man3/strnlen.3 @@ -0,0 +1,67 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" 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 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O strnlen \- determine the length of a fixed-size string +strnlen \- ¸ÇÄêŤÎʸ»úÎó¤ÎŤµ¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.sp +.B #include +.sp +.BI "size_t strnlen(const char *" s ", size_t " maxlen ); +.fi +.\"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 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 ¤¬»Ø¤¹Ê¸»úÎó¤ÎŤµ¤ò¥Ð¥¤¥È¿ô¤ÇÊÖ¤¹¡£ +Ťµ¤Ë¤Ï½ªÃ¼¤Î \(aq\\0\(aq ʸ»ú¤ò´Þ¤Þ¤Ê¤¤¡£ +¤Þ¤¿Ä¹¤µ¤ÏºÇÂç¤Ç \fImaxlen\fP ¤Þ¤Ç¤Ç¤¢¤ê¡¢ +.BR strnlen () +¤Ï \fIs\fP ¤ÎºÇ½é¤Î \fImaxlen\fP ¥Ð¥¤¥È¤Î¤ß¤ò¸¡ºº¤· +\fIs+maxlen\fP ¤è¤êÀè¤ò¸¡ºº¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.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 \(aq\\0\(aq character among the first +.\"O \fImaxlen\fP characters pointed to by \fIs\fP. +.BR strnlen () +´Ø¿ô¤Ï \fImaxlen\fP °Ê²¼¤Ê¤é¤Ð \fIstrlen(s)\fP ¤ÈƱ¤¸ +ÃͤòÊÖ¤¹¡£\fIs\fP ¤Î»Ø¤¹Ê¸»úÎ󤬺ÇÂç \fImaxlen\fP ¥Ð¥¤¥È¤Þ¤Ç¤Ë +\(aq\\0\(aq ʸ»ú¤ò´Þ¤Þ¤Ê¤¤¾ì¹ç¤Ë¤Ï \fImaxlen\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is a GNU extension. +¤³¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strlen (3), +.BR feature_test_macros (7) diff --git a/draft/man3/strpbrk.3 b/draft/man3/strpbrk.3 new file mode 100644 index 00000000..7a3a9736 --- /dev/null +++ b/draft/man3/strpbrk.3 @@ -0,0 +1,82 @@ +.\" 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 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 1993-04-12 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O strpbrk \- search a string for any of a set of characters +strpbrk \- ʸ»ú¥»¥Ã¥ÈÃæ¤Îʸ»ú¤òʸ»úÎ󤫤鸡½Ð¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strpbrk(const char *" s ", const char *" accept ); +.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" +.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 ¤Ë´Þ¤Þ¤ì¤ëʸ»ú¤Î¤É¤ì¤«¤Ë°ìÃפ·¤¿¤â¤Î¤Ø¤Î +¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤½¤Î¤è¤¦¤Êʸ»ú¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï 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 strsep (3), +.BR strspn (3), +.BR strstr (3), +.BR strtok (3), +.BR wcspbrk (3) diff --git a/draft/man3/strptime.3 b/draft/man3/strptime.3 new file mode 100644 index 00000000..f233e317 --- /dev/null +++ b/draft/man3/strptime.3 @@ -0,0 +1,657 @@ +.\" Copyright 1993 Mitchum DSouza +.\" +.\" 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, jmv@lucifer.dorms.spbu.ru, 1999-11-08 +.\" Modified, aeb, 2000-04-07 +.\" Updated from glibc docs, C. Scott Ananian, 2001-08-25 +.\" 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 Í×ÁÇÊ̤λþ¹ï +.\" +.TH STRPTIME 3 2009-12-05 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.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" " /* glibc2 needs this */" +.BR "#define _XOPEN_SOURCE" " /* glibc2 ¤Ç¤Ï¡¢¤³¤ì¤¬É¬Íס£ */" +.br +.B #include +.sp +.BI "char *strptime(const char *" s ", const char *" format , +.BI "struct tm *" tm ); +.\"O .SH DESCRIPTION +.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 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Î´Ö¤Ë¤Ï¡¢ +¶õÇò¡¦±Ñ»ú¡¦¿ô»ú¤¬¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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 ¤Ä¤ÎÍ×ÁÇ (¶õÇò¡¦Ê¸»ú¡¦¥Õ¥©¡¼¥Þ¥Ã¥È) ¤Ï¡¢½ç¤Ë½èÍý¤µ¤ì¤ë¡£ +ÆþÎϤ¬¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤È¥Þ¥Ã¥Á¤Ç¤­¤Ê¤¤¾ì¹ç¡¢´Ø¿ô¤ÏÄä»ß¤¹¤ë¡£ +»Ä¤ê¤Î¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤ÈÆþÎÏʸ»úÎó¤Ï½èÍý¤µ¤ì¤Ê¤¤¡£ +.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 +.\"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 +.B %c +.\"O The date and time representation for the current locale. +¸½ºß¤Î¥í¥±¡¼¥ë¤Ç¤ÎÆüÉդȻþ¹ï¤Îɽ¸½¡£ +.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 +.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 +.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 +.B %X +.\"O The time, using the locale's time format. +»þ¹ï¡£¥í¥±¡¼¥ë¤Î»þ¹ï¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»È¤¦¡£ +.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). +ǯ¡£À¤µª¤ÎÉôʬ¤ò´Þ¤à (Îã: 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 ¤È¤¤¤¦½¤Àµ»Ò¤ò»È¤¦¤³¤È¤ÇÊѹ¹¤Ç¤­¤ë¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¤â¤¢¤ë¡£ +¤³¤ì¤é¤Î½¤Àµ»Ò¤Ï¡¢Ê̤Υե©¡¼¥Þ¥Ã¥È¤ä»ÅÍͤò»È¤¦¤³¤È¤ò»Ø¼¨¤¹¤ë¡£ +Ê̤Υե©¡¼¥Þ¥Ã¥È¤ä»ÅÍͤ¬¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¸ºß¤·¤Ê¤¤¤È¤­¤Ï¡¢ +Êѹ¹¤·¤Æ¤¤¤Ê¤¤¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬»È¤ï¤ì¤ë¡£ +.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. +ÆüÉդȻþ¹ï¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£ +.TP +.B %EC +.\"O The name of the base year (period) in the locale's alternative representation. +´ð½àǯ (´ü´Ö) ¤Î̾Á°¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£ +.TP +.B %Ex +.\"O The locale's alternative date representation. +ÆüÉÕ¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£ +.TP +.B %EX +.\"O The locale's alternative time representation. +»þ¹ï¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£ +.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. +´°Á´¤Ê·Á¼°¤Îǯ¡£Ê̤Îɽ¸½·¿¼°¤ò»È¤¦¡£ +.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. +»þ´Ö (24 »þ´ÖÀ©)¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.TP +.B %OI +.\"O The hour (12-hour clock) using the locale's alternative numeric symbols. +»þ´Ö (12 »þ´ÖÀ©)¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.TP +.B %Om +.\"O The month using the locale's alternative numeric symbols. +·î¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.TP +.B %OM +.\"O The minutes using the locale's alternative numeric symbols. +ʬ¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.TP +.B %OS +.\"O The seconds using the locale's alternative numeric symbols. +Éá£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.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 +¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È)¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.LP +.\"O The broken-down time structure \fItm\fP is defined in \fI\fP +.\"O as follows: +Í×ÁÇÊ̤λþ¹ï¹½Â¤ÂÎ \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; /* ʬ */ + int tm_hour; /* »þ´Ö */ + int tm_mday; /* Æü */ + int tm_mon; /* ·î */ + int tm_year; /* ǯ */ + int tm_wday; /* ÍËÆü */ + int tm_yday; /* ǯÆâÄÌ»»Æü */ + int tm_isdst; /* ²Æ»þ´Ö */ +}; +.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" +.SH ½àµò +SUSv2, POSIX.1-2001. +.\"O .SH NOTES +.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 +¤¬ºÆ·×»»¤µ¤ì¤ë¡£ +.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 +¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Î¤ß¡¢ +¤³¤Î´Ø¿ô¤Î¥×¥í¥È¥¿¥¤¥×¤òÄ󶡤¹¤ë¡£ +.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 ¤Î»ØÄê¤ÈƱ¤¸°ÕÌ£¤Ç°·¤ï¤ì¤¿¡£ +.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.) +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. +¥¿¥¤¥à¥¾¡¼¥ó̾¡£ +.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)) ¤«¤é¤ÎÄÌ»»¤ÎÉÿô¡£ +±¼É䬥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¸Â¤ê¡¢±¼Éäϥ«¥¦¥ó¥È¤·¤Ê¤¤¡£ +.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) +¤Î»ÈÍÑË¡¤ò¼¨¤·¤Æ¤¤¤ë¡£ +.sp +.nf +#define _XOPEN_SOURCE +#include +#include +#include +#include + +int +main(void) +{ + struct tm tm; + char buf[255]; + + memset(&tm, 0, sizeof(struct tm)); + strptime("2001\-11\-12 18:31:01", "%Y\-%m\-%d %H:%M:%S", &tm); + strftime(buf, sizeof(buf), "%d %b %Y %H:%M", &tm); + puts(buf); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR time (2), +.BR getdate (3), +.BR scanf (3), +.BR setlocale (3), +.BR strftime (3), +.BR feature_test_macros (7) diff --git a/draft/man3/strsep.3 b/draft/man3/strsep.3 new file mode 100644 index 00000000..59b567fc --- /dev/null +++ b/draft/man3/strsep.3 @@ -0,0 +1,141 @@ +.\" 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 Sat Jul 24 18:00:10 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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 ¶èÀÚ¤êʸ»ú +.\" +.TH STRSEP 3 2009-01-16 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O strsep \- extract token from string +strsep \- ʸ»úÎ󤫤é¥È¡¼¥¯¥ó¤ò¼è¤ê½Ð¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strsep(char **" stringp ", const char *" delim ); +.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 strsep (): +_BSD_SOURCE +.\"O .SH DESCRIPTION +.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 with a \(aq\\0\(aq character +.\"O (by overwriting the delimiter) +.\"O and \fI*stringp\fP is updated to point past the token. +¥È¡¼¥¯¥ó¤Ï (¶èÀÚ¤êʸ»ú¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ) \(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" +.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" +.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 +.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 strpbrk (3), +.BR strspn (3), +.BR strstr (3), +.BR strtok (3) diff --git a/draft/man3/strsignal.3 b/draft/man3/strsignal.3 new file mode 100644 index 00000000..17f97f17 --- /dev/null +++ b/draft/man3/strsignal.3 @@ -0,0 +1,89 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" 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 +.\" +.\" 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 17:59:03 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRSIGNAL 3 2008-08-21 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strsignal \- ¥·¥°¥Ê¥ë¤òÀâÌÀ¤¹¤ëʸ»úÎó¤òÊÖ¤¹ +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *strsignal(int " sig ); +.sp +.BI "extern const char * const " sys_siglist []; +.fi +.SH ÀâÌÀ +.BR strsignal () +´Ø¿ô¤Ï¡¢°ú¿ô \fIsig\fP ¤ÇÅϤµ¤ì¤¿¥·¥°¥Ê¥ëÈÖ¹æ¤ò +ÀâÌÀ¤¹¤ëʸ»úÎó¤òÊÖ¤¹¡£ +ʸ»úÎó¤Ï¡¢¼¡¤Î +.BR strsignal () +¤¬¸Æ¤Ð¤ì¤ë¤Þ¤Ç¤Î´Ö¤À¤±»ÈÍѤǤ­¤ë¡£ +.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 () +´Ø¿ô¤ò +»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.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" +.SH ½àµò +POSIX.1-2008. +.\"O Present on Solaris and the BSDs. +Solaris ¤È BSD ·Ï¤Ë¤â¸ºß¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR psignal (3), +.BR strerror (3), +.BR feature_test_macros (7) diff --git a/draft/man3/strspn.3 b/draft/man3/strspn.3 new file mode 100644 index 00000000..e013ce60 --- /dev/null +++ b/draft/man3/strspn.3 @@ -0,0 +1,72 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Tue Dec 16 10:04:31 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. +.\" +.\" 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 17:57:50 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRSPN 3 1993-04-12 "" "Linux Programmer's Manual" +.SH ̾Á° +strspn, strcspn \- ʸ»úÎ󤫤éʸ»ú¤Î¥»¥Ã¥È¤òõ¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t strspn(const char *" s ", const char *" accept ); +.sp +.BI "size_t strcspn(const char *" s ", const char *" reject ); +.fi +.SH ÀâÌÀ +.BR strspn () +´Ø¿ô¤Ï¡¢\fIaccept\fP ¤Ë´Þ¤Þ¤ì¤ëʸ»ú¤À¤±¤Ç¹½À®¤µ¤ì¤ëʸ»úÎó +¤ò \fIs\fP ¤«¤éõ¤·¡¢¤½¤ÎºÇ½é¤ÎÉôʬ¤ÎŤµ¤ò·×»»¤¹¤ë¡£ +.PP +.BR strcspn () +´Ø¿ô¤Ï¡¢\fIreject\fP ¤Ë´Þ¤Þ¤ì¤Ê¤¤Ê¸»ú¤À¤±¤Ç¹½À®¤µ¤ì¤ëʸ»úÎó +¤ò \fIs\fP ¤«¤éõ¤·¡¢¤½¤ÎºÇ½é¤ÎÉôʬ¤ÎŤµ¤ò·×»»¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR strspn () +´Ø¿ô¤Ï¡¢\fIaccept\fP ¤«¤é¤Îʸ»ú¤À¤±¤Ç¹½À®¤µ¤ì¤ë \fIs\fP ¤Î +ºÇ½é¤ÎÉôʬ¤Îʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +.PP +.BR strcspn () +´Ø¿ô¤Ï¡¢\fIs\fP ¤ÎºÇ½é¤ÎÉôʬ¤Ç¡¢Ê¸»úÎó \fIreject\fP ¤Ë +´Þ¤Þ¤ì¤Ê¤¤Ê¸»ú¤Î¿ô¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.SH ´ØÏ¢¹àÌÜ +.BR index (3), +.BR memchr (3), +.BR rindex (3), +.BR strchr (3), +.BR strpbrk (3), +.BR strsep (3), +.BR strstr (3), +.BR strtok (3), +.BR wcscspn (3), +.BR wcsspn (3) diff --git a/draft/man3/strstr.3 b/draft/man3/strstr.3 new file mode 100644 index 00000000..ce9d75c6 --- /dev/null +++ b/draft/man3/strstr.3 @@ -0,0 +1,119 @@ +.\" 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 Sat Jul 24 17:56:43 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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 2005-04-05 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O strstr, strcasestr \- locate a substring +strstr, strcasestr \- Éôʬʸ»úÎó¤Î°ÌÃÖ¤ò¼¨¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strstr(const char *" haystack ", const char *" needle ); +.sp +.B #define _GNU_SOURCE +.sp +.B #include +.sp +.BI "char *strcasestr(const char *" haystack ", const char *" needle ); +.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 \(aq\\0\(aq characters are not compared. +.BR strstr () +´Ø¿ô¤Ï¡¢Éôʬʸ»úÎó \fIneedle\fP ¤¬Ê¸»úÎó \fIhaystack\fP Ãæ +¤ÇºÇ½é¤Ë¸½¤ì¤ë°ÌÃÖ¤ò¸«¤Ä¤±¤ë¡£ +ʸ»úÎó¤ò½ªÃ¼¤¹¤ë \(aq\\0\(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" +.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" +.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 +.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 ¤òÊÖ¤¹¡£ +.SH ´ØÏ¢¹àÌÜ +.BR index (3), +.BR memchr (3), +.BR rindex (3), +.BR strcasecmp (3), +.BR strchr (3), +.BR strpbrk (3), +.BR strsep (3), +.BR strspn (3), +.BR strtok (3), +.BR wcsstr (3), +.BR feature_test_macros (7) diff --git a/draft/man3/strtod.3 b/draft/man3/strtod.3 new file mode 100644 index 00000000..5a6f3333 --- /dev/null +++ b/draft/man3/strtod.3 @@ -0,0 +1,276 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)strtod.3 5.3 (Berkeley) 6/29/91 +.\" +.\" Modified Sun Aug 21 17:16:22 1994 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sat May 04 19:34:31 MET DST 1996 by Michael Haardt +.\" (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 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O strtod, strtof, strtold \- convert ASCII string to floating-point number +.SH ̾Á° +strtod, strtof, strtold \- ASCII ʸ»úÎó¤òÉâÆ°¾®¿ôÅÀ¼Â¿ô¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double strtod(const char *" nptr ", char **" endptr ); +.br +.BI "float strtof(const char *" nptr ", char **" endptr ); +.br +.BI "long double strtold(const char *" nptr ", char **" endptr ); +.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 strtof (), +.BR strtold (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.\"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 +·¿¤ÎÃͤˤ½¤ì¤¾¤ìÊÑ´¹¤¹¤ë¡£ + +.\"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) +¤Ç¼±Ê̤µ¤ì¤ë)¡£ +.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 ¤Î²¿¾è¤Ç¤¢¤ë¤«¤òɽ¤¹¡£ +.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 ¿Ê¤Î»Ø¿ôÉô¤Ï¡¢¤É¤Á¤é¤«°ìÊý¤·¤«Â¸ºß¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.LP +.\"O An +.\"O .I infinity +.\"O is either "INF" or "INFINITY", disregarding case. +.I ̵¸Â +¤Ï "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" +.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 +¤Ç»²¾È¤µ¤ì¤ë¾ì½ê¤ØÊݸ¤µ¤ì¤ë¡£ + +.\"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 +¤ÎÃÍ (ÊÑ´¹ÂоݤǤ¢¤ëʸ»úÎó¤Î³«»Ï¥¢¥É¥ì¥¹) ¤¬Êݸ¤µ¤ì¤ë¡£ + +.\"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 +.SH ¥¨¥é¡¼ +.TP +.B ERANGE +.\"O Overflow or underflow occurred. +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Þ¤¿¤Ï¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.\"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 +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR atof (3), +.BR atoi (3), +.BR atol (3), +.BR strtol (3), +.BR strtoul (3) diff --git a/draft/man3/strtoimax.3 b/draft/man3/strtoimax.3 new file mode 100644 index 00000000..44b00200 --- /dev/null +++ b/draft/man3/strtoimax.3 @@ -0,0 +1,98 @@ +.\" 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 Sep 5 21:02:09 JST 2004 +.\" by Yuichi SATO +.\" +.TH STRTOIMAX 3 2003-11-28 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O strtoimax, strtoumax \- convert string to integer +strtoimax, strtoumax \- ʸ»úÎó¤òÀ°¿ô¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "intmax_t strtoimax(const char *" nptr ", char **" endptr ", int " base ); +.br +.BI "uintmax_t strtoumax(const char *" nptr ", char **" endptr ", int " base ); +.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" +.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" +.SH ½àµò +C99, POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR imaxabs (3), +.BR imaxdiv (3), +.BR strtol (3), +.BR strtoul (3), +.BR wcstoimax (3) diff --git a/draft/man3/strtok.3 b/draft/man3/strtok.3 new file mode 100644 index 00000000..891ce530 --- /dev/null +++ b/draft/man3/strtok.3 @@ -0,0 +1,293 @@ +.\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl) +.\" and Copyright (C) 2005 Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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. +.\" +.\" Rewritten old page, 960210, aeb@cwi.nl +.\" Updated, added strtok_r. 2000-02-13 Nicolas 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 2008-10-29 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O strtok, strtok_r \- extract tokens from strings +.SH ̾Á° +strtok, strtok_r \- ʸ»úÎ󤫤é¥È¡¼¥¯¥ó¤ò¼è¤ê½Ð¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strtok(char *" str ", const char *" delim ); +.sp +.BI "char *strtok_r(char *" str ", const char *" delim ", char **" saveptr ); +.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 strtok_r (): +_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 ¤ò»ØÄꤹ¤ë¡£ + +.\"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 ¤Ë°ã¤¦Ê¸»úÎó¤ò»ØÄꤷ¤Æ¤â¤è¤¤¡£ + +.\"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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 () +¤¬ÊÖ¤¹¥È¡¼¥¯¥ó¤Ï¾ï¤Ë¶õ¤Ç¤Ê¤¤Ê¸»úÎó¤È¤Ê¤ë¡£ + +.\"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 () +ÆâÉô¤Ç»ÈÍѤµ¤ì¤ë¡£ + +.\"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 +¤ÏÁ°²ó¤Î¸Æ¤Ó½Ð¤·°Ê¹ßÊѹ¹¤·¤Ê¤¤¤è¤¦¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"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" +.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" +.SH ½àµò +.TP +.BR strtok () +SVr4, POSIX.1-2001, 4.3BSD, C89, C99. +.TP +.BR strtok_r () +POSIX.1-2001. +.\"O .SH "BUGS" +.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 () +¤òÍѤ¤¤ë¤³¤È¡£ +.\"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 +.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" +1: a/bbb///cc + \-\-> a + \-\-> bbb + \-\-> cc +2: xxx + \-\-> xxx +3: yyy + \-\-> yyy +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + char *str1, *str2, *token, *subtoken; + char *saveptr1, *saveptr2; + int j; + + if (argc != 4) { + fprintf(stderr, "Usage: %s string delim subdelim\\n", + argv[0]); + exit(EXIT_FAILURE); + } + + for (j = 1, str1 = argv[1]; ; j++, str1 = NULL) { + token = strtok_r(str1, argv[2], &saveptr1); + if (token == NULL) + break; + printf("%d: %s\\n", j, token); + + for (str2 = token; ; str2 = NULL) { + subtoken = strtok_r(str2, argv[3], &saveptr2); + if (subtoken == NULL) + break; + printf("\t \-\-> %s\\n", subtoken); + } + } + + exit(EXIT_SUCCESS); +} /* main */ +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR index (3), +.BR memchr (3), +.BR rindex (3), +.BR strchr (3), +.BR strpbrk (3), +.BR strsep (3), +.BR strspn (3), +.BR strstr (3), +.BR wcstok (3) diff --git a/draft/man3/strtol.3 b/draft/man3/strtol.3 new file mode 100644 index 00000000..f6313a33 --- /dev/null +++ b/draft/man3/strtol.3 @@ -0,0 +1,389 @@ +.\" 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 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 +.\" +.\" WORD: base ´ð¿ô +.\" +.TH STRTOL 3 2007-07-26 "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 +.sp +.BI "long int strtol(const char *" nptr ", char **" endptr ", int " base ); +.sp +.BI "long long int strtoll(const char *" nptr ", char **" endptr \ +", int " base ); +.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 strtoll (): +XOPEN_SOURCE >= 600 || _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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¿Ê¿ô¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +.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 ¤òɽ¤¹¡£) +.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 ¤Ê¤é¤Ð¡¢Ê¸»úÎóÁ´ÂΤ¬Í­¸ú¤À¤Ã¤¿¤³¤È¤Ë¤Ê¤ë¡£ +.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 ·¿¤ÎÃͤòÊÖ¤¹¡£ +.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 +¤¬ÊÖ¤µ¤ì¤ë¡£ +.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. +·ë²Ì¤ÎÃͤ¬Èϰϳ°¤Ç¤¢¤ë¡£ +.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 ¤¬ÀßÄꤵ¤ì¤ë¾ì¹ç¤¬¤¢¤ë¡£ +.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 +.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 °Ê³°¤ÎÃͤ«¤É¤¦¤«¤ò³Îǧ¤·¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤É¤¦¤«¤òȽÃǤ¹¤ë +ɬÍפ¬¤¢¤ë¡£ + +.\"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 Ëè¤Î¶èÀÚ¤êʸ»ú¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£) +.LP +.\"O BSD also has +BSD ¤Ë¤Ï¡¢ +.sp +.in +4n +.nf +.BI "quad_t strtoq(const char *" nptr ", char **" endptr ", int " base ); +.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 +.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: +¤³¤Î¥×¥í¥°¥é¥à¤Î¼Â¹ÔÎã¤ò¤¤¤¯¤Ä¤«°Ê²¼¤Ë¼¨¤¹: +.in +4n +.nf + +.RB "$" " ./a.out 123" +strtol() returned 123 +.RB "$" " ./a.out \(aq 123\(aq" +strtol() returned 123 +.RB "$" " ./a.out 123abc" +strtol() returned 123 +Further characters after number: abc +.RB "$" " ./a.out 123abc 55" +strtol: Invalid argument +.RB "$" " ./a.out \(aq\(aq" +No digits were found +.RB "$" " ./a.out 4000000000" +strtol: Numerical result out of range +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int base; + char *endptr, *str; + long val; + + if (argc < 2) { + fprintf(stderr, "Usage: %s str [base]\\n", argv[0]); + exit(EXIT_FAILURE); + } + + str = argv[1]; + base = (argc > 2) ? atoi(argv[2]) : 10; + + errno = 0; /* To distinguish success/failure after call */ + val = strtol(str, &endptr, base); + + /* Check for various possible errors */ + + if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN)) + || (errno != 0 && val == 0)) { + perror("strtol"); + exit(EXIT_FAILURE); + } + + if (endptr == str) { + fprintf(stderr, "No digits were found\\n"); + exit(EXIT_FAILURE); + } + + /* If we got here, strtol() successfully parsed a number */ + + printf("strtol() returned %ld\\n", val); + + if (*endptr != \(aq\\0\(aq) /* Not necessarily an error... */ + printf("Further characters after number: %s\\n", 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) diff --git a/draft/man3/strtoul.3 b/draft/man3/strtoul.3 new file mode 100644 index 00000000..498f4e14 --- /dev/null +++ b/draft/man3/strtoul.3 @@ -0,0 +1,302 @@ +.\" 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 Sun Jul 25 10:54:03 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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 ´ð¿ô +.\" +.TH STRTOUL 3 2007-07-26 "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 +.sp +.BI "unsigned long int strtoul(const char *" nptr ", char **" endptr \ +", int " base ); +.sp +.BI "unsigned long long int strtoull(const char *" nptr ", char **" endptr , +.BI " int " base ); +.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 strtoull (): +XOPEN_SOURCE >= 600 || _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.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 ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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¿Ê¿ô¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +.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 ¤òɽ¤¹¡£) +.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 ¤Ê¤é¤Ð¡¢Ê¸»úÎóÁ´ÂΤ¬Í­¸ú¤À¤Ã¤¿¤³¤È¤Ë¤Ê¤ë¡£ +.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" +·¿¤ÎÃͤòÊÖ¤¹¡£ +.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 () +¤ÈÁ´¤¯Æ±¤¸¤Ç¤¢¤ë¡£ +.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. +ʸ»úÎ󤬿ôÃͤÎɽ¸½Èϰϳ°¤Ç¤¢¤ë¡£ +.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" +.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 +.SH Ãí°Õ +.\"O Since +.\"O .BR strtoul () +.\"O can legitimately return 0 or +.\"O .B LONG_MAX +.\"O .RB ( LLONG_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 LONG_MAX +.RB ( strtoull () +¤Ç¤Ï +.BR LLONG_MAX ) +¤¬ÊÖ¤ë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¡¢ +¥×¥í¥°¥é¥à¤Ï´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë +.I errno +¤ò 0 ¤ËÀßÄꤷ¡¢¸Æ¤Ó½Ð¤·¸å¤Ë +.I errno +¤¬ 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 Ëè¤Î¶èÀÚ¤êʸ»ú¤ËÂбþ¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£) +.LP +.\"O BSD also has +BSD ¤Ë¤Ï¡¢ +.sp +.in +4n +.nf +.BI "u_quad_t strtouq(const char *" nptr ", char **" endptr ", int " base ); +.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 () +¤ÈÅù²Á¤Ê¾ì¹ç¤â¤¢¤ê¤¨¤ë¡£ + +.\"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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR atof (3), +.BR atoi (3), +.BR atol (3), +.BR strtod (3), +.BR strtol (3) diff --git a/draft/man3/strverscmp.3 b/draft/man3/strverscmp.3 new file mode 100644 index 00000000..809c1852 --- /dev/null +++ b/draft/man3/strverscmp.3 @@ -0,0 +1,157 @@ +.\" 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) 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 +.SH ̾Á° +.\"O strverscmp \- compare two version strings +strverscmp \- 2¤Ä¤Î¥Ð¡¼¥¸¥ç¥óʸ»úÎó¤òÈæ³Ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int strverscmp(const char *" s1 ", const char *" s2 ); +.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 () +¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ + +.\"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 +¤ò»ÈÍѤ·¤Ê¤¤¡£ +¤³¤Î¤³¤È¤«¤é¡¢¤³¤Î´Ø¿ô¤¬¼ç¤Ë¥¢¥¹¥­¡¼Ê¸»ú¤«¤éÀ®¤ëʸ»úÎó¤ò +ÁÛÄꤷ¤Æ¤¤¤ë¤³¤È¤¬Ê¬¤«¤ë¡£ + +.\"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" +.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" +.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), +.BR feature_test_macros (7) diff --git a/draft/man3/strxfrm.3 b/draft/man3/strxfrm.3 new file mode 100644 index 00000000..251e15b1 --- /dev/null +++ b/draft/man3/strxfrm.3 @@ -0,0 +1,113 @@ +.\" 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 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 +.\" +.TH STRXFRM 3 1993-04-12 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O strxfrm \- string transformation +.SH ̾Á° +strxfrm \- ʸ»úÎó¤ÎÊÑ´¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t strxfrm(char *" dest ", const char *" src ", size_t " n ); +.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 \(aq\\0\(aq character. +.\"O If the value returned is \fIn\fP or more, the +.\"O contents of \fIdest\fP are indeterminate. +.SH ÊÖ¤êÃÍ +.BR strxfrm () +´Ø¿ô¤Ï¡¢ÊÑ´¹¤µ¤ì¤¿Ê¸»úÎó¤ò \fIdest\fP ¤ËÂåÆþ¤¹¤ë¤È¤­¤Ë +ɬÍפʥХ¤¥È¿ô¤«¤é¡¢½ªÃ¼¤Î \(aq\\0\(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) +¤ò»È¤Ã¤Æʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR bcmp (3), +.BR memcmp (3), +.BR setlocale (3), +.BR strcasecmp (3), +.BR strcmp (3), +.BR strcoll (3) diff --git a/draft/man3/swab.3 b/draft/man3/swab.3 new file mode 100644 index 00000000..7abd6e57 --- /dev/null +++ b/draft/man3/swab.3 @@ -0,0 +1,68 @@ +.\" 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 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 +.\" +.TH SWAB 3 2001-12-15 "" "Linux Programmer's Manual" +.SH ̾Á° +swab \- ÎÙÀܤ¹¤ë¥Ð¥¤¥È¤ò¸ò´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.B #include +.sp +.BI "void swab(const void *" from ", void *" to ", ssize_t " n ); +.fi +.SH ÀâÌÀ +.BR swab () +´Ø¿ô¤Ï¡¢\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 ¤Ï¶ö¿ô¤Ë¤¹¤ë¤Ù¤­¤Ç¤¢¤ë)¡£ +.SH ÊÖ¤êÃÍ +.BR swab () +´Ø¿ô¤Ï¡¢ÃͤòÊÖ¤µ¤Ê¤¤¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR bstring (3), +.BR feature_test_macros (7) diff --git a/draft/man3/sysconf.3 b/draft/man3/sysconf.3 new file mode 100644 index 00000000..bbfa1b73 --- /dev/null +++ b/draft/man3/sysconf.3 @@ -0,0 +1,542 @@ +.\" 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: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 +.\" +.TH SYSCONF 3 2007-12-12 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O sysconf \- Get configuration information at runtime +.SH ̾Á° +sysconf \- Æ°ºîÃæ¤ËÀßÄê¾ðÊó¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long sysconf(int " "name" ); +.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 ¤Ç¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¥³¥ó¥Ñ¥¤¥ë»þ¤ä¼Â¹Ô»þ¤Ë¡¢ +ÆÃÄê¤Î¥ª¥×¥·¥ç¥ó¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤ä¡¢ +ÀßÄê²Äǽ¤ÊÆÃÄê¤ÎÄê¿ô¤äÀ©¸Â¤¬¤É¤ó¤ÊÃͤ«¤ò¥Æ¥¹¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.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 +¤ÎξÊý¤â¤·¤¯¤Ï°ìÊý¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¡¢ +ÆÃÄê¤Î¥Þ¥¯¥í¤ÎÃͤò³Îǧ¤¹¤ë¡£ +.LP +.\"O At run time, one can ask for numerical values using the present function +.\"O .BR sysconf (). +.\"O On 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) +¤ò»È¤Ã¤Æ³Îǧ¤Ç¤­¤ë¡£ +.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) ¤¬ÊÖ¤¹ÃͤÏÊѲ½¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.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" +.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 () +¤Î¥Ñ¥é¥á¡¼¥¿Ì¾¡¢´Êñ¤ÊÀâÌÀ¤ò°Ê²¼¤Ë¼¨¤¹¡£ +.LP +.\"O First, the POSIX.1 compatible values. +¤Þ¤º 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" +.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 length, either from +.\"O standard input or from a file. +.\"O This includes length 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 ɸ½à¤Î¥Ð¡¼¥¸¥ç¥ó¡£YYYYMML ¤È¤¤¤¦½ñ¼°¤Çɽµ­¤µ¤ì¤ë¡£ +.TP +.BR POSIX2_C_DEV " - " _SC_2_C_DEV +.\"O indicates whether the POSIX.2 C language development facilities are +.\"O supported. +POSIX.2 ¤Î C ¸À¸ì³«È¯µ¡Ç½¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤ò¼¨¤¹¡£ +.TP +.BR POSIX2_FORT_DEV " - " _SC_2_FORT_DEV +.\"O indicates whether the POSIX.2 FORTRAN development utilities are +.\"O supported. +POSIX.2 ¤Î FORTRAN ³«È¯¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤ò¼¨¤¹¡£ +.TP +.BR POSIX2_FORT_RUN " - " _SC_2_FORT_RUN +.\"O indicates whether the POSIX.2 FORTRAN runtime utilities are supported. +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. +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 +.BR "" " - " _SC_NPROCESSORS_CONF +.\"O The number of processors configured. +ÀßÄꤵ¤ì¤¿¥×¥í¥»¥Ã¥µ¿ô¡£ +.TP +.BR "" " - " _SC_NPROCESSORS_ONLN +.\"O The number of processors currently online (available). +¸½ºß¥ª¥ó¥é¥¤¥ó¤Î (ÍøÍѲÄǽ¤Ê) ¥×¥í¥»¥Ã¥µ¿ô¡£ +.\"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" +.SH ½àµò +POSIX.1-2001. +.\"O .SH "BUGS" +.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) ¤Î¤¦¤Á¤É¤ì¤¯¤é¤¤¤¬ +¥æ¡¼¥¶¤Î´Ä¶­ÊÑ¿ô¤Ë¤è¤Ã¤Æ»È¤ï¤ì¤ë¤«¤Ïʬ¤«¤é¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.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) diff --git a/draft/man3/syslog.3 b/draft/man3/syslog.3 new file mode 100644 index 00000000..a7d94ab7 --- /dev/null +++ b/draft/man3/syslog.3 @@ -0,0 +1,531 @@ +.\" Written Feb 1994 by Steve Greenland (stevegr@neosoft.com) +.\" +.\" 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. +.\" +.\" Updated 1999.12.19 by Karl M. Hegbloom +.\" +.\" Updated 13 Oct 2001, Michael Kerrisk +.\" Added description of vsyslog +.\" Added descriptions of LOG_ODELAY and LOG_NOWAIT +.\" Added brief description of facility and option arguments +.\" Added CONFORMING TO section +.\" 2001-10-13, aeb, minor changes +.\" Modified 13 Dec 2001, Martin Schulze +.\" Modified 3 Jan 2002, Michael Kerrisk +.\" +.\" Japanese Verion Copyright (c) 1996 Shoichi OZAWA +.\" all right reserved. +.\" Translated Sep 1 20:14:01 JST 1996 +.\" by Shoichi OZAWA +.\" Updated Thu Oct 18 01:00:02 JST 2001 +.\" by Akihiro MOTOKI +.\" Updated Fri Jan 4 22:15:21 JST 2002 +.\" by Akihiro MOTOKI +.\" Updated 2002-04-14 by Kentaro Shirakata +.\" Updated 2007-01-01 by Kentaro Shirakata +.\" +.TH SYSLOG 3 2008-11-12 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O closelog, openlog, syslog, vsyslog \- send messages to the system logger +.SH ̾Á° +closelog, openlog, syslog, vsyslog \- ¥·¥¹¥Æ¥à¥í¥¬¡¼¤Ë¥á¥Ã¥»¡¼¥¸¤òÁ÷¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "void openlog(const char *" ident ", int " option ", int " facility ); +.br +.BI "void syslog(int " priority ", const char *" format ", ...);" +.br +.B "void closelog(void);" +.sp +.B #include +.sp +.BI "void vsyslog(int " priority ", const char *" format ", va_list " ap ); +.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 vsyslog (): +_BSD_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR closelog () +.\"O closes the descriptor being used to write to the system logger. +.\"O The use of +.\"O .BR closelog () +.\"O is optional. +.BR closelog () +¤Ï¥·¥¹¥Æ¥à¤Î¥í¥°µ­Ï¿ÍÑ¥×¥í¥°¥é¥à(¥·¥¹¥Æ¥à¥í¥¬¡¼ +.BR syslogd (8)) +¥Ø¤ÎÀܳ¤ò½ªÎ»¤¹¤ë¡£ +.BR closelog () +¤Ïɬ¿Ü¤Ç¤Ï¤Ê¤¤¡£ +.sp +.\"O .BR openlog () +.\"O opens a connection to the system logger for a program. +.BR openlog () +¤Ï¥í¥°¤ò½ÐÎϤ·¤è¤¦¤È¤·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤«¤é¥í¥°µ­Ï¿ÍÑ¥×¥í¥°¥é¥à¤Ø¤Î +Àܳ¤ò³«»Ï¤¹¤ë¡£ +.\"O The string pointed +.\"O to by +.\"O .I ident +.\"O is prepended to every message, and is typically set to the program name. +.I ident +¤Ç»ØÄꤷ¤¿Ê¸»úÎó(Ä̾ï¤Ï +.BR openlog () +¤·¤¿¥×¥í¥°¥é¥à¤Î̾Á°)¤Ï¥í¥°½ÐÎϤΰìʸ°ìʸ¤ËÄɲ䵤졢¤É¤Î¥×¥í¥°¥é¥à +¤¬½ÐÎϤ·¤¿¥í¥°¤«¤ò¼±Ê̤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.\"O The +.\"O .I option +.\"O argument specifies flags which control the operation of +.\"O .BR openlog () +.\"O and subsequent calls to +.\"O .BR syslog (). +.I option +°ú¤­¿ô¤Ï¡¢ +.BR openlog () +¤ÎÆ°ºî¤È¤½¤Î¸å¤Î +.BR syslog () +¤Î¸Æ¤Ó½Ð¤·¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°¤ò»ØÄꤹ¤ë¡£ +.\"O The +.\"O .I facility +.\"O argument establishes a default to be used if +.\"O none is specified in subsequent calls to +.\"O .BR syslog (). +.I facility +°ú¤­¿ô¤Ï¡¢¸å¤Ç +.BR syslog () +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë facility ¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë»ÈÍѤµ¤ì¤ë +¥Ç¥Õ¥©¥ë¥ÈÃͤò·èÄꤹ¤ë¡£ +.\"O Values for +.\"O .I option +.\"O and +.\"O .I facility +.\"O are given below. +.\"O The use of +.\"O .BR openlog () +.\"O is optional; it will automatically be called by +.\"O .BR syslog () +.\"O if necessary, in which case +.\"O .I ident +.\"O will default to NULL. +.I option +¤È +.I facility +¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò¤¹¤ë¡£ +.BR openlog () +¤Ïɬ¿Ü¤Ç¤Ï¤Ê¤¯¡¢É¬Íפ˱þ¤¸¤Æ +.BR syslog () +¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.BR syslog () +¤¬¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¡¢ +.I ident +¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï NULL ¤Ë¤Ê¤ë¡£ +.sp +.\"O .BR syslog () +.\"O generates a log message, which will be distributed by +.\"O .BR syslogd (8). +.BR syslog () +¤Ï¥í¥°¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¡¢ +.BR syslogd (8) +¤¬¤½¤Î¥á¥Ã¥»¡¼¥¸¤òµ­Ï¿¤¹¤ë¡£ +.\"O The +.\"O .I priority +.\"O argument is formed by ORing the +.\"O .I facility +.\"O and the +.\"O .I level +.\"O values (explained below). +.I priority +°ú¤­¿ô¤Ï +.I facility +¤È +.I level +¤È¤ÎÁȹ礻¤Ç»ØÄꤹ¤ë¡£ +.I facility +¤È +.I level +¤Î¼è¤ê¤¦¤ëÃͤϸå½Ò¤¹¤ë¡£ +.\"O The remaining arguments +.\"O are a +.\"O .IR format , +.\"O as in +.\"O .BR printf (3) +.\"O and any arguments required by the +.\"O .IR format , +.\"O except that the two character sequence +.\"O .B %m +.\"O will be replaced by +.\"O the error message string +.\"O .IR strerror ( errno ). +.\"O A trailing newline may be added if needed. +»Ä¤ê¤Î +.I format +°ú¤­¿ô¤Ï +.BR printf (3) +¤È»÷¤¿¥¹¥¿¥¤¥ë¤Î½ñ¼°¤È¤½¤Î½ñ¼°¤ËÍ¿¤¨¤ëÃͤǤ¢¤ë¡£ +.I format +Ãæ¤Î2ʸ»ú +.B %m +¤Ï¤½¤Î»þÅÀ¤Ç¤Î +.I errno +¤Ë´ØÏ¢¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸Ê¸»úÎó +.RI ( strerror ) +¤Ë¤è¤Ã¤ÆÃÖ¤­´¹¤¨¤é¤ì¤ë¡£ +ɬÍפʾì¹ç¤ÏËöÈø¤Ë²þ¹Ô¤¬²Ã¤¨¤é¤ì¤ë¡£ +.\"O The function +.\"O .BR vsyslog () +.\"O performs the same task as +.\"O .BR syslog () +.\"O with the difference that it takes a set of arguments which have +.\"O been obtained using the +.\"O .BR stdarg (3) +.\"O variable argument list macros. +.BR vsyslog () +´Ø¿ô¤Ï +.BR syslog () +¤ÈƱ¤¸µ¡Ç½¤ò»ý¤Ä¤¬¡¢²ÄÊÑ°ú¤­¿ô¥ê¥¹¥È¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +»ØÄꤵ¤ì¤¿°ú¤­¿ô¤Ï¡¢ +.BR stdarg (3) +²ÄÊÑ°ú¤­¿ô¥ê¥¹¥È¥Þ¥¯¥í¤òÍѤ¤¤Æ¼èÆÀ¤µ¤ì¤ë¡£ + +.\"O The subsections below list the parameters used to set the values of +.\"O .IR option , " facility" ", and " priority . +.\"O .SS option +.\"O The +.\"O .I option +.\"O argument to +.\"O .BR openlog () +.\"O is an OR of any of these: +°Ê²¼¤Î¥µ¥Ö¥»¥¯¥·¥ç¥ó¤Ç¤Ï¡¢ +.I option +¤È +.I facility +¤È +.I priority +¤ÎÃͤòÀßÄꤹ¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¥Ñ¥é¥á¡¼¥¿¤òÀâÌÀ¤¹¤ë¡£ +.SS option +²¼µ­¤ÎÃͤò OR ¤·¤¿¤â¤Î¤¬ +.BR openlog () +¤Î +.I option +°ú¤­¿ô¤Ë¤Ê¤ë: +.TP 15 +.B LOG_CONS +.\"O Write directly to system console if there is an error while sending to +.\"O system logger. +¥¨¥é¡¼¤¬¤¢¤ì¤Ð¡¢¥·¥¹¥Æ¥à¥í¥¬¡¼¤ËÁ÷¤ë°ìÊý¤Ç¥·¥¹¥Æ¥à¥³¥ó¥½¡¼¥ë¤Ë¤âľÀܽñ¤¯¡£ +.TP +.B LOG_NDELAY +.\"O Open the connection immediately (normally, the connection is opened when +.\"O the first message is logged). +¥í¥°µ­Ï¿ÍÑ¥×¥í¥°¥é¥à¤È¤ÎÀܳ¤ò¨ºÂ¤Ë³«»Ï¤¹¤ë +(Ä̾ï¤Ï¡¢ºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤¬µ­Ï¿¤µ¤ì¤ë»þ¤ËÀܳ¤ò³«¤¯)¡£ +.TP +.B LOG_NOWAIT +.\"O Don't wait for child processes that may have been created while logging +.\"O the message. +.\"O (The GNU C library does not create a child process, so this +.\"O option has no effect on Linux.) +¥á¥Ã¥»¡¼¥¸¤òµ­Ï¿¤¹¤ëºÝ¤ËÀ¸À®¤µ¤ì¤ë»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤òÂÔ¤¿¤Ê¤¤¡£ +(GNU C ¥é¥¤¥Ö¥é¥ê¤Ï»Ò¥×¥í¥»¥¹¤òÀ¸À®¤·¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï Linux ¤Ç¤Ï̵¸ú¤Ç¤¢¤ë¡£) +.TP +.B LOG_ODELAY +.\"O The converse of +.\"O .BR LOG_NDELAY ; +.\"O opening of the connection is delayed until +.\"O .BR syslog () +.\"O is called. +.\"O (This is the default, and need not be specified.) +.B LOG_NDELAY +¤ÎÈ¿ÂС£ +.BR syslog () +¤¬¸Æ¤Ð¤ì¤ë¤Þ¤Ç¡¢Àܳ¤Î³«»Ï¤ò¹Ô¤ï¤Ê¤¤¡£ +(¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤¢¤ê¡¢Æä˻ØÄꤹ¤ëɬÍפϤʤ¤¡£) +.TP +.B LOG_PERROR +.\"O (Not in POSIX.1-2001.) +.\"O Print to stderr as well. +stderr ¤Ë¤â½ÐÎϤ¹¤ë¡£(POSIX.1-2001 ¤Ç¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤) +.TP +.B LOG_PID +.\"O Include PID with each message. +¸Ä¡¹¤Î¥á¥Ã¥»¡¼¥¸¤Ë PID ¤ò´Þ¤á¤ë¡£ +.\"O .SS facility +.SS facility +.\"O The +.\"O .I facility +.\"O argument is used to specify what type of program is logging the message. +.\"O This lets the configuration file specify that messages from different +.\"O facilities will be handled differently. +.I facility +°ú¤­¿ô¤Ï¥á¥Ã¥»¡¼¥¸¤Ëµ­Ï¿¤µ¤ì¤ë¥×¥í¥°¥é¥à¤Î¥¿¥¤¥×¤ò»ØÄꤹ¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +¤³¤ì¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¥¿¥¤¥×¤Î¥×¥í¥°¥é¥à¤«¤é¤Î¥á¥Ã¥»¡¼¥¸¤Ï°Û¤Ê¤ë°·¤¤¤ò +¤¹¤ë¤è¤¦¤ËÀßÄê¥Õ¥¡¥¤¥ë( +.BR syslog.conf (5)) +¤ËÄêµÁ¤Ç¤­¤ë¡£ +.TP 15 +.B LOG_AUTH +.\"O security/authorization messages (DEPRECATED Use +.\"O .B LOG_AUTHPRIV +.\"O instead) +¥»¥­¥å¥ê¥Æ¥£/ǧ¾Ú ¥á¥Ã¥»¡¼¥¸ +(Èó¿ä¾©¡£Âå¤ï¤ê¤Ë +.B LOG_AUTHPRIV +¤ò»ÈÍѤ¹¤ë¤³¤È) +.TP +.B LOG_AUTHPRIV +.\"O security/authorization messages (private) +¥»¥­¥å¥ê¥Æ¥£/ǧ¾Ú ¥á¥Ã¥»¡¼¥¸ (¥×¥é¥¤¥Ù¡¼¥È) +.TP +.B LOG_CRON +.\"O clock daemon +.\"O .RB ( cron " and " at ) +¥¯¥í¥Ã¥¯¥Ç¡¼¥â¥ó +.RB ( cron +¤È +.RB at ) +.TP +.B LOG_DAEMON +.\"O system daemons without separate facility value +ÆÃÄê¤Î facility Ãͤò»ý¤¿¤Ê¤¤¥·¥¹¥Æ¥à¥Ç¡¼¥â¥ó +.TP +.B LOG_FTP +.\"O ftp daemon +ftp ¥Ç¡¼¥â¥ó +.TP +.B LOG_KERN +.\"O kernel messages (these can't be generated from user processes) +¥«¡¼¥Í¥ë¥á¥Ã¥»¡¼¥¸ (¥æ¡¼¥¶¥×¥í¥»¥¹¤«¤éÀ¸À®¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤) +.\" LOG_KERN has the value 0; if used as a facility, zero translates to: +.\" "use the default facility". +.TP +.\"O .BR LOG_LOCAL0 " through " LOG_LOCAL7 +.\"O reserved for local use +.BR LOG_LOCAL0 " ¤«¤é " LOG_LOCAL7 +¥í¡¼¥«¥ë¤Ê»ÈÍѤΤ¿¤á¤Ë¥ê¥¶¡¼¥Ö¤µ¤ì¤Æ¤¤¤ë +.TP +.B LOG_LPR +.\"O line printer subsystem +¥é¥¤¥ó¥×¥ê¥ó¥¿¡¦¥µ¥Ö¥·¥¹¥Æ¥à +.TP +.B LOG_MAIL +.\"O mail subsystem +¥á¡¼¥ë¡¦¥µ¥Ö¥·¥¹¥Æ¥à +.TP +.B LOG_NEWS +.\"O USENET news subsystem +USENET ¥Ë¥å¡¼¥¹¡¦¥µ¥Ö¥·¥¹¥Æ¥à +.TP +.B LOG_SYSLOG +.\"O messages generated internally by +.\"O .BR syslogd (8) +.BR syslogd (8) +¤Ë¤è¤Ã¤ÆÆâÉôŪ¤Ëȯ¹Ô¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸ +.TP +.\"O .BR LOG_USER " (default)" +.BR LOG_USER " (¥Ç¥Õ¥©¥ë¥È)" +.\"O generic user-level messages +°ìÈÌŪ¤Ê¥æ¡¼¥¶¥ì¥Ù¥ë¥á¥Ã¥»¡¼¥¸ +.TP +.B LOG_UUCP +.\"O UUCP subsystem +UUCP¥µ¥Ö¥·¥¹¥Æ¥à +.SS level +.\"O This determines the importance of the message. +.\"O The levels are, in order of decreasing importance: +¤³¤ì¤Ï¥á¥Ã¥»¡¼¥¸¤ÎÍ¥ÀèÅÙ¤ò»ØÄꤹ¤ë¡£ +Í¥ÀèÅ٤ι⤤¤â¤Î¤«¤éÄ㤤¤â¤Î¤Î½ç¤Ç²¼µ­¤¹¤ë¡£ +.TP 15 +.B LOG_EMERG +.\"O system is unusable +¥·¥¹¥Æ¥à¤¬»ÈÍÑÉÔ²Ä +.TP +.B LOG_ALERT +.\"O action must be taken immediately +ľ¤Á¤Ë¹ÔÆ°¤òµ¯¤³¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.TP +.B LOG_CRIT +.\"O critical conditions +´í¸±¤Ê¾õÂÖ +.TP +.B LOG_ERR +.\"O error conditions +¥¨¥é¡¼¤Î¾õÂÖ +.TP +.B LOG_WARNING +.\"O warning conditions +¥ï¡¼¥Ë¥ó¥°¤Î¾õÂÖ +.TP +.B LOG_NOTICE +.\"O normal, but significant, condition +Ä̾ï¤À¤¬½ÅÍפʾõÂÖ +.TP +.B LOG_INFO +.\"O informational message +¥¤¥ó¥Õ¥©¥á¡¼¥·¥ç¥ó¥á¥Ã¥»¡¼¥¸ +.TP +.B LOG_DEBUG +.\"O debug-level message +¥Ç¥Ð¥Ã¥°¥ì¥Ù¥ë¤Î¥á¥Ã¥»¡¼¥¸ +.LP +.\"O The function +.\"O .BR setlogmask (3) +.\"O can be used to restrict logging to specified levels only. +.BR setlogmask (3) +´Ø¿ô¤ò»ÈÍѤ·¤Æ¡¢ +»ØÄꤵ¤ì¤¿¥ì¥Ù¥ë¤Î¥á¥Ã¥»¡¼¥¸¤À¤±¤òµ­Ï¿¤¹¤ë¤è¤¦¤Ë +À©¸Â¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The functions +.\"O .BR openlog (), +.\"O .BR closelog (), +.\"O and +.\"O .BR syslog () +.\"O (but not +.\"O .BR vsyslog ()) +.\"O are specified in SUSv2 and POSIX.1-2001. +.BR openlog (), +.BR closelog (), +.BR syslog () +¤Ï SUSv2 ¤È POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë +(⤷ +.BR vsyslog () +¤Ï½ü¤¯)¡£ +.\"O POSIX.1-2001 specifies only the +.\"O .B LOG_USER +.\"O and +.\"O .B LOG_LOCAL* +.\"O values for +.\"O .IR facility . +POSIX.1-2001 ¤Ç¤Ï +.I facility +¤È¤·¤Æ +.B LOG_USER +¤È +.B LOG_LOCAL* +¤ÎÃͤ¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¤À¤±¤Ç¤¢¤ë¡£ +.\"O However, with the exception of +.\"O .B LOG_AUTHPRIV +.\"O and +.\"O .BR LOG_FTP , +.\"O the other +.\"O .I facility +.\"O values appear on most Unix systems. +¤·¤«¤·¤Ê¤¬¤é¡¢ +.B LOG_AUTHPRIV +¤È +.B LOG_FTP +¤È¤¤¤¦Îã³°¤Ï¤¢¤ë¤¬¡¢ +¤½¤ì°Ê³°¤Î +.I facility +¤ÎÃͤÏ¿¤¯¤Î Unix ¥·¥¹¥Æ¥à¤Ç»È¤ï¤ì¤Æ¤¤¤ë¡£ +.\"O The +.\"O .B LOG_PERROR +.\"O value for +.\"O .I option +.\"O is not specified by POSIX.1-2001, but is available +.\"O in most versions of Unix. +.I option +¤ÎÃͤΠ+.B LOG_PERROR +¤ÎÃͤϡ¢ POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +Unix ¤Î¿¤¯¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .\" .SH HISTORY +.\" .SH ÍúÎò +.\"O .\" A +.\"O .\" .BR syslog () +.\"O .\" function call appeared in 4.2BSD. +.\" .BR syslog () +.\" ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¡¦¥³¡¼¥ë¤Ï 4.2BSD ¤«¤é¼ÂÁõ¤µ¤ì¤¿¡£ +.\"O .\" 4.3BSD documents +.\"O .\" .BR openlog (), +.\"O .\" .BR syslog (), +.\"O .\" .BR closelog (), +.\"O .\" and +.\"O .\" .BR setlogmask (). +.\" 4.3BSD ¤Ë¤Ï +.\" .BR openlog (), +.\" .BR syslog (), +.\" .BR closelog (), +.\" .BR setlogmask () +.\" ¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .\" 4.3BSD-Reno also documents +.\"O .\" .BR vsyslog (). +.\" ¤Þ¤¿¡¢4.3BSD-Reno ¤Ë¤Ï +.\" .BR vsyslog () +.\" ¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .\" Of course early v* functions used the +.\"O .\" .I +.\"O .\" mechanism, which is not compatible with +.\"O .\" .IR . +.\" ÅöÁ³¤Ê¤¬¤é½é´ü¤Î v* ´Ø¿ô¤Ï +.\" .I +.\" ¤È¤Ï¸ß´¹À­¤Î¤Ê¤¤ +.\" .I +.\" ¤Î»ÅÁȤò»ÈÍѤ·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The argument +.\"O .I ident +.\"O in the call of +.\"O .BR openlog () +.\"O is probably stored as-is. +.BR openlog () +¸Æ¤Ó½Ð¤·¤Î +.I ident +°ú¤­¿ô¤Ï¡¢Ãͤ¬¤½¤Î¤Þ¤ÞÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¤³¤È¤òÁ°Äó¤Ë¤·¤Æ¤¤¤ë¡£ +.\"O Thus, if the string it points to +.\"O is changed, +.\"O .BR syslog () +.\"O may start prepending the changed string, and if the string +.\"O it points to ceases to exist, the results are undefined. +¤½¤ì¤æ¤¨¡¢ +.I ident +¤Ç»ØÄꤵ¤ì¤¿Ê¸»úÎó¤¬Êѹ¹¤µ¤ì¤ë¤È¡¢ +.BR syslog () +¤ÏÊѹ¹¤µ¤ì¤¿Ê¸»úÎó¤ÎÄɲ乤ë¤À¤í¤¦¤·¡¢ +»ØÄꤵ¤ì¤¿Ê¸»úÎó¤¬Â¸ºß¤·¤Ê¤¯¤Ê¤Ã¤¿¾ì¹ç¡¢·ë²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.\"O Most portable is to use a string constant. +ºÇ¤â°Ü¿¢À­¤¬¤¢¤ëÊýË¡¤Ï¡¢Ê¸»úÎóÄê¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +.LP +.\"O Never pass a string with user-supplied data as a format, +.\"O use the following instead: +¥æ¡¼¥¶¡¼¤«¤éÍ¿¤¨¤é¤ì¤¿¥Ç¡¼¥¿¤ò format ¤È¤·¤ÆÅϤ·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë°Ê²¼¤ò»È¤¦¤³¤È¡£ +.nf + + syslog(priority, "%s", string); +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR logger (1), +.BR setlogmask (3), +.BR syslog.conf (5), +.BR syslogd (8) diff --git a/draft/man3/system.3 b/draft/man3/system.3 new file mode 100644 index 00000000..2357a848 --- /dev/null +++ b/draft/man3/system.3 @@ -0,0 +1,265 @@ +.\" 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:51:15 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 11 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) +.\" 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 µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\" +.TH SYSTEM 3 2004-12-20 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O system \- execute a shell command +system \- ¥·¥§¥ë¥³¥Þ¥ó¥É¤Î¼Â¹Ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int system(const char *" "command" ); +.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" +.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) +¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ +.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 () +¤Ï¥·¥§¥ë¤¬ÍøÍѲÄǽ¤Ê¤é¥¼¥í°Ê³°¤ÎÃͤòÊÖ¤·¡¢ÍøÍÑÉԲĤʤ饼¥í¤òÊÖ¤¹¡£ +.PP +.\"O .BR system () +.\"O does not affect the wait status of any other children. +.BR system () +¤Ï¾¤Î»Ò¥×¥í¥»¥¹¤Î¥¦¥¨¥¤¥È¥¹¥Æ¡¼¥¿¥¹¤Ë¤Ï±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C89, C99, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.PP +.\"O If the +.\"O .B _XOPEN_SOURCE +.\"O feature test macro is defined, 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 +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤ÈÍøÍѲÄǽ¤Ë¤Ê¤ë¡£ +.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 () +¤ò¸Æ¤Ö¥×¥í¥°¥é¥à¤Ï¡¢ +°Ê²¼¤ÎÎã¤Î¤è¤¦¤Ë»Ò¥×¥í¥»¥¹¤Î½ªÎ»¾õÂÖ¤ò¼«Ê¬¤Ç¥Á¥§¥Ã¥¯¤·¤Æ¤ª¤«¤Ê¤¤¤È¡¢ +ÃæÃǤǤ­¤Ê¤¯¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.br +.nf + + while (something) { + int ret = system("foo"); + + if (WIFSIGNALED(ret) && + (WTERMSIG(ret) == SIGINT || WTERMSIG(ret) == SIGQUIT)) + break; + } +.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 ¤òÍѤ¤¤Æ¤¤¤ë) +.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) +¤ò¸Æ¤Ó½Ð¤·¤Æ¤¤¤¿»þ¤Ë¤Ï¡¢¥·¥§¥ë¤¬ÍøÍѲÄǽ¤Ç¤Ê¤¤¾ì¹ç¤ä¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë +¤Ç¤Ê¤¤¾ì¹ç¤¬¤¢¤ë¤«¤é¤Ç¤¢¤ë¡£ +.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" +.SH ´ØÏ¢¹àÌÜ +.BR sh (1), +.BR signal (2), +.BR wait (2), +.BR exec (3) diff --git a/draft/man3/sysv_signal.3 b/draft/man3/sysv_signal.3 new file mode 100644 index 00000000..632563cf --- /dev/null +++ b/draft/man3/sysv_signal.3 @@ -0,0 +1,149 @@ +.\" 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 +.\" +.\"WORD: reliable ¿®ÍêÀ­¤Î¤¢¤ë +.\"WORD: unreliable ¿®ÍêÀ­¤Ë·ç¤±¤ë +.\"WORD: signal semantics ¥·¥°¥Ê¥ë½èÍýÊý¼° +.\" +.TH SYSV_SIGNAL 3 2007-05-04 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sysv_signal \- signal handling with System V semantics +sysv_signal \- System V Êý¼°¤Î¥·¥°¥Ê¥ë½èÍý +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "sighandler_t sysv_signal(int " signum ", sighandler_t " handler ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR sysv_signal () +.\"O function takes the same arguments, and performs the same task, as +.\"O .BR signal (2). +.BR sysv_signal () +´Ø¿ô¤Ï +.BR signal (2) +¤ÈƱ¤¸°ú¤­¿ô¤ò¤È¤ê¡¢Æ±¤¸½èÍý¤ò¼Â¹Ô¤¹¤ë¡£ + +.\"O However +.\"O .BR sysv_signal () +.\"O provides the System V unreliable signal semantics, that is: +.\"O a) the disposition of the signal is reset to the default +.\"O when the handler is invoked; +.\"O b) delivery of further instances of the signal is not blocked while +.\"O the signal handler is executing; and +.\"O c) if the handler interrupts (certain) blocking system calls, +.\"O then the system call is not automatically restarted. +¤·¤«¤·¤Ê¤¬¤é¡¢ +.BR sysv_signal () +¤Ï System V ¤Î¿®ÍêÀ­¤Ë·ç¤±¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤òÄ󶡤·¤Æ¤¤¤ë¡£ +¿®ÍêÀ­¤Ë·ç¤±¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤Ï°Ê²¼¤ÎÆÃħ¤ò»ý¤Ä¡£ +a) ¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤ë¤È¡¢¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡ (disposition) ¤¬ +¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡¢ +b) ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¡¢¤½¤ì°Ê¹ß¤ËȯÀ¸¤·¤¿Æ±¤¸¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤¬ +¥Ö¥í¥Ã¥¯¤µ¤ì¤Ê¤¤¡¢ +c) ¥Ï¥ó¥É¥é¤¬Ää»ßÃæ¤Î (blocking ¤·¤Æ¤¤¤ë) ¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÃæÃǤ·¤¿¾ì¹ç¡¢ +¼«Æ°Åª¤ËºÆ³«¤µ¤ì¤Ê¤¤¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR sysv_signal () +.\"O function returns the previous value of the signal handler, or +.\"O .B SIG_ERR +.\"O on error. +.BR sysv_signal () +´Ø¿ô¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎľÁ°¤ÎÃͤòÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.B SIG_ERR +¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O As for +.\"O .BR signal (2). +.BR signal (2) +¤ÈƱ¤¸¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is nonstandard. +¤³¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Use of +.\"O .BR sysv_signal () +.\"O should be avoided; use +.\"O .BR sigaction (2) +.\"O instead. +.BR sysv_signal () +¤Î»ÈÍѤÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£Âå¤ï¤ê¤Ë +.BR sigaction (2) +¤ò»È¤¦¤³¤È¡£ + +.\"O On older Linux systems, +.\"O .BR sysv_signal () +.\"O and +.\"O .BR signal (2) +.\"O were equivalent. +.\"O But on newer systems, +.\"O .BR signal (2) +.\"O provides reliable signal semantics; see +.\"O .BR signal (2) +.\"O for details. +°ÊÁ°¤Î Linux ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR sysv_signal () +¤È +.BR signal (2) +¤ÏÅù²Á¤Ç¤¢¤Ã¤¿¡£¤·¤«¤·¡¢¿·¤·¤á¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR signal (2) +¤Ï¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤òÄ󶡤·¤Æ¤¤¤ë¡£ +¾ÜºÙ¤Ï +.BR signal (2) +¤ò»²¾È¡£ + +.\"O The use of +.\"O .I sighandler_t +.\"O is a GNU extension; +.\"O this type is only defined if +.\"O this type is only defined if +.\"O the +.\"O .B _GNU_SOURCE +.\"O feature test macro is defined. +.I sighandler_t +¤ò»È¤Ã¤Æ¤¤¤ë¤Î¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +¤³¤Î·¿¤Ïµ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _GNU_SOURCE +¤òÄêµÁ¤·¤¿¾ì¹ç¤Ë¤Î¤ßÄêµÁ¤µ¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sigaction (2), +.BR signal (2), +.BR bsd_signal (3), +.BR feature_test_macros (7), +.BR signal (7) diff --git a/draft/man3/tan.3 b/draft/man3/tan.3 new file mode 100644 index 00000000..40d9de31 --- /dev/null +++ b/draft/man3/tan.3 @@ -0,0 +1,182 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +tan, tanf, tanl \- ÀµÀÜ¡Ê¥¿¥ó¥¸¥§¥ó¥È¡Ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double tan(double " x ); +.br +.BI "float tanf(float " x ); +.br +.BI "long double tanl(long double " x ); +.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)): +.in +.sp +.ad l +.BR tanf (), +.BR tanl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.BR tan () +´Ø¿ô¤Ï \fIx\fP ¤ÎÀµÀÜ¡Ê¥¿¥ó¥¸¥§¥ó¥È¡Ë¤ÎÃͤòÊÖ¤¹¡£ +\fIx\fP ¤Ï¥é¥¸¥¢¥óñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.\"O .SH RETURN VALUE +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the tangent of +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÀµÀÜ (¥¿¥ó¥¸¥§¥ó¥È) ¤òÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ 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 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. +.\" Testing certainly seems to bear this out. -- mtk, Jul 08 +.\" +.\" POSIX.1 allows an optional underflow error; +.\" 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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is an infinity +Îΰ襨¥é¡¼ (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 ) +¤¬¾å¤¬¤ë¡£ +.TP +.\"O Range error: result overflow +ÈÏ°Ï¥¨¥é¡¼ (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 ) +¤¬¾å¤¬¤ë¡£ +.PP +.\"O These functions do not set +.\"O .IR errno . +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I errno +¤òÀßÄꤷ¤Ê¤¤¡£ +.\" FIXME . Is it intentional that these functions do not set +.\" errno (at least for domain error)? +.\" Bug raised: http://sourceware.org/bugzilla/show_bug.cgi?id=6782 +.\"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 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR acos (3), +.BR asin (3), +.BR atan (3), +.BR atan2 (3), +.BR cos (3), +.BR ctan (3), +.BR sin (3) diff --git a/draft/man3/tanh.3 b/draft/man3/tanh.3 new file mode 100644 index 00000000..0ae2a2c7 --- /dev/null +++ b/draft/man3/tanh.3 @@ -0,0 +1,136 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O tanh, tanhf, tanhl \- hyperbolic tangent function +tanh, tanhf, tanhl \- ÁжÊÀþÀµÀÜ (hyperbolic tangent) ´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double tanh(double " x ); +.br +.BI "float tanhf(float " x ); +.br +.BI "long double tanhl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR tanhf (), +.BR tanhl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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) ´Ø¿ô¤òÊÖ¤¹¡£ +¿ô³ØŪ¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡¥ +.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 +¤ÎÁжÊÀþÀµÀܤòÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ 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 (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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR acosh (3), +.BR asinh (3), +.BR atanh (3), +.BR cosh (3), +.BR ctanh (3), +.BR sinh (3) diff --git a/draft/man3/tcgetpgrp.3 b/draft/man3/tcgetpgrp.3 new file mode 100644 index 00000000..8bc69e40 --- /dev/null +++ b/draft/man3/tcgetpgrp.3 @@ -0,0 +1,204 @@ +.\" Copyright (C) 2002 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) 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 +.SH ̾Á° +tcgetpgrp, tcsetpgrp \- üËö¤Î¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Î +¼èÆÀ/ÀßÄê¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B "#include " +.sp +.BI "pid_t tcgetpgrp(int " fd ); +.sp +.BI "int tcsetpgrp(int " fd ", pid_t " pgrp ); +.\"O .SH DESCRIPTION +.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 +¤Ç»ØÄꤵ¤ì¤¿Ã¼Ëö¤Ï¡¢¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" ¥×¥í¥»¥¹¼«ÂΤϥХ寥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¡£ +.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 ¤Ï¡¢¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦¥×¥í¥»¥¹¤ÈƱ¤¸¥»¥Ã¥·¥ç¥ó¤Ë +°¤¹¤ë (¥á¥ó¥Ð¤¬¶õ¤Ç¤Ê¤¤) ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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 +¥·¥°¥Ê¥ë¤Ï +¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ÎÁ´¤Æ¤Î¥á¥ó¥Ð¤ËÁ÷¤é¤ì¤ë¡£ +.\"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 +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.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 +.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 +.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" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.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 +.SS Îò»Ë +.\"O The ioctls appeared in 4.2BSD. +.\"O The functions are POSIX inventions. +¤³¤ì¤é¤Î ioctl ¤Ï 4.2BSD ¤ÇÅо줷¤¿¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï POSIX ¤Ç¹Í°Æ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR setpgid (2), +.BR setsid (2), +.BR credentials (7) diff --git a/draft/man3/tcgetsid.3 b/draft/man3/tcgetsid.3 new file mode 100644 index 00000000..f5bcf2ac --- /dev/null +++ b/draft/man3/tcgetsid.3 @@ -0,0 +1,115 @@ +.\" Copyright (C) 2002 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) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Sat Jul 19 03:06:35 JST 2003 +.\" by Akihiro MOTOKI +.\" +.TH TCGETSID 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O tcgetsid \- get session ID +.SH ̾Á° +tcgetsid \- ¥»¥Ã¥·¥ç¥óID ¤ò¼èÆÀ¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _XOPEN_SOURCE 500 +.br +.B "#include " +.sp +.BI "pid_t tcgetsid(int " fd ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The function +.\"O .BR tcgetsid () +.\"O returns the session ID of the current session that has the +.\"O terminal associated to +.\"O .I fd +.\"O as controlling terminal. +.\"O This terminal must be the controlling terminal of the calling process. +´Ø¿ô +.BR tcgetsid () +¤Ï¡¢À©¸æüËö¤È¤·¤Æ +.I fd +¤ËÂбþ¤¹¤ëüËö¤ò»ý¤Ä¥«¥ì¥ó¥È¡¦¥»¥Ã¥·¥ç¥ó¤Î¥»¥Ã¥·¥ç¥óID ¤òÊÖ¤¹¡£ +¤³¤ÎüËö¤Ï \fBtcgetsid\fR() ¤Î¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤Ç +¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O When +.\"O .I fd +.\"O refers to the controlling terminal of our session, +.\"O the function +.\"O .BR tcgetsid () +.\"O will return the session ID of this session. +.I fd +¤¬¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ã¤¿¥»¥Ã¥·¥ç¥ó¤ÎÀ©¸æüËö¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +´Ø¿ô +.BR tcgetsid () +¤Ï¤³¤Î¥»¥Ã¥·¥ç¥ó¤Î¥»¥Ã¥·¥ç¥óID ¤òÊÖ¤¹¡£ +.\"O Otherwise, \-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 +¤ÏÍ­¸ú¤Ê¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Ç¤Ê¤¤¡£ +.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 . +¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ã¤¿¥×¥í¥»¥¹¤¬À©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡¢¤â¤·¤¯¤Ï +À©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤ë¤¬ +.I fd +¤Ç»²¾È¤µ¤ì¤ë¤â¤Î¤È¤Ï°Û¤Ê¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR tcgetsid () +.\"O is provided in glibc since version 2.1. +.BR tcgetsid () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O This function is implemented via the +.\"O .B TIOCGSID +.\"O .BR ioctl (2), +.\"O present +.\"O since Linux 2.1.71. +¤³¤Î´Ø¿ô¤Ï +.B TIOCGSID +.BR ioctl (2) +·Ðͳ¤Ç¼Â¸½¤µ¤ì¤Æ¤ª¤ê¡¢ +Linux 2.1.71 °Ê¹ß¤Ç¸ºß¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getsid (2) diff --git a/draft/man3/telldir.3 b/draft/man3/telldir.3 new file mode 100644 index 00000000..72ffcaac --- /dev/null +++ b/draft/man3/telldir.3 @@ -0,0 +1,118 @@ +.\" 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 +.\" 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 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 +.\" +.TH TELLDIR 3 2009-03-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O telldir \- return current location in directory stream +telldir \- ¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥àÃæ¤Î¸½ºß°ÌÃÖ¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long telldir(DIR *" dirp ); +.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 telldir (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.\"O .SH DESCRIPTION +.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" +.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 +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O Invalid directory stream descriptor \fIdirp\fP. +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¥Ç¥£¥¹¥¯¥ê¥×¥¿ \fIdirp\fP ¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +4.3BSD, POSIX.1-2001. +.\"O .SH NOTES +.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" +.SH ´ØÏ¢¹àÌÜ +.BR closedir (3), +.BR opendir (3), +.BR readdir (3), +.BR rewinddir (3), +.BR scandir (3), +.BR seekdir (3) diff --git a/draft/man3/tempnam.3 b/draft/man3/tempnam.3 new file mode 100644 index 00000000..b1423f56 --- /dev/null +++ b/draft/man3/tempnam.3 @@ -0,0 +1,296 @@ +.\" Copyright (c) 1999 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. +.\" +.\" Japanese Version Copyright (c) 1997-2000 Kazuyuki Tanisako and NAKANO Takeo +.\" all rights reserved. +.\" Translated 1997-05-17, Kazuyuki Tanisako +.\" Modified 1997-05-27, Kazuyuki Tanisako +.\" Modified 1998-02-04, Kazuyuki Tanisako +.\" Updated and Modified 2000-10-12, NAKANO Takeo +.\" Updated 2006-04-14, Akihiro MOTOKI , LDP v2.29 +.\" Updated 2006-07-26, Akihiro MOTOKI , LDP v2.36 +.\" +.\"WORD: temporary file ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë +.\"WORD: filename ¥Õ¥¡¥¤¥ë̾ +.\"WORD: function ´Ø¿ô +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: environment variable ´Ä¶­ÊÑ¿ô +.\"WORD: argument °ú¤­¿ô +.\"WORD: storage ÊݸÎΰè +.\"WORD: pointer ¥Ý¥¤¥ó¥¿¡¼ +.\" +.TH TEMPNAM 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O tempnam \- create a name for a temporary file +tempnam \- ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤Î̾Á°¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *tempnam(const char *" dir ", const char *" pfx ); +.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 tempnam (): +_BSD_SOURCE || _SVID_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR tempnam () +.\"O function returns a pointer to a string that is a valid filename, +.\"O and such that a file with this name did not exist when +.\"O .BR tempnam () +.\"O checked. +.\"O The filename suffix of the pathname generated will start with +.\"O .I pfx +.\"O in case +.\"O .I pfx +.\"O is a non-NULL string of at most five bytes. +.\"O The directory prefix part of the pathname generated is required to +.\"O be "appropriate" (often that at least implies writable). +.BR tempnam () +´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë̾¤È¤·¤ÆÀµ¤·¤¤Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +¤³¤Î¥Õ¥¡¥¤¥ë̾¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤Ï¡¢ +.BR tempnam () +¤¬¥Á¥§¥Ã¥¯¤·¤¿»þÅÀ¤Ë¤ª¤¤¤Æ¤Ï¸ºß¤·¤Ê¤¤ (¤·¤Ê¤«¤Ã¤¿)¡£ +.I pfx +¤¬ NULL ¤Ç¤Ê¤¤ 5 ¥Ð¥¤¥È°ÊÆâ¤Îʸ»úÎó¤Ç¤¢¤ì¤Ð¡¢ +À¸À®¤µ¤ì¤ë¥Ñ¥¹Ì¾¤Î¤¦¤Á¤Î¥Õ¥¡¥¤¥ë̾¤ÎÉôʬ¤Ï +.I pfx +¤«¤é»Ï¤Þ¤ë¤â¤Î¤Ë¤Ê¤ë¡£ +À¸À®¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÎÉôʬ¤Ï¡¢¡ÖŬÀڡפǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(ÂçÄñ¤Î¾ì¹ç¡¢¡ÖŬÀڡפǤ¢¤ë¤¿¤á¤Ë¤Ï¤Þ¤º¾¯¤Ê¤¯¤È¤â +½ñ¤­¹þ¤ß²Äǽ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ + +.\"O Attempts to find an appropriate directory go through the following +.\"O steps: +ŬÀڤʥǥ£¥ì¥¯¥È¥ê¤Îõº÷¤Ï¡¢°Ê²¼¤Î¼ê½ç¤Ë¤·¤¿¤¬¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +.TP 3 +a) +.\"O In case the environment variable +.\"O .B TMPDIR +.\"O exists and +.\"O contains the name of an appropriate directory, that is used. +´Ä¶­ÊÑ¿ô +.B TMPDIR +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +¤½¤ÎÆâÍƤ¬Å¬Àڤʥǥ£¥ì¥¯¥È¥ê¤Î̾Á°¤Ê¤é¡¢¤½¤ì¤òÍѤ¤¤ë¡£ +.TP +b) +.\"O Otherwise, if the +.\"O .I dir +.\"O argument is non-NULL and appropriate, it is used. +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.I dir +°ú¤­¿ô¤¬ NULL ¤Ç¤Ê¤¤Ê¸»úÎó¤Ç¤«¤ÄŬÀڤʤ顢¤½¤ì¤òÍѤ¤¤ë¡£ +.TP +c) +.\"O Otherwise, +.\"O .I P_tmpdir +.\"O (as defined in +.\"O .IR ) +.\"O is used when appropriate. +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.RI ( +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë) +.I P_tmpdir +¤¬Å¬Àڤʤ顢¤½¤ì¤òÍѤ¤¤ë¡£ +.TP +d) +.\"O Finally an implementation-defined directory may be used. +ºÇ¸å¤Ë¼ÂÁõ¤ÇÄêµÁ¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬ÍѤ¤¤é¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.PP +.\"O The string returned by +.\"O .BR tempnam () +.\"O is allocated using +.\"O .BR malloc (3) +.\"O and hence should be freed by +.\"O .BR free (3). +.BR tempnam () +¤¬ÊÖ¤¹Ê¸»úÎó¤Ï +.BR malloc (3) +¤ò»È¤Ã¤Æ³ÎÊݤµ¤ì¤ë¡£¤½¤Î¤¿¤á¡¢ +.BR free (3) +¤Ç²òÊü¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR tempnam () +.\"O function returns a pointer to a unique temporary +.\"O filename, or NULL if a unique name cannot be generated. +.BR tempnam () +´Ø¿ô¤Ï¾¤È½Å¤Ê¤é¤Ê¤¤¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë̾¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¾¤È½Å¤Ê¤é¤Ê¤¤Ì¾Á°¤¬À¸À®¤Ç¤­¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +.\"O Allocation of storage failed. +ÊݸÎΰè¤Î³ä¤êÅö¤Æ¤Ë¼ºÇÔ¤·¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\"O POSIX.1-2008 marks +.\"O .BR tempnam () +.\"O as obsolete. +POSIX.1-2008 ¤Ï +.BR tempnam () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Although +.\"O .BR tempnam () +.\"O generates names that are difficult to guess, +.\"O it is nevertheless possible that between the time that +.\"O .BR tempnam () +.\"O returns a pathname, and the time that the program opens it, +.\"O another program might create that pathname using +.\"O .BR open (2), +.\"O or create it as a symbolic link. +.\"O This can lead to security holes. +.\"O To avoid such possibilities, use the +.\"O .BR open (2) +.\"O .B O_EXCL +.\"O flag to open the pathname. +.\"O Or better yet, use +.\"O .BR mkstemp (3) +.\"O or +.\"O .BR tmpfile (3). +.BR tempnam () +¤Ï¿ä¬¤¬Æñ¤·¤¤Ì¾Á°¤òÀ¸À®¤¹¤ë¤¬¡¢¤½¤ì¤Ë¤â¤«¤«¤ï¤é¤º¡¢ +.BR tempnam () +¤¬¥Ñ¥¹Ì¾¤òÊÖ¤·¤Æ¤«¤é¡¢¥×¥í¥°¥é¥à¤¬¤½¤Î¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë +¤Þ¤Ç¤Î´Ö¤Ë¡¢ÊÌ¤Î¥×¥í¥°¥é¥à¤¬Æ±¤¸¥Ñ¥¹Ì¾¤Ç¡¢¥Õ¥¡¥¤¥ë¤ò +.BR open (2) +¤ÇºîÀ®¤·¤¿¤ê¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤·¤¿¤ê¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤³¤ì¤Ï¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤Ë¤Ä¤Ê¤¬¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤½¤Î¤è¤¦¤Ê²ÄǽÀ­¤ò²óÈò¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.BR open (2) +¤Î +.B O_EXCL +¥Õ¥é¥°¤ò»È¤Ã¤Æ¥Ñ¥¹Ì¾¤ò¥ª¡¼¥×¥ó¤¹¤ì¤Ð¤è¤¤¡£ +¤â¤Ã¤È¤¤¤¤¤Î¤Ï¡¢ +.BR mkstemp (3) +¤ä +.BR tmpfile (3) +¤ò»È¤¦¤³¤È¤Ç¤¢¤ë¡£ + +.\"O SUSv2 does not mention the use of +.\"O .BR TMPDIR ; +.\"O glibc will use it only +.\"O when the program is not set-user-ID. +.\"O On SVr4, the directory used under \fBd)\fP is +.\"O .I /tmp +.\"O (and this is what glibc does). +SUSv2 ¤Ç¤Ï +.B TMPDIR +¤ËÉÕ¤¤¤Æ¸ÀµÚ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +glibc ¤Ï¡¢¥×¥í¥°¥é¥à¤¬ set-user-ID ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¸Â¤Ã¤Æ¤³¤ì¤òÍѤ¤¤ë¡£ +SVr4 ¤Ç¤Ï \fBd)\fP ¤Ç»ÈÍѤµ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò +.I /tmp +¤ÈÄê¤á¤Æ¤¤¤ë (glibc ¤â¤³¤ÎÄ̤ê¤Ç¤¢¤ë)¡£ +.LP +.\"O Because it dynamically allocates memory used to return the pathname, +.\"O .BR tempnam () +.\"O is reentrant, and thus thread safe, unlike +.\"O .BR tmpnam (3). +¥Ñ¥¹Ì¾¤òÊÖ¤¹¤Î¤Ë»ÈÍѤ¹¤ë¥á¥â¥ê¤òưŪ¤Ë³ÎÊݤ¹¤ë¤Î¤Ç¡¢ +.BR tmpnam (3) +¤È°ã¤¤¡¢ +.BR tempnam () +¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤¢¤ê¡¢¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤¢¤ë¡£ +.LP +.\"O The +.\"O .BR tempnam () +.\"O function generates a different string each time it is called, +.\"O up to +.\"O .B TMP_MAX +.\"O (defined in +.\"O .IR ) +.\"O times. +.\"O If it is called more than +.\"O .B TMP_MAX +.\"O times, +.\"O the behavior is implementation defined. +.BR tempnam () +´Ø¿ô¤ÏºÇÂç +.B TMP_MAX +²ó¤Þ¤Ç¡¢¸Æ¤Ó½Ð¤µ¤ì¤ëÅ٤˰ۤʤëʸ»úÎó¤òºîÀ®¤¹¤ë +.RB ( TMP_MAX +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +¤â¤· +.B TMP_MAX +²ó°Ê¾å¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢Æ°ºî¤Ï¼ÂÁõ°Í¸¤Ç¤¢¤ë¡£ +.LP +.\"O .BR tempnam () +.\"O uses at most the first five bytes from +.\"O .IR pfx . +.BR tempnam () +¤ÏºÇÂç¤Ç +.I pfx +¤ÎÀèƬ 5 ¥Ð¥¤¥È¤ò»ÈÍѤ¹¤ë¡£ + +.\"O The glibc implementation of +.\"O .BR tempnam () +.\"O will fail with the error +.\"O .B EEXIST +.\"O upon failure to find a unique name. +¾¤È½Å¤Ê¤é¤Ê¤¤Ì¾Á°¤¬¸«¤Ä¤±¤é¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢glibc ¤Î +.BR tempnam () +¤Î¼ÂÁõ¤Ï¥¨¥é¡¼ +.B EEXIST +¤Ç¼ºÇÔ¤¹¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The precise meaning of "appropriate" is undefined; +.\"O it is unspecified how accessibility of a directory is determined. +¡ÖŬÀڡפȤ¤¤¦¸ÀÍÕ¤ÎÀµ³Î¤Ê°ÕÌ£¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ¤É¤ÎÄøÅ٤Υ¢¥¯¥»¥¹¸¢¸Â¤¬É¬ÍפʤΤ«¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"O Never use this function. +.\"O Use +.\"O .BR mkstemp (3) +.\"O or +.\"O .BR tmpfile (3) +.\"O instead. +·è¤·¤Æ¤³¤Î´Ø¿ô¤ò»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£Âå¤ï¤ê¤Ë +.BR mkstemp (3) +¤« +.BR tmpfile (3) +¤ò»È¤¦¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mkstemp (3), +.BR mktemp (3), +.BR tmpfile (3), +.BR tmpnam (3) diff --git a/draft/man3/termios.3 b/draft/man3/termios.3 new file mode 100644 index 00000000..4d1d75ee --- /dev/null +++ b/draft/man3/termios.3 @@ -0,0 +1,1570 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de) +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 1993-07-24 by Rik Faith +.\" Modified 1995-02-25 by Jim Van Zandt +.\" Modified 1995-09-02 by Jim Van Zandt +.\" moved to man3, aeb, 950919 +.\" Modified 2001-09-22 by Michael Kerrisk +.\" Modified 2001-12-17, aeb +.\" Modified 2004-10-31, aeb +.\" 2006-12-28, mtk: +.\" Added .SS headers to give some structure to this page; and a +.\" small amount of reordering. +.\" Added a section on canonical and noncanonical mode. +.\" Enhanced the discussion of "raw" mode for cfmakeraw(). +.\" Document CMSPAR. +.\" +.\" Japanese Version Copyright (c) 1998-1999 +.\" Michihide Hotta and NAKANO Takeo all rights reserved. +.\" Translated 1998-02-02, Michihide Hotta +.\" Updated 1999-03-14, NAKANO Takeo +.\" Updated 2001-02-17, Kentaro Shirakata +.\" Updated 2001-10-16, Kentaro Shirakata +.\" Updated 2002-01-04, Kentaro Shirakata +.\" Updated 2003-09-01, Kentaro Shirakata +.\" Updated 2006-07-26, Akihiro MOTOKI , LDP v2.36 +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" Updated 2007-09-06, Akihiro MOTOKI, LDP v2.64 +.\" +.\"WORD: carriage return Éüµ¢(ʸ»ú) +.\"WORD: new line ²þ¹Ô(ʸ»ú) +.\"WORD: fill character ÊäŶʸ»ú +.\"WORD: horizontal tab ¿åÊ¿¥¿¥Ö +.\"WORD: backspace ¸åÂà(ʸ»ú) +.\"WORD: vertical tab ¿âľ¥¿¥Ö +.\"WORD: feature test macro µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\" +.TH TERMIOS 3 2007-11-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O termios, tcgetattr, tcsetattr, tcsendbreak, tcdrain, tcflush, tcflow, +.\"O cfmakeraw, cfgetospeed, cfgetispeed, cfsetispeed, cfsetospeed, cfsetspeed \- +.\"O get and set terminal attributes, line control, get and set baud rate +.SH ̾Á° +termios, tcgetattr, tcsetattr, tcsendbreak, tcdrain, tcflush, tcflow, +cfmakeraw, cfgetospeed, cfgetispeed, cfsetispeed, cfsetospeed, cfsetspeed \- +¥¿¡¼¥ß¥Ê¥ë°À­¤Î¼èÆÀ¡¦ÀßÄê¡¢¥é¥¤¥óÀ©¸æ¡¢¥Ü¡¼¥ì¡¼¥È¤Î¼èÆÀ¡¦ÀßÄê +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "int tcgetattr(int " fd ", struct termios *" termios_p ); +.sp +.BI "int tcsetattr(int " fd ", int " optional_actions , +.BI " const struct termios *" termios_p ); +.sp +.BI "int tcsendbreak(int " fd ", int " duration ); +.sp +.BI "int tcdrain(int " fd ); +.sp +.BI "int tcflush(int " fd ", int " queue_selector ); +.sp +.BI "int tcflow(int " fd ", int " action ); +.sp +.BI "void cfmakeraw(struct termios *" termios_p ); +.sp +.BI "speed_t cfgetispeed(const struct termios *" termios_p ); +.sp +.BI "speed_t cfgetospeed(const struct termios *" termios_p ); +.sp +.BI "int cfsetispeed(struct termios *" termios_p ", speed_t " speed ); +.sp +.BI "int cfsetospeed(struct termios *" termios_p ", speed_t " speed ); +.sp +.BI "int cfsetspeed(struct termios *" termios_p ", speed_t " speed ); +.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 cfsetspeed (), +.BR cfmakeraw (): +_BSD_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The termios functions describe a general terminal interface that is +.\"O provided to control asynchronous communications ports. +termios ´Ø¿ô·²¤Ï¡¢ÈóƱ´üÄÌ¿®¥Ý¡¼¥È¤òÀ©¸æ¤¹¤ë¤¿¤á¤ÎÈÆÍÑ +¥¿¡¼¥ß¥Ê¥ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +.\"O .SS "The termios structure" +.SS "termios ¹½Â¤ÂÎ" +.LP +.\"O Many of the functions described here have a \fItermios_p\fP argument +.\"O that is a pointer to a \fItermios\fP structure. +.\"O This structure contains at least the following members: +¤³¤³¤Ë¼¨¤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤Î¿¤¯¤Ï¡¢°ú¤­¿ô¤Ë \fItermios_p\fP ¤òÍѤ¤¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ï \fItermios\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤³¤Î¹½Â¤ÂΤˤϾ¯¤Ê¤¯¤È¤â°Ê²¼¤Ë¼¨¤¹¥á¥ó¥Ð¤¬´Þ¤Þ¤ì¤ë: +.sp +.in +4n +.nf +tcflag_t c_iflag; /* input modes */ +tcflag_t c_oflag; /* output modes */ +tcflag_t c_cflag; /* control modes */ +tcflag_t c_lflag; /* local modes */ +cc_t c_cc[NCCS]; /* control chars */ +.fi +.in +.PP +.\"O The values that may be assigned to these fields are described below. +.\"O In the case of the first four bit-mask fields, +.\"O the definitions of some of the associated flags that may be set are +.\"O only exposed if a specific feature test macro (see +.\"O .BR feature_test_macros (7)) +.\"O is defined, as noted in brackets ("[]"). +°Ê²¼¤Ë¡¢¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ë³ä¤êÅö¤Æ²Äǽ¤ÊÃͤˤĤ¤¤ÆÀâÌÀ¤¹¤ë¡£ +ºÇ½é¤Î 4 ¤Ä¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¥Õ¥£¡¼¥ë¥É¤Ç¤Ï¡¢ +´Ø·¸¤¹¤ë¥Õ¥é¥°¤ÎÄêµÁ¤Î¤¤¤¯¤Ä¤«¤Ï¡¢ÆÃÄê¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í +.RB ( feature_test_macros (7) +»²¾È) ¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë¤Î¤ß¸ø³«¤µ¤ì¤ë¡£ +ɬÍפʵ¡Ç½¸¡ºº¥Þ¥¯¥í¤Ï³Ñ³ç¸Ì ("[]") Æâ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O In the descriptions below, "not in POSIX" means that the +.\"O value is not specified in POSIX.1-2001, +.\"O and "XSI" means that the value is specified in POSIX.1-2001 +.\"O as part of the XSI extension. +°Ê²¼¤ÎÀâÌÀ¤Ç¡¢ "POSIX ¤Ë¤Ï¤Ê¤¤" ¤Ï +¤½¤ÎÃͤ¬ POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò°ÕÌ£¤·¡¢ +"XSI" ¤Ï¤½¤ÎÃͤ¬ POSIX.1-2001 ¤Î XSI ³ÈÄ¥¤Ç +µ¬Äꤵ¤ì¤Æ¤¤¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.PP +.\"O \fIc_iflag\fP flag constants: +\fIc_iflag\fP ¥Õ¥é¥°¤Ë¤Ï°Ê²¼¤ÎÍ×ÁǤò»ØÄê¤Ç¤­¤ë: +.TP +.B IGNBRK +.\"O Ignore BREAK condition on input. +ÆþÎÏÃæ¤Î BREAK ¿®¹æ¤ò̵»ë¤¹¤ë¡£ +.TP +.B BRKINT +.\"O If \fBIGNBRK\fP is set, a BREAK is ignored. +.\"O If it is not set +.\"O but \fBBRKINT\fP is set, then a BREAK causes the input and output +.\"O queues to be flushed, and if the terminal is the controlling +.\"O terminal of a foreground process group, it will cause a +.\"O \fBSIGINT\fP to be sent to this foreground process group. +\fBIGNBRK\fP ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢BREAK ¿®¹æ¤Ï̵»ë¤µ¤ì¤ë¡£ +\fBIGNBRK\fP ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢\fBBRKINT\fP ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +BREAK ¿®¹æ¤Ë¤è¤Ã¤ÆÆþ½ÐÎÏ¥­¥å¡¼¤¬¥Õ¥é¥Ã¥·¥å¤µ¤ì¡¢ +¤µ¤é¤Ë¡¢Ã¼Ëö¤¬¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÀ©¸æüËö¤Î¾ì¹ç¤Ï¡¢ +¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë \fBSIGINT\fP ¤¬Á÷¤é¤ì¤ë¡£ +.\"O When neither \fBIGNBRK\fP nor \fBBRKINT\fP are set, a BREAK +.\"O reads as a null byte (\(aq\\0\(aq), except when \fBPARMRK\fP is set, +.\"O in which case it reads as the sequence \\377 \\0 \\0. +\fBIGNBRK\fP ¤â \fBBRKINT\fP ¤âÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +BREAK ¤ò NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤È¤·¤ÆÆɤ߹þ¤à¡£ +¤¿¤À¤·¡¢\fBPARMRK\fP ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï \\377 \\0 \\0 ¤Î¥·¡¼¥±¥ó¥¹¤È¤·¤Æ +Æɤ߹þ¤à¡£ +.TP +.B IGNPAR +.\"O Ignore framing errors and parity errors. +¥Õ¥ì¡¼¥à¥¨¥é¡¼¤ª¤è¤Ó¥Ñ¥ê¥Æ¥£¥¨¥é¡¼¤ò̵»ë¤¹¤ë¡£ +.TP +.B PARMRK +.\"O If \fBIGNPAR\fP is not set, prefix a character with a parity error or +.\"O framing error with \\377 \\0. +.\"O If neither \fBIGNPAR\fP nor \fBPARMRK\fP +.\"O is set, read a character with a parity error or framing error +.\"O as \\0. +\fBIGNPAR\fP ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥Ñ¥ê¥Æ¥£¥¨¥é¡¼¤¢¤ë¤¤¤Ï¥Õ¥ì¡¼¥à¥¨¥é¡¼ +¤ÎȯÀ¸¤·¤¿Ê¸»ú¤ÎÁ°¤Ë \\377 \\0 ¤òÉղ乤롣\fBIGNPAR\fP ¤â \fBPARMRK\fP ¤â +ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥Ñ¥ê¥Æ¥£¥¨¥é¡¼¤¢¤ë¤¤¤Ï¥Õ¥ì¡¼¥à¥¨¥é¡¼¤ÎȯÀ¸¤·¤¿Ê¸»ú¤ò +\\0 ¤È¤·¤ÆÆɤ߹þ¤à¡£ +.TP +.B INPCK +.\"O Enable input parity checking. +ÆþÎϤΥѥê¥Æ¥£¥Á¥§¥Ã¥¯¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.B ISTRIP +.\"O Strip off eighth bit. +8 ¥Ó¥Ã¥ÈÌܤòÍî¤È¤¹¡£ +.TP +.B INLCR +.\"O Translate NL to CR on input. +ÆþÎϤΠNL (New Line: ²þ¹Ôʸ»ú) ¤ò CR (Carriage Return: Éüµ¢Ê¸»ú) ¤Ë +ÃÖ¤­´¹¤¨¤ë¡£ +.TP +.B IGNCR +.\"O Ignore carriage return on input. +ÆþÎϤΠCR ¤ò̵»ë¤¹¤ë¡£ +.TP +.B ICRNL +.\"O Translate carriage return to newline on input (unless \fBIGNCR\fP is set). +(\fBIGNCR\fP ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç) ÆþÎϤΠCR ¤ò NL ¤ËÃÖ¤­´¹¤¨¤ë¡£ +.TP +.B IUCLC +.\"O (not in POSIX) Map uppercase characters to lowercase on input. +(POSIX ¤Ë¤Ï¤Ê¤¤) ÆþÎϤÎÂçʸ»ú¤ò¾®Ê¸»ú¤ËÃÖ¤­´¹¤¨¤ë¡£ +.TP +.B IXON +.\"O Enable XON/XOFF flow control on output. +½ÐÎϤΠXON/XOFF ¥Õ¥í¡¼À©¸æ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.B IXANY +.\"O (XSI) Typing any character will restart stopped output. +.\"O (The default is to allow just the START character to restart output.) +(XSI) Ǥ°Õ¤Îʸ»ú¤òÆþÎϤ¹¤ë¤È¡¢Ää»ß¤·¤Æ¤¤¤¿½ÐÎϤòºÆ³«¤¹¤ë +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢START ʸ»ú¤Ç¤Î¤ß½ÐÎϤ¬ºÆ³«¤µ¤ì¤ë)¡£ +.TP +.B IXOFF +.\"O Enable XON/XOFF flow control on input. +ÆþÎϤΠXON/XOFF ¥Õ¥í¡¼À©¸æ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.B IMAXBEL +.\"O (not in POSIX) Ring bell when input queue is full. +.\"O Linux does not implement this bit, and acts as if it is always set. +(POSIX ¤Ë¤Ï¤Ê¤¤) ÆþÎÏ¥­¥å¡¼¤¬°ìÇդλþ¤Ë¥Ù¥ë¤òÌĤ餹¡£ +Linux ¤Ç¤Ï¤³¤Î¥Ó¥Ã¥È¤Ï¼ÂÁõ¤µ¤ì¤Æ¤ª¤é¤º¡¢ +¾ï¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤«¤Î¤è¤¦¤Ë¿¶Éñ¤¦¡£ +.TP +.\"O .BR IUTF8 " (since Linux 2.6.4)" +.BR IUTF8 " (Linux 2.6.4 °Ê¹ß)" +.\"O (not in POSIX) Input is UTF8; +.\"O this allows character-erase to be correctly performed in cooked mode. +(POSIX ¤Ë¤Ï¤Ê¤¤) ÆþÎϤ¬ UTF8 ¤Ç¤¢¤ë; +¤³¤ì¤Ë¤è¤ê cooked mode ¤Çʸ»úºï½ü (character-erase) ¤ò +Àµ¤·¤¯µ¡Ç½¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O \fIc_oflag\fP flag constants defined in POSIX.1: +POSIX.1 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë \fIc_oflag\fP ¥Õ¥é¥°¤ò°Ê²¼¤Ë¼¨¤¹: +.TP +.B OPOST +.\"O Enable implementation-defined output processing. +¼ÂÁõ¤Ë°Í¸¤·¤¿½ÐÎϽèÍý¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.PP +.\"O The remaining \fIc_oflag\fP flag constants are defined in POSIX.1-2001, +.\"O unless marked otherwise. +»Ä¤ê¤Î \fIc_oflag\fP ¥Õ¥é¥°¤Ï¡¢Æõ­¤Î¤Ê¤¤¸Â¤ê POSIX.1-2001 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B OLCUC +.\"O (not in POSIX) Map lowercase characters to uppercase on output. +(POSIX ¤Ë¤Ï¤Ê¤¤) ½ÐÎÏ»þ¤Ë¾®Ê¸»ú¤òÂçʸ»ú¤ËÊÑ´¹¤¹¤ë¡£ +.TP +.B ONLCR +.\"O (XSI) Map NL to CR-NL on output. +(XSI) ½ÐÎϤΠNL ¤ò CR-NL ¤ËÃÖ¤­´¹¤¨¤ë¡£ +.TP +.B OCRNL +.\"O Map CR to NL on output. +½ÐÎϤΠCR ¤ò NL ¤ËÃÖ¤­´¹¤¨¤ë¡£ +.TP +.B ONOCR +.\"O Don't output CR at column 0. +0 ·åÌÜ¤Ç CR ¤ò½ÐÎϤ·¤Ê¤¤¡£ +.TP +.B ONLRET +.\"O Don't output CR. +CR ¤ò½ÐÎϤ·¤Ê¤¤¡£ +.TP +.B OFILL +.\"O Send fill characters for a delay, rather than using a timed delay. +žÁ÷»þ´Ö¤òÃ٤餻¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ÊäŶʸ»ú (fill character) ¤òÁ÷¤ë¡£ +(ÌõÃí:ÆÃÄê¤Îʸ»ú¤ËÂФ·¤Æ¡¢Ã¼Ëö¦¤Î½èÍý¤òÂԤĤ¿¤á¤ËžÁ÷¤ò°ìÄê»þ´Ö +Ã٤餻¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤Þ¤¿¡¢ \fBOFILL\fP ¤ò»ØÄꤹ¤ë¤È +žÁ÷¤òÃ٤餻¤ëÂå¤ï¤ê¤ËÊäŶʸ»ú¤òÁ÷¤ë¡£) +.TP +.B OFDEL +.\"O (not in POSIX) Fill character is ASCII DEL (0177). +.\"O If unset, fill character is ASCII NUL (\(aq\\0\(aq). +.\"O (Not implemented on Linux.) +(POSIX ¤Ë¤Ï¤Ê¤¤) ÊäŶʸ»ú¤ò ASCII DEL ¤Ë¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï ASCII NUL (\(aq\\0\(aq) ¤Ë¤Ê¤ë¡£ +(Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +.TP +.B NLDLY +.\"O Newline delay mask. +.\"O Values are \fBNL0\fP and \fBNL1\fP. +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .B _SVID_SOURCE +.\"O or +.\"O .BR _XOPEN_SOURCE ] +NL ¤ÎÃÙ±ä¤òÀßÄꤹ¤ë¡£ÃÍ¤Ï \fBNL0\fP (ÃÙ±ä¤Ê¤·) ¤ª¤è¤Ó \fBNL1\fP ¤Ç¤¢¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤« +.B _XOPEN_SOURCE +¤¬É¬Í×] +.TP +.B CRDLY +.\"O Carriage return delay mask. +.\"O Values are \fBCR0\fP, \fBCR1\fP, \fBCR2\fP, or \fBCR3\fP. +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .B _SVID_SOURCE +.\"O or +.\"O .BR _XOPEN_SOURCE ] +CR ¤ÎÃÙ±ä¤òÀßÄꤹ¤ë¡£ÃÍ¤Ï \fBCR0\fP (ÃÙ±ä¤Ê¤·), +\fBCR1\fP, \fBCR2\fP,\fBCR3\fP ¤Ç¤¢¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤« +.B _XOPEN_SOURCE +¤¬É¬Í×] +.TP +.B TABDLY +.\"O Horizontal tab delay mask. +.\"O Values are \fBTAB0\fP, \fBTAB1\fP, \fBTAB2\fP, \fBTAB3\fP (or \fBXTABS\fP). +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .B _SVID_SOURCE +.\"O or +.\"O .BR _XOPEN_SOURCE ] +¿åÊ¿¥¿¥Ö (horizontal tab) ¤ÎÃÙ±ä¤òÀßÄꤹ¤ë¡£ +ÃÍ¤Ï \fBTAB0\fP (ÃÙ±ä¤Ê¤·), +\fBTAB1\fP, \fBTAB2\fP, \fBTAB3\fP (\fBXTABS\fP) ¤Ç¤¢¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤« +.B _XOPEN_SOURCE +¤¬É¬Í×] +.\"O A value of TAB3, that is, XTABS, expands tabs to spaces +.\"O (with tab stops every eight columns). +XTAB3 (¤³¤ì¤Ï XTABS ¤ÈƱ¤¸¤Ç¤¢¤ë) ¤ÎÃͤϥ¿¥Ö¤ò¥¹¥Ú¡¼¥¹²¿¸Ä¤ËÊÑ´¹¤¹¤ë¤«¤ò¼¨¤¹ +(¥¿¥Ö¤Ï 8 ·åËè¤Ë»ß¤Þ¤ë)¡£ +.TP +.B BSDLY +.\"O Backspace delay mask. +.\"O Values are \fBBS0\fP or \fBBS1\fP. +.\"O (Has never been implemented.) +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .B _SVID_SOURCE +.\"O or +.\"O .BR _XOPEN_SOURCE ] +¸åÂà (backspace) ¤ÎÃÙ±ä¤òÀßÄꤹ¤ë¡£ +ÃÍ¤Ï \fBBS0\fP (ÃÙ±ä¤Ê¤·) ¤¢¤ë¤¤¤Ï \fBBS1\fP ¤Ç¤¢¤ë¡£ +(¼ÂÁõ¤µ¤ì¤¿¤³¤È¤Ï¤Ê¤¤) +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤« +.B _XOPEN_SOURCE +¤¬É¬Í×] +.TP +.B VTDLY +.\"O Vertical tab delay mask. +.\"O Values are \fBVT0\fP or \fBVT1\fP. +¿âľ¥¿¥Ö (vertical tab) ¤ÎÃÙ±ä¤òÀßÄꤹ¤ë¡£ +ÃÍ¤Ï \fBVT0\fP (ÃÙ±ä¤Ê¤·) ¤¢¤ë¤¤¤Ï \fBVT1\fP ¤Ç¤¢¤ë¡£ +.TP +.B FFDLY +.\"O Form feed delay mask. +.\"O Values are \fBFF0\fP or \fBFF1\fP. +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .B _SVID_SOURCE +.\"O or +.\"O .BR _XOPEN_SOURCE ] +ÊÇÁ÷¤ê (form feed) ¤ÎÃÙ±ä¤òÀßÄꤹ¤ë¡£ +ÃÍ¤Ï \fBFF0\fP (ÃÙ±ä¤Ê¤·) ¤¢¤ë¤¤¤Ï \fBFF1\fP ¤Ç¤¢¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤« +.B _XOPEN_SOURCE +¤¬É¬Í×] +.PP +.\"O \fIc_cflag\fP flag constants: +\fIc_cflag\fP ¥Õ¥é¥°¤Ï°Ê²¼¤ÎÄ̤ê: +.TP +.B CBAUD +.\"O (not in POSIX) Baud speed mask (4+1 bits). +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .BR _SVID_SOURCE ] +(POSIX ¤Ë¤Ï¤Ê¤¤) ¥Ü¡¼¥ì¡¼¥È¥Þ¥¹¥¯ (4+1 ¥Ó¥Ã¥È)¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B CBAUDEX +.\"O (not in POSIX) Extra baud speed mask (1 bit), included in +.\"O .BR CBAUD . +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .BR _SVID_SOURCE ] +(POSIX ¤Ë¤Ï¤Ê¤¤) ÄɲäΥܡ¼¥ì¡¼¥È¥Þ¥¹¥¯ (1 ¥Ó¥Ã¥È)¡£ +.B CBAUD +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.sp +.\"O (POSIX says that the baud speed is stored in the +.\"O .I termios +.\"O structure without specifying where precisely, and provides +.\"O .BR cfgetispeed () +.\"O and +.\"O .BR cfsetispeed () +.\"O for getting at it. +.\"O Some systems use bits selected by +.\"O .B CBAUD +.\"O in +.\"O .IR c_cflag , +.\"O other systems use separate fields, for example, +.\"O .I sg_ispeed +.\"O and +.\"O .IR sg_ospeed .) +(POSIX ¤Ç¤Ï¡¢ +.I termios +¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤¿¥Ü¡¼¥ì¡¼¥È¤ÏÀµ³Î¤Ê¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥Ü¡¼¥ì¡¼¥È¤òÁàºî¤¹¤ë¤¿¤á¤Ë +.BR cfgetispeed () +¤È +.BR cfsetispeed () +¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£ +.I c_cflag +Æâ¤Î +.B CBAUD +¤ÇÁªÂò¤µ¤ì¤¿¥Ó¥Ã¥È¤ò»È¤¦¥·¥¹¥Æ¥à¤â¤¢¤ì¤Ð¡¢ +.I sg_ispeed +¤ä +.I sg_ospeed +¤È¤¤¤Ã¤¿ÆÈΩ¤·¤¿¥Õ¥£¡¼¥ë¥É¤ò»È¤¦¤â¤Î¤â¤¢¤ë¡£) +.TP +.B CSIZE +.\"O Character size mask. +.\"O Values are \fBCS5\fP, \fBCS6\fP, \fBCS7\fP, or \fBCS8\fP. +ʸ»ú¥µ¥¤¥º¤òÀßÄꤹ¤ë¡£ +ÃÍ¤Ï \fBCS5\fP, \fBCS6\fP, \fBCS7\fP, \fBCS8\fP ¤Ç¤¢¤ë¡£ +.TP +.B CSTOPB +.\"O Set two stop bits, rather than one. +¥¹¥È¥Ã¥×¥Ó¥Ã¥È¤ò 1 ¤Ç¤Ï¤Ê¤¯ 2 ¤Ë¤¹¤ë¡£ +.TP +.B CREAD +.\"O Enable receiver. +¼õ¿®¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.B PARENB +.\"O Enable parity generation on output and parity checking for input. +½ÐÎϤ˥ѥê¥Æ¥£¤òÉղä·¡¢ÆþÎϤΥѥê¥Æ¥£¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¡£ +.TP +.B PARODD +.\"O If set, then parity for input and output is odd; +.\"O otherwise even parity is used. +ÀßÄꤵ¤ì¤ë¤È¡¢ÆþÎϤª¤è¤Ó½ÐÎϤËÂФ¹¤ë¥Ñ¥ê¥Æ¥£¤¬´ñ¿ô¥Ñ¥ê¥Æ¥£¤È¤Ê¤ë¡£ +ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢¶ö¿ô¥Ñ¥ê¥Æ¥£¤¬»ÈÍѤµ¤ì¤ë¡£ +.TP +.B HUPCL +.\"O Lower modem control lines after last process closes the device (hang up). +ºÇ¸å¤Î¥×¥í¥»¥¹¤¬¥Ç¥Ð¥¤¥¹¤ò¥¯¥í¡¼¥º¤·¤¿¸å¡¢¥â¥Ç¥à¤ÎÀ©¸æÀþ¤ò low ¤Ë¤¹¤ë +(ÀÚÃǤ¹¤ë)¡£ +.TP +.B CLOCAL +.\"O Ignore modem control lines. +¥â¥Ç¥à¤ÎÀ©¸æÀþ¤ò̵»ë¤¹¤ë¡£ +.TP +.B LOBLK +.\"O (not in POSIX) Block output from a noncurrent shell layer. +.\"O For use by \fBshl\fP (shell layers). (Not implemented on Linux.) +(POSIX ¤Ë¤Ï¤Ê¤¤) ¸½ºß¤Î¥·¥§¥ëÁذʳ°¤«¤é¤Î½ÐÎϤòÍÞÀ©¤¹¤ë¡£ + \fBshl\fP (¥·¥§¥ëÁØ) ¤ÇÍѤ¤¤é¤ì¤ë¡£(Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +.TP +.B CIBAUD +.\"O (not in POSIX) Mask for input speeds. +.\"O The values for the +.\"O .B CIBAUD +.\"O bits are +.\"O the same as the values for the +.\"O .B CBAUD +.\"O bits, shifted left +.\"O .B IBSHIFT +.\"O bits. +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .BR _SVID_SOURCE ] +.\"O (Not implemented on Linux.) +(POSIX ¤Ë¤Ï¤Ê¤¤) ÆþÎÏ®Å٤Υޥ¹¥¯¡£ +.B CIBAUD +¥Ó¥Ã¥È¤Î¤¿¤á¤ÎÃÍ¤Ï +.B CBAUD +¥Ó¥Ã¥È¤Î¤¿¤á¤ÎÃͤÈƱ¤¸¤Ç¤¢¤ê¡¢ +º¸¤Ë +.B IBSHIFT +¥Ó¥Ã¥È¥·¥Õ¥È¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +(Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +.TP +.B CMSPAR +.\"O (not in POSIX) +.\"O Use "stick" (mark/space) parity (supported on certain serial +.\"O devices): if +.\"O .B PARODD +.\"O is set, the parity bit is always 1; if +.\"O .B PARODD +.\"O is not set, then the parity bit is always 0). +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .BR _SVID_SOURCE ] +(POSIX ¤Ë¤Ï¤Ê¤¤) +(°ìÉô¤Î¥·¥ê¥¢¥ë¥Ç¥Ð¥¤¥¹¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë) +¡Ö¥¹¥Æ¥£¥Ã¥¯ (stick)¡×¥Ñ¥ê¥Æ¥£ (¥Þ¡¼¥¯/¥¹¥Ú¡¼¥¹ ¥Ñ¥ê¥Æ¥£)¤ò»ÈÍѤ¹¤ë¡£ +.B PARODD +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¥Ñ¥ê¥Æ¥£¥Ó¥Ã¥È¤Ï¾ï¤Ë 1 ¤È¤Ê¤ê¡¢ +ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¾ï¤Ë 0 ¤È¤Ê¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B CRTSCTS +.\"O (not in POSIX) Enable RTS/CTS (hardware) flow control. +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .BR _SVID_SOURCE ] +(POSIX ¤Ë¤Ï¤Ê¤¤) RTS/CTS (¥Ï¡¼¥É¥¦¥§¥¢) ¥Õ¥í¡¼À©¸æ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.PP +.\"O \fIc_lflag\fP flag constants: +\fIc_lflag\fP ¥Õ¥é¥°¤Ï°Ê²¼¤ÎÄ̤ê: +.TP +.B ISIG +.\"O When any of the characters INTR, QUIT, SUSP, or DSUSP are received, +.\"O generate the corresponding signal. +INTR, QUIT, SUSP, DSUSP ¤Îʸ»ú¤ò¼õ¿®¤·¤¿»þ¡¢Âбþ¤¹¤ë¥·¥°¥Ê¥ë¤ò +ȯÀ¸¤µ¤»¤ë¡£ +.TP +.B ICANON +.\"O Enable canonical mode (described below). +¥«¥Î¥Ë¥«¥ë¥â¡¼¥É¤òÍ­¸ú¤Ë¤¹¤ë (²¼µ­»²¾È)¡£ +.TP +.B XCASE +.\"O (not in POSIX; not supported under Linux) +.\"O If \fBICANON\fP is also set, terminal is uppercase only. +.\"O Input is converted to lowercase, except for characters preceded by \\. +.\"O On output, uppercase characters are preceded by \\ and lowercase +.\"O characters are converted to uppercase. +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤) +\fBICANON\fP ¤¬Æ±»þ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢Ã¼Ëö¤ÏÂçʸ»ú¤Î¤ß¤¬Í­¸ú¤Ç¤¢¤ë¡£ +ÆþÎϤµ¤ì¤¿Ê¸»ú¤Ï \\ ¤¬ÉÕ¤¤¤¿Ê¸»ú¤ò½ü¤¤¤Æ¾®Ê¸»ú¤ËÊÑ´¹¤µ¤ì¤ë¡£ +½ÐÎÏ»þ¤Ï¡¢Âçʸ»ú¤ÎÁ°¤Ë \\ ¤¬ÉÕ¤­¡¢¾®Ê¸»ú¤ÏÂçʸ»ú¤ËÊÑ´¹¤µ¤ì¤ë¡£ +.\"O [requires _BSD_SOURCE or _SVID_SOURCE or _XOPEN_SOURCE] +.\"O .\" glibc is probably now wrong to allow +.RB [ _BSD_SOURCE +¤¬ +.B _SVID_SOURCE +¤« +.B _XOPEN_SOURCE +¤¬É¬Í×] +.\" °Ê²¼¤Ï¤ª¤½¤é¤¯ glibc ¤Î´Ö°ã¤¤¤Ç¤¢¤í¤¦¡£ +.\"O .\" Define +.\"O .\" .B _XOPEN_SOURCE +.\"O .\" to expose +.\"O .\" .BR XCASE . +.\" .B XCASE +.\" ¤ò¸ø³«¤¹¤ë¤Ë¤Ï +.\" .B _XOPEN_SOURCE +.\" ¤òÄêµÁ¤¹¤ë¤³¤È¡£ +.TP +.B ECHO +.\"O Echo input characters. +ÆþÎϤµ¤ì¤¿Ê¸»ú¤ò¥¨¥³¡¼¤¹¤ë¡£ +.TP +.B ECHOE +.\"O If \fBICANON\fP is also set, the ERASE character erases the preceding +.\"O input character, and WERASE erases the preceding word. +\fBICANON\fP ¤âƱ»þ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ERASE ʸ»ú¤ÏÁ°¤Îʸ»ú¤òºï½ü¤·¡¢ +WERASE ʸ»ú¤ÏÁ°¤Îñ¸ì¤òºï½ü¤¹¤ë¡£ +.TP +.B ECHOK +.\"O If \fBICANON\fP is also set, the KILL character erases the current line. +\fBICANON\fP ¤âƱ»þ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢KILL ʸ»ú¤Ï¸½ºß¤Î¹Ô¤òºï½ü¤¹¤ë¡£ +.TP +.B ECHONL +.\"O If \fBICANON\fP is also set, echo the NL character even if ECHO is not set. +\fBICANON\fP ¤âƱ»þ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +ECHO ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤â NL ʸ»ú¤ò¥¨¥³¡¼¤¹¤ë¡£ +.TP +.B ECHOCTL +.\"O (not in POSIX) If \fBECHO\fP is also set, ASCII control signals other than +.\"O TAB, NL, START, and STOP are echoed as \fB^X\fP, +.\"O where X is the character with +.\"O ASCII code 0x40 greater than the control signal. +.\"O For example, character +.\"O 0x08 (BS) is echoed as \fB^H\fP. +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .BR _SVID_SOURCE ] +(POSIX ¤Ë¤Ï¤Ê¤¤) \fBECHO\fP ¤âƱ»þ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +TAB, NL, START, STOP ¤Î ASCII À©¸æʸ»ú¤¬ \fB^X\fP ¤È¤·¤Æ¥¨¥³¡¼¤µ¤ì¤ë¡£ +X ¤ÏÀ©¸æʸ»ú¤è¤ê ASCII ¥³¡¼¥É¤Ç 0x10 ¤À¤±Â礭¤Êʸ»ú¤Ç¤¢¤ë¡£ +Î㤨¤Ðʸ»ú 0x28 (BS) ¤Ï \fB^H\fP ¤È¥¨¥³¡¼¤µ¤ì¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B ECHOPRT +.\"O (not in POSIX) If \fBICANON\fP and \fBIECHO\fP are also set, characters +.\"O are printed as they are being erased. +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .BR _SVID_SOURCE ] +(POSIX ¤Ë¤Ï¤Ê¤¤) \fBICANON\fP ¤ª¤è¤Ó \fBIECHO\fP ¤¬Æ±»þ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +ºï½ü¤µ¤ì¤¿Ê¸»ú¤âɽ¼¨¤µ¤ì¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B ECHOKE +.\"O (not in POSIX) If \fBICANON\fP is also set, KILL is echoed by erasing +.\"O each character on the line, as specified by \fBECHOE\fP and \fBECHOPRT\fP. +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .BR _SVID_SOURCE ] +(POSIX ¤Ë¤Ï¤Ê¤¤) \fBICANON\fP ¤âÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +KILL ¤¬¹Ô¤Î³Æʸ»ú¤ò¾Ãµî¤¹¤ëÂå¤ï¤ê¤Ë¥¨¥³¡¼¤µ¤ì¤ë¡£ +¤³¤ì¤Ï \fBECHOE\fP ¤ª¤è¤Ó \fBECHOPRT\fP ¤ò»ØÄꤹ¤ë¤³¤È¤ÈÅù¤·¤¤¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B DEFECHO +.\"O (not in POSIX) Echo only when a process is reading. +.\"O (Not implemented on Linux.) +(POSIX ¤Ë¤Ï¤Ê¤¤) ¥×¥í¥»¥¹¤¬Æɤ߹þ¤ó¤À¤È¤­¤Ë¤À¤±¥¨¥³¡¼¤¹¤ë¡£ +(Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +.TP +.B FLUSHO +.\"O (not in POSIX; not supported under Linux) +.\"O Output is being flushed. +.\"O This flag is toggled by typing +.\"O the DISCARD character. +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .BR _SVID_SOURCE ] +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤) +½ÐÎϤò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£¤³¤Î¥Õ¥é¥°¤Ï DISCARD ʸ»ú¤òÆþÎϤ¹¤ë¤³¤È¤ÇÀÚÂؤ¨¤é¤ì¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B NOFLSH +.\"O Disable flushing the input and output queues when generating the +.\"O .BR SIGINT , +.\"O .BR SIGQUIT , +.\"O and +.\"O .B SIGSUSP +.\"O signals. +.\"O .\" Stevens lets SIGSUSP only flush the input queue +.BR SIGINT , +.BR SIGQUIT , +.B SIGSUSP +¥·¥°¥Ê¥ëȯÀ¸»þ¤ÎÆþÎÏ¡¦½ÐÎÏ¥­¥å¡¼¤Î¥Õ¥é¥Ã¥·¥å¤ò̵¸ú¤Ë¤¹¤ë¡£ +.TP +.B TOSTOP +.\"O Send the +.\"O .B SIGTTOU +.\"O signal to the process group of a background process +.\"O which tries to write to its controlling terminal. +¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÇÀ©¸æüËö¤Ø +ʸ»ú¤ò½ÐÎϤ·¤è¤¦¤È¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤ËÂФ·¤Æ +.B SIGTTOU +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.TP +.B PENDIN +.\"O (not in POSIX; not supported under Linux) +.\"O All characters in the input queue are reprinted when +.\"O the next character is read. +.\"O .RB ( bash (1) +.\"O handles typeahead this way.) +.\"O [requires +.\"O .B _BSD_SOURCE +.\"O or +.\"O .BR _SVID_SOURCE ] +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤) +¼¡¤Îʸ»ú¤òÆɤ߹þ¤ó¤À»þ¡¢ÆþÎÏ¥­¥å¡¼Ãæ¤ÎÁ´Ê¸»ú¤òºÆɽ¼¨¤¹¤ë¡£ +.RB ( bash (1) +¤ÏÆþÎϹԤò¤³¤Î¤è¤¦¤Ë½èÍý¤·¤Æ¤¤¤ë¡£) +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B IEXTEN +.\"O Enable implementation-defined input processing. +.\"O This flag, as well as \fBICANON\fP must be enabled for the +.\"O special characters EOL2, LNEXT, REPRINT, WERASE to be interpreted, +.\"O and for the \fBIUCLC\fP flag to be effective. +¼ÂÁõ°Í¸¤ÎÆþÎϽèÍý¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢Æüìʸ»ú¤Ç¤¢¤ë EOL2, LNEXT, REPRINT, WERASE ¤ä¡¢ +\fBIUCLC\fP ¥Õ¥é¥°¤òÍ­¸ú¤Ë¤¹¤ë¤¿¤á¤ËɬÍפǤ¢¤ë¡£ +.PP +.\"O The \fIc_cc\fP array defines the special control characters. +.\"O The symbolic indices (initial values) and meaning are: +\fIc_cc\fP ÇÛÎó¤ÏÆüì¤ÊÀ©¸æʸ»ú¤òÄêµÁ¤·¤Æ¤¤¤ë¡£ +¥·¥ó¥Ü¥ë¤Î°ìÍ÷ (½é´üÃÍ) ¤È°ÕÌ£¤Ï°Ê²¼¤ÎÄ̤ꡣ +.TP +.B VINTR +.\"O (003, ETX, Ctrl-C, or also 0177, DEL, rubout) +.\"O Interrupt character. +.\"O Send a +.\"O .B SIGINT +.\"O signal. +.\"O Recognized when +.\"O .B ISIG +.\"O is set, and then not passed as input. +(003, ETX, Ctrl-C ¤« 0177, DEL, rubout) +³ä¤ê¹þ¤ßʸ»ú¡£ +.B SIGINT +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.B ISIG +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VQUIT +.\"O (034, FS, Ctrl-\e) +.\"O Quit character. +.\"O Send +.\"O .B SIGQUIT +.\"O signal. +.\"O Recognized when +.\"O .B ISIG +.\"O is set, and then not passed as input. +(034, FS, Ctrl-\e) +½ªÎ»Ê¸»ú¡£ +.B SIGQUIT +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.B ISIG +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VERASE +.\"O (0177, DEL, rubout, or 010, BS, Ctrl-H, or also #) +.\"O Erase character. +.\"O This erases the previous not-yet-erased character, +.\"O but does not erase past EOF or beginning-of-line. +.\"O Recognized when +.\"O .B ICANON +.\"O is set, and then not passed as input. +(0177, DEL, rubout ¤« 010, BS, Ctrl-H ¤« #) +¾Ãµîʸ»ú¡£¤³¤ì¤Ë¤è¤ê¡¢Ä¾Á°¤Î̤¾Ãµîʸ»ú¤ò¾Ãµî¤¹¤ë¡£ +¤·¤«¤·¡¢EOF ¤ä¹ÔƬ¤òĶ¤¨¤Æ¤Ï¾Ãµî¤·¤Ê¤¤¡£ +.B ICANON +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VKILL +.\"O (025, NAK, Ctrl-U, or Ctrl-X, or also @) +.\"O Kill character. +.\"O This erases the input since the last EOF or beginning-of-line. +.\"O Recognized when +.\"O .B ICANON +.\"O is set, and then not passed as input. +(025, NAK, Ctrl-U ¤« Ctrl-X ¤« @) +´°Á´¾Ãµîʸ»ú¡£Ä¾Á°¤Î EOF ¤«¹ÔƬ°Ê¹ß¤ÎÁ´¤Æ¤ÎÆþÎϤò¾Ãµî¤¹¤ë¡£ +.B ICANON +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VEOF +.\"O (004, EOT, Ctrl-D) +.\"O End-of-file character. +(004, EOT, Ctrl-D) +¥Õ¥¡¥¤¥ë½ªÃ¼Ê¸»ú¡£ +.\"O More precisely: this character causes the pending tty buffer to be sent +.\"O to the waiting user program without waiting for end-of-line. +¤è¤êÀµ³Î¤Ë¤Ï¡¢tty ¥Ð¥Ã¥Õ¥¡¤ÎÆâÍƤò¹ÔËö¤òÂÔ¤¿¤º¤Ë¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤ËÁ÷¤ë¡£ +.\"O If it is the first character of the line, the +.\"O .BR read (2) +.\"O in the +.\"O user program returns 0, which signifies end-of-file. +¤³¤ì¤¬¹Ô¤ÎºÇ½é¤Îʸ»ú¤À¤Ã¤¿¾ì¹ç¡¢¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤Î +.BR read (2) +¤Ï 0 ¤ò +ÊÖ¤·¡¢¥Õ¥¡¥¤¥ë½ªÃ¼¤Ç¤¢¤ë¤³¤È¤òÃΤ餻¤ë¡£ +.\"O Recognized when +.\"O .B ICANON +.\"O is set, and then not passed as input. +.B ICANON +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VMIN +.\"O Minimum number of characters for noncanonical read. +È󥫥Υ˥«¥ëÆɤ߹þ¤ß»þ¤ÎºÇ¾®Ê¸»ú¿ô¡£ +.TP +.B VEOL +(0, NUL) +.\"O Additional end-of-line character. +.\"O Recognized when +.\"O .B ICANON +.\"O is set. +ÄɲäιÔËöʸ»ú¡£ +.B ICANON +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤¹¤ë¡£ +.TP +.B VTIME +.\"O Timeout in deciseconds for noncanonical read. +È󥫥Υ˥«¥ëÆɤ߹þ¤ß»þ¤Î¥¿¥¤¥à¥¢¥¦¥È»þ´Ö (1/10 ÉÃñ°Ì)¡£ +.TP +.B VEOL2 +.\"O (not in POSIX; 0, NUL) +(POSIX ¤Ë¤Ï¤Ê¤¤; 0, NUL) +.\"O Yet another end-of-line character. +.\"O Recognized when +.\"O .B ICANON +.\"O is set. +ÄɲäιÔËöʸ»ú¡£ +.B ICANON +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤¹¤ë¡£ +.TP +.B VSWTCH +.\"O (not in POSIX; not supported under Linux; 0, NUL) +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤; 0, NUL) +.\"O Switch character. +.\"O (Used by \fBshl\fP only.) +¥¹¥¤¥Ã¥Áʸ»ú (\fBshl\fP ¤Ç¤Î¤ßÍѤ¤¤é¤ì¤ë)¡£ +.TP +.B VSTART +(021, DC1, Ctrl-Q) +.\"O Start character. +.\"O Restarts output stopped by the Stop character. +.\"O Recognized when +.\"O .B IXON +.\"O is set, and then not passed as input. +³«»Ïʸ»ú¡£Ää»ßʸ»ú¤ÇÄä»ß¤·¤¿½ÐÎϤòºÆ³«¤¹¤ë¡£ +.B IXON +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VSTOP +(023, DC3, Ctrl-S) +.\"O Stop character. +.\"O Stop output until Start character typed. +.\"O Recognized when +.\"O .B IXON +.\"O is set, and then not passed as input. +Ää»ßʸ»ú¡£³«»Ïʸ»ú¤¬ÆþÎϤµ¤ì¤ë¤Þ¤Ç½ÐÎϤòÄä»ß¤¹¤ë¡£ +.B IXON +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VSUSP +(032, SUB, Ctrl-Z) +.\"O Suspend character. +.\"O Send +.\"O .B SIGTSTP +.\"O signal. +.\"O Recognized when +.\"O .B ISIG +.\"O is set, and then not passed as input. +ÃæÃÇʸ»ú¡£ +.B SIGTSTP +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.B ISIG +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VDSUSP +.\"O (not in POSIX; not supported under Linux; 031, EM, Ctrl-Y) +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤; 031, EM, Ctrl-Y) +.\"O Delayed suspend character: +.\"O send +.\"O .B SIGTSTP +.\"O signal when the character is read by the user program. +.\"O Recognized when +.\"O .B IEXTEN +.\"O and +.\"O .B ISIG +.\"O are set, and the system supports +.\"O job control, and then not passed as input. +ÃÙ±äÃæÃÇʸ»ú¡£¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤«¤éʸ»ú¤¬Æɤ߹þ¤Þ¤ì¤¿»þ¤Ë +.B SIGTSTP +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.B IEXTEN +¤È +.B ISIG +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Æ¡¢¥·¥¹¥Æ¥à¤¬¥¸¥ç¥ÖÀ©¸æ¤ËÂбþ¤·¤Æ¤¤¤ë¾ì¹ç¤Ë +ǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VLNEXT +.\"O (not in POSIX; 026, SYN, Ctrl-V) +(POSIX ¤Ë¤Ï¤Ê¤¤; 026, SYN Ctrl-V) +.\"O Literal next. +.\"O Quotes the next input character, depriving it of +.\"O a possible special meaning. +.\"O Recognized when +.\"O .B IEXTEN +.\"O is set, and then not passed as input. +¥ê¥Æ¥é¥ë¡£¼¡¤ÎÆþÎÏʸ»ú¤ò¥¨¥¹¥±¡¼¥×¤·¡¢ÆÃÊ̤ʰÕÌ£¤¬¤¢¤Ã¤Æ¤â²ò¼á¤·¤Ê¤¤¡£ +.B IEXTEN +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VWERASE +.\"O (not in POSIX; 027, ETB, Ctrl-W) +(POSIX ¤Ë¤Ï¤Ê¤¤; 027, ETB, Ctrl-W) +.\"O Word erase. +ñ¸ì¾Ãµî¡£ +.\"O Recognized when +.\"O .B ICANON +.\"O and +.\"O .B IEXTEN +.\"O are set, and then not passed as input. +.B ICANON +¤È +.B IEXTEN +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VREPRINT +.\"O (not in POSIX; 022, DC2, Ctrl-R) +(POSIX ¤Ë¤Ï¤Ê¤¤; 022, DC2, Ctrl-R) +.\"O Reprint unread characters. +¤Þ¤ÀÆɤ߹þ¤ó¤Ç¤¤¤Ê¤¤Ê¸»úÎó¤òºÆɽ¼¨¤¹¤ë¡£ +.\"O Recognized when +.\"O .B ICANON +.\"O and +.\"O .B IEXTEN +.\"O are set, and then not passed as input. +.B ICANON +¤È +.B IEXTEN +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VDISCARD +.\"O (not in POSIX; not supported under Linux; 017, SI, Ctrl-O) +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤; 017, SI, Ctrl-O) +.\"O Toggle: start/stop discarding pending output. +̤Á÷¿®¥Ð¥Ã¥Õ¥¡¤ÎÆâÍƤÎÇË´þ/Êݸ¤òÀÚ¤êÂؤ¨¤ë¡£ +.\"O Recognized when +.\"O .B IEXTEN +.\"O is set, and then not passed as input. +.B IEXTEN +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VSTATUS +.\"O (not in POSIX; not supported under Linux; +.\"O status request: 024, DC4, Ctrl-T). +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤; +¾õÂÖÍ×µá: 024, DC4, Ctrl-T) +.LP +.\"O These symbolic subscript values are all different, except that +.\"O .BR VTIME , +.\"O .B VMIN +.\"O may have the same value as +.\"O .BR VEOL , +.\"O .BR VEOF , +.\"O respectively. +¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤Î¼¨¤¹ÃͤÏÁ´¤Æ°Û¤Ê¤ë¡£ +¤¿¤À¤·¡¢ +.BR VTIME , +.B VMIN +¤Ï¤½¤ì¤¾¤ì +.BR VEOL , +.B VEOF +¤ÈƱ¤¸ÃͤǤ¢¤ë¡£ +.\"O In noncanonical mode the special character meaning is replaced +.\"O by the timeout meaning. +.\"O For an explanation of +.\"O .B VMIN +.\"O and +.\"O .BR VTIME , +.\"O see the description of +.\"O noncanonical mode below. +È󥫥Υ˥«¥ë¥â¡¼¥É¤Ç¤Ï¡¢Æüìʸ»ú¤Î°ÕÌ£¤Ï¥¿¥¤¥à¥¢¥¦¥È¤Î°ÕÌ£¤ËÊѤï¤ë¡£ +.B VMIN +¤È +.B VTIME +¤ÎÀâÌÀ¤Ë¤Ä¤¤¤Æ¤Ï¡¢²¼µ­¤ÎÈ󥫥Υ˥«¥ë¥â¡¼¥É¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SS "Retrieving and changing terminal settings" +.SS "üËö¤ÎÀßÄê¤Î¼èÆÀ¤ÈÊѹ¹" +.PP +.\"O .BR tcgetattr () +.\"O gets the parameters associated with the object referred by \fIfd\fP and +.\"O stores them in the \fItermios\fP structure referenced by +.\"O \fItermios_p\fP. +.\"O This function may be invoked from a background process; +.\"O however, the terminal attributes may be subsequently changed by a +.\"O foreground process. +.BR tcgetattr () +¤Ï \fIfd\fP ¤Ë´Ø¤¹¤ë¥Ñ¥é¥á¡¼¥¿¤ò¼èÆÀ¤·¡¢\fItermios_p\fP ¤¬»²¾È¤¹¤ë¹½ +¤ÂÎ \fItermios\fP ¤ËÀßÄꤹ¤ë¡£¤³¤Î´Ø¿ô¤Ï¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¤«¤é +¸Æ¤Ð¤ì¤ë¤³¤È¤â¤¢¤ë¤¬¡¢¤³¤Î¾ì¹ç¡¢Ã¼Ëö¤Î°À­¤Ï¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹ +¤Ë¤è¤Ã¤ÆÊѲ½¤¹¤ë¤³¤È¤â¤¢¤ë¡£ +.LP +.\"O .BR tcsetattr () +.\"O sets the parameters associated with the terminal (unless support is +.\"O required from the underlying hardware that is not available) from the +.\"O \fItermios\fP structure referred to by \fItermios_p\fP. +.\"O \fIoptional_actions\fP specifies when the changes take effect: +.BR tcsetattr () +¤ÏüËö¤Ë´ØÏ¢¤·¤¿¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë (¥Ï¡¼¥É¥¦¥§¥¢¤ÎÀßÄê¤ËɬÍפǡ¢¤³¤³¤Ç +ÀßÄê¤Ç¤­¤Ê¤¤¤â¤Î¤ò½ü¤¯)¡£ÀßÄê¤Ë¤Ï \fItermios_p\fP ¤¬»²¾È¤¹¤ë +\fItermios\fP ¹½Â¤ÂΤòÍѤ¤¤ë¡£ +\fIoptional_actions\fP ¤Ë¤ÏÊѹ¹¤¬Í­¸ú¤È¤Ê¤ë¥¿¥¤¥ß¥ó¥°¤òÀßÄꤹ¤ë: +.IP \fBTCSANOW\fP +.\"O the change occurs immediately. +¤¿¤À¤Á¤ËÊѹ¹¤¬Í­¸ú¤È¤Ê¤ë¡£ +.IP \fBTCSADRAIN\fP +.\"O the change occurs after all output written to +.\"O .I fd +.\"O has been transmitted. +.\"O This function should be used when changing +.\"O parameters that affect output. +.I fd +¤Ø¤Î½ÐÎϤ¬¤¹¤Ù¤ÆžÁ÷¤µ¤ì¤¿¸å¤ËÊѹ¹¤¬Í­¸ú¤Ë¤Ê¤ë¡£¤³¤Îµ¡Ç½¤Ï +½ÐÎϤ˱ƶÁ¤¹¤ë¥Ñ¥é¥á¡¼¥¿¤òÊѹ¹¤¹¤ë»þ¤Ë»ÈÍѤ¹¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.IP \fBTCSAFLUSH\fP +.\"O the change occurs after all output written to the object referred by +.\"O .I fd +.\"O has been transmitted, and all input that has been received but not read +.\"O will be discarded before the change is made. +¥Ñ¥é¥á¡¼¥¿¤òÊѹ¹¤¹¤ëÁ°¤Ë¡¢ +.I fd +¤Ø¤Î½ÐÎϤ¬¤¹¤Ù¤ÆžÁ÷¤µ¤ì¡¢¼õ¿®¤·¤¿¤¬¤Þ¤ÀÆɤ߹þ¤ó¤Ç¤¤¤Ê¤¤¤¹¤Ù¤Æ¤Î +ÆþÎϤ¬ÇË´þ¤µ¤ì¤ë¡£ +.\"O .SS "Canonical and noncanonical mode" +.SS "¥«¥Î¥Ë¥«¥ë¥â¡¼¥É¤ÈÈ󥫥Υ˥«¥ë¥â¡¼¥É" +.\"O The setting of the +.\"O .B ICANON +.\"O canon flag in +.\"O .I c_lflag +.\"O determines whether the terminal is operating in canonical mode +.\"O .RB ( ICANON +.\"O set) or +.\"O noncanonical mode +.\"O .RB ( ICANON +.\"O unset). +.\"O By default, +.\"O .B ICANON +.\"O set. +.I c_lflag +¤Î +.B ICANON +¥Õ¥é¥°¤ÎÀßÄê¤Ë¤è¤ê¡¢Ã¼Ëö¤¬¥«¥Î¥Ë¥«¥ë¥â¡¼¥É¤ÇÆ°ºî¤¹¤ë¤«¤¬·èÄꤵ¤ì¤ë¡£ +.B ICANON +¤¬¥»¥Ã¥È¤µ¤ì¤¿¾ì¹ç¡¢¥«¥Î¥Ë¥«¥ë¥â¡¼¥É (canonical mode) ¤È¤Ê¤ê¡¢ +¥»¥Ã¥È¤µ¤ì¤Ê¤¤¾ì¹ç¡¢È󥫥Υ˥«¥ë¥â¡¼¥É (noncanonical mode) ¤È¤Ê¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.B ICANON +¤Ï¥»¥Ã¥È¤µ¤ì¤ë¡£ + +.\"O In canonical mode: +¥«¥Î¥Ë¥«¥ë¥â¡¼¥É¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤ÊÆ°ºî¤È¤Ê¤ë¡£ +.IP * 2 +.\"O Input is made available line by line. +.\"O An input line is available when one of the line delimiters +.\"O is typed (NL, EOL, EOL2; or EOF at the start of line). +.\"O Except in the case of EOF, the line delimiter is included +.\"O in the buffer returned by +.\"O .BR read (2). +ÆþÎϤϹÔñ°Ì¤Ë¹Ô¤ï¤ì¤ë¡£ +¹Ô¶èÀÚ¤êʸ»ú¤¬ÂǤÁ¹þ¤Þ¤ì¤¿»þÅÀ¤Ç¡¢ÆþÎϹԤ¬ÍøÍѲÄǽ¤È¤Ê¤ë¡£ +¹Ô¶èÀÚ¤êʸ»ú¤Ï NL, EOL, EOL2 ¤ª¤è¤Ó¹ÔƬ¤Ç¤Î EOF ¤Ç¤¢¤ë¡£ +EOF °Ê³°¤Î¾ì¹ç¡¢ +.BR read (2) +¤¬ÊÖ¤¹¥Ð¥Ã¥Õ¥¡¤Ë¹Ô¶èÀÚ¤êʸ»ú¤â´Þ¤á¤é¤ì¤ë¡£ +.IP * 2 +.\"O Line editing is enabled (ERASE, KILL; +.\"O and if the +.\"O .B IEXTEN +.\"O flag is set: WERASE, REPRINT, LNEXT). +.\"O A +.\"O .BR read (2) +.\"O returns at most one line of input; if the +.\"O .BR read (2) +.\"O requested fewer bytes than are available in the current line of input, +.\"O then only as many bytes as requested are read, +.\"O and the remaining characters will be available for a future +.\"O .BR read (2). +¹ÔÊÔ½¸¤¬Í­¸ú¤È¤Ê¤ë (ERASE, KILL ¤¬¸ú²Ì¤ò»ý¤Ä¡£ +.B IEXTEN +¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +WERASE, REPRINT, LNEXT ¤â¸ú²Ì¤ò»ý¤Ä)¡£ +.BR read (2) +¤ÏºÇÂç¤Ç¤â 1¹Ô¤ÎÆþÎϤ·¤«ÊÖ¤µ¤Ê¤¤¡£ +.BR read (2) +¤¬Í׵ᤷ¤¿¥Ð¥¤¥È¿ô¤¬¸½ºß¤ÎÆþÎϹԤΥХ¤¥È¿ô¤è¤ê¤â¾¯¤Ê¤¤¾ì¹ç¡¢ +Í׵ᤷ¤¿¤Î¤ÈƱ¤¸¥Ð¥¤¥È¿ô¤À¤±¤¬Æɤ߹þ¤Þ¤ì¡¢ +»Ä¤ê¤Îʸ»ú¤Ï¼¡²ó¤Î +.BR read (2) +¤ÇÆɤ߹þ¤Þ¤ì¤ë¡£ +.PP +.\"O In noncanonical mode input is available immediately (without +.\"O the user having to type a line-delimiter character), +.\"O and line editing is disabled. +.\"O The settings of MIN +.\"O .RI ( c_cc[VMIN] ) +.\"O and TIME +.\"O .RI ( c_cc[VTIME] ) +.\"O determine the circumstances in which a +.\"O .BR read (2) +.\"O completes; there are four distinct cases: +È󥫥Υ˥«¥ë¥â¡¼¥É¤Ç¤Ï¡¢ÆþÎϤϨºÂ¤ËÍøÍѲÄǽ¤È¤Ê¤ê +(¥æ¡¼¥¶¤Ï¹Ô¶èÀÚ¤êʸ»ú¤òÂǤÁ¹þ¤àɬÍפϤʤ¤)¡¢ +¹ÔÊÔ½¸¤Ï̵¸ú¤È¤Ê¤ë¡£ +MIN +.RI ( c_cc[VMIN] ) +¤È TIME +.RI ( c_cc[VTIME] ) +¤ÎÀßÄê¤Ë¤è¤ê¡¢ +.BR read (2) +¤¬´°Î»¤¹¤ë¾ò·ï¤¬·èÄꤵ¤ì¤ë¡£4¼ïÎà¤Î¾ì¹ç¤¬¤¢¤ë: +.IP * 2 +MIN == 0; TIME == 0: +.\"O If data is available, +.\"O .BR read (2) +.\"O returns immediately, with the lesser of the number of bytes +.\"O available, or the number of bytes requested. +.\"O If no data is available, +.\"O .BR read (2) +.\"O returns 0. +¥Ç¡¼¥¿¤¬ÍøÍѲÄǽ¤Ç¤¢¤ì¤Ð¡¢ +.BR read (2) +¤Ï¤¹¤°¤ËÊ֤롣¤³¤Î¤È¤­¤ÎÊÖ¤êÃͤϡ¢¤½¤Î¤È¤­ÍøÍѲÄǽ¤Ê¥Ð¥¤¥È¿ô¤« +.BR read (2) +¤ÎÍ×µá¥Ð¥¤¥È¿ô¤Î¤¦¤Á¾®¤µ¤¤Êý¤È¤Ê¤ë¡£ +ÍøÍѲÄǽ¤Ê¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç +.BR read (2) +¤Ï 0 ¤òÊÖ¤¹¡£ +.IP * 2 +MIN > 0; TIME == 0: +.\"O .BR read (2) +.\"O blocks until the lesser of MIN bytes or the number of bytes requested +.\"O are available, and returns the lesser of these two values. +.BR read (2) +¤Ï¡¢ÍøÍѲÄǽ¤Ê¥Ç¡¼¥¿¤¬ MIN ¥Ð¥¤¥È¤«Í×µá¥Ð¥¤¥È¿ô¤Î¤¤¤º¤ì¤«¤Ë㤹¤ë¤Þ¤Ç +Ää»ß¤¹¤ë¡£ÊÖ¤êÃͤϡ¢MIN ¤«Í×µá¥Ð¥¤¥È¿ô¤Î¾®¤µ¤¤Êý¤È¤Ê¤ë¡£ +.IP * 2 +MIN == 0; TIME > 0: +.\"O TIME specifies the limit for a timer in tenths of a second. +.\"O The timer is started when +.\"O .BR read (2) +.\"O is called. +.\"O .BR read (2) +.\"O returns either when at least one byte of data is available, +.\"O or when the timer expires. +.\"O If the timer expires without any input becoming available, +.\"O .BR read (2) +.\"O returns 0. +TIME ¤Ï¥¿¥¤¥Þ¤Î¾å¸Â¤òµ¬Äꤷ¡¢Ã±°Ì¤Ï 1/10 ÉäǤ¢¤ë¡£ +¥¿¥¤¥Þ¤Ï +.BR read (2) +¤¬¸Æ¤Ð¤ì¤¿»þÅÀ¤Ç³«»Ï¤µ¤ì¤ë¡£ +.BR read (2) +¤¬ÊÖ¤ë¤Î¤Ï¡¢¾¯¤Ê¤¯¤È¤â 1¥Ð¥¤¥È¤Î¥Ç¡¼¥¿¤¬ÍøÍѲÄǽ¤È¤Ê¤Ã¤¿»þÅÀ¡¢ +¤Þ¤¿¤Ï¥¿¥¤¥Þ¤¬»þ´ÖÀÚ¤ì¤È¤Ê¤Ã¤¿»þÅÀ¤Ç¤¢¤ë¡£ +ÆþÎϤ¬Á´¤¯¤Ê¤¯¥¿¥¤¥Þ¤¬»þ´ÖÀÚ¤ì¤È¤Ê¤Ã¤¿¾ì¹ç¡¢ +.BR read (2) +¤Ï 0 ¤òÊÖ¤¹¡£ +.IP * 2 +MIN > 0; TIME > 0: +.\"O TIME specifies the limit for a timer in tenths of a second. +.\"O Once an initial byte of input becomes available, +.\"O the timer is restarted after each further byte is received. +.\"O .BR read (2) +.\"O returns either when the lesser of the number of bytes requested or +.\"O MIN byte have been read, +.\"O or when the inter-byte timeout expires. +.\"O Because the timer is only started after the initial byte +.\"O becomes available, at least one byte will be read. +TIME ¤Ï¥¿¥¤¥Þ¤Î¾å¸Â¤òµ¬Äꤷ¡¢Ã±°Ì¤Ï 1/10 ÉäǤ¢¤ë¡£ +ÆþÎϤκǽé¤Î¥Ð¥¤¥È¤¬ÍøÍѲÄǽ¤Ë¤Ê¤Ã¤¿¸å¤Ï¡¢ +¿·¤¿¤Ë 1¥Ð¥¤¥È¼õ¿®¤¹¤ëÅ٤˥¿¥¤¥Þ¤¬¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +.BR read (2) +¤¬ÊÖ¤ë¤Î¤Ï¡¢MIN ¥Ð¥¤¥È¤«Í×µá¥Ð¥¤¥È¿ô¤Î¤¦¤Á¾¯¤Ê¤¤Êý¤Þ¤ÇÆɤ߽Фµ¤ì¤¿»þÅÀ¤«¡¢ +¥Ð¥¤¥È´Ö¥¿¥¤¥Þ¤¬»þ´ÖÀÚ¤ì¤È¤Ê¤Ã¤¿»þÅÀ¤Ç¤¢¤ë¡£ +¤ÏºÇ½é¤Î¥Ð¥¤¥È¤¬ÍøÍѲÄǽ¤Ë¤Ê¤é¤Ê¤¤¤È¥¿¥¤¥Þ¤Ï³«»Ï¤µ¤ì¤Ê¤¤¤Î¤Ç¡¢ +¾¯¤Ê¤¯¤È¤â 1¥Ð¥¤¥È¤ÏÆɤ߹þ¤Þ¤ì¤ë¡£ +.SS "Raw mode" +.LP +.\"O .BR cfmakeraw () +.\"O sets the terminal to something like the +.\"O "raw" mode of the old Version 7 terminal driver: +.\"O input is available character by character, +.\"O echoing is disabled, and all special processing of +.\"O terminal input and output characters is disabled. +.\"O The terminal attributes are set as follows: +.BR cfmakeraw () +¤Ï¡¢Ã¼Ëö¤òÀΤΠVersion 7 üËö¥É¥é¥¤¥Ð¤Î +"raw" ¥â¡¼¥É¤Î¤è¤¦¤ËÀßÄꤹ¤ë¡£ +ÆþÎϤÏʸ»úñ°Ì¤Ë²Äǽ¤Ç¤¢¤ê¡¢¥¨¥³¡¼¤¬Ìµ¸ú¤È¤Ê¤ê¡¢ +üËö¤ÎÆþ½ÐÎÏʸ»ú¤ËÂФ¹¤ëÆüì½èÍý¤Ï¤¹¤Ù¤Æ̵¸ú¤È¤Ê¤ë¡£ +üËö¤Î°À­¤Ï°Ê²¼¤Î¤è¤¦¤ËÀßÄꤵ¤ì¤ë: +.nf + + termios_p\->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP + | INLCR | IGNCR | ICRNL | IXON); + termios_p\->c_oflag &= ~OPOST; + termios_p\->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); + termios_p\->c_cflag &= ~(CSIZE | PARENB); + termios_p\->c_cflag |= CS8; +.fi +.\"O .SS "Line control" +.SS "¥é¥¤¥óÀ©¸æ" +.LP +.\"O .BR tcsendbreak () +.\"O transmits a continuous stream of zero-valued bits for a specific +.\"O duration, if the terminal is using asynchronous serial data +.\"O transmission. +.\"O If \fIduration\fP is zero, it transmits zero-valued bits +.\"O for at least 0.25 seconds, and not more that 0.5 seconds. +.\"O If \fIduration\fP is not zero, it sends zero-valued bits for some +.\"O implementation-defined length of time. +.BR tcsendbreak () +¤ÏüËö¤¬ÈóƱ´ü¤Î¥·¥ê¥¢¥ë¥Ç¡¼¥¿Å¾Á÷¤òÍѤ¤¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +Ϣ³¤·¤¿0¤Î¥Ó¥Ã¥ÈÎó¤ò°ìÄê´Ö³Ö¤ÇžÁ÷¤¹¤ë¡£ +\fIduration\fP ¤¬ 0 ¤Î¾ì¹ç¤Ï¡¢0 ¤Î¥Ó¥Ã¥È¤ò 0.25 Éðʾ塢 +0.5 Éðʲ¼¤Î´Ö³Ö¤ÇžÁ÷¤¹¤ë¡£ \fIduration\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢ +0 ¤Î¥Ó¥Ã¥È¤ò¼ÂÁõ°Í¸¤Î»þ´Ö´Ö³Ö¤ÇÁ÷¤ë¡£ +.LP +.\"O If the terminal is not using asynchronous serial data transmission, +.\"O .BR tcsendbreak () +.\"O returns without taking any action. +üËö¤¬ÈóƱ´ü¤Î¥·¥ê¥¢¥ë¥Ç¡¼¥¿Å¾Á÷¥â¡¼¥É¤Ç¤Ê¤¤¾ì¹ç¡¢ +.BR tcsendbreak () +¤Ï²¿¤â¹Ô¤ï¤º¤ËÌá¤ë¡£ +.LP +.\"O .BR tcdrain () +.\"O waits until all output written to the object referred to by +.\"O .I fd +.\"O has been transmitted. +.BR tcdrain () +¤Ï +.I fd +¤¬¹Ô¤Ã¤Æ¤¤¤ë½ÐÎϤΞÁ÷¤¬´°Î»¤¹¤ë¤Þ¤ÇÂԤġ£ +.LP +.\"O .BR tcflush () +.\"O discards data written to the object referred to by +.\"O .I fd +.\"O but not transmitted, or data received but not read, depending on the +.\"O value of +.\"O .IR queue_selector : +.BR tcflush () +¤Ï +.I fd +¤¬¹Ô¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿¤Î½ÐÎϤǤޤÀžÁ÷¤µ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¡¢¤¢¤ë¤¤¤Ï¼õ¿®¤· +¤¿¤¬¤Þ¤ÀÆþÎϤ·¤Æ¤¤¤Ê¤¤¤â¤Î¤òÇË´þ¤¹¤ë¡£¤¤¤º¤ì¤ò¹Ô¤¦¤«¤Ï +.I queue_selector +¤ÎÃͤÇÄê¤á¤ë: +.\"??nakano flush == discard? +.IP \fBTCIFLUSH\fP +.\"O flushes data received but not read. +¼õ¿®¤·¤¿¤¬Æɤó¤Ç¤¤¤Ê¤¤¥Ç¡¼¥¿¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.IP \fBTCOFLUSH\fP +.\"O flushes data written but not transmitted. +½ñ¤¤¤¿¤¬Á÷¿®¤·¤Æ¤¤¤Ê¤¤¥Ç¡¼¥¿¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.IP \fBTCIOFLUSH\fP +.\"O flushes both data received but not read, and data written but not +.\"O transmitted. +¼õ¿®¤·¤¿¤¬Æɤó¤Ç¤¤¤Ê¤¤¥Ç¡¼¥¿¡¦½ñ¤¤¤¿¤¬Á÷¿®¤·¤Æ¤¤¤Ê¤¤¥Ç¡¼¥¿Î¾Êý +¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.LP +.\"O .BR tcflow () +.\"O suspends transmission or reception of data on the object referred to by +.\"O .IR fd , +.\"O depending on the value of +.\"O .IR action : +.BR tcflow () +¤Ï +.I fd +¤Ç»ØÄꤵ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤ª¤±¤ë¥Ç¡¼¥¿¤ÎÁ÷¿®¤¢¤ë¤¤¤Ï¼õ¿®¤ò°ì»þŪ¤ËÃæÃǤ¹¤ë¡£ +Á÷¿®¤È¼õ¿®¤Î¤É¤Á¤é¤«¤Ï¡¢ +.IR action ¤Ç·è¤Þ¤ë: +.IP \fBTCOOFF\fP +.\"O suspends output. +½ÐÎϤÎÃæÃÇ¡£ +.IP \fBTCOON\fP +.\"O restarts suspended output. +ÃæÃǤ·¤¿½ÐÎϤκƳ«¡£ +.IP \fBTCIOFF\fP +.\"O transmits a STOP character, which stops the terminal device from +.\"O transmitting data to the system. +STOP ʸ»ú¤ÎÁ÷¿®¡£ +STOP ʸ»ú¤ÏüËö¥Ç¥Ð¥¤¥¹¤«¤é¥·¥¹¥Æ¥à¤Ø¤Î¥Ç¡¼¥¿Á÷¿®¤òÄä»ß¤¹¤ë¡£ +.IP \fBTCION\fP +.\"O transmits a START character, which starts the terminal device +.\"O transmitting data to the system. +START ʸ»ú¤ÎÁ÷¿®¡£ +START ʸ»ú¤ÏüËö¥Ç¥Ð¥¤¥¹¤«¤é¥·¥¹¥Æ¥à¤Ø¤Î¥Ç¡¼¥¿Á÷¿®¤ò³«»Ï¤¹¤ë¡£ +.LP +.\"O The default on open of a terminal file is that neither its input nor its +.\"O output is suspended. +üËö¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¤È¤­¤Î¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +ÆþÎϤâ½ÐÎϤâÃæÃǤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SS "Line speed" +.SS "¥é¥¤¥ó®ÅÙ" +.\"O The baud rate functions are provided for getting and setting the values +.\"O of the input and output baud rates in the \fItermios\fP structure. +.\"O The new values do not take effect +.\"O until +.\"O .BR tcsetattr () +.\"O is successfully called. +¥Ü¡¼¥ì¡¼¥È´Ø¿ô¤Ï \fItermios\fP ¹½Â¤ÂÎÃæ¤ÎÆþ½ÐÎϥܡ¼¥ì¡¼¥È¤ò +¼èÆÀ¡¢ÀßÄꤹ¤ë¤¿¤á¤ËÄ󶡤µ¤ì¤ë¡£ +ÀßÄꤵ¤ì¤¿ÃÍ¤Ï +.BR tcsetattr () +¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤Þ¤Ç¤ÏÍ­¸ú¤Ç¤Ï¤Ê¤¤¡£ + +.\"O Setting the speed to \fBB0\fP instructs the modem to "hang up". +.\"O The actual bit rate corresponding to \fBB38400\fP may be altered with +.\"O .BR setserial (8). +®ÅÙ¤ò \fBB0\fP ¤ËÀßÄꤷ¤¿¾ì¹ç¡¢¥â¥Ç¥à¤ÏÄä»ß (hang up) ¤¹¤ë¡£ +\fBB38400\fP ¤Ë³ºÅö¤¹¤ë¼ÂºÝ¤Î¥Ó¥Ã¥È¥ì¡¼¥È¤Ï +.BR setserial (8) +¤Ç +Êѹ¹¤Ç¤­¤ë¡£ +.LP +.\"O The input and output baud rates are stored in the \fItermios\fP +.\"O structure. +ÆþÎϤª¤è¤Ó½ÐÎϥܡ¼¥ì¡¼¥È¤Ï \fItermios\fP ¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ë¡£ +.LP +.\"O .BR cfgetospeed () +.\"O returns the output baud rate stored in the \fItermios\fP structure +.\"O pointed to by +.\"O .IR termios_p . +.BR cfgetospeed () +¤Ï +.I termios_p +¤¬¼¨¤·¤Æ¤¤¤ë \fItermios\fP ¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤Æ¤¤¤ë +½ÐÎϥܡ¼¥ì¡¼¥È¤òÊÖ¤¹¡£ +.LP +.\"O .BR cfsetospeed () +.\"O sets the output baud rate stored in the \fItermios\fP structure pointed +.\"O to by \fItermios_p\fP to \fIspeed\fP, which must be one of these constants: +.BR cfsetospeed () +¤Ï \fItermios_p\fP ¤Ç¼¨¤µ¤ì¤Æ¤¤¤ë \fItermios\fP ¹½Â¤ÂÎÃæ¤Î½ÐÎϥܡ¼¥ì¡¼¥È¤ò +\fIspeed\fP ¤ËÀßÄꤹ¤ë¡£Ãͤϰʲ¼¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤: +.nf + +.ft B + B0 + B50 + B75 + B110 + B134 + B150 + B200 + B300 + B600 + B1200 + B1800 + B2400 + B4800 + B9600 + B19200 + B38400 + B57600 + B115200 + B230400 +.ft P + +.fi +.\"O The zero baud rate, \fBB0\fP, +.\"O is used to terminate the connection. +.\"O If B0 is specified, the modem control lines shall no longer be asserted. +.\"O Normally, this will disconnect the line. +.\"O \fBCBAUDEX\fP is a mask +.\"O for the speeds beyond those defined in POSIX.1 (57600 and above). +.\"O Thus, \fBB57600\fP & \fBCBAUDEX\fP is nonzero. +0¥Ü¡¼ (\fBB0\fP) ¤ÏÀܳ¤ÎÃæÃǤËÍѤ¤¤é¤ì¤ë¡£ +B0¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥â¥Ç¥à¤ÎÀ©¸æÀþ¤Ï»ÈÍѤµ¤ì¤Ê¤¤¾õÂ֤ˤʤꡢ°ìÈ̤ˤϤ³¤ì¤Ç +Àܳ¤¬ÀÚÃǤµ¤ì¤ë¡£ +\fBCBAUDEX\fP ¤ÏPOSIX.1¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë®ÅÙ¤ÎÈϰϳ° (57600 ¤ª¤è¤Ó¤½¤ì°Ê¾å) +¤òÀßÄꤹ¤ë¡£¤¹¤Ê¤ï¤ÁÎ㤨¤Ð \fBB57600\fP & \fBCBAUDEX\fP ¤Ï 0 ¤Ç¤Ê¤¤¡£ +.LP +.\"O .BR cfgetispeed () +.\"O returns the input baud rate stored in the \fItermios\fP structure. +.BR cfgetispeed () +¤Ï \fItermios\fP ¹½Â¤ÂÎÃæ¤ÎÆþÎϥܡ¼¥ì¡¼¥È¤òÊÖ¤¹¡£ +.LP +.\"O .BR cfsetispeed () +.\"O sets the input baud rate stored in the \fItermios\fP structure to +.\"O .IR speed , +.\"O which must be specified as one of the \fBBnnn\fP constants listed above for +.\"O .BR cfsetospeed (). +.\"O If the input baud rate is set to zero, the input baud rate will be +.\"O equal to the output baud rate. +.BR cfsetispeed () +¤Ï \fItermios\fP ¹½Â¤ÂÎÃæ¤ÎÆþÎϥܡ¼¥ì¡¼¥È¤ò +.I speed +¤ËÀßÄꤹ¤ë¡£ +.I speed +¤Ë¤Ï¡¢¾å½Ò¤Î +.BR cfsetospeed () +¤Î¥Ü¡¼¥ì¡¼¥ÈÄê¿ô \fBBnnn\fP ¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ÆþÎϥܡ¼¥ì¡¼¥È¤¬ 0 ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ÆþÎϥܡ¼¥ì¡¼¥È¤Ï½ÐÎϥܡ¼¥ì¡¼¥È +¤ÈƱ¤¸ÃͤȤʤ롣 +.LP +.\"O .BR cfsetspeed () +.\"O is a 4.4BSD extension. +.\"O It takes the same arguments as +.\"O .BR cfsetispeed (), +.\"O and sets both input and output speed. +.BR cfsetspeed () +¤Ï 4.4BSD ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£¤³¤Î´Ø¿ô¤Ï +.BR cfsetispeed () +¤ÈƱ¤¸°ú¤­¿ô¤ò¤È¤ê¡¢Æþ½ÐÎÏξÊý¤Î®ÅÙ¤òÀßÄꤹ¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.LP +.\"O .BR cfgetispeed () +.\"O returns the input baud rate stored in the +.\"O \fItermios\fP +.\"O structure. +.BR cfgetispeed () +¤Ï \fItermios\fP ¹½Â¤ÂÎÃæ¤ÎÆþÎϥܡ¼¥ì¡¼¥È¤òÊÖ¤¹¡£ +.LP +.\"O .BR cfgetospeed () +.\"O returns the output baud rate stored in the \fItermios\fP structure. +.BR cfgetospeed () +¤Ï \fItermios\fP ¹½Â¤ÂÎÃæ¤Î½ÐÎϥܡ¼¥ì¡¼¥È¤òÊÖ¤¹¡£ +.LP +.\"O All other functions return: +¾¤Î¤¹¤Ù¤Æ¤Î´Ø¿ô¤ÎÌá¤êÃÍ: +.IP 0 +.\"O on success. +¼Â¹ÔÀ®¸ù¡£ +.IP \-1 +.\"O on failure and set +.\"O .I errno +.\"O to indicate the error. +¼Â¹Ô¼ºÇÔ¡£ +.I errno +¤¬¥¨¥é¡¼¤Î¼ïÎà¤ò¼¨¤¹¡£ +.LP +.\"O Note that +.\"O .BR tcsetattr () +.\"O returns success if \fIany\fP of the requested changes could be +.\"O successfully carried out. +.\"O Therefore, when making multiple changes +.\"O it may be necessary to follow this call with a further call to +.\"O .BR tcgetattr () +.\"O to check that all changes have been performed successfully. +.BR tcsetattr () +¤Ï \fI¤Ê¤ó¤é¤«¤Î\fP Êѹ¹Í׵᤬À®¸ù¤·¤¿¾ì¹ç¤ËÀ®¸ù¤òÊÖ¤¹¤³¤È¤ËÃí°Õ¡£ +½¾¤Ã¤Æ¡¢Ê£¿ô¤ÎÊѹ¹¤ò¹Ô¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢°ú¤­Â³¤¤¤Æ +.BR tcgetattr () +¤ò¸Æ¤Ó½Ð¤·¤ÆÁ´¤Æ¤ÎÊѹ¹¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¤«¤ò³Îǧ¤¹¤ëɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.BR tcgetattr (), +.BR tcsetattr (), +.BR tcsendbreak (), +.BR tcdrain (), +.BR tcflush (), +.BR tcflow (), +.BR cfgetispeed (), +.BR cfgetospeed (), +.BR cfsetispeed (), +.\"O and +.BR cfsetospeed () +.\"O are specified in POSIX.1-2001. +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +.\"O .BR cfmakeraw () +.\"O and +.\"O .BR cfsetspeed () +.\"O are nonstandard, but available on the BSDs. +.BR cfmakeraw () +¤È +.BR cfsetspeed () +¤ÏÈóɸ½à¤À¤¬¡¢BSD ¤Ç¤ÏÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Unix V7 and several later systems have a list of baud rates +.\"O where after the fourteen values B0, ..., B9600 one finds the +.\"O two constants EXTA, EXTB ("External A" and "External B"). +.\"O Many systems extend the list with much higher baud rates. +Unix V7 ¤È¤½¤Î¸å¤Î¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥Ü¡¼¥ì¡¼¥È¤Î 14 ¸Ä¤Î¥ê¥¹¥È¤Ç¤¢¤ë +B0, ..., B9600 ¤Î¸å¤í¤Ë EXTA, EXTB ("External A" ¤È "External B") ¤Î 2 ¤Ä¤ò +Äɲ䷤Ƥ¤¤ë¡£ +¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¤µ¤é¤Ë¹â®¤Ê¥Ü¡¼¥ì¡¼¥È¤Î¤¿¤á¤Ë¥ê¥¹¥È¤ò³ÈÄ¥¤·¤Æ¤¤¤ë¡£ +.LP +.\"O The effect of a nonzero \fIduration\fP with +.\"O .BR tcsendbreak () +.\"O varies. +.BR tcsendbreak () +¤Ç \fIduration\fP ¤Ë 0 °Ê³°¤ò»ØÄꤷ¤¿¾ì¹ç¤Î¸ú²Ì¤ÏÍÍ¡¹¤Ç¤¢¤ë¡£ +.\"O SunOS specifies a break of +.\"O .I "duration\ *\ N" +.\"O seconds, where \fIN\fP is at least 0.25, and not more than 0.5. +SunOS ¤Ï +.IB duration * N +ÉäΥ֥졼¥¯¤òµ¬Äꤷ¤Æ¤¤¤ë¡£¤³¤³¤Ç \fIN\fP ¤Ï 0.25 °Ê¾å 0.5 ̤Ëþ¤Ç¤¢¤ë¡£ +.\"O Linux, AIX, DU, Tru64 send a break of +.\"O .I duration +.\"O milliseconds. +Linux, AIX, DU, Tru64 ¤Ï +.I duration +¥ß¥êÉäΥ֥졼¥¯¤òÁ÷¿®¤¹¤ë¡£ +.\"O FreeBSD and NetBSD and HP-UX and MacOS ignore the value of +.\"O .IR duration . +FreeBSD, NetBSD, HP-UX, MacOS ¤Ï +.I duration +¤ÎÃͤò̵»ë¤¹¤ë¡£ +.\"O Under Solaris and Unixware, +.\"O .BR tcsendbreak () +.\"O with nonzero +.\"O .I duration +.\"O behaves like +.\"O .BR tcdrain (). +Solaris ¤È Unixware ¤Ç¤Ï¡¢Èó¥¼¥í¤Î +.I duration +¤ò»ØÄꤷ¤¿ +.BR tcsendbreak () +¤Î¿¶¤ëÉñ¤¤¤Ï +.BR tcdrain () +¤ÈƱÍͤǤ¢¤ë¡£ +.\"O .\" libc4 until 4.7.5, glibc for sysv: EINVAL for duration > 0. +.\"O .\" libc4.7.6, libc5, glibc for unix: duration in ms. +.\"O .\" glibc for bsd: duration in us +.\"O .\" glibc for sunos4: ignore duration +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR stty (1), +.BR console_ioctl (4), +.BR tty_ioctl (4), +.BR setserial (8) diff --git a/draft/man3/tgamma.3 b/draft/man3/tgamma.3 new file mode 100644 index 00000000..d3c7a8c5 --- /dev/null +++ b/draft/man3/tgamma.3 @@ -0,0 +1,298 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" Based on glibc infopages +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 +.\" +.TH TGAMMA 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O tgamma, tgammaf, tgammal \- true gamma function +tgamma, tgammaf, tgammal \- ËÜÅö¤Î¥¬¥ó¥Þ´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "double tgamma(double " x ); +.br +.BI "float tgammaf(float " x ); +.br +.BI "long double tgammal(long double " x ); +.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)): +.in +.sp +.ad l +.BR tgamma (), +.BR tgammaf (), +.BR tgammal (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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 ¤Ë´Ø¤·¤Æ¡¢°Ê²¼¤¬À®Î©¤¹¤ë: +.sp + Gamma(m+1) = m! +.sp +¤è¤ê°ìÈÌŪ¤Ë¤Ï¡¢¤¹¤Ù¤Æ¤Î \fIx\fP ¤Ë´Ø¤·¤Æ°Ê²¼¤¬À®Î©¤¹¤ë: +.sp + Gamma(x+1) = x * Gamma(x) +.sp +¤µ¤é¤Ë¡¢¶Ë¤ò½ü¤¯¤¹¤Ù¤Æ¤Î \fIx\fP ¤Ç¼¡¼°¤âÀ®Î©¤¹¤ë: +.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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O If +.\"O .I x +.\"O is positive infinity, positive infinity is returned. +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"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 , +¤òÊÖ¤¹¡£¤³¤ÎºÝ¡¢¿ô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£ + +.\"O If the result underflows, +.\"O a range error occurs, +.\"O and the functions return 0, with the correct mathematical sign. +·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O The following errors can occur: +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.\"O Domain error: \fIx\fP is a negative integer, or negative infinity +Îΰ襨¥é¡¼: \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 +¶Ë¥¨¥é¡¼ (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 +ÈÏ°Ï¥¨¥é¡¼ (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 ) +¤¬¾å¤¬¤ë¡£ +.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 +ÈÏ°Ï¥¨¥é¡¼ (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 +¤ÏÀßÄꤵ¤ì¤Ê¤¤¡£ +.\" 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 +.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 +.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 +.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 + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR gamma (3), +.BR lgamma (3) diff --git a/draft/man3/timegm.3 b/draft/man3/timegm.3 new file mode 100644 index 00000000..b7817d20 --- /dev/null +++ b/draft/man3/timegm.3 @@ -0,0 +1,139 @@ +.\" 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) 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 +.SH ̾Á° +timegm, timelocal \- gmtime ¤È localtime ¤ÎµÕ´Ø¿ô +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "time_t timelocal(struct tm *" tm ); +.sp +.BI "time_t timegm(struct tm *" tm ); +.sp +.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 timelocal (), +.BR timegm (): +_BSD_SOURCE || _SVID_SOURCE +.\"O .SH DESCRIPTION +.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) +´Ø¿ô¤ÎµÕ´Ø¿ô¤Ç¤¢¤ë¡£ +.\"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 +.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) +¤ÈƱ¤¸¤â¤Î¤Ç¤¢¤ë¡£ +¤Î¤Ç¡¢¤³¤ì¤ò»È¤¦Íýͳ¤Ï¤Ê¤¤¤Ï¤º¤Ç¤¢¤ë¡£ +.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 +.in +4n +.nf +#include +#include + +time_t my_timegm (struct tm *tm) +{ + time_t ret; + char *tz; + + tz = getenv("TZ"); + setenv("TZ", "", 1); + tzset(); + ret = mktime(tm); + if (tz) + setenv("TZ", tz, 1); + else + unsetenv("TZ"); + tzset(); + return ret; +} +.fi +.in +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR gmtime (3), +.BR localtime (3), +.BR mktime (3), +.BR tzset (3) diff --git a/draft/man3/timeradd.3 b/draft/man3/timeradd.3 new file mode 100644 index 00000000..1f356d2e --- /dev/null +++ b/draft/man3/timeradd.3 @@ -0,0 +1,247 @@ +.\" Copyright (c) 2007 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. +.\" +.\" 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 +.SH ̾Á° +.\"O timeradd, timersub, timercmp, timerclear, timerisset \- timeval operations +timeradd, timersub, timercmp, timerclear, timerisset \- timeval ¤ÎÁàºî +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include + +.BI "void timeradd(struct timeval *" a ", struct timeval *" b , +.BI " struct timeval *" res ); + +.BI "void timersub(struct timeval *" a ", struct timeval *" b , +.BI " struct timeval *" res ); + +.BI "void timerclear(struct timeval *" tvp ); + +.BI "int timerisset(struct timeval *" tvp ); + +.BI "int timercmp(struct timeval *" a ", struct timeval *" b ", " CMP ); +.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 +.\"O All functions shown above: +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô: +_BSD_SOURCE +.\"O .SH DESCRIPTION +.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 +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.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 ¤ÎÈϰϤËÆþ¤ë¤è¤¦¤ËÀµµ¬²½¤µ¤ì¤ë¡£ + +.\"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 ¤ÎÈϰϤËÆþ¤ë¤è¤¦¤ËÀµµ¬²½¤µ¤ì¤ë¡£ + +.\"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)) ¤òɽ¤¹¡£ + +.\"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 °Ê³°) ¤òÊÖ¤¹¡£ + +.\"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 ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"#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 +°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +Âå¤ï¤ê¤Ë°Ê²¼¤ò»È¤¦¤³¤È¡£ + + !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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR gettimeofday (2), +.BR time (7) diff --git a/draft/man3/tmpfile.3 b/draft/man3/tmpfile.3 new file mode 100644 index 00000000..2a386b45 --- /dev/null +++ b/draft/man3/tmpfile.3 @@ -0,0 +1,131 @@ +.\" 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 Sat Jul 24 17:46:57 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2001-11-17, aeb +.\" +.\" Japanese Version Copyright (c) 1997 Tenkou N. Hattori +.\" all rights reserved. +.\" Translated Sat Jan 18 16:51:59 JST 1997 +.\" by Tenkou N. Hattori +.\" Updated & Modified Sun Dec 9 15:25:20 JST 2001 +.\" by Yuichi SATO +.\" +.TH TMPFILE 3 2008-07-14 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O tmpfile \- create a temporary file +tmpfile \- ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B FILE *tmpfile(void); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR tmpfile () +.\"O function opens a unique temporary file +.\"O in binary read/write (w+b) mode. +.\"O The file will be automatically deleted when it is closed or the +.\"O program terminates. +.BR tmpfile () +´Ø¿ô¤Ï¥æ¥Ë¡¼¥¯¤Ê¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤ò +¥Ð¥¤¥Ê¥ê¥ê¡¼¥É¥é¥¤¥È¥â¡¼¥É (w+b) ¤Ç¥ª¡¼¥×¥ó¤¹¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥¯¥í¡¼¥º»þ¤Þ¤¿¤Ï¥×¥í¥°¥é¥à¤Î½ªÎ»»þ¤Ë¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR tmpfile () +.\"O function returns a stream descriptor, or NULL if +.\"O a unique filename cannot be generated or the unique file cannot be +.\"O opened. +.\"O In the latter case, \fIerrno\fP is set to indicate the error. +.BR tmpfile () +´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¤«¡¢ +¥æ¥Ë¡¼¥¯¤Ê¥Õ¥¡¥¤¥ë¤¬ºî¤ì¤Ê¤«¤Ã¤¿¤«¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +¸å¼Ô¤Î¾ì¹ç¡¢¥¨¥é¡¼¤òɽ¤¹ \fIerrno\fP ¤òÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O Search permission denied for directory in file's path prefix. +¥Õ¥¡¥¤¥ë¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥µ¡¼¥Á¤Î¥¢¥¯¥»¥¹¸¢ (search permission) ¤¬¤Ê¤¤¡£ +.TP +.B EEXIST +.\"O Unable to generate a unique filename. +¥æ¥Ë¡¼¥¯¤Ê¥Õ¥¡¥¤¥ë̾¤¬ºîÀ®¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINTR +.\"O The call was interrupted by a signal. +¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤ÆÃæÃǤµ¤ì¤¿¡£ +.TP +.B EMFILE +.\"O Too many file descriptors in use by the process. +1 ¤Ä¤Î¥×¥í¥»¥¹¤Ç»ÈÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¿ô¤òĶ²á¤·¤¿¡£ +.TP +.B ENFILE +.\"O Too many files open in the system. +¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó²Äǽ¤Ê¥Õ¥¡¥¤¥ë¿ô¤òĶ²á¤·¤¿¡£ +.TP +.B ENOSPC +¥Ç¥£¥ì¥¯¥È¥ê¤Ë¿·¤·¤¤¥Õ¥¡¥¤¥ë¤òÄɲ乤뤿¤á¤Î¶õ¤­Îΰ褬¤Ê¤¤¡£ +.TP +.B EROFS +.\"O Read-only file system. +ÆɤߤÀ¤·ÀìÍÑ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O POSIX.1-2001 specifies: +.\"O an error message may be written to \fIstdout\fP if the stream +.\"O cannot be opened. +POSIX.1-2001 ¤Ç¤Ï¡¢ +¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +\fIstdout\fP ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½ñ¤­½Ð¤µ¤ì¤ë¡¢¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.LP +.\"O The standard does not specify the directory that +.\"O .BR tmpfile () +.\"O will use. +.\"O Glibc will try the path prefix \fIP_tmpdir\fP defined +.\"O in \fI\fP, and if that fails the directory \fI/tmp\fP. +µ¬³Ê¤Ç¤Ï +.BR tmpfile () +¤¬»È¤¦¥Ç¥£¥ì¥¯¥È¥ê¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +glibc ¤Ç¤Ï \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë +\fIP_tmpdir\fP ¤ò¥Ñ¥¹¤ÎÀèƬ¤Ë»È¤ª¤¦¤È¤¹¤ë¡£ +¤³¤ì¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê \fI/tmp\fP ¤ò»È¤¦¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR exit (3), +.BR mkstemp (3), +.BR mktemp (3), +.BR tempnam (3), +.BR tmpnam (3) diff --git a/draft/man3/tmpnam.3 b/draft/man3/tmpnam.3 new file mode 100644 index 00000000..d897c87e --- /dev/null +++ b/draft/man3/tmpnam.3 @@ -0,0 +1,266 @@ +.\" Copyright (c) 1999 Andries Brouwer (aeb@cwi.nl) +.\" Japanese Version Copyright 1997 Tenkou N. Hattori +.\" +.\" 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. +.\" +.\" 2003-11-15, aeb, added tmpnam_r +.\" +.\" Japanese Version Copyright (c) 1997 Tenkou N. Hattori +.\" all rights reserved. +.\" Translated 1997-01-18, Tenkou N. Hattori +.\" Updated 2000-03-15, Kentaro Shirakata +.\" Updated 2005-03-15, Akihiro MOTOKI +.\" Updated 2006-07-26, Akihiro MOTOKI , LDP v2.36 +.\" +.TH TMPNAM 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O tmpnam, tmpnam_r \- create a name for a temporary file +tmpnam, tmpnam_r \- °ì»þ¥Õ¥¡¥¤¥ë¤Î̾Á°¤òºîÀ®¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *tmpnam(char *" s ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR tmpnam () +.\"O function returns a pointer to a string that is a valid filename, +.\"O and such that a file with this name did not exist at some point +.\"O in time, so that naive programmers may think it +.\"O a suitable name for a temporary file. +.\"O If the argument +.\"O .I s +.\"O is NULL this name is generated in an internal static buffer +.\"O and may be overwritten by the next call to +.\"O .BR tmpnam (). +.BR tmpnam () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë̾¤Ë»È¤¨¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤¢¤ë»þÅÀ¤Ç¤ÏƱ¤¸Ì¾Á°¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¥Õ¥¡¥¤¥ë̾¤¬ÊÖ¤µ¤ì¤ë¤Î¤Ç¡¢ +ÍÄÃÕ¤Ê¥×¥í¥°¥é¥Þ¤Ï¤³¤Îʸ»úÎ󤬰ì»þ¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ +Ŭ¤·¤Æ¤¤¤ë¤È¹Í¤¨¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +°ú¤­¿ô +.I s +¤¬ NULL ¤Ê¤é¡¢¤³¤Î̾Á°¤ÏÆâÉô¤ÎÀÅŪ¥Ð¥Ã¥Õ¥¡¤ËºîÀ®¤µ¤ì¡¢ +¼¡¤Ë +.BR tmpnam () +´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤Ë¾å½ñ¤­¤µ¤ì¤ë¡£ +.\"O If +.\"O .I s +.\"O is not NULL, the name is copied to the character array (of length +.\"O at least +.\"O .IR L_tmpnam ) +.\"O pointed to by +.\"O .I s +.\"O and the value +.\"O .I s +.\"O is returned in case of success. +.I s +¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢¥Õ¥¡¥¤¥ë̾¤Ï +.I s +¤¬»Ø¤¹ (¾¯¤Ê¤¯¤È¤â +.I L_tmpnam +¤ÎŤµ¤ò»ý¤Ä) ʸ»úÇÛÎó¤Ë¥³¥Ô¡¼¤µ¤ì¡¢ +À®¸ù¤·¤¿¾ì¹ç¤Ï +.I s +¤¬ÊÖ¤µ¤ì¤ë¡£ +.LP +.\"O The pathname that is created, has a directory prefix +.\"O .IR P_tmpdir . +ºîÀ®¤µ¤ì¤ë¥Ñ¥¹Ì¾¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ÎÉôʬ¤Ë +.I P_tmpdir +¤¬»È¤ï¤ì¤ë¡£ +.\"O (Both +.\"O .I L_tmpnam +.\"O and +.\"O .I P_tmpdir +.\"O are defined in +.\"O .IR , +.\"O just like the +.\"O .B TMP_MAX +.\"O mentioned below.) +.RI ( L_tmpnam +¤È +.I P_tmpdir +¤Ï¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ë +.B TMP_MAX +ƱÍÍ +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£) +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR tmpnam () +.\"O function returns a pointer to a unique temporary +.\"O filename, or NULL if a unique name cannot be generated. +.BR tmpnam () +´Ø¿ô¤Ï°ì°Õ¤Ê°ì»þ¥Õ¥¡¥¤¥ë̾¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +°ì°Õ¤Ê¥Õ¥¡¥¤¥ë̾¤¬ºîÀ®¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.\"O No errors are defined. +¥¨¥é¡¼¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.\"O POSIX.1-2008 marks +.\"O .BR tmpnam () +.\"O as obsolete. +POSIX.1-2008 ¤Ï +.BR tmpnam () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The +.\"O .BR tmpnam () +.\"O function generates a different string each time it is called, +.\"O up to +.\"O .B TMP_MAX +.\"O times. +.\"O If it is called more than +.\"O .B TMP_MAX +.\"O times, +.\"O the behavior is implementation defined. +.BR tmpnam () +´Ø¿ô¤ÏºÇÂç +.B TMP_MAX +²ó¤Þ¤Ç¡¢¸Æ¤Ó½Ð¤µ¤ì¤ëÅ٤˰ۤʤëʸ»úÎó¤òºîÀ®¤¹¤ë¡£ +.B TMP_MAX +²ó°Ê¾å¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢¤½¤ÎÆ°ºî¤Ï¼ÂÁõ°Í¸¤Ç¤¢¤ë¡£ +.LP +.\"O Although +.\"O .BR tmpnam () +.\"O generates names that are difficult to guess, +.\"O it is nevertheless possible that between the time that +.\"O .BR tmpnam () +.\"O returns a pathname, and the time that the program opens it, +.\"O another program might create that pathname using +.\"O .BR open (2), +.\"O or create it as a symbolic link. +.\"O This can lead to security holes. +.\"O To avoid such possibilities, use the +.\"O .BR open (2) +.\"O .B O_EXCL +.\"O flag to open the pathname. +.\"O Or better yet, use +.\"O .BR mkstemp (3) +.\"O or +.\"O .BR tmpfile (3). +.BR tmpnam () +¤Ï¿ä¬¤¬Æñ¤·¤¤Ì¾Á°¤òÀ¸À®¤¹¤ë¤¬¡¢¤½¤ì¤Ë¤â¤«¤«¤ï¤é¤º¡¢ +.BR tmpnam () +¤¬¥Ñ¥¹Ì¾¤òÊÖ¤·¤Æ¤«¤é¡¢¥×¥í¥°¥é¥à¤¬¤½¤Î¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë +¤Þ¤Ç¤Î´Ö¤Ë¡¢ÊÌ¤Î¥×¥í¥°¥é¥à¤¬Æ±¤¸¥Ñ¥¹Ì¾¤Ç¡¢¥Õ¥¡¥¤¥ë¤ò +.BR open (2) +¤ÇºîÀ®¤·¤¿¤ê¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤·¤¿¤ê¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤³¤ì¤Ï¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤Ë¤Ä¤Ê¤¬¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤½¤Î¤è¤¦¤Ê²ÄǽÀ­¤ò²óÈò¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.BR open (2) +¤Î +.B O_EXCL +¥Õ¥é¥°¤ò»È¤Ã¤Æ¥Ñ¥¹Ì¾¤ò¥ª¡¼¥×¥ó¤¹¤ì¤Ð¤è¤¤¡£ +¤â¤Ã¤È¤¤¤¤¤Î¤Ï¡¢ +.BR mkstemp (3) +¤ä +.BR tmpfile (3) +¤ò»È¤¦¤³¤È¤Ç¤¢¤ë¡£ +.LP +.\"O Portable applications that use threads cannot call +.\"O .BR tmpnam () +.\"O with a NULL parameter if either +.\"O .B _POSIX_THREADS +.\"O or +.\"O .B _POSIX_THREAD_SAFE_FUNCTIONS +.\"O is defined. +°Ü¿¢À­¤¬É¬Íפʡ¢¥¹¥ì¥Ã¥É¤ò»È¤Ã¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +.B _POSIX_THREADS +¤« +.B _POSIX_THREAD_SAFE_FUNCTIONS +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +.BR tmpnam () +´Ø¿ô¤ò NULL °ú¤­¿ô¤Ç¸Æ¤Ó½Ð¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.LP +.\"O A POSIX draft proposed to use a function +.\"O .BR tmpnam_r () +.\"O defined by +.\"O .sp +.\"O .nf +.\"O .in +4n +.\"O char *tmpnam_r(char *s) { +.\"O return s ? tmpnam(s) : NULL; +.\"O } +.\"O .in +.\"O .fi +.\"O .sp +.\"O apparently as a warning not to use NULL. +POSIX Áð°Æ¤Ç¤Ï¡¢´Ø¿ô +.BR tmpnam_r () +¤ò»È¤¦¤³¤È¤òÄó°Æ¤·¤Æ¤¤¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +NULL ¤ò»È¤ï¤Ê¤¤¤è¤¦¤Ë¤È¤¤¤¦·Ù¹ð¤Î°ÕÌ£¤Ç NULL ¤òÊÌ°·¤¤¤·¤Æ¤¤¤ë¡£ +.sp +.nf +.in +4n +char * +tmpnam_r(char *s) +{ + return s ? tmpnam(s) : NULL; +} +.in +.fi +.sp +.\"O A few systems implement it. +.\"O To get a glibc prototype for this function, +.\"O define +.\"O .B _SVID_SOURCE +.\"O or +.\"O .B _BSD_SOURCE +.\"O before including +.\"O .IR . +¿ô¤Ï¾¯¤Ê¤¤¤¬¡¢¤³¤Î´Ø¿ô¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Î glibc ¤Î¥×¥í¥È¥¿¥¤¥×¤ò»È¤¦¤Ë¤Ï¡¢ +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëÁ°¤Ë +.B _SVID_SOURCE +¤« +.B _BSD_SOURCE +¤òÄêµÁ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Never use this function. +.\"O Use +.\"O .BR mkstemp (3) +.\"O or +.\"O .BR tmpfile (3) +.\"O instead. +·è¤·¤Æ¤³¤Î´Ø¿ô¤ò»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£Âå¤ï¤ê¤Ë +.BR mkstemp (3) +¤« +.BR tmpfile (3) +¤ò»È¤¦¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mkstemp (3), +.BR mktemp (3), +.BR tempnam (3), +.BR tmpfile (3) diff --git a/draft/man3/toascii.3 b/draft/man3/toascii.3 new file mode 100644 index 00000000..b3d27f58 --- /dev/null +++ b/draft/man3/toascii.3 @@ -0,0 +1,79 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" Copyright (c) 1995 by Jim Van Zandt +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Tue Dec 16 19:43:29 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. +.\" +.\" 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. +.\" +.\" Added BUGS section, aeb, 950919 +.\" +.TH TOASCII 3 2009-03-15 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +toascii \- ʸ»ú¤ò ASCII ¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int toascii(int " "c" ); +.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 toascii (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.SH ÀâÌÀ +.BR toascii () +¤Ï¾å°Ì¥Ó¥Ã¥È¤ò¥¯¥ê¥¢¤¹¤ë»ö¤Ë¤è¤ê¡¢ +ASCII ʸ»ú¥»¥Ã¥È¤ËŬ¹ç¤¹¤ë¤è¤¦¤Ë \fIc\fP ¤ò 7¥Ó¥Ã¥È¤Î \fIunsigned char\fP +¤ËÊÑ´¹¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +ÊÑ´¹¤µ¤ì¤¿Ê¸»ú¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, BSD, POSIX.1-2001. +.\"O POSIX.1-2008 marks +.\"O .BR toascii () +.\"O as obsolete, +.\"O noting that it cannot be used portably in a localized application. +POSIX.1-2008 ¤Ï +.BR toascii () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +¥í¡¼¥«¥é¥¤¥º¤µ¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢°Ü¿¢À­¤ò³ÎÊݤ·¤Ä¤Ä¡¢ +¤³¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Many people will be unhappy if you use this function. +.\"O This function will convert accented letters into random characters. +¤³¤Î´Ø¿ô¤ò»È¤¦»ö¤Ç¤¿¤¯¤µ¤ó¤Î¿Í¡¹¤¬ÉÔ¹¬¤Ë¤Ê¤ë¤À¤í¤¦¡£ +¤³¤Î´Ø¿ô¤Ï¥¢¥¯¥»¥ó¥ÈÉÕ¤­¤Î»ú¤ò¤Ç¤¿¤é¤á¤Êʸ»ú¤ËÊÑ´¹¤·¤Æ¤·¤Þ¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR isascii (3), +.BR tolower (3), +.BR toupper (3) diff --git a/draft/man3/toupper.3 b/draft/man3/toupper.3 new file mode 100644 index 00000000..7f9f04de --- /dev/null +++ b/draft/man3/toupper.3 @@ -0,0 +1,84 @@ +.\" 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:45:39 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2000-02-13 by Nicolas Lichtmaier +.\" +.\" Japanese Version Copyright (c) 1997 Ueyama Rui and HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Fri Aug 29 19:47:32 JST 1997 +.\" by Ueyama Rui +.\" by HIROFUMI Nishizuka +.\" Translated Sun Mar 12 21:42:31 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH TOUPPER 3 1993-04-04 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +toupper, tolower \- ¾®Ê¸»ú¤òÂçʸ»ú¤Ë¤¹¤ë¡£¤Þ¤¿¤ÏÂçʸ»ú¤ò¾®Ê¸»ú¤Ë¤¹¤ë¡£ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int toupper(int " "c" ); +.br +.BI "int tolower(int " "c" ); +.fi +.SH ÀâÌÀ +.BR toupper () +¤Ï¡¢ +.I c +¤¬Âçʸ»ú¤Ë¤Ç¤­¤ëʸ»ú¤Ç¤¢¤ë¤Ê¤é¤ÐÂçʸ»ú¤ËÊÑ´¹¤¹¤ë¡£ +.PP +.BR tolower () +¤Ï +.I c +¤¬¾®Ê¸»ú¤Ë¤Ç¤­¤ëʸ»ú¤Ç¤¢¤ë¤Ê¤é¤Ð¾®Ê¸»ú¤ËÊÑ´¹¤¹¤ë¡£ +.PP +¤â¤· +.I c +¤¬ +.I unsigned char +¤ÎÃͤǤʤ¤¤« +.B EOF +¤Ê¤é¤Ð¡¢¤³¤ì¤é¤Î´Ø¿ô¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +ÊÑ´¹¤¬¤Ç¤­¤ì¤ÐÊÑ´¹¸å¤Îʸ»ú¤òÊÖ¤¹¡£¤Ç¤­¤Ê¤±¤ì¤ÐÊÑ´¹Á°¤Î +.I c +¤òÊÖ¤¹¡£ +.SH ½àµò +C89, C99, 4.3BSD. +.SH ¥Ð¥° +¤Ê¤Ë¤¬Âçʸ»ú¤Ç¤Ê¤Ë¤¬¾®Ê¸»ú¤Ê¤Î¤«¤È¤¤¤¦¤³¤È¤Î¾ÜºÙ¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Ë +°Í¸¤·¤Æ¤¤¤ë¡£¤¿¤È¤¨¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤Î +.B """C""" +¥í¥±¡¼¥ë¤Ç¤Ï¥¦¥à¥é¥¦¥È¤òǧ¼±¤·¤Ê¤¤¤¿¤á¡¢¤½¤ì¤é¤Îʸ»ú¤ÏÊÑ´¹¤Ç¤­¤Ê¤¤¡£ +.PP +.\" ¤Þ¤¿¡¢±Ñ¸ì°Ê³°¤Î¥í¥±¡¼¥ë¤Ç¤Ï¡¢Âçʸ»ú¤È¾®Ê¸»ú¤¬Àµ¤·¤¯Âбþ¤·¤Ê¤¤ +.\" ¤³¤È¤¬¤¢¤ë¡£¤¿¤È¤¨¤Ð¡¢¥É¥¤¥Ä¸ì¤Î¥¨¥¹¥Ä¥§¥Ã¥È¤Ê¤É¤Ç¤¢¤ë¡£ +¤¤¤¯¤Ä¤«¤ÎÈó±Ñ¸ì¥í¥±¡¼¥ë¤Ç¤Ï¡¢Âбþ¤¹¤ëÂçʸ»ú¤ò»ý¤¿¤Ê¤¤¾®Ê¸»ú¤¬Â¸ºß¤¹¤ë¡£ +¥É¥¤¥Ä¸ì¤Î¥¨¥¹¥Ä¥§¥Ã¥È¤¬°ì¤Ä¤ÎÎã¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR isalpha (3), +.BR setlocale (3), +.BR towlower (3), +.BR towupper (3), +.BR locale (7) diff --git a/draft/man3/towctrans.3 b/draft/man3/towctrans.3 new file mode 100644 index 00000000..ecc57a4d --- /dev/null +++ b/draft/man3/towctrans.3 @@ -0,0 +1,80 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 25 08:17:41 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.\" WORD: transliteration descriptor ÊÑ´¹µ­½Ò»Ò +.\" +.TH TOWCTRANS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O towctrans \- wide-character transliteration +towctrans \- ¥ï¥¤¥Éʸ»ú¤ÎÊÑ´¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wint_t towctrans(wint_t " wc ", wctrans_t " desc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O If \fIwc\fP is a wide character, the +.\"O .BR towctrans () +.\"O function +.\"O translates it according to the transliteration descriptor \fIdesc\fP. +.\"O If \fIwc\fP is \fBWEOF\fP, \fBWEOF\fP is returned. +\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð¡¢ +.BR towctrans () +´Ø¿ô¤ÏÊÑ´¹µ­½Ò»Ò +\fIdesc\fP ¤Ë½¾¤Ã¤Æ¤½¤Îʸ»ú¤òÊÑ´¹¤¹¤ë¡£\fIwc\fP ¤¬ \fBWEOF\fP ¤Ê¤é¤Ð¡¢ +\fBWEOF\fP ¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O \fIdesc\fP must be a transliteration descriptor returned by +.\"O the +.\"O .BR wctrans (3) +.\"O function. +\fIdesc\fP ¤Ï¡¢ +.BR wctrans (3) +¤¬ÊÖ¤·¤¿ÊÑ´¹µ­½Ò»Ò¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR towctrans () +.\"O function returns the translated wide character, +.\"O or \fBWEOF\fP if \fIwc\fP is \fBWEOF\fP. +.BR towctrans () +´Ø¿ô¤Ï¡¢ÊÑ´¹·ë²Ì¤Î¥ï¥¤¥Éʸ»ú¤òÊÖ¤¹¡£\fIwc\fP ¤¬ \fBWEOF\fP +¤Ê¤é¤Ð¡¢\fBWEOF\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR towctrans () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR towctrans () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR towlower (3), +.BR towupper (3), +.BR wctrans (3) diff --git a/draft/man3/towlower.3 b/draft/man3/towlower.3 new file mode 100644 index 00000000..6abc51d0 --- /dev/null +++ b/draft/man3/towlower.3 @@ -0,0 +1,82 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 25 08:06:53 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH TOWLOWER 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O towlower \- convert a wide character to lowercase +towlower \- ¥ï¥¤¥Éʸ»ú 1 ¸Ä¤ò¾®Ê¸»ú¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wint_t towlower(wint_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR towlower () +.\"O function is the wide-character equivalent of the +.\"O .BR tolower (3) +.\"O function. +.\"O If \fIwc\fP is a wide character, it is converted to +.\"O lowercase. +.\"O Characters which do not have case are returned unchanged. +.BR towlower () +´Ø¿ô¤Ï¡¢ +.BR tolower (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð¡¢¤³¤Îʸ»ú¤Ï¾®Ê¸»ú¤ËÊÑ´¹¤µ¤ì¤ë¡£ +Âçʸ»ú¡¦¾®Ê¸»ú¤Î¶èÊ̤¬¤Ê¤¤Ê¸»ú¤ÏÊÑ´¹¤µ¤ì¤º¤ËÊÖ¤µ¤ì¤ë¡£ +.\"O If \fIwc\fP is \fBWEOF\fP, \fBWEOF\fP is returned. +\fIwc\fP ¤¬ \fBWEOF\fP ¤Ê¤é¤Ð¡¢\fBWEOF\fP ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR towlower () +.\"O function returns the lowercase equivalent of \fIwc\fP, +.\"O or \fBWEOF\fP if \fIwc\fP is \fBWEOF\fP. +.BR towlower () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤ËÂбþ¤¹¤ë¾®Ê¸»ú¤òÊÖ¤¹¡£\fIwc\fP ¤¬ +\fBWEOF\fP ¤Ê¤é¤Ð¡¢\fBWEOF\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR towlower () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR towlower () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.\"O This function is not very appropriate for dealing with Unicode characters, +.\"O because Unicode knows about three cases: upper, lower and title case. +¤³¤Î´Ø¿ô¤ò Unicode ʸ»ú¤ËÂФ·¤Æ»È¤¦¤Î¤Ï¤¢¤Þ¤êŬÀڤǤʤ¤¡£¤Ê¤¼¤Ê¤é¡¢ +Unicode ¤Ë¤Ï¡¢Âçʸ»ú (upper case)¡¦¾®Ê¸»ú (lower case)¡¦ +¥¿¥¤¥È¥ëʸ»ú (title case) ¤È¤¤¤¦ 3 ¤Ä¤Î "case" ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iswlower (3), +.BR towctrans (3), +.BR towupper (3) diff --git a/draft/man3/towupper.3 b/draft/man3/towupper.3 new file mode 100644 index 00000000..ed89538d --- /dev/null +++ b/draft/man3/towupper.3 @@ -0,0 +1,81 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 25 08:16:12 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH TOWUPPER 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O towupper \- convert a wide character to uppercase +towupper \- ¥ï¥¤¥Éʸ»ú 1 ¸Ä¤òÂçʸ»ú¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wint_t towupper(wint_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR towupper () +.\"O function is the wide-character equivalent of the +.\"O .BR toupper (3) +.\"O function. +.\"O If \fIwc\fP is a wide character, it is converted to +.\"O uppercase. +.\"O Characters which do not have case are returned unchanged. +.BR towupper () +´Ø¿ô¤Ï¡¢ +.BR toupper (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð¡¢¤³¤Îʸ»ú¤ÏÂçʸ»ú¤ËÊÑ´¹¤µ¤ì¤ë¡£ +Âçʸ»ú¡¦¾®Ê¸»ú¤Î¶èÊ̤¬¤Ê¤¤Ê¸»ú¤ÏÊÑ´¹¤µ¤ì¤º¤ËÊÖ¤µ¤ì¤ë¡£ +.\"O If \fIwc\fP is \fBWEOF\fP, \fBWEOF\fP is returned. +\fIwc\fP ¤¬ \fBWEOF\fP ¤Ê¤é¤Ð¡¢\fBWEOF\fP ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR towupper () +.\"O function returns the uppercase equivalent of \fIwc\fP, +.\"O or \fBWEOF\fP if \fIwc\fP is \fBWEOF\fP. +.BR towupper () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤ËÂбþ¤¹¤ëÂçʸ»ú¤òÊÖ¤¹¡£\fIwc\fP ¤¬ +\fBWEOF\fP ¤Ê¤é¤Ð¡¢\fBWEOF\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR towupper () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +\fBtowlower\fP ¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.\"O This function is not very appropriate for dealing with Unicode characters, +.\"O because Unicode knows about three cases: upper, lower and title case. +¤³¤Î´Ø¿ô¤ò Unicode ʸ»ú¤ËÂФ·¤Æ»È¤¦¤Î¤Ï¤¢¤Þ¤êŬÀڤǤʤ¤¡£¤Ê¤¼¤Ê¤é¡¢ +Unicode ¤Ë¤Ï¡¢Âçʸ»ú (upper case)¡¦¾®Ê¸»ú (lower case)¡¦ +¥¿¥¤¥È¥ëʸ»ú (title case) ¤È¤¤¤¦ 3 ¤Ä¤Î "case" ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iswupper (3), +.BR towctrans (3), +.BR towlower (3) diff --git a/draft/man3/trunc.3 b/draft/man3/trunc.3 new file mode 100644 index 00000000..7aadda0a --- /dev/null +++ b/draft/man3/trunc.3 @@ -0,0 +1,113 @@ +.\" 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) 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 2008-08-11 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O trunc, truncf, truncl \- round to integer, towards zero +trunc, truncf, truncl \- 0 ¤Ë¶á¤¤Êý¤ÎÀ°¿ôÃͤ˴ݤá¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double trunc(double " x ); +.br +.BI "float truncf(float " x ); +.br +.BI "long double truncl(long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR trunc (), +.BR truncf (), +.BR truncl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"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" +.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 +.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 +¤Ê¤É) ¤Ë³ÊǼ¤¹¤ë¤Ë¤ÏÂ礭²á¤®¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Î·ë²Ì¤Ïʬ¤«¤é¤Ê¤¤¤Î¤Ç¡¢ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òÈò¤±¤ë¤¿¤á¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤ÏÀ°¿ô·¿¤ËÂåÆþ¤¹¤ëÁ°¤Ë +ÊÖ¤µ¤ì¤¿ÃͤÎÈϰϳÎǧ¤ò¼Â¹Ô¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ceil (3), +.BR floor (3), +.BR lrint (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3) diff --git a/draft/man3/tsearch.3 b/draft/man3/tsearch.3 new file mode 100644 index 00000000..88838130 --- /dev/null +++ b/draft/man3/tsearch.3 @@ -0,0 +1,382 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" Copyright 1995 by Jim Van Zandt +.\" +.\" 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 ishikawa, keisuke +.\" all rights reserved. +.\" Translated Tue Mar 9 08:21:04 JST 1999 +.\" by ishikawa, keisuke +.\" Updated & Modified Sun Jan 20 11:31:46 JST 2002 +.\" by Yuichi SATO +.\" +.TH TSEARCH 3 2008-09-23 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O tsearch, tfind, tdelete, twalk, tdestroy \- manage a binary tree +tsearch, tfind, tdelete, twalk, tdestroy \- ÆóʬÌÚ (binary tree) ¤ÎÁàºî +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *tsearch(const void *" key ", void **" rootp , +.BI " int (*" compar ")(const void *, const void *));" +.sp +.BI "void *tfind(const void *" key ", const void **" rootp , +.BI " int (*" compar ")(const void *, const void *));" +.sp +.BI "void *tdelete(const void *" key ", void **" rootp , +.BI " int (*" compar ")(const void *, const void *));" +.sp +.BI "void twalk(const void *" root ", void (*" action ")(const void *" nodep , +.BI " const VISIT " which , +.BI " const int " depth "));" +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "void tdestroy(void *" root ", void (*" free_node ")(void *" nodep )); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR tsearch (), +.\"O .BR tfind (), +.\"O .BR twalk (), +.\"O and +.\"O .BR tdelete () +.\"O manage a +.\"O binary tree. +.\"O They are generalized from Knuth (6.2.2) Algorithm T. +.\"O The first field in each node of the tree is a pointer to the +.\"O corresponding data item. +.\"O (The calling program must store the actual data.) +.\"O \fIcompar\fP points to a comparison routine, which takes +.\"O pointers to two items. +.\"O It should return an integer which is negative, +.\"O zero, or positive, depending on whether the first item is less than, +.\"O equal to, or greater than the second. +.BR tsearch (), +.BR tfind (), +.BR twalk (), +.BR tdelete () +¤Ï +ÆóʬÌÚ¤òÁàºî¤¹¤ë´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï Knuth (6.2.2) Algorithm T ¤Ë´ð¤Å¤¤¤Æ¤¤¤ë¡£ +ÌÚ¹½Â¤¤Ë¤ª¤±¤ë³Æ¥Î¡¼¥É¤ÎºÇ½é¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢Âбþ¤¹¤ë¥Ç¡¼¥¿¡¦ +¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +(»²¾ÈÀè¤Î¥Ç¡¼¥¿¤Ï¡¢¸Æ¤Ó½Ð¤·¥×¥í¥°¥é¥à¤ÇÍÑ°Õ¤¹¤ë¡£) +\fIcompar\fP ¤ÏÈæ³Ó¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +Èæ³Ó¥ë¡¼¥Á¥ó¤Ï¡¢¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿ 2 ¤Ä¤ò°ú¿ô¤Ë»ý¤Ä¡£ +Èæ³Ó¥ë¡¼¥Á¥ó¤ÎÊÖ¤êÃͤϡ¢1 ¤ÄÌܤΥ¢¥¤¥Æ¥à¤¬ 2 ¤ÄÌܤΥ¢¥¤¥Æ¥à¤è¤ê¤â +¡Ö¾®¤µ¤¤¡¢Åù¤·¤¤¡¢Â礭¤¤¡×¤Ë¤è¤Ã¤Æ¡¢ +¡ÖÉé¡¢0¡¢Àµ¡×¤ÎÀ°¿ôÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O .BR tsearch () +.\"O searches the tree for an item. +.\"O \fIkey\fP points to the item to be searched for. +.\"O \fIrootp\fP points to a +.\"O variable which points to the root of the tree. +.\"O If the tree is empty, +.\"O then the variable that \fIrootp\fP points to should be set to NULL. +.\"O If the item is found in the tree, then +.\"O .BR tsearch () +.\"O returns a pointer +.\"O to it. +.\"O If it is not found, then +.\"O .BR tsearch () +.\"O adds it, and returns a +.\"O pointer to the newly added item. +.BR tsearch () +¤Ï¡¢ÌÚ¹½Â¤¤«¤é¥¢¥¤¥Æ¥à¤ò¸¡º÷¤¹¤ë´Ø¿ô¤Ç¤¢¤ë¡£ +\fIkey\fP ¤Ï¡¢¸¡º÷¤¹¤ë¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +\fIrootp\fP ¤ÏÌÚ¹½Â¤¤Îº¬¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +ÌÚ¹½Â¤¤¬¥Î¡¼¥É¤ò´Þ¤Þ¤Ê¤¤¾ì¹ç¡¢\fIrootp\fP ¤Î»²¾È¤·¤Æ¤¤¤ëÊÑ¿ô¤Ï +NULL ¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ÌÚ¹½Â¤¤Ë¥¢¥¤¥Æ¥à¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¡¢ +.BR tsearch () +¤Ï¤½¤Î¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢¥¢¥¤¥Æ¥à¤òÌÚ¹½Â¤¤ËÄɲä·¡¢ +Äɲä·¤¿¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.\"O .BR tfind () +.\"O is like +.\"O .BR tsearch (), +.\"O except that if the item is not +.\"O found, then +.\"O .BR tfind () +.\"O returns NULL. +.BR tfind () +¤Ï¡¢ +.BR tsearch () +¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ +¥¢¥¤¥Æ¥à¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç NULL ¤òÊÖ¤¹ÅÀ¤¬°Û¤Ê¤ë¡£ +.PP +.\"O .BR tdelete () +.\"O deletes an item from the tree. +.\"O Its arguments are the same as for +.\"O .BR tsearch (). +.BR tdelete () +¤ÏÌÚ¹½Â¤¤«¤é¥¢¥¤¥Æ¥à¤òºï½ü¤¹¤ë¡£ +°ú¿ô¤Ï +.BR tsearch () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.PP +.\"O .BR twalk () +.\"O performs depth-first, left-to-right traversal of a binary +.\"O tree. +.\"O \fIroot\fP points to the starting node for the traversal. +.\"O If that node is not the root, then only part of the tree will be visited. +.\"O .BR twalk () +.\"O calls the user function \fIaction\fP each time a node is +.\"O visited (that is, three times for an internal node, and once for a +.\"O leaf). +.\"O \fIaction\fP, in turn, takes three arguments. +.\"O The first is a pointer to the node being visited. +.\"O The second is an integer which +.\"O takes on the values \fBpreorder\fP, \fBpostorder\fP, and +.\"O \fBendorder\fP depending on whether this is the first, second, or +.\"O third visit to the internal node, or \fBleaf\fP if it is the single +.\"O visit to a leaf node. +.\"O (These symbols are defined in \fI\fP.) +.\"O The third argument is the depth of the node, with +.\"O zero being the root. +.BR twalk () +¤Ï¡¢ÆóʬÌÚ¤ò¿¼¤µÍ¥Àè (depth-first) ¤Ç¡¢ +º¸¤«¤é±¦¤Ë¤¿¤É¤Ã¤Æ¤¤¤¯´Ø¿ô¤Ç¤¢¤ë¡£ +\fIroot\fP ¤Ïµ¯ÅÀ¤È¤Ê¤ë¥Î¡¼¥É¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +\fIroot\fP ¤Ëº¬°Ê³°¤Î¥Î¡¼¥É¤ò»ØÄꤹ¤ë¤È¡¢ÉôʬÌÚ¤¬ÂоݤȤʤ롣 +.BR twalk () +¤Ï¡¢¥Î¡¼¥É¤òˬ¤ì¤ëÅÙ¤Ë +(¤Ä¤Þ¤ê¡¢ÆâÉô¥Î¡¼¥É¤ËÂФ·¤Æ¤Ï 3 ²ó¡¢ÍÕ¤ËÂФ·¤Æ¤Ï 1 ²ó) +¥æ¡¼¥¶´Ø¿ô \fIaction\fP ¤ò¸Æ¤Ó½Ð¤¹¡£ +\fIaction\fP ¤Ë¤Ï°Ê²¼¤Î½ç¤Ë 3 ¤Ä¤Î°ú¿ô¤¬Í¿¤¨¤é¤ì¤ë¡£ +ºÇ½é¤Î°ú¿ô¤Ïˬ¤ì¤¿¥Î¡¼¥É¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +2 ¤ÄÌܤΰú¿ô¤Ë¤Ï¡¢ÆâÉô¥Î¡¼¥É¤Î¾ì¹ç¤ÏˬÌä²ó¿ô¤Ë±þ¤¸¤Æ +\fBpreorder\fP, \fBpostorder\fP, \fBendorder\fP ¤¬¡¢ +Íդξì¹ç¤Ï \fBleaf\fP ¤¬Í¿¤¨¤é¤ì¤ë¡£ +(¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤Ï \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£) +3 ¤ÄÌܤΰú¿ô¤Ï¥Î¡¼¥É¤Î¿¼¤µ¤Ç¡¢º¬¤Î¾ì¹ç¤Ï 0 ¤Ç¤¢¤ë¡£ +.PP +.\"O (More commonly, \fBpreorder\fP, \fBpostorder\fP, and \fBendorder\fP +.\"O are known as \fBpreorder\fP, \fBinorder\fP, and \fBpostorder\fP: +.\"O before visiting the children, after the first and before the second, +.\"O and after visiting the children. +.\"O Thus, the choice of name \fBpost\%order\fP +.\"O is rather confusing.) +(¤è¤ê°ìÈÌŪ¤Ë¤Ï¡¢\fBpreorder\fP, \fBpostorder\fP, \fBendorder\fP ¤Ï +\fBpreorder\fP, \fBinorder\fP, \fBpostorder\fP ¤È¤·¤ÆÃΤé¤ì¤Æ¤¤¤ë: +¤½¤ì¤¾¤ì¡¢»ÒÍ×ÁǤòé¤ëÁ°¡¦ºÇ½é¤Î»ÒÍ×ÁǤòé¤Ã¤¿¸å¤«¤Ä 2 ÈÖÌܤλÒÍ×ÁǤòé¤ëÁ°¡¦ +»ÒÍ×ÁǤòé¤Ã¤¿¸å¤È¤¤¤¦¤³¤È¤òɽ¤·¤Æ¤¤¤ë¡£ +¤è¤Ã¤Æ \fBpost\%order\fP ¤È¤¤¤¦Ì¾Á°¤òÁª¤Ö¤Î¤Ï¾¯¤·Ê¶¤é¤ï¤·¤¤¡£) +.PP +.\"O .BR tdestroy () +.\"O removes the whole tree pointed to by \fIroot\fP, +.\"O freeing all resources allocated by the +.\"O .BR tsearch () +.\"O function. +.\"O For the data in each tree node the function \fIfree_node\fP is called. +.\"O The pointer to the data is passed as the argument to the function. +.\"O If no such work is necessary \fIfree_node\fP must point to a function +.\"O doing nothing. +.BR tdestroy () +¤Ï \fIroot\fP ¤¬»Ø¤¹ÌÚ¹½Â¤Á´ÂΤòºï½ü¤·¡¢ +.BR tsearch () +´Ø¿ô¤Ç³ÎÊݤµ¤ì¤¿¥ê¥½¡¼¥¹¤òÁ´¤Æ²òÊü¤¹¤ë¡£ +ÌÚ¹½Â¤¤Î³Æ¥Î¡¼¥É¤Ë¤Ä¤¤¤Æ¡¢´Ø¿ô \fIfree_node\fP ¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬¤³¤Î´Ø¿ô¤Î°ú¿ô¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +¤½¤Î¤è¤¦¤ÊÆ°ºî¤¬É¬ÍפǤʤ±¤ì¤Ð¡¢ +\fIfree_node\fP ¤Ï²¿¤â¤·¤Ê¤¤´Ø¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR tsearch () +.\"O returns a pointer to a matching item in the tree, or to +.\"O the newly added item, or NULL if there was insufficient memory +.\"O to add the item. +.\"O .BR tfind () +.\"O returns a pointer to the item, or +.\"O NULL if no match is found. +.\"O If there are multiple elements that match the key, +.\"O the element returned is unspecified. +.BR tsearch () +¤Ï¡¢ÌÚ¹½Â¤¤Ë¸«¤Ä¤«¤Ã¤¿¥¢¥¤¥Æ¥à¤«¡¢ +¿·¤·¤¯Äɲä·¤¿¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥á¥â¥ê¤ÎÉÔ­¤Î¤¿¤á¥¢¥¤¥Æ¥à¤òÄɲäǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.BR tfind () +¤Ï¡¢¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +°ìÃפ¹¤ë¥¢¥¤¥Æ¥à¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +¸¡º÷¾ò·ï¤Ë°ìÃפ¹¤ëÍ×ÁǤ¬Ê£¿ô¤¢¤ë¾ì¹ç¡¢ÊÖ¤µ¤ì¤ëÃͤÏÉÔÄê¤Ç¤¢¤ë¡£ +.PP +.\"O .BR tdelete () +.\"O returns a pointer to the parent of the item deleted, or +.\"O NULL if the item was not found. +.BR tdelete () +¤Ïºï½ü¤·¤¿¥¢¥¤¥Æ¥à¤Î¿Æ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¢¥¤¥Æ¥à¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.PP +.\"O .BR tsearch (), +.\"O .BR tfind (), +.\"O and +.\"O .BR tdelete () +.\"O also +.\"O return NULL if \fIrootp\fP was NULL on entry. +\fIrootp\fP ¤¬ NULL ¤Î¾ì¹ç¡¢ +.BR tsearch (), +.BR tfind (), +.BR tdelete () +¤Ï NULL ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O The function +.\"O .BR tdestroy () +.\"O is a GNU extension. +´Ø¿ô +.BR tdestroy () +¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O .BR twalk () +.\"O takes a pointer to the root, while the other functions +.\"O take a pointer to a variable which points to the root. +.BR twalk () +¤Ïº¬¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò°ú¿ô¤Ë¤È¤ë¤¬¡¢ +¤Û¤«¤Î´Ø¿ô¤Ïº¬¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.PP +.\"O .BR twalk () +.\"O uses \fBpostorder\fP to mean "after the left subtree, but +.\"O before the right subtree". +.\"O Some authorities would call this +.\"O "inorder", and reserve "postorder" to mean "after both subtrees". +.BR twalk () +¤Ë¤ª¤¤¤Æ¤Ï¡¢\fBpostorder\fP ¤Ï +¡Öº¸¤ÎÉôʬÌڤθå¤Ç¡¢±¦¤ÎÉôʬÌÚ¤ÎÁ°¡×¤ò°ÕÌ£¤·¤Æ¤¤¤ë¡£ +¤·¤«¤·¡¢¿Í¤Ë¤è¤Ã¤Æ¤Ï¤³¤ì¤ò "inorder" ¤È¸Æ¤ó¤Ç¡¢ +"postorder" ¤ò¡ÖξÊý¤ÎÉôʬÌڤθå¡×¤È¤¹¤ë¾ì¹ç¤â¤¢¤ë¡£ +.PP +.\"O .BR tdelete () +.\"O frees the memory required for the node in the tree. +.\"O The user is responsible for freeing the memory for the corresponding +.\"O data. +.BR tdelete () +¤Ï¡¢ºï½ü¤·¤¿¥Î¡¼¥É¤Î»ÈÍѤ·¤Æ¤¤¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë¤¬¡¢ +¥Î¡¼¥É¤ËÂбþ¤¹¤ë¥Ç¡¼¥¿¤Î¥á¥â¥ê¤Ï¡¢¥æ¡¼¥¶¤¬²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The example program depends on the fact that +.\"O .BR twalk () +.\"O makes no +.\"O further reference to a node after calling the user function with +.\"O argument "endorder" or "leaf". +.\"O This works with the GNU library +.\"O implementation, but is not in the System V documentation. +²¼¤Î¥×¥í¥°¥é¥àÎã¤Ï¡¢¥æ¡¼¥¶´Ø¿ô¤¬ "endorder" ¤« "leaf" ¤ò°ú¿ô¤Ë¤·¤Æ +¸Æ¤Ó½Ð¤µ¤ì¤Æ°Ê¹ß¤Ï¡¢ +.BR twalk () +¤¬¤½¤Î¥Î¡¼¥É¤ò»²¾È¤·¤Ê¤¤¤³¤È¤òÁ°Äó¤È¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï GNU ¥é¥¤¥Ö¥é¥ê¤Î¼ÂÁõ¤Ç¤Ïµ¡Ç½¤¹¤ë¤¬¡¢System V ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤Ï¸ºß¤·¤Ê¤¤¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The following program inserts twelve random numbers into a binary +.\"O tree, where duplicate numbers are collapsed, then prints the numbers +.\"O in order. +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï 12 ¸Ä¤ÎÍð¿ô¤òÆóʬÌÚ¤ËÁÞÆþ¤·¤¿¸å¡¢ +ÁÞÆþ¤·¤¿¿ô¤ò½çÈ֤˽ÐÎϤ¹¤ë (ÁÞÆþ¤ÎºÝ¡¢½ÅÊ£¤·¤¿Íð¿ô¤Ï 1 ¤Ä¤Ë¤Þ¤È¤á¤é¤ì¤ë)¡£ +.sp +.nf +#define _GNU_SOURCE /* Expose declaration of tdestroy() */ +#include +#include +#include +#include + +void *root = NULL; + +void * +xmalloc(unsigned n) +{ + void *p; + p = malloc(n); + if (p) + return p; + fprintf(stderr, "insufficient memory\\n"); + exit(EXIT_FAILURE); +} + +int +compare(const void *pa, const void *pb) +{ + if (*(int *) pa < *(int *) pb) + return \-1; + if (*(int *) pa > *(int *) pb) + return 1; + return 0; +} + +void +action(const void *nodep, const VISIT which, const int depth) +{ + int *datap; + + switch (which) { + case preorder: + break; + case postorder: + datap = *(int **) nodep; + printf("%6d\\n", *datap); + break; + case endorder: + break; + case leaf: + datap = *(int **) nodep; + printf("%6d\\n", *datap); + break; + } +} + +int +main(void) +{ + int i, *ptr; + void *val; + + srand(time(NULL)); + for (i = 0; i < 12; i++) { + ptr = (int *) xmalloc(sizeof(int)); + *ptr = rand() & 0xff; + val = tsearch((void *) ptr, &root, compare); + if (val == NULL) + exit(EXIT_FAILURE); + else if ((*(int **) val) != ptr) + free(ptr); + } + twalk(root, action); + tdestroy(root, free); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bsearch (3), +.BR hsearch (3), +.BR lsearch (3) +.BR qsort (3), +.BR feature_test_macros (7) diff --git a/draft/man3/ttyname.3 b/draft/man3/ttyname.3 new file mode 100644 index 00000000..27f81994 --- /dev/null +++ b/draft/man3/ttyname.3 @@ -0,0 +1,109 @@ +.\" Copyright (c) 1995 Jim Van Zandt +.\" +.\" 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 2001-12-13, Martin Schulze +.\" Added ttyname_r, aeb, 2002-07-20 +.\" +.\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya +.\" all rights reserved. +.\" Translated Mon Feb 10 1997 by Hiroaki Nagoya +.\" Updated Fri Dec 21 JST 2001 by Kentaro Shirakata +.\" Updated Fri Oct 16 JST 2002 by Kentaro Shirakata +.\" +.TH TTYNAME 3 2008-07-14 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +.\"O ttyname, ttyname_r \- return name of a terminal +ttyname, ttyname_r \- üËö̾¤òÊÖ¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *ttyname(int " fd ); + +.BI "int ttyname_r(int " fd ", char *" buf ", size_t " buflen ); +.fi +.SH ÀâÌÀ +.\"O The function +.\"O .BR ttyname () +.\"O returns a pointer to the null-terminated pathname of the terminal device +.\"O that is open on the file descriptor \fIfd\fP, or NULL on error +.\"O (for example, if \fIfd\fP is not connected to a terminal). +.\"O The return value may point to static data, possibly overwritten by the +.\"O next call. +.BR ttyname () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ \fIfd\fP ¤¬¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ëüËö¥Ç¥Ð¥¤¥¹¤Î +NULL ½ªÃ¼¤µ¤ì¤¿¥Ñ¥¹Ì¾¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤­¤¿¤Ê¤é¤Ð NULL ¤òÊÖ¤¹ +(¤¿¤È¤¨¤Ð¡¢\fIfd\fP ¤¬Ã¼Ëö¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¤È¤­)¡£ +ÊÖ¤êÃͤÏÀÅŪ¥Ç¡¼¥¿¤ò»Ø¤·¤Æ¤¤¤ë¤Î¤Ç¡¢¼¡¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.\"O The function +.\"O .BR ttyname_r () +.\"O stores this pathname in the buffer +.\"O .I buf +.\"O of length +.\"O .IR buflen . +.BR ttyname_r () +´Ø¿ô¤Ï¡¢¤³¤Î¥Ñ¥¹Ì¾¤òŤµ +.I buflen +¤Î¥Ð¥Ã¥Õ¥¡ +.I buf +¤Ë³ÊǼ¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The function +.\"O .BR ttyname () +.\"O returns a pointer to a pathname on success. +.\"O On error, NULL is returned, and +.\"O .I errno +.\"O is set appropriately. +.BR ttyname () +´Ø¿ô¤Ï¡¢À®¸ù»þ¤Ï¥Ñ¥¹Ì¾¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼»þ¤Ï NULL ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O The function +.\"O .BR ttyname_r () +.\"O returns 0 on success, and an error number upon error. +.BR ttyname_r () +´Ø¿ô¤Ï¡¢À®¸ù»þ¤Ë¤Ï 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼»þ¤Ë¤Ï¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.BR ttyname_r (): +.TP +.B EBADF +.\"O Bad file descriptor. +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¡£ +.TP +.B ENOTTY +.\"O File descriptor does not refer to a terminal device. +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Ã¼Ëö¥Ç¥Ð¥¤¥¹¤ò¼¨¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ERANGE +.\"O .I buflen +.\"O was too small to allow storing the pathname. +.I buflen +¤¬¥Ñ¥¹Ì¾¤ò³ÊǼ¤¹¤ë¤Ë¤Ïû¤¹¤®¤ë¡£ +.SH ½àµò +4.2BSD, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR fstat (2), +.BR isatty (3) diff --git a/draft/man3/ttyslot.3 b/draft/man3/ttyslot.3 new file mode 100644 index 00000000..a4525f49 --- /dev/null +++ b/draft/man3/ttyslot.3 @@ -0,0 +1,257 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Wed Sep 8 01:25:01 JST 2004 +.\" by Yuichi SATO +.\" +.TH TTYSLOT 3 2007-11-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ttyslot \- find the slot of the current user's terminal in some file +ttyslot \- ¥«¥ì¥ó¥È¥æ¡¼¥¶¤ÎüËö¤Î¥¹¥í¥Ã¥È¤ò¥Õ¥¡¥¤¥ë¤«¤éõ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.\"O .BR "#include " " /* on BSD-like systems, and Linux */" +.BR "#include " " /* BSD ·Ï¤Î¥·¥¹¥Æ¥à¤È Linux ¤Î¾ì¹ç */" +.br +.\"O .BR "#include " " /* on System V-like systems */" +.BR "#include " " /* System V ·Ï¤Î¥·¥¹¥Æ¥à¤Î¾ì¹ç */" +.sp +.B "int ttyslot(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 +.ad l +.BR ttyslot (): +_BSD_SOURCE || (_XOPEN_SOURCE_EXTENDED && !\ _XOPEN_SOURCE\ >=\ 500) +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The legacy function +.\"O .BR ttyslot () +.\"O returns the index of the current user's entry in some file. +¥ì¥¬¥·¡¼¤Ê´Ø¿ô +.BR ttyslot () +¤Ï¡¢¤¢¤ë¥Õ¥¡¥¤¥ë¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥«¥ì¥ó¥È¥æ¡¼¥¶¤Î¥¨¥ó¥È¥ê¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÖ¤¹¡£ +.LP +.\"O Now "What file?" you ask. +.\"O Well, let's first look at some history. +¡Ö¤É¤Î¥Õ¥¡¥¤¥ë¤Ê¤Î¤«¡©¡×¤È¤¤¤¦¼ÁÌ䤬¤¢¤ë¤À¤í¤¦¡£ +¤Ç¤Ï¡¢¤Þ¤ººÇ½é¤Ë¤½¤ÎÎò»Ë¤ò¸«¤Æ¤ß¤è¤¦¡£ +.\"O .SS "Ancient History" +.SS ÂçÀΤÎÎò»Ë +.\"O There used to be a file +.\"O .I /etc/ttys +.\"O in Unix V6, that was read by the +.\"O .BR init (8) +.\"O program to find out what to do with each terminal line. +Unix V6 ¤Ç¤Ï +.I /etc/ttys +¥Õ¥¡¥¤¥ë¤¬»È¤ï¤ì¤Æ¤¤¤¿¡£ +.BR init (8) +¥×¥í¥°¥é¥à¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤ß¡¢ +³ÆüËö¹Ô¤Ç²¿¤ò¤¹¤Ù¤­¤«¤òõ¤¹¡£ +.\"O Each line consisted of three characters. +³Æ¹Ô¤Ï 3 ʸ»ú¤«¤é¹½À®¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O The first character was either \(aq0\(aq or \(aq1\(aq, +.\"O where \(aq0\(aq meant "ignore". +1 ʸ»úÌÜ¤Ï \(aq0\(aq ¤Þ¤¿¤Ï \(aq1\(aq ¤Ç¤¢¤ê¡¢ +\(aq0\(aq ¤Ï¡Ö̵»ë¤¹¤ë¡×¤³¤È¤òɽ¤¹¡£ +.\"O The second character denoted the terminal: \(aq8\(aq stood for "/dev/tty8". +2 ʸ»úÌܤÏüËö¤ò¼¨¤¹: \(aq8\(aq ¤Ï "/dev/tty8" ¤òɽ¤¹¡£ +.\"O The third character was an argument to +.\"O .BR getty (8) +.\"O indicating the sequence of line speeds to try (\(aq\-\(aq was: start trying +.\"O 110 baud). +.\"O Thus a typical line was "18\-". +3 ʸ»úÌÜ¤Ï +.BR getty (8) +¤Ø¤Î°ú¤­¿ô¤Ç¤¢¤ê¡¢(Àܳ¤ò) »î¤ß¤ë²óÀþ®Å٤νç½ø¤òɽ¤¹ +(\(aq\-\(aq ¤Ï 110 ¥Ü¡¼¤ÇÀܳ¤Î»î¹Ô¤ò³«»Ï¤¹¤ë¤³¤È¤òɽ¤¹)¡£ +¤è¤Ã¤Æ°ìÈÌŪ¤Ê¹Ô¤Ï "18\-" ¤È¤Ê¤ë¡£ +.\"O A hang on some line was solved by changing the \(aq1\(aq to a \(aq0\(aq, +.\"O signaling init, changing back again, and signaling init again. +¤¢¤ë¹Ô¤Ç¥Ï¥ó¥°¤·¤¿¾ì¹ç¤Ï¡¢\(aq1\(aq ¤ò \(aq0\(aq ¤ËÊѹ¹¤·¡¢ +init ¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ê¡¢\(aq0\(aq ¤ò \(aq1\(aq ºÆÅÙ¤ËÊѹ¹¤·¡¢ +init ¤ËºÆÅÙ¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤Ç²ò·è¤¹¤ë¡£ +.LP +.\"O In Unix V7 the format was changed: here the second character +.\"O was the argument to +.\"O .BR getty (8) +.\"O indicating the sequence of line speeds to try (\(aq0\(aq was: cycle through +.\"O 300-1200-150-110 baud; \(aq4\(aq was for the on-line console DECwriter) +.\"O while the rest of the line contained the name of the tty. +.\"O Thus a typical line was "14console". +Unix V7 ¤Ç¤Ï¥Õ¥©¡¼¥Þ¥Ã¥È¤¬Êѹ¹¤µ¤ì¤¿: +2 ʸ»úÌܤ¬ +.BR getty (8) +¤Î°ú¤­¿ô¤È¤Ê¤ê¡¢(Àܳ¤ò) »î¤ß¤ë²óÀþ®Å٤νç½ø¤òɽ¤¹¤è¤¦¤Ë¤Ê¤ê +(\(aq0\(aq ¤Ï 300-1200-150-110 ¤ò·«¤êÊÖ¤¹¤³¤È¤òɽ¤·¡¢ +\(aq4\(aq ¤Ï¥ª¥ó¥é¥¤¥ó¥³¥ó¥½¡¼¥ë DECwriter ¤òɽ¤¹)¡¢ +¹Ô¤Î»Ä¤ê (¤Îʸ»ú) ¤ÏüËö̾¤È¤Ê¤Ã¤¿¡£ +¤è¤Ã¤Æ¡¢°ìÈÌŪ¤Ê¹Ô¤Ï "14console" ¤È¤Ê¤ë¡£ +.LP +.\"O Later systems have more elaborate syntax. +¸å¼Ô¤Î¥·¥¹¥Æ¥à¤Î½ñ¼°¤Ï¡¢¤è¤êÀº¹ª¤Ç¤¢¤ë¡£ +.\"O System V-like systems have +.\"O .I /etc/inittab +.\"O instead. +System V ·Ï¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢Âå¤ï¤ê¤Ë +.I /etc/inittab +¤¬¤¢¤ë¡£ +.\"O .SS "Ancient History (2)" +.SS "ÂçÀΤÎÎò»Ë (2)" +.\"O On the other hand, there is the file +.\"O .I /etc/utmp +.\"O listing the people currently logged in. +.\"O It is maintained by +.\"O .BR login (1). +°ìÊý¡¢¸½ºß¥í¥°¥¤¥ó¤·¤Æ¤¤¤ë¿Í¤ò¥ê¥¹¥È¤¹¤ë¥Õ¥¡¥¤¥ë +.I /etc/utmp +¤¬¤¢¤ë¡£ +¤³¤ì¤Ï +.BR login (1) +¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O It has a fixed size, and the appropriate index in the file was +.\"O determined by +.\"O .BR login (1) +.\"O using the +.\"O .BR ttyslot () +.\"O call to find the number of the line in +.\"O .I /etc/ttys +.\"O (counting from 1). +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¸ÇÄꤵ¤ì¤¿¥µ¥¤¥º¤Ç¤¢¤ê¡¢¥Õ¥¡¥¤¥ëÆâ¤ÎŬÀڤʥ¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¡¢ +.BR login (1) +¤Ë¤è¤Ã¤Æ·èÄꤵ¤ì¤ë¡£ +¤³¤ÎºÝ¤Ë +.BR ttyslot () +¤¬¸Æ¤Ð¤ì¤Æ¡¢ +.I /etc/ttys +¤Ë¤ª¤±¤ë¹ÔÈÖ¹æ¤ò¸«¤Ä¤±¤ë (¹ÔÈÖ¹æ¤Ï 1 ¤«¤é¿ô¤¨¤ë)¡£ +.\"O .SS "The semantics of ttyslot" +.SS "ttyslot ¤Î°ÕÌ£" +.\"O Thus, the function +.\"O .BR ttyslot () +.\"O returns the index of the controlling terminal of the calling process +.\"O in the file +.\"O .IR /etc/ttys , +.\"O and that is (usually) the same as the index of the entry for the +.\"O current user in the file +.\"O .IR /etc/utmp . +¤è¤Ã¤Æ¡¢´Ø¿ô +.BR ttyslot () +¤Ï¡¢¥Õ¥¡¥¤¥ë +.I /etc/ttys +¤Ë¤ª¤±¤ë¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÖ¤¹¡£ +¤³¤ì¤Ï +.I /etc/utmp +¤Ë¤ª¤±¤ë¥«¥ì¥ó¥È¥æ¡¼¥¶¤Î¥¨¥ó¥È¥ê¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤È (Ä̾ï¤Ï) Åù¤·¤¤¡£ +.\"O BSD still has the +.\"O .I /etc/ttys +.\"O file, but System V-like systems do not, and hence cannot refer to it. +BSD ¤Ë¤Ï̤¤À¤Ë +.I /etc/ttys +¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¤¬¡¢System V ·Ï¤Î¥·¥¹¥Æ¥à¤Ë¤Ï¤Ê¤¤¤Î¤Ç¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\"O Thus, on such systems the documentation says that +.\"O .BR ttyslot () +.\"O returns the current user's index in the user accounting data base. +¤è¤Ã¤Æ¡¢¤½¤Î¤è¤¦¤Ê¥·¥¹¥Æ¥à¤Ç¤Ï +.RB ¡Ö ttyslot () +¤Ï¥«¥ì¥ó¥È¥æ¡¼¥¶¤Î¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤ª¤±¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÖ¤¹¡× +¤È¥É¥­¥å¥á¥ó¥È¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O If successful, this function returns the slot number. +À®¸ù¤·¤¿¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï¥¹¥í¥Ã¥ÈÈÖ¹æ¤òÊÖ¤¹¡£ +.\"O On error (e.g., if none of the file descriptors 0, 1 or 2 is +.\"O associated with a terminal that occurs in this data base) +.\"O it returns 0 on Unix V6 and V7 and BSD-like systems, +.\"O but \-1 on System V-like systems. +¥¨¥é¡¼¤Î¾ì¹ç +(Î㤨¤Ð¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ 0, 1, 2 ¤Î²¿¤ì¤â +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤¢¤ëüËö¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢ +Unix V6, V7, BSD ·Ï¤Î¥·¥¹¥Æ¥à¤Ï 0 ¤òÊÖ¤¹¤¬¡¢ +System V ·Ï¤Î¥·¥¹¥Æ¥à¤Ï -1 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O SUSv1; marked as LEGACY in SUSv2; removed in POSIX.1-2001. +.\"O SUSv2 requires \-1 on error. +SUSv1¡£SUSv2 ¤Ç¤Ï¡Ö²áµî¤Î̾»Ä (LEGACY)¡×¤È°ÌÃÖÉÕ¤±¤é¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Çºï½ü¤µ¤ì¤¿¡£ +SUSv2 ¤Ç¤Ï¥¨¥é¡¼»þ¤Ë \-1 ¤òÊÖ¤¹¤³¤È¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The utmp file is found various places on various systems, such as +.\"O .IR /etc/utmp , +.\"O .IR /var/adm/utmp , +.\"O .IR /var/run/utmp . +utmp ¥Õ¥¡¥¤¥ë¤ÏÍÍ¡¹¤Ê¥·¥¹¥Æ¥à¤Ç +.IR /etc/utmp , +.IR /var/adm/utmp , +.I /var/run/utmp +¤Î¤è¤¦¤Ë¤¤¤í¤¤¤í¤Ê¾ì½ê¤Ë¤¢¤ë¡£ +.LP +.\"O The glibc2 implementation of this function reads the file +.\"O .BR _PATH_TTYS , +.\"O defined in +.\"O .I +.\"O as "/etc/ttys". +.\"O It returns 0 on error. +¤³¤Î´Ø¿ô¤Î glibc2 ¤Ë¤ª¤±¤ë¼ÂÁõ¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë +.B _PATH_TTYS +¤òÆɤ߹þ¤à¡£ +¤³¤ì¤Ï +.I +¤Ë¤ª¤¤¤Æ "/etc/ttys" ¤ÈÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢0 ¤òÊÖ¤¹¡£ +.\"O Since Linux systems do not usually have "/etc/ttys", it will +.\"O always return 0. +Linux ¥·¥¹¥Æ¥à¤Ë¤ÏÄ̾ï "/etc/ttys" ¤¬¤Ê¤¤¤Î¤Ç¡¢¾ï¤Ë 0 ¤òÊÖ¤¹¡£ +.LP +.\"O Minix also has +.\"O .IR fttyslot ( fd ). +Minix ¤Ë¤Ï +.IR fttyslot ( fd ) +¤â¤¢¤ë¡£ +.\"O .\" .SH HISTORY +.\" .SH ÍúÎò +.\"O .\" .BR ttyslot () +.\"O .\" appeared in Unix V7. +.\" .BR ttyslot () +.\" ¤Ï Unix V7 ¤ËÅо줷¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getttyent (3), +.BR ttyname (3), +.BR utmp (5) diff --git a/draft/man3/tzset.3 b/draft/man3/tzset.3 new file mode 100644 index 00000000..9dcb2db3 --- /dev/null +++ b/draft/man3/tzset.3 @@ -0,0 +1,383 @@ +.\" 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 Sun Jul 25 11:01:58 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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 ¥°¥ê¥Ë¥Ã¥¸»Ò¸áÀþ +.\" +.TH TZSET 3 2010-02-25 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O tzset, tzname, timezone, daylight \- initialize time conversion information +.SH ̾Á° +tzset, tzname, timezone, daylight \- »þ¹ï¤ÎÊÑ´¹¾ðÊó¤ò½é´ü²½¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.B void tzset (void); +.sp +.BI "extern char *" tzname [2]; +.BI "extern long " timezone ; +.BI "extern int " daylight ; +.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 tzset (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.br +.IR tzname : +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.br +.IR timezone : +_SVID_SOURCE || _XOPEN_SOURCE +.br +.IR daylight : +_SVID_SOURCE || _XOPEN_SOURCE +.\"O .SH DESCRIPTION +.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¡¢ +¥µ¥Þ¡¼¥¿¥¤¥à´ü´Ö¤¬°ìǯ¤Î¤É¤³¤«¤Ë¤¢¤ì¤Ð 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 +¤â¤è¤¯ÍѤ¤¤é¤ì¤ë¡£ +¤³¤ì¤Ï¥·¥¹¥Æ¥à¤Î¥¿¥¤¥à¥¾¡¼¥ó¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë +ŬÀڤʥե¡¥¤¥ë¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£) +.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) ¤¬ÍѤ¤¤é¤ì¤ë¡£ +.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) +¤ò»ý¤¿¤Ê¤¤¥í¡¼¥«¥ë¥¿¥¤¥à¥¾¡¼¥ó¤ËÂФ·¤ÆÍѤ¤¤ë¡£ +.sp +.RS +.I std offset +.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 ¤Î´Ö¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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] +.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 ¤Ï¡¢ +Âбþ¤¹¤ë¥µ¥Þ¡¼¥¿¥¤¥à¥¾¡¼¥ó¤Î̾Á°¤È¥ª¥Õ¥»¥Ã¥È¤ò»ØÄꤹ¤ë¡£ +¥ª¥Õ¥»¥Ã¥È¤¬¾Êά¤µ¤ì¤ë¤È¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ïɸ½à¤Î°ì»þ´ÖÁ°¤È¤Ê¤ë¡£ +.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 ¥Õ¥£¡¼¥ë¥É¤Ïɸ½à¤ËÌá¤ë»þ¹ï¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤Î·Á¼°¤Ç»ØÄꤹ¤ë¡£ +.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 Æü¤Ï¥«¥¦¥ó¥È¤µ¤ì¤Ê¤¤¡£ +.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 +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 ¤ÏÆüÍËÆü¤Ç¤¢¤ë¡£ +.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 ¤Ç¤¢¤ë¡£ + +.\"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 ¤Ë¹Ô¤ï¤ì¤ë¡£ +.nf + + 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 ¤Ç»Ï¤Þ¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥·¥¹¥Æ¥à¥¿¥¤¥à¥¾¡¼¥ó¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤Ç +¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤¿¤³¤È¤Ë¤Ê¤ë¡£ +.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 +¤Ç¤¢¤ë¡£ +.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 +¥Õ¥¡¥¤¥ë¤ä¡¢ +¥·¥¹¥Æ¥à¤Î¥¿¥¤¥à¥¾¡¼¥ó¥Ç¥£¥ì¥¯¥È¥êÃæ¤ÎŬÀڤʥ¿¥¤¥à¥¾¡¼¥ó¥Õ¥¡¥¤¥ë¤Ø¤Î +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¤³¤È¤¬Â¿¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD. +.\"O .SH NOTES +.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 +ÊÑ¿ô¤ò¸«¤è)¡£ +¤³¤ì¤Ï¤â¤¦²¿Ç¯¤â»È¤ï¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢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 ¤Î¾ì¹ç¤Ïɸ½à¤Î̾Á°¤¬ÍѤ¤¤é¤ì¡¢ +¤½¤ì°Ê³°¤Ï¥µ¥Þ¡¼¥¿¥¤¥àÈǤÎ̾Á°¤¬ÍѤ¤¤é¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR date (1), +.BR gettimeofday (2), +.BR time (2), +.BR ctime (3), +.BR getenv (3), +.BR tzfile (5) diff --git a/draft/man3/ualarm.3 b/draft/man3/ualarm.3 new file mode 100644 index 00000000..db84d6d7 --- /dev/null +++ b/draft/man3/ualarm.3 @@ -0,0 +1,193 @@ +.\" 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 Sep 11 07:32:05 JST 2004 +.\" by Yuichi SATO +.\" Updated 2007-05-04, Akihiro MOTOKI +.\" +.TH UALARM 3 2008-08-06 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ualarm \- schedule signal after given number of microseconds +ualarm \- »ØÄꤷ¤¿¥Þ¥¤¥¯¥íÉøå¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ëͽÄê¤ò¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "useconds_t ualarm(useconds_t " usecs ", useconds_t " interval ); +.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 ualarm (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"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. +ÃÙ¤ì¤Ï¥·¥¹¥Æ¥à¤Î³èÀ­ÅÙ¡¦¸Æ¤Ó½Ð¤·¤Î½èÍý»þ´Ö¡¦ +¥·¥¹¥Æ¥à¥¿¥¤¥Þ¡¼¤ÎγÅ٤ˤè¤Ã¤ÆŤ¯¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +.\"O Unless caught or ignored, the +.\"O .B SIGALRM +.\"O signal will terminate the process. +Ê᪤ޤ¿¤Ï̵»ë¤µ¤ì¤Ê¤¤¸Â¤ê¡¢ +.B SIGALRM +¥·¥°¥Ê¥ë¤Ï¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë¡£ +.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" +.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 +.SH ¥¨¥é¡¼ +.TP +.B EINTR +.\"O Interrupted by a signal. +¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.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" +.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 +.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: +.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. +¤Î¤è¤¦¤Ê¾¤Î¥¿¥¤¥Þ¡¼´Ø¿ô¤È¤ÎÁê¸ßºîÍѤϵ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.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) +¤Ê¤É) ¤ò»È¤¦¤³¤È¡£ +.\"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) diff --git a/draft/man3/ulimit.3 b/draft/man3/ulimit.3 new file mode 100644 index 00000000..01901078 --- /dev/null +++ b/draft/man3/ulimit.3 @@ -0,0 +1,130 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1996 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. +.\" +.\" Moved to man3, aeb, 980612 +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Sat 18 Jul 1998 by NAKANO Takeo +.\" Modified Sun Dec 18 1998 by NAKANO Takeo +.\" +.TH ULIMIT 3 2008-08-06 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O ulimit \- get and set user limits +.SH ̾Á° +ulimit \- ¥æ¡¼¥¶¡¼À©¸Â¤ò¼èÆÀ¡¦ÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "long ulimit(int " cmd ", long " newlimit ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Warning: This routine is obsolete. +.\"O Use +.\"O .BR getrlimit (2), +.\"O .BR setrlimit (2), +.\"O and +.\"O .BR sysconf (3) +.\"O instead. +Ãí°Õ: ¤³¤Î¥ë¡¼¥Á¥ó¤Ï¸Å¤¤¡£ +Âå¤ï¤ê¤Ë +.BR getrlimit (2), +.BR setrlimit (2), +.BR sysconf (3) +¤Ê¤É¤òÍѤ¤¤ë¤³¤È¡£ +.\"O For the shell command +.\"O .BR ulimit (), +.\"O see +.\"O .BR bash (1). +¥·¥§¥ë¥³¥Þ¥ó¥É¤È¤·¤Æ¤Î +.BR ulimit () +¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR bash (1) +¤ò¸«¤ë¤³¤È¡£ + +.\"O The +.\"O .BR ulimit () +.\"O call will get or set some limit for the calling process. +.BR ulimit () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë´Ø¤¹¤ëÀ©¸Â¤Î¤¤¤¯¤Ä¤«¤ò¼èÆÀ¡¦ÀßÄꤹ¤ë¡£ +.\"O The +.\"O .I cmd +.\"O argument can have one of the following values. +.I cmd +°ú¤­¿ô¤Ë¤Ï¡¢°Ê²¼¤ÎÃͤΤ¦¤Á¤Î¤É¤ì¤«°ì¤Ä¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B UL_GETFSIZE +.\"O Return the limit on the size of a file, in units of 512 bytes. +¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ë´Ø¤¹¤ëÀ©¸Â¤òÊÖ¤¹¡£Ã±°Ì¤Ï 512 ¥Ð¥¤¥È¡£ +.TP +.B UL_SETFSIZE +.\"O Set the limit on the size of a file. +¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ë´Ø¤¹¤ëÀ©¸Â¤òÀßÄꤹ¤ë¡£ +.TP +.B 3 +.\"O (Not implemented for Linux.) +.\"O Return the maximum possible address of the data segment. +(Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +¥Ç¡¼¥¿¥»¥°¥á¥ó¥È¤Ç»ØÄê¤Ç¤­¤ë¥¢¥É¥ì¥¹¤ÎºÇÂçÃͤòÊÖ¤¹¡£ +.TP +.B 4 +.\"O (Implemented but no symbolic constant provided.) +.\"O Return the maximum number of files that the calling process can open. +(¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢Âбþ¤¹¤ë¥·¥ó¥Ü¥ê¥Ã¥¯¤ÊÄê¿ô¤Ï¸ºß¤·¤Ê¤¤) +¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤ÎºÇÂçÃͤòÊÖ¤¹¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .BR ulimit () +.\"O returns a nonnegative value. +.\"O On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤¹¤ë¤È +.BR ulimit () +¤Ï 0 ¤Þ¤¿¤ÏÀµ¤ÎÃͤòÊÖ¤¹¡£ +¥¨¥é¡¼¤¬À¸¤¸¤ë¤È \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ÊÃͤËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EPERM +.\"O A unprivileged process tried to increase a limit. +ÈóÆø¢¥×¥í¥»¥¹¤¬À©¸ÂÃͤòÁý²Ã¤µ¤»¤è¤¦¤È¤·¤¿¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SVr4, POSIX.1-2001. +.\"O POSIX.1-2008 marks +.\"O .BR ulimit () +.\"O as obsolete. +POSIX.1-2008 ¤Ï +.BR ulimit () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bash (1), +.BR getrlimit (2), +.BR setrlimit (2), +.BR sysconf (3) diff --git a/draft/man3/undocumented.3 b/draft/man3/undocumented.3 new file mode 100644 index 00000000..f62313e8 --- /dev/null +++ b/draft/man3/undocumented.3 @@ -0,0 +1,211 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1995 Jim Van Zandt +.\" From jrv@vanzandt.mv.com Mon Sep 4 21:11:50 1995 +.\" +.\" 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. +.\" +.\" 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 +.SH ̾Á° +.\"O none \- undocumented library functions +none \- ¥É¥­¥å¥á¥ó¥È¤¬¤Ê¤¤¥é¥¤¥Ö¥é¥ê´Ø¿ô (library functions) +.\"O .SH SYNOPSIS +.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 +.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" +.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) diff --git a/draft/man3/ungetwc.3 b/draft/man3/ungetwc.3 new file mode 100644 index 00000000..345680ec --- /dev/null +++ b/draft/man3/ungetwc.3 @@ -0,0 +1,98 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:43 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH UNGETWC 3 1999-09-19 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ungetwc \- push back a wide character onto a FILE stream +ungetwc \- ¥ï¥¤¥Éʸ»ú¤ò FILE ¥¹¥È¥ê¡¼¥à¤ØÌ᤹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wint_t ungetwc(wint_t " wc ", FILE *" stream ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The \fBungetwc\fP() function is the wide-character equivalent of the +.\"O .BR ungetc (3) +.\"O function. +.\"O It pushes back a wide character onto \fIstream\fP and returns it. +.BR ungetwc () +´Ø¿ô¤Ï +.BR ungetc (3) +´Ø¿ô¤Î¥ï¥¤¥Éʸ»úÈǤǤ¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»ú¤ò \fIstream\fP ¤ØÌᤷ¤Æ¡¢¤½¤ì¤òÊÖ¤¹¡£ +.PP +.\"O If \fIwc\fP is \fBWEOF\fP, it returns \fBWEOF\fP. +.\"O If \fIwc\fP is an invalid wide character, +.\"O it sets \fIerrno\fP to \fBEILSEQ\fP and returns \fBWEOF\fP. +\fIwc\fP ¤¬ \fBWEOF\fP ¤Î¾ì¹ç¡¢ \fBWEOF\fP ¤òÊÖ¤¹¡£ +\fIwc\fP ¤¬ÉÔÀµ¤Ê¥ï¥¤¥Éʸ»ú¤Î¾ì¹ç¡¢ +\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤷ¤Æ \fBWEOF\fP ¤òÊÖ¤¹¡£ +.PP +.\"O If \fIwc\fP is a valid wide character, it is pushed back onto the stream +.\"O and thus becomes available for future wide character read operations. +.\"O The file-position indicator is decremented by one or more. +.\"O The end-of-file +.\"O indicator is cleared. +.\"O The backing storage of the file is not affected. +\fIwc\fP ¤¬Í­¸ú¤Ê¥ï¥¤¥Éʸ»ú¤Î¾ì¹ç¡¢¤½¤ì¤ò¥¹¥È¥ê¡¼¥à¤Ø¤ÈÌᤷ¤Æ¸å¤Î +¥ï¥¤¥Éʸ»úÆɤ߹þ¤ßÁàºî¤Ç¼èÆÀ¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£¥Õ¥¡¥¤¥ë°ÌÃÖ(file-position) +»Ø¼¨»Ò¤Ï1°Ê¾åÌᤵ¤ì¤ë¡£¥Õ¥¡¥¤¥ë½ªÃ¼(end-of-file)»Ø¼¨»Ò¤Ï¥¯¥ê¥¢¤µ¤ì¤ë¡£ +¤½¤Î¥Õ¥¡¥¤¥ë¤ÎÇظå¤Ë¤¢¤ëµ­²±ÇÞÂΤϱƶÁ¤ò¼õ¤±¤Ê¤¤¡£ +.PP +.\"O Note: \fIwc\fP need not be the last wide-character read from the stream; +.\"O it can be any other valid wide character. +Ãí°Õ: \fIwc\fP ¤Ï¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤ó¤ÀºÇ¸å¤Î¥ï¥¤¥Éʸ»ú¤Ç¤¢¤ëɬÍפϤʤ¤¡£ +Í­¸ú¤Ê¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð²¿¤Ç¤âÎɤ¤¡£ +.PP +.\"O If the implementation supports multiple push-back operations in a row, the +.\"O pushed-back wide characters will be read in reverse order; however, only one +.\"O level of push-back is guaranteed. +³¤±¤ÆÊ£¿ô¤Î¥ï¥¤¥Éʸ»ú¤òÌ᤹¤³¤È¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¼ÂÁõ¤Î¾ì¹ç¤Ï¡¢ +Ìᤷ¤¿¥ï¥¤¥Éʸ»ú¤Ï¡¢Ìᤷ¤¿¤Î¤È¤ÏµÕ¤Î½çÈÖ¤ÇÆɤ߹þ¤Þ¤ì¤ë¡£ +¤·¤«¤·¤³¤Î¾ì¹ç¤Ç¤â°ìÃʳ¬¤ÎÌᤷ¤·¤«Êݾڤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR ungetwc () +.\"O function returns \fIwc\fP when successful, or \fBWEOF\fP upon +.\"O failure. +.BR ungetwc () +´Ø¿ô¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï \fIwc\fP ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï \fBWEOF\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR ungetwc () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR ungetwc () +´Ø¿ô¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fgetwc (3) diff --git a/draft/man3/unlocked_stdio.3 b/draft/man3/unlocked_stdio.3 new file mode 100644 index 00000000..2b35f7a8 --- /dev/null +++ b/draft/man3/unlocked_stdio.3 @@ -0,0 +1,162 @@ +.\" 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) 2001 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Fri Nov 2 23:08:42 2001 +.\" by Akihiro MOTOKI +.\" +.TH UNLOCKED_STDIO 3 2008-08-29 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O getc_unlocked, getchar_unlocked, putc_unlocked, +.\"O putchar_unlocked \- nonlocking stdio functions +.SH ̾Á° +getc_unlocked, getchar_unlocked, putc_unlocked, +putchar_unlocked \- ¥í¥Ã¥¯¤ò¹Ô¤ï¤º¤Ëɸ½àÆþ½ÐÎϤò¹Ô¤¦´Ø¿ô·² +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getc_unlocked(FILE *" stream ); +.B "int getchar_unlocked(void);" +.BI "int putc_unlocked(int " c ", FILE *" stream ); +.BI "int putchar_unlocked(int " c ); +.sp +.BI "void clearerr_unlocked(FILE *" stream ); +.BI "int feof_unlocked(FILE *" stream ); +.BI "int ferror_unlocked(FILE *" stream ); +.BI "int fileno_unlocked(FILE *" stream ); +.BI "int fflush_unlocked(FILE *" stream ); +.BI "int fgetc_unlocked(FILE *" stream ); +.BI "int fputc_unlocked(int " c ", FILE *" stream ); +.BI "size_t fread_unlocked(void *" ptr ", size_t " size ", size_t " n , +.BI " FILE *" stream ); +.BI "size_t fwrite_unlocked(const void *" ptr ", size_t " size ", size_t " n , +.BI " FILE *" stream ); +.sp +.BI "char *fgets_unlocked(char *" s ", int " n ", FILE *" stream ); +.BI "int fputs_unlocked(const char *" s ", FILE *" stream ); +.sp +.B #include +.sp +.BI "wint_t getwc_unlocked(FILE *" stream ); +.B "wint_t getwchar_unlocked(void);" +.BI "wint_t fgetwc_unlocked(FILE *" stream ); +.BI "wint_t fputwc_unlocked(wchar_t " wc ", FILE *" stream ); +.BI "wint_t putwc_unlocked(wchar_t " wc ", FILE *" stream ); +.BI "wint_t putwchar_unlocked(wchar_t " wc ); +.BI "wchar_t *fgetws_unlocked(wchar_t *" ws ", int " n ", FILE *" stream ); +.BI "int fputws_unlocked(const wchar_t *" ws ", FILE *" stream ); +.fi +.sp +.in -4n +.\"O Feature Test Macro Requirements for glibc (see +.\"O .BR feature_test_macros (7)): +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.ad l +.in +.sp +.BR getc_unlocked (), +.BR getchar_unlocked (), +.BR putc_unlocked (), +.BR putchar_unlocked (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE || +_BSD_SOURCE || _SVID_SOURCE +.sp +.BR clearerr_unlocked (), +.BR feof_unlocked (), +.BR ferror_unlocked (), +.BR fileno_unlocked (), +.BR fflush_unlocked (), +.BR fgetc_unlocked (), +.BR fputc_unlocked (), +.BR fread_unlocked (), +.BR fwrite_unlocked (): +_BSD_SOURCE || _SVID_SOURCE +.sp +.BR fgets_unlocked (), +.BR fputs_unlocked (), +.BR getwc_unlocked (), +.BR getwchar_unlocked (), +.BR fgetwc_unlocked (), +.BR fputwc_unlocked (), +.BR putwchar_unlocked (), +.BR fgetws_unlocked (), +.BR fputws_unlocked (): +_GNU_SOURCE +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Each of these functions has the same behavior as its counterpart +.\"O without the "_unlocked" suffix, except that they do not use locking +.\"O (they do not set locks themselves, and do not test for the presence +.\"O of locks set by others) and hence are thread-unsafe. +.\"O See +.\"O .BR flockfile (3). +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ËöÈø¤Ë "_unlocked" ¤¬¤Ä¤¤¤Æ¤¤¤Ê¤¤´Ø¿ô¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¤¬¡¢ +¥Õ¥¡¥¤¥ë¤Î¥í¥Ã¥¯¤ò»ÈÍѤ·¤Ê¤¤ÅÀ¤¬°Û¤Ê¤ë¡£(¤³¤ì¤é¤Î´Ø¿ô¼«¿È¤Ï¥Õ¥¡¥¤¥ë¤Î¥í¥Ã¥¯ +¤ò¥»¥Ã¥È¤»¤º¡¢Â¾¤Î´Ø¿ô¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯¤â +¹Ô¤ï¤Ê¤¤) ¤½¤ì¤æ¤¨¡¢¥¹¥ì¥Ã¥É(thread)¤Ç°ÂÁ´¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.BR flockfile (3) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O The four functions \fIgetc_unlocked\fP(), +.\"O .BR getchar_unlocked (), +.\"O .BR putc_unlocked (), +.\"O .BR putchar_unlocked () +.\"O are in POSIX.1-2001. +.BR getc_unlocked (), +.BR getchar_unlocked (), +.BR putc_unlocked (), +.BR putchar_unlocked () +¤Î 4 ¤Ä¤Î´Ø¿ô¤Ï +POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +.\"O The nonstandard +.\"O .BR *_unlocked () +.\"O variants occur on a few Unix systems, and are available in recent glibc. +Èóɸ½à¤Î +.BR *_unlocked () +¤ÎÃç´Ö¤Ï 2¡¢3 ¤Î Unix ¥·¥¹¥Æ¥à¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +ºÇ¶á¤Î glibc ¤Ç¤Ï»ÈÍѲÄǽ¤Ç¤¢¤ë¤¬¡¢ +.\" E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and +.\" moved to a compatibility library. +.\" Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked, +.\" feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked, +.\" fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked, +.\" fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked, +.\" ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked, +.\" getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked, +.\" putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked, +.\" putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked, +.\" ungetc_unlocked, ungetwc_unlocked. +.\"O They should probably not be used. +¤³¤ì¤é¤Î´Ø¿ô¤Ï»È¤ï¤Ê¤¤Êý¤¬¤è¤¤¤À¤í¤¦¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR flockfile (3), +.BR stdio (3), +.BR feature_test_macros (7) diff --git a/draft/man3/unlockpt.3 b/draft/man3/unlockpt.3 new file mode 100644 index 00000000..cfc36a1c --- /dev/null +++ b/draft/man3/unlockpt.3 @@ -0,0 +1,88 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This page is in the public domain. - aeb +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 02:25:57 JST 2003 +.\" by Akihiro MOTOKI +.\" +.TH UNLOCKPT 3 2008-06-14 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O unlockpt \- unlock a pseudo-terminal master/slave pair +.SH ̾Á° +unlockpt \- µ¼»÷üËö¥Þ¥¹¥¿/¥¹¥ì¡¼¥Ö¤Î¥Ú¥¢¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "int unlockpt(int " fd ");" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR unlockpt () +.\"O function unlocks the slave pseudo-terminal device +.\"O (pty) corresponding to the master pty referred to by +.\"O .IR fd . +.BR unlockpt () +´Ø¿ô¤Ï +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥Þ¥¹¥¿µ¼»÷üËö¤ËÂбþ¤¹¤ë¥¹¥ì¡¼¥Öµ¼»÷üËö¤Î¥í¥Ã¥¯¤ò +²ò½ü¤¹¤ë¡£ +.PP +.\"O .BR unlockpt () +.\"O should be called before opening the slave side of a pty. +µ¼»÷üËö¤Î¥¹¥ì¡¼¥Ö¦¤ò¥ª¡¼¥×¥ó¤¹¤ëÁ°¤Ë¡¢ +.BR unlockpt () +¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O When successful, +.\"O .BR unlockpt () +.\"O returns 0. +.\"O Otherwise, it returns \-1 and sets +.\"O .I errno +.\"O appropriately. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR grantpt () +¤Ï 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.\"O The +.\"O .I fd +.\"O argument is not a file descriptor open for writing. +°ú¤­¿ô +.I fd +¤¬½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O The +.\"O .I fd +.\"O argument is not associated with a master pty. +°ú¤­¿ô +.I fd +¤¬¥Þ¥¹¥¿µ¼»÷üËö¤ËÂбþ¤¹¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR unlockpt () +.\"O is provided in glibc since version 2.1. +.BR unlockpt () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR grantpt (3), +.BR posix_openpt (3), +.BR ptsname (3), +.BR pts (4), +.BR feature_test_macros (7), +.BR pty (7) diff --git a/draft/man3/updwtmp.3 b/draft/man3/updwtmp.3 new file mode 100644 index 00000000..7cfc5bbe --- /dev/null +++ b/draft/man3/updwtmp.3 @@ -0,0 +1,125 @@ +.\" WORD: current process ID ¸½¥×¥í¥»¥¹ID +.\" WORD: AVAILABILITY ÍøÍѲÄǽ¤Ê´Ä¶­ +.\" Copyright 1997 NicoláÔ Lichtmaier +.\" Created Wed Jul 2 23:27:34 ART 1997 +.\" +.\" 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. +.\" +.\" Added info on availability, aeb, 971207 +.\" Added -lutil remark, 030718 +.\" 2008-07-02, mtk, document updwtmpx() +.\" +.\" Japanese Version Copyright (c) 1998 Tomoyuki NISHIOKA +.\" all rights reserved. +.\" Translated Sat May 23 18:46:34 JST 1998 +.\" by Tomoyuki NISHIOKA +.\" Updated 2003-09-14 by Kentaro Shirakata +.\" Updated 2008-07-30 by Kentaro Shirakata +.\" +.TH UPDWTMP 3 2008-07-02 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +updwtmp, logwtmp \- wtmp ¥Õ¥¡¥¤¥ë¤Ë¥¨¥ó¥È¥ê¤òÄɲ乤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void updwtmp(const char *" wtmp_file ", const struct utmp *" ut ); +.br +.BI "void logwtmp(const char *" line ", const char *" name \ +", const char *" host ); +.fi +.SH ÀâÌÀ +.\"O .BR updwtmp () +.\"O appends the utmp structure +.\"O .I ut +.\"O to the wtmp file. +.BR updwtmp () +¤Ï¡¢utmp ¹½Â¤ÂÎ +.I ut +¤ò wtmp ¥Õ¥¡¥¤¥ë¤ËÄɲ乤롣 +.PP +.\"O .BR logwtmp () +.\"O constructs a utmp structure using +.\"O .IR line ", " name ", " host , +.\"O current time and current process ID. +.\"O Then it calls +.\"O .BR updwtmp () +.\"O to append the structure to the wtmp file. +.BR logwtmp () +¤Ï¡¢ +.IR line ", " name ", " host , +¸½ºß»þ¹ï¡¢¸½¥×¥í¥»¥¹ID ¤«¤é utmp ¹½Â¤ÂΤòºî¤ê¡¢ +.BR updwtmp () +¤ò¸Æ¤Ó½Ð¤·¤Æ¤½¤Î¹½Â¤ÂΤò wtmp ¥Õ¥¡¥¤¥ë¤ËÄɲ乤롣 +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /var/log/wtmp +¥æ¡¼¥¶¥í¥°¥¤¥ó¤ÎÍúÎò¥Ç¡¼¥¿¥Ù¡¼¥¹ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Not in POSIX.1-2001. +.\"O Present on Solaris, NetBSD, and perhaps other systems. +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +Solaris, NetBSD ¤Ë¸ºß¤·¡¢¤ª¤½¤é¤¯Â¾¤Î¥·¥¹¥Æ¥à¤Ë¤â¤¢¤ë¤À¤í¤¦¡£ +.\"O .SH AVAILABILITY +.SH ÍøÍѲÄǽ¤Ê´Ä¶­ +.\"O Both functions are available under glibc2, but not under libc5. +glibc2 ¤Î²¼¤Ç¤Ï¤É¤Á¤é¤Î´Ø¿ô¤âÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O However, +.\"O .BR logwtmp () +.\"O used to occur in the old libbsd. +.\"O These days, the +.\"O .BR logwtmp () +.\"O function is included in libutil. +.\"O (Hence you'll need to add \fI\-lutil\fP +.\"O to your compiler commandline to get it.) +libc5 ¤Î²¼¤Ç¤Ï¤É¤Á¤é¤â»È¤¨¤Ê¤¤¤¬¡¢ +.BR logwtmp () +¤Ï¸Å¤¤ libbsd ¤Ë¤¢¤Ã¤¿¡£ +ºÇ¶á¤Ç¤Ï¡¢ +.BR logwtmp () +´Ø¿ô¤Ï libutil ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë +(¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Î´Ø¿ô¤ò»È¤¦¤¿¤á¤Ë¤Ï¥³¥ó¥Ñ¥¤¥é¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë +\fI\-lutil\fP ¤òÄɲ乤ëɬÍפ¬¤¢¤ë)¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O For consistency with the other "utmpx" functions (see +.\"O .BR getutxent (3)), +.\"O glibc provides (since version 2.1): +¾¤Î "utmpx" ´Ø¿ô·² +.RB ( getutxent (3) +»²¾È) ¤È¤Î°ì´ÓÀ­¤Î¤¿¤á¤Ë¡¢glibc (¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß) ¤Ï°Ê²¼¤Î´Ø¿ô¤ò +Ä󶡤·¤Æ¤¤¤ë: +.nf +.sp +.B #include +.sp +.BI "void updwtmpx (const char *" wtmpx_file ", const struct utmpx *" utx ); +.fi +.PP +.\"O This function performs the same task as +.\"O .BR updwtmp (), +.\"O but differs in that it takes a +.\"O .I utmpx +.\"O structure as its last argument. +¤³¤Î´Ø¿ô¤Ï +.BR updwtmp () +¤ÈƱ¤¸ºî¶È¤ò¹Ô¤¦¤¬¡¢ºÇ¸å¤Î°ú¤­¿ô¤È¤·¤Æ +.I utmpx +¹½Â¤ÂΤò¼è¤ë¤È¤³¤í¤¬°Û¤Ê¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getutxent (3), +.BR wtmp (5) diff --git a/draft/man3/usleep.3 b/draft/man3/usleep.3 new file mode 100644 index 00000000..e059fc68 --- /dev/null +++ b/draft/man3/usleep.3 @@ -0,0 +1,195 @@ +.\" 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-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 2007-07-26 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O usleep \- suspend execution for interval of microseconds +usleep \- ¥Þ¥¤¥¯¥íÉÃñ°Ì¤Ç¼Â¹Ô¤ò±ä´ü¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int usleep(useconds_t " usec ); +.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 usleep (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR usleep () +.\"O function suspends execution of the calling process 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" +.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" +.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 () +¤Îµ¬Ä꤬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"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 °Ê¹ß¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ + +.\"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 +.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] ¤ÎÈϰϤÎÀ°¿ô¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤ë +Éä¹æ¤Ê¤·À°¿ô·¿¤Ç¤¢¤ë¡£ +ÌÀ¼¨Åª¤Ë¤³¤Î·¿¤ò»È¤ï¤Ê¤¤¤³¤È¤Ç¥×¥í¥°¥é¥à¤Î°Ü¿¢À­¤¬¤è¤ê¹â¤Þ¤ë¡£ +°Ê²¼¤Î¤è¤¦¤Ë»È¤¦¤³¤È¡£ +.in +4n +.nf +.sp +#include +\&... + unsigned int usecs; +\&... + usleep(usecs); +.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" +.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) diff --git a/draft/man3/wcpcpy.3 b/draft/man3/wcpcpy.3 new file mode 100644 index 00000000..c5e6ef32 --- /dev/null +++ b/draft/man3/wcpcpy.3 @@ -0,0 +1,71 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 25 22:24:35 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCPCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcpcpy \- copy a wide-character string, returning a pointer to its end +wcpcpy \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥³¥Ô¡¼¤·¡¢¤½¤ÎËöÈø¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "wchar_t *wcpcpy(wchar_t *" dest ", const wchar_t *" src ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcpcpy () +.\"O function is the wide-character equivalent of the +.\"O .BR stpcpy (3) +.\"O function. +.\"O It copies the wide-character string pointed to by \fIsrc\fP, +.\"O including the terminating L\(aq\\0\(aq character, to the array pointed to by +.\"O \fIdest\fP. +.BR wcpcpy () +´Ø¿ô¤Ï¡¢ +.BR stpcpy (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï \fIsrc\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¡¢½ªÃ¼¤Î L\(aq\\0\(aq ¤ò´Þ¤á¤Æ¡¢ +\fIdest\fP ¤¬»Ø¤¹ÇÛÎó¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +.PP +.\"O The strings may not overlap. +¤³¤ì¤é¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The programmer must ensure that there +.\"O is room for at least \fIwcslen(src)+1\fP +.\"O wide characters at \fIdest\fP. +¥×¥í¥°¥é¥Þ¤Ï¡¢\fIdest\fP ¤¬»Ø¤¹Îΰè¤Ë¾¯¤Ê¤¯¤È¤â¥ï¥¤¥Éʸ»ú +\fIwcslen(src)+1\fP ¸Äʬ¤ÎÎΰè¤ò³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR wcpcpy () +.\"O returns a pointer to the end of the wide-character string +.\"O \fIdest\fP, that is, a pointer to the terminating L\(aq\\0\(aq character. +.BR wcpcpy () +¤Ï¡¢¥ï¥¤¥Éʸ»úʸ»úÎó \fIdest\fP ¤ÎËöÈø¡¢¤Ä¤Þ¤ê½ªÃ¼¤Î +L\(aq\\0\(aq ʸ»ú¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is a GNU extension. +¤³¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR strcpy (3), +.BR wcscpy (3), +.BR feature_test_macros (7) diff --git a/draft/man3/wcpncpy.3 b/draft/man3/wcpncpy.3 new file mode 100644 index 00000000..b15d0e35 --- /dev/null +++ b/draft/man3/wcpncpy.3 @@ -0,0 +1,87 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Wed Oct 27 02:17:42 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCPNCPY 3 2003-11-01 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcpncpy \- copy a fixed-size string of wide characters, +.\"O returning a pointer to its end +wcpncpy \- ¸ÇÄêĹ¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥³¥Ô¡¼¤·¡¢¤½¤ÎËöÈø¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "wchar_t *wcpncpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcpncpy () +.\"O function is the wide-character equivalent +.\"O of the +.\"O .BR stpncpy (3) +.\"O function. +.\"O It copies at most \fIn\fP wide characters from the wide-character +.\"O string pointed to by \fIsrc\fP, +.\"O including the terminating L\(aq\\0\(aq character, +.\"O to the array pointed to by \fIdest\fP. +.\"O Exactly \fIn\fP wide characters are +.\"O written at \fIdest\fP. +.\"O If the length \fIwcslen(src)\fP is smaller than \fIn\fP, +.\"O the remaining wide characters in the array pointed to +.\"O by \fIdest\fP are filled with L\(aq\\0\(aq characters. +.\"O If the length \fIwcslen(src)\fP is greater or equal +.\"O to \fIn\fP, the string pointed to by \fIdest\fP will +.\"O not be L\(aq\\0\(aq terminated. +.BR wcpncpy () +´Ø¿ô¤Ï¡¢ +.BR stpncpy (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIsrc\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎ󤫤é \fIdest\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó +¤Ë¡¢½ªÃ¼¤Î L\(aq\\0\(aq ¤ò´Þ¤á¤ÆºÇÂç \fIn\fP ʸ»ú¤ò ¥³¥Ô¡¼¤¹¤ë¡£¤Á¤ç¤¦¤É +\fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤¬ \fIdest\fP ¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£¤Ä¤Þ¤ê¡¢ +\fIwcslen(src)\fP ¤ÎŤµ¤¬ \fIn\fP ¤è¤ê¾®¤µ¤±¤ì¤Ð¡¢\fIdest\fP ¤¬»Ø¤¹ÇÛ +ÎóÃæ¤Î»Ä¤ê¤Î¥ï¥¤¥Éʸ»ú¤Ï L\(aq\\0\(aq ʸ»ú¤ÇËä¤á¤é¤ì¤ë¡£¤â¤· +\fIwcslen(src)\fP ¤ÎŤµ¤¬ \fIn\fP °Ê¾å¤Ê¤é¤Ð¡¢\fIdest\fP ¤¬»Ø¤¹Ê¸»úÎó +¤Ï L\(aq\\0\(aq ¤Ç½ªÃ¼¤·¤Ê¤¤¡£ +.PP +.\"O The strings may not overlap. +2 ¤Ä¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The programmer must ensure that there is room for at least \fIn\fP wide +.\"O characters at \fIdest\fP. +¥×¥í¥°¥é¥Þ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ò³ÊǼ¤Ç¤­¤ëÎΰè¤ò +\fIdest\fP ¤Ë³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR wcpncpy () +.\"O returns a pointer to the last wide character written, that is, +.\"O \fIdest + n \- 1\fP. +.BR wcpncpy () +¤Ï¡¢ºÇ¸å¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¡¢ +¤¹¤Ê¤ï¤Á \fIdest + n \- 1\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is a GNU extension. +¤³¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR stpncpy (3), +.BR wcsncpy (3), +.BR feature_test_macros (7) diff --git a/draft/man3/wcrtomb.3 b/draft/man3/wcrtomb.3 new file mode 100644 index 00000000..57ae1053 --- /dev/null +++ b/draft/man3/wcrtomb.3 @@ -0,0 +1,131 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 25 22:55:40 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCRTOMB 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcrtomb \- convert a wide character to a multibyte sequence +wcrtomb \- ¥ï¥¤¥Éʸ»ú 1 ¤Ä¤ò¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t wcrtomb(char *" s ", wchar_t " wc ", mbstate_t *" ps ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The main case for this function is when \fIs\fP is +.\"O not NULL and \fIwc\fP is not +.\"O L\(aq\\0\(aq. +¤³¤Î´Ø¿ô¤¬¼ç¤Ë»È¤ï¤ì¤ë¤Î¤Ï¡¢\fIs\fP ¤¬ NULL ¤Ç¤Ê¤¯¡¢\fIwc\fP ¤¬ L\(aq\\0\(aq +¤Ç¤Ê¤¤¾ì¹ç¤Ç¤¢¤ë¡£ +.\"O In this case, the +.\"O .BR wcrtomb () +.\"O function +.\"O converts the wide character \fIwc\fP +.\"O to its multibyte representation and stores it +.\"O at the beginning of the character +.\"O array pointed to by \fIs\fP. +.\"O It updates the shift state \fI*ps\fP, and +.\"O returns the length of said multibyte representation, +.\"O that is, the number of bytes +.\"O written at \fIs\fP. +¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR wcrtomb () +´Ø¿ô¤Ï¥ï¥¤¥Éʸ»ú \fIwc\fP ¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èɽ +¸½¤ËÊÑ´¹¤·¡¢\fIs\fP ¤¬»Ø¤¹ char ·¿¤ÎÇÛÎó¤Ë¤³¤ì¤ò³ÊǼ¤¹¤ë¡£¤³¤Î´Ø¿ô¤Ï +¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò¹¹¿·¤·¡¢½ÐÎϤµ¤ì¤¿¥Þ¥ë¥Á¥Ð¥¤¥Èɽ¸½¤ÎŤµ¡¢¤¹¤Ê +¤ï¤Á \fIs\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +.PP +.\"O A different case is when \fIs\fP is not NULL but \fIwc\fP is L\(aq\\0\(aq. +.\"O In this +.\"O case the +.\"O .BR wcrtomb () +.\"O function stores at +.\"O the character array pointed to by +.\"O \fIs\fP the shift sequence needed to +.\"O bring \fI*ps\fP back to the initial state, +.\"O followed by a \(aq\\0\(aq byte. +.\"O It updates the shift state \fI*ps\fP (i.e., brings +.\"O it into the initial state), +.\"O and returns the length of the shift sequence plus +.\"O one, that is, the number of bytes written at \fIs\fP. +Ê̤Υ±¡¼¥¹¤È¤·¤Æ¤Ï¡¢\fIs\fP ¤Ï NULL ¤Ç¤Ê¤¤¤¬ \fIwc\fP ¤¬ L\(aq\\0\(aq ¤Î¤³¤È¤¬ +¤¢¤ë¡£¤³¤Î¾ì¹ç¤Î +.BR wcrtomb () +´Ø¿ô¤Ï¡¢\fI*ps\fP ¤ò½é´ü¾õÂÖ¤ËÌ᤹¤Î¤Ëɬ +Íפʥ·¥Õ¥È¥·¡¼¥±¥ó¥¹¤ò \fIs\fP ¤¬»Ø¤¹ char ·¿ÇÛÎó¤Ë³ÊǼ¤·¡¢¤½¤Î¸å¤Ë \(aq\\0\(aq +¤ò³ÊǼ¤¹¤ë¡£¤³¤Î´Ø¿ô¤Ï¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò¹¹¿·¤·(¤Ä¤Þ¤ê½é´ü¾õÂÖ¤ËÌá +¤·)¡¢¥·¥Õ¥È¥·¡¼¥±¥ó¥¹¤ÎŤµ¤Ë 1 ¤ò²Ã¤¨¤¿ÃͤòÊÖ¤¹¡£¤³¤ÎÃÍ¤Ï \fIs\fP ¤Ë +½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤Ç¤¢¤ë¡£ +.PP +.\"O A third case is when \fIs\fP is NULL. +.\"O In this case \fIwc\fP is ignored, +.\"O and the function effectively returns wcrtomb(buf,L\(aq\\0\(aq,\fIps\fP) where +.\"O buf is an internal anonymous buffer. +»°ÈÖÌܤΥ±¡¼¥¹¤Ï¡¢\fIs\fP ¤¬ NULL ¤Î»þ¤Ç¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï \fIwc\fP ¤Ï +̵»ë¤µ¤ì¡¢´Ø¿ô¤Î¼ÂºÝ¤Î¸ú²Ì¤È¤·¤Æ¤Ï wcrtomb(buf,L\(aq\\0\(aq,\fIps\fP) ¤ÈƱ¤¸ +Ãͤ¬ÊÖ¤µ¤ì¤ë¡£¤³¤³¤Ç¡¢buf ¤ÏÆâÉôŪ¤Êƿ̾¤Î¥Ð¥Ã¥Õ¥¡¤Ç¤¢¤ë¡£ + +.PP +.\"O In all of the above cases, if \fIps\fP is a NULL pointer, a static anonymous +.\"O state only known to the +.\"O .BR wcrtomb () +.\"O function is used instead. +°Ê¾å¤Î¤¤¤º¤ì¤Î¾ì¹ç¤â¡¢\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ê¤é¤Ð¥·¥Õ¥È¾õÂÖ¤ÏÍѤ¤ +¤é¤ì¤º¡¢ +.BR wcrtomb () +´Ø¿ô¤À¤±¤¬ÃΤäƤ¤¤ëÀÅŪ¤Êƿ̾¤Î¾õÂÖ¤¬»È¤ï¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcrtomb () +.\"O function returns the number of +.\"O bytes that have been or would +.\"O have been written to the byte array at \fIs\fP. +.\"O If \fIwc\fP can not be +.\"O represented as a multibyte sequence (according to the current locale), +.\"O .I (size_t)\ \-1 +.\"O is returned, and \fIerrno\fP set to \fBEILSEQ\fP. +.BR wcrtomb () +´Ø¿ô¤Ï¡¢\fIs\fP ¤¬»Ø¤¹¥Ð¥¤¥ÈÎó¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¡¢¤¢ +¤ë¤¤¤Ï½ñ¤­¹þ¤Þ¤ì¤¿¤Ç¤¢¤í¤¦¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£\fIwc\fP ¤ò(¸½ºß¤Î¥í¥±¡¼¥ë¤Ë +½¾¤Ã¤Æ)¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Çɽ¸½¤Ç¤­¤Ê¤±¤ì¤Ð¡¢ +.I (size_t)\ \-1 +¤¬ÊÖ¤µ¤ì¡¢ \fIerrno\fP ¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR wcrtomb () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR wcrtomb () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.\"O Passing NULL as \fIps\fP is not multithread safe. +\fIps\fP ¤Ë NULL ¤òÅϤ·¤¿ºÝ¤ÎÆ°ºî¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR wcsrtombs (3) diff --git a/draft/man3/wcscasecmp.3 b/draft/man3/wcscasecmp.3 new file mode 100644 index 00000000..2be48c76 --- /dev/null +++ b/draft/man3/wcscasecmp.3 @@ -0,0 +1,91 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 25 23:52:06 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSCASECMP 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcscasecmp \- compare two wide-character strings, ignoring case +wcscasecmp \- ¥ï¥¤¥Éʸ»úÎó¤òÈæ³Ó¤¹¤ë¡£Âçʸ»ú¤È¾®Ê¸»ú¤ò¶èÊ̤·¤Ê¤¤¡£ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int wcscasecmp(const wchar_t *" s1 ", const wchar_t *" s2 ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcscasecmp () +.\"O function is the wide-character equivalent of the +.\"O .BR strcasecmp (3) +.\"O function. +.\"O It compares the wide-character string pointed to +.\"O by \fIs1\fP and the wide-character string pointed to by \fIs2\fP, ignoring +.\"O case differences +.\"O .RB ( towupper (3), +.\"O .BR towlower (3)). +.BR wcscasecmp () +´Ø¿ô¤Ï¡¢ +.BR strcasecmp (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô +¤Ç¤¢¤ë¡£¤³¤Î´Ø¿ô¤Ï¡¢\fIs1\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤È \fIs2\fP ¤¬»Ø¤¹ +¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¡¢Âçʸ»ú¤È¾®Ê¸»ú¤Î°ã¤¤ +.RB ( towupper (3), +.BR towlower (3)) +¤ò̵»ë¤·¤ÆÈæ³Ó¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcscasecmp () +.\"O function returns zero if the wide-character strings at +.\"O \fIs1\fP and \fIs2\fP are equal except for case distinctions. +.\"O It returns a +.\"O positive integer if \fIs1\fP is greater than \fIs2\fP, ignoring case. +.\"O It +.\"O returns a negative integer if \fIs1\fP is smaller +.\"O than \fIs2\fP, ignoring case. +.BR wcscasecmp () +´Ø¿ô¤Ï¡¢\fIs1\fP ¤È \fIs2\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úÎó¤òÂçʸ +»ú¤È¾®Ê¸»ú¤Î°ã¤¤¤ò̵»ë¤·¤ÆÈæ³Ó¤·¤¿»þ¤Ë¡¢Åù¤·¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£Âçʸ»ú¤È +¾®Ê¸»ú¤Î°ã¤¤¤ò̵»ë¤·¤Æ \fIs1\fP ¤ÎÊý¤¬ \fIs2\fP ¤è¤êÂ礭¤±¤ì¤ÐÀµ¤ÎÀ°¿ô +¤òÊÖ¤¹¡£ +Âçʸ»ú¤È¾®Ê¸»ú¤Î°ã¤¤¤ò̵»ë¤·¤Æ \fIs1\fP ¤ÎÊý¤¬ \fIs2\fP ¤è¤ê¾®¤µ¤±¤ì¤Ð +Éé¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.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 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +Linux °Ê³°¤Î¾¤Î¥·¥¹¥Æ¥à¤Ç¹­¤¯ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR wcscasecmp () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR wcscasecmp () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strcasecmp (3), +.BR wcscmp (3) diff --git a/draft/man3/wcscat.3 b/draft/man3/wcscat.3 new file mode 100644 index 00000000..160e2d2b --- /dev/null +++ b/draft/man3/wcscat.3 @@ -0,0 +1,69 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Oct 17 21:56:31 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSCAT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcscat \- concatenate two wide-character strings +wcscat \- 2 ¤Ä¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤ò·ë¹ç¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcscat(wchar_t *" dest ", const wchar_t *" src ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcscat () +.\"O function is the wide-character equivalent +.\"O of the +.\"O .BR strcat (3) +.\"O function. +.\"O It copies the wide-character string pointed to by \fIsrc\fP, +.\"O including the terminating L\(aq\\0\(aq character, +.\"O to the end of the wide-character string pointed to by \fIdest\fP. +.BR wcscat () +´Ø¿ô¤Ï¡¢ +.BR strcat (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIsrc\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó(½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤ò´Þ¤à)¤ò¡¢ +\fIdest\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎºÇ¸å¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +.PP +.\"O The strings may not overlap. +¤³¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The programmer must ensure that there is room for at least +.\"O \fIwcslen(dest)+wcslen(src)+1\fP wide characters at \fIdest\fP. +¥×¥í¥°¥é¥Þ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fIwcslen(dest)+wcslen(src)+1\fP ʸ»ú¤Î +¥ï¥¤¥Éʸ»ú¤¬Æþ¤ë¤À¤±¤ÎÎΰè¤ò \fIdest\fP ¤ËÂФ·¤Æ³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR wcscat () +.\"O returns \fIdest\fP. +.BR wcscat () +¤Ï \fIdest\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strcat (3), +.BR wcpcpy (3), +.BR wcscpy (3), +.BR wcsncat (3) diff --git a/draft/man3/wcschr.3 b/draft/man3/wcschr.3 new file mode 100644 index 00000000..a225a055 --- /dev/null +++ b/draft/man3/wcschr.3 @@ -0,0 +1,65 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Oct 17 21:56:31 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSCHR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcschr \- search a wide character in a wide-character string +wcschr \- ¥ï¥¤¥Éʸ»úʸ»úÎóÃæ¤Î¥ï¥¤¥Éʸ»ú¤ò¸¡º÷¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcschr(const wchar_t *" wcs ", wchar_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcschr () +.\"O function is the wide-character equivalent +.\"O of the +.\"O .BR strchr (3) +.\"O function. +.\"O It searches the first occurrence of \fIwc\fP in the wide-character +.\"O string pointed to by \fIwcs\fP. +.BR wcschr () +´Ø¿ô¤Ï¡¢ +.BR strchr (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwcs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎÃæ¤ÇºÇ½é¤Ë¸½¤ï¤ì¤ë \fIwc\fP ¤ò¸¡º÷¤¹¤ë¡£ +.\"O.SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcschr () +.\"O function returns a pointer to the first occurrence of +.\"O \fIwc\fP in the wide-character string pointed to by \fIwcs\fP, or NULL if +.\"O \fIwc\fP does not occur in the string. +.BR wcschr () +´Ø¿ô¤Ï¡¢\fIwcs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎÃæ¤ÇºÇ½é¤Ë¸½¤ï¤ì¤¿ +\fIwc\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£\fIwc\fP ¤¬Ê¸»úÎóÃæ¤Ë¸½¤ï¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï +NULL ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strchr (3), +.BR wcspbrk (3), +.BR wcsrchr (3), +.BR wcsstr (3), +.BR wmemchr (3) diff --git a/draft/man3/wcscmp.3 b/draft/man3/wcscmp.3 new file mode 100644 index 00000000..6b1cca66 --- /dev/null +++ b/draft/man3/wcscmp.3 @@ -0,0 +1,71 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Oct 17 22:09:35 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSCMP 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcscmp \- compare two wide-character strings +wcscmp \- 2 ¤Ä¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤òÈæ³Ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int wcscmp(const wchar_t *" s1 ", const wchar_t *" s2 ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcscmp () +.\"O function is the wide-character equivalent +.\"O of the +.\"O .BR strcmp (3) +.\"O function. +.\"O It compares the wide-character string pointed to by \fIs1\fP and the +.\"O wide-character string pointed to by \fIs2\fP. +.BR wcscmp () +´Ø¿ô¤Ï¡¢ +.BR strcmp (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIs1\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤È +\fIs2\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤òÈæ³Ó¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcscmp () +.\"O function returns zero if the wide-character strings at +.\"O \fIs1\fP and \fIs2\fP are equal. +.\"O It returns an integer greater than zero if +.\"O at the first differing position \fIi\fP, the corresponding wide-character +.\"O \fIs1[i]\fP is greater than \fIs2[i]\fP. +.\"O It returns an integer less than zero if +.\"O at the first differing position \fIi\fP, the corresponding wide-character +.\"O \fIs1[i]\fP is less than \fIs2[i]\fP. +.BR wcscmp () +´Ø¿ô¤Ï¡¢\fIs1\fP ¤È \fIs2\fP ¤¬¤½¤ì¤¾¤ì»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó +¤¬Æ±¤¸¤Ç¤¢¤ì¤Ð 0 ¤òÊÖ¤¹¡£°Û¤Ê¤ëʸ»ú¤¬ºÇ½é¤Ë¸½¤ï¤ì¤¿°ÌÃ֤ˤª¤¤¤Æ¡¢¤½¤Î°Ì +Ã֤ˤ¢¤ë¥ï¥¤¥Éʸ»ú \fIs1[i]\fP ¤¬ \fIs2[i]\fP ¤è¤êÂ礭¤±¤ì¤ÐÀµ¤ÎÃͤòÊÖ¤¹¡£ +°Û¤Ê¤ëʸ»ú¤¬ºÇ½é¤Ë¸½¤ï¤ì¤¿°ÌÃ֤ˤª¤¤¤Æ¡¢¤½¤Î°ÌÃ֤ˤ¢¤ë¥ï¥¤¥Éʸ»ú \fIs1[i]\fP +¤¬ \fIs2[i]\fP ¤è¤ê¾®¤µ¤±¤ì¤ÐÉé¤ÎÃͤòÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strcmp (3), +.BR wcscasecmp (3), +.BR wmemcmp (3) diff --git a/draft/man3/wcscpy.3 b/draft/man3/wcscpy.3 new file mode 100644 index 00000000..1f889657 --- /dev/null +++ b/draft/man3/wcscpy.3 @@ -0,0 +1,71 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Oct 17 22:19:07 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcscpy \- copy a wide-character string +wcscpy \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcscpy(wchar_t *" dest ", const wchar_t *" src ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcscpy () +.\"O function is the wide-character equivalent +.\"O of the +.\"O .BR strcpy (3) +.\"O function. +.\"O It copies the wide-character string pointed to by \fIsrc\fP, +.\"O including the terminating L\(aq\\0\(aq character, to the array pointed to by +.\"O \fIdest\fP. +.BR wcscpy () +´Ø¿ô¤Ï¡¢ +.BR strcpy (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIsrc\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»ú(½ªÃ¼¤Î L\(aq\\0\(aq ¤ò´Þ¤à)¤ò +\fIdest\fP ¤¬»Ø¤¹ÇÛÎó¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +.PP +.\"O The strings may not overlap. +¤³¤ì¤é¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The programmer must ensure that there is +.\"O room for at least \fIwcslen(src)+1\fP +.\"O wide characters at \fIdest\fP. +¥×¥í¥°¥é¥Þ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fIwcslen(src)+1\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú +¤¬Æþ¤ë¤À¤±¤ÎÎΰè¤ò \fIdest\fP ¤ËÂФ·¤Æ³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR wcscpy () +.\"O returns \fIdest\fP. +.BR wcscpy () +¤Ï \fIdest\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strcpy (3), +.BR wcpcpy (3), +.BR wcscat (3), +.BR wcsdup (3), +.BR wmemcpy (3) diff --git a/draft/man3/wcscspn.3 b/draft/man3/wcscspn.3 new file mode 100644 index 00000000..8048e677 --- /dev/null +++ b/draft/man3/wcscspn.3 @@ -0,0 +1,79 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Oct 17 22:19:07 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSCSPN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcscspn \- search a wide-character string for any of a set of wide characters +wcscspn \- ¥ï¥¤¥Éʸ»úʸ»úÎ󤫤顢Ϳ¤¨¤¿Ê¸»ú½¸¹ç¤Ë´Þ¤Þ¤ì¤ëʸ»ú¤ò¸¡º÷¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t wcscspn(const wchar_t *" wcs ", const wchar_t *" reject ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcscspn () +.\"O function is the wide-character equivalent +.\"O of the +.\"O .BR strcspn (3) +.\"O function. +.\"O It determines the length of the longest initial segment of \fIwcs\fP +.\"O which consists entirely of wide-characters not listed in \fIreject\fP. +.\"O In +.\"O other words, it searches for the first occurrence in the wide-character +.\"O string \fIwcs\fP of any of the characters in the wide-character string +.\"O \fIreject\fP. +.BR wcscspn () +´Ø¿ô¤Ï¡¢ +.BR strcspn (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwcs\fP ¤ÎÀèƬÉôʬ¤òÄ´¤Ù¡¢\fIreject\fP ¤ËÎóµó¤µ¤ì¤Æ¤¤¤Ê¤¤ +¥ï¥¤¥Éʸ»ú¤À¤±¤Ë¤è¤Ã¤Æ¹½À®¤µ¤ì¤ëÉôʬ¤òºÇ¤âŤ¯¼è¤Ã¤¿¾ì¹ç¤ÎŤµ¤òµá¤á¤ë¡£ +¸À¤¤´¹¤¨¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úʸ»úÎó \fIwcs\fP ¤ÎÃæ¤Ë¡¢¥ï¥¤¥Éʸ»úÎó +\fIreject\fP ¤Ë´Þ¤Þ¤ì¤ë¤¤¤º¤ì¤«¤Îʸ»ú¤¬¸½¤ï¤ì¤ëºÇ½é¤Î°ÌÃÖ¤òõ¤¹¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcscspn () +.\"O function returns the number of +.\"O wide characters in the longest +.\"O initial segment of \fIwcs\fP which consists entirely of wide-characters not +.\"O listed in \fIreject\fP. +.\"O In other words, it returns the position of the first +.\"O occurrence in the wide-character string \fIwcs\fP +.\"O of any of the characters in +.\"O the wide-character string \fIreject\fP, +.\"O or \fIwcslen(wcs)\fP if there is none. +.BR wcscspn () +´Ø¿ô¤Ï¡¢\fIwcs\fP ¤ÎÀèƬÉôʬ¤òÄ´¤Ù¡¢\fIreject\fP ¤ËÎóµó +¤µ¤ì¤Æ¤¤¤Ê¤¤¥ï¥¤¥Éʸ»ú¤À¤±¤Ë¤è¤Ã¤Æ¹½À®¤µ¤ì¤ëÉôʬ¤òºÇ¤âŤ¯¼è¤Ã¤¿¾ì¹ç¤Î +Ťµ¤òÊÖ¤¹¡£ +¸À¤¤´¹¤¨¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úʸ»úÎó \fIwcs\fP ¤ÎÃæ¤Ë¡¢¥ï¥¤¥Éʸ»úÎó +\fIreject\fP ¤Ë´Þ¤Þ¤ì¤ë¤¤¤º¤ì¤«¤Îʸ»ú¤¬¸½¤ï¤ì¤ëºÇ½é¤Î°ÌÃÖ¤òÊÖ¤¹¡£ +²¿¤â¸½¤ï¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï \fIwcslen(wcs)\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strcspn (3), +.BR wcspbrk (3), +.BR wcsspn (3) diff --git a/draft/man3/wcsdup.3 b/draft/man3/wcsdup.3 new file mode 100644 index 00000000..4edf8d26 --- /dev/null +++ b/draft/man3/wcsdup.3 @@ -0,0 +1,90 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 18 22:36:21 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated & Modified Sun Jun 6 13:23:46 JST 2004 +.\" by Yuichi SATO +.\" +.TH WCSDUP 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcsdup \- duplicate a wide-character string +wcsdup \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤òÊ£À½¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "wchar_t *wcsdup(const wchar_t *" s ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcsdup () +.\"O function is the wide-character equivalent +.\"O of the +.\"O .BR strdup (3) +.\"O function. +.\"O It allocates and returns a new wide-character string whose initial +.\"O contents is a duplicate of the wide-character string pointed to by \fIs\fP. +.BR wcsdup () +´Ø¿ô¤Ï¡¢ +.BR strdup (3) +´Ø¿ô¤Î¥ï¥¤¥Éʸ»úÈǤǤ¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥Ý¥¤¥ó¥¿ \fIs\fP ¤¬»Ø¤·¼¨¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎÊ£À½¤ò +¿·¤·¤¤Îΰè¤Ë³ä¤êÅö¤Æ¤ÆÊÖ¤¹¡£ +.PP +.\"O Memory for the new wide-character string is +.\"O obtained with +.\"O .BR malloc (3), +.\"O and should be freed with +.\"O .BR free (3). +¿·¤·¤¤¥ï¥¤¥Éʸ»úʸ»úÎó¤Î¤¿¤á¤Î¥á¥â¥ê¤Ï +.BR malloc (3) +¤ò»È¤Ã¤Æ³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +¤³¤ÎÎΰè¤Ï +.BR free (3) +¤ò»È¤Ã¤Æ²òÊü¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcsdup () +.\"O function returns a pointer +.\"O to the new wide-character string, +.\"O or NULL if sufficient memory was not available. +.BR wcsdup () +´Ø¿ô¤Ï¡¢¿·¤·¤¤¥ï¥¤¥Éʸ»úʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +.\"O Insufficient memory available to allocate duplicate string. +Ê£À½Ê¸»úÎó¤ò³ä¤êÅö¤Æ¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.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 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +Linux °Ê³°¤Î¾¤Î¥·¥¹¥Æ¥à¤Ç¹­¤¯ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .\" present in libc5 and glibc 2.0 and later +.\" libc5 ¤È glibc 2.0 ¤È¤½¤ì°Ê¹ß¤Ë¸ºß¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strdup (3), +.BR wcscpy (3), +.BR feature_test_macros (7) diff --git a/draft/man3/wcslen.3 b/draft/man3/wcslen.3 new file mode 100644 index 00000000..13ba6c38 --- /dev/null +++ b/draft/man3/wcslen.3 @@ -0,0 +1,59 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 18 22:43:56 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSLEN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcslen \- determine the length of a wide-character string +wcslen \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎŤµ¤òµá¤á¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t wcslen(const wchar_t *" s ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcslen () +.\"O function is the wide-character equivalent +.\"O of the +.\"O .BR strlen (3) +.\"O function. +.\"O It determines the length of the wide-character string pointed to +.\"O by \fIs\fP, not including the terminating L\(aq\\0\(aq character. +.BR wcslen () +´Ø¿ô¤Ï¡¢ +.BR strlen (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎŤµ¤òµá¤á¤ë¡£ +½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤Ï¤³¤ÎŤµ¤Ë¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcslen () +.\"O function returns the +.\"O number of wide characters in \fIs\fP. +.BR wcslen () +´Ø¿ô¤Ï¡¢\fIs\fP ¤Ë´Þ¤Þ¤ì¤ë¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strlen (3) diff --git a/draft/man3/wcsncasecmp.3 b/draft/man3/wcsncasecmp.3 new file mode 100644 index 00000000..cee5982c --- /dev/null +++ b/draft/man3/wcsncasecmp.3 @@ -0,0 +1,96 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 18 22:59:06 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSNCASECMP 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcsncasecmp \- compare two fixed-size wide-character strings, ignoring case +wcsncasecmp \- Âçʸ»ú¤È¾®Ê¸»ú¤ò¶èÊ̤»¤º¡¢2 ¤Ä¤Î¸ÇÄêĹ¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤òÈæ³Ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int wcsncasecmp(const wchar_t *" s1 ", const wchar_t *" s2 ", size_t " n ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcsncasecmp () +.\"O function is the wide-character equivalent of the +.\"O .BR strncasecmp (3) +.\"O function. +.\"O It compares the wide-character string pointed to +.\"O by \fIs1\fP and the wide-character string +.\"O pointed to by \fIs2\fP, but at most +.\"O \fIn\fP wide characters from each string, ignoring case differences +.\"O .RB ( towupper (3), +.\"O .BR towlower (3)). +.BR wcsncasecmp () +´Ø¿ô¤Ï¡¢ +.BR strncasecmp (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø +¿ô¤Ç¤¢¤ë¡£¤³¤Î´Ø¿ô¤Ï¡¢\fIs1\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤È \fIs2\fP ¤¬»Ø +¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤òÈæ³Ó¤¹¤ë¤¬¡¢ºÇÂç¤Ç¤âÀèƬ¤Î¥ï¥¤¥Éʸ»ú \fIn\fP ¸Ä +¤·¤«Èæ³Ó¤·¤Ê¤¤¡£¤Þ¤¿¡¢Âçʸ»ú¤È¾®Ê¸»ú +.RB ( towupper (3), +.BR towlower (3)) +¤Ï¶èÊ̤·¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcsncasecmp () +.\"O function returns zero +.\"O if the wide-character strings at +.\"O \fIs1\fP and \fIs2\fP, +.\"O truncated to at most length \fIn\fP, are equal except +.\"O for case distinctions. +.\"O It returns a positive integer if truncated \fIs1\fP is +.\"O greater than truncated \fIs2\fP, ignoring case. +.\"O It returns a negative integer +.\"O if truncated \fIs1\fP is smaller than truncated \fIs2\fP, ignoring case. +.BR wcsncasecmp () +´Ø¿ô¤Ï¡¢\fIs1\fP ¤È \fIs2\fP ¤¬¤½¤ì¤¾¤ì»Ø¤¹Ê¸»úÎó¤ò +\fIn\fP ʸ»ú¤Ë¼ý¤Þ¤ë¤è¤¦¤ËÀÚ¤êµÍ¤á¤¿¤â¤Î¤ò¡¢Âçʸ»ú¤È¾®Ê¸»ú¤Î°ã¤¤¤ò̵»ë +¤·¤ÆÈæ³Ó¤·¤¿¤È¤­¤ËÅù¤·¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£¤³¤Î´Ø¿ô¤Ï¡¢Âçʸ»ú¤È¾®Ê¸»ú¤ò¶è +Ê̤·¤Ê¤¤¾ì¹ç¤Ë¡¢\fIs1\fP ¤òÀÚ¤êµÍ¤á¤¿¤â¤Î¤¬ \fIs2\fP ¤òÀÚ¤êµÍ¤á¤¿¤â¤Î +¤è¤êÂ礭¤±¤ì¤ÐÀµ¤ÎÃͤòÊÖ¤¹¡£¤³¤Î´Ø¿ô¤Ï¡¢Âçʸ»ú¤È¾®Ê¸»ú¤ò¶èÊ̤·¤Ê¤¤¾ì¹ç +¤Ë¡¢\fIs1\fP ¤òÀÚ¤êµÍ¤á¤¿¤â¤Î¤¬ \fIs2\fP ¤òÀÚ¤êµÍ¤á¤¿¤â¤Î¤è¤ê¾®¤µ¤±¤ì +¤ÐÉé¤ÎÃͤòÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.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 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +Linux °Ê³°¤Î¾¤Î¥·¥¹¥Æ¥à¤Ç¹­¤¯ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR wcsncasecmp () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR wcsncasecmp () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strncasecmp (3), +.BR wcsncmp (3) diff --git a/draft/man3/wcsncat.3 b/draft/man3/wcsncat.3 new file mode 100644 index 00000000..d1b05981 --- /dev/null +++ b/draft/man3/wcsncat.3 @@ -0,0 +1,67 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 18 23:11:34 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSNCAT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcsncat \- concatenate two wide-character strings +wcsncat \- 2 ¤Ä¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤ò·ë¹ç¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcsncat(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcsncat () +.\"O function is the wide-character equivalent of the +.\"O .BR strncat (3) +.\"O function. +.\"O It copies at most \fIn\fP wide characters from the wide-character +.\"O string pointed to by \fIsrc\fP to the end of the wide-character string pointed +.\"O to by \fIdest\fP, and adds a terminating L\(aq\\0\(aq character. +.BR wcsncat () +´Ø¿ô¤Ï +.BR strncat (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIsrc\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎ󤫤éºÇÂç \fIn\fP ¸Äʬ¤Î¥ï +¥¤¥Éʸ»ú¤ò¥³¥Ô¡¼¤·¤Æ¡¢\fIdest\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎËöÈø¤ËŽ¤êÉÕ +¤±¤ë¡£\fIdest\fP ¤Î½ªÃ¼¤Ë¤Ï L\(aq\\0\(aq ʸ»ú¤òÄɲ乤롣 +.PP +.\"O The strings may not overlap. +¤³¤ì¤é¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The programmer must ensure that there is room for at least +.\"O \fIwcslen(dest) + n + 1\fP wide characters at \fIdest\fP. +¥×¥í¥°¥é¥Þ¤Ï¡¢\fIdest\fP ¤Ë¾¯¤Ê¤¯¤È¤â \fIwcslen(dest) + n + 1\fP +¸Ä¤Î¥ï¥¤¥Éʸ»ú¤¬Æþ¤ëÎΰè¤ò³ÎÊݤ·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR wcsncat () +.\"O returns \fIdest\fP. +.BR wcsncat () +¤Ï \fIdest\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strncat (3), +.BR wcscat (3) diff --git a/draft/man3/wcsncmp.3 b/draft/man3/wcsncmp.3 new file mode 100644 index 00000000..e051ea0b --- /dev/null +++ b/draft/man3/wcsncmp.3 @@ -0,0 +1,77 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 18 23:40:56 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSNCMP 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcsncmp \- compare two fixed-size wide-character strings +wcsncmp \- 2 ¤Ä¤Î¸ÇÄêĹ¥ï¥¤¥Éʸ»úʸ»úÎó¤òÈæ³Ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int wcsncmp(const wchar_t *" s1 ", const wchar_t *" s2 ", size_t " n ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcsncmp () +.\"O function is the wide-character equivalent of the +.\"O .BR strncmp (3) +.\"O function. +.\"O It compares the wide-character string pointed to by \fIs1\fP and the +.\"O wide-character string pointed to by \fIs2\fP, but at most \fIn\fP wide +.\"O characters from each string. +.\"O In each string, the comparison extends only up +.\"O to the first occurrence of a L\(aq\\0\(aq character, if any. +.BR wcsncmp () +´Ø¿ô¤Ï¡¢ +.BR strncmp (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIs1\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤È \fIs2\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ +»úʸ»úÎó¤òÈæ³Ó¤¹¤ë¤¬¡¢ºÇÂç¤Ç¤âÀèƬ¤Î¥ï¥¤¥Éʸ»ú \fIn\fP ¸Ä¤Þ¤Ç¤·¤«Èæ³Ó +¤·¤Ê¤¤¡£¤Þ¤¿¤¤¤º¤ì¤«¤Îʸ»úÎó¤Ë L\(aq\\0\(aq ʸ»ú¤¬¸½¤ì¤¿¤é¡¢Èæ³Ó¤Ï +¤½¤Î°ÌÃ֤ǽªÎ»¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcsncmp () +.\"O function returns zero if the wide-character strings at +.\"O \fIs1\fP and \fIs2\fP, truncated to at most length \fIn\fP, are equal. +.\"O It returns an integer greater than zero if at the first differing position +.\"O \fIi\fP (\fIi\fP < \fIn\fP), +.\"O the corresponding wide-character \fIs1[i]\fP is +.\"O greater than \fIs2[i]\fP. +.\"O It returns an integer less than zero if at the first +.\"O differing position \fIi\fP (\fIi\fP < \fIn\fP), the corresponding +.\"O wide-character \fIs1[i]\fP is less than \fIs2[i]\fP. +.BR wcsncmp () +´Ø¿ô¤Ï¡¢\fIs1\fP ¤È \fIs2\fP ¤¬¤½¤ì¤¾¤ì»Ø¤¹Ê¸»úÎó¤ò +\fIn\fP ʸ»ú¤Ë¼ý¤Þ¤ë¤è¤¦¤ËÀÚ¤êµÍ¤á¤¿¤â¤Î¤¬Åù¤·¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +¤³¤Î´Ø¿ô¤Ï¡¢°Û¤Ê¤ëʸ»ú¤¬ºÇ½é¤Ë¸½¤ï¤ì¤¿°ÌÃÖ \fIi\fP (\fIi\fP < \fIn\fP) +¤Ë¤ª¤¤¤Æ¡¢¤½¤Î°ÌÃ֤ˤ¢¤ëʸ»ú \fIs1[i]\fP ¤¬ \fIs2[i]\fP ¤è¤êÂ礭¤±¤ì¤Ð +Àµ¤ÎÃͤòÊÖ¤¹¡£°Û¤Ê¤ëʸ»ú¤¬ºÇ½é¤Ë¸½¤ï¤ì¤¿°ÌÃÖ \fIi\fP (\fIi\fP < \fIn\fP) +¤Ë¤ª¤¤¤Æ¡¢¤½¤Î°ÌÃ֤ˤ¢¤ëʸ»ú \fIs1[i]\fP ¤¬ \fIs2[i]\fP ¤è¤ê¾®¤µ¤±¤ì¤Ð +Éé¤ÎÃͤòÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strncmp (3), +.BR wcsncasecmp (3) diff --git a/draft/man3/wcsncpy.3 b/draft/man3/wcsncpy.3 new file mode 100644 index 00000000..3ca6a166 --- /dev/null +++ b/draft/man3/wcsncpy.3 @@ -0,0 +1,80 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 19 02:13:45 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSNCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcsncpy \- copy a fixed-size string of wide characters +wcsncpy \- ¸ÇÄêĹ¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcsncpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcsncpy () +.\"O function is the wide-character equivalent of the +.\"O .BR strncpy (3) +.\"O function. +.\"O It copies at most \fIn\fP wide characters from the wide-character +.\"O string pointed to by \fIsrc\fP, +.\"O including the terminating L\(aq\\0\(aq character, +.\"O to the array pointed to by \fIdest\fP. +.\"O Exactly \fIn\fP wide characters are +.\"O written at \fIdest\fP. +.\"O If the length \fIwcslen(src)\fP is smaller than \fIn\fP, +.\"O the remaining wide characters in the array +.\"O pointed to by \fIdest\fP are filled +.\"O with L\(aq\\0\(aq characters. +.\"O If the length \fIwcslen(src)\fP is greater or equal +.\"O to \fIn\fP, the string pointed to by \fIdest\fP +.\"O will not be L\(aq\\0\(aq terminated. +.BR wcsncpy () +´Ø¿ô¤Ï¡¢ +.BR strncpy (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï \fIsrc\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎ󤫤顢½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤ò +´Þ¤á¤ÆºÇÂç \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ò¡¢\fIdest\fP ¤¬»Ø¤¹ÇÛÎó¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +¤Á¤ç¤¦¤É \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤¬ \fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +\fIwcslen(src)\fP ¤ÎŤµ¤¬ \fIn\fP ¤è¤ê¾®¤µ¤±¤ì¤Ð¡¢\fIdest\fP ¤¬»Ø¤¹ +ÇÛÎó¤Î»Ä¤ê¤Î¥ï¥¤¥Éʸ»ú¤ÎÉôʬ¤Ï L\(aq\\0\(aq ʸ»ú¤ÇËä¤á¤é¤ì¤ë¡£ +\fIwcslen(src)\fP ¤ÎŤµ¤¬ \fIn\fP °Ê¾å¤Ê¤é¤Ð¡¢\fIdest\fP ¤¬»Ø¤¹Ê¸»úÎó +¤¬ L\(aq\\0\(aq ¤Ç½ªÃ¼¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.PP +.\"O The strings may not overlap. +¤³¤ì¤é¤ÎÇÛÎó¤Ï½Å¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The programmer must ensure that there is room for at least \fIn\fP wide +.\"O characters at \fIdest\fP. +¥×¥í¥°¥é¥Þ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fIn\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤¬Æþ¤ë¤À¤±¤ÎÎΰè¤ò +\fIdest\fP ¤ËÂФ·¤Æ³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR wcsncpy () +.\"O returns \fIdest\fP. +.BR wcsncpy () +¤Ï \fIdest\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strncpy (3) diff --git a/draft/man3/wcsnlen.3 b/draft/man3/wcsnlen.3 new file mode 100644 index 00000000..bbf1f299 --- /dev/null +++ b/draft/man3/wcsnlen.3 @@ -0,0 +1,75 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 19 02:22:50 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSNLEN 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcsnlen \- determine the length of a fixed-size wide-character string +wcsnlen \- ¸ÇÄêĹ¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎŤµ¤òµá¤á¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "size_t wcsnlen(const wchar_t *" s ", size_t " maxlen ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcsnlen () +.\"O function is the wide-character equivalent +.\"O of the +.\"O .BR strnlen (3) +.\"O function. +.\"O It returns the number of wide-characters in the string pointed to by +.\"O \fIs\fP, not including the terminating L\(aq\\0\(aq character, but at most +.\"O \fImaxlen\fP. +.\"O In doing this, +.\"O .BR wcsnlen () +.\"O looks only at the first \fImaxlen\fP +.\"O wide-characters at \fIs\fP and never beyond \fIs+maxlen\fP. +.BR wcsnlen () +´Ø¿ô¤Ï¡¢ +.BR strnlen (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIs\fP ¤¬»Ø¤¹Ê¸»úÎóÃæ¤Î¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¤¬¡¢¤³¤ì¤ÏºÇÂç +\fImaxlen\fP ʸ»ú¤Þ¤Ç¤Ç¤¢¤ë¡£¤Þ¤¿¡¢½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤Ï´Þ¤Þ¤Ê¤¤¡£ +¤³¤ì¤ò¹Ô¤¦ºÝ¤Ë¤Ï¡¢ +.BR wcsnlen () +¤Ï \fIs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úÎó¤ÎºÇ½é¤Î +\fImaxlen\fP ʸ»ú¤·¤«¸«¤º¡¢·è¤·¤Æ \fIs+maxlen\fP ʸ»ú¤òĶ¤¨¤Æʸ»úÎó¤ò +»²¾È¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcsnlen () +.\"O function returns \fIwcslen(s)\fP, if that is less than +.\"O \fImaxlen\fP, or \fImaxlen\fP if there is no L\(aq\\0\(aq character among the +.\"O first \fImaxlen\fP wide characters pointed to by \fIs\fP. +.BR wcsnlen () +´Ø¿ô¤Ï¡¢\fIwcslen(s)\fP ¤ÎÃͤ¬ \fImaxlen\fP ¤è¤ê¾®¤µ¤±¤ì +¤Ð \fIwcslen(s)\fP ¤òÊÖ¤¹¡£¤¢¤ë¤¤¤Ï¡¢\fIs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úÎóÃæ¤Î +ºÇ½é¤Î \fImaxlen\fP ʸ»ú¤Ë L\(aq\\0\(aq ʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð +\fImaxlen\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is a GNU extension. +¤³¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strnlen (3), +.BR wcslen (3) diff --git a/draft/man3/wcsnrtombs.3 b/draft/man3/wcsnrtombs.3 new file mode 100644 index 00000000..a1c1649e --- /dev/null +++ b/draft/man3/wcsnrtombs.3 @@ -0,0 +1,170 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Fri Oct 22 01:12:12 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSNRTOMBS 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcsnrtombs \- convert a wide-character string to a multibyte string +wcsnrtombs \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "size_t wcsnrtombs(char *" dest ", const wchar_t **" src ", size_t " nwc , +.BI " size_t " len ", mbstate_t *" ps ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcsnrtombs () +.\"O function is like the +.\"O .BR wcsrtombs (3) +.\"O function, +.\"O except that the number of wide characters to be converted, +.\"O starting at \fI*src\fP, is limited to \fInwc\fP. +.BR wcsnrtombs () +´Ø¿ô¤Ï¡¢ +.BR wcsrtombs () +´Ø¿ô¤Ë»÷¤Æ¤¤¤ë¡£¤¿¤À¤·¡¢ +ÊÑ´¹¤µ¤ì¤ë¥ï¥¤¥Éʸ»ú¤Î¿ô¤¬(\fI*src\fP ¤«¤é¿ô¤¨¤Æ) \fInwc\fP ʸ»ú¤ËÀ©¸Â +¤µ¤ì¤Æ¤¤¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +.PP +.\"O If \fIdest\fP is not a NULL pointer, +.\"O the +.\"O .BR wcsnrtombs () +.\"O function converts +.\"O at most \fInwc\fP wide characters from +.\"O the wide-character string \fI*src\fP to a multibyte string starting at +.\"O \fIdest\fP. +.\"O At most \fIlen\fP bytes are written to \fIdest\fP. +.\"O The shift state +.\"O \fI*ps\fP is updated. +.\"O The conversion is effectively performed by repeatedly +.\"O calling +.\"O .IR "wcrtomb(dest, *src, ps)" , +.\"O as long as this call succeeds, +.\"O and then incrementing \fIdest\fP by the +.\"O number of bytes written and \fI*src\fP +.\"O by one. +.\"O The conversion can stop for three reasons: +\fIdest\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¡¢ +.BR wcsnrtombs () +´Ø¿ô¤Ï +¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎºÇÂç \fInwc\fP ¸Ä¤Þ¤Ç¤Î¥ï¥¤¥Éʸ»ú¤ò \fIdest\fP ¤«¤é +»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£\fIdest\fP ¤Ë¤ÏºÇÂç \fIlen\fP ¥Ð¥¤ +¥È¤Þ¤Ç½ñ¤­¹þ¤Þ¤ì¤ë¡£¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤Ï¹¹¿·¤µ¤ì¤ë¡£¼ÂºÝ¤Î¸ú²Ì¤È¤· +¤Æ¤Ï¡¢¤³¤ÎÊÑ´¹¤Ï°Ê²¼¤ÎÆ°ºî¤ÈƱ¤¸¤Ë¤Ê¤ë: +.IR "wcrtomb(dest, *src, ps)" +¤ò¸Æ¤Ó¡¢À®¸ù¤¬Ê֤俤é +\fIdest\fP ¤ò½ñ¤­¹þ¤ó¤À¥Ð¥¤¥È¿ô¤À¤±Áý¤ä¤·¡¢\fI*src\fP ¤ò 1 Áý¤ä¤¹¡£ +¤½¤·¤Æ¡¢wcrtomb ¤¬À®¸ù¤òÊÖ¤¹¸Â¤ê¤³¤ì¤ò·«¤êÊÖ¤¹¡£ +ÊÑ´¹¤¬»ß¤Þ¤ëÍýͳ¤Ï 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 \fI*src\fP +.\"O is left pointing to the invalid wide character, +.\"O .I (size_t)\ \-1 +.\"O is returned, +.\"O and \fIerrno\fP is set to \fBEILSEQ\fP. +1. (¸½ºß¤Î¥í¥±¡¼¥ë¤Ë´ð¤Å¤¤¤Æ)¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Çɽ¸½¤Ç¤­¤Ê¤¤¥ï¥¤¥Éʸ»ú¤Ë +½Ð²ñ¤Ã¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ï¡¢\fI*src\fP ¤ÏÉÔÀµ¤Ê¥ï¥¤¥Éʸ»ú¤ò»Ø¤·¤¿¾õÂ֤ˤʤꡢ +.I (size_t)\ \-1 +¤¬ÊÖ¤µ¤ì¡¢\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O 2. \fInwc\fP wide characters have been +.\"O converted without encountering a L\(aq\\0\(aq, +.\"O or the length limit forces a stop. +.\"O In this case \fI*src\fP is left pointing +.\"O to the next wide character to be converted, and the number of bytes written +.\"O to \fIdest\fP is returned. +2. L\(aq\\0\(aq ¤Ë½Ð²ñ¤ï¤Ê¤¤¤Ç \fInwc\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤òÊÑ´¹¤·¤¿¾ì¹ç¤«¡¢Ä¹ +¤µ¤ÎÀ©¸Â¤Ë¤è¤Ã¤ÆÊÑ´¹¤¬»ß¤á¤é¤ì¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢\fI*src\fP ¤Ï¼¡¤Ë +ÊÑ´¹¤µ¤ì¤ë¤Ù¤­¥ï¥¤¥Éʸ»ú¤ò»Ø¤·¤¿¾õÂ֤ˤʤꡢ\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿ +¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O 3. The wide-character string has been completely converted, including the +.\"O terminating L\(aq\\0\(aq (which has the side effect of bringing back \fI*ps\fP +.\"O to the initial state). +.\"O In this case \fI*src\fP is set to NULL, and the number +.\"O of bytes written to \fIdest\fP, excluding the terminating \(aq\\0\(aq byte, is +.\"O returned. +3. ¥ï¥¤¥Éʸ»úÎ󤬽ªÃ¼¤Î L\(aq\\0\(aq (¤³¤ì¤Ë¤Ï \fI*ps\fP ¤ò½é´ü¾õÂÖ¤ËÌ᤹¤È +¤¤¤¦ÉûºîÍѤ¬¤¢¤ë)¤â´Þ¤á¤ÆÁ´¤ÆÊÑ´¹¤µ¤ì¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ë¤Ï \fI*src\fP +¤Ë NULL ¤¬ÀßÄꤵ¤ì¡¢\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë +(½ªÃ¼¤Î \(aq\\0\(aq ¤Ï¿ô¤¨¤Ê¤¤)¡£ +.PP +.\"O If \fIdest\fP is NULL, \fIlen\fP is ignored, +.\"O and the conversion proceeds as above, +.\"O except that the converted bytes are not written out to memory, and that +.\"O no destination length limit exists. +\fIdest\fP ¤¬ NULL ¤Ê¤é¤Ð \fIlen\fP ¤Ï̵»ë¤µ¤ì¤ÆÁ°½Ò¤Î¤è¤¦¤ËÊÑ´¹¤¬¹Ô¤ï +¤ì¤ë¤¬¡¢ÊÑ´¹¤µ¤ì¤¿¥Ð¥¤¥È¥Ç¡¼¥¿¤Ï¥á¥â¥ê¤Ë½ñ¤­½Ð¤µ¤ì¤Ê¤¤ÅÀ¤È¡¢½ÐÎÏÀè¤ÎĹ +¤µ¤ÎÀ©¸Â¤¬¤Ê¤¤ÅÀ¤¬°Û¤Ê¤ë¡£ +.PP +.\"O In both of the above cases, +.\"O if \fIps\fP is a NULL pointer, a static anonymous +.\"O state only known to the wcsnrtombs function is used instead. +¾åµ­¤Î¤¤¤º¤ì¤Î¾ì¹ç¤â¡¢\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ê¤é¤Ð¡¢wcsnrtombs ´Ø¿ô +¤À¤±¤¬ÃΤäƤ¤¤ëÀÅŪ¤Êƿ̾¤Î¾õÂÖ¤¬¥·¥Õ¥È¾õÂÖ¤ÎÂå¤ï¤ê¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +.\"O The programmer must ensure that there is room for at least \fIlen\fP bytes +.\"O at \fIdest\fP. +¥×¥í¥°¥é¥Þ¤Ï¾¯¤Ê¤¯¤È¤â \fIlen\fP ¥Ð¥¤¥È¤ÎÎΰè¤ò \fIdest\fP ¤Ë³ÎÊݤ·¤Ê +¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcsnrtombs () +.\"O function returns +.\"O the number of bytes that make up the +.\"O converted part of multibyte sequence, +.\"O not including the terminating null byte. +.BR wcsnrtombs () +´Ø¿ô¤Ï¡¢ÊÑ´¹¤·¤ÆÆÀ¤é¤ì¤¿¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Î¥Ð¥¤¥È¿ô¤òÊÖ +¤¹¡£¤³¤ì¤Ë¤Ï½ªÃ¼¤Î null ¥Ð¥¤¥È¤Ï´Þ¤Þ¤Ê¤¤¡£ +.\"O If a wide character was encountered which +.\"O could not be converted, +.\"O .I (size_t)\ \-1 +.\"O is returned, and \fIerrno\fP set to \fBEILSEQ\fP. +ÊÑ´¹¤Ç¤­¤Ê¤¤¥ï¥¤¥Éʸ»ú¤Ë½Ð²ñ¤Ã¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤¬ÊÖ¤µ¤ì¡¢ \fIerrno\fP ¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O This function is a GNU extension. +¤³¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR wcsnrtombs () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR wcsnrtombs () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.\"O Passing NULL as \fIps\fP is not multithread safe. +\fIps\fP ¤Ë NULL ¤òÅϤ·¤¿ºÝ¤ÎÆ°ºî¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iconv (3), +.BR wcsrtombs (3) diff --git a/draft/man3/wcspbrk.3 b/draft/man3/wcspbrk.3 new file mode 100644 index 00000000..9f844fab --- /dev/null +++ b/draft/man3/wcspbrk.3 @@ -0,0 +1,67 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 15:19:34 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSPBRK 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcspbrk \- search a wide-character string for any of a set of wide characters +wcspbrk \- ¥ï¥¤¥Éʸ»úÎ󤫤顢Ϳ¤¨¤é¤ì¤¿¥ï¥¤¥Éʸ»ú½¸¹ç¤Ë´Þ¤Þ¤ì¤ëʸ»ú¤ò¸¡º÷¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcspbrk(const wchar_t *" wcs ", const wchar_t *" accept ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcspbrk () +.\"O function is the wide-character equivalent +.\"O of the +.\"O .BR strpbrk (3) +.\"O function. +.\"O It searches for the first occurrence in the wide-character +.\"O string pointed to by \fIwcs\fP of any of the +.\"O characters in the wide-character +.\"O string pointed to by \fIaccept\fP. +.BR wcspbrk () +´Ø¿ô¤Ï¡¢ +.BR strpbrk (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwcs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤Ë¤ª¤¤¤Æ¡¢\fIaccept\fP ¤¬ +¼¨¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤Î¤¤¤º¤ì¤«¤Îʸ»ú¤¬ºÇ½é¤Ë¸½¤ï¤ì¤ë°ÌÃÖ¤ò¸¡º÷¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcspbrk () +.\"O function returns a pointer to the first occurrence in +.\"O \fIwcs\fP of any of the characters listed in \fIaccept\fP. +.\"O If \fIwcs\fP +.\"O contains none of these characters, NULL is returned. +.BR wcspbrk () +´Ø¿ô¤Ï¡¢\fIaccept\fP ¤ËÎóµó¤µ¤ì¤¿Ê¸»ú¤Î¤¤¤º¤ì¤«¤¬ +\fIwcs\fP Ãæ¤ËºÇ½é¤Ë¸½¤ï¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£¤³¤Î¤è¤¦¤Êʸ»ú¤¬ +\fIwcs\fP ¤Ë´Þ¤Þ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢NULL ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strpbrk (3), +.BR wcschr (3), +.BR wcscspn (3) diff --git a/draft/man3/wcsrchr.3 b/draft/man3/wcsrchr.3 new file mode 100644 index 00000000..40dbdee2 --- /dev/null +++ b/draft/man3/wcsrchr.3 @@ -0,0 +1,62 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 15:19:34 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSRCHR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcsrchr \- search a wide character in a wide-character string +wcsrchr \- ¥ï¥¤¥Éʸ»úÎóÃæ¤Î¥ï¥¤¥Éʸ»ú¤òõ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcsrchr(const wchar_t *" wcs ", wchar_t " wc ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcsrchr () +.\"O function is the wide-character equivalent +.\"O of the +.\"O .BR strrchr (3) +.\"O function. +.\"O It searches the last occurrence of \fIwc\fP in the wide-character +.\"O string pointed to by \fIwcs\fP. +.BR wcsrchr () +´Ø¿ô¤Ï¡¢ +.BR strrchr (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwcs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎóÃæ¤Ë \fIwc\fP ¤¬ºÇ¸å¤Ë¸½¤ï +¤ì¤ë°ÌÃÖ¤ò¸¡º÷¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcsrchr () +.\"O function returns a pointer to the last occurrence of +.\"O \fIwc\fP in the wide-character string pointed to by \fIwcs\fP, or NULL if +.\"O \fIwc\fP does not occur in the string. +\fBwcsrchr\fP ´Ø¿ô¤Ï¡¢\fIwcs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎóÃæ¤Ë \fIwc\fP ¤¬ +ºÇ¸å¤Ë¸½¤ï¤ì¤¿°ÌÃÖ¤òÊÖ¤¹¡£¤³¤Îʸ»úÎó¤Ë \fIwc\fP ¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð +NULL ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strrchr (3), +.BR wcschr (3) diff --git a/draft/man3/wcsrtombs.3 b/draft/man3/wcsrtombs.3 new file mode 100644 index 00000000..97d89927 --- /dev/null +++ b/draft/man3/wcsrtombs.3 @@ -0,0 +1,160 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 15:38:11 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSRTOMBS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcsrtombs \- convert a wide-character string to a multibyte string +wcsrtombs \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t wcsrtombs(char *" dest ", const wchar_t **" src , +.BI " size_t " len ", mbstate_t *" ps ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O If \fIdest\fP is not a NULL pointer, +.\"O the +.\"O .BR wcsrtombs () +.\"O function converts +.\"O the wide-character string \fI*src\fP to a multibyte string starting at +.\"O \fIdest\fP. +.\"O At most \fIlen\fP bytes are written to \fIdest\fP. +.\"O The shift state +.\"O \fI*ps\fP is updated. +.\"O The conversion is effectively performed by repeatedly +.\"O calling +.\"O .IR "wcrtomb(dest, *src, ps)" , +.\"O as long as this call succeeds, +.\"O and then incrementing \fIdest\fP by the +.\"O number of bytes written and \fI*src\fP +.\"O by one. +.\"O The conversion can stop for three reasons: +\fIdest\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¡¢ +.BR wcsrtombs () +´Ø¿ô¤Ï +¥ï¥¤¥Éʸ»úʸ»úÎó \fI*src\fP ¤ò \fIdest\fP ¤¬»Ø¤¹¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó +¤ËÊÑ´¹¤¹¤ë¡£ºÇÂç \fIlen\fP ¥Ð¥¤¥È¤Þ¤Ç¤¬ \fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤Ï¹¹¿·¤µ¤ì¤ë¡£¼ÂºÝ¤Î¸ú²Ì¤È¤·¤Æ¤Ï¡¢¤³¤ÎÊÑ´¹¤Ï°Ê²¼ +¤ÎÆ°ºî¤ÈƱ¤¸¤Ë¤Ê¤ë: +.IR "wcrtomb(dest, *src, ps)" +¤ò¸Æ¤Ó¡¢À®¸ù¤¬Ê֤俤顢 +\fIdest\fP ¤ò½ñ¤­¹þ¤ó¤À¥Ð¥¤¥È¿ô¤À¤±Áý¤ä¤·¡¢\fI*src\fP ¤ò 1 Áý¤ä¤¹¡£ +¤½¤·¤Æ¡¢wcrtomb ¤¬À®¸ù¤òÊÖ¤¹¸Â¤ê¤³¤ì¤ò·«¤êÊÖ¤¹¡£ +ÊÑ´¹¤¬»ß¤Þ¤ëÍýͳ¤Ï 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 \fI*src\fP +.\"O is left pointing to the invalid wide character, +.\"O .I (size_t)\ \-1 +.\"O is returned, +.\"O and +.\"O .I errno +.\"O is set to \fBEILSEQ\fP. +(¸½ºß¤Î¥í¥±¡¼¥ë¤Ë´ð¤Å¤¤¤Æ)¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Çɽ¸½¤Ç¤­¤Ê¤¤¥ï¥¤¥Éʸ»ú¤Ë +½Ð²ñ¤Ã¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ï¡¢\fI*src\fP ¤ÏÉÔÀµ¤Ê¥ï¥¤¥Éʸ»ú¤ò»Ø¤·¤¿¾õÂ֤ˤʤꡢ +.I (size_t)\ \-1 +¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +.\"O 2. The length limit forces a stop. +.\"O In this case \fI*src\fP is left pointing +.\"O to the next wide character to be converted, +.\"O and the number of bytes written to +.\"O \fIdest\fP is returned. +2. Ťµ¤ÎÀ©¸Â¤Ë¤è¤êÊÑ´¹¤¬»ß¤á¤é¤ì¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢\fI*src\fP ¤Ï¼¡¤Ë +ÊÑ´¹¤µ¤ì¤ë¤Ù¤­¥ï¥¤¥Éʸ»úÎó¤ò»Ø¤·¤¿¾õÂ֤ˤʤꡢ\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì +¤¿¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O 3. The wide-character string has been completely converted, including the +.\"O terminating L\(aq\\0\(aq (which has the side effect of bringing back \fI*ps\fP +.\"O to the initial state). +.\"O In this case \fI*src\fP is set to NULL, and the number +.\"O of bytes written to \fIdest\fP, excluding the terminating \(aq\\0\(aq byte, is +.\"O returned. +3. ¥ï¥¤¥Éʸ»úÎ󤬽ªÃ¼¤Î L\(aq\\0\(aq (¤³¤ì¤Ë¤Ï \fI*ps\fP ¤ò½é´ü¾õÂÖ¤ËÌ᤹¤È +¤¤¤¦ÉûºîÍѤ¬¤¢¤ë)¤â´Þ¤á¤ÆÁ´¤ÆÊÑ´¹¤µ¤ì¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ë¤Ï \fI*src\fP +¤Ë NULL ¤¬ÀßÄꤵ¤ì¡¢\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë +(½ªÃ¼¤Î \(aq\\0\(aq ¤Ï¿ô¤¨¤Ê¤¤)¡£ +.PP +.\"O If \fIdest\fP is NULL, \fIlen\fP is ignored, +.\"O and the conversion proceeds as above, except that the converted bytes +.\"O are not written out to memory, and that +.\"O no length limit exists. +\fIdest\fP ¤¬ NULL ¤Ê¤é¤Ð \fIlen\fP ¤Ï̵»ë¤µ¤ì¤ÆÁ°½Ò¤Î¤è¤¦¤ËÊÑ´¹¤¬¹Ô¤ï +¤ì¤ë¤¬¡¢ÊÑ´¹¤µ¤ì¤¿¥Ð¥¤¥È¥Ç¡¼¥¿¤Ï¥á¥â¥ê¤Ë½ñ¤­½Ð¤µ¤ì¤Ê¤¤ÅÀ¤È¡¢½ÐÎÏÀè¤ÎĹ +¤µ¤ÎÀ©¸Â¤¬¤Ê¤¤ÅÀ¤¬°Û¤Ê¤ë¡£ +.PP +.\"O In both of the above cases, +.\"O if \fIps\fP is a NULL pointer, a static anonymous +.\"O state only known to the wcsrtombs function is used instead. +¾åµ­¤Î¤¤¤º¤ì¤Î¾ì¹ç¤â¡¢\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ê¤é¤Ð¡¢wcsnrtombs ´Ø¿ô +¤À¤±¤¬ÃΤäƤ¤¤ëÀÅŪ¤Êƿ̾¤Î¾õÂÖ¤¬¥·¥Õ¥È¾õÂÖ¤ÎÂå¤ï¤ê¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +.\"O The programmer must ensure that there is room for at least \fIlen\fP bytes +.\"O at \fIdest\fP. +¥×¥í¥°¥é¥Þ¤Ï¾¯¤Ê¤¯¤È¤â \fIlen\fP ¥Ð¥¤¥È¤ÎÎΰè¤ò \fIdest\fP ¤Ë³ÎÊݤ·¤Ê +¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcsrtombs () +.\"O function returns +.\"O the number of bytes that make up the +.\"O converted part of multibyte sequence, +.\"O not including the terminating null byte. +.BR wcsrtombs () +¤Ï¡¢ÊÑ´¹¤·¤ÆÆÀ¤é¤ì¤¿¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¤³¤ì¤Ë¤Ï½ªÃ¼¤Î null ¥Ð¥¤¥È¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +.\"O If a wide character was encountered +.\"O which could not be converted, +.\"O .I (size_t)\ \-1 +.\"O is returned, and +.\"O .I errno +.\"O set to \fBEILSEQ\fP. +ÊÑ´¹¤Ç¤­¤Ê¤¤¥ï¥¤¥Éʸ»ú¤Ë½Ð²ñ¤Ã¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.\"O The behavior of +.\"O .BR wcsrtombs () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR wcsrtombs () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.\"O Passing NULL as \fIps\fP is not multithread safe. +\fIps\fP ¤Ë NULL ¤òÅϤ·¤¿ºÝ¤ÎÆ°ºî¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iconv (3), +.BR wcsnrtombs (3), +.BR wcstombs (3) diff --git a/draft/man3/wcsspn.3 b/draft/man3/wcsspn.3 new file mode 100644 index 00000000..3cb866eb --- /dev/null +++ b/draft/man3/wcsspn.3 @@ -0,0 +1,77 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 15:46:13 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSSPN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcsspn \- advance in a wide-character string, skipping +.\"O any of a set of wide characters +wcsspn \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¿Ê¤ß¡¢¥ï¥¤¥Éʸ»ú¤Î½¸¹ç¤Îʸ»ú¤ò¥¹¥­¥Ã¥×¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t wcsspn(const wchar_t *" wcs ", const wchar_t *" accept ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcsspn () +.\"O function is the wide-character equivalent of the +.\"O .BR strspn (3) +.\"O function. +.\"O It determines the length of the longest initial segment of \fIwcs\fP +.\"O which consists entirely of wide-characters listed in \fIaccept\fP. +.\"O In other +.\"O words, it searches for the first occurrence in the wide-character string +.\"O \fIwcs\fP of a wide-character not contained in the wide-character string +.\"O \fIaccept\fP. +.BR wcsspn () +´Ø¿ô¤Ï¡¢ +.BR strspn (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwcs\fP ¤ÎÀèƬÉôʬ¤òÄ´¤Ù¡¢\fIaccept\fP ¤ËÎóµó¤µ¤ì¤Æ¤¤¤ë +¥ï¥¤¥Éʸ»ú¤À¤±¤Ë¤è¤Ã¤Æ¹½À®¤µ¤ì¤ëÉôʬ¤òºÇ¤âŤ¯¼è¤Ã¤¿¾ì¹ç¤ÎŤµ¤òµá¤á¤ë¡£ +¸À¤¤´¹¤¨¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úʸ»úÎó \fIwcs\fP ¤ÎÃæ¤Ë¡¢¥ï¥¤¥Éʸ»úÎó +\fIaccept\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤Ê¸»ú¤¬¸½¤ï¤ì¤ëºÇ½é¤Î°ÌÃÖ¤òõ¤¹¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcsspn () +.\"O function returns the number of +.\"O wide characters in the longest +.\"O initial segment of \fIwcs\fP which consists entirely of wide-characters listed +.\"O in \fIaccept\fP. +.\"O In other words, it returns the position of the first +.\"O occurrence in the wide-character string \fIwcs\fP of a wide-character not +.\"O contained in the wide-character string \fIaccept\fP, or \fIwcslen(wcs)\fP +.\"O if there is none. +.BR wcsspn () +´Ø¿ô¤Ï¡¢\fIwcs\fP ¤ÎÀèƬÉôʬ¤òÄ´¤Ù¡¢\fIaccept\fP ¤ËÎóµó¤µ +¤ì¤Æ¤¤¤ë¥ï¥¤¥Éʸ»ú¤À¤±¤Ë¤è¤Ã¤Æ¹½À®¤µ¤ì¤ëÉôʬ¤òºÇ¤âŤ¯¼è¤Ã¤¿¾ì¹ç¤ÎŤµ +¤òÊÖ¤¹¡£ +¸À¤¤´¹¤¨¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úʸ»úÎó \fIwcs\fP ¤ÎÃæ¤Ë¡¢¥ï¥¤¥Éʸ»úÎó +\fIaccept\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤Ê¸»ú¤¬¸½¤ï¤ì¤ëºÇ½é¤Î°ÌÃÖ¤òÊÖ¤¹¡£ +²¿¤â¸½¤ï¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï \fIwcslen(wcs)\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strspn (3), +.BR wcscspn (3) diff --git a/draft/man3/wcsstr.3 b/draft/man3/wcsstr.3 new file mode 100644 index 00000000..5c6b964a --- /dev/null +++ b/draft/man3/wcsstr.3 @@ -0,0 +1,71 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 15:50:55 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSSTR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcsstr \- locate a substring in a wide-character string +wcsstr \- ¥ï¥¤¥Éʸ»úʸ»úÎóÃæ¤ÎÉôʬʸ»úÎó¤Î°ÌÃÖ¤òÆÃÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcsstr(const wchar_t *" haystack ", const wchar_t *" needle ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcsstr () +.\"O function is the wide-character equivalent of the +.\"O .BR strstr (3) +.\"O function. +.\"O It searches for the first occurrence of the wide-character string +.\"O \fIneedle\fP (without its terminating L\(aq\\0\(aq character) as a substring in +.\"O the wide-character string \fIhaystack\fP. +.BR wcsstr () +´Ø¿ô¤Ï¡¢ +.BR strstr (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»úʸ»úÎó¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úʸ»úÎó \fIneedle\fP (½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤Ï´Þ¤Þ¤Ê¤¤) +¤¬¡¢¥ï¥¤¥Éʸ»úʸ»úÎó \fIhaystack\fP ¤ÎÉôʬʸ»úÎó¤È¤·¤ÆºÇ½é¤Ë¸½¤ï¤ì¤ë°Ì +ÃÖ¤òõ¤¹¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcsstr () +.\"O function returns a pointer to the first occurrence of +.\"O \fIneedle\fP in \fIhaystack\fP. +.\"O It returns NULL if \fIneedle\fP does not occur +.\"O as a substring in \fIhaystack\fP. +.BR wcsstr () +´Ø¿ô¤Ï¡¢\fIhaystack\fP Ãæ¤Ë \fIneedle\fP ¤¬¸½¤ï¤ì¤¿ºÇ½é¤Î +°ÌÃÖ¤òÊÖ¤¹¡£\fIneedle\fP ¤¬ \fIhaystack\fP ¤ÎÉôʬʸ»úÎó¤Ç¤Ê¤±¤ì¤Ð +NULL ¤òÊÖ¤¹¡£ +.PP +.\"O Note the special case: +.\"O If \fIneedle\fP is the empty wide-character string, +.\"O the return value is always \fIhaystack\fP itself. +°Ê²¼¤ÎÆüì¤Ê¾ì¹ç¤ËÃí°Õ¤¹¤ë¤³¤È: \fIneedle\fP ¤¬¶õ¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤Ê +¤é¤Ð¡¢ÊÖ¤êÃͤϾï¤Ë \fIhaystack\fP ¼«¿È¤È¤Ê¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strstr (3), +.BR wcschr (3) diff --git a/draft/man3/wcstoimax.3 b/draft/man3/wcstoimax.3 new file mode 100644 index 00000000..64172dbf --- /dev/null +++ b/draft/man3/wcstoimax.3 @@ -0,0 +1,77 @@ +.\" 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 Sep 11 07:57:58 JST 2004 +.\" by Yuichi SATO +.\" +.TH WCSTOIMAX 3 2003-11-01 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcstoimax, wcstoumax \- convert wide-character string to integer +wcstoimax, wcstoumax \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤òÀ°¿ô¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "intmax_t wcstoimax(const wchar_t *" nptr ", wchar_t **" endptr \ +", int " base ); +.br +.BI "uintmax_t wcstoumax(const wchar_t *" nptr ", wchar_t **" endptr \ +", int " base ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O These functions are just like +.\"O .BR wcstol (3) +.\"O and +.\"O .BR wcstoul (3), +.\"O except that they return a value of type +.\"O .I intmax_t +.\"O and +.\"O .IR uintmax_t , +.\"O respectively. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¤Á¤ç¤¦¤É +.BR wcstol (3) +¤È +.BR wcstoul (3) +¤Ë»÷¤Æ¤¤¤ë¤¬¡¢¤½¤ì¤¾¤ì +.I intmax_t +¤È +.I uintmax_t +·¿¤ÎÃͤòÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR imaxabs (3), +.BR imaxdiv (3), +.BR strtoimax (3), +.BR strtoumax (3), +.\" FIXME . the pages referred to by the following xrefs are not yet written +.BR wcstol (3), +.BR wcstoul (3) diff --git a/draft/man3/wcstok.3 b/draft/man3/wcstok.3 new file mode 100644 index 00000000..3379194b --- /dev/null +++ b/draft/man3/wcstok.3 @@ -0,0 +1,126 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 17:53:50 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSTOK 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcstok \- split wide-character string into tokens +wcstok \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥È¡¼¥¯¥ó¤Ëʬ³ä¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcstok(wchar_t *" wcs ", const wchar_t *" delim \ +", wchar_t **" ptr ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcstok () +.\"O function is the wide-character equivalent of the +.\"O .BR strtok (3) +.\"O function, +.\"O with an added argument to make it multithread-safe. It can be used +.\"O to split a wide-character string \fIwcs\fP into tokens, where a token is +.\"O defined as a substring not containing any wide-characters from \fIdelim\fP. +.BR wcstok () +´Ø¿ô¤Ï¡¢ +.BR strtok (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ë¡¢ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤ÎÆ°ºî¤ò¤µ¤»¤ë¤¿¤á¤Î°ú¤­¿ô¤òÄɲä·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤òÍѤ¤¤Æ¡¢¥ï¥¤¥Éʸ»úʸ»úÎó \fIwcs\fP ¤ò¥È¡¼¥¯¥ó¤Ëʬ²ò¤¹¤ë¤³¤È +¤¬¤Ç¤­¤ë¡£¤³¤³¤Ç¡¢¥È¡¼¥¯¥ó¤Ï \fIdelim\fP ¤ËÎóµó¤µ¤ì¤Æ¤¤¤ëʸ»ú¤ò´Þ¤Þ¤Ê +¤¤Éôʬʸ»úÎó¤È¤·¤ÆÄêµÁ¤µ¤ì¤ë¡£ +.PP +.\"O The search starts at \fIwcs\fP, if \fIwcs\fP is not NULL, +.\"O or at \fI*ptr\fP, if \fIwcs\fP is NULL. +.\"O First, any delimiter wide-characters are skipped, that is, the +.\"O pointer is advanced beyond any wide-characters which occur in \fIdelim\fP. +¸¡º÷¤Ï \fIwcs\fP ¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð \fIwcs\fP ¤«¤é³«»Ï¤µ¤ì¡¢\fIwcs\fP +¤¬ NULL ¤Ê¤é¤Ð \fI*ptr\fP ¤«¤é³«»Ï¤µ¤ì¤ë¡£¤Þ¤º¡¢Á´¤Æ¤Î¶èÀÚ¤ê¥ï¥¤¥Éʸ»ú +¤¬¥¹¥­¥Ã¥×¤µ¤ì¤ë¡£¤Ä¤Þ¤ê¡¢\fIdelim\fP ¤Ë´Þ¤Þ¤ì¤ë¥ï¥¤¥Éʸ»ú¤òĶ¤¨¤ë¤è¤¦ +¤Ë¥Ý¥¤¥ó¥¿¤¬Á°¤Ë¿Ê¤á¤é¤ì¤ë¡£ +.\"O If the end of the wide-character string is now reached, +.\"O .BR wcstok () +.\"O returns NULL, to indicate that no tokens +.\"O were found, and stores an appropriate value in \fI*ptr\fP, +.\"O so that subsequent calls to +.\"O .BR wcstok () +.\"O will continue to return NULL. +.\"O Otherwise, the +.\"O .BR wcstok () +.\"O function recognizes the beginning of a token +.\"O and returns a pointer to it, but before doing that, it zero-terminates the +.\"O token by replacing the next wide-character which occurs in \fIdelim\fP with +.\"O a L\(aq\\0\(aq character, +.\"O and it updates \fI*ptr\fP so that subsequent calls will +.\"O continue searching after the end of recognized token. +¥ï¥¤¥Éʸ»úʸ»úÎó¤Î½ª¤ï¤ê¤Ë㤷¤¿¤é¡¢ +.BR wcstok () +¤Ï NULL ¤òÊÖ¤·¤Æ +¥È¡¼¥¯¥ó¤¬Á´¤¯¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤·¡¢¤³¤Î¸å¤Ë +.BR wcstok () +¤ò¸Æ¤Ó +½Ð¤·¤Æ¤â NULL ¤¬ÊÖ¤µ¤ì¤ë¤è¤¦¤Ë \fI*ptr\fP ¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£¤½¤ì +°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR wcstok () +´Ø¿ô¤Ï¥È¡¼¥¯¥ó¤ÎÀèƬ¤ò¼±Ê̤·¡¢¤³¤ì¤ò»Ø¤¹ +¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¤¿¤À¤·¤³¤ì¤ò¹Ô¤¦Á°¤Ë¡¢¥È¡¼¥¯¥ó¤Î¸å¤Ë¤¢¤ë¡¢\fIdelim\fP +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ëʸ»ú¤ò L\(aq\\0\(aq ¤ËÃÖ¤­´¹¤¨¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥È¡¼¥¯¥ó¤ò 0 ¤Ç +½ªÃ¼¤µ¤»¤ë¡£¤µ¤é¤Ë \fI*ptr\fP ¤ò¹¹¿·¤·¡¢¸å¤Ç +.BR wcstok () +¤ò¸Æ¤Ó½Ð¤·¤¿ +ºÝ¤Ë¡¢¼±Ê̤µ¤ì¤¿¥È¡¼¥¯¥ó¤Î³¤­¤«¤é¸¡º÷¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcstok () +.\"O function returns a pointer to the next token, +.\"O or NULL if no further token was found. +.BR wcstok () +´Ø¿ô¤Ï¼¡¤Î¥È¡¼¥¯¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¥È¡¼¥¯¥ó¤¬¸«¤Ä¤«¤é +¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The original \fIwcs\fP wide-character string is destructively modified during +.\"O the operation. +´Ø¿ô¤ËÍ¿¤¨¤¿¥ï¥¤¥Éʸ»úÎó \fIwcs\fP ¤Ï¡¢´Ø¿ô¤ÎÆ°ºî¤Ë¤è¤Ã¤Æ´°Á´¤Ë½ñ¤­´¹ +¤¨¤é¤ì¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The following code loops over the tokens contained in a wide-character string. +°Ê²¼¤Î¥³¡¼¥É¤Ï¡¢¥ï¥¤¥Éʸ»úʸ»úÎó¤Ë´Þ¤Þ¤ì¤ë¥È¡¼¥¯¥ó¤ò¼è¤ê½Ð¤·¤Ê¤¬¤é +¥ë¡¼¥×¤¹¤ë¡£ +.sp +.nf +wchar_t *wcs = ...; +wchar_t *token; +wchar_t *state; +for (token = wcstok(wcs, " \\t\\n", &state); + token != NULL; + token = wcstok(NULL, " \\t\\n", &state)) { + ... +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR strtok (3), +.BR wcschr (3) diff --git a/draft/man3/wcstombs.3 b/draft/man3/wcstombs.3 new file mode 100644 index 00000000..56020f25 --- /dev/null +++ b/draft/man3/wcstombs.3 @@ -0,0 +1,130 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcstombs \- convert a wide-character string to a multibyte string +wcstombs \- ¥ï¥¤¥Éʸ»úÎó¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t wcstombs(char *" dest ", const wchar_t *" src ", size_t " n ); +.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 ¥Ð¥¤¥È¤¬½ñ¤­¹þ¤Þ¤ì¤ë¡£ +ÊÑ´¹¤Ï½é´ü¾õÂ֤dz«»Ï¤µ¤ì¤ë¡£ÊÑ´¹¤Ï°Ê²¼¤Î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 +¤¬ÊÖ¤µ¤ì¤ë¡£ +.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 ¤Ë +½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë¡£¤·¤«¤·¤³¤Î»þÅÀ¤Ç¤Î¥·¥Õ¥È¾õÂ֤ϼº¤ï¤ì¤ë¡£ +.PP +.\"O 3. The wide-character string has been completely converted, including the +.\"O terminating 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 \(aq\\0\(aq byte, is returned. +3. ¥ï¥¤¥Éʸ»úÎ󤬽ªÃ¼¤Î L\(aq\\0\(aq ¤ò´Þ¤á¤Æ´°Á´¤ËÊÑ´¹¤µ¤ì¤¿¾ì¹ç¡£ +¤³¤Î¾ì¹ç¤Ë¤ÏÊÑ´¹¤Ï½é´ü¾õÂ֤ǽª¤ê¡¢½ªÃ¼¤Î \(aq\\0\(aq ¥Ð¥¤¥È¤ò½ü¤¤¤Æ +\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +.PP +.\"O The programmer must ensure that there is room for at least \fIn\fP bytes +.\"O at \fIdest\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 ¤Ï̵»ë¤µ¤ì¤ë¡£¾åµ­¤ÈƱÍͤËÊÑ´¹¤¬¹Ô +¤Ê¤ï¤ì¤ë¤¬ÊÑ´¹·ë²Ì¤Î¥Ð¥¤¥ÈÎó¤Ï¥á¥â¥ê¤Ë¤Ï½ñ¤­¹þ¤Þ¤ì¤Ê¤¤¡£ +¤Þ¤¿Ä¹¤µ¤Î¾å¸Â¤¬Â¸ºß¤·¤Ê¤¤¡£ +.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" +.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" +.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 +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +.\"O The function +.\"O .BR wcsrtombs () +.\"O provides a thread safe interface to +.\"O the same functionality. +.BR wcsrtombs () +´Ø¿ô¤ÏƱ¤¸µ¡Ç½¤Î¤¿¤á¤Î¥¹¥ì¥Ã¥É¡¦¥»¡¼¥Õ¤Ê +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR wcsrtombs (3) diff --git a/draft/man3/wcswidth.3 b/draft/man3/wcswidth.3 new file mode 100644 index 00000000..5b469abd --- /dev/null +++ b/draft/man3/wcswidth.3 @@ -0,0 +1,72 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 18:44:42 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSWIDTH 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcswidth \- determine columns needed for a fixed-size wide-character string +wcswidth \- ¸ÇÄꥵ¥¤¥º¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤Îɽ¼¨¤ËɬÍפʥ«¥é¥à¿ô¤òµá¤á¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.B #include +.sp +.BI "int wcswidth(const wchar_t *" s ", size_t " n ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcswidth () +.\"O function returns the +.\"O number of columns needed to represent +.\"O the wide-character string pointed to by \fIs\fP, but at most \fIn\fP wide +.\"O characters. +.\"O If a nonprintable wide character occurs among these characters, +.\"O \-1 is returned. +.BR wcswidth () +´Ø¿ô¤Ï¡¢\fIs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤òɽ¸½¤¹¤ë¤¿¤á¤Ë +ɬÍפʥ«¥é¥à¿ô¤òÊÖ¤¹¡£¤¿¤À¤·¡¢ºÇÂç \fIn\fP ʸ»ú¤·¤«½èÍý¤·¤Ê¤¤¡£ +°õºþ²Äǽ¤Ç¤Ê¤¤¥ï¥¤¥Éʸ»ú¤¬Ê¸»úÎó¤Ë´Þ¤Þ¤ì¤ë¾ì¹ç¤Ë¤Ï¡¢ \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcswidth () +.\"O function +.\"O returns the number of column positions for the +.\"O wide-character string \fIs\fP, truncated to at most length \fIn\fP. +.BR wcswidth () +´Ø¿ô¤Ï¡¢¥ï¥¤¥Éʸ»úʸ»úÎó \fIs\fP ¤Îɽ¸½¤ËɬÍפʥ«¥é¥à¿ô +¤òÊÖ¤¹¡£¤¿¤À¤·¥ï¥¤¥Éʸ»úʸ»úÎó¤ÏºÇÂç \fIn\fP ¸Ä¤ËÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR wcswidth () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR wcswidth () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iswprint (3), +.BR wcwidth (3) diff --git a/draft/man3/wctob.3 b/draft/man3/wctob.3 new file mode 100644 index 00000000..2c28a106 --- /dev/null +++ b/draft/man3/wctob.3 @@ -0,0 +1,93 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 19:35:47 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCTOB 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wctob \- try to represent a wide character as a single byte +wctob \- ¥ï¥¤¥Éʸ»ú¤Î¥·¥ó¥°¥ë¥Ð¥¤¥Èɽ¸½¤ò»î¤ß¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int wctob(wint_t " c ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wctob () +.\"O function tests whether +.\"O the multibyte representation of the +.\"O wide character \fIc\fP, starting in the initial state, consists of a single +.\"O byte. +.\"O If so, it is returned as an +.\"O .IR "unsigned char" . +.BR wctob () +´Ø¿ô¤Ï¡¢¥ï¥¤¥Éʸ»ú \fIc\fP ¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èɽ¸½(½é´ü¾õÂ֤dz« +»Ï)¤¬¥·¥ó¥°¥ë¥Ð¥¤¥Èʸ»ú¤À¤±¤Ç¤Ç¤­¤Æ¤¤¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£¤â¤·¤½¤¦¤Ç¤¢ +¤ì¤Ð¡¢¤³¤ì¤ò +.I "unsigned char" +·¿¤È¤·¤ÆÊÖ¤¹¡£ +.PP +.\"O Never use this function. +.\"O It cannot help you in writing internationalized +.\"O programs. +.\"O Internationalized programs must never distinguish single-byte and +.\"O multibyte characters. +¤³¤Î´Ø¿ô¤Ï·è¤·¤Æ»È¤ï¤Ê¤¤¤³¤È¡£¤³¤Î´Ø¿ô¤Ï¹ñºÝ²½¥×¥í¥°¥é¥à¤ò½ñ¤¯¾å¤Ç¤ÏÌò +¤ËΩ¤¿¤Ê¤¤¡£¹ñºÝ²½¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¥·¥ó¥°¥ë¥Ð¥¤¥Èʸ»ú¤È¥Þ¥ë¥Á¥Ð¥¤¥È +ʸ»ú¤ò¶èÊ̤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wctob () +.\"O function returns the single-byte representation of \fIc\fP, +.\"O if it exists, of \fBEOF\fP otherwise. +.BR wctob () +´Ø¿ô¤Ï \fIc\fP ¤Î¥·¥ó¥°¥ë¥Ð¥¤¥Èɽ¸½¤¬Â¸ºß¤¹¤ì¤Ð¡¢¤½¤Îɽ¸½ +¤òÊÖ¤¹¡£Â¸ºß¤·¤Ê¤±¤ì¤Ð \fBEOF\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR wctob () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR wctob () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.\"O This function should never be used. +.\"O Internationalized programs must never +.\"O distinguish single-byte and multibyte characters. +.\"O Use the function +.\"O .BR wctomb (3) +.\"O instead. +¤³¤Î´Ø¿ô¤Ï·è¤·¤Æ»È¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£¹ñºÝ²½¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¥·¥ó¥°¥ë¥Ð¥¤¥È +ʸ»ú¤È¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò¶èÊ̤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¤³¤Î´Ø¿ô¤Ç¤Ï¤Ê¤¯ +.BR wctomb (3) +´Ø¿ô¤ò»È¤¦¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR btowc (3), +.BR wctomb (3) diff --git a/draft/man3/wctomb.3 b/draft/man3/wctomb.3 new file mode 100644 index 00000000..161b792e --- /dev/null +++ b/draft/man3/wctomb.3 @@ -0,0 +1,124 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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 +.SH ̾Á° +.\"O wctomb \- convert a wide character to a multibyte sequence +wctomb \- ¥ï¥¤¥Éʸ»ú¤ò¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÊÑ´¹¤¹¤ë¡£ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int wctomb(char *" s ", wchar_t " wc ); +.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. +.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 +¥Ð¥¤¥È¤Î¶õ¤­¤¬¤¢¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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" +.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 ¤òÊÖ¤¹¡£ +.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 () +´Ø¿ô¤Ïʸ»úÉä¹æ¤¬¥·¥Õ¥È¾õÂÖ¤Ë +°Í¸¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¥¼¥í°Ê³°¡¢¥·¥Õ¥È¾õÂ֤˰͸¤·¤Ê¤¤¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.\"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 +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.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) +´Ø¿ô¤Ï +Ʊ¤¸µ¡Ç½¤Î¤è¤êÎɤ¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR MB_CUR_MAX (3), +.BR wcrtomb (3), +.BR wcstombs (3) diff --git a/draft/man3/wctrans.3 b/draft/man3/wctrans.3 new file mode 100644 index 00000000..4d31d2b1 --- /dev/null +++ b/draft/man3/wctrans.3 @@ -0,0 +1,97 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 19:48:40 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCTRANS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wctrans \- wide-character translation mapping +wctrans \- ¥ï¥¤¥Éʸ»úÊÑ´¹¥Þ¥Ã¥Ô¥ó¥° +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wctrans_t wctrans(const char *" name ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The \fIwctrans_t\fP type represents a mapping +.\"O which can map a wide character to +.\"O another wide character. +.\"O Its nature is implementation-dependent, but the special +.\"O value \fI(wctrans_t)\ 0\fP denotes an invalid mapping. +.\"O Nonzero \fIwctrans_t\fP +.\"O values can be passed to the +.\"O .BR towctrans (3) +.\"O function to actually perform +.\"O the wide-character mapping. +\fIwctrans_t\fP ·¿¤Ï¡¢¤¢¤ë¥ï¥¤¥Éʸ»ú¤ò¾¤Î¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤Ç¤­¤ë¥Þ¥Ã¥Ô +¥ó¥°¤òɽ¸½¤¹¤ë¡£ËܼÁŪ¤Ë¤Ï¼ÂÁõ°Í¸¤Ç¤¢¤ë¤¬¡¢Æüì¤ÊÃÍ +\fI(wctrans_t)0\fP ¤ÏÉÔÀµ¤Ê¥Þ¥Ã¥Ô¥ó¥°¤ò¼¨¤¹¡£0 ¤Ç¤Ê¤¤Ãͤò»ý¤Ä +\fIwctrans_t\fP ¤ò +.BR towctrans (3) +´Ø¿ô¤ËÅϤ¹¤³¤È¤Ë¤è¤Ã¤Æ¡¢¼ÂºÝ¤Ë +¥ï¥¤¥Éʸ»ú¤ÎÊÑ´¹¤ò¼Â¹Ô¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O The +.\"O .BR wctrans () +.\"O function returns a mapping, given by its name. +.\"O The set of +.\"O valid names depends on the +.\"O .B LC_CTYPE +.\"O category of the current locale, but the +.\"O following names are valid in all locales. +.BR wctrans () +¤Ï¡¢Ì¾Á°¤Ë¤è¤Ã¤ÆÍ¿¤¨¤é¤ì¤ë¥Þ¥Ã¥Ô¥ó¥°¤òÊÖ¤¹¡£Í­¸ú¤Ê̾Á°¤Î +½¸¹ç¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¤¬¡¢°Ê²¼¤Î̾Á°¤ÏÁ´¤Æ¤Î¥í¥±¡¼¥ë¤Ë¤ª¤¤¤ÆÍ­¸ú¤Ç¤¢¤ë¡£ +.nf + +.\"O "tolower" \- realizes the \fBtolower\fP(3) mapping + "tolower" \- \fBtolower\fP(3) ¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¼Â¸½¤¹¤ë +.\"O "toupper" \- realizes the \fBtoupper\fP(3) mapping + "toupper" \- \fBtoupper\fP(3) ¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¼Â¸½¤¹¤ë +.fi +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wctrans () +.\"O function returns a mapping descriptor if the \fIname\fP +.\"O is valid. +.\"O Otherwise it returns \fI(wctrans_t) 0\fP. +.BR wctrans () +´Ø¿ô¤Ï¡¢\fIname\fP ¤¬Í­¸ú¤Ê¤é¤Ð¥Þ¥Ã¥Ô¥ó¥°µ­½Ò»Ò¤òÊÖ¤¹¡£ +Í­¸ú¤Ç¤Ê¤±¤ì¤Ð \fI(wctrans_t) 0\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR wctrans () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR wctrans () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR towctrans (3) diff --git a/draft/man3/wctype.3 b/draft/man3/wctype.3 new file mode 100644 index 00000000..8a64e69f --- /dev/null +++ b/draft/man3/wctype.3 @@ -0,0 +1,120 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 20:01:16 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCTYPE 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wctype \- wide-character classification +wctype \- ¥ï¥¤¥Éʸ»ú¤ÎʬÎà +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wctype_t wctype(const char *" name ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The \fBwctype_t\fP type represents a property which a wide character may or +.\"O may not have. +.\"O In other words, it represents a class of wide characters. +\fBwctype_t\fP ·¿¤Ï¡¢¥ï¥¤¥Éʸ»ú¤¬»ý¤Ã¤Æ¤¤¤ë¡¢¤¢¤ë¤¤¤Ï»ý¤Ã¤Æ¤¤¤Ê¤¤Â°À­ +¤òɽ¸½¤¹¤ë¡£¸À¤¤´¹¤¨¤ë¤È¡¢\fBwctype_t\fP ·¿¤Ï¥ï¥¤¥Éʸ»ú¤Î¥¯¥é¥¹¤ò +ɽ¸½¤¹¤ë¡£ +.\"O This type's nature is implementation-dependent, but the special value +.\"O \fI(wctype_t) 0\fP denotes an invalid property. +.\"O Nonzero \fBwctype_t\fP values +.\"O can be passed to the +.\"O .BR iswctype (3) +.\"O function +.\"O to actually test whether a given +.\"O wide character has the property. +¤³¤Î·¿¤ÏËܼÁŪ¤Ë¼ÂÁõ°Í¸¤Ç¤¢¤ë¤¬¡¢Æüì¤ÊÃÍ \fI(wctype_t) 0\fP ¤ÏÉÔÀµ¤Ê +°À­¤ò¼¨¤¹¡£0 ¤Ç¤Ê¤¤Ãͤò»ý¤Ä \fBwctype_t\fP ¤ò +.BR iswctype (3) +´Ø¿ô¤ËÅÏ +¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¢Í¿¤¨¤é¤ì¤¿¥ï¥¤¥Éʸ»ú¤¬¤½¤Î°À­¤ò»ý¤Ä¤«¤É¤¦¤«¤ò¼ÂºÝ¤Ë¥Æ +¥¹¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +x.PP +.\"O The +.\"O .BR wctype () +.\"O function returns a property, given by its name. +.\"O The set of +.\"O valid names depends on the +.\"O .B LC_CTYPE +.\"O category of the current locale, but the +.\"O following names are valid in all locales. +.BR wctype () +´Ø¿ô¤Ï¡¢Ì¾Á°¤Ë¤è¤Ã¤ÆÍ¿¤¨¤é¤ì¤ë°À­¤òÊÖ¤¹¡£Í­¸ú¤Ê̾Á°¤Î½¸ +¹ç¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¤¬¡¢°Ê²¼¤Î̾Á°¤ÏÁ´¤Æ¤Î¥í¥±¡¼¥ë¤ÇÍ­¸ú¤Ç¤¢¤ë¡£ +.sp +.nf +.\"O "alnum" \- realizes the \fBisalnum\fP(3) classification function +.\"O "alpha" \- realizes the \fBisalpha\fP(3) classification function +.\"O "blank" \- realizes the \fBisblank\fP(3) classification function +.\"O "cntrl" \- realizes the \fBiscntrl\fP(3) classification function +.\"O "digit" \- realizes the \fBisdigit\fP(3) classification function +.\"O "graph" \- realizes the \fBisgraph\fP(3) classification function +.\"O "lower" \- realizes the \fBislower\fP(3) classification function +.\"O "print" \- realizes the \fBisprint\fP(3) classification function +.\"O "punct" \- realizes the \fBispunct\fP(3) classification function +.\"O "space" \- realizes the \fBisspace\fP(3) classification function +.\"O "upper" \- realizes the \fBisupper\fP(3) classification function +.\"O "xdigit" \- realizes the \fBisxdigit\fP(3) classification function + "alnum" \- ¥¯¥é¥¹²½´Ø¿ô \fBisalnum\fP(3) ¤ò¼Â¸½¤¹¤ë + "alpha" \- ¥¯¥é¥¹²½´Ø¿ô \fBisalpha\fP(3) ¤ò¼Â¸½¤¹¤ë + "blank" \- ¥¯¥é¥¹²½´Ø¿ô \fBisblank\fP(3) ¤ò¼Â¸½¤¹¤ë + "cntrl" \- ¥¯¥é¥¹²½´Ø¿ô \fBiscntrl\fP(3) ¤ò¼Â¸½¤¹¤ë + "digit" \- ¥¯¥é¥¹²½´Ø¿ô \fBisdigit\fP(3) ¤ò¼Â¸½¤¹¤ë + "graph" \- ¥¯¥é¥¹²½´Ø¿ô \fBisgraph\fP(3) ¤ò¼Â¸½¤¹¤ë + "lower" \- ¥¯¥é¥¹²½´Ø¿ô \fBislower\fP(3) ¤ò¼Â¸½¤¹¤ë + "print" \- ¥¯¥é¥¹²½´Ø¿ô \fBisprint\fP(3) ¤ò¼Â¸½¤¹¤ë + "punct" \- ¥¯¥é¥¹²½´Ø¿ô \fBispunct\fP(3) ¤ò¼Â¸½¤¹¤ë + "space" \- ¥¯¥é¥¹²½´Ø¿ô \fBisspace\fP(3) ¤ò¼Â¸½¤¹¤ë + "upper" \- ¥¯¥é¥¹²½´Ø¿ô \fBisupper\fP(3) ¤ò¼Â¸½¤¹¤ë + "xdigit" \- ¥¯¥é¥¹²½´Ø¿ô \fBisxdigit\fP(3) ¤ò¼Â¸½¤¹¤ë +.fi +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wctype () +.\"O function returns a property descriptor +.\"O if the \fIname\fP is valid. +.\"O Otherwise it returns \fI(wctype_t) 0\fP. +.BR wctype () +´Ø¿ô¤Ï¡¢\fIname\fP ¤¬Í­¸ú¤Ê¤é¤Ð°À­µ­½Ò»Ò¤òÊÖ¤¹¡£ +Í­¸ú¤Ç¤Ê¤±¤ì¤Ð \fI(wctype_t) 0\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR wctype () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR wctype () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iswctype (3) diff --git a/draft/man3/wcwidth.3 b/draft/man3/wcwidth.3 new file mode 100644 index 00000000..20478829 --- /dev/null +++ b/draft/man3/wcwidth.3 @@ -0,0 +1,82 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 20:06:18 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Fri Aug 16 01:32:21 JST 2002 +.\" by Akihiro MOTOKI +.\" +.TH WCWIDTH 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wcwidth \- determine columns needed for a wide character +wcwidth \- ¥ï¥¤¥Éʸ»ú¤¬É¬ÍפȤ¹¤ë¥«¥é¥à¿ô¤òÄ´¤Ù¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.B #include +.sp +.BI "int wcwidth(wchar_t " c ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wcwidth () +.\"O function returns the number of columns +.\"O needed to represent the wide character \fIc\fP. +.\"O If \fIc\fP is a printable wide character, the value +.\"O is at least 0. +.\"O If \fIc\fP is L\(aq\\0\(aq, the value is 0. +.\"O Otherwise \-1 is returned. +.BR wcwidth () +´Ø¿ô¤Ï¡¢¥ï¥¤¥Éʸ»ú \fIc\fP ¤òɽ¸½¤¹¤ë¤¿¤á¤ËɬÍפʥ«¥é¥à +¿ô¤òÊÖ¤¹¡£\fIc\fP ¤¬°õºþ²Äǽʸ»ú¤Ê¤é¤Ð¡¢¤³¤ÎÃÍ¤Ï 0 °Ê¾å¤Ç¤¢¤ë¡£ +\fIc\fP ¤¬ L\(aq\\0\(aq ¤Ê¤é¤Ð¡¢ÃÍ¤Ï 0 ¤Ç¤¢¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wcwidth () +.\"O function returns the number of +.\"O column positions for \fIc\fP. +.BR wcwidth () +´Ø¿ô¤Ï¡¢\fIc\fP ¤Îɽ¸½¤ËɬÍפʥ«¥é¥à¿ô¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. + +.\"O Note that glibc before 2.2.5 used the prototype +glibc 2.2.5 °ÊÁ°¤Ç¤Ï°Ê²¼¤Î¥×¥í¥È¥¿¥¤¥×Àë¸À¤¬»ÈÍѤµ¤ì¤Æ¤¤¤¿¤³¤È¤Ë +Ãí°Õ¤¹¤ë¤³¤È¡£ +.br +.nf +.BI "int wcwidth(wint_t " c ); +.fi +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR wcwidth () +.\"O depends on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR wcwidth () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR iswprint (3), +.BR wcswidth (3), +.BR feature_test_macros (7) diff --git a/draft/man3/wmemchr.3 b/draft/man3/wmemchr.3 new file mode 100644 index 00000000..dcade71a --- /dev/null +++ b/draft/man3/wmemchr.3 @@ -0,0 +1,62 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 26 00:03:46 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WMEMCHR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wmemchr \- search a wide character in a wide-character array +wmemchr \- ¥ï¥¤¥Éʸ»ú¤ÎÇÛÎ󤫤é¥ï¥¤¥Éʸ»ú¤òõ¤¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wmemchr(const wchar_t *" s ", wchar_t " c ", size_t " n ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wmemchr () +.\"O function is the wide-character equivalent of the +.\"O .BR memchr (3) +.\"O function. +.\"O It searches the \fIn\fP wide characters starting at \fIs\fP for +.\"O the first occurrence of the wide character \fIc\fP. +.BR wmemchr () +´Ø¿ô¤Ï¡¢ +.BR memchr (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIs\fP ¤òÀèƬ¤È¤¹¤ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ÎÃ椫¤é¡¢ºÇ½é +¤Ë¥ï¥¤¥Éʸ»ú \fIc\fP ¤¬¸½¤ï¤ì¤ë¾ì½ê¤òõ¤¹¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wmemchr () +.\"O function returns a pointer to the first occurrence of \fIc\fP +.\"O among the \fIn\fP wide characters starting at \fIs\fP, or NULL if \fIc\fP does +.\"O not occur among these. +.BR wmemchr () +´Ø¿ô¤Ï¡¢\fIs\fP ¤òÀèƬ¤È¤¹¤ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ÎÃæ +¤Ë¤ª¤¤¤ÆºÇ½é¤Ë \fIc\fP ¤¬¸½¤ï¤ì¤ë¾ì½ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£\fIc\fP ¤¬¸½ +¤ï¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï NULL ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR memchr (3), +.BR wcschr (3) diff --git a/draft/man3/wmemcmp.3 b/draft/man3/wmemcmp.3 new file mode 100644 index 00000000..36149f96 --- /dev/null +++ b/draft/man3/wmemcmp.3 @@ -0,0 +1,74 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 26 00:39:25 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WMEMCMP 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wmemcmp \- compare two arrays of wide-characters +wmemcmp \- ¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó 2 ¤Ä¤òÈæ³Ó¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int wmemcmp(const wchar_t *" s1 ", const wchar_t *" s2 ", size_t " n ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wmemcmp () +.\"O function is the wide-character equivalent of the +.\"O .BR memcmp (3) +.\"O function. +.\"O It compares the \fIn\fP wide-characters starting at \fIs1\fP and the +.\"O \fIn\fP wide-characters starting at \fIs2\fP. +.BR wmemcmp () +´Ø¿ô¤Ï¡¢ +.BR memcmp (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIs1\fP ¤òÀèƬ¤È¤¹¤ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤È \fIs2\fP ¤ò +ÀèƬ¤È¤¹¤ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤òÈæ³Ó¤¹¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR wmemcmp () +.\"O function returns +.\"O zero if the wide-character arrays of size +.\"O \fIn\fP at \fIs1\fP and \fIs2\fP are equal. +.\"O It returns an integer greater than +.\"O zero if at the first differing position \fIi\fP (\fIi\fP < \fIn\fP), the +.\"O corresponding wide-character \fIs1[i]\fP is greater than \fIs2[i]\fP. +.\"O It returns an integer less than zero if +.\"O at the first differing position \fIi\fP +.\"O (\fIi\fP < \fIn\fP), the corresponding +.\"O wide-character \fIs1[i]\fP is less than +.\"O \fIs2[i]\fP. +.BR wmemcmp () +´Ø¿ô¤Ï¡¢\fIs1\fP ¤È \fIs2\fP ¤òÀèƬ¤È¤¹¤ëÂ礭¤µ¤¬ +\fIn\fP ¤Î 2 ¤Ä¤ÎÇÛÎó¤¬Åù¤·¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +ºÇ½é¤Ë°Û¤Ê¤ëʸ»ú¤¬¸½¤ï¤ì¤¿°ÌÃÖ \fIi\fP (\fIi\fP < \fIn\fP)¤Ë¤ª¤¤¤Æ¡¢¤½ +¤Î°ÌÃ֤ˤ¢¤ë¥ï¥¤¥Éʸ»ú \fIs1[i]\fP ¤¬ \fIs2[i]\fP ¤è¤êÂ礭¤±¤ì¤ÐÀµ¤ÎÀ° +¿ô¤òÊÖ¤¹¡£ +ºÇ½é¤Ë°Û¤Ê¤ëʸ»ú¤¬¸½¤ï¤ì¤¿°ÌÃÖ \fIi\fP (\fIi\fP < \fIn\fP)¤Ë¤ª¤¤¤Æ¡¢¤½ +¤Î°ÌÃ֤ˤ¢¤ë¥ï¥¤¥Éʸ»ú \fIs1[i]\fP ¤¬ \fIs2[i]\fP ¤è¤ê¾®¤µ¤±¤ì¤ÐÉé¤ÎÀ° +¿ô¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR memcmp (3), +.BR wcscmp (3) diff --git a/draft/man3/wmemcpy.3 b/draft/man3/wmemcpy.3 new file mode 100644 index 00000000..e4961b0c --- /dev/null +++ b/draft/man3/wmemcpy.3 @@ -0,0 +1,72 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 26 00:43:58 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WMEMCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wmemcpy \- copy an array of wide-characters +wmemcpy \- ¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤ò¥³¥Ô¡¼¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wmemcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wmemcpy () +.\"O function is the wide-character equivalent of the +.\"O .BR memcpy (3) +.\"O function. +.\"O It copies \fIn\fP wide characters from the array starting at +.\"O \fIsrc\fP to the array starting at \fIdest\fP. +.BR wmemcpy () +´Ø¿ô¤Ï¡¢ +.BR memcpy (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIsrc\fP ¤òÀèƬ¤È¤¹¤ëÇÛÎ󤫤é \fIdest\fP ¤òÀèƬ¤È¤¹¤ëÇÛÎó +¤Ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ò¥³¥Ô¡¼¤¹¤ë¡£ +.PP +.\"O The arrays may not overlap; use +.\"O .BR wmemmove (3) +.\"O to copy between overlapping +.\"O arrays. +2 ¤Ä¤ÎÇÛÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ÇÛÎ󤬽ŤʤäƤ¤¤ë¾ì¹ç¤Ë¤Ï +.BR wmemmove (3) +¤ò»È¤Ã¤Æ¥³¥Ô¡¼¤¹¤ë¤³¤È¡£ +.PP +.\"O The programmer must ensure that there is room for at least \fIn\fP wide +.\"O characters at \fIdest\fP. +¥×¥í¥°¥é¥Þ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤¬Æþ¤ëÎΰè¤ò \fIdest\fP +¤Ë³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR wmemcpy () +.\"O returns \fIdest\fP. +.BR wmemcpy () +¤Ï \fIdest\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR memcpy (3), +.BR wcscpy (3), +.BR wmemmove (3), +.BR wmempcpy (3) diff --git a/draft/man3/wmemmove.3 b/draft/man3/wmemmove.3 new file mode 100644 index 00000000..17f60f51 --- /dev/null +++ b/draft/man3/wmemmove.3 @@ -0,0 +1,65 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 26 00:51:13 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WMEMMOVE 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wmemmove \- copy an array of wide-characters +wmemmove \-¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤ò¥³¥Ô¡¼¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wmemmove(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wmemmove () +.\"O function is the wide-character equivalent of the +.\"O .BR memmove (3) +.\"O function. +.\"O It copies \fIn\fP wide characters from the array +.\"O starting at \fIsrc\fP to the array starting at \fIdest\fP. +.\"O The arrays may +.\"O overlap. +.BR wmemmove () +´Ø¿ô¤Ï¡¢ +.BR memmove (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢ +¤ë¡£¤³¤Î´Ø¿ô¤Ï \fIsrc\fP ¤òÀèƬ¤È¤¹¤ëÇÛÎ󤫤é \fIdest\fP ¤òÀèƬ¤È¤¹¤ë +ÇÛÎó¤Ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ò¥³¥Ô¡¼¤¹¤ë¡£2 ¤Ä¤ÎÇÛÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤â +¹½¤ï¤Ê¤¤¡£ +.PP +.\"O The programmer must ensure that there is room for at least \fIn\fP wide +.\"O characters at \fIdest\fP. +¥×¥í¥°¥é¥Þ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤¬Æþ¤ëÎΰè¤ò \fIdest\fP +¤Ë³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR wmemmove () +.\"O returns \fIdest\fP. +.BR wmemmove () +¤Ï \fIdest\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR memmove (3), +.BR wmemcpy (3) diff --git a/draft/man3/wmemset.3 b/draft/man3/wmemset.3 new file mode 100644 index 00000000..15f4b372 --- /dev/null +++ b/draft/man3/wmemset.3 @@ -0,0 +1,56 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 26 00:51:32 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WMEMSET 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wmemset \- fill an array of wide-characters with a constant wide character +wmemset \- ¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤òÄê¿ô¤Î¥ï¥¤¥Éʸ»ú¤ÇËä¤á¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wmemset(wchar_t *" wcs ", wchar_t " wc ", size_t " n ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wmemset () +.\"O function is the wide-character equivalent of the +.\"O .BR memset (3) +.\"O function. +.\"O It fills the array of \fIn\fP wide-characters starting at \fIwcs\fP +.\"O with \fIn\fP copies of the wide character \fIwc\fP. +.BR wmemset () +´Ø¿ô¤Ï¡¢ +.BR memset (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fBmemset\fP ¤òÀèƬ¤È¤¹¤ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤ò¡¢ +¥ï¥¤¥Éʸ»ú \fIwc\fP ¤Î \fIn\fP ¸Ä¤Î¥³¥Ô¡¼¤ÇËä¤á¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR wmemset () +.\"O returns \fIwcs\fP. +.BR wmemset () +¤Ï \fIwcs\fP ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR memset (3) diff --git a/draft/man3/wordexp.3 b/draft/man3/wordexp.3 new file mode 100644 index 00000000..6b9d710a --- /dev/null +++ b/draft/man3/wordexp.3 @@ -0,0 +1,347 @@ +.\" 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 Sep 12 05:05:19 JST 2004 +.\" by Yuichi SATO +.\" +.TH WORDEXP 3 2008-07-14 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wordexp, wordfree \- perform word expansion like a posix-shell +wordexp, wordfree \- posix ¥·¥§¥ë¤Î¤è¤¦¤Ëñ¸ì¤ÎŸ³«¤ò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B "#include " +.sp +.BI "int wordexp(const char *" s ", wordexp_t *" p ", int " flags ); +.sp +.BI "void wordfree(wordexp_t *" p ); +.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 wordexp (), +.BR wordfree (): +_XOPEN_SOURCE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The function +.\"O .BR wordexp () +.\"O performs a shell-like expansion of the string +.\"O .I s +.\"O and returns the result in the structure pointed to by +.\"O .IR p . +´Ø¿ô +.BR wordexp () +¤Ï¥·¥§¥ë¤Î¤è¤¦¤Ëʸ»úÎó +.I s +¤òŸ³«¤·¡¢ +.I p +¤Ç»Ø¤·¼¨¤¹¹½Â¤ÂΤ˷ë²Ì¤òÊÖ¤¹¡£ +.\"O The data type +.\"O .I wordexp_t +.\"O is a structure that at least has the fields +.\"O .IR we_wordc , +.\"O .IR we_wordv , +.\"O and +.\"O .IR we_offs . +¥Ç¡¼¥¿·¿ +.I wordexp_t +¤Ï¾¯¤Ê¤¯¤È¤â¥Õ¥£¡¼¥ë¥É +.IR we_wordc , +.IR we_wordv , +.I we_offs +¤ò»ý¤Ä¹½Â¤ÂΤǤ¢¤ë¡£ +.\"O The field +.\"O .I we_wordc +.\"O is a +.\"O .I size_t +.\"O that gives the number of words in the expansion of +.\"O .IR s . +¥Õ¥£¡¼¥ë¥É +.I we_wordc +¤Ï +.I size_t +¤Ç¤¢¤ê¡¢ +.I s +¤òŸ³«¤·¤¿·ë²Ì¤Ëñ¸ì¤¬¤¤¤¯¤Ä¤¢¤ë¤«¤òɽ¤¹¡£ +.\"O The field +.\"O .I we_wordv +.\"O is a +.\"O .I char ** +.\"O that points to the array of words found. +¥Õ¥£¡¼¥ë¥É +.I we_wordv +¤Ï +.I char ** +¤Ç¤¢¤ê¡¢¸«¤Ä¤«¤Ã¤¿Ã±¸ì¤ÎÇÛÎó¤ò»Ø¤·¼¨¤¹¡£ +.\"O The field +.\"O .I we_offs +.\"O of type +.\"O .I size_t +.\"O is sometimes (depending on +.\"O .IR flags , +.\"O see below) used to indicate the number of initial elements in the +.\"O .I we_wordv +.\"O array that should be filled with NULLs. +.I size_t +·¿¤Î¥Õ¥£¡¼¥ë¥É +.I we_offs +¤Ï¡¢ +.I we_wordv +ÇÛÎó¤Ë¤¢¤ë½é´üÍ×ÁǤΤ¦¤Á¤¤¤¯¤Ä¤¬ +NULL ¤ÇËä¤á¤é¤ì¤ë¤Ù¤­¤«¤òɽ¤¹¤Î¤Ë»È¤ï¤ì¤¿¤ê¤¹¤ë +.RI ( flags +¤Ë¤è¤ê·èÄꤵ¤ì¤ë¡£²¼µ­¤ò»²¾È¡£)¡£ +.LP +.\"O The function +.\"O .BR wordfree () +.\"O frees the allocated memory again. +.\"O More precisely, it does not free +.\"O its argument, but it frees the array +.\"O .I we_wordv +.\"O and the strings that points to. +´Ø¿ô +.BR wordfree () +¤Ï³ä¤êÅö¤Æ¤¿¥á¥â¥ê¤òºÆÅÙ²òÊü¤¹¤ë¡£ +¤è¤êÀµ³Î¤Ë¤¤¤¦¤È¡¢¤³¤Î´Ø¿ô¤Ï¤½¤Î°ú¤­¿ô¤ò²òÊü¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +ÇÛÎó +.I we_wordv +¤È¤½¤ì¤¬»Ø¤·¼¨¤¹Ê¸»úÎó¤ò²òÊü¤¹¤ë¡£ +.\"O .SS "The string argument" +.SS "ʸ»úÎó°ú¤­¿ô" +.\"O Since the expansion is the same as the expansion by the shell (see +.\"O .BR sh (1)) +.\"O of the parameters to a command, the string +.\"O .I s +.\"O must not contain characters that would be illegal in shell command +.\"O parameters. +.\"O In particular, there must not be any unescaped +.\"O newline or |, &, ;, <, >, (, ), {, } characters +.\"O outside a command substitution or parameter substitution context. +¤³¤ÎŸ³«¤Ï¥·¥§¥ë¤Ë¤è¤ë¥³¥Þ¥ó¥É¤Î¥Ñ¥é¥á¡¼¥¿¤ÎŸ³« +.RB ( sh (1) +¤ò»²¾È) ¤ÈƱ¤¸¤Ç¤¢¤ë¤Î¤Ç¡¢Ê¸»úÎó +.I s +¤Ï¥·¥§¥ë¥³¥Þ¥ó¥É¥Ñ¥é¥á¡¼¥¿¤ÇÉÔÀµ¤È¤µ¤ì¤ëʸ»ú¤ò´Þ¤ó¤Ç¤Ï¤Ê¤é¤Ê¤¤¡£ +Æä˥¨¥¹¥±¡¼¥×¤µ¤ì¤Æ¤¤¤Ê¤¤²þ¹Ô¡¢|, &, ;, <, >, (, ), {, } ʸ»ú¤ò +¥³¥Þ¥ó¥ÉÃÖ´¹¤ä¥Ñ¥é¥á¡¼¥¿ÃÖ´¹¤Î¾ìḬ̀ʳ°¤Ë´Þ¤á¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.LP +.\"O If the argument +.\"O .I s +.\"O contains a word that starts with an unquoted comment character #, +.\"O then it is unspecified whether that word and all following words +.\"O are ignored, or the # is treated as a non-comment character. +°ú¤­¿ô +.I s +¤Ë¥¯¥©¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥³¥á¥ó¥Èʸ»ú # ¤Ç»Ï¤Þ¤ëñ¸ì¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤½¤Îñ¸ì¤È¤½¤ì°Ê¹ß¤Îñ¸ì¤¬Ìµ»ë¤µ¤ì¤ë¤«¡¢ +¤½¤ì¤È¤â # ¤¬¥³¥á¥ó¥Èʸ»ú¤È¤·¤Æ°·¤ï¤Ê¤¤¤«¤Ï¡¢µ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SS "The expansion" +.SS "Ÿ³«" +.\"O The expansion done consists of the following stages: +.\"O tilde expansion (replacing ~user by user's home directory), +.\"O variable substitution (replacing $FOO by the value of the environment +.\"O variable FOO), command substitution (replacing $(command) or \`command\` +.\"O by the output of command), arithmetic expansion, field splitting, +.\"O wildcard expansion, quote removal. +¼Â¹Ô¤µ¤ì¤ëŸ³«¤Ï¡¢°Ê²¼¤ÎÃʳ¬¤Ç¹½À®¤µ¤ì¤ë: +¥Á¥ë¥ÀŸ³« (~user ¤ò user ¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤­´¹¤¨¤ë)¡¢ +ÊÑ¿ôŸ³« ($FOO ¤ò´Ä¶­ÊÑ¿ô FOO ¤ÎÃͤËÃÖ¤­´¹¤¨¤ë)¡¢ +¥³¥Þ¥ó¥ÉŸ³« ($(command) ¤Þ¤¿¤Ï \`command\` ¤ò command ¤Î½ÐÎϤÇÃÖ¤­´¹¤¨¤ë)¡¢ +»»½ÑŸ³«¡¢¥Õ¥£¡¼¥ë¥Éʬ³ä¡¢¥ï¥¤¥ë¥É¥«¡¼¥ÉŸ³«¡¢¥¯¥©¡¼¥È¤Î½üµî¡£ +.LP +.\"O The result of expansion of special parameters +.\"O ($@, $*, $#, $?, $\-, $$, $!, $0) is unspecified. +Æüì¤Ê¥Ñ¥é¥á¡¼¥¿ ($@, $*, $#, $?, $\-, $$, $!, $0) ¤Î +Ÿ³«·ë²Ì¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.LP +.\"O Field splitting is done using the environment variable $IFS. +.\"O If it is not set, the field separators are space, tab and newline. +¥Õ¥£¡¼¥ë¥Éʬ³ä¤Ï´Ä¶­ÊÑ¿ô $IFS ¤òÍѤ¤¤Æ¹Ô¤ï¤ì¤ë¡£ +¤³¤Î´Ä¶­ÊÑ¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¥Õ¥£¡¼¥ë¥É¶èÀÚ¤êʸ»ú¤Ï¥¹¥Ú¡¼¥¹¡¦¥¿¥Ö¡¦²þ¹Ô¤Ç¤¢¤ë¡£ +.\"O .SS "The output array" +.SS "½ÐÎϤµ¤ì¤ëÇÛÎó" +.\"O The array +.\"O .I we_wordv +.\"O contains the words found, followed by a NULL. +ÇÛÎó +.I we_wordv +¤Ï¸«¤Ä¤«¤Ã¤¿Ã±¸ì¤ò¤ò´Þ¤ß¡¢ºÇ¸å¤Ë NULL ¤¬Â³¤¯¡£ +.\"O .SS "The flags argument" +.\"O The +.\"O .I flag +.\"O argument is a bitwise inclusive OR of the following values: +.SS "flags °ú¤­¿ô" +.I flags +°ú¤­¿ô¤Ï°Ê²¼¤ÎÃͤΥӥåÈÊñ´ÞŪ OR ¤Ç¤¢¤ë: +.TP +.B WRDE_APPEND +.\"O Append the words found to the array resulting from a previous call. +¸«¤Ä¤«¤Ã¤¿Ã±¸ì¤òÁ°²ó¤Î¸Æ¤Ó½Ð¤··ë²Ì¤ÎÇÛÎó¤ËÄɲ乤롣 +.TP +.B WRDE_DOOFFS +.\"O Insert +.\"O .I we_offs +.\"O initial NULLs in the array +.\"O .IR we_wordv . +.\"O (These are not counted in the returned +.\"O .IR we_wordc .) +½é´ü¾õÂ֤Ǥ¢¤ë +.I we_offs +¸Ä¤Î NULL ¤òÇÛÎó +.I we_wordv +¤ËÁÞÆþ¤¹¤ë (¤³¤ì¤é¤ÏÊÖ¤µ¤ì¤ë +.I we_wordc +¤Ë¤Ï¥«¥¦¥ó¥È¤µ¤ì¤Ê¤¤)¡£ +.TP +.B WRDE_NOCMD +.\"O Don't do command substitution. +¥³¥Þ¥ó¥ÉÃÖ´¹¤ò¹Ô¤ï¤Ê¤¤¡£ +.TP +.B WRDE_REUSE +.\"O The argument +.\"O .I p +.\"O resulted from a previous call to +.\"O .BR wordexp (), +.\"O and +.\"O .BR wordfree () +.\"O was not called. +.\"O Reuse the allocated storage. +°ú¤­¿ô +.I p +¤ÏÁ°²ó¤Î +.BR wordexp () +¤Î¸Æ¤Ó½Ð¤··ë²Ì¤Ç¤¢¤ê¡¢ +.BR wordfree () +¤¬ (¤Þ¤À) ¸Æ¤Ó½Ð¤µ¤ì¤Ê¤¤¡£ +³ä¤êÅö¤Æ¤é¤ì¤¿Îΰè¤òºÆÍøÍѤ¹¤ë¡£ +.TP +.B WRDE_SHOWERR +.\"O Normally during command substitution +.\"O .I stderr +.\"O is redirected to +.\"O .IR /dev/null . +Ä̾ï¤Ï¥³¥Þ¥ó¥ÉÃÖ´¹¤Î¤È¤­¤Ë +.I stderr +¤¬ +.I /dev/null +¤Ë¥ê¥À¥¤¥ì¥¯¥È¤µ¤ì¤ë¡£ +.\"O This flag specifies that +.\"O .I stderr +.\"O is not to be redirected. +¤³¤Î¥Õ¥é¥°¤Ï +.I stderr +¤ò¥ê¥À¥¤¥ì¥¯¥È¤·¤Ê¤¤¤è¤¦¤Ë»ØÄꤹ¤ë¡£ +.TP +.B WRDE_UNDEF +.\"O Consider it an error if an undefined shell variable is expanded. +̤ÄêµÁ¤Î¥·¥§¥ëÊÑ¿ô¤òŸ³«¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¡¢¥¨¥é¡¼¤È¤·¤Æ°·¤¦¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O In case of success 0 is returned. +.\"O In case of error +.\"O one of the following five values is returned. +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï°Ê²¼¤Î 5 ¤Ä¤ÎÃͤΤ¦¤Á¤Î 1 ¤Ä¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.B WRDE_BADCHAR +.\"O Illegal occurrence of newline or one of |, &, ;, <, >, (, ), {, }. +²þ¹Ô¤Þ¤¿¤Ï |, &, ;, <, >, (, ), {, } ¤Î¤¦¤Á¤Î 1 ¤Ä¤¬ÉÔÀµ¤Ë½Ð¸½¤·¤¿¡£ +.TP +.B WRDE_BADVAL +.\"O An undefined shell variable was referenced, and the +.\"O .B WRDE_UNDEF +.\"O flag +.\"O told us to consider this an error. +̤ÄêµÁ¤Î¥·¥§¥ëÊÑ¿ô¤¬»²¾È¤µ¤ì¡¢¤«¤Ä +.B WRDE_UNDEF +¥Õ¥é¥°¤Ç¤³¤ì¤ò¥¨¥é¡¼¤È¤·¤Æ°·¤¦¤è¤¦¤Ë»Ø¼¨¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B WRDE_CMDSUB +.\"O Command substitution occurred, and the +.\"O .B WRDE_NOCMD +.\"O flag told us to consider this an error. +¥³¥Þ¥ó¥ÉÃÖ´¹¤¬µ¯¤³¤ê¡¢¤«¤Ä +.B WRDE_NOCMD +¥Õ¥é¥°¤Ç¤³¤ì¤ò¥¨¥é¡¼¤È¤·¤Æ°·¤¦¤è¤¦¤Ë»Ø¼¨¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B WRDE_NOSPACE +.\"O Out of memory. +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B WRDE_SYNTAX +.\"O Shell syntax error, such as unbalanced parentheses or +.\"O unmatched quotes. +Âбþ¤¹¤ë³ç¸Ì¤¬¤Ê¤¤¡¢¥¯¥©¡¼¥È¤¬¹çÃפ·¤Ê¤¤¤È¤¤¤Ã¤¿¡¢ +¥·¥§¥ë¤Î½ñ¼°¥¨¥é¡¼¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .BR wordexp () +.\"O and +.\"O .BR wordfree () +.\"O are provided in glibc since version 2.1. +.BR wordexp () +¤È +.BR wordfree () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH EXAMPLE +.SH Îã +.\"O The output of the following example program +.\"O is approximately that of "ls [a-c]*.c". +°Ê²¼¤Î¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Î½ÐÎϤϤÀ¤¤¤¿¤¤ "ls [a-c]*.c" ¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ +.LP +.nf +#include +#include +#include + +int +main(int argc, char **argv) +{ + wordexp_t p; + char **w; + int i; + + wordexp("[a-c]*.c", &p, 0); + w = p.we_wordv; + for (i = 0; i < p.we_wordc; i++) + printf("%s\en", w[i]); + wordfree(&p); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fnmatch (3), +.BR glob (3) diff --git a/draft/man3/wprintf.3 b/draft/man3/wprintf.3 new file mode 100644 index 00000000..3a76bdae --- /dev/null +++ b/draft/man3/wprintf.3 @@ -0,0 +1,371 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:36 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH WPRINTF 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf \- formatted +.\"O wide-character output conversion +wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf \- ¥ï¥¤¥Éʸ»ú¤ò +¥Õ¥©¡¼¥Þ¥Ã¥È¤·¤Æ½ÐÎϤ¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "int wprintf(const wchar_t *" format ", ...);" +.BI "int fwprintf(FILE *" stream ", const wchar_t *" format ", ...);" +.BI "int swprintf(wchar_t *" wcs ", size_t " maxlen , +.BI " const wchar_t *" format ", ...);" +.sp +.BI "int vwprintf(const wchar_t *" format ", va_list " args ); +.BI "int vfwprintf(FILE *" stream ", const wchar_t *" format ", va_list " args ); +.BI "int vswprintf(wchar_t *" wcs ", size_t " maxlen , +.BI " const wchar_t *" format ", va_list " args ); +.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 +.\"O All functions shown above: +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô: +.\" .BR wprintf (), +.\" .BR fwprintf (), +.\" .BR swprintf (), +.\" .BR vwprintf (), +.\" .BR vfwprintf (), +.\" .BR vswprintf (): +_XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR wprintf () +.\"O family of functions is +.\"O the wide-character equivalent of the +.\"O .BR printf (3) +.\"O family of functions. +.\"O It performs formatted output of wide +.\"O characters. +.BR wprintf () +¥Õ¥¡¥ß¥ê¡¼¤Î´Ø¿ô¤Ï +.BR printf (3) +¥Õ¥¡¥ß¥ê¡¼¤Î´Ø¿ô¤Î +¥ï¥¤¥Éʸ»úÈǤǤ¢¤ë¡£¤³¤ì¤é¤Ï¥ï¥¤¥Éʸ»ú¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤·¤Æ½ÐÎϤ¹¤ë¡£ +.PP +.\"O The +.\"O .BR wprintf () +.\"O and +.\"O .BR vwprintf () +.\"O functions +.\"O perform wide-character output to \fIstdout\fP. +.\"O \fIstdout\fP must not be byte oriented; see +.\"O .BR fwide (3) +.\"O for more information. +.BR wprintf () +¤È +.BR vwprintf () +´Ø¿ô¤Ï \fIstdout\fP ¤Ë½ÐÎϤò¹Ô¤Ê¤¦¡£ +\fIstdout\fP ¤¬¥Ð¥¤¥Èñ°ÌÆþ½ÐÎϤǤ¢¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¡£¤è¤ê¾Ü¤·¤¤ÀâÌÀ¤Ï +.BR fwide (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +.\"O The +.\"O .BR fwprintf () +.\"O and +.\"O .BR vfwprintf () +.\"O functions +.\"O perform wide-character output to \fIstream\fP. +.\"O \fIstream\fP must not be byte oriented; see +.\"O .BR fwide (3) +.\"O for more information. +.BR fwprintf () +¤È +.BR vfwprintf () +´Ø¿ô¤Ï \fIstream\fP ¤Ë¥ï¥¤¥Éʸ»ú½ÐÎÏ +¤ò¹Ô¤Ê¤¦¡£ \fIstream\fP ¤¬¥Ð¥¤¥Èñ°ÌÆþ½ÐÎϤǤ¢¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +¤è¤ê¾Ü¤·¤¤ÀâÌÀ¤Ï +.BR fwide (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +.\"O The +.\"O .BR swprintf () +.\"O and +.\"O .BR vswprintf () +.\"O functions +.\"O perform wide-character output +.\"O to an array of wide characters. +.\"O The programmer must ensure that there is +.\"O room for at least \fImaxlen\fP wide +.\"O characters at \fIwcs\fP. +.BR swprintf () +¤È +.BR vswprintf () +´Ø¿ô¤Ï¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤Ë +¥ï¥¤¥Éʸ»ú½ÐÎϤò¹Ô¤Ê¤¦¡£¥×¥í¥°¥é¥Þ¡¼¤Ï \fIwcs\fP ¤ËºÇÄã¤Ç¤â +\fImaxlen\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤ò½ÐÎϤǤ­¤ë¶õ¤­¤¬¤¢¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð +¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O These functions are like +.\"O the +.\"O .BR printf (3), +.\"O .BR vprintf (3), +.\"O .BR fprintf (3), +.\"O .BR vfprintf (3), +.\"O .BR sprintf (3), +.\"O .BR vsprintf (3) +.\"O functions except for the +.\"O following differences: +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.BR printf (3), +.BR vprintf (3), +.BR fprintf (3), +.BR vfprintf (3), +.BR sprintf (3), +.BR vsprintf (3) +´Ø¿ô¤Ë»÷¤Æ¤¤¤ë¤¬°Ê²¼¤Î +ÅÀ¤Ç°Û¤Ã¤Æ¤¤¤ë¡£ +.TP +.B \(bu +.\"O The \fIformat\fP string is a wide character string. +\fIformat\fP ¤¬¥ï¥¤¥Éʸ»úÎó¤ÇÍ¿¤¨¤é¤ì¤ë¡£ +.TP +.B \(bu +.\"O The output consists of wide characters, not bytes. +½ÐÎϤ¬¥Ð¥¤¥È¤Ç¤Ï¤Ê¤¯¥ï¥¤¥Éʸ»ú¤Ç¹½À®¤µ¤ì¤ë¡£ +.TP +.B \(bu +.\"O .BR swprintf () +.\"O and +.\"O .BR vswprintf () +.\"O take a \fImaxlen\fP argument, +.\"O .BR sprintf (3) +.\"O and +.\"O .BR vsprintf (3) +.\"O do not. +.\"O .RB ( snprintf (3) +.\"O and +.\"O .BR vsnprintf (3) +.\"O take a \fImaxlen\fP argument, but these functions do not return \-1 upon +.\"O buffer overflow on Linux.) +.BR swprintf () +¤È +.BR vswprintf () +¤Ï \fImaxlen\fP °ú¤­¿ô¤ò¼è¤ë¤¬¡¢ +.BR sprintf () +¤È +.BR vsprintf () +¤Ï¼è¤é¤Ê¤¤ +.RB ( snprintf () +¤È +.BR vsnprintf () +¤Ï \fImaxlen\fP °ú¤­¿ô¤ò¼è¤ë¤¬ +¤³¤ì¤é¤Î´Ø¿ô¤¬ Linux ¤Ç¤Ï¡¢¥Ð¥Ã¥Õ¥¡¡¼¤¬°î¤ì¤¿¾ì¹ç¤Ç¤â \-1 ¤òÊÖ¤µ¤Ê¤¤)¡£ +.PP +.\"O The treatment of the conversion characters \fBc\fP and \fBs\fP is different: +\fBc\fP ¤È \fBs\fP ÊÑ´¹Ê¸»ú¤Î°·¤¤¤¬°Û¤Ã¤Æ¤¤¤ë: +.TP +.\"O .B c +.\"O If no +.\"O .B l +.\"O modifier is present, the +.\"O .I int +.\"O argument is converted to a wide character by a call to the +.\"O .BR btowc (3) +.\"O function, and the resulting wide character is written. +.\"O If an +.\"O .B l +.\"O modifier is present, the +.\"O .I wint_t +.\"O (wide character) argument is written. +.B c +¤â¤· +.B l +½¤¾þ»Ò¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï +.I int +°ú¤­¿ô¤Ï +.BR btowc (3) +´Ø¿ô¤Ë¤è¤Ã¤Æ¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤µ¤ì¤ë¡£¤½¤·¤Æ·ë²Ì¤Î¥ï¥¤¥Éʸ»ú¤¬½ÐÎϤµ¤ì¤ë¡£ +.B l +½¤¾þ»Ò¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ï +.I wint_t +(¥ï¥¤¥Éʸ»ú)°ú¤­¿ô¤¬½ÐÎϤµ¤ì¤ë¡£ +.\"O .B s +.\"O If no +.\"O .B l +.\"O modifier is present: The +.\"O .I "const\ char\ *" +.\"O argument is expected to be a pointer to an array of character type +.\"O (pointer to a string) containing a multibyte character sequence beginning +.\"O in the initial shift state. +.\"O Characters from the array are converted to +.\"O wide characters (each by a call to the +.\"O .BR mbrtowc (3) +.\"O function with a conversion state starting in the initial state before +.\"O the first byte). +.\"O The resulting wide characters are written up to +.\"O (but not including) the terminating null wide character. +.\"O If a precision is +.\"O specified, no more wide characters than the number specified are written. +.\"O Note that the precision determines the number of +.\"O .I wide characters +.\"O written, not the number of +.\"O .I bytes +.\"O or +.\"O .IR "screen positions" . +.TP +.B s +¤â¤· +.B l +½¤¾þ»Ò¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +.I "const\ char\ *" +°ú¤­¿ô¤Ï½é´ü¾õÂÖ¤è¤ê»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò´Þ¤ó¤À +char ·¿¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼(ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼)¤È¤ß¤Ê¤µ¤ì¤ë¡£ +ÇÛÎó¤Îʸ»ú¤Ï(ºÇ½é¤Î¥Ð¥¤¥ÈÁ°¤Ë½é´ü¾õÂÖ¤ÇÊÑ´¹¤ò³«»Ï¤·¡¢¤½¤ì¤¾¤ì¤Îʸ»ú¤ò +.BR mbrtowc (3) +´Ø¿ô¤Ë¤è¤Ã¤Æ)¥ï¥¤¥Éʸ»ú¤Ø¤ÈÊÑ´¹¤µ¤ì¤ë¡£·ë²Ì¤Î¥ï¥¤¥Éʸ»ú¤Ï½ªÃ¼¤Î +¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Î¼êÁ°¤Þ¤Ç¤¬½ñ¤­¹þ¤Þ¤ì¤ë¡£ÀºÅÙ(precision)¤¬»ØÄꤵ¤ì¤¿ +¾ì¹ç¡¢»ØÄꤵ¤ì¤¿¿ô»ú¤òĶ¤¨¤ë¥ï¥¤¥Éʸ»ú¤Ï½ñ¤­¹þ¤Þ¤ì¤Ê¤¤¡£ÀºÅÙ¤Ï +½ñ¤­¹þ¤Þ¤ì¤ë +.I ¥Ð¥¤¥È +¿ô¤ä +.I ²èÌ̾å¤Î°ÌÃÖ +¤Ç¤Ï¤Ê¤¯ +.I ¥ï¥¤¥Éʸ»ú +¤Î¿ô¤ò»ØÄꤹ¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.\"O The array must contain a terminating null byte, unless a precision is given +.\"O and it is so small that the number of converted wide characters reaches it +.\"O before the end of the array is reached. +.\"O If an +.\"O .B l +.\"O modifier is present: The +.\"O .I "const\ wchar_t\ *" +.\"O argument is expected to be a pointer to an array of wide characters. +.\"O Wide characters from the array are written up to (but not including) a +.\"O terminating null wide character. +.\"O If a precision is specified, no more than +.\"O the number specified are written. +.\"O The array must contain a terminating null +.\"O wide character, unless a precision is given and it is smaller than or equal +.\"O to the number of wide characters in the array. +ÀºÅÙ¤¬¤Ê¤¤¾ì¹ç¤Ë¤ÏÇÛÎó¤Î½ªÃ¼¤Ë¥Ê¥ëʸ»ú¤ò´Þ¤àɬÍפ¬¤¢¤ë¡£ +ÀºÅÙ¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ÇÛÎó¤ÎºÇ¸å¤ËÅþÃ夹¤ëÁ°¤ËÊÑ´¹¤µ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Î +¿ô¤¬¤½¤ì¤ËÅþ㤹¤ë¤è¤¦¡¢ÀºÅ٤Ͻ½Ê¬¤Ë¾®¤µ¤Ê¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤â¤· +.B l +½¤¾þ»Ò¤¬Â¸ºß¤¹¤ë¾ì¹ç¡¢ +.I "const\ wchar_t\ *" +°ú¤­¿ô¤Ï¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤È¤ß¤Ê¤µ¤ì¤ë¡£ +ÇÛÎó¤Î¥ï¥¤¥Éʸ»úÎó¤Ï½ªÃ¼¤Î¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Î¼ê´Ö¤Þ¤Ç½ÐÎϤµ¤ì¤ë¡£ +¤â¤·ÀºÅÙ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï»ØÄꤵ¤ì¤¿ÀºÅٰʾå¤Îʸ»ú¤Ï½ÐÎϤµ¤ì¤Ê¤¤¡£ +ÀºÅÙ¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ë¤Ï½ªÃ¼¤Î¥Ê¥ë¥ï¥¤¥Éʸ»ú¤ò´Þ¤àɬÍפ¬¤¢¤ë¡£ +ÀºÅÙ¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¤½¤ì¤Ï¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤ÎÂ礭¤µ¤è¤ê¤â¾®¤µ¤¯¤Ê +¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The functions return the number of wide characters written, excluding the +.\"O terminating null wide character in +.\"O case of the functions +.\"O .BR swprintf () +.\"O and +.\"O .BR vswprintf (). +.\"O They return \-1 when an error occurs. +¤³¤ì¤é¤Î´Ø¿ô¤Ï½ñ¤­¹þ¤Þ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Îʸ»ú¿ô¤òÊÖ¤¹¡£ +.BR swprintf () +¤È +.BR vswprintf () +´Ø¿ô¤Î¾ì¹ç¤Ï +½ªÃ¼¤Î¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ï´Þ¤Þ¤Ê¤¤¡£¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +C99. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The behavior of +.\"O .BR wprintf () +.\"O et al. depends +.\"O on the +.\"O .B LC_CTYPE +.\"O category of the +.\"O current locale. +.BR wprintf () +Åù¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +.\"O If the \fIformat\fP string contains non-ASCII wide characters, the program +.\"O will only work correctly if the +.\"O .B LC_CTYPE +.\"O category of the current locale at +.\"O run time is the same as the +.\"O .B LC_CTYPE +.\"O category of the current locale at +.\"O compile time. +.\"O This is because the +\fIformat\fP ʸ»úÎó¤¬ ASCII °Ê³°¤Î¥ï¥¤¥Éʸ»ú¤ò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¡¢ +¼Â¹Ô»þ¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤¬¥³¥ó¥Ñ¥¤¥ë»þ¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤È +°ìÃפ·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ß¥×¥í¥°¥é¥à¤ÏÀµ¾ï¤ËÆ°ºî¤¹¤ë¡£¤³¤ì¤Ï +.I wchar_t +.\"O representation is platform- and locale- dependent. +.\"O (The glibc represents +.\"O wide characters using their Unicode (ISO-10646) code point, but other +.\"O platforms don't do this. +.\"O Also, the use of ISO C99 universal character names +.\"O of the form \\unnnn does not solve this problem.) +¤Îɽ¸½¤¬¥í¥±¡¼¥ë¤ä¥×¥é¥Ã¥È¥Û¡¼¥à¤Ë°Í¸¤·¤Æ¤¤¤ë¤³¤È¤Ë¸¶°ø¤¬¤¢¤ë¡£ +(glibc ¤Ç¤Ï¥ï¥¤¥Éʸ»ú¤È¤·¤Æ Unicode (ISO-10646) ¤Î¥³¡¼¥É¥Ý¥¤¥ó¥È¤ò +»ÈÍѤ·¤Æ¤¤¤ë¡£Â¾¤Î¥×¥é¥Ã¥È¥Û¡¼¥à¤Ç¤Ï¤½¤¦¤Ç¤Ï¤Ê¤¤¡£Æ±ÍÍ¤Ë +ISO C99 ¤Î \\unnnn ·Á¼°¤ÎÈÆÍÑʸ»ú̾¾Î¤Ï¤³¤ÎÌäÂê¤ò²ò·è¤·¤Ê¤¤¡£) +.\"O Therefore, in +.\"O internationalized programs, the \fIformat\fP string should consist of ASCII +.\"O wide characters only, or should be constructed at run time in an +.\"O internationalized way (e.g., using +.\"O .BR gettext (3) +.\"O or +.\"O .BR iconv (3), +.\"O followed by +.\"O .BR mbstowcs (3)). +¤³¤Î¤¿¤á¹ñºÝ²½¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ç¤Ï \fIformat\fP ʸ»úÎó¤ò ASCII ¥ï¥¤¥É +ʸ»ú¤Î¤ß¤Ë¤¹¤ë¤«¡¢¼Â¹Ô»þ¤Ë¹ñºÝ²½¤µ¤ì¤¿ÊýË¡¤Ç¹½À®¤¹¤ëɬÍפ¬¤¢¤ë +(Î㤨¤Ð +.BR gettext () +¤È +.BR iconv () +¤ä +.BR mbstowcs () +¤òÁȤ߹ç¤ï¤Æ»ÈÍѤ¹¤ë)¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fprintf (3), +.BR fputwc (3), +.BR fwide (3), +.BR printf (3), +.BR snprintf (3) +.\" .BR wscanf (3) diff --git a/draft/man3/xcrypt.3 b/draft/man3/xcrypt.3 new file mode 100644 index 00000000..ed759173 --- /dev/null +++ b/draft/man3/xcrypt.3 @@ -0,0 +1,125 @@ +.\" Copyright 2003 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" this is the 3rd type of interface for cryptographic routines +.\" 1. encrypt() expects a bit field +.\" 2. cbc_crypt() byte values +.\" 3. xencrypt() a hexstring +.\" to bad to be true :( +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Wed Sep 15 01:02:11 JST 2004 +.\" by Yuichi SATO +.\" +.TH XCRYPT 3 2003-04-04 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O xencrypt, xdecrypt, passwd2des \- RFS password encryption +xencrypt, xdecrypt, passwd2des \- RFS ¥Ñ¥¹¥ï¡¼¥É°Å¹æ²½ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B "#include " +.sp +.BI "void passwd2des(char " *passwd ", char *" key ");" +.sp +.BI "int xencrypt(char *" secret ", char *" passwd ");" +.sp +.BI "int xdecrypt(char *" secret ", char *" passwd ");" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The function +.\"O .BR passwd2des () +.\"O takes a character string +.\"O .I passwd +.\"O of arbitrary length and fills a character array +.\"O .I key +.\"O of length 8. +.\"O The array +.\"O .I key +.\"O is suitable for use as DES key. +.\"O It has odd parity set in bit 0 of each byte. +´Ø¿ô +.BR passwd2des () +¤ÏǤ°Õ¤ÎŤµ¤Îʸ»úÎó +.I passwd +¤ò¤È¤ê¡¢Ä¹¤µ 8 ¤Îʸ»úÇÛÎó +.I key +¤òËä¤á¤ë¡£ +ÇÛÎó +.I key +¤Ï DES ¥­¡¼¤È¤·¤Æ»È¤¦¤Î¤ËŬ¤·¤Æ¤¤¤ë¡£ +¤³¤ÎÇÛÎó¤Î³Æ¥Ð¥¤¥È¤Î¥Ó¥Ã¥È 0 ¤Ï´ñ¿ô¥Ñ¥ê¥Æ¥£¤Ç¤¢¤ë¡£ +.\"O Both other functions described here use this function to turn their +.\"O argument +.\"O .I passwd +.\"O into a DES key. +¤³¤³¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë»Ä¤ê¤Î 2 ¤Ä¤Î´Ø¿ô¤Ï¡¢ +¤³¤Î´Ø¿ô¤ò»È¤¤¡¢°ú¤­¿ô +.I passwd +¤ò DES ¥­¡¼¤ËÊÑ´¹¤¹¤ë¡£ +.LP +.\"O The +.\"O .BR xencrypt () +.\"O function takes the ASCII character string +.\"O .I secret +.\"O given in hex, +.\"O .\" (over the alphabet 0123456789abcdefABCDEF), +.BR xencrypt () +´Ø¿ô¤Ï +.\" (¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È 0123456789abcdefABCDEF ¤Çɽ¤µ¤ì¤ë) +16 ¿Ê¿ô¤ÇÍ¿¤¨¤é¤ì¤¿ ASCII ʸ»úÎó +.I secret +¤ò¤È¤ë¡£ +.\"O which must have a length that is a multiple of 16, +¤³¤ÎŤµ¤Ï 16 ¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O encrypts it using the DES key derived from +.\"O .I passwd +.\"O by +.\"O .BR passwd2des (), +¤½¤·¤Æ +.BR passwd2des () +¤Ë¤è¤Ã¤Æ +.I passwd +¤«¤éƳ¤­½Ð¤µ¤ì¤¿ DES ¥­¡¼¤ò»È¤¤¡¢ +.I secret +¤ò°Å¹æ²½¤¹¤ë¡£ +.\"O and outputs the result again in +.\"O .I secret +.\"O as a hex string +.\"O .\" (over the alphabet 0123456789abcdef) +.\"O of the same length. +¤½¤Î·ë²Ì¤Ï +.\" (¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È 0123456789abcdef ¤Çɽ¤µ¤ì¤ë) +16 ¿Ê¿ôʸ»úÎó¤È¤·¤Æ +.I secret +¤ËºÆ¤ÓƱ¤¸Ä¹¤µ¤Ç½ÐÎϤµ¤ì¤ë¡£ +.LP +.\"O The +.\"O .BR xdecrypt () +.\"O function performs the converse operation. +.BR xdecrypt () +´Ø¿ô¤ÏµÕ¤ÎÁàºî¤ò¹Ô¤¦¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The functions +.\"O .BR xencrypt () +.\"O and +.\"O .BR xdecrypt () +.\"O return 1 on success and 0 on error. +´Ø¿ô +.BR xencrypt () +¤È +.BR xdecrypt () +¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ë 1 ¤òÊÖ¤·¡¢¼ºÇÔ¤·¤¿¾ì¹ç¤Ë 0 ¤òÊÖ¤¹¡£ +.\"O .SH VERSIONS +.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 BUGS +.SH ¥Ð¥° +.\"O The prototypes are missing from the abovementioned include file. +¾åµ­¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ë¥×¥í¥È¥¿¥¤¥×¤¬¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cbc_crypt (3) diff --git a/draft/man3/xdr.3 b/draft/man3/xdr.3 new file mode 100644 index 00000000..796d0831 --- /dev/null +++ b/draft/man3/xdr.3 @@ -0,0 +1,897 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)xdr.3n 2.2 88/08/03 4.0 RPCSRC; from 1.16 88/03/14 SMI +.\" +.\" 2007-12-30, mtk, Convert function prototypes to modern C syntax +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Tue Jan 4 20:48:51 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH XDR 3 2007-12-30 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O xdr \- library routines for external data representation +xdr \- ³°Éô¥Ç¡¼¥¿É½¸½(XDR)¤Î¤¿¤á¤Î¥é¥¤¥Ö¥é¥ê¡¦¥ë¡¼¥Æ¥£¥ó +.\"O .SH SYNOPSIS AND DESCRIPTION +.SH ½ñ¼°¤ÈÀâÌÀ +.LP +.\"O These routines allow C programmers to describe +.\"O arbitrary data structures in a machine-independent fashion. +.\"O Data for remote procedure calls are transmitted using these +.\"O routines. +¤³¤ì¤é¤Î¥ë¡¼¥Æ¥£¥ó¤Ï C ¥×¥í¥°¥é¥Þ¡¼¤¬¥Þ¥·¥óÈó°Í¸¤Ê·Á¼°¤Ç +Ǥ°Õ¤Î¥Ç¡¼¥¿¹½Â¤ÂΤòµ­½Ò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£ +¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¡¦¥³¡¼¥ë¤Î¤¿¤á¤Î¥Ç¡¼¥¿¤Ï¤³¤ì¤é¤Î¥ë¡¼¥Æ¥£¥ó¤ò +»ÈÍѤ·¤ÆÁ÷¿®¤µ¤ì¤ë¡£ + +.\"O The prototypes below are declared in +.\"O .I +.\"O and make use of the following types: +°Ê²¼¤Ë¼¨¤¹¥×¥í¥È¥¿¥¤¥×Àë¸À¤Ï +.I +¤Ç¹Ô¤ï¤ì¤Æ¤ª¤ê¡¢¤½¤ÎÃæ¤Ç¤Ï¼¡¤Î·¿¤¬»ÈÍѤµ¤ì¤ë¡£ +.in +4n +.nf + +typedef int \fIbool_t\fP; + +typedef bool_t (*\fIxdrproc_t\fP) (XDR *, void *,...); +.fi +.in +.LP +.\"O For the declaration of the +.\"O .I XDR +.\"O type, see +.\"O .IR . +.I XDR +·¿¤ÎÀë¸À¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.I +¤ò»²¾È¡£ +.LP +.nf +.BI "bool_t xdr_array(XDR *" xdrs ", char **" arrp ", unsigned int *" sizep , +.BI " unsigned int " maxsize ", unsigned int " elsize , +.BI " xdrproc_t " elproc ); +.fi +.IP +.\"O A filter primitive that translates between variable-length arrays +.\"O and their corresponding external representations. +.\"O The argument +.\"O .I arrp +.\"O is the address of the pointer to the array, while +.\"O .I sizep +.\"O is the address of the element count of the array; +.\"O this element count cannot exceed +.\"O .IR maxsize . +²ÄÊÑŤÎÇÛÎó¤È¤½¤ì¤ËÂбþ¤¹¤ë³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +°ú¤­¿ô +.I arrp +¤ÏÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ê¡¢ +.I sizep +¤ÏÇÛÎó¤ÎÍ×ÁÇ¿ô¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤ÎÍ×ÁÇ¿ô¤Ï +.I maxsize +¤òĶ¤¨¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.\"O The argument +.\"O .I elsize +.\"O is the +.\"O .I sizeof +.\"O each of the array's elements, and +.\"O .I elproc +.\"O is an XDR filter that translates between +.\"O the array elements' C form, and their external +.\"O representation. +.\"O This routine returns one if it succeeds, zero otherwise. +°ú¤­¿ô +.I elsize +¤Ï³ÆÇÛÎó¤ÎÍ×ÁǤΠ+.I sizeof +¤Ç¤¢¤ê¡¢ +.I elproc +¤ÏÇÛÎóÍ×ÁǤò C ·Á¼°¤«¤é¤½¤Î³°Éôɽ¸½¤ËÊÑ´¹¤¹¤ë¤¿¤á¤Î XDR ¥Õ¥£¥ë¥¿¡¼¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_bool(XDR *" xdrs ", bool_t *" bp ); +.fi +.IP +.\"O A filter primitive that translates between booleans (C +.\"O integers) +.\"O and their external representations. +.\"O When encoding data, this +.\"O filter produces values of either one or zero. +.\"O This routine returns one if it succeeds, zero otherwise. +¿¿µ¶ÃÍ(C ¤Î int)¤È¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¥Ç¡¼¥¿¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë»þ¡¢¤³¤Î¥Õ¥£¥ë¥¿¡¼¤Ï 1 ¤Þ¤¿ 0 ¤ÎÃͤòÀ¸À®¤¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_bytes(XDR *" xdrs ", char **" sp ", unsigned int *" sizep , +.BI " unsigned int " maxsize ); +.fi +.IP +.\"O A filter primitive that translates between counted byte +.\"O strings and their external representations. +.\"O The argument +.\"O .I sp +.\"O is the address of the string pointer. +.\"O The length of the +.\"O string is located at address +.\"O .IR sizep ; +.\"O strings cannot be longer than +.\"O .IR maxsize . +.\"O This routine returns one if it succeeds, zero otherwise. +¤¢¤ëŤµ¤Î¥Ð¥¤¥Èʸ»úÎó¤È¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +°ú¤­¿ô +.I sp +¤Ïʸ»úÎó¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£Ê¸»úÎó¤ÎŤµ¤Ï +.I sizep +¤Î¥¢¥É¥ì¥¹¤ËÃÖ¤¯¡£Ê¸»úÎó¤Ï +.I maxsize +¤è¤êŤ¯¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_char(XDR *" xdrs ", char *" cp ); +.fi +.IP +.\"O A filter primitive that translates between C characters +.\"O and their external representations. +.\"O This routine returns one if it succeeds, zero otherwise. +.\"O Note: encoded characters are not packed, and occupy 4 bytes each. +.\"O For arrays of characters, it is worthwhile to +.\"O consider +.\"O .BR xdr_bytes (), +.\"O .BR xdr_opaque () +.\"O or +.\"O .BR xdr_string (). +C ¤Îʸ»ú(char)¤È¤½¤Î³°Éôɽ¸½¤È¤Î´Ö¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +Ãí°Õ: ¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿¥Ç¡¼¥¿¤ÏµÍ¤á¹þ¤Þ¤ì¤Æ¤ª¤é¤º¡¢¤½¤ì¤¾¤ì 4 ¥Ð¥¤¥È¤ò +Àê¤á¤ë¡£Ê¸»ú¤ÎÇÛÎó¤Î¾ì¹ç¤Ë¤Ï +.BR xdr_bytes (), +.BR xdr_opaque (), +.BR xdr_string () +¤Ê¤É¤ò¹Íθ¤·¤¿Êý¤¬Îɤ¤¡£ +.LP +.nf +.BI "void xdr_destroy(XDR *" xdrs ); +.fi +.IP +.\"O A macro that invokes the destroy routine associated with the XDR stream, +.\"O .IR xdrs . +.\"O Destruction usually involves freeing private data structures +.\"O associated with the stream. +.\"O Using +.\"O .I xdrs +.\"O after invoking +.\"O .BR xdr_destroy () +.\"O is undefined. +¤³¤Î¥Þ¥¯¥í¤Ï XDR ¥¹¥È¥ê¡¼¥à +.I xdrs +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ç˲õ¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤¹¡£ +Ç˲õ¤Ë¤ÏÄ̾¥¹¥È¥ê¡¼¥à¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿»äŪ¥Ç¡¼¥¿¹½Â¤ÂΤβòÊü¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.BR xdr_destroy () +¤Î¸Æ¤Ó½Ð¤·¤Î¸å¤Ë +.I xdrs +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_double(XDR *" xdrs ", double *" dp ); +.fi +.IP +.\"O A filter primitive that translates between C +.\"O .I double +.\"O precision numbers and their external representations. +.\"O This routine returns one if it succeeds, zero otherwise. +C ¤Î +.I ÇÜÀºÅÙ¿ô (double) +¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_enum(XDR *" xdrs ", enum_t *" ep ); +.fi +.IP +.\"O A filter primitive that translates between C +.\"O .IR enum s +.\"O (actually integers) and their external representations. +.\"O This routine returns one if it succeeds, zero otherwise. +C ¤Î +.I enum +(¼ÂºÝ¤Ë¤Ï int)¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_float(XDR *" xdrs ", float *" fp ); +.fi +.IP +.\"O A filter primitive that translates between C +.\"O .IR float s +.\"O and their external representations. +.\"O This routine returns one if it succeeds, zero otherwise. +C ¤Î +.IR "ÉâÆ°¾®¿ôÅÀ¿ô (float)" +¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "void xdr_free(xdrproc_t " proc ", char *" objp ); +.fi +.IP +.\"O Generic freeing routine. +.\"O The first argument is the XDR routine for the object being freed. +.\"O The second argument is a pointer to the object itself. +.\"O Note: the pointer passed to this routine is +.\"O .I not +.\"O freed, but what it points to +.\"O .I is +.\"O freed (recursively). +ÈÆÍѲòÊü(free)¥ë¡¼¥Æ¥£¥ó¡£ºÇ½é¤Î°ú¤­¿ô¤Ï¥ª¥Ö¥¸¥§¥¯¥È¤ò²òÊü¤¹¤ë¤¿¤á¤Î +XDR ¥ë¡¼¥Æ¥£¥ó¤Ç¤¢¤ë¡£ÆóÈÖÌܤΰú¤­¿ô¤Ï¤½¤Î¥ª¥Ö¥¸¥§¥¯¥È¼«¿È¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼ +¤Ç¤¢¤ë¡£Ãí°Õ: ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ËÅϤµ¤ì¤ë¥Ý¥¤¥ó¥¿¡¼¤Ï +.I ²òÊü¤µ¤ì¤Ê¤¤ +¤¬¡¢¤³¤Î¥Ý¥¤¥ó¥¿¡¼¤Î»Ø¤¹¥Ç¡¼¥¿¤Ï(ºÆµ¢Åª¤Ë) +.IR ²òÊü¤µ¤ì¤ë ¡£ +.LP +.nf +.BI "unsigned int xdr_getpos(XDR *" xdrs ); +.fi +.IP +.\"O A macro that invokes the get-position routine +.\"O associated with the XDR stream, +.\"O .IR xdrs . +.\"O The routine returns an unsigned integer, +.\"O which indicates the position of the XDR byte stream. +.\"O A desirable feature of .SM XDR +.\"O streams is that simple arithmetic works with this number, +.\"O although the XDR stream instances need not guarantee this. +¤³¤Î¥Þ¥¯¥í¤Ï XDR ¥¹¥È¥ê¡¼¥à +.I xdrs +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿°ÌÃÖ¼èÆÀ¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤¹¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï XDR ¥Ð¥¤¥È¡¦¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ¤ò»Ø¼¨¤¹¤ëÉä¹æ̵¤·À°¿ô¤òÊÖ¤¹¡£ +XDR ¥¹¥È¥ê¡¼¥à¤Îµ¡Ç½¤È¤·¤Æ¤³¤Î¿ôÃͤÇñ½ã¤Ê»»½Ñºî¶È¤¬¤Ç¤­¤ë¤³¤È¤¬ +´üÂÔ¤µ¤ì¤Æ¤ë¤¤¤ë¡£¤·¤«¤·¤Ê¤¬¤é +XDR ¥¹¥È¥ê¡¼¥à¤Î¼ÂÂΤϤ³¤ì¤òÊݾڤ¹¤ëɬÍפϤʤ¤¡£ +.LP +.nf +.BI "long *xdr_inline(XDR *" xdrs ", int " len ); +.fi +.IP +.\"O A macro that invokes the inline routine associated with the XDR stream, +.\"O .IR xdrs . +.\"O The routine returns a pointer +.\"O to a contiguous piece of the stream's buffer; +.\"O .I len +.\"O is the byte length of the desired buffer. +.\"O Note: pointer is cast to +.\"O .IR "long *" . +¤³¤Î¥Þ¥¯¥í¤Ï XDR ¥¹¥È¥ê¡¼¥à +.I xdrs +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿ÆâÉô(inline)¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤¹¡£ +¥ë¡¼¥Æ¥£¥ó¤Ï¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¡¼¤ÎϢ³¤¹¤ëÃÇÊҤؤΥݥ¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +.I len +¤ÏÍ׵᤹¤ë¥Ð¥Ã¥Õ¥¡¡¼¤Î¥Ð¥¤¥ÈŤǤ¢¤ë¡£ +Ãí°Õ: ¥Ý¥¤¥ó¥¿¡¼¤Ï +.I "long *" +¤Ë¥­¥ã¥¹¥È¤µ¤ì¤ë¡£ +.IP +.\"O Warning: +.\"O .BR xdr_inline () +.\"O may return NULL (0) +.\"O if it cannot allocate a contiguous piece of a buffer. +.\"O Therefore the behavior may vary among stream instances; +.\"O it exists for the sake of efficiency. +·Ù¹ð: +.BR xdr_inline () +¤Ï¥Ð¥Ã¥Õ¥¡¡¼¤ÎϢ³¤¹¤ëÃÇÊÒ¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï +NULL (0)¤òÊÖ¤¹¤«¤â¤·¤ì¤Ê¤¤¡£ +¤É¤Î¾ì¹ç¤â¤½¤ÎÆ°ºî¤Ï¥¹¥È¥ê¡¼¥à¤Î¼ÂÂΤˤè¤Ã¤ÆÊѲ½¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤ì¤Ï¸úΨ²½¤Î¤¿¤á¤Ë¸ºß¤·¤Æ¤¤¤ë¡£ +.LP +.nf +.BI "bool_t xdr_int(XDR *" xdrs ", int *" ip ); +.fi +.IP +.\"O A filter primitive that translates between C integers +.\"O and their external representations. +.\"O This routine returns one if it succeeds, zero otherwise. +C ¤ÎÀ°¿ô(int)¤È¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_long(XDR *" xdrs ", long *" lp ); +.fi +.IP +.\"O A filter primitive that translates between C +.\"O .I long +.\"O integers and their external representations. +.\"O This routine returns one if it succeeds, zero otherwise. +C ¤Î +.I long +À°¿ô¤È¤½¤Î¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "void xdrmem_create(XDR *" xdrs ", char *" addr ", unsigned int " size , +.BI " enum xdr_op " op ); +.fi +.IP +.\"O This routine initializes the XDR stream object pointed to by +.\"O .IR xdrs . +.\"O The stream's data is written to, or read from, +.\"O a chunk of memory at location +.\"O .I addr +.\"O whose length is no more than +.\"O .I size +.\"O bytes long. +.\"O The +.\"O .I op +.\"O determines the direction of the XDR stream (either +.\"O .BR XDR_ENCODE , +.\"O .BR XDR_DECODE , +.\"O or +.\"O .BR XDR_FREE ). +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.I xdrs +¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤Æ¤¤¤ë XDR ¥¹¥È¥ê¡¼¥à¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò½é´ü²½¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Î¥Ç¡¼¥¿¤Ï +.I addr +°ÌÃ֤ˤ¢¤ë¥á¥â¥ê¡¼¤Î²ô¤«¤éÆɤ߽ñ¤­¤µ¤ì¤ë¡£ +¤½¤ÎŤµ¤Ï¥Ð¥¤¥Èñ°Ì¤Ç +.I size +Ķ¤¨¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.I op +¤Ï XDR ¥¹¥È¥ê¡¼¥à¤ÎÊÑ´¹Êý¸þ¤ò·èÄꤹ¤ë +.RB ( XDR_ENCODE , +.BR XDR_DECODE , +.B XDR_FREE +¤Î¤É¤ì¤«)¡£ +.LP +.nf +.BI "bool_t xdr_opaque(XDR *" xdrs ", char *" cp ", unsigned int " cnt ); +.fi +.IP +.\"O A filter primitive that translates between fixed size opaque data +.\"O and its external representation. +.\"O The argument +.\"O .I cp +.\"O is the address of the opaque object, and +.\"O .I cnt +.\"O is its size in bytes. +.\"O This routine returns one if it succeeds, zero otherwise. +¸ÇÄêŤÎÉÔÌÀ¥Ç¡¼¥¿¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +°ú¤­¿ô +.I cp +¤ÏÉÔÌÀ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ê +.I cnt +¤Ï¤½¤Î¥Ð¥¤¥Èñ°Ì¤ÎÂ礭¤µ¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_pointer(XDR *" xdrs ", char **" objpp , +.BI " unsigned int " objsize ", xdrproc_t " xdrobj ); +.fi +.IP +.\"O Like +.\"O .BR xdr_reference () +.\"O except that it serializes NULL pointers, whereas +.\"O .BR xdr_reference () +.\"O does not. +.\"O Thus, +.\"O .BR xdr_pointer () +.\"O can represent +.\"O recursive data structures, such as binary trees or +.\"O linked lists. +.BR xdr_reference () +¤ÈƱÍͤǤ¢¤ë¤¬¡¢¤³¤ì¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤òÈֹ沽¤¹¤ë¤Î¤ËÂФ·¤Æ +.BR xdr_reference () +¤Ï¤½¤¦¤·¤Ê¤¤ÅÀ¤¬°Û¤Ê¤Ã¤Æ¤¤¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢ +.BR xdr_pointer () +¤ÏÆóʬÌÚ¤äÏ¢·ë¥ê¥¹¥È¤Î¤è¤¦¤ÊºÆµ¢Åª¤Ê¥Ç¡¼¥¿¹½Â¤ÂΤò +ɽ¸½¤Ç¤­¤ë¡£ +.LP +.nf +.BI "void xdrrec_create(XDR *" xdrs ", unsigned int " sendsize , +.BI " unsigned int " recvsize ", char *" handle , +.BI " int (*" readit ") (char *, char *, int)," +.BI " int (*" writeit ") (char *, char *, int));" +.fi +.IP +.\"O This routine initializes the XDR stream object pointed to by +.\"O .IR xdrs . +.\"O The stream's data is written to a buffer of size +.\"O .IR sendsize ; +.\"O a value of zero indicates the system should use a suitable default. +.\"O The stream's data is read from a buffer of size +.\"O .IR recvsize ; +.\"O it too can be set to a suitable default by passing a zero value. +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.I xdrs +¤Ç»Ø¤µ¤ì¤¿ XDR ¥¹¥È¥ê¡¼¥à¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò½é´ü²½¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Î¥Ç¡¼¥¿¤ÏÂ礭¤µ +.I sendsize +¤Î¥Ð¥Ã¥Õ¥¡¤Ø½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.I sendsize +¤ò¥¼¥í¤Ë¤¹¤ë¤È¡¢¥·¥¹¥Æ¥à¤ËŬÀڤʥǥե©¥ë¥È¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë»Ø¼¨¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Î¥Ç¡¼¥¿¤ÏÂ礭¤µ +.I recvsize +¤Î¥Ð¥Ã¥Õ¥¡¤«¤éÆɤ߹þ¤Þ¤ì¤ë¡£¤³¤ì¤â¥¼¥í¤òÅϤ¹¤³¤È¤ÇŬÀڤʥǥե©¥ë¥È¤Ë +ÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O When a stream's output buffer is full, +.\"O .I writeit +.\"O is called. +.\"O Similarly, when a stream's input buffer is empty, +.\"O .I readit +.\"O is called. +.\"O The behavior of these two routines is similar to +.\"O the system calls +.\"O .BR read (2) +.\"O and +.\"O .BR write (2), +.\"O except that +.\"O .I handle +.\"O is passed to the former routines as the first argument. +¥¹¥È¥ê¡¼¥à¤Î½ÐÎϥХåե¡¤¬°ìÇդξì¹ç¤Ï +.I writeit +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£Æ±Íͤ˥¹¥È¥ê¡¼¥àÆþÎϥХåե¡¤¬¶õ¤Î¾ì¹ç¤Ë¤Ï +.I readit +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£¤³¤ì¤é¤ÎÆó¤Ä¤Î¥ë¡¼¥Æ¥£¥ó¤ÎÆ°ºî¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î +.BR read (2) +¤ä +.BR write (2) +¤È»÷¤Æ¤¤¤ë¤¬¡¢Á°¼Ô¤Î¥ë¡¼¥Æ¥£¥ó¤ÏºÇ½é¤Î°ú¤­¿ô¤È¤·¤Æ +.I handle +¤¬ÅϤµ¤ì¤ëÅÀ¤Ç°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O Note: the XDR stream's +.\"O .I op +.\"O field must be set by the caller. +Ãí°Õ: XDR ¥¹¥È¥ê¡¼¥à¤Î +.I op +¤Ï¸Æ¤Ó½Ð¤·Â¦¤ÇÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP +.\"O Warning: this XDR stream implements an intermediate record stream. +.\"O Therefore there are additional bytes in the stream +.\"O to provide record boundary information. +·Ù¹ð: ¤³¤Î XDR ¥¹¥È¥ê¡¼¥à¤ÏÃæ´Ö¥ì¥³¡¼¥É¡¦¥¹¥È¥ê¡¼¥à¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +¥ì¥³¡¼¥É¶­³¦¤Î¾ðÊó¤òÄ󶡤¹¤ë¤¿¤á¤Ë¥¹¥È¥ê¡¼¥à¤Ë¤Ï;ʬ¤Ê¥Ð¥¤¥È¤¬Â¸ºß¤¹¤ë¡£ +.LP +.nf +.BI "bool_t xdrrec_endofrecord(XDR *" xdrs ", int " sendnow ); +.fi +.IP +.\"O This routine can be invoked only on streams created by +.\"O .BR xdrrec_create (). +.\"O The data in the output buffer is marked as a completed record, +.\"O and the output buffer is optionally written out if +.\"O .I sendnow +.\"O is nonzero. +.\"O This routine returns one if it succeeds, zero otherwise. +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.BR xdrrec_create () +¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¤Î¤ß¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +½ÐÎϥХåե¡¤Î¥Ç¡¼¥¿¤Ï´°Á´¤Ê¥ì¥³¡¼¥É¤È¤·¤Æ°õ¤µ¤ì¡¢ +.I sendnow +¤¬¥¼¥í¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï½ÐÎϥХåե¡¤Ï½ñ¤­½Ð¤µ¤ì¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdrrec_eof(XDR *" xdrs ); +.fi +.IP +.\"O This routine can be invoked only on streams created by +.\"O .BR xdrrec_create (). +.\"O After consuming the rest of the current record in the stream, +.\"O this routine returns one if the stream has no more input, +.\"O zero otherwise. +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.BR xdrrec_create () +¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¤Î¤ß¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Î¸½ºß¤Î¥ì¥³¡¼¥É¤Î»Ä¤ê¤ò¾ÃÈñ¤·¤¿¸å¤Ë¡¢ +¥¹¥È¥ê¡¼¥à¤ËÆþÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdrrec_skiprecord(XDR *" xdrs ); +.fi +.IP +.\"O This routine can be invoked only on +.\"O streams created by +.\"O .BR xdrrec_create (). +.\"O It tells the XDR implementation that the rest of the current record +.\"O in the stream's input buffer should be discarded. +.\"O This routine returns one if it succeeds, zero otherwise. +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.BR xdrrec_create () +¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¤Î¤ß¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +XDR ¤Î¼ÂÁõ¤Ë¤½¤Î¥¹¥È¥ê¡¼¥à¤ÎÆþÎϥХåե¡¡¼¤Î¸½ºß¤Î¥ì¥³¡¼¥É¤Î»Ä¤ê¤ò +¼Î¤Æ¤ë¤è¤¦¤ËÅÁ¤¨¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_reference(XDR *" xdrs ", char **" pp ", unsigned int " size , +.BI " xdrproc_t " proc ); +.fi +.IP +.\"O A primitive that provides pointer chasing within structures. +.\"O The argument +.\"O .I pp +.\"O is the address of the pointer; +.\"O .I size +.\"O is the +.\"O .I sizeof +.\"O the structure that +.\"O .I *pp +.\"O points to; and +.\"O .I proc +.\"O is an XDR procedure that filters the structure +.\"O between its C form and its external representation. +.\"O This routine returns one if it succeeds, zero otherwise. +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡¼ÄÉÀפòÄ󶡤¹¤ë´ðËܥ롼¥Æ¥£¥ó¡£ +°ú¤­¿ô +.I pp +¤Ï¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I size +¤Ï +.I *pp +¤¬»Ø¤·¤Æ¤¤¤ë¹½Â¤ÂΤΠ+.I sizeof +¤Ç¤¢¤ë¡£ +.I proc +¤Ï¤½¤Î¹½Â¤ÂΤΠC ·Á¼°¤È³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦ XDR ¥×¥í¥·¥¸¥ã¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.IP +.\"O Warning: this routine does not understand NULL pointers. +.\"O Use +.\"O .BR xdr_pointer () +.\"O instead. +·Ù¹ð: ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï NULL ¥Ý¥¤¥ó¥¿¡¼¤òÍý²ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£¤«¤ï¤ê¤Ë +.BR xdr_pointer () +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.LP +.nf +.BI "xdr_setpos(XDR *" xdrs ", unsigned int " pos ); +.fi +.IP +.\"O A macro that invokes the set position routine associated with +.\"O the XDR stream +.\"O .IR xdrs . +.\"O The argument +.\"O .I pos +.\"O is a position value obtained from +.\"O .BR xdr_getpos (). +.\"O This routine returns one if the XDR stream could be repositioned, +.\"O and zero otherwise. +¤³¤Î¥Þ¥¯¥í¤Ï XDR ¥¹¥È¥ê¡¼¥à +.I xdrs +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿°ÌÃÖÀßÄê¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤¹¡£°ú¤­¿ô +.I pos +¤Ï +.BR xdr_getpos () +¤Ë¤è¤Ã¤Æ¼èÆÀ¤µ¤ì¤ë°ÌÃÖ¿ôÃͤǤ¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï XDR ¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ¤ÎÊѹ¹¤¬¤Ç¤­¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.IP +.\"O Warning: it is difficult to reposition some types of XDR +.\"O streams, so this routine may fail with one +.\"O type of stream and succeed with another. +·Ù¹ð: ¤¢¤ë¼ï¤Î XDR ¥¹¥È¥ê¡¼¥à¤Î¾ì¹ç¤Ï°ÌÃÖ¤ÎÊѹ¹¤ò¹Ô¤Ê¤¦¤³¤È¤¬º¤Æñ¤Ç¤¢¤ë¡£ +¤½¤ì¤Ç¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¤¢¤ë¼ï¤Î¥¹¥È¥ê¡¼¥à¤Î¾ì¹ç¤Ë¤ÏÀ®¸ù¤·¡¢Ê̤μïÎà¤Î +¾ì¹ç¤Ë¤Ï¼ºÇÔ¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +.nf +.BI "bool_t xdr_short(XDR *" xdrs ", short *" sp ); +.fi +.IP +.\"O A filter primitive that translates between C +.\"O .I short +.\"O integers and their external representations. +.\"O This routine returns one if it succeeds, zero otherwise. +C ¤Î +.I short +À°¿ô¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤¹¤ë¤È 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "void xdrstdio_create(XDR *" xdrs ", FILE *" file ", enum xdr_op " op ); +.fi +.IP +.\"O This routine initializes the XDR stream object pointed to by +.\"O .IR xdrs . +.\"O The XDR stream data is written to, or read from, the +.\"O .I stdio +.\"O stream +.\"O .IR file . +.\"O The argument +.\"O .I op +.\"O determines the direction of the XDR stream (either +.\"O .BR XDR_ENCODE , +.\"O .BR XDR_DECODE , +.\"O or +.\"O .BR XDR_FREE ). +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.I xdrs +¤Ç»Ø¤µ¤ì¤¿ XDR ¥¹¥È¥ê¡¼¥à¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò½é´ü²½¤¹¤ë¡£ +XDR ¥¹¥È¥ê¡¼¥à¤ËÆɤ߽ñ¤­¤ì¤¿¥Ç¡¼¥¿¤Ï +.I stdio +¥¹¥È¥ê¡¼¥à +.I file +¤¬»ÈÍѤµ¤ì¤ë¡£ +.I op +°ú¤­¿ô¤Ï XDR ¥¹¥È¥ê¡¼¥à¤ÎÊÑ´¹Êý¸þ¤ò·èÄꤹ¤ë +.RB ( XDR_ENCODE , +.BR XDR_DECODE , +.B XDR_FREE +¤Î¤É¤ì¤«)¡£ +.IP +.\"O Warning: the destroy routine associated with such XDR streams calls +.\"O .BR fflush (3) +.\"O on the +.\"O .I file +.\"O stream, but never +.\"O .BR fclose (3). +·Ù¹ð: ¤³¤Î¤è¤¦¤Ê XDR ¥¹¥È¥ê¡¼¥à¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ç˲õ¥ë¡¼¥Æ¥£¥ó¤Ï +.I file +¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ +.BR fflush (3) +¤ò¸Æ¤Ó½Ð¤¹¤¬ +.BR fclose (3) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ï¤Ê¤¤¡£ +.LP +.nf +.BI "bool_t xdr_string(XDR *" xdrs ", char **" sp ", unsigned int " maxsize ); +.fi +.IP +.\"O A filter primitive that translates between C strings and +.\"O their corresponding external representations. +.\"O Strings cannot be longer than +.\"O .IR maxsize . +.\"O Note: +.\"O .I sp +.\"O is the address of the string's pointer. +.\"O This routine returns one if it succeeds, zero otherwise. +C ¤Îʸ»úÎó¤È¤½¤ì¤ËÂбþ¤¹¤ë³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +ʸ»úÎó¤Ï +.I maxsize +¤è¤êŤ¯¤Ï¤Ç¤­¤Ê¤¤¡£ +Ãí°Õ: +.I sp +¤Ïʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_u_char(XDR *" xdrs ", unsigned char *" ucp ); +.fi +.IP +.\"O A filter primitive that translates between +.\"O .I unsigned +.\"O C characters and their external representations. +.\"O This routine returns one if it succeeds, zero otherwise. +C ¤Î +.I Éä¹æ̵¤·Ê¸»ú (unsigned char) +¤È¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned *" up ); +.fi +.IP +.\"O A filter primitive that translates between C +.\"O .I unsigned +.\"O integers and their external representations. +.\"O This routine returns one if it succeeds, zero otherwise. +C ¤Î +.I Éä¹æ̵¤·À°¿ô (unsigned) +¤È¤½¤Î³°Éôɽ¸½¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_u_long(XDR *" xdrs ", unsigned long *" ulp ); +.fi +.IP +.\"O A filter primitive that translates between C +.\"O .I "unsigned long" +.\"O integers and their external representations. +.\"O This routine returns one if it succeeds, zero otherwise. +C ¤Î +.I "unsigned long" +À°¿ô¤È¤½¤Î³°Éôɽ¸½¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_u_short(XDR *" xdrs ", unsigned short *" usp ); +.fi +.IP +.\"O A filter primitive that translates between C +.\"O .I "unsigned short" +.\"O integers and their external representations. +.\"O This routine returns one if it succeeds, zero otherwise. +C ¤Î +.I "unsigned short" +À°¿ô¤È¤½¤Î³°Éôɽ¸½¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_union(XDR *" xdrs ", int *" dscmp ", char *" unp , +.BI " struct xdr_discrim *" choices , +.BI " xdrproc_t " defaultarm "); /* may equal NULL */" +.fi +.IP +.\"O A filter primitive that translates between a discriminated C +.\"O .I union +.\"O and its corresponding external representation. +.\"O It first +.\"O translates the discriminant of the union located at +.\"O .IR dscmp . +ʬÊ̲Äǽ¤Ê C ¤Î +.I "¶¦ÍÑÂÎ (union)" +¤È¤½¤Î³°Éô·Á¼°¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +ºÇ½é¤Ë +.I dscmp +¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿¶¦ÍÑÂΤÎʬÊÌÍ×ÁǤ¬ÊÑ´¹¤µ¤ì¤ë¡£ +.\"O This discriminant is always an +.\"O .IR enum_t . +¤³¤ÎʬÊÌÍ×ÁǤϾï¤Ë +.I enum_t +¤Ç¤¢¤ë¡£ +.\"O Next the union located at +.\"O .I unp +.\"O is translated. +.\"O The argument +.\"O .I choices +.\"O is a pointer to an array of +.\"O .BR xdr_discrim () +.\"O structures. +.\"O Each structure contains an ordered pair of +.\"O .RI [ value , proc ]. +¼¡¤Ë +.I unp +¤Î°ÌÃ֤ζ¦ÍÑÂΤ¬ÊÑ´¹¤µ¤ì¤ë¡£°ú¤­¿ô +.I choices +¤Ï +.BR xdr_discrim () +¹½Â¤ÂΤÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£³Æ¹½Â¤ÂÎ¤Ï +.RI [ value , proc ] +¤Î½ç½øÉÕ¤­¥Ú¥¢¤ò³ÊǼ¤·¤Æ¤¤¤ë¡£ +.\"O If the union's discriminant is equal to the associated +.\"O .IR value , +.\"O then the +.\"O .I proc +.\"O is called to translate the union. +.\"O The end of the +.\"O .BR xdr_discrim () +.\"O structure array is denoted by a routine of value NULL. +¤â¤·¶¦ÍÑÂΤÎʬÊÌÍ×ÁǤ¬´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +.I value +¤ÈÅù¤·¤¤¾ì¹ç¤Ë¤Ï¡¢¶¦ÍÑÂΤòÊÑ´¹¤¹¤ë¤¿¤á¤Ë +.I proc +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.BR xdr_discrim () +¹½Â¤ÂΤÎÇÛÎó¤ÎºÇ¸å¤Ï¡¢¥ë¡¼¥Æ¥£¥ó¤È¤·¤Æ +.SM NULL +¤ò»ØÄꤹ¤ë¤³¤È¤Ç¼¨¤µ¤ì¤ë¡£ +.\"O If the discriminant is not found in the +.\"O .I choices +.\"O array, then the +.\"O .I defaultarm +.\"O procedure is called (if it is not NULL). +.\"O Returns one if it succeeds, zero otherwise. +ʬÊÌÍ×ÁǤ¬ +.I choices +ÇÛÎó¤ÎÃæ¤Ë¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.I defaultarm +¤¬ (NULL ¤Ç¤Ê¤±¤ì¤Ð) ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +À®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_vector(XDR *" xdrs ", char *" arrp ", unsigned int " size , +.BI " unsigned int " elsize ", xdrproc_t " elproc ); +.fi +.IP +.\"O A filter primitive that translates between fixed-length arrays +.\"O and their corresponding external representations. +.\"O The argument +.\"O .I arrp +.\"O is the address of the pointer to the array, while +.\"O .I size +.\"O is the element count of the array. +.\"O The argument +.\"O .I elsize +.\"O is the +.\"O .I sizeof +.\"O each of the array's elements, and +.\"O .I elproc +.\"O is an XDR filter that translates between +.\"O the array elements' C form, and their external +.\"O representation. +.\"O This routine returns one if it succeeds, zero otherwise. +¸ÇÄêŤÎÇÛÎó¤È¤½¤ì¤é¤¬Âбþ¤¹¤ë³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +°ú¤­¿ô +.I arrp +¤ÏÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£°ìÊý¤Ç +.I size +¤ÏÇÛÎó¤ÎÍ×ÁÇ¿ô¤½¤Î¤â¤Î¤Ç¤¢¤ë¡£°ú¤­¿ô +.I elsize +¤ÏÇÛÎó¤Î³ÆÍ×ÁǤΠ+.I sizeof +¤Ç¡¢ +.I elproc +¤ÏÇÛÎó¤ÎÍ×ÁǤò C ·Á¼°¤«¤é¤½¤Î³°Éôɽ¸½¤Ø¤ÈÊÑ´¹¤¹¤ë XDR ¥Õ¥£¥ë¥¿¡¼¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_void(void);" +.fi +.IP +.\"O This routine always returns one. +.\"O It may be passed to RPC routines that require a function argument, +.\"O where nothing is to be done. +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¾ï¤Ë 1 ¤òÊÖ¤¹¡£ +¤³¤ì¤Ï²¿¤â¹Ô¤Ê¤ï¤Ê¤¤¤¬¡¢´Ø¿ô°ú¤­¿ô¤¬É¬Í×¤Ê +RPC ¥ë¡¼¥Æ¥£¥ó¤ËÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +.nf +.BI "bool_t xdr_wrapstring(XDR *" xdrs ", char **" sp ); +.fi +.IP +.\"O A primitive that calls +.\"O .B "xdr_string(xdrs, sp,MAXUN.UNSIGNED );" +.\"O where +.\"O .B MAXUN.UNSIGNED +.\"O is the maximum value of an unsigned integer. +.\"O .BR xdr_wrapstring () +.\"O is handy because the RPC package passes a maximum of two XDR +.\"O routines as arguments, and +.\"O .BR xdr_string (), +.\"O one of the most frequently used primitives, requires three. +.\"O Returns one if it succeeds, zero otherwise. +.B "xdr_string(xdrs, sp, \s-1MAXUN.UNSIGNED\s0 );" +¤ò¸Æ¤Ó½Ð¤¹´ðËܥ롼¥Æ¥£¥ó¡£ +¤³¤³¤Ç +.B +.SM MAXUN.UNSIGNED +¤ÏÉä¹æ̵¤·À°¿ô(unsigned int)¤ÎºÇÂçÃͤǤ¢¤ë¡£ +.BR xdr_wrapstring () +¤Ï¡¢ +.SM RPC +¥Ñ¥Ã¥±¡¼¥¸¤ÏÆó¤Ä¤Î +.SM XDR +¥ë¡¼¥Æ¥£¥ó¤ÎºÇÂçÃͤò°ú¤­¿ô¤È¤·¤ÆÅϤ¹¤¿¤áÊØÍø¤Ç¤¢¤ë¡£ +.BR xdr_string () +¤ÏºÇ¤âÉÑÈˤËÍøÍѤµ¤ì¤ë´ðËܥ롼¥Æ¥£¥ó¤Ç¤¢¤ë¤¬»°¤Ä¤òÍ׵᤹¤ë¡£ +À®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡¢¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR rpc (3) +.LP +.\"O The following manuals: +°Ê²¼¤Î¥Þ¥Ë¥å¥¢¥ë: +.RS +eXternal Data Representation Standard: Protocol Specification +.br +eXternal Data Representation: Sun Technical Notes +.br +.IR "XDR: External Data Representation Standard" , +RFC\ 1014, Sun Microsystems, Inc., +USC-ISI. +.RE diff --git a/draft/man3/y0.3 b/draft/man3/y0.3 new file mode 100644 index 00000000..d1293d85 --- /dev/null +++ b/draft/man3/y0.3 @@ -0,0 +1,356 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified Sat Jul 24 19:08:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-08-25, aeb +.\" 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 +.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 +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double y0(double " x ); +.br +.BI "double y1(double " x ); +.br +.BI "double yn(int " n ", double " x ); +.sp +.BI "float y0f(float " x ); +.br +.BI "float y1f(float " x ); +.br +.BI "float ynf(int " n ", float " x ); +.sp +.BI "long double y0l(long double " x ); +.br +.BI "long double y1l(long double " x ); +.br +.BI "long double ynl(int " n ", long double " x ); +.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) +»²¾È): +.in +.sp +.ad l +.BR y0 (), +.BR y1 (), +.BR yn (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE +.br +.BR y0f (), +.BR y0l (), +.BR y1f (), +.BR y1l (), +.BR ynf (), +.BR ynl (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.\" Also seems to work: -std=c99 -D_XOPEN_SOURCE +.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 ¼¡¤Î +ÂèÆó¼ï¥Ù¥Ã¥»¥ë´Ø¿ô¤ÎÃͤòÊÖ¤¹¡£ +.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 +.SH ÊÖ¤êÃÍ +.\"O On success, these functions return the appropriate +.\"O Bessel value of the second kind for +.\"O .IR x . +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ËÂФ¹¤ëÂèÆó¼ï¥Ù¥Ã¥»¥ë´Ø¿ô¤ÎÃͤòÊÖ¤¹¡£ + +.\"O If +.\"O .I x +.\"O is a NaN, a NaN is returned. +.I x +¤¬ 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 ¤òÊÖ¤¹¤³¤È¤âǧ¤á¤Æ¤¤¤ë)¡£ + +.\"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 +¤òÊÖ¤¹¡£ + +.\"O If the result underflows, +.\"O a range error occurs, +.\"O and the functions return 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 +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.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 +¶Ë¥¨¥é¡¼: \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 +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.\" 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 +Îã³°¤òÊÖ¤µ¤Ê¤¤¡£ +.TP +.\"O Range error: result overflow +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.\" 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" +.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 +.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 + +.\"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 ) +¤ò¾å¤²¤Ê¤¤¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR j0 (3) diff --git a/draft/man4/console.4 b/draft/man4/console.4 new file mode 100644 index 00000000..e7c9c671 --- /dev/null +++ b/draft/man4/console.4 @@ -0,0 +1,159 @@ +.\" Copyright (c) 1994 Andries Brouwer (aeb@cwi.nl), Mon Oct 31 21:03:19 MET 1994 +.\" +.\" 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. +.\" +.\" Modified, Sun Feb 26 14:58:45 1995, faith@cs.unc.edu +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Sun Jan 4 16:25:42 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated Wed Jan 9 JST 2002 by Kentaro Shirakata +.\" +.\" WORD: console ¥³¥ó¥½¡¼¥ë +.\" WORD: terminal üËö +.\" WORD: virtual ²¾ÁÛ +.\" WORD: major number ¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ +.\" WORD: minor number ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ +.\" WORD: character device ¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹ +.\" WORD: device file ¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë +.\" WORD: kernel ¥«¡¼¥Í¥ë +.\" WORD: compile ¥³¥ó¥Ñ¥¤¥ë +.\" WORD: key mapping ¥­¡¼¥Þ¥Ã¥Ô¥ó¥° +.\" WORD: screen buffer ¥¹¥¯¥ê¡¼¥ó¥Ð¥Ã¥Õ¥¡ +.\" WORD: simulate ¥·¥ß¥å¥ì¡¼¥È +.\" WORD: escape sequence ¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ +.\" WORD: initial state ½é´ü¾õÂÖ +.\" WORD: reset ¥ê¥»¥Ã¥È +.TH CONSOLE 4 1994-10-31 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +console \- ¥³¥ó¥½¡¼¥ëüËö (console terminal) ¤È²¾ÁÛ¥³¥ó¥½¡¼¥ë (virtual console) +.SH ÀâÌÀ +.\"O A Linux system has up to 63 \fIvirtual consoles\fP +.\"O (character devices with major number 4 and minor number 1 to 63), +.\"O usually called \fI/dev/tty\fP\fIn\fP with 1 \(<= \fIn\fP \(<= 63. +Linux ¥·¥¹¥Æ¥à¤ÏÉáÄÌ¡¢\fI/dev/tty\fP\fIn\fP (n ¤Ï 1 \(<= \fIn\fP \(<= +63) ¤È¸Æ¤Ð¤ì¤ë\fI²¾ÁÛ¥³¥ó¥½¡¼¥ë\fP (¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ (major number) +4 ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ (minor number) 1 ¤«¤é 63 ¤Î¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹ +(character device)) ¤ò»ý¤Ä¡£ +.\"O The current console is also addressed by +.\"O \fI/dev/console\fP or \fI/dev/tty0\fP, the character device with +.\"O major number 4 and minor number 0. +¸½ºß¤Î¥³¥ó¥½¡¼¥ë¤Ï \fI/dev/console\fP ¤Þ¤¿¤Ï \fI/dev/tty0\fP (¥á¥¸¥ã¡¼ +¥Ê¥ó¥Ð¡¼ 4 ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ 0 ¤Î¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹) ¤Ë¤è¤Ã¤Æ¤â°·¤¨¤ë¡£ +.\"O The device files /dev/* are usually created using the script MAKEDEV, +.\"O or using +.\"O .BR mknod (1), +.\"O usually with mode 0622 and owner root.tty. +¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë (device file) /dev/* ¤ÏÉáÄÌ MAKEDEV ¥¹¥¯¥ê¥×¥È¤Þ¤¿¤Ï +.BR mknod (1) +¤ò»È¤Ã¤Æ¥â¡¼¥É 0622¡¢½êÍ­¼Ô root.tty ¤È¤·¤ÆºîÀ®¤µ¤ì¤ë¡£ +.LP +¥«¡¼¥Í¥ë (kernel) ¥Ð¡¼¥¸¥ç¥ó 1.1.54 °ÊÁ°¤Ï¡¢²¾ÁÛ¥³¥ó¥½¡¼¥ë¤Î¿ô¤Ï¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +(tty.h Ãæ¤Î : #define NR_CONSOLES 8 ¤Ë¤è¤Ã¤Æ) ¥«¡¼¥Í¥ë¤ËËä¤á¹þ¤Þ¤ì¤Æ¤¤¤¿¡£ +¤½¤·¤Æ¡¢¤½¤ì¤òÊѹ¹¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·Ä¾¤¹¤³¤È¤Ç²¾ÁÛ¥³¥ó¥½¡¼¥ë¤Î¿ô¤òÊѹ¹¤Ç¤­¤¿¡£ +¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó 1.1.54 °Ê¹ß¤Ç¤Ï²¾ÁÛ¥³¥ó¥½¡¼¥ë¤¬É¬ÍפȤµ¤ì¤ë»þ¤Ï +¤¹¤°¤ËÆ°ºîÃæ¤ËºîÀ®¤µ¤ì¤ë¡£ +.LP +.\"O Common ways to start a process on a console are: +.\"O (a) tell +.\"O .BR init (8) +.\"O (in +.\"O .BR inittab (5)) +.\"O to start a +.\"O .BR mingetty (8) +.\"O (or +.\"O .BR agetty (8)) +.\"O on the console; +¥³¥ó¥½¡¼¥ë¾å¤Ç¥×¥í¥»¥¹¤ò³«»Ï¤¹¤ë°ìÈÌŪ¤ÊÊýË¡¤Ï: +(a) ¥³¥ó¥½¡¼¥ë¾å¤Ç +.BR mingetty (8) +(¤Þ¤¿¤Ï +.BR agetty (8)) +¤ò¥¹¥¿¡¼¥È¤µ¤»¤ë¤³¤È¤ò +.RB ( inittab (5) +¤ÎÃæ¤Ç) +.BR init (8) +¤ËÅÁ¤¨¤ë¡£ +.\"O (b) ask +.\"O .BR openvt (1) +.\"O to start a process on the console; +(b) ¥³¥ó¥½¡¼¥ë¾å¤Ç¥×¥í¥»¥¹¤ò¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤ò +.BR openvt (1) +¤ËÍê¤à¡£ +.\"O (c) start X \(em it will find the first unused console, +.\"O and display its output there. +.\"O (There is also the ancient +.\"O .BR doshell (8).) +(c) X ¤ò³«»Ï¤¹¤ë - X ¤Ï»È¤ï¤ì¤Æ¤¤¤Ê¤¤¥³¥ó¥½¡¼¥ë¤Î¤¦¤ÁºÇ½é¤Î¤â¤Î¤ò¸«ÉÕ¤±¡¢ +¤½¤³¤Ëɽ¼¨¤ò½ÐÎϤ¹¤ë¡£(ÀΤʤ¬¤é¤Î +.BR doshell (8) +¤â¤¢¤ë¡£) +.LP +.\"O Common ways to switch consoles are: (a) use Alt+F\fIn\fP or +.\"O Ctrl+Alt+F\fIn\fP to switch to console \fIn\fP; AltGr+F\fIn\fP +.\"O might bring you to console \fIn\fP+12 [here Alt and AltGr refer +.\"O to the left and right Alt keys, respectively]; +¥³¥ó¥½¡¼¥ë¤òÀÚ¤êÂؤ¨¤ë°ìÈÌŪ¤ÊÊýË¡¤Ï: (a)¥³¥ó¥½¡¼¥ë \fIn\fP ¤ËÀÚ¤êÂؤ¨¤ë +¤¿¤á¤Ë Alt+F\fIn\fP ¤Þ¤¿¤Ï Ctrl+Alt+F\fIn\fP ¤ò»È¤¦¡£ +AltGr+F\fIn\fP ¤ò»È¤¦¤È¡¢¤ª¤½¤é¤¯¥³¥ó¥½¡¼¥ë \fIn\fP+12 ¤ËÀÚ¤êÂؤï¤ë +[¤³¤³¤Ç¤Î Alt ¤È AltGr ¤Ï¤½¤ì¤¾¤ìº¸±¦¤Î Alt ¥­¡¼¤ò¼¨¤¹]¡£ +.\"O (b) use Alt+RightArrow or Alt+LeftArrow to cycle through +.\"O the presently allocated consoles; (c) use the program +.\"O .BR chvt (1). +.\"O (The key mapping is user settable, see +.\"O .BR loadkeys (1); +.\"O the above mentioned key combinations are according to the default settings.) +(b) ¸½ºß³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥³¥ó¥½¡¼¥ë¤ò½Û´Ä¤¹¤ë¤¿¤á¤Ë Alt + ±¦Ìð°õ¥­¡¼ +¤Þ¤¿¤Ï Alt + º¸Ìð°õ¥­¡¼¤ò»È¤¦¡£(c) +.BR chvt (1) +¥×¥í¥°¥é¥à¤ò»È¤¦ +(¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¤Ï¥æ¡¼¥¶¤¬¥»¥Ã¥È¤Ç¤­¤ë¡¢ +.BR loadkeys (1) +¤ò¸«¤è¡£ +¾å¤Ç½Ò¤Ù¤¿¥­¡¼¥Ð¥¤¥ó¥É¤Ï¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¤Ë¤è¤ë¤â¤Î¤Ç¤¢¤ë)¡£ +.LP +.\"O The command +.\"O .BR deallocvt (1) +.\"O (formerly \fBdisalloc\fP) +.\"O will free the memory taken by the screen buffers for consoles +.\"O that no longer have any associated process. +.BR deallocvt (1) +¥³¥Þ¥ó¥É(°ÊÁ°¤Ï \fBdisalloc\fP ¤È¤¤¤¦Ì¾Á°¤À¤Ã¤¿)¤Ï¡¢ +¥×¥í¥»¥¹¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤Ê¤¤¥³¥ó¥½¡¼¥ë¤Î +¥¹¥¯¥ê¡¼¥ó¥Ð¥Ã¥Õ¥¡ (screen buffer) ¤Î¤¿¤á¤Ë»È¤ï¤ì¤Æ¤¤¤ë¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£ +.\"O .SS Properties +.SS ÆÃÀ­ +¥³¥ó¥½¡¼¥ë¤Ï¿¤¯¤Î¾õÂÖ¤ò¤â¤Ã¤Æ¤¤¤ë¡£ +»ä¤Ï¡¢¤½¤ì¤Ë¤Ä¤¤¤Æ¤¤¤Ä¤«¥É¥­¥å¥á¥ó¥È¤Ë¤·¤¿¤¤¤È¹Í¤¨¤Æ¤¤¤ë¡£ +¤â¤Ã¤È¤â½ÅÍפʻö¼Â¤Ï¥³¥ó¥½¡¼¥ë¤Ï vt100 üËö¤ò¿¿»÷¤Æ¤¤¤ë +(¥·¥ß¥å¥ì¡¼¥È¤·¤Æ¤¤¤ë) ¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +¥³¥ó¥½¡¼¥ë¤Ï ESC c ¤È¤¤¤¦Æó¤Ä¤Îʸ»ú¤ò°õ»ú¤¹¤ë»ö¤Ë¤è¤Ã¤Æ¡¢ +½é´ü¾õÂ֤˥ꥻ¥Ã¥È¤µ¤ì¤ë¡£ +¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ (escape sequences) ¤Ë¤Ä¤¤¤Æ¤Ï +.BR console_codes (4) +¤ÇÁ´¤ÆÀâÌÀ¤·¤Æ¤¢¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +.I /dev/console +.br +.I /dev/tty* +.SH ´ØÏ¢¹àÌÜ +.BR chvt (1), +.BR deallocvt (1), +.BR loadkeys (1), +.BR mknod (1), +.BR openvt (1), +.BR console_codes (4), +.BR console_ioctl (4), +.BR tty (4), +.BR ttyS (4), +.BR charsets (7), +.BR agetty (8), +.BR init (8), +.BR mapscrn (8), +.BR mingetty (8), +.BR resizecons (8), +.BR setfont (8) diff --git a/draft/man4/console_codes.4 b/draft/man4/console_codes.4 new file mode 100644 index 00000000..0a561b07 --- /dev/null +++ b/draft/man4/console_codes.4 @@ -0,0 +1,822 @@ +'\" t +.\" Copyright (c) 1996 Andries Brouwer , Mon Oct 31 22:13:04 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. +.\" +.\" This is combined from many sources. +.\" For Linux, the definitive source is of course console.c. +.\" About vt100-like escape sequences in general there are +.\" the ISO 6429 and ISO 2022 norms, the descriptions of +.\" an actual vt100, and the xterm docs (ctlseqs.ms). +.\" Substantial portions of this text are derived from a write-up +.\" by Eric S. Raymond . +.\" +.\" Tiny correction, aeb, 961107. +.\" +.\" 2006-05-27, Several corrections - Thomas E. Dickey +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 +.\" ISHIKAWA Mutsumi, TAKAHASHI Mutsuji +.\" all rights reserved. +.\" Translated Mon Jul 21 03:12:45 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" and TAKAHASHI Mutsuji +.\" +.\" Japanese Version Modified Mon Jan 12 03:29:14 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated Wed Jan 9 JST 2001 by Kentaro Shirakata +.\" Updated Sun Jul 23 JST 2006 by Kentaro Shirakata +.\" Updated Tue Jul 22 JST 2008 by Kentaro Shirakata +.\" +.\" WORD: private mode ¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É +.\" +.TH CONSOLE_CODES 4 2008-01-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +console_codes \- Linux ¥³¥ó¥½¡¼¥ë¤Î¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤È¥³¥ó¥È¥í¡¼¥ë +¥·¡¼¥±¥ó¥¹ +.SH ÀâÌÀ +Linux ¥³¥ó¥½¡¼¥ë¤Ï VT102 ¤È ECMA-48/ISO6429/ANSI X3.64 üËö¥³¥ó¥½¡¼¥ë¤Î +¥µ¥Ö¥»¥Ã¥È¤Ë¡¢¥«¥é¡¼¥Ñ¥ì¥Ã¥È¤äʸ»ú½¸¹ç¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ê¤É¤òÊѹ¹¤¹¤ë +¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É¥·¡¼¥±¥ó¥¹¤ò²Ã¤¨¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +°Ê²¼¤Îɽ¤Ç¤Ï¡¢µ¡Ç½¤Î ECMA-48 ¤Þ¤¿¤Ï DEC ¤Î¥Ë¡¼¥â¥Ë¥¯¥¹(DEC¤Ç»Ï¤Þ¤ì¤Ð¸å¼Ô)¤ò +2 ÈÖÌܤηå¤Ëµ­¤¹¡£ +¥Ë¡¼¥â¥Ë¥¯¥¹¤Î¤Ê¤¤¤â¤Î¤Ï ECMA-48 ¤Ç¤â VT102 ¤Ç¤â¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¡£ +.LP +¤¹¤Ù¤Æ¤Î½ÐÎϺî¶È¤¬½ª¤Ã¤Æ¡¢¼ÂºÝ¤Ë°õ»ú¤¹¤ë¤¿¤á¤Ëʸ»ú¤Î¥¹¥È¥ê¡¼¥à¤¬ +¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð¡¼¤ËÆϤ¤¤¿»þ¡¢ºÇ½é¤Ë¹Ô¤Ê¤ï¤ì¤ë¤Î¤¬¡¢½èÍýÍÑ¥³¡¼¥É¤«¤é +°õ»úÍѤΥ³¡¼¥É¤Ø¤ÎÊÑ´¹¤Ç¤¢¤ë¡£ +.LP +¤â¤·¡¢¥³¥ó¥½¡¼¥ë¤¬ UTF-8 ¥â¡¼¥É¤Ê¤é¡¢Æþ¤Ã¤ÆÍ褿¥Ð¥¤¥È(byte)¤Ï +16 ¥Ó¥Ã¥È¤Î Unicode ¤ËÁȤßΩ¤Æ¤é¤ì¤ë¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢¤½¤ì¤¾¤ì¤Î +¥Ð¥¤¥È¤Ï¸½ºß¤Î(³Æ¥Ð¥¤¥È¤ò Unicode ¤ÎÃͤËÊÑ´¹¤¹¤ë)¥Þ¥Ã¥Ô¥ó¥°¥Æ¡¼¥Ö¥ë¤Ë +½¾¤Ã¤ÆÊÑ´¹¤µ¤ì¤ë¡£¤³¤ì¤Ë´Ø¤·¤Æ¤Ï²¼¤Î¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È(Charcter Sets) +Àá¤ò»²¾È¤Î¤³¤È¡£ +.LP +Ä̾Unicode ¤ÎÃͤϥե©¥ó¥È¥¤¥ó¥Ç¥Ã¥¯¥¹(font index) ¤ËÊÑ´¹¤µ¤ì¡¢ +¥Ó¥Ç¥ª¥á¥â¥ê¤ËÃߤ¨¤é¤ì¤ë¡£¤½¤·¤Æ(¥Ó¥Ç¥ª ROM Ãæ¤Ë¸«ÉÕ¤±¤é¤ì¤ë) +Âбþ¤¹¤ë¥°¥ê¥Õ(glyph)¤¬²èÌ̤˸½¤ì¤ë¡£ +Unicode ¤òÍѤ¤¤ë¤È¡¢(PC ¸ß´¹µ¡¤ÎÀ߷פǤÏ) 512 ¤Î°Û¤Ê¤Ã¤¿ +¥°¥ê¥Õ¤òƱ»þ¤ËÍøÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.LP +¸½ºß¤Î Unicode ¤ÎÃͤ¬¥³¥ó¥È¥í¡¼¥ëʸ»ú¤Ç¤¢¤ë¤«¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤ò +½èÍý¤·¤Æ¤¤¤ë»þ¤Ë¤Ï¡¢¤½¤ÎÃͤÏÆÃÊ̤˰·¤ï¤ì¤ë¡£ +¥Õ¥©¥ó¥È¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ËÊÑ´¹¤µ¤ì¤Æ¥°¥ê¥Õ¤È¤·¤Æɽ¼¨¤µ¤ì¤ëÂå¤ï¤ê¤Ë¡¢¥«¡¼¥½¥ë¤Î +°ÜÆ°¤ä¤½¤Î¾¤Î¥³¥ó¥È¥í¡¼¥ëµ¡Ç½¤ò¼Â¹Ô¤µ¤»¤ë¡£ +¾Ü¤·¤¤¤³¤È¤Ï¡¢¸å½Ò¤Î¡ÖLINUX ¥³¥ó¥½¡¼¥ë¥³¥ó¥È¥í¡¼¥ë¡×¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È¤Î¤³¤È¡£ +.LP +°ìÈ̤ËüËö¥³¥ó¥È¥í¡¼¥ë¥³¡¼¥É¤ò¥×¥í¥°¥é¥àÃæ¤ËľÀܵ­½Ò¤¹¤ë¤Î¤Ï +Îɤ¤¤³¤È¤Ç¤Ï¤Ê¤¤¡£ +Linux¤Ç¤Ï¡¢Ã¼Ëö¤Ë¤ª¤¤¤Æ¼Â¸½²Äǽ¤ÊÁàºî¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç¤¢¤ë +.BR terminfo (5) +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¥³¥ó¥½¡¼¥ë¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤ò¤ï¤¶¤ï¤¶ÆþÎϤ¹¤ë¤è¤ê¤â¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç +terminfo ¤Î¾ðÊó¤ò»²¾È¤¹¤ë +.BR ncurses (3), +.BR tput (1), +¤ä +.BR reset (1) +¤Ê¤É¤Î¥¹¥¯¥ê¡¼¥ó¥é¥¤¥Ö¥é¥ê¤ä¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡¼¤ò»È¤¤¤¿¤¤¤È»×¤¦¤Ç¤¢¤í¤¦¡£ +.SS "Linux ¥³¥ó¥½¡¼¥ë¥³¥ó¥È¥í¡¼¥ë" +¤³¤Î¾Ï¤Ç¤Ï Linux ¥³¥ó¥½¡¼¥ë¤Ë¤ª¤¤¤ÆÆüì¤Êµ¡Ç½(¤Ä¤Þ¤ê¡¢¸½ºß¤Î¥«¡¼¥½¥ë°ÌÃÖ¤Ë +ʸ»ú¤Î¥¤¥á¡¼¥¸¤ò°õ»ú¤¹¤ë°Ê³°¤Î¤³¤È)¤òµ¯¤³¤µ¤»¤ëÁ´¤Æ¤Î¥³¥ó¥È¥í¡¼¥ëʸ»ú¤È +¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤ë¡£ +.PP +.B "¥³¥ó¥È¥í¡¼¥ëʸ»ú" +.sp +¥³¥ó¥È¥í¡¼¥ëʸ»ú¤È¤Ï¡¢(¥Þ¥Ã¥Ô¥ó¥°¥Æ¡¼¥Ö¥ë¤Ë¤è¤ëÊÑ´¹Á°¤Î¥³¡¼¥É¤¬) +00 (NUL), 07 (BEL), 08 (BS), 09 (HT), 0a (LF), 0b (VT), +0c (FF), 0d (CR), 0e (SO), 0f (SI), 18 (CAN), 1a (SUB), +1b (ESC), 7f (DEL) ¤Î 14 ¤Î¥³¡¼¥É¤Î¤¦¤Á¤Î¤É¤ì¤«¤Ç¤¢¤ëʸ»ú¤Ç¤¢¤ë¡£ +"¥³¥ó¥È¥í¡¼¥ëʸ»úɽ¼¨(display control characters)"¥â¡¼¥É(¸å½Ò)¤ò +ÀßÄꤹ¤ë¤È¡¢07, 09, 0b, 18, 1a, 7f ¤ò¥°¥ê¥Õ¤È¤·¤Æɽ¼¨¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°ìÊý¡¢ UTF-8 ¥â¡¼¥É¤Ç¤Ï¡¢00-1f ¤ÎÁ´¤Æ¤Î¥³¡¼¥É¤Ï¡¢¥³¥ó¥È¥í¡¼¥ëʸ»úɽ¼¨ +¥â¡¼¥É¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ç¤â¥³¥ó¥È¥í¡¼¥ëʸ»ú¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +.PP +¥³¥ó¥È¥í¡¼¥ëʸ»ú¤¬¤¢¤ë»þ¤Ë¤Ï¡¢¤½¤ì¤Ï¤¹¤°¤Ë(¤¿¤È¤¨¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤Î +ÅÓÃæ¤Ç¤â)¼Â¹Ô¤µ¤ì¡¢ÇË´þ¤µ¤ì¤ë¡£¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤Ï¼¡¤Îʸ»ú¤«¤é³¤±¤é¤ì¤ë +(¤·¤«¤·¡¢ESC ¤Ï¿·¤·¤¤¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤ò»Ï¤á¤ë¤Î¤Ç¡¢ +Á°¤Î½ªÎ»¤·¤Æ¤¤¤Ê¤¤¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤¬Ãæ»ß¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤µ¤é¤Ë¡¢CAN ¤È SUB ¤Ï¤É¤ó¤Ê¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤âÃæ»ß¤¹¤ë)¡£ +ǧ¤á¤é¤ì¤Æ¤¤¤ë¥³¥ó¥È¥í¡¼¥ëʸ»ú¤Ï¡¢BEL, BS, HT, LF, VT, FF, CR, SO, SI, +CAN, SUB, ESC, DEL, CSI ¤Ç¤¢¤ë¡£¤³¤ì¤é¤Ï´üÂԤɤª¤ê¤ÎÆ°ºî¤ò¤¹¤ë: +.HP +.\"O BEL (0x07, \fB^G\fP) beeps; +BEL (0x07, \fB^G\fP) ¤Ï¥Ó¡¼¥×²»¤òÌĤ餹; +.HP +.\"O BS (0x08, \fB^H\fP) backspaces one column +.\"O (but not past the beginning of the line); +BS (0x08, \fB^H\fP) ¤Ï¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹ +(¤¿¤À¤·¡¢¹ÔƬ¤Ï±Û¤¨¤Ê¤¤); +.HP +.\"O HT (0x09, \fB^I\fP) goes to the next tab stop or to the end of the line +.\"O if there is no earlier tab stop; +HT (0x09, \fB^I\fP) ¤Ï¼¡¤Î¥¿¥Ö¥¹¥È¥Ã¥×(tab stop)¤Ø°ÜÆ°¤¹¤ë¡¢¤½¤³¤«¤é¹ÔËö¤Þ¤Ç¤Ë +¥¿¥Ö¥¹¥È¥Ã¥×¤¬Ìµ¤¤¾ì¹ç¤Ï¹Ô¤Î½ª¤ê¤Ë°ÜÆ°¤¹¤ë; +.HP +.\"O LF (0x0A, \fB^J\fP), VT (0x0B, \fB^K\fP) and +.\"O FF (0x0C, \fB^L\fP) all give a linefeed, +.\"O and if LF/NL (new-line mode) is set also a carriage return; +LF (0x0A, \fB^J\fP), VT (0x0B, \fB^K\fP), FF (0x0C, \fB^L\fP) ¤³¤ì¤é¤ÏÁ´¤Æ +¥é¥¤¥ó¥Õ¥£¡¼¥É(linefeed)¤òÍ¿¤¨¤ë; +LF/NL (¥Ë¥å¡¼¥é¥¤¥ó¥â¡¼¥É(new line mode))¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð +¥­¥ã¥ê¥Ã¥¸¥ê¥¿¡¼¥ó¤â¥¢¥¯¥Æ¥£¥Ö¤Ë¤¹¤ë; +.HP +.\"O CR (0x0D, \fB^M\fP) gives a carriage return; +CR (0x0D, \fB^M\fP) ¤Ï¥­¥ã¥ê¥Ã¥¸¥ê¥¿¡¼¥ó¤òÍ¿¤¨¤ë; +.HP +.\"O SO (0x0E, \fB^N\fP) activates the G1 character set; +SO (0x0E, \fB^N\fP) ¤Ï G1 ʸ»ú½¸¹ç¤ò¥¢¥¯¥Æ¥£¥Ö¤Ë¤¹¤ë¡£ +.HP +.\"O SI (0x0F, \fB^O\fP) activates the G0 character set; +SI (0x0F, \fB^O\fP) ¤Ï G0 ʸ»ú½¸¹ç¤ò¥¢¥¯¥Æ¥£¥Ö¤Ë¤¹¤ë; +.HP +.\"O CAN (0x18, \fB^X\fP) and SUB (0x1A, \fB^Z\fP) interrupt escape sequences; +CAN (0x18, \fB^X\fP) ¤È SUB (0x1A, \fB^Z\fP) ¤Ï¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤òÃæÃǤ¹¤ë; +.HP +.\"O ESC (0x1B, \fB^[\fP) starts an escape sequence; +ESC (0x1B, \fB^[\fP) ¤Ï¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤ò»Ï¤á¤ë¡£ +.HP +DEL (0x7F) ¤Ï̵»ë¤µ¤ì¤ë; +.HP +CSI (0x9B) ¤Ï ESC [ ¤ÈÅù²Á¡£ +.PP +.B "¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤Ç¤¢¤ë¤¬ CSI ¥·¡¼¥±¥ó¥¹¤Ç¤Ê¤¤¤â¤Î" +.sp +.TS +l l l. +ESC c RIS ¥ê¥»¥Ã¥È¡£ +ESC D IND ¥é¥¤¥ó¥Õ¥£¡¼¥É¡£ +ESC E NEL ¥Ë¥å¡¼¥é¥¤¥ó¡£ +ESC H HTS ¸½ºß¤Î·å¤Î°ÌÃ֤˥¿¥Ö¥¹¥È¥Ã¥×¤òÀßÄꤹ¤ë¡£ +ESC M RI µÕ¥é¥¤¥ó¥Õ¥£¡¼¥É +.\"O ESC Z DECID T{ +.\"O DEC private identification. The kernel +.\"O returns the string ESC [ ? 6 c, claiming +.\"O that it is a VT102. +.\"O T} +ESC Z DECID T{ +DEC¸ÇÍ­¤Î¼±ÊÌÍÑ¡£¥«¡¼¥Í¥ë¤Ïʸ»úÎó ESC [ ? 6 c ¤òÊÖ¤¹¡£ +¤³¤ì¤ÏüËö¤¬VT102¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +T} +.\"O ESC 7 DECSC T{ +.\"O Save current state (cursor coordinates, +.\"O attributes, character sets pointed at by G0, G1). +.\"O T} +ESC 7 DECSC T{ +¸½ºß¤Î¾õÂÖ(¥«¡¼¥½¥ë¤ÎºÂɸ¡¢Â°À­¡¢G0, G1 ¤Ç¼¨¤·¤Æ¤¤¤ë +ʸ»ú½¸¹ç)¤ò¥»¡¼¥Ö¤¹¤ë¡£ +T} +.\"O ESC 8 DECRC Restore state most recently saved by ESC 7. +ESC 8 DECRC ºÇ¸å¤Ë ESC 7 ¤Ç¥»¡¼¥Ö¤·¤¿¾õÂÖ¤òÉüµ¢¤µ¤»¤ë¡£ +ESC [ CSI ¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤òƳÆþ¤¹¤ë¡£ +ESC % ¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤òÁªÂò¤¹¤ë¥·¡¼¥±¥ó¥¹¤ò³«»Ï¤¹¤ë¡£ +ESC % @ \0\0\0 ¥Ç¥Õ¥©¥ë¥È(ISO 646 / ISO 8859-1)¤òÁªÂò¤¹¤ë¡£ +ESC % G \0\0\0 UTF-8 ¤òÁªÂò¤¹¤ë¡£ +ESC % 8 \0\0\0 UTF-8 ¤òÁªÂò¤¹¤ë(µì¼°)¡£ +ESC # 8 DECALN DEC ¤Î¥¹¥¯¥ê¡¼¥óÄ´À°¥Æ¥¹¥È \- ¥¹¥¯¥ê¡¼¥ó¤ò E ¤Ç + ¤¦¤á¤ë¡£ +ESC ( G0 ʸ»ú½¸¹ç¤òÄêµÁ¤¹¤ë¥·¡¼¥±¥ó¥¹¤ò³«»Ï¤¹¤ë¡£ +ESC ( B \0\0\0 ¥Ç¥Õ¥©¥ë¥È(ISO 8859-1 ¥Þ¥Ã¥Ô¥ó¥°)¤òÁªÂò¤¹¤ë¡£ +.\"O ESC ( 0 \0\0\0Select VT100 graphics mapping +ESC ( 0 \0\0\0 VT100 ¥°¥é¥Õ¥£¥¯¥¹¥Þ¥Ã¥Ô¥ó¥°¤òÁªÂò¤¹¤ë¡£ +ESC ( U \0\0\0 ¥Ì¥ë¥Þ¥Ã¥Ô¥ó¥°¤òÁªÂò¤¹¤ë \- ¥­¥ã¥é¥¯¥¿ ROM ¤«¤é + \0\0\0 ľÀܥޥåԥ󥰤¹¤ë¡£ +ESC ( K \0\0\0 ¥æ¡¼¥¶¡¼ÄêµÁ¤Î¥Þ¥Ã¥Ô¥ó¥°¤òÁªÂò¤¹¤ë \- ¤½¤Î¥Þ¥Ã¥× + \0\0\0 ¤Ï \fBmapscrn\fP(8) ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡¼¤Ë¤è¤Ã¤Æ¥í¡¼ + \0\0\0 ¥É¤µ¤ì¤ë¡£ +ESC ) G1 ¤òÄêµÁ¤¹¤ë¥·¡¼¥±¥ó¥¹¤ò³«»Ï¤¹¤ë¡£ + (¤¹¤Ç¤Ë½Ò¤Ù¤¿¤è¤¦¤Ë B, 0, U, K ¤Î¤É¤ì¤«¤¬¼¡¤Ë³¤¯) +ESC > DECPNM ¿ôÃÍ¥­¡¼¥Ñ¥Ã¥É¥â¡¼¥É(numeric keypad mode)¤ò + ¥»¥Ã¥È¤¹¤ë¡£ +ESC = DECPAM ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥­¡¼¥Ñ¥Ã¥É¥â¡¼¥É(application keypad + mode) ¤ò¥»¥Ã¥È¤¹¤ë¡£ +.\"O ESC ] OSC T{ +.\"O (Should be: Operating system command) +.\"O ESC ] P \fInrrggbb\fP: set palette, with parameter +.\"O given in 7 hexadecimal digits after the final P :-(. +.\"O Here \fIn\fP is the color (0-15), and \fIrrggbb\fP indicates +.\"O the red/green/blue values (0-255). +.\"O ESC ] R: reset palette +.\"O T} +ESC ] OSC T{ +("Operating system command"¤Î¤³¤È¤À¤í¤¦) +ESC ] P \fInrrggbb\fP: ºÇ¸å¤Î P ¤Î¤¢¤È¤Î 7 ¤Ä¤Î 16 ¿Ê¿ô¤ò +¥Ñ¥é¥á¡¼¥¿¤È¤·¤Æ :-( ¥Ñ¥ì¥Ã¥È¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤³¤Ç¡¢\fIn\fP¤Ï¿§ (0-15)¡¢\fIrrggbb\fP¤ÏÀÖ/ÎÐ/ÀĤÎÃÍ +(0-255)¤ò°ÕÌ£¤¹¤ë¡£ +ESC ] R: ¥Ñ¥ì¥Ã¥È¤ò¥ê¥»¥Ã¥È¤¹¤ë¡£ +T} +.TE +.PP +.B "ECMA-48 CSI ¥·¡¼¥±¥ó¥¹" +.sp +CSI (¤Þ¤¿¤Ï ESC [ ) ¤Î¤¢¤È¤Ë¡¢ºÇÂç¤Ç NPAR (16) ¸Ä¤Î¥»¥ß¥³¥í¥ó¤Ç¶èÀÚ¤é¤ì¤¿ +10 ¿Ê¿ô¤Î¥Ñ¥é¥á¡¼¥¿¥·¡¼¥±¥ó¥¹¤¬Â³¤¯¡£ +¶õ¤Ç¤¢¤ë¤«¤½¤³¤Ë¤Ê¤¤¥Ñ¥é¥á¡¼¥¿¤Ï 0 ¤È¤µ¤ì¤ë¡£ +¥Ñ¥é¥á¡¼¥¿¥·¡¼¥±¥ó¥¹¤ÎÁ°¤Ë¤Ï¤Ò¤È¤Ä¤Î¥¯¥¨¥¹¥Á¥ç¥ó¥Þ¡¼¥¯¤¬¤Ä¤¯¤³¤È¤¬¤¢¤ë¡£ +.PP +¤·¤«¤·¡¢CSI [ (¤Þ¤¿¤Ï ESC [ [ ) ¤Î¸å¤Ç¤Ï¡¢°ìʸ»ú¤¬Æɤޤ졢¤³¤Î¤¹¤Ù¤Æ¤Î +¥Ñ¥é¥á¡¼¥¿¥·¡¼¥±¥ó¥¹¤¬Ìµ»ë¤µ¤ì¤ë(Íפ¹¤ë¤Ë¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Î¥¨¥³¡¼¤Ï +̵»ë¤µ¤ì¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë)¡£ +.PP +CSI ¥·¡¼¥±¥ó¥¹¤ÎÆ°ºî¤Ï¡¢¤½¤ÎºÇ¸å¤Îʸ»ú¤Ë¤è¤Ã¤Æ·è¤Þ¤ë¡£ +.TS +l l l. +@ ICH »Ø¼¨¤µ¤ì¤¿¿ô¤Î¶õÇòʸ»ú¤òÁÞÆþ¤¹¤ë¡£ +A CUU »Ø¼¨¤µ¤ì¤¿¿ô¤À¤±¥«¡¼¥½¥ë¤ò¾åÊý¸þ¤Ë°ÜÆ°¤¹¤ë¡£ +B CUD ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¿ô¤Î¹Ô¤À¤±²¼Êý¸þ¤Ë°ÜÆ°¤¹¤ë¡£ +C CUF ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¿ô¤Î·å¤À¤±±¦¤Ë°ÜÆ°¤¹¤ë¡£ +D CUB ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¿ô¤Î·å¤À¤±º¸¤Ë°ÜÆ°¤¹¤ë¡£ +E CNL ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¿ô¤Î¹Ô¤À¤±²¼¤ÎÂè 1 ·å¤Ë°ÜÆ°¤¹¤ë¡£ +F CPL ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¿ô¤Î¹Ô¤À¤±¾å¤ÎÂè 1 ·å¤Ë°ÜÆ°¤¹¤ë¡£ +G CHA ¥«¡¼¥½¥ë¤ò¸½ºß¤Î¹Ô¤Î»Ø¼¨¤µ¤ì¤¿·å¤Ë°ÜÆ°¤¹¤ë¡£ +H CUP ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¹Ô¡¢·å(1,1¤ò¸¶ÅÀ¤È¤¹¤ë)¤Ë + °ÜÆ°¤¹¤ë¡£ +J ED ¥Ç¥£¥¹¥×¥ì¥¤¤Î¾Ãµî(¥Ç¥Õ¥©¥ë¥È: ¥«¡¼¥½¥ë¤«¤é¥Ç¥£¥¹¥×¥ì¥¤¤Î + ºÇ¸å¤Þ¤Ç)¡£ + ESC [ 1 J: ºÇ½é¤«¤é¥«¡¼¥½¥ë¤Þ¤Ç¤Î¾Ãµî¡£ + ESC [ 2 J: ¥Ç¥£¥¹¥×¥ì¥¤Á´ÂΤξõ +K EL ¹Ô¤Î¾Ãµî(¥Ç¥Õ¥©¥ë¥È: ¥«¡¼¥½¥ë¤«¤é¹ÔËö¤Þ¤Ç)¡£ + ESC [ 1 K: ¹ÔƬ¤«¤é¥«¡¼¥½¥ë¤Þ¤Ç¤Î¾Ãµî¡£ + ESC [ 2 K: ¹ÔÁ´ÂΤξõ +L IL »Ø¼¨¤µ¤ì¤¿¿ô¤Î¶õ¹Ô¤òÁÞÆþ¤¹¤ë¡£ +M DL »Ø¼¨¤µ¤ì¤¿¿ô¤Î¹Ô¤òºï½ü¤¹¤ë¡£ +P DCH ¸½ºß¤Î¹Ô¤«¤é»Ø¼¨¤µ¤ì¤¿¿ô¤Îʸ»ú¤òºï½ü¤¹¤ë¡£ +X ECH ¸½ºß¤Î¹Ô¤«¤é»Ø¼¨¤µ¤ì¤¿¿ô¤Îʸ»ú¤ò¾Ãµî¤¹¤ë¡£ +a HPR ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¿ô¤Î·å¤À¤±±¦¤Ë°ÜÆ°¤¹¤ë¡£ +c DA ESC [ ? 6 c ¤òÊÖ¤¹: "»ä¤ÏVT102¤Ç¤¹"(¤È¤¤¤¦¤³¤È)¡£ +d VPA ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¹Ô¤Î¸½ºß¤Î·å¤Ë°ÜÆ°¤¹¤ë¡£ +e VPR ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¹Ô¿ô¤À¤±²¼¤Ë°ÜÆ°¤¹¤ë¡£ +f HVP ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¹Ô¡¢·å¤Ë°ÜÆ°¤¹¤ë¡£ +g TBC ¥Ñ¥é¥á¡¼¥¿¤Ê¤·¤Î»þ: ¸½ºß°ÌÃ֤Υ¿¥Ö¥¹¥È¥Ã¥×¤òºï½ü¤¹¤ë¡£ + ESC [ 3 g: ¤¹¤Ù¤Æ¤Î¥¿¥Ö¥¹¥È¥Ã¥×¤òºï½ü¤¹¤ë¡£ +h SM ¥â¡¼¥É¤Î¥»¥Ã¥È(¸å½Ò)¡£ +l RM ¥â¡¼¥É¤Î¥ê¥»¥Ã¥È(¸å½Ò)¡£ +m SGR °À­¤Î¥»¥Ã¥È(¸å½Ò)¡£ +n DSR ¾õÂÖ¤ÎÊó¹ð(¸å½Ò)¡£ +q DECLL ¥­¡¼¥Ü¡¼¥É¤Î LED ¤ò¥»¥Ã¥È¤¹¤ë¡£ + ESC [ 0 q: ¤¹¤Ù¤Æ¤Î LED ¤ò¾Ã¤¹¡£ + ESC [ 1 q: ¥¹¥¯¥í¡¼¥ë¥í¥Ã¥¯ LED ¤òÅÀÅô¡£ + ESC [ 2 q: ¥Ê¥ó¥Ð¡¼¥í¥Ã¥¯ LED ¤òÅÀÅô¡£ + ESC [ 3 q: ¥­¥ã¥Ô¥¿¥ë¥í¥Ã¥¯ LED ¤òÅÀÅô¡£ +r DECSTBM ¥¹¥¯¥í¡¼¥ë¤ÎÈϰϤΥ»¥Ã¥È; ¥Ñ¥é¥á¡¼¥¿¤Ï°ìÈÖ¾å¤Î¹Ô¤È + °ìÈÖ²¼¤Î¹Ô¡£ +s ? ¥«¡¼¥½¥ë°ÌÃÖ¤ÎÊݸ¡£ +u ? ¥«¡¼¥½¥ë°ÌÃÖ¤ÎÉüµ¢¡£ +\` HPA ¥«¡¼¥½¥ë¤ò¸½ºß¤Î¹Ô¤Î»Ø¼¨¤µ¤ì¤¿·å¤Ë°ÜÆ°¤¹¤ë¡£ +.TE +.PP +.B "ECMA-48 ¥°¥é¥Õ¥£¥¯¥¹¥ì¥ó¥Ç¥£¥·¥ç¥ó(Graphics Rendition)¤ÎÀßÄê" +.sp +.\"O The ECMA-48 SGR sequence ESC [ \fIparameters\fP m sets display +.\"O attributes. +.\"O Several attributes can be set in the same sequence, separated by +.\"O semicolons. +.\"O An empty parameter (between semicolons or string initiator or +.\"O terminator) is interpreted as a zero. +ECMA-48 SGR ¥·¡¼¥±¥ó¥¹ ESC [ <¥Ñ¥é¥á¡¼¥¿> m ¤Ïɽ¼¨Â°À­¤òÀßÄꤹ¤ë¡£ +¥»¥ß¥³¥í¥ó¤Ç¶èÀڤ뤳¤È¤Ç¡¢Æ±¤¸¥·¡¼¥±¥ó¥¹¤Ç¤¤¤¯¤Ä¤«¤Î°À­¤òÀßÄê¤Ç¤­¤ë¡£ +¶õ¥Ñ¥é¥á¡¼¥¿(¥»¥ß¥³¥í¥ó¤«Ê¸»úÎ󳫻Ïʸ»ú¤«Ê¸»úÎó½ªÃ¼Ê¸»ú¤Î´Ö)¤Ï¥¼¥í¤È²ò¼á¤µ¤ì¤ë¡£ +.TS +l l. +¥Ñ¥é¥á¡¼¥¿ ·ë²Ì +0 ¤¹¤Ù¤Æ¤Î°À­¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤¹¤ë¡£ +1 ¥Ü¡¼¥ë¥É(bold)¤ò¥»¥Ã¥È¡£ +2 ¥Ï¡¼¥Õ¥Ö¥é¥¤¥È(half-bright)(¥«¥é¡¼¥Ç¥£¥¹¥×¥ì¥¤¤Ç¤Ï¿§¤ÇÂåÍÑ)¤ò + ¥»¥Ã¥È¡£ +.\"O 4 T{ +.\"O set underscore (simulated with color on a color display) +.\"O (the colors used to simulate dim or underline are set +.\"O using ESC ] ...) +.\"O T} +4 T{ +²¼Àþ(underscore)¤ò¥»¥Ã¥È(¥«¥é¡¼¥Ç¥£¥¹¥×¥ì¥¤¤Ç¤Ï¿§¤ÇÂåÍÑ)¡£ +(¥Ç¥£¥à¤ä²¼Àþ¤òÂåÍѤ¹¤ë¤Î¤Ë»È¤ï¤ì¤ë¿§¤Ï ESC ] ... ¤Ë¤è¤ê¥»¥Ã¥È) +T} +5 ÅÀÌÇ(blink)¤ò¥»¥Ã¥È¡£ +7 ȿžɽ¼¨(reverce video)¤ò¥»¥Ã¥È¡£ +.\"O 10 T{ +.\"O reset selected mapping, display control flag, +.\"O and toggle meta flag (ECMA-48 says "primary font"). +.\"O T} +10 T{ +ÁªÂò¤·¤¿¥Þ¥Ã¥Ô¥ó¥°¡¢¥Ç¥£¥¹¥×¥ì¥¤¥³¥ó¥È¥í¡¼¥ë¥Õ¥é¥°(display +control flag)¡¢¥È¥°¥ë¥á¥¿¥Õ¥é¥°(toggle meta flag)¤ò¥ê¥»¥Ã¥È¤¹¤ë +(ECMA-48¤Ç¤Ï"primary font"¤È¸Æ¤ó¤Ç¤¤¤ë)¡£ +T} +.\"O 11 T{ +.\"O select null mapping, set display control flag, +.\"O reset toggle meta flag (ECMA-48 says "first alternate font"). +.\"O T} +11 T{ +¥Ì¥ë¥Þ¥Ã¥Ô¥ó¥°¤òÁªÂò¡¢¥Ç¥£¥¹¥×¥ì¥¤¥³¥ó¥È¥í¡¼¥ë¥Õ¥é¥°¤ò¥»¥Ã¥È¡¢ +¥È¥°¥ë¥á¥¿¥Õ¥é¥°¤ò¥ê¥»¥Ã¥È¤¹¤ë +(ECMA-48 ¤Ç¤Ï"first alternate font"¤È¸Æ¤ó¤Ç¤¤¤ë)¡£ +T} +.\"O 12 T{ +.\"O select null mapping, set display control flag, +.\"O set toggle meta flag (ECMA-48 says "second alternate font"). +.\"O The toggle meta flag +.\"O causes the high bit of a byte to be toggled +.\"O before the mapping table translation is done. +.\"O T} +12 T{ +¥Ì¥ë¥Þ¥Ã¥Ô¥ó¥°¤òÁªÂò¡¢¥Ç¥£¥¹¥×¥ì¥¤¥³¥ó¥È¥í¡¼¥ë¥Õ¥é¥°¡¢ +¥È¥°¥ë¥á¥¿¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë +(ECMA-48 ¤Ç¤Ï "second alternate font" ¤È¸Æ¤ó¤Ç¤¤¤ë)¡£ +¥È¥°¥ë¥á¥¿¥Õ¥é¥°¤¬¤¿¤Ã¤Æ¤¤¤ë¤È¡¢ +¥Þ¥Ã¥Ô¥ó¥°¥Æ¡¼¥Ö¥ë¤Ë¤è¤ëÊÑ´¹¤ò¤¹¤ëÁ°¤Ë¡¢¥Ð¥¤¥È¤Î¾å°Ì¤Î1¥Ó¥Ã¥È¤¬ +¥È¥°¥ë¤µ¤ì¤ë¡£ +T} +.\"O 21 set normal intensity (ECMA-48 says "doubly underlined") +21 Ä̾ï¤Îµ±Å٤˥»¥Ã¥È(ECMA-48 ¤Ç¤Ï "doubly underlined" ¤È¸Æ¤ó¤Ç¤¤¤ë)¡£ +22 Ä̾ï¤Îµ±Å٤˥»¥Ã¥È¡£ +24 ²¼Àþ¥ª¥Õ¡£ +25 ÅÀÌÇ¥ª¥Õ¡£ +27 ȿžɽ¼¨¥ª¥Õ¡£ +30 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É(foreground)¤ò¹õ¤Ë¥»¥Ã¥È¡£ +31 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤òÀ֤˥»¥Ã¥È¡£ +32 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤òÎФ˥»¥Ã¥È¡£ +33 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤òÃã¤Ë¥»¥Ã¥È¡£ +34 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤òÀĤ˥»¥Ã¥È¡£ +35 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤ò¥Þ¥¼¥ó¥À¤Ë¥»¥Ã¥È¡£ +36 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤ò¥·¥¢¥ó¤Ë¥»¥Ã¥È¡£ +37 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤òÇò¤Ë¥»¥Ã¥È¡£ +38 ²¼Àþɽ¼¨¤ËÀßÄꤷ¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¥»¥Ã¥È¡£ +39 ²¼Àþɽ¼¨¤ò²ò½ü¤·¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¥»¥Ã¥È¡£ +40 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É(background)¤ò¹õ¤Ë¥»¥Ã¥È¡£ +41 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤òÀ֤˥»¥Ã¥È¡£ +42 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤òÎФ˥»¥Ã¥È¡£ +43 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤òÃã¤Ë¥»¥Ã¥È¡£ +44 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤òÀĤ˥»¥Ã¥È¡£ +45 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤ò¥Þ¥¼¥ó¥À¤Ë¥»¥Ã¥È¡£ +46 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤ò¥·¥¢¥ó¤Ë¥»¥Ã¥È¡£ +47 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤òÇò¤Ë¥»¥Ã¥È¡£ +49 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¥»¥Ã¥È¡£ +.TE +.PP +.B "ECMA-48 ¥â¡¼¥É¥¹¥¤¥Ã¥Á(Mode Switches)" +.TP +ESC [ 3 h +DECCRM (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥ª¥Õ): ¥³¥ó¥È¥í¡¼¥ëʸ»ú¤òɽ¼¨¤¹¤ë¡£ +.TP +ESC [ 4 h +DECIM (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥ª¥Õ): ÁÞÆþ¥â¡¼¥É¤Ë¤¹¤ë¡£ +.TP +ESC [ 20 h +LF/NL (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥ª¥Õ): LF, VT, FF¤ò¥¨¥³¡¼¤·¤¿¤¢¤È¼«Æ°Åª CR ¤ò¤Ä¤±¤ë¡£ +.\" +.PP +.B "ECMA-48 ¾õÂÖ¥ê¥Ý¡¼¥È¥³¥Þ¥ó¥É(Status Report Commands)" +.\" +.TP +ESC [ 5 n +¥Ç¥Ð¥¤¥¹¾õÂ֤Υê¥Ý¡¼¥È(DSR): ÊÖ»ö¤Ï ESC [ 0 n (üËö OK). +.TP +ESC [ 6 n +¥«¡¼¥½¥ë°ÌÃ֤Υê¥Ý¡¼¥È(CPR): ÊÖ»ö¤Ï ESC [ \fIy\fP ; \fIx\fP R¡¢ +\fIx,y\fP ¤Ï¥«¡¼¥½¥ë¤Î°ÌÃÖ¤ò¤¢¤é¤ï¤¹¡£ +.\" +.PP +.B "DEC ¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É (DECSET/DECRST) ¥·¡¼¥±¥ó¥¹" +.sp +.\" +¤³¤ì¤é¤Ï ECMA-48 ¤Ç¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¡£¤³¤³¤Ç¤Ï¡¢¥»¥Ã¥È¥â¡¼¥É +¥·¡¼¥±¥ó¥¹ (Set Mode sequences)¤òµ­ºÜ¤¹¤ë; ºÇ¸å¤Î \(aqh\(aq ¤ò \(aql\(aq ¤Ë +ÃÖ¤­´¹¤¨¤ë¤È¥ê¥»¥Ã¥È¥â¡¼¥É¥·¡¼¥±¥ó¥¹(Reset Mode sequences)¤Ë¤Ê¤ë¡£ +.TP +ESC [ ? 1 h +DECCKM (¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥Õ): ¥»¥Ã¥È¤µ¤ì¤¿»þ¤Ë¤Ï¥«¡¼¥½¥ë¥­¡¼¤Ï ESC [ ¤Ç¤Ï¤Ê¤¯ +ESC O ¤òÁ°¤Ë¤Ä¤±¤ÆÁ÷¤ë¡£ +.TP +ESC [ ? 3 h +DECCOLM (¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥Õ = 80 ·å): 80/132 ¤Î·å¥â¡¼¥ÉÀÚÂؤ¨¡£ +¥É¥é¥¤¥Ð¡¼¤Î¥½¡¼¥¹¤ÎÃí¼á¤Ë¤Ï¡¢¤³¤ì¤À¤±¤Ç¤Ï½½Ê¬¤Ç¤Ê¤¯ +.BR resizecons (8) +¤Î¤è¤¦¤Ê¥æ¡¼¥¶¡¼¥â¡¼¥É¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡¼¤Ç¡¢¥³¥ó¥½¡¼¥ë¥Ó¥Ç¥ª¥«¡¼¥É¤Î +¥Ï¡¼¥É¥¦¥§¥¢¥ì¥¸¥¹¥¿¤òÊѤ¨¤ëɬÍפ¬¤¢¤ë¤È½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +ESC [ ? 5 h +DECSCNM (¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥Õ): ȿžɽ¼¨¥â¡¼¥É¤Î¥»¥Ã¥È¡£ +.TP +ESC [ ? 6 h +DECOM(¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥Õ): ¥»¥Ã¥È¤µ¤ì¤¿»þ¤Ë¤Ï¡¢¥«¡¼¥½¥ë¤Î¥¢¥É¥ì¥Ã¥·¥ó¥°¤¬¡¢ +¥¹¥¯¥í¡¼¥ëÈϰϤκ¸¾å¶ù¤«¤é¤ÎÁêÂаÌÃ֤ˤʤ롣 +.TP +ESC [ ? 7 h +DECAWM(¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥ó): ¥ª¡¼¥È¥é¥Ã¥×¤òÀßÄê¡£¤³¤Î¥â¡¼¥É¤Î»þ¤Ï¡¢80 ·å +(DECCOLM ¤¬¥ª¥ó¤Î¤È¤­¤Ï 132 ·å)¤òĶ¤¨¤¿¥°¥é¥Õ¥£¥Ã¥¯¥­¥ã¥é¥¯¥¿¤Ï¡¢ +¶¯À©Åª¤Ë¼¡¤Î¹Ô¤ÎÀèƬ¤ËÀÞ¤êÊÖ¤µ¤ì¤Æɽ¼¨¤µ¤ì¤ë¡£ +.TP +ESC [ ? 8 h +DECARM(¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥ó): ¥­¡¼¥Ü¡¼¥É¤Î¥ª¡¼¥È¥ê¥Ô¡¼¥È¤ò¥ª¥ó¤Ë¥»¥Ã¥È¡£ +.TP +ESC [ ? 9 h +X10 ¥Þ¥¦¥¹¥ê¥Ý¡¼¥È(¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥Õ): ¥ê¥Ý¡¼¥È¥â¡¼¥É¤ò 1 ¤Ë¥»¥Ã¥È(¤Þ¤¿¤Ï¡¢ +0 ¤Ë¥ê¥»¥Ã¥È) \(em ¸å½Ò +.TP +ESC [ ? 25 h +.\"O DECTECM (default on): Make cursor visible. +DECTECM (¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥ó): ¥«¡¼¥½¥ë¤ò²Ä»ë(visible)¤Ë¤¹¤ë¡£ +.TP +ESC [ ? 1000 h +X11 ¥Þ¥¦¥¹¥ê¥Ý¡¼¥È(¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥Õ): ¥ê¥Ý¡¼¥È¥â¡¼¥É¤ò 2 ¤Ë¥»¥Ã¥È(¤Þ¤¿¤Ï¡¢ +0¤Ë¥ê¥»¥Ã¥È) \(em ¸å½Ò +.\" +.PP +.B "Linux ¥³¥ó¥½¡¼¥ë¥×¥é¥¤¥Ù¡¼¥È CSI ¥·¡¼¥±¥ó¥¹" +.sp +.\" +°Ê²¼¤Î¥·¡¼¥±¥ó¥¹¤Ï ECMA-48 ¤Î¤â¤Î¤Ç¤âËÜÍè¤Î VT102 ¤Î¤â¤Î¤Ç¤â¤Ç¤â¤Ê¤¯¡¢ +Linux¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð¡¼¤Ë¸ÇÍ­¤Ê¥·¡¼¥±¥ó¥¹¤Ç¤¢¤ë¡£¿§¤Ï SGR ¥Ñ¥é¥á¡¼¥¿¤Ç +ɽ¸½¤µ¤ì¤ë: 0 = ¹õ, 1= ÀÖ, 2 = ÎÐ, 3 = Ãã, 4 = ÀÄ, 5 = ¥Þ¥¼¥ó¥¿, +6 = ¥·¥¢¥ó, 7 = Çò +.TS +l l. +ESC [ 1 ; \fIn\fP ] ²¼Àþ¤Î¿§¤ò\fIn\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC [ 2 ; \fIn\fP ] ¥Ç¥£¥à¤Î¿§¤ò\fIn\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC [ 8 ] ¸½ºß¤Î¿§¤Î¥Ú¥¢¤ò¥Ç¥Õ¥©¥ë¥È°À­¤Ë¤¹¤ë¡£ +ESC [ 9 ; \fIn\fP ] ¥¹¥¯¥ê¡¼¥ó¥Ö¥é¥ó¥¯(screen blank)¤Î¥¿¥¤¥à¥¢¥¦¥È + ¤ò \fIn\fP ʬ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC [ 10 ; \fIn\fP ] ¥Ù¥ë¤Î¼þÇÈ¿ô(Hz)¤ò¥»¥Ã¥È¤¹¤ë¡£ +ESC [ 11 ; \fIn\fP ] ¥Ù¥ë¤ÎÌĤäƤ¤¤ë»þ´Ö(msec)¤ò¥»¥Ã¥È¤¹¤ë¡£ +ESC [ 12 ; \fIn\fP ] »ØÄê¤Î¥³¥ó¥½¡¼¥ë¤òÁ°Ì̤˻ý¤Ã¤Æ¤¯¤ë¡£ +ESC [ 13 ] ¥¹¥¯¥ê¡¼¥ó¤ò¥¢¥ó¥Ö¥é¥ó¥¯(Unblank)¤¹¤ë¡£ +ESC [ 14 ] VESAÅŸ»Ää»ß¥¤¥ó¥¿¡¼¥Ð¥ë(VESA powerdown + interval)¤ò¥»¥Ã¥È¤¹¤ë¡£ +.TE +.SS ʸ»ú½¸¹ç +.\"O The kernel knows about 4 translations of bytes into console-screen +.\"O symbols. +.\"O The four tables are: a) Latin1 \-> PC, +.\"O b) VT100 graphics \-> PC, c) PC \-> PC, d) user-defined. +¥«¡¼¥Í¥ë¤Ï¡¢¥Ð¥¤¥ÈÎ󤫤饳¥ó¥½¡¼¥ë¥¹¥¯¥ê¡¼¥óÉä¹æ¤ÎÊÑ´¹¤ò 4 ¤Ä +ÃΤäƤ¤¤ë¡£ +4 ¤Ä¤ÎÊÑ´¹¥Æ¡¼¥Ö¥ë¤È¤Ï¡¢a) Latin1 \-> PC, b) VT100 graphics \-> PC, +c) PC \-> PC, d) ¥æ¡¼¥¶¡¼ÄêµÁ, ¤Ç¤¢¤ë¡£ +.PP +.\"O There are two character sets, called G0 and G1, and one of them +.\"O is the current character set. +.\"O (Initially G0.) +.\"O Typing \fB^N\fP causes G1 to become current, +.\"O \fB^O\fP causes G0 to become current. +G0 ¤È G1 ¤È¸Æ¤Ð¤ì¤ëÆó¤Ä¤Îʸ»ú½¸¹ç¤¬¤¢¤ê¡¢¤½¤Î¤¦¤Á°ì¤Ä¤¬¸½ºß¤Î +ʸ»ú½¸¹ç¤Ç¤¢¤ë(½é´üÃÍ¤Ï G0 )¡£ +\fB^N\fP ¤ò¥¿¥¤¥×¤¹¤ë¤È G1 ¤¬ \fB^O\fP ¤òÆþÎϤ¹¤ë¤È G0 ¤¬¸½ºß¤Îʸ»ú½¸¹ç¤Ë¤Ê¤ë¡£ +.PP +.\"O These variables G0 and G1 point at a translation table, and can be +.\"O changed by the user. +.\"O Initially they point at tables a) and b), respectively. +.\"O The sequences ESC ( B and ESC ( 0 and ESC ( U and ESC ( K cause G0 to +.\"O point at translation table a), b), c) and d), respectively. +.\"O The sequences ESC ) B and ESC ) 0 and ESC ) U and ESC ) K cause G1 to +.\"O point at translation table a), b), c) and d), respectively. +ÊÑ¿ô G0 ¤È G1 ¤ÏÊÑ´¹¥Æ¡¼¥Ö¥ë¤ò»Ø¤·¤Æ¤ª¤ê¡¢¥æ¡¼¥¶¡¼¤Ë¤è¤êÊѹ¹¤Ç¤­¤ë¡£ +ºÇ½é¤Ï¤½¤ì¤¾¤ì¥Æ¡¼¥Ö¥ë a) ¤È ¥Æ¡¼¥Ö¥ë b) ¤ò»Ø¤·¤Æ¤¤¤ë¡£ +ESC ( B ¡¢ ESC ( 0 ¡¢ ESC ( U ¡¢ ESC ( K ¤Î¤½¤ì¤¾¤ì¤Î¥·¡¼¥±¥ó¥¹¤Ë¤è¤ê¡¢ +G0 ¤¬ÊÑ´¹¥Æ¡¼¥Ö¥ë a)¡¢ b)¡¢ c)¡¢ d) ¤ò»Ø¤¹¤è¤¦¤Ë¤Ê¤ë¡£ +¤Þ¤¿¡¢ESC ) B ¡¢ ESC ) 0 ¡¢ ESC ) U ¡¢ ESC ) K ¤Î¤½¤ì¤¾¤ì¤Î¥·¡¼¥±¥ó¥¹ +¤Ë¤è¤ê¡¢G1 ¤¬ÊÑ´¹¥Æ¡¼¥Ö¥ë a)¡¢ b)¡¢ c)¡¢ d) ¤ò»Ø¤¹¤è¤¦¤Ë¤Ê¤ë¡£ +.PP +ESC c ¤Î¥·¡¼¥±¥ó¥¹¤ÏüËö¤ò¥ê¥»¥Ã¥È¤¹¤ë¡£¥¹¥¯¥ê¡¼¥ó¤¬¤á¤Á¤ã¤¯¤Á¤ã¤Ë¤Ê¤Ã¤¿ +»þ¤Ë¤½¤¦¤¹¤ë¤³¤È¤¬É¬ÍפǤ¢¤ë¡£¤è¤¯¥¢¥É¥Ð¥¤¥¹¤µ¤ì¤ë "echo ^V^O" ¤Ï G0 +¤ò¸½ºß¤Îʸ»ú½¸¹ç¤Ë¤¹¤ë¤À¤±¤Ç¤¢¤ê¡¢G0 ¤¬¥Æ¡¼¥Ö¥ë a) ¤ò»Ø¤·¤Æ¤¤¤ë¤È¤¤¤¦ +ÊݾڤϤʤ¤¡£ +¤¤¤¯¤Ä¤«¤Î¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ë¤Ï¡¢ +.BR reset (1) +¤È¤¤¤¦¥×¥í¥°¥é¥à¤¬´Þ¤Þ¤ì¤ë¤¬¡¢¤³¤ì¤Ï¤¿¤À "echo ^[c" ¤ò¼Â¹Ô¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.\"O If your terminfo entry for the console is correct +.\"O (and has an entry rs1=\\Ec), then "tput reset" will also work. +¤â¤·¡¢¥³¥ó¥½¡¼¥ë¤Î terminfo ¥¨¥ó¥È¥ê¡¼¤¬Àµ¤·¤¤(¤«¤Ä rs1=\\Ec ¤Î¥¨¥ó¥È¥ê¡¼¤¬ +¤¢¤ë)¤Ê¤é¤Ð¡¢"tput reset"¤Ç¤âƱ¤¸¸ú²Ì¤¬¤¢¤ë¡£ +.PP +¥æ¡¼¥¶¡¼ÄêµÁ¤Î¥Þ¥Ã¥Ô¥ó¥°¥Æ¡¼¥Ö¥ë¤Ï +.BR mapscrn (8) +¤ò»È¤Ã¤ÆÄêµÁ¤Ç¤­¤ë¡£ +¥Þ¥Ã¥Ô¥ó¥°¤Î·ë²Ì¡¢¥·¥ó¥Ü¥ë c ¤¬°õ»ú¤µ¤ì¤ë¤È¥·¥ó¥Ü¥ë s = map[c] ¤¬ +¥Ó¥Ç¥ª¥á¥â¥ê¤ËÁ÷¤é¤ì¤ë¡£s ¤ËÂбþ¤¹¤ë¥Ó¥Ã¥È¥Þ¥Ã¥×¤Ï¥­¥ã¥é¥¯¥¿¡¼ ROM ¤Ë¤¢¤ê¡¢ +.BR setfont (8) +¤Ë¤è¤êÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +.SS ¥Þ¥¦¥¹¥È¥é¥Ã¥­¥ó¥° +.\"O The mouse tracking facility is intended to return +.\"O .BR xterm (1)-compatible +.\"O mouse status reports. +.\"O Because the console driver has no way to know +.\"O the device or type of the mouse, these reports are returned in the +.\"O console input stream only when the virtual terminal driver receives +.\"O a mouse update ioctl. +.\"O These ioctls must be generated by a mouse-aware +.\"O user-mode application such as the +.\"O .BR gpm (8) +.\"O daemon. +¥Þ¥¦¥¹¥È¥é¥Ã¥­¥ó¥°µ¡Ç½¤Ï¡¢ +.BR xterm (1)-¸ß´¹¤Î +¥Þ¥¦¥¹¥¹¥Æ¡¼¥¿¥¹¥ê¥Ý¡¼¥È(mouse +status reports)¤òÊÖ¤µ¤»¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð¡¼¤Ï¥Þ¥¦¥¹¤Î¥Ç¥Ð¥¤¥¹¤ä¼ïÎà¤Ë¤Ä¤¤¤ÆÃΤëÊýË¡¤¬ +¤Ê¤¤¤Î¤Ç¡¢²¾ÁÛ¥¿¡¼¥ß¥Ê¥ë¥É¥é¥¤¥Ð¡¼¤¬¥Þ¥¦¥¹¹¹¿·¤Î ioctl ¤ò¼õ¤±¼è¤Ã¤¿»þ¤À¤±¡¢ +¥Þ¥¦¥¹¥¹¥Æ¡¼¥¿¥¹¥ê¥Ý¡¼¥È¤¬¥³¥ó¥½¡¼¥ë¤ÎÆþÎÏ¥¹¥È¥ê¡¼¥à¤ËÁ÷¤é¤ì¤ë¡£ +¤³¤Î ioctl ¤Ï¡¢ +.BR gpm (8) +¥Ç¡¼¥â¥ó¤Î¤è¤¦¤Ê¥Þ¥¦¥¹Âбþ¤Î¥æ¡¼¥¶¡¼¥â¡¼¥É +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬È¯À¸¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The mouse tracking escape sequences generated by +.\"O \fBxterm\fP(1) encode numeric parameters in a single character as +.\"O \fIvalue\fP+040. +.\"O For example, \(aq!\(aq is 1. +.\"O The screen coordinate system is 1-based. +\fBxterm\fP(1) ¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤ëÁ´¤Æ¤Î¥Þ¥¦¥¹ÄÉÀ×¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤Î¤¿¤á¤Î +¥Ñ¥é¥á¡¼¥¿¤Ï¡¢¿ôÃͤò \fIvalue\fP+040 ¤Î¤è¤¦¤ËÉä¹æ²½¤·¡¢°ì¤Ä¤Îʸ»ú¤È¤·¤Æ +¤¢¤é¤ï¤¹¡£ +Î㤨¤Ð¡¢\(aq!\(aq ¤Ï 1 ¤Ë¤Ê¤ë¡£¥¹¥¯¥ê¡¼¥óºÂɸ¤Ï 1 ¤ò¥Ù¡¼¥¹¤Ë¤¹¤ë¡£ +.PP +X10 ¸ß´¹¥â¡¼¥É¤Ç¤Ï¡¢¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿»þ¤Ë¥Þ¥¦¥¹¤Î°ÌÃ֤Ȳ¡¤µ¤ì¤¿¥Þ¥¦¥¹¤Î +¥Ü¥¿¥ó¤È¤ò¥¨¥ó¥³¡¼¥É¤·¤¿¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤òÁ÷¤ë¡£ +¤³¤Îµ¡Ç½¤Ï ESC [ ? 9 h ¤òÁ÷¤ë¤ÈÍ­¸ú¤Ë¤Ê¤ê ESC [ ? 9 l ¤Ë¤è¤ê̵¸ú¤Ë¤Ê¤ë¡£ +¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤ë¤È \fBxterm\fP(1) ¤Ï ESC [ M \fIbxy\fP (¤Î 6 ʸ»ú)¤òÁ÷¤ë¡£ +¤³¤³¤Ç \fIb\fP ¤Ï button\-1, \fIx\fP ¤È \fIy\fP ¤Ï ¥Þ¥¦¥¹¤¬¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿ +»þ¤Î x ¤È y ºÂɸ¤Ç¤¢¤ë¡£ +¤³¤Î¥³¡¼¥É¤Ï¥«¡¼¥Í¥ë¤¬È¯À¸¤¹¤ë¤Î¤ÈƱ¤¸¥³¡¼¥É¤Ç¤¢¤ë¡£ +.PP +¥Î¡¼¥Þ¥ë¥È¥é¥Ã¥­¥ó¥°¥â¡¼¥É(Normal tracking mode)(Linux 2.0.24 ¤Ç¤Ï +¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤)¤Ç¤Ï¡¢Î¾Êý¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿¤«Î¥¤µ¤ì¤¿»þ¤Ë +¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤¬Á÷¤é¤ì¤ë¡£ +¥â¥Ç¥£¥Õ¥¡¥¤¥¢¤Î¾ðÊó¤â°ì½ï¤ËÁ÷¤é¤ì¤ë¡£ +¤³¤Îµ¡Ç½¤Ï¡¢ESC [ ? 1000 h ¤òÁ÷¤ë¤ÈÍ­¸ú¤Ë¤Ê¤ê ESC [ ? 1000 l ¤Ç̵¸ú¤Ë¤Ê¤ë¡£ +¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤ë¤«Î¥¤µ¤ì¤ë¤«¤·¤¿»þ¤Ë¤Ï¡¢\fBxterm\fP(1) ¤Ï ESC [ M +\fIbxy\fP ¤òÁ÷¤ë¡£ +\fIb\fP ¤ÎÄã°Ì¤Î2¥Ó¥Ã¥È¤Ë¤Ï¥Ü¥¿¥ó¾ðÊ󤬥¨¥ó¥³¡¼¥É¤µ¤ì¤ë: +0=MB1 ¤¬²¡¤µ¤ì¤¿, 1=MB2 ¤¬²¡¤µ¤ì¤¿, 2=MB3 ¤¬²¡¤µ¤ì¤¿, 3=Î¥¤µ¤ì¤¿¡£ +¹â°Ì¤Î¥Ó¥Ã¥È¤Ë¤Ï¡¢¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿»þ¤Ë¤É¤Î¥â¥Ç¥£¥Õ¥¡¥¤¥¢¤¬¥À¥¦¥ó¤·¤Æ¤¤¤¿¤«¤¬ +¥¨¥ó¥³¡¼¥É¤µ¤ì¤ë: 4=Shift, 8=Meta, 16=Control¡£ +¤½¤·¤Æ¡¢¾å°Ì¤È²¼°Ì¥Ó¥Ã¥È¤¬²Ã»»¤µ¤ì¤ë¡£ +¤³¤³¤Ç¤â \fIx\fP ¤È \fIy\fP ¤Ï¡¢¥Þ¥¦¥¹¥¤¥Ù¥ó¥È¤¬µ¯¤³¤Ã¤¿»þ¤Î +x ¤È y ºÂɸ¤Ç¤¢¤ê¡¢º¸¾å¤Î¶ù¤¬(1,1)¤Ç¤¢¤ë¡£ +.SS ¾¤Î¥¿¡¼¥ß¥Ê¥ë¤È¤ÎÈæ³Ó +.\"O Many different terminal types are described, like the Linux console, +.\"O as being "VT100-compatible". +.\"O Here we discuss differences between the +.\"O Linux console and the two most important others, the DEC VT102 and +.\"O .BR xterm (1). +¿¤¯¤Î°Û¤Ê¤ë¥¿¡¼¥ß¥Ê¥ë¥¿¥¤¥×¤¬¡¢Linux ¥³¥ó¥½¡¼¥ë¤Î¤è¤¦¤Ë¡¢"VT100¸ß´¹"¤ò +̾¾è¤Ã¤Æ¤¤¤ë¡£ +¤³¤³¤Ç¤Ï¡¢Linux ¥³¥ó¥½¡¼¥ë¤È 2 ¤Ä¤ÎºÇ¤â½ÅÍפʥ¿¡¼¥ß¥Ê¥ë¤Ç¤¢¤ë +DEC VT102 ¤È +.BR xterm (1) +¤È¤Î°ã¤¤¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤ë¡£ +.\" +.PP +.B ¥³¥ó¥È¥í¡¼¥ëʸ»ú¤Î¼è¤ê°·¤¤ +.sp +VT102 ¤Ï°Ê²¼¤Î¥³¥ó¥È¥í¡¼¥ëʸ»ú¤âǧ¼±¤¹¤ë: +.HP +NUL (0x00) ¤Ï̵»ë¤µ¤ì¤ë; +.HP +ENQ (0x05) ¤Ï¥¢¥ó¥µ¡¼¥Ð¥Ã¥¯¥á¥Ã¥»¡¼¥¸(answerback message)¤òȯÀ¸¤¹¤ë; +.HP +.\"O DC1 (0x11, \fB^Q\fP, XON) resumed transmission; +DC1 (0x11, \fB^Q\fP, XON) ¤ÏÁ÷¿®¤òºÆ³«¤¹¤ë; +.HP +.\"O DC3 (0x13, \fB^S\fP, XOFF) caused VT100 to ignore (and stop transmitting) +.\"O all codes except XOFF and XON. +DC3 (0x13, \fB^S\fP, XOFF) ¤Ï VT100 ¤Ë XOFF ¤È XON °Ê³°¤Î¥³¡¼¥É¤ò̵»ë(¤½¤·¤Æ +Á÷¿®¤ÎÄä»ß)¤òµ¯¤³¤µ¤»¤ë¡£ +.LP +tty ¥É¥é¥¤¥Ð¡¼¤Ë¤è¤ê VT100 ¤Ë»÷¤¿ DC1/DC3 ½èÍý¤ò¤Ç¤­¤ë¡£ +.LP +.BR xterm (1) +(VT100 ¥â¡¼¥É)¤Ï BEL, BS, HT, LF, VT, FF, CR, SO, SI, ESC ¤Î +¥³¥ó¥È¥í¡¼¥ëʸ»ú¤òǧ¼±¤¹¤ë¡£ +.\" +.PP +.B ¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ +.sp +Linux ¥³¥ó¥½¡¼¥ë¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤ VT100 ¥³¥ó¥½¡¼¥ë¥·¡¼¥±¥ó¥¹¤Ï°Ê²¼¤ÎÄ̤ê: +.TS +l l l. +ESC N SS2 ¥·¥ó¥°¥ë¥·¥Õ¥È 2 + (¼¡¤Îʸ»ú¤À¤± G2 ʸ»ú½¸¹ç¤òÁªÂò¤¹¤ë)¡£ +ESC O SS3 ¥·¥ó¥°¥ë¥·¥Õ¥È 3 + (¼¡¤Îʸ»ú¤À¤± G3 ʸ»ú½¸¹ç¤òÁªÂò¤¹¤ë)¡£ +ESC P DCS ¥Ç¥Ð¥¤¥¹À©¸æʸ»úÎó (ESC \\ ¤Ç½ª¤ï¤ë) +ESC X SOS ʸ»úÎó¤Î»Ï¤Þ¤ê¡£ +ESC ^ PM ¥×¥é¥¤¥Ð¥·¡¼¥á¥Ã¥»¡¼¥¸(ESC \\ ¤Ç½ª¤ï¤ë)¡£ +ESC \\ ST ʸ»úÎó¤Î½ªÃ¼Ê¸»ú¡£ +ESC * ... G2 ʸ»ú½¸¹ç¤ò»ØÄꤹ¤ë¡£ +ESC + ... G3 ʸ»ú½¸¹ç¤ò»ØÄꤹ¤ë¡£ +.TE +.PP +.BR xterm (1) +(VT100 ¥â¡¼¥É)¤Ï ESC c, ESC # 8, ESC >, ESC =, +ESC D, ESC E, ESC H, ESC M, ESC N, ESC O, ESC P ... ESC \\, +ESC Z ¤òǧ¼±¤¹¤ë("¤ï¤¿¤·¤Ï¹âÅù¥Ó¥Ç¥ª¥ª¥×¥·¥ç¥óÉÕ¤­¤Î VT100 ¤Ç¤¹"¤È¤¤¤¦ +°ÕÌ£¤Ç ESC [ ? 1 ; 2 c ¤ÈÊÖÅú¤¹¤ë)¡¢ESC ^ ... ESC \\ ¤Ï¾å½Ò¤ÈƱ¤¸°ÕÌ£¤ò +¤¢¤é¤ï¤¹¡£ESC (, ESC ), ESC *, ESC + ¤Ë³¤¯ 0, A, B ¤ò DEC Æüìʸ»ú¤È +¤·¤Æ¼õ¤±¡¢¤½¤ì¤¾¤ì¥é¥¤¥ó¥É¥í¡¼¥¤¥ó¥°(line drawing) ¤Î¥»¥Ã¥È¡¢UK¡¢ +US-ASCII ¤ò¤¢¤é¤ï¤¹¡£ +.PP +.\"O The user can configure \fBxterm\fP(1) to respond to VT220-specific +.\"O control sequences, and it will identify itself as a VT52, VT100, and +.\"O up depending on the way it is configured and initialized. +¥æ¡¼¥¶¡¼¤Ï \fBxterm\fP(1) ¤¬ VT220 ÆÃÍ­¤Î¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤Ë +È¿±þ¤¹¤ë¤è¤¦¤ËÀßÄê¤Ç¤­¡¢¤Þ¤¿ÀßÄê¤È½é´ü²½¤Î¤µ¤ì¤«¤¿¤Ë¤è¤Ã¤Æ +¼«Ê¬¼«¿È¤ò VT52, VT100 ¤Ê¤É¤Èǧ¼±¤¹¤ë¡£ +.PP +.\"O It accepts ESC ] (OSC) for the setting of certain resources. +.\"O In addition to the ECMA-48 string terminator (ST), +.\"O \fBxterm\fP(1) accepts a BEL to terminate an OSC string. +.\"O These are a few of the OSC control sequences recognized by \fBxterm\fP(1): +xterm ¤Ï¡¢ÆÃÄê¤Î¥ê¥½¡¼¥¹¤ÎÀßÄê¤Î¤¿¤á¤Ë ESC ] (OSC) ¤ò¼õ¤±ÉÕ¤±¤ë¡£ +ECMA-48 ¤Îʸ»úÎó½ªÃ¼Ê¸»ú (ST) ¤Ë²Ã¤¨¤Æ¡¢ +\fBxterm\fP(1) ¤Ï BEL ¤ò OSC ʸ»úÎó¤ò½ªÃ¼¤¹¤ë¤â¤Î¤È¤·¤Æ¼õ¤±ÉÕ¤±¤ë¡£ +°Ê²¼¤Ï \fBxterm\fP(1) ¤¬Ç§¼±¤¹¤ë OSC ¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤Î°ìÉô¤Ç¤¢¤ë¡£ +.TS +l l. +.\"O ESC ] 0 ; \fItxt\fP ST Set icon name and window title to \fItxt\fP. +.\"O ESC ] 1 ; \fItxt\fP ST Set icon name to \fItxt\fP. +.\"O ESC ] 2 ; \fItxt\fP ST Set window title to \fItxt\fP. +.\"O ESC ] 4 ; \fInum\fP; \fItxt\fP ST Set ANSI color \fInum\fP to \fItxt\fP. +.\"O ESC ] 10 ; \fItxt\fP ST Set dynamic text color to \fItxt\fP. +.\"O ESC ] 4 6 ; \fIname\fP ST Change log file to \fIname\fP (normally disabled +.\"O by a compile-time option) +.\"O ESC ] 5 0 ; \fIfn\fP ST Set font to \fIfn\fP. +ESC ] 0 ; \fItxt\fP ST ¥¢¥¤¥³¥ó̾¤È¥¦¥¤¥ó¥É¥¦¥¿¥¤¥È¥ë¤ò \fItxt\fP ¤Ë + ¥»¥Ã¥È¤¹¤ë¡£ +ESC ] 1 ; \fItxt\fP ST ¥¢¥¤¥³¥ó̾¤ò \fItxt\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC ] 2 ; \fItxt\fP ST ¥¦¥¤¥ó¥É¥¦¥¿¥¤¥È¥ë¤ò \fItxt\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC ] 4 ; \fInum\fP; \fItxt\fP ST ANSI ¿§ \fInum\fP ¤ò \fItxt\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC ] 10 ; \fI\fItxt\fP\fP ST ưŪ¥Æ¥­¥¹¥È¿§¤ò \fItxt\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC ] 4 6 ; \fIname\fP ST ¥Á¥§¥ó¥¸¥í¥°¥Õ¥¡¥¤¥ë¤ò \fIname\fP ¤ËÊѹ¹¤¹¤ë(Ä̾ï¤Ï + ¥³¥ó¥Ñ¥¤¥ë»þ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë)¡£ +ESC ] 5 0 ; \fIfn\fP ST ¥Õ¥©¥ó¥È¤ò \fIfn\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +.TE +.PP +.\"O It recognizes the following with slightly modified meaning +.\"O (saving more state, behaving closer to VT100/VT220): +°Ê²¼¤Î¤â¤Î¤Ï¡¢¾¯¤·°ã¤Ã¤¿°ÕÌ£¤Ë¤È¤é¤ì¤ë +(¤è¤ê¿¤¯¤Î¾õÂÖ¤òÊݸ¤·¡¢¤è¤ê VT100/VT220 ¤Ë¶á¤¤¤Õ¤ë¤Þ¤¤¤ò¤¹¤ë): +.LP +.TS +l l l. +ESC 7 DECSC ¥«¡¼¥½¥ë¤ÎÊݸ¡£ +ESC 8 DECRC ¥«¡¼¥½¥ë¤ÎÉü¸µ¡£ +.TE +.PP +¤Þ¤¿¡¢¼¡¤Î¤â¤Î¤âǧ¼±¤¹¤ë: +.TS +l l l. +ESC F ¥«¡¼¥½¥ë¤ò¥¹¥¯¥ê¡¼¥ó¤Îº¸²¼¤Ë°ÜÆ°¤¹¤ë¡£ + (\fBxterm\fP(1) ¤Î \fBhpLowerleftBugCompat\fP¥ê¥½¡¼¥¹¤Ë¤è¤êÍ­¸ú¤Ê»þ) +ESC l (HP ¥¿¡¼¥ß¥Ê¥ëËè¤Ë)¥á¥â¥ê¥í¥Ã¥¯¡£ + ¥«¡¼¥½¥ë¤è¤ê¾å¤Î¥á¥â¥ê¤ò¥í¥Ã¥¯¤¹¤ë¡£ +ESC m (HP ¥¿¡¼¥ß¥Ê¥ëËè¤Ë)¥á¥â¥ê¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë¡£ +ESC n LS2 G2 ʸ»ú½¸¹ç¤Î¸Æ¤Ó½Ð¤·¡£ +ESC o LS3 G3 ʸ»ú½¸¹ç¤Î¸Æ¤Ó½Ð¤·¡£ +ESC | LS3R G3 ʸ»ú½¸¹ç¤ò GR ¤È¤·¤Æ¸Æ¤Ó½Ð¤¹¡£ +ESC } LS2R G2 ʸ»ú½¸¹ç¤ò GR ¤È¤·¤Æ¸Æ¤Ó½Ð¤¹¡£ +ESC ~ LS1R G1 ʸ»ú½¸¹ç¤ò GR ¤È¤·¤Æ¸Æ¤Ó½Ð¤¹¡£ +.TE +.PP +.\"O It also recognizes ESC % and provides a more complete UTF-8 +.\"O implementation than Linux console. +¤Þ¤¿ ESC % ¤òǧ¼±¤·¡¢Linux ¥³¥ó¥½¡¼¥ë¤è¤ê¹¹¤Ë´°Á´¤Ê UTF-8 ¼ÂÁõ¤òÄ󶡤¹¤ë¡£ +.\" +.PP +.B "CSI ¥·¡¼¥±¥ó¥¹" +.sp +.\"O Old versions of \fBxterm\fP(1), for example, from X11R5, +.\"O interpret the blink SGR as a bold SGR. +X11R5 ͳÍè¤Î¤è¤¦¤Ê¡¢¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î \fBxterm\fP(1) ¤Ï¥Ö¥ê¥ó¥¯ SGR ¤ò +¥Ü¡¼¥ë¥É SGR ¤È¤·¤Æ²ò¼á¤¹¤ë¡£ +.\"O Later versions which implemented ANSI colors, for example, +.\"O XFree86 3.1.2A in 1995, improved this by allowing +.\"O the blink attribute to be displayed as a color. +1995 ǯ¤Î XFree86 3.1.2A ¤Î¤è¤¦¤Ê¡¢ANSI ¥«¥é¡¼¤¬¼ÂÁõ¤µ¤ì¤¿¡¢¤è¤ê¿·¤·¤¤ +¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢¥Ö¥ê¥ó¥¯Â°À­¤ò¿§¤È¤·¤Æɽ¼¨¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤³¤ì¤ò +²þÁ±¤·¤Æ¤¤¤ë¡£ +.\"O Modern versions of xterm implement blink SGR as blinking text +.\"O and still allow colored text as an alternate rendering of SGRs. +.\"O Stock X11R6 versions did not recognize the color-setting SGRs until +.\"O the X11R6.8 release, which incorporated XFree86 xterm. +ºÇ¶á¤Î¥Ð¡¼¥¸¥ç¥ó¤Î xterm ¤Ï¥Ö¥ê¥ó¥¯ SGR ¤ò¥Æ¥­¥¹¥È¤ò¥Ö¥ê¥ó¥¯¤µ¤»¤ë¤³¤È¤Ç +¼ÂÁõ¤·¡¢¤µ¤é¤Ë¤Þ¤¿¡¢SGR ɽ¼¨¤ÎÂåÂذƤȤ·¤Æ¿§ÉÕ¤­¤Î¥Æ¥­¥¹¥È¤âÍøÍѤǤ­¤ë¡£ +Stock X11R6 ÈǤǤϡ¢XFree86 xterm ¤¬ÁȤßÆþ¤ì¤é¤ì¤¿ X11R6.8 ¥ê¥ê¡¼¥¹¤Þ¤Ç +¿§ÀßÄê SGR ¤òǧ¼±¤·¤Ê¤«¤Ã¤¿¡£ +.\"O All ECMA-48 CSI sequences recognized by Linux are also recognized by +.\"O .IR xterm , +.\"O however \fBxterm\fP(1) implements several ECMA-48 and DEC control sequences +.\"O not recognized by Linux. +Linux ¤¬Ç§¼±¤¹¤ë¾¤Î¤¹¤Ù¤Æ¤Î ECMA-48 CSI ¥·¡¼¥±¥ó¥¹¤Ï +.I xterm +¤Ç¤âǧ¼±¤µ¤ì¤ë¤¬¡¢\fBxterm\fP(1) ¤Ï Linux ¤¬Ç§¼±¤·¤Ê¤¤ +¤¤¤¯¤Ä¤«¤Î ECMA-48 ¤È DEC ¤Î¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤â¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +.PP +.\"O The \fBxterm\fP(1) +.\"O program recognizes all of the DEC Private Mode sequences listed +.\"O above, but none of the Linux private-mode sequences. +\fBxterm\fP(1) ¤Ï¾å½Ò¤Î¤¹¤Ù¤Æ¤Î DEC ¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É¤Î¥·¡¼¥±¥ó¥¹¤òǧ¼±¤¹¤ë¤¬¡¢ +Linux ¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É¤Î¥·¡¼¥±¥ó¥¹¤Ï¤É¤ì¤âǧ¼±¤·¤Ê¤¤¡£ +.\"O For discussion of \fBxterm\fP(1)'s +.\"O own private-mode sequences, refer to the +.\"O \fIXterm Control Sequences\fP +.\"O document by +.\"O Edward Moy, +.\"O Stephen Gildea, +.\"O and Thomas E. Dickey +.\"O available with the X distribution. +\fBxterm\fP(1) ¼«¿È¤Î¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É¥·¡¼¥±¥ó¥¹¤Ë´Ø¤·¤Æ¤ÎµÄÏÀ¤Ï¡¢ +X ÇÛÉۤȤȤâ¤ËÆþ¼ê²Äǽ¤Ê Edward Moy, Stephen Gildea,Thomas E. Dickey ¤Ë¤è¤ë +\fIXterm Control Sequences\fP +¥É¥­¥å¥á¥ó¥È¤ò»²¾È¤µ¤ì¤¿¤¤¡£ +.\"O That document, though terse, is much longer than this manual page. +.\"O For a chronological overview, +¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ï¡¢´Ê·é¤Ê¤â¤Î¤Ç¤¢¤ë¤¬¡¢¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤è¤ê +ÍÚ¤«¤ËŤ¤¤â¤Î¤Ç¤¢¤ë¡£ +ǯÂå½ç¤Î³µ´Ñ¤È¤·¤Æ¤Ï¡¢ +.PP +.in +4n +http://invisible-island.net/xterm/xterm.log.html +.in +.PP +.\"O details changes to xterm. +¤Ë¤Ï xterm ¤ÎÊѹ¹¤Î¾ÜºÙ¤¬¤¢¤ë¡£ +.PP +.\"O The \fIvttest\fP program +\fIvttest\fP ¤Ï +.PP +.in +4n +http://invisible-island.net/vttest/ +.in +.PP +.\"O demonstrates many of these control sequences. +¤ÇÆþ¼ê¤Ç¤­¡¢¤³¤ì¤é¤Î¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤Î¿¤¯¤Ë´Ø¤¹¤ë¥Ç¥â¤ò¹Ô¤¦¡£ +.\"O The \fBxterm\fP(1) source distribution also contains sample +.\"O scripts which exercise other features. +\fBxterm\fP(1) ¥½¡¼¥¹ÇÛÉۥѥ屡¼¥¸¤Ë¤Ï +¤½¤Î¾¤Îµ¡Ç½¤ò³Ø¤Ö¤³¤È¤¬½ÐÍè¤ë¥µ¥ó¥×¥ë¥¹¥¯¥ê¥×¥È¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O ESC 8 (DECRC) is not able to restore the character set changed with +.\"O ESC %. +ESC 8 (DECRC) ¤Ï ESC % ¤ÇÊѹ¹¤µ¤ì¤¿Ê¸»ú½¸¹ç¤òÉü¸µ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.SH ¥Ð¥° +.\"O In 2.0.23, CSI is broken, and NUL is not ignored inside +.\"O escape sequences. +2.0.23 ¤Ç¤Ï CSI ¤¬²õ¤ì¤Æ¤¤¤Æ¡¢¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹Ãæ¤Î NUL ¤¬ +̵»ë¤µ¤ì¤Ê¤¤¡£ +.PP +.\"O Some older kernel versions (after 2.0) interpret 8-bit control +.\"O sequences. +.\"O These "C1 controls" use codes between 128 and 159 to replace +.\"O ESC [, ESC ] and similar two-byte control sequence initiators. +.\"O There are fragments of that in modern kernels (either overlooked or +.\"O broken by changes to support UTF-8), +.\"O but the implementation is incomplete and should be regarded +.\"O as unreliable. +¸Å¤¤¥Ð¡¼¥¸¥ç¥ó(2.0 °Ê¹ß)¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¡¢8 ¥Ó¥Ã¥ÈÀ©¸æ¥·¡¼¥±¥ó¥¹¤ò²ò¼á¤¹¤ë¡£ +¤³¤ì¤é¤Î "C1 ¥³¥ó¥È¥í¡¼¥ë" ¤Ï ESC [, ESC ] ¤ª¤è¤ÓƱÍͤÊÀ©¸æ¥·¡¼¥±¥ó¥¹ +µ¯Æ°»Ò¤òÃÖ¤­´¹¤¨¤ë¤¿¤á¤Ë 128 ¤«¤é 159 ¤Î¥³¡¼¥É¤ò»È¤¦¡£ +¿·¤·¤¤¥«¡¼¥Í¥ë¤Ç¤Ï (UTF-8 Âбþ¤ÎÊѹ¹»þ¤Ë¸«Íî¤È¤µ¤ì¤¿¤«²õ¤ì¤¿¤¿¤á¤Ë) +À£ÃǤ·¤Æ¤¤¤ë¤¬¡¢¼ÂÁõ¤ÏÉÔ´°Á´¤Ç¿®Íê¤Ç¤­¤Ê¤¤¤â¤Î¤Èɾ²Á¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O Linux "private mode" sequences do not follow the rules in ECMA-48 +.\"O for private mode control sequences. +.\"O In particular, those ending with ] do not use a standard terminating +.\"O character. +Linux "¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É" ¥·¡¼¥±¥ó¥¹¤Ï ECMA-48 ¤Î¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É +¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤Î¥ë¡¼¥ë¤Ë½¾¤Ã¤Æ¤¤¤Ê¤¤¡£ +Æäˡ¢ ] ¤Ç½ª¤ï¤ë¤â¤Î¤Ïɸ½à½ªÃ¼Ê¸»ú¤ò»È¤¨¤Ê¤¤¡£ +.\"O The OSC (set palette) sequence is a greater problem, +.\"O since \fBxterm\fP(1) may interpret this as a control sequence +.\"O which requires a string terminator (ST). +OSC(¥Ñ¥ì¥Ã¥ÈÀßÄê)¥·¡¼¥±¥ó¥¹¤ÏÂ礭¤ÊÌäÂ꤬¤¢¤ë¡£ +\fBxterm\fP(1) ¤Ï¤³¤ì¤òʸ»úÎó½ªÃ¼Ê¸»ú (ST) ¤¬É¬Íפʥ³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤È +²ò¼á¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.\"O Unlike the \fBsetterm\fP(1) sequences which will be ignored (since +.\"O they are invalid control sequences), the palette sequence will make +.\"O \fBxterm\fP(1) appear to hang (though pressing the return-key +.\"O will fix that). +(ÉÔÀµ¤Ê¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤Ê¤Î¤Ç)̵»ë¤µ¤ì¤ë \fBsetterm\fP(1) ¥·¡¼¥±¥ó¥¹¤È +°ã¤¤¡¢¥Ñ¥ì¥Ã¥È¥·¡¼¥±¥ó¥¹¤Ï \fBxterm\fP(1) ¤ò¥Ï¥ó¥°¤µ¤»¤ë¤«¤â¤·¤ì¤Ê¤¤ +(¤·¤«¤·¥ê¥¿¡¼¥ó¥­¡¼¤ò²¡¤¹¤³¤È¤Ç²óÉü¤Ç¤­¤ë)¡£ +.\"O To accommodate applications which have been hardcoded to use Linux +.\"O control sequences, +.\"O set the \fBxterm\fP(1) resource \fBbrokenLinuxOSC\fP to true. +Linux ¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤ò¥Ï¡¼¥É¥³¡¼¥É¤·¤Æ¤¤¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë +Ŭ±þ¤µ¤»¤ë¤Ë¤Ï¡¢\fBxterm\fP(1) ¥ê¥½¡¼¥¹¤Î \fBbrokenLinuxOSC\fP ¤ò +¿¿ (true) ¤ËÀßÄꤹ¤ë¡£ +.PP +.\"O An older version of this document implied that Linux recognizes the +.\"O ECMA-48 control sequence for invisible text. +.\"O It is ignored. +¤³¤Î¥É¥­¥å¥á¥ó¥È¤Î¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢Linux ¤¬ ECMA-48 ¤ÎÉԲĻë¥Æ¥­¥¹¥È¤Î +¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤òǧ¼±¤¹¤ë¤«¤Î¤è¤¦¤Ë½ñ¤«¤ì¤Æ¤¤¤¿¡£ +¤³¤ì¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR console (4), +.BR console_ioctl (4), +.BR charsets (7) diff --git a/draft/man4/console_ioctl.4 b/draft/man4/console_ioctl.4 new file mode 100644 index 00000000..27957c6e --- /dev/null +++ b/draft/man4/console_ioctl.4 @@ -0,0 +1,941 @@ +.\" Copyright (c) 1995 Jim Van Zandt and aeb +.\" Sun Feb 26 11:46:23 MET 1995 +.\" +.\" 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, Sun Feb 26 15:04:20 1995, faith@cs.unc.edu +.\" Modified, Thu Apr 20 22:08:17 1995, jrv@vanzandt.mv.com +.\" Modified, Mon Sep 18 22:32:47 1995, hpa@storm.net (H. Peter Anvin) +.\" FIXME The following are not documented: +.\" KDFONTOP (since 2.1.111) +.\" KDGKBDIACRUC (since 2.6.24) +.\" KDSKBDIACR +.\" KDSKBDIACRUC (since 2.6.24) +.\" KDKBDREP (since 2.1.113) +.\" KDMAPDISP (not implemented as at 2.6.27) +.\" KDUNMAPDISP (not implemented as at 2.6.27) +.\" VT_LOCKSWITCH (since 1.3.47, needs CAP_SYS_TTY_CONFIG) +.\" VT_UNLOCKSWITCH (since 1.3.47, needs CAP_SYS_TTY_CONFIG) +.\" VT_GETHIFONTMASK (since 2.6.18) +.\" +.\" Japanese Version Copyright (c) 1996,1997 TAKAHASHI Mutsuji +.\" 1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Sun Jan 11 03:24:14 JST 1998 +.\" by TAKAHASHI Mutsuji +.\" and ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Thu Feb 5 17:35:37 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated & Modefied Sat Feb 27 1999 by Shouichi Saito +.\" Updated Tue Jan 28 JST 2003 by Kentaro Shirakata +.\" +.TH CONSOLE_IOCTL 4 2009-02-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O console_ioctl \- ioctl's for console terminal and virtual consoles +console_ioctl \- ¥³¥ó¥½¡¼¥ëüËö¤È²¾ÁÛ¥³¥ó¥½¡¼¥ë¤Î ioctl +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The following Linux-specific +.\"O .BR ioctl (2) +.\"O requests are supported. +.\"O Each requires a third argument, assumed here to be \fIargp\fP. +¼¡¤Î¤è¤¦¤Ê Linux ¸ÇÍ­¤Î +.BR ioctl (2) +¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤½¤ì¤¾¤ì3ÈÖÌܤΰú¿ô¤¬É¬ÍפǤ¢¤ë¡¢¤³¤³¤Ç¤Ï \fIargp\fP ¤È¤¹¤ë¡£ +.IP \fBKDGETLED\fP +.\"O Get state of LEDs. +.\"O \fIargp\fP points to a \fIchar\fP. +.\"O The lower three bits +.\"O of \fI*argp\fP are set to the state of the LEDs, as follows: +LED ¤Î¾õÂÖ¤ò¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤Ï \fIchar\fP ¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +\fI*argp\fP ¤Î²¼°Ì 3 ¥Ó¥Ã¥È¤Ë°Ê²¼¤Î¤è¤¦¤Ë LED ¤Î¾õÂÖ¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ + +.\"O LED_CAP 0x04 caps lock led +.\"O LEC_NUM 0x02 num lock led +.\"O LED_SCR 0x01 scroll lock led + LED_CAP 0x04 ¥­¥ã¥Ô¥¿¥ë¥í¥Ã¥¯¤¬ÅÀÅô + LEC_NUM 0x02 ¥Ê¥ó¥Ð¡¼¥í¥Ã¥¯¤¬ÅÀÅô + LED_SCR 0x01 ¥¹¥¯¥í¡¼¥ë¥í¥Ã¥¯¤¬ÅÀÅô +.IP \fBKDSETLED\fP +.\"O Set the LEDs. +.\"O The LEDs are set to correspond to the lower three bits of +.\"O \fIargp\fP. +.\"O However, if a higher order bit is set, +.\"O the LEDs revert to normal: displaying the state of the +.\"O keyboard functions of caps lock, num lock, and scroll lock. +LED¤òÅÀÅô¤µ¤»¤ë¡£LED¤Ï \fIargp\fP ¤Î²¼°Ì 3 ¥Ó¥Ã¥È¤Ë½¾¤¤ÅÀÅô¤µ¤ì¤ë¡£ +¤·¤«¤·¡¢¤è¤ê¹â°Ì¤Î¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë»þ¤Ë¤Ï¡¢¥­¥ã¥Ô¥¿¥ë¥í¥Ã¥¯¡¢ +¥Ê¥ó¥Ð¡¼¥í¥Ã¥¯¡¢¥¹¥¯¥í¡¼¥ë¥í¥Ã¥¯¤Î¥­¡¼¥Ü¡¼¥Éµ¡Ç½¤Î¾õÂÖ¤òɽ¼¨¤¹¤ë LED ¤Ï +Ä̾ï¾õÂÖ¤ËÌá¤ë¡£ +.LP +.\"O Before 1.1.54, the LEDs just reflected the state of the corresponding +.\"O keyboard flags, and KDGETLED/KDSETLED would also change the keyboard +.\"O flags. +.\"O Since 1.1.54 the leds can be made to display arbitrary +.\"O information, but by default they display the keyboard flags. +.\"O The following two ioctl's are used to access the keyboard flags. +¥«¡¼¥Í¥ë 1.1.54 °ÊÁ°¤Ï¡¢LED ¤Ï¤½¤ì¤¾¤ì¤Î¥­¡¼¥Ü¡¼¥É¥Õ¥é¥°¤Î¾õÂÖ¤òÈ¿±Ç¤¹¤ë +¤À¤±¤Ç¡¢KDGETLED/KDSETLED ¤â¥­¡¼¥Ü¡¼¥É¥Õ¥é¥°¤òÊѹ¹¤¹¤ë¤À¤±¤Ç¤¢¤Ã¤¿¡£ +¥«¡¼¥Í¥ël 1.1.54 ¤«¤é¤Ï LED ¤ËǤ°Õ¤Îɽ¼¨¤ò¤¹¤ë»ö¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤¬¡¢ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥­¡¼¥Ü¡¼¥É¥Õ¥é¥°¤òɽ¼¨¤¹¤ë¡£ +¼¡¤Ë¼¨¤¹ 2 ¤Ä¤Î ioctl ¤Ï¥­¡¼¥Ü¡¼¥É¥Õ¥é¥°¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +.IP \fBKDGKBLED\fP +.\"O Get keyboard flags CapsLock, NumLock, ScrollLock (not lights). +.\"O \fIargp\fP points to a char which is set to the flag state. +.\"O The low order three bits (mask 0x7) get the current flag state, +.\"O and the low order bits of the next nibble (mask 0x70) get +.\"O the default flag state. +.\"O (Since 1.1.54.) +¥­¥ã¥Ô¥¿¥ë¥í¥Ã¥¯¡¢¥Ê¥ó¥Ð¡¼¥í¥Ã¥¯¡¢¥¹¥¯¥í¡¼¥ë¥í¥Ã¥¯¤Î(LED ¤Îɽ¼¨¤Ç¤Ï +¤Ê¤¯)¥­¡¼¥Ü¡¼¥É¥Õ¥é¥°¤òÆÀ¤ë¡£ +\fIargp\fP ¤Ï¥Õ¥é¥°¤Î¾õÂÖ¤¬¥»¥Ã¥È¤µ¤ì¤ëʸ»úÊÑ¿ô¤ò»Ø¤¹¡£ +(0x7)¤Ç¥Þ¥¹¥¯¤·¤ÆÆÀ¤é¤ì¤ë²¼°Ì 3 ¥Ó¥Ã¥È¤¬¸½ºß¤Î¥Õ¥é¥°¤Î¾õÂÖ¤ò¼¨¤·¡¢ +(0x70)¤Ç¥Þ¥¹¥¯¤·¤ÆÆÀ¤é¤ì¤ë¼¡¤Î 3 ¥Ó¥Ã¥È¤¬¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥é¥°¤Î¾õÂÖ¤ò +¼¨¤¹¡£(¥«¡¼¥Í¥ë 1.1.54°Ê¹ß) +.IP \fBKDSKBLED\fP +.\"O Set keyboard flags CapsLock, NumLock, ScrollLock (not lights). +.\"O \fIargp\fP has the desired flag state. +.\"O The low order three bits (mask 0x7) have the flag state, +.\"O and the low order bits of the next nibble (mask 0x70) have +.\"O the default flag state. +.\"O (Since 1.1.54.) +¥­¥ã¥Ô¥¿¥ë¥í¥Ã¥¯¡¢¥Ê¥ó¥Ð¡¼¥í¥Ã¥¯¡¢¥¹¥¯¥í¡¼¥ë¥í¥Ã¥¯¤Î(LED ¤Îɽ¼¨¤Ç¤Ï¤Ê¤¯) +¥­¡¼¥Ü¡¼¥É¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +\fIargp\fP ¤¬¥»¥Ã¥È¤·¤¿¤¤¥Õ¥é¥°¤Ç¤¢¤ë¡£ +(0x7)¤Ç¥Þ¥¹¥¯¤·¤ÆÆÀ¤é¤ì¤ë²¼°Ì 3 ¥Ó¥Ã¥È¤¬¥Õ¥é¥°¤Î¾õÂ֤ǡ¢(0x70)¤Ç¥Þ¥¹¥¯¤·¤Æ +ÆÀ¤é¤ì¤ë¼¡¤Î 3 ¥Ó¥Ã¥È¤¬¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥é¥°¤Î¾õÂ֤Ǥ¢¤ë¡£(¥«¡¼¥Í¥ë +1.1.54°Ê¹ß) +.IP \fBKDGKBTYPE\fP +.\"O Get keyboard type. +.\"O This returns the value KB_101, defined as 0x02. +¥­¡¼¥Ü¡¼¥É¤Î¼ïÎà¤òÆÀ¤ë¡£¤³¤ì¤ÏÃÍ 0x02 ¤ÈÄêµÁ¤µ¤ì¤Æ¤¤¤ë KB_101¤òÊÖ¤¹¡£ +.IP \fBKDADDIO\fP +.\"O Add I/O port as valid. +.\"O Equivalent to \fPioperm(arg,1,1)\fP. +I/O¥Ý¡¼¥È¤òÍ­¸ú¤Êʪ¤È¤·¤Æ²Ã¤¨¤ë¡£¤³¤ì¤Ï \fIioperm(arg,1,1)\fP ¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.IP \fBKDDELIO\fP +.\"O Delete I/O port as valid. +.\"O Equivalent to \fIioperm(arg,1,0)\fP. +I/O¥Ý¡¼¥È¤òÍ­¸ú¤Êʪ¤«¤é³°¤¹¡£¤³¤ì¤Ï \fIioperm(arg,1,0)\fP ¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.IP \fBKDENABIO\fP +.\"O Enable I/O to video board. +.\"O Equivalent to \fIioperm(0x3b4, 0x3df-0x3b4+1, 1)\fP. +¥Ó¥Ç¥ª¥Ü¡¼¥É¤Ø¤Î I/O ¤ò²Äǽ¤Ë¤¹¤ë¡£ +¤³¤ì¤Ï \fIioperm(0x3b4, 0x3df-0x3b4+1, 1)\fP ¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.IP \fBKDDISABIO\fP +.\"O Disable I/O to video board. +.\"O Equivalent to \fIioperm(0x3b4, 0x3df-0x3b4+1, 0)\fP. +¥Ó¥Ç¥ª¥Ü¡¼¥É¤Ø¤Î I/O ¤òÉÔ²Äǽ¤Ë¤¹¤ë¡£ +¤³¤ì¤Ï \fIioperm(0x3b4, 0x3df-0x3b4+1, 0)\fP ¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.IP \fBKDSETMODE\fP +.\"O Set text/graphics mode. +.\"O \fIargp\fP is one of these: +¥Æ¥­¥¹¥È/¥°¥é¥Õ¥£¥¯¥¹¥â¡¼¥É¤òÀßÄꤹ¤ë¡£ +\fIargp\fP ¤Ï¼¡¤Î¤¦¤Á¤Î¤É¤ì¤«¡§ + + KD_TEXT 0x00 + KD_GRAPHICS 0x01 +.IP \fBKDGETMODE\fP +.\"O Get text/graphics mode. +.\"O \fIargp\fP points to a \fIlong\fP which is set to one +.\"O of the above values. +¥Æ¥­¥¹¥È/¥°¥é¥Õ¥£¥¯¥¹¥â¡¼¥É¤ò¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤¬»Ø¤¹ \fIlong\fP ·¿ÊÑ¿ô¤Ë +¾å½Ò¤ÎÃͤΤɤÁ¤é¤«¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.IP \fBKDMKTONE\fP +.\"O Generate tone of specified length. +.\"O The lower 16 bits of \fIargp\fP specify the period in clock cycles, +.\"O and the upper 16 bits give the duration in msec. +.\"O If the duration is zero, the sound is turned off. +.\"O Control returns immediately. +.\"O For example, \fIargp\fP = (125<<16) + 0x637 would specify +.\"O the beep normally associated with a ctrl-G. +.\"O (Thus since 0.99pl1; broken in 2.1.49-50.) +»ØÄꤵ¤ì¤¿Ä¹¤µ¤Î¥È¡¼¥ó¤òȯÀ¸¤¹¤ë¡£ +\fIargp\fP ¤Î²¼°Ì 16 ¥Ó¥Ã¥È¤Ï¥¯¥í¥Ã¥¯¥µ¥¤¥¯¥ë¤òñ°Ì¤Ë¤·¤Æ¼þ´ü¤ò»ØÄꤷ¡¢ +¾å°Ì 16 ¥Ó¥Ã¥È¤¬ msec ¤Îñ°Ì¤Çɽ¤·¤¿¡¢(¥È¡¼¥ó¤òȯÀ¸¤µ¤»¤ë)»þ´Ö¤ò»ØÄꤹ¤ë¡£ +¥È¡¼¥ó¤òȯÀ¸¤µ¤»¤ë»þ´Ö¤¬¥¼¥í¤Î¤È¤­¤Ï¡¢¥µ¥¦¥ó¥É¤Ï¥ª¥Õ¤Ë¤Ê¤ë¡£ +À©¸æ¤Ïľ¤Á¤ËÌá¤ë¡£ +Î㤨¤Ð¡¢\fIargp\fP = (125<<16) + 0x637 ¤È¤¹¤ì¤Ð¡¢Ä̾ï ctrl-G ¤ò²¡¤·¤¿»þ¤Ë +ȯÀ¸¤¹¤ë²»¤Ë¤Ê¤ë¡£ +(¥«¡¼¥Í¥ë 0.99pl1 °Ê¹ß;¤³¤Îµ¡Ç½¤Ï ¥«¡¼¥Í¥ë 2.1.49 ¤«¤é +2.1.50 ¤Ç¤Ï¥Ð¥°¤Î¤¿¤áÆ°ºî¤·¤Ê¤¤) +.IP \fBKIOCSOUND\fP +.\"O Start or stop sound generation. +.\"O The lower 16 bits of +.\"O \fIargp\fP specify the period in clock cycles +.\"O (that is, \fIargp\fP = 1193180/frequency). +.\"O \fIargp\fP = 0 turns sound off. +.\"O In either case, control returns immediately. +²»¤ÎȯÀ¸¤Î³«»Ï¤äÄä»ß¤ò¹Ô¤¦¡£ +\fIargp\fP ¤Î²¼°Ì 16 ¥Ó¥Ã¥È¤Ï¥¯¥í¥Ã¥¯¥µ¥¤¥¯¥ë¤òñ°Ì¤È¤·¤Æ¼þ´ü¤ò¼¨¤¹¡£ +(¤Ä¤Þ¤ê \fIargp\fP = 1193180/¼þÇÈ¿ô)¡£ +\fIargp\fP = 0 ¤Î¾ì¹ç¡¢¥µ¥¦¥ó¥É¤Ï¥ª¥Õ¤Ë¤Ê¤ë¡£ +¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢¤¿¤À¤Á¤ËÀ©¸æ¤ÏÌá¤ë¡£ +.IP \fBGIO_CMAP\fP +.\"O Get the current default color map from kernel. +.\"O \fIargp\fP points to +.\"O a 48-byte array. +.\"O (Since 1.3.3.) +¸½ºß¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥«¥é¡¼¥Þ¥Ã¥×¤ò¥«¡¼¥Í¥ë¤è¤ê¼èÆÀ¤¹¤ë¡£ +.\"O \fIargp\fP ¤Ï 48 ¥Ð¥¤¥È¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¡£(¥«¡¼¥Í¥ë 1.3.3 °Ê¹ß) +.IP \fBPIO_CMAP\fP +.\"O Change the default text-mode color map. +.\"O \fIargp\fP points to a +.\"O 48-byte array which contains, in order, the Red, Green, and Blue +.\"O values for the 16 available screen colors: 0 is off, and 255 is full +.\"O intensity. +.\"O The default colors are, in order: black, dark red, dark +.\"O green, brown, dark blue, dark purple, dark cyan, light grey, dark +.\"O grey, bright red, bright green, yellow, bright blue, bright purple, +.\"O bright cyan and white. +.\"O (Since 1.3.3.) +¥Ç¥Õ¥©¥ë¥È¤Î¥Æ¥­¥¹¥È¥â¡¼¥É¤Î¥«¥é¡¼¥Þ¥Ã¥×¤òÊѹ¹¤¹¤ë¡£ +\fIargp\fP ¤¬»Ø¤¹ 48 ¥Ð¥¤¥È¤ÎÇÛÎóÃæ¤Ë¤Ï¡¢16 ¤Î²Äǽ¤Ê¥¹¥¯¥ê¡¼¥ó¤Î¿§¤ò¡¢ +ÀÖ¡¢ÎС¢ÀĤνç¤Ë 0 ¤ò¥ª¥Õ¡¢255¤òºÇÂ綯Å٤Ȥ·¤¿ÃͤȤ·¤ÆǼ¤á¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î¿§¤Ï½ç¤Ë¡¢¹õ¡¢Ç»¤¤ÀÖ¡¢Ç»¤¤ÎС¢Ã㡢ǻ¤¤ÀÄ¡¢Ç»¤¤»ç¡¢Ç»¤¤¥·¥¢¥ó¡¢ +ÌÀ¤ë¤¤³¥¿§¡¢Ç»¤¤³¥¿§¡¢ÌÀ¤ë¤¤ÀÖ¡¢ÌÀ¤ë¤¤ÎС¢²«¡¢ÌÀ¤ë¤¤ÀÄ¡¢ÌÀ¤ë¤¤»ç¡¢ +ÌÀ¤ë¤¤¥·¥¢¥ó¡¢Çò¤Ç¤¢¤ë¡£(¥«¡¼¥Í¥ë 1.3.3°Ê¹ß) +.IP \fBGIO_FONT\fP +.\"O Gets 256-character screen font in expanded form. +.\"O \fIargp\fP points to an 8192 byte array. +.\"O Fails with error code \fBEINVAL\fP if the +.\"O currently loaded font is a 512-character font, or if the console is +.\"O not in text mode. +³ÈÄ¥¤µ¤ì¤¿·Á¼°¤Ç 256 ʸ»ú¤Î¥¹¥¯¥ê¡¼¥ó¥Õ¥©¥ó¥È¤òÆÀ¤ë¡£ +\fIargp\fP ¤Ï 8192 ¥Ð¥¤¥È¤ÎÇÛÎó¤ò»Ø¤¹¡£ +¸½ºß¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥Õ¥©¥ó¥È¤¬ 512 ʸ»ú¤Î¥Õ¥©¥ó¥È¤Ç¤¢¤ë¤«¡¢¥³¥ó¥½¡¼¥ë¤¬ +¥Æ¥­¥¹¥È¥â¡¼¥É¤Ç¤Ê¤¤»þ¤Ë¤Ï¼ºÇÔ¤· \fBEINVAL\fP ¤Î¥¨¥é¡¼¥³¡¼¥É¤òÊÖ¤¹¡£ +.IP \fBGIO_FONTX\fP +.\"O Gets screen font and associated information. +.\"O \fIargp\fP points to a +.\"O struct consolefontdesc (see \fBPIO_FONTX\fP). +.\"O On call, the +.\"O \fIcharcount\fP field should be set to the maximum number of +.\"O characters that would fit in the buffer pointed to by \fIchardata\fP. +.\"O On return, the \fIcharcount\fP and \fIcharheight\fP are filled with +.\"O the respective data for the currently loaded font, and the +.\"O \fIchardata\fP array contains the font data if the initial value of +.\"O \fIcharcount\fP indicated enough space was available; otherwise the +.\"O buffer is untouched and \fIerrno\fP is set to \fBENOMEM\fP. +.\"O (Since 1.3.1.) +¥¹¥¯¥ê¡¼¥ó¥Õ¥©¥ó¥È¤È¤½¤ì¤Ë´ØÏ¢¤·¤¿¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤Ï¹½Â¤ÂÎ consolefontdesc (\fBPIO_FONTX\fP ¤ò»²¾È¤Î¤³¤È)¤ò»Ø¤¹¡£ +´Ø¿ô¸Æ¤Ó½Ð¤·¤Î¤È¤­¤Ë¤Ï¡¢\fIcharcount\fP ¤Ë¤Ï¡¢\fIchardata\fP ¤¬»Ø¤¹ +¥Ð¥Ã¥Õ¥¡¤Ë¤ª¤µ¤Þ¤ëºÇÂç¤Îʸ»ú¿ô¤ò¥»¥Ã¥È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +´Ø¿ô¸Æ¤Ó½Ð¤·¤«¤éÌá¤Ã¤¿»þ¤Ë¤Ï \fIcharcount\fP ¤È \fIcharheight\fP ¤Ë¤Ï¡¢ +¸½ºß¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥Õ¥©¥ó¥È¤Î³ºÅö¤¹¤ë¥Ç¡¼¥¿¤¬¼ý¤á¤é¤ì¤Æ¤¤¤ë¡£ +ÇÛÎó \fIchardata\fP ¤Ë¤Ï¡¢ºÇ½é¤Ë \fIcharcount\fP ¤Ë¤¤¤ì¤¿Ãͤˤè¤Ã¤Æ +¥Õ¥©¥ó¥È¤ò¼ý¤á¤ë¤Î¤Ë½½Ê¬¤Ê¥¹¥Ú¡¼¥¹¤¬¤¢¤ë¤È¤ï¤«¤ì¤Ð¥Õ¥©¥ó¥È¥Ç¡¼¥¿¤¬¼ý¤á¤é¤ì¤ë¡£ +¤½¤¦¤Ç¤Ê¤¤»þ¤Ë¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤ÏÊѹ¹¤µ¤ì¤º¡¢ \fIerrno\fP ¤Ë \fBENOMEM\fP ¤¬ +¥»¥Ã¥È¤µ¤ì¤ë(¥«¡¼¥Í¥ë 1.3.1 °Ê¹ß)¡£ +.IP \fBPIO_FONT\fP +.\"O Sets 256-character screen font. +.\"O Load font into the EGA/VGA character +.\"O generator. +.\"O \fIargp\fP points to a 8192 byte map, with 32 bytes per +.\"O character. +.\"O Only first \fIN\fP of them are used for an 8x\fIN\fP font +.\"O (0 < \fIN\fP <= 32). +.\"O This call also invalidates the Unicode mapping. +256 ʸ»ú¤Î¥Õ¥©¥ó¥È¤ò¥»¥Ã¥È¤¹¤ë¡£EGA/VGA ¥­¥ã¥é¥¯¥¿¡¼¥¸¥§¥Í¥ì¡¼¥¿¡¼ +(character generator) ¤Ë¥Õ¥©¥ó¥È¤ò¥í¡¼¥É¤¹¤ë¡£ +\fIargp\fP ¤Ï¡¢8192 ¥Ð¥¤¥È(°ìʸ»ú 32 ¥Ð¥¤¥È)¤Î¥Þ¥Ã¥×¤ò»Ø¤¹¡£ +¥Þ¥Ã¥×¤Î¤¦¤Á¡¢ºÇ½é¤Î \fIN\fP ¤Î¤ß¤¬ 8x\fIN\fP ¤Î¥Õ¥©¥ó¥È¤Î¤¿¤á¤Ë +ÍѤ¤¤é¤ì¤ë(0 < \fIN\fP <= 32)¡£ +¤³¤Î¸Æ¤Ó½Ð¤·¤ò¤¹¤ë¤È Unicode ¤Î¥Þ¥Ã¥Ô¥ó¥°¤¬Ìµ¸ú¤Ë¤Ê¤ë¡£ +.IP \fBPIO_FONTX\fP +.\"O Sets screen font and associated rendering information. +.\"O \fIargp\fP +.\"O points to a +¥¹¥¯¥ê¡¼¥ó¥Õ¥©¥ó¥È¤È¡¢¤½¤ì¤Ë´ØÏ¢¤¹¤ë¥ì¥ó¥À¥ê¥ó¥°¾ðÊó¤ò¥»¥Ã¥È¤¹¤ë¡£ +\fIargp\fP ¤Ï¡¢°Ê²¼¤Î¹½Â¤ÂΤò»Ø¤¹¡£ + +.in +4n +.nf +struct consolefontdesc { +.\"O unsigned short charcount; /* characters in font +.\"O (256 or 512) */ +.\"O unsigned short charheight; /* scan lines per +.\"O character (1-32) */ +.\"O char *chardata; /* font data in +.\"O expanded form */ + unsigned short charcount; /* ¥Õ¥©¥ó¥È¤Îʸ»ú¿ô + (256 ¤Þ¤¿¤Ï 512) */ + unsigned short charheight; /* °ìʸ»ú¤ÎÁöººÀþ¤Î¿ô + (1-32) */ + char *chardata; /* Ÿ³«¤µ¤ì¤¿¥Õ¥©¥ó¥È¥Ç¡¼¥¿ */ +}; +.fi +.in + +.\"O If necessary, the screen will be appropriately resized, and +.\"O \fBSIGWINCH\fP sent to the appropriate processes. +.\"O This call also invalidates the Unicode mapping. +.\"O (Since 1.3.1.) +ɬÍפʤ饹¥¯¥ê¡¼¥ó¤ÏŬÅö¤Ë¥µ¥¤¥ºÊѹ¹¤µ¤ì¡¢\fBSIGWINCH\fP ¤¬Å¬ÀÚ¤Ê +¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤ë¡£ +¤³¤Î¥³¡¼¥ë¤Ë¤è¤ê Unicode ¤Î¥Þ¥Ã¥Ô¥ó¥°¤¬Ìµ¸ú¤Ë¤Ê¤ë¡£ +.IP \fBPIO_FONTRESET\fP +.\"O Resets the screen font, size and Unicode mapping to the bootup +.\"O defaults. +.\"O \fIargp\fP is unused, but should be set to NULL to +.\"O ensure compatibility with future versions of Linux. +.\"O (Since 1.3.28.) +¥¹¥¯¥ê¡¼¥ó¥Õ¥©¥ó¥È¡¢¥µ¥¤¥º¡¢ Unicode ¥Þ¥Ã¥Ô¥ó¥°¤ò¥Ö¡¼¥È»þ¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ë +¥ê¥»¥Ã¥È¤¹¤ë¡£\fIargp\fP ¤ÏÍѤ¤¤é¤ì¤Ê¤¤¤¬¡¢¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Î +Linux ¤È¤Î¸ß´¹À­¤òÊݤĤ¿¤á¤Ë NULL ¤Ë¥»¥Ã¥È¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.IP \fBGIO_SCRNMAP\fP +.\"O Get screen mapping from kernel. +.\"O \fIargp\fP points to an area of size +.\"O E_TABSZ, which is loaded with the font positions used to display each +.\"O character. +.\"O This call is likely to return useless information if the +.\"O currently loaded font is more than 256 characters. +¥¹¥¯¥ê¡¼¥ó¥Þ¥Ã¥Ô¥ó¥°¤ò¥«¡¼¥Í¥ë¤è¤ê¼èÆÀ¤¹¤ë¡£\fIargp\fP ¤Ï¥µ¥¤¥º E_TABSZ ¤Î +Îΰè¤ò»Ø¤¹¡£¤½¤ÎÎΰè¤Ë¤Ï³Æ¥­¥ã¥é¥¯¥¿¡¼¤òɽ¼¨¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¥Õ¥©¥ó¥È¤Î +°ÌÃÖ¤¬¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¸Æ¤Ó½Ð¤·¤Ï¸½ºß¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥Õ¥©¥ó¥È¤¬ 256 ʸ»ú¤è¤ê¤â¿¤¤»þ¤Ë¤Ï +̵°ÕÌ£¤Ê¾ðÊó¤òÊÖ¤¹»ö¤¬Â¿¤¤¡£ +.IP \fBGIO_UNISCRNMAP\fP +.\"O Get full Unicode screen mapping from kernel. +.\"O \fIargp\fP points to an +.\"O area of size E_TABSZ*sizeof(unsigned short), which is loaded with the +.\"O Unicodes each character represent. +.\"O A special set of Unicodes, +.\"O starting at U+F000, are used to represent "direct to font" mappings. +.\"O (Since 1.3.1.) +¥Õ¥ë Unicode ¥¹¥¯¥ê¡¼¥ó¥Þ¥Ã¥Ô¥ó¥°¤ò¥«¡¼¥Í¥ë¤è¤ê¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤Ï¥µ¥¤¥º E_TABSZ*sizeof(unsigned short) ¤ÎÎΰè¤ò»Ø¤¹¡£ +¤½¤ÎÎΰè¤Ë¤Ï³Æ¥­¥ã¥é¥¯¥¿¡¼¤ò¼¨¤¹ Unicode ¤¬¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¡£ +U+F000 ¤Ë»Ï¤Þ¤ë Unicode ¤ÎÆÃÊ̤ʽ¸¹ç¤Ï¡¢¡Ö¥Õ¥©¥ó¥ÈľÀܤÊ(direct to font)¡× +¥Þ¥Ã¥Ô¥ó¥°¤ò¼¨¤¹¤Î¤ËÍѤ¤¤é¤ì¤ë(¥«¡¼¥Í¥ë 1.3.1 °Ê¹ß)¡£ +.IP \fBPIO_SCRNMAP\fP +.\"O Loads the "user definable" (fourth) table in the kernel which maps +.\"O bytes into console screen symbols. +.\"O \fIargp\fP points to an area of +.\"O size E_TABSZ. +¡Ö¥æ¡¼¥¶¡¼ÄêµÁ²Äǽ¤Ê(user definable)¡×(4ÈÖÌܤÎ)¥Æ¡¼¥Ö¥ë¤ò¥«¡¼¥Í¥ë¤Ë +¥í¡¼¥É¤¹¤ë¡£¤½¤Î¥Æ¡¼¥Ö¥ë¤Ï³Æ¥Ð¥¤¥È¤ò¥¹¥¯¥ê¡¼¥ó¥·¥ó¥Ü¥ë¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¡£ +\fIargp\fP ¤Ï¥µ¥¤¥ºE_TABSZ¤ÎÎΰè¤ò»Ø¤¹¡£ +.IP \fBPIO_UNISCRNMAP\fP +.\"O Loads the "user definable" (fourth) table in the kernel which maps +.\"O bytes into Unicodes, which are then translated into screen symbols +.\"O according to the currently loaded Unicode-to-font map. +.\"O Special Unicodes starting at U+F000 can be used to map directly to the font +.\"O symbols. +.\"O (Since 1.3.1.) +¡Ö¥æ¡¼¥¶¡¼ÄêµÁ²Äǽ¤Ê¡×(4ÈÖÌܤÎ)¥Æ¡¼¥Ö¥ë¤ò¥«¡¼¥Í¥ë¤Ë¥í¡¼¥É¤¹¤ë¡£ +¤½¤Î¥Æ¡¼¥Ö¥ë¤Ï³Æ¥Ð¥¤¥È¤ò¥æ¥Ë¥³¡¼¥É¤Ë¥Þ¥Ã¥Ô¥ó¥°¤·¡¢¤½¤Î¸å¡¢ +¸½ºß¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥æ¥Ë¥³¡¼¥É¤«¤é¥Õ¥©¥ó¥È¤Ø¤Î¥Þ¥Ã¥×¤Ë½¾¤¤ +¥¹¥¯¥ê¡¼¥ó¥·¥ó¥Ü¥ë¤ËÊÑ´¹¤µ¤ì¤ë¡£ +U+F000 ¤Ë»Ï¤Þ¤ë¥æ¥Ë¥³¡¼¥É¤ÏľÀÜ¥Õ¥©¥ó¥È¥·¥ó¥Ü¥ë¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¤Î¤Ë +»È¤¨¤ë(¥«¡¼¥Í¥ë 1.3.1 °Ê¹ß) +.IP \fBGIO_UNIMAP\fP +.\"O Get Unicode-to-font mapping from kernel. +.\"O \fIargp\fP points to a +Unicode ¤«¤é¥Õ¥©¥ó¥È¤Ø¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¥«¡¼¥Í¥ë¤«¤é¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤Ï¡¢ + +.in +4n +.nf +struct unimapdesc { + unsigned short entry_ct; + struct unipair *entries; +}; +.fi +.in + +¤È¤¤¤¦¹½Â¤ÂΤò»Ø¤¹¡£ +.\"O where \fIentries\fP points to an array of +¤³¤³¤Ç \fIentries\fP ¤Ï¡¢ + +.in +4n +.nf +struct unipair { + unsigned short unicode; + unsigned short fontpos; +}; +.fi +.in + +¤È¤¤¤¦¹½Â¤ÂΤÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +.\"O (Since 1.1.92.) +(¥«¡¼¥Í¥ë 1.1.92 °Ê¹ß) +.IP \fBPIO_UNIMAP\fP +.\"O Put unicode-to-font mapping in kernel. +.\"O \fIargp\fP points to a +.\"O \fIstruct unimapdesc\fP. +.\"O (Since 1.1.92) +Unicode ¤«¤é¥Õ¥©¥ó¥È¤Ø¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¥«¡¼¥Í¥ë¤Ë¥»¥Ã¥È¤¹¤ë¡£\fIargp\fP +¤Ï¹½Â¤ÂÎ \fIstruct unimapdesc\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£(¥«¡¼¥Í¥ë 1.1.92 °Ê¹ß) +.IP \fBPIO_UNIMAPCLR\fP +.\"O Clear table, possibly advise hash algorithm. +.\"O \fIargp\fP points to a +¥Æ¡¼¥Ö¥ë¤ò¥¯¥ê¥¢¤·¡¢¤½¤Î»ö¤ò¥Ï¥·¥å¥¢¥ë¥´¥ê¥º¥à¤ËÅÁ¤¨¤ë¡£ +\fIargp\fP¤Ï + +.in +4n +.nf +struct unimapinit { + unsigned short advised_hashsize; /* 0 if no opinion */ + unsigned short advised_hashstep; /* 0 if no opinion */ + unsigned short advised_hashlevel; /* 0 if no opinion */ +}; +.fi +.in + +¤È¤¤¤¦¹½Â¤ÂΤò»Ø¤¹¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +.\"O (Since 1.1.92.) +(¥«¡¼¥Í¥ë 1.1.92 °Ê¹ß) +.IP \fBKDGKBMODE\fP +.\"O Gets current keyboard mode. +.\"O \fIargp\fP points to a \fIlong\fP which is set to one +.\"O of these: +¸½ºß¤Î¥­¡¼¥Ü¡¼¥É¥â¡¼¥É¤ò¼èÆÀ¤¹¤ë¡£\fIargp\fP ¤Î»Ø¤¹ \fIlong\fP ·¿ÊÑ¿ô¤¬¡¢ +¼¡¤Î¤¦¤Á¤Î¤É¤ì¤«¤ËÀßÄꤵ¤ì¤ë¡£ + + K_RAW 0x00 + K_XLATE 0x01 + K_MEDIUMRAW 0x02 + K_UNICODE 0x03 +.IP \fBKDSKBMODE\fP +.\"O Sets current keyboard mode. +.\"O \fIargp\fP is a \fIlong\fP equal to one of the above values. +¸½ºß¤Î¥­¡¼¥Ü¡¼¥É¥â¡¼¥É¤òÀßÄꤹ¤ë¡£ +\fIargp\fP ¤Ï¾åµ­¤ÎÃͤΤ¦¤Á¤Î¤É¤ì¤«¤ËÅù¤·¤¤ \fIlong\fP ¤Ë¤¹¤ë¡£ +.IP \fBKDGKBMETA\fP +.\"O Gets meta key handling mode. +.\"O \fIargp\fP points to a \fIlong\fP which is +.\"O set to one of these: +¥á¥¿¥­¡¼¥Ï¥ó¥É¥ê¥ó¥°¥â¡¼¥É(meta key handling mode)¤ò¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤¬»Ø¤¹ \fIlong\fP ·¿ÊÑ¿ô¤Ï¡¢¼¡¤Î¤¦¤Á¤Î¤É¤ì¤«¤ËÀßÄꤵ¤ì¤ë¡£ + + K_METABIT 0x03 set high order bit + K_ESCPREFIX 0x04 escape prefix +.IP \fBKDSKBMETA\fP +.\"O Sets meta key handling mode. +.\"O \fIargp\fP is a \fIlong\fP equal to one of the above values. +¥á¥¿¥­¡¼¥Ï¥ó¥É¥ê¥ó¥°¥â¡¼¥É¤òÀßÄꤹ¤ë¡£ +\fIargp\fP ¤Ï¾åµ­¤ÎÃͤΤɤ줫¤ËÅù¤·¤¤ \fIlong\fP ¤Ë¤¹¤ë¡£ +.IP \fBKDGKBENT\fP +.\"O Gets one entry in key translation table (keycode to action code). +.\"O \fIargp\fP points to a +¥­¡¼¥³¡¼¥É¤ò¥¢¥¯¥·¥ç¥ó¥³¡¼¥É¤ËÊÑ´¹¤¹¤ë¥­¡¼ÊÑ´¹É½¤Î¥¨¥ó¥È¥ê¡¼¤Î°ì¤Ä¤ò +¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤Ï¡¢ + +.in +4n +.nf +struct kbentry { + unsigned char kb_table; + unsigned char kb_index; + unsigned short kb_value; +}; +.fi +.in + +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +.\"O with the first two members filled in: +.\"O \fIkb_table\fP selects the key table (0 <= \fIkb_table\fP < MAX_NR_KEYMAPS), +.\"O and \fIkb_index\fP is the keycode (0 <= \fIkb_index\fP < NR_KEYS). +.\"O \fIkb_value\fP is set to the corresponding action code, +.\"O or K_HOLE if there is no such key, +.\"O or K_NOSUCHMAP if \fIkb_table\fP is invalid. +ºÇ½é¤Î2¤Ä¤ÎÍ×ÁÇ¡¢\fIkb_table\fP ¤Ë¤ÏÁªÂò¤¹¤ë¥­¡¼¥Æ¡¼¥Ö¥ë (0 <= +\fIkb_table\fP < MAX_NR_KEYMAPS)¡¢\fIkb_index\fP ¤Ë¤Ï¥­¡¼¥³¡¼¥É(0 <= +\fIkb_index\fP < NR_KEYS)¤òÀßÄꤹ¤ë¡£ +\fIkb_value\fP ¤ÏÂбþ¤¹¤ë¥¢¥¯¥·¥ç¥ó¥³¡¼¥É¡¢¤Þ¤¿¤Ï¡¢¤½¤Î¤è¤¦¤Ê¥­¡¼¤¬ +¤Ê¤¤¤È¤­¤Ë¤Ï K_HOLE¡¢\fIkb_table\fP ¤¬Ìµ¸ú¤Ê»þ¤Ë¤Ï K_NOSUCHMAP ¤ËÀßÄꤵ¤ì¤ë¡£ +.IP \fBKDSKBENT\fP +.\"O Sets one entry in translation table. +.\"O \fIargp\fP points to +.\"O a \fIstruct kbentry\fP. +ÊÑ´¹¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¡¼¤Î°ì¤Ä¤òÀßÄꤹ¤ë¡£\fIargp\fP ¤Ï +¹½Â¤ÂÎ \fIstruct kbentry\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +.IP \fBKDGKBSENT\fP +.\"O Gets one function key string. +.\"O \fIargp\fP points to a +¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Îʸ»úÎó¤ò¼èÆÀ¤¹¤ë¡£\fIargp\fP ¤Ï¡¢ + +.in +4n +.nf +struct kbsentry { + unsigned char kb_func; + unsigned char kb_string[512]; +}; +.fi +.in + +¤È¤¤¤¦¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ + +.\"O \fIkb_string\fP is set to the (null-terminated) string corresponding to +.\"O the \fIkb_func\fPth function key action code. +\fIkb_func\fP ÈÖÌܤΥե¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Î¥¢¥¯¥·¥ç¥ó¥³¡¼¥É¤ËÂбþ¤¹¤ë +(NULL ¤Ç½ªÃ¼¤µ¤ì¤¿)ʸ»úÎó¤¬ \fIkb_string\fP ¤ËÀßÄꤵ¤ì¤ë¡£ +.IP \fBKDSKBSENT\fP +.\"O Sets one function key string entry. +.\"O \fIargp\fP points to +.\"O a \fIstruct kbsentry\fP. +¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Îʸ»úÎó¤Î¥¨¥ó¥È¥ê¡¼¤òÀßÄꤹ¤ë¡£\fIargp\fP ¤Ï¡¢ +¹½Â¤ÂÎ \fIstruct kbsentry\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +.IP \fBKDGKBDIACR\fP +.\"O Read kernel accent table. +.\"O \fIargp\fP points to a +¥«¡¼¥Í¥ë¤Î¥¢¥¯¥»¥ó¥È¥Æ¡¼¥Ö¥ë(accent table)¤òÆɤ߹þ¤à¡£\fIargp\fP¤Ï¡¢ + +.in +4n +.nf +struct kbdiacrs { + unsigned int kb_cnt; + struct kbdiacr kbdiacr[256]; +}; +.fi +.in + +¤È¤¤¤¦¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +.\"O where \fIkb_cnt\fP is the number of entries in the array, each of which +.\"O is a +¤³¤³¤Ç¡¢\fIkb_cnt\fP ¤ÏÇÛÎóÃæ¤Î¥¨¥ó¥È¥ê¡¼¤Î¸Ä¿ô¤Ç¡¢¸Ä¡¹¤Î¥¨¥ó¥È¥ê¡¼¤Ï¡¢ + +.in +4n +.nf +struct kbdiacr { + unsigned char diacr; + unsigned char base; + unsigned char result; +}; +.fi +.in + +¤È¤¤¤¦¹½Â¤ÂΤǤ¢¤ë¡£ +.IP \fBKDGETKEYCODE\fP +.\"O Read kernel keycode table entry (scan code to keycode). +.\"O \fIargp\fP points to a +¥«¡¼¥Í¥ë¤Î(¥¹¥­¥ã¥ó¥³¡¼¥É¤«¤é¥­¡¼¥³¡¼¥É¤Ø +ÊÑ´¹¤¹¤ë)¥­¡¼¥³¡¼¥É¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¡¼¤òÆɤ߹þ¤à¡£ +\fIargp\fP ¤Ï¡¢ + +.in +4n +.nf +struct kbkeycode { + unsigned int scancode; + unsigned int keycode; +}; +.fi +.in + +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +.\"O \fIkeycode\fP is set to correspond to the given \fIscancode\fP. +.\"O (89 <= \fIscancode\fP <= 255 only. +.\"O For 1 <= \fIscancode\fP <= 88, \fIkeycode\fP==\fIscancode\fP.) +.\"O (Since 1.1.63.) +\fIkeycode\fP ¤Ï¡¢\fIscancode\fP ¤ËÂбþ¤·¤¿ÃͤËÀßÄꤵ¤ì¤ë¡£(¤¿¤À¤·¡¢89 +<= \fIscancode\fP <= 255 ¤Î¤ß¤Ë¤Ä¤¤¤Æ¡£1 <= \fIscancode\fP <= 88 ¤Ç¤Ï +\fIkeycode\fP == \fIscancode\fP ¤Ç¤¢¤ë¡£) +(¥«¡¼¥Í¥ë 1.1.63 °Ê¹ß) +.IP \fBKDSETKEYCODE\fP +.\"O Write kernel keycode table entry. +.\"O \fIargp\fP points to +.\"O a \fIstruct kbkeycode\fP. +.\"O (Since 1.1.63.) +¥«¡¼¥Í¥ë¤Î¥­¡¼¥³¡¼¥É¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¡¼¤ò½ñ¤­¹þ¤à¡£\fIargp\fP ¤Ï¹½Â¤ÂÎ +\fIstruct kbkeycode\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +(¥«¡¼¥Í¥ë 1.1.63 °Ê¹ß) +.IP \fBKDSIGACCEPT\fP +.\"O The calling process indicates its willingness to accept the signal +.\"O \fIargp\fP when it is generated by pressing an appropriate key combination. +.\"O (1 <= \fIargp\fP <= NSIG). +.\"O (See spawn_console() in linux/drivers/char/keyboard.c.) +¤³¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤Ï¡¢ÆÃÊ̤ÊÁȹ礻¤Ç¥­¡¼¤ò²¡¤·¤¿»þ¤ËȯÀ¸¤¹¤ë¥·¥°¥Ê¥ë +\fIargp\fP (1 <= \fIargp\fP <= NSIG) ¤ò¿Ê¤ó¤Ç¼õ¤±ÉÕ¤±¤ë¤«¤É¤¦¤«¤ò¼¨¤¹¡£ +(linux/drivers/char/keyboard.c ¤Î Spawn_console() ¤ò¸«¤è¡£) +.IP \fBVT_OPENQRY\fP +.\"O Returns the first available (non-opened) console. +.\"O \fIargp\fP points to an \fIint\fP which is set to the +.\"O number of the vt (1 <= \fI*argp\fP <= MAX_NR_CONSOLES). +ºÇ½é¤Î¶õ¤¤¤Æ¤¤¤ë(¤Þ¤À¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤)¥³¥ó¥½¡¼¥ë¤òÊÖ¤¹¡£ +\fIargp\fP ¤Î»Ø¤¹ \fIint\fP ·¿¤ÎÀ°¿ô¤Ë¤Ï¡¢vt ¤ÎÈֹ椬¥»¥Ã¥È¤µ¤ì¤ë +(1 <= \fI*argp\fP <= MAX_NR_CONSOLES)¡£ +.IP \fBVT_GETMODE\fP +.\"O Get mode of active vt. +.\"O \fIargp\fP points to a +¥¢¥¯¥Æ¥£¥Ö¤Ê vt ¤Î¥â¡¼¥É¤ò¼èÆÀ¤¹¤ë¡£\fIargp\fP¤Ï¡¢ + +.in +4n +.nf +struct vt_mode { + char mode; /* vt mode */ + char waitv; /* if set, hang on writes if not active */ + short relsig; /* signal to raise on release req */ + short acqsig; /* signal to raise on acquisition */ + short frsig; /* unused (set to 0) */ +}; +.fi +.in + +.\"O which is set to the mode of the active vt. +.\"O \fImode\fP is set to one of these values: +¤È¤¤¤¦¹½Â¤ÂΤò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ê¡¢¥¢¥¯¥Æ¥£¥Ö¤Ê vt ¤Î¥â¡¼¥É¤¬ +¥»¥Ã¥È¤µ¤ì¤ë¡£ +\fImode\fP ¤Ï¼¡¤Î¤É¤ì¤«¤ËÀßÄꤵ¤ì¤ë¡§ + +.\"O VT_AUTO auto vt switching +.\"O VT_PROCESS process controls switching +.\"O VT_ACKACQ acknowledge switch + VT_AUTO ¼«Æ°vtÀÚÂؤ¨ + VT_PROCESS ¥×¥í¥»¥¹¥³¥ó¥È¥í¡¼¥ëÀÚÂؤ¨ + VT_ACKACQ ¥¢¥¯¥Î¥ê¥Ã¥¸ÀÚÂؤ¨ +.IP \fBVT_SETMODE\fP +.\"O Set mode of active vt. +.\"O \fIargp\fP points to +.\"O a \fIstruct vt_mode\fP. +¥¢¥¯¥Æ¥£¥Ö¤Ê vt ¤Î¥â¡¼¥É¤òÀßÄꤹ¤ë¡£\fIargp\fP ¤Ï¹½Â¤ÂÎ +\fIstruct vt_mode\fP ¤Ø¤Î +¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +.IP \fBVT_GETSTATE\fP +.\"O Get global vt state info. +.\"O \fIargp\fP points to a +¥°¥í¡¼¥Ð¥ë¤Ê vt ¤Î¾õÂ֤ξðÊó¤ò¼èÆÀ¤¹¤ë¡£\fIargp\fP¤Ï¡¢ + +.in +4n +.nf +struct vt_stat { + unsigned short v_active; /* active vt */ + unsigned short v_signal; /* signal to send */ + unsigned short v_state; /* vt bit mask */ +}; +.fi +.in + +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +.\"O For each vt in use, the corresponding bit in the \fIv_state\fP member is set. +.\"O (Kernels 1.0 through 1.1.92.) +»ÈÍѤµ¤ì¤Æ¤¤¤ë¤½¤ì¤¾¤ì¤Î vt ¤Ë¤Ä¤­ \fIv_state\fP ¤ÎÂбþ¤¹¤ë¥Ó¥Ã¥È¤¬ +¥»¥Ã¥È¤µ¤ì¤ë¡£ +(¥«¡¼¥Í¥ël 1.0 ¤«¤é 1.1.92 ¤Þ¤Ç) +.IP \fBVT_RELDISP\fP +.\"O Release a display. +¥Ç¥£¥¹¥×¥ì¡¼¤ò²òÊü¤¹¤ë¡£ +.IP \fBVT_ACTIVATE\fP +.\"O Switch to vt \fIargp\fP (1 <= \fIargp\fP <= MAX_NR_CONSOLES). +\fIargp\fP (1 <= \fIargp\fP <= MAX_NR_CONSOLES)¤Î vt ¤ËÀÚÂؤ¨¤ë¡£ +.IP \fBVT_WAITACTIVE\fP +.\"O Wait until vt \fIargp\fP has been activated. +\fIargp\fP¤Î vt ¤¬¥¢¥¯¥Æ¥£¥Ö¤Ë¤Ê¤ë¤Þ¤ÇÂԤġ£ +.IP \fBVT_DISALLOCATE\fP +.\"O Deallocate the memory associated with vt \fIargp\fP. +.\"O (Since 1.1.54.) +\fIargp\fP ¤Î vt ¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤¿¥á¥â¥ê¡¼¤ò²òÊü¤¹¤ë¡£ +(¥«¡¼¥Í¥ë 1.1.54 °Ê¹ß) +.IP \fBVT_RESIZE\fP +.\"O Set the kernel's idea of screensize. +.\"O \fIargp\fP points to a +¥«¡¼¥Í¥ë¤¬Ç§¼±¤¹¤ë¥¹¥¯¥ê¡¼¥ó¥µ¥¤¥º¤òÀßÄꤹ¤ë¡£\fIargp\fP ¤Ï¡¢ + +.in +4n +.nf +struct vt_sizes { + unsigned short v_rows; /* # rows */ + unsigned short v_cols; /* # columns */ + unsigned short v_scrollsize; /* no longer used */ +}; +.fi +.in + +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +.\"O Note that this does not change the videomode. +.\"O See +.\"O .BR resizecons (8). +.\"O (Since 1.1.54.) +¤³¤ì¤Ï¥Ó¥Ç¥ª¥â¡¼¥É¤òÊѹ¹¤·¤Ê¤¤»ö¤ËÃí°Õ¡£ +.BR resizecons (8) +¤ò¸«¤è(¥«¡¼¥Í¥ë 1.1.54 °Ê¹ß)¡£ +.IP \fBVT_RESIZEX\fP +.\"O Set the kernel's idea of various screen parameters. +.\"O \fIargp\fP points to a +¥«¡¼¥Í¥ë¤¬Ç§¼±¤¹¤ë³Æ¼ï¤Î¥¹¥¯¥ê¡¼¥ó¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë¡£\fIargp\fP ¤Ï¡¢ + +.in +4n +.nf +struct vt_consize { + unsigned short v_rows; /* number of rows */ + unsigned short v_cols; /* number of columns */ + unsigned short v_vlin; /* number of pixel rows + on screen */ + unsigned short v_clin; /* number of pixel rows + per character */ + unsigned short v_vcol; /* number of pixel columns + on screen */ + unsigned short v_ccol; /* number of pixel columns + per character */ +}; +.fi +.in + +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ + +.\"O Any parameter may be set to zero, indicating "no change", but if +.\"O multiple parameters are set, they must be self-consistent. +.\"O Note that this does not change the videomode. +.\"O See +.\"O .BR resizecons (8). +.\"O (Since 1.3.3.) +¥Ñ¥é¥á¡¼¥¿¤Ï¥¼¥í¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¡£¤½¤Î¤È¤­¤Ï¡ÖÊѹ¹¤·¤Ê¤¤¤³¤È¡×¤ò +°ÕÌ£¤¹¤ë¤¬¡¢Ê£¿ô¤Î¥Ñ¥é¥á¡¼¥¿¤¬ÀßÄꤵ¤ì¤¿»þ¤Ë¤Ï¤½¤ì¤é¤Î´Ö¤ÇÌ·½â¤¬ +¤Ê¤¤¤è¤¦¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ¤â¥Ó¥Ç¥ª¥â¡¼¥É¤ÏÊѹ¹¤µ¤ì¤Ê¤¤»ö¤ËÃí°Õ¡£ +.BR resizecons (8) +¤ò»²¾È¤Î»ö(¥«¡¼¥Í¥ë 1.3.3 °Ê¹ß)¡£ +.PP +.\"O The action of the following ioctls depends on the first byte in the struct +.\"O pointed to by \fIargp\fP, referred to here as the \fIsubcode\fP. +.\"O These are legal only for the superuser or the owner of the current tty. +°Ê²¼¤Î ioctl ¤¬¤É¤Î¤è¤¦¤ËÆ°ºî¤ò¤¹¤ë¤«¤Ï¡¢\fIargp\fP ¤¬»Ø¤¹¹½Â¤ÂΤΠ+ºÇ½é¤Î¥Ð¥¤¥È(¤³¤³¤Ç¤Ï \fIsubcode\fP ¤È¸Æ¤Ö)¤Ë°Í¸¤¹¤ë¡£ +¤³¤ì¤é¤Î¸Æ½Ð¤·¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤«¸½ºß¤Î tty ¤Î¥ª¡¼¥Ê¤Ë¤Î¤ßµö¤µ¤ì¤ë¡£ +.IP "\fBTIOCLINUX, subcode=0\fP" +.\"O Dump the screen. +.\"O Disappeared in 1.1.92. (With kernel 1.1.92 or later, read from +.\"O /dev/vcsN or /dev/vcsaN instead.) +¥¹¥¯¥ê¡¼¥ó¤ò¥À¥ó¥×(dump)¤¹¤ë +¥«¡¼¥Í¥ë 1.1.92 °Ê¹ß¤Ç¤Ê¤¯¤Ê¤Ã¤¿(1.1.92 °Ê¹ß¤Ç¤Ï¡¢Âå¤ï¤ê¤Ë /dev/vcsN +¤Þ¤¿¤Ï /dev/vcsaN ¤è¤êÆɤ߹þ¤à)¡£ +.IP "\fBTIOCLINUX, subcode=1\fP" +.\"O Get task information. +.\"O Disappeared in 1.1.92. +¥¿¥¹¥¯¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£¥«¡¼¥Í¥ë 1.1.92 ¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£ +.IP "\fBTIOCLINUX, subcode=2\fP" +.\"O Set selection. +.\"O \fIargp\fP points to a +ÁªÂò¤òÀßÄꤹ¤ë¡£ +\fIargp\fP ¤¬»Ø¤¹¤Î¤Ï¡¢ +.in +4n +.nf + +struct { + char subcode; + short xs, ys, xe, ye; + short sel_mode; +} + +.fi +.in +.\"O \fIxs\fP and \fIys\fP are the starting column and row. +.\"O \fIxe\fP and \fIye\fP are the ending +.\"O column and row. +.\"O (Upper left corner is row=column=1.) +.\"O \fIsel_mode\fP is 0 for character-by-character selection, +.\"O 1 for word-by-word selection, +.\"O or 2 for line-by-line selection. +.\"O The indicated screen characters are highlighted and saved +.\"O in the static array sel_buffer in devices/char/console.c. +¤Ç¤¢¤ê¡¢¤³¤³¤Ç +\fIxs\fP ¤È \fIys\fP ¤Ï»Ï¤á¤Î·å¤È¹Ô¤Ç¡¢\fIxe\fP ¤È \fIye\fP ¤Ï½ª¤ê¤Î·å¤È +¹Ô¤Ç¤¢¤ë¡£ +(º¸¾å¤Î¶ù¤¬ ·å=¹Ô=1 ) +\fIsel_mode\fP ¤Ï 0 ¤¬Ê¸»úËè¤ÎÁªÂò¤Ç¡¢1¤Ï¸ìËè¤ÎÁªÂò¡¢2¤Ï¹ÔËè¤ÎÁªÂò¤ò +°ÕÌ£¤¹¤ë¡£ +¼¨¤µ¤ì¤¿¥¹¥¯¥ê¡¼¥ó¾å¤Îʸ»ú¤Ï¥Ï¥¤¥é¥¤¥Èɽ¼¨¤µ¤ì devices/char/console.c ¤Î +ÀÅŪÇÛÎó sel_buffer ¤ËÊݸ¤µ¤ì¤ë¡£ +.IP "\fBTIOCLINUX, subcode=3\fP" +.\"O Paste selection. +.\"O The characters in the selection buffer are +.\"O written to \fIfd\fP. +ÁªÂò¤·¤¿¤â¤Î¤ò¥Ú¡¼¥¹¥È¤¹¤ë¡£ +ÁªÂò¥Ð¥Ã¥Õ¥¡Ãæ¤Îʸ»ú ¤¬ \fIfd\fP ¤Ë½ñ¤­½Ð¤µ¤ì¤ë¡£ +.IP "\fBTIOCLINUX, subcode=4\fP" +.\"O Unblank the screen. +¥¹¥¯¥ê¡¼¥ó¤ò¥¢¥ó¥Ö¥é¥ó¥¯(unblank)¤¹¤ë¡£ +.IP "\fBTIOCLINUX, subcode=5\fP" +.\"O Sets contents of a 256-bit look up table defining characters in a "word", +.\"O for word-by-word selection. +.\"O (Since 1.1.32.) +¸ìËè¤ÎÁªÂò¤Î¤¿¤á¤Î¡Ö¸ì¡×Ãæ¤Îʸ»ú¤òµ¬Äꤷ¤Æ¤¤¤ë 256 ¥Ó¥Ã¥È¤Î¥ë¥Ã¥¯¥¢¥Ã¥× +¥Æ¡¼¥Ö¥ë¤ÎÆâÍƤòÀßÄꤹ¤ë(¥«¡¼¥Í¥ë 1.1.32 °Ê¹ß)¡£ +.IP "\fBTIOCLINUX, subcode=6\fP" +.\"O \fIargp\fP points to a char which is set to the value of the kernel +.\"O variable \fIshift_state\fP. +.\"O (Since 1.1.32.) +\fIargp\fP ¤Ïʸ»úÊÑ¿ô¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¡¢¤½¤ÎÆâÍƤ¬¥«¡¼¥Í¥ëÊÑ¿ô +\fIshift_state\fP¤ÎÃͤËÀßÄꤵ¤ì¤ë(¥«¡¼¥Í¥ë 1.1.32 °Ê¹ß)¡£ +.IP "\fBTIOCLINUX, subcode=7\fP" +.\"O \fIargp\fP points to a char which is set to the value of the kernel +.\"O variable \fIreport_mouse\fP. +.\"O (Since 1.1.33.) +\fIargp\fP ¤Ïʸ»úÊÑ¿ô¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¡¢¤½¤ÎÆâÍƤ¬¥«¡¼¥Í¥ëÊÑ¿ô +\fIreport_mouse\fP ¤ÎÃͤËÀßÄꤵ¤ì¤ë(¥«¡¼¥Í¥ë 1.1.33 °Ê¹ß)¡£ +.IP "\fBTIOCLINUX, subcode=8\fP" +.\"O Dump screen width and height, cursor position, and all the +.\"O character-attribute pairs. +.\"O (Kernels 1.1.67 through 1.1.91 only. +.\"O With kernel 1.1.92 or later, read from /dev/vcsa* instead.) +¥¹¥¯¥ê¡¼¥óÉý¡¢¥¹¥¯¥ê¡¼¥ó¹â¤µ¡¢¥«¡¼¥½¥ë°ÌÃÖ¡¢Á´¤Æ¤Îʸ»ú°À­¤ÎÁȤò¥À¥ó¥×¤¹¤ë +(¥«¡¼¥Í¥ë 1.1.67 ¤«¤é 1.1.91¤Þ¤Ç¤Î¤ß¡£ +¥«¡¼¥Í¥ë 1.1.92 °Ê¹ß¤Ç¤Ï /dev/vcsa*¤è¤êÆɤ߹þ¤à)¡£ +.IP "\fBTIOCLINUX, subcode=9\fP" +.\"O Restore screen width and height, cursor position, and all the +.\"O character-attribute pairs. +.\"O (Kernels 1.1.67 through 1.1.91 only. +.\"O With kernel 1.1.92 or later, write to /dev/vcsa* instead.) +¥¹¥¯¥ê¡¼¥óÉý¡¢¥¹¥¯¥ê¡¼¥ó¹â¤µ¡¢¥«¡¼¥½¥ë°ÌÃÖ¡¢Á´¤Æ¤Îʸ»ú°À­¤ÎÁȤòÉü¸µ¤¹¤ë +(¥«¡¼¥Í¥ë 1.1.67 ¤«¤é 1.1.91 ¤Þ¤Ç¤Î¤ß¡£ +¥«¡¼¥Í¥ë 1.1.92 °Ê¹ß¤Ç¤Ï /dev/vcsa* ¤Ë½ñ¤­¹þ¤à)¡£ +.IP "\fBTIOCLINUX, subcode=10\fP" +.\"O Handles the Power Saving +.\"O feature of the new generation of monitors. +.\"O VESA screen blanking mode is set to \fIargp\fP[1], which governs what +.\"O screen blanking does: +¿·À¤Âå¥â¥Ë¥¿¡¼¤Î¥Ñ¥ï¡¼¥»¡¼¥Öµ¡Ç½¤òÀ©¸æ¤¹¤ë¡£ +VESA ¥¹¥¯¥ê¡¼¥ó¥Ö¥é¥ó¥­¥ó¥°¥â¡¼¥É¤¬ \fIargp\fP[1]¤ËÀßÄꤵ¤ì¤ë¡£ +¤½¤ÎÃͤϥ¹¥¯¥ê¡¼¥ó¥Ö¥é¥ó¥­¥ó¥°¤¬¤É¤Î¤è¤¦¤Ë¹Ô¤ï¤ì¤ë¤«¤ò¼¨¤¹¡£°Ê²¼¤¬¤½¤Î +ÃͤǤ¢¤ë¡£ + +.\"O \fI0\fP: Screen blanking is disabled. + \fI0\fP: ¥¹¥¯¥ê¡¼¥ó¥Ö¥é¥ó¥­¥ó¥°¤Ê¤·¡£ + +.\"O \fI1\fP: The current video adapter +.\"O register settings are saved, then the controller is programmed to turn off +.\"O the vertical synchronization pulses. +.\"O This puts the monitor into "standby" mode. +.\"O If your monitor has an Off_Mode timer, then +.\"O it will eventually power down by itself. + \fI1\fP:¸½ºß¤Î¥Ó¥Ç¥ª¥¢¥À¥×¥¿¡¼¥ì¥¸¥¹¥¿¤¬Êݸ¤µ¤ì¤¿¤¢¤È¡¢ +¥³¥ó¥È¥í¡¼¥é¤Ï¿âľƱ´ü¥Ñ¥ë¥¹¤ò¥ª¥Õ¤Ë¤¹¤ë¤è¤¦¥×¥í¥°¥é¥à¤µ¤ì¤ë¡£¤³¤ì¤Ë¤è¤ê +¥â¥Ë¥¿¡¼¤Ï¡Ö¥¹¥¿¥ó¥Ð¥¤¡×¥â¡¼¥É¤Ë¤Ï¤¤¤ë¡£ +¥â¥Ë¥¿¡¼¤Ë Off_Mode ¥¿¥¤¥Þ¤¬È÷¤ï¤Ã¤Æ¤ª¤ì¤Ð¡¢ºÇ½ªÅª¤Ë¤Ï¥â¥Ë¥¿¡¼¤¬¼«Ê¬¤Ç +ÅŸ»¤òÍ¡£ + +.\"O \fI2\fP: The current +.\"O settings are saved, then both the vertical and horizontal +.\"O synchronization pulses are turned off. +.\"O This puts the monitor into "off" mode. +.\"O If your monitor has no Off_Mode timer, +.\"O or if you want your monitor to power down immediately when the +.\"O blank_timer times out, then you choose this option. +.\"O (\fICaution:\fP Powering down frequently will damage the monitor.) + \fI2\fP:¸½ºß¤ÎÀßÄê¤òÊݸ¤·¤¿¸å¡¢¿âľ¡¢¿åʿƱ´ü¥Ñ¥ë¥¹¤¬¥ª¥Õ¤Ë¤Ê¤ë¡£ +¤³¤ì¤Ë¤è¤ê¥â¥Ë¥¿¡¼¤Ï¡Ö¥ª¥Õ¡×¥â¡¼¥É¤Ë¤Ê¤ë¡£ +¥â¥Ë¥¿¡¼¤Ë Off_Mode ¥¿¥¤¥Þ¡¼¤¬¤Ê¤¤»þ¡¢¤Þ¤¿¤Ï¡¢blank_timer ¤¬¥¿¥¤¥à¥¢¥¦¥È¤·¤¿¤é +¤¹¤°¤Ë¥â¥Ë¥¿¡¼¤ÎÅŸ»¤òÍ¤¿¤¤¤È¤­¤Ë¤³¤ÎÁªÂò»è¤òÁª¤Ö¡£ +(Ãí°Õ¡§ÉÑÈˤ˥â¥Ë¥¿¡¼¤ÎÅŸ»¤òÀÚ¤ë¤È¥â¥Ë¥¿¡¼¤òÄˤá¤ë¡£) + +.\"O (Since 1.1.76.) +(¥«¡¼¥Í¥ë 1.1.76 °Ê¹ß) + +.\"O .SH "RETURN VALUE" +.SH Ìá¤êÃÍ +.\"O On success, 0 is returned. +.\"O On error \-1 is returned, and \fIerrno\fP is set. +À®¸ù»þ¤Ë¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤ËÂФ·¤Æ¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +\fIerrno\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O \fIerrno\fP may take on these values: +\fIerrno\fP ¤Ï¼¡¤Î¤è¤¦¤ÊÃͤò¤È¤ë: +.TP +.B EBADF +.\"O The file descriptor is invalid. +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Ìµ¸ú¡£ +.TP +.B ENOTTY +.\"O The file descriptor is not associated with a character special device, +.\"O or the specified request does not apply to it. +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥­¥ã¥é¥¯¥¿¡¦¥¹¥Ú¥·¥ã¥ë¥Ç¥Ð¥¤¥¹¤È´ØÏ¢ÉÕ¤±¤é¤ì¤Æ +¤¤¤Ê¤¤¡£¤Þ¤¿¤Ï¡¢Í׵ᤵ¤ì¤¿¤â¤Î¤¬¤½¤ì¤ËÅö¤Æ¤Ï¤Þ¤é¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O The file descriptor or \fIargp\fP is invalid. +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Þ¤¿¤Ï \fIargp\fP ¤¬Ìµ¸ú¡£ +.TP +.B EPERM +.\"O Insufficient permission. +¸¢¸Â¤¬ÉÔ½½Ê¬¡£ + +.\"O .SH NOTES +.SH Ãí°Õ +.\"O .BR Warning : +.\"O Do not regard this man page as documentation of the Linux console ioctl's. +.\"O This is provided for the curious only, as an alternative to reading the +.\"O source. +.\"O Ioctl's are undocumented Linux internals, liable to be changed +.\"O without warning. +.\"O (And indeed, this page more or less describes the +.\"O situation as of kernel version 1.1.94; +.\"O there are many minor and not-so-minor +.\"O differences with earlier versions.) +.BR ·Ù¹ð : +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò Linux ¤Î¥³¥ó¥½¡¼¥ë ioctl ¤òʸ½ñ²½¤·¤¿¤â¤Î¤È»×¤ï¤Ê¤¤»ö¡£ +¤³¤ì¤Ï¡¢¶½Ì£¤¬¤¢¤ë¿Í¤¬¥½¡¼¥¹¤òÆɤळ¤È¤ÎÂå¤ï¤ê¤Ë¤Ê¤ë¤è¤¦¤ËÍÑ°Õ¤·¤¿Êª¤Ç¤¢¤ë¡£ +ioctl ¤Ïʸ½ñ²½¤µ¤ì¤Ê¤¤ Linux ¤ÎÆâÉôµ¡Ç½¤Ç¤¢¤Ã¤Æ¡¢·Ù¹ð¤Ê¤·¤Ë +Êѹ¹¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +(¤½¤·¤Æ¡¢¤³¤Î¥Ú¡¼¥¸¤Ï¥«¡¼¥Í¥ë 1.1.94 ¤Î¤È¤­¤Î¾õ¶·¤òµ­½Ò¤·¤¿Êª¤Ç¡¢¤½¤ì¤Ï +°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤ÈÈæ¤Ù¤ì¤Ð¡¢Â¿¤¯¤Î°ã¤¤¤¬¤¢¤ë) + +.\"O Very often, ioctl's are introduced for communication between the +.\"O kernel and one particular well-known program (fdisk, hdparm, setserial, +.\"O tunelp, loadkeys, selection, setfont, etc.), and their behavior will be +.\"O changed when required by this particular program. +ioctl ¤Ï¥«¡¼¥Í¥ë¤È¡¢¤¢¤ëÆÃÄê¤Î¤è¤¯ÃΤé¤ì¤¿¥×¥í¥°¥é¥à¤È¤Î¾ðÊó¸ò´¹¤Î¤¿¤á¤Ë +ƳÆþ¤µ¤ì¤ë»ö¤¬Èó¾ï¤Ë¿¤¤(fdisk, hdparm, setserial,tunelp, loadkeys, +selection, setfont ¤Ê¤É)¡£¤½¤Î¤¿¤á ioctl ¤ÎÆ°ºî¤Ï¡¢¤½¤ÎÆÃÄê¤Î¥×¥í¥°¥é¥à¤¬ +ɬÍפȤ·¤¿»þ¤Ë¤ÏÊѹ¹¤Ë¤Ê¤ë¡£ + +.\"O Programs using these ioctl's will not be portable to other versions +.\"O of Unix, will not work on older versions of Linux, and will not work +.\"O on future versions of Linux. +¤³¤ì¤é¤Î ioctl ¤ò»È¤Ã¤¿¥×¥í¥°¥é¥à¤Ï¾¤Î¥Ð¡¼¥¸¥ç¥ó¤Î Unix ¤È¤Î¸ß´¹À­¤¬ +¤Ê¤¤¤·¡¢¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Linux ¤Ç¤Ï¡¢Áö¤é¤Ê¤¤¡£¤µ¤é¤Ë¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Î +Linux ¤Ç¤ÏÁö¤é¤Ê¤¯¤Ê¤ë¤«¤âÃΤì¤Ê¤¤¡£ + +.\"O Use POSIX functions. +POSIX µ¡Ç½¤ò»È¤¤¤Ê¤µ¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR dumpkeys (1), +.BR kbd_mode (1), +.BR loadkeys (1), +.BR mknod (1), +.BR setleds (1), +.BR setmetamode (1), +.BR execve (2), +.BR fcntl (2), +.BR ioperm (2), +.BR termios (3), +.BR console (4), +.BR console_codes (4), +.BR mt (4), +.BR sd (4), +.BR tty (4), +.BR tty_ioctl (4), +.BR ttyS (4), +.BR vcs (4), +.BR vcsa (4), +.BR charsets (7), +.BR mapscrn (8), +.BR resizecons (8), +.BR setfont (8), +.IR /usr/include/linux/kd.h , +.I /usr/include/linux/vt.h diff --git a/draft/man4/dsp56k.4 b/draft/man4/dsp56k.4 new file mode 100644 index 00000000..dcfdc9f1 --- /dev/null +++ b/draft/man4/dsp56k.4 @@ -0,0 +1,188 @@ +'\" t +.\" Copyright (c) 2000 lars brinkhoff +.\" +.\" 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, Thu Jan 27 19:16:19 CET 2000, lars@nocrew.org +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jul 11 20:05:48 JST 2000 +.\" by Yuichi SATO +.\" +.\"WORD: handshake ¥Ï¥ó¥É¥·¥§¥¤¥¯ +.\"WORD: device ¥Ç¥Ð¥¤¥¹ +.\"WORD: processer ¥×¥í¥»¥Ã¥µ¡¼ +.\"WORD: transmit Á÷¿® +.\"WORD: recieve ¼õ¿® +.\"WORD: quantity ñ°Ì +.\" +.TH DSP56K 4 2000-03-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O dsp56k \- DSP56001 interface device +dsp56k \- DSP56001 ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¡¦¥Ç¥Ð¥¤¥¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +#include +.sp +.BI "ssize_t read(int " fd ", void *" data ", size_t " length ); +.BI "ssize_t write(int " fd ", void *" data ", size_t " length ); + +.BI "int ioctl(int " fd ", DSP56K_UPLOAD, struct dsp56k_upload *" program ); +.BI "int ioctl(int " fd ", DSP56K_SET_TX_WSIZE, int " wsize ); +.BI "int ioctl(int " fd ", DSP56K_SET_RX_WSIZE, int " wsize ); +.BI "int ioctl(int " fd ", DSP56K_HOST_FLAGS, struct dsp56k_host_flags *" flags ); +.BI "int ioctl(int " fd ", DSP56K_HOST_CMD, int " cmd ); +.fi +.\"O .SH CONFIGURATION +.SH ÀßÄê +.\"O The dsp56k device is a character device with major number 55 and minor +.\"O number 0. +dsp56k ¥Ç¥Ð¥¤¥¹¤Ï¡¢¥á¥¸¥ã¡¼ÈÖ¹æ 55¡¢¥Þ¥¤¥Ê¡¼ÈÖ¹æ 0 ¤Î +¥­¥ã¥é¥¯¥¿¡¼¡¦¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The Motorola DSP56001 is a fully programmable 24-bit digital signal +.\"O processor found in Atari Falcon030-compatible computers. +.\"O The \fIdsp56k\fP special file is used to control the DSP56001, and +.\"O to send and receive data using the bidirectional handshaked host +.\"O port. +Motorola DSP56001 ¤Ï¡¢Atari Falcon030 ¸ß´¹¤Î¥³¥ó¥Ô¥å¡¼¥¿¤Ç»È¤ï¤ì¤Æ¤¤¤ë +¥Õ¥ë¥×¥í¥°¥é¥Þ¥Ö¥ë¤Ê 24 ¥Ó¥Ã¥È¤Î¥Ç¥¸¥¿¥ë¥·¥°¥Ê¥ë¥×¥í¥»¥Ã¥µ¡¼¤Ç¤¢¤ë¡£ +¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë \fIdsp56k\fP ¤Ï¡¢DSP56001 ¤ÎÀ©¸æ¤È +ÁÐÊý¸þ¥Ï¥ó¥É¥·¥§¥¤¥¯¥Û¥¹¥È¥Ý¡¼¥È¤Ç¤Î¥Ç¡¼¥¿¤ÎÁ÷¼õ¿®¤Î¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.PP +.\"O To send a data stream to the signal processor, use +.\"O .BR write (2) +.\"O to the +.\"O device, and +.\"O .BR read (2) +.\"O to receive processed data. +.\"O The data can be sent or +.\"O received in 8, 16, 24, or 32-bit quantities on the host side, but will +.\"O always be seen as 24-bit quantities in the DSP56001. +¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥à¤ò¥·¥°¥Ê¥ë¥×¥í¥»¥Ã¥µ¡¼¤ËÁ÷¿®¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ +.BR write (2) +¤ò»È¤¦¤³¤È¡£ +½èÍý¤µ¤ì¤¿¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.BR read (2) +¤ò»È¤¦¤³¤È¡£ +¥Û¥¹¥È¦¤Ç¤Ï¡¢¥Ç¡¼¥¿¤Ï 8, 16, 24, 32 ¥Ó¥Ã¥Èñ°Ì¤ÇÁ÷¼õ¿®¤Ç¤­¤ë¤¬¡¢ +DSP56001 Æâ¤Ç¤Ï¡¢24 ¥Ó¥Ã¥Èñ°Ì¤Ç°·¤ï¤ì¤ë¡£ +.PP +.\"O The following +.\"O .BR ioctl (2) +.\"O calls are used to control the +.\"O \fIdsp56k\fP device: +¼¡¤Î +.BR ioctl (2) +¥³¡¼¥ë¤¬ \fIdsp56k\fP ¥Ç¥Ð¥¤¥¹¤òÀ©¸æ¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.IP \fBDSP56K_UPLOAD\fP +.\"O resets the DSP56001 and uploads a program. +.\"O The third +.\"O .BR ioctl(2) +.\"O argument must be a pointer to a \fIstruct dsp56k_binary\fP with members +.\"O \fIbin\fP pointing to a DSP56001 binary program, and \fIlen\fP set to +.\"O the length of the program, counted in 24-bit words. +DSP56001 ¤ò¥ê¥»¥Ã¥È¤·¡¢¥×¥í¥°¥é¥à¤ò¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë¡£ +.BR ioctl (2) +¤Î 3 ÈÖÌܤΰú¤­¿ô¤Ï¡¢ +¹½Â¤ÂÎ \fIstruct dsp56k_binary\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¹½Â¤ÂΤΥá¥ó¥Ð¡¼ \fIbin\fP ¤Ï DSP56001 ¥Ð¥¤¥Ê¥ê¥×¥í¥°¥é¥à¤ò»Ø¤·¡¢ +¹½Â¤ÂΤΥá¥ó¥Ð¡¼ \fIlen\fP ¤Ï 24 ¥Ó¥Ã¥È¥ï¡¼¥É¤Ç¿ô¤¨¤¿ +¥×¥í¥°¥é¥à¤ÎŤµ¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP \fBDSP56K_SET_TX_WSIZE\fP +.\"O sets the transmit word size. +.\"O Allowed values are in the range 1 to 4, +.\"O and is the number of bytes that will be sent at a time to the +.\"O DSP56001. +.\"O These data quantities will either be padded with zero +.\"O bytes, or truncated to fit the native 24-bit data format of the +.\"O DSP56001. +Á÷¿®¥ï¡¼¥É¥µ¥¤¥º¤òÀßÄꤹ¤ë¡£ +ÀßÄê¤Ç¤­¤ëÃÍ¤Ï 1 ¡Á 4 ¤ÎÈϰϤǡ¢¤³¤Î¥Ð¥¤¥È¿ôʬ¤À¤± 1 ÅÙ¤Ë DSP56001 ¤ËÁ÷¿®¤¹¤ë¡£ +¤³¤Î¥Ç¡¼¥¿Ã±°Ì¤Ï¡¢DSP56001 ËÜÍè¤Î 24 ¥Ó¥Ã¥È¥Ç¡¼¥¿·Á¼°¤Ë¹ç¤ï¤»¤ë¤¿¤á¡¢ +¥¼¥í¤Î¥Ð¥¤¥È¤ÇËä¤á¤é¤ì¤¿¤ê¡¢ÀÚ¤êµÍ¤á¤é¤ì¤¿¤ê¤¹¤ë¡£ +.IP \fBDSP56K_SET_RX_WSIZE\fP +.\"O sets the receive word size. +.\"O Allowed values are in the range 1 to 4, +.\"O and is the number of bytes that will be received at a time from the +.\"O DSP56001. +.\"O These data quantities will either truncated, or padded with +.\"O a null byte (\(aq\\0\(aq) to fit the native 24-bit data format of the DSP56001. +¼õ¿®¥ï¡¼¥É¥µ¥¤¥º¤òÀßÄꤹ¤ë¡£ +ÀßÄê¤Ç¤­¤ëÃÍ¤Ï 1 ¡Á 4 ¤ÎÈϰϤǡ¢ +¤³¤Î¥Ð¥¤¥È¿ôʬ¤À¤± 1 ÅÙ¤Ë DSP56001 ¤«¤é¼õ¿®¤¹¤ë¡£ +¤³¤Î¥Ç¡¼¥¿Ã±°Ì¤Ï¡¢DSP56001 ËÜÍè¤Î 24 ¥Ó¥Ã¥È¥Ç¡¼¥¿·Á¼°¤Ë¹ç¤ï¤»¤ë¤¿¤á¡¢ +ÀÚ¤êµÍ¤á¤é¤ì¤¿¤ê¡¢NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤ÇËä¤á¤é¤ì¤¿¤ê¤¹¤ë¡£ +.IP \fBDSP56K_HOST_FLAGS\fP +.\"O read and write the host flags. +.\"O The host flags are four +.\"O general-purpose bits that can be read by both the hosting computer and +.\"O the DSP56001. +.\"O Bits 0 and 1 can be written by the host, and bits 2 and +.\"O 3 can be written by the DSP56001. +¥Û¥¹¥È¥Õ¥é¥°¤òÆɤ߽ñ¤­¤¹¤ë¡£ +¥Û¥¹¥È¥Õ¥é¥°¤Ï¡¢°ìÈÌŪ¤ÊÌÜŪ¤Ç»È¤¦¤³¤È¤Î¤Ç¤­¤ë¥Ó¥Ã¥È¤Ç¡¢ +¥Û¥¹¥È¥³¥ó¥Ô¥å¡¼¥¿¤È DSP56001 ¤ÎξÊý¤«¤éÆɤळ¤È¤¬¤Ç¤­¤ë¡£ +¥Ó¥Ã¥È 0 ¤È 1 ¤Ï¡¢¥Û¥¹¥È¤Ë¤è¤Ã¤Æ½ñ¤­¹þ¤à¤³¤È¤¬¤Ç¤­¡¢ +¥Ó¥Ã¥È 2 ¤È 3 ¤Ï¡¢DSP56001 ¤Ë¤è¤Ã¤Æ½ñ¤­¹þ¤à¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O To access the host flags, the third +.\"O .BR ioctl (2) +.\"O argument must be a pointer +.\"O to a \fIstruct dsp56k_host_flags\fP. +.\"O If bit 0 or 1 is set in the +.\"O \fIdir\fP member, the corresponding bit in \fIout\fP will be written +.\"O to the host flags. +.\"O The state of all host flags will be returned in +.\"O the lower four bits of the \fIstatus\fP member. +¥Û¥¹¥È¥Õ¥é¥°¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.BR ioctl (2) +¤Î 3 ÈÖÌܤΰú¤­¿ô¤¬ +¹½Â¤ÂÎ \fIstruct dsp56k_host_flags\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î¹½Â¤ÂΤΥá¥ó¥Ð¡¼ \fIdir\fP ¤Î¥Ó¥Ã¥È 0 ¤Þ¤¿¤Ï 1 ¤¬ÀßÄꤵ¤ì¤ë¤È¡¢ +¥á¥ó¥Ð¡¼ \fIout\fP ¤ÎÂбþ¤¹¤ë¥Ó¥Ã¥È¤ÎÃͤ¬¥Û¥¹¥È¥Õ¥é¥°¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +¤¹¤Ù¤Æ¤Î¥Û¥¹¥È¥Õ¥é¥°¤Î¾õÂ֤ϡ¢¹½Â¤ÂΤΥá¥ó¥Ð¡¼ \fIstatus\fP ¤Î +²¼¤«¤é 4 ¥Ó¥Ã¥È¤È¤·¤ÆÊÖ¤µ¤ì¤ë¡£ +.IP \fBDSP56K_HOST_CMD\fP +.\"O sends a host command. +.\"O Allowed values are in the range 0 to 31, and is a +.\"O user-defined command handled by the program running in the DSP56001. +¥Û¥¹¥È¥³¥Þ¥ó¥É¤òÁ÷¿®¤¹¤ë¡£ +Á÷¿®¤Ç¤­¤ëÃÍ¤Ï 0 ¡Á 31 ¤ÎÈϰϤǡ¢DSP56001 ¤ÇÆ°ºî¤·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ +½èÍý¤µ¤ì¤ë¥æ¡¼¥¶¡¼ÄêµÁ¥³¥Þ¥ó¥É¤Ç¤¢¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +/dev/dsp56k +.\"O .\" .SH AUTHORS +.\" .SH Ãø¼Ô +.\" Fredrik Noring , lars brinkhoff , +.\" Tomas Berndtsson . +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.IR linux/include/asm-m68k/dsp56k.h , +.IR linux/drivers/char/dsp56k.c , +.IR http://dsp56k.nocrew.org/ , +DSP56000/DSP56001 Digital Signal Processor User's Manual diff --git a/draft/man4/fd.4 b/draft/man4/fd.4 new file mode 100644 index 00000000..dd188794 --- /dev/null +++ b/draft/man4/fd.4 @@ -0,0 +1,337 @@ +'\" t +.\" Copyright (c) 1993 Michael Haardt (michael@cantor.informatik.rwth-aachen.de) +.\" and 1994,1995 Alain Knaff (Alain.Knaff@imag.fr) +.\" +.\" 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, Sun Feb 26 15:00:02 1995, faith@cs.unc.edu +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Sun Jan 11 03:25:38 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: floppy disk ¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯ +.\" WORD: double density ÇÜÌ©ÅÙ +.\" WORD: high density ¹âÌ©ÅÙ +.\" WORD: extra density ³Èĥ̩ÅÙ +.\" WORD: interleaved format ¥¤¥ó¥¿¡¼¥ê¡¼¥Ö¥É¥Õ¥©¡¼¥Þ¥Ã¥È +.\" WORD: media ¥á¥Ç¥£¥¢ +.\" WORD: geometry ¥¸¥ª¥á¥È¥ê +.\" WORD: buffer cache ¥Ð¥Ã¥Õ¥¡¥­¥ã¥Ã¥·¥å +.\" WORD: threshold ïçÃÍ +.\" WORD: clear ¥¯¥ê¥¢¡¼ +.\" +.TH FD 4 1995-01-29 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O fd \- floppy disk device +.SH ̾Á° +fd \- ¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯(floppy disk)¥Ç¥Ð¥¤¥¹ +.\"O .SH CONFIGURATION +.SH ÀßÄê +.\"O Floppy drives are block devices with major number 2. +.\"O Typically they +.\"O are owned by root.floppy (i.e., user root, group floppy) and have +.\"O either mode 0660 (access checking via group membership) or mode 0666 +.\"O (everybody has access). +.\"O The minor +.\"O numbers encode the device type, drive number, and controller number. +.\"O For each device type (that is, combination of density and track count) +.\"O there is a base minor number. +.\"O To this base number, add the drive's +.\"O number on its controller and 128 if the drive is on the secondary +.\"O controller. +.\"O In the following device tables, \fIn\fP represents the +.\"O drive number. +¥Õ¥í¥Ã¥Ô¡¼¥É¥é¥¤¥Ö¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 2 ¤ò»ý¤Ä¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£ +°ìÈÌŪ¤Ë¤Ï¡¢¤³¤Î¥Ç¥Ð¥¤¥¹¤Î¥ª¡¼¥Ê¡¼¤Ï root.floppy (¥ª¡¼¥Ê¡¼ root¡¢ +¥°¥ë¡¼¥× floppy)¤Ç¡¢¥â¡¼¥É 0660 (¥°¥ë¡¼¥×¤Î¹½À®°÷¤Ç¤¢¤ë¤³¤È¤Ë +¤è¤Ã¤Æ¥¢¥¯¥»¥¹¥Á¥§¥Ã¥¯¤¬¹Ô¤ï¤ì¤ë)¡¢¤Þ¤¿¤Ï¡¢¥â¡¼¥É 0666 (ï¤Ç¤â¥¢¥¯¥»¥¹ +¤Ç¤­¤ë) ¤Ç¤¢¤ë¡£¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼¤Ï¥Ç¥Ð¥¤¥¹¤Î¥¿¥¤¥×¡¢¥É¥é¥¤¥Ö¤ÎÈֹ桢¥³ +¥ó¥È¥í¡¼¥é¡¼¤ÎÈÖ¹æ¤òÉä¹æ²½¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£¤½¤ì¤¾¤ì¤Î¥Ç¥Ð¥¤¥¹¥¿¥¤¥× +(¤³¤ì¤Ï¡¢Ì©ÅÙ (density) ¤È¥È¥é¥Ã¥¯¥«¥¦¥ó¥È (track count) ¤ÎÁȹ礻¤Ç¤¢¤ë) +¤Ï¡¢¥Ù¡¼¥¹¤È¤Ê¤ë¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼¤ò»ý¤Ã¤Æ¤¤¤ë¡£¤³¤Î¥Ù¡¼¥¹¥Ê¥ó¥Ð¡¼¤Ë¤½¤Î +¥³¥ó¥È¥í¡¼¥é¡¼¾å¤Î¥É¥é¥¤¥Ö¥Ê¥ó¥Ð¡¼¤ò²Ã¤¨¤ë¡£¤â¤·¡¢¤½¤Î¥É¥é¥¤¥Ö¤¬ 2 ÈÖÌܤΠ+¥³¥ó¥È¥í¡¼¥é¡¼¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¤Ê¤é¡¢¤µ¤é¤Ë 128 ¤ò²Ã¤¨¤ë¡£¼¡¤Î¥Ç¥Ð¥¤¥¹ +¥Æ¡¼¥Ö¥ë¤Ç¤Ï¡¢ \fIn\fP ¤Ï¥É¥é¥¤¥ÖÈÖ¹æ¤òɽ¤¹¡£ +.PP +.\"O \fBWarning: If you use formats with more tracks +.\"O than supported by your drive, you may cause it mechanical damage.\fP +.\"O Trying once if more tracks than the usual 40/80 are supported should not +.\"O damage it, but no warranty is given for that. +.\"O Don't create device +.\"O entries for those formats to prevent their usage if you are not sure. +·Ù¹ð: ¤â¤·¡¢¥É¥é¥¤¥Ö¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤è¤ê¿¤¯¤Î¥È¥é¥Ã¥¯¤ò»ý¤Ä¤è¤¦¤Ë +¥Õ¥©¡¼¥Þ¥Ã¥È¤·¤è¤¦¤È¤·¤¿¾ì¹ç¡¢µ¡³£Åª¤Ê¥À¥á¡¼¥¸¤ò°ú¤­µ¯¤³¤¹¤«¤âÃΤì¤Ê¤¤¡£ +.PP +ËÝÌõ¼ÔÃí: +°Ê²¼¤Îɽ¤ËÍѤ¤¤é¤ì¤ëÍѸì¤Ïɽ¤ÎÀ°·Á¤Î´Ø·¸¤«¤é +(°ì¹Ô¤Ë¤¦¤Þ¤¯Ç¼¤á¤ë»ö¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¤¿¤á) +¤«¤é¸¶Ê¸¤Î¤Þ¤Þ¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤È¤ÎÂбþ¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ +.TS +l l. +Name ̾Á° +Capac. ÍÆÎÌ +Cyl. ¥·¥ê¥ó¥À¿ô +Sect. ¥»¥¯¥¿¿ô +Heads. ¥Ø¥Ã¥À¿ô +Base minor # ¥Ù¡¼¥¹¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ +.TE + +.\"O Drive independent device files which automatically detect the media +.\"O format and capacity: +¥á¥Ç¥£¥¢¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ÈÍÆÎ̤ò¼«Æ°Åª¤Ë¸¡½Ð¤¹¤ë¥É¥é¥¤¥ÖÈó°Í¸¤Î¥Ç¥Ð¥¤¥¹ +¥Õ¥¡¥¤¥ë: +.TS +l l. +Name Base minor # +_ +\fBfd\fP\fIn\fP 0 +.TE +.PP +.\"O 5.25 inch double density device files: +5.25 ¥¤¥ó¥ÁÇÜÌ©ÅÙ(double density)¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBd360\fP 360K 40 9 2 4 +.TE +.PP +.\"O 5.25 inch high density device files: +5.25 ¥¤¥ó¥Á¹âÌ©ÅÙ(high density)¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBh360\fP 360K 40 9 2 20 +\fBfd\fP\fIn\fP\fBh410\fP 410K 41 10 2 48 +\fBfd\fP\fIn\fP\fBh420\fP 420K 42 10 2 64 +\fBfd\fP\fIn\fP\fBh720\fP 720K 80 9 2 24 +\fBfd\fP\fIn\fP\fBh880\fP 880K 80 11 2 80 +\fBfd\fP\fIn\fP\fBh1200\fP 1200K 80 15 2 8 +\fBfd\fP\fIn\fP\fBh1440\fP 1440K 80 18 2 40 +\fBfd\fP\fIn\fP\fBh1476\fP 1476K 82 18 2 56 +\fBfd\fP\fIn\fP\fBh1494\fP 1494K 83 18 2 72 +\fBfd\fP\fIn\fP\fBh1600\fP 1600K 80 20 2 92 +.TE +.PP +.\"O 3.5 inch double density device files: +3.5 ¥¤¥ó¥ÁÇÜÌ©ÅÙ(double density)¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBD360\fP 360K 80 9 1 12 +\fBfd\fP\fIn\fP\fBD720\fP 720K 80 9 2 16 +\fBfd\fP\fIn\fP\fBD800\fP 800K 80 10 2 120 +\fBfd\fP\fIn\fP\fBD1040\fP 1040K 80 13 2 84 +\fBfd\fP\fIn\fP\fBD1120\fP 1120K 80 14 2 88 +.TE +.PP +.\"O 3.5 inch high density device files: +3.5 ¥¤¥ó¥Á¹âÌ©ÅÙ(high density)¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBH360\fP 360K 40 9 2 12 +\fBfd\fP\fIn\fP\fBH720\fP 720K 80 9 2 16 +\fBfd\fP\fIn\fP\fBH820\fP 820K 82 10 2 52 +\fBfd\fP\fIn\fP\fBH830\fP 830K 83 10 2 68 +\fBfd\fP\fIn\fP\fBH1440\fP 1440K 80 18 2 28 +\fBfd\fP\fIn\fP\fBH1600\fP 1600K 80 20 2 124 +\fBfd\fP\fIn\fP\fBH1680\fP 1680K 80 21 2 44 +\fBfd\fP\fIn\fP\fBH1722\fP 1722K 82 21 2 60 +\fBfd\fP\fIn\fP\fBH1743\fP 1743K 83 21 2 76 +\fBfd\fP\fIn\fP\fBH1760\fP 1760K 80 22 2 96 +\fBfd\fP\fIn\fP\fBH1840\fP 1840K 80 23 2 116 +\fBfd\fP\fIn\fP\fBH1920\fP 1920K 80 24 2 100 +.TE +.PP +.\"O 3.5 inch extra density device files: +3.5 ¥¤¥ó¥Á³Èĥ̩ÅÙ(extra density)¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBE2880\fP 2880K 80 36 2 32 +\fBfd\fP\fIn\fP\fBCompaQ\fP 2880K 80 36 2 36 +\fBfd\fP\fIn\fP\fBE3200\fP 3200K 80 40 2 104 +\fBfd\fP\fIn\fP\fBE3520\fP 3520K 80 44 2 108 +\fBfd\fP\fIn\fP\fBE3840\fP 3840K 80 48 2 112 +.TE +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O \fBfd\fP special files access the floppy disk drives in raw mode. +.\"O The following +.\"O .BR ioctl (2) +.\"O calls are supported by \fBfd\fP devices: +\fBfd\fP ¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ï¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ö¤Ë¥í¡¼¥â¡¼¥É +(raw mode)¤Ç +¥¢¥¯¥»¥¹¤¹¤ë¡£\fBfd\fP ¤Ç¤Ï¡¢¼¡¤Î +.BR ioctl (2) +¥³¡¼¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .IP \fBFDCLRPRM\fP +.\"O clears the media information of a drive (geometry of disk in drive). +.IP \fBFDCLRPRM\fP +¥É¥é¥¤¥Ö¤Î¥á¥Ç¥£¥¢¾ðÊó(¥É¥é¥¤¥ÖÆâ¤Î¥Ç¥£¥¹¥¯¤Î¥¸¥ª¥á¥È¥ê¾ðÊó)¤ò¥¯¥ê¥¢¤¹ +¤ë¡£ +.\"O .IP \fBFDSETPRM\fP +.\"O sets the media information of a drive. +.\"O The media information will be +.\"O lost when the media is changed. +.IP \fBFDSETPRM\fP +¥É¥é¥¤¥Ö¤Î¥á¥Ç¥£¥¢¾ðÊó¤ò¥»¥Ã¥È¤¹¤ë¡£¥á¥Ç¥£¥¢¾ðÊó¤Ï¥á¥Ç¥£¥¢¤¬¸ò´¹¤µ¤ì¤¿ +»þ¡¢¼º¤ï¤ì¤ë¡£ +.\"O .IP \fBFDDEFPRM\fP +.\"O sets the media information of a drive (geometry of disk in drive). +.\"O The media information will not be lost when the media is changed. +.\"O This will disable autodetection. +.\"O In order to reenable autodetection, you +.\"O have to issue an \fBFDCLRPRM\fP. +.IP \fBFDDEFPRM\fP +¥É¥é¥¤¥Ö¤Î¥á¥Ç¥£¥¢¾ðÊó(¥É¥é¥¤¥ÖÆâ¤Î¥Ç¥£¥¹¥¯¤Î¥¸¥ª¥á¥È¥ê¾ðÊó)¤ò¥»¥Ã¥È¤¹ +¤ë¡£¥á¥Ç¥£¥¢¾ðÊó¤Ï¥á¥Ç¥£¥¢¤¬¸ò´¹¤µ¤ì¤¿»þ¤Ç¤â¼º¤ï¤ì¤Ê¤¤¡£¤³¤ì¤Ï(¥á¥Ç¥£ +¥¢¾ðÊó¤Î)¼«Æ°¸¡½Ð¤ò̵¸ú¤Ë¤¹¤ë¡£¼«Æ°¸¡½Ð¤òºÆ¤ÓÍ­¸ú¤Ë¤¹¤ë¤¿¤á¤Ë¡¢ +\fBFDCLRPRM\fP ¤òȯ¹Ô¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .IP \fBFDGETDRVTYP\fP +.\"O returns the type of a drive (name parameter). +.\"O For formats which work +.\"O in several drive types, \fBFDGETDRVTYP\fP returns a name which is +.\"O appropriate for the oldest drive type which supports this format. +.IP \fBFDGETDRVTYP\fP +¥É¥é¥¤¥Ö¤Î¥¿¥¤¥×(̾Á°°ú¿ô)¤òÊÖ¤¹¡£¤½¤ì¤¾¤ì¤Î¥É¥é¥¤¥Ö¥¿¥¤¥×¤ËŬ¹ç¤¹¤ë¤è +¤¦¤Ë¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¹Ô¤¦¤¿¤á¡¢\fBFDGETDRVTYP\fP ¤Ï¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¥µ¥Ý¡¼¥È +¤¹¤ëºÇ¤â¸Å¤¤¥É¥é¥¤¥Ö¥¿¥¤¥×¤Î¤¿¤á¤ËŬÀÚ¤Ê̾Á°¤òÊÖ¤¹¡£ +.\"O .IP \fBFDFLUSH\fP +.\"O invalidates the buffer cache for the given drive. +.IP \fBFDFLUSH\fP +Í¿¤¨¤é¤ì¤¿¥É¥é¥¤¥Ö¤Î¥Ð¥Ã¥Õ¥¡¥­¥ã¥Ã¥·¥å¤ò̵¸ú¤Ë¤¹¤ë¡£ +.\"O .IP \fBFDSETMAXERRS\fP +.\"O sets the error thresholds for reporting errors, aborting the operation, +.\"O recalibrating, resetting, and reading sector by sector. +.IP \fBFDSETMAXERRS\fP +¥¨¥é¡¼¤ÎÊó¹ð¡¢Áàºî¤ÎÃæ»ß¡¢ºÆ»î¹Ô¡¢¥ê¥»¥Ã¥È¡¢¥»¥¯¥¿¡¼Ëè¤ÎÆɤ߹þ¤ß¤Î¤¿¤á +¤Î¥¨¥é¡¼ïçÃͤò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .IP \fBFDSETMAXERRS\fP +.\"O gets the current error thresholds. +.IP \fBFDGETMAXERRS\fP +¸½ºß¤Î¥¨¥é¡¼ïçÃͤòÆÀ¤ë¡£ +.\"O .IP \fBFDGETDRVTYP\fP +.\"O gets the internal name of the drive. +.IP \fBFDGETDRVTYP\fP +¥É¥é¥¤¥Ö¤ÎÆâÉô̾¤òÆÀ¤ë¡£ +.\"O .IP \fBFDWERRORCLR\fP +.\"O clears the write error statistics. +.IP \fBFDWERRORCLR\fP +½ñ¤­¹þ¤ß¥¨¥é¡¼¤ÎÅý·×¤ò¥¯¥ê¥¢¡¼¤¹¤ë¡£ +.\"O .IP \fBFDWERRORGET\fP +.\"O reads the write error statistics. +.\"O These include the total number of +.\"O write errors, the location and disk of the first write error, and the +.\"O location and disk of the last write error. +.\"O Disks are identified by a +.\"O generation number which is incremented at (almost) each disk change. +.IP \fBFDWERRORGET\fP +½ñ¤­¹þ¤ß¥¨¥é¡¼¤ÎÅý·×¤òÆɤࡣÅý·×¤Ï¡¢½ñ¤­¹þ¤ß¥¨¥é¡¼¤Î¹ç·×¡¢ºÇ½é¤Î½ñ¤­¹þ +¤ß¥¨¥é¡¼¤Ï¤É¤Î¥Ç¥£¥¹¥¯¤Î¤É¤³¤Çµ¯¤³¤Ã¤¿¤«¡¢¤½¤·¤Æ¡¢ºÇ¸å¤Î½ñ¤­¹þ¤ß¥¨¥é¡¼ +¤¬¤É¤Î¥Ç¥£¥¹¥¯¤Î¤É¤³¤Çµ¯¤³¤Ã¤¿¤«¤È¤¤¤¦¾ðÊó¤ò´Þ¤ó¤Ç¤¤¤ë¡£¥Ç¥£¥¹¥¯¤Ï¥Ç¥£ +¥¹¥¯¤Î¸ò´¹¤´¤È¤ËÁý¤¨¤ë¥¸¥§¥Í¥ì¡¼¥·¥ç¥óÈÖ¹æ¤Ë¤è¤Ã¤Æ¼±Ê̤µ¤ì¤ë¡£ +.\"O .IP \fBFDTWADDLE\fP +.\"O Switch the drive motor off for a few microseconds. +.\"O This might be +.\"O needed in order to access a disk whose sectors are too close together. +.IP \fBFDTWADDLE\fP +¿ô¥ß¥êÉäδ֥ɥ饤¥Ö¤Î¥â¡¼¥¿¡¼¤Î¥¹¥¤¥Ã¥Á¤òÀڤ롣¤³¤ì¤Ï¥Ç¥£¥¹¥¯¤Î¥»¥¯¥¿¡¼ +Ʊ»Î¤¬Àܶᤷ¤¹¤®¤Æ¤¤¤ë¥Ç¥£¥¹¥¯¤Î¥¢¥¯¥»¥¹¤Î¤¿¤á¤ËɬÍפǤ¢¤í¤¦¡£ +.\"O .IP \fBFDSETDRVPRM\fP +.\"O sets various drive parameters. +.IP \fBFDSETDRVPRM\fP +¥É¥é¥¤¥Ö¤ÎÍÍ¡¹¤Ê¥Ñ¥é¥á¡¼¥¿¤ò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .IP \fBFDGETDRVPRM\fP +.\"O reads these parameters back. +.IP \fBFDGETDRVPRM\fP +(\fBFDSETDRVPRM\fP ¤ò»È¤Ã¤Æ¥»¥Ã¥È¤·¤¿)¥Ñ¥é¥á¡¼¥¿¤òÆɤߤÀ¤¹¡£ +.\"O .IP \fBFDGETDRVSTAT\fP +.\"O gets the cached drive state (disk changed, write protected et al.) +.IP \fBFDGETDRVSTAT\fP +¥­¥ã¥Ã¥·¥å¤µ¤ì¤Æ¤¤¤ë¥É¥é¥¤¥Ö¤Î¾õÂÖ(¥Ç¥£¥¹¥¯¤Î¸ò´¹¡¢¥é¥¤¥È¥×¥í¥Æ¥¯¥È¤Ê +¤É)¤òÆÀ¤ë¡£ +.\"O .IP \fBFDPOLLDRVSTAT\fP +.\"O polls the drive and return its state. +.IP \fBFDPOLLDRVSTAT\fP +¥É¥é¥¤¥Ö¤ò¥Ý¡¼¥ê¥ó¥°¤·¤Æ¡¢¤½¤Î¾õÂÖ¤òÊÖ¤¹¡£ +.\"O .IP \fBFDGETFDCSTAT\fP +.\"O gets the floppy controller state. +.IP \fBFDGETFDCSTAT\fP +¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¡¼¤Î¾õÂÖ¤òÆÀ¤ë¡£ +.\"O .IP \fBFDRESET\fP +.\"O resets the floppy controller under certain conditions. +.IP \fBFDRESET\fP +¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¡¼¤ò¿®Íê¤Ç¤­¤ë¾õÂ֤˥ꥻ¥Ã¥È¤¹¤ë¡£ +.\"O .IP \fBFDRAWCMD\fP +.\"O sends a raw command to the floppy controller. +.IP \fBFDRAWCMD\fP +¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¡¼¤ËÄã¥ì¥Ù¥ë¤Î¥³¥Þ¥ó¥É(raw command)¤òÁ÷¤ë¡£ +.PP +.\"O For more precise information, consult also the \fI\fP and +.\"O \fI\fP include files, as well as the manual page for +.\"O floppycontrol. +¤è¤êÀµ³Î¤Ê¾ðÊó¤Î¤¿¤á¤Ë¤Ï¡¢¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¡¼¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï¤â¤Á¤í +¤ó¡¢\fI\fP ¤È \fI\fP ¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤â»²¾È¤Î¤³¤È¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +/dev/fd* +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The various formats allow to read and write many types of disks. +.\"O However, if a floppy is formatted with a too small inter sector gap, +.\"O performance may drop, up to needing a few seconds to access an entire +.\"O track. +.\"O To prevent this, use interleaved formats. +.\"O It is not possible to +.\"O read floppies which are formatted using GCR (group code recording), +.\"O which is used by Apple II and Macintosh computers (800k disks). +.\"O Reading floppies which are hard sectored (one hole per sector, with +.\"O the index hole being a little skewed) is not supported. +.\"O This used to be common with older 8 inch floppies. +ÍÍ¡¹¤Ê¥Ç¥£¥¹¥¯¤Î¥¿¥¤¥×¤ÇÍÍ¡¹¤Ê¼ïÎà¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ÎÆɤ߽ñ¤­¤¬µö¤µ¤ì¤Æ¤¤ +¤ë¡£¤·¤«¤·¡¢¤â¤·¥»¥¯¥¿´Ö¤Î¥®¥ã¥Ã¥×¤¬¾®¤µ¤¹¤®¤ë¤è¤¦¤Ë¥Õ¥í¥Ã¥Ô¡¼¤¬¥Õ¥©¡¼ +¥Þ¥Ã¥È¤µ¤ì¤¿¤Ê¤é¤Ð¡¢¥È¥é¥Ã¥¯Á´ÂΤΥ¢¥¯¥»¥¹¤Ë¿ôÉÃɬÍפˤʤ뤿¤áÀ­Ç½¤¬Äã +²¼¤¹¤ë¤À¤í¤¦¡£¤³¤ì¤òËɤ°¤¿¤á¤Ë¤Ï¡¢¥¤¥ó¥¿¡¼¥ê¡¼¥Ö¥É¡¦¥Õ¥©¡¼¥Þ¥Ã¥È +(interleaved format) ¤òÍѤ¤¤ë¡£ +.\"O .\" .SH AUTHORS +.\" .SH Ãø¼Ô +.\" Alain Knaff (Alain.Knaff@imag.fr), David Niemi +.\" (niemidc@clark.net), Bill Broadhurst (bbroad@netcom.com). +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR floppycontrol (1), +.BR getfdprm (1), +.BR mknod (1), +.BR superformat (1), +.BR mount (8), +.BR setfdprm (8) +ËÝÌõ +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ diff --git a/draft/man4/full.4 b/draft/man4/full.4 new file mode 100644 index 00000000..15d7d87c --- /dev/null +++ b/draft/man4/full.4 @@ -0,0 +1,81 @@ +.\" -*- nroff -*- +.\" +.\" This man-page is Copyright (C) 1997 John S. Kallal +.\" +.\" 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. +.\" +.\" correction, aeb, 970825 +.\" +.\" Japanese Version Copyright (c) 1998 +.\" ISHIKAWA Mutsumi, all rights reserved. +.\" +.\" Translated into Japanese Mon Jan 12 02:59:50 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated 2006-07-20, Akihiro MOTOKI , LDP v2.34 +.\" +.TH FULL 4 2007-11-24 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O full \- always full device +.SH ̾Á° +full \- ¤¤¤Ä¤â full ¤Ç¤¢¤ë¥Ç¥Ð¥¤¥¹ +.\"O .SH CONFIGURATION +.SH ÀßÄê +.\"O If your system does not have \fI/dev/full\fP created already, it +.\"O can be created with the following commands: +¥·¥¹¥Æ¥à¤ËºîÀ®ºÑ¤ß¤Î \fI/dev/full\fP ¤¬¤Ê¤¤¾ì¹ç¡¢ +¼¡¤Î¥³¥Þ¥ó¥É¤Ë¤è¤êºîÀ®¤Ç¤­¤ë¡£ +.nf + + mknod \-m 666 /dev/full c 1 7 + chown root:root /dev/full +.fi +.\"O .SH DESCRIPTION +.\"O File \fI/dev/full\fP has major device number 1 +.\"O and minor device number 7. +.SH ÀâÌÀ +\fI/dev/full\fP ¤Ï¡¢¥á¥¸¥ã¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 1¡¢ +¥Þ¥¤¥Ê¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 7 ¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.LP +.\"O Writes to the \fI/dev/full\fP device will fail with an +.\"O .B ENOSPC +.\"O error. +.\"O This can be used to test how a program handles disk-full errors. +\fI/dev/full\fP ¥Ç¥Ð¥¤¥¹¤Ø¤Î½ñ¤­¹þ¤ß¤Ï¡¢ +.B ENOSPC +¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¡£ +¤³¤ÎÆ°ºî¤ò»È¤Ã¤Æ¡¢¥×¥í¥°¥é¥à¤¬¥Ç¥£¥¹¥¯¥Õ¥ë¤Î¥¨¥é¡¼¤ò¤É¤Î¤è¤¦¤Ë +½èÍý¤¹¤ë¤«¤ò¥Æ¥¹¥È¤Ç¤­¤ë¡£ + +.\"O Reads from the \fI/dev/full\fP device will return \\0 characters. +\fI/dev/full\fP ¥Ç¥Ð¥¤¥¹¤«¤é¤ÎÆɤ߽Ф·¤Ç¤Ï¡¢\\0 ʸ»ú(¥Ì¥ëʸ»ú)¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\"O Seeks on \fI/dev/full\fP will always succeed. +\fI/dev/full\fP ¤Î¥·¡¼¥¯ (seek) ¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +/dev/full +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mknod (1), +.BR null (4), +.BR zero (4) +.\"O .SH ËÝÌõ¼Ô +.\"O ÀÐÀî ËÓ diff --git a/draft/man4/hd.4 b/draft/man4/hd.4 new file mode 100644 index 00000000..4931b17e --- /dev/null +++ b/draft/man4/hd.4 @@ -0,0 +1,161 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 16:56:20 1993 by Rik Faith +.\" Modified Mon Oct 21 21:38:51 1996 by Eric S. Raymond +.\" (and some more by aeb) +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Sun Jan 11 03:35:23 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Thu Feb 5 17:36:37 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: hard disk drive ¥Ï¡¼¥É¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ö +.\" WORD: block device ¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ +.\" WORD: primary ¥×¥é¥¤¥Þ¥ê +.\" WORD: controller ¥³¥ó¥È¥í¡¼¥é +.\" WORD: master drive ¥Þ¥¹¥¿¡¼¥É¥é¥¤¥Ö +.\" WORD: slave drive ¥¹¥ì¡¼¥Ö¥É¥é¥¤¥Ö +.\" WORD: pertition ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó +.\" WORD: logical partition ÏÀÍý¥Ñ¡¼¥Æ¥£¥·¥ç¥ó +.\" WORD: pertitioning ¥Ñ¡¼¥Æ¥£¥·¥ç¥Ë¥ó¥° +.\" WORD: BSD-disklabel BSD ¥Ç¥£¥¹¥¯¥é¥Ù¥ë +.\" +.TH HD 4 1992-12-17 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O hd \- MFM/IDE hard disk devices +hd \- MFM/IDE ¥Ï¡¼¥É¥Ç¥£¥¹¥¯¥Ç¥Ð¥¤¥¹ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The \fBhd*\fP devices are block devices to access MFM/IDE hard disk drives +.\"O in raw mode. +.\"O The master drive on the primary IDE controller (major device +.\"O number 3) is \fBhda\fR; the slave drive is \fBhdb\fR. +.\"O The master drive of the second controller (major device number 22) +.\"O is \fBhdc\fR and the slave \fBhdd\fR. +\fBhd*\fP ¥Ç¥Ð¥¤¥¹¤Ï MFM/IDE ¥Ï¡¼¥É¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ö¤Ë¥í¡¼¥â¡¼¥É (raw mode) +¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ (block device) ¤Ç¤¢¤ë¡£¥×¥é¥¤¥Þ¥ê +(primary) IDE ¥³¥ó¥È¥í¡¼¥é (¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 3) ¤Î ¥Þ¥¹¥¿¡¼¥É¥é¥¤¥Ö +(mater drive) ¤Ï \fBhda\fR¡¢¥¹¥ì¡¼¥Ö¥É¥é¥¤¥Ö (slave drive) ¤Ï \fBhdb\fR +¤Ç¤¢¤ë¡£¤Þ¤¿¡¢¥»¥«¥ó¥É¥³¥ó¥È¥í¡¼¥é (¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 22) ¤Î¥Þ¥¹¥¿¡¼ +¥É¥é¥¤¥Ö¤Ï \fBhdc\fR ¥¹¥ì¡¼¥Ö¤Ï \fBhdd\fR ¤Ç¤¢¤ë¡£ +.LP +.\"O General IDE block device names have the form +.\"O .BI hd X\c +.\"O , or +.\"O .BI hd XP\c +.\"O , where +.\"O .I X +.\"O is a letter denoting the physical drive, and +.\"O .I P +.\"O is a number denoting the partition on that physical drive. +.\"O The first form, +.\"O .BI hd X, +.\"O is used to address the whole drive. +°ìÈÌŪ¤Ê IDE ¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Î̾Á°¤Ï +.BI hd X\c +¤Þ¤¿¤Ï¡¢ +.BI hd XP\c +¤È¤¤¤¦·ÁÂÖ¤ò¤È¤ë¡£¤³¤Î¡¢ +.I X +¤ÎÉôʬ¤ÏʪÍýŪ¤Ê¥É¥é¥¤¥Ö¤òɽ¤¹Ê¸»ú¤Ç¡¢ +.I P +¤ÎÉôʬ¤Ï¤½¤ÎʪÍýŪ¤Ê¥É¥é¥¤¥Ö¾å¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó (partition) ¤òɽ¤¹¿ô»ú¤Ç +¤¢¤ë¡£¤³¤ÎºÇ½é¤Î·Á¼° +.BI hd X, +¤Ï¥É¥é¥¤¥ÖÁ´ÂΤò¼¨¤¹¤Î¤Ë»È¤ï¤ì¤ë¡£ +.\"O Partition numbers are assigned in the order the partitions +.\"O are discovered, and only nonempty, nonextended partitions +.\"O get a number. +.\"O However, partition numbers 1-4 are given to the +.\"O four partitions described in the MBR (the "primary" partitions), +.\"O regardless of whether they are unused or extended. +.\"O Thus, the first logical partition will be +.\"O .BI hd X 5\c +.\"O \&. +.\"O Both DOS-type partitioning and BSD-disklabel partitioning are supported. +.\"O You can have at most 63 partitions on an IDE disk. +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Ê¥ó¥Ð¡¼¤Ïȯ¸«¤µ¤ì¤¿¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ë½ç¤Ë³ä¤êÉÕ¤±¤é¤ì¤ë¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Ê¥ó¥Ð¡¼¤¬³ä¤êÉÕ¤±¤é¤ì¤ë¤Î¤Ï¡¢¶õ¤Ç¤Ê¤¯ (nonempty) ¤«¤Ä +³ÈÄ¥¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ç¤Ê¤¤ (nonextended) ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¤ß¤Ç¤¢¤ë¡£ +¤³¤Î¤¦¤Á¡¢¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Ê¥ó¥Ð¡¼ 1 ¤«¤é 4 ¤Ï¤½¤ì¤¬»È¤ï¤ì¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢ +¤Þ¤¿³ÈÄ¥¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤À¤È¤·¤Æ¤â MBR ¤Ëµ­½Ò¤µ¤ì¤ë»Í¤Ä¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó +(¤¤¤ï¤æ¤ë¡¢¥×¥é¥Þ¥ê'¥Ñ¡¼¥Æ¥£¥·¥ç¥ó) ¤ËÍ¿¤¨¤é¤ì¤ë¡£ +½¾¤Ã¤Æ¡¢ºÇ½é¤ÎÏÀÍý¥Ñ¡¼¥Æ¥£¥·¥ç¥ó (logical pertition) ¤Ï¡¢ +.BI hd X 5\c +¤È¤Ê¤ë¤À¤í¤¦¡£ +(IDE ¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤Ç¤Ï) DOS ¥¿¥¤¥×¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥Ë¥ó¥° (partitioning) +¤È BSD ¥Ç¥£¥¹¥¯¥é¥Ù¥ë (BSD-disklabel) ¤Ë¤è¤ë¥Ñ¡¼¥Æ¥£¥·¥ç¥Ë¥ó¥°¤ÎξÊý¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£¤Þ¤¿¡¢IDE ¥Ç¥£¥¹¥¯¾å¤ËºÇ¹â 63 ¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ò +ºîÀ®¤¹¤ë»ö¤¬¤Ç¤­¤ë¡£ +.LP +.\"O For example, +.\"O .I /dev/hda +.\"O refers to all of the first IDE drive in the system; and +.\"O .I /dev/hdb3 +.\"O refers to the third DOS "primary" partition on the second one. +Î㤨¤Ð¡¢ +.I /dev/hda +¤Ï¥·¥¹¥Æ¥à¤ÎºÇ½é¤Î IDE ¥É¥é¥¤¥ÖÁ´ÂΤò»²¾È¤¹¤ë¡£¤½¤·¤Æ¡¢ +.I /dev/hdb3 +¤Ï¥»¥«¥ó¥É¥É¥é¥¤¥Ö¤Î»°¤Ä¤á¤Î DOS `¥×¥é¥¤¥Þ¥ê'¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ò»²¾È¤¹¤ë¡£ +.LP +.\"O They are typically created by: +¤³¤ì¤é¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë (device file) ¤Ïŵ·¿Åª¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤é¤ì¤ë¡£ +.RS +.sp +mknod \-m 660 /dev/hda b 3 0 +.br +mknod \-m 660 /dev/hda1 b 3 1 +.br +mknod \-m 660 /dev/hda2 b 3 2 +.br +\&... +.br +mknod \-m 660 /dev/hda8 b 3 8 +.br +mknod \-m 660 /dev/hdb b 3 64 +.br +mknod \-m 660 /dev/hdb1 b 3 65 +.br +mknod \-m 660 /dev/hdb2 b 3 66 +.br +\&... +.br +mknod \-m 660 /dev/hdb8 b 3 72 +.br +chown root:disk /dev/hd* +.RE +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +/dev/hd* +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR sd (4) +.BR mount (8), diff --git a/draft/man4/initrd.4 b/draft/man4/initrd.4 new file mode 100644 index 00000000..9ed425bd --- /dev/null +++ b/draft/man4/initrd.4 @@ -0,0 +1,857 @@ +.\" -*- nroff -*- +.\" This man-page is Copyright (C) 1997 John S. Kallal +.\" +.\" 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 author(s) of this work. +.\" +.\" If the you wish to distribute versions of this work under other +.\" conditions than the above, please contact the author(s) at the following +.\" for permission: +.\" +.\" John S. Kallal - +.\" email: +.\" mail: 518 Kerfoot Farm RD, Wilmington, DE 19803-2444, USA +.\" phone: (302)654-5478 +.\" +.\" $Id: initrd.4,v 1.1.1.1 1999/07/19 01:49:27 cvs Exp $ +.\" +.\" Japanese Version Copyright (c) 1997,1998 +.\" ISHIKAWA Mutsumi, all rights reserved. +.\" Translated 1997-12-15, ISHIKAWA Mutsumi +.\" Modified 1998-02-09, ISHIKAWA Mutsumi +.\" Updated & Modified 2005-10-08, Akihiro MOTOKI +.\" +.TH INITRD 4 2009-04-04 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O initrd \- boot loader initialized RAM disk +initrd \- ¥Ö¡¼¥È¥í¡¼¥À¤Ë¤è¤Ã¤Æ½é´ü²½¤µ¤ì¤¿ RAM ¥Ç¥£¥¹¥¯ +.\"O .SH CONFIGURATION +.SH ÀßÄê +.\"O The +.\"O .I /dev/initrd +.\"O is a read-only block device assigned +.\"O major number 1 and minor number 250. +.\"O Typically +.\"O .I /dev/initrd +.\"O is owned by +.\"O .I root.disk +.\"O with mode 0400 (read access by root only). +.\"O If the Linux system does not have +.\"O .I /dev/initrd +.\"O already created, it can be created with the following commands: +.I /dev/initrd +¤Ï¡¢¥á¥¸¥ã¡¼ÈÖ¹æ 1¡¢¥Þ¥¤¥Ê¡¼ÈÖ¹æ 250 ¤¬³ä¤êÅö¤Æ¤é¤ì¤¿ +Æɤ߹þ¤ßÀìÍѤΥ֥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£ +ÉáÄÌ¡¢ +.I /dev/initrd +¤Î½êÍ­¼Ô¤Ï +.I root.disk +¤Ç¤¢¤ê¡¢¥â¡¼¥É¤Ï 400 (root ¤Î¤ß¤¬Æɤ߽Ф·²Äǽ) ¤Ç¤¢¤ë¡£ +¤â¤·¡¢Linux ¥·¥¹¥Æ¥à¤ËºîÀ®ºÑ¤Î +.I /dev/initrd +¥Õ¥¡¥¤¥ë¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤ÇºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë: +.nf +\fB + mknod \-m 400 /dev/initrd b 1 250 + chown root:disk /dev/initrd +\fP +.fi +.PP +.\"O Also, support for both "RAM disk" and "Initial RAM disk" +.\"O (e.g. +.\"O .BR CONFIG_BLK_DEV_RAM=y +.\"O and +.\"O .BR CONFIG_BLK_DEV_INITRD=y ) +.\"O must be compiled directly into the Linux kernel to use +.\"O .IR /dev/initrd . +.\"O When using +.\"O .IR /dev/initrd , +.\"O the RAM disk driver cannot be loaded as a module. +¤Þ¤¿¡¢ +.I /dev/initrd +¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +"RAM disk" ¤È "Initial RAM disk" ¤ÎξÊý¤Îµ¡Ç½¤¬ +Linux ¥«¡¼¥Í¥ë¤ËľÀÜÁȤ߹þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(Î㤨¤Ð¡¢¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤ÎÀßÄê¤Ç +.B CONFIG_BLK_DEV_RAM=y +¤«¤Ä +.B CONFIG_BLK_DEV_INITRD=y +¤È¤¹¤ë)¡£ +.I /dev/initrd +¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ë¤Ï¡¢RAM ¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ð¤ò¥â¥¸¥å¡¼¥ë¤È¤·¤Æ +¥í¡¼¥É¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\" +.\" +.\" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The special file +.\"O .I /dev/initrd +.\"O is a read-only block device. +.\"O This device is a RAM disk that is initialized (e.g., loaded) +.\"O by the boot loader before the kernel is started. +.\"O The kernel then can use +.\"O .IR /dev/initrd "'s " +.\"O contents for a two-phase system boot-up. +.I /dev/initrd +¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤ÏÆɤ߹þ¤ßÀìÍѤΥ֥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£ +¤³¤Î¥Ç¥Ð¥¤¥¹¤Ï¥«¡¼¥Í¥ë¤¬µ¯Æ°¤µ¤ì¤ëÁ°¤Ë¥Ö¡¼¥È¥í¡¼¥À (boot loader) +¤Ë¤è¤Ã¤Æ½é´ü²½ (Î㤨¤Ð¡¢¥í¡¼¥É) ¤µ¤ì¤ë RAM ¥Ç¥£¥¹¥¯¤Ç¤¢¤ë¡£ +¤½¤Î¸å¡¢¥«¡¼¥Í¥ë¤Ï +.I /dev/initrd +¤ÎÆâÍƤòÆóÃʳ¬¤Î¥·¥¹¥Æ¥àµ¯Æ° (two-phase system boot-up) +¤ÇÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O In the first boot-up phase, the kernel starts up +.\"O and mounts an initial root file-system from the contents of +.\"O .I /dev/initrd +.\"O (e.g., RAM disk initialized by the boot loader). +.\"O In the second phase, additional drivers or other modules +.\"O are loaded from the initial root device's contents. +.\"O After loading the additional modules, a new root file system +.\"O (i.e., the normal root file system) is mounted from a +.\"O different device. +ºÇ½é¤Î¥Ö¡¼¥È¥¢¥Ã¥×Ãʳ¬ (first boot-up phase) ¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤Ï +(Î㤨¤Ð¡¢¥Ö¡¼¥È¥í¡¼¥À¤Ë¤è¤Ã¤Æ½é´ü²½¤µ¤ì¤¿ RAM disk ¤Ç¤¢¤ë) +.I /dev/initrd +¤ÎÆâÍƤò½é´ü¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à (root file-system) ¤È¤·¤Æ¥Þ¥¦¥ó¥È +¤·¤Æµ¯Æ°¤¹¤ë¡£ +ÂèÆóÃʳ¬¤Ç¤Ï½é´ü¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤â¤Î¤«¤é¡¢ÄɲäΥɥ饤 +¥Ð¤ä¤½¤Î¾¤Î¥â¥¸¥å¡¼¥ë¤¬¥í¡¼¥É¤µ¤ì¤ë¡£ +ÄɲäΥ⥸¥å¡¼¥ë¤¬¥í¡¼¥É¤µ¤ì¤¿¸å¡¢¿·¤·¤¤¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +(¤¹¤Ê¤ï¤Á¡¢Ä̾ï»þ¤Î¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à) +¤¬Ê̤ΥǥХ¤¥¹¤«¤é¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +.\" +.\" +.\" +.\"O .SS "Boot-up Operation" +.SS ¥Ö¡¼¥È¥¢¥Ã¥×ºî¶È +.\"O When booting up with +.\"O .BR initrd , +.\"O the system boots as follows: +.B initrd +¤òÍøÍѤ·¤¿»þ¤Ï¡¢¥·¥¹¥Æ¥à¤Ï¼¡¤Î¤è¤¦¤Ë¥Ö¡¼¥È¤¹¤ë: +.IP 1. 3 +.\"O The boot loader loads the kernel program and +.\"O .IR /dev/initrd 's +.\"O contents into memory. +¥Ö¡¼¥È¥í¡¼¥À¤Ï¥«¡¼¥Í¥ë¥×¥í¥°¥é¥à¤È +.I /dev/initrd +¤ÎÆâÍƤò¥á¥â¥ê¤Ë¥í¡¼¥É¤¹¤ë¡£ +.IP 2. +.\"O On kernel startup, +.\"O the kernel uncompresses and copies the contents of the device +.\"O .I /dev/initrd +.\"O onto device +.\"O .I /dev/ram0 +.\"O and then frees the memory used by +.\"O .IR /dev/initrd . +¥«¡¼¥Í¥ëµ¯Æ°»þ¡¢¥«¡¼¥Í¥ë¤Ï +.I /dev/initrd +¥Ç¥Ð¥¤¥¹¤ÎÆâÍƤòŸ³« (uncompress) ¤·¡¢ +.I /dev/ram0 +¤Ë¥³¥Ô¡¼¤¹¤ë¡£¤µ¤é¤Ë¡¢ +.I /dev/initrd +¤Î»È¤Ã¤Æ¤¤¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£ +.IP 3. +.\"O The kernel then read-write mounts the device +.\"O .I /dev/ram0 +.\"O as the initial root file system. +¥«¡¼¥Í¥ë¤Ï +.I /dev/ram0 +¥Ç¥Ð¥¤¥¹¤ò½é´ü¤Î¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤·¤ÆÆɤ߽ñ¤­²Äǽ¤Ê·Á¼°¤Ç¥Þ¥¦¥ó +¥È¤¹¤ë¡£ +.IP 4. +.\"O If the indicated normal root file system is also the initial +.\"O root file-system (e.g. +.\"O .IR /dev/ram0 ) +.\"O then the kernel skips to the last step for the usual boot sequence. +»Ø¼¨¤µ¤ì¤¿¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬½é´ü¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +(Î㤨¤Ð +.IR /dev/ram0 ) +¤ÈƱ°ì¤Î¾ì¹ç¤Ï¡¢¥«¡¼¥Í¥ë¤ÏÉáÄ̤Υ֡¼¥È¥·¡¼¥±¥ó¥¹¤Î¤¿¤á¤ÎºÇ¸å¤Î¥¹¥Æ¥Ã¥×¤ò +¾Êά¤¹¤ë¡£ +.IP 5. +.\"O If the executable file +.\"O .IR /linuxrc +.\"O is present in the initial root file-system, +.\"O .I /linuxrc +.\"O is executed with UID 0. +.\"O (The file +.\"O .I /linuxrc +.\"O must have executable permission. +.\"O The file +.\"O .I /linuxrc +.\"O can be any valid executable, including a shell script.) +.I /linuxrc +¤È¤¤¤¦¼Â¹Ô²Äǽ¤Ê¥Õ¥¡¥¤¥ë¤¬½é´ü¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ì¤Ð¡¢ +.I /linuxrc +¤ò UID 0 (¤¹¤Ê¤ï¤Á¡¢root) ¤Î¸¢¸Â¤Ç¼Â¹Ô¤¹¤ë¡£ +.RI ( /linuxrc +¥Õ¥¡¥¤¥ë¤Ï¼Â¹Ô²Äǽ¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I /linuxrc +¤ÏÀµÅö¤Ê¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ç¤¢¤ì¤Ð¤è¤¯¡¢¥·¥§¥ë¥¹¥¯¥ê¥×¥È¤Ç¤â¹½¤ï¤Ê¤¤¡£) +.IP 6. +.\"O If +.\"O .I /linuxrc +.\"O is not executed or when +.\"O .I /linuxrc +.\"O terminates, the normal root file system is mounted. +.\"O (If +.\"O .I /linuxrc +.\"O exits with any file-systems mounted on the initial root +.\"O file-system, then the behavior of the kernel is +.\"O .BR UNSPECIFIED . +.\"O See the NOTES section for the current kernel behavior.) +.I /linuxrc +¤¬¼Â¹Ô¤µ¤ì¤Ê¤¤¡¢¤Þ¤¿¤Ï¡¢ +.I /linuxrc +¤Î¼Â¹Ô¤¬½ªÎ»¤·¤¿»þ¤Ï¡¢Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +.RI ( /linuxrc +¤ò½ªÎ»¤·¤¿»þ¡¢²¿¤é¤«¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬½é´ü¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ë +¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¥«¡¼¥Í¥ë¤ÎÆ°ºî¤Ï +\fB·è¤á¤é¤ì¤Æ¤¤¤Ê¤¤ (ÉÔÄê¤Ç¤¢¤ë)\fR¡£ +¸½ºß¤Î¥«¡¼¥Í¥ë¤¬¤É¤Î¤è¤¦¤ËÆ°ºî¤¹¤ë¤«¤Ï¡¢ +¡ÖÃí°Õ¡×¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È¤Î¤³¤È¡£) +.IP 7. +.\"O If the normal root file system has a directory +.\"O .IR /initrd , +.\"O the device +.\"O .I /dev/ram0 +.\"O is moved from +.\"O .IR / +.\"O to +.\"O .IR /initrd . +.\"O Otherwise if the directory +.\"O .IR /initrd +.\"O does not exist, the device +.\"O .I /dev/ram0 +.\"O is unmounted. +.\"O (When moved from +.\"O .IR / +.\"O to +.\"O .IR /initrd , +.\"O .I /dev/ram0 +.\"O is not unmounted and therefore processes can remain running from +.\"O .IR /dev/ram0 . +.\"O If directory +.\"O .I /initrd +.\"O does not exist on the normal root file system +.\"O and any processes remain running from +.\"O .IR /dev/ram0 +.\"O when +.\"O .I /linuxrc +.\"O \"O exits, the behavior of the kernel is +.\"O .BR UNSPECIFIED . +.\"O See the NOTES section for the current kernel behavior.) +Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë +¥Ç¥£¥ì¥¯¥È¥ê +.I /initrd +¤¬¤¢¤ì¤Ð¡¢ +.I /dev/ram0 +¥Ç¥Ð¥¤¥¹¤Ï +.I / +¤«¤é +.I /initrd +¤Ë°ÜÆ°¤µ¤ì¤ë¡£ +.I /initrd +¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢ +.I /dev/ram0 +¤Ï¥¢¥ó¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +.RI ( / +¤¬ +.I /initrd +¤Ë°ÜÆ°¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +.I /dev/ram0 +¤Ï¥¢¥ó¥Þ¥¦¥ó¥È¤µ¤ì¤º¡¢¤½¤Î·ë²Ì¡¢ +.I /dev/ram0 +¤ÇÁö¤ê»Ï¤á¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¤Þ¤Þ»Ä¤ë»ö¤¬¤Ç¤­¤ë¡£ +¤â¤·¡¢ +.I /initrd +¥Ç¥£¥ì¥¯¥È¥ê¤¬Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¸ºß¤»¤º¡¢ +.I /linuxrc +¤¬½ªÎ»¤·¤¿»þ¤Ë +.I /dev/ram0 +¾å¤Ç¼Â¹Ô¤µ¤ì¤¿¡¢¤Ê¤ó¤é¤«¤Î¥×¥í¥»¥¹¤¬Áö¤ê³¤±¤Æ¤¤¤¿¾ì¹ç¤Î +¥«¡¼¥Í¥ë¤ÎÆ°ºî¤Ï +.BR "·è¤á¤é¤ì¤Æ¤¤¤Ê¤¤ (ÉÔÄê¤Ç¤¢¤ë)" ¡£ +¸½ºß¤Î¥«¡¼¥Í¥ë¤¬¡¢¤³¤Î»þ¤É¤Î¤è¤¦¤ÊÆ°ºî¤ò¤¹¤ë¤«¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +¡ÖÃí°Õ¡×¤ò»²¾È¤Î¤³¤È¡£) +.IP 8. +.\"O The usual boot sequence (e.g., invocation of +.\"O .IR /sbin/init ) +.\"O is performed on the normal root file system. +ÉáÄ̤Υ֡¼¥È¥·¡¼¥±¥ó¥¹ (Î㤨¤Ð¡¢ +.I /sbin/init +¤Îµ¯Æ°) ¤¬Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ç¹Ô¤ï¤ì¤ë¡£ +.\" +.\" +.\" +.\"O .SS Options +.SS ¥ª¥×¥·¥ç¥ó +.\"O The following boot loader options, when used with +.\"O .BR initrd , +.\"O affect the kernel's boot-up operation: +.B initrd +¤òÍѤ¤¤ë¾ì¹ç¤Ë¡¢¥«¡¼¥Í¥ë¤Î¥Ö¡¼¥È¥¢¥Ã¥×Áàºî¤Ë±Æ¶Á¤òÍ¿¤¨¤ë +¥Ö¡¼¥È¥í¡¼¥À¡¦¥ª¥×¥·¥ç¥ó¤Ï¼¡¤Î¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ë¡¢ +.TP +.\"O .BI initrd= "filename" +.\"O Specifies the file to load as the contents of +.\"O .IR /dev/initrd . +.\"O For +.\"O .B LOADLIN +.\"O this is a command-line option. +.\"O For +.\"O .B LILO +.\"O you have to use this command in the +.\"O .B LILO +.\"O configuration file +.\"O .IR /etc/lilo.config . +.\"O The filename specified with this +.\"O option will typically be a gzipped file-system image. +.BI initrd= "filename" +.I /dev/initrd +¤ÎÆâÍƤȤ·¤Æ¥í¡¼¥É¤¹¤ë¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¡£ +.B LOADLIN +¤Ç¤Ï¡¢¤³¤ì¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +.B LILO +¤Ç¤Ï¡¢ +.B LILO +¤ÎÀßÄê¥Õ¥¡¥¤¥ë +.I /etc/lilo.config +Æâ¤Ç¥³¥Þ¥ó¥É¤È¤·¤Æ»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ï¡¢Â¿¤¯¤Î¾ì¹ç gzip °µ½Ì¤µ¤ì¤¿ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¤¥á¡¼¥¸¤Ç¤¢¤ë¡£ +.TP +.\"O .I noinitrd +.\"O This boot option disables the two-phase boot-up operation. +.\"O The kernel performs the usual boot sequence as if +.\"O .I /dev/initrd +.\"O was not initialized. +.\"O With this option, any contents of +.\"O .I /dev/initrd +.\"O loaded into memory by the boot loader contents are preserved. +.\"O This option permits the contents of +.\"O .I /dev/initrd +.\"O to be any data and need not be limited to a file system image. +.\"O However, device +.\"O .I /dev/initrd +.\"O is read-only and can be read only one time after system startup. +.B noinitrd +¤³¤Îµ¯Æ°¥ª¥×¥·¥ç¥ó¤ÏÆóÃʳ¬¤Îµ¯Æ°Áàºî¤ò̵¸ú¤Ë¤¹¤ë¡£ +¥«¡¼¥Í¥ë¤Ï +.I /dev/initrd +¤¬½é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤ÈƱÍͤΡ¢Ä̾ï¤Î¥Ö¡¼¥È¥¢¥Ã¥×Æ°ºî¤ò¹Ô¤¦¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È¡¢¥Ö¡¼¥È¥í¡¼¥À¤Ë¤è¤Ã¤Æ¥á¥â¥ê¾å¤Ë¥í¡¼¥É¤µ¤ì¤¿ +.I /dev/initrd +¤ÎÆâÍƤϤ½¤Î¤Þ¤ÞÊݸ¤µ¤ì¤ë¡£ +¤Ä¤Þ¤ê¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢ +.I /dev/initrd +¤ÎÆâÍƤò (¥Ö¡¼¥È°Ê³°¤ÎÌÜŪ¤Ë) ÍøÍѤ¹¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤ë¡£¤Þ¤¿¡¢¤½¤ÎÆâÍÆ¤Ï +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¤¥á¡¼¥¸¤Ë¸ÂÄꤵ¤ì¤Ê¤¤¡£ +¤·¤«¤·¡¢ +.I /dev/initrd +¥Ç¥Ð¥¤¥¹¤ÏÆɤߤÀ¤·¤Î¤ß²Äǽ¤Ç¤¢¤ê¡¢¥·¥¹¥Æ¥à¤Îµ¯Æ°¸å 1 ÅÙ¤·¤«Æɤ߽Ф¹»ö +¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.\"O .BI root= "device-name" +.\"O Specifies the device to be used as the normal root file system. +.\"O .RB "For " LOADLIN +.\"O this is a command-line option. +.\"O .RB "For " LILO " this is a boot time option or +.\"O can be used as an option line in the +.\"O .B LILO +.\"O configuration file +.\"O .IR /etc/lilo.config . +.\"O The device specified by the this option must be a mountable +.\"O device having a suitable root file-system. +.BI root= "device-name" +Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤·¤Æ»È¤ï¤ì¤ë¥Ç¥Ð¥¤¥¹¤ò»ØÄꤹ¤ë¡£ +.B LOADLIN +¤Ç¤Ï¡¢¤³¤ì¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +.B LILO +¤Ç¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¡¢¤Þ¤¿¤Ï¡¢ +.B LILO +¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë +.I /etc/lilo.config +¤Î¥ª¥×¥·¥ç¥ó¥é¥¤¥ó¤È¤·¤Æ»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤ë¥Ç¥Ð¥¤¥¹¤Ï¡¢Å¬Àڤʥ롼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤· +¤Æ¥Þ¥¦¥ó¥È²Äǽ¤Ê¥Ç¥Ð¥¤¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" +.\" +.\" +.\"O .SS "Changing the Normal Root File System" +.SS Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÊѹ¹ +.\"O By default, +.\"O the kernel's settings +.\"O (e.g., set in the kernel file with +.\"O .BR rdev (8) +.\"O or compiled into the kernel file), +.\"O or the boot loader option setting +.\"O is used for the normal root file systems. +.\"O For an NFS-mounted normal root file system, one has to use the +.\"O .B nfs_root_name +.\"O and +.\"O .B nfs_root_addrs +.\"O boot options to give the NFS settings. +.\"O For more information on NFS-mounted root see the kernel documentation file +.\"O .BR Documentation/filesystems/nfsroot.txt . +.\"O For more information on setting the root file system see also the +.\"O .BR LILO +.\"O and +.\"O LOADLIN +.\"O documentation. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤ÎÀßÄê +(Î㤨¤Ð¡¢ +.BR rdev (8) +¤òÍѤ¤¤Æ¥«¡¼¥Í¥ë¥Õ¥¡¥¤¥ëÆâ¤Ë¥»¥Ã¥È¤µ¤ì¤¿¤â¤Î¡¢¤Þ¤¿¤Ï¡¢¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥«¡¼ +¥Í¥ë¥Õ¥¡¥¤¥ëÆâ¤ËËä¤á¹þ¤Þ¤ì¤¿¤â¤Î)¡¢ +¤Þ¤¿¤Ï¡¢¥Ö¡¼¥È¥í¡¼¥À¤Î¥ª¥×¥·¥ç¥óÀßÄê¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¤â¤Î¤¬Ä̾ï»þ¥ë¡¼ +¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤·¤Æ»È¤ï¤ì¤ë¡£ +NFS ¥Þ¥¦¥ó¥È¤µ¤ì¤¿Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÍøÍѤ¹¤ë¾ì¹ç¡¢ +.B nfs_root_name +¤È +.B nfs_root_addrs +¥Ö¡¼¥È¥ª¥×¥·¥ç¥ó¤ò»È¤Ã¤Æ NFS ¤ÎÀßÄê¤òÍ¿¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +NFS ¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥ë¡¼¥È (¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à) ¤Ë¤Ä¤¤¤Æ¤Î +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¡¢¥«¡¼¥Í¥ë¤Î¥É¥­¥å¥á¥ó¥È¥Õ¥¡¥¤¥ë +.B Documentation/filesystems/nfsroot.txt +¤ò»²¾È¤Î¤³¤È¡£ +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÀßÄê¤Ë¤Ä¤¤¤Æ¤Î¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¡¢ +.B LILO +¤È +.B LOADLIN +¤Î¥É¥­¥å¥á¥ó¥È¤â»²¾È¤Î¤³¤È¡£ +.PP +.\"O It is also possible for the +.\"O .I /linuxrc +.\"O executable to change the normal root device. +¤Þ¤¿¡¢ +.I /linuxrc +¤òÍѤ¤¤ë»ö¤Ë¤è¤Ã¤Æ¤âÄ̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Ç¥Ð¥¤¥¹¤òÊѹ¹¤¹¤ë¤³¤È +¤¬¤Ç¤­¤ë¡£ +.\"O For +.\"O .I /linuxrc +.\"O to change the normal root device, +.\"O .IR /proc +.\"O must be mounted. +.I /linuxrc +¤òÍѤ¤¤Æ¡¢Ä̾ï»þ¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤òÊѹ¹¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.I /proc +¤¬¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O After mounting +.\"O .IR /proc , +.\"O .I /linuxrc +.\"O changes the normal root device by writing into the proc files +.\"O .IR /proc/sys/kernel/real-root-dev , +.\"O .IR /proc/sys/kernel/nfs-root-name , +.\"O and +.\"O .IR /proc/sys/kernel/nfs-root-addrs . +.I /proc +¤ò¥Þ¥¦¥ó¥È¤·¤¿¸å¤Ç¡¢ +.I /linuxrc +¤Ï proc ¥Õ¥¡¥¤¥ë +.IR /proc/sys/kernel/real-root-dev , +.IR /proc/sys/kernel/nfs-root-name , +.I /proc/sys/kernel/nfs-root-addrs +¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¤¡¢Ä̾ï»þ¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤òÊѹ¹¤¹¤ë¡£ +.\"O For a physical root device, the root device is changed by having +.\"O .I /linuxrc +.\"O write the new root file system device number into +.\"O .IR /proc/sys/kernel/real-root-dev . +(NFS ¤Ç¤Ï¤Ê¤¤) ʪÍýŪ¤Ê¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Î¾ì¹ç¡¢ +.I /linuxrc +¤¬¿·¤·¤¤¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤ò +.I /proc/sys/kernel/real-root-dev +¤Ë½ñ¤­¹þ¤à¤³¤È¤Ç¡¢¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤¬Êѹ¹¤µ¤ì¤ë¡£ +.\"O For an NFS root file system, the root device is changed by having +.\"O .I /linuxrc +.\"O write the NFS setting into files +.\"O .IR /proc/sys/kernel/nfs-root-name +.\"O and +.\"O .I /proc/sys/kernel/nfs-root-addrs +.\"O and then writing 0xff (e.g., the pseudo-NFS-device number) into file +.\"O .IR /proc/sys/kernel/real-root-dev . +NFS ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¾ì¹ç¡¢ +.I /linuxrc +¤¬ NFS ¤ÎÀßÄê¤ò +.I /proc/sys/kernel/nfs-root-name +¤È +.I /proc/sys/kernel/nfs-root-addrs +¤Ë½ñ¤­¹þ¤ß¡¢¤½¤ì¤«¤é +.I /proc/sys/kernel/real-root-dev +¤Ë (µ¿»÷ NFS ¥Ç¥Ð¥¤¥¹¥Ê¥ó¥Ð¡¼¤Ç¤¢¤ë) 0xff ¤ò½ñ¤­¹þ¤à¤³¤È¤Ç¡¢ +¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤¬Êѹ¹¤µ¤ì¤ë¡£ +.\"O For example, the following shell command line would change +.\"O the normal root device to +.\"O .IR /dev/hdb1 : +Î㤨¤Ð¡¢¼¡¤Î¥·¥§¥ë¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë¤è¤ê¡¢Ä̾ï»þ¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤ò +.I /dev/hdb1 +¤ËÊѹ¹¤Ç¤­¤ë¤À¤í¤¦: +.nf + + echo 0x365 >/proc/sys/kernel/real-root-dev + +.fi +.\"O For an NFS example, the following shell command lines would change the +.\"O normal root device to the NFS directory +.\"O .I /var/nfsroot +.\"O on a local networked NFS server with IP number 193.8.232.7 for a system with +.\"O IP number 193.8.232.7 and named "idefix": +¤Þ¤¿¡¢NFS ¤Î¾ì¹ç¡¢¼¡¤Î¤è¤¦¤Ê¥·¥§¥ë¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë¤è¤ê¡¢ +¥í¡¼¥«¥ë¥Í¥Ã¥È¥ï¡¼¥¯¤Î 193.8.232.2 ¤È¤¤¤¦ IP ¥¢¥É¥ì¥¹¤ò»ý¤Ä NFS ¥µ¡¼¥Ð¤Î +NFS ¥Ç¥£¥ì¥¯¥È¥ê +.I /var/nfsroot +¤ò 193.8.232.7 ¤È¤¤¤¦ IP ¥¢¥É¥ì¥¹¤ò»ý¤Ä "idefix" ¤È¤¤¤¦Ì¾Á°¤Î¥· +¥¹¥Æ¥à¤ÎÄ̾ï»þ¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤È¤·¤Æ¥Þ¥¦¥ó¥È¤¹¤ë¤è¤¦¤ËÊѹ¹¤Ç¤­¤ë¤À¤í¤¦: +.nf + + echo /var/nfsroot >/proc/sys/kernel/nfs-root-name + echo 193.8.232.2:193.8.232.7::255.255.255.0:idefix \\ + >/proc/sys/kernel/nfs-root-addrs + echo 255 >/proc/sys/kernel/real-root-dev +.fi + +.\"O .BR Note : +.BR Ãí°Õ : +.\"O The use of +.\"O .I /proc/sys/kernel/real-root-dev +.\"O to change the root file system is obsolete. +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÊѹ¹¤¹¤ë¤¿¤á¤Ë +.I /proc/sys/kernel/real-root-dev +¤ò»È¤¦¤Î¤Ï°ÊÁ°¤ÎÊýË¡¤Ç¤¢¤ë¡£ +.\"O See the kernel source file +.\"O .I Documentation/initrd.txt +.\"O as well as +.\"O .BR pivot_root (2) +.\"O and +.\"O .BR pivot_root (8) +.\"O for information on the modern method of changing the root file system. +.\"O .\" FIXME the manual page should describe the pivot_root mechanism. +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÊѹ¹¤¹¤ë¿·¤·¤¤ÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï¡¢ +¥«¡¼¥Í¥ë¥½¡¼¥¹¤Ë´Þ¤Þ¤ì¤ë +.I Documentation/initrd.txt +¥Õ¥¡¥¤¥ë¤ä¡¢ +.BR pivot_root (2) +¤ä +.BR pivot_root (8) +¤ò»²¾È¤·¤Æ¤Û¤·¤¤¡£ +.\" FIXME ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç pivot_root ¤Î»ÅÁȤߤòÀâÌÀ¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.\" +.\" +.\" +.\"O .SS Usage +.SS »È¤¤Êý +.\"O The main motivation for implementing +.\"O .B initrd +.\"O was to allow for modular kernel configuration at system installation. +.B initrd +¤¬¼ÂÁõ¤µ¤ì¤¿¼ç¤ÊÌÜŪ¤Ï¡¢¥·¥¹¥Æ¥à¥¤¥ó¥¹¥È¡¼¥ë»þ¤Ë¡¢¥â¥¸¥å¡¼¥ë²½¤µ¤ì¤¿¥«¡¼ +¥Í¥ë¤ÎÀßÄê¤ò²Äǽ¤Ë¤¹¤ë¤³¤È¤Ç¤¢¤Ã¤¿¡£ +.PP +.\"O A possible system installation scenario is as follows: +¼¡¤Î¤è¤¦¤Êή¤ì¤Î¥·¥¹¥Æ¥à¥¤¥ó¥¹¥È¡¼¥ë¤¬²Äǽ¤Ë¤Ê¤ë: +.IP 1. 3 +.\"O The loader program boots from floppy or other media with a minimal kernel +.\"O (e.g., support for +.\"O .IR /dev/ram , +.\"O .IR /dev/initrd , +.\"O and the ext2 file-system) and loads +.\"O .IR /dev/initrd +.\"O with a gzipped version of the initial file-system. +¥í¡¼¥À¥×¥í¥°¥é¥à¤Ï¡¢¥Õ¥í¥Ã¥Ô¡¼¤ä¤½¤Î¾¤Î¥á¥Ç¥£¥¢¤«¤é¡¢ +ºÇ¾®¸Â¤Î¥«¡¼¥Í¥ë (Î㤨¤Ð¡¢ +.IR /dev/ram , +.IR /dev/initrd , +ext2 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¤ß¤Î¥µ¥Ý¡¼¥È¤·¤¿¥«¡¼¥Í¥ë) ¤ò¥Ö¡¼¥È¤·¡¢ +gzip °µ½Ì¤µ¤ì¤¿½é´ü¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¤¥á¡¼¥¸¤ò +.I /dev/initrd +¤Ë¥í¡¼¥É¤¹¤ë¡£ +.IP 2. +.\"O The executable +.\"O .I /linuxrc +.\"O determines what is needed to (1) mount the normal root file-system +.\"O (i.e., device type, device drivers, file system) and (2) the +.\"O distribution media (e.g., CD-ROM, network, tape, ...). +.\"O This can be done by asking the user, by auto-probing, +.\"O or by using a hybrid approach. +¼Â¹Ô¥Õ¥¡¥¤¥ë +.I /linuxrc +¤Ï¡¢(1) Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¤Ë²¿¤¬É¬Íפ« +(¤¹¤Ê¤ï¤Á¡¢¥Ç¥Ð¥¤¥¹¥¿¥¤¥×¡¢¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à)¡¢ +(2) ÇÛÉÛ¥á¥Ç¥£¥¢¤Ë²¿¤¬É¬Íפ« (Î㤨¤Ð¡¢CD-ROM, ¥Í¥Ã¥È¥ï¡¼¥¯¡¢¥Æ¡¼¥×¤Ê¤É) +¤ò·èÄꤹ¤ë¡£·èÄê¤Ï¡¢¥æ¡¼¥¶¤Ø¤ÎÌ䤤¹ç¤ï¤»¡¢¼«Æ°¸¡½Ð¡¢¤¢¤ë¤¤¤Ï¤½¤Îξ¼Ô¤Î +ÊýË¡¤òÁȤ߹ç¤ï¤»¤Æ¹Ô¤ï¤ì¤ë¡£ +.IP 3. +.\"O The executable +.\"O .I /linuxrc +.\"O loads the necessary modules from the initial root file-system. +¼Â¹Ô¥Õ¥¡¥¤¥ë +.I /linuxrc +¤Ï¡¢½é´ü¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤éɬÍפʥ⥸¥å¡¼¥ë¤ò¥í¡¼¥É¤¹¤ë¡£ +.IP 4. +.\"O The executable +.\"O .I /linuxrc +.\"O creates and populates the root file system. (At this stage the normal +.\"O root file system does not have to be a +.\"O completed system yet.) +¼Â¹Ô¥Õ¥¡¥¤¥ë +.I /linuxrc +¤Ï¡¢¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òºîÀ®¤·¡¢ÇÛÃÖ¤¹¤ë (¤³¤ÎÃʳ¬¤Ç¤Ï¡¢Ä̾ï»þ¥ë¡¼ +¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï´°Á´¤Ê¥·¥¹¥Æ¥à¤Ç¤¢¤ëɬÍפϤʤ¤)¡£ +.IP 5. +.\"O The executable +.\"O .IR /linuxrc +.\"O sets +.\"O .IR /proc/sys/kernel/real-root-dev , +.\"O unmount +.\"O .IR /proc , +.\"O the normal root file system and any other file +.\"O systems it has mounted, and then terminates. +¼Â¹Ô¥Õ¥¡¥¤¥ë +.I /linuxrc +¤Ï¡¢ +.I /proc/sys/kernel/real-root-dev +¤òÀßÄꤷ¡¢ +.IR /proc "¡¢" +¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ëÄ̾ï»þ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àµÚ¤Ó¤½¤Î¾¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +¤ò¥¢¥ó¥Þ¥¦¥ó¥È¤·¡¢ +¼Â¹Ô¤ò½ªÎ»¤¹¤ë¡£ +.IP 6. +.\"O The kernel then mounts the normal root file system. +¼¡¤Ë¡¢¥«¡¼¥Í¥ë¤Ï¡¢Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥Þ¥¦¥ó¥È¤¹¤ë¡£ +.IP 7. +.\"O Now that the file system is accessible and intact, +.\"O the boot loader can be installed. +¤³¤ÎÃʳ¬¤Ç¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÏÁ´¤¯Êѹ¹¤¬¹Ô¤ï¤ì¤Æ¤¤¤Ê¤¤¾õÂ֤ǡ¢ +¥¢¥¯¥»¥¹¤Ç¤­¤ë¾õÂ֤ˤʤ롣 +¤Þ¤¿¡¢¥Ö¡¼¥È¥í¡¼¥À¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.IP 8. +.\"O The boot loader is configured to load into +.\"O .I /dev/initrd +.\"O a file system with the set of modules that was used to bring up the system. +.\"O (e.g., Device +.\"O .I /dev/ram0 +.\"O can be modified, then unmounted, and finally, the image is written from +.\"O .I /dev/ram0 +.\"O to a file.) +¥Ö¡¼¥È¥í¡¼¥À¤òÀßÄꤷ¡¢¥·¥¹¥Æ¥àµ¯Æ°»þ¤Ë»ÈÍѤµ¤ì¤ë¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤Î¥»¥Ã +¥È¤ò´Þ¤ó¤À¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +.I /dev/initrd +¤Ë¥í¡¼¥É¤¹¤ë (Î㤨¤Ð¡¢ +.I /dev/ram0 +¥Ç¥Ð¥¤¥¹¤ÎÆâÍƤò½¤Àµ¤·¡¢¥¢¥ó¥Þ¥¦¥ó¥È¤¹¤ë¡£ºÇ¸å¤Ë¡¢ +.I /dev/ram0 +¤Î¥¤¥á¡¼¥¸¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹)¡£ +.IP 9. +.\"O The system is now bootable and additional installation tasks can be +.\"O performed. +¤³¤ì¤Ç¡¢¥·¥¹¥Æ¥à¤¬¥Ö¡¼¥È²Äǽ¤Ë¤Ê¤ë¡£¤³¤Î¸å¡¢¤µ¤é¤Ë¤½¤Î¾¤Î¥¤¥ó¥¹¥È¡¼¥ë +¤Îºî¶È¤ò¼Â¹Ô¤Ç¤­¤ë¡£ +.PP +.\"O The key role of +.\"O .I /dev/initrd +.\"O in the above is to reuse the configuration data during normal system operation +.\"O without requiring initial kernel selection, a large generic kernel or, +.\"O recompiling the kernel. +¾åµ­¤ÎÆ°ºî¤Ç¤Î +.I /dev/initrd +¤ÎÌò³ä¤Î¥­¡¼¥Ý¥¤¥ó¥È¤Ï¡¢½é´ü¥«¡¼¥Í¥ë¤ÎÁªÂò¤äÂ礭¤Ê¥¸¥§¥Í¥ê¥Ã¥¯¥«¡¼¥Í¥ë¡¢ +¥«¡¼¥Í¥ë¤ÎºÆ¹½Ãۤʤ·¤Ë¡¢Ä̾ï¤Î¥·¥¹¥Æ¥àÁàºî¤ÇºÆÍøÍѲÄǽ¤ÊÀßÄê¥Ç¡¼¥¿¤òÍø +ÍѤ¹¤ë¤³¤È¤Ë¤¢¤ë¡£ +.PP +.\"O A second scenario is for installations where Linux runs on systems with +.\"O different hardware configurations in a single administrative network. +.\"O In such cases, it may be desirable to use only a small set of kernels +.\"O (ideally only one) and to keep the system-specific part of configuration +.\"O information as small as possible. +.\"O In this case, create a common file +.\"O with all needed modules. +.\"O Then, only the +.\"O .I /linuxrc +.\"O file or a file executed by +.\"O .I /linuxrc +.\"O would be different. +2 ÈÖÌܤΥ±¡¼¥¹¤Ï¡¢°ì¤Ä¤Î´ÉÍý¾å¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤Ë¤ª¤¤¤Æ¡¢°Û¤Ê¤ëÀßÄê¤Î¥Ï¡¼ +¥É¥¦¥§¥¢¤Î¥·¥¹¥Æ¥à¾å¤Ç Linux ¤òÆ°ºî¤µ¤»¤ë¤¿¤á¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò¹Ô¤¦¾ì¹ç +¤Ç¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¥±¡¼¥¹¤Î¾ì¹ç¡¢¤´¤¯¾®¿ô¤Î¥«¡¼¥Í¥ë¤Î¥»¥Ã¥È (ÍýÁÛŪ¤Ë¤Ï¤¿¤Ã¤¿°ì +¤Ä¤Î¥«¡¼¥Í¥ë) ¤Î¤ß¤òÍøÍѤ·¡¢¥·¥¹¥Æ¥à¸ÇÍ­¤ÎÀßÄê¾ðÊó¤Ï²Äǽ¤Ê¸Â¤ê¾®¤µ¤¯¤¹ +¤ë¤³¤È¤¬Ë¾¤Þ¤·¤¤¤Ç¤¢¤í¤¦¡£ +¤³¤Î¾ì¹ç¡¢Á´¤Æ¤ÎɬÍפʥ⥸¥å¡¼¥ë¤¬Æþ¤Ã¤¿¶¦ÄÌ¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¡£ +¤½¤·¤Æ¡¢ +.I /linuxrc +¥Õ¥¡¥¤¥ë¡¢¤Þ¤¿¤Ï¡¢ +.I /linuxrc +¤«¤é¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î¤ß¤ò°Û¤Ê¤Ã¤¿¤â¤Î¤Ë¤·¤Æ¤ª¤¯¡£ +.PP +.\"O A third scenario is more convenient recovery disks. +.\"O Because information like the location of the root file-system +.\"O partition is not needed at boot time, the system loaded from +.\"O .I /dev/initrd +.\"O can use a dialog and/or auto-detection followed by a +.\"O possible sanity check. +3 ÈÖÌܤΥ±¡¼¥¹¤Ï¡¢¤è¤êÊØÍø¤ÊÉüµìÍѥǥ£¥¹¥¯¤òºî¤ë¾ì¹ç¤Ç¤¢¤ë¡£ +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î°ÌÃ֤Ȥ¤¤Ã¤¿¾ðÊó¤Ï +¥Ö¡¼¥È»þ¤ËɬÍפʤ¤¤¿¤á¡¢ +.I /dev/initrd +¤«¤é¥í¡¼¥É¤µ¤ì¤¿¥·¥¹¥Æ¥à¤Ï¡¢ +ɬÍפÊÀµ¾ïÀ­¥Á¥§¥Ã¥¯¤ò¹Ô¤Ã¤¿¸å¤Ç¡¢¥æ¡¼¥¶¤Ø¤ÎÌ䤤¹ç¤ï¤»¤ä¼«Æ°¸¡½Ð +(¤â¤·¤¯¤Ï¤½¤ÎξÊý) ¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.PP +.\"O Last but not least, Linux distributions on CD-ROM may use +.\"O .B initrd +.\"O for easy installation from the CD-ROM. +.\"O The distribution can use +.\"O .B LOADLIN +.\"O to directly load +.\"O .I /dev/initrd +.\"O from CD-ROM without the need of any floppies. +.\"O The distribution could also use a +.\"O .B LILO +.\"O boot floppy and then bootstrap a bigger ram disk via +.\"O .IR /dev/initrd +.\"O from the CD-ROM. +(¾¤Ë¤â¤¿¤¯¤µ¤óÎ㤬¤¢¤ë¤À¤í¤¦¤¬) ºÇ¸å¤ÎÎã¤È¤·¤Æ¤Ï¡¢ +.B initrd +¤òÍøÍѤ¹¤ë¤È¡¢CD-ROM ¾å¤Î Linux ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤ò +¤è¤ê´Êñ¤Ë CD-ROM ¤«¤é¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤À¤í¤¦¡£ +¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ï¡¢ +.B LOADLIN +¤ò»È¤Ã¤Æ¡¢¥Õ¥í¥Ã¥Ô¡¼¤òÁ´¤¯ÍøÍѤ»¤º¤Ë CD-ROM ¤«¤é +.I /dev/initrd +¤òľÀÜ¥í¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤Þ¤¿¡¢ +.B LILO +¥Ö¡¼¥È¥Õ¥í¥Ã¥Ô¡¼¤ò»È¤Ã¤Æ¥Ö¡¼¥È¤ò¹Ô¤¤¡¢ +.I /dev/initrd +¤òÄ̤·¤Æ CD-ROM ¤«¤é¤è¤êÂ礭¤Ê RAM ¥Ç¥£¥¹¥¯¤òµ¯Æ°¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.\" +.\" +.\" +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.I /dev/initrd +.br +.I /dev/ram0 +.br +.I /linuxrc +.br +.I /initrd +.\" +.\" +.\" +.\"O .SH NOTES +.SH Ãí°Õ +.IP 1. 3 +.\"O With the current kernel, any file systems that remain mounted when +.\"O .I /dev/ram0 +.\"O is moved from +.\"O .I / +.\"O to +.\"O .I /initrd +.\"O continue to be accessible. +.\"O However, the +.\"O .I /proc/mounts +.\"O entries are not updated. +¸½ºß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.I /dev/ram0 +¤¬ +.I / +¤«¤é +.I /initrd +¤Ë°ÜÆ°¤µ¤ì¤¿ºÝ¤Ë¡¢°ÜÆ°»þ¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢ +¤½¤Î¸å¤â·Ñ³Ū¤Ë¥¢¥¯¥»¥¹²Äǽ¤Ç¤¢¤ë¡£¤·¤«¤·¡¢ +.I /proc/mounts +¤Î¥¨¥ó¥È¥ê¤Ï¹¹¿·¤µ¤ì¤Ê¤¤¡£ +.IP 2. +.\"O With the current kernel, if directory +.\"O .I /initrd +.\"O does not exist, then +.\"O .I /dev/ram0 +.\"O will +.\"O .B not +.\"O be fully unmounted if +.\"O .I /dev/ram0 +.\"O is used by any process or has any file-system mounted on it. +.\"O If +.\"O .IR /dev/ram0 +.\"O is +.\"O .B not +.\"O fully unmounted, then +.\"O .I /dev/ram0 +.\"O will remain in memory. +¸½ºß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê +.I /initrd +¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +.I /dev/ram0 +¤ò²¿¤é¤«¤Î¥×¥í¥»¥¹¤¬ÍøÍѤ·¤Æ¤¤¤¿¤ê¡¢²¿¤é¤«¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ +.I /dev/ram0 +¾å¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +.I /dev/ram0 +¤Ï´°Á´¤Ë¤Ï¥¢¥ó¥Þ¥¦¥ó¥È¡Ö¤µ¤ì¤Ê¤¤¡×¡£ +.I /dev/ram0 +¤¬¡¢´°Á´¤Ë¥¢¥ó¥Þ¥¦¥ó¥È¡Ö¤µ¤ì¤Ê¤±¤ì¤Ð¡×¡¢ +.I /dev/ram0 +¤Ï¥á¥â¥ê¾å¤Ë»Ä¤Ã¤Æ¤·¤Þ¤¦¤Ï¤º¤Ç¤¢¤ë¡£ +.IP 3. +.\"O Users of +.\"O .I /dev/initrd +.\"O should not depend on the behavior give in the above notes. +.\"O The behavior may change in future versions of the Linux kernel. +.I /dev/initrd +¤ÎÍøÍѼԤϡ¢¾åµ­¤ÎÃí°Õ»ö¹à¤Ç½Ò¤Ù¤¿Æ°ºî¤Ë°Í¸¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤ÎÆ°ºî¤Ï Linux ¥«¡¼¥Í¥ë¤Î¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤ÏÊѹ¹¤µ¤ì¤ë +¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤À¡£ +.\" +.\" +.\" +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\"O .\" The kernel code for device +.\"O .\" .BR initrd +.\"O .\" was written by Werner Almesberger and +.\"O .\" Hans Lermen . +.\" .BR initrd +.\" ¥Ç¥Ð¥¤¥¹¤Î¤¿¤á¤Î¥«¡¼¥Í¥ë¥³¡¼¥É¤Ï Werner Almesberger +.\" ¤È Hans Lermen ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ +.\"O .\" The code for +.\"O .\" .BR initrd +.\"O .\" was added to the baseline Linux kernel in development version 1.3.73. +.\" .BR initrd +.\" ¤Î¤¿¤á¤Î¥³¡¼¥É¤Ï¡¢³«È¯¼Ô¸þ¤±¥Ð¡¼¥¸¥ç¥ó¤Î 1.3.73 ¤Ç +.\" ¥á¥¤¥ó¤Î Linux ¥«¡¼¥Í¥ë¤ËÁȤ߹þ¤Þ¤ì¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR ram (4), +.BR freeramdisk (8), +.BR rdev (8) + +.\"O The documentation file +.\"O .I initrd.txt +.\"O in the kernel source package, the LILO documentation, +.\"O the LOADLIN documentation, the SYSLINUX documentation. +¥«¡¼¥Í¥ë¥½¡¼¥¹¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤ë¥É¥­¥å¥á¥ó¥È¥Õ¥¡¥¤¥ë +.IR initrd.txt "¡¢" +LILO ¤Î¥É¥­¥å¥á¥ó¥È¡¢LOADLIN ¤Î¥É¥­¥å¥á¥ó¥È¡¢SYSLINUX ¤Î¥É¥­¥å¥á¥ó¥È¡£ diff --git a/draft/man4/intro.4 b/draft/man4/intro.4 new file mode 100644 index 00000000..c0f159a4 --- /dev/null +++ b/draft/man4/intro.4 @@ -0,0 +1,62 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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. +.\" +.\" Translated into Japanese, and added Information of Japanese +.\" man-pages project, Thu Feb 6 16:39:55 1997, +.\" Mutsumi Ishikawa +.\" +.\" Japanese Version Last 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 +.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 +.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) diff --git a/draft/man4/lp.4 b/draft/man4/lp.4 new file mode 100644 index 00000000..905176ad --- /dev/null +++ b/draft/man4/lp.4 @@ -0,0 +1,223 @@ +'\" t +.\" Copyright (c) Michael Haardt (michael@cantor.informatik.rwth-aachen.de), +.\" Sun Jan 15 19:16:33 1995 +.\" +.\" 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, Sun Feb 26 15:02:58 1995, faith@cs.unc.edu +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 +.\" ISHIKAWA Mutsumi, TAKAHASHI Mutsuji +.\" all rights reserved. +.\" Translated Tue Feb 13 22:48:47 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" and TAKAHASHI Mutsuji +.\" +.\" Japanese Version Last Modified Sun Jan 11 03:42:56 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: printer ¥×¥ê¥ó¥¿¡¼ +.\" WORD: parallel ¥Ñ¥é¥ì¥ë +.\" WORD: polling ¥Ý¡¼¥ê¥ó¥° +.\" WORD: interrupt ³ä¤ê¹þ¤ß +.\" WORD: dot matrix printer ¥É¥Ã¥È¥Þ¥È¥ê¥¯¥¹¥×¥ê¥ó¥¿¡¼ +.\" WORD: default ¥Ç¥Õ¥©¥ë¥È +.\" WORD: modularize ¥â¥¸¥å¡¼¥ë²½ +.\" WORD: driver ¥É¥é¥¤¥Ð +.\" WORD: buffer ¥Ð¥Ã¥Õ¥¡ +.\" +.TH LP 4 1995-01-15 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O lp \- line printer devices +.SH ̾Á° +lp \- ¥é¥¤¥ó¥×¥ê¥ó¥¿¡¼¥Ç¥Ð¥¤¥¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.\"O .SH CONFIGURATION +.SH ÀßÄê +.\"O \fBlp\fP[0\(en2] are character devices for the parallel line printers; +.\"O they have major number 6 and minor number 0\(en2. +.\"O The minor numbers +.\"O correspond to the printer port base addresses 0x03bc, 0x0378 and 0x0278. +.\"O Usually they have mode 220 and are owned by root and group lp. +.\"O You can use printer ports either with polling or with interrupts. +.\"O Interrupts are recommended when high traffic is expected, for example, +.\"O for laser printers. +.\"O For usual dot matrix printers polling will usually be enough. +.\"O The default is polling. +\fBlp\fP[0\(en2] ¤Ï¥Ñ¥é¥ì¥ë¥×¥ê¥ó¥¿¡¼¤Î¤¿¤á¤Î¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹¤Ç¥á¥¸¥ã¡¼ +¥Ê¥ó¥Ð¡¼ 6 ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ 0\(en2 ¤ò»ý¤Ä¡£¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼¤Ï¡¢¥Ù¡¼¥¹ +¥¢¥É¥ì¥¹ 0x03bc, 0x0378, 0x0278 ¤Î¤½¤ì¤¾¤ì¤Î¥×¥ê¥ó¥¿¡¼¥Ý¡¼¥È¤ËÂбþ¤¹¤ë +Ä̾¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ï¥â¡¼¥É 220 ¥ª¡¼¥Ê¡¼ root ¥°¥ë¡¼¥× lp ¤È¤Ê¤Ã +¤Æ¤¤¤ë¡£¥×¥ê¥ó¥¿¡¼¥Ý¡¼¥È¤Ï¥Ý¡¼¥ê¥ó¥°(polling)¤Þ¤¿¤Ï³ä¤ê¹þ¤ß +(interrupts) ¤Î¤É¤Á¤é¤òÍѤ¤¤Æ¤âÍøÍѤǤ­¤ë¡£³ä¤ê¹þ¤ß¤ÎÍøÍѤϡ¢¹âÉé²Ù¤¬ +ͽÁÛ¤µ¤ì¤ë»þ¡¢Î㤨¤Ð¥ì¡¼¥¶¡¼¥×¥ê¥ó¥¿¡¼¤ò¥×¥ê¥ó¥¿¥Ý¡¼¥È¤ËÀܳ¤¹¤ë¾ì¹ç¤Ê +¤É¤Ë¿ä¾©¤µ¤ì¤ë¡£ÉáÄ̤Υɥåȥޥȥꥯ¥¹¥×¥ê¥ó¥¿¡¼¤Ç¤Ï¡¢¥Ý¡¼¥ê¥ó¥°¤ÎÍøÍÑ +¤ÇÄ̾ï¤Ï½½Ê¬¤Ç¤¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥Ý¡¼¥ê¥ó¥°¤òÍøÍѤ¹¤ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The following +.\"O .BR ioctl (2) +.\"O calls are supported: +¼¡¤Î +.BR ioctl (2) +¥³¡¼¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPTIME, int \fP\fIarg\fP\fB)\fP" +.\"O Sets the amount of time that the driver sleeps before rechecking the printer +.\"O when the printer's buffer appears to be filled to \fIarg\fP. +.\"O If you have a fast printer, decrease this number; +.\"O if you have a slow printer then increase it. +.\"O This is in hundredths of a second, the default 2 +.\"O being 0.02 seconds. +.\"O It only influences the polling driver. +¥×¥ê¥ó¥¿¡¼¤Î¥Ð¥Ã¥Õ¥¡( buffer ) ¤¬¤¤¤Ã¤Ñ¤¤¤Ë¤Ê¤Ã¤¿»þ¡¢¥É¥é¥¤¥Ð¤¬¥×¥ê¥ó¥¿¡¼ +¤òºÆ¥Á¥§¥Ã¥¯¤¹¤ë¤Þ¤Ç¤ËµÙ»ß¤¹¤ë»þ´Ö¤ò \fIarg\fP ¤È¤¹¤ë¡£¹â®¤Ê¥×¥ê¥ó¥¿¡¼ +¤Î»þ¤Ï¤³¤ì¤ò¸º¤é¤·¡¢ÃÙ¤¤¥×¥ê¥ó¥¿¡¼¤Î»þ¤Ë¤ÏÁý¤ä¤¹¡£Ã±°Ì¤Ï1ÉäÎ100ʬ¤Î1 +¤Ç¡¢¥Ç¥Õ¥©¥ë¥È¤Î2¤Ï0.02Éäˤ¢¤¿¤ë¡£¥Ý¡¼¥ê¥ó¥°¥É¥é¥¤¥Ð( polling driver +)¤Î¤ß¤Ë±Æ¶Á¤¹¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCHAR, int \fP\fIarg\fP\fB)\fP" +.\"O Sets the maximum number of busy-wait iterations which the polling driver does +.\"O while waiting for the printer to get ready for receiving a character to +.\"O \fIarg\fP. +.\"O If printing is too slow, increase this number; if the +.\"O system gets too slow, decrease this number. +.\"O The default is 1000. +.\"O It only influences the polling driver. +¥Ý¡¼¥ê¥ó¥°¥É¥é¥¤¥Ð¤¬¥×¥ê¥ó¥¿¡¼¤Îʸ»ú¼õ¼è¤ê½àÈ÷¤¬¤Ç¤­¤ë¤Î¤òÂÔ +¤Ä¥Ó¥¸¡¼¥¦¥¨¥¤¥È(busy-wait)¤Î²ó¿ô¤ÎºÇÂçÃͤò \fIarg\fP¤È¤¹¤ë¡£ +¤â¤·°õºþ¤¬ÃÙ¤¹¤®¤ë»þ¤Ï¤³¤ì¤òÁý¤ä¤·¡¢¥·¥¹¥Æ¥à¤¬ÃÙ¤¯¤Ê¤ê¤¹¤®¤ë»þ¤Ë¤Ï +¸º¤é¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ï 1000 ¤Ç¤¢¤ë¡£¥Ý¡¼¥ê¥ó¥°¥É¥é¥¤¥Ð¤Î¤ß¤Ë±Æ¶Á¤¹¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORT, int \fP\fIarg\fP\fB)\fP" +.\"O If \fIarg\fP is 0, the printer driver will retry on errors, otherwise +.\"O it will abort. +.\"O The default is 0. +¤â¤·¡¢\fIarg\fP ¤¬ 0 ¤Ê¤é¡¢¥×¥ê¥ó¥¿¡¼¥É¥é¥¤¥Ð¤Ï¥¨¥é¡¼¤Ë¤Ä¤¤¤ÆºÆ»î¹Ô +¤ò¹Ô¤¦¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤ÏÃæ»ß¤¹¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ï 0 ¤Ç¤¢¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORTOPEN, int \fP\fIarg\fP\fB)\fP" +.\"O If \fIarg\fP is 0, +.\"O .BR open (2) +.\"O will be aborted on error, otherwise error will be ignored. +.\"O The default is +.\"O to ignore it. +¤â¤·¡¢\fIarg\fP ¤¬ 0 ¤Ê¤é +.BR open (2) +¤Î·ë²Ì¤¬¥¨¥é¡¼¤Î¾ì¹ç¡¢Æ°ºî¤¬Ãæ»ß¤µ¤ì¤ë¡£¤½¤ì°Ê³°¤Ê¤é¥¨¥é¡¼¤Ï̵ +»ë¤µ¤ì¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥¨¥é¡¼¤Ï̵»ë¤µ¤ì¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCAREFUL, int \fP\fIarg\fP\fB)\fP" +.\"O If \fIarg\fP is 0, then the out-of-paper, offline and error signals are +.\"O required to be false on all writes, otherwise they are ignored. +.\"O The default is to ignore them. +\fIarg\fP¤¬0¤Î¤È¤­¤Ë¤Ï¡¢¤¹¤Ù¤Æ¤Î½ñ¤­½Ð¤·¤Î»þ¤Ë¡¢»æÀڤ졢¥ª¥Õ¥é¥¤¥ó¡¢¥¨ +¥é¡¼¤Î¥·¥°¥Ê¥ë¤¬µ¶(false)¤Ç¤¢¤ë¤³¤È¤¬É¬ÍפȤµ¤ì¤ë¤¬¡¢0 °Ê³°¤Ê¤é¤³¤ì +¤é¤Î¥·¥°¥Ê¥ë¤Ï̵»ë¤µ¤ì¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤â¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤Ï̵»ë¤µ¤ì¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPWAIT, int \fP\fIarg\fP\fB)\fP" +.\"O Sets the number of busy waiting iterations to wait before strobing the +.\"O printer to accept a just-written character, and the number of iterations to +.\"O wait before turning the strobe off again, +.\"O to \fIarg\fP. +.\"O The specification says this time should be 0.5 +.\"O microseconds, but experience has shown the delay caused by the code is +.\"O already enough. +.\"O For that reason, the default value is 0. +.\"O This is used for both the polling and the interrupt driver. +¥×¥ê¥ó¥¿¡¼¤¬Á÷¤é¤ì¤¿Ê¸»ú¤ò¼õ¤±¼è¤ë¤Î¤òÂԤĤ¿¤á¡¢¥É¥é¥¤¥Ð¤¬Ê¸»ú¤òÁ÷¤Ã +¤Æ¤«¤é¥¹¥È¥í¡¼¥Ö(strobe)¤¹¤ë¤Þ¤Ç¤ÎÂÔ¤Á¤Î·«¤êÊÖ¤·¤Î²ó¿ô¤È¡¢¥¹¥È¥í¡¼¥Ö +¤òºÆ¤Ó¥ª¥Õ¤Ë¤¹¤ë¤Þ¤Ç¤ÎÂÔ¤Á¤Î·«¤êÊÖ¤·¤Î²ó¿ô¤ò \fIarg\fP¤ËÀßÄê +¤¹¤ë¡£»ÅÍͤˤè¤ì¤Ð¤³¤Î»þ´Ö¤Ï 0.5 ¥Þ¥¤¥¯¥íÉäȤ¹¤ë¤Ù¤­¤À¤¬¡¢·Ð¸³¤Ë¤è¤ì¤Ð +¤³¤Î¥³¡¼¥É¤Ë¤è¤Ã¤ÆÀ¸¤¸¤ëÃÙ¤ì¤Ç½½Ê¬¤Ç¤¢¤ë¡£¤½¤Î¤¿¤á¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 0 ¤Ç +¤¢¤ë¡£¤³¤ì¤Ï¡¢¥Ý¡¼¥ê¥ó¥°¤È³ä¤ê¹þ¤ß¥É¥é¥¤¥Ð¤ÎξÊý¤Ç»È¤ï¤ì¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPSETIRQ, int \fP\fIarg\fP\fB)\fP" +.\"O This +.\"O .BR ioctl (2) +.\"O requires superuser privileges. +.\"O It takes an +.\"O .I int +.\"O containing the new IRQ as argument. +.\"O As a side effect, the printer will be reset. +.\"O When \fIarg\fP is 0, the polling driver will be used, which is also default. +¤³¤Î +.BR ioctl (2) +¤ò»È¤¦¤Ë¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Î¸¢¸Â¤¬É¬ÍפǤ¢¤ë¡£¿·¤·¤¤IRQ¤ò¼¨¤¹ +.I int +¤ò°ú¿ô¤È¤·¤Æ¤È¤ë¡£¤Þ¤¿¡¢ÉûºîÍѤȤ·¤Æ¥×¥ê¥ó¥¿¡¼¤Ï¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +\fIarg\fP¤¬0¤Î»þ¤Þ¤¿¤Ï¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ç¤Ï¡¢¥Ý¡¼¥ê¥ó¥°¥É¥é¥¤¥Ð¡¼¤¬»È¤ï +¤ì¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETIRQ, int *\fP\fIarg\fP\fB)\fP" +.\"O Stores the currently used IRQ in \fIarg\fP. +¸½ºß»È¤ï¤ì¤Æ¤¤¤ëIRQ¤ò\fIarg\fP¤Ë¤¤¤ì¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETSTATUS, int *\fP\fIarg\fP\fB)\fP" +.\"O Stores the value of the status port in \fIarg\fP. +.\"O The bits have the following meaning: +¥¹¥Æ¡¼¥¿¥¹¥Ý¡¼¥È¤ÎÃͤò\fIarg\fP¤Ë¼ý¤á¤ë¡£³Æ¥Ó¥Ã¥È¤Ë¤Ï¼¡¤Î¤è¤¦¤Ê°ÕÌ£¤¬ +¤¢¤ë¡§ +.TS +l l. +.\"O LP_PBUSY inverted busy input, active high +.\"O LP_PACK unchanged acknowledge input, active low +.\"O LP_POUTPA unchanged out-of-paper input, active high +.\"O LP_PSELECD unchanged selected input, active high +.\"O LP_PERRORP unchanged error input, active low +LP_PBUSY ¥Ó¥¸¡¼¿®¹æ¤Îȿž¡¢¥Ï¥¤¤¬¥¢¥¯¥Æ¥£¥Ö +LP_PACK ¥¢¥¯¥Î¥ê¥Ã¥¸¿®¹æ¡¢¥í¡¼¤¬¥¢¥¯¥Æ¥£¥Ö +LP_POUTPA »æÀڤ쿮¹æ¡¢¥Ï¥¤¤¬¥¢¥¯¥Æ¥£¥Ö +LP_PSELECD ÁªÂò¿®¹æ¡¢¥Ï¥¤¤¬¥¢¥¯¥Æ¥£¥Ö +LP_PERRORP ¥¨¥é¡¼¿®¹æ¡¢¥í¡¼¤¬¥¢¥¯¥Æ¥£¥Ö +.TE +.sp +.\"O Refer to your printer manual for the meaning of the signals. +.\"O Note that undocumented bits may also be set, depending on your printer. +¿®¹æ¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ï³Æ¼«¤Î¥×¥ê¥ó¥¿¡¼¤Î¥Þ¥Ë¥å¥¢¥ë¤ò»²¾È¤Î¤³¤È¡£¥×¥ê¥ó¥¿¡¼ +¤Ë¤è¤Ã¤Æ¤Ïµ­ºÜ¤Î¤Ê¤¤¥Ó¥Ã¥È¤â¥»¥Ã¥È¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç¡¢Ãí°Õ¤Î¤³¤È¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPRESET)\fP" +.\"O Resets the printer. +.\"O No argument is used. +¥×¥ê¥ó¥¿¡¼¤ò¥ê¥»¥Ã¥È¤¹¤ë¡£°ú¿ô¤Ï¤È¤é¤Ê¤¤¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +/dev/lp* +.\"O .\" .SH AUTHORS +.\" .SH Ãø¼Ô +.\"O .\" The printer driver was originally written by Jim Weigand and Linus +.\"O .\" Torvalds. +.\"O .\" It was further improved by Michael K.\& Johnson. +.\"O .\" The interrupt code was written by Nigel Gamble. +.\"O .\" Alan Cox modularized it. +.\"O .\" LPCAREFUL, LPABORT, LPGETSTATUS were added by Chris Metcalf. +.\" ¥×¥ê¥ó¥¿¡¼¥É¥é¥¤¥Ð¤Ï½é¤á¤Ï Jim Weigand ¤È Linus Torvalds ¤Ë¤è¤Ã¤Æ½ñ +.\" ¤«¤ì¡¢¤µ¤é¤Ë Michael K.\& Johnson ¤Ë¤è¤Ã¤Æ²þÎɤµ¤ì¤¿¡£³ä¤ê¹þ¤ß¤Î¥³¡¼¥É +.\" ¤Ï Nigel Gamble ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£¤Þ¤¿¡¢Alan Cox ¤Ï¥É¥é¥¤¥Ð¤ò¥â¥¸¥å¡¼ +.\" ¥ë²½¤·¤¿¡£ +.\" LPCAREFUL, LPABORT, LPGETSTATUS ¤Ï Chris Metcalf ¤Ë¤è¤Ã¤Æ²Ã¤¨¤é¤ì¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR chmod (1), +.BR chown (1), +.BR mknod (1), +.BR lpcntl (8), +.BR tunelp (8) +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ , +.\" ¹â¶¶ ËÓ»Ê +.SH ËÝÌõ¼ÔÃí +¥«¡¼¥Í¥ë 2.1.x ¤Ç¤Ï¥Ñ¥é¥ì¥ë¥Ý¡¼¥È¤Þ¤ï¤ê¤¬ÂçÉý¤Ë½ñ¤­Ä¾¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥«¡¼¥Í¥ë 2.1.x ¤Î¥Ñ¥é¥ì¥ë¥Ý¡¼¥È¥É¥é¥¤¥Ð¤Ë¤Ï¡¢ +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤ÎÆâÍƤϤ½¤Î¤Þ¤ÞŬÍѤǤ­¤Þ¤»¤ó¡£ diff --git a/draft/man4/mem.4 b/draft/man4/mem.4 new file mode 100644 index 00000000..3947b7d2 --- /dev/null +++ b/draft/man4/mem.4 @@ -0,0 +1,105 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Tue Feb 6 16:48:30 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Sun Jan 11 03:52:01 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: system memory ¥·¥¹¥Æ¥à¥á¥â¥ê +.\" WORD: kernel memory ¥«¡¼¥Í¥ë¥á¥â¥ê +.\" WORD: system ports ¥·¥¹¥Æ¥à¥Ý¡¼¥È +.\" WORD: character device file ¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë +.\" WORD: patch ¥Ñ¥Ã¥Á +.\" WORD: byte address ¥Ð¥¤¥È¥¢¥É¥ì¥¹ +.\" WORD: physical memory address ʪÍý¥á¥â¥ê¥¢¥É¥ì¥¹ +.\" WORD: read-only Æɤ߹þ¤ßÀìÍÑ +.\" WORD: write-only ½ñ¤­¹þ¤ßÀìÍÑ +.\" WORD: kernel ¥«¡¼¥Í¥ë +.\" WORD: virtual memory ²¾ÁÛ¥á¥â¥ê +.\" WORD: I/O ports IO ¥Ý¡¼¥È +.TH MEM 4 1992-11-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mem, kmem, port \- ¥·¥¹¥Æ¥à¥á¥â¥ê(system memory)¡¢¥«¡¼¥Í¥ë¥á¥â¥ê +(kernel memory)¡¢¥·¥¹¥Æ¥à¥Ý¡¼¥È(sysmem ports) +.SH ÀâÌÀ +\fBmem\fP ¤Ï¥³¥ó¥Ô¥å¡¼¥¿¤Î¥á¥¤¥ó¥á¥â¥ê¥¤¥á¡¼¥¸¤Î¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹¥Õ¥¡ +¥¤¥ë(character device file)¤Ç¤¢¤ë¡£¤³¤Î¥Ç¥Ð¥¤¥¹¤Ï¡¢Î㤨¤Ð¡¢¥·¥¹¥Æ¥à¤ò +¸¡ºº¤¹¤ë¤¿¤á(¤Þ¤¿¡¢¥Ñ¥Ã¥Á(patch)¤ò¤¢¤Æ¤ë¤¿¤á)¤Ë»È¤ï¤ì¤ë¤À¤í¤¦¡£ +.LP +.B mem +¤Î¥Ð¥¤¥È¥¢¥É¥ì¥¹(byte address)¤Ï ʪÍý¥á¥â¥ê¥¢¥É¥ì¥¹¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +¸ºß¤·¤Æ¤¤¤Ê¤¤¾ì½ê¤Ø¤Î»²¾È¤Ï¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.LP +Æɤ߹þ¤ßÀìÍÑ(read-only)¤¢¤ë¤¤¤Ï½ñ¤­¹þ¤ßÀìÍÑ(write-only)¤Î¥Ó¥Ã¥È¤Ø¤Î¸¡ +ºº¤¢¤ë¤¤¤Ï¥Ñ¥Ã¥ÁÅö¤Æ¤Ïͽ´ü¤»¤Ì·ë²Ì¤ò¤â¤¿¤é¤¹¤³¤È¤¬¤¢¤ë¡£ +.LP +¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ïŵ·¿Åª¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤é¤ì¤ë¡£: +.RS +.sp +mknod \-m 660 /dev/mem c 1 1 +.br +chown root:kmem /dev/mem +.RE +.LP +.B kmem +¥Õ¥¡¥¤¥ë¤Ï +.B mem +¤ÈƱ¤¸¤À¤¬¡¢ +ʪÍý¥á¥â¥ê¤Ø¤Î¥¢¥¯¥»¥¹¤Ç¤Ï¤Ê¤¯¡¢¥«¡¼¥Í¥ë(kernel)¤Î²¾ÁÛ +¥á¥â¥ê(virtual memory)¤Ø¤Î¥¢¥¯¥»¥¹¤Ç¤¢¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +.LP +¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ïŵ·¿Åª¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤é¤ì¤ë¡£: +.RS +.sp +mknod \-m 640 /dev/kmem c 1 2 +.br +chown root:kmem /dev/kmem +.RE +.LP +\fBport\fP ¤Ï +.B mem +¤Ë»÷¤Æ¤¤¤ë¤¬ I/O ¥Ý¡¼¥È(I/O ports)¤Ø¤Î¥¢¥¯¥»¥¹¤¬¹Ô¤ï¤ì¤ë¡£ +.LP +¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ïŵ·¿Åª¤Ë¤Ï¼¡¤Î¤è¤¦¤Ëºî¤é¤ì¤ë¡£: +.RS +.sp +mknod \-m 660 /dev/port c 1 4 +.br +chown root:mem /dev/port +.RE +.SH ¥Õ¥¡¥¤¥ë +.I /dev/mem +.br +.I /dev/kmem +.br +.I /dev/port +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR ioperm (2) +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ diff --git a/draft/man4/mouse.4 b/draft/man4/mouse.4 new file mode 100644 index 00000000..5183cb89 --- /dev/null +++ b/draft/man4/mouse.4 @@ -0,0 +1,233 @@ +.\" t +.\" roff.\" Copyright +.\" This manpage is Copyright (C) 1996 Michael Haardt. +.\" Updates Nov 1998, 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) 1996,1997,1998 +.\" ISHIKAWA Mutsumi,TAKAHASHI Mutsuji +.\" all rights reserved. +.\" Translated Tue Feb 14 00:47:44 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" and TAKAHASHI Mutsuji +.\" +.\" Japanese Version Last Modified Sun Jan 11 03:55:54 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated & Modefied Sat Feb 27 1999 by Shouichi Saito +.\" +.\" WORD: serial mouse ¥·¥ê¥¢¥ë¥Þ¥¦¥¹ +.\" WORD: interface ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\" WORD: RS232/V24 RS232/V24 +.\" WORD: dialout line ¥À¥¤¥¢¥ë¥¢¥¦¥È¥é¥¤¥ó +.\" WORD: pinout ¥Ô¥óÇÛÎó +.\" WORD: Microsoft-compatible ¥Þ¥¤¥¯¥í¥½¥Õ¥È¸ß´¹ +.\" +.TH MOUSE 4 1996-02-10 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O mouse \- serial mouse interface +.SH ̾Á° +mouse \- ¥·¥ê¥¢¥ë¥Þ¥¦¥¹¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O .SH CONFIGURATION +.SH ÀßÄê +.\"O Serial mice are connected to a serial RS232/V24 dialout line, see +.\"O .BR ttyS (4) +.\"O for a description. +¥·¥ê¥¢¥ë¥Þ¥¦¥¹¤Ï RS232/V24 ¥À¥¤¥¢¥ë¥¢¥¦¥È¥é¥¤¥ó¤ËÀܳ¤µ¤ì¤ë¡£ +RS232/V24 ¥À¥¤¥¢¥ë¥¢¥¦¥È¥é¥¤¥ó ¤Ë¤Ä¤¤¤Æ¤Ï +.BR ttyS (4) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .SS Introduction +.SS ³µÀâ +.\"O The pinout of the usual 9 pin plug as used for serial mice is: +¥·¥ê¥¢¥ë¥Þ¥¦¥¹¤Ç»È¤ï¤ì¤ëÉáÄ̤Π9 ¥Ô¥ó¥×¥é¥°¤Î¥Ô¥óÇÛÎó¤Ï°Ê²¼¤Ç¤¢¤ë: +.TS +center; +r c l. +pin name used for +2 RX Data +3 TX -12 V, Imax = 10 mA +4 DTR +12 V, Imax = 10 mA +7 RTS +12 V, Imax = 10 mA +5 GND Ground +.TE + +.\"O This is the specification, in fact 9 V suffices with most mice. +¤³¤ì¤Ï»ÅÍͽñ¤Ç¤¢¤ê¡¢¼ÂºÝ¤Ï¤Û¤È¤ó¤É¤Î¥Þ¥¦¥¹¤Ç¤Ï 9 V ¤Ç½½Ê¬¤Ç¤¢¤ë¡£ +.PP +.\"O The mouse driver can recognize a mouse by dropping RTS to low and raising +.\"O it again. +.\"O About 14 ms later the mouse will send 0x4D (\(aqM\(aq) on the data line. +.\"O After a further 63 ms, a Microsoft-compatible 3-button mouse will send +.\"O 0x33 (\(aq3\(aq). +¥Þ¥¦¥¹¥É¥é¥¤¥Ð¤Ï RTS ¤ò¥í¡¼(low)¤ËÍ¡¢ºÆ¤Ó¾å¤²¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥Þ¥¦¥¹¤òǧ¼±¤Ç¤­ +¤ë¡£¤ª¤è¤½ 14 ms ¸å¡¢¥Þ¥¦¥¹¤Ï¥Ç¡¼¥¿¥é¥¤¥ó¾å¤Ë 0x4D (\(aqM\(aq) ¤òÁ÷¤ë¤À¤í¤¦¡£¤µ¤é +¤Ë 63ms ¤¢¤È¡¢¥Þ¥¤¥¯¥í¥½¥Õ¥È¸ß´¹ 3¥Ü¥¿¥ó¥Þ¥¦¥¹¤Ï 0x33 (\(aq3\(aq) ¤òÁ÷¤ë¡£ +.PP +.\"O The relative mouse movement is sent as \fIdx\fP (positive means right) +.\"O and \fIdy\fP (positive means down). +.\"O Various mice can operate at different speeds. +.\"O To select speeds, cycle through the +.\"O speeds 9600, 4800, 2400 and 1200 bit/s, each time writing the two characters +.\"O from the table below and waiting 0.1 seconds. +.\"O The following table shows available speeds and the strings that select them: +¥Þ¥¦¥¹¤ÎÁêÂÐŪ¤Ê°ÜÆ°¤Ï¡¢\fIdx\fP(Àµ¤¬±¦)¤È\fIdy\fP(Àµ¤¬²¼)¤È¤·¤ÆÅÁ¤¨¤é¤ì¤ë¡£ +³Æ¼ï¤Î¥Þ¥¦¥¹¤Ï°Û¤Ê¤Ã¤¿¥¹¥Ô¡¼¥É¤ÇÁàºî¤Ç¤­¤ë¡£¥¹¥Ô¡¼¥É¤òÁªÂò¤¹¤ë¤Ë¤Ï¡¢ +²¼¤Îɽ¤Î£²Ê¸»ú¤òÁ÷¤Ã¤Æ¤«¤é 0.1 ÉÃÂԤĤ³¤È¤Ç¡¢9600, 4800, 2400, 1200 +bit/s ¤ò½ç¤ËÁª¤Ù¤ë¡£ +°Ê²¼¤Îɽ¤Ç¤ÏÁªÂò²Äǽ¤Ê¥¹¥Ô¡¼¥É¤È¤½¤ì¤òÁªÂò¤¹¤ë¤¿¤á¤Îʸ»úÎó¤ò¼¨¤·¤Æ¤¤¤ë¡£ +.TS +center; +l l. +bit/s string +9600 *q +4800 *p +2400 *o +1200 *n +.TE + +.\"O The first byte of a data packet can be used to synchronization purposes. +¥Ç¡¼¥¿¥Ñ¥±¥Ã¥È¤ÎÂè 1 ¥Ð¥¤¥È¤ÏƱ´ü¤ò¤È¤ë¤Î¤ËÍøÍѤǤ­¤ë¡£ +.\"O .SS "Microsoft protocol" +.SS "¥Þ¥¤¥¯¥í¥½¥Õ¥È ¥×¥í¥È¥³¥ë(Microsoft Protocol)" +.\"O The \fBMicrosoft\fP protocol uses 1 start bit, 7 data bits, no parity +.\"O and one stop bit at the speed of 1200 bits/sec. +.\"O Data is sent to RxD in 3-byte packets. +.\"O The \fIdx\fP and \fIdy\fP movements are sent as +.\"O two's-complement, \fIlb\fP (\fIrb\fP) are set when the left (right) +.\"O button is pressed: +\fB¥Þ¥¤¥¯¥í¥½¥Õ¥È\fP¥×¥í¥È¥³¥ë¤Ï¡¢1200 bits/sec ¤Î¥¹¥Ô¡¼¥É¤Ç¡¢1 ¥¹ +¥¿¡¼¥È¥Ó¥Ã¥È(1 start bit)¡¢7 ¥Ç¡¼¥¿¥Ó¥Ã¥È(7 data bits)¡¢¥Ñ¥ê¥Æ¥£¤Ê +¤·¡¢1 ¥¹¥È¥Ã¥×¥Ó¥Ã¥È(1 stop bit)¤Ç¤¢¤ë¡£ +¥Ç¡¼¥¿¤Ï RxD ¤Ë 3 ¥Ð¥¤¥È¤Î¥Ñ¥±¥Ã¥È¤È¤·¤ÆÁ÷¤é¤ì¤ë¡£\fIdx\fP ¤È \fIdy\fP +¤ÎÆ°¤­¤Ï 2 ¤ÎÊä¿ôɽ¼¨¤ÇÁ÷¤é¤ì¡¢º¸(±¦)¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿»þ¤Ë¤Ï \fIlb\fP +(\fIrb\fP)¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.TS +center; +r c c c c c c c. +byte d6 d5 d4 d3 d2 d1 d0 +1 1 lb rb dy7 dy6 dx7 dx6 +2 0 dx5 dx4 dx3 dx2 dx1 dx0 +3 0 dy5 dy4 dy3 dy2 dy1 dy0 +.TE +.\"O .SS "3-button Microsoft protocol" +.SS "3¤Ä¥Ü¥¿¥ó ¥Þ¥¤¥¯¥í¥½¥Õ¥È ¥×¥í¥È¥³¥ë(3-button Microsoft protocol)" +.\"O Original Microsoft mice only have two buttons. +.\"O However, there are some +.\"O three button mice which also use the Microsoft protocol. +.\"O Pressing or +.\"O releasing the middle button is reported by sending a packet with zero +.\"O movement and no buttons pressed. +.\"O (Thus, unlike for the other two buttons, the status of the middle +.\"O button is not reported in each packet.) +ËÜÍè¤Î¥Þ¥¤¥¯¥í¥½¥Õ¥È¥Þ¥¦¥¹¤Ï 2 ¤Ä¤Î¥Ü¥¿¥ó¤·¤«»ý¤¿¤Ê¤¤¡£¤·¤«¤·¡¢3 ¤Ä¥Ü¥¿¥ó +¤Î¥Þ¥¦¥¹¤Ç¥Þ¥¤¥¯¥í¥½¥Õ¥È¥×¥í¥È¥³¥ë¤Îʪ¤â¸ºß¤¹¤ë¡£¿¿Ãæ¤Î¥Ü¥¿¥ó¤ò²¡¤¹¡¢ +¤Þ¤¿¤ÏÊü¤¹¤È¤¤¤¦¤³¤È¤Ï¡¢Æ°¤­¥¼¥í¤Ç¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤¤¤¦¥Ñ¥±¥Ã¥È +¤òÁ÷¤ë¤³¤È¤ÇÅÁ¤¨¤é¤ì¤ë¡£(½¾¤Ã¤Æ¾¤ÎÆó¤Ä¤Î¥Ü¥¿¥ó¤È°ã¤¤¡¢¿¿Ãæ¤Î¥Ü¥¿ +¥ó¤Î¥¹¥Æ¡¼¥¿¥¹¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥Ñ¥±¥Ã¥È¤«¤é¤ÏÅÁ¤ï¤Ã¤ÆÍè¤Ê¤¤¡£) +.\"O .SS "Logitech protocol" +.SS "¥í¥¸¥Æ¥Ã¥¯ ¥×¥í¥È¥³¥ë(Logitech protocol)" +.\"O Logitech serial 3-button mice use a different extension of the +.\"O Microsoft protocol: when the middle button is up, the above 3-byte +.\"O packet is sent. +.\"O When the middle button is down a 4-byte packet is +.\"O sent, where the 4th byte has value 0x20 (or at least has the 0x20 +.\"O bit set). +.\"O In particular, a press of the middle button is reported +.\"O as 0,0,0,0x20 when no other buttons are down. +¥í¥¸¥Æ¥Ã¥¯ ¥·¥ê¥¢¥ë 3¤Ä¥Ü¥¿¥ó¥Þ¥¦¥¹¤Ï¡¢¥Þ¥¤¥¯¥í¥½¥Õ¥È ¥×¥í¥È¥³¥ë¤È¤Ï +°Û¤Ê¤Ã¤¿³ÈÄ¥¤ò¤·¤Æ¤¤¤ë¡£:¿¿Ãæ¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤Æ¤Ê¤¤¤È¡¢¾åµ­ 3¥Ð¥¤¥È¤Î +¥Ñ¥±¥Ã¥È¤¬Á÷¤é¤ì¤ë¡£¿¿Ãæ¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤Æ¤¤¤ë¤È¡¢4¥Ð¥¤¥È¤Î¥Ñ¥±¥Ã¥È¤¬ +Á÷¤é¤ì¤ë¡£Â裴¥Ð¥¤¥È¤Ï 0x20 ¤ÎÃͤò»ý¤Ã¤Æ¤¤¤ë(¤¢¤ë¤¤¤Ï¡¢¾¯¤Ê¤¯¤È¤â 0x20 +¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë)¡£ ⤷¡¢Â¾¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤Æ¤¤¤Ê¤¤¾õÂ֤ǡ¢ +¿¿Ãæ¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤ë¤È¡¢0,0,0,0x20 ¤ÈÅÁ¤¨¤é¤ì¤ë¡£ +.\"O .SS "Mousesystems protocol" +.SS "¥Þ¥¦¥¹¥·¥¹¥Æ¥à¥º ¥×¥í¥È¥³¥ë(Mousesystems protocol)" +.\"O The \fBMousesystems\fP protocol uses 1 start bit, 8 data bits, no parity +.\"O and two stop bits at the speed of 1200 bits/sec. +.\"O Data is sent to RxD in +.\"O 5-byte packets. +.\"O \fIdx\fP is sent as the sum of the two two's-complement +.\"O values, \fIdy\fP is send as negated sum of the two two's-complement +.\"O values. +.\"O \fIlb\fP (\fImb\fP, \fIrb\fP) are cleared when the left (middle, +.\"O right) button is pressed: +\fB¥Þ¥¦¥¹¥·¥¹¥Æ¥à¥º\fP¥×¥í¥È¥³¥ë¤Ï¡¢1200 bits/sec¤Ç¡¢1 ¥¹¥¿¡¼¥È¥Ó¥Ã¥È¡¢ +8 ¥Ç¡¼¥¿¥Ó¥Ã¥È¡¢¥Ñ¥ê¥Æ¥£¤Ê¤·¡¢2 ¥¹¥È¥Ã¥×¥Ó¥Ã¥È¤Ç¤¢¤ë¡£ +¥Ç¡¼¥¿¤Ï¡¢RxD ¤Ë 5 ¥Ð¥¤¥È¤Î¥Ñ¥±¥Ã¥È¤È¤·¤ÆÁ÷¤é¤ì¤ë¡£\fIdx\fP ¤Ï 2 ¤Ä¤Î +2 ¤ÎÊä¿ô¤ÎϤȤ·¤ÆÁ÷¤é¤ì¡¢\fIdy\fP ¤Ï 2 ¤Ä¤Î 2 ¤ÎÊä¿ô¤ÎϤÎÈÝÄê +¤È¤·¤ÆÁ÷¤é¤ì¤ë¡£º¸(Ãæ¡¢±¦)¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿»þ¤Ë¤Ï\fIlb\fP +(\fImb\fP, \fIrb\fP) ¤¬¥¯¥ê¥¢¤µ¤ì¤ë¡£ +.TS +center; +r c c c c c c c c. +byte d7 d6 d5 d4 d3 d2 d1 d0 +1 1 0 0 0 0 lb mb rb +2 0 dxa6 dxa5 dxa4 dxa3 dxa2 dxa1 dxa0 +3 0 dya6 dya5 dya4 dya3 dya2 dya1 dya0 +4 0 dxb6 dxb5 dxb4 dxb3 dxb2 dxb1 dxb0 +5 0 dyb6 dyb5 dyb4 dyb3 dyb2 dyb1 dyb0 +.TE + +.\"O Bytes 4 and 5 describe the change that occurred since bytes 2 and 3 +.\"O were transmitted. +Âè 4,5 ¥Ð¥¤¥È¤Ë¤Ï¡¢Âè 2,3 ¥Ð¥¤¥È¤¬Á÷¤é¤ì¤¿¤¢¤ÈÀ¸¤¸¤¿Êѹ¹¤¬µ­½Ò¤µ¤ì¤ë¡£ +.\"O .SS "Sun protocol" +.SS "¥µ¥ó ¥×¥í¥È¥³¥ë(Sun protocol)" +.\"O The \fBSun\fP protocol is the 3-byte version of the above 5-byte +.\"O Mousesystems protocol: the last two bytes are not sent. +\fB¥µ¥ó\fP ¥×¥í¥È¥³¥ë¤Ï¡¢¾åµ­¤Î 5 ¥Ð¥¤¥È ¥Þ¥¦¥¹¥·¥¹¥Æ¥à¥×¥í¥È¥³¥ë¤Î 3 +¥Ð¥¤¥ÈÈǤǤ¹¡£¸å¤Î 2 ¥Ð¥¤¥È¤ÏÁ÷¤é¤ì¤Þ¤»¤ó¡£ +.\"O .SS "MM protocol" +.SS "MM ¥×¥í¥È¥³¥ë(MM protocol)" +.\"O The \fBMM\fP protocol uses 1 start bit, 8 data bits, odd parity and one +.\"O stop bit at the speed of 1200 bits/sec. +.\"O Data is sent to RxD in 3-byte +.\"O packets. +.\"O \fIdx\fP and \fIdy\fP are sent as single signed values, the +.\"O sign bit indicating a negative value. +.\"O \fIlb\fP (\fImb\fP, \fIrb\fP) are +.\"O set when the left (middle, right) button is pressed: +\fBMM\fP ¥×¥í¥È¥³¥ë¤Ï 1200 bits/sec ¤Ç 1 ¥¹¥¿¡¼¥È¥Ó¥Ã¥È¡¢8 ¥Ç¡¼¥¿¥Ó¥Ã +¥È¡¢´ñ¿ô¥Ñ¥ê¥Æ¥£¡¢ 1 ¥¹¥È¥Ã¥×¥Ó¥Ã¥È¤ò»È¤¦¡£¥Ç¡¼¥¿¤Ï RxD ¤Ë 3 ¥Ð¥¤¥È¤Î¥Ñ +¥±¥Ã¥È¤È¤·¤ÆÁ÷¤é¤ì¤ë¡£\fIdx\fP ¤È \fIdy\fP ¤Ï°ì¤Ä¤ÎÉä¹æ¤Ä¤­¤ÎÃͤȤ·¤Æ +Á÷¤é¤ì¡¢¥µ¥¤¥ó¥Ó¥Ã¥È¤ÏÉé¤ÎÃͤòɽ¤¹¡£º¸(Ãæ¡¢±¦)¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿»þ¤Ë¤Ï +\fIlb\fP (\fImb\fP, \fIrb\fP)¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.TS +center; +r c c c c c c c c. +byte d7 d6 d5 d4 d3 d2 d1 d0 +1 1 0 0 dxs dys lb mb rb +2 0 dx6 dx5 dx4 dx3 dx2 dx1 dx0 +3 0 dy6 dy5 dy4 dy3 dy2 dy1 dy0 +.TE +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /dev/mouse +.\"O A commonly used symlink pointing to a mouse device. +°ìÈÌŪ¤Ë¥Þ¥¦¥¹¥Ç¥Ð¥¤¥¹¤ò¤µ¤¹¤Î¤Ë»È¤ï¤ì¤ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ttyS (4), +.BR gpm (8) diff --git a/draft/man4/null.4 b/draft/man4/null.4 new file mode 100644 index 00000000..5441a66e --- /dev/null +++ b/draft/man4/null.4 @@ -0,0 +1,81 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:00:12 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Tue Feb 6 16:42:51 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Sun Jan 11 04:04:34 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: special file ¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë +.\" WORD: end of file end of file +.\" WORD: \0 character \0 ʸ»ú(null ʸ»ú) +.\" WORD: device ¥Ç¥Ð¥¤¥¹ +.\" +.TH NULL 4 1992-11-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +.\"O null, zero \- data sink +null, zero \- ¥Ç¡¼¥¿¤ÎÁݤ­¤À¤á +.SH ÀâÌÀ +.\"O Data written to a \fBnull\fP or \fBzero\fP special file is discarded. +\fBnull\fP ¤Þ¤¿¤Ï \fBzero\fP ¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë(special file)¤Ë +½ñ¤«¤ì¤¿¥Ç¡¼¥¿¤Ï¼Î¤Æ¤é¤ì¤ë¡£ +.PP +.\"O Reads from the \fBnull\fP special file always return end of file (i.e., +.\"O .BR read (2) +.\"O returns 0), whereas +.\"O reads from \fBzero\fP always return bytes containing zero (\e0 characters). +\fBnull\fP ¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤òÆɤà¤È¾ï¤Ë end of file ¤¬ÊÖ¤µ¤ì (¤Ä¤Þ¤ê¡¢ +.BR read (2) +¤Ï 0 ¤òÊÖ¤¹)¡¢ÂоÈŪ +¤Ë \fBzero\fP ¤òÆɤà¤È¾ï¤Ë¥Ð¥¤¥È¿ô 0 (\e0 ʸ»ú) ¤¬ÊÖ¤µ¤ì¤ë¡£ +.LP +.\"O \fBnull\fP and \fBzero\fP are typically created by: +\fBnull\fP ¤È \fBzero\fP ¤Ï°ìÈÌŪ¤Ë¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤é¤ì¤ë: +.RS +.sp +mknod \-m 666 /dev/null c 1 3 +.br +mknod \-m 666 /dev/zero c 1 5 +.br +chown root:root /dev/null /dev/zero +.RE +.SH ¥Õ¥¡¥¤¥ë +.I /dev/null +.br +.I /dev/zero +.SH Ãí°Õ +.\"O If these devices are not writable and readable for all users, many +.\"O programs will act strangely. +¤³¤ì¤é¤Î¥Ç¥Ð¥¤¥¹¤¬Á´¤Æ¤Î¥æ¡¼¥¶¤ËÂФ·¤ÆÆɤ߽ñ¤­²Äǽ¤Ç¤Ê¤¤¾ì¹ç¡¢ +¿¤¯¤Î¥×¥í¥°¥é¥à¤ÎÆ°ºî¤¬¤ª¤«¤·¤¯¤Ê¤ë¤À¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR full (4) +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ diff --git a/draft/man4/pts.4 b/draft/man4/pts.4 new file mode 100644 index 00000000..4ff7de62 --- /dev/null +++ b/draft/man4/pts.4 @@ -0,0 +1,140 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This man page was written by Jeremy Phelps . +.\" Notes added - aeb +.\" Redistribute and revise at will. +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 00:28:17 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: pseudo-terminal µ¼»÷üËö +.\"WORD: pts µ¼»÷üËö +.\" +.TH PTS 4 2002-10-09 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ptmx, pts \- pseudo-terminal master and slave +ptmx, pts \- µ¼»÷üËö¤Î¥Þ¥¹¥¿¤È¥¹¥ì¡¼¥Ö +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The file \fI/dev/ptmx\fP is a character file with major number 5 and +.\"O minor number 2, usually of mode 0666 and owner.group of root.root. +.\"O It is used to create a pseudo-terminal master and slave pair. +¥Õ¥¡¥¤¥ë \fI/dev/ptmx\fP ¤Ï¡¢¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ (major number) 5¡¢ +¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ (minor number) 2 ¤ò»ý¤Ä¥­¥ã¥é¥¯¥¿¡¦¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¡¢ +Ä̾¥â¡¼¥É¤Ï 0666 ¤Ç¡¢½êÍ­¼Ô.¥°¥ë¡¼¥×¤Ï root.root ¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢µ¼»÷üËö (pseudo-terminal) ¤Î¥Þ¥¹¥¿¤È¥¹¥ì¡¼¥Ö¤Î +¥Ú¥¢¤òºîÀ®¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +.PP +.\"O When a process opens \fI/dev/ptmx\fP, it gets a file +.\"O descriptor for a pseudo-terminal master (PTM), +.\"O and a pseudo-terminal slave (PTS) device is created in the +.\"O .I /dev/pts +.\"O directory. +.\"O Each file descriptor obtained by opening \fI/dev/ptmx\fP +.\"O is an independent PTM with its own associated PTS, whose path can +.\"O be found by passing the descriptor to +.\"O .BR ptsname (3). +¥×¥í¥»¥¹¤¬ \fI/dev/ptmx\fP ¤ò¥ª¡¼¥×¥ó¤¹¤ë¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Ë¤Ï +µ¼»÷üËö¥Þ¥¹¥¿ (pseudo-terminal master; PTM) ¤Ø¤Î¥Õ¥¡¥¤¥ë¡¦ +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÊÖ¤µ¤ì¡¢ +.I /dev/pts +¥Ç¥£¥ì¥¯¥È¥ê¤Ëµ¼»÷üËö¥¹¥ì¡¼¥Ö (pseudo-terminal slave; PTS) +¥Ç¥Ð¥¤¥¹¤¬ºîÀ®¤µ¤ì¤ë¡£ +\fI/dev/ptmx\fP ¤ò¥ª¡¼¥×¥ó¤·¤ÆÆÀ¤é¤ì¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +¤½¤ì¤¾¤ìÆÈΩ¤Î PTM ¤Ç¤¢¤ê¡¢Âбþ¤¹¤ë PTS ¤ò³Æ¡¹»ý¤Ä¡£ +PTS ¤Î¥Ñ¥¹Ì¾¤Ï¡¢PTM ¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +.BR ptsname (3) +¤ËÅϤ¹¤ÈÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O Before opening the pseudo-terminal slave, you must pass the master's file +.\"O descriptor to +.\"O .BR grantpt (3) +.\"O and +.\"O .BR unlockpt (3). +µ¼»÷üËö¥¹¥ì¡¼¥Ö¤ò¥ª¡¼¥×¥ó¤¹¤ëÁ°¤Ë¡¢É¬¤º¡¢¥Þ¥¹¥¿¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +°ú¤­¿ô¤È¤·¤Æ +.BR grantpt (3) +¤È +.BR unlockpt (3) +¤ò¸Æ¤Ó½Ð¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O Once both the pseudo-terminal master and slave are open, the slave provides +.\"O processes with an interface that is identical to that of a real terminal. +µ¼»÷üËö¤Î¥Þ¥¹¥¿¤È¥¹¥ì¡¼¥Ö¤ÎξÊý¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¸å¤Ï¡¢¥¹¥ì¡¼¥Ö¤Ï¡¢ +¥×¥í¥»¥¹¤ËÂФ·¤Æ¡¢¼ÂüËö (real terminal) ¤ÈÁ´¤¯Æ±¤¸¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +.PP +.\"O Data written to the slave is presented on the master descriptor as input. +.\"O Data written to the master is presented to the slave as input. +¥¹¥ì¡¼¥Ö¤Ë½ñ¤«¤ì¤¿¥Ç¡¼¥¿¤Ï¥Þ¥¹¥¿¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ëÆþÎϤȤ·¤Æ°·¤ï¤ì¡¢ +¥Þ¥¹¥¿¤Ë½ñ¤«¤ì¤¿¥Ç¡¼¥¿¤Ï¥¹¥ì¡¼¥Ö¤ËÂФ¹¤ëÆþÎϤȤ·¤Æ°·¤ï¤ì¤ë¡£ +.PP +.\"O In practice, pseudo-terminals are used for implementing terminal emulators +.\"O such as +.\"O .BR xterm (1), +.\"O in which data read from the pseudo-terminal master is interpreted by the +.\"O application in the same way +.\"O a real terminal would interpret the data, and for implementing remote-login +.\"O programs such as +.\"O .BR sshd (8), +.\"O in which data read from the pseudo-terminal master is sent across the network +.\"O to a client program that is connected to a terminal or terminal emulator. +¼ÂÎã¤ò¤¢¤²¤ë¤È¡¢µ¼»÷üËö¤Ï +.BR xterm (1) +¤Î¤è¤¦¤ÊüËö¥¨¥ß¥å¥ì¡¼¥¿¤ò¼ÂÁõ¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +üËö¥¨¥ß¥å¥ì¡¼¥¿¤Ç¤Ï¡¢µ¼»÷üËö¤Î¥Þ¥¹¥¿¤«¤éÆɤ߹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤Ï¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤È¤Ã¤Æ¼ÂüËö¤Î¥Ç¡¼¥¿¤ÈÁ´¤¯Æ±¤¸¤â¤Î¤Î¤è¤¦¤Ë¸«¤¨¤ë¡£ +¤Þ¤¿¡¢ +.BR sshd (8) +¤Î¤è¤¦¤Ê¥ê¥â¡¼¥È¡¦¥í¥°¥¤¥óÍÑ¤Î¥×¥í¥°¥é¥à¤Î¼ÂÁõ¤Ç¤Ï¡¢ +µ¼»÷üËö¥Þ¥¹¥¿¤«¤éÆɤ߹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤ò·Ðͳ¤·¤Æ¡¢ +üËö¤äüËö¥¨¥ß¥å¥ì¡¼¥¿¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¥¯¥é¥¤¥¢¥ó¥È¡¦¥×¥í¥°¥é¥à¤ËÁ÷¿®¤µ¤ì¤ë¡£ +.PP +.\"O Pseudo-terminals can also be used to send input to programs that normally +.\"O refuse to read input from pipes (such as +.\"O .BR su (1), +.\"O and +.\"O .BR passwd (1)). +µ¼»÷üËö¤Ï¡¢ +.RB ( su (1) +¤ä +.BR passwd (1) +¤Î¤è¤¦¤Ê) Ä̾ï¤Ï¥Ñ¥¤¥×¤«¤é¤ÎÆþÎϤòµñÈݤ¹¤ë¥×¥í¥°¥é¥à¤Ë¡¢ +ÆþÎϤòÁ÷¿®¤¹¤ë¤¿¤á¤Ë¤â»ÈÍѤǤ­¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.IR /dev/ptmx , +.I /dev/pts/* +.\"O .SH NOTES +.SH È÷¹Í +.\"O The Linux support for the above (known as Unix98 pty naming) +.\"O is done using the +.\"O .I devpts +.\"O file system, that should be mounted on +.\"O .IR /dev/pts . +(Unix98 pty naming ¤È¸Æ¤Ð¤ì¤ë) ¾åµ­¤Îµ¡Ç½¤Î Linux ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¡¢ +Ä̾ï +.I /dev/pts +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë¤Ï¤º¤Î +.I devpts +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÄ̤·¤Æ¼Â¸½¤µ¤ì¤Æ¤¤¤ë¡¢ +.LP +.\"O Before this Unix98 scheme, master ptys were called +.\"O .IR /dev/ptyp0 ", ..." +.\"O and slave ptys +.\"O .IR /dev/ttyp0 ", ..." +.\"O and one needed lots of preallocated device nodes. +¤³¤Î Unix98 ¥¹¥­¡¼¥à¤¬Æ³Æþ¤µ¤ì¤ëÁ°¤Ï¡¢¥Þ¥¹¥¿µ¼»÷üËö¤Ï +.IR /dev/ptyp0 ", ..." +¡¢¥¹¥ì¡¼¥Öµ¼»÷üËö¤Ï +.IR /dev/ttyp0 ", ..." +¤È¸Æ¤Ð¤ì¤Æ¤ª¤ê¡¢¤¢¤é¤«¤¸¤á¤¿¤¯¤µ¤ó¤Î¥Ç¥Ð¥¤¥¹¡¦¥Î¡¼¥É¤ò³ä¤êÅö¤Æ¤Æ +¤ª¤¯É¬Íפ¬¤¢¤Ã¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getpt (3), +.BR grantpt (3), +.BR ptsname (3), +.BR unlockpt (3), +.BR pty (7) diff --git a/draft/man4/ram.4 b/draft/man4/ram.4 new file mode 100644 index 00000000..967ca41c --- /dev/null +++ b/draft/man4/ram.4 @@ -0,0 +1,57 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:01:11 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Tue Dec 28 17:23:13 JST 1996 +.\" by ISHIKAWA Mutsumi +.\" Japanese Version Last Modified Sun Jan 11 03:55:54 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: ram disk ¥é¥à¥Ç¥£¥¹¥¯ +.\" WORD: raw mode ¥í¡¼¥â¡¼¥É +.\" WORD: block device ¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ +.TH RAM 4 1992-11-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ram \- RAM ¥Ç¥£¥¹¥¯¥Ç¥Ð¥¤¥¹ +.SH ÀâÌÀ +\fIram\fP ¥Ç¥Ð¥¤¥¹¤Ï RAM ¥Ç¥£¥¹¥¯¤Ë¥í¡¼¥â¡¼¥É (raw mode) ¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î +¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ (block device) ¤Ç¤¢¤ë¡£ +.LP +ŵ·¿Åª¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤é¤ì¤ë¡£: +.RS +.sp +mknod \-m 660 /dev/ram b 1 1 +.br +chown root:disk /dev/ram +.RE +.SH ¥Õ¥¡¥¤¥ë +/dev/ram +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR mount (8) +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ diff --git a/draft/man4/random.4 b/draft/man4/random.4 new file mode 100644 index 00000000..9fdc4d43 --- /dev/null +++ b/draft/man4/random.4 @@ -0,0 +1,381 @@ +.\" Copyright (c) 1997 John S. Kallal (kallal@voicenet.com) +.\" +.\" 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. +.\" +.\" Some changes by tytso and aeb. +.\" +.\" 2004-12-16, John V. Belmonte/mtk, Updated init and quit scripts +.\" 2004-04-08, AEB, Improved description of read from /dev/urandom +.\" 2008-06-20, George Spelvin , +.\" Matt Mackall +.\" Add a Usage subsection that recommends most users to use +.\" /dev/urandom, and emphasizes parsimonious usage of /dev/random. +.\" +.\" Japanese Version Copyright (c) 1998 +.\" ISHIKAWA Mutsumi, all rights reserved. +.\" Translated into Japanese Mon Jan 12 03:20:27 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Japanese Version Last Modified Thu Feb 5 21:08:33 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated & Modified Sun Jun 6 14:48:03 JST 2004 +.\" by Yuichi SATO +.\" Updated & Modified Tue Jan 18 04:21:16 JST 2005 by Yuichi SATO +.\" Updated & Modified Fri Apr 22 03:44:01 JST 2005 by Yuichi SATO +.\" Updated 2008-08-13, Akihiro MOTOKI , LDP v3.05 +.\" +.\"WORD: random generator Íð¿ô¥¸¥§¥Í¥ì¡¼¥¿ +.\" +.TH RANDOM 4 2008-06-20 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O random, urandom \- kernel random number source devices +random, urandom \- ¥«¡¼¥Í¥ëÍð¿ô¥½¡¼¥¹¥Ç¥Ð¥¤¥¹ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The character special files \fI/dev/random\fP and +.\"O \fI/dev/urandom\fP (present since Linux 1.3.30) +.\"O provide an interface to the kernel's random number generator. +(Linux 1.3.30 ¤«¤éÄ󶡤µ¤ì¤Æ¤¤¤ë) \fI/dev/random\fP ¡¢ +\fI/dev/urandom\fP ¥­¥ã¥é¥¯¥¿¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ï +¥«¡¼¥Í¥ëÍð¿ô¥¸¥§¥Í¥ì¡¼¥¿¤Ø¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +.\"O File \fI/dev/random\fP has major device number 1 +.\"O and minor device number 8. +.\"O File \fI/dev/urandom\fP has major device number 1 and minor device number 9. +\fI/dev/random\fP ¥Õ¥¡¥¤¥ë¤Ï¥á¥¸¥ã¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 1 +¥Þ¥¤¥Ê¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 8 ¤Ç¤¢¤ë¡£ +\fI/dev/urandom\fP ¤Ï¥á¥¸¥ã¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 1 +¥Þ¥¤¥Ê¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 9 ¤Ç¤¢¤ë¡£ +.LP +.\"O The random number generator gathers environmental noise +.\"O from device drivers and other sources into an entropy pool. +Íð¿ô¥¸¥§¥Í¥ì¡¼¥¿¤Ï¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ä¤½¤Î¾¤Î¸»¤«¤é¤Î´Ä¶­¥Î¥¤¥º¤ò +¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Ø½¸¤á¤ë¡£ +.\"O The generator also keeps an estimate of the +.\"O number of bits of noise in the entropy pool. +¤Þ¤¿¡¢¥¸¥§¥Í¥ì¡¼¥¿¤Ï¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ëÆâ¤Î¥Î¥¤¥º¤Î¥Ó¥Ã¥È¿ô¤Î¿äÄêÃͤò +ÊÝ»ý¤¹¤ë¡£ +.\"O From this entropy pool random numbers are created. +¤³¤Î¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤«¤éÍð¿ô¤¬À¸À®¤µ¤ì¤ë¡£ +.LP +.\"O When read, the \fI/dev/random\fP device will only return random bytes +.\"O within the estimated number of bits of noise in the entropy +.\"O pool. +.\"O \fI/dev/random\fP should be suitable for uses that need very +.\"O high quality randomness such as one-time pad or key generation. +Æɤ߹þ¤ß¤¬¹Ô¤ï¤ì¤ë¤È¡¢ +\fI/dev/random\fP +¥Ç¥Ð¥¤¥¹¤Ï¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Î¥Î¥¤¥º¥Ó¥Ã¥È¤Î¿ô¤Î¿äÄêÃͤΤ¦¤Á¡¢ +¥é¥ó¥À¥à¥Ð¥¤¥È¤Î¤ß¤òÊÖ¤¹¡£ +\fI/dev/random\fP ¤Ï¥ï¥ó¥¿¥¤¥à¥Ñ¥Ã¥É (one-time pad) ¤ä¸°¤ÎÀ¸À®¤Î¤è¤¦¤Ê +Èó¾ï¤Ë¹â¤¤ÉʼÁ¤ò»ý¤Ã¤¿Ìµºî°ÙÀ­¤¬É¬ÍפˤʤëÍÑÅӤ˸þ¤¤¤Æ¤¤¤ë¤À¤í¤¦¡£ +.\"O When the entropy pool is empty, reads from \fI/dev/random\fP will block +.\"O until additional environmental noise is gathered. +¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤¬¶õ¤Î»þ¤Ï¡¢\fI/dev/random\fP ¤«¤é¤ÎÆɤ߽Ф·¤Ï¡¢ +¹¹¤Ê¤ë´Ä¶­¥Î¥¤¥º¤¬ÆÀ¤é¤ì¤ë¤Þ¤Ç¡¢¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¡£ +.LP +.\"O A read from the \fI/dev/urandom\fP device will not block +.\"O waiting for more entropy. +.\"O As a result, if there is not sufficient entropy in the +.\"O entropy pool, the returned values are theoretically vulnerable to a +.\"O cryptographic attack on the algorithms used by the driver. +.\"O Knowledge of how to do this is not available in the current unclassified +.\"O literature, but it is theoretically possible that such an attack may +.\"O exist. +.\"O If this is a concern in your application, use \fI/dev/random\fP +.\"O instead. +\fI/dev/urandom\fP ¥Ç¥Ð¥¤¥¹¤«¤éÆɤ߽Ф·¤Ç¤Ï¡¢ +¥¨¥ó¥È¥í¥Ô¡¼¤¬¤è¤ê¹â¤¯¤Ê¤ë¤Î¤òÂԤĤ¿¤á¤Î¥Ö¥í¥Ã¥¯¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +¤½¤Î·ë²Ì¡¢¤â¤·¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Ë½½Ê¬¤Ê¥¨¥ó¥È¥í¥Ô¡¼¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +ÊÖ¤êÃͤϤ³¤Î¥É¥é¥¤¥Ð¤Ç»È¤ï¤ì¤Æ¤¤¤ë¥¢¥ë¥´¥ê¥º¥à¤Ë´ð¤Å¤¯°Å¹æ¹¶·â¤ËÂФ·¤Æ¡¢ +ÏÀÍýŪ¤Ë¤Ï¼å¤¯¤Ê¤ë¤³¤È¤Ë¤Ê¤ë¡£ +¤³¤Î¹¶·â¤ò¤É¤Î¤è¤¦¤Ë¹Ô¤¦¤«¤È¤¤¤¦»ö¤Ë¤Ä¤¤¤Æ¤Ï¡¢¸½ºß¸¦µæÏÀʸ¤Ê¤É¤Î +·Á¤ÇÆþ¼ê¤Ç¤­¤ë»ñÎÁ¤Ï¤Ê¤¤¡¢¤·¤«¤·¡¢¤½¤Î¤è¤¦¤Ê¹¶·â¤ÏÏÀÍýŪ¤Ë¸ºß²Äǽ¤Ç¤¢¤ë¡£ +¤â¤·¡¢¤³¤Î»ö¤¬¿´Çۤʤ顢(\fI/dev/urandom\fP ¤Ç¤Ï¤Ê¤¯) +\fI/dev/random\fP ¤òÍøÍѤ¹¤ì¤Ð¤¤¤¤¡£ +.\"O .SS Usage +.SS »È¤¤Êý +.\"O If you are unsure about whether you should use +.\"O .IR /dev/random +.\"O or +.\"O .IR /dev/urandom , +.\"O then probably you want to use the latter. +.\"O As a general rule, +.\"O .IR /dev/urandom +.\"O should be used for everything except long-lived GPG/SSL/SSH keys. +.I /dev/random +¤È +.I /dev/urandom +¤Î¤É¤Á¤é¤ò»È¤¦¤Ù¤­¤«Ì¤ä¿¾ì¹ç¡¢¤¿¤¤¤Æ¤¤¤Ï +.I /dev/urandom +¤ÎÊý¤ò»È¤¤¤¿¤¤¤È»×¤Ã¤Æ¤¤¤ë¤Ï¤º¤À¤í¤¦¡£ +°ìÈ̤ˡ¢Ä¹´ü¤ËÅϤäƻȤï¤ì¤ë GPG/SSL/SSH ¤Î¥­¡¼°Ê³°¤ÎÁ´¤Æ¤Î¤â¤Î¤Ë +.I /dev/urandom +¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O If a seed file is saved across reboots as recommended above (all major +.\"O Linux distributions have done this since 2000 at least), the output is +.\"O cryptographically secure against attackers without local root access as +.\"O soon as it is reloaded in the boot sequence, and perfectly adequate for +.\"O network encryption session keys. +.\"O Since reads from +.\"O .I /dev/random +.\"O may block, users will usually want to open it in nonblocking mode +.\"O (or perform a read with timeout), +.\"O and provide some sort of user notification if the desired +.\"O entropy is not immediately available. +²¼µ­¤Ç¿ä¾©¤·¤Æ¤¤¤ë¤è¤¦¤ËºÆµ¯Æ°¤ÎÁ°¸å¤ÇÍð¿ô¼ï¥Õ¥¡¥¤¥ë¤¬Êݸ¤µ¤ì¤ë¾ì¹ç +(Á´¤Æ¤Î¼ç¤Ê Linux ¤Î¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ï¾¯¤Ê¤¯¤È¤â 2000 ǯ°Ê¹ß¤Ï +Íð¿ô¼ï¤òÊݸ¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë)¡¢µ¯Æ°¥·¡¼¥±¥ó¥¹¤Ë¤ª¤¤¤ÆÍð¿ô¼ï¤¬ +ºÆ¥í¡¼¥É¤µ¤ì¤¿Ä¾¸å¤«¤é¡¢¤½¤Î½ÐÎÏ¤Ï¥í¡¼¥«¥ë¤Î¥ë¡¼¥È¥¢¥¯¥»¥¹¤¬¤Ç¤­¤Ê¤¤ +¹¶·â¼Ô¤ËÂФ·¤Æ°Å¹æŪ¤Ë°ÂÁ´¤Ê¤â¤Î¤È¤Ê¤ê¡¢¥Í¥Ã¥È¥ï¡¼¥¯°Å¹æ²½¤Î¥»¥Ã¥·¥ç¥ó¥­¡¼ +¤È¤·¤Æ»È¤¦¤Ë¤Ï´°Á´¤ËºÇŬ¤Ê¤â¤Î¤È¤Ê¤ë¡£ +.I /dev/random +¤«¤é¤ÎÆɤ߽Ф·¤ÏÄä»ß (block) ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¡¢¥æ¡¼¥¶¤ÏÉáÄÌ +¤³¤Î¥Õ¥¡¥¤¥ë¤òÈóÄä»ß (nonblocking) ¥â¡¼¥É¤Ç³«¤³¤¦¤È¤· +(¤â¤·¤¯¤Ï¥¿¥¤¥à¥¢¥¦¥È¤ò»ØÄꤷ¤ÆÆɤ߽Ф·¤ò¼Â¹Ô¤·)¡¢´õ˾¤¹¤ë¥ì¥Ù¥ë¤Î +¥¨¥ó¥È¥í¥Ô¡¼¤Ï¤¹¤°¤Ë¤ÏÍøÍѤǤ­¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢²¿¤é¤«¤ÎÄÌÃΤò¹Ô¤¦¤³¤È¤À¤í¤¦¡£ + +.\"O The kernel random-number generator is designed to produce a small +.\"O amount of high-quality seed material to seed a +.\"O cryptographic pseudo-random number generator (CPRNG). +.\"O It is designed for security, not speed, and is poorly +.\"O suited to generating large amounts of random data. +.\"O Users should be very economical in the amount of seed +.\"O material that they read from +.\"O .IR /dev/urandom +.\"O (and +.\"O .IR /dev/random ); +.\"O unnecessarily reading large quantities of data from this device will have +.\"O a negative impact on other users of the device. +¥«¡¼¥Í¥ë¤ÎÍð¿ô¥¸¥§¥Í¥ì¡¼¥¿¤Ï¡¢°Å¹æµ¿»÷Íð¿ô¥¸¥§¥Í¥ì¡¼¥¿ (Cryptographic +pseudo-random number generator; CPRNG) ¤Î¼ï¤È¤·¤Æ»ÈÍѤǤ­¤ë +¹âÉʼÁ¤ÊÍð¿ô¼ï¤ÎºàÎÁ¤ò¾¯¤·À¸À®¤¹¤ë¤¿¤á¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï®Å٤ǤϤʤ¯°ÂÁ´À­¤ò½Å»ë¤·¤ÆÀ߷פµ¤ì¤Æ¤ª¤ê¡¢ +¥é¥ó¥À¥à¤Ê¥Ç¡¼¥¿¤òÂçÎ̤ËÀ¸À®¤¹¤ë¤Î¤Ë¤ÏÁ´¤¯¤â¤Ã¤ÆŬ¤·¤Æ¤¤¤Ê¤¤¡£ +¥æ¡¼¥¶¤Ï +.I /dev/urandom +(¤È +.IR /dev/random ) +¤«¤éÆɤ߽Ф¹Íð¿ô¼ï¤ÎºàÎÁ¤ÎÎ̤ò¤Ç¤­¤ë¤À¤±ÀáÌ󤹤٤­¤Ç¤¢¤ë¡£ +¤³¤Î¥Ç¥Ð¥¤¥¹¤«¤éÉÔɬÍפËÂçÎ̤Υǡ¼¥¿¤òÆɤ߽Ф¹¤È¡¢¤³¤Î¥Ç¥Ð¥¤¥¹¤ò»È¤¦ +¾¤Î¥æ¡¼¥¶¤Ë¥Þ¥¤¥Ê¥¹¤Î±Æ¶Á¤òÍ¿¤¨¤Æ¤·¤Þ¤¦¤À¤í¤¦¡£ + +.\"O The amount of seed material required to generate a cryptographic key +.\"O equals the effective key size of the key. +.\"O For example, a 3072-bit RSA +.\"O or Diffie-Hellman private key has an effective key size of 128 bits +.\"O (it requires about 2^128 operations to break) so a key generator only +.\"O needs 128 bits (16 bytes) of seed material from +.\"O .IR /dev/random . +°Å¹æ¸°¤òÀ¸À®¤¹¤ë¤Î¤ËɬÍפÊÍð¿ô¼ï¤ÎºàÎÁ¤ÎÎ̤ϡ¢¸°¤Î¼Â¸ú¥µ¥¤¥º¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢3072 ¥Ó¥Ã¥È¤Î RSA ¤ª¤è¤Ó Diffie-Hellman ¤ÎÈëÌ©¸°¤Î¼Â¸ú¥µ¥¤¥º¤Ï +128 ¥Ó¥Ã¥È (¤³¤ÎÈëÌ©¸°¤òÇˤë¤Ë¤Ï 2^128 ²ó¤ÎÁàºî¤¬É¬ÍפȤ¤¤¦¤³¤È) ¤Ç¤¢¤ê¡¢ +¤½¤Î¤¿¤á¸°À¸À®´ï¤¬ +.I /dev/random +¤«¤éÆɤ߽Ф¹É¬Íפ¬¤¢¤ëÍð¿ô¼ï¤ÎºàÎÁ¤ÎÎÌ¤Ï 128 ¥Ó¥Ã¥È (16 ¥Ð¥¤¥È) ¤À¤±¤Ç¤¢¤ë¡£ + +.\"O While some safety margin above that minimum is reasonable, as a guard +.\"O against flaws in the CPRNG algorithm, no cryptographic primitive +.\"O available today can hope to promise more than 256 bits of security, +.\"O so if any program reads more than 256 bits (32 bytes) from the kernel +.\"O random pool per invocation, or per reasonable reseed interval (not less +.\"O than one minute), that should be taken as a sign that its cryptography is +.\"O .I not +.\"O skilfully implemented. +CPRNG ¥¢¥ë¥´¥ê¥º¥à¤Î·ç´Ù¤ËÂФ¹¤ëÊݸî¤È¤·¤Æ¡¢¤³¤ÎºÇ¾®ÃͤËÂФ·¤Æ¤¤¤¯¤é¤«¤Î +°ÂÁ´¾å¤Î¥Þ¡¼¥¸¥ó¤ò¼è¤ë¤Î¤Ï¤â¤Ã¤È¤â¤À¤¬¡¢¸½ºßÍøÍѲÄǽ¤Ê°Å¹æ¥×¥ê¥ß¥Æ¥£¥Ö¤Ç +256 ¥Ó¥Ã¥È¤è¤ê¿¤¯¤Î°ÂÁ´¤ÊÍð¿ô¤òɬÍפȤ¹¤ë¤è¤¦¤Ê¤â¤Î¤Ï¤Ê¤¤¡£ +µ¯Æ°¤¹¤ëÅ٤ˡ¢¤â¤·¤¯¤ÏÍð¿ô¼ï¤òÊѹ¹¤¹¤ëÂÅÅö¤Ê´Ö³Ö (1 ʬ¤è¤êû¤¯¤Ê¤ë¤³¤È¤Ï¤Ê¤¤) +¤ÎÅ٤ˡ¢¥«¡¼¥Í¥ë¤ÎÍð¿ô¥×¡¼¥ë¤«¤é 256 ¥Ó¥Ã¥È (32 ¥Ð¥¤¥È) ¤è¤ê¤¿¤¯¤µ¤óÆɤ߽Ф¹ +¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥×¥í¥°¥é¥à¤Î°Å¹æ½èÍý¤¬¤¦¤Þ¤¯¼ÂÁõ¤µ¤ì¤Æ¡Ö¤¤¤Ê¤¤¡×²ÄǽÀ­¤¬ +¤¢¤ë¤È¹Í¤¨¤ë¤Ù¤­¤Ç¤¢¤í¤¦¡£ +.\"O .SS Configuration +.SS ÀßÄê +.\"O If your system does not have +.\"O \fI/dev/random\fP and \fI/dev/urandom\fP created already, they +.\"O can be created with the following commands: +¥·¥¹¥Æ¥à¤Ë¤¢¤é¤«¤¸¤áºîÀ®¤µ¤ì¤¿ \fI/dev/random\fP ¤È +\fI/dev/urandom\fP ¤¬Â¸ºß¤·¤Ê¤¤¤Ê¤é¡¢¼¡¤Î¤è¤¦¤Ê¥³¥Þ¥ó¥É¤ÇºîÀ®¤Ç¤­¤ë¡£ +.nf + + mknod \-m 644 /dev/random c 1 8 + mknod \-m 644 /dev/urandom c 1 9 + chown root:root /dev/random /dev/urandom +.fi + +.\"O When a Linux system starts up without much operator interaction, +.\"O the entropy pool may be in a fairly predictable state. +¥ª¥Ú¥ì¡¼¥¿¤ÎÁàºî¤Ê¤·¤Ë Linux ¥·¥¹¥Æ¥à¤¬µ¯Æ°¤·¤¿Ä¾¸å¤Ï¡¢ +¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Ï°Õ³°À­¤Î˳¤·¤¤¶Ñ°ì¤Ê¾õÂ֤ˤ¢¤ë¤À¤í¤¦¡£ +.\"O This reduces the actual amount of noise in the entropy pool +.\"O below the estimate. +.\"O In order to counteract this effect, it helps to carry +.\"O entropy pool information across shut-downs and start-ups. +¤³¤ì¤Ë¤è¤ê¡¢¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Î¼ÂºÝ¤Î¥Î¥¤¥ºÎ̤Ïɾ²ÁÃͤè¤ê¾¯¤Ê¤¯¤Ê¤ë¡£ +¤³¤Î¸ú²Ì¤òÂǤÁ¾Ã¤¹¤¿¤á¤Ë¡¢¥·¥ã¥Ã¥È¥À¥¦¥ó¤«¤é (¼¡¤Î) µ¯Æ°»þ¤Þ¤Ç»ý¤Á±Û¤·¤¿ +¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Î¾ðÊ󤬽õ¤±¤Ë¤Ê¤ë¡£ +.\"O To do this, add the following lines to an appropriate script +.\"O which is run during the Linux system start-up sequence: +¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤ò»ý¤Á±Û¤¹¤¿¤á¤Ë¤Ï¡¢ +Linux ¥·¥¹¥Æ¥à¤Îµ¯Æ°»þ¤Ë¼Â¹Ô¤µ¤ì¤ëŬÀڤʥ¹¥¯¥ê¥×¥È¤Ë¡¢ +°Ê²¼¤Î¹Ô¤òÄɲ乤ì¤Ð¤è¤¤: +.nf + + echo "Initializing random number generator..." + random_seed=/var/run/random-seed +.\"O # Carry a random seed from start-up to start-up +.\"O # Load and then save the whole entropy pool + # Íð¿ô¼ï¤òº£²ó¤Î¥¹¥¿¡¼¥È¥¢¥Ã¥×¤«¤é¼¡²ó¤Î¥¹¥¿¡¼¥È¥¢¥Ã¥×¤Þ¤Ç»ý¤Á±Û¤¹¡£ + # ¥í¡¼¥É¤ò¹Ô¤¤¡¢¤½¤Î¸å¡¢Á´¤Æ¤Î¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤òÊݸ¤¹¤ë¡£ + if [ \-f $random_seed ]; then + cat $random_seed >/dev/urandom + else + touch $random_seed + fi + chmod 600 $random_seed + poolfile=/proc/sys/kernel/random/poolsize + [ \-r $poolfile ] && bytes=\`cat $poolfile\` || bytes=512 + dd if=/dev/urandom of=$random_seed count=1 bs=$bytes +.fi + +.\"O Also, add the following lines in an appropriate script which is +.\"O run during the Linux system shutdown: +¤Þ¤¿¡¢Linux ¥·¥¹¥Æ¥à¤Î¥·¥ã¥Ã¥È¥À¥¦¥ó»þ¤Ë¼Â¹Ô¤µ¤ì¤ëŬÀڤʥ¹¥¯¥ê¥×¥È¤Ë¡¢ +°Ê²¼¤Î¹Ô¤òÄɲ乤ì¤Ð¤è¤¤: +.nf + +.\"O # Carry a random seed from shut-down to start-up +.\"O # Save the whole entropy pool + # Íð¿ô¼ï¤òº£²ó¤Î¥·¥ã¥Ã¥È¥À¥¦¥ó¤«¤é¼¡²ó¤Î¥¹¥¿¡¼¥È¥¢¥Ã¥×¤Þ¤Ç»ý¤Á±Û¤¹¡£ + # Á´¤Æ¤Î¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤òÊݸ¤¹¤ë¡£ + echo "Saving random seed..." + random_seed=/var/run/random-seed + touch $random_seed + chmod 600 $random_seed + poolfile=/proc/sys/kernel/random/poolsize + [ \-r $poolfile ] && bytes=\`cat $poolfile\` || bytes=512 + dd if=/dev/urandom of=$random_seed count=1 bs=$bytes +.fi +.\"O .SS "/proc Interface" +.SS "/proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹" +.\"O The files in the directory +.\"O .I /proc/sys/kernel/random +.\"O (present since 2.3.16) provide an additional interface to the +.\"O .I /dev/random +.\"O device. +¥Ç¥£¥ì¥¯¥È¥ê +.I /proc/sys/kernel/random +¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë (2.3.16 ¤«¤é¸ºß¤¹¤ë) ¤Ï¡¢ +.I /dev/random +¥Ç¥Ð¥¤¥¹¤Ø¤Î¤½¤Î¾¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +.LP +.\"O The read-only file +.\"O .I entropy_avail +.\"O gives the available entropy. +.\"O Normally, this will be 4096 (bits), +.\"O a full entropy pool. +Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë +.I entropy_avail +¤Ï»ÈÍѲÄǽ¤Ê¥¨¥ó¥È¥í¥Ô¡¼¤òɽ¤¹¡£ +Ä̾¤³¤ì¤Ï 4096 (¥Ó¥Ã¥È) ¤Ë¤Ê¤ê¡¢¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤¬ËþÇդξõÂ֤Ǥ¢¤ë¡£ +.LP +.\"O The file +.\"O .I poolsize +.\"O gives the size of the entropy pool. +¥Õ¥¡¥¤¥ë +.I poolsize +¤Ï¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Î¥µ¥¤¥º¤òɽ¤¹¡£ +.\"O The semantics of this file vary across kernel versions: +¤³¤Î¥Õ¥¡¥¤¥ë¤Î°ÕÌ£¤Ï¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê°Û¤Ê¤ë¡£ +.RS +.TP 12 +Linux 2.4: +.\"O This file gives the size of the entropy pool in +.\"O .IR bytes . +.\"O Normally, this file will have the value 512, but it is writable, +.\"O and can be changed to any value for which an algorithm is available. +.\"O The choices are 32, 64, 128, 256, 512, 1024, or 2048. +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Î¥µ¥¤¥º¤ò¡Ö¥Ð¥¤¥È¡×ñ°Ì¤Çµ¬Äꤹ¤ë¡£ +Ä̾¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÃÍ¤Ï 512 ¤Ë¤Ê¤ë¤¬¡¢½ñ¤­¹þ¤ß²Äǽ¤Ç¤¢¤ê¡¢ +¥¢¥ë¥´¥ê¥º¥à¤ÇÍøÍѲÄǽ¤ÊǤ°Õ¤ÎÃͤËÊѹ¹¤Ç¤­¤ë¡£ +ÁªÂò²Äǽ¤ÊÃÍ¤Ï 32, 64, 128, 256, 512, 1024, 2048 ¤Ç¤¢¤ë¡£ +.TP +Linux 2.6: +.\"O This file is read-only, and gives the size of the entropy pool in +.\"O .IR bits . +.\"O It contains the value 4096. +¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÆɤ߽Ф·ÀìÍѤǤ¢¤ê¡¢ +¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Î¥µ¥¤¥º¤ò¡Ö¥Ó¥Ã¥È¡×ñ°Ì¤Çµ¬Äꤹ¤ë¡£ +ÃÍ¤Ï 4096 ¤Ç¤¢¤ë¡£ +.RE +.LP +.\"O The file +.\"O .I read_wakeup_threshold +.\"O contains the number of bits of entropy required for waking up processes +.\"O that sleep waiting for entropy from +.\"O .IR /dev/random . +¥Õ¥¡¥¤¥ë +.I read_wakeup_threshold +¤Ï +.I /dev/random +¤«¤é¤Î¥¨¥ó¥È¥í¥Ô¡¼¤òÂԤäƵٻߤ·¤Æ¤¤¤ë¥×¥í¥»¥¹¤òµ¯¤³¤¹¤Î¤ËɬÍ×¤Ê +¥¨¥ó¥È¥í¥Ô¡¼¤Î¥Ó¥Ã¥È¿ô¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£ +.\"O The default is 64. +¥Ç¥Õ¥©¥ë¥È¤Ï 64 ¤Ç¤¢¤ë¡£ +.\"O The file +.\"O .I write_wakeup_threshold +.\"O contains the number of bits of entropy below which we wake up +.\"O processes that do a +.\"O .BR select (2) +.\"O or +.\"O .BR poll (2) +.\"O for write access to +.\"O .IR /dev/random . +¥Õ¥¡¥¤¥ë +.I write_wakeup_threshold +¤Ï¥¨¥ó¥È¥í¥Ô¡¼¤Î¥Ó¥Ã¥È¿ô¤òÊÝ»ý¤·¤Æ¤ª¤ê¡¢¤³¤ÎÃͰʲ¼¤Ë¤Ê¤Ã¤¿¤é +.I /dev/random +¤Ø¤Î½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤Î¤¿¤á¤Ë +.BR select (2) +¤Þ¤¿¤Ï +.BR poll (2) +¤ò¼Â¹Ô¤¹¤ë¥×¥í¥»¥¹¤òµ¯¤³¤¹¡£ +.\"O These values can be changed by writing to the files. +¤³¤ÎÃͤϥե¡¥¤¥ë¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤³¤È¤Ë¤è¤Ã¤ÆÊѹ¹¤Ç¤­¤ë¡£ +.LP +.\"O The read-only files +.\"O .I uuid +.\"O and +.\"O .I boot_id +.\"O contain random strings like 6fd5a44b-35f4-4ad4-a9b9-6b9be13e1fe9. +Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë +.I uuid +¤È +.I boot_id +¤Ï 6fd5a44b-35f4-4ad4-a9b9-6b9be13e1fe9 ¤Î¤è¤¦¤Ê +¥é¥ó¥À¥à¤Êʸ»úÎó¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£ +.\"O The former is generated afresh for each read, the latter was +.\"O generated once. +Á°¼Ô¤ÏÆɤ߹þ¤ß¤ÎÅ٤˿·¤¿¤ËÀ¸À®¤µ¤ì¡¢ +¸å¼Ô¤Ï 1 ÅÙ¤À¤±À¸À®¤µ¤ì¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +/dev/random +.br +/dev/urandom +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\"O .\" The kernel's random number generator was written by +.\"O .\" Theodore Ts'o (tytso@athena.mit.edu). +.\" ¥«¡¼¥Í¥ë¡¦¥é¥ó¥À¥à¥Ê¥ó¥Ð¡¼¡¦¥¸¥§¥Í¥ì¡¼¥¿¤Ï Theodora Ts'o +.\" (tytso@athena.mit.edu) ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +mknod (1) +.br +RFC\ 1750, "Randomness Recommendations for Security" +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ diff --git a/draft/man4/rtc.4 b/draft/man4/rtc.4 new file mode 100644 index 00000000..27003f6b --- /dev/null +++ b/draft/man4/rtc.4 @@ -0,0 +1,569 @@ +.\" rtc.4 +.\" Copyright 2002 Urs Thuermann (urs@isnogud.escape.de) +.\" +.\" 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. +.\" +.\" $Id: rtc.4,v 1.4 2005/12/05 17:19:49 urs Exp $ +.\" +.\" 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 +.SH ̾Á° +.\"O rtc \- real-time clock +rtc \- ¥ê¥¢¥ë¥¿¥¤¥à¥¯¥í¥Ã¥¯ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +#include +.sp +.BI "int ioctl(" fd ", RTC_" request ", " param ");" +.\"O .SH DESCRIPTION +.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 ¤Ï¡¢º£Æü¤Ç¤Ï¥Þ¥¶¡¼¥Ü¡¼¥É¤Î +¥Á¥Ã¥×¥»¥Ã¥È (¥µ¥¦¥¹¥Ö¥ê¥Ã¥¸) Æâ¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¯¡¢ +¸ò´¹²Äǽ¤Ê¹Å²ß¤¯¤é¤¤¤ÎÂ礭¤µ¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×ÅÅÃÓ¤ò»È¤Ã¤Æ¤¤¤ë¡£ + +.\"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 ¤ÈƱ¤¸µ¡Ç½¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤¬Â¿¤¤¡£ + +.\"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 ¤È¤¤¤¦¼þÇÈ¿ô¤Ç¥«¥¦¥ó¥È¤¹¤ë¡£ + +.\"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 ¥ê¥¯¥¨¥¹¥È¤ÇÆɤ߽ñ¤­¤¬¤Ç¤­¤ë¡£ + +.\"O Besides tracking the date and time, many RTCs can also generate +.\"O interrupts +ÆüÉդȻþ´Ö¤ò¥«¥¦¥ó¥È¤¹¤ë¤Î¤Ë²Ã¤¨¤Æ¡¢ +¿¤¯¤Î 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 ¤¬³ä¤ê¹þ¤ß¤òȯÀ¸¤Ç¤­¤ë¥·¥¹¥Æ¥à¤È¡¢ +¤Ç¤­¤Ê¤¤¥·¥¹¥Æ¥à¤¬¤¢¤ë¡£ + +.\"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) +°Ê¹ß¤ËȯÀ¸¤·¤¿³ä¤ê¹þ¤ß¤Î²ó¿ô¤Ç¤¢¤ë¡£ +.\"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: +RTC ¤Î»þ¹ï¤ò°Ê²¼¤Î¹½Â¤ÂΤÇÊÖ¤¹: +.IP +.in +4n +.nf +struct rtc_time { + int tm_sec; + int tm_min; + int tm_hour; + 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 +¥Õ¥£¡¼¥ë¥É¤Î¤ß¤¬»ÈÍѤµ¤ì¤ë¡£ +.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 +.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 ¤Î¥¢¥é¡¼¥à»þ¹ï¤ò (¤½¤ì¤¾¤ì) Æɤ߽ñ¤­¤Ç¤­¤ë: +.PP +.RS +.in +4n +.nf +struct rtc_wkalrm { + unsigned char enabled; + unsigned char pending; + struct rtc_time time; +}; +.fi +.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 +.SH ¥Õ¥¡¥¤¥ë +.IR /dev/rtc ", " +.IR /dev/rtc0 ", " +.\"O .IR /dev/rtc1 ", " +.I /dev/rtc1 +.\"O etc: RTC special character device files. +¤Ê¤É: +RTC Æü쥭¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë + +.IR /proc/driver/rtc : +.\"O status of the (first) RTC. +(1 ¤ÄÌܤÎ) RTC ¤Î¾õÂÖ +.\"O .SH NOTES +.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 ¤ò»È¤¦¥×¥í¥°¥é¥à¤Ë±Æ¶Á¤òÍ¿¤¨¤ë¡£ + +.\"O An RTC's Epoch has nothing to do with the POSIX Epoch which is only +.\"O used for the system clock. +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 ¤Ç¤¢¤ë¤È²¾Äꤵ¤ì¤ë¡£ + +.\"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 ʬ¤ä³Æ·î¤Î½éÆü¤Ê¤É¡¢Äê´üŪ¤Ê¥¢¥é¡¼¥à¤ò¹Ô¤¦¥·¥Ê¥ê¥ª¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +¤³¤Î¤è¤¦¤Ê»È¤¤Êý¤Ï°Ü¿¢À­¤¬¤Ê¤¤¡£ +°Ü¿¢À­¤Î¹â¤¤¥æ¡¼¥¶¶õ´Ö¥³¡¼¥É¤Ç¤Ï¡¢Ã±ÆȤΥ¢¥é¡¼¥à³ä¤ê¹þ¤ß¤À¤±¤òÁÛÄꤷ¡¢ +³ä¤ê¹þ¤ß¤Î¼õ¿®¸å¤Ë¥¢¥é¡¼¥à¤ò̵¸ú¤Þ¤¿¤ÏºÆ½é´ü²½¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"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" +.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), +/usr/src/linux/Documentation/rtc.txt diff --git a/draft/man4/sd.4 b/draft/man4/sd.4 new file mode 100644 index 00000000..c7d90b31 --- /dev/null +++ b/draft/man4/sd.4 @@ -0,0 +1,227 @@ +.\" sd.4 +.\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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) 1996,1997 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated 1997-02-06, ISHIKAWA Mutsumi +.\" Updated 2005-11-19, Akihiro MOTOKI +.\" +.\" WORD: pointer ¥Ý¥¤¥ó¥¿ +.\" WORD: structure ¹½Â¤ÂÎ +.\" WORD: geometry ¥¸¥ª¥á¥È¥ê +.\" WORD: sector ¥»¥¯¥¿ +.\" WORD: implement ¼ÂÁõ +.\" WORD: raw device ¥í¡¼¥Ç¥Ð¥¤¥¹ +.\" +.TH SD 4 1992-12-17 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sd \- Driver for SCSI Disk Drives +sd \- SCSI ¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ö¤Î¤¿¤á¤Î¥É¥é¥¤¥Ð +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.BR "#include " "/* for HDIO_GETGEO */" +.BR "#include " "/* for BLKGETSIZE and BLKRRPART */" +.fi +.\"O .SH CONFIGURATION +.SH ÀßÄê +.\"O The block device name has the following form: +.\"O .BI sd lp, +.\"O where +.\"O .I l +.\"O is a letter denoting the physical drive, and +.\"O .I p +.\"O is a number denoting the partition on that physical drive. +.\"O Often, the partition number, +.\"O .IR p , +.\"O will be left off when the device corresponds to the whole drive. +¤³¤Î¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ (block device) ¤Î̾Á°¤Ï¡¢¼¡¤Î¤è¤¦¤Ê·Á¼°¤ò¤È¤ë: +.BI sd lp, +¤³¤Î¤¦¤Á¡¢ +.I l +¤ÏʪÍý¥É¥é¥¤¥Ö¤ò°ÕÌ£¤¹¤ëʸ»ú¤Ç¤¢¤ê¡¢ +.I p +¤Ï¤½¤ÎʪÍý¥É¥é¥¤¥Ö¾å¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó (partition) ¤ò°ÕÌ£¤¹¤ë¿ô»ú¤Ç¤¢¤ë¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Ê¥ó¥Ð¡¼ +.I p +¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢¤½¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ï¥É¥é¥¤¥ÖÁ´ÂΤò¤µ¤¹¡£ + +.\"O SCSI disks have a major device number of 8, and a minor device number of +.\"O the form (16 * +.\"O .IR drive_number ") + " partition_number , +.\"O where +.\"O .I drive_number +.\"O is the number of the physical drive in order of detection, and +.\"O .I partition_number +.\"O is as follows: +SCSI ¥Ç¥£¥¹¥¯¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 8 ¤ò»ý¤Á¡¢¼¡¤Î¤è¤¦¤Ê·Á¼°¤Î¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ +¤ò»ý¤Ä¡£(16 * +.IR drive_number ") + " partition_number ¡¢ +¤³¤Î +.I drive_number +¤Ï¸¡½Ð¤µ¤ì¤¿ÊªÍý¥É¥é¥¤¥Ö¤ÎÈÖ¹æ¤Ç¤¢¤ê¡¢ +.I partition_number +¤Ï¼¡¤Î¤è¤¦¤Ë¤Ê¤ë: +.sp +.\"O partition 0 is the whole drive +.\"O .br +.\"O partitions 1-4 are the DOS "primary" partitions +.\"O .br +.\"O partitions 5-8 are the DOS "extended" (or "logical") partitions +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó 0 ¤Ï¥É¥é¥¤¥ÖÁ´ÂÎ +.br +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó 1 ¡Á 4 ¤Ï DOS ¤Î "´ðËÜ (primary)" ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó +.br +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó 5 ¡Á 8 ¤Ï DOS ¤Î "³ÈÄ¥ (extended)" (¤Þ¤¿¤Ï¡¢"ÏÀÍý +(logical)") ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¡£ + +.\"O For example, +.\"O .I /dev/sda +.\"O will have major 8, minor 0, and will refer to all of the first SCSI drive +.\"O in the system; and +.\"O .I /dev/sdb3 +.\"O will have major 8, minor 19, and will refer to the third DOS "primary" +.\"O partition on the second SCSI drive in the system. +Î㤨¤Ð¡¢ +.I /dev/sda +¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 8 ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ 0 ¤ò»ý¤Á¡¢¥·¥¹¥Æ¥à¤ÎºÇ½é¤Î SCSI +¥É¥é¥¤¥ÖÁ´ÂΤò»²¾È¤¹¤ë¡£¤½¤·¤Æ¡¢ +.I /dev/sdb3 +¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 8 ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ 19 ¤ò»ý¤Á¡¢¥·¥¹¥Æ¥à¤ÎÆó¤ÄÌܤΠ+SCSI ¥É¥é¥¤¥Ö¤Î»°ÈÖÌܤΠDOS "´ðËÜ" ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ò»²¾È¤¹¤ë¡£ + +.\"O At this time, only block devices are provided. +.\"O Raw devices have not yet been implemented. +¸½ºß¤Ï¡¢¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤À¤±¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£¥í¡¼¡¦¥Ç¥Ð¥¤¥¹ (raw device) +¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The following +.\"O .IR ioctl s +.\"O are provided: +¼¡¤Î +.I ioctl +¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë: +.TP +.B HDIO_GETGEO +.RS +.\"O Returns the BIOS disk parameters in the following structure: +¼¡¤Î¤è¤¦¤Ê¹½Â¤ÂΤòÍѤ¤¤Æ BIOS ¤Î¥Ç¥£¥¹¥¯¥Ñ¥é¥á¡¼¥¿¤òÊÖ¤¹: +.in +4n +.nf + +struct hd_geometry { + unsigned char heads; + unsigned char sectors; + unsigned short cylinders; + unsigned long start; +}; +.fi +.in + +.\"O A pointer to this structure is passed as the +.\"O .BR ioctl (2) +.\"O parameter. +¤³¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤¬ +.BR ioctl (2) +¤Ø¤Î¥Ñ¥é¥á¡¼¥¿¤È¤·¤ÆÅϤµ¤ì¤ë¡£ + +.\"O The information returned in the parameter is the disk geometry of the drive +.\"O .I "as understood by DOS!" +.\"O This geometry is +.\"O .I not +.\"O the physical geometry of the drive. +.\"O It is used when constructing the +.\"O drive's partition table, however, and is needed for convenient operation +.\"O of +.\"O .BR fdisk (1), +.\"O .BR efdisk (1), +.\"O and +.\"O .BR lilo (1). +.\"O If the geometry information is not available, zero will be returned for all +.\"O of the parameters. +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤ËÆþ¤ì¤é¤ì¤ÆÊÖ¤µ¤ì¤ë¾ðÊó¤Ï¡¢ +.I "DOS ¤Ë¤è¤Ã¤ÆÍý²ò¤µ¤ì¤ë¤è¤¦¤Ê" +¥É¥é¥¤¥Ö¤Î¥¸¥ª¥á¥È¥ê¤Ç¤¢¤ë¡£ +¤³¤Î¥¸¥ª¥á¥È¥ê¤Ï¡¢¥É¥é¥¤¥Ö¤ÎʪÍýŪ¤Ê¥¸¥ª¥á¥È¥ê +.I ¤Ç¤Ï¤Ê¤¤¡£ +¤³¤Î¾ðÊó¤Ï¥É¥é¥¤¥Ö¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤òºîÀ®¤¹¤ë»þ¤ËÍѤ¤¤é¤ì¤ë¡¢ +¤Þ¤¿¡¢ +.BR fdisk (1), +.BR efdisk (1), +.BR lilo (1) +¤ÎŬÀÚ¤ÊÁàºî¤ËɬÍפǤ¢¤ë¡£ +¤â¤·¡¢¥¸¥ª¥á¥È¥ê¤Î¾ðÊó¤¬ÆÀ¤é¤ì¤Ê¤±¤ì¤Ð¡¢¤½¤ì¤¾¤ì¤ÎÃÍÁ´¤Æ¤Ë¥¼¥í¤¬Æþ¤ì +¤é¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ +.RE +.TP +.B BLKGETSIZE +.\"O Returns the device size in sectors. +.\"O The +.\"O .BR ioctl (2) +.\"O parameter should be a pointer to a +.\"O .IR long . +¥»¥¯¥¿¤Î¿ô¤Çɽ¤·¤¿¥Ç¥Ð¥¤¥¹¤Î¥µ¥¤¥º¤¬ÊÖ¤µ¤ì¤ë¡£ +.BR ioctl (2) +¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢ +.I long +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B BLKRRPART +.\"O Forces a reread of the SCSI disk partition tables. +.\"O No parameter is needed. +¶¯À©Åª¤Ë¡¢SCSI ¥Ç¥£¥¹¥¯¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤ÎºÆÆɤ߹þ¤ß¤ò¹Ô¤¦¡£ +¥Ñ¥é¥á¡¼¥¿¤ÏɬÍפʤ¤¡£ + +.\"O The +.\"O .BR scsi (4) +.\"O .BR ioctl (2) +.\"O operations are also supported. +.\"O If the +.\"O .BR ioctl (2) +.\"O parameter is required, and it is NULL, then +.\"O .BR ioctl (2) +.\"O will fail with the error +.\"O .BR EINVAL . +.BR scsi (4) +¤Î +.BR ioctl (2) +Áàºî¤âƱÍͤ˥µ¥Ý¡¼¥È¤µ¤ì¤ë¡£ +.BR ioctl (2) +¤Î¥Ñ¥é¥á¡¼¥¿¤¬É¬Íפǡ¢¤½¤ì¤¬ NULL ¤Ê¤é¤Ð¡¢ +.BR ioctl (2) +¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.\"O /dev/sd[a\-h]: the whole device +/dev/sd[a\-h]: ¥É¥é¥¤¥ÖÁ´ÂÎ +.br +.\"O /dev/sd[a\-h][0\-8]: individual block partitions +/dev/sd[a\-h][0\-8]: ¸Ä¡¹¤Î¥Ö¥í¥Ã¥¯¥Ñ¡¼¥Æ¥£¥·¥ç¥ó +.\"O .\".SH "SEE ALSO" +.\" .SH ´ØÏ¢¹àÌÜ +.\"O .\".BR scsi (4) +.\" .BR scsi (4) diff --git a/draft/man4/sk98lin.4 b/draft/man4/sk98lin.4 new file mode 100644 index 00000000..2de1ed92 --- /dev/null +++ b/draft/man4/sk98lin.4 @@ -0,0 +1,1005 @@ +.\" (C)Copyright 1999-2003 Marvell(R) -- linux@syskonnect.de +.\" sk98lin.4 1.1 2003/12/17 10:03:18 +.\" This manpage can be viewed using `groff -Tascii -man sk98lin.4 | less` +.\" +.\" 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 2004-10-09, Yuichi SATO +.\" Modified 2007-06-05, Akihiro MOTOKI , LDP v2.51 +.\" +.\"WORD: autonegotiation ¼«Æ°ÀßÄê +.\"WORD: interrupt moderation ³ä¤ê¹þ¤ßÄ´Ää +.\" +.TH SK98LIN 4 2007-11-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sk98lin \- Marvell/SysKonnect Gigabit Ethernet driver v6.21 +sk98lin \- Marvell/SysKonnect ¥®¥¬¥Ó¥Ã¥È¥¤¡¼¥µ¥Í¥Ã¥È¥É¥é¥¤¥Ð v6.21 +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B insmod sk98lin.o +.RB [ Speed_A=\c +.IR i,j,... ] +.RB [ Speed_B=\c +.IR i,j,... ] +.RB [ AutoNeg_A=\c +.IR i,j,... ] +.RB [ AutoNeg_B=\c +.IR i,j,... ] +.RB [ DupCap_A=\c +.IR i,j,... ] +.RB [ DupCap_B=\c +.IR i,j,... ] +.RB [ FlowCtrl_A=\c +.IR i,j,... ] +.RB [ FlowCtrl_B=\c +.IR i,j,... ] +.RB [ Role_A=\c +.IR i,j,... ] +.RB [ Role_B=\c +.IR i,j,... ] +.RB [ ConType=\c +.IR i,j,... ] +.RB [ Moderation=\c +.IR i,j,... ] +.RB [ IntsPerSec=\c +.IR i,j,... ] +.RB [ PrefPort=\c +.IR i,j,... ] +.RB [ RlmtMode=\c +.IR i,j,... ] +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.ad l +.hy 0 +.\"O .B sk98lin +.\"O is the Gigabit Ethernet driver for Marvell and SysKonnect network adapter cards. +.\"O It supports SysKonnect SK-98xx/SK-95xx compliant Gigabit Ethernet Adapter and +.\"O any Yukon compliant chipset. +.B sk98lin +¤Ï Marvell ¤È SysKonnect ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥À¥×¥¿¥«¡¼¥É¤Î +¥®¥¬¥Ó¥Ã¥È¥¤¡¼¥µ¥Í¥Ã¥È¥É¥é¥¤¥Ð¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï SysKonnect SK-98xx/SK-95xx ¸ß´¹¤Î¥®¥¬¥Ó¥Ã¥È¥¤¡¼¥µ¥Í¥Ã¥È¥¢¥À¥×¥¿¤È +Yukon ¸ß´¹¤Î¥Á¥Ã¥×¥»¥Ã¥È¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ + +.\"O When loading the driver using insmod, parameters for the network adapter cards +.\"O might be stated as a sequence of comma separated commands. +.\"O If for instance two network adapters are installed and AutoNegotiation on +.\"O Port A of the first adapter should be ON, +.\"O but on the Port A of the second adapter switched OFF, one must enter: +insmod ¤ò»È¤Ã¤Æ¥É¥é¥¤¥Ð¤ò¥í¡¼¥É¤¹¤ëºÝ¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ñ¥é¥á¡¼¥¿¤ò +¥³¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¤¿¥³¥Þ¥ó¥É¤ÎÎó¤È¤·¤Æ»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +2 ¤Ä¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥À¥×¥¿¤¬¼è¤êÉÕ¤±¤é¤ì¤Æ¤¤¤ë»þ¤Ë¡¢ +Î㤨¤Ð¡¢1 ¤ÄÌܤΥ¢¥À¥×¥¿¤Î¥Ý¡¼¥È A ¤Î¼«Æ°¥Í¥´¥·¥¨¡¼¥·¥ç¥ó¤Ï ON ¤Ë¤¹¤ë¤¬¡¢ +2 ¤ÄÌܤΥ¢¥À¥×¥¿¤Î¥Ý¡¼¥È A ¤Ï OFF ¤Ë¤¹¤ë¾ì¹ç¤Ï¡¢ +°Ê²¼¤Î¤è¤¦¤ËÆþÎϤ¹¤ì¤Ð¤è¤¤: + + insmod sk98lin.o AutoNeg_A=On,Off + +.\"O After +.\"O .B sk98lin +.\"O is bound to one or more adapter cards and the +.\"O .I /proc +.\"O file system is mounted on your system, a dedicated statistics file +.\"O will be created in folder +.\"O .I /proc/net/sk98lin +.\"O for all ports of the installed network adapter cards. +.\"O Those files are named +.\"O .I eth[x] +.\"O whereas +.\"O .I x +.\"O is the number of the interface that has been assigned to a +.\"O dedicated port by the system. +.B sk98lin +¤¬ 1 ¤Ä°Ê¾å¤Î¥¢¥À¥×¥¿¥«¡¼¥É¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤Æ¡¢ +¤«¤Ä +.I /proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥·¥¹¥Æ¥à¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¼è¤êÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥À¥×¥¿¥«¡¼¥É¤ÎÁ´¤Æ¤Î¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¡¢ +(¥Ý¡¼¥Èñ°Ì¤Ë) ÀìÍѤÎÅý·×¥Õ¥¡¥¤¥ë¤¬¥Õ¥©¥ë¥À +.I /proc/net/sk98lin +¤Ëºî¤é¤ì¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï +.I eth[x] +¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤ê¡¢ +.I x +¤Ï¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÎÈÖ¹æ¤Ç¤¢¤ë¡£ +¤³¤ÎÈÖ¹æ¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¥Ý¡¼¥ÈËè¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +.\"O If loading is finished, any desired IP address can be +.\"O assigned to the respective +.\"O .I eth[x] +.\"O interface using the +.\"O .BR ifconfig (8) +.\"O command. +.\"O This causes the adapter to connect to the Ethernet and to display a status +.\"O message on the console saying "ethx: network connection up using port y" +.\"O followed by the configured or detected connection parameters. +¥í¡¼¥É¤¬´°Î»¤¹¤ë¤È¡¢ +.BR ifconfig (8) +¥³¥Þ¥ó¥É¤ò»È¤Ã¤Æ¡¢³Æ +.I eth[x] +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë´õ˾¤¹¤ë IP ¥¢¥É¥ì¥¹¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤è¤ê¥¢¥À¥×¥¿¤¬¥¤¡¼¥µ¥Í¥Ã¥È¤ËÀܳ¤µ¤ì¡¢ +¥³¥ó¥½¡¼¥ë¤Ë¾õÂÖ¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤ë¡£ +¤³¤Î¥á¥Ã¥»¡¼¥¸¤Ç¤Ï¡¢ +"ethx: network connection up using port y" ¤Î¸å¤Ë +ÀßÄꤵ¤ì¤¿¤ê¸¡½Ð¤µ¤ì¤¿Àܳ¥Ñ¥é¥á¡¼¥¿¤¬É½¼¨¤µ¤ì¤ë¡£ + +.\"O The +.\"O .B sk98lin +.\"O also supports large frames (also called jumbo frames). +.\"O Using jumbo frames can improve throughput tremendously when +.\"O transferring large amounts of data. +.\"O To enable large frames, the MTU (maximum transfer unit) size +.\"O for an interface is to be set to a high value. +.\"O The default MTU size is 1500 and can be changed up to 9000 (bytes). +.\"O Setting the MTU size can be done when assigning the IP address +.\"O to the interface or later by using the +.\"O .BR ifconfig (8) +.\"O command with the mtu parameter. +.\"O If for instance eth0 needs an IP +.\"O address and a large frame MTU size, +.\"O the following two commands might be used: +.B sk98lin +¤Ï¥é¡¼¥¸¥Õ¥ì¡¼¥à (¥¸¥ã¥ó¥Ü¥Õ¥ì¡¼¥à¤È¤â¸Æ¤Ð¤ì¤ë) ¤â¥µ¥Ý¡¼¥È¤¹¤ë¡£ +¥¸¥ã¥ó¥Ü¥Õ¥ì¡¼¥à¤ò»È¤¦¤È¡¢ÂçÎ̤Υǡ¼¥¿¤òžÁ÷¤¹¤ëºÝ¤Ë¡¢ +¥¹¥ë¡¼¥×¥Ã¥È¤òÂçÉý¤Ë¸þ¾å¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥é¡¼¥¸¥Õ¥ì¡¼¥à¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢ +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î MTU (maximum transfer unit, ºÇÂçžÁ÷ñ°Ì) ¥µ¥¤¥º¤ò +Â礭¤ÊÃͤËÀßÄꤹ¤ì¤Ð¤è¤¤¡£ +¥Ç¥Õ¥©¥ë¥È¤Î MTU ¥µ¥¤¥º¤Ï 1500 ¤Ç¤¢¤ê¡¢ +ºÇÂç¤Ç 9000 (¥Ð¥¤¥È) ¤Þ¤ÇÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +MTU ¥µ¥¤¥º¤òÀßÄꤹ¤ë¤Î¤Ï¡¢ +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë IP ¥¢¥É¥ì¥¹¤ò³ä¤êÅö¤Æ¤ë¤È¤­¤Ë¤â¤Ç¤­¤ë¤·¡¢¸å¤«¤é +.BR ifconfig (8) +¥³¥Þ¥ó¥É¤Ë mtu °ú¤­¿ô¤ò»ØÄꤹ¤ë¤³¤È¤ÇÀßÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +Î㤨¤Ð¡¢eth0 ¤Ë IP ¥¢¥É¥ì¥¹¤È¥é¡¼¥¸¥Õ¥ì¡¼¥à MTU ¥µ¥¤¥º¤ò +³ä¤êÅö¤Æ¤¿¤¤¾ì¹ç¡¢°Ê²¼¤Î 2 ¤Ä¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ì¤Ð¤è¤¤: + + ifconfig eth0 10.1.1.1 + ifconfig eth0 mtu 9000 + +.\"O Those two commands might even be combined into one: +¤³¤ì¤é¤Î 2 ¤Ä¤Î¥³¥Þ¥ó¥É¤Ï 1 ¤Ä¤Ë¤Þ¤È¤á¤ë¤³¤È¤â¤Ç¤­¤ë: + + ifconfig eth0 10.1.1.1 mtu 9000 + +.\"O Note that large frames can only be used if permitted by +.\"O your network infrastructure. +.\"O This means, that any switch being used in your Ethernet must +.\"O also support large frames. +.\"O Quite some switches support large frames, +.\"O but need to be configured to do so. +.\"O Most of the times, their default setting is to support only +.\"O standard frames with an MTU size of 1500 (bytes). +.\"O In addition to the switches inside the network, +.\"O all network adapters that are to be used must also be +.\"O enabled regarding jumbo frames. +.\"O If an adapter is not set to receive large frames it will simply drop them. +¥é¡¼¥¸¥Õ¥ì¡¼¥à¤ò»ÈÍѤǤ­¤ë¤Î¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯´Ä¶­Á´ÂÎ¤Ç +¥é¡¼¥¸¥Õ¥ì¡¼¥à¤Î»ÈÍѤ¬Ç§¤á¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ß¤Ç¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤Ä¤Þ¤ê¡¢¥¤¡¼¥µ¥Í¥Ã¥È¤Ç»È¤ï¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥¹¥¤¥Ã¥Á¤Ç¤â +¥é¡¼¥¸¥Õ¥ì¡¼¥à¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¿¤¯¤Î¥¹¥¤¥Ã¥Á¤¬¥é¡¼¥¸¥Õ¥ì¡¼¥à¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤Ï¤¤¤ë¤¬¡¢ +ÀßÄê¤ò¹Ô¤¦É¬Íפ¬¤¢¤ë¡£ +¿¤¯¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¤Ç¤Ïɸ½à¥Õ¥ì¡¼¥à +(1500 ¥Ð¥¤¥È¤Î MTU ¥µ¥¤¥º) ¤À¤±¤·¤«¥µ¥Ý¡¼¥È¤·¤Ê¤¤¡£ +¥Í¥Ã¥È¥ï¡¼¥¯Æâ¤Î¥¹¥¤¥Ã¥Á¤Ë²Ã¤¨¡¢ +»ÈÍѤµ¤ì¤ëÁ´¤Æ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥À¥×¥¿¤Ç¤â +¥¸¥ã¥ó¥Ü¥Õ¥ì¡¼¥à¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥¢¥À¥×¥¿¤¬¥é¡¼¥¸¥Õ¥ì¡¼¥à¤ò¼õ¤±¼è¤ë¤è¤¦¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¥¢¥À¥×¥¿¤Ï¤½¤Î¥Õ¥ì¡¼¥à¤òñ½ã¤Ë¼Î¤Æ¤Æ¤·¤Þ¤¦¡£ + +.\"O Switching back to the standard Ethernet frame size can be done by using the +.\"O .BR ifconfig (8) +.\"O command again: +ɸ½à¤Î¥¤¡¼¥µ¥Í¥Ã¥È¥Õ¥ì¡¼¥à¥µ¥¤¥º¤ËÌ᤹¤Î¤Ï¡¢ºÆ¤Ó +.BR ifconfig (8) +¥³¥Þ¥ó¥É¤ò»È¤¨¤Ð¤è¤¤: + + ifconfig eth0 mtu 1500 + +.\"O The Marvell/SysKonnect Gigabit Ethernet driver for Linux is able to +.\"O support VLAN and Link Aggregation according to +.\"O IEEE standards 802.1, 802.1q, and 802.3ad. +.\"O Those features are only available after installation of open source modules +.\"O which can be found on the Internet: +Linux ¤Î Marvell/SysKonnect ¥®¥¬¥Ó¥Ã¥È¥¤¡¼¥µ¥Í¥Ã¥È¥É¥é¥¤¥Ð¤Ï¡¢ +IEEE µ¬³Ê 802.1, 802.1q, 802.3ad ¤Ë½àµò¤¹¤ë +VLAN ¤È Link Aggregation ¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Îµ¡Ç½¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ë¤¢¤ë¥ª¡¼¥×¥ó¥½¡¼¥¹¥â¥¸¥å¡¼¥ë¤ò +¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¸å¤Ç¤Î¤ßÍøÍѲÄǽ¤Ç¤¢¤ë: + +.IR VLAN \c +: http://www.candelatech.com/~greear/vlan.html +.br +.I Link +.IR Aggregation \c +: http://www.st.rim.or.jp/~yumo + +.br +.\"O Note that Marvell/SysKonnect does not offer any support for these +.\"O open source modules and does not take the responsibility for any +.\"O kind of failures or problems arising when using these modules. +Marvell/SysKonnect ¤Ï¡¢¤³¤ì¤é¤Î¥ª¡¼¥×¥ó¥½¡¼¥¹¥â¥¸¥å¡¼¥ë¤ËÂФ¹¤ë¥µ¥Ý¡¼¥È¤Ï +¹Ô¤Ã¤Æ¤ª¤é¤º¡¢¤³¤ì¤é¤ò»È¤Ã¤¿¾ì¹ç¤ËÀ¸¤¸¤ë¤¤¤«¤Ê¤ë¼ºÇÔ¤äÌäÂê¤Ë¤Ä¤¤¤Æ¤â +ÀÕǤ¤òÉé¤ï¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.\"O .SS Parameters +.SS °ú¤­¿ô +.TP +.BI Speed_A= i,j,... +.\"O This parameter is used to set the speed capabilities of port A of an +.\"O adapter card. +.\"O It is only valid for Yukon copper adapters. +.\"O Possible values are: +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È A ¤¬¥µ¥Ý¡¼¥È¤¹¤ë¥ê¥ó¥¯Â®ÅÙ¤ò +ÀßÄꤹ¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£¤³¤ì¤Ï Yukon copper ¥¢¥À¥×¥¿¤Ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.\"O .IR 10 , +.\"O .IR 100 , +.\"O .I 1000 +.\"O or +.\"O .I Auto +.\"O whereas +.\"O .I Auto +.\"O is the default. +.\"O Usually, the speed is negotiated between the two ports +.\"O during link establishment. +.\"O If this fails, a port can be forced to a specific setting with this parameter. +.IR 10 , +.IR 100 , +.IR 1000 , +.IR Auto ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I Auto +¤Ç¤¢¤ë¡£ +Ä̾¥ê¥ó¥¯Â®Å٤ϥê¥ó¥¯¤Î³ÎΩ»þ¤Ë 2 ¤Ä¤Î¥Ý¡¼¥È¤Î´Ö¤Ç¼«Æ°ÀßÄꤵ¤ì¤ë¡£ +¤³¤ì¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢¥Ý¡¼¥È¤Ï¤³¤Î°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿ÀßÄê¤Ë¤Ê¤ë¡£ +.TP +.BI Speed_B= i,j,... +.\"O This parameter is used to set the speed capabilities of port B of +.\"O an adapter card. +.\"O It is only valid for Yukon copper adapters. +.\"O Possible values are: +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È B ¤¬¥µ¥Ý¡¼¥È¤¹¤ë¥ê¥ó¥¯Â®ÅÙ¤ò +ÀßÄꤹ¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£¤³¤ì¤Ï Yukon copper ¥¢¥À¥×¥¿¤Ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.\"O .IR 10 , +.\"O .IR 100 , +.\"O .I 1000 +.\"O or +.\"O .I Auto +.\"O whereas +.\"O .I Auto +.\"O is the default. +.\"O Usually, the speed is negotiated between the two ports during link +.\"O establishment. +.\"O If this fails, a port can be forced to a specific setting with this parameter. +.IR 10 , +.IR 100 , +.IR 1000 , +.IR Auto ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I Auto +¤Ç¤¢¤ë¡£ +Ä̾¥ê¥ó¥¯Â®Å٤ϥê¥ó¥¯¤Î³ÎΩ»þ¤Ë 2 ¤Ä¤Î¥Ý¡¼¥È¤Î´Ö¤Ç¼«Æ°ÀßÄꤵ¤ì¤ë¡£ +¤³¤ì¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢¥Ý¡¼¥È¤Ï¤³¤Î°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿ÀßÄê¤Ë¤Ê¤ë¡£ +.TP +.BI AutoNeg_A= i,j,... +.\"O Enables or disables the use of autonegotiation of port A of an adapter card. +.\"O Possible values are: +¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È A ¤Î¼«Æ°ÀßÄê (autonegotiation) ¤Î»ÈÍѤò +Í­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.\"O .IR On , +.\"O .I Off +.\"O or +.\"O .I Sense +.\"O whereas +.\"O .I On +.\"O is the default. +.\"O The +.\"O .I Sense +.\"O mode automatically detects whether the link partner supports +.\"O auto-negotiation or not. +.IR On , +.IR Off , +.IR Sense ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I On +¤Ç¤¢¤ë¡£ +.I Sense +¥â¡¼¥É¤Ï¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤¬¼«Æ°ÀßÄê¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«Èݤ«¤ò +¼«Æ°Åª¤Ë¸¡ÃΤ¹¤ë¡£ +.TP +.BI AutoNeg_B= i,j,... +.\"O Enables or disables the use of autonegotiation of port B of an adapter card. +.\"O Possible values are: +¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È B ¤Î¼«Æ°ÀßÄê (autonegotiation) ¤Î»ÈÍѤò +Í­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.\"O .IR On , +.\"O .I Off +.\"O or +.\"O .I Sense +.\"O whereas +.\"O .I On +.\"O is the default. +.\"O The +.\"O .I Sense +.\"O mode automatically detects whether the link partner supports +.\"O auto-negotiation or not. +.IR On , +.IR Off , +.IR Sense ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I On +¤Ç¤¢¤ë¡£ +.I Sense +¥â¡¼¥É¤Ï¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤¬¼«Æ°ÀßÄê¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«Èݤ«¤ò +¼«Æ°Åª¤Ë¸¡ÃΤ¹¤ë¡£ +.TP +.BI DupCap_A= i,j,... +.\"O This parameter indicates the duplex mode to be used for port A +.\"O of an adapter card. +.\"O Possible values are: +¤³¤Î°ú¤­¿ô¤Ï¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È A ¤Ç»È¤¦Æó½ÅÄÌ¿® (duplex) ¥â¡¼¥É¤ò¼¨¤¹¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.\"O .IR Half , +.\"O .I Full +.\"O or +.\"O .I Both +.\"O whereas +.\"O .I Both +.\"O is the default. +.\"O This parameter is only relevant if AutoNeg_A of port A is not set to +.\"O .IR Sense . +.IR Half , +.IR Full , +.IR Both ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I Both +¤Ç¤¢¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ï¥Ý¡¼¥È A ¤Î AutoNeg_A ¤¬ +.I Sense +¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +.\"O If AutoNeg_A is set to +.\"O .I On +.\"O , all three values of DupCap_A ( +.\"O .IR Half , +.\"O .I Full +.\"O or +.\"O .IR Both ) +.\"O might be stated. +.\"O If AutoNeg_A is set to +.\"O .IR Off , +.\"O only DupCap_A values +.\"O .I Full +.\"O and +.\"O .I Half +.\"O are allowed. +.\"O This DupCap_A parameter is useful if your link partner does not +.\"O support all possible duplex combinations. +AutoNeg_A ¤¬ +.I On +¤Î¾ì¹ç¡¢DupCap_A ¤Î 3 ¤Ä¤ÎÃÍ +.RI ( Half , +.IR Full , +.IR Both ) +¤Î¤¦¤Á¤É¤ì¤Ç¤â»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +AutoNeg_A ¤¬ +.I Off +¤Î¾ì¹ç¡¢DupCap_A ¤ÎÃÍ +.I Full +¤È +.I Half +¤Î¤ß¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î DupCap_A °ú¤­¿ô¤Ï¡¢¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤¬Á´¤Æ¤ÎÆó½ÅÄÌ¿®¤ÎÁȤ߹ç¤ï¤»¤ò +¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤ËÌò¤ËΩ¤Ä¡£ +.TP +.BI DupCap_B= i,j,... +.\"O This parameter indicates the duplex mode to be used for port B +.\"O of an adapter card. +.\"O Possible values are: +¤³¤Î°ú¤­¿ô¤Ï¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È B ¤Ç»È¤¦Æó½ÅÄÌ¿®¥â¡¼¥É¤ò¼¨¤¹¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.\"O .IR Half , +.\"O .I Full +.\"O or +.\"O .I Both +.\"O whereas +.\"O .I Both +.\"O is the default. +.\"O This parameter is only relevant if AutoNeg_B of port B is not set to +.\"O .IR Sense . +.IR Half , +.IR Full , +.IR Both ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I Both +¤Ç¤¢¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ï¥Ý¡¼¥È B ¤Î AutoNeg_B ¤¬ +.I Sense +¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +.\"O If AutoNeg_B is set to +.\"O .IR On , +.\"O all three values of DupCap_B ( +.\"O .IR Half , +.\"O .I Full +.\"O or +.\"O .IR Both ) +.\"O might be stated. +.\"O If AutoNeg_B is set to +.\"O .IR Off , +.\"O only DupCap_B values +.\"O .I Full +.\"O and +.\"O .I Half +.\"O are allowed. +.\"O This DupCap_B parameter is useful if your link partner does not +.\"O support all possible duplex combinations. +AutoNeg_B ¤¬ +.I On +¤Î¾ì¹ç¡¢DupCap_B ¤Î 3 ¤Ä¤ÎÃÍ +.RI ( Half , +.IR Full , +.IR Both ) +¤Î¤¦¤Á¤É¤ì¤Ç¤â»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +AutoNeg_B ¤¬ +.I Off +¤Î¾ì¹ç¡¢DupCap_B ¤ÎÃÍ +.I Full +¤È +.I Half +¤Î¤ß¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î DupCap_B °ú¤­¿ô¤Ï¡¢¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤¬Á´¤Æ¤ÎÆó½ÅÄÌ¿®¤ÎÁȤ߹ç¤ï¤»¤ò +¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤ËÌò¤ËΩ¤Ä¡£ +.TP +.BI FlowCtrl_A= i,j,... +.\"O This parameter can be used to set the flow control capabilities the +.\"O port reports during auto-negotiation. +.\"O Possible values are: +¤³¤Î°ú¤­¿ô¤Ï¼«Æ°ÀßÄê»þ¤Ë¥Ý¡¼¥È¤¬Âиþ¤ËÅÁ¤¨¤ë +¥Õ¥í¡¼À©¸æµ¡Ç½¤òÀßÄꤹ¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.\"O .IR Sym , +.\"O .IR SymOrRem , +.\"O .I LocSend +.\"O or +.\"O .I None +.\"O whereas +.\"O .I SymOrRem +.\"O is the default. +.\"O The different modes have the following meaning: +.IR Sym , +.IR SymOrRem , +.IR LocSend , +.IR None ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I SymOrRem +¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥â¡¼¥É¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê°ÕÌ£¤¬¤¢¤ë: + +.br +.I Sym += Symmetric +.\"O both link partners are allowed to send PAUSE frames + ¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤ÎÁÐÊý¤¬ PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.I SymOrRem += SymmetricOrRemote +.\"O both or only remote partner are allowed to send PAUSE frames + ¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤ÎÁÐÊý¤Þ¤¿¤Ï¥ê¥â¡¼¥È¥Ñ¡¼¥È¥Ê¤Î¤ß¤¬ +PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.I LocSend += LocalSend +.\"O only local link partner is allowed to send PAUSE frames + ¥í¡¼¥«¥ë¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤Î¤ß¤¬ PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.I None += None +.\"O no link partner is allowed to send PAUSE frames + ¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤Î¤É¤Á¤é¤â PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ + +.\"O Note that this parameter is ignored if AutoNeg_A is set to +.\"O .IR Off . +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï AutoNeg_A ¤¬ +.I Off +¤Î¾ì¹ç¤Ë¤Ï̵»ë¤µ¤ì¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.TP +.BI FlowCtrl_B= i,j,... +.\"O This parameter can be used to set the flow control capabilities the +.\"O port reports during auto-negotiation. +.\"O Possible values are: +¤³¤Î°ú¤­¿ô¤Ï¼«Æ°ÀßÄê»þ¤Ë¥Ý¡¼¥È¤¬Âиþ¤ËÅÁ¤¨¤ë +¥Õ¥í¡¼À©¸æµ¡Ç½¤òÀßÄꤹ¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.\"O .IR Sym , +.\"O .IR SymOrRem , +.\"O .I LocSend +.\"O or +.\"O .I None +.\"O whereas +.\"O .I SymOrRem +.\"O is the default. +.\"O The different modes have the following meaning: +.IR Sym , +.IR SymOrRem , +.IR LocSend , +.IR None ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I SymOrRem +¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥â¡¼¥É¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê°ÕÌ£¤¬¤¢¤ë: + +.I Sym += Symmetric +.\"O both link partners are allowed to send PAUSE frames + ¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤ÎÁÐÊý¤¬ PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.I SymOrRem += SymmetricOrRemote +.\"O both or only remote partner are allowed to send PAUSE frames + ¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤ÎÁÐÊý¤Þ¤¿¤Ï¥ê¥â¡¼¥È¥Ñ¡¼¥È¥Ê¤Î¤ß¤¬ +PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.I LocSend += LocalSend +.\"O only local link partner is allowed to send PAUSE frames + ¥í¡¼¥«¥ë¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤Î¤ß¤¬ PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.I None += None +.\"O no link partner is allowed to send PAUSE frames + ¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤Î¤É¤Á¤é¤â PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.br + +.\"O Note that this parameter is ignored if AutoNeg_B is set to +.\"O .IR Off . +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï AutoNeg_B ¤¬ +.I Off +¤Î¾ì¹ç¤Ë¤Ï̵»ë¤µ¤ì¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.TP +.BI Role_A= i,j,... +.\"O This parameter is only valid for 1000Base-T adapter cards. +.\"O For two 1000Base-T ports to communicate, +.\"O one must take the role of the master (providing timing information), +.\"O while the other must be the slave. +.\"O Possible values are: +¤³¤Î°ú¤­¿ô¤Ï 1000Base-T ¥¢¥À¥×¥¿¥«¡¼¥É¤Ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +2 ¤Ä¤Î 1000Base-T ¥Ý¡¼¥È¤¬ÄÌ¿®¤¹¤ë¾ì¹ç¡¢ +ÊÒÊý¤¬ (¥¿¥¤¥ß¥ó¥°¾ðÊó¤òÄ󶡤¹¤ë) ¥Þ¥¹¥¿¤ÎÌò³ä¤ò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤â¤¦ÊÒÊý¤¬¥¹¥ì¡¼¥Ö¤Ë¤Ê¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.\"O .IR Auto , +.\"O .I Master +.\"O or +.\"O .I Slave +.\"O whereas +.\"O .I Auto +.\"O is the default. +.\"O Usually, the role of a port is negotiated between two ports during +.\"O link establishment, but if that fails the port A of an adapter card +.\"O can be forced to a specific setting with this parameter. +.IR Auto , +.IR Master , +.IR Slave ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I Auto +¤Ç¤¢¤ë¡£ +Ä̾¥Ý¡¼¥È¤ÎÌò³ä¤Ï 2 ¤Ä¤Î¥Ý¡¼¥È¤Ç¥ê¥ó¥¯¤ò³ÎΩ¤¹¤ë¤È¤­¤Ë¼«Æ°ÀßÄꤵ¤ì¤ë¡£ +¼«Æ°ÀßÄê¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È A ¤Ï¤³¤Î°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿ÀßÄê¤Ë¤Ê¤ë¡£ +.TP +.BI Role_B= i,j,... +.\"O This parameter is only valid for 1000Base-T adapter cards. +.\"O For two 1000Base-T ports to communicate, one must take +.\"O the role of the master (providing timing information), +.\"O while the other must be the slave. +.\"O Possible values are: +¤³¤Î°ú¤­¿ô¤Ï 1000Base-T ¥¢¥À¥×¥¿¥«¡¼¥É¤Ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +2 ¤Ä¤Î 1000Base-T ¥Ý¡¼¥È¤¬ÄÌ¿®¤¹¤ë¾ì¹ç¡¢ +ÊÒÊý¤¬ (¥¿¥¤¥ß¥ó¥°¾ðÊó¤òÄ󶡤¹¤ë) ¥Þ¥¹¥¿¤ÎÌò³ä¤ò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤â¤¦ÊÒÊý¤¬¥¹¥ì¡¼¥Ö¤Ë¤Ê¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.\"O .IR Auto , +.\"O .I Master +.\"O or +.\"O .I Slave +.\"O whereas +.\"O .I Auto +.\"O is the default. +.\"O Usually, the role of a port is negotiated between +.\"O two ports during link establishment, but if that fails +.\"O the port B of an adapter card can be forced to a +.\"O specific setting with this parameter. +.IR Auto , +.IR Master , +.IR Slave ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I Auto +¤Ç¤¢¤ë¡£ +Ä̾¥Ý¡¼¥È¤ÎÌò³ä¤Ï 2 ¤Ä¤Î¥Ý¡¼¥È¤Ç¥ê¥ó¥¯¤ò³ÎΩ¤¹¤ë¤È¤­¤Ë¼«Æ°ÀßÄꤵ¤ì¤ë¡£ +¼«Æ°ÀßÄê¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È B ¤Ï¤³¤Î°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿ÀßÄê¤Ë¤Ê¤ë¡£ +.TP +.BI ConType= i,j,... +.\"O This parameter is a combination of all five per-port parameters +.\"O within one single parameter. +.\"O This simplifies the configuration of both ports of an adapter card. +.\"O The different values of this variable reflect the +.\"O most meaningful combinations of port parameters. +.\"O Possible values and their corresponding combination of per-port parameters: +¤³¤Î°ú¤­¿ô¤Ï¡¢¥Ý¡¼¥ÈËè¤Ë»ØÄꤹ¤ë¡¢Á´Éô¤Ç 5 ¸Ä¤Î°ú¤­¿ô¤ÎÁȤ߹ç¤ï¤»¤ò¡¢ +1 ¤Ä¤Î°ú¤­¿ô¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë¤è¤ê¥¢¥À¥×¥¿¥«¡¼¥É¤Î 2 ¤Ä¤Î¥Ý¡¼¥È¤ÎÀßÄê¤ò´Êά²½¤Ç¤­¤ë¡£ +¤³¤ÎÊÑ¿ô¤Î¤½¤ì¤¾¤ì¤ÎÃͤϡ¢ +¥Ý¡¼¥È°ú¤­¿ô¤ÎºÇ¤â°ÕÌ£¤Î¤¢¤ëÁȤ߹ç¤ï¤»¤òÈ¿±Ç¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤȤ½¤ì¤ËÂбþ¤¹¤ë¥Ý¡¼¥ÈËè¤Î¥Ñ¥é¥á¡¼¥¿¤ÎÁȤ߹ç¤ï¤»¤Ï¡¢ +°Ê²¼¤ÎÄ̤ê: + +.nf +ConType | DupCap AutoNeg FlowCtrl Role Speed +--------+------------------------------------------- +\fIAuto\fP | Both On SymOrRem Auto Auto +.br +\fI100FD\fP | Full Off None Auto 100 +.br +\fI100HD\fP | Half Off None Auto 100 +.br +\fI10FD\fP | Full Off None Auto 10 +.br +\fI10HD\fP | Half Off None Auto 10 + +.fi +.\"O Stating any other port parameter together with this +.\"O .I ConType +.\"O parameter will result in a merged configuration of those settings. +.\"O This is due to +.\"O the fact, that the per-port parameters (e.g. +.\"O .IR Speed_A ) +.\"O have a higher priority than the combined variable +.\"O .IR ConType . +¤½¤Î¾¤Î¥Ý¡¼¥È°ú¤­¿ô¤ò +.I ConType +°ú¤­¿ô¤ÈÁȤ߹ç¤ï¤»¤Æ»ØÄꤹ¤ë¤È¡¢¤½¤ì¤é¤ÎÀßÄê¤ò·ë¹ç¤·¤¿ÀßÄê¤È¤Ê¤ë¡£ +¤³¤ì¤Ï¡¢¥Ý¡¼¥ÈËè¤Î°ú¤­¿ô (Î㤨¤Ð +.IR Speed_A ) +¤ÎÊý¤¬ÁȤ߹ç¤ï¤»ÊÑ¿ô +.I ConType +¤è¤êÍ¥Àè½ç°Ì¤¬¹â¤¤¤¿¤á¤Ç¤¢¤ë¡£ +.TP +.BI Moderation= i,j,... +.\"O Interrupt moderation is employed to limit the maximum number of interrupts +.\"O the driver has to serve. +.\"O That is, one or more interrupts (which indicate any transmit or +.\"O receive packet to be processed) are queued until the driver processes them. +.\"O When queued interrupts are to be served, is determined by the +.\"O .I IntsPerSec +.\"O parameter, which is explained later below. +.\"O Possible moderation modes are: +³ä¤ê¹þ¤ßÄ´Ää (interrupt moderation) ¤Ï¡¢¥É¥é¥¤¥Ð¤¬½èÍý¤ò³«»Ï¤·¤Ê¤±¤ì¤Ð +¤Ê¤é¤Ê¤¤³ä¤ê¹þ¤ß²ó¿ô¤ÎºÇÂçÃͤòÀßÄꤹ¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤Ä¤Þ¤ê¡¢¥É¥é¥¤¥Ð¤¬½èÍý¤ò¹Ô¤¦¤Þ¤Ç¡¢1²ó°Ê¾å¤Î³ä¤ê¹þ¤ß +(Á÷¿®¤Þ¤¿¤Ï¼õ¿®¥Ñ¥±¥Ã¥È¤¬½èÍý¤µ¤ì¤ë¤³¤È) ¤¬¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¡£ +¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤¿³ä¤ê¹þ¤ß¤¬¤¤¤Ä½èÍý¤µ¤ì¤ë¤«¤Ï¡¢ +°Ê²¼¤ÇÀâÌÀ¤¹¤ë +.I IntsPerSec +°ú¤­¿ô¤Ç·èÄꤵ¤ì¤ë¡£ +»ÈÍѲÄǽ¤ÊÄ´Ää¥â¡¼¥É¤Ï°Ê²¼¤ÎÄ̤ê: +.\"O .IR None , +.\"O .I Static +.\"O or +.\"O .I Dynamic +.\"O whereas +.\"O .I None +.\"O is the default. +.\"O The different modes have the following meaning: +.IR None , +.IR Static , +.IR Dynamic ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I None +¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥â¡¼¥É¤Ï°Ê²¼¤Î°ÕÌ£¤ò»ý¤Ä: + +.I None +.\"O No interrupt moderation is applied on the adapter card. +.\"O Therefore, each transmit or receive interrupt is served immediately +.\"O as soon as it appears on the interrupt line of the adapter card. +¥¢¥À¥×¥¿¥«¡¼¥É¤ËÂФ·¤Æ³ä¤ê¹þ¤ßÄ´Ää¤òŬÍѤ·¤Ê¤¤¡£ +¤è¤Ã¤ÆÁ÷¿®¤Þ¤¿¤Ï¼õ¿®³ä¤ê¹þ¤ß¤Ï¡¢ +¥¢¥À¥×¥¿¥«¡¼¥É¤Î³ä¤ê¹þ¤ßÀþ¤Ë¸½¤ì¤ë¤Èľ¤°¤Ë½èÍý¤µ¤ì¤ë¡£ + +.br +.I Static +.\"O Interrupt moderation is applied on the adapter card. +.\"O All transmit and receive interrupts are queued until +.\"O a complete moderation interval ends. +.\"O If such a moderation interval ends, all queued interrupts +.\"O are processed in one big bunch without any delay. +.\"O The term +.\"O .I Static +.\"O reflects the fact, that interrupt moderation is always enabled, +.\"O regardless how much network load is currently passing via a +.\"O particular interface. +.\"O In addition, the duration of the moderation interval has a fixed +.\"O length that never changes while the driver is operational. +¥¢¥À¥×¥¿¥«¡¼¥É¤ËÂФ·¤Æ³ä¤ê¹þ¤ßÄ´Ä䤬ŬÍѤµ¤ì¤ë¡£ +Á´¤Æ¤ÎÁ÷¿®¤Þ¤¿¤Ï¼õ¿®³ä¤ê¹þ¤ß¤Ï¡¢Ä´Ää´Ö³Ö¤¬´°Á´¤Ë½ª¤ï¤ë¤Þ¤Ç +¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¡£ +¤³¤ÎÄ´Ää´Ö³Ö¤¬½ª¤ï¤ë¤È¡¢¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤¿Á´¤Æ¤Î³ä¤ê¹þ¤ß¤Ï¡¢ +1¸Ä¤ÎÂ礭¤Ê²ô¤È¤·¤ÆÃÙ±ä¤Ê¤¯½èÍý¤µ¤ì¤ë¡£ +.I Static +¤È¤¤¤¦ÍѸì¤Ï¡¢¤¢¤ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë¸½ºß¤É¤ì¤À¤±¤Î +¥Í¥Ã¥È¥ï¡¼¥¯Éé²Ù¤¬¤«¤«¤Ã¤Æ¤¤¤ë¤«¤Ë´Ø¤ï¤é¤º¡¢ +³ä¤ê¹þ¤ßÄ´Ä䤬¾ï¤ËÍ­¸ú¤Ë¤Ê¤ë¤³¤È¤òɽ¤·¤Æ¤¤¤ë¡£ +¤µ¤é¤Ë¡¢Ä´Ää´Ö³Ö¤Î»þ´Ö¤Ï¸ÇÄê¤Ç¡¢¥É¥é¥¤¥Ð¤¬Æ°ºî¤·¤Æ¤¤¤ë´Ö¤ÏÊѲ½¤·¤Ê¤¤¡£ + +.br +.I Dynamic +.\"O Interrupt moderation might be applied on the adapter card, +.\"O depending on the load of the system. +.\"O If the driver detects that the system load is too high, +.\"O the driver tries to shield the system against too much network +.\"O load by enabling interrupt moderation. +.\"O If \(em at a later time \(em the CPU utilization decreases +.\"O again (or if the network load is negligible) the interrupt +.\"O moderation will automatically be disabled. +¥·¥¹¥Æ¥à¤ÎÉé²Ù¤Ë±þ¤¸¤Æ¡¢¥¢¥À¥×¥¿¥«¡¼¥É¤ËÂФ·¤Æ³ä¤ê¹þ¤ßÄ´Ä䤬ŬÍѤµ¤ì¤ë¡£ +¥É¥é¥¤¥Ð¤¬¥·¥¹¥Æ¥à¤ÎÉé²Ù¤¬¹â¤¹¤®¤ë¤È¸¡½Ð¤·¤¿¾ì¹ç¡¢ +³ä¤ê¹þ¤ßÄ´Ää¤òÍ­¸ú¤Ë¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢ +²á¾ê¤Ê¥Í¥Ã¥È¥ï¡¼¥¯Éé²Ù¤«¤é¥·¥¹¥Æ¥à¤òÊݸ¤è¤¦¤È¤¹¤ë¡£ +\(em ¤½¤Î¸å¤Ë \(em CPU ÍøÍÑΨ¤¬ºÆ¤Ó²¼¤¬¤Ã¤¿¾ì¹ç +(¤Þ¤¿¤Ï¥Í¥Ã¥È¥ï¡¼¥¯Éé²Ù¤¬¶Ë¤ï¤º¤«¤Ë¤Ê¤Ã¤¿¾ì¹ç)¡¢ +³ä¤ê¹þ¤ßÄ´Ää¤Ï¼«Æ°Åª¤Ë̵¸ú¤Ë¤µ¤ì¤ë¡£ + +.\"O Interrupt moderation should be used when the driver has to +.\"O handle one or more interfaces with a high network load, +.\"O which \(em as a consequence \(em leads also to a high CPU utilization. +.\"O When moderation is applied in such high network load situations, +.\"O CPU load might be reduced by 20-30% on slow computers. +¥É¥é¥¤¥Ð¤¬°·¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¤¦¤Á +¥Í¥Ã¥È¥ï¡¼¥¯Éé²Ù¤¬¹â¤¤¤â¤Î¤¬ 1 ¤Ä°Ê¾å¤¢¤ê¡¢ +\(em ¤½¤Î·ë²Ì \(em CPU ÍøÍÑΨ¤¬¹â¤¯¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +³ä¤ê¹þ¤ßÄ´Ää¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +¥Í¥Ã¥È¥ï¡¼¥¯Éé²Ù¤¬¹â¤¤¾õ¶·¤ÇÄ´Ä䤬ŬÍѤµ¤ì¤ë¤È¡¢ +ÃÙ¤¤¥³¥ó¥Ô¥å¡¼¥¿¤Ç¤Ï CPU Éé²Ù¤¬ 20-30% ºï¸º¤µ¤ì¤ë¤À¤í¤¦¡£ + +.\"O Note that the drawback of using interrupt moderation is an increase of +.\"O the round-trip-time (RTT), due to the queuing and serving of +.\"O interrupts at dedicated moderation times. +³ä¤ê¹þ¤ßÄ´Ää¤ò»È¤¦¤³¤È¤Î·çÅÀ¤È¤·¤Æ¡¢ +±ýÉüÃÙ±ä»þ´Ö (round-trip-time, RTT) ¤ÎÁý²Ã¤¬¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤³¤ì¤Ï¡¢³ä¤ê¹þ¤ß¤¬¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¡¢¤Þ¤È¤á¤Æ½èÍý¤µ¤ì¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.TP +.BI IntsPerSec= i,j,... +.\"O This parameter determines the length of any interrupt moderation interval. +¤³¤Î°ú¤­¿ô¤Ï³ä¤ê¹þ¤ßÄ´Ää¤Î´Ö³Ö¤ò·èÄꤹ¤ë¡£ +.\"O Assuming that static interrupt moderation is to be used, an +.\"O .I IntsPerSec +.\"O parameter value of 2000 will lead to an interrupt moderation interval of +.\"O 500 microseconds. +.\"O Possible values for this parameter are in the range of +.\"O 30...40000 (interrupts per second). +.\"O The default value is 2000. +ÀÅŪ (static) ³ä¤ê¹þ¤ßÄ´Ä䤬»È¤ï¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.I IntsPerSec +°ú¤­¿ô¤ÎÃͤ¬ 2000 ¤Ç¤¢¤ì¤Ð¡¢³ä¤ê¹þ¤ßÄ´Ää¤Î´Ö³Ö¤Ï 500 ¥ß¥êÉäˤʤ롣 +¤³¤Î°ú¤­¿ô¤ËÀßÄê²Äǽ¤ÊÃÍ¤Ï 30...40000 ¤ÎÈϰϤǡ¢ +¤³¤ì¤Ï 1 ÉÃËè¤Î³ä¤ê¹þ¤ß²ó¿ô¤Ç¤¢¤ë¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 2000 ¤Ç¤¢¤ë¡£ + +.\"O This parameter is only used, if either static or dynamic interrupt moderation +.\"O is enabled on a network adapter card. +.\"O This parameter is ignored if no moderation is applied. +¤³¤Î°ú¤­¿ô¤ÏÀÅŪ (static) ¤Þ¤¿¤ÏưŪ (dynamic) ³ä¤ê¹þ¤ßÄ´Ä䤬 +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¤­¤Ë¤Î¤ß»ÈÍѤµ¤ì¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ï³ä¤ê¹þ¤ßÄ´Ä䤬ŬÍѤµ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"O Note that the duration of the moderation interval is to be chosen with care. +.\"O At first glance, selecting a very long duration (e.g., only 100 interrupts per +.\"O second) seems to be meaningful, but the increase of packet-processing delay +.\"O is tremendous. +.\"O On the other hand, selecting a very short moderation time might +.\"O compensate the use of any moderation being applied. +Ä´Ää´Ö³Ö¤Î´ü´Ö¤ÏÃí°Õ¤·¤ÆÁª¤Ö¤³¤È¡£ +°ì¸«¤·¤¿¤È¤³¤í¤Ç¤Ï¡¢¤È¤Æ¤âŤ¤´ü´Ö (Î㤨¤Ð 1 ÉÃ´Ö¤Ë 100 ²ó¤À¤±¤Î³ä¤ê¹þ¤ß) ¤ò +Áª¤Ö¤³¤È¤Ë°ÕÌ£¤¬¤¢¤ë¤è¤¦¤Ë¸«¤¨¤ë¤«¤â¤·¤ì¤Ê¤¤¤¬¡¢¤½¤¦¤¹¤ë¤È +¥Ñ¥±¥Ã¥È½èÍý¤ÎÃٱ䤬·ã¤·¤¯Áý²Ã¤¹¤ë¡£ +°ìÊý¤Ç¡¢¤È¤Æ¤âû¤¤Ä´Ää»þ´Ö¤òÁª¤Ö¤È¡¢³ä¤ê¹þ¤ßÄ´Ää¤ò»È¤¦°ÕÌ£¤¬¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¡£ +.TP +.BI PrefPort= i,j,... +.\"O This parameter is used to force the preferred port to +.\"O A or B (on dual-port network adapters). +.\"O The preferred port is the one that is used if both ports A and B are +.\"O detected as fully functional. +.\"O Possible values are: +¤³¤Î°ú¤­¿ô¤Ï (2 ¥Ý¡¼¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥À¥×¥¿¤Ç) +Í¥Àè (preferred) ¥Ý¡¼¥È¤ò A ¤Þ¤¿¤Ï B ¤Î¤É¤Á¤é¤Ë¤¹¤ë¤«¤ò»ØÄꤹ¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£ +Í¥Àè¥Ý¡¼¥È¤È¤Ï¡¢A ¤È B ¤ÎξÊý¤Î¥Ý¡¼¥È¤¬´°Á´¤Ëµ¡Ç½¤·¤Æ¤¤¤ë¤È¸¡ÃΤµ¤ì¤¿¾ì¹ç¤Ë +»ÈÍѤµ¤ì¤ë¥Ý¡¼¥È¤Ç¤¢¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.\"O .I A +.\"O or +.\"O .I B +.\"O whereas +.\"O .I A +.\"O is the default. +.I A +¤Þ¤¿¤Ï +.IR B ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I A +¤Ç¤¢¤ë¡£ +.TP +.BI RlmtMode= i,j,... +.\"O RLMT monitors the status of the port. +.\"O If the link of the active port fails, +.\"O RLMT switches immediately to the standby link. +.\"O The virtual link is maintained as long as at least one "physical" link is up. +.\"O This parameters states how RLMT should monitor both ports. +.\"O Possible values are: +RLMT ¤Ï¥Ý¡¼¥È¤Î¾õÂÖ¤ò´Æ»ë¤¹¤ë¡£ +¥¢¥¯¥Æ¥£¥Ö¤Ê¥Ý¡¼¥È¤Î¥ê¥ó¥¯¤¬Íî¤Á¤¿¾ì¹ç¡¢ +RLMT ¤Ï¨»þ¤ËÂÔµ¡¤·¤Æ¤¤¤ë¥ê¥ó¥¯¤ËÀÚ¤êÂؤ¨¤ë¡£ +¾¯¤Ê¤¯¤È¤â 1 ¤Ä¤Î¡ÖʪÍýŪ¡×¥ê¥ó¥¯¤¬µ¯Æ°¤¹¤ë¤Þ¤Ç¤Ï¡¢²¾ÁÛ¥ê¥ó¥¯¤¬°Ý»ý¤µ¤ì¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ï RLMT ¤¬Î¾Êý¤Î¥Ý¡¼¥È¤ò¤É¤Î¤è¤¦¤Ë´Æ»ë¤¹¤ë¤«¤ò·è¤á¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.\"O .IR CheckLinkState , +.\"O .IR CheckLocalPort , +.\"O .I CheckSeg +.\"O or +.\"O .I DualNet +.\"O whereas +.\"O .I CheckLinkState +.\"O is the default. +.\"O The different modes have the following meaning: +.IR CheckLinkState , +.IR CheckLocalPort , +.IR CheckSeg , +.IR DualNet ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I CheckLinkState +¤Ç¤¢¤ë¡£ +³Æ¥â¡¼¥É¤Ï°Ê²¼¤Î¤è¤¦¤Ê°ÕÌ£¤ò»ý¤Ä¡£ + +.I CheckLinkState +.\"O Check link state only: RLMT uses the link state reported by the adapter +.\"O hardware for each individual port to determine whether a port can be used +.\"O for all network traffic or not. +¥ê¥ó¥¯¾õÂ֤ΥÁ¥§¥Ã¥¯¤Î¤ß: +RLMT ¤Ï¡¢³Æ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¥¢¥À¥×¥¿¥Ï¡¼¥É¥¦¥§¥¢¤¬Êó¹ð¤¹¤ë¥ê¥ó¥¯¾õÂÖ¤ò»È¤¤¡¢ +¤½¤Î¥Ý¡¼¥È¤¬Á´¤Æ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥È¥é¥Õ¥£¥Ã¥¯¤òÁ÷¼õ¿®¤¹¤ë¤Î¤Ë»ÈÍѲÄǽ¤«¤ò +·èÄꤹ¤ë¡£ + +.br +.I CheckLocalPort +.\"O In this mode, RLMT monitors the network path between the two +.\"O ports of an adapter by regularly exchanging packets between them. +.\"O This mode requires a network configuration in which the +.\"O two ports are able to "see" each other (i.e., there +.\"O must not be any router between the ports). +¤³¤Î¥â¡¼¥É¤Ç¤Ï¡¢RLMT ¤Ï¥¢¥À¥×¥¿¥«¡¼¥É¤Î 2 ¤Ä¤Î¥Ý¡¼¥È¤Î´Ö¤Ç +Äê´üŪ¤Ë¥Ñ¥±¥Ã¥È¤ò¸ò´¹¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢ +2 ¤Ä¤Î¥Ý¡¼¥È¤Î´Ö¤Î¥Í¥Ã¥È¥ï¡¼¥¯·ÐÏ©¤ò´Æ»ë¤¹¤ë¡£ +¤³¤Î¥â¡¼¥É¤Ç¤Ï 2 ¤Ä¤Î¥Ý¡¼¥È¤¬¸ß¤¤¤Ë¡Ö¸«¤¨¤ë¡×¤è¤¦¤Ê +¥Í¥Ã¥È¥ï¡¼¥¯ÀßÄ꤬ɬÍפǤ¢¤ë +(¤Ä¤Þ¤ê¡¢¥Ý¡¼¥È´Ö¤Ë¥ë¡¼¥¿¤¬¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤)¡£ + +.br +.I CheckSeg +.\"O Check local port and segmentation: +.\"O This mode supports the same functions as the CheckLocalPort +.\"O mode and additionally checks network segmentation between the ports. +.\"O Therefore, this mode is only to be used if Gigabit Ethernet +.\"O switches are installed on the network that have been +.\"O configured to use the Spanning Tree protocol. +¥í¡¼¥«¥ë¥Ý¡¼¥È¤È¥»¥°¥á¥ó¥È¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +¤³¤Î¥â¡¼¥É¤Ï CheckLocalPort ¥â¡¼¥É¤ÈƱ¤¸µ¡Ç½¤òÄ󶡤·¡¢ +¹¹¤Ë¥Ý¡¼¥È´Ö¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥»¥°¥á¥ó¥È¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +¤è¤Ã¤Æ¡¢¤³¤Î¥â¡¼¥É¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Ë +¥¹¥Ñ¥Ë¥ó¥°¥Ä¥ê¡¼¥×¥í¥È¥³¥ë (Spanning Tree protocol) ¤ò +»È¤¦¤è¤¦¤ËÀßÄꤵ¤ì¤¿¥®¥¬¥Ó¥Ã¥È¥¤¡¼¥µ¥Í¥Ã¥È¥¹¥¤¥Ã¥Á¤¬ +ÀßÃÖ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ß»ÈÍѤǤ­¤ë¡£ + +.br +.I DualNet +.\"O In this mode, ports A and B are used as separate devices. +.\"O If you have a dual port adapter, port A will be configured as +.\"O .IR eth[x] +.\"O and port B as +.\"O .I eth[x+1] +.\"O Both ports can be used independently with distinct IP addresses. +.\"O The preferred port setting is not used. +.\"O RLMT is turned off. +¤³¤Î¥â¡¼¥É¤Ç¤Ï¡¢¥Ý¡¼¥È A ¤È B ¤¬ÊÌ¡¹¤Î¥Ç¥Ð¥¤¥¹¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +2 ¥Ý¡¼¥È¤Î¥¢¥À¥×¥¿¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢¥Ý¡¼¥È A ¤ò +.I eth[x] +¤Ë¡¢¥Ý¡¼¥È B ¤ò +.I eth[x+1] +¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +2 ¤Ä¤Î¥Ý¡¼¥È¤ÏÊÌ¡¹¤Î IP ¥¢¥É¥ì¥¹¤òÉÕ¤±¤ÆÆÈΩ¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Í¥Àè¥Ý¡¼¥È¤ÎÀßÄê¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£ +RLMT ¤Ï̵¸ú¤Ë¤µ¤ì¤ë¡£ + +.\"O Note that RLMT modes +.\"O .I CheckLocalPort +.\"O and +.\"O .I CheckLinkState +.\"O are designed to operate in configurations where a +.\"O network path between the ports on one adapter exists. +.\"O Moreover, they are not designed to work where adapters are +.\"O connected back-to-back. +RLMT ¥â¡¼¥É +.I CheckLocalPort +¤È +.I CheckLinkState +¤Ï¡¢1 ¤Ä¤Î¥¢¥À¥×¥¿¾å¤Î¥Ý¡¼¥È´Ö¤Ç¥Í¥Ã¥È¥ï¡¼¥¯·ÐÏ©¤¬¤¢¤ë¤è¤¦¤ÊÀßÄê¤Ç +Æ°ºî¤¹¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +¤µ¤é¤Ë¡¢¤³¤Î¥â¡¼¥É¤Ï¥¢¥À¥×¥¿Æ±»Î¤¬Ä¾·ë (back-to-back) ¤Ç +Àܳ¤µ¤ì¤Æ¤¤¤ë¾õÂÖ¤ÇÆ°ºî¤¹¤ë¤è¤¦¤Ë¤ÏÀ߷פµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /proc/net/sk98lin/eth[x] +.br +.\"O The statistics file of a particular interface of an adapter card. +.\"O It contains generic information about the adapter card plus a detailed +.\"O summary of all transmit and receive counters. +¥¢¥À¥×¥¿¥«¡¼¥É¤ÎÆÃÄê¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÎÅý·×¥Õ¥¡¥¤¥ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¥¢¥À¥×¥¿¥«¡¼¥É¤Î°ìÈÌŪ¤Ê¾ðÊó¤È¡¢ +Á´¤Æ¤ÎÁ÷¿®¡¦¼õ¿®¥«¥¦¥ó¥¿¤Î¾ÜºÙ¤Ê°ìÍ÷¤¬´Þ¤Þ¤ì¤ë¡£ +.TP +.I /usr/src/linux/Documentation/networking/sk98lin.txt +.br +.\"O This is the +.\"O .I README +.\"O file of the +.\"O .I sk98lin +.\"O driver. +.\"O It contains a detailed installation HOWTO and describes all parameters +.\"O of the driver. +.\"O It denotes also common problems and provides the solution to them. +.I sk98lin +¥É¥é¥¤¥Ð¤Î +.I README +¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë¤Ï¾ÜºÙ¤Ê¥¤¥ó¥¹¥È¡¼¥ë HOWTO ¤¬´Þ¤Þ¤ì¤Æ¤ª¤ê¡¢ +¥É¥é¥¤¥Ð¤ÎÁ´¤Æ¤Î°ú¤­¿ô¤¬µ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +¤Þ¤¿°ìÈÌŪ¤ÊÌäÂê¤È¤½¤Î²ò·èË¡¤Ë¤Ä¤¤¤Æ¤â½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Report any bugs to linux@syskonnect.de +¥Ð¥°¤Ï linux@syskonnect.de ¤ËÊó¹ð¤·¤Æ¤Û¤·¤¤¡£ +.\"O .\" .SH AUTHORS +.\" .SH Ãø¼Ô +.\" Ralph Roesler \(em rroesler@syskonnect.de +.\" .br +.\" Mirko Lindner \(em mlindner@syskonnect.de +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR insmod (8), +.BR ifconfig (8), +.BR modprobe (8) diff --git a/draft/man4/st.4 b/draft/man4/st.4 new file mode 100644 index 00000000..c1be9bf9 --- /dev/null +++ b/draft/man4/st.4 @@ -0,0 +1,1608 @@ +.\" Copyright 1995 Robert K. Nichols (Robert.K.Nichols@att.com) +.\" Copyright 1999-2005 Kai M¥Æ¡¢kisara (Kai.Makisara@kolumbus.fi) +.\" +.\" 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 Last Modified Tue Feb 10 15:09:29 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated Sun Mar 12 2000 by NAKANO Takeo +.\" Updated Sun Apr 24 2005 by NAKANO Takeo +.sp +.BI "int ioctl(int " fd ", int " request " [, (void *)" arg3 "]);" +.BI "int ioctl(int " fd ", MTIOCTOP, (struct mtop *)" mt_cmd ); +.BI "int ioctl(int " fd ", MTIOCGET, (struct mtget *)" mt_status ); +.BI "int ioctl(int " fd ", MTIOCPOS, (struct mtpos *)" mt_pos ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .B st +.\"O driver provides the interface to a variety of SCSI tape devices. +.\"O Currently, the driver takes control of all detected devices of type +.\"O \(lqsequential-access\(rq. +.\"O The +.\"O .B st +.\"O driver uses major device number 9. +.B st +¥É¥é¥¤¥Ð¡¼¤ÏÍÍ¡¹¤Ê SCSI ¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤òÄ󶡤¹¤ë¡£ +¸½ºß¤Ç¤Ï¡¢¥É¥é¥¤¥Ð¡¼¤Ï¸¡½Ð¤µ¤ì¤¿Á´¤Æ¤Î +\(lq¥·¡¼¥±¥ó¥·¥ã¥ë¥¢¥¯¥»¥¹ (sequential-access) \(rq ¥¿¥¤¥×¤Î¥Ç¥Ð¥¤¥¹¤Ø¤Î +À©¸æ¤ò¹Ô¤¦¡£ +.B st +¥É¥é¥¤¥Ð¡¼¤Ï¥á¥¸¥ã¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 9 ¤òÍѤ¤¤ë¡£ +.PP +.\"O Each device uses eight minor device numbers. +.\"O The lowermost five bits +.\"O in the minor numbers are assigned sequentially in the order of +.\"O detection. +.\"O In the 2.6 kernel, the bits above the eight lowermost bits are +.\"O concatenated to the five lowermost bits to form the tape number. +.\"O The minor numbers can be grouped into +.\"O two sets of four numbers: the principal (auto-rewind) minor device numbers, +.\"O .IR n , +.\"O and the \(lqno-rewind\(rq device numbers, +.\"O .RI ( n " + 128)." +.\"O Devices opened using the principal device number will be sent a +.\"O .BR REWIND +.\"O command when they are closed. +.\"O Devices opened using the \(lqno-rewind\(rq device number will not. +.\"O (Note that using an auto-rewind device for positioning the tape with, +.\"O for instance, mt does not lead to the desired result: the tape is +.\"O rewound after the mt command and the next command starts from the +.\"O beginning of the tape). +¤½¤ì¤¾¤ì¤Î¥Ç¥Ð¥¤¥¹¤Ï 8 ¤Ä¤Î¥Þ¥¤¥Ê¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤ò»È¤¦¡£ +¥Þ¥¤¥Ê¡¼ÈÖ¹æ¤ÎÄã°Ì¦¤Î 5 ¥Ó¥Ã¥È¤Ï¡¢¸¡½Ð¤µ¤ì¤¿½ç¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +¥«¡¼¥Í¥ë 2.6 ¤Ç¤Ï¡¢ +Äã°Ì¦ 8 ¥Ó¥Ã¥È¤è¤ê¤â¾å°Ì¤Ë¤¢¤ë¥Ó¥Ã¥È·²¤¬¤³¤Î 5 ¥Ó¥Ã¥È¤ËÏ¢·ë (concatenate) +¤µ¤ì¡¢¥Æ¡¼¥ÖÈÖ¹æ¤È¤Ê¤ë¡£ +¥Þ¥¤¥Ê¡¼ÈÖ¹æ¤Ï¡¢¤½¤ì¤¾¤ì 4 ¤Ä¤Î¿ô»ú¤«¤é¤Ê¤ëÆó¤Ä¤Î¥»¥Ã¥È¤Ë +¥°¥ë¡¼¥×ʬ¤±¤µ¤ì¤ë¡£ +´ðËÜ (¼«Æ°´¬¤­Ìᤷ) ¥Ç¥Ð¥¤¥¹ÈÖ¹æ +.IR n ¡¢ +¤ª¤è¤Ó \(lqÈ󴬤­Ìᤷ (no-rewind) \(rq ¥Ç¥Ð¥¤¥¹ÈÖ¹æ +.RI ( n " + 128)." +¤Ç¤¢¤ë¡£ +´ðËܥǥХ¤¥¹ÈÖ¹æ¤òÍѤ¤¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Ç¥Ð¥¤¥¹¤Ë¤Ï¡¢ +¥¯¥í¡¼¥º¤¹¤ë»þ¤Ë +.B REWIND +¥³¥Þ¥ó¥É¤¬Á÷¤é¤ì¤ë¡£ +\(lqÈ󴬤­Ìᤷ\(rq ¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤òÍѤ¤¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤¿¾ì¹ç¤Ï +\s-1REWIND\s+1 ¥³¥Þ¥ó¥É¤ÏÁ÷¤é¤ì¤Ê¤¤ +(¼«Æ°´¬¤­Ìᤷ¥Ç¥Ð¥¤¥¹¤ò¥Æ¡¼¥×¤Î°ÌÃÖ·è¤á¤Ë (Î㤨¤Ð mt ¤Ç) ÍѤ¤¤Æ¤â¡¢ +˾¤à·ë²Ì¤ÏÆÀ¤é¤ì¤Ê¤¤¡£¥Æ¡¼¥×¤Ï mt ¥³¥Þ¥ó¥É¤Î¸å¤Ç´¬¤­Ìᤵ¤ì¡¢ +¼¡¤Î¥³¥Þ¥ó¥É¤Ï¥Æ¡¼¥×¤ÎÀèƬ¤«¤é»Ï¤Þ¤Ã¤Æ¤·¤Þ¤¦)¡£ +.PP +.\"O Within each group, four minor numbers are available to define +.\"O devices with different characteristics (block size, compression, +.\"O density, etc.) +.\"O When the system starts up, only the first device is +.\"O available. +.\"O The other three are activated when the default +.\"O characteristics are defined (see below). +.\"O (By changing compile-time +.\"O constants, it is possible to change the balance between the maximum +.\"O number of tape drives and the number of minor numbers for each +.\"O drive. +.\"O The default allocation allows control of 32 tape drives. +.\"O For instance, it is possible to control up to 64 tape drives +.\"O with two minor numbers for different options.) +¤½¤ì¤¾¤ì¤Î¥°¥ë¡¼¥×¤Ç¡¢°Û¤Ê¤Ã¤¿ÆÃÀ­ (¥Ö¥í¥Ã¥¯¥µ¥¤¥º¡¦°µ½Ì¡¦ +Ì©Å٤ʤÉ) ¤Î¥Ç¥Ð¥¤¥¹¤òÄêµÁ¤¹¤ë¤¿¤á¤Ë 4 ¤Ä¤Î¥Þ¥¤¥Ê¡¼Èֹ椬ÍøÍѤǤ­¤ë¡£ +¥·¥¹¥Æ¥à¤¬µ¯Æ°¤·¤¿¤È¤­¤Ë¤Ï¡¢ºÇ½é¤Î¥Ç¥Ð¥¤¥¹¤À¤±¤¬»È¤¨¤ë¡£ +¾¤Î 3 ¤Ä¤Ï¥Ç¥Õ¥©¥ë¥È¤ÎÆÃÀ­¤¬ÄêµÁ¤µ¤ì¤Æ½é¤á¤Æ»È¤¨¤ë¤è¤¦¤Ë¤Ê¤ë (¸å½Ò)¡£ +(¥³¥ó¥Ñ¥¤¥ë»þ¤ÎÄê¿ô¤òÊѹ¹¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥Æ¡¼¥×¥É¥é¥¤¥Ö¤ÎºÇÂç¿ô¤È¡¢ +¤½¤ì¤¾¤ì¤Î¥É¥é¥¤¥Ö¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¥Þ¥¤¥Ê¡¼ÈÖ¹æ¤Î¸Ä¿ô¤È¤òÄ´À°¤Ç¤­¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î³ä¤êÅö¤Æ¤Ç¤Ï 32 Âæ¤Þ¤Ç¤Î¥Æ¡¼¥×¥É¥é¥¤¥Ö¤òÀ©¸æ¤Ç¤­¤ë¡£ +Î㤨¤Ð 64 Âæ¤Þ¤Ç¤Î¥Æ¡¼¥×¥É¥é¥¤¥Ö¤ò¡¢°Û¤Ê¤Ã¤¿¥ª¥×¥·¥ç¥ó¤ò»ý¤Ä +Æó¤Ä¤Î¥Þ¥¤¥Ê¡¼ÈÖ¹æ¤ÇÀ©¸æ¤¹¤ë¤è¤¦¤Ë¤â¤Ç¤­¤ë¡£) +.PP +.\"O Devices are typically created by: +¥Ç¥Ð¥¤¥¹¤ÏÉáÄ̼¡¤Î¤è¤¦¤Ëºî¤é¤ì¤ë: +.in +4n +.nf + +mknod \-m 666 /dev/st0 c 9 0 +mknod \-m 666 /dev/st0l c 9 32 +mknod \-m 666 /dev/st0m c 9 64 +mknod \-m 666 /dev/st0a c 9 96 +mknod \-m 666 /dev/nst0 c 9 128 +mknod \-m 666 /dev/nst0l c 9 160 +mknod \-m 666 /dev/nst0m c 9 192 +mknod \-m 666 /dev/nst0a c 9 224 +.fi +.in +.PP +.\"O There is no corresponding block device. +¤³¤ì¤é¤Ë¤ÏÂбþ¤¹¤ë¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Ï¸ºß¤·¤Ê¤¤¡£ +.PP +.\"O The driver uses an internal buffer that has to be large enough to hold +.\"O at least one tape block. +.\"O In kernels before 2.1.121, the buffer is +.\"O allocated as one contiguous block. +.\"O This limits the block size to the +.\"O largest contiguous block of memory the kernel allocator can provide. +.\"O The limit is currently 128 kB for 32-bit architectures and +.\"O 256 kB for 64-bit architectures. +.\"O In newer kernels the driver +.\"O allocates the buffer in several parts if necessary. +.\"O By default, the +.\"O maximum number of parts is 16. +.\"O This means that the maximum block size +.\"O is very large (2 MB if allocation of 16 blocks of 128 kB succeeds). +¥É¥é¥¤¥Ð¤ÏÆâÉô¥Ð¥Ã¥Õ¥¡¤ò»È¤¤¡¢¤½¤ÎÂ礭¤µ¤Ï¾¯¤Ê¤¯¤È¤â¥Æ¡¼¥×¤Î +1 ¥Ö¥í¥Ã¥¯¤òÊÝ»ý¤Ç¤­¤ë¤è¤¦¤Ë¼è¤é¤ì¤ë¡£ 2.1.121 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¥Ð¥Ã¥Õ¥¡¤ÏϢ³¤¹¤ë°ì¤Ä¤Î¥Ö¥í¥Ã¥¯¤È¤·¤Æ³ä¤êÅö¤Æ¤é¤ì¤ë¡£¤³¤ÎÊýË¡¤À¤È¡¢ +¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎºÇÂçÃͤϥ«¡¼¥Í¥ë¤Î³ä¤êÅö¤Æ²Äǽ¤ÊϢ³¥á¥â¥ê¥Ö¥í¥Ã¥¯¤Ë +À©¸Â¤µ¤ì¤ë¡£¤³¤ÎÀ©¸Â¤Ï 32 ¥Ó¥Ã¥È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï 128 kB¡¢ +64 ¥Ó¥Ã¥È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï 256 kB ¤Ç¤¢¤ë¡£¤³¤ì°Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¥É¥é¥¤¥Ð¤ÏɬÍפ˱þ¤¸¤Æ¤¤¤¯¤Ä¤«¤Ë¤ï¤«¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ò³ä¤êÅö¤Æ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 16 ¸Ä¤Þ¤Ç¤ÎÉôʬ¤Ëʬ³ä¤Ç¤­¤ë¡£¤¹¤Ê¤ï¤Á +¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎºÇÂçÃͤÏÈó¾ï¤ËÂ礭¤¤ (128 kB ¤Î¥Ö¥í¥Ã¥¯ 16 ¸Ä¤Î +³ä¤êÅö¤Æ¤ËÀ®¸ù¤¹¤ì¤Ð 2 MB ¤È¤Ê¤ë)¡£ +.PP +.\"O The driver's internal buffer size is determined by a compile-time +.\"O constant which can be overridden with a kernel startup option. +.\"O In addition to this, the driver tries to allocate a larger temporary +.\"O buffer at run time if necessary. +.\"O However, run-time allocation of large +.\"O contiguous blocks of memory may fail and it is advisable not to rely +.\"O too much on dynamic buffer allocation with kernels older than 2.1.121 +.\"O (this applies also to demand-loading the driver with kerneld or kmod). +¥É¥é¥¤¥Ð¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ï¥³¥ó¥Ñ¥¤¥ë»þ¤ÎÄê¿ô¤ÇÄêµÁ¤µ¤ì¤ë¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ë¤Îµ¯Æ°»þ¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¾å½ñ¤­²Äǽ¤Ç¤¢¤ë¡£ +¤µ¤é¤Ë¥É¥é¥¤¥Ð¤Ï¼Â¹Ô»þ¤Ë¤â¡¢É¬Íפ˱þ¤¸¤Æ¤è¤êÂ礭¤Ê°ì»þ¥Ð¥Ã¥Õ¥¡¤ò +³ä¤êÅö¤Æ¤è¤¦¤È¤¹¤ë¡£¤·¤«¤·¼Â¹Ô»þ¤ËÂ礭¤ÊϢ³¥á¥â¥ê¥Ö¥í¥Ã¥¯¤ò +³ä¤êÅö¤Æ¤è¤¦¤È¤¹¤ë¤È¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ë¤Î¤Ç¡¢ 2.1.121 +°ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢Æ°Åª¤Ê¥Ð¥Ã¥Õ¥¡³ä¤êÅö¤Æ¤Ï¤¢¤Þ¤ê¤¢¤Æ¤Ë¤·¤Ê¤¤¤Û¤¦¤¬Îɤ¤ +(¤³¤ì¤Ï kerneld ¤ä kmod ¤Ë¤è¤ë¥É¥é¥¤¥Ð¤Î¥Ç¥Þ¥ó¥É¥í¡¼¥É¤Ë´Ø¤·¤Æ¤âÅö¤Æ¤Ï¤Þ¤ë)¡£ +.PP +.\"O The driver does not specifically support any tape drive brand or +.\"O model. +.\"O After system start-up the tape device options are defined by +.\"O the drive firmware. +.\"O For example, if the drive firmware selects fixed-block mode, +.\"O the tape device uses fixed-block mode. +.\"O The options can +.\"O be changed with explicit +.\"O .BR ioctl (2) +.\"O calls and remain in effect when the device is closed and reopened. +.\"O Setting the options affects both the auto-rewind and the nonrewind +.\"O device. +¥É¥é¥¤¥Ð¤Ï¥É¥é¥¤¥Ö¤Î¥á¡¼¥«¤ä¥â¥Ç¥ë¤òÆÃÄꤷ¤Æ¥µ¥Ý¡¼¥È¤¹¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¥·¥¹¥Æ¥à¤¬µ¯Æ°¤¹¤ë¤È¡¢¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤Î¥ª¥×¥·¥ç¥ó¤¬¥É¥é¥¤¥Ö¤Î +¥Õ¥¡¡¼¥à¥¦¥§¥¢¤Ë¤è¤Ã¤ÆÄêµÁ¤µ¤ì¤ë¡£Î㤨¤Ð¡¢ +¥É¥é¥¤¥Ö¤Î¥Õ¥¡¡¼¥à¥¦¥§¥¢¤¬¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤òÁªÂò¤¹¤ì¤Ð¡¢ +¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤Ï¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤ò»È¤¦¤³¤È¤Ë¤Ê¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.BR ioctl (2) +¥³¡¼¥ë¤òÌÀ¼¨Åª¤Ë»È¤¨¤ÐÊѹ¹¤Ç¤­¡¢ +¤½¤ÎÊѹ¹¤Ï¥Ç¥Ð¥¤¥¹¤¬¥¯¥í¡¼¥º¤µ¤ì¤ÆºÆ¤Ó¥ª¡¼¥×¥ó¤µ¤ì¤¿¤È¤­¤â»Ä¤ë¡£ +.\"nakano: µÕ¤«¡© +¥ª¥×¥·¥ç¥ó¤ÎÀßÄê¤Ï¡¢ +¼«Æ°´¬¤­Ìᤷ¥Ç¥Ð¥¤¥¹¤ÈÈ󴬤­Ìᤷ¥Ç¥Ð¥¤¥¹¤ÎξÊý¤Ë±Æ¶Á¤¹¤ë¡£ +.PP +.\"O Different options can be specified for the different devices within +.\"O the subgroup of four. +.\"O The options take effect when the device is +.\"O opened. +.\"O For example, the system administrator can define +.\"O one device that writes in fixed-block mode with a certain block size, +.\"O and one which writes in variable-block mode (if the drive supports +.\"O both modes). +4 ¤Ä¤Î¥µ¥Ö¥°¥ë¡¼¥×¤½¤ì¤¾¤ì¤Î¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ°Û¤Ê¤ë¥ª¥×¥·¥ç¥ó¤ò +Í¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¥ª¥×¥·¥ç¥ó¤Ï¥Ç¥Ð¥¤¥¹¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¤È¤­¤Ë +¸úÎϤòȯ´ø¤¹¤ë¡£Î㤨¤Ð¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô¤Ï¤¢¤ë¥Ç¥Ð¥¤¥¹¤ò +ŬÅö¤Ê¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤Î¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç½ñ¤­¹þ¤à¤è¤¦¤ËÄêµÁ¤·¡¢ +Ê̤ΥǥХ¤¥¹¤ò²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç½ñ¤­¹þ¤à¤è¤¦¤Ë¤Ç¤­¤ë (¥É¥é¥¤¥Ö¤¬ +ξÊý¤Î¥â¡¼¥É¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ì¤Ð)¡£ +.PP +.\"O The driver supports +.\"O .B tape partitions +.\"O if they are supported by the drive. +.\"O (Note that the tape partitions +.\"O have nothing to do with disk partitions. +.\"O A partitioned tape can be +.\"O seen as several logical tapes within one medium.) +.\"O Partition support has to be enabled with an +.\"O .BR ioctl (2). +.\"O The tape +.\"O location is preserved within each partition across partition changes. +.\"O The partition used for subsequent tape operations is +.\"O selected with an +.\"O .BR ioctl (2). +.\"O The partition switch is executed together with +.\"O the next tape operation in order to avoid unnecessary tape +.\"O movement. +.\"O The maximum number of partitions on a tape is defined by a +.\"O compile-time constant (originally four). +.\"O The driver contains an +.\"O .BR ioctl (2) +.\"O that can format a tape with either one or two partitions. +¤³¤Î¥É¥é¥¤¥Ð¤Ï¡¢ +.B ¥Æ¡¼¥×¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë (¥É¥é¥¤¥Ö¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç)¡£ +(¥Æ¡¼¥×¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ï¥Ç¥£¥¹¥¯¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤È¤Ï¤Ê¤ó¤Î´Ø·¸¤â¤Ê¤¤¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó²½¤µ¤ì¤¿¥Æ¡¼¥×¤Ï¡¢°ì¤Ä¤Î¥á¥Ç¥£¥¢¤ËÊ£¿ô¤ÎÏÀÍý¥Æ¡¼¥×¤¬ +¸ºß¤¹¤ë¤«¤Î¤è¤¦¤Ë¸«¤¨¤ë¡£) +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¥µ¥Ý¡¼¥È¤Ï +.BR ioctl (2) +¤Ë¤è¤Ã¤ÆÍ­¸ú¤Ë¤Ç¤­¤ë¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤¬Êѹ¹¤µ¤ì¤ë¤È¡¢ +¥Æ¡¼¥×¤Î°ÌÃ֤Ϥ½¤ì¤¾¤ì¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥óÆâÉô¤ÇÊݸ¤µ¤ì¤ë¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ÎÁªÂò¤Ï +.BR ioctl (2) +¤Ç¹Ô¤¦¡£ +¤½¤ì°Ê¹ß¤Î¥Æ¡¼¥×Áàºî¤ÎÂоݤϡ¢¤½¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ë¤Ê¤ë¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ÎÀÚ¤êÂؤ¨¤Ï¡¢¼¡¤Î¥Æ¡¼¥×Áàºî¤ÈƱ»þ¤Ë¹Ô¤ï¤ì¡¢ +ÉÔɬÍפʥơ¼¥×°ÜÆ°¤ò¤·¤Ê¤¯¤Æ¤¹¤à¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +°ì¤Ä¤Î¥Æ¡¼¥×¤Ë¤ª¤±¤ë¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ÎºÇÂç¿ô¤Ï +¥³¥ó¥Ñ¥¤¥ë»þ¤ÎÄê¿ô¤Ë¤è¤Ã¤ÆÄêµÁ¤µ¤ì¤ë (Ä̾ï¤Ï 4)¡£ +¥É¥é¥¤¥Ð¤Ë¤Ï¡¢¥Æ¡¼¥×¤Î 1 ¤Ä¤Þ¤¿¤Ï +2 ¤Ä¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤­¤ë¤è¤¦¤Ê +.BR ioctl (2) +¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O Device +.\"O .I /dev/tape +.\"O is usually created as a hard or soft link to the default tape device +.\"O on the system. +Ä̾¥·¥¹¥Æ¥à¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë¥Ï¡¼¥É¥ê¥ó¥¯ +¤Þ¤¿¤Ï¥½¥Õ¥È¥ê¥ó¥¯¤È¤·¤Æ¡¢¥Ç¥Ð¥¤¥¹ +.I /dev/tape +¤¬ºîÀ®¤µ¤ì¤ë¡£ +.PP +.\"O Starting from kernel 2.6.2, the driver exports in the sysfs directory +.\"O .I /sys/class/scsi_tape +.\"O the attached devices and some parameters assigned to the devices. +¥«¡¼¥Í¥ë 2.6.2 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¥É¥é¥¤¥Ð¤Ï sysfs ¥Ç¥£¥ì¥¯¥È¥ê +.I /sys/class/scsi_tape +¤Ë¡¢¥¢¥¿¥Ã¥Á¤·¤¿¥Ç¥Ð¥¤¥¹¤È¤½¤Î¥Ç¥Ð¥¤¥¹¤Ë³äÅö¤Æ¤¿¥Ñ¥é¥á¡¼¥¿¤ò¥¨¥¯¥¹¥Ý¡¼¥È¤¹¤ë¡£ +.\"O .SS "Data Transfer" +.SS ¥Ç¡¼¥¿Å¾Á÷ +.\"O The driver supports operation in both fixed-block mode and +.\"O variable-block mode (if supported by the drive). +.\"O In fixed-block mode the drive +.\"O writes blocks of the specified size and the block size is not +.\"O dependent on the byte counts of the write system calls. +.\"O In variable-block mode one tape block is written for each write call +.\"O and the byte +.\"O count determines the size of the corresponding tape block. +.\"O Note that +.\"O the blocks on the tape don't contain any information about the +.\"O writing mode: when reading, the only important thing is to use +.\"O commands that accept the block sizes on the tape. +¤³¤Î¥É¥é¥¤¥Ð¤Ï¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤È²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Î +ξÊý¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë (¥É¥é¥¤¥Ö¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ì¤Ð)¡£ +¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç¤Ï¡¢¥É¥é¥¤¥Ö¤Ï·è¤Þ¤Ã¤¿¥µ¥¤¥º¤Î¥Ö¥í¥Ã¥¯¤ò +(Ê£¿ô¸Ä) ½ñ¤­¹þ¤à¡£¤³¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤Ï +write ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥Ð¥¤¥È¿ô¤Ë¤è¤é¤Ê¤¤¡£ +²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç¤Ï¡¢ +write ¥³¡¼¥ë¤´¤È¤Ë°ì¤Ä¤Î¥Æ¡¼¥×¥Ö¥í¥Ã¥¯¤Ë½ñ¤­¹þ¤ß¤¬¹Ô¤ï¤ì¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¥Ð¥¤¥È¿ô¤¬Âбþ¤¹¤ë¥Æ¡¼¥×¥Ö¥í¥Ã¥¯¤Î¥µ¥¤¥º¤ò·è¤á¤ë¡£ +¥Æ¡¼¥×¾å¤Î¥Ö¥í¥Ã¥¯¤Ë¤Ï¡¢½ñ¤­¹þ¤ß¥â¡¼¥É¤Î¾ðÊó¤Ï°ìÀÚ´Þ¤Þ¤ì¤Ê¤¤¡£ +Æɤ߹þ¤ß¤Î¤È¤­¤Ë½ÅÍפʤ³¤È¤Ï¡¢¥Æ¡¼¥×¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ò¼õ¤±Æþ¤ì¤ë +¥³¥Þ¥ó¥É¤ò»È¤¦¤«¤É¤¦¤«¤À¤±¤Ç¤¢¤ë¡£ +.PP +.\"O In variable-block mode the read byte count does not have to match +.\"O the tape block size exactly. +.\"O If the byte count is larger than the +.\"O next block on tape, the driver returns the data and the function +.\"O returns the actual block size. +.\"O If the block size is larger than the +.\"O byte count, the requested amount of data from the start of the block +.\"O is returned and the rest of the block is discarded. +²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç¤Ï¡¢Æɤ߹þ¤ß¥Ð¥¤¥È¿ô¤Ï¥Æ¡¼¥×¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤È +ɬ¤º¤·¤â°ìÃפ·¤Æ¤¤¤Ê¤¯¤Æ¤âÎɤ¤¡£¥Ð¥¤¥È¿ô¤¬¥Æ¡¼¥×¤Î¼¡¤Î¥Ö¥í¥Ã¥¯¤è¤ê¤â +Â礭¤±¤ì¤Ð¡¢¥É¥é¥¤¥Ð¤Ï¤½¤Î¥Ç¡¼¥¿¤òÊÖ¤·¡¢´Ø¿ô¤Ï¼ÂºÝ¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤òÊÖ¤¹¡£ +¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤¬¥Ð¥¤¥È¿ô¤è¤ê¤âÂ礭¤±¤ì¤Ð¡¢Í׵ᤵ¤ì¤¿Ê¬¤Î¥Ç¡¼¥¿¤¬ +¥Ö¥í¥Ã¥¯¤ÎÀèƬ¤«¤éÆɤ߹þ¤Þ¤ì¤ÆÊÖ¤µ¤ì¡¢¥Ö¥í¥Ã¥¯¤Î»Ä¤ê¤ÏÇË´þ¤µ¤ì¤ë¡£ +.PP +.\"O In fixed-block mode the read byte counts can be arbitrary if +.\"O buffering is enabled, or a multiple of the tape block size if +.\"O buffering is disabled. +.\"O Kernels before 2.1.121 allow writes with +.\"O arbitrary byte count if buffering is enabled. +.\"O In all other cases +.\"O (kernel before 2.1.121 with buffering disabled or newer kernel) the +.\"O write byte count must be a multiple of the tape block size. +¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç¤Ï¡¢¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ì¤Ð +Æɤ߹þ¤ß¥Ð¥¤¥È¿ô¤ÏǤ°Õ¤ÎÂ礭¤µ¤Ç¤è¤¤¡£¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤¬Ìµ¸ú¤Î¾ì¹ç¤Ï¡¢ +¥Æ¡¼¥×¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎÀ°¿ôÇܤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ 2.1.121 °ÊÁ°¤Î +¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤¬Í­¸ú¤Ê¾ì¹ç¤Ë¤Ï +Ǥ°Õ¤Î¥Ð¥¤¥È¿ô¤Î½ñ¤­¹þ¤ß¤¬¤Ç¤­¤ë¡£¤½¤Î¾¤Î¾ì¹ç¤¹¤Ù¤Æ +(2.1.121 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¥Ð¥Ã¥Õ¥¡¤¬Ìµ¸ú¤Ê¾ì¹ç¤È¡¢¿·¤·¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç) +¤Ç¤Ï¡¢½ñ¤­¹þ¤ß¥Ð¥¤¥È¿ô¤Ï¥Æ¡¼¥×¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎÀ°¿ôÇܤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O In the 2.6 kernel, the driver tries to use direct transfers between the user +.\"O buffer and the device. +.\"O If this is not possible, the driver's internal buffer +.\"O is used. +.\"O The reasons for not using direct transfers include improper alignment +.\"O of the user buffer (default is 512 bytes but this can be changed by the HBA +.\"O driver), one of more pages of the user buffer not reachable by the +.\"O SCSI adapter, etc. +2.6 ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Î¥É¥é¥¤¥Ð¤Ï¥æ¡¼¥¶¥Ð¥Ã¥Õ¥¡¤È¥Ç¥Ð¥¤¥¹´Ö¤Ç¡¢ +¥Ç¡¼¥¿¤ÎľÀÜžÁ÷ (direct transfer) ¤ò»î¤ß¤ë¡£ +¤³¤ì¤¬ÉÔ²Äǽ¤Ê¾ì¹ç¤Ï¡¢¥É¥é¥¤¥Ð¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡¤òÍѤ¤¤ë¡£ +ľÀÜžÁ÷¤¬¤Ç¤­¤Ê¤¤Íýͳ¤È¤·¤Æ¤Ï¡¢¥æ¡¼¥¶¥Ð¥Ã¥Õ¥¡¤Î¥¢¥é¥¤¥ó¥á¥ó¥È¤¬Å¬ÀڤǤʤ¤ +(¥Ç¥Õ¥©¥ë¥È¤Ï 512 ¥Ð¥¤¥È¤À¤¬ HBA ¥É¥é¥¤¥Ð¤Ë¤è¤Ã¤ÆÊѹ¹¤µ¤ì¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ë)¡¢ +¥æ¡¼¥¶¥Ð¥Ã¥Õ¥¡¤Î¥Ú¡¼¥¸¤Î¤É¤ì¤«¤¬ SCSI ¥¢¥À¥×¥¿¤«¤é¸«¤¨¤Ê¤¤¡¢ +¤Ê¤É¤¬¹Í¤¨¤é¤ì¤ë¡£ +.PP +.\"O A filemark is automatically written to tape if the last tape operation +.\"O before close was a write. +¥Æ¡¼¥×¤ò¥¯¥í¡¼¥º¤¹¤ëľÁ°¤Î¥Æ¡¼¥×ÁàºîÌ¿Î᤬½ñ¤­¹þ¤ß¤Ç¤¢¤ì¤Ð¡¢ +¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤¬¼«Æ°Åª¤Ë¥Æ¡¼¥×¤Ø½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.PP +.\"O When a filemark is encountered while reading, the following +.\"O happens. +.\"O If there are data remaining in the buffer when the filemark +.\"O is found, the buffered data is returned. +.\"O The next read returns zero +.\"O bytes. +.\"O The following read returns data from the next file. +.\"O The end of +.\"O recorded data is signaled by returning zero bytes for two consecutive +.\"O read calls. +.\"O The third read returns an error. +Æɤ߹þ¤ß»þ¤Ë¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤Ë½Ð²ñ¤¦¤È¡¢°Ê²¼¤¬¼Â¹Ô¤µ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤¬¸«ÉÕ¤«¤Ã¤¿¤È¤­¤Ë¥Ð¥Ã¥Õ¥¡¤Ë¥Ç¡¼¥¿¤¬»Ä¤Ã¤Æ¤¤¤ë¤È¡¢ +¥Ð¥Ã¥Õ¥¡¤Î¥Ç¡¼¥¿¤¬ÊÖ¤µ¤ì¤ë¡£¼¡¤ÎÆɤ߹þ¤ßÁàºî¤Ï 0 ¥Ð¥¤¥È¤òÊÖ¤¹¡£ +¤½¤Î¼¡¤ÎÆɤ߹þ¤ß¤Ï¼¡¤Î¥Õ¥¡¥¤¥ë¤«¤é¤Î¥Ç¡¼¥¿¤òÊÖ¤¹¡£ +µ­Ï¿¥Ç¡¼¥¿¤ÎËöÈø¤Ï¡¢Æɤ߹þ¤ßÁàºî¤¬Æó²ó³¤±¤Æ +0 ¥Ð¥¤¥È¤òÊÖ¤·¤ÆÍè¤ë¤«¤¿¤Á¤ÇÄÌÃΤµ¤ì¤ë¡£»°²óÌܤÎÆɤ߹þ¤ß¤Ï¥¨¥é¡¼¤òÊÖ¤¹¡£ +.\"O .SS Ioctls +.SS ioctl +.\"O The driver supports three +.\"O .BR ioctl (2) +.\"O requests. +.\"O Requests not recognized by the +.\"O .B st +.\"O driver are passed to the +.\"O .B SCSI +.\"O driver. +.\"O The definitions below are from +.\"O .IR /usr/include/linux/mtio.h : +¥É¥é¥¤¥Ð¤Ï 3 ¤Ä¤Î +.BR ioctl (2) +Í×µá¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.B st +¥É¥é¥¤¥Ð¤Ë¤è¤Ã¤Æǧ¼±¤µ¤ì¤Ê¤«¤Ã¤¿Í×µá¤Ï +.B SCSI +¥É¥é¥¤¥Ð¤Ë¤ï¤¿¤µ¤ì¤ë¡£ +°Ê²¼¤ÎÄêµÁ¤Ï +.I /usr/include/linux/mtio.h +¤Ë¤è¤ë¡£ +.\"O .SS "MTIOCTOP \(em Perform a tape operation" +.SS "MTIOCTOP \(em ¥Æ¡¼¥×Áàºî¤Î¼Â¹Ô" +.PP +.\"O This request takes an argument of type +.\"O .IR "(struct mtop *)" . +.\"O Not all drives support all operations. +.\"O The driver returns an +.\"O .B EIO +.\"O error if the drive rejects an operation. +¤³¤ÎÍ×µá¤Ï +.I "(struct mtop *)" +·¿¤Î°ú¿ô¤ò¤È¤ë¡£Á´¤Æ¤Î¥É¥é¥¤¥Ö¤¬Á´¤Æ¤ÎÁàºî¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¥É¥é¥¤¥Ö¤¬Áàºî¤òµñÈݤ¹¤ë¤È¡¢¥É¥é¥¤¥Ð¤Ï +.B EIO +¥¨¥é¡¼¤òÊÖ¤¹¡£ +.PP +.in +4n +.nf +/* Structure for MTIOCTOP \- mag tape op command: */ +struct mtop { + short mt_op; /* operations defined below */ + int mt_count; /* how many of them */ +}; +.fi +.in +.PP +.\"O Magnetic Tape operations for normal tape use: +Ä̾ï¤Î¥Æ¡¼¥×ÍøÍѤΤ¿¤á¤Î¼§µ¤¥Æ¡¼¥×Áàºî: +.TP 14 +.B MTBSF +.\"O Backward space over +.\"O .I mt_count +.\"O filemarks. +.I mt_count +¸Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯ (filemark) ʬ¤Î¸åÊý¥¹¥Ú¡¼¥¹ (backward space)¡£ +.TP +.B MTBSFM +.\"O Backward space over +.\"O .I mt_count +.\"O filemarks. +.\"O Reposition the tape to the EOT side of the last filemark. +.I mt_count +¸Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯Ê¬¤Î¸åÊý¥¹¥Ú¡¼¥¹¡£ +¥Æ¡¼¥×¤Î°ÌÃÖ¤òºÇ¸å¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤Î EOT ¦¤ËÊѹ¹¤¹¤ë¡£ +.TP +.B MTBSR +.\"O Backward space over +.\"O .I mt_count +.\"O records (tape blocks). +.I mt_count +¸Ä¤Î¥ì¥³¡¼¥É (¥Æ¡¼¥×¥Ö¥í¥Ã¥¯) ʬ¤Î¸åÊý¥¹¥Ú¡¼¥¹¡£ +.TP +.B MTBSS +.\"O Backward space over +.\"O .I mt_count +.\"O setmarks. +.I mt_count +¸Ä¤Î¥»¥Ã¥È¥Þ¡¼¥¯Ê¬¤Î¸åÊý¥¹¥Ú¡¼¥¹¡£ +.TP +.B MTCOMPRESSION +.\"O Enable compression of tape data within the drive if +.\"O .I mt_count +.\"O is nonzero and disable compression if +.\"O .I mt_count +.\"O is zero. +.\"O This command uses the MODE page 15 supported by most DATs. +.I mt_count +¤¬ 0 °Ê³°¤Ê¤é¡¢¥É¥é¥¤¥Ö¤Î¥Ç¡¼¥¿°µ½Ì¤òÍ­¸ú¤Ë¤¹¤ë¡£ +0 ¤Ê¤é°µ½Ì¤ò̵¸ú¤Ë¤¹¤ë¡£¤³¤Î¥³¥Þ¥ó¥É¤Ï MODE ¥Ú¡¼¥¸ 15 ¤òÍѤ¤¤ë¡£ +¤³¤ì¤Ï¤Û¤È¤ó¤É¤Î DAT ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B MTEOM +.\"O Go to the end of the recorded media (for appending files). +(¥Õ¥¡¥¤¥ë¤òÄɲ乤뤿¤á¤Ë) ¥á¥Ç¥£¥¢¤Îµ­Ï¿Éôʬ¤ÎºÇ¸å¤Þ¤Ç¿Ê¤á¤ë¡£ +.TP +.B MTERASE +.\"O Erase tape. +.\"O With 2.6 kernel, short erase (mark tape empty) is performed if the +.\"O argument is zero. +.\"O Otherwise long erase (erase all) is done. +¥Æ¡¼¥×¤ÎÆâÍƤò¾Ãµî¤¹¤ë¡£ +2.6 ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢°ú¿ô¤¬ 0 ¤Ê¤é¤Ð short erase (¥Æ¡¼¥×¤¬¶õ¤À¤È°õ¤ò¤Ä¤±¤ë) +¤ò¹Ô¤¦¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï long erase (Á´ÂΤò¾Ãµî¤¹¤ë) ¤ò¹Ô¤¦¡£ +.TP +.B MTFSF +.\"O Forward space over +.\"O .I mt_count +.\"O filemarks. +.I mt_count +¸Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯Ê¬¤ÎÁ°Êý¥¹¥Ú¡¼¥¹ (forward space)¡£ +.TP +.B MTFSFM +.\"O Forward space over +.\"O .I mt_count +.\"O filemarks. +.\"O Reposition the tape to the BOT side of the last filemark. +.I mt_count +¸Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯Ê¬¤ÎÁ°Êý¥¹¥Ú¡¼¥¹¡£ +¥Æ¡¼¥×¤Î°ÌÃ֤ϺǸå¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤Î BOT ¦Êѹ¹¤µ¤ì¤ë¡£ +.TP +.B MTFSR +.\"O Forward space over +.\"O .I mt_count +.\"O records (tape blocks). +.I mt_count +¸Ä¤Î¥ì¥³¡¼¥É (¥Æ¡¼¥×¥Ö¥í¥Ã¥¯) ʬ¤ÎÁ°Êý¥¹¥Ú¡¼¥¹¡£ +.TP +.B MTFSS +.\"O Forward space over +.\"O .I mt_count +.\"O setmarks. +.I mt_count +¸Ä¤Î¥»¥Ã¥È¥Þ¡¼¥¯Ê¬¤ÎÁ°Êý¥¹¥Ú¡¼¥¹¡£ +.TP +.B MTLOAD +.\"O Execute the SCSI load command. +.\"O A special case is available for some HP +.\"O autoloaders. +.\"O If +.\"O .I mt_count +.\"O is the constant +.\"O .B MT_ST_HPLOADER_OFFSET +.\"O plus a number, the number is +.\"O sent to the drive to control the autoloader. +SCSI ¥í¡¼¥É¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¡£ HP ¥ª¡¼¥È¥í¡¼¥À¤Ë¸Â¤Ã¤ÆÍøÍѤǤ­¤ë¡£ +.\"nakano: ¤¢¤Ã¤Æ¤ë¡© +.I mt_count +¤¬Äê¿ô +.B MT_ST_HPLOADER_OFFSET +¤È¤¢¤ë¿ôÃͤÎϤǤ¢¤ë¾ì¹ç¡¢ +¤½¤Î¿ôÃͤ¬¥É¥é¥¤¥Ö¤ËÁ÷¤é¤ì¡¢¥ª¡¼¥È¥í¡¼¥À¤ÎÀ©¸æ¤ËÍѤ¤¤é¤ì¤ë¡£ +.TP +.B MTLOCK +.\"O Lock the tape drive door. +¥Æ¡¼¥×¥É¥é¥¤¥Ö¤ÎÈâ¤ò¥í¥Ã¥¯¤¹¤ë¡£ +.TP +.B MTMKPART +.\"O Format the tape into one or two partitions. +.\"O If +.\"O .I mt_count +.\"O is nonzero, it gives the size of the first partition and the second +.\"O partition contains the rest of the tape. +.\"O If +.\"O .I mt_count +.\"O is zero, the tape is formatted into one partition. +.\"O This command is not allowed for a drive unless the partition support +.\"O is enabled for the drive (see +.\"O .BR MT_ST_CAN_PARTITIONS +.\"O below). +¥Æ¡¼¥×¤ò 1 ¤Þ¤¿¤Ï 2 ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ë¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ë¡£ +.I mt_count +¤¬ 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢¤³¤ì¤¬ºÇ½é¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¥µ¥¤¥º¤òÍ¿¤¨¡¢ +ÆóÈÖÌܤΥѡ¼¥Æ¥£¥·¥ç¥ó¤¬¥Æ¡¼¥×¤Î»Ä¤ê¤Ë¤Ê¤ë¡£ +.I mt_count +¤¬ 0 ¤Î¾ì¹ç¤Ï¡¢¥Æ¡¼¥×¤Ï°ì¤Ä¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤È¤·¤Æ¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤ë¡£ +¤³¤Î¥³¥Þ¥ó¥É¤Ï¡¢¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¥µ¥Ý¡¼¥È¤¬Í­¸ú¤Ë¤µ¤ì¤¿ +¥É¥é¥¤¥Ö¤Ç¤Ê¤±¤ì¤Ð»È¤¨¤Ê¤¤ (°Ê²¼¤Î +.B MT_ST_CAN_PARTITIONS +¤ò¸«¤è)¡£ +.TP +.B MTNOP +.\"O No op \(em flushes the driver's buffer as a side effect. +.\"O Should be used before reading status with +.\"O .BR MTIOCGET . +²¿¤âÁàºî¤ò¹Ô¤ï¤Ê¤¤¡£\- Éû¼¡Åª¤Ê¸ú²Ì¤È¤·¤Æ¡¢¥É¥é¥¤¥Ð¡¼¤Î¥Ð¥Ã¥Õ¥¡ +¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.B MTIOCGET +¤ò»È¤Ã¤Æ¾õÂÖ¤òÆɤ߽Ф¹Á°¤Ë¤Ï¤³¤ÎÁàºî¤ò¹Ô¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B MTOFFL +.\"O Rewind and put the drive off line. +´¬¤­Ìᤷ (rewind) ¤ò¹Ô¤¤¡¢¥É¥é¥¤¥Ö¤ò¥ª¥Õ¥é¥¤¥ó (off line) ¤Ë¤¹¤ë¡£ +.TP +.B MTRESET +.\"O Reset drive. +¥É¥é¥¤¥Ö¤ò¥ê¥»¥Ã¥È¤¹¤ë¡£ +.TP +.B MTRETEN +.\"O Re-tension tape. +¥Æ¡¼¥×¤ò¥ê¥Æ¥ó¥·¥ç¥ó (re-tension) ¤¹¤ë +(¥Æ¡¼¥×¤òºÇ¸å¤Þ¤Ç´¬¤¤¤¿¸å¡¢ºÇ½é¤Þ¤Ç´¬¤­Ì᤹)¡£ +.TP +.B MTREW +.\"O Rewind. +´¬¤­Ìᤷ¡£ +.TP +.B MTSEEK +.\"O Seek to the tape block number specified in +.\"O .IR mt_count . +.\"O This operation requires either a SCSI-2 drive that supports the +.\"O .B LOCATE +.\"O command (device-specific address) +.\"O or a Tandberg-compatible SCSI-1 drive (Tandberg, Archive +.\"O Viper, Wangtek, ...). +.\"O The block number should be one that was previously returned by +.\"O .BR MTIOCPOS +.\"O if device-specific addresses are used. +.I mt_count +¤Ç»ØÄꤵ¤ì¤¿¥Æ¡¼¥×¥Ö¥í¥Ã¥¯ÈÖ¹æ¤ò¥·¡¼¥¯¤¹¤ë¡£ +¤³¤ÎÁàºî¤¬¹Ô¤¨¤ë¤Î¤Ï¡¢ \s-1LOCATE\s+1 ¥³¥Þ¥ó¥É (¥Ç¥Ð¥¤¥¹¸ÇÍ­¤Î¥¢¥É¥ì¥¹) +¤ò¥µ¥Ý¡¼¥È¤¹¤ë SCSI-2 ¥É¥é¥¤¥Ö¤«¡¢¤¢¤ë¤¤¤Ï Tandberg +¸ß´¹¤Î SCSI-1 ¥É¥é¥¤¥Ö (Tandberg, Archive, Viper, Wangtek,¡Ä) ¤Ç¤¢¤ë¡£ +¥Ç¥Ð¥¤¥¹¸ÇÍ­¤Î¥¢¥É¥ì¥¹¤¬ÍøÍѤµ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥Ö¥í¥Ã¥¯ÈÖ¹æ¤Ï +°ÊÁ°¤Ë \s-1MTIOCPOS\s+1 ¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤¿¤â¤Î¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B MTSETBLK +.\"O Set the drive's block length to the value specified in +.\"O .IR mt_count . +.\"O A block length of zero sets the drive to variable block size mode. +.I mt_count +¤ÎÃͤò¥É¥é¥¤¥Ö¤Î¥Ö¥í¥Ã¥¯Ä¹ (block length) ¤È¤·¤Æ¥»¥Ã¥È¤¹¤ë¡£ +¥Ö¥í¥Ã¥¯Ä¹¤ò 0 ¤Ë¤¹¤ë¤È¥É¥é¥¤¥Ö¤Ï²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥µ¥¤¥º¥â¡¼¥É¤Ë¥»¥Ã +¥È¤µ¤ì¤ë¡£ +.TP +.B MTSETDENSITY +.\"O Set the tape density to the code in +.\"O .IR mt_count . +.\"O The density codes supported by a drive can be found from the drive +.\"O documentation. +¥Æ¡¼¥×Ì©ÅÙ (tape density) ¤ò +.I mt_count +¤Ç¼¨¤µ¤ì¤ë¥³¡¼¥É¤ËÊѹ¹¤¹¤ë¡£¥É¥é¥¤¥Ö¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÌ©ÅÙ¥³¡¼¥É +¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥É¥é¥¤¥Ö¤Îʸ½ñ¤Ë½ñ¤¤¤Æ¤¢¤ë¤À¤í¤¦¡£ +.TP +.B MTSETPART +.\"O The active partition is switched to +.\"O .IR mt_count . +.\"O The partitions are numbered from zero. +.\"O This command is not allowed for +.\"O a drive unless the partition support is enabled for the drive (see +.\"O .B MT_ST_CAN_PARTITIONS +.\"O below). +¥¢¥¯¥Æ¥£¥Ö¤Ê¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤òÂè +.I mt_count +ÈÖÌܤËÀÚ¤êÂؤ¨¤ë¡£¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ï 0 ¤«¤é¿ô¤¨¤ë¡£ +¤³¤Î¥³¥Þ¥ó¥É¤Ï¡¢¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¥µ¥Ý¡¼¥È¤¬Í­¸ú¤Ë¤µ¤ì¤¿ +¥É¥é¥¤¥Ö¤Ç¤Ê¤±¤ì¤Ð»È¤¨¤Ê¤¤ (°Ê²¼¤Î +.B MT_ST_CAN_PARTITIONS +¤ò¸«¤è)¡£ +.TP +.B MTUNLOAD +.\"O Execute the SCSI unload command (does not eject the tape). +SCSI unload ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë (¥Æ¡¼¥×¤Î¥¤¥¸¥§¥¯¥È¤Ï¹Ô¤ï¤Ê¤¤)¡£ +.TP +.B MTUNLOCK +.\"O Unlock the tape drive door. +¥Æ¡¼¥×¥É¥é¥¤¥Ö¤ÎÈâ¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë¡£ +.TP +.B MTWEOF +.\"O Write +.\"O .I mt_count +.\"O filemarks. +.I mt_count +¸Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤ò½ñ¤­¹þ¤à¡£ +.TP +.B MTWSM +.\"O Write +.\"O .I mt_count +.\"O setmarks. +.I mt_count +¸Ä¤Î¥»¥Ã¥È¥Þ¡¼¥¯¤ò½ñ¤­¹þ¤à¡£ +.PP +.\"O Magnetic Tape operations for setting of device options (by the superuser): +¥Ç¥Ð¥¤¥¹¥ª¥×¥·¥ç¥ó¤ÎÀßÄê¤Î¤¿¤á¤Î (¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Ë¤è¤ë) ¼§µ¤¥Æ¡¼¥×Áàºî: +.TP 8 +.B MTSETDRVBUFFER +.\"O Set various drive and driver options according to bits encoded in +.\"O .IR mt_count . +.\"O These consist of the drive's buffering mode, a set of Boolean driver +.\"O options, the buffer write threshold, defaults for the block size and +.\"O density, and timeouts (only in kernels 2.1 and later). +.\"O A single operation can affect only one item in the list above (the +.\"O Booleans counted as one item.) +¤¤¤í¤¤¤í¤Ê¥É¥é¥¤¥Ö¤È¥É¥é¥¤¥Ð¡¼¤Î¥ª¥×¥·¥ç¥ó¤ò +.I mt_count +¤Ë¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿³Æ¥Ó¥Ã¥È¤Ë½¾¤Ã¤ÆÀßÄꤹ¤ë¡£ +¥ª¥×¥·¥ç¥ó¤Ë¤Ï¡¢¥É¥é¥¤¥Ö¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¥â¡¼¥É¡¢ +¥Ö¡¼¥ëÃͤΥɥ饤¥Ð¥ª¥×¥·¥ç¥ó¤Î½¸¹ç¡¢ +¥Ð¥Ã¥Õ¥¡¤Î½ñ¤­¹þ¤ßïçÃÍ (¥Ç¥Õ¥©¥ë¥È¤Ï¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÈÌ©ÅÙ)¡¢ +¥¿¥¤¥à¥¢¥¦¥ÈÃͤ¬´Þ¤Þ¤ì¤ë (¥«¡¼¥Í¥ë 2.1 °Ê¹ß)¡£ +°ì²ó¤ÎÁàºî¤ÇÊѤ¨¤é¤ì¤ë¤Î¤Ï¡¢¾åµ­¤Î¥ê¥¹¥È¤Î¤É¤ì¤«°ì¤Ä¤À¤±¤Ç¤¢¤ë +(Ê£¿ô¤Î¥Ö¡¼¥ëÃͤϤޤȤá¤Æ°ì¤Ä¤È´ªÄꤵ¤ì¤ë)¡£ +.IP +.\"O A value having zeros in the high-order 4 bits will be used to set the +.\"O drive's buffering mode. +.\"O The buffering modes are: +¹â°Ì¤Î4¥Ó¥Ã¥È¤¬¥¼¥í¤Ç¤¢¤ëÃͤϡ¢ +¥É¥é¥¤¥Ö¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¥â¡¼¥É¤ÎÀßÄê¤Ë»È¤ï¤ì¤ë¡£ +¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¥â¡¼¥É¤Ï°Ê²¼¤ÎÄ̤ê: +.RS 12 +.IP 0 4 +.\"O The drive will not report +.\"O .BR GOOD +.\"O status on write commands until the data +.\"O blocks are actually written to the medium. +¥É¥é¥¤¥Ö¤Ï¥é¥¤¥È¥³¥Þ¥ó¥É¤ËÂФ·¡¢ +¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤¬¼ÂºÝ¤ËÇÞÂΤ˽ñ¤­¹þ¤Þ¤ì¤ë¤Þ¤Ç +.B GOOD +¤Î¥¹¥Æ¡¼¥¿¥¹¤òÊÖ¤µ¤Ê¤¤¡£ +.IP 1 +.\"O The drive may report +.\"O .BR GOOD +.\"O status on write commands as soon as all the +.\"O data has been transferred to the drive's internal buffer. +¥É¥é¥¤¥Ö¤Ï¥é¥¤¥È¥³¥Þ¥ó¥É¤ËÂФ·¡¢ +¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¤¬¥É¥é¥¤¥Ö¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡¤ËžÁ÷¤µ¤ì¤ë¤È¤¹¤°¤Ë¡¢ +.B GOOD +¤Î¥¹¥Æ¡¼¥¿¥¹¤òÊÖ¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.IP 2 +.\"O The drive may report +.\"O .B GOOD +.\"O status on write commands as soon as (a) all +.\"O the data has been transferred to the drive's internal buffer, and +.\"O (b) all buffered data from different initiators has been successfully +.\"O written to the medium. +¥é¥¤¥È¥³¥Þ¥ó¥É¤ËÂФ·¡¢°Ê²¼¤Î 2 ¤Ä¤Î¾ò·ï¤¬¤½¤í¤Ã¤¿¾ì¹ç¡¢ +¥É¥é¥¤¥Ö¤Ï¤¹¤°¤Ë +.B GOOD +¥¹¥Æ¡¼¥¿¥¹¤òÊÖ¤¹»ö¤¬¤Ç¤­¤ë¡£ +(a) ¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¤¬¥É¥é¥¤¥Ö¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡¤ËžÁ÷¤µ¤ì¤¿¡£ +(b) ÊÌ¡¹¤Î¥¤¥Ë¥·¥¨¡¼¥¿¡¼¤«¤éÍ褿¥Ð¥Ã¥Õ¥¡¥Ç¡¼¥¿¤¬¡¢ +¤¹¤Ù¤ÆÇÞÂΤØÌäÂê¤Ê¤¯½ñ¤­¹þ¤Þ¤ì¤¿¡£ +.RE +.IP +.\"O To control the write threshold the value in +.\"O .I mt_count +.\"O must include the constant +.\"O .BR MT_ST_WRITE_THRESHOLD +.\"O logically ORed with a block count in the low 28 bits. +.\"O The block count refers to 1024-byte blocks, not the physical block +.\"O size on the tape. +.\"O The threshold cannot exceed the driver's internal buffer size (see +.\"O DESCRIPTION, above). +½ñ¤­¹þ¤ßïçÃͤòÀ©¸æ¤¹¤ë¤Ë¤Ï¡¢ +.I mt_count +¤Ë¤Ï¡¢Äê¿ô +.B MT_ST_WRITE_THRESHOLD +¤È¥Ö¥í¥Ã¥¯¥«¥¦¥ó¥È¤ÎÏÀÍýÏ +(OR) ¤ò¤È¤Ã¤¿Ãͤò²¼°Ì¤Î 28¥Ó¥Ã¥È¤Ë´Þ¤Þ¤Í¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î¥Ö¥í¥Ã¥¯¥«¥¦¥ó¥È¤Ï 1024 ¥Ð¥¤¥È¥Ö¥í¥Ã¥¯¤òñ°Ì¤È¤·¤¿¤â¤Î¤Ç¡¢¥Æ¡¼¥×¤Î +ʪÍý¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤òñ°Ì¤È¤·¤¿¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +¤Þ¤¿¡¢ïçÃͤϥɥ饤¥Ð¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡ (¾åµ­¤ÎÀâÌÀ»²¾È) +¤Î¥µ¥¤¥º¤ò±Û¤¨¤ë»ö¤Ï¤Ç¤­¤Ê¤¤¡£ +.IP +.\"O To set and clear the Boolean options +.\"O the value in +.\"O .I mt_count +.\"O must include one of the constants +.\"O .BR MT_ST_BOOLEANS , +.\"O .BR MT_ST_SETBOOLEANS , +.\"O .BR MT_ST_CLEARBOOLEANS , +.\"O or +.\"O .BR MT_ST_DEFBOOLEANS +.\"O logically or'ed with +.\"O whatever combination of the following options is desired. +.\"O Using +.\"O .BR MT_ST_BOOLEANS +.\"O the options can be set to the values +.\"O defined in the corresponding bits. +.\"O With +.\"O .BR MT_ST_SETBOOLEANS +.\"O the options can be selectively set and with +.\"O .BR MT_ST_DEFBOOLEANS +.\"O selectively cleared. +¥Ö¡¼¥ëÃͤΥե饰¤òÀßÄꡦ²ò½ü¤¹¤ë¤Ë¤Ï¡¢ +.I mt_count +¤ÎÃÍ¤Ï +.BR MT_ST_BOOLEANS , +.BR MT_ST_SETBOOLEANS , +.BR MT_ST_CLEARBOOLEANS , +.BR MT_ST_DEFBOOLEANS +¤Î¤¤¤º¤ì¤«°ì¤Ä¤ÎÃͤˡ¢°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤ÎǤ°Õ¤ÎÁȤ߹ç¤ï¤»¤ËÂФ·¤Æ +ÏÀÍýϤò¼è¤Ã¤¿¤â¤Î¤ò»ØÄꤹ¤ë¡£ +.BR MT_ST_BOOLEANS ¤òÍѤ¤¤ë¤È¡¢ +¥ª¥×¥·¥ç¥ó¤òÂбþ¤¹¤ë¥Ó¥Ã¥È¤ËÂФ·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ëÃͤËÀßÄê¤Ç¤­¤ë¡£ +.BR MT_ST_SETBOOLEANS ¤òÍѤ¤¤ë¤È¡¢ +¥ª¥×¥·¥ç¥ó¤ÏÁªÂòŪ¤ËÀßÄꤵ¤ì¡¢ +.BR MT_ST_DEFBOOLEANS ¤òÍѤ¤¤ë¤È +ÁªÂòŪ¤Ë²ò½ü¤µ¤ì¤ë¡£ +.IP "" +.\"O The default options for a tape device are set with +.\"O .BR MT_ST_DEFBOOLEANS . +.\"O A nonactive tape device (e.g., device with +.\"O minor 32 or 160) is activated when the default options for it are +.\"O defined the first time. +.\"O An activated device inherits from the device +.\"O activated at start-up the options not set explicitly. +¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B MT_ST_DEFBOOLEANS +¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ +¥¢¥¯¥Æ¥£¥Ö¤Ç¤Ê¤¤¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹ (Îã: ¥Þ¥¤¥Ê¡¼ÈÖ¹æ ¤¬ 32 ¤ä 160 ¤Î¥Ç¥Ð¥¤¥¹) +¤Ï¡¢¤½¤ì¤é¤ËÂФ¹¤ë¥Ç¥Õ¥©¥ë¥È¤Î¥ª¥×¥·¥ç¥ó¤¬ºÇ½é¤ËÄêµÁ¤µ¤ì¤¿¤È¤­¤Ë +¥¢¥¯¥Æ¥£¥Ö¤Ë¤Ê¤ë¡£¥¢¥¯¥Æ¥£¥Ö¤Ë¤µ¤ì¤¿¥Ç¥Ð¥¤¥¹¤Ï¡¢ +µ¯Æ°»þ¤Ë¥¢¥¯¥Æ¥£¥Ö¤Ë¤µ¤ì¤¿¥Ç¥Ð¥¤¥¹¤«¤é¡¢ +ÌÀ¼¨Åª¤Ë»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¥ª¥×¥·¥ç¥ó¤ò·Ñ¾µ¤¹¤ë¡£ +.IP "" +.\"O The Boolean options are: +¥Ö¡¼¥ëÃͤΥª¥×¥·¥ç¥ó¤Ï°Ê²¼¤ÎÄ̤ê: +.RS +.TP +.\"O .BR MT_ST_BUFFER_WRITES " (Default: true)" +.BR MT_ST_BUFFER_WRITES " (¥Ç¥Õ¥©¥ë¥È: ¿¿)" +.\"O Buffer all write operations in fixed-block mode. +.\"O If this option is false and the drive uses a fixed block size, then +.\"O all write operations must be for a multiple of the block size. +.\"O This option must be set false to write reliable multivolume archives. +¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ë¤ª¤±¤ë¤¹¤Ù¤Æ¤Î½ñ¤­¹þ¤ßÁàºî¤ò¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬µ¶¤Ç¤¢¤ê¡¢¤«¤Ä¥É¥é¥¤¥Ö¤¬¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤Î»þ¤Ï¡¢ +¤¹¤Ù¤Æ¤Î½ñ¤­¹þ¤ßÁàºî¤Ï¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎÇÜ¿ô¤ÎÂ礭¤µ¤Ç¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¿®ÍêÀ­¤Î¤¢¤ë¥Þ¥ë¥Á¥Ü¥ê¥å¡¼¥à¥¢¡¼¥«¥¤¥Ö¤ò½ñ¤­¹þ¤à¤¿¤á¤Ë¤Ï¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ïµ¶¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .BR MT_ST_ASYNC_WRITES " (Default: true)" +.BR MT_ST_ASYNC_WRITES " (¥Ç¥Õ¥©¥ë¥È: ¿¿)" +.\"O When this option is true, write operations return immediately without +.\"O waiting for the data to be transferred to the drive if the data fits +.\"O into the driver's buffer. +.\"O The write threshold determines how full the buffer must be before a +.\"O new SCSI write command is issued. +.\"O Any errors reported by the drive will be held until the next +.\"O operation. +.\"O This option must be set false to write reliable multivolume archives. +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¿¿¤Î»þ¤Ë¤Ï¡¢¥Ç¡¼¥¿¤¬¥É¥é¥¤¥Ð¤Î¥Ð¥Ã¥Õ¥¡¤Ë¼ý¤Þ¤ë»þ¤Ë¤Ï +¥Ç¡¼¥¿¤¬¥É¥é¥¤¥Ö¤ËžÁ÷¤µ¤ì¤ë¤Î¤òÂÔ¤¿¤º¤Ë¡¢¤¹¤°¤Ë½ñ¤­¹þ¤ßÁàºî¤¬Ê֤äÆÍè¤ë¡£ +¥Ð¥Ã¥Õ¥¡¤¬¤É¤Î¤¯¤é¤¤¶õ¤¤¤¿¤é¼¡¤Î SCSI write ¥³¥Þ¥ó¥É¤òȯ¹Ô¤Ç¤­¤ë¤«¤Ï¡¢ +½ñ¤­¹þ¤ßïçÃͤˤè¤Ã¤Æ·è¤Þ¤ë¡£ +¥É¥é¥¤¥Ö¤¬ÊÖ¤¹¤¹¤Ù¤Æ¤Î¥¨¥é¡¼¤Ï¡¢¼¡¤ÎÁàºî¤Þ¤ÇÊݸ¤µ¤ì¤ë¡£ +¿®ÍêÀ­¤Î¤¢¤ë¥Þ¥ë¥Á¥Ü¥ê¥å¡¼¥à¥¢¡¼¥«¥¤¥Ö¤ò½ñ¤­¹þ¤à¤¿¤á¤Ë¤Ï¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ïµ¶¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.\"O .BR MT_ST_READ_AHEAD " (Default: true)" +.BR MT_ST_READ_AHEAD " (¥Ç¥Õ¥©¥ë¥È: ¿¿)" +.\"O This option causes the driver to provide read buffering and +.\"O read-ahead in fixed-block mode. +.\"O If this option is false and the drive uses a fixed block size, then +.\"O all read operations must be for a multiple of the block size. +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢ +¥É¥é¥¤¥Ð¤Ï¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤ÇÆɤ߹þ¤ß¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ÈÀèÆɤߤò¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬µ¶¤Ç¤¢¤ê¡¢¤«¤Ä¥É¥é¥¤¥Ö¤¬¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤Î»þ¤Ï¡¢ +¤¹¤Ù¤Æ¤ÎÆɤ߹þ¤ßÁàºî¤Ï¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎÇÜ¿ô¤ÎÂ礭¤µ¤Ç¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.\"O .BR MT_ST_TWO_FM " (Default: false)" +.BR MT_ST_TWO_FM " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +.\"O This option modifies the driver behavior when a file is closed. +.\"O The normal action is to write a single filemark. +.\"O If the option is true the driver will write two filemarks and +.\"O backspace over the second one. +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Õ¥¡¥¤¥ë¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿»þ¤Î¥É¥é¥¤¥Ð¡¼¤Î¿¶Éñ¤¤¤òÊѹ¹¤¹¤ë¡£ +°ì¤Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤ò½ñ¤­¹þ¤à¤Î¤¬Ä̾ï¤ÎÆ°ºî¤Ç¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¿¿¤Î»þ¤Ë¤Ï¡¢ +¥É¥é¥¤¥Ð¡¼¤Ï 2 ¤Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤ò½ñ¤­¹þ¤ó¤Ç¡¢ +2 ¤Ä¤á¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤Î¤È¤³¤í¤ËÌá¤ë¡£ +.IP +.\"O Note: +.\"O This option should not be set true for QIC tape drives since they are +.\"O unable to overwrite a filemark. +.\"O These drives detect the end of recorded data by testing for blank tape +.\"O rather than two consecutive filemarks. +.\"O Most other current drives also +.\"O detect the end of recorded data and using two filemarks is usually +.\"O necessary only when interchanging tapes with some other systems. +Ãí°Õ¡§ +QIC¥Æ¡¼¥×¥É¥é¥¤¥Ö¤Ï¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤Ë¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¤Î¤Ç¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¿¿¤Ë¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤é¤Î¥É¥é¥¤¥Ö¤Ïµ­Ï¿¥Ç¡¼¥¿¤ÎËöÈø¤Î¸¡ÃΤˡ¢ +¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤¬ 2¤Ä³¤±¤Æ¤¢¤ë¤«¤Ç¤Ï¤Ê¤¯¡¢ +¥Ö¥é¥ó¥¯¥Æ¡¼¥×¤«¤É¤¦¤«¤Î¥Æ¥¹¥È¤òÍѤ¤¤ë¡£ +¸½ºß¤Î¾¤Î¤Û¤È¤ó¤É¤Î¥É¥é¥¤¥Ö¤â¡¢µ­Ï¿¥Ç¡¼¥¿¤ÎËöÈø¤ò¸¡ÃΤ¹¤ë¡£ +2 ¤Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤¬É¬Íפˤʤë¤Î¤Ï¡¢ +¾¤Î¥·¥¹¥Æ¥à¤È¥Æ¡¼¥×¤ò¤ä¤ê¤È¤ê¤¹¤ë¾ì¹ç¤Ç¤¢¤ë¡£ +.TP +.\"O .BR MT_ST_DEBUGGING " (Default: false)" +.BR MT_ST_DEBUGGING " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +.\"O This option turns on various debugging messages from the driver +.\"O (effective only if the driver was compiled with +.\"O .B DEBUG +.\"O defined nonzero). +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¿¿¤Ë¤¹¤ë¤È¡¢ +¥É¥é¥¤¥Ð¤Ï¤¤¤í¤¤¤í¤Ê¥Ç¥Ð¥Ã¥°ÍÑ¥á¥Ã¥»¡¼¥¸¤ò½Ð¤¹¤è¤¦¤Ë¤Ê¤ë +.RB ( DEBUG +¤òÈó¥¼¥í¤ËÄêµÁ¤·¤Æ¥É¥é¥¤¥Ð¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤¤¤ë»þ¤Î¤ßÍ­¸ú)¡£ +.TP +.\"O .BR MT_ST_FAST_EOM " (Default: false)" +.BR MT_ST_FAST_EOM " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +.\"O This option causes the +.\"O .B MTEOM +.\"O operation to be sent directly to the +.\"O drive, potentially speeding up the operation but causing the driver to +.\"O lose track of the current file number normally returned by the +.\"O .B MTIOCGET +.\"O request. +.\"O If +.\"O .B MT_ST_FAST_EOM +.\"O is false the driver will respond to an +.\"O .B MTEOM +.\"O request by forward spacing over files. +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¿¿¤Ë¤¹¤ë¤È¡¢ +.B MTEOM +Áàºî¤¬Ä¾Àܥɥ饤¥Ö¤ËÁ÷¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +Áàºî¤¬Á᤯¤Ê¤ë¤Ï¤º¤À¤¬¡¢ +¥É¥é¥¤¥Ð¤¬¸½ºß¤Î¥Õ¥¡¥¤¥ëÈÖ¹æ¤ò¸«¼º¤¦¤³¤È¤Ë¤Ê¤ë +(¤³¤ì¤ÏÄ̾ï¤Ê¤é +.B MTIOCGET +¥ê¥¯¥¨¥¹¥È¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë)¡£ +.B MT_ST_FAST_EOM +¤¬µ¶¤Î»þ¤Ë¤Ï¡¢¥É¥é¥¤¥Ð¤Ï +.B MTEOM +¥ê¥¯¥¨¥¹¥È¤Ë±þ¤¨¤ë¤È¤­¡¢Á°Êý¤Ë¥Õ¥¡¥¤¥ë¤ò°ì¤Ä°ì¤Ä¿Ê¤á¤Æ¤¤¤¯¡£ +.TP +.\"O .BR MT_ST_AUTO_LOCK " (Default: false)" +.BR MT_ST_AUTO_LOCK " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +.\"O When this option is true, the drive door is locked when the device is +.\"O opened and unlocked when it is closed. +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¿¿¤Î»þ¤Ë¤Ï¡¢ +¥Ç¥Ð¥¤¥¹¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¤È¥É¥é¥¤¥Ö¤ÎÈ⤬¥í¥Ã¥¯¤µ¤ì¡¢ +¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¥¢¥ó¥í¥Ã¥¯¤µ¤ì¤ë¡£ +.TP +.\"O .BR MT_ST_DEF_WRITES " (Default: false)" +.BR MT_ST_DEF_WRITES " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +.\"O The tape options (block size, mode, compression, etc.) may change +.\"O when changing from one device linked to a drive to another device +.\"O linked to the same drive depending on how the devices are +.\"O defined. +.\"O This option defines when the changes are enforced by the +.\"O driver using SCSI-commands and when the drives auto-detection +.\"O capabilities are relied upon. +.\"O If this option is false, the driver +.\"O sends the SCSI-commands immediately when the device is changed. +.\"O If the +.\"O option is true, the SCSI-commands are not sent until a write is +.\"O requested. +.\"O In this case the drive firmware is allowed to detect the +.\"O tape structure when reading and the SCSI-commands are used only to +.\"O make sure that a tape is written according to the correct specification. +¥Æ¡¼¥×¥ª¥×¥·¥ç¥ó (¥Ö¥í¥Ã¥¯¥µ¥¤¥º¡¢¥â¡¼¥É¡¢°µ½Ì¤Ê¤É) +¤¬¤¢¤ë¥É¥é¥¤¥Ö¤Ë¥ê¥ó¥¯¤µ¤ì¤¿¥Ç¥Ð¥¤¥¹¤ÇÊѹ¹¤µ¤ì¤ë¤È¡¢ +¤½¤ÎƱ¤¸¥É¥é¥¤¥Ö¤Ë¥ê¥ó¥¯¤µ¤ì¤¿Â¾¤Î¥Ç¥Ð¥¤¥¹¤Ç¤âÊѹ¹¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë +(¤½¤Î¥Ç¥Ð¥¤¥¹¤ÎÄêµÁ¤Ë¤è¤ë)¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +¥É¥é¥¤¥Ð¤Ë¤è¤ëÊѹ¹¤ò¤¤¤Ä SCSI ¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤ÆÈ¿±Ç¤µ¤»¤ë¤«¤È¡¢ +¥É¥é¥¤¥Ö¤Î¼«Æ°¸¡Ãε¡Ç½¤¬¤¤¤Ä¿®Íꤷ¤ÆÎɤ¤¤Î¤«¤òÄêµÁ¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òµ¶¤Ë¤·¤Æ¤ª¤¯¤È¡¢ +¥Ç¥Ð¥¤¥¹¤ÎÊѹ¹¤¬¤¢¤ë¤È¥É¥é¥¤¥Ð¤Ï¤¹¤°¤Ë SCSI ¥³¥Þ¥ó¥É¤òÁ÷¤ë¡£ +¿¿¤Ë¤·¤Æ¤ª¤¯¤È¡¢ SCSI ¥³¥Þ¥ó¥É¤Ï½ñ¤­¹þ¤ß¤¬Í׵ᤵ¤ì¤ë¤Þ¤ÇÁ÷¤é¤ì¤Ê¤¤¡£ +¸å¼Ô¤Î¾ì¹ç¤Ï¡¢Æɤ߹þ¤ß¤ÎºÝ¤Ë¥É¥é¥¤¥Ö¤Î¥Õ¥¡¡¼¥à¥¦¥§¥¢¤Ë¤è¤Ã¤Æ +¥Æ¡¼¥×¹½Â¤¤Î¸¡ÃΤ¬¹Ô¤¨¤ë¡£¤Þ¤¿ SCSI ¥³¥Þ¥ó¥É¤Ï¡¢ +¥Æ¡¼¥×¤¬Àµ¤·¤¤»ØÄê¤Ë±è¤Ã¤Æ½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Î +³Îǧ¤Î¤¿¤á¤À¤±¤ËÍѤ¤¤é¤ì¤ë¡£ +.TP +.\"O .BR MT_ST_CAN_BSR " (Default: false)" +.BR MT_ST_CAN_BSR " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +.\"O When read-ahead is used, the tape must sometimes be spaced backward to the +.\"O correct position when the device is closed and the SCSI command to +.\"O space backwards over records is used for this purpose. +.\"O Some older +.\"O drives can't process this command reliably and this option can be used +.\"O to instruct the driver not to use the command. +.\"O The end result is that, +.\"O with read-ahead and fixed-block mode, the tape may not be correctly +.\"O positioned within a file when the device is closed. +.\"O With 2.6 kernel, the +.\"O default is true for drives supporting SCSI-3. +ÀèÆɤߤò»È¤¦¤È¡¢¥Æ¡¼¥×¤ò¥¯¥í¡¼¥º¤¹¤ë¤È¤­¤Ë¡¢ +¾ì¹ç¤Ë¤è¤Ã¤Æ¤Ï¥Æ¡¼¥×¤òÀµ¤·¤¤°ÌÃ֤˵ÕÌᤷ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤¬¤¢¤ë¡£ +¤³¤ì¤Ë¤Ï¡¢¥ì¥³¡¼¥É¤ò±Û¤¨¤ÆµÕÌᤷ¤¹¤ë SCSI ¥³¥Þ¥ó¥É¤¬ÍѤ¤¤é¤ì¤ë¡£ +¸Å¤¤¥É¥é¥¤¥Ö¤Ç¤Ï¡¢¤³¤Î¥³¥Þ¥ó¥É½èÍý¤Î¿®ÍêÀ­¤¬Ä㤤¤³¤È¤¬¤¢¤ë¤¬¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢ +¥É¥é¥¤¥Ð¤Ë¤³¤Î¥³¥Þ¥ó¥É¤ÎÍøÍѤò¶Ø»ß¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +ÀèÆɤߤȸÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤òÍѤ¤¤Æ¤¤¤ë¤È¡¢ºÇ½ªÅª¤Ê·ë²Ì¤È¤·¤Æ¡¢ +¥Ç¥Ð¥¤¥¹¤Î¥¯¥í¡¼¥º»þ¤Ë¥Æ¡¼¥×¤¬Àµ¤·¤¤°ÌÃ֤ˤʤé¤Ê¤¤¤³¤È¤¬¤¢¤ë¡£ +.\"nakano ¤½¤¦¤«¡© +2.6 ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢SCSI-3 ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¥É¥é¥¤¥Ö¤ËÂФ·¤Æ¡¢ +¤³¤ÎÃͤΥǥե©¥ë¥È¤Ï¿¿¤È¤Ê¤ë¡£ +.TP +.\"O .BR MT_ST_NO_BLKLIMS " (Default: false)" +.BR MT_ST_NO_BLKLIMS " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +.\"O Some drives don't accept the +.\"O .B "READ BLOCK LIMITS" +.\"O SCSI command. +.\"O If this is used, the driver does not use the command. +.\"O The drawback is +.\"O that the driver can't check before sending commands if the selected +.\"O block size is acceptable to the drive. +¥É¥é¥¤¥Ö¤Ë¤è¤Ã¤Æ¤Ï +.B READ BLOCK LIMITS SCSI +¥³¥Þ¥ó¥É¤ò¼õ¤±¤Ä¤±¤Ê¤¤¤³¤È¤¬¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È¡¢¥É¥é¥¤¥Ð¤Ï¤³¤Î¥³¥Þ¥ó¥É¤òÍѤ¤¤Ê¤¤¡£ +·çÅÀ¤Ï¡¢»ØÄꤷ¤¿¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤¬¥É¥é¥¤¥Ö¤Ë¼õÍý¤µ¤ì¤Æ¤·¤Þ¤¦¤È¡¢ +¥É¥é¥¤¥Ð¤Î¥³¥Þ¥ó¥ÉÁ÷¿®Á°¥Á¥§¥Ã¥¯¤¬¤Ç¤­¤Ê¤¯¤Ê¤ëÅÀ¤Ç¤¢¤ë¡£ +.TP +.\"O .BR MT_ST_CAN_PARTITIONS " (Default: false)" +.BR MT_ST_CAN_PARTITIONS " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +.\"O This option enables support for several partitions within a +.\"O tape. +.\"O The option applies to all devices linked to a drive. +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢°ì¤Ä¤Î¥Æ¡¼¥×¤ËÊ£¿ô¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤òÃÖ¤¯¤³¤È¤ò +¥µ¥Ý¡¼¥È¤¹¤ë¤«¤É¤¦¤«¤ò·è¤á¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥É¥é¥¤¥Ö¤Ë¥ê¥ó¥¯¤µ¤ì¤¿Á´¤Æ¤Î¥Ç¥Ð¥¤¥¹¤ËŬÍѤµ¤ì¤ë¡£ +.TP +.\"O .MT_ST_SCSI2LOGICAL " (Default: false)" +.TP MT_ST_SCSI2LOGICAL " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +.\"O This option instructs the driver to use the logical block addresses +.\"O defined in the SCSI-2 standard when performing the seek and tell +.\"O operations (both with +.\"O .B MTSEEK +.\"O and +.\"O .B MTIOCPOS +.\"O commands and when changing tape +.\"O partition). +.\"O Otherwise the device-specific addresses are used. +.\"O It is highly advisable to set this option if the drive supports the +.\"O logical addresses because they count also filemarks. +.\"O There are some +.\"O drives that only support the logical block addresses. +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +seek ¤ª¤è¤Ó tell Áàºî (ξ¼Ô¤È¤â +.BR MTSEEK ¡¦ MTIOCPOS +¥³¥Þ¥ó¥É¤òȼ¤¤¡¢¥Æ¡¼¥×°ÌÃÖ¤òÊѹ¹¤¹¤ë¤È¤­) ¤ÎºÝ¤Ë¡¢ +SCSI-2 ¤Îɸ½à¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÏÀÍý¥Ö¥í¥Ã¥¯¥¢¥É¥ì¥¹¤òÍѤ¤¤ë¤«¤É¤¦¤«¤ò +¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +.\"nakano both with ¤ÎÉôʬ²ø¤·¤¤¡£ +µ¶¤À¤È¥Ç¥Ð¥¤¥¹¸ÇÍ­¤Î¥¢¥É¥ì¥¹¤¬ÍѤ¤¤é¤ì¤ë¡£ +¥É¥é¥¤¥Ö¤¬ÏÀÍý¥¢¥É¥ì¥¹¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤È¤­¤Ï¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¥»¥Ã¥È¤¹¤ë¤³¤È¤ò¶¯¤¯´«¤á¤ë¡£ +¤³¤Î¥â¡¼¥É¤Ç¤Ï¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤â¥«¥¦¥ó¥È¤¹¤ë¤«¤é¤Ç¤¢¤ë¡£ +ÏÀÍý¥Ö¥í¥Ã¥¯¥¢¥É¥ì¥¹¤·¤«¥µ¥Ý¡¼¥È¤·¤Ê¤¤¥É¥é¥¤¥Ö¤â¤¤¤¯¤Ä¤«Â¸ºß¤·¤Æ¤¤¤ë¡£ +.TP +.\"O .BR MT_ST_SYSV " (Default: false)" +.BR MT_ST_SYSV " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +.\"O When this option is enabled, the tape devices use the SystemV +.\"O semantics. +.\"O Otherwise the BSD semantics are used. +.\"O The most important +.\"O difference between the semantics is what happens when a device used +.\"O for reading is closed: in System V semantics the tape is spaced forward +.\"O past the next filemark if this has not happened while using the +.\"O device. +.\"O In BSD semantics the tape position is not changed. +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¿¿¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤Ï +SystemV ¤Î¥ë¡¼¥ë¤òÍѤ¤¤ë¡£µ¶¤À¤È BSD ¤Î¥ë¡¼¥ë¤òÍѤ¤¤ë¡£ +.\"nakano: semantics ¢ª ¥ë¡¼¥ë ¤Ï¤Á¤È°ã¤¦¤«¡© +¤³¤ì¤é¤Î¥ë¡¼¥ë´Ö¤ÎºÇ¤âÂ礭¤Ê°ã¤¤¤Ï¡¢Æɤ߹þ¤ß¤ò¹Ô¤Ã¤Æ¤¤¤¿ +¥Ç¥Ð¥¤¥¹¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿¤È¤­¤Î¿¶Éñ¤¤¤Ç¤¢¤ë¡£ +System V ¤Î¥ë¡¼¥ë¤Ç¤Ï¡¢¥Æ¡¼¥×¤Ï¼¡¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤ò±Û¤¨¤Æ°ÜÆ°¤¹¤ë +(¥Ç¥Ð¥¤¥¹¤ÎÍøÍÑ»þ¤Ë¤³¤ì¤¬¹Ô¤ï¤ì¤Ê¤«¤Ã¤¿¾ì¹ç)¡£ +BSD ¤Î¥ë¡¼¥ë¤Ç¤Ï¥Æ¡¼¥×°ÌÃÖ¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.TP +.\"O .BR MT_NO_WAIT " (Default: false)" +.BR MT_NO_WAIT " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +.\"O Enables immediate mode (i.e., don't wait for the command to finish) for some +.\"O commands (e.g., rewind). +¨»þ¥â¡¼¥É (immediate mode; ¥³¥Þ¥ó¥É¤Î½ªÎ»¤òÂÔ¤¿¤Ê¤¤) +¤ò¡¢¤¢¤ë¼ï¤Î¥³¥Þ¥ó¥É (rewind ¤Ê¤É) ¤ËÂФ·¤ÆÍ­¸ú¤Ë¤¹¤ë¡£ +.PP +.\"O An example: +Îã: +.in +4n +.nf + +struct mtop mt_cmd; +mt_cmd.mt_op = MTSETDRVBUFFER; +mt_cmd.mt_count = MT_ST_BOOLEANS | + MT_ST_BUFFER_WRITES | MT_ST_ASYNC_WRITES; +ioctl(fd, MTIOCTOP, mt_cmd); +.fi +.in +.RE +.IP "" +.\"O The default block size for a device can be set with +.\"O .B MT_ST_DEF_BLKSIZE +.\"O and the default density code can be set with +.\"O .BR MT_ST_DEFDENSITY . +.\"O The values for the parameters are or'ed +.\"O with the operation code. +¥Ç¥Ð¥¤¥¹¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤Ï +.B MT_ST_DEF_BLKSIZE +¤Ë¤è¤Ã¤ÆÀßÄê¤Ç¤­¡¢¥Ç¥Õ¥©¥ë¥È¤ÎÌ©ÅÙ¥³¡¼¥É¤Ï +.B MT_ST_DEFDENSITY +¤Ë¤è¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤ÎÃͤÏÁàºî¥³¡¼¥É¤È OR ¤·¤ÆÍ¿¤¨¤ë¡£ +.IP "" +.\"O With kernels 2.1.x and later, the timeout values can be set with the +.\"O subcommand +.\"O .B MT_ST_SET_TIMEOUT +.\"O ORed with the timeout in seconds. +.\"O The long timeout (used for rewinds and other commands +.\"O that may take a long time) can be set with +.\"O .BR MT_ST_SET_LONG_TIMEOUT . +.\"O The kernel defaults are very long to +.\"O make sure that a successful command is not timed out with any +.\"O drive. +.\"O Because of this the driver may seem stuck even if it is only +.\"O waiting for the timeout. +.\"O These commands can be used to set more +.\"O practical values for a specific drive. +.\"O The timeouts set for one device +.\"O apply for all devices linked to the same drive. +2.1.x °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥ÈÃͤÎÀßÄê¤Ï¡¢ +¥µ¥Ö¥³¥Þ¥ó¥É +.B MT_ST_SET_TIMEOUT +¤ËÉÃñ°Ì¤Î¥¿¥¤¥à¥¢¥¦¥ÈÃͤò +OR ¤·¤ÆÍ¿¤¨¤ë¤³¤È¤Ë¤è¤Ã¤Æ¹Ô¤¨¤ë¡£ long ¥¿¥¤¥à¥¢¥¦¥È +(´¬¤­Ìᤷ¤Ê¤É¡¢Ä¹¤¤»þ´Ö¤¬¤«¤«¤ë¥³¥Þ¥ó¥É¤ËÂФ·¤ÆÍѤ¤¤é¤ì¤ë) ¤Ï +.B MT_ST_SET_LONG_TIMEOUT +¤ÇÀßÄê¤Ç¤­¤ë¡£ +¥«¡¼¥Í¥ë¤Î¥Ç¥Õ¥©¥ë¥È¤ÏÈó¾ï¤ËŤ¯¡¢¤É¤Î¥É¥é¥¤¥Ö¤Ç¤â +À®¸ù¤·¤Æ¤¤¤ë¥³¥Þ¥ó¥É¤¬·è¤·¤Æ¥¿¥¤¥à¥¢¥¦¥È¤·¤Ê¤¤¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥É¥é¥¤¥Ð¤Ï¥¿¥¤¥à¥¢¥¦¥È¤òÂԤäƤ¤¤ë¤À¤±¤Ê¤Î¤Ë¡¢ +»É¤µ¤Ã¤¿ (stuck ¤·¤¿) ¤è¤¦¤Ë¸«¤¨¤ë¤³¤È¤¬¤¢¤ë¡£¤³¤ì¤é¤Î¥³¥Þ¥ó¥É¤ò»È¤¨¤Ð¡¢ +ÆÃÄê¤Î¥É¥é¥¤¥Ö¤ËÂФ·¤Æ¤â¤¦¾¯¤·¼ÂºÝŪ¤ÊÃͤËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°ì¤Ä¤Î¥Ç¥Ð¥¤¥¹¤ËÀßÄꤷ¤¿¥¿¥¤¥à¥¢¥¦¥ÈÃͤϡ¢ +¤½¤ì¤ÈƱ¤¸¥É¥é¥¤¥Ö¤Ë¥ê¥ó¥¯¤·¤¿Á´¤Æ¤Î¥Ç¥Ð¥¤¥¹¤ËŬÍѤµ¤ì¤ë¡£ +.IP "" +.\"O Starting from kernels 2.4.19 and 2.5.43, the driver supports a status +.\"O bit which indicates whether the drive requests cleaning. +.\"O The method used by the +.\"O drive to return cleaning information is set using the +.\"O .B MT_ST_SEL_CLN +.\"O .B subcommand. +.\"O If the value is zero, the cleaning +.\"O bit is always zero. +.\"O If the value is one, the TapeAlert data defined +.\"O in the SCSI-3 standard is used (not yet implemented). +.\"O Values 2-17 are +.\"O reserved. +.\"O If the lowest eight bits are >= 18, bits from the extended +.\"O sense data are used. +.\"O The bits 9-16 specify a mask to select the bits +.\"O to look at and the bits 17-23 specify the bit pattern to look for. +.\"O If the bit pattern is zero, one or more bits under the mask indicate +.\"O the cleaning request. +.\"O If the pattern is nonzero, the pattern must match +.\"O the masked sense data byte. +2.4.19 ¤ª¤è¤Ó 2.5.43 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¤³¤Î¥É¥é¥¤¥Ð¤Ï¥É¥é¥¤¥Ö¤Î¥¯¥ê¡¼¥Ë¥ó¥°¤¬É¬Íפ«¤É¤¦¤«¤ò¼¨¤¹ +¾õÂ֥ӥåȤò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +¥É¥é¥¤¥Ö¤¬¥¯¥ê¡¼¥Ë¥ó¥°¾ðÊó¤òÊÖ¤µ¤»¤ë¤«¤É¤¦¤«¤Ï¡¢ +.B MT_ST_SEL_CLN +¥µ¥Ö¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡£ +¤³¤ÎÃͤ¬ 0 ¤À¤È¡¢¥¯¥ê¡¼¥Ë¥ó¥°¥Ó¥Ã¥È¤Ï¾ï¤Ë 0 ¤È¤Ê¤ë¡£ +Ãͤò 1 ¤Ë¤¹¤ë¤È¡¢SCSI-3 ɸ½à¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë +TapeAlert ¥Ç¡¼¥¿¤¬ÍѤ¤¤é¤ì¤ë (¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +ÃͤȤ·¤Æ¤Ï 2 ¤«¤é 17 ¤¬Í½Ì󤵤ì¤Æ¤¤¤ë¡£ +Äã°Ì¦¤Î 8 ¥Ó¥Ã¥È¤¬ 18 °Ê¾å¤À¤È¡¢³ÈÄ¥¾õÂ֥ǡ¼¥¿ (extended sense data) +¤¬ÍѤ¤¤é¤ì¤ë¡£Âè 9-16 ¥Ó¥Ã¥È¤ÏÃíÌܤ¹¤Ù¤­¥Ó¥Ã¥È¤òÁªÂò¤¹¤ë¤¿¤á¤Î¥Þ¥¹¥¯¤ò»ØÄꤷ¡¢ +Âè 17-23 ¥Ó¥Ã¥È¤Ïõ¤¹¤Ù¤­¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó¤¬ 0 ¤Î¤È¤­¤Ï¡¢ +¥Þ¥¹¥¯²¼¤Î¥Ó¥Ã¥È (·²) ¤¬¥¯¥ê¡¼¥Ë¥ó¥°Í×µá¤ò¼¨¤¹¡£¥Ñ¥¿¡¼¥ó¤¬ 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢ +¤³¤Î¥Ñ¥¿¡¼¥ó¤¬¥Þ¥¹¥¯¸å¤Î¾õÂ֥ǡ¼¥¿¥Ð¥¤¥È¤Ë¥Þ¥Ã¥Á¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SS "MTIOCGET \(em Get status" +.SS "MTIOCGET \(em ¥¹¥Æ¡¼¥¿¥¹¤Î¼èÆÀ" +.PP +.\"O This request takes an argument of type +.\"O .IR "(struct mtget *)" . +¤³¤Î¥ê¥¯¥¨¥¹¥È¤Ï +.IR "(struct mtget *)" +¤È¤¤¤¦·¿¤Î°ú¿ô¤ò¤È¤ë¡£ +.PP +.in +4n +.nf +/* structure for MTIOCGET \- mag tape get status command */ +struct mtget { + long mt_type; + long mt_resid; + /* the following registers are device dependent */ + long mt_dsreg; + long mt_gstat; + long mt_erreg; + /* The next two fields are not always used */ + daddr_t mt_fileno; + daddr_t mt_blkno; +}; +.fi +.in +.IP \fImt_type\fP 11 +.\"O The header file defines many values for +.\"O .IR mt_type , +.\"O but the current driver reports only the generic types +.\"O .B MT_ISSCSI1 +.\"O (Generic SCSI-1 tape) +.\"O and +.\"O .B MT_ISSCSI2 +.\"O (Generic SCSI-2 tape). +¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëÃæ¤Ë¤Ï¿¤¯¤Î +.I mt_type +¤ÎÃͤ¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¸½¹Ô¤Î¥É¥é¥¤¥Ð¤ÏÈÆÍѤΥ¿¥¤¥×¤Ç¤¢¤ë +.B MT_ISSCSI1 +(ÈÆÍÑ SCSI-1 ¥Æ¡¼¥×) ¤ª¤è¤Ó +.B MT_ISSCSI2 +(ÈÆÍÑ SCSI-2 ¥Æ¡¼¥×) ¤Î¤ß¤òÊÖ¤¹¡£ +.IP \fImt_resid\fP +.\"O contains the current tape partition number. +¸½ºß¤Î¥Æ¡¼¥×°ÌÃÖÈֹ档 +.IP \fImt_dsreg\fP +.\"O reports the drive's current settings for block size (in the low 24 +.\"O bits) and density (in the high 8 bits). +.\"O These fields are defined by +.\"O .BR MT_ST_BLKSIZE_SHIFT , +.\"O .BR MT_ST_BLKSIZE_MASK , +.\"O .BR MT_ST_DENSITY_SHIFT , +.\"O and +.\"O .BR MT_ST_DENSITY_MASK . +¥É¥é¥¤¥Ö¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÈÌ©Å٤θ½ºß¤ÎÀßÄê¤òÊó¹ð¤¹¤ë +(²¼°Ì 24 ¥Ó¥Ã¥È¤¬¥Ö¥í¥Ã¥¯¥µ¥¤¥º¡¢¾å°Ì 8 ¥Ó¥Ã¥È¤¬Ì©ÅÙ)¡£ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +.BR MT_ST_BLKSIZE_SHIFT , +.BR MT_ST_BLKSIZE_MASK , +.BR MT_ST_DENSITY_SHIFT , +.BR MT_ST_DENSITY_MASK +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.IP \fImt_gstat\fP +.\"O reports generic (device independent) status information. +.\"O The header file defines macros for testing these status bits: +ÈÆÍѤΠ(¥Ç¥Ð¥¤¥¹¤Ë°Í¸¤·¤Ê¤¤) ¥¹¥Æ¡¼¥¿¥¹¤òÊó¹ð¤¹¤ë¡£ +¤³¤ì¤é¤Î¥¹¥Æ¡¼¥¿¥¹¥Ó¥Ã¥È¤ò¥Æ¥¹¥È¤¹¤ë¤¿¤á¤Î¥Þ¥¯¥í¤¬ +¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.RS +.HP 4 +\fBGMT_EOF\fP(\fIx\fP): +.\"O The tape is positioned just after a filemark +.\"O (always false after an +.\"O .B MTSEEK +.\"O operation). +¥Æ¡¼¥×¤Ï¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤Îľ¸å¤Ë°ÌÃÖ¤·¤Æ¤¤¤ë¡£ +.RB ( MTSEEK +Áàºî¤Î¸å¤Ç¤Ï¾ï¤Ëµ¶) +.HP +\fBGMT_BOT\fP(\fIx\fP): +.\"O The tape is positioned at the beginning of the first file (always false +.\"O after an +.\"O .B MTSEEK +.\"O operation). +¥Æ¡¼¥×¤ÏºÇ½é¤Î¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë°ÌÃÖ¤·¤Æ¤¤¤ë¡£ +.RB ( MTSEEK +Áàºî¤Î¸å¤Ç¤Ï¾ï¤Ëµ¶) +.HP +\fBGMT_EOT\fP(\fIx\fP): +.\"O A tape operation has reached the physical End Of Tape. +¥Æ¡¼¥×Áàºî¤Ï¥Æ¡¼¥×¤ÎʪÍýŪ¤Ê½ªÅÀ¤Ë㤷¤¿¡£ +.HP +\s-1GMT_SM(\s+1\fIx\fP\s-1)\s+1: +.\"O The tape is currently positioned at a setmark +.\"O (always false after an +.\"O .B MTSEEK +.\"O operation). +¥Æ¡¼¥×¤Ï¸½ºß¥»¥Ã¥È¥Þ¡¼¥¯¤Ë°ÌÃÖ¤·¤Æ¤¤¤ë¡£ +.RB ( MTSEEK +Áàºî¤Î¸å¤Ç¤Ï¾ï¤Ëµ¶) +.HP +\fBGMT_EOD\fP(\fIx\fP): +.\"O The tape is positioned at the end of recorded data. +¥Æ¡¼¥×¤Ïµ­Ï¿¥Ç¡¼¥¿¤ÎËöÈø¤Ë°ÌÃÖ¤·¤Æ¤¤¤ë¡£ +.HP +\fBGMT_WR_PROT\fP(\fIx\fP): +.\"O The drive is write-protected. +.\"O For some drives this can also mean that the drive does not support +.\"O writing on the current medium type. +¥É¥é¥¤¥Ö¤Ï¥é¥¤¥È¥×¥í¥Æ¥¯¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¥É¥é¥¤¥Ö¤Ë¤è¤Ã¤Æ¤Ï¡¢ +¥É¥é¥¤¥Ö¤¬¸½ºß¤Î¥á¥Ç¥£¥¢¥¿¥¤¥×¤Ø¤Î½ñ¤­¹þ¤ß¤ò +¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤»ö¤ò°ÕÌ£¤¹¤ë¾ì¹ç¤â¤¢¤ë¡£ +.HP +\fBGMT_ONLINE\fP(\fIx\fP): +.\"O The last +.\"O .BR open (2) +.\"O found the drive with a tape in place and ready for operation. +¤â¤Ã¤È¤âºÇ¶á¤Î +.BR open (2) +¤¬¡¢¥Æ¡¼¥×¤¬Æþ¤Ã¤Æ¤¤¤ÆÁàºî¤Î½àÈ÷¤¬¤Ç¤­¤Æ¤¤¤ë¥É¥é¥¤¥Ö¤ò¸¡ÃΤ·¤¿¡£ +.HP +\fBGMT_D_6250\fP(\fIx\fP), \fBGMT_D_1600\fP(\fIx\fP), \fBGMT_D_800\fP(\fIx\fP): +.\"O This \(lqgeneric\(rq status information reports the current +.\"O density setting for 9-track \(12" tape drives only. +¤³¤Î¡ÖÈÆÍѡפΥ¹¥Æ¡¼¥¿¥¹¾ðÊó¤Ï¡¢ +9-¥È¥é¥Ã¥¯ \(12" ¥Æ¡¼¥×¥É¥é¥¤¥Ö¤Î¾ì¹ç¤Ë¤Î¤ß¡¢ +¸½ºß¤ÎÌ©ÅÙ¤ÎÀßÄê¤òÊó¹ð¤¹¤ë¡£ +.HP +\fBGMT_DR_OPEN\fP(\fIx\fP): +.\"O The drive does not have a tape in place. +¥É¥é¥¤¥Ö¤Ë¥Æ¡¼¥×¤¬Æþ¤Ã¤Æ¤¤¤Ê¤¤¡£ +.HP +\fBGMT_IM_REP_EN\fP(\fIx\fP): +.\"O Immediate report mode. +.\"O This bit is set if there are no guarantees that +.\"O the data has been physically written to the tape when the write call +.\"O returns. +.\"O It is set zero only when the driver does not buffer data and +.\"O the drive is set not to buffer data. +¨»þÊó¹ð¥â¡¼¥É¡£ write ¥³¡¼¥ë¤¬Ìá¤Ã¤¿¤È¤­¡¢ +¥Æ¡¼¥×¤ËÂФ·¤ÆʪÍýŪ¤Ê½ñ¤­¹þ¤ß¤¬¹Ô¤ï¤ì¤¿¤«¤É¤¦¤«¤òÊݾڤǤ­¤Ê¤¤¾ì¹ç¤Ë¡¢ +¤³¤Î¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£¥É¥é¥¤¥Ð¤¬¥Ç¡¼¥¿¤ò¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤»¤º¡¢ +¥É¥é¥¤¥Ö¤â¥Ç¡¼¥¿¤ò¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤·¤Ê¤¤¾ì¹ç¤Ë¸Â¤Ã¤Æ¡¢ +¤³¤ÎÃÍ¤Ï 0 ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.HP +\fBGMT_CLN\fP(\fIx\fP): +.\"O The drive has requested cleaning. +.\"O Implemented in kernels since 2.4.19 and 2.5.43. +¥É¥é¥¤¥Ö¤¬¥¯¥ê¡¼¥Ë¥ó¥°¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë 2.4.19 ¤ª¤è¤Ó 2.5.43 °Ê¹ß¤Ç¼ÂÁõ¤µ¤ì¤¿¡£ +.RE +.IP \fImt_erreg\fP +.\"O The only field defined in +.\"O .I mt_erreg +.\"O is the recovered error count in the low 16 bits (as defined by +.\"O .BR MT_ST_SOFTERR_SHIFT +.\"O and +.\"O .BR MT_ST_SOFTERR_MASK . +.\"O Due to inconsistencies in the way drives report recovered errors, this +.\"O count is often not maintained (most drives do not by default report +.\"O soft errors but this can be changed with a SCSI MODE SELECT command). +.I mt_erreg +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Õ¥£¡¼¥ë¥É¤Ï°ì¤Ä¤À¤±¤Ç¡¢ +²¼°Ì¤Î 16 ¥Ó¥Ã¥È¤¬¥¨¥é¡¼¤ò¥ê¥«¥Ð¡¼¤·¤¿²ó¿ô¤Ç¤¢¤ë +.RB ( MT_ST_SOFTERR_SHIFT +¤È +.B MT_ST_SOFTERR_MASK +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +¥É¥é¥¤¥Ö¤ÎÊó¹ð¤¹¤ë¥¨¥é¡¼¥ê¥«¥Ð¡¼¿ô¤ÈÌ·½â¤¹¤ë¤³¤È¤¬¤¢¤ë¤Î¤Ç¡¢ +¤³¤Î¿ô¤Ï¤Û¤È¤ó¤É¤Î¾ì¹ç°Ý»ý¤µ¤ì¤Ê¤¤ +(¤Û¤È¤ó¤É¤Î¥É¥é¥¤¥Ö¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥½¥Õ¥È¥¨¥é¡¼¤òÊó¹ð¤·¤Ê¤¤¡£ +¤·¤«¤·¤³¤ì¤Ï SCSI MODE SELECT ¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤ÆÊѹ¹¤Ç¤­¤ë)¡£ +.IP \fImt_fileno\fP +.\"O reports the current file number (zero-based). +.\"O This value is set to \-1 when the file number is unknown (e.g., after +.\"O .BR MTBSS +.\"O or +.\"O .BR MTSEEK ). +(¥¼¥í¤«¤é¿ô¤¨¤¿) ¸½ºß¤Î¥Õ¥¡¥¤¥ëÈÖ¹æ¤òÊó¹ð¤¹¤ë¡£ +¥Õ¥¡¥¤¥ëÈֹ椬¤ï¤«¤é¤Ê¤¤»þ (Î㤨¤Ð +.B MTBSS +¤ä +.B MTSEEK +¤Î¸å¤Ê¤É) ¤Ë¤Ï \-1 ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.IP \fImt_blkno\fP +.\"O reports the block number (zero-based) within the current file. +.\"O This value is set to \-1 when the block number is unknown (e.g., after +.\"O .BR MTBSF , +.\"O .BR MTBSS , +.\"O or +.\"O .BR MTSEEK ). +¸½ºß¤Î¥Õ¥¡¥¤¥ëÃæ¤Î(¥¼¥í¤«¤é¿ô¤¨¤¿)¥Ö¥í¥Ã¥¯ÈÖ¹æ¤òÊó¹ð¤¹¤ë¡£ +¥Ö¥í¥Ã¥¯Èֹ椬¤ï¤«¤é¤Ê¤¤»þ (Î㤨¤Ð +.BR MTBSF , +.BR MTBSS , +.BR MTSEEK +¤Î¸å¤Ê¤É) ¤Ë¤Ï \-1 ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PD +.\"O .SS "MTIOCPOS \(em Get tape position" +.SS "MTIOCPOS \(em ¥Æ¡¼¥×°ÌÃ֤μèÆÀ" +.PP +.\"O This request takes an argument of type +.\"O .I "(struct mtpos *)" +.\"O and reports the drive's notion of the current tape block number, +.\"O which is not the same as +.\"O .I mt_blkno +.\"O returned by +.\"O .BR MTIOCGET . +.\"O This drive must be a SCSI-2 drive that supports the +.\"O .B "READ POSITION" +.\"O command (device-specific address) +.\"O or a Tandberg-compatible SCSI-1 drive (Tandberg, Archive +.\"O Viper, Wangtek, ... ). +¤³¤Î¥ê¥¯¥¨¥¹¥È¤Ï +.I "(struct mtpos *)" +·¿¤Î°ú¿ô¤ò¤È¤ê¡¢¥É¥é¥¤¥Ö¤¬ÊÝ»ý¤·¤Æ¤¤¤ë¸½ºß¤Î¥Æ¡¼¥×¥Ö¥í¥Ã¥¯ÈÖ¹æ¤òÊó¹ð¤¹¤ë¡£ +¤³¤ì¤Ï¡¢ +.B MTIOCGET +¤Ë¤è¤êÊÖ¤µ¤ì¤ë +.I mt_blkno +¤ÈƱ¤¸¤Ç¤Ï¤Ê¤¤¡£ +¥É¥é¥¤¥Ö¤Ï +.B "READ POSITION" +¥³¥Þ¥ó¥É (¥Ç¥Ð¥¤¥¹¸ÇÍ­¥¢¥É¥ì¥¹) +¤ò¥µ¥Ý¡¼¥È¤¹¤ë SCSI-2¥É¥é¥¤¥Ö¤«¡¢ +Tandberg ¸ß´¹¤Î SCSI-1 ¥É¥é¥¤¥Ö +(Tandberg, Archive, Viper, Wangtek, ... ) ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.in +4n +.nf +/* structure for MTIOCPOS \- mag tape get position command */ +struct mtpos { + long mt_blkno; /* current block number */ +}; +.fi +.in +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.TP 14 +.TP +.B EACCES +.\"O An attempt was made to write or erase a write-protected tape. +.\"O (This error is not detected during +.\"O .BR open (2).) +½ñ¤­¹þ¤ßÊݸ¤ì¤Æ¤¤¤ë¥Æ¡¼¥×¤Ë½ñ¤­¹þ¤ß¤Þ¤¿¤Ï¾Ãµî¤ò¹Ô¤ª¤¦¤È¤·¤¿¡£ +(¤³¤Î¥¨¥é¡¼¤Ï +.BR open (2) +Ãæ¤Ë¤Ï¸¡ÃΤµ¤ì¤Ê¤¤¡£) +.TP +.B EBUSY +.\"O The device is already in use or the driver was unable to allocate a +.\"O buffer. +¥Ç¥Ð¥¤¥¹¤¬¤¹¤Ç¤Ë»È¤ï¤ì¤Æ¤¤¤ë¤«¡¢ +¥É¥é¥¤¥Ð¤¬¥Ð¥Ã¥Õ¥¡¤ò³äÅö¤Æ¤é¤ì¤Ê¤«¤Ã¤¿¡£ +.TP +.B EFAULT +.\"O The command parameters point to memory not belonging to the calling +.\"O process. +¥³¥Þ¥ó¥É¤Î°ú¿ô¤¬¡¢ +¸Æ¤Ó¤À¤·¥×¥í¥»¥¹¤Ë°¤·¤Æ¤¤¤Ê¤¤¥á¥â¥ê°ÌÃÖ¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\"O An +.\"O .BR ioctl (2) +.\"O had an invalid argument, or a requested block size was invalid. +.BR ioctl (2) +¤Î°ú¿ô¤¬ÉÔÀµ¤Ç¤¢¤ë¤«¡¢Í׵ᤷ¤¿¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤¬ÉÔÀµ¡£ +.TP +.B EIO 14 +.\"O The requested operation could not be completed. +Í׵ᤵ¤ì¤¿Áàºî¤¬ºÇ¸å¤Þ¤Ç¹Ô¤¨¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O The byte count in +.\"O .BR read (2) +.\"O is smaller than the next physical block on the tape. +.\"O (Before 2.2.18 and 2.4.0-test6 the extra bytes have been +.\"O silently ignored.) +.BR read (2) +¤Î¥Ð¥¤¥È¿ô¤¬¡¢¥Æ¡¼¥×¤Ë¤¢¤ë¼¡¤ÎʪÍý¥Ö¥í¥Ã¥¯¤è¤ê¾®¤µ¤¤ +(2.2.18 ¤ª¤è¤Ó 2.4.0-test6 °ÊÁ°¤Ç¤Ï¡¢ÌۤäÆ;ʬ¤Î¥Ð¥¤¥È¤ò̵»ë¤·¤Æ¤¤¤¿)¡£ +.TP +.B ENOSPC +.\"O A write operation could not be completed because the tape reached +.\"O end-of-medium. +¥á¥Ç¥£¥¢¤Î½ªÅÀ¤Ë㤷¤¿¤¿¤á¡¢½ñ¤­¹þ¤ßÁàºî¤¬´°Î»¤·¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOSYS +.\"O Unknown +.\"O .BR ioctl (2). +ÉÔÌÀ¤Ê +.BR ioctl (2)¡£ +.TP +.B ENXIO +.\"O During opening, the tape device does not exist. +¥ª¡¼¥×¥ó¤¹¤ë»þ¤Ë¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¡£ +.TP +.B EOVERFLOW +.\"O An attempt was made to read or write a variable-length block that is +.\"O larger than the driver's internal buffer. +¥É¥é¥¤¥Ð¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡¤è¤êÂ礭¤¤¥µ¥¤¥º¤Î²ÄÊÑĹ¥Ö¥í¥Ã¥¯¤ò +Æɤ߽ñ¤­¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B EROFS +.\"O Open is attempted with +.\"O .B O_WRONLY +.\"O or +.\"O .B O_RDWR +.\"O when the tape in the drive is write-protected. +¥É¥é¥¤¥Ö¤ËÆþ¤Ã¤Æ¤¤¤ë¥Æ¡¼¥×¤¬¥é¥¤¥È¥×¥í¥Æ¥¯¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +.B O_WRONLY +¤Þ¤¿¤Ï +.B O_RDWR +¤Ç open ¤ò¹Ô¤ª¤¦¤È¤·¤¿¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP 12 +.\"O .I /dev/st* +.\"O the auto-rewind SCSI tape devices +.I /dev/st* +¼«Æ°´¬¤­Ìᤷ¤Î SCSI ¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¡£ +.TP 12 +.\"O .I /dev/nst* +.\"O the nonrewind SCSI tape devices +.I /dev/nst* +´¬¤­Ìᤷ¤ò¤·¤Ê¤¤ SCSI ¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¡£ +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\"O .\" The driver has been written by Kai M\(:akisara (Kai.Makisara@metla.fi) +.\"O .\" starting from a driver written by Dwayne Forsyth. +.\"O .\" Several other +.\"O .\" people have also contributed to the driver. +.\" ¤³¤Î¥É¥é¥¤¥Ð¤Ï +.\" Dwayne Forsyth ¤Î½ñ¤¤¤¿¥É¥é¥¤¥Ð¤ò¤â¤È¤Ë¤·¤Æ +.\" Kai M\(:akisara (Kai.Makisara@metla.fi) ¤¬½ñ¤¤¤¿¡£ +.\" ¾¤Ë¤â²¿¿Í¤«¤Î¿Í¡¹¤¬¤³¤Î¥É¥é¥¤¥Ð¤Ë¹×¸¥¤·¤Æ¤­¤¿¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.IP 1. 4 +.\"O When exchanging data between systems, both systems have to agree on +.\"O the physical tape block size. +.\"O The parameters of a drive after startup +.\"O are often not the ones most operating systems use with these +.\"O devices. +.\"O Most systems use drives in variable-block mode if the drive +.\"O supports that mode. +.\"O This applies to most modern drives, including +.\"O DATs, 8mm helical scan drives, DLTs, etc. +.\"O It may be advisable to use +.\"O these drives in variable-block mode also in Linux (i.e., use +.\"O .B MTSETBLK +.\"O or +.\"O .B MTSETDEFBLK +.\"O at system startup to set the mode), at least when +.\"O exchanging data with a foreign system. +.\"O The drawback of +.\"O this is that a fairly large tape block size has to be used to get +.\"O acceptable data transfer rates on the SCSI bus. +°Û¤Ê¤ë¥·¥¹¥Æ¥à¤Ç¥Ç¡¼¥¿¤òÁê¸ß¤Ë¤ä¤ê¤È¤ê¤¹¤ë¾ì¹ç¡¢ +ξÊý¤Î¥·¥¹¥Æ¥à¤ÇʪÍýŪ¤Ê¥Æ¡¼¥×¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ò°ìÃפµ¤»¤ëɬÍפ¬¤¢¤ë¡£ +µ¯Æ°Ä¾¸å¤Î¥É¥é¥¤¥Ö¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢Âç¿¿ô¤Î OS ¤¬¤½¤Î¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ +ÍѤ¤¤Æ¤¤¤ëÃͤȰۤʤäƤ¤¤ë¤³¤È¤â¤è¤¯¤¢¤ë¡£Â¿¤¯¤Î¥·¥¹¥Æ¥à¤Ï¡¢ +¥É¥é¥¤¥Ö¤¬Âбþ¤·¤Æ¤¤¤ì¤Ð²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤òÍѤ¤¤ë¡£ DAT¡¢ +8mm ¥Ø¥ê¥«¥ë¥¹¥­¥ã¥ó¥É¥é¥¤¥Ö¡¢ DLT ¤Ê¤É¤ÎºÇ¶á¤Î¥É¥é¥¤¥Ö¤Î +¤Û¤È¤ó¤É¤Ï²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤ËÂбþ¤·¤Æ¤¤¤ë¤«¤é¡£ +¤³¤ì¤é¤Î¥É¥é¥¤¥Ö¤Ï (¾¯¤Ê¤¯¤È¤â¾¤Î¥·¥¹¥Æ¥à¤È¤Î¥Ç¡¼¥¿¸ò´¹¤¬ +¤¢¤ë¾ì¹ç¤Ï)¡¢ Linux ¤Ç¤â²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç»È¤¦¤Û¤¦¤¬ +Îɤ¤¤«¤â¤·¤ì¤Ê¤¤ (¤Ä¤Þ¤ê¥·¥¹¥Æ¥à¤Îµ¯Æ°»þ¤Î¥â¡¼¥ÉÀßÄê¤Ë +.B MTSETBLK +¤Þ¤¿¤Ï +.B MTSETDEFBLK +¤òÍѤ¤¤ë)¡£ +·çÅÀ¤È¤·¤Æ¤Ï¡¢Èæ³ÓŪÂ礭¤Ê¥Æ¡¼¥×¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤òÍѤ¤¤Ê¤±¤ì¤Ð¡¢ +SCSI ¥Ð¥¹¾å¤ÇËþ­¤Î¤¤¤¯Å¾Á÷®ÅÙ¤¬ÆÀ¤é¤ì¤Ê¤¤¤³¤È¤Ç¤¢¤ë¡£ +.IP 2. +.\"O Many programs (e.g., +.\"O .BR tar (1)) +.\"O allow the user to specify the blocking +.\"O factor on the command line. +.\"O Note that this determines the physical block +.\"O size on tape only in variable-block mode. +¿¤¯¤Î¥×¥í¥°¥é¥à +.RB ( tar (1) +¤Ê¤É) ¤Ç¤Ï¡¢ +¥³¥Þ¥ó¥É¥é¥¤¥ó¤«¤é¥æ¡¼¥¶¤¬¥Ö¥í¥Ã¥¯´ØÏ¢¤ÎÃͤò»ØÄê¤Ç¤­¤ë¡£ +¤³¤ÎÃͤˤè¤Ã¤Æ¥Æ¡¼¥×¾å¤ÎʪÍýŪ¤Ê¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ò·èÄê¤Ç¤­¤ë¤Î¤Ï¡¢ +²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ë¸Â¤é¤ì¤ë¤³¤È¤ËÃí°Õ¡£ +.IP 3. +.\"O In order to use SCSI tape drives, the basic SCSI driver, +.\"O a SCSI-adapter driver and the SCSI tape driver must be either +.\"O configured into the kernel or loaded as modules. +.\"O If the SCSI-tape +.\"O driver is not present, the drive is recognized but the tape support +.\"O described in this page is not available. +SCSI ¥Æ¡¼¥×¥É¥é¥¤¥Ö¤òÍѤ¤¤ë¤Ë¤Ï¡¢´ðËܤΠSCSI ¥É¥é¥¤¥Ð¡¢ +SCSI ¥¢¥À¥×¥¿¤Î¥É¥é¥¤¥Ð¡¢ SCSI ¥Æ¡¼¥×¥É¥é¥¤¥Ð¤Î¤¹¤Ù¤Æ¤¬ +¥«¡¼¥Í¥ë¤ËÁȤ߹þ¤Þ¤ì¤Æ¤¤¤ë¤«¡¢¤¢¤ë¤¤¤Ï¥â¥¸¥å¡¼¥ë¤È¤·¤Æ¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë +ɬÍפ¬¤¢¤ë¡£ SCSI ¥Æ¡¼¥×¥É¥é¥¤¥Ð¤¬¤Ê¤¤¤È¡¢ +¥É¥é¥¤¥Ö¤Ïǧ¼±¤µ¤ì¤ë¤¬¡¢ +¤³¤Î¥Ú¡¼¥¸¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥Æ¡¼¥×¤Î¥µ¥Ý¡¼¥È¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +.IP 4. +.\"O The driver writes error messages to the console/log. +.\"O The SENSE +.\"O codes written into some messages are automatically translated to text +.\"O if verbose SCSI messages are enabled in kernel configuration. +¥É¥é¥¤¥Ð¤Ï¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò¥³¥ó¥½¡¼¥ë¤È¥í¥°¤È¤Ë½ñ¤­½Ð¤¹¡£ +¥«¡¼¥Í¥ëÀßÄê¤Ç verbose SCSI messages ¤¬Í­¸ú¤Ë¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +SENSE ¥³¡¼¥É¤¬¼«Æ°Åª¤Ë¥Æ¥­¥¹¥È¤ËÊÑ´¹¤µ¤ì¤Æ¡¢ +¤¤¤¯¤Ä¤«¤Î¥á¥Ã¥»¡¼¥¸¤Ë½ñ¤­¤À¤µ¤ì¤ë¡£ +.IP 5. +.\"O The driver's internal buffering allows good throughput in fixed-block +.\"O mode also with small +.\"O .BR read (2) +.\"O and +.\"O .BR write (2) +.\"O byte counts. +.\"O With direct transfers +.\"O this is not possible and may cause a surprise when moving to the 2.6 +.\"O kernel. +.\"O The solution is to tell the software to use larger transfers (often +.\"O telling it to use larger blocks). +.\"O If this is not possible, direct transfers can be disabled. +¤³¤Î¥É¥é¥¤¥Ð¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤Ï¡¢¸ÇÄê¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ê¤é +.BR read (2) +¤ä +.BR write (2) +¤Î¥Ð¥¤¥È¿ô¤¬¾®¤µ¤¯¤Æ¤âÎɤ¤¥¹¥ë¡¼¥×¥Ã¥È¤ò½Ð¤¹¡£ +ľÀÜžÁ÷¤Ç¤Ï¤³¤ì¤ÏÉÔ²Äǽ¤Ê¤Î¤Ç¡¢2.6 ¥«¡¼¥Í¥ë¤Ë°Ü¹Ô¤·¤¿¤È¤­¤Ë¶Ã¤¯¤«¤â¤·¤ì¤Ê¤¤¡£ +²ò·èË¡¤È¤·¤Æ¤Ï¡¢¥½¥Õ¥È¥¦¥§¥¢¤Ë¤è¤êÂ礭¤ÊžÁ÷¤ò¹Ô¤¦¤è¤¦ÅÁ¤¨¤ë +(¤¿¤¤¤Æ¤¤¤Ï¤è¤êÂ礭¤Ê¥Ö¥í¥Ã¥¯¤ò»È¤ï¤»¤ë) ¤³¤È¤Ç¤¢¤ë¡£ +¤³¤ì¤¬ÉÔ²Äǽ¤Ê¤é¡¢Ä¾ÀÜžÁ÷¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.\"O .SH COPYRIGHT +.\" .SH Ãøºî¸¢ +.\" Copyright \(co 1995 Robert K. Nichols. +.\" .br +.\" Copyright \(co 1999-2005 Kai M\(:akisara. +.\" .PP +.\" 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. +.\" Additional permissions are contained in the header of the source file. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mt (1) +.PP +.\"O The file +.\"O .I drivers/scsi/README.st +.\"O or +.\"O .I Documentation/scsi/st.txt +.\"O (kernel >= 2.6) in the kernel sources contains +.\"O the most recent information about the driver and its configuration +.\"O possibilities. +¥«¡¼¥Í¥ë¥½¡¼¥¹¤Î +.I drivers/scsi/README.st +¤ä +.I Documentation/scsi/st.txt +(¥«¡¼¥Í¥ë 2.6 °Ê¹ß) ¤Î³Æ¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢ +¥É¥é¥¤¥Ð¤Ë´Ø¤¹¤ë¤è¤ê¿·¤·¤¤¾ðÊó¤ä¡¢ +¤½¤ÎÀßÄê²Äǽ¤ÊÈϰϤ˴ؤ¹¤ëÆâÍƤ¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ diff --git a/draft/man4/tty.4 b/draft/man4/tty.4 new file mode 100644 index 00000000..f11e7bdd --- /dev/null +++ b/draft/man4/tty.4 @@ -0,0 +1,121 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2003-04-07 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Tue Feb 6 16:57:03 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" Modified Thu Feb 5 17:28:31 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated Fri Aug 16 00:04:53 JST 2002 +.\" by Akihiro MOTOKI +.\" +.\" WORD: terminal üËö +.\" WORD: process ¥×¥í¥»¥¹ +.\" WORD: controlling terminal À©¸æüËö +.\" WORD: file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\" +.TH TTY 4 2003-04-07 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O tty \- controlling terminal +.SH ̾Á° +tty \- À©¸æüËö +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The file \fI/dev/tty\fP is a character file with major number 5 and +.\"O minor number 0, usually of mode 0666 and owner.group root.tty. +.\"O It is a synonym for the controlling terminal of a process, if any. +\fI/dev/tty\fP ¥Õ¥¡¥¤¥ë¤Ï¡¢¥á¥¸¥ã¡¼ÈÖ¹æ 5¡¢¥Þ¥¤¥Ê¡¼ÈÖ¹æ 0 ¤Î¥­¥ã¥é¥¯¥¿¡¼ +¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£Ä̾¤½¤Î¥â¡¼¥É¤Ï 0666¡¢¥ª¡¼¥Ê.¥°¥ë¡¼¥×¤Ï root.tty ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤¬Â¸ºß¤¹¤ë¾ì¹ç¡¢¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ï¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤È +Ʊ¤¸¤â¤Î¤òɽ¤¹¡£ +.LP +.\"O In addition to the +.\"O .BR ioctl (2) +.\"O requests supported by the device that +.\"O \fBtty\fP refers to, the +.\"O .BR ioctl (2) +.\"O request \fBTIOCNOTTY\fP is supported. +\fBtty\fP ¤¬»²¾È¤·¤Æ¤¤¤ë¥Ç¥Ð¥¤¥¹¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë +.BR ioctl (2) +Í×µá¤Ë +²Ã¤¨¤Æ¡¢ +.BR ioctl (2) +Í×µá \fBTIOCNOTTY\fP ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SS TIOCNOTTY +.\"O Detach the calling process from its controlling terminal. +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ò¤½¤ÎÀ©¸æüËö¤«¤éÀÚ¤êÎ¥¤¹¡£ +.sp +.\"O If the process is the session leader, +.\"O then +.\"O .B SIGHUP +.\"O and +.\"O .B SIGCONT +.\"O signals are sent to the foreground process group +.\"O and all processes in the current session lose their controlling tty. +¤½¤Î¥×¥í¥»¥¹¤¬¥»¥Ã¥·¥ç¥ó¡¦¥ê¡¼¥À¡¼ (session leader) ¤Î¾ì¹ç¡¢ +¥·¥°¥Ê¥ë +.B SIGHUP +¤È +.B SIGCONT +¤¬¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÁ÷¤é¤ì¡¢ +¥«¥ì¥ó¥È¡¦¥»¥Ã¥·¥ç¥ó¤Ë°¤¹Á´¤Æ¤Î¥×¥í¥»¥¹¤Ë¤Ä¤¤¤Æ³Æ¡¹¤ÎÀ©¸æüËö¤¬ÀÚ¤êÎ¥¤µ¤ì¤ë¡£ +.sp +.\"O This +.\"O .BR ioctl (2) +.\"O call only works on file descriptors connected +.\"O to \fI/dev/tty\fP. +.\"O It is used by daemon processes when they are invoked +.\"O by a user at a terminal. +.\"O The process attempts to open \fI/dev/tty\fP. +.\"O If the open succeeds, it +.\"O detaches itself from the terminal by using \fBTIOCNOTTY\fP, while if the +.\"O open fails, it is obviously not attached to a terminal and does not need +.\"O to detach itself. +¤³¤Î +.BR ioctl (2) +¸Æ¤Ó½Ð¤·¤Ï \fI/dev/tty\fP ¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¡¦ +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤Î¤ßºîÍѤ¹¤ë¡£¤³¤Îµ¡Ç½¤Ï¡¢¥æ¡¼¥¶¤Ë¤è¤Ã¤ÆüËö¤«¤é +µ¯Æ°¤µ¤ì¤¿¥Ç¡¼¥â¥ó¥×¥í¥»¥¹¤Ë¤è¤ê»ÈÍѤµ¤ì¤ë¡£ +¤½¤Î¥×¥í¥»¥¹¤Ï \fI/dev/tty\fP ¤ò¥ª¡¼¥×¥ó¤·¤è¤¦¤È»î¤ß¤ë¡£ +¥ª¡¼¥×¥ó¤ËÀ®¸ù¤¹¤ë¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Ï \fBTIOCNOTTY\fP ¤ò»È¤Ã¤Æ +¼«Ê¬¼«¿È¤òüËö¤«¤éÀÚ¤êÎ¥¤¹¡£¥ª¡¼¥×¥ó¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¤¬ +üËö¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤Ê¤¤¤Î¤ÏÌÀ¤é¤«¤Ç¤¢¤ê¡¢¼«¿È¤òüËö¤«¤éÀÚ¤êÎ¥¤¹ +ɬÍפϤʤ¤¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +/dev/tty +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR ioctl (2), +.BR termios (3), +.BR console (4), +.BR tty_ioctl (4), +.BR ttyS (4), +.BR agetty (8), +.BR mingetty (8) diff --git a/draft/man4/ttyS.4 b/draft/man4/ttyS.4 new file mode 100644 index 00000000..a8b61a8f --- /dev/null +++ b/draft/man4/ttyS.4 @@ -0,0 +1,65 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:03:24 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Tue Feb 6 17:52:03 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Thu Feb 5 17:27:58 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: serial ¥·¥ê¥¢¥ë +.TH TTYS 4 1992-12-19 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ttyS \- ¥·¥ê¥¢¥ë¥¿¡¼¥ß¥Ê¥ë¥é¥¤¥ó(serial terminal lines) +.SH ÀâÌÀ +\fBttyS[0\-3]\fP ¤Ï¥·¥ê¥¢¥ë¥¿¡¼¥ß¥Ê¥ë¥é¥¤¥ó¤Î¤¿¤á¤Î¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹ +(character device)¤Ç¤¢¤ë¡£ +.LP +ŵ·¿Åª¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤é¤ì¤ë¡£: +.RS +.sp +mknod \-m 660 /dev/ttyS0 c 4 64 # base address 0x3f8 +.br +mknod \-m 660 /dev/ttyS1 c 4 65 # base address 0x2f8 +.br +mknod \-m 660 /dev/ttyS2 c 4 66 # base address 0x3e8 +.br +mknod \-m 660 /dev/ttyS3 c 4 67 # base address 0x2e8 +.br +chown root:tty /dev/ttyS[0\-3] +.RE +.SH ¥Õ¥¡¥¤¥ë +/dev/ttyS[0\-3] +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR tty (4), +.BR agetty (8), +.BR mingetty (8), +.BR setserial (8) +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ diff --git a/draft/man4/tty_ioctl.4 b/draft/man4/tty_ioctl.4 new file mode 100644 index 00000000..41749a13 --- /dev/null +++ b/draft/man4/tty_ioctl.4 @@ -0,0 +1,816 @@ +.\" Copyright 2002 Walter Harms +.\" and Andries Brouwer . +.\" Distributed under GPL. +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Sat Oct 16 06:08:24 JST 2004 +.\" by Yuichi SATO +.\" +.TH TTY_IOCTL 4 2008-10-29 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O tty_ioctl \- ioctls for terminals and serial lines +tty_ioctl \- üËö¤È¥·¥ê¥¢¥ë¥é¥¤¥ó¤Î ioctl (Æþ½ÐÎÏÀ©¸æ) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B "#include " +.sp +.BI "int ioctl(int " fd ", int " cmd ", ...);" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR ioctl () +.\"O call for terminals and serial ports accepts many possible command arguments. +üËö¤È¥·¥ê¥¢¥ë¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¤Î +.BR ioctl () +¥³¡¼¥ë¤Ï¡¢Â¿¤¯¤Î¥³¥Þ¥ó¥É°ú¤­¿ô¤ò¼õ¤±ÉÕ¤±¤ë¡£ +.\"O Most require a third argument, of varying type, here called \fIargp\fP +.\"O or \fIarg\fP. +¿¤¯¤¬¤¤¤í¤¤¤í¤Ê·¿¤Î 3 ÈÖÌܤΰú¤­¿ô¤òɬÍפȤ¹¤ë¡£ +¤³¤³¤Ç¤Ï \fIargp\fP ¤Þ¤¿¤Ï \fIarg\fP ¤È¸Æ¤Ö¡£ +.LP +.\"O Use of +.\"O .I ioctl +.\"O makes for nonportable programs. +.\"O Use the POSIX interface described in +.\"O .BR termios (3) +.\"O whenever possible. +.I ioctl +¤ò»ÈÍѤ¹¤ë¤È°Ü¿¢À­¤Î¤Ê¤¤¥×¥í¥°¥é¥à¤Ë¤Ê¤ë¡£ +²Äǽ¤Ê¾ì¹ç¤Ï¡¢ +.BR termios (3) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë POSIX ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò»È¤¦¤³¤È¡£ +.\"O .SS "Get and Set Terminal Attributes" +.SS üËö°À­¤Î¼èÆÀ¤ÈÀßÄê +.TP +.BI "TCGETS struct termios *" argp +.\"O Equivalent to +.\"O .IR "tcgetattr(fd, argp)" . +.I "tcgetattr(fd, argp)" +¤ÈƱ¤¸¡£ +.br +.\"O Get the current serial port settings. +¸½ºß¤Î¥·¥ê¥¢¥ë¥Ý¡¼¥È¤ÎÀßÄê¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TCSETS const struct termios *" argp +.\"O Equivalent to +.\"O .IR "tcsetattr(fd, TCSANOW, argp)" . +.I "tcsetattr(fd, TCSANOW, argp)" +¤ÈƱ¤¸¡£ +.br +.\"O Set the current serial port settings. +¸½ºß¤Î¥·¥ê¥¢¥ë¥Ý¡¼¥È¤ÎÀßÄê¤òÊѹ¹¤¹¤ë¡£ +.TP +.BI "TCSETSW const struct termios *" argp +.\"O Equivalent to +.\"O .IR "tcsetattr(fd, TCSADRAIN, argp)" . +.I "tcsetattr(fd, TCSADRAIN, argp)" +¤ÈƱ¤¸¡£ +.br +.\"O Allow the output buffer to drain, and +.\"O set the current serial port settings. +ÇӽР(drain) ¤ò¹Ô¤¦¤¿¤á¤Î½ÐÎϥХåե¡¤Î»ÈÍѤòµö²Ä¤·¡¢ +¸½ºß¤Î¥·¥ê¥¢¥ë¥Ý¡¼¥È¤ÎÀßÄê¤òÊѹ¹¤¹¤ë¡£ +.TP +.BI "TCSETSF const struct termios *" argp +.\"O Equivalent to +.\"O .IR "tcsetattr(fd, TCSAFLUSH, argp)" . +.I "tcsetattr(fd, TCSAFLUSH, argp)" +¤ÈƱ¤¸¡£ +.br +.\"O Allow the output buffer to drain, discard pending input, and +.\"O set the current serial port settings. +ÇӽР(drain) ¤ò¹Ô¤¦¤¿¤á¤Î½ÐÎϥХåե¡¤Î»ÈÍѤòµö²Ä¤·¡¢ +½èÍý¤·¤Æ¤¤¤Ê¤¤ÆþÎϤòÇË´þ¤·¤Æ¡¢ +¸½ºß¤Î¥·¥ê¥¢¥ë¥Ý¡¼¥È¤ÎÀßÄê¤òÊѹ¹¤¹¤ë¡£ +.LP +.\"O The following four ioctls are just like +.\"O .BR TCGETS , +.\"O .BR TCSETS , +.\"O .BR TCSETSW , +.\"O .BR TCSETSF , +.\"O except that they take a +.\"O .I "struct termio *" +.\"O instead of a +.\"O .IR "struct termios *" . +°Ê²¼¤Î 4 ¤Ä¤Î ioctl ¤Ï +.BR TCGETS , +.BR TCSETS , +.BR TCSETSW , +.B TCSETSF +¤È»÷¤Æ¤¤¤ë¡£ +¤¿¤À¤·¡¢ +.I "struct termios *" +¤ÎÂå¤ï¤ê¤Ë +.I "struct termio *" +¤ò¼è¤ë¡£ +.TP +.BI "TCGETA struct termio *" argp +.TP +.BI "TCSETA const struct termio *" argp +.TP +.BI "TCSETAW const struct termio *" argp +.TP +.BI "TCSETAF const struct termio *" argp +.\"O .SS "Locking the termios structure" +.SS "termios ¹½Â¤ÂΤΥí¥Ã¥¯" +.\"O The +.\"O .I termios +.\"O structure of a terminal can be locked. +.\"O The lock is itself a +.\"O .I termios +.\"O structure, with nonzero bits or fields indicating a +.\"O locked value. +üËö¤Î +.I termios +¹½Â¤ÂΤϥí¥Ã¥¯¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¡£ +¤³¤Î¥í¥Ã¥¯¼«ÂÎ¤Ï +.I termios +¹½Â¤ÂΤǤ¢¤ê¡¢ +0 ¤Ç¤Ê¤¤¥Ó¥Ã¥È¤Þ¤¿¤Ï¥Õ¥£¡¼¥ë¥É¤Ï¥í¥Ã¥¯¤µ¤ì¤¿Ãͤò¼¨¤¹¡£ +.TP +.BI "TIOCGLCKTRMIOS struct termios *" argp +.\"O Gets the locking status of the +.\"O .I termios +.\"O structure of the terminal. +üËö¤Î +.I termios +¹½Â¤ÂΤΥí¥Ã¥¯¾õÂÖ¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCSLCKTRMIOS const struct termios *" argp +.\"O Sets the locking status of the +.\"O .I termios +.\"O structure of the terminal. +.\"O Only root (more precisely: a process with the +.\"O .BR CAP_SYS_ADMIN +.\"O capability) can do this. +üËö¤Î +.I termios +¹½Â¤ÂΤΥí¥Ã¥¯¾õÂÖ¤òÀßÄꤹ¤ë¡£ +root ¤Î¤ß (¤è¤êÀµ³Î¤Ë¤Ï¡¢ +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤¬¤³¤ì¤ò¼Â¹Ô¤Ç¤­¤ë¡£ +.\"O .SS "Get and Set Window Size" +.SS ¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤Î¼èÆÀ¤ÈÀßÄê +.\"O Window sizes are kept in the kernel, but not used by the kernel +.\"O (except in the case of virtual consoles, where the kernel will +.\"O update the window size when the size of the virtual console changes, +.\"O for example, by loading a new font). +¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤Ï¥«¡¼¥Í¥ëÆâ¤ËÊÝ»ý¤µ¤ì¤ë¤¬¡¢ +¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤Ê¤¤ +(²¾ÁÛ¥³¥ó¥½¡¼¥ë¤Î¾ì¹ç¤ÏÎã³°¤Ç¤¢¤ê¡¢¿·¤·¤¤¥Õ¥©¥ó¥È¤òÆɤ߹þ¤ó¤À¾ì¹ç¤Ê¤É¡¢ +²¾ÁÛüËö¤Î¥µ¥¤¥º¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¡¢¥«¡¼¥Í¥ë¤Ï¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤ò¹¹¿·¤¹¤ë)¡£ + +.\"O The following constants and structure are defined in +.\"O .IR . +°Ê²¼¤ÎÄê¿ô¤È¹½Â¤ÂÎ¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.BI "TIOCGWINSZ struct winsize *" argp +.\"O Get window size. +¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCSWINSZ const struct winsize *" argp +.\"O Set window size. +¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤òÀßÄꤹ¤ë¡£ +.LP +.\"O The struct used by these ioctls is defined as +¤³¤ì¤é¤Î ioctl ¤Ç»ÈÍѤµ¤ì¤ë¹½Â¤ÂΤϡ¢°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ + +.in +4n +.nf +struct winsize { + unsigned short ws_row; + unsigned short ws_col; +.\"O unsigned short ws_xpixel; /* unused */ +.\"O unsigned short ws_ypixel; /* unused */ + unsigned short ws_xpixel; /* ̤»ÈÍÑ */ + unsigned short ws_ypixel; /* ̤»ÈÍÑ */ +}; +.fi +.in + +.\"O When the window size changes, a +.\"O .B SIGWINCH +.\"O signal is sent to the +.\"O foreground process group. +¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¡¢ +¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë +.B SIGWINCH +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +.\"O .SS "Sending a Break" +.SS "break ¤ÎÁ÷¿®" +.TP +.BI "TCSBRK int " arg +.\"O Equivalent to +.\"O .IR "tcsendbreak(fd, arg)" . +.I "tcsendbreak(fd, arg)" +¤ÈƱ¤¸¡£ +.br +.\"O If the terminal is using asynchronous serial data transmission, and +.\"O .I arg +.\"O is zero, then send a break (a stream of zero bits) for between +.\"O 0.25 and 0.5 seconds. +.\"O If the terminal is not using asynchronous +.\"O serial data transmission, then either a break is sent, or the function +.\"O returns without doing anything. +üËö¤¬ÈóƱ´ü¥·¥ê¥¢¥ë¥Ç¡¼¥¿Å¾Á÷¤ò»ÈÍѤ·¤Æ¤ª¤ê¡¢ +.I arg +¤¬ 0 ¤Î¾ì¹ç¡¢0.25 ¤«¤é 0.5 ÉÃ¤Î´Ö¤Ë +break (0 ¤Î¥Ó¥Ã¥ÈÎó¤Î¥¹¥È¥ê¡¼¥à) ¤¬Á÷¿®¤µ¤ì¤ë¡£ +üËö¤¬ÈóƱ´ü¥·¥ê¥¢¥ë¥Ç¡¼¥¿Å¾Á÷¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢ +break ¤¬Á÷¿®¤µ¤ì¤ë¤«¡¢¤³¤Î´Ø¿ô¤Ï²¿¤â¤»¤º¤ËÊ֤롣 +.\"O When +.\"O .I arg +.\"O is nonzero, nobody knows what will happen. +.I arg +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢²¿¤¬µ¯¤³¤ë¤«Ê¬¤«¤é¤Ê¤¤¡£ + +.\"O (SVr4, UnixWare, Solaris, Linux treat +.\"O .I "tcsendbreak(fd,arg)" +.\"O with nonzero +.\"O .I arg +.\"O like +.\"O .IR "tcdrain(fd)" . +(SVr4, UnixWare, Solaris, Linux ¤Ï¡¢ +.I "tcsendbreak(fd,arg)" +¤Î +.I arg +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢ +.I "tcdrain(fd)" +¤Î¤è¤¦¤Ë°·¤¦¡£ +.\"O SunOS treats +.\"O .I arg +.\"O as a multiplier, and sends a stream of bits +.\"O .I arg +.\"O times as long as done for zero +.\"O .IR arg . +SunOS ¤Ï +.I arg +¤òÇÜ¿ô¤È¤·¤Æ°·¤¤¡¢¥Ó¥Ã¥È¤Î¥¹¥È¥ê¡¼¥à¤ò +.I arg +²óÁ÷¿®¤¹¤ë¡£ +.I arg +¤¬ 0 ¤Î¾ì¹ç¤âƱ¤¸¡£ +.\"O DG/UX and AIX treat +.\"O .I arg +.\"O (when nonzero) as a time interval measured in milliseconds. +DG/UX ¤È AIX ¤Ï¡¢(0 °Ê³°¤Î¾ì¹ç) +.I arg +¤ò¥ß¥êÉÃñ°Ì¤Î»þ´Ö´Ö³Ö¤È¤·¤Æ°·¤¦¡£ +.\"O HP-UX ignores +.\"O .IR arg .) +HP-UX ¤Ï +.I arg +¤ò̵»ë¤¹¤ë¡£) +.TP +.BI "TCSBRKP int " arg +.\"O So-called "POSIX version" of +.\"O .BR TCSBRK . +.\"O It treats nonzero +.\"O .I arg +.\"O as a timeinterval measured in deciseconds, and does nothing +.\"O when the driver does not support breaks. +¤¤¤ï¤æ¤ë¡ÖPOSIX ÈǡפΠ+.B TCSBRK +¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï 0 °Ê³°¤Î +.I arg +¤ò 1/10 ÉÃñ°Ì¤Î»þ´Ö´Ö³Ö¤È¤·¤Æ°·¤¦¡£ +¤Þ¤¿¥É¥é¥¤¥Ð¤¬ break ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢²¿¤â¤·¤Ê¤¤¡£ +.TP +.B "TIOCSBRK void" +.\"O Turn break on, that is, start sending zero bits. +break ¤ò¥ª¥ó¤Ë¤¹¤ë¡£ +¤Ä¤Þ¤ê 0 ¤Î¥Ó¥Ã¥ÈÎó¤ÎÁ÷¿®¤ò³«»Ï¤¹¤ë¡£ +.TP +.B "TIOCCBRK void" +.\"O Turn break off, that is, stop sending zero bits. +break ¤ò¥ª¥Õ¤Ë¤¹¤ë¡£ +¤Ä¤Þ¤ê 0 ¤Î¥Ó¥Ã¥ÈÎó¤ÎÁ÷¿®¤òÄä»ß¤¹¤ë¡£ +.\"O .SS "Software flow control" +.SS ¥½¥Õ¥È¥¦¥§¥¢¥Õ¥í¡¼À©¸æ +.TP +.BI "TCXONC int " arg +.\"O Equivalent to +.\"O .IR "tcflow(fd, arg)" . +.I "tcflow(fd, arg)" +¤ÈƱ¤¸¡£ +.br +.\"O See +.\"O .BR tcflow (3) +.\"O for the argument values +.\"O .BR TCOOFF , +.\"O .BR TCOON , +.\"O .BR TCIOFF , +.\"O .BR TCION . +.BR tcflow (3) +¤Î°ú¤­¿ô +.BR TCOOFF , +.BR TCOON , +.BR TCIOFF , +.B TCION +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SS "Buffer count and flushing" +.SS "¥Ð¥Ã¥Õ¥¡¤Î¥«¥¦¥ó¥È¤È½ñ¤­½Ð¤· (flush)" +.TP +.BI "FIONREAD int *" argp +.\"O Get the number of bytes in the input buffer. +ÆþÎϥХåե¡¤Ë¤¢¤ë¥Ð¥¤¥È¿ô¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCINQ int *" argp +.\"O Same as +.\"O .BR FIONREAD . +.B FIONREAD +¤ÈƱ¤¸¡£ +.TP +.BI "TIOCOUTQ int *" argp +.\"O Get the number of bytes in the output buffer. +½ÐÎϥХåե¡¤Ë¤¢¤ë¥Ð¥¤¥È¿ô¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TCFLSH int " arg +.\"O Equivalent to +.\"O .IR "tcflush(fd, arg)" . +.I "tcflush(fd, arg)" +¤ÈƱ¤¸¡£ +.br +.\"O See +.\"O .BR tcflush (3) +.\"O for the argument values +.\"O .BR TCIFLUSH , +.\"O .BR TCOFLUSH , +.\"O .BR TCIOFLUSH . +.BR tcflush (3) +¤Î°ú¤­¿ô +.BR TCIFLUSH , +.BR TCOFLUSH , +.B TCIOFLUSH +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SS "Faking input" +.SS ÆþÎϤε¶Áõ +.TP +.BI "TIOCSTI const char *" argp +.\"O Insert the given byte in the input queue. +»ØÄꤵ¤ì¤¿¥Ð¥¤¥È¤òÆþÎÏ¥­¥å¡¼¤ËÁÞÆþ¤¹¤ë¡£ +.\"O .SS "Redirecting console output" +.SS ¥³¥ó¥½¡¼¥ë½ÐÎϤΥê¥À¥¤¥ì¥¯¥È +.TP +.B "TIOCCONS void" +.\"O Redirect output that would have gone to +.\"O .I /dev/console +.\"O or +.\"O .I /dev/tty0 +.\"O to the given terminal. +.\"O If that was a pseudo-terminal master, send it to the slave. +.I /dev/console +¤Þ¤¿¤Ï +.I /dev/tty0 +¤ËÁ÷¤é¤ì¤ë½ÐÎϤò¡¢»ØÄꤵ¤ì¤¿Ã¼Ëö¥ê¥À¥¤¥ì¥¯¥È¤¹¤ë¡£ +»ØÄꤵ¤ì¤¿Ã¼Ëö¤¬µ¿»÷üËö (pseudo-terminal) ¤Î¥Þ¥¹¥¿¤Î¾ì¹ç¡¢ +½ÐÎϤϥ¹¥ì¡¼¥Ö¤ËÁ÷¤é¤ì¤ë¡£ +.\"O In Linux before version 2.6.10, +.\"O anybody can do this as long as the output was not redirected yet; +.\"O since version 2.6.10, only root (a process with the +.\"O .BR CAP_SYS_ADMIN +.\"O capability) may do this. +¥Ð¡¼¥¸¥ç¥ó 2.6.10 ¤è¤êÁ°¤Î Linux ¤Ç¤Ï¡¢½ÐÎϤ¬¤Þ¤À¥ê¥À¥¤¥ì¥¯¥È¤µ¤ì¤Æ +¤¤¤Ê¤±¤ì¤Ð¡¢Ã¯¤Ç¤â¥ê¥À¥¤¥ì¥¯¥È¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Ð¡¼¥¸¥ç¥ó 2.6.10 °Ê¹ß¤Ç¤Ï¡¢root +.RB ( CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤À¤±¤¬¥ê¥À¥¤¥ì¥¯¥È¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O If output was redirected already +.\"O .B EBUSY +.\"O is returned, +.\"O but redirection can be stopped by using this ioctl with +.\"O .I fd +.\"O pointing at +.\"O .I /dev/console +.\"O or +.\"O .IR /dev/tty0 . +½ÐÎϤ¬¤¹¤Ç¤Ë¥ê¥À¥¤¥ì¥¯¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï +.B EBUSY +¤¬ÊÖ¤µ¤ì¤ë¤¬¡¢ +.I /dev/console +¤« +.I /dev/tty0 +¤ò»Ø¤·¤Æ¤¤¤ë +.I fd +¤ËÂФ·¤Æ¤³¤Î ioctl ¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¡¢¥ê¥À¥¤¥ì¥¯¥È¤ò»ß¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SS "Controlling terminal" +.SS "üËö¤ÎÀ©¸æ" +.TP +.BI "TIOCSCTTY int " arg +.\"O Make the given terminal the controlling terminal of the calling process. +»ØÄꤵ¤ì¤¿Ã¼Ëö¤ò¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤Ë¤¹¤ë¡£ +.\"O The calling process must be a session leader and not have a +.\"O controlling terminal already. +.\"O If this terminal is already the controlling terminal +.\"O of a different session group then the ioctl fails with +.\"O .BR EPERM , +.\"O unless the caller is root (more precisely: has the +.\"O .BR CAP_SYS_ADMIN +.\"O capability) and +.\"O .I arg +.\"O equals 1, in which case the terminal is stolen, and all processes that had +.\"O it as controlling terminal lose it. +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ï¥»¥Ã¥·¥ç¥ó¥ê¡¼¥À¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤«¤Ä´û¤ËÀ©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¤³¤ÎüËö¤¬´û¤Ë¾¤Î¥»¥Ã¥·¥ç¥ó¥°¥ë¡¼¥×¤ÎÀ©¸æüËö¤Ç¤¢¤ë¾ì¹ç¡¢ +ioctl ¤Ï +.B EPERM +¤Ç¼ºÇÔ¤¹¤ë¡£¤¿¤À¤·¸Æ¤Ó½Ð¤·¤¿¥æ¡¼¥¶¤¬ root ¤Ç +(¤è¤êÀµ³Î¤Ë¤Ï +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Æ)¡¢¤«¤Ä +.I arg +¤¬ 1 ¤Ç¤¢¤ë¾ì¹ç¤ò½ü¤¯¡£ +¤³¤Î¾ì¹ç¡¢Ã¼Ëö¤ÏÅð¤Þ¤ì (stolen)¡¢ +¤³¤ÎüËö¤òÀ©¸æüËö¤È¤·¤Æ¤¤¤¿Á´¤Æ¤Î¥×¥í¥»¥¹¤ÏüËö¤ò¼º¤¦¡£ +.TP +.B TIOCNOTTY void +.\"O If the given terminal was the controlling terminal of the calling process, +.\"O give up this controlling terminal. +.\"O If the process was session leader, +.\"O then send +.\"O .B SIGHUP +.\"O and +.\"O .B SIGCONT +.\"O to the foreground process group +.\"O and all processes in the current session lose their controlling terminal. +»ØÄꤵ¤ì¤¿Ã¼Ëö¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤Ç¤¢¤ë¾ì¹ç¡¢ +¤³¤ÎÀ©¸æüËö¤òÊü´þ¤¹¤ë¡£ +¥×¥í¥»¥¹¤¬¥»¥Ã¥·¥ç¥ó¥ê¡¼¥À¤Î¾ì¹ç¡¢ +¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë +.B SIGHUP +¤È +.B SIGCONT +¤òÁ÷¤ê¡¢¥«¥ì¥ó¥È¥»¥Ã¥·¥ç¥ó¤ÎÁ´¤Æ¤Î¥×¥í¥»¥¹¤ÏÀ©¸æüËö¤ò¼º¤¦¡£ +.\"O .SS "Process group and session ID" +.SS "¥°¥ë¡¼¥× ID ¤È¥»¥Ã¥·¥ç¥ó ID ¤Î½èÍý" +.TP +.BI "TIOCGPGRP pid_t *" argp +.\"O When successful, equivalent to +.\"O .IR "*argp = tcgetpgrp(fd)" . +À®¸ù¤·¤¿¾ì¹ç¡¢ +.I "*argp = tcgetpgrp(fd)" +¤ÈƱ¤¸¡£ +.br +.\"O Get the process group ID of the foreground process group on this terminal. +¤³¤ÎüËö¾å¤Î¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCSPGRP const pid_t *" argp +.\"O Equivalent to +.\"O .IR "tcsetpgrp(fd, *argp)" . +.I "tcsetpgrp(fd, *argp)" +¤ÈƱ¤¸¡£ +.br +.\"O Set the foreground process group ID of this terminal. +¤³¤ÎüËö¤Î¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¤Î¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë¡£ +.TP +.BI "TIOCGSID pid_t *" argp +.\"O Get the session ID of the given terminal. +.\"O This will fail with +.\"O .B ENOTTY +.\"O in case the terminal is not a master pseudo-terminal +.\"O and not our controlling terminal. +.\"O Strange. +»ØÄꤵ¤ì¤¿Ã¼Ëö¤Î¥»¥Ã¥·¥ç¥ó ID ¤ò¼èÆÀ¤¹¤ë¡£ +üËö¤¬¥Þ¥¹¥¿µ¿»÷üËö¤Þ¤¿¤ÏÀ©¸æüËö¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢ +.B ENOTTY +¤Ç¼ºÇÔ¤¹¤ë¡£ +´ñ̯¤À¡£ +.\"O .SS "Exclusive mode" +.SS ÇÓ¾¥â¡¼¥É +.TP +.B "TIOCEXCL void" +.\"O Put the terminal into exclusive mode. +.\"O No further +.\"O .BR open (2) +.\"O operations on the terminal are permitted. +.\"O (They will fail with +.\"O .BR EBUSY , +.\"O except for root, that is, a process with the +.\"O .BR CAP_SYS_ADMIN +.\"O capability.) +üËö¤òÇÓ¾¥â¡¼¥É¤Ë¤¹¤ë¡£ +üËö¤ËÂФ·¤Æ¡¢¤³¤ì°Ê¹ß¤Î +.BR open (2) +Áàºî¤ò¶Ø»ß¤¹¤ë¡£ +(root °Ê³°¤Î¾ì¹ç¡¢¤Ä¤Þ¤ê +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹¤Î¾ì¹ç¡¢¤³¤ì°Ê¹ß¤Î +.BR open (2) +¤Ï +.B EBUSY +¤Ç¼ºÇÔ¤¹¤ë¡£) +.TP +.B "TIOCNXCL void" +.\"O Disable exclusive mode. +ÇÓ¾¥â¡¼¥É¤ò̵¸ú¤Ë¤¹¤ë¡£ +.\"O .SS "Line discipline" +.SS "¥é¥¤¥óÀ©¸æ (line discipline)" +.TP +.BI "TIOCGETD int *" argp +.\"O Get the line discipline of the terminal. +üËö¤Î¥é¥¤¥óÀ©¸æ¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCSETD const int *" argp +.\"O Set the line discipline of the terminal. +üËö¤Î¥é¥¤¥óÀ©¸æ¤Î¾ðÊó¤òÀßÄꤹ¤ë¡£ +.\"O .SS "Pseudo-terminal ioctls" +.SS "µ¿»÷üËö¤Î ioctl" +.TP +.BI "TIOCPKT const int *" argp +.\"O Enable (when +.\"O .RI * argp +.\"O is nonzero) or disable packet mode. +¥Ñ¥±¥Ã¥È¥â¡¼¥É¤òÍ­¸ú +.RI (* argp +¤¬ 0 °Ê³°¤Î¾ì¹ç) ¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ +.\"O Can be applied to the master side of a pseudo-terminal only (and will return +.\"O .B ENOTTY +.\"O otherwise). +.\"O In packet mode, each subsequent +.\"O .BR read (2) +.\"O will return a packet that either contains a single nonzero control byte, +.\"O or has a single byte containing zero (\(aq\0\(aq) followed by data +.\"O written on the slave side of the pseudo-terminal. +.\"O If the first byte is not +.\"O .B TIOCPKT_DATA +.\"O (0), it is an OR of one +.\"O or more of the following bits: +µ¿»÷üËö¤Î¥Þ¥¹¥¿Â¦¤Ë¤Î¤ßŬÍѤǤ­¤ë (¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï +.B ENOTTY +¤òÊÖ¤¹)¡£ +¥Ñ¥±¥Ã¥È¥â¡¼¥É¤Ç¤Ï¡¢¤½¤Î¸å¤Ë¼Â¹Ô¤µ¤ì¤ë +.BR read (2) +¤Ï¡¢Ãͤ¬ 0 °Ê³°¤Î 1 ¤Ä¤ÎÀ©¸æ¥Ð¥¤¥È¤ò´Þ¤à¥Ñ¥±¥Ã¥È¤«¡¢ +Ãͤ¬ 0 ¤Î 1 ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ëµ¿»÷üËö¤Î¥¹¥ì¡¼¥Ö¦¤Ç½ñ¤­¹þ¤Þ¤ì¤¿ +¥Ç¡¼¥¿¤¬Â³¤¯¥Ñ¥±¥Ã¥È¤òÊÖ¤¹¡£ +ºÇ½é¤Î¥Ð¥¤¥È¤¬ +.B TIOCPKT_DATA +(0) ¤Ç¤Ê¤¤¾ì¹ç¡¢°Ê²¼¤Î¥Ó¥Ã¥È¤Î 1 ¤Ä°Ê¾å¤ò OR ¤·¤¿¤â¤Î¤Ç¤¢¤ë: + +.nf +.\"O TIOCPKT_FLUSHREAD The read queue for the terminal is flushed. +TIOCPKT_FLUSHREAD üËö¤ÎÆɤ߹þ¤ß¥­¥å¡¼¤¬¥Õ¥é¥Ã¥·¥å (flush) ¤µ¤ì¤ë¡£ +.\"O TIOCPKT_FLUSHWRITE The write queue for the terminal is flushed. +TIOCPKT_FLUSHWRITE üËö¤Î½ñ¤­½Ð¤·¥­¥å¡¼¤¬¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë¡£ +.\"O TIOCPKT_STOP Output to the terminal is stopped. +TIOCPKT_STOP üËö¤Ø¤Î½ÐÎϤ¬Ää»ß¤µ¤ì¤ë¡£ +.\"O TIOCPKT_START Output to the terminal is restarted. +TIOCPKT_START üËö¤Ø¤Î½ÐÎϤ¬ºÆ³«¤µ¤ì¤ë¡£ +.\"O TIOCPKT_DOSTOP The start and stop characters are \fB^S\fP/\fB^Q\fP. +.\"O TIOCPKT_NOSTOP The start and stop characters are not \fB^S\fP/\fB^Q\fP. +TIOCPKT_DOSTOP ³«»Ïʸ»ú¤È½ªÎ»Ê¸»ú¤¬ \fB^S\fP/\fB^Q\fP ¤Ç¤¢¤ë¡£ +TIOCPKT_NOSTOP ³«»Ïʸ»ú¤È½ªÎ»Ê¸»ú¤¬ \fB^S\fP/\fB^Q\fP ¤Ç¤Ê¤¤¡£ +.fi + +.\"O While this mode is in use, the presence +.\"O of control status information to be read +.\"O from the master side may be detected by a +.\"O .BR select (2) +.\"O for exceptional conditions. +¤³¤Î¥â¡¼¥É¤¬»È¤ï¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +À©¸æ¾õÂÖ¾ðÊó¤Î¸ºß¤¬¥Þ¥¹¥¿Â¦¤«¤éÆɤ߹þ¤á¤ë¤«¤Ï¡¢ +Î㳰Ū¤Ê¾ò·ï¤Ç +.BR select (2) +¤ò»È¤¦¤³¤È¤Ë¤è¤êÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ + +.\"O This mode is used by +.\"O .BR rlogin (1) +.\"O and +.\"O .BR rlogind (8) +.\"O to implement a remote-echoed, +.\"O locally \fB^S\fP/\fB^Q\fP flow-controlled remote login. +¤³¤Î¥â¡¼¥É¤Ï +.BR rlogin (1) +¤È +.BR rlogind (8) +¤Ç»È¤ï¤ì¡¢¥ê¥â¡¼¥È¥¨¥³¡¼¤Î¥ê¥â¡¼¥È¥í¥°¥¤¥ó¤È +¥í¡¼¥«¥ë¤Ç¤Î \fB^S\fP/\fB^Q\fP ¥Õ¥í¡¼À©¸æ¤Î¥ê¥â¡¼¥È¥í¥°¥¤¥ó¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£ + +.\"O The BSD ioctls +.\"O .BR TIOCSTOP , +.\"O .BR TIOCSTART , +.\"O .BR TIOCUCNTL , +.\"O .B TIOCREMOTE +.\"O have not been implemented under Linux. +BSD ¤Î ioctl ¤Ç¤¢¤ë +.BR TIOCSTOP , +.BR TIOCSTART , +.BR TIOCUCNTL , +.B TIOCREMOTE +¤Ï¡¢Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SS "Modem control" +.SS ¥â¥Ç¥àÀ©¸æ +.TP +.BI "TIOCMGET int *" argp +.\"O get the status of modem bits. +¥â¥Ç¥à¥Ó¥Ã¥ÈÎó¤Î¾õÂÖ¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCMSET const int *" argp +.\"O set the status of modem bits. +¥â¥Ç¥à¥Ó¥Ã¥ÈÎó¤Î¾õÂÖ¤òÀßÄꤹ¤ë¡£ +.TP +.BI "TIOCMBIC const int *" argp +.\"O clear the indicated modem bits. +»ØÄꤵ¤ì¤¿¥â¥Ç¥à¥Ó¥Ã¥ÈÎó¤ò¥¯¥ê¥¢¤¹¤ë¡£ +.TP +.BI "TIOCMBIS const int *" argp +.\"O set the indicated modem bits. +»ØÄꤵ¤ì¤¿¥â¥Ç¥à¥Ó¥Ã¥ÈÎó¤òÀßÄꤹ¤ë¡£ +.LP +.\"O Bits used by these four ioctls: +¤³¤ì¤é¤Î 4 ¤Ä¤Î ioctl ¤Ç»È¤ï¤ì¤ë¥Ó¥Ã¥È¤Ï°Ê²¼¤ÎÄ̤ê: + +.nf +TIOCM_LE DSR (data set ready/line enable) +TIOCM_DTR DTR (data terminal ready) +TIOCM_RTS RTS (request to send) +TIOCM_ST Secondary TXD (transmit) +TIOCM_SR Secondary RXD (receive) +TIOCM_CTS CTS (clear to send) +TIOCM_CAR DCD (data carrier detect) +.\"O TIOCM_CD see TIOCM_CAR +TIOCM_CD TIOCM_CAR ¤ò»²¾È¡£ +TIOCM_RNG RNG (ring) +.\"O TIOCM_RI see TIOCM_RNG +TIOCM_RI TIOCM_RNG ¤ò»²¾È¡£ +TIOCM_DSR DSR (data set ready) +.fi +.\"O .SS "Marking a line as local" +.SS "²óÀþ¤ò¥í¡¼¥«¥ë¤È¤·¤Æ¥Þ¡¼¥¯¤¹¤ë" +.TP +.BI "TIOCGSOFTCAR int *" argp +.\"O ("Get software carrier flag") +.\"O Get the status of the CLOCAL flag in the c_cflag field of the +.\"O .I termios +.\"O structure. +("¥½¥Õ¥È¥¦¥§¥¢¥­¥ã¥ê¥¢¥Õ¥é¥°¤Î¼èÆÀ") +.I termios +¹½Â¤ÂΤΠc_cflag ¥Õ¥£¡¼¥ë¥É¤Î +.B CLOCAL +¥Õ¥é¥°¤Î¾õÂÖ¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCSSOFTCAR const int *" argp +.\"O ("Set software carrier flag") +.\"O Set the CLOCAL flag in the +.\"O .I termios +.\"O structure when +.\"O .RI * argp +.\"O is nonzero, and clear it otherwise. +("¥½¥Õ¥È¥¦¥§¥¢¥­¥ã¥ê¥¢¥Õ¥é¥°¤ÎÀßÄê") +.RI * argp +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢ +.I termios +¹½Â¤ÂΤΠ+.B CLOCAL +¥Õ¥é¥°¤òÀßÄꤹ¤ë¡£ +0 ¤Î¾ì¹ç¤Ï¥¯¥ê¥¢¤¹¤ë¡£ +.LP +.\"O If the +.\"O .B CLOCAL +.\"O flag for a line is off, the hardware carrier detect (DCD) +.\"O signal is significant, and an +.\"O .BR open (2) +.\"O of the corresponding terminal will block until DCD is asserted, +.\"O unless the +.\"O .B O_NONBLOCK +.\"O flag is given. +¥é¥¤¥ó¤Î +.B CLOCAL +¥Õ¥é¥°¤¬¥ª¥Õ¤Î¾ì¹ç¡¢ +¥Ï¡¼¥É¥¦¥§¥¢¥­¥ã¥ê¥¢¸¡½Ð (hardware carrier detect, DCD) ¥·¥°¥Ê¥ë¤¬½ÅÍפǤ¢¤ê¡¢ +.B O_NONBLOCK +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Ê¤¤¸Â¤ê¡¢Âбþ¤¹¤ëüËö¤Î +.BR open (2) +¤Ï DCD ¤¬¼¨¤µ¤ì¤ë¤Þ¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¡£ +.\"O If +.\"O .B CLOCAL +.\"O is set, the line behaves as if DCD is always asserted. +.B CLOCAL +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¥é¥¤¥ó¤Ï¾ï¤Ë DCD ¤¬¼¨¤µ¤ì¤Æ¤¤¤ë¤«¤Î¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ +.\"O The software carrier flag is usually turned on for local devices, +.\"O and is off for lines with modems. +¥½¥Õ¥È¥¦¥§¥¢¥­¥ã¥ê¥¢¥Õ¥é¥°¤Ï¡¢¥í¡¼¥«¥ë¥Ç¥Ð¥¤¥¹¤Ç¤ÏÄ̾ï¤Ï¥ª¥ó¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +¥â¥Ç¥à¤Î¥é¥¤¥ó¤Ç¤Ï¥ª¥Õ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O .SS "Linux-specific" +.SS "Linux ¸ÇÍ­¤Î ioctl" +.\"O For the +.\"O .B TIOCLINUX +.\"O ioctl, see +.\"O .BR console_ioctl (4). +.B TIOCLINUX +ioctl ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR console_ioctl (4) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SS "Kernel debugging" +.SS ¥«¡¼¥Í¥ë¥Ç¥Ð¥Ã¥®¥ó¥° +.B "#include " +.TP +.BI "TIOCTTYGSTRUCT struct tty_struct *" argp +.\"O Get the +.\"O .I tty_struct +.\"O corresponding to +.\"O .IR fd . +.I fd +¤ËÂбþ¤¹¤ë +.I tty_struct +¤ò¼èÆÀ¤¹¤ë¡£ +.\"O .\" .SS "Serial info" +.\" .SS "¥·¥ê¥¢¥ë¾ðÊó" +.\" .BR "#include " +.\" .sp +.\" .TP +.\" .BI "TIOCGSERIAL struct serial_struct *" argp +.\"O .\" Get serial info. +.\" ¥·¥ê¥¢¥ë¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ +.\" .TP +.\" .BI "TIOCSSERIAL const struct serial_struct *" argp +.\"O .\" Set serial info. +.\" ¥·¥ê¥¢¥ë¾ðÊó¤òÀßÄꤹ¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The +.\"O .BR ioctl () +.\"O system call returns 0 on success. +.\"O On error it returns \-1 and sets +.\"O .I errno +.\"O appropriately. +.BR ioctl () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\"O Invalid command parameter. +ÉÔÀµ¤Ê¥³¥Þ¥ó¥É°ú¤­¿ô¤Ç¤¢¤ë¡£ +.TP +.B ENOIOCTLCMD +.\"O Unknown command. +ÉÔÌÀ¤Ê¥³¥Þ¥ó¥É¤Ç¤¢¤ë¡£ +.TP +.B ENOTTY +.\"O Inappropriate +.\"O .IR fd . +.I fd +¤¬ÉÔŬÀڤǤ¢¤ë¡£ +.TP +.B EPERM +.\"O Insufficient permission. +¸¢¸Â¤¬ÉÔ­¤·¤Æ¤¤¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O Check the condition of DTR on the serial port. +¥·¥ê¥¢¥ë¥Ý¡¼¥È¤Î DTR ¤Î¾õÂÖ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ + +.nf +#include +#include +#include + +int +main(void) +{ + int fd, serial; + + fd = open("/dev/ttyS0", O_RDONLY); + ioctl(fd, TIOCMGET, &serial); + if (serial & TIOCM_DTR) +.\"O puts("TIOCM_DTR is not set"); + puts("TIOCM_DTR ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£"); + else +.\"O puts("TIOCM_DTR is set"); + puts("TIOCM_DTR ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¡£"); + close(fd); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ioctl (2), +.BR termios (3), +.BR console_ioctl (4), +.BR pty (7) +.\" +.\" FIONBIO const int * +.\" FIONCLEX void +.\" FIOCLEX void +.\" FIOASYNC const int * +.\"O .\" from serial.c: +.\" serial.c ¤è¤ê: +.\" TIOCSERCONFIG void +.\" TIOCSERGWILD int * +.\" TIOCSERSWILD const int * +.\" TIOCSERGSTRUCT struct async_struct * +.\" TIOCSERGETLSR int * +.\" TIOCSERGETMULTI struct serial_multiport_struct * +.\" TIOCSERSETMULTI const struct serial_multiport_struct * +.\"O .\" TIOCGSERIAL, TIOCSSERIAL (see above) +.\" TIOCGSERIAL, TIOCSSERIAL (¾åµ­¤ò»²¾È) diff --git a/draft/man4/vcs.4 b/draft/man4/vcs.4 new file mode 100644 index 00000000..4f4779e4 --- /dev/null +++ b/draft/man4/vcs.4 @@ -0,0 +1,229 @@ +.\" Copyright (c) 1995 James R. Van Zandt +.\" Sat Feb 18 09:11:07 EST 1995 +.\" +.\" 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, Sun Feb 26 15:08:05 1995, faith@cs.unc.edu +.\" 2007-12-17, Samuel Thibault : +.\" document the VT_GETHIFONTMASK ioctl +.\" " +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Tue Feb 6 16:30:31 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Sun Jan 11 03:55:54 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated Sat Feb 10 23:17:30 JST 2001 +.\" by Yuichi SATO +.\" Updated 2008-02-12, Akihiro MOTOKI , LDP v2.77 +.\" +.\" WORD: virtual console ²¾ÁÛ¥³¥ó¥½¡¼¥ë +.\" WORD: memory ¥á¥â¥ê +.\" WORD: permission ¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó +.\" WORD: prefix ¥×¥ì¥Õ¥£¥Ã¥¯¥¹ +.\" WORD: screen ¥¹¥¯¥ê¡¼¥ó +.\" WORD: cursor ¥«¡¼¥½¥ë +.\" WORD: Braille ¥Ö¥é¥¤¥æÅÀ»ú +.\" +.TH VCS 4 2007-12-17 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O vcs, vcsa \- virtual console memory +vcs, vcsa \- ²¾ÁÛ¥³¥ó¥½¡¼¥ë¥á¥â¥ê (virtual console memory) +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O \fI/dev/vcs0\fP is a character device with major number 7 and minor number +.\"O 0, usually of mode 0644 and owner root.tty. +.\"O It refers to the memory of the currently +.\"O displayed virtual console terminal. +\fI/dev/vcs0\fP ¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ (major number) 7¡¢¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ +(minor number) 0 ¤Î¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹ (character device) ¤Ç¡¢ +Ä̾¤½¤Î¥â¡¼¥É¤Ï 0644¡¢¥ª¡¼¥Ê¤Ï root.tty ¤Ç¤¢¤ë¡£ +¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë (device file) ¤Ï +¸½ºßɽ¼¨¤µ¤ì¤Æ¤¤¤ë²¾ÁÛ¥³¥ó¥½¡¼¥ëüËö¤Î¥á¥â¥ê¤ò»²¾È¤¹¤ë¡£ +.LP +.\"O \fI/dev/vcs[1\-63]\fP are character devices for virtual console +.\"O terminals, they have major number 7 and minor number 1 to 63, usually +.\"O mode 0644 and owner root.tty. +.\"O \fI/dev/vcsa[0\-63]\fP are the same, but +.\"O using +.\"O .IR "unsigned short" s +.\"O (in host byte order) that include attributes, +.\"O and prefixed with four bytes giving the screen +.\"O dimensions and cursor position: \fIlines\fP, \fIcolumns\fP, \fIx\fP, \fIy\fP. +.\"O (\fIx\fP = \fIy\fP = 0 at the top left corner of the screen.) +\fB/dev/vcs[1\-63]\fP ¤Ï²¾ÁÛ¥³¥ó¥½¡¼¥ëüËö¤Î¤¿¤á¤Î +¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹¤Ç¡¢¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼¤¬ 7¡¢¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼¤¬ 1 ¤«¤é 63¡¢ +Ä̾ï¤Ï¥â¡¼¥É¤¬ 0644¡¢¥ª¡¼¥Ê¡¼¤¬ root.tty ¤Ç¤¢¤ë¡£ +\fB/dev/vcsa[0\-63]\fP ¤Ï \fB/dev/vcs[1\-63]\fP ¤ÈƱÍͤǤ¢¤ë¤¬¡¢ +°À­¤ò³ÊǼ¤¹¤ë¤Î¤Ë (¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¤Î) +.I "unsigned short" +¤ò»ÈÍѤ·¤Æ¤¤¤ëÅÀ¡¢¥¹¥¯¥ê¡¼¥ó¤Î¥µ¥¤¥º¡¦¥«¡¼¥½¥ë¤Î°ÌÃÖ¤òɽ¤¹ +4 ¥Ð¥¤¥È¤Î¾ðÊó +\fIlines\fP, \fIcolumns\fP, \fIx\fP, \fIy\fP +(\fIx\fP =\fIy\fP = 0 ¤¬²èÌ̤κ¸¾å) ¤¬ÀèƬ¤Ë¤¢¤ëÅÀ¤¬°Û¤Ê¤ë¡£ + +.\"O When a 512-character font is loaded, +.\"O the 9th bit position can be fetched by applying the +.\"O .BR ioctl (2) +.\"O \fBVT_GETHIFONTMASK\fP operation +.\"O (available in Linux kernels 2.6.18 and above) +.\"O on \fI/dev/tty[1\-63]\fP; +.\"O the value is returned in the +.\"O .I "unsigned short" +.\"O pointed to by the third +.\"O .BR ioctl (2) +.\"O argument. +512 ʸ»ú¤«¤éÀ®¤ë¥Õ¥©¥ó¥È¤ò¥í¡¼¥É¤·¤¿¾ì¹ç¡¢ +9 ¥Ó¥Ã¥ÈÌܤξðÊó¤Ï \fI/dev/tty[1\-63]\fP ¤ËÂФ·¤Æ +.BR ioctl (2) +\fBVT_GETHIFONTMASK\fP Áàºî¤ò¹Ô¤¦¤³¤È¤Ç¼èÆÀ¤Ç¤­¤ë +(\fBVT_GETHIFONTMASK\fP Áàºî¤Ï¥«¡¼¥Í¥ë 2.6.18 °Ê¹ß¤Î Linux ¤Ç +ÍøÍѲÄǽ¤Ç¤¢¤ë)¡£ +ÃÍ¤Ï +.BR ioctl (2) +¤Î 3 ÈÖÌܤΰú¤­¿ô¤¬»Ø¤¹ +.I "unsigned short" +¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O These devices replace the screendump +.\"O .BR ioctl (2) +.\"O operations of +.\"O .BR console (4), +.\"O so the system +.\"O administrator can control access using file system permissions. +¤³¤ì¤é¤Î¥Ç¥Ð¥¤¥¹¤Ï +.BR console (4) +¤Î screendump +.BR ioctl (2) +¤òÂåÂؤȤʤ롣 +½¾¤Ã¤Æ¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó +(filesystem permission) ¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤ò¥³¥ó¥È¥í¡¼¥ë¤Ç¤­¤ë¡£ +.PP +.\"O The devices for the first eight virtual consoles may be created by: +ºÇ½é¤Î 8 ¤Ä¤Î²¾ÁÛüËö¤Î¤¿¤á¤Î¥Ç¥Ð¥¤¥¹¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤ë»ö¤¬¤Ç¤­¤ë: + +.nf + for x in 0 1 2 3 4 5 6 7 8; do + mknod \-m 644 /dev/vcs$x c 7 $x; + mknod \-m 644 /dev/vcsa$x c 7 $[$x+128]; + done + chown root:tty /dev/vcs* +.fi + +.\"O No +.\"O .BR ioctl (2) +.\"O requests are supported. +.BR ioctl (2) +¤Ë¤è¤ëÍ×µá¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +/dev/vcs[0\-63] +.br +/dev/vcsa[0\-63] +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\" Andries Brouwer +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O Introduced with version 1.1.92 of the Linux kernel. +Linux ¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó 1.1.92 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O You may do a screendump on vt3 by switching to vt1 and typing +.\"O \fIcat /dev/vcs3 >foo\fP. +.\"O Note that the output does not contain +.\"O newline characters, so some processing may be required, like +.\"O in \fIfold \-w 81 /dev/vcs3 | lpr\fP or (horrors) +.\"O \fIsetterm \-dump 3 \-file /proc/self/fd/1\fP. +vt3 ¤Î¥¹¥¯¥ê¡¼¥ó¥À¥ó¥×¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢Ã¼Ëö¤ò vt1 ¤ËÀÚÂؤ¨¤Æ +\fIcat /dev/vcs3 >foo\fP ¤È¥¿¥¤¥×¤¹¤ì¤Ð¤è¤¤¡£ +µ¤¤òÉÕ¤±¤ÆÍߤ·¤¤¤Î¤Ï¡¢¤³¤Î½ÐÎϤϲþ¹Ôʸ»ú (newline character) ¤ò +´Þ¤ó¤Ç¤¤¤Ê¤¤¤È¤¤¤¦»ö¤Ç¤¢¤ë¡£ +½¾¤Ã¤Æ¡¢\fIfold \-w 81 /dev/vcs3 | lpr\fP ¤ä +(¤¾¤Ã¤È¤¹¤ë¤¬) \fIsetterm \-dump 3 \-file /proc/self/fd/1\fP ¤Î¤è¤¦¤Ê +²¿¤é¤«¤Î½èÍý¤¬É¬Íפˤʤ뤫¤â¤·¤ì¤Ê¤¤¡£ +.LP +.\"O The \fI/dev/vcsa0\fP device is used for Braille support. +\fI/dev/vcsa0\fP ¥Ç¥Ð¥¤¥¹¤ò»È¤¦¤³¤È¤Ç¡¢ +¥Ö¥é¥¤¥æÅÀ»ú¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O This program displays the character and screen attributes under the +.\"O cursor of the second virtual console, then changes the background color +.\"O there: +°Ê²¼¤Î¥×¥í¥°¥é¥à¤ÏÆó¤ÄÌܤβ¾ÁÛ¥³¥ó¥½¡¼¥ë¤Î¥«¡¼¥½¥ë°ÌÃ֤Υ¹¥¯¥ê¡¼¥ó°À­¤Èʸ»ú +¤òɽ¼¨¤·¤¿¸å¡¢¥«¡¼¥½¥ë°ÌÃÖ¤ÎÇØ·Ê¿§¤òÊѹ¹¤¹¤ë : + +.nf +#include +#include +#include +#include +#include +#include + +int +main(void) +{ + int fd; + char *device = "/dev/vcsa2"; + char *console = "/dev/tty2"; + struct {unsigned char lines, cols, x, y;} scrn; + unsigned short s; + unsigned short mask; + unsigned char ch, attrib; + + fd = open(console, O_RDWR); + if (fd < 0) { + perror(console); + exit(EXIT_FAILURE); + } + if (ioctl(fd, VT_GETHIFONTMASK, &mask) < 0) { + perror("VT_GETHIFONTMASK"); + exit(EXIT_FAILURE); + } + (void) close(fd); + fd = open(device, O_RDWR); + if (fd < 0) { + perror(device); + exit(EXIT_FAILURE); + } + (void) read(fd, &scrn, 4); + (void) lseek(fd, 4 + 2*(scrn.y*scrn.cols + scrn.x), 0); + (void) read(fd, &s, 2); + ch = s & 0xff; + if (attrib & mask) + ch |= 0x100; + attrib = ((s & ~mask) >> 8); + printf("ch=\(aq%c\(aq attrib=0x%02x\\n", ch, attrib); + attrib ^= 0x10; + (void) lseek(fd, \-1, 1); + (void) write(fd, &attrib, 1); + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR console (4), +.BR tty (4), +.BR ttyS (4), +.BR gpm (8) diff --git a/draft/man4/wavelan.4 b/draft/man4/wavelan.4 new file mode 100644 index 00000000..6bfcba30 --- /dev/null +++ b/draft/man4/wavelan.4 @@ -0,0 +1,245 @@ +.\" From jt@hplb.hpl.hp.com Thu Dec 19 18:31:49 1996 +.\" From: Jean Tourrilhes +.\" Address: HP Labs, Filton Road, Stoke Gifford, Bristol BS12 6QZ, U.K. +.\" Jean II - HPLB - '96 +.\" wavelan.c.4 +.\" +.\" Provenance of this page is unclear. Licensed under the GPL, +.\" after inquiries with Jean Tourrilhes and Bruce Janson +.\" (mtk, July 2006) +.\" +.\" Japanese Version Copyright (c) 1997 +.\" ISHIKAWA Mutsumi, all rights reserved. +.\" Translated Sat Sep 20 14:45:21 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Tue Feb 10 15:21:08 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: wireless ethernet ¥ï¥¤¥¢¥ì¥¹¥¤¡¼¥µ¥Í¥Ã¥È +.\" +.TH WAVELAN 4 1996-10-22 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O wavelan \- AT&T GIS WaveLAN ISA device driver +.SH ̾Á° +wavelan \- AT&T GIS WaveLAN ISA ¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.BI "insmod wavelan_cs.o [io=" B,B.. "] [ irq=" I,I.. "] [name=" N,N.. ] +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .I wavelan +.\"O is the low-level device driver for the NCR / AT&T / Lucent +.\"O .B WaveLAN ISA +.\"O and Digital (DEC) +.\"O .B RoamAbout DS +.\"O wireless ethernet adapter. +.\"O This driver is available as a module or +.\"O might be compiled in the kernel. +.\"O This driver supports multiple cards +.\"O in both forms (up to 4) and allocates the next available ethernet +.\"O device (eth0..eth#) for each card found, unless a device name is +.\"O explicitly specified (see below). +.\"O This device name will be reported +.\"O in the kernel log file with the MAC address, NWID and frequency used +.\"O by the card. +.I wavelan +¤Ï¡¢NCR / AT&T / Lucent ¤Î +.B WaveLan ISA +¤È Digital(DEC) ¤Î +.B RoamAbout DS +¤È¤¤¤¦¥ï¥¤¥¢¥ì¥¹¡¦¥¤¡¼¥µ¥Í¥Ã¥È (wireless ethernet) ¥¢¥À¥×¥¿¤Î¤¿¤á¤Î +¥í¡¼¥ì¥Ù¥ë¡¦¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ç¤¢¤ë¡£¤³¤Î¥É¥é¥¤¥Ð¤Ï¥â¥¸¥å¡¼¥ë¤È¤·¤Æ¤â¡¢¤Þ¤¿¡¢ +¥«¡¼¥Í¥ë¤ËÁȤ߹þ¤ó¤À·Á¤Ç¤âÍøÍѤǤ­¤ë¡£¤Þ¤¿¡¢¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢Ê£¿ô¥«¡¼¥É +(ºÇÂç 4 Ëç¤Þ¤Ç) ¤ò¥µ¥Ý¡¼¥È¤·¡¢ÌÀ¼¨Åª¤Ë¥Ç¥Ð¥¤¥¹¤Î̾Á°¤ò»ØÄꤷ¤Ê¤¤¸Â¤ê +(¤³¤ì¤Ë´Ø¤·¤Æ¤Ï¡¢²¼¤ò¸«¤è)¡¢È¯¸«¤µ¤ì¤¿¤½¤ì¤¾¤ì¤Î¥«¡¼¥É¤Ë¤Ï¡¢ÍøÍѲÄǽ¤Ê +¼¡¤Î¥¤¡¼¥µ¥Í¥Ã¥È¥Ç¥Ð¥¤¥¹(eth0..eth#)¤¬³ä¤êÅö¤Æ¤é¤ì¤ë¡£¤³¤Î¥Ç¥Ð¥¤¥¹Ì¾¤Ï +MAC ¥¢¥É¥ì¥¹¡¢NWID¡¢¥«¡¼¥É¤Ë¤è¤Ã¤ÆÍøÍѤµ¤ì¤ë¼þÇÈ¿ô¤È¤È¤â¤Ë +¥«¡¼¥Í¥ë¥í¥°¥Õ¥¡¥¤¥ë¤ËÊó¹ð¤µ¤ì¤ë¡£ +.\"O .SS Parameters +.SS °ú¿ô +.\"O This section apply to the module form (parameters passed on the +.\"O .BR insmod (8) +.\"O command line). +.\"O If the driver is included in the kernel, use the +.\"O .I ether=IRQ,IO,NAME +.\"O syntax on the kernel command line. +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤Ï¡¢¥â¥¸¥å¡¼¥ë¤È¤·¤Æ»ÈÍѤ¹¤ë¾ì¹ç +¤ËŬÍѤµ¤ì¡¢ +.BR insmod (8) +¤Î¥³¥Þ¥ó¥É¡¦¥é¥¤¥ó°ú¤­¿ô¤È¤·¤ÆÍѤ¤¤ë¡£ +¥«¡¼¥Í¥ë¤Ë¥É¥é¥¤¥Ð¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.I ether=IRQ,IO,NAME +¤È¤¤¤¦·Á¼°¤Î¥Ñ¥é¥á¡¼¥¿¤ò¥«¡¼¥Í¥ë¡¦¥³¥Þ¥ó¥É¥é¥¤¥ó¤ËÅϤ¹¡£ +.TP +.\"O .B io +.\"O Specify the list of base address where to search for wavelan cards +.\"O (setting by dip switch on the card). +.\"O If you don't specify any io +.\"O address, the driver will scan 0x390 and 0x3E0 addresses, which might +.\"O conflict with other hardware... +.B io +wavelan ¥«¡¼¥É¤ò¸¡½Ð¤¹¤ë»þ¤Ë¤É¤³¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹¤ò¥µ¡¼¥Á¤¹¤ë¤«¤È¤¤¤¦ +¥ê¥¹¥È¤ò»ØÄꤹ¤ë (¥«¡¼¥É¤¬ÍøÍѤ¹¤ë¥Ù¡¼¥¹¥¢¥É¥ì¥¹¤Ï¥«¡¼¥É¤Î¥Ç¥£¥Ã¥× +¥¹¥¤¥Ã¥Á¤ÇÀßÄꤹ¤ë)¡£¤â¤· io ¥¢¥É¥ì¥¹¤¬»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¥É¥é¥¤¥Ð¤Ï 0x390 ¤È +0x3E0 ¤ò¥¹¥­¥ã¥ó¤¹¤ë(¤³¤Î¥¢¥É¥ì¥¹¤Ï¾¤Î¥Ï¡¼¥É¤È¾×Æͤ¹¤ë¤³¤È¤â¹Í¤¨¤é¤ì¤ë)¡£ +.TP +.\"O .B irq +.\"O Set the list of irq that each wavelan card should use (the value is +.\"O saved in permanent storage for future use). +.B irq +¤½¤ì¤¾¤ì¤Î wavelan ¥«¡¼¥É¤¬ÍøÍѤ¹¤ë irq ¤Î¥ê¥¹¥È¤ò¥»¥Ã¥È¤¹¤ë (¤³¤ÎÃÍ¤Ï +¾­ÍèŪ¤ÊÍøÍѤΤ¿¤á¤Ë¥Ñ¡¼¥Þ¥Í¥ó¥È¡¦¥¹¥È¥ì¡¼¥¸¤ËÊݸ¤µ¤ì¤ë)¡£ +.TP +.\"O .B name +.\"O Set the list of name to be used for each wavelan cards device (name +.\"O used by +.\"O .BR ifconfig (8)). +.B name +¤½¤ì¤¾¤ì¤Î wavelan ¥«¡¼¥É¥Ç¥Ð¥¤¥¹¤Ë +.RB ( ifconfig (8) +¤¬ÍøÍѤ¹¤ë)̾Á°¤Î¥ê¥¹¥È¤ò¥»¥Ã¥È¤¹¤ë¡£ +.\"O .SS "Wireless Extensions" +.SS "¥ï¥¤¥¢¥ì¥¹³ÈÄ¥ (Wireless Extentions)" +.\"O Use +.\"O .BR iwconfig (8) +.\"O to manipulate wireless extensions. +¥ï¥¤¥¢¥ì¥¹³ÈÄ¥¤ÎÁàºî¤Ë¤Ï +.BR iwconfig (8) +¤ò»È¤¦¡£ +.\"O .SS NWID (or domain) +.SS NWID (or ¥É¥á¥¤¥ó) +.\"O Set the network ID +.\"O .RI [ 0 +.\"O to +.\"O .IR FFFF ] +.\"O or disable it +.\"O .RI [ off ]. +.\"O As the NWID is stored in the card Permanent Storage Area, it will be +.\"O reuse at any further invocation of the driver. +¥Í¥Ã¥È¥ï¡¼¥¯ ID¤ò +.RI [ 0 +¤«¤é +.IR FFFF ] +¤ËÀßÄꤹ¤ë¤«¡¢ +.RI [ off ] +¤½¤ÎÍøÍѤò̵¸ú¤Ë¤¹¤ë¡£ +NWID ¤Ï¥«¡¼¥É¤Î¥Ñ¡¼¥Þ¥Í¥ó¥È¡¦¥¹¥È¥ì¡¼¥¸¥¨¥ê¥¢ (Permanent Strage Area) ¤Ë +³ÊǼ¤µ¤ì¤ë¤Î¤Ç¡¢NWID ¤Ï¥É¥é¥¤¥Ð¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤¿¤Ó¤ËÍøÍѤǤ­¤ë¡£ +.\"O .SS Frequency & channels +.SS ¼þÇÈ¿ô¤È¥Á¥ã¥Í¥ë +.\"O For the 2.4GHz 2.00 Hardware, you are able to set the frequency by +.\"O specifying one of the 10 defined channels +.\"O .RI ( 2.412, +.\"O .I 2.422, 2.425, 2.4305, 2.432, 2.442, 2.452, 2.460, 2.462 +.\"O or +.\"O .IR 2.484 ) +.\"O or directly by its value. +.\"O The frequency is changed immediately and +.\"O permanently. +.\"O Frequency availability depends on the regulations... +2.4GHz 2.00 ¥Ï¡¼¥É¥¦¥§¥¢¤Ç¤Ï¡¢10 ¤ÎÄêµÁºÑ¤ß¤Î¥Á¥ã¥Í¥ë +.RI ( 2.412 +.I 2.422, 2.425, 2.4305, 2.432, 2.442, 2.452, 2.460, 2.462 +.IR 2.484 ) +¤Î¤¦¤Á¤Î°ì¤Ä¤ò»ØÄꤹ¤ë¤«¡¢¤½¤ÎÃͤòľÀÜ»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤Æ¼þÇÈ¿ô¤òÀßÄê +¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¼þÇÈ¿ô¤Ïľ¸å¤ËÊѹ¹¤µ¤ì¡¢¤Þ¤¿¡¢¤½¤ÎÊѹ¹¤Ï¹±µ×Ū¤Ç¤¢¤ë¡£ +¤É¤Î¼þÇÈ¿ô¤¬ÍøÍѤǤ­¤ë¤«¤È¤¤¤¦¤³¤È¤Ï¡¢(¤½¤Î¹ñ¤Î) ˡΧ¤Ë°Í¸¤¹¤ë¡Ä +.\"O .SS Statistics spy +.SS Åý·×¥¹¥Ñ¥¤ (Statics spy) +.\"O Set a list of MAC addresses in the driver (up to 8) and get the last +.\"O quality of link for each of those (see +.\"O .BR iwspy (8)). +(8 ¤Ä¤Þ¤Ç¤Î) MAC ¥¢¥É¥ì¥¹¤Î¥ê¥¹¥È¤ò¥É¥é¥¤¥Ð¤ËÀßÄꤷ¤Æ¡¢ +¤½¤ì¤¾¤ì¤Î¥ê¥ó¥¯¤ÎÉʼÁ¤òÆÀ¤ë +.RB ( iwspy (8) +¤ò»²¾È)¡£ +.\"O .SS /proc/net/wireless +.SS /proc/net/wireless +.\"O .I status +.\"O is the status reported by the modem. +.I status +¤Ï¥â¥Ç¥à¤«¤éÊó¹ð¤µ¤ì¤¿¥¹¥Æ¡¼¥¿¥¹¤Ç¤¢¤ë¡£ +.\"O .I Link quality +.\"O reports the quality of the modulation on the air (direct sequence +.\"O spread spectrum) [max = 16]. +.I link quality +¤ÏÄÌ¿®Ãæ¤Î(ľÀܳȻ¶¥¹¥Ú¥¯¥È¥é¥àÄÌ¿®Êý¼°¤Ë¤ª¤±¤ë)ÊÑÄ´¤ÎÉʼÁ¤òÊó¹ð¤¹¤ë +[ºÇÂç = 16]¡£ +.\"O .I Level +.\"O and +.\"O .I Noise +.\"O refer to the signal level and noise level [max = 64]. +.I Level +¤È +.I Noise +¤Ï¿®¹æ¥ì¥Ù¥ë¤È¥Î¥¤¥º¤Î¥ì¥Ù¥ë¤ò»²¾È¤¹¤ë [ºÇÂç = 64]¡£ +.\"O The +.\"O .I crypt discarded packet +.\"O and +.\"O .I misc discarded packet +.\"O counters are not implemented. +.I °Å¹æ²½¤µ¤ì¤Æ¤¤¤ÆÇÑ´þ¤µ¤ì¤¿¥Ñ¥±¥Ã¥È(crypt discarded packet) +¤È +.I ¤½¤ì°Ê³°¤ÎÇÑ´þ¤µ¤ì¤¿¥Ñ¥±¥Ã¥È(misc discarded packet) +¤Î¥«¥¦¥ó¥¿¡¼¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SS "Private Ioctl" +.SS "¥É¥é¥¤¥Ð¸ÇÍ­¤ÎIOCTL (Private Ioctl)" +.\"O You may use +.\"O .BR iwpriv (8) +.\"O to manipulate private ioctls. +.BR iwpriv (8) +¤ò¥É¥é¥¤¥Ð¸ÇÍ­¤Î ioctl ¤ÎÁàºî¤Î¤¿¤á¤ËÍøÍѤǤ­¤ë¡£ +.\"O .SS Quality and Level threshold +.\"O Enable you the define the quality and level threshold used by the +.\"O modem (packet below that level are discarded). +.SS ÉʼÁ¤È¥ì¥Ù¥ë¤ÎïçÃÍ (Quality and Level threshold) +¥â¥Ç¥à¤Ç»È¤ï¤ì¤ëÉʼÁ¤È¥ì¥Ù¥ë¤ÎïçÃÍ (¤½¤Î¥ì¥Ù¥ë¤ò²¼²ó¤Ã¤¿¥Ñ¥±¥Ã¥È¤Ï +ÇË´þ¤µ¤ì¤ë) ¤òÄêµÁ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SS Histogram +.\"O This functionality allow to set a number of signal level intervals and +.\"O to count the number of packets received in each of those defined +.\"O intervals. +.\"O This distribution might be used to calculate the mean value +.\"O and standard deviation of the signal level. +.SS ¥Ò¥¹¥È¥°¥é¥à (Histogram) +¤³¤Îµ¡Ç½¤Ï¥·¥°¥Ê¥ë¥ì¥Ù¥ë´Ö³Ö¤Î¿ô¤ÎÀßÄê¡¢¤ª¤è¤Ó¡¢¤½¤ì¤é¤ÎÀßÄꤷ¤¿´Ö³Ö¤Î +¤½¤ì¤¾¤ì¤Ç¼õ¿®¤·¤¿¥Ñ¥±¥Ã¥È¤Î¿ô¤ò¥«¥¦¥ó¥È¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£ +¤³¤ÎʬÉۤϥ·¥°¥Ê¥ë¥ì¥Ù¥ë¤ÎºÇÉÎÃÍɸ½àÊк¹¤Î·×»»¤ËÌòΩ¤Ä¤À¤í¤¦¡£ +.\"O .SS "Specific Notes" +.SS ÆÃÄê¤Î¥É¥é¥¤¥Ð¤Ç¤ÎÃí°Õ +.\"O This driver will fail to detect some +.\"O .B non-NCR/ATT&T/Lucent +.\"O Wavelan cards. +.\"O If this happens for you, you must look in the source code on +.\"O how to add your card to the detection routine. +¤³¤Î¥É¥é¥¤¥Ð¤Ï¤¤¤¯¤Ä¤«¤Î +.B NCR/AT&T/Lucent ¤Ç¤Ï¤Ê¤¤ +Wavelan ¥«¡¼¥É¤Î¸¡½Ð¤Ë¼ºÇÔ¤¹¤ë¤À¤í¤¦¡£ +¤³¤ì¤¬¤¢¤Ê¤¿¤Î»ý¤Ã¤Æ¤¤¤ë¥«¡¼¥É¤Çµ¯¤³¤Ã¤¿¾ì¹ç +¡¢¤½¤Î¥«¡¼¥É¤Î¸¡½Ð½èÍý¤ò¤É¤Î¤è¤¦¤Ë²Ã¤¨¤ì¤Ð¤¤¤¤¤«¤È +¤¤¤¦¤³¤È¤Ë¤Ä¤¤¤Æ¥½¡¼¥¹¥³¡¼¥É¤ò³Îǧ¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.PP +.\"O Some of the mentioned features are optional. +.\"O You may enable to disable +.\"O them by changing flags in the driver header and recompile. +¤³¤³¤Þ¤Ç¤Ç½Ò¤Ù¤Æ¤­¤¿µ¡Ç½¤Î¤¦¤Á¤Î¤¤¤¯¤Ä¤«¤Ï¡¢ÁªÂò²Äǽ¤Ç¤¢¤ë¡£ +¥É¥é¥¤¥Ð¤ÎÀèƬÉôʬ¤Î¥Õ¥é¥°¤òÊѹ¹¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤Ê¤ª¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¢ +¤½¤Îµ¡Ç½¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¢¤ë¡£ +.\"O .\" .SH AUTHOR +.SH Ãø¼Ô +.\" Bruce Janson \(em bruce@cs.usyd.edu.au +.\" .br +.\" Jean Tourrilhes \(em jt@hplb.hpl.hp.com +.\" .br +.\"O .\" (and others; see source code for details) +.\" (¤ª¤è¤Ó¡¢¤½¤Î¾¤Î¿Íã; ¾ÜºÙ¤Ï¥½¡¼¥¹¥³¡¼¥É¤ò»²¾È¤Î¤³¤È) +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR wavelan_cs (4), +.BR ifconfig (8), +.BR insmod (8), +.BR iwconfig (8), +.BR iwpriv (8), +.BR iwspy (8) diff --git a/draft/man5/acct.5 b/draft/man5/acct.5 new file mode 100644 index 00000000..76096e9d --- /dev/null +++ b/draft/man5/acct.5 @@ -0,0 +1,250 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-10, Akihiro MOTOKI , LDP v3.05 +.\" +.\"WORD: accounting ¥¢¥«¥¦¥ó¥Æ¥£¥ó¥° +.\" +.TH ACCT 5 2008-06-15 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O acct \- process accounting file +acct \- ¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¡¦¥Õ¥¡¥¤¥ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O If the kernel is built with the process accounting option enabled +.\"O .RB ( CONFIG_BSD_PROCESS_ACCT ), +.\"O then calling +.\"O .BR acct (2) +.\"O starts process accounting, for example: +¥«¡¼¥Í¥ë¤¬¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤Î¥ª¥×¥·¥ç¥ó +.RB ( CONFIG_BSD_PROCESS_ACCT ) +¤òÍ­¸ú¤Ë¤·¤ÆºîÀ®¤µ¤ì¤Æ¤¤¤ë¤È¡¢°Ê²¼¤Î¤è¤¦¤Ë +.BR acct (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤¬³«»Ï¤µ¤ì¤ë¡£ + +.in +4n + acct("/var/log/pacct"); +.in + +.\"O When process accounting is enabled, the kernel writes a record +.\"O to the accounting file as each process on the system terminates. +.\"O This record contains information about the terminated process, +.\"O and is defined in +.\"O .I +.\"O as follows: +¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï +¥·¥¹¥Æ¥à¾å¤Î³Æ¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤¿¤Ó¤Ë¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤Ë +¥ì¥³¡¼¥É¤ò½ñ¤­¹þ¤à¡£ +¤³¤Î¥ì¥³¡¼¥É¤Ï¡¢½ªÎ»¤·¤¿¥×¥í¥»¥¹¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë¤â¤Î¤Ç¡¢ +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +.in +4n +.nf +#define ACCT_COMM 16 + +typedef u_int16_t comp_t; + +struct acct { + char ac_flag; /* Accounting flags */ + u_int16_t ac_uid; /* Accounting user ID */ + u_int16_t ac_gid; /* Accounting group ID */ + u_int16_t ac_tty; /* Controlling terminal */ + u_int32_t ac_btime; /* Process creation time + (seconds since the Epoch) */ + comp_t ac_utime; /* User CPU time */ + comp_t ac_stime; /* System CPU time */ + comp_t ac_etime; /* Elapsed time */ + comp_t ac_mem; /* Average memory usage (kB) */ + comp_t ac_io; /* Characters transferred (unused) */ + comp_t ac_rw; /* Blocks read or written (unused) */ + comp_t ac_minflt; /* Minor page faults */ + comp_t ac_majflt; /* Major page faults */ + comp_t ac_swaps; /* Number of swaps (unused) */ + u_int32_t ac_exitcode; /* Process termination status + (see wait(2)) */ + char ac_comm[ACCT_COMM+1]; + /* Command name (basename of last + executed command; null-terminated) */ + char ac_pad[\fIX\fP]; /* padding bytes */ +}; + +enum { /* Bits that may be set in ac_flag field */ + AFORK = 0x01, /* Has executed fork, but no exec */ + ASU = 0x02, /* Used superuser privileges */ + ACORE = 0x08, /* Dumped core */ + AXSIG = 0x10 /* Killed by a signal */ +}; +.fi +.in +.PP +.\"O The +.\"O .I comp_t +.\"O data type is a floating-point value consisting of a 3-bit, base-8 exponent, +.\"O and a 13-bit mantissa. +.\"O A value, +.\"O .IR c , +.\"O of this type can be converted to a (long) integer as follows: +¥Ç¡¼¥¿·¿ +.I comp_t +¤ÏÉâÆ°¾®¿ôÅÀÃͤǡ¢3 ¥Ó¥Ã¥ÈÉý¤Î´ð¿ô¤¬ 8 ¤Î»Ø¿ôÉô¤È 13 ¥Ó¥Ã¥ÈÉý¤Î²¾¿ôÉô¤«¤é +¹½À®¤µ¤ì¤ë¡£ +.I comp_t +·¿¤ÎÃÍ +.I c +¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ (long ·¿¤Î) À°¿ô¤ËÊÑ´¹¤Ç¤­¤ë¡£ +.nf + + v = (c & 0x1fff) << (((c >> 13) & 0x7) * 3); +.fi +.PP +.\"O The +.\"O .IR ac_utime , +.\"O .IR ac_stime , +.\"O and +.\"O .I ac_etime +.\"O fields measure time in "clock ticks"; divide these values by +.\"O .I sysconf(_SC_CLK_TCK) +.\"O to convert them to seconds. +¥Õ¥£¡¼¥ë¥É +.IR ac_utime , +.IR ac_stime , +.I ac_etime +¤Ï "clock ticks" ñ°Ì¤Ç·×¬¤·¤¿»þ´Ö¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤ÎÃͤò +.I sysconf(_SC_CLK_TCK) +¤Ç³ä¤ë¤È¡¢ÉäËÊÑ´¹¤Ç¤­¤ë¡£ +.\"O .SS Version 3 Accounting File Format +.SS ¥Ð¡¼¥¸¥ç¥ó 3 ¤Î¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.\"O Since kernel 2.6.8, +.\"O an optional alternative version of the accounting file can be produced +.\"O if the +.\"O .B CONFIG_BSD_PROCESS_ACCT_V3 +.\"O option is set when building the kernel. +.\"O With this option is set, +.\"O the records written to the accounting file contain additional fields, +.\"O and the width of +.\"O .I c_uid +.\"O and +.\"O .I ac_gid +.\"O fields is widened from 16 to 32 bits +.\"O (in line with the increased size of UID and GIDs in Linux 2.4 and later). +.\"O The records are defined as follows: +¥«¡¼¥Í¥ë 2.6.8 °Ê¹ß¤Ç¤Ï¡¢ +Ê̤ΥС¼¥¸¥ç¥ó¤Î¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤òÀ¸À®¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢ +¤³¤ì¤ò»È¤¦¤Ë¤Ï¥«¡¼¥Í¥ë¹½ÃÛ»þ¤Ë +.B CONFIG_BSD_PROCESS_ACCT_V3 +¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤ë¤È¡¢¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤ë +¥ì¥³¡¼¥É¤Ë¥Õ¥£¡¼¥ë¥É¤¬Äɲ䵤ì¤ë¡£ +¤Þ¤¿¡¢¥Õ¥£¡¼¥ë¥É +.I c_uid +¤È +.I ac_gid +¤ÎÉý¤¬ 16 ¥Ó¥Ã¥È¤«¤é 32 ¥Ó¥Ã¥È¤Ë³ÈÄ¥¤µ¤ì¤ë +(¤³¤ì¤Ï Linux 2.4 °Ê¹ß¤Ç UID ¤È GID ¤Î¥µ¥¤¥º¤¬Áý¤¨¤Æ¤¤¤ë¤Î¤Ë +Âбþ¤·¤¿¤â¤Î¤Ç¤¢¤ë)¡£ +¤³¤Î¥ì¥³¡¼¥É¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct acct_v3 { + char ac_flag; /* Flags */ + char ac_version; /* Always set to ACCT_VERSION (3) */ + u_int16_t ac_tty; /* Controlling terminal */ + u_int32_t ac_exitcode; /* Process termination status */ + u_int32_t ac_uid; /* Real user ID */ + u_int32_t ac_gid; /* Real group ID */ + u_int32_t ac_pid; /* Process ID */ + u_int32_t ac_ppid; /* Parent process ID */ + u_int32_t ac_btime; /* Process creation time */ + float ac_etime; /* Elapsed time */ + comp_t ac_utime; /* User CPU time */ + comp_t ac_stime; /* System time */ + comp_t ac_mem; /* Average memory usage (kB) */ + comp_t ac_io; /* Characters transferred (unused) */ + comp_t ac_rw; /* Blocks read or written + (unused) */ + comp_t ac_minflt; /* Minor page faults */ + comp_t ac_majflt; /* Major page faults */ + comp_t ac_swaps; /* Number of swaps (unused) */ + char ac_comm[ACCT_COMM]; /* Command name */ +}; + +.fi +.in +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The +.\"O .I acct_v3 +.\"O structure is defined in glibc since version 2.6. +.I acct_v3 +¹½Â¤ÂΤϥС¼¥¸¥ç¥ó 2.6 °Ê¹ß¤Î glibc ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH CONFORMING TO +.SH ½àµò +.\"O Process accounting originated on BSD. +.\"O Although it is present on most systems, it is not standardized, +.\"O and the details vary somewhat between systems. +¥×¥í¥»¥¹¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤Ï BSD ͳÍè¤Ç¤¢¤ë¡£ +¤³¤Îµ¡Ç½¤Ï¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¤¬¡¢É¸½à²½¤µ¤ì¤Æ¤ª¤é¤º¡¢ +¤½¤Î¾ÜºÙ¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤ê¤¤¤¯¤é¤«°Û¤Ê¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Records in the accounting file are ordered by termination time of +.\"O the process. +¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤Î¥ì¥³¡¼¥É¤Ï¡¢¥×¥í¥»¥¹¤Î½ªÎ»»þ¹ï¤Î½ç½ø¤È¤Ê¤ë¡£ + +.\"O In kernels up to and including 2.6.9, +.\"O a separate accounting record is written for each thread created using +.\"O the NPTL threading library; +.\"O since Linux 2.6.10, +.\"O a single accounting record is written for the entire process +.\"O on termination of the last thread in the process. +¥Ð¡¼¥¸¥ç¥ó 2.6.9 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +NPTL ¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥¹¥ì¥Ã¥É¤Ç¤Ï +¥¹¥ì¥Ã¥ÉËè¤ËÊÌ¡¹¤Î¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥ì¥³¡¼¥É¤¬½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤¿¡£ +Linux 2.6.10 °Ê¹ß¤Ç¤Ï¡¢¥×¥í¥»¥¹Æâ¤ÎºÇ¸å¤Î¥¹¥ì¥Ã¥É¤¬½ªÎ»¤¹¤ë¤È¡¢ +¥×¥í¥»¥¹Á´ÂΤˤĤ¤¤Æ¤Î¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥ì¥³¡¼¥É¤¬°ì¤Ä¤À¤±½ñ¤­¹þ¤Þ¤ì¤ë¡£ + +.\"O The +.\"O .I proc/sys/kernel/acct +.\"O file, described in +.\"O .BR proc (5), +.\"O defines settings that control the behavior of process accounting +.\"O when disk space runs low. +.I proc/sys/kernel/acct +¥Õ¥¡¥¤¥ë +.RB ( proc (5) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë) ¤Ï¡¢¥Ç¥£¥¹¥¯ÍÆÎ̤λĤ꤬¾¯¤Ê¤¯¤Ê¤Ã¤¿ºÝ¤Î +¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤ÎÆ°ºî¤òÀ©¸æ¤¹¤ëÀßÄê¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR lastcomm (1), +.BR acct (2), +.BR accton (8), +.BR sa (8) diff --git a/draft/man5/charmap.5 b/draft/man5/charmap.5 new file mode 100644 index 00000000..8848b14b --- /dev/null +++ b/draft/man5/charmap.5 @@ -0,0 +1,200 @@ +.\" Hey emacs, this is -*- nroff -*- +.\" +.\" This file is part of locale(1) which displays the settings of the +.\" current locale. +.\" Copyright (C) 1994 Jochen Hein (Hein@Student.TU-Clausthal.de) +.\" +.\" 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, USA. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Thu Feb 5 21:12:56 JST 1998 +.\" by HANATAKA Shinya +.\" Updated Wed Jan 9 JST 2001 by Kentaro Shirakata +.\" +.TH CHARMAP 5 1994-11-28 "" "Linux User Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O charmap \- character symbols to define character encodings +charmap \- ʸ»úÉä¹æ²½¤òÄêµÁ¤¹¤ë¤¿¤á¤Îʸ»ú¥·¥ó¥Ü¥ë +.\"O .SH DESCRIPTION +.SH ½ñ¼° +.\"O A character set description (charmap) defines a character set of +.\"O available characters and their encodings. +.\"O All supported character +.\"O sets should have the +.\"O .B portable character set +.\"O as a proper subset. +.\"O .\" Not true anymore: +.\"O .\" The portable character set is defined in the file +.\"O .\" .I /usr/lib/nls/charmap/POSIX +.\"O .\" .I /usr/share/i18n/charmap/POSIX +.\"O .\" for reference purposes. +ʸ»ú½¸¹çµ­½Ò (charmap) ¤Ï»ÈÍѤǤ­¤ëʸ»ú½¸¹ç¤È¤½¤ÎÉä¹æ²½¤òÄêµÁ¤¹¤ë¡£ +¥µ¥Ý¡¼¥È¤µ¤ì¤ëÁ´¤Æ¤Îʸ»ú½¸¹ç¤ÏÂÅÅö¤Ê¥µ¥Ö¥»¥Ã¥È¤È¤·¤Æ +.B "¶¦ÄÌʸ»ú½¸¹ç (portable character set)" +¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" °Ê²¼¤Ï¤â¤Ï¤äÀµ¤·¤¯¤Ê¤¤: +.\" ¶¦ÄÌʸ»ú½¸¹ç¤Ï»²¾ÈÍÑ¤Ë +.\" .I /usr/lib/nls/charmap/POSIX +.\" .I /usr/share/i18n/charmap/POSIX +.\" ¥Õ¥¡¥¤¥ë¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS Syntax +.SS ʸˡ +.\"O The charmap file starts with a header, that may consist of the +.\"O following keywords: +charmap ¥Õ¥¡¥¤¥ë¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤«¤é¤Ê¤ë¥Ø¥Ã¥À¡¼¤Ç»Ï¤Þ¤ë: +.TP +.\"O .I +.\"O is followed by the name of the codeset. +.I +¤Ï¥³¡¼¥É¥»¥Ã¥È¤Î̾Á°¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I +.\"O is followed by the max number of bytes for a multibyte-character. +.\"O Multibyte characters are currently not supported. +.\"O The default value +.\"O is 1. +.I +¤ÏÊ£¿ô¥Ð¥¤¥Èʸ»ú¤Î°ìʸ»ú¤¢¤¿¤ê¤ÎºÇÂç¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£ +Ê£¿ô¥Ð¥¤¥Èʸ»ú¤Ï¸½ºß¤Î¤È¤³¤í¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£¥Ç¥Õ¥©¥ë¥È¤Ï 1 ¤Ç¤¢¤ë¡£ +.TP +.\"O .I +.\"O is followed by the min number of bytes for a character. +.\"O This +.\"O value must be less or equal than +.\"O .BR mb_cur_max . +.\"O If not specified, it defaults to +.\"O .BR mb_cur_max . +.I +¤Ï°ìʸ»ú¤¢¤¿¤ê¤ÎºÇÄã¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£¤³¤ÎÃÍ¤Ï +.B mb_cur_max +°Ê²¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤â¤·»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¥Ç¥Õ¥©¥ë¥È¤Ï +.B mb_cur_max +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.TP +.\"O .I +.\"O is followed by a character that should be used as the +.\"O escape-character for the rest of the file to mark characters that +.\"O should be interpreted in a special way. +.\"O It defaults to +.\"O the backslash ( +.\"O .B \\\\ +.\"O ). +.I +¥Õ¥¡¥¤¥ë¤Î»Ä¤ê¤ÎÉôʬ¤Ç¥¨¥¹¥±¡¼¥×¡¦¥­¥ã¥é¥¯¥¿¡¼¤È¤·¤Æ»ÈÍѤ¹¤ëʸ»ú +¤ò»ØÄꤹ¤ë¡£¤³¤ì¤ÇÆüì¤Ê°ÕÌ£¤Ë²ò¼á¤µ¤ì¤ëʸ»ú¤ò¥¨¥¹¥±¡¼¥×¤¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å +.RB ( \e ) +¤Ç¤¢¤ë¡£ +.TP +.I +¤Ï¥Õ¥¡¥¤¥ë¤Î»Ä¤ê¤ÎÉôʬ¤Ç¥³¥á¥ó¥È¡¦¥­¥ã¥é¥¯¥¿¡¼¤È¤·¤Æ»ÈÍѤ¹¤ëʸ»ú +¤ò»ØÄꤹ¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥·¥ã¡¼¥× +.RB ( # ) +¤Ç¤¢¤ë¡£ +.PP +.\"O The charmap-definition itself starts with the keyword +.\"O .B CHARMAP +.\"O in column 1. +charmap ¤ÎÄêµÁ¤½¤Î¤â¤Î¤ÏÂè°ì¥«¥é¥à¤Ë¥­¡¼¥ï¡¼¥É +.B CHARMAP +¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +.\"O The following lines may have one of the two following forms to +.\"O define the character-encodings: +°Ê²¼¤Î¹Ô¤Ïʸ»ú¤ÎÉä¹æ²½¤òÄêµÁ¤¹¤ë¤¿¤á¤ÎÆó¤Ä¤ÎÊýË¡¤Ç¤¢¤ë: +.TP +.I +.\"O This form defines exactly one character and its encoding. +¤³¤ì¤Ï°ì¤Ä¤Îʸ»ú¤È¤½¤ÎÉä¹æ²½¤òÄêµÁ¤¹¤ë¡£ +.TP +.I ... +.\"O This form defines a couple of characters. +.\"O This is only useful for +.\"O multibyte-characters, which are currently not implemented. +¤³¤Î·Á¼°¤ÏÊ£¿ô¤Îʸ»ú¤òÄêµÁ¤¹¤ë¡£¤³¤ì¤ÏÊ£¿ô¥Ð¥¤¥Èʸ»ú (¸½ºß¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +¤Î¤ß¤ÇÍ­ÍѤǤ¢¤ë¡£ +.PP +.\"O The last line in a charmap-definition file must contain +.\"O .B END CHARMAP. +charmap ¤ÎÄêµÁ¤ÎºÇ¸å¤Î¹Ô¤Ï +.B END CHARMAP +¤òÃÖ¤¯¡£ +.\"O .SS "Symbolic Names" +.SS ¥·¥ó¥Ü¥ë̾ +.\"O A +.\"O .B symbolic name +.\"O for a character contains only characters of the +.\"O .B portable character set. +.\"O The name itself is enclosed between angle brackets. +ʸ»ú¤Î +.B ¥·¥ó¥Ü¥ë̾ (symbolic name) +¤Ï +.B ¶¦ÄÌʸ»ú½¸¹ç(portable character set) +¤Îʸ»ú¤Î¤ß¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +¤³¤Î̾Á°¤Ï¤«¤®¤«¤Ã¤³ < > ¤Ç¶´¤à¡£ +.\"O Characters following an +.\"O .B +.\"O are interpreted as itself; for example, the sequence +.\"O .B "<\\\\\\\\\\\\>>" +.\"O represents the symbolic name +.\"O .B "\\\\>" +.\"O enclosed in angle brackets. +.B +¤Ë³¤¯Ê¸»ú¤Ï¤½¤ì¼«¿È¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£Î㤨¤Ð +.B "<\e\e\e>>" +¤Î¤è¤¦¤Êʸ»úÎó¤Ï +.B "\e>" +¤È¤¤¤¦¥·¥ó¥Ü¥ë̾¤ò¤«¤®¤«¤Ã¤³¤Ç¶¹¤ó¤Çɽ¸½¤·¤Æ¤¤¤ë¡£ +.\"O .SS "Character Encoding" +.SS ʸ»úÉä¹æ²½ +.\"O The +.\"O encoding may be in each of the following three forms: +Éä¹æ²½¤Ï°Ê²¼¤Î»°¤Ä¤Î·Á¼°¤Î¤É¤ì¤«¤Çɽ¤¹: +.TP +.\"O .I d +.\"O with a decimal number +.I d<¿ô»ú> +¤Ï 10 ¿Ê¤Î¿ôÃͤòɽ¤¹¡£ +.TP +.\"O .I x +.\"O with a hexadecimal number +.I x<¿ô»ú> +¤Ï 16 ¿Ê¤Î¿ôÃͤòɽ¤¹¡£ +.TP +.\"O .I +.\"O with an octal number. +.I <¿ô»ú> +¤Ï 8 ¿Ê¤Î¿ôÃͤòɽ¤¹¡£ +.\" FIXME comments +.\" FIXME char ... char +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.I /usr/share/i18n/charmaps/* +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\" Jochen Hein (jochen.hein@delphi.central.de) +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.2. +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR locale (1), +.BR localedef (1), +.BR localeconv (3), +.BR setlocale (3), +.BR locale (5) diff --git a/draft/man5/core.5 b/draft/man5/core.5 new file mode 100644 index 00000000..87608792 --- /dev/null +++ b/draft/man5/core.5 @@ -0,0 +1,593 @@ +.\" Copyright (c) 2006, 2008 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. +.\" +.\" Japanese Version Copyright (c) 2006-2008 Akihiro MOTOKI +.\" Translated 2006-04-15, Akihiro MOTOKI +.\" Updated 2007-01-05, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2007-09-03, Akihiro MOTOKI, LDP v2.64 +.\" Updated 2008-08-10, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-09-19, Akihiro MOTOKI, LDP v3.08 +.\" +.TH CORE 5 2010-02-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O core \- core dump file +core \- ¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The default action of certain signals is to cause a process to terminate +.\"O and produce a +.\"O .IR "core dump file" , +.\"O a disk file containing an image of the process's memory at +.\"O the time of termination. +.\"O This image can be used in a debugger (e.g., +.\"O .BR gdb (1)) +.\"O to inspect the state of the program at the time that it terminated. +.\"O A list of the signals which cause a process to dump core can be found in +.\"O .BR signal (7). +¤¢¤ë¼ï¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±¤¿¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥¢¥¯¥·¥ç¥ó¤Ï¡¢ +¥×¥í¥»¥¹¤ò½ªÎ»¤· (terminate)¡¢ +.I "¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë (core dump file)" +¤òÀ¸À®¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Ï¡¢¥Ç¥£¥¹¥¯¾å¤ËÀ¸À®¤µ¤ì¤ë +½ªÎ»»þ¤Î¥×¥í¥»¥¹¤Î¥á¥â¥ê¥¤¥á¡¼¥¸¤òÆâÍƤȤ¹¤ë¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +¤³¤Î¥¤¥á¡¼¥¸¤ò¥Ç¥Ð¥Ã¥¬ (Î㤨¤Ð +.BR gdb (1)) +¤ËÆɤ߹þ¤ó¤Ç¡¢ +¥×¥í¥°¥é¥à¤¬½ªÎ»¤·¤¿»þÅÀ¤Î¥×¥í¥°¥é¥à¤Î¾õÂÖ¤ò¸¡ºº¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤É¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±¤¿¤È¤­¤Ë¥×¥í¥»¥¹¤¬¥³¥¢¥À¥ó¥×¤òÀ¸À®¤¹¤ë¤«¤Î¥ê¥¹¥È¤Ï +.BR signal (7) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ + +.\"O A process can set its soft +.\"O .B RLIMIT_CORE +.\"O resource limit to place an upper limit on the size of the core dump file +.\"O that will be produced if it receives a "core dump" signal; see +.\"O .BR getrlimit (2) +.\"O for details. +¥×¥í¥»¥¹¤Ï¥½¥Õ¥È¡¦¥ê¥½¡¼¥¹À©¸Â +.B RLIMIT_CORE +¤òÀßÄꤹ¤ë¤³¤È¤Ç¡¢¡Ö¥³¥¢¥À¥ó¥×¡×¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤¿ºÝ¤ËÀ¸À®¤µ¤ì¤ë +¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤Ë¾å¸Â¤ò²Ý¤¹¤³¤È¤¬¤Ç¤­¤ë¡£¾ÜºÙ¤Ï +.BR getrlimit (2) +¤ò»²¾È¡£ + +.\"O There are various circumstances in which a core dump file is +.\"O not produced: +¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤¬À¸À®¤µ¤ì¤Ê¤¤¾õ¶·¤¬¤¤¤¯¤Ä¤«¤¢¤ë: +.IP * 3 +.\"O The process does not have permission to write the core file. +.\"O (By default the core file is called +.\"O .IR core , +.\"O and is created in the current working directory. +.\"O See below for details on naming.) +.\"O Writing the core file will fail if the directory in which +.\"O it is to be created is nonwritable, +.\"O or if a file with the same name exists and +.\"O is not writable +.\"O or is not a regular file +.\"O (e.g., it is a directory or a symbolic link). +¥×¥í¥»¥¹¤¬¥³¥¢¥Õ¥¡¥¤¥ë¤ò½ñ¤­¹þ¤àµö²Ä¤ò»ý¤¿¤Ê¤¤¾ì¹ç +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥³¥¢¥Õ¥¡¥¤¥ë¤Ï +.I core +¤È¤¤¤¦Ì¾Á°¤Ç¡¢¥«¥ì¥ó¥È¡¦¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ËÀ¸À®¤µ¤ì¤ë¡£ +̿̾µ¬Â§¤Î¾ÜºÙ¤Ï²¼µ­¤ò»²¾È)¡£ +¥³¥¢¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤è¤¦¤È¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬½ñ¤­¹þ¤ß²Äǽ¤Ç¤Ê¤¤¾ì¹ç¡¢ +¤â¤·¤¯¤ÏƱ¤¸Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬½ñ¤­¹þ¤ß²Äǽ¤Ç¤â +Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤â¤Ê¤¤¾ì¹ç (Î㤨¤Ð¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ä¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯)¡¢ +¥³¥¢¥Õ¥¡¥¤¥ë¤ÎÀ¸À®¤Ï¼ºÇÔ¤¹¤ë¡£ +.IP * +.\"O A (writable, regular) file with the same name as would be used for the +.\"O core dump already exists, but there is more than one hard link to that +.\"O file. +¥³¥¢¥À¥ó¥×¤Ë»È¤ª¤¦¤È¤·¤¿¤Î¤ÈƱ¤¸Ì¾Á°¤Î (½ñ¤­¹þ¤ß²Äǽ¤Ê¡¢Ä̾ï¤Î) ¥Õ¥¡¥¤¥ë¤¬ +¤¹¤Ç¤Ë¸ºß¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥Ï¡¼¥É¥ê¥ó¥¯¤¬ 2¸Ä°Ê¾å¤¢¤ë¾ì¹ç¡£ +.IP * +.\"O The file system where the core dump file would be created is full; +.\"O or has run out of inodes; or is mounted read-only; +.\"O or the user has reached their quota for the file system. +¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤è¤¦¤È¤·¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Õ¥ë¤Ç¤¢¤ë¤«¡¢ +inode ¤¬Á´¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤ë¤«¡¢Æɤ߹þ¤ßÀìÍѤǥޥ¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡£ +¤Þ¤¿¤Ï¡¢¤½¤Î¥æ¡¼¥¶¤Î¥Ç¥£¥¹¥¯»ÈÍÑÎ̤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î +¥¯¥ª¡¼¥¿ (quota) ¤Ë㤷¤Æ¤¤¤ë¡£ +.IP * +.\"O The directory in which the core dump file is to be created does +.\"O not exist. +¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤è¤¦¤È¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡£ +.IP * +.\"O The +.\"O .B RLIMIT_CORE +.\"O (core file size) or +.\"O .B RLIMIT_FSIZE +.\"O (file size) resource limits for the process are set to zero; see +.\"O .BR getrlimit (2) +.\"O and the documentation of the shell's +.\"O .I ulimit +.\"O command +.\"O .RI ( limit +.\"O in +.\"O .BR csh (1)). +¥×¥í¥»¥¹Ëè¤Î¥ê¥½¡¼¥¹À©¸Â +.B RLIMIT_CORE +(¥³¥¢¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º) ¤« +.B RLIMIT_FSIZE +(¥Õ¥¡¥¤¥ë¥µ¥¤¥º) ¤¬ 0 ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡£ +.BR getrlimit (2) +¤ä¥·¥§¥ë¤Î +.I ulimit +¥³¥Þ¥ó¥É¤Î¥É¥­¥å¥á¥ó¥È +.RB ( csh (1) +¤Î +.IR limit ) +¤ò»²¾È¡£ +.IP * +.\"O The binary being executed by the process does not have read +.\"O permission enabled. +¥×¥í¥»¥¹¤¬¼Â¹Ô¤·¤¿¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë¤ÎÆɤ߽Ф·µö²Ä¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡£ +.IP * +.\"O The process is executing a set-user-ID (set-group-ID) program +.\"O that is owned by a user (group) other than the real user (group) +.\"O ID of the process. +.\"O (However, see the description of the +.\"O .BR prctl (2) +.\"O .B PR_SET_DUMPABLE +.\"O operation, and the description of the +.\"O .I /proc/sys/fs/suid_dumpable +.\"O .\" FIXME . Perhaps relocate discussion of /proc/sys/fs/suid_dumpable +.\"O .\" and PR_SET_DUMPABLE to this page? +.\"O file in +.\"O .BR proc (5).) +¥×¥í¥»¥¹¤¬¼Â¹Ô¤·¤Æ¤¤¤ë set-user-ID (set-group-ID) ¥×¥í¥°¥é¥à¤Î½êÍ­¼Ô¤Î +¥æ¡¼¥¶ (¥°¥ë¡¼¥×) ¤¬¡¢¥×¥í¥»¥¹¤Î¼Â UID (¼Â GID) ¤È°Û¤Ê¤ë¾ì¹ç +(⤷¡¢ +.BR prctl (2) +.B PR_SET_DUMPABLE +Áàºî¤ÎÀâÌÀ¤È¡¢ +.BR proc (5) +¤Î +.I /proc/sys/fs/suid_dumpable +¥Õ¥¡¥¤¥ë¤ÎÀâÌÀ¤â»²¾È¤Î¤³¤È)¡£ +.\" FIXME . Perhaps relocate discussion of /proc/sys/fs/suid_dumpable +.\" and PR_SET_DUMPABLE to this page? +.\"O .SS Naming of core dump files +.SS ¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î̾Á° +.\"O By default, a core dump file is named +.\"O .IR core , +.\"O but the +.\"O .I /proc/sys/kernel/core_pattern +.\"O file (since Linux 2.6 and 2.4.21) +.\"O can be set to define a template that is used to name core dump files. +.\"O The template can contain % specifiers which are substituted +.\"O by the following values when a core file is created: +.\" motoki XXX Ʊ¤¸ÆâÍƤ¬½ÅÊ£¤·¤Æ½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î̾Á°¤Ï +.I core +¤È¤Ê¤ë¤¬¡¢¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î̾Á°¤ò·è¤á¤ë¤Î¤Ë»È¤ï¤ì¤ë¥Æ¥ó¥×¥ì¡¼¥È¤ò +.I /proc/sys/kernel/core_pattern +¥Õ¥¡¥¤¥ë¤ËÄêµÁ¤¹¤ë¤³¤È¤Ç¡¢¥Õ¥¡¥¤¥ë̾¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.RI ( /proc/sys/kernel/core_pattern +¤Ï Linux 2.6 ¤ª¤è¤Ó 2.4.21 °Ê¹ß¤ÇÍøÍѤǤ­¤ë)¡£ +¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤Ï % »Ø¼¨»Ò (specifier) ¤òÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ï¥³¥¢¥Õ¥¡¥¤¥ë¤¬À¸À®¤µ¤ì¤ëºÝ¤Ë¡¢°Ê²¼¤ÎÃͤËÃÖ¤­´¹¤¨¤é¤ì¤ë¡£ +.PP +.RS 4 +.PD 0 +.TP 4 +%% +.\"O a single % character +1 ¤Ä¤Î % ʸ»ú +.TP +%p +.\"O PID of dumped process +¥À¥ó¥×¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ID (PID) +.TP +%u +.\"O (numeric) real UID of dumped process +¥À¥ó¥×¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID (real UID) +.TP +%g +.\"O (numeric) real GID of dumped process +¥À¥ó¥×¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¼Â¥°¥ë¡¼¥× ID (real GID) +.TP +%s +.\"O number of signal causing dump +¥À¥ó¥×¤ò°ú¤­µ¯¤³¤·¤¿¥·¥°¥Ê¥ë¤ÎÈÖ¹æ +.TP +%t +.\"O time of dump, expressed as seconds since the +.\"O Epoch, 1970-01-01 00:00:00 +0000 (UTC) +¥À¥ó¥×»þ¹ï¡¢µª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) +¤«¤é¤ÎÉÿô¡£ +.TP +%h +.\"O hostname (same as \fInodename\fP returned by \fBuname\fP(2)) +¥Û¥¹¥È̾ (\fBuname\fP(2) ¤ÇÊÖ¤µ¤ì¤ë \fInodename\fP ¤ÈƱ¤¸) +.TP +%e +.\"O executable filename (without path prefix) +¼Â¹Ô¥Õ¥¡¥¤¥ë̾ (¥Ñ¥¹Ì¾¤Î¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤Ï´Þ¤Þ¤ì¤Ê¤¤) +.TP +%c +.\"O core file size soft resource limit of crashing process (since Linux 2.6.24) +¥¯¥é¥Ã¥·¥å¤·¤¿¥×¥í¥»¥¹¤Î¥³¥¢¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤Ë´Ø¤¹¤ë¥½¥Õ¥È¥ê¥½¡¼¥¹¾å¸Â +(Linux 2.6.24 °Ê¹ß) +.PD +.RE +.PP +.\"O A single % at the end of the template is dropped from the +.\"O core filename, as is the combination of a % followed by any +.\"O character other than those listed above. +¥Æ¥ó¥×¥ì¡¼¥È¤ÎËöÈø¤Ë 1 ¸Ä¤À¤± % ¤¬¤¢¤ë¾ì¹ç¡¢ +¤½¤Î % ¤Ï¥³¥¢¥Õ¥¡¥¤¥ë̾¤Ë¤Ï´Þ¤á¤é¤ì¤Ê¤¤¡£¤Þ¤¿¡¢¾å¤ÇÎóµó¤µ¤ì¤Æ +¤¤¤Ê¤¤ % ¤Èʸ»ú¤ÎÁȤ߹ç¤ï¤»¤¬¤¢¤Ã¤¿¾ì¹ç¤âƱÍͤǤ¢¤ë¡£ +.\"O All other characters in the template become a literal +.\"O part of the core filename. +¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤ª¤±¤ë¾¤Îʸ»ú¤Ï¡¢ +¥³¥¢¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ¤½¤Î¤Þ¤Þ»È¤ï¤ì¤ë¡£ +.\"O The template may include \(aq/\(aq characters, which are interpreted +.\"O as delimiters for directory names. +¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤Ï \(aq/\(aq ʸ»ú¤òÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¡¢ +¥Ç¥£¥ì¥¯¥È¥ê̾¤Î¶èÀÚ¤êʸ»ú¤È²ò¼á¤µ¤ì¤ë¡£ +.\"O The maximum size of the resulting core filename is 128 bytes (64 bytes +.\"O in kernels before 2.6.19). +·ë²Ì¤È¤·¤ÆÀ¸À®¤µ¤ì¤ë¥³¥¢¥Õ¥¡¥¤¥ë̾¤ÎºÇÂ祵¥¤¥º¤Ï 128 ¥Ð¥¤¥È¤Ç¤¢¤ë +(2.6.19 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï 64 ¥Ð¥¤¥È)¡£ +.\"O The default value in this file is "core". +¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï "core" ¤Ç¤¢¤ë¡£ +.\"O For backward compatibility, if +.\"O .I /proc/sys/kernel/core_pattern +.\"O does not include "%p" and +.\"O .I /proc/sys/kernel/core_uses_pid +.\"O (see below) +.\"O is nonzero, then .PID will be appended to the core filename. +°ÊÁ°¤Î¤â¤Î¤È¤Î¸ß´¹À­¤Î¤¿¤á¡¢ +.I /proc/sys/kernel/core_pattern +¤Ë "%p" ¤¬´Þ¤Þ¤ì¤º¡¢ +¤«¤Ä +.I /proc/sys/kernel/core_uses_pid +(²¼µ­»²¾È) ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢.PID ¤¬¥³¥¢¥Õ¥¡¥¤¥ë̾¤ËÄɲ䵤ì¤ë¡£ + +.\"O Since version 2.4, Linux has also provided +.\"O a more primitive method of controlling +.\"O the name of the core dump file. +.\"O If the +.\"O .I /proc/sys/kernel/core_uses_pid +.\"O file contains the value 0, then a core dump file is simply named +.\"O .IR core . +.\"O If this file contains a nonzero value, then the core dump file includes +.\"O the process ID in a name of the form +.\"O .IR core.PID . +¥Ð¡¼¥¸¥ç¥ó 2.4 °Ê¹ß¤Î Linux ¤Ç¤Ï +¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î̾Á°¤òÀ©¸æ¤¹¤ë¸¶»ÏŪ¤ÊÊýË¡¤âÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.I /proc/sys/kernel/core_uses_pid +¥Õ¥¡¥¤¥ë¤ËÃÍ 0 ¤¬½ñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Ïñ½ã¤Ë +.I core +¤È¤¤¤¦Ì¾Á°¤Ë¤Ê¤ë¡£¤³¤Î¥Õ¥¡¥¤¥ë¤Ë 0 °Ê³°¤ÎÃͤ¬½ñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Ï +.I core.PID +¤È¤¤¤¦·Á¼°¤Î̾Á°¤Ë¤Ê¤ê¡¢¥Õ¥¡¥¤¥ë̾¤Ë¥×¥í¥»¥¹ ID ¤¬´Þ¤Þ¤ì¤ë¡£ +.\"O .SS Piping core dumps to a program +.SS ¥³¥¢¥À¥ó¥×¤Î¥×¥í¥°¥é¥à¤Ø¤Î¥Ñ¥¤¥× +.\"O Since kernel 2.6.19, Linux supports an alternate syntax for the +.\"O .I /proc/sys/kernel/core_pattern +.\"O file. +.\"O If the first character of this file is a pipe symbol (\fB|\fP), +.\"O then the remainder of the line is interpreted as a program to be +.\"O executed. +.\"O Instead of being written to a disk file, the core dump is given as +.\"O standard input to the program. +.\"O Note the following points: +¥«¡¼¥Í¥ë 2.6.19 °Ê¹ß¤Ç¤Ï¡¢Linux ¤Ï +.I /proc/sys/kernel/core_pattern +¥Õ¥¡¥¤¥ë¤ÎÊ̤ι½Ê¸¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤ÎºÇ½é¤Îʸ»ú¤¬¥Ñ¥¤¥×µ­¹æ (\fB|\fP) ¤Ç¤¢¤ì¤Ð¡¢ +¤½¤Î¹Ô¤Î»Ä¤ê¤ÎÉôʬ¤Ï¼Â¹Ô¤¹¤ë¥×¥í¥°¥é¥à¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +¥³¥¢¥À¥ó¥×¤Ï¡¢¥Ç¥£¥¹¥¯¾å¤Î¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥×¥í¥°¥é¥à¤Îɸ½àÆþÎϤȤ·¤ÆÅϤµ¤ì¤ë¡£ +°Ê²¼¤ÎÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.IP * 3 +.\"O The program must be specified using an absolute pathname (or a +.\"O pathname relative to the root directory, \fI/\fP), +.\"O and must immediately follow the '|' character. +¥×¥í¥°¥é¥à¤ÏÀäÂХѥ¹Ì¾ (¤â¤·¤¯¤Ï¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê \fI/\fP ¤«¤é¤Î +ÁêÂХѥ¹Ì¾) ¤Ç»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤Þ¤¿¡¢'|' ʸ»ú¤Îľ¸å¤«¤é»Ï¤á¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP * +.\"O The process created to run the program runs as user and group +.\"O .IR root . +¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤ËÀ¸À®¤µ¤ì¤ë¥×¥í¥»¥¹¤Ï¡¢ +¥æ¡¼¥¶¡¢¥°¥ë¡¼¥×¤È¤â +.I root +¤È¤·¤Æ¼Â¹Ô¤µ¤ì¤ë¡£ +.IP * +.\"O Command-line arguments can be supplied to the +.\"O program (since kernel 2.6.24), +.\"O delimited by white space (up to a total line length of 128 bytes). +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ò¥×¥í¥°¥é¥à¤ËÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­ (¥«¡¼¥Í¥ë 2.6.24 °Ê¹ß)¡¢ +°ú¤­¿ô¤Ï¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤Ç¶èÀÚ¤ë +(1¹Ô¤ÎºÇÂçĹ¤Ï 128 ¥Ð¥¤¥È¤¬¾å¸Â¤Ç¤¢¤ë)¡£ +.IP * +.\"O The command-line arguments can include any of +.\"O the % specifiers listed above. +.\"O For example, to pass the PID of the process that is being dumped, specify +.\"O .I %p +.\"O in an argument. +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ë¤Ï¡¢¾åµ­¤Î¥ê¥¹¥È¤Ë¤¢¤ë % »Ø¼¨»Ò¤ò´Þ¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Î㤨¤Ð¡¢¥À¥ó¥×¤µ¤ì¤ë¥×¥í¥»¥¹¤Î PID ¤òÅϤ¹¤Ë¤Ï¡¢ +°ú¤­¿ô¤Ë +.I %p +¤ò»ØÄꤹ¤ë¡£ +.\"O .SS Controlling which mappings are written to the core dump +.SS ¤É¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¥³¥¢¥À¥ó¥×¤Ë½ñ¤­¹þ¤à¤«¤òÀ©¸æ¤¹¤ë +.\"O Since kernel 2.6.23, the Linux-specific +.\"O .IR /proc/PID/coredump_filter +.\"O file can be used to control which memory segments are written to the +.\"O core dump file in the event that a core dump is performed for the +.\"O process with the corresponding process ID. +¥«¡¼¥Í¥ë 2.6.23 °Ê¹ß¤Ç¤Ï¡¢Linux ¸ÇÍ­¤Î¥Õ¥¡¥¤¥ë +.I /proc/PID/coredump_filter +¤ò»È¤Ã¤Æ¡¢Âбþ¤¹¤ë¥×¥í¥»¥¹ ID ¤ò»ý¤Ä¥×¥í¥»¥¹¤ËÂФ·¤Æ¥³¥¢¥À¥ó¥×¤¬¹Ô¤ï¤ì¤ë +ºÝ¤Ë¡¢¤É¤Î¥á¥â¥ê¥»¥°¥á¥ó¥È¤ò¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à¤«¤òÀ©¸æ¤Ç¤­¤ë¡£ + +.\"O The value in the file is a bit mask of memory mapping types (see +.\"O .BR mmap (2)). +.\"O If a bit is set in the mask, then memory mappings of the +.\"O corresponding type are dumped; otherwise they are not dumped. +.\"O The bits in this file have the following meanings: +¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÃͤϥá¥â¥ê¥Þ¥Ã¥Ô¥ó¥°¼ïÊÌ +.RB ( mmap (2) +»²¾È) ¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +¥Þ¥¹¥¯Æâ¤Î¤¢¤ë¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢¤½¤Î¥Ó¥Ã¥È¤ËÂбþ¤¹¤ë¼ïÊ̤Π+¥á¥â¥ê¥Þ¥Ã¥Ô¥ó¥°¤¬¥À¥ó¥×¤µ¤ì¤ë¡£¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤Ï¥À¥ó¥×¤µ¤ì¤Ê¤¤¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î³Æ¥Ó¥Ã¥È¤Ï°Ê²¼¤Î°ÕÌ£¤ò»ý¤Ä¡£ +.PP +.PD 0 +.RS 4 +.TP +bit 0 +.\"O Dump anonymous private mappings. +̵̾¤Î¥×¥é¥¤¥Ù¡¼¥È¥Þ¥Ã¥Ô¥ó¥° (anonymous private mappings) ¤ò¥À¥ó¥×¤¹¤ë¡£ +.TP +bit 1 +.\"O Dump anonymous shared mappings. +̵̾¤Î¶¦Í­¥Þ¥Ã¥Ô¥ó¥° (anonymous shared mappings) ¤ò¥À¥ó¥×¤¹¤ë¡£ +.TP +bit 2 +.\"O Dump file-backed private mappings. +¥Õ¥¡¥¤¥ë¤È´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥×¥é¥¤¥Ù¡¼¥È¥Þ¥Ã¥Ô¥ó¥° +(file-backed private mappings) ¤ò¥À¥ó¥×¤¹¤ë¡£ +.TP +bit 3 +.\"O Dump file-backed shared mappings. +¥Õ¥¡¥¤¥ë¤È´ØÏ¢ÉÕ¤±¤é¤ì¤¿¶¦Í­¥Þ¥Ã¥Ô¥ó¥° +(file-backed shared mappings) ¤ò¥À¥ó¥×¤¹¤ë¡£ +.\" file-backed shared mappings of course also update the underlying +.\" mapped file. +.RE +.PD +.PP +.\"O The default value of +.\"O .I coredump_filter +.\"O is 0x3; +.\"O this reflects traditional Linux behavior and means that +.\"O only anonymous memory segments are dumped. +.I coredump_filter +¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 0x3 ¤Ç¤¢¤ë¡£ +¤³¤ÎÃͤÏÀΤ«¤é¤Î Linux ¤ÎµóÆ°¤òÈ¿±Ç¤·¤¿¤â¤Î¤Ç¤¢¤ê¡¢ +̵̾¥á¥â¥ê¥»¥°¥á¥ó¥È (anonymous memory segments) ¤À¤±¤¬¥À¥ó¥×¤µ¤ì¤ë +¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ + +.\"O Memory-mapped I/O pages such as frame buffer are never dumped, and +.\"O virtual DSO pages are always dumped, regardless of the +.\"O .I coredump_filter +.\"O value. +.I coredump_filter +¤ÎÃͤ˴ؤï¤é¤º¡¢¥Õ¥ì¡¼¥à¥Ð¥Ã¥Õ¥¡¤Ê¤É¤Î memory-mapped I/O ¤Ë´Ø¤¹¤ë +¥Ú¡¼¥¸¤Ï·è¤·¤Æ¥À¥ó¥×¤µ¤ì¤º¡¢²¾ÁÛ DSO ¥Ú¡¼¥¸¤Ï¾ï¤Ë¥À¥ó¥×¤µ¤ì¤ë¡£ + +.\"O A child process created via +.\"O .BR fork (2) +.\"O inherits its parents +.\"O .I coredump_filter +.\"O value; +.\"O the +.\"O .I coredump_filter +.\"O value is preserved across an +.\"O .BR execve (2). +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤ë»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î +.I coredump_filter +¤ÎÃͤò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç +.I coredump_filter +¤ÎÃͤÏÊÝ»ý¤µ¤ì¤ë¡£ + +.\"O It can be useful to set +.\"O .I coredump_filter +.\"O in the parent shell before running a program, for example: +Îã¤Î¤è¤¦¤Ë¡¢¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¿Æ¥·¥§¥ë¤Î +.I coredump_filter +¤òÀßÄꤷ¤Æ¤ª¤¯¤ÈÌòΩ¤Ä¤³¤È¤¬¤¢¤ë¡£ + +.in +4n +.nf +.RB "$" " echo 0x7 > /proc/self/coredump_filter" +.RB "$" " ./some_program" +.fi +.in +.PP +.\"O This file is only provided if the kernel was built with the +.\"O .B CONFIG_ELF_CORE +.\"O configuration option. +¤³¤Î¥Õ¥¡¥¤¥ë¤¬Ä󶡤µ¤ì¤ë¤Î¤Ï¡¢¥«¡¼¥Í¥ë¤¬ÀßÄꥪ¥×¥·¥ç¥ó +.B CONFIG_ELF_CORE +¤òÍ­¸ú¤Ë¤·¤ÆºîÀ®¤µ¤ì¤¿¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH È÷¹Í +.\"O The +.\"O .BR gdb (1) +.\"O .I gcore +.\"O command can be used to obtain a core dump of a running process. +.BR gdb (1) +¤Î +.I gcore +¥³¥Þ¥ó¥É¤ò»ÈÍѤ¹¤ë¤È¡¢¼Â¹ÔÃæ¤Î¥×¥í¥»¥¹¤Î¥³¥¢¥À¥ó¥×¤ò¼èÆÀ¤Ç¤­¤ë¡£ + +.\"O If a multithreaded process (or, more precisely, a process that +.\"O shares its memory with another process by being created with the +.\"O .B CLONE_VM +.\"O flag of +.\"O .BR clone (2)) +.\"O dumps core, then the process ID is always appended to the core filename, +.\"O unless the process ID was already included elsewhere in the +.\"O filename via a %p specification in +.\"O .IR /proc/sys/kernel/core_pattern . +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥»¥¹ +(¤è¤êÀµ³Î¤Ë¤Ï¡¢ +.BR clone (2) +¤Î +.B CLONE_VM +¤ÇÀ¸À®¤µ¤ì¤¿ÊÌ¥×¥í¥»¥¹¤È¥á¥â¥ê¤ò¶¦Í­¤·¤Æ¤¤¤ë¥×¥í¥»¥¹) +¤¬¥³¥¢¥À¥ó¥×¤òÀ¸À®¤¹¤ë¾ì¹ç¡¢ +¥³¥¢¥Õ¥¡¥¤¥ë̾¤Ë¥×¥í¥»¥¹ ID ¤¬É¬¤ºÉղ䵤ì¤ë¡£ +¤¿¤À¤·¡¢ +.I /proc/sys/kernel/core_pattern +¤Î %p »ØÄê¤Ë¤è¤ê¥³¥¢¥Õ¥¡¥¤¥ë̾¤Î¤É¤³¤«Â¾¤Î¾ì½ê¤Ë¥×¥í¥»¥¹ ID ¤¬ +¤¹¤Ç¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥×¥í¥»¥¹ ID ¤¬ËöÈø¤ËÉղ䵤ì¤Ê¤¤¡£ +.\"O (This is primarily useful when employing the LinuxThreads implementation, +.\"O where each thread of a process has a different PID.) +(¤³¤Îµ¡Ç½¤¬¤Þ¤ºÌò¤ËΩ¤Ä¤Î¤Ï LinuxThreads ¼ÂÁõ¤òÍøÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤ë¡£ +LinuxThreads ¼ÂÁõ¤Ç¤Ï¡¢¥×¥í¥»¥¹Æâ¤Î¸Ä¡¹¤Î¥¹¥ì¥Ã¥É¤Ï°Û¤Ê¤ë¥×¥í¥»¥¹ ID +¤ò»ý¤Ä¡£) +.\" Always including the PID in the name of the core file made +.\" sense for LinuxThreads, where each thread had a unique PID, +.\" but doesn't seem to serve any purpose with NPTL, where all the +.\" threads in a process share the same PID (as POSIX.1 requires). +.\" Probably the behavior is maintained so that applications using +.\" LinuxThreads continue appending the PID (the kernel has no easy +.\" way of telling which threading implementation the userspace +.\" application is using). -- mtk, April 2006 +.\"O .SH EXAMPLE +.SH Îã +.\"O The program below can be used to demonstrate the use of the +.\"O pipe syntax in the +.\"O .I /proc/sys/kernel/core_pattern +.\"O file. +.\"O The following shell session demonstrates the use of this program +.\"O (compiled to create an executable named +.\"O .IR core_pattern_pipe_test ): +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï +.I /proc/sys/kernel/core_pattern +¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¤¥×¹½Ê¸¤Î»ÈÍÑÎã¤ò¼¨¤·¤Æ¤¤¤ë¡£ +°Ê²¼¤Î¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥ó¤Ï¤³¤Î¥×¥í¥°¥é¥à¤Î»ÈÍÑÎã¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë +(¥³¥ó¥Ñ¥¤¥ë¤·¤Æ +.I core_pattern_pipe_test +¤È¤¤¤¦Ì¾Á°¤Î¼Â¹Ô¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Æ¤¤¤ë)¡£ +.PP +.in +4n +.nf +.RB "$" " cc \-o core_pattern_pipe_test core_pattern_pipe_test.c" +.RB "$" " su" +Password: +.RB "#" " echo \(aq|$PWD/core_pattern_pipe_test %p \ +UID=%u GID=%g sig=%s\(aq > \e" +.B " /proc/sys/kernel/core_pattern" +.RB "#" " exit" +.RB "$" " sleep 100" +.BR "^\e" " # type control-backslash" +Quit (core dumped) +.RB "$" " cat core.info" +argc=5 +argc[0]= +argc[1]=<20575> +argc[2]= +argc[3]= +argc[4]= +Total bytes in core dump: 282624 +.fi +.in +.\"O .SS Program source +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +/* core_pattern_pipe_test.c */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +#define BUF_SIZE 1024 + +int +main(int argc, char *argv[]) +{ + int tot, j; + ssize_t nread; + char buf[BUF_SIZE]; + FILE *fp; + char cwd[PATH_MAX]; + + /* Change our current working directory to that of the + crashing process */ + + snprintf(cwd, PATH_MAX, "/proc/%s/cwd", argv[1]); + chdir(cwd); + + /* Write output to file "core.info" in that directory */ + + fp = fopen("core.info", "w+"); + if (fp == NULL) + exit(EXIT_FAILURE); + + /* Display command\-line arguments given to core_pattern + pipe program */ + + fprintf(fp, "argc=%d\\n", argc); + for (j = 0; j < argc; j++) + fprintf(fp, "argc[%d]=<%s>\\n", j, argv[j]); + + /* Count bytes in standard input (the core dump) */ + + tot = 0; + while ((nread = read(STDIN_FILENO, buf, BUF_SIZE)) > 0) + tot += nread; + fprintf(fp, "Total bytes in core dump: %d\\n", tot); + + exit(EXIT_SUCCESS); +} +.fi +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR bash (1), +.BR gdb (1), +.BR getrlimit (2), +.BR mmap (2), +.BR prctl (2), +.BR sigaction (2), +.BR elf (5), +.BR proc (5), +.BR pthreads (7), +.BR signal (7) diff --git a/draft/man5/dir_colors.5 b/draft/man5/dir_colors.5 new file mode 100644 index 00000000..47674117 --- /dev/null +++ b/draft/man5/dir_colors.5 @@ -0,0 +1,632 @@ +.\" +.\" manpage for /etc/dir_colors, config file for dircolors(1) +.\" extracted from color-ls 3.12.0.3 dircolors(1) manpage +.\" +.\" This file may be copied under the conditions described +.\" in the LDP GENERAL PUBLIC LICENSE, Version 1, September 1998 +.\" that should have been distributed together with this file. +.\" +.\" 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 ¥­¥ã¥ì¥Ã¥È +.\" +.TH DIR_COLORS 5 2001-12-26 "GNU" "Linux User Manual" +.\"O .SH NAME +.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).) +¤³¤Î´Ä¶­ÊÑ¿ô¤Ï¡¢Ä̾ï + +.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 +¥Õ¥¡¥¤¥ë¤Ç¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.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 ¤Ä¤Î¶õÇò¤¬¤¢¤ë¾ì¹ç¡¢ +¥Ï¥Ã¥·¥å¥Þ¡¼¥¯¤Î¸å¤í¤Ï¥³¥á¥ó¥È¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +¶õ¹Ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.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 +¤ÇÍ¿¤¨¤é¤ì¤ë) üËö¥¿¥¤¥×¤ò»ØÄꤹ¤ë¡£ +¥°¥í¡¼¥Ð¥ëÀë¸À¤ò¤½¤Î¸å¤Ë³¤¯Ã¼Ëö¸ÇÍ­¤ÎÀë¸À¤Ç¾å½ñ¤­¤¹¤ë¤³¤È¤¬¾ï¤Ë²Äǽ¤Ç¤¢¤ë¡£ +.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 +.B FILE \fIcolor-sequence\fR +.\"O Specifies the color used for a regular file. +Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B DIR \fIcolor-sequence\fR +.\"O Specifies the color used for directories. +¥Ç¥£¥ì¥¯¥È¥ê¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B LINK \fIcolor-sequence\fR +.\"O Specifies the color used for a symbolic link. +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.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 +.B FIFO \fIcolor-sequence\fR +.\"O Specifies the color used for a FIFO (named pipe). +FIFO (̾Á°ÉÕ¤­¥Ñ¥¤¥×) ¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B SOCK \fIcolor-sequence\fR +.\"O Specifies the color used for a socket. +¥½¥±¥Ã¥È¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.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 +.B CHR \fIcolor-sequence\fR +.\"O Specifies the color used for a character device special file. +¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B EXEC \fIcolor-sequence\fR +.\"O Specifies the color used for a file with the executable attribute set. +¼Â¹Ô°À­¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Ë»È¤ï¤ì¤ë¿§¤òÀßÄꤹ¤ë¡£ +.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 ~ +¤Î¤è¤¦¤Ê¥Ô¥ê¥ª¥É¤Ç»Ï¤Þ¤é¤Ê¤¤³ÈÄ¥»Ò¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤³¤Î·Á¼°¤Ï¸Å¤¤¤â¤Î¤È¹Í¤¨¤é¤ì¤Æ¤¤¤ë¡£ +.\"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 ¥³¡¼¥É¤ò¥Ç¥Õ¥©¥ë¥È¤Ç»È¤¦¡£ + +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 ¥¢¥ó¥À¡¼¥é¥¤¥ó¤µ¤ì¤¿¥Æ¥­¥¹¥È + 5 ¥Õ¥é¥Ã¥·¥å¤¹¤ë¥Æ¥­¥¹¥È +30 Á°·Ê¿§¡§¹õ +31 Á°·Ê¿§¡§ÀÖ +32 Á°·Ê¿§¡§ÎÐ +33 Á°·Ê¿§¡§²« (¤â¤·¤¯¤ÏÃã) +34 Á°·Ê¿§¡§ÀÄ +35 Á°·Ê¿§¡§»ç +36 Á°·Ê¿§¡§¥·¥¢¥ó +37 Á°·Ê¿§¡§Çò (¤â¤·¤¯¤Ï³¥) +40 ÇØ·Ê¿§¡§¹õ +41 ÇØ·Ê¿§¡§ÀÖ +42 ÇØ·Ê¿§¡§ÎÐ +43 ÇØ·Ê¿§¡§²« (¤â¤·¤¯¤ÏÃã) +44 ÇØ·Ê¿§¡§ÀÄ +45 ÇØ·Ê¿§¡§»ç +46 ÇØ·Ê¿§¡§¥·¥¢¥ó +47 ÇØ·Ê¿§¡§Çò (¤â¤·¤¯¤Ï³¥) +.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 +¤Ï°Ê²¼¤ò¥Ç¥Õ¥©¥ë¥È¤È¤·¤Æ»È¤¦¡£ +.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 ¼Â¹Ô¥Õ¥¡¥¤¥ë +.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)" +.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 +ÄêµÁ¤ò»È¤¦É¬Íפ¬¤¢¤ë¡£ +.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 ¤ÎÌÜŪ¤Ï¡¢Ã±¤ËɬÍפÊÂǤÁ¹þ¤à²ó¿ô¤ò¸º¤é¤¹ +(¤µ¤é¤Ë¡¢¸«¶ì¤·¤¤¥¨¥¹¥±¡¼¥×¥³¡¼¥É¤ò¥æ¡¼¥¶¡¼¤Ë±£¤¹) ¤³¤È¤Ë¤¢¤ë¡£ +¥·¡¼¥±¥ó¥¹¤¬¤½¤ÎüËö¤Ë¤È¤Ã¤ÆŬÀڤǤʤ¤¾ì¹ç¡¢ +¹ÔÆâ¤Î¤½¤ì¤¾¤ì¤Î¥­¡¼¥ï¡¼¥É¼«¿È¤ò»ØÄꤷ¤Æºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.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 +¤ò»ØÄꤹ¤ë¤³¤È¤ÇƱ¤¸¸ú²Ì¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"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 ¸À¸ì¥¹¥¿¥¤¥ë¤Îɽµ­¤Ë¤Ï°Ê²¼¤Îʸ»ú¤¬´Þ¤Þ¤ì¤ë¡£ +.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 ¥Ï¥Ã¥·¥å¥Þ¡¼¥¯ (#) +.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 +.I ~/.dir_colors +.\"O Per-user configuration file. +¥æ¡¼¥¶¡¼Ëè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¡£ +.\"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 +¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÄêµÁ¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.sp +.RS +.2i +.ta 1.0i +.nf +\fBLEFTCODE\fR \ee[ +\fBRIGHTCODE\fR m +.fi +.RE +.sp +.\"O The default +.\"O .B ENDCODE +.\"O is undefined. +.B ENDCODE +¤Î¥Ç¥Õ¥©¥ë¥È¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR dircolors (1), +.BR ls (1), +.BR stty (1), +.BR xterm (1) diff --git a/draft/man5/elf.5 b/draft/man5/elf.5 new file mode 100644 index 00000000..c99472bd --- /dev/null +++ b/draft/man5/elf.5 @@ -0,0 +1,2879 @@ +.\" $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. +ºÆÇÛÃÖ²Äǽ¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¢¤³¤ÎÃͤϥ»¥¯¥·¥ç¥ó¤ÎÀèƬ¤«¤é +ºÆÇÛÃ֤DZƶÁ¤ò¼õ¤±¤ë³ÊǼñ°Ì (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. +¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Î¾ì¹ç¡¢ +¤³¤ÎÃͤϺÆÇÛÃ֤DZƶÁ¤ò¼õ¤±¤ë³ÊǼñ°Ì¤Î²¾ÁÛ¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.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/filesystems.5 b/draft/man5/filesystems.5 new file mode 100644 index 00000000..7b8ffe00 --- /dev/null +++ b/draft/man5/filesystems.5 @@ -0,0 +1,322 @@ +.\" Copyright 1996 Daniel Quinlan (Daniel.Quinlan@linux.org) +.\" +.\" 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. +.\" +.\" 2007-12-14 mtk Added Reiserfs, XFS, JFS. +.\" +.\" Japanese Version Copyright (c) 1997 Ueyama Rui +.\" all rights reserved. +.\" Translated Tue Aug 19 21:56:35 JST 1997 +.\" by Ueyama Rui +.\" Modified Wed Oct 10 11:07:33 JST 2001 +.\" by Yuichi SATO +.\" Updated Fri Dec 21 JST 2001 by Kentaro Shirakata +.\" +.\"WORD: extended file system ³ÈÄ¥¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.\"WORD: second extended file system ÂèÆó³ÈÄ¥¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.\"WORD: RAM disk RAM¥Ç¥£¥¹¥¯ +.\"WORD: High Sierra ¥Ï¥¤¥·¥§¥é +.\"WORD: Rock Ridge ¥í¥Ã¥¯¥ê¥Ã¥¸ +.\" +.TH FILESYSTEMS 5 2007-12-14 "Linux" "Linux Programmer's Manual" +.nh +.\"O .SH NAME +.SH ̾Á° +.\"O filesystems \- Linux file-system types: minix, ext, ext2, ext3, Reiserfs, +.\"O XFS, JFS, xia, msdos, +.\"O umsdos, vfat, proc, nfs, iso9660, hpfs, sysv, smb, ncpfs +filesystems \- Linux ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à: minix, ext, ext2, ext3, Reiserfs, +XFS, JFS, xia, msdos, +umsdos, vfat, proc, nfs, iso9660, hpfs, sysv, smb, ncpfs +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O When, as is customary, the +.\"O .B proc +.\"O file system is mounted on +.\"O .IR /proc , +.\"O you can find in the file +.\"O .I /proc/filesystems +.\"O which file systems your kernel currently supports. +.\"O If you need a currently unsupported one, insert the corresponding +.\"O module or recompile the kernel. +.B proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬´·½¬¤É¤ª¤ê¤Ë +.I /proc +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¸½ºß¤Î¥«¡¼¥Í¥ë¤¬¤É¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤« +ÃΤ뤿¤á¤Ë¤Ï¥Õ¥¡¥¤¥ë +.I /proc/filesystems +¤ò¸«¤ì¤Ð¤è¤¤¡£ +ɬÍפʥե¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¸½ºß¤Î¥«¡¼¥Í¥ë¤Ë¥µ¥Ý¡¼¥È¤µ¤ì¤Æ +¤¤¤Ê¤¤¾ì¹ç¡¢Å¬Àڤʥ⥸¥å¡¼¥ë¤òÁȤ߹þ¤à¤«¡¢¤½¤ì¤â¤À¤á¤Ê¤é¤Ð +¥«¡¼¥Í¥ë¤òºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤³¤È¡£ + +.\"O In order to use a file system, you have to +.\"O .I mount +.\"O it; see +.\"O .BR mount (8). +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»È¤¦¤¿¤á¤Ë¤Ï¡¢ +.I ¥Þ¥¦¥ó¥È +¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.BR mount (8) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"O Below a short description of a few of the available file systems. +°Ê²¼¤ÏÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¤¦¤Á¡¢¤¤¤¯¤Ä¤«¤Î´Êñ¤ÊÀâÌÀ¤Ç¤¢¤ë¡£ +.TP 10 +.B "minix" +.\"O is the file system used in the Minix operating system, the first to run +.\"O under Linux. +.\"O It has a number of shortcomings: a 64MB partition size +.\"O limit, short filenames, a single timestamp, etc. +Minix ¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡£ +Linux ¤ÇÆ°¤¤¤¿ºÇ½é¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤â¤¢¤ë¡£¤³¤ì¤Ë¤Ï¤¤¤¯¤Ä¤«·çÅÀ¤¬¤¢¤ë¡£ +¤Þ¤º¡¢¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¥µ¥¤¥º¤¬ºÇÂç 64MB ¤Ç¤¢¤ë¤³¤È¡£Â¾¤Ë¤â¡¢Ã»¤¤¥Õ¥¡¥¤¥ë̾ +¤·¤«»È¤¨¤Ê¤¤¡¢¥¿¥¤¥à¥¹¥¿¥ó¥×¤¬°ì¤Ä¤À¤±¤Ç¤¢¤ë¡¢¤Ê¤É¤Ê¤É¡£ +.\"O It remains useful for floppies and RAM disks. +¥Õ¥í¥Ã¥Ô¡¼¤ä RAM ¥Ç¥£¥¹¥¯¤ËÊØÍø¤Ê¤Î¤Ç¤Þ¤À»Ä¤Ã¤Æ¤¤¤ë¡£ +.TP +.B ext +.\"O is an elaborate extension of the +.\"O .B minix +.\"O file system. +.\"O It has been completely superseded by the second version +.\"O of the extended file system +.\"O .RB ( ext2 ) +.\"O and has been removed from the kernel (in 2.1.21). +.B minix +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¼ê¤Î¹þ¤ó¤À³ÈÄ¥¤Ç¤¢¤ë¡£¤³¤ì¤ÏÂèÆó³ÈÄ¥¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +(second extended file system : +.BR ext2 ) +¤Ë´°Á´¤Ë¤È¤Ã¤ÆÂå¤ï¤é¤ì¡¢¥«¡¼¥Í¥ë 2.1.21 ¤Ç¼è¤ê½ü¤«¤ì¤¿¡£ +.TP +.B ext2 +.\"O is the high performance disk file system used by Linux for fixed disks +.\"O as well as removable media. +Linux ¤Î¹âÀ­Ç½¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£¤³¤ì¤Ï¸ÇÄê¥Ç¥£¥¹¥¯¤À¤±¤Ç¤Ï¤Ê¤¯ +¥ê¥à¡¼¥Ð¥Ö¥ë¥Ç¥£¥¹¥¯¤Ë¤â¤è¤¯»È¤ï¤ì¤ë¡£ +.\"O The second extended file system was designed as an extension of the +.\"O extended file system +.\"O .RB ( ext ). +.\"O .B ext2 +.\"O offers the best performance (in terms of speed and CPU usage) of +.\"O the file systems supported under Linux. +³ÈÄ¥¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.RB ( ext ) +¤ÎȯŸ¤È¤·¤ÆÂèÆó³ÈÄ¥¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.RB ( ext2 ) +¤¬À߷פµ¤ì¤¿¡£¤³¤Î +.B ext2 +¤Ï Linux ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÃæ¤Ç (¥¹¥Ô¡¼¥É¤ª¤è¤Ó CPU ¤Î»ÈÍÑÎ̤ÎÌ̤Ç) ºÇ¤â +¤è¤¤¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤òȯ´ø¤¹¤ë¡£ +.TP +.B ext3 +.\"O is a journaling version of the ext2 file system. +.\"O It is easy to +.\"O switch back and forth between ext2 and ext3. +ext2 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¸¥ã¡¼¥Ê¥ëµ¡Ç½¤ò¤Ä¤±¤¿¤â¤Î¤Ç¤¢¤ë¡£ +ext2 ¤È ext3 ¤Ï´Êñ¤Ë¹Ô¤­¤ÄÌá¤ê¤Ä¤Ç¤­¤ë¡£ +.TP +.B Reiserfs +.\"O is a journaling file system, designed by Hans Reiser, +.\"O that was integrated into Linux in kernel 2.4.1. +Hans Reiser ¤Ë¤è¤Ã¤ÆÀ߷פµ¤ì¤¿¥¸¥ã¡¼¥Ê¥ê¥ó¥°¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.4.1 ¤Ç Linux ¤ËÅý¹ç¤µ¤ì¤¿¡£ +.TP +.B XFS +.\"O is a journaling file system, developed by SGI, +.\"O that was integrated into Linux in kernel 2.4.20. +SGI ¤Ë¤è¤ê³«È¯¤µ¤ì¤¿¥¸¥ã¡¼¥Ê¥ê¥ó¥°¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.4.20 ¤Ç Linux ¤ËÅý¹ç¤µ¤ì¤¿¡£ +.TP +.B JFS +.\"O is a journaling file system, developed by IBM, +.\"O that was integrated into Linux in kernel 2.4.24. +IBM ¤Ë¤è¤ê³«È¯¤µ¤ì¤¿¥¸¥ã¡¼¥Ê¥ê¥ó¥°¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.4.24 ¤Ç Linux ¤ËÅý¹ç¤µ¤ì¤¿¡£ +.TP +.\"O .B xiafs +.\"O was designed and implemented to be a stable, safe file system by +.\"O extending the Minix file system code. +.\"O It provides the basic most +.\"O requested features without undue complexity. +.B xiafs +¤Ï Minix ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î³ÈÄ¥¤Ç¡¢¤è¤ê°ÂÄꤷ°ÂÁ´¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤·¤Æ +À߷ס¢¼ÂÁõ¤µ¤ì¤¿¡£¤³¤ì¤Ï¡¢¤¤¤é¤Ê¤¤Ê£»¨¤µ¤ÏÈò¤±¤Ä¤ÄɬÍפʴðËÜŪµ¡Ç½¤ò +È÷¤¨¤Æ¤¤¤ë¡£ +.\"O The +.\"O .B xia +.\"O file system is no longer actively developed or maintained. +.\"O It was removed from the kernel in 2.1.21. +.B xia +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢¤â¤Ï¤ä³«È¯¤â¥á¥ó¥Æ¥Ê¥ó¥¹¤â¹Ô¤ï¤ì¤Æ¤¤¤Ê¤¤¡£ +¥«¡¼¥Í¥ë 2.1.21 ¤Ç¼è¤ê½ü¤«¤ì¤¿¡£ +.TP +.\"O .B msdos +.\"O is the file system used by DOS, Windows, and some OS/2 computers. +.\"O .B msdos +.\"O filenames can be no longer than 8 characters, followed by an +.\"O optional period and 3 character extension. +.B msdos +¤Ï DOS ¤ä Windows¡¢¤¤¤¯¤é¤«¤Î OS/2 ¥³¥ó¥Ô¥å¡¼¥¿¤¬»È¤Ã¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë +¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +¤³¤Î +.B msdos +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡Ö8 ʸ»ú¤Î̾Á°¡Ü¥Ô¥ê¥ª¥É¡Ü3 ʸ»ú¤Î³ÈÄ¥»Ò¡×¤è¤ê +Ť¤¥Õ¥¡¥¤¥ë̾¤Ï¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.\"O .B umsdos +.\"O is an extended DOS file system used by Linux. +.\"O It adds capability for +.\"O long filenames, UID/GID, POSIX permissions, and special files +.\"O (devices, named pipes, etc.) under the DOS file system, without +.\"O sacrificing compatibility with DOS. +.B umsdos +¤Ï DOS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò³ÈÄ¥¤·¤¿ Linux ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï DOS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¤â¤È¤Ç¡¢Ä¹¤¤¥Õ¥¡¥¤¥ë̾¤ä UID/GID¡¢POSIX ·Á¼°¤Î +¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¡¢(¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤ä̾Á°ÉÕ¤­¥Ñ¥¤¥×¤Ê¤É¤Î) Æüì¥Õ¥¡¥¤¥ë¤ò +»È¤¨¤ë¤è¤¦¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£DOS ¤È¤Î¸ß´¹À­¤¬¤¢¤ë¡£ +.TP +.\"O .B vfat +.\"O is an extended DOS file system used by Microsoft Windows95 and Windows NT. +.\"O VFAT adds the capability to use long filenames under the MSDOS file system. +.B vfat +¤Ï Microsoft Windows95 ¤È Windows NT ¤¬»È¤¦ DOS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +Ť¤¥Õ¥¡¥¤¥ë̾¤¬»È¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.TP +.\"O .B proc +.\"O is a pseudo file system which is used as an interface to kernel data +.\"O structures rather than reading and interpreting +.\"O .IR /dev/kmem . +.\"O In particular, its files do not take disk space. +.\"O See +.\"O .BR proc (5). +.B proc +¤Ï¥«¡¼¥Í¥ë¥Ç¡¼¥¿¹½Â¤¤Ø¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤È¤Ê¤ëµ¿»÷¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï +.I /dev/kmem +¤òÆɤó¤Ç²ò¼á¤¹¤ë¤³¤È¤ÎÂå¤ï¤ê¤È¤·¤Æ»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤Ï¥Ç¥£¥¹¥¯¥¹¥Ú¡¼¥¹¤ò»ÈÍѤ·¤Ê¤¤¡£ +.BR proc (5) +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.\"O .B iso9660 +.\"O is a CD-ROM file system type conforming to the ISO 9660 standard. +.B iso9660 +¤Ï ISO 9660 ɸ½à¤Ë±è¤Ã¤¿ CD-ROM ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +.RS +.TP +.B "High Sierra" +.\"O Linux supports High Sierra, the precursor to the ISO 9660 standard for +.\"O CD-ROM file systems. +.\"O It is automatically recognized within the +.\"O .B iso9660 +.\"O file-system support under Linux. +Linux ¤Ï¥Ï¥¤¥·¥§¥é (High Sierra) ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£¤³¤ì¤Ï ISO 9660 ɸ½à¤¬ +·è¤Þ¤ë¤è¤êÁ°¤Ë»È¤ï¤ì¤Æ¤¤¤¿ CD-ROM ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£Linux ¤Î +.B iso9660 +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥µ¥Ý¡¼¥È¤¬¥Ï¥¤¥·¥§¥é¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¼«Æ°¤Ç +ǧ¼±¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B "Rock Ridge" +.\"O Linux also supports the System Use Sharing Protocol records specified +.\"O by the Rock Ridge Interchange Protocol. +.\"O They are used to further describe the files in the +.\"O .B iso9660 +.\"O file system to a UNIX host, and provide information such as long +.\"O filenames, UID/GID, POSIX permissions, and devices. +.\"O It is automatically recognized within the +.\"O .B iso9660 +.\"O file-system support under Linux. +Linux ¤Ï¥í¥Ã¥¯¥ê¥Ã¥¸ (Rock Ridge) ÊÑ´¹¥×¥í¥È¥³¥ë¤Çµ¬Äꤵ¤ì¤¿ +¥·¥¹¥Æ¥à»ÈÍѶ¦Í­¥×¥í¥È¥³¥ë¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£¤³¤ì¤Ï UNIX ¥Û +¥¹¥È¤Î¥Õ¥¡¥¤¥ë¤ò +.B iso9660 +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤è¤ê¾Ü¤·¤¯µ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¡¢ +Ť¤¥Õ¥¡¥¤¥ë̾¤ä UID/GID¡¢POSIX ·Á¼°¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¡¢¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë +¤Ê¤É¤Î¾ðÊó¤òÄ󶡤¹¤ë¡£Linux ¤Î +.B iso9660 +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥µ¥Ý¡¼¥È¤¬¥í¥Ã¥¯¥ê¥Ã¥¸¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¼«Æ°¤Ç +ǧ¼±¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.RE +.TP +.\"O .B hpfs +.\"O is the High Performance Filesystem, used in OS/2. +.\"O This file system is +.\"O read-only under Linux due to the lack of available documentation. +.B hpfs +¤Ï OS/2 ¤Ç»È¤ï¤ì¤ë¹âÀ­Ç½¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à(High Performance Filesystem)¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¥É¥­¥å¥á¥ó¥È¤¬Æþ¼ê¤Ç¤­¤Ê¤¤¤¿¤á¡¢ +Linux ¤Ç¤ÏÆɤ߹þ¤ßÀìÍÑ (Read-only) ¤Ç¤·¤«»ÈÍѤǤ­¤Ê¤¤¡£ +.TP +.\"O .B sysv +.\"O is an implementation of the SystemV/Coherent file system for Linux. +.\"O It implements all of Xenix FS, SystemV/386 FS, and Coherent FS. +.B sysv +¤Ï SystemV/Coherent ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î Linux ¤Ç¤Î¼ÂÁõ¤Ç¤¢¤ë¡£ +Xenix, SystemV/386, Coherent ³Æ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.\"O .B nfs +.\"O is the network file system used to access disks located on remote computers. +.B nfs +¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +Î¥¤ì¤¿¥³¥ó¥Ô¥å¡¼¥¿¤Î¥Ç¥£¥¹¥¯¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.\"O .B smb +.\"O is a network file system that supports the SMB protocol, used by +.\"O Windows for Workgroups, Windows NT, and Lan Manager. +.B smb +¤Ï SMB ¥×¥í¥È¥³¥ë¤ò¥µ¥Ý¡¼¥È¤·¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +Windows for Workgroups, Windows NT, Lan Manager ¤¬»È¤Ã¤Æ¤¤¤ë¡£ +.sp +.\"O To use +.\"O .B smb +.\"O fs, you need a special mount program, which can be found in the ksmbfs +.\"O package, found at +.\"O .IR ftp://sunsite.unc.edu/pub/Linux/system/Filesystems/smbfs . +.B smb +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»È¤¦¤¿¤á¤Ë¤Ï ksmbfs ¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤ë +Æüì¤Ê¥Þ¥¦¥ó¥È¥×¥í¥°¥é¥à¤¬É¬ÍפǤ¢¤ë¡£ +ksmbfs ¤Ï +.I ftp://sunsite.unc.edu/pub/Linux/system/Filesystems/smbfs +¤Ë¤¢¤ë¡£ +.TP +.\"O .B ncpfs +.\"O is a network file system that supports the NCP protocol, used by +.\"O Novell NetWare. +.B ncpfs +¤Ï NCP ¥×¥í¥È¥³¥ë¤ò¥µ¥Ý¡¼¥È¤·¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£Novell NetWare ¤¬ +»È¤Ã¤Æ¤¤¤ë¡£ +.sp +.\"O To use +.\"O .BR ncpfs , +.\"O you need special programs, which can be found at +.\"O .IR ftp://linux01.gwdg.de/pub/ncpfs . +.B ncpfs +¤ò»È¤¦¤¿¤á¤Ë¤Ï +.I ftp://linux01.gwdg.de/pub/ncpfs +¤Ë¤¢¤ëÆüì¤Ê¥×¥í¥°¥é¥à¤¬É¬ÍפǤ¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR proc (5), +.BR fsck (8), +.BR mkfs (8), +.BR mount (8) diff --git a/draft/man5/ftpusers.5 b/draft/man5/ftpusers.5 new file mode 100644 index 00000000..3ae86bf0 --- /dev/null +++ b/draft/man5/ftpusers.5 @@ -0,0 +1,81 @@ +.\" Copyright (c) 2000 Christoph J. Thompson +.\" +.\" 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. +.\" +.\" 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 NAKANO Takeo all rights reserved. +.\" Translated Fri 16 Feb 2001 by NAKANO Takeo +.\" +.TH FTPUSERS 5 2000-08-27 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O ftpusers \- list of users that may not log in via the FTP daemon +.SH ̾Á° +ftpusers \- FTP ¥Ç¡¼¥â¥ó·Ðͳ¤Ç¤Î¥í¥°¥¤¥ó¤òµö¤µ¤Ê¤¤¥æ¡¼¥¶¡¼¤Î¥ê¥¹¥È +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The text file +.\"O .B ftpusers +.\"O contains a list of users that may not log in using the +.\"O File Transfer Protocol (FTP) server daemon. +.\"O This file is used not merely for +.\"O system administration purposes but for improving security within a TCP/IP +.\"O networked environment. +.\"O It will typically contain a list of the users that +.\"O either have no business using ftp or have too many privileges to be allowed +.\"O to log in through the FTP server daemon. +.\"O Such users usually include root, daemon, bin, uucp, and news. +.\"O If your FTP server daemon doesn't use +.\"O .B ftpusers +.\"O then it is suggested that you read its documentation to find out how to +.\"O block access for certain users. +.\"O Washington University FTP server Daemon +.\"O (wuftpd) and Professional FTP Daemon (proftpd) are known to make use of +.\"O .BR ftpusers . +.B ftpusers +¤Ï¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¡¢File Transfer Protocol (FTP) ¥µ¡¼¥Ð¡¼¥Ç¡¼¥â¥ó +¤òÍøÍѤ·¤Æ¤Î¥í¥°¥¤¥ó¤òµö¤µ¤Ê¤¤¥æ¡¼¥¶¡¼¤ò¥ê¥¹¥È¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ïñ¤Ë¥·¥¹¥Æ¥à´ÉÍý¤Î¤¿¤á¤À¤±¤Ç¤Ê¤¯¡¢ +TCP/IP ¥Í¥Ã¥È¥ï¡¼¥¯´Ä¶­¤Ç¤Î¥»¥­¥å¥ê¥Æ¥£¤ò¸þ¾å¤µ¤»¤ë¤Î¤Ë¤âÍøÍѤǤ­¤ë¡£ +Ä̾ï¤Ï¡¢ftp ¤òÍѤ¤¤¿ºî¶È¤ò¹Ô¤ï¤Ê¤¤¥æ¡¼¥¶¡¼¤ä¡¢ +FTP ¥µ¡¼¥Ð¡¼¥Ç¡¼¥â¥ó·Ðͳ¤Ç¤Î¥í¥°¥¤¥ó¤òµö¤¹¤Ë¤Ï +¸¢¸Â¤¬Â礭¤¹¤®¤ë¥æ¡¼¥¶¡¼¤ò¥ê¥¹¥È¤·¤Æ¤ª¤¯¡£ +¤³¤Î¤è¤¦¤Ê¥æ¡¼¥¶¡¼¤Ë¤Ï¡¢Î㤨¤Ð root, daemon, bin, uucp, news ¤Ê¤É¤¬´Þ¤Þ¤ì¤ë¡£ +¤ª»È¤¤¤Î FTP ¥µ¡¼¥Ð¡¼¥Ç¡¼¥â¥ó¤¬ +.B ftpusers +¤òÍѤ¤¤Ê¤¤¾ì¹ç¤Ï¡¢¤½¤Î¥Ç¡¼¥â¥ó¤Î¥É¥­¥å¥á¥ó¥È¤òÆɤó¤Ç¡¢ +ÆÃÄê¤Î¥æ¡¼¥¶¡¼¤Î¥¢¥¯¥»¥¹¤ò¥Ö¥í¥Ã¥¯¤¹¤ë¤ä¤êÊý¤ò³Ø¤ó¤Ç¤ª¤¯¤³¤È¤ò¤¹¤¹¤á¤ë¡£ +Washington University FTP ¥µ¡¼¥Ð¡¼¥Ç¡¼¥â¥ó (wuftpd) ¤È +Professional FTP ¥Ç¡¼¥â¥ó (proftpd) ¤È¤Ï¡¢ +.B ftpusers +¤òÍøÍѤ¹¤ë¤³¤È¤¬¤ï¤«¤Ã¤Æ¤¤¤ë¡£ +.\"O .SS Format +.SS ¥Õ¥©¡¼¥Þ¥Ã¥È +.\"O The format of +.\"O .B ftpusers +.\"O is very simple. +.\"O There is one account name (or username) per line. +.\"O Lines starting with a # are ignored. +.B ftpusers +¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ÏÈó¾ï¤Ëñ½ã¤Ç¤¢¤ê¡¢ +¥¢¥«¥¦¥ó¥È̾ (¤Þ¤¿¤Ï¥æ¡¼¥¶¡¼Ì¾) ¤ò³Æ¹Ô¤Ë½ñ¤¯¤À¤±¤Ç¤¢¤ë¡£ +# ¤Ç»Ï¤Þ¤ë¹Ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.I /etc/ftpusers +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR passwd (5), +.BR proftpd (8), +.BR wuftpd (8) diff --git a/draft/man5/group.5 b/draft/man5/group.5 new file mode 100644 index 00000000..9aa71905 --- /dev/null +++ b/draft/man5/group.5 @@ -0,0 +1,85 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:06:03 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1997 Ueyama Rui +.\" all rights reserved. +.\" Translated 1997-08-30, Ueyama Rui +.\" Modified 2005-02-20, Akihiro MOTOKI +.\" +.TH GROUP 5 2009-10-17 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O group \- user group file +group \- ¥æ¡¼¥¶¡¼¥°¥ë¡¼¥×¤Î¥Õ¥¡¥¤¥ë +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O \fI/etc/group\fP is a text file which defines the groups on the system. +.\"O There is one entry per line, with the following format: +\fI/etc/group\fP ¤Ï¡¢¤½¤Î¥·¥¹¥Æ¥à¤Î¥°¥ë¡¼¥×¤òÄêµÁ¤¹¤ë¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +1 ¹Ô¤Ë 1 ¥¨¥ó¥È¥ê¤Ç¡¢³Æ¹Ô¤Î·Á¼°¤Ï°Ê²¼¤Î¤È¤ª¤ê¤Ç¤¢¤ë¡£ +.sp +.RS +group_name:password:GID:user_list +.RE +.sp +.\"O The field descriptions are: +¥Õ¥£¡¼¥ë¥É¤ÎÀâÌÀ: +.IP group_name +.\"O the name of the group. +¥°¥ë¡¼¥×¤Î̾Á°¡£ +.IP password +.\"O the (encrypted) group password. +.\"O If this field is empty, no password is needed. +(°Å¹æ²½¤µ¤ì¤¿) ¥Ñ¥¹¥ï¡¼¥É¡£¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬¶õ¤Ê¤é¥Ñ¥¹¥ï¡¼¥É¤ÏɬÍפʤ¤¡£ +.IP GID +.\"O the numerical group ID. +¥°¥ë¡¼¥×ID¤Î¿ôÃÍ¡£ +.IP user_list +.\"O a list of the usernames that are members of this group, separated by commas. +¤³¤Î¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤Î¥æ¡¼¥¶¡¼Ì¾¤Î¥ê¥¹¥È¡£ +¥æ¡¼¥¶¡¼Ì¾¤Ï¥³¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +/etc/group +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O As the 4.2BSD +.\"O .BR initgroups (3) +.\"O man page says: No-one seems to keep +.\"O .I /etc/group +.\"O up-to-date. +4.2BSD ¤Î +.BR initgroups (3) +¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë½ñ¤«¤ì¤Æ¤¤¤ë: +ï¤â +.I /etc/group +¤òºÇ¿·¤Î¾õÂÖ¤ËÊݤäƤϤ¤¤Ê¤¤¤è¤¦¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR login (1), +.BR newgrp (1), +.BR getgrent (3), +.BR getgrnam (3), +.BR passwd (5) diff --git a/draft/man5/host.conf.5 b/draft/man5/host.conf.5 new file mode 100644 index 00000000..a1267dd6 --- /dev/null +++ b/draft/man5/host.conf.5 @@ -0,0 +1,360 @@ +.\" Copyright (c) 1997 Martin Schulze (joey@infodrom.north.de) +.\" +.\" 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. +.\" +.\" Much of the text is copied from the manpage of resolv+(8). +.\" +.\" 2003-08-23 Martin Schulze Updated according to glibc 2.3.2 +.\" +.\" Japanese Version Copyright (c) 2000-2003 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Sep 24 06:18:14 JST 2000 +.\" by Yuichi SATO +.\" Updated & Modified Sun Sep 7 17:51:03 JST 2003 +.\" by Yuichi SATO +.\" +.\"WORD: method Êý¼° +.\"WORD: trim ¼è¤êµî¤ë +.\"WORD: spoofing µ¶Áõ +.\" +.TH HOST.CONF 5 2003-08-23 "Linux" "Linux System Administration" +.\"O .SH NAME +.SH ̾Á° +.\"O host.conf \- resolver configuration file +host.conf \- ¥ì¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The file +.\"O .I /etc/host.conf +.\"O contains configuration information specific to the resolver library. +.\"O It should contain one configuration keyword per line, followed by +.\"O appropriate configuration information. +.\"O The keywords recognized are +.\"O .IR order ", " trim ", " multi ", " nospoof ", " spoof ", and " reorder . +.\"O These keywords are described below. +¥Õ¥¡¥¤¥ë +.I /etc/host.conf +¤Ë¤Ï¡¢¥ì¥¾¥ë¥Ð¥é¥¤¥Ö¥é¥ê¤Î¾ÜºÙ¤ÊÀßÄê¾ðÊ󤬴ޤޤì¤Æ¤¤¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢1 ¹ÔËè¤Ë 1 ¤Ä¤ÎÀßÄꥭ¡¼¥ï¡¼¥É¤È +¤½¤ì¤Ë³¤¯Å¬ÀÚ¤ÊÀßÄê¾ðÊ󤬤ʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ǧ¼±¤µ¤ì¤ë¥­¡¼¥ï¡¼¥É¤Ï +.IR order ", " trim ", " multi ", " nospoof ", " spoof ", " reorder +¤Ç¤¢¤ë¡£ +³Æ¥­¡¼¥ï¡¼¥É¤ò¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ë¡£ +.TP +.I order +.\"O This keyword specifies how host lookups are to be performed. +.\"O It should be followed by one or more lookup methods, separated by commas. +.\"O Valid methods are +.\"O .IR bind ", " hosts ", and " nis . +¤³¤Î¥­¡¼¥ï¡¼¥É¤Ï¡¢¥Û¥¹¥È¤Î¥ë¥Ã¥¯¥¢¥Ã¥×Êý¼°¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥­¡¼¥ï¡¼¥É¤Î¸å¤Ë¤Ï¡¢¥³¥ó¥Þ¤Çʬ¤±¤¿ +1 ¤Ä°Ê¾å¤Î¥ë¥Ã¥¯¥¢¥Ã¥×Êý¼°¤¬Â³¤«¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +»ÈÍѲÄǽ¤ÊÊý¼°¤Ï +.IR bind ", " hosts ", " nis +¤Ç¤¢¤ë¡£ +.TP +.I trim +.\"O This keyword may be listed more than once. +.\"O Each time it should be +.\"O followed by a list of domains, separated by colons (\(aq:\(aq), semicolons +.\"O (\(aq;\(aq) or commas (\(aq,\(aq), with the leading dot. +.\"O When set, the +.\"O resolv+ library will automatically trim the given domain name from the +.\"O end of any hostname resolved via DNS. +.\"O This is intended for use with +.\"O local hosts and domains. +.\"O (Related note: trim will not affect hostnames +.\"O gathered via NIS or the hosts file. +.\"O Care should be taken to +.\"O ensure that the first hostname for each entry in the hosts file is +.\"O fully qualified or unqualified, as appropriate for the local +.\"O installation.) +¤³¤Î¥­¡¼¥ï¡¼¥É¤Ï¡¢2 ²ó°Ê¾å¥ê¥¹¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Ëè²ó¡¢¤³¤Î¥­¡¼¥ï¡¼¥É¤Î¸å¤Ë¤Ï¡¢ +¥É¥Ã¥È¤Ç¤Ï¤¸¤Þ¤ë 1 ¤Ä°Ê¾å¤Î¥É¥á¥¤¥ó̾¤Î¥ê¥¹¥È¤ò³¤±¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥É¥á¥¤¥ó̾¤Ï¥³¥í¥ó (\(aq:\(aq)¡¢¥»¥ß¥³¥í¥ó (\(aq;\(aq)¡¢¥³¥ó¥Þ (\(aq,\(aq) +¤Ç¶èÀڤ롣 +¤³¤Î¥­¡¼¥ï¡¼¥É¤¬ÀßÄꤵ¤ì¤ë¤È¡¢resolv+ ¥é¥¤¥Ö¥é¥ê¤Ï DNS ¤Ç¥ì¥¾¥ë¥Ö¤µ¤ì¤¿ +¤¹¤Ù¤Æ¤Î¥Û¥¹¥È̾¤Î¸å¤í¤«¤éÍ¿¤¨¤é¤ì¤¿¥É¥á¥¤¥ó̾¤ò¼«Æ°Åª¤Ë¼è¤êµî¤ë¡£ +¤³¤Î¥­¡¼¥ï¡¼¥É¤Ï¥í¡¼¥«¥ë¤Ê¥Û¥¹¥È¤È¥É¥á¥¤¥ó¤Ç»ÈÍѤ¹¤ë¤³¤È¤ò°Õ¿Þ¤·¤Æ¤¤¤ë¡£ +(´ØÏ¢¤·¤¿Ãí°Õ : NIS ¤Þ¤¿¤Ï hosts ¥Õ¥¡¥¤¥ë¤Ç½¸¤á¤é¤ì¤¿¥Û¥¹¥È̾¤Ë +trim ¤Ï±Æ¶Á¤·¤Ê¤¤¡£ +hosts ¥Õ¥¡¥¤¥ë¤Î³Æ¥¨¥ó¥È¥ê¤ÎºÇ½é¤Î¥Û¥¹¥È̾¤ò¡¢ +´°Á´¤Ê¥É¥á¥¤¥ó̾ÉÕ¤­¤Î¤â¤Î¤Ë¤¹¤ë¤«¤·¤Ê¤¤¤«¤Ï¡¢ +¥Û¥¹¥È¤´¤È¤Î¥¤¥ó¥¹¥È¡¼¥ë¥Ý¥ê¥·¡¼¤Ë¤¢¤ï¤»¤Æ +ŬÀÚ¤ËÁªÂò¤¹¤ëɬÍפ¬¤¢¤ë¡£Ãí°Õ¤¹¤ë¤³¤È¡£) +.TP +.I multi +.\"O Valid values are +.\"O .IR on " and " off . +.\"O If set to +.\"O .IR on , +.\"O the resolv+ library will return all valid addresses for a host that +.\"O appears in the +.\"O .I /etc/hosts +.\"O file, +.\"O instead of only the first. +.\"O This is +.\"O .I off +.\"O by default, as it may cause a substantial performance loss at sites +.\"O with large hosts files. +Í­¸ú¤ÊÃÍ¤Ï +.IR on " ¤È " off +¤Ç¤¢¤ë¡£ +.I on +¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ºÇ½é¤Î¥¨¥ó¥È¥ê¤Î¤ß¤òÎã³°¤È¤·¤Æ¡¢ +resolv+ ¥é¥¤¥Ö¥é¥ê¤Ï +.I /etc/hosts +¥Õ¥¡¥¤¥ë¤Ë¸½¤ì¤ë¥Û¥¹¥È¤ËÂФ·¤ÆÁ´¤Æ¤ÎÍ­¸ú¤Ê¥¢¥É¥ì¥¹¤òÊÖ¤½¤¦¤È¤¹¤ë¡£ +Â礭¤Ê hosts ¥Õ¥¡¥¤¥ë¤ò»ý¤Ä¥µ¥¤¥È¤Ç¤Ï¡¢ +¤³¤ÎÀßÄê¤ÏÈó¾ï¤ÊÀ­Ç½¤ÎÄã²¼¤ò¾·¤¯¤Î¤Ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +.I off +¤Ç¤¢¤ë¡£ +.TP +.I nospoof +.\"O Valid values are +.\"O .IR on " and " off . +.\"O If set to +.\"O .IR on , +.\"O the resolv+ library will attempt to prevent hostname spoofing to +.\"O enhance the security of +.\"O .BR rlogin " and " rsh . +.\"O It works as follows: after performing a host address lookup, resolv+ +.\"O will perform a hostname lookup for that address. +.\"O If the two hostnames +.\"O do not match, the query will fail. +Í­¸ú¤ÊÃÍ¤Ï +.IR on " ¤È " off +¤Ç¤¢¤ë¡£ +.I on +¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢resolv+ ¥é¥¤¥Ö¥é¥ê¤Ï +.BR rlogin " ¤È " rsh +¤Î¥»¥­¥å¥ê¥Æ¥£¤ò¸þ¾å¤µ¤»¤ë¤¿¤á¥Û¥¹¥È̾¤Îµ¶Áõ¤òËɻߤ·¤è¤¦¤È¤¹¤ë¡£ +¤³¤ì¤Ï¡¢¡Ö¥Û¥¹¥È¥¢¥É¥ì¥¹¤Î¥ë¥Ã¥¯¥¢¥Ã¥×¤ò¹Ô¤Ã¤¿¸å¡¢ +resolv+ ¤Ï¤½¤Î¥¢¥É¥ì¥¹¤ËÂФ·¤Æ¥Û¥¹¥È̾¤Î¥ë¥Ã¥¯¥¢¥Ã¥×¤ò¹Ô¤¤¡¢ +¤â¤· 2 ¤Ä¤Î¥Û¥¹¥È̾¤¬°ìÃפ·¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢¥¯¥¨¥ê¡¼¤Ï¼ºÇÔ¤¹¤ë¡£¡× +¤È¤¤¤¦¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ +.\"O The default value is +.\"O .IR off . +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï +.I off +¤Ç¤¢¤ë¡£ +.TP +.I spoofalert +.\"O Valid values are +.\"O .IR on " and " off . +Í­¸ú¤ÊÃÍ¤Ï +.IR on " ¤È " off +¤Ç¤¢¤ë¡£ +.\"O If this option is set to +.\"O .I on +.\"O and the +.\"O .I nospoof +.\"O option is also set, resolv+ will log a warning of the error via the +.\"O syslog facility. +.\"O The default value is +.\"O .IR off . +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ +.I on +¤ËÀßÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.I nospoof +¥ª¥×¥·¥ç¥ó¤â (on ¤Ë) ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +resolv+ ¤Ï syslog µ¡Ç½¤òÄ̤¸¤Æ¥¨¥é¡¼¤Ë´Ø¤¹¤ë·Ù¹ð¤Î¥í¥°¤ò¤È¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï +.I off +¤Ç¤¢¤ë¡£ +.TP +.I spoof +.\"O Valid values are +.\"O .IR off ", " nowarn " and " warn . +Í­¸ú¤ÊÃÍ¤Ï +.IR off ", " nowarn ", " warn +¤Ç¤¢¤ë¡£ +.\"O If this option is set to +.\"O .IR off , +.\"O spoofed addresses are permitted and no warnings will be emitted +.\"O via the syslog facility. +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò +.I off +¤ËÀßÄꤹ¤ë¤È¡¢µ¶Áõ¤µ¤ì¤¿¥¢¥É¥ì¥¹¤òµö²Ä¤·¤Æ¡¢ +syslog µ¡Ç½¤òÄ̤¸¤¿·Ù¹ð¤òȯ¤·¤Ê¤¤¡£ +.\"O If this option is set to +.\"O .IR warn , +.\"O resolv+ will attempt to prevent hostname spoofing to +.\"O enhance the security and log a warning of the error via the syslog +.\"O facility. +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò +.I warn +¤ËÀßÄꤹ¤ë¤È¡¢resolv+ ¤Ï¥»¥­¥å¥ê¥Æ¥£¤ò¹â¤á¤ë¤¿¤á¤Ë¥Û¥¹¥È̾¤Îµ¶Áõ¤òËɻߤ·¡¢ +syslog µ¡Ç½¤òÄ̤¸¤Æ¥¨¥é¡¼¤Ë´Ø¤¹¤ë·Ù¹ð¤Î¥í¥°¤ò¤È¤ë¡£ +.\"O If this option is set to +.\"O .IR nowarn , +.\"O the resolv+ library will attempt to prevent hostname spoofing to +.\"O enhance the security but not emit warnings via the syslog facility. +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò +.I nowarn +¤ËÀßÄꤹ¤ë¤È¡¢resolv+ ¤Ï¥»¥­¥å¥ê¥Æ¥£¤ò¹â¤á¤ë¤¿¤á¤Ë¥Û¥¹¥È̾¤Îµ¶Áõ¤òËɻߤ¹¤ë¤¬¡¢ +syslog µ¡Ç½¤òÄ̤¸¤¿·Ù¹ð¤Ïȯ¤·¤Ê¤¤¡£ +.\"O Setting this option to anything else is equal to setting it to +.\"O .IR nowarn . +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò²¿¤âÀßÄꤷ¤Ê¤¤¾ì¹ç¤Ï¡¢ +.I nowarn +¤òÀßÄꤷ¤¿¤Î¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ +.TP +.I reorder +.\"O Valid values are +.\"O .IR on " and " off . +.\"O If set to +.\"O .IR on , +.\"O resolv+ will attempt to reorder host addresses so that local addresses +.\"O (i.e., on the same subnet) are listed first when a +.\"O .BR gethostbyname (3) +.\"O is performed. +.\"O Reordering is done for all lookup methods. +.\"O The default +.\"O value is +.\"O .IR off . +Í­¸ú¤ÊÃÍ¤Ï +.IR on " ¤È " off +¤Ç¤¢¤ë¡£ +.I on +¤ËÀßÄꤵ¤ì¤ë¤È¡¢ +.B gethostbyname (3) +¤¬¼Â¹Ô¤µ¤ì¤ë¤È¤­¡¢resolv+ ¥é¥¤¥Ö¥é¥ê¤Ï¡¢¥í¡¼¥«¥ë¤Ê +(¤Ä¤Þ¤ê¡¢Æ±¤¸¥µ¥Ö¥Í¥Ã¥È¤Ë¤¢¤ë) ¥¢¥É¥ì¥¹¤¬ºÇ½é¤Ë¥ê¥¹¥È¤µ¤ì¤ë¤è¤¦¤Ë +¥Û¥¹¥È¥¢¥É¥ì¥¹¤òʤÙÊѤ¨¤ë¡£ +¤¹¤Ù¤Æ¤Î¥ë¥Ã¥¯¥¢¥Ã¥×Êý¼°¤ËÂФ·¤ÆʤÙÊѤ¨¤¬¹Ô¤ï¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃͤϡ¢ +.I off +¤Ç¤¢¤ë¡£ +.\"O .SH ENVIRONMENT +.SH ´Ä¶­ÊÑ¿ô +.\"O There are six environment variables that can be used to allow users to +.\"O override the behavior which is configured in +.\"O .IR /etc/host.conf . +.I /etc/host.conf +¤ÇÀßÄꤵ¤ì¤Æ¤¤¤ëÆ°ºî¤ò¡¢¥æ¡¼¥¶¤¬¾å½ñ¤­¤Ç¤­¤ë 6 ¤Ä¤Î´Ä¶­ÊÑ¿ô¤¬¤¢¤ë¡£ +.TP +.B RESOLV_HOST_CONF +.\"O If set this variable points to a file that should be read instead of +.\"O .IR /etc/host.conf . +¤³¤ÎÊÑ¿ô¤òÀßÄꤹ¤ë¤È¡¢ +.I /etc/host.conf +¤ÎÂå¤ê¤ËÆɤ߹þ¤à¥Õ¥¡¥¤¥ë¤òÀßÄê¤Ç¤­¤ë¡£ +.TP +.B RESOLV_SERV_ORDER +.\"O Overrides the +.\"O .I order +.\"O command. +.I order +¥³¥Þ¥ó¥É¤ò¾å½ñ¤­¤¹¤ë¡£ +.TP +.B RESOLV_SPOOF_CHECK +.\"O Overrides the +.\"O .IR nospoof ", " spoofalert " and " spoof +.\"O commands in the same way as the +.\"O .I spoof +.\"O command is parsed. +.\"O Valid values are +.\"O .IR off ", " nowarn " and " warn . +.I spoof +¥³¥Þ¥ó¥É¤ò²òÀϤ¹¤ë¤Î¤ÈƱ¤¸Êý¼°¤Ç¡¢ +.IR nospoof ", " spoofalert ", " spoof +¥³¥Þ¥ó¥É¤ò¾å½ñ¤­¤Ç¤­¤ë¡£ +Í­¸ú¤ÊÃÍ¤Ï +.IR off ", " nowarn ", " warn +¤Ç¤¢¤ë¡£ +.TP +.B RESOLV_MULTI +.\"O Overrides the +.\"O .I multi +.\"O command. +.I multi +¥³¥Þ¥ó¥É¤ò¾å½ñ¤­¤¹¤ë¡£ +.TP +.B RESOLV_REORDER +.\"O Overrides the +.\"O .I reorder +.\"O command. +.I reorder +¥³¥Þ¥ó¥É¤ò¾å½ñ¤­¤¹¤ë¡£ +.TP +.B RESOLV_ADD_TRIM_DOMAINS +.\"O A list of domains, separated by colons (\(aq:\(aq), semicolons (\(aq;\(aq) or +.\"O commas (\(aq,\(aq), with the leading dot, which will be added to the list of +.\"O domains that should be trimmed. +¥³¥í¥ó (\(aq:\(aq)¡¢¥»¥ß¥³¥í¥ó (\(aq;\(aq)¡¢¥³¥ó¥Þ (\(aq,\(aq) ¤Ç¶èÀڤä¿ +¥É¥Ã¥È (\(aq.\(aq) ¤Ç»Ï¤Þ¤ë¥É¥á¥¤¥ó̾¤Î¥ê¥¹¥È¡£ +¥Û¥¹¥È̾¤«¤é¼è¤êµî¤ë¥É¥á¥¤¥ó̾¤Î¥ê¥¹¥È¤ËÄɲ乤롣 +.TP +.B RESOLV_OVERRIDE_TRIM_DOMAINS +.\"O A list of domains, separated by colons (\(aq:\(aq), semicolons (\(aq;\(aq) or +.\"O commas (\(aq,\(aq), with the leading dot, which will replace the list of +.\"O domains that should be trimmed. +.\"O Overrides the +.\"O .I trim +.\"O command. +¥³¥í¥ó (\(aq:\(aq)¡¢¥»¥ß¥³¥í¥ó (\(aq;\(aq)¡¢¥³¥ó¥Þ (\(aq,\(aq) ¤Ç¶èÀڤä¿ +¥É¥Ã¥È (\(aq.\(aq) ¤Ç»Ï¤Þ¤ë¥É¥á¥¤¥ó̾¤Î¥ê¥¹¥È¡£ +¥Û¥¹¥È̾¤«¤é¼è¤êµî¤ë¥É¥á¥¤¥ó̾¤Î¥ê¥¹¥È¤ò¾å½ñ¤­¤¹¤ë¡£ +.I trim +¥³¥Þ¥ó¥É¤ò¾å½ñ¤­¤¹¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/host.conf +.\"O Resolver configuration file +¥ê¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë +.TP +.I /etc/resolv.conf +.\"O Resolver configuration file +¥ê¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë +.TP +.I /etc/hosts +.\"O Local hosts database +¥í¡¼¥«¥ë¤Î hosts ¥Ç¡¼¥¿¥Ù¡¼¥¹ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The following differences exist compared to the original implementation. +¸µ¡¹¤Î¼ÂÁõ¤ËÈæ¤Ù¤Æ°Ê²¼¤Î¤è¤¦¤Ê°ã¤¤¤¬¤¢¤ë¡£ +.\"O A new command +.\"O .I spoof +.\"O and a new environment variable +.\"O .B RESOLV_SPOOF_CHECK +.\"O can take arguments like +.\"O .IR off ", " nowarn " and " warn . +¿·¤·¤¤¥³¥Þ¥ó¥É +.I spoof +¤È¿·¤·¤¤´Ä¶­ÊÑ¿ô +.B RESOLV_SPOOF_CHECK +¤Ï¡¢°ú¤­¿ô +.IR off ", " nowarn ", " warn +¤ò¤È¤ë¡£ +.\"O Line comments can appear anywhere and not only at the beginning of a line. +¥³¥á¥ó¥È¤Ï¹ÔƬ¤À¤±¤Ç¤Ï¤Ê¤¯¡¢¤É¤³¤Ë½ñ¤¤¤Æ¤â¤è¤¤¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR gethostbyname (3), +.BR hostname (7), +.BR named (8), +.BR resolv+ (8) diff --git a/draft/man5/hosts.5 b/draft/man5/hosts.5 new file mode 100644 index 00000000..a18bea76 --- /dev/null +++ b/draft/man5/hosts.5 @@ -0,0 +1,198 @@ +.\" Hey, Emacs! This is an -*- nroff -*- source file. +.\" Copyright (c) 2000 Manoj Srivastava +.\" +.\" 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. +.\" +.\" Minor polishing, aeb +.\" Modified, 2002-06-16, Mike Coleman +.\" +.\" Japanese Version Copyright (c) 2000-2002 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Sep 24 05:53:22 JST 2000 +.\" by Yuichi SATO +.\" Updated & Modified Sat Aug 31 05:49:00 JST 2002 by Yuichi SATO +.\" +.TH HOSTS 5 2002-06-16 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O hosts \- The static table lookup for hostnames +hosts \- ¥Û¥¹¥È̾¤ÎÀÅŪ¤Ê¥ë¥Ã¥¯¥¢¥Ã¥×¥Æ¡¼¥Ö¥ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B /etc/hosts +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This manual page describes the format of the +.\"O .I /etc/hosts +.\"O file. +.\"O This file is a simple text file that associates IP addresses +.\"O with hostnames, one line per IP address. +.\"O For each host a single +.\"O line should be present with the following information: +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï¡¢ +.I /etc/hosts +¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤Ä¤¤¤Æµ­½Ò¤·¤Æ¤¤¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï´Êñ¤Ê¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¡¢1 ¹Ô¤Ë 1 ¤Ä¤Î IP ¥¢¥É¥ì¥¹¤¬¤¢¤ê¡¢ +IP ¥¢¥É¥ì¥¹¤È¥Û¥¹¥È̾¤ò´ØÏ¢¤Å¤±¤Æ¤¤¤ë¡£ +³Æ¥Û¥¹¥È¤Ë¤Ä¤¤¤Æ¡¢¼¡¤Î¤è¤¦¤Ê¾ðÊó¤¬ 1 ¹Ô¤ÇÍ¿¤¨¤é¤ì¤ë¡£ +.RS +.PP +.\"O IP_address canonical_hostname [aliases...] +IP¥¢¥É¥ì¥¹ Àµ¼°¤Ê¥Û¥¹¥È̾ [¥¨¥¤¥ê¥¢¥¹...] +.RE +.PP +.\"O Fields of the entry are separated by any number of blanks and/or +.\"O tab characters. +.\"O Text from a "#" character until the end of the line is +.\"O a comment, and is ignored. +.\"O Host names may contain only alphanumeric +.\"O characters, minus signs ("\-"), and periods ("."). +.\"O They must begin with an +.\"O alphabetic character and end with an alphanumeric character. +.\"O Optional aliases provide for name changes, alternate spellings, +.\"O shorter hostnames, or generic hostnames (for example, +.\"O .IR localhost ). +¥¨¥ó¥È¥ê¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢¶õÇò¤Þ¤¿¤Ï¥¿¥Ö (Ê£¿ô¤Ç¤â²Ä) ¤Ç¶èÀÚ¤é¤ì¤ë¡£ +"#" ʸ»ú¤«¤é¹ÔËö¤Þ¤Ç¤Î¥Æ¥­¥¹¥È¤Ï¥³¥á¥ó¥È¤È¤·¤Æ̵»ë¤µ¤ì¤ë¡£ +¥Û¥¹¥È̾¤Ï±Ñ¿ô»ú¡¦¥Þ¥¤¥Ê¥¹µ­¹æ ("\-")¡¦¥Ô¥ê¥ª¥É (".") ¤ò´Þ¤à¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Û¥¹¥È̾¤Ï±Ñʸ»ú (alphabetic character) ¤Ç»Ï¤Þ¤Ã¤Æ¡¢ +±Ñ¿ô»ú (alphanumeric characte) ¤Ç½ª¤ï¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥¨¥¤¥ê¥¢¥¹¤Ï¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ê¡¢Ì¾Á°¤ÎÊѹ¹¡¢Ê̤Υ¹¥Ú¥ë¡¢ +û¤¤¥Û¥¹¥È̾¡¢°ìÈÌŪ¤Ë»È¤ï¤ì¤ë¥Û¥¹¥È̾ (Î㤨¤Ð +.IR localhost ) +¤Ê¤É¤Î¤¿¤á¤ËÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O The Berkeley Internet Name Domain (BIND) Server implements the +.\"O Internet name server for Unix systems. +.\"O It augments or replaces the +.\"O .I /etc/hosts +.\"O file or hostname lookup, and frees a host from relying on +.\"O .I /etc/hosts +.\"O being up to date and complete. +Berkeley Internet Name Domain (BIND) ¥µ¡¼¥Ð¤Ï¡¢ +Unix ¥·¥¹¥Æ¥à¤Î¤¿¤á¤Î¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Í¡¼¥à¥µ¡¼¥Ð¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¡¢ +.I /etc/hosts +¥Õ¥¡¥¤¥ë¤ä¥Û¥¹¥È̾¥ë¥Ã¥¯¥¢¥Ã¥×¤ò³ÈÄ¥¤·¤¿¤êÃÖ¤­´¹¤¨¤¿¤ê¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë¤è¤ê³Æ¥Û¥¹¥È¤Ï +.I /etc/hosts +¤òºÇ¿·¤«¤Ä´°Á´¤ËÊݤ¿¤Ê¤¯¤Æ¤â¤è¤¯¤Ê¤ë¡£ +.PP +.\"O In modern systems, even though the host table has been superseded by +.\"O DNS, it is still widely used for: +¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤Ï¡¢DNS ¤Ë¤È¤Ã¤ÆÂå¤ï¤é¤ì¤¿¤Ë¤â¤«¤«¤ï¤é¤º¡¢ +¸½ºß¤Î¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¼¡¤Î¤è¤¦¤ÊÍÑÅӤǹ­¤¯»È¤ï¤ì¤Æ¤¤¤ë¡£ +.TP +.\"O .B bootstrapping +.B ¥Ö¡¼¥È»þ +.\"O Most systems have a small host table containing the name and address +.\"O information for important hosts on the local network. +.\"O This is useful +.\"O when DNS is not running, for example during system bootup. +ÂçÉôʬ¤Î¥·¥¹¥Æ¥à¤Ï¡¢¥í¡¼¥«¥ë¥Í¥Ã¥È¥ï¡¼¥¯¤Ë¤ª¤¤¤Æ½ÅÍפʥۥ¹¥È¤Î +̾Á°¤È¥¢¥É¥ì¥¹¤¬´Þ¤Þ¤ì¤¿¾®¤µ¤Ê¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¡¢¥·¥¹¥Æ¥à¤Î¥Ö¡¼¥È»þ¤Ê¤É¤Î DNS ¤¬²ÔƯ¤·¤Æ¤¤¤Ê¤¤¤È¤­¤ËÌòΩ¤Ä¡£ +.TP +.B NIS +.\"O Sites that use NIS use the host table as input to the NIS host +.\"O database. +.\"O Even though NIS can be used with DNS, most NIS sites still +.\"O use the host table with an entry for all local hosts as a backup. +NIS ¤ò»ÈÍѤ·¤Æ¤¤¤ë¥µ¥¤¥È¤Ï¡¢¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤ò +NIS ¥Û¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÆþÎϤȤ·¤ÆÍѤ¤¤ë¡£ +NIS ¤ò DNS ¤È¶¦¤Ë»ÈÍѤǤ­¤ë¤Ë¤â¤«¤«¤ï¤é¤º¡¢ +ÂçÉôʬ¤Î NIS ¥µ¥¤¥È¤Ï̤¤À¤Ë¡¢ +Á´¤Æ¤Î¥í¡¼¥«¥ë¥Û¥¹¥È¤Î¥¨¥ó¥È¥ê¤ò¤â¤Ä¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤ò +¥Ð¥Ã¥¯¥¢¥Ã¥×¤È¤·¤Æ»ÈÍѤ·¤Æ¤¤¤ë¡£ +.TP +.\"O .B isolated nodes +.B ³ÖÀ䤵¤ì¤¿¥Î¡¼¥É +.\"O Very small sites that are isolated from the network use the host table +.\"O instead of DNS. +.\"O If the local information rarely changes, and the +.\"O network is not connected to the Internet, DNS offers little +.\"O advantage. +¥Í¥Ã¥È¥ï¡¼¥¯¤«¤é³ÖÀ䤵¤ì¤¿Èó¾ï¤Ë¾®¤µ¤Ê¥µ¥¤¥È¤Ï¡¢ +DNS ¤ÎÂå¤ï¤ê¤Ë¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ·¤Æ¤¤¤ë¡£ +¥í¡¼¥«¥ë¾ðÊ󤬵©¤Ë¤·¤«Êѹ¹¤µ¤ì¤º¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¤¬¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤ÈÀܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +DNS ¤Ë¤½¤ì¤Û¤É¤ÎÍøÅÀ¤Ï¤Ê¤¤¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.I /etc/hosts +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Modifications to this file normally take effect immediately, +.\"O except in cases where the file is cached by applications. +¤³¤Î¥Õ¥¡¥¤¥ë¤Ø¤ÎÊѹ¹¤ÏÄ̾魯¤°¤ËÈ¿±Ç¤µ¤ì¤ë¡£Ã¢¤·¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó +¤Ë¤è¤ê¥Õ¥¡¥¤¥ë¤ÎÆâÍƤ¬¥­¥ã¥Ã¥·¥å¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¤³¤Î¸Â¤ê¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SS "Historical Notes" +.SS Îò»ËŪ¤Ê·Ð°Þ +.\"O RFC\ 952 gave the original format for the host table, though it has +.\"O since changed. +¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¤½¤Î¸åÊѹ¹¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +¸µ¡¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï RFC\ 952 ¤Ë¤Ïµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"O Before the advent of DNS, the host table was the only way of resolving +.\"O hostnames on the fledgling Internet. +.\"O Indeed, this file could be +.\"O created from the official host data base maintained at the Network +.\"O Information Control Center (NIC), though local changes were often +.\"O required to bring it up to date regarding unofficial aliases and/or +.\"O unknown hosts. +.\"O The NIC no longer maintains the hosts.txt files, +.\"O though looking around at the time of writing (circa 2000), there are +.\"O historical hosts.txt files on the WWW. +.\"O I just found three, from 92, +.\"O 94, and 95. +DNS ¤ÎÅоì°ÊÁ°¡¢¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤Ï¡¢¶î¤±½Ð¤·¤¿¤Ð¤«¤ê¤Î¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ë¤ª¤±¤ë +¥Û¥¹¥È̾²ò·è¤ÎÍ£°ì¤ÎÊýË¡¤Ç¤¢¤Ã¤¿¡£ +¼ÂºÝ¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ï Network Information Control Center (NIC) ¤Ë¤è¤Ã¤Æ +´ÉÍý¤µ¤ì¤ë¸ø¼°¥Û¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤¿¡£ +¤·¤«¤·¡¢Èó¸ø¼°¤Ê¥¨¥¤¥ê¥¢¥¹¤äÉÔÌÀ¤Ê¥Û¥¹¥È¤ò°·¤¨¤ë¤è¤¦¤Ë¡¢ +ºÇ¿·¤ËÊݤĤ¿¤á¤Î¥í¡¼¥«¥ë¤ÊÊѹ¹¤¬ÉÑÈˤËɬÍפȤµ¤ì¤¿¡£ +NIC ¤Ï´û¤Ë hosts.txt ¤ò´ÉÍý¤·¤Æ¤¤¤Ê¤¤¤¬¡¢ +¤³¤ì¤ò½ñ¤¤¤Æ¤¤¤ë (2000 ǯº¢¤Î) »þÅÀ¤ÇÄ´¤Ù¤Æ¤ß¤ë¤È¡¢ +WWW ¾å¤ËÎò»ËŪ¤Ê hosts.txt ¤¬Â¸ºß¤¹¤ë¡£ +92, 94, 95 ǯ¤Î¤â¤Î¤¬¸«¤Ä¤«¤Ã¤¿¡£ +.\"O .SH EXAMPLE +.SH Îã +.nf +127.0.0.1 localhost +192.168.1.10 foo.mydomain.org foo +192.168.1.13 bar.mydomain.org bar +146.82.138.7 master.debian.org master +209.237.226.90 www.opensource.org +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR hostname (1), +.BR resolver (3), +.BR resolver (5), +.BR hostname (7), +.BR named (8), +Internet RFC\ 952 +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\"O .\" This manual page was written by Manoj Srivastava , +.\"O .\" for the Debian GNU/Linux system. +.\" ¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï¡¢Debian GNU/Linux ¥·¥¹¥Æ¥à¤Î¤¿¤á¤Ë +.\" Manoj Srivastava ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ diff --git a/draft/man5/hosts.equiv.5 b/draft/man5/hosts.equiv.5 new file mode 100644 index 00000000..ebd6d2e9 --- /dev/null +++ b/draft/man5/hosts.equiv.5 @@ -0,0 +1,121 @@ +.\" Copyright (c) 1995 Peter Tobias +.\" This file may be distributed under the GNU General Public License. +.\" +.\" Japanese Version Copyright (c) 2000 NAKANO Takeo all rights reserved. +.\" Translated 2000-03-12, NAKANO Takeo +.\" Modified 2005-02-20, Akihiro MOTOKI +.\" +.TH HOSTS.EQUIV 5 2003-08-24 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O /etc/hosts.equiv \- list of hosts and users that are granted "trusted" +.\"O \fBr\fP command access to your system +.SH ̾Á° +/etc/hosts.equiv \- ¡Ö¿®Íꤵ¤ì¤¿¡×\fBr\fP ¥³¥Þ¥ó¥É¤Ë¤è¤ë¥·¥¹¥Æ¥à¤Ø¤Î +¥¢¥¯¥»¥¹¤òµö²Ä¤¹¤ë¥Û¥¹¥È¤ª¤è¤Ó¥æ¡¼¥¶¤Î¥ê¥¹¥È +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The \fBhosts.equiv\fP file allows or denies hosts and users to use +.\"O the \fBr\fP-commands (e.g., \fBrlogin\fP, \fBrsh\fP or \fBrcp\fP) without +.\"O supplying a password. +.B hosts.equiv +¥Õ¥¡¥¤¥ë¤Ï \fBr\fP-¥³¥Þ¥ó¥É +.RB ( rlogin ", " rsh ", " rcp +¤Ê¤É) ¤Ë¤è¤ë¥Ñ¥¹¥ï¡¼¥É¤Ê¤·¤Ç¤ÎÍøÍѤò +µö²Ä/µñÈݤ¹¤ë¥Û¥¹¥È/¥æ¡¼¥¶¤òÀßÄꤹ¤ë¡£ +.PP +.\"O The file uses the following format: +¤³¤Î¥Õ¥¡¥¤¥ë¤Ç¤Ï°Ê²¼¤Î½ñ¼°¤òÍѤ¤¤ë¡£ +.TP +\fI[ + | \- ]\fP \fI[hostname]\fP \fI[username]\fP +.PP +.\"O The \fIhostname\fP is the name of a host which is logically equivalent +.\"O to the local host. +.\"O Users logged into that host are allowed to access +.\"O like-named user accounts on the local host without supplying a password. +.\"O The \fIhostname\fP may be (optionally) preceded by a plus (+) sign. +.\"O If the plus sign is used alone it allows any host to access your system. +.\"O You can explicitly deny access to a host by preceding the \fIhostname\fP +.\"O by a minus (\-) sign. +.\"O Users from that host must always supply a password. +.\"O For security reasons you should always use the FQDN of the hostname and +.\"O not the short hostname. +.I hostname +¤Ï¡¢¥í¡¼¥«¥ë¥Û¥¹¥È¤ÈÏÀÍýŪ¤ËÅù²Á¤Ê¥Û¥¹¥È¤Î̾Á°¤Ç¤¢¤ë¡£ +¤½¤Î¥Û¥¹¥È¤Ë¥í¥°¥¤¥ó¤·¤Æ¤¤¤ë¥æ¡¼¥¶¤Ï¡¢¥Ñ¥¹¥ï¡¼¥É¤Ê¤·¤Ç +¥í¡¼¥«¥ë¥Û¥¹¥È¤ÎƱ¤¸Ì¾Á°¤Î¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È¤Ë¥¢¥«¥¦¥ó¥È¤Ç¤­¤ë¡£ +.I hostname +¤ÎÁ°¤Ë¤Ï¥×¥é¥¹µ­¹æ (+) ¤òÃÖ¤¤¤Æ¤â¤è¤¤¡£¥×¥é¥¹µ­¹æ¤¬Ã±ÆȤÇÃÖ¤«¤ì¤¿¾ì¹ç¤Ï¡¢ +¤³¤Î¥·¥¹¥Æ¥à¤Ø¤Î¥¢¥¯¥»¥¹¤ò¤¢¤é¤æ¤ë¥Û¥¹¥È¤ËÂФ·¤Æµö²Ä¤·¤¿¤³¤È¤Ë¤Ê¤ë¡£ +¥¢¥¯¥»¥¹¤òÌÀ¼¨Åª¤ËµñÈݤ¹¤ë¤Ë¤Ï¡¢ +.I hostname +¤ÎÁ°¤Ë¥Þ¥¤¥Ê¥¹µ­¹æ (\-) ¤òÉÕ¤±¤ë¡£¤½¤Î¥Û¥¹¥È¤«¤é¤Î¥æ¡¼¥¶¤Ï +¾ï¤Ë¥Ñ¥¹¥ï¡¼¥É¤òÍ׵ᤵ¤ì¤ë¡£¥»¥­¥å¥ê¥Æ¥£¾å¡¢¥Û¥¹¥È̾¤Ï +û¤¤Ì¾Á°¤Ç¤Ï¤Ê¤¯¾ï¤Ë FQDN ¤ò»È¤Ã¤Æ»ØÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.\"O The \fIusername\fP entry grants a specific user access to all user +.\"O accounts (except root) without supplying a password. +.\"O That means the +.\"O user is NOT restricted to like-named accounts. +.\"O The \fIusername\fP may +.\"O be (optionally) preceded by a plus (+) sign. +.\"O You can also explicitly +.\"O deny access to a specific user by preceding the \fIusername\fP with +.\"O a minus (\-) sign. +.\"O This says that the user is not trusted no matter +.\"O what other entries for that host exist. +.I username +¥¨¥ó¥È¥ê¤Ï¡¢ÆÃÄê¤Î¥æ¡¼¥¶¤ËÂФ·¤Æ¡¢ (root °Ê³°¤Î) ¤¢¤é¤æ¤ë¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È +¤Ø¤Î¥¢¥¯¥»¥¹¤ò¥Ñ¥¹¥ï¡¼¥É¤Ê¤·¤Çµö²Ä¤¹¤ë¡£¤¹¤Ê¤ï¤Á¡¢¤½¤Î¥æ¡¼¥¶¤ÏƱ¤¸Ì¾Á°¤Î +¥¢¥«¥¦¥ó¥È°Ê³°¤Ë¤â¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.I username +¤ÎÁ°¤Ë¤Ï¥×¥é¥¹µ­¹æ (+) ¤òÃÖ¤¤¤Æ¤â¤è¤¤¡£ +ÆÃÄê¤Î¥æ¡¼¥¶¤«¤é¤Î¥¢¥¯¥»¥¹¤òÌÀ¼¨Åª¤ËµñÈݤ¹¤ë¤Ë¤Ï¡¢ +.I username +¤ÎÁ°¤Ë¥Þ¥¤¥Ê¥¹µ­¹æ (\-) ¤òÉÕ¤±¤ë¡£¤³¤¦¤¹¤ë¤È¡¢ +¥Û¥¹¥È¤Î¥¨¥ó¥È¥ê¤¬¤Ê¤ó¤È¸À¤ª¤¦¤È¤â¡¢¤½¤Î¥æ¡¼¥¶¤Ï¿®Íꤵ¤ì¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£ +.PP +.\"O Netgroups can be specified by preceding the netgroup by an @ sign. +netgroup ¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¡¢¤½¤Î¾ì¹ç¤Ï @ µ­¹æ¤òÁ°¤Ë¤Ä¤±¤ë¡£ +.PP +.\"O Be extremely careful when using the plus (+) sign. +.\"O A simple typographical +.\"O error could result in a standalone plus sign. +.\"O A standalone plus sign is +.\"O a wildcard character that means "any host"! +¥×¥é¥¹µ­¹æ (+) ¤òÍøÍѤ¹¤ëºÝ¤Ë¤Ï¤¯¤ì¤°¤ì¤âÃí°Õ¤¹¤ë¤³¤È¡£ +ñ½ã¤Ê¥ß¥¹¥¿¥¤¥×¤Ç¡¢Ã±ÆȤΥץ饹µ­¹æ¤òÃÖ¤¤¤Æ¤·¤Þ¤¦¤³¤È¤¬¤¢¤ë¡£ +ñÆȤΥץ饹µ­¹æ¤Ï¡Ö¤¹¤Ù¤Æ¤Î¥Û¥¹¥È¡×¤òɽ¤¹¥ï¥¤¥ë¥É¥«¡¼¥É¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦! +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.I /etc/hosts.equiv +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Some systems will only honor the contents of this file when it has owner +.\"O root and no write permission for anybody else. +.\"O Some exceptionally +.\"O paranoid systems even require that there be no other hard links to the file. +¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍƤ¬¸úÎϤò»ý¤Ä¤Î¤Ï¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤¬ root ¤Ç¡¢ +¤«¤Ä¤½¤ì°Ê³°¤Ë½ñ¤­¹þ¤ß¸¢¸Â¤¬¤Ê¤¤¾ì¹ç¤Ë¸ÂÄꤵ¤ì¤Æ¤¤¤ë¤³¤È¤â¤¢¤ë¡£ +¤Þ¤¿¡¢Èó¾ï¤ËÀ©¸Â¤¬¤­¤Ä¤¤¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¾¤Î +¥Ï¡¼¥É¥ê¥ó¥¯¤¬¤Ê¤¤¤³¤È¤¬Í׵ᤵ¤ì¤ë¾ì¹ç¤â¤¢¤ë¡£ +.PP +.\"O Modern systems use the Pluggable Authentication Modules library (PAM). +.\"O With PAM a standalone plus sign is only considered a wildcard +.\"O character which means "any host" when the word +.\"O .I promiscuous +.\"O is added to the auth component line in your PAM file for +.\"O the particular service +.\"O .RB "(e.g., " rlogin ). +ºÇ¶á¤Î¥·¥¹¥Æ¥à¤Ç¤Ï Pluggable Authentication Modules library (PAM) ¤¬ +»È¤ï¤ì¤Æ¤¤¤ë¡£PAM ¤Ç¤Ï¡¢Ã±ÆȤΥץ饹µ­¹æ¤¬¡Ö¤¹¤Ù¤Æ¤Î¥Û¥¹¥È¡×¤òɽ¤¹ +¥ï¥¤¥ë¥É¥«¡¼¥É¤È¤·¤Æ°·¤ï¤ì¤ë¤Î¤Ï¡¢ÆÃÄê¤Î¥µ¡¼¥Ó¥¹ (Î㤨¤Ð +.BR rlogin ) +ÍѤΠPAM ¥Õ¥¡¥¤¥ë¤Ç auth ¹Ô¤Ë¥­¡¼¥ï¡¼¥É +.I promiscuous +¤¬Äɲ䵤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ß¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR rhosts (5), +.BR rlogind (8), +.BR rshd (8) diff --git a/draft/man5/intro.5 b/draft/man5/intro.5 new file mode 100644 index 00000000..69978ce0 --- /dev/null +++ b/draft/man5/intro.5 @@ -0,0 +1,52 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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 +.\" +.TH INTRO 5 2007-10-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.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) diff --git a/draft/man5/issue.5 b/draft/man5/issue.5 new file mode 100644 index 00000000..39e3e996 --- /dev/null +++ b/draft/man5/issue.5 @@ -0,0 +1,60 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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 +.\" +.TH ISSUE 5 1993-07-24 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.SH ¥Õ¥¡¥¤¥ë +/etc/issue +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR motd (5), +.BR agetty (8), +.BR mingetty (8) diff --git a/draft/man5/locale.5 b/draft/man5/locale.5 new file mode 100644 index 00000000..6ae1308a --- /dev/null +++ b/draft/man5/locale.5 @@ -0,0 +1,1064 @@ +.\" Hey Emacs, this is -*- nroff -*- +.\" +.\" This file is part of locale(1) which displays the settings of the +.\" current locale. +.\" Copyright (C) 1994 Jochen Hein (Hein@Student.TU-Clausthal.de) +.\" Copyright (C) 2008 Petr Baudis (pasky@suse.cz) +.\" +.\" 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, USA. +.\" +.\" 2008-06-17 Petr Baudis +.\" LC_TIME: Describe first_weekday and first_workday +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1998-02-11, HANATAKA Shinya +.\" Updated & Modified 2001-10-18, AKihiro MOTOKI +.\" Updated 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" +.TH LOCALE 5 2008-06-17 "Linux" "Linux User Manual" +.\"O .SH NAME +.\"O locale \- Describes a locale definition file +.SH ̾Á° +locale \- ¥í¥±¡¼¥ëÄêµÁ¥Õ¥¡¥¤¥ë +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .B locale +.\"O definition files contains all the information that the +.\"O .BR localedef (1) +.\"O command needs to convert it into the binary locale database. +.B "¥í¥±¡¼¥ë (locale)" +ÄêµÁ¥Õ¥¡¥¤¥ë¤Ï +.BR localedef (1) +¥³¥Þ¥ó¥É¤¬¥Ð¥¤¥Ê¥ê¤Î¥í¥±¡¼¥ë¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÊÑ´¹¤¹¤ë¤Î¤Ë +ɬÍפÊÁ´¤Æ¤Î¾ðÊó¤ò´Þ¤ó¤Ç¤¤¤ë¡£ + +.\"O The definition files consist of sections which each describe a +.\"O locale category in detail. +ÄêµÁ¥Õ¥¡¥¤¥ë¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¥»¥¯¥·¥ç¥ó¤«¤é¹½À®¤µ¤ì¤Æ¤ª¤ê¡¢³Æ¥»¥¯¥·¥ç¥ó +¤Ë¤Ï¥í¥±¡¼¥ë¤Î¥«¥Æ¥´¥ê¤¬¾ÜºÙ¤Ëµ­½Ò¤µ¤ì¤ë¡£ + +.\"O .SS Syntax +.SS ʸˡ +.\"O The locale definition file starts with a header that may consist +.\"O of the following keywords: +¥í¥±¡¼¥ëÄêµÁ¥Õ¥¡¥¤¥ë¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤«¤é¹½À®¤µ¤ì¤ë¥Ø¥Ã¥À¡¼¤Ç»Ï¤Þ¤ë: +.TP +.I +.\"O is followed by a character that should be used as the +.\"O escape-character for the rest of the file to mark characters that +.\"O should be interpreted in a special way. +.\"O It defaults to the backslash (\\). +¥Õ¥¡¥¤¥ë¤Î»Ä¤ê¤ÎÉôʬ¤Ç¥¨¥¹¥±¡¼¥×¡¦¥­¥ã¥é¥¯¥¿¡¼¤È¤·¤Æ»ÈÍѤ¹¤ëʸ»ú¤ò +»ØÄꤹ¤ë¡£¤³¤ì¤ÏÆüì¤Ê°ÕÌ£¤Ë²ò¼á¤µ¤ì¤ëʸ»ú¤ò¥¨¥¹¥±¡¼¥×¤¹¤ë¤Î¤Ë»ÈÍѤ¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å (\\) ¤Ç¤¢¤ë¡£ +.TP +.I +.\"O is followed by a character that will be used as the +.\"O comment-character for the rest of the file. +.\"O It defaults to the number sign (#). +¥Õ¥¡¥¤¥ë¤Î»Ä¤ê¤ÎÉôʬ¤Ç¥³¥á¥ó¥È¡¦¥­¥ã¥é¥¯¥¿¡¼¤È¤·¤Æ»ÈÍѤ¹¤ëʸ»ú +¤ò»ØÄꤹ¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥·¥ã¡¼¥× (#) ¤Ç¤¢¤ë¡£ +.PP +.\"O The locale definition has one part for each locale category. +.\"O Each part can be copied from another existing locale or +.\"O can be defined from scratch. +.\"O If the category should be copied, +.\"O the only valid keyword in the definition is +.\"O .B copy +.\"O followed by the name of the locale which should be copied. +¥í¥±¡¼¥ë¤ÎÄêµÁ¤Ï¥í¥±¡¼¥ë¤Î¥«¥Æ¥´¥êËè¤ÎÄêµÁ¤ò¹Ô¤¦Éôʬ¤«¤é¹½À®¤µ¤ì¤ë¡£ +³ÆÉôʬ¤Ï¡¢ÄêµÁºÑ¤ß¤Î¾¤Î¥í¥±¡¼¥ë¤Î¥³¥Ô¡¼¤ò¸µ¤ËÄêµÁ¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¤·¡¢ +ºÇ½é¤«¤éÄêµÁ¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£¥«¥Æ¥´¥ê¤ò¥³¥Ô¡¼¤¹¤ë¾ì¹ç¡¢ÄêµÁ¤ÎÃæ¤Ë +.B copy +¤È¤¤¤¦¥­¡¼¥ï¡¼¥É¤Ë³¤±¤Æ¥³¥Ô¡¼¤¹¤ë¥í¥±¡¼¥ë¤Î̾Á°¤ò½ñ¤¯¡£ +.\" FIXME glibc 2.2.2 added new nonstandard locale categories: +.\" LC_ADDRESS, LC_IDENTIFICATION, LC_MEASUREMENT, LC_NAME, +.\" LC_PAPER, LC_TELEPHONE. +.\"O These need to be documented. +.\"O .SS LC_CTYPE +.\"O The definition for the +.\"O .B LC_CTYPE +.\"O category starts with the string +.\"O .I LC_CTYPE +.\"O in the first column. +.SS LC_CTYPE +.B LC_CTYPE +¥«¥Æ¥´¥ê¤ÎÄêµÁ¤ÏºÇ½é¤Î¥«¥é¥à¤Ë +.I LC_CTYPE +¤È¤¤¤¦Ê¸»úÎó¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +.\"O There are the following keywords allowed: +¤³¤³¤Ç¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤¬»ÈÍѤǤ­¤ë: +.TP +.\"O .I upper +.\"O followed by a list of uppercase letters. +.\"O The letters +.\"O .B A +.\"O through +.\"O .B Z +.\"O are included automatically. +.\"O Characters also specified as +.\"O .BR cntrl , +.\"O .BR digit , +.\"O .BR punct , +.\"O or +.\"O .B space +.\"O are not allowed. +.I upper +Âçʸ»ú (uppercase letter) ¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.B A +¤«¤é +.B Z +¤Þ¤Ç¤Îʸ»ú¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.BR cntrl , +.BR digit , +.BR punct , +.B space +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.\"O .I lower +.\"O followed by a list of lowercase letters. +.\"O The letters +.\"O .B a +.\"O through +.\"O .B z +.\"O are included automatically. +.\"O Characters also specified as +.\"O .BR cntrl , +.\"O .BR digit , +.\"O .BR punct , +.\"O or +.\"O .B space +.\"O are not allowed. +.I lower +¾®Ê¸»ú (lowercase letter) ¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.B a +¤«¤é +.B z +¤Þ¤Ç¤Îʸ»ú¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.BR cntrl , +.BR digit , +.BR punct , +.B space +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.\"O .I alpha +.\"O followed by a list of letters. +.\"O All character specified as either +.\"O .B upper +.\"O or +.\"O .B lower +.\"O are automatically included. +.\"O Characters also specified as +.\"O .BR cntrl , +.\"O .BR digit , +.\"O .BR punct , +.\"O or +.\"O .B space +.\"O are not allowed. +.I alpha +¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Îʸ»ú¤ò»ØÄꤹ¤ë¡£ +.B upper +¤È +.B lower +¤ò»ØÄꤷ¤¿Á´¤Æ¤Îʸ»ú¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.BR cntrl , +.BR digit , +.BR punct , +.B space +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.\"O .I digit +.\"O followed by the characters classified as numeric digits. +.\"O Only the +.\"O digits +.\"O .B 0 +.\"O through +.\"O .B 9 +.\"O are allowed. +.\"O They are included by default in this class. +.I digit +¿ô»ú¤È¤·¤Æ»ÈÍѤµ¤ì¤ëʸ»ú¤ò»ØÄꤹ¤ë¡£¿ô»ú¤È¤·¤Æ¤Ï +.B 0 +¤«¤é +.B 9 +¤Î¤ß¤¬»ÈÍѤǤ­¤ë¡£¤³¤ì¤é¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.\"O .I space +.\"O followed by a list of characters defined as white-space +.\"O characters. +.\"O Characters also specified as +.\"O .BR upper , +.\"O .BR lower , +.\"O .BR alpha , +.\"O .BR digit , +.\"O .BR graph , +.\"O or +.\"O .B xdigit +.\"O are not allowed. +.\"O The characters +.\"O .BR , +.\"O .BR , +.\"O .BR , +.\"O .BR , +.\"O .BR , +.\"O and +.\"O .B +.\"O are automatically included. +.I space +¶õÇò¤È¤·¤Æ»ÈÍѤ¹¤ëʸ»ú¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR graph , +.B xdigit +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.BR , +.BR , +.BR , +.BR , +.BR , +.B +¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.TP +.\"O .I cntrl +.\"O followed by a list of control characters. +.\"O Characters also specified as +.\"O .BR upper , +.\"O .BR lower , +.\"O .BR alpha , +.\"O .BR digit , +.\"O .BR punct , +.\"O .BR graph , +.\"O .BR print , +.\"O or +.\"O .B xdigit +.\"O are not allowed. +.I cntrl +¥³¥ó¥È¥í¡¼¥ë¡¦¥­¥ã¥é¥¯¥¿¡¼¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR punct , +.BR graph , +.BR print , +.B xdigit +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.\"O .I punct +.\"O followed by a list of punctuation characters. +.\"O Characters also +.\"O specified as +.\"O .BR upper , +.\"O .BR lower , +.\"O .BR alpha , +.\"O .BR digit , +.\"O .BR cntrl , +.\"O .BR xdigit , +.\"O or the +.\"O .B +.\"O character are not allowed. +.I punct +¶çÆÉÅÀʸ»ú¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR cntrl , +.BR xdigit , +.B +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.\"O .I graph +.\"O followed by a list of printable characters, not including the +.\"O .B +.\"O character. +.\"O The characters defined as +.\"O .BR upper , +.\"O .BR lower , +.\"O .BR alpha , +.\"O .BR digit , +.\"O .BR xdigit , +.\"O and +.\"O .B punct +.\"O are automatically included. +.\"O Characters also specified as +.\"O .B cntrl +.\"O are not allowed. +.I graph +ɽ¼¨²Äǽʸ»ú¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¤¬¡¢ +.B +ʸ»ú¤Ï´Þ¤Þ¤Ê¤¤¡£ +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR xdigit , +.B punct +¤ò»ØÄꤷ¤¿Ê¸»ú¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.B cntrl +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.\"O .I print +.\"O followed by a list of printable characters, including the +.\"O .B +.\"O character. +.\"O The characters defined as +.\"O .BR upper , +.\"O .BR lower , +.\"O .BR alpha , +.\"O .BR digit , +.\"O .BR xdigit , +.\"O .BR punct , +.\"O and the +.\"O .B +.\"O character are automatically included. +.\"O Characters also specified as +.\"O .B cntrl +.\"O are not allowed. +.I print +.B +ʸ»ú¤ò´Þ¤á¤¿É½¼¨²Äǽʸ»ú¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR xdigit , +.BR punct , +.B +¤Ë»ØÄꤷ¤¿Ê¸»ú¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.B cntrl +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.\"O .I xdigit +.\"O followed by a list of characters classified as hexadecimal +.\"O digits. +.\"O The decimal digits must be included followed by one or +.\"O more set of six characters in ascending order. +.\"O The following +.\"O characters are included by default: +.\"O .B 0 +.\"O through +.\"O .BR 9 , +.\"O .B a +.\"O through +.\"O .BR f , +.\"O .B A +.\"O through +.\"O .BR F . +.I xdigit +16 ¿Ê¿ô¤È¤·¤Æ»ÈÍѤ¹¤ëʸ»ú¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£10 ¿Ê¤Î¿ô»ú¤Ë²Ã¤¨¤Æ¡¢ +6 ʸ»ú¤ò¾º½ç¤Ç³¤±¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï°Ê²¼¤Îʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë: +.B 0 +¤«¤é +.BR 9 ¡¢ +.B a +¤«¤é +.BR f ¡¢ +.B A +¤«¤é +.BR F ¡£ +.TP +.\"O .I blank +.\"O followed by a list of characters classified as +.\"O .BR blank . +.\"O The characters +.\"O .B +.\"O and +.\"O .B +.\"O are automatically included. +.I blank +.B "̵ÃÏ (blank)" +¤ËʬÎव¤ì¤ëʸ»ú¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.B +¤È +.B +¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.TP +.\"O .I toupper +.\"O followed by a list of mappings from lowercase to uppercase +.\"O letters. +.\"O Each mapping is a pair of a lowercase and an uppercase letter +.\"O separated with a +.\"O .B , +.\"O and enclosed in parentheses. +.\"O The members of the list are separated +.\"O with semicolons. +.I toupper +¾®Ê¸»ú¤«¤éÂçʸ»ú¤Ø¤ÎÂбþ¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£³ÆÂбþ¤Ï¾®Ê¸»ú¤ÈÂçʸ»ú¤Î¥Ú¥¢¤ò +.B , +¤Ç¶èÀڤäƳç¸Ì¤Ç³ç¤Ã¤Æ»ØÄꤹ¤ë¡£ +¥ê¥¹¥È¤Î³Æ¥á¥ó¥Ð¡¼¤Ï¥»¥ß¥³¥í¥ó¤Ç¶èÀڤ롣 +.TP +.\"O .I tolower +.\"O followed by a list of mappings from uppercase to lowercase +.\"O letters. +.\"O If the keyword tolower is not present, the reverse of the +.\"O toupper list is used. +.I tolower +Âçʸ»ú¤«¤é¾®Ê¸»ú¤Ø¤ÎÂбþ¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£tolower ¤È¤¤¤¦ +¥­¡¼¥ï¡¼¥É¤¬Ìµ¤¤¾ì¹ç¤Ë¤Ï toupper ¤òµÕ¤Ë¤·¤¿¤â¤Î¤¬»ÈÍѤµ¤ì¤ë¡£ +.PP +.\"O The +.\"O .B LC_CTYPE +.\"O definition ends with the string +.\"O .IR "END LC_CYTPE" . +.B LC_CTYPE +¤ÎÄêµÁ¤Ï +.I "END LC_CYTPE" +¤È¤¤¤¦Ê¸»úÎó¤Ç½ªÎ»¤¹¤ë¡£ +.\"O .SS LC_COLLATE +.\"O The +.\"O .B LC_COLLATE +.\"O category defines the rules for collating characters. +.\"O Due to +.\"O limitations of libc not all POSIX-options are implemented. +.SS LC_COLLATE +.B LC_COLLATE +¥«¥Æ¥´¥ê¤ÏÀ°Îó½ç½ø¤òÄêµÁ¤·¤Æ¤¤¤ë¡£libc ¤Ë¤è¤ëÀ©¸Â¤Î¤¿¤á +POSIX ¥ª¥×¥·¥ç¥ó¤ÎÁ´¤Æ¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ + +.\"O The definition starts with the string +.\"O .B LC_COLLATE +.\"O in the first column. +¤³¤Î¥«¥Æ¥´¥ê¤ÎÄêµÁ¤ÏºÇ½é¤Î¥«¥é¥à¤Ë +.B LC_COLLATE +¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +.\"O There are the following keywords allowed: +¤³¤³¤Ç¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤¬»ÈÍѤǤ­¤ë: +.TP +.I collating-element +.TP +.I collating-symbol +.PP +.\"O The order-definition starts with a line: +.\"O .TP +.\"O .I order_start +.\"O .PP +.\"O followed by a list of keywords out of +.\"O .BR forward , +.\"O .BR backward , +.\"O or +.\"O .BR position . +.\"O The order definition consists of lines that describe the order +.\"O and is terminated with the keyword +.\"O .TP +.\"O .IR order_end . +½ç½ø¤ÎÄêµÁ¤Ï°Ê²¼¤Î¹Ô¤Ç»Ï¤á¤ë: +.TP +.I order_start +.PP +¤³¤ì¤Ë +.BR forward , +.BR backward , +.B position +¤Î¤¤¤º¤ì¤«¤Î¥­¡¼¥ï¡¼¥É¤¬Â³¤¯¡£ +½ç½ø¤òµ­½Ò¤¹¤ë¹Ô¤¬Â³¤­¡¢°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤Ç½ª¤ë: +.TP +.I order_end +.PP +.\"O For more details see the sources in +.\"O .I /usr/lib/nls/src +.\"O notably the examples +.\"O .BR POSIX , +.\"O .B Example +.\"O and +.\"O .B Example2 +¤è¤ê¾Ü¤·¤¯¤Ï +.I /usr/lib/nls/src +¤Ë¤¢¤ë¥½¡¼¥¹¡¦¥Õ¥¡¥¤¥ë¤ò»²¾È¤Î¤³¤È¡£ÆÃ¤Ë +.B POSIX +¤ÎÎã¡¢ +.B Example +¤È +.B Example2 +¤ò¸«¤ë¤È¤è¤¤¡£ +.PP +.\"O The +.\"O .B LC_COLLATE +.\"O definition ends with the string +.\"O .IR "END LC_COLLATE" . +.B LC_COLLATE +ÄêµÁ¤Ï +.I "END LC_COLLATE" +¤È¤¤¤¦Ê¸»úÎó¤Ç½ªÎ»¤¹¤ë¡£ +.\"O .SS LC_MONETARY +.\"O The definition starts with the string +.\"O .B LC_MONETARY +.\"O in the first column. +.SS LC_MONETARY +.B LC_MONETARY +¤ÎÄêµÁ¤ÏºÇ½é¤Î¥«¥é¥à¤Ë +.B LC_MONETARY +¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +.\"O There are the following keywords allowed: +¤³¤³¤Ç¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë: +.TP +.\"O .I int_curr_symbol +.\"O followed by the international currency symbol. +.\"O This must be a +.\"O 4-character string containing the international currency symbol as +.\"O defined by the ISO 4217 standard (three characters) followed by a +.\"O separator. +.I int_curr_symbol +¹ñºÝÄ̲ߵ­¹æ¤ò»ØÄꤹ¤ë¡£¤³¤ì¤Ï ISO 4217 µ¬³Ê¤ËÄêµÁ¤µ¤ì¤¿¹ñºÝÄÌ²ß +µ­¹æ (3 ʸ»ú) ¤Ë¶èÀÚ¤êʸ»ú¤ò³¤±¤¿ 4 ʸ»ú¤Ç¤¢¤ëɬÍפ¬¤¢¤ë¡£ +.TP +.\"O .I currency_symbol +.\"O followed by the local currency symbol. +.I currency_symbol +ÃÏ°èŪ¤ÊÄ̲ߵ­¹æ¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I mon_decimal_point +.\"O followed by the string that will be used as the decimal delimiter +.\"O when formatting monetary quantities. +.I mon_decimal_point +¶â³Û¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ëºÝ¤Î¾®¿ôÅÀ¤Ë»ÈÍѤ¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I mon_thousands_sep +.\"O followed by the string that will be used as a group separator +.\"O when formatting monetary quantities. +.I mon_thousands_sep +¶â³Û¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ëºÝ¤Ë·å¤Î¶èÀÚ¤ê¤Ë»ÈÍѤ¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I mon_grouping +.\"O followed by a string that describes the formatting of numeric +.\"O quantities. +.I mon_grouping +¿ô»ú¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¤¹¤ëºÝ¤Ë²¿·å¤´¤È¤Ë¶èÀڤ뤫¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I positive_sign +.\"O followed by a string that is used to indicate a positive sign for +.\"O monetary quantities. +.I positive_sign +¿ôÃͤˤª¤¤¤ÆÀµ¤ÎÉä¹æ¤Ë»ÈÍѤ¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I negative_sign +.\"O followed by a string that is used to indicate a negative sign for +.\"O monetary quantities. +.I negative_sign +¿ôÃͤˤª¤¤¤ÆÉé¤ÎÉä¹æ¤Ë»ÈÍѤ¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I int_frac_digits +.\"O followed by the number of fractional digits that should be used when +.\"O formatting with the +.\"O .BR int_curr_symbol . +.I int_frac_digits +.B int_curr_symbol +¤Ç¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ë»þ¤Ë»ÈÍѤ¹¤Ù¤­Ã¼¿ô¤Î·å¿ô¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I frac_digits +.\"O followed by the number of fractional digits that should be used when +.\"O formatting with the +.\"O .BR currency_symbol . +.I frac_digits +.B currency_symbol +¤Ç¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ëºÝ¤Ë»ÈÍѤ¹¤Ù¤­Ã¼¿ô¤Î·å¿ô¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I p_cs_precedes +.\"O followed by an integer set to +.\"O .B 1 +.\"O if the +.\"O .I currency_symbol +.\"O or +.\"O .I int_curr_symbol +.\"O should precede the formatted monetary quantity or set to +.\"O .B 0 +.\"O if the symbol succeeds the value. +.I p_cs_precedes +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤·¤¿¶â³Û¤ÎÁ°¤ËÉÕ¤±¤ë¾ì¹ç¤Ë¤Ï +.B 1 +¤ò¡¢¸å¤í¤ËÉÕ¤±¤ë¾ì¹ç¤Ë¤Ï +.B 0 +¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I p_sep_by_space +.\"O followed by an integer. +.\"O .RS +.\"O .TP +.\"O .B 0 +.\"O means that no space should be printed between the symbol and the +.\"O value. +.\"O .TP +.\"O .B 1 +.\"O means that a space should be printed between the symbol and the +.\"O value. +.\"O .TP +.\"O .B 2 +.\"O means that a space should be printed between the symbol and the +.\"O sign string, if adjacent. +.\"O .RE +.I p_sep_by_space +°Ê²¼¤ÎÀ°¿ô¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ +.RS +.TP +.B 0 +µ­¹æ¤È¿ôÃͤδ֤˶õÇò¤òÆþ¤ì¤Ê¤¤¡£ +.TP +.B 1 +µ­¹æ¤È¿ôÃͤδ֤˶õÇò¤òÆþ¤ì¤ë¡£ +.TP +.B 2 +µ­¹æ¤È¿ôÃͤ¬ÎÙÀܤ·¤Æ¤¤¤ì¤Ð´Ö¤Ë¶õÇò¤òÆþ¤ì¤ë¡£ +.RE +.TP +.\"O .I n_cs_precedes +.\"O .RS +.\"O .TP +.\"O .B 0 +.\"O - the symbol succeeds the value. +.\"O .TP +.\"O .B 1 +.\"O - the symbol precedes the value. +.\"O .RE +.I n_cs_precedes +.RS +.TP +.B 0 +- µ­¹æ¤Ï¿ôÃͤθå¤Ë¤ª¤¯¡£ +.TP +.B 1 +- µ­¹æ¤Ï¿ôÃͤÎÁ°¤Ë¤ª¤¯¡£ +.RE +.TP +.\"O .I n_sep_by_space +.\"O An integer set to +.\"O .B 0 +.\"O if no space separates the +.\"O .I currency_symbol +.\"O or +.\"O .I int_curr_symbol +.\"O from the value for a negative monetary quantity, set to +.\"O .B 1 +.\"O if a space separates the symbol from the value and set to +.\"O .B 2 +.\"O if a space separates the symbol and the sign string, if adjacent. +.I n_sep_by_space +°Ê²¼¤ÎÀ°¿ô¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ +.RS +.TP +.B 0 +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ÈÉé¤Î¶â³Û¤È¤Î´Ö¤Ë¶õÇò¤òÆþ¤ì¤Ê¤¤¡£ +.TP +.B 1 +Éé¤Î¿ôÃͤȵ­¹æ¤Î´Ö¤Ë¶õÇò¤òÆþ¤ì¤ë¡£ +.TP +.B 2 +ÎÙÀܤ·¤Æ¤¤¤¿¾ì¹ç¤Ë¤Î¤ß¶õÇò¤òÆþ¤ì¤ë¡£ +.RE +.TP +.I p_sign_posn +.RS +.TP +.\"O .B 0 +.\"O Parentheses enclose the quantity and the +.\"O .I currency_symbol +.\"O or +.\"O .IR int_curr_symbol . +.B 0 +ÃÍ¤È +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ò³ç¸Ì¤Ç³ç¤ë¡£ +.TP +.\"O .B 1 +.\"O The sign string precedes the quantity and the +.\"O .I currency_symbol +.\"O or the +.\"O .IR int_curr_symbol . +.B 1 +Éä¹æ¤òÃÍ¤È +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ÎÁ°¤ËÃÖ¤¯¡£ +.TP +.\"O .B 2 +.\"O The sign string succeeds the quantity and the +.\"O .I currency_symbol +.\"O or the +.\"O .IR int_curr_symbol . +.B 2 +Éä¹æ¤òÃÍ¤È +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤Î¸å¤ËÃÖ¤¯¡£ +.TP +.\"O .B 3 +.\"O The sign string precedes the +.\"O .I currency_symbol +.\"O or the +.\"O .IR int_curr_symbol . +.B 3 +Éä¹æ¤ò +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ÎÁ°¤ËÃÖ¤¯¡£ +.TP +.\"O .B 4 +.\"O The sign string succeeds the +.\"O .I currency_symbol +.\"O or the +.\"O .IR int_curr_symbol . +.B 4 +Éä¹æ¤ò +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤Î¸å¤ËÃÖ¤¯¡£ +.RE +.TP +.I n_sign_posn +.RS +.TP +.\"O .B 0 +.\"O Parentheses enclose the quantity and the +.\"O .I currency_symbol +.\"O or +.\"O .IR int_curr_symbol . +.B 0 +ÃÍ¤È +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ò³ç¸Ì¤Ç³ç¤ë¡£ +.TP +.\"O .B 1 +.\"O The sign string precedes the quantity and the +.\"O .I currency_symbol +.\"O or the +.\"O .IR int_curr_symbol . +.B 1 +Éä¹æ¤òÃÍ¤È +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ÎÁ°¤ËÃÖ¤¯¡£ +.TP +.\"O .B 2 +.\"O The sign string succeeds the quantity and the +.\"O .I currency_symbol +.\"O or the +.\"O .IR int_curr_symbol . +.B 2 +Éä¹æ¤òÃÍ¤È +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤Î¸å¤ËÃÖ¤¯¡£ +.TP +.\"O .B 3 +.\"O The sign string precedes the +.\"O .I currency_symbol +.\"O or the +.\"O .IR int_curr_symbol . +.B 3 +Éä¹æ¤ò +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ÎÁ°¤ËÃÖ¤¯¡£ +.TP +.\"O .B 4 +.\"O The sign string succeeds the +.\"O .I currency_symbol +.\"O or the +.\"O .IR int_curr_symbol . +.B 4 +Éä¹æ¤ò +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤Î¸å¤ËÃÖ¤¯¡£ +.RE +.PP +.\"O The +.\"O .B LC_MONETARY +.\"O definition ends with the string +.\"O .IR "END LC_MONETARY" . +.B LC_MONETARY +¤ÎÄêµÁ¤Ï +.I "END LC_MONETARY" +¤È¤¤¤¦Ê¸»úÎó¤Ç½ªÎ»¤¹¤ë¡£ +.\"O .SS LC_NUMERIC +.\"O The definition starts with the string +.\"O .B LC_NUMERIC +.\"O in the first column. +.SS LC_NUMERIC +¤³¤Î¥«¥Æ¥´¥ê¤ÎÄêµÁ¤ÏºÇ½é¤Î¥«¥é¥à¤Ë +.B LC_NUMERIC +¤È¤¤¤¦Ê¸»úÎó¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +.\"O The following keywords are allowed: +¤³¤³¤Ç¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤ò»ÈÍѤǤ­¤ë: +.TP +.\"O .I decimal_point +.\"O followed by the string that will be used as the decimal delimiter +.\"O when formatting numeric quantities. +.I decimal_point +¿ôÃͤò¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ëºÝ¤Ë¾®¿ôÅÀ¤Ë»ÈÍѤ¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I thousands_sep +.\"O followed by the string that will be used as a group separator +.\"O when formatting numeric quantities. +.I thousands_sep +¿ôÃͤò¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ëºÝ¤Ë·å¤Î¶èÀÚ¤ê¤Ë»ÈÍѤ¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I grouping +.\"O followed by a string that describes the formatting of numeric +.\"O quantities. +.I grouping +¿ôÃͤò¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ëºÝ¤Ë²¿·å¤´¤È¤Ë¶èÀڤ뤫¤òʸ»úÎó¤Ç»ØÄꤹ¤ë¡£ +.PP +.\"O The +.\"O .B LC_NUMERIC +.\"O definition ends with the string +.\"O .IR "END LC_NUMERIC" . +The +.B LC_NUMERIC +¤ÎÄêµÁ¤Ï +.I "END LC_NUMERIC" +¤È¤¤¤¦Ê¸»úÎó¤Ç½ªÎ»¤¹¤ë¡£ +.\"O .SS LC_TIME +.\"O The definition starts with the string +.\"O .B LC_TIME +.\"O in the first column. +.SS LC_TIME +¤³¤Î¥«¥Æ¥´¥ê¤ÎÄêµÁ¤ÏºÇ½é¤Î¥«¥é¥à¤Ë +.B LC_TIME +¤È¤¤¤¦Ê¸»úÎó¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +.\"O The following keywords are allowed: +¤³¤³¤Ç¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤¬»ÈÍѤǤ­¤ë: +.TP +.\"O .I abday +.\"O followed by a list of abbreviated weekday names. +.\"O The list starts with the first day of the week +.\"O as specified by +.\"O .I week +.\"O (Sunday by default). +.I abday +ÍËÆü¤Î̾Á°¤Î¾Êά·Á¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +¥ê¥¹¥È¤Ï +.I week +¤Ç»ØÄꤵ¤ì¤¿½µ¤Î³«»ÏÍËÆü (¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÆüÍËÆü) ¤«¤é»Ï¤á¤ë¡£ +.TP +.\"O .I day +.\"O followed by a list of weekday names. +.\"O The list starts with the first day of the week +.\"O as specified by +.\"O .I week +.\"O (Sunday by default). +.I day +ÍËÆü¤Î̾Á°¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +¥ê¥¹¥È¤Ï +.I week +¤Ç»ØÄꤵ¤ì¤¿½µ¤Î³«»ÏÍËÆü (¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÆüÍËÆü) ¤«¤é»Ï¤á¤ë¡£ +.TP +.\"O .I abmon +.\"O followed by a list of abbreviated month names. +.I abmon +·î¤Î̾Á°¤Î¾Êά·Á¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I mon +.\"O followed by a list of month names. +.I mon +·î¤Î̾Á°¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I am_pm +.\"O The appropriate representation of the +.\"O .B am +.\"O and +.\"O .B pm +.\"O strings. +.I am_pm +¤½¤ì¤¾¤ì +.B "¸áÁ° (am)" +¤È +.B "¸á¸å (pm)" +¤ËÂбþ¤¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I d_t_fmt +.\"O The appropriate date and time format. +.I d_t_fmt +ŬÀÚ¤ÊÆüÉÕ¤± (date) ¤È»þ¹ï (time) ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I d_fmt +.\"O The appropriate date format. +.I d_fmt +ŬÀÚ¤ÊÆüÉÕ¤± (date) ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I t_fmt +.\"O The appropriate time format. +.I t_fmt +ŬÀڤʻþ¹ï (time) ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .I t_fmt_ampm +.\"O The appropriate time format when using 12h clock format. +.I t_fmt_ampm +12 »þ´ÖÊý¼°¤ò»ÈÍѤ·¤¿»þ¹ï¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë¡£ +.TP +.I week +.\"O followed by a list of three values: +.\"O The number of days in a week (by default 7), +.\"O a date of beginning of the week (by default corresponds to Sunday), +.\"O and the minimal length of the first week in year (by default 4). +3 ¤Ä¤ÎÃͤ«¤é¤Ê¤ë¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +¥ê¥¹¥È¤Ï¡¢°ì½µ´Ö¤ÎÆü¿ô (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 7)¡¢ +½µ¤Î³«»ÏÍËÆü (¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÆüÍˤËÂбþ)¡¢ +°ìǯ¤ÎºÇ½é¤Î½µ¤ÎºÇ¾®¤ÎŤµ (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 4) ¤«¤é¹½À®¤µ¤ì¤ë¡£ +.\"O Regarding the start of the week, +.\"O .B 19971130 +.\"O shall be used for Sunday and +.\"O .B 19971201 +.\"O shall be used for Monday. +.\"O Thus, countries using +.\"O .B 19971130 +.\"O should have local Sunday name as the first day in the +.\"O .I day +.\"O list, +.\"O while countries using +.\"O .B 19971201 +.\"O should have Monday translation as the first item in the +.\"O .I day +.\"O list. +½µ¤Î³«»ÏÍËÆü¤Ë¤Ä¤¤¤Æ¤Ï¡¢½µ¤Î³«»ÏÆü¤¬ÆüÍËÆü¤Î¾ì¹ç¤Ë¤Ï +.B 19971130 +¤ò¡¢·îÍËÆü¤Î¾ì¹ç¤Ë¤Ï +.B 19971201 +¤ò»ÈÍѤ¹¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +.I day +¥ê¥¹¥È¤ÎºÇ½é¤ÎÆü¤È¤·¤Æ¡¢ +.B 19971130 +¤ò»È¤¦¹ñ¤Ç¤Ï¤½¤ÎÃÏ°è¤ÎÆüÍËÆü¤Î̾Á°¤ò¡¢ +.B 19971201 +¤ò»È¤¦¹ñ¤Ç¤Ï¤½¤ÎÃÏ°è¤Î·îÍËÆü¤Î̾Á°¤òÀßÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.\"O .IR first_weekday " (since glibc 2.2)" +.IR first_weekday " (glibc 2.2 °Ê¹ß)" +.\"O Number of the first day from the +.\"O .I day +.\"O list to be shown in calendar applications. +.\"O The default value of +.\"O .B 1 +.\"O corresponds to either Sunday or Monday depending +.\"O on the value of the second +.\"O .I week +.\"O list item. +¥«¥ì¥ó¥À¡¼¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇºÇ½é¤Ëɽ¼¨¤¹¤ëÍËÆü¤Î +.I day +¥ê¥¹¥È¤Ë¤ª¤±¤ëÈֹ档 +¥Ç¥Õ¥©¥ë¥ÈÃͤΠ1 ¤ÏÆüÍËÆü¤«·îÍËÆü¤ËÂбþ¤¹¤ë¡£ +¤É¤Á¤é¤ËÂбþ¤¹¤ë¤«¤Ï +.I week +¥ê¥¹¥È¤ÎÆóÈÖÌܤιàÌܤÎÃͤǷè¤Þ¤ë¡£ +.TP +.\"O .IR first_workday " (since glibc 2.2)" +.IR first_workday " (glibc 2.2 °Ê¹ß)" +.\"O Number of the first working day from the +.\"O .I day +.\"O list. +ºÇ½é¤Î½¢¶ÈÆü¤ò¼¨¤¹ +.I day +¥ê¥¹¥È¤Ë¤ª¤±¤ëÍËÆü¤ÎÈֹ档 +.PP +.\"O The +.\"O .B LC_TIME +.\"O definition ends with the string +.\"O .IR "END LC_TIME" . +.B LC_TIME +¤ÎÄêµÁ¤Ï +.I "END LC_TIME" +¤È¤¤¤¦Ê¸»úÎó¤Ç½ªÎ»¤¹¤ë¡£ +.\"O .SS LC_MESSAGES +.\"O The definition starts with the string +.\"O .B LC_MESSAGES +.\"O in the first column. +.SS LC_MESSAGES +¤³¤Î¥«¥Æ¥´¥ê¤ÎÄêµÁ¤ÏºÇ½é¤Î¥«¥é¥à¤Ë +.B LC_MESSAGES +¤È¤¤¤¦Ê¸»úÎó¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +.\"O The following keywords are allowed: +¤³¤³¤Ç¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤¬»ÈÍѤǤ­¤ë: +.TP +.\"O .I yesexpr +.\"O followed by a regular expression that describes possible +.\"O yes-responses. +.\"O .TP +.\"O .I noexpr +.\"O followed by a regular expression that describes possible +.\"O no-responses. +.I yesexpr +¡Ö¤Ï¤¤ (yes)¡×¤ò°ÕÌ£¤¹¤ëÀµµ¬É½¸½¤ò»ØÄꤹ¤ë¡£ +.TP +.I noexpr +¡Ö¤¤¤¤¤¨ (no)¡×¤ò°ÕÌ£¤¹¤ëÀµµ¬É½¸½¤ò»ØÄꤹ¤ë¡£ +.PP +.\"O The +.\"O .B LC_MESSAGES +.\"O definition ends with the string +.\"O .IR "END LC_MESSAGES" . +.B LC_MESSAGES +¤ÎÄêµÁ¤Ï +.I "END LC_MESSAGES" +¤È¤¤¤¦Ê¸»úÎó¤Ç½ªÎ»¤¹¤ë¡£ + +.\"O See the POSIX.2 standard for details. +¤è¤ê¾Ü¤·¤¯¤Ï POSIX.2 µ¬³Ê¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.\"O /usr/lib/locale/ +.\"O \(em database for the current locale setting of that category +.\"O .br +.\"O /usr/lib/nls/charmap/* \(em charmap-files +/usr/lib/locale/ +\(em ¸½ºß¤Î¥í¥±¡¼¥ëÀßÄê¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.br +/usr/lib/nls/charmap/* \(em ʸ»úÄêµÁ¥Õ¥¡¥¤¥ë +.\"O .SH "CONFORMING TO" +.\"O POSIX.2 +.SH ½àµò +POSIX.2, ISO/IEC 14652. +.\"O .SH BUGS +.\"O This manual page isn't complete. +.SH ¥Ð¥° +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï´°Á´¤Ç¤Ï¤Ê¤¤¡£ +.\"O .\" .SH AUTHOR +.\"O .\" Jochen Hein (Hein@Student.TU-Clausthal.de) +.\" .SH Ãø¼Ô +.\" Jochen Hein (Hein@Student.TU-Clausthal.de) +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR locale (1), +.BR localedef (1) +.BR localeconv (3), +.BR setlocale (3), +.BR charmap (5), diff --git a/draft/man5/motd.5 b/draft/man5/motd.5 new file mode 100644 index 00000000..72819263 --- /dev/null +++ b/draft/man5/motd.5 @@ -0,0 +1,57 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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 +.\" +.TH MOTD 5 1992-12-29 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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) +¤Ë¤è¤Ã¤Æ¥í¥°¥¤¥ó¤¬À®¸ù¤·¤¿¤¢¤È¤Ç¡¢¥í¥°¥¤¥ó¥·¥§¥ë¤¬µ¯Æ°¤µ¤ì¤ëÁ°¤Ë +ɽ¼¨¤µ¤ì¤ë¡£ + +.\"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" ¤ò¤¢¤é¤ï¤·¤Æ¤¤¤Æ¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÅÁÅýŪ +¤Ë¤½¤Î̾¤Î¤È¤ª¤ê¤Ë»È¤ï¤ì¤Æ¤¤¤ë +(¤¹¤Ù¤Æ¤Î¥æ¡¼¥¶¡¼¤Ë¥á¥¤¥ë¤òÁ÷¤ë¤è¤ê¤â¾¯¤Ê¤¤¥Ç¥£¥¹¥¯ÍÆÎ̤·¤«É¬ÍפȤ·¤Ê¤¤)¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +/etc/motd +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR login (1), +.BR issue (5) diff --git a/draft/man5/nologin.5 b/draft/man5/nologin.5 new file mode 100644 index 00000000..81c551bb --- /dev/null +++ b/draft/man5/nologin.5 @@ -0,0 +1,54 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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 +.\" +.TH NOLOGIN 5 1992-12-29 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.SH ¥Õ¥¡¥¤¥ë +/etc/nologin +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR login (1), +.BR shutdown (8) diff --git a/draft/man5/nscd.conf.5 b/draft/man5/nscd.conf.5 new file mode 100644 index 00000000..4e36144f --- /dev/null +++ b/draft/man5/nscd.conf.5 @@ -0,0 +1,271 @@ +.\" -*- nroff -*- +.\" Copyright (c) 1999, 2000 SuSE GmbH Nuernberg, Germany +.\" Author: Thorsten Kukuk +.\" +.\" 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; see the file COPYING. If not, +.\" write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +.\" Boston, MA 02111-1307, USA. +.\" +.\" Japanese Version Copyright (c) 2001 Yuichi SATO +.\" all rights reserved. +.\" Translated 2001-06-09, Yuichi SATO +.\" Updated 2006-07-19, Akihiro MOTOKI , LDP v2.36 +.\" +.TH NSCD.CONF 5 1999-10-01 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O /etc/nscd.conf \- name service cache daemon configuration file +/etc/nscd.conf \- ¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥­¥ã¥Ã¥·¥å¥Ç¡¼¥â¥ó¤ÎÀßÄê¥Õ¥¡¥¤¥ë +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The file +.\"O .I /etc/nscd.conf +.\"O is read from +.\"O .BR nscd (8) +.\"O at startup. +.\"O Each line specifies either an attribute and a value, or an +.\"O attribute, service, and a value. +.\"O Fields are separated either by SPACE +.\"O or TAB characters. +.\"O A \(aq#\(aq (number sign) indicates the beginning of a +.\"O comment; following characters, up to the end of the line, +.\"O are not interpreted by nscd. +.BR nscd (8) +¤Ïµ¯Æ°»þ¤Ë¥Õ¥¡¥¤¥ë +.I /etc/nscd.conf +¤òÆɤ߹þ¤à¡£ +³Æ¹Ô¤Ë¤Ï¡Ö°À­¡¦Ã͡פޤ¿¤Ï¡Ö°À­¡¦¥µ¡¼¥Ó¥¹¡¦Ã͡פò»ØÄꤹ¤ë¡£ +¥Õ¥£¡¼¥ë¥É¤Ï¥¹¥Ú¡¼¥¹Ê¸»ú¤Þ¤¿¤Ï¥¿¥Öʸ»ú¤Ç¶èÀÚ¤é¤ì¤ë¡£ +\(aq#\(aq (¥Ê¥ó¥Ð¡¼µ­¹æ) ¤Ï¥³¥á¥ó¥È¤Î»Ï¤Þ¤ê¤òɽ¤¹¡£ +¤³¤Îµ­¹æ¤«¤é¹ÔËö¤Þ¤Ç¤Ï nscd ¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤Ê¤¤¡£ +.\"O Valid services are \fIpasswd\fP, \fIgroup\fP, or \fIhosts\fP. +»ØÄê²Äǽ¤Ê¥µ¡¼¥Ó¥¹¤Ï \fIpasswd\fP, \fIgroup\fP, \fIhosts\fP ¤Ç¤¢¤ë¡£ + +.B logfile +.I debug-file-name +.RS +.\"O Specifies name of the file to which debug info should be written. +¥Ç¥Ð¥Ã¥°¾ðÊ󤬽ñ¤­¹þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î̾Á°¤ò»ØÄꤹ¤ë¡£ +.RE + +.B debug-level +.I value +.RS +.\"O Sets the desired debug level. +´õ˾¤¹¤ë¥Ç¥Ð¥Ã¥°¥ì¥Ù¥ë¤òÀßÄꤹ¤ë¡£ +.RE + +.B threads +.I number +.RS +.\"O This is the number of threads that are started to wait for +.\"O requests. +.\"O At least five threads will always be created. +¥¹¥ì¥Ã¥É¤ò¤¤¤¯¤Äµ¯Æ°¤·¤Æ¥ê¥¯¥¨¥¹¥È¤òÂԤĤΤ«¤ò»ØÄꤹ¤ë¡£ +¾¯¤Ê¤¯¤È¤â 5 ¤Ä¤Î¥¹¥ì¥Ã¥É¤¬¾ï¤ËºîÀ®¤µ¤ì¤ë¡£ +.RE + +.B server-user +.I user +.RS +.\"O If this option is set, nscd will run as this user and not as root. +.\"O If a separate cache for every user is used (\-S parameter), this +.\"O option is ignored. +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤ë¤È¡¢ +nscd ¤Ï root ¤Ç¤Ï¤Ê¤¯¡¢¤³¤Î user ¤È¤·¤Æ¼Â¹Ô¤µ¤ì¤ë¡£ +(\-S ¥Ñ¥é¥á¡¼¥¿¤Ë¤è¤ê) ³Æ¥æ¡¼¥¶¡¼Ëè¤ËÊÌ¡¹¤Î¥­¥ã¥Ã¥·¥å¤¬»È¤ï¤ì¤ë¾ì¹ç¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï̵»ë¤µ¤ì¤ë¡£ +.RE + +.B enable-cache +.I service +.I +.RS +.\"O Enables or disables the specified +.\"O .I service +.\"O cache. +»ØÄꤷ¤¿ +.I service +¤Î¥­¥ã¥Ã¥·¥å¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ +.RE + +.B positive-time-to-live +.I service +.I value +.RS +.\"O Sets the TTL (time-to-live) for positive entries (successful queries) +.\"O in the specified cache for +.\"O .IR service . +.\"O .I Value +.\"O is in seconds. +.\"O Larger values increase cache hit rates and reduce mean +.\"O response times, but increase problems with cache coherence. +»ØÄꤷ¤¿ +.I service +¤Î¥­¥ã¥Ã¥·¥å¤Ë¤¢¤ë¥Ý¥¸¥Æ¥£¥Ö¥¨¥ó¥È¥ê (À®¸ù¤·¤¿Ì䤤¹ç¤ï¤») ¤Î +TTL (time-to-live) ¤òÀßÄꤹ¤ë¡£ +.I value +¤Îñ°Ì¤ÏÉäǤ¢¤ë¡£ +ÃͤòÂ礭¤¯¤¹¤ë¤È¡¢¥Ò¥Ã¥ÈΨ¤¬¹â¤¯¤Ê¤êÊ¿¶Ñ±þÅú»þ´Ö¤òû¤¯¤Ç¤­¤ë¤¬¡¢ +¥­¥ã¥Ã¥·¥å¤Î¥³¥Ò¡¼¥ì¥ó¥¹ (coherence, +¥­¥ã¥Ã¥·¥å¤¬¼ÂºÝ¤Î¥Ç¡¼¥¿¤È°ìÃפ·¤Æ¤¤¤ë¤³¤È) ¤ËÌäÂ꤬À¸¤¸¤ë¡£ +.RE + +.B negative-time-to-live +.I service +.I value +.RS +.\"O Sets the TTL (time-to-live) for negative entries (unsuccessful queries) +.\"O in the specified cache for +.\"O .IR service . +.\"O .I Value +.\"O is in seconds. +.\"O Can result in significant performance improvements if there +.\"O are several files owned by UIDs (user IDs) not in system databases (for +.\"O example untarring the linux kernel sources as root); should be kept small +.\"O to reduce cache coherency problems. +»ØÄꤷ¤¿ +.I service +¤Î¥­¥ã¥Ã¥·¥å¤Ë¤¢¤ë¥Í¥¬¥Æ¥£¥Ö¥¨¥ó¥È¥ê (¼ºÇÔ¤·¤¿Ì䤤¹ç¤ï¤») ¤Î +TTL (time-to-live) ¤òÀßÄꤹ¤ë¡£ +.I value +¤Îñ°Ì¤ÏÉäǤ¢¤ë¡£ +¥·¥¹¥Æ¥à¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ê¤¤ UID (¥æ¡¼¥¶¡¼ID) ¤Ç½êÍ­¤µ¤ì¤ë¥Õ¥¡¥¤¥ë +(¤¿¤È¤¨¤Ð root ¤Ç tar ¤òŸ³«¤·¤¿ linux ¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹) ¤¬¾¯¤Ê¤¤¤È¡¢ +¸²Ãø¤ÊÀ­Ç½¤Î¸þ¾å¤¬¸«¤é¤ì¤ë¡£ +¥­¥ã¥Ã¥·¥å¤Î¥³¥Ò¡¼¥ì¥ó¥¹ÌäÂê¤ò¾¯¤Ê¤¯¤¹¤ë¤¿¤á¤Ë¾®¤µ¤ÊÃͤˤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.RE + +.B suggested-size +.I service +.I value +.RS +.\"O This is the internal hash table size, +.\"O .I value +.\"O should remain a prime number for optimum efficiency. +ÆâÉô¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ÎÂ礭¤µ¤ò»ØÄꤹ¤ë¡£ +¸úΨ¤òºÇŬ¤Ë¤¹¤ë¤¿¤á¤Ë +.I value +¤ÏÁÇ¿ô¤Ë¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.RE + +.B check-files +.I service +.I +.RS +.\"O Enables or disables checking the file belonging to the specified +.\"O .I service +.\"O for changes. +.\"O The files are +.\"O .IR /etc/passwd , +.\"O .IR /etc/group , +.\"O and +.\"O .IR /etc/hosts . +»ØÄꤷ¤¿ +.I service +¤Ë´ØÏ¢¤¹¤ë¥Õ¥¡¥¤¥ë¤ÎÊѹ¹¤Î¥Á¥§¥Ã¥¯¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤Ï +.IR /etc/passwd , +.IR /etc/group , +.I /etc/hosts +¤Ç¤¢¤ë¡£ +.RE + +.B max-threads +.I threads +.RS +.\"O Specifies the maximum number of threads to be started. +³«»Ï¤¹¤ë¥¹¥ì¥Ã¥É¤ÎºÇÂç¿ô¤ò»ØÄꤹ¤ë¡£ +.RE + +.B stat-user +.I username +.RS +.\"O Specifies the user who is allowed to request statistics. +Åý·×¾ðÊó¤Î»²¾È¤òµö²Ä¤¹¤ë¥æ¡¼¥¶¤ò»ØÄꤹ¤ë¡£ +.RE + +.B reload-count +unlimited | +.I number +.RS +.\"O Limit on the number of times a cached entry gets reloaded without being used +.\"O before it gets removed. +.\"O The default is 5. +¥­¥ã¥Ã¥·¥å¤µ¤ì¤¿¥¨¥ó¥È¥ê¤¬»ÈÍѤµ¤ì¤Ê¤«¤Ã¤¿¤È¤­¤Ë¡¢ +ºï½ü¤µ¤ì¤ëÁ°¤Ë²¿²ó¥ê¥í¡¼¥É¤µ¤ì¤ë¤«¤òÀßÄꤹ¤ë¡£ +.RE + +.B paranoia +.I +.RS +.\"O Enabling paranoia mode causes nscd to restart itself periodically. +¥Ñ¥é¥Î¥¤¥¢¥â¡¼¥É¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¥Ñ¥é¥Î¥¤¥¢¥â¡¼¥É¤Ç¤Ï nscd ¤òÄê´üŪ¤ËºÆµ¯Æ°¤¹¤ë¡£ +.RE + +.B restart-interval +.I time +.RS +.\"O Sets the restart interval to +.\"O .I time +.\"O seconds +.\"O if periodic restart is enabled by enabling +.\"O .B paranoia +.\"O mode. +¥Ñ¥é¥Î¥¤¥¢¥â¡¼¥É¤¬Í­¸ú¤ÇÄê´üŪ¤ËºÆµ¯Æ°¤¹¤ë¾ì¹ç¤Î¡¢ +ºÆµ¯Æ°´Ö³Ö¤ò +.I time +ÉäËÀßÄꤹ¤ë¡£ +.RE + +.B persistent +.I service +.I +.RS +.\"O Keep the content of the cache for +.\"O .I service +.\"O over server restarts; useful when +.\"O .B paranoia +.\"O mode is set. +¥µ¡¼¥Ð¤ÎºÆµ¯Æ°¤ÎÁ°¸å¤Ç +.I service +¤Î¥­¥ã¥Ã¥·¥åÆâÍƤòÊÝ»ý¤¹¤ë¡£ +.B paranoia +¥â¡¼¥É¤¬Í­¸ú¤Î¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.RE + +.B shared +.I service +.I +.RS +.\"O The memory mapping of the nscd databases for +.\"O .I service +.\"O is shared with the clients so +.\"O that they can directly search in them instead of having to ask the +.\"O daemon over the socket each time a lookup is performed. +.I service +¤Î nscd ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥á¥â¥ê¡¦¥Þ¥Ã¥Ô¥ó¥°¤ò¥¯¥é¥¤¥¢¥ó¥È´Ö¤Ç¶¦Í­¤¹¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¸¡º÷¤ò¼Â¹Ô¤¹¤ëÅ٤˥½¥±¥Ã¥È·Ðͳ¤Ç¥Ç¡¼¥â¥ó¤ËÌ䤤¹ç¤ï¤»¤ò +¹Ô¤ï¤º¤Ë¡¢Ä¾Àܥǡ¼¥¿¥Ù¡¼¥¹¤ò¸¡º÷¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.RE +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR nscd (8) +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\"O .\" .B nscd +.\"O .\" was written by Thorsten Kukuk and Ulrich Drepper. +.\" .B nscd +.\" ¤Ï Thorsten Kukuk ¤È Ulrich Drepper ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ diff --git a/draft/man5/nsswitch.conf.5 b/draft/man5/nsswitch.conf.5 new file mode 100644 index 00000000..024abe68 --- /dev/null +++ b/draft/man5/nsswitch.conf.5 @@ -0,0 +1,426 @@ +.\" Copyright (c) 1998 Thorsten Kukuk (kukuk@vt.uni-paderborn.de) +.\" +.\" 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. +.\" +.\" This manual page based on the GNU C Library info pages. +.\" FIXME ? The use of quotes on this page is inconsistent with the +.\" rest of man-pages. +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Wed Apr 29 1998 by NAKANO Takeo +.\" Updated & Modified Sat Aug 21 1999 +.\" by NAKANO Takeo +.\" Updated Fri Oct 12 JST 2001 by Akihiro MOTOKI +.\" +.\" WORD: lookup ±ÜÍ÷(¤¹¤ë) +.\" +.TH NSSWITCH.CONF 5 1999-01-17 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O nsswitch.conf \- System Databases and Name Service Switch configuration file +.SH ̾Á° +nsswitch.conf \- ¥·¥¹¥Æ¥à¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥¹¥¤¥Ã¥Á¤ÎÀßÄê¥Õ¥¡¥¤¥ë +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Various functions in the C Library need to be configured to work +.\"O correctly in the local environment. +.\"O Traditionally, this was done by +.\"O using files (e.g., \fI/etc/passwd\fP), but other nameservices (like the +.\"O Network Information Service (NIS) and the Domain Name Service (DNS)) +.\"O became popular, and were hacked into the C library, usually with a fixed +.\"O search order. +C ¥é¥¤¥Ö¥é¥ê¤Îµ¡Ç½¤ÎÃæ¤Ë¤Ï¡¢¥í¡¼¥«¥ë¤Ê´Ä¶­¤ÇÀµ¤·¤¯Æ°ºî¤µ¤»¤ë¤Ë¤ÏÀßÄ꤬ +ɬÍפʤâ¤Î¤¬Â¿¿ô¸ºß¤¹¤ë¡£ÅÁÅýŪ¤Ë¤³¤ì¤Ï¥Õ¥¡¥¤¥ë (Î㤨¤Ð \fI/etc/passwd\fP) ¤ò +ÍѤ¤¤ë¤³¤È¤Ç¼Â¸½¤µ¤ì¤Æ¤­¤¿¡£¤·¤«¤·Â¾¤Î¥Í¡¼¥à¥µ¡¼¥Ó¥¹ (Network +Information Service (NIS) ¤ä Domain Name Service (DNS)) ¤¬°ìÈÌŪ¤Ë¤Ê¤ê¡¢ +¤³¤ì¤é¤¬ C ¥é¥¤¥Ö¥é¥ê¤Ë¼è¤ê¹þ¤Þ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Ã¤¿¡£¤¿¤À¤·Ä̾¸¡ +º÷¤Î½ç½ø¤Ï¸ÇÄꤵ¤ì¤Æ¤¤¤¿¡£ +.LP +.\"O The Linux libc5 with NYS support and the GNU C Library 2.x (libc.so.6) +.\"O contain a cleaner solution of this problem. +.\"O It is designed after a method +.\"O used by Sun Microsystems in the C library of Solaris 2. +.\"O We follow their +.\"O name and call this scheme "Name Service Switch" (NSS). +.\"O The sources for +.\"O the "databases" and their lookup order are specified in the +.\"O .I /etc/nsswitch.conf +.\"O file. +NYS ¤ò¥µ¥Ý¡¼¥È¤·¤¿ Linux libc5 ¤ä GNU C Linrary 2.x (libc.so.6) ¤Ç¤Ï¡¢ +¤³¤ÎÌäÂê¤Ï¤è¤ê¸«Ä̤·Îɤ¯²ò·è¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£¤³¤ì¤é¤Ï Sun +Microsystems ¤¬ Solaris 2 ¤Î C ¥é¥¤¥Ö¥é¥ê¤ÇÍѤ¤¤¿ÊýË¡¤Ë¤Ê¤é¤Ã¤Æ¤¤¤ë¡£ +°Ê²¼¤Ç¤Ï¤³¤Î»ÅÁȤߤò "Name Service Switch" (NSS) ¤È¸Æ¤Ö¡£¥Ç¡¼¥¿¥Ù¡¼¥¹ +¤Î¾ðÊ󸻤ȡ¢¤½¤ì¤é¤ò±ÜÍ÷¤¹¤ë½ç½ø¤ò»ØÄꤷ¤¿¤Î¤¬ +.I /etc/nsswitch.conf +¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.LP +.\"O The following databases are available in the NSS: +NSS(¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥¹¥£¥Ã¥Á) ¤Ç¤Ï°Ê²¼¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B aliases +.\"O Mail aliases, used by +.\"O .BR sendmail (8). +.\"O Presently ignored. +.BR sendmail (8) +¤ÇÍѤ¤¤é¤ì¤ë¥á¡¼¥ë¥¨¥¤¥ê¥¢¥¹¡£ +¸½ºß¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.B ethers +.\"O Ethernet numbers. +¥¤¡¼¥µ¡¼¥Í¥Ã¥ÈÈֹ档 +.TP +.B group +.\"O Groups of users, used by +.\"O .BR getgrent (3) +.\"O functions. +¥æ¡¼¥¶¡¼¤Î¥°¥ë¡¼¥×¡£ +.BR getgrent (3) +´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B hosts +.\"O Host names and numbers, used by +.\"O .BR gethostbyname (3) +.\"O and similar functions. +¥Û¥¹¥È̾¤È¥Û¥¹¥ÈÈֹ档 +.BR gethostbyname (3) +¤Ê¤É¤Î´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B netgroup +.\"O Network wide list of hosts and users, used for access rules. +.\"O C libraries before glibc 2.1 only support netgroups over NIS. +¥Í¥Ã¥È¥ï¡¼¥¯¥ï¥¤¥É¤ËÍѤ¤¤é¤ì¤ë¥Û¥¹¥È¤ä¥æ¡¼¥¶¡¼¤Î¥ê¥¹¥È¡£¥¢¥¯¥»¥¹À©¸Â¤Ë +ÍøÍѤµ¤ì¤ë¡£ glibc 2.1 °ÊÁ°¤Î C ¥é¥¤¥Ö¥é¥ê¤Ï¡¢ NIS ¾å¤Ç¤À¤± +netgroup ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.TP +.B networks +.\"O Network names and numbers, used by +.\"O .BR getnetent (3) +.\"O functions. +¥Í¥Ã¥È¥ï¡¼¥¯Ì¾¤ÈÈֹ档 +.BR getnetent (3) +´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B passwd +.\"O User passwords, used by +.\"O .BR getpwent (3) +.\"O functions. +¥æ¡¼¥¶¡¼¥Ñ¥¹¥ï¡¼¥É¡£ +.BR getpwent (3) +´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B protocols +.\"O Network protocols, used by +.\"O .BR getprotoent (3) +.\"O functions. +¥Í¥Ã¥È¥ï¡¼¥¯¥×¥í¥È¥³¥ë¡£ +.BR getprotoent (3) +´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B publickey +.\"O Public and secret keys for secure_rpc used by NIS+ and NFS. +NIS+ ¤È NFS ¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë secure_rpc ¤Î¸ø³«¸°¤ÈÈëÌ©¸°¡£ +.TP +.B rpc +.\"O Remote procedure call names and numbers, used by +.\"O .BR getrpcbyname (3) +.\"O and similar functions. +¥ê¥â¡¼¥È¥×¥í¥·¥¸¥ã¡¼¥³¡¼¥ë (remote procedure call) ¤Î̾Á°¤ÈÈֹ档 +.BR getrpcbyname (3) +¤Ê¤É¤Î´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B services +.\"O Network services, used by +.\"O .BR getservent (3) +.\"O functions. +¥Í¥Ã¥È¥ï¡¼¥¯¥µ¡¼¥Ó¥¹¡£ +.BR getservent (3) +´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B shadow +.\"O Shadow user passwords, used by +.\"O .BR getspnam (3). +¥·¥ã¥É¥¦¥æ¡¼¥¶¡¼¥Ñ¥¹¥ï¡¼¥É¡£ +.BR getspnam (3) +¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.LP +.\"O An example +.\"O .I /etc/nsswitch.conf +.\"O (namely, the default used when +.\"O .I /etc/nsswitch.conf +.\"O is missing): +.I /etc/nsswitch.conf +¥Õ¥¡¥¤¥ë¤Î°ìÎã¤ò°Ê²¼¤Ë¼¨¤¹ (¤³¤³¤Ë¼¨¤¹ÆâÍÆ¤Ï +.I /etc/nsswitch.conf +¥Õ¥¡¥¤¥ë¤¬¤Ê¤¤¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¤ÈƱ¤¸¤Ç¤¢¤ë)¡£ +.sp 1n +.PD 0 +.TP 16 +passwd: +compat +.TP +group: +compat +.TP +shadow: +compat +.sp 1n +.TP +hosts: +dns [!UNAVAIL=return] files +.TP +networks: +nis [NOTFOUND=return] files +.TP +ethers: +nis [NOTFOUND=return] files +.TP +protocols: +nis [NOTFOUND=return] files +.TP +rpc: +nis [NOTFOUND=return] files +.TP +services: +nis [NOTFOUND=return] files +.PD +.LP +.\"O XXX: The first column is the database. +.\"O XXX: The rest of the line specifies how the lookup process works. +.\"O You can specify the way it works for each database individually. +ºÇ½é¤Î¥«¥é¥à¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤Ç¤¢¤ë¡£ +¹Ô¤Î»Ä¤ê¤Ç¤Ï±ÜÍ÷¥×¥í¥»¥¹¤ÎÆ°ºî¤ò»ØÄꤷ¤Æ¤¤¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ·¤Æ¡¢±ÜÍ÷ÊýË¡¤ÏÆÈΩ¤ËÀßÄê¤Ç¤­¤ë¡£ +.LP +.\"O The configuration specification for each database can contain two +.\"O different items: +³Æ¡¹¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀßÄê¤Ë¤Ï°Ê²¼¤Î 2 ¼ïÎà¤ÎÆâÍƤò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PD 0 +.TP +.\"O * The service specification like `files', `db', or `nis'. +* ¥µ¡¼¥Ó¥¹¤Î»ØÄê¡£ `files', `db', `nis' ¤Ê¤É¡£ +.TP +.\"O * The reaction on lookup result like `[NOTFOUND=return]'. +* ±ÜÍ÷·ë²Ì¤ËÂФ¹¤ë¥ê¥¢¥¯¥·¥ç¥ó¡£ `[NOTFOUND=return]' ¤Ê¤É¡£ +.PD +.LP +.\"O For libc5 with NYS, the allowed service specifications are `files', `nis', +.\"O and `nisplus'. +.\"O For hosts, you could specify `dns' as extra service, for +.\"O passwd and group `compat', but not for shadow. +NYS µ¡Ç½¤òÁȤ߹þ¤ó¤À libc5 ¤Ç¤Ï¡¢»ØÄê¤Ç¤­¤ë¥µ¡¼¥Ó¥¹¤Ï `files'¡¢ `nis'¡¢ +`nisplus' ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ hosts ¤ËÂФ·¤Æ¤Ï `dns' ¤â»ØÄê¤Ç¤­¤ë¡£¤Þ¤¿ +passwd ¤È group ¤ËÂФ·¤Æ¤Ï `compat' ¤â»ØÄê¤Ç¤­¤ë¡£ shadow ¤Ë¤Ï +`compat' ¤Î»ØÄê¤Ï¤Ç¤­¤Ê¤¤¡£ +.LP +.\"O For glibc, you must have a file called +.\"O .BI /lib/libnss_SERVICE.so. X +.\"O for every SERVICE you are using. +.\"O On a standard installation, you could use +.\"O `files', `db', `nis', and `nisplus'. +.\"O For hosts, you could specify `dns' as +.\"O extra service, for passwd, group, and shadow `compat'. +.\"O These services will not +.\"O be used by libc5 with NYS. +.\"O The version number +.\"O .I X +.\"O is 1 for glibc 2.0 and 2 for glibc 2.1. +glibc ¤Ç¤Ï¡¢ÍøÍѤ·¤è¤¦¤È¤¹¤ë¥µ¡¼¥Ó¥¹ SERVICE ¤½¤ì¤¾¤ì¤ËÂФ· +¤Æ +.BI /lib/libnss_SERVICE.so. X +¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬É¬Íפˤʤ롣ɸ½àŪ¤Ê¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤Ï `files'¡¢ `db'¡¢ +`nis'¡¢ `nisplus' ¤¬ÍøÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¤¡£ hosts ¤ËÂÐ +¤·¤Æ¤Ï `dns' ¤â»ØÄê¤Ç¤­¡¢ passwd¡¢ group¡¢ shadow ¤ËÂФ·¤Æ¤Ï `compat' +¤â»ØÄê¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î¥µ¡¼¥Ó¥¹¤Ï libc5+NYS ¤Î´Ä¶­¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +¥Ð¡¼¥¸¥ç¥óÈÖ¹æ +.I X +¤Ï¡¢ glibc 2.0 ÍѤʤé 1¡¢ glibc 2.1 ÍѤʤé 2 ¤Ç¤¢¤ë¡£ +.LP +.\"O The second item in the specification gives the user much finer +.\"O control on the lookup process. +.\"O Action items are placed between two +.\"O service names and are written within brackets. +.\"O The general form is +Æó¤Ä¤á¤Î»ØÄêÊýË¡¤Ï±ÜÍ÷¥×¥í¥»¥¹¤ò¤è¤ê¾ÜºÙ¤ËÀ©¸æ¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£¥¢ +¥¯¥·¥ç¥ó»ØÄê (action item) ¤Ï¥µ¡¼¥Ó¥¹Ì¾¤Î´Ö¤Ë¡¢³Ñ¤«¤Ã¤³ [] ¤Ç³ç¤é¤ì¤Æ +µ­½Ò¤µ¤ì¤ë¡£°ìÈÌŪ¤Ê½ñ¼°¤Ï°Ê²¼¤ÎÄ̤ꡣ +.LP +`[' ( `!'? STATUS `=' ACTION )+ `]' +.LP +.\"O where +¤³¤³¤Ç¤½¤ì¤¾¤ì +.sp 1n +.PD 0 +.TP +STATUS => success | notfound | unavail | tryagain +.TP +ACTION => return | continue +.PD +¤Ç¤¢¤ë¡£ +.LP +.\"O The case of the keywords is insignificant. +.\"O The STATUS values are +.\"O the results of a call to a lookup function of a specific service. +.\"O They mean: +¥­¡¼¥ï¡¼¥É¤ÎÂçʸ»ú¾®Ê¸»ú¤Ï¶èÊ̤µ¤ì¤Ê¤¤¡£ STATUS ¤ÎÃͤÏÆÃÄê¤Îµ¡Ç½¤ËÂФ· +¤Æ±ÜÍ÷¤ò¹Ô¤Ã¤¿·ë²Ì¤Ç¤¢¤ë¡£¤½¤ì¤¾¤ì¤Î°ÕÌ£¤Ï°Ê²¼¤ÎÄ̤ꡣ +.TP +.B success +.\"O No error occurred and the wanted entry is returned. +.\"O The default +.\"O action for this is `return'. +¥¨¥é¡¼¤Ïµ¯¤³¤é¤º¡¢É¬Íפʥ¨¥ó¥È¥ê¤¬ÊÖ¤µ¤ì¤¿¡£¤³¤Î·ë²Ì¤ËÂФ¹¤ë¥Ç¥Õ¥©¥ë¥È +¤Î¥¢¥¯¥·¥ç¥ó¤Ï `return' ¤Ç¤¢¤ë¡£ +.TP +.B notfound +.\"O The lookup process works ok but the needed value was not found. +.\"O The default action is `continue'. +±ÜÍ÷¥×¥í¥»¥¹¤Ïµ¡Ç½¤·¤Æ¤¤¤ë¤¬¡¢É¬ÍפÊÃͤ¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£¥Ç¥Õ¥©¥ë¥È¤Î +¥¢¥¯¥·¥ç¥ó¤Ï `continue'¡£ +.TP +.B unavail +.\"O The service is permanently unavailable. +.\"O This can either mean the +.\"O needed file is not available, or, for DNS, the server is not +.\"O available or does not allow queries. +.\"O The default action is +.\"O `continue'. +¥µ¡¼¥Ó¥¹¤¬¡Ê±Ê³Ū¤Ë¡ËÍøÍѤǤ­¤Ê¤¤¡£É¬Íפʥե¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡¢DNS ¤Î +¾ì¹ç¤Ë¤Ï¥µ¡¼¥Ð¤ËÂФ¹¤ëÌ䤤¹ç¤ï¤»¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¡¢¤Ê¤É¤¬¤¢¤ê¤¦¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î¥¢¥¯¥·¥ç¥ó¤Ï `continue'¡£ +.TP +.B tryagain +.\"O The service is temporarily unavailable. +.\"O This could mean a file is +.\"O locked or a server currently cannot accept more connections. +.\"O The default action is `continue'. +¥µ¡¼¥Ó¥¹¤¬°ì»þŪ¤ËÍøÍѤǤ­¤Ê¤¤¡£¥Õ¥¡¥¤¥ë¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¡¢¥µ¡¼¥Ð¤ÎÀÜ +³¿ô¤¬¥ê¥ß¥Ã¥È¤ò±Û¤¨¤Æ¤¤¤Æ¸½ºßÍøÍѤǤ­¤Ê¤¤¡¢¤Ê¤É¤¬¹Í¤¨¤é¤ì¤ë¡£¥Ç¥Õ¥©¥ë +¥È¤Î¥¢¥¯¥·¥ç¥ó¤Ï `continue'¡£ +.\"O .SS Interaction with +/\- syntax (compat mode) +.SS +/\- ½ñ¼°¤È¤Î´Ø·¸ (compat ¥â¡¼¥É) +.\"O Linux libc5 without NYS does not has the name service switch but does +.\"O allow the user some policy control. +.\"O In +.\"O .I /etc/passwd +.\"O you could have entries of the form +user or +@netgroup +.\"O (include the specified user from the NIS passwd map), +.\"O \-user or \-@netgroup (exclude the specified user), +.\"O and + (include every user, except the excluded ones, from the NIS +.\"O passwd map). +.\"O Since most people only put a + at the end of +.\"O .I /etc/passwd +.\"O to include everything from NIS, the switch provides a faster +.\"O alternative for this case (`passwd: files nis') which doesn't +.\"O require the single + entry in +.\"O .IR /etc/passwd , +.\"O .I /etc/group , +.\"O and +.\"O .IR /etc/shadow . +NYS µ¡Ç½¤òÁȤ߹þ¤ó¤Ç¤¤¤Ê¤¤ libc5 ¤Ï¡¢¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥¹¥¤¥Ã¥Á¤Îµ¡Ç½¤ò»ý¤Ã +¤Æ¤¤¤Ê¤¤¡£¤·¤«¤·¤¢¤ëÄøÅ٤Υݥꥷ¡¼À©¸æ¤Ï¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.I /etc/passwd +¤Ç¤Ï +user ¤ä +@netgroup (NIS ¤Î passwd ¥Þ¥Ã¥×¤«¤é»ØÄꤷ¤¿¥æ¡¼¥¶¤ò¼è¤ê¹þ +¤à)¡¢ \-user ¤ä \-@netgroup (»ØÄꤷ¤¿¥æ¡¼¥¶¤ò½ü³°¤¹¤ë)¡¢ + (NIS ¤Î +passwd ¥Þ¥Ã¥×¤«¤é¡¢½ü³°¤µ¤ì¤¿¥æ¡¼¥¶°Ê³°¤ÎÁ´¤Æ¤Î¥¨¥ó¥È¥ê¤ò¼è¤ê¹þ¤à) ¤Ê +¤É¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤Û¤È¤ó¤É¤Î¾ì¹ç¤Ï +.I /etc/passwd +¤ÎºÇ¸å¤Ë + ¤òÉÕ¤±¤Æ NIS ¤Î¤¹¤Ù¤Æ¤ò¼è¤ê¹þ¤ó¤Ç¤¤¤ë¤À¤±¤Ê¤Î¤Ç¡¢ +¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥¹¥¤¥Ã¥Á¤òÍѤ¤¤Æ +(`passwd: files nis') ¤Î¤è¤¦¤Ë¤¹¤ì¤Ð¤è¤ê¹â®¤ÊÆ°ºî¤¬´üÂԤǤ­¡¢ +¤Þ¤¿ +.IR /etc/passwd ", " /etc/group ", " /etc/shadow +¤Ë + ¤À¤±¤Î¥¨¥ó¥È¥ê¤ò½ñ¤«¤Ê¤¯¤Æ¤¹¤à¡£ +.\"O If this is not sufficient, the NSS `compat' service provides full +.\"O +/\- semantics. +.\"O By default, the source is `nis', but this may be +.\"O overridden by specifying `nisplus' as source for the pseudo-databases +.\"O .BR passwd_compat , +.\"O .B group_compat +.\"O and +.\"O .BR shadow_compat . +.\"O These pseudo-databases are only available in GNU C Library. +¤è¤êºÙ¤«¤ÊÀ©¸æ¤ò¹Ô¤¤¤¿¤¤¾ì¹ç¤Ï¡¢ NSS ¤Î `compat' ¥µ¡¼¥Ó¥¹¤òÍѤ¤¤ì¤Ð ++/\- ½ñ¼°¤ò¥Õ¥ë¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥½¡¼¥¹¤Ï `nis' ¤Ë¤Ê¤Ã +¤Æ¤¤¤ë¤¬¡¢¤³¤ì¤Ïµ¼»÷¥Ç¡¼¥¿¥Ù¡¼¥¹ +.BR passwd_compat , group_compat , shadow_compat +¤Ê¤É¤Ë `nisplus' ¤ò»ØÄꤹ¤ë¤³¤È¤Ç¾å½ñ¤­¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Îµ¼»÷¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ï GNU C ¥é¥¤¥Ö¥é¥ê¤Ç¤·¤«ÍøÍѤǤ­¤Ê¤¤¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.\"O A service named SERVICE is implemented by a shared object library +.\"O named libnss_SERVICE.so.1 that resides in /lib. +SERVICE ¤È¤¤¤¦Ì¾Á°¤Î¥µ¡¼¥Ó¥¹¤Ï libnss_SERVICE.so.1 ¤È¤¤¤¦Ì¾Á°¤Î¶¦Í­¥ª +¥Ö¥¸¥§¥¯¥È¥é¥¤¥Ö¥é¥ê¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£¤³¤ì¤Ï /lib ¤ËÃÖ¤«¤ì¤ë¡£ +.TP 25 +.PD 0 +.I /etc/nsswitch.conf +.\"O configuration file +ÀßÄê¥Õ¥¡¥¤¥ë¡£ +.TP +.BI /lib/libnss_compat.so. X +.\"O implements `compat' source for glibc2 +glibc2 ¤ËÂФ·¤Æ `compat' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.BI /lib/libnss_db.so. X +.\"O implements `db' source for glibc2 +glibc2 ¤ËÂФ·¤Æ `db' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.BI /lib/libnss_dns.so. X +.\"O implements `dns' source for glibc2 +glibc2 ¤ËÂФ·¤Æ `dns' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.BI /lib/libnss_files.so. X +.\"O implements `files' source for glibc2 +glibc2 ¤ËÂФ·¤Æ `files' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.BI /lib/libnss_hesoid.so. X +.\"O implements `hesoid' source for glibc2 +glibc2 ¤ËÂФ·¤Æ `hesoid' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.BI /lib/libnss_nis.so. X +.\"O implements `nis' source for glibc2 +glibc2 ¤ËÂФ·¤Æ `nis' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.BI /lib/libnss_nisplus.so. X +.\"O implements `nisplus' source for glibc2 +glibc2 ¤ËÂФ·¤Æ `nisplus' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.I /lib/libnss_nisplus.so.2 +.\"O implements `nisplus' source for glibc 2.1 +glibc 2.1 ¤ËÂФ·¤Æ `nisplus' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.PD +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Within each process that uses +.\"O .BR nsswitch.conf , +.\"O the entire file is read only once; if the file is later changed, the +.\"O process will continue using the old configuration. +.I nsswitch.conf +¤òÍøÍѤ¹¤ë¤½¤ì¤¾¤ì¤Î¥×¥í¥»¥¹¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë¤Ï°ìÅÙ¤·¤«Æɤ߹þ¤Þ¤ì¤Ê¤¤¡£ +¤â¤· nsswitch.conf ¤¬¤¢¤È¤Ç½ñ¤­´¹¤¨¤é¤ì¤Æ¤â¡¢ +¤½¤Î¥×¥í¥»¥¹¤Ï¸Å¤¤ÀßÄê¤Î¤Þ¤Þ¤ÇÆ°ºî¤ò·Ñ³¤¹¤ë¡£ +.LP +.\"O With Solaris, it isn't possible to link programs using the NSS Service +.\"O statically. +.\"O With Linux, this is no problem. +Solaris ¤Ç¤Ï NSS ¥µ¡¼¥Ó¥¹¤òÍѤ¤¤¿¥×¥í¥°¥é¥à¤ò¥¹¥¿¥Æ¥£¥Ã¥¯¤Ë¥ê¥ó¥¯¤¹¤ë +¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ Linux ¤Ç¤ÏÌäÂê¤Ê¤¯¥¹¥¿¥Æ¥£¥Ã¥¯¥ê¥ó¥¯¤Ç¤­¤ë¡£ diff --git a/draft/man5/passwd.5 b/draft/man5/passwd.5 new file mode 100644 index 00000000..232c5cfa --- /dev/null +++ b/draft/man5/passwd.5 @@ -0,0 +1,234 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sun Jul 25 10:46:28 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Aug 21 18:12:27 1994 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Jun 18 01:53:57 1995 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Mon Jan 5 20:24:40 MET 1998 by Michael Haardt +.\" (michael@cantor.informatik.rwth-aachen.de) +.\" +.\" Japanese Version Copyright (c) 1997 Kazuyuki Tanisako +.\" all rights reserved. +.\" Translated 1998-02-10, Kazuyuki Tanisako +.\" Updated 1998-09-23, Kazuyuki Tanisako +.\" Updated 2006-07-19, Akihiro MOTOKI , LDP v2.36 +.\" +.TH PASSWD 5 1998-01-05 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O passwd \- password file +passwd \- ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .B Passwd +.\"O is a text file, that contains a list of the system's accounts, +.\"O giving for each account some useful information like user ID, +.\"O group ID, home directory, shell, etc. +.B passwd +¥Õ¥¡¥¤¥ë¤Ï¡¢¤½¤Î¥·¥¹¥Æ¥à¤Î¥¢¥«¥¦¥ó¥È¥ê¥¹¥È¤òÊÝ»ý¤¹¤ë¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +¥¢¥«¥¦¥ó¥ÈËè¤Ë¡¢¥æ¡¼¥¶¡¼ ID¡¢¥°¥ë¡¼¥× ID¡¢¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¡¢ +»ÈÍѤ¹¤ë shell ¥³¥Þ¥ó¥É¤Î¼ïÎà¡¢Åù¤ÎÍ­ÍѤʾðÊó¤òÄ󶡤·¤Æ¤¤¤ë¡£ +.\"O Often, it also contains the encrypted passwords for each account. +.\"O It should have general read permission (many utilities, like +.\"O .BR ls (1) +.\"O use it to map user IDs to usernames), but write access only for the +.\"O superuser. +¤Þ¤¿¡¢³Æ¥¢¥«¥¦¥ó¥È¤Î°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤òÊÝ»ý¤¹¤ë¾ì¹ç¤â¤¢¤ë¡£ +¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹µö²Ä¤Ï¡¢Á´¥æ¡¼¥¶¡¼¤Ë +Æɤ߽Ф·¤Îµö²Ä¤òÍ¿¤¨ +.RI ( ls (1) +Åù¤Î¿¤¯¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ç¤Ï¥æ¡¼¥¶¡¼ ID ¤ò¥æ¡¼¥¶¡¼Ì¾¤Ë +Âбþ¤µ¤»¤ë¤Î¤Ë +.B passwd +¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ¹¤ë)¡¢ +½ñ¤­¹þ¤ßµö²Ä¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤Ë¤Î¤ßÍ¿¤¨¤ë¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.\"O In the good old days there was no great problem with this general +.\"O read permission. +.\"O Everybody could read the encrypted passwords, but the +.\"O hardware was too slow to crack a well-chosen password, and moreover, the +.\"O basic assumption used to be that of a friendly user-community. +.\"O These days many people run some version of the shadow password suite, where +.\"O .I /etc/passwd +.\"O has asterisks (*) instead of encrypted passwords, +.\"O and the encrypted passwords are in +.\"O .I /etc/shadow +.\"O which is readable by the superuser only. +¸Å¤­Îɤ­»þÂå¤Ë¤Ï¡¢¤³¤ÎÁ´¥æ¡¼¥¶¡¼¤ËÂФ¹¤ëÆɤ߼è¤êµö²Ä¤Ï +ÆÃÊ̤ÊÌäÂê¤òµ¯¤³¤µ¤Ê¤«¤Ã¤¿¡£Ã¯¤Ç¤â°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤ò +Æɤळ¤È¤¬½ÐÍ褿¤¬¡¢¾å¼ê¤ËÁª¤Ð¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤òÇˤë¤Î¤Ë¤Ï +Åö»þ¤Î¥Ï¡¼¥É¥¦¥§¥¢¤Î®Å٤Ϥ¢¤Þ¤ê¤ËÃÙ¤«¤Ã¤¿¤·¡¢¤½¤ì¤Ë²Ã¤¨¤Æ +ͧ¹¥Åª¤Ê¥æ¡¼¥¶¡¼¼Ò²ñ¤Ç¤¢¤ë¤³¤È¤ò´ðËÜŪ¤ÊÁ°Äó¤È¤·¤Æ¤¤¤¿¡£ +ºÇ¶á¤Ç¤Ï¿¤¯¤Î¿Í¤¬¡¢²¿¤é¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Î shadow password suite +(¥·¥ã¥É¥¦¡¦¥Ñ¥¹¥ï¡¼¥Éµ¡Ç½¤ò¼Â¸½¤¹¤ë¤¿¤á¤Î¥×¥í¥°¥é¥à·²) +¤òÆ°¤«¤·¤Æ¤¤¤ë¡£¤½¤Î¾ì¹ç +.I /etc/passwd +¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¥ï¡¼¥ÉÍó¤Ë¤Ï¡¢°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤ÎÂå¤ï¤ê¤Ë +¥¢¥¹¥¿¥ê¥¹¥¯ (*) ¤¬ÀßÄꤵ¤ì¤ë¡£°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ï +.I /etc/shadow +¥Õ¥¡¥¤¥ë¤ËÊÝ»ý¤µ¤ì¤ë¡£ +.I /etc/shadow +¥Õ¥¡¥¤¥ë¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤À¤±¤¬Æɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O Regardless of whether shadow passwords are used, many sysadmins +.\"O use an asterisk in the encrypted password field to make sure +.\"O that this user can not authenticate him- or herself using a +.\"O password. +.\"O (But see the Notes below.) +shadow password ¤¬»È¤ï¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ë¤Ï¤è¤é¤º¡¢Â¿¤¯¤Î¥·¥¹¥Æ¥à +´ÉÍý¼Ô¤Ï¡¢°Å¹æ²½¥Ñ¥¹¥ï¡¼¥ÉÍó¤Ë¥¢¥¹¥¿¥ê¥¹¥¯¤òÀßÄꤹ¤ë¤³¤È¤Ç¡¢ +¤½¤Î¥æ¡¼¥¶¡¼¤¬¥Ñ¥¹¥ï¡¼¥É¤Ç¤Îǧ¾Ú¤¬¼õ¤±¤é¤ì¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¤¤ë +(²¼µ­¤Î¡ÖÃí°Õ¡×¤Î¹à¤ò»²¾È)¡£ +.PP +.\"O If you create a new login, first put an asterisk in the password field, +.\"O then use +.\"O .BR passwd (1) +.\"O to set it. +¿·¤·¤¤¥æ¡¼¥¶¡¼¤òÅÐÏ¿¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢¥Ñ¥¹¥ï¡¼¥ÉÍó¤Ë¥¢¥¹¥¿¥ê¥¹¥¯¤òÀßÄꤷ¤Æ¤ª¤­ +.BR passwd (1) +¥³¥Þ¥ó¥É¤Ë¤è¤êÀßÄê¤ò¹Ô¤¦¤è¤¦¤Ë¤¹¤ë¡£ +.PP +.\"O There is one entry per line, and each line has the format: +¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Ï 1 ¹Ô¤´¤È¤Ë 1 ¥¨¥ó¥È¥ê¤ò»ý¤Á¡¢ +³Æ¹Ô¤Î½ñ¼°¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.sp +.RS +account:password:UID:GID:GECOS:directory:shell +.RE +.sp +.\"O The field descriptions are: +³ÆÍó¤ÎÀâÌÀ: +.RS +.TP 1.0in +.I account +.\"O the name of the user on the system. +.\"O It should not contain capital letters. +¤½¤Î¥·¥¹¥Æ¥à¤Ç¤Î¥æ¡¼¥¶¡¼Ì¾¡£Âçʸ»ú¤ò´Þ¤Þ¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£ +.TP +.I password +.\"O the encrypted user password, an asterisk (*), or the letter \(aqx\(aq. +.\"O (See +.\"O .BR pwconv (8) +.\"O for an explanation of \(aqx\(aq.) +¥æ¡¼¥¶¡¼¤Î°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¡¢¥¢¥¹¥¿¥ê¥¹¥¯¡¢¤Þ¤¿¤Ïʸ»ú \(aqx\(aq +(\(aqx\(aq ¤ÎÀâÌÀ¤Ë¤Ä¤¤¤Æ¤Ï +.BR pwconv (8) +¤ò»²¾È)¡£ +.TP +.I UID +.\"O the numerical user ID. +¥æ¡¼¥¶¡¼ ID Èֹ档 +.TP +.I GID +.\"O the numerical primary group ID for this user. +¥æ¡¼¥¶¡¼¤¬Â°¤¹¤ë¥×¥é¥¤¥Þ¥ê¥°¥ë¡¼¥× ID Èֹ档 +.TP +.I GECOS +.\"O This field is optional and only used for informational purposes. +.\"O Usually, it contains the full username. +.\"O GECOS means General Electric +.\"O Comprehensive Operating System, which has been renamed to GCOS when +.\"O GE's large systems division was sold to Honeywell. +.\"O Dennis Ritchie has reported: "Sometimes we sent printer output or +.\"O batch jobs to the GCOS machine. +.\"O The gcos field in the password file was a place to stash the +.\"O information for the $IDENTcard. +.\"O Not elegant." +ËÜÍó¤Ï¾Êά²Äǽ¤Ç¡¢¾ðÊóÄ󶡤ÎÌÜŪ¤Î¤ß¤Ë»È¤ï¤ì¤ë¡£ +¥æ¡¼¥¶¡¼¤Î¥Õ¥ë¥Í¡¼¥à¤òÀßÄꤹ¤ë¤³¤È¤¬Â¿¤¤¡£GECOS ¤Ï General Electric +Comprehensive Operating System ¤ò°ÕÌ£¤·¤Æ¤ª¤ê¡¢GE ¼Ò¤ÎÂ絬ÌÏ¥·¥¹¥Æ¥àÉôÌç +¤¬ Honeywell ¼Ò¤ËÇäµÑ¤µ¤ì¤¿ºÝ¤Ë GCOS ¤Ø¤ÈÊѹ¹¤µ¤ì¤¿¡£Dennis Ritchie »á¤Ï +¼¡¤Î¤è¤¦¤Ë¸À¤Ã¤Æ¤¤¤ë:¡Ö»þ¡¹¥×¥ê¥ó¥¿½ÐÎϤ䡢 +¥Ð¥Ã¥Á¥¸¥ç¥Ö¤ò GCOS ¥Þ¥·¥ó¤ËÁ÷¤Ã¤¿¤ê¤¹¤ë¤¬¡¢ +¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î gcos Íó¤Ï $IDENT ¥«¡¼¥ÉÍѤξðÊó¤ò +±£¤·¤Æ¤ª¤¯¤¿¤á¤Î¾ì½ê¤Ê¤ó¤À¡£¤Þ¤ë¤Ã¤­¤ê¥¨¥ì¥¬¥ó¥È¤¸¤ã¤Ê¤¤¡£¡× +.TP +.I directory +.\"O the user's +.\"O .B $HOME +.\"O directory. +¥æ¡¼¥¶¡¼¤Î +.B $HOME +¥Ç¥£¥ì¥¯¥È¥ê¡£ +.TP +.I shell +.\"O the program to run at login (if empty, use +.\"O .IR /bin/sh ). +.\"O If set to a nonexisting executable, the user will be unable to login +.\"O through +.\"O .BR login (1). +¥í¥°¥¤¥ó»þ¤ËÆ°¤¯¥×¥í¥°¥é¥à̾ (¶õÍó¤Î¾ì¹ç +.I /bin/sh +¤¬»È¤ï¤ì¤ë)¡£ +¸ºß¤·¤Ê¤¤¼Â¹Ô¥×¥í¥°¥é¥à¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +.BR login (1) +¤Ë¤è¤ë¥·¥¹¥Æ¥à¤Ø¤Î¥í¥°¥¤¥ó¤Ï¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +.RE +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.I /etc/passwd +.\"O .SH NOTES +.SH Ãí°Õ +.\"O If you want to create +.\"O user groups, their GIDs must be equal and there must be an entry in +.\"O \fI/etc/group\fP, or no group will exist. +¥æ¡¼¥¶¡¼¥°¥ë¡¼¥×¤òºî¤ê¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢Æ±¤¸¥°¥ë¡¼¥×¤Ë°¤¹¤ë +¥æ¡¼¥¶¡¼¤Î GID ¤ÏƱ¤¸ÃͤȤ·¡¢¤½¤Î GID ¤ò \fI/etc/group\fP ¤ÎÃæ¤Ë +ÄêµÁ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£¤½¤¦¤·¤Ê¤¤¤È¥°¥ë¡¼¥×¤òºî¤Ã¤¿¤³¤È¤Ë¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O If the encrypted password is set to an asterisk, the user will be unable +.\"O to login using +.\"O .BR login (1), +.\"O but may still login using +.\"O .BR rlogin (1), +.\"O run existing processes and initiate new ones through +.\"O .BR rsh (1), +.\"O .BR cron (8), +.\"O .BR at (1), +.\"O or mail filters, etc. +.\"O Trying to lock an account by simply changing the +.\"O shell field yields the same result and additionally allows the use of +.\"O .BR su (1). +°Å¹æ²½¥Ñ¥¹¥ï¡¼¥É¤È¤·¤Æ¥¢¥¹¥¿¥ê¥¹¥¯¤òÀßÄꤹ¤ë¤È¡¢ +.BR login (1) +¤ò»È¤Ã¤Æ¤Î¥í¥°¥¤¥ó¤¬¤Ç¤­¤Ê¤¯¤Ê¤ë¤¬¡¢ +.BR rlogin (1) +¤Ç¤Ï¤Þ¤À¥í¥°¥¤¥ó¤¬¤Ç¤­¤ë¤·¡¢ +.BR rsh (1), +.BR cron (8), +.BR at (1) +¤ä¥á¥¤¥ë¤Î¥Õ¥£¥ë¥¿Åù¤ò»È¤¤¡¢¸½Â¸¤¹¤ë¥×¥í¥»¥¹¤ò +¼Â¹Ô¤µ¤»¤¿¤ê¡¢¿·¤¿¤Ê¥×¥í¥»¥¹¤òµ¯Æ°¤·¤¿¤ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +»ÈÍѤ¹¤ë shell ¤ÎÍó¤ò¡¢Ã±¤ËÊѹ¹¤¹¤ë¤³¤È¤Ç¥¢¥«¥¦¥ó¥È¤ò +»È¤¨¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Î¤âƱÍͤηë²Ì¤È¤Ê¤ë¡£¤½¤Î¾ì¹ç¤Ë¤Ï¤µ¤é¤Ë +.BR su (1) +¤âÍ­¸ú¤Ê¤Þ¤Þ»Ä¤Ã¤Æ¤·¤Þ¤¦¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR login (1), +.BR passwd (1), +.BR su (1), +.BR getpwent (3), +.BR getpwnam (3), +.BR group (5), +.BR shadow (5) diff --git a/draft/man5/proc.5 b/draft/man5/proc.5 new file mode 100755 index 00000000..5cd5f67f --- /dev/null +++ b/draft/man5/proc.5 @@ -0,0 +1,4334 @@ +.\" 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. +¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¥á¥â¥ê¥µ¥¤¥º¡£ +.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 agressiveness, 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/protocols.5 b/draft/man5/protocols.5 new file mode 100644 index 00000000..4e8e12f4 --- /dev/null +++ b/draft/man5/protocols.5 @@ -0,0 +1,117 @@ +.\" Copyright (c) 1995 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., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\" +.\" 1995-10-18 Martin Schulze +.\" * first released +.\" 2002-09-22 Seth W. Klein +.\" * protocol numbers are now assigned by the IANA +.\" +.\" Japanese Version Copyright (c) 1998 Hiroaki Nagoya all rights reserved. +.\" Translated Wed Feb 4 1998 by Hiroaki Nagoya +.\" Updated Tue Oct 16 2001 by Kentaro Shirakata +.\" +.TH PROTOCOLS 5 2008-09-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O protocols \- the protocols definition file +protocols \- ¥×¥í¥È¥³¥ëÄêµÁ¥Õ¥¡¥¤¥ë +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This file is a plain ASCII file, describing the various DARPA internet +.\"O protocols that are available from the TCP/IP subsystem. +.\"O It should be +.\"O consulted instead of using the numbers in the ARPA include files, or, +.\"O even worse, just guessing them. +.\"O These numbers will occur in the +.\"O protocol field of any IP header. +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï ASCII ¥Õ¥¡¥¤¥ë¤Ç¡¢TCP/IP ¥µ¥Ö¥·¥¹¥Æ¥à¤«¤éÍøÍѤǤ­¤ë +¤¤¤í¤¤¤í¤Ê DARPA ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥×¥í¥È¥³¥ë¤òµ­½Ò¤·¤Æ¤¤¤ë¡£ +ARPA ´ØÏ¢¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ëÆâ¤Î¿ôÃͤò»È¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¤·¡¢ +ñ¤Ë¿ä¬¤·¤¿Ãͤò»È¤¦¤Î¤Ï¤µ¤é¤ËÎɤ¯¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë¤³¤Î¥Õ¥¡¥¤¥ë¤ËÌ䤤¹ç¤ï¤»¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¿ôÃÍ¤Ï IP ¥Ø¥Ã¥À¤Î¥×¥í¥È¥³¥ë¥Õ¥£¡¼¥ë¥É¤Ë¸½¤ì¤ë¡£ + +.\"O Keep this file untouched since changes would result in incorrect IP +.\"O packages. +.\"O Protocol numbers and names are specified by the IANA +.\"O (Internet Assigned Numbers Authority). +.\"O .\" .. by the DDN Network Information Center. +¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÊѹ¹¤·¤Ê¤¤¤³¤È¡£Êѹ¹¤¹¤ë¤È IP ¥Ñ¥Ã¥±¡¼¥¸¤¬ÉÔÀµ¤Ë¤Ê¤ë¡£ +¥×¥í¥È¥³¥ëÈÖ¹æ¤È¥×¥í¥È¥³¥ë̾¤Ï +IANA (Internet Assigned Numbers Authority) ¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤ë¡£ +.\" DDN Network Information Center ¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤ë¡£ + +.\"O Each line is of the following format: +¤½¤ì¤¾¤ì¤Î¹Ô¤Ï¼¡¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤¢¤ë¡£ + +.RS +.I protocol number aliases ... +.RE + +.\"O where the fields are delimited by spaces or tabs. +.\"O Empty lines are ignored. +.\"O If a line contains a hash mark (#), the hash mark and the part +.\"O of the line following it are ignored. +³Æ¥Õ¥£¡¼¥ë¥É¤Ï¶õÇò¤«¥¿¥Ö¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤Æ¡¢¶õ¹Ô¤Ï̵»ë¤µ¤ì¤ë¡£ +¹Ô¤Ë¥Ï¥Ã¥·¥åµ­¹æ(#)¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¡¢ +¥Ï¥Ã¥·¥åµ­¹æ¤ò´Þ¤à¤½¤Î¹Ô¤Î»Ä¤ê¤Ï̵»ë¤µ¤ì¤ë¡£ + +.\"O The field descriptions are: +¥Õ¥£¡¼¥ë¥É¤ÎÀâÌÀ¤Ï°Ê²¼¤Î¤È¤ª¤ê¡£ +.TP +.I protocol +.\"O the native name for the protocol. +.\"O For example +.\"O .IR ip , +.\"O .IR tcp , +.\"O or +.\"O .IR udp . +¥×¥í¥È¥³¥ë¤Î¸Çͭ̾¡£¤¿¤È¤¨¤Ð +.IR ip , +.IR tcp , +.IR udp +¤Ê¤É¡£ +.TP +.I number +.\"O the official number for this protocol as it will appear within the IP +.\"O header. +¥×¥í¥È¥³¥ë¤Î¸ø¼°Èֹ桢IP ¥Ø¥Ã¥À¤Ë¸½¤ì¤ë¡£ +.TP +.I aliases +.\"O optional aliases for the protocol. +¥×¥í¥È¥³¥ë¤ÎÊÌ̾¡¢¥ª¥×¥·¥ç¥ó¡£ +.LP +.\"O This file might be distributed over a network using a network-wide +.\"O naming service like Yellow Pages/NIS or BIND/Hesiod. +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï Yellow Pages/NIS ¤ä BIND/Hesoid ¤Ê¤É¤Î¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î +̾Á°ÉÕ¤±¥µ¡¼¥Ó¥¹¤Ë¤è¤Ã¤Æ¥Í¥Ã¥È¥ï¡¼¥¯¾å¤ÇÇÛÉÛ¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/protocols +.\"O The protocols definition file. +¥×¥í¥È¥³¥ëÄêµÁ¥Õ¥¡¥¤¥ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getprotoent (3) + +http://www.iana.org/assignments/protocol-numbers diff --git a/draft/man5/resolv.conf.5 b/draft/man5/resolv.conf.5 new file mode 100644 index 00000000..95187eb9 --- /dev/null +++ b/draft/man5/resolv.conf.5 @@ -0,0 +1,458 @@ +.\" Copyright (c) 1986 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms are permitted +.\" provided that the above copyright notice and this paragraph are +.\" duplicated in all such forms and that any documentation, +.\" advertising materials, and other materials related to such +.\" distribution and use acknowledge that the software was developed +.\" by the University of California, Berkeley. The name of the +.\" University may not be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" @(#)resolver.5 5.9 (Berkeley) 12/14/89 +.\" $Id$ +.\" +.\" Added ndots remark by Bernhard R. Link - debian bug #182886 +.\" +.\" Japanese Version Copyright (c) 2000, 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated 2000-09-15, Yuichi SATO +.\" Updated & Modified 2005-01-22, Yuichi SATO +.\" Updated 2010-04-18, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: resolver ¥ì¥¾¥ë¥Ð +.\"WORD: query Ì䤤¹ç¤ï¤» +.\" +.TH RESOLV.CONF 5 2009-03-01 "" "Linux Programmer's Manual" +.UC 4 +.\"O .SH NAME +.SH ̾Á° +.\"O resolv.conf \- resolver configuration file +resolv.conf \- ¥ì¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B /etc/resolv.conf +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .I resolver +.\"O is a set of routines in the C library +.\"O that provide access to the Internet Domain Name System (DNS). +.\"O The resolver configuration file contains information that is read +.\"O by the resolver routines the first time they are invoked by a process. +.\"O The file is designed to be human readable and contains a list of +.\"O keywords with values that provide various types of resolver information. +.I resolver +¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î¥É¥á¥¤¥ó¥Í¡¼¥à¥·¥¹¥Æ¥à (DNS) ¤Ø¤Î¥¢¥¯¥»¥¹¤òÄ󶡤¹¤ë +C ¥é¥¤¥Ö¥é¥ê¤Î¥ë¡¼¥Á¥ó·²¤Ç¤¢¤ë¡£ +¥ì¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¥ì¥¾¥ë¥Ð¥ë¡¼¥Á¥ó¤¬¥×¥í¥»¥¹¤Ë¤è¤Ã¤ÆºÇ½é¤Ë +µ¯Æ°¤µ¤ì¤¿¤È¤­¤ËÆɤ߹þ¤Þ¤ì¤ë¾ðÊ󤬳ÊǼ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¿Í´Ö¤Ë²ÄÆɤʤ褦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +¥­¡¼¥ï¡¼¥É¤ÈÃͤΥꥹ¥È¤¬´Þ¤Þ¤ì¡¢¤¤¤í¤¤¤í¤Ê¥¿¥¤¥×¤Î¥ì¥¾¥ë¥Ð¾ðÊó¤òÄ󶡤¹¤ë¡£ +.LP +.\"O On a normally configured system this file should not be necessary. +.\"O The only name server to be queried will be on the local machine; +.\"O the domain name is determined from the hostname +.\"O and the domain search path is constructed from the domain name. +ÉáÄ̤ËÀßÄꤵ¤ì¤¿¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ÏɬÍפʤ¤¡£ +Ì䤤¹ç¤ï¤»¤ò¤µ¤ì¤ëÍ£°ì¤Î¥Í¡¼¥à¥µ¡¼¥Ð¤Ï¥í¡¼¥«¥ë¥Þ¥·¥ó¾å¤Ë¤¢¤ë¡£ +¥É¥á¥¤¥ó̾¤Ï¥Û¥¹¥È̾¤«¤é·èÄꤵ¤ì¡¢ +¥É¥á¥¤¥ó¤Î¸¡º÷¥Ñ¥¹¤Ï¥É¥á¥¤¥ó̾¤«¤éºîÀ®¤µ¤ì¤ë¡£ +.LP +.\"O The different configuration options are: +¤³¤Î¾õÂÖ¤òÊѹ¹¤¹¤ë¤¿¤á¤ÎÀßÄꥪ¥×¥·¥ç¥ó¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ë¡£ +.TP +.\"O \fBnameserver\fP Name server IP address +\fBnameserver\fP ¥Í¡¼¥à¥µ¡¼¥Ð¤Î IP ¥¢¥É¥ì¥¹ +.\"O Internet address (in dot notation) of a name server +.\"O that the resolver should query. +.\"O Up to +.\"O .B MAXNS +.\"O (currently 3, see \fI\fP) name servers may be listed, +.\"O one per keyword. +.\"O If there are multiple servers, +.\"O the resolver library queries them in the order listed. +.\"O If no \fBnameserver\fP entries are present, +.\"O the default is to use the name server on the local machine. +.\"O (The algorithm used is to try a name server, and if the query times out, +.\"O try the next, until out of name servers, +.\"O then repeat trying all the name servers +.\"O until a maximum number of retries are made.) +¥ì¥¾¥ë¥Ð¤¬Ì䤤¹ç¤ï¤»¤ò¤¹¤ë¥Í¡¼¥à¥µ¡¼¥Ð¤Î +(¥É¥Ã¥Èɽµ­¤Î) ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹¡£ +¤³¤Î¥­¡¼¥ï¡¼¥É 1 ¤Ä¤´¤È¤Ë 1 Âæ¤Å¤Ä¡¢ +.B MAXNS +Âæ (¸½¾õ¤Ç¤Ï 3 Âæ¡¢\fI\fP ¤ò»²¾È) ¤Þ¤Ç¤Î¥Í¡¼¥à¥µ¡¼¥Ð¤ò¥ê¥¹¥È¤Ç¤­¤ë¡£ +Ê£¿ô¤Î¥µ¡¼¥Ð¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥ì¥¾¥ë¥Ð¥é¥¤¥Ö¥é¥ê¤Ï +¥ê¥¹¥È¤µ¤ì¤¿½ç¤ËÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦¡£ +\fBnameserver\fP ¥¨¥ó¥È¥ê¤¬¤Ê¤¤¾ì¹ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥í¡¼¥«¥ë¥Þ¥·¥ó¾å¤Î¥Í¡¼¥à¥µ¡¼¥Ð¤¬»È¤ï¤ì¤ë¡£ +(¤³¤³¤Ç»È¤ï¤ì¤ë¥¢¥ë¥´¥ê¥º¥à¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +¤Ï¤¸¤á¤Ë¥Í¡¼¥à¥µ¡¼¥Ð¤ËÌ䤤¹ç¤ï¤»¤ò»î¤ß¤ë¡£ +¤³¤ÎÌ䤤¹ç¤ï¤»¤¬¥¿¥¤¥à¥¢¥¦¥È¤Ë¤Ê¤Ã¤¿¾ì¹ç¡¢ +¼¡¤Î¥Í¡¼¥à¥µ¡¼¥Ð¤ËÌ䤤¹ç¤ï¤»¤ò»î¤ß¤ë¡£ +¤³¤ì¤ò¥Í¡¼¥à¥µ¡¼¥Ð¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç³¤±¤ë¡£ +¤½¤ì¤Ç¤â±þÅú¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢¥ê¥È¥é¥¤ºÇÂç²ó¿ô¤Ë㤹¤ë¤Þ¤Ç +Á´¤Æ¤Î¥Í¡¼¥à¥µ¡¼¥Ð¤ËÌ䤤¹ç¤ï¤»¤ò·«¤êÊÖ¤¹¡£) +.TP +.\"O \fBdomain\fP Local domain name. +\fBdomain\fP ¥í¡¼¥«¥ë¥É¥á¥¤¥ó̾ +.\"O Most queries for names within this domain can use short names +.\"O relative to the local domain. +.\"O If no \fBdomain\fP entry is present, the domain is determined +.\"O from the local hostname returned by +.\"O .BR gethostname (2); +.\"O the domain part is taken to be everything after the first \(aq.\(aq. +.\"O Finally, if thehost name does not contain a domain part, the root +.\"O domain is assumed. +¤³¤Î¥É¥á¥¤¥ó¤Ë¤¢¤ë̾Á°¤ÎÌ䤤¹ç¤ï¤»¤Î¤Û¤È¤ó¤É¤Ë¡¢ +¤³¤Î¥í¡¼¥«¥ë¥É¥á¥¤¥ó¤Ë¤ª¤±¤ëû¤¤Ì¾Á°¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +\fBdomain\fP ¥¨¥ó¥È¥ê¤¬¤Ê¤¤¾ì¹ç¡¢¥É¥á¥¤¥ó̾¤Ï +.BR gethostname (2) +¤ÇÊÖ¤µ¤ì¤ë¥í¡¼¥«¥ë¥Û¥¹¥È̾¤«¤é·èÄꤵ¤ì¡¢ +ºÇ½é¤Î \(aq.\(aq °Ê¹ß¤ÎÁ´¤Æ¤ÎÉôʬ¤¬¥É¥á¥¤¥ó̾¤È¤µ¤ì¤ë¡£ +¤³¤Î¥Û¥¹¥È̾¤Ë¤â¥É¥á¥¤¥óÉô¤ò´Þ¤ó¤Ç¤¤¤Ê¤¤¾ì¹ç¡¢¥ë¡¼¥È¥É¥á¥¤¥ó¤¬²¾Äꤵ¤ì¤ë¡£ +.TP +.\"O \fBsearch\fP Search list for host-name lookup. +\fBsearch\fP ¥Û¥¹¥È̾¥ë¥Ã¥¯¥¢¥Ã¥×¤Î¤¿¤á¤Î¸¡º÷¥ê¥¹¥È +.\"O The search list is normally determined from the local domain name; +.\"O by default, it contains only the local domain name. +.\"O This may be changed by listing the desired domain search path +.\"O following the \fIsearch\fP keyword with spaces or tabs separating +.\"O the names. +.\"O Resolver queries having fewer than +.\"O .I ndots +.\"O dots (default is 1) in them will be attempted using each component +.\"O of the search path in turn until a match is found. +¸¡º÷¥ê¥¹¥È¤ÏÄ̾ï¥í¡¼¥«¥ë¥É¥á¥¤¥ó̾¤«¤é·èÄꤵ¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¸¡º÷¥ê¥¹¥È¤Ï¥í¡¼¥«¥ë¥É¥á¥¤¥ó̾¤Î¤ß¤Ç¤¢¤ë¡£ +¤³¤ì¤òÊѹ¹¤¹¤ë¤Ë¤Ï¡¢\fIsearch\fP ¥­¡¼¥ï¡¼¥É¤Î¸å¤Ë +´õ˾¤¹¤ë¥É¥á¥¤¥ó¸¡º÷¥Ñ¥¹¤ò¥¹¥Ú¡¼¥¹¤Þ¤¿¤Ï¥¿¥Ö¤Ç¶èÀڤäƥꥹ¥È¤¹¤ì¤Ð¤è¤¤¡£ +¥É¥Ã¥È¤Î¿ô¤¬ +.I ndots +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 1) ¤è¤ê¾¯¤Ê¤¤¥ì¥¾¥ë¥Ð¤ÎÌ䤤¹ç¤ï¤»¤Ï¡¢ +°ìÃפ¹¤ë¤â¤Î¤¬¸«¤Ä¤«¤ë¤Þ¤Ç¸¡º÷¥Ñ¥¹¤Î³ÆÍ×ÁǤò½ç¤Ë»È¤Ã¤Æ»î¤¹¡£ +.\"O For environments with multiple subdomains please read +.\"O .BI "options ndots:" n +.\"O below to avoid man-in-the-middle attacks and unnecessary +.\"O traffic for the root-dns-servers. +Ê£¿ô¤Î¥µ¥Ö¥É¥á¥¤¥ó¤ò»ý¤Ä´Ä¶­¤Ç¤Ï¡¢ +Âè»°¼Ô¤Ë¤è¤ë¹¶·â (man-in-the-middle attack) ¤È +¥ë¡¼¥È DNS ¥µ¡¼¥Ð¤Ø¤ÎÉÔɬÍפʥȥé¥Õ¥£¥Ã¥¯¤òÈò¤±¤ë¤¿¤á¤Ë¡¢ +°Ê²¼¤Î +.BI "options ndots:" n +¤òÆɤó¤Ç¤Û¤·¤¤¡£ +.\"O .\" When having a resolv.conv with a line +.\"O .\" search subdomain.domain.tld domain.tld +.\"O .\" and doing a hostlookup, for example by +.\"O .\" ping host.anothersubdomain +.\"O .\" it sends dns-requests for +.\"O .\" host.anothersubdomain. +.\"O .\" host.anothersubdomain.subdomain.domain.tld. +.\"O .\" host.anothersubdomain.domain.tld. +.\"O .\" thus not only causing unnecessary traffic for the root-dns-servers +.\"O .\" but broadcasting information to the outside and making man-in-the-middle +.\"O .\" attacks possible. +.\" resolv.conv ¤Ë +.\" search subdomain.domain.tld domain.tld +.\" °Ê²¼¤Î¤è¤¦¤Ê¹Ô¤¬¤¢¤ë¾ì¹ç¤Ë¡¢¤¿¤È¤¨¤Ð +.\" ping host.anothersubdomain +.\" ¤Ë¤è¤ë¥Û¥¹¥È¤Î¸¡º÷¤¬¹Ô¤ï¤ì¤ë¤È¡¢ +.\" host.anothersubdomain. +.\" host.anothersubdomain.subdomain.domain.tld. +.\" host.anothersubdomain.domain.tld. +.\" ¤ËÂФ·¤Æ DNS ¥ê¥¯¥¨¥¹¥È¤¬Á÷¤é¤ë¡£ +.\" ¤³¤ì¤Ë¤è¤Ã¤Æ¡¢¥ë¡¼¥È DNS ¥µ¡¼¥Ð¤ËÂФ·¤Æ +.\" ÉÔɬÍפʥȥé¥Õ¥£¥Ã¥¯¤ò°ú¤­µ¯¤³¤¹¤À¤±¤Ç¤Ê¤¯¡¢ +.\" ³°Éô¤Ë¾ðÊó¤ò¤Ð¤é¤Þ¤¤¤Æ¤·¤Þ¤¦¤¿¤á¤Ë¡¢Âè»°¼Ô¤Ë¤è¤ë¹¶·â¤¬²Äǽ¤Ë¤Ê¤ë¡£ +.\"O Note that this process may be slow and will generate a lot of network +.\"O traffic if the servers for the listed domains are not local, +.\"O and that queries will time out if no server is available +.\"O for one of the domains. +¤³¤Î¥×¥í¥»¥¹¤ÏÃÙ¤¯¡¢¥ê¥¹¥È¤µ¤ì¤¿¥É¥á¥¤¥ó¤¬¥í¡¼¥«¥ë¤Î¤â¤Î¤Ç¤Ê¤¤¾ì¹ç¡¢ +¿Âç¤Ê¥Í¥Ã¥È¥ï¡¼¥¯¥È¥é¥Õ¥£¥Ã¥¯¤òȯÀ¸¤µ¤»¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤µ¤é¤Ë¡¢¤³¤ì¤é¤Î¥É¥á¥¤¥ó¤Î¤¤¤º¤ì¤«¤Ò¤È¤Ä¤Ë¤Ç¤âŬÀڤʥµ¡¼¥Ð¤¬¤Ê¤¤¾ì¹ç¡¢ +Ì䤤¹ç¤ï¤»¤¬¥¿¥¤¥à¥¢¥¦¥È¤Ë¤Ê¤ëÅÀ¤Ë¤âÃí°Õ¤¹¤ë¤³¤È¡£ +.IP +¸½¾õ¤Ç¤Ï¡¢¸¡º÷¥ê¥¹¥È¤Ï 6 ¥É¥á¥¤¥ó¡¦·× 256 ʸ»ú¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +\fBsortlist\fP +.\"O This option allows addresses returned by +.\"O .BR gethostbyname (3) +.\"O to be sorted. +.\"O A sortlist is specified by IP-address-netmask pairs. +.\"O The netmask is +.\"O optional and defaults to the natural netmask of the net. +.\"O The IP address +.\"O and optional network pairs are separated by slashes. +.\"O Up to 10 pairs may +.\"O be specified. +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¡¢ +.BR gethostbyname (3) +¤ÇÊÖ¤µ¤ì¤ë¥¢¥É¥ì¥¹¤ò¥½¡¼¥È¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +sortlist ¤Ï IP ¥¢¥É¥ì¥¹¤È¥Í¥Ã¥È¥Þ¥¹¥¯¤Î¥Ú¥¢¤Ç»ØÄꤵ¤ì¤ë¡£ +¥Í¥Ã¥È¥Þ¥¹¥¯¤Ï¾Êά²Äǽ¤Ç¤¢¤ê¡¢ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥Í¥Ã¥È¤ËÂФ¹¤ë¥Ç¥Õ¥©¥ë¥È¤Î¥Í¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +IP ¥¢¥É¥ì¥¹¤È¥ª¥×¥·¥ç¥ó¤Î¥Í¥Ã¥È¥Þ¥¹¥¯¤Î¥Ú¥¢¤Ï¥¹¥é¥Ã¥·¥å¤Ç¶èÀڤ롣 +ºÇÂç 10 ÁȤΥڥ¢¤ò»ØÄê¤Ç¤­¤ë¡£ +.\"O Here is an example: +°Ê²¼¤ËÎã¤ò¼¨¤¹¡£ + +.in +4n +sortlist 130.155.160.0/255.255.240.0 130.155.0.0 +.in +.br +.TP +\fBoptions\fP +.\"O Options allows certain internal resolver variables to be modified. +.\"O The syntax is +options ¤Ë¤è¤ê¡¢¥ì¥¾¥ë¥Ð¤ÎÆâÉôÊÑ¿ô¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +½ñ¼°¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.RS +.IP +\fBoptions\fP \fIoption\fP \fI...\fP +.LP +.\"O where \fIoption\fP is one of the following: +¤³¤³¤Ç \fIoption\fP ¤Ï¼¡¤Î¤¦¤Á¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ +.TP +\fBdebug\fP +.\" Since glibc 2.2? +.\"O sets +.\"O .B RES_DEBUG +.\"O in +.\"O .IR _res.options . +.I _res.options +¤Ë +.B RES_DEBUG +¤òÀßÄꤹ¤ë¡£ +.TP +.BI ndots: n +.\" Since glibc 2.2 +.\"O sets a threshold for the number of dots which +.\"O must appear in a name given to +.\"O .BR res_query (3) +.\"O (see +.\"O .BR resolver (3)) +.\"O before an \fIinitial absolute query\fP will be made. +.\"O The default for +.\"O \fIn\fP is 1, meaning that if there are any dots in a name, the name +.\"O will be tried first as an absolute name before any \fIsearch list\fP +.\"O elements are appended to it. +.\"O The value for this option is silently capped to 15. +¡Ö\fIºÇ½é¤Î´°Á´¤Ê̾Á°¤Ç¤ÎÌ䤤¹ç¤ï¤»\fP¤¬¼Â¹Ô¤µ¤ì¤ëÁ°¤Ë¡¢ +.BR res_query (3) +.RB ( resolver (3) +¤ò»²¾È) ¤ËÍ¿¤¨¤é¤ì¤ë̾Á°¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤Ù¤­¥É¥Ã¥È¤Î¿ô¤ÎïçÃ͡פòÀßÄꤹ¤ë¡£ +\fIn\fP ¤Î¥Ç¥Õ¥©¥ë¥È¤Ï 1 ¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï¡¢Ì¾Á°¤Ë¥É¥Ã¥È¤¬¤¢¤ë¾ì¹ç¡¢\fIsearch list\fP ¤ÎÍ×ÁǤ¬Éղ䵤ì¤ëÁ°¤Ë¡¢ +¤½¤Î̾Á°¤¬´°Á´¤Ê̾Á°¤È¤·¤ÆºÇ½é¤Ë»î¤µ¤ì¤ë¤È¤¤¤¦¤³¤È¤ò°ÕÌ£¤·¤Æ¤¤¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÎÃͤξå¸Â¤Ï 15 ¤Ç¤¢¤ê¡¢ÌۤäƤ³¤ÎÃͤޤÇÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.TP +.BI timeout: n +.\" Since glibc 2.2 +.\"O sets the amount of time the resolver will wait for a +.\"O response from a remote name server before retrying the +.\"O query via a different name server. +.\"O Measured in seconds, +.\"O the default is +.\"O .B RES_TIMEOUT +.\"O (currently 5, see \fI\fP). +.\"O The value for this option is silently capped to 30. +¡Ö¥ì¥¾¥ë¥Ð¤¬Â¾¤Î¥Í¡¼¥à¥µ¡¼¥Ð¤ÇÌ䤤¹ç¤ï¤»¤ò¥ê¥È¥é¥¤¤¹¤ëÁ°¤Ë¡¢ +¥ê¥â¡¼¥È¥Í¡¼¥à¥µ¡¼¥Ð¤«¤é¤Î±þÅú¤òÂԤĻþ´Ö¡×¤òÀßÄꤹ¤ë¡£ +ñ°Ì¤ÏÉäǡ¢¥Ç¥Õ¥©¥ë¥È¤Ï +.B RES_TIMEOUT +¤Ç¤¢¤ë +(¸½¾õ¤Ç¤Ï 5 Éá¢\fI\fP ¤ò»²¾È)¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÎÃͤξå¸Â¤Ï 30 ¤Ç¤¢¤ê¡¢ÌۤäƤ³¤ÎÃͤޤÇÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.TP +.BI attempts: n +.\"O sets the number of times the resolver will send a +.\"O query to its name servers before giving up and returning +.\"O an error to the calling application. +.\"O The default is +.\"O .B RES_DFLRETRY +.\"O (currently 2, see \fI\fP). +.\"O The value for this option is silently capped to 5. +¡Ö¥ì¥¾¥ë¥Ð¤¬Äü¤á¤Æ¸Æ¤Ó½Ð¤·¸µ¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¥¨¥é¡¼¤òÊÖ¤¹¤Þ¤Ç¤Ë¡¢ +¥Í¡¼¥à¥µ¡¼¥Ð¤ËÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦²ó¿ô¡×¤òÀßÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.B RES_DFLRETRY +²ó¤Ç¤¢¤ë +(¸½¾õ¤Ç¤Ï 2 ²ó¡¢\fI\fP ¤ò»²¾È)¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÎÃͤξå¸Â¤Ï 5 ¤Ç¤¢¤ê¡¢ÌۤäƤ³¤ÎÃͤޤÇÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.TP +.B rotate +.\" Since glibc 2.2 +.\"O sets +.\"O .B RES_ROTATE +.\"O in +.\"O .IR _res.options , +.\"O which causes round robin selection of nameservers from among those listed. +.\"O This has the effect of spreading the query load among all listed servers, +.\"O rather than having all clients try the first listed server first every time. +.I _res.options +¤Ë RES_ROTATE ¤òÀßÄꤹ¤ë¡£ +¥ê¥¹¥È¤µ¤ì¤Æ¤¤¤ë¥Í¡¼¥à¥µ¡¼¥Ð¤«¤éÁª¤Ö¤È¤­¤Ë¡¢ +¥é¥¦¥ó¥É¥í¥Ó¥ó (round robin) ÁªÂò¤ò¹Ô¤ï¤»¤ë¡£ +¥ê¥¹¥È¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥µ¡¼¥Ð¤ÇÌ䤤¹ç¤ï¤»¤ÎÉé²Ù¤òʬ»¶¤¹¤ë¸ú²Ì¤¬¤¢¤ê¡¢ +ºÇ½é¤Ë¥ê¥¹¥È¤µ¤ì¤¿¥µ¡¼¥Ð¤ËÁ´¤Æ¤Î¥¯¥é¥¤¥¢¥ó¥È¤¬ +Ëè²óºÇ½é¤ËÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦¤ï¤±¤Ç¤Ï¤Ê¤¯¤Ê¤ë¡£ +.TP +.B no-check-names +.\" Since glibc 2.2 +.\"O sets +.\"O .B RES_NOCHECKNAME +.\"O in +.\"O .IR _res.options , +.\"O which disables the modern BIND checking of incoming hostnames and +.\"O mail names for invalid characters such as underscore (_), non-ASCII, +.\"O or control characters. +.I _res.options +¤Ë +.B RES_NOCHECKNAME +¤òÀßÄꤹ¤ë¡£ +Æþ¤Ã¤Æ¤¯¤ë¥Û¥¹¥È̾¤È¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ë¡¢ +¥¢¥ó¥À¡¼¥¹¥³¥¢ (_)¡¦ASCII °Ê³°¤Îʸ»ú¡¦À©¸æʸ»ú¤È¤¤¤Ã¤¿ +ÉÔÀµ¤Êʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤«¤òÄ´¤Ù¤ë +ºÇ¶á¤Î BIND ¤Î¥Á¥§¥Ã¥¯¤ò̵¸ú¤Ë¤¹¤ë¡£ +.TP +.B inet6 +.\" Since glibc 2.2 +.\"O sets +.\"O .BR RES_USE_INET6 +.\"O in +.\"O .IR _res.options . +.\"O This has the effect of trying a AAAA query before an A query inside the +.\"O .BR gethostbyname (3) +.\"O function, and of mapping IPv4 responses in IPv6 "tunneled form" +.\"O if no AAAA records are found but an A record set exists. +.I _res.options +¤Ë +.B RES_USE_INET6 +¤òÀßÄꤹ¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤ë¤È¡¢ +.BR gethostbyname (3) +´Ø¿ô¤ÎÆâÉô¤Ç A ¥ì¥³¡¼¥É¤ÎÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦Á°¤Ë +AAAA ¥ì¥³¡¼¥É¤ÎÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦¤è¤¦¤Ë¤Ê¤ë¡£ +¤Þ¤¿¡¢AAAA ¥ì¥³¡¼¥É¤Ï¸«¤Ä¤«¤é¤Ê¤¤¤¬ A ¥ì¥³¡¼¥É¥»¥Ã¥È¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ë¡¢ +IPv4 ¤Î±þÅú¤ò IPv6¡Ö¥È¥ó¥Í¥ë·Á¼°¡×¤Ë¥Þ¥Ã¥×¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.TP +.\"O .BR ip6-bytestring " (since glibc 2.3.4)" +.BR ip6-bytestring " (glibc 2.3.4 °Ê¹ß)" +.\"O sets +.\"O .BR RES_USE_BSTRING +.\"O in +.\"O .IR _res.options . +.\"O This causes reverse IPv6 lookups to be made using the bit-label format +.\"O described in RFC\ 2673; +.\"O if this option is not set, then nibble format is used. +.I _res.options +¤Ë +.B RES_USE_BSTRING +¤òÀßÄꤹ¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤ë¤È¡¢IPv6 ¥¢¥É¥ì¥¹¤ÎµÕ°ú¤­¤Ç +RFC\ 2673 ¤Çµ¬Äꤵ¤ì¤¿ bit-label ·Á¼°¤¬»ÈÍѤµ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢nibble ·Á¼°¤¬»ÈÍѤµ¤ì¤ë¡£ +.TP +.\"O .BR ip6-dotint / no-ip6-dotint " (since glibc 2.3.4)" +.BR ip6-dotint / no-ip6-dotint " (glibc 2.3.4 °Ê¹ß)" +.\"O Clear/set +.\"O .BR RES_NOIP6DOTINT +.\"O in +.\"O .IR _res.options . +.I _res.options +¤Ø¤Î +.B RES_NOIP6DOTINT +¤Î¥»¥Ã¥È/¥¯¥ê¥¢¤ò¹Ô¤¦¡£ +.\"O When this option is clear +.\"O .RB ( ip6-dotint ), +.\"O reverse IPv6 lookups are made in the (deprecated) +.\"O .I ip6.int +.\"O zone; +.\"O when this option is set +.\"O .RB ( no-ip6-dotint ), +.\"O reverse IPv6 lookups are made in the +.\"O .I ip6.arpa +.\"O zone by default. +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¥¯¥ê¥¢¤µ¤ì¤ë¤È +.RB ( ip6-dotint )¡¢ +IPv6 ¥¢¥É¥ì¥¹¤ÎµÕ°ú¤­¤¬ (Èó¿ä¾©¤Î) +.I ip6.int +¥¾¡¼¥ó¤Ç¹Ô¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¥»¥Ã¥È¤µ¤ì¤ë¤È +.RB ( no-ip6-dotint )¡¢ +IPv6 ¥¢¥É¥ì¥¹¤ÎµÕ°ú¤­¤¬¥Ç¥Õ¥©¥ë¥È¤Î +.I ip6.arpa +¥¾¡¼¥ó¤Ç¹Ô¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.\"O This option is set by default. +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¥»¥Ã¥È¤µ¤ì¤ë¡£ +.TP +.\"O .BR edns0 " (since glibc 2.6)" +.BR edns0 " (glibc 2.6 °Ê¹ß)" +.\"O sets +.\"O .BR RES_USE_EDNSO +.\"O in +.\"O .IR _res.options . +.\"O This enables support for the DNS extensions described in RFC\ 2671. +.I _res.options +¤Ë +.B RES_USE_EDNSO +¤ò¥»¥Ã¥È¤¹¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢RFC\ 2671 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë +DNS ³ÈÄ¥¤Î¥µ¥Ý¡¼¥È¤¬Í­¸ú¤Ë¤Ê¤ë¡£ +.RE +.LP +.\"O The \fIdomain\fP and \fIsearch\fP keywords are mutually exclusive. +.\"O If more than one instance of these keywords is present, +.\"O the last instance wins. +\fIdomain\fP ¤È \fIsearch\fP ¥­¡¼¥ï¡¼¥É¤Ï¡¢¸ß¤¤¤ËÇÓ¾Ū¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥­¡¼¥ï¡¼¥É¤¬ 2 ¤Ä°Ê¾åµ­½Ò¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +ºÇ¸å¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤¬Í­¸ú¤Ë¤Ê¤ë¡£ +.LP +.\"O The \fIsearch\fP keyword of a system's \fIresolv.conf\fP file can be +.\"O overridden on a per-process basis by setting the environment variable +.\"O .B LOCALDOMAIN +.\"O to a space-separated list of search domains. +¥·¥¹¥Æ¥à¤Î \fIresolv.conf\fP ¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë \fIsearch\fP ¥­¡¼¥ï¡¼¥É¤Ï¡¢ +¥¹¥Ú¡¼¥¹¤Ç¶èÀڤ俸¡º÷¥É¥á¥¤¥ó¤Î¥ê¥¹¥È¤ò +´Ä¶­ÊÑ¿ô +.B LOCALDOMAIN +¤ËÀßÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¢³Æ¥×¥í¥»¥¹Ëè¤Ë¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +.\"O The \fIoptions\fP keyword of a system's \fIresolv.conf\fP file can be +.\"O amended on a per-process basis by setting the environment variable +.\"O .B RES_OPTIONS +.\"O to a space-separated list of resolver options +.\"O as explained above under \fBoptions\fP. +¥·¥¹¥Æ¥à¤Î \fIresolv.conf\fP ¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë \fIoptions\fP ¥­¡¼¥ï¡¼¥É¤Ï¡¢ +¾å¤Î \fBoptions\fP ¥»¥¯¥·¥ç¥ó¤ÇÀâÌÀ¤·¤¿¤è¤¦¤Ë¡¢ +¥¹¥Ú¡¼¥¹¤Ç¶èÀڤ俥쥾¥ë¥Ð¥ª¥×¥·¥ç¥ó¤Î¥ê¥¹¥È¤ò +´Ä¶­ÊÑ¿ô +.B RES_OPTIONS +¤ËÀßÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¢³Æ¥×¥í¥»¥¹Ëè¤Ë½¤Àµ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +.\"O The keyword and value must appear on a single line, and the keyword +.\"O (e.g., \fBnameserver\fP) must start the line. +.\"O The value follows the keyword, separated by white space. +¥­¡¼¥ï¡¼¥É¤ÈÃͤÏƱ¤¸¹Ô¤Ë½ñ¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤Þ¤¿¡¢(\fBnameserver\fP ¤Î¤è¤¦¤Ê) ¥­¡¼¥ï¡¼¥É¤¬¹Ô¤ÎÀèƬ¤Ë¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Ãͤϥ­¡¼¥ï¡¼¥É¤Î¸å¤Ë¥¹¥Ú¡¼¥¹¤Ç¶èÀڤäƳ¤±¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.IR /etc/resolv.conf , +.I +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR gethostbyname (3), +.BR resolver (3), +.BR hostname (7), +.BR named (8) +.br +.\"O Name Server Operations Guide for BIND +BIND ¤Î¥Í¡¼¥à¥µ¡¼¥Ð¥ª¥Ú¥ì¡¼¥·¥ç¥ó¥¬¥¤¥É +.\"O +.\"O Local Variables: +.\"O mode: nroff +.\"O End: diff --git a/draft/man5/rpc.5 b/draft/man5/rpc.5 new file mode 100644 index 00000000..a2f2b024 --- /dev/null +++ b/draft/man5/rpc.5 @@ -0,0 +1,102 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)rpc.5 2.2 88/08/03 4.0 RPCSRC; from 1.4 87/11/27 SMI; +.\" +.\" This page is a part of LDP man-pages 1.25 +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated Fri Aug 27 1999 by NAKANO Takeo +.\" Updated Sat Dec 22 JST 2001 by Kentaro Shirakata +.\" +.TH RPC 5 1985-09-26 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O rpc \- rpc program number data base +.SH ̾Á° +rpc \- rpc ¥×¥í¥°¥é¥àÈÖ¹æ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B /etc/rpc +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .I rpc +.\"O file contains user readable names that +.\"O can be used in place of RPC program numbers. +.\"O Each line has the following information: +.I rpc +¥Õ¥¡¥¤¥ë¤Ë¤Ï RPC ¥×¥í¥°¥é¥àÈÖ¹æ¤ÎÂå¤ï¤ê¤Ë»È¤¦¤³¤È¤Î¤Ç¤­¤ë +¥æ¡¼¥¶¡¼¤Ë²ÄÆɤÊ̾Á°¤¬Æþ¤Ã¤Æ¤¤¤ë¡£¤½¤ì¤¾¤ì¤Î¹Ô¤Ï°Ê²¼¤Î¾ðÊó¤ò´Þ¤à¡£ +.HP 10 +.\"O name of server for the RPC program +RPC ¥×¥í¥°¥é¥à¤Î¥µ¡¼¥Ð¤Î̾Á° +.br +.ns +.HP 10 +.\"O RPC program number +RPC ¥×¥í¥°¥é¥àÈÖ¹æ +.br +.ns +.HP 10 +.\"O aliases +ÊÌ̾ +.LP +.\"O Items are separated by any number of blanks and/or +.\"O tab characters. +.\"O A \(aq#\(aq indicates the beginning of a comment; characters from +.\"O the \(aq#\(aq to the end of the line are not interpreted by routines +.\"O which search the file. +¤½¤ì¤¾¤ì¤Î¹àÌܤÏǤ°Õ¤Î¸Ä¿ô¤Î¶õÇò¡¦¥¿¥Ö (º®ºß²Ä) ¤Ë¤è¤Ã¤Æ¶èÀÚ¤é¤ì¤ë¡£ +ÀèƬ¤Ë \(aq#\(aq ¤Î¤¢¤ë¹Ô¤Ï¥³¥á¥ó¥È¤Ç¤¢¤ë¡£ +\(aq#\(aq ¤«¤é¤½¤Î¹Ô¤Î½ªÎ»¤Þ¤Ç¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ò¥µ¡¼¥Á¤¹¤ë¥ë¡¼¥Á¥ó¤Ë¤è¤Ã¤Æ +²ò¼á¤µ¤ì¤Ê¤¯¤Ê¤ë¡£ +.LP +.\"O Here is an example of the \fI/etc/rpc\fP file from the Sun RPC Source +.\"O distribution. +°Ê²¼¤Ë¡¢ Sun RPC ¤Î¥½¡¼¥¹¥Ñ¥Ã¥±¡¼¥¸¤«¤é¤È¤Ã¤Æ¤­¤¿ +\fI/etc/rpc\fP ¥Õ¥¡¥¤¥ë¤ÎÎã¤ò¼¨¤¹¡£ +.nf +.ta 1.5i +0.5i +1.0i +1.0i +# +# rpc 88/08/01 4.0 RPCSRC; from 1.12 88/02/07 SMI +# +portmapper 100000 portmap sunrpc +rstatd 100001 rstat rstat_svc rup perfmeter +rusersd 100002 rusers +nfs 100003 nfsprog +ypserv 100004 ypprog +mountd 100005 mount showmount +ypbind 100007 +walld 100008 rwall shutdown +yppasswdd 100009 yppasswd +etherstatd 100010 etherstat +rquotad 100011 rquotaprog quota rquota +sprayd 100012 spray +3270_mapper 100013 +rje_mapper 100014 +selection_svc 100015 selnsvc +database_svc 100016 +rexd 100017 rex +alis 100018 +sched 100019 +llockmgr 100020 +nlockmgr 100021 +x25.inr 100022 +statmon 100023 +status 100024 +bootparam 100026 +ypupdated 100028 ypupdate +keyserv 100029 keyserver +tfsd 100037 +nsed 100038 +nsemntd 100039 +.fi +.DT +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/rpc +.\"O RPC program number data base +RPC ¥×¥í¥°¥é¥àÈÖ¹æ¥Ç¡¼¥¿¥Ù¡¼¥¹ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getrpcent (3) diff --git a/draft/man5/securetty.5 b/draft/man5/securetty.5 new file mode 100644 index 00000000..e555cdd9 --- /dev/null +++ b/draft/man5/securetty.5 @@ -0,0 +1,64 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sun Jul 25 11:06:27 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1998 Hiroaki Nagoya all rights reserved. +.\" Translated Wed Feb 4 1998 by Hiroaki Nagoya +.\" +.TH SECURETTY 5 1992-12-29 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O securetty \- file which lists ttys from which root can log in +securetty \- root ¤¬¥í¥°¥¤¥ó¤Ç¤­¤ëüËö¥ê¥¹¥È¤Î¥Õ¥¡¥¤¥ë +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The file +.\"O .I /etc/securetty +.\"O is used by (some versions of) +.\"O .BR login (1). +.I /etc/securetty +¥Õ¥¡¥¤¥ë¤Ï (¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Î) +.BR login (1) +¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¡£ +.\"O The file contains the device names of tty lines +.\"O (one per line, without leading +.\"O .IR /dev/ ) +.\"O on which root is allowed to login. +root ¤Î¥í¥°¥¤¥ó¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ëüËö¤Î¥Ç¥Ð¥¤¥¹Ì¾¤¬£±¹Ô¤Ë +¤Ò¤È¤Ä¤º¤Ä½ñ¤«¤ì¤Æ¤¤¤ë (ÀèƬ¤Î +.I /dev/ +¤Ï¾Êά¤¹¤ë)¡£ +.\"O See +.\"O .BR login.defs (5) +.\"O if you use the shadow suite. +shadow login suite ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.BR login.defs (5) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.I /etc/securetty +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR login (1), +.BR login.defs (5) diff --git a/draft/man5/services.5 b/draft/man5/services.5 new file mode 100644 index 00000000..cbda10c4 --- /dev/null +++ b/draft/man5/services.5 @@ -0,0 +1,340 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1996 Austin Donnelly , +.\" with additional material Copyright (c) 1995 Martin Schulze +.\" +.\" +.\" 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 manpage was made by merging two independently written manpages, +.\" one written by Martin Schulze (18 Oct 95), the other written by +.\" Austin Donnelly, (9 Jan 96). +.\" +.\" Thu Jan 11 12:14:41 1996 Austin Donnelly +.\" * Merged two services(5) manpages +.\" +.\" Japanese Version Copyright (c) 1997 MOTOKI Akihiro +.\" all rights reserved. +.\" Translated Wed Aug 20 08:32:26 JST 1997 +.\" by MOTOKI Akihiro +.\" +.TH SERVICES 5 2008-09-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O services \- Internet network services list +services \- ¥¤¥ó¥¿¡¼¥Í¥Ã¥È ¥Í¥Ã¥È¥ï¡¼¥¯¥µ¡¼¥Ó¥¹ ¥ê¥¹¥È +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .B services +.\"O is a plain ASCII file providing a mapping between human-friendly textual +.\"O names for internet services, and their underlying assigned port +.\"O numbers and protocol types. +.\"O Every networking program should look into +.\"O this file to get the port number (and protocol) for its service. +.B services +¤Ï¡¢¿Í¤¬Ê¬¤«¤ê¤ä¤¹¤¤·Á¤Î¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥µ¡¼¥Ó¥¹¤Î̾Á°¤È¡¢ +¤½¤ì¤é¤Î¥µ¡¼¥Ó¥¹¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥Ý¡¼¥ÈÈÖ¹æ¤ä +¥×¥í¥È¥³¥ë¼ïÊ̤ÎÂбþ´Ø·¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +¥Í¥Ã¥È¥ï¡¼¥¯¾å¤ÇÆ°ºî¤¹¤ë¥×¥í¥°¥é¥à¤Ï¤¹¤Ù¤Æ¡¢ +¤½¤Î¥µ¡¼¥Ó¥¹¤ËÂбþ¤¹¤ë¥Ý¡¼¥ÈÈÖ¹æ (¤È¥×¥í¥È¥³¥ë) ¤òÆÀ¤ë¤¿¤á¤Ë¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë¤òÄ´¤Ù¤ëɬÍפ¬¤¢¤ë¡£ +.\"O The C library routines +.\"O .BR getservent (3), +.\"O .BR getservbyname (3), +.\"O .BR getservbyport (3), +.\"O .BR setservent (3), +.\"O and +.\"O .BR endservent (3) +.\"O support querying this file from programs. +C ¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤¢¤ë +.BR getservent (3), +.BR getservbyname (3), +.BR getservbyport (3), +.BR setservent (3), +.BR endservent (3) +¤òÍøÍѤ¹¤ë¤³¤È¤Ç¡¢¥×¥í¥°¥é¥à¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤òÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O Port numbers are assigned by the IANA (Internet Assigned Numbers +.\"O Authority), and their current policy is to assign both TCP and UDP +.\"O protocols when assigning a port number. +.\"O Therefore, most entries will +.\"O have two entries, even for TCP-only services. +¥Ý¡¼¥ÈÈÖ¹æ¤Ï¡¢IANA (Internet Assigned Numbers Authority) ¤Ë¤è¤Ã¤Æ +³ä¤êÅö¤Æ¤é¤ì¤Æ¤ª¤ê¡¢¸½ºß¤Ï¥Ý¡¼¥ÈÈÖ¹æ¤ò³ä¤êÅö¤Æ¤ëºÝ¤Ë +TCP ¤È UDP ¤ÎξÊý¤Î¥×¥í¥È¥³¥ë¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤½¤Î¤¿¤á¡¢¤Û¤È¤ó¤É¤Î¥µ¡¼¥Ó¥¹¤ËÂФ·¤Æ¡¢ +¤¿¤È¤¨ TCP ¤À¤±¤Î¥µ¡¼¥Ó¥¹¤Î¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢Âбþ¤¹¤ë¹àÌܤ¬Æó¤Ä¤¢¤ë¤³¤È¤Ë¤Ê¤ë¡£ + +.\"O Port numbers below 1024 (so-called "low numbered" ports) can only be +.\"O bound to by root (see +.\"O .BR bind (2), +.\"O .BR tcp (7), +.\"O and +.\"O .BR udp (7)). +.\"O This is so clients connecting to low numbered ports can trust +.\"O that the service running on the port is the standard implementation, +.\"O and not a rogue service run by a user of the machine. +.\"O Well-known port numbers specified by the IANA are normally +.\"O located in this root-only space. +1024 ¤è¤ê¾®¤µ¤¤¥Ý¡¼¥ÈÈÖ¹æ (¤¤¤ï¤æ¤ë "low numbered" ¥Ý¡¼¥È) ¤Ï +´ÉÍý¼Ô (root) ¸¢¸Â¤Ë¤è¤Ã¤Æ¤Î¤ß»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.RB ( bind (2), +.BR tcp (7), +.BR udp (7) +»²¾È)¡£ +¤³¤ì¤Ï¡¢¤³¤ì¤é¤Î¥Ý¡¼¥È¤ËÀܳ¤¹¤ë¥¯¥é¥¤¥¢¥ó¥È¤ËÂФ·¤Æ¡¢ +¤½¤Î¥Ý¡¼¥È¤ÇÆ°¤¤¤Æ¤¤¤ë¥µ¡¼¥Ó¥¹¤¬É¸½àŪ¤Ê¼ÂÁõ¤Ç¤¢¤ê¡¢ +¤½¤Î·×»»µ¡¤Î¥æ¡¼¥¶¡¼¤¬Æ°¤«¤·¤Æ¤¤¤ë +ÉÔÀµ¤Ê¥µ¡¼¥Ó¥¹¤Ç¤Ï¤Ê¤¤¤³¤È¤òÊݾڤ¹¤ë¤¿¤á¤Ç¤¢¤ë¡£ +IANA ¤ËÌÀµ­¤µ¤ì¤Æ¤¤¤ë¤è¤¯»ÈÍѤµ¤ì¤ë¥Ý¡¼¥ÈÈÖ¹æ¤Ï¡¢ +Ä̾盧¤Î¤è¤¦¤Ê´ÉÍý¼Ô¤À¤±¤¬»ÈÍѤǤ­¤ëÈϰϤËÇÛÃÖ¤µ¤ì¤ë¡£ + +.\"O The presence of an entry for a service in the +.\"O .B services +.\"O file does not necessarily mean that the service is currently running +.\"O on the machine. +.\"O See +.\"O .BR inetd.conf (5) +.\"O for the configuration of Internet services offered. +.\"O Note that not all +.\"O networking services are started by +.\"O .BR inetd (8), +.\"O and so won't appear in +.\"O .BR inetd.conf (5). +.B services +¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë¥µ¡¼¥Ó¥¹¤ËÂФ¹¤ë¹àÌܤ¬¤¢¤Ã¤Æ¤â¡¢É¬¤º¤·¤â¤½¤Î¥µ¡¼¥Ó¥¹¤¬¸½ +ºß¤½¤Î·×»»µ¡¤ÇÆ°¤¤¤Æ¤¤¤ëÌõ¤Ç¤Ï¤Ê¤¤¡£ÍøÍѲÄǽ¤Ê¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥µ¡¼¥Ó¥¹¤ÎÀßÄê¤Ë +¤Ä¤¤¤Æ¤Ï +.BR inetd.conf (5) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£¤¿¤À¤·¡¢¤¹¤Ù¤Æ¤Î¥µ¡¼¥Ó¥¹¤¬ +.BR inetd (8) +¤Ë¤è¤Ã¤Æµ¯Æ°¤µ¤ì¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢ +.BR inetd.conf (5) +¤Ë¤Ï½ñ¤«¤ì¤Æ¤¤¤Ê¤¤¥µ¡¼¥Ó¥¹¤â¤¢¤ë¤³¤È¤ËÃí°Õ¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.\"O In particular, news (NNTP) and mail (SMTP) servers are often +.\"O initialized from the system boot scripts. +Æäˡ¢¥Í¥Ã¥È¥Ë¥å¡¼¥¹ (NNTP) ¤ä ¥á¡¼¥ë (SMTP) ¤Î¥µ¡¼¥Ð¡¼¤Ï¡¢¥·¥¹¥Æ¥àµ¯Æ°»þ¤Î +¥¹¥¯¥ê¥×¥È¤«¤éµ¯Æ°¤µ¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ + +.\"O The location of the +.\"O .B services +.\"O file is defined by +.\"O .B _PATH_SERVICES +.\"O in +.\"O .IR "." +.\"O This is usually set to +.\"O .IR /etc/services "." +.B services +¥Õ¥¡¥¤¥ë¤Î¾ì½ê¤Ï¡¢ +.I +Ãæ¤Î +.B _PATH_SERVICES +¤Ë¤è¤Ã¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ÎÃͤÏÄ̾ï +.I /etc/services +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¡£ + +.\"O Each line describes one service, and is of the form: + 1 ¹Ô¤Ë¤Ä¤­ 1 ¥µ¡¼¥Ó¥¹¤¬µ­½Ò¤µ¤ì¤Æ¤ª¤ê¡¢¤½¤Î·Á¼°¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.IP +\f2service-name\ \ \ port\f3/\f2protocol\ \ \ \f1[\f2aliases ...\f1] +.TP +.\"O where: +.TP 10 +.I service-name +.\"O is the friendly name the service is known by and looked up under. +.\"O It is case sensitive. +.\"O Often, the client program is named after the +.\"O .IR service-name "." +¥µ¡¼¥Ó¥¹¤òɽ¤¹Ê¬¤«¤ê¤ä¤¹¤¤Ì¾Á°¤Ç¤¢¤ê¡¢¸¡º÷¤ÎºÝ¤Ë¤â»ÈÍѤµ¤ì¤ë¡£ +Âçʸ»ú¤È¾®Ê¸»ú¤Ï¶èÊ̤µ¤ì¤ë¡£ +¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Ï +.I service-name +¤Ë¤Á¤Ê¤ó¤Ç̾ÉÕ¤±¤é¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ +.TP +.I port +.\"O is the port number (in decimal) to use for this service. +¥µ¡¼¥Ó¥¹¤ËÂФ·¤Æ»ÈÍѤµ¤ì¤ë¥Ý¡¼¥ÈÈֹ档10 ¿Ê¿ô¤Ç»ØÄꤹ¤ë¡£ +.TP +.I protocol +.\"O is the type of protocol to be used. +.\"O This field should match an entry +.\"O in the +.\"O .BR protocols (5) +.\"O file. +.\"O Typical values include +.\"O .B tcp +.\"O and +.\"O .BR udp . +»ÈÍѤµ¤ì¤ë¥×¥í¥È¥³¥ë¤Î¼ïÎà¡£¤³¤ÎÍó¤Ï¡¢ +.BR protocols (5) +¥Õ¥¡¥¤¥ë¤ÎÃæ¤Î¹àÌܤȰìÃפ·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +Ä̾ï»ÈÍѤµ¤ì¤ëÃͤϡ¢ +.B tcp +¤È +.B udp +¤Ç¤¢¤ë¡£ +.TP +.I aliases +.\"O is an optional space or tab separated list of other names for this +.\"O service (but see the BUGS section below). +.\"O Again, the names are case +.\"O sensitive. +¥µ¡¼¥Ó¥¹¤ËÂФ¹¤ëÊÌ̾¤Î¥ê¥¹¥È (¶èÀڤϥ¹¥Ú¡¼¥¹¤Þ¤¿¤Ï¥¿¥Ö) ¤Ç¡¢¤³¤ÎÍó¤Ï +ɬÍפˤʤé¤Ð½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë +(⤷¡¢²¼µ­¤Î¥Ð¥°¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È¤Î¤³¤È)¡£¤Þ¤¿¡¢ÊÌ̾¤Ï +Âçʸ»ú¤È¾®Ê¸»ú¤Ï¶èÊ̤µ¤ì¤ë¡£ +.PP +.\"O Either spaces or tabs may be used to separate the fields. +¤½¤ì¤¾¤ì¤ÎÍó¤Î¶èÀÚ¤ê¤Ë¤Ï¡¢¥¹¥Ú¡¼¥¹¤Þ¤¿¤Ï¥¿¥Ö¤¬»ÈÍѤµ¤ì¤ë¡£ + +.\"O Comments are started by the hash sign (#) and continue until the end +.\"O of the line. +.\"O Blank lines are skipped. +¥³¥á¥ó¥È¤Ï¥·¥ã¡¼¥× (#) ¤Ç»Ï¤Þ¤ê¡¢¤½¤Î¹Ô¤Î½ª¤ï¤ê¤Þ¤Ç¤¬¥³¥á¥ó¥È¤È¤ß¤Ê¤µ¤ì¤ë¡£ +¶õ¹Ô¤ÏÈô¤Ð¤µ¤ì¤ë¡£ + +.\"O The +.\"O .I service-name +.\"O should begin in the first column of the file, since leading spaces are +.\"O not stripped. +¹Ô¤Î»Ï¤á¤Î¥¹¥Ú¡¼¥¹¤Ï̵»ë¤µ¤ì¤Ê¤¤¤Î¤Ç¡¢ +.I service-name +¤Ï¡¢¹ÔƬ¤«¤é½ñ¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .I service-names +.\"O can be any printable characters excluding space and tab. +.\"O However, a conservative choice of characters should be used to minimize +.\"O compatibility problems. +.\"O E.g., a\-z, 0\-9, and hyphen (\-) would seem a +.\"O sensible choice. +.I service-names +¤Ï¡¢¥¹¥Ú¡¼¥¹¤È¥¿¥Ö°Ê³°¤Î°õ»ú²Äǽ¤Êʸ»ú¤Ê¤é²¿¤Ç¤â¤è¤¤¤¬¡¢¤·¤«¤·¤Ê¤¬¤é +¸ß´¹À­¤ÎÌäÂê¤ò¾¯¤Ê¤¯¤¹¤ë¤è¤¦¤Êʸ»ú¤òÁªÂò¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢a\-z ¡¢0\-9 ¡¢¥Ï¥¤¥Õ¥©¥ó (\-) ¤ò»ÈÍѤ¹¤ë¤Î¤¬ÌµÆñ¤È»×¤ï¤ì¤ë¡£ + +.\"O Lines not matching this format should not be present in the +.\"O file. +.\"O (Currently, they are silently skipped by +.\"O .BR getservent (3), +.\"O .BR getservbyname (3), +.\"O and +.\"O .BR getservbyport (3). +.\"O However, this behavior should not be relied on.) +»ØÄꤵ¤ì¤¿·Á¼°¤Ë¹ç¤ï¤Ê¤¤¹Ô¤Ï¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤ (¸½ºß¤Ï¡¢¤½¤Î¤è¤¦¤Ê¹Ô¤Ï +.BR getservent (3), +.BR getservbyname (3), +.BR getservbyport (3) +¤Ë¤è¤Ã¤Æ̵»ë¤µ¤ì¤ë¡£¤·¤«¤·¡¢¤½¤Î¾ì¹ç¤ÎµóÆ°¤Ï¿®Íê¤Ç¤­¤Ê¤¤)¡£ + +.\" The following is not true as at glibc 2.8 (a line with a comma is +.\" ignored by getservent()); it's not clear if/when it was ever true. +.\"O .\" As a backwards compatibility feature, the slash (/) between the +.\"O .\" .I port +.\"O .\" number and +.\"O .\" .I protocol +.\"O .\" name can in fact be either a slash or a comma (,). +.\"O .\" Use of the comma in +.\"O .\" modern installations is deprecated. +.\" ¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤È¤ÎÀ°¹çÀ­¤ÎÌäÂ꤫¤é¡¢¼ÂºÝ¤Ë¤Ï +.\" .I port +.\" ÈÖ¹æ¤È +.\" .I protocol +.\" ¤Î´Ö¤Î¥¹¥é¥Ã¥·¥å (/) ¤Ï¡¢¥¹¥é¥Ã¥·¥å¤«¥³¥ó¥Þ (,) ¤Î¤É¤Á¤é¤Ç¤â¹½¤ï¤Ê¤¤¡£ +.\" ¤·¤«¤·¤Ê¤¬¤é¡¢º£¤Ê¤ª¥³¥ó¥Þ¤ò»ÈÍѤ¹¤ë¤Î¤Ï˾¤Þ¤·¤¤¤³¤È¤Ç¤Ï¤Ê¤¤¡£ +.\" +.\"O This file might be distributed over a network using a network-wide +.\"O naming service like Yellow Pages/NIS or BIND/Hesiod. +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢Yellow Pages/NIS ¤ä BIND/Hesiod ¤Î¤è¤¦¤Ê¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î̾Á° +¥µ¡¼¥Ó¥¹¤òÍѤ¤¤Æ¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤òÄ̤¸¤ÆÇÛÉÛ¤µ¤ì¤ë²ÄǽÀ­¤â¤¢¤ë¡£ + +.\"O A sample +.\"O .B services +.\"O file might look like this: +.B services +¥Õ¥¡¥¤¥ë¤Î¸«Ëܤò°Ê²¼¤Ë¼¨¤¹¡£ +.RS +.nf +.sp +.ta 3i +netstat 15/tcp +qotd 17/tcp quote +msp 18/tcp # message send protocol +msp 18/udp # message send protocol +chargen 19/tcp ttytst source +chargen 19/udp ttytst source +ftp 21/tcp +# 22 \- unassigned +telnet 23/tcp +.fi +.RE +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/services +.\"O The Internet network services list +¥¤¥ó¥¿¡¼¥Í¥Ã¥È ¥Í¥Ã¥È¥ï¡¼¥¯¥µ¡¼¥Ó¥¹¤Î¥ê¥¹¥È +.TP +.I +.\"O Definition of +.\"O .B _PATH_SERVICES +.B _PATH_SERVICES +¤ÎÄêµÁ +.\"O .\" .SH BUGS +.\" .SH ¥Ð¥° +.\" It's not clear when/if the following was ever true; +.\" it isn't true for glibc 2.8: +.\"O .\" There is a maximum of 35 aliases, due to the way the +.\"O .\" .BR getservent (3) +.\"O .\" code is written. +.\"O .\" +.\" .BR getservent (3) +.\" ¤Î¥³¡¼¥É¤Î½ñ¤­Êý¤ÎÌäÂê¤Ç¡¢35 ¸Ä¤Þ¤Ç¤·¤«ÊÌ̾¤òÉÕ¤±¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.\" +.\" It's not clear when/if the following was ever true; +.\" it isn't true for glibc 2.8: +.\"O .\" Lines longer than +.\"O .\" .B BUFSIZ +.\"O .\" (currently 1024) characters will be ignored by +.\"O .\" .BR getservent (3), +.\"O .\" .BR getservbyname (3), +.\"O .\" and +.\"O .\" .BR getservbyport (3). +.\"O .\" However, this will also cause the next line to be mis-parsed. +.\" .B BUFSIZ +.\" (¸½ºß¤Ï 1024) ʸ»ú¤è¤êŤ¤¹Ô¤Ï¡¢ +.\" .BR getservent (3), +.\" .BR getservbyname (3), +.\" .BR getservbyport (3) +.\" ¤Ë¤è¤ê̵»ë¤µ¤ì¤ë¡£¤µ¤é¤Ë¡¢¤³¤Î¤³¤È¤Ï¼¡¤Î¹Ô¤¬Àµ¤·¤¯²ò¼á¤µ¤ì¤Ê¤¤¸¶°ø¤È¤Ê¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR listen (2), +.BR endservent (3), +.BR getservbyname (3), +.BR getservbyport (3), +.BR getservent (3), +.BR setservent (3), +.BR inetd.conf (5), +.BR protocols (5), +.BR inetd (8) + +.\"O Assigned Numbers RFC, most recently RFC\ 1700, (AKA STD0002) +¥Ý¡¼¥ÈÈÖ¹æ¤Î³ä¤êÅö¤Æ¤òÄê¤á¤Æ¤¤¤ë RFC (ºÇ¿·ÈÇ¤Ï RFC\ 1700¡¢ÊÌ̾ STD0002) diff --git a/draft/man5/shells.5 b/draft/man5/shells.5 new file mode 100644 index 00000000..8f2c13be --- /dev/null +++ b/draft/man5/shells.5 @@ -0,0 +1,81 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Thu May 20 20:45:48 MET DST 1993 +.\" +.\" 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 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 +.\" +.TH SHELLS 5 1993-11-21 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O shells \- pathnames of valid login shells +.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) +¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¡£ +¾¤Î¥×¥í¥°¥é¥à¤â¤³¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤Ç¤­¤ë¡£ +.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 +.SH ¥Õ¥¡¥¤¥ë +.I /etc/shells +.\"O .SH EXAMPLE +.\"O .I /etc/shells +.\"O may contain the following paths: +.SH Îã +.I /etc/shells +¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê¥Ñ¥¹¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤À¤í¤¦¡£ +.sp +.RS +.I /bin/sh +.br +.I /bin/csh +.RE +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR chsh (1), +.BR getusershell (3) diff --git a/draft/man5/slabinfo.5 b/draft/man5/slabinfo.5 new file mode 100644 index 00000000..78df621a --- /dev/null +++ b/draft/man5/slabinfo.5 @@ -0,0 +1,191 @@ +.\" Copyright (c) 2001 Andreas Dilger (adilger@turbolinux.com) +.\" +.\" 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) 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 +.SH ̾Á° +/proc/slabinfo \- ¥«¡¼¥Í¥ë slab ¥¢¥í¥±¡¼¥¿¤ÎÅý·× +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B cat /proc/slabinfo +.\"O .SH DESCRIPTION +.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 +¤Ï¤³¤ì¤é¤ÎÅý·×¤òÍ¿¤¨¤ë¡£Îã¤ò¼¨¤¹¡£ +.LP +.in +4n +.nf +% cat /proc/slabinfo +slabinfo \- version: 1.1 +kmem_cache 60 78 100 2 2 1 +blkdev_requests 5120 5120 96 128 128 1 +mnt_cache 20 40 96 1 1 1 +inode_cache 7005 14792 480 1598 1849 1 +dentry_cache 5469 5880 128 183 196 1 +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 +\&... +.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 ¤¢¤¿¤ê¤Î¥Ú¡¼¥¸¿ô¡¢¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤ë¡£ + +.\"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 ¥­¥ã¥Ã¥·¥å¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤È¤Ë¤è¤ê¡¢ +¥ª¥Ö¥¸¥§¥¯¥È¤ÏÄ̾ï¥Ú¡¼¥¸¤ÎÆâÉô¤Ë¤­¤Ã¤Á¤ê¤È¤Ï¼ý¤á¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +ÍøÍÑÃæ¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¤Ò¤È¤Ä¤Ç¤âÊÝ»ý¤·¤Æ¤¤¤ë¥Ú¡¼¥¸¤Ï¡¢ +ÍøÍÑÃæ¤Ç¤¢¤ë¤È¤ß¤Ê¤µ¤ì¡¢²òÊü¤Ç¤­¤Ê¤¤¡£ + +.\"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 ¥­¥ã¥Ã¥·¥åÅý·×¤¬»È¤¨¤Ê¤¤¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥«¥é¥à¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¡£ + +.\"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 ¥­¥ã¥Ã¥·¥å¤¬¶õ¤À¤Ã¤¿¤ê°ìÇÕ¤À¤Ã¤¿¤ê¤·¤¿¾ì¹ç¤Ë¡¢ +¥°¥í¡¼¥Ð¥ë¤Ê¥­¥ã¥Ã¥·¥å¤È¼õ¤±ÅϤ·¤Ç¤­¤ë¥Õ¥ê¡¼¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤ÎºÇÂç¿ô¤Ç¤¢¤ë¡£ + +.\"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 ¥­¥ã¥Ã¥·¥å¤ÎÀ©¸Â¤ÎÈÏ°Ï¤Ë ¼ý¤Þ¤Ã¤¿/¼ý¤Þ¤é¤Ê¤«¤Ã¤¿ ²ó¿ô¤Ç¤¢¤ë¡£ + +.\"O It is possible to tune the SMP per-CPU slab cache limit +.\"O and batchcount via: +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 +.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 +.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 +¤òÍ­¸ú¤Ë¤·¤¿¾ì¹ç¤Î¤ß¸ºß¤¹¤ë¡£ + diff --git a/draft/man5/termcap.5 b/draft/man5/termcap.5 new file mode 100644 index 00000000..b7ac0219 --- /dev/null +++ b/draft/man5/termcap.5 @@ -0,0 +1,882 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 formatting Sat Jul 24 17:13:38 1993, Rik Faith (faith@cs.unc.edu) +.\" Modified (extensions and corrections) +.\" Sun May 1 14:21:25 MET DST 1994 Michael Haardt +.\" If mistakes in the capabilities are found, please send a bug report to: +.\" michael@moria.de +.\" Modified Mon Oct 21 17:47:19 EDT 1996 by Eric S. Raymond (esr@thyrsus.com) +.\" +.\" Japanese Version Copyright (c) 1999 NOKUBI Takatsugu +.\" all rights reserved. +.\" Translated Fri Jan 29 13:09:56 JST 1999 +.\" by NOKUBI Takatsugu +.\" Proofed & Modified Thu 12 Oct 2000 +.\" by NAKANO Takeo +.\" +.\"WORD capability µ¡Ç½ +.\"WORD formfeed ÊÇÁ÷¤ê +.\"WORD standout ¶¯Ä´ +.\"WORD carriage return Éüµ¢ +.\"WORD new line ²þ¹Ô +.\"WORD block graphic character(s) ¿Þ·Áʸ»ú(½¸¹ç) +.\"WORD alternate character set ÂåÂØʸ»ú½¸¹ç +.\" +.TH TERMCAP 5 1996-10-21 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O termcap \- terminal capability database +termcap \- üËöµ¡Ç½¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The termcap database is an obsolete facility for describing the +.\"O capabilities of character-cell terminals and printers. +.\"O It is retained only for capability with old programs; +.\"O new ones should use the +.\"O .BR terminfo (5) +.\"O database and associated libraries. +termcap ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ï¡¢ +ʸ»úñ°Ì¤ÇÆ°ºî¤¹¤ëüËö¤ä¥×¥ê¥ó¥¿¤Îµ¡Ç½¤òµ­½Ò¤¹¤ë¤¿¤á¤Îµì¼°¤Îµ¡¹½¤Ç¤¢¤ë¡£ +¤³¤Îµ¡¹½¤Ï¸Å¤¤¥×¥í¥°¥é¥à¤òÆ°ºî¤µ¤»¤ë¤¿¤á¤À¤±¤ËÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢ +¿·¤·¤¤¥×¥í¥°¥é¥à¤Ï +.BR terminfo (5) +¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¤½¤ì¤Ë´ØÏ¢¤·¤¿¥é¥¤¥Ö¥é¥ê¤òÍѤ¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.LP +.\"O .I /etc/termcap +.\"O is an ASCII file (the database master) that lists the capabilities of +.\"O many different types of terminals. +.\"O Programs can read termcap to find +.\"O the particular escape codes needed to control the visual attributes of +.\"O the terminal actually in use. +.\"O (Other aspects of the terminal are +.\"O handled by +.\"O stty (1).) +.\"O The termcap database is indexed on the +.\"O .B TERM +.\"O environment variable. +.I /etc/termcap +¤Ï¡¢Â¿¤¯¤Î°Û¤Ê¤ë¼ïÎà¤ÎüËö¤Ë´Ø¤¹¤ëµ¡Ç½¤òÎóµ­¤·¤¿¥¢¥¹¥­¡¼¥Õ¥¡¥¤¥ë +(¥Ç¡¼¥¿¥Ù¡¼¥¹¥Þ¥¹¥¿¡¼) ¤Ç¤¢¤ë¡£ +¥×¥í¥°¥é¥à¤Ï termcap ¤òÆɤ߹þ¤ó¤Ç¡¢ +¼ÂºÝ¤Ë»ÈÍѤ·¤Æ¤¤¤ëüËö¤Ë¸ÄÊ̤Υ¨¥¹¥±¡¼¥×¥³¡¼¥É·²¤ò¼èÆÀ¤¹¤ë¡£ +¤³¤ì¤òÍѤ¤¤ë¤È¡¢¤½¤ÎüËö¤Î»ë³ÐŪ¤ÊÀ­¼Á¤òÀ©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +(üËö¤Î¾¤ÎÀ­¼Á¤Ï +.BR stty (1) +¤ÇÀ©¸æ¤¹¤ë)¡£ +termcap ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ï¡¢´Ä¶­ÊÑ¿ô +.B TERM +¤ÎÃͤǰú¤«¤ì¤ë¡£ +.LP +.\"O Termcap entries must be defined on a single logical line, with \(aq\\\(aq +.\"O used to suppress the newline. +.\"O Fields are separated by \(aq:\(aq. +.\"O The first field of each entry starts at the left-hand margin, +.\"O and contains a list of names for the terminal, separated by \(aq|\(aq. +termcap ¤Î¥¨¥ó¥È¥ê¤Ï¡¢Ã±°ì¤ÎÏÀÍý¹Ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤¿¤À¤·¡¢¹ÔËö¤Ë \(aq\\\(aq ¤òÍѤ¤¤ì¤Ð¤½¤³¤Ç¤Î²þ¹Ô¤òÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Õ¥£¡¼¥ë¥É¤Ï \(aq:\(aq ¤Çʬ³ä¤µ¤ì¤ë¡£ +³Æ¥¨¥ó¥È¥ê¤ÎºÇ½é¤Î¥Õ¥£¡¼¥ë¥É¤Ïº¸Â¦ÀèƬ¤«¤é»Ï¤Þ¤ê¡¢ +ÆâÍƤϤ½¤ÎüËö¤Î̾Á°¤Î¥ê¥¹¥È¤Ç¤¢¤ë¡£Ì¾Á°¤Î¶èÀÚ¤ê¤Ë¤Ï \(aq|\(aq ¤¬ÍѤ¤¤é¤ì¤ë¡£ +.LP +.\"O The first subfield may (in BSD termcap entries from versions 4.3 and +.\"O prior) contain a short name consisting of two characters. +.\"O This short name may consist of capital or small letters. +.\"O In 4.4BSD termcap entries this field is omitted. +ºÇ½é¤Î¥µ¥Ö¥Õ¥£¡¼¥ë¥É¤Ï +(4.3 °ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤ÎBSD termcap ¥¨¥ó¥È¥ê¤Ç¤Ï) +2 ʸ»ú¤«¤é¤Ê¤ëû¤¤Ì¾Á°¤È¤Ê¤Ã¤Æ¤¤¤ë¡£¤³¤Îû¤¤Ì¾Á°¤Ï +Âçʸ»ú¤â¤·¤¯¤Ï¾®Ê¸»ú¤Ç¹½À®¤µ¤ì¤ë¡£4.4BSD ¤Î termcap ¥¨¥ó¥È¥ê¤Ç¤Ï¡¢ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¾Êά¤µ¤ì¤ë¡£ +.LP +.\"O The second subfield (first, in the newer 4.4BSD format) contains the +.\"O name used by the environment variable +.\"O .BR TERM . +.\"O It should be spelled in lowercase letters. +.\"O Selectable hardware capabilities should be marked +.\"O by appending a hyphen and a suffix to this name. +.\"O See below for an example. +.\"O Usual suffixes are w (more than 80 characters wide), am +.\"O (automatic margins), nam (no automatic margins), and rv (reverse video +.\"O display). +.\"O The third subfield contains a long and descriptive name for +.\"O this termcap entry. +2 ÈÖÌÜ (ºÇ¿·¤Î 4.4BSD ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤Ï 1 ÈÖÌÜ) ¤Î¥µ¥Ö¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢ +´Ä¶­ÊÑ¿ô +.B TERM +¤ÇÍѤ¤¤é¤ì¤ë̾¾Î¤¬Æþ¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¾®Ê¸»ú¤·¤«»È¤¨¤Ê¤¤¡£ +ÁªÂò²Äǽ¤Ê¥Ï¡¼¥É¥¦¥§¥¢µ¡Ç½¤Ï¡¢¥Ï¥¤¥Õ¥ó¤ÈÀÜÈø¸ì (suffix) +¤ò̾¾Î¤Î¸å¤ËÄɲ乤뤳¤È¤Ë¤è¤Ã¤Æ¼¨¤¹É¬Íפ¬¤¢¤ë¡£°Ê²¼¤ÎÎã¤ò¸«¤è¡£ +´·½¬Åª¤ÊÀÜÈø¸ì¤Ë¤Ï¡¢w (80 ʸ»ú°Ê¾å¤ÎÉý¤¬¤¢¤ë)¡¢ +am (automatic margins: ¼«Æ°Åª¤Ê¹Ô¤ÎÀÞ¤êÊÖ¤·)¡¢ +nam (non automatic margins: ¼«Æ°Åª¤Ç¤Ê¤¤¹Ô¤ÎÀÞ¤êÊÖ¤·)¡¢ +rv (reverse video display: ȿž¥Ó¥Ç¥ªÉ½¼¨) +¤Ê¤É¤¬¤¢¤ë¡£ +3ÈÖÌܤΥµ¥Ö¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢ +¤³¤Îtermcap¥¨¥ó¥È¥ê¡¼¤ËÂФ¹¤ëŤ¤ÀâÌÀŪ¤Ê̾¾Î¤¬Æþ¤ë¡£ +.LP +.\"O Subsequent fields contain the terminal capabilities; any continued +.\"O capability lines must be indented one tab from the left margin. +¤³¤Î¸å¤Ë³¤¯¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢Ã¼Ëö¤Îµ¡Ç½¤òµ­½Ò¤¹¤ë¡£ +µ¡Ç½¤òµ­½Ò¤¹¤ë¹Ô¤¬·Ñ³¤¹¤ë¾ì¹ç¤Ï¡¢ +º¸Ã¼¤«¤é1¤Ä¤Î¥¿¥Ö¤ò¤ª¤¤¤Æ¥¤¥ó¥Ç¥ó¥È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.LP +.\"O Although there is no defined order, it is suggested to write first +.\"O boolean, then numeric, and then string capabilities, each sorted +.\"O alphabetically without looking at lower or upper spelling. +.\"O Capabilities of similar functions can be written in one line. +½ç½ø¤Ë¤Ä¤¤¤Æ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +Âçʸ»ú¾®Ê¸»ú¤Ï¶èÊ̤»¤º¤Ë¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Ë¤Ê¤é¤Ù¡¢ +»Ï¤á¤Ï¥Ö¡¼¥ëÃͤΡ¢¼¡¤Ï¿ôÃͤΡ¢ºÇ¸å¤Ïʸ»úÎó¤Îµ¡Ç½¤ò½ñ¤¯¤³¤È¤¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +Ʊ¤¸¤è¤¦¤ÊƯ¤­¤ò¤¹¤ëµ¡Ç½¤Ï 1 ¹Ô¤Ë¤Þ¤È¤á¤Æ½ñ¤¯¤ÈÎɤ¤¡£ +.LP +.nf +.\"O Example for: +Îã: +.sp +Head line: vt|vt101|DEC VT 101 terminal in 80 character mode:\e +Head line: Vt|vt101-w|DEC VT 101 terminal in (wide) 132 character mode:\e +Boolean: :bs:\e +Numeric: :co#80:\e +String: :sr=\eE[H:\e +.fi +.\"O .SS "Boolean Capabilities" +.SS "¥Ö¡¼¥ëÃͤǻØÄꤹ¤ëµ¡Ç½" +.nf +.\"O 5i Printer will not echo on screen +5i ¥×¥ê¥ó¥¿¤Ï¥¹¥¯¥ê¡¼¥ó¤Ë¥¨¥³¡¼¤·¤Ê¤¤ +.\"O am Automatic margins which means automatic line wrap +am ¼«Æ°¥Þ¡¼¥¸¥ó¡£¼«Æ°Åª¤Ë¹Ô¤òÀÞ¤êÊÖ¤¹ +.\"O bs Control-H (8 dec.) performs a backspace +bs ¥³¥ó¥È¥í¡¼¥ë H (¥­¡¼¥³¡¼¥É 8) ¤ò¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤È¤·¤Æ°·¤¦ +.\"O bw Backspace on left margin wraps to previous line and right margin +bw º¸Ã¼¤Ç¤Î¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤ò¡¢¾å¤Î¹Ô¤Î±¦Ã¼¤ËÀÞ¤êÊÖ¤¹ +.\"O da Display retained above screen +da ²èÌ̤ξåü¤«¤é³°¤ì¤Æ¤¤¤¿¹Ô¤òɽ¼¨¤¹¤ë (Ä̾ï¤Ï¥Þ¥ë¥Á¥Ú¡¼¥¸Ã¼Ëö¤Ç) +.\"O db Display retained below screen +db ²èÌ̤β¼Ã¼¤«¤é³°¤ì¤Æ¤¤¤¿¹Ô¤òɽ¼¨¤¹¤ë (Ä̾ï¤Ï¥Þ¥ë¥Á¥Ú¡¼¥¸Ã¼Ëö¤Ç) +.\"O eo A space erases all characters at cursor position +eo ¶õÇòʸ»ú¤Ï¥«¡¼¥½¥ë°ÌÃÖ¤ÎÁ´¤Æ¤Îʸ»ú¤ò¾Ã¤¹ +.\"O es Escape sequences and special characters work in status line +es ¥¹¥Æ¡¼¥¿¥¹¹Ô¾å¤Î¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤äÆüìʸ»ú¤ÏÍ­¸ú¤ËƯ¤¯ +.\"O gn Generic device +gn °ìÈÌŪ¤Ê¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë +.\"O hc This is a hardcopy terminal +hc ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ç¤¢¤ë +.\"O HC The cursor is hard to see when not on bottom line +HC ºÇ²¼¹Ô¤Ë¤Ê¤¤¥«¡¼¥½¥ë¤Ï¸«¤Å¤é¤¤ +.\"O hs Has a status line +hs ¥¹¥Æ¡¼¥¿¥¹¹Ô¤¬¤¢¤ë +.\"O hz Hazeltine bug, the terminal can not print tilde characters +hz ¥Á¥ë¥Àʸ»ú¤¬É½¼¨¤Ç¤­¤Ê¤¤Ã¼Ëö¤Ç¤¢¤ë (Hazeltine üËö¤Î¥Ð¥°) +.\"O in Terminal inserts null bytes, not spaces, to fill whitespace +in ¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤òËä¤á¤ë¤Î¤Ë¡¢¥¹¥Ú¡¼¥¹¤Ç¤Ï¤Ê¤¯ NULL ¥Ð¥¤¥È¤òÁÞÆþ¤¹¤ëüËö¤Ç¤¢¤ë +.\"O km Terminal has a meta key +km üËö¤Ë¤Ï¥á¥¿¥­¡¼¤¬¤¢¤ë +.\"O mi Cursor movement works in insert mode +mi ÁÞÆþ¥â¡¼¥É¤Ç¤â¥«¡¼¥½¥ë°ÜÆ°¤¬¤Ç¤­¤ë +.\"O ms Cursor movement works in standout/underline mode +ms ¶¯Ä´/²¼Àþ¥â¡¼¥É¤Ç¤â¥«¡¼¥½¥ë°ÜÆ°¤¬¤Ç¤­¤ë +.\"O NP No pad character +NP ¥Ñ¥Ç¥£¥ó¥°Ê¸»ú¤¬¤Ê¤¤ +.\"O NR ti does not reverse te +NR ti ¤Ï te ¤òȿž¤·¤Ê¤¤ +.\"O nx No padding, must use XON/XOFF +nx ¥Ñ¥Ç¥£¥ó¥°¤Ç¤Ï¤Ê¤¯¡¢XON/XOFF ¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.\"O os Terminal can overstrike +os ½Å¤ÍÂǤÁ¤¬²Äǽ¤ÊüËö¤Ç¤¢¤ë +.\"O ul Terminal underlines although it can not overstrike +ul ½Å¤ÍÂǤÁ¤Ï¤Ç¤­¤Ê¤¤¤¬¡¢²¼Àþɽ¼¨¤Î¤Ç¤­¤ëüËö¤Ç¤¢¤ë +.\"O xb Beehive glitch, f1 sends ESCAPE, f2 sends \fB^C\fP +xb f1 ¤Ï¥¨¥¹¥±¡¼¥×¤òÁ÷¿®¤·¡¢f2 ¤Ï \fB^C\fP ¤òÁ÷¿®¤¹¤ë (Beehive üËö¤ÎÉÔ¶ñ¹ç) +.\"O xn Newline/wraparound glitch +xn ²þ¹Ô/ÀÞ¤êÊÖ¤·¤ËÉÔ¶ñ¹ç¤¬¤¢¤ë +.\"O xo Terminal uses xon/xoff protocol +xo üËö¤Ï xon/xoff ¥×¥í¥È¥³¥ë¤òÍѤ¤¤ë +.\"O xs Text typed over standout text will be displayed in standout +xs ¶¯Ä´Ê¸»ú¤Î¾å¤Ë½ÐÎϤµ¤ì¤¿Ê¸»ú¤Ï¶¯Ä´Ê¸»ú¤È¤·¤Æɽ¼¨¤µ¤ì¤ë +.\"O xt Teleray glitch, destructive tabs and odd standout mode +xt Ç˲õŪ¤Ê¥¿¥Ö¤ÈÃæÅÓȾü¤Ê¶¯Ä´¥â¡¼¥É (Teleray üËö¤ÎÉÔ¶ñ¹ç) +.fi +.\"O .SS "Numeric Capabilities" +.SS "¿ôÃͤǻØÄꤹ¤ëµ¡Ç½" +.nf +.\"O co Number of columns +co üËö¤Î¹Ô¿ô +.\"O dB Delay in milliseconds for backspace on hardcopy terminals +dB ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ë¤ª¤¤¤Æ¡¢¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤ËɬÍפÊÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì) +.\"O dC Delay in milliseconds for carriage return on hardcopy terminals +dC ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ë¤ª¤¤¤Æ¡¢Éüµ¢¤ËɬÍפÊÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì) +.\"O dF Delay in milliseconds for form feed on hardcopy terminals +dF ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ë¤ª¤¤¤Æ¡¢ÊÇÁ÷¤ê¤ËɬÍפÊÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì) +.\"O dN Delay in milliseconds for new line on hardcopy terminals +dN ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ë¤ª¤¤¤Æ¡¢²þ¹Ô¤ËɬÍפÊÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì) +.\"O dT Delay in milliseconds for tabulator stop on hardcopy terminals +dT ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ë¤ª¤¤¤Æ¡¢¥¿¥Ö¥¹¥È¥Ã¥×¤ËɬÍפÊÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì) +.\"O dV Delay in milliseconds for vertical tabulator stop on +.\"O hardcopy terminals +dV ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ë¤ª¤¤¤Æ¡¢¿âľ¥¿¥Ö¤ËɬÍפÊÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì) +.\"O it Difference between tab positions +it ¥¿¥Ö°ÌÃÖ´Ö¤Îʸ»ú¿ô +.\"O lh Height of soft labels +lh ¥½¥Õ¥È¥é¥Ù¥ë¤Î¹â¤µ +.\"O lm Lines of memory +lm ²èÌÌ¥á¥â¥ê¤Ë¼ýÍƤǤ­¤ë¹Ô¿ô +.\"O lw Width of soft labels +lw ¥½¥Õ¥È¥é¥Ù¥ë¤ÎÉý +.\"O li Number of lines +li ¹Ô¿ô +.\"O Nl Number of soft labels +Nl ¥½¥Õ¥È¥é¥Ù¥ë¤Î¿ô +.\"O pb Lowest baud rate which needs padding +pb ¥Ñ¥Ç¥£¥ó¥°¤¬É¬ÍפȤʤëºÇÄã¤Î¥Ü¡¼¥ì¡¼¥È +.\"O sg Standout glitch +sg ¶¯Ä´É½¼¨¤ÎÉÔ¶ñ¹ç (¶¯Ä´É½¼¨¤ËÀÚÂؤ¨¤¿¤È¤­¤Ëɽ¼¨¤µ¤ì¤ë¥¹¥Ú¡¼¥¹¤Î¿ô) +.\"O ug Underline glitch +ug ²¼Àþɽ¼¨¤ÎÉÔ¶ñ¹ç (¶¯Ä´É½¼¨¤ËÀÚÂؤ¨¤¿¤È¤­¤Ëɽ¼¨¤µ¤ì¤ë¥¹¥Ú¡¼¥¹¤Î¿ô) +.\"O vt virtual terminal number +vt ²¾ÁÛüËöÈÖ¹æ +.\"O ws Width of status line if different from screen width +ws ¥¹¥Æ¡¼¥¿¥¹¹Ô¤ÎÉý (²èÌÌÉý¤È°Û¤Ê¤ë¾ì¹ç) +.fi +.\"O .SS "String Capabilities" +.SS "ʸ»úÎó¤Ç»ØÄꤹ¤ëµ¡Ç½" +.nf +.\"O !1 shifted save key +!1 ¥·¥Õ¥È¾õÂ֤Πsave ¥­¡¼ +.\"O !2 shifted suspend key +!2 ¥·¥Õ¥È¾õÂ֤Πsuspend ¥­¡¼ +.\"O !3 shifted undo key +!3 ¥·¥Õ¥È¾õÂ֤Πundo ¥­¡¼ +.\"O #1 shifted help key +#1 ¥·¥Õ¥È¾õÂ֤Πhelp ¥­¡¼ +.\"O #2 shifted home key +#2 ¥·¥Õ¥È¾õÂ֤Πhome ¥­¡¼ +.\"O #3 shifted input key +#3 ¥·¥Õ¥È¾õÂ֤Πinput ¥­¡¼ +.\"O #4 shifted cursor left key +#4 ¥·¥Õ¥È¾õÂ֤κ¸¥«¡¼¥½¥ë¥­¡¼ +.\"O %0 redo key +%0 redo ¥­¡¼ +.\"O %1 help key +%1 help ¥­¡¼ +.\"O %2 mark key +%2 mark¥­¡¼ +.\"O %3 message key +%3 message ¥­¡¼ +.\"O %4 move key +%4 move ¥­¡¼ +.\"O %5 next-object key +%5 next-object ¥­¡¼ +.\"O %6 open key +%6 open ¥­¡¼ +.\"O %7 options key +%7 options ¥­¡¼ +.\"O %8 previous-object key +%8 previous-object ¥­¡¼ +.\"O %9 print key +%9 print ¥­¡¼ +.\"O %a shifted message key +%a ¥·¥Õ¥È¾õÂ֤Πmessage ¥­¡¼ +.\"O %b shifted move key +%b ¥·¥Õ¥È¾õÂ֤Πmove ¥­¡¼ +.\"O %c shifted next key +%c ¥·¥Õ¥È¾õÂ֤Πnext ¥­¡¼ +.\"O %d shifted options key +%d ¥·¥Õ¥È¾õÂ֤Πoptions ¥­¡¼ +.\"O %e shifted previous key +%e ¥·¥Õ¥È¾õÂ֤Πprevious ¥­¡¼ +.\"O %f shifted print key +%f ¥·¥Õ¥È¾õÂ֤Πprint ¥­¡¼ +.\"O %g shifted redo key +%g ¥·¥Õ¥È¾õÂ֤Πredo ¥­¡¼ +.\"O %h shifted replace key +%h ¥·¥Õ¥È¾õÂ֤Πreplace ¥­¡¼ +.\"O %i shifted cursor right key +%i ¥·¥Õ¥È¾õÂ֤ᦥ«¡¼¥½¥ë¥­¡¼ +.\"O %j shifted resume key +%j ¥·¥Õ¥È¾õÂ֤Πresume ¥­¡¼ +.\"O &0 shifted cancel key +&0 ¥·¥Õ¥È¾õÂ֤Πcancel ¥­¡¼ +.\"O &1 reference key +&1 reference ¥­¡¼ +.\"O &2 refresh key +&2 refresh ¥­¡¼ +.\"O &3 replace key +&3 replace ¥­¡¼ +.\"O &4 restart key +&4 restart ¥­¡¼ +.\"O &5 resume key +&5 resume ¥­¡¼ +.\"O &6 save key +&6 save ¥­¡¼ +.\"O &7 suspend key +&7 suspend ¥­¡¼ +.\"O &8 undo key +&8 undo ¥­¡¼ +.\"O &9 shifted begin key +&9 ¥·¥Õ¥È¾õÂ֤Πbegin ¥­¡¼ +.\"O *0 shifted find key +*0 ¥·¥Õ¥È¾õÂ֤Πfind ¥­¡¼ +.\"O *1 shifted command key +*1 ¥·¥Õ¥È¾õÂ֤Πcommand ¥­¡¼ +.\"O *2 shifted copy key +*2 ¥·¥Õ¥È¾õÂ֤Πcopy ¥­¡¼ +.\"O *3 shifted create key +*3 ¥·¥Õ¥È¾õÂ֤Πcreate ¥­¡¼ +.\"O *4 shifted delete character +*4 ¥·¥Õ¥È¾õÂ֤Πdelete ¥­¡¼ +.\"O *5 shifted delete line +*5 ¥·¥Õ¥È¾õÂ֤Πdelete line ¥­¡¼ +.\"O *6 select key +*6 select ¥­¡¼ +.\"O *7 shifted end key +*7 ¥·¥Õ¥È¾õÂ֤Πend ¥­¡¼ +.\"O *8 shifted clear line key +*8 ¥·¥Õ¥È¾õÂ֤Πclear line ¥­¡¼ +.\"O *9 shifted exit key +*9 ¥·¥Õ¥È¾õÂ֤Πexit ¥­¡¼ +.\"O @0 find key +@0 find ¥­¡¼ +.\"O @1 begin key +@1 begin ¥­¡¼ +.\"O @2 cancel key +@2 cancel ¥­¡¼ +.\"O @3 close key +@3 close ¥­¡¼ +.\"O @4 command key +@4 command ¥­¡¼ +.\"O @5 copy key +@5 copy ¥­¡¼ +.\"O @6 create key +@6 create ¥­¡¼ +.\"O @7 end key +@7 end ¥­¡¼ +.\"O @8 enter/send key +@8 enter/send ¥­¡¼ +.\"O @9 exit key +@9 exit ¥­¡¼ +.\"O al Insert one line +al 1 ¹ÔÁÞÆþ¤¹¤ë +.\"O AL Insert %1 lines +AL %1 ¹ÔÁÞÆþ¤¹¤ë +.\"O ac Pairs of block graphic characters to map alternate character set +ac ¿Þ·Áʸ»ú¤Î¥Ú¥¢¤Î½¸¹ç¡£ÂåÂØʸ»ú¥»¥Ã¥È¤Ë¥Þ¥Ã¥×¤¹¤ë¤¿¤á¤Î¤â¤Î +.\"O ae End alternative character set +ae ÂåÂØʸ»ú¥»¥Ã¥È¤Î½ª¤ê +.\"O as Start alternative character set for block graphic characters +as ¿Þ·Áʸ»ú½¸¹ç¤ËÂФ¹¤ë¡¢ÂåÂØʸ»ú¥»¥Ã¥È¤Î³«»Ï +.\"O bc Backspace, if not \fB^H\fP +bc \fB^H\fP ¤¬¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤Ç¤Ê¤¤¾ì¹ç¤Î¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹ +.\"O bl Audio bell +bl (²»À¼¤Î) ¥Ù¥ë¤òÌĤ餹 +.\"O bt Move to previous tab stop +bt Á°¤Î¥¿¥Ö¥¹¥È¥Ã¥×¤Ø°ÜÆ° +.\"O cb Clear from beginning of line to cursor +cb ¹ÔƬ¤«¤é¥«¡¼¥½¥ë°ÌÃ֤ޤǤΥ¯¥ê¥¢ +.\"O cc Dummy command character +cc ¥À¥ß¡¼¥³¥Þ¥ó¥Éʸ»ú +.\"O cd Clear to end of screen +cd ²èÌ̤κǸå¤Þ¤Ç¤ò¥¯¥ê¥¢ +.\"O ce Clear to end of line +ce ¹Ô¤ÎºÇ¸å¤Þ¤Ç¤ò¥¯¥ê¥¢ +.\"O ch Move cursor horizontally only to column %1 +ch ¥«¡¼¥½¥ë¤ò¿åÊ¿Êý¸þ¤Ë¤À¤±°ÜÆ°¤·¡¢ %1 ·å¤Î°ÌÃ֤ˤ¹¤ë +.\"O cl Clear screen and cursor home +cl ²èÌ̤ò¾Ãµî¤·¡¢¥«¡¼¥½¥ë¤ò¥Û¡¼¥à¥Ý¥¸¥·¥ç¥ó¤Ø +.\"O cm Cursor move to row %1 and column %2 (on screen) +cm ²èÌ̾å¤Î %1 ¹Ô¡¢ %2 ·å¤Ø¥«¡¼¥½¥ë¤ò°ÜÆ° +.\"O CM Move cursor to row %1 and column %2 (in memory) +CM ¥á¥â¥ê¾å¤Î %1 ¹Ô¡¢ %2 ·å¤Ø¥«¡¼¥½¥ë¤ò°ÜÆ° +.\"O cr Carriage return +cr Éüµ¢ +.\"O cs Scroll region from line %1 to %2 +cs %1 ¹ÔÌܤ«¤é %2 ¹ÔÌܤޤǤÎÈϰϤò¥¹¥¯¥í¡¼¥ë¤¹¤ë +.\"O ct Clear tabs +ct ¥¿¥Ö¤Î¾Ãµî +.\"O cv Move cursor vertically only to line %1 +cv ¥«¡¼¥½¥ë¤ò¿âľÊý¸þ¤Ë¤À¤±°ÜÆ°¤·¡¢ %1 ¹Ô¤Î°ÌÃ֤ˤ¹¤ë +.\"O dc Delete one character +dc °ìʸ»úºï½ü¤¹¤ë +.\"O DC Delete %1 characters +DC %1 ʸ»úºï½ü¤¹¤ë +.\"O dl Delete one line +dl °ì¹Ôºï½ü¤¹¤ë +.\"O DL Delete %1 lines +DL %1 ¹Ôºï½ü¤¹¤ë +.\"O dm Begin delete mode +dm delete ¥â¡¼¥É³«»Ï +.\"O do Cursor down one line +do ¥«¡¼¥½¥ë¤ò°ì¹Ô²¼¤²¤ë +.\"O DO Cursor down #1 lines +DO ¥«¡¼¥½¥ë¤ò #1 ¹Ô²¼¤²¤ë +.\"O ds Disable status line +ds ¥¹¥Æ¡¼¥¿¥¹¹Ô¤ò̵¸ú¤Ë¤¹¤ë +.\"O eA Enable alternate character set +eA ÂåÂØʸ»ú½¸¹ç¤òÍ­¸ú¤Ë¤¹¤ë +.\"O ec Erase %1 characters starting at cursor +ec ¥«¡¼¥½¥ë°ÌÃÖ¤«¤é %1 ʸ»ú¾Ãµî¤¹¤ë +.\"O ed End delete mode +ed delete ¥â¡¼¥É½ªÎ» +.\"O ei End insert mode +ei intert ¥â¡¼¥É½ªÎ» +.\"O ff Formfeed character on hardcopy terminals +ff ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ç¤ÎÊÇÁ÷¤êʸ»ú +.\"O fs Return character to its position before going to status line +fs ¥¹¥Æ¡¼¥¿¥¹¹Ô¤Ë°ÜÆ°¤¹¤ëÁ°¤Î°ÌÃÖ¤ØÉüµ¢¤¹¤ëʸ»ú +.\"O F1 The string sent by function key f11 +.\"O F2 The string sent by function key f12 +.\"O F3 The string sent by function key f13 +F1 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f11 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +F2 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f12 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +F3 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f13 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +\&... \&... +.\"O F9 The string sent by function key f19 +.\"O FA The string sent by function key f20 +.\"O FB The string sent by function key f21 +F9 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f19 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +FA ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f20 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +FB ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f21 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +\&... \&... +.\"O FZ The string sent by function key f45 +.\"O Fa The string sent by function key f46 +.\"O Fb The string sent by function key f47 +FZ ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f45 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +Fa ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f46 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +Fb ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f47 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +\&... \&... +.\"O Fr The string sent by function key f63 +Fr ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f63 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +.\"O hd Move cursor a half line down +hd ¥«¡¼¥½¥ë¤ò°ì¹Ô¤ÎȾʬ¤À¤±²¼¤Ë°ÜÆ° +.\"O ho Cursor home +ho ¥«¡¼¥½¥ë¤ò¥Û¡¼¥à¥Ý¥¸¥·¥ç¥ó¤Ë°ÜÆ° +.\"O hu Move cursor a half line up +hu ¥«¡¼¥½¥ë¤ò°ì¹Ô¤ÎȾʬ¤À¤±¾å¤Ë°ÜÆ° +.\"O i1 Initialization string 1 at login +i1 ¥í¥°¥¤¥ó»þ¤Î½é´ü²½Ê¸»úÎó 1 +.\"O i3 Initialization string 3 at login +i3 ¥í¥°¥¤¥ó»þ¤Î½é´ü²½Ê¸»úÎó 3 +.\"O is Initialization string 2 at login +is ¥í¥°¥¤¥ó»þ¤Î½é´ü²½Ê¸»úÎó 2 +.\"O ic Insert one character +ic °ìʸ»úÁÞÆþ +.\"O IC Insert %1 characters +IC %1 ʸ»úÁÞÆþ +.\"O if Initialization file +if ½é´ü²½¥Õ¥¡¥¤¥ë +.\"O im Begin insert mode +im insert ¥â¡¼¥É³«»Ï +.\"O ip Insert pad time and needed special characters after insert +ip ÁÞÆþ¸å¤Î¥Ñ¥Ç¥£¥ó¥°¤ËɬÍפʻþ´Ö¤ÈÆüìʸ»ú +.\"O iP Initialization program +iP ½é´ü²½¥×¥í¥°¥é¥à +.\"O K1 upper left key on keypad +K1 ¥­¡¼¥Ñ¥Ã¥É¤Îº¸¾å¥­¡¼ +.\"O K2 center key on keypad +K2 ¥­¡¼¥Ñ¥Ã¥É¤ÎÃæ±û¥­¡¼ +.\"O K3 upper right key on keypad +K3 ¥­¡¼¥Ñ¥Ã¥É¤Î±¦¾å¥­¡¼ +.\"O K4 bottom left key on keypad +K4 ¥­¡¼¥Ñ¥Ã¥É¤Îº¸²¼¥­¡¼ +.\"O K5 bottom right key on keypad +K5 ¥­¡¼¥Ñ¥Ã¥É¤Î±¦²¼¥­¡¼ +.\"O k0 Function key 0 +k0 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 0 +.\"O k1 Function key 1 +k1 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 1 +.\"O k2 Function key 2 +k2 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 2 +.\"O k3 Function key 3 +k3 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 3 +.\"O k4 Function key 4 +k4 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 4 +.\"O k5 Function key 5 +k5 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 5 +.\"O k6 Function key 6 +k6 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 6 +.\"O k7 Function key 7 +k7 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 7 +.\"O k8 Function key 8 +k8 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 8 +.\"O k9 Function key 9 +k9 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 9 +.\"O k; Function key 10 +k; ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 10 +.\"O ka Clear all tabs key +ka clea all tabs ¥­¡¼ +.\"O kA Insert line key +kA insert line ¥­¡¼ +.\"O kb Backspace key +kb ¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¥­¡¼ +.\"O kB Back tab stop +kB back tab ¥­¡¼ +.\"O kC Clear screen key +kC clear screen ¥­¡¼ +.\"O kd Cursor down key +kd ²¼¥«¡¼¥½¥ë¥­¡¼ +.\"O kD Key for delete character under cursor +kD ¥«¡¼¥½¥ë°ÌÃÖ¤Îʸ»ú¤ò¾Ã¤¹¥­¡¼ +.\"O ke turn keypad off +ke ¥­¡¼¥Ñ¥Ã¥É¤ò¥ª¥Õ¤Ë¤¹¤ë +.\"O kE Key for clear to end of line +kE ¹ÔËö¤Þ¤Ç¤ò¥¯¥ê¥¢¤¹¤ë¥­¡¼ +.\"O kF Key for scrolling forward/down +kF Á°Êý¸þ/²¼Êý¸þ¤Ø¥¹¥¯¥í¡¼¥ë¤¹¤ë¥­¡¼ +.\"O kh Cursor home key +kh home ¥­¡¼ +.\"O kH Cursor hown down key +kH cursor hown down ¥­¡¼ +.\"O kI Insert character/Insert mode key +kI ʸ»úÁÞÆþ¥­¡¼/insert ¥â¡¼¥É¥­¡¼ +.\"O kl Cursor left key +kl º¸¥«¡¼¥½¥ë¥­¡¼ +.\"O kL Key for delete line +kL ¹Ô¤òºï½ü¤¹¤ë¥­¡¼ +.\"O kM Key for exit insert mode +kM insert ¥â¡¼¥É¤ò½ªÎ»¤¹¤ë¥­¡¼ +.\"O kN Key for next page +kN ¼¡¤Î¥Ú¡¼¥¸¤Ø°ÜÆ°¤¹¤ë¥­¡¼ +.\"O kP Key for previous page +kP Á°¤Î¥Ú¡¼¥¸¤Ø°ÜÆ°¤¹¤ë¥­¡¼ +.\"O kr Cursor right key +kr ±¦¥«¡¼¥½¥ë¥­¡¼ +.\"O kR Key for scrolling backward/up +kR ¸å¤íÊý¸þ/¾åÊý¸þ¤Ë¥¹¥¯¥í¡¼¥ë¤¹¤ë¥­¡¼ +.\"O ks Turn keypad on +ke ¥­¡¼¥Ñ¥Ã¥É¤ò¥ª¥ó¤Ë¤¹¤ë +.\"O kS Clear to end of screen key +kS ²èÌ̺Ǹå¤Þ¤Ç¤ò¥¯¥ê¥¢¤¹¤ë¥­¡¼ +.\"O kt Clear this tab key +kt ¥¿¥Ö¥¯¥ê¥¢¥­¡¼ +.\"O kT Set tab here key +kT ¥¿¥Ö¥¹¥È¥Ã¥×ÀßÄꥭ¡¼ +.\"O ku Cursor up key +ku ¾å¥«¡¼¥½¥ë¥­¡¼ +.\"O l0 Label of zeroth function key, if not f0 +.\"O l1 Label of first function key, if not f1 +.\"O l2 Label of first function key, if not f2 +l0 0 ÈÖÌܤΥե¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Î¥é¥Ù¥ë (f0 ¤Ç¤Ê¤¤¾ì¹ç) +l1 1 ÈÖÌܤΥե¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Î¥é¥Ù¥ë (f1 ¤Ç¤Ê¤¤¾ì¹ç) +l2 2 ÈÖÌܤΥե¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Î¥é¥Ù¥ë (f2 ¤Ç¤Ê¤¤¾ì¹ç) +\&... \&... +.\"O la Label of tenth function key, if not f10 +la 10 ÈÖÌܤΥե¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Î¥é¥Ù¥ë (f10 ¤Ç¤Ê¤¤¾ì¹ç) +.\"O le Cursor left one character +le ¥«¡¼¥½¥ë¤òº¸¤Ø°ìʸ»úʬ°ÜÆ°¤¹¤ë +.\"O ll Move cursor to lower left corner +ll ¥«¡¼¥½¥ë¤òº¸²¼¶ù¤Ë°ÜÆ°¤¹¤ë +.\"O LE Cursor left %1 characters +LE ¥«¡¼¥½¥ë¤òº¸ %1 ʸ»úʬ°ÜÆ°¤¹¤ë +.\"O LF Turn soft labels off +LF ¥½¥Õ¥È¥é¥Ù¥ë¤ò¥ª¥Õ¤Ë¤¹¤ë +.\"O LO Turn soft labels on +LO ¥½¥Õ¥È¥é¥Ù¥ë¤ò¥ª¥ó¤Ë¤¹¤ë +.\"O mb Start blinking +mb ÅÀÌdz«»Ï +.\"O MC Clear soft margins +MC ¥½¥Õ¥È¥Þ¡¼¥¸¥ó¤ò¥¯¥ê¥¢ +.\"O md Start bold mode +md bold ¥â¡¼¥É³«»Ï +.\"O me End all mode like so, us, mb, md and mr +me so, us, mb, md, mr ¤Ê¤É¤Î¥â¡¼¥ÉÁ´¤Æ¤ò½ªÎ»¤¹¤ë +.\"O mh Start half bright mode +mh Ⱦµ±Å٥⡼¥É³«»Ï +.\"O mk Dark mode (Characters invisible) +mk ¥À¡¼¥¯¥â¡¼¥É (ʸ»ú¤Ï¸«¤¨¤Ê¤¯¤Ê¤ë) +.\"O ML Set left soft margin +ML º¸Â¦¤Î¥½¥Õ¥È¥Þ¡¼¥¸¥ó¤òÀßÄê +.\"O mm Put terminal in meta mode +mm üËö¤ò¥á¥¿¥â¡¼¥É¤ËÀßÄꤹ¤ë +.\"O mo Put terminal out of meta mode +mo üËö¤ò¥á¥¿¥â¡¼¥É¤Ç¤Ê¤¯¤¹¤ë +.\"O mp Turn on protected attribute +mp °À­Êݸî¥â¡¼¥É¤ò¥ª¥ó¤Ë¤¹¤ë +.\"O mr Start reverse mode +mr ȿž¥â¡¼¥É³«»Ï +.\"O MR Set right soft margin +MR ±¦Ã¼¤Î¥½¥Õ¥È¥Þ¡¼¥¸¥ó¤òÀßÄê +.\"O nd Cursor right one character +nd ¥«¡¼¥½¥ë¤ò±¦¤Ë°ìʸ»úʬ°ÜÆ° +.\"O nw Carriage return command +nw Éüµ¢¥³¥Þ¥ó¥É +.\"O pc Padding character +pc ¥Ñ¥Ç¥£¥ó¥°Ê¸»ú +.\"O pf Turn printer off +pf ¥×¥ê¥ó¥¿¤ò¥ª¥Õ¤Ë¤¹¤ë +.\"O pk Program key %1 to send string %2 as if typed by user +pk ¥æ¡¼¥¶¤¬ÆþÎϤ·¤¿¤È¤­¤Ëʸ»úÎó %2 ¤òÁ÷½Ð¤¹¤ë¥×¥í¥°¥é¥à¥­¡¼ %1 +.\"O pl Program key %1 to execute string %2 in local mode +pl ¥í¡¼¥«¥ë¥â¡¼¥É¤Çʸ»úÎó %2 ¤ò¼Â¹Ô¤¹¤ë¥×¥í¥°¥é¥à¥­¡¼ %1 +.\"O pn Program soft label %1 to show string %2 +pn ʸ»úÎó %2 ¤òɽ¼¨¤¹¤ë¤¿¤á¤Î¥×¥í¥°¥é¥à¥½¥Õ¥È¥é¥Ù¥ë %1 +.\"O po Turn the printer on +po ¥×¥ê¥ó¥¿¤ò¥ª¥ó¤Ë¤¹¤ë +.\"O pO Turn the printer on for %1 (<256) bytes +pO %1 (<256) ¥Ð¥¤¥È¤Î´Ö¥×¥ê¥ó¥¿¤ò¥ª¥ó¤Ë¤¹¤ë +.\"O ps Print screen contents on printer +ps ²èÌ̾å¤ÎÆâÍƤò¥×¥ê¥ó¥¿¤Ë°õºþ¤¹¤ë +.\"O px Program key %1 to send string %2 to computer +px ʸ»úÎó %2 ¤ò¥³¥ó¥Ô¥å¡¼¥¿¤ËÁ÷½Ð¤¹¤ë¥×¥í¥°¥é¥à¥­¡¼ %1 +.\"O r1 Reset string 1 to set terminal to sane modes +.\"O r2 Reset string 2 to set terminal to sane modes +.\"O r3 Reset string 3 to set terminal to sane modes +r1 üËö¤òÀµ¾ï¤Ê¥â¡¼¥É¤ËÀßÄꤹ¤ë¥ê¥»¥Ã¥Èʸ»úÎó 1 +r2 üËö¤òÀµ¾ï¤Ê¥â¡¼¥É¤ËÀßÄꤹ¤ë¥ê¥»¥Ã¥Èʸ»úÎó 2 +r3 üËö¤òÀµ¾ï¤Ê¥â¡¼¥É¤ËÀßÄꤹ¤ë¥ê¥»¥Ã¥Èʸ»úÎó 3 +.\"O RA disable automatic margins +RA ¼«Æ°ÀÞ¤êÊÖ¤·¤ò̵¸ú¤Ë¤¹¤ë +.\"O rc Restore saved cursor position +rc Êݸ¤·¤Æ¤ª¤¤¤¿¥«¡¼¥½¥ë°ÌÃÖ¤ËÉüµ¢¤¹¤ë +.\"O rf Reset string filename +rf ¥ê¥»¥Ã¥Èʸ»úÎó¤ÎÆþ¤Ã¤¿¥Õ¥¡¥¤¥ë̾ +.\"O RF Request for input from terminal +RF üËö¤«¤é¤ÎÆþÎÏÍ×µá +.\"O RI Cursor right %1 characters +RI ¥«¡¼¥½¥ë¤ò±¦¤Ø %1 ʸ»úʬ°ÜÆ°¤¹¤ë +.\"O rp Repeat character %1 for %2 times +rp ʸ»ú %1 ¤ò %2 ²óʬ·«¤êÊÖ¤¹ +.\"O rP Padding after character sent in replace mode +rP ÃÖ´¹¥â¡¼¥É¤Ë¤ª¤¤¤Æ¡¢Ê¸»ú¤òÁ÷½Ð¤·¤¿¸å¤Ë¹Ô¤¦¥Ñ¥Ç¥£¥ó¥° +.\"O rs Reset string +rs ¥ê¥»¥Ã¥Èʸ»úÎó +.\"O RX Turn off XON/XOFF flow control +RX XON/XOFF ¥Õ¥í¡¼À©¸æ¤ò¥ª¥Õ¤Ë¤¹¤ë +.\"O sa Set %1 %2 %3 %4 %5 %6 %7 %8 %9 attributes +sa °À­ %1 %2 %3 %4 %5 %6 %7 %8 %9 ¤òÀßÄê +.\"O SA enable automatic margins +SA ¼«Æ°ÀÞ¤êÊÖ¤·¤òÍ­¸ú¤Ë¤¹¤ë +.\"O sc Save cursor position +sc ¥«¡¼¥½¥ë°ÌÃÖ¤òÊݸ¤¹¤ë +.\"O se End standout mode +se ¶¯Ä´¥â¡¼¥É½ªÎ» +.\"O sf Normal scroll one line +sf ½çÊý¸þ¤Î 1 ¹Ô¥¹¥¯¥í¡¼¥ë +.\"O SF Normal scroll %1 lines +SF ½çÊý¸þ¤Î %1 ¹Ô¥¹¥¯¥í¡¼¥ë +.\"O so Start standout mode +so ¶¯Ä´¥â¡¼¥É³«»Ï +.\"O sr Reverse scroll +sr µÕ¥¹¥¯¥í¡¼¥ë +.\"O SR scroll back %1 lines +SR %1 ¹ÔʬµÕ¥¹¥¯¥í¡¼¥ë¤¹¤ë +.\"O st Set tabulator stop in all rows at current column +st Á´¤Æ¤Î¹Ô¤Ë¤ª¤¤¤Æ¡¢¸½ºß¤Î·å°ÌÃÖ¤ò¥¿¥Ö¥¹¥È¥Ã¥×¤ËÀßÄꤹ¤ë +.\"O SX Turn on XON/XOFF flow control +SX XON/XOFF ¥Õ¥í¡¼À©¸æ¤ò¥ª¥ó¤Ë¤¹¤ë +.\"O ta move to next hardware tab +ta ¼¡¤Î¥Ï¡¼¥É¥¦¥§¥¢¥¿¥Ö°ÌÃ֤ذÜÆ° +.\"O tc Read in terminal description from another entry +tc ¾¤Î¥¨¥ó¥È¥ê¤«¤éüËö¤ÎÀâÌÀ¤òÆɤà¹þ¤à +.\"O te End program that uses cursor motion +te ¥«¡¼¥½¥ë°ÜÆ°¤òÍѤ¤¤ë¥×¥í¥°¥é¥à¤Î½ªÎ» +.\"O ti Begin program that uses cursor motion +ti ¥«¡¼¥½¥ë°ÜÆ°¤òÍѤ¤¤ë¥×¥í¥°¥é¥à¤Î³«»Ï +.\"O ts Move cursor to column %1 of status line +ts ¥¹¥Æ¡¼¥¿¥¹¹Ô¤Î¥«¡¼¥½¥ë¤ò %1 ·å¤Ø°ÜÆ° +.\"O uc Underline character under cursor and move cursor right +uc ¥«¡¼¥½¥ë°ÌÃÖ¤Îʸ»ú¤Ë²¼Àþ¤ò¤Ä¤±¡¢±¦¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ° +.\"O ue End underlining +ue ²¼Àþ¥â¡¼¥É½ªÎ» +.\"O up Cursor up one line +up ¥«¡¼¥½¥ë¤ò 1 ¹Ôʬ¾å¤Ë°ÜÆ° +.\"O UP Cursor up %1 lines +UP ¥«¡¼¥½¥ë¤ò %1 ¹Ôʬ¾å¤Ë°ÜÆ° +.\"O us Start underlining +us ²¼Àþ¥â¡¼¥É³«»Ï +.\"O vb Visible bell +vb ¥Ó¥¸¥å¥¢¥ë¥Ù¥ë +.\"O ve Normal cursor visible +ve ¥«¡¼¥½¥ë¤òÄ̾ï¤ÎÌÀ¤ë¤µ¤Ë¤¹¤ë +.\"O vi Cursor invisible +vi ¥«¡¼¥½¥ë¤ò¸«¤¨¤Ê¤¯¤¹¤ë +.\"O vs Standout cursor +vs ¶¯Ä´¥«¡¼¥½¥ë +.\"O wi Set window from line %1 to %2 and column %3 to %4 +wi ¥¦¥£¥ó¥É¥¦Îΰè¤ò %1¡Á%2 ¹Ô¡¢%3¡Á%4 ·å¤ËÀßÄê +.\"O XF XOFF character if not \fB^S\fP +XF XOFF À©¸æʸ»ú (\fB^S\fP ¤Ç¤Ê¤¤¾ì¹ç) +.fi +.LP +.\"O There are several ways of defining the control codes for string capabilities: +ʸ»úÎóµ¡Ç½¤ÎÀ©¸æ¥³¡¼¥É¤òÄêµÁ¤¹¤ë¤Ë¤Ï¡¢¤¤¤¯¤Ä¤«¤ÎÊýË¡¤¬¤¢¤ë¡£ +.LP +.\"O Every normal character represents itself, +.\"O except \(aq^\(aq, \(aq\e\(aq, and \(aq%\(aq. +\&\(aq^\(aq, \(aq\e\(aq, \(aq%\(aq ¤ò½ü¤¯Á´¤Æ¤ÎÄ̾ï¤Îʸ»ú¤Ï¡¢¤½¤ì¼«¿È¤òɽ¤¹¡£ +.LP +.\"O A \fB^x\fP means Control-x. +.\"O Control-A equals 1 decimal. +\fB^x\fP ¤Ï Control-x ¤ò°ÕÌ£¤¹¤ë¡£ Control-A ¤Ï 10 ¿Ê¿ô¤Î 1 ¤ËÅù¤·¤¤¡£ +.\"NAKANO: 1 decimal? +.LP +.\"O \ex means a special code. +.\"O x can be one of the following characters: +\&\ex ¤ÏÆü쥳¡¼¥É¤È¤·¤Æ°·¤ï¤ì¤ë¡£x ¤Ë¤Ï°Ê²¼¤Îʸ»ú¤Î¤É¤ì¤«¤¬Æþ¤ë¡£ +.RS +.\"O E Escape (27) +E ¥¨¥¹¥±¡¼¥× (27) +.br +.\"O n Linefeed (10) +n ¥é¥¤¥ó¥Õ¥£¡¼¥É (10) +.br +.\"O r Carriage return (13) +r Éüµ¢ (13) +.br +.\"O t Tabulation (9) +t ¥¿¥Ö (9) +.br +.\"O b Backspace (8) +b ¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹ (8) +.br +.\"O f Form feed (12) +f ÊÇÁ÷¤ê (12) +.br +.\"O 0 Null character. +.\"O A \exxx specifies the octal character xxx. +0 ¥Ì¥ë¥­¥ã¥é¥¯¥¿¡£'\exxx' ¤Ï 8 ¿Ê¿ô xxx ¤Îʸ»ú¤òɽ¤¹¡£ +.RE +.IP i +.\"O Increments parameters by one. +¥Ñ¥é¥á¡¼¥¿¤ò 1 Áý²Ã¤µ¤»¤ë¡£ +.IP r +.\"O Single parameter capability +°ì¤Ä¤Î¥Ñ¥é¥á¡¼¥¿¤ò¤È¤ëµ¡Ç½ +.IP + +.\"O Add value of next character to this parameter and do binary output +¼¡¤Îʸ»ú¤ÎÃͤò¥Ñ¥é¥á¡¼¥¿¤ËÄɲä·¡¢¥Ð¥¤¥Ê¥ê¤Ç½ÐÎϤ¹¤ë +.IP 2 +.\"O Do ASCII output of this parameter with a field with of 2 +¥Ñ¥é¥á¡¼¥¿¤ò 2 ·å¤Î¿ô»ú¤È¤·¤Æ ASCII ½ÐÎϤ¹¤ë (printf ¤Î %2d ¤ÈƱ¤¸°ÕÌ£) +.IP d +.\"O Do ASCII output of this parameter with a field with of 3 +¥Ñ¥é¥á¡¼¥¿¤ò¿ô»ú¤È¤·¤Æ ASCII ½ÐÎϤ¹¤ë (printf ¤Î %d ¤ÈƱ¤¸°ÕÌ£) +.IP % +.\"O Print a \(aq%\(aq +\(aq%\(aq ¤òɽ¼¨¤¹¤ë +.LP +.\"O If you use binary output, then you should avoid the null character +.\"O because it terminates the string. +.\"O You should reset tabulator expansion +.\"O if a tabulator can be the binary output of a parameter. +¥Ð¥¤¥Ê¥ê½ÐÎϤò¹Ô¤¦¾ì¹ç¡¢ +ʸ»úÎó¤ò½ªÃ¼¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¥Ì¥ëʸ»ú¤òÈò¤±¤Í¤Ð¤Ê¤é¤Ê¤¤¡£ +¥¿¥Öʸ»ú¤ò¥Ñ¥é¥á¡¼¥¿¤Î¥Ð¥¤¥Ê¥ê½ÐÎϤȤ¹¤ë¾ì¹ç¤Ï¡¢ +¥¿¥Öʸ»ú¤ÎŸ³«¤ò¥ê¥»¥Ã¥È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .IP Warning: +.IP Ãí°Õ: +.\"O The above metacharacters for parameters may be wrong, they document Minix +.\"O termcap which may not be compatible with Linux termcap. +¾åµ­¤Î¤è¤¦¤Ê¡¢¥Ñ¥é¥á¡¼¥¿¤È¤·¤Æ¤Î¥á¥¿Ê¸»ú¤ÏÀµ¤·¤¯¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î¤³¤È¤Ï¡¢Minix¤Î termcap ¤È +Linux ¤Î termcap ¤È¤Î´Ö¤Ë¸ß´¹À­¤¬¤Ê¤¤¤³¤È¤Ë·Ò¤¬¤Ã¤Æ¤¤¤ë¡£ +.\"NAKANO: ¤¢¤ä¤·¤¤¡£ +.LP +.\"O The block graphic characters can be specified by three string capabilities: +¿Þ·Áʸ»ú¤Ï 3 ¤Ä¤Îʸ»úÎóµ¡Ç½¤Ç»ØÄê¤Ç¤­¤ë¡£ +.IP as +.\"O start the alternative charset +ÂåÂØʸ»ú¥»¥Ã¥È¤Î³«»Ï +.IP ae +.\"O end it +ÂåÂØʸ»ú¥»¥Ã¥È¤Î½ªÎ» +.IP ac +.\"O pairs of characters. +.\"O The first character is the name of the block graphic +.\"O symbol and the second characters is its definition. +ʸ»úÎó¤Î¥Ú¥¢¤Î½¸¹ç¤ò»ØÄꤹ¤ë¡£ +ºÇ½é¤Îʸ»ú¤Ï¿Þ·Áʸ»ú¤Î̾¾Î¤Ç¡¢ +2 ÈÖÌܤÎʸ»ú¤Ï¤½¤ÎÄêµÁ¤Ç¤¢¤ë¡£ +.LP +.\"O The following names are available: +̾¾Î¤Ë¤Ï°Ê²¼¤Î¤â¤Î¤¬¤¢¤ë¡£ +.sp +.nf +.\"O + right arrow (>) ++ ±¦Ìð°õ (>) +.\"O , left arrow (<) +, º¸Ìð°õ (<) +.\"O \&. down arrow (v) +\&. ²¼Ìð°õ (v) +.\"O 0 full square (#) +0 ¤Ê¤«¤òÅɤê¤Ä¤Ö¤·¤¿»Í³Ñ (#) +.\"O I lantern (#) +I ¥é¥ó¥¿¥óµ­¹æ (#) +(ÌõÃí ¸¶Ê¸¤Ï latern ¤À¤Ã¤¿¤¬¡¢¤³¤ì¤Ï lantern ¤Î typo ¤È»×¤ï¤ì¤ë) +.\"O - upper arrow (^) +- ¾åÌð°õ (^) +.\"O \&' rhombus (+) +\&' É©·Á (+) +.\"O a chess board (:) +a ¥Á¥§¥¹ÈÄ (:) +.\"O f degree (') +f ³ÑÅÙ (') +.\"O g plus-minus (#) +g ¥×¥é¥¹¥Þ¥¤¥Ê¥¹ (#) +.\"O h square (#) +h »Í³Ñ (#) +.\"O j right bottom corner (+) +j ±¦²¼¶ù (+) +.\"O k right upper corner (+) +k ±¦¾å¶ù (+) +.\"O l left upper corner (+) +l º¸¾å¶ù (+) +.\"O m left bottom corner (+) +m º¸²¼¶ù (+) +.\"O n cross (+) +n ½½»ú (+) +.\"O o upper horizontal line (-) +o ¾å¿åÊ¿Àþ (-) +.\"O q middle horizontal line (-) +q Ãæ¿åÊ¿Àþ (-) +.\"O s bottom horizontal line (_) +s ²¼¿åÊ¿Àþ (_) +.\"O t left tee (+) +t º¸ T »ú (+) +.\"O u right tee (+) +u ±¦ T »ú (+) +.\"O v bottom tee (+) +v ²¼ T »ú (+) +.\"O w normal tee (+) +w Àµ T »ú (+) +.\"O x vertical line (|) +x ¿âľÀþ (|) +.\"O ~ paragraph (???) +~ ÃÊÍî (???) +.fi +.sp +.\"O The values in parentheses are suggested defaults which are used by curses, +.\"O if the capabilities are missing. +³ç¸ÌÆâ¤ÎÃͤϡ¢ +»ØÄꤷ¤¿µ¡Ç½¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¥Ç¥Õ¥©¥ë¥È¤ÎÃͤǤ¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ncurses (3), +.BR termcap (3), +.BR terminfo (5) +.SH ¹»Àµ¼Ôµ­ +Ìõ½Ð¤Ë¤¢¤¿¤Ã¤Æ¤Ï "\fBtermcap & terminfo\fP" +(Strang, Mui, O'reilly ¶¦Ãø, ÎëÌÚÎï ´ÆÌõ, ¥¢¥¹¥­¡¼½ÐÈÇ¶É 1992) +¤ò»²¹Í¤Ë¤·¤¿¡£ +¤¿¤À¤·ËÜÆüËܸì¥Þ¥Ë¥å¥¢¥ë¤Ë¤ª¤±¤ë¸í¤ê¤Ï¹»Àµ¼Ô¤ÎÀÕǤ¤Ç¤¢¤ë¡£ diff --git a/draft/man5/ttytype.5 b/draft/man5/ttytype.5 new file mode 100644 index 00000000..55c53ce1 --- /dev/null +++ b/draft/man5/ttytype.5 @@ -0,0 +1,93 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:17:50 1993 by Rik Faith +.\" Modified Thu Oct 19 21:25:21 MET 1995 by Martin Schulze +.\" Modified Mon Oct 21 17:47:19 EDT 1996 by Eric S. Raymond +.\" xk +.\" +.\" Japanese Version Copyright (c) 1997 NAKANO Takeo all rights reserved. +.\" Translated Thu Feb 10 1998 by NAKANO Takeo +.\" +.TH TTYTYPE 5 1993-07-24 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ttytype \- terminal device to default terminal type mapping +ttytype \- üËö¥Ç¥Ð¥¤¥¹¡ÝüËö¥¿¥¤¥×¤Î¥Ç¥Õ¥©¥ë¥È¥Þ¥Ã¥Ô¥ó¥° +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .I /etc/ttytype +.\"O file associates termcap/terminfo terminal type names +.\"O with tty lines. +.\"O Each line consists of a terminal type, followed by +.\"O whitespace, followed by a tty name (a device name without the +.\"O .IR /dev/ ") prefix." +.I /etc/ttytype +¤Ï tty ¥é¥¤¥ó¤ò termcap/terminfo ¤ÎüËö¥¿¥¤¥×¤Î̾Á°¤È´ØÏ¢ÉÕ¤±¤ë¡£¤½¤ì +¤¾¤ì¤Î¹Ô¤Ë¤Ï¡¢¤Þ¤ºÃ¼Ëö¤Î¥¿¥¤¥×¡¢Â³¤¤¤Æ¥¹¥Ú¡¼¥¹Ê¸»ú¡¢¤µ¤é¤Ë³¤¤¤Æ tty +̾ (¥Ç¥Ð¥¤¥¹Ì¾¤«¤éÀèƬ¤Î \fI/dev/\fP ¤ò¤È¤Ã¤¿¤â¤Î) ¤¬½ñ¤«¤ì¤ë¡£ + +.\"O This association is used by the program +.\"O .BR tset (1) +.\"O to set the environment variable +.\"O .B TERM +.\"O to the default terminal name for +.\"O the user's current tty. +¤³¤Î´ØÏ¢ÉÕ¤±¤Ï¥×¥í¥°¥é¥à +.BR tset (1) +¤¬ÍøÍѤ·¡¢¥æ¡¼¥¶¡¼¤¬¸½ºß»È¤Ã¤Æ¤¤¤ëüËö¤Î +.B TERM +´Ä¶­ÊÑ¿ô¤¬¡¢¥Ç¥Õ¥©¥ë¥È¤ÎüËö̾¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ + +.\"O This facility was designed for a traditional time-sharing environment +.\"O featuring character-cell terminals hardwired to a Unix minicomputer. +.\"O It is little used on modern workstation and personal Unixes. +¤³¤Îµ¡Ç½¤ÏÅÁÅýŪ¤Ê¥¿¥¤¥à¡¦¥·¥§¥¢¥ê¥ó¥°´Ä¶­ ( Unix ¥ß¥Ë¥³¥ó¥Ô¥å¡¼¥¿¤Ë +¥­¥ã¥é¥¯¥¿Ã¼Ëö¤¬Ä¾·ë¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê´Ä¶­) ¸þ¤±¤ËÀ߷פµ¤ì¤¿¡£¶áÂåŪ¤Ê +¥ï¡¼¥¯¥¹¥Æ¡¼¥·¥ç¥ó¤ä¥Ñ¡¼¥½¥Ê¥ë Unix ´Ä¶­¤Ç¤Ï¡¢¤Û¤È¤ó¤ÉÍøÍѤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.TP +.\"O .I /etc/ttytype +.\"O the tty definitions file. +.I /etc/ttytype +tty ÄêµÁ¥Õ¥¡¥¤¥ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O A typical +.\"O .I /etc/ttytype +.\"O is: +ŵ·¿Åª¤Ê \fI/etc/ttytype\fP ¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +.RS +.sp +con80x25 tty1 +.br +vt320 ttys0 +.RE +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR termcap (5), +.BR terminfo (5), +.BR agetty (8), +.BR mingetty (8) diff --git a/draft/man5/tzfile.5 b/draft/man5/tzfile.5 new file mode 100644 index 00000000..1760ed27 --- /dev/null +++ b/draft/man5/tzfile.5 @@ -0,0 +1,234 @@ +.\" @(#)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/man5/utmp.5 b/draft/man5/utmp.5 new file mode 100644 index 00000000..e269618d --- /dev/null +++ b/draft/man5/utmp.5 @@ -0,0 +1,562 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@cantor.informatik.rwth-aachen.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 1993-07-25 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995-02-26 by Michael Haardt +.\" Modified 1996-07-20 by Michael Haardt +.\" Modified 1997-07-02 by Nicolas Lichtmaier +.\" Modified 2004-10-31 by aeb, following Gwenole Beauchesne +.\" +.\" Japanese Version Copyright (c) 1997 Kazuyuki Tanisako +.\" all rights reserved. +.\" Translated 1998-02-16, Kazuyuki Tanisako +.\" Updated 2003-01-20, Akihiro MOTOKI +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" Updated 2005-10-06, Akihiro MOTOKI +.\" Updated 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" +.TH UTMP 5 2008-10-10 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O utmp, wtmp \- login records +utmp, wtmp \- ¥í¥°¥¤¥óµ­Ï¿ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .I utmp +.\"O file allows one to discover information about who is currently using the +.\"O system. +.\"O There may be more users currently using the system, because not +.\"O all programs use utmp logging. +.I utmp +¥Õ¥¡¥¤¥ë¤ò¸«¤ë¤³¤È¤Ç¡¢¸½ºß郎¥·¥¹¥Æ¥à¤ò»È¤Ã¤Æ¤¤¤ë¤«¤È¤¤¤¦¾ðÊó +¤¬ÆÀ¤é¤ì¤ë¡£¤¿¤À¤¹¤Ù¤Æ¤Î¥×¥í¥°¥é¥à¤¬ utmp ¥Õ¥¡¥¤¥ë¤ò +¹¹¿·¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢¼ÂºÝ¤Ë¤Ï¤½¤ì°Ê¾å¤Î¥æ¡¼¥¶¡¼¤¬ +¥·¥¹¥Æ¥à¤ò»È¤Ã¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.PP +.\"O .B Warning: +.\"O .I utmp +.\"O must not be writable by the user class "other", +.\"O because many system programs (foolishly) +.\"O depend on its integrity. +.\"O You risk faked system logfiles and +.\"O modifications of system files if you leave +.\"O .I utmp +.\"O writable to any user other than the owner and group owner of the file. +.B ·Ù¹ð: +(¶ò¤«¤Ë¤â) ¿¤¯¤Î¥·¥¹¥Æ¥à¥×¥í¥°¥é¥à¤¬¤½¤ÎÀ°¹çÀ­¤Ë°Í¸¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ +.I utmp +¥Õ¥¡¥¤¥ë¤Ï "other" ¤ËʬÎव¤ì¤ë¥æ¡¼¥¶¤ËÂФ·¤Æ +½ñ¤­¹þ¤ß²Äǽ¤Ë¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤È¥°¥ë¡¼¥×¥ª¡¼¥Ê¡¼°Ê³°¤Î¥æ¡¼¥¶¤ËÂФ·¤Æ +.I utmp +¥Õ¥¡¥¤¥ë¤ò½ñ¤­¹þ¤ß²Äǽ¤Ê¾õÂ֤ˤ·¤Æ¤ª¤¯¤È¡¢ +¥·¥¹¥Æ¥à¤Î¥í¥°¥Õ¥¡¥¤¥ë¤òµ¶Â¤¤µ¤ì¤¿¤ê¡¢¥·¥¹¥Æ¥à¥Õ¥¡¥¤¥ë¤Î +²þ¤¶¤ó¤ò¼õ¤±¤ë¤È¤¤¤Ã¤¿¥ê¥¹¥¯¤òÈȤ¹¤³¤È¤Ë¤Ê¤ë¡£ +.PP +.\"O The file is a sequence of +.\"O .I utmp +.\"O structures, +.\"O declared as follows in +.\"O .IR +.\"O (note that this is only one of several definitions +.\"O around; details depend on the version of libc): +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï +.I utmp +¹½Â¤ÂΤ竤êÊÖ¤·¤Ç¹½À®¤µ¤ì¤ë¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +(¤³¤³¤Ëµ­½Ò¤·¤Æ¤¢¤ë¤Î¤Ï´ö¤Ä¤«¤ÎÂç¤Þ¤«¤ÊÄêµÁ¤Î¤ß¤Ç¡¢ +¾ÜºÙ¤Ï libc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤êÊѤï¤ë¤³¤È¤ËÃí°Õ¤¬É¬ÍפǤ¢¤ë)¡£ +.in +4n +.nf +.sp +/* Values for ut_type field, below */ + +#define EMPTY 0 /* Record does not contain valid info + (formerly known as UT_UNKNOWN on Linux) */ +#define RUN_LVL 1 /* Change in system run-level (see + \fBinit\fP(8)) */ +#define BOOT_TIME 2 /* Time of system boot (in \fIut_tv\fP) */ +#define NEW_TIME 3 /* Time after system clock change + (in \fIut_tv\fP) */ +#define OLD_TIME 4 /* Time before system clock change + (in \fIut_tv\fP) */ +#define INIT_PROCESS 5 /* Process spawned by \fBinit\fP(8) */ +#define LOGIN_PROCESS 6 /* Session leader process for user login */ +#define USER_PROCESS 7 /* Normal process */ +#define DEAD_PROCESS 8 /* Terminated process */ +#define ACCOUNTING 9 /* Not implemented */ + +#define UT_LINESIZE 32 +#define UT_NAMESIZE 32 +#define UT_HOSTSIZE 256 + +struct exit_status { /* Type for ut_exit, below */ + short int e_termination; /* Process termination status */ + short int e_exit; /* Process exit status */ +}; + +struct utmp { + short ut_type; /* Type of record */ + pid_t ut_pid; /* PID of login process */ + char ut_line[UT_LINESIZE]; /* Device name of tty \- "/dev/" */ + char ut_id[4]; /* Terminal name suffix, + or inittab(5) ID */ + char ut_user[UT_NAMESIZE]; /* Username */ + char ut_host[UT_HOSTSIZE]; /* Hostname for remote login, or + kernel version for run-level + messages */ + struct exit_status ut_exit; /* Exit status of a process + marked as DEAD_PROCESS; not + used by Linux init(8) */ +.\"O /* The ut_session and ut_tv fields must be the same size when +.\"O compiled 32- and 64-bit. This allows data files and shared +.\"O memory to be shared between 32- and 64-bit applications. */ + /* ut_session ¤È ut_tv ¥Õ¥£¡¼¥ë¥É¤Ï¡¢32¥Ó¥Ã¥È¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¾ì¹ç¤È + 64¥Ó¥Ã¥È¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¾ì¹ç¤ÇƱ¤¸¥µ¥¤¥º¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + ¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢32¥Ó¥Ã¥È¤È64¥Ó¥Ã¥È¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¡¢ + ¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤È¶¦Í­¥á¥â¥ê¤ò¶¦Í­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ */ + +#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32 + int32_t ut_session; /* Session ID (\fBgetsid\fP(2)), + used for windowing */ + struct { + int32_t tv_sec; /* Seconds */ + int32_t tv_usec; /* Microseconds */ + } ut_tv; /* Time entry was made */ +#else + long ut_session; /* Session ID */ + struct timeval ut_tv; /* Time entry was made */ +#endif + + int32_t ut_addr_v6[4]; /* Internet address of remote + host; IPv4 address uses + just ut_addr_v6[0] */ + char __unused[20]; /* Reserved for future use */ +}; + +/* Backwards compatibility hacks */ +#define ut_name ut_user +#ifndef _NO_UT_TIME +#define ut_time ut_tv.tv_sec +#endif +#define ut_xtime ut_tv.tv_sec +#define ut_addr ut_addr_v6[0] +.sp +.fi +.in +.\"O This structure gives the name of the special file associated with the +.\"O user's terminal, the user's login name, and the time of login in the form +.\"O of +.\"O .BR time (2). +.\"O String fields are terminated by \fB\(aq\e0\(aq\fP +.\"O if they are shorter than the size +.\"O of the field. +¤³¤Î¹½Â¤ÂΤ«¤é¥æ¡¼¥¶¡¼¤Î»È¤Ã¤Æ¤¤¤ëüËö¤Î¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë̾¡¢ +¥æ¡¼¥¶¡¼¤Î¥í¥°¥¤¥ó̾¡¢ +.RB ( time (2) +·Á¼°¤Ç¤Î)¥í¥°¥¤¥ó»þ¹ï¤¬¤ï¤«¤ë¡£Ê¸»úÎó¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +¥Õ¥£¡¼¥ë¥É¤ÎŤµ¤è¤êʸ»úÎó¤¬Ã»¤¤¾ì¹ç¤Ë¤Ï¡¢\fB\(aq\e0\(aq\fP ¤Ë¤è¤Ã¤Æ½ªÃ¼¤µ¤ì¤ë¡£ +.PP +.\"O The first entries ever created result from +.\"O .BR init (8) +.\"O processing +.\"O .BR inittab (5). +.\"O Before an entry is processed, though, +.\"O .BR init (8) +.\"O cleans up utmp by setting \fIut_type\fP to \fBDEAD_PROCESS\fP, clearing +.\"O \fIut_user\fP, \fIut_host\fP, and \fIut_time\fP with null bytes for each +.\"O record which \fIut_type\fP is not \fBDEAD_PROCESS\fP or \fBRUN_LVL\fP +.\"O and where no process with PID \fIut_pid\fP exists. +.\"O If no empty record +.\"O with the needed \fIut_id\fP can be found, +.\"O .BR init (8) +.\"O creates a new one. +.\"O It sets \fIut_id\fP from the inittab, \fIut_pid\fP and \fIut_time\fP to the +.\"O current values, and \fIut_type\fP to \fBINIT_PROCESS\fP. +ºÇ½é¤Î¥¨¥ó¥È¥ê¤Ï +.BR init (8) +¥³¥Þ¥ó¥É¤¬ +.BR inittab (5) +¤ò½èÍý¤¹¤ë¤³¤È¤Çºî¤é¤ì¤ë¡£ +¤¢¤ë¥¨¥ó¥È¥ê¤ò½èÍý¤¹¤ëÁ°¤Ë¡¢ +.BR init (8) +¤Ï \fIut_type\fP ¤ò \fBDEAD_PROCESS\fP ¤Ë½é´ü²½¤¹¤ë¡£ +¥ì¥³¡¼¥É¤Î +\fIut_type\fP ¤¬ \fBDEAD_PROCESS\fP ¤È \fBRUN_LVL\fP ¤Î¤¤¤º¤ì¤Ç¤â¤Ê¤¯¡¢ +¤«¤Ä PID ¤¬ \fIut_pid\fP ¤Ç¤¢¤ë¥×¥í¥»¥¹¤¬¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢\fIut_user\fP, +\fIut_host\fP, \fIut_time\fP ¤ò¥Ì¥ë¥Ð¥¤¥È¤Ç¥¯¥ê¥¢¤·¤Æ½é´ü²½¤ò¹Ô¤¦¡£ +ɬÍ×¤Ê \fIut_id\fP ¤ò»ý¤Ä¶õ¤Î¥ì¥³¡¼¥É¤ò¸«¤Ä¤±¤é¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.BR init (8) +¤Ï¿·¤·¤¤¥ì¥³¡¼¥É¤òºî¤ë¡£inittab ¤«¤é \fIut_id\fP ¤òÀßÄꤷ¡¢ +\fIut_pid\fP ¤ª¤è¤Ó \fIut_time\fP ¤ò¸½ºßÃͤˡ¢ +\fIut_type\fP ¤ò \fBINIT_PROCESS\fP ¤ËÀßÄꤹ¤ë¡£ +.PP +.\"O .BR mingetty (8) +.\"O (or +.\"O .BR agetty (8)) +.\"O locates the entry by the PID, changes \fIut_type\fP to +.\"O \fBLOGIN_PROCESS\fP, changes \fIut_time\fP, sets \fIut_line\fP, and waits +.\"O for connection to be established. +.\"O .BR login (1), +.\"O after a user has been +.\"O authenticated, changes \fIut_type\fP to \fBUSER_PROCESS\fP, changes +.\"O \fIut_time\fP, and sets \fIut_host\fP and \fIut_addr\fP. +.\"O Depending on +.\"O .BR mingetty (8) +.\"O (or +.\"O .BR agetty (8)) +.\"O and +.\"O .BR login (1), +.\"O records may be located by +.\"O \fIut_line\fP instead of the preferable \fIut_pid\fP. +.BR mingetty (8) +(¤Þ¤¿¤Ï +.BR agetty (8)) +¤Ï pid ¤Ç¥¨¥ó¥È¥ê¤òÆÃÄꤷ¡¢ +\fIut_type\fP ¤ò \fBLOGIN_PROCESS\fP ¤ËÊѹ¹¤·¡¢ +\fIut_time\fP ¤ò¹¹¿·¤·¡¢\fIut_line\fP¤òÀßÄꤷ¤¿¸å¡¢Àܳ¤¬³ÎΩ¤µ¤ì¤ë¤Î¤òÂԤġ£ +.BR login (1) +¤Ï¥æ¡¼¥¶¡¼Ç§¾Ú¤¬½ªÎ»¤¹¤ë¤È¡¢ +\fIut_type\fP ¤ò \fBUSER_PROCESS\fP ¤ËÊѹ¹¤·¡¢ +\fIut_time\fP ¤ò¹¹¿·¤·¡¢\fIut_host\fP ¤È \fIut_addr\fP¤òÀßÄꤹ¤ë¡£ +.BR mingetty (8) +(¤Þ¤¿¤Ï +.BR agetty (8)) +¤È +.BR login (1) +¤Ë¤è¤ê°Û¤Ê¤ë¤¬¡¢ +\fIut_pid\fP ¤ÎÂå¤ï¤ê¤Ë +\fIut_line\fP ¤ò»È¤Ã¤Æ¥ì¥³¡¼¥É¤ÎÆÃÄ꤬¹Ô¤ï¤ì¤ë¤³¤È¤â¤¢¤ë +(\fIut_pid\fP ¤ò»È¤¦Êý¤¬Ë¾¤Þ¤·¤¤) ¡£ +.PP +.\"O When +.\"O .BR init (8) +.\"O finds that a process has exited, it locates its utmp +.\"O entry by \fIut_pid\fP, sets \fIut_type\fP to \fBDEAD_PROCESS\fP, and +.\"O clears \fIut_user\fP, \fIut_host\fP and \fIut_time\fP with null bytes. +.BR init (8) +¤Ï¥×¥í¥»¥¹¤Î½ªÎ»¤ò¸¡½Ð¤·¤¿¾ì¹ç¡¢ +\fIut_pid\fP ¤ò¥­¡¼¤È¤·¤Æ utmp ¤Î¥¨¥ó¥È¥ê¤òÆÃÄꤷ¡¢ +\fIut_type\fP ¤ò \fBDEAD_PROCESS\fP ¤ËÀßÄꤷ¡¢ +\fIut_user\fP, \fIut_host\fP, \fIut_time\fP ¤ò¥Ì¥ë¥Ð¥¤¥È¤Ç¥¯¥ê¥¢¤¹¤ë¡£ +.PP +.\"O .BR xterm (1) +.\"O and other terminal emulators directly create a +.\"O \fBUSER_PROCESS\fP record and generate the \fIut_id\fP by using the +.\"O string that suffix part of the terminal name (the characters +.\"O following \fI/dev/[pt]ty\fP). +.\"O If they find a \fBDEAD_PROCESS\fP for this ID, +.\"O they recycle it, otherwise they create a new entry. +.\"O If they can, they +.\"O will mark it as \fBDEAD_PROCESS\fP on exiting and it is advised that +.\"O they null \fIut_line\fP, \fIut_time\fP, \fIut_user\fP, and \fIut_host\fP +.\"O as well. +.BR xterm (1) +¥³¥Þ¥ó¥É¤ä¾¤ÎüËö¥¨¥ß¥å¥ì¡¼¥¿¤Ï +ľÀÜ \fBUSER_PROCESS\fP ¤Î¥ì¥³¡¼¥É¤òºî¤ê¡¢ +üËö̾¤Î¥µ¥Õ¥£¥Ã¥¯¥¹Ê¸»úÎó (\fI/dev/[pt]ty\fP ¤Ë³¤¯Ê¸»úÎó) +¤ò»È¤Ã¤Æ \fIut_id\fP ¤ÎÃͤòÀ¸À®¤¹¤ë¡£ +¤³¤Î id ¤ò»ý¤Ä¥¨¥ó¥È¥ê¤¬ \fBDEAD_PROCESS\fP ¤Ç¤¢¤Ã¤¿¾ì¹ç¤Ë¤ÏºÆÍøÍѤ·¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¿·¤·¤¤¥¨¥ó¥È¥ê¤¬ºî¤é¤ì¤ë¡£ +²Äǽ¤Ê¾ì¹ç¤Ë¤Ï¥×¥í¥»¥¹½ªÎ»»þ¤Ë \fBDEAD_PROCESS\fP ¤ÈÀßÄꤷ¡¢ +¤µ¤é¤Ë \fIut_line\fP, \fIut_time\fP, \fIut_user\fP, \fIut_host\fP +¤ò¥Ì¥ë¥Ð¥¤¥È¤Ç¥¯¥ê¥¢¤¹¤ë¤³¤È¤¬¾©Î夵¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O sets up a \fBLOGIN_PROCESS\fP entry and leaves the rest to +.\"O .BR login (1) +.\"O as usual. +.\"O After the telnet session ends, +.\"O .BR telnetd (8) +.\"O cleans up utmp in the described way. +.BR telnetd (8) +¤Ï \fBLOGIN_PROCESS\fP ¤òÀßÄꤹ¤ë¤À¤±¤Ç¤è¤¯¡¢ +»Ä¤ê¤Î½èÍý¤ÏÄ̾ïÄ̤ê +.BR login (1) +¤ËǤ¤»¤ì¤Ð¤è¤¤¡£ +telnet ¤Î¥»¥Ã¥·¥ç¥ó¤¬½ªÎ»¤·¤¿¸å¡¢Á°½Ò¤Î¤è¤¦¤Ë +.BR telnetd (8) +¤¬ utmp ¤Î¥¨¥ó¥È¥ê¤ò½é´ü²½¤¹¤ë¡£ +.PP +.\"O The \fIwtmp\fP file records all logins and logouts. +.\"O Its format is exactly like \fIutmp\fP except that a null username +.\"O indicates a logout +.\"O on the associated terminal. +.\"O Furthermore, the terminal name \fB~\fP +.\"O with username \fBshutdown\fP or \fBreboot\fP indicates a system +.\"O shutdown or reboot and the pair of terminal names \fB|\fP/\fB}\fP +.\"O logs the old/new system time when +.\"O .BR date (1) +.\"O changes it. +.\"O \fIwtmp\fP is maintained by +.\"O .BR login (1), +.\"O .BR init (8), +.\"O and some versions of +.\"O .BR getty (8) +.\"O (e.g., +.\"O .BR mingetty (8) +.\"O or +.\"O .BR agetty (8)). +.\"O None of these programs creates the file, so if it is +.\"O removed, record-keeping is turned off. +\fIwtmp\fP ¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¤¹¤Ù¤Æ¤Î¥í¥°¥¤¥ó¤È¥í¥°¥¢¥¦¥È¤¬µ­Ï¿¤µ¤ì¤ë¡£ +¤½¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢¥í¥°¥¢¥¦¥ÈºÑ¤ÎüËö¤Ç¥æ¡¼¥¶¡¼Ì¾¤¬¥Ì¥ë¤È¤Ê¤ë¤³¤È°Ê³°¤Ï +\fIutmp\fP ¤È¤Þ¤Ã¤¿¤¯Æ±¤¸¤Ç¤¢¤ë¡£ +¥æ¡¼¥¶¡¼Ì¾¤¬ \fBshutdown\fP ¤â¤·¤¯¤Ï \fBreboot\fP ¤Ç¤¢¤ë +üËö̾ \fB~\fP ¤Ï¥·¥¹¥Æ¥à¤ÎÄä»ß (shutdown) ¤Þ¤¿¤ÏºÆµ¯Æ° (reboot) +¤ò°ÕÌ£¤¹¤ë¡£¤Þ¤¿¤½¤ÎüËö̾¤¬ \fB|\fP ¤È \fB}\fP ¤ÎÂÐ¤Ï +.BR date (1) +¥³¥Þ¥ó¥É¤ÇÊѹ¹¤·¤¿¿·¡¿µì¤Î¥·¥¹¥Æ¥à»þ¹ï¤òµ­Ï¿¤·¤Æ¤¤¤ë¡£ +\fIwtmp\fP ¥Õ¥¡¥¤¥ë¤Ï +.BR login (1), +.BR init (8) +¤ä¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Î +.BR getty (8) +.RB ( mingetty (8) +¤Þ¤¿¤Ï +.BR agetty (8)) +¤Ë¤è¤ê´ÉÍý¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥×¥í¥°¥é¥à¤Ï¤É¤ì¤â¥Õ¥¡¥¤¥ë¤ò¿·¤¿¤ËºîÀ®¤·¤Ê¤¤¤Î¤Ç¡¢ +¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¤³¤È¤Ç¾ðÊó¤Îµ­Ï¿ (record-keeping) ¤ò»ß¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +/var/run/utmp +.br +/var/log/wtmp +.\"O .SH "CONFORMING TO" +.SH ½àµò +.PP +.\"O POSIX.1 does not specify a +.\"O .I utmp +.\"O structure, but rather one named +.\"O .IR utmpx , +.\"O with specifications for the fields +.\"O .IR ut_type , +.\"O .IR ut_pid , +.\"O .IR ut_line , +.\"O .IR ut_id , +.\"O .IR ut_user , +.\"O and +.\"O .IR ut_tv . +.\"O POSIX.1 does not specify the lengths of the +.\"O .I ut_line +.\"O and +.\"O .I ut_user +.\"O fields. +POSIX.1 ¤Ç¤Ï¡¢ +.I utmp +¹½Â¤ÂΤǤϤʤ¯¡¢ +.I utmpx +¹½Â¤ÂΤòµ¬Äꤷ¤Æ¤¤¤ë¡£ +.I utmpx +¹½Â¤ÂΤǵ¬Äꤵ¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢¥Õ¥£¡¼¥ë¥É +.IR ut_type , +.IR ut_pid , +.IR ut_line , +.IR ut_id , +.IR ut_user , +.IR ut_tv +¤Ç¤¢¤ë¡£ +POSIX.1 ¤Ç¤Ï¡¢¥Õ¥£¡¼¥ë¥É +.I ut_line +¤È +.I ut_user +¤ÎŤµ¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"O Linux defines the +.\"O .I utmpx +.\"O structure to be the same as the +.\"O .I utmp +.\"O structure. +Linux ¤Ç¤Ï¡¢ +.I utmpx +¹½Â¤ÂΤÎÄêµÁ¤Ï +.I utmp +¹½Â¤ÂΤÈƱ¤¸¤Ç¤¢¤ë¡£ +.\"O .SS Comparison with Historical Systems +.SS ²áµî¤Î¥·¥¹¥Æ¥à¤È¤ÎÈæ³Ó +.\"O Linux utmp entries conform neither to v7/BSD nor to System V; they are a +.\"O mix of the two. +Linux ¤Ç¤Î utmp ¤Î¥¨¥ó¥È¥ê¤Ï v7/BSD ¤ä System V ¤Î¤¤¤º¤ì¤Ë¤â½àµò¤·¤Æ¤ª¤é¤º¡¢ +¤½¤ÎξÊý¤¬º®ºß¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +.\"O v7/BSD has fewer fields; most importantly it lacks +.\"O \fIut_type\fP, which causes native v7/BSD-like programs to display (for +.\"O example) dead or login entries. +.\"O Further, there is no configuration file +.\"O which allocates slots to sessions. +.\"O BSD does so because it lacks \fIut_id\fP fields. +v7/BSD ¤Ç¤Ï¤è¤ê¾¯¤·¤Î¹àÌܤ·¤«¤Ê¤¤; +¤â¤Ã¤È¤â½ÅÍפʤ³¤È¤Ï¡¢\fIut_type\fP ¤¬Ìµ¤¤¤³¤È¤Ç¤¢¤ë¡£ +¤½¤Î¤¿¤á v7/BSD ·Ï¤Î¥×¥í¥°¥é¥à¤Ç¤Ï (¤¿¤È¤¨¤Ð) »à¤ó¤À¾õÂ֤Υ¨¥ó¥È¥ê¤ä +¥í¥°¥¤¥ó¾õÂ֤Υ¨¥ó¥È¥ê¤Þ¤Çɽ¼¨¤µ¤ì¤Æ¤·¤Þ¤¦¤³¤È¤Ë¤Ê¤Ã¤¿¡£ +¤µ¤é¤Ë¥»¥Ã¥·¥ç¥óÍѤΥ¹¥í¥Ã¥È¤ò³ä¤êÅö¤Æ¤ë¤¿¤á¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤¬¤Ê¤¤¡£ +BSD ¤ËÀßÄê¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¤Î¤Ï \fIut_id\fP ¤¬¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ + +.\"O In Linux (as in System V), the \fIut_id\fP field of a +.\"O record will never change once it has been set, which reserves that slot +.\"O without needing a configuration file. +.\"O Clearing \fIut_id\fP may result +.\"O in race conditions leading to corrupted utmp entries and potential +.\"O security holes. +.\"O Clearing the abovementioned fields by filling them +.\"O with null bytes is not required by System V semantics, +.\"O but makes it possible to run +.\"O many programs which assume BSD semantics and which do not modify utmp. +.\"O Linux uses the BSD conventions for line contents, as documented above. +Linux (System V ·Ï)¤Ç¤Ï¡¢ÀßÄê¥Õ¥¡¥¤¥ë¤òɬÍפȤ»¤º +¥»¥Ã¥·¥ç¥óÍѤΥ¹¥í¥Ã¥È¤ò³ä¤êÅö¤Æ¤ë¤Î¤Ç¡¢°ìöÀßÄê +¤µ¤ì¤Æ¤·¤Þ¤¦¤È¥ì¥³¡¼¥É¤Î \fIut_id\fP ¤Ï·è¤·¤ÆÊѹ¹¤µ¤ì¤Ê¤¤¡£ +\fIut_id\fP ¤ò¥¯¥ê¥¢¤¹¤ë¤È¶¥¹ç¾õÂ֤ˤª¤Á¤¤¤ê¡¢ +utmp ¤Î¥¨¥ó¥È¥ê¤ò²õ¤·¤¿¤ê¡¢ÀøºßŪ¤Ê¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤Ë¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¾å½Ò¤Î¥Õ¥£¡¼¥ë¥É¤ò NULL ¥Ð¥¤¥È¤ÇËä¤á¤Æ¥¯¥ê¥¢¤·¤Æ¤ª¤¯¤Î¤Ï¡¢ +System V ¤Ç¤Î¼è¤ê·è¤á¤Ç¤ÏɬÍפȤϤµ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +BSD ¤Ç¤Î¼è¤ê·è¤á¤òÁ°Äó¤È¤·¤Æ¤¤¤Æ¡¢¤«¤Ä utmp ¤ò¹¹¿·¤·¤Ê¤¤Â¿¤¯¤Î¥×¥í¥°¥é¥à¤¬ +Æ°ºî¤¹¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ç¤¢¤ë¡£ +Linux ¤Ç¤Ï¤³¤³¤Þ¤Çµ­½Ò¤·¤Æ¤­¤¿¤è¤¦¤Ë¡¢¹ÔÆâÍƤÎɽ¼¨¤Ï BSD ¤Î´·Îã¤Ë½¾¤Ã¤Æ¤¤¤ë¡£ +.PP +.\"O .\" mtk: What is the referrent of "them" in the following sentence? +.\"O .\" System V only uses the type field to mark them and logs +.\"O .\" informative messages such as \fB"new time"\fP in the line field. +.\"O System V has no \fIut_host\fP or \fIut_addr_v6\fP fields. +.\" mtk: What is the referrent of "them" in the following sentence? +.\" System V ¤Ç¤Ï ut_type ¤òÌÜ°õ¤Ë¤·¤¿¤ê¡¢¤¿¤È¤¨¤Ð \fB"new time"\fP ¤Î¤è¤¦¤Ê +.\" ÄÌÃÎ¥á¥Ã¥»¡¼¥¸¤òµ­Ï¿¤¹¤ë¤¿¤á¤Î¤ß¤Ë»È¤Ã¤Æ¤¤¤ë¡£ +\fBUT_UNKNOWN\fP ¤Ï Linux ¤Çºî¤é¤ì¤¿¤â¤Î¤Î¤è¤¦¤Ç¤¢¤ë¡£ +System V ¤Ë¤Ï \fIut_host\fP ¤â \fIut_addr_v6\fP ¤â¸ºß¤·¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.PP +.\"O Unlike various other +.\"O systems, where utmp logging can be disabled by removing the file, utmp +.\"O must always exist on Linux. +.\"O If you want to disable +.\"O .BR who (1) +.\"O then +.\"O do not make utmp world readable. +¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¤³¤È¤Ç utmp ¤Ø¤Îµ­Ï¿¤ò»ß¤á¤é¤ì¤ë +¾¤ÎÍÍ¡¹¤Ê¥·¥¹¥Æ¥à¤È¤Ï°ã¤¤¡¢Linux ¤Ç¤Ï utmp ¥Õ¥¡¥¤¥ë¤òɬ¤º¤ª¤¤¤Æ +¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +.BR who (1) +¥³¥Þ¥ó¥É¤¬µ¡Ç½¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +utmp ¥Õ¥¡¥¤¥ë¤ÎÁ´¥æ¡¼¥¶¡¼¤ËÂФ¹¤ëÆɤ߼è¤êµö²Ä¤òÀßÄꤷ¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£ +.PP +.\"O The file format is machine-dependent, so it is recommended that it be +.\"O processed only on the machine architecture where it was created. +¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¥Þ¥·¥ó¤Ë°Í¸¤¹¤ë¤Î¤Ç¡¢¥Õ¥¡¥¤¥ë¤¬ºî¤é¤ì¤¿ +¥Þ¥·¥ó¤â¤·¤¯¤ÏƱ°ì¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¥Þ¥·¥ó¾å¤Ç¤Î¤ß½èÍý¤¹¤ë¤³¤È¤ò¿ä¾©¤¹¤ë¡£ +.PP +.\"O Note that on \fIbiarch\fP platforms, that is, systems which can run both +.\"O 32-bit and 64-bit applications (x86-64, ppc64, s390x, etc.), +.\"O \fIut_tv\fP is the same size in 32-bit mode as in 64-bit mode. +.\"O The same goes for \fIut_session\fP and \fIut_time\fP if they are present. +.\"O This allows data files and shared memory to be shared between +.\"O 32-bit and 64-bit applications. +Ãí°Õ¤¹¤Ù¤­ÅÀ¤È¤·¤Æ¤Ï¡¢ +\fIbiarch\fP ¤Ê¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¡¢¤Ä¤Þ¤ê 32¥Ó¥Ã¥È¤È 64¥Ó¥Ã¥È¤ÎξÊý¤Î +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¼Â¹Ô¤Ç¤­¤ë¥·¥¹¥Æ¥à (x86-64, ppc64, s390x ¤Ê¤É) ¤Ç¤Ï¡¢ +\fIut_tv\fP ¤Î¥µ¥¤¥º¤Ï 32¥Ó¥Ã¥È¥â¡¼¥É¤È 64¥Ó¥Ã¥È¥â¡¼¥É¤ÇƱ¤¸¤Ç¤¢¤ë¡£ +\fIut_session\fP ¤È \fIut_time\fP ¤â¡¢Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤ÏƱÍͤËƱ¤¸¥µ¥¤¥º +¤Ç¤¢¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢32¥Ó¥Ã¥È¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È 64¥Ó¥Ã¥È¥¢¥×¥ê¥±¡¼¥·¥ç¥ó +¤Î´Ö¤Ç¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤È¶¦Í­¥á¥â¥ê¤ò¶¦Í­¤¹¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤ë¡£ +.\"O This is achieved by changing the type of +.\"O .I ut_session +.\"O to +.\"O .IR int32_t , +.\"O and that of +.\"O .I ut_tv +.\"O to a struct with two +.\"O .I int32_t +.\"O fields +.\"O .I tv_sec +.\"O and +.\"O .IR tv_usec . +¤½¤Î¤¿¤á¤Ë¤Ï¡¢ +.I ut_session +¤ò +.I int32_t +·¿¤Ë¡¢ +.I ut_tv +¤ò 2¤Ä¤Î +.I int32_t +·¿¤Î¥Õ¥£¡¼¥ë¥É +.IR tv_sec , +.I tv_usec +¤ò»ý¤Ä¹½Â¤ÂΤËÊѹ¹¤¹¤ì¤Ð¤è¤¤ +.\"O Since \fIut_tv\fP may not be the same as \fIstruct timeval\fP, +.\"O then instead of the call: +\fIut_tv\fP ¤Ï \fIstruct timeval\fP ¤ÈƱ¤¸¥µ¥¤¥º¤È¤Ï¸Â¤é¤Ê¤¤¤Î¤Ç¡¢ +.in +4n +.nf +.sp +gettimeofday((struct timeval *) &ut.ut_tv, NULL); +.fi +.in + +¤Î¤è¤¦¤Ê¸Æ¤Ó½Ð¤·¤ò¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +.\"O the following method of setting this field is recommended: +°Ê²¼¤Î¤è¤¦¤Ë³Æ¥Õ¥£¡¼¥ë¥É¤òÀßÄꤹ¤ëÊýË¡¤¬¿ä¾©¤µ¤ì¤ë: +.in +4n +.nf +.sp +struct utmp ut; +struct timeval tv; + +gettimeofday(&tv, NULL); +ut.ut_tv.tv_sec = tv.tv_sec; +ut.ut_tv.tv_usec = tv.tv_usec; +.fi +.in +.PP +.\"O Note that the \fIutmp\fP struct from libc5 has changed in libc6. +.\"O Because of this, +.\"O binaries using the old libc5 struct will corrupt +.\"O .IR /var/run/utmp " and/or " /var/log/wtmp . +utmp ¹½Â¤ÂÎ¤Ï libc5 ¤«¤é libc6 ¤ÇÊѹ¹¤µ¤ì¤¿¡£¤½¤Î¤¿¤áÀΤΠlibc5 ¤Î¹½Â¤ÂÎ +¤ò»È¤Ã¤¿¥×¥í¥°¥é¥à¤Ï +.IR /var/run/utmp " ¤ä " /var/log/wtmp +¥Õ¥¡¥¤¥ë¤ò²õ¤·¤Æ¤·¤Þ¤¦¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O This man page is based on the libc5 one, things may work differently now. +¤³¤Î man ¥Ú¡¼¥¸¤Ï libc5 ¤Ë´ð¤Å¤¤¤Æºî¤é¤ì¤Æ¤¤¤Æ¡¢ +ºÇ¿·¤Î¤â¤Î¤Ç¤Ï°ã¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ac (1), +.BR date (1), +.BR last (1), +.BR login (1), +.BR who (1), +.BR getutent (3), +.BR getutmp (3), +.BR login (3), +.BR logout (3), +.BR logwtmp (3), +.BR updwtmp (3), +.BR init (8) diff --git a/draft/man6/intro.6 b/draft/man6/intro.6 new file mode 100644 index 00000000..e8622413 --- /dev/null +++ b/draft/man6/intro.6 @@ -0,0 +1,50 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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 +.\" +.TH INTRO 6 2007-10-23 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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 +.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/arp.7 b/draft/man7/arp.7 new file mode 100644 index 00000000..77f9b2b7 --- /dev/null +++ b/draft/man7/arp.7 @@ -0,0 +1,561 @@ +'\" t +.\" This man page is Copyright (C) 1999 Matthew Wilcox . +.\" 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. +.\" Modified June 1999 Andi Kleen +.\" $Id: arp.7,v 1.9 2001/03/12 08:45:27 nakano Exp $ +.\" +.\" Japanese Version Copyright (c) 1999-2001 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated & Modified 2001-02-16, NAKANO Takeo +.\" Updated 2008-12-26, Akihiro MOTOKI, LDP v3.14 +.\" +.\"WORD permanent Êݸ +.\"WORD neighbor cache entry ¶á˵¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +.\"WORD stale ¸Å¤¯¤Ê¤Ã¤¿ +.\"WORD proxy arp ÂåÍý arp +.\"WORD garbage collect (-or) ¥¬¥Ù¡¼¥¸¡¦¥³¥ì¥¯¥È(¥³¥ì¥¯¥¿) +.\"WORD capability ¸¢¸Â +.\"WORD neighbor soliciation message ¶á˵Í×ÀÁ¥á¥Ã¥»¡¼¥¸ +.\"WORD network flooding ¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥Õ¥é¥Ã¥Ç¥£¥ó¥° +.\"WORD thrashing ¥¹¥é¥Ã¥·¥ó¥° +.\"WORD connection oriented Àܳ»Ø¸þ +.\"WORD forward progress ¥Õ¥©¥ï¡¼¥É¥×¥í¥°¥ì¥¹ +.\" +.TH ARP 7 2008-11-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O arp \- Linux ARP kernel module. +.SH ̾Á° +arp \- Linux ARP ¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This kernel protocol module implements the Address Resolution +.\"O Protocol defined in RFC\ 826. +.\"O It is used to convert between Layer2 hardware addresses +.\"O and IPv4 protocol addresses on directly connected networks. +.\"O The user normally doesn't interact directly with this module except to +.\"O configure it; +.\"O instead it provides a service for other protocols in the kernel. +¤³¤Î¥«¡¼¥Í¥ë¥×¥í¥È¥³¥ë¥â¥¸¥å¡¼¥ë¤Ï¡¢ +RFC\ 826 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë Address Resolution Protocol ¤ò +¼ÂÁõ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ ARP ¤Ï¡¢¥À¥¤¥ì¥¯¥È¤ËÀܳ¤µ¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Ç¡¢ +Âè 2 ÁؤΥϡ¼¥É¥¦¥§¥¢¥¢¥É¥ì¥¹¤òIPv4 ¥×¥í¥È¥³¥ë¥¢¥É¥ì¥¹¤Ë +ÊÑ´¹¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£¥æ¡¼¥¶¡¼¤ÏÀßÄê¤Î¾ì¹ç¤ò½ü¤¤¤Æ +Ä̾ïľÀܤ³¤Î¥â¥¸¥å¡¼¥ë¤Ë´Ø¤ë¤³¤È¤Ï¤Ê¤¤¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ëÆâÉô¤Î¾¤Î¥×¥í¥È¥³¥ë¤Ë¥µ¡¼¥Ó¥¹¤òÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.PP +.\"O A user process can receive ARP packets by using +.\"O .BR packet (7) +.\"O sockets. +.\"O There is also a mechanism for managing the ARP cache +.\"O in user-space by using +.\"O .BR netlink (7) +.\"O sockets. +.\"O The ARP table can also be controlled via +.\"O .BR ioctl (2) +.\"O on any +.\"O .B AF_INET +.\"O socket. +¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤Ï¡¢ +.BR packet (7) +¥½¥±¥Ã¥È¤òÍѤ¤¤ì¤Ð ARP ¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +ARP ¥­¥ã¥Ã¥·¥å¤ò¥æ¡¼¥¶¡¼¶õ´Ö¤Ç´ÉÍý¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤Ï +.BR netlink (7) +¤òÍѤ¤¤ë¡£ ARP ¥Æ¡¼¥Ö¥ë¤âÀ©¸æ²Äǽ¤Ç¡¢¤³¤ì¤Ë¤ÏǤ°Õ¤Î +.B AF_INET +¥½¥±¥Ã¥È¤Ë +.BR ioctl (2) +¤òÍѤ¤¤ë¡£ +.PP +.\"O The ARP module maintains a cache of mappings between hardware addresses +.\"O and protocol addresses. +.\"O The cache has a limited size so old and less +.\"O frequently used entries are garbage-collected. +.\"O Entries which are marked +.\"O as permanent are never deleted by the garbage-collector. +.\"O The cache can +.\"O be directly manipulated by the use of ioctls and its behavior can be +.\"O tuned by the +.\"O .I /proc +.\"O interfaces described below. +ARP ¥â¥¸¥å¡¼¥ë¤Ï¥Ï¡¼¥É¥¦¥§¥¢¥¢¥É¥ì¥¹¤«¤é¥×¥í¥È¥³¥ë¥¢¥É¥ì¥¹¤Ø¤Î +¥Þ¥Ã¥Ô¥ó¥°¤Î¥­¥ã¥Ã¥·¥å¤ò´ÉÍý¤¹¤ë¡£¥­¥ã¥Ã¥·¥å¤ÎÂ礭¤µ¤Ë¤ÏÀ©¸Â¤¬ +¤¢¤ë¤Î¤Ç¡¢¸Å¤¤¥¨¥ó¥È¥ê¤äÍøÍѤµ¤ì¤Ê¤¤¥¨¥ó¥È¥ê¤Ï¥¬¥Ù¡¼¥¸¥³¥ì¥¯¥È +¤µ¤ì¤ë¡£ permanent (Êݸ) ¥Þ¡¼¥¯¤¬¤Ä¤±¤é¤ì¤¿¥¨¥ó¥È¥ê¤Ï¡¢ +·è¤·¤Æ¥¬¥Ù¡¼¥¸¥³¥ì¥¯¥¿¤Ë¤è¤Ã¤Æ¾Ãµî¤µ¤ì¤Ê¤¤¡£ +ioctl ¤òÍѤ¤¤ì¤Ð¥­¥ã¥Ã¥·¥å¤òľÀÜÁàºî¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤Þ¤¿¸å½Ò¤Î +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë¤è¤ê¥­¥ã¥Ã¥·¥å¤Î¿¶¤ëÉñ¤¤¤òÄ´À°¤Ç¤­¤ë¡£ +.PP +.\"O When there is no positive feedback for an existing mapping after some +.\"O time (see the +.\"O .I /proc +.\"O interfaces below), a neighbor cache entry is considered stale. +.\"O Positive feedback can be gotten from a higher layer; for example from +.\"O a successful TCP ACK. +.\"O Other protocols can signal forward progress +.\"O using the +.\"O .B MSG_CONFIRM +.\"O flag to +.\"O .BR sendmsg (2). +.\"O When there is no forward progress, ARP tries to reprobe. +.\"O It first tries to ask a local arp daemon +.\"O .B app_solicit +.\"O times for an updated MAC address. +.\"O If that fails and an old MAC address is known, an unicast probe is send +.\"O .B ucast_solicit +.\"O times. +.\"O If that fails too, it will broadcast a new ARP +.\"O request to the network. +.\"O Requests are only sent when there is data queued +.\"O for sending. +¸ºß¤·¤Æ¤¤¤ë¥Þ¥Ã¥Ô¥ó¥°¤ËÂФ·¤Æ¡¢ +Àµ¤Î¥Õ¥£¡¼¥É¥Ð¥Ã¥¯¤¬°ìÄê»þ´Ö¤Ê¤¤ (¸å½Ò¤Î +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¸«¤è) ¤È¡¢ +¶á˵¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê (neighbor cache entry) ¤Ï +¸Å¤¯¤Ê¤Ã¤¿ (stale) ¤È¤ß¤Ê¤µ¤ì¤ë¡£ +Àµ¤Î¥Õ¥£¡¼¥É¥Ð¥Ã¥¯¤Ï¹â°Ì¤Î¥ì¥¤¥ä¡¼¤«¤é¤â¼èÆÀ¤Ç¤­¤ë +(Î㤨¤Ð TCP ACK ¤¬À®¸ù¤·¤¿¾ì¹ç¤Ê¤É)¡£ +¾¤Î¥×¥í¥È¥³¥ë¤Ï¡¢ +.BR sendmsg (2) +¤Ë +.B MSG_CONFIRM +¥Õ¥é¥°¤òÍѤ¤¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢ +¥Õ¥©¥ï¡¼¥É¥×¥í¥°¥ì¥¹ (forward progress) ¤ò¥·¥°¥Ê¥ë¤Ç¤­¤ë¡£ +¥Õ¥©¥ï¡¼¥É¥×¥í¥°¥ì¥¹¤¬¤Ê¤±¤ì¤Ð¡¢ +ARP ¤ÏºÆ¤Ó¥×¥í¡¼¥Ö¤ò»î¤ß¤ë¡£ +¤Þ¤º¥í¡¼¥«¥ë¤Ê arp ¥Ç¡¼¥â¥ó¤ËÌä¹ç¤ï¤»¤ò¹Ô¤¤¡¢ +¹¹¿·¤µ¤ì¤¿ MAC ¥¢¥É¥ì¥¹¤ò¼èÆÀ¤·¤è¤¦¤È¤¹¤ë¡£ +¤³¤Î¥ê¥¯¥¨¥¹¥È¤Ë +.B app_solicit +²ó¼ºÇÔ¤¹¤ë¤È¡¢¸Å¤¤ MAC ¥¢¥É¥ì¥¹¤¬¤ï¤«¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +unicast ¤Î¥×¥í¡¼¥Ö¤¬ +.B ucaset_solicit +²óÁ÷¤é¤ì¤ë¡£¤³¤ì¤Ë¤â¼ºÇÔ¤¹¤ë¤È¡¢¿·¤·¤¤ ARP ¥ê¥¯¥¨¥¹¥È +¤ò¥Í¥Ã¥È¥ï¡¼¥¯¤Ë¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤¹¤ë¡£ +¥ê¥¯¥¨¥¹¥È¤Ï¡¢¥Ç¡¼¥¿¤¬Á÷¿®¥­¥å¡¼¤Ë¤Ê¤±¤ì¤ÐÁ÷¤é¤ì¤Ê¤¤¡£ +.PP +.\"O Linux will automatically add a nonpermanent proxy arp entry when it +.\"O receives a request for an address it forwards to and proxy arp is +.\"O enabled on the receiving interface. +.\"O When there is a reject route for the target, no proxy arp entry is added. +Linux ¤Ï¡¢¤¢¤ë¥¢¥É¥ì¥¹¤Ø¤Î¥ê¥¯¥¨¥¹¥È¤ò¼õ¿®¡¦¥Õ¥©¥ï¡¼¥É¤·¡¢ +¼õ¿®¤·¤¿¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÇÂåÍý arp ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¼«Æ°Åª¤Ë¤½¤Î¥¢¥É¥ì¥¹¤ò nonpermanent ¤ÊÂåÍý arp ¥¨¥ó¥È¥ê¤ËÄɲ乤롣 +¤½¤Î¥¿¡¼¥²¥Ã¥È¤Ë reject route ¤¬¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +ÂåÍý arp ¥¨¥ó¥È¥ê¤Ï°ìÀÚÄɲ䵤ì¤Ê¤¤¡£ +.\"O .SS Ioctls +.SS ioctl +.\"O Three ioctls are available on all +.\"O .B AF_INET +.\"O sockets. +.\"O They take a pointer to a +.\"O .I struct arpreq +.\"O as their argument. +¤¹¤Ù¤Æ¤Î +.B AF_INET +¥½¥±¥Ã¥È¤Ç¤Ï¡¢ 3 ¤Ä¤Î ioctl ¤¬»ÈÍѤǤ­¤ë¡£ +¤³¤ì¤é¤Ï +.I struct arpreq +¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò°ú¿ô¤Ë¼è¤ë¡£ + +.in +4n +.nf +struct arpreq { + struct sockaddr arp_pa; /* protocol address */ + struct sockaddr arp_ha; /* hardware address */ + int arp_flags; /* flags */ + struct sockaddr arp_netmask; /* netmask of protocol address */ + char arp_dev[16]; +}; +.fi +.in + +.\"O .BR SIOCSARP ", " SIOCDARP " and " SIOCGARP +.\"O respectively set, delete and get an ARP mapping. +.\"O Setting and deleting ARP maps are privileged operations and may +.\"O only be performed by a process with the +.\"O .B CAP_NET_ADMIN +.\"O capability or an effective UID of 0. +.BR SIOCSARP ", " SIOCDARP ", " SIOCGARP +¤Ï¡¢¤½¤ì¤¾¤ì ARP ¥Þ¥Ã¥Ô¥ó¥°¤òÀßÄꡦºï½ü¡¦¼èÆÀ¤¹¤ë¡£ +ARP ¥Þ¥Ã¥×¤ÎÀßÄê¤Èºï½ü¤ÏÆø¢¤¬É¬ÍפÊÁàºî¤Ç¤¢¤ê¡¢ +.B CAP_NET_ADMIN +¸¢¸Â¤ò»ý¤Ä¥×¥í¥»¥¹¤«¡¢¼Â¹Ô¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹ +¤Ç¤Ê¤±¤ì¤Ð¼Â¹Ô¤Ç¤­¤Ê¤¤¡£ +.PP +.\"O .I arp_pa +.\"O must be an +.\"O .B AF_INET +.\"O socket and +.\"O .I arp_ha +.\"O must have the same type as the device which is specified in +.\"O .IR arp_dev . +.\"O .I arp_dev +.\"O is a zero-terminated string which names a device. +.I arp_pa +¤Ï +.B AF_INET +¥½¥±¥Ã¥È¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +.I arp_ha +¤Ï +.I arp_dev +¤ÇÀßÄꤵ¤ì¤¿¥Ç¥Ð¥¤¥¹¤ÈƱ¤¸¥¿¥¤¥×¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I arp_dev +¤Ï¥Ç¥Ð¥¤¥¹¤Î̾Á°¤ò¼¨¤¹¡¢¥¼¥í¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +.RS +.TS +tab(:) allbox; +c s +l l. +\fIarp_flags\fR +.\"O flag:meaning +.\"O ATF_COM:Lookup complete +.\"O ATF_PERM:Permanent entry +.\"O ATF_PUBL:Publish entry +.\"O ATF_USETRAILERS:Trailers requested +.\"O ATF_NETMASK:Use a netmask +.\"O ATF_DONTPUB:Don't answer +¥Õ¥é¥°:°ÕÌ£ +ATF_COM:»²¾È´°Î» +ATF_PERM:¥¨¥ó¥È¥ê¤ò peramanent ¤Ë¤¹¤ë +ATF_PUBL:¥¨¥ó¥È¥ê¤ò publish ¤¹¤ë +ATF_USETRAILERS:trailer ¤¬É¬Í× +ATF_NETMASK:netmask ¤òÍѤ¤¤ë +ATF_DONTPUB:²óÅú¤·¤Ê¤¤ +.TE +.RE + +.PP +.\"O If the +.\"O .B ATF_NETMASK +.\"O flag is set, then +.\"O .I arp_netmask +.\"O should be valid. +.\"O Linux 2.2 does not support proxy network ARP entries, so this +.\"O should be set to 0xffffffff, or 0 to remove an existing proxy arp entry. +.\"O .B ATF_USETRAILERS +.\"O is obsolete and should not be used. +.B ATF_NETMASK +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ë¤Ï¡¢ +.I arp_netmask +¤¬Í­¸ú¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Linux 2.2 ¤ÏÂåÍý¥Í¥Ã¥È¥ï¡¼¥¯ ARP ¥¨¥ó¥È¥ê¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢ +¤³¤ì¤Ï 0xffffffff ¤Ë¥»¥Ã¥È¤·¤Æ¤ª¤¯¤«¡¢¤¢¤ë¤¤¤Ï +¸½Â¸¤ÎÂåÍý arp ¥¨¥ó¥È¥ê¤òºï½ü¤·¤¿¤¤¾ì¹ç¤Ë¤Ï 0 ¤Ë¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +.B ATF_USETRAILERS +¤Ï obsolete ¤Ê¤Î¤Ç¡¢ÍѤ¤¤ë¤Ù¤­¤Ç¤Ê¤¤¡£ +.\"O .SS /proc interfaces +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.\"O ARP supports a range of +.\"O .I /proc +.\"O interfaces to configure parameters on a global or per-interface basis. +.\"O The interfaces can be accessed by reading or writing the +.\"O .I /proc/sys/net/ipv4/neigh/*/* +.\"O files. +.\"O Each interface in the system has its own directory in +.\"O .IR /proc/sys/net/ipv4/neigh/ . +.\"O The setting in the "default" directory is used for all newly created +.\"O devices. +.\"O Unless otherwise specified, time-related sysctls are specified +.\"O in seconds. +ARP ¤Ç¤Ï¡¢¥°¥í¡¼¥Ð¥ë¤Ê¥Ñ¥é¥á¡¼¥¿¤ä¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤´¤È¤Î¥Ñ¥é¥á¡¼¥¿¤ò +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ̤·¤ÆÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë¤Ï¡¢ +.I proc/sys/net/ipv4/neigh/*/* +¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¤Ë¤è¤ê¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +¥·¥¹¥Æ¥à¤Ë¤¢¤ë¤½¤ì¤¾¤ì¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤Ï¡¢ +¤½¤ì¤¾¤ìÂбþ¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤¬ +.I /proc/sys/net/ipv4/neigh/ +°Ê²¼¤Ë¤¢¤ë¡£ +"default" ¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤ÆÀßÄê¤ò¤¹¤ë¤È¡¢ +¤½¤ì°Ê¹ßÀ¸À®¤µ¤ì¤ë¥Ç¥Ð¥¤¥¹Á´¤Æ¤ËÂФ·¤Æ¤½¤ÎÀßÄ꤬ÍѤ¤¤é¤ì¤ë¡£ +Æä˻ØÄ꤬¤Ê¤±¤ì¤Ð¡¢»þ´Ö¤Ë´Ø¤ë sysctl ¤Îñ°Ì¤ÏÉäǤ¢¤ë¡£ +.TP +.\"O .IR anycast_delay " (since Linux 2.2)" +.IR anycast_delay " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O The maximum number of jiffies to delay before replying to a +.\"O IPv6 neighbor solicitation message. +.\"O Anycast support is not yet implemented. +.\"O Defaults to 1 second. +IPv6 ¤Î¶á˵Í×ÀÁ¥á¥Ã¥»¡¼¥¸ (neighbor soliciation message) +¤Ë±þÅú¤¹¤ë¤Þ¤Ç¤ÎºÇÂçÃÙ±ä»þ´Ö (jiffy ñ°Ì)¡£ +anycast ¤Î¥µ¥Ý¡¼¥È¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 1 Éᣠ+.TP +.\"O .IR app_solicit " (since Linux 2.2)" +.IR app_solicit " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O The maximum number of probes to send to the user space ARP daemon via +.\"O netlink before dropping back to multicast probes (see +.\"O .IR mcast_solicit ). +.\"O Defaults to 0. +¥æ¡¼¥¶¡¼¶õ´Ö¤Î ARP ¥Ç¡¼¥â¥ó¤Ë netlink ¤òÍѤ¤¤Æõº÷¤µ¤»¤ëºÇÂç²ó¿ô¡£ +¤³¤ì¤ò±Û¤¨¤ë¤È¥Þ¥ë¥Á¥­¥ã¥¹¥È¤Ë¤è¤ëõº÷¤Ë°Ü¹Ô¤¹¤ë +.RI ( mcast_solicit +¤ò¸«¤è)¡£ +.TP +.\"O .IR base_reachable_time " (since Linux 2.2)" +.IR base_reachable_time " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O Once a neighbor has been found, the entry is considered to be valid +.\"O for at least a random value between +.\"O .IR base_reachable_time "/2 and 3*" base_reachable_time /2. +.\"O An entry's validity will be extended if it receives positive feedback +.\"O from higher level protocols. +.\"O Defaults to 30 seconds. +¶á˵¤Î¥Û¥¹¥È¤¬¤ß¤Ä¤«¤ë¤È¡¢¤½¤Î¥¨¥ó¥È¥ê¤Ï +.IR base_reachable_time "/2 ¤«¤é 3*" base_reachable_time /2 +¤Î´Ö¤Î¥é¥ó¥À¥à¤ÊÃͤλþ´Ö¡¢Í­¸ú¤Ç¤¢¤ë¤È¤ß¤Ê¤µ¤ì¤ë¡£ +¥¨¥ó¥È¥ê¤ÎÍ­¸úÀ­¤Ï¡¢¹â°Ì¤Î¥×¥í¥È¥³¥ë¤«¤é¥Ý¥¸¥Æ¥£¥Ö¤Ê¥Õ¥£¡¼¥É¥Ð¥Ã¥¯¤ò +¼õ¤±¼è¤ë¤È±äŤµ¤ì¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ï 30 Éᣠ+.\"O This file is now obsolete in favor of +.\"O .IR base_reachable_time_ms . +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¸½ºß¤ÏÈó¿ä¾©¤Ç¤¢¤ê¡¢Âå¤ï¤ê¤Ë +.I base_reachable_time_ms +¤ò»È¤¦¤³¤È¡£ +.TP +.\"O .IR base_reachable_time_ms " (since Linux 2.6.12)" +.IR base_reachable_time_ms " (Linux 2.6.12 °Ê¹ß)" +.\"O As for +.\"O .IR base_reachable_time , +.\"O but measures time in milliseconds. +.\"O Defaults to 30000 milliseconds. +.I base_reachable_time +¤ÈƱ¤¸¤À¤¬¡¢»þ´Ö¤ò¥ß¥êÉÃñ°Ì¤Ç¬¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 30000 ¥ß¥êÉäǤ¢¤ë¡£ +.TP +.\"O .IR delay_first_probe_time " (since Linux 2.2)" +.IR delay_first_probe_time " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O Delay before first probe after it has been decided that a neighbor +.\"O is stale. +.\"O Defaults to 5 seconds. +¶á˵¥Û¥¹¥È¤Î¥¨¥ó¥È¥ê¤¬¸Å¤¯¤Ê¤Ã¤¿¤ÈȽÃǤµ¤ì¤¿¸å¤Ë +ºÇ½é¤Ëõº÷¤ò¹Ô¤¦¤Þ¤Ç¤ÎÃÙ±ä»þ´Ö¡£¥Ç¥Õ¥©¥ë¥È¤Ï 5 Éᣠ+.TP +.\"O .IR gc_interval " (since Linux 2.2)" +.IR gc_interval " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O How frequently the garbage collector for neighbor entries +.\"O should attempt to run. +.\"O Defaults to 30 seconds. +¥¬¥Ù¡¼¥¸¡¦¥³¥ì¥¯¥¿¤ò¶á˵¥Û¥¹¥È¥¨¥ó¥È¥ê¤ËÂФ·¤Æ¼Â¹Ô¤µ¤»¤ëÉÑÅÙ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 30 Éᣠ+.TP +.\"O .IR gc_stale_time " (since Linux 2.2)" +.IR gc_stale_time " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O Determines how often to check for stale neighbor entries. +.\"O When a neighbor entry is considered stale, it is resolved again before +.\"O sending data to it. +.\"O Defaults to 60 seconds. +¸Å¤¯¤Ê¤Ã¤¿¶á˵¥Û¥¹¥È¥¨¥ó¥È¥ê¤ËÂФ·¤Æ¥Á¥§¥Ã¥¯¤ò¹Ô¤¦ÉÑÅÙ¡£ +¶á˵¥Û¥¹¥È¥¨¥ó¥È¥ê¤¬¸Å¤¯¤Ê¤Ã¤¿¤È¤ß¤Ê¤µ¤ì¤ë¤È¡¢¤½¤Î¥¨¥ó¥È¥ê¤Ë +¥Ç¡¼¥¿¤òÁ÷¤ëÁ°¤Ë¤ÏºÆÅÙ²ò·è¤¬¹Ô¤ï¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 60 Éᣠ+.TP +.\"O .IR gc_thresh1 " (since Linux 2.2)" +.IR gc_thresh1 " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O The minimum number of entries to keep in the ARP cache. +.\"O The garbage collector will not run if there are fewer than +.\"O this number of entries in the cache. +.\"O Defaults to 128. +ARP ¥­¥ã¥Ã¥·¥å¤ËÊݸ¤¹¤ë¥¨¥ó¥È¥ê¿ô¤ÎºÇ¾®ÃÍ¡£ +¤³¤Î¿ô¤è¤ê¾¯¤Ê¤¤¥¨¥ó¥È¥ê¤·¤«¥­¥ã¥Ã¥·¥å¤Ë¤Ê¤±¤ì¤Ð¡¢ +¥¬¥Ù¡¼¥¸¡¦¥³¥ì¥¯¥¿¤Ï¼Â¹Ô¤µ¤ì¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 128¡£ +.TP +.\"O .IR gc_thresh2 " (since Linux 2.2)" +.IR gc_thresh2 " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O The soft maximum number of entries to keep in the ARP cache. +.\"O The garbage collector will allow the number of entries to exceed +.\"O this for 5 seconds before collection will be performed. +.\"O Defaults to 512. +ARP ¥­¥ã¥Ã¥·¥å¤ËÊݸ¤µ¤ì¤ë¥¨¥ó¥È¥ê¿ô¤Î¥½¥Õ¥È¤ÊºÇÂçÃÍ¡£ +¥­¥ã¥Ã¥·¥å¤Î¥¨¥ó¥È¥ê¤¬¤³¤Î¿ô¤ò 5 Éôֱۤ¨¤Ä¤Å¤±¤ë¤È¡¢ +¥¬¥Ù¡¼¥¸¡¦¥³¥ì¥¯¥¿¤¬¼Â¹Ô¤µ¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 512¡£ +.TP +.\"O .IR gc_thresh3 " (since Linux 2.2)" +.IR gc_thresh3 " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O The hard maximum number of entries to keep in the ARP cache. +.\"O The garbage collector will always run if there are more than +.\"O this number of entries in the cache. +.\"O Defaults to 1024. +ARP ¥­¥ã¥Ã¥·¥å¤ËÊݸ¤µ¤ì¤ë¥¨¥ó¥È¥ê¿ô¤Î¥Ï¡¼¥É¤ÊºÇÂçÃÍ¡£ +¥­¥ã¥Ã¥·¥å¤Î¥¨¥ó¥È¥ê¤¬¤³¤Î¿ô¤ò±Û¤¨¤ë¤È¡¢ +¥¬¥Ù¡¼¥¸¡¦¥³¥ì¥¯¥¿¤Ï¤¿¤À¤Á¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 1024¡£ +.TP +.\"O .IR locktime " (since Linux 2.2)" +.IR locktime " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O The minimum number of jiffies to keep an ARP entry in the cache. +.\"O This prevents ARP cache thrashing if there is more than one potential +.\"O mapping (generally due to network misconfiguration). +.\"O Defaults to 1 second. +ARP ¥¨¥ó¥È¥ê¤ò¥­¥ã¥Ã¥·¥å¤ËÊݸ¤¹¤ë»þ´Ö¤ÎºÇ¾®ÃÍ (jiffy ñ°Ì)¡£ +²ÄǽÀ­¤Î¤¢¤ë¥Þ¥Ã¥Ô¥ó¥°¤¬°ì¤Ä°Ê¾å¤¢¤ë (¤¿¤¤¤Æ¤¤¤Ï¥Í¥Ã¥È¥ï¡¼¥¯ÀßÄê¤Î¥ß¥¹) +¾ì¹ç¤Ë¡¢ ARP ¥­¥ã¥Ã¥·¥å¤Î¥¹¥é¥Ã¥·¥ó¥°¤¬µ¯¤­¤ë¤³¤È¤òËɤ°¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 1 Éᣠ+.TP +.\"O .IR mcast_solicit " (since Linux 2.2)" +.IR mcast_solicit " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O The maximum number of attempts to resolve an address by +.\"O multicast/broadcast before marking the entry as unreachable. +.\"O Defaults to 3. +¥¨¥ó¥È¥ê¤ò unreachable ¥Þ¡¼¥¯¤¹¤ëÁ°¤Ë¡¢ +¥¢¥É¥ì¥¹¤ò¥Þ¥ë¥Á¥­¥ã¥¹¥È/¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤Ç²ò·è¤·¤è¤¦¤È¤¹¤ë +»î¹Ô²ó¿ô¤ÎºÇÂçÃÍ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 3¡£ +.TP +.\"O .IR proxy_delay " (since Linux 2.2)" +.IR proxy_delay " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O When an ARP request for a known proxy-ARP address is received, delay up to +.\"O .I proxy_delay +.\"O jiffies before replying. +.\"O This is used to prevent network flooding in some cases. +.\"O Defaults to 0.8 seconds. +´ûÃΤÎÂåÍý ARP ¥¢¥É¥ì¥¹¤ËÂФ·¤Æ ARP ¥ê¥¯¥¨¥¹¥È¤ò¼õ¿®¤·¤¿¾ì¹ç¤Ë¡¢ +±þÅúÁ°¤ËºÇÂç +.I proxy_delay +jiffy ¤Þ¤ÇÃٱ䤹¤ë¡£¤³¤ì¤Ï¾ì¹ç¤Ë¤è¤Ã¤ÆÀ¸¤¸¤ë +¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥Õ¥é¥Ã¥Ç¥£¥ó¥° (network flooding) ¤òÈò¤±¤ë¤¿¤á¤ËÍѤ¤¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 0.8 Éᣠ+.TP +.\"O .IR proxy_qlen " (since Linux 2.2)" +.IR proxy_qlen " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O The maximum number of packets which may be queued to proxy-ARP addresses. +.\"O Defaults to 64. +ÂåÍý ARP ¥¢¥É¥ì¥¹¤ËÂФ·¤Æ¥­¥å¡¼¥¤¥ó¥°¤Ç¤­¤ëºÇÂç¤Î¥Ñ¥±¥Ã¥È¿ô¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 64¡£ +.TP +.\"O .IR retrans_time " (since Linux 2.2)" +.IR retrans_time " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O The number of jiffies to delay before retransmitting a request. +.\"O Defaults to 1 second. +.\"O This file is now obsolete in favor of +.\"O .IR retrans_time_ms . +¥ê¥¯¥¨¥¹¥È¤òºÆÅÙÁ÷¤ë¤Þ¤Ç¤ÎÃÙ±ä»þ´Ö (jiffy ñ°Ì)¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 1 Éᣠ+¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¸½ºß¤ÏÈó¿ä¾©¤Ç¤¢¤ê¡¢Âå¤ï¤ê¤Ë +.I retrans_time_ms +¤ò»È¤¦¤³¤È¡£ +.TP +.\"O .IR retrans_time_ms " (since Linux 2.6.12)" +.IR retrans_time_ms " (Linux 2.6.12 °Ê¹ß)" +.\"O The number of milliseconds to delay before retransmitting a request. +.\"O Defaults to 1000 milliseconds. +¥ê¥¯¥¨¥¹¥È¤òºÆÅÙÁ÷¤ë¤Þ¤Ç¤ÎÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì)¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 1000 ¥ß¥êÉᣠ+.TP +.\"O .IR ucast_solicit " (since Linux 2.2)" +.IR ucast_solicit " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O The maximum number of attempts to send unicast probes before asking +.\"O the ARP daemon (see +.\"O .IR app_solicit ). +.\"O Defaults to 3. +ARP ¥Ç¡¼¥â¥ó¤Ø¤ÎÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦Á°¤Ë¹Ô¤¦ unicast õº÷¤ÎºÇÂç»î¹Ô¿ô +.RI ( app_solicit +¤ò¸«¤è)¡£¥Ç¥Õ¥©¥ë¥È¤Ï 3¡£ +.TP +.\"O .IR unres_qlen " (since Linux 2.2)" +.IR unres_qlen " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +.\"O The maximum number of packets which may be queued for each unresolved +.\"O address by other network layers. +.\"O Defaults to 3. +²ò·è¤µ¤ì¤Æ¤¤¤Ê¤¤¥¢¥É¥ì¥¹¤ËÂФ·¤Æ¡¢ +¾¤Î¥Í¥Ã¥È¥ï¡¼¥¯Áؤ«¤é¥­¥å¡¼¥¤¥ó¥°¤Ç¤­¤ëºÇÂç¥Ñ¥±¥Ã¥È¿ô¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 3¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The +.\"O .I struct arpreq +.\"O changed in Linux 2.0 to include the +.\"O .I arp_dev +.\"O member and the ioctl numbers changed at the same time. +.\"O Support for the old ioctls was dropped in Linux 2.2. +Linux 2.0 ¤Ç¡¢ +.I struct arpreq +¤Ë +.I arp_dev +¥á¥ó¥Ð¡¼¤¬´Þ¤Þ¤ì¤ë¤è¤¦¤ËÊѹ¹¤¬¤¢¤Ã¤¿¡£¤Þ¤¿Æ±»þ¤Ë +ioctl ÈÖ¹æ¤âÊѹ¹¤µ¤ì¤¿¡£¸Å¤¤ ioctl ¤Ï +Linux 2.2 ¤ÇÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¯¤Ê¤Ã¤¿¡£ + +.\"O Support for proxy arp entries for networks (netmask not equal 0xffffffff) +.\"O was dropped in Linux 2.2. +.\"O It is replaced by automatic proxy arp setup by +.\"O the kernel for all reachable hosts on other interfaces (when +.\"O forwarding and proxy arp is enabled for the interface). +¥Í¥Ã¥È¥ï¡¼¥¯¤ËÂФ¹¤ëÂåÍý arp ¥¨¥ó¥È¥ê (netmask ¤¬ 0xffffffff ¤Ç¤Ê¤¤) +¤Ï¡¢ Linux 2.2 ¤ÇÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¯¤Ê¤Ã¤¿¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡¢Ê̤Υ¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤ª¤±¤ë +Åþã²Äǽ¤Ê¤¹¤Ù¤Æ¤Î¥Û¥¹¥È¤ËÂФ¹¤ë¼«Æ°ÂåÍý arp ¤Ë¤è¤Ã¤ÆÃÖ¤­´¹¤¨¤é¤ì¤¿ +(¤½¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¥Õ¥©¥ï¡¼¥Ç¥£¥ó¥°¤ÈÂåÍý arp ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç)¡£ + +.\"O The +.\"O .I neigh/* +.\"O interfaces did not exist before Linux 2.2. +.I neigh/* +¤Î³Æ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï Linux 2.2 °ÊÁ°¤Ë¤Ï¸ºß¤·¤Ê¤¤¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Some timer settings are specified in jiffies, which is architecture- +.\"O and kernel version-dependent; see +.\"O .BR time (7). +¤¤¤¯¤Ä¤«¤Î¥¿¥¤¥Þ¡¼ÀßÄê¤Ï jiffy ¤Ç»ØÄꤵ¤ì¤ë¤¬¡¢ +jiffy ¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ä¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë°Í¸¤¹¤ë¡£ +.BR time (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O There is no way to signal positive feedback from user space. +.\"O This means connection-oriented protocols implemented in user space +.\"O will generate excessive ARP traffic, because ndisc will regularly +.\"O reprobe the MAC address. +.\"O The same problem applies for some kernel protocols (e.g., NFS over UDP). +¥æ¡¼¥¶¡¼¶õ´Ö¤«¤é¥Ý¥¸¥Æ¥£¥Ö¤Ê¥Õ¥£¡¼¥É¥Ð¥Ã¥¯¤òÁ÷¤ëÊýË¡¤¬Â¸ºß¤·¤Ê¤¤¡£ +¤Ä¤Þ¤êÀܳ»Ø¸þ (connection-oriented) ¤Î¥×¥í¥È¥³¥ë¤ò¥æ¡¼¥¶¡¼¶õ´Ö¤Ç +¼ÂÁõ¤¹¤ë¤È¡¢Í¾·×¤Ê ARP ¥È¥é¥Õ¥£¥Ã¥¯¤Î¸¶°ø¤È¤Ê¤ë¡£ +¤Ê¤¼¤Ê¤é ndisc ¤ÏÄê´üŪ¤Ë MAC ¥¢¥É¥ì¥¹¤òºÆõº÷¤¹¤ë¤«¤é¤Ç¤¢¤ë¡£ +ƱÍͤÎÌäÂê¤Ï¤¤¤¯¤Ä¤«¤Î¥«¡¼¥Í¥ë¥×¥í¥È¥³¥ë (NFS over UDP ¤Ê¤É) ¤Ë¤â¸ºß¤¹¤ë¡£ +.PP +.\"O This man page mashes IPv4 specific and shared between IPv4 and IPv6 +.\"O functionality together. +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ï IPv4 ÆÃÍ­¤Îµ¡Ç½¤È +IPv4¡¦IPv6 ¤Ç¶¦Í­¤µ¤ì¤ëµ¡Ç½¤È¤¬¤´¤Ã¤Á¤ã¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR capabilities (7), +.BR ip (7) +.PP +.\"O RFC\ 826 for a description of ARP. +.BR RFC\ 826 : +ARP ¤Ë´Ø¤¹¤ëÀâÌÀ +.br +.\"O RFC\ 2461 for a description of IPv6 neighbor discovery and the base +.\"O algorithms used. +.BR RFC\ 2461 : +IPv6 neighbor discovery ¤Ë´Ø¤¹¤ëÀâÌÀ¤È¡¢ +ÍøÍѤµ¤ì¤Æ¤¤¤ë´ðÁÃ¥¢¥ë¥´¥ê¥º¥à +.LP +.\"O Linux 2.2+ IPv4 ARP uses the IPv6 algorithms when applicable. +Linux 2.2 °Ê¹ß¤Î IPv4 ARP ¤Ï¡¢ +²Äǽ¤Ê¾ì¹ç¤Ï IPv6 ¤Î¥¢¥ë¥´¥ê¥º¥à¤òÍѤ¤¤ë¡£ diff --git a/draft/man7/ascii.7 b/draft/man7/ascii.7 new file mode 100644 index 00000000..1dd2d5c1 --- /dev/null +++ b/draft/man7/ascii.7 @@ -0,0 +1,263 @@ +'\" t +.\" Copyright (c) 1993 Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de) +.\" Created Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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. +.\" +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1994-05-15 by Daniel Quinlan (quinlan@yggdrasil.com) +.\" Modified 1994-11-22 by Daniel Quinlan (quinlan@yggdrasil.com) +.\" Modified 1995-07-11 by Daniel Quinlan (quinlan@yggdrasil.com) +.\" Modified 1996-12-18 by Michael Haardt and aeb +.\" Modified 1999-05-31 by Dimitri Papadopoulos (dpo@club-internet.fr) +.\" 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 +.SH ̾Á° +.\"O ascii \- the 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 ¥Ó¥Ã¥È¤Î¥³¡¼¥É¤Ç¤Ï²¼È¾Ê¬¤Ë +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 \{\ +.in 1i +.ft CW +\} +.TS +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 +004 4 04 EOT (žÁ÷½ªÎ») 104 68 44 D +005 5 05 ENQ (Ì䤤¹ç¤ï¤») 105 69 45 E +006 6 06 ACK (¹ÎÄê±þÅú) 106 70 46 F +007 7 07 BEL \(aq\ea\(aq (¥Ù¥ë) 107 71 47 G +010 8 08 BS \(aq\eb\(aq (¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹) 110 72 48 H +011 9 09 HT \(aq\et\(aq (¿åÊ¿¥¿¥Ö) 111 73 49 I +012 10 0A LF \(aq\en\(aq (²þ¹Ô) 112 74 4A J +013 11 0B VT \(aq\ev\(aq (¿âľ¥¿¥Ö) 113 75 4B K +014 12 0C FF \(aq\ef\(aq (²þ¥Ú¡¼¥¸) 114 76 4C L +015 13 0D CR \(aq\er\(aq (Éüµ¢) 115 77 4D M +016 14 0E SO (¥·¥Õ¥È¥¢¥¦¥È) 116 78 4E N +017 15 0F SI (¥·¥Õ¥È¥¤¥ó) 117 79 4F O +020 16 10 DLE (ÅÁÁ÷À©¸æ³ÈÄ¥) 120 80 50 P +021 17 11 DC1 (ÁõÃÖÀ©¸æ1) 121 81 51 Q +022 18 12 DC2 (ÁõÃÖÀ©¸æ2) 122 82 52 R +023 19 13 DC3 (ÁõÃÖÀ©¸æ3) 123 83 53 S +024 20 14 DC4 (ÁõÃÖÀ©¸æ4) 124 84 54 T +025 21 15 NAK (ÈÝÄê±þÅú) 125 85 55 U +026 22 16 SYN (Ʊ´ü) 126 86 56 V +027 23 17 ETB (žÁ÷¥Ö¥í¥Ã¥¯½ªÎ») 127 87 57 W +030 24 18 CAN (¥­¥ã¥ó¥»¥ë) 130 88 58 X +031 25 19 EM (¥á¥Ç¥£¥¢½ªÎ») 131 89 59 Y +032 26 1A SUB (ÃÖ´¹) 132 90 5A Z +033 27 1B ESC (¥¨¥¹¥±¡¼¥×) 133 91 5B [ +034 28 1C FS (¥Õ¥¡¥¤¥ë¶èÀÚ¤ê) 134 92 5C \e \(aq\e\e\(aq +035 29 1D GS (¥°¥ë¡¼¥×¶èÀÚ¤ê) 135 93 5D ] +036 30 1E RS (¥ì¥³¡¼¥É¶èÀÚ¤ê) 136 94 5E ^ +037 31 1F US (¥æ¥Ë¥Ã¥È¶èÀÚ¤ê) 137 95 5F \&_ +040 32 20 SPACE 140 96 60 \` +041 33 21 ! 141 97 61 a +042 34 22 " 142 98 62 b +043 35 23 # 143 99 63 c +044 36 24 $ 144 100 64 d +045 37 25 % 145 101 65 e +046 38 26 & 146 102 66 f +047 39 27 \' 147 103 67 g +050 40 28 ( 150 104 68 h +051 41 29 ) 151 105 69 i +052 42 2A * 152 106 6A j +053 43 2B + 153 107 6B k +054 44 2C , 154 108 6C l +055 45 2D \- 155 109 6D m +056 46 2E . 156 110 6E n +057 47 2F / 157 111 6F o +060 48 30 0 160 112 70 p +061 49 31 1 161 113 71 q +062 50 32 2 162 114 72 r +063 51 33 3 163 115 73 s +064 52 34 4 164 116 74 t +065 53 35 5 165 117 75 u +066 54 36 6 166 118 76 v +067 55 37 7 167 119 77 w +070 56 38 8 170 120 78 x +071 57 39 9 171 121 79 y +072 58 3A : 172 122 7A z +073 59 3B ; 173 123 7B { +074 60 3C < 174 124 7C | +075 61 3D = 175 125 7D } +076 62 3E > 176 126 7E ~ +077 63 3F ? 177 127 7F DEL +.TE +.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 \{\ +.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 +3: # 3 C S c s 3: ! + 5 ? I S ] g q { +4: $ 4 D T d t 4: " , 6 @ J T ^ h r | +5: % 5 E U e u 5: # \- 7 A K U _ i s } +6: & 6 F V f v 6: $ . 8 B L V \` j t ~ +7: \' 7 G W g w 7: % / 9 C M W a k u DEL +8: ( 8 H X h x 8: & 0 : D N X b l v +9: ) 9 I Y i y 9: \' 1 ; E O Y c m w +A: * : J Z j z +B: + ; K [ k { +C: , < L \e l | +D: \- = M ] m } +E: . > N ^ n ~ +F: / ? O _ o DEL +.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 ¤ÇÅо줷¤¿¡£ +.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 +.\" American National Standards Committee X3 (ANSC-X3) and now it is known +.\" as Accredited Standards Committee X3 (ASC X3). It is accredited by ANSI +.\" and administered by ITI. The subcommittee X3.2 worked on coded +.\" character sets; the task group working on ASCII appears to have been +.\" designated X3.2.4. In 1966, ASA became the United States of America +.\" Standards Institute (USASI) and published ASCII in 1968. It became the +.\" American National Standards Institute (ANSI) in 1969 and is the +.\" U.S. member body of ISO; private and nonprofit. +.\" +.\"O .SH "SEE ALSO" +.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) diff --git a/draft/man7/boot.7 b/draft/man7/boot.7 new file mode 100644 index 00000000..d903834b --- /dev/null +++ b/draft/man7/boot.7 @@ -0,0 +1,382 @@ +.\" Written by Oron Peled . +.\" May be distributed subject to the GPL. +.\" +.\" I tried to be as much generic in the description as possible: +.\" - General boot sequence is applicable to almost any +.\" OS/Machine (DOS/PC, Linux/PC, Solaris/SPARC, CMS/S390) +.\" - kernel and init(8) is applicable to almost any Unix/Linux +.\" - boot scripts are applicable to SYSV-R4 based Unix/Linux +.\" +.\" Modified 2004-11-03 patch from Martin Schulze +.\" +.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. +.\" Translated 2002-08-07, NAKANO Takeo +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" +.TH BOOT 7 2007-06-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O boot-scripts \- General description of boot sequence +.SH ̾Á° +boot-scripts \- ¥Ö¡¼¥È¥·¡¼¥±¥ó¥¹¤Î°ìÈÌŪ¤Ê²òÀâ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .LP +.\"O The boot sequence varies in details among systems +.\"O but can be roughly divided to the following steps: +.\"O (i) hardware boot, (ii) OS loader, +.\"O (iii) kernel startup, (iv) init and inittab, +.\"O (v) boot scripts. +.\"O We will describe each of these in more detail below. +ºÙ¤«¤¤¤È¤³¤í¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¤¬¡¢Âç¤Þ¤«¤Ë¸À¤¦¤È¡¢ +¥Ö¡¼¥È¥·¡¼¥±¥ó¥¹¤Ï°Ê²¼¤ÎÃʳ¬¤Ëʬ¤±¤é¤ì¤ë: +(1) ¥Ï¡¼¥É¥¦¥§¥¢¤Î¥Ö¡¼¥È (2) OS ¥í¡¼¥À¡¼ +(3) ¥«¡¼¥Í¥ë¤Îµ¯Æ° (4) init ¤È inittab +(5) ¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È +.\"O .SS "Hardware-boot" +.SS ¥Ï¡¼¥É¥¦¥§¥¢¤Î¥Ö¡¼¥È +.\"O After power-on or hard reset, control is given +.\"O to a program stored on read-only memory (normally +.\"O PROM). +.\"O In PC we usually call this program the \fBBIOS\fR. +ÅŸ»ÅêÆþ¤ä¥Ï¡¼¥É¥ê¥»¥Ã¥È¤¬¹Ô¤ï¤ì¤ë¤È¡¢ +ROM (Ä̾ï¤Ï PROM) ¤ËÊݸ¤µ¤ì¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤ËÀ©¸æ¤¬ÅϤµ¤ì¤ë¡£ +PC ¤Ç¤Ï¤³¤Î¥×¥í¥°¥é¥à¤ÏÄ̾ï \fBBIOS\fR ¤È¸Æ¤Ð¤ì¤ë¡£ + +.\"O This program normally makes a basic self-test of the +.\"O machine and accesses nonvolatile memory to read +.\"O further parameters. +.\"O This memory in the PC is +.\"O battery-backed CMOS memory, so most people +.\"O refer to it as the \fBCMOS\fR, although outside +.\"O of the PC world, it is usually called \fBnvram\fR +.\"O (nonvolatile ram). +¤Õ¤Ä¤¦¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢¤Þ¤º¥Þ¥·¥ó¤Î´ðËÜŪ¤Ê¼«¸Ê¿ÇÃǤò¹Ô¤¤¡¢ +¤½¤·¤ÆÉÔ´øȯÀ­¥á¥â¥ê¤Ë¥¢¥¯¥»¥¹¤·¤Æ³Æ¼ï¤Î¥Ñ¥é¥á¡¼¥¿¤òÆɤ߹þ¤à¡£ +PC ¤Ç¤Ï¡¢¤³¤Î¥á¥â¥ê¤ÏÅÅÃӤˤè¤Ã¤Æ¥Ð¥Ã¥¯¥¢¥Ã¥×¤µ¤ì¤Æ¤¤¤ë CMOS ¥á¥â¥ê¤Ç¤¢¤ë¡£ +¤½¤Î¤¿¤á \fBCMOS\fR ¤È¸Æ¤Ð¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ +¤·¤«¤· PC °Ê³°¤ÎÀ¤³¦¤Ç¤Ï¡¢Ä̾ï \fBnvram\fR +(nonvolatile ram) ¤È¸Æ¤Ð¤ì¤Æ¤¤¤ë¡£ + +.\"O The parameters stored in the nvram vary between +.\"O systems, but as a minimum, the hardware boot program +.\"O should know what is the boot device, or which devices +.\"O to probe as possible boot devices. +nvram ¤ËÊݸ¤µ¤ì¤Æ¤¤¤ë¥Ñ¥é¥á¡¼¥¿¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +¤·¤«¤·¡¢¥Ï¡¼¥É¥¦¥§¥¢¥Ö¡¼¥È¥×¥í¥°¥é¥à¤Ï¡¢¾¯¤Ê¤¯¤È¤â¡¢ +¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤¬¤É¤ì¤Ç¤¢¤ë¤«¡¢¤â¤·¤¯¤Ï +¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤È¤·¤Æõº÷¤¹¤ë¥Ç¥Ð¥¤¥¹¤¬¤É¤ì¤Ç¤¢¤ë¤«¤ò +ÃΤäƤ¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O Then the hardware boot stage accesses the boot device, +.\"O loads the OS Loader, which is located on a fixed position +.\"O on the boot device, and transfers control to it. +¥Ï¡¼¥É¥¦¥§¥¢¥Ö¡¼¥È¤Î¥·¡¼¥±¥ó¥¹¤Ï¡¢¼¡¤Ë¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤Ë¥¢¥¯¥»¥¹¤·¡¢ +¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤Î¤¢¤é¤«¤¸¤á·è¤Þ¤Ã¤¿¾ì½ê¤ËÃÖ¤«¤ì¤Æ¤¤¤ë +OS ¥í¡¼¥À¡¼¤ò¥í¡¼¥É¤·¡¢À©¸æ¤òÅϤ¹¡£ +.TP +.\"O Note: +.\"O We do not cover here booting from network. +.\"O Those who want +.\"O to investigate this subject may want to research: +.\"O DHCP, TFTP, PXE, Etherboot. +Ãí°Õ: +¤³¤³¤Ç¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ö¡¼¥È¤Ë¤Ä¤¤¤Æ¤Ï¿¨¤ì¤Ê¤¤¡£ +¤³¤ÎÏÃÂê¤Ë¤Ä¤¤¤ÆÄ´ºº¤·¤¿¤¤ÆɼԤϡ¢ +DHCP, TFTP, PXE, Etherboot Åù¤Ë¤Ä¤¤¤ÆÄ´¤Ù¤Æ¤ß¤ë¤È¤è¤¤¡£ +.\"O .SS "OS Loader" +.SS OS ¥í¡¼¥À¡¼ +.\"O In PC, the OS Loader is located in the first sector +.\"O of the boot device \- this is the \fBMBR\fR +.\"O (Master Boot Record). +PC ¤Ç¤Ï¡¢OS ¥í¡¼¥À¡¼¤Ï¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤ÎÀèƬ¥»¥¯¥¿¤ËÃÖ¤«¤ì¤ë¡£ +¤³¤ì¤Ï \fBMBR\fR (Master Boot Record) ¤È¸Æ¤Ð¤ì¤ë¡£ + +.\"O In most systems, this primary loader is very +.\"O limited due to various constraints. +.\"O Even on non-PC systems +.\"O there are some limitations to the size and complexity +.\"O of this loader, but the size limitation of the PC MBR +.\"O (512 bytes including the partition table) makes it +.\"O almost impossible to squeeze a full OS Loader into it. +ÍÍ¡¹¤ÊÀ©Ìó¤Î¤¿¤á¡¢ +¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤ÇÂè°ì¥í¡¼¥À¡¼¤ÏÈó¾ï¤Ë´Êñ¤Êµ¡Ç½¤·¤«»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +PC °Ê³°¤Î¥·¥¹¥Æ¥à¤Ç¤â¡¢ +¥µ¥¤¥º¤ÎÀ©¸Â¤ä¥í¡¼¥À¡¼¤Îµ¡Ç½¤Ê¤É¤Ë¤¢¤ëÄøÅÙ¤ÎÀ©¸Â¤Ï¸ºß¤¹¤ë¡£ +¤·¤«¤·¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤ò´Þ¤á¤Æ 512 ¥Ð¥¤¥È¤È¤¤¤¦ +PC ¤Î MBR ¤Ç¤Ï¡¢OS ¥í¡¼¥À¡¼¤ÎÁ´µ¡Ç½¤ò¤³¤³¤Ë²¡¤·¹þ¤à¤Î¤Ï¤Þ¤ºÉÔ²Äǽ¤À¡£ + +.\"O Therefore, most operating systems make the primary loader +.\"O call a secondary OS loader which may be located on +.\"O a specified disk partition. +¤·¤¿¤¬¤Ã¤ÆÂçÄñ¤Î OS ¤Ç¤Ï¡¢Âè°ì¥í¡¼¥À¡¼¤ÏÂèÆó¥í¡¼¥À¡¼¤ò¸Æ¤Ö¤è¤¦¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +¸å¼Ô¤Ï¤¢¤é¤«¤¸¤á»ØÄꤵ¤ì¤¿¥Ç¥£¥¹¥¯¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ËÃÖ¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ + +.\"O In Linux the OS loader is normally +.\"O .BR lilo (8) +.\"O or +.\"O .BR grub (8). +.\"O Both of them may install either as secondary loaders +.\"O (where the DOS installed MBR points to them), or +.\"O as a two part loader where they provide special MBR +.\"O containing the bootstrap code to load the second part +.\"O of the loader from the root partition. +Linux ¤Ë¤ª¤±¤ë OS ¥í¡¼¥À¡¼¤Ï¡¢¤Õ¤Ä¤¦ +.BR lilo (8) +¤« +.BR grub (8) +¤Ç¤¢¤ë¡£Î¾¼Ô¤È¤âÂèÆó¥í¡¼¥À¡¼¤È¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤â¤Ç¤­ +(¤³¤Î¾ì¹ç DOS ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿ MBR ¤¬¤³¤ì¤é¤ò»Ø¤¹¤è¤¦¤Ë¤¹¤ë)¡¢ +¤Þ¤¿Âè°ì¡¦ÂèÆó¥í¡¼¥À¡¼¤ÎξÊý¤È¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¸å¼Ô¤Î¾ì¹ç¸þ¤±¤Ë¡¢Î¾¼Ô¤ÏÆÃÊÌ¤Ê MBR ¥¤¥á¡¼¥¸¤òÄ󶡤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Ë¤ÏÂèÆó¥í¡¼¥À¡¼¤ò¥ë¡¼¥È¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤«¤é¥í¡¼¥É¤¹¤ë¤è¤¦¤Ê +¥Ö¡¼¥È¥¹¥È¥é¥Ã¥×¥³¡¼¥É¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ + +.\"O The main job of the OS Loader is to locate the kernel +.\"O on the disk, load it and run it. +.\"O Most OS loaders allow +.\"O interactive use, to enable specification of alternative +.\"O kernel (maybe a backup in case the last compiled one +.\"O isn't functioning) and to pass optional parameters +.\"O to the kernel. +OS ¥í¡¼¥À¡¼¤Î¼ç¤Ê»Å»ö¤Ï¡¢¥«¡¼¥Í¥ë¤Î¥Ç¥£¥¹¥¯¾å¤Î°ÌÃÖ¤òÆÃÄꤷ¡¢ +¥í¡¼¥É¤·¤Æµ¯Æ°¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£¤Û¤È¤ó¤É¤Î OS ¥í¡¼¥À¡¼¤Ï¡¢ +ÂÐÏå⡼¥É¤Ç»ÈÍѤ¹¤ë¤³¤È¤â¤Ç¤­¡¢ÄɲäΥѥé¥á¡¼¥¿¤ò¥«¡¼¥Í¥ë¤ËÅϤ·¤¿¤ê¡¢ +¥Ç¥Õ¥©¥ë¥È¤È¤ÏÊ̤Υ«¡¼¥Í¥ë¤ò»ØÄꤷ¤¿¤ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +(Î㤨¤Ð¡¢ºÇ¸å¤Ë¥³¥ó¥Ñ¥¤¥ë¤·¤¿¥«¡¼¥Í¥ë¤¬µ¡Ç½¤·¤Ê¤«¤Ã¤¿»þ¤Ë +¥Ð¥Ã¥¯¥¢¥Ã¥×¤Î¥«¡¼¥Í¥ë¤ò»ØÄꤷ¤Æµ¯Æ°¤¹¤ë¤È¤¤¤Ã¤¿¤³¤È¤¬¤Ç¤­¤ë)¡£ +.\"O .SS "Kernel Startup" +.SS ¥«¡¼¥Í¥ë¤Îµ¯Æ° +.\"O When the kernel is loaded, it initializes the devices (via +.\"O their drivers), starts the swapper (it is a "kernel process", +.\"O called kswapd in modern Linux kernels), and mounts the root +.\"O file system (/). +¥«¡¼¥Í¥ë¤Ï¥í¡¼¥É¤µ¤ì¤ë¤È¡¢¥Ç¥Ð¥¤¥¹¤ò (¥É¥é¥¤¥Ð¤Ë¤è¤Ã¤Æ) +½é´ü²½¤·¡¢¥¹¥ï¥Ã¥Ñ¤òµ¯Æ°¤· (ºÇ¶á¤Î Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¥¹¥ï¥Ã¥Ñ¤Ï kswapd ¤È¤¤¤¦¡Ö¥«¡¼¥Í¥ë¥×¥í¥»¥¹¡×¤Ë¤Ê¤ë)¡¢ +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à (/) ¤ò¥Þ¥¦¥ó¥È¤¹¤ë¡£ + +.\"O Some of the parameters that may be passed to the kernel +.\"O relate to these activities (e.g: You can override the +.\"O default root file system). +.\"O For further information +.\"O on Linux kernel parameters read +.\"O .BR bootparam (7). +¥«¡¼¥Í¥ë¤ËÅϤ¹¤³¤È¤Î¤Ç¤­¤ë¥Ñ¥é¥á¡¼¥¿¤Î¤¤¤¯¤Ä¤«¤Ï¡¢ +¤³¤ì¤é¤ÎÆ°ºî¤Ë´Ø·¸¤¹¤ë¡£ +(Î㤨¤Ð¥Ç¥Õ¥©¥ë¥È¤Î¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë)¡£ +Linux ¥«¡¼¥Í¥ë¥Ñ¥é¥á¡¼¥¿¤Ë´Ø¤¹¤ë¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR bootparam (7) +¤òÆɤó¤Ç¤Û¤·¤¤¡£ + +.\"O Only then the kernel creates the first (user land) +.\"O process which is numbered 1. +.\"O This process executes the +.\"O program +.\"O .IR /sbin/init , +.\"O passing any parameters that weren't handled by the kernel already. +¤³¤ì¤é¤¬ºÑ¤ó¤Ç¤Ï¤¸¤á¤Æ¡¢ +¥«¡¼¥Í¥ë¤ÏºÇ½é¤Î (¥æ¡¼¥¶¥é¥ó¥É¤Î) ¥×¥í¥»¥¹¤òÀ¸À®¤·¡¢ +ÈÖ¹æ 1 ¤òÍ¿¤¨¤ë¡£¤³¤Î¥×¥í¥»¥¹¤Ï +.I /sbin/init +¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¡£ +¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ñ¥é¥á¡¼¥¿¤Ï¤¹¤Ù¤Æ +.I /sbin/init +¤ËÅϤµ¤ì¤ë¡£ +.\"O .SS "init and inittab" +.SS init ¤È inittab +.\"O When init starts it reads +.\"O .I /etc/inittab +.\"O for further instructions. +.\"O This file defines what should be run in different \fIrun-levels\fR. +init ¤Ï¡¢µ¯Æ°¤¹¤ë¤È¤Þ¤º +.I /etc/inittab +¤òÆɤߡ¢¤½¤Î¸å¤Î¹ÔÆ°¤Ë´Ø¤¹¤ë¾ðÊó¤òÆÀ¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï +.I ¥é¥ó¥ì¥Ù¥ë +¤Ë¤è¤Ã¤Æ¤É¤Î¤è¤¦¤ÊÆ°ºî¤ò¹Ô¤¦¤Ù¤­¤Ç¤¢¤ë¤«¤òÄêµÁ¤¹¤ë¡£ + +.\"O This gives the system administrator an easy management scheme, where +.\"O each run-level is associated with a set of services (e.g: +.\"O \fBS\fR is \fIsingle-user\fR, on \fB2\fR most network +.\"O services start, etc.). +.\"O The administrator may change the current +.\"O run-level via +.\"O .BR init (8) +.\"O and query the current run-level via +.\"O .BR runlevel (8). +¤³¤ì¤Ë¤è¤Ã¤Æ¥·¥¹¥Æ¥à´ÉÍý¼Ô¤Î´ÉÍý¤¬³Ú¤Ë¤Ê¤ë¡£ +³Æ\fI¥é¥ó¥ì¥Ù¥ë\fR¤ÏÄ󶡤¹¤ë¥µ¡¼¥Ó¥¹¤Î½¸¹ç¤ËÂбþ¤¹¤ë +(Î㤨¤Ð \fBS\fR ¤Ï \fI¥·¥ó¥°¥ë¥æ¡¼¥¶\fR¡¢ +\fB2\fR ¤Ç¤ÏÂçÄñ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥µ¡¼¥Ó¥¹¤òµ¯Æ°¤¹¤ë¡¢¤Ê¤É)¡£ +¥·¥¹¥Æ¥à´ÉÍý¼Ô¤Ï¡¢ +.BR init (8) +¤òÍѤ¤¤Æ¸½ºß¤Î¥é¥ó¥ì¥Ù¥ë¤òÊѹ¹¤Ç¤­¡¢ +.BR runlevel (8) +¤Ë¤è¤Ã¤Æ¸½ºß¤Î¥é¥ó¥ì¥Ù¥ë¤ò³Îǧ¤Ç¤­¤ë¡£ + +.\"O However, since it is not convenient to manage individual services +.\"O by editing this file, inittab only bootstraps a set of scripts +.\"O that actually start/stop the individual services. +¤·¤«¤·¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤·¤Æ¸Ä¡¹¤Î¥µ¡¼¥Ó¥¹¤ò´ÉÍý¤¹¤ë¤Î¤ÏÉÔÊؤʤΤǡ¢ +inittab ¤Ïñ¤Ë¥¹¥¯¥ê¥×¥È¤Î½¸¹ç¤ËÂФ¹¤ë¥Ö¡¼¥È¥¹¥È¥é¥Ã¥×¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¼ÂºÝ¤Î¸Ä¡¹¤Î¥µ¡¼¥Ó¥¹¤Îµ¯Æ°¤äÄä»ß¤Ï¡¢¤³¤ì¤é¤Î¥¹¥¯¥ê¥×¥È¤Ç¹Ô¤¦¡£ +.\"O .SS "Boot Scripts" +.SS ¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È +.\"O +.TP +.\"O Note: +.\"O The following description applies to System V release 4 based system, which +.\"O currently covers most commercial Unix systems (Solaris, HP-UX, Irix, Tru64) +.\"O as well as the major Linux distributions (RedHat, Debian, Mandrake, +.\"O Suse, Caldera). +.\"O Some systems (Slackware Linux, FreeBSD, OpenBSD) +.\"O have a somewhat different scheme of boot scripts. +Ãí°Õ: +°Ê²¼¤ÎÀâÌÀ¤Ï System V Release 4 ¤ò¥Ù¡¼¥¹¤È¤·¤¿¥·¥¹¥Æ¥à¤Ë´Ø¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¸½ºß¤ÎÂçÄñ¤Î¾¦ÍÑ Unix ¥·¥¹¥Æ¥à (Solaris, HP-UX, Irix, Tru64) ¤ä¡¢ +¥á¥¸¥ã¡¼¤Ê Linux ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó (RedHat, Debian, Mandrake, +Suse, Caldera) ¤Ï¤³¤ì¤ò¥Ù¡¼¥¹¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤Îµ¡¹½¤¬ +¤¤¤¯¤é¤«°Û¤Ê¤ë¤³¤È¤â¤¢¤ë (Slackware Linux, FreeBSD, OpenBSD ¤Ê¤É)¡£ +.LP +.\"O For each managed service (mail, nfs server, cron, etc.) there is +.\"O a single startup script located in a specific directory +.\"O .RI ( /etc/init.d +.\"O in most versions of Linux). +.\"O Each of these scripts accepts as a single argument +.\"O the word "start" \-\- causing it to start the service, or the word +.\"O \&"stop" \-\- causing it to stop the service. +.\"O The script may optionally +.\"O accept other "convenience" parameters (e.g: "restart", to stop and then +.\"O start, "status" do display the service status). +.\"O Running the script +.\"O without parameters displays the possible arguments. +´ÉÍý¤¹¤Ù¤­³Æ¥µ¡¼¥Ó¥¹ (¥á¡¼¥ë¡¢nfs ¥µ¡¼¥Ð¡¢cron ¤Ê¤É¤Ê¤É) +¤½¤ì¤¾¤ì¤ËÂФ·¤Æ¡¢¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤¬¤Ò¤È¤Ä¤º¤ÄÆÃÄê¤Î¥Ç¥£¥ì¥¯¥È¥ê +(¤Û¤È¤ó¤É¤Î Linux ¤Ç +.IR /etc/init.d ) +¤ËÇÛÃÖ¤µ¤ì¤ë¡£¤³¤ì¤é¤Î¥¹¥¯¥ê¥×¥È¤Ï¡¢ +¤½¤ì¤¾¤ì°ú¿ô¤È¤·¤Æ¤Ò¤È¤Ä¤Îñ¸ì¤ò¼è¤ë¡£"start" ¤¬»ØÄꤵ¤ì¤ë¤È +¤½¤Î¥µ¡¼¥Ó¥¹¤òµ¯Æ°¤·¡¢"stop" ¤¬»ØÄꤵ¤ì¤ë¤È¥µ¡¼¥Ó¥¹¤òÄä»ß¤¹¤ë¡£ +¥¹¥¯¥ê¥×¥È¤Ï¾¤Î¡ÖÊØÍø¤Ê¡×°ú¿ô¤ò¼è¤Ã¤Æ¤â¤è¤¤ +(Î㤨¤Ð "restart" ¤ÇÄä»ß¡¦µ¯Æ°¤ò½çÈ֤˹Ԥ俤ꡢ"status" +¤Ç¥µ¡¼¥Ó¥¹¤Î¾õÂÖ¤òɽ¼¨¤¹¤ë¤Ê¤É)¡£ +¥¹¥¯¥ê¥×¥È¤ò°ú¿ô¤Ê¤·¤Ç¼Â¹Ô¤¹¤ë¤È¡¢ +»ØÄê¤Ç¤­¤ë°ú¿ô¤Î°ìÍ÷¤¬É½¼¨¤µ¤ì¤ë¡£ +.\"O .SS "Sequencing Directories" +.SS ½ç½ø¤Å¤±¥Ç¥£¥ì¥¯¥È¥ê +.\"O To make specific scripts start/stop at specific run-levels and in +.\"O specific order, there are \fIsequencing directories\fR. +.\"O These +.\"O are normally in \fI/etc/rc[0\-6S].d\fR. +.\"O In each of these directories +.\"O there are links (usually symbolic) to the scripts in the \fI/etc/init.d\fR +.\"O directory. +¤¢¤ë¥é¥ó¥ì¥Ù¥ë¤Ç¡¢ÆÃÄê¤Î¥¹¥¯¥ê¥×¥È¤ò»ØÄꤷ¤¿½ç½ø¤Ç¼Â¹Ô¤µ¤»¤ë¤¿¤á¡¢ +.I ½ç½øÉÕ¤±¥Ç¥£¥ì¥¯¥È¥ê (sequencing directory) +¤È¤¤¤¦»ÅÁȤߤ¬Â¸ºß¤¹¤ë¡£ +¤³¤ì¤é¤Ï¤Õ¤Ä¤¦ +.I /etc/rc[0\-6S].d +¤Ç¤¢¤ë¡£³Æ¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÉô¤Ë¤Ï¡¢ +.I /etc/init.d +¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤¿¥¹¥¯¥ê¥×¥È¤Ø¤Î¥ê¥ó¥¯ (¤Õ¤Ä¤¦¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯) +¤¬ÃÖ¤«¤ì¤ë¡£ + +.\"O A primary script (usually \fI/etc/rc\fR) is called from +.\"O .BR inittab (5) +.\"O and calls the services scripts via the links in the sequencing directories. +.\"O All links with names that begin with \(aqS\(aq are being called with +.\"O the argument "start" (thereby starting the service). +.\"O All links with +.\"O names that begin with \(aqK\(aq are being called with the argument "stop" +.\"O (thereby stopping the service). +Âè°ì¥¹¥¯¥ê¥×¥È (Ä̾ï +.IR /etc/rc ) +¤Ï +.BR inittab (5) +¤«¤é¸Æ¤Ð¤ì¡¢ +½ç½øÉÕ¤±¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤¿¥ê¥ó¥¯·Ðͳ¤Ç³Æ¥µ¡¼¥Ó¥¹¥¹¥¯¥ê¥×¥È¤ò¸Æ¤Ó½Ð¤¹¡£ +̾Á°¤¬ \(aqS\(aq ¤Ç¤Ï¤¸¤Þ¤ë¥ê¥ó¥¯¤Ï "start" ¤È¤¤¤¦°ú¿ô¤ò¤Ä¤±¤Æ¸Æ¤Ó½Ð¤µ¤ì +(¤¹¤Ê¤ï¤Á¥µ¡¼¥Ó¥¹¤¬µ¯Æ°¤·)¡£Ì¾Á°¤¬ \(aqK\(aq ¤Ç¤Ï¤¸¤Þ¤ë¥ê¥ó¥¯¤Ï "stop" +¤È¤¤¤¦°ú¿ô¤ò¤Ä¤±¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë (¤¹¤Ê¤ï¤Á¥µ¡¼¥Ó¥¹¤¬Ää»ß¤¹¤ë)¡£ + +.\"O To define the starting or stopping order within the same run-level, +.\"O the names of the links contain order-numbers. +.\"O Also, to make the names clearer, they usually +.\"O end with the name of the service they refer to. +.\"O Example: +.\"O the link \fI/etc/rc2.d/S80sendmail\fR starts the sendmail service on +.\"O runlevel 2. +.\"O This happens after \fI/etc/rc2.d/S12syslog\fR is run +.\"O but before \fI/etc/rc2.d/S90xfs\fR is run. +Ʊ¤¸¥é¥ó¥ì¥Ù¥ë¤ÎÆâÉô¤Ç¤Îµ¯Æ°¤äÄä»ß¤Î½ç½ø¤òµ¬Äꤹ¤ë¤¿¤á¤Ë¡¢ +¥ê¥ó¥¯¤Î̾Á°¤Ë¤Ï½ç½ø¤ò¼¨¤¹¿ô»ú¤¬´Þ¤Þ¤ì¤ë¡£ +¤Þ¤¿¡¢Ì¾Á°¤ò¤ï¤«¤ê¤ä¤¹¤¯¤¹¤ë¤¿¤á¡¢ +¥ê¥ó¥¯Ì¾¤ÎËöÈø¤Ë¤ÏÂбþ¤¹¤ë¥µ¡¼¥Ó¥¹¤Î̾Á°¤¬¤Ä¤±¤é¤ì¤ë¡£ +Î㤨¤Ð¡¢ +.I /etc/rc2.d/S80sendmail +¤È¤¤¤¦¥ê¥ó¥¯¤Ï¡¢sendmail ¥µ¡¼¥Ó¥¹¤ò¥é¥ó¥ì¥Ù¥ë 2 ¤Ë¤ª¤¤¤Æµ¯Æ°¤¹¤ë¡£ +¤³¤ì¤Ï¡¢ +.I /etc/rc2.d/S12syslog +¤è¤ê¤â¸å¤Ë¡¢¤Þ¤¿ +.I /etc/rc2.d/S90xfs +¤è¤ê¤âÀè¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ + +.\"O To manage the boot order and run-levels, we have to manage these links. +.\"O However, on many versions of Linux, there are tools to help with this task +.\"O (e.g: +.\"O .BR chkconfig (8)). +¥Ö¡¼¥È¤Î½ç½ø¤È¥é¥ó¥ì¥Ù¥ë¤ò´ÉÍý¤¹¤ë¤Ë¤Ï¡¢ +¤³¤ì¤é¤Î¥ê¥ó¥¯¤ò´ÉÍý¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤·¤«¤·Â¿¤¯¤Î Linux ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +¤³¤ì¤é¤Îºî¶È¤ò¼ê½õ¤±¤·¤Æ¤¯¤ì¤ë¥Ä¡¼¥ë¤¬Â¸ºß¤¹¤ë +(Î㤨¤Ð +.BR chkconfig (8) +¤Ê¤É)¡£ +.\"O .SS "Boot Configuration" +.SS ¥Ö¡¼¥È¤ÎÀßÄê +.\"O Usually the daemons started may optionally receive command-line options +.\"O and parameters. +.\"O To allow system administrators to change these +.\"O parameters without editing the boot scripts themselves, +.\"O configuration files are used. +.\"O These are located in a specific +.\"O directory (\fI/etc/sysconfig\fR on RedHat systems) and are +.\"O used by the boot scripts. +¥Ç¡¼¥â¥ó¤Îµ¯Æ°»þ¤Ë¤Ï¡¢ +¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤ä¥Ñ¥é¥á¡¼¥¿¤ò»ØÄê¤Ç¤­¤ë¤Î¤¬ÉáÄ̤Ǥ¢¤ë¡£ +¥·¥¹¥Æ¥à´ÉÍý¼Ô¤¬¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤òÊѹ¹¤·¤¿¤¤¤È»×¤Ã¤¿¤È¤­¤Ë¡¢ +¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤½¤Î¤â¤Î¤òÊÔ½¸¤·¤Ê¤¯¤Æ¤â¤¹¤à¤è¤¦¡¢ +ÀßÄê¥Õ¥¡¥¤¥ë¤¬ÍѤ¤¤é¤ì¤ë¡£¤³¤ì¤é¤ÏÆÃÄê¤Î¥Ç¥£¥ì¥¯¥È¥ê +(RedHat ¥·¥¹¥Æ¥à¤Ç¤Ï +.IR /etc/sysconfig ) +¤ËÃÖ¤«¤ì¡¢¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤«¤é»²¾È¤µ¤ì¤ë¡£ + +.\"O In older Unix systems, these files contained the actual command line +.\"O options for the daemons, but in modern Linux systems (and also +.\"O in HP-UX), these files just contain shell variables. +.\"O The boot scripts in \fI/etc/init.d\fR +.\"O \fBsource\fR the configuration +.\"O files, and then use the variable values. +¸Å¤¤ Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï +¥Ç¡¼¥â¥ó¤ËÍ¿¤¨¤ë¼ÂºÝ¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤¬½ñ¤«¤ì¤Æ¤¤¤¿¡£ +¤·¤«¤·ºÇ¶á¤Î Linux ¥·¥¹¥Æ¥à (¤ä HP-UX) ¤Ç¤Ï¡¢ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ïñ¤Ë¥·¥§¥ëÊÑ¿ô¤¬½ñ¤«¤ì¤Æ¤¤¤ë¤À¤±¤Ç¤¢¤ë¡£ +.I /etc/init.d +¤ËÃÖ¤«¤ì¤¿¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤Ï¡¢¤³¤ì¤é¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ò +.B source +¤·¡¢¤½¤ÎÊÑ¿ô¤ÎÃͤòÍѤ¤¤ë¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.\"O .LP +.IR /etc/init.d/ , +.\"O .IR /etc/rc[S0\-6].d/ , +.IR /etc/rc[S0\-6].d/ , +.I /etc/sysconfig/ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR inittab (5), +.BR bootparam (7), +.BR init (8), +.BR runlevel (8), +.BR shutdown (8) diff --git a/draft/man7/bootparam.7 b/draft/man7/bootparam.7 new file mode 100644 index 00000000..823d3826 --- /dev/null +++ b/draft/man7/bootparam.7 @@ -0,0 +1,2267 @@ +.\" Copyright (c) 1995,1997 Paul Gortmaker and Andries Brouwer +.\" +.\" 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 man page written 950814 by aeb, based on Paul Gortmaker's HOWTO +.\" (dated v1.0.1, 15/08/95). +.\" Major update, aeb, 970114. +.\" FIXME ? The use of quotes on this page is inconsistent with the +.\" rest of man-pages. +.\" +.\" Japanese Version Copyright (c) 1999 MATSUURA Masaaki +.\" all rights reserved. +.\" Translated 1999-02-04, MATSUURA Masaaki +.\" Modified 2001-07-08, Yuichi SATO +.\" Updated & Modified 2001-09-10, NAKANO Takeo +.\" Updated 2002-04-21, NAKANO Takeo +.\" Updated 2007-05-04, Akihiro MOTOKI , LDP v2.46 +.\" +.TH BOOTPARAM 7 2007-12-16 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O bootparam \- Introduction to boot time parameters of the Linux kernel +.SH ̾Á° +bootparam \- Linux ¥«¡¼¥Í¥ëµ¯Æ°»þ¥Ñ¥é¥á¡¼¥¿¤Î²òÀâ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The Linux kernel accepts certain 'command-line options' or 'boot time +.\"O parameters' at the moment it is started. +.\"O In general this is used to +.\"O supply the kernel with information about hardware parameters that +.\"O the kernel would not be able to determine on its own, or to avoid/override +.\"O the values that the kernel would otherwise detect. +Linux ¥«¡¼¥Í¥ë¤Ïµ¯Æ°¤¹¤ë¤È¤­¤Ë¡Ö¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¡×¤¢¤ë¤¤¤Ï +¡Öµ¯Æ°»þ¥Ñ¥é¥á¡¼¥¿¡×¤ò¼õ¤±ÉÕ¤±¤ë¡£ +¤³¤ì¤Ï°ìÈ̤ˡ¢ +¥«¡¼¥Í¥ë¤Ë¤Ï·èÄê¤Ç¤­¤Ê¤¤¥Ï¡¼¥É¥¦¥§¥¢¤Î¥Ñ¥é¥á¡¼¥¿¤ò¥«¡¼¥Í¥ë¤ËÅϤ·¤¿¤¤¾ì¹ç¤ä¡¢ +¥«¡¼¥Í¥ë¤¬¸¡½Ð¤¹¤ë¤Ç¤¢¤í¤¦Ãͤò°Õ¿ÞŪ¤Ë̵¸ú¤Ë¤·¤¿¤êÊѹ¹¤·¤¿¤ê¤¹¤ë¾ì¹ç¤ËÍѤ¤¤ë¡£ + +.\"O When the kernel is booted directly by the BIOS (say from a floppy to +.\"O which you copied a kernel using 'cp zImage /dev/fd0'), +.\"O you have no opportunity to specify any parameters. +.\"O So, in order to take advantage of this possibility you have to +.\"O use software that is able to pass parameters, like LILO or loadlin. +.\"O For a few parameters one can also modify the kernel image itself, +.\"O using rdev, see +.\"O .BR rdev (8) +.\"O for further details. +¥«¡¼¥Í¥ë¤¬ BIOS ¤«¤éľÀܵ¯Æ°¤µ¤ì¤ë¤È¤­ +(¤¿¤È¤¨¤Ð 'cp zImage /dev/fd0' +¤Ç¥Õ¥í¥Ã¥Ô¡¼¤Ë¥³¥Ô¡¼¤·¤¿¥«¡¼¥Í¥ë¤«¤éµ¯Æ°¤¹¤ë¤Ê¤É) ¤Ï¡¢ +¥Ñ¥é¥á¡¼¥¿¤ò»ØÄꤹ¤ëµ¡²ñ¤Ï¤Ê¤¤¡£ +¤æ¤¨¤Ë¡¢¤³¤Îµ¯Æ°»þ¥Ñ¥é¥á¡¼¥¿µ¡Ç½¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.I LILO +¤ä +.I loadlin +¤Î¤è¤¦¤Ë¥Ñ¥é¥á¡¼¥¿¤ò»ØÄê¤Ç¤­¤ë¥½¥Õ¥È¥¦¥§¥¢¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤¤¤¯¤Ä¤«¤Î¥Ñ¥é¥á¡¼¥¿¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.I rdev +¤ò»È¤Ã¤Æ¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤½¤Î¤â¤Î¤ò½¤Àµ¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¾ÜºÙ¤Ï +.BR rdev (8) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"O The LILO program (LInux LOader) written by Werner Almesberger is the +.\"O most commonly used. +.\"O It has the ability to boot various kernels, and +.\"O stores the configuration information in a plain text file. +.\"O (See +.\"O .BR lilo (8) +.\"O and +.\"O .BR lilo.conf (5).) +.\"O LILO can boot DOS, OS/2, Linux, FreeBSD, UnixWare, etc., and is quite flexible. +Werner Almesberger ¤Ë¤è¤ë +LILO (LInux LOader) ¥×¥í¥°¥é¥à¤ÏºÇ¤â¹­¤¯»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +LILO ¤Ï¤¤¤í¤¤¤í¤Ê¥«¡¼¥Í¥ë¤òÁªÂò¤·¤Æ¥Ö¡¼¥È¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¡¢ +ÀßÄê¾ðÊó¤ò¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤ËÊÝ»ý¤¹¤ë +.RB ( lilo (8) +¤È +.BR lilo.conf (5) +¤ò»²¾È)¡£ LILO ¤Ï DOS, OS/2, Linux, FreeBSD ¤Ê¤É¤òµ¯Æ°¤Ç¤­¡¢ +Èó¾ï¤Ë½ÀÆð¤Ç¤¢¤ë¡£ + +.\"O The other commonly used Linux loader is 'LoadLin' which is a DOS +.\"O program that has the capability to launch a Linux kernel from the DOS +.\"O prompt (with boot-args) assuming that certain resources are available. +.\"O This is good for people that want to launch Linux from DOS. +¤Û¤«¤Ë¤Ï +.I loadLin +¤â¤è¤¯»È¤ï¤ì¤Æ¤¤¤ë Linux ¥í¡¼¥À¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï DOS ¤Î¥×¥í¥°¥é¥à¤Ç¡¢DOS ¥×¥í¥ó¥×¥È¤«¤é +(µ¯Æ°»þ°ú¿ô¤È¤È¤â¤Ë) Linux ¥«¡¼¥Í¥ë¤òµ¯Æ°¤Ç¤­¤ë +(¤¤¤¯¤Ä¤«¤ÎÆÃÄê¤Î¥ê¥½¡¼¥¹¤¬ÍøÍѲÄǽ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ +loadlin ¤Ï DOS ¤«¤é Linux ¤òµ¯Æ°¤µ¤»¤¿¤¤¿Í¤Ë¤¢¤Ã¤Æ¤¤¤ë¡£ + +.\"O It is also very useful if you have certain hardware which relies on +.\"O the supplied DOS driver to put the hardware into a known state. +.\"O A common example is 'SoundBlaster Compatible' sound cards that require +.\"O the DOS driver to twiddle a few mystical registers to put the card +.\"O into a SB compatible mode. +.\"O Booting DOS with the supplied driver, and +.\"O then loading Linux from the DOS prompt with loadlin avoids the reset +.\"O of the card that happens if one rebooted instead. +¤Þ¤¿ loadlin ¤Ï¡¢DOS ¤Î¥É¥é¥¤¥Ð¤Ç¤¢¤ë¾õÂÖ¤Ë +ÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¥Ï¡¼¥É¥¦¥§¥¢¤ò +»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤âÈó¾ï¤ËÊØÍø¤Ç¤¢¤ë¡£ +¤è¤¯¤¢¤ëÎã¤Ï +¡ÖSoundBlaster ¸ß´¹¡×¤Î¥µ¥¦¥ó¥É¥«¡¼¥É¤Ç¡¢ +¤³¤ì¤é¤ÎÃæ¤Ë¤Ï DOS ¤Î¥É¥é¥¤¥Ð¤ò»È¤Ã¤Æ +¤¤¤¯¤Ä¤«ÈëÌ©¤Î¥ì¥¸¥¹¥¿¤ò¤¤¤¸¤Ã¤Æ¤ä¤é¤Ê¤¤¤È¡¢ +ËÜÅö¤Î SB ¸ß´¹¥â¡¼¥É¤Ë¤Ï¤Ê¤é¤Ê¤¤¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ë¡£ +¤Þ¤º¥Ï¡¼¥É¥¦¥§¥¢¤Ë¤Ä¤¤¤Æ¤­¤¿¥É¥é¥¤¥Ð¤òÁȤ߹þ¤ó¤Ç DOS ¤òµ¯Æ°¤·¡¢ +¤½¤Î¸å loadlin ¤ò»ÈÍѤ·¤Æ Linux ¥«¡¼¥Í¥ë¤òÆɤ߹þ¤á¤Ð¡¢ +¥ê¥Ö¡¼¥È¤Ë¤è¤Ã¤Æ¥«¡¼¥É¤ÎÀßÄ꤬¥ê¥»¥Ã¥È¤µ¤ì¤ë¤Î¤òËɤ²¤ë¤ï¤±¤À¡£ +.\"O .SS "The Argument List" +.SS °ú¿ô¥ê¥¹¥È +.\"O The kernel command line is parsed into a list of strings +.\"O (boot arguments) separated by spaces. +.\"O Most of the boot args take the form of: +¥«¡¼¥Í¥ë¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ï¥¹¥Ú¡¼¥¹¤Ç¶èÀÚ¤é¤ì¤¿Ê¸»úÎó +.RI ( "µ¯Æ°»þ°ú¿ô: boot arguments" ) +¤Î¥ê¥¹¥È¤«¤éÀ®¤Ã¤Æ¤¤¤ë¡£¤Û¤È¤ó¤É¤Îµ¯Æ°»þ°ú¿ô¤Ï¼¡¤Î½ñ¼°¤Ë½¾¤¦¡£ +.IP +name[=value_1][,value_2]...[,value_10] +.LP +.\"O where 'name' is a unique keyword that is used to identify what part of +.\"O the kernel the associated values (if any) are to be given to. +.\"O Note the limit of 10 is real, as the present code only handles 10 comma +.\"O separated parameters per keyword. +.\"O (However, you can reuse the same +.\"O keyword with up to an additional 10 parameters in unusually +.\"O complicated situations, assuming the setup function supports it.) +¤³¤³¤Ç 'name' ¤Ï¡¢¤½¤ì¤ËÂбþ¤¹¤ëÃͤ¬¥«¡¼¥Í¥ë¤Î¤É¤ÎÉôʬ¤ËÅϤµ¤ì¤ë¤â¤Î¤Ê¤Î¤«¤ò +¼±Ê̤¹¤ë¤¿¤á¤Î¡¢Â¾¤È½Å¤Ê¤é¤Ê¤¤¥­¡¼¥ï¡¼¥É¤Ç¤¢¤ë¡£ +½ñ¼°Ãæ¤Î 10 ¤È¤¤¤¦À©¸Â¤Ï¼ÂºÝ¤Ë¸ºß¤¹¤ë¡£ +¸½ºß¤Î¥³¡¼¥É¤Ï¡¢¥­¡¼¥ï¡¼¥É¤Ò¤È¤Ä¤¢¤¿¤ê¡¢¥³¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¤¿¥Ñ¥é¥á¡¼¥¿¤ò +10 ¸Ä¤Þ¤Ç¤·¤«¼è¤ê°·¤¦¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +(¤·¤«¤·¡¢»ö¾ð¤¬Èó¾ï¤ËÊ£»¨¤Ê¾ì¹ç¤Ë¤Ï¡¢Æ±¤¸¥­¡¼¥ï¡¼¥É¤òºÆÅÙÍøÍѤ·¤Æ +10 ¸Ä°Ê¾å¤Î¥Ñ¥é¥á¡¼¥¿¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +ÂоݤȤʤë¥Ï¡¼¥É¥¦¥§¥¢¤ÎÀßÄê´Ø¿ô¤¬¤½¤ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ì¤Ð¡¢¤À¤¬¡£) + +.\"O Most of the sorting goes on in linux/init/main.c. +.\"O First, the kernel +.\"O checks to see if the argument is any of the special arguments 'root=', +.\"O \&'nfsroot=', 'nfsaddrs=', 'ro', 'rw', 'debug' or 'init'. +.\"O The meaning of these special arguments is described below. +¥«¡¼¥Í¥ë¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î°·¤¤¤Ï¤Û¤È¤ó¤É linux/init/main.c ¤¬¹Ô¤Ê¤Ã¤Æ¤¤¤ë¡£ +½é¤á¤Ë¡¢¥«¡¼¥Í¥ë¤Ï +\&'root=', 'nfsroot=', 'nfsaddrs=', 'ro', 'rw', 'debug', 'init' +¤È¤¤¤Ã¤¿ÆÃÊ̤ʰú¿ô¤¬¤¢¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +¤³¤ì¤é¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò¤¹¤ë¡£ + +.\"O Then it walks a list of setup functions (contained in the bootsetups +.\"O array) to see if the specified argument string (such as 'foo') has +.\"O been associated with a setup function ('foo_setup()') for a particular +.\"O device or part of the kernel. +.\"O If you passed the kernel the line +.\"O foo=3,4,5,6 then the kernel would search the bootsetups array to see +.\"O if 'foo' was registered. +.\"O If it was, then it would call the setup +.\"O function associated with 'foo' (foo_setup()) and hand it the arguments +.\"O 3, 4, 5 and 6 as given on the kernel command line. +¥«¡¼¥Í¥ë¤Ï¼¡¤ËÀßÄê´Ø¿ô¤Î¥ê¥¹¥È +(ÇÛÎó bootsetups ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë) ¤ò¥¹¥­¥ã¥ó¤·¡¢ +»ØÄꤵ¤ì¤¿°ú¿ôʸ»úÎó (Î㤨¤Ð 'foo') ¤¬ +ÆÃÄê¤Î¥Ç¥Ð¥¤¥¹¤ä¥«¡¼¥Í¥ë¤Î°ìÉô¤ËÂФ¹¤ëÀßÄê´Ø¿ô +('foo_setup()') ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¤«¤òÄ´¤Ù¤ë¡£ +Î㤨¤Ð¥«¡¼¥Í¥ë¤Ë foo=3,4,5,6 ¤Î¤è¤¦¤Ê¥Ñ¥é¥á¡¼¥¿¤òÍ¿¤¨¤¿¤È¤¹¤ë¤È¡¢ +¥«¡¼¥Í¥ë¤ÏÇÛÎó bootsetups ¤òÄ´¤Ù¤Æ¡¢ 'foo' ¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤«Ä´¤Ù¤ë¡£ +ÅÐÏ¿¤µ¤ì¤Æ¤¤¤¿¤é¡¢'foo' ¤ËÂбþ¤¹¤ëÀßÄê´Ø¿ô ('foo_setup()') ¤ò¥³¡¼¥ë¤·¡¢ +¥«¡¼¥Í¥ë¥³¥Þ¥ó¥É¥é¥¤¥ó¤ËÍ¿¤¨¤é¤ì¤¿°ú¿ô¤Ç¤¢¤ë 3, 4, 5, 6 ¤òÀßÄê´Ø¿ô¤ËÅϤ¹¡£ + +.\"O Anything of the form 'foo=bar' that is not accepted as a setup function +.\"O as described above is then interpreted as an environment variable to +.\"O be set. +.\"O A (useless?) example would be to use 'TERM=vt100' as a boot +.\"O argument. +\&'foo=bar' ¤È¤¤¤¦·Á¼°¤Î°ú¿ô¤Î¤¦¤Á¡¢ +¾åµ­¤Î¤è¤¦¤ËÀßÄê´Ø¿ô¤Ë¼õ¤±Æþ¤ì¤é¤ì¤Ê¤«¤Ã¤¿¤â¤Î¤Ï¡¢ +´Ä¶­ÊÑ¿ô¤È²ò¼á¤µ¤ì¤ÆÀßÄꤵ¤ì¤ë¡£ +(¤¢¤Þ¤êÌò¤ËΩ¤¿¤Ê¤¤?) Îã¤È¤·¤Æ¤Ï¡¢'TERM=VT100' ¤¬¤¢¤ë¡£ + +.\"O Any remaining arguments that were not picked up by the kernel and were +.\"O not interpreted as environment variables are then passed onto process +.\"O one, which is usually the init program. +.\"O The most common argument that +.\"O is passed to the init process is the word 'single' which instructs init +.\"O to boot the computer in single user mode, and not launch all the usual +.\"O daemons. +.\"O Check the manual page for the version of init installed on +.\"O your system to see what arguments it accepts. +¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ½èÍý¤µ¤ì¤º¡¢´Ä¶­ÊÑ¿ô¤È¤·¤Æ¤â²ò¼á¤µ¤ì¤Ê¤«¤Ã¤¿ +»Ä¤ê¤Î°ú¿ô¤Ï¡¢¥×¥í¥»¥¹ 1 ¤ËÅϤµ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +Ä̾盧¤Î¥×¥í¥»¥¹ 1 ¤Ï +.I init +¥×¥í¥°¥é¥à¤Ç¤¢¤ë¡£ +¥×¥í¥»¥¹ 1 ¤ËÅϤµ¤ì¤ë°ú¿ô¤ÇºÇ¤âÎɤ¯»È¤ï¤ì¤ë¤Î¤Ï¡¢ +\&'single' ¤È¤¤¤¦¥­¡¼¥ï¡¼¥É¤Ç¤¢¤ë¡£ +¤³¤ì¤ò»ØÄꤹ¤ë¤È init ¤Ï¥·¥ó¥°¥ë¥æ¡¼¥¶¥â¡¼¥É¤Ç¥³¥ó¥Ô¥å¡¼¥¿¤òµ¯Æ°¤·¡¢ +Ä̾ï»È¤ï¤ì¤ë¥Ç¡¼¥â¥ó¤Ï°ìÀÚµ¯Æ°¤·¤Ê¤¤¡£ +¥·¥¹¥Æ¥à¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë init ¤¬ +¤É¤ó¤Ê°ú¿ô¤ò¼õ¤±ÉÕ¤±¤ë¤«¤Ï¡¢ +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÇÄ´¤Ù¤ë¤³¤È¡£ +.\"O .SS "General Non-Device Specific Boot Arguments" +.SS °ìÈÌŪ¤Ê¡¢¥Ç¥Ð¥¤¥¹¸ÇÍ­¤Ç¤Ï¤Ê¤¤µ¯Æ°»þ°ú¤­¿ô +.TP +.B "'init=...'" +.\"O This sets the initial command to be executed by the kernel. +.\"O If this is not set, or cannot be found, the kernel will try +.\"O .IR /sbin/init , +.\"O then +.\"O .IR /etc/init , +.\"O then +.\"O .IR /bin/init , +.\"O then +.\"O .I /bin/sh +.\"O and panic if all of this fails. +¥«¡¼¥Í¥ë¤¬¼Â¹Ô¤¹¤ë½é´ü¥³¥Þ¥ó¥É¤òÀßÄꤹ¤ë¡£ +¤³¤Î»ØÄ꤬¤Ê¤µ¤ì¤Ê¤«¤Ã¤¿¤ê¡¢»ØÄꤷ¤¿¥³¥Þ¥ó¥É¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥«¡¼¥Í¥ë¤Ï +.IR /sbin/init , +.IR /etc/init , +.IR /bin/init , +.I /bin/sh +¤Î½ç¤Ç¼Â¹Ô¤ò»î¤ß¡¢¤¹¤Ù¤Æ¤Ë¼ºÇÔ¤·¤¿¤é panic ¤òµ¯¤³¤¹¡£ +.TP +.B "'nfsaddrs=...'" +.\"O This sets the nfs boot address to the given string. +.\"O This boot address is used in case of a net boot. +nfs ¤Î¥Ö¡¼¥È¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤¿Ê¸»úÎó¤ËÀßÄꤹ¤ë¡£ +¤³¤Î¥Ö¡¼¥È¥¢¥É¥ì¥¹¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ö¡¼¥È¤Î¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¡£ +.TP +.B "'nfsroot=...'" +.\"O This sets the nfs root name to the given string. +.\"O If this string +.\"O does not begin with '/' or ',' or a digit, then it is prefixed by +.\"O \&'/tftpboot/'. +.\"O This root name is used in case of a net boot. +nfs ¥ë¡¼¥È¤Î̾Á°¤òÀßÄꤹ¤ë¡£ +¤³¤Îʸ»úÎó¤ÎÀèƬ¤¬ '/'¡¢','¡¢¿ô»ú¤Î¤¤¤º¤ì¤Ç¤â¤Ç¤Ê¤¤¤È¤­¤Ï¡¢ +\&'/tftpboot/' ¤¬ÀèƬ¤ËÉղ䵤ì¤ë¡£ +¤³¤Î̾Á°¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ö¡¼¥È¤Î¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¡£ +.TP +.B "'no387'" +.\"O (Only when +.\"O .B CONFIG_BUGi386 +.\"O is defined.) +.\"O Some i387 coprocessor chips have bugs that show up when used in 32 bit +.\"O protected mode. +.\"O For example, some of the early ULSI-387 chips would +.\"O cause solid lockups while performing floating-point calculations. +.\"O Using the 'no387' boot arg causes Linux to ignore the maths +.\"O coprocessor even if you have one. +.\"O Of course you must then have your +.\"O kernel compiled with math emulation support! +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_BUGi386 +¤¬»ØÄꤵ¤ì¤¿¤È¤­¤Î¤ßÍ­¸ú¡£) +°ìÉô¤Î i387 ¥³¥×¥í¥»¥Ã¥µ¥Á¥Ã¥×¤Ë¤Ï¡¢ +32 ¥Ó¥Ã¥È¥×¥í¥Æ¥¯¥È¥â¡¼¥É¤Ç¤Î»ÈÍÑ»þ¤ËÀ¸¤¸¤ë¥Ð¥°¤¬¤¢¤ë¡£ +Î㤨¤Ð½é´ü¤Î ULSI-387 ¥Á¥Ã¥×¤Ï¡¢ +ÉâÆ°¾®¿ôÅÀ±é»»¤ò¹Ô¤Ê¤¦¤È³Î¼Â¤Ë¥í¥Ã¥¯¥¢¥Ã¥×¤·¤Æ¤·¤Þ¤¦¡£ +¤³¤Îµ¯Æ°»þ°ú¿ô 'no387' ¤ò»ØÄꤹ¤ë¤È¡¢ +Linux ¤Ï¥³¥×¥í¥»¥Ã¥µ¤¬¤¢¤Ã¤Æ¤â¤½¤ì¤ò̵»ë¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤Ê¤ª¤â¤Á¤í¤ó¡¢¥«¡¼¥Í¥ë¥³¥ó¥Ñ¥¤¥ë»þ¤ËÉâÆ°¾®¿ôÅÀ±é»»¤ò¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë +(kernel math emulation) »ØÄê¤ò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤! +.TP +.B "'no-hlt'" +.\"O (Only when +.\"O .B CONFIG_BUGi386 +.\"O is defined.) +.\"O Some of the early i486DX-100 chips have a problem with the 'hlt' +.\"O instruction, in that they can't reliably return to operating mode +.\"O after this instruction is used. +.\"O Using the 'no-hlt' instruction tells +.\"O Linux to just run an infinite loop when there is nothing else to do, +.\"O and to not halt the CPU. +.\"O This allows people with these broken chips +.\"O to use Linux. +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_BUGi386 +¤¬»ØÄꤵ¤ì¤¿¤È¤­¤Î¤ßÍ­¸ú¡£) +½é´ü¤Î i486DX-100 ¥Á¥Ã¥×¤Î°ìÉô¤Ç¤Ï 'hlt' Ì¿Îá¤ËÌäÂ꤬¤¢¤Ã¤Æ¡¢ +¤³¤ÎÌ¿Îá¤ò»È¤¦¤È¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥â¡¼¥É¤ËÀµ¤·¤¯Ìá¤Ã¤ÆÍè¤Ê¤¤¡£ +\&'no-hlt' ¤ò»ØÄꤹ¤ì¤Ð¡¢Linux ¤Ï¥¢¥¤¥É¥ê¥ó¥°»þ¤Ë CPU ¤òÄä»ß +(halt) ¤¹¤ë¤«¤ï¤ê¤Ë̵¸Â¥ë¡¼¥×¤ò¼Â¹Ô¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤³¤ì¤Ë¤è¤Ã¤Æ¡¢¤½¤Î¤è¤¦¤Ê¥Ð¥°¤Î¤¢¤ë¥Á¥Ã¥×¤Ç¤â Linux ¤ò»ÈÍѤǤ­¤ë¡£ +.TP +.B "'root=...'" +.\"O This argument tells the kernel what device is to be used as the root +.\"O file system while booting. +.\"O The default of this setting is determined +.\"O at compile time, and usually is the value of the root device of the +.\"O system that the kernel was built on. +.\"O To override this value, and +.\"O select the second floppy drive as the root device, one would +.\"O use 'root=/dev/fd1'. +.\"O (The root device can also be set using +.\"O .BR rdev (8).) +µ¯Æ°»þ¤Ë¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤·¤Æ»È¤ï¤ì¤ë¥Ç¥Ð¥¤¥¹¤ò¥«¡¼¥Í¥ë¤Ë»ØÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï¥³¥ó¥Ñ¥¤¥ë»þ¤Ë·èÄꤵ¤ì¡¢ +Ä̾ï¤Ï¥«¡¼¥Í¥ë¤ò¹½ÃÛ¤·¤¿¥·¥¹¥Æ¥à¤Î¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Ë¤Ê¤ë¡£ +¤³¤ÎÃͤò̵¸ú¤Ë¤·¤Æ¡¢ +Î㤨¤Ð 2 ÈÖÌܤΥեí¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ö¤ò¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Ë»ØÄꤹ¤ë¾ì¹ç¤Ï¡¢ +\&'root=/dev/fd1' ¤È¤¹¤ë¡£ +(¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Ï +.BR rdev (8) +¤òÍѤ¤¤Æ¤âÀßÄê¤Ç¤­¤ë¡£) + +.\"O The root device can be specified symbolically or numerically. +.\"O A symbolic specification has the form /dev/XXYN, where XX designates +.\"O the device type ('hd' for ST-506 compatible hard disk, with Y in +.\"O \&'a'-'d'; 'sd' for SCSI compatible disk, with Y in 'a'-'e'; +.\"O \&'ad' for Atari ACSI disk, with Y in 'a'-'e', +.\"O \&'ez' for a Syquest EZ135 parallel port removable drive, with Y='a', +.\"O \&'xd' for XT compatible disk, with Y either 'a' or 'b'; 'fd' for +.\"O floppy disk, with Y the floppy drive number \(em fd0 would be +.\"O the DOS 'A:' drive, and fd1 would be 'B:'), Y the driver letter or +.\"O number, and N the number (in decimal) of the partition on this device +.\"O (absent in the case of floppies). +.\"O Recent kernels allow many other +.\"O types, mostly for CD-ROMs: nfs, ram, scd, mcd, cdu535, aztcd, cm206cd, +.\"O gscd, sbpcd, sonycd, bpcd. +.\"O (The type nfs specifies a net boot; ram refers to a ram disk.) +¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Î»ØÄê¤Ë¤Ï¥·¥ó¥Ü¥ë·Á¼°¤È¿ôÃÍ·Á¼°¤òÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥·¥ó¥Ü¥ë·Á¼°¤Î¾ì¹ç¤Ï /dev/XXYN ¤È¤¤¤¦½ñ¼°¤Ç»ØÄꤹ¤ë¡£ +XX ¤Ë¤Ï¥Ç¥Ð¥¤¥¹¥¿¥¤¥×¤ò»ØÄꤹ¤ë¡£ +Y ¤Ë¤Ï¥É¥é¥¤¥Ö¥ì¥¿¡¼¤â¤·¤¯¤Ï¥É¥é¥¤¥ÖÈֹ桢 +N ¤Ë¤Ï (¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯¤ò½ü¤¯) ¥Ç¥£¥¹¥¯¤Î +¥Ñ¡¼¥Æ¥£¥·¥ç¥óÈÖ¹æ¤ò 10 ¿Ê¿ô¤Î¿ôÃͤǻØÄꤹ¤ë¡£ +(ST-506 ¸ß´¹¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤Ç¤Ï¥Ç¥Ð¥¤¥¹¥¿¥¤¥×¤¬ 'hd' ¤Ç +Y ¤ÎÈÏ°Ï¤Ï 'a' ¤«¤é 'd'¡¢ +SCSI ¥Ç¥£¥¹¥¯¤Ï 'sd' ¤Ç Y ¤Ï 'a' ¤«¤é 'e'¡¢ +Atari ACSI ¥Ç¥£¥¹¥¯¤Ï 'ad' ¤Ç Y ¤Ï 'a' ¤«¤é 'e'¡¢ +Syquest EZ135 ¥Ñ¥é¥ì¥ë¥Ý¡¼¥È¥ê¥à¡¼¥Ð¥Ö¥ë¥Ç¥£¥¹¥¯¤Ï 'ez' ¤Ç Y ¤Ï 'a' ¤Î¤ß¡¢ +XT ¥Ç¥£¥¹¥¯¤Ï 'xt' ¤Ç Y ¤Ï 'a' ¤« 'b'¡¢ +¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯¤Ï 'fd' ¤Ç Y ¤Ë¤Ï¥É¥é¥¤¥ÖÈÖ¹æ¤ò»ØÄꤹ¤ë¡£ +fd0 ¤Ï DOS ¤Î 'A:'¡¢fd1 ¤Ï 'B:' ¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ï¸ºß¤·¤Ê¤¤¤Î¤Ç N ¤Ï»ØÄꤷ¤Ê¤¤¡£) +ºÇ¿·¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢Â¾¤Ë¤â¼¡¤Î¤è¤¦¤Ê¿¤¯¤Î¥Ç¥Ð¥¤¥¹¥¿¥¤¥×¤ò»ØÄê¤Ç¤­¤ë +(¤Û¤È¤ó¤É¤Ï CD-ROM ¤À¤¬): +nfs, ram, scd, mcd, cdu535, aztcd, cm206cd, gscd, sbpcd, sonycd, bpcd¡£ +(nfs ¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ö¡¼¥È¤Ë¡¢ram ¤Ï RAM ¥Ç¥£¥¹¥¯¤ò»ÈÍѤ¹¤ë¾ì¹ç¤ËÍѤ¤¤ë¡£) + +.\"O Note that this has nothing to do with the designation of these +.\"O devices on your file system. +.\"O The '/dev/' part is purely conventional. +¤Ê¤ª¡¢¤³¤ì¤é¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ç¤Î¥Ç¥Ð¥¤¥¹¤Î»ØÄêÊýË¡¤È¤ÏÁ´¤¯´Ø·¸¤Ê¤¤¡£ +\&'/dev/' ¤òÍѤ¤¤ë¤Î¤Ïñ¤Ë´·½¬¤Ë²á¤®¤Ê¤¤¡£ + +.\"O The more awkward and less portable numeric specification of the above +.\"O possible root devices in major/minor format is also accepted. +.\"O (E.g., /dev/sda3 is major 8, minor 3, so you could use 'root=0x803' as an +.\"O alternative.) +°·¤¤¤Ë¤¯¤¤¤·°Ü¿¢À­¤âÎɤ¯¤Ê¤¤¤¬¡¢ +¾åµ­¤Î¥Ç¥Ð¥¤¥¹¤ò major/minor ÈÖ¹æ¤Î¿ôÃͤǻØÄꤷ¤Æ¤â¤è¤¤¡£ +(Î㤨¤Ð /dev/sda3 ¤Ï major ÈÖ¹æ 8¡¢minor ÈÖ¹æ 3 ¤Ê¤Î¤Ç¡¢ +\&'root=0x803' ¤Èµ­½Ò¤Ç¤­¤ë¡£) +.TP +.\"O .B "'ro' and 'rw'" +.B "'ro' ¤È 'rw'" +.\"O The 'ro' option tells the kernel to mount the root file system +.\"O as 'readonly' so that file system consistency check programs (fsck) +.\"O can do their work on a quiescent file system. +.\"O No processes can +.\"O write to files on the file system in question until it is 'remounted' +.\"O as read/write capable, for example, by 'mount \-w \-n \-o remount /'. +.\"O (See also +.\"O .BR mount (8).) +\&'ro' ¥ª¥×¥·¥ç¥ó¤Ï¡¢¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +¡ÖÆɤ߽Ф·ÀìÍѡפǥޥ¦¥ó¥È¤¹¤ë¤è¤¦¥«¡¼¥Í¥ë¤Ë»Ø¼¨¤·¡¢ +fsck ¥×¥í¥°¥é¥à¤¬¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÌ·½â¤ò¸¡ºº¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¡ÖÆɤ߽ñ¤­²Äǽ¡×¤È¤·¤ÆºÆ¥Þ¥¦¥ó¥È¤µ¤ì¤ë +(¤Ä¤Þ¤ê 'mount \-w \-n \-o remount /') ¤Þ¤Ç¤Î´Ö¤Ï¡¢ +¤¤¤«¤Ê¤ë¥×¥í¥»¥¹¤â¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.RB ( mount (8) +¤â»²¾È¤»¤è¡£) + +.\"O The 'rw' option tells the kernel to mount the root file system read/write. +.\"O This is the default. +rw ¥ª¥×¥·¥ç¥ó¤Ï¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +¡ÖÆɤ߽ñ¤­²Äǽ¡×¤Ç¥Þ¥¦¥ó¥È¤¹¤ë¤è¤¦¥«¡¼¥Í¥ë¤Ë»Ø¼¨¤¹¤ë¡£ +¤³¤Á¤é¤¬¥Ç¥Õ¥©¥ë¥È¤Ç¤¢¤ë¡£ + +.\"O The choice between read-only and read/write can also be set using +.\"O .BR rdev (8). +¾Êά»þ¤Î»ØÄê¤ò¡ÖÆɤ߽Ф·ÀìÍÑ¡×¤È +¡ÖÆɤ߽ñ¤­²Äǽ¡×¤È¤Î¤É¤Á¤é¤Ë¤¹¤ë¤«¤Ï¡¢ +.BR rdev (8) +¤Ë¤è¤Ã¤Æ¤âÀßÄê¤Ç¤­¤ë¡£ +.TP +.B "'reserve=...'" +.\"O This is used to protect I/O port regions from probes. +.\"O The form of the command is: +¥Ç¥Ð¥¤¥¹¤Î¼«Æ°¸¡½Ð¤«¤é I/O ¥Ý¡¼¥È¤òÊݸ¤ë¤¿¤á¤ËÍѤ¤¤ë¡£ +¥³¥Þ¥ó¥É¤Î·Á¼°¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +.BI reserve= iobase,extent[,iobase,extent]... +.sp +.\"O In some machines it may be necessary to prevent device drivers from +.\"O checking for devices (auto-probing) in a specific region. +.\"O This may be +.\"O because of hardware that reacts badly to the probing, or hardware +.\"O that would be mistakenly identified, or merely +.\"O hardware you don't want the kernel to initialize. +µ¡¼ï¤Ë¤è¤Ã¤Æ¤Ï¡¢ +¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ë¤è¤ë¥Ç¥Ð¥¤¥¹¤Î¼«Æ°¸¡½Ð¤ò¡¢ +ÆÃÄê¤ÎÈϰϤËÂФ·¤Æ¤Ï¶Ø»ß¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤¬¤¢¤ë¡£ +¥Ï¡¼¥É¥¦¥§¥¢¤¬¸¡½ÐÆ°ºî¤Ë¤è¤Ã¤Æ¿¼¹ï¤ÊÌäÂê¤ò°ú¤­µ¯¤³¤¹¾ì¹ç¤ä¡¢ +¸íǧ¼±¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¾ì¹ç¡¢ +¤Þ¤¿Ã±¤Ë¥«¡¼¥Í¥ë¤Ë¥Ï¡¼¥É¥¦¥§¥¢¤ò½é´ü²½¤µ¤»¤¿¤¯¤Ê¤¤¾ì¹ç¤Ê¤É¤¬¤¢¤ê¤¦¤ë¤À¤í¤¦¡£ + +.\"O The reserve boot-time argument specifies an I/O port region that +.\"O shouldn't be probed. +.\"O A device driver will not probe a reserved region, +.\"O unless another boot argument explicitly specifies that it do so. +¤³¤Îµ¯Æ°»þ°ú¿ô reserve ¤Ï¡¢¼«Æ°¸¡½Ð¤ÎÂоݳ°¤È¤¹¤ë I/O ¥Ý¡¼¥È¤ÎÈϰϤò»ØÄꤹ¤ë¡£ +¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ï¡¢ +¾¤Îµ¯Æ°»þ°ú¿ô¤Ë¤è¤Ã¤ÆÌÀ¼¨Åª¤Ë»ØÄꤵ¤ì¤Ê¤¤¸Â¤ê¡¢ +ͽÌ󤵤줿ÈϰϤËÂФ·¤Æ¼«Æ°¸¡½ÐÆ°ºî¤ò¹Ô¤ï¤Ê¤¤¡£ + +.\"O For example, the boot line +Î㤨¤Ð¥Ö¡¼¥È»þ¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë +.IP +reserve=0x300,32 blah=0x300 +.IP +.\"O keeps all device drivers except the driver for 'blah' from probing +.\"O 0x300-0x31f. +¤È»ØÄꤹ¤ë¤È¡¢'blah' ¤ò½ü¤¯¤¹¤Ù¤Æ¤Î¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ï +0x300 ¤«¤é 0x31f ¤ÎÈϰϤò¼«Æ°¸¡½Ð¤ÎÂоݳ°¤È¤¹¤ë¡£ +.TP +.B "'mem=...'" +.\"O The BIOS call defined in the PC specification that returns +.\"O the amount of installed memory was only designed to be able +.\"O to report up to 64MB. +.\"O Linux uses this BIOS call at boot to +.\"O determine how much memory is installed. +.\"O If you have more than 64MB of +.\"O RAM installed, you can use this boot arg to tell Linux how much memory +.\"O you have. +.\"O The value is in decimal or hexadecimal (prefix 0x), +.\"O and the suffixes 'k' (times 1024) or 'M' (times 1048576) can be used. +.\"O Here is a quote from Linus on usage of the 'mem=' parameter. +ÅëºÜ¤µ¤ì¤Æ¤¤¤ë¥á¥â¥ê¤ÎÎ̤òÊÖ¤¹ BIOS ¥³¡¼¥ë¤Ï +PC ¤Î»ÅÍͤÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¤³¤ì¤ÏºÇÂç 64MB ¤Þ¤Ç¤·¤«ÊÖ¤¹¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +Linux ¤ÏÅëºÜ¥á¥â¥ê¤ÎÎ̤òÄ´¤Ù¤ë¤¿¤á¤Ë¡¢ +µ¯Æ°»þ¤Ë¤³¤Î BIOS ¥³¡¼¥ë¤ò»ÈÍѤ¹¤ë¡£ +¤â¤· 64MB °Ê¾å¤Î RAM ¤òÅëºÜ¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¤³¤Îµ¯Æ°»þ°ú¿ô¤òÍѤ¤¤Æ +¼ÂºÝ¤Î¥á¥â¥êÍÆÎ̤ò Linux ¤ËÃΤ餻¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +ÃÍ¤Ï 10 ¿Ê¿ô¤Þ¤¿¤Ï 16 ¿Ê¿ô (ÀèƬ¤Ë 0x ¤òÉÕ²Ã) ¤Î¿ôÃͤǻØÄꤷ¡¢ +1024 Çܤòɽ¤¹ 'k' ¤Þ¤¿¤Ï 1048576 Çܤòɽ¤¹ 'M' +¤òËöÈø¤ËÉղäǤ­¤ë¡£ +°Ê²¼¤Ï Linus ¤Ë¤è¤ë 'mem=' ¥Ñ¥é¥á¡¼¥¿¤Î²òÀâ¤Ç¤¢¤ë¡£ + +.in +0.5i +.\"O The kernel will accept any 'mem=xx' parameter you give it, and if it +.\"O turns out that you lied to it, it will crash horribly sooner or later. +.\"O The parameter indicates the highest addressable RAM address, so +.\"O \&'mem=0x1000000' means you have 16MB of memory, for example. +.\"O For a 96MB machine this would be 'mem=0x6000000'. +¥«¡¼¥Í¥ë¤Ï 'mem=xx' ¥Ñ¥é¥á¡¼¥¿¤È¤·¤Æ +¤É¤ó¤ÊÃͤò»ØÄꤷ¤Æ¤â¤½¤ì¤ò¤½¤Î¤Þ¤Þ¼õ¤±Æþ¤ì¤ë¡£ +¤À¤«¤é¤½¤ì¤¬±³¤À¤È¤ï¤«¤Ã¤¿¤é¡¢ +ÃÙ¤«¤ìÁᤫ¤ì¤Ò¤É¤¤¥¯¥é¥Ã¥·¥å¤ò¤¹¤ë¤À¤í¤¦¡£ +¥Ñ¥é¥á¡¼¥¿¤Ï¥¢¥¯¥»¥¹¤·¤¦¤ëºÇ¤â¹â°Ì¤Î RAM ¥¢¥É¥ì¥¹¤ò»Ø¼¨¤¹¤ë¡£ +¤À¤«¤éÎ㤨¤Ð 'mem=0x1000000' ¤Ã¤Æ¤¤¤¦¤Î¤Ï +16MB ¤Î¥á¥â¥ê¤¬¤¢¤ë¡¢¤È¤¤¤¦°ÕÌ£¤Ë¤Ê¤ë¡£ +96MB ¤Î¥Þ¥·¥ó¤Ê¤é 'mem=0x6000000' ¤À¡£ + +.\"O NOTE NOTE NOTE: some machines might use the top of memory for BIOS +.\"O caching or whatever, so you might not actually have up to the full +.\"O 96MB addressable. +.\"O The reverse is also true: some chipsets will map +.\"O the physical memory that is covered by the BIOS area into the area +.\"O just past the top of memory, so the top-of-mem might actually be 96MB +.\"O + 384kB for example. +.\"O If you tell linux that it has more memory than +.\"O it actually does have, bad things will happen: maybe not at once, but +.\"O surely eventually. +.BR "Ãí°Õ Ãí°Õ Ãí°Õ" : +¥Þ¥·¥ó¤Ë¤è¤Ã¤Æ¤Ï¥á¥â¥ê¤ÎºÇ¾å°Ì¤ÎÎΰè¤ò BIOS ¤Î¥­¥ã¥Ã¥·¥å¤ä¤é²¿¤ä¤é¤Î +¤¿¤á¤Ë»È¤Ã¤Æ¤¤¤ë¤³¤È¤¬¤¢¤ë¤«¤é¡¢ +¼ÂºÝ¤Ë¤Ï 96MB ¤ò¥Õ¥ë¤Ë¥¢¥É¥ì¥¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +µÕ¤Î¾ì¹ç¤â¤¢¤ë¡£ +¤¤¤¯¤Ä¤«¤Î¥Á¥Ã¥×¥»¥Ã¥È¤Ç¤Ï¡¢ +BIOS Îΰè¤ËÆþ¤Ã¤Æ¤¤¤ëʪÍý¥á¥â¥ê¤òºÇ¾å°Ì¤Î¥á¥â¥ê¤Î¤µ¤é¤Ë¾å¤Ë¥Þ¥Ã¥×¤¹¤ë¡£ +¤è¤Ã¤ÆºÇ¾å°Ì¤Î¥á¥â¥ê¤Ï¤¿¤È¤¨¤Ð 96MB + 384kB ¤Ê¤ó¤ÆÃͤˤʤ뤫¤â¤·¤ì¤Ê¤¤¡£ +linux ¤Ë¼ÂºÝ¤è¤ê¿¤¤¥á¥â¥ê¤ò¶µ¤¨¤Æ¤·¤Þ¤Ã¤¿¤È¤·¤¿¤é¡¢ +¤Þ¤º¤¤¤³¤È¤¬µ¯¤­¤ë¤À¤í¤¦¡£ +¤¹¤°¤Ë¤Ç¤Ï¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¤±¤É¡¢¤æ¤¯¤æ¤¯¤Ï³Î¼Â¤Ë¤Í¡£ +.in + +.\"O You can also use the boot argument 'mem=nopentium' to turn off 4 MB +.\"O page tables on kernels configured for IA32 systems with a pentium or newer +.\"O CPU. +¤Þ¤¿¡¢µ¯Æ°»þ°ú¿ô¤Ë 'mem=nopentium' ¤ò»ØÄꤹ¤ë¤È¡¢ +pentium ¤È¤½¤ì°Ê¹ß¤Î CPU ¤ò»È¤Ã¤¿ IA32 ¥·¥¹¥Æ¥àÍѤËÀßÄꤵ¤ì¤¿¥«¡¼¥Í¥ë¤Ç +4MB ¤Î¥Ú¡¼¥¸¥Æ¡¼¥Ö¥ë¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B "'panic=N'" +.\"O By default the kernel will not reboot after a panic, but this option +.\"O will cause a kernel reboot after N seconds (if N is greater than zero). +.\"O This panic timeout can also be set by "echo N > /proc/sys/kernel/panic". +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤Ï¥Ñ¥Ë¥Ã¥¯¤Î¸å¥ê¥Ö¡¼¥È¤·¤Ê¤¤¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤Æ (N ¤ò 0 ¤è¤êÂ礭¤ÊÃͤȤ¹¤ì¤Ð) +N Éøå¤Ë¥ê¥Ö¡¼¥È¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤³¤ÎÃͤϡ¢µ¯Æ°¸å¤Ë "echo N > /proc/sys/kernel/panic" +¤È¤·¤ÆÀßÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.TP +.B "'reboot=[warm|cold][,[bios|hard]]'" +.\"O (Only when +.\"O .B CONFIG_BUGi386 +.\"O is defined.) +.\"O Since 2.0.22 a reboot is by default a cold reboot. +.\"O One asks for the old default with 'reboot=warm'. +.\"O (A cold reboot may be required to reset certain hardware, +.\"O but might destroy not yet written data in a disk cache. +.\"O A warm reboot may be faster.) +.\"O By default a reboot is hard, by asking the keyboard controller +.\"O to pulse the reset line low, but there is at least one type +.\"O of motherboard where that doesn't work. +.\"O The option 'reboot=bios' will +.\"O instead jump through the BIOS. +(¥«¡¼¥Í¥ë¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_BUGi386 +¤¬»ØÄꤵ¤ì¤¿¤È¤­¤Î¤ßÍ­¸ú¡£) +¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó 2.0.22 ¤«¤é¡¢ +¥ê¥Ö¡¼¥È¤Î¥Ç¥Õ¥©¥ë¥È¤Ï¥³¡¼¥ë¥É¥Ö¡¼¥È¤Ë¤Ê¤Ã¤¿¡£ +°ÊÁ°¤Î¥Ç¥Õ¥©¥ë¥È¤Ç¤¢¤ë¥¦¥©¡¼¥à¥Ö¡¼¥È¤ò¤¹¤ë¤Ë¤Ï +\&'reboot=warm' ¤È»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +(¤¢¤ë¼ï¤Î¥Ï¡¼¥É¥¦¥§¥¢¤ò¥ê¥»¥Ã¥È¤¹¤ë¤Ë¤Ï¥³¡¼¥ë¥É¥Ö¡¼¥È¤¬É¬Íפˤʤ뤬¡¢ +¥Ç¥£¥¹¥¯¥­¥ã¥Ã¥·¥å¤Ë¤¢¤ë½ñ¤­¹þ¤ó¤Ç¤¤¤Ê¤¤¥Ç¡¼¥¿¤ÏÇ˲õ¤µ¤ì¤ë¡£ +¥¦¥©¡¼¥à¥Ö¡¼¥È¤Ç¤Ï¡¢¤è¤êÁÇÁ᤯¥ê¥Ö¡¼¥È¤Ç¤­¤ë¡£) +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥ê¥Ö¡¼¥È¤Ï 'hard' ¤Ç¹Ô¤ï¤ì¤ë¡£ +¤¹¤Ê¤ï¤Á¥ê¥»¥Ã¥È¥é¥¤¥ó¤Ë low ¤ò½ÐÎϤ¹¤ë¤è¤¦¥­¡¼¥Ü¡¼¥É¥³¥ó¥È¥í¡¼¥é¤ËÍ׵ᤷ¤Æ¡¢ +¥ê¥Ö¡¼¥È¤ò¹Ô¤¦¡£ +¤·¤«¤·°ìÉô¤Î¥Þ¥¶¡¼¥Ü¡¼¥É¤Ç¤Ï¤³¤ì¤¬¤Ç¤­¤Ê¤¤¡£ +\&'reboot=bios' ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢ +Âå¤ï¤ê¤Ë BIOS ¤ò·Ðͳ¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.TP +.\"O .B "'nosmp'" and "'maxcpus=N'" +.B "'nosmp'" ¤È "'maxcpus=N'" +.\"O (Only when __SMP__ is defined.) +.\"O A command-line option of 'nosmp' or 'maxcpus=0' will disable SMP +.\"O activation entirely; an option 'maxcpus=N' limits the maximum number +.\"O of CPUs activated in SMP mode to N. +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë __SMP__ ¤¬»ØÄꤵ¤ì¤¿¤È¤­¤Î¤ßÍ­¸ú¡£) +¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤Ë 'nosmp' ¤Þ¤¿¤Ï 'maxcpus=0' ¤ò»ØÄꤹ¤ë¤È¡¢ +SMP (Symmetric Multi Processing) ¤ò´°Á´¤Ë̵¸ú¤Ë¤¹¤ë¡£ +\&'maxcpus=N' ¥ª¥×¥·¥ç¥ó¤Ï¡¢ +SMP ¥â¡¼¥É¤ÇÍ­¸ú¤Ë¤¹¤ë CPU ¤ÎºÇÂç¿ô¤ò N ¤ËÀ©¸Â¤¹¤ë¡£ +.\"O .SS "Boot Arguments for Use by Kernel Developers" +.SS ¥«¡¼¥Í¥ë³«È¯¼ÔÍѤε¯Æ°»þ°ú¿ô +.TP +.B "'debug'" +.\"O Kernel messages are handed off to the kernel log daemon klogd so that they +.\"O may be logged to disk. +.\"O Messages with a priority above +.\"O .I console_loglevel +.\"O are also printed on the console. +.\"O (For these levels, see \fI\fP.) +.\"O By default this variable is set to log anything more important than +.\"O debug messages. +.\"O This boot argument will cause the kernel to also +.\"O print the messages of DEBUG priority. +.\"O The console loglevel can also be set at run time via an option +.\"O to klogd. +.\"O See +.\"O .BR klogd (8). +¥«¡¼¥Í¥ë¤¬½ÐÎϤ¹¤ë¥á¥Ã¥»¡¼¥¸¤Ï¥«¡¼¥Í¥ë¥í¥°¥Ç¡¼¥â¥ó klogd ¤ËÅϤµ¤ì¡¢ +¥Ç¥£¥¹¥¯¤Ëµ­Ï¿¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¥×¥é¥¤¥ª¥ê¥Æ¥£¤¬ +.I console_loglevel +¤Î¥á¥Ã¥»¡¼¥¸¤Ï¥³¥ó¥½¡¼¥ë¤Ë¤âɽ¼¨¤µ¤ì¤ë¡£ +(¤³¤ì¤é¤Î¥ì¥Ù¥ë¤Ë¤Ä¤¤¤Æ¤Ï¡¢\fI\fP ¤ò»²¾È¡£) +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¤³¤ÎÊÑ¿ô¤Ï¡¢ +¥Ç¥Ð¥Ã¥°¥á¥Ã¥»¡¼¥¸¤è¤ê¤â½ÅÍפʤ¢¤é¤æ¤ë¥á¥Ã¥»¡¼¥¸¤òµ­Ï¿¤¹¤ë¤è¤¦ÀßÄꤵ¤ì¤Æ¤¤¤ë +(¥Ç¥Ð¥Ã¥°¥á¥Ã¥»¡¼¥¸¤Ï´Þ¤Þ¤Ê¤¤)¡£ +¤³¤Îµ¯Æ°»þ°ú¿ô¤ò»ØÄꤹ¤ë¤È¡¢ +¥«¡¼¥Í¥ë¤Ï¥×¥é¥¤¥ª¥ê¥Æ¥£¤¬ DEBUG ¤Î¥á¥Ã¥»¡¼¥¸¤â½ÐÎϤ¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.I console_loglevel +¤â klogd ¤Ë¥ª¥×¥·¥ç¥ó¤òÅϤ»¤Ð¼Â¹Ô»þ¤ËÀßÄê¤Ç¤­¤ë¡£ +.BR klogd (8) +¤ò¸«¤è¡£ +.TP +.B "'profile=N'" +.\"O It is possible to enable a kernel profiling function, +.\"O if one wishes to find out where the kernel is spending its CPU cycles. +.\"O Profiling is enabled by setting the variable +.\"O .I prof_shift +.\"O to a nonzero value. +.\"O This is done either by specifying +.\"O .B CONFIG_PROFILE +.\"O at compile time, or by giving the 'profile=' option. +.\"O compile time, or by giving the 'profile=' option. +.\"O Now the value that +.\"O .I prof_shift +.\"O gets will be N, when given, or +.\"O .BR CONFIG_PROFILE_SHIFT , +.\"O when that is given, or 2, the default. +.\"O The significance of this variable is that it +.\"O gives the granularity of the profiling: each clock tick, if the +.\"O system was executing kernel code, a counter is incremented: +¥«¡¼¥Í¥ë¤¬¤É¤³¤Ç CPU ¥µ¥¤¥¯¥ë¤ò¾ÃÈñ¤·¤Æ¤¤¤ë¤«Ä´¤Ù¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +¥«¡¼¥Í¥ë¤Î¥×¥í¥Õ¥¡¥¤¥ê¥ó¥°µ¡Ç½¤òÍ­¸ú¤Ë¤¹¤ì¤Ð¤³¤ì¤ò¼Â¸½¤Ç¤­¤ë¡£ +¥«¡¼¥Í¥ë¥×¥í¥Õ¥¡¥¤¥ê¥ó¥°¤Ï¡¢ÊÑ¿ô +.I prof_shift +¤ò 0 °Ê³°¤ÎÃͤ˥»¥Ã¥È¤¹¤ë¤ÈÍ­¸ú¤Ë¤Ê¤ë¡£ +¤³¤ÎÃͤϥ³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_PROFILE +¤Ç»ØÄꤹ¤ë¤«¡¢ +¤³¤Î 'prifile=N' ¥ª¥×¥·¥ç¥ó¤Ç»ØÄê¤Ç¤­¤ë¡£ +.I prof_shift +¤ÎÃÍ¤Ï N ¤¬»ØÄꤵ¤ì¤ì¤Ð N ¤È¤Ê¤ê¡¢N ¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï +.B CONFIG_PROFILE_SHIFT +¤ÎÃͤ¬ÍѤ¤¤é¤ì¤ë¡£ +¤É¤Á¤é¤â»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¥Ç¥Õ¥©¥ë¥ÈÃͤΠ2 ¤¬ÍѤ¤¤é¤ì¤ë¡£ +¤³¤ÎÊÑ¿ô¤¬½ÅÍפʤΤϡ¢ +¥«¡¼¥Í¥ë¥×¥í¥Õ¥¡¥¤¥ê¥ó¥°¤ÎγÅÙ¤ò·èÄꤹ¤ë¤È¤³¤í¤Ë¤¢¤ë¡£ +¤¹¤Ê¤ï¤Á¡¢³Æ¥¯¥í¥Ã¥¯¤Î³ä¹þ¤ß¤´¤È¤Ë¡¢¥·¥¹¥Æ¥à¤¬¥«¡¼¥Í¥ë¥³¡¼¥É¤ò¼Â¹Ô¤·¤Æ¤¤¤ì¤Ð¡¢ +°Ê²¼¤Î¤è¤¦¤Ë¥«¥¦¥ó¥¿¤ÎÃͤ¬¥¤¥ó¥¯¥ê¥á¥ó¥È¤µ¤ì¤ë¡£ +.IP +profile[address >> prof_shift]++; +.sp +.\"O The raw profiling information can be read from +.\"O .IR /proc/profile . +.\"O Probably you'll want to use a tool such as readprofile.c to digest it. +.\"O Writing to +.\"O .I /proc/profile +.\"O will clear the counters. +À¸¤Î¥×¥í¥Õ¥¡¥¤¥ê¥ó¥°¾ðÊó¤Ï¡¢ +.I /proc/profile +¤«¤é¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¤¬¡¢readprofile.c +¤Î¤è¤¦¤Ê¾ðÊó¤ò²Ã¹©¤¹¤ë¥Ä¡¼¥ë¤ò»È¤Ã¤¿¤Û¤¦¤¬Îɤ¤¤À¤í¤¦¡£ +.I /proc/profile +¤ËǤ°Õ¤Î¥Ç¡¼¥¿¤ò½ñ¹þ¤à¤È¡¢ +¥«¥¦¥ó¥¿¤Ï¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +.TP +.B "'swap=N1,N2,N3,N4,N5,N6,N7,N8'" +.\"O Set the eight parameters max_page_age, page_advance, page_decline, +.\"O page_initial_age, age_cluster_fract, age_cluster_min, pageout_weight, +.\"O bufferout_weight that control the kernel swap algorithm. +.\"O For kernel tuners only. +¥«¡¼¥Í¥ë¤Î¥¹¥ï¥Ã¥×¥¢¥ë¥´¥ê¥º¥à¤ò¥³¥ó¥È¥í¡¼¥ë¤¹¤ë +¼¡¤Î 8 ¤Ä¤Î¥Ñ¥é¥á¡¼¥¿¤ò¥»¥Ã¥È¤¹¤ë¡£ +max_page_age, page_advance, +page_decline, page_initial_age, age_cluster_fract, +age_cluster_min, pageout_weight, bufferout_weight. +¤³¤ì¤Ï¥«¡¼¥Í¥ë¤ò¥Á¥å¡¼¥ó¤¹¤ë¿Í¤Î¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +.TP +.B "'buff=N1,N2,N3,N4,N5,N6'" +.\"O Set the six parameters max_buff_age, buff_advance, buff_decline, +.\"O buff_initial_age, bufferout_weight, buffermem_grace that control +.\"O kernel buffer memory management. +.\"O For kernel tuners only. +¥«¡¼¥Í¥ë¤Î¥Ð¥Ã¥Õ¥¡¥á¥â¥ê´ÉÍý¤ò¥³¥ó¥È¥í¡¼¥ë¤¹¤ë +¼¡¤Î 6 ¤Ä¤Î¥Ñ¥é¥á¡¼¥¿¤ò¥»¥Ã¥È¤¹¤ë¡£ +max_buff_age, buff_advance, +buff_decline, buff_initial_age, bufferout_weight, +buffermem_grace. +¤³¤ì¤Ï¥«¡¼¥Í¥ë¤ò¥Á¥å¡¼¥ó¤¹¤ë¿Í¤Î¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +.\"O .SS "Boot Arguments for Ramdisk Use" +.SS "RAM ¥Ç¥£¥¹¥¯´ØÏ¢¤Îµ¯Æ°»þ°ú¿ô" +.\"O (Only if the kernel was compiled with +.\"O .BR CONFIG_BLK_DEV_RAM .) +.\"O In general it is a bad idea to use a ramdisk under Linux \(em +.\"O the system will use available memory more efficiently itself. +.\"O But while booting (or while constructing boot floppies) +.\"O it is often useful to load the floppy contents into a +.\"O ramdisk. +.\"O One might also have a system in which first +.\"O some modules (for file system or hardware) must be loaded +.\"O before the main disk can be accessed. +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_BLK_DEV_RAM +¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤¿¤È¤­¤Î¤ßÍ­¸ú¡£) +°ìÈÌŪ¤Ë¤Ï¡¢Linux ¤Ç RAM ¥Ç¥£¥¹¥¯¤ò»ÈÍѤ¹¤ë¤Î¤Ï¤¢¤Þ¤êÎɤ¤¹Í¤¨¤Ç¤Ï¤Ê¤¤¡£ +¥·¥¹¥Æ¥à¤ËǤ¤»¤Æ¤ª¤±¤Ð¤â¤Ã¤È¸úΨŪ¤Ë¥á¥â¥ê¤ò»ÈÍѤ¹¤ë¡£ +¤·¤«¤·¥Ö¡¼¥È»þ (¤Þ¤¿¤Ï¥Ö¡¼¥È¥Õ¥í¥Ã¥Ô¡¼¤ÎºîÀ®Ãæ) ¤Ë¤Ï¡¢ +¥Õ¥í¥Ã¥Ô¡¼¤ÎÆâÍƤò RAM ¥Ç¥£¥¹¥¯¤Ë¥í¡¼¥É¤¹¤ë¤ÈÊØÍø¤«¤â¤·¤ì¤Ê¤¤¡£ +¥á¥¤¥ó¥Ç¥£¥¹¥¯¤¬¥¢¥¯¥»¥¹²Äǽ¤Ë¤Ê¤ëÁ°¤Ë¡¢ +(¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ä¥Ï¡¼¥É¥¦¥§¥¢¤Ë´Ø¤¹¤ë) +¥â¥¸¥å¡¼¥ë¤ò¤¤¤¯¤Ä¤«¥í¡¼¥É¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¥·¥¹¥Æ¥à¤â¤¢¤ë¤À¤í¤¦¡£ + +.\"O In Linux 1.3.48, ramdisk handling was changed drastically. +.\"O Earlier, the memory was allocated statically, and there was +.\"O a 'ramdisk=N' parameter to tell its size. +.\"O (This could also +.\"O be set in the kernel image at compile time, or by use of +.\"O .BR rdev (8).) +.\"O These days ram disks use the buffer cache, and grow dynamically. +.\"O For a lot of information (e.g., how to use +.\"O .BR rdev (8) +.\"O in conjunction with the new ramdisk setup), see +.\"O .IR /usr/src/linux/Documentation/ramdisk.txt . +Linux ¤Î¥Ð¡¼¥¸¥ç¥ó 1.3.48 ¤Ë¤ª¤¤¤Æ¡¢ +RAM ¥Ç¥£¥¹¥¯¤Î¼è¤ê°·¤¤¤¬º¬Ä줫¤éÊѲ½¤·¤¿¡£ +¤½¤ì°ÊÁ°¤Þ¤Ç¤Ï¡¢¥á¥â¥ê¤ÏÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¡¢ +\&'ramdisk=N' ¥Ñ¥é¥á¡¼¥¿¤Ç¤½¤Î¥µ¥¤¥º¤ò»ØÄꤷ¤Æ¤¤¤¿¡£ +(¤³¤ÎÃͤϥ«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤ä +.BR rdev (8) +¤Ë¤è¤Ã¤Æ¤âÊѹ¹¤Ç¤­¤¿¡£) +¸½ºß¤Ï RAM ¥Ç¥£¥¹¥¯¤Ï¥Ð¥Ã¥Õ¥¡¥­¥ã¥Ã¥·¥å¤ò»ÈÍѤ·¤Æ¤ª¤ê¡¢ +ưŪ¤ËÀ®Ä¹¤¹¤ë¡£ +¤µ¤é¤Ë¿¤¯¤Î¾ðÊó (¤¿¤È¤¨¤Ð +.BR rdev (8) +¤¬¿·¤·¤¤ RAM ¥Ç¥£¥¹¥¯¤ÎÀßÄê¤È¤É¤Î¤è¤¦¤Ë´Ø·¸¤¹¤ë¤«) ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.I /usr/src/linux/Documentation/ramdisk.txt +¤ò»²¾È¡£ + +.\"O There are four parameters, two boolean and two integral. +4 ¤Ä¤Î¥Ñ¥é¥á¡¼¥¿¤¬¤¢¤ë¡£ÏÀÍýÃͤò¤È¤ë¤â¤Î¤¬ 2 ¤Ä¡¢À°¿ôÃͤò¤È¤ë¤â¤Î¤¬ 2 ¤Ä¡£ +.TP +.B "'load_ramdisk=N'" +.\"O If N=1, do load a ramdisk. +.\"O If N=0, do not load a ramdisk. +.\"O (This is the default.) +N=1 ¤Ê¤é RAM ¥Ç¥£¥¹¥¯¤ò¥í¡¼¥É¤¹¤ë¡£N=0 ¤Ê¤é¥í¡¼¥É¤·¤Ê¤¤ (¥Ç¥Õ¥©¥ë¥È)¡£ +.TP +.B "'prompt_ramdisk=N'" +.\"O If N=1, do prompt for insertion of the floppy. +.\"O (This is the default.) +.\"O If N=0, do not prompt. +.\"O (Thus, this parameter is never needed.) +N=1 ¤Ê¤é¥Õ¥í¥Ã¥Ô¡¼ÁÞÆþ¤òÂ¥¤¹¥×¥í¥ó¥×¥È¤ò½Ð¤¹ (¥Ç¥Õ¥©¥ë¥È)¡£ +N=0 ¤Ê¤é¥×¥í¥ó¥×¥È¤ò½Ð¤µ¤Ê¤¤¡£ +(½¾¤Ã¤Æ¡¢¤³¤Î¥Ñ¥é¥á¡¼¥¿¤ò»ØÄꤹ¤ëɬÍפϤޤºÌµ¤¤¤Ç¤¢¤í¤¦¡£) +.TP +.\"O .BR 'ramdisk_size=N' " or (obsolete) " 'ramdisk=N' +.BR 'ramdisk_size=N' " ¤â¤·¤¯¤Ï (¸Å¤¤·Á¼°¤Î) " 'ramdisk=N' +.\"O Set the maximal size of the ramdisk(s) to N kB. +.\"O The default is 4096 (4 MB). +¥é¥à¥Ç¥£¥¹¥¯¤ÎºÇÂ祵¥¤¥º¤ò N kB (¥­¥í¥Ð¥¤¥È) ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +¾Êά»þ¤Ï 4096 (4 MB)¡£ +.TP +.B "'ramdisk_start=N'" +.\"O Sets the starting block number (the offset on the floppy where +.\"O the ramdisk starts) to N. +.\"O This is needed in case the ramdisk follows a kernel image. +³«»Ï¥Ö¥í¥Ã¥¯ÈÖ¹æ +(¥Õ¥í¥Ã¥Ô¡¼ÀèƬ¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤Ç»ØÄꤷ¤¿ RAM ¥Ç¥£¥¹¥¯¤Î³«»ÏÅÀ) +¤ò N ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤Î¤¢¤È¤Ë RAM ¥Ç¥£¥¹¥¯¥¤¥á¡¼¥¸¤òÃÖ¤¯¾ì¹ç¤ËɬÍפȤʤ롣 +.TP +.B "'noinitrd'" +.\"O (Only if the kernel was compiled with +.\"O .B CONFIG_BLK_DEV_RAM +.\"O and +.\"O .BR CONFIG_BLK_DEV_INITRD .) +.\"O These days it is possible to compile the kernel to use initrd. +.\"O When this feature is enabled, the boot process will load the kernel +.\"O and an initial ramdisk; then the kernel converts initrd into +.\"O a "normal" ramdisk, which is mounted read-write as root device; +.\"O then /linuxrc is executed; afterwards the "real" root file system is mounted, +.\"O and the initrd file system is moved over to /initrd; finally +.\"O the usual boot sequence (e.g., invocation of /sbin/init) is performed. +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_BLK_DEV_RAM +¤È +.B CONFIG_BLK_DEV_INITRD +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¤­¤Î¤ßÍ­¸ú¡£) +ºÇ¶á¤Ï initrd ¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¥«¡¼¥Í¥ë¤ò¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤ë¤È¡¢ +¥Ö¡¼¥È¥×¥í¥»¥¹¤Ï¥«¡¼¥Í¥ë¤È RAM ¥Ç¥£¥¹¥¯¤ò¥í¡¼¥É¤·¡¢ +¥«¡¼¥Í¥ë¤Ï initrd ¤ò¡ÖÉáÄÌ¤Î¡× RAM ¥Ç¥£¥¹¥¯¤ËÊÑ´¹¤·¡¢ +¤³¤Î RAM ¥Ç¥£¥¹¥¯¤¬¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤È¤·¤Æ¡ÖÆɤ߽ñ¤­²Äǽ¡×¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +¼¡¤Ë /linuxrc ¤¬¼Â¹Ô¤µ¤ì¤ë¡£ +¤½¤Î¸å¡Ö¿¿¤Î¡×¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Þ¥¦¥ó¥È¤µ¤ì¡¢ +initrd ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï /initrd ¤Ë°Ü¤µ¤ì¤ë¡£ +ºÇ¸å¤ËÄ̾ï¤Î¥Ö¡¼¥È¥·¡¼¥±¥ó¥¹ (¶ñÂÎŪ¤Ë¤Ï /sbin/init ¤Î¸Æ¤Ó½Ð¤·) ¤¬¼Â¹Ô¤µ¤ì¤ë¡£ + +.\"O For a detailed description of the initrd feature, see +.\"O .IR /usr/src/linux/Documentation/initrd.txt . +initrd ¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ê²òÀâ¤Ï +.I /usr/src/linux/Documentation/initrd.txt +¤ò»²¾È¡£ + +.\"O The 'noinitrd' option tells the kernel that although it was compiled for +.\"O operation with initrd, it should not go through the above steps, but +.\"O leave the initrd data under +.\"O .IR /dev/initrd . +.\"O (This device can be used only once: the data is freed as soon as +.\"O the last process that used it has closed +.\"O .IR /dev/initrd .) +\&'noinitrd' ¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È¡¢ +¥«¡¼¥Í¥ë¤Ï (initrd Æ°ºî¤ò¹Ô¤¦¤è¤¦¤Ë¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ç¤â) +¾åµ­¤ÎÆ°ºî¤ò¹Ô¤Ê¤ï¤º¡¢Âå¤ï¤ê¤Ë initrd ¤Î¥Ç¡¼¥¿¤ò +.I /dev/initrd +¤Ë»Ä¤¹¡£ +(¤³¤Î¥Ç¥Ð¥¤¥¹¤Ï°ìÅÙ¤·¤«»È¤¨¤Ê¤¤¡£ +¥Ç¡¼¥¿¤Ï¡¢¤½¤Î¥Ç¡¼¥¿¤ò»È¤Ã¤¿ºÇ¸å¤Î¥×¥í¥»¥¹¤¬ +.I /dev/initrd +¤ò¥¯¥í¡¼¥º¤¹¤ë¤È¤¹¤°¤Ë²òÊü¤µ¤ì¤ë¡£) +.\"O .SS "BOOT ARGUMENTS FOR SCSI DEVICES" +.SS "SCSI ¥Ç¥Ð¥¤¥¹ÍѤε¯Æ°»þ°ú¿ô" +.\"O General notation for this section: +¤³¤ÎÀá¤Ë¤ª¤±¤ëÍѸ졧 + +.\"O .I iobase +.\"O -- the first I/O port that the SCSI host occupies. +.\"O These are specified in hexadecimal notation, +.\"O and usually lie in the range from 0x200 to 0x3ff. +.I iobase +-- SCSI ¥Û¥¹¥È¥¢¥À¥×¥¿¤¬ÀêÍ­¤¹¤ë I/O ¥Ý¡¼¥È¤ÎÀèƬ¥¢¥É¥ì¥¹¡£ +16 ¿Êɽµ­¤Ç»ØÄꤷ¡¢Ä̾ï 0x200 ¤«¤é 0x3ff ¤ÎÈϰϤ˰ÌÃÖ¤¹¤ë¡£ + +.\"O .I irq +.\"O -- the hardware interrupt that the card is configured to use. +.\"O Valid values will be dependent on the card in question, but will +.\"O usually be 5, 7, 9, 10, 11, 12, and 15. +.\"O The other values are usually +.\"O used for common peripherals like IDE hard disks, floppies, serial +.\"O ports, etc. +.I irq +-- ¥«¡¼¥É¤¬ÍøÍѤ¹¤ë¥Ï¡¼¥É¥¦¥§¥¢³ä¤ê¹þ¤ß¡£Í­¸ú¤ÊÃͤϥ«¡¼¥É¤Ë +¤è¤Ã¤Æ°Û¤Ê¤ë¤¬¡¢Ä̾ï¤Ï 5, 7, 9, 10, 11, 12, 15 ¤Ç¤¢¤ë¡£ +¤³¤ì°Ê³°¤ÎÃͤÏÄ̾IDE ¥Ï¡¼¥É¥Ç¥£¥¹¥¯¡¢¥Õ¥í¥Ã¥Ô¡¼¡¢ +¥·¥ê¥¢¥ë¥Ý¡¼¥È¤È¤¤¤Ã¤¿°ìÈÌŪ¤Ê¼þÊÕµ¡´ï¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¡£ + +.\"O .I scsi-id +.\"O -- the ID that the host adapter uses to identify itself on the +.\"O SCSI bus. +.\"O Only some host adapters allow you to change this value, as +.\"O most have it permanently specified internally. +.\"O The usual default value +.\"O is 7, but the Seagate and Future Domain TMC-950 boards use 6. +.I scsi-id +-- SCSI ¥Ð¥¹¾å¤Î¥Û¥¹¥È¥¢¥À¥×¥¿¤¬¼«Ê¬¼«¿È¤ò¼±Ê̤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë ID Èֹ档 +¤³¤ÎÃͤòÊѹ¹¤Ç¤­¤ë¥Û¥¹¥È¥¢¥À¥×¥¿¤â¤´¤¯´õ¤Ë¸ºß¤¹¤ë¤¬¡¢ +¤Û¤È¤ó¤É¤Ï¥¢¥À¥×¥¿ÆâÉô¤Ç¸ÇÄꤵ¤ì¤Æ¤¤¤ë¡£ +¤è¤¯»È¤ï¤ì¤ë¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 7 ¤Ç¤¢¤ë¤¬¡¢Seagate ¤â¤·¤¯¤Ï +Future Domain À½¤Î TMC-950 ¥Ü¡¼¥É¤Ç¤Ï 6 ¤¬»È¤ï¤ì¤ë¡£ + +.\"O .I parity +.\"O -- whether the SCSI host adapter expects the attached devices +.\"O to supply a parity value with all information exchanges. +.\"O Specifying a one indicates parity checking is enabled, +.\"O and a zero disables parity checking. +.\"O Again, not all adapters will support selection of parity +.\"O behavior as a boot argument. +.I parity +-- SCSI ¥Û¥¹¥È¥¢¥À¥×¥¿¤¬¼è¤êÉÕ¤±¤é¤ì¤¿¥Ç¥Ð¥¤¥¹¤È¤ÎÄÌ¿®¤ËºÝ¤·¤Æ +¥Ñ¥ê¥Æ¥£ÃͤòɬÍפȤ¹¤ë¤«¤É¤¦¤«¡£ +1 ¤ò»ØÄꤹ¤ë¤È¥Ñ¥ê¥Æ¥£¥Á¥§¥Ã¥¯¤¬Í­¸ú¤Ë¤Ê¤ê¡¢ +0 ¤Ç¥Ñ¥ê¥Æ¥£¥Á¥§¥Ã¥¯¤¬Ìµ¸ú¤Ë¤Ê¤ë¡£ +¤·¤«¤·¡¢¤¹¤Ù¤Æ¤Î¥Ç¥Ð¥¤¥¹¤¬¤³¤Îµ¯Æ°»þ°ú¿ô¤Ë¤è¤ë¥Ñ¥ê¥Æ¥£¤ÎÁªÂò¤ò +¥µ¥Ý¡¼¥È¤¹¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B "'max_scsi_luns=...'" +.\"O A SCSI device can have a number of 'subdevices' contained within +.\"O itself. +.\"O The most common example is one of the new SCSI CD-ROMs that +.\"O handle more than one disk at a time. +.\"O Each CD is addressed as a +.\"O \&'Logical Unit Number' (LUN) of that particular device. +.\"O But most +.\"O devices, such as hard disks, tape drives and such are only one device, +.\"O and will be assigned to LUN zero. +SCSI ¥Ç¥Ð¥¤¥¹¤ÏÊ£¿ô¤Î¡Ö¥µ¥Ö¥Ç¥Ð¥¤¥¹¡×¤ò¼«Ê¬¼«¿È¤ÎÆâÉô¤Ë»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +ºÇ¤â¤è¤¯¤¢¤ëÎã¤È¤·¤Æ¡¢°ì»þ¤Ë 1 Ëç°Ê¾å¤Î¥Ç¥£¥¹¥¯¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤ë +(¥Á¥§¥ó¥¸¥ã¡¼µ¡Ç½ÉÕ¤Î) SCSI CD-ROM ¤¬¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î CD ¤Ï¤½¤Î¥Ç¥Ð¥¤¥¹¤Î +¡ÖÏÀÍý¥æ¥Ë¥Ã¥ÈÈÖ¹æ (LUN)¡×¤Ë¤è¤Ã¤ÆÆÃÄꤵ¤ì¤ë¡£ +¤·¤«¤·¤Û¤È¤ó¤É¤Î¥Ç¥Ð¥¤¥¹ (Î㤨¤Ð¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤ä¥Æ¡¼¥×¥É¥é¥¤¥Ö) ¤Ï¡¢ +LUN ÈÖ¹æ 0 ¤¬³ä¤êÅö¤Æ¤é¤ì¤¿¡¢¤¿¤À¤Ò¤È¤Ä¤Î¥Ç¥Ð¥¤¥¹¤«¤é¤Ê¤ë¡£ + +.\"O Some poorly designed SCSI devices cannot handle being probed for +.\"O LUNs not equal to zero. +.\"O Therefore, if the compile-time flag +.\"O .B CONFIG_SCSI_MULTI_LUN +.\"O is not set, newer kernels will by default +.\"O only probe LUN zero. +À߷פ¬ÉÔ½½Ê¬¤Ê SCSI ¥Ç¥Ð¥¤¥¹¤Ç¤Ï 0 °Ê³°¤Î LUN ÈÖ¹æ¤Ø¤Î¼«Æ°¸¡½Ð¤ò +°·¤¨¤Ê¤¤¤³¤È¤¬¤¢¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_SCSI_MULTI_LUN +¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢ +ºÇ¶á¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï LUN ÈÖ¹æ 0 ¤Î¤ß¤ò¸¡½Ð¤¹¤ë¡£ + +.\"O To specify the number of probed LUNs at boot, one enters +.\"O \&'max_scsi_luns=n' as a boot arg, where n is a number between one and +.\"O eight. +.\"O To avoid problems as described above, one would use n=1 to +.\"O avoid upsetting such broken devices. +µ¯Æ°»þ¤ËÄ´¤Ù¤ë LUN ÈÖ¹æ¤ò»ØÄꤹ¤ë¾ì¹ç¡¢µ¯Æ°»þ°ú¿ô¤È¤·¤Æ +\&'max_scsi_luns=n' ¤ò»ØÄꤹ¤ë¡£n ¤Ï 1 ¤«¤é 8 ¤Î´Ö¤Ç»ØÄꤹ¤ë¡£ +n=1 °Ê¾å¤ÎÃͤò»ÈÍѤ·¤Ê¤¤¤è¤¦¤Ë¤¹¤ì¤Ð¡¢ +¤³¤Î¤è¤¦¤Ê¤¤¤«¤ì¤¿µ¡³£¤Ë¤Ò¤É¤¤Ìܤˤ¢¤ï¤µ¤ì¤º¤Ë¤¹¤à¤À¤í¤¦¡£ +.TP +.\"O .B "SCSI tape configuration" +.B SCSI ¥Æ¡¼¥×¥É¥é¥¤¥Ö¤ÎÀßÄê +.\"O Some boot time configuration of the SCSI tape driver can be achieved +.\"O by using the following: +SCSI ¥Æ¡¼¥×¥É¥é¥¤¥Ð¤Îµ¯Æ°»þÀßÄê¤Î°ìÉô¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¹Ô¤Ê¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.IP +.BI st= buf_size[,write_threshold[,max_bufs]] +.sp +.\"O The first two numbers are specified in units of kB. +.\"O The default +.\"O .I buf_size +.\"O is 32kB, and the maximum size that can be specified is a +.\"O ridiculous 16384kB. +.\"O The +.\"O .I write_threshold +.\"O is the value at which the buffer is committed to tape, with a +.\"O default value of 30kB. +.\"O The maximum number of buffers varies +.\"O with the number of drives detected, and has a default of two. +.\"O An example usage would be: +ºÇ½é¤Î 2 ¤Ä¤Î¿ô»ú¤Ï kB ñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.I buf_size +¤Î¥Ç¥Õ¥©¥ë¥È¤Ï 32kB ¤Ç¤¢¤ë¡£¾å¸Â¤Ï 16384kB ¤Þ¤Ç»ØÄê¤Ç¤­¤ë¡£ +.I write_threshold +¤Ï¥Ç¡¼¥¿½ñ¤­½Ð¤·¤ÎïçÃͤǡ¢ +¥Ð¥Ã¥Õ¥¡¤Î¥Ç¡¼¥¿¤Î¥µ¥¤¥º¤¬¤³¤ÎÃͤò±Û¤¨¤ë¤È¥Ç¡¼¥¿¤Ï¥Æ¡¼¥×¤Ë½ñ¤­½Ð¤µ¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 30kB ¤Ç¤¢¤ë¡£ +¥Ð¥Ã¥Õ¥¡¿ô¤ÎºÇÂçÃÍ +.RI ( max_bufs ) +¤Ï¸¡½Ð¤µ¤ì¤¿¥É¥é¥¤¥Ö¤Î¿ô¤Ë¤è¤Ã¤ÆÊѲ½¤¹¤ë¤¬¡¢¥Ç¥Õ¥©¥ë¥È¤Ï 2 ¤Ç¤¢¤ë¡£ +»ÈÍÑÎã¤ò°Ê²¼¤Ë¼¨¤¹¡£ +.IP +st=32,30,2 +.IP +.\"O Full details can be found in the file +.\"O .I Documentation/scsi/st.txt +.\"O (or +.\"O .I drivers/scsi/README.st +.\"O for older kernels) in the kernel source. +¾ÜºÙ¤Ï¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.I Documentation/scsi/st.txt +(¸Å¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï +.IR drivers/scsi/README.st ) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.\"O .B "Adaptec aha151x, aha152x, aic6260, aic6360, SB16-SCSI configuration" +.B Adaptec aha151x, aha152x, aic6260, aic6360, SB16-SCSI ¤ÎÀßÄê +.\"O The aha numbers refer to cards and the aic numbers refer to the actual +.\"O SCSI chip on these type of cards, including the Soundblaster-16 SCSI. +aha ¤Ë³¤¯ÈÖ¹æ¤Ï¥«¡¼¥É¤òɽ¤·¡¢ +aic ¤Ë³¤¯ÈÖ¹æ¤Ï¥«¡¼¥É¤ËÅëºÜ¤µ¤ì¤Æ¤¤¤ë¼ÂºÝ¤Î¥Á¥Ã¥×¤òɽ¤¹ +(Soundblaster-16 SCSI ¤â¸å¼Ô¤Ë´Þ¤Þ¤ì¤ë)¡£ + +.\"O The probe code for these SCSI hosts looks for an installed BIOS, and +.\"O if none is present, the probe will not find your card. +.\"O Then you will +.\"O have to use a boot arg of the form: +SCSI ¥Û¥¹¥È¤Î¸¡½Ð¥³¡¼¥É¤Ï¡¢ +¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë BIOS ¤òõ¤¹¡£ +¸«¤Ä¤«¤é¤Ê¤¤¤È¡¢¥«¡¼¥É¤Ï¸¡½Ð¤Ç¤­¤Ê¤¤¡£ +¤³¤Î¾ì¹ç¤Ï°Ê²¼¤Î¤è¤¦¤Ëµ¯Æ°»þ°ú¿ô¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.IP +.BI aha152x= iobase[,irq[,scsi-id[,reconnect[,parity]]]] +.IP +.\"O If the driver was compiled with debugging enabled, a sixth +.\"O value can be specified to set the debug level. +¤â¤·¥É¥é¥¤¥Ð¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¤¤¤¿¾ì¹ç¤Ï¡¢ +6 ÈÖÌܤÎÃͤǥǥХå°¥ì¥Ù¥ë¤ò»ØÄê¤Ç¤­¤ë¡£ + +.\"O All the parameters are as described at the top of this section, and the +.\"O .I reconnect +.\"O value will allow device disconnect/reconnect if a nonzero value +.\"O is used. +.\"O An example usage is as follows: +¤¹¤Ù¤Æ¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢¤³¤Î¥»¥¯¥·¥ç¥ó¤ÎºÇ½é¤ÇÀâÌÀ¤·¤¿Ä̤ê¤Ç¤¢¤ë¡£ +.I reconnect +¤Ë 0 °Ê³°¤ÎÃͤò»ØÄꤹ¤ë¤È¡¢¥Ç¥Ð¥¤¥¹¤òÀÚÃǤ·¤¿¤êÀܳ¤·¤¿¤ê¤Ç¤­¤ë¡£ +°Ê²¼¤ËÎã¤ò¼¨¤¹¡£ +.IP +aha152x=0x340,11,7,1 +.IP +.\"O Note that the parameters must be specified in order, meaning that if +.\"O you want to specify a parity setting, then you will have to specify an +.\"O iobase, irq, scsi-id and reconnect value as well. +¥Ñ¥é¥á¡¼¥¿¤Ïɬ¤º¾åµ­¤Î½çÈ֤ɤª¤ê¤Ë»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Î㤨¤Ð¡¢¥Ñ¥ê¥Æ¥£ (parity) ¤òÀßÄꤷ¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +iobase, irq, scsi-id, reconnect ¤âƱ»þ¤Ë»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ +.TP +.\"O .B "Adaptec aha154x configuration" +.B Adaptec aha154x ¤ÎÀßÄê +.\"O The aha1542 series cards have an i82077 floppy controller onboard, +.\"O while the aha1540 series cards do not. +.\"O These are busmastering cards, +.\"O and have parameters to set the ''fairness'' that is used to share +.\"O the bus with other devices. +.\"O The boot arg looks like the following. +aha1542 ¥·¥ê¡¼¥º¤Î¥«¡¼¥É¤Ï +i82077 ¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯¥³¥ó¥È¥í¡¼¥é¤ò¥Ü¡¼¥É¤ËÅëºÜ¤·¤Æ¤¤¤ë¡£ +°ìÊý aha1540 ¥·¥ê¡¼¥º¤Î¥«¡¼¥É¤ÏÅëºÜ¤·¤Æ¤¤¤Ê¤¤¡£ +¤³¤ì¤é¤Ï¶¦¤Ë¥Ð¥¹¥Þ¥¹¥¿¥«¡¼¥É¤Ç¤¢¤ê¡¢ +¾¤Î¥Ç¥Ð¥¤¥¹¤È¥Ð¥¹¤ò¶¦Í­¤¹¤ëºÝ¤Ë¡¢ +¤É¤Î¤¯¤é¤¤¡Ö¥Õ¥§¥¢¤Ë¡×¿¶¤ëÉñ¤¦¤«¤ò»ØÄꤹ¤ë¥Ñ¥é¥á¡¼¥¿¤¬¤¢¤ë¡£ +µ¯Æ°»þ°ú¿ô¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ»ØÄꤹ¤ë¡£ +.IP +.BI aha1542= iobase[,buson,busoff[,dmaspeed]] +.IP +.\"O Valid iobase values are usually one of: 0x130, 0x134, 0x230, 0x234, +.\"O 0x330, 0x334. +.\"O Clone cards may permit other values. +Í­¸ú¤Ê iobase ¤ÎÃͤϼ¡¤ÎÄ̤ꡣ +0x130, 0x134, 0x230, 0x234, 0x330, 0x334¡£ +¥¯¥í¡¼¥ó¥«¡¼¥É¤ÎÃæ¤Ë¤Ï¾¤ÎÃͤò»ØÄê¤Ç¤­¤ë¤â¤Î¤â¤¢¤ë¡£ + +.\"O The +.\"O .IR buson ", " busoff +.\"O values refer to the number of microseconds that the +.\"O card dominates the ISA bus. +.\"O The defaults are 11us on, and 4us off, so +.\"O that other cards (such as an ISA LANCE Ethernet card) have a chance to +.\"O get access to the ISA bus. +.IR buson ", " busoff +Ãͤϥ«¡¼¥É¤¬ISA ¥Ð¥¹¤òÀêÍ­¤¹¤ë»þ´Ö¤ò¥Þ¥¤¥¯¥íÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ +¾Êά»þ¤Ï¤½¤ì¤¾¤ì 11us on ¤È 4us off ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ç¡¢ +¾¤Î¥«¡¼¥É (Î㤨¤Ð ISA LANCE ¥¤¡¼¥µ¥Í¥Ã¥È¥«¡¼¥É) ¤â +ISA ¥Ð¥¹¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ + +.\"O The +.\"O .I dmaspeed +.\"O value refers to the rate (in MB/s) at which the DMA +.\"O (Direct Memory Access) transfers proceed. +.\"O The default is 5MB/s. +.\"O Newer revision cards allow you to select this value as part of the +.\"O soft-configuration, older cards use jumpers. +.\"O You can use values up to +.\"O 10MB/s assuming that your motherboard is capable of handling it. +.\"O Experiment with caution if using values over 5MB/s. +.I dmaspeed +ÃÍ¤Ï DMA (Direct Memory Access) žÁ÷®ÅÙ¤ò MB/s ñ°Ì¤ÇÀßÄꤹ¤ë¡£ +¾Êά»þ¤Ï 5MB/s ¤Ç¤¢¤ë¡£¿·¤·¤¤¥ê¥Ó¥¸¥ç¥ó¤Î¥«¡¼¥É¤Ç¤Ï¡¢ +¤³¤ÎÃͤò»È¤Ã¤¿¥½¥Õ¥È¥¦¥§¥¢¤Ë¤è¤ëÀßÄ꤬¤Ç¤­¤ë¡£ +¸Å¤¤¥«¡¼¥É¤Ï¥¸¥ã¥ó¥ÑÀßÄê¤òɬÍפȤ¹¤ë¡£ +¥Þ¥¶¡¼¥Ü¡¼¥É¤¬Âбþ¤·¤Æ¤¤¤ì¤ÐºÇÂç 10MB/s ¤Þ¤Ç»ØÄê²Äǽ¤Ç¤¢¤ë¡£ +5MB/s °Ê¾å¤ÎÃͤò»È¤¦¾ì¹ç¤ÏÃí°Õ¤·¤Æ¼Â¸³¤·¤Æ¤«¤é¤Ë¤¹¤ë¤³¤È¡£ +.TP +.\"O .B "Adaptec aha274x, aha284x, aic7xxx configuration" +.B Adaptec aha274x, aha284x, aic7xxx ¤ÎÀßÄê +.\"O These boards can accept an argument of the form: +¤³¤ì¤é¤Î¥Ü¡¼¥É¤Ï°Ê²¼¤Î·Á¼°¤Ç»ØÄꤹ¤ë¡£ +.IP +.BI aic7xxx= extended,no_reset +.IP +.\"O The +.\"O .I extended +.\"O value, if nonzero, indicates that extended translation for large +.\"O disks is enabled. +.\"O The +.\"O .I no_reset +.\"O value, if nonzero, tells the driver not to reset the SCSI bus when +.\"O setting up the host adapter at boot. +.I extended +Ãͤ¬ 0 °Ê³°¤Î»þ¤Ï¡¢ÂçÍÆÎ̥ǥ£¥¹¥¯ÍѤγÈÄ¥ÊÑ´¹¤¬Í­¸ú¤Ë¤Ê¤ë¡£ +.I no_reset +Ãͤò 0 °Ê³°¤ÎÃͤˤ¹¤ë¤È¡¢¥Û¥¹¥È¥¢¥À¥×¥¿¤Î¸¡½Ð»þ¤Ë¡¢ +¥É¥é¥¤¥Ð¤Ë¤è¤ë SCSI ¥Ð¥¹¤Î½é´ü²½¤ò¹Ô¤ï¤Ê¤¤¡£ +.TP +.\"O .B "AdvanSys SCSI Hosts configuration ('advansys=')" +.B "AdvanSys SCSI ¥Û¥¹¥È¥¢¥À¥×¥¿¤ÎÀßÄê ('advansys=')" +.\"O The AdvanSys driver can accept up to four i/o addresses that will be +.\"O probed for an AdvanSys SCSI card. +.\"O Note that these values (if used) do +.\"O not effect EISA or PCI probing in any way. +.\"O They are only used for +.\"O probing ISA and VLB cards. +.\"O In addition, if the driver has been +.\"O compiled with debugging enabled, the level of debugging output can be +.\"O set by adding an 0xdeb[0-f] parameter. +.\"O The 0-f allows setting the +.\"O level of the debugging messages to any of 16 levels of verbosity. +AdvanSys ¥É¥é¥¤¥Ð¤Ï¥«¡¼¥É¤Î¸¡½ÐÀè¤È¤·¤Æ +4 ¤Ä¤Î I/O ¥¢¥É¥ì¥¹¤ò¼õ¤±ÉÕ¤±¤ë¡£ +EISA ¤ä PCI ¥«¡¼¥É¤Ç¤Ï¤³¤ì¤é¤ò»ØÄꤷ¤Æ¤âÁ´¤¯¸ú²Ì¤¬Ìµ¤¤¡£ +ISA µÚ¤Ó VLB ¥«¡¼¥É¤Î¸¡½Ð¤ËÂФ·¤Æ¤Î¤ßÍѤ¤¤é¤ì¤ë¡£ +¤µ¤é¤Ë¡¢¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥óÉÕ¤­¤Ç¥É¥é¥¤¥Ð¤¬¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¥Ç¥Ð¥Ã¥°¾ðÊó¤Î½ÐÎÏ¥ì¥Ù¥ë¤È¤·¤Æ 0xdeb[0-f] ¥Ñ¥é¥á¡¼¥¿¤òÄɲäǤ­¤ë¡£ +0-f ¤Ë¤è¤ê¥Ç¥Ð¥Ã¥°¥á¥Ã¥»¡¼¥¸¤Î¾ðÊó¤Î¥ì¥Ù¥ë¤ò 16 Ãʳ¬¤Ç»ØÄꤹ¤ë¡£ +.TP +.B "AM53C974" +.IP +.BI AM53C974= host-scsi-id,target-scsi-id,max-rate,max-offset +.TP +.\"O .B "BusLogic SCSI Hosts configuration ('BusLogic=')" +.B BusLogic SCSI ¥Û¥¹¥È¥¢¥À¥×¥¿¤ÎÀßÄê ('BusLogic=') +.IP +.BI BusLogic= N1,N2,N3,N4,N5,S1,S2,... +.IP +.\"O For an extensive discussion of the BusLogic command-line parameters, +.\"O see +.\"O .I /usr/src/linux/drivers/scsi/BusLogic.c +.\"O (lines 3149-3270 in the kernel version I am looking at). +.\"O The text +.\"O below is a very much abbreviated extract. +Buslogic ¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ñ¥é¥á¡¼¥¿¤Ë´Ø¤¹¤ë¾ÜºÙ¤ÊµÄÏÀ¤Ï +.I /usr/src/linux/drivers/scsi/BusLogic.c +(Ãø¼Ô¤¬¤¤¤Þ¸«¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤Ç¤Ï 4350-4497 ¹ÔÌÜ) ¤ò»²¾È¤¹¤ë¤³¤È¡£ +°Ê²¼¤Ï¤³¤ì¤òÈó¾ï¤Ë¤ª¤ª¤¶¤Ã¤Ñ¤ËÍ×Ìó¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +.\"O The parameters N1-N5 are integers. +.\"O The parameters S1,... are strings. +.\"O N1 is the I/O Address at which the Host Adapter is located. +.\"O N2 is the Tagged Queue Depth to use for Target Devices that support +.\"O Tagged Queuing. +.\"O N3 is the Bus Settle Time in seconds. +.\"O This is the amount of time +.\"O to wait between a Host Adapter Hard Reset which +.\"O initiates a SCSI Bus Reset and issuing any SCSI Commands. +.\"O N4 is the Local Options (for one Host Adapter). +.\"O N5 is the Global Options (for all Host Adapters). +¥Ñ¥é¥á¡¼¥¿ N1 ¤«¤é N5 ¤Þ¤Ç¤ÏÀ°¿ô¤Ç¤¢¤ë¡£ +¥Ñ¥é¥á¡¼¥¿ S1 °Ê¹ß¤Ïʸ»úÎó¤Ç¤¢¤ë¡£ +N1 ¤Ï¥Û¥¹¥È¥¢¥À¥×¥¿¤¬Â¸ºß¤¹¤ë I/O ¥¢¥É¥ì¥¹¡£ +N2 ¤Ï¥¿¥°¥­¥å¡¼¥¤¥ó¥°¤ò¥µ¥Ý¡¼¥È¤¹¤ë¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ»ÈÍѤ¹¤ë¥­¥å¡¼¤Î¿¼¤µ¡£ +N3 ¤Ï¥Ð¥¹°ÂÄê»þ´Ö (BST) ¤òÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ +¤³¤ì¤Ï¥Û¥¹¥È¥¢¥À¥×¥¿¤Î¥Ï¡¼¥É¥ê¥»¥Ã¥È¤Ë¤è¤ê SCSI ¥Ð¥¹¤ò¥ê¥»¥Ã¥È¤·¤Æ¤«¤é +SCSI ¥³¥Þ¥ó¥É¤Îȯ¹Ô¤ò³«»Ï¤¹¤ë¤Þ¤Ç¤ÎÂÔ¤Á»þ´Ö¤Ç¤¢¤ë¡£ +N4 ¤Ï¥í¡¼¥«¥ë¥ª¥×¥·¥ç¥ó (¤Ò¤È¤Ä¤Î¥Û¥¹¥È¥¢¥À¥×¥¿ÍÑ)¡£ +N5 ¤Ï¥°¥í¡¼¥Ð¥ë¥ª¥×¥·¥ç¥ó (¤¹¤Ù¤Æ¤Î¥Û¥¹¥È¥¢¥À¥×¥¿ÍÑ)¡£ + +.\"O The string options are used to provide control over Tagged Queuing +.\"O (TQ:Default, TQ:Enable, TQ:Disable, TQ:), over +.\"O Error Recovery (ER:Default, ER:HardReset, ER:BusDeviceReset, +.\"O ER:None, ER:), and over Host Adapter Probing +.\"O (NoProbe, NoProbeISA, NoSortPCI). +ʸ»úÎ󥪥ץ·¥ç¥ó¤Ï°Ê²¼¤ÎÆ°ºî¤òÀ©¸æ¤¹¤ë: +¥¿¥°¥­¥å¡¼¥¤¥ó¥° (TQ:Default, TQ:Enable, TQ:Disable, TQ:)¡¢ +¥¨¥é¡¼Éüµ¢ (ER:Default, ER:HardReset, ER:BusDeviceReset, +ER:None, ER:)¡¢ +¥Û¥¹¥È¥¢¥À¥×¥¿¤Î¸¡½Ð (NoProbe, NoProbeISA, NoSortPCI)¡£ +.TP +.\"O .B "EATA/DMA configuration" +.B EATA/DMA ¤ÎÀßÄê +.\"O The default list of i/o ports to be probed can be changed by +¸¡½ÐÂоݤˤ¹¤ë I/O ¥Ý¡¼¥È¤Î¥ê¥¹¥È¤ò°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÊѹ¹¤Ç¤­¤ë¡£ +.IP +.BI eata= iobase,iobase,...\fP. +.TP +.\"O .B "Future Domain TMC-16x0 configuration" +.B Future Domain TMC-16x0 ¤ÎÀßÄê +.IP +.BI fdomain= iobase,irq[,adapter_id] +.TP +.\"O .B "Great Valley Products (GVP) SCSI controller configuration" +.B Great Valley Products (GVP) SCSI ¥³¥ó¥È¥í¡¼¥é¤ÎÀßÄê +.IP +.BI gvp11= dma_transfer_bitmask +.TP +.\"O .B "Future Domain TMC-8xx, TMC-950 configuration" +.B Future Domain À½ TMC-8xx, TMC-950 ¤ÎÀßÄê +.IP +.BI tmc8xx= mem_base,irq +.IP +.\"O The +.\"O .I mem_base +.\"O value is the value of the memory mapped I/O region that +.\"O the card uses. +.\"O This will usually be one of the following values: +.\"O 0xc8000, 0xca000, 0xcc000, 0xce000, 0xdc000, 0xde000. +.I mem_base +¤Ë¤Ï¥«¡¼¥É¤¬»ÈÍѤ¹¤ë¥á¥â¥ê¥Þ¥Ã¥× I/O ¤ÎÎΰè¤ò»ØÄꤹ¤ë¡£Ä̾ï +¤Ï¼¡¤ÎÃͤΤɤ줫¤¬»È¤ï¤ì¤ë: 0xc8000, 0xca000, 0xcc000, +0xce000, 0xdc000, 0xde000¡£ +.TP +.\"O .B "IN2000 configuration" +.B IN2000 ¤ÎÀßÄê +.IP +.BI in2000= S +.IP +.\"O where S is a comma-separated string of items keyword[:value]. +.\"O Recognized keywords (possibly with value) are: +.\"O ioport:addr, noreset, nosync:x, period:ns, disconnect:x, +.\"O debug:x, proc:x. +.\"O For the function of these parameters, see +.\"O .IR /usr/src/linux/drivers/scsi/in2000.c . +S ¤Ï¥³¥ó¥Þ¶èÀÚ¤ê¤Îʸ»úÎó¤Ç¡¢³Æ¹àÌÜ¤Ï keyword[:value] ·Á¼°¤Ç»ØÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ë¥­¡¼¥ï¡¼¥É¤Ï°Ê²¼¤ÎÄ̤ꡣ +ioport:addr, noreset, nosync:x, period:ns, disconnect:x, debug:x, proc:x¡£ +¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤Îµ¡Ç½¤Ë¤Ä¤¤¤Æ¤Ï +.I /usr/src/linux/drivers/scsi/in2000.c +¤ò»²¾È¡£ +.TP +.\"O .B "NCR5380 and NCR53C400 configuration" +.B NCR5380 ¤ª¤è¤Ó NCR53C400 ¤ÎÀßÄê +.\"O The boot arg is of the form +¤³¤Îµ¯Æ°»þ°ú¿ô¤Ï°Ê²¼¤Î½ñ¼°¤Ç»ØÄꤹ¤ë¡£ +.IP +.BI ncr5380= iobase,irq,dma +.IP +.\"O or +¤Þ¤¿¤Ï +.IP +.BI ncr53c400= iobase,irq +.IP +.\"O If the card doesn't use interrupts, then an IRQ value of 255 (0xff) will +.\"O disable interrupts. +.\"O An IRQ value of 254 means to autoprobe. +.\"O More details can be found in the file +.\"O .I Documentation/scsi/g_NCR5380.txt +.\"O (or +.\"O .I drivers/scsi/README.g_NCR5380 +.\"O for older kernels) in the kernel source. +¥«¡¼¥É¤¬ IRQ ¤ò»ÈÍѤ·¤Ê¤¤¾ì¹ç¤Ï¡¢ +255 (0xff) ¤ò»ØÄꤹ¤ì¤Ð̵¸ú¤Ë¤Ç¤­¤ë¡£ +IRQ ¤Ë 254 ¤ò»ØÄꤹ¤ë¤È¼«Æ°¸¡½Ð¤¹¤ë¡£ +¾ÜºÙ¤Ï¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.I Documentation/scsi/g_NCR5380.txt +(¸Å¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï +.IR drivers/scsi/README.g_NCR5380 ) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.\"O .B "NCR53C8xx configuration" +.B NCR53C8xx ¤ÎÀßÄê +.IP +.BI ncr53c8xx= S +.IP +.\"O where S is a comma-separated string of items keyword:value. +.\"O Recognized keywords are: mpar (master_parity), spar (scsi_parity), +.\"O disc (disconnection), specf (special_features), ultra (ultra_scsi), +.\"O fsn (force_sync_nego), tags (default_tags), sync (default_sync), +.\"O verb (verbose), debug (debug), burst (burst_max). +.\"O For the function of the assigned values, see +.\"O .IR /usr/src/linux/drivers/scsi/ncr53c8xx.c . +S ¤Ï¥³¥ó¥Þ¶èÀÚ¤ê¤Îʸ»úÎó¤Ç¡¢³Æ¹àÌÜ¤Ï keyword[:value] ·Á¼°¤Ç»ØÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ë¥­¡¼¥ï¡¼¥É¤Ï°Ê²¼¤ÎÄ̤ꡣ +mpar (master_parity), +spar (scsi_parity), disc (disconnection), specf +(special_features), ultra (ultra_scsi), fsn +(force_sync_nego), tags (default_tags), sync (default_sync), +verb (verbose), debug (debug), burst (burst_max)¡£ +¤³¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤Îµ¡Ç½¤Ë¤Ä¤¤¤Æ¤Ï +.I /usr/src/linux/drivers/scsi/README.ncr53c8xx +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.\"O .B "NCR53c406a configuration" +.B NCR53c406a ¤ÎÀßÄê +.IP +.BI ncr53c406a= iobase[,irq[,fastpio]] +.IP +.\"O Specify irq = 0 for noninterrupt driven mode. +.\"O Set fastpio = 1 for fast pio mode, 0 for slow mode. +³ä¤ê¹þ¤ß̵¤·¤ÇÆ°ºî¤¹¤ë¥â¡¼¥É¤Ë¤Ï irq ¤Ë 0 ¤ò»ØÄꤹ¤ë¡£ +¹â® PIO ¥â¡¼¥É¤Ï fastpio ¤Ë 1 ¤ò»ØÄꤷ¡¢Ä㮥⡼¥É¤Ï 0 ¤ò»ØÄꤹ¤ë¡£ +.TP +.\"O .B "Pro Audio Spectrum configuration" +.B Pro Audio Spectrum ¤ÎÀßÄê +.\"O The PAS16 uses a NC5380 SCSI chip, and newer models support +.\"O jumperless configuration. +.\"O The boot arg is of the form: +PAS16 ¤Ï NC5380 SCSI ¥Á¥Ã¥×¤ò»ÈÍѤ·¤Æ¤ª¤ê¡¢ +ºÇ¶á¤Î¥â¥Ç¥ë¤Ï¥¸¥ã¥ó¥Ñ¥ì¥¹¤ÎÀßÄê¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +µ¯Æ°»þ°ú¿ô¤Î½ñ¼°¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +.BI pas16= iobase,irq +.IP +.\"O The only difference is that you can specify an IRQ value of 255, which +.\"O will tell the driver to work without using interrupts, albeit at a +.\"O performance loss. +.\"O The iobase is usually 0x388. +Í£°ì¤Î°ã¤¤¤È¤·¤Æ¡¢ +IRQ ¤Ë 255 ¤ò»ØÄꤹ¤ì¤Ð³ä¤ê¹þ¤ß¤ò»ÈÍѤ·¤Ê¤¤¤è¤¦¥É¥é¥¤¥Ð¤Ë»Ø¼¨¤Ç¤­¤ë +(¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ÏÄã²¼¤¹¤ë)¡£ +Ä̾ï iobase ¤Ï 0x388 ¤Ç¤¢¤ë¡£ +.TP +.\"O .B "Seagate ST-0x configuration" +.B Seagate À½ ST-0x ¤ÎÀßÄê +.\"O If your card is not detected at boot time, +.\"O you will then have to use a boot arg of the form: +¥«¡¼¥É¤¬µ¯Æ°»þ¤Ëǧ¼±¤µ¤ì¤Ê¤¤¾ì¹ç¤Ï°Ê²¼¤Î¤è¤¦¤Ê»ØÄ꤬ɬÍפˤʤë¤À¤í¤¦¡£ +.IP +.BI st0x= mem_base,irq +.IP +.\"O The +.\"O .I mem_base +.\"O value is the value of the memory mapped I/O region that +.\"O the card uses. +.\"O This will usually be one of the following values: +.\"O 0xc8000, 0xca000, 0xcc000, 0xce000, 0xdc000, 0xde000. +.I mem_base +¤Ë¤Ï¥«¡¼¥É¤¬»ÈÍѤ¹¤ë¥á¥â¥ê¥Þ¥Ã¥× I/O ¤ÎÎΰè¤ò»ØÄꤹ¤ë¡£ +Ä̾ï¤Ï¼¡¤Î¤É¤ì¤«: +0xc8000, 0xca000, 0xcc000, 0xce000, 0xdc000, 0xde000¡£ +TP +.\"O .B "Trantor T128 configuration" +.B Trantor À½ T128 ¤ÎÀßÄê +.\"O These cards are also based on the NCR5380 chip, and accept the +.\"O following options: +¤³¤Î¥«¡¼¥É¤â NCR5380 ¥Á¥Ã¥×¤òÍøÍѤ·¤Æ¤ª¤ê¡¢ +°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤ò¼õ¤±ÉÕ¤±¤ë¡£ +.IP +.BI t128= mem_base,irq +.IP +.\"O The valid values for +.\"O .I mem_base +.\"O are as follows: 0xcc000, 0xc8000, 0xdc000, 0xd8000. +Í­¸ú¤Ê +.I mem_base +¤ÎÃͤϼ¡¤ÎÄ̤ê¤Ç¤¢¤ë: 0xcc000, 0xc8000, 0xdc000, 0xd8000¡£ +.TP +.\"O .B "UltraStor 14F/34F configuration" +.B UltraStor À½ 14F/34F ¤ÎÀßÄê +.\"O The default list of i/o ports to be probed can be changed by +¼«Æ°¸¡½Ð¤ò»î¤ß¤ë I/O ¥Ý¡¼¥È¤Î¥ê¥¹¥È¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÊѹ¹¤Ç¤­¤ë¡£ +.IP +.BI eata= iobase,iobase,... . +.TP +.\"O .B "WD7000 configuration" +.B WD7000 ¤ÎÀßÄê +.IP +.BI wd7000= irq,dma,iobase +.\"O .SS "Commodore Amiga A2091/590 SCSI controller configuration" +.SS Commodore Amiga À½ A2091/590 SCSI ¥³¥ó¥È¥í¡¼¥é¤ÎÀßÄê +.IP +.BI wd33c93= S +.IP +.\"O where S is a comma-separated string of options. +.\"O Recognized options are +.\"O nosync:bitmask, nodma:x, period:ns, disconnect:x, debug:x, +.\"O clock:x, next. +.\"O For details, see +.\"O .IR /usr/src/linux/drivers/scsi/wd33c93.c . +S ¤Ï¥³¥ó¥Þ¶èÀÚ¤ê¤Îʸ»úÎó¤Ç¡¢³Æ¹àÌÜ¤Ï keyword[:value] ·Á¼°¤Ç»ØÄꤹ¤ë¡£ +ǧ¼±¤µ¤ì¤ë¥ª¥×¥·¥ç¥ó¤Ï°Ê²¼¤ÎÄ̤ꡣ +nosync:bitmask, nodma:x, period:ns, +disconnect:x, debug:x, clock:x, next¡£ +¾ÜºÙ¤Ï +.I /usr/src/linux/drivers/scsi/wd33c93.c +¤ò»²¾È¤»¤è¡£ +.\"O .SS "Hard Disks" +.SS ¥Ï¡¼¥É¥Ç¥£¥¹¥¯ +.TP +.\"O .B "IDE Disk/CD-ROM Driver Parameters" +.B "IDE Disk/CD-ROM ¥É¥é¥¤¥Ð¤Î¥Ñ¥é¥á¡¼¥¿" +.\"O The IDE driver accepts a number of parameters, which range from disk +.\"O geometry specifications, to support for broken controller chips. +.\"O Drive specific options are specified by using 'hdX=' with X in 'a'-'h'. +IDE ¥É¥é¥¤¥Ð¤Ï¡¢ +¥Ç¥£¥¹¥¯¤Î¥¸¥ª¥á¥È¥ê»ØÄ꤫¤é¥Ð¥°¤Î¤¢¤ë¥³¥ó¥È¥í¡¼¥é¥Á¥Ã¥×¤Î¥µ¥Ý¡¼¥È¤Þ¤Ç¡¢ +¿ô¿¤¯¤Î¥Ñ¥é¥á¡¼¥¿¤ò¼õ¤±ÉÕ¤±¤ë¡£ +¥É¥é¥¤¥Ö¤òÆÃÄꤹ¤ë¤Ë¤Ï 'hdX=' ¤ò»È¤¦¡£ +¤³¤³¤Ç X ¤Ë¤Ï 'a' ¤«¤é 'h' ¤Îʸ»ú¤ò»ØÄꤹ¤ë¡£ + +.\"O Non-drive specific options are specified with the prefix 'hd='. +.\"O Note that using a drive specific prefix for a non-drive specific option +.\"O will still work, and the option will just be applied as expected. +¤¢¤ë¥É¥é¥¤¥Ö¤ËÆÃÍ­¤Ê¤â¤Î¤Ç¤Ï¤Ê¤¤¥ª¥×¥·¥ç¥ó¤Ï¡¢hd= ¤òÁ°¤ËÉÕ¤±¤Æ»ØÄꤹ¤ë¡£ +¥É¥é¥¤¥ÖÆÃÍ­¤Ç¤Ê¤¤¥ª¥×¥·¥ç¥ó¤ËÂФ·¤Æ¥É¥é¥¤¥Ö»ØÄê +('hdX=') ¤òÁ°ÃÖ¤·¤Æ¤âÌäÂê¤Ï¤Ê¤¤¡£ +¤½¤Î¥ª¥×¥·¥ç¥ó¤Ï´üÂÔÄ̤ꤽ¤Î¥É¥é¥¤¥Ö¤ËŬÍѤµ¤ì¤ë¡£ +.\"nakano ¤È¤¤¤¦¤Î¤¬ "as expected" ¤À¤È»×¤¦¤ó¤À¤±¤É... + +.\"O Also note that 'hd=' can be used to refer to the next unspecified +.\"O drive in the (a, ..., h) sequence. +.\"O For the following discussions, +.\"O the 'hd=' option will be cited for brevity. +.\"O See the file +.\"O .I Documentation/ide.txt +.\"O (or +.\"O .I drivers/block/README.ide +.\"O for older kernels) in the kernel source for more details. +\&'hd=' ¤Ï¡¢(a, ..., h) ¤Î¥·¡¼¥±¥ó¥¹¤Ë¤ª¤¤¤Æ¡¢ +¤Þ¤À»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¼¡¤Î¥É¥é¥¤¥Ö¤ò»Ø¤¹¤¿¤á¤Ë¤â»È¤¨¤ë¡£ +¤³¤ì°Ê¹ß¤Ç¤Ï´Êñ¤Î¤¿¤á¤Ë 'hd=' ¤ò»È¤Ã¤ÆÀâÌÀ¤¹¤ë¡£ +¤µ¤é¤Ë¾Ü¤·¤¤¾ðÊó¤òÆÀ¤ë¤Ë¤Ï¡¢¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.I Documentation/ide.txt +(¸Å¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï +.IR drivers/block/README.ide ) +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.\"O .B "The 'hd=cyls,heads,sects[,wpcom[,irq]]' options" +.B 'hd=cyls,heads,sects[,wpcom[,irq]]' ¥ª¥×¥·¥ç¥ó +.\"O These options are used to specify the physical geometry of the disk. +.\"O Only the first three values are required. +.\"O The cylinder/head/sectors +.\"O values will be those used by fdisk. +.\"O The write precompensation value +.\"O is ignored for IDE disks. +.\"O The IRQ value specified will be the IRQ +.\"O used for the interface that the drive resides on, and is not really a +.\"O drive-specific parameter. +¤³¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Ç¥£¥¹¥¯¤ÎʪÍýŪ¤Ê¥¸¥ª¥á¥È¥ê¤ò»ØÄꤹ¤ë¤¿¤á¤Ë»È¤¦¡£ +ºÇ½é¤Î 3 ¤Ä¤ÎÃͰʹߤϾÊά¤Ç¤­¤ë¡£ +¥·¥ê¥ó¥À (cyls)¡¢¥Ø¥Ã¥É (heads)¡¢¥»¥¯¥¿ (sects) ¤Î³ÆÃÍ¤Ï +fdisk ¤ÇÍѤ¤¤é¤ì¤ë¤â¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +½ñ¤­¹þ¤ßÊäÀµ (wpcom) ÃÍ¤Ï IDE ¥Ç¥£¥¹¥¯¤Ç¤Ï̵»ë¤µ¤ì¤ë¡£ +IRQ Ãͤˤϡ¢¤½¤Î¥É¥é¥¤¥Ö¤¬Àܳ¤µ¤ì¤Æ¤¤¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ÍѤ¤¤ë +IRQ ¤ò»ØÄꤹ¤ë +(ËÜÍè¤Î°ÕÌ£¤Ç¤Ï¡Ö¥É¥é¥¤¥Ö¤ËÆÃÍ­¡×¤Î¥Ñ¥é¥á¡¼¥¿¤Ç¤Ï¤Ê¤¤)¡£ +.TP +.\"O .B "The 'hd=serialize' option" +.B 'hd=serialize' ¥ª¥×¥·¥ç¥ó +.\"O The dual IDE interface CMD-640 chip is broken as designed such that +.\"O when drives on the secondary interface are used at the same time as +.\"O drives on the primary interface, it will corrupt your data. +.\"O Using this +.\"O option tells the driver to make sure that both interfaces are never +.\"O used at the same time. +¥Ç¥å¥¢¥ë IDE ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë CMD-640 ¥Á¥Ã¥×¤Ë¤ÏÀß·×¾å¤ÎÌäÂ꤬¤¢¤Ã¤Æ¡¢ +¥»¥«¥ó¥À¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¾å¤Î¥É¥é¥¤¥Ö¤È +¥×¥é¥¤¥Þ¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¾å¤Î¥É¥é¥¤¥Ö¤ò +Ʊ»þ¤Ë»ÈÍѤ¹¤ë¤È¥Ç¡¼¥¿¤¬Ç˲õ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤ë¤È¡¢ +¥É¥é¥¤¥Ð¤ÏξÊý¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ +Ʊ»þ¤Ë»ÈÍѤµ¤ì¤ë¤³¤È¤¬ÀäÂФˤʤ¤¤è¤¦¤Ë¤¹¤ë¡£ +.TP +.\"O .B "The 'hd=dtc2278' option" +.B 'hd=dtc2278' ¥ª¥×¥·¥ç¥ó +.\"O This option tells the driver that you have a DTC-2278D IDE interface. +.\"O The driver then tries to do DTC-specific operations to enable the +.\"O second interface and to enable faster transfer modes. +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢DTC-2278D IDE ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬»È¤ï¤ì¤Æ¤¤¤ë +¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +¤¹¤ë¤È¥É¥é¥¤¥Ð¤Ï¡¢DTC ÆÃÍ­¤Îµ¡Ç½ +(2 ÈÖÌܤΥ¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤È¹â®žÁ÷¥â¡¼¥É) +¤ò»ÈÍѲÄǽ¤Ë¤¹¤ë¤è¤¦»î¤ß¤ë¡£ +.TP +.\"O .B "The 'hd=noprobe' option" +.B 'hd=noprobe' ¥ª¥×¥·¥ç¥ó +.\"O Do not probe for this drive. +.\"O For example, +¤³¤Î¥É¥é¥¤¥Ö¤Î¼«Æ°¸¡½Ð¤ò¤·¤Ê¤¤¡£ +Î㤨¤Ð +.IP +hdb=noprobe hdb=1166,7,17 +.IP +.\"O would disable the probe, but still specify the drive geometry so +.\"O that it would be registered as a valid block device, and hence +.\"O usable. +¤È¤¹¤ë¤È¼«Æ°¸¡½Ð¤¬Ìµ¸ú¤Ë¤Ê¤ë¡£ +¤·¤«¤·¥É¥é¥¤¥Ö¤Î¥¸¥ª¥á¥È¥ê¤ò»ØÄꤷ¤Æ¤¤¤ë¤Î¤Ç¡¢ +¤³¤Î¥É¥é¥¤¥Ö¤ÏÀµ¤·¤¤¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤È¤·¤ÆÅÐÏ¿¤µ¤ì¡¢»ÈÍѲÄǽ¤Ë¤Ê¤ë¡£ +.TP +.\"O .B "The 'hd=nowerr' option" +.B 'hd=nowerr' ¥ª¥×¥·¥ç¥ó +.\"O Some drives apparently have the +.\"O .B WRERR_STAT +.\"O bit stuck on permanently. +.\"O This enables a work-around for these broken devices. +¥É¥é¥¤¥Ö¤Ë¤è¤Ã¤Æ¤Ï¡¢½ñ¤­¹þ¤ß¥¨¥é¡¼ +.RB ( WRERR_STAT ) +¥Ó¥Ã¥È¤¬¥¯¥ê¥¢¤Ç¤­¤Ê¤¯¤Ê¤ë¤³¤È¤¬¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢ +¤³¤Î¤è¤¦¤Ê²õ¤ì¤¿¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë²óÈòµ¡Ç½¤¬Í­¸ú¤Ë¤Ê¤ë¡£ +.TP +.\"O .B "The 'hd=cdrom' option" +.B "'hd=cdrom' ¥ª¥×¥·¥ç¥ó" +.\"O This tells the IDE driver that there is an ATAPI compatible CD-ROM +.\"O attached in place of a normal IDE hard disk. +.\"O In most cases the CD-ROM +.\"O is identified automatically, but if it isn't then this may help. +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢Ä̾ï¤Î IDE ¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤ÎÂå¤ï¤ê¤Ë¡¢ +ATAPI ¸ß´¹¤Î CDROM ¤¬Â³¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò IDE ¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +CD-ROM ¤Ï¤¿¤¤¤Æ¤¤¼«Æ°Åª¤Ëǧ¼±¤µ¤ì¤ë¤¬¡¢ +¤¦¤Þ¤¯¹Ô¤«¤Ê¤¤¾ì¹ç¤Ë»î¤·¤Æ¤ß¤ë¤ÈÎɤ¤¡£ +.TP +.\"O .B "Standard ST-506 Disk Driver Options ('hd=')" +.B ¥¹¥¿¥ó¥À¡¼¥É ST-506 ¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ð¤Î¥ª¥×¥·¥ç¥ó ('hd=') +.\"O The standard disk driver can accept geometry arguments for the disks +.\"O similar to the IDE driver. +.\"O Note however that it only expects three +.\"O values (C/H/S); any more or any less and it will silently ignore you. +.\"O Also, it only accepts 'hd=' as an argument, that is, 'hda=' +.\"O and so on are not valid here. +.\"O The format is as follows: +¥¹¥¿¥ó¥À¡¼¥É¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ð¤Ï +IDE ¥É¥é¥¤¥Ð¤ÈƱÍͤΥ¸¥ª¥á¥È¥ê»ØÄê¤ò°ú¿ô¤Ë¤È¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤¿¤À¤·¼õ¤±ÉÕ¤±¤ëÃͤϤÁ¤ç¤¦¤É 3 ¤Ä (C/H/S) ¤Ë¸Â¤é¤ì¤ë¡£ +¤½¤ì°Ê¾å¤ÎÃͤ䤽¤ì°Ê²¼¤ÎÃͤò»ØÄꤹ¤ë¤È¡¢¥É¥é¥¤¥Ð¤ÏÌۤäƤ½¤Î»ØÄê¤ò̵»ë¤¹¤ë¡£ +¤Þ¤¿°ú¿ô¤È¤·¤Æ¼õ¤±Æþ¤ì¤é¤ì¤ë¤Î¤Ï 'hd=' ¤Î·Á¼°¤À¤±¤Ç¤¢¤ë¡£ +¤Ä¤Þ¤ê 'hda=' ¤Î¤è¤¦¤Ê»ØÄê¤Ï¤³¤³¤Ç¤ÏÀµ¤·¤¯¤Ê¤¤¡£ +½ñ¼°¤Ï¼¡¤ÎÄ̤ꡣ +.IP +hd=cyls,heads,sects +.IP +.\"O If there are two disks installed, the above is repeated with the +.\"O geometry parameters of the second disk. +2 Âæ¤Î¥Ç¥£¥¹¥¯¤¬Àܳ¤µ¤ì¤Æ¤¤¾ì¹ç¤Ï¡¢ +2 ÈÖÌܤΥǥ£¥¹¥¯¤ËÂФ·¤Æ¤â¾åµ­¤Î¥¸¥ª¥á¥È¥ê¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +.\"O .B "XT Disk Driver Options ('xd=')" +.B XT ¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ð¤Î¥ª¥×¥·¥ç¥ó ('xd=') +.\"O If you are unfortunate enough to be using one of these old 8 bit cards +.\"O that move data at a whopping 125kB/s then here is the scoop. +.\"O If the card is not recognized, you will have to use a boot arg of the form: +¤³¤ì¤é¤Î¸Å¤¤ 8 bit ¥«¡¼¥É (125kB/s ¤ÎžÁ÷®ÅÙ¤·¤«¤Ê¤¤!) +¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ÉÔ¹¬¤Ê¿Í¤Î¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +¥«¡¼¥É¤¬Ç§¼±¤µ¤ì¤Ê¤¤¾ì¹ç¤Ï°Ê²¼¤Î½ñ¼°¤Çµ¯Æ°»þ°ú¿ô¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¤À¤í¤¦¡£ +.IP +xd=type,irq,iobase,dma_chan +.IP +.\"O The type value specifies the particular manufacturer of the card, +.\"O overriding autodetection. +.\"O For the types to use, consult the +.\"O .I drivers/block/xd.c +.\"O source file of the kernel you are using. +.\"O The type is an index in the list +.\"O .I xd_sigs +.\"O and in the course of time +.\" 1.1.50, 1.3.81, 1.3.99, 2.0.34, 2.1.67, 2.1.78, 2.1.127 +.\"O types have been added to or deleted from the middle of the list, +.\"O changing all type numbers. +.\"O Today (Linux 2.5.0) the types are +.\"O 0=generic; 1=DTC 5150cx; 2,3=DTC 5150x; 4,5=Western Digital; +.\"O 6,7,8=Seagate; 9=Omti; 10=XEBEC, and where here several types are +.\"O given with the same designation, they are equivalent. +type Ãͤˤϥ«¡¼¥É¤Î¥á¡¼¥«¡¼¤ò»ØÄꤷ¡¢¤³¤ì¤Ï¼«Æ°¸¡ÃΤè¤êÍ¥À褵¤ì¤ë¡£ +»ØÄꤹ¤Ù¤­ type ¤ÎÃͤˤĤ¤¤Æ¤Ï¡¢»È¤Ã¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë +.I drivers/block/xd.c +¤òÄ´¤Ù¤Æ¤Û¤·¤¤¡£type ¤Ï¥ê¥¹¥È +.I xd_sigs +¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¡¢Îò»Ë¤È¶¦¤ËÄɲ䵤줿¤êºï½ü¤µ¤ì¤¿¤ê¤·¤Æ¤­¤¿¡£ +¥ê¥¹¥È¤ÎÅÓÃæ¤Ç¤ÎÄɲᦺï½ü¤â¹Ô¤ï¤ì¤¿¤Î¤Ç¡¢ +¤½¤Î¾ì¹ç¤Ï¤¹¤Ù¤Æ¤Î type Èֹ椬Êѹ¹¤µ¤ì¤¿¡£ +º£Æü (Linux 2.5.0) ¤Ë¤ª¤±¤ë type ¤Ï¡¢ +0=generic; 1=DTC 5150cx; 2,3=DTC 5150x; 4,5=Western Digital; +6,7,8=Seagate; 9=Omti; 10=XEBEC ¤Ç¤¢¤ë¡£ +¤³¤³¤Ç¤Ï¤¤¤¯¤Ä¤«¤Î type ¤ËƱ¤¸»ØÄ꤬Ϳ¤¨¤é¤ì¤Æ¤¤¤ë¤¬¡¢ +¤½¤ì¤é¤ÏÅù²Á¤Ç¤¢¤ë¡£ + +0=¥Î¡¼¥Ö¥é¥ó¥É¡¢1=DTC¡¢2,3,4=Western Digital¡¢5,6,7=Seagate¡¢8=OMTI +Ʊ¤¸¥á¡¼¥«¡¼¤ËÊ£¿ô¤ÎÃͤ¬¤¢¤ë¤Î¤Ï¸¡½Ð¤Ë»ÈÍѤµ¤ì¤ë BIOS ʸ»úÎó¤Î°ã¤¤¤Ç¤¢¤ë¡£ +BIOS ʸ»úÎó¤Ï type ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£ + +.\"O The xd_setup() function does no checking on the values, and assumes +.\"O that you entered all four values. +.\"O Don't disappoint it. +.\"O Here is an +.\"O example usage for a WD1002 controller with the BIOS disabled/removed, +.\"O using the 'default' XT controller parameters: +xd_setup() ´Ø¿ô¤Ï°ú¿ô¤ò¥Á¥§¥Ã¥¯¤»¤º¡¢ +4 ¤Ä¤ÎÃͤ¬¤¹¤Ù¤Æ»ØÄꤵ¤ì¤ë¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤ë¡£ +°ú¿ô¤ò¾Êά¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +Îã¤È¤·¤Æ¡¢BIOS ¤¬Ìµ¸ú¤Ë¤µ¤ì¤¿ (¤¢¤ë¤¤¤Ïºï½ü¤µ¤ì¤¿) +WD1002 ¥³¥ó¥È¥í¡¼¥é¤Î¾ì¹ç¤ò¼¨¤¹ +(¥Ñ¥é¥á¡¼¥¿¤Ë¤Ï XT ¥³¥ó¥È¥í¡¼¥é¤Î¡Ö¥Ç¥Õ¥©¥ë¥È¡×¤ÎÃͤò»È¤Ã¤Æ¤¤¤ë)¡£ +.IP +xd=2,5,0x320,3 +.TP +.\"O .B "Syquest's EZ* removable disks" +.B Syquest À½ EZ* ¥ê¥à¡¼¥Ð¥Ö¥ë¥Ç¥£¥¹¥¯ +.IP +.BI ez= iobase[,irq[,rep[,nybble]]] +.\"O .SS "IBM MCA Bus Devices" +.SS "IBM MCA ¥Ð¥¹¾å¤Î¥Ç¥Ð¥¤¥¹" +.\"O See also +.\"O .IR /usr/src/linux/Documentation/mca.txt . +.I /usr/src/linux/Documentation/mca.txt +¤â»²¾È¤»¤è¡£ +.TP +.\"O .B "PS/2 ESDI hard disks" +.B PS/2 ESDI ¥Ï¡¼¥É¥Ç¥£¥¹¥¯ +.\"O It is possible to specify the desired geometry at boot time: +˾¤à¥¸¥ª¥á¥È¥ê¤òµ¯Æ°»þ¤Ë»ØÄê¤Ç¤­¤ë¡£ +.IP +.BI ed= cyls,heads,sectors. +.IP +.\"O For a ThinkPad-720, add the option +ThinkPad-720 ¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤òÄɲ乤뤳¤È¡£ +.IP +.\"O .BR tp720=1 . +.B tp720=1 +.TP +.\"O .B "IBM Microchannel SCSI Subsystem configuration" +.B IBM Microchannel SCSI ¥µ¥Ö¥·¥¹¥Æ¥à¤ÎÀßÄê +.IP +.BI ibmmcascsi= N +.IP +.\"O where N is the \fIpun\fP (SCSI ID) of the subsystem. +N ¤Ï¥µ¥Ö¥·¥¹¥Æ¥à¤Î \fIpun\fP (SCSI ID) ¤òɽ¤¹¡£ +.TP +.\"O .B "The Aztech Interface" +.B Aztech ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O The syntax for this type of card is: +¤³¤Î¥¿¥¤¥×¤Î¥«¡¼¥É¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +aztcd=iobase[,magic_number] +.IP +.\"O If you set the magic_number to 0x79 then the driver will try and run +.\"O anyway in the event of an unknown firmware version. +.\"O All other values +.\"O are ignored. +magic_number ¤Ë 0x79 ¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢ +¥É¥é¥¤¥Ð¤Ï¥Õ¥¡¡¼¥à¥¦¥§¥¢¤Î¥Ð¡¼¥¸¥ç¥ó¤¬Ê¬¤«¤é¤Ê¤¤¾ì¹ç¤Ç¤â¡¢ +¤È¤Ë¤«¤¯¼Â¹Ô¤ò»î¤ß¤ë¡£ +¤½¤Î¾¤ÎÃͤϤ¹¤Ù¤Æ̵»ë¤µ¤ì¤ë¡£ +.TP +.\"O .B "Parallel port CD-ROM drives" +.B "¥Ñ¥é¥ì¥ë¥Ý¡¼¥È CD-ROM ¥É¥é¥¤¥Ö" +.\"O Syntax: +½ñ¼°: +.IP +.\"O pcd.driveN=prt,pro,uni,mod,slv,dly +pcd.driveN=port,pro,uni,mod,slv,dly +.br +pcd.nice=nice +.IP +.\"O where 'port' is the base address, 'pro' is the protocol number, 'uni' +.\"O is the unit selector (for chained devices), 'mod' is the mode (or \-1 +.\"O to choose the best automatically), 'slv' is 1 if it should be a slave, +.\"O and 'dly' is a small integer for slowing down port accesses. +.\"O The 'nice' parameter controls the driver's use of idle CPU time, at the +.\"O expense of some speed. +¤³¤³¤Ç 'port' ¤Ï¥Ù¡¼¥¹¥¢¥É¥ì¥¹¡¢'pro' +¤Ï¥×¥í¥È¥³¥ëÈֹ桢'uni' ¤Ï¥æ¥Ë¥Ã¥È¥»¥ì¥¯¥¿ +(¥Á¥§¥¤¥ó¥Ç¥Ð¥¤¥¹ÍÑ)¡¢'mod' ¤Ï¥â¡¼¥É +(¤¢¤ë¤¤¤Ï¼«Æ°Åª¤ËºÇŬ¤Î¤â¤Î¤òÁª¤Ð¤»¤ë¤Ë¤Ï \-1)¡¢'slv' +¤Ï¥¹¥ì¡¼¥Ö¤Ë¤·¤¿¤¤¾ì¹ç¤Ë 1¡¢'dly' +¤Ï¥Ý¡¼¥È¥¢¥¯¥»¥¹¤òÃÙ¤¯¤·¤¿¤¤¾ì¹ç¤Ë¾®¤µ¤ÊÀ°¿ô¤òÍ¿¤¨¤ë¡£'nice' ¥Ñ¥é¥á¡¼¥¿¤Ï¡¢ +¥É¥é¥¤¥Ð¤Î¥¢¥¤¥É¥ë CPU »þ´Ö¤Î»È¤¤Êý¤òÀ©¸æ¤¹¤ë¡£ +¤¿¤À¤·Â®Å٤Ϥ¢¤ëÄøÅÙÄã²¼¤¹¤ë¡£ +.TP +.\"O .B "The CDU-31A and CDU-33A Sony Interface" +.B Sony À½ CDU-31A ¤È CDU-33A ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O This CD-ROM interface is found on some of the Pro Audio Spectrum sound +.\"O cards, and other Sony supplied interface cards. +.\"O The syntax is as follows: +¤³¤Î CD-ROM ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï¡¢ +Pro Audio Spectrum ¥µ¥¦¥ó¥É¥«¡¼¥É¤Î°ìÉô¤ä +¥½¥Ë¡¼¤¬¶¡µë¤¹¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥«¡¼¥É¤Ç»È¤ï¤ì¤Æ¤¤¤ë¡£ +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +cdu31a=iobase,[irq[,is_pas_card]] +.IP +.\"O Specifying an IRQ value of zero tells the driver that hardware +.\"O interrupts aren't supported (as on some PAS cards). +.\"O If your card +.\"O supports interrupts, you should use them as it cuts down on the CPU +.\"O usage of the driver. +IRQ ¤Ë 0 ¤ò»ØÄꤹ¤ë¤È¡¢ +¥Ï¡¼¥É¥¦¥§¥¢³ä¤ê¹þ¤ß¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë +(PAS ¥«¡¼¥É¤Ë¤Ï¤½¤Î¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ë)¡£ +»ÈÍѤ¹¤ë¥«¡¼¥É¤¬³ä¤ê¹þ¤ß¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤Ê¤é¡¢ +¥É¥é¥¤¥Ð¤Ë¤è¤ë CPU ¤ÎÉé²Ù¤ò¸º¤é¤¹¤¿¤á¤Ë¤â³ä¤ê¹þ¤ß¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O The +.\"O .I is_pas_card +.\"O should be entered as 'PAS' if using a Pro Audio Spectrum card, +.\"O and otherwise it should not be specified at all. +.I is_pas_card +¤Ë¤Ï¡¢Pro Audio Spectrum ¥«¡¼¥É¤ò»ÈÍѤ·¤Æ¤¤¤ë¤È¤­¤Ë¤Ï 'PAS' ¤ò»ØÄꤷ¡¢ +¤½¤¦¤Ç¤Ê¤¤¤È¤­¤Ë¤Ï¤Ê¤Ë¤â»ØÄꤷ¤Ê¤¤¡£ +.TP +.\"O .B "The CDU-535 Sony Interface" +.B Sony À½ CDU-535 ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O The syntax for this CD-ROM interface is: +¤³¤Î CD-ROM ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +sonycd535=iobase[,irq] +.IP +.\"O A zero can be used for the I/O base as a 'placeholder' if one wishes +.\"O to specify an IRQ value. +IRQ ¤ÎÃͤÀ¤±¤ò»ØÄꤷ¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +iobase Ãͤò 0 ¤È¤¹¤ì¤Ðñ¤Ê¤ë·êËä¤á¤È²ò¼á¤µ¤ì¤ë¡£ +.TP +.\"O .B "The GoldStar Interface" +.B GoldStar ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O The syntax for this CD-ROM interface is: +¤³¤Î CD-ROM ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +gscd=iobase +.TP +.\"O .B "The ISP16 CD-ROM Interface" +.B ISP16 CD-ROM ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O Syntax: +½ñ¼°: +.IP +isp16=[iobase[,irq[,dma[,type]]]] +.IP +.\"O (three integers and a string). +.\"O If the type is given as 'noisp16', +.\"O the interface will not be configured. +.\"O Other recognized types +.\"O are: 'Sanyo", 'Sony', 'Panasonic' and 'Mitsumi'. +(À°¿ôÃÍ 3 ¤Ä¤Èʸ»úÎó 1 ¤Ä¡£) type ¤Ë 'noisp16' ¤ò»ØÄꤹ¤ë¤È¡¢ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÎÀßÄê¤Ï¹Ô¤Ê¤ï¤ì¤Ê¤¤¡£ +type ¤Ë¤Ï¤³¤Î¾¤Ë¤â 'Sanyo', 'Sony', 'Panasonic', 'Mitsumi' ¤¬»ØÄê¤Ç¤­¤ë¡£ +.TP +.\"O .B "The Mitsumi Standard Interface" +.B Mitsumi ɸ½à¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O The syntax for this CD-ROM interface is: +¤³¤ÎCD-ROM ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +mcd=iobase,[irq[,wait_value]] +.IP +.\"O The +.\"O .I wait_value +.\"O is used as an internal timeout value for people who are +.\"O having problems with their drive, and may or may not be implemented +.\"O depending on a compile-time #define. +.\"O The Mitsumi FX400 is an IDE/ATAPI CD-ROM player and does not use +.\"O the mcd driver. +.I wait_value +¤Ï¥É¥é¥¤¥Ö¤ËÌäÂ꤬¤¢¤ë¾ì¹ç¤Ë¡¢ +¥É¥é¥¤¥ÐÆâÉô¤Î¥¿¥¤¥à¥¢¥¦¥È¤Î»ØÄê¤ËÍѤ¤¤ë¡£ +¥³¥ó¥Ñ¥¤¥ë»þ¤Î #define ¤Ë¤è¤Ã¤Æ¼ÂÁõ¤µ¤ì¤ë¤«¤µ¤ì¤Ê¤¤¤«¤¬·è¤Þ¤ë¡£ +Mitsumi FX400 ¤Ï IDE/ATAPI CD-ROM ¥×¥ì¥¤¥ä¡¼¤Ç¤¢¤ê¡¢ +¤³¤Î mcd ¥É¥é¥¤¥Ð¤Ï»ÈÍѤ·¤Ê¤¤¡£ +.TP +.\"O .B "The Mitsumi XA/MultiSession Interface" +.B Mitsumi XA/¥Þ¥ë¥Á¥»¥Ã¥·¥ç¥ó¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O This is for the same hardware as above, but the driver has extended features. +.\"O Syntax: +¤³¤ì¤Ï¾åµ­¤ÈƱ¤¸¥Ï¡¼¥É¥¦¥§¥¢¤À¤¬¡¢³ÈÄ¥µ¡Ç½¤¬¤¢¤ë¡£ +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +mcdx=iobase[,irq] +.TP +.\"O .B "The Optics Storage Interface" +.B Optics ¥¹¥È¥ì¡¼¥¸¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O The syntax for this type of card is: +¤³¤Î¥«¡¼¥É¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +optcd=iobase +.TP +.\"O .B "The Phillips CM206 Interface" +.B Phillips CM206 ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O The syntax for this type of card is: +¤³¤Î¥«¡¼¥É¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +cm206=[iobase][,irq] +.IP +.\"O The driver assumes numbers between 3 and 11 are IRQ values, and +.\"O numbers between 0x300 and 0x370 are I/O ports, so you can specify one, +.\"O or both numbers, in any order. +.\"O It also accepts 'cm206=auto' to enable +.\"O autoprobing. +¥É¥é¥¤¥Ð¤Ï IRQ ÃͤȤ·¤Æ 3 ¤«¤é 11 ¤Þ¤Ç¡¢ +I/O ¥Ý¡¼¥È¥¢¥É¥ì¥¹¤ÎÃͤȤ·¤Æ 0x300 ¤«¤é 0x370 ¤òÁÛÄꤷ¤Æ¤¤¤ë¡£ +¤¤¤º¤ì¤«°ìÊý¡¢¤¢¤ë¤¤¤ÏξÊý¤ò»ØÄê¤Ç¤­¤ë¡£½çÈÖ¤âÌä¤ï¤Ê¤¤¡£ +\&'cm206=auto' ¤È¤¹¤ë¤³¤È¤Ë¤è¤ê¼«Æ°¸¡½Ð¤â¤Ç¤­¤ë¡£ +.TP +.\"O .B "The Sanyo Interface" +.B Sanyo ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O The syntax for this type of card is: +¤³¤Î¥«¡¼¥É¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +sjcd=iobase[,irq[,dma_channel]] +.TP +.\"O .B "The SoundBlaster Pro Interface" +.B SoundBlaster Pro ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O The syntax for this type of card is: +¤³¤Î¥«¡¼¥É¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +sbpcd=iobase,type +.IP +.\"O where type is one of the following (case sensitive) strings: +.\"O \&'SoundBlaster', 'LaserMate', or 'SPEA'. +.\"O The I/O base is that of the +.\"O CD-ROM interface, and not that of the sound portion of the card. +type ÃÍ¤Ë¤Ï 'SoundBlaster', 'LaserMate', 'SPEA' ¤Î¤¦¤Á¤Ò¤È¤Ä¤ò»ØÄê¤Ç¤­¤ë +(Âçʸ»ú¾®Ê¸»ú¤¬¶èÊ̤µ¤ì¤ë)¡£ +iobase ¤Ï CD-ROM ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÎÃͤǤ¢¤ë¡£ +¥«¡¼¥É¤Î¥µ¥¦¥ó¥ÉÉô¤ÎÃͤȴְ㤨¤Ê¤¤¤³¤È¡£ +.\"O .SS "Ethernet Devices" +.SS "¥¤¡¼¥µ¥Í¥Ã¥È¥Ç¥Ð¥¤¥¹" +.\"O Different drivers make use of different parameters, but they all at +.\"O least share having an IRQ, an I/O port base value, and a name. +.\"O In its most generic form, it looks something like this: +¥É¥é¥¤¥Ð¤¬°Û¤Ê¤ë¤ÈÍѤ¤¤ë¥Ñ¥é¥á¡¼¥¿¤â°Û¤Ê¤ë¤¬¡¢ +¤¹¤Ù¤Æ¤Î¥É¥é¥¤¥Ð¤Ï¡¢¾¯¤Ê¤¯¤È¤â³ä¤ê¹þ¤ßÈÖ¹æ (irq)¡¢ +I/O ¥Ý¡¼¥È¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹ (iobase)¡¢Ì¾Á° (name) ¤ò»ý¤Ä¡£ +ºÇ¤â°ìÈÌŪ¤Ê·Á¼°¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +ether=irq,iobase[,param_1[,...param_8]],name +.IP +.\"O The first nonnumeric argument is taken as the name. +.\"O The param_n values (if applicable) usually have different meanings for each +.\"O different card/driver. +.\"O Typical param_n values are used to specify +.\"O things like shared memory address, interface selection, DMA channel +.\"O and the like. +ºÇ½é¤Î¿ô»ú¤Ç¤Ê¤¤ÃͤÏ̾Á°¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +param_n ¤ÎÃͤϥ«¡¼¥É (¥É¥é¥¤¥Ð) ¤´¤È¤Ë°Û¤Ê¤ë°ÕÌ£¤ò»ý¤Ä¡£ +¤è¤¯¤¢¤ëÌÜŪ¤Ï¡¢¶¦Í­¥á¥â¥ê¥¢¥É¥ì¥¹¤Î»ØÄê¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÎÁªÂò¡¢ +DMA ¥Á¥ã¥Í¥ë¤Ê¤É¤Ç¤¢¤ë¡£ + +.\"O The most common use of this parameter is to force probing for a second +.\"O ethercard, as the default is to only probe for one. +.\"O This can be accomplished with a simple: +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤ÎºÇ¤â¤è¤¯¤¢¤ëÍøÍÑË¡¤Ï¡¢ +2 ÈÖÌܤΠEthernet ¥«¡¼¥É¤ò¶¯À©Åª¤Ë¸¡½Ð¤µ¤»¤ë¾ì¹ç¤Ç¤¢¤ë +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 1 Ë礷¤«¸¡½Ð¤·¤Ê¤¤)¡£ +¤³¤ì¤Ï´Êñ¤Ç¡¢¼¡¤Î¤è¤¦¤Ë¤¹¤ì¤Ð¤è¤¤¡£ +.IP +ether=0,0,eth1 +.IP +.\"O Note that the values of zero for the IRQ and I/O base in the above +.\"O example tell the driver(s) to autoprobe. +¤³¤ÎÎã¤Ç IRQ ¤È I/O ¥Ù¡¼¥¹¥¢¥É¥ì¥¹¤Ë 0 ¤ò»ØÄꤷ¤Æ¤¤¤ë¤Î¤Ï¡¢ +¥É¥é¥¤¥Ð¤Ë¼«Æ°¸¡½Ð¤ò¤¹¤ë¤è¤¦ÅÁ¤¨¤Æ¤¤¤ë¤Î¤Ç¤¢¤ë¡£ + +.\"O The Ethernet-HowTo has extensive documentation on using multiple +.\"O cards and on the card/driver-specific implementation +.\"O of the param_n values where used. +.\"O Interested readers should refer to +.\"O the section in that document on their particular card. +Ethernet-HOWTO ¤Ç¤Ï¡¢Ê£¿ô¤Î¥«¡¼¥É¤ò»È¤¦¤ä¤êÊý¤ä¡¢ +¥«¡¼¥É¤ä¥É¥é¥¤¥Ð¤ËÆÃÍ­¤Î param_n ÃͤΰÕÌ£¤Ë¤Ä¤¤¤Æ¡¢ +¤º¤Ã¤È¾ÜºÙ¤Ë²òÀ⤵¤ì¤Æ¤¤¤ë¡£ +¶½Ì£¤ò»ý¤Ã¤¿ÆɼԤϡ¢¤³¤Îʸ½ñ¤Ë¤¢¤¿¤ê¡¢ +¼«Ê¬¤Î¥«¡¼¥É¤Ë´Ø¤·¤Æ½ñ¤«¤ì¤Æ¤¤¤ë¥»¥¯¥·¥ç¥ó¤ò»²¾È¤¹¤ë¤ÈÎɤ¤¡£ +.\"O .SS "The Floppy Disk Driver" +.SS ¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ð +.\"O There are many floppy driver options, and they are all listed in +.\"O .I Documentation/floppy.txt +.\"O (or +.\"O .I drivers/block/README.fd +.\"O for older kernels) in the kernel source. +.\"O This information is taken directly +.\"O from that file. +¥Õ¥í¥Ã¥Ô¡¼¥É¥é¥¤¥Ð¤Î¥ª¥×¥·¥ç¥ó¤Ï¿¿ô¤¢¤ê¡¢ +¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.I Documentation/floppy.txt +(¸Å¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï +.IR drivers/block/README.fd ) +¤Ë¤¹¤Ù¤Æµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +°Ê²¼¤Î¾ðÊó¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤«¤é¤È¤Ã¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.B "floppy=mask,allowed_drive_mask" +.\"O Sets the bit mask of allowed drives to mask. +.\"O By default, only units 0 +.\"O and 1 of each floppy controller are allowed. +.\"O This is done because +.\"O certain nonstandard hardware (ASUS PCI motherboards) mess up the +.\"O keyboard when accessing units 2 or 3. +.\"O This option is somewhat +.\"O obsoleted by the cmos option. +»È¤Ã¤Æ¤è¤¤¥É¥é¥¤¥Ö¤Ë¤«¤±¤ë¥Ó¥Ã¥È¥Þ¥¹¥¯¤òÀßÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +¥æ¥Ë¥Ã¥È 0 ¤È 1 ¤Î¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¤À¤±¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¡¢É¸½à¤Ç¤Ê¤¤¥Ï¡¼¥É¥¦¥§¥¢ (Î㤨¤Ð ASUS ¤Î PCI¥Þ¥¶¡¼¥Ü¡¼¥É¤Ê¤É) +¤Ç¥æ¥Ë¥Ã¥È 2 ¤ä 3 ¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤È¡¢ +¥­¡¼¥Ü¡¼¥É¤¬¤ª¤«¤·¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤«¤é¤Ç¤¢¤ë¡£ +cmos ¥ª¥×¥·¥ç¥ó (¸å½Ò) ¤ÎƳÆþ¤Ë¤è¤Ã¤Æ¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¢¤Þ¤ê»È¤ï¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£ +.TP +.B "floppy=all_drives" +.\"O Sets the bit mask of allowed drives to all drives. +.\"O Use this if you have +.\"O more than two drives connected to a floppy controller. +µö²Ä¤¹¤ë¥É¥é¥¤¥Ö¤ò¼¨¤¹¥Ó¥Ã¥È¥Þ¥¹¥¯¤ò¡¢¡Ö¤¹¤Ù¤Æ¤Î¥É¥é¥¤¥Ö¡×¤Ë¤¹¤ë¡£ +1 ¤Ä¤Î¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¤Ë 2 Âæ°Ê¾å¤Î¥É¥é¥¤¥Ö¤òÀܳ¤¹¤ë¾ì¹ç¤ËÍѤ¤¤ë¡£ +.TP +.B "floppy=asus_pci" +.\"O Sets the bit mask to allow only units 0 and 1. +.\"O (The default) +¥æ¥Ë¥Ã¥È 0 ¤È 1 ¤Î¤ß¤òµö²Ä¤¹¤ë¤è¤¦¥Ó¥Ã¥È¥Þ¥¹¥¯¤òÀßÄꤹ¤ë¡£ +(¥Ç¥Õ¥©¥ë¥È)¡£ +.TP +.B "floppy=daring" +.\"O Tells the floppy driver that you have a well behaved floppy +.\"O controller. +.\"O This allows more efficient and smoother operation, but +.\"O may fail on certain controllers. +.\"O This may speed up certain operations. +Àµ¤·¤¯¿¶¤ëÉñ¤¦¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¤ò»È¤Ã¤Æ¤¤¤ë¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤ÈÆ°ºî¤Ï¤è¤ê¸úΨŪ¤«¤Ä¥¹¥à¡¼¥¹¤Ë¤Ê¤ë¤¬¡¢ +¥³¥ó¥È¥í¡¼¥é¤Ë¤è¤Ã¤Æ¤ÏÆ°ºî¤Ë¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +¤³¤ì¤ò»ØÄꤹ¤ë¤È¤¢¤ë¼ï¤ÎÆ°ºî¤¬¹â®¤Ë¤Ê¤ë¡£ +.TP +.B "floppy=0,daring" +.\"O Tells the floppy driver that your floppy controller should be used +.\"O with caution. +Ãí°Õ¤·¤Æ°·¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¤Ç¤¢¤ë¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +.TP +.B "floppy=one_fdc" +.\"O Tells the floppy driver that you have only floppy controller (default) +¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¤¬¤Ò¤È¤Ä¤·¤«¤Ê¤¤¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë +(¥Ç¥Õ¥©¥ë¥È)¡£ +.TP +.\"O .BR floppy=two_fdc " or " floppy=address,two_fdc +.BR floppy=two_fdc " ¤Þ¤¿¤Ï " floppy=address,two_fdc +.\"O Tells the floppy driver that you have two floppy controllers. +.\"O The second floppy controller is assumed to be at address. +.\"O If address is +.\"O not given, 0x370 is assumed. +¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¤¬¤Õ¤¿¤Ä¤¢¤ë¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +2 ÈÖÌܤΥ³¥ó¥È¥í¡¼¥é¤Î I/O ¥¢¥É¥ì¥¹¤Ï address ¤Ç»ØÄꤹ¤ë¡£ +address ¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï 0x370 ¤¬»È¤ï¤ì¤ë¡£ +.TP +.B "floppy=thinkpad" +.\"O Tells the floppy driver that you have a Thinkpad. +.\"O Thinkpads use an +.\"O inverted convention for the disk change line. +Thinkpad ¤ò»È¤Ã¤Æ¤¤¤ë¤³¤È¤ò¥Õ¥í¥Ã¥Ô¡¼¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +Thinkpad ¤Ï¥Ç¥£¥¹¥¯¼è½Ð¤Î¸¡½Ð¿®¹æ¤òȿž¤·¤Æ»È¤Ã¤Æ¤¤¤ë¡£ +.TP +.B "floppy=0,thinkpad" +.\"O Tells the floppy driver that you don't have a Thinkpad. +Thinkpad ¤ò»È¤Ã¤Æ¤¤¤Ê¤¤¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +.TP +.B "floppy=drive,type,cmos" +.\"O Sets the cmos type of drive to type. +.\"O Additionally, this drive is +.\"O allowed in the bit mask. +.\"O This is useful if you have more than two +.\"O floppy drives (only two can be described in the physical cmos), or if +.\"O your BIOS uses nonstandard CMOS types. +.\"O Setting the CMOS to 0 for the +.\"O first two drives (default) makes the floppy driver read the physical +.\"O cmos for those drives. +¥É¥é¥¤¥Ö¤Î cmos ¥¿¥¤¥×¤ò type ¤ËÀßÄꤹ¤ë¡£ +¤µ¤é¤Ë¥Ó¥Ã¥È¥Þ¥¹¥¯¤òÊѹ¹¤·¡¢¤³¤Î¥É¥é¥¤¥Ö¤Î»ÈÍѤòµö²Ä¤¹¤ë¡£ +¤³¤Î»ØÄ꤬ÊØÍø¤Ê¤Î¤Ï¡¢¥Õ¥í¥Ã¥Ô¡¼¥É¥é¥¤¥Ö¤¬ 2 Âæ°Ê¾å¤¢¤ë¾ì¹ç +(ʪÍý cmos ¤Ëµ­½Ò¤Ç¤­¤ë¤Î¤Ï 2 Âæ¤Þ¤Ç) ¤ä¡¢ +BIOS ¤¬É¸½àŪ¤Ç¤Ê¤¤ CMOS ¥¿¥¤¥×¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤ë¡£ +ºÇ½é¤Î 2 Âæ¤Î¥É¥é¥¤¥Ö¤Î CMOS ¤Ë 0 ¤ò»ØÄꤹ¤ë (¥Ç¥Õ¥©¥ë¥È) ¤È¡¢ +¥Õ¥í¥Ã¥Ô¡¼¥É¥é¥¤¥Ð¤Ï¤³¤ì¤é¤Î¥É¥é¥¤¥Ö¤ÎʪÍý cmos ¤ò»²¾È¤¹¤ë¡£ +.TP +.B "floppy=unexpected_interrupts" +.\"O Print a warning message when an unexpected interrupt is received +.\"O (default behavior) +ͽ´ü¤·¤Ê¤¤³ä¤ê¹þ¤ß¤ò¼õ¤±¤¿»þ¤Ë·Ù¹ð¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë (¥Ç¥Õ¥©¥ë¥È)¡£ +.TP +.\"O .BR floppy=no_unexpected_interrupts " or " floppy=L40SX +.BR floppy=no_unexpected_interrupts " ¤Þ¤¿¤Ï " floppy=L40SX +.\"O Don't print a message when an unexpected interrupt is received. +.\"O This is needed on IBM L40SX laptops in certain video modes. +.\"O (There seems to +.\"O be an interaction between video and floppy. +.\"O The unexpected interrupts +.\"O only affect performance, and can safely be ignored.) +ͽ´ü¤·¤Ê¤¤³ä¤ê¹þ¤ß¤ò¼õ¤±¤¿»þ¤Ç¤â·Ù¹ð¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Ê¤¤¡£ +¤³¤ì¤Ï IBM L40SX ¥é¥Ã¥×¥È¥Ã¥×¥³¥ó¥Ô¥å¡¼¥¿¤ò +ÆÃÄê¤Î¥Ó¥Ç¥ª¥â¡¼¥É¤Ç»ÈÍѤ¹¤ë»þ¤ËɬÍפȤʤ롣 +(¥Ó¥Ç¥ª¤È¥Õ¥í¥Ã¥Ô¡¼¤È¤Î´Ö¤Ç²¿¤é¤«¤ÎÁê¸ßºîÍѤ¬¤¢¤ë¤è¤¦¤À¡£ +ͽ´ü¤·¤Ê¤¤³ä¤ê¹þ¤ß¤ÏÀ­Ç½¤À¤±¤Ë±Æ¶Á¤·¡¢Ìµ»ë¤·¤Æ¤â°ÂÁ´¤Ç¤¢¤ë¡£) +.\"O .SS "The Sound Driver" +.SS ¥µ¥¦¥ó¥É¥É¥é¥¤¥Ð +.\"O The sound driver can also accept boot args to override the compiled in +.\"O values. +.\"O This is not recommended, as it is rather complex. +.\"O It is described in the kernel source file +.\"O .IR Documentation/sound/oss/README.OSS +.\"O .RI ( drivers/sound/Readme.linux +.\"O in older kernel versions). +.\"O Readme.Linux file, in linux/drivers/sound. +.\"O It accepts +.\"O a boot arg of the form: +¥µ¥¦¥ó¥É¥É¥é¥¤¥Ð¤âµ¯Æ°»þ°ú¿ô¤ò¼õ¤±ÉÕ¤±¡¢ +¥³¥ó¥Ñ¥¤¥ë»þ¤Ë»ØÄꤵ¤ì¤¿ÃͤòÊѹ¹¤Ç¤­¤ë¡£ +¤³¤ì¤Ï¤ä¤äÌÌÅݤʤ¿¤á¡¢¤¢¤Þ¤ê¤ªÁ¦¤á¤Ç¤­¤Ê¤¤¡£ +¾ÜºÙ¤Ï¡¢¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.IR Documentation/sound/oss/README.OSS +(¸Å¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï +.IR drivers/sound/Readme.linux ) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +°ú¿ô¤Î·Á¼°¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +sound=device1[,device2[,device3...[,device10]]] +.IP +.\"O where each deviceN value is of the following format 0xTaaaId and the +.\"O bytes are used as follows: +³Æ deviceN ¤Ï¤½¤ì¤¾¤ì 0xTaaaId ¤È¤¤¤¦·Á¼°¤Ç»ØÄꤹ¤ë¡£ +³Æ¥Ð¥¤¥È¤Î°ÕÌ£¤Ï°Ê²¼¤ÎÄ̤ꡣ + +.\"O T \- device type: 1=FM, 2=SB, 3=PAS, 4=GUS, 5=MPU401, 6=SB16, +.\"O 7=SB16-MPU401 +T \- ¥Ç¥Ð¥¤¥¹¤Î¥¿¥¤¥×: 1=FM, 2=SB, 3=PAS, 4=GUS, 5=MPU401, 6=SB16, 7=SB16-MPU401 + +.\"O aaa \- I/O address in hex. +aaa \- I/O ¥Ý¡¼¥È¥¢¥É¥ì¥¹ (16¿ÊÃÍ) + +.\"O I \- interrupt line in hex (i.e 10=a, 11=b, ...) +I \- ³ä¤ê¹þ¤ßÈÖ¹æ (16 ¿ÊÃÍ¡£Îã: 10=a, 11=b, ...) + +.\"O d \- DMA channel. +d \- DMA ¥Á¥ã¥Í¥ë + +.\"O As you can see it gets pretty messy, and you are better off to compile +.\"O in your own personal values as recommended. +.\"O Using a boot arg of +.\"O \&'sound=0' will disable the sound driver entirely. +¾åµ­¤ÎÄ̤ꡢ¤«¤Ê¤ê°·¤¤¤Ë¤¯¤¤·Á¼°¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢ +¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¼«Ê¬¤Ë¤¢¤Ã¤¿Ãͤò»ØÄꤹ¤ëÊý¤¬Îɤ¤¤À¤í¤¦¡£ +¤Ê¤ªµ¯Æ°»þ°ú¿ô¤È¤·¤Æ 'sound=0' ¤ò»ØÄꤹ¤ë¤È¡¢ +¥µ¥¦¥ó¥É¥É¥é¥¤¥Ð¤ò´°Á´¤Ë̵¸ú¤Ë¤¹¤ë¡£ +.\"O .SS "ISDN Drivers" +.SS "ISDN ¥É¥é¥¤¥Ð" +.TP +.\"O .B "The ICN ISDN driver" +.B ICN ISDN ¥É¥é¥¤¥Ð +.\"O Syntax: +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +icn=iobase,membase,icn_id1,icn_id2 +.IP +.\"O where icn_id1,icn_id2 are two strings used to identify the +.\"O card in kernel messages. +icn_id1,icn_id2 ¤Ï¥«¡¼¥É¤ò¼±Ê̤¹¤ë¤¿¤á¤Î 2 ¤Ä¤Îʸ»úÎó¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë¥á¥Ã¥»¡¼¥¸¤ÇÍѤ¤¤é¤ì¤ë¡£ +.TP +.\"O .B "The PCBIT ISDN driver" +.B PCBIT ISDN ¥É¥é¥¤¥Ð +.\"O Syntax: +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +pcbit=membase1,irq1[,membase2,irq2] +.IP +.\"O where membaseN is the shared memory base of the N'th card, and irqN is +.\"O the interrupt setting of the N'th card. +.\"O The default is IRQ 5 and +.\"O membase 0xD0000. +membaseN ¤Ï N ÈÖÌܤΥ«¡¼¥É¤Î¶¦Í­¥á¥â¥ê¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹¤Ç¤¢¤ê¡¢ +irqN ¤Ï N ÈÖÌܤΥ«¡¼¥É¤Î³ä¤ê¹þ¤ßÀßÄê¤Ç¤¢¤ë¡£ +̵»ØÄê»þ¤Ë¤Ï IRQ = 5, membase = 0xD0000 ¤È¤Ê¤ë¡£ +.TP +.\"O .B "The Teles ISDN driver" +.B Teles ISDN ¥É¥é¥¤¥Ð +.\"O Syntax: +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +teles=iobase,irq,membase,protocol,teles_id +.IP +.\"O where iobase is the i/o port address of the card, membase is the +.\"O shared memory base address of the card, irq is the interrupt channel +.\"O the card uses, and teles_id is the unique ASCII string identifier. +iobase ¤Ï¥«¡¼¥É¤Î I/O ¥Ý¡¼¥È¥¢¥É¥ì¥¹¡¢ +membase ¤Ï¥«¡¼¥É¤Î¶¦Í­¥á¥â¥ê¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹¡¢ +¤½¤·¤Æ irq ¤Ï¥«¡¼¥É¤¬»ÈÍѤ¹¤ë³ä¤ê¹þ¤ß¥Á¥ã¥Í¥ë¤Ç¤¢¤ë¡£ +teles_id ¤Ï¥¢¥¹¥­¡¼Ê¸»úÎó¤Ë¤è¤ë¼±ÊÌʸ»úÎó¤Ç¤¢¤ë (¾¤È½Å¤Ê¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤ë)¡£ +.\"O .SS "Serial Port Drivers" +.SS ¥·¥ê¥¢¥ë¥Ý¡¼¥È¥É¥é¥¤¥Ð +.TP +.\"O .B "The RISCom/8 Multiport Serial Driver ('riscom8=')" +.B RISCom/8 ¥Þ¥ë¥Á¥Ý¡¼¥È¥·¥ê¥¢¥ë¥É¥é¥¤¥Ð ('riscom8=') +.\"O Syntax: +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +riscom=iobase1[,iobase2[,iobase3[,iobase4]]] +.IP +.\"O More details can be found in +.\"O .IR /usr/src/linux/Documentation/riscom8.txt . +¾ÜºÙ¤Ï +.I /usr/src/linux/Documentation/riscom8.txt +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.\"O .B "The DigiBoard Driver ('digi=')" +.B DigiBoard ¥É¥é¥¤¥Ð ('digi=') +.\"O If this option is used, it should have precisely six parameters. +.\"O Syntax: +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤¦¾ì¹ç¤Ï¡¢ +6 ¤Ä¤Á¤ç¤¦¤É¤Î¥Ñ¥é¥á¡¼¥¿¤òÍ¿¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +digi=status,type,altpin,numports,iobase,membase +.IP +.\"O The parameters maybe given as integers, or as strings. +.\"O If strings are used, then iobase and membase should be given +.\"O in hexadecimal. +.\"O The integer arguments (fewer may be given) are in order: +.\"O status (Enable(1) or Disable(0) this card), +.\"O type (PC/Xi(0), PC/Xe(1), PC/Xeve(2), PC/Xem(3)), +.\"O altpin (Enable(1) or Disable(0) alternate pin arrangement), +.\"O numports (number of ports on this card), +.\"O iobase (I/O Port where card is configured (in HEX)), +.\"O membase (base of memory window (in HEX)). +.\"O Thus, the following two boot prompt arguments are equivalent: +¥Ñ¥é¥á¡¼¥¿¤ÏÀ°¿ôÃͤ«Ê¸»úÎó¤ÇÍ¿¤¨¤ë¡£ +ʸ»úÎó¤Ç»ØÄꤹ¤ë¾ì¹ç¤Ï¡¢ +iobase ¤È membase ¤Ï 16 ¿ÊÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +À°¿ôÃͤǻØÄꤹ¤ë¾ì¹ç¤Ï¥Ñ¥é¥á¡¼¥¿¤Î¸Ä¿ô¤Ï¾¯¤Ê¤¯¤Æ¤âÎɤ¯¡¢½ç¤Ë: +status ¤³¤Î¥«¡¼¥É¤ÎÆ°ºî¤ò»ØÄꤹ¤ë (Enable(1) ¤Þ¤¿¤Ï Disable(0)), +type ¥«¡¼¥É¤Î¥¿¥¤¥× (PC/Xi(0), PC/Xe(1), PC/Xeve(2), PC/Xem(3)), +altpin ¥Ô¥óÇÛÃÖ¤òȿž¤µ¤»¤ë (Enable(1) or Disable(0)), +numports ¥«¡¼¥É¤Î¥Ý¡¼¥ÈÈÖ¹æ, +iobase ¤³¤Î¥«¡¼¥É¤Î I/O ¥Ý¡¼¥È (ʸ»úÎó»ØÄê¤Î¾ì¹ç¤Ï 16 ¿Êɽµ­), +membase ¥á¥â¥ê¥¦¥£¥ó¥É¥¦¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹ (ʸ»úÎó»ØÄê¤Î¾ì¹ç¤Ï 16 ¿Êɽµ­)¡£ +¤·¤¿¤¬¤Ã¤Æ°Ê²¼¤Î¤Õ¤¿¤Ä¤Îµ¯Æ°»þ°ú¿ô¤ÏƱ¤¸°ÕÌ£¤ò»ý¤Ä¡£ +.IP +digi=E,PC/Xi,D,16,200,D0000 +.br +digi=1,0,0,16,0x200,851968 +.IP +.\"O More details can be found in +.\"O .IR /usr/src/linux/Documentation/digiboard.txt . +¾ÜºÙ¤Ï +.I /usr/src/linux/Documentation/digiboard.txt +¤ò»²¾È¤»¤è¡£ +.TP +.\"O .B "The Baycom Serial/Parallel Radio Modem" +.B Baycom ¥·¥ê¥¢¥ë¡¦¥Ñ¥é¥ì¥ë ¥é¥¸¥ª¥â¥Ç¥à +.\"O Syntax: +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +baycom=iobase,irq,modem +.IP +.\"O There are precisely 3 parameters; for several cards, give +.\"O several 'baycom=' commands. +.\"O The modem parameter is a string +.\"O that can take one of the values ser12, ser12*, par96, par96*. +.\"O Here the * denotes that software DCD is to be used, and +.\"O ser12/par96 chooses between the supported modem types. +.\"O For more details, see the file +.\"O .I Documentation/networking/baycom.txt +.\"O (or +.\"O .I drivers/net/README.baycom +.\"O for older kernels) in the kernel source. +¤Á¤ç¤¦¤É 3 ¤Ä¤Î¥Ñ¥é¥á¡¼¥¿¤òÍ¿¤¨¤ë¡£ +Ê£¿ô¤Î¥«¡¼¥É¤¬¤¢¤ë¾ì¹ç¤Ï¡¢'baycom=' ¥³¥Þ¥ó¥É¤âÊ£¿ôµ­½Ò¤¹¤ë¡£ +modem ¥Ñ¥é¥á¡¼¥¿¤Ïʸ»úÎó¤Ç¡¢ +ser12, ser12*, par96, par96* ¤ÎÃ椫¤é¤Ò¤È¤Ä¤òÁª¤Ö¡£ +* ¤ò¤Ä¤±¤ë¤È¥½¥Õ¥È¥¦¥§¥¢ DCD ¤ò»ÈÍѤ¹¤ë¡£ +¥â¥Ç¥à¤Î¼ïÎà¤Ë±þ¤¸¤Æ ser12 ¤« par96 ¤«¤òÁªÂò¤¹¤ë¡£ +¾ÜºÙ¤Ï¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.I Documentation/networking/baycom.txt +(¸Å¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï +.IR drivers/net/README.baycom ) +¤ò»²¾È¡£ +.TP +.\"O .B "Soundcard radio modem driver" +.B ¥µ¥¦¥ó¥É¥«¡¼¥É¥é¥¸¥ª¥â¥Ç¥à¥É¥é¥¤¥Ð +.\"O Syntax: +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +soundmodem=iobase,irq,dma[,dma2[,serio[,pario]]],0,mode +.IP +.\"O All parameters except the last are integers; +.\"O the dummy 0 is required because of a bug in the setup code. +.\"O The mode parameter is a string with syntax hw:modem, +.\"O where hw is one of sbc, wss, wssfdx and modem is one of +.\"O afsk1200, fsk9600. +ºÇ¸å¤Î¥Ñ¥é¥á¡¼¥¿¤ò½ü¤¯¤¹¤Ù¤Æ¤Î¥Ñ¥é¥á¡¼¥¿¤ÏÀ°¿ô¤Ç¤¢¤ë¡£ +¥À¥ß¡¼¤Î 0 ¤¬¤¢¤ë¤Î¤Ï¡¢ÀßÄê¥×¥í¥°¥é¥à¤Î¥Ð¥°¤Î¤»¤¤¤Ç¤¢¤ë¡£ +mode ¥Ñ¥é¥á¡¼¥¿¤Ïʸ»úÎó¤Ç¡¢hw:modem ¤È¤¤¤¦½ñ¼°¤Ç»ØÄꤹ¤ë¡£ +hw ¤Ï sbc, wss, wssfdx ¤Î¤¦¤Á¤Ò¤È¤Ä¡¢ +modem ¤Ï afsk1200, fsk9600 ¤Î¤É¤Á¤é¤«¤òÁªÂò¤·¤Æµ­½Ò¤¹¤ë¡£ +.\" HERE GOES (NAKANO) +.\"O .SS "The Line Printer Driver" +.SS ¥é¥¤¥ó¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð +.TP +.B "'lp='" +.\"O Syntax: +½ñ¼°: +.IP +lp=0 +.br +lp=auto +.br +lp=reset +.br +lp=port[,port...] +.IP +.\"O You can tell the printer driver what ports to use and what ports not +.\"O to use. +.\"O The latter comes in handy if you don't want the printer driver +.\"O to claim all available parallel ports, so that other drivers +.\"O (e.g., PLIP, PPA) can use them instead. +¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Ë¤Ï¡¢¤É¤Î¥Ý¡¼¥È¤ò»È¤¦¤«¡¢ +¤É¤Î¥Ý¡¼¥È¤ò»È¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¤«¤òÅÁ¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¸å¼Ô¤Ï¡¢ +ÍøÍѲÄǽ¤Ê¤¢¤é¤æ¤ë¥Ñ¥é¥ì¥ë¥Ý¡¼¥È¤ò¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤¬Í׵ᤷ¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¡¢ +¾¤Î¥É¥é¥¤¥Ð (PLIP ¤ä PPA ¤Ê¤É) ¤«¤é +¤½¤ì¤é¤ò»È¤¨¤ë¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ + +.\"O The format of the argument is multiple port names. +.\"O For example, +.\"O lp=none,parport0 would use the first parallel port for lp1, and +.\"O disable lp0. +.\"O To disable the printer driver entirely, one can use +.\"O lp=0. +°ú¿ô¤Î½ñ¼°¤Ï¡¢Ê£¿ô¤Î¥Ý¡¼¥È̾¤Ç¤¢¤ë¡£ +Î㤨¤Ð lp=none,parport0 ¤È¤¹¤ë¤È¡¢ +ºÇ½é¤Î¥Ñ¥é¥ì¥ë¥Ý¡¼¥È¤ò lp1 ¤È¤·¤Æ»È¤¤¡¢ +lp0 ¤Ï̵¸ú¤Ë¤¹¤ë¡£¥×¥ê¥ó¥¿¡¼¥É¥é¥¤¥Ð¤ò´°Á´¤Ë̵¸ú¤Ë¤¹¤ë¤Ë¤Ï +lp=0 ¤È¤¹¤ì¤Ð¤è¤¤¡£ +.TP +.\"O .B "WDT500/501 driver" +.B WDT500/501 ¥É¥é¥¤¥Ð +.\"O Syntax: +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +wdt=io,irq +.\"O .SS "Mouse Drivers" +.SS ¥Þ¥¦¥¹¥É¥é¥¤¥Ð +.TP +.B "'bmouse=irq'" +.\"O The busmouse driver only accepts one parameter, that being the +.\"O hardware IRQ value to be used. +¥Ð¥¹¥Þ¥¦¥¹¥É¥é¥¤¥Ð¤Ï¥Ñ¥é¥á¡¼¥¿¤ò¤Ò¤È¤Ä¤À¤±¤È¤ê¡¢ +¥Ï¡¼¥É¥¦¥§¥¢ IRQ ¤ò»ØÄê¤Ç¤­¤ë¡£ +.TP +.B "'msmouse=irq'" +.\"O And precisely the same is true for the msmouse driver. +msmouse ¥É¥é¥¤¥Ð¤Ç¤â¤³¤Î»ö¾ð¤Ï¤Þ¤Ã¤¿¤¯Æ±¤¸¤Ç¤¢¤ë¡£ +.TP +.\"O .B "ATARI mouse setup" +.B ATARI ¥Þ¥¦¥¹¤ÎÀßÄê +.IP +atamouse=threshold[,y-threshold] +.IP +.\"O If only one argument is given, it is used for both +.\"O x-threshold and y-threshold. +.\"O Otherwise, the first argument +.\"O is the x-threshold, and the second the y-threshold. +.\"O These values must lie between 1 and 20 (inclusive); the default is 2. +¥Ñ¥é¥á¡¼¥¿¤¬¤Ò¤È¤Ä¤À¤±Í¿¤¨¤é¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +x-threshold ¤È y-threshold ¤òξÊý¤ËÍѤ¤¤é¤ì¤ë¡£ +¤Õ¤¿¤ÄÍ¿¤¨¤é¤ì¤¿¾ì¹ç¤Ï¡¢ºÇ½é¤ÎÃͤ¬ x-threshold ¤È¤·¤ÆÍѤ¤¤é¤ì¡¢ +2 ÈÖÌܤÎÃͤ¬ y-threshold ¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ +ÃÍ¤Ï 1 ¤«¤é 20 ¤Þ¤Ç¤Î¿ôÃͤǻØÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 2¡£ +.\"O .SS "Video Hardware" +.SS ¥Ó¥Ç¥ªµ¡´ï +.TP +.B "'no-scroll'" +.\"O This option tells the console driver not to use hardware scroll +.\"O (where a scroll is effected by moving the screen origin in video +.\"O memory, instead of moving the data). +.\"O It is required by certain +.\"O Braille machines. +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð¤Ë¡¢ +¥Ï¡¼¥É¥¦¥§¥¢¥¹¥¯¥í¡¼¥ë¤òÍѤ¤¤Ê¤¤¤è¤¦ÅÁ¤¨¤ë +(¤³¤³¤Ç¸À¤¦¥Ï¡¼¥É¥¦¥§¥¢¥¹¥¯¥í¡¼¥ë¤È¤Ï¡¢ +¥Ó¥Ç¥ª¥á¥â¥ê¾å¤Î¥Ç¡¼¥¿¤ò°ÜÆ°¤µ¤»¤ë¤³¤È¤Ë¤è¤Ã¤Æ +¥¹¥¯¥ê¡¼¥óɽ¼¨Îΰè¤ò¥¹¥¯¥í¡¼¥ë¤µ¤»¤ë¤³¤È¤ò»Ø¤¹)¡£ +ÆÃÄê¤ÎÅÀ»ú¥Þ¥·¥ó¤Ç¤Ï¤³¤Î»ØÄ꤬ɬÍפȤʤ롣 +.\"O .\" .SH AUTHORS +.\"O .\" Linus Torvalds (and many others) +.\" .SH Ãø¼Ô +.\" Linus Torvalds (¾¿¿ô) +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR lilo.conf (5), +.BR klogd (8), +.BR lilo (8), +.BR mount (8), +.BR rdev (8) + +.\"O Large parts of this man page have been derived from the +.\"O Boot Parameter HOWTO (version 1.0.1) written by Paul Gortmaker. +.\"O More information may be found in this (or a more recent) HOWTO. +.\"O An up-to-date source of information is +.\"O .IR /usr/src/linux/Documentation/kernel-parameters.txt . +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÂçÉôʬ¤Ï Paul Gortmaker ¤Ë¤è¤ë +Boot Parameter HOWTO (version 1.0.1) ¤ò´ð¤Ë¤·¤Æ¤¤¤ë¡£ +¤³¤Î (¤¢¤ë¤¤¤ÏºÇ¿·¤Î) HOWTO ¤ò¤¢¤¿¤ì¤Ð¡¢ +¤µ¤é¤Ë¿¤¯¤Î¾ðÊó¤¬Æþ¼ê¤Ç¤­¤ë¤À¤í¤¦¡£ +ºÇ¿·¤Î¾ðÊó¸»¤Ï +.I /usr/src/linux/Documentation/kernel-parameters.txt +¤Ç¤¢¤ë¡£ + +(ÌõÃí) Boot Parameter HOWTO ¤Ï¸½ºß BootPrompt-HOWTO ¤È¤·¤Æ +¥á¥ó¥Æ¥Ê¥ó¥¹¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ËÙ¹¾À¿°ì¤µ¤ó¤Ë¤è¤ëÆüËܸìÈǤϡ¢ +.UR http://www.linux.or.jp/JF/JFdocs/BootPrompt-HOWTO.html +http://www.linux.or.jp/JF/JFdocs/BootPrompt-HOWTO.html +.UE +¤Ë¤¢¤ê¤Þ¤¹¡£±Ñ¸ìÈÇ¥ª¥ê¥¸¥Ê¥ë¤Ï¡¢ +.UR http://linuxdoc.org/HOWTO/BootPrompt-HOWTO.html +http://linuxdoc.org/HOWTO/BootPrompt-HOWTO.html +.UE +¤Ë¤¢¤ê¤Þ¤¹¡£ +¤¬¡¢¤¤¤º¤ì¤â May 1999 ¤Þ¤Ç¤Î¤â¤Î¤Ê¤Î¤Ç¤ä¤ä¸Å¤¤¤Ç¤¹¡£ diff --git a/draft/man7/capabilities.7 b/draft/man7/capabilities.7 new file mode 100644 index 00000000..42a41aa3 --- /dev/null +++ b/draft/man7/capabilities.7 @@ -0,0 +1,1598 @@ +.\" Copyright (c) 2002 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. +.\" +.\" 6 Aug 2002 - Initial Creation +.\" Modified 2003-05-23, Michael Kerrisk, +.\" Modified 2004-05-27, Michael Kerrisk, +.\" 2004-12-08, mtk Added O_NOATIME for CAP_FOWNER +.\" 2005-08-16, mtk, Added CAP_AUDIT_CONTROL and CAP_AUDIT_WRITE +.\" 2008-07-15, Serge Hallyn +.\" Document file capabilities, per-process capability +.\" bounding set, changed semantics for CAP_SETPCAP, +.\" and other changes in 2.6.2[45]. +.\" Add CAP_MAC_ADMIN, CAP_MAC_OVERRIDE, CAP_SETFCAP. +.\" 2008-07-15, mtk +.\" Add text describing circumstances in which CAP_SETPCAP +.\" (theoretically) permits a thread to change the +.\" capability sets of another thread. +.\" Add section describing rules for programmatically +.\" adjusting thread capability sets. +.\" Describe rationale for capability bounding set. +.\" Document "securebits" flags. +.\" Add text noting that if we set the effective flag for one file +.\" capability, then we must also set the effective flag for all +.\" other capabilities where the permitted or inheritable bit is set. +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-03-09, Akihiro MOTOKI +.\" Updated 2005-11-04, Akihiro MOTOKI +.\" Updated 2006-04-16, Akihiro MOTOKI, LDP v2.29 +.\" Updated 2006-07-20, Akihiro MOTOKI, LDP v2.34 +.\" Updated 2007-01-05, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2008-12-24, Akihiro MOTOKI, LDP v3.15 +.\" Updated 2009-02-27, Akihiro MOTOKI, LDP v3.19 +.\" Updated 2010-04-11, Akihiro MOTOKI, LDP v3.24 +.\" +.TH CAPABILITIES 7 2010-01-31 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O capabilities \- overview of Linux capabilities +capabilities \- Linux ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤Î³µÍ× +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O For the purpose of performing permission checks, +.\"O traditional Unix implementations distinguish two categories of processes: +.\"O .I privileged +.\"O processes (whose effective user ID is 0, referred to as superuser or root), +.\"O and +.\"O .I unprivileged +.\"O processes (whose effective UID is nonzero). +¸¢¸Â¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦´ÑÅÀ¤«¤é¸«¤ë¤È¡¢ÅÁÅýŪ¤Ê Unix ¤Î¼ÂÁõ¤Ç¤Ï +¥×¥í¥»¥¹¤ÏÆó¤Ä¤Î¥«¥Æ¥´¥ê¤ËʬÎà¤Ç¤­¤ë: +.I Æø¢ +¥×¥í¥»¥¹ (¼Â¸ú¥æ¡¼¥¶ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¡£¥æ¡¼¥¶ID 0 ¤Ï +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤ä root ¤È¸Æ¤Ð¤ì¤ë) ¤È +.I ÈóÆø¢ +¥×¥í¥»¥¹ (¼Â¸ú¥æ¡¼¥¶ID ¤¬ 0 °Ê³°¤Î¥×¥í¥»¥¹) ¤Ç¤¢¤ë¡£ +.\"O Privileged processes bypass all kernel permission checks, +.\"O while unprivileged processes are subject to full permission +.\"O checking based on the process's credentials +.\"O (usually: effective UID, effective GID, and supplementary group list). +ÈóÆø¢¥×¥í¥»¥¹¤Ç¤Ï¡¢¥×¥í¥»¥¹¤Î»ñ³Ê¾ðÊó (Ä̾ï¤Ï¡¢¼Â¸úUID ¡¢¼Â¸úGID +¤ÈÄɲäΥ°¥ë¡¼¥×¥ê¥¹¥È) ¤Ë´ð¤Å¤¯¸¢¸Â¥Á¥§¥Ã¥¯¤¬¹Ô¤ï¤ì¤ë¤Î¤ËÂФ·¡¢ +Æø¢¥×¥í¥»¥¹¤Ç¤ÏÁ´¤Æ¤Î¥«¡¼¥Í¥ë¤Î¸¢¸Â¥Á¥§¥Ã¥¯¤¬¥Ð¥¤¥Ñ¥¹¤µ¤ì¤ë¡£ + +.\"O Starting with kernel 2.2, Linux divides the privileges traditionally +.\"O associated with superuser into distinct units, known as +.\"O .IR capabilities , +.\"O which can be independently enabled and disabled. +.\"O Capabilities are a per-thread attribute. +¥Ð¡¼¥¸¥ç¥ó 2.2 °Ê¹ß¤Î Linux ¤Ç¤Ï¡¢ +¤³¤ì¤Þ¤Ç¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤­¤¿¸¢¸Â¤ò¡¢ +¤¤¤¯¤Ä¤«¤Î¥°¥ë¡¼¥×¤Ëʬ³ä¤·¤Æ¤¤¤ë¡£¤³¤ì¤é¤Î¥°¥ë¡¼¥×¤Ï +.IR ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) +¤È¸Æ¤Ð¤ì¡¢¥°¥ë¡¼¥×Ëè¤ËÆÈΩ¤ËÍ­¸ú¡¢Ìµ¸ú¤òÀßÄê¤Ç¤­¤ë¡£ +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï¥¹¥ì¥Ã¥Éñ°Ì¤Î°À­¤Ç¤¢¤ë¡£ +.\" +.\"O .SS Capabilities List +.SS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥ê¥¹¥È +.\"O The following list shows the capabilities implemented on Linux, +.\"O and the operations or behaviors that each capability permits: +°Ê²¼¤Î¥ê¥¹¥È¤Ï¡¢ +Linux ¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤È +³Æ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬µö²Ä¤¹¤ëÁàºî¤ÈÆ°ºî¤ò¤Þ¤È¤á¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.\"O .BR CAP_AUDIT_CONTROL " (since Linux 2.6.11)" +.\"O Enable and disable kernel auditing; change auditing filter rules; +.\"O retrieve auditing status and filtering rules. +.BR CAP_AUDIT_CONTROL " (Linux 2.6.11 °Ê¹ß)" +¥«¡¼¥Í¥ë´Æºº (audit) ¤ÎÍ­¸ú̵¸ú¤ÎÀÚ¤êÂؤ¨¡¢ +´Æºº¤Î¥Õ¥£¥ë¥¿¡¦¥ë¡¼¥ë¤ÎÊѹ¹¡¢ +´Æºº¤Î¾õ¶·¤ä¥Õ¥£¥ë¥¿¡¦¥ë¡¼¥ë¤Î¼èÆÀ¤¬¤Ç¤­¤ë¡£ +.TP +.\"O .BR CAP_AUDIT_WRITE " (since Linux 2.6.11)" +.BR CAP_AUDIT_WRITE " (Linux 2.6.11 °Ê¹ß)" +.\"O Write records to kernel auditing log. +¥«¡¼¥Í¥ë´Æºº¤Î¥í¥°¤Ë¥ì¥³¡¼¥É¤ò½ñ¤­¹þ¤à¡£ +.TP +.B CAP_CHOWN +.\"O Make arbitrary changes to file UIDs and GIDs (see +.\"O .BR chown (2)). +¥Õ¥¡¥¤¥ë¤Î UID ¤ÈGID ¤òǤ°Õ¤ËÊѹ¹¤¹¤ë +.RB ( chown (2) +»²¾È)¡£ +.TP +.B CAP_DAC_OVERRIDE +.\"O Bypass file read, write, and execute permission checks. +.\"O (DAC is an abbreviation of "discretionary access control".) +¥Õ¥¡¥¤¥ë¤ÎÆɤ߽Ф·¡¢½ñ¤­¹þ¤ß¡¢¼Â¹Ô¤Î¸¢¸Â¥Á¥§¥Ã¥¯¤ò¥Ð¥¤¥Ñ¥¹¤¹¤ë +(DAC ¤Ï "discretionary access control (Ǥ°Õ¤Î¥¢¥¯¥»¥¹À©¸æ)" ¤Îά¤Ç¤¢¤ë)¡£ +.TP +.B CAP_DAC_READ_SEARCH +.\"O Bypass file read permission checks and +.\"O directory read and execute permission checks. +¥Õ¥¡¥¤¥ë¤ÎÆɤ߽Ф·¸¢¸Â¤Î¥Á¥§¥Ã¥¯¤È¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆɤ߽Ф·¤È¼Â¹Ô +¤Î¸¢¸Â¥Á¥§¥Ã¥¯¤ò¥Ð¥¤¥Ñ¥¹¤¹¤ë¡£ +.TP +.B CAP_FOWNER +.PD 0 +.RS +.IP * 2 +.\"O Bypass permission checks on operations that normally +.\"O require the file system UID of the process to match the UID of +.\"O the file (e.g., +.\"O .BR chmod (2), +.\"O .BR utime (2)), +.\"O excluding those operations covered by +.\"O .B CAP_DAC_OVERRIDE +.\"O and +.\"O .BR CAP_DAC_READ_SEARCH ; +Ä̾¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤¬¥Õ¥¡¥¤¥ë¤Î UID ¤Ë°ìÃפ¹¤ë¤³¤È¤¬ +Í׵ᤵ¤ì¤ëÁàºî (Î㤨¤Ð +.BR chmod (2), +.BR utime (2)) +¤Ë¤ª¤±¤ë¸¢¸Â¥Á¥§¥Ã¥¯¤ò¥Ð¥¤¥Ñ¥¹¤¹¤ë¡£ +⤷¡¢ +.B CAP_DAC_OVERRIDE +¤« +.B CAP_DAC_READ_SEARCH +¤Ë¤è¤ê¥Á¥§¥Ã¥¯¤¬¹Ô¤ï¤ì¤ëÁàºî¤Ï½ü¤¯¡£ +.IP * +.\"O set extended file attributes (see +.\"O .BR chattr (1)) +.\"O on arbitrary files; +Ǥ°Õ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ³ÈÄ¥¥Õ¥¡¥¤¥ë°À­¤òÀßÄꤹ¤ë +.RB ( chattr (1) +»²¾È)¡£ +.IP * +.\"O set Access Control Lists (ACLs) on arbitrary files; +Ǥ°Õ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¥¢¥¯¥»¥¹À©¸æ¥ê¥¹¥È (ACL) ¤òÀßÄꤹ¤ë¡£ +.IP * +.\"O ignore directory sticky bit on file deletion; +¥Õ¥¡¥¤¥ë¤Îºï½ü¤ÎºÝ¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥¹¥Æ¥£¥Ã¥­¡¼¥Ó¥Ã¥È¤ò̵»ë¤¹¤ë¡£ +.IP * +.\"O specify +.\"O .B O_NOATIME +.\"O for arbitrary files in +.\"O .BR open (2) +.\"O and +.\"O .BR fcntl (2). +.BR open (2) +¤ä +.BR fcntl (2) +¤ÇǤ°Õ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +.B O_NOATIME +¤ò»ØÄꤹ¤ë¡£ +.RE +.PD +.TP +.B CAP_FSETID +.\"O Don't clear set-user-ID and set-group-ID permission +.\"O bits when a file is modified; +.\"O set the set-group-ID bit for a file whose GID does not match +.\"O the file system or any of the supplementary GIDs of the calling process. +¥Õ¥¡¥¤¥ë¤¬Êѹ¹¤µ¤ì¤¿¤È¤­¤Ë set-user-ID ¤Èset-group-ID ¤Îµö²Ä¥Ó¥Ã¥È¤ò¥¯¥ê¥¢ +¤·¤Ê¤¤¡£¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à GID ¤ÈÄɲäΠGID ¤Î¤¤¤º¤ì¤È¤â +GID ¤¬°ìÃפ·¤Ê¤¤¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ set-group-ID ¥Ó¥Ã¥È¤òÀßÄꤹ¤ë¡£ +.TP +.B CAP_IPC_LOCK +.\"O Lock memory +.\"O .RB ( mlock (2), +.\"O .BR mlockall (2), +.\"O .BR mmap (2), +.\"O .BR shmctl (2)). +¥á¥â¥ê¡¼¤Î¥í¥Ã¥¯ +.RB ( mlock (2), +.BR mlockall (2), +.BR mmap (2), +.BR shmctl (2)) +¤ò¹Ô¤¦¡£ +.TP +.B CAP_IPC_OWNER +.\"O Bypass permission checks for operations on System V IPC objects. +System V IPC ¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ¹¤ëÁàºî¤Ë´Ø¤·¤Æ¸¢¸Â¥Á¥§¥Ã¥¯¤ò¥Ð¥¤¥Ñ¥¹¤¹¤ë¡£ +.TP +.B CAP_KILL +.\"O Bypass permission checks for sending signals (see +.\"O .BR kill (2)). +.\"O This includes use of the +.\"O .BR ioctl (2) +.\"O .B KDSIGACCEPT +.\"O operation. +¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ëºÝ¤Ë¸¢¸Â¥Á¥§¥Ã¥¯¤ò¥Ð¥¤¥Ñ¥¹¤¹¤ë +.RB ( kill (2) +»²¾È)¡£¤³¤ì¤Ë¤Ï +.BR ioctl (2) +¤Î +.B KDSIGACCEPT +Áàºî¤Î»ÈÍѤâ´Þ¤Þ¤ì¤ë¡£ +.\" FIXME CAP_KILL also has an effect for threads + setting child +.\" termination signal to other than SIGCHLD: without this +.\" capability, the termination signal reverts to SIGCHLD +.\" if the child does an exec(). What is the rationale +.\" for this? +.TP +.\"O .BR CAP_LEASE " (since Linux 2.4)" +.BR CAP_LEASE " (Linux 2.4 °Ê¹ß)" +.\"O Establish leases on arbitrary files (see +.\"O .BR fcntl (2)). +Ǥ°Õ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +¥Õ¥¡¥¤¥ë¥ê¡¼¥¹¤òÀßÄꤹ¤ë +.RB ( fcntl (2) +»²¾È)¡£ +.TP +.B CAP_LINUX_IMMUTABLE +.\"O Set the +.\"O .B FS_APPEND_FL +.\"O and +.\"O .B FS_IMMUTABLE_FL +.\"O .\" These attributes are now available on ext2, ext3, Reiserfs, XFS, JFS +.\"O i-node flags (see +.\"O .BR chattr (1)). +³ÈÄ¥¥Õ¥¡¥¤¥ë°À­ +.B FS_APPEND_FL +¤È +.B FS_IMMUTABLE_FL +¤òÀßÄꤹ¤ë +.RB ( chattr (1) +»²¾È)¡£ +.\" ¤³¤ì¤é¤Î°À­¤Ï ext2, ext3, Reiserfs, XFS, JFS ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.TP +.\"O .BR CAP_MAC_ADMIN " (since Linux 2.6.25)" +.BR CAP_MAC_ADMIN " (Linux 2.6.25 °Ê¹ß)" +.\"O Override Mandatory Access Control (MAC). +.\"O Implemented for the Smack Linux Security Module (LSM). +¶¯À©¥¢¥¯¥»¥¹À©¸æ (MAC) ¤ò¾å½ñ¤­¤¹¤ë¡£ +Smack Linux Security Module (LSM) ÍѤ˼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.\"O .BR CAP_MAC_OVERRIDE " (since Linux 2.6.25)" +.BR CAP_MAC_OVERRIDE " (Linux 2.6.25 °Ê¹ß)" +.\"O Allow MAC configuration or state changes. +.\"O Implemented for the Smack LSM. +MAC ¤ÎÀßÄê¤ä¾õÂÖ¤òÊѹ¹¤¹¤ë¡£ +Smack LSM ÍѤ˼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.\"O .BR CAP_MKNOD " (since Linux 2.4)" +.BR CAP_MKNOD " (Linux 2.4 °Ê¹ß)" +.\"O Create special files using +.\"O .BR mknod (2). +(Linux 2.4 °Ê¹ß) +.BR mknod (2) +¤ò»ÈÍѤ·¤Æ¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¡£ +.TP +.B CAP_NET_ADMIN +.\"O Perform various network-related operations +.\"O (e.g., setting privileged socket options, +.\"O enabling multicasting, interface configuration, +.\"O modifying routing tables). +³Æ¼ï¤Î¥Í¥Ã¥È¥ï¡¼¥¯´ØÏ¢¤ÎÁàºî¤ò¼Â¹Ô¤¹¤ë¡£ +(Î㤨¤Ð¡¢Æø¢¤¬É¬Íפʥ½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¡¢¥Þ¥ë¥Á¥­¥ã¥¹¥È¤òÍ­¸ú¤Ë¤¹¤ë¡¢ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÀßÄꤹ¤ë¡¢¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤òÊѹ¹¤¹¤ë¤Ê¤É) +.TP +.B CAP_NET_BIND_SERVICE +.\"O Bind a socket to Internet domain privileged ports +.\"O (port numbers less than 1024). +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥É¥á¥¤¥ó¤ÎÆø¢¥Ý¡¼¥È (¥Ý¡¼¥ÈÈֹ椬 1024 ÈÖ̤Ëþ) +¤ò¥Ð¥¤¥ó¥É¤Ç¤­¤ë¡£ +.TP +.B CAP_NET_BROADCAST +.\"O (Unused) Make socket broadcasts, and listen to multicasts. +(̤»ÈÍÑ) ¥½¥±¥Ã¥È¤Î¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤È¡¢¥Þ¥ë¥Á¥­¥ã¥¹¥È¤ÎÂÔ¤Á¼õ¤±¤ò¹Ô¤¦¡£ +.TP +.B CAP_NET_RAW +.\"O Use RAW and PACKET sockets. +.\"O .\" Also various IP options and setsockopt(SO_BINDTODEVICE) +RAW ¥½¥±¥Ã¥È¤È PACKET ¥½¥±¥Ã¥È¤ò»ÈÍѤ¹¤ë¡£ +.\" ¤Þ¤¿¡¢³Æ¼ï¤Î IP ¥ª¥×¥·¥ç¥ó¤È SO_BINDTODEVICE ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤǤ­¤ë¡£ +.TP +.B CAP_SETGID +.\"O Make arbitrary manipulations of process GIDs and supplementary GID list; +.\"O forge GID when passing socket credentials via Unix domain sockets. +¥×¥í¥»¥¹¤Î GID ¤ÈÄɲäΠGID ¥ê¥¹¥È¤ËÂФ¹¤ëǤ°Õ¤ÎÁàºî¤ò¹Ô¤¦¡£ +Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È·Ðͳ¤Ç¥½¥±¥Ã¥È¤Î»ñ³Ê¾ðÊó (credential) ¤òÅϤ¹ºÝ¤Ë +µ¶¤Î GID ¤òÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.\"O .BR CAP_SETFCAP " (since Linux 2.6.24)" +.BR CAP_SETFCAP " (Linux 2.6.24 °Ê¹ß)" +.\"O Set file capabilities. +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÀßÄꤹ¤ë¡£ +.TP +.B CAP_SETPCAP +.\"O If file capabilities are not supported: +.\"O grant or remove any capability in the +.\"O caller's permitted capability set to or from any other process. +.\"O (This property of +.\"O .B CAP_SETPCAP +.\"O is not available when the kernel is configured to support +.\"O file capabilities, since +.\"O .B CAP_SETPCAP +.\"O has entirely different semantics for such kernels.) +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç: +¸Æ¤Ó½Ð¤·¸µ¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë´Þ¤Þ¤ì¤ëǤ°Õ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¡¢ +¾¤Î¥×¥í¥»¥¹¤ËÉÕÍ¿¤·¤¿¤ê¡¢ºï½ü¤·¤¿¤ê¤Ç¤­¤ë¡£ +(¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.B CAP_SETPCAP +¤Ï¤³¤ÎÌò³ä¤ò»ý¤¿¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤Ç¤Ï +.B CAP_SETPCAP +¤ÏÁ´¤¯Ê̤ΰÕÌ£¤ò»ý¤Ä¤«¤é¤Ç¤¢¤ë¡£) + +.\"O If file capabilities are supported: +.\"O add any capability from the calling thread's bounding set +.\"O to its inheritable set; +.\"O drop capabilities from the bounding set (via +.\"O .BR prctl (2) +.\"O .BR PR_CAPBSET_DROP ); +.\"O make changes to the +.\"O .I securebits +.\"O flags. +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç: +¸Æ¤Ó½Ð¤·¸µ¥¹¥ì¥Ã¥É¤Î¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤ÎǤ°Õ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò +¼«¿È¤Î·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ËÄɲäǤ­¤ë¡£ +.RB ( prctl (2) +.BR PR_CAPBSET_DROP +¤ò»È¤Ã¤Æ) +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òºï½ü¤Ç¤­¤ë¡£ +.I securebits +¥Õ¥é¥°¤òÊѹ¹¤Ç¤­¤ë¡£ +.TP +.B CAP_SETUID +.\"O Make arbitrary manipulations of process UIDs +.\"O .RB ( setuid (2), +.\"O .BR setreuid (2), +.\"O .BR setresuid (2), +.\"O .BR setfsuid (2)); +.\"O make forged UID when passing socket credentials via Unix domain sockets. +¥×¥í¥»¥¹¤Î UID ¤ËÂФ¹¤ëǤ°Õ¤ÎÁàºî +.RB ( setuid (2), +.BR setreuid (2), +.BR setresuid (2), +.BR setfsuid (2)) +¤ò¹Ô¤¦¡£ +Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È·Ðͳ¤Ç¥½¥±¥Ã¥È¤Î»ñ³Ê¾ðÊó (credential) ¤òÅϤ¹ºÝ¤Ë +µ¶¤Î UID ¤òÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.\" FIXME CAP_SETUID also an effect in exec(); document this. +.TP +.B CAP_SYS_ADMIN +.PD 0 +.RS +.IP * 2 +.\"O Perform a range of system administration operations including: +.\"O .BR quotactl (2), +.\"O .BR mount (2), +.\"O .BR umount (2), +.\"O .BR swapon (2), +.\"O .BR swapoff (2), +.\"O .BR sethostname (2), +.\"O and +.\"O .BR setdomainname (2); +°Ê²¼¤Î¥·¥¹¥Æ¥à´ÉÍýÍѤÎÁàºî¤ò¼Â¹Ô¤¹¤ë: +.BR quotactl (2), +.BR mount (2), +.BR umount (2), +.BR swapon (2), +.BR swapoff (2), +.BR sethostname (2), +.BR setdomainname (2). +.IP * +.\"O perform +.\"O .B IPC_SET +.\"O and +.\"O .B IPC_RMID +.\"O operations on arbitrary System V IPC objects; +Ǥ°Õ¤Î System V IPC ¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ¹¤ë +.B IPC_SET +¤È +.B IPC_RMID +Áàºî¤ò¼Â¹Ô¤¹¤ë¡£ +.IP * +.\"O perform operations on +.\"O .I trusted +.\"O and +.\"O .I security +.\"O Extended Attributes (see +.\"O .BR attr (5)); +³Èĥ°À­ +.I trusted +¤È +.I security +¤ËÂФ¹¤ëÁàºî¤ò¼Â¹Ô¤¹¤ë +.RB ( attr (5) +»²¾È)¡£ +.IP * +.\"O use +.\"O .BR lookup_dcookie (2); +.BR lookup_dcookie (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ +.IP * +.\"O use +.\"O .BR ioprio_set (2) +.\"O to assign +.\"O .B IOPRIO_CLASS_RT +.\"O and (before Linux 2.6.25) +.\"O .B IOPRIO_CLASS_IDLE +.\"O I/O scheduling classes; +.BR ioprio_set (2) +¤ò»È¤Ã¤Æ I/O ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹ +.BR IOPRIO_CLASS_RT , +.B IOPRIO_CLASS_IDLE +¤ò³ä¤êÅö¤Æ¤ë +.RB ( IOPRIO_CLASS_IDLE +¤Ï Linux 2.6.25 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¤ß)¡£ +.IP * +.\"O forge UID when passing socket credentials; +¥½¥±¥Ã¥È¤Î»ñ³Ê¾ðÊó (credential) ¤òÅϤ¹ºÝ¤Ëµ¶¤Î UID ¤òÅϤ¹¡£ +.IP * +.\"O exceed +.\"O .IR /proc/sys/fs/file-max , +.\"O the system-wide limit on the number of open files, +.\"O in system calls that open files (e.g., +.\"O .BR accept (2), +.\"O .BR execve (2), +.\"O .BR open (2), +.\"O .BR pipe (2)); +¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë (Î㤨¤Ð +.BR accept (2), +.BR execve (2), +.BR open (2), +.BR pipe (2)) +¤Ç¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¾å¸Â +.I /proc/sys/fs/file-max +¤òĶ²á¤¹¤ë¡£ +.IP * +.\"O employ +.\"O .B CLONE_NEWNS +.\"O flag with +.\"O .BR clone (2) +.\"O and +.\"O .BR unshare (2); +.BR clone (2) +¤È +.BR unshare (2) +¤Ç +.B CLONE_NEWNS +¥Õ¥é¥°¤òÍøÍѤ¹¤ë¡£ +.IP * +.\"O perform +.\"O .B KEYCTL_CHOWN +.\"O and +.\"O .B KEYCTL_SETPERM +.\"O .BR keyctl (2) +.\"O operations. +.BR keyctl (2) +¤Î +.B KEYCTL_CHOWN +¤È +.B KEYCTL_SETPERM +Áàºî¤ò¼Â¹Ô¤¹¤ë¡£ +.RE +.PD +.TP +.B CAP_SYS_BOOT +.\"O Use +.\"O .BR reboot (2) +.\"O and +.\"O .BR kexec_load (2). +.BR reboot (2) +¤È +.BR kexec_load (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ +.TP +.B CAP_SYS_CHROOT +.\"O Use +.\"O .BR chroot (2). +.BR chroot (2). +¤ò¸Æ¤Ó½Ð¤¹¡£ +.TP +.B CAP_SYS_MODULE +.\"O Load and unload kernel modules +.\"O (see +.\"O .BR init_module (2) +.\"O and +.\"O .BR delete_module (2)); +.\"O in kernels before 2.6.25: +.\"O drop capabilities from the system-wide capability bounding set. +¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤Î¥í¡¼¥É¡¢¥¢¥ó¥í¡¼¥É¤ò¹Ô¤¦ +.RB ( init_module (2) +¤È +.BR delete_module (2) +¤ò»²¾È¤Î¤³¤È)¡£ +¥Ð¡¼¥¸¥ç¥ó 2.6.25 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¡¢ +¥·¥¹¥Æ¥àÁ´ÂΤΥ±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È (capability bounding set) +¤«¤é¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò³°¤¹¡£ +.TP +.B CAP_SYS_NICE +.PD 0 +.RS +.IP * 2 +.\"O Raise process nice value +.\"O .RB ( nice (2), +.\"O .BR setpriority (2)) +.\"O and change the nice value for arbitrary processes; +¥×¥í¥»¥¹¤Î nice Ãͤΰú¤­¾å¤² +.RB ( nice (2), +.BR setpriority (2)) +¤ä¡¢Ç¤°Õ¤Î¥×¥í¥»¥¹¤Î nice ÃͤÎÊѹ¹¤ò¹Ô¤¦¡£ +.IP * +.\"O set real-time scheduling policies for calling process, +.\"O and set scheduling policies and priorities for arbitrary processes +.\"O .RB ( sched_setscheduler (2), +.\"O .BR sched_setparam (2)); +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ËÂФ¹¤ë¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥Ý¥ê¥·¡¼¤È¡¢ +Ǥ°Õ¤Î¥×¥í¥»¥¹¤ËÂФ¹¤ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥Ý¥ê¥·¡¼¤ÈÍ¥ÀèÅÙ¤òÀßÄꤹ¤ë +.RB ( sched_setscheduler (2), +.BR sched_setparam (2))¡£ +.IP * +.\"O set CPU affinity for arbitrary processes +.\"O .RB ( sched_setaffinity (2)); +Ǥ°Õ¤Î¥×¥í¥»¥¹¤ËÂФ¹¤ë CPU affinity ¤òÀßÄê¤Ç¤­¤ë +.RB ( sched_setaffinity (2))¡£ +.IP * +.\"O set I/O scheduling class and priority for arbitrary processes +.\"O .RB ( ioprio_set (2)); +Ǥ°Õ¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ I/O ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ÈÍ¥ÀèÅÙ¤òÀßÄê¤Ç¤­¤ë +.RB ( ioprio_set (2))¡£ +.IP * +.\"O apply +.\"O .BR migrate_pages (2) +.\"O to arbitrary processes and allow processes +.\"O to be migrated to arbitrary nodes; +.BR migrate_pages (2) +¤òǤ°Õ¤Î¥×¥í¥»¥¹¤ËŬÍѤ·¡¢¥×¥í¥»¥¹¤òǤ°Õ¤Î¥Î¡¼¥É¤Ë°ÜÆ°¤¹¤ë¡£ +.\" FIXME CAP_SYS_NICE also has the following effect for +.\" migrate_pages(2): +.\" do_migrate_pages(mm, &old, &new, +.\" capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE); +.IP * +.\"O apply +.\"O .BR move_pages (2) +.\"O to arbitrary processes; +.BR move_pages (2) +¤òǤ°Õ¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ¹Ô¤¦¡£ +.IP * +.\"O use the +.\"O .B MPOL_MF_MOVE_ALL +.\"O flag with +.\"O .BR mbind (2) +.\"O and +.\"O .BR move_pages (2). +.BR mbind (2) +¤È +.BR move_pages (2) +¤Ç +.B MPOL_MF_MOVE_ALL +¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¡£ +.RE +.PD +.TP +.B CAP_SYS_PACCT +.\"O Use +.\"O .BR acct (2). +.BR acct (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ +.TP +.B CAP_SYS_PTRACE +.\"O Trace arbitrary processes using +.\"O .BR ptrace (2) +.BR ptrace (2) +¤ò»È¤Ã¤ÆǤ°Õ¤Î¥×¥í¥»¥¹¤ò¥È¥ì¡¼¥¹¤¹¤ë¡£ +.TP +.B CAP_SYS_RAWIO +.\"O Perform I/O port operations +.\"O .RB ( iopl (2) +.\"O and +.\"O .BR ioperm (2)); +.\"O access +.\"O .IR /proc/kcore . +I/O ¥Ý¡¼¥ÈÁàºî¤ò¼Â¹Ô¤¹¤ë +.RB ( iopl (2) +¡¢ +.BR ioperm (2))¡£ +.I /proc/kcore +¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.TP +.B CAP_SYS_RESOURCE +.PD 0 +.RS +.IP * 2 +.\"O Use reserved space on ext2 file systems; +ext2 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤ÎͽÌ󤵤ì¤Æ¤¤¤ëÎΰè¤ò»ÈÍѤ¹¤ë¡£ +.IP * +.\"O make +.\"O .BR ioctl (2) +.\"O calls controlling ext3 journaling; +ext3 ¤Î¥¸¥ã¡¼¥Ê¥ëµ¡Ç½¤òÀ©¸æ¤¹¤ë +.BR ioctl (2) +¤ò»ÈÍѤ¹¤ë¡£ +.IP * +.\"O override disk quota limits; +¥Ç¥£¥¹¥¯ quota ¤Î¾å¸Â¤ò¾å½ñ¤­¤¹¤ë¡£ +.IP * +.\"O increase resource limits (see +.\"O .BR setrlimit (2)); +¥ê¥½¡¼¥¹¾å¸Â¤òÁý¤ä¤¹ +.RB ( setrlimit (2))¡£ +.IP * +.\"O override +.\"O .B RLIMIT_NPROC +.\"O resource limit; +.B RLIMIT_NPROC +¥ê¥½¡¼¥¹À©¸Â¤ò¾å½ñ¤­¤¹¤ë¡£ +.IP * +.\"O raise +.\"O .I msg_qbytes +.\"O limit for a System V message queue above the limit in +.\"O .I /proc/sys/kernel/msgmnb +.\"O (see +.\"O .BR msgop (2) +.\"O and +.\"O .BR msgctl (2)). +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ë´Ø¤¹¤ë¾å¸Â +.I msg_qbytes +¤ò +.I /proc/sys/kernel/msgmnb +¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¾å¸Â¤è¤ê¤âÂ礭¤¯ÀßÄꤹ¤ë +.RB ( msgop (2) +¤È +.BR msgctl (2) +»²¾È)¡£ +.RE +.PD +.TP +.B CAP_SYS_TIME +.\"O Set system clock +.\"O .RB ( settimeofday (2), +.\"O .BR stime (2), +.\"O .BR adjtimex (2)); +.\"O set real-time (hardware) clock. +¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤òÊѹ¹¤¹¤ë +.RB ( settimeofday (2), +.BR stime (2), +.BR adjtimex (2))¡£ +¥ê¥¢¥ë¥¿¥¤¥à (¥Ï¡¼¥É¥¦¥§¥¢) ¥¯¥í¥Ã¥¯¤òÊѹ¹¤¹¤ë¡£ +.TP +.B CAP_SYS_TTY_CONFIG +.\"O Use +.\"O .BR vhangup (2). +.BR vhangup (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ +.\" +.\"O .SS Past and Current Implementation +.SS ²áµî¤È¸½ºß¤Î¼ÂÁõ +.\"O A full implementation of capabilities requires that: +´°Á´¤Ê·Á¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¼ÂÁõ¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤ÎÍ×·ï¤òËþ¤¿¤¹É¬Íפ¬¤¢¤ë¡§ +.IP 1. 3 +.\"O For all privileged operations, +.\"O the kernel must check whether the thread has the required +.\"O capability in its effective set. +Á´¤Æ¤ÎÆø¢Áàºî¤Ë¤Ä¤¤¤Æ¡¢¥«¡¼¥Í¥ë¤Ï¤½¤Î¥¹¥ì¥Ã¥É¤Î¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë +ɬÍפʥ±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤¢¤ë¤«¤ò³Îǧ¤¹¤ë¡£ +.IP 2. +.\"O The kernel must provide system calls allowing a thread's capability sets to +.\"O be changed and retrieved. +¥«¡¼¥Í¥ë¤Ç¡¢¤¢¤ë¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤òÊѹ¹¤·¤¿¤ê¡¢ +¼èÆÀ¤·¤¿¤ê¤Ç¤­¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Ä󶡤µ¤ì¤ë¡£ +.IP 3. +.\"O The file system must support attaching capabilities to an executable file, +.\"O so that a process gains those capabilities when the file is executed. +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¡¢¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤Ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÉÕÍ¿¤Ç¤­¡¢¥Õ¥¡¥¤¥ë +¼Â¹Ô»þ¤Ë¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥×¥í¥»¥¹¤¬¼èÆÀ¤Ç¤­¤ë¤è¤¦¤Êµ¡Ç½¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +.PP +.\"O Before kernel 2.6.24, only the first two of these requirements are met; +.\"O since kernel 2.6.24, all three requirements are met. +¥«¡¼¥Í¥ë 2.6.24 ¤è¤êÁ°¤Ç¤Ï¡¢ºÇ½é¤Î 2¤Ä¤ÎÍ×·ï¤Î¤ß¤¬Ëþ¤¿¤µ¤ì¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë 2.6.24 °Ê¹ß¤Ç¤Ï¡¢3¤Ä¤ÎÍ׷魯¤Ù¤Æ¤¬Ëþ¤¿¤µ¤ì¤Æ¤¤¤ë¡£ +.\" +.\"O .SS Thread Capability Sets +.SS ¥¹¥ì¥Ã¥É¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È +.\"O Each thread has three capability sets containing zero or more +.\"O of the above capabilities: +³Æ¥¹¥ì¥Ã¥É¤Ï°Ê²¼¤Î 3¼ïÎà¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ò»ý¤Ä¡£³Æ¡¹¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ï +¾åµ­¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÎÁȤ߹ç¤ï¤»¤Ç¤¢¤ë (Á´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Ìµ¸ú¤Ç¤â¤è¤¤)¡£ +.TP +.\"O .IR Permitted : +.\"O This is a limiting superset for the effective +.\"O capabilities that the thread may assume. +.\"O It is also a limiting superset for the capabilities that +.\"O may be added to the inheritable set by a thread that does not have the +.\"O .B CAP_SETPCAP +.\"O capability in its effective set. +.IR "µö²Ä (permitted)" : +¤½¤Î¥¹¥ì¥Ã¥É¤¬»ý¤Ä¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î +¸ÂÄêŪ¤Ê¥¹¡¼¥Ñ¡¼¥»¥Ã¥È¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï¡¢¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¥¹¥ì¥Ã¥É¤¬·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë +ÄɲòÄǽ¤Ê¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¸ÂÄêŪ¤Ê¥¹¡¼¥Ñ¡¼¥»¥Ã¥È¤Ç¤â¤¢¤ë¡£ + +.\"O If a thread drops a capability from its permitted set, +.\"O it can never reacquire that capability (unless it +.\"O .BR execve (2)s +.\"O either a set-user-ID-root program, or +.\"O a program whose associated file capabilities grant that capability). +µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤«¤éºï½ü¤·¤Æ¤·¤Þ¤Ã¤¿¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï¡¢ +(set-user-ID-root ¥×¥í¥°¥é¥à¤«¡¢ +¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Çµö²Ä¤·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤ò +.BR execve (2) +¤·¤Ê¤¤¸Â¤ê¤Ï) ¤â¤¦°ìÅÙ³ÍÆÀ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.\"O .IR Inheritable : +.\"O This is a set of capabilities preserved across an +.\"O .BR execve (2). +.\"O It provides a mechanism for a process to assign capabilities +.\"O to the permitted set of the new program during an +.\"O .BR execve (2). +.IR "·Ñ¾µ²Äǽ (inheritable)" : +.BR execve (2) +¤òÁ°¸å¤ÇÊÝ»ý¤µ¤ì¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ç¤¢¤ë¡£ +¤³¤Î»ÅÁȤߤò»È¤¦¤³¤È¤Ç¡¢¤¢¤ë¥×¥í¥»¥¹¤¬ +.BR execve (2) +¤ò¹Ô¤¦ºÝ¤Ë¿·¤·¤¤¥×¥í¥°¥é¥à¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤È¤·¤Æ +³ä¤êÅö¤Æ¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.\"O .IR Effective : +.\"O This is the set of capabilities used by the kernel to +.\"O perform permission checks for the thread. +.IR "¼Â¸ú (effective)" : +¥«¡¼¥Í¥ë¤¬¥¹¥ì¥Ã¥É¤Î¸¢¸Â (permission) ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤È¤­¤Ë +»ÈÍѤ¹¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ç¤¢¤ë¡£ +.PP +.\"O A child created via +.\"O .BR fork (2) +.\"O inherits copies of its parent's capability sets. +.\"O See below for a discussion of the treatment of capabilities during +.\"O .BR execve (2). +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤ë»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +Ãæ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î°·¤¤¤Ë¤Ä¤¤¤Æ¤Ï²¼µ­¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O Using +.\"O .BR capset (2), +.\"O a thread may manipulate its own capability sets (see below). +.BR capset (2) +¤ò»È¤¦¤È¡¢¥×¥í¥»¥¹¤Ï¼«Ê¬¼«¿È¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È +¤òÁàºî¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë (²¼µ­»²¾È)¡£ +.\" +.\"O .SS File Capabilities +.SS ¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\"O Since kernel 2.6.24, the kernel supports +.\"O associating capability sets with an executable file using +.\"O .BR setcap (8). +.\"O The file capability sets are stored in an extended attribute (see +.\"O .BR setxattr (2)) +.\"O named +.\"O .IR "security.capability" . +.\"O Writing to this extended attribute requires the +.\"O .BR CAP_SETFCAP +.\"O capability. +¥«¡¼¥Í¥ë 2.6.24 °Ê¹ß¤Ç¤Ï¡¢ +.BR setcap (8) +¤ò»È¤Ã¤Æ¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤òÂбþÉÕ¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ï +.I "security.capability" +¤È¤¤¤¦Ì¾Á°¤Î³Èĥ°À­¤ËÊݸ¤µ¤ì¤ë +.RB ( setxattr (2) +»²¾È)¡£¤³¤Î³Èĥ°À­¤Ø¤Î½ñ¤­¹þ¤ß¤Ë¤Ï +.B CAP_SETFCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.\"O The file capability sets, +.\"O in conjunction with the capability sets of the thread, +.\"O determine the capabilities of a thread after an +.\"O .BR execve (2). +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤È¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎξÊý¤¬ +¹Í褵¤ì¡¢ +.BR execve (2) +¸å¤Î¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤¬·èÄꤵ¤ì¤ë¡£ + +.\"O The three file capability sets are: +3 ¤Ä¤Î¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.\"O .IR Permitted " (formerly known as " forced ): +.\"O These capabilities are automatically permitted to the thread, +.\"O regardless of the thread's inheritable capabilities. +.IR "µö²Ä (Permitted)" " (°ÊÁ°¤Î" "¶¯À© (Forced)" "):" +¥¹¥ì¥Ã¥É¤Î·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ë´Ø¤ï¤é¤º¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ë¼«Æ°Åª¤Ë +ǧ¤á¤é¤ì¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡£ +.TP +.\"O .IR Inheritable " (formerly known as " allowed ): +.\"O This set is ANDed with the thread's inheritable set to determine which +.\"O inheritable capabilities are enabled in the permitted set of +.\"O the thread after the +.\"O .BR execve (2). +.IR "·Ñ¾µ²Äǽ (Inheritable)" " (°ÊÁ°¤Î " "µöÍÆ (Allowed)" "):" +¤³¤Î¥»¥Ã¥È¤È¡¢¥¹¥ì¥Ã¥É¤Î·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤È¤Î +ÏÀÍýÀÑ (AND) ¤¬¤È¤é¤ì¡¢ +.BR execve (2) +¤Î¸å¤Ë¤½¤Î¥¹¥ì¥Ã¥É¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÇÍ­¸ú¤È¤Ê¤ë +·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬·èÄꤵ¤ì¤ë¡£ +.TP +.\"O .IR Effective : +.IR "¼Â¸ú (Effective)" : +.\"O This is not a set, but rather just a single bit. +.\"O If this bit is set, then during an +.\"O .BR execve (2) +.\"O all of the new permitted capabilities for the thread are +.\"O also raised in the effective set. +.\"O If this bit is not set, then after an +.\"O .BR execve (2), +.\"O none of the new permitted capabilities is in the new effective set. +¤³¤ì¤Ï½¸¹ç¤Ç¤Ï¤Ê¤¯¡¢1 ¥Ó¥Ã¥È¤Î¾ðÊó¤Ç¤¢¤ë¡£ +¤³¤Î¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +.BR execve (2) +¼Â¹ÔÃæ¤Ë¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Î¿·¤·¤¤µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Á´¤Æ +¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£½¸¹ç¤Ë¤ª¤¤¤Æ¤â¥»¥Ã¥È¤µ¤ì¤ë¡£ +¤³¤Î¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.BR execve (2) +¸å¤Ë¤Ï¿·¤·¤¤µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¤É¤ì¤â¿·¤·¤¤¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£½¸¹ç +¤Ë¥»¥Ã¥È¤µ¤ì¤Ê¤¤¡£ + +.\"O Enabling the file effective capability bit implies +.\"O that any file permitted or inheritable capability that causes a +.\"O thread to acquire the corresponding permitted capability during an +.\"O .BR execve (2) +.\"O (see the transformation rules described below) will also acquire that +.\"O capability in its effective set. +¥Õ¥¡¥¤¥ë¤Î¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ó¥Ã¥È¤òÍ­¸ú¤Ë¤¹¤ë¤È¤¤¤¦¤Î¤Ï¡¢ +.BR execve (2) +¼Â¹Ô»þ¤Ë¡¢¥Õ¥¡¥¤¥ë¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤È·Ñ¾µ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ËÂбþ¤¹¤ë¤â¤Î¤¬ +¥¹¥ì¥Ã¥É¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤È¤·¤Æ¥»¥Ã¥È¤µ¤ì¤ë¤¬¡¢ +¤³¤ì¤¬¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë¤â¥»¥Ã¥È¤µ¤ì¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë +(¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÎÊÑ´¹¥ë¡¼¥ë¤Ï²¼µ­»²¾È)¡£ +.\"O Therefore, when assigning capabilities to a file +.\"O .RB ( setcap (8), +.\"O .BR cap_set_file (3), +.\"O .BR cap_set_fd (3)), +.\"O if we specify the effective flag as being enabled for any capability, +.\"O then the effective flag must also be specified as enabled +.\"O for all other capabilities for which the corresponding permitted or +.\"O inheritable flags is enabled. +¤·¤¿¤¬¤Ã¤Æ¡¢¥Õ¥¡¥¤¥ë¤Ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò³ä¤êÅö¤Æ¤ëºÝ +.RB ( setcap (8), +.BR cap_set_file (3), +.BR cap_set_fd (3))¡¢ +¤¤¤º¤ì¤«¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ËÂФ·¤Æ¼Â¸ú¥Õ¥é¥°¤òÍ­¸ú¤È»ØÄꤹ¤ë¾ì¹ç¡¢ +µö²Ä¥Õ¥é¥°¤ä·Ñ¾µ²Äǽ¥Õ¥é¥°¤òÍ­¸ú¤Ë¤·¤¿Â¾¤ÎÁ´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +¤Ë¤Ä¤¤¤Æ¤â¼Â¸ú¥Õ¥é¥°¤òÍ­¸ú¤È»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" +.\"O .SS Transformation of Capabilities During execve() +.SS "execve() Ãæ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÎÊÑ´¹" +.PP +.\"O During an +.\"O .BR execve (2), +.\"O the kernel calculates the new capabilities of +.\"O the process using the following algorithm: +.BR execve (2) +¼Â¹Ô»þ¤Ë¡¢¥«¡¼¥Í¥ë¤Ï¥×¥í¥»¥¹¤Î¿·¤·¤¤¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¼¡¤Î +¥¢¥ë¥´¥ê¥º¥à¤òÍѤ¤¤Æ·×»»¤¹¤ë¡§ +.in +4n +.nf + +P'(permitted) = (P(inheritable) & F(inheritable)) | + (F(permitted) & cap_bset) + +P'(effective) = F(effective) ? P'(permitted) : 0 + +.\"O P'(inheritable) = P(inheritable) [i.e., unchanged] +P'(inheritable) = P(inheritable) [¤Ä¤Þ¤ê¡¢Êѹ¹¤µ¤ì¤Ê¤¤] + +.fi +.in +.\"O where: +³ÆÊÑ¿ô¤Î°ÕÌ£¤Ï°Ê²¼¤ÎÄ̤ê: +.RS 4 +.IP P 10 +.\"O denotes the value of a thread capability set before the +.\"O .BR execve (2) +.BR execve (2) +Á°¤Î¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÃÍ +.IP P' +.\"O denotes the value of a capability set after the +.\"O .BR execve (2) +.BR execve (2) +¸å¤Î¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÃÍ +.IP F +.\"O denotes a file capability set +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÃÍ +.IP cap_bset +.\"O is the value of the capability bounding set (described below). +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤ÎÃÍ (²¼µ­»²¾È) +.RE +.\" +.\"O .SS Capabilities and execution of programs by root +.SS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤È¡¢¥ë¡¼¥È¤Ë¤è¤ë¥×¥í¥°¥é¥à¤Î¼Â¹Ô +.\"O In order to provide an all-powerful +.\"O .I root +.\"O using capability sets, during an +.\"O .BR execve (2): +.BR execve (2) +»þ¤Ë¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ò»È¤Ã¤Æ¡¢Á´¤Æ¤Î¸¢¸Â¤ò»ý¤Ã¤¿ +.I root +¤ò¼Â¸½¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¡£ +.IP 1. 3 +.\"O If a set-user-ID-root program is being executed, +.\"O or the real user ID of the process is 0 (root) +.\"O then the file inheritable and permitted sets are defined to be all ones +.\"O (i.e., all capabilities enabled). +set-user-ID-root ¥×¥í¥°¥é¥à¤¬¼Â¹Ô¤µ¤ì¤ë¾ì¹ç¡¢ +¤Þ¤¿¤Ï¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID ¤¬ 0 (root) ¤Î¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤Èµö²Ä¥»¥Ã¥È¤òÁ´¤Æ 1 +(Á´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Í­¸ú) ¤ËÄêµÁ¤¹¤ë¡£ +.IP 2. +.\"O If a set-user-ID-root program is being executed, +.\"O then the file effective bit is defined to be one (enabled). +set-user-ID-root ¥×¥í¥°¥é¥à¤¬¼Â¹Ô¤µ¤ì¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¤Î¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ó¥Ã¥È¤ò 1 (enabled) ¤ËÄêµÁ¤¹¤ë¡£ +.PP +.\"O The upshot of the above rules, +.\"O combined with the capabilities transformations described above, +.\"O is that when a process +.\"O .BR execve (2)s +.\"O a set-user-ID-root program, or when a process with an effective UID of 0 +.\"O .BR execve (2)s +.\"O a program, +.\"O it gains all capabilities in its permitted and effective capability sets, +.\"O except those masked out by the capability bounding set. +.\"O .\" If a process with real UID 0, and nonzero effective UID does an +.\"O .\" exec(), then it gets all capabilities in its +.\"O .\" permitted set, and no effective capabilities +.\"O This provides semantics that are the same as those provided by +.\"O traditional Unix systems. +¾åµ­¤Î¥ë¡¼¥ë¤Ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ÊÑ´¹¤òŬÍѤ·¤¿·ë²Ì¤ò¤Þ¤È¤á¤ë¤È¡¢ +¥×¥í¥»¥¹¤¬ set-user-ID-root ¥×¥í¥°¥é¥à¤ò +.BR execve (2) +¤¹¤ë¾ì¹ç¡¢¤Þ¤¿¤Ï¼Â¸ú UID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤¬¥×¥í¥°¥é¥à¤ò +.BR execve (2) +¤¹¤ë¾ì¹ç¡¢µö²Ä¤È¼Â¸ú¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÁ´¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +(Àµ³Î¤Ë¤Ï¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ë¤è¤ë¥Þ¥¹¥¯¤Ç½ü³°¤µ¤ì¤ë¤â¤Î +°Ê³°¤ÎÁ´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò¼èÆÀ¤¹¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.\" ¼Â UID ¤¬ 0 ¤Ç¼Â¸ú UID ¤¬ 0 °Ê³°¤Î¥×¥í¥»¥¹¤¬ exec () ¤ò¹Ô¤¦¤È¡¢ +.\" µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë´Þ¤Þ¤ì¤ëÁ´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\" ¤¬¼èÆÀ¤µ¤ì¡¢¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï¼èÆÀ¤µ¤ì¤Ê¤¤¡£ +¤³¤ì¤Ë¤è¤ê¡¢ÅÁÅýŪ¤Ê Unix ¥·¥¹¥Æ¥à¤ÈƱ¤¸¿¶¤ëÉñ¤¤¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O .SS Capability bounding set +.SS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È +.\"O The capability bounding set is a security mechanism that can be used +.\"O to limit the capabilities that can be gained during an +.\"O .BR execve (2). +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È (capability bounding set) ¤Ï¡¢ +.BR execve (2) +»þ¤Ë³ÍÆÀ¤Ç¤­¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÀ©¸Â¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë +¥»¥­¥å¥ê¥Æ¥£µ¡¹½¤Ç¤¢¤ë¡£ +.\"O The bounding set is used in the following ways: +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï°Ê²¼¤Î¤è¤¦¤Ë»ÈÍѤµ¤ì¤ë¡£ +.IP * 2 +.\"O During an +.\"O .BR execve (2), +.\"O the capability bounding set is ANDed with the file permitted +.\"O capability set, and the result of this operation is assigned to the +.\"O thread's permitted capability set. +.\"O The capability bounding set thus places a limit on the permitted +.\"O capabilities that may be granted by an executable file. +.BR execve (2) +¼Â¹Ô»þ¤Ë¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤È +¥Õ¥¡¥¤¥ë¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÏÀÍýÏ (AND) ¤ò¼è¤Ã¤¿¤â¤Î¤¬¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +¤Ä¤Þ¤ê¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï¡¢ +¼Â¹Ô¥Õ¥¡¥¤¥ë¤¬Ç§¤á¤Æ¤¤¤ëµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ËÂФ·¤Æ +À©¸Â¤ò²Ý¤¹Æ¯¤­¤ò¤¹¤ë¡£ +.IP * +.\"O (Since Linux 2.6.25) +.\"O The capability bounding set acts as a limiting superset for +.\"O the capabilities that a thread can add to its inheritable set using +.\"O .BR capset (2). +.\"O This means that if a capability is not in the bounding set, +.\"O then a thread can't add this capability to its +.\"O inheritable set, even if it was in its permitted capabilities, +.\"O and thereby cannot have this capability preserved in its +.\"O permitted set when it +.\"O .BR execve (2)s +.\"O a file that has the capability in its inheritable set. +(Linux 2.6.25 °Ê¹ß) +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï¡¢¥¹¥ì¥Ã¥É¤¬ +.BR capset (2) +¤Ë¤è¤ê¼«¿È¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤ËÄɲòÄǽ¤Ê¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÎÊ콸ÃĤò +À©¸Â¤¹¤ëÌò³ä¤ò»ý¤Ä¡£ +¥¹¥ì¥Ã¥É¤Ëµö²Ä¤µ¤ì¤¿¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ç¤¢¤Ã¤Æ¤â¡¢¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ë +´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¥¹¥ì¥Ã¥É¤Ï¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï¼«¿È¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤Ë +ÄɲäǤ­¤º¡¢¤½¤Î·ë²Ì¡¢·Ñ¾µ²Äǽ¥»¥Ã¥È¤Ë¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò´Þ¤à¥Õ¥¡¥¤¥ë¤ò +.BR execve (2) +¤¹¤ë¾ì¹ç¡¢¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òµö²Ä¥»¥Ã¥È¤Ë»ý¤Á³¤±¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡¢ +¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.PP +.\"O Note that the bounding set masks the file permitted capabilities, +.\"O but not the inherited capabilities. +.\"O If a thread maintains a capability in its inherited set +.\"O that is not in its bounding set, +.\"O then it can still gain that capability in its permitted set +.\"O by executing a file that has the capability in its inherited set. +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤¬¥Þ¥¹¥¯¤ò¹Ô¤¦¤Î¤Ï¡¢·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ç¤Ï¤Ê¤¯¡¢ +¥Õ¥¡¥¤¥ë¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥Þ¥¹¥¯¤ò¹Ô¤¦ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤¢¤ë¥¹¥ì¥Ã¥É¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤Ë¤½¤Î¥¹¥ì¥Ã¥É¤Î¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ë +¸ºß¤·¤Ê¤¤¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ï¡¢ +·Ñ¾µ²Äǽ¥»¥Ã¥È¤Ë´Þ¤Þ¤ì¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢ +µö²Ä¥»¥Ã¥È¤Ë´Þ¤Þ¤ì¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â³ÍÆÀ¤Ç¤­¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.PP +.\"O Depending on the kernel version, the capability bounding set is either +.\"O a system-wide attribute, or a per-process attribute. +¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï +¥·¥¹¥Æ¥à¶¦Ä̤ΰÀ­¤Î¾ì¹ç¤È¡¢¥×¥í¥»¥¹Ã±°Ì¤Î°À­¤Î¾ì¹ç¤¬¤¢¤ë¡£ +.PP +.\"O .B "Capability bounding set prior to Linux 2.6.25" +.B "Linux 2.6.25 ¤è¤êÁ°¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È" +.PP +.\"O In kernels before 2.6.25, the capability bounding set is a system-wide +.\"O attribute that affects all threads on the system. +2.6.25 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï +¥·¥¹¥Æ¥à¶¦Ä̤ΰÀ­¤Ç¡¢¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤ËŬÍѤµ¤ì¤ë¡£ +.\"O The bounding set is accessible via the file +.\"O .IR /proc/sys/kernel/cap-bound . +.\"O motoki: accessible = ¡Ö»²¾È²Äǽ¡×¤Ç¤è¤¤¤«¡¢Ê¸Ì®¤òÍ׳Îǧ +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï +.I /proc/sys/kernel/cap-bound +¥Õ¥¡¥¤¥ë·Ðͳ¤Ç»²¾È¤Ç¤­¤ë¡£ +.\"O (Confusingly, this bit mask parameter is expressed as a +.\"O signed decimal number in +.\"O .IR /proc/sys/kernel/cap-bound .) +(´Ö°ã¤¨¤ä¤¹¤¤¤¬¡¢¤³¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯·Á¼°¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢ +.I /proc/sys/kernel/cap-bound +¤Ç¤ÏÉä¹æÉÕ¤­¤Î½½¿Ê¿ô¤Çɽ¸½¤µ¤ì¤ë¡£) + +.\"O Only the +.\"O .B init +.\"O process may set capabilities in the capability bounding set; +.\"O other than that, the superuser (more precisely: programs with the +.\"O .B CAP_SYS_MODULE +.\"O capability) may only clear capabilities from this set. +.B init +¥×¥í¥»¥¹¤À¤±¤¬¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ç +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥»¥Ã¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤½¤ì°Ê³°¤Ç¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶ (¤è¤êÀµ³Î¤Ë¤Ï¡¢ +.B CAP_SYS_MODULE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤¿¥×¥í¥°¥é¥à) ¤¬¡¢ +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥¯¥ê¥¢¤¬ +¤Ç¤­¤ë¤À¤±¤Ç¤¢¤ë¡£ + +.\"O On a standard system the capability bounding set always masks out the +.\"O .B CAP_SETPCAP +.\"O capability. +.\"O To remove this restriction (dangerous!), modify the definition of +.\"O .B CAP_INIT_EFF_SET +.\"O in +.\"O .I include/linux/capability.h +.\"O and rebuild the kernel. +Ä̾ï¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï¡¢ +.B CAP_SETPCAP +¤¬Ìµ¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤³¤ÎÀ©¸Â¤ò¼è¤êµî¤ë¤Ë¤Ï (¼è¤êµî¤ë¤Î¤Ï´í¸±!)¡¢ +.I include/linux/capability.h +Æâ¤Î +.B CAP_INIT_EFF_SET +¤ÎÄêµÁ¤ò½¤Àµ¤·¡¢¥«¡¼¥Í¥ë¤òºÆ¹½ÃÛ¤¹¤ëɬÍפ¬¤¢¤ë¡£ + +.\"O The system-wide capability bounding set feature was added +.\"O to Linux starting with kernel version 2.2.11. +¥·¥¹¥Æ¥à¶¦Ä̤Υ±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥Èµ¡Ç½¤Ï¡¢ +¥«¡¼¥Í¥ë 2.2.11 °Ê¹ß¤Ç Linux ¤ËÄɲ䵤줿¡£ +.\" +.PP +.\"O .B "Capability bounding set from Linux 2.6.25 onwards" +.B "Linux 2.6.25 °Ê¹ß¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È" +.PP +.\"O From Linux 2.6.25, the +.\"O .I "capability bounding set" +.\"O is a per-thread attribute. +.\"O (There is no longer a system-wide capability bounding set.) +Linux 2.6.25 °Ê¹ß¤Ç¤Ï¡¢ +¡Ö¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¡×¤Ï¥¹¥ì¥Ã¥Éñ°Ì¤Î°À­¤Ç¤¢¤ë +(¥·¥¹¥Æ¥à¶¦Ä̤Υ±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï¤â¤Ï¤ä¸ºß¤·¤Ê¤¤)¡£ + +.\"O The bounding set is inherited at +.\"O .BR fork (2) +.\"O from the thread's parent, and is preserved across an +.\"O .BR execve (2). +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï +.BR fork (2) +»þ¤Ë¤Ï¥¹¥ì¥Ã¥É¤Î¿Æ¥×¥í¥»¥¹¤«¤é·Ñ¾µ¤µ¤ì¡¢ +.BR execve (2) +¤ÎÁ°¸å¤Ç¤ÏÊÝ»ý¤µ¤ì¤ë¡£ + +.\"O A thread may remove capabilities from its capability bounding set using the +.\"O .BR prctl (2) +.\"O .B PR_CAPBSET_DROP +.\"O operation, provided it has the +.\"O .B CAP_SETPCAP +.\"O capability. +.\"O Once a capability has been dropped from the bounding set, +.\"O it cannot be restored to that set. +.\"O A thread can determine if a capability is in its bounding set using the +.\"O .BR prctl (2) +.\"O .B PR_CAPBSET_READ +.\"O operation. +¥¹¥ì¥Ã¥É¤¬ +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ï +.BR prctl (2) +¤Î +.BR PR_CAPBSET_DROP +Áàºî¤ò»È¤Ã¤Æ¼«¿È¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤¤¤Ã¤¿¤ó¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤éºï½ü¤·¤Æ¤·¤Þ¤¦¤È¡¢ +¥¹¥ì¥Ã¥É¤Ï¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òºÆÅÙ¥»¥Ã¥È¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.BR prctl (2) +¤Î +.B PR_CAPBSET_READ +Áàºî¤ò»È¤¦¤³¤È¤Ç¡¢¥¹¥ì¥Ã¥É¤¬¤¢¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¼«¿È¤Î¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤òÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ + +.\"O Removing capabilities from the bounding set is only supported if file +.\"O capabilities are compiled into the kernel +.\"O (CONFIG_SECURITY_FILE_CAPABILITIES). +.\"O In that case, the +.\"O .B init +.\"O process (the ancestor of all processes) begins with a full bounding set. +.\"O If file capabilities are not compiled into the kernel, then +.\"O .B init +.\"O begins with a full bounding set minus +.\"O .BR CAP_SETPCAP , +.\"O because this capability has a different meaning when there are +.\"O no file capabilities. +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Îºï½ü¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤ë¤Î¤Ï¡¢ +¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç +(CONFIG_SECURITY_FILE_CAPABILITIES) ¤À¤±¤Ç¤¢¤ë¡£ +¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ (Á´¤Æ¤Î¥×¥í¥»¥¹¤ÎÀèÁĤǤ¢¤ë) +.I init +¥×¥í¥»¥¹¤Ï¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤ÇÁ´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬ +¥»¥Ã¥È¤µ¤ì¤¿¾õÂ֤dz«»Ï¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +.I init +¤Ï¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ç +.B CAP_SETPCAP +°Ê³°¤ÎÁ´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥»¥Ã¥È¤µ¤ì¤¿¾õÂ֤dz«»Ï¤¹¤ë¡£ +¤³¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ï¡¢ +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï +°ã¤Ã¤¿°ÕÌ£¤ò»ý¤Ä¤«¤é¤Ç¤¢¤ë¡£ + +.\"O Removing a capability from the bounding set does not remove it +.\"O from the thread's inherited set. +.\"O However it does prevent the capability from being added +.\"O back into the thread's inherited set in the future. +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òºï½ü¤·¤Æ¤â¡¢ +¥¹¥ì¥Ã¥É¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤«¤é¤Ï¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ïºï½ü¤µ¤ì¤Ê¤¤¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é¤Îºï½ü¤Ë¤è¤ê¡¢ +¤³¤ÎÀ褽¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥¹¥ì¥Ã¥É¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤ËÄɲ乤뤳¤È +¤Ï¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +.\" +.\" +.\"O .SS Effect of User ID Changes on Capabilities +.SS "¥æ¡¼¥¶ ID Êѹ¹¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ø¤Î±Æ¶Á" +.\"O To preserve the traditional semantics for transitions between +.\"O 0 and nonzero user IDs, +.\"O the kernel makes the following changes to a thread's capability +.\"O sets on changes to the thread's real, effective, saved set, +.\"O and file system user IDs (using +.\"O .BR setuid (2), +.\"O .BR setresuid (2), +.\"O or similar): +¥æ¡¼¥¶ ID ¤¬ 0 ¤È 0 °Ê³°¤Î´Ö¤ÇÊѲ½¤¹¤ëºÝ¤Î¿¶¤ëÉñ¤¤¤ò½¾Íè¤ÈƱ¤¸¤Ë¤¹¤ë¤¿¤á¡¢ +¥¹¥ì¥Ã¥É¤Î¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤¬ +.RB ( setuid (2), +.BR setresuid (2) +¤Ê¤É¤ò»È¤Ã¤Æ) Êѹ¹¤µ¤ì¤¿ºÝ¤Ë¡¢¥«¡¼¥Í¥ë¤Ï¤½¤Î¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë +°Ê²¼¤ÎÊѹ¹¤ò¹Ô¤¦: +.IP 1. 3 +.\"O If one or more of the real, effective or saved set user IDs +.\"O was previously 0, and as a result of the UID changes all of these IDs +.\"O have a nonzero value, +.\"O then all capabilities are cleared from the permitted and effective +.\"O capability sets. +UID ¤ÎÊѹ¹Á°¤Ë¤Ï¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤Î¤¦¤Á +¾¯¤Ê¤¯¤È¤â°ì¤Ä¤¬ 0 ¤Ç¡¢Êѹ¹¸å¤Ë¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤¬ +¤¹¤Ù¤Æ 0 °Ê³°¤ÎÃͤˤʤ俾ì¹ç¡¢µö²Ä¤È¼Â¸ú¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Î +Á´¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥¯¥ê¥¢¤¹¤ë¡£ +.IP 2. +.\"O If the effective user ID is changed from 0 to nonzero, +.\"O then all capabilities are cleared from the effective set. +¼Â¸ú UID ¤¬ 0 ¤«¤é 0 °Ê³°¤ËÊѹ¹¤µ¤ì¤¿¾ì¹ç¡¢ +¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÁ´¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥¯¥ê¥¢¤¹¤ë¡£ +.IP 3. +.\"O If the effective user ID is changed from nonzero to 0, +.\"O then the permitted set is copied to the effective set. +¼Â¸ú UID ¤¬ 0 °Ê³°¤«¤é 0 ¤ËÊѹ¹¤µ¤ì¤¿¾ì¹ç¡¢ +µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÆâÍƤò¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +.IP 4. +.\"O If the file system user ID is changed from 0 to nonzero (see +.\"O .BR setfsuid (2)) +.\"O then the following capabilities are cleared from the effective set: +.\"O .BR CAP_CHOWN , +.\"O .BR CAP_DAC_OVERRIDE , +.\"O .BR CAP_DAC_READ_SEARCH , +.\"O .BR CAP_FOWNER , +.\"O .BR CAP_FSETID , +.\"O .B CAP_LINUX_IMMUTABLE +.\"O (since Linux 2.2.30), +.\"O .BR CAP_MAC_OVERRIDE , +.\"O and +.\"O .B CAP_MKNOD +.\"O (since Linux 2.2.30). +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤¬ 0 ¤«¤é 0 °Ê³°¤ËÊѹ¹¤µ¤ì¤¿¾ì¹ç +.RB ( setfsuid (2) +»²¾È)¡¢¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Î°Ê²¼¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥¯¥ê¥¢¤µ¤ì¤ë: +.BR CAP_CHOWN , +.BR CAP_DAC_OVERRIDE , +.BR CAP_DAC_READ_SEARCH , +.BR CAP_FOWNER , +.BR CAP_FSETID , +.B CAP_LINUX_IMMUTABLE +(Linux 2.2.30 °Ê¹ß), +.BR CAP_MAC_OVERRIDE , +.B CAP_MKNOD +(Linux 2.2.30 °Ê¹ß)¡£ +.\"O If the file system UID is changed from nonzero to 0, +.\"O then any of these capabilities that are enabled in the permitted set +.\"O are enabled in the effective set. +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤¬ 0 °Ê³°¤«¤é 0 ¤ËÊѹ¹¤µ¤ì¤¿¾ì¹ç¡¢ +¾åµ­¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¤¦¤Áµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÇÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤â¤Î¤¬ +¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÇÍ­¸ú¤Ë¤µ¤ì¤ë¡£ +.PP +.\"O If a thread that has a 0 value for one or more of its user IDs wants +.\"O to prevent its permitted capability set being cleared when it resets +.\"O all of its user IDs to nonzero values, it can do so using the +.\"O .BR prctl (2) +.\"O .B PR_SET_KEEPCAPS +.\"O operation. +³Æ¼ï UID ¤Î¤¦¤Á¾¯¤Ê¤¯¤È¤â°ì¤Ä¤¬ 0 ¤Ç¤¢¤ë¥¹¥ì¥Ã¥É¤¬¡¢ +¤½¤Î UID ¤ÎÁ´¤Æ¤¬ 0 °Ê³°¤Ë¤Ê¤Ã¤¿¤È¤­¤Ëµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤¬ +¥¯¥ê¥¢¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +.BR prctl (2) +¤Î +.B PR_SET_KEEPCAPS +Áàºî¤ò»È¤¨¤Ð¤è¤¤¡£ +.\" +.\"O .SS Programmatically adjusting capability sets +.SS ¥×¥í¥°¥é¥à¤Ç¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤òÄ´À°¤¹¤ë +.\"O A thread can retrieve and change its capability sets using the +.\"O .BR capget (2) +.\"O and +.\"O .BR capset (2) +.\"O system calls. +.\"O However, the use of +.\"O .BR cap_get_proc (3) +.\"O and +.\"O .BR cap_set_proc (3), +.\"O both provided in the +.\"O .I libcap +.\"O package, +.\"O is preferred for this purpose. +³Æ¥¹¥ì¥Ã¥É¤Ï¡¢ +.BR capget (2) +¤ä +.BR capset (2) +¤ò»È¤Ã¤Æ¡¢¼«¿È¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ò¼èÆÀ¤·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë¡£ +¤¿¤À¤·¡¢¤³¤ì¤ò¹Ô¤¦¤Ë¤Ï¡¢ +.I libcap +¥Ñ¥Ã¥±¡¼¥¸¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë +.BR cap_get_proc (3) +¤ä +.BR cap_set_proc (3) +¤ò»È¤¦¤Î¤¬Ë¾¤Þ¤·¤¤¡£ +.\"O The following rules govern changes to the thread capability sets: +¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÊѹ¹¤Ë¤Ï°Ê²¼¤Î¥ë¡¼¥ë¤¬Å¬ÍѤµ¤ì¤ë¡£ +.IP 1. 3 +.\"O If the caller does not have the +.\"O .B CAP_SETPCAP +.\"O capability, +.\"O the new inheritable set must be a subset of the combination +.\"O of the existing inheritable and permitted sets. +.\"O [XXX] motoki: combination ¤Ã¤Æ AND ? OR ? +¸Æ¤Ó½Ð¤·Â¦¤¬ +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¿·¤·¤¤·Ñ¾µ²Äǽ¥»¥Ã¥È¤Ï¡¢ +´û¸¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤Èµö²Ä¥»¥Ã¥È¤ÎÀѽ¸¹ç (AND) ¤ÎÉôʬ½¸¹ç¤Ç +¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP 2. +.\"O (Since kernel 2.6.25) +.\"O The new inheritable set must be a subset of the combination of the +.\"O existing inheritable set and the capability bounding set. +.\"O [XXX] motoki: combination ¤Ã¤Æ AND ? OR ? +(¥«¡¼¥Í¥ë 2.6.25 °Ê¹ß) +¿·¤·¤¤·Ñ¾µ²Äǽ¥»¥Ã¥È¤Ï¡¢´û¸¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤È¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦ +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤ÎÀѽ¸¹ç (AND) ¤ÎÉôʬ½¸¹ç¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP 3. +.\"O The new permitted set must be a subset of the existing permitted set +.\"O (i.e., it is not possible to acquire permitted capabilities +.\"O that the thread does not currently have). +¿·¤·¤¤µö²Ä¥»¥Ã¥È¤Ï¡¢´û¸¤Îµö²Ä¥»¥Ã¥È¤ÎÉôʬ½¸¹ç¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(¤Ä¤Þ¤ê¡¢¤½¤Î¥¹¥ì¥Ã¥É¤¬¸½ºß»ý¤Ã¤Æ¤¤¤Ê¤¤µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò +³ÍÆÀ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤)¡£ +.IP 4. +.\"O The new effective set must be a subset of the new permitted set. +¿·¤·¤¤¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ï¿·¤·¤¤µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Î +Éôʬ½¸¹ç¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SS The """securebits"" flags: establishing a capabilities-only environment +.SS securebits ¥Õ¥é¥°: ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤À¤±¤Î´Ä¶­¤ò¹½ÃÛ¤¹¤ë +.\" For some background: +.\" see http://lwn.net/Articles/280279/ and +.\" http://article.gmane.org/gmane.linux.kernel.lsm/5476/ +.\"O Starting with kernel 2.6.26, +.\"O and with a kernel in which file capabilities are enabled, +.\"O Linux implements a set of per-thread +.\"O .I securebits +.\"O flags that can be used to disable special handling of capabilities for UID 0 +.\"O .RI ( root ). +¥«¡¼¥Í¥ë 2.6.26 °Ê¹ß¤Ç¡¢ +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Í­¸ú¤Ë¤Ê¤Ã¤¿¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¥¹¥ì¥Ã¥Éñ°Ì¤Î +.I securebits +¥Õ¥é¥°¤¬¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤È UID 0 +.RI ( root ) +¤ËÂФ¹¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÎÆÃÊÌ°·¤¤¤ò̵¸ú¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O These flags are as follows: +°Ê²¼¤Î¤è¤¦¤Ê¥Õ¥é¥°¤¬¤¢¤ë¡£ +.TP +.B SECBIT_KEEP_CAPS +.\"O Setting this flag allows a thread that has one or more 0 UIDs to retain +.\"O its capabilities when it switches all of its UIDs to a nonzero value. +.\"O If this flag is not set, +.\"O then such a UID switch causes the thread to lose all capabilities. +.\"O This flag is always cleared on an +.\"O .BR execve (2). +.\"O (This flag provides the same functionality as the older +.\"O .BR prctl (2) +.\"O .B PR_SET_KEEPCAPS +.\"O operation.) +¤³¤Î¥Õ¥é¥°¤ò¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢UID ¤¬ 0 ¤Î¥¹¥ì¥Ã¥É¤Î UID ¤¬ 0 °Ê³°¤ÎÃÍ¤Ë +ÀÚ¤êÂؤï¤ëºÝ¤Ë¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ï¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò°Ý»ý¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢UID ¤¬ 0 ¤«¤é 0 °Ê³°¤ÎÃÍ¤Ë +ÀÚ¤êÂؤï¤ë¤È¡¢¤½¤Î¥¹¥ì¥Ã¥É¤ÏÁ´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¼º¤¦¡£ +¤³¤Î¥Õ¥é¥°¤Ï +.BR execve (2) +»þ¤Ë¤ÏÁ´¤Æ¥¯¥ê¥¢¤µ¤ì¤ë +(¤³¤Î¥Õ¥é¥°¤Ï¡¢°ÊÁ°¤Î +.BR prctl (2) +¤Î +.B PR_SET_KEEPCAPS +Áàºî¤ÈƱ¤¸µ¡Ç½¤òÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë)¡£ +.TP +.B SECBIT_NO_SETUID_FIXUP +.\"O Setting this flag stops the kernel from adjusting capability sets when +.\"O the threads's effective and file system UIDs are switched between +.\"O zero and nonzero values. +.\"O (See the subsection +.\"O .IR "Effect of User ID Changes on Capabilities" .) +¤³¤Î¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢¥¹¥ì¥Ã¥É¤Î¼Â¸ú UID ¤È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤¬ +0 ¤È 0 °Ê³°¤Î´Ö¤ÇÀÚ¤êÂؤï¤Ã¤¿¾ì¹ç¤Ë¡¢ +¥«¡¼¥Í¥ë¤Ï¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÄ´À°¤ò¹Ô¤ï¤Ê¤¯¤Ê¤ë +(¡Ö¥æ¡¼¥¶ ID Êѹ¹¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ø¤Î±Æ¶Á¡×¤ÎÀá¤ò»²¾È)¡£ +.TP +.B SECBIT_NOROOT +.\"O If this bit is set, then the kernel does not grant capabilities +.\"O when a set-user-ID-root program is executed, or when a process with +.\"O an effective or real UID of 0 calls +.\"O .BR execve (2). +.\"O (See the subsection +.\"O .IR "Capabilities and execution of programs by root" .) +¤³¤Î¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +set-user-ID-root ¥×¥í¥°¥é¥à¤Î¼Â¹Ô»þ¤ä¡¢ +¼Â¸ú UID ¤« ¼Â UID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤¬ +.BR execve (2) +¤ò¸Æ¤Ó½Ð¤·¤¿»þ¤Ë¡¢¥«¡¼¥Í¥ë¤Ï¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òµö²Ä¤·¤Ê¤¤ +(¡Ö¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤È¡¢¥ë¡¼¥È¤Ë¤è¤ë¥×¥í¥°¥é¥à¤Î¼Â¹Ô¡×¤ÎÀá¤ò»²¾È)¡£ +.PP +.\"O Each of the above "base" flags has a companion "locked" flag. +.\"O Setting any of the "locked" flags is irreversible, +.\"O and has the effect of preventing further changes to the +.\"O corresponding "base" flag. +.\"O The locked flags are: +.\"O .BR SECBIT_KEEP_CAPS_LOCKED , +.\"O .BR SECBIT_NO_SETUID_FIXUP_LOCKED , +.\"O and +.\"O .BR SECBIT_NOROOT_LOCKED . +¾åµ­¤Î "base" ¥Õ¥é¥°¤Î³Æ¡¹¤Ë¤ÏÂбþ¤¹¤ë "locked" ¥Õ¥é¥°¤¬Â¸ºß¤¹¤ë¡£ +¤¤¤º¤ì¤Î "locked" ¥Õ¥é¥°¤â°ìÅÙ¥»¥Ã¥È¤µ¤ì¤ë¤ÈÌ᤹¤³¤È¤Ï¤Ç¤­¤º¡¢ +¤½¤ì°Ê¹ß¤ÏÂбþ¤¹¤ë "base" ¥Õ¥é¥°¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +"locked" ¥Õ¥é¥°¤Ï +.BR SECBIT_KEEP_CAPS_LOCKED , +.BR SECBIT_NO_SETUID_FIXUP_LOCKED , +.BR SECBIT_NOROOT_LOCKED +¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤ë¡£ +.PP +.\"O The +.\"O .I securebits +.\"O flags can be modified and retrieved using the +.\"O .BR prctl (2) +.\"O .B PR_SET_SECUREBITS +.\"O and +.\"O .B PR_GET_SECUREBITS +.\"O operations. +.\"O The +.\"O .B CAP_SETPCAP +.\"O capability is required to modify the flags. +.I securebits +¥Õ¥é¥°¤Ï¡¢ +.BR prctl (2) +¤ÎÁàºî +.B PR_SET_SECUREBITS +¤ä +.B PR_GET_SECUREBITS +¤ò»È¤¦¤³¤È¤ÇÊѹ¹¤·¤¿¤ê¼èÆÀ¤·¤¿¤ê¤Ç¤­¤ë¡£ +¥Õ¥é¥°¤òÊѹ¹¤¹¤ë¤Ë¤Ï +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ + +.\"O The +.\"O .I securebits +.\"O flags are inherited by child processes. +.\"O During an +.\"O .BR execve (2), +.\"O all of the flags are preserved, except +.\"O .B SECURE_KEEP_CAPS +.\"O which is always cleared. +.I securebits +¥Õ¥é¥°¤Ï»Ò¥×¥í¥»¥¹¤Ë·Ñ¾µ¤µ¤ì¤ë¡£ +.BR execve (2) +¤Ë¤ª¤¤¤Æ¤Ï¡¢ +.B SECURE_KEEP_CAPS +¤¬¾ï¤Ë¥¯¥ê¥¢¤µ¤ì¤ë°Ê³°¤Ï¡¢Á´¤Æ¤Î¥Õ¥é¥°¤¬ÊÝ»ý¤µ¤ì¤ë¡£ + +.\"O An application can use the following call to lock itself, +.\"O and all of its descendants, +.\"O into an environment where the only way of gaining capabilities +.\"O is by executing a program with associated file capabilities: +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢°Ê²¼¤Î¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦¤³¤È¤Ë¤è¤ê¡¢ +¼«Ê¬¼«¿È¤ª¤è¤Ó»Ò¹¤È¤Ê¤ë¥×¥í¥»¥¹Á´¤Æ¤ËÂФ·¤Æ¡¢ +ɬÍפʥե¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤¿¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Ê¤¤¸Â¤ê¡¢ +Âбþ¤¹¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò³ÍÆÀ¤Ç¤­¤Ê¤¤¤è¤¦¤Ê¾õ¶·¤ËÊĤ¸¤³¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.in +4n +.nf + +prctl(PR_SET_SECUREBITS, + SECBIT_KEEP_CAPS_LOCKED | + SECBIT_NO_SETUID_FIXUP | + SECBIT_NO_SETUID_FIXUP_LOCKED | + SECBIT_NOROOT | + SECBIT_NOROOT_LOCKED); +.fi +.in +.\"O .SH "CONFORMING TO" +.SH ½àµò +.PP +.\"O No standards govern capabilities, but the Linux capability implementation +.\"O is based on the withdrawn POSIX.1e draft standard; see +.\"O .IR http://wt.xpilot.org/publications/posix.1e/ . +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ë´Ø¤¹¤ëɸ½à¤Ï¤Ê¤¤¤¬¡¢ Linux ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÏÇѰƤˤʤä¿ +POSIX.1e Áð°Æ¤Ë´ð¤Å¤¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.I http://wt.xpilot.org/publications/posix.1e/ +¤ò»²¾È¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Since kernel 2.5.27, capabilities are an optional kernel component, +.\"O and can be enabled/disabled via the CONFIG_SECURITY_CAPABILITIES +.\"O kernel configuration option. +¥«¡¼¥Í¥ë 2.5.27 °Ê¹ß¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÏÁªÂò¼°¤Î¥«¡¼¥Í¥ë¥³¥ó¥Ý¡¼¥Í¥ó¥È +¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢¥«¡¼¥Í¥ëÀßÄꥪ¥×¥·¥ç¥ó CONFIG_SECURITY_CAPABILITIES +¤Ë¤è¤êÍ­¸ú/̵¸ú¤òÀÚ¤êÂؤ¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O The +.\"O .I /proc/PID/task/TID/status +.\"O file can be used to view the capability sets of a thread. +.\"O The +.\"O .I /proc/PID/status +.\"O file shows the capability sets of a process's main thread. +.I /proc/PID/task/TID/status +¥Õ¥¡¥¤¥ë¤ò»È¤¦¤È¡¢¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.I /proc/PID/status +¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¥×¥í¥»¥¹¤Î¥á¥¤¥ó¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤¬É½¼¨¤µ¤ì¤ë¡£ + +.\"O The +.\"O .I libcap +.\"O package provides a suite of routines for setting and +.\"O getting capabilities that is more comfortable and less likely +.\"O to change than the interface provided by +.\"O .BR capset (2) +.\"O and +.\"O .BR capget (2). +.I libcap +¥Ñ¥Ã¥±¡¼¥¸¤Ï¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÀßÄꡦ¼èÆÀ¤¹¤ë¤¿¤á¤Î +¥ë¡¼¥Á¥ó·²¤òÄ󶡤·¤Æ¤¤¤ë¡£¤³¤ì¤é¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¡¢ +.BR capset (2) +¤È +.BR capget (2) +¤¬Ä󶡤¹¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÈÈæ¤Ù¤Æ¡¢¤è¤ê»È¤¤¤ä¤¹¤¯¡¢Êѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¾¯¤Ê¤¤¡£ +.\"O This package also provides the +.\"O .BR setcap (8) +.\"O and +.\"O .BR getcap (8) +.\"O programs. +.\"O It can be found at +.\"O .br +.\"O .IR http://www.kernel.org/pub/linux/libs/security/linux-privs . +¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ç¤Ï¡¢ +.BR setcap (8), +.BR getcap (8) +¤È¤¤¤¦¥×¥í¥°¥é¥à¤âÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +¥Ñ¥Ã¥±¡¼¥¸¤Ï +.I http://www.kernel.org/pub/linux/libs/security/linux-privs +¤ÇÆþ¼ê¤Ç¤­¤ë¡£ + +.\"O Before kernel 2.6.24, and since kernel 2.6.24 if +.\"O file capabilities are not enabled, a thread with the +.\"O .B CAP_SETPCAP +.\"O capability can manipulate the capabilities of threads other than itself. +.\"O However, this is only theoretically possible, +.\"O since no thread ever has +.\"O .BR CAP_SETPCAP +.\"O in either of these cases: +¥Ð¡¼¥¸¥ç¥ó 2.6.24 ¤è¤êÁ°¡¢¤ª¤è¤Ó¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬ +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤2.6.24 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤¿¥¹¥ì¥Ã¥É¤Ï¼«Ê¬°Ê³°¤Î¥¹¥ì¥Ã¥É¤Î +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÁàºî¤Ç¤­¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¤³¤ì¤ÏÍýÏÀŪ¤Ë²Äǽ¤È¤¤¤¦¤À¤±¤Ç¤¢¤ë¡£ +°Ê²¼¤Î¤¤¤º¤ì¤«¤Î¾ì¹ç¤Ë¤ª¤¤¤Æ¤â¡¢¤É¤Î¥¹¥ì¥Ã¥É¤â +.BR CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¤³¤È¤Ï¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.IP * 2 +.\"O In the pre-2.6.25 implementation the system-wide capability bounding set, +.\"O .IR /proc/sys/kernel/cap-bound , +.\"O always masks out this capability, and this can not be changed +.\"O without modifying the kernel source and rebuilding. +2.6.25 ¤è¤êÁ°¤Î¼ÂÁõ¤Ç¤Ï¡¢¥·¥¹¥Æ¥à¶¦Ä̤Υ±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È +.I /proc/sys/kernel/cap-bound +¤Ç¤Ï¤³¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï¾ï¤Ë̵¸ú¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +¥½¡¼¥¹¤òÊѹ¹¤·¤Æ¥«¡¼¥Í¥ë¤òºÆ¥³¥ó¥Ñ¥¤¥ë¤·¤Ê¤¤¸Â¤ê¡¢ +¤³¤ì¤òÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.IP * +.\"O If file capabilities are disabled in the current implementation, then +.\"O .B init +.\"O starts out with this capability removed from its per-process bounding +.\"O set, and that bounding set is inherited by all other processes +.\"O created on the system. +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Ìµ¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¥×¥í¥»¥¹Ëè¤Î¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é¤³¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÈ´¤¤¤Æ +.B init +¤Ï³«»Ï¤µ¤ì¡¢ +¥·¥¹¥Æ¥à¾å¤ÇÀ¸À®¤µ¤ì¤ë¾¤ÎÁ´¤Æ¤Î¥×¥í¥»¥¹¤Ç¤³¤Î¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤¬ +·Ñ¾µ¤µ¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR capget (2), +.BR prctl (2), +.BR setfsuid (2), +.BR cap_clear (3), +.BR cap_copy_ext (3), +.BR cap_from_text (3), +.BR cap_get_file (3), +.BR cap_get_proc (3), +.BR cap_init (3), +.BR capgetp (3), +.BR capsetp (3), +.BR credentials (7), +.BR pthreads (7), +.BR getcap (8), +.BR setcap (8) +.PP +.\"O .I include/linux/capability.h +.\"O in the kernel source +¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.I include/linux/capability.h diff --git a/draft/man7/charsets.7 b/draft/man7/charsets.7 new file mode 100644 index 00000000..7e0cd237 --- /dev/null +++ b/draft/man7/charsets.7 @@ -0,0 +1,657 @@ +.\" Copyright (c) 1996 Eric S. Raymond +.\" and Andries Brouwer +.\" +.\" 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. +.\" +.\" This is combined from many sources, including notes by aeb and +.\" 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 +.\" +.\" 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 +.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 ¥É¥é¥¤¥Ð¤Ê¤É¤Î +¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ï¡¢Èó¥é¥Æ¥ó¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Ê¤É¤Î +¥Þ¥ë¥Á¥ê¥ó¥¬¥ëʸ»ú¥»¥Ã¥È (multilingual character sets) ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Ë¤Ï¥é¥Æ¥ó¥¢¥ë¥Õ¥¡¥Ù¥Ã¥Èʸ»ú¡¦¥®¥ê¥·¥ãʸ»ú¡¦ +¥­¥ê¥ëʸ»ú¡¦¥¢¥é¥Ó¥¢Ê¸»ú¡¦¥Ø¥Ö¥é¥¤Ê¸»ú¤Ê¤É¤¬´Þ¤Þ¤ì¡¢ +ȯ²»¶èÊÌÉä¹æ (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, +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 ¤ËÀÚ¤êÂؤï¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤) +.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 ɸ½à¤ÎÃæ¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +.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 ¤È¤·¤ÆÃΤé¤ì¤ë¡£ +¤³¤ì¤Ï 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. +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) ¤Ç¤¢¤ë¡£¤³¤ì +¤Ï 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. +¥³¥ó¥½¡¼¥ë¤Ë¤ª¤±¤ë¡¢¤½¤Î¾¤Î 8859 ʸ»ú½¸¹ç¤Î¥µ¥Ý¡¼¥È¤Ï +.RB ( setfont (8)) +¤Î¤è¤¦¤Ê¥æ¡¼¥¶¥â¡¼¥É¡¦¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤òÍøÍѤ¹¤ë»ö¤Ç²Äǽ¤Ë¤Ê¤ë¡£ +¤³¤Î¤è¤¦¤Ê¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤òÍøÍѤ¹¤ë¤³¤È¤Ë¤è¤ê¡¢¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð¤Ë¤ª¤± +¤ë¥­¡¼¥Ü¡¼¥É¤È 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)¡¢¥Ç¥ó¥Þ¡¼¥¯¸ì +(Danish)¡¢¥ª¥é¥ó¥À¸ì(Dutch)¡¢±Ñ¸ì(English)¡¢¥Õ¥§¥í¡¼¸ì(Faroese)¡¢ +¥Õ¥£¥ó¥é¥ó¥É¸ì(Finnish)¡¢¥Õ¥é¥ó¥¹¸ì(French)¡¢¥É¥¤¥Ä¸ì(German)¡¢ +¥¬¥ê¥·¥¢¸ì(Galician)¡¢¥¢¥¤¥ë¥é¥ó¥É¸ì(Irish)¡¢¥¢¥¤¥¹¥é¥ó¥É¸ì(Icelandic)¡¢ +¥¤¥¿¥ê¥¢¸ì(Italian)¡¢¥Î¥ë¥¦¥§¡¼¸ì(Norwegian)¡¢¥Ý¥ë¥È¥¬¥ë¸ì(Portuguese)¡¢ +¥¹¥Ú¥¤¥ó¸ì(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)¡¢¥Á¥§¥³ +¸ì(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)¡¢¥Þ¥ë¥¿¸ì +(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 ¤Ï¡¢ +ËܼÁŪ¤Ë¤ÏÇѻߤµ¤ì¤Æ¤¤¤ë(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 +¥Ö¥ë¥¬¥ê¥¢¸ì(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) +¤Ïʸ»ú¤Î·ÁÂÖ¤òʬ³ä¤·¤¿¸ÇÄêÉý¥Õ¥©¥ó¥È¤Ç¤¢¤ë¡£ +¤½¤Î¤¿¤á¡¢Å¬Àڤʥǥ£¥¹¥×¥ì¥¤¥¨¥ó¥¸¥ó¤¬Àµ¤·¤¤ +initial, medial, final ¥Õ¥©¡¼¥à¤Ë·ë¹ç¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.\"O 8859-7 +.\"O Supports Modern Greek. +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 +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)ʸ»ú¤Ë +ÃÖ¤­´¹¤¨¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.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 ¤Ë¤Ï´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤ +¥¤¥Ì¥¤¥Ã¥È¸ì(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 +¤³¤ì¤ÏµñÀ䤵¤ì¤¿Áð°Æɸ½à¤Î¤¿¤á¤À¤±¤Ë¸ºß¤¹¤ë¡£ +¤³¤ÎÁð°Æɸ½à¤Ï 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 +¤³¤Îʸ»ú¥»¥Ã¥È¤Ï¸ºß¤·¤Ê¤¤¡£ +¥Ù¥È¥Ê¥à¸ì¤¬¤³¤Î¾ì½ê¤ò»È¤¦¤è¤¦¤ËÄó°Æ¤·¤¿¤¬¡¢ +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) +¥Ð¥ë¥È³¤½ô¹ñ¤Î¸À¸ì¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +Æäˡ¢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)¤Ë +Âбþ¤¹¤ë¡£ +¤³¤Îʸ»ú¥»¥Ã¥È¤Ï¸ÅÂ奢¥¤¥ë¥é¥ó¥É¸ì¤ÇÍѤ¤¤é¤ì¤ëÉÕÅÀÉÕ¤­Ê¸»ú¤â´Þ¤à¡£ +.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-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 ¤ÇÂбþ¤¹¤ë¿¤¯¤Î¸À¸ì¤ËÂбþ¤·¡¢ +¤µ¤é¤Ë¥ë¡¼¥Þ¥Ë¥¢¸ì¤Ë¤Ï¤è¤ê´°Á´¤ËÂбþ¤¹¤ë¡£ +.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 ¤è¤ê´öʬÎɤ¯ +¥Ç¥¶¥¤¥ó¤µ¤ì¤¿¥­¥ê¥ëʸ»ú½¸¹ç¤Ç¤¢¤ë¡£ +KOI8-U ¤Ï KOI8-R ¤ò¸µ¤Ë¤·¤¿¶¦ÄÌʸ»ú¥»¥Ã¥È¤Ç¤¢¤ê¡¢ +¥¦¥¯¥é¥¤¥Ê¸ì(Ukrainian) ¤Ë¤è¤ê¤è¤¯Âбþ¤¹¤ë¡£ +¤³¤ì¤é¤Î¤É¤Á¤é¤â 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 ¤Î¥³¥ó¥½¡¼¥ë¥µ¥Ý¡¼¥È¤Ï¡¢ +¥æ¡¼¥¶¥â¡¼¥É¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ç¼Â¸½¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¥­¡¼¥Ü¡¼¥É¤Î³ä¤êÅö¤Æ¤È 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. +JIS X 0208 ¤ÏÆüËܸì¤Î¹ñÄêɸ½àʸ»ú¥»¥Ã¥È¤Ç¤¢¤ë¡£ +¾¤Ë¤â¤¤¤¯¤Ä¤«ÆüËܸì¤Î¹ñÄêɸ½àʸ»ú¥»¥Ã¥È¤Ï¤¢¤ë +(JIS X 0201, JIS X 0212, JIS X 0213 ¤Ê¤É)¤¬¡¢¤³¤ì¤¬ºÇ¤â½ÅÍפǤ¢¤ë¡£ +ʸ»ú¤Ï 94x94 ¤Î 2 ¥Ð¥¤¥È¥Þ¥È¥ê¥Ã¥¯¥¹¤ËÇÛÃÖ¤µ¤ì¤ë¡£ +³Æ¥Ð¥¤¥È¤Ï 0x21-0x7e ¤ÎÃͤò»ý¤Ä¡£ +JIS X 0208 ¤Ïʸ»ú¥»¥Ã¥È¤Ç¤¢¤ê¡¢¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ç¤Ï¤Ê¤¤¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤³¤ì¤Ï¡¢ +JIS X 0208 ¼«¿È¤Ï¥Æ¥­¥¹¥È¥Ç¡¼¥¿¤Îɽ¸½¤Ë¤Ï»È¤ï¤ì¤Ê¤¤¡¢¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +JIS X 0208 ¤Ï¡¢ +EUC-JP, Shift_JIS, ISO-2022-JP ¤È¤¤¤Ã¤¿¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ò +¹½À®¤¹¤ëÉôÉʤȤ·¤ÆÍѤ¤¤é¤ì¤ë¡£ +EUC-JP ¤¬ Linux ¤Ë¤ª¤¤¤ÆºÇ¤â½ÅÍפʥ¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ç¤¢¤ê¡¢ +US ASCII ¤È JIS X 0208 ¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +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. +KS X 1001 ¤Ï´Ú¹ñ¤Î¹ñÄêɸ½àʸ»ú¥»¥Ã¥È¤Ç¤¢¤ë¡£ +JIS X 0208 ¤ÈƱÍͤˡ¢Ê¸»ú¤Ï 94x94 ¤Î 2 ¥Ð¥¤¥È¥Þ¥È¥ê¥Ã¥¯¥¹¤ËÇÛÃÖ¤µ¤ì¤ë¡£ +KS X 1001 ¤Ï JIS X 0208 ¤ÈƱÍͤˡ¢ +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. +GB 2312 ¤Ï¡¢´ÊÂÎʸ»ú¤òɽ¸½¤¹¤ë¤¿¤á¤ÎÃæ¹ñ¤Î¹ñÄêɸ½àʸ»ú¥»¥Ã¥È¤Ç¤¢¤ë¡£ +JIS X 0208 ¤ÈƱÍͤˡ¢Ê¸»ú¤Ï 94x94 ¤Î 2 ¥Ð¥¤¥È¥Þ¥È¥ê¥Ã¥¯¥¹¤ËÇÛÃÖ¤µ¤ì¡¢ +EUC-CN ¤ËÍѤ¤¤é¤ì¤ë¡£ +EUC-CN ¤Ï Linux ¤Ë¤ª¤¤¤ÆºÇ¤â½ÅÍפʥ¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ç¤¢¤ê¡¢ +US ASCII ¤È GB 2312 ¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +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 ʸ»úÌܤȤ·¤ÆÍѤ¤¤ë¡£ +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. +TIS 620 ¤Ï¥¿¥¤¤Î¹ñÄêɸ½àʸ»ú¥»¥Ã¥È¤Ç¡¢US ASCII ¤Î¾å°Ì½¸¹ç¤Ç¤¢¤ë¡£ +ISO 8859 ¥·¥ê¡¼¥º¤ÈƱÍͤˡ¢¥¿¥¤Ê¸»ú¤Ï 0xa1-0xfe ¤ËÇÛÃÖ¤µ¤ì¤ë¡£ +TIS 620 ¤Ï Linux ¤Ç¤Î¤ß°ìÈÌŪ¤ËÍѤ¤¤é¤ì¤Æ¤¤¤ëʸ»ú¥»¥Ã¥È¤Ç¤¢¤ê¡¢ +¤Þ¤¿¡¢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)(¤¢¤ë¼ï¤ÎÄÁ¤·¤¤Ê¸»ú¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë¾ì¹ç¤Ë¤À¤± +2 ¤Ä¤Î 16 ¥Ó¥Ã¥ÈÀ°¿ô¤¬É¬ÍפȤʤë)¤«¡¢ +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 ¥Ó¥Ã¥È¤ò +Éä¹æ²½¤¹¤ë¤Î¤Ë 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 ¤ò¥¼¥í¡¢£±¡¢Ç¤°Õ¤Î¥Ó¥Ã¥È¤È¤¹¤ë¤È¡¢¤¢¤ë¥Ð¥¤¥È 0xxxxxxx ¤Ï Unicode ¤Ç¤Ï +00000000 0xxxxxxx ¤È¤¢¤é¤ï¤µ¤ì¤ë¡£¤³¤ì¤Ï¡¢ASCII ¤Î 0xxxxxxx ¤ÈƱ¤¸ +¥·¥ó¥Ü¥ë¤Î¥³¡¼¥É¤Ç¤¢¤ë¡£¤³¤Î¤è¤¦¤Ë¡¢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 ¥Ó¥Ã¥È +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 ʸ»ú¥»¥Ã¥È¤ò»È¤¦¤Û¤È¤ó¤É¤Î¥æ¡¼¥¶¤Ë¤È¤Ã¤Æ¡¢ +¤³¤Î»ö¼Â¤Ï¡¢ASCII ¤ÎÈϰϳ°¤ò»È¤Ã¤¿Ê¸»ú¤Ï +Æó¤Ä¤Î¥Ð¥¤¥È¤ËÉä¹æ²½¤µ¤ì¤ë¤È¤¤¤¦¤³¤È¤ò°ÕÌ£¤¹¤ë¡£¤³¤Î¤³¤È¤«¤é +(UTF-8 ¤ò»È¤¦¤È¡¢ISO-8859-1¤ò»ÈÍѤ·¤Æ¤¤¤ë)¸µ¡¹¤Î¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤«¤é +1 ¡Á 2 ¥Ñ¡¼¥»¥ó¥ÈÂ礭¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤³¤È¤Ë¤Ê¤ë¡£ +¥í¥·¥¢¸ì¤ä¥®¥ê¥·¥ã¸ì¤òÍøÍѤ¹¤ë¥æ¡¼¥¶¡¼¤Ë¤È¤Ã¤Æ¤Ï¡¢ +¤³¤ì¤Ë¤è¤Ã¤Æ¸µ¤Î¥Æ¥­¥¹¥È¤Ï 2 ÇܤÎÂ礭¤µ¤Ë¤Ê¤ë¤³¤È¤Ë¤Ê¤ë¡£ +¤Ê¤¼¤Ê¤é¤³¤ì¤é¤Î¸À¸ì¤Ï¤Û¤È¤ó¤É¤¬ ASCII ¤ÎÈϰϳ°¤À¤«¤é¤Ç¤¢¤ë¡£ +¸½ºß 16-bit ¥³¡¼¥É¤ò¹­¤¯ÍøÍѤ·¤Æ¤¤¤ëÆüËܸì¤òÍøÍѤ¹¤ë¥æ¡¼¥¶¤Ë¤Ï +3 ¥Ð¥¤¥ÈɬÍפȤʤ롣 +Unicode ¤Ø¤ÎÊÑ´¹¤Ë¥¢¥ë¥´¥ê¥º¥àŪÊÑ´¹¤ò¤¹¤ì¤Ð¤è¤¤Ê¸»ú¥»¥Ã¥È¤¬¤¢¤ë +(ÆÃ¤Ë 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 ¤Î¥Ð¥¤¥È¤Ï¡¢¾ï¤Ë¤½¤Îʸ»ú¼«¿È¤ò +ɽ¸½¤¹¤ë¤³¤È¤ËÃíÌܤ·¤Æ¤Û¤·¤¤¡£Æäˡ¢´ö¤Ä¤«¤ÎÂ礭¤Ê¥³¡¼¥É¤Î¥Ñ¡¼¥È¤ò·ÁÀ® +¤¹¤ë¤¿¤á¤Ë¡¢NUL (\(aq\\0\(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 ¤ò +»ÈÍѤ·¤Æ¤¤¤ë¤³¤È¤òÆä˰ռ±¤·¤Ê¤¯¤Æ¤âÎɤ¤¡£ +¥«¡¼¥Í¥ë¤Ï¥Ð¥¤¥È¤¬²¿¤ò¤¢¤é¤ï¤·¤Æ¤¤¤ë¤«¤ËÃí°Õ¤¹¤ëɬÍפ¬¤Ê¤¤¡£ +.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 ¤Î°Û¤Ê¤Ã¤¿¥·¥ó¥Ü¥ë¤ò +»ý¤Ã¤¿Ê¸»ú½¸¹ç¤òÍøÍѲÄǽ¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¤³¤ì¤Ï¡¢ÆüËܸ졢Ãæ¹ñ¸ì¡¢´Ú¹ñ¸ì¤Ç¤Ï½½Ê¬¤Ç¤Ï¤Ê¤¤¡¢¤·¤«¤·¡¢¤½¤Î¾¤ÎÍøÍÑ¤Ç¤Ï +½½Ê¬¤Ç¤¢¤ë¡£ +.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. +ISO 2022 ¤È ISO 4873 ɸ½à¤Ç¤Ï¡¢ +VT100 ¤ÎÆ°ºî¤Ë´ð¤Å¤¤¤¿¥Õ¥©¥ó¥È¥³¥ó¥È¥í¡¼¥ë¥â¥Ç¥ë¤ò½Ò¤Ù¤é¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥â¥Ç¥ë¤Ï Linux ¥«¡¼¥Í¥ë¤ä +.BR xterm (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 ¤Î¥³¡¼¥É¤ò»ÈÍѤ¹¤ë¡£ +.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) ¤ò»È¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +¥Õ¥¡¥ó¥¯¥·¥ç¥ó LS\fIn\fP ¤ÏºÇ¾å°Ì¥Ó¥Ã¥È¤¬ 0 ¤Ç¤¢¤ë¥³¡¼¥É¤Î¤¿¤á¤Îʸ»ú½¸¹ç¤ò +G\fIn\fP ¤ËÀßÄꤹ¤ë¡£ +¥Õ¥¡¥ó¥¯¥·¥ç¥ó LS\fIn\fPR ¤ÏºÇ¾å°Ì¥Ó¥Ã¥È¤¬ 1 ¤Ç¤¢¤ë¥³¡¼¥É¤Î¤¿¤á¤Îʸ»ú¥»¥Ã¥È¤ò +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 ʸ»ú½¸¹ç +¤òÍѤ¤¤ë¤è¤¦¤Ë»Ø¼¨¤µ¤ì¤ë¡£ +xx ¤Ï "ISO 2375 International Register of Coded Character Sets" ¤Ç +·è¤á¤é¤ì¤Æ¤¤¤ë°ìʸ»ú¡¢¤Þ¤¿¤ÏÆóʸ»ú¤Ç¤¢¤ë¡£ +¤¿¤È¤¨¤Ð ESC ( @ ¤Ï ISO 646 ʸ»ú½¸¹ç¤ò G0 ¤È¤·¤ÆÁª¤Ó¡¢ESC ( A +¤Ï(¥Ê¥ó¥Ð¡¼¥µ¥¤¥ó(¡ô)¤ÎÂå¤ï¤ê¤Ë¡¢¥Ý¥ó¥É(¡ò)¤ò»ý¤Ä) UK ¥¹¥¿¥ó¥À¡¼¥Éʸ»ú½¸¹ç¤ò +ÁªÂò¤¹¤ë¡£ESC ( B ¤Ï(Ä̲ߵ­¹æ¤Î¤«¤ï¤ê¤Ë¥À¥é¡¼(¡ð)¤ò»ý¤Ä) ASCII¤òÁªÂò¤¹¤ë¡£ +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 +\- xx (G1 ÍÑ), ESC . xx (G2 ÍÑ), ECS / xx (G3 ÍÑ)¤òÍѤ¤¤ë¤³¤È¤Ç¡¢ +G\fIn\fP ʸ»ú½¸¹ç¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë»Ø¼¨¤µ¤ì¤ë¡£ +Î㤨¤Ð¡¢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 ʸ»ú½¸¹ç¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë»Ø¼¨¤µ¤ì¤ë¡£ +Î㤨¤Ð¡¢ESC $ ( C ¤Ï ´Ú¹ñ¸ì(Korean)ʸ»ú½¸¹ç¤ò G0 ¤È¤·¤ÆÁªÂò¤¹¤ë¡£ +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 ¤ÏºÇ¾å°Ì¥Ó¥Ã¥È¤¬ +¥»¥Ã¥È¤µ¤ì¤¿¥³¡¼¥É¤È¤·¤Æ¤Î¤ß¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +Æäˡ¢\fB^N\fP ¤È \fB^O\fP ¤ÏÍѤ¤¤é¤ì¤º¡¢ESC ( xx ¤Ï xx=B ¤È¤·¤Æ¤Î¤ß +ÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¡¢ +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) diff --git a/draft/man7/complex.7 b/draft/man7/complex.7 new file mode 100644 index 00000000..380c8770 --- /dev/null +++ b/draft/man7/complex.7 @@ -0,0 +1,88 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-08-02, Akihiro MOTOKI +.\" Updated 2005-02-20, Akihiro MOTOKI +.\" +.\"WORD: operations ±é»» +.\"WORD: imaginary unit µõ¿ôñ°Ì +.\" +.TH COMPLEX 7 2009-07-25 "" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O complex \- basics of complex mathematics +complex \- Ê£ÁÇ¿ô¤Î¿ô³Ø¤Î´ðÁà +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Complex numbers are numbers of the form z = a+b*i, where a and b are +.\"O real numbers and i = sqrt(\-1), so that i*i = \-1. +Ê£ÁÇ¿ô¤Ï z = a+b*i ¤Î·Á¼°¤Î¿ô¤Ç¤¢¤ë¡£ a ¤È b ¤Ï¼Â¿ô¤Ç¤¢¤ê¡¢ +i ¤Ï i = sqrt(\-1) ¤Ä¤Þ¤ê i*i = \-1 ¤Î´Ø·¸¤òËþ¤¿¤¹¡£ +.br +.\"O There are other ways to represent that number. +.\"O The pair (a,b) of real +.\"O numbers may be viewed as a point in the plane, given by X- and +.\"O Y-coordinates. +.\"O This same point may also be described by giving +.\"O the pair of real numbers (r,phi), where r is the distance to the origin O, +.\"O and phi the angle between the X-axis and the line Oz. +.\"O Now +.\"O z = r*exp(i*phi) = r*(cos(phi)+i*sin(phi)). +Ê£ÁÇ¿ô¤òɽ¸½¤¹¤ëÊ̤ÎÊýË¡¤â¤¢¤ë¡£¼Â¿ô¤ÎÁÈ (a,b) ¤Ï XºÂɸ¡¢YºÂɸ¤Ç +»ØÄꤵ¤ì¤¿Ê¿Ì̾å¤ÎÅÀ¤È¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤³¤ÎƱ¤¸ÅÀ¤Ï¡¢¼Â¿ô¤ÎÁÈ +(r,phi) ¤Çɽ¤¹¤³¤È¤â¤Ç¤­¤ë¡£r ¤Ï¸¶ÅÀ 0 ¤«¤é¤Îµ÷Î¥¤Ç¤¢¤ê¡¢phi ¤Ï +X¼´¤È 0 ¤È z ¤ò·ë¤ÖÀþʬ¤¬¤Ê¤¹³Ñ¤Ç¤¢¤ë¡£¤³¤Î¤È¤­¡¢ +z = r*exp(i*phi) = r*(cos(phi)+i*sin(phi)) +¤Î´Ø·¸¤¬À®¤êΩ¤Ä¡£ +.PP +.\"O The basic operations are defined on z = a+b*i and w = c+d*i as: +2¤Ä¤ÎÊ£ÁÇ¿ô z = a+b*i, w = c+d*i ¤Ë´Ø¤¹¤ë´ðËܱ黻¤Ï¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.TP +.\"O .B addition: z+w = (a+c) + (b+d)*i +.B ²ÃË¡: z+w = (a+c) + (b+d)*i +.TP +.\"O .B multiplication: z*w = (a*c \- b*d) + (a*d + b*c)*i +.B ¾èË¡: z*w = (a*c \- b*d) + (a*d + b*c)*i +.TP +.\"O .B division: z/w = ((a*c + b*d)/(c*c + d*d)) + ((b*c \- a*d)/(c*c + d*d))*i +.B ½üË¡: z/w = ((a*c + b*d)/(c*c + d*d)) + ((b*c \- a*d)/(c*c + d*d))*i +.PP +.\"O Nearly all math function have a complex counterpart but there are +.\"O some complex-only functions. +¤Û¤È¤ó¤ÉÁ´¤Æ¤Î¿ô³Ø´Ø¿ô¤Ë´Ø¤·¤ÆÊ£ÁÇ¿ôÈǤ¬¤¢¤ë¤¬¡¢ +Ê£ÁÇ¿ôÀìÍѤδؿô¤â´ö¤Ä¤«¤¢¤ë¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O Your C-compiler can work with complex numbers if it supports the C99 standard. +.\"O Link with \fI\-lm\fP. +.\"O The imaginary unit is represented by I. +»ÈÍѤ¹¤ë C ¥³¥ó¥Ñ¥¤¥é¤¬ C99 ɸ½à¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ì¤ÐÊ£ÁÇ¿ô¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +\fI\-lm\fP ¤ò¤Ä¤±¤Æ¥ê¥ó¥¯¤¹¤ë¤³¤È¡£µõ¿ôñ°Ì¤Ï I ¤Çɽ¸½¤µ¤ì¤ë¡£ +.sp +.nf +.\"O /* check that exp(i * pi) == \-1 */ +/* exp(i * pi) == \-1 ¤È¤Ê¤ë¤³¤È¤ò³Îǧ¤¹¤ë */ +#include /* for atan */ +#include +#include + +int +main(void) +{ + double pi = 4 * atan(1.0); + double complex z = cexp(I * pi); + printf("%f + %f * i\\n", creal(z), cimag(z)); +} +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR carg (3), +.BR cexp (3), +.BR cimag (3), +.BR creal (3) diff --git a/draft/man7/credentials.7 b/draft/man7/credentials.7 new file mode 100644 index 00000000..3442bdf2 --- /dev/null +++ b/draft/man7/credentials.7 @@ -0,0 +1,484 @@ +.\" Copyright (c) 2007 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. +.\" +.\" 2007-06-13 Creation +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI all rights reserved. +.\" Translated 2007-10-25, Akihiro MOTOKI , LDP v2.66 +.\" Updated 2008-08-04, Akihiro MOTOKI, LDP v3.05 +.\" +.TH CREDENTIALS 7 2008-06-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O credentials \- process identifiers +credentials \- ǧ¾Ú¤ËÍѤ¤¤é¤ì¤ë¥×¥í¥»¥¹¤Î¼±ÊÌ»Ò +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .SS Process ID (PID) +.SS ¥×¥í¥»¥¹ID (PID) +.\"O Each process has a unique nonnegative integer identifier +.\"O that is assigned when the process is created using +.\"O .BR fork (2). +.\"O A process can obtain its PID using +.\"O .BR getpid (2). +.\"O A PID is represented using the type +.\"O .I pid_t +.\"O (defined in +.\"O .IR ). +³Æ¥×¥í¥»¥¹¤Ï¡¢Éé¤Ç¤Ê¤¤À°¿ô¤Î°ì°Õ¤Ê¼±Ê̻Ҥò»ý¤Ä¡£ +¤³¤Î¼±ÊÌ»Ò¤Ï +.BR fork (2) +¤ò»È¤Ã¤Æ¥×¥í¥»¥¹¤¬À¸À®¤µ¤ì¤ëºÝ¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +¥×¥í¥»¥¹¤Ï +.BR getpid (2) +¤ò»È¤Ã¤Æ¼«Ê¬¤Î PID ¤ò¼èÆÀ¤Ç¤­¤ë¡£ +PID ¤Ï +.I pid_t +·¿¤Çɽ¸½¤µ¤ì¤ë +.RI ( pid_t +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ + +.\"O PIDs are used in a range of system calls to identify the process +.\"O affected by the call, for example: +PID ¤Ï³Æ¼ï¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ºîÍѤ¹¤ë¥×¥í¥»¥¹¤ò +ÆÃÄꤹ¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£°Ê²¼¤ËÎã¤òµó¤²¤ë: +.BR kill (2), +.BR ptrace (2), +.BR setpriority (2), +.\" .BR sched_rr_get_interval (2), +.\" .BR sched_getaffinity (2), +.\" .BR sched_setaffinity (2), +.\" .BR sched_getparam (2), +.\" .BR sched_setparam (2), +.\" .BR sched_setscheduler (2), +.\" .BR sched_getscheduler (2), +.BR setpgid (2), +.\" .BR getsid (2), +.BR setsid (2), +.BR sigqueue (2), +.\"O and +.BR waitpid (2). +.\" .BR waitid (2), +.\" .BR wait4 (2), + +.\"O A process's PID is preserved across an +.\"O .BR execve (2). +¥×¥í¥»¥¹¤Î PID ¤Ï +.BR execve (2) +¤ÎÁ°¸å¤ÇÉÔÊѤǤ¢¤ë¡£ +.\"O .SS Parent Process ID (PPID) +.SS ¿Æ¥×¥í¥»¥¹ ID (PPID) +.\"O A process's parent process ID identifies the process that created +.\"O this process using +.\"O .BR fork (2). +.\"O A process can obtain its PPID using +.\"O .BR getppid (2). +.\"O A PPID is represented using the type +.\"O .IR pid_t . +¥×¥í¥»¥¹¤Î¿Æ¥×¥í¥»¥¹¤Î ID ¤Ï¡¢ +.BR fork (2) +¤ò»È¤Ã¤Æ¤½¤Î¥×¥í¥»¥¹¤òÀ¸À®¤·¤¿¥×¥í¥»¥¹¤ò¼¨¤¹¡£ +¥×¥í¥»¥¹¤Ï +.BR getppid (2) +¤ò»È¤Ã¤Æ¼«Ê¬¤Î PPID ¤ò¼èÆÀ¤Ç¤­¤ë¡£ +PPID ¤Ï +.I pid_t +·¿¤Çɽ¸½¤µ¤ì¤ë¡£ + +.\"O A process's PPID is preserved across an +.\"O .BR execve (2). +¥×¥í¥»¥¹¤Î PPID ¤Ï +.BR execve (2) +¤ÎÁ°¸å¤ÇÉÔÊѤǤ¢¤ë¡£ +.\"O .SS Process Group ID and Session ID +.SS ¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤È¥»¥Ã¥·¥ç¥ó ID +.\"O Each process has a session ID and a process group ID, +.\"O both represented using the type +.\"O .IR pid_t . +.\"O A process can obtain its session ID using +.\"O .BR getsid (2), +.\"O and its process group ID using +.\"O .BR getpgrp (2). +³Æ¥×¥í¥»¥¹¤Ï¥»¥Ã¥·¥ç¥ó ID ¤È¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤ò»ý¤Ä¡£ +¤³¤ì¤é¤Î ID ¤Ï¤É¤Á¤é¤â +.I pid_t +·¿¤Çɽ¸½¤µ¤ì¤ë¡£ +¥×¥í¥»¥¹¤Ï¡¢¤½¤ì¤¾¤ì +.BR getsid (2), +.BR getpgrp (2) +¤ò»È¤Ã¤Æ¼«Ê¬¤Î¥»¥Ã¥·¥ç¥ó ID¡¢¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤ò¼èÆÀ¤Ç¤­¤ë¡£ + +.\"O A child created by +.\"O .BR fork (2) +.\"O inherits its parent's session ID and process group ID. +.\"O A process's session ID and process group ID are preserved across an +.\"O .BR execve (2). +.BR fork (2) +¤ÇÀ¸À®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤È¥×¥í¥»¥¹¥°¥ë¡¼¥× ID +¤ò·Ñ¾µ¤¹¤ë¡£¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤È¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤Ï +.BR execve (2) +¤ÎÁ°¸å¤ÇÉÔÊѤǤ¢¤ë¡£ + +.\"O Sessions and process groups are abstractions devised to support shell +.\"O job control. +.\"O A process group (sometimes called a "job") is a collection of +.\"O processes that share the same process group ID; +.\"O the shell creates a new process group for the process(es) used +.\"O to execute single command or pipeline (e.g., the two processes +.\"O created to execute the command "ls\ |\ wc" are placed in the +.\"O same process group). +.\"O A process's group membership can be set using +.\"O .BR setpgid (2). +.\"O The process whose process ID is the same as its process group ID is the +.\"O \fIprocess group leader\fP for that group. +¥»¥Ã¥·¥ç¥ó¤È¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î³µÇ°¤Ï¡¢¥·¥§¥ë¤Î¥¸¥ç¥ÖÀ©¸æ¤ò¹Ô¤¦¤¿¤á¤Ë +¹Í°Æ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¥×¥í¥»¥¹¥°¥ë¡¼¥× (»þ¤Ë¤Ï¡Ö¥¸¥ç¥Ö¡×¤È¸Æ¤Ð¤ì¤ë¤³¤È¤â¤¢¤ë) ¤Ï¡¢ +Ʊ¤¸¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤ò¶¦Í­¤¹¤ë¥×¥í¥»¥¹¤Î½¸¤Þ¤ê¤Ç¤¢¤ë¡£ +¥·¥§¥ë¤Ï¡¢°ì¤Ä¤Î¥³¥Þ¥ó¥É¤â¤·¤¯¤Ï¥Ñ¥¤¥×¥é¥¤¥ó¤Î¼Â¹Ô¤Ë»È¤ï¤ì¤ë¥×¥í¥»¥¹·²¤Ë +ÂФ·¤Æ°ì¤Ä¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤òÀ¸À®¤¹¤ë +(Î㤨¤Ð¡¢¥³¥Þ¥ó¥É "ls\ |\ wc" ¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤ËÀ¸À®¤µ¤ì¤ëÆó¤Ä¤Î¥×¥í¥»¥¹¤Ï +Ʊ¤¸¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ËÃÖ¤«¤ì¤ë)¡£ +½ê°¤¹¤ë¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ï +.BR setpgid (2) +¤ò»È¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡£ +¼«¿È¤Î¥×¥í¥»¥¹ ID ¤¬¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤ÈƱ¤¸¥×¥í¥»¥¹¤Ï¡¢ +¤½¤Î¥°¥ë¡¼¥×¤Î¡Ö¥×¥í¥»¥¹¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼¡×¤Ç¤¢¤ë¡£ + +.\"O A session is a collection of processes that share the same session ID. +.\"O All of the members of a process group also have the same session ID +.\"O (i.e., all of the members of a process group always belong to the +.\"O same session, so that sessions and process groups form a strict +.\"O two-level hierarchy of processes.) +.\"O A new session is created when a process calls +.\"O .BR setsid (2), +.\"O which creates a new session whose session ID is the same +.\"O as the PID of the process that called +.\"O .BR setsid (2). +.\"O The creator of the session is called the \fIsession leader\fP. +¥»¥Ã¥·¥ç¥ó¤Ï¡¢Æ±¤¸¥»¥Ã¥·¥ç¥ó ID ¤ò¶¦Í­¤¹¤ë¥×¥í¥»¥¹¤Î½¸¤Þ¤ê¤Ç¤¢¤ë¡£ +¤¢¤ë°ì¤Ä¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¡¼¤ÏƱ¤¸¥»¥Ã¥·¥ç¥ó ID ¤ò»ý¤Ä +(¤Ä¤Þ¤ê¡¢°ì¤Ä¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤ÏÁ´¤ÆƱ¤¸¥»¥Ã¥·¥ç¥ó¤Ë½ê°¤·¡¢ +¤³¤ì¤Ë¤è¤ê¡¢¥»¥Ã¥·¥ç¥ó¤È¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÇÆó³¬ÁØ¤Î¥×¥í¥»¥¹³¬Áؤ¬·ÁÀ®¤Ç¤­¤ë)¡£ +¿·¤¿¤Ê¥»¥Ã¥·¥ç¥ó¤ÎÀ¸À®¤Ï¥×¥í¥»¥¹¤¬ +.BR setsid (2) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¹Ô¤¦¡£ +.BR setsid (2) +¤Ï¡¢ +.BR setsid (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î PID ¤ÈƱ¤¸ÃͤΥ»¥Ã¥·¥ç¥ó ID ¤ò»ý¤Ä +¿·¤¿¤Ê¥»¥Ã¥·¥ç¥ó¤òÀ¸À®¤¹¤ë¡£ +¥»¥Ã¥·¥ç¥ó¤ÎÀ¸À®¼Ô¤Ï¡Ö¥»¥Ã¥·¥ç¥ó¡¦¥ê¡¼¥À¡¼¡×¤È¸Æ¤Ð¤ì¤ë¡£ +.\"O .SS User and Group Identifiers +.SS ¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥× ID +.\"O Each process has various associated user and groups IDs. +.\"O These IDs are integers, respectively represented using the types +.\"O .I uid_t +.\"O and +.\"O .I gid_t +.\"O (defined in +.\"O .IR ). +³Æ¥×¥í¥»¥¹¤Ï¡¢¿ô¼ïÎà¤Î¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥× ID ¤ò»ý¤Ä¡£ +¥æ¡¼¥¶ ID¡¢¥°¥ë¡¼¥× ID ¤ÏÀ°¿ô¤Ç¡¢¤½¤ì¤¾¤ì +.IR uid_t , +.I gid_t +·¿¤Çɽ¸½¤µ¤ì¤ë (¤³¤ì¤é¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ + +.\"O On Linux, each process has the following user and group identifiers: +Linux ¤Ç¤Ï¡¢³Æ¥×¥í¥»¥¹¤Ï°Ê²¼¤Î¤è¤¦¤Ê¼ïÎà¤Î¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥× ID ¤ò»ý¤Ä¡£ +.IP * 3 +.\"O Real user ID and real group ID. +¼Â¥æ¡¼¥¶ ID ¤È¼Â¥°¥ë¡¼¥× ID¡£ +.\"O These IDs determine who owns the process. +.\"O A process can obtain its real user (group) ID using +.\"O .BR getuid (2) +.\"O .RB ( getgid (2)). +¤³¤ì¤é¤Î ID ¤Ë¤è¤ê¥×¥í¥»¥¹¤Î½êÍ­¼Ô¤¬·èÄꤵ¤ì¤ë¡£ +¥×¥í¥»¥¹¤¬¼«Ê¬¤Î¼Â¥æ¡¼¥¶ ID¡¢¼Â¥°¥ë¡¼¥× ID ¤ò¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢¤½¤ì¤¾¤ì +.BR getuid (2), +.BR getgid (2) +¤ò»ÈÍѤ¹¤ë¡£ +.IP * +.\"O Effective user ID and effective group ID. +¼Â¸ú¥æ¡¼¥¶ ID ¤È¼Â¸ú¥°¥ë¡¼¥× ID¡£ +.\"O These IDs are used by the kernel to determine the permissions +.\"O that the process will have when accessing shared resources such +.\"O as message queues, shared memory, and semaphores. +.\"O On most Unix systems, these IDs also determine the +.\"O permissions when accessing files. +.\"O However, Linux uses the file system IDs described below +.\"O for this task. +.\"O A process can obtain its effective user (group) ID using +.\"O .BR geteuid (2) +.\"O .RB ( getegid (2)). +¤³¤ì¤é¤Î ID ¤Ï¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¡¢¶¦Í­¥á¥â¥ê¡¢¥»¥Þ¥Õ¥©¤Ê¤É¤Î +¶¦Í­¥ê¥½¡¼¥¹¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤¿ºÝ¤Ë¤½¤Î¥×¥í¥»¥¹¤¬¥¢¥¯¥»¥¹µö²Ä¤ò +»ý¤Ã¤Æ¤¤¤ë¤«¤ò¥«¡¼¥Í¥ë¤¬È½Äꤹ¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤Û¤È¤ó¤É¤Î Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤ì¤é¤Î ID ¤Ï¥Õ¥¡¥¤¥ë¤Ø¤Î¥¢¥¯¥»¥¹»þ¤Î +¥¢¥¯¥»¥¹µö²Ä¤ÎȽÄê¤Ë¤â»ÈÍѤµ¤ì¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢Linux ¤Ç¤Ï¥Õ¥¡¥¤¥ë¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä¤ÎȽÄê¤Ë¤Ï +¸å½Ò¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID ¤¬»ÈÍѤµ¤ì¤ë¡£ +¥×¥í¥»¥¹¤¬¼«Ê¬¤Î¼Â¸ú¥æ¡¼¥¶ ID¡¢¼Â¸ú¥°¥ë¡¼¥× ID ¤ò¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢¤½¤ì¤¾¤ì +.BR geteuid (2), +.BR getegid (2) +¤ò»ÈÍѤ¹¤ë¡£ +.IP * +.\"O Saved set-user-ID and saved set-group-ID. +Êݸ (saved) set-user-ID ¤ÈÊݸ set-group-ID¡£ +.\"O These IDs are used in set-user-ID and set-group-ID programs to save +.\"O a copy of the corresponding effective IDs that were set when +.\"O the program was executed (see +.\"O .BR execve (2)). +¤³¤ì¤é¤Î ID ¤Ï¡¢set-user-ID ¤ä set-group-ID ¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ë¤ª¤¤¤Æ¡¢ +¥×¥í¥°¥é¥à¤Î¼Â¹Ô»þ¤ËÀßÄꤵ¤ì¤¿¼Â¸ú ID ¤Î¥³¥Ô¡¼¤òÊݸ¤¹¤ë¤¿¤á¤Ë +»ÈÍѤµ¤ì¤ë +.RB ( execve (2) +»²¾È)¡£ +.\"O A set-user-ID program can assume and drop privileges by +.\"O switching its effective user ID back and forth between the values +.\"O in its real user ID and saved set-user-ID. +.\"O This switching is done via calls to +.\"O .BR seteuid (2), +.\"O .BR setreuid (2), +.\"O or +.\"O .BR setresuid (2). +.\"O A set-group-ID program performs the analogous tasks using +.\"O .BR setegid (2), +.\"O .BR setregid (2), +.\"O or +.\"O .BR setresgid (2). +set-user-ID ¥×¥í¥°¥é¥à¤Ï¡¢¼Â¸ú¥æ¡¼¥¶ ID ¤ò¼Â¥æ¡¼¥¶ID ¤ÈÊݸ set-user-ID +¤Î´Ö¤Ç¹Ô¤Ã¤¿¤êÍ褿¤êÀÚ¤êÂؤ¨¤ë¤³¤È¤Ç¡¢Æø¢¤òÆÀ¤¿¤êÍî¤È¤·¤¿¤ê¤Ç¤­¤ë¡£ +¤³¤ÎÀÚ¤êÂؤ¨¤Ï +.BR seteuid (2), +.BR setreuid (2), +.BR setresuid (2) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¼Â¹Ô¤Ç¤­¤ë¡£ +set-group-ID ¥×¥í¥°¥é¥à¤Ï¡¢ +.BR setegid (2), +.BR setregid (2), +.BR setresgid (2) +¤ò»È¤Ã¤ÆƱÍͤΤ³¤È¤¬¤Ç¤­¤ë¡£ +.\"O A process can obtain its saved set-user-ID (set-group-ID) using +.\"O .BR getresuid (2) +.\"O .RB ( getresgid (2)). +¥×¥í¥»¥¹¤¬¼«Ê¬¤ÎÊݸ set-user-ID¡¢Êݸ set-group-ID ¤ò¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢ +.BR getresuid(2), +.BR getresgids (2) +¤ò¤½¤ì¤¾¤ì»ÈÍѤ¹¤ë¡£ +.IP * +.\"O File system user ID and file system group ID (Linux-specific). +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥æ¡¼¥¶ ID ¤È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥°¥ë¡¼¥× ID (Linux ¸ÇÍ­)¡£ +.\"O These IDs, in conjunction with the supplementary group IDs described +.\"O below, are used to determine permissions for accessing files; see +.\"O .BR path_resolution (7) +.\"O for details. +.\"O Whenever a process's effective user (group) ID is changed, +.\"O the kernel also automatically changes the file system user (group) ID +.\"O to the same value. +.\"O Consequently, the file system IDs normally have the same values +.\"O as the corresponding effective ID, and the semantics for file-permission +.\"O checks are thus the same on Linux as on other Unix systems. +.\"O The file system IDs can be made to differ from the effective IDs +.\"O by calling +.\"O .BR setfsuid (2) +.\"O and +.\"O .BR setfsgid (2). +¤³¤ì¤é¤Î ID ¤Ï¡¢¸å½Ò¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤ÈÁȤ߹ç¤ï¤»¤Æ»ÈÍѤµ¤ì¡¢ +¥Õ¥¡¥¤¥ë¤Ø¤Î¥¢¥¯¥»¥¹¸¢¤Î·èÄê¤ËÍøÍѤµ¤ì¤ë¡£¾ÜºÙ¤Ï +.BR path_resolution (7) +¤ò»²¾È¡£ +¥×¥í¥»¥¹¤Î¼Â¸ú ID (¥æ¡¼¥¶ ID ¤ä ¥°¥ë¡¼¥× ID) ¤¬Êѹ¹¤µ¤ì¤ë¤¿¤Ó¤Ë¡¢ +¥«¡¼¥Í¥ë¤Ï¼«Æ°Åª¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID ¤òƱ¤¸ÃͤËÊѹ¹¤¹¤ë¡£ +¤½¤Î·ë²Ì¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID ¤ÏÄ̾ï¤ÏÂбþ¤¹¤ë¼Â¸ú ID ¤ÈƱ¤¸ÃͤȤʤꡢ +¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¤Î¥Á¥§¥Ã¥¯ÊýË¡¤Ï Linux ¤È¾¤Î Unix ¥·¥¹¥Æ¥à¤ÇƱ¤¸¤Ç¤¢¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID ¤Ï¼Â¸ú ID ¤È¤Ï°Û¤Ê¤ëÃͤˤ¹¤ë¤³¤È¤¬¤Ç¤­¡¢ +Êѹ¹¤Ï +.BR setfsuid (2) +¤È +.BR setfsgid (2) +¤ò¸Æ¤Ó½Ð¤·¤Æ¹Ô¤¦¡£ +.IP * +.\"O Supplementary group IDs. +Êä½õ¥°¥ë¡¼¥× ID¡£ +.\"O This is a set of additional group IDs that are used for permission +.\"O checks when accessing files and other shared resources. +.\"O On Linux kernels before 2.6.4, +.\"O a process can be a member of up to 32 supplementary groups; +.\"O since kernel 2.6.4, +.\"O a process can be a member of up to 65536 supplementary groups. +¤³¤Î ID ¤Ï¡¢¥Õ¥¡¥¤¥ë¤ä¾¤Î¶¦Í­¥ê¥½¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹»þ¤Ë¥¢¥¯¥»¥¹µö²Ä¤Î +¥Á¥§¥Ã¥¯¤Ë»ÈÍѤµ¤ì¤ë¡¢ÄɲäΥ°¥ë¡¼¥× ID ¤Î½¸¹ç¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.6.4 ¤è¤êÁ°¤Î Linux ¤Ç¤Ï¡¢°ì¤Ä¤Î¥×¥í¥»¥¹¤¢¤¿¤ê¤Î +Êä½õ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¿ô¤ÏºÇÂç¤Ç 32 ¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.6.4 °Ê¹ß¤Ç¤Ï¡¢°ì¤Ä¤Î¥×¥í¥»¥¹¤¢¤¿¤ê¤Î +Êä½õ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¿ô¤ÏºÇÂç¤Ç 65536 ¤Ç¤¢¤ë¡£ +.\"O The call +.\"O .I sysconf(_SC_NGROUPS_MAX) +.\"O can be used to determine the number of supplementary groups +.\"O of which a process may be a member. +.I sysconf(_SC_NGROUPS_MAX) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢¤¢¤ë¥×¥í¥»¥¹¤¬¥á¥ó¥Ð¡¼¤È¤Ê¤ë¤³¤È¤¬¤Ç¤­¤ë²ÄǽÀ­¤Î¤¢¤ë +Êä½õ¥°¥ë¡¼¥×¿ô¤òÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.\" Since kernel 2.6.4, the limit is visible via the read-only file +.\" /proc/sys/kernel/ngroups_max. +.\" As at 2.6.22-rc2, this file is still read-only. +.\"O A process can obtain its set of supplementary group IDs using +.\"O .BR getgroups (2), +.\"O and can modify the set using +.\"O .BR setgroups (2). +¥×¥í¥»¥¹¤Ï¡¢¼«Ê¬¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤Î½¸¹ç¤ò +.BR getgroups (2) +¤Ç¼èÆÀ¤Ç¤­¡¢ +.BR setgroups (2) +¤Ç½¸¹ç¤òÊѹ¹¤Ç¤­¤ë¡£ +.PP +.\"O A child process created by +.\"O .BR fork (2) +.\"O inherits copies of its parent's user and groups IDs. +.\"O During an +.\"O .BR execve (2), +.\"O a process's real user and group ID and supplementary +.\"O group IDs are preserved; +.\"O the effective and saved set IDs may be changed, as described in +.\"O .BR execve (2). +.BR fork (2) +¤ÇÀ¸À®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥× ID ¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤Î´Ö¡¢¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶/¥°¥ë¡¼¥× ID ¤ÈÊä½õ¥°¥ë¡¼¥× ID ½¸¹ç¤ÏÉÔÊѤǤ¢¤ë¡£ +¼Â¸ú ID ¤ÈÊݸ¥»¥Ã¥È ID ¤ÏÊѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë +.RB ( execve (2) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë)¡£ + +.\"O Aside from the purposes noted above, +.\"O a process's user IDs are also employed in a number of other contexts: +¾åµ­¤ÎÌÜŪ°Ê³°¤Ë¤â¡¢¥×¥í¥»¥¹¤Î¥æ¡¼¥¶ ID ¤Ï¾¤ÎÍÍ¡¹¤Ê¾ìÌ̤ÇÍøÍѤµ¤ì¤ë¡£ +.IP * 3 +.\"O when determining the permissions for sending signals \(em see +.\"O .BR kill (2); +¥·¥°¥Ê¥ë¤òÁ÷¤ëµö²Ä¤ÎȽÄê»þ \(em +.BR kill (2) +»²¾È¡£ +.IP * +.\"O when determining the permissions for setting +.\"O process-scheduling parameters (nice value, real time +.\"O scheduling policy and priority, CPU affinity, I/O priority) using +.\"O .BR setpriority (2), +.\"O .BR sched_setaffinity (2), +.\"O .BR sched_setscheduler (2), +.\"O .BR sched_setparam (2), +.\"O and +.\"O .BR ioprio_set (2); +¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°´ØÏ¢¤Î¥Ñ¥é¥á¡¼¥¿ (nice ÃÍ¡¢ +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥Ý¥ê¥·¡¼¤äÍ¥ÀèÅÙ¡¢CPU affinity¡¢ +Æþ½ÐÎÏÍ¥ÀèÅÙ) ¤ÎÀßÄêµö²Ä¤ÎȽÄê»þ¡£ +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°´ØÏ¢¤Î¥Ñ¥é¥á¡¼¥¿ÀßÄê¤Ë¤Ï +.BR setpriority (2), +.BR sched_setaffinity (2), +.BR sched_setscheduler (2), +.BR sched_setparam (2), +.BR ioprio_set (2) +¤¬»ÈÍѤµ¤ì¤ë¡£ +.IP * +.\"O when checking resource limits; see +.\"O .BR getrlimit (2); +¥ê¥½¡¼¥¹¾å¸Â¤Î¥Á¥§¥Ã¥¯»þ¡£ +.BR getrlimit (2) +»²¾È¡£ +.IP * +.\"O when checking the limit on the number of inotify instances +.\"O that the process may create; see +.\"O .BR inotify (7). +¥×¥í¥»¥¹¤¬À¸À®¤Ç¤­¤ë inotify ¥¤¥ó¥¹¥¿¥ó¥¹¿ô¤Î¾å¸Â¤Î¥Á¥§¥Ã¥¯»þ¡£ +.BR inotify (7) +»²¾È¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O Process IDs, parent process IDs, process group IDs, and session IDs +.\"O are specified in POSIX.1-2001. +.\"O The real, effective, and saved set user and groups IDs, +.\"O and the supplementary group IDs, are specified in POSIX.1-2001. +.\"O The file system user and group IDs are a Linux extension. +¥×¥í¥»¥¹ ID¡¢¿Æ¥×¥í¥»¥¹ ID¡¢¥×¥í¥»¥¹¥°¥ë¡¼¥× ID¡¢¥»¥Ã¥·¥ç¥ó ID ¤Ï +POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +¼Â ID¡¢¼Â¸ú ID¡¢Êݸ¥»¥Ã¥È ID ¤Î¥æ¡¼¥¶ ID / ¥°¥ë¡¼¥× ID ¤ª¤è¤Ó +Êä½õ¥°¥ë¡¼¥× ID ¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥æ¡¼¥¶ ID / ¥°¥ë¡¼¥× ID ¤Ï Linux ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The POSIX threads specification requires that +.\"O credentials are shared by all of the threads in a process. +.\"O However, at the kernel level, Linux maintains separate user and group +.\"O credentials for each thread. +.\"O The NPTL threading implementation does some work to ensure +.\"O that any change to user or group credentials +.\"O (e.g., calls to +.\"O .BR setuid (2), +.\"O .BR setresuid (2), +.\"O etc.) +.\"O is carried through to all of the POSIX threads in a process. +POSIX ¤Î¥¹¥ì¥Ã¥É»ÅÍͤǤϡ¢¤³¤ì¤é¤Î¼±Ê̻Ҥ¬¥×¥í¥»¥¹Æâ¤ÎÁ´¥¹¥ì¥Ã¥É¤Ç +¶¦Í­¤µ¤ì¤ë¤³¤È¤òµá¤á¤Æ¤¤¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¥«¡¼¥Í¥ë¤Î¥ì¥Ù¥ë¤Ç¤Ï¡¢Linux ¤Ï¥¹¥ì¥Ã¥ÉËè¤ËÊÌ¡¹¤Î +¥æ¡¼¥¶¤È¥°¥ë¡¼¥×¤Ë´Ø¤¹¤ë¼±Ê̻Ҥò´ÉÍý¤·¤Æ¤¤¤ë¡£ +NPTL ¥¹¥ì¥Ã¥É¼ÂÁõ¤¬¡¢(Î㤨¤Ð +.BR setuid (2), +.BR setresuid (2) +¤Ê¤É¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ë) ¥æ¡¼¥¶¤ä¥°¥ë¡¼¥×¤Ë´Ø¤¹¤ë¼±Ê̻ҤËÂФ¹¤ëÊѹ¹¤¬ +¥×¥í¥»¥¹Æâ¤ÎÁ´¤Æ¤Î POSIX ¥¹¥ì¥Ã¥É¤ËÂФ·¤ÆÈ¿±Ç¤µ¤ì¤ë¤³¤È¤òÊݾڤ¹¤ë +¤¿¤á¤Î½èÍý¤ò¹Ô¤Ã¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bash (1), +.BR csh (1), +.BR ps (1), +.BR access (2), +.BR execve (2), +.BR faccessat (2), +.BR fork (2), +.BR getpgrp (2), +.BR getpid (2), +.BR getppid (2), +.BR getsid (2), +.BR kill (2), +.BR killpg (2), +.BR setegid (2), +.BR seteuid (2), +.BR setfsgid (2), +.BR setfsuid (2), +.BR setgid (2), +.BR setgroups (2), +.BR setresgid (2), +.BR setresuid (2), +.BR setuid (2), +.BR waitpid (2), +.BR euidaccess (3), +.BR initgroups (3), +.BR tcgetpgrp (3), +.BR tcsetpgrp (3), +.BR capabilities (7), +.BR path_resolution (7), +.BR unix (7) diff --git a/draft/man7/ddp.7 b/draft/man7/ddp.7 new file mode 100644 index 00000000..669aa453 --- /dev/null +++ b/draft/man7/ddp.7 @@ -0,0 +1,402 @@ +.\" This man page is Copyright (C) 1998 Alan Cox. +.\" 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. +.\" $Id: ddp.7,v 1.6 1999/12/06 00:13:56 nakano Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated Mon 6 Dec 1999 by NAKANO Takeo +.\" +.TH DDP 7 2008-11-20 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ddp \- Linux AppleTalk protocol implementation +ddp \- Linux ¤Ç¤Î AppleTalk ¥×¥í¥È¥³¥ë¤Î¼ÂÁõ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.IB ddp_socket " = socket(AF_APPLETALK, SOCK_DGRAM, 0);" +.br +.IB raw_socket " = socket(AF_APPLETALK, SOCK_RAW, " protocol ");" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Linux implements the Appletalk protocols described in +.\"O .IR "Inside Appletalk" . +.\"O Only the DDP layer and AARP are present in +.\"O the kernel. +.\"O They are designed to be used via the +.\"O .B netatalk +.\"O protocol +.\"O libraries. +.\"O This page documents the interface for those who wish or need to +.\"O use the DDP layer directly. +Linux ¤Ï +.I "Inside Appletalk" +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë Appletalk ¥×¥í¥È¥³¥ë¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë¤Ë¤¢¤ë¤Î¤Ï DDP ÁØ¤È AARP ¤À¤±¤Ç¤¢¤ë¡£¤³¤ì¤é¤Ï +.B netatalk +¥×¥í¥È¥³¥ë¥é¥¤¥Ö¥é¥ê¤òÄ̤·¤ÆÍøÍѤµ¤ì¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Ú¡¼¥¸¤Ï DDP ÁؤòľÀÜÍøÍѤ·¤¿¤¤¥æ¡¼¥¶¡¼¤Î¤¿¤á¤Ë¡¢ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òµ­½Ò¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.PP +.\"O The communication between Appletalk and the user program works using a +.\"O BSD-compatible socket interface. +.\"O For more information on sockets, see +.\"O .BR socket (7). +Appletalk ¤È¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤È¤ÎÄÌ¿®¤Ë¤Ï¡¢ +BSD ¸ß´¹¤Î¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÍøÍѤ¹¤ë¡£ +¥½¥±¥Ã¥È¤Ë´Ø¤¹¤ë¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR socket (7) +¤ò¸«¤è¡£ +.PP +.\"O An AppleTalk socket is created by calling the +.\"O .BR socket (2) +.\"O function with a +.\"O .B AF_APPLETALK +.\"O socket family argument. +.\"O Valid socket types are +.\"O .B SOCK_DGRAM +.\"O to open a +.\"O .B ddp +.\"O socket or +.\"O .B SOCK_RAW +.\"O to open a +.\"O .B raw +.\"O socket. +.\"O .I protocol +.\"O is the Appletalk protocol to be received or sent. +.\"O For +.\"O .B SOCK_RAW +.\"O you must specify +.\"O .BR ATPROTO_DDP . +Appletalk ¥½¥±¥Ã¥È¤Ï¡¢ +¥½¥±¥Ã¥È¥Õ¥¡¥ß¥ê¡¼¤Î°ú¿ô¤Ë +.B AF_APPLETALK +¤ò»ØÄꤷ¤Æ +.BR socket (2) +´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤ë¡£»ØÄê¤Ç¤­¤ë¥½¥±¥Ã¥È¥¿¥¤¥×¤Ï¡¢ +.B ddp +¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¾ì¹ç¤Ë¤Ï +.BR SOCK_DGRAM ¡¢ +.B raw +¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¾ì¹ç¤Ë¤Ï +.B SOCK_RAW +¤Ç¤¢¤ë¡£ +.I protocol +¤ÏÁ÷¼õ¿®¤µ¤ì¤ë Appletalk ¥×¥í¥È¥³¥ë¤Ç¤¢¤ë¡£ +¥½¥±¥Ã¥È¥¿¥¤¥×¤Ë +.B SOCK_RAW +¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï¡¢¥×¥í¥È¥³¥ë¤Ë +.B ATPROTO_DDP +¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O Raw sockets may be only opened by a process with effective user ID 0 +.\"O or when the process has the +.\"O .B CAP_NET_RAW +.\"O capability. +raw ¥½¥±¥Ã¥È¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤«¡¢ +.B CAT_NEW_RAW +¸¢¸Â¤ò»ý¤Ã¤¿¥×¥í¥»¥¹¤Ç¤Ê¤¤¤È¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤¡£ +.\"O .SS "Address Format" +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.\"O An Appletalk socket address is defined as a combination of a network number, +.\"O a node number, and a port number. +Appletalk ¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï¥Í¥Ã¥È¥ï¡¼¥¯Èֹ桦¥Î¡¼¥ÉÈֹ桦¥Ý¡¼¥ÈÈÖ¹æ¤Î +ÁȤ߹ç¤ï¤»¤ÇÄêµÁ¤µ¤ì¤ë¡£ +.PP +.in +4n +.nf +struct at_addr { + unsigned short s_net; + unsigned char s_node; +}; + +struct sockaddr_atalk { + sa_family_t sat_family; /* address family */ + unsigned char sat_port; /* port */ + struct at_addr sat_addr; /* net/node */ +}; +.fi +.in +.PP +.\"O .I sat_family +.\"O is always set to +.\"O .BR AF_APPLETALK . +.I sat_family +¤Ï¾ï¤Ë +.B AF_APPLETALK +¤ËÀßÄꤹ¤ë¡£ +.\"O .I sat_port +.\"O contains the port. +.\"O The port numbers below 129 are known as +.\"O .IR reserved ports . +.\"O Only processes with the effective user ID 0 or the +.\"O .B CAP_NET_BIND_SERVICE +.\"O capability may +.\"O .BR bind (2) +.\"O to these sockets. +.I sat_port +¤Ï¥Ý¡¼¥È¤òÍ¿¤¨¤ë¡£¥Ý¡¼¥ÈÈֹ椬 129 °Ê²¼¤Î¥Ý¡¼¥È¤Ï +¡ÖͽÌó¥Ý¡¼¥È (reserved port)¡× ¤È¸Æ¤Ð¤ì¤ë¡£¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤«¡¢ +.B CAP_NET_BIND_SERVICE +¸¢¸Â¤ò»ý¤Ä¥×¥í¥»¥¹¤À¤±¤¬¡¢¤³¤Î¤è¤¦¤Ê¥½¥±¥Ã¥È¤ò +.BR bind (2) +¤Ç¤­¤ë¡£ +.\"O .I sat_addr +.\"O is the host address. +.\"O The +.\"O .I net +.\"O member of +.\"O .I struct at_addr +.\"O contains the host network in network byte order. +.\"O The value of +.\"O .B AT_ANYNET +.\"O is a +.\"O wildcard and also implies \(lqthis network.\(rq +.I sat_addr +¤Ï¥Û¥¹¥È¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I struct at_addr +¤Î¥á¥ó¥Ð¡¼ +.I s_net +¤Ë¤Ï¥Û¥¹¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤ò¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤ÇÍ¿¤¨¤ë¡£ÃÍ +.B AT_ANYNET +¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É¤Ç¡¢¡Ö¤³¤Î¥Í¥Ã¥È¥ï¡¼¥¯¡×¤â°ÅÌۤΤ¦¤Á¤Ë´Þ¤Þ¤ì¤ë¡£ +.\"O The +.\"O .I node +.\"O member of +.\"O .I struct at_addr +.\"O contains the host node number. +.\"O The value of +.\"O .B AT_ANYNODE +.\"O is a +.\"O wildcard and also implies \(lqthis node.\(rq The value of +.\"O .B ATADDR_BCAST +.\"O is a link +.\"O local broadcast address. +.I struct at_addr +¤Î¥á¥ó¥Ð¡¼ +.I s_node +¤Ë¤Ï¥Û¥¹¥È¤Î¥Î¡¼¥ÉÈÖ¹æ¤òÍ¿¤¨¤ë¡£ÃÍ +.B AT_ANYNODE +¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É¤Ç¡¢¡Ö¤³¤Î¥Î¡¼¥É¡×¤â°ÅÌۤΤ¦¤Á¤Ë´Þ¤Þ¤ì¤ë¡£ÃÍ +.B ATADDR_BCAST +¤Ï¥í¡¼¥«¥ë¤Ê¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.\" FIXME this doesn't make sense [johnl] +.\"O .SS "Socket Options" +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.\"O No protocol-specific socket options are supported. +¥×¥í¥È¥³¥ë¸ÇÍ­¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ï¤Ê¤¤¡£ +.\"O .SS /proc interfaces +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.\"O IP supports a set of +.\"O .I /proc +.\"O interfaces to configure some global AppleTalk parameters. +.\"O The parameters can be accessed by reading or writing files in the directory +.\"O .IR /proc/sys/net/atalk/ . +Appletalk ¤Î¥°¥í¡¼¥Ð¥ë¥Ñ¥é¥á¡¼¥¿¤Î¤¤¤¯¤Ä¤«¤Ï¡¢ +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ̤·¤ÆÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤Ë¤Ï¡¢ +.I /proc/sys/net/atalk/ +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.TP +.I aarp-expiry-time +.\"O The time interval (in seconds) before an AARP cache entry expires. +AARP ¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê¤òÇË´þ¤¹¤ë¤Þ¤Ç¤Î¥¿¥¤¥à¥¤¥ó¥¿¡¼¥Ð¥ë (ÉÃñ°Ì)¡£ +.TP +.I aarp-resolve-time +.\"O The time interval (in seconds) before an AARP cache entry is resolved. +AARP ¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê¤¬²ò·è¤µ¤ì¤ë¤Þ¤Ç¤Î¥¿¥¤¥à¥¤¥ó¥¿¡¼¥Ð¥ë (ÉÃñ°Ì)¡£ +.TP +.I aarp-retransmit-limit +.\"O The number of retransmissions of an AARP query before the node is declared +.\"O dead. +AARP ¥¯¥¨¥ê¡¼¤ÎºÇÂçºÆÁ÷¿®²ó¿ô¡£¤³¤Î²ó¿ô¤ò±Û¤¨¤ë¤È¡¢ +¤½¤Î¥Î¡¼¥É¤Ï dead ¤Ç¤¢¤ë¤È¤ß¤Ê¤µ¤ì¤ë¡£ +.TP +.I aarp-tick-time +.\"O The timer rate (in seconds) for the timer driving AARP. +¥¿¥¤¥Þ¡¼Æ°ºî¤¹¤ë AARP ¤Î¥¿¥¤¥Þ¡¼¥ì¡¼¥È (ÉÃñ°Ì) +.PP +.\"O The default values match the specification and should never need to be +.\"O changed. +¥Ç¥Õ¥©¥ë¥È¤ÎÃͤǻÅÍͤ˥ޥåÁ¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ +Êѹ¹¤¹¤ëɬÍפÏÁ´¤¯¤Ê¤¤¤Ï¤º¤Ç¤¢¤ë¡£ +.\"O .SS Ioctls +.SS ioctl +.\"O All ioctls described in +.\"O .BR socket (7) +.\"O apply to DDP. +.BR socket (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î ioctl ¤¬ +DDP ¤Ë¤âŬÍѤµ¤ì¤ë¡£ +.\" FIXME Add a section about multicasting +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\" FIXME document all errors. We should really fix the kernels to +.\" give more uniform error returns (ENOMEM vs ENOBUFS, EPERM vs +.\" EACCES etc.) +.TP +.B EACCES +.\"O The user tried to execute an operation without the necessary permissions. +.\"O These include sending to a broadcast address without +.\"O having the broadcast flag set, +.\"O and trying to bind to a reserved port without effective user ID 0 or +.\"O .BR CAP_NET_BIND_SERVICE . +¥æ¡¼¥¶¤¬¹Ô¤ª¤¦¤È¤·¤¿Áàºî¤ËɬÍפʸ¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +broadcast ¥Õ¥é¥°¤ò¥»¥Ã¥È¤»¤º¤Ë¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ØÁ÷¿®¤ò¹Ô¤ª¤¦¤È¤·¤¿¡¢ +¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Ç¤Ê¤¯¡¢ +.B CAP_NET_BIND_SERVICE +¸¢¸Â¤Î¤Ê¤¤¥×¥í¥»¥¹¤ÇÆø¢¥Ý¡¼¥È¤ò¥Ð¥¤¥ó¥É¤·¤è¤¦¤È¤·¤¿¡¢¤Ê¤É¤¬¹Í¤¨¤é¤ì¤ë¡£ +.TP +.B EADDRINUSE +.\"O Tried to bind to an address already in use. +´û¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B EADDRNOTAVAIL +.\"O A nonexistent interface was requested or the requested source address was +.\"O not local. +¸ºß¤·¤Ê¤¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬Í׵ᤵ¤ì¤¿¡£¤Þ¤¿¤Ï +Í׵ᤵ¤ì¤¿¥½¡¼¥¹¥¢¥É¥ì¥¹¤¬¥í¡¼¥«¥ë¤Ê¤â¤Î¤Ç¤Ê¤¤¡£ +.TP +.B EAGAIN +.\"O Operation on a nonblocking socket would block. +Èó¥Ö¥í¥Ã¥­¥ó¥°¥½¥±¥Ã¥È¤ËÂФ·¤Æ¥Ö¥í¥Ã¥¯¤¹¤ëÁàºî¤ò¹Ô¤Ã¤¿¡£ +.TP +.B EALREADY +.\"O A connection operation on a nonblocking socket is already in progress. +Èó¥Ö¥í¥Ã¥­¥ó¥°¥½¥±¥Ã¥È¤ËÂФ¹¤ëÀܳÁàºî¤¬´û¤Ë¼Â¹ÔÃæ¤Ç¤¢¤ë¡£ +.TP +.B ECONNABORTED +.\"O A connection was closed during an +.\"O .BR accept (2). +.BR accept (2) +¤ÎÅÓÃæ¤ÇÀܳ¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿¡£ +.TP +.B EHOSTUNREACH +.\"O No routing table entry matches the destination address. +¹Ô¤­À襢¥É¥ì¥¹¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤Ë¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O Invalid argument passed. +ÅϤ·¤¿°ú¿ô¤¬ÉÔÀµ¡£ +.TP +.B EISCONN +.\"O .BR connect (2) +.\"O was called on an already connected socket. +ÀܳºÑ¤ß¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.BR connect (2) +¤¬¸Æ¤Ð¤ì¤¿¡£ +.TP +.B EMSGSIZE +.\"O Datagram is bigger than the DDP MTU. +¥Ç¡¼¥¿¥°¥é¥à¤¬ DDP MTU ¤è¤êÂ礭¤¤¡£ +.TP +.B ENODEV +.\"O Network device not available or not capable of sending IP. +¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤¬¤Ê¤¤¡£¤¢¤ë¤¤¤Ï IP ¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.B ENOENT +.\"O .B SIOCGSTAMP +.\"O was called on a socket where no packet arrived. +¥Ñ¥±¥Ã¥È¤¬ÅþÃ夷¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.B SIOCGSTAMP +¤¬¸Æ¤Ð¤ì¤¿¡£ +.TP +.\"O .BR ENOMEM " and " ENOBUFS +.BR ENOMEM " ¤È " ENOBUFS +.\"O Not enough memory available. +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B ENOPKG +.\"O A kernel subsystem was not configured. +¥«¡¼¥Í¥ë¤Î¥µ¥Ö¥·¥¹¥Æ¥à¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.\"O .BR ENOPROTOOPT " and " EOPNOTSUPP +.BR ENOPROTOOPT " ¤È " EOPNOTSUPP +.\"O Invalid socket option passed. +ÅϤ·¤¿¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÉÔÀµ¡£ +.TP +.B ENOTCONN +.\"O The operation is only defined on a connected socket, but the socket wasn't +.\"O connected. +¹Ô¤ª¤¦¤È¤·¤¿Áàºî¤ÏÀܳºÑ¤ß¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Î¤ßÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤À¤¬¡¢ +¤½¤Î¥½¥±¥Ã¥È¤ÏÀܳ¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPERM +.\"O User doesn't have permission to set high priority, +.\"O make a configuration change, +.\"O or send signals to the requested process or group, +¹â¤¤Í¥ÀèÅÙ¤ËÀßÄꤷ¤¿¤ê¡¢ÀßÄê¤òÊѹ¹¤·¤¿¤ê¡¢ +»ØÄꤷ¤¿¥×¥í¥»¥¹¤ä¥°¥ë¡¼¥×¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¤Î¤ËɬÍפʸ¢¸Â¤ò +¥æ¡¼¥¶¤¬»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EPIPE +.\"O The connection was unexpectedly closed or shut down by the other end. +Àܳ¤¬ÀèÊý¤Ë¤è¤Ã¤Æ¡¢Ä̾ï°Ê³°¤Î¤ä¤êÊý¤Ç¥¯¥í¡¼¥º¤Þ¤¿¤Ï¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤¿¡£ +.TP +.B ESOCKTNOSUPPORT +.\"O The socket was unconfigured, or an unknown socket type was requested. +¥½¥±¥Ã¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£¤Þ¤¿¤Ï̤ÃΤΥ½¥±¥Ã¥È¥¿¥¤¥×¤¬Í׵ᤵ¤ì¤¿¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O Appletalk is supported by Linux 2.0 or higher. +.\"O The +.\"O .I /proc +.\"O interfaces exist since Linux 2.2. +Appletalk ¤Ï Linux 2.0 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï Linux 2.2 °Ê¹ß¤Ë¸ºß¤¹¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Be very careful with the +.\"O .B SO_BROADCAST +.\"O option \- it is not privileged in Linux. +.\"O It is easy to overload the network +.\"O with careless sending to broadcast addresses. +.B SO_BROADCAST +¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë»þ¤Ë¤Ï¿µ½Å¤Î¾å¤Ë¤â¿µ½Å¤Ë¤Ê¤Ã¤Æ¤Û¤·¤¤¡£ +Linux ¤Ç¤Ï¤³¤ì¤ËÆø¢¤òɬÍפȤ·¤Ê¤¤¡£ +ÉÔÃí°Õ¤Ë¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ËÁ÷¿®¤ò¹Ô¤¦¤È¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¤Î¾õÂÖ¤¬´Êñ¤ËÊѹ¹¤µ¤ì¤Æ¤·¤Þ¤¦¡£ +.\"O .SS Compatibility +.SS °Ü¿¢À­ +.\"O The basic AppleTalk socket interface is compatible with +.\"O .B netatalk +.\"O on BSD-derived systems. +.\"O Many BSD systems fail to check +.\"O .B SO_BROADCAST +.\"O when sending broadcast frames; this can lead to compatibility problems. +´ðËÜŪ¤Ê Appletalk ¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï +BSD ͳÍè¤Î¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë +.B netatalk +¤È¸ß´¹À­¤¬¤¢¤ë¡£Â¿¤¯¤Î BSD ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥Õ¥ì¡¼¥à¤òÁ÷¿®¤·¤è¤¦¤È¤·¤¿¤È¤­¤Î +.B SO_BROADCAST +¤Î¥Á¥§¥Ã¥¯¤Ë¼ºÇÔ¤¹¤ë¡£¤³¤ì¤Ï¸ß´¹À­¤ÎÌäÂê¤È¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +.\"O The +.\"O raw +.\"O socket mode is unique to Linux and exists to support the alternative CAP +.\"O package and AppleTalk monitoring tools more easily. +raw ¥½¥±¥Ã¥È¥â¡¼¥É¤Ï Linux ÆÈÆäΤâ¤Î¤Ç¡¢¤â¤¦°ìÊý¤Î¼ÂÁõ¤Ç¤¢¤ë CAP +¥Ñ¥Ã¥±¡¼¥¸¤ä¡¢ Appletalk ¥â¥Ë¥¿¥Ä¡¼¥ë¤ò¤è¤ê´Êñ¤Ë¼ÂÁõ¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O There are too many inconsistent error values. +¥¨¥é¡¼¤ÎÃͤ¬¤Þ¤Ã¤¿¤¯¼óÈø°ì´Ó¤·¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O The ioctls used to configure routing tables, devices, +.\"O AARP tables and other devices are not yet described. +¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¡¦¥Ç¥Ð¥¤¥¹¡¦ AARP ¥Æ¡¼¥Ö¥ë¡¦¤½¤Î¾¤Î¥Ç¥Ð¥¤¥¹¤ò +ÀßÄꤹ¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë ioctl ¤¬¤Þ¤Àµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR recvmsg (2), +.BR sendmsg (2), +.BR capabilities (7), +.BR socket (7) diff --git a/draft/man7/environ.7 b/draft/man7/environ.7 new file mode 100644 index 00000000..f1cf9fb2 --- /dev/null +++ b/draft/man7/environ.7 @@ -0,0 +1,420 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" and Andries Brouwer (aeb@cwi.nl), Fri Feb 14 21:47:50 1997. +.\" +.\" 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 Sun Jul 25 10:45:30 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Jul 21 21:25:26 1996 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Mon Oct 21 17:47:19 1996 by Eric S. Raymond (esr@thyrsus.com) +.\" Modified Wed Aug 27 20:28:58 1997 by Nicolas Lichtmaier (nick@debian.org) +.\" Modified Mon Sep 21 00:00:26 1998 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Wed Jan 24 06:37:24 2001 by Eric S. Raymond (esr@thyrsus.com) +.\" Modified Thu Dec 13 23:53:27 2001 by Martin Schulze +.\" +.\" nakano Ãí: Nicolas ¤µ¤ó¤Î a ¤Ï¥ª¥ê¥¸¥Ê¥ë¤Ç¤Ï \'a ¤À¤¬, +.\" ¥­¥ã¥é¥¯¥¿¤ò²õ¤¹¤Î¤Ç a ¤ËÊѹ¹¤·¤¿. +.\" +.\" Japanese Version Copyright (c) 1997 KURODA Masaru all rights reserved. +.\" Translated May 27, 1997 by KURODA Masaru +.\" Modified Sat 25 Jul 1998 by NAKANO Takeo +.\" Modified Sun 6 Dec 1998 by NAKANO Takeo +.\" Updated & Modified Sat Aug 21 1999 +.\" by NAKANO Takeo +.\" Updated & Modified Sat 18 Mar 2000 by NAKANO Takeo +.\" Updated Sat Dec 22 JST 2001 by Kentaro Shirakata +.\" Updated Sat Mar 23 JST 2002 by Kentaro Shirakata +.\" Updated 2010-04-11, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: environment ´Ä¶­ +.\"WORD: environment variable ´Ä¶­ÊÑ¿ô +.\"WORD: shell variable ¥·¥§¥ëÊÑ¿ô +.\"WORD: locale ¥í¥±¡¼¥ë +.\"WORD: locale category ¥í¥±¡¼¥ë¥«¥Æ¥´¥ê +.\" +.TH ENVIRON 7 2009-07-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O environ \- user environment +.SH ̾Á° +environ \- ¥æ¡¼¥¶´Ä¶­ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.BI "extern char **" environ ; +.br +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The variable +.\"O .I environ +.\"O points to an array of pointers to strings called the "environment". +.\"O The last pointer in this array has the value NULL. +.\"O (This variable must be declared in the user program, +.\"O but is declared in the header file +.\"O .I +.\"O in case the header files came from libc4 or libc5, and +.\"O in case they came from glibc and +.\"O .B _GNU_SOURCE +.\"O was defined.) +.\"O This array of strings is made available to the process by the +.\"O .BR exec (3) +.\"O call that started the process. +ÊÑ¿ô +.I environ +¤Ï¡Ö´Ä¶­ (environment)¡×¤È¸Æ¤Ð¤ì¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Ç¤¢¤ë¡£ +¤³¤ÎÇÛÎó¤ÎºÇ¸å¤Î¥Ý¥¤¥ó¥¿¤ÎÃÍ¤Ï NULL ¤Ç¤¢¤ë¡£ +(¤³¤ÎÊÑ¿ô¤Ï¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤ÇÀë¸À¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤¿¤À¤· libc4 ¤ä libc5 ¤Î¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤Ê¤é +.I +¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë¤·¡¢¤³¤ì¤¬ glibc ͳÍè¤Î¤â¤Î¤Ç¤â +.B _GNU_SOURCE +¤¬ define ¤µ¤ì¤Æ¤¤¤ì¤ÐÀë¸ÀºÑ¤ß¤È¤Ê¤ë)¡£ +¤³¤Îʸ»úÎóÇÛÎó¤Ï¡¢ +¥×¥í¥»¥¹¤òµ¯Æ°¤¹¤ë +.BR exec (3) +¤Ë¤è¤Ã¤Æ¡¢¤½¤Îµ¯Æ°¤µ¤ì¤¿¥×¥í¥»¥¹¤ÇÍøÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + +.\"O By convention the strings in +.\"O .I environ +.\"O have the form "\fIname\fP\fB=\fP\fIvalue\fP". +.\"O Common examples are: +ÄÌÎã¤Ç¤Ï¡¢ +.I environ +¤Îʸ»úÎó¤Ï "\fIname\fP\fB=\fP\fIvalue\fP" ¤È¤¤¤¦½ñ¼°¤ò¤È¤ë¡£ +¤è¤¯ÍѤ¤¤é¤ì¤ëÎã¤ò°Ê²¼¤Ë¼¨¤¹¡£ +.TP +.B USER +.\"O The name of the logged-in user (used by some BSD-derived programs). +¥æ¡¼¥¶¤Î¥í¥°¥¤¥ó̾ (BSD µ¯¸»¤Î¥×¥í¥°¥é¥à¤Ê¤É¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë)¡£ +.TP +.B LOGNAME +.\"O The name of the logged-in user (used by some System-V derived programs). +¥æ¡¼¥¶¤Î¥í¥°¥¤¥ó̾(System V µ¯¸»¤Î¥×¥í¥°¥é¥à¤Ê¤É¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë)¡£ +.TP +.B HOME +.\"O A user's login directory, set by +.\"O .BR login (1) +.\"O from the password file +.\"O .BR passwd (5). +¥æ¡¼¥¶¤Î¥í¥°¥¤¥ó¥Ç¥£¥ì¥¯¥È¥ê¡£ +.BR login (1) +¤¬¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë +.BR passwd (5) +¤«¤é¼èÆÀ¤·¤ÆÀßÄꤹ¤ë¡£ +.TP +.B LANG +.\"O The name of a locale to use for locale categories when not overridden +.\"O by \fBLC_ALL\fP or more specific environment variables like +.\"O \fBLC_COLLATE\fP, \fBLC_CTYPE\fP, \fBLC_MESSAGES\fP, \fBLC_MONETARY\fP, +.\"O \fBLC_NUMERIC\fP, \fBLC_TIME\fP, cf. +.\"O .BR locale (5). +¥í¥±¡¼¥ë¤Î³Æ¥«¥Æ¥´¥ê¤Ç»ÈÍѤµ¤ì¤ë¥í¥±¡¼¥ë¤Î̾Á°¡£\fBLC_ALL\fP ¤ä¡¢ +¤è¤ê¶¹¤¤ÈϰϤòÂоݤȤ¹¤ë´Ä¶­ÊÑ¿ô +.RB ( LC_COLLATE , +.BR LC_CTYPE , +.BR LC_MESSAGES , +.BR LC_MONETARY , +.BR LC_NUMERIC , +.B LC_TIME +¤Ê¤É) +¤Ë¤è¤Ã¤Æ¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +.BR locale (5) +¤ò¸«¤è¡£ +.TP +.B PATH +.\"O The sequence of directory prefixes that +.\"O .BR sh (1) +.\"O and many other +.\"O programs apply in searching for a file known by an incomplete pathname. +.\"O The prefixes are separated by \(aq\fB:\fP\(aq. +.\"O (Similarly one has \fBCDPATH\fP used by some shells to find the target +.\"O of a change directory command, \fBMANPATH\fP used by +.\"O .BR man (1) +.\"O to +.\"O find manual pages, etc.) +.BR sh (1) +¤ä¾¤Î¥×¥í¥°¥é¥à¤¬¡¢¥Õ¥ë¥Ñ¥¹¤ÇÍ¿¤¨¤é¤ì¤Ê¤«¤Ã¤¿¼Â¹Ô¥Õ¥¡¥¤¥ë¤ò¸¡º÷¤¹¤ë¤È¤­¡¢ +¥Õ¥¡¥¤¥ë̾¤ËÁ°ÃÖ¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÎÇÛÎó¡£ +³Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ï \(aq\fB:\fP\(aq ¤Ë¤è¤Ã¤Æ¶èÀÚ¤é¤ì¤ë¡£ +(Ʊ¤¸¤è¤¦¤Ê¤â¤Î¤Ë¡¢ +¥·¥§¥ë¤¬¥Ç¥£¥ì¥¯¥È¥êÊѹ¹¥³¥Þ¥ó¥É¤ÎÊѹ¹Àè¤òõ¤¹¤¿¤á¤ËÍѤ¤¤ë +\fBCDPATH\fP ¤ä¡¢ +.BR man (1) +¤¬¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¸¡º÷¤ËÍѤ¤¤ë \fBMANPATH\fP ¤Ê¤É¤¬¤¢¤ë¡£) +.TP +.B PWD +.\"O The current working directory. +.\"O Set by some shells. +¸½ºß¤Î¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¡£¤¤¤¯¤Ä¤«¤Î¥·¥§¥ë¤¬ÀßÄꤹ¤ë¡£ +.TP +.B SHELL +.\"O The pathname of the user's login shell. +¥æ¡¼¥¶¡¼¤Î¥í¥°¥¤¥ó¥·¥§¥ë¤Î¥Ñ¥¹Ì¾¡£ +.TP +.B TERM +.\"O The terminal type for which output is to be prepared. +üËö¤Î¼ïÎà¡£½ÐÎϤϤ³¤ì¤Ë¤¢¤ï¤»¤ÆÍÑ°Õ¤µ¤ì¤ë¡£ +.TP +.B PAGER +.\"O The user's preferred utility to display text files. +¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤òɽ¼¨¤¹¤ë¥æ¡¼¥Æ¥ê¥Æ¥£¡£¥æ¡¼¥¶¡¼¤¬¹¥¤ß¤Î¤â¤Î¤òÀßÄꤹ¤ë¡£ +.TP +.BR EDITOR / VISUAL +.\"O The user's preferred utility to edit text files. +¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤¹¤ë¥æ¡¼¥Æ¥ê¥Æ¥£¡£¥æ¡¼¥¶¡¼¤¬¹¥¤ß¤Î¤â¤Î¤òÀßÄꤹ¤ë¡£ +.\" .TP +.\" .B BROWSER +.\"O .\" The user's preferred utility to browse URLs. Sequence of colon-separated +.\"O .\" browser commands. See http://www.catb.org/~esr/BROWSER/ . +.\" URL ¤Î±ÜÍ÷¤ËÍѤ¤¤ë¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡£¥æ¡¼¥¶¡¼¤¬¹¥¤ß¤Î¤â¤Î¤òÀßÄꤹ¤ë¡£ +.\" ¥³¥í¥ó¤Ç¶èÀڤäƥ֥饦¥¶¥³¥Þ¥ó¥É¤òʤ٤롣 +.\" http://www.catb.org/~esr/BROWSER/ ¤ò¸«¤è¡£ +.PP +.\"O Further names may be placed in the environment by the \fIexport\fP +.\"O command and "name=value" in +.\"O .BR sh (1), +.\"O or by the \fIsetenv\fP command if you use +.\"O .BR csh (1). +.\"O Arguments may also be placed in the +.\"O environment at the point of an +.\"O .BR exec (3). +.\"O A C program can manipulate its environment using the functions +.\"O .BR getenv (3), +.\"O .BR putenv (3), +.\"O .BR setenv (3), +.\"O and +.\"O .BR unsetenv (3). +´Ä¶­¤Ë̾Á°¤òÄɲ乤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR sh (1) +¤Ç¤Ï \fIexport\fP ¥³¥Þ¥ó¥É¤È "name=value" ¤ò»ÈÍѤ¹¤ë¡£ +.BR csh (1) +¤Ç¤Ï \fIsetenv\fP ¥³¥Þ¥ó¥É¤ò»ÈÍѤ¹¤ë¡£ +.BR exec (3) +¤Î°ú¿ô¤È¤·¤Æ¤â´Ä¶­¤òÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +C ¥×¥í¥°¥é¥à¤«¤é¤Ï¡¢ +.BR getenv (3), +.BR putenv (3), +.BR setenv (3), +.BR unsetenv (3) +¤Ê¤É¤Î´Ø¿ô¤òÍѤ¤¤Æ´Ä¶­¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O Note that the behavior of many programs and library routines is +.\"O influenced by the presence or value of certain environment variables. +.\"O A random collection: +¥×¥í¥°¥é¥à¤ä¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó¤Î¿¤¯¤Ï¡¢¤½¤ì¤¾¤ìŬÅö¤Ê´Ä¶­ÊÑ¿ô¤Î¸ºß +¤äÃͤˤè¤Ã¤Æ¡¢Æ°ºî¤Ë±Æ¶Á¤ò¼õ¤±¤ë¤³¤È¤¬¤¢¤ë¡£°Ê²¼¡¢Å¬µ¹µó¤²¤Æ¤ß¤è¤¦¡£ +.LP +.\"O The variables +.\"O .BR LANG ", " LANGUAGE ", " NLSPATH ", " LOCPATH ", " +.\"O .BR LC_ALL ", " LC_MESSAGES ", " +.\"O etc. influence locale handling, cf. +.\"O .BR locale (5). +.BR LANG ", " LANGUAGE ", " NLSPATH ", " LOCPATH ", " +.BR LC_ALL ", " LC_MESSAGES ", " +¤Ê¤É¤ÎÊÑ¿ô¡£¥í¥±¡¼¥ë¤Î°·¤¤¤Ë±Æ¶Á¤¹¤ë¡£ +.BR locale (5) +¤ò¸«¤è¡£ +.LP +.\"O .B TMPDIR +.\"O influences the path prefix of names created by +.\"O .BR tmpnam (3) +.\"O and other routines, the temporary directory used by +.\"O .BR sort (1) +.\"O and other programs, etc. +.B TMPDIR +¤Ï +.BR tmpnam (3) +¤Ê¤É¤Î¥ë¡¼¥Á¥ó¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤ë¥Õ¥¡¥¤¥ë̾¤ËÁ°ÃÖ¤µ¤ì¤ë¥Ñ¥¹¤Ë±Æ¶Á¤¹¤ë¡£¤Þ¤¿ +.BR sort (1) +¤Î°ì»þ¥Ç¥£¥ì¥¯¥È¥ê¤ËÍѤ¤¤é¤ì¤¿¤ê¡¢Â¾¤Î¥×¥í¥°¥é¥à¤«¤é¤âÍøÍѤµ¤ì¤ë¡£ +.LP +.\"O .BR LD_LIBRARY_PATH ", " LD_PRELOAD +.\"O and other LD_* variables influence +.\"O the behavior of the dynamic loader/linker. +.BR LD_LIBRARY_PATH ", " LD_PRELOAD +¤Ê¤É¤Î LD_* ÊÑ¿ô¤Ï¥À¥¤¥Ê¥ß¥Ã¥¯¥í¡¼¥À¡¦¥ê¥ó¥«¤ÎÆ°ºî¤Ë±Æ¶Á¤¹¤ë¡£ +.LP +.\"O .B POSIXLY_CORRECT +.\"O makes certain programs and library routines follow +.\"O the prescriptions of POSIX. +.B POSIXLY_CORRECT +¤¬»ØÄꤵ¤ì¤ë¤È¡¢¤¢¤ë¼ï¤Î¥×¥í¥°¥é¥à¤ä¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó¤Ï +POSIX ¤Îµ¬Äê¤Ë½¾¤¦¤è¤¦¤Ë¤Ê¤ë¡£ +.LP +.\"O The behavior of +.\"O .BR malloc (3) +.\"O is influenced by +.\"O .B MALLOC_* +.\"O variables. +.BR malloc (3) +¤ÎÆ°ºî¤Ï +.B MALLOC_* +ÊÑ¿ô¤Ë¤è¤Ã¤Æ±Æ¶Á¤µ¤ì¤ë¡£ +.LP +.\"O The variable +.\"O .B HOSTALIASES +.\"O gives the name of a file containing aliases +.\"O to be used with +.\"O .BR gethostbyname (3). +.B HOSTALIAS +ÊÑ¿ô¤Ï¡¢ +.BR gethostbyname (3) +¤¬ÍѤ¤¤ë¥¨¥¤¥ê¥¢¥¹¤¬½ñ¤«¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë̾¤òÍ¿¤¨¤ë¡£ +.LP +.\"O .BR TZ " and " TZDIR +.\"O give timezone information used by +.\"O .BR tzset (3) +.\"O and through that by functions like +.\"O .BR ctime (3), +.\"O .BR localtime (3), +.\"O .BR mktime (3), +.\"O .BR strftime (3). +.\"O See also +.\"O .BR tzselect (8). +.BR TZ " ¤È " TZDIR +¤Ï +.BR tzset (3) +¤ª¤è¤Ó¡¢¤³¤Î´Ø¿ô¤ò»È¤¦ +.BR ctime (3), +.BR localtime (3), +.BR mktime (3), +.BR strftime (3) +¤È¤¤¤Ã¤¿´Ø¿ô¤ÇÍѤ¤¤é¤ì¤ë¥¿¥¤¥à¥¾¡¼¥ó¤Î¾ðÊó¤òÍ¿¤¨¤ë¡£ +.BR tzselect (8) +¤â»²¾È¤Î¤³¤È¡£ +.LP +.\"O .B TERMCAP +.\"O gives information on how to address a given terminal +.\"O (or gives the name of a file containing such information). +.B TERMCAP +¤Ï¡¢¸½ºß¤ÎüËö¾ðÊó¤Î¼èÆÀÀè +(¤¢¤ë¤¤¤Ï¤½¤Î¤è¤¦¤Ê¾ðÊ󤬽ñ¤«¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë̾) ¤òÍ¿¤¨¤ë¡£ +.LP +.\"O .BR COLUMNS " and " LINES +.\"O tell applications about the window size, possibly overriding the actual size. +.BR COLUMNS " ¤È " LINES +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¥¦¥¤¥ó¥É¥¦¤Î¥µ¥¤¥º¤òÅÁ¤¨¤ë¡£ +¼ÂºÝ¤Î¥µ¥¤¥º¤È¤Ï°ã¤¦ÃͤòÍ¿¤¨¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.LP +.\"O .BR PRINTER " or " LPDEST +.BR PRINTER " ¤Þ¤¿¤Ï " LPDEST +.\"O may specify the desired printer to use. +.\"O See +.\"O .BR lpr (1). +ÍѤ¤¤¿¤¤¥×¥ê¥ó¥¿¤ò»ØÄꤹ¤ë¡£ +.BR lpr (1) +¤ò»²¾È¤Î¤³¤È¡£ +.LP +.\"O Etc. +¤Ê¤É¤Ê¤É... +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Clearly there is a security risk here. +.\"O Many a system command has been +.\"O tricked into mischief by a user who specified unusual values for +.\"O .BR IFS " or " LD_LIBRARY_PATH . +¤³¤ì¤é¤ÎÃæ¤Ë¤Ï¡¢ÌÀ¤é¤«¤Ë¥»¥­¥å¥ê¥Æ¥£¾å¤Î´í¸±¤¬Â¸ºß¤¹¤ë¡£ +¥æ¡¼¥¶¡¼¤¬ +.BR IFS " ¤ä " LD_LIBRARY_PATH +¤Ë°Û¾ï¤ÊÃͤòÍ¿¤¨¤¿¤³¤È¤Ë¤è¤Ã¤Æ¡¢ +¤³¤ì¤Þ¤Ç¿¤¯¤Î¥·¥¹¥Æ¥à¥³¥Þ¥ó¥É¤¬¤À¤Þ¤µ¤ì¤Æ¡¢ +¥·¥¹¥Æ¥à¤ò¤Ò¤É¤¤Ìܤˤ¢¤ï¤»¤Æ¤­¤¿¡£ + +.\"O There is also the risk of name space pollution. +.\"O Programs like +.\"O .I make +.\"O and +.\"O .I autoconf +.\"O allow overriding of default utility names from the +.\"O environment with similarly named variables in all caps. +.\"O Thus one uses +.\"O .B CC +.\"O to select the desired C compiler (and similarly +.\"O .BR MAKE , +.\"O .BR AR , +.\"O .BR AS , +.\"O .BR FC , +.\"O .BR LD , +.\"O .BR LEX , +.\"O .BR RM , +.\"O .BR YACC , +.\"O etc.). +̾Á°¶õ´Ö¤¬±øÀ÷¤µ¤ì¤ë´í¸±À­¤â¸ºß¤¹¤ë¡£ +.I make +¤ä +.I autoconf +¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ò +´Ä¶­¤Ë¤¢¤ë»÷¤¿¤è¤¦¤Ê̾Á°¤ÎÊÑ¿ô¤Ç¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +(Ä̾ï¤Ï¤¹¤Ù¤ÆÂçʸ»ú¤ÎÊÑ¿ô¤òÍѤ¤¤ë)¡£ +¤¹¤Ê¤ï¤Á¡¢ÍøÍѤ·¤¿¤¤ C ¥³¥ó¥Ñ¥¤¥é¤Ï +.B CC +¤ÇÁªÂò¤Ç¤­¤ë¡£¤Þ¤¿Æ±ÍÍ¤Ë +.BR MAKE , +.BR AR , +.BR AS , +.BR FC , +.BR LD , +.BR LEX , +.BR RM , +.B YACC +¤Ê¤É¤âÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O However, in some traditional uses such an environment variable +.\"O gives options for the program instead of a pathname. +.\"O Thus, one has +.\"O .BR MORE , +.\"O .BR LESS , +.\"O and +.\"O .BR GZIP . +.\"O Such usage is considered mistaken, and to be avoided in new +.\"O programs. +.\"O The authors of +.\"O .I gzip +.\"O should consider renaming their option to +.\"O .BR GZIP_OPT . +¤È¤³¤í¤¬°ìÊý¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤ÊÊÑ¿ô¤ò +(¥Ñ¥¹Ì¾¤Ç¤Ï¤Ê¤¯) +¥×¥í¥°¥é¥à¤ËÂФ¹¤ë¥ª¥×¥·¥ç¥ó¤È¤·¤Æ°·¤¦¤è¤¦¤Êήµ·¤â¸ºß¤·¤Æ¤­¤¿¡£ +Î㤨¤Ð +.BR MORE , +.BR LESS , +.B GZIP +¤Ê¤É¤¬¤½¤¦¤Ç¤¢¤ë¡£ +¤³¤Î¤è¤¦¤ÊÍøÍÑË¡¤Ï´Ö°ã¤Ã¤Æ¤¤¤ë¤È¹Í¤¨¤ë¤Ù¤­¤Ç¡¢ +¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.I gzip +¤Îºî¼Ô¤¿¤Á¤Ï¡¢¥ª¥×¥·¥ç¥ó¤òÍ¿¤¨¤ë´Ä¶­ÊÑ¿ô¤ò +.B GZIP_OPT +¤Ë²þ̾¤¹¤ë¤³¤È¤ò¹Í¤¨¤ë¤Û¤¦¤¬¤è¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR bash (1), +.BR csh (1), +.BR login (1), +.BR sh (1), +.BR tcsh (1), +.BR execve (2), +.BR clearenv (3), +.BR exec (3), +.BR getenv (3), +.BR putenv (3), +.BR setenv (3), +.BR unsetenv (3), +.BR locale (5) diff --git a/draft/man7/epoll.7 b/draft/man7/epoll.7 new file mode 100644 index 00000000..907f0c59 --- /dev/null +++ b/draft/man7/epoll.7 @@ -0,0 +1,949 @@ +.\" +.\" 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 +.\" +.\" 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 +.SH ̾Á° +.\"O epoll \- I/O event notification facility +epoll \- I/O ¥¤¥Ù¥ó¥ÈÄÌÃε¡Ç½ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.\"O .SH DESCRIPTION +.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 +¥¤¥ó¥¹¥¿¥ó¥¹¤ÎºîÀ®¤ä´ÉÍý¤ò¹Ô¤¦¤¿¤á¤Ë +°Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë: +.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) +¤Îµ¡Ç½¤¬³ÈÄ¥¤µ¤ì¤Æ¤¤¤ë)¡£ +.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 +½¸¹ç¤È¸Æ¤Ð¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +.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 +.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) ¤È¤·¤Æ¤âÆ°ºî¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Æó¤Ä¤ÎÇÛÁ÷µ¡¹½¤Î°ã¤¤¤Ï¡¢¼¡¤Î¤è¤¦¤ËÀâÌÀ¤Ç¤­¤ë¡£ +¤³¤Î¤è¤¦¤Ê¥·¥Ê¥ê¥ª¤¬µ¯¤³¤Ã¤¿¤È¤·¤è¤¦: +.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 +¥¤¥ó¥¹¥¿¥ó¥¹¤ËÅÐÏ¿¤µ¤ì¤ë¡£ +.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 +¤¬Ê֤롣 +.IP 4. +.\"O The pipe reader reads 1 kB of data from +.\"O .IR rfd . +¥Ñ¥¤¥×¤«¤éÆɤ߽Ф¹¥×¥í¥°¥é¥à¤¬¡¢1 kB ¤Î¥Ç¡¼¥¿¤ò +.I rfd +¤«¤éÆɤ߽Ф¹¡£ +.IP 5. +.\"O A call to +.\"O .BR epoll_wait (2) +.\"O is done. +.BR epoll_wait (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) +¤Î¸Æ¤Ó½Ð¤·¤¬ +̵´ü¸Â¤ËÄä»ß (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 ) +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤È¤·¤Æ»È¤¦¤¿¤á¤ËÄó°Æ¤µ¤ì¤ëÊýË¡¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.RS +.TP 4 +.B i +.\"O with nonblocking file descriptors; and +¥Ö¥í¥Ã¥¯¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤È¶¦¤Ë»È¤¦¡£ +.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 +¤òÊÖ¤·¤¿¸å¤Ç¤Î¤ß¡¢¥¤¥Ù¥ó¥È¤òÂԤġ£ +.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) +¤¬»È¤ï¤ì¤Æ¤¤¤ë¤È¤³¤í¤Ç¤Ï¤É¤³¤Ç¤â»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"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 +¤ò»ØÄꤷ¤Æ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òºÆÅÙ»ÈÍѤǤ­¤ë¤è¤¦¤Ë¤¹¤ë¤Î¤Ï¡¢ +¸Æ¤Ó½Ð¤·Â¦¤ÎÀÕǤ¤Ç¤¢¤ë¡£ +.\"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 +.\" 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 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +.\" 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 +.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) +¤ò·Ñ³¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.in +4n +.nf +#define MAX_EVENTS 10 +struct epoll_event ev, events[MAX_EVENTS]; +int listen_sock, conn_sock, nfds, epollfd; + +/* Set up listening socket, \(aqlisten_sock\(aq (socket(), + bind(), listen()) */ + +epollfd = epoll_create(10); +if (epollfd == \-1) { + perror("epoll_create"); + exit(EXIT_FAILURE); +} + +ev.events = EPOLLIN; +ev.data.fd = listen_sock; +if (epoll_ctl(epollfd, EPOLL_CTL_ADD, listen_sock, &ev) == \-1) { + perror("epoll_ctl: listen_sock"); + exit(EXIT_FAILURE); +} + +for (;;) { + nfds = epoll_wait(epollfd, events, MAX_EVENTS, \-1); + if (nfds == \-1) { + perror("epoll_pwait"); + exit(EXIT_FAILURE); + } + + for (n = 0; n < nfds; ++n) { + if (events[n].data.fd == listen_sock) { + conn_sock = accept(listen_sock, + (struct sockaddr *) &local, &addrlen); + if (conn_sock == \-1) { + perror("accept"); + exit(EXIT_FAILURE); + } + setnonblocking(conn_sock); + ev.events = EPOLLIN | EPOLLET; + ev.data.fd = conn_sock; + if (epoll_ctl(epollfd, EPOLL_CTL_ADD, conn_sock, + &ev) == \-1) { + perror("epoll_ctl: conn_sock"); + exit(EXIT_FAILURE); + } + } else { + do_use_fd(events[n].data.fd); + } + } +} +.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 +¤ÎϢ³Ū¤ÊÀÚ¤êÂؤ¨¤¬Èò¤±¤é¤ì¤ë¡£ +.\"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 +¤Ê¤É)¡£ +.\" 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 +.\" cannot add the duplicate file descriptor to the epoll set. (In every +.\" other case that I can think of, descriptors duplicated by fork have +.\" similar semantics to descriptors duplicated by dup() and friends.) On +.\" the other hand, the very fact that the child has a duplicate of the +.\" descriptor means that even if the parent closes its descriptor, then +.\" epoll_wait() in the parent will continue to receive notifications for +.\" that descriptor because of the duplicated descriptor in the child. +.\" +.\" See http://thread.gmane.org/gmane.linux.kernel/596462/ +.\" "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 +¥Þ¥¹¥¯¤ÇÅÐÏ¿¤¹¤ì¤Ð¡¢¥¤¥Ù¥ó¥È¤ò¥Õ¥£¥ë¥¿¥ê¥ó¥°¤¹¤ë¤Î¤Ë +¤³¤Îµ¡Ç½¤ÏÍ­ÍѤʼêË¡¤Ç¤¢¤ë¡£ +.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 +.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 () +.\"O .BR EPOLL_CTL_DEL ). +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.B epoll +½¸¹ç¤«¤éºï½ü¤µ¤ì¤ë¤Î¤Ï¡¢Âбþ¤¹¤ë¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¤ò»²¾È¤·¤Æ¤¤¤ë +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿¸å¤Ç¤¢¤ë +.RB ( epoll_ctl () +.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 +.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 +.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 +.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. +¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¤¤¤Ä¤É¤Î¤è¤¦¤Ë»È¤¦¤«¤Ï¡¢ +Á´¤¯¥æ¡¼¥¶¤ËǤ¤µ¤ì¤Æ¤ë¡£ +.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 ¤ò¹Ô¤¦¤³¤È¤Ç¤¢¤ë¡£ +.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) +¤ò»È¤Ã¤Æ½ñ¤­¹þ¤ß¤ò¤¹¤ë¤È¤­¤â¡¢Æ±¤¸¤³¤È¤¬¸À¤¨¤ë +(´Æ»ë¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¾ï¤Ë¥¹¥È¥ê¡¼¥à»Ø¸þ¤Î¥Õ¥¡¥¤¥ë¤ò +»²¾È¤·¤Æ¤¤¤ë¤³¤È¤òÊݾڤǤ­¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¸å¼Ô¤Î¼êË¡¤Î»ÈÍѤòÈò¤±¤ë¤³¤È)¡£ +.\"O .SS Possible Pitfalls and Ways to Avoid Them +.SS ¤¢¤ê¤¬¤Á¤ÊÍî¤È¤··ê¤È²óÈòÊýË¡ +.TP +.\"O .B o Starvation (edge-triggered) +.B o µ²²î (starvation) (¥¨¥Ã¥¸¥È¥ê¥¬) +.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 +¤Ë¸ÇÍ­¤Î¤â¤Î¤Ç¤Ï¤Ê¤¤)¡£ +.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 ¥¤¥Ù¥ó¥È¥­¥ã¥Ã¥·¥å¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç +.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) +¤¹¤ë¤È¡¢¥¤¥Ù¥ó¥È¥­¥ã¥Ã¥·¥å¤Ï¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÂԤĥ¤¥Ù¥ó¥È¤¬ +¸ºß¤¹¤ë¤È¤¤¤Ã¤Æ¡¢º®Í𤬵¯¤­¤ë¡£ +.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 +.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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR epoll_create (2), +.BR epoll_create1 (2), +.BR epoll_ctl (2), +.BR epoll_wait (2) diff --git a/draft/man7/feature_test_macros.7 b/draft/man7/feature_test_macros.7 new file mode 100644 index 00000000..1e888e20 --- /dev/null +++ b/draft/man7/feature_test_macros.7 @@ -0,0 +1,913 @@ +.\" 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 2009-12-13 "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. +.\"O This can be 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. +µ¡Ç½¸¡ºº¥Þ¥¯¥í (feature test macro) ¤Ë¤è¤ê¡¢¥×¥í¥°¥é¥Þ¤Ï +¥×¥í¥°¥é¥à¤¬¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤ëºÝ¤Ë¥·¥¹¥Æ¥à¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ë¤è¤ê +¸ø³«¤µ¤ì¤ëÄêµÁ¤òÀ©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Îµ¡Ç½¤ò»È¤¦¤È¡¢Èóɸ½à¤ÎÄêµÁ¤¬¸ø³«¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤Ç¤­¡¢ +°Ü¿¢À­¤Î¤¢¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òºîÀ®¤¹¤ë¤Î¤ËÌòΩ¤Ä¡£ +¾¤Î¥Þ¥¯¥í¤ò»È¤¦¤È¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¸ø³«¤µ¤ì¤Ê¤¤Èóɸ½à¤ÎÄêµÁ¤ò +¸ø³«¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°Ê²¼¤ÇÀâÌÀ¤¹¤ëµ¡Ç½¸¡ºº¥Þ¥¯¥í¤Î¤½¤ì¤¾¤ì¤ÎÀµ³Î¤Ê±Æ¶Á¤ò³Îǧ¤¹¤ë¤Ë¤Ï¡¢ +¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.I +¤òÄ´¤Ù¤ì¤Ð¤è¤¤¡£ + +.\"O In order to be effective, a feature test macro +.\"O .IR "must be defined before including any header files" . +.\"O This can either be done 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 .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 chmod (2) +.\"O manual page): +´Ø¿ô¤¬µ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÄêµÁ¤òɬÍפȤ¹¤ë¾ì¹ç¡¢ +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î½ñ¼° (SYNOPSIS) ¤ÎÀá¤Ë +°Ê²¼¤Î·Á¼°¤ÎÃí¼á¤òÆþ¤ì¤ë +(°Ê²¼¤ÎÎã¤Ï +.BR chmod (2) +¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤«¤é¤Î°úÍѤǤ¢¤ë)¡£ +.RS +.sp +.B #include +.sp +.BI "int chmod(const char *" path ", mode_t " mode ); +.br +.BI "int fchmod(int " fd ", mode_t " mode ); +.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 fchmod (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.RE +.PP +.\"O The \fB||\fP means that in order to obtain the declaration of +.\"O .BR fchmod (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 fchmod (2) +¤ÎÄêµÁ¤ò +.I +¤«¤éÆÀ¤ë¤Ë¤Ï¡¢°Ê²¼¤Î¥Þ¥¯¥í¤ÎÄêµÁ¤Î¤¤¤º¤ì¤«¤ò¡¢¤É¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î +¥¤¥ó¥¯¥ë¡¼¥É¤è¤ê¤âÁ°¤Ç¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.RS +.nf + +#define _BSD_SOURCE +#define _XOPEN_SOURCE 500 /* 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=500 # 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 backwards 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/fifo.7 b/draft/man7/fifo.7 new file mode 100644 index 00000000..efed3240 --- /dev/null +++ b/draft/man7/fifo.7 @@ -0,0 +1,116 @@ +.\" This man page is Copyright (C) 1999 Claus Fischer. +.\" 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. +.\" +.\" 990620 - page created - aeb@cwi.nl +.\" +.\" FIXME . Add example programs to this page? +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Wed Jan 5 23:35:27 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH FIFO 7 2008-12-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +fifo \- ÀèÆþÀè½ÐÆüì¥Õ¥¡¥¤¥ë¡¢Ì¾Á°ÉÕ¤­¥Ñ¥¤¥× +.\"O .SH DESCRIPTION +.SH ½ñ¼° +.\"O A FIFO special file (a named pipe) is similar to a pipe, +.\"O except that it is accessed as part of the file system. +.\"O It can be opened by multiple processes for reading or +.\"O writing. +.\"O When processes are exchanging data via the FIFO, +.\"O the kernel passes all data internally without writing it +.\"O to the file system. +.\"O Thus, the FIFO special file has no +.\"O contents on the file system; the file system entry merely +.\"O serves as a reference point so that processes can access +.\"O the pipe using a name in the file system. +FIFO Æüì¥Õ¥¡¥¤¥ë(̾Á°ÉÕ¤­¥Ñ¥¤¥×)¤Ï¥Ñ¥¤¥×¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î°ìÉô¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ëÅÀ¤¬°Û¤Ã¤Æ¤¤¤ë¡£ +Ê£¿ô¤Î¥×¥í¥»¥¹¤¬Æɤ߹þ¤ß¤ä½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤¹¤ë¤³¤È +¤¬¤Ç¤­¤ë¡£¥×¥í¥»¥¹¤¬ FIFO ¤òÄ̤·¥Ç¡¼¥¿¤ò¸ò´¹¤¹¤ë¾ì¹ç¡¢ +¼ÂºÝ¤Ë¤½¤ì¤ò¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤Ï½ñ¤­¹þ¤Þ¤º¡¢¥«¡¼¥Í¥ë¤ÏÁ´¤Æ¤Î +¥Ç¡¼¥¿¤òÆâÉôŪ¤ËÅϤ¹¡£¤³¤Î¤è¤¦¤Ë¡¢FIFO Æüì¥Õ¥¡¥¤¥ë¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +¾å¤Ë¤ÏÆâÍƤò»ý¤¿¤Ê¤¤¤Î¤Ç¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¨¥ó¥È¥ê¤Ï +¥×¥í¥»¥¹¤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î̾Á°¤ò»ÈÍѤ·¤Æ¤½¤Î¥Ñ¥¤¥×¤Ë +¥¢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ë»²¾È¥Ý¥¤¥ó¥È¤òÄ󶡤·¤Æ¤¤¤ë¤Ë²á¤®¤Ê¤¤¡£ +.PP +.\"O The kernel maintains exactly one pipe object for each +.\"O FIFO special file that is opened by at least one process. +.\"O The FIFO must be opened on both ends (reading and writing) +.\"O before data can be passed. +.\"O Normally, opening the FIFO blocks +.\"O until the other end is opened also. +¥«¡¼¥Í¥ë¤Ï¡¢¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë +FIFO Æüì¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡¢¤½¤ì¤¾¤ì°ì¤Ä¤Î¥Ñ¥¤¥×¤Î¤ß¤ò´ÉÍý¤·¤Æ¤¤¤ë¡£ +¥Ç¡¼¥¿¤¬ÅϤµ¤ì¤ëÁ°¤Ë¤½¤Î FIFO ¤Îξü(½ñ¤­¹þ¤ß¤ÈÆɤ߽Ф·)¤¬¥ª¡¼¥×¥ó +¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£Ä̾FIFO ¤ò¥ª¡¼¥×¥ó¤¹¤ë¤È¡¢ +¤½¤ÎÈ¿ÂЦ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¤Þ¤ÇÄä»ß(block)¤µ¤»¤é¤ì¤ë¡£ +.PP +.\"O A process can open a FIFO in nonblocking mode. +.\"O In this +.\"O case, opening for read only will succeed even if no-one has +.\"O opened on the write side yet, opening for write only will +.\"O fail with +.\"O .B ENXIO +.\"O (no such device or address) unless the other +.\"O end has already been opened. +¥×¥í¥»¥¹¤Ï FIFO ¤òÈóÄä»ß(nonblocking)¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤Î¾ì¹ç¡¢Æɤ߹þ¤ßÀìÍѤǥª¡¼¥×¥ó¤·¤¿¾ì¹ç¤Ë¤Ï½ñ¤­¹þ¤ß¦¤òï¤â¥ª¡¼¥×¥ó +¤·¤Æ¤¤¤Ê¤¯¤Æ¤âÀ®¸ù¤¹¤ë¡£½ñ¤­¹þ¤ßÀìÍѤǥª¡¼¥×¥ó¤·¤¿¾ì¹ç¤ÏÈ¿ÂЦ¤¬´û¤Ë +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð +.B ENXIO +(¤½¤Î¤è¤¦¤Ê¥Ç¥Ð¥¤¥¹¤Þ¤¿¤Ï¥¢¥É¥ì¥¹¤Ï¸ºß¤·¤Ê¤¤) +¤È¤¤¤¦¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¡£ +.PP +.\"O Under Linux, opening a FIFO for read and write will succeed +.\"O both in blocking and nonblocking mode. +.\"O POSIX leaves this +.\"O behavior undefined. +.\"O This can be used to open a FIFO for +.\"O writing while there are no readers available. +.\"O A process +.\"O that uses both ends of the connection in order to communicate +.\"O with itself should be very careful to avoid deadlocks. +Linux ¤Ç¤Ï¡¢FIFO ¤òÆɤ߹þ¤ß¤È½ñ¤­¹þ¤ßξÍѤ˥ª¡¼¥×¥ó¤·¤¿¾ì¹ç¡¢ +Ää»ß¡¢ÈóÄä»ß¤Î¤É¤Á¤é¤Î¥â¡¼¥É¤Ç¤âÀ®¸ù¤¹¤ë¡£POSIX ¤Ç¤Ï¤³¤Î¾ì¹ç¤Î +Æ°ºî¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£¤³¤ì¤ÏÆɤ߹þ¤ß¦¤¬¤¤¤Ê¤¤»þ¤Ë½ñ¤­¹þ¤ßÍÑ¤Ë +¥ª¡¼¥×¥ó¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¼«Ê¬¼«¿È¤ÈÄÌ¿®¤¹¤ë¤¿¤á¤Ë +ξü¤ò»ÈÍѤ¹¤ë¥×¥í¥»¥¹¤Ï¥Ç¥Ã¥É¥í¥Ã¥¯¤òÈò¤±¤ë¤¿¤á¤ËÈó¾ï¤ËÃí°Õ¿¼¤¯ +¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O When a process tries to write to a FIFO that is not opened +.\"O for read on the other side, the process is sent a +.\"O .B SIGPIPE +.\"O signal. +¥×¥í¥»¥¹¤¬¡¢È¿ÂФÎÆɤ߹þ¤ß¦¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤ FIFO ¤ò +½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤·¤è¤¦¤È¤·¤¿¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¤Ë +.B SIGPIPE +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ + +.\"O FIFO special files can be created by +.\"O .BR mkfifo (3), +.\"O and are indicated by +.\"O .IR "ls \-l" +.\"O with the file type \(aqp\(aq. +FIFO Æüì¥Õ¥¡¥¤¥ë¤Ï +.BR mkfifo (3) +¤ÇºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢ +.IR "ls \-l" +¤Ç¤Ï¥Õ¥¡¥¤¥ë¼ïÊÌ \(aqp\(aq ¤Çɽ¼¨¤µ¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mkfifo (1), +.BR open (2), +.BR pipe (2), +.BR sigaction (2), +.BR signal (2), +.BR socketpair (2), +.BR mkfifo (3), +.BR pipe (7) diff --git a/draft/man7/futex.7 b/draft/man7/futex.7 new file mode 100644 index 00000000..fbfc78fa --- /dev/null +++ b/draft/man7/futex.7 @@ -0,0 +1,214 @@ +.\" This page is made available under the MIT license. +.\" +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.\" +.\" Japanese Version Copyright(C) 2003 Suzuki Takashi +.\" all rights reserved. +.\" Translated Fri Oct 24 10:37:10 JST 2003 +.\" by Suzuki Takashi. +.\" +.\"WORD: contend ¶¥¹ç¤¹¤ë +.\"WORD: sleep µ¯¾²ÂÔ¤Á¤¹¤ë +.\"WORD: wake µ¯¾²¤¹¤ë +.\"WORD: wake up µ¯¾²¤¹¤ë +.\" +.TH FUTEX 7 2002-12-31 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O futex \- Fast Userspace Locking +futex - ¹â®¥æ¡¼¥¶¶õ´Ö¥í¥Ã¥¯µ¡¹½ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.PP +.\"O The Linux kernel provides futexes ("Fast Userspace muTexes") +.\"O as a building block for fast userspace +.\"O locking and semaphores. +.\"O Futexes are very basic and lend themselves well for building higher level +.\"O locking abstractions such as POSIX mutexes. +Linux ¥«¡¼¥Í¥ë¤Ï¡¢¥æ¡¼¥¶¶õ´Ö¤Ç¹â®¤Ê¥í¥Ã¥¯µ¡¹½¤ä¥»¥Þ¥Õ¥©¤ò»ÈÍѤ¹¤ë¤¿¤á¤Î +´ðÁÃŪÍ×ÁǤȤ·¤Æ futex ("Fast Userspace muTexes"; ¹â®¥æ¡¼¥¶¶õ´Ö mutex) ¤ò +Ä󶡤·¤Æ¤¤¤ë¡£ +futex ¤ÏÈó¾ï¤Ë´ðËÜŪ¤Ê¤â¤Î¤Ç¡¢ POSIX mutex ¤Î¤è¤¦¤Ê¹âÅ٤ʥí¥Ã¥¯µ¡¹½¤Î³µÇ°¤ò +¹½ÃÛ¤¹¤ë¤Î¤ËÌòΩ¤Ã¤Æ¤¤¤ë¡£ +.PP +.\"O This page does not set out to document all design decisions +.\"O but restricts itself to issues relevant for +.\"O application and library development. +.\"O Most programmers will in fact not be using futexes directly but +.\"O instead rely on system libraries built on them, +.\"O such as the NPTL pthreads implementation. +¤³¤Î¥Ú¡¼¥¸¤Ï¤¹¤Ù¤Æ¤ÎÀß·×·èÄê¤òµ­½Ò¤¹¤ë¤è¤¦¤Ë¤Ï¤Ê¤Ã¤Æ¤ª¤é¤º¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ä¥é¥¤¥Ö¥é¥ê¤Î³«È¯¤Ë´Ø·¸¤¹¤ë¤³¤È¤¬¤é¤Ë¸Â¤Ã¤Æ¤¤¤ë¡£ +¼ÂºÝ¤Ë¤Ï¥×¥í¥°¥é¥Þ¤Î¿¤¯¤ÏľÀÜ¤Ï futex ¤ò°·¤ï¤Ê¤¤¤¬¡¢¤½¤ÎÂå¤ï¤ê +futex ¤Ë´ð¤Å¤¤¤Æ¹½ÃÛ¤µ¤ì¤¿¥·¥¹¥Æ¥à¥é¥¤¥Ö¥é¥ê (Î㤨¤Ð NPTL ¥¹¥ì¥Ã¥É) ¤Ë +°Í¸¤¹¤ë¤³¤È¤Ë¤Ê¤ë¤À¤í¤¦¡£ +.PP +.\"O A futex is identified by a piece of memory which can be +.\"O shared between different processes. +.\"O In these different processes, it need not have identical addresses. +.\"O In its bare form, a futex has semaphore semantics; +.\"O it is a counter that can be incremented and decremented atomically; +.\"O processes can wait for the value to become positive. +futex ¤Ï°Û¤Ê¤ë¥×¥í¥»¥¹´Ö¤Ç¶¦Í­¤¹¤ë¤³¤È¤Î¤Ç¤­¤ë¥á¥â¥êÊҤǼ±Ê̤µ¤ì¤ë¡£ +¤³¤ì¤é¤Î°Û¤Ê¤ë¥×¥í¥»¥¹¤Ç¤Ï¡¢Æ±¤¸¥¢¥É¥ì¥¹¤¬ÉÕÍ¿¤µ¤ì¤Æ¤¤¤ëɬÍפϤʤ¤¡£ +Íç¤Î»Ñ¤Ç¤Ï futex ¤Î¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤Ï¥»¥Þ¥Õ¥©¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +futex ¤ÏÉÔ²ÄʬÁàºî¤Ç (atomically) ¥¤¥ó¥¯¥ê¥á¥ó¥È¤·¤¿¤ê¥Ç¥¯¥ê¥á¥ó¥È¤·¤¿¤ê¤Ç¤­¤ë +¥«¥¦¥ó¥¿¤Ç¡¢¥×¥í¥»¥¹¤ÏÃͤ¬Àµ¤Ë¤Ê¤ë¤Î¤òÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O Futex operation is entirely userspace for the noncontended case. +.\"O The kernel is only involved to arbitrate the contended case. +.\"O As any sane design will strive for noncontention, +.\"O futexes are also optimized for this situation. +futex ¤ÎÁàºî¤Ï¡¢¶¥¹ç¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï´°Á´¤Ë¥æ¡¼¥¶¶õ´Ö¤Ç¹Ô¤Ê¤ï¤ì¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¶¥¹ç¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤ÎÃçºÛ¤Ë´ØÍ¿¤¹¤ë¤À¤±¤Ç¤¢¤ë¡£ +Îɼ±¤¢¤ëÀ߷פǤ϶¥¹ç¤¬µ¯¤³¤é¤Ê¤¤¤è¤¦ÅØÎϤ¹¤ë¤¬¡¢ +futex ¤â¶¥¹ç¾õÂ֤˴ؤ·¤ÆºÇŬ²½¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O In its bare form, a futex is an aligned integer which is +.\"O only touched by atomic assembler instructions. +.\"O Processes can share this integer using +.\"O .BR mmap (2), +.\"O via shared memory segments or because they share memory space, +.\"O in which case the application is commonly called multithreaded. +Íç¤Î»Ñ¤Ç¤Ï¡¢ futex ¤ÏÉÔ²Äʬ¤Ê¥¢¥»¥ó¥Ö¥êÌ¿Îá¤Ç¤Î¤ßÁàºî¤µ¤ì¤ë +¥¢¥é¥¤¥ó¥á¥ó¥È¤Î·¤Ã¤¿ int ·¿¤ÎÊÑ¿ô¤Ç¤¢¤ë¡£ +Ê£¿ô¤Î¥×¥í¥»¥¹¤Ï¤³¤Î int ·¿ÊÑ¿ô¤ò¡¢ +.BR mmap (2) +¤òÍѤ¤¤ë¤«¡¢ +¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤ò²ð¤¹¤ë¤«¡¢ +¥á¥â¥ê¶õ´Ö¤ò¶¦Í­¤¹¤ë (¤³¤Î¾ì¹ç¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï°ìÈÌŪ¤Ë¥Þ¥ë¥Á¡¦¥¹¥ì¥Ã¥É¤Ç¤¢¤ë¤È¸Æ¤Ð¤ì¤ë) ¤«ÊýË¡¤Ç¶¦Í­¤¹¤ë¡£ +.\"O .SS "Semantics" +.SS "¥»¥Þ¥ó¥Æ¥£¥¯¥¹" +.PP +.\"O Any futex operation starts in userspace, +.\"O but it may necessary to communicate with the kernel using the +.\"O .BR futex (2) +.\"O system call. +futex ¤ÎÁàºî¤Ï¤¹¤Ù¤Æ¥æ¡¼¥¶¶õ´Ö¤«¤é»Ï¤Þ¤ë¤¬¡¢É¬Íפ˱þ¤¸¤Æ +.BR futex (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍѤ¤¤Æ¥«¡¼¥Í¥ë¤ÈÄÌ¿®¤¹¤ë¡£ +.PP +.\"O To "up" a futex, execute the proper assembler instructions that +.\"O will cause the host CPU to atomically increment the integer. +.\"O Afterwards, check if it has in fact changed from 0 to 1, in which case +.\"O there were no waiters and the operation is done. +.\"O This is the noncontended case which is fast and should be common. +futex ¤ò "up" ¤¹¤ë¤Ë¤Ï¡¢ +¥Û¥¹¥È CPU ¤ËÂФ· int ·¿ÊÑ¿ô¤òÉÔ²ÄʬÁàºî¤Ç¥¤¥ó¥¯¥ê¥á¥ó¥È¤¹¤ë¤è¤¦¤Ê¡¢ +ŬÀڤʥ¢¥»¥ó¥Ö¥êÌ¿Îá¤ò¼Â¹Ô¤¹¤ë¡£ +¤½¤Î¤¢¤È¡¢¼ÂºÝ¤Ë 0 ¤«¤é 1 ¤ËÊѲ½¤·¤¿¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¡¢ +ÊѲ½¤·¤Æ¤¤¤ì¤ÐÂÔ¤Á¥×¥í¥»¥¹ (waiter) ¤Ï¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤ê¡¢Áàºî¤Ï´°Î»¤¹¤ë¡£ +¤³¤ì¤Ï¶¥¹ç¤Î¤Ê¤¤¾ì¹ç¤Ç¤¢¤ê¡¢¹â®¤Ç¤è¤¯µ¯¤³¤ë¤Ï¤º¤Ç¤¢¤ë¡£ +.PP +.\"O In the contended case, the atomic increment changed the counter +.\"O from \-1 (or some other negative number). +.\"O If this is detected, there are waiters. +.\"O Userspace should now set the counter to 1 and instruct the +.\"O kernel to wake up any waiters using the +.\"O .B FUTEX_WAKE +.\"O operation. +¶¥¹ç¤¬¤¢¤ë¾ì¹ç¡¢ÉÔ²ÄʬÁàºî¤Î¥¤¥ó¥¯¥ê¥á¥ó¥È¤Ç¥«¥¦¥ó¥¿¤Ï \-1 (¤Þ¤¿¤Ï¾¤ÎÉé¤Î¿ô) +¤«¤éÊѲ½¤¹¤ë¡£¤³¤ì¤¬¸¡½Ð¤µ¤ì¤ë¤È¡¢ÂÔ¤Á¥×¥í¥»¥¹¤¬¤¢¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +¥æ¡¼¥¶¶õ´Ö¤Ç¤Ï¥«¥¦¥ó¥¿¤ò 1 ¤ËÀßÄꤷ¡¢ +.B FUTEX_WAKE +¤òÍѤ¤¤Æ¥«¡¼¥Í¥ë¤ËÂÔ¤Á¥×¥í¥»¥¹¤ò wake (µ¯¾²) ¤µ¤»¤ë¤è¤¦»Ø¼¨¤¹¤ë¡£ +.PP +.\"O Waiting on a futex, to "down" it, is the reverse operation. +.\"O Atomically decrement the counter and check if it changed to 0, +.\"O in which case the operation is done and the futex was uncontended. +.\"O In all other circumstances, the process should set the counter to \-1 +.\"O and request that the kernel wait for another process to up the futex. +.\"O This is done using the +.\"O .B FUTEX_WAIT +.\"O operation. +futex ¤Î³ÍÆÀ¤òÂԤġ¢¤¹¤Ê¤ï¤Á futex ¤ò "down" ¤¹¤ë¤Ë¤ÏÈ¿ÂФÎÁàºî¤ò¹Ô¤Ê¤¦¡£ +ÉÔ²ÄʬÁàºî¤Ç¥«¥¦¥ó¥¿¤ò¥Ç¥¯¥ê¥á¥ó¥È¤·¡¢¥«¥¦¥ó¥¿¤¬ 0 ¤ËÊѲ½¤·¤¿¤«¤É¤¦¤«¤ò +¥Á¥§¥Ã¥¯¤¹¤ë¡£ÊѲ½¤·¤Æ¤¤¤ì¤ÐÁàºî¤Ï´°Î»¤· futex ¤Ï¶¥¹ç¤·¤Æ¤¤¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +0 ¤Ë¤Ê¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥×¥í¥»¥¹¤Ï¥«¥¦¥ó¥¿¤ò \-1 ¤ËÀßÄꤷ¡¢ +¾¤Î¥×¥í¥»¥¹¤¬¤½¤Î futex ¤ò up ¤¹¤ë¤Î¤òÂԤĤ褦¥«¡¼¥Í¥ë¤ËÍ׵ᤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤Ï +.B FUTEX_WAIT +¤ò¹Ô¤Ê¤¦¤³¤È¤Ç¼Â¸½¤µ¤ì¤ë¡£ +.PP +.\"O The +.\"O .BR futex (2) +.\"O system call can optionally be passed a timeout specifying how long +.\"O the kernel should +.\"O wait for the futex to be upped. +.\"O In this case, semantics are more complex and the programmer is referred +.\"O to +.\"O .BR futex (2) +.\"O for +.\"O more details. +.\"O The same holds for asynchronous futex waiting. +.BR futex (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤Ï¡¢¾Êά²Äǽ¤Ê°ú¿ô¤È¤·¤Æ¥¿¥¤¥à¥¢¥¦¥È¤òÅϤ¹¤³¤È¤¬¤Ç¤­¡¢ +¥«¡¼¥Í¥ë¤Ï¤½¤Î futex ¤¬ up ¤µ¤ì¤ë¤Î¤ò¤É¤ì¤¯¤é¤¤¤Î´ü´ÖÂԤĤ٤­¤«¤ò +»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤³¤Î¾ì¹ç¡¢¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤Ï¤â¤Ã¤ÈÊ£»¨¤Ë¤Ê¤ë¤¿¤á¡¢ +¤è¤ê¾ÜºÙ¤Ê¾ðÊó¤òÆÀ¤ë¤Ë¤Ï¥×¥í¥°¥é¥Þ¤Ï +.BR futex (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +Ʊ¤¸¥Ú¡¼¥¸¤ËÈóƱ´ü¤Î futex ÂÔ¤Á¤Ë¤Ä¤¤¤Æ¤âµ­¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "VERSIONS" +.SH ¥Ð¡¼¥¸¥ç¥ó +.PP +.\"O Initial futex support was merged in Linux 2.5.7 +.\"O but with different semantics from those described above. +.\"O Current semantics are available from Linux 2.5.40 onwards. +ºÇ½é¤Î futex Âбþ¤Ï Linux 2.5.7 ¤ÇÁȤ߹þ¤Þ¤ì¤¿¤¬¡¢ +¾åµ­¤Î¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤È¤Ï°Û¤Ê¤ë¡£ +¸½ºß¤Î¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤Ï Linux 2.5.40 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\"O .SH "NOTES" +.SH Ãí°Õ +.PP +.\"O To reiterate, bare futexes are not intended as an easy to use +.\"O abstraction for end-users. +.\"O Implementors are expected to be assembly literate and to have read +.\"O the sources of the futex userspace library referenced +.\"O below. +ºÆ¤Ó·«¤êÊÖ¤·¤Æ¤ª¤¯¤¬¡¢Íç¤Î futex ¤Ï¥¨¥ó¥É¥æ¡¼¥¶¤¬Íưפ˻Ȥ¨¤ë³µÇ°¤È¤·¤Æ +°Õ¿Þ¤µ¤ì¤¿¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +¼ÂÁõ¼Ô¤Ï¡¢¥¢¥»¥ó¥Ö¥ê¸À¸ì¤Ë´·¤ì¤Æ¤ª¤ê¡¢°Ê²¼¤Ëµó¤²¤ë futex ¥æ¡¼¥¶¶õ´Ö¥é¥¤¥Ö¥é¥ê¤Î +¥½¡¼¥¹¤òÆɤ߽ª¤¨¤Æ¤¤¤ë¤³¤È¤¬Í׵ᤵ¤ì¤ë¡£ +.PP +.\"O This man page illustrates the most common use of the +.\"O .BR futex (2) +.\"O primitives: it is by no means the only one. +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¤Ï +.BR futex (2) +¥×¥ê¥ß¥Æ¥£¥Ö¤ÎºÇ¤â°ìÈÌŪ¤Ê»ÈÍÑË¡¤¬ +µ­¤µ¤ì¤Æ¤¤¤ë¡£¤³¤ì¤Ï·è¤·¤ÆÍ£°ì¤Î»ÈÍÑË¡¤Ç¤Ï¤Ê¤¤¡£ +.\"O .\" .SH "AUTHORS" +.\" .SH Ãø¼Ô +.\" .PP +.\"O .\" Futexes were designed and worked on by Hubertus Franke +.\"O .\" (IBM Thomas J. Watson Research Center), +.\"O .\" Matthew Kirkwood, Ingo Molnar (Red Hat) and +.\"O .\" Rusty Russell (IBM Linux Technology Center). +.\"O .\" This page written by bert hubert. +.\" futex ¤Ï Hubertus Franke (IBM Thomas J. Watson Research Center) ¤È +.\" Matthew Kirkwood ¡¢ Ingo Molnar (Red Hat) ¡¢ +.\" Rusty Russell (IBM Linux Technology Center) ¤¬À߷פ·¡¢¸¡Æ¤¤·¤¿¡£ +.\" ¤³¤Î¥Ú¡¼¥¸¤Ï bert hubert ¤¬µ­¤·¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR futex (2) +.PP +.\"O .IR "Fuss, Futexes and Furwocks: Fast Userlevel Locking in Linux" +.\"O (proceedings of the Ottawa Linux Symposium 2002), +.\"O futex example library, futex-*.tar.bz2 +.\"O . +.IR "Fuss, Futexes and Furwocks: Fast Userlevel Locking in Linux" +(proceedings of the Ottawa Linux Symposium 2002), +futex ¤Î»ÈÍÑÎã¥é¥¤¥Ö¥é¥ê, futex-*.tar.bz2 +. diff --git a/draft/man7/glob.7 b/draft/man7/glob.7 new file mode 100644 index 00000000..1914fcd9 --- /dev/null +++ b/draft/man7/glob.7 @@ -0,0 +1,353 @@ +.\" Copyright (c) 1998 Andries Brouwer +.\" +.\" 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. +.\" +.\" 2003-08-24 fix for / by John Kristoff + joey +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Wed 12 Aug 1998 by NAKANO Takeo +.\" Updated 2003-09-28 by NAKANO Takeo +.\" +.\"WORD: wild card pattern ¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó +.\"WORD: character class ʸ»ú¥¯¥é¥¹ +.\"WORD: range Îΰè»ØÄê +.\"WORD: complementation Ê佸¹ç +.\"WORD: regular expression Àµµ¬É½¸½ +.\"WORD: bracket expression ¥Ö¥é¥±¥Ã¥Èɽ¸½ +.\"WORD: collating sequence ¾È¹ç½ç½ø +.\"WORD: collating element ¾È¹ç½ç½ø¤ÎÍ×ÁÇ +.\"WORD: current locale ¥«¥ì¥ó¥È¥í¥±¡¼¥ë +.\"WORD: equivalence class Åù²Á¥¯¥é¥¹ +.\" +.TH GLOB 7 2003-08-24 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O glob \- Globbing pathnames +glob \- ¥Ñ¥¹Ì¾¤ò glob ¤¹¤ë +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Long ago, in Unix V6, there was a program +.\"O .I /etc/glob +.\"O that would expand wildcard patterns. +.\"O Soon afterwards this became a shell built-in. +ÀΡ¹ Unix V6 ¤Ç¤Ï¡¢¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤òŸ³«¤¹¤ë +.I /etc/glob +¤È¸À¤¦¥×¥í¥°¥é¥à¤¬¤¢¤Ã¤¿¡£¤½¤Î¸å¤¹¤°¤Ë¡¢ +¤³¤Îµ¡Ç½¤Ï¥·¥§¥ë¤ËÁȤ߹þ¤Þ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ + +.\"O These days there is also a library routine +.\"O .BR glob (3) +.\"O that will perform this function for a user program. +º£Æü¤Ç¤Ï¡¢¤³¤Îµ¡Ç½¤ò¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤«¤é¤â¼Â¹Ô¤Ç¤­¤ë¤è¤¦¡¢ +.BR glob (3) +¤È¤¤¤¦¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó¤â¸ºß¤·¤Æ¤¤¤ë¡£ + +.\"O The rules are as follows (POSIX.2, 3.13). +glob ¤Îµ¬Â§¤ò°Ê²¼¤Ë½Ò¤Ù¤ë (POSIX.2 3.13)¡£ +.\"O .SS "Wildcard Matching" +.SS ¥ï¥¤¥ë¥É¥«¡¼¥É¥Þ¥Ã¥Á +.\"O A string is a wildcard pattern if it contains one of the +.\"O characters \(aq?\(aq, \(aq*\(aq or \(aq[\(aq. +.\"O Globbing is the operation +.\"O that expands a wildcard pattern into the list of pathnames +.\"O matching the pattern. +.\"O Matching is defined by: +ʸ»úÎó¤Ë \(aq?\(aq, \(aq*\(aq, \(aq[\(aq ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤È¡¢ +¤½¤ì¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤È¤ß¤Ê¤µ¤ì¤ë¡£ +¡Öglob ¤¹¤ë¡×¤È¤¤¤¦¤Î¤Ï¡¢¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤òŸ³«¤·¤Æ¡¢ +¤½¤Î¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹Ì¾¤Î¥ê¥¹¥È¤òÆÀ¤ë¤³¤È¤Ç¤¢¤ë¡£ +¥Þ¥Ã¥Á¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ + +.\"O A \(aq?\(aq (not between brackets) matches any single character. +(¥Ö¥é¥±¥Ã¥È³°Éô¤Î) \(aq?\(aq ¤Ï¤¢¤é¤æ¤ëñ°ì¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ + +.\"O A \(aq*\(aq (not between brackets) matches any string, +.\"O including the empty string. +(¥Ö¥é¥±¥Ã¥È³°Éô¤Î) \(aq*\(aq ¤Ï¤¢¤é¤æ¤ëʸ»úÎó¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +¶õʸ»úÎó (empty string) ¤Ë¤â¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +.\"O .B "Character classes" +.B "ʸ»ú¥¯¥é¥¹ (character class)" +.sp +.\"O An expression "\fI[...]\fP" where the first character after the +.\"O leading \(aq[\(aq is not an \(aq!\(aq matches a single character, +.\"O namely any of the characters enclosed by the brackets. +.\"O The string enclosed by the brackets cannot be empty; +.\"O therefore \(aq]\(aq can be allowed between the brackets, provided +.\"O that it is the first character. +.\"O (Thus, "\fI[][!]\fP" matches the +.\"O three characters \(aq[\(aq, \(aq]\(aq and \(aq!\(aq.) +"\fI[...]\fP" ¤È¸À¤¦É½µ­¤Ï¡¢ÀèƬ¤Î \(aq[\(aq ¤Ë³¤¯ºÇ½é¤Îʸ»ú¤¬ \(aq!\(aq ¤Ç +¤Ê¤±¤ì¤Ð¡¢¥Ö¥é¥±¥Ã¥È¤ÎÃæ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ëʸ»ú¤Î¤É¤ì¤«°ì¤Ä¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +¥Ö¥é¥±¥Ã¥È¤ÎÆâÉô¤Ë´Þ¤Þ¤ì¤ëʸ»úÎó¤Ï¶õ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ \(aq]\(aq ¤âºÇ½é¤Îʸ»ú¤Ë»ØÄꤹ¤ì¤Ð¥Ö¥é¥±¥Ã¥È¤ÎÆâÉô¤Ë´Þ¤á¤ë¤³¤È¤¬ +¤Ç¤­¤ë (¤Ä¤Þ¤ê "\fI[][!]\fP" ¤Ï \(aq[\(aq, \(aq]\(aq, \(aq!\(aq ¤Î +3 ʸ»ú¤Î¤É¤ì¤«¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡£ +.PP +.\"O .B Ranges +.B "Îΰè»ØÄê (range)" +.sp +.\"O There is one special convention: +.\"O two characters separated by \(aq\-\(aq denote a range. +.\"O (Thus, "\fI[A\-Fa\-f0\-9]\fP" +.\"O is equivalent to "\fI[ABCDEFabcdef0123456789]\fP".) +.\"O One may include \(aq\-\(aq in its literal meaning by making it the +.\"O first or last character between the brackets. +.\"O (Thus, "\fI[]\-]\fP" matches just the two characters \(aq]\(aq and \(aq\-\(aq, +.\"O and "\fI[\-\-0]\fP" matches the +.\"O three characters \(aq\-\(aq, \(aq.\(aq, \(aq0\(aq, since \(aq/\(aq +.\"O cannot be matched.) +Æüì¤Êɽµ­Ë¡¤¬°ì¤Ä¸ºß¤¹¤ë¡£\(aq\-\(aq ¤ò¶´¤àÆó¤Ä¤Îʸ»ú¤ÏÎΰè»ØÄê¤È¤Ê¤ë¡£ +(¤Ä¤Þ¤ê "\fI[A\-Fa\-f0\-9]\fP" ¤Ï "\fI[ABCDEFabcdef0123456789]\fP" +¤ÈÅù²Á¤È¤Ê¤ë¡£) \(aq\-\(aq ʸ»ú¤½¤Î¤â¤Î¤òÆþ¤ì¤¿¤¤¾ì¹ç¤Ï¡¢ +¥Ö¥é¥±¥Ã¥È¤ÎÀèƬ¤Þ¤¿¤ÏºÇ¸å¤Îʸ»ú¤Ë»ØÄꤹ¤ì¤Ð¤è¤¤¡£ +(¤Ä¤Þ¤ê "\fI[]\-]\fP" ¤ÏÆó¤Ä¤Îʸ»ú \(aq]\(aq ¤È \(aq\-\(aq +¤Ë¥Þ¥Ã¥Á¤·¡¢"\fI[\-\-0]\fP" ¤Ï \(aq\-\(aq, \(aq.\(aq, \(aq0\(aq ¤Î +3 ʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£¤³¤Î´Ö¤Î \(aq/\(aq ¤Ë¤Ï¥Þ¥Ã¥Á¤·¤Ê¤¤¡£¸å½Ò¤ò»²¾È¡£) +.PP +.\"O .B Complementation +.B Ê佸¹ç (complementation) +.sp +.\"O An expression "\fI[!...]\fP" matches a single character, namely +.\"O any character that is not matched by the expression obtained +.\"O by removing the first \(aq!\(aq from it. +.\"O (Thus, "\fI[!]a\-]\fP" matches any +.\"O single character except \(aq]\(aq, \(aqa\(aq and \(aq\-\(aq.) +"\fI[!...]\fP" ¤È¸À¤¦É½µ­¤Ï¡¢¥Ö¥é¥±¥Ã¥È¤ÎÆâÉô¤Ë´Þ¤Þ¤ì¤Ê¤¤Ã±°ì¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë +(¤¿¤À¤·ÀèƬ¤Ë¤¢¤ë \(aq!\(aq ¤Ï½ü³°)¡£ (¤Ä¤Þ¤ê "\fI[!]a\-]\fP" ¤Ï +\(aq]\(aq, \(aqa\(aq, \(aq\-\(aq °Ê³°¤Î¤¹¤Ù¤Æ¤Îʸ»ú¤Î¡¢¤É¤ì¤«°ì¤Ä¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£) + +.\"O One can remove the special meaning of \(aq?\(aq, \(aq*\(aq and \(aq[\(aq by +.\"O preceding them by a backslash, or, in case this is part of +.\"O a shell command line, enclosing them in quotes. +.\"O Between brackets these characters stand for themselves. +.\"O Thus, "\fI[[?*\e]\fP" matches the +.\"O four characters \(aq[\(aq, \(aq?\(aq, \(aq*\(aq and \(aq\e\(aq. +¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å \(aq\e\(aq ¤òÁ°ÃÖ¤¹¤ì¤Ð¡¢ \(aq?\(aq, \(aq*\(aq, \(aq[\(aq +¤ÏÄ̾ï¤Îʸ»ú¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +¤Þ¤¿¤Ï¥·¥§¥ë¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î°ìÉô¤Ë»ØÄꤹ¤ë¾ì¹ç¤Ï¡¢ +¥¯¥©¡¼¥È¤Ç°Ï¤Ã¤Æ¤âƱ¤¸¸ú²Ì¤¬ÆÀ¤é¤ì¤ë¡£¥Ö¥é¥±¥Ã¥È¤ÎÆâÉô¤Ç¤Ï¡¢ +¤³¤ì¤é¤Îʸ»ú¤Ï¤½¤Îʸ»ú¼«¿È¤À¤±¤ò°ÕÌ£¤¹¤ë¡£ +¤¹¤Ê¤ï¤Á "\fI[[?*\e]\fP" ¤Ï \(aq[\(aq, \(aq?\(aq, \(aq*\(aq, \(aq\e\(aq +¤Î¤É¤ì¤«°ìʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.\"O .SS Pathnames +.SS "¥Ñ¥¹Ì¾ (pathname)" +.\"O Globbing is applied on each of the components of a pathname +.\"O separately. +.\"O A \(aq/\(aq in a pathname cannot be matched by a \(aq?\(aq or \(aq*\(aq +.\"O wildcard, or by a range like "\fI[.\-0]\fP". +.\"O A range cannot contain an +.\"O explicit \(aq/\(aq character; this would lead to a syntax error. +glob Æ°ºî¤Ï¡¢¥Ñ¥¹Ì¾¤Î¤½¤ì¤¾¤ì¤ÎÉôʬ¤ËÆÈΩ¤ËŬÍѤµ¤ì¤ë¡£ +¥Ñ¥¹Ì¾¤Ë¸ºß¤¹¤ë \(aq/\(aq ¤Ï \(aq?\(aq ¤ä \(aq*\(aq ¥ï¥¤¥ë¥É¥«¡¼¥É¤Ë¤Ï¥Þ¥Ã¥Á¤·¤Ê¤¤¡£ +¤Þ¤¿ "\fI[.\-0]\fP" ¤Î¤è¤¦¤ÊÎΰè»ØÄê¤Ë¤â¥Þ¥Ã¥Á¤·¤Ê¤¤¡£ +Îΰè»ØÄê¤ÏÍÛ¤Ë \(aq/\(aq ʸ»ú¤ò´Þ¤à¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£¤³¤ì¤Ïʸˡ¥¨¥é¡¼¤È¤Ê¤ë¡£ + +.\"O If a filename starts with a \(aq.\(aq, +.\"O this character must be matched explicitly. +.\"O (Thus, \fIrm\ *\fP will not remove .profile, and \fItar\ c\ *\fP will not +.\"O archive all your files; \fItar\ c\ .\fP is better.) +\(aq.\(aq ¤Ç»Ï¤Þ¤ë¥Ñ¥¹Ì¾¤Ç¤Ï¡¢¤³¤Îʸ»ú¤ÏÍۤ˥ޥåÁ¤µ¤»¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +(¤Ä¤Þ¤ê \fIrm\ *\fP ¤Ï .profile ¤òºï½ü¤·¤Ê¤¤¡£¤Þ¤¿ \fItar\ c\ *\fP +¤Ç¤Ï¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤Ï¥¢¡¼¥«¥¤¥Ö¤µ¤ì¤Ê¤¤¡£ \fItar\ c\ .\fP ¤ÎÊý¤¬Îɤ¤¡£) +.\"O .SS "Empty Lists" +.SS ¶õ¤Î¥ê¥¹¥È +.\"O The nice and simple rule given above: "expand a wildcard pattern +.\"O into the list of matching pathnames" was the original Unix +.\"O definition. +.\"O It allowed one to have patterns that expand into +.\"O an empty list, as in +Àè¤ËÍ¿¤¨¤¿¡¢¤ï¤«¤ê¤ä¤¹¤¯´Êñ¤Ê¥ë¡¼¥ë¡¢ +¡Ö¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤ò¥Þ¥Ã¥Á¤·¤¿¥Ñ¥¹Ì¾¤Î¥ê¥¹¥È¤ËŸ³«¤¹¤ë¡×¤È¸À¤¦¤Î¤Ï¡¢ +¥ª¥ê¥¸¥Ê¥ë¤Î Unix ¤Ë¤ª¤±¤ëÄêµÁ¤Ç¤¢¤Ã¤¿¡£ +¤³¤ì¤Ï¥Ñ¥¿¡¼¥ó¤¬¶õ¤Î¥ê¥¹¥È¤ËŸ³«¤µ¤ì¤ë¤³¤È¤âµö²Ä¤µ¤ì¤Æ¤¤¤¿¡£ +Î㤨¤Ð +.br +.nf + xv \-wait 0 *.gif *.jpg +.fi +.\"O where perhaps no *.gif files are present (and this is not +.\"O an error). +¤Ë¤ª¤¤¤Æ¡¢*.gif ¥Õ¥¡¥¤¥ë¤¬Á´¤¯¤Ê¤¤¾ì¹ç¤Ç¤â¡¢ +¤³¤ì¤Ï¶õ¤Î¥ê¥¹¥È¤ËŸ³«¤µ¤ì¤ë¤¿¤á¡¢¥¨¥é¡¼¤Ë¤Ê¤é¤Ê¤¤¡£ +.\"O However, POSIX requires that a wildcard pattern is left +.\"O unchanged when it is syntactically incorrect, or the list of +.\"O matching pathnames is empty. +.\"O With +.\"O .I bash +.\"O one can force the classical behavior by setting +.\"O .IR allow_null_glob_expansion=true . +¤·¤«¤· POSIX ¤Ç¤Ï¡¢Ê¸Ë¡Åª¤ËÀµ¤·¤¯¤Ê¤¤¥Ñ¥¿¡¼¥ó¤ä¡¢ +¥Þ¥Ã¥Á¤¬¤Ê¤«¤Ã¤¿¥Ñ¥¿¡¼¥ó¤Ï¡¢ +¤½¤Î¤Þ¤ÞÊѹ¹¤µ¤ì¤º¤Ë»Ä¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.I bash +¤Ç¤Ï +.I allow_null_glob_expansion=true +¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢°ÊÁ°¤Î¿¶¤ëÉñ¤¤¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O (Similar problems occur elsewhere. +.\"O E.g., where old scripts have +(ƱÍͤÎÌäÂê¤ÏÊ̤ΤȤ³¤í¤Ç¤âµ¯¤³¤Ã¤Æ¤¤¤ë¡£Î㤨¤Ð¡¢¸Å¤¤¥¹¥¯¥ê¥×¥È¤Ë¤ª¤±¤ë +.br +.nf + rm \`find . \-name "*~"\` +.fi +.\"O new scripts require +¤Î¤è¤¦¤Êµ­½Ò¤Ï¡¢¿·¤·¤¤¥¹¥¯¥ê¥×¥È¤Ç¤Ï +.br +.nf + rm \-f nosuchfile \`find . \-name "*~"\` +.fi +.\"O to avoid error messages from +.\"O .I rm +.\"O called with an empty argument list.) +¤Î¤è¤¦¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤µ¤â¤Ê¤¤¤È +.I rm +¤ò°ú¤­¿ô¥ê¥¹¥È¤Ê¤·¤Ç¸Æ¤Ó½Ð¤¹²ÄǽÀ­¤¬¤¢¤ê¡¢ +¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½Ð¤Æ¤·¤Þ¤¦¡£) +.\"O .SH NOTES +.SH Ãí°Õ +.\"O .SS Regular expressions +.SS Àµµ¬É½¸½ +.\"O Note that wildcard patterns are not regular expressions, +.\"O although they are a bit similar. +.\"O First of all, they match +.\"O filenames, rather than text, and secondly, the conventions +.\"O are not the same: for example, in a regular expression \(aq*\(aq means zero or +.\"O more copies of the preceding thing. +¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤ÏÀµµ¬É½¸½¤È¿¾¯»÷¤Æ¤¤¤ë¤¬¡¢¤·¤«¤·¤³¤Îξ¼Ô¤Ï°Û¤Ê¤ë¡£ +¤Þ¤ºÂè°ì¤Ë¡¢Á°¼Ô¤¬¥Õ¥¡¥¤¥ë̾¤Ë¥Þ¥Ã¥Á¤¹¤ë¤Î¤ËÂФ·¤Æ¡¢ +¸å¼Ô¤Ï¥Æ¥­¥¹¥È¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ÂèÆó¤Ë¡¢¥ë¡¼¥ë¤âƱ¤¸¤Ç¤Ï¤Ê¤¤¡£ +Î㤨¤ÐÀµµ¬É½¸½¤Ë¤ª¤±¤ë \(aq*\(aq ¤Ï¡¢ +Á°ÃÖ¤µ¤ì¤¿Ê¸»ú¤Î 0 °Ê¾å¤Î·«¤êÊÖ¤·¤òɽ¤¹¡£ + +.\"O Now that regular expressions have bracket expressions where +.\"O the negation is indicated by a \(aq^\(aq, POSIX has declared the +.\"O effect of a wildcard pattern "\fI[^...]\fP" to be undefined. +Àµµ¬É½¸½¤Ë¤â¥Ö¥é¥±¥Ã¥Èɽ¸½¤Ï¤¢¤ë¤¬¡¢ÈÝÄê¤Ï \(aq^\(aq ¤Ç¤Ê¤µ¤ì¤ë¡£ +POSIX ¤Ç¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤Ë¤ª¤±¤ë "\fI[^...]\fP" ¤ò̤ÄêµÁ¤Ç¤¢¤ë¤È¤·¤Æ¤¤¤ë¡£ +.\"O .SS Character classes and Internationalization +.SS ʸ»ú¥¯¥é¥¹¤È¹ñºÝ²½ +.\"O Of course ranges were originally meant to be ASCII ranges, +.\"O so that "\fI[\ \-%]\fP" stands for "\fI[\ !"#$%]\fP" and "\fI[a\-z]\fP" stands +.\"O for "any lowercase letter". +.\"O Some Unix implementations generalized this so that a range X\-Y +.\"O stands for the set of characters with code between the codes for +.\"O X and for Y. +.\"O However, this requires the user to know the +.\"O character coding in use on the local system, and moreover, is +.\"O not convenient if the collating sequence for the local alphabet +.\"O differs from the ordering of the character codes. +Îΰè»ØÄê¤Ï¡¢¤â¤È¤â¤È¤Ï¤â¤Á¤í¤ó ASCII ¤Ë¤ª¤±¤ë½ç½øʤӤò°ÕÌ£¤·¤Æ¤¤¤¿¡£ +¤·¤¿¤¬¤Ã¤Æ "\fI[\ \-%]\fP" ¤Ï "\fI[\ !"#$%]\fP" ¤Î°ÕÌ£¤Ç¤¢¤ê¡¢ +"\fI[a\-z]\fP" ¤Ï¡Ö¤¹¤Ù¤Æ¤Î¾®Ê¸»ú¡×¤Î°ÕÌ£¤Ç¤¢¤Ã¤¿¡£ +Unix ¤Î¼ÂÁõ¤ÎÃæ¤Ë¤Ï¡¢¤³¤ì¤ò³ÈÄ¥¤·¤¿¤â¤Î¤¬Â¸ºß¤·¡¢ +¤½¤³¤Ç¤Ï X\-Y ¤È¤¤¤¦Îΰè»ØÄê¤Ï¡¢X ¤Î¥³¡¼¥É¤È +Y ¤Î¥³¡¼¥É¤Ë¶´¤Þ¤ì¤¿¥³¡¼¥É¤ò»ý¤Äʸ»ú¤¹¤Ù¤Æ¤òɽ¤¹¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£ +¤·¤«¤·¡¢¤³¤ì¤Ë¤Ï¥æ¡¼¥¶¡¼¤¬¥í¡¼¥«¥ë¤Ê¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë +ʸ»ú¥³¡¼¥É¤òÃΤé¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤µ¤é¤Ë¥í¡¼¥«¥ë¤Ê¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤ËÂФ¹¤ë¾È¹ç½ç½ø +(collating sequence) ¤¬Ê¸»ú¥³¡¼¥É¤Î½ç½ø¤È°Û¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤ÏÉÔÊؤǤ¢¤Ã¤¿¡£ +(ÌõÃí: collating sequence ¤Ë´Ø¤·¤Æ¤Ï +.BR regex (7) +¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£) +.\"O Therefore, POSIX extended the bracket notation greatly, +.\"O both for wildcard patterns and for regular expressions. +.\"O In the above we saw three types of items that can occur in a bracket +.\"O expression: namely (i) the negation, (ii) explicit single characters, +.\"O and (iii) ranges. +.\"O POSIX specifies ranges in an internationally +.\"O more useful way and adds three more types: +¤·¤¿¤¬¤Ã¤Æ POSIX ¤Ç¤Ï¡¢¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤ÈÀµµ¬É½¸½¤ÎÁÐÊý¤Ë¤ª¤¤¤Æ¡¢ +¥Ö¥é¥±¥Ã¥Èɽµ­¤òÂçÉý¤Ë³ÈÄ¥¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Þ¤Ç²æ¡¹¤Ï¡¢¥Ö¥é¥±¥Ã¥Èɽµ­¤Ë¤Ï»°¤Ä¤ÎÍ×ÁǤ¬´Þ¤Þ¤ì¤¦¤ë¤³¤È¤ò¸«¤Æ¤­¤¿¡£ +¤¹¤Ê¤ï¤Á (i) ÈÝÄê¡¢(ii) ñ°ì¤Îʸ»ú¡¢(iii) Îΰè»ØÄê¡¢¤Î»°¤Ä¤Ç¤¢¤ë¡£ +POSIX ¤Ç¤Ï¡¢Îΰè»ØÄê¤ò¤è¤ê¹ñºÝ²½¤ËÊØÍø¤Ê¤è¤¦¤ËÄêµÁ¤·¤Æ¤ª¤ê¡¢ +¤Þ¤¿»°¤Ä¤Î¥¿¥¤¥×¤ò¥Ö¥é¥±¥Ã¥Èɽµ­¤ÎÍ×ÁǤȤ·¤ÆÄɲ䷤Ƥ¤¤ë¡£ + +.\"O (iii) Ranges X\-Y comprise all characters that fall between X +.\"O and Y (inclusive) in the currect collating sequence as defined +.\"O by the +.\"O .B LC_COLLATE +.\"O category in the current locale. +(iii) Îΰè»ØÄê X\-Y ¤Ï X ¤È Y ¤Ë¶´¤Þ¤ì¤¿ (ξü´Þ¤à) ¤¹¤Ù¤Æ¤Îʸ»ú¤ò°ÕÌ£¤¹¤ë¡£ +¤³¤Î¤È¤­¡¢¥«¥ì¥ó¥È¥í¥±¡¼¥ë (current locale) ¤Î +.B LC_COLLATE +¥«¥Æ¥´¥ê¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾È¹ç½ç½ø¤¬ÍѤ¤¤é¤ì¤ë¡£ + +.\"O (iv) Named character classes, like +(iv) ̾Á°ÉÕ¤­Ê¸»ú¥¯¥é¥¹: °Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +.nf + +[:alnum:] [:alpha:] [:blank:] [:cntrl:] +[:digit:] [:graph:] [:lower:] [:print:] +[:punct:] [:space:] [:upper:] [:xdigit:] + +.fi +.\"O so that one can say "\fI[[:lower:]]\fP" instead of "\fI[a\-z]\fP", and have +.\"O things work in Denmark, too, where there are three letters past \(aqz\(aq +.\"O in the alphabet. +.\"O These character classes are defined by the +.\"O .B LC_CTYPE +.\"O category +.\"O in the current locale. +¤³¤ì¤òÍѤ¤¤ì¤Ð "\fI[a\-z]\fP" ¤ÎÂå¤ï¤ê¤Ë "\fI[[:lower:]]\fP" ¤Î¤è¤¦¤Ê»ØÄ꤬¤Ç¤­¤ë¡£ +¤Þ¤¿¥Ç¥ó¥Þ¡¼¥¯¤Î¤è¤¦¤Ë¡¢¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Î \(aqz\(aq °Ê¹ß¤Ë +3 ¤Ä¤Îʸ»ú¤¬Â¸ºß¤¹¤ë¤è¤¦¤Ê¾ì¹ç¤Ç¤â¡¢Æ±¤¸¤è¤¦¤ÊÆ°ºî¤¬´üÂԤǤ­¤ë¡£ +¤³¤ì¤é¤Îʸ»ú¥¯¥é¥¹¤Ï¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"O (v) Collating symbols, like "\fI[.ch.]\fP" or "\fI[.a-acute.]\fP", +.\"O where the string between "\fI[.\fP" and "\fI.]\fP" is a collating +.\"O element defined for the current locale. +.\"O Note that this may +.\"O be a multicharacter element. +(v) ¾È¹ç½ç½ø¤Ë¤ª¤±¤ë¥·¥ó¥Ü¥ë: "\fI[.ch.]\fP" ¤ä "\fI[.a-acute.]\fP" ¤Î¤è¤¦¤Ë "\fI[.\fP" +¤È "\fI.]\fP" ¤Ç¶´¤Þ¤ì¤¿Ê¸»úÎó¤Ï¡¢¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤ÇÄêµÁ¤µ¤ì¤¿¾È¹ç½ç½ø¤ÎÍ×ÁǤȤʤ롣 +¤¢¤ë°ì¤Ä¤ÎÍ×ÁǤ¬Ê£¿ô¤Îʸ»ú¤«¤é¤Ê¤ë¾ì¹ç¤â¤¢¤ê¤¦¤ë¤³¤È¤ËÃí°Õ¡£ + +.\"O (vi) Equivalence class expressions, like "\fI[=a=]\fP", +.\"O where the string between "\fI[=\fP" and "\fI=]\fP" is any collating +.\"O element from its equivalence class, as defined for the +.\"O current locale. +.\"O For example, "\fI[[=a=]]\fP" might be equivalent +.\"O .\" FIXME . the accented 'a' characters are not rendering properly +.\"O .\" mtk May 2007 +.\"O to "\fI[aaaaa]\fP" (warning: Latin-1 here), that is, +.\"O to "\fI[a[.a-acute.][.a-grave.][.a-umlaut.][.a-circumflex.]]\fP". +(vi) Åù²Á¥¯¥é¥¹É½¸½ (equivalence class expressions): "\fI[=a=]\fP" +¤Î¤è¤¦¤Ë "\fI[=\fP" ¤È "\fI=]\fP" ¤È¤Ç¶´¤Þ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +¤³¤ì¤ÏÅù²Á¥¯¥é¥¹¤Î¥á¥ó¥Ð¡¼¤Ç¤¢¤ë¾È¹ç½ç½ø¤ÎÍ×ÁǤ¹¤Ù¤Æ¤Ë¤Ê¤ë¡£ +Åù²Á¥¯¥é¥¹¤Ï¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ë¤Ê¤ë¡£ +Î㤨¤Ð¡¢"\fI[[=a=]]\fP" ¤Ï +"\fI[a[.a\-acute.][.a\-grave.][.a\-umlaut.][.a\-circumflex.]]\fP" +¤ÈÅù²Á¤Ç¤¢¤ë +(Latin-1 ɽµ­¤Ç¤Ï [a\e`{a}\e'{a}\e"{a}\e^{a}] ¤âƱ¤¸¡£ +[ÌõÃí] ÆüËܸì¤Î roff ¥Ú¡¼¥¸¤Ç¤Ï latin1 ¥³¡¼¥É¤¬½Ð¤Ê¤¤¤Î¤Ç¡¢ +¤³¤³¤Ç¤Ï TeX ɽµ­¤Çµ­ºÜ)¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sh (1), +.BR fnmatch (3), +.BR glob (3), +.BR locale (7), +.BR regex (7) diff --git a/draft/man7/hier.7 b/draft/man7/hier.7 new file mode 100644 index 00000000..404e27ac --- /dev/null +++ b/draft/man7/hier.7 @@ -0,0 +1,795 @@ +.\" 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 Sun Jul 25 11:05:58 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sat Feb 10 16:18:03 1996 by Urs Thuermann (urs@isnogud.escape.de) +.\" Modified Mon Jun 16 20:02:00 1997 by NicoláÔ Lichtmaier +.\" Modified Mon Feb 6 16:41:00 1999 by NicoláÔ Lichtmaier +.\" Modified Tue Feb 8 16:46:45 2000 by Chris Pepper +.\" Modified Fri Sep 7 20:32:45 2001 by Tammy Fox +.\" +.\" Japanese Version Copyright (c) 1997-2000 TACHIBANA Akira +.\" all rights reserved. +.\" Translated Wed Dec 11 02:08:20 JST 1997 +.\" by TACHIBANA Akira +.\" Modified Sat Apr 8 02:44:43 JST 2000 +.\" by TACHIBANA Akira +.\" Updated Sun Sep 17 20:48:33 JST 2000 +.\" by TACHIBANA Akira +.\" Updated Sat 29 Dec 2001 by NAKANO Takeo +.\" +.\"WORD: native language support Êì¹ñ¸ì¥µ¥Ý¡¼¥È +.TH HIER 7 2009-03-30 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O hier \- Description of the file system hierarchy +.SH ̾Á° +hier \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à³¬ÁؤÎÀâÌÀ +.\"O .SH DESCRIPTION +.\"O A typical Linux system has, among others, the following directories: +.SH ÀâÌÀ +ŵ·¿Åª¤Ê Linux system ¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ë +(¾¤Ë¤â¤¿¤¯¤µ¤ó¤Î¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ë¤¬): +.TP +.I / +.\"O This is the root directory. +.\"O This is where the whole tree starts. +¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¡£¤³¤³¤¬³¬Áؤε¯ÅÀ¤È¤Ê¤ë¡£ +.TP +.I /bin +.\"O This directory contains executable programs which are needed in +.\"O single user mode and to bring the system up or repair it. +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¥·¥ó¥°¥ë¥æ¡¼¥¶¡¼¥â¡¼¥É¤Ç +¥·¥¹¥Æ¥à¤Îµ¯Æ°¤ä½¤Íý¤ò¹Ô¤¦ºÝ¤ËɬÍפʼ¹ԷÁ¼°¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤ë¡£ +.TP +.I /boot +.\"O Contains static files for the boot loader. +.\"O This directory only holds +.\"O the files which are needed during the boot process. +.\"O The map installer +.\"O and configuration files should go to +.\"O .I /sbin +.\"O and +.\"O .IR /etc . +¥Ö¡¼¥È¥í¡¼¥À¤¬ÍѤ¤¤ëÀÅŪ¤Ê¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¥Ö¡¼¥È¥×¥í¥»¥¹¤Î´Ö¤ËɬÍפʥե¡¥¤¥ë¤À¤±¤¬ÃÖ¤«¤ì¤ë¡£ +¥Þ¥Ã¥×¥¤¥ó¥¹¥È¡¼¥é¤äÀßÄê¥Õ¥¡¥¤¥ë¤Ï +.I /sbin +¤ä +.I /etc +¤ËÃÖ¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.I /dev +.\"O Special or device files, which refer to physical devices. +.\"O See +.\"O .BR mknod (1). +ʪÍý¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤ë +¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤ä¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.BR mknod (1) +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.I /etc +.\"O Contains configuration files which are local to the machine. +.\"O Some +.\"O larger software packages, like X11, can have their own subdirectories +.\"O below +.\"O .IR /etc . +.\"O Site-wide configuration files may be placed here or in +.\"O .IR /usr/etc . +.\"O Nevertheless, programs should always look for these files in +.\"O .I /etc +.\"O and you may have links for these files to +.\"O .IR /usr/etc . +¥Þ¥·¥ó¸ÇÍ­¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¾ì½ê¡£X11 ¤Î¤è¤¦¤Ê +Â絬ÌϤʥ½¥Õ¥È¥¦¥§¥¢¥Ñ¥Ã¥±¡¼¥¸¤Ç¤Ï¡¢ +.I /etc +°Ê²¼¤Ë¹¹¤Ë¥Ñ¥Ã¥±¡¼¥¸Ã±°Ì¤Ç¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬ºî¤é¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +¥µ¥¤¥ÈÁ´ÂΤËÍ­¸ú¤ÊÀßÄê¥Õ¥¡¥¤¥ë¤Ï¡¢¤³¤³¤Ç¤Ï¤Ê¤¯ +.I /usr/etc +¤ËÃÖ¤«¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +¤·¤«¤·¡¢¥×¥í¥°¥é¥à¤«¤é¤Î¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î»²¾ÈÀè¤Ï¡¢¾ï¤Ë +.I /etc +¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.I /usr/etc +°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¤Ï¡¢¤½¤ì¤é¤Ø¤Î¥ê¥ó¥¯¤ò +.I /etc +¤ËÃÖ¤±¤Ð¤è¤¤¡£ +.TP +.I /etc/opt +.\"O Host-specific configuration files for add-on applications installed +.\"O in +.\"O .IR /opt . +.I /opt +¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥¢¥É¥ª¥ó¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬»È¤¦¡¢ +¥Û¥¹¥È¸ÇÍ­¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /etc/sgml +.\"O This directory contains the configuration files for SGML and XML (optional). +SGML ¤ä XML ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê (¤Ê¤¯¤Æ¤â¤è¤¤)¡£ +.TP +.I /etc/skel +.\"O When a new user account is created, files from this directory are +.\"O usually copied into the user's home directory. +¿·¤¿¤Ë¥æ¡¼¥¶¡¼¥¢¥«¥¦¥ó¥È¤òºî¤ëºÝ¡¢ +Ä̾盧¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤¬ +¥æ¡¼¥¶¡¼¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ +.TP +.I /etc/X11 +.\"O Configuration files for the X11 window system (optional). +X11 window system ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê (¤Ê¤¯¤Æ¤â¤è¤¤)¡£ +.TP +.I /home +.\"O On machines with home directories for users, these are usually beneath +.\"O this directory, directly or not. +.\"O The structure of this directory +.\"O depends on local administration decisions. +Ä̾¥æ¡¼¥¶¡¼¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥êľ²¼¤Ê¤¤¤·¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Î²¼¤ËºîÀ®¤µ¤ì¤ë¡£ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¹½À®¤ò¤É¤¦¤¹¤ë¤«¤Ï¡¢ +¥í¡¼¥«¥ë¥Þ¥·¥ó¤Î´ÉÍý¼Ô¤¬·è¤á¤ë¤³¤È¤Ç¤¢¤ë¡£ +.TP +.I /lib +.\"O This directory should hold those shared libraries that are necessary +.\"O to boot the system and to run the commands in the root file system. +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¥·¥¹¥Æ¥à¤Îµ¯Æ°»þ¤ËɬÍפʶ¦Í­¥é¥¤¥Ö¥é¥ê¤ä¡¢ +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤Î¤ËɬÍפʶ¦Í­¥é¥¤¥Ö¥é¥ê¤òÃÖ¤¯¡£ +.TP +.I /media +.\"O This directory contains mount points for removable media such as CD +.\"O and DVD disks or USB sticks. +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢ +CD/DVD ¥Ç¥£¥¹¥¯¤ä USB ¥¹¥Æ¥£¥Ã¥¯¤Ê¤É¤Î¼è¤ê³°¤·²Äǽ¥á¥Ç¥£¥¢ +(removable media) ÍѤΥޥ¦¥ó¥È¥Ý¥¤¥ó¥È¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /mnt +.\"O This directory is a mount point for a temporarily mounted file system. +.\"O In some distributions, +.\"O .I /mnt +.\"O contains subdirectories intended to be used as mount points for several +.\"O temporary file systems. +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢°ì»þŪ¤Ë¥Þ¥¦¥ó¥È¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÍѤΠ+¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤¢¤ë¡£ +¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï¡¢°ì»þŪ¤Ë¥Þ¥¦¥ó¥È¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÍѤΠ+¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤È¤·¤Æ¡¢ +.I /mnt +Æâ¤Ë¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤¬¤¢¤ë¡£ +.TP +.I /opt +.\"O This directory should contain add-on packages that contain static files. +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¥¢¥É¥ª¥ó¥Ñ¥Ã¥±¡¼¥¸¤ÎÀÅŪ¤Ê¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /proc +.\"O This is a mount point for the +.\"O .I proc +.\"O file system, which provides information about running processes and +.\"O the kernel. +.\"O This pseudo-file system is described in more detail in +.\"O .BR proc (5). +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï +.I proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤¢¤ë¡£ +.I proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢¼Â¹ÔÃæ¥×¥í¥»¥¹¤ä¥«¡¼¥Í¥ë¤Î¾ðÊó¤òÄ󶡤¹¤ë¡£ +¤³¤Îµ¿»÷¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¾ÜºÙ¤Ï¡¢ +.BR proc (5) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /root +.\"O This directory is usually the home directory for the root user (optional). +Ä̾盧¤³¤¬ root ¥æ¡¼¥¶¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ê¤ë (¤Ê¤¯¤Æ¤â¤è¤¤)¡£ +.TP +.I /sbin +.\"O Like +.\"O .IR /bin , +.\"O this directory holds commands needed to boot the system, but which are +.\"O usually not executed by normal users. +.I /bin +¤ÈƱÍͤˡ¢ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¥·¥¹¥Æ¥à¤Îµ¯Æ°¤ËɬÍפʥ³¥Þ¥ó¥É¤¬´Þ¤Þ¤ì¤ë¡£ +¤¿¤À¤·¤³¤³¤Ë¤Ï¡¢°ìÈ̥桼¥¶¡¼¤ÏÄ̾ï¼Â¹Ô¤·¤Ê¤¤¥³¥Þ¥ó¥É¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /srv +.\"O This directory contains site-specific data that is served by this system. +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¤³¤Î¥·¥¹¥Æ¥à¤ÇÄ󶡤µ¤ì¤ë +¥µ¥¤¥È¸ÇÍ­¤Î¥Ç¡¼¥¿¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /tmp +.\"O This directory contains temporary files which may be deleted with no +.\"O notice, such as by a regular job or at system boot up. +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢ +Äê´üŪ¤Ê¥¸¥ç¥Ö¤Ë¤è¤Ã¤Æ¡¢¤Þ¤¿¤Ï¥·¥¹¥Æ¥àµ¯Æ°»þ¤Ë¡¢ +̵¾ò·ï¤Ëºï½ü¤·¤Æ¹½¤ï¤Ê¤¤°ì»þŪ¤Ê¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /usr +.\"O This directory is usually mounted from a separate partition. +.\"O It should hold only sharable, read-only data, so that it can be mounted +.\"O by various machines running Linux. +Ä̾盧¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢ÆÈΩ¤·¤¿¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤¬¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +¤³¤³¤Ë¤Ï¡¢¶¦Í­²Äǽ¤ÇÆɤ߹þ¤ßÀìÍѤΤâ¤Î¤À¤±¤¬´Þ¤Þ¤ì¡¢ +¤è¤Ã¤Æ¤¤¤í¤¤¤í¤Ê Linux ¥Þ¥·¥ó¤«¤é¥Þ¥¦¥ó¥È¤Ç¤­¤ë¡£ +.TP +.I /usr/X11R6 +.\"O The X\-Window system, version 11 release 6 (optional). +X Window System, Version 11 release 6 (¤Ê¤¯¤Æ¤â¤è¤¤)¡£ +.\":tati:X(3) ¤Ë¹ç¤ï¤»¤Þ¤·¤¿ +.TP +.I /usr/X11R6/bin +.\"O Binaries which belong to the X\-Window system; often, there is a +.\"O symbolic link from the more traditional +.\"O .I /usr/bin/X11 +.\"O to here. +X Window System ¤Î¥Ð¥¤¥Ê¥ê¤ÎÃÖ¤­¾ì½ê¡£ +¸Å¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë +.I /usr/bin/X11 +¤«¤é¤³¤³¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¤¡£ +.TP +.I /usr/X11R6/lib +.\"O Data files associated with the X\-Window system. +X Window System ¤Ë´ØÏ¢¤¹¤ë¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/X11R6/lib/X11 +.\"O These contain miscellaneous files needed to run X; Often, there is a +.\"O symbolic link from +.\"O .I /usr/lib/X11 +.\"O to this directory. +¤³¤³¤Ë¤Ï X ¤ÎÆ°ºî¤ËɬÍפʼ¤Î¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.I /usr/lib/X11 +¤«¤é¤³¤³¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¤¡£ +.TP +.I /usr/X11R6/include/X11 +.\"O Contains include files needed for compiling programs using the X11 +.\"O window system. +.\"O Often, there is a symbolic link from +.\"O .I /usr/include/X11 +.\"O to this directory. +¤³¤³¤Ë¤Ï X11 Window System ¤ò»È¤Ã¤¿¥×¥í¥°¥é¥à¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤¿¤á¤Ë +ɬÍפʥ¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.I /usr/include/X11 +¤«¤é¤³¤³¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¤¡£ +.TP +.I /usr/bin +.\"O This is the primary directory for executable programs. +.\"O Most programs +.\"O executed by normal users which are not needed for booting or for +.\"O repairing the system and which are not installed locally should be +.\"O placed in this directory. +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢¼Â¹Ô·Á¼°¥Õ¥¡¥¤¥ë¤Î¼ç¤ÊÃÖ¤­¾ì½ê¤Ç¤¢¤ë¡£ +¥·¥¹¥Æ¥à¤Î¥Ö¡¼¥È¤ä¥·¥¹¥Æ¥àÉüµì¤Ë¤ÏɬÍפȤµ¤ì¤Ê¤¤¡¢ +°ìÈ̥桼¥¶¡¼¤¬ÍøÍѤ¹¤ë¥³¥Þ¥ó¥É¤Î¿¤¯¤Ï¡¢ +¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë¤Î¤Ç¤Ê¤¤¸Â¤ê¡¢ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.I /usr/bin/X11 +.\"O is the traditional place to look for X11 executables; on Linux, it +.\"O usually is a symbolic link to +.\"O .IR /usr/X11R6/bin . +X11 ¥³¥Þ¥ó¥É¤ÎÅÁÅýŪ¤ÊÃÖ¤­¾ì½ê¡£Linux ¤Ç¤Ï¡¢Ä̾ï +.I /usr/X11R6/bin +¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/dict +.\"O Replaced by +.\"O .IR /usr/share/dict . +.I /usr/share/dict +¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +.TP +.I /usr/doc +.\"O Replaced by +.\"O .IR /usr/share/doc . +.I /usr/share/doc +¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +.TP +.I /usr/etc +.\"O Site-wide configuration files to be shared between several machines +.\"O may be stored in this directory. +.\"O However, commands should always +.\"O reference those files using the +.\"O .I /etc +.\"O directory. +.\"O Links from files in +.\"O .I /etc +.\"O should point to the appropriate files in +.\"O .IR /usr/etc . +¥µ¥¤¥ÈÆâÉô¤ÎÊ£¿ô¤Î¥Þ¥·¥ó¤¬¶¦Í­¤¹¤ë¤è¤¦¤ÊÀßÄê¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¥³¥Þ¥ó¥É¤Ï¤½¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î»²¾ÈÀè¤ò¡¢¾ï¤Ë +.I /etc +¤Ë¤¹¤Ù¤­¤À¤í¤¦¡£ +.I /etc +¤Î¥Õ¥¡¥¤¥ë¤«¤é¥ê¥ó¥¯¤òÄ¥¤Ã¤Æ¡¢ +.I /usr/etc +¤ÎŬÀڤʥե¡¥¤¥ë¤ò»Ø¤¹¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.I /usr/games +.\"O Binaries for games and educational programs (optional). +¥²¡¼¥à¥×¥í¥°¥é¥à¤ä¶µ°éÍÑ¥×¥í¥°¥é¥à¤Î¥Ð¥¤¥Ê¥ê¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë (¤Ê¤¯¤Æ¤â¤è¤¤)¡£ +.TP +.I /usr/include +.\"O Include files for the C compiler. +C ¥³¥ó¥Ñ¥¤¥éÍѤΥ¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/include/X11 +.\"O Include files for the C compiler and the X\-Window system. +.\"O This is +.\"O usually a symbolic link to +.\"O .IR /usr/X11R6/include/X11 . +C ¥³¥ó¥Ñ¥¤¥é¤È X Window System ÍѤΥ¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +Ä̾盧¤ì¤Ï +.I /usr/inlcude/X11 +¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.TP +.I /usr/include/asm +.\"O Include files which declare some assembler functions. +.\"O This used to be a +.\"O symbolic link to +.\"O .IR /usr/src/linux/include/asm . +¥¢¥»¥ó¥Ö¥é´Ø¿ô¤ÎÀë¸À¤ò¹Ô¤¦¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢°ÊÁ°¤Ï +.I /usr/src/linux/include/asm +¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤À¤Ã¤¿¡£ +.TP +.I /usr/include/linux +.\"O This contains information which may change from system release to +.\"O system release and used to be a symbolic link to +.\"O .I /usr/src/linux/include/linux +.\"O to get at operating system specific information. +¤³¤³¤Ë¤Ï¡¢¥·¥¹¥Æ¥à¤Î¥ê¥ê¡¼¥¹¤Î¤¿¤Ó¤´¤È¤ËÊѹ¹¤µ¤ì¤¦¤ë¾ðÊ󤬴ޤޤì¤ë¡£ +¤³¤³¤Ï°ÊÁ°¤Ï +.I /usr/src/linux/include/linux +¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤µ¤ì¤Æ¤ª¤ê¡¢ +¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¸ÇÍ­¤Î¾ðÊó¤¬ÆÀ¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£ + +.\"O (Note that one should have include files there that work correctly with +.\"O the current libc and in user space. +.\"O However, Linux kernel source is not +.\"O designed to be used with user programs and does not know anything +.\"O about the libc you are using. +.\"O It is very likely that things will break +.\"O if you let +.\"O .I /usr/include/asm +.\"O and +.\"O .I /usr/include/linux +.\"O point at a random kernel tree. +.\"O Debian systems don't do this +.\"O and use headers from a known good kernel +.\"O version, provided in the libc*-dev package.) +(¤³¤³¤ËÃÖ¤¯¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ï¡¢ +¸½ºß¤Î libc ¤ª¤è¤Ó¥æ¡¼¥¶¶õ´Ö¤ÇÀµ¤·¤¯Æ°ºî¤¹¤ë¤â¤Î¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤·¤«¤· Linux ¤Î¥«¡¼¥Í¥ë¥½¡¼¥¹¤Ï +¥æ¡¼¥¶¥×¥í¥°¥é¥à¤È¤¤¤Ã¤·¤ç¤Ë»È¤¦¤è¤¦¤Ë¤ÏÀ߷פµ¤ì¤Æ¤¤¤Ê¤¤¤·¡¢ +¤¢¤Ê¤¿¤¬»È¤Ã¤Æ¤¤¤ë libc ¤â´ØÃΤ·¤Ê¤¤¡£ +.I /usr/include/asm +¤È +.I /usr/include/linux +¤òŬÅö¤Ê¥«¡¼¥Í¥ë¥Ä¥ê¡¼¤Ø¤Î¥ê¥ó¥¯¤Ë¤·¤¿¤ê¤¹¤ë¤È¡¢ÇËþ¤¹¤ë¤Î¤ÏÌܤ˸«¤¨¤Æ¤¤¤ë¡£ +Debian ¤Ç¤Ï¤³¤¦¤»¤º¤Ë¡¢libc*-dev package ¤¬Ä󶡤¹¤ë¡¢ +°ÂÄꤷ¤¿¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤òÃÖ¤¤¤Æ¤¤¤ë¡£) +.TP +.I /usr/include/g++ +.\"O Include files to use with the GNU C++ compiler. +GNU C++ ¥³¥ó¥Ñ¥¤¥éÍѤΥ¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/lib +.\"O Object libraries, including dynamic libraries, plus some executables +.\"O which usually are not invoked directly. +.\"O More complicated programs may +.\"O have whole subdirectories there. +¥ª¥Ö¥¸¥§¥¯¥È¥é¥¤¥Ö¥é¥ê (¥À¥¤¥Ê¥ß¥Ã¥¯¥é¥¤¥Ö¥é¥ê¤â´Þ¤à) ¤È¡¢ +ľÀܤˤϵ¯Æ°¤µ¤ì¤Ê¤¤¤è¤¦¤Ê¼Â¹Ô·Á¼°¥Õ¥¡¥¤¥ë¾¯¡¹¤È¤¬ÃÖ¤«¤ì¤ë¡£ +Ê£»¨¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¹¹¤Ë¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.I /usr/lib/X11 +.\"O The usual place for data files associated with X programs, and +.\"O configuration files for the X system itself. +.\"O On Linux, it usually is +.\"O a symbolic link to +.\"O .IR /usr/X11R6/lib/X11 . +X ¤Î¥×¥í¥°¥é¥à¤Ë´ØÏ¢¤¹¤ë¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤È¡¢ +X Window System ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +Linux ¤Ç¤ÏÄ̾ï +.I /usr/X11R6/lib/X11 +¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/lib/gcc-lib +.\"O contains executables and include files for the GNU C compiler, +.\"O .BR gcc (1). +GNU C ¥³¥ó¥Ñ¥¤¥é +.BR gcc (1) +ÍѤμ¹ԷÁ¼°¥Õ¥¡¥¤¥ë¤È¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/lib/groff +.\"O Files for the GNU groff document formatting system. +GNU groff ʸ½ñÀ°·Á¥·¥¹¥Æ¥à¤Î¤¿¤á¤Î¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/lib/uucp +.\"O Files for +.\"O .BR uucp (1). +.BR uucp (1) +¤Î¤¿¤á¤Î¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/local +.\"O This is where programs which are local to the site typically go. +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢ +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ê¥×¥í¥°¥é¥à¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ëŵ·¿Åª¤Ê¾ì½ê¤Ç¤¢¤ë¡£ +.TP +.I /usr/local/bin +.\"O Binaries for programs local to the site. +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ê¥×¥í¥°¥é¥à¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/local/doc +.\"O Local documentation. +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ê¥É¥­¥å¥á¥ó¥È¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/local/etc +.\"O Configuration files associated with locally installed programs. +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥×¥í¥°¥é¥à¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/games +.\"O Binaries for locally installed games. +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥²¡¼¥à¤Î¥Ð¥¤¥Ê¥ê¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/lib +.\"O Files associated with locally installed programs. +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Î´ØÏ¢¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/include +.\"O Header files for the local C compiler. +¥í¡¼¥«¥ë¤Ê C ¥³¥ó¥Ñ¥¤¥é¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/info +.\"O Info pages associated with locally installed programs. +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Î info ¥Ú¡¼¥¸¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/man +.\"O Man pages associated with locally installed programs. +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/sbin +.\"O Locally installed programs for system administration. +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥·¥¹¥Æ¥à´ÉÍý¥³¥Þ¥ó¥É¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/share +.\"O Local application data that can be shared among different architectures +.\"O of the same OS. +Ʊ¤¸ OS ¤Ê¤é¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤¬°Û¤Ê¤Ã¤Æ¤â¶¦Í­¤Ç¤­¤ë¡¢ +¥í¡¼¥«¥ë¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ç¡¼¥¿¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/src +.\"O Source code for locally installed software. +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥½¥Õ¥È¥¦¥§¥¢¤Î¥½¡¼¥¹¥³¡¼¥É¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/man +.\"O Replaced by +.\"O .IR /usr/share/man . +.I /usr/share/man +¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +.TP +.I /usr/sbin +.\"O This directory contains program binaries for system administration +.\"O which are not essential for the boot process, for mounting +.\"O .IR /usr , +.\"O or for system repair. +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¥·¥¹¥Æ¥à´ÉÍý¥³¥Þ¥ó¥É¤¬´Þ¤Þ¤ì¤ë¡£ +¤³¤³¤ËÃÖ¤«¤ì¤ë¥³¥Þ¥ó¥É¤Ï¡¢¥Ö¡¼¥È¥×¥í¥»¥¹¤ä +.I /usr +¤Î¥Þ¥¦¥ó¥È¡¢¥·¥¹¥Æ¥à¤Î½¤Íý¤Ê¤É¤ËɬÍפʤâ¤Î¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.I /usr/share +.\"O This directory contains subdirectories with specific application data, that +.\"O can be shared among different architectures of the same OS. +.\"O Often one finds stuff here that used to live in +.\"O .I /usr/doc +.\"O or +.\"O .I /usr/lib +.\"O or +.\"O .IR /usr/man . +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤´¤È¤Ë¸ÇÍ­¤Ê¥Ç¡¼¥¿ +(Ʊ¤¸ OS ¤Ê¤é¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤¬°ã¤Ã¤Æ¤¤¤Æ¤â¶¦Í­¤Ç¤­¤ë¤â¤Î) +¤¬¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥êñ°Ì¤ÇÃÖ¤«¤ì¤ë¡£ +°ÊÁ°¤Ë¤Ï +.IR /usr/doc , +.IR /usr/lib , +.I /usr/man +¤Ê¤É¤Ë¤¢¤Ã¤¿ÆâÍƤ¬¡¢Â¿¤¯¤³¤³¤ËÃÖ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/share/dict +.\"O Contains the word lists used by spell checkers. +¥¹¥Ú¥ë¥Á¥§¥Ã¥«ÍѤÎñ¸ì¥ê¥¹¥È¤¬´Þ¤Þ¤ì¤ë¡£ +.TP +.I /usr/share/doc +.\"O Documentation about installed programs. +¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Î¥É¥­¥å¥á¥ó¥È¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/share/games +.\"O Static data files for games in +.\"O .IR /usr/games . +.I /usr/games +¤ËÃÖ¤«¤ì¤¿¥²¡¼¥àÍѤÎÀÅŪ¤Ê¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/share/info +.\"O Info pages go here. +info ¥Ú¡¼¥¸¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /usr/share/locale +.\"O Locale information goes here. +¥í¥±¡¼¥ë (locale) ¾ðÊó¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /usr/share/man +.\"O Manual pages go here in subdirectories according to the man page sections. +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¡£³Æ¥Ú¡¼¥¸¤Ï¥»¥¯¥·¥ç¥ó¤Ë±þ¤¸¤¿¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤ë¡£ +.TP +.I /usr/share/man//man[1\-9] +.\"O These directories contain manual pages for the +.\"O specific locale in source code form. +.\"O Systems which use a unique language and code set for all manual pages +.\"O may omit the substring. +¤³¤ì¤é¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢ +³Æ¥í¥±¡¼¥ë¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥½¡¼¥¹¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¡£ +¤¹¤Ù¤Æ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÇƱ¤¸¸À¸ì¤È¥³¡¼¥É¥»¥Ã¥È¤ò»ÈÍѤ¹¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I +¤Ï¾Êά¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +.I /usr/share/misc +.\"O Miscellaneous data that can be shared among different architectures of the +.\"O same OS. +Ʊ¤¸ OS ¤Ê¤é¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤¬°ã¤Ã¤Æ¤¤¤Æ¤â¶¦Í­¤Ç¤­¤ë¡¢»¨Â¿¤Ê¥Ç¡¼¥¿¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/share/nls +.\"O The message catalogs for native language support go here. +Êì¹ñ¸ì¥µ¥Ý¡¼¥È (native language support) ÍѤΥá¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/share/sgml +.\"O Files for SGML and XML. +SGML ¤ä XML ¤Î¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/share/terminfo +.\"O The database for terminfo. +terminfo ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /usr/share/tmac +.\"O Troff macros that are not distributed with groff. +groff ¤È°ì½ï¤Ë¤ÏÇÛÉÛ¤µ¤ì¤Æ¤¤¤Ê¤¤ troff ¥Þ¥¯¥í¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/share/zoneinfo +.\"O Files for timezone information. +¥¿¥¤¥à¥¾¡¼¥ó¾ðÊó¤Î¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /usr/src +.\"O Source files for different parts of the system, included with some packages +.\"O for reference purposes. +.\"O Don't work here with your own projects, as files +.\"O below /usr should be read-only except when installing software. +¥·¥¹¥Æ¥à¾å¤Î¿§¡¹¤Ê¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë +(»²¾ÈÍѤΥѥ屡¼¥¸¤â´Þ¤à) ¤ÎÃÖ¤­¾ì½ê¡£ +¤³¤Î¾ì½ê¤Ç¼«Ê¬¤Î¥×¥í¥¸¥§¥¯¥È¤Îºî¶È¤ò¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +/usr °Ê²¼¤Î¥Õ¥¡¥¤¥ë¤Ï¥½¥Õ¥È¥¦¥§¥¢¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Î»þ°Ê³°¤Ï +Æɤ߹þ¤ßÀìÍѤˤʤäƤ¤¤ë¤Ù¤­¤À¤«¤é¤Ç¤¢¤ë¡£ +.TP +.I /usr/src/linux +.\"O This was the traditional place for the kernel source. +.\"O Some distributions put here the source for the default kernel they ship. +.\"O You should probably use another directory when building your own kernel. +¤«¤Ä¤Æ¤Ï¥«¡¼¥Í¥ë¥½¡¼¥¹¤ÎÅÁÅýŪ¤ÊÃÖ¤­¾ì½ê¤À¤Ã¤¿¡£ +¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï¡¢ +½Ð²Ù»þ¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¤ò¤³¤³¤ËÃÖ¤¤¤Æ¤¤¤ë¡£ +¼«Ê¬¤Ç¥«¡¼¥Í¥ë¤ò¥Ó¥ë¥É¤¹¤ë¤È¤­¤ÏÊ̤ξì½ê¤ò»È¤¦¤Û¤¦¤¬¤¤¤¤¤À¤í¤¦¡£ +.TP +.I /usr/tmp +.\"O Obsolete. +.\"O This should be a link +.\"O to +.\"O .IR /var/tmp . +.\"O This link is present only for compatibility reasons and shouldn't be used. +º£¤Ç¤ÏÍѤ¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï +.I /var/tmp +¤Ø¤Î¥ê¥ó¥¯¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤Î¥ê¥ó¥¯¤Ï¸ß´¹À­¤Î¤¿¤á¤À¤±¤Ë¤¢¤ê¡¢¤â¤Ï¤ä»È¤¦¤Ù¤­¤Ç¤Ê¤¤¡£ +.TP +.I /var +.\"O This directory contains files which may change in size, such as spool +.\"O and log files. +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¥¹¥×¡¼¥ë¥Õ¥¡¥¤¥ë¤ä¥í¥°¥Õ¥¡¥¤¥ë¤Î¤è¤¦¤Ê¡¢ +¥µ¥¤¥º¤¬ÊѲ½¤¹¤ë¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /var/adm +.\"O This directory is superseded by +.\"O .I /var/log +.\"O and should be a symbolic link to +.\"O .IR /var/log . +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï +.I /var/log +¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +¤³¤³¤Ï +.I /var/log +¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.I /var/backups +.\"O Reserved for historical reasons. +Îò»ËŪ¤ÊÍýͳ¤«¤é¤Þ¤À»Ä¤Ã¤Æ¤¤¤ë¡£ +.TP +.I /var/cache +.\"O Data cached for programs. +¥×¥í¥°¥é¥à¤Î¤¿¤á¤Ë¥­¥ã¥Ã¥·¥å¤µ¤ì¤¿¥Ç¡¼¥¿¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.IR /var/catman/cat[1\-9] " or " /var/cache/man/cat[1\-9] +.\"O These directories contain preformatted manual pages according to their +.\"O man page section. +.\"O (The use of preformatted manual pages is deprecated.) +¤³¤ì¤é¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢À°·ÁºÑ¤ß¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤¬¡¢ +¥Ú¡¼¥¸¤Î¥»¥¯¥·¥ç¥ó¤Ë½¾¤Ã¤ÆÃÖ¤«¤ì¤Æ¤¤¤ë¡£ +(À°·ÁºÑ¤ß¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÍøÍѤϿ侩¤µ¤ì¤Æ¤¤¤Ê¤¤¡£) +.TP +.I /var/cron +.\"O Reserved for historical reasons. +Îò»ËŪ¤ÊÍýͳ¤«¤é¤Þ¤À»Ä¤Ã¤Æ¤¤¤ë¡£ +.TP +.I /var/lib +.\"O Variable state information for programs. +¥×¥í¥°¥é¥à¤Î¾õÂ֤˴ؤ¹¤ë¾ðÊó¤Î¤¦¤Á¡¢²ÄÊѤʤâ¤Î¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/local +.\"O Variable data for +.\"O .IR /usr/local . +.I /usr/local +ÍѤβÄÊѥǡ¼¥¿¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/lock +.\"O Lock files are placed in this directory. +.\"O The naming convention for +.\"O device lock files is +.\"O .I LCK.. +.\"O where +.\"O .I +.\"O is the device's name in the file system. +.\"O The format used is that of HDU UUCP lock files, that is, lock files +.\"O contain a PID as a 10-byte ASCII decimal number, followed by a newline +.\"O character. +¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +¥Ç¥Ð¥¤¥¹¤Î¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤Î̿̾¤Ï¡¢´·½¬¤È¤·¤Æ +.I LCK.. +¤È¤µ¤ì¤Æ¤¤¤ë¡£¤³¤³¤Ç +.I +¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ç¤Î¥Ç¥Ð¥¤¥¹Ì¾¤Ç¤¢¤ë¡£ +ÍøÍѤµ¤ì¤Æ¤¤¤ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï +HDU UUCP ¤Î¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤¹¤Ê¤ï¤Á³Æ¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤Ë¤Ï +¥¢¥¹¥­¡¼ 10 ¿Ê¿ôÃÍʸ»ú¤Çɽµ­¤·¤¿ PID 10 ¥Ð¥¤¥È¤È¡¢ +¤½¤ì¤Ë³¤¤¤Æ²þ¹Ôʸ»ú¤È¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /var/log +.\"O Miscellaneous log files. +¼ï¡¹¤Î¥í¥°¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/opt +.\"O Variable data for +.\"O .IR /opt . +.I /opt +ÍѤβÄÊѥǡ¼¥¿¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/mail +.\"O Users' mailboxes. +.\"O Replaces +.\"O .IR /var/spool/mail . +¥æ¡¼¥¶¤Î¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤ÎÃÖ¤­¾ì½ê¡£ +.I /var/spool/mail +¤òÃÖ¤­´¹¤¨¤¿¡£ +.TP +.I /var/msgs +.\"O Reserved for historical reasons. +Îò»ËŪ¤ÊÍýͳ¤«¤é¤Þ¤À»Ä¤Ã¤Æ¤¤¤ë¡£ +.TP +.I /var/preserve +.\"O Reserved for historical reasons. +Îò»ËŪ¤ÊÍýͳ¤«¤é¤Þ¤À»Ä¤Ã¤Æ¤¤¤ë¡£ +.TP +.I /var/run +.\"O Run-time variable files, like files holding process identifiers (PIDs) +.\"O and logged user information +.\"O .IR (utmp) . +.\"O Files in this directory are usually cleared when the system boots. +¼Â¹Ô»þ¤Î²ÄÊÑ¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +Î㤨¤Ð¥×¥í¥»¥¹¼±ÊÌ»Ò (PID) ¤òÊÝ»ý¤¹¤ë¥Õ¥¡¥¤¥ë¤ä¡¢ +¥æ¡¼¥¶¤Î¥í¥°¥¤¥ó¾ðÊó¥Õ¥¡¥¤¥ë +.I (utmp) +¤Ê¤É¤Ç¤¢¤ë¡£ +¤³¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢Ä̾亮¥¹¥Æ¥àµ¯Æ°»þ¤Ëºï½ü¤µ¤ì¤ë¡£ +.TP +.I /var/spool +.\"O Spooled (or queued) files for various programs. +¿§¡¹¤Ê¥×¥í¥°¥é¥à¤Î¥¹¥×¡¼¥ë¥Õ¥¡¥¤¥ë (¤¢¤ë¤¤¤Ï¥­¥å¡¼¥Õ¥¡¥¤¥ë) ¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/spool/at +.\"O Spooled jobs for +.\"O .BR at (1). +.BR at (1) +¤Î¥¸¥ç¥Ö¥¹¥×¡¼¥ë¡£ +.TP +.I /var/spool/cron +.\"O Spooled jobs for +.\"O .BR cron (8). +.BR cron (8) +¤Î¥¸¥ç¥Ö¥¹¥×¡¼¥ë¡£ +.TP +.I /var/spool/lpd +.\"O Spooled files for printing. +°õºþÍѤΥ¹¥×¡¼¥ë¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /var/spool/mail +.\"O Replaced by +.\"O .IR /var/mail . +.I /var/mail +¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +.TP +.I /var/spool/mqueue +.\"O Queued outgoing mail. +¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤¿Á÷¿®¥á¡¼¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/spool/news +.\"O Spool directory for news. +¥Ë¥å¡¼¥¹¤Î¥¹¥×¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¡£ +.TP +.I /var/spool/rwho +.\"O Spooled files for +.\"O .BR rwhod (8). +.BR rwhod (8) +¤Î¥¹¥×¡¼¥ë¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/spool/smail +.\"O Spooled files for the +.\"O .BR smail (1) +.\"O mail delivery program. +¥á¡¼¥ëÇÛÁ÷¥×¥í¥°¥é¥à +.BR smail (1) +¤Î¥¹¥×¡¼¥ë¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/spool/uucp +.\"O Spooled files for +.\"O .BR uucp (1). +.BR uucp (1) +¤Î¥¹¥×¡¼¥ë¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/tmp +.\"O Like +.\"O .IR /tmp , +.\"O this directory holds temporary files stored for an unspecified duration. +.I /tmp +¤È»÷¤Æ¤¤¤ë¤¬¡¢ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤ë°ì»þŪ¤Ê¥Õ¥¡¥¤¥ë¤ÏÊݸ´ü´Ö¤ÎÀ©¸Â¤¬¤Ê¤¤¡£ +.TP +.I /var/yp +.\"O Database files for NIS. +NIS ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +The Filesystem Hierarchy Standard, Version 2.2 . +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O This list is not exhaustive; different systems may be configured +.\"O differently. +¤³¤Î¥ê¥¹¥È¤ÏÌÖÍåŪ¤Ê¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +¸Ä¡¹¤Î¥·¥¹¥Æ¥à¤Ç¤Ï°Û¤Ê¤ëÉôʬ¤¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR find (1), +.BR ln (1), +.BR proc (5), +.BR mount (8) + +The Filesystem Hierarchy Standard diff --git a/draft/man7/icmp.7 b/draft/man7/icmp.7 new file mode 100644 index 00000000..d6b58913 --- /dev/null +++ b/draft/man7/icmp.7 @@ -0,0 +1,332 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: icmp.7,v 1.8 2001/01/14 05:30:41 hanataka Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2008-12-26, Akihiro MOTOKI , LDP v3.14 +.\" +.\"WORD destination route ¹Ô¤­Àè·ÐÏ© +.\"WORD token packet filter ¥È¡¼¥¯¥ó¡¦¥Ñ¥±¥Ã¥È¡¦¥Õ¥£¥ë¥¿ +.\" +.TH ICMP 7 2010-02-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O icmp, IPPROTO_ICMP \- Linux IPv4 ICMP kernel module. +.SH ̾Á° +icmp, IPPROTO_ICMP \- Linux IPv4 ICMP ¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This kernel protocol module implements the Internet Control +.\"O Message Protocol defined in RFC\ 792. +.\"O It is used to signal error conditions and for diagnosis. +.\"O The user doesn't interact directly with this module; +.\"O instead it communicates with the other protocols in the kernel +.\"O and these pass the ICMP errors to the application layers. +.\"O The kernel ICMP module also answers ICMP requests. +¤³¤Î¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤Ï RFC\ 792 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë Internet +Control Message Protocol ¤ò¼ÂÁõ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥×¥í¥È¥³¥ë¤Ï¥¨¥é¡¼¾õ¶·¤òÃΤ餻¤¿¤ê¿ÇÃǤò¹Ô¤¦¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +¥æ¡¼¥¶¡¼¤Ï¤³¤Î¥â¥¸¥å¡¼¥ë¤È¤ÏľÀܤˤÏÄÌ¿®¤Ç¤­¤Ê¤¤¡£ +¤³¤Î¥â¥¸¥å¡¼¥ë¤Ï¥«¡¼¥Í¥ë¤Î¾¤Î¥×¥í¥È¥³¥ë¤ÈÄÌ¿®¤·¡¢ +¤½¤ì¤é¤Î¥×¥í¥È¥³¥ë¤¬ ICMP ¥¨¥é¡¼¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ì¥¤¥ä¤ËÅϤ¹¡£ +¥«¡¼¥Í¥ë¤Î ICMP ¥â¥¸¥å¡¼¥ë¤Ï ICMP ¥ê¥¯¥¨¥¹¥È¤ËÂФ¹¤ë±þÅú¤â¹Ô¤¦¡£ +.PP +.\"O A user protocol may receive ICMP packets for all local sockets by opening +.\"O a raw socket with the protocol +.\"O .BR IPPROTO_ICMP . +.\"O See +.\"O .BR raw (7) +.\"O for more information. +.\"O The types of ICMP packets passed to the socket can be filtered using the +.\"O .B ICMP_FILTER +.\"O socket option. +.\"O ICMP packets are always processed by the kernel too, even +.\"O when passed to a user socket. +raw ¥½¥±¥Ã¥È¤ò¥×¥í¥È¥³¥ë +.B IPPROTO_ICMP +¤Ç¥ª¡¼¥×¥ó¤¹¤ì¤Ð¡¢ +¥æ¡¼¥¶¡¼¥×¥í¥È¥³¥ë¤Ï¥í¡¼¥«¥ë¤Ê¥½¥±¥Ã¥ÈÁ´¤Æ¤ËÂФ¹¤ë +ICMP ¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¾ÜºÙ¤Ï +.BR raw (7) +¤ò»²¾È¤Î¤³¤È¡£ +¥½¥±¥Ã¥È¤ËÅϤµ¤ì¤ë ICMP ¥Ñ¥±¥Ã¥È¤Î¥¿¥¤¥×¤Ï +.B ICMP_FILTER +¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¥Õ¥£¥ë¥¿¡¼¤Ç¤­¤ë¡£ +ICMP ¥Ñ¥±¥Ã¥È¤Ï (¤¿¤È¤¨¥æ¡¼¥¶¡¼¥½¥±¥Ã¥È¤ËÅϤµ¤ì¤ë¾ì¹ç¤Ç¤â)¡¢ +¾ï¤Ë¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ (¤â) ½èÍý¤µ¤ì¤ë¡£ +.LP +.\"O Linux limits the rate of ICMP error packets to each destination. +.\"O .B ICMP_REDIRECT +.\"O and +.\"O .B ICMP_DEST_UNREACH +.\"O are also limited by the destination route of the incoming packets. +Linux ¤Ç¤Ï ICMP ¥¨¥é¡¼¥Ñ¥±¥Ã¥È¤Î¥ì¡¼¥È¤ò¤½¤ì¤¾¤ì¤ÎÁ÷¤êÀè¤ËÂФ·¤Æ +À©¸Â¤·¤Æ¤¤¤ë¡£ +.B ICMP_REDIRECT +¤È +.B ICMP_DEST_UNREACH +¤âÅþÃ夷¤¿¥Ñ¥±¥Ã¥È¤Î¹Ô¤­Àè·ÐÏ© (destination route) ¤òÀ©¸Â¤¹¤ë¡£ +.\"O .SS /proc interfaces +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.\"O ICMP supports a set of +.\"O .I /proc +.\"O interfaces to configure some global IP parameters. +.\"O The parameters can be accessed by reading or writing files in the directory +.\"O .IR /proc/sys/net/ipv4/ . +.\"O Most of these parameters are rate limitations for specific ICMP types. +.\"O Linux 2.2 uses a token bucket filter to limit ICMPs. +.\"O .\" FIXME better description needed +.\"O The value is the timeout in seconds until the token bucket filter is +.\"O cleared after a burst. +.\"O A jiffy is a system dependent unit, usually 10ms on i386 and +.\"O about 1ms on alpha and ia64. +ICMP ¤Ç¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¥°¥í¡¼¥Ð¥ë¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë¤¿¤á¤Î +.I /proc +¥Õ¥¡¥¤¥ë·²¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤Ë¤Ï¡¢ +.I /proc/sys/net/ipv4/ +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤Î¤Û¤È¤ó¤É¤ÏÆÃÄê¤Î ICMP ¥¿¥¤¥×¤ËÂФ¹¤ë¥ì¡¼¥ÈÀ©¸Â +(rate limitation) ¤Ç¤¢¤ë¡£ +Linux 2.2 ¤Ï ICMP ¤ÎÀ©¸Â¤Ë¥È¡¼¥¯¥ó¡¦¥Ð¥±¥Ã¥È¡¦¥Õ¥£¥ë¥¿ +(token bucket filter) ¤òÍѤ¤¤ë¡£ +.\" FIXME better description needed +¤½¤ì¤¾¤ì¤ÎÃͤϡ¢¥Ð¡¼¥¹¥È¤Î¸å¤Ë¥È¡¼¥¯¥ó¡¦¥Ð¥±¥Ã¥È¡¦¥Õ¥£¥ë¥¿¤¬¥¯¥ê¥¢ +¤µ¤ì¤ë¤Þ¤Ç¤Î¥¿¥¤¥à¥¢¥¦¥È¤òÉÃñ°Ì¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ºÇ¾®Ã±°Ì(jiffy)¤Ï +¥·¥¹¥Æ¥à°Í¸¤Îñ°Ì¤Ç i386 ¥·¥¹¥Æ¥à¤ÏÄ̾ï 10ms¡¢alpha ¤ä ia64 ¤Ç¤Ï +1ms ¤Ç¤¢¤ë¡£ +.TP +.\"O .IR icmp_destunreach_rate " (Linux 2.2 to 2.4.9)" +.IR icmp_destunreach_rate " (Linux 2.2 ¤«¤é 2.4.9 ¤Þ¤Ç)" +.\" Precisely: from 2.1.102 +.\"O Maximum rate to send ICMP Destination Unreachable packets. +.\"O This limits the rate at which packets are sent to any individual +.\"O route or destination. +.\"O The limit does not affect sending of +.\"O .B ICMP_FRAG_NEEDED +.\"O packets needed for path MTU discovery. +ICMP ÉÔã¥Ñ¥±¥Ã¥È (Destination Unreachable packet) ¤òÁ÷¤ëºÇÂç¥ì¡¼¥È¡£ +¤³¤ì¤ÏÆÃÄê¤Î¥ë¡¼¥È¤Þ¤¿¤Ï¹Ô¤­Àè¤Ë¥Ñ¥±¥Ã¥È¤òÁ÷¿®¤¹¤ë¥ì¡¼¥È¤òÀ©¸Â¤¹¤ë¡£ +¤³¤ÎÀ©¸Â¤Ï¡¢ +path MTU discovery ¤ËɬÍ×¤Ê +.B ICMP_FRAG_NEEDED +¥Ñ¥±¥Ã¥È¤ÎÁ÷¿®¤Ë¤Ï±Æ¶Á¤·¤Ê¤¤¡£ +.TP +.\"O .IR icmp_echo_ignore_all " (since Linux 2.2)" +.IR icmp_echo_ignore_all " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.68 +.\"O If this value is nonzero, Linux will ignore all +.\"O .B ICMP_ECHO +.\"O requests. +¤³¤ÎÃͤ¬Èó¥¼¥í¤Î¾ì¹ç¤Ï¡¢ Linux ¤Ï¤¹¤Ù¤Æ¤Î +.B ICMP_ECHO +Í×µá¤ò̵»ë¤¹¤ë¡£ +.TP +.\"O .IR icmp_echo_ignore_broadcasts " (since Linux 2.2)" +.IR icmp_echo_ignore_broadcasts " (Linux 2.2 °Ê¹ß)" +.\" Precisely: from 2.1.68 +.\"O If this value is nonzero, Linux will ignore all +.\"O .B ICMP_ECHO +.\"O packets sent to broadcast addresses. +¤³¤ÎÃͤ¬Èó¥¼¥í¤Î¾ì¹ç¤Ï¡¢ Linux ¤Ï¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ËÁ÷¤é¤ì¤¿¤¹¤Ù¤Æ¤Î +.B ICMP_ECHO +Í×µá¤ò̵»ë¤¹¤ë¡£ +.TP +.\"O .IR icmp_echoreply_rate " (Linux 2.2 to 2.4.9)" +.IR icmp_echoreply_rate " (Linux 2.2 ¤«¤é 2.4.9 ¤Þ¤Ç)" +.\" Precisely: from 2.1.102 +.\"O Maximum rate for sending +.\"O .B ICMP_ECHOREPLY +.\"O packets in response to +.\"O .B ICMP_ECHOREQUEST +.\"O packets. +.B ICMP_ECHOREQUEST +¥Ñ¥±¥Ã¥È¤Ë±þÅú¤¹¤ë +.B ICMP_ECHOREPLY +¥Ñ¥±¥Ã¥È¤ÎºÇÂçÁ÷¿®¥ì¡¼¥È¡£ +.TP +.\"O .IR icmp_errors_use_inbound_ifaddr " (Boolean; default: disabled; since Linux 2.6.12)" +.IR icmp_errors_use_inbound_ifaddr " (Boolean; default: disabled; Linux 2.6.12 °Ê¹ß)" +.\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt +.\"O If disabled, ICMP error messages are sent with the primary address of +.\"O the exiting interface. +¤³¤ì¤ò̵¸ú¤Ë¤¹¤ë¤È¡¢ICMP ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Ï¡¢ +½ÐÎÏ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¥×¥é¥¤¥Þ¥ê¥¢¥É¥ì¥¹¤ÇÁ÷¿®¤µ¤ì¤ë¡£ + +.\"O If enabled, the message will be sent with the primary address of +.\"O the interface that received the packet that caused the ICMP error. +.\"O This is the behavior that many network administrators will expect from +.\"O a router. +.\"O And it can make debugging complicated network layouts much easier. +¤³¤ì¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Ï ICMP ¥¨¥é¡¼¤Î¸¶°ø¤È¤Ê¤Ã¤¿¥Ñ¥±¥Ã¥È¤ò +¼õ¿®¤·¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¥×¥é¥¤¥Þ¥¢¥É¥ì¥¹¤ÇÁ÷¿®¤µ¤ì¤ë¡£ +¤³¤ÎÆ°ºî¤Ï¡¢Â¿¤¯¤Î¥Í¥Ã¥È¥ï¡¼¥¯´ÉÍý¼Ô¤¬¥ë¡¼¥¿¤ËÂФ·¤Æ´üÂÔ¤·¤Æ¤¤¤ë¤â¤Î¤Ç¤¢¤ê¡¢ +¤³¤ì¤Ë¤è¤êÊ£»¨¤Ê¥Í¥Ã¥È¥ï¡¼¥¯¥ì¥¤¥¢¥¦¥È¤Î¥Ç¥Ð¥Ã¥°¤¬¤è¤êÍưפˤʤ롣 + +.\"O Note that if no primary address exists for the interface selected, +.\"O then the primary address of the first non-loopback interface that +.\"O has one will be used regardless of this setting. +ÁªÂò¤µ¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¥×¥é¥¤¥Þ¥ê¥¢¥É¥ì¥¹¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢ +¤³¤ÎÀßÄê¤Ë´Ø¤ï¤é¤º¡¢ºÇ½é¤Î¥ë¡¼¥×¥Ð¥Ã¥¯°Ê³°¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¡¢ +¥×¥é¥¤¥Þ¥ê¥¢¥É¥ì¥¹¤ò»ý¤Ä¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¥×¥é¥¤¥Þ¥ê¥¢¥É¥ì¥¹¤¬»ÈÍѤµ¤ì¤ëÅÀ¤Ë +Ãí°Õ¤¹¤ë¤³¤È¡£ +.TP +.\"O .IR icmp_ignore_bogus_error_responses " (Boolean; default: disabled; since Linux 2.2)" +.IR icmp_ignore_bogus_error_responses " (Boolean; default: disabled; Linux 2.2 °Ê¹ß)" +.\" precisely: since 2.1.32 +.\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt +.\"O Some routers violate RFC1122 by sending bogus responses to broadcast frames. +.\"O Such violations are normally logged via a kernel warning. +.\"O If this parameter is enabled, the kernel will not give such warnings, +.\"O which will avoid log file clutter. +¥ë¡¼¥¿¤ÎÃæ¤Ë¤Ï¡¢RFC1122 ¤Ë°ãÈ¿¤·¡¢¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥Õ¥ì¡¼¥à¤ËÂФ·¤Æ +µ¶¤Î±þÅú¤òÁ÷¿®¤¹¤ë¤â¤Î¤¬¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê°ãÈ¿¤ÏÄ̾參¡¼¥Í¥ë¤Î·Ù¹ð¤È¤·¤Æ¥í¥°¤Ëµ­Ï¿¤µ¤ì¤ë¡£ +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï¤³¤Î¤è¤¦¤Ê·Ù¹ð¤ò½Ð¤µ¤Ê¤¯¤Ê¤ê¡¢ +¥í¥°¥Õ¥¡¥¤¥ë¤Ë»¨²»¤Î¤è¤¦¤Ê¾ðÊ󤬵­Ï¿¤µ¤ì¤ë¤Î¤òÈò¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.\"O .IR icmp_paramprob_rate " (Linux 2.2 to 2.4.9)" +.IR icmp_paramprob_rate " (Linux 2.2 ¤«¤é 2.4.9 ¤Þ¤Ç)" +.\" Precisely: from 2.1.102 +.\"O Maximum rate for sending +.\"O .B ICMP_PARAMETERPROB +.\"O packets. +.\"O These packets are sent when a packet arrives with an invalid IP header. +.B ICMP_PARAMETERPROB +¥Ñ¥±¥Ã¥È¤ÎºÇÂçÁ÷¿®¥ì¡¼¥È¡£ +¤³¤ì¤é¤Î¥Ñ¥±¥Ã¥È¤ÏÉÔÀµ¤Ê IP ¥Ø¥Ã¥À¤ò»ý¤Ä¥Ñ¥±¥Ã¥È¤¬ÅþÃ夷¤¿¾ì¹ç¤Ë +Á÷¿®¤µ¤ì¤ë¡£ +.TP +.\"O .IR icmp_ratelimit " (integer; default: 1000; since Linux 2.4.10)" +.IR icmp_ratelimit " (integer; default: 1000; Linux 2.4.10 °Ê¹ß)" +.\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt +.\"O Limit the maximum rates for sending ICMP packets whose type matches +.\"O .IR icmp_ratemask +.\"O (see below) to specific targets. +.\"O 0 to disable any limiting, +.\"O otherwise the minimum space between responses in milliseconds. +¼ïÊ̤¬ +.I icmp_ratemask +(²¼µ­»²¾È) ¤Ë¥Þ¥Ã¥Á¤·¤¿ ICMP ¥Ñ¥±¥Ã¥È¤Î¡¢ +ÆÃÄê¤ÎÁ÷¿®Àè¤Ø¤ÎÁ÷¿®¥ì¡¼¥È¤ÎºÇÂçÃͤòÀ©¸Â¤¹¤ë¡£ +0 ¤Ï¥ì¡¼¥ÈÀ©¸Â¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤ò¡¢ +0 °Ê³°¤ÎÃͤϱþÅú´Ö¤ÎºÇ¾®´Ö³Ö (¥ß¥êÉÃñ°Ì) ¤ò¼¨¤¹¡£ +.TP +.\"O .IR icmp_ratemask " (integer; default: see below; since Linux 2.4.10)" +.IR icmp_ratemask " (integer; default: ²¼µ­»²¾È; Linux 2.4.10 °Ê¹ß)" +.\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt +.\"O Mask made of ICMP types for which rates are being limited. +¥ì¡¼¥ÈÀ©¸Â¤ò¹Ô¤¦ ICMP ¥¿¥¤¥×¤ò·è¤á¤ë¥Þ¥¹¥¯¡£ + +.\"O Significant bits: IHGFEDCBA9876543210 +.\"O .br +.\"O Default mask: 0000001100000011000 (0x1818) +Í­¸ú¥Ó¥Ã¥È: IHGFEDCBA9876543210 +.br +¥Ç¥Õ¥©¥ë¥È¥Þ¥¹¥¯: 0000001100000011000 (0x1818) + +.\"O Bit definitions (see the kernel source file +.\"O .IR include/linux/icmp.h ): +¥Ó¥Ã¥ÈÄêµÁ (¥«¡¼¥Í¥ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë +.I include/linux/icmp.h +¤ò»²¾È): + +.in +4n +.nf +0 Echo Reply +3 Destination Unreachable * +4 Source Quench * +5 Redirect +8 Echo Request +B Time Exceeded * +C Parameter Problem * +D Timestamp Request +E Timestamp Reply +F Info Request +G Info Reply +H Address Mask Request +I Address Mask Reply +.fi +.in + +.\"O The bits marked with an asterisk are rate limited by default +.\"O (see the default mask above). +¥¢¥¹¥¿¥ê¥¹¥¯°õ¤¬ÉÕ¤¤¤¿¥Ó¥Ã¥È¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¥ì¡¼¥ÈÀ©¸Â¤¬Í­¸ú¤Ë +¤Ê¤Ã¤Æ¤¤¤ë (¾åµ­¤Î¥Þ¥¹¥¯¤Î¥Ç¥Õ¥©¥ë¥È¤â»²¾È)¡£ +.TP +.\"O .IR icmp_timeexceed_rate " (Linux 2.2 to 2.4.9)" +.IR icmp_timeexceed_rate " (Linux 2.2 ¤«¤é 2.4.9 ¤Þ¤Ç)" +.\"O Maximum rate for sending +.\"O .B ICMP_TIME_EXCEEDED +.\"O packets. +.\"O These packets are +.\"O sent to prevent loops when a packet has crossed too many hops. +.B ICMP_TIME_EXCEEDED +¥Ñ¥±¥Ã¥È¤ÎºÇÂçÁ÷¿®¥ì¡¼¥È¡£ +¤³¤ì¤é¤Î¥Ñ¥±¥Ã¥È¤Ï¥Ñ¥±¥Ã¥È¤¬¤¢¤Þ¤ê¤Ë¿¤¯¤Î hop ¤òÄ̲ᤷ¤¿¾ì¹ç¤Ë¡¢ +¥ë¡¼¥×¤òËɤ°¤¿¤á¤ËÁ÷¤é¤ì¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O Support for the +.\"O .B ICMP_ADDRESS +.\"O request was removed in 2.2. +.B ICMP_ADDRESS +Í×µá¤ËÂФ¹¤ë¥µ¥Ý¡¼¥È¤Ï 2.2 ¤Çºï½ü¤µ¤ì¤¿¡£ +.PP +.\"O Support for +.\"O .B ICMP_SOURCE_QUENCH +.\"O was removed in Linux 2.2. +.B ICMP_SOURCE_QUENCH +¤Ï Linux 2.2 ¤Çºï½ü¤µ¤ì¤¿¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O As many other implementations don't support +.\"O .B IPPROTO_ICMP +.\"O raw sockets, this feature +.\"O should not be relied on in portable programs. +¾¤Î¿¤¯¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.B IPPROTO_ICMP +raw ¥½¥±¥Ã¥È¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤Îµ¡Ç½¤Ï°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¤ÏÍѤ¤¤ë¤Ù¤­¤Ç¤Ê¤¤¡£ +.\" not really true ATM +.\" .PP +.\" Linux ICMP should be compliant to RFC 1122. +.PP +.\"O .B ICMP_REDIRECT +.\"O packets are not sent when Linux is not acting as a router. +.\"O They are also only accepted from the old gateway defined in the +.\"O routing table and the redirect routes are expired after some time. +Linux ¤¬¥ë¡¼¥¿¡¼¤È¤·¤ÆÆ°ºî¤·¤Æ¤¤¤Ê¤¤¤È¤­¤Ë¤Ï¡¢ +.B ICMP_REDIRECT +¥Ñ¥±¥Ã¥È¤ÏÁ÷¿®¤µ¤ì¤Ê¤¤¡£ +¤Þ¤¿¤³¤ì¤é¤¬¼õ¤±¼è¤é¤ì¤ë¤Î¤â¡¢È¯¿®¸µ¤¬¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +¸Å¤¤¥²¡¼¥È¥¦¥§¥¤¤Ç¡¢¥ê¥À¥¤¥ì¥¯¥È¡¦¥ë¡¼¥È (redirect route) ¤¬ +ŬÅö¤Ê»þ´Ö¤Î¸å¤Ë´ü¸ÂÀÚ¤ì¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¸Â¤é¤ì¤ë¡£ +.PP +.\"O The 64-bit timestamp returned by +.\"O .B ICMP_TIMESTAMP +.\"O is in milliseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). +.B ICMP_TIMESTAMP +¤«¤éÊÖ¤µ¤ì¤ë 64 ¥Ó¥Ã¥È¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤Ï¡¢ +µª¸µ (Epoch) ¤Ç¤¢¤ë 1970-01-01 00:00:00 +0000 (UTC) +¤«¤é¤Î·Ð²á»þ´Ö¤ò¥ß¥êÉÃñ°Ì¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.PP +.\"O Linux ICMP internally uses a raw socket to send ICMPs. +.\"O This raw socket may appear in +.\"O .BR netstat (8) +.\"O output with a zero inode. +Linux ICMP ¤Ï ICMP ¤òÁ÷¤ë¤¿¤á¤ËÆâÉô¤Ç raw ¥½¥±¥Ã¥È¤òÍѤ¤¤ë¡£ +raw ¥½¥±¥Ã¥È¤Ï +.BR netstat (8) +¤Î½ÐÎÏ¤Ë 0 inode ¤È¤·¤Æ½ÐÎϤµ¤ì¤ë¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR ip (7) +.PP +.\"O RFC\ 792 for a description of the ICMP protocol. +.BR RFC\ 792 : +ICMP ¥×¥í¥È¥³¥ë¤ÎÀâÌÀ diff --git a/draft/man7/inotify.7 b/draft/man7/inotify.7 new file mode 100644 index 00000000..9dcdb1f8 --- /dev/null +++ b/draft/man7/inotify.7 @@ -0,0 +1,698 @@ +'\" 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 new file mode 100644 index 00000000..4aaaa438 --- /dev/null +++ b/draft/man7/intro.7 @@ -0,0 +1,56 @@ +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de), Fri Apr 2 11:32:09 MET DST +.\" 1993 +.\" +.\" 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 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 +.\" +.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 ¾Ï¤Ë¤ÏÍÍ¡¹¤Ê»öÊÁ¤Î³µÍפ¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +½¬´·¡¢¥×¥í¥È¥³¥ë¡¢Ê¸»ú½¸¹ç¤Îµ¬³Ê¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¹½À®¡¢ +¤½¤Î¾¤Î»¨Â¿¤Ê¤³¤È¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤ë¡£ +.\"O .SH NOTES +.SH È÷¹Í +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR standards (7) diff --git a/draft/man7/ip.7 b/draft/man7/ip.7 new file mode 100644 index 00000000..09ab9289 --- /dev/null +++ b/draft/man7/ip.7 @@ -0,0 +1,1832 @@ +'\" t +.\" Don't change the line above. it tells man that tbl is needed. +.\" This man page is Copyright (C) 1999 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. +.\" $Id: ip.7,v 1.19 2000/12/20 18:10:31 ak Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2001-02-14, Kentaro Shirakata +.\" Updated 2001-04-04, Yuichi SATO +.\" Updated & Modified 2003-10-16, Yuichi SATO +.\" Updated & Modified 2005-01-22, Yuichi SATO +.\" Updated & Modified 2005-09-10, Akihiro MOTOKI +.\" Updated & Modified 2005-10-06, Akihiro MOTOKI +.\" Updated 2007-01-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.43 +.\" Updated 2007-05-28, Akihiro MOTOKI , LDP v2.48 +.\" Updated 2008-12-26, Akihiro MOTOKI , LDP v3.14 +.\" +.\"WORD ancillary message Êä½õ¥á¥Ã¥»¡¼¥¸ +.\"WORD ... oriented ¡Á»Ø¸þ¤Î +.\"WORD capability ¸¢¸Â +.\"WORD payload ¥Ú¥¤¥í¡¼¥É +.\"WORD drop(ped) (¥Ñ¥±¥Ã¥È¤ò) Íî¤È¤¹¡¢(¼õÆ°¤Î¾ì¹ç) ÅþÃ夷¤Ê¤¤ +.\"WORD tap ¥¿¥Ã¥×(¤¹¤ë) +.\" +.TH IP 7 2009-02-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ip \- Linux IPv4 protocol implementation +ip \- Linux IPv4 ¥×¥í¥È¥³¥ë¤Î¼ÂÁõ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.\" .B #include -- does not exist anymore +.\" .B #include -- never include +.B #include +.br +.\"O .B #include \fR/* superset of previous */ +.B #include \fR/* ¾åµ­¤Î¥¹¡¼¥Ñ¡¼¥»¥Ã¥È */ +.sp +.IB tcp_socket " = socket(AF_INET, SOCK_STREAM, 0);" +.br +.IB udp_socket " = socket(AF_INET, SOCK_DGRAM, 0);" +.br +.IB raw_socket " = socket(AF_INET, SOCK_RAW, " protocol ");" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Linux implements the Internet Protocol, version 4, +.\"O described in RFC\ 791 and RFC\ 1122. +.\"O .B ip +.\"O contains a level 2 multicasting implementation conforming to RFC\ 1112. +.\"O It also contains an IP router including a packet filter. +Linux ¤Ï RFC\ 791 ¤È RFC\ 1122 ¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤ë +Internet Protocol, version 4 ¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +.B ip +¤Ë¤Ï RFC\ 1112 ¤Ë½àµò¤·¤¿ level 2 ¥Þ¥ë¥Á¥­¥ã¥¹¥È¤Î¼ÂÁõ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¤Þ¤¿¥Ñ¥±¥Ã¥È¥Õ¥£¥ë¥¿µ¡Ç½¤ò´Þ¤à IP ¥ë¡¼¥¿¡¼¤â¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" FIXME has someone verified that 2.1 is really 1812 compliant? +.PP +.\"O The programming interface is BSD-sockets compatible. +.\"O For more information on sockets, see +.\"O .BR socket (7). +¥×¥í¥°¥é¥ß¥ó¥°¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï BSD ¥½¥±¥Ã¥È¤È¸ß´¹¤Ç¤¢¤ë¡£ +¥½¥±¥Ã¥È¤Ë´Ø¤¹¤ë¤è¤ê¾ÜºÙ¤Ê¾ðÊó¤Ï +.BR socket (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O An IP socket is created by calling the +.\"O .BR socket (2) +.\"O function as +.\"O .BR "socket(AF_INET, socket_type, protocol)" . +IP ¥½¥±¥Ã¥È¤Ï¡¢ +.BR socket (2) +´Ø¿ô¤ò +.B "socket(AF_INET, socket_type, protocol)" +¤Î¤è¤¦¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤ÇÀ¸À®¤µ¤ì¤ë¡£ +.\"O Valid socket types are +.\"O .B SOCK_STREAM +.\"O to open a +.\"O .BR tcp (7) +.\"O socket, +.\"O .B SOCK_DGRAM +.\"O to open a +.\"O .BR udp (7) +.\"O socket, or +.\"O .B SOCK_RAW +.\"O to open a +.\"O .BR raw (7) +.\"O socket to access the IP protocol directly. +»ØÄê¤Ç¤­¤ë¥½¥±¥Ã¥È¥¿¥¤¥×¤Ï 3 ¤Ä¤¢¤ê¡¢ +.BR tcp (7) +¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¾ì¹ç +.BR SOCK_STREAM ¡¢ +.BR udp (7) +¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¾ì¹ç +.BR SOCK_DGRAM ¡¢ +IP ¥×¥í¥È¥³¥ë¤ËľÀÜ¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Ë +.BR raw (7) +¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¾ì¹ç¤Ë¤Ï +.B SOCK_RAW +¤Ç¤¢¤ë¡£ +.\"O .I protocol +.\"O is the IP protocol in the IP header to be received or sent. +.\"O The only valid values for +.\"O .I protocol +.\"O are 0 and +.\"O .B IPPROTO_TCP +.\"O for TCP sockets, and 0 and +.\"O .B IPPROTO_UDP +.\"O for UDP sockets. +.\"O For +.\"O .B SOCK_RAW +.\"O you may specify a valid IANA IP protocol defined in +.\"O RFC\ 1700 assigned numbers. +.I protocol +¤ÏÁ÷¼õ¿®¤µ¤ì¤ë IP ¥Ø¥Ã¥À¤Ë½ñ¤«¤ì¤ë IP ¥×¥í¥È¥³¥ë¤Ç¤¢¤ë¡£ +»ØÄê¤Ç¤­¤ëÃͤϡ¢ +TCP ¥½¥±¥Ã¥È¤Ë¤Ï 0 ¤« +.BR IPPROTO_TCP ¡¢ +UDP ¥½¥±¥Ã¥È¤Ë¤Ï 0 ¤« +.B IPPROTO_UDP +¤Ë¸Â¤é¤ì¤ë¡£ +.B SOCK_RAW +¤ËÂФ·¤Æ¤Ï¡¢ RFC\ 1700 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÍ­¸ú¤Ê IANA IP ¥×¥í¥È¥³¥ë¤ò¡¢ +³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ëÈÖ¹æ¤Ç»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\" FIXME ip current does an autobind in listen, but I'm not sure +.\" if that should be documented. +.\"O When a process wants to receive new incoming packets or connections, it +.\"O should bind a socket to a local interface address using +.\"O .BR bind (2). +.\"O Only one IP socket may be bound to any given local (address, port) pair. +.\"O When +.\"O .B INADDR_ANY +.\"O is specified in the bind call, the socket will be bound to +.\"O .I all +.\"O local interfaces. +.\"O When +.\"O .BR listen (2) +.\"O or +.\"O .BR connect (2) +.\"O are called on an unbound socket, it is automatically bound to a +.\"O random free port with the local address set to +.\"O .BR INADDR_ANY . +¤¢¤ë¥×¥í¥»¥¹¤Ç¡¢¤ä¤Ã¤Æ¤¯¤ë¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤·¤¿¤ê +ÀܳÍ×µá¤ò¼õ¤±¤¿¤ê¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +¤½¤Î¥×¥í¥»¥¹¤Ï¥í¡¼¥«¥ë¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤Ë¡¢ +.BR bind (2) +¤òÍѤ¤¤Æ¥½¥±¥Ã¥È¤ò¥Ð¥¤¥ó¥É¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤¢¤ë¥í¡¼¥«¥ë¤Ê¡Ö¥¢¥É¥ì¥¹¤È¥Ý¡¼¥È¡×¤Î¥Ú¥¢¤ËÂФ·¤Æ¥Ð¥¤¥ó¥É¤Ç¤­¤ë +IP ¥½¥±¥Ã¥È¤Ï°ì¤Ä¤Ë¸Â¤é¤ì¤ë¡£ +.BR bind (2) +¤Î¸Æ¤Ó½Ð¤·¤Ç +.B INADDR_ANY +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ï¡¢¥½¥±¥Ã¥È¤Ï¥í¡¼¥«¥ë¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î +\fI¤¹¤Ù¤Æ\fP¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤ë¡£ +.BR listen (2) +¤Þ¤¿¤Ï +.BR connect (2) +¤¬¥Ð¥¤¥ó¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤Ç¥³¡¼¥ë¤µ¤ì¤ë¤È¡¢ +¤½¤Î¥½¥±¥Ã¥È¤Ï¼«Æ°Åª¤Ë¥í¡¼¥«¥ë¤Ê¥¢¥É¥ì¥¹¤ò +.B INADDR_ANY +¤Ë¥»¥Ã¥È¤·¡¢¶õ¤¤¤Æ¤¤¤ë¥Ý¡¼¥È¤ò¥é¥ó¥À¥à¤ËÁª¤ó¤Ç¥Ð¥¤¥ó¥É¤¹¤ë¡£ + +.\"O A TCP local socket address that has been bound is unavailable for +.\"O some time after closing, unless the +.\"O .B SO_REUSEADDR +.\"O flag has been set. +.\"O Care should be taken when using this flag as it makes TCP less reliable. +.B SO_REUSEADDR +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +¥Ð¥¤¥ó¥É¤µ¤ì¤Æ¤¤¤¿ TCP ¥í¡¼¥«¥ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï +¥¯¥í¡¼¥º¤µ¤ì¤¿¸å¤·¤Ð¤é¤¯¤Î´Ö»È¤¨¤Ê¤¯¤Ê¤ë¡£ +.B SO_REUSEADDR +¥Õ¥é¥°¤ò»È¤¦¤È TCP ¤Î¿®ÍêÀ­¤òÄã²¼¤µ¤»¤ë¤Î¤Ç¡¢ +»È¤¦¤È¤­¤Ë¤ÏÃí°Õ¤¬É¬ÍפǤ¢¤ë¡£ +.\"O .SS Address Format +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.\"O An IP socket address is defined as a combination of an IP interface +.\"O address and a 16-bit port number. +.\"O The basic IP protocol does not supply port numbers, they +.\"O are implemented by higher level protocols like +.\"O .BR udp (7) +.\"O and +.\"O .BR tcp (7). +.\"O On raw sockets +.\"O .I sin_port +.\"O is set to the IP protocol. +IP ¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï¡¢ IP ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤È +16¥Ó¥Ã¥È¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ÎÁȤ߹ç¤ï¤»¤ÇÄêµÁ¤µ¤ì¤ë¡£ +IP ¥×¥í¥È¥³¥ë¤½¤Î¤â¤Î¤Ï¥Ý¡¼¥ÈÈÖ¹æ¤ò°·¤ï¤Ê¤¤¡£ +¥Ý¡¼¥ÈÈÖ¹æ¤Ï¡¢ +.BR udp (7) +¤ä +.BR tcp (7) +¤È¤¤¤Ã¤¿¡¢¾å°Ì¤Î¥×¥í¥È¥³¥ë¤Ç¼ÂÁõ¤µ¤ì¤ë¡£ +raw ¥½¥±¥Ã¥È¤Ç¤Ï¡¢ +.I sin_port +¤¬ IP ¥×¥í¥È¥³¥ë¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.in +4n +.nf +struct sockaddr_in { + sa_family_t sin_family; /* address family: AF_INET */ + in_port_t sin_port; /* port in network byte order */ + struct in_addr sin_addr; /* internet address */ +}; + +/* Internet address. */ +struct in_addr { + uint32_t s_addr; /* address in network byte order */ +}; +.fi +.in +.PP +.\"O .I sin_family +.\"O is always set to +.\"O .BR AF_INET . +.\"O This is required; in Linux 2.2 most networking functions return +.\"O .B EINVAL +.\"O when this setting is missing. +.\"O .I sin_port +.\"O contains the port in network byte order. +.\"O The port numbers below 1024 are called +.\"O .IR "privileged ports" +.\"O (or sometimes: +.\"O .IR "reserved ports" ). +.\"O Only privileged processes (i.e., those having the +.\"O .B CAP_NET_BIND_SERVICE +.\"O capability) may +.\"O .BR bind (2) +.\"O to these sockets. +.\"O Note that the raw IPv4 protocol as such has no concept of a +.\"O port, they are only implemented by higher protocols like +.\"O .BR tcp (7) +.\"O and +.\"O .BR udp (7). +.I sin_familiy +¤Ë¤Ï¾ï¤Ë +.B AF_INET +¤ò¥»¥Ã¥È¤¹¤ë¡£¤³¤ì¤Ïɬ¿Ü¤Ç¤¢¤ë¡£ Linux 2.2 ¤Ç¤Ï¡¢¤³¤Î¥»¥Ã¥È¤ò˺¤ì¤ë¤È +¤Û¤È¤ó¤É¤Î¥Í¥Ã¥È¥ï¡¼¥¯´Ø¿ô¤Ï +.B EINVAL +¤òÊÖ¤¹¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.I sin_port +¤Ë¤Ï¥Ý¡¼¥ÈÈÖ¹æ¤ò¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç»ØÄꤹ¤ë¡£ +1024 ̤Ëþ¤Î¥Ý¡¼¥ÈÈÖ¹æ¤Ï +.I "Æø¢¥Ý¡¼¥È (privileged ports)" +¤È¸Æ¤Ð¤ì¤ë +.RI ( "ͽÌó¥Ý¡¼¥È (reserved ports)" +¤È¤â»þ¡¹¸Æ¤Ð¤ì¤ë)¡£ +Æø¢¥×¥í¥»¥¹ +.RB ( CAP_NET_BIND_SERVICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) °Ê³°¤Î¥×¥í¥»¥¹¤Ï¡¢¤³¤ì¤é¤Î¥Ý¡¼¥È¤Ë¤Ï +.BR bind (2) +¤Ç¤­¤Ê¤¤¡£ IPv4 ¥×¥í¥È¥³¥ë¤½¤Î¤â¤Î¤Ë¤Ï¥Ý¡¼¥È¤Ë´Ø¤¹¤ë³µÇ°¤¬¤Ê¤¤¡£ +¥Ý¡¼¥È¤Ï¡¢ +.BR tcp (7) +¤ä +.BR udp (7) +¤È¤¤¤Ã¤¿¡¢¾å°Ì¤Î¥×¥í¥È¥³¥ë¤Ë¤ª¤¤¤Æ¼ÂÁõ¤µ¤ì¤ë¡£ +.PP +.\"O .I sin_addr +.\"O is the IP host address. +.\"O The +.\"O .I s_addr +.\"O member of +.\"O .I struct in_addr +.\"O contains the host interface address in network byte order. +.I sin_addr +¤Ï IP ¥Û¥¹¥È¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I struct in_addr +¤Î +.I s_addr +¥á¥ó¥Ð¤Ë¤Ï¡¢¥Û¥¹¥È¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤ò +¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç»ØÄꤹ¤ë¡£ +.\"O .I in_addr +.\"O should be assigned one of the INADDR_* values (e.g., +.\"O .BR INADDR_ANY ) +.\"O or set using the +.\"O .BR inet_aton (3), +.\"O .BR inet_addr (3), +.\"O .BR inet_makeaddr (3) +.\"O library functions or directly with the name resolver (see +.\"O .BR gethostbyname (3)). +.I in_addr +¤Ï¡¢INADDR_* ¤Î°ì¤Ä (Î㤨¤Ð +.BR INADDR_ANY ) +¤òÂåÆþ¤¹¤ë¡¢ +¥é¥¤¥Ö¥é¥ê´Ø¿ô +.BR inet_aton (3), +.BR inet_addr (3), +.BR inet_makeaddr (3) +¤òÍѤ¤¤ë¡¢¤¢¤ë¤¤¤Ï̾Á°²ò·èµ¡¹½ (name resolver) +¤òľÀÜÍѤ¤¤ë¡¢¤Î¤É¤ì¤«¤ÇÀßÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.RB ( gethostbyname (3) +¤ò¸«¤è)¡£ + +.\"O IPv4 addresses are divided into unicast, broadcast +.\"O and multicast addresses. +.\"O Unicast addresses specify a single interface of a host, +.\"O broadcast addresses specify all hosts on a network and multicast +.\"O addresses address all hosts in a multicast group. +.\"O Datagrams to broadcast addresses can be only sent or received when the +.\"O .B SO_BROADCAST +.\"O socket flag is set. +IPv4 ¥¢¥É¥ì¥¹¤Ë¤Ï¡¢¥æ¥Ë¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¡¢ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¡¢¥Þ¥ë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤¬¤¢¤ë¡£ +¥æ¥Ë¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ï¡¢¤¢¤ë¥Û¥¹¥È¤Î°ì¤Ä¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤹ¤ë¡£ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ï¡¢¤¢¤ë¥Í¥Ã¥È¥ï¡¼¥¯¾å¤ÎÁ´¤Æ¤Î¥Û¥¹¥È¤ò»ØÄꤹ¤ë¡£ +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ï¡¢¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Ë½ê°¤¹¤ë +Á´¤Æ¤Î¥Û¥¹¥È¤ò»ØÄꤹ¤ë¡£¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ø¤Î¥Ç¡¼¥¿¥°¥é¥à¤Ï¡¢ +.B SO_BROADCAST +¥½¥±¥Ã¥È¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤ÈÁ÷¿®¡¦¼õ¿®¤Ç¤­¤Ê¤¤¡£ +.\"O In the current implementation, connection oriented sockets are only allowed +.\"O to use unicast addresses. +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢Àܳ»Ø¸þ¤Î¥½¥±¥Ã¥È¤Ë¤Ï¥æ¥Ë¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤·¤«»È¤¨¤Ê¤¤¡£ +.\" Leave a loophole for XTP @) + +.\"O Note that the address and the port are always stored in +.\"O network byte order. +.\"O In particular, this means that you need to call +.\"O .BR htons (3) +.\"O on the number that is assigned to a port. +.\"O All address/port manipulation +.\"O functions in the standard library work in network byte order. +¥¢¥É¥ì¥¹¤È¥Ý¡¼¥È¤Ï¾ï¤Ë¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç³ÊǼ¤µ¤ì¤ë¤³¤È¤ËÃí°Õ¤»¤è¡£ +¶ñÂÎŪ¤Ë¤Ï¡¢¥Ý¡¼¥È¤ò»ØÄꤹ¤ë¿ôÃÍ¤Ë¤Ï +.BR htons (3) +¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢¤ë¡£ +ɸ½à¥é¥¤¥Ö¥é¥ê¤Ë¤¢¤ë¥¢¥É¥ì¥¹/¥Ý¡¼¥ÈÁàºî´Ø¿ô¤Ï +¤¹¤Ù¤Æ¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤ÇÆ°ºî¤¹¤ë¡£ + +.\"O There are several special addresses: +.\"O .B INADDR_LOOPBACK +.\"O (127.0.0.1) +.\"O always refers to the local host via the loopback device; +.\"O .B INADDR_ANY +.\"O (0.0.0.0) +.\"O means any address for binding; +.\"O .B INADDR_BROADCAST +.\"O (255.255.255.255) +.\"O means any host and has the same effect on bind as +.\"O .B INADDR_ANY +.\"O for historical reasons. +ÆÃÊ̤ʥ¢¥É¥ì¥¹¤¬¤¤¤¯¤Ä¤«Â¸ºß¤¹¤ë: +.TP +.BR INADDR_LOOPBACK (127.0.0.1) +loopback ¥Ç¥Ð¥¤¥¹¤òÄ̤·¤Æ¾ï¤Ë¥í¡¼¥«¥ë¤Ê¥Û¥¹¥È¤ò»²¾È¤¹¤ë¡£ +.TP +.BR INADDR_ANY (0.0.0.0) +¥Ð¥¤¥ó¥É¤ËÍѤ¤¤ëǤ°Õ¤Î¥¢¥É¥ì¥¹¡£ +.TP +.BR INADDR_BROADCAST (255.255.255.255) +Ǥ°Õ¤Î¥Û¥¹¥È¡£Îò»ËŪÍýͳ¤«¤é¡¢¥Ð¥¤¥ó¥É¤ÎºÝ¤Ë¤Ï +.B INADDR_ANY +¤ÈƱ¤¸¸ú²Ì¤Ë¤Ê¤ë¡£ +.\"O .SS Socket Options +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.\"O IP supports some protocol-specific socket options that can be set with +.\"O .BR setsockopt (2) +.\"O and read with +.\"O .BR getsockopt (2). +.\"O The socket option level for IP is +.\"O .BR IPPROTO_IP . +.\"O .\" or SOL_IP on Linux +.\"O A boolean integer flag is zero when it is false, otherwise true. +IP ¤Ë¤Ï¥×¥í¥È¥³¥ë¸ÇÍ­¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬¤¤¤¯¤Ä¤«Â¸ºß¤·¡¢ +.BR setsockopt (2) +¤ÇÀßÄ꤬¡¢ +.BR getsockopt (2) +¤Ç¼èÆÀ¤¬¤Ç¤­¤ë¡£ IP ¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë¤Ï +.B IPPROTO_IP +.\" Linux ¤Ç¤Ï SOL_IP ¤â²Ä +¤Ç¤¢¤ë¡£ +¥Ö¡¼¥ëÀ°¿ôÃͤΥե饰¤Ç¤Ï¡¢ 0 ¤Ïµ¶¡¢¤½¤ì°Ê³°¤Ï¿¿¤ò°ÕÌ£¤¹¤ë¡£ +.\" +.\" FIXME Document IP_FREEBIND +.\" Boolean +.\" Since Linux 2.4.0-test10 +.\" +.TP +.\"O .BR IP_ADD_MEMBERSHIP " (since Linux 1.2)" +.BR IP_ADD_MEMBERSHIP " (Linux 1.2 °Ê¹ß)" +.\"O Join a multicast group. +.\"O Argument is an +.\"O .I ip_mreqn +.\"O structure. +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Ë»²²Ã¤¹¤ë¡£ +°ú¤­¿ô¤Ï +.I ip_mreqn +¹½Â¤ÂΤǤ¢¤ë¡£ +.sp +.in +4n +.nf +struct ip_mreqn { + struct in_addr imr_multiaddr; /* IP multicast group + address */ + struct in_addr imr_address; /* IP address of local + interface */ + int imr_ifindex; /* interface index */ +}; +.fi +.in +.sp +.\"O .I imr_multiaddr +.\"O contains the address of the multicast group the application +.\"O wants to join or leave. +.\"O It must be a valid multicast address +.\"O .\" (i.e., within the 224.0.0.0-239.255.255.255 range) +.\"O (or +.\"O .BR setsockopt (2) +.\"O fails with the error +.\"O .BR EINVAL ). +.\"O .I imr_address +.\"O is the address of the local interface with which the system +.\"O should join the multicast group; if it is equal to +.\"O .B INADDR_ANY +.\"O an appropriate interface is chosen by the system. +.\"O .I imr_ifindex +.\"O is the interface index of the interface that should join/leave the +.\"O .I imr_multiaddr +.\"O group, or 0 to indicate any interface. +.I imr_multiaddr +¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬»²²Ã¤Þ¤¿¤ÏűÂष¤¿¤¤ +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Î¥¢¥É¥ì¥¹¤¬Æþ¤ë¡£ +»ØÄꤹ¤ë¥¢¥É¥ì¥¹¤ÏÍ­¸ú¤Ê¥Þ¥ë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.\" (¤Ä¤Þ¤ê¡¢224.0.0.0-239.255.255.255 ¤ÎÈÏ°ÏÆâ) +(¤µ¤â¤Ê¤±¤ì¤Ð +.BR setsockopt (2) +¤¬¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë)¡£ +.I imr_address +¤Ï¥·¥¹¥Æ¥à¤¬¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Ë»²²Ã¤¹¤ëºÝ¤ËÍѤ¤¤ë +¥í¡¼¥«¥ë¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +¤³¤ì¤¬ +.B INADDR_ANY +¤Ç¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢Å¬Àڤʥ¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤ÆÁªÂò¤µ¤ì¤ë¡£ +.I imr_ifindex +¤Ï +.I imr_multiaddr +¥°¥ë¡¼¥×¤Ë»²²Ã/űÂह¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î interface index ¤Ç¤¢¤ë¡£ +¤É¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤â¤è¤¤¾ì¹ç¤Ï 0 ¤Ë¤¹¤ë¡£ +.IP +.\"O The +.\"O .I ip_mreqn +.\"O is available only since Linux 2.2. +.\"O For compatibility, the old +.\"O .I ip_mreq +.\"O structure (present since Linux 1.2) is still supported. +.\"O It differs from +.\"O .I ip_mreqn +.\"O only by not including the +.\"O .I imr_ifindex +.\"O field. +.\"O Only valid as a +.\"O .BR setsockopt (2). +.I ip_mreqn +¤Ï Linux 2.2 °Ê¹ß¤Ç¤Î¤ßÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +¸ß´¹À­¤Î¤¿¤á¡¢¸Å¤¤ +.I ip_mreq +¹½Â¤ÂÎ (Linux 1.2 °Ê¹ß¤Ç¸ºß¤¹¤ë) ¤â¤Þ¤À¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.I ip_mreqn +¤È¤Î°ã¤¤¤Ï¡¢ +.I imr_ifindex +¥Õ¥£¡¼¥ë¥É¤ò´Þ¤Þ¤Ê¤¤¤³¤È¤À¤±¤Ç¤¢¤ë¡£ +.BR setsockopt (2) +¤Ç¤Î¤ß»È¤¨¤ë¡£ +.\" +.TP +.\"O .BR IP_DROP_MEMBERSHIP " (since Linux 1.2)" +.BR IP_DROP_MEMBERSHIP " (Linux 1.2 °Ê¹ß)" +.\"O Leave a multicast group. +.\"O Argument is an +.\"O .I ip_mreqn +.\"O or +.\"O .I ip_mreq +.\"O structure similar to +.\"O .BR IP_ADD_MEMBERSHIP . +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤«¤éÈ´¤±¤ë¡£°ú¤­¿ô¤Ï +.B IP_ADD_MEMBERSHIP +¤ÈƱÍÍ¤Ë +.I ip_mreqn +¤Þ¤¿¤Ï +.I ip_mreq +¹½Â¤ÂΤǤ¢¤ë¡£ +.TP +.\"O .BR IP_HDRINCL " (since Linux 2.0)" +.BR IP_HDRINCL " (Linux 2.0 °Ê¹ß)" +.\"O If enabled, +.\"O the user supplies an IP header in front of the user data. +.\"O Only valid for +.\"O .B SOCK_RAW +.\"O sockets. +.\"O See +.\"O .BR raw (7) +.\"O for more information. +.\"O When this flag is enabled the values set by +.\"O .BR IP_OPTIONS , +.\"O .B IP_TTL +.\"O and +.\"O .B IP_TOS +.\"O are ignored. +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¥æ¡¼¥¶¤Ï IP ¥Ø¥Ã¥À¤ò¥æ¡¼¥¶¡¼¥Ç¡¼¥¿¤ÎÁ°¤ËÍ¿¤¨¤ë¡£ +.B SOCK_RAW +¥½¥±¥Ã¥È¤Ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£¾ÜºÙ¤Ï +.BR raw (7) +¤ò¸«¤è¡£¤³¤Î¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +.BR IP_OPTIONS , +.BR IP_TTL , +.B IP_TOS +¤Ï̵»ë¤µ¤ì¤ë¡£ +.\" FIXME Document IP_IPSEC_POLICY +.\" Since Linux 2.5.47 +.\" Needs CAP_NET_ADMIN +.TP +.\"O .BR IP_MTU " (since Linux 2.2)" +.BR IP_MTU " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.124 +.\"O Retrieve the current known path MTU of the current socket. +.\"O Only valid when the socket has been connected. +.\"O Returns an integer. +.\"O Only valid as a +.\"O .BR getsockopt (2). +¥½¥±¥Ã¥È¤Î¡¢´ûÃΤΠpath MTU ¤ò¼èÆÀ¤¹¤ë¡£ +¥½¥±¥Ã¥È¤¬Àܳ¤·¤Æ¤¤¤ë¾ì¹ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +.BR getsockopt (2) +¤Ç¤Î¤ß»È¤¨¤ë¡£ +.TP +.\"O .BR IP_MTU_DISCOVER " (since Linux 2.2)" +.BR IP_MTU_DISCOVER " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.124 +.\"O Set or receive the Path MTU Discovery setting for a socket. +.\"O When enabled, Linux will perform Path MTU Discovery +.\"O as defined in RFC\ 1191 +.\"O on this socket. +.\"O The don't-fragment flag is set on all outgoing datagrams. +.\"O The system-wide default is controlled by the +.\"O .I /proc/sys/net/ipv4/ip_no_pmtu_disc +.\"O file for +.\"O .B SOCK_STREAM +.\"O sockets, and disabled on all others. +.\"O For +.\"O .RB non- SOCK_STREAM +.\"O sockets, it is the user's responsibility to packetize the data +.\"O in MTU sized chunks and to do the retransmits if necessary. +.\"O The kernel will reject packets that are bigger than the known +.\"O path MTU if this flag is set (with +.\"O .B EMSGSIZE +.\"O ). +¥½¥±¥Ã¥È¤Î Path MTU Discovery ¤ÎÀßÄê¤ò¥»¥Ã¥È¡¦¼èÆÀ¤¹¤ë¡£ +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ Linux ¤Ï¤³¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ +RFC\ 1191 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë Path MTU Discovery ¤ò¹Ô¤¦¡£ +ȯ¿®¥Ç¡¼¥¿¥°¥é¥à¤Ë¤Ï¡¢Á´¤Æ¡Ö¥Õ¥é¥°¥á¥ó¥ÈÉÔµö²Ä¡×¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +¥·¥¹¥Æ¥àÁ´ÂΤËÂФ¹¤ë¥Ç¥Õ¥©¥ë¥È¤Ï¡¢ +.B SOCK_STREAM +¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï +.I /proc/sys/net/ipv4/ip_no_pmtu_disc +¥Õ¥¡¥¤¥ë¤Ë¤è¤êÀ©¸æ¤Ç¤­¤ë¡£ +¤½¤Î¾¤Ë¤Ä¤¤¤Æ¤Ï̵¸ú¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.B SOCK_STREAM +¤Ç¤Ê¤¤¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï¡¢ +¥æ¡¼¥¶¡¼¤¬¥Ç¡¼¥¿¤ò MTU ¤Î¥µ¥¤¥º¤Î²ô¤Ë¥Ñ¥±¥Ã¥È²½¤·¤¿¤ê¡¢ +ɬÍפʾì¹ç¤Ë¤ÏºÆÁ÷¤·¤¿¤ê¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +¥«¡¼¥Í¥ë¤Ï´ûÃΤΠpath MTU ¤è¤êÂ礭¤Ê¥Ñ¥±¥Ã¥È¤òµñÈݤ¹¤ë +.RB ( EMSGSIZE +¤È¤Ê¤ë)¡£ +.TS +tab(:); +c l +l l. +.\"O Path MTU discovery flags:Meaning +.\"O IP_PMTUDISC_WANT:Use per-route settings. +.\"O IP_PMTUDISC_DONT:Never do Path MTU Discovery. +.\"O IP_PMTUDISC_DO:Always do Path MTU Discovery. +.\"O IP_PMTUDISC_PROBE:Set DF but ignore Path MTU. +Path MTU discovery ¥Õ¥é¥°:°ÕÌ£ +IP_PMTUDISC_WANT:¥ë¡¼¥È¤´¤È¤ÎÀßÄê¤òÍѤ¤¤ë¡£ +IP_PMTUDISC_DONT:Path MTU Discovery ¤ò¹Ô¤ï¤Ê¤¤¡£ +IP_PMTUDISC_DO:¾ï¤Ë Path MTU Discovery ¤ò¹Ô¤¦¡£ +IP_PMTUDISC_PROBE:DF¥Ó¥Ã¥È¤ò¥»¥Ã¥È¤¹¤ë¤¬¡¢Path MTU ¤ò̵»ë¤¹¤ë¡£ +.TE + +.\"O When PMTU discovery is enabled, the kernel automatically keeps track of +.\"O the path MTU per destination host. +.\"O When it is connected to a specific peer with +.\"O .BR connect (2), +.\"O the currently known path MTU can be retrieved conveniently using the +.\"O .B IP_MTU +.\"O socket option (e.g., after a +.\"O .B EMSGSIZE +.\"O error occurred). +.\"O It may change over time. +.\"O For connectionless sockets with many destinations, +.\"O the new MTU for a given destination can also be accessed using the +.\"O error queue (see +.\"O .BR IP_RECVERR ). +.\"O A new error will be queued for every incoming MTU update. +path MTU discovery ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï°¸Àè¥Û¥¹¥È¤´¤È¤Ë +¼«Æ°Åª¤Ë path MTU ¤ò½èÍý¤¹¤ë¡£ÆÃÄê¤ÎÁê¼ê¤Ë +.BR connect (2) +¤ÇÀܳ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +.B IP_MTU +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ì¤Ð¡¢´ûÃΤΠpath MTU ¤Î¼èÆÀ¤ËÊØÍø¤Ç¤¢¤ë +(¤¿¤È¤¨¤Ð +.B EMSGSIZE +¥¨¥é¡¼¤¬µ¯¤­¤¿¸å¤Ê¤É)¡£¤³¤ì¤Ï»þ´Ö¤È¤È¤â¤ËÊѲ½¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +°¸À褬¤¿¤¯¤µ¤ó¤¢¤ë¥³¥Í¥¯¥·¥ç¥ó¥ì¥¹¤Ê¥½¥±¥Ã¥È¤Ç¤Ï¡¢ +Í¿¤¨¤é¤ì¤¿°¸Àè¤ËÂФ¹¤ë¿·¤·¤¤ MTU ¤Ë¤â¡¢ +¥¨¥é¡¼¥­¥å¡¼¤òÍѤ¤¤Æ¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.RB ( IP_RECVERR +¤ò¸«¤è)¡£ +MTU ¹¹¿·¤¬ÅþÃ夹¤ë¤´¤È¤Ë¡¢¿·¤¿¤Ê¥¨¥é¡¼¤¬¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤ë¡£ + +.\"O While MTU discovery is in progress, initial packets from datagram sockets +.\"O may be dropped. +.\"O Applications using UDP should be aware of this and not +.\"O take it into account for their packet retransmit strategy. +MTU discovery ¤Î¿Ê¹ÔÃæ¤Ë¤Ï¡¢¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤«¤é¤Î½é´ü¥Ñ¥±¥Ã¥È¤Ï +ÅþÃ夷¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ UDP ¤òÍѤ¤¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +¤³¤Î¤³¤È¤òµ¤¤Ë¤«¤±¤Æ¤ª¤­¡¢ +¥Ñ¥±¥Ã¥È¤ÎºÆÁ÷¥¢¥ë¥´¥ê¥º¥à¤Ë¤³¤Îʬ¤ò½ü³°¤µ¤»¤ë¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O To bootstrap the path MTU discovery process on unconnected sockets, it +.\"O is possible to start with a big datagram size +.\"O (up to 64K-headers bytes long) and let it shrink by updates of the path MTU. +Àܳ¤·¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤ËÂФ·¤Æ +path MTU discovery ¥×¥í¥»¥¹¤òΩ¤Á¾å¤²¤ë¤Ë¤Ï¡¢ +Â礭¤Ê¥Ç¡¼¥¿¥°¥é¥à¥µ¥¤¥º (ºÇÂç 64K ¥Ø¥Ã¥À¥Ð¥¤¥ÈĹ) ¤«¤é¤Ï¤¸¤á¤Æ¡¢ +path MTU ¤¬¹¹¿·¤µ¤ì¤ë¤Þ¤Ç¥µ¥¤¥º¤ò½Ì¤á¤Æ¤¤¤¯¤³¤È¤â²Äǽ¤Ç¤¢¤ë¡£ +.\" FIXME this is an ugly hack + +.\"O To get an initial estimate of the +.\"O path MTU, connect a datagram socket to the destination address using +.\"O .BR connect (2) +.\"O and retrieve the MTU by calling +.\"O .BR getsockopt (2) +.\"O with the +.\"O .B IP_MTU +.\"O option. +path MTU ¤ÎÃͤò¤Þ¤º¸«ÀѤâ¤Ã¤Æ¤ß¤ë¤Ë¤Ï¡¢°¸À襢¥É¥ì¥¹¤Ë +.BR connect (2) +¤ò»È¤Ã¤Æ¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤òÀܳ¤·¡¢ +.BR getsockopt (2) +¤ò +.B IP_MTU +¥ª¥×¥·¥ç¥ó¤È¤È¤â¤Ë¸Æ¤Ó¡¢ MTU ¤ò¼èÆÀ¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ + +.\"O It is possible to implement RFC 4821 MTU probing with +.\"O .B SOCK_DGRAM +.\"O or +.\"O .B SOCK_RAW +.\"O sockets by setting a value of +.\"O .BR IP_PMTUDISC_PROBE +.\"O (available since Linux 2.6.22). +.\"O This is also particularly useful for diagnostic tools such as +.\"O .BR tracepath (8) +.\"O that wish to deliberately send probe packets larger than +.\"O the observed Path MTU. +.B IP_PMTUDISC_PROBE +(Linux 2.6.22 °Ê¹ß¤ÇÍøÍѲÄǽ) ¤òÀßÄꤹ¤ë¤³¤È¤Ç¡¢ +.B SOCK_DGRAM +¤ä +.B SOCK_RAW +¤Î¥½¥±¥Ã¥È¤Ç RFC 4821 ¤Î MTU õº÷¤ò¼ÂÁõ¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¡£ +¤Þ¤¿¡¢¤³¤Îµ¡Ç½¤Ï¡¢ +.BR tracepath (8) +¤Î¤è¤¦¤Ê¿ÇÃǥġ¼¥ë¤ÇÆäËÍ­ÍѤǤ¢¤ë¡£¤³¤ì¤é¤Î¥Ä¡¼¥ë¤Ç¤Ï¡¢ +´Ñ¬¤µ¤ì¤¿ Path MTU ¤è¤ê¤âÂ礭¤Êõº÷¥Ñ¥±¥Ã¥È¤ò°Õ¿ÞŪ¤Ë +Á÷¿®¤·¤è¤¦¤È¤¹¤ë¡£ +.TP +.\"O .BR IP_MULTICAST_IF " (since Linux 1.2)" +.BR IP_MULTICAST_IF " (Linux 1.2 °Ê¹ß)" +.\"O Set the local device for a multicast socket. +.\"O Argument is an +.\"O .I ip_mreqn +.\"O or +.\"O .I ip_mreq +.\"O structure similar to +.\"O .BR IP_ADD_MEMBERSHIP . +¥í¡¼¥«¥ë¥Ç¥Ð¥¤¥¹¤ò¥Þ¥ë¥Á¥­¥ã¥¹¥È¥½¥±¥Ã¥È¤È¤·¤ÆÀßÄꤹ¤ë¡£°ú¤­¿ô¤Ï +.B IP_ADD_MEMBERSHIP +¤ÈƱÍÍ¤Ë +.I ip_mreqn +¤Þ¤¿¤Ï +.I ip_mreq +¹½Â¤ÂΤǤ¢¤ë¡£ +.IP +.\"O When an invalid socket option is passed, +.\"O .B ENOPROTOOPT +.\"O is returned. +ÉÔÀµ¤Ê¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÅϤµ¤ì¤ë¤È¡¢ +.B ENOPROTOOPT +¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.\"O .BR IP_MULTICAST_LOOP " (since Linux 1.2)" +.BR IP_MULTICAST_LOOP " (Linux 1.2 °Ê¹ß)" +.\"O Set or read a boolean integer argument that determines whether +.\"O sent multicast packets should be looped back to the local sockets. +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È¤ò¥í¡¼¥«¥ë¤Ê¥½¥±¥Ã¥È¤Ë¥ë¡¼¥×¥Ð¥Ã¥¯¤¹¤ë¤«¤É¤¦¤«¤ò +Äê¤á¤ë¥Ö¡¼¥ëÃͤÎÀ°¿ô°ú¤­¿ô¤òÀßÄꡦ¼èÆÀ¤¹¤ë¡£ +.TP +.\"O .BR IP_MULTICAST_TTL " (since Linux 1.2)" +.BR IP_MULTICAST_TTL " (Linux 1.2 °Ê¹ß)" +.\"O Set or read the time-to-live value of outgoing multicast packets for this +.\"O socket. +.\"O It is very important for multicast packets to set the smallest TTL possible. +.\"O The default is 1 which means that multicast packets don't leave the local +.\"O network unless the user program explicitly requests it. +.\"O Argument is an integer. +¤³¤Î¥½¥±¥Ã¥È¤«¤éȯ¿®¤µ¤ì¤ë¥Þ¥ë¥Á¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È¤Î +time-to-live ÃͤòÀßÄꡦ¼èÆÀ¤¹¤ë¡£ +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï¡¢¤Ç¤­¤ë¤À¤±¾®¤µ¤Ê +TTL ¤ËÀßÄꤹ¤ë¤³¤È¤¬¤È¤Æ¤â½ÅÍפǤ¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ï 1 ¤Ç¡¢ +¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤¬ÌÀ¼¨Åª¤ËÍ׵ᤷ¤Ê¤¤¸Â¤ê +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È¤Ï¥í¡¼¥«¥ë¤Ê¥Í¥Ã¥È¥ï¡¼¥¯¤«¤é½Ð¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£ +°ú¤­¿ô¤ËÀ°¿ô¤ò¼è¤ë¡£ +.TP +.\"O .BR IP_OPTIONS " (since Linux 2.0)" +.BR IP_OPTIONS " (Linux 2.0 °Ê¹ß)" +.\" Precisely: 1.3.30 +.\"O Set or get the IP options to be sent with every packet from this socket. +.\"O The arguments are a pointer to a memory buffer containing the options +.\"O and the option length. +¤³¤Î¥½¥±¥Ã¥È¤«¤éÁ÷¤é¤ì¤ë¥Ñ¥±¥Ã¥ÈÁ´¤Æ¤ËÉտ魯¤ë IP ¥ª¥×¥·¥ç¥ó¤ò +ÀßÄꡦ¼èÆÀ¤¹¤ë¡£¥ª¥×¥·¥ç¥ó¤òÊݸ¤·¤Æ¤¤¤ë¥á¥â¥ê¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤È +¥ª¥×¥·¥ç¥ó¤ÎŤµ¤È¤ò°ú¤­¿ô¤Ë¼è¤ë¡£ +.\"O The +.\"O .BR setsockopt (2) +.\"O call sets the IP options associated with a socket. +.\"O The maximum option size for IPv4 is 40 bytes. +.\"O See RFC\ 791 for the allowed options. +.\"O When the initial connection request packet for a +.\"O .B SOCK_STREAM +.\"O socket contains IP options, the IP options will be set automatically +.\"O to the options from the initial packet with routing headers reversed. +.\"O Incoming packets are not allowed to change options after the connection +.\"O is established. +.BR setsockopt (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¥½¥±¥Ã¥È¤Ë´ØÏ¢¤Å¤±¤é¤ì¤ë IP ¥ª¥×¥·¥ç¥ó¤òÀßÄê¤Ç¤­¤ë¡£ +IPv4 ¤Ë¤ª¤±¤ë¥ª¥×¥·¥ç¥ó¤Î¥µ¥¤¥º¤ÎºÇÂçÃÍ¤Ï 40 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +ÍѤ¤¤ë¤³¤È¤Î¤Ç¤­¤ë¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ï RFC\ 791 ¤ò¸«¤è¡£ +.B SOCK_STREAM +¥½¥±¥Ã¥È¤ËÂФ¹¤ë½é´üÀܳÍ×µá¥Ñ¥±¥Ã¥È¤Ë IP ¥ª¥×¥·¥ç¥ó¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤È¡¢ +¥ë¡¼¥Æ¥£¥ó¥°¥Ø¥Ã¥À¤òÉÕ¤±¤ÆÌᤵ¤ì¤Æ¤¯¤ë½é´ü¥Ñ¥±¥Ã¥È¤Î +IP ¥ª¥×¥·¥ç¥ó¤ËƱ¤¸¥ª¥×¥·¥ç¥ó¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£Àܳ¤¬³ÎΩ¤µ¤ì¤¿¸å¡¢ +¤ä¤Ã¤Æ¤­¤¿¥Ñ¥±¥Ã¥È¤Î¥ª¥×¥·¥ç¥ó¤òÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\"O The processing of all incoming source routing options +.\"O is disabled by default and can be enabled by using the +.\"O .I accept_source_route +.\"O .I /proc +.\"O interface. +.\"O Other options like timestamps are still handled. +.\"O For datagram sockets, IP options can be only set by the local user. +.\"O Calling +.\"O .BR getsockopt (2) +.\"O with +.\"O .B IP_OPTIONS +.\"O puts the current IP options used for sending into the supplied buffer. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡£³°Éô¤«¤é¼õ¿®¤·¤¿¥Ñ¥±¥Ã¥È¤ÎÁ´¤Æ¤Î source routing ¥ª¥×¥·¥ç¥ó +¤Î½èÍý¤Ï̵¸ú¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢ +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î +.I accept_source_route +¤ò»È¤¦¤È¤³¤ì¤òÍ­¸ú¤Ë¤Ç¤­¤ë¡£¤³¤ì¤ò̵¸ú¤Ë¤·¤Æ¤¤¤Æ¤â timestamps ¤Ê¤É +¤Î¾¤Î¥ª¥×¥·¥ç¥ó¤Î½èÍý¤Ï¹Ô¤ï¤ì¤ë¡£¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤Ç¤Ï¡¢ +IP ¥ª¥×¥·¥ç¥ó¤Ï¥í¡¼¥«¥ë¥æ¡¼¥¶¡¼¤·¤«ÀßÄê¤Ç¤­¤Ê¤¤¡£ +.BR getsockopt (2) +¤ò +.B IP_OPTIONS +¤ò¤Ä¤±¤Æ¸Æ¤Ö¤È¡¢¸½ºßÁ÷¿®¤ËÍѤ¤¤é¤ì¤Æ¤¤¤ë IP ¥ª¥×¥·¥ç¥ó¤ò +°ú¤­¿ô¤ËÍ¿¤¨¤¿¥Ð¥Ã¥Õ¥¡¤Ë¼èÆÀ¤Ç¤­¤ë¡£ +.\" FIXME Document IP_PASSSEC +.\" Boolean +.\" Since Linux 2.6.17 +.\" commit 2c7946a7bf45ae86736ab3b43d0085e43947945c +.\" Author: Catherine Zhang +.TP +.\"O .BR IP_PKTINFO " (since Linux 2.2)" +.BR IP_PKTINFO " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.68 +.\"O Pass an +.\"O .B IP_PKTINFO +.\"O ancillary message that contains a +.\"O .I pktinfo +.\"O structure that supplies some information about the incoming packet. +.\"O This only works for datagram oriented sockets. +.B IP_PKTINFO +Êä½õ¥á¥Ã¥»¡¼¥¸¤òÅϤ¹¡£¤³¤ì¤Ë¤ÏÅþÃå¥Ñ¥±¥Ã¥È¤Ë´Ø¤¹¤ë¾ðÊó¤òÄ󶡤¹¤ë +.I pktinfo +¹½Â¤ÂΤ¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¥Ç¡¼¥¿¥°¥é¥à»Ø¸þ¤Î¥½¥±¥Ã¥È¤Ç¤·¤«Æ°ºî¤·¤Ê¤¤¡£ +.\"O The argument is a flag that tells the socket whether the +.\"O .B IP_PKTINFO +.\"O message should be passed or not. +.\"O The message itself can only be sent/retrieved +.\"O as control message with a packet using +.\"O .BR recvmsg (2) +.\"O or +.\"O .BR sendmsg (2). +°ú¤­¿ô¤Ï +.B IP_PKTINFO +¥á¥Ã¥»¡¼¥¸¤òÄ̲ᤵ¤»¤ë¤«¤É¤¦¤«¤ò¥½¥±¥Ã¥È¤ËÃΤ餻¤ë¥Õ¥é¥°¤Ç¤¢¤ë¡£ +¥á¥Ã¥»¡¼¥¸¼«¿È¤Ï +.BR recvmsg (2) +¤Þ¤¿¤Ï +.BR sendmsg (2) +¤òÍѤ¤¤¿¥Ñ¥±¥Ã¥È¤ÎÀ©¸æ¥á¥Ã¥»¡¼¥¸¤È¤·¤Æ¤Î¤ßÁ÷¼õ¿®¤Ç¤­¤ë¡£ + +.IP +.in +4n +.nf +struct in_pktinfo { + unsigned int ipi_ifindex; /* Interface index */ + struct in_addr ipi_spec_dst; /* Local address */ + struct in_addr ipi_addr; /* Header Destination + address */ +}; +.fi +.in +.IP +.\" FIXME elaborate on that. +.\"O .I ipi_ifindex +.\"O is the unique index of the interface the packet was received on. +.I ipi_ifindex +¤Ï¥Ñ¥±¥Ã¥È¤¬¼õ¿®¤µ¤ì¤¿¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¡¢Â¾¤È½Å¤Ê¤é¤Ê¤¤¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤¢¤ë¡£ +.\"O .I ipi_spec_dst +.\"O is the local address of the packet and +.\"O .I ipi_addr +.\"O is the destination address in the packet header. +.I ipi_spec_dst +¤Ï¥Ñ¥±¥Ã¥È¤Î¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I ipi_addr +¤Ï¥Ñ¥±¥Ã¥È¥Ø¥Ã¥À¤Ë¤¢¤ë°¸À襢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.\"O If +.\"O .B IP_PKTINFO +.\"O is passed to +.\"O .BR sendmsg (2) +.\"O and +.\"O .\" This field is grossly misnamed +.\"O .I ipi_spec_dst +.\"O is not zero, then it is used as the local source address for the routing +.\"O table lookup and for setting up IP source route options. +.B IP_PKTINFO +¤¬ +.BR sendmsg (2) +¤ËÅϤµ¤ì¤Æ¡¢¤«¤Ä +.\" ¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢Ì¾Á°¤ÎÉÕ¤±Êý¤¬ÌÀ¤é¤«¤Ë´Ö°ã¤Ã¤Æ¤¤¤ë¤Î¤À¤¬ +.I ipi_spec_dst +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢ +.I ipi_spec_dst +¤Ï¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤ò¸¡º÷¤¹¤ëºÝ¤Ë¥í¡¼¥«¥ë¤ÊÁ÷¿®¸µ¥¢¥É¥ì¥¹¤È¤·¤Æ»ÈÍѤµ¤ì¡¢ +IP source route ¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¤Î¤Ë¤â»ÈÍѤµ¤ì¤ë¡£ +.\"O When +.\"O .I ipi_ifindex +.\"O is not zero, the primary local address of the interface specified by the +.\"O index overwrites +.\"O .I ipi_spec_dst +.\"O for the routing table lookup. +.I ipi_ifindex +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢¤³¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î +¥×¥é¥¤¥Þ¥ê¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤Ç +.I ipi_spec_dst +¤ò¾å½ñ¤­¤·¡¢¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤ò¸¡º÷¤¹¤ë¡£ +.TP +.\"O .BR IP_RECVERR " (since Linux 2.2)" +.BR IP_RECVERR " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.15 +.\"O Enable extended reliable error message passing. +.\"O When enabled on a datagram socket, all +.\"O generated errors will be queued in a per-socket error queue. +.\"O When the user receives an error from a socket operation, +.\"O the errors can be received by calling +.\"O .BR recvmsg (2) +.\"O with the +.\"O .B MSG_ERRQUEUE +.\"O flag set. +.\"O The +.\"O .I sock_extended_err +.\"O structure describing the error will be passed in an ancillary message with +.\"O the type +.\"O .B IP_RECVERR +.\"O and the level +.\"O .BR IPPROTO_IP . +.\"O .\" or SOL_IP on Linux +.\"O This is useful for reliable error handling on unconnected sockets. +.\"O The received data portion of the error queue contains the error packet. +¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Î¼õ¤±ÅϤ·¤Ë¡¢¿®ÍêÀ­¤Î¹â¤¤³ÈÄ¥¤µ¤ì¤¿ÊýË¡¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤ËÂФ·¤ÆÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +ȯÀ¸¤·¤¿¥¨¥é¡¼¤ÏÁ´¤Æ¥½¥±¥Ã¥È¤´¤È¤Î¥¨¥é¡¼¥­¥å¡¼¤ËÊݸ¤µ¤ì¤ë¡£ +¥æ¡¼¥¶¡¼¤Ï¥½¥±¥Ã¥ÈÁàºî¤«¤é¥¨¥é¡¼¤ò¼õ¤±¼è¤Ã¤¿¤È¤­¡¢ +.BR recvmsg (2) +¤ò +.B MSG_ERRQUEUE +¥Õ¥é¥°¤È¤È¤â¤Ë¸Æ¤Ù¤Ð¤½¤Î¥¨¥é¡¼¤ò¼èÆÀ¤Ç¤­¤ë¡£ +¤½¤Î¥¨¥é¡¼¤òµ­½Ò¤¹¤ë +.I sock_extended_err +¹½Â¤ÂΤ¬¡¢¥¿¥¤¥× +.BR IP_RECVERR ¡¦ +¥ì¥Ù¥ë +.B IPPROTO_IP +.\" Linux ¤Ç¤Ï SOL_IP ¤â²Ä +¤ÎÊä½õ¥á¥Ã¥»¡¼¥¸¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +¤³¤ì¤ÏÀܳ»Ö¸þ¤Ç¤Ê¤¤¥½¥±¥Ã¥È¤Ç¿®ÍêÀ­¤Î¹â¤¤¥¨¥é¡¼½èÍý¤ò¹Ô¤¤¤¿¤¤¾ì¹ç¤Ë +Í­ÍѤǤ¢¤ë¡£¥¨¥é¡¼¥­¥å¡¼¤Î¼õ¿®¥Ç¡¼¥¿¥Õ¥é¥°¥á¥ó¥È¤Ë¤Ï +¥¨¥é¡¼¥Ñ¥±¥Ã¥È¤¬´Þ¤Þ¤ì¤ë¡£ +.\"NAKANO portion ¤ò¥Õ¥é¥°¥á¥ó¥È¤Ã¤Æ¸À¤Ã¤Á¤ã¤Ã¤Æ¤¤¤¤¤Î¤«¡© +.IP +.\"O The +.\"O .B IP_RECVERR +.\"O control message contains a +.\"O .I sock_extended_err +.\"O structure: +.B IP_RECVERR +À©¸æ¥á¥Ã¥»¡¼¥¸¤Ë¤Ï +.I sock_extended_err +¹½Â¤ÂΤ¬´Þ¤Þ¤ì¤ë: +.IP +.in +4n +.ne 18 +.nf +#define SO_EE_ORIGIN_NONE 0 +#define SO_EE_ORIGIN_LOCAL 1 +#define SO_EE_ORIGIN_ICMP 2 +#define SO_EE_ORIGIN_ICMP6 3 + +struct sock_extended_err { + uint32_t ee_errno; /* error number */ + uint8_t ee_origin; /* where the error originated */ + uint8_t ee_type; /* type */ + uint8_t ee_code; /* code */ + uint8_t ee_pad; + uint32_t ee_info; /* additional information */ + uint32_t ee_data; /* other data */ + /* More data may follow */ +}; + +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. +.\"O .I ee_origin +.\"O is the origin code of where the error originated. +.I ee_errno +¤Ë¤Ï¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¥¨¥é¡¼¤Î +.I errno +Èֹ椬Æþ¤ë¡£ +.I ee_origin +¤Ë¤Ï¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì½ê¤ò¼¨¤¹¥³¡¼¥É¤¬Æþ¤ë¡£ +.\"O The other fields are protocol-specific. +.\"O The macro +.\"O .B SO_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. +¤½¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤Ï¥×¥í¥È¥³¥ë°Í¸¤Ç¤¢¤ë¡£ +.B SO_EE_OFFENDER +¥Þ¥¯¥í¤ÏÍ¿¤¨¤é¤ì¤¿Êä½õ¥á¥Ã¥»¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿¤«¤é +¥¨¥é¡¼¤ÎȯÀ¸¤·¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥É¥ì¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.\"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. +¥¢¥É¥ì¥¹¤¬ÉÔÌÀ¤Ê¾ì¹ç¡¢ +.I sockaddr +¹½Â¤ÂΤΠ+.I sa_family +¥Õ¥£¡¼¥ë¥É¤Ï +.B AF_UNSPEC +¤È¤Ê¤ê¡¢¤½¤Î¾¤Î¥Õ¥£¡¼¥ë¥ÉÃͤÏÉÔÄê¤Ç¤¢¤ë¡£ +.IP +.\"O IP uses the +.\"O .I sock_extended_err +.\"O structure as follows: +IP ¤Ï°Ê²¼¤Î¤è¤¦¤Ê +.I sock_extended_err +¹½Â¤ÂΤòÍѤ¤¤ë: +.\"O .I ee_origin +.\"O is set to +.\"O .B SO_EE_ORIGIN_ICMP +.\"O for errors received as an ICMP packet, or +.\"O .B SO_EE_ORIGIN_LOCAL +.\"O for locally generated errors. +.\"O Unknown values should be ignored. +.I ee_origin +¤Ï¡¢ +¥¨¥é¡¼¤¬ ICMP ¥Ñ¥±¥Ã¥È¤È¤·¤Æ¼õ¿®¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï +.B SO_EE_ORIGIN_ICMP +¤Ë¥»¥Ã¥È¤µ¤ì¡¢¥í¡¼¥«¥ë¤Çµ¯¤³¤Ã¤¿¾ì¹ç¤Ë¤Ï +.B SO_EE_ORIGIN_LOCAL +¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +ÉÔÌÀ¤ÊÃͤÏ̵»ë¤µ¤ì¤ë¡£ +.\"O .I ee_type +.\"O and +.\"O .I ee_code +.\"O are set from the type and code fields of the ICMP header. +.I ee_type +¤È +.I ee_code +¤Ï ICMP ¥Ø¥Ã¥À¤Î type ¥Õ¥£¡¼¥ë¥É¤È code ¥Õ¥£¡¼¥ë¥É¤ÎÃͤ˥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .I ee_info +.\"O contains the discovered MTU for +.\"O .B EMSGSIZE +.\"O errors. +.\"O The message also contains the +.\"O .I sockaddr_in of the node +.\"O caused the error, which can be accessed with the +.\"O .B SO_EE_OFFENDER +.\"O macro. +.\"O The +.\"O .I sin_family +.\"O field of the SO_EE_OFFENDER address is +.\"O .B AF_UNSPEC +.\"O when the source was unknown. +.I ee_info +¤Ë¤Ï +.B EMSGSIZE +¥¨¥é¡¼¤ËÂФ¹¤ë discover ¤µ¤ì¤¿ MTU ¤¬Æþ¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤Ë¤Ï¥¨¥é¡¼¤ò°ú¤­µ¯¤³¤·¤¿¥Î¡¼¥É¤Î +.I sockaddr_in +¹½Â¤ÂΤâ´Þ¤Þ¤ì¤ë¡£ +¤³¤ì¤Ë¤Ï +.B SO_EE_OFFENDER +¥Þ¥¯¥í¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +¥½¡¼¥¹¤¬ÉÔÌÀ¤Î¾ì¹ç¡¢ +SO_EE_OFFENDER ¥¢¥É¥ì¥¹¤Î +.I sin_family +¥Õ¥£¡¼¥ë¥É¤Ï +.B AF_UNSPEC +¤È¤Ê¤ë¡£ +.\"O When the error originated from the network, all IP options +.\"O .RI ( IP_OPTIONS ", " IP_TTL ", " +.\"O etc.) enabled on the socket and contained in the +.\"O error packet are passed as control messages. +.\"O The payload of the packet causing the error is returned as normal payload. +¥¨¥é¡¼¤¬¥Í¥Ã¥È¥ï¡¼¥¯¤Çµ¯¤­¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥½¥±¥Ã¥È¤ÇÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤¿¤¹¤Ù¤Æ¤Î IP ¥ª¥×¥·¥ç¥ó +.RB ( IP_OPTIONS ", " IP_TTL +¤Ê¤É) ¤È¥¨¥é¡¼¥Ñ¥±¥Ã¥È¤Ë´Þ¤Þ¤ì¤Æ¤¤¤¿¤¹¤Ù¤Æ¤Î IP ¥ª¥×¥·¥ç¥ó¤È¤¬¡¢ +À©¸æ¥á¥Ã¥»¡¼¥¸¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +¥¨¥é¡¼¤òµ¯¤³¤·¤¿¥Ñ¥±¥Ã¥È¤Î¥Ú¥¤¥í¡¼¥É (payload) ¤Ï +ÉáÄ̤Υڥ¤¥í¡¼¥É¤È¤·¤ÆÊÖ¤µ¤ì¤ë¡£ +.\" FIXME . is it a good idea to document that? It is a dubious feature. +.\"O .\" On +.\"O .\" .B SOCK_STREAM +.\"O .\" sockets, +.\"O .\" .B IP_RECVERR +.\"O .\" has slightly different semantics. Instead of +.\"O .\" saving the errors for the next timeout, it passes all incoming +.\"O .\" errors immediately to the user. +.\"O .\" This might be useful for very short-lived TCP connections which +.\"O .\" need fast error handling. Use this option with care: +.\"O .\" it makes TCP unreliable +.\"O .\" by not allowing it to recover properly from routing +.\"O .\" shifts and other normal +.\"O .\" conditions and breaks the protocol specification. +.\" .B SOCK_STREAM +.\" ¥½¥±¥Ã¥È¤Ç¤Ï¡¢ +.\" .B IP_RECVERR +.\" ¤Ï¤ä¤ä°Û¤Ê¤ë°ÕÌ£¤ò»ý¤Ä¡£¼¡¤Î¥¿¥¤¥à¥¢¥¦¥È¤Þ¤Ç¥Ç¡¼¥¿¤òÊÝ»ý¤¹¤ë¤Î¤Ç¤Ê¤¯¡¢ +.\" ¤ä¤Ã¤Æ¤­¤¿¥¨¥é¡¼¤ÏÁ´¤Æ¤¿¤À¤Á¤Ë¥æ¡¼¥¶¡¼¤ËÅϤµ¤ì¤ë¡£¤³¤ì¤Ï¡¢ +.\" ¹â®¤Ê¥¨¥é¡¼½èÍý¤¬É¬ÍפȤʤë¤è¤¦¤Ê¡¢¶Ëü¤Ë¼÷Ì¿¤Îû¤¤ +.\" TCP Àܳ¤ËÂФ·¤ÆÍ­ÍѤǤ¢¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤ÏÃí°Õ¤·¤ÆÍѤ¤¤ë¤³¤È¡£ +.\" ·ÐÏ©¤¬ÊѤï¤Ã¤¿¤ê¡¢¤½¤Î¾Ä̾ï¤Î¾õ¶·¤ËÂФ·¤Æ¡¢Å¬ÀڤʲóÉü¤¬ÉÔ²Äǽ¤È¤Ê¤ê¡¢ +.\" TCP ¤Î¿®ÍêÀ­¤òÄ㤯¤·¤Æ¤·¤Þ¤¦¡£¤Þ¤¿¥×¥í¥È¥³¥ë¤Î»ÅÍͤËÈ¿¤·¤Æ¤·¤Þ¤¦¡£ +.\"O Note that TCP has no error queue; +.\"O .B MSG_ERRQUEUE +.\"O is not permitted on +.\"O .B SOCK_STREAM +.\"O sockets. +.\"O .B IP_RECVERR +.\"O is valid for TCP, but all errors are returned by socket function return or +.\"O .B SO_ERROR +.\"O only. +TCP ¤Ë¤Ï¥¨¥é¡¼¥­¥å¡¼¤¬¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤Û¤·¤¤¡£ +.B MSG_ERRQUEUE +¤Ï +.B SOCK_STREAM +¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï»È¤¨¤Ê¤¤¡£ +TCP ¤Ç¤Ï +.B IP_RECVERR +¤À¤±¤¬Í­¸ú¤À¤¬¡¢¥½¥±¥Ã¥È´Ø¿ô¤«¤éÊÖ¤µ¤ì¤ë¥¨¥é¡¼¤Ï +.B SO_ERROR +¤À¤±¤Ë¤Ê¤ë¡£ +.IP +.\"O For raw sockets, +.\"O .B IP_RECVERR +.\"O enables passing of all received ICMP errors to the +.\"O application, otherwise errors are only reported on connected sockets +raw ¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.B IP_RECVERR +¤ò»ØÄꤹ¤ë¤È¡¢¼õ¿®¤·¤¿¤¹¤Ù¤Æ¤Î ICMP ¥¨¥é¡¼¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë +ÅϤ¹¤è¤¦¤Ë¤Ê¤ë¡£»ØÄꤷ¤Ê¤¤¤È¡¢ +ÀܳºÑ¤ß¤Î¥½¥±¥Ã¥È¤ËÂФ¹¤ë¥¨¥é¡¼¤À¤±¤òÊó¹ð¤¹¤ë¡£ +.IP +.\"O It sets or retrieves an integer boolean flag. +.\"O .B IP_RECVERR +.\"O defaults to off. +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Ö¡¼¥ëÃͤΥե饰¤òÀßÄꡦ¼èÆÀ¤¹¤ë¡£ +.B IP_RECVERR +¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥ª¥Õ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.TP +.\"O .BR IP_RECVOPTS " (since Linux 2.2)" +.BR IP_RECVOPTS " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.15 +.\"O Pass all incoming IP options to the user in a +.\"O .B IP_OPTIONS +.\"O control message. +.\"O The routing header and other options are already filled in +.\"O for the local host. +.\"O Not supported for +.\"O .B SOCK_STREAM +.\"O sockets. +ÅþÃ夷¤¿Á´¤Æ¤Î IP ¥ª¥×¥·¥ç¥ó¤ò +.B IP_OPTION +¥³¥ó¥È¥í¡¼¥ë¥á¥Ã¥»¡¼¥¸¤ËÆþ¤ì¤Æ¥æ¡¼¥¶¡¼¤ËÅϤ¹¡£ +¥ë¡¼¥Æ¥£¥ó¥°¥Ø¥Ã¥À¤È¤½¤Î¾¤Î¥ª¥×¥·¥ç¥ó¤È¤Ï¡¢ +¥í¡¼¥«¥ë¥Û¥¹¥È¤ËÂФ·¤Æ¤Ï¤¢¤é¤«¤¸¤áµ­Æþ¤µ¤ì¤Æ¤¤¤ë¡£ +.B SOCK_STREAM +¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.\"O .BR IP_RECVTOS " (since Linux 2.2)" +.BR IP_RECVTOS " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.68 +.\"O If enabled the +.\"O .B IP_TOS +.\"O ancillary message is passed with incoming packets. +.\"O It contains a byte which specifies the Type of Service/Precedence +.\"O field of the packet header. +.\"O Expects a boolean integer flag. +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +.B IP_TOS +Êä½õ¥á¥Ã¥»¡¼¥¸¤¬ÅþÃå¥Ñ¥±¥Ã¥È¤È¤È¤â¤ËÅϤµ¤ì¤ë¡£ +¤³¤ì¤Ë¤Ï¥Ñ¥±¥Ã¥È¥Ø¥Ã¥À¤Î Service/Precedence +¥Õ¥£¡¼¥ë¥É¤Î¥¿¥¤¥×¤ò»ØÄꤹ¤ë¥Ð¥¤¥È¥Ç¡¼¥¿¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¥Ö¡¼¥ëÀ°¿ôÃͤΥե饰¤ò¤È¤ë¡£ +.TP +.\"O .BR IP_RECVTTL " (since Linux 2.2)" +.BR IP_RECVTTL " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.68 +.\"O When this flag is set, pass a +.\"O .B IP_TTL +.\"O control message with the time to live +.\"O field of the received packet as a byte. +.\"O Not supported for +.\"O .B SOCK_STREAM +.\"O sockets. +¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +.B IP_TTL +¥³¥ó¥È¥í¡¼¥ë¥á¥Ã¥»¡¼¥¸¤¬¼õ¿®¥Ñ¥±¥Ã¥È¤Î +time-to-live ¥Õ¥£¡¼¥ë¥É¤Î¥Ð¥¤¥È¥Ç¡¼¥¿¤È¤È¤â¤ËÅϤµ¤ì¤ë¡£ +.B SOCK_STREAM +¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B IP_RETOPTS +.\"O .BR IP_RETOPTS " (since Linux 2.2)" +.BR IP_RETOPTS " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.15 +.\"O Identical to +.\"O .BR IP_RECVOPTS , +.\"O but returns raw unprocessed options with timestamp and route record +.\"O options not filled in for this hop. +.B IP_RECVOPTS +¤ÈÅù²Á¤À¤¬¡¢Ì¤½èÍý¤ÎÀ¸¤Î¥ª¥×¥·¥ç¥ó¤ò¡¢ +¤³¤Î hop ¤Ç¤Ïµ­Æþ¤µ¤ì¤Ê¤¤ timestamp ¥ì¥³¡¼¥É¤È route ¥ì¥³¡¼¥É¤È¤È¤â¤ËÊÖ¤¹¡£ +.\"NAKANO °ÕÌ£ÉÔÌÀ...(^^; +.TP +.\"O .BR IP_ROUTER_ALERT " (since Linux 2.2)" +.BR IP_ROUTER_ALERT " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.68 +.\"O Pass all to-be forwarded packets with the +.\"O IP Router Alert option set to this socket. +.\"O Only valid for raw sockets. +.\"O This is useful, for instance, for user-space RSVP daemons. +.\"O The tapped packets are not forwarded by the kernel; it is +.\"O the user's responsibility to send them out again. +.\"O Socket binding is ignored, +.\"O such packets are only filtered by protocol. +.\"O Expects an integer flag. +¥Õ¥©¥ï¡¼¥É¤¹¤Ù¤­¥Ñ¥±¥Ã¥È¤ò IP Router Alert ¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Æ +¤³¤Î¥½¥±¥Ã¥È¤ËÅϤ¹¡£ +raw ¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£¤³¤ì¤Ï¤¿¤È¤¨¤Ð¥æ¡¼¥¶¡¼¶õ´Ö¤Î +RSVP ¥Ç¡¼¥â¥ó¤ËÂФ·¤ÆÊØÍø¤Ç¤¢¤ë¡£¥¿¥Ã¥×¤µ¤ì¤¿¥Ñ¥±¥Ã¥È¤Ï +¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¤Ï¥Õ¥©¥ï¡¼¥É¤µ¤ì¤Ê¤¤¤Î¤Ç¡¢¤³¤ì¤é¤òºÆÁ÷¤¹¤ë¤Î¤Ï +¥æ¡¼¥¶¡¼¤ÎÀÕǤ¤È¤Ê¤ë¡£¥½¥±¥Ã¥È¤Î¥Ð¥¤¥ó¥É¤Ï̵»ë¤µ¤ì¡¢ +¤³¤Î¤è¤¦¤Ê¥Ñ¥±¥Ã¥È¤Ï¥×¥í¥È¥³¥ë¤Ë¤è¤Ã¤Æ¤Î¤ß¥Õ¥£¥ë¥¿¥ê¥ó¥°¤µ¤ì¤ë¡£ +À°¿ôÃͤΥե饰¤ò¼è¤ë¡£ +.\"NAKANO Socket binding... ¤Îʸ¡¢°ÕÌ£¤ï¤«¤é¤ó¡£ +.TP +.\"O .BR IP_TOS " (since Linux 1.0)" +.BR IP_TOS " (Linux 1.0 °Ê¹ß)" +.\"O Set or receive the Type-Of-Service (TOS) field that is sent +.\"O with every IP packet originating from this socket. +.\"O It is used to prioritize packets on the network. +.\"O TOS is a byte. +.\"O There are some standard TOS flags defined: +.\"O .B IPTOS_LOWDELAY +.\"O to minimize delays for interactive traffic, +.\"O .B IPTOS_THROUGHPUT +.\"O to optimize throughput, +.\"O .B IPTOS_RELIABILITY +.\"O to optimize for reliability, +.\"O .B IPTOS_MINCOST +.\"O should be used for "filler data" where slow transmission doesn't matter. +¤³¤Î¥½¥±¥Ã¥È¤«¤éÁ÷¿®¤µ¤ì¤ë¤¹¤Ù¤Æ¤Î IP ¥Ñ¥±¥Ã¥È¤ËŬÍѤµ¤ì¤ë +Type-Of-Service (TOS) ¥Õ¥£¡¼¥ë¥É¤òÀßÄꡦ¼èÆÀ¤¹¤ë¡£ +¤³¤ì¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Ç¤Î¥Ñ¥±¥Ã¥È¤ÎÍ¥ÀèÅÙ¤ò·è¤á¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +TOS ¤Ï¥Ð¥¤¥È¥Ç¡¼¥¿¤Ç¤¢¤ë¡£É¸½à¤Î TOS ¥Õ¥é¥°¤¬¤¤¤¯¤Ä¤«ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.B IPTOS_LOWDELAY +¤Ï¥¤¥ó¥¿¥é¥¯¥Æ¥£¥Ö¤Ê¥È¥é¥Õ¥£¥Ã¥¯¤ÎÃÙ±ä¤òºÇ¾®¤Ë¤¹¤ë¡£ +.B IPTOS_THROUGHPUT +¤Ï¥¹¥ë¡¼¥×¥Ã¥È¤òºÇÂç¤Ë¤¹¤ë¡£ +.B IPTOS_RELIABILITY +¤Ï¿®ÍêÀ­¤òºÇ¹â¤Ë¤¹¤ë¡£ +.B IPTOS_MINCOST +¤ÏžÁ÷®ÅÙ¤¬ÃÙ¤¯¤Æ¤â¤«¤Þ¤ï¤Ê¤¤¤È¤­¡¢¡Ö¥Ç¡¼¥¿¤òµÍ¤á¹þ¤à¡×¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +.\"O At most one of these TOS values can be specified. +.\"O Other bits are invalid and shall be cleared. +¤³¤ì¤é¤Î¤¦¤Á¡¢ 1 ¤Ä¤Þ¤Ç¤À¤±¤òÀßÄê¤Ç¤­¤ë¡£ +¾¤Î¥Ó¥Ã¥È¤Ï̵¸ú¤Ç¡¢¥¯¥ê¥¢¤µ¤ì¤ë¡£ +.\"NAKANO ¢¬Ìõ¤¢¤Ã¤Æ¤ë¡© +.\"O Linux sends +.\"O .B IPTOS_LOWDELAY +.\"O datagrams first by default, +.\"O but the exact behavior depends on the configured queueing discipline. +Linux ¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +.B IPTOS_LOWDELAY +¥Ç¡¼¥¿¥°¥é¥à¤òºÇ½é¤ËÁ÷¿®¤¹¤ë¡£ +¤·¤«¤·¡¢Àµ³Î¤Ê¿¶¤ëÉñ¤¤¤Ï¥­¥å¡¼½èÍý¤ÎÀßÄê¤Ë°Í¸¤¹¤ë¡£ +.\" FIXME elaborate on this +.\"O Some high priority levels may require superuser privileges (the +.\"O .B CAP_NET_ADMIN +.\"O capability). +.\"O The priority can also be set in a protocol independent way by the +.\"O .RB ( SOL_SOCKET ", " SO_PRIORITY ) +.\"O socket option (see +.\"O .BR socket (7)). +¹â¤¤Í¥ÀèÅ٤ˤ¹¤ë¤Ë¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¸¢¸Â +.RB ( CAP_NET_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤¬É¬ÍפȤʤ뤫¤â¤·¤ì¤Ê¤¤¡£ +Í¥ÀèÅÙ¤Ï +.RB ( SOL_SOCKET ", " SO_PRIORITY ) +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ì¤Ð¡¢ +¥×¥í¥È¥³¥ë¤Ë°Í¸¤·¤Ê¤¤·Á¤Ç¤âÀßÄê¤Ç¤­¤ë +.RB ( socket (7) +¤ò¸«¤è)¡£ +.\" FIXME Document IP_TRANSPARENT +.\" Needs CAP_NET_ADMIN +.\" Boolean +.\" Since Linux 2.6.27 +.\" commit f5715aea4564f233767ea1d944b2637a5fd7cd2e +.\" Author: KOVACS Krisztian +.TP +.\"O .BR IP_TTL " (since Linux 1.0)" +.BR IP_TTL " (Linux 1.0 °Ê¹ß)" +.\"O Set or retrieve the current time-to-live field that is used in every packet +.\"O sent from this socket. +time-to-live ¥Õ¥£¡¼¥ë¥É¤ÎÃͤòÀßÄê¤Þ¤¿¤Ï¼èÆÀ¤¹¤ë¡£ +¤³¤ÎÃͤϤ³¤Î¥½¥±¥Ã¥È¤«¤éÁ÷¿®¤µ¤ì¤ë¤¹¤Ù¤Æ¤Î¥Ñ¥±¥Ã¥È¤ËÍѤ¤¤é¤ì¤ë¡£ +.\" FIXME Document IP_XFRM_POLICY +.\" Since Linux 2.5.48 +.\" Needs CAP_NET_ADMIN +.\"O .SS /proc interfaces +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.\"O The IP protocol +.\"O supports a set of +.\"O .I /proc +.\"O interfaces to configure some global parameters. +.\"O The parameters can be accessed by reading or writing files in the directory +.\"O .IR /proc/sys/net/ipv4/ . +IP ¥×¥í¥È¥³¥ë¤Ç¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¥°¥í¡¼¥Ð¥ë¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë¤¿¤á¤Î +.I /proc +¥Õ¥¡¥¤¥ë·²¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤Ë¤Ï¡¢ +.I /proc/sys/net/ipv4/ +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.\" FIXME As at 2.6.12, 14 Jun 2005, the following are undocumented: +.\" ip_queue_maxlen +.\" ip_conntrack_max +.\"O Interfaces described as +.\"O .I Boolean +.\"O take an integer value, with a nonzero value ("true") meaning that +.\"O the corresponding option is enabled, and a zero value ("false") +.\"O meaning that the option is disabled. +.I Boolean +¤È½ñ¤«¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÏÀ°¿ôÃͤò¤È¤ê¡¢ +0 °Ê³°¤ÎÃÍ ("true") ¤ÏÂбþ¤¹¤ë¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¡¢ +0 ÃÍ ("false") ¤Ï̵¸ú¡¢¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.\" +.TP +.\"O .IR ip_always_defrag " (Boolean; since Linux 2.2.13)" +.IR ip_always_defrag " (Boolean; Linux 2.2.13 °Ê¹ß)" +.\"O [New with kernel 2.2.13; in earlier kernel versions this feature +.\"O was controlled at compile time by the +.\"O .B CONFIG_IP_ALWAYS_DEFRAG +.\"O option; this option is not present in 2.4.x and later] +[2.2.13 ¤Ç¿·µ¬Åо졣°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Îµ¡Ç½¤Ï +¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_IP_ALWAYS_DEFRAG +¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤ÆÀ©¸æ¤µ¤ì¤Æ¤¤¤¿; +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï 2.4.x °Ê¹ß¤Ç¤Ï¸ºß¤·¤Ê¤¤] + +.\"O When this boolean flag is enabled (not equal 0), incoming fragments +.\"O (parts of IP packets +.\"O that arose when some host between origin and destination decided +.\"O that the packets were too large and cut them into pieces) will be +.\"O reassembled (defragmented) before being processed, even if they are +.\"O about to be forwarded. +¤³¤Î¥Ö¡¼¥ëÃͤΥե饰¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë (0 °Ê³°¤Ë¤Ê¤Ã¤Æ¤¤¤ë) ¤È¡¢ +ÅþÃ夷¤¿¥Õ¥é¥°¥á¥ó¥È (IP ¥Ñ¥±¥Ã¥È¤Î°ìÉô¤Ç¡¢ +ȯ¿®¸µ¤Èȯ¿®Àè¤Î´Ö¤Î¤É¤³¤«¤Î¥Û¥¹¥È¤Ç¡¢¤½¤Î¥Ñ¥±¥Ã¥È¤¬ +Â礭¤¹¤®¤ë¤ÈȽÃǤµ¤ì¡¢Ê¬³ä¤µ¤ì¤¿¾ì¹ç¤ËÀ¸¤¸¤ë) +¤Ï¡¢¤¿¤È¤¨¥Õ¥©¥ï¡¼¥É¤µ¤ì¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â +½èÍýÁ°¤ËºÆ¹½ÃÛ (¥Ç¥Õ¥é¥°¥á¥ó¥È) ¤µ¤ì¤ë¡£ + +.\"O Only enable if running either a firewall that is the sole link +.\"O to your network or a transparent proxy; never ever use it for a +.\"O normal router or host. +.\"O Otherwise fragmented communication can be disturbed +.\"O if the fragments travel over different links. +.\"O Defragmentation also has a large memory and CPU time cost. +¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤¬¥í¡¼¥«¥ë¦¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤ËÍ£°ì¤Î¥ê¥ó¥¯¤ò»ý¤Ã¤Æ¤¤¤ë +¾ì¹ç¤ä¡¢Æ©²á¥×¥í¥¯¥·¤Î¾ì¹ç¤Ë¸Â¤Ã¤ÆÍ­¸ú¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Ä̾ï¤Î¥ë¡¼¥¿¡¼¤ä¥Û¥¹¥È¤Ç¤Ï·è¤·¤Æ»ÈÍѤ¹¤ë¤³¤È¤Î¤Ê¤¤¤è¤¦¤Ë¡£ +¤µ¤â¤Ê¤¤¤È¥Õ¥é¥°¥á¥ó¥È¤¬Ê̤Υê¥ó¥¯¤ò·Ðͳ¤·¤ÆÅÁ¤ï¤ë¾ì¹ç¤Ë¡¢ +ÄÌ¿®¤Î¥Õ¥é¥°¥á¥ó¥È²½¤¬¤Ç¤­¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¡£ +¤Þ¤¿¥Õ¥é¥°¥á¥ó¥ÈºÆ¹½ÃÛ½èÍý¤Ï¥á¥â¥ê¤È CPU »þ´Ö¤Î¥³¥¹¥È¤¬Èó¾ï¤ËÂ礭¤¤¡£ + +.\"O This is automagically turned on when masquerading or transparent +.\"O proxying are configured. +¤³¤ì¤Ï¥Þ¥¹¥«¥ì¡¼¥É¤äÆ©²á¥×¥í¥¯¥·¤¬ÀßÄꤵ¤ì¤ë¤È¡¢ +ÉԻ׵ĤʻÅÁȤߤˤè¤Ã¤Æ¼«Æ°Åª¤ËÍ­¸ú¤Ë¤Ê¤ë¡£ +.\" +.TP +.\"O .IR ip_autoconfig " (since Linux 2.2 to 2.6.17)" +.IR ip_autoconfig " (Linux 2.2 °Ê¹ß 2.6.17 ¤Þ¤Ç)" +.\" Precisely: since 2.1.68 +.\" FIXME document ip_autoconfig +.\"O Not documented. +¤Þ¤Àµ­½Ò¤·¤Æ¤¤¤Ê¤¤¡£ +.\" +.TP +.\"O .IR ip_default_ttl " (integer; default: 64; since Linux 2.2)" +.IR ip_default_ttl " (integer; default: 64; Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.15 +.\"O Set the default time-to-live value of outgoing packets. +.\"O This can be changed per socket with the +.\"O .B IP_TTL +.\"O option. +Á÷½Ð¤µ¤ì¤ë¥Ñ¥±¥Ã¥È¤Î time-to-live ÃͤΥǥե©¥ë¥È¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤ì¤Ï +.B IP_TTL +¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ì¤Ð¡¢¥Ñ¥±¥Ã¥È¤´¤È¤ËÊѤ¨¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.\" +.TP +.\"O .IR ip_dynaddr " (Boolean; default: disabled; since Linux 2.0.31)" +.IR ip_dynaddr " (Boolean; default: disabled; Linux 2.0.31 °Ê¹ß)" +.\"O Enable dynamic socket address and masquerading entry rewriting on interface +.\"O address change. +.\"O This is useful for dialup interface with changing IP addresses. +.\"O 0 means no rewriting, 1 turns it on and 2 enables verbose mode. +ưŪ¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤È¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤¬Êѹ¹¤µ¤ì¤¿ºÝ¤Î +¥Þ¥¹¥«¥ì¡¼¥É¥¨¥ó¥È¥ê¤ÎºÆ½ñ¤­¹þ¤ß¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¥À¥¤¥¢¥ë¥¢¥Ã¥×¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¡¢ +IP ¥¢¥É¥ì¥¹¤¬Êѹ¹¤µ¤ì¤ë¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.\" +.TP +.\"O .IR ip_forward " (Boolean; default: disabled; since Linux 1.2)" +.IR ip_forward " (Boolean; default: disabled; Linux 1.2 °Ê¹ß)" +.\"O Enable IP forwarding with a boolean flag. +.\"O IP forwarding can be also set on a per-interface basis. +IP forwarding ¤òÍ­¸ú¤Ë¤¹¤ë¤«¤É¤¦¤«¤Î¥Ö¡¼¥ëÃͥե饰¡£ +IP forwarding ¤¹¤ë¤«¤É¤¦¤«¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤´¤È¤Ë¤âÀßÄê¤Ç¤­¤ë¡£ +.\" +.TP +.\"O .IR ip_local_port_range " (since Linux 2.2)" +.IR ip_local_port_range " (Linux 2.2 °Ê¹ß)" +.\" Precisely: since 2.1.68 +.\"O Contains two integers that define the default local port range +.\"O allocated to sockets. +.\"O Allocation starts with the first number and ends with the second number. +.\"O Note that these should not conflict with the ports used by masquerading +.\"O (although the case is handled). +.\"O Also arbitrary choices may cause problems with some firewall packet +.\"O filters that make assumptions about the local ports in use. +.\"O First number should be at least greater than 1024, +.\"O or better greater than 4096, to avoid clashes +.\"O with well known ports and to minimize firewall problems. +¥½¥±¥Ã¥È¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥Ç¥Õ¥©¥ë¥È¤Î¥í¡¼¥«¥ë¥Ý¡¼¥È¤ÎÈϰϤòÄê¤á¤ë +Æó¤Ä¤ÎÀ°¿ô¤òÍ¿¤¨¤ë¡£³ä¤êÅö¤Æ¤Ï 1 ÈÖÌܤÎÈֹ椫¤é»Ï¤Þ¤ê¡¢ 2 ÈÖÌܤÎÈÖ¹æ¤Ç½ª¤ï¤ë¡£ +¤³¤ì¤é¤Ï¥Þ¥¹¥«¥ì¡¼¥É¤ÇÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Ý¡¼¥È¤È½Å¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤ +(¤½¤Î¾ì¹ç¤â¼è¤ê°·¤ï¤ì¤ë¤¬)¡£ +¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Î¥Ñ¥±¥Ã¥È¥Õ¥£¥ë¥¿¡¼¤¬¡ÖÍøÍÑÃæ¤Î¥í¡¼¥«¥ë¥Ý¡¼¥È¡× +¤Ë¤Ä¤¤¤Æ²¿¤é¤«¤Î²¾Äê¤ò¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +ÈÖ¹æ¤ò¾¡¼ê¤Ë·è¤á¤Æ¤·¤Þ¤¦¤ÈÌäÂ꤬µ¯¤­¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +1 ÈÖÌܤÎÈÖ¹æ¤Ï¾¯¤Ê¤¯¤È¤â 1024 ¤è¤êÂ礭¤¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Îɤ¯»È¤ï¤ì¤ë¥Ý¡¼¥È¤È¤Î¾×ÆͤòÈò¤±¤¿¤ê¡¢¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÌäÂê¤ò +²óÈò¤·¤¿¤±¤ì¤Ð¡¢ 4096 ¤è¤ê¤âÂ礭¤¯¤¹¤ë¤Û¤¦¤¬Îɤ¤¤À¤í¤¦¡£ +.\" +.TP +.\"O .IR ip_no_pmtu_disc " (Boolean; default: disabled; since Linux 2.2)" +.IR ip_no_pmtu_disc " (Boolean; default: disabled; Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.15 +.\"O If enabled, don't do Path MTU Discovery for TCP sockets by default. +.\"O Path MTU discovery may fail if misconfigured firewalls (that drop +.\"O all ICMP packets) or misconfigured interfaces (e.g., a point-to-point +.\"O link where the both ends don't agree on the MTU) are on the path. +.\"O It is better to fix the broken routers on the path than to turn off +.\"O Path MTU Discovery globally, because not doing it incurs a high cost +.\"O to the network. +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¥Ç¥Õ¥©¥ë¥È¤Ç TCP ¥½¥±¥Ã¥È¤ËÂФ¹¤ë +Path MTU Discoverty ¤ò¹Ô¤ï¤Ê¤¤¡£ +Path MTU Discovery ¤Ï¡¢ +Àµ¤·¤¯ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤ (ICMP ¥Ñ¥±¥Ã¥È¤òÁ´¤Æ¥É¥í¥Ã¥×¤¹¤ë) ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ä¡¢ +(point-to-point ¥ê¥ó¥¯¤ÇÁÐÊý¤Î MTU ¤¬°ìÃפ·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ê¤É) +Àµ¤·¤¯ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬·ÐÏ©¾å¤Ë¸ºß¤¹¤ë¤È¼ºÇÔ¤·¤Æ¤·¤Þ¤¦¡£ +Path MTU Discovery ¤ò¥°¥í¡¼¥Ð¥ë¤Ë̵¸ú¤Ë¤¹¤ë¤è¤ê¤Ï¡¢ +²õ¤ì¤Æ¤¤¤ë¥ë¡¼¥¿¤òľ¤¹¤Û¤¦¤¬Îɤ¤¡£ +Path MTU Discovery ¤ò̵¸ú¤Ë¤¹¤ë¤È¥Í¥Ã¥È¥ï¡¼¥¯¤Î¥³¥¹¥È¤¬ +Â礭¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤«¤é¤Ç¤¢¤ë¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.\"O .IR ip_nonlocal_bind " (Boolean; default: disabled; since Linux 2.4)" +.IR ip_nonlocal_bind " (Boolean; default: disabled; Linux 2.4 °Ê¹ß)" +.\" Precisely: patch-2.4.0-test10 +.\"O If set, allows processes to +.\"O .BR bind (2) +.\"O to nonlocal IP addresses, +.\"O which can be quite useful, but may break some applications. +¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢¥×¥í¥»¥¹¤¬¼«Ê¬°Ê³°¤Î IP ¥¢¥É¥ì¥¹¤ò +.BR bind (2) +¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£¤³¤ì¤Ï¤«¤Ê¤êÊØÍø¤À¤¬¡¢¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤â¤¢¤ë¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR ip6frag_time " (integer; default 30)" +.\"O Time in seconds to keep an IPv6 fragment in memory. +IPv6 ¥Õ¥é¥°¥á¥ó¥È¤ò¥á¥â¥ê¤ËÊÝ»ý¤·¤Æ¤ª¤¯»þ´Ö (ÉÃñ°Ì)¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR ip6frag_secret_interval " (integer; default 600)" +.\"O Regeneration interval (in seconds) of the hash secret (or lifetime +.\"O for the hash secret) for IPv6 fragments. +IPv6 ¥Õ¥é¥°¥á¥ó¥È¤Î hash secret ¤ÎÀ¸À®´Ö³Ö (hash secret ¤Î¼÷Ì¿) +(ÉÃñ°Ì)¡£ +.TP +.IR ipfrag_high_thresh " (integer), " ipfrag_low_thresh " (integer)" +.\"O If the amount of queued IP fragments reaches +.\"O .IR ipfrag_high_thresh , +.\"O the queue is pruned down to +.\"O .IR ipfrag_low_thresh . +.\"O Contains an integer with the number of bytes. +¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤Æ¤¤¤ë IP ¥Õ¥é¥°¥á¥ó¥È¤ÎÎ̤¬ +.I ipfrag_high_thresh +¤Ë㤹¤ë¤È¡¢¥­¥å¡¼¤ÎÆâÍÆ¤Ï +.I ipfrag_low_thresh +¤Ë¤Þ¤ÇÀÚ¤ê¼Î¤Æ¤é¤ì¤ë¡£¤½¤ì¤¾¤ì¤ÎÂ礭¤µ¤ò +¥Ð¥¤¥Èñ°Ì¤Çɽ¤¹À°¿ôÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.TP +.I neigh/* +.\"O See +.\"O .BR arp (7). +.BR arp (7) +¤ò¸«¤è¡£ +.\" FIXME Document the conf/*/* interfaces +.\" FIXME Document the route/* interfaces +.\" FIXME document them all +.\"O .SS Ioctls +.SS ioctl +.\"O All ioctls described in +.\"O .BR socket (7) +.\"O apply to +.\"O .BR ip . +.BR socket (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë ioctl ¤Ï¡¢¤¹¤Ù¤Æ +.B ip +¤Ë¤âŬÍѤµ¤ì¤ë¡£ +.\" 2006-04-02, mtk +.\" commented out the following because ipchains is obsolete +.\" .PP +.\"O .\" The ioctls to configure firewalling are documented in +.\"O .\" .BR ipfw (4) +.\"O .\" from the +.\"O .\" .B ipchains +.\"O .\" package. +.\" ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë´Ø·¸¤ÎÀßÄê¤Ë´Ø¤¹¤ë ioctl ¤Ë¤Ä¤¤¤Æ¤Ï +.\" .B ipchains +.\" ¥Ñ¥Ã¥±¡¼¥¸¤Î +.\" .BR ipfw (4) +.\" ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O Ioctls to configure generic device parameters are described in +.\"O .BR netdevice (7). +¥¸¥§¥Í¥ê¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Î¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë ioctl ¤Ë¤Ä¤¤¤Æ¤Ï +.BR netdevice (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.\" FIXME Add a discussion of multicasting +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\" FIXME document all errors. +.\" We should really fix the kernels to give more uniform +.\" error returns (ENOMEM vs ENOBUFS, EPERM vs EACCES etc.) +.TP +.B EACCES +.\"O The user tried to execute an operation without the necessary permissions. +.\"O These include: +.\"O sending a packet to a broadcast address without having the +.\"O .B SO_BROADCAST +.\"O flag set; +.\"O sending a packet via a +.\"O .I prohibit +.\"O route; +.\"O modifying firewall settings without superuser privileges (the +.\"O .B CAP_NET_ADMIN +.\"O capability); +.\"O binding to a privileged port without superuser privileges (the +.\"O .B CAP_NET_BIND_SERVICE +.\"O capability). +ɬÍפʸ¢¸Â¤Î¤Ê¤¤¥æ¡¼¥¶¡¼¤¬Áàºî¤ò¼Â¹Ô¤·¤è¤¦¤È¤·¤¿¡£ +°Ê²¼¤Î¤è¤¦¤Ê¾ì¹ç¤¬¹Í¤¨¤é¤ì¤ë: +.B SO_BROADCAST +¥Õ¥é¥°¤òÀßÄꤷ¤Æ¤¤¤Ê¤¤¾õÂÖ¤Ç¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ë +¥Ñ¥±¥Ã¥È¤òÁ÷¤í¤¦¤È¤·¤¿¡£ +.I prohibit +¤Ê¥ë¡¼¥È¤òÄ̤·¤Æ¥Ñ¥±¥Ã¥È¤òÁ÷¤í¤¦¤È¤·¤¿¡£ +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¸¢¸Â +.RB ( CAP_NET_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤Ê¤·¤Ç¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÀßÄê¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿¡£ +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¸¢¸Â +.RB ( CAP_NET_BIND_SERVICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤Ê¤·¤ÇÆø¢¥Ý¡¼¥È¤Ë¥Ð¥¤¥ó¥É¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B EADDRINUSE +.\"O Tried to bind to an address already in use. +´û¤Ë»È¤ï¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B EADDRNOTAVAIL +.\"O A nonexistent interface was requested or the requested source +.\"O address was not local. +¸ºß¤·¤Ê¤¤¥½¥±¥Ã¥È¤¬Í׵ᤵ¤ì¤¿¡£¤Þ¤¿¤ÏÍ׵ᤵ¤ì¤¿ +¥½¡¼¥¹¥¢¥É¥ì¥¹¤¬¥í¡¼¥«¥ë¤Ç¤Ê¤¤¡£ +.TP +.B EAGAIN +.\"O Operation on a nonblocking socket would block. +Èó¥Ö¥í¥Ã¥­¥ó¥°¥½¥±¥Ã¥È¤ËÂФ·¤Æ¥Ö¥í¥Ã¥¯¤¹¤ëÁàºî¤ò¹Ô¤Ã¤¿¡£ +.TP +.B EALREADY +.\"O An connection operation on a nonblocking socket is already in progress. +Èó¥Ö¥í¥Ã¥­¥ó¥°¥½¥±¥Ã¥È¤ËÂФ¹¤ëÀܳÁàºî¤¬´û¤Ë¼Â¹ÔÃæ¤Ç¤¢¤ë¡£ +.TP +.B ECONNABORTED +.\"O A connection was closed during an +.\"O .BR accept (2). +.BR accept (2) +¤ÎºÇÃæ¤ËÀܳ¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿¡£ +.TP +.B EHOSTUNREACH +.\"O No valid routing table entry matches the destination address. +.\"O This error can be caused by a ICMP message from a remote router or +.\"O for the local routing table. +°¸À襢¥É¥ì¥¹¤Ë¥Þ¥Ã¥Á¤¹¤ëÍ­¸ú¤Ê¥¨¥ó¥È¥ê¤¬¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤Ë +¸ºß¤·¤Ê¤¤¡£¤³¤Î¥¨¥é¡¼¤Ï¥ê¥â¡¼¥È¥ë¡¼¥¿¤«¤é¤Î¡¢ +¤¢¤ë¤¤¤Ï¥í¡¼¥«¥ë¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤Ø¤Î +ICMP ¥á¥Ã¥»¡¼¥¸¤Ë¤è¤Ã¤Æ°ú¤­µ¯¤³¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.\"O Invalid argument passed. +.\"O For send operations this can be caused by sending to a +.\"O .I blackhole +.\"O route. +ÉÔÀµ¤Ê°ú¤­¿ô¤¬ÅϤµ¤ì¤¿¡£Á÷¿®Áàºî¤Ë¤ª¤¤¤Æ¡¢ +.I blackhole +¥ë¡¼¥È¤ËÁ÷¿®¤·¤è¤¦¤È¤¹¤ë¤È¤³¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +.B EISCONN +.\"O .BR connect (2) +.\"O was called on an already connected socket. +.BR connect (2) +¤¬¡¢´û¤ËÀܳºÑ¤ß¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ¸Æ¤Ð¤ì¤¿¡£ +.TP +.B EMSGSIZE +.\"O Datagram is bigger than an MTU on the path and it cannot be fragmented. +¥Ç¡¼¥¿¥°¥é¥à¤¬ path MTU ¤è¤ê¤âÂ礭¤¯¡¢¥Õ¥é¥°¥á¥ó¥È²½¤â¤Ç¤­¤Ê¤¤¡£ +.TP +.BR ENOBUFS ", " ENOMEM +.\"O Not enough free memory. +.\"O This often means that the memory allocation is limited by the socket +.\"O buffer limits, not by the system memory, but this is not 100% consistent. +¶õ¤­¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +¤³¤Î¥¨¥é¡¼¤Ï¡¢¥á¥â¥ê¥¢¥í¥±¡¼¥·¥ç¥ó¤¬¥½¥±¥Ã¥È¥Ð¥Ã¥Õ¥¡¤Î +Â礭¤µ¤Ë¤è¤Ã¤ÆÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò°ÕÌ£¤·¤Æ¤¤¤ë¤Î¤¬Ä̾ï¤Ç¤¢¤ë¤¬¡¢ +100% ¤½¤¦¤À¤È¤¤¤¦¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ENOENT +.\"O .B SIOCGSTAMP +.\"O was called on a socket where no packet arrived. +¥Ñ¥±¥Ã¥È¤¬Á´¤¯ÅþÃ夷¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.B SIOCGSTAMP +¤¬¸Æ¤Ð¤ì¤¿¡£ +.TP +.B ENOPKG +.\"O A kernel subsystem was not configured. +¥«¡¼¥Í¥ë¥µ¥Ö¥·¥¹¥Æ¥à¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.\"O .BR ENOPROTOOPT " and " EOPNOTSUPP +.BR ENOPROTOOPT " ¤È " EOPNOTSUPP +.\"O Invalid socket option passed. +ÉÔÀµ¤Ê¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÅϤµ¤ì¤¿¡£ +.TP +.B ENOTCONN +.\"O The operation is only defined on a connected socket, but the socket wasn't +.\"O connected. +Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤ËÂФ·¤Æ¡¢ +Àܳ¾õÂ֤Ǥ·¤«ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤Áàºî¤ò¹Ô¤ª¤¦¤È¤·¤¿¡£ +.TP +.B EPERM +.\"O User doesn't have permission to set high priority, change configuration, +.\"O or send signals to the requested process or group. +¹â¤¤Í¥ÀèÅÙ¤òÀßÄꤷ¤¿¤ê¡¢ÀßÄê¤òÊѹ¹¤·¤¿¤ê¡¢Í׵ᤵ¤ì¤¿¥×¥í¥»¥¹¤ä +¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤Ã¤¿¤ê¤¹¤ë¤Î¤ËɬÍפʸ¢¸Â¤ò¡¢ +¥æ¡¼¥¶¡¼¤¬»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EPIPE +.\"O The connection was unexpectedly closed or shut down by the other end. +Àܳ¤¬ÀèÊý¤«¤é´üÂÔ¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¤ä¤êÊý¤Ç +¥¯¥í¡¼¥º¤¢¤ë¤¤¤Ï¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤¿¡£ +.TP +.B ESOCKTNOSUPPORT +.\"O The socket is not configured or an unknown socket type was requested. +¥½¥±¥Ã¥È¤¬Ì¤ÀßÄê¤Ç¤¢¤ë¤«¡¢ÃΤé¤Ê¤¤¥½¥±¥Ã¥È¥¿¥¤¥×¤¬Í׵ᤵ¤ì¤¿¡£ +.PP +.\"O Other errors may be generated by the overlaying protocols; see +¾¤Î¥¨¥é¡¼¤¬¾åÁؤΥץí¥È¥³¥ë¤Ë¤è¤Ã¤ÆÀ¸¤¸¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .BR tcp (7), +.\"O .BR raw (7), +.\"O .BR udp (7) +.\"O and +.\"O .BR socket (7). +.BR tcp (7), +.BR raw (7), +.BR udp (7), +.BR socket (7) +¤Ê¤É¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O .BR IP_MTU , +.\"O .BR IP_MTU_DISCOVER , +.\"O .BR IP_PKTINFO , +.\"O .B IP_RECVERR +.\"O and +.\"O .B IP_ROUTER_ALERT +.BR IP_MTU , +.BR IP_MTU_DISCOVER , +.BR IP_PKTINFO , +.BR IP_RECVERR , +.B IP_ROUTER_ALERT +.\"O are Linux-specific and should not be used in +.\"O programs intended to be portable. +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢°Ü¿¢À­¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +ÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\" IP_PASSSEC is Linux-specific +.\" IP_TRANSPARENT is Linux-specific +.\" IP_FREEBIND is Linux-specific +.\" IP_XFRM_POLICY is Linux-specific +.\" IP_IPSEC_POLICY is a nonstandard extension, also present on some BSDs +.\"O Be very careful with the +.\"O .B SO_BROADCAST +.\"O option \- it is not privileged in Linux. +.\"O It is easy to overload the network +.\"O with careless broadcasts. +.\"O For new application protocols +.\"O it is better to use a multicast group instead of broadcasting. +.\"O Broadcasting is discouraged. +.B SO_BROADCAST +¥ª¥×¥·¥ç¥ó¤ÎÍøÍѤˤϡ¢¤¯¤ì¤°¤ì¤âÃí°Õ¤¹¤ë¤³¤È¡£ +¤³¤ì¤Ï Linux ¤Ç¤ÏÆø¢Áàºî¤Ç¤Ï¤Ê¤¤¡£ +ÉÔÃí°Õ¤Ê¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤ò¹Ô¤¦¤È¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤Ï´Êñ¤Ë²áÉé²Ù¾õÂ֤ˤʤ롣 +¿·¤·¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥È¥³¥ë¤Ë¤Ï¡¢¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤Ç¤Ï¤Ê¤¯ +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤òÍѤ¤¤ë¤Û¤¦¤¬¤è¤¤¡£ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤Ï¿ä¾©¤µ¤ì¤Ê¤¤¡£ +.PP +.\"O Some other BSD sockets implementations provide +.\"O .B IP_RCVDSTADDR +.\"O and +.\"O .B IP_RECVIF +.\"O socket options to get the destination address and the interface of +.\"O received datagrams. +.\"O Linux has the more general +.\"O .B IP_PKTINFO +.\"O for the same task. +¾¤Î BSD ¤Î¥½¥±¥Ã¥È¼ÂÁõ¤Ç¤Ï¡¢ +.B IP_RCVDSTADDR +¤È +.B IP_RECVIF +¤È¤¤¤Ã¤¿¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤ª¤ê¡¢ +°¸À襢¥É¥ì¥¹¤ä¼õ¿®¥Ç¡¼¥¿¥°¥é¥à¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬¼èÆÀ¤Ç¤­¤ë¤è¤¦¤Ë +¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤â¤¢¤ë¡£ +Linux ¤ÇƱ¤¸¤³¤È¤ò¤ä¤é¤»¤ë¤Ë¤Ï¡¢¤è¤ê°ìÈÌŪ¤Ê +.B IP_PKTINFO +¤¬»È¤¨¤ë¡£ +.PP +.\"O Some BSD sockets implementations also provide an +.\"O .B IP_RECVTTL +.\"O option, but an ancillary message with type +.\"O .B IP_RECVTTL +.\"O is passed with the incoming packet. +.\"O This is different from the +.\"O .B IP_TTL +.\"O option used in Linux. +¤¤¤¯¤Ä¤«¤Î BSD ¤Î¥½¥±¥Ã¥È¼ÂÁõ¤Ç¤Ï +.B IP_RECVTTL +¥ª¥×¥·¥ç¥ó¤âÄ󶡤µ¤ì¤Æ¤¤¤ë¤¬¡¢¥¿¥¤¥× +.B IP_RECVTTL +¤ÎÊä½õ¥á¥Ã¥»¡¼¥¸¤Ï¼õ¿®¥Ñ¥±¥Ã¥È¤È¤È¤â¤ËÅϤµ¤ì¤ë¡£ +¤³¤ì¤Ï Linux ¤Ç»È¤ï¤ì¤Æ¤¤¤ë +.B IP_TTL +¥ª¥×¥·¥ç¥ó¤È¤Ï°Û¤Ê¤ëÆ°ºî¤Ç¤¢¤ë¡£ +.PP +.\"O Using +.\"O .B SOL_IP +.\"O socket options level isn't portable, BSD-based stacks use +.\"O .B IPPROTO_IP +.\"O level. +.B SOL_IP +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë¤Ï°Ü¿¢À­¤¬¤Ê¤¤¡£ +BSD ¥Ù¡¼¥¹¤Î¥×¥í¥È¥³¥ë¥¹¥¿¥Ã¥¯¤Ç¤Ï +.B IPPROTO_IP +¥ì¥Ù¥ë¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS Compatibility +.SS °Ü¿¢À­ +.\"O For compatibility with Linux 2.0, the obsolete +.\"O .BI "socket(AF_INET, SOCK_PACKET, " protocol ) +.\"O syntax is still supported to open a +.\"O .BR packet (7) +.\"O socket. +.\"O This is deprecated and should be replaced by +.\"O .BI "socket(AF_PACKET, SOCK_RAW, " protocol ) +.\"O instead. +.\"O The main difference is the +.\"O new +.\"O .I sockaddr_ll +.\"O address structure for generic link layer information instead of the old +.\"O .BR sockaddr_pkt . +Linux 2.0 ¤È¤Î¸ß´¹À­¤Î¤¿¤á¤Ë¡¢ obsolete ¤Ê +.BI "socket(AF_INET, SOCK_PACKET, " protocol ) +¤È¤¤¤¦½ñ¼°¤Ç¤â +.BR packet (7) +¤ò¥ª¡¼¥×¥ó¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¬¡¢¤³¤ì¤Ï¤ª´«¤á¤Ç¤­¤Ê¤¤¡£º£¸å¤Ï +.BI "socket(AF_PACKET, SOCK_RAW, " protocol ) +¤òÂå¤ï¤ê¤ËÍѤ¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£¼ç¤Ê°ã¤¤¤Ï¡¢¥¸¥§¥Í¥ê¥Ã¥¯¤Ê¥ê¥ó¥¯ÁØÍѤΠ+.I sockaddr_ll +¥¢¥É¥ì¥¹¹½Â¤ÂΤ¬¡¢¸Å¤¤ +.B sockaddr_pkt +¤ËÊѤï¤Ã¤ÆÍѤ¤¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤³¤È¤Ç¤¢¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O There are too many inconsistent error values. +¥¨¥é¡¼¤ÎÃͤ¬Á´¤¯¼óÈø°ì´Ó¤·¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O The ioctls to configure IP-specific interface options and ARP tables are +.\"O not described. +IP ¸ÇÍ­¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤¿¤á¤Î ioctl ¤È +ARP ¥Æ¡¼¥Ö¥ë¤Î¤³¤È¤¬µ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O Some versions of glibc forget to declare +.\"O .IR in_pktinfo . +.\"O Workaround currently is to copy it into your program from this man page. +glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï +.I in_pktinfo +¤ÎÄêµÁ¤ò˺¤ì¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ë¡£ +¸½»þÅÀ¤Ç¤Î¤È¤ê¤¢¤¨¤º¤ÎÂкö¤È¤·¤Æ¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤Ë¤¢¤ëÄêµÁ¤ò¥×¥í¥°¥é¥àÃæ¤Ë +¥³¥Ô¡¼¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +.PP +.\"O Receiving the original destination address with +.\"O .B MSG_ERRQUEUE +.\"O in +.\"O .I msg_name +.\"O by +.\"O .BR recvmsg (2) +.\"O does not work in some 2.2 kernels. +.BR recvmsg (2) +¤Ç +.I msg_name +¤Ë +.B MSG_ERRQUEUE +¤ò»ØÄꤷ¤Æ¡¢¼õ¿®¥Ñ¥±¥Ã¥È¤ËÆþ¤Ã¤Æ¤¤¤¿°¸À襢¥É¥ì¥¹¤ò¼èÆÀ¤¹¤ëÊýË¡¤Ï +2.2 ¥«¡¼¥Í¥ë¤Î°ìÉô¤Ç¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¡£ +.\"O .\" .SH AUTHORS +.\" .SH Ãø¼Ô +.\"O .\" This man page was written by Andi Kleen. +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï Andi Kleen ¤¬½ñ¤¤¤¿¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR recvmsg (2), +.BR sendmsg (2), +.BR byteorder (3), +.BR ipfw (4), +.BR capabilities (7), +.BR netlink (7), +.BR raw (7), +.BR socket (7), +.BR tcp (7), +.BR udp (7) +.PP +.\"O RFC\ 791 for the original IP specification. +.BR RFC\ 791 : +¥ª¥ê¥¸¥Ê¥ë¤Î IP ¤Î»ÅÍÍ +.br +.\"O RFC\ 1122 for the IPv4 host requirements. +.BR RFC\ 1122 : +IPv4 ¥Û¥¹¥È¤ÎɬÍ×¾ò·ï +.br +.\"O RFC\ 1812 for the IPv4 router requirements. +.BR RFC\ 1812 : +IPv4 ¥ë¡¼¥¿¤ÎɬÍ×¾ò·ï +.\" FIXME autobind INADDR REUSEADDR diff --git a/draft/man7/ipv6.7 b/draft/man7/ipv6.7 new file mode 100644 index 00000000..c772dc1a --- /dev/null +++ b/draft/man7/ipv6.7 @@ -0,0 +1,592 @@ +.\" This man page is Copyright (C) 2000 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. +.\" $Id: ipv6.7,v 1.4 2001/08/15 18:01:06 hanataka Exp $ +.\" +.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. +.\" Translated Sun 18 Feb 2001 by NAKANO Takeo +.\" Updated Wed 4 Apr 2001 by Yuichi SATO +.\" Updated Sat Dec 17 09:31:21 JST 2005 by Yuichi SATO +.\" Updated 2007-05-28, Akihiro MOTOKI , LDP v2.50 +.\" Updated 2008-08-07, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: flow identifier ¥Õ¥í¡¼»ØÄê»Ò +.\"WORD: control message À©¸æ¥á¥Ã¥»¡¼¥¸ +.\"WORD: incoming ¡Á ¼õ¿® (¥Ñ¥±¥Ã¥È¡¢¥Ç¡¼¥¿¥°¥é¥à) +.\"WORD: outgoing ¡Á Á÷¿® (¥Ñ¥±¥Ã¥È¡¢¥Ç¡¼¥¿¥°¥é¥à) +.\"WORD: asynchronous error ÈóƱ´ü¥¨¥é¡¼ +.\" +.TH IPV6 7 2009-02-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O ipv6, AF_INET6 \- Linux IPv6 protocol implementation +.SH ̾Á° +ipv6, AF_INET6 \- Linux ¤Î IPv6 ¥×¥í¥È¥³¥ë¼ÂÁõ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.IB tcp6_socket " = socket(AF_INET6, SOCK_STREAM, 0);" +.br +.IB raw6_socket " = socket(AF_INET6, SOCK_RAW, " protocol ");" +.br +.IB udp6_socket " = socket(AF_INET6, SOCK_DGRAM, " protocol ");" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Linux 2.2 optionally implements the Internet Protocol, version 6. +.\"O This man page contains a description of the IPv6 basic API as +.\"O implemented by the Linux kernel and glibc 2.1. +.\"O The interface +.\"O is based on the BSD sockets interface; see +.\"O .BR socket (7). +Linux 2.2 ¤Ç¤Ï¡¢Internet Protocol, version 6 ¤ò +¥ª¥×¥·¥ç¥ó¤È¤·¤Æ¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ï¡¢Linux ¥«¡¼¥Í¥ë¤È glibc 2.1 ¤Ç¤Î¼ÂÁõ¤Ë´ð¤Å¤¤¤Æ¡¢ +IPv6 ¤Î´ðËÜŪ¤Ê API ¤ò²òÀ⤹¤ë¡£ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï BSD ¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò¤â¤È¤Ë¤·¤Æ¤¤¤ë¡£ +.BR socket (7) +¤ò»²¾È¡£ +.PP +.\"O The IPv6 API aims to be mostly compatible with the +.\"O IPv4 API (see +.\"O .BR ip (7)). +.\"O Only differences are described in this man page. +IPv6 API ¤Ï¡¢ +IPv4 API +.RB ( ip (7) +»²¾È) ¤È¤Û¤Ü¸ß´¹¤Ë¤Ê¤ë¤³¤È¤òÌܻؤ·¤Æ¤¤¤ë¡£ +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤ÏÁê°ãÅÀ¤Î¤ß¤ò²òÀ⤹¤ë¡£ +.PP +.\"O To bind an +.\"O .B AF_INET6 +.\"O socket to any process, the local address should be copied from the +.\"O .I in6addr_any +.\"O variable which has +.\"O .I in6_addr +.\"O type. +.\"O In static initializations, +.\"O .B IN6ADDR_ANY_INIT +.\"O may also be used, which expands to a constant expression. +.\"O Both of them are in network byte order. +.B AF_INET6 +¥½¥±¥Ã¥È¤ò²¿¤é¤«¤Î¥×¥í¥»¥¹¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¤Ë¤Ï¡¢ +¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤ò +.I in6_addr +·¿¤ÎÊÑ¿ô +.I in6addr_any +¤«¤é¥³¥Ô¡¼¤·¤Æ¤¯¤ëɬÍפ¬¤¢¤ë¡£ +static ¤Ê½é´üÃÍ +.B IN6ADDR_ANY_INIT +¤âÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¡¢¤³¤ì¤ÏÄê¿ô¼°¤ËŸ³«¤µ¤ì¤ë¡£ +¤³¤ì¤é¤Îξ¼Ô¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç¤¢¤ë¡£ +.PP +.\"O The IPv6 loopback address (::1) is available in the global +.\"O .I in6addr_loopback +.\"O variable. +.\"O For initializations, +.\"O .B IN6ADDR_LOOPBACK_INIT +.\"O should be used. +IPv6 ¤Î¥ë¡¼¥×¥Ð¥Ã¥¯¥¢¥É¥ì¥¹ (::1) ¤Ï global ÊÑ¿ô +.I in6addr_loopback +¤«¤é¼èÆÀ¤Ç¤­¤ë¡£½é´ü²½¤Ë¤Ï +.B IN6ADDR_LOOPBACK_INIT +¤òÍѤ¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.\"O IPv4 connections can be handled with the v6 API by using the +.\"O v4-mapped-on-v6 address type; +.\"O thus a program only needs to support this API type to +.\"O support both protocols. +.\"O This is handled transparently by the address +.\"O handling functions in the C library. +v4-mapped-on-v6 ¥¢¥É¥ì¥¹·¿¤òÍѤ¤¤ë¤³¤È¤Ç¡¢ +IPv4 Àܳ¤â v6 API ¤Ç°·¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤¦¤¹¤ì¤Ð¡¢¥×¥í¥°¥é¥à¤Ï v6 ¤Î API ¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤À¤±¤Ç¡¢ +ξÊý¤Î¥×¥í¥È¥³¥ë¤ò¥µ¥Ý¡¼¥È¤Ç¤­¤ë¡£ +v4-mapped-on-v6 ¥¢¥É¥ì¥¹·¿¤Ï C ¥é¥¤¥Ö¥é¥êÆâÉô¤Î¥¢¥É¥ì¥¹¤ò +°·¤¦´Ø¿ô¤Ë¤è¤Ã¤ÆÆ©²áŪ¤Ë½èÍý¤µ¤ì¤ë¡£ +.PP +.\"O IPv4 and IPv6 share the local port space. +.\"O When you get an IPv4 connection +.\"O or packet to a IPv6 socket, its source address will be mapped +.\"O to v6 and it will be mapped to v6. +IPv4 ¤È IPv6 ¤Ï¥í¡¼¥«¥ë¥Ý¡¼¥È¶õ´Ö¤ò¶¦Í­¤¹¤ë¡£ +IPv4 ¤ÎÀܳ (¤Þ¤¿¤Ï¥Ñ¥±¥Ã¥È) ¤ò IPv6 ¥½¥±¥Ã¥È¤¬¼èÆÀ¤¹¤ë¤È¡¢ +ȯ¿®¸µ¥¢¥É¥ì¥¹¤¬ v6 ¤Ë¥Þ¥Ã¥×¤µ¤ì¡¢¤½¤ÎÀܳ (¥Ñ¥±¥Ã¥È) ¤â v6 ¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¡£ +.\"nakano: ºÇ¸å¤Î it ¤¬¤Ê¤Ë¤ò»Ø¤¹¤Î¤«¤ï¤«¤é¤ó¡£ +.\"O +.\"O .SS Address Format +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.in +4n +.nf +struct sockaddr_in6 { + sa_family_t sin6_family; /* AF_INET6 */ + in_port_t sin6_port; /* port number */ + uint32_t sin6_flowinfo; /* IPv6 flow information */ + struct in6_addr sin6_addr; /* IPv6 address */ + uint32_t sin6_scope_id; /* Scope ID (new in 2.4) */ +}; + +struct in6_addr { + unsigned char s6_addr[16]; /* IPv6 address */ +}; +.fi +.in +.sp +.\"O .I sin6_family +.\"O is always set to +.\"O .BR AF_INET6 ; +.\"O .I sin6_port +.\"O is the protocol port (see +.\"O .I sin_port +.\"O in +.\"O .BR ip (7)); +.\"O .I sin6_flowinfo +.\"O is the IPv6 flow identifier; +.\"O .I sin6_addr +.\"O is the 128bit IPv6 address. +.\"O .I sin6_scope_id +.\"O is an ID depending on the scope of the address. +.\"O It is new in Linux 2.4. +.\"O Linux only supports it for link scope addresses, in that case +.\"O .I sin6_scope_id +.\"O contains the interface index (see +.\"O .BR netdevice (7)) +.I sin6_family +¤Ï¾ï¤Ë +.B AF_INET6 +¤ËÀßÄꤵ¤ì¤ë¡£ +.I sin6_port +¤Ï¥×¥í¥È¥³¥ë¥Ý¡¼¥È¤Ç¤¢¤ë +.RB ( ip (7) +¤Î +.I sin_port +¤ò»²¾È)¡£ +.I sin6_flowinfo +¤Ï IPv6 ¤Î¥Õ¥í¡¼»ØÄê»Ò (flow identifier) ¤Ç¤¢¤ë¡£ +.I sin6_addr +¤Ï 128 ¥Ó¥Ã¥È¤Î IPv6 ¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I sin6_scope_id +¤Ï¥¢¥É¥ì¥¹¤Î¥¹¥³¡¼¥×¤Ë°Í¸¤·¤¿ ID ¤Ç¤¢¤ë +(¤³¤ì¤Ï Linux 2.4 ¤ÇƳÆþ¤µ¤ì¤¿)¡£ +Linux ¤Î¾ì¹ç¤Ï¡¢¤³¤ì¤Ï¥ê¥ó¥¯¥¹¥³¡¼¥×¥¢¥É¥ì¥¹¤Ç¤·¤«¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤¡£ +¤³¤Î¾ì¹ç +.I sin6_scope_id +¤Ë¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬´Þ¤Þ¤ì¤ë¤³¤È¤Ë¤Ê¤ë +.RB ( netdevice (7) +¤ò»²¾È)¡£ +.PP +.\"O IPv6 supports several address types: unicast to address a single +.\"O host, multicast to address a group of hosts, +.\"O anycast to address the nearest member of a group of hosts +.\"O (not implemented in Linux), IPv4-on-IPv6 to +.\"O address a IPv4 host, and other reserved address types. +IPv6 ¤Ï²¿¼ïÎफ¤Î¥¢¥É¥ì¥¹¥¿¥¤¥×¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +ñ°ì¤Î¥Û¥¹¥È¤ò¥¢¥É¥ì¥¹¤¹¤ë¤¿¤á¤Î unicast¡¢ +¥Û¥¹¥È¤Î¥°¥ë¡¼¥×¤ò¥¢¥É¥ì¥¹¤¹¤ë¤¿¤á¤Î multicast¡¢ +¥Û¥¹¥È¤Î¥°¥ë¡¼¥×Ãæ¤ÇºÇ¤â¶á¤¯¤Ë¤¤¤ë¤â¤Î¤ò¥¢¥É¥ì¥¹¤¹¤ë¤¿¤á¤Î anycast +(¤³¤ì¤Ï Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤)¡¢ +IPv4 ¥Û¥¹¥È¤ò¥¢¥É¥ì¥¹¤¹¤ë¤¿¤á¤Î IPv4-on-IPv6¡£ +¾¤Ë¤âͽÌóºÑ¤ß¤Î¥¢¥É¥ì¥¹¥¿¥¤¥×¤¬¤¢¤ë¡£ +.PP +.\"O The address notation for IPv6 is a group of 16 2-digit hexadecimal +.\"O numbers, separated with a \(aq:\(aq. +.\"O \&"::" stands for a string of 0 bits. +.\"O Special addresses are ::1 for loopback and ::FFFF: +.\"O for IPv4-mapped-on-IPv6. +IPv6 ¤Ç¤Î¥¢¥É¥ì¥¹É½µ­¤Ï 2 ·å¤Î 16 ¿Ê¿ô 16 ¸Ä¤«¤é¤Ê¤ê¡¢ +\(aq:\(aq ¤Ï¶èÀÚ¤êʸ»ú¤Ï¤Ç¡¢"::" ¤Ï 0 ¥Ó¥Ã¥È¤Îʸ»úÎó¤òɽ¤¹¡£ +Æüì¤Ê¥¢¥É¥ì¥¹¤È¤·¤Æ¡¢¥ë¡¼¥×¥Ð¥Ã¥¯¤òɽ¤¹ ::1¡¢ +IPv4-mapped-on-IPv6 ¤òɽ¤¹ ::FFFF:: ¤¬¤¢¤ë¡£ +.PP +.\"O The port space of IPv6 is shared with IPv4. +IPv6 ¤Î¥Ý¡¼¥È¶õ´Ö¤Ï IPv4 ¤È¶¦Í­¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS "Socket Options" +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.\"O IPv6 supports some protocol-specific socket options that can be set with +.\"O .BR setsockopt (2) +.\"O and read with +.\"O .BR getsockopt (2). +.\"O The socket option level for IPv6 is +.\"O .BR IPPROTO_IPV6 . +.\"O A boolean integer flag is zero when it is false, otherwise true. +IPv6 ¤Ï¥×¥í¥È¥³¥ë¸ÇÍ­¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ò¤¤¤¯¤Ä¤«¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Ï +.BR setsockopt (2) +¤ÇÀßÄê¤Ç¤­¡¢ +.BR getsockopt (2) +¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +IPv6 ¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë¤Ï +.B IPPROTO_IPV6 +¤Ç¤¢¤ë¡£ +¥Ö¡¼¥ëÀ°¿ô¤Î¥Õ¥é¥°¤Ï¡¢0 ¤¬µ¶¤Ç¤¢¤ê¡¢¤½¤ì°Ê³°¤Ï¿¿¤Ç¤¢¤ë¡£ +.TP +.B IPV6_ADDRFORM +.\"O Turn an +.\"O .B AF_INET6 +.\"O socket into a socket of a different address family. +.\"O Only +.\"O .B AF_INET +.\"O is currently supported for that. +.\"O It is only allowed for IPv6 sockets +.\"O that are connected and bound to a v4-mapped-on-v6 address. +.\"O The argument is a pointer to an integer containing +.\"O .BR AF_INET . +.\"O This is useful to pass v4-mapped sockets as file descriptors to +.\"O programs that don't know how to deal with the IPv6 API. +.B AF_INET6 +¥½¥±¥Ã¥È¤òÊ̤Υ¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Î¥½¥±¥Ã¥È¤ËÊѤ¨¤ë¡£ +¸½ºß¤Ï +.B AF_INET +¤Î¤ß¤¬Êѹ¹Àè¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤È¤·¤Æ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤¬µö²Ä¤µ¤ì¤ë¤Î¤Ï¡¢IPv6 ¤¬Àܳ¤µ¤ì¡¢ +v4-mapped-on-v6 ¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤¿¾ì¹ç¤Ë¸Â¤é¤ì¤ë¡£ +°ú¤­¿ô¤Ï +.B AF_INET +¤¬Æþ¤Ã¤Æ¤¤¤ëÀ°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +v4-mapped ¥½¥±¥Ã¥È¤ò¡¢IPv6 API ¤ò°·¤¨¤Ê¤¤¥×¥í¥°¥é¥à¤ËÂФ·¤Æ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤È¤·¤ÆÅϤ¹¾ì¹ç¤ËÊØÍø¡£ +.TP +.B IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP +.\"O Control membership in multicast groups. +.\"O Argument is a pointer to a +.\"O .I struct ipv6_mreq +.\"O structure. +multicast ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤òÀ©¸æ¤¹¤ë¡£ +°ú¤­¿ô¤Ï +.I struct ipv6_mreq +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡£ +.\"O .\" FIXME IPV6_CHECKSUM is not documented, and probably should be +.\"O .\" FIXME IPV6_JOIN_ANYCAST is not documented, and probably should be +.\"O .\" FIXME IPV6_LEAVE_ANYCAST is not documented, and probably should be +.\" FIXME IPV6_CHECKSUM ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£ +.\" FIXME IPV6_JOIN_ANYCAST ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£ +.\" FIXME IPV6_LEAVE_ANYCAST ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£ +.\"O .\" FIXME IPV6_RECVPKTINFO is not documented, and probably should be +.\"O .\" FIXME IPV6_2292PKTINFO is not documented, and probably should be +.\"O .\" FIXME there are probably many other IPV6_* socket options that +.\"O .\" should be documented +.\" FIXME IPV6_RECVPKTINFO ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£ +.\" FIXME IPV6_2292PKTINFO ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£ +.\" FIXME ¾¤Ë¤â¿¤¯¤Îµ­½Ò¤¹¤Ù¤­ IPV6_* ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬¤¢¤ë¤À¤í¤¦¡£ +.TP +.B IPV6_MTU +.\"O Set the MTU to be used for the socket. +.\"O The MTU is limited by the device +.\"O MTU or the path mtu when path mtu discovery is enabled. +.\"O Argument is a pointer to integer. +¤½¤Î¥½¥±¥Ã¥È¤ËÂФ·¤ÆÍѤ¤¤ë MTU ¤ÎÃͤòÀßÄꤹ¤ë¡£ +MTU ¤ÎÂ礭¤µ¤Ï¡¢ +¤½¤Î¥Ç¥Ð¥¤¥¹¤Î MTU ¤Þ¤¿¤Ï (Path MTU Discovery +¤¬²Äǽ¤Ê¤é) ¤½¤Î·ÐÏ©¤Î MTU ¤ÎÂ礭¤µ°Ê²¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +°ú¤­¿ô¤ÏÀ°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.TP +.B IPV6_MTU_DISCOVER +.\"O Control path mtu discovery on the socket. +.\"O See +.\"O .B IP_MTU_DISCOVER +.\"O in +.\"O .BR ip (7) +.\"O for details. +¤½¤Î¥½¥±¥Ã¥È¤Ç¤Î Path MTU Discovery ¤òÀ©¸æ¤¹¤ë¡£ +¾ÜºÙ¤Ï +.BR ip (7) +¤Î +.B IP_MTU_DISCOVER +¤ò»²¾È¡£ +.TP +.B IPV6_MULTICAST_HOPS +.\"O Set the multicast hop limit for the socket. +.\"O Argument is a pointer to an +.\"O integer. +.\"O \-1 in the value means use the route default, otherwise it should be +.\"O between 0 and 255. +¤½¤Î¥½¥±¥Ã¥È¤Ç¤Î multicast ¤Î hop ¿ô¤Î¾å¸ÂÃͤòÀßÄꤹ¤ë¡£ +°ú¤­¿ô¤ÏÀ°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +\-1 ¤ò»ØÄꤹ¤ë¤È·ÐÏ©¤Î¥Ç¥Õ¥©¥ë¥È¤òÍѤ¤¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤«¤é 255 ¤ÎÈϰϤò»ØÄꤹ¤ë¡£ +.TP +.B IPV6_MULTICAST_IF +.\"O Set the device for outgoing multicast packets on the socket. +.\"O This is only allowed +.\"O for +.\"O .B SOCK_DGRAM +.\"O and +.\"O .B SOCK_RAW +.\"O socket. +.\"O The argument is a pointer to an interface index (see +.\"O .BR netdevice (7)) +.\"O in an integer. +¤½¤Î¥½¥±¥Ã¥È¤Ç¤Î¡¢Á÷¿® multicast ¥Ñ¥±¥Ã¥È¤ËÍѤ¤¤ë¥Ç¥Ð¥¤¥¹¤òÀßÄꤹ¤ë¡£ +¤³¤ì¤Ï +.B SOCK_DGRAM +¤ª¤è¤Ó +.B SOCK_RAW +³Æ¥½¥±¥Ã¥È¤Ç¤Î¤ßµö¤µ¤ì¤ë¡£ +°ú¤­¿ô¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÀ°¿ôÃÍ +.RB ( netdevice (7) +¤ò»²¾È) ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.TP +.B IPV6_MULTICAST_LOOP +.\"O Control whether the socket sees multicast packets that it has send itself. +.\"O Argument is a pointer to boolean. +¥½¥±¥Ã¥È¤¬¡¢¼«Ê¬¼«¿È¤ÎÁ÷¿®¤·¤¿ +multicast ¥Ñ¥±¥Ã¥È¤ò´Æ»ë¤¹¤ë¤«¤É¤¦¤«¤òÀ©¸æ¤¹¤ë¡£ +°ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤؤΥݥ¤¥ó¥¿¡£ +.TP +.B IPV6_PKTINFO +.\"O Set delivery of the +.\"O .B IPV6_PKTINFO +.\"O control message on incoming datagrams. +.\"O Only allowed for +.\"O .B SOCK_DGRAM +.\"O or +.\"O .B SOCK_RAW +.\"O sockets. +.\"O Argument is a pointer to a boolean value in an integer. +¥Ç¡¼¥¿¥°¥é¥à¤ÎÅþÃå»þ¤Ë¤ª¤±¤ë +.B IPV6_PKTINFO +À©¸æ¥á¥Ã¥»¡¼¥¸¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¤òÀßÄꤹ¤ë¡£ +.B SOCK_DGRAM +¥½¥±¥Ã¥È¤Þ¤¿¤Ï +.B SOCK_RAW +¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Î¤ßµö²Ä¤µ¤ì¤ë¡£ +°ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤÎÆþ¤Ã¤¿À°¿ô¡£ +.TP +.nh +.B IPV6_RTHDR, IPV6_AUTHHDR, IPV6_DSTOPS, IPV6_HOPOPTS, IPV6_FLOWINFO, IPV6_HOPLIMIT +.hy +.\"O Set delivery of control messages for incoming datagrams containing +.\"O extension headers from the received packet. +¼õ¿®¥Ñ¥±¥Ã¥È¤Î¥Ç¡¼¥¿¥°¥é¥à¤Ë³ÈÄ¥¥Ø¥Ã¥À¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¡¢ +À©¸æ¥á¥Ã¥»¡¼¥¸¤ÎÇÛÁ÷¤òÀßÄꤹ¤ë¡£ +.\"O .B IPV6_RTHDR +.\"O delivers the routing header, +.BR IPV6_RTHDR : +routing ¥Ø¥Ã¥À¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£ +.\"O .B IPV6_AUTHHDR +.\"O delivers the authentication header, +.BR IPV6_AUTHHDR : +authentication ¥Ø¥Ã¥À¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£ +.\"O .B IPV6_DSTOPTS +.\"O delivers the destination options, +.BR IPV6_DSTOPTS : +destination ¥ª¥×¥·¥ç¥ó¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£ +.\"O .B IPV6_HOPOPTS +.\"O delivers the hop options, +.BR IPV6_HOPOPTS : +hop ¥ª¥×¥·¥ç¥ó¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£ +.\"O .B IPV6_FLOWINFO +.\"O delivers an integer containing the flow ID, +.BR IPV6_FLOWINFO : +flow ID ¤ò´Þ¤àÀ°¿ô¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£ +.\"O .B IPV6_HOPLIMIT +.\"O delivers an integer containing the hop count of the packet. +.BR IPV6_HOPLIMIT : +¥Ñ¥±¥Ã¥È¤Î hop ¥«¥¦¥ó¥È¤ò´Þ¤àÀ°¿ô¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£ +.\"O The control messages have the same type as the socket option. +.\"O All these header options can also be set for outgoing packets +.\"O by putting the appropriate control message into the control buffer of +.\"O .BR sendmsg (2). +.\"O Only allowed for +.\"O .B SOCK_DGRAM +.\"O or +.\"O .B SOCK_RAW +.\"O sockets. +.\"O Argument is a pointer to a boolean value. +À©¸æ¥á¥Ã¥»¡¼¥¸¤Ï¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Î¤â¤Î¤ÈƱ¤¸¥¿¥¤¥×¤ò»ý¤Ä¡£ +¤³¤ì¤é¤Î¤¹¤Ù¤Æ¤Î¥Ø¥Ã¥À¥ª¥×¥·¥ç¥ó¤Ï¡¢ +ŬÀÚ¤ÊÀ©¸æ¥á¥Ã¥»¡¼¥¸¤ò +.BR sendmsg (2) +¤ÎÀ©¸æ¥Ð¥Ã¥Õ¥¡¡¼¤Ë½ñ¤­¤³¤á¤Ð¡¢ +Á÷¿®¥Ñ¥±¥Ã¥È¤Ë¤Ç¤âÀßÄê¤Ç¤­¤ë¡£ +.B SOCK_DGRAM +¥½¥±¥Ã¥È¤Þ¤¿¤Ï +.B SOCK_RAW +¥½¥±¥Ã¥È¤Ç¤Î¤ßµö¤µ¤ì¤ë¡£°ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤؤΥݥ¤¥ó¥¿¡£ +.TP +.B IPV6_RECVERR +.\"O Control receiving of asynchronous error options. +.\"O See +.\"O .B IP_RECVERR +.\"O in +.\"O .BR ip (7) +.\"O for details. +.\"O Argument is a pointer to boolean. +ÈóƱ´ü¥¨¥é¡¼ (asynchronous error) ¥ª¥×¥·¥ç¥ó¤Î¼õ¿®¤òÀ©¸æ¤¹¤ë¡£ +¾ÜºÙ¤Ï +.BR ip (7) +¤Î +.B IP_RECVERR +¤ò»²¾È¡£ +°ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤؤΥݥ¤¥ó¥¿¡£ +.TP +.B IPV6_ROUTER_ALERT +.\"O Pass forwarded packets containing a router alert hop-by-hop option to +.\"O this socket. +.\"O Only allowed for SOCK_RAW sockets. +.\"O The tapped packets are not forwarded by the kernel, it is the +.\"O user's responsibility to send them out again. +¤³¤Î¥½¥±¥Ã¥È¤Ç¡¢router alert hop-by-hop ¥ª¥×¥·¥ç¥ó¤ÎÉÕ¤¤¤¿Å¾Á÷¥Ñ¥±¥Ã¥È¤ò +Ä̤¹¤«¤É¤¦¤«¤òÀ©¸æ¤¹¤ë¡£ +.B SOCK_RAW +¥½¥±¥Ã¥È¤Ç¤Î¤ßµö²Ä¤µ¤ì¤ë¡£ +tap ¤µ¤ì¤¿¥Ñ¥±¥Ã¥È¤Ï¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¤ÏžÁ÷¤µ¤ì¤Ê¤¤¡£¤½¤¦¤·¤¿¥Ñ¥±¥Ã¥È¤ò +ºÆÅÙÁ÷¿®¤¹¤ë¤Î¤Ï¥æ¡¼¥¶¡¼¤ÎÀÕǤ¤Ç¤¢¤ë¡£ +.\"O Argument is a pointer to an integer. +.\"O A positive integer indicates a router alert option value to intercept. +.\"O Packets carrying a router alert option with a value field containing +.\"O this integer will be delivered to the socket. +.\"O A negative integer disables delivery of packets with router alert options +.\"O to this socket. +°ú¤­¿ô¤ÏÀ°¿ô (integer) ¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +Àµ¤ÎÀ°¿ô¤Ï˵¼õ¤ò¹Ô¤¦ router alert ¥ª¥×¥·¥ç¥óÃͤò¼¨¤¹¡£ +¥ª¥×¥·¥ç¥óÃͤ¬¤³¤ÎÀ°¿ô¤Ç¤¢¤ë router alert ¥ª¥×¥·¥ç¥ó¤ÎÉÕ¤¤¤¿¥Ñ¥±¥Ã¥È¤Ï +¥½¥±¥Ã¥È¤ËÇÛÁ÷¤µ¤ì¤ë¡£Éé¤ÎÀ°¿ô¤ò»ØÄꤹ¤ë¤È¡¢¤³¤Î¥½¥±¥Ã¥È¤Ø¤Î +router alert ¥ª¥×¥·¥ç¥ó¤ÎÉÕ¤¤¤¿¥Ñ¥±¥Ã¥È¤ÎÇÛÁ÷¤¬¹Ô¤ï¤ì¤Ê¤¤¡£ +.\" FLOWLABEL_MGR, FLOWINFO_SEND +.TP +.B IPV6_UNICAST_HOPS +.\"O Set the unicast hop limit for the socket. +.\"O Argument is a pointer to an integer. +.\"O \-1 in the value means use the route default, +.\"O otherwise it should be between 0 and 255. +¤½¤Î¥½¥±¥Ã¥È¤Ç¤Î unicast ¤Î hop ¿ô¤Î¾å¸ÂÃͤòÀßÄꤹ¤ë¡£ +°ú¤­¿ô¤ÏÀ°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +\-1 ¤ò»ØÄꤹ¤ë¤È·ÐÏ©¤Î¥Ç¥Õ¥©¥ë¥È¤òÍѤ¤¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤«¤é 255 ¤ÎÈϰϤò»ØÄꤹ¤ë¡£ +.TP +.\"O .BR IPV6_V6ONLY " (since Linux 2.4.21 and 2.6)" +.BR IPV6_V6ONLY " (Linux 2.4.21 °Ê¹ß¤ª¤è¤Ó 2.6 °Ê¹ß)" +.\" See RFC 3493 +.\"O If this flag is set to true (nonzero), then the socket is restricted +.\"O to sending and receiving IPv6 packets only. +.\"O In this case, an IPv4 and an IPv6 application can bind +.\"O to a single port at the same time. +¤³¤Î¥Õ¥é¥°¤ò¿¿ (0 °Ê³°) ¤ËÀßÄꤹ¤ë¤È¡¢¤½¤Î¥½¥±¥Ã¥È¤Ï IPv6 ¥Ñ¥±¥Ã¥È¤À¤±¤ò +Á÷¼õ¿®¤¹¤ë¤è¤¦¤ËÀ©¸Â¤µ¤ì¤ë¡£ +¤³¤Î¾ì¹ç¡¢IPv4 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È IPv6 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬Æ±»þ¤Ë +°ì¤Ä¤Î¥Ý¡¼¥È¤ò¥Ð¥¤¥ó¥É¤Ç¤­¤ë¡£ + +.\"O If this flag is set to false (zero), +.\"O then the socket can be used to send and receive packets +.\"O to and from an IPv6 address or an IPv4-mapped IPv6 address. +¤³¤Î¥Õ¥é¥°¤òµ¶ (0) ¤ËÀßÄꤹ¤ë¤È¡¢¤½¤Î¥½¥±¥Ã¥È¤Ï¥Ñ¥±¥Ã¥È¤ÎÁ÷¼õ¿®¤Ë +IPv6 ¥¢¥É¥ì¥¹¤È IPv4-mapped IPv6 ¥¢¥É¥ì¥¹¤ÎξÊý¤ò»ÈÍѤǤ­¤ë¡£ + +.\"O The argument is a pointer to a boolean value in an integer. +°ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤÎÆþ¤Ã¤¿À°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ + +.\"O The default value for this flag is defined by the contents of the file +.\"O .IR /proc/sys/net/ipv6/bindv6only . +.\"O The default value for that file is 0 (false). +¤³¤Î¥Õ¥é¥°¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤϥե¡¥¤¥ë +.I /proc/sys/net/ipv6/bindv6only +¤ÎÆâÍƤˤè¤êÄêµÁ¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 0 (µ¶) ¤Ç¤¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The older +.\"O .I libinet6 +.\"O libc5 based IPv6 API implementation for Linux is not described here +.\"O and may vary in details. +IPv6 API ¤ò libc5 ¥Ù¡¼¥¹¤Ç Linux ¸þ¤±¤Ë¼ÂÁõ¤·¤¿¡¢°ÊÁ°¤Î +.I libinet6 +¤Ë¤Ä¤¤¤Æ¤Ï¤³¤³¤Ç¤Ïµ­½Ò¤·¤Æ¤¤¤Ê¤¤¡£ +¤ª¤½¤é¤¯ºÙ¤«¤¤¤È¤³¤í¤Ë¤ÏÁê°ãÅÀ¤¬¤¢¤ë¤À¤í¤¦¡£ +.PP +.\"O Linux 2.4 will break binary compatibility for the +.\"O .I sockaddr_in6 +.\"O for 64-bit +.\"O hosts by changing the alignment of +.\"O .I in6_addr +.\"O and adding an additional +.\"O .I sin6_scope_id +.\"O field. +.\"O The kernel interfaces stay compatible, but a program including +.\"O .I sockaddr_in6 +.\"O or +.\"O .I in6_addr +.\"O into other structures may not be. +.\"O This is not +.\"O a problem for 32bit hosts like i386. +Linux 2.4 ¤Ç¤Ï 64 ¥Ó¥Ã¥È¤Î¥Û¥¹¥È¤ËÂФ·¤Æ +.I sockaddr_in6 +¤Î¥Ð¥¤¥Ê¥ê¸ß´¹À­¤¬Êݤ¿¤ì¤Æ¤¤¤Ê¤¤¡£ +.I in6_addr +¤Î¥¢¥é¥¤¥ó¥á¥ó¥È¤¬Êѹ¹¤µ¤ì¡¢¤Þ¤¿ +.I sin6_scope_id +¥Õ¥£¡¼¥ë¥É¤¬¿·¤¿¤ËÄɲ䵤줿¤«¤é¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¸ß´¹À­¤ÏÊݤ¿¤ì¤Æ¤¤¤ë¤¬¡¢ +.I sockaddr_in6 +¤ä +.I in6_addr +¤ò¾¤Î¹½Â¤ÂΤ˴ޤó¤Ç¤¤¤ë¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï +Êݤ¿¤ì¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤ì¤Ï i386 ¤Î¤è¤¦¤Ê 32 ¥Ó¥Ã¥È¤Î¥Û¥¹¥È¤Ç¤ÏÌäÂê¤Ë¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The +.\"O .I sin6_flowinfo +.\"O field is new in Linux 2.4. +.\"O It is transparently passed/read by the kernel +.\"O when the passed address length contains it. +.\"O Some programs that pass a longer address buffer and then +.\"O check the outgoing address length may break. +.I sin6_flowinfo +¥Õ¥£¡¼¥ë¥É¤Ï Linux 2.4 ¤ÇÅо줷¤¿¡£ +¤³¤ì¤¬ÅϤµ¤ì¤¿¥¢¥É¥ì¥¹Ä¹¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤È¡¢ +¥«¡¼¥Í¥ë¤ËÆ©²áŪ¤ËÅϤµ¤ì¡¢Æɤޤì¤ë¡£ +.\"nakano ¤³¤³¤ï¤«¤é¤Ê¤¤¤Ç¤¹... +¤è¤êŤ¤¥¢¥É¥ì¥¹¥Ð¥Ã¥Õ¥¡¤òÅϤ·¡¢ +¤½¤·¤ÆÁ÷¿®¥¢¥É¥ì¥¹¤ÎŤµ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ï +¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH "NOTES" +.SH Ãí°Õ +.\"O The +.\"O .I sockaddr_in6 +.\"O structure is bigger than the generic +.\"O .IR sockaddr . +.\"O Programs that assume that all address types can be stored safely in a +.\"O .I struct sockaddr +.\"O need to be changed to use +.\"O .I struct sockaddr_storage +.\"O for that instead. +.I sockaddr_in6 +¹½Â¤ÂΤϥ¸¥§¥Í¥ê¥Ã¥¯¤Ê +.I sockaddr +¤è¤ê¤âÂ礭¤¤¡£ +¤¹¤Ù¤Æ¤Î¥¢¥É¥ì¥¹¥¿¥¤¥×¤¬ +.I struct sockaddr +¤ÎÃæ¤Ë°ÂÁ´¤ËǼ¤á¤é¤ì¤ë¤È²¾Äꤷ¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤Ï¡¢Âå¤ï¤ê¤Ë +.I struct sockaddr_storage +¤òÍѤ¤¤ë¤è¤¦¤ËÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The IPv6 extended API as in RFC\ 2292 is currently only partly +.\"O implemented; +.\"O although the 2.2 kernel has near complete support for receiving options, +.\"O the macros for generating IPv6 options are missing in glibc 2.1. +IPv6 ³ÈÄ¥ API ¤Ï¡¢¸½ºß¤Þ¤À RFC\ 2292 ¤ò´°Á´¤Ë¤Ï¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¡£ +2.2 ¥«¡¼¥Í¥ë¤Ï¼õ¿®¥ª¥×¥·¥ç¥ó¤ò¤Û¤Ü´°Á´¤Ë¥µ¥Ý¡¼¥È¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤¬¡¢ +glibc2.1 ¤Ë¤Ï IPv6 ¥ª¥×¥·¥ç¥ó¤òÀ¸À®¤¹¤ë¥Þ¥¯¥í¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O IPSec support for EH and AH headers is missing. +EH ¤ª¤è¤Ó AH ¥Ø¥Ã¥À ¤Ç¤Î IPSec ¤Î¥µ¥Ý¡¼¥È¤Ï¸ºß¤·¤Ê¤¤¡£ +.PP +.\"O Flow label management is not complete and not documented here. +¥Õ¥í¡¼¥é¥Ù¥ë´ÉÍý¤Ï¤Þ¤À´°Á´¤Ç¤Ê¤¯¡¢¤³¤³¤Ë¤âµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O This man page is not complete. +¤³¤Î man ¥Ú¡¼¥¸¤Ï¤Þ¤À´°À®¤·¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR cmsg (3), +.BR ip (7) +.LP +RFC\ 2553: IPv6 BASIC API. +.\"O Linux tries to be compliant to this. +Linux ¤Ï¤³¤Î RFC ¤Ë½àµò¤¹¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤ë¡£ +.LP +RFC\ 2460: IPv6 specification. diff --git a/draft/man7/iso_8859-1.7 b/draft/man7/iso_8859-1.7 new file mode 100644 index 00000000..412ca7c9 --- /dev/null +++ b/draft/man7/iso_8859-1.7 @@ -0,0 +1,191 @@ +'\" t +.\" Copyright 1993-1995 Daniel Quinlan (quinlan@yggdrasil.com) +.\" +.\" 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. +.\" +.\" 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 +.\" +.TH ISO_8859-1 7 1999-05-31 "Linux" "Linux Programmer's Manual" +.nh +.SH ̾Á° +iso_8859-1 \- ISO 8859-1 ʸ»ú½¸¹ç¤Î 8¿Ê¿ô¡¢10¿Ê¿ô¡¢16¿Ê¿ô¤Ë¤è¤ëÉä¹æ²½ +.SH ÀâÌÀ +ISO 8859 µ¬³Ê¤Ï ASCII ʸ»ú½¸¹ç (ISO 6460IRV ¤È¤·¤Æ¤âÃΤé¤ì¤Æ¤¤¤ë) ¤Î +¤¤¤¯¤Ä¤«¤Î 8 ¥Ó¥Ã¥È³ÈÄ¥¤ò´Þ¤ó¤Ç¤¤¤ë¡£Æä˽ÅÍ×¤Ê¤Î¤Ï ISO 8859-1¡¢ +"¥é¥Æ¥ó¡¦¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È No. 1" ¤Ç¡¢¹­¤¯¼ÂÁõ¤µ¤ì¡¢´û¤Ë ASCII ¤ËÂå¤ï¤Ã¤Æ +»ö¼Â¾å¤Îɸ½à¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤è¤¦¤Ë¤ß¤¨¤ë¡£ +.P +ISO 8859-1 ¤Ï°Ê²¼¤Î¸À¸ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë: ¥¢¥Õ¥ê¥«¡¼¥ó¥¹¸ì¡¢¥Ð¥¹¥¯¸ì¡¢ +¥«¥¿¥í¥Ë¥¢¸ì¡¢¥Ç¥ó¥Þ¡¼¥¯¸ì¡¢¥ª¥é¥ó¥À¸ì¡¢±Ñ¸ì¡¢¥Õ¥§¥í¡¼¸ì¡¢¥Õ¥£¥ó¥é¥ó¥É¸ì¡¢ +¥Õ¥é¥ó¥¹¸ì¡¢¥¬¥ê¥·¥¢¸ì¡¢¥É¥¤¥Ä¸ì¡¢¥¢¥¤¥¹¥é¥ó¥É¸ì¡¢¥¢¥¤¥ë¥é¥ó¥É¸ì¡¢¥¤¥¿¥ê¥¢¸ì¡¢ +¥Î¥ë¥¦¥§¡¼¸ì¡¢¥Ý¥ë¥È¥¬¥ë¸ì¡¢¥¹¥³¥Ã¥È¥é¥ó¥É¸ì¡¢¥¹¥Ú¥¤¥ó¸ì¡¢¥¹¥¦¥§¡¼¥Ç¥ó¸ì +.P +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) +.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) ¤ò»²¾È¡£ ] +.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 +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 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 +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 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 +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 +.TE +.SH ´ØÏ¢¹àÌÜ +.BR ascii (7), +.BR iso_8859-15 (7) diff --git a/draft/man7/iso_8859-15.7 b/draft/man7/iso_8859-15.7 new file mode 100644 index 00000000..9d9a8d07 --- /dev/null +++ b/draft/man7/iso_8859-15.7 @@ -0,0 +1,227 @@ +'\" t +.\" Copyright 1993-1995 Daniel Quinlan (quinlan@yggdrasil.com) +.\" Copyright 1999 Dimitri Papadopoulos (dpo@club-internet.fr) +.\" +.\" 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) 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 +.\" +.TH ISO_8859-15 7 1999-05-31 "Linux" "Linux Programmer's Manual" +.nh +.\"O .SH NAME +.SH ̾Á° +.\"O iso_8859-15 \- the ISO 8859-15 character set encoded in octal, decimal, +.\"O and hexadecimal +iso_8859-15 \- ISO 8859-15 ʸ»ú½¸¹ç¤Î 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 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¡¢ +"¥é¥Æ¥ó¡¦¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È No. 1" ¤Ç¡¢¹­¤¯¼ÂÁõ¤µ¤ì¡¢´û¤Ë ASCII ¤ËÂå¤ï¤Ã¤Æ +»ö¼Â¾å¤Îɸ½à¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤è¤¦¤Ë¤ß¤¨¤ë¡£°ìÊý¤Ç¤½¤ì¤Ï¥æ¡¼¥í (EURO) µ­¹æ¤¬ +´Þ¤Þ¤ì¤Æ¤ª¤é¤º¡¢¥Õ¥£¥ó¥é¥ó¥É¸ì¤È¥Õ¥é¥ó¥¹¸ì¤ò´°Á´¤Ë¥µ¥Ý¡¼¥È¤Ç¤­¤Æ¤¤¤Ê¤¤¡£ +ISO 8859-15 ¤Ï¤³¤ì¤é¤ÎÍ×µá¤òËþ¤¿¤¹¤¿¤á¤Ë ISO 8859-1 ¤ò½¤Àµ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.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" +.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) +.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) ¤òŬÀڤʥե©¥ó¥È¤ò½àÈ÷¤·¤Æ»²¾È¡£ ] +.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 +243 163 A3 ¡ò POUND SIGN +244 164 A4 EURO SIGN +245 165 A5 ¡ï YEN SIGN +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 +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 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 +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 +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 +.TE +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ascii (7), +.BR iso_8859-1 (7) diff --git a/draft/man7/iso_8859-16.7 b/draft/man7/iso_8859-16.7 new file mode 100644 index 00000000..87245631 --- /dev/null +++ b/draft/man7/iso_8859-16.7 @@ -0,0 +1,221 @@ +'\" t +.\" Copyright 2002 Ionel Mugurel Ciobica (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 +.\" 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) 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" +.nh +.\"O .SH NAME +.SH ̾Á° +.\"O iso_8859-16 \- the ISO 8859-16 character set encoded in octal, decimal, +.\"O and hexadecimal +iso_8859-16 \- ISO 8859-16 ʸ»ú½¸¹ç¤Î 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-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¡×¤ÏÃæ±û¡¦Åì¥è¡¼¥í¥Ã¥Ñ¤Î¥é¥Æ¥óʸ»ú¤òÉä¹æ²½ +¤¹¤ë¤¿¤á¤Î¤â¤Î¤À¤¬¡¢¤Þ¤À¼ÂÁõ¤·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¡¦¥Ù¥ó¥À¤Ï¤Ê¤¤¡£ +.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 ¤Ï°Ê²¼¤Î¸À¸ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë: ¥¢¥ë¥Ð¥Ë¥¢¸ì¡¢¥Ü¥¹¥Ë¥¢¸ì¡¢ +¥¯¥í¥¢¥Á¥¢¸ì¡¢±Ñ¸ì¡¢¥Õ¥£¥ó¥é¥ó¥É¸ì¡¢¥É¥¤¥Ä¸ì¡¢¥Ï¥ó¥¬¥ê¡¼¸ì¡¢ +¥¢¥¤¥ë¥é¥ó¥É¸ì¡¢¥Ý¡¼¥é¥ó¥É¸ì¡¢¥ë¡¼¥Þ¥Ë¥¢¸ì¡¢¥¹¥í¥Ù¥Ë¥¢¸ì¡¢¥»¥ë¥Ó¥¢¸ì¡£ +.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" +.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) +.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 ÍѤËÀßÄꤵ¤ì¤¿´Ä¶­¤Ç¤Î¤ßÀµ¤·¤¯É½¼¨¤Ç¤­¤ë¤À¤í¤¦¡£ +.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 +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 +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 +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 +.TE +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ascii (7), +.BR iso_8859-1 (7), +.BR iso_8859-15 (7), +.BR iso_8859-2 (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) diff --git a/draft/man7/iso_8859-2.7 b/draft/man7/iso_8859-2.7 new file mode 100644 index 00000000..03adadf3 --- /dev/null +++ b/draft/man7/iso_8859-2.7 @@ -0,0 +1,230 @@ +'\" t +.\" Copyright 1999 Roman Maurer (roman.maurer@hermes.si) +.\" Copyright 1993-1995 Daniel Quinlan (quinlan@yggdrasil.com) +.\" +.\" 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. +.\" +.\" 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 +.\" +.TH ISO_8859-2 7 2007-11-25 "Linux" "Linux Programmer's Manual" +.nh +.\"O .SH NAME +.SH ̾Á° +.\"O iso_8859-2 \- the 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¡¢ + "¥é¥Æ¥ó¡¦¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È 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 ¤Ï°Ê²¼¤Î¸À¸ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë: ¥¢¥ë¥Ð¥Ë¥¢¸ì¡¢¥Ü¥¹¥Ë¥¢¸ì¡¢ +¥¯¥í¥¢¥Á¥¢¸ì¡¢¥Á¥§¥³¸ì¡¢±Ñ¸ì¡¢¥Õ¥£¥ó¥é¥ó¥É¸ì¡¢¥É¥¤¥Ä¸ì¡¢¥Ï¥ó¥¬¥ê¡¼¸ì¡¢ +¥¢¥¤¥ë¥é¥ó¥É¸ì¡¢¥Ý¡¼¥é¥ó¥É¸ì¡¢¥¹¥í¥ô¥¡¥­¥¢¸ì¡¢¥¹¥í¥ô¥§¥Ë¥¢¸ì¡¢¥½¥ë¥Ó¥¢¸ì¡£ +.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" +.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) +.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) ¤ò +ŬÀڤʥե©¥ó¥È¤ò½àÈ÷¤·¤Æ»²¾È¡£ ] +.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 +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 +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 +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 +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 +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 +.TE +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR ascii (7), +.BR iso_8859-1 (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). diff --git a/draft/man7/iso_8859-7.7 b/draft/man7/iso_8859-7.7 new file mode 100644 index 00000000..68950233 --- /dev/null +++ b/draft/man7/iso_8859-7.7 @@ -0,0 +1,204 @@ +'\" t +.\" Copyright 1999 Dimitri Papadopoulos (dpo@club-internet.fr) +.\" +.\" 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) 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 +.\" +.TH ISO_8859-7 7 2008-10-30 "Linux" "Linux Programmer's Manual" +.nh +.\"O .SH NAME +.SH ̾Á° +.\"O iso_8859-7 \- the ISO 8859-7 character set encoded in octal, decimal, +.\"O and hexadecimal +iso_8859-7 \- ISO 8859-7 ʸ»ú½¸¹ç¤Î 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-7 encodes the +.\"O characters used in modern monotonic Greek. +ISO 8859 µ¬³Ê¤Ï ASCII ʸ»ú½¸¹ç (ISO 646-IRV ¤È¤â¸Æ¤Ð¤ì¤ë) ¤Î +¤¤¤¯¤Ä¤«¤Î 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) +.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) ¤òŬÀڤʥե©¥ó¥È¤ò½àÈ÷¤·¤Æ»²¾È¤·¤Æ¤Û¤·¤¤¡£ ] +.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 +243 163 A3 ¡ò POUND SIGN +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 +254 172 AC ¢Ì NOT SIGN +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 +301 193 C1 ¦¡ GREEK CAPITAL LETTER ALPHA +302 194 C2 ¦¢ GREEK CAPITAL LETTER BETA +303 195 C3 ¦£ GREEK CAPITAL LETTER GAMMA +304 196 C4 ¦¤ GREEK CAPITAL LETTER DELTA +305 197 C5 ¦¥ GREEK CAPITAL LETTER EPSILON +306 198 C6 ¦¦ GREEK CAPITAL LETTER ZETA +307 199 C7 ¦§ GREEK CAPITAL LETTER ETA +310 200 C8 ¦¨ GREEK CAPITAL LETTER THETA +311 201 C9 ¦© GREEK CAPITAL LETTER IOTA +312 202 CA ¦ª GREEK CAPITAL LETTER KAPPA +313 203 CB ¦« GREEK CAPITAL LETTER LAMBDA +314 204 CC ¦¬ GREEK CAPITAL LETTER MU +315 205 CD ¦­ GREEK CAPITAL LETTER NU +316 206 CE ¦® GREEK CAPITAL LETTER XI +317 207 CF ¦¯ GREEK CAPITAL LETTER OMICRON +320 208 D0 ¦° GREEK CAPITAL LETTER PI +321 209 D1 ¦± GREEK CAPITAL LETTER RHO +323 211 D3 ¦² GREEK CAPITAL LETTER SIGMA +324 212 D4 ¦³ GREEK CAPITAL LETTER TAU +325 213 D5 ¦´ GREEK CAPITAL LETTER UPSILON +326 214 D6 ¦µ GREEK CAPITAL LETTER PHI +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 +341 225 E1 ¦Á GREEK SMALL LETTER ALPHA +342 226 E2 ¦Â GREEK SMALL LETTER BETA +343 227 E3 ¦Ã GREEK SMALL LETTER GAMMA +344 228 E4 ¦Ä GREEK SMALL LETTER DELTA +345 229 E5 ¦Å GREEK SMALL LETTER EPSILON +346 230 E6 ¦Æ GREEK SMALL LETTER ZETA +347 231 E7 ¦Ç GREEK SMALL LETTER ETA +350 232 E8 ¦È GREEK SMALL LETTER THETA +351 233 E9 ¦É GREEK SMALL LETTER IOTA +352 234 EA ¦Ê GREEK SMALL LETTER KAPPA +353 235 EB ¦Ë GREEK SMALL LETTER LAMBDA +354 236 EC ¦Ì GREEK SMALL LETTER MU +355 237 ED ¦Í GREEK SMALL LETTER NU +356 238 EE ¦Î GREEK SMALL LETTER XI +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 +363 243 F3 ¦Ò GREEK SMALL LETTER SIGMA +364 244 F4 ¦Ó GREEK SMALL LETTER TAU +365 245 F5 ¦Ô GREEK SMALL LETTER UPSILON +366 246 F6 ¦Õ GREEK SMALL LETTER PHI +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 +.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" +.SH ´ØÏ¢¹àÌÜ +.BR ascii (7) diff --git a/draft/man7/iso_8859-9.7 b/draft/man7/iso_8859-9.7 new file mode 100644 index 00000000..09b94a32 --- /dev/null +++ b/draft/man7/iso_8859-9.7 @@ -0,0 +1,202 @@ +'\" t +.\" Copyright 2002 Dimitri Papadopoulos (dpo@club-internet.fr) +.\" +.\" 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) 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 +.\" +.TH ISO_8859-9 7 2002-09-24 "Linux" "Linux Programmer's Manual" +.nh +.\"O .SH NAME +.\"O iso_8859-9 \- the 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 +.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" +.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) +.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) ¤òŬÀڤʥե©¥ó¥È¤ò½àÈ÷¤·¤Æ»²¾È¡£ ] +.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 +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 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 +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 +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 +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 +.TE +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ascii (7) diff --git a/draft/man7/koi8-r.7 b/draft/man7/koi8-r.7 new file mode 100644 index 00000000..b7a131d7 --- /dev/null +++ b/draft/man7/koi8-r.7 @@ -0,0 +1,232 @@ +'\" 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 2009-02-04 "Linux" "Linux Programmer's Manual" +.nh +.\"O .SH NAME +.SH ̾Á° +.\"O koi8-r \- Russian Net 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 ¨¡ FORMS LIGHT HORIZONTAL +201 129 81 ¨¢ FORMS LIGHT VERTICAL +202 130 82 ¨£ FORMS LIGHT DOWN AND RIGHT +203 131 83 ¨¤ FORMS LIGHT DOWN AND LEFT +204 132 84 ¨¦ FORMS LIGHT UP AND RIGHT +205 133 85 ¨¥ FORMS LIGHT UP AND LEFT +206 134 86 ¨§ FORMS LIGHT VERTICAL AND RIGHT +207 135 87 ¨© FORMS LIGHT VERTICAL AND LEFT +210 136 88 ¨¨ FORMS LIGHT DOWN AND HORIZONTAL +211 137 89 ¨ª FORMS LIGHT UP AND HORIZONTAL +212 138 8A ¨« FORMS 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 SMALL 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 NON-BREAKING SPACE +233 155 9B BOTTOM HALF INTEGRAL +234 156 9C ¡¬ DEGREE SIGN +235 157 9D SUPERSCRIPT DIGIT TWO +236 158 9E ¡¦ MIDDLE DOT +237 159 9F ¡à DIVISION SIGN +240 160 A0 ¨¬ FORMS DOUBLE HORIZONTAL +241 161 A1 ¨­ FORMS DOUBLE VERTICAL +242 162 A2 FORMS DOWN SINGLE AND RIGHT DOUBLE +243 163 A3 §× CYRILLIC SMALL LETTER IO +244 164 A4 FORMS DOWN DOUBLE AND RIGHT SINGLE +245 165 A5 ¨® FORMS DOUBLE DOWN AND RIGHT +246 166 A6 FORMS DOWN SINGLE AND LEFT DOUBLE +247 167 A7 FORMS DOWN DOUBLE AND LEFT SINGLE +250 168 A8 ¨¯ FORMS DOUBLE DOWN AND LEFT +251 169 A9 FORMS UP SINGLE AND RIGHT DOUBLE +252 170 AA FORMS UP DOUBLE AND RIGHT SINGLE +253 171 AB ¨± FORMS DOUBLE UP AND RIGHT +254 172 AC FORMS UP SINGLE AND LEFT DOUBLE +255 173 AD FORMS UP DOUBLE AND LEFT SINGLE +256 174 AE ¨° FORMS DOUBLE UP AND LEFT +257 175 AF ¨¼ FORMS VERTICAL SINGLE AND RIGHT DOUBLE +260 176 B0 ¨· FORMS VERTICAL DOUBLE AND RIGHT SINGLE +261 177 B1 ¨² FORMS DOUBLE VERTICAL AND RIGHT +262 178 B2 ¨¾ FORMS VERTICAL SINGLE AND LEFT DOUBLE +263 179 B3 §§ CYRILLIC CAPITAL LETTER IO +264 180 B4 ¨¹ FORMS VERTICAL DOUBLE AND LEFT SINGLE +265 181 B5 ¨´ FORMS DOUBLE VERTICAL AND LEFT +266 182 B6 ¨¸ FORMS DOWN SINGLE AND HORIZONTAL DOUBLE +267 183 B7 ¨½ FORMS DOWN DOUBLE AND HORIZONTAL SINGLE +270 184 B8 ¨³ FORMS DOUBLE DOWN AND HORIZONTAL +271 185 B9 ¨º FORMS UP SINGLE AND HORIZONTAL DOUBLE +272 186 BA ¨¿ FORMS UP DOUBLE AND HORIZONTAL SINGLE +273 187 BB ¨µ FORMS DOUBLE UP AND HORIZONTAL +274 188 BC ¨» FORMS VERTICAL SINGLE AND HORIZONTAL DOUBLE +275 189 BD ¨À FORMS VERTICAL DOUBLE AND HORIZONTAL SINGLE +276 190 BE ¨¶ FORMS DOUBLE VERTICAL AND HORIZONTAL +277 191 BF COPYRIGHT SIGN +300 192 C0 §ð CYRILLIC SMALL LETTER IU +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 GE +310 200 C8 §ç CYRILLIC SMALL LETTER KHA +311 201 C9 §Ú CYRILLIC SMALL LETTER II +312 202 CA §Û CYRILLIC SMALL LETTER SHORT II +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 IA +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 YERI +332 218 DA §Ù CYRILLIC SMALL LETTER ZE +333 219 DB §ê CYRILLIC SMALL LETTER SHA +334 220 DC §ï CYRILLIC SMALL LETTER REVERSED 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 IU +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 GE +350 232 E8 §· CYRILLIC CAPITAL LETTER KHA +351 233 E9 §ª CYRILLIC CAPITAL LETTER II +352 234 EA §« CYRILLIC CAPITAL LETTER SHORT II +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 IA +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 YERI +372 250 FA §© CYRILLIC CAPITAL LETTER ZE +373 251 FB §º CYRILLIC CAPITAL LETTER SHA +374 252 FC §¿ CYRILLIC CAPITAL LETTER REVERSED 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-7 (7), +.BR koi8-u (7), +RFC\ 1489, +http://koi8.pp.ru/ diff --git a/draft/man7/locale.7 b/draft/man7/locale.7 new file mode 100644 index 00000000..c8934143 --- /dev/null +++ b/draft/man7/locale.7 @@ -0,0 +1,361 @@ +.\" 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. +.\" +.\" Modified Sat Jul 24 17:28:34 1993 by Rik Faith +.\" Modified Sun Jun 01 17:16:34 1997 by Jochen Hein +.\" +.\" Modified Thu Apr 25 00:43:19 2002 by Bruno Haible +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Wed Dec 24 21:08:08 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Thu 14 Nov 2002 by NAKANO Takeo +.\" +.\"WORD: locale ¥í¥±¡¼¥ë +.\" +.TH LOCALE 7 2008-12-05 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O locale \- Description of multilanguage support +.SH ̾Á° +locale \- ¿¸À¸ì¥µ¥Ý¡¼¥È¤Î²òÀâ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O A locale is a set of language and cultural rules. +.\"O These cover aspects +.\"O such as language for messages, different character sets, lexicographic +.\"O conventions, etc. +.\"O A program needs to be able to determine its locale +.\"O and act accordingly to be portable to different cultures. +¥í¥±¡¼¥ë (locale) ¤Ï¸À¸ì¤äʸ²½¥ë¡¼¥ë¤Î½¸¹ç¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Ï¡¢¥á¥Ã¥»¡¼¥¸½ÐÎϤ˻ÈÍѤ¹¤ë¸À¸ì¡¦¤¤¤í¤¤¤í¤Êʸ»ú½¸¹ç¡¦ +ɽµ­¤Ë´Ø¤¹¤ë´·½¬¤È¤¤¤Ã¤¿¤è¤¦¤ÊÌ̤ò¥«¥Ð¡¼¤·¤Æ¤¤¤ë¡£ +¥×¥í¥°¥é¥à¤ò¤¤¤í¤¤¤í¤Êʸ²½¤Ë°Ü¿¢²Äǽ¤È¤¹¤ë¤Ë¤Ï¡¢ +¤½¤Î¥×¥í¥°¥é¥à¤Ï¼«Ê¬¤Î¥í¥±¡¼¥ë¤ò·è¤á¤Æ¡¢ +¤½¤ì¤Ë±þ¤¸¤¿Å¬ÀÚ¤ÊÆ°ºî¤¬¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O The header +.\"O .I +.\"O declares data types, functions and macros which are useful in this +.\"O task. +¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë +.I +¤Ë¤Ï¡¢¤³¤ÎÌÜŪ¤ËÊØÍø¤Ê¥Ç¡¼¥¿·¿¡¦´Ø¿ô¡¦¥Þ¥¯¥í¤Ê¤É¤ÎÀë¸À¤¬¤¢¤ë¡£ +.PP +.\"O The functions it declares are +.\"O .BR setlocale (3) +.\"O to set the current locale, and +.\"O .BR localeconv (3) +.\"O to get information about number formatting. +¤³¤Î¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤Ë¤Ï¡¢ +¸½ºß¤Î¥í¥±¡¼¥ë¤òÀßÄꤹ¤ë +.BR setlocale (3) +¤È¡¢¿ôÃͤΥե©¡¼¥Þ¥Ã¥ÈÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ë +.BR localeconv (3) +¤¬¤¢¤ë¡£ +.PP +.\"O There are different categories for local information a program might +.\"O need; they are declared as macros. +.\"O Using them as the first argument +.\"O to the +.\"O .BR setlocale (3) +.\"O function, it is possible to set one of these to the desired locale: +¥×¥í¥°¥é¥à¤ÎɬÍפ˱þ¤¸¤Æ¡¢¥í¡¼¥«¥ë¾ðÊó¤Ï¤¤¤í¤¤¤í¤Ê¥«¥Æ¥´¥ê¤Ëʬ¤«¤ì¤Æ¤ª¤ê¡¢ +¤½¤ì¤é¤Ï¥Þ¥¯¥í¤È¤·¤ÆÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤ò +.BR setlocale (3) +´Ø¿ô¤ÎºÇ½é¤Î°ú¤­¿ô¤ËÍѤ¤¤ë¤È¡¢ +¤³¤ì¤é¤Î¤É¤ì¤«¤ò˾¤à¥í¥±¡¼¥ë¤ËÀßÄê¤Ç¤­¤ë¡£ +.TP +.B LC_COLLATE +.\"O This is used to change the behavior of the functions +.\"O .BR strcoll (3) +.\"O and +.\"O .BR strxfrm (3), +.\"O which are used to compare strings in the local alphabet. +.\"O For example, +.\"O the German sharp s is sorted as "ss". +¤³¤ì¤ÏÃÏ°èŪ¤Ê¥¢¥ë¥Õ¥¡¥Ù¥Ã¥Èʸ»úÎó¤ÎÈæ³Ó¤Ë»ÈÍѤ¹¤ë +.BR strcoll (3) +´Ø¿ô¤È +.BR strxfrm (3) +´Ø¿ô¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¡£Î㤨¤Ð¥É¥¤¥Ä¸ì¤Î¥¨¥¹¥Ä¥§¥Ã¥È (±Ô¤¤ s) +¤Ï¡¢¥½¡¼¥È¤ÎºÝ "ss" ¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +.TP +.B LC_CTYPE +.\"O This changes the behavior of the character handling and +.\"O classification functions, such as +.\"O .BR isupper (3) +.\"O and +.\"O .BR toupper (3), +.\"O and the multibyte character functions such as +.\"O .BR mblen (3) +.\"O or +.\"O .BR wctomb (3). +¤³¤ì¤Ï +.BR isupper (3) +¤ä +.BR toupper (3) +¤Î¤è¤¦¤Êʸ»ú¤ÎȽÄꡦÁàºî¤ò¤¹¤ë´Ø¿ô¤ä¡¢Â¿¥Ð¥¤¥Èʸ»ú¤ò°·¤¦ +.BR mblen (3) +¤ä +.BR wctomb (3) +¤Î¤è¤¦¤Ê´Ø¿ô¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¡£ +.TP +.B LC_MONETARY +.\"O changes the information returned by +.\"O .BR localeconv (3) +.\"O which describes the way numbers are usually printed, with details such +.\"O as decimal point versus decimal comma. +.\"O This information is internally +.\"O used by the function +.\"O .BR strfmon (3). +.BR localeconv (3) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë¾ðÊó¤òÊѹ¹¤¹¤ë¡£ +¤³¤ì¤Ë¤Ï¾®¿ôÅÀ¤ä¶èÀڤꥳ¥ó¥Þ¤Î°ÌÃ֤ʤɡ¢ +¿ô»ú¤Îɽ¼¨ÊýË¡¤Ë´Ø¤¹¤ë¾ÜºÙ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£¤³¤Î¾ðÊó¤Ï +.BR strfmon (3) +´Ø¿ô¤¬ÆâÉô¤Ç»ÈÍѤ¹¤ë¡£ +.TP +.B LC_MESSAGES +.\"O changes the language messages are displayed in and what an affirmative or +.\"O negative answer looks like. +.\"O The GNU C-library contains the +.\"O .BR gettext (3), +.\"O .BR ngettext (3), +.\"O and +.\"O .BR rpmatch (3) +.\"O functions to ease the use of these information. +.\"O The GNU gettext family of +.\"O functions also obey the environment variable +.\"O .BR LANGUAGE +.\"O (containing a colon-separated list of locales) +.\"O if the category is set to a valid locale other than +.\"O .BR """C""" . +¥á¥Ã¥»¡¼¥¸É½¼¨¤Ë»ÈÍѤ¹¤ë¸À¸ì¤òÊѹ¹¤¹¤ë¡£ +¤Þ¤¿¹ÎÄêŪ¡¦ÈÝÄêŪ¤Ê²óÅú¤ò¤É¤Î¤è¤¦¤Ëɽ¼¨¤¹¤ë¤«¤òÊѹ¹¤¹¤ë¡£ +¤³¤ì¤é¤Î¾ðÊó¤ò´Êñ¤Ë»ÈÍѤ¹¤ë¤¿¤á¤Ë¡¢ GNU C ¥é¥¤¥Ö¥é¥ê¤Ë¤Ï +.BR gettext (3), +.BR ngettext (3), +.BR rpmatch (3) +´Ø¿ô¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +GNU gettext ¥Õ¥¡¥ß¥ê¡¼¤Ë°¤¹¤ë´Ø¿ô¤Ï¡¢¥«¥Æ¥´¥ê¤¬ +.B """C""" +°Ê³°¤ÎÍ­¸ú¤Ê¥í¥±¡¼¥ë¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢´Ä¶­ÊÑ¿ô +.B LANGUAGE +¤Ë¤â½¾¤¦ +.RB ( LANGUAGE +¤Ï¥³¥í¥ó¶èÀÚ¤ê¤Î¥í¥±¡¼¥ë¤Î¥ê¥¹¥È¤Ç¤¢¤ë)¡£ +.TP +.B LC_NUMERIC +.\"O changes the information used by the +.\"O .BR printf (3) +.\"O and +.\"O .BR scanf (3) +.\"O family of functions, when they are advised to use the +.\"O locale-settings. +.\"O This information can also be read with the +.\"O .BR localeconv (3) +.\"O function. +.BR printf (3) +´Ø¿ô¤ª¤è¤Ó +.BR scanf (3) +´Ø¿ô¤Î¥Õ¥¡¥ß¥ê¡¼¤Ç¥í¥±¡¼¥ëÀßÄê¤ò»È¤¦¤è¤¦»Ø¼¨¤µ¤ì¤¿¾ì¹ç¤Ë +ÍѤ¤¤ë¾ðÊó¤òÊѹ¹¤¹¤ë¡£¤³¤Î¾ðÊó¤Ï +.BR localeconv (3) +´Ø¿ô¤Ç¼èÆÀ¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.TP +.B LC_TIME +.\"O changes the behavior of the +.\"O .BR strftime (3) +.\"O function to display the current time in a locally acceptable form; for +.\"O example, most of Europe uses a 24-hour clock versus the +.\"O 12-hour clock used in the United States. +.BR strftime (3) +´Ø¿ô¤ÎÆ°ºî¤òÊѹ¹¤·¡¢ +ÃÏ°è¤ÇÍøÍѤµ¤ì¤Æ¤¤¤ëÊýË¡¤Ç¸½ºß»þ¹ï¤òɽ¼¨¤¹¤ë¡£ +Î㤨¤Ð¡¢¥è¡¼¥í¥Ã¥Ñ¤Î¿¤¯¤Ç¤Ï 24»þ´Ö¼°¤Î»þ·×¤ò»È¤¦¤¬¡¢ +¥¢¥á¥ê¥«¤Ç¤Ï 12»þ´Ö¼°¤Î»þ·×¤ò»È¤¦¡£ +.TP +.B LC_ALL +.\"O All of the above. +¾åµ­¤ÎÁ´¤Æ¡£ +.\" FIXME glibc 2.2.2 added new nonstandard locale categories: +.\" LC_ADDRESS, LC_IDENTIFICATION, LC_MEASUREMENT, LC_NAME, +.\" LC_PAPER, LC_TELEPHONE. These need to be documented. +.PP +.\"O If the second argument to +.\"O .BR setlocale (3) +.\"O is empty string, +.\"O .BR """""" , +.\"O for the default locale, it is determined using the following steps: +.BR setlocale (3) +¤ÎÆóÈÖÌܤΰú¤­¿ô¤¬¶õʸ»úÎó \fB""\fP ¤Î¾ì¹ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤Î¥í¥±¡¼¥ë¤Ï°Ê²¼¤Î¼ê½ç¤Ç·èÄꤹ¤ë: +.IP 1. +.\"O If there is a non-null environment variable +.\"O .BR LC_ALL , +.\"O the value of +.\"O .B LC_ALL +.\"O is used. +´Ä¶­ÊÑ¿ô +.B LC_ALL +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï +.B LC_ALL +¤ÎÃͤ¬»ÈÍѤµ¤ì¤ë¡£ +.IP 2. +.\"O If an environment variable with the same name as one of the categories +.\"O above exists and is non-null, its value is used for that category. +¾åµ­¤Î¥«¥Æ¥´¥ê¤Î¤É¤ì¤«¤ÈƱ¤¸Ì¾Á°¤Î´Ä¶­ÊÑ¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤½¤Î¥«¥Æ¥´¥ê¤Ë¤Ï¤½¤ÎÃͤ¬»ÈÍѤµ¤ì¤ë¡£ +.IP 3. +.\"O If there is a non-null environment variable +.\"O .BR LANG , +.\"O the value of +.\"O .B LANG +.\"O is used. +´Ä¶­ÊÑ¿ô +.B LANG +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï +.B LANG +¤ÎÃͤ¬»ÈÍѤµ¤ì¤ë¡£ +.PP +.\"O Values about local numeric formatting is made available in a +.\"O .I struct lconv +.\"O returned by the +.\"O .BR localeconv (3) +.\"O function, which has the following declaration: +ÃÏ°èŪ¤Ê¿ôÃÍ¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¾ðÊó¤Ï +.BR localeconv (3) +´Ø¿ô¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë +.I struct lconv +¤ÇÆÀ¤ë¤³¤È¤¬¤Ç¤­¡¢¤³¤ì¤Ï°Ê²¼¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +struct lconv { + +.\"O /* Numeric (nonmonetary) information */ + /* (Ä̲߰ʳ°¤Î) ¿ôÃ;ðÊó */ + +.\"O char *decimal_point; /* Radix character */ +.\"O char *thousands_sep; /* Separator for digit groups to left +.\"O of radix character */ +.\"O char *grouping; /* Each element is the number of digits in a +.\"O group; elements with higher indices are +.\"O further left. An element with value CHAR_MAX +.\"O means that no further grouping is done. An +.\"O element with value 0 means that the previous +.\"O element is used for all groups further left. */ + char *decimal_point; /* ¾®¿ôÅÀ¤Îʸ»ú */ + char *thousands_sep; /* ¾®¿ôÅÀ¤Îº¸Â¦¤Î¿ô»ú¤Î¥°¥ë¡¼¥×¤Î + ¶èÀÚ¤êʸ»ú */ + char *grouping; /* ¤½¤ì¤¾¤ì¤ÎÍ×ÁǤϳƥ°¥ë¡¼¥×¤Î¿ô»ú¤Î¸Ä¿ô¤Ç¤¢¤ë¡£ + ¥¤¥ó¥Ç¥Ã¥¯¥¹Ãͤ¬Â礭¤¤¤Û¤É¡¢º¸Â¦¤Î¥°¥ë¡¼¥×¤òɽ¤¹¡£ + Í×ÁǤÎÃͤ¬ CHAR_MAX ¤Î¾ì¹ç¤Ï¡¢ºÇ¸å¤Î¥°¥ë¡¼¥×¤Ç + ¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£Í×ÁǤÎÃͤ¬ 0 ¤Î¾ì¹ç¤Ï¡¢ + ¤½¤ÎÍ×ÁǤè¤êº¸Â¦¤ÎÁ´¤Æ¤ÎÍ×ÁǤËÁ°¤ÎÍ×ÁǤÈƱ¤¸Ãͤò + »ÈÍѤ¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ */ + +.\"O /* Remaining fields are for monetary information */ + /* »Ä¤ê¤Î¥Õ¥£¡¼¥ë¥É¤ÏÄ̲߾ðÊóÍѤǤ¢¤ë */ + +.\"O char *int_curr_symbol; /* First three chars are a currency symbol +.\"O from ISO 4217. Fourth char is the +.\"O separator. Fifth char is \(aq\0\(aq. */ +.\"O char *currency_symbol; /* Local currency symbol */ +.\"O char *mon_decimal_point; /* Radix character */ +.\"O char *mon_thousands_sep; /* Like `thousands_sep' above */ +.\"O char *mon_grouping; /* Like `grouping' above */ +.\"O char *positive_sign; /* Sign for positive values */ +.\"O char *negative_sign; /* Sign for negative values */ +.\"O char int_frac_digits; /* International fractional digits */ +.\"O char frac_digits; /* Local fractional digits */ + char *int_curr_symbol; /* ºÇ½é¤Î»°¤Ä¤Îʸ»ú¤Ï ISO 4217 ¤ÎÄ̲ߵ­¹æ¡£ + »ÍÈÖÌܤÎʸ»ú¤Ï¶èÀÚ¤êʸ»ú¡£ + ¸ÞÈÖÌÜ¤Ï \(aq\0\(aq¡£ */ + char *currency_symbol; /* ÃÏ°è¤ÎÄ̲ߵ­¹æ */ + char *mon_decimal_point; /* ¾®¿ôÅÀ¤Îʸ»ú */ + char *mon_thousands_sep; /* ¾åµ­¤Î `thousands_sep' ¤ÈƱÍÍ */ + char *mon_grouping; /* ¾åµ­¤Î `grouping' ¤ÈƱÍÍ */ + char *positive_sign; /* Àµ¤ÎÃͤÎÉä¹æ */ + char *negative_sign; /* Éé¤ÎÃͤÎÉä¹æ */ + char int_frac_digits; /* ¹ñºÝŪ¤Ê¾®¿ôÉô¤Î¿ô»ú */ + char frac_digits; /* ÃÏ°è¤Î¾®¿ôÉô¤Î¿ô»ú */ +.\"O char p_cs_precedes; /* 1 if currency_symbol precedes a +.\"O positive value, 0 if succeeds */ +.\"O char p_sep_by_space; /* 1 if a space separates currency_symbol +.\"O from a positive value */ +.\"O char n_cs_precedes; /* 1 if currency_symbol precedes a +.\"O negative value, 0 if succeeds */ +.\"O char n_sep_by_space; /* 1 if a space separates currency_symbol +.\"O from a negative value */ + char p_cs_precedes; /* Àµ¤ÎÃͤÎÁ°¤ËÄ̲ߵ­¹æ¤òÃÖ¤¯¾ì¹ç¤Ï 1, + ¸å¤í¤ËÃÖ¤¯¾ì¹ç¤Ï 0 */ + char p_sep_by_space; /* Àµ¤ÎÃͤÈÄ̲ߵ­¹æ¤Î´Ö¤Ë¥¹¥Ú¡¼¥¹¤ò + Æþ¤ì¤ë¾ì¹ç¤Ï 1 */ + char n_cs_precedes; /* Éé¤ÎÃͤÎÁ°¤ËÄ̲ߵ­¹æ¤òÃÖ¤¯¾ì¹ç¤Ï 1, + ¸å¤í¤ËÃÖ¤¯¾ì¹ç¤Ï 0 */ + char n_sep_by_space; /* Éé¤ÎÃͤÈÄ̲ߵ­¹æ¤Î´Ö¤Ë¥¹¥Ú¡¼¥¹¤ò + Æþ¤ì¤ë¾ì¹ç¤Ï 1 */ +.\"O /* Positive and negative sign positions: +.\"O 0 Parentheses surround the quantity and currency_symbol. +.\"O 1 The sign string precedes the quantity and currency_symbol. +.\"O 2 The sign string succeeds the quantity and currency_symbol. +.\"O 3 The sign string immediately precedes the currency_symbol. +.\"O 4 The sign string immediately succeeds the currency_symbol. */ + /* Àµ¤ÈÉé¤ÎÉä¹æ¤Î°ÌÃÖ: + 0 ÃͤÈÄ̲ߵ­¹æ¤ò³ç¸Ì¤Ç°Ï¤à + 1 Éä¹æ¤ÏÃͤÈÄ̲ߵ­¹æ¤ÎÁ°¤ËÃÖ¤¯ + 2 Éä¹æ¤ÏÃͤÈÄ̲ߵ­¹æ¤Î¸å¤ËÃÖ¤¯ + 3 Éä¹æ¤ÏÄ̲ߵ­¹æ¤Îľ¸å¤ËÃÖ¤¯ + 4 Éä¹æ¤ÏÄ̲ߵ­¹æ¤ÎľÁ°¤ËÃÖ¤¯ */ + char p_sign_posn; + char n_sign_posn; +}; +.fi +.in +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001 + +.\"O The GNU gettext functions are specified in LI18NUX2000. +GNU gettext ´Ø¿ô¥Õ¥¡¥ß¥ê¡¼¤Ï LI18NUX2000 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR locale (1), +.BR localedef (1), +.BR gettext (3), +.BR localeconv (3), +.BR ngettext (3), +.BR nl_langinfo (3), +.BR rpmatch (3), +.BR setlocale (3), +.BR strcoll (3), +.BR strfmon (3), +.BR strftime (3), +.BR strxfrm (3) diff --git a/draft/man7/mailaddr.7 b/draft/man7/mailaddr.7 new file mode 100644 index 00000000..2746fc89 --- /dev/null +++ b/draft/man7/mailaddr.7 @@ -0,0 +1,183 @@ +.\" +.\" Copyright (c) 1983, 1987 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms are permitted +.\" provided that the above copyright notice and this paragraph are +.\" duplicated in all such forms and that any documentation, +.\" advertising materials, and other materials related to such +.\" distribution and use acknowledge that the software was developed +.\" by the University of California, Berkeley. The name of the +.\" University may not be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" @(#)mailaddr.7 6.5 (Berkeley) 2/14/89 +.\" +.\" Extensively rewritten by Arnt Gulbrandsen . My +.\" changes are placed under the same copyright as the original BSD page. +.\" +.\" Adjusted by Arnt Gulbrandsen in 2004 to +.\" 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" +.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 ¥á¡¼¥ë¡¦ +¥¢¥É¥ì¥¹¤Î´Êñ¤Ê¾Ò²ð¤ò¹Ô¤¦¡£¥á¡¼¥ë¡¦¥¢¥É¥ì¥¹¤Ï°ìÈÌŪ¤Ë¤Ï +.PP + user@domain +.PP +¤Î·Á¤Ç¤¢¤ë¡£ +domain ¤Ï¥µ¥Ö¡¦¥É¥á¥¤¥ó¤Î³¬Áؤò ¥É¥Ã¥È (.) ¤Ç +¶èÀڤäƤĤʤ¤¤À¤â¤Î¤Ç¤¢¤ë¡£ +°Ê²¼¤ÎÎã¤ÏÁ´¤ÆƱ¤¸¥¢¥É¥ì¥¹¤ÎÀµ¤·¤¤É½µ­Ë¡¤Ç¤¢¤ë: +.PP + eric@monet.berkeley.edu +.br + Eric Allman +.br + 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") ¤ÏÉáÄ̤ϥ桼¥¶¡¼¤Î̾Á°¤Ç¤¢¤ë¤¬¡¢ +¤½¤Î°ÕÌ£¤Ï¥í¡¼¥«¥ë¤Ê¥½¥Õ¥È¥¦¥§¥¢¤Ë¤è¤Ã¤ÆÄêµÁ¤µ¤ì¤ë¡£ +Âçʸ»ú¡¢¾®Ê¸»ú¤ò¶èÊ̤·¤Æ¤â¤è¤¤¤¬¡¢ÉáÄ̤϶èÊ̤µ¤ì¤Ê¤¤¡£ +¥í¡¼¥«¥ëÉôʬ¤¬¥´¥ß¤Î¤è¤¦¤Ë¸«¤¨¤ë¾ì¹ç¤Ï¡¢¤½¤ì¤Ï¤¿¤¤¤ÆÆâÉôŪ¤ÊÅŻҥ᡼¥ë +¥·¥¹¥Æ¥à¤È¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î´Ö¤Ë¤¢¤ë¥²¡¼¥È¥¦¥§¥¤¤Î¤»¤¤¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ë¡£ +.PP + "surname/admd=telemail/c=us/o=hp/prmd=hp"@some.where +.br + USER%SOMETHING@some.where +.br + machine!machine!name@some.where +.br + 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 ¥²¡¼¥È¥¦¥§¥¤¤Ç¤ÎÎã¤Ç¤¢¤ë¡£ +ºÇ¸å¤Î¤Ïñ¤Ë´ÖÈ´¤±¤Ê¥æ¡¼¥¶¡¼Ì¾¤Ç¤¢¤ë¡£) +.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. +.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. +.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)" ¤È¤¤¤¦¡£ +°Ê²¼¤Î½ñ¼°¤ò»ÈÍѤ¹¤ë: +.PP + <@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 +¤ËÁ÷¤ë¡£ +.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. +.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" ¤Î¥¢¥É¥ì¥¹¤ÏÂçʸ»ú¡¢¾®Ê¸»ú¤Î¶èÊ̤Ϥµ¤ì¤Ê¤¤¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.I /etc/aliases +.br +.I ~/.forward +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR binmail (1), +.BR mail (1), +.BR mconnect (1), +.BR aliases (5), +.BR forward (5), +.BR sendmail (8), +.BR vrfy (8) + +RFC\ 2822 (Internet Message Format) diff --git a/draft/man7/man-pages.7 b/draft/man7/man-pages.7 new file mode 100644 index 00000000..2dd7590b --- /dev/null +++ b/draft/man7/man-pages.7 @@ -0,0 +1,948 @@ +.\" (C) Copyright 1992-1999 Rickard E. Faith and David A. Wheeler +.\" (faith@cs.unc.edu and dwheeler@ida.org) +.\" and (C) Copyright 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. +.\" +.\" 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 +.SH ̾Á° +.\"O man-pages \- conventions for writing Linux man pages +man-pages \- Linux ¤Î man ¥Ú¡¼¥¸¤ò½ñ¤¯ºÝ¤Î·è¤Þ¤ê»ö +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B man +.RI [ section ] +.I title +.\"O .SH DESCRIPTION +.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 +.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 +.\"O .B 2 System calls +.\"O Those functions which must be performed by the kernel. +.B 2 ¥·¥¹¥Æ¥à¥³¡¼¥ë +¥«¡¼¥Í¥ë¤¬½èÍý¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤´Ø¿ô¡£ +.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 +.\"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 +.\"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 +.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 +.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ʸ»ú¤ò±Û¤¨¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤Û¤·¤¤¡£ +¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢¥Ñ¥Ã¥Á¤ò¥á¡¼¥ëËÜʸ¤ËºÜ¤»¤ÆÁ÷¤ë¾ì¹ç¤Ë¡¢ +¥á¡¼¥ë¥¯¥é¥¤¥¢¥ó¥È¤Ë¤è¤ë¹ÔÀÞ¤êÊÖ¤·¤ò²óÈò¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"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" +.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 \(em remember 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. +ºÇ¿·¤Î¥ê¥Ó¥¸¥ç¥ó¤ÎÆüÉÕ \(em man ¥Ú¡¼¥¸¤ËÊѹ¹¤ò²Ã¤¨¤¿¤È¤­¤Ë¤Ï +ɬ¤º¤³¤ì¤òÊѹ¹¤¹¤ë¤³¤È¡£ +¤³¤ì¤¬ºÇ¤â°ìÈÌŪ¤Ê¥Ð¡¼¥¸¥ç¥ó´ÉÍýÊýË¡¤Ç¤¢¤ë¡£ +ÆüÉÕ¤Ï YYYY-MM-DD ¤Î·Á¼°¤Çµ­ºÜ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.I source +.\"O The source of the command, function, or system call. +¥³¥Þ¥ó¥É¡¢´Ø¿ô¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î½Ð¼«¡£ + +.\"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 +¤È¤À¤±½ñ¤¯¤³¤È¤¬Â¿¤¤¤À¤í¤¦¡£ + +.\"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" +¤È¤À¤±½ñ¤¯¡£ +(°ÊÁ°¤Î´·½¬¤Ç¤Ï¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òµ­ºÜ¤·¤¿/ÆâÍƤò³Îǧ¤·¤¿¥«¡¼¥Í¥ë¤Î +¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òµ­ºÜ¤·¤Æ¤¤¤¿¡£¤·¤«¤·¡¢¥Ð¡¼¥¸¥ç¥óÈֹ椬¼ÂºÝ¤ÎÆâÍÆ¤È +°ìÃפ·¤Æ¤¤¤ë¤³¤È¤Ï¤Ê¤¯¡¢¤½¤Î¤¿¤á¥Ð¡¼¥¸¥ç¥óÈֹ椬¤Ê¤¤¤è¤ê¤â +¤ª¤½¤é¤¯°­¤¤·Á¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£ +º£¸å¤Ï¡¢¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤ò´Þ¤á¤ë¤Î¤ÏÈò¤±¤ë¤³¤È¡£) + +.\"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 +¤È½ñ¤¯¤«¡¢¶õ¤Îʸ»úÎó¤ò»È¤¦¡£ + +.\"O For Section 4 pages, use +.\"O .IR "Linux" . +¥»¥¯¥·¥ç¥ó 4 ¤Î¥Ú¡¼¥¸¤Ç¤Ï +.I "Linux" +¤ò»È¤¦¡£ + +.\"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" +¤ò»È¤¦¤³¤È)¡£ +.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 ¿§¤Ä¤­ +¤Î¥»¥¯¥·¥ç¥ó¤ò»ý¤Ä¤Î¤¬Ë¾¤Þ¤·¤¤¡£ +¿·¤·¤¯¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òºîÀ®¤¹¤ëºÝ¤Ë¤Ï¡¢¤À¤¤¤¿¤¤°Ê²¼¤Î¥ê¥¹¥È¤Ë¼¨¤·¤¿ +½ç½ø¤Ç¥»¥¯¥·¥ç¥ó¤òÇÛÃÖ¤¹¤ë¤è¤¦¤Ë¤·¤Æ¤â¤é¤¤¤¿¤¤¡£ +.in +0.5i +.nf + +.\"O \fBNAME\fP +\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) ¤òÀߤ±¤ë¤³¤È¤Ç +Âбþ¤Ç¤­¤Ê¤¤¤«¹Í¤¨¤Æ¤Û¤·¤¤¡£ + +.\"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 +»ØÄê¤ò½ñ¤­¡¢´Ø¿ôÀë¸À¤ò³¤±¤ë¡£ + +.\"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 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¤À¤±Åо줹¤Ù¤­¤Ç¤¢¤ë¡£ +.\" .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 ¤Î¥Ú¡¼¥¸¤Î¾ì¹ç¡¢¤³¤Î¥»¥¯¥·¥ç¥ó¤Ë +¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó¤¬¸Æ¤Ó½Ð¤·¸µ¤ËÊÖ¤¹ÃͤΥꥹ¥È¤òµ­ºÜ¤¹¤ë¡£ +¤½¤ì¤é¤ÎÃͤ¬ÊÖ¤µ¤ì¤¿¾ì¹ç¤Î¾õÂÖ¤ËÂФ¹¤ëÀâÌÀ¤â½ñ¤¯¡£ +.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 +.\"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 +¤¬»È¤ï¤ì¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¤¤À¤í¤¦¡£ +.\" 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. +.\" ¤´¤¯°ìÈÌŪ¤Ê¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Î³µÍפȡ¢ +.\" ¤½¤ì¤é¤ò¤É¤¦°·¤¦¤«¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤ë¡£¥×¥í¥°¥é¥à¤Î¼Â¹Ô»þ¤Ë¸½¤ì¤ë +.\" ¥·¥¹¥Æ¥à¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤äÃ×̿Ū¥·¥°¥Ê¥ë¤òÁ´ÉôÀâÌÀ¤¹¤ëɬÍפϤʤ¤¡£ +.\" ¤¿¤À¤·¤½¤ì¤é¤¬¥×¥í¥°¥é¥à¤ËÂФ·¤Æ +.\" ²¿¤é¤«¤ÎÆüì¤Ê°ÕÌ£¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤ÏÊ̤Ǥ¢¤ë¡£ +.\" +.\" 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 ¤«¤é¤ÎÊѹ¹) +¤Ë¤Ä¤¤¤Æ¤Î¤ß¤Ç¤¢¤í¤¦¡£ + +.\"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) +»²¾È¡£) + +.\"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 ¸ÇÍ­¤Î¾ì¹ç¤Ï¡¢¤½¤Î»Ý¤òµ­ºÜ¤¹¤ë¤³¤È¡£ + +.\"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. +À©¸Â¡¦ÃΤé¤ì¤Æ¤¤¤ë·ç´Ù¤äÉÔÊؤÊÅÀ¡¢¤½¤Î¾ÉԻ׵ĤÊÆ°ºî¤Ê¤É¤ò½ñ¤¯¡£ +.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 +.\"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 +.\"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 +.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) ¥»¥¯¥·¥ç¥ó¤Ç¤¢¤Ã¤Æ¤â¡¢¤³¤Î¥ë¡¼¥ë¤Ë½¾¤¦¡× +´Ø¿ô¤Î¾¤ÎÉôʬ¤Ï¥Ü¡¼¥ë¥É¤ò»ØÄꤹ¤ë: +.PP +.BI " int myfunction(int " argc ", char **" argv ); +.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 )¡£ +.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 ¤Ï¥Ü¡¼¥ë¥É¤Ë¤·¤Ê¤¤¡£ +.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 +¥Þ¥¯¥í¤òÍѤ¤¤ë)¡£ +.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 + +.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 +¤Î¤è¤¦¤Ë¥¤¥¿¥ê¥Ã¥¯ÂΤǵ­ºÜ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.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 () +¤Î¤è¤¦¤Ëµ­ºÜ¤¹¤ë¡£ +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ë¤Ï¼¡¤Î¤è¤¦¤Ëµ­ºÜ¤¹¤ë¤Î¤¬Ë¾¤Þ¤·¤¤: +.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()" ¤è¤ê¤â¡¢¤³¤Î·Á¼°¤ò»È¤¦¤³¤È¡£ +¤³¤ì¤Ë¤è¤ê¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò²ò¼á¤¹¤ë¥Ä¡¼¥ë¤ò +½ñ¤¯¤Î¤¬´Êñ¤Ë¤Ê¤ë¡£) +.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))¡£ +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ë¤Ï¼¡¤Î¤è¤¦¤Ëµ­ºÜ¤¹¤ë¤Î¤¬Ë¾¤Þ¤·¤¤: +.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 +.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 +* +.\"O Example programs should be written in C. +¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï C ¤Çµ­ºÜ¤¹¤ë¤³¤È¡£ +.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 +* +.\"O Example programs should be fairly short (preferably less than 100 lines; +.\"O ideally less than 50 lines). +¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï¤«¤Ê¤êû¤á¤Ë¤¹¤ë¤³¤È +(100¹Ô̤Ëþ¤¬Ë¾¤Þ¤·¤¯¡¢50¹Ô̤Ëþ¤¬ÍýÁÛŪ¤Ç¤¢¤ë)¡£ +.TP +* +.\"O Example programs should do error checking after system calls and +.\"O library function calls. +¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¸å¤Ç +¥¨¥é¡¼¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¤³¤È¡£ +.TP +* +.\"O Example programs should be complete, and compile without +.\"O warnings when compiled with \fIcc\ \-Wall\fP. +¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï´°·ë¤·¤Æ¤¤¤Æ¡¢ +\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 +* +.\"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 ʸ»ú¤ò»È¤¦¤Î¤ÏÈò¤±¤ë¤³¤È¡£) +.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) +¤ò»²¾È¤¹¤ë¤³¤È¡£ + +.\"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 +.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) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR man (1), +.BR man2html (1), +.BR groff (7), +.BR groff_man (7), +.BR man (7), +.BR mdoc (7) diff --git a/draft/man7/man.7 b/draft/man7/man.7 new file mode 100644 index 00000000..5637bd1b --- /dev/null +++ b/draft/man7/man.7 @@ -0,0 +1,903 @@ +.\" (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 afterwards. +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/math_error.7 b/draft/man7/math_error.7 new file mode 100644 index 00000000..17c92086 --- /dev/null +++ b/draft/man7/math_error.7 @@ -0,0 +1,440 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-17, Akihiro MOTOKI , LDP v3.07 +.\" +.\"WORD: significand ²¾¿ôÉô +.\"WORD: domain error Îΰ襨¥é¡¼ +.\"WORD: pole error ¶Ë¥¨¥é¡¼ +.\"WORD: range error ÈÏ°Ï¥¨¥é¡¼ +.\" +.TH MATH_ERROR 7 2008-08-11 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O math_error \- detecting errors from mathematical functions +math_error \- ¿ô³Ø´Ø¿ô¤«¤é¤Î¥¨¥é¡¼¤Î¸¡½Ð +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O When an error occurs, +.\"O most library functions indicate this fact by returning a special value +.\"O (e.g., \-1 or NULL). +.\"O Because they typically return a floating-point number, +.\"O the mathematical functions declared in +.\"O .IR +.\"O indicate an error using other mechanisms. +.\"O There are two error-reporting mechanisms: +.\"O the older one sets +.\"O .IR errno ; +.\"O the newer one uses the floating-point exception mechanism (the use of +.\"O .BR feclearexcept (3) +.\"O and +.\"O .BR fetestexcept (3), +.\"O as outlined below) +.\"O described in +.\"O .BR fenv (3). +¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢¤Û¤È¤ó¤É¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï (\-1 ¤ä NULL ¤Ê¤É¤Î) +ÆÃÊ̤ÊÃͤòÊÖ¤¹¤³¤È¤Ç¥¨¥é¡¼¤òÄÌÃΤ¹¤ë¡£ +.I +¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë¿ô³Ø´Ø¿ô¤Ï¡¢Ä̾ï¤ÏÉâÆ°¾®¿ôÅÀÃͤòÊÖ¤¹¤Î¤Ç¡¢ +¾¤Îµ¡¹½¤ò»È¤Ã¤Æ¥¨¥é¡¼¤òÄÌÃΤ¹¤ë¡£ +¥¨¥é¡¼ÄÌÃε¡¹½¤Ï 2 ¼ïÎढ¤ê¡¢ +¸Å¤¤¤â¤Î¤¬ +.I errno +¤òÀßÄꤹ¤ë¤ä¤êÊý¤Ç¤¢¤ê¡¢¿·¤·¤¤¤â¤Î¤¬ +.BR fenv (3) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ëÉâÆ°¾®¿ôÅÀÎã³°µ¡¹½¤Ç¤¢¤ë¡£ +.RB ( feclearexcept (3) +¤È +.BR fetestexcept (3) +¤ò»ÈÍѤ¹¤ë¡£¤³¤ì¤é¤Ë¤Ä¤¤¤Æ¤Ï°Ê²¼¤Ç³µÍפòÀâÌÀ¤·¤Æ¤¤¤ë¡£) + +.\"O A portable program that needs to check for an error from a mathematical +.\"O function should set +.\"O .I errno +.\"O to zero, and make the following call +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¡¢¿ô³Ø´Ø¿ô¤«¤é¤Î¥¨¥é¡¼¤ò³Îǧ¤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢ +¿ô³Ø´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë +.I errno +¤ò 0 ¤ËÀßÄꤷ¡¢°Ê²¼¤ò¸Æ¤Ó½Ð¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.in +4n +.nf + +feclearexcept(FE_ALL_EXCEPT); +.\"O +.fi +.in +.\"O before calling a mathematical function. +.\"Omotoki: Âбþ¤¹¤ëÌõ¤Ï feclearexcept ¤Î°úÍѤÎÁ°¤Ë¤¢¤ë¡£ + +.\"O Upon return from the mathematical function, if +.\"O .I errno +.\"O is nonzero, or the following call (see +.\"O .BR fenv (3)) +.\"O returns nonzero +¿ô³Ø´Ø¿ô¤«¤éÊ֤äƤ­¤¿ºÝ¤Ë¡¢ +.I errno +¤¬ 0 °Ê³°¤«¡¢°Ê²¼¤Î¸Æ¤Ó½Ð¤·¤¬ 0 °Ê³°¤òÊÖ¤·¤¿¾ì¹ç +.RB ( fenv (3) +»²¾È)¡¢¿ô³Ø´Ø¿ô¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤¤¤ë¡£ +.in +4n +.nf + +fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | + FE_UNDERFLOW); +.\"O +.fi +.in +.\" enum +.\" { +.\" FE_INVALID = 0x01, +.\" __FE_DENORM = 0x02, +.\" FE_DIVBYZERO = 0x04, +.\" FE_OVERFLOW = 0x08, +.\" FE_UNDERFLOW = 0x10, +.\" FE_INEXACT = 0x20 +.\" }; +.\"O then an error occurred in the mathematical function. +.\"Omotoki: Âбþ¤¹¤ëÌõ¤Ï fetestexcept ¤Î°úÍѤÎÁ°¤Ë¤¢¤ë¡£ + +.\"O The error conditions that can occur for mathematical functions +.\"O are described below. +¿ô³Ø´Ø¿ô¤ÇȯÀ¸¤¹¤ë¥¨¥é¡¼¾ò·ï¤Ë¤Ä¤¤¤Æ¤Ï°Ê²¼¤ÇÀâÌÀ¤¹¤ë¡£ +.\"O .SS Domain Error +.SS Îΰ襨¥é¡¼ (domain error) +.\"O A +.\"O .I domain error +.\"O occurs when a mathematical function is supplied with an argument whose +.\"O value falls outside the domain for which the function +.\"O is defined (e.g., giving a negative argument to +.\"O .BR log (3)). +.\"O When a domain error occurs, +.\"O math functions commonly return a NaN +.\"O (though some functions return a different value in this case); +.\"O .I errno +.\"O is set to +.\"O .BR EDOM , +.\"O and an "invalid" +.\"O .RB ( FE_INVALID ) +.\"O floating-point exception is raised. +.I Îΰ襨¥é¡¼ +¤¬È¯À¸¤¹¤ë¤Î¤Ï¡¢¿ô³Ø´Ø¿ô¤ËÅϤµ¤ì¤¿°ú¤­¿ô¤ÎÃͤ¬¤½¤Î´Ø¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë +Îΰè¤ËÆþ¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤¢¤ë (Î㤨¤Ð +.BR log (3) +¤ËÉé¤Î°ú¤­¿ô¤òÅϤ·¤¿¾ì¹ç)¡£ +Îΰ襨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢ +¿ô³Ø´Ø¿ô¤ÏÉáÄÌ¤Ï NaN ¤òÊÖ¤· +(Ʊ¤¸¾õ¶·¤Ç°ã¤¦ÃͤòÊÖ¤¹´Ø¿ô¤â¤¢¤ë)¡¢ +.I errno +¤Ë +.B EDOM +¤òÀßÄꤷ¡¢¡Ö̵¸ú (invalid)¡× +ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤ò¾å¤²¤ë¡£ +.\"O .SS Pole Error +.SS ¶Ë¥¨¥é¡¼ (pole error) +.\"O A +.\"O .I pole error +.\"O occurs when the mathematical result of a function is an exact infinity +.\"O (e.g., the logarithm of 0 is negative infinity). +.\"O When a pole error occurs, +.\"O the function returns the (signed) value +.\"O .BR HUGE_VAL , +.\"O .BR HUGE_VALF , +.\"O or +.\"O .BR HUGE_VALL , +.\"O depending on whether the function result type is +.\"O .IR double , +.\"O .IR float , +.\"O or +.\"O .IR "long double" . +.\"O The sign of the result is that which is mathematically correct for +.\"O the function. +.I ¶Ë¥¨¥é¡¼ +¤¬È¯À¸¤¹¤ë¤Î¤Ï¡¢´Ø¿ô¤Î¿ô³ØŪ¤Ê·ë²Ì¤¬Ìµ¸ÂÂ礽¤Î¤â¤Î¤È¤Ê¤ë¾ì¹ç¤Ç¤¢¤ë +(Î㤨¤Ð +0 ¤ÎÂпô¤ÏÉé¤Î̵¸ÂÂç¤Ç¤¢¤ë)¡£ +¶Ë¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢¤½¤Î´Ø¿ô¤ÎÊÖ¤êÃÍ¤Ï (Éä¹æÉÕ¤­¤Î) +.BR HUGE_VAL , +.BR HUGE_VALF , +.B HUGE_VALL +¤Î¤¤¤º¤ì¤«¤È¤Ê¤ë (Á°µ­¤ÎÃͤΤ¦¤Á¤É¤ì¤¬Ê֤뤫¤Ï´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ë¤è¤ê·è¤Þ¤ê¡¢ +¤½¤ì¤¾¤ì +.IR double , +.IR float , +.I "long double" +¤ËÂбþ¤¹¤ë)¡£ +·ë²Ì¤ÎÉä¹æ¤Ï¡¢¤½¤Î´Ø¿ô¤Î¿ô³ØŪ¤ÊÄêµÁ¤«¤é·èÄꤵ¤ì¤ë¡£ +.\"O .I errno +.\"O is set to +.\"O .BR ERANGE , +.\"O and a "divide-by-zero" +.\"O .RB ( FE_DIVBYZERO ) +.\"O floating-point exception is raised. +.I errno +¤Ï +.B ERANGE +¤ËÀßÄꤵ¤ì¡¢¡Ö0 ¤Ë¤è¤ë½ü»» (divide-by-zero)¡× +ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_DIVBYZERO ) +¤¬¾å¤¬¤ë¡£ +.\"O .SS Range Error +.SS ÈÏ°Ï¥¨¥é¡¼ (range ¥¨¥é¡¼) +.\"O A +.\"O .I range error +.\"O occurs when the magnitude of the function result means that it +.\"O cannot be represented in the result type of the function. +.\"O The return value of the function depends on whether the range error +.\"O was an overflow or an underflow. +.I ÈÏ°Ï¥¨¥é¡¼ +¤¬È¯À¸¤¹¤ë¤Î¤Ï¡¢´Ø¿ô¤Î·ë²Ì¤ÎÃͤ¬¤½¤Î´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ç¤Ïɽ¸½¤Ç¤­¤Ê¤¤¾ì¹ç +¤Ç¤¢¤ë¡£´Ø¿ô¤ÎÊÖ¤êÃͤϡ¢ÈÏ°Ï¥¨¥é¡¼¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ç¤¢¤Ã¤¿¤«¥¢¥ó¥À¡¼¥Õ¥í¡¼ +¤Ç¤¢¤Ã¤¿¤«¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ + +.\"O A floating result +.\"O .I overflows +.\"O if the result is finite, +.\"O but is too large to represented in the result type. +.\"O When an overflow occurs, +.\"O the function returns the value +.\"O .BR HUGE_VAL , +.\"O .BR HUGE_VALF , +.\"O or +.\"O .BR HUGE_VALL , +.\"O depending on whether the function result type is +.\"O .IR double , +.\"O .IR float , +.\"O or +.\"O .IR "long double" . +.\"O .I errno +.\"O is set to +.\"O .BR ERANGE , +.\"O and an "overflow" +.\"O .RB ( FE_OVERFLOW ) +.\"O floating-point exception is raised. +ÉâÆ°¾®¿ôÅÀ¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ï¡¢·ë²Ì¤¬Í­¸Â¤À¤¬¡¢Â礭²á¤®¤Æ +·ë²Ì¤òÊÖ¤¹·¿¤Ç¤Ïɽ¸½¤Ç¤­¤Ê¤¤¾ì¹ç¤ËȯÀ¸¤¹¤ë¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬È¯À¸¤¹¤ë¤È¡¢ +¤½¤Î´Ø¿ô¤Ï +.BR HUGE_VAL , +.BR HUGE_VALF , +.B HUGE_VALL +¤Î¤¤¤º¤ì¤«¤òÊÖ¤¹ (Á°µ­¤ÎÃͤΤ¦¤Á¤É¤ì¤¬Ê֤뤫¤Ï´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ë¤è¤ê·è¤Þ¤ê¡¢ +¤½¤ì¤¾¤ì +.IR double , +.IR float , +.I "long double" +¤ËÂбþ¤¹¤ë)¡£ +.I errno +¤Ï +.B ERANGE +¤ËÀßÄꤵ¤ì¡¢¡Ö¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ (overflow)¡× +ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ + +.\"O A floating result +.\"O .I underflows +.\"O if the result is too small to be represented in the result type. +.\"O If an underflow occurs, +.\"O a mathematical function typically returns 0.0 +.\"O (C99 says a function shall return "an implementation-defined value +.\"O whose magnitude is no greater than the smallest normalized +.\"O positive number in the specified type"). +ÉâÆ°¾®¿ôÅÀ¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Ï¡¢ +·ë²Ì¤¬¾®¤µ²á¤®¤Æ¡¢·ë²Ì¤òÊÖ¤¹·¿¤Ç¤Ïɽ¸½¤Ç¤­¤Ê¤¤¾ì¹ç¤ËȯÀ¸¤¹¤ë¡£ +¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¬È¯À¸¤¹¤ë¤È¡¢¿ô³Ø´Ø¿ô¤ÏÄ̾ï¤Ï 0.0 ¤òÊÖ¤¹ +(C99 ¤Ç¤Ï¡¢»ØÄꤵ¤ì¤¿·¿¤Ë¤ª¤¤¤ÆºÇ¾®¤ÎÀµµ¬²½¤µ¤ì¤¿Àµ¤ÎÃͤè¤êÂ礭¤¯¤Ê¤¤ +Ãͤò»ý¤Ä¼ÂÁõÄêµÁ (implementation-defined) ¤ÎÃͤòÊÖ¤¹¡¢¤È¤Ê¤Ã¤Æ¤¤¤ë)¡£ +.\"O .I errno +.\"O may be set to +.\"O .BR ERANGE , +.\"O and an "overflow" +.\"O .RB ( FE_UNDERFLOW ) +.\"O floating-point exception may be raised. +.I errno +¤Ï +.B ERANGE +¤ËÀßÄꤵ¤ì¡¢¡Ö¥¢¥ó¥À¡¼¥Õ¥í¡¼¡×ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ + +.\"O Some functions deliver a range error if the supplied argument value, +.\"O or the correct function result, would be +.\"O .IR subnormal . +.\"O A subnormal value is one that is nonzero, +.\"O but with a magnitude that is so small that +.\"O it can't be presented in normalized form +.\"O (i.e., with a 1 in the most significant bit of the significand). +.\"O The representation of a subnormal number will contain one +.\"O or more leading zeros in the significand. +¤¤¤¯¤Ä¤«¤Î´Ø¿ô¤Ç¤Ï¡¢ÅϤµ¤ì¤¿°ú¤­¿ô¤ÎÃͤ䡢Àµ¤·¤¤´Ø¿ô¤Î·ë²Ì¤¬ +.I subnormal (ÈóÀµµ¬²½¿ô) +¤Ë¤Ê¤ë¾ì¹ç¤ËÈÏ°Ï¥¨¥é¡¼¤ò¾å¤²¤ë¡£ +subnormal ¤ÊÃͤȤϡ¢0 ¤Ç¤Ï¤Ê¤¤¤¬¡¢¤½¤ÎÃͤ¬¾®¤µ¤¹¤®¤Æ +(²¾¿ôÉô¤ÎºÇ¾å°Ì¥Ó¥Ã¥È¤¬ 1 ¤È¤Ê¤ë) ɸ½à·Á¤Ç¤Ïɽ¸½¤Ç¤­¤Ê¤¤¤è¤¦¤ÊÃͤǤ¢¤ë¡£ +subnormal ¤ÊÃͤÎɽ¸½¤Ç¤Ï¡¢²¾¿ôÉô¤Î¾å°Ì¦¤Î¥Ó¥Ã¥È¤Ë 1 ¸Ä°Ê¾å¤Î 0 ¤¬ +´Þ¤Þ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The +.\"O .I math_errhandling +.\"O identifier specified by C99 and POSIX.1-2001 is not supported by glibc. +C99 ¤È POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë +.I math_errhandling +¼±ÊÌ»Ò¤Ï glibc ¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" See CONFORMANCE in the glibc 2.8 (and earlier) source. +.\"O This identifier is supposed to indicate which of the two +.\"O error-notification mechanisms +.\"O .RI ( errno , +.\"O exceptions retrievable via +.\"O .BR fettestexcept (3)) +.\"O is in use. +¤³¤Î¼±Ê̻Ҥϡ¢2 ¤Ä¤Î¥¨¥é¡¼ÄÌÃε¡¹½ +.RI ( errno +¤È +.BR fetestexcept (3) +·Ðͳ¤Ç¼èÆÀ¤Ç¤­¤ëÎã³°) ¤Î¤¦¤Á¤É¤Á¤é¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¤«¤òÄÌÃÎ +¤¹¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O The standards require that at least one be in use, +.\"O but permit both to be available. +.\"O The current (version 2.8) situation under glibc is messy. +.\"O Most (but not all) functions raise exceptions on errors. +.\"O Some also set +.\"O .IR errno . +.\"O A few functions set +.\"O .IR errno , +.\"O but don't raise an exception. +.\"O A very few functions do neither. +.\"O See the individual manual pages for details. +ɸ½à¤Ç¤Ï¡¢¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Ï»ÈÍѤµ¤ì¤ë¤³¤È¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë¤¬¡¢ +ξÊý¤È¤âÍøÍѲÄǽ¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¤È¤µ¤ì¤Æ¤¤¤ë¡£ +glibc ¤Ç¤Î¸½ºß¤Î (¥Ð¡¼¥¸¥ç¥ó 2.8 ¤Ç¤Î) ¾õ¶·¤Ï¤«¤Ê¤êº®Í𤷤Ƥ¤¤ë¡£ +¤Û¤È¤ó¤É¤Î´Ø¿ô (¤¿¤À¤·Á´Éô¤Ç¤Ï¤Ê¤¤) ¤Ï¥¨¥é¡¼»þ¤ËÎã³°¤ò¾å¤²¤ë¡£ +¤¤¤¯¤Ä¤«¤Î´Ø¿ô¤Ï +.I errno +¤âÀßÄꤹ¤ë¡£ +.I errno +¤òÀßÄꤹ¤ë¤¬¡¢Îã³°¤ò¾å¤²¤Ê¤¤´Ø¿ô¤â¾¯¤·¤À¤±Â¸ºß¤¹¤ë¡£ +¤É¤Á¤é¤â¹Ô¤ï¤Ê¤¤´Ø¿ô¤â¤´¤¯¾¯¿ô¤À¤¬Â¸ºß¤¹¤ë¡£ +¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¸Ä¡¹¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤Î¤³¤È¡£ + +.\"O To avoid the complexities of using +.\"O .I errno +.\"O and +.\"O .BR fetestexcept (3) +.\"O for error checking, +.\"O it is often advised that one should instead check for bad argument +.\"O values before each call. +.I errno +¤È +.BR fetestexcept (3) +¤ÎξÊý¤ò»È¤Ã¤Æ¥¨¥é¡¼¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¤³¤È¤ÇÊ£»¨¤Ë¤Ê¤ë¤Î¤òÈò¤±¤ë¤¿¤á¡¢ +¿¤¯¤Î¾ì¹ç¡¢´Ø¿ô¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦Á°¤ËÉÔÀµ¤Ê°ú¤­¿ô¤«¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦ +ÊýË¡¤¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.\" http://www.securecoding.cert.org/confluence/display/seccode/FLP32-C.+Prevent+or+detect+domain+and+range+errors+in+math+functions +.\"O For example, the following code ensures that +.\"O .BR log (3)'s +.\"O argument is not a NaN and is not zero (a pole error) or +.\"O less than zero (a domain error): +Î㤨¤Ð¡¢°Ê²¼¤Î¥³¡¼¥É¤Ï¡¢ +.BR log (3) +¤Î°ú¤­¿ô¤¬ NaN ¤Ç¤â (¶Ë¥¨¥é¡¼¤È¤Ê¤ë) 0 ¤Ç¤â (Îΰ襨¥é¡¼¤È¤Ê¤ë) 0 ̤Ëþ +¤Ç¤â¤Ê¤¤¤³¤È¤òÊݾڤ¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.in +4n +.nf + +double x, r; + +if (isnan(x) || islessequal(x, 0)) { + /* Deal with NaN / pole error / domain error */ +} + +r = log(x); + +.fi +.in +.\"O The discussion on this page does not apply to the complex +.\"O mathematical functions (i.e., those declared by +.\"O .IR ), +.\"O which in general are not required to return errors by C99 +.\"O and POSIX.1-2001. +¤³¤Î¥Ú¡¼¥¸¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¤³¤È¤Ï¡¢ +.RI ( +¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë) Ê£ÁÇ¿ô´Ø¿ô¤Ë¤Ï¤¢¤Æ¤Ï¤Þ¤é¤Ê¤¤¡£ +°ìÈ̤ˡ¢C99 ¤ä POSIX.1-2001 ¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤¬¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤ò +Í׵ᤷ¤Æ¤Ê¤¤¡£ + +.\"O The +.\"O .BR gcc (1) +.\"O .I "-fno-math-errno" +.\"O option causes the executable to employ implementations of some +.\"O mathematical functions that are faster than the standard +.\"O implementations, but do not set +.\"O .I errno +.\"O on error. +.\"O (The +.\"O .BR gcc (1) +.\"O .I "-ffast-math" +.\"O option also enables +.\"O .IR "-fno-math-errno" .) +.\"O An error can still be tested for using +.\"O .BR fetestexcept (3). +.BR gcc (1) +¤Î +.I "-fno-math-errno" +¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¡¢¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ç¡¢É¸½à¤Î¼ÂÁõ¤è¤ê¤â¹â®¤Ê¿ô³Ø´Ø¿ô¤Î +¼ÂÁõ¤¬»ÈÍѤµ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¤¬¡¢ +¥¨¥é¡¼»þ¤Ë +.I errno +¤¬ÀßÄꤵ¤ì¤Ê¤¤ +.RB ( gcc (1) +¤Î +.I "-ffast-math" +¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤â +.I "-fno-math-errno" +¤ÏÍ­¸ú¤Ë¤Ê¤ë)¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¤Ç¤â¡¢ +.BR fetestexcept (3) +¤ò»È¤Ã¤¿¥¨¥é¡¼¤Î¸¡ºº¤Ï²Äǽ¤Ç¤¢¤ë¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR gcc (1), +.BR errno (3), +.BR fenv (3), +.BR fpclassify (3), +.BR INFINITY (3), +.BR isgreater (3), +.BR matherr (3), +.BR nan (3) +.br +.I "info libc" diff --git a/draft/man7/mdoc.7 b/draft/man7/mdoc.7 new file mode 100644 index 00000000..b5807a1a --- /dev/null +++ b/draft/man7/mdoc.7 @@ -0,0 +1,711 @@ +.\" Copyright (c) 1991, 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. +.\" +.\" @(#)mdoc.7 8.2 (Berkeley) 12/30/93 +.\" $Id: mdoc.7,v 1.6 2000/09/07 07:21:50 hanataka 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 ¸Æ¤Ó½Ð¤·²Äǽ¥Þ¥¯¥í +.\" +.Dd July 11, 1999 +.Dt MDOC 7 +.Os Linux +.\"O .Sh NAME +.Sh ̾Á° +.Nm mdoc +.\"O .Nd quick reference guide for the +.Nd +.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 ¤Îʸ½ñ¤ÇÄ̾ïÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸¤È¤Ï°Û¤Ê¤ë¡£ +¤·¤«¤·¹­¤¯ÍѤ¤¤é¤ì¤Æ¤¤¤ë¤¤¤¯¤Ä¤«¤Î¥×¥í¥°¥é¥à¤Îʸ½ñ¤Ç¡¢ +¤³¤Î¥Þ¥¯¥í¤¬ÍøÍѤµ¤ì¤Æ¤¤¤ë¡£ +.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) +¤Ç¡¢ +.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 ¤Ä¤Î¥Þ¥¯¥í¤ò +¤³¤Î½çÈ֤ǽñ¤¯É¬Íפ¬¤¢¤ë¡£ +.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 +¥¤¥ó¥Ç¥ó¥È¤·¤Æ¥Æ¥­¥¹¥È¤ò°ì¹Ôɽ¼¨¡£ +.It Li \&.Dl +.\"O (D-ell) Display-one literal. +.\"O Indent and display one line of literal text. +(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 diag Ta "¿ÇÃǥꥹ¥È (diagnostic list)" +.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) ¤ÎÆâÉô¤Ç¤Ï¡¢ +¤½¤Î¤Û¤È¤ó¤É¤¬¥Ñ¡¼¥º¤µ¤ì¤ë¤È¤¤¤¦ÅÀ¤Ç¤¢¤ë¡£ +Î㤨¤Ð°Ê²¼¤Î¤è¤¦¤ËÊÑ´¹¤µ¤ì¤ë: +.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 +¤ËÂФ·¤ÆºîÍѤ¹¤ë¡£¤½¤·¤Æ¼¡¤ËÃæ¿È¤Î¸Æ¤Ó¤À¤·²Äǽ¤Ê¥Þ¥¯¥í +.Ql \&Ar +¤¬¸Æ¤Ð¤ì¡¢°ú¿ô¤Ç¤¢¤ë +.Ql file +¤ËºîÍѤ¹¤ë¡£¸Æ¤Ó¤À¤·²Äǽ¤Ç¤¢¤ë¤¬¥Ñ¡¼¥¹¤µ¤ì¤Ê¤¤¥Þ¥¯¥í¤ä¡¢ +¤½¤ÎµÕ¤Î¥Þ¥¯¥í¤â¸ºß¤¹¤ë¡£¤³¤Î¤è¤¦¤Ê¥Þ¥¯¥í¤Ï°Ê²¼¤Î +.Em parsed +¥«¥é¥à¤ä +.Em callable +¥«¥é¥à¤Ç¼¨¤¹¡£ +.Pp +.\"O Unless stated, manual domain macros share a common syntax: +Æä˵­½Ò¤¬¤Ê¤±¤ì¤Ð¡¢¥Þ¥Ë¥å¥¢¥ë¥É¥á¥¤¥ó¥Þ¥¯¥í¤Ï¶¦Ä̤νñ¼°¤ò¤È¤ë: +.Pp +.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, +Æüì¤Ê°ÕÌ£¤ò»ý¤Ä¶çÆÉʸ»ú¤Ï¡¢Ê¸»úÎó +.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." +.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 \&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 \&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 \&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 \&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 \&St Ta Yes Ta Yes Ta "ɸ½à (\-p1003.2, \-p1003.1, \-ansiC ¤Î¤É¤ì¤«)" +.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 "¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÁê¸ß»²¾È" +.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 "»²¹Íʸ¸¥¤Î½ñÀÒ¥¿¥¤¥È¥ë" +.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 \&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 \&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 \&Em Ta Yes Ta Yes Ta "¶¯Ä´ (traditional English)." +.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 \&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 \&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 "³ÈÄ¥°ú¿ô¥ê¥¹¥È¤Î³«¤­" +.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 ¸Ä¤ò±Û¤¨¤ë¤È¤­¤ËÍѤ¤¤é¤ì¤ë¡£ +.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 ¥Þ¥¯¥í (»²¾ÈÍÑ¥¿¡¼¥²¥Ã¥È¤Î»ØÄê) ¤âÍøÍѤǤ­¤ë¡£ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ë´Ø¤¹¤ë¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.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 +.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 ´ØÏ¢¹àÌÜ +.Xr groff_mdoc 7 , +.Xr mdoc.samples 7 , +.Xr man 7 , +.Xr man-pages 7 diff --git a/draft/man7/mq_overview.7 b/draft/man7/mq_overview.7 new file mode 100644 index 00000000..2c9b3fdb --- /dev/null +++ b/draft/man7/mq_overview.7 @@ -0,0 +1,512 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-03-13, Akihiro MOTOKI +.\" Updated 2006-07-20, Akihiro MOTOKI , LDP v2.36 +.\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.19 +.\" Updated 2010-04-11, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: message queue descriptor ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò +.\"WORD: message queue description ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò +.\" +.TH MQ_OVERVIEW 7 2009-09-27 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mq_overview \- Overview of POSIX message queues +mq_overview \- POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î³µÍ× +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O POSIX message queues allow processes to exchange data in +.\"O the form of messages. +.\"O This API is distinct from that provided by System V message queues +.\"O .RB ( msgget (2), +.\"O .BR msgsnd (2), +.\"O .BR msgrcv (2), +.\"O etc.), but provides similar functionality. +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ò»ÈÍѤ¹¤ë¤È¡¢¥×¥í¥»¥¹´Ö¤Ç +¥á¥Ã¥»¡¼¥¸¤Î·Á¤Ç¤Î¥Ç¡¼¥¿¤Î¤ä¤ê¼è¤ê¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î API ¤Ï System V ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î API +.RB ( msgget (2), +.BR msgsnd (2), +.BR msgrcv (2) +¤Ê¤É) ¤È¤Ï°Û¤Ê¤ë¤â¤Î¤À¤¬¡¢Æ±Íͤε¡Ç½¤òÄ󶡤¹¤ë¡£ + +.\"O Message queues are created and opened using +.\"O .BR mq_open (3); +.\"O this function returns a +.\"O .I message queue descriptor +.\"O .RI ( mqd_t ), +.\"O which is used to refer to the open message queue in later calls. +.\"O Each message queue is 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, +.\"O followed by one or more characters, none of which are slashes. +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ÎºîÀ®¤È¥ª¡¼¥×¥ó¤Ï +.BR mq_open (3) +¤ò»È¤Ã¤Æ¹Ô¤¦¡£¤³¤Î´Ø¿ô¤Ï +.I ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò (message queue descriptor) +.RI ( mqd_t ) +¤òÊÖ¤¹¡£¤³¤ì°Ê¹ß¤Î¥³¡¼¥ë¤Ç¤Ï¡¢¥ª¡¼¥×¥ó¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï +.I ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò +¤ò»È¤Ã¤Æ»²¾È¤µ¤ì¤ë¡£ +³Æ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï +.I /somename +¤Î·Á¤Î̾Á°¤Ç¶èÊ̤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤½¤Î̾Á°¤Ï¡¢ºÇÂç¤Ç +.B NAME_MAX +(¤¹¤Ê¤ï¤Á 255) ʸ»ú¤Î NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¡¢ +¥¹¥é¥Ã¥·¥å¤Ç»Ï¤Þ¤ê¡¢¥¹¥é¥Ã¥·¥å°Ê³°¤Îʸ»ú¤¬ 1 ʸ»ú°Ê¾å³¤¯·Á¼°¤Ç¤¢¤ë¡£ +.\"O Two processes can operate on the same queue by passing the same name to +.\"O .BR mq_open (3). +.BR mq_open (3) +¤ËƱ¤¸Ì¾Á°¤òÅϤ¹¤³¤È¤Ç¡¢2¤Ä¤Î¥×¥í¥»¥¹¤ÇƱ°ì¤Î¥­¥å¡¼¤ò +Áàºî¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O Messages are transferred to and from a queue using +.\"O .BR mq_send (3) +.\"O and +.\"O .BR mq_receive (3). +.\"O When a process has finished using the queue, it closes it using +.\"O .BR mq_close (3), +.\"O and when the queue is no longer required, it can be deleted using +.\"O .BR mq_unlink (3). +.\"O Queue attributes can be retrieved and (in some cases) modified using +.\"O .BR mq_getattr (3) +.\"O and +.\"O .BR mq_setattr (3). +.\"O A process can request asynchronous notification +.\"O of the arrival of a message on a previously empty queue using +.\"O .BR mq_notify (3). +¥á¥Ã¥»¡¼¥¸¤Î¥­¥å¡¼¤Ø¤ÎÁ÷¼õ¿®¤Ï +.BR mq_send (3) +¤È +.BR mq_receive (3) +¤ò»È¤Ã¤Æ¹Ô¤¦¡£¥×¥í¥»¥¹¤¬¥­¥å¡¼¤Î»ÈÍѤò½ª¤¨¤ë¤È¤­¤Ë¤Ï¡¢ +.BR mq_close (3) +¤ò»È¤Ã¤Æ¥­¥å¡¼¤ò¥¯¥í¡¼¥º¤¹¤ë¡£¥­¥å¡¼¤¬¤â¤Ï¤äÉÔÍפȤʤ俾ì¹ç¤Ë¤Ï¡¢ +.BR mq_unlink (3) +¤ò»È¤Ã¤Æ¥­¥å¡¼¤òºï½ü¤Ç¤­¤ë¡£¥­¥å¡¼¤Î°À­¤Ï +.BR mq_getattr (3) +¤Ç¼èÆÀ¤Ç¤­¡¢ (À©¸Â¤Ï¤¢¤ë¤¬) +.BR mq_setattr (3) +¤ÇÊѹ¹¤Ç¤­¤ë¡£ +.BR mq_notify (3) +¤ò»È¤¦¤³¤È¤Ç¡¢¶õ¤Î¥­¥å¡¼¤Ø¤Î¥á¥Ã¥»¡¼¥¸ÅþÃå¤òÈóƱ´ü¤Ç +ÄÌÃΤ¹¤ë¤è¤¦¤ËÍ׵᤹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ + +.\"O A message queue descriptor is a reference to an +.\"O .I "open message queue description" +.\"O (cf. +.\"O .BR open (2)). +.\"O After a +.\"O .BR fork (2), +.\"O a child inherits copies of its parent's message queue descriptors, +.\"O and these descriptors refer to the same open message queue descriptions +.\"O as the corresponding descriptors in the parent. +.\"O Corresponding descriptors in the two processes share the flags +.\"O .RI ( mq_flags ) +.\"O that are associated with the open message queue description. +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò¤Ï +.I "¥ª¡¼¥×¥ó¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò (open message queue description)" +¤Ø¤Î»²¾È¤Ç¤¢¤ë +.RB ( open (2) +¤â»²¾È)¡£ +.BR fork (2) +¼Â¹Ô¸å¤Ï¡¢»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +¤³¤ì¤é¤Îµ­½Ò»Ò¤Ï¡¢¿Æ¥×¥í¥»¥¹¤ÎÂбþ¤¹¤ëµ­½Ò»Ò¤ÈƱ¤¸¥ª¡¼¥×¥ó¥á¥Ã¥»¡¼¥¸¥­¥å¡¼ +µ­½Ò¤ò»²¾È¤·¤Æ¤¤¤ë¡£¿Æ¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤ÎÂбþ¤¹¤ëµ­½Ò»Ò¤Ï¡¢¥Õ¥é¥° +.RI ( mq_flags ) +¤ò¶¦Í­¤¹¤ë¡£¤Ê¤¼¤Ê¤é¡¢¥Õ¥é¥°¤Ï¥ª¡¼¥×¥ó¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò¤Ë +´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ + +.\"O Each message has an associated +.\"O .IR priority , +.\"O and messages are always delivered to the receiving process +.\"O highest priority first. +.\"O Message priorities range from 0 (low) to +.\"O .I sysconf(_SC_MQ_PRIO_MAX)\ -\ 1 +.\"O (high). +.\"O On Linux, +.\"O .I sysconf(_SC_MQ_PRIO_MAX) +.\"O returns 32768, but POSIX.1-2001 only requires +.\"O an implementation to support priorities in the range 0 to 31; +.\"O some implementations only provide this range. +³Æ¥á¥Ã¥»¡¼¥¸¤Ë¤Ï¤½¤ì¤¾¤ì +.I Í¥ÀèÅÙ (priority) +¤¬¤¢¤ê¡¢¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®¥×¥í¥»¥¹¤Ø¤ÎÇÛÁ÷¤Ï¾ï¤Ë +Í¥ÀèÅ٤ι⤤¥á¥Ã¥»¡¼¥¸¤«¤é½ç¤Ë¹Ô¤ï¤ì¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤ÎÍ¥ÀèÅÙ¤Ï 0 (ÄãÍ¥Àè) ¤«¤é +.I sysconf(_SC_MQ_PRIO_MAX)\ -\ 1 +(¹âÍ¥Àè) ¤ÎÃͤò»ý¤Ä¡£ +Linux ¤Ç¤Ï¡¢ +.I sysconf(_SC_MQ_PRIO_MAX) +¤Ï 32768 ¤òÊÖ¤¹¤¬¡¢ +POSIX.1-2001 ¤ÇÍ׵ᤵ¤ì¤Æ¤¤¤ë¤Î¤Ï 0 ¤«¤é 31 ¤Þ¤Ç¤ÎÍ¥ÀèÅÙ¤ò +¼ÂÁõ¤¹¤ë¤³¤È¤À¤±¤Ç¤¢¤ê¡¢¼ÂÁõ¤Ë¤è¤Ã¤Æ¤Ï¤³¤ÎÈϰϤÎÍ¥ÀèÅÙ¤·¤« +Âбþ¤·¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O The remainder of this section describes some specific details +.\"O of the Linux implementation of POSIX message queues. +¤³¤ÎÀá¤Î»Ä¤ê¤Ç¤Ï¡¢POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î Linux ¤Î¼ÂÁõ¤Î¾ÜºÙ +¤Ë¤Ä¤¤¤ÆÀâÌÀ¤¹¤ë¡£ +.\"O .SS Library interfaces and system calls +.SS ¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤È¥·¥¹¥Æ¥à¥³¡¼¥ë +.\"O In most cases the +.\"O .B mq_*() +.\"O library interfaces listed above are implemented +.\"O on top of underlying system calls of the same name. +.\"O Deviations from this scheme are indicated in the following table: +¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢¾åµ­¤Î +.B mq_*() +¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¡¢Æ±¤¸Ì¾Á°¤Î²¼°ÌÁؤΥ·¥¹¥Æ¥à¥³¡¼¥ë¤ò +»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£¤³¤ÎÏÈÁȤߤˤ¢¤Æ¤Ï¤Þ¤é¤Ê¤¤¤â¤Î¤ò +°Ê²¼¤Îɽ¤Ë¼¨¤¹¡£ +.in +4n +.TS +lB lB +l l. +Library interface System call +mq_close(3) close(2) +mq_getattr(3) mq_getsetattr(2) +mq_notify(3) mq_notify(2) +mq_open(3) mq_open(2) +mq_receive(3) mq_timedreceive(2) +mq_send(3) mq_timedsend(2) +mq_setattr(3) mq_getsetattr(2) +mq_timedreceive(3) mq_timedreceive(2) +mq_timedsend(3) mq_timedsend(2) +mq_unlink(3) mq_unlink(2) +.TE +.in +.\"O .SS Versions +.SS ¥Ð¡¼¥¸¥ç¥ó +.\"O POSIX message queues have been supported on Linux since kernel 2.6.6. +.\"O Glibc support has been provided since version 2.3.4. +Linux ¤Ç¤Ï POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï¥«¡¼¥Í¥ë 2.6.6 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +glibc ¤Ç¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3.4 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS Kernel configuration +.SS ¥«¡¼¥Í¥ë¤ÎÀßÄê +.\"O Support for POSIX message queues is configurable via the +.\"O .B CONFIG_POSIX_MQUEUE +.\"O kernel configuration option. +.\"O This option is enabled by default. +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¥µ¥Ý¡¼¥È¤Ï¡¢¥«¡¼¥Í¥ë¤ÎÀßÄê (configuration) +¥ª¥×¥·¥ç¥ó +.B CONFIG_POSIX_MQUEUE +¤ÇÀßÄê²Äǽ¤Ç¤¢¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÍ­¸ú¤Ç¤¢¤ë¡£ +.\"O .SS Persistence +.SS »ý³À­ +.\"O POSIX message queues have kernel persistence: +.\"O if not removed by +.\"O .BR mq_unlink (3), +.\"O a message queue will exist until the system is shut down. +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï¥«¡¼¥Í¥ëÆâ¤ÇÊÝ»ý¤µ¤ì¤ë¡£ +.BR mq_unlink (3) +¤Çºï½ü¤µ¤ì¤Ê¤±¤ì¤Ð¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï +¥·¥¹¥Æ¥à¤¬¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤ë¤Þ¤Ç¸ºß¤·Â³¤±¤ë¡£ +.\"O .SS Linking +.SS ¥ê¥ó¥¯ +.\"O Programs using the POSIX message queue API must be compiled with +.\"O .I cc \-lrt +.\"O to link against the real-time library, +.\"O .IR librt . +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼ API ¤ò»ÈÍѤ·¤¿¥×¥í¥°¥é¥à¤Ï +.I cc \-lrt +¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¡¢¥ê¥¢¥ë¥¿¥¤¥à¥é¥¤¥Ö¥é¥ê +.I librt +¤È¥ê¥ó¥¯¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SS /proc interfaces +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.\"O The following interfaces can be used to limit the amount of +.\"O kernel memory consumed by POSIX message queues: +°Ê²¼¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æ¡¢POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬¾ÃÈñ¤¹¤ë¥«¡¼¥Í¥ë +¥á¥â¥ê¤ÎÎ̤òÀ©¸Â¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.I /proc/sys/fs/mqueue/msg_max +.\"O This file can be used to view and change the ceiling value for the +.\"O maximum number of messages in a queue. +.\"O This value acts as a ceiling on the +.\"O .I attr\->mq_maxmsg +.\"O argument given to +.\"O .BR mq_open (3). +.\"O The default value for +.\"O .I msg_max +.\"O is 10. +.\"O The minimum value is 1 (10 in kernels before 2.6.28). +.\"O The upper limit is +.\"O .BR HARD_MAX : +.\"O .IR "(131072\ /\ sizeof(void\ *))" +.\"O (32768 on Linux/86). +.\"O This limit is ignored for privileged processes +.\"O .RB ( CAP_SYS_RESOURCE ), +.\"O but the +.\"O .B HARD_MAX +.\"O ceiling is nevertheless imposed. +¤³¤Î¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ¡¢°ì¤Ä¤Î¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¥á¥Ã¥»¡¼¥¸¤ÎºÇÂç¿ô¤Î +¾å¸ÂÃͤò»²¾È¤·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë¡£¤³¤ÎÃͤϡ¢ +.BR mq_open (3) +¤ËÅϤ¹ +.I attr\->mq_maxmsg +°ú¤­¿ô¤ËÂФ¹¤ë¾å¸ÂÃͤȤ·¤Æµ¡Ç½¤¹¤ë¡£ +.I msg_max +¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 10 ¤Ç¡¢ +ºÇ¾®ÃÍ¤Ï 1 (2.6.28 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï 10) ¤Ç¤¢¤ë¡£ +¾å¸Â¤Ï¡ÖËä¤á¹þ¤ß¤Î¸ÇÄêÃÍ¡× +.RB ( HARD_MAX ) +¤Ç +.IR "(131072\ /\ sizeof(void\ *))" +(Linux/86 ¤Ç¤Ï 32768) ¤Ç¤¢¤ë¡£ +¤³¤Î¾å¸Â¤ÏÆø¢¥×¥í¥»¥¹ +.RB ( CAP_SYS_RESOURCE ) +¤Ç¤Ï̵»ë¤µ¤ì¤ë¤¬¡¢Ëä¤á¹þ¤ß¤Î¸ÇÄêÃͤˤè¤ë¾å¸Â¤Ï +¤É¤ó¤Ê¾ì¹ç¤Ë¤Ç¤âŬÍѤµ¤ì¤ë¡£ +.TP +.I /proc/sys/fs/mqueue/msgsize_max +.\"O This file can be used to view and change the ceiling on the +.\"O maximum message size. +.\"O This value acts as a ceiling on the +.\"O .I attr\->mq_msgsize +.\"O argument given to +.\"O .BR mq_open (3). +.\"O The default value for +.\"O .I msgsize_max +.\"O is 8192 bytes. +.\"O The minimum value is 128 (8192 in kernels before 2.6.28). +.\"O The upper limit for +.\"O .I msgsize_max +.\"O is 1,048,576 (in kernels before 2.6.28, the upper limit was +.\"O .BR INT_MAX ; +.\"O that is, 2,147,483,647 on Linux/86). +.\"O This limit is ignored for privileged processes +.\"O .RB ( CAP_SYS_RESOURCE ). +¤³¤Î¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ¡¢¥á¥Ã¥»¡¼¥¸¤ÎºÇÂ祵¥¤¥º¤Î¾å¸ÂÃͤò +»²¾È¤·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë¡£ +¤³¤ÎÃͤϡ¢ +.BR mq_open (3) +¤ËÅϤ¹ +.I attr\->mq_msgsize +°ú¤­¿ô¤ËÂФ¹¤ë¾å¸ÂÃͤȤ·¤Æµ¡Ç½¤¹¤ë¡£ +.I msgsize_max +¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 8192 ¥Ð¥¤¥È¤Ç¡¢ +ºÇ¾®ÃÍ¤Ï 128 (2.6.28 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï 8192) ¤Ç¤¢¤ë¡£ +.I msgsize_max +¤Î¾å¸Â¤Ï 1,048,576 ¤Ç¤¢¤ë +(2.6.28 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¾å¸Â¤Ï +.B INT_MAX +(Linux/86 ¤Ç¤Ï 2,147,483,647) ¤Ç¤¢¤Ã¤¿)¡£ +¤³¤Î¾å¸Â¤ÏÆø¢¥×¥í¥»¥¹ +.RB ( CAP_SYS_RESOURCE ) +¤Ç¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.I /proc/sys/fs/mqueue/queues_max +.\"O This file can be used to view and change the system-wide limit on the +.\"O number of message queues that can be created. +.\"O Only privileged processes +.\"O .RB ( CAP_SYS_RESOURCE ) +.\"O can create new message queues once this limit has been reached. +.\"O The default value for +.\"O .I queues_max +.\"O is 256; it can be changed to any value in the range 0 to INT_MAX. +¤³¤Î¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ¡¢ºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¿ô¤Ë +ÂФ¹¤ë¥·¥¹¥Æ¥àÁ´ÂΤǤÎÀ©¸Â¤ò»²¾È¤·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë¡£ +°ìÅÙ¤³¤Î¾å¸Â¤Ë㤹¤ë¤È¡¢¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òºîÀ®¤Ç¤­¤ë¤Î¤Ï +Æø¢¥×¥í¥»¥¹ +.RB ( CAP_SYS_RESOURCE ) +¤À¤±¤È¤Ê¤ë¡£ +.I queues_max +¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 256 ¤Ç¤¢¤ê¡¢ +0 ¤«¤é INT_MAX ¤ÎÈϰϤÎǤ°Õ¤ÎÃͤËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SS Resource limit +.SS ¥ê¥½¡¼¥¹À©¸Â +.\"O The +.\"O .B RLIMIT_MSGQUEUE +.\"O resource limit, which places a limit on the amount of space +.\"O that can be consumed by all of the message queues +.\"O belonging to a process's real user ID, is described in +.\"O .BR getrlimit (2). +¥ê¥½¡¼¥¹¾å¸Â +.B RLIMIT_MSGQUEUE +¤Ï¡¢¥×¥í¥»¥¹¤Î¼Â UID ¤ËÂбþ¤¹¤ëÁ´¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬¾ÃÈñ¤¹¤ë +¥á¥â¥ê¶õ´Ö¤ÎÎ̤ËÂФ·¤Æ¾å¸Â¤òÀßÄꤹ¤ë¡£ +.BR getrlimit (2) +¤ò»²¾È¡£ +.\"O .SS Mounting the message queue file system +.SS ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¡¦¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È +.\"O On Linux, message queues are created in a virtual file system. +.\"O (Other implementations may also provide such a feature, +.\"O but the details are likely to differ.) +.\"O This file system can be mounted (by the superuser) using the following +.\"O commands: +Linux ¤Ç¤Ï¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤ËºîÀ®¤µ¤ì¤ë +(¾¤Î¼ÂÁõ¤Ç¤âƱÍͤε¡Ç½¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¤â¤Î¤â¤¢¤ë¤¬¡¢ +¾ÜºÙ¤Ï°ã¤Ã¤Æ¤¤¤ë¤À¤í¤¦)¡£ +°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò»È¤¦¤³¤È¤Ç (¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Ï) +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥Þ¥¦¥ó¥È¤Ç¤­¤ë: +.in +4n +.nf + +.RB "#" " mkdir /dev/mqueue" +.RB "#" " mount \-t mqueue none /dev/mqueue" + +.fi +.in +.\"O The sticky bit is automatically enabled on the mount directory. +¥Þ¥¦¥ó¥È¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¥¹¥Æ¥£¥Ã¥­¡¼¥Ó¥Ã¥È (sticky bit) ¤Ï +¼«Æ°Åª¤Ë¥ª¥ó¤È¤Ê¤ë¡£ + +.\"O After the file system has been mounted, the message queues on the system +.\"O can be viewed and manipulated using the commands usually used for files +.\"O (e.g., +.\"O .BR ls (1) +.\"O and +.\"O .BR rm (1)). +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¡¦¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¸å¤Ï¡¢¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +Ä̾ï»È¤¦¥³¥Þ¥ó¥É (Î㤨¤Ð +.BR ls (1) +¤ä +.BR rm (1)) +¤ò»È¤Ã¤Æ¡¢¥·¥¹¥Æ¥à¾å¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òɽ¼¨¤·¤¿¤ê +Áàºî¤·¤¿¤ê¤Ç¤­¤ë¡£ + +.\"O The contents of each file in the directory consist of a single line +.\"O containing information about the queue: +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î³Æ¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤Ï 1¹Ô¤Ç¤¢¤ê¡¢ +¥­¥å¡¼¤Ë´Ø¤¹¤ë¾ðÊó¤¬É½¼¨¤µ¤ì¤ë¡£ +.in +4n +.nf + +.RB "$" " cat /dev/mqueue/mymq" +QSIZE:129 NOTIFY:2 SIGNO:0 NOTIFY_PID:8260 + +.fi +.in +.\"O These fields are as follows: +³Æ¥Õ¥£¡¼¥ë¥É¤Î¾ÜºÙ¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.TP +.B QSIZE +.\"O Number of bytes of data in all messages in the queue. +¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ëÁ´¥á¥Ã¥»¡¼¥¸¤Î¹ç·×¥Ð¥¤¥È¿ô¡£ +.TP +.B NOTIFY_PID +.\"O If this is nonzero, then the process with this PID has used +.\"O .BR mq_notify (3) +.\"O to register for asynchronous message notification, +.\"O and the remaining fields describe how notification occurs. +¤³¤ÎÃͤ¬ 0 °Ê³°¤Î¾ì¹ç¡¢¤³¤ÎÃͤΠPID ¤ò»ý¤Ä¥×¥í¥»¥¹¤¬ +.BR mq_notify (3) +¤ò»È¤Ã¤Æ¡¢ÈóƱ´ü¤Î¥á¥Ã¥»¡¼¥¸ÄÌÃΤò¹Ô¤¦¤è¤¦¤ËÀßÄꤷ¤¿¤³¤È¤ò¼¨¤¹¡£ +¤É¤Î¤è¤¦¤ËÄÌÃΤ¬¹Ô¤ï¤ì¤ë¤«¤Ï¡¢°Ê²¼¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤è¤ê·èÄꤵ¤ì¤ë¡£ +.TP +.B NOTIFY +.\"O Notification method: +.\"O 0 is +.\"O .BR SIGEV_SIGNAL ; +.\"O 1 is +.\"O .BR SIGEV_NONE ; +.\"O and +.\"O 2 is +.\"O .BR SIGEV_THREAD . +ÄÌÃÎÊýË¡: +0 ¤Ï +.BR SIGEV_SIGNAL ; +1 ¤Ï +.BR SIGEV_NONE ; +2 ¤Ï +.B SIGEV_THREAD +.TP +.B SIGNO +.\"O Signal number to be used for +.\"O .BR SIGEV_SIGNAL . +.B SIGEV_SIGNAL +¤Ë»ÈÍѤµ¤ì¤ë¥·¥°¥Ê¥ëÈֹ档 +.\"O .SS Polling message queue descriptors +.SS ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò¤Î¥Ý¡¼¥ê¥ó¥° +.\"O On Linux, a message queue descriptor is actually a file descriptor, +.\"O and can be monitored using +.\"O .BR select (2), +.\"O .BR poll (2), +.\"O or +.\"O .BR epoll (7). +.\"O This is not portable. +Linux ¤Ç¤Ï¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò¤Ï¼ÂºÝ¤Ï¥Õ¥¡¥¤¥ëµ­½Ò»Ò (file descriptor) +¤Ç¤¢¤ê¡¢ +.BR select (2), +.BR poll (2), +.BR epoll (7) +¤ò»È¤Ã¤Æ´Æ»ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Îµ¡Ç½¤Î°Ü¿¢À­¤Ï¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O System V message queues +.\"O .RB ( msgget (2), +.\"O .BR msgsnd (2), +.\"O .BR msgrcv (2), +.\"O etc.) are an older API for exchanging messages between processes. +.\"O POSIX message queues provide a better designed interface than +.\"O System V message queues; +.\"O on the other hand POSIX message queues are less widely available +.\"O (especially on older systems) than System V message queues. +System V ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼ +.RB ( msgget (2), +.BR msgsnd (2), +.BR msgrcv (2) +¤Ê¤É) ¤Ï¥×¥í¥»¥¹´Ö¤Ç¥á¥Ã¥»¡¼¥¸¤ò¤ä¤ê¼è¤ê¤¹¤ë¤¿¤á¤Î¸Å¤¤ API ¤Ç¤¢¤ë¡£ +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï System V ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤è¤ê¤â¤¦¤Þ¤¯ +À߷פµ¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤·¤Æ¤¤¤ë¡£ +°ìÊý¤Ç¡¢POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï System V ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ÈÈæ¤Ù¤ë¤È +ÍøÍѤǤ­¤ë¥·¥¹¥Æ¥à¤¬¾¯¤Ê¤¤ (Æäˡ¢¸Å¤¤¥·¥¹¥Æ¥à¤Ç¤Ï¾¯¤Ê¤¤)¡£ + +.\"O Linux does not currently (2.6.26) support the use of access control +.\"O lists (ACLs) for POSIX message queues. +¸½ºß¤Î¤³¤È¤í (¥Ð¡¼¥¸¥ç¥ó 2.6.26 »þÅÀ)¡¢ +Linux ¤Ï POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ËÂФ¹¤ë¥¢¥¯¥»¥¹À©¸æ¥ê¥¹¥È (ACL) ¤Ë +Âбþ¤·¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O An example of the use of various message queue functions is shown in +.\"O .BR mq_notify (3). +³Æ¼ï¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼´Ø¿ô¤ò»ÈÍѤ·¤¿Î㤬 +.BR mq_notify (3) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR getrlimit (2), +.BR mq_getsetattr (2), +.BR poll (2), +.BR select (2), +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR epoll (7) diff --git a/draft/man7/netdevice.7 b/draft/man7/netdevice.7 new file mode 100644 index 00000000..da5f20c7 --- /dev/null +++ b/draft/man7/netdevice.7 @@ -0,0 +1,455 @@ +'\" t +.\" Don't change the first line, it tells man that tbl is needed. +.\" This man page is Copyright (C) 1999 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. +.\" $Id: netdevice.7,v 1.10 2001/08/15 18:01:06 hanataka Exp $ +.\" +.\" Modified, 2004-11-25, mtk, formatting and a few wording fixes +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated Mon 6 Dec 1999 by NAKANO Takeo +.\" Updated Wed 14 Feb 2001 by Kentaro Shirakata +.\" Updated 2009-02-12 by Kentaro Shirakata +.\" +.\"WORD load balancing bundle Éé²Ùʬ»¶¥°¥ë¡¼¥× +.\"WORD file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD capability ¸¢¸Â +.\" +.TH NETDEVICE 7 2009-01-14 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O netdevice \- Low level access to Linux network devices +.SH ̾Á° +netdevice \- Linux ¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤Ø¤ÎÄã¥ì¥Ù¥ë¥¢¥¯¥»¥¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B "#include " +.br +.B "#include " +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This man page describes the sockets interface which is used to configure +.\"O network devices. +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤òÀßÄꤹ¤ë¤¿¤á¤Ë +ÍѤ¤¤ë¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤Ä¤¤¤Æ²òÀ⤹¤ë¡£ + +.\"O Linux supports some standard ioctls to configure network devices. +.\"O They can be used on any socket's file descriptor regardless of the +.\"O family or type. +.\"O They pass an +.\"O . ifreq +.\"O structure: +Linux ¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤òÀßÄꤹ¤ë¤¿¤á¤Îɸ½àŪ¤Ê ioctl ¤ò +¤¤¤¯¤Ä¤«È÷¤¨¤Æ¤¤¤ë¡£¤³¤ì¤é¤Ï¤É¤ó¤Ê¥½¥±¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤â +ÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¥Õ¥¡¥ß¥ê¡¼¤ä¥¿¥¤¥×¤Ï²¿¤Ç¤â¤è¤¤¡£ +¤³¤ì¤é¤Î ioctl ¤Ï +.I ifreq +¹½Â¤ÂΤòÅϤ¹¡£ + +.in +4n +.nf +struct ifreq { + char ifr_name[IFNAMSIZ]; /* Interface name */ + union { + struct sockaddr ifr_addr; + struct sockaddr ifr_dstaddr; + struct sockaddr ifr_broadaddr; + struct sockaddr ifr_netmask; + struct sockaddr ifr_hwaddr; + short ifr_flags; + int ifr_ifindex; + int ifr_metric; + int ifr_mtu; + struct ifmap ifr_map; + char ifr_slave[IFNAMSIZ]; + char ifr_newname[IFNAMSIZ]; + char *ifr_data; + }; +}; + +struct ifconf { + int ifc_len; /* size of buffer */ + union { + char *ifc_buf; /* buffer address */ + struct ifreq *ifc_req; /* array of structures */ + }; +}; +.fi +.in + +.\"O Normally, the user specifies which device to affect by setting +.\"O .I ifr_name +.\"O to the name of the interface. +.\"O All other members of the structure may +.\"O share memory. +Ä̾¥æ¡¼¥¶¡¼¤Ë¤è¤ëÀßÄêÂоݥǥХ¤¥¹¤Î»ØÄê¤Ï¡¢ +.I ifr_name +¤Ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î̾Á°¤ò¥»¥Ã¥È¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¹Ô¤¦¡£ +¾¤Î¹½Â¤ÂΤÎÁ´¤Æ¤Î¥á¥ó¥Ð¤Ï¡¢¥á¥â¥ê¤ò¶¦Í­¤¹¤ë¡£ +.\"O .SS Ioctls +.SS ioctl +.\"O If an ioctl is marked as privileged then using it requires an effective +.\"O user ID of 0 or the +.\"O .B CAP_NET_ADMIN +.\"O capability. +.\"O If this is not the case +.\"O .B EPERM +.\"O will be returned. +¡ÖÆø¢¤¬É¬Íספȵ­½Ò¤µ¤ì¤Æ¤¤¤ë ioctl ¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢ +¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤«¡¢ +.B CAP_NET_ADMIN +¸¢¸Â¤¬É¬ÍפǤ¢¤ë¡£¤³¤ì¤¬Ëþ¤¿¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï +.B EPERM +¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.B SIOCGIFNAME +.\"O Given the +.\"O .IR ifr_ifindex , +.\"O return the name of the interface in +.\"O .IR ifr_name . +.\"O This is the only ioctl which returns its result in +.\"O .IR ifr_name . +.I ifr_ifindex +¤ò¼õ¤±¼è¤ê¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î̾Á°¤ò +.I ifr_name +¤ËÆþ¤ì¤ÆÊÖ¤¹¡£¤³¤ì¤Ï·ë²Ì¤ò +.I ifr_name +¤È¤·¤ÆÊÖ¤¹Í£°ì¤Î ioctl ¤Ç¤¢¤ë¡£ +.TP +.B SIOCGIFINDEX +.\"O Retrieve the interface index of the interface into +.\"O .IR ifr_ifindex . +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î interface index ¤ò¼èÆÀ¤·¡¢ +.I ifr_ifindex +¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +.TP +.BR SIOCGIFFLAGS ", " SIOCSIFFLAGS +.\"O Get or set the active flag word of the device. +.\"O .I ifr_flags +.\"O contains a bit mask of the following values: +¥Ç¥Ð¥¤¥¹¤Î active ¥Õ¥é¥°¥ï¡¼¥É¤ò¼èÆÀ¤Þ¤¿¤ÏÀßÄꤹ¤ë¡£ +.I ifr_flags +¤Ë¤Ï°Ê²¼¤ÎÃͤΥӥåȥޥ¹¥¯¤¬Æþ¤ë¡£ +.TS +tab(:); +c s +l l. +.\"O Device flags +.\"O IFF_UP:Interface is running. +.\"O IFF_BROADCAST:Valid broadcast address set. +.\"O IFF_DEBUG:Internal debugging flag. +.\"O IFF_LOOPBACK:Interface is a loopback interface. +.\"O IFF_POINTOPOINT:Interface is a point-to-point link. +.\"O IFF_RUNNING:Resources allocated. +.\"O IFF_NOARP:No arp protocol +.\"O IFF_PROMISC:Interface is in promiscuous mode. +.\"O IFF_NOTRAILERS:Avoid use of trailers. +.\"O IFF_ALLMULTI:Receive all multicast packets. +.\"O IFF_MASTER:Master of a load balancing bundle. +.\"O IFF_SLAVE:Slave of a load balancing bundle. +.\"O IFF_MULTICAST:Supports multicast +.\"O IFF_PORTSEL:Is able to select media type via ifmap. +.\"O IFF_AUTOMEDIA:Auto media selection active. +.\"O IFF_DYNAMIC:T{ +.\"O The addresses are lost when the interface goes down. +.\"O T} +.\"O IFF_LOWER_UP:Driver signals L1 up (since Linux 2.6.17) +.\"O IFF_DORMANT:Driver signals dormant (since Linux 2.6.17) +.\"O IFF_ECHO:Echo sent packets (since Linux 2.6.25) +¥Ç¥Ð¥¤¥¹¥Õ¥é¥° +IFF_UP:¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÏÆ°ºîÃæ¡£ +IFF_BROADCAST:T{ +Í­¸ú¤Ê¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¡£ +T} +IFF_DEBUG:ÆâÉô¤Î¥Ç¥Ð¥Ã¥°¥Õ¥é¥°¡£ +IFF_LOOPBACK:¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï¥ë¡¼¥×¥Ð¥Ã¥¯¤Ç¤¢¤ë¡£ +IFF_POINTOPOINT:T{ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï point-to-point ¥ê¥ó¥¯¤Ç¤¢¤ë¡£ +T} +IFF_RUNNING:¥ê¥½¡¼¥¹¤¬³ä¤êÅö¤ÆºÑ¤ß¡£ +IFF_NOARP:arp ¥×¥í¥È¥³¥ë¤¬¤Ê¤¤¡£ +IFF_PROMISC:¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï promiscuous ¥â¡¼¥É¤Ç¤¢¤ë¡£ +IFF_NOTRAILERS:trailer ¤ÎÍøÍѤòÈò¤±¤ë¡£ +IFF_ALLMULTI:Á´¤Æ¤Î¥Þ¥ë¥Á¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤¹¤ë¡£ +IFF_MASTER:Éé²Ùʬ»¶¥°¥ë¡¼¥×¤Î¥Þ¥¹¥¿¡¼¤Ç¤¢¤ë¡£ +IFF_SLAVE:Éé²Ùʬ»¶¥°¥ë¡¼¥×¤Î¥¹¥ì¡¼¥Ö¤Ç¤¢¤ë¡£ +IFF_MULTICAST:¥Þ¥ë¥Á¥­¥ã¥¹¥È¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +IFF_PORTSEL:ifmap ¤Ë¤è¤Ã¤Æ¥á¥Ç¥£¥¢¥¿¥¤¥×¤òÁªÂò¤Ç¤­¤ë¡£ +IFF_AUTOMEDIA:¼«Æ°¥á¥Ç¥£¥¢ÁªÂò¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +IFF_DYNAMIC:T{ +¤³¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ÊĤ¸¤ë¤È¡¢¥¢¥É¥ì¥¹¤Ï¼º¤ï¤ì¤ë¡£ +T} +IFF_LOWER_UP:¥É¥é¥¤¥Ð¤«¤é¤Î L1 ¥¢¥Ã¥×¤ÎÄÌÃÎ (Linux 2.6.17 °Ê¹ß) +IFF_DORMANT:¥É¥é¥¤¥Ð¤«¤é¤ÎµÙ»ß¾õÂÖ¤ÎÄÌÃÎ (Linux 2.6.17 °Ê¹ß) +IFF_ECHO:Á÷¤é¤ì¤¿¥Ñ¥±¥Ã¥È¤ò¥¨¥³¡¼¤¹¤ë (Linux 2.6.25 °Ê¹ß) + + +.TE +.\"O Setting the active flag word is a privileged operation, but any +.\"O process may read it. +active ¥Õ¥é¥°¥ï¡¼¥É¤ÎÀßÄê¤ÏÆø¢¤¬É¬ÍפÊÁàºî¤Ç¤¢¤ë¡£ +¤·¤«¤·Æɤ߽Ф·¤Ï¤É¤ó¤Ê¥×¥í¥»¥¹¤«¤é¤â²Äǽ¤Ç¤¢¤ë¡£ +.TP +.BR SIOCGIFMETRIC ", " SIOCSIFMETRIC +.\"O Get or set the metric of the device using +.\"O .IR ifr_metric . +.\"O This is currently not implemented; it sets +.\"O .I ifr_metric +.\"O to 0 if you attempt to read it and returns +.\"O .B EOPNOTSUPP +.\"O if you attempt to set it. +¥Ç¥Ð¥¤¥¹¤Î¥á¥È¥ê¥Ã¥¯¤ò +.I ifr_metric +¤òÍѤ¤¤Æ¼èÆÀ¡¦ÀßÄꤹ¤ë¡£ +¤³¤ì¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£Æɤ߽Ф½¤¦¤È¤¹¤ë¤È +.I ifr_metric +¤Ë 0 ¤ò¥»¥Ã¥È¤·¤ÆÊ֤ꡢÀßÄꤷ¤è¤¦¤È¤¹¤ë¤È +.B EOPNOTSUPP +¤¬Ê֤롣 +.TP +.BR SIOCGIFMTU ", " SIOCSIFMTU +.\"O Get or set the MTU (Maximum Transfer Unit) of a device using +.\"O .IR ifr_mtu . +.\"O Setting the MTU is a privileged operation. +.\"O Setting the MTU to +.\"O too small values may cause kernel crashes. +¥Ç¥Ð¥¤¥¹¤Î MTU (Maximum Transfer Unit) ¤ò +.I ifr_mtu +¤òÍѤ¤¤Æ¼èÆÀ¡¦ÀßÄꤹ¤ë¡£ MTU ¤ÎÀßÄê¤ÏÆø¢¤¬É¬ÍפÊÁàºî¤Ç¤¢¤ë¡£ +MTU ¤ÎÃͤò¾®¤µ¤¯¤·¤¹¤®¤ë¤È¥«¡¼¥Í¥ë¤¬¥¯¥é¥Ã¥·¥å¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.BR SIOCGIFHWADDR ", " SIOCSIFHWADDR +.\"O Get or set the hardware address of a device using +.\"O .IR ifr_hwaddr . +¥Ç¥Ð¥¤¥¹¤Î¥Ï¡¼¥É¥¦¥§¥¢¥¢¥É¥ì¥¹¤ò +.I ifr_hwaddr +¤òÍѤ¤¤Æ¼èÆÀ¡¦ÀßÄꤹ¤ë¡£ +.\"O The hardware address is specified in a struct +.\"O .IR sockaddr . +¥Ï¡¼¥É¥¦¥§¥¢¥¢¥É¥ì¥¹¤Ï +.I sockaddr +¹½Â¤ÂΤËÀßÄꤵ¤ì¤ë¡£ +.\"O .I sa_family +.\"O contains the ARPHRD_* device type, +.\"O .I sa_data +.\"O the L2 hardware address starting from byte 0. +.I sa_family +¤Ë¤Ï ARPHRD_* ¥Ç¥Ð¥¤¥¹¥¿¥¤¥×¤¬Æþ¤ê¡¢ +.I sa_data +¤Ë¤Ï¥Ð¥¤¥È 0 ¤«¤é»Ï¤Þ¤ë L2 ¥Ï¡¼¥É¥¦¥§¥¢¥¢¥É¥ì¥¹¤¬Æþ¤ë¡£ +.\"O Setting the hardware address is a privileged operation. +¥Ï¡¼¥É¥¦¥§¥¢¥¢¥É¥ì¥¹¤ÎÀßÄê¤ÏÆø¢¤¬É¬ÍפÊÁàºî¤Ç¤¢¤ë¡£ +.TP +.B SIOCSIFHWBROADCAST +.\"O Set the hardware broadcast address of a device from +.\"O .IR ifr_hwaddr . +.\"O This is a privileged operation. +¥Ç¥Ð¥¤¥¹¤Î¥Ï¡¼¥É¥¦¥§¥¢¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ò +.I ifr_hwaddr +¤ÎÃͤËÀßÄꤹ¤ë¡£¤³¤ÎÁàºî¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£ +.TP +.BR SIOCGIFMAP ", " SIOCSIFMAP +.\"O Get or set the interface's hardware parameters using +.\"O .IR ifr_map . +.\"O Setting the parameters is a privileged operation. +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥Ï¡¼¥É¥¦¥§¥¢¤Î¥Ñ¥é¥á¡¼¥¿¤ò +.I ifr_map +¤òÍѤ¤¤Æ¼èÆÀ¡¦ÀßÄꤹ¤ë¡£ +¥Ñ¥é¥á¡¼¥¿¤ÎÀßÄê¤ÏÆø¢¤¬É¬ÍפÊÁàºî¤Ç¤¢¤ë¡£ + +.in +4n +.nf +struct ifmap { + unsigned long mem_start; + unsigned long mem_end; + unsigned short base_addr; + unsigned char irq; + unsigned char dma; + unsigned char port; +}; +.fi +.in + +.\"O The interpretation of the ifmap structure depends on the device driver +.\"O and the architecture. +ifmap ¹½Â¤ÂΤβò¼á¤Ï¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë°Í¸¤¹¤ë¡£ +.TP +.BR SIOCADDMULTI ", " SIOCDELMULTI +.\"O Add an address to or delete an address from the device's link layer +.\"O multicast filters using +.\"O .IR ifr_hwaddr . +.\"O These are privileged operations. +.\"O See also +.\"O .BR packet (7) +.\"O for an alternative. +¥Ç¥Ð¥¤¥¹¤Î¥ê¥ó¥¯ÁؤΥޥë¥Á¥­¥ã¥¹¥È¥Õ¥£¥ë¥¿¡¼¤«¤é¡¢ +.I ifr_hwaddr +¤Î¥¢¥É¥ì¥¹¤òÄɲᦺï½ü¤¹¤ë¡£¤³¤ì¤é¤ÎÁàºî¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£ +Ê̤ÎÊýË¡¤¬ +.BR packet (7) +¤Ç²òÀ⤵¤ì¤Æ¤¤¤ë¡£ +.TP +.BR SIOCGIFTXQLEN ", " SIOCSIFTXQLEN +.\"O Get or set the transmit queue length of a device using +.\"O .IR ifr_qlen . +.\"O Setting the transmit queue length is a privileged operation. +¥Ç¥Ð¥¤¥¹¤ÎÁ÷¿®¥­¥å¡¼¤ÎŤµ¤ò +.I ifr_qlen +¤Ë¼èÆÀ¡¦ÀßÄꤹ¤ë¡£Á÷¿®¥­¥å¡¼¤ÎŤµ¤ÎÀßÄê¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£ +.TP +.B SIOCSIFNAME +.\"O Changes the name of the interface specified in +.\"O .I ifr_name +.\"O to +.\"O .IR ifr_newname . +.\"O This is a privileged operation. +.\"O It is only allowed when the interface +.\"O is not up. +.I ifr_name +¤Ç»ØÄꤷ¤¿¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î̾Á°¤ò +.I ifr_newname +¤ËÊѹ¹¤¹¤ë¡£¤³¤ÎÁàºî¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ up ¤·¤Æ¤¤¤Ê¤¤ +»þ¤Ë¤Î¤ß»ÈÍѤǤ­¤ë¡£ +.TP +.B SIOCGIFCONF +.\"O Return a list of interface (transport layer) addresses. +.\"O This currently +.\"O means only addresses of the +.\"O .B AF_INET +.\"O (IPv4) family for compatibility. +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹(¥È¥é¥ó¥¹¥Ý¡¼¥ÈÁØ)¥¢¥É¥ì¥¹¤Î¥ê¥¹¥È¤òÊÖ¤¹¡£ +¸½ºß¤Î¤È¤³¤í¡¢¸ß´¹À­¤Î¤¿¤á¤Ë +.B AF_INET +(IPv4) ¥Õ¥¡¥ß¥ê¡¼¤Î¥¢¥É¥ì¥¹¤Î¤ß¤Ç¤¢¤ë¡£ +.\"O The user passes a +.\"O .I ifconf +.\"O structure as argument to the ioctl. +.\"O It contains a pointer to an array of +.\"O .I ifreq +.\"O structures in +.\"O .I ifc_req +.\"O and its length in bytes in +.\"O .IR ifc_len . +¥æ¡¼¥¶¡¼¤Ï +.I ifconf +¹½Â¤ÂΤò ioctl ¤Î°ú¿ô¤È¤·¤ÆÅϤ¹¡£ +.I ifconf +¹½Â¤ÂΤˤϡ¢ +.I ifreq +¹½Â¤ÂΤÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë +.I ifc_req +¤È¡¢¥Ð¥¤¥Èñ°Ì¤ÎÇÛÎó¤ÎŤµ¤ò»ØÄꤹ¤ë +.I ifc_len +¤¬´Þ¤Þ¤ì¤ë¡£ +.\"O The kernel fills the ifreqs with all current L3 interface addresses that +.\"O are running: +.\"O .I ifr_name +.\"O contains the interface name (eth0:1 etc.), +.\"O .I ifr_addr +.\"O the address. +¥«¡¼¥Í¥ë¤Ï ifreqs ¤ò¸½ºßÆ°ºî¤·¤Æ¤¤¤ëÁ´¤Æ¤Î L3 ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤ÇËä¤á¤ë¡£ +.I ifr_name +¤Ë¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹Ì¾ (eth0:1 ¤Ê¤É) ¤¬Æþ¤ê¡¢ +.I ifr_addr +¤Ë¤Ï¥¢¥É¥ì¥¹¤¬Æþ¤ë¡£ +.\"O The kernel returns with the actual length in +.\"O .IR ifc_len . +¥«¡¼¥Í¥ë¤Ï¼ÂºÝ¤ÎŤµ¤ò +.I ifc_len +¤ËÊÖ¤¹¡£ +.\"O If +.\"O .I ifc_len +.\"O is equal to the original length the buffer probably has overflowed +.\"O and you should retry with a bigger buffer to get all addresses. +.I ifc_len +¤¬¸µ¤Î¥Ð¥Ã¥Õ¥¡¤ÎŤµ¤ÈƱ¤¸¤À¤Ã¤¿¾ì¹ç¡¢ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤·¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¡¢ +Á´¤Æ¤Î¥¢¥É¥ì¥¹¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë¤è¤êÂ礭¤Ê¥Ð¥Ã¥Õ¥¡¤ÇºÆ»î¹Ô¤¹¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O When no error occurs the ioctl returns 0; +.\"O otherwise \-1. +.\"O Overflow is no an error. +¥¨¥é¡¼¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï ioctl ¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ï¥¨¥é¡¼¤È¤Ï¸«¤Ê¤µ¤ì¤Ê¤¤¡£ +.\" Slaving isn't supported in 2.2 +.\" . +.\" .TP +.\" .BR SIOCGIFSLAVE ", " SIOCSIFSLAVE +.\" Get or set the slave device using +.\" .IR ifr_slave . +.\" Setting the slave device is a privileged operation. +.\" .PP +.\" FIXME add amateur radio stuff. +.PP +.\"O Most protocols support their own ioctls to configure protocol-specific +.\"O interface options. +.\"O See the protocol man pages for a description. +¤Û¤È¤ó¤É¤Î¥×¥í¥È¥³¥ë¤Ë¤Ï¡¢ÀìÍѤΥ¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥ª¥×¥·¥ç¥ó¤ò +ÀßÄꤹ¤ë¤¿¤á¤ÎÆȼ«¤Î ioctl ¤¬Â¸ºß¤¹¤ë¡£ +ÀâÌÀ¤Ï³Æ¥×¥í¥È¥³¥ë¤Î man ¥Ú¡¼¥¸¤ò¸«¤è¡£ +.PP +.\"O In addition some devices support private ioctls. +.\"O These are not described here. +¤µ¤é¤Ë¡¢¥Ç¥Ð¥¤¥¹¤Ë¤è¤Ã¤Æ¤Ï¥×¥é¥¤¥Ù¡¼¥È¤Ê ioctl ¤¬¤¢¤ë¡£ +¤³¤ì¤é¤Ï¤³¤³¤Ç¤ÏÀâÌÀ¤·¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Strictly speaking, +.\"O .B SIOCGIFCONF +.\"O is IP specific and belongs in +.\"O .BR ip (7). +¸·Ì©¤Ë¤¤¤¦¤È¡¢ +.B SIOCGIFCONF +¤Ï IP ¸ÇÍ­¤Ç¤¢¤ê¡¢ +.BR ip (7) +¤Ë°¤¹¤ë¡£ +.LP +.\"O The names of interfaces with no addresses or that don't have the +.\"O .B IFF_RUNNING +.\"O flag set can be found via +.\"O .IR /proc/net/dev . +¥¢¥É¥ì¥¹¤¬¤Ê¤«¤Ã¤¿¤ê¡¢ +.B IFF_RUNNING +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î̾Á°¤Ï +.I /proc/net/dev +¤ÇÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.LP +.\"O Local IPv6 IP addresses can be found via +.\"O .I /proc/net +.\"O or via +.\"O .BR rtnetlink (7). +¥í¡¼¥«¥ë IPV6 IP ¥¢¥É¥ì¥¹¤Ï +.I /proc/net +¤« +.BR rtnetlink (7) +¤ÇÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O glibc 2.1 is missing the +.\"O .I ifr_newname +.\"O macro in +.\"O .IR . +.\"O Add the following to your program as a workaround: +glibc 2.1 ¤Ç¤Ï +.I +¤Ë +.I ifr_newname +¥Þ¥¯¥í¤¬¤Ê¤¤¡£ +¤È¤ê¤¢¤¨¤º¤ÎÂбþºö¤È¤·¤Æ¡¢°Ê²¼¤Î¥³¡¼¥É¤òÄɲ䷤Ƥª¤¯¤³¤È¡£ +.sp +.in +4n +.nf +#ifndef ifr_newname +#define ifr_newname ifr_ifru.ifru_slave +#endif +.fi +.in +.RE +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR proc (5), +.BR capabilities (7), +.BR ip (7), +.BR rtnetlink (7) diff --git a/draft/man7/netlink.7 b/draft/man7/netlink.7 new file mode 100644 index 00000000..038dc770 --- /dev/null +++ b/draft/man7/netlink.7 @@ -0,0 +1,746 @@ +'\" t +.\" Don't change the first line, it tells man that tbl is needed. +.\" This man page is Copyright (c) 1998 by Andi Kleen. Subject to the GPL. +.\" Based on the original comments from Alexey Kuznetsov +.\" $Id: netlink.7,v 1.8 2000/06/22 13:23:00 ak Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06 by NAKANO Takeo +.\" Updated 2001-04-04 by Yuichi SATO , catch up to LDP v1.35 +.\" Updated 2006-06-23 by Yuichi SATO , catch up to LDP v2.29 +.\" +.\"WORD payload ¥Ú¥¤¥í¡¼¥É +.\"WORD capability ¸¢¸Â +.\" +.TH NETLINK 7 2008-11-11 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O netlink \- Communication between kernel and userspace (AF_NETLINK) +netlink \- ¥«¡¼¥Í¥ë¤È¥æ¡¼¥¶¡¼¶õ´Ö¤ÎÄÌ¿® (AF_NETLINK) +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include + +.BI "netlink_socket = socket(AF_NETLINK, " socket_type ", " netlink_family ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Netlink is used to transfer information between kernel and +.\"O userspace processes. +.\"O It consists of a standard sockets-based interface for userspace +.\"O processes and an internal kernel API for kernel modules. +.\"O The internal kernel interface is not documented in this manual page. +.\"O There is also an obsolete netlink interface +.\"O via netlink character devices; this interface is not documented here +.\"O and is only provided for backwards compatibility. +netlink ¤Ï¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤È¥æ¡¼¥¶¡¼¶õ´Ö¤Î¥×¥í¥»¥¹´Ö¤Ç +¾ðÊó¤ò¤ä¤ê¤È¤ê¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +netlink ¤Ï¡¢¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤ËÂФ·¤Æ¤Ï +ɸ½àŪ¤Ê¥½¥±¥Ã¥È¥Ù¡¼¥¹¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò¡¢ +¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤Ë¤Ï¥«¡¼¥Í¥ë¤ÎÆâÉô API ¤òÄ󶡤¹¤ë¡£ +¥«¡¼¥Í¥ëÆâÉô¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤Ä¤¤¤Æ¤Ï¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ïµ­½Ò¤·¤Ê¤¤¡£ +¤Þ¤¿¡¢netlink ¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹¤òÍѤ¤¤¿ +obsolete ¤Ê netlink ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤â¤¢¤ë¤¬¡¢¤³¤ì¤â¤³¤Îʸ½ñ¤Ç¤Ï²òÀ⤷¤Ê¤¤¡£ +¤³¤ì¤Ïñ¤Ë²áµî¸ß´¹À­¤Î¤¿¤á¤ËÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ë¤¹¤®¤Ê¤¤¡£ + +.\"O Netlink is a datagram-oriented service. +.\"O Both +.\"O .B SOCK_RAW +.\"O and +.\"O .B SOCK_DGRAM +.\"O are valid values for +.\"O .IR socket_type . +.\"O However, the netlink protocol does not distinguish between datagram +.\"O and raw sockets. +netlink ¤Ï¥Ç¡¼¥¿¥°¥é¥à»Ø¸þ¤Î¥µ¡¼¥Ó¥¹¤Ç¤¢¤ë¡£ +.I socket_type +¤Ë¤Ï +.B SOCK_RAW +¤È +.B SOCK_DGRAM +¤ÎξÊý¤È¤â»ØÄê²Äǽ¤Ç¤¢¤ë¡£ +¤·¤«¤· netlink ¥×¥í¥È¥³¥ë¤Ï¥Ç¡¼¥¿¥°¥é¥à¤È raw ¥½¥±¥Ã¥È¤Î¶èÊ̤ò¤·¤Ê¤¤¡£ + +.\"O .I netlink_family +.\"O selects the kernel module or netlink group to communicate with. +.\"O The currently assigned netlink families are: +.I netlink_family +¤Ï¡¢ÄÌ¿®¤¹¤ë¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤ä netlink ¥°¥ë¡¼¥×¤ÎÁªÂò¤ËÍѤ¤¤ë¡£ +¸½ºß³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë netlink ¥Õ¥¡¥ß¥ê¡¼¤Ï°Ê²¼¤ÎÄ̤ꡣ +.TP +.B NETLINK_ROUTE +.\"O Receives routing and link updates and may be used to modify the routing +.\"O tables (both IPv4 and IPv6), IP addresses, link parameters, +.\"O neighbor setups, queueing disciplines, traffic classes and +.\"O packet classifiers (see +.\"O .BR rtnetlink (7)). +¥ë¡¼¥Æ¥£¥ó¥°¤È¥ê¥ó¥¯¤Î¹¹¿·¤ò¼õ¿®¤¹¤ë¡£ +(IPv4 ¤È IPv6 ξÊý¤Î) ¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¡¦ +IP ¥¢¥É¥ì¥¹¡¦¥ê¥ó¥¯¥Ñ¥é¥á¡¼¥¿¡¦¶á˵ÀßÄê (neighbor setup)¡¦ +¥­¥å¡¼¥¤¥ó¥°¥ë¡¼¥ë (queueing dicipline)¡¦¥È¥é¥Õ¥£¥Ã¥¯¥¯¥é¥¹¡¦ +¥Ñ¥±¥Ã¥È¤Î¥¯¥é¥¹Ê¬Îà¤Î½¤Àµ¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¤À¤í¤¦ +.RB ( rtnetlink (7) +¤ò¸«¤è)¡£ +.TP +.B NETLINK_W1 +.\"O Messages from 1-wire subsystem. +ñÀþ (1-wire) ¤Î¥µ¥Ö¥·¥¹¥Æ¥à¤«¤é¤Î¥á¥Ã¥»¡¼¥¸¡£ +.TP +.B NETLINK_USERSOCK +.\"O Reserved for user-mode socket protocols. +¥æ¡¼¥¶¡¼¥â¡¼¥É¥½¥±¥Ã¥È¥×¥í¥È¥³¥ë¤Î¤¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.TP +.B NETLINK_FIREWALL +.\"O Transport IPv4 packets from netfilter to userspace. +.\"O Used by +.\"O .I ip_queue +.\"O kernel module. +IPv4 ¥Ñ¥±¥Ã¥È¤ò netfilter ¤«¤é¥æ¡¼¥¶¡¼¶õ´Ö¤ØžÁ÷¤¹¤ë¡£ +.I ip_queue +¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤Ç»ÈÍѤµ¤ì¤ë¡£ +.TP +.B NETLINK_INET_DIAG +.\" FIXME More details on NETLINK_INET_DIAG needed. +.\"O INET socket monitoring. +INET ¥½¥±¥Ã¥È¤ò¥â¥Ë¥¿¥ê¥ó¥°¤¹¤ë¡£ +.TP +.B NETLINK_NFLOG +Netfilter/iptables ULOG. +.TP +.B NETLINK_XFRM +.\" FIXME More details on NETLINK_XFRM needed. +IPsec. +.TP +.B NETLINK_SELINUX +.\"O SELinux event notifications. +SELinux ¤Î¥¤¥Ù¥ó¥ÈÄÌÃΡ£ +.TP +.B NETLINK_ISCSI +.\" FIXME More details on NETLINK_ISCSI needed. +Open-iSCSI. +.TP +.B NETLINK_AUDIT +.\" FIXME More details on NETLINK_AUDIT needed. +.\"O Auditing. +´Æºº (audit) ¤ò¹Ô¤¦¡£ +.TP +.B NETLINK_FIB_LOOKUP +.\" FIXME More details on NETLINK_FIB_LOOKUP needed. +.\"O Access to FIB lookup from userspace. +¥æ¡¼¥¶¡¼¶õ´Ö¤«¤é FIB ¥ë¥Ã¥¯¥¢¥Ã¥×¤Ë¥¢¥¯¥»¥¹¤¹¤ë¡£ +.TP +.B NETLINK_CONNECTOR +.\"O Kernel connector. +.\"O See +.\"O .I Documentation/connector/* +.\"O in the kernel source for further information. +¥«¡¼¥Í¥ë¥³¥Í¥¯¥¿¡£ +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¥«¡¼¥Í¥ë¥½¡¼¥¹¤Î +.I Documentation/connector/* +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.B NETLINK_NETFILTER +.\" FIXME More details on NETLINK_NETFILTER needed. +.\"O Netfilter subsystem. +netfilter ¥µ¥Ö¥·¥¹¥Æ¥à¡£ +.TP +.B NETLINK_IP6_FW +.\"O Transport IPv6 packets from netfilter to userspace. +.\"O Used by +.\"O .I ip6_queue +.\"O kernel module. +IPv6 ¥Ñ¥±¥Ã¥È¤ò netfilter ¤«¤é¥æ¡¼¥¶¡¼¶õ´Ö¤ØžÁ÷¤¹¤ë¡£ +.I ip6_queue +¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤Ç»ÈÍѤµ¤ì¤ë¡£ +.TP +.B NETLINK_DNRTMSG +.\"O DECnet routing messages. +DECnet ¥ë¡¼¥Æ¥£¥ó¥°¥á¥Ã¥»¡¼¥¸¡£ +.TP +.B NETLINK_KOBJECT_UEVENT +.\" FIXME More details on NETLINK_KOBJECT_UEVENT needed. +.\"O Kernel messages to userspace. +¥æ¡¼¥¶¡¼¶õ´Ö¤Ø¤Î¥«¡¼¥Í¥ë¥á¥Ã¥»¡¼¥¸ +.TP +.B NETLINK_GENERIC +.\"O Generic netlink family for simplified netlink usage. +netlink ¤ò´Êñ¤Ë»ÈÍѤ¹¤ë¤¿¤á¤Î°ìÈÌŪ¤Ê netlink ¥Õ¥¡¥ß¥ê¡¼¡£ +.PP +.\"O Netlink messages consist of a byte stream with one or multiple +.\"O .I nlmsghdr +.\"O headers and associated payload. +netlink ¥á¥Ã¥»¡¼¥¸¤Ï¥Ð¥¤¥È¥¹¥È¥ê¡¼¥à¤«¤é¤Ê¤ê¡¢ +°ì¤Ä°Ê¾å¤Î +.I nlmsghdr +¥Ø¥Ã¥À¤È¡¢¤½¤ì¤ËÂбþ¤¹¤ë¥Ú¥¤¥í¡¼¥É (payload) ¤¬´Þ¤Þ¤ì¤ë¡£ +.\"O The byte stream should only be accessed with the standard +.\"O .B NLMSG_* +.\"O macros. +.\"O See +.\"O .BR netlink (3) +.\"O for further information. +¥Ð¥¤¥È¥¹¥È¥ê¡¼¥à¤Ë¤Ï¡¢É¸½à¤Î +.B NLMSG_* +¥Þ¥¯¥í¤Ë¤è¤Ã¤Æ¤Î¤ß¥¢¥¯¥»¥¹¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR netlink (3) +¤ò¸«¤è¡£ + +.\"O In multipart messages (multiple +.\"O .I nlmsghdr +.\"O headers with associated payload in one byte stream) the first and all +.\"O following headers have the +.\"O .B NLM_F_MULTI +.\"O flag set, except for the last header which has the type +.\"O .BR NLMSG_DONE . +¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸ (°ì¤Ä°Ê¾å¤Î +.I nlmsghdr +¥Ø¥Ã¥À¤È¡¢¤½¤ì¤ËÂбþ¤¹¤ë¥Ú¥¤¥í¡¼¥É¤¬ +°ì¤Ä¥Ð¥¤¥È¥¹¥È¥ê¡¼¥à¤Ë´Þ¤Þ¤ì¤ë) ¤Ë¤ª¤¤¤Æ¤Ï¡¢ +ÀèƬ¤Î¥Ø¥Ã¥À¡¦¸å³¤Î¥Ø¥Ã¥À¤Ë¤Ï +.B NLM_F_MULTI +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£¤¿¤À¤·ºÇ¸å¤Î¥Ø¥Ã¥À¤À¤±¤ÏÎã³°¤Ç¡¢ +.B NLMSG_DONE +¥¿¥¤¥×¤È¤Ê¤ë¡£ + +.\"O After each +.\"O .I nlmsghdr +.\"O the payload follows. +¤½¤ì¤¾¤ì¤Î +.B nlmsghdr +¤Î¸å¤Ë¤Ï¥Ú¥¤¥í¡¼¥É¤¬Â³¤¯¡£ + +.in +4n +.nf +struct nlmsghdr { +.\"O __u32 nlmsg_len; /* Length of message including header. */ +.\"O __u16 nlmsg_type; /* Type of message content. */ +.\"O __u16 nlmsg_flags; /* Additional flags. */ +.\"O __u32 nlmsg_seq; /* Sequence number. */ +.\"O __u32 nlmsg_pid; /* PID of the sending process. */ + __u32 nlmsg_len; /* ¥Ø¥Ã¥À¤ò´Þ¤à¥á¥Ã¥»¡¼¥¸¤ÎŤµ */ + __u16 nlmsg_type; /* ¥á¥Ã¥»¡¼¥¸¤ÎÆâÍƤΥ¿¥¤¥× */ + __u16 nlmsg_flags; /* Äɲåե饰 */ + __u32 nlmsg_seq; /* ¥·¡¼¥±¥ó¥¹ÈÖ¹æ */ + __u32 nlmsg_pid; /* Á÷¿®¥×¥í¥»¥¹¤Î PID */ +}; +.fi +.in + +.\"O .I nlmsg_type +.\"O can be one of the standard message types: +.\"O .B NLMSG_NOOP +.\"O message is to be ignored, +.\"O .B NLMSG_ERROR +.\"O message signals an error and the payload contains an +.\"O .I nlmsgerr +.\"O structure, +.\"O .B NLMSG_DONE +.\"O message terminates a multipart message. +.I nlmsg_type +¤Ïɸ½à¤Î¥á¥Ã¥»¡¼¥¸¥¿¥¤¥×¤Î¤É¤ì¤«°ì¤Ä¤Ç¤¢¤ë: +.B NLMSG_NOOP +¥á¥Ã¥»¡¼¥¸¤Ï̵»ë¤µ¤ì¤ë¡£ +.B NLMSG_ERROR +¥á¥Ã¥»¡¼¥¸¤Ï¥¨¥é¡¼¤ò¼¨¤·¡¢¥Ú¥¤¥í¡¼¥É¤Ë¤Ï +.I nlmsgerr +¹½Â¤ÂΤ¬Æþ¤ë¡£ +.B NLMSG_DONE +¥á¥Ã¥»¡¼¥¸¤Ï¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸¤Î½ªÎ»¤òÅÁ¤¨¤ë¡£ + +.in +4n +.nf +struct nlmsgerr { +.\"O int error; /* Negative errno or 0 for acknowledgements */ +.\"O struct nlmsghdr msg; /* Message header that caused the error */ + int error; /* Éé¤Þ¤¿¤Ï 0 ¤Î errno ¤Ï±þÅú¤òɽ¤¹ */ + struct nlmsghdr msg; /* ¥¨¥é¡¼¤òµ¯¤³¤·¤¿¥á¥Ã¥»¡¼¥¸¤Î¥Ø¥Ã¥À */ +}; +.fi +.in + +.\"O A netlink family usually specifies more message types, see the +.\"O appropriate manual pages for that, for example, +.\"O .BR rtnetlink (7) +.\"O for +.\"O .BR NETLINK_ROUTE . +¤¢¤ë netlink ¥Õ¥¡¥ß¥ê¡¼¤Ç»ØÄê¤Ç¤­¤ë¥á¥Ã¥»¡¼¥¸¥¿¥¤¥×¤Ï¡¢ +Ä̾ï¤â¤Ã¤È¿¤¤¡£¤³¤ì¤é¤Ë´Ø¤·¤Æ¤ÏŬÀÚ¤Ê man ¥Ú¡¼¥¸¤ò¸«¤Æ¤Û¤·¤¤¡£ +¤¿¤È¤¨¤Ð +.B NETLINK_ROUTE +¤Ë´Ø¤·¤Æ¤Ï +.BR rtnetlink (7) +¤Ë½ñ¤¤¤Æ¤¢¤ë¡£ + +.\"O Standard flag bits in +.\"O .I nlmsg_flags +.I nlmsg_flags +¤Îɸ½à¥Õ¥é¥°¥Ó¥Ã¥È +.br +--------------------------------- +.TS +tab(:); +lB l. +.\"O NLM_F_REQUEST:Must be set on all request messages. +.\"O NLM_F_MULTI:T{ +.\"O The message is part of a multipart message terminated by +.\"O .BR NLMSG_DONE . +.\"O T} +.\"O NLM_F_ACK:Request for an acknowledgment on success. +.\"O NLM_F_ECHO:Echo this request. +NLM_F_REQUEST:Í×µá¥á¥Ã¥»¡¼¥¸Á´¤Æ¤Ç¥»¥Ã¥È¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +NLM_F_MULTI:T{ +¤³¤Î¥á¥Ã¥»¡¼¥¸¤Ï¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸¤Î°ìÉô¤Ç¤¢¤ë¡£ +¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸¤Ï +.B NLMSG_DONE +¤Ç½ªÃ¼¤¹¤ë¡£ +T} +NLM_F_ACK:À®¸ù¤·¤¿¾ì¹ç¤Î±þÅú¤òÍ׵᤹¤ë¡£ +NLM_F_ECHO:¤³¤ÎÍ×µá¤ò¥¨¥³¡¼¤¹¤ë¡£ +.TE + +.\"O Additional flag bits for GET requests +GET Í×µá¤Ë¤ª¤±¤ëÄɲåե饰¥Ó¥Ã¥È +.br +------------------------------------- +.TS +tab(:); +lB l. +.\"O NLM_F_ROOT:Return the complete table instead of a single entry. +.\"O NLM_F_MATCH:T{ +.\"O Return all entries matching criteria passed in message content. +.\"O Not implemented yet. +.\"O T} +.\" FIXME NLM_F_ATOMIC is not used any more? +.\"O NLM_F_ATOMIC:Return an atomic snapshot of the table. +.\"O NLM_F_DUMP:Convenience macro; equivalent to (NLM_F_ROOT|NLM_F_MATCH). +NLM_F_ROOT:ñ°ì¤Î¥¨¥ó¥È¥ê¤Ç¤Ï¤Ê¤¯¥Æ¡¼¥Ö¥ëÁ´ÂΤòÊÖ¤¹¡£ +NLM_F_MATCH:T{ +¥á¥Ã¥»¡¼¥¸¤ÎÆâÍƤÇÅϤµ¤ì¤¿´ð½à (criteria) ¤Ë¥Þ¥Ã¥Á¤¹¤ë +Á´¤Æ¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +T} +NLM_F_ATOMIC:¥Æ¡¼¥Ö¥ë¤Î¥¢¥È¥ß¥Ã¥¯¤Ê¥¹¥Ê¥Ã¥×¥·¥ç¥Ã¥È¤òÊÖ¤¹¡£ +NLM_F_DUMP:ÊØÍø¤Ê¥Þ¥¯¥í¡£(NLM_F_ROOT|NLM_F_MATCH) ¤ÈƱ¤¸¡£ +.TE + +.\"O Note that +.\"O .B NLM_F_ATOMIC +.\"O requires the +.\"O .B CAP_NET_ADMIN +.\"O capability or an effective UID of 0. +.B NLM_F_ATOMIC +¤ò»È¤¦¾ì¹ç¤Ï¡¢ +.B CAP_NET_ADMIN +¸¢¸Â¤ò»ý¤Ä¤«¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ + +.\"O Additional flag bits for NEW requests +NEW Í×µá¤Ë¤ª¤±¤ëÄɲåե饰¥Ó¥Ã¥È +.br +------------------------------------- +.TS +tab(:); +lB l. +.\"O NLM_F_REPLACE:Replace existing matching object. +.\"O NLM_F_EXCL:Don't replace if the object already exists. +.\"O NLM_F_CREATE:Create object if it doesn't already exist. +.\"O NLM_F_APPEND:Add to the end of the object list. +NLM_F_REPLACE:¸½Â¸¤Î¥ª¥Ö¥¸¥§¥¯¥È¤òÃÖ´¹¤¹¤ë¡£ +NLM_F_EXCL:¤¹¤Ç¤Ë¥ª¥Ö¥¸¥§¥¯¥È¤¬¤¢¤Ã¤¿¤éÃÖ´¹¤·¤Ê¤¤¡£ +NLM_F_CREATE:¤Þ¤À¥ª¥Ö¥¸¥§¥¯¥È¤¬¤Ê¤±¤ì¤ÐºîÀ®¤¹¤ë¡£ +NLM_F_APPEND:¥ª¥Ö¥¸¥§¥¯¥È¥ê¥¹¥È¤ÎºÇ¸å¤ËÄɲ乤롣 +.TE + +.\"O .I nlmsg_seq +.\"O and +.\"O .I nlmsg_pid +.\"O are used to track messages. +.I nlmsg_seq +¤È +.I nlmsg_pid +¤Ï¥á¥Ã¥»¡¼¥¸¤ÎÄÉÀפ˻ÈÍѤµ¤ì¤ë¡£ +.\"O .I nlmsg_pid +.\"O shows the origin of the message. +.I nlmsg_pid +¤Ï¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®¸µ¤òɽ¤¹¡£ +.\"O Note that there isn't a 1:1 relationship between +.\"O .I nlmsg_pid +.\"O and the PID of the process if the message originated from a netlink +.\"O socket. +¥á¥Ã¥»¡¼¥¸¤¬ netlink ¥½¥±¥Ã¥È¤ÇÁ÷¿®¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.I nlmsg_pid +¤È¥×¥í¥»¥¹¤Î PID ¤Ï 1:1 ¤Î´Ø·¸¤Ç¤Ï¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.\"O See the +.\"O .B ADDRESS FORMATS +.\"O section for further information. +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¡¢ +.RB ¡Ö ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È ¡× +¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È¤¹¤ë¤³¤È¡£ + +.\"O Both +.\"O .I nlmsg_seq +.\"O and +.\"O .I nlmsg_pid +.\"O .\" FIXME Explain more about nlmsg_seq and nlmsg_pid. +.\"O are opaque to netlink core. +.I nlmsg_seq +¤È +.I nlmsg_pid +¤Ï netlink ¤Î¥³¥¢¤Ë¤Ï¸«¤¨¤Ê¤¤ (opaque)¡£ + +.\"O Netlink is not a reliable protocol. +netlink ¤Ï¿®ÍêÀ­¤Î¹â¤¤¥×¥í¥È¥³¥ë¤Ç¤Ï¤Ê¤¤¡£ +.\"O It tries its best to deliver a message to its destination(s), +.\"O but may drop messages when an out-of-memory condition or +.\"O other error occurs. +.\"O For reliable transfer the sender can request an +.\"O acknowledgement from the receiver by setting the +.\"O .B NLM_F_ACK +.\"O flag. +.\"O An acknowledgment is an +.\"O .B NLMSG_ERROR +.\"O packet with the error field set to 0. +netlink ¤Ï¥á¥Ã¥»¡¼¥¸¤ò¹Ô¤­Àè¤ËÆϤ±¤ë¤¿¤á¤ËºÇÁ±¤ò¿Ô¤¯¤¹¤¬¡¢ +¥á¥â¥ê¤¬Â­¤ê¤Ê¤«¤Ã¤¿¤ê¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¤¹¤ë¤È +¥á¥Ã¥»¡¼¥¸¤ò¼è¤ê¤³¤Ü¤¹¤³¤È¤â¤¢¤ë¡£ +¿®ÍêÀ­¤Î¹â¤¤Å¾Á÷¤ò¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +Á÷¿®¼Ô¤Ï¼õ¿®¼Ô¤Ë±þÅú¤òÍ׵᤹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤Ï +.B NLM_F_ACK +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +±þÅú¤Ï +.B NLMSG_ERROR +¥Ñ¥±¥Ã¥È¤Î¥¨¥é¡¼¥Õ¥£¡¼¥ë¥É¤ò 0 ¤Ë¤·¤¿¤â¤Î¤Ë¤Ê¤ë¡£ +.\"O The application must generate acknowledgements for +.\"O received messages itself. +.\"O The kernel tries to send an +.\"O .B NLMSG_ERROR +.\"O message for every failed packet. +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¼«Ê¬¼«¿È¤Î¥á¥Ã¥»¡¼¥¸¤ò¼õ¤±¤¿¤È¤­¤Ë¤Ï¡¢ +±þÅú¤òÀ¸À®¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥«¡¼¥Í¥ë¤Ï¼ºÇÔ¤·¤¿¥Ñ¥±¥Ã¥È¤ËÂФ·¤Æ¡¢ +.B NLMSG_ERROR +¥á¥Ã¥»¡¼¥¸¤òÁ÷¤í¤¦¤È¤¹¤ë¡£ +.\"O A user process should follow this convention too. +¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤Ï¤³¤Î´·½¬¤Ë¤â½¾¤¦É¬Íפ¬¤¢¤ë¡£ + +.\"O However, reliable transmissions from kernel to user are impossible +.\"O in any case. +¤·¤«¤·¡¢¤É¤Î¤è¤¦¤Ê¾ì¹ç¤Ç¤â¥«¡¼¥Í¥ë¤«¤é¥æ¡¼¥¶¡¼¤Ø¤Î +¿®ÍêÀ­¤Î¹â¤¤Å¾Á÷¤ÏÉÔ²Äǽ¤Ç¤¢¤ë¡£ +.\"O The kernel can't send a netlink message if the socket buffer is full: +.\"O the message will be dropped and the kernel and the userspace process will +.\"O no longer have the same view of kernel state. +¥½¥±¥Ã¥È¥Ð¥Ã¥Õ¥¡¤¬ËþÇդξì¹ç¡¢¥«¡¼¥Í¥ë¤Ï netlink ¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤Ç¤­¤Ê¤¤¡£ +¥á¥Ã¥»¡¼¥¸¤Ï¼è¤ê¤³¤Ü¤µ¤ì¤Æ¡¢¥«¡¼¥Í¥ë¤È¥æ¡¼¥¶¡¼¶õ´Ö¥×¥í¥»¥¹¤Ï¡¢ +¥«¡¼¥Í¥ë¤Î¾õÂ֤ˤĤ¤¤Æ¤ÎƱ¤¸¥Ó¥å¡¼¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +.\"O It is up to the application to detect when this happens (via the +.\"O .B ENOBUFS +.\"O error returned by +.\"O .BR recvmsg (2)) +.\"O and resynchronize. +¤³¤ì¤¬µ¯¤³¤Ã¤¿¤³¤È +.RB ( recvmsg (2) +¤Ë¤è¤Ã¤Æ +.B ENOBUFS +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë) ¤ò¸¡ÃΤ·¤ÆºÆ¤ÓƱ´ü¤µ¤»¤ë¤Î¤Ï¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÀÕǤ¤Ç¤¢¤ë¡£ +.\"O .SS Address Formats +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.\"O The +.\"O .I sockaddr_nl +.\"O structure describes a netlink client in user space or in the kernel. +.\"O A +.\"O .I sockaddr_nl +.\"O can be either unicast (only sent to one peer) or sent to +.\"O netlink multicast groups +.\"O .RI ( nl_groups +.\"O not equal 0). +.I sockaddr_nl +¹½Â¤ÂΤϥ桼¥¶¡¼¶õ´Ö¤ä¥«¡¼¥Í¥ë¶õ´Ö¤Ç netlink ¥¯¥é¥¤¥¢¥ó¥È¤òµ­½Ò¤¹¤ë¡£ +.I sockaddr_nl +¤Ï¥æ¥Ë¥­¥ã¥¹¥È (ñ°ì¤ÎÀܳÀè¤Ë¤À¤±Á÷¤é¤ì¤ë) ¤Ë¤â¤Ç¤­¤ë¤·¡¢ +netlink ¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥× +.RI ( nl_groups +¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç) ¤Ë¤âÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.in +4n +.nf +struct sockaddr_nl { +.\"O sa_family_t nl_family; /* AF_NETLINK */ +.\"O unsigned short nl_pad; /* Zero. */ +.\"O pid_t nl_pid; /* Process ID. */ +.\"O __u32 nl_groups; /* Multicast groups mask. */ + sa_family_t nl_family; /* AF_NETLINK */ + unsigned short nl_pad; /* 0 ¤Ç¤¢¤ë */ + pid_t nl_pid; /* ¥×¥í¥»¥¹ ID */ + __u32 nl_groups; /* ¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¥Þ¥¹¥¯ */ +}; +.fi +.in + +.\"O .I nl_pid +.\"O is the unicast address of netlink socket. +.\"O It's always 0 if the destination is in the kernel. +.I nl_pid +¤Ï netlink ¥½¥±¥Ã¥È¤Î¥æ¥Ë¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +¹Ô¤­À褬¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï¡¢¾ï¤Ë 0 ¤Ç¤¢¤ë¡£ +.\"O For a userspace process, +.\"O .I nl_pid +.\"O is usually the PID of the process owning the destination socket. +¥æ¡¼¥¶¡¼¶õ´Ö¥×¥í¥»¥¹¤Î¾ì¹ç¡¢Ä̾ï¤Ï +.I nl_pid +¤Ï¹Ô¤­Àè¤Î¥½¥±¥Ã¥È¤ò½êÍ­¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î PID ¤Ç¤¢¤ë¡£ +.\"O However, +.\"O .I nl_pid +.\"O identifies a netlink socket, not a process. +¤¿¤À¤·¡¢ +.I nl_pid +¤Ï¥×¥í¥»¥¹¤Ç¤Ï¤Ê¤¯ netlink ¥½¥±¥Ã¥È¤òƱÄꤹ¤ë¡£ +.\"O If a process owns several netlink +.\"O sockets, then +.\"O .I nl_pid +.\"O can only be equal to the process ID for at most one socket. +¥×¥í¥»¥¹¤¬Ê£¿ô¤Î netlink ¥½¥±¥Ã¥È¤ò½êÍ­¤¹¤ë¾ì¹ç¡¢ +.I nl_pid +¤ÏºÇÂç¤Ç¤â°ì¤Ä¤Î¥½¥±¥Ã¥È¤Î¥×¥í¥»¥¹ ID ¤È¤·¤«Åù¤·¤¯¤Ê¤é¤Ê¤¤¡£ +.\"O There are two ways to assign +.\"O .I nl_pid +.\"O to a netlink socket. +.I nl_pid +¤ò netlink ¥½¥±¥Ã¥È¤Ë³ä¤êÅö¤Æ¤ëÊýË¡¤Ï 2 ¤Ä¤¢¤ë¡£ +.\"O If the application sets +.\"O .I nl_pid +.\"O before calling +.\"O .BR bind (2), +.\"O then it is up to the application to make sure that +.\"O .I nl_pid +.\"O is unique. +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ +.BR bind (2) +¤ò¸Æ¤ÖÁ°¤Ë +.I nl_pid +¤òÀßÄꤹ¤ë¾ì¹ç¡¢ +.I nl_pid +¤¬°ì°Õ¤Ç¤¢¤ë¤³¤È¤ò³Îǧ¤¹¤ë¤Î¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÀÕǤ¤È¤Ê¤ë¡£ +.\"O If the application sets it to 0, the kernel takes care of assigning it. +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ +.I nl_pid +¤ò 0 ¤ËÀßÄꤷ¤¿¾ì¹ç¡¢¥«¡¼¥Í¥ë¤¬¤³¤ÎÃͤò³ä¤êÅö¤Æ¤ë¡£ +.\"O The kernel assigns the process ID to the first netlink socket the process +.\"O opens and assigns a unique +.\"O .I nl_pid +.\"O to every netlink socket that the process subsequently creates. +¥«¡¼¥Í¥ë¤Ï¥×¥í¥»¥¹¤¬ºÇ½é¤Ë¥ª¡¼¥×¥ó¤·¤¿ +netlink ¥½¥±¥Ã¥È¤ËÂФ·¤Æ¥×¥í¥»¥¹ ID ¤ò³ä¤êÅö¤Æ¡¢ +¤½¤ì°Ê¹ß¤Ë¥×¥í¥»¥¹¤¬ºîÀ®¤·¤¿Á´¤Æ¤Î netlink ¥½¥±¥Ã¥È¤Ë¤â°ì°Õ¤Ê +.I nl_pid +¤ò³ä¤êÅö¤Æ¤ë¡£ + +.\"O .I nl_groups +.\"O is a bit mask with every bit representing a netlink group number. +.I nl_groups +¤Ï¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¡¢¤¹¤Ù¤Æ¤Î¥Ó¥Ã¥È¤¬ netlink ¥°¥ë¡¼¥×ÈÖ¹æ¤òɽ¤¹¡£ +.\"O Each netlink family has a set of 32 multicast groups. +¤½¤ì¤¾¤ì¤Î netlink ¥Õ¥¡¥ß¥ê¡¼¤Ï 32 ¤Î¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Î¥»¥Ã¥È¤ò»ý¤Ä¡£ +.\"O When +.\"O .BR bind (2) +.\"O is called on the socket, the +.\"O .I nl_groups +.\"O field in the +.\"O .I sockaddr_nl +.\"O should be set to a bit mask of the groups which it wishes to listen to. +¤½¤ì¤¾¤ì¤Î netlink ¥Õ¥¡¥ß¥ê¡¼¤Ï 32 ¤Î¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Î +¥»¥Ã¥È¤ò»ý¤Ä¡£ +.BR bind (2) +¤¬¥½¥±¥Ã¥È¤ËÂФ·¤Æ¸Æ¤Ð¤ì¤ë¤È¡¢ +.I sockaddr_nl +¤Î +.I nl_groups +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï listen ¤·¤¿¤¤¥°¥ë¡¼¥×¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O The default value for this field is zero which means that no multicasts +.\"O will be received. +.\"O A socket may multicast messages to any of the multicast groups by setting +.\"O .I nl_groups +.\"O to a bit mask of the groups it wishes to send to when it calls +.\"O .BR sendmsg (2) +.\"O or does a +.\"O .BR connect (2). +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï 0 ¤Ç¡¢¥Þ¥ë¥Á¥­¥ã¥¹¥È¤ò°ìÀÚ¼õ¿®¤·¤Ê¤¤¡£ +.BR sendmsg (2) +¤ä +.BR connect (2) +¤Ë¤è¤Ã¤Æ¡¢¤¢¤ë¥½¥±¥Ã¥È¤«¤é¥á¥Ã¥»¡¼¥¸¤ò¥Þ¥ë¥Á¥­¥ã¥¹¥È¤·¤¿¤¤¤È¤­¤Ï¡¢ +.I nl_groups +¤ËÁ÷¿®¤·¤¿¤¤¥°¥ë¡¼¥×¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤ò¥»¥Ã¥È¤¹¤ì¤Ð¤è¤¤¡£ +.\"O Only processes with an effective UID of 0 or the +.\"O .B CAP_NET_ADMIN +.\"O capability may send or listen to a netlink multicast group. +¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤«¡¢ +.B CAP_NET_ADMIN +¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¡¼¤Î¤ß¤¬ netlink ¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Ë +Á÷¿®¤·¤¿¤ê¡¢¤³¤ì¤ò listen ¤·¤¿¤ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O Any replies to a message received for a multicast group should be +.\"O sent back to the sending PID and the multicast group. +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¸þ¤±¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤·¤¿¾ì¹ç¡¢¤³¤ìÂФ¹¤ë±þÅú¤Ï +Á÷¤ê¼ç¤Î PID ¤È¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤È¤ËÁ÷¤êÊÖ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The socket interface to netlink is a new feature of Linux 2.2. +netlink ¤Ø¤Î¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï Linux 2.2 ¤Î¿·µ¡Ç½¤Ç¤¢¤ë¡£ + +.\"O Linux 2.0 supported a more primitive device based netlink interface +.\"O (which is still available as a compatibility option). +.\"O This obsolete interface is not described here. +Linux 2.0 ¤Ï¡¢¤â¤Ã¤È¸¶»ÏŪ¤Ê¥Ç¥Ð¥¤¥¹¥Ù¡¼¥¹¤Î netlink ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò +¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤¿ (¤³¤ì¤â¸ß´¹À­¤Î¤¿¤á¤Ëº£¤Ç¤â»ÈÍѤǤ­¤ë)¡£ +¸Å¤¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë´Ø¤·¤Æ¤Ï¤³¤³¤Ç¤Ïµ­½Ò¤·¤Ê¤¤¡£ + +.\"O NETLINK_SELINUX appeared in Linux 2.6.4. +NETLINK_SELINUX ¤Ï Linux 2.6.4 ¤ÇÅо줷¤¿¡£ + +.\"O NETLINK_AUDIT appeared in Linux 2.6.6. +NETLINK_AUDIT ¤Ï Linux 2.6.6 ¤ÇÅо줷¤¿¡£ + +.\"O NETLINK_KOBJECT_UEVENT appeared in Linux 2.6.10. +NETLINK_KOBJECT_UEVENT ¤Ï Linux 2.6.10 ¤ÇÅо줷¤¿¡£ + +.\"O NETLINK_W1 and NETLINK_FIB_LOOKUP appeared in Linux 2.6.13. +NETLINK_W1, NETLINK_FIB_LOOKUP ¤Ï Linux 2.6.13 ¤ÇÅо줷¤¿¡£ + +.\"O NETLINK_INET_DIAG, NETLINK_CONNECTOR and NETLINK_NETFILTER appeared in +.\"O Linux 2.6.14. +NETLINK_INET_DIAG, NETLINK_CONNECTOR, NETLINK_NETFILTER ¤Ï +Linux 2.6.14 ¤ÇÅо줷¤¿¡£ + +.\"O NETLINK_GENERIC and NETLINK_ISCSI appeared in Linux 2.6.15. +NETLINK_GENERIC, NETLINK_ISCSI ¤Ï Linux 2.6.15 ¤ÇÅо줷¤¿¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O It is often better to use netlink via +.\"O .I libnetlink +.\"O or +.\"O .I libnl +.\"O than via the low-level kernel interface. +Äã¥ì¥Ù¥ë¤Î¥«¡¼¥Í¥ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤è¤ê¡¢ +.I libnetlink +¤Þ¤¿¤Ï +.I libnl +¤òÄ̤·¤Æ netlink ¤òÍøÍѤ¹¤ë¤Û¤¦¤¬Îɤ¤¤³¤È¤¬Â¿¤¤¡£ +.\"O .SH BUGS +.\"O This manual page is not complete. +.SH ¥Ð¥° +¤³¤Î man ¥Ú¡¼¥¸¤Ï´°À®¤·¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O The following example creates a +.\"O .B NETLINK_ROUTE +.\"O netlink socket which will listen to the +.\"O .B RTMGRP_LINK +.\"O (network interface create/delete/up/down events) and +.\"O .B RTMGRP_IPV4_IFADDR +.\"O (IPv4 addresses add/delete events) multicast groups. +°Ê²¼¤ÎÎã¤Ç¤Ï¡¢ +.B RTMGRP_LINK +(¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î create/delete/up/down ¥¤¥Ù¥ó¥È) ¤È +.B RTMGRP_IPV4_IFADDR +(IPv4 ¥¢¥É¥ì¥¹¤Î add/delete ¥¤¥Ù¥ó¥È) ¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤ò listen ¤¹¤ë +.B NETLINK_ROUTE +netlink ¤òºîÀ®¤·¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct sockaddr_nl sa; + +memset(&sa, 0, sizeof(sa)); +sa.nl_family = AF_NETLINK; +sa.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR; + +fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); +bind(fd, (struct sockaddr *) &sa, sizeof(sa)); +.fi +.in + +.\"O The next example demonstrates how to send a netlink message to the +.\"O kernel (pid 0). +.\"O Note that application must take care of message sequence numbers +.\"O in order to reliably track acknowledgements. +¼¡¤ÎÎã¤Ç¤Ï¡¢netlink ¥á¥Ã¥»¡¼¥¸¤ò¥«¡¼¥Í¥ë (pid 0) ¤ËÁ÷¤ëÊýË¡¤ò¼¨¤·¤Æ¤¤¤ë¡£ +±þÅú¤òÄÉÀפ¹¤ëºÝ¤Î¿®ÍêÀ­¤ò¹â¤á¤ë¤¿¤á¤Ë¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ +¥á¥Ã¥»¡¼¥¸¤Î¥·¡¼¥±¥ó¥¹ÈÖ¹æ¤òÀµ¤·¤¯½èÍý¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ + +.in +4n +.nf +.\"O struct nlmsghdr *nh; /* The nlmsghdr with payload to send. */ +struct nlmsghdr *nh; /* Á÷¿®¤¹¤ë nlmsghdr ¤È¥Ú¥¤¥í¡¼¥É */ +struct sockaddr_nl sa; +struct iovec iov = { (void *) nh, nh\->nlmsg_len }; +struct msghdr msg; + +msg = { (void *)&sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; +memset(&sa, 0, sizeof(sa)); +sa.nl_family = AF_NETLINK; +nh\->nlmsg_pid = 0; +nh\->nlmsg_seq = ++sequence_number; +.\"O /* Request an ack from kernel by setting NLM_F_ACK. */ +/* NLM_F_ACK ¤òÀßÄꤹ¤ë¤³¤È¤Ç¡¢¥«¡¼¥Í¥ë¤Ë±þÅú¤òÍ׵᤹¤ë */ +nh\->nlmsg_flags |= NLM_F_ACK; + +sendmsg(fd, &msg, 0); +.fi +.in + +.\"O And the last example is about reading netlink message. +ºÇ¸å¤Ï¡¢netlink ¥á¥Ã¥»¡¼¥¸¤ÎÆɤ߹þ¤ß¤ÎÎã¤Ç¤¢¤ë¡£ + +.in +4n +.nf +int len; +char buf[4096]; +struct iovec iov = { buf, sizeof(buf) }; +struct sockaddr_nl sa; +struct msghdr msg; +struct nlmsghdr *nh; + +msg = { (void *)&sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; +len = recvmsg(fd, &msg, 0); + +for (nh = (struct nlmsghdr *) buf; NLMSG_OK (nh, len); + nh = NLMSG_NEXT (nh, len)) { +.\"O /* The end of multipart message. */ + /* ¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸¤Î½ª¤ï¤ê */ + if (nh\->nlmsg_type == NLMSG_DONE) + return; + + if (nh\->nlmsg_type == NLMSG_ERROR) +.\"O /* Do some error handling. */ + /* ²¿¤é¤«¤Î¥¨¥é¡¼½èÍý¤ò¹Ô¤¦ */ + ... + +.\"O /* Continue with parsing payload. */ + /* ¥Ú¥¤¥í¡¼¥É¤Î²òÀϤò³¤±¤ë */ + ... +} +.fi +.in +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR cmsg (3), +.BR netlink (3), +.BR capabilities (7), +.BR rtnetlink (7) +.PP +.\"O ftp://ftp.inr.ac.ru/ip-routing/iproute2* +.\"O for information about libnetlink. +libnetlink ¤Ë´Ø¤¹¤ë¾ðÊó¤Ï +ftp://ftp.inr.ac.ru/ip-routing/iproute2* + +.\"O http://people.suug.ch/~tgr/libnl/ +.\"O for information about libnl. +libnl ¤Ë´Ø¤¹¤ë¾ðÊó¤Ï +http://people.suug.ch/~tgr/libnl/ + +RFC 3549 "Linux Netlink as an IP Services Protocol" diff --git a/draft/man7/operator.7 b/draft/man7/operator.7 new file mode 100644 index 00000000..89cd6509 --- /dev/null +++ b/draft/man7/operator.7 @@ -0,0 +1,87 @@ +.\" 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 2007-12-08 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O C operator \- C operator precedence and order of evaluation +C 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/packet.7 b/draft/man7/packet.7 new file mode 100644 index 00000000..a797f8a9 --- /dev/null +++ b/draft/man7/packet.7 @@ -0,0 +1,715 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: packet.7,v 1.12 2001/06/19 07:07:38 argrath Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2001-02-13, Kentaro Shirakata +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" +.\"WORD physical layer ʪÍýÁØ +.\"WORD link level header(s) ¥ê¥ó¥¯¥ì¥Ù¥ë¥Ø¥Ã¥À +.\"WORD phyxical header(s) ʪÍý¥Ø¥Ã¥À +.\"WORD effective user id ¼Â¸ú¥æ¡¼¥¶¡¼ ID +.\"WORD capability ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\"WORD pending error Ãٱ䥨¥é¡¼ +.\"WORD promiscuous mode ̵º¹Ê̥⡼¥É +.\" +.TH PACKET 7 2008-08-08 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O packet, AF_PACKET \- packet interface on device level. +packet, AF_PACKET \- ¥Ç¥Ð¥¤¥¹¥ì¥Ù¥ë¤Î¥Ñ¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.br +.B #include /* the L2 protocols */ +.sp +.BI "packet_socket = socket(AF_PACKET, int " socket_type ", int "protocol ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Packet sockets are used to receive or send raw packets at the device driver +.\"O (OSI Layer 2) level. +.\"O They allow the user to implement protocol modules in user space +.\"O on top of the physical layer. +packet ¥½¥±¥Ã¥È¤Ï¡¢¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð (OSI ¥ì¥¤¥ä 2) ¥ì¥Ù¥ë¤Ç +À¸¤Î¥Ñ¥±¥Ã¥È (raw packet) ¤òÁ÷¼õ¿®¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +packet ¥½¥±¥Ã¥È¤ò»È¤¦¤È¡¢¥æ¡¼¥¶¡¼¶õ´Ö¤ÇʪÍýÁؤξå¤Ë +¥×¥í¥È¥³¥ë¥â¥¸¥å¡¼¥ë¤ò¼ÂÁõ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O The +.\"O .I socket_type +.\"O is either +.\"O .B SOCK_RAW +.\"O for raw packets including the link level header or +.\"O .B SOCK_DGRAM +.\"O for cooked packets with the link level header removed. +.\"O The link level +.\"O header information is available in a common format in a +.\"O .IR sockaddr_ll . +.\"O .I protocol +.\"O is the IEEE 802.3 protocol number in network order. +.\"O See the +.\"O .I +.\"O include file for a list of allowed protocols. +.\"O When protocol +.\"O is set to +.\"O .B htons(ETH_P_ALL) +.\"O then all protocols are received. +.\"O All incoming packets of that protocol type will be passed to the packet +.\"O socket before they are passed to the protocols implemented in the kernel. +.I socket_type +¤Ë¤Ï +.B SOCK_RAW +¤È +.B SOCK_DGRAM +¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ +.B SOCK_RAW +¤Ï¥ê¥ó¥¯¥ì¥Ù¥ë¥Ø¥Ã¥À¤ò´Þ¤à raw ¥Ñ¥±¥Ã¥È¤ò¡¢ +.B SOCK_DGRAM +¤Ï¥ê¥ó¥¯¥ì¥Ù¥ë¥Ø¥Ã¥À¤¬ºï½ü¤µ¤ì¤¿²Ã¹©ºÑ¤ß¥Ñ¥±¥Ã¥È¤ò¼¨¤¹¡£ +¥ê¥ó¥¯¥ì¥Ù¥ë¥Ø¥Ã¥À¾ðÊó¤Ï +.I sockaddr_ll +¤Ç¶¦Ä̤Υե©¡¼¥Þ¥Ã¥È¤ÇÆþ¼ê¤Ç¤­¤ë¡£ +.I protocol +¤Ë¤Ï IEEE 802.3 ¥×¥í¥È¥³¥ëÈÖ¹æ¤ò +¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç»ØÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ë¥×¥í¥È¥³¥ë¤Î¥ê¥¹¥È¤Ï¡¢¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ò»²¾È¡£¥×¥í¥È¥³¥ë¤ò +.B htons(ETH_P_ALL) +¤Ë¤¹¤ë¤È¡¢Á´¤Æ¤Î¥×¥í¥È¥³¥ë¤¬¼õ¿®¤µ¤ì¤ë¡£ +³°Éô¤«¤éÍ褿¥Ñ¥±¥Ã¥È¤Î¤¦¤Á»ØÄꤷ¤¿¥×¥í¥È¥³¥ë¤Î¤â¤Î¤Ï¡¢ +¥«¡¼¥Í¥ë¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¤ËÅϤµ¤ì¤ëÁ°¤ÎÃʳ¬¤Ç¡¢ +packet ¥½¥±¥Ã¥È¤ËÅϤµ¤ì¤ë¡£ + +.\"O Only processes with effective UID 0 or the +.\"O .B CAP_NET_RAW +.\"O capability may open packet sockets. +packet ¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤Ç¤­¤ë¤Î¤Ï¡¢ +¼Â¸ú¥æ¡¼¥¶¡¼ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤«¡¢ +.B CAP_NET_RAW +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹¤À¤±¤Ç¤¢¤ë¡£ + +.\"O .B SOCK_RAW +.\"O packets are passed to and from the device driver without any changes in +.\"O the packet data. +.\"O When receiving a packet, the address is still parsed and +.\"O passed in a standard +.\"O .I sockaddr_ll +.\"O address structure. +.\"O When transmitting a packet, the user supplied buffer +.\"O should contain the physical layer header. +.\"O That packet is then +.\"O queued unmodified to the network driver of the interface defined by the +.\"O destination address. +.\"O Some device drivers always add other headers. +.\"O .B SOCK_RAW +.\"O is similar to but not compatible with the obsolete +.\"O .B AF_INET/SOCK_PACKET +.\"O of Linux 2.0. +.B SOCK_RAW +¥Ñ¥±¥Ã¥È¤Ç¤Ï¡¢¥Ñ¥±¥Ã¥È¤ò¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤È¼õ¤±ÅϤ·¤¹¤ëºÝ¡¢ +¥Ñ¥±¥Ã¥È¥Ç¡¼¥¿¤ËÊѹ¹¤¬¹Ô¤ï¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +¥Ñ¥±¥Ã¥È¤Î¼õ¿®»þ¤Ë¤Ï¡¢¥¢¥É¥ì¥¹¤Î²òÀϤÀ¤±¤Ï¹Ô¤ï¤ì¡¢ +ɸ½àŪ¤Ê +.I sockaddr_ll +¥¢¥É¥ì¥¹¹½Â¤ÂΤËÅϤµ¤ì¤ë¡£¥Ñ¥±¥Ã¥È¤ÎÁ÷¿®»þ¤Ë¤Ï¡¢¥æ¡¼¥¶¤¬»ØÄꤹ¤ë +¥Ð¥Ã¥Õ¥¡¤ËʪÍýÁؤΥإåÀ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +¥Ñ¥±¥Ã¥È¤Ï¤½¤Î¤Þ¤Þ½¤Àµ¤ò¼õ¤±¤º¤Ë¡¢¹Ô¤­À襢¥É¥ì¥¹¤«¤é·èÄꤵ¤ì¤ë +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥É¥é¥¤¥Ð¤Ë¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤ë¡£ +¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ë¤è¤Ã¤Æ¤Ï¡¢Â¾¤Î¥Ø¥Ã¥À¤ò¾ï¤ËÄɲ乤ë¤â¤Î¤â¤¢¤ë¡£ +.B SOCK_RAW +¤Ï Linux 2.0 ¤Î obosolete ¤Ê +.B AF_INET/SOCK_PACKET +¤È»÷¤Æ¤¤¤ë¤¬¡¢¸ß´¹À­¤¬¤¢¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ + +.\"O .B SOCK_DGRAM +.\"O operates on a slightly higher level. +.\"O The physical header is removed before the packet is passed to the user. +.\"O Packets sent through a +.\"O .B SOCK_DGRAM +.\"O packet socket get a suitable physical layer header based on the +.\"O information in the +.\"O .I sockaddr_ll +.\"O destination address before they are queued. +.B SOCK_DGRAM +¤Ï¤ä¤ä¹â°Ì¤Î¥ì¥Ù¥ë¤ÇÆ°ºî¤¹¤ë¡£ÊªÍý¥Ø¥Ã¥À¤Ï¡¢¥Ñ¥±¥Ã¥È¤¬¥æ¡¼¥¶¡¼¤Ë +ÅϤµ¤ì¤ëÁ°¤Ëºï½ü¤µ¤ì¤ë¡£ +.B SOCK_DGRAM +¤Î packet ¥½¥±¥Ã¥È¤òÄ̤·¤ÆÁ÷¤é¤ì¤ë¥Ñ¥±¥Ã¥È¤Ï¡¢ +.I sockaddr_ll +¤Î¹Ô¤­À襢¥É¥ì¥¹¤Î¾ðÊó¤Ë´ð¤Å¤­¡¢Å¬ÀÚ¤ÊʪÍýÁؤΥإåÀ¤¬Éղ䵤ì¤Æ¤«¤é¡¢ +¥­¥å¡¼¤ËÁ÷¤é¤ì¤ë¡£ + +.\"O By default all packets of the specified protocol type +.\"O are passed to a packet socket. +.\"O To only get packets from a specific interface use +.\"O .BR bind (2) +.\"O specifying an address in a +.\"O .I struct sockaddr_ll +.\"O to bind the packet socket to an interface. +.\"O Only the +.\"O .I sll_protocol +.\"O and the +.\"O .I sll_ifindex +.\"O address fields are used for purposes of binding. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢»ØÄꤷ¤¿¥×¥í¥È¥³¥ë·¿¤Î¥Ñ¥±¥Ã¥È¤Ï¤¹¤Ù¤Æ packet +¥½¥±¥Ã¥È¤ËÁ÷¤é¤ì¤ë¡£ÆÃÄê¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤«¤é¤Î¥Ñ¥±¥Ã¥È¤À¤±¤ò +¼èÆÀ¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +.I struct sockaddr_ll +¤Ë¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Æ +.BR bind (2) +¤ò¸Æ¤Ó¡¢ packet ¥½¥±¥Ã¥È¤ò¤½¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë·ë¤ÓÉÕ¤±¤ë (¥Ð¥¤¥ó¥É¤¹¤ë)¡£ +¥Ð¥¤¥ó¥É¤ÎºÝ¤Ë¤Ï¡¢¥¢¥É¥ì¥¹¥Õ¥£¡¼¥ë¥É¤Î¤¦¤Á +.I sll_protocol +¤È +.I sll_ifindex +¤À¤±¤¬ÍѤ¤¤é¤ì¤ë¡£ + +.\"O The +.\"O .BR connect (2) +.\"O operation is not supported on packet sockets. +.BR connect (2) +Áàºî¤Ï packet ¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"O When the +.\"O .B MSG_TRUNC +.\"O flag is passed to +.\"O .BR recvmsg (2), +.\"O .BR recv (2), +.\"O .BR recvfrom (2) +.\"O the real length of the packet on the wire is always returned, +.\"O even when it is longer than the buffer. +.B MSG_TRUNC +¥Õ¥é¥°¤¬ +.BR recvmsg (2), +.BR recv (2), +.BR recvfrom (2) +¤ËÅϤµ¤ì¤ë¤È¡¢ (¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤è¤êÂ礭¤«¤Ã¤¿¤È¤·¤Æ¤â) ¾ï¤Ë¼ÂºÝ¤ËÄÌ¿®¤µ¤ì¤¿ +¥Ñ¥±¥Ã¥È¤ÎŤµ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SS Address Types +.SS ¥¢¥É¥ì¥¹¤Î¥¿¥¤¥× +.\"O The sockaddr_ll is a device independent physical layer address. +sockaddr_ll ¤Ï¥Ç¥Ð¥¤¥¹¤Ë°Í¸¤·¤Ê¤¤ÊªÍýÁؤΥ¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ + +.in +4n +.nf +.\"O struct sockaddr_ll { +.\"O unsigned short sll_family; /* Always AF_PACKET */ +.\"O unsigned short sll_protocol; /* Physical layer protocol */ +.\"O int sll_ifindex; /* Interface number */ +.\"O unsigned short sll_hatype; /* Header type */ +.\"O unsigned char sll_pkttype; /* Packet type */ +.\"O unsigned char sll_halen; /* Length of address */ +.\"O unsigned char sll_addr[8]; /* Physical layer address */ +.\"O }; +struct sockaddr_ll { + unsigned short sll_family; /* ¾ï¤Ë AF_PACKET */ + unsigned short sll_protocol; /* ʪÍýÁؤΥץí¥È¥³¥ë */ + int sll_ifindex; /* ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ÈÖ¹æ */ + unsigned short sll_hatype; /* ¥Ø¥Ã¥À¼ïÊÌ */ + unsigned char sll_pkttype; /* ¥Ñ¥±¥Ã¥È¼ïÊÌ */ + unsigned char sll_halen; /* ¥¢¥É¥ì¥¹¤ÎŤµ */ + unsigned char sll_addr[8]; /* ʪÍýÁؤΥ¢¥É¥ì¥¹ */ +}; +.fi +.in + +.\"O .I sll_protocol +.\"O is the standard ethernet protocol type in network order as defined +.\"O in the +.\"O .I +.\"O include file. +.\"O It defaults to the socket's protocol. +.I sll_protocol +¤Ïɸ½àŪ¤Ê¥¤¡¼¥µ¥Í¥Ã¥È¥×¥í¥È¥³¥ë¤Î¥¿¥¤¥×¤Ç¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Çµ­½Ò¤¹¤ë¡£ +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤¬¤³¤Î¥½¥±¥Ã¥È¤Î¥×¥í¥È¥³¥ë¤Î¥Ç¥Õ¥©¥ë¥È¤È¤Ê¤ë¡£ + +.\"O .I sll_ifindex +.\"O is the interface index of the interface +.\"O (see +.\"O .BR netdevice (7)); +.\"O 0 matches any interface (only permitted for binding). +.I sll_ifindex +¤Ï¤½¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î interface index ¤Ç¤¢¤ë +.RB ( netdevice (7) +¤ò»²¾È)¡£ +0 ¤Ï (¥Ð¥¤¥ó¥É¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë) Ǥ°Õ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ + +.\"O .I sll_hatype +.\"O is a ARP type as defined in the +.\"O .I +.\"O include file. +.I sll_hatype +¤Ï¡¢¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë ARP ¼ïÊ̤Ǥ¢¤ë¡£ + +.\"O .I sll_pkttype +.\"O contains the packet type. +.\"O Valid types are +.\"O .B PACKET_HOST +.\"O for a packet addressed to the local host, +.\"O .B PACKET_BROADCAST +.\"O for a physical layer broadcast packet, +.\"O .B PACKET_MULTICAST +.\"O for a packet sent to a physical layer multicast address, +.\"O .B PACKET_OTHERHOST +.\"O for a packet to some other host that has been caught by a device driver +.\"O in promiscuous mode, and +.\"O .B PACKET_OUTGOING +.\"O for a packet originated from the local host that is looped back to a packet +.\"O socket. +.\"O These types make only sense for receiving. +.I sll_pkttype +¤Ï¥Ñ¥±¥Ã¥È¼ïÊ̤Ǥ¢¤ë¡£»ØÄê¤Ç¤­¤ë¼ïÊ̤ϰʲ¼¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë: +.B PACKET_HOST +(¥í¡¼¥«¥ë¥Û¥¹¥È¸þ¤±¤Î¥Ñ¥±¥Ã¥È)¡¢ +.B PACKET_BORADCAST +(ʪÍýÁØ¤Î¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È)¡¢ +.B PACKET_MULTICAST +(ʪÍýÁؤΥޥë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ËÁ÷¤ë¥Ñ¥±¥Ã¥È)¡¢ +.B PACKET_OTHERHOST +(¾¤Î¥Û¥¹¥È¤Ë¸þ¤±¤é¤ì¤¿¥Ñ¥±¥Ã¥È¤Î¤¦¤Á¡¢ +̵º¹Ê̥⡼¥É (promiscuous mode: ¸å½Ò) ¤Î¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ë¤è¤êÊä­¤µ¤ì¤¿¤â¤Î)¡¢ +.B PACKET_OUTGOING +(¥í¡¼¥«¥ë¥Û¥¹¥È¤«¤éȯ¿®¤µ¤ì¡¢ +packet ¥½¥±¥Ã¥È¤Ë¥ë¡¼¥×¥Ð¥Ã¥¯¤·¤Æ¤­¤¿¥Ñ¥±¥Ã¥È)¡£ +¤³¤ì¤é¤Î¼ïÊ̤¬°ÕÌ£¤ò»ý¤Ä¤Î¤Ï¼õ¿®»þ¤Î¤ß¤Ç¤¢¤ë¡£ + +.\"O .I sll_addr +.\"O and +.\"O .I sll_halen +.\"O contain the physical layer (e.g., IEEE 802.3) address and its length. +.\"O The exact interpretation depends on the device. +.I sll_addr +¤È +.I sll_halen +¤Ï¡¢ÊªÍýÁؤΠ(¤Ä¤Þ¤ê IEEE 802.3 ¤Î) ¥¢¥É¥ì¥¹¤È¤½¤ÎŤµ¤Ç¤¢¤ë¡£ +¸·Ì©¤Ê²ò¼á¤Ï¥Ç¥Ð¥¤¥¹¤Ë°Í¸¤¹¤ë¡£ + +.\"O When you send packets it is enough to specify +.\"O .IR sll_family , +.\"O .IR sll_addr , +.\"O .IR sll_halen , +.\"O .IR sll_ifindex . +¥Ñ¥±¥Ã¥È¤òÁ÷¤ë¾ì¹ç¤Ï¡¢ +.IR sll_family , +.IR sll_addr , +.IR sll_halen , +.I sll_ifindex +¤ò»ØÄꤹ¤ì¤Ð½½Ê¬¤Ç¤¢¤ë¡£ +.\"O The other fields should be 0. +¤½¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤Ï 0 ¤Ë¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .I sll_hatype +.\"O and +.\"O .I sll_pkttype +.\"O are set on received packets for your information. +.I sll_hatype +¤È +.I sll_pkttype +¤Ë¤Ï¼õ¿®¤·¤¿¥Ñ¥±¥Ã¥È¤Î¾ðÊó¤¬ÀßÄꤵ¤ì¤ë¡£ +.\"O For bind only +.\"O .I sll_protocol +.\"O and +.\"O .I sll_ifindex +.\"O are used. +¥Ð¥¤¥ó¥É¤ÎºÝ¤Ë¤Ï¡¢ +.I sll_protocol +¤È +.I sll_ifindex +¤À¤±¤¬»ÈÍѤµ¤ì¤ë¡£ +.\"O .SS Socket Options +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.\"O Packet sockets can be used to configure physical layer multicasting +.\"O and promiscuous mode. +.\"O It works by calling +.\"O .BR setsockopt (2) +.\"O on a packet socket for +.\"O .B SOL_PACKET +.\"O and one of the options +.\"O .B PACKET_ADD_MEMBERSHIP +.\"O to add a binding or +.\"O .B PACKET_DROP_MEMBERSHIP +.\"O to drop it. +.\"O They both expect a +.\"O .B packet_mreq +.\"O structure as argument: +packet ¥½¥±¥Ã¥È¤Ï¡¢ÊªÍýÁؤΥޥë¥Á¥­¥ã¥¹¥È¤ä +̵º¹Ê̥⡼¥É (promiscuous mode) ¤òÀßÄꤷ¤Æ»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤Ï +.B SOL_PACKET +¤È°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Î¤¤¤º¤ì¤«¤ò»ØÄꤷ¤Æ +.BR setsockopt (2) +¤ò¸Æ¤Ù¤Ð¤è¤¤¡£ +¥Ð¥¤¥ó¥É¤òÄɲ乤ë¾ì¹ç¤Ï +.B PACKET_ADD_MEMBERSHIP +¤Ç¤¢¤ê¡¢¼è¤êµî¤ë¾ì¹ç¤Ï +.B PACKET_DROP_MEMBERSHIP +¤Ç¤¢¤ë¡£¤³¤ì¤é¤Ï¤¤¤º¤ì¤â +.B packet_mreq +¹½Â¤ÂΤò°ú¤­¿ô¤Ë¼è¤ë¡£ + +.in +4n +.nf +.\"O struct packet_mreq { +.\"O int mr_ifindex; /* interface index */ +.\"O unsigned short mr_type; /* action */ +.\"O unsigned short mr_alen; /* address length */ +.\"O unsigned char mr_address[8]; /* physical layer address */ +.\"O }; +struct packet_mreq { + int mr_ifindex; /* ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ÈÖ¹æ */ + unsigned short mr_type; /* Æ°ºî */ + unsigned short mr_alen; /* ¥¢¥É¥ì¥¹¤ÎŤµ */ + unsigned char mr_address[8]; /* ʪÍýÁؤΥ¢¥É¥ì¥¹ */ +}; +.fi +.in + +.\"O .B mr_ifindex +.\"O contains the interface index for the interface whose status +.\"O should be changed. +.\"O The +.\"O .B mr_type +.\"O parameter specifies which action to perform. +.\"O .B PACKET_MR_PROMISC +.\"O enables receiving all packets on a shared medium (often known as +.\"O "promiscuous mode"), +.\"O .B PACKET_MR_MULTICAST +.\"O binds the socket to the physical layer multicast group specified in +.\"O .B mr_address +.\"O and +.\"O .BR mr_alen , +.\"O and +.\"O .B PACKET_MR_ALLMULTI +.\"O sets the socket up to receive all multicast packets arriving at +.\"O the interface. +.I mr_ifindex +¤Ï¡¢¥¹¥Æ¡¼¥¿¥¹¤òÊѹ¹¤·¤¿¤¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ÈÖ¹æ¤Ç¤¢¤ë¡£ +.I mr_type +¥Ñ¥é¥á¡¼¥¿¤Ï¼Â¹Ô¤¹¤ëÆ°ºî¤ò»ØÄꤹ¤ë: +.B PACKET_MR_PROMISC +¤Ï¡¢¶¦Í­¤·¤Æ¤¤¤ëÇÞÂΤ«¤é¤ÎÁ´¤Æ¤Î¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë +(¤·¤Ð¤·¤Ð "̵º¹Ê̥⡼¥É (promiscuous mode)" ¤È¸Æ¤Ð¤ì¤ë)¡£ +.B PACKET_MR_MULTICAST +¤Ï¡¢¤½¤Î¥½¥±¥Ã¥È¤ò¡¢ +.I mr_address +¤È +.I mr_alen +¤Ç»ØÄꤵ¤ì¤ëʪÍýÁؤΥޥë¥Á¥­¥ã¥¹¥È¥Ö¥ë¡¼¥×¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¡£ +.B PACKET_MR_ALLMULTI +¤Ï socket ¤ò up ¤Ë¤·¤Æ¡¢¤½¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ËÅþ㤷¤¿¤¹¤Ù¤Æ¤Î +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ + +.\"O In addition the traditional ioctls +.\"O .BR SIOCSIFFLAGS , +.\"O .BR SIOCADDMULTI , +.\"O .B SIOCDELMULTI +.\"O can be used for the same purpose. +ÀΤ«¤é¤¢¤ë ioctl ¤À¤±¤Ç¤Ê¤¯¡¢ +.BR SIOCSIFFLAGS , +.BR SIOCADDMULTI , +.B SIOCDELMULTI +¤òƱ¤¸ÌÜŪ¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SS Ioctls +.SS ioctl +.\"O .B SIOCGSTAMP +.\"O can be used to receive the timestamp of the last received packet. +.\"O Argument is a +.\"O .IR "struct timeval" . +.B SIOCGSTAMP +¤òÍѤ¤¤ë¤È¡¢ºÇ¸å¤Ë¼õ¿®¤·¤¿¥Ñ¥±¥Ã¥È¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°ú¤­¿ô¤Ï +.I struct timeval +¤Ç¤¢¤ë¡£ + +.\"O In addition all standard ioctls defined in +.\"O .BR netdevice (7) +.\"O and +.\"O .BR socket (7) +.\"O are valid on packet sockets. +¤µ¤é¤Ë¡¢ +.BR netdevice (7) +¤ª¤è¤Ó +.BR socket (7) +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëɸ½à¤Î ioctl ¤Ï¤¤¤º¤ì¤â +packet ¥½¥±¥Ã¥È¤Ë»ØÄê²Äǽ¤Ç¤¢¤ë¡£ +.\"O .SS Error Handling +.SS ¥¨¥é¡¼½èÍý +.\"O Packet sockets do no error handling other than errors occurred +.\"O while passing the packet to the device driver. +.\"O They don't have the concept of a pending error. +packet ¥½¥±¥Ã¥È¤Ï¡¢¥Ñ¥±¥Ã¥È¤ò¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ËÅϤ¹¤È¤­¤Ë +µ¯¤­¤¿¥¨¥é¡¼¤·¤«½èÍý¤·¤Ê¤¤¡£Ãٱ䥨¥é¡¼ (pending error) +¤Ë´Ø¤¹¤ë³µÇ°¤Ï»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EADDRNOTAVAIL +.\"O Unknown multicast group address passed. +ÉÔÌÀ¤Ê¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¥¢¥É¥ì¥¹¤¬ÅϤµ¤ì¤¿¡£ +.TP +.B EFAULT +.\"O User passed invalid memory address. +¥æ¡¼¥¶¤¬ÅϤ·¤¿¥á¥â¥ê¥¢¥É¥ì¥¹¤¬ÉÔÀµ¡£ +.TP +.B EINVAL +.\"O Invalid argument. +°ú¤­¿ô¤¬ÉÔÀµ¡£ +.TP +.B EMSGSIZE +.\"O Packet is bigger than interface MTU. +¥Ñ¥±¥Ã¥È¤¬¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î MTU ¤è¤êÂ礭¤¤¡£ +.TP +.B ENETDOWN +.\"O Interface is not up. +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ up ¤Ç¤Ê¤¤¡£ +.TP +.B ENOBUFS +.\"O Not enough memory to allocate the packet. +¥Ñ¥±¥Ã¥È¤Ë³ä¤êÅö¤Æ¤ë¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B ENODEV +.\"O Unknown device name or interface index specified in interface address. +¥Ç¥Ð¥¤¥¹Ì¾¤¬ÉÔÌÀ¡£¤¢¤ë¤¤¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤Ç»ØÄꤵ¤ì¤¿ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬ÉÔÌÀ¡£ +.TP +.B ENOENT +.\"O No packet received. +¥Ñ¥±¥Ã¥È¤ò°ì¤Ä¤â¼õ¿®¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTCONN +.\"O No interface address passed. +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤¬ÅϤµ¤ì¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENXIO +.\"O Interface address contained an invalid interface index. +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤ËÉÔÀµ¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EPERM +.\"O User has insufficient privileges to carry out this operation. +¤³¤ÎÁàºî¤ò¹Ô¤¦¤Î¤ËɬÍפʸ¢¸Â¤ò¥æ¡¼¥¶¤¬»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ + +.\"O In addition other errors may be generated by the low-level driver. +¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬¡¢Äã¥ì¥Ù¥ë¤Î¥É¥é¥¤¥Ð¤ÇÀ¸À®¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .B AF_PACKET +.\"O is a new feature in Linux 2.2. +.\"O Earlier Linux versions supported only +.\"O .BR SOCK_PACKET . +.B AF_PACKET +¤Ï Linux 2.2 ¤Î¿·µ¡Ç½¤Ç¤¢¤ë¡£¤³¤ì¤è¤ê¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Linux ¤Ç¤Ï +.B SOCK_PACKET +¤Î¤ß¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤¿¡£ +.PP +.\"O The include file +.\"O .I +.\"O is present since glibc 2.1. +.\"O Older systems need: +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤¬Â¸ºß¤¹¤ë¤Î¤Ï glibc 2.1 °Ê¹ß¤Ç¤¢¤ë¡£ +¤½¤ì°ÊÁ°¤Î¥·¥¹¥Æ¥à¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ëɬÍפ¬¤¢¤ë: +.sp +.in +4n +.nf +#include +#include +#include /* The L2 protocols */ +.fi +.in +.\"O .SH NOTES +.SH Ãí°Õ +.\"O For portable programs it is suggested to use +.\"O .B AF_PACKET +.\"O via +.\"O .BR pcap (3); +.\"O although this only covers a subset of the +.\"O .B AF_PACKET +.\"O features. +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +.BR pcap (3) +·Ðͳ¤Ç +.B AF_PACKET +¤òÍѤ¤¤ë¤³¤È¤ò¤ªÁ¦¤á¤¹¤ë¡£¤¿¤À¤·¡¢¤³¤ÎÊýË¡¤Ç¤Ï +.B AF_PACKET +¤Îµ¡Ç½¤¹¤Ù¤Æ¤òÍøÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ + +.\"O The +.\"O .B SOCK_DGRAM +.\"O packet sockets make no attempt to create or parse the IEEE 802.2 LLC +.\"O header for a IEEE 802.3 frame. +.\"O When +.\"O .B ETH_P_802_3 +.\"O is specified as protocol for sending the kernel creates the +.\"O 802.3 frame and fills out the length field; the user has to supply the LLC +.\"O header to get a fully conforming packet. +.\"O Incoming 802.3 packets are not multiplexed on the DSAP/SSAP protocol +.\"O fields; instead they are supplied to the user as protocol +.\"O .B ETH_P_802_2 +.\"O with the LLC header prepended. +.\"O It is thus not possible to bind to +.\"O .BR ETH_P_802_3 ; +.\"O bind to +.\"O .B ETH_P_802_2 +.\"O instead and do the protocol multiplex yourself. +.\"O The default for sending is the standard Ethernet DIX +.\"O encapsulation with the protocol filled in. +.B SOCK_DGRAM +packet ¥½¥±¥Ã¥È¤Ï¡¢IEEE 802.3 ¥Õ¥ì¡¼¥à¤Î IEEE 802.2 LLC ¥Ø¥Ã¥À¤Î +À¸À®¤ä²òÀϤò¹Ô¤ª¤¦¤È¤·¤Ê¤¤¡£ +.B ETH_P_802_3 +¤¬Á÷¿®¥×¥í¥È¥³¥ë¤Ë»ØÄꤵ¤ì¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï 802.3 ¥Õ¥ì¡¼¥à¤ò +À¸À®¤·¤Æ length ¥Õ¥£¡¼¥ë¥É¤Ë½ñ¤­¹þ¤à¡£ +´°Á´¤Ë½àµò¤·¤¿¥Ñ¥±¥Ã¥È¤òÆÀ¤ë¤¿¤á¤Ë¤Ï¥æ¡¼¥¶¡¼¤¬ LLC ¥Ø¥Ã¥À¤ò +Í¿¤¨¤ëɬÍפ¬¤¢¤ë¡£ÅþÃ夷¤¿ 802.3 ¥Ñ¥±¥Ã¥È¤Ç¤Ï¡¢ +DSAP/SSAP protocol ¤Î³Æ¥Õ¥£¡¼¥ë¥É¤Ï¿½Å²½ (multiplex) ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë¤³¤ì¤é¤Ï LLC ¥Ø¥Ã¥À¤¬Á°ÃÖ¤µ¤ì¤¿ +.B ETH_P_802_2 +¥×¥í¥È¥³¥ë¤È¤·¤ÆÍ¿¤¨¤é¤ì¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +.B ETH_P_802_3 +¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£¤«¤ï¤ê¤Ë +.B ETH_P_802_2 +¤Ë¥Ð¥¤¥ó¥É¤·¡¢¼«Ê¬¼«¿È¤Ç¥×¥í¥È¥³¥ë¤Î¿½Å²½¤ò¹Ô¤¦¤³¤È¡£ +Á÷¿®¤Î¥Ç¥Õ¥©¥ë¥È¤Ï¡¢¥×¥í¥È¥³¥ë¥Õ¥£¡¼¥ë¥É¤ò»ý¤Ä +ɸ½à¤Î Ethernet DIX encapsulation ¤Ç¤¢¤ë¡£ + +.\"O Packet sockets are not subject to the input or output firewall chains. +packet ¥½¥±¥Ã¥È¤ÏÆþ½ÐÎϤΠfirewall chain ¤Ë±Æ¶Á¤ò¤¦¤±¤Ê¤¤¡£ +.\"O .SS Compatibility +.SS °Ü¿¢À­ +.\"O In Linux 2.0, the only way to get a packet socket was by calling +.\"O .BI "socket(AF_INET, SOCK_PACKET, " protocol )\fR. +.\"O This is still supported but strongly deprecated. +.\"O The main difference between the two methods is that +.\"O .B SOCK_PACKET +.\"O uses the old +.\"O .I struct sockaddr_pkt +.\"O to specify an interface, which doesn't provide physical layer +.\"O independence. +Linux 2.0 ¤Ç¤Ï¡¢ packet ¥½¥±¥Ã¥È¤òÆÀ¤ëÊýË¡¤Ï +.BI "socket(AF_INET, SOCK_PACKET, " protocol )\fR +¤ò¸Æ¤Ö¤ä¤êÊý¤·¤«¤Ê¤«¤Ã¤¿¡£¤³¤ÎÊýË¡¤Ï¤Þ¤À¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +ÍѤ¤¤Ê¤¤¤³¤È¤ò¶¯¤¯¿ä¾©¤¹¤ë¡£¸½ºß¤ÎÊýË¡¤È¤Î¼ç¤Ê°ã¤¤¤Ï¡¢ +.B SOCK_PACKET +¤Ç¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î»ØÄê¤Ë¸Å¤¤ +.I struct sockaddr_pkt +¤òÍѤ¤¤ëÅÀ¤Ç¤¢¤ë¡£¤³¤ì¤Ë¤ÏʪÍýÁؤ«¤é¤ÎÆÈΩÀ­¤¬¤Ê¤¤¡£ + +.in +4n +.nf +struct sockaddr_pkt { + unsigned short spkt_family; + unsigned char spkt_device[14]; + unsigned short spkt_protocol; +}; +.fi +.in + +.\"O .I spkt_family +.\"O contains +.\"O the device type, +.\"O .I spkt_protocol +.\"O is the IEEE 802.3 protocol type as defined in +.\"O .I +.\"O and +.\"O .I spkt_device +.\"O is the device name as a null-terminated string, for example, eth0. +.I spkt_family +¤Ï¥Ç¥Ð¥¤¥¹¤Î¥¿¥¤¥×¡¢ +.I spkt_protocol +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë IEEE 802.3 ¥×¥í¥È¥³¥ë¥¿¥¤¥×¡¢ +.I spkt_device +¤Ï¥Ç¥Ð¥¤¥¹¤Î̾Á°¤ò NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤ÇÍ¿¤¨¤¿¤â¤Î (Îã: eth0) ¤Ç¤¢¤ë¡£ + +.\"O This structure is obsolete and should not be used in new code. +¤³¤Î¹½Â¤ÂÎ¤Ï obsolete ¤Ç¤¢¤ê¡¢ +¿·¤·¤¯¥³¡¼¥É¤ò½ñ¤¯»þ¤Ë¤ÏÍѤ¤¤ë¤Ù¤­¤Ç¤Ê¤¤¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O glibc 2.1 does not have a define for +.\"O .BR SOL_PACKET . +.\"O The suggested workaround is to use: +glibc 2.1 ¤Ë¤Ï +.B SOL_PACKET +¤ÎÄêµÁ¤¬¤Ê¤¤¡£²óÈòºö¤È¤·¤Æ¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¤È¤è¤¤¡£ +.in +4n +.nf + +#ifndef SOL_PACKET +#define SOL_PACKET 263 +#endif + +.fi +.in +.\"O This is fixed in later glibc versions and also does not occur on +.\"O libc5 systems. +¤³¤ÎÌäÂê¤Ï¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï½¤Àµ¤µ¤ì¤Æ¤¤¤ë¡£ +libc5 ¤Î¥·¥¹¥Æ¥à¤Ë¤Ï¤³¤ÎÌäÂê¤Ï¤Ê¤¤¡£ + +.\"O The IEEE 802.2/803.3 LLC handling could be considered as a bug. +IEEE 802.2/803.3 ¤Î LLC ¤Î°·¤¤Êý¤Ï¡¢¥Ð¥°¤È¹Í¤¨¤Æ¤âÎɤ¤¤À¤í¤¦¡£ + +.\"O Socket filters are not documented. +¥½¥±¥Ã¥È¥Õ¥£¥ë¥¿¡¼¤Ë¤Ä¤¤¤Æµ­ºÜ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"O The +.\"O .B MSG_TRUNC +.\"O .BR recvmsg (2) +.\"O extension is an ugly hack and should be replaced by a control message. +.\"O There is currently no way to get the original destination address of +.\"O packets via +.\"O .BR SOCK_DGRAM . +.B MSG_TRUNC +.BR recvmsg (2) +³ÈÄ¥¤ÏÈó¾ï¤Ë¤Þ¤º¤¤Âнè¤Ç¤¢¤ê¡¢À©¸æ¥á¥Ã¥»¡¼¥¸¤ÇÃÖ¤­´¹¤¨¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +º£¤Î¤È¤³¤í +.B SOCK_DGRAM +·Ðͳ¤Ç¥Ñ¥±¥Ã¥È¤Ë¤Ä¤¤¤Æ¤¤¤¿°¸À襢¥É¥ì¥¹¤òÆÀ¤ëÊýË¡¤¬¤Ê¤¤¡£ +.\"O .\" .SH CREDITS +.\" .SH Ãø¼Ô +.\"O .\" This man page was written by Andi Kleen with help from Matthew Wilcox. +.\"O .\" AF_PACKET in Linux 2.2 was implemented +.\"O .\" by Alexey Kuznetsov, based on code by Alan Cox and others. +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï Matthew Wilcox ¤Î½õÎϤΤâ¤È¤Ë Andi Kleen ¤¬½ñ¤¤¤¿¡£ +.\" Linux 2.2 ¤Î AF_PACKET ¤Ï¡¢ +.\" Alan Cox ¤¿¤Á¤Î¥³¡¼¥É¤ò¤â¤È¤Ë¤·¤Æ Alexey Kuznetsov ¤¬¼ÂÁõ¤·¤¿¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR socket (2), +.BR pcap (3), +.BR capabilities (7), +.BR ip (7), +.BR raw (7), +.BR socket (7) + +.\"O RFC\ 894 for the standard IP Ethernet encapsulation. +ɸ½à IP Ethernet encapsulation ¤Ë´Ø¤¹¤ë¾ðÊó¤Ï RFC\ 894 ¤Ë¤¢¤ë¡£ + +.\"O RFC\ 1700 for the IEEE 802.3 IP encapsulation. +IEEE 802.3 IP encapsulation ¤Ë´Ø¤¹¤ë¾ðÊó¤Ï RFC\ 1700 ¤Ë¤¢¤ë¡£ + +.\"O The +.\"O .I +.\"O include file for physical layer protocols. +ʪÍýÁؤΥץí¥È¥³¥ë¤Ë´Ø¤¹¤ëµ­½Ò¤Ï +.I +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë¡£ diff --git a/draft/man7/path_resolution.7 b/draft/man7/path_resolution.7 new file mode 100644 index 00000000..6641eb63 --- /dev/null +++ b/draft/man7/path_resolution.7 @@ -0,0 +1,415 @@ +.\" Copyright (C) 2003 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. +.\" +.\" Japanese Version Copyright (c) 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated 2005-01-26, Yuichi SATO +.\" Updated and Modified 2005-10-27, Akihiro MOTOKI +.\" Updated and Modified 2005-11-04, Akihiro MOTOKI +.\" +.TH PATH_RESOLUTION 7 2009-12-05 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O path_resolution \- how a pathname is resolved to a file +path_resolution \- ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤Î²ò·èÊýË¡ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Some Unix/Linux system calls have as parameter one or more filenames. +.\"O A filename (or pathname) is resolved as follows. +¤¤¤¯¤Ä¤«¤Î Unix/Linux ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +1 ¤Ä°Ê¾å¤Î¥Õ¥¡¥¤¥ë̾¤ò°ú¤­¿ô¤È¤·¤Æ»ý¤Ä¡£ +¥Õ¥¡¥¤¥ë̾ (¤Þ¤¿¤Ï¥Ñ¥¹Ì¾) ¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ²ò·è¤µ¤ì¤ë¡£ +.\"O .SS "Step 1: Start of the resolution process" +.SS "¥¹¥Æ¥Ã¥× 1: ²ò·è²áÄø¤ò³«»Ï¤¹¤ë" +.\"O If the pathname starts with the \(aq/\(aq character, +.\"O the starting lookup directory +.\"O is the root directory of the calling process. +.\"O (A process inherits its +.\"O root directory from its parent. +.\"O Usually this will be the root directory +.\"O of the file hierarchy. +.\"O A process may get a different root directory +.\"O by use of the +.\"O .BR chroot (2) +.\"O system call. +.\"O A process may get an entirely private mount namespace in case +.\"O it \(em or one of its ancestors \(em was started by an invocation of the +.\"O .BR clone (2) +.\"O system call that had the +.\"O .B CLONE_NEWNS +.\"O flag set.) +.\"O This handles the \(aq/\(aq part of the pathname. +¥Ñ¥¹Ì¾¤¬ \(aq/\(aq ʸ»ú¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¥Ç¥£¥ì¥¯¥È¥ê¸¡º÷¤Î³«»ÏÅÀ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ê¤ë¡£ +(¥×¥í¥»¥¹¤Ï¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò¿Æ¥×¥í¥»¥¹¤«¤é·Ñ¾µ¤¹¤ë¡£ +Ä̾ï¤Ï¡¢¤³¤ì¤¬¥Õ¥¡¥¤¥ë³¬ÁؤΥ롼¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ê¤ë¡£ +¥×¥í¥»¥¹¤Ï +.BR chroot (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤ÆÊ̤Υ롼¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò¼èÆÀ¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤Î¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¤È +.B CLONE_NEWNS +¥Õ¥é¥°¤òÀßÄꤷ¤Æ +.BR clone (2) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤Æ³«»Ï¤µ¤ì¤¿¤½¤Î¥×¥í¥»¥¹¤Î»Ò¹¤Ï¡¢ +´°Á´¤Ë¥×¥é¥¤¥Ù¡¼¥È¤Ê¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤ò¼èÆÀ¤Ç¤­¤ë¡£) +¥Ñ¥¹Ì¾¤Î \(aq/\(aq ¤ÎÉôʬ¤Ï¡¢¤³¤Î¤è¤¦¤Ë¤·¤Æ°·¤ï¤ì¤ë¡£ + +.\"O If the pathname does not start with the \(aq/\(aq character, the +.\"O starting lookup directory of the resolution process is the current working +.\"O directory of the process. +.\"O (This is also inherited from the parent. +.\"O It can be changed by use of the +.\"O .BR chdir (2) +.\"O system call.) +¥Ñ¥¹Ì¾¤¬ \(aq/\(aq ʸ»ú¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +²ò·è²áÄø¤Ë¤ª¤±¤ë¥Ç¥£¥ì¥¯¥È¥ê¸¡º÷¤Î³«»ÏÅÀ¤Ï¡¢ +¥×¥í¥»¥¹¤Î¸½ºß¤Îºî¶È (working) ¥Ç¥£¥ì¥¯¥È¥ê¤È¤Ê¤ë¡£ +(¤³¤ì¤â¿Æ¥×¥í¥»¥¹¤«¤é·Ñ¾µ¤µ¤ì¤ë¡£ +¤³¤ì¤Ï +.BR chdir (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤³¤È¤ÇÊѹ¹¤Ç¤­¤ë¡£) + +.\"O Pathnames starting with a \(aq/\(aq character are called absolute pathnames. +.\"O Pathnames not starting with a \(aq/\(aq are called relative pathnames. +\(aq/\(aq ʸ»ú¤Ç»Ï¤Þ¤ë¥Ñ¥¹Ì¾¤ÏÀäÂХѥ¹Ì¾¤È¸Æ¤Ð¤ì¡¢ +\(aq/\(aq ʸ»ú¤Ç»Ï¤Þ¤é¤Ê¤¤¥Ñ¥¹Ì¾¤ÏÁêÂХѥ¹Ì¾¤È¸Æ¤Ð¤ì¤ë¡£ +.\"O .SS "Step 2: Walk along the path" +.SS "¥¹¥Æ¥Ã¥× 2: ¥Ñ¥¹¤òé¤ë" +.\"O Set the current lookup directory to the starting lookup directory. +.\"O Now, for each nonfinal component of the pathname, where a component +.\"O is a substring delimited by \(aq/\(aq characters, this component is looked up +.\"O in the current lookup directory. +¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤ò¥Ç¥£¥ì¥¯¥È¥ê¸¡º÷¤Î³«»ÏÅÀ¤È¤¹¤ë¡£ +¤½¤·¤Æ¡¢¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Î¹½À®Í×ÁÇ (component) ¤Ç¤Ê¤¤³Æ¹½À®Í×ÁǤˤĤ¤¤Æ¡¢ +¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤Ç¸¡º÷¤ò¹Ô¤¦¡£ +¤³¤³¤Ç¹½À®Í×ÁÇ¤Ï \(aq/\(aq ¤Ç¶èÀÚ¤é¤ì¤¿Éôʬʸ»úÎó¤Ç¤¢¤ë¡£ + +.\"O If the process does not have search permission on +.\"O the current lookup directory, +.\"O an +.\"O .B EACCES +.\"O error is returned ("Permission denied"). +¥×¥í¥»¥¹¤¬¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤Î¸¡º÷µö²Ä¤ò»ý¤¿¤Ê¤¤¾ì¹ç¡¢ +.B EACCES +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë ("Permission denied")¡£ + +.\"O If the component is not found, an +.\"O .B ENOENT +.\"O error is returned +.\"O \"O ("No such file or directory"). +¹½À®Í×ÁǤ¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¡¢ +.B ENOENT +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë +("No such file or directory")¡£ + +.\"O If the component is found, but is neither a directory nor a symbolic link, +.\"O an +.\"O .B ENOTDIR +.\"O error is returned ("Not a directory"). +¹½À®Í×ÁǤϸ«¤Ä¤«¤Ã¤¿¤¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤â¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤â¤Ê¤¤¾ì¹ç¡¢ +.B ENOTDIR +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë ("Not a directory")¡£ + +.\"O If the component is found and is a directory, we set the +.\"O current lookup directory to that directory, and go to the +.\"O next component. +¹½À®Í×ÁǤ¬¸«¤Ä¤«¤Ã¤Æ¡¢¤«¤Ä¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¾ì¹ç¡¢ +¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤ò¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÀßÄꤷ¡¢ +¼¡¤Î¹½À®Í×ÁǤ˰ÜÆ°¤¹¤ë¡£ + +.\"O If the component is found and is a symbolic link (symlink), we first +.\"O resolve this symbolic link (with the current lookup directory +.\"O as starting lookup directory). +.\"O Upon error, that error is returned. +¹½À®Í×ÁǤ¬¸«¤Ä¤«¤Ã¤Æ¡¢¤«¤Ä¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯ (symlink) ¤Ç¤¢¤ë¾ì¹ç¡¢ +(¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤ò¥Ç¥£¥ì¥¯¥È¥ê¸¡º÷¤Î³«»ÏÅÀ¤È¤·¤Æ) +ºÇ½é¤Ë¤½¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò²ò·è¤¹¤ë¡£ +.\"O If the result is not a directory, an +.\"O .B ENOTDIR +.\"O error is returned. +·ë²Ì¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¾ì¹ç¡¢ +.B ENOTDIR +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O If the resolution of the symlink is successful and returns a directory, +.\"O we set the current lookup directory to that directory, and go to +.\"O the next component. +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î²ò·è¤¬À®¸ù¤·¤Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬ÊÖ¤µ¤ì¤¿¾ì¹ç¡¢ +¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤ÆÀßÄꤷ¡¢ +¼¡¤Î¹½À®Í×ÁǤ˰ÜÆ°¤¹¤ë¡£ +.\"O Note that the resolution process here involves recursion. +²ò·è²áÄø¤ËºÆµ¢¤¬´Þ¤Þ¤ì¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.\"O In order to protect the kernel against stack overflow, and also +.\"O to protect against denial of service, there are limits on the +.\"O maximum recursion depth, and on the maximum number of symbolic links +.\"O followed. +.\"O An +.\"O .B ELOOP +.\"O error is returned when the maximum is +.\"O exceeded ("Too many levels of symbolic links"). +¥«¡¼¥Í¥ë¤ò¥¹¥¿¥Ã¥¯¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ä +¥µ¡¼¥Ó¥¹µñÈÝ (denial of service) ¤«¤é¼é¤ë¤¿¤á¡¢ +ºÆµ¢¤ÎºÇÂç¤Î¿¼¤µ¤È¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òé¤ëºÇÂç²ó¿ô¤ËÀ©¸Â¤¬¤¢¤ë¡£ +ºÇÂçÃͤòĶ¤¨¤¿¾ì¹ç +.B ELOOP +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë +("Too many levels of symbolic links")¡£ +.\" +.\"O .\" presently: max recursion depth during symlink resolution: 5 +.\"O .\" max total number of symbolic links followed: 40 +.\"O .\" _POSIX_SYMLOOP_MAX is 8 +.\" ¸½ºß¤Î¤È¤³¤í: ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯²ò·è¤Ë¤ª¤±¤ëºÆµ¢¤ÎºÇÂç¤Î¿¼¤µ¤Ï 5 ¤Ç¤¢¤ë¡£ +.\" ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òé¤ëºÇÂç²ó¿ô¤Ï 40 ¤Ç¤¢¤ë¡£ +.\" _POSIX_SYMLOOP_MAX ¤Ï 8 ¤Ç¤¢¤ë¡£ +.\"O .SS "Step 3: Find the final entry" +.SS "¥¹¥Æ¥Ã¥× 3: ºÇ¸å¤Î¥¨¥ó¥È¥ê¤ò¸«¤Ä¤±¤ë" +.\"O The lookup of the final component of the pathname goes just like +.\"O that of all other components, as described in the previous step, +.\"O with two differences: (i) the final component need not be a +.\"O directory (at least as far as the path resolution process is concerned \(em +.\"O it may have to be a directory, or a nondirectory, because of +.\"O the requirements of the specific system call), and (ii) it +.\"O is not necessarily an error if the component is not found \(em +.\"O maybe we are just creating it. +.\"O The details on the treatment +.\"O of the final entry are described in the manual pages of the specific +.\"O system calls. +¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Î¹½À®Í×ÁǤθ¡º÷¤Ï¡¢Á°¤Î¥¹¥Æ¥Ã¥×¤ÇÀâÌÀ¤·¤¿ +¾¤ÎÁ´¤Æ¤Î¹½À®Í×ÁǤÈƱ¤¸¤è¤¦¤Ë¼Â¹Ô¤µ¤ì¤ë¤¬¡¢2 ¤Ä¤Î°ã¤¤¤¬¤¢¤ë¡£ +(i) ºÇ¸å¤Î¹½À®Í×ÁǤϥǥ£¥ì¥¯¥È¥ê¤Ç¤¢¤ëɬÍפ¬¤Ê¤¤ +(¥Ñ¥¹²ò·è²áÄø¤Ë´Ø¤¹¤ë¸Â¤ê¤Ï¤É¤Á¤é¤Ç¤â¹½¤ï¤Ê¤¤ \(em +ÆÃÄê¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Í׵᤹¤ë¤â¤Î¤Ë¤è¤Ã¤Æ¡¢ +¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¾ì¹ç¤â¤¢¤ë¤·¡¢ +¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¾ì¹ç¤â¤¢¤ë)¡£ +(ii) ¹½À®Í×ÁǤ¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ë¥¨¥é¡¼¤Ë¤¹¤ëɬÍפϤʤ¤ \(em +¤½¤Î¹½À®Í×ÁǤòºîÀ®¤¹¤ë¤À¤±¤Ç¤è¤¤¾ì¹ç¤â¤¢¤ë¡£ +ºÇ¸å¤Î¥¨¥ó¥È¥ê¤Î¾ÜºÙ¤Ê°·¤¤¤Ï¡¢ +ÆÃÄê¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS ". and .." +.SS ". ¤È .." +.\"O By convention, every directory has the entries "." and "..", +.\"O which refer to the directory itself and to its parent directory, +.\"O respectively. +´·½¬¤È¤·¤Æ¡¢Á´¤Æ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¥¨¥ó¥È¥ê "." ¤È ".." ¤ò»ý¤Ä¡£ +¤³¤ì¤é¤Ï¤½¤ì¤¾¤ì¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¼«¿È¤È¤½¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤¹¤ë¡£ + +.\"O The path resolution process will assume that these entries have +.\"O their conventional meanings, regardless of whether they are +.\"O actually present in the physical file system. +¥Ñ¥¹²ò·è²áÄø¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥¨¥ó¥È¥ê¤¬ÊªÍýŪ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë +¼ÂºÝ¤Ë¸ºß¤¹¤ë¤«Èݤ«¤Ë´Ø¤ï¤é¤º¡¢´·½¬Åª¤Ê°ÕÌ£¤ò»ý¤Ä¤È²¾Äꤹ¤ë¡£ + +.\"O One cannot walk down past the root: "/.." is the same as "/". +¥ë¡¼¥È¤è¤ê¾å¤Ëé¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤: "/.." ¤Ï "/" ¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.\"O .SS "Mount points" +.SS "¥Þ¥¦¥ó¥È°ÌÃÖ" +.\"O After a "mount dev path" command, the pathname "path" refers to +.\"O the root of the file system hierarchy on the device "dev", and no +.\"O longer to whatever it referred to earlier. +"mount dev path" ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤¿¸å¡¢ +¥Ñ¥¹Ì¾ "path" ¤Ï¥Ç¥Ð¥¤¥¹ "dev" ¾å¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à³¬ÁؤΠ+¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¡¢°ÊÁ°¤Î°ÌÃÖ¤ò»²¾È¤·¤Ê¤¤¡£ + +.\"O One can walk out of a mounted file system: "path/.." refers to +.\"O the parent directory of "path", +.\"O outside of the file system hierarchy on "dev". +¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î³°¤Ë½Ð¤ë¤³¤È¤¬¤Ç¤­¤ë: +"path/.." ¤Ï "dev" ¾å¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à³¬Áؤγ°¤Ç¤¢¤ë +"path" ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤¹¤ë¡£ +.\"O .SS "Trailing slashes" +.SS "ËöÈø¤Î¥¹¥é¥Ã¥·¥å" +.\"O If a pathname ends in a \(aq/\(aq, that forces resolution of the preceding +.\"O component as in Step 2: it has to exist and resolve to a directory. +.\"O Otherwise a trailing \(aq/\(aq is ignored. +.\"O (Or, equivalently, a pathname with a trailing \(aq/\(aq is equivalent to +.\"O the pathname obtained by appending \(aq.\(aq to it.) +¥Ñ¥¹Ì¾¤¬ \(aq/\(aq ¤Ç½ª¤ï¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¥¹¥Æ¥Ã¥× 2 ¤Ë¤ª¤¤¤Æ¡¢¤½¤ÎÁ°¤Ë¤¢¤ë¹½À®Í×ÁǤβò·èË¡¤ò¼¡¤Î¤è¤¦¤Ë¶¯À©¤¹¤ë: +¤½¤Î¹½À®Í×ÁǤ¬Â¸ºß¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤Æ²ò·è¤µ¤ì¤ë¡£ +¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢ËöÈø¤Î \(aq/\(aq ¤¬Ìµ»ë¤µ¤ì¤ë¡£ +(¤Þ¤¿Æ±Íͤˡ¢ËöÈø¤Ë \(aq/\(aq ¤¬¤¢¤ë¥Ñ¥¹Ì¾¤Ï¡¢ +\(aq.\(aq ¤òËöÈø¤Ë²Ã¤¨¤ÆÆÀ¤é¤ì¤ë¥Ñ¥¹Ì¾¤ÈÅù¤·¤¤¡£) +.\"O .SS "Final symlink" +.SS "ºÇ¸å¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¤È¤­" +.\"O If the last component of a pathname is a symbolic link, then it +.\"O depends on the system call whether the file referred to will be +.\"O the symbolic link or the result of path resolution on its contents. +¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Î¹½À®Í×ÁǤ¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¡¢ +»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ò¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤È¤¹¤ë¤«¡¢ +¤½¤ÎÆâÍƤˤĤ¤¤Æ¥Ñ¥¹¤ò²ò·è¤·¤¿·ë²Ì¤È¤¹¤ë¤«¤Ï¡¢ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë°Í¸¤¹¤ë¡£ +.\"O For example, the system call +.\"O .BR lstat (2) +.\"O will operate on the symlink, while +.\"O .BR stat (2) +.\"O operates on the file pointed to by the symlink. +¤¿¤È¤¨¤Ð¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR lstat (2) +¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ËºîÍѤ¹¤ë¡£ +°ìÊý¡¢ +.BR stat (2) +¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç»Ø¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËºîÍѤ¹¤ë¡£ +.\"O .SS "Length limit" +.SS "Ťµ¤ÎÀ©¸Â" +.\"O There is a maximum length for pathnames. +.\"O If the pathname (or some +.\"O intermediate pathname obtained while resolving symbolic links) +.\"O is too long, an +.\"O .B ENAMETOOLONG +.\"O error is returned ("File name too long"). +¥Ñ¥¹Ì¾¤Ë¤ÏºÇÂ獬¤¢¤ë¡£ +¥Ñ¥¹Ì¾ (¤Þ¤¿¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò²ò·è¤¹¤ë¤È¤­¤ËÆÀ¤é¤ì¤ëÃæ´Ö¥Ñ¥¹Ì¾) ¤¬ +Ť¹¤®¤ë¾ì¹ç¡¢ +.B ENAMETOOLONG +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë ("File name too long")¡£ +.\"O .SS "Empty pathname" +.SS "¶õ¤Î¥Ñ¥¹Ì¾" +.\"O In the original Unix, the empty pathname referred to the current directory. +.\"O Nowadays POSIX decrees that an empty pathname must not be resolved +.\"O successfully. +.\"O Linux returns +.\"O .B ENOENT +.\"O in this case. +¸µ¡¹¤Î Unix ¤Ç¤Ï¡¢¶õ¤Î¥Ñ¥¹Ì¾¤Ï¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤¿¡£ +ºÇ¶á¡¢POSIX ¤Ç¤Ï¶õ¤Î¥Ñ¥¹Ì¾¤ò²ò·è¤¹¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¤È¤¤¤¦·èÄ꤬¤Ê¤µ¤ì¤¿¡£ +¤³¤Î¾ì¹ç¡¢Linux ¤Ï +.B ENOENT +¤òÊÖ¤¹¡£ +.\"O .SS "Permissions" +.SS "µö²Ä" +.\"O The permission bits of a file consist of three groups of three bits, cf.\& +.\"O .BR chmod (1) +.\"O and +.\"O .BR stat (2). +¥Õ¥¡¥¤¥ë¤Îµö²Ä¥Ó¥Ã¥È¤Ï¡¢3 ÁȤΠ3 ¥Ó¥Ã¥È¤«¤é¹½À®¤µ¤ì¤ë¡£ +.BR chmod (1) +¤È +.BR stat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O The first group of three is used when the effective user ID of +.\"O the calling process equals the owner ID of the file. +.\"O The second group +.\"O of three is used when the group ID of the file either equals the +.\"O effective group ID of the calling process, or is one of the +.\"O supplementary group IDs of the calling process (as set by +.\"O .BR setgroups (2)). +.\"O When neither holds, the third group is used. +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô ID ¤ÈÅù¤·¤¤¾ì¹ç¡¢ +3 ¤Ä¤Î¤¦¤ÁºÇ½é¤Î¥°¥ë¡¼¥×¤¬»È¤ï¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥× ID ¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤Þ¤¿¤Ï +.RB ( setgroups (2) +¤ÇÀßÄꤵ¤ì¤ë) ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÊä½õ (supplementary) ¥°¥ë¡¼¥× ID ¤È +Åù¤·¤¤¾ì¹ç¡¢3 ¤Ä¤Î¤¦¤Á 2 ÈÖÌܤΥ°¥ë¡¼¥×¤¬»È¤ï¤ì¤ë¡£ +¤É¤Á¤é¤Ë¤âÅö¤Æ¤Ï¤Þ¤é¤Ê¤¤¾ì¹ç¡¢3 ÈÖÌܤΥ°¥ë¡¼¥×¤¬»È¤ï¤ì¤ë¡£ + +.\"O Of the three bits used, the first bit determines read permission, +.\"O the second write permission, and the last execute permission +.\"O in case of ordinary files, or search permission in case of directories. +3 ¥Ó¥Ã¥È¤¬»È¤ï¤ì¤ë¾ì¹ç¡¢ºÇ½é¤Î¥Ó¥Ã¥È¤ÏÆɤ߹þ¤ßµö²Ä¤ò·èÄꤷ¡¢ +2 ÈÖÌܤΥӥåȤϽñ¤­¹þ¤ßµö²Ä¤ò·èÄꤹ¤ë¡£ +¤Þ¤¿ 3 ÈÖÌܤΥӥåȤϡ¢Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¼Â¹Ôµö²Ä¤òɽ¤·¡¢ +¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¤Ï¸¡º÷µö²Ä¤òɽ¤¹¡£ + +.\"O Linux uses the fsuid instead of the effective user ID in permission checks. +.\"O Ordinarily the fsuid will equal the effective user ID, but the fsuid can be +.\"O changed by the system call +.\"O .BR setfsuid (2). +Linux ¤Ï¡¢µö²Ä¤Î¥Á¥§¥Ã¥¯¤Ë¤ª¤¤¤Æ¡¢¼Â¸ú¥æ¡¼¥¶ ID ¤Ç¤Ï¤Ê¤¯ fsuid ¤ò»È¤¦¡£ +Ä̾ï¤Ï fsuid ¤Ï¼Â¸ú¥æ¡¼¥¶ ID ¤ÈÅù¤·¤¤¤¬¡¢fsuid ¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR setfsuid (2) +¤ÇÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O (Here "fsuid" stands for something like "file system user ID". +.\"O The concept was required for the implementation of a user space +.\"O NFS server at a time when processes could send a signal to a process +.\"O with the same effective user ID. +.\"O It is obsolete now. +.\"O Nobody should use +.\"O .BR setfsuid (2).) +(¤³¤³¤Ç "fsuid" ¤Ï "file system user ID" ¤òɽ¤·¤Æ¤¤¤ë¡£ +¤³¤Î³µÇ°¤Ï¡Ö¥×¥í¥»¥¹¤¬Æ±¤¸¼Â¸ú¥æ¡¼¥¶ ID ¤ò»ý¤Ä¥×¥í¥»¥¹¤Ë +Ʊ»þ¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡×¤È¤¤¤¦¥æ¡¼¥¶¶õ´Ö NFS ¥µ¡¼¥Ð¤ò +¼ÂÁõ¤¹¤ëºÝ¤ËɬÍפǤ¢¤Ã¤¿¡£ +¤³¤ì¤Ïº£¤Ç¤ÏÇѤì¤Æ¤·¤Þ¤Ã¤¿¡£ +.BR setfsuid (2) +¤ò»È¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ + +.\"O Similarly, Linux uses the fsgid ("file system group ID") +.\"O instead of the effective group ID. +.\"O See +.\"O .BR setfsgid (2). +ƱÍͤˡ¢Linux ¤Ç¤Ï¼Â¸ú¥°¥ë¡¼¥× ID ¤ÎÂå¤ï¤ê¤Ë +fsgid ("¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥°¥ë¡¼¥×ID") ¤ò»È¤¦¡£ +.BR setfsgid (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\" FIXME say something about file system mounted read-only ? +.\"O .SS "Bypassing permission checks: superuser and capabilities" +.SS "µö²Ä¤Î³Îǧ¤ò¥¹¥­¥Ã¥×¤¹¤ë: ¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤È¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£" +.\"O On a traditional Unix system, the superuser +.\"O .RI ( root , +.\"O user ID 0) is all-powerful, and bypasses all permissions restrictions +.\"O when accessing files. +ÅÁÅýŪ¤Ê Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶ +.RI ( root , +¥æ¡¼¥¶ ID 0) ¤ÏÈó¾ï¤Ë¶¯ÎϤǤ¢¤ê¡¢¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹»þ¤Î +µö²Ä¤Ë¤è¤ëÀ©¸Â¤òÁ´¤Æ¥¹¥­¥Ã¥×¤¹¤ë¡£ +.\" (but for exec at least one x bit must be set) -- AEB +.\" but there is variation across systems on this point: for +.\" example, HP-UX and Tru64 are as described by AEB. However, +.\" on some implementations (e.g., Solaris, FreeBSD), +.\" access(X_OK) by superuser will report success, regardless +.\" of the file's execute permission bits. -- MTK (Oct 05) + +.\"O On Linux, superuser privileges are divided into capabilities (see +.\"O .BR capabilities (7)). +.\"O Two capabilities are relevant for file permissions checks: +.\"O \fBCAP_DAC_OVERRIDE\fP and \fBCAP_DAC_READ_SEARCH\fP. +.\"O (A process has these capabilities if its fsuid is 0.) +Linux ¤Ç¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¸¢¸Â¤¬Ê£¿ô¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ëʬ³ä¤µ¤ì¤Æ¤¤¤ë +.RB ( capabilities (7) +»²¾È)¡£¥Õ¥¡¥¤¥ë¤Îµö²Ä¤Î³Îǧ¤Ë¤Ï¡¢ +.B CAP_DAC_OVERRIDE +¤È +.B CAP_DAC_READ_SEARCH +¤Î 2¤Ä¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬´Ø·¸¤¹¤ë +(¥×¥í¥»¥¹¤Î fsuid ¤¬ 0 ¤Î¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¤Ï¤³¤ì¤é¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä)¡£ + +.\"O The \fBCAP_DAC_OVERRIDE\fP capability overrides all permission checking, +.\"O but only grants execute permission when at least one +.\"O of the file's three execute permission bits is set. +.B CAP_DAC_OVERRIDE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÏÁ´¤Æ¤Îµö²Ä¥Á¥§¥Ã¥¯¤ò¾å½ñ¤­¤¹¤ë¡£ +¼ÂºÝ¤Ë¤Ï¡¢ÂоݤȤʤë¥Õ¥¡¥¤¥ë¤Î 3 ¤Ä¤Î¼Â¹Ôµö²Ä¥Ó¥Ã¥È¤Î¤¦¤Á¤Î +¾¯¤Ê¤¯¤È¤â 1 ¤Ä¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢¼Â¹Ô¤òµö²Ä¤¹¤ë¤À¤±¤Ç¤¢¤ë¡£ + +.\"O The \fBCAP_DAC_READ_SEARCH\fP capability grants read and search permission +.\"O on directories, and read permission on ordinary files. +.B CAP_DAC_READ_SEARCH +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤ÆÆɤ߹þ¤ß¤È¸¡º÷¤òµö²Ä¤·¡¢ +Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤ÆÆɤ߹þ¤ß¤òµö²Ä¤¹¤ë¡£ +.\" FIXME say something about immutable files +.\" FIXME say something about ACLs +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR readlink (2), +.BR capabilities (7), +.BR credentials (7), +.BR symlink (7) diff --git a/draft/man7/pipe.7 b/draft/man7/pipe.7 new file mode 100644 index 00000000..df83f41c --- /dev/null +++ b/draft/man7/pipe.7 @@ -0,0 +1,443 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2005 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) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-12-26, Akihiro MOTOKI +.\" +.TH PIPE 7 2005-12-08 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O pipe \- overview of pipes and FIFOs +pipe \- ¥Ñ¥¤¥×¤È FIFO ¤Î³µÍ× +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Pipes and FIFOs (also known as named pipes) +.\"O provide a unidirectional interprocess communication channel. +.\"O A pipe has a +.\"O .I read end +.\"O and a +.\"O .IR "write end" . +.\"O Data written to the write end of a pipe can be read +.\"O from the read end of the pipe. +¥Ñ¥¤¥×¤È FIFO (̾Á°ÉÕ¤­¥Ñ¥¤¥×¤È¤â¤¤¤¦) ¤Ï¡¢ +ñÊý¸þ¤Î¥×¥í¥»¥¹´ÖÄÌ¿®¥Á¥ã¥Í¥ë¤òÄ󶡤¹¤ë¡£ +¥Ñ¥¤¥×¤Ë¤Ï¡ÖÆɤ߽Ф·Â¦¡×¤È¡Ö½ñ¤­¹þ¤ß¦¡×¤¬¤¢¤ë¡£ +¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤Ç½ñ¤­¹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤Ï¡¢ +¥Ñ¥¤¥×¤ÎÆɤ߽Ф·Â¦¤«¤éÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O A pipe is created using +.\"O .BR pipe (2), +.\"O which creates a new pipe and returns two file descriptors, +.\"O one referring to the read end of the pipe, +.\"O the other referring to the write end. +.\"O Pipes can be used to create a communication channel between related +.\"O processes; see +.\"O .BR pipe (2) +.\"O for an example. +¥Ñ¥¤¥×¤òºîÀ®¤¹¤ë¤Ë¤Ï +.BR pipe (2) +¤ò»ÈÍѤ¹¤ë¡£ +.BR pipe (2) +¤Ï¿·¤·¤¤¥Ñ¥¤¥×¤òºîÀ®¤·¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÆó¤ÄÊÖ¤¹¡£ +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¦¤Á¡¢°ìÊý¤Ï¥Ñ¥¤¥×¤ÎÆɤ߽Ф·Â¦¤ò¡¢¤â¤¦°ìÊý¤Ï +½ñ¤­¹þ¤ß¦¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +¥Ñ¥¤¥×¤Ï´ØÏ¢¤¹¤ë¥×¥í¥»¥¹´Ö¤ÎÄÌ¿®¤òºîÀ®¤¹¤ë¤Î¤Ë»ÈÍѤǤ­¤ë¡£ +Îã¤Ï +.BR pipe (2) +¤ò»²¾È¡£ + +.\"O A FIFO (short for First In First Out) has a name within the file +.\"O system (created using +.\"O .BR mkfifo (3)), +.\"O and is opened using +.\"O .BR open (2). +.\"O Any process may open a FIFO, assuming the file permissions allow it. +FIFO (First In First Out ¤Î¾Êά) ¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Î̾Á°¤ò»ý¤Á¡¢ +.BR open (2) +¤ò»È¤Ã¤Æ¥ª¡¼¥×¥ó¤Ç¤­¤ë +.RB ( mkfifo (3) +¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤ë)¡£ +¤É¤ó¤Ê¥×¥í¥»¥¹¤Ç¤â¡¢¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹µö²Ä¤¬¤¢¤ì¤Ð FIFO ¤ò¥ª¡¼¥×¥ó¤¹¤ë +¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O The read end is opened using the +.\"O .B O_RDONLY +.\"O flag; the write end is opened using the +.\"O .B O_WRONLY +.\"O flag. +.\"O See +.\"O .BR fifo (7) +.\"O for further details. +Æɤ߽Ф·Â¦¤ò¥ª¡¼¥×¥ó¤¹¤ë¤Ë¤Ï +.B O_RDONLY +¥Õ¥é¥°¤ò»ÈÍѤ·¡¢½ñ¤­¹þ¤ß¦¤ò¥ª¡¼¥×¥ó¤¹¤ë¤Ë¤Ï +.B O_WRONLY +¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¡£¾ÜºÙ¤Ï +.BR fifo (7) +¤ò»²¾È¡£ +.\"O .IR Note : +.\"O although FIFOs have a pathname in the file system, +.\"O I/O on FIFOs does not involve operations on the underlying device +.\"O (if there is one). +¡ÚÃí°Õ¡Û +FIFO ¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î¥Ñ¥¹Ì¾¤ò»ý¤Ä¤¬¡¢ +FIFO ¤ËÂФ·¤ÆÆþ½ÐÎϤò¹Ô¤Ã¤Æ¤â¡¢(¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬Â¸ºß¤¹¤ë¥Ç¥Ð¥¤¥¹¤¬ +¤¢¤Ã¤¿¤È¤·¤Æ¤â) ¤½¤Î¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ëÁàºî¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.\"O .SS "I/O on Pipes and FIFOs" +.SS "¥Ñ¥¤¥×¤ä FIFO ¤ËÂФ¹¤ëÆþ½ÐÎÏ" +.\"O The only difference between pipes and FIFOs is the manner in which +.\"O they are created and opened. +.\"O Once these tasks have been accomplished, +.\"O I/O on pipes and FIFOs has exactly the same semantics. +¥Ñ¥¤¥×¤È FIFO ¤Î°ã¤¤¤ÏºîÀ®¤ä¥ª¡¼¥×¥ó¤ÎÊýË¡¤À¤±¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤ÎÁàºî¤¬´°Î»¤·¤¿¸å¤Ï¡¢¥Ñ¥¤¥×¤È FIFO ¤ËÂФ¹¤ëÆþ½ÐÎÏ¤Ï +Á´¤¯Æ±¤¸»ÅÁȤߤǹԤï¤ì¤ë¡£ + +.\"O If a process attempts to read from an empty pipe, then +.\"O .BR read (2) +.\"O will block until data is available. +.\"O If a process attempts to write to a full pipe (see below), then +.\"O .BR write (2) +.\"O blocks until sufficient data has been read from the pipe +.\"O to allow the write to complete. +.\"O Nonblocking I/O is possible by using the +.\"O .BR fcntl (2) +.\"O .B F_SETFL +.\"O operation to enable the +.\"O .B O_NONBLOCK +.\"O open file status flag. +¥×¥í¥»¥¹¤¬¶õ¤Î¥Ñ¥¤¥×¤«¤éÆɤ߽Ф·¤ò¹Ô¤ª¤¦¤È¤·¤¿¾ì¹ç¡¢ +.BR read (2) +¤Ï¥Ç¡¼¥¿¤¬Æɤ߽Ф·²Äǽ¤Ë¤Ê¤ë¤Þ¤ÇÄä»ß¤¹¤ë¡£ +¥×¥í¥»¥¹¤¬¥Õ¥ë¾õÂ֤Υѥ¤¥×¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤ª¤¦¤È¤·¤¿¾ì¹ç¡¢ +.BR write (2) +¤Ï½ñ¤­¹þ¤ß¤ò´°Î»¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÎ̤Υѥ¤¥×¤«¤é¤ÎÆɤ߽Ф·¤¬ +¹Ô¤ï¤ì¤ë¤Þ¤ÇÄä»ß¤¹¤ë¡£ +ÈóÄä»ß (nonblocking) I/O ¤ò»È¤¦¤³¤È¤â¤Ç¤­¤ë¡£ +ÈóÄä»ß I/O ¤ò»È¤¦¤Ë¤Ï¡¢ +.BR fcntl (2) +.B F_SETFL +Áàºî¤ò»È¤Ã¤Æ¡¢ +.B O_NONBLOCK +¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤òÍ­¸ú¤Ë¤¹¤ë¡£ + +.\"O The communication channel provided by a pipe is a +.\"O .IR "byte stream" : +.\"O there is no concept of message boundaries. +¥Ñ¥¤¥×¤Ë¤è¤êÄ󶡤µ¤ì¤ëÄÌ¿®¥Á¥ã¥Í¥ë¤Ï¡Ö¥Ð¥¤¥È¥¹¥È¥ê¡¼¥à¡×¤Ç¤¢¤ê¡¢ +¥á¥Ã¥»¡¼¥¸¶­³¦¤Î³µÇ°¤Ï¤Ê¤¤¡£ + +.\"O If all file descriptors referring to the write end of a pipe +.\"O have been closed, then an attempt to +.\"O .BR read (2) +.\"O from the pipe will see end-of-file +.\"O .RB ( read (2) +.\"O will return 0). +¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤ò»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +¤¹¤Ù¤Æ¥¯¥í¡¼¥º¤µ¤ì¤¿¸å¤Ç¡¢¤½¤Î¥Ñ¥¤¥×¤«¤é +.BR read (2) +¤ò¹Ô¤ª¤¦¤È¤·¤¿¾ì¹ç¡¢ +end-of-file (¥Õ¥¡¥¤¥ëËöÈø) ¤¬¸«¤¨¤ë +.RB ( read (2) +¤Ï 0 ¤òÊÖ¤¹)¡£ +.\"O If all file descriptors referring to the read end of a pipe +.\"O have been closed, then a +.\"O .BR write (2) +.\"O will cause a +.\"O .B SIGPIPE +.\"O signal to be generated for the calling process. +¥Ñ¥¤¥×¤ÎÆɤ߽Ф·Â¦¤ò»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +¤¹¤Ù¤Æ¥¯¥í¡¼¥º¤µ¤ì¤¿¸å¤Ç¡¢ +.BR write (2) +¤ò¹Ô¤¦¤È¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë +.B SIGPIPE +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +.\"O If the calling process is ignoring this signal, then +.\"O .BR write (2) +.\"O fails with the error +.\"O .BR EPIPE . +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¤³¤Î¥·¥°¥Ê¥ë¤ò̵»ë¤·¤Æ¤¤¤ë¤È¤­¤Ë¤Ï¡¢ +.BR write (2) +¤Ï¥¨¥é¡¼ +.B EPIPE +¤Ç¼ºÇÔ¤¹¤ë¡£ +.\"O An application that uses +.\"O .BR pipe (2) +.\"O and +.\"O .BR fork (2) +.\"O should use suitable +.\"O .BR close (2) +.\"O calls to close unnecessary duplicate file descriptors; +.\"O this ensures that end-of-file and +.\"O .BR SIGPIPE / EPIPE +.\"O are delivered when appropriate. +.BR pipe (2) +¤È +.BR fork (2) +¤ò»ÈÍѤ¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +.BR close (2) +¤òŬÀڤ˻ȤäÆÉÔɬÍפʥե¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÊ£À½¤ò +¥¯¥í¡¼¥º¤¹¤Ù¤­¤Ç¤¢¤ë¡£¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢É¬Íפʻþ¤Ë³Î¼Â¤Ë +end-of-file ¤ä +.BR SIGPIPE / EPIPE +¤¬ÇÛÁ÷¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + +.\"O It is not possible to apply +.\"O .BR lseek (2) +.\"O to a pipe. +¥Ñ¥¤¥×¤Ë¤Ï +.BR lseek (2) +¤ò¹Ô¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\"O .SS "Pipe Capacity" +.SS ¥Ñ¥¤¥×¤ÎÍÆÎÌ +.\"O A pipe has a limited capacity. +.\"O If the pipe is full, then a +.\"O .BR write (2) +.\"O will block or fail, depending on whether the +.\"O .B O_NONBLOCK +.\"O flag is set (see below). +.\"O Different implementations have different limits for the pipe capacity. +.\"O Applications should not rely on a particular capacity: +.\"O an application should be designed so that a reading process consumes data +.\"O as soon as it is available, +.\"O so that a writing process does not remain blocked. +¥Ñ¥¤¥×¤ÎÍÆÎ̤ˤϾå¸Â¤¬¤¢¤ë¡£ +¥Ñ¥¤¥×¤¬¥Õ¥ë¤Î¾ì¹ç¡¢ +.BR write (2) +¤ÏÄä»ß¤·¤¿¤ê¼ºÇÔ¤·¤¿¤ê¤¹¤ë¡£¤É¤Á¤é¤Ë¤Ê¤ë¤«¤Ï +.B O_NONBLOCK +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ë°Í¸¤¹¤ë (²¼µ­»²¾È)¡£ +¼ÂÁõ¤Ë¤è¤ê¡¢¥Ñ¥¤¥×¤ÎÍÆÎ̤ξå¸Â¤Ï°Û¤Ê¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÏÆÃÄê¤ÎÍÆÎ̤òÁ°Äó¤Ë¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +½ñ¤­¹þ¤ß¦¤Î¥×¥í¥»¥¹¤¬Ää»ß¤·¤¿¤Þ¤Þ¤Ë¤Ê¤é¤Ê¤¤¤è¤¦¡¢ +Æɤ߽Ф·Â¦¤Î¥×¥í¥»¥¹¤Ï¥Ç¡¼¥¿¤¬ÍøÍѲÄǽ¤Ë¤Ê¤Ã¤¿¤é¤Ç¤­¤ë¤À¤±¤¹¤°¤Ë +Æɤ߽Ф·¤ò¹Ô¤¦¤è¤¦¤Ë¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òÀ߷פ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O In Linux versions before 2.6.11, the capacity of a pipe was the same as +.\"O the system page size (e.g., 4096 bytes on i386). +.\"O Since Linux 2.6.11, the pipe capacity is 65536 bytes. +¥Ð¡¼¥¸¥ç¥ó 2.6.11 ¤è¤êÁ°¤Î Linux ¤Ç¤Ï¥Ñ¥¤¥×¤ÎÍÆÎ̤ϥ·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º +¤ÈƱ¤¸¤Ç¤¢¤Ã¤¿ (Î㤨¤Ð i386 ¤Ç¤Ï 4096 ¥Ð¥¤¥È)¡£ +Linux 2.6.11 °Ê¹ß¤Ç¤Ï¡¢¥Ñ¥¤¥×¤ÎÍÆÎÌ¤Ï 65536 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +.\"O .SS PIPE_BUF +.SS PIPE_BUF +.\"O POSIX.1-2001 says that +.\"O .BR write (2)s +.\"O of less than +.\"O .B PIPE_BUF +.\"O bytes must be atomic: the output data is written to the pipe as a +.\"O contiguous sequence. +.\"O Writes of more than +.\"O .B PIPE_BUF +.\"O bytes may be nonatomic: the kernel may interleave the data +.\"O with data written by other processes. +.\"O POSIX.1-2001 requires +.\"O .B PIPE_BUF +.\"O to be at least 512 bytes. +.\"O (On Linux, +.\"O .B PIPE_BUF +.\"O is 4096 bytes.) +POSIX.1-2001 ¤Ç¤Ï¡¢ +.B PIPE_BUF +¥Ð¥¤¥È°Ê²¼¤Î +.BR write (2) +¤Ï atomic ¤Ë¹Ô¤ï¤ì¤ë¤³¤È¡¢¤Ä¤Þ¤ê¥Ñ¥¤¥×¤Ø¤Î½ÐÎϥǡ¼¥¿¤Î½ñ¤­¹þ¤ß¤Ï +Ϣ³¤·¤¿¥·¡¼¥±¥ó¥¹¤È¤·¤Æ¹Ô¤ï¤ì¤ë¤³¤È¤òɬ¿Ü¤È¤·¤Æ¤¤¤ë (MUST)¡£ +.B PIPE_BUF +¥Ð¥¤¥È¤è¤ê¿¤¯¤Î¥Ç¡¼¥¿¤ò½ñ¤­¹þ¤ß¾ì¹ç¤Ï atomic ¤È¤Ï¤Ê¤é¤Ê¤¤¡¢ +¤Ä¤Þ¤ê¥Ñ¥¤¥×¤Ø¤Î¾¤Î¥×¥í¥»¥¹¤Ë¤è¤ë¥Ç¡¼¥¿¤Î½ñ¤­¹þ¤ß¤¬´Ö¤ËÆþ¤ë +²ÄǽÀ­¤¬¤¢¤ë¡£ +POSIX.1-2001 ¤Î»ÅÍͤǤϡ¢ +.B PIPE_BUF +¤ÏºÇ¾®¤Ç¤â 512 ¥Ð¥¤¥È¤Ç¤¢¤ë¤³¤È¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë +(Linux ¤Ç¤Ï +.B PIPE_BUF +¤Ï 4096 ¥Ð¥¤¥È¤Ç¤¢¤ë)¡£ +.\"O The precise semantics depend on whether the file descriptor is nonblocking +.\"O .RB ( O_NONBLOCK ), +.\"O whether there are multiple writers to the pipe, and on +.\"O .IR n , +.\"O the number of bytes to be written: +Àµ³Î¤ÊÆ°ºî¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ nonblocking +.RB ( O_NONBLOCK ) +¤«¤É¤¦¤«¡¢¥Ñ¥¤¥×¤Ø¤Î½ñ¤­¹þ¤ß¤¬Ê£¿ô¤«¤é¹Ô¤ï¤ì¤ë¤«¤É¤¦¤«¡¢¤ª¤è¤Ó +½ñ¤­¹þ¤ß¤ò¹Ô¤¦¥Ð¥¤¥È¿ô +.I n +¤Ë¤è¤ê·èÄꤵ¤ì¤ë¡£ +.TP +.\"O \fBO_NONBLOCK\fP disabled, \fIn\fP <= \fBPIPE_BUF\fP +\fBO_NONBLOCK\fP ̵¸ú, \fIn\fP <= \fBPIPE_BUF\fP +.\"O All +.\"O .I n +.\"O bytes are written atomically; +.\"O .BR write (2) +.\"O may block if there is not room for +.\"O .I n +.\"O bytes to be written immediately +.I n +¥Ð¥¤¥ÈÁ´Éô¤Î½ñ¤­¹þ¤ß¤¬ atomic ¤Ë¹Ô¤ï¤ì¤ë¡£ +.I n +¥Ð¥¤¥Èʬ¤ò¤¹¤°¤Ë½ñ¤­¹þ¤à;ÃϤ¬¤Ê¤¤¾ì¹ç¤Ï +.BR write (2) +¤ÏÄä»ß (block) ¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +.\"O \fBO_NONBLOCK\fP enabled, \fIn\fP <= \fBPIPE_BUF\fP +\fBO_NONBLOCK\fP Í­¸ú, \fIn\fP <= \fBPIPE_BUF\fP +.\"O If there is room to write +.\"O .I n +.\"O bytes to the pipe, then +.\"O .BR write (2) +.\"O succeeds immediately, writing all +.\"O .I n +.\"O bytes; otherwise +.\"O .BR write (2) +.\"O fails, with +.\"O .I errno +.\"O set to +.\"O .BR EAGAIN . +¥Ñ¥¤¥×¤Ë +.I n +¥Ð¥¤¥È¤ò½ñ¤­¹þ¤à;ÃϤ¬¤¢¤ë¾ì¹ç¤Ï¡¢ +.I n +¥Ð¥¤¥ÈÁ´Éô¤¬¤¹¤°¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +;ÃϤ¬¤Ê¤¤¾ì¹ç¤Ï¡¢ +.BR write (2) +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.TP +.\"O \fBO_NONBLOCK\fP disabled, \fIn\fP > \fBPIPE_BUF\fP +\fBO_NONBLOCK\fP ̵¸ú, \fIn\fP > \fBPIPE_BUF\fP +.\"O The write is nonatomic: the data given to +.\"O .BR write (2) +.\"O may be interleaved with +.\"O .BR write (2)s +.\"O by other process; +.\"O the +.\"O .BR write (2) +.\"O blocks until +.\"O .I n +.\"O bytes have been written. +½ñ¤­¹þ¤ß¤Ï atomic ¤È¤Ï¤Ê¤é¤Ê¤¤¡£ +.BR write (2) +¤ËÅϤµ¤ì¤¿¥Ç¡¼¥¿¤Î´Ö¤Ë¡¢Â¾¤Î¥×¥í¥»¥¹¤Ë¤è¤ê +.BR write (2) +¤µ¤ì¤¿¥Ç¡¼¥¿¤¬Æþ¤ë¤³¤È¤¬¤¢¤ë¡£ +.BR write (2) +¤Ï +.I n +¥Ð¥¤¥È¤Î½ñ¤­¹þ¤ß¤¬´°Î»¤¹¤ë¤Þ¤ÇÄä»ß¤¹¤ë¡£ +.TP +.\"O \fBO_NONBLOCK\fP enabled, \fIn\fP > \fBPIPE_BUF\fP +\fBO_NONBLOCK\fP Í­¸ú, \fIn\fP > \fBPIPE_BUF\fP +.\"O If the pipe is full, then +.\"O .BR write (2) +.\"O fails, with +.\"O .I errno +.\"O set to +.\"O .BR EAGAIN . +.\"O Otherwise, from 1 to +.\"O .I n +.\"O bytes may be written (i.e., a "partial write" may occur; +.\"O the caller should check the return value from +.\"O .BR write (2) +.\"O to see how many bytes were actually written), +.\"O and these bytes may be interleaved with writes by other processes. +¥Ñ¥¤¥×¤¬¥Õ¥ë¤Î¾ì¹ç¡¢ +.BR write (2) +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢1 ¥Ð¥¤¥È°Ê¾å +.I n +¥Ð¥¤¥È°Ê²¼¤Î¥Ç¡¼¥¿¤¬½ñ¤­¹þ¤Þ¤ì¤ë +(¤Ä¤Þ¤ê¡Ö°ìÉôʬ¤À¤±½ñ¤­¹þ¤Þ¤ì¤ë¡×¾ì¹ç¤â¤¢¤êÆÀ¤ë)¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï +.BR write (2) +¤ÎÊÖ¤êÃͤò»²¾È¤·¡¢¼ÂºÝ¤Ë²¿¥Ð¥¤¥È½ñ¤­¹þ¤Þ¤ì¤¿¤Î¤«¤ò³Îǧ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤Þ¤¿¡¢½ñ¤­¹þ¤ß¤ËÀ®¸ù¤·¤¿¥Ç¡¼¥¿¤â¡¢Â¾¤Î¥×¥í¥»¥¹¤¬½ñ¤­¹þ¤ó¤À¥Ç¡¼¥¿¤¬ +´Ö¤ËÆþ¤ë¤³¤È¤¬¤¢¤ë¡£ +.\"O .SS "Open File Status Flags" +.SS ¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¾õÂ֥ե饰 +.\"O The only open file status flags that can be meaningfully applied to +.\"O a pipe or FIFO are +.\"O .B O_NONBLOCK +.\"O and +.\"O .BR O_ASYNC . +¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤Î¤¦¤Á¡¢¥Ñ¥¤¥×¤ä FIFO ¤ËÂФ·¤Æ°ÕÌ£¤ò»ý¤Ä¤Î¤Ï +.B O_NONBLOCK +¤È +.B O_ASYNC +¤À¤±¤Ç¤¢¤ë¡£ + +.\"O Setting the +.\"O .B O_ASYNC +.\"O flag for the read end of a pipe causes a signal +.\"O .RB ( SIGIO +.\"O by default) to be generated when new input becomes available on the pipe +.\"O (see +.\"O .BR fcntl (2) +.\"O for details). +.\"O On Linux, +.\"O .B O_ASYNC +.\"O is supported for pipes and FIFOs only since kernel 2.6. +¥Ñ¥¤¥×¤ÎÆɤ߽Ф·Â¦¤Ë +.B O_ASYNC +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢¥Ñ¥¤¥×¤Ë¿·¤¿¤ÊÆþÎϤ¬¤¢¤ë¤È¥·¥°¥Ê¥ë (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +.BR SIGIO ) +¤¬À¸À®¤µ¤ì¤ë (¾ÜºÙ¤Ï +.BR fcntl (2) +¤ò»²¾È)¡£ +Linux ¤Ç¤Ï¡¢ +¥Ñ¥¤¥×¤È FIFO ¤ËÂФ¹¤ë +.B O_ASYNC +¤Ï¥«¡¼¥Í¥ë 2.6 °Ê¹ß¤Ç¤Î¤ß¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS "Portability notes" +.SS °Ü¿¢¤Ë´Ø¤¹¤ëÃí°Õ +.\"O On some systems (but not Linux), pipes are bidirectional: +.\"O data can be transmitted in both directions between the pipe ends. +.\"O According to POSIX.1-2001, pipes only need to be unidirectional. +.\"O Portable applications should avoid reliance on +.\"O bidirectional pipe semantics. +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à (Linux ¤Ç¤Ï¤Ê¤¤) ¤Ç¤Ï¡¢¥Ñ¥¤¥×¤ÏÁÐÊý¸þ¤Ç¤¢¤ë¡¢ +¤Ä¤Þ¤ê¥Ñ¥¤¥×¤Îξü´Ö¤Ç¥Ç¡¼¥¿¤òξÊý¸þ¤ËÁ÷¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢¥Ñ¥¤¥×¤Ï°ìÊý¸þ¤ÎÄÌ¿®¤À¤±¤ËÂбþ¤·¤Æ¤¤¤ì¤Ð¤è¤¤¡£ +°Ü¿¢¤ò¹Íθ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ÁÐÊý¸þ¥Ñ¥¤¥×¤Î»ÅÁȤߤò +Á°Äó¤Ë¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR dup (2), +.BR fcntl (2), +.BR open (2), +.BR pipe (2), +.BR poll (2), +.BR select (2), +.BR socketpair (2), +.BR stat (2), +.BR mkfifo (3), +.BR epoll (7), +.BR fifo (7) diff --git a/draft/man7/posixoptions.7 b/draft/man7/posixoptions.7 new file mode 100644 index 00000000..d103f3c3 --- /dev/null +++ b/draft/man7/posixoptions.7 @@ -0,0 +1,1084 @@ +.\" 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 () +.\"O parameter used to inquire about the option, and possibly +.\"O a very short description. +POSIX ¾Êά·Á¤Î̾Á°¡¦¥ª¥×¥·¥ç¥ó¡¦¥ª¥×¥·¥ç¥ó¤òÄ´¤Ù¤ë¤¿¤á¤Î +.BR sysconf () +°ú¤­¿ô¤Î̾Á°¡¦(²Äǽ¤Ê¤é¤Ð) Èó¾ï¤Ëû¤¤ÀâÌÀ¤òµ­½Ò¤¹¤ë¡£ +.\"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/pthreads.7 b/draft/man7/pthreads.7 new file mode 100644 index 00000000..b4b3c97a --- /dev/null +++ b/draft/man7/pthreads.7 @@ -0,0 +1,1252 @@ +'\" t +.\" Copyright (c) 2005 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. +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-09-06, Akihiro MOTOKI +.\" Updated 2006-04-15, Akihiro MOTOKI, LDP v2.29 +.\" Updated 2007-01-05, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-11-05, Akihiro MOTOKI, LDP v3.12 +.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" Updated 2008-12-26, Akihiro MOTOKI, LDP v3.14 +.\" +.\"WORD: manager thread ´ÉÍý¥¹¥ì¥Ã¥É +.\"WORD: thread group ¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥× +.\"WORD: real-time signal ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë +.\"WORD: non-conformant ɸ½àÈó½àµò¤Î +.\"WORD: alternate signal stack ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯ +.\" +.TH PTHREADS 7 2008-11-18 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O pthreads \- POSIX threads +pthreads \- POSIX ¥¹¥ì¥Ã¥É +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O POSIX.1 specifies a set of interfaces (functions, header files) for +.\"O threaded programming commonly known as POSIX threads, or Pthreads. +.\"O A single process can contain multiple threads, +.\"O all of which are executing the same program. +.\"O These threads share the same global memory (data and heap segments), +.\"O but each thread has its own stack (automatic variables). +POSIX.1 ¤Ï¡¢°ìÈÌ¤Ë POSIX ¥¹¥ì¥Ã¥É¤ä Pthreads ¤È¤·¤ÆÃΤé¤ì¤ë +¥¹¥ì¥Ã¥É¡¦¥×¥í¥°¥é¥ß¥ó¥°¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹·² (´Ø¿ô¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë) +¤òµ¬Äꤷ¤Æ¤¤¤ë¡£°ì¤Ä¤Î¥×¥í¥»¥¹¤ÏÊ£¿ô¤Î¥¹¥ì¥Ã¥É¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¡¢ +Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤ÏƱ¤¸¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¡£ +¤³¤ì¤é¤Î¥¹¥ì¥Ã¥É¤ÏƱ¤¸Âç°è¥á¥â¥ê (¥Ç¡¼¥¿¤È¥Ò¡¼¥×Îΰè) ¤ò¶¦Í­¤¹¤ë¤¬¡¢ +³Æ¥¹¥ì¥Ã¥É¤Ï¼«Ê¬ÀìÍѤΥ¹¥¿¥Ã¥¯ (¼«Æ°ÊÑ¿ô) ¤ò»ý¤Ä¡£ + +.\"O POSIX.1 also requires that threads share a range of other attributes +.\"O (i.e., these attributes are process-wide rather than per-thread): +POSIX.1 ¤Ï¥¹¥ì¥Ã¥É´Ö¤Ç¤É¤Î¤è¤¦¤Ê°À­¤ò¶¦Í­¤¹¤ë¤«¤Ë¤Ä¤¤¤Æ¤âÄê¤á¤Æ¤¤¤ë +(¤Ä¤Þ¤ê¡¢¤³¤ì¤é¤Î°À­¤Ï¥¹¥ì¥Ã¥Éñ°Ì¤Ç¤Ï¤Ê¤¯¥×¥í¥»¥¹Á´ÂΤǶ¦Ä̤Ǥ¢¤ë): +.IP \- 3 +.\"O process ID +¥×¥í¥»¥¹ ID +.IP \- 3 +.\"O parent process ID +¿Æ¥×¥í¥»¥¹ ID +.IP \- 3 +.\"O process group ID and session ID +¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤È¥»¥Ã¥·¥ç¥ó ID +.IP \- 3 +.\"O controlling terminal +À©¸æüËö +.IP \- 3 +.\"O user and group IDs +¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥× ID +.IP \- 3 +.\"O open file descriptors +¥ª¡¼¥×¥ó¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.IP \- 3 +.\"O record locks (see +.\"O .BR fcntl (2)) +¥ì¥³¡¼¥É¤Î¥í¥Ã¥¯ +.RB ( fcntl (3) +»²¾È) +.IP \- 3 +.\"O signal dispositions +¥·¥°¥Ê¥ë¤ÎÇÛÃÖ +.IP \- 3 +.\"O file mode creation mask +.\"O .RB ( umask (2)) +¥Õ¥¡¥¤¥ë¥â¡¼¥ÉºîÀ®¥Þ¥¹¥¯ +.RB ( umask (2)) +.IP \- 3 +.\"O current directory +¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê +.RB ( chdir (2)) +.\"O and +.\"O root directory +¤È¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê +.RB ( chroot (2)) +.IP \- 3 +.\"O interval timers +¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ +.RB ( setitimer (2)) +.\"O and POSIX timers +¤È POSIX ¥¿¥¤¥Þ +.RB ( timer_create (2)) +.IP \- 3 +.\"O nice value +nice ÃÍ +.RB ( setpriority (2)) +.IP \- 3 +.\"O resource limits +¥ê¥½¡¼¥¹À©¸Â +.RB ( setrlimit (2)) +.IP \- 3 +.\"O measurements of the consumption of CPU time +.\"O .RB ( times (2)) +.\"O and resources +.\"O .RB ( getrusage (2)) +CPU »þ´Ö +.RB ( times (2)) +¤È¥ê¥½¡¼¥¹ +.RB ( getrusage (2)) +¤Î¾ÃÈñ¾õ¶·¤Î·×¬ +.PP +.\"O As well as the stack, POSIX.1 specifies that various other +.\"O attributes are distinct for each thread, including: +¥¹¥¿¥Ã¥¯¤Ë¤Ä¤¤¤Æ¤â¡¢POSIX.1 ¤Ï¤É¤Î¤è¤¦¤Ê°À­¤¬ +¸Ä¡¹¤Î¥¹¥ì¥Ã¥É¤ÇÆÈΩ¤Ë´ÉÍý¤µ¤ì¤ë¤«¤òµ¬Äꤷ¤Æ¤¤¤ë: +.IP \- 3 +.\"O thread ID (the +.\"O .I pthread_t +.\"O data type) +¥¹¥ì¥Ã¥É ID +.RB ( pthread_t +¥Ç¡¼¥¿·¿) +.IP \- 3 +.\"O signal mask +¥·¥°¥Ê¥ë¥Þ¥¹¥¯ +.RB ( pthread_sigmask (3)) +.IP \- 3 +.\"O the +.\"O .I errno +.\"O variable +.I errno +ÊÑ¿ô +.IP \- 3 +.\"O alternate signal stack +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯ +.RB ( sigaltstack (2)) +.IP \- 3 +.\"O real-time scheduling policy and priority +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Î¥Ý¥ê¥·¡¼¤ÈÍ¥ÀèÅÙ +.RB ( sched_setscheduler (2) +.\"O and +¤È +.BR sched_setparam (2)) +.PP +.\"O The following Linux-specific features are also per-thread: +°Ê²¼¤Î Linux ÆÃÍ­¤Îµ¡Ç½¤â¥¹¥ì¥Ã¥Éñ°Ì¤Ç¤¢¤ë: +.IP \- 3 +.\"O capabilities (see +.\"O .BR capabilities (7)) +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.RB ( capabilities (7) +»²¾È) +.IP \- 3 +.\"O CPU affinity +CPU affinity (¿ÆÏÂÅÙ) +.RB ( sched_setaffinity (2)) +.\"O .SS "Pthreads function return values" +.SS "pthreads ´Ø¿ô¤ÎÊÖ¤êÃÍ" +.\"O Most pthreads functions return 0 on success, and an error number of failure. +.\"O Note that the pthreads functions do not set +.\"O .IR errno . +.\"O For each of the pthreads functions that can return an error, +.\"O POSIX.1-2001 specifies that the function can never fail with the error +.\"O .BR EINTR . +¤Û¤È¤ó¤É¤Î pthreads ´Ø¿ô¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢ +¼ºÇÔ¤·¤¿¾ì¹ç¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹¡£ +pthreads ´Ø¿ô¤Ï +.I errno +¤ò¥»¥Ã¥È¤·¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢ +¥¨¥é¡¼¤òÊÖ¤¹²ÄǽÀ­¤Î¤¢¤ë pthreads ´Ø¿ô¤¬¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¤Èµ¬Äꤷ¤Æ¤¤¤ë¡£ +.\"O .SS Thread IDs +.SS "¥¹¥ì¥Ã¥É ID" +.\"O Each of the threads in a process has a unique thread identifier +.\"O (stored in the type +.\"O .IR pthread_t ). +.\"O This identifier is returned to the caller of +.\"O .BR pthread_create (3), +.\"O and a thread can obtain its own thread identifier using +.\"O .BR pthread_self (3). +.\"O Thread IDs are only guaranteed to be unique within a process. +.\"O A thread ID may be reused after a terminated thread has been joined, +.\"O or a detached thread has terminated. +.\"O In all pthreads functions that accept a thread ID as an argument, +.\"O that ID by definition refers to a thread in +.\"O the same process as the caller. +¤¢¤ë¥×¥í¥»¥¹Æâ¤Î³Æ¥¹¥ì¥Ã¥É¤Ï +.RI ( pthread_t +·¿¤Î) °ì°Õ¤Ê¥¹¥ì¥Ã¥É¼±Ê̻Ҥò»ý¤Ä¡£ +¤³¤Î¼±Ê̻Ҥϡ¢ +.BR pthread_create (3) +¤Î¸Æ¤Ó½Ð¤·¸µ¤ËÊÖ¤µ¤ì¤ë¡£¤Þ¤¿¡¢¥¹¥ì¥Ã¥É¤Ï¼«¿È¤Î¥¹¥ì¥Ã¥É¼±Ê̻Ҥò +.BR pthread_self (3) +¤ò»È¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£ +¥¹¥ì¥Ã¥É ID ¤Î°ì°ÕÀ­¤¬Êݾڤµ¤ì¤ë¤Î¤Ï¡¢°ì¤Ä¤Î¥×¥í¥»¥¹Æâ¤Ë¤ª¤¤¤Æ¤Î¤ß¤Ç¤¢¤ë¡£ +½ªÎ»¤·¤¿¥¹¥ì¥Ã¥É¤¬ join ¤µ¤ì¤¿¸å¤Ç¤Ï¡¢¥¹¥ì¥Ã¥É ID ¤ÏºÆÍøÍѤµ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¥¹¥ì¥Ã¥É ID ¤ò°ú¤­¿ô¤Ë¼è¤ëÁ´¤Æ¤Î¥¹¥ì¥Ã¥É´Ø¿ô¤Ë¤ª¤¤¤Æ¡¢ +¤½¤Î ID ¤Ï¸Æ¤Ó½Ð¤·¸µ¤ÈƱ¤¸¥×¥í¥»¥¹Æâ¤Î°ì¤Ä¤Î¥¹¥ì¥Ã¥É¤ò»²¾È¤¹¤ë¡£ +.\"O .SS "Thread-safe functions" +.SS "¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ê´Ø¿ô" +.\"O A thread-safe function is one that can be safely +.\"O (i.e., it will deliver the same results regardless of whether it is) +.\"O called from multiple threads at the same time. +¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ê´Ø¿ô¤Ï¡¢Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤«¤éƱ»þ¤Ë¸Æ¤Ó½Ð¤·¤Æ¤â°ÂÁ´¤Ê +(¤¹¤Ê¤ï¤Á¡¢Æ±»þ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿¤«¤Ë´Ø¤ï¤é¤º¡¢Æ±¤¸·ë²Ì¤òÊÖ¤¹) ´Ø¿ô¤Î¤³¤È¤Ç¤¢¤ë¡£ + +.\"O POSIX.1-2001 and POSIX.1-2008 require that all functions specified +.\"O in the standard shall be thread-safe, +.\"O except for the following functions: +POSIX.1-2001 ¤È POSIX.1-2008¤Ç¤Ï¡¢°ìÉô¤ÎÎã³°¤ò½ü¤­¡¢ +ɸ½à¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î´Ø¿ô¤¬¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤¢¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Îã³°¤Ç¤¢¤ë¡£ +.in +4n +.nf + +asctime() +basename() +catgets() +crypt() +.\"O ctermid() if passed a non-NULL argument +ctermid() (NULL ¤Ç¤Ê¤¤°ú¤­¿ô¤òÅϤµ¤ì¤¿¾ì¹ç) +ctime() +dbm_clearerr() +dbm_close() +dbm_delete() +dbm_error() +dbm_fetch() +dbm_firstkey() +dbm_nextkey() +dbm_open() +dbm_store() +dirname() +dlerror() +drand48() +.\"O ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)] +ecvt() [POSIX.1-2001 ¤Î¤ß (POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤¿)] +encrypt() +endgrent() +endpwent() +endutxent() +.\"O fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)] +fcvt() [POSIX.1-2001 ¤Î¤ß (POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤¿)] +ftw() +.\"O gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)] +gcvt() [POSIX.1-2001 ¤Î¤ß (POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤¿)] +getc_unlocked() +getchar_unlocked() +getdate() +getenv() +getgrent() +getgrgid() +getgrnam() +.\"O gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)] +.\"O gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)] +gethostbyaddr() [POSIX.1-2001 ¤Î¤ß (POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤¿)] +gethostbyname() [POSIX.1-2001 ¤Î¤ß (POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤¿)] +gethostent() +getlogin() +getnetbyaddr() +getnetbyname() +getnetent() +getopt() +getprotobyname() +getprotobynumber() +getprotoent() +getpwent() +getpwnam() +getpwuid() +getservbyname() +getservbyport() +getservent() +getutxent() +getutxid() +getutxline() +gmtime() +hcreate() +hdestroy() +hsearch() +inet_ntoa() +l64a() +lgamma() +lgammaf() +lgammal() +localeconv() +localtime() +lrand48() +mrand48() +nftw() +nl_langinfo() +ptsname() +putc_unlocked() +putchar_unlocked() +putenv() +pututxline() +rand() +readdir() +setenv() +setgrent() +setkey() +setpwent() +setutxent() +strerror() +.\"O strsignal() [Added in POSIX.1-2008] +strsignal() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +strtok() +.\"O system() [Added in POSIX.1-2008] +system() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +.\"O tmpnam() if passed a non-NULL argument +tmpnam() (NULL ¤Ç¤Ê¤¤°ú¤­¿ô¤òÅϤµ¤ì¤¿¾ì¹ç) +ttyname() +unsetenv() +.\"O wcrtomb() if its final argument is NULL +wcrtomb() (ºÇ¸å¤Î°ú¤­¿ô¤¬ NULL ¤Î¾ì¹ç) +.\"O wcsrtombs() if its final argument is NULL +wcsrtombs() (ºÇ¸å¤Î°ú¤­¿ô¤¬ NULL ¤Î¾ì¹ç) +wcstombs() +wctomb() +.fi +.in +.\"O .SS Cancellation Points +.SS ¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È (cancellation points) +.\"O POSIX.1 specifies that certain functions must, +.\"O and certain other functions may, be cancellation points. +.\"O If a thread is cancelable, its cancelability type is deferred, +.\"O and a cancellation request is pending for the thread, +.\"O then the thread is canceled when it calls a function +.\"O that is a cancellation point. +POSIX.1 ¤Îµ¬Äê¤Ç¤Ï¡¢ÆÃÄê¤Î´Ø¿ô¤Ï¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¾¤ÎÆÃÄê¤Î´Ø¿ô¤Ï¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¤È¤µ¤ì¤Æ¤¤¤ë¡£ +¤¢¤ë¥¹¥ì¥Ã¥É¤¬¼è¤ê¾Ã¤·²Äǽ¤Ç¡¢¤½¤Î¼è¤ê¾Ã¤·¼ïÊÌ (cancelability type) +¤¬±ä´ü (deferred) ¤Ç¡¢¤½¤Î¥¹¥ì¥Ã¥É¤ËÂФ¹¤ë¼è¤ê¾Ã¤·Í׵᤬½èÍýÂÔ¤Á¤Î¾ì¹ç¡¢ +¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È¤Ç¤¢¤ë´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿»þÅÀ¤Ç¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Î¥­¥ã¥ó¥»¥ë¤¬ +¹Ô¤ï¤ì¤ë¡£ + +.\"O The following functions are required to be cancellation points by +.\"O POSIX.1-2001 and/or POSIX.1-2008: +POSIX.1-2001 ¤È POSIX.1-2008 ¤ÎξÊý¡¢¤â¤·¤¯¤Ï¤¤¤º¤ì¤«°ìÊý¤Ç¤Ï¡¢ +°Ê²¼¤Î´Ø¿ô¤Ï¡¢¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È (cancellation points) ¤Ç +¤¢¤ë¤³¤È¤¬É¬¿Ü¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ + +.\" FIXME +.\" Document the list of all functions that are cancellation points in glibc +.in +4n +.nf +accept() +aio_suspend() +clock_nanosleep() +close() +connect() +creat() +fcntl() F_SETLKW +fdatasync() +fsync() +getmsg() +getpmsg() +lockf() F_LOCK +mq_receive() +mq_send() +mq_timedreceive() +mq_timedsend() +msgrcv() +msgsnd() +msync() +nanosleep() +open() +.\"O openat() [Added in POSIX.1-2008] +openat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +pause() +poll() +pread() +pselect() +pthread_cond_timedwait() +pthread_cond_wait() +pthread_join() +pthread_testcancel() +putmsg() +putpmsg() +pwrite() +read() +readv() +recv() +recvfrom() +recvmsg() +select() +sem_timedwait() +sem_wait() +send() +sendmsg() +sendto() +.\"O sigpause() [POSIX.1-2001 only (moves to "may" list in POSIX.1-2008)] +sigpause() [POSIX.1-2001 only (moves to "may" list in POSIX.1-2008)] +sigsuspend() +sigtimedwait() +sigwait() +sigwaitinfo() +sleep() +system() +tcdrain() +.\"O usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)] +usleep() [POSIX.1-2001 ¤Î¤ß (POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤¿)] +wait() +waitid() +waitpid() +write() +writev() +.fi +.in + +.\"O The following functions may be cancellation points according to +.\"O POSIX.1-2001 and/or POSIX.1-2008: +POSIX.1-2001 ¤È POSIX.1-2008 ¤ÎξÊý¡¢¤â¤·¤¯¤Ï¤¤¤º¤ì¤«°ìÊý¤Ç¤Ï¡¢ +°Ê²¼¤Î´Ø¿ô¤Ï¡¢¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È (cancellation points) ¤Ç +¤¢¤Ã¤Æ¤â¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ + +.in +4n +.nf +access() +asctime() +asctime_r() +catclose() +catgets() +catopen() +.\"O chmod() [Added in POSIX.1-2008] +.\"O chown() [Added in POSIX.1-2008] +chmod() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +chown() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +closedir() +closelog() +ctermid() +ctime() +ctime_r() +dbm_close() +dbm_delete() +dbm_fetch() +dbm_nextkey() +dbm_open() +dbm_store() +dlclose() +dlopen() +.\"O dprintf() [Added in POSIX.1-2008] +dprintf() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +endgrent() +endhostent() +endnetent() +endprotoent() +endpwent() +endservent() +endutxent() +.\"O faccessat() [Added in POSIX.1-2008] +.\"O fchmod() [Added in POSIX.1-2008] +.\"O fchmodat() [Added in POSIX.1-2008] +.\"O fchown() [Added in POSIX.1-2008] +.\"O fchownat() [Added in POSIX.1-2008] +faccessat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +fchmod() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +fchmodat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +fchown() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +fchownat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +fclose() +.\"O fcntl() (for any value of cmd argument) +fcntl() (cmd °ú¤­¿ô¤¬²¿¤Ç¤¢¤Ã¤Æ¤â) +fflush() +fgetc() +fgetpos() +fgets() +fgetwc() +fgetws() +fmtmsg() +fopen() +fpathconf() +fprintf() +fputc() +fputs() +fputwc() +fputws() +fread() +freopen() +fscanf() +fseek() +fseeko() +fsetpos() +fstat() +.\"O fstatat() [Added in POSIX.1-2008] +fstatat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +ftell() +ftello() +ftw() +.\"O futimens() [Added in POSIX.1-2008] +futimens() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +fwprintf() +fwrite() +fwscanf() +getaddrinfo() +getc() +getc_unlocked() +getchar() +getchar_unlocked() +getcwd() +getdate() +.\"O getdelim() [Added in POSIX.1-2008] +getdelim() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +getgrent() +getgrgid() +getgrgid_r() +getgrnam() +getgrnam_r() +.\"O gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)] +.\"O gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)] +gethostbyaddr() [SUSv3 ¤Î¤ß (¤³¤Î´Ø¿ô¤Ï POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤Æ¤¤¤ë)] +gethostbyname() [SUSv3 ¤Î¤ß (¤³¤Î´Ø¿ô¤Ï POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤Æ¤¤¤ë)] +gethostent() +gethostid() +gethostname() +.\"O getline() [Added in POSIX.1-2008] +getline() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +getlogin() +getlogin_r() +getnameinfo() +getnetbyaddr() +getnetbyname() +getnetent() +.\"O getopt() (if opterr is nonzero) +getopt() (opterr ¤¬ 0 °Ê³°¤Î¾ì¹ç) +getprotobyname() +getprotobynumber() +getprotoent() +getpwent() +getpwnam() +getpwnam_r() +getpwuid() +getpwuid_r() +gets() +getservbyname() +getservbyport() +getservent() +getutxent() +getutxid() +getutxline() +getwc() +getwchar() +.\"O getwd() [SUSv3 only (function removed in POSIX.1-2008)] +getwd() [SUSv3 ¤Î¤ß (¤³¤Î´Ø¿ô¤Ï POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤Æ¤¤¤ë)] +glob() +iconv_close() +iconv_open() +ioctl() +link() +.\"O linkat() [Added in POSIX.1-2008] +.\"O lio_listio() [Added in POSIX.1-2008] +linkat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +lio_listio() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +localtime() +localtime_r() +.\"O lockf() [Added in POSIX.1-2008] +lockf() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +lseek() +lstat() +.\"O mkdir() [Added in POSIX.1-2008] +.\"O mkdirat() [Added in POSIX.1-2008] +.\"O mkdtemp() [Added in POSIX.1-2008] +.\"O mkfifo() [Added in POSIX.1-2008] +.\"O mkfifoat() [Added in POSIX.1-2008] +.\"O mknod() [Added in POSIX.1-2008] +.\"O mknodat() [Added in POSIX.1-2008] +mkdir() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mkdirat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mkdtemp() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mkfifo() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mkfifoat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mknod() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mknodat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mkstemp() +mktime() +nftw() +opendir() +openlog() +pathconf() +pclose() +perror() +popen() +posix_fadvise() +posix_fallocate() +posix_madvise() +posix_openpt() +posix_spawn() +posix_spawnp() +posix_trace_clear() +posix_trace_close() +posix_trace_create() +posix_trace_create_withlog() +posix_trace_eventtypelist_getnext_id() +posix_trace_eventtypelist_rewind() +posix_trace_flush() +posix_trace_get_attr() +posix_trace_get_filter() +posix_trace_get_status() +posix_trace_getnext_event() +posix_trace_open() +posix_trace_rewind() +posix_trace_set_filter() +posix_trace_shutdown() +posix_trace_timedgetnext_event() +posix_typed_mem_open() +printf() +.\"O psiginfo() [Added in POSIX.1-2008] +.\"O psignal() [Added in POSIX.1-2008] +psiginfo() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +psignal() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +pthread_rwlock_rdlock() +pthread_rwlock_timedrdlock() +pthread_rwlock_timedwrlock() +pthread_rwlock_wrlock() +putc() +putc_unlocked() +putchar() +putchar_unlocked() +puts() +pututxline() +putwc() +putwchar() +readdir() +readdir_r() +.\"O readlink() [Added in POSIX.1-2008] +.\"O readlinkat() [Added in POSIX.1-2008] +readlink() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +readlinkat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +remove() +rename() +.\"O renameat() [Added in POSIX.1-2008] +renameat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +rewind() +rewinddir() +.\"O scandir() [Added in POSIX.1-2008] +scandir() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +scanf() +seekdir() +semop() +setgrent() +sethostent() +setnetent() +setprotoent() +setpwent() +setservent() +setutxent() +.\"O sigpause() [Added in POSIX.1-2008] +sigpause() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +stat() +strerror() +strerror_r() +strftime() +symlink() +.\"O symlinkat() [Added in POSIX.1-2008] +symlinkat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +sync() +syslog() +tmpfile() +tmpnam() +ttyname() +ttyname_r() +tzset() +ungetc() +ungetwc() +unlink() +.\"O unlinkat() [Added in POSIX.1-2008] +.\"O utime() [Added in POSIX.1-2008] +.\"O utimensat() [Added in POSIX.1-2008] +.\"O utimes() [Added in POSIX.1-2008] +.\"O vdprintf() [Added in POSIX.1-2008] +unlinkat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +utime() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +utimensat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +utimes() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +vdprintf() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +vfprintf() +vfwprintf() +vprintf() +vwprintf() +wcsftime() +wordexp() +wprintf() +wscanf() +.fi +.in + +.\"O An implementation may also mark other functions +.\"O not specified in the standard as cancellation points. +.\"O In particular, an implementation is likely to mark +.\"O any nonstandard function that may block as a cancellation point. +.\"O (This includes most functions that can touch files.) +¼ÂÁõ»þ¤Ë¡¢É¸½àµ¬³Ê¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤½¤Î¾¤Î´Ø¿ô¤ò¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È +¤È¤¹¤ë¤³¤È¤âǧ¤á¤é¤ì¤Æ¤¤¤ë¡£ +Æäˡ¢Ää»ß (block) ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ëÈóɸ½à¤Î´Ø¿ô¤ò¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È¤È +¤¹¤ë¼ÂÁõ¤Ï¤¢¤êÆÀ¤ë¤³¤È¤À¤í¤¦ +(¥Õ¥¡¥¤¥ë¤ò°·¤¦²ÄǽÀ­¤Î¤¢¤ë¤Û¤È¤ó¤É¤Î´Ø¿ô¤¬¤³¤ì¤Ë´Þ¤Þ¤ì¤ë)¡£ +.\" So, scanning "cancellation point" comments in the glibc 2.8 header +.\" files, it looks as though at least the following nonstandard +.\" functions are cancellation points: +.\" endnetgrent +.\" endspent +.\" epoll_pwait +.\" epoll_wait +.\" fcloseall +.\" fdopendir +.\" fflush_unlocked +.\" fgetc_unlocked +.\" fgetgrent +.\" fgetgrent_r +.\" fgetpwent +.\" fgetpwent_r +.\" fgets_unlocked +.\" fgetspent +.\" fgetspent_r +.\" fgetwc_unlocked +.\" fgetws_unlocked +.\" fputc_unlocked +.\" fputs_unlocked +.\" fputwc_unlocked +.\" fputws_unlocked +.\" fread_unlocked +.\" fwrite_unlocked +.\" gai_suspend +.\" getaddrinfo_a +.\" getdate_r +.\" getgrent_r +.\" getgrouplist +.\" gethostbyaddr_r +.\" gethostbyname2 +.\" gethostbyname2_r +.\" gethostbyname_r +.\" gethostent_r +.\" getnetbyaddr_r +.\" getnetbyname_r +.\" getnetent_r +.\" getnetgrent +.\" getnetgrent_r +.\" getprotobyname_r +.\" getprotobynumber_r +.\" getprotoent_r +.\" getpw +.\" getpwent_r +.\" getservbyname_r +.\" getservbyport_r +.\" getservent_r +.\" getspent +.\" getspent_r +.\" getspnam +.\" getspnam_r +.\" getutmp +.\" getutmpx +.\" getw +.\" getwc_unlocked +.\" getwchar_unlocked +.\" initgroups +.\" innetgr +.\" mkostemp +.\" mkostemp64 +.\" mkstemp64 +.\" ppoll +.\" pthread_timedjoin_np +.\" putgrent +.\" putpwent +.\" putspent +.\" putw +.\" putwc_unlocked +.\" putwchar_unlocked +.\" rcmd +.\" rcmd_af +.\" rexec +.\" rexec_af +.\" rresvport +.\" rresvport_af +.\" ruserok +.\" ruserok_af +.\" setnetgrent +.\" setspent +.\" sgetspent +.\" sgetspent_r +.\" updwtmpx +.\" utmpxname +.\" vfscanf +.\" vfwscanf +.\" vscanf +.\" vsyslog +.\" vwscanf +.\"O .SS "Compiling on Linux" +.SS "Linux ¤Ç¤Î¥³¥ó¥Ñ¥¤¥ë" +.\"O On Linux, programs that use the Pthreads API should be compiled using +.\"O .IR "cc \-pthread" . +Linux ¤Ç¤Ï¡¢Pthreads API ¤òÍѤ¤¤¿¥×¥í¥°¥é¥à¤Ï +.I "cc \-pthread" +¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SS "Linux Implementations of POSIX Threads" +.SS "POSIX ¥¹¥ì¥Ã¥É¤Î Linux ¤Ç¤Î¼ÂÁõ" +.\"O Over time, two threading implementations have been provided by +.\"O the GNU C library on Linux: +¤³¤ì¤Þ¤Ç¡¢2¤Ä¤Î¥¹¥ì¥Ã¥É¤Î¼ÂÁõ¤¬ Linux ¤Î GNU C ¥é¥¤¥Ö¥é¥ê¤Ë¤è¤ê +Ä󶡤µ¤ì¤Æ¤­¤¿¡£ +.TP +.B LinuxThreads +.\"O This is the original Pthreads implementation. +.\"O Since glibc 2.4, this implementation is no longer supported. +ºÇ½é¤Î Pthreads ¤Î¼ÂÁõ¡£ +glibc 2.4 °Ê¹ß¤Ï¡¢¤³¤Î¼ÂÁõ¤Ï¤â¤Ï¤ä¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.BR NPTL " (Native POSIX Threads Library)" +.\"O This is the modern Pthreads implementation. +.\"O By comparison with LinuxThreads, NPTL provides closer conformance to +.\"O the requirements of the POSIX.1 specification and better performance +.\"O when creating large numbers of threads. +.\"O NPTL is available since glibc 2.3.2, +.\"O and requires features that are present in the Linux 2.6 kernel. +¿·¤·¤¤ Pthreads ¤Î¼ÂÁõ¡£LinuxThreads ¤ÈÈæ¤Ù¤ë¤È¡¢ +NPTL ¤Ï POSIX.1 ¤ÎÍ×µá»ÅÍͤؤνàµò¤ÎÅٹ礤¤¬¹â¤¯¡¢ +¿¿ô¤Î¥¹¥ì¥Ã¥É¤òºîÀ®¤·¤¿ºÝ¤ÎÀ­Ç½¤â¹â¤¤¡£ +NPTL ¤Ï glibc 2.3.2 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +NPTL ¤òÍøÍѤ¹¤ë¤Ë¤Ï Linux 2.6 ¥«¡¼¥Í¥ë¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ëµ¡Ç½¤¬É¬ÍפǤ¢¤ë¡£ +.PP +.\"O Both of these are so-called 1:1 implementations, meaning that each +.\"O thread maps to a kernel scheduling entity. +¤É¤Á¤é¤Î¼ÂÁõ¤â¤¤¤ï¤æ¤ë 1:1 ¼ÂÁõ¡¢¤¹¤Ê¤ï¤Á¸Ä¡¹¤Î¥¹¥ì¥Ã¥É¤¬ +¥«¡¼¥Í¥ë¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¼ÂÂΤ˥ޥåԥ󥰤µ¤ì¤ë¡£ +.\"O Both threading implementations employ the Linux +.\"O .BR clone (2) +.\"O system call. +.\"O In NPTL, thread synchronization primitives (mutexes, +.\"O thread joining, etc.) are implemented using the Linux +.\"O .BR futex (2) +.\"O system call. +¤É¤Á¤é¤Î¥¹¥ì¥Ã¥É¤Î¼ÂÁõ¤â Linux ¤Î +.BR clone (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍøÍѤ·¤Æ¤¤¤ë¡£ +NPTL ¤Ç¤Ï¡¢¥¹¥ì¥Ã¥ÉƱ´ü¤Î´ðËܵ¡¹½ (mutex ¤ä ¥¹¥ì¥Ã¥É¤Î join Åù) ¤Ï +Linux ¤Î +.BR futex (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SS LinuxThreads +.\"O The notable features of this implementation are the following: +¤³¤Î¼ÂÁõ¤ÎÂ礭¤ÊÆÃħ¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.IP \- 3 +.\"O In addition to the main (initial) thread, +.\"O and the threads that the program creates using +.\"O .BR pthread_create (3), +.\"O the implementation creates a "manager" thread. +.\"O This thread handles thread creation and termination. +.\"O (Problems can result if this thread is inadvertently killed.) +¥á¥¤¥ó¥¹¥ì¥Ã¥É (ºÇ½é¤Î¥¹¥ì¥Ã¥É) ¤È¥×¥í¥°¥é¥à¤¬ +.BR pthread_create (3) +¤ò»È¤Ã¤ÆºîÀ®¤·¤¿¥¹¥ì¥Ã¥É¤Ë²Ã¤¨¡¢ +¤³¤Î¼ÂÁõ¤Ç¤Ï¡Ö´ÉÍý (manager)¡×¥¹¥ì¥Ã¥É¤¬ºîÀ®¤µ¤ì¤ë¡£ +´ÉÍý¥¹¥ì¥Ã¥É¤Ï¥¹¥ì¥Ã¥É¤ÎºîÀ®¤È½ªÎ»¤ò¼è¤ê°·¤¦ +(¤³¤Î¥¹¥ì¥Ã¥É¤¬¤¦¤Ã¤«¤ê kill ¤µ¤ì¤ë¤È¡¢ÌäÂ꤬µ¯¤³¤ë¤³¤È¤¬¤¢¤ë)¡£ +.IP \- 3 +.\"O Signals are used internally by the implementation. +.\"O On Linux 2.2 and later, the first three real-time signals are used +.\"O (see also +.\"O .BR signal (7)). +.\"O On older Linux kernels, +.\"O .B SIGUSR1 +.\"O and +.\"O .B SIGUSR2 +.\"O are used. +.\"O Applications must avoid the use of whichever set of signals is +.\"O employed by the implementation. +¤³¤Î¼ÂÁõ¤Ç¤ÏÆâÉô¤Ç¥·¥°¥Ê¥ë¤ò»ÈÍѤ·¤Æ¤¤¤ë¡£ +Linux 2.2 °Ê¹ß¤Ç¤Ï¡¢¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î¤¦¤ÁºÇ½é¤Î 3¤Ä¤¬»È¤ï¤ì¤ë +.RB ( signal (7) +»²¾È)¡£ +¤½¤ì°ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï +.B SIGUSR1 +¤È +.B SIGUSR2 +¤¬»È¤ï¤ì¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢¥¹¥ì¥Ã¥É¼ÂÁõ¤ÇÍøÍѤµ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤ò +¤É¤ì¤â»È¤ï¤Ê¤¤¤è¤¦¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP \- 3 +.\"O Threads do not share process IDs. +.\"O (In effect, LinuxThreads threads are implemented as processes which share +.\"O more information than usual, but which do not share a common process ID.) +.\"O LinuxThreads threads (including the manager thread) +.\"O are visible as separate processes using +.\"O .BR ps (1). +¥¹¥ì¥Ã¥É´Ö¤Ç¥×¥í¥»¥¹ ID ¤ò¶¦Í­¤·¤Ê¤¤ +(¼ÂºÝ¤Ë¤Ï LinuxThreads ¤Î¥¹¥ì¥Ã¥É¤ÏÄ̾ï¤è¤ê¤Ï¾ðÊó¤ò¶¦Í­¤¹¤ë¥×¥í¥»¥¹¤È¤·¤Æ +¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢°ì¤Ä¤Î¶¦ÄÌ¤Î¥×¥í¥»¥¹ ID ¤ò¶¦Í­¤·¤Æ¤Ï¤¤¤Ê¤¤)¡£ +(´ÉÍý¥¹¥ì¥Ã¥É¤ò´Þ¤à) LinuxThreads ¥¹¥ì¥Ã¥É¤Ï +.BR ps (1) +¤ò»È¤¦¤ÈÊÌ¤Î¥×¥í¥»¥¹¤Î¤è¤¦¤Ë¸«¤¨¤ë¡£ +.PP +.\"O The LinuxThreads implementation deviates from the POSIX.1 +.\"O specification in a number of ways, including the following: +LinuxThreads ¤Î¼ÂÁõ¤Ç¤Ï POSIX.1 »ÅÍͤ«¤é°ï椷¤Æ¤¤¤ëÅÀ¤¬ +¤¤¤¯¤Ä¤«¤¢¤ë¡£°Ê²¼¤Ë¼¨¤¹¤è¤¦¤ÊÅÀ¤¬¤¢¤ë: +.IP \- 3 +.\"O Calls to +.\"O .BR getpid (2) +.\"O return a different value in each thread. +.BR getpid (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤­¤Ë¡¢¥¹¥ì¥Ã¥ÉËè¤Ë°Û¤Ê¤ëÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +.IP \- 3 +.\"O Calls to +.\"O .BR getppid (2) +.\"O in threads other than the main thread return the process ID of the +.\"O manager thread; instead +.\"O .BR getppid (2) +.\"O in these threads should return the same value as +.\"O .BR getppid (2) +.\"O in the main thread. +¥á¥¤¥ó¥¹¥ì¥Ã¥É°Ê³°¤Î¥¹¥ì¥Ã¥É¤Ç +.BR getppid (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢´ÉÍý¥¹¥ì¥Ã¥É¤Î¥×¥í¥»¥¹ ID ¤¬ÊÖ¤µ¤ì¤ë¡£ +ËÜÅö¤Ï¡¢¤³¤ì¤é¤Î¥¹¥ì¥Ã¥É¤Ç +.BR getppid (2) +¤ò¸Æ¤ó¤À¾ì¹ç¤Ë¤Ï¥á¥¤¥ó¥¹¥ì¥Ã¥É¤Ç¤Î +.BR getppid (2) +¤ÈƱ¤¸Ãͤ¬ÊÖ¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.IP \- 3 +.\"O When one thread creates a new child process using +.\"O .BR fork (2), +.\"O any thread should be able to +.\"O .BR wait (2) +.\"O on the child. +.\"O However, the implementation only allows the thread that +.\"O created the child to +.\"O .BR wait (2) +.\"O on it. +¤¢¤ë¥¹¥ì¥Ã¥É¤¬ +.BR fork (2) +¤ò»È¤Ã¤Æ¿·¤·¤¤»Ò¥×¥í¥»¥¹¤òºîÀ®¤·¤¿¾ì¹ç¡¢ +¤É¤Î¥¹¥ì¥Ã¥É¤Ç¤â¤³¤Î»Ò¥×¥í¥»¥¹¤ò +.BR wait (2) +¤Ç¤­¤ë¤Ù¤­¤Ç¤¢¤ë¡£¤·¤«¤·¤Ê¤¬¤é¡¢¤³¤Î¼ÂÁõ¤Ç¤Ï»Ò¥×¥í¥»¥¹¤òºîÀ®¤·¤¿ +¥¹¥ì¥Ã¥É¤À¤±¤¬¤³¤Î»Ò¥×¥í¥»¥¹¤ò +.BR wait (2) +¤Ç¤­¤ë¡£ +.IP \- 3 +.\"O When a thread calls +.\"O .BR execve (2), +.\"O all other threads are terminated (as required by POSIX.1). +.\"O However, the resulting process has the same PID as the thread that called +.\"O .BR execve (2): +.\"O it should have the same PID as the main thread. +¤¢¤ë¥¹¥ì¥Ã¥É¤¬ +.BR execve (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤ÏÁ´¤Æ½ªÎ»¤µ¤ì¤ë (POSIX.1 ¤Î»ÅÍÍÄ̤ê)¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¿·¤·¤¤¥×¥í¥»¥¹¤Ï +.BR execve (2) +¤ò¸Æ¤ó¤À¥¹¥ì¥Ã¥É¤ÈƱ¤¸ PID ¤ò»ý¤Ä¡£Àµ¤·¤¯¤Ï +¥á¥¤¥ó¥¹¥ì¥Ã¥É¤ÈƱ¤¸ PID ¤ò»ý¤Ä¤Ù¤­¤Ç¤¢¤ë¡£ +.IP \- 3 +.\"O Threads do not share user and group IDs. +.\"O This can cause complications with set-user-ID programs and +.\"O can cause failures in Pthreads functions if an application +.\"O changes its credentials using +.\"O .BR seteuid (2) +.\"O or similar. +¥¹¥ì¥Ã¥É´Ö¤Ç¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥× ID ¤¬¶¦Í­¤µ¤ì¤Ê¤¤ +¤³¤Î¤³¤È¤Ï¡¢set-user-ID ¥×¥í¥°¥é¥à¤ÇÌÌÅݤʻöÂÖ¤ò¾·¤¤¤¿¤ê¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ +.BR seteuid (2) +¤Ê¤É¤ò»È¤Ã¤Æ¿®ÍѾðÊó (credentials) ¤òÊѹ¹¤·¤¿¾ì¹ç¤Ë +Pthreads ´Ø¿ô¤¬¼ºÇÔ¤¹¤ë¸¶°ø¤È¤Ê¤ë¡£ +.IP \- 3 +.\"O Threads do not share a common session ID and process group ID. +¥¹¥ì¥Ã¥É´Ö¤Ç¶¦Ä̤Υ»¥Ã¥·¥ç¥ó ID ¤ä¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤ò¶¦Í­¤·¤Ê¤¤¡£ +.IP \- 3 +.\"O Threads do not share record locks created using +.\"O .BR fcntl (2). +¥¹¥ì¥Ã¥É´Ö¤Ç +.BR fcntl (2) +¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤ë¥ì¥³¡¼¥É¡¦¥í¥Ã¥¯¤ò¶¦Í­¤·¤Ê¤¤¡£ +.IP \- 3 +.\"O The information returned by +.\"O .BR times (2) +.\"O and +.\"O .BR getrusage (2) +.\"O is per-thread rather than process-wide. +.BR times (2) +¤È +.BR getrusage (2) +¤¬ÊÖ¤¹¾ðÊó¤¬¥×¥í¥»¥¹Á´ÂΤξðÊó¤Ç¤Ê¤¯¥¹¥ì¥Ã¥Éñ°Ì¤Î¾ðÊó¤Ç¤¢¤ë¡£ +.IP \- 3 +.\"O Threads do not share semaphore undo values (see +.\"O .BR semop (2)). +¥¹¥ì¥Ã¥É´Ö¤Ç¥»¥Þ¥Õ¥©¤Î¥¢¥ó¥É¥¥ÃÍ +.RB ( semop (2) +»²¾È) ¤ò¶¦Í­¤·¤Ê¤¤¡£ +.IP \- 3 +.\"O Threads do not share interval timers. +¥¹¥ì¥Ã¥É´Ö¤Ç¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¤ò¶¦Í­¤·¤Ê¤¤¡£ +.IP \- 3 +.\"O Threads do not share a common nice value. +¥¹¥ì¥Ã¥É¤Ï¶¦Ä̤Πnice Ãͤò¶¦Í­¤·¤Ê¤¤¡£ +.IP \- 3 +.\"O POSIX.1 distinguishes the notions of signals that are directed +.\"O to the process as a whole and signals that are directed to individual +.\"O threads. +.\"O According to POSIX.1, a process-directed signal (sent using +.\"O .BR kill (2), +.\"O for example) should be handled by a single, +.\"O arbitrarily selected thread within the process. +.\"O LinuxThreads does not support the notion of process-directed signals: +.\"O signals may only be sent to specific threads. +POSXI.1 ¤Ç¤Ï¡¢Á´ÂΤȤ·¤Æ¤Î¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤ë¥·¥°¥Ê¥ë¤È¡¢ +¸ÄÊ̤Υ¹¥ì¥Ã¥É¤ËÁ÷¤é¤ì¤ë¥·¥°¥Ê¥ë¤ò¶èÊ̤·¤Æ¹Í¤¨¤Æ¤¤¤ë¡£ +POSIX.1 ¤Ë¤è¤ë¤È¡¢¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤¿¥·¥°¥Ê¥ë (Î㤨¤Ð +.BR kill (2) +¤ò»È¤Ã¤ÆÁ÷¤ë) ¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Ë°¤¹¥¹¥ì¥Ã¥É¤Î¤¦¤Á +¾¡¼ê¤Ë (arbitrarily) ¤ËÁªÂò¤µ¤ì¤¿°ì¤Ä¤Î¥¹¥ì¥Ã¥É¤Ë¤è¤ê½èÍý¤µ¤ì¤ë +¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£LinuxThreads ¤Ï¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤ë¥·¥°¥Ê¥ë¤Î +³µÇ°¤ËÂбþ¤·¤Æ¤ª¤é¤º¡¢¥·¥°¥Ê¥ë¤ÏÆÃÄê¤Î¥¹¥ì¥Ã¥É¤Ë¤À¤±Á÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.IP \- 3 +.\"O Threads have distinct alternate signal stack settings. +.\"O However, a new thread's alternate signal stack settings +.\"O are copied from the thread that created it, so that +.\"O the threads initially share an alternate signal stack. +.\"O (A new thread should start with no alternate signal stack defined. +.\"O If two threads handle signals on their shared alternate signal +.\"O stack at the same time, unpredictable program failures are +.\"O likely to occur.) +¥¹¥ì¥Ã¥É¤Ï¤½¤ì¤¾¤ì¤ÎÆȼ«¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ÎÀßÄê¤ò»ý¤Ä¡£ +¤·¤«¤·¡¢¿·¤·¤¤¥¹¥ì¥Ã¥É¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ÎÀßÄê¤Ï +¤½¤Î¥¹¥ì¥Ã¥É¤òºîÀ®¤·¤¿¥¹¥ì¥Ã¥É¤«¤é¥³¥Ô¡¼¤µ¤ì¡¢¤½¤Î¤¿¤á +¥¹¥ì¥Ã¥É¤ÏºÇ½é¤Ï°ì¤Ä¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò¶¦Í­¤¹¤ë¡£ +(»ÅÍͤǤϡ¢¿·¤·¤¤¥¹¥ì¥Ã¥É¤ÏÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¾õÂÖ +¤Ç³«»Ï¤µ¤ì¤ë¤Ù¤­¤È¤µ¤ì¤Æ¤¤¤ë¡£ +2¤Ä¤Î¥¹¥ì¥Ã¥É¤¬¶¦Í­¤µ¤ì¤Æ¤¤¤ëÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤ÇƱ»þ¤Ë +¥·¥°¥Ê¥ë¤Î½èÍý¤ò¹Ô¤Ã¤¿¾ì¹ç¡¢Í½Â¬ÉÔ²Äǽ¤Ê¥×¥í¥°¥é¥à¤Î¥¨¥é¡¼¤¬ +µ¯¤³¤êÆÀ¤ë¡£) +.SS NPTL +.\"O With NPTL, all of the threads in a process are placed +.\"O in the same thread group; +.\"O all members of a thread group share the same PID. +.\"O NPTL does not employ a manager thread. +.\"O NPTL makes internal use of the first two real-time signals +.\"O (see also +.\"O .BR signal (7)); +.\"O these signals cannot be used in applications. +NPTL ¤Ç¤Ï¡¢°ì¤Ä¤Î¥×¥í¥»¥¹¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤ÏƱ¤¸¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥× +¤Ë°¤¹¤ë; ¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¡¼¤ÏƱ¤¸ PID ¤ò¶¦Í­¤¹¤ë¡£ +NPTL ¤Ï´ÉÍý¥¹¥ì¥Ã¥É (manager thread) ¤òÍøÍѤ·¤Ê¤¤¡£ +NPTL ¤ÏÆâÉô¤Ç¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î¤¦¤ÁºÇ½é¤Î 2¤Ä¤ÎÈÖ¹æ¤ò»ÈÍѤ·¤Æ¤ª¤ê +.RB ( signal (7) +»²¾È)¡¢¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï»ÈÍѤǤ­¤Ê¤¤¡£ + +.\"O NPTL still has at least one nonconformance with POSIX.1: +NPTL ¤Ë¤â POSIX.1 ¤Ë½àµò¤·¤Æ¤¤¤Ê¤¤ÅÀ¤¬¾¯¤Ê¤¯¤È¤â°ì¤Ä¤¢¤ë: +.IP \- 3 +.\"O Threads do not share a common nice value. +¥¹¥ì¥Ã¥É¤Ï¶¦Ä̤Πnice Ãͤò¶¦Í­¤·¤Ê¤¤¡£ +.\" FIXME . bug report filed for NPTL nice nonconformance +.\" http://bugzilla.kernel.org/show_bug.cgi?id=6258 +.\" Sep 08: there is a patch by Denys Vlasenko to address this +.\" "make setpriority POSIX compliant; introduce PRIO_THREAD extension" +.\" Monitor this to see if it makes it into mainline. +.PP +.\"O Some NPTL nonconformances only occur with older kernels: +NPTL ¤Îɸ½àÈó½àµò¤ÊÅÀ¤Î¤¦¤Á¤¤¤¯¤Ä¤«¤Ï°ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Î¤ßȯÀ¸¤¹¤ë: +.IP \- 3 +.\"O The information returned by +.\"O .BR times (2) +.\"O and +.\"O .BR getrusage (2) +.\"O is per-thread rather than process-wide (fixed in kernel 2.6.9). +.BR times (2) +¤È +.BR getrusage (2) +¤¬ÊÖ¤¹¾ðÊó¤¬¥×¥í¥»¥¹Á´ÂΤξðÊó¤Ç¤Ê¤¯¥¹¥ì¥Ã¥Éñ°Ì¤Î¾ðÊó¤Ç¤¢¤ë +(¥«¡¼¥Í¥ë 2.6.9 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£ +.IP \- 3 +.\"O Threads do not share resource limits (fixed in kernel 2.6.10). +¥¹¥ì¥Ã¥É´Ö¤Ç¥ê¥½¡¼¥¹À©¸Â¤ò¶¦Í­¤·¤Ê¤¤ (¥«¡¼¥Í¥ë 2.6.10 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£ +.IP \- 3 +.\"O Threads do not share interval timers (fixed in kernel 2.6.12). +¥¹¥ì¥Ã¥É´Ö¤Ç¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¤ò¶¦Í­¤·¤Ê¤¤ +(¥«¡¼¥Í¥ë 2.6.12 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£ +.IP \- 3 +.\"O Only the main thread is permitted to start a new session using +.\"O .BR setsid (2) +.\"O (fixed in kernel 2.6.16). +¥á¥¤¥ó¥¹¥ì¥Ã¥É¤À¤±¤¬ +.BR setsid (2) +¤ò»È¤Ã¤Æ¿·¤·¤¤¥»¥Ã¥·¥ç¥ó¤ò³«»Ï¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +(¥«¡¼¥Í¥ë 2.6.16 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£ +.IP \- 3 +.\"O Only the main thread is permitted to make the process into a +.\"O process group leader using +.\"O .BR setpgid (2) +.\"O (fixed in kernel 2.6.16). +¥á¥¤¥ó¥¹¥ì¥Ã¥É¤À¤±¤¬ +.BR setpgid (2) +¤ò»È¤Ã¤Æ¤½¤Î¥×¥í¥»¥¹¤ò¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +(¥«¡¼¥Í¥ë 2.6.16 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£ +.IP \- 3 +.\"O Threads have distinct alternate signal stack settings. +.\"O However, a new thread's alternate signal stack settings +.\"O are copied from the thread that created it, so that +.\"O the threads initially share an alternate signal stack +.\"O (fixed in kernel 2.6.16). +¥¹¥ì¥Ã¥É¤Ï¤½¤ì¤¾¤ì¤ÎÆȼ«¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ÎÀßÄê¤ò»ý¤Ä¡£ +¤·¤«¤·¡¢¿·¤·¤¤¥¹¥ì¥Ã¥É¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ÎÀßÄê¤Ï +¤½¤Î¥¹¥ì¥Ã¥É¤òºîÀ®¤·¤¿¥¹¥ì¥Ã¥É¤«¤é¥³¥Ô¡¼¤µ¤ì¡¢¤½¤Î¤¿¤á +¥¹¥ì¥Ã¥É¤ÏºÇ½é¤Ï°ì¤Ä¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò¶¦Í­¤¹¤ë +(¥«¡¼¥Í¥ë 2.6.16 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£ +.PP +.\"O Note the following further points about the NPTL implementation: +NPTL ¤Î¼ÂÁõ¤Ç¤Ï°Ê²¼¤ÎÅÀ¤Ë¤Ä¤¤¤Æ¤âÃí°Õ¤¹¤ë¤³¤È: +.IP \- 3 +.\"O If the stack size soft resource limit (see the description of +.\"O .B RLIMIT_STACK +.\"O in +.\"O .BR setrlimit (2)) +.\"O is set to a value other than +.\"O .IR unlimited , +.\"O then this value defines the default stack size for new threads. +.\"O To be effective, this limit must be set before the program +.\"O is executed, perhaps using the +.\"O .I ulimit -s +.\"O shell built-in command +.\"O .RI ( "limit stacksize" +.\"O in the C shell). +¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤Î¥ê¥½¡¼¥¹¤Î¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È +.RB ( setrlimit (2) +¤Î +.B RLIMIT_STACK +¤ÎÀâÌÀ¤ò»²¾È) ¤¬ +.I unlimited +°Ê³°¤ÎÃͤËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤ÎÃͤ¬ +¿·¤·¤¤¥¹¥ì¥Ã¥É¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤È¤Ê¤ë¡£ +ÀßÄê¤òÍ­¸ú¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¥ê¥ß¥Ã¥ÈÃͤò +ÀßÄꤷ¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤¿¤¤¤Æ¤¤¤Ï¡¢¥·¥§¥ë¤ÎÁȤ߹þ¤ß¥³¥Þ¥ó¥É¤Î +.I ulimit -s +(C ¥·¥§¥ë¤Ç¤Ï +.IR "limit stacksize" ) +¤ò»È¤Ã¤ÆÀßÄꤹ¤ë¡£ +.\"O .SS "Determining the Threading Implementation" +.SS "¥¹¥ì¥Ã¥É¼ÂÁõ¤ÎȽÄê" +.\"O Since glibc 2.3.2, the +.\"O .BR getconf (1) +.\"O command can be used to determine +.\"O the system's threading implementation, for example: +glibc 2.3.2 °Ê¹ß¤Ç¤Ï¡¢ +.BR getconf (1) +¥³¥Þ¥ó¥É¤ò»È¤Ã¤Æ¡¢ +¥·¥¹¥Æ¥à¤Î¥¹¥ì¥Ã¥É¼ÂÁõ¤òȽÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°Ê²¼¤ËÎã¤ò¼¨¤¹: +.nf +.in +4n + +bash$ getconf GNU_LIBPTHREAD_VERSION +NPTL 2.3.4 +.in +.fi +.PP +.\"O With older glibc versions, a command such as the following should +.\"O be sufficient to determine the default threading implementation: +¤¾¤ì°ÊÁ°¤Î glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê¥³¥Þ¥ó¥É¤Ç +¥Ç¥Õ¥©¥ë¥È¤Î¥¹¥ì¥Ã¥É¼ÂÁõ¤òȽÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.nf +.in +4n + +bash$ $( ldd /bin/ls | grep libc.so | awk \(aq{print $3}\(aq ) | \\ + egrep \-i \(aqthreads|ntpl\(aq + Native POSIX Threads Library by Ulrich Drepper et al +.in +.fi +.\"O .SS "Selecting the Threading Implementation: LD_ASSUME_KERNEL" +.SS "¥¹¥ì¥Ã¥É¤Î¼ÂÁõ¤ÎÁªÂò: LD_ASSUME_KERNEL" +.\"O On systems with a glibc that supports both LinuxThreads and NPTL +.\"O (i.e., glibc 2.3.\fIx\fP), the +.\"O .B LD_ASSUME_KERNEL +.\"O environment variable can be used to override +.\"O the dynamic linker's default choice of threading implementation. +.\"O This variable tells the dynamic linker to assume that it is +.\"O running on top of a particular kernel version. +LinuxThreads ¤È NPTL ¤ÎξÊý¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë glibc +(glibc 2.3.\fIx\fP) ¤¬¤¢¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.B LD_ASSUME_KERNEL +´Ä¶­ÊÑ¿ô¤ò»È¤¦¤³¤È¤Ç¡¢Æ°Åª¥ê¥ó¥«¤¬¥Ç¥Õ¥©¥ë¥È¤Ç +ÁªÂò¤¹¤ë¥¹¥ì¥Ã¥É¼ÂÁõ¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ÎÊÑ¿ô¤Ë¤è¤ê¡¢Æ°Åª¥ê¥ó¥«¤¬ÆÃÄê¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¾å¤Ç +Æ°ºî¤·¤Æ¤¤¤ë¤È²¾Äꤹ¤ë¤è¤¦¤Ë»ØÄꤹ¤ë¡£ +.\"O By specifying a kernel version that does not +.\"O provide the support required by NPTL, we can force the use +.\"O of LinuxThreads. +.\"O (The most likely reason for doing this is to run a +.\"O (broken) application that depends on some nonconformant behavior +.\"O in LinuxThreads.) +.\"O For example: +NPTL ¤¬É¬ÍפȤ¹¤ë¥µ¥Ý¡¼¥Èµ¡Ç½¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤ò +»ØÄꤹ¤ë¤³¤È¤Ç¡¢¶¯À©Åª¤Ë LinuxThreads ¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë +(¤³¤Î¤è¤¦¤Ê¤³¤È¤ò¤¹¤ëºÇ¤â¤¢¤ê¤½¤¦¤Ê¾ìÌ̤ϡ¢ +LinuxThreads ¤Îɸ½àÈó½àµò¤Ê¿¶Éñ¤¤¤Ë°Í¸¤¹¤ë (²õ¤ì¤¿) ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó +¤òÆ°ºî¤µ¤»¤ë¾ì¹ç¤À¤í¤¦)¡£ +°Ê²¼¤ËÎã¤ò¼¨¤¹: +.nf +.in +4n + +bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\ + awk \(aq{print $3}\(aq ) | egrep \-i \(aqthreads|ntpl\(aq + linuxthreads-0.10 by Xavier Leroy +.in +.fi +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR futex (2), +.BR gettid (2), +.BR futex (7), +.BR signal (7), +.br +.\"O and various Pthreads manual pages, for example: +¤ª¤è¤Ó Pthreads ¤Î³Æ¼ï¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¡¢Î㤨¤Ð: +.BR pthread_attr_init (3), +.BR pthread_atfork (3), +.BR pthread_cancel (3), +.BR pthread_cleanup_push (3), +.BR pthread_cond_signal (3), +.BR pthread_cond_wait (3), +.BR pthread_create (3), +.BR pthread_detach (3), +.BR pthread_equal (3), +.BR pthread_exit (3), +.BR pthread_key_create (3), +.BR pthread_kill (3), +.BR pthread_mutex_lock (3), +.BR pthread_mutex_unlock (3), +.BR pthread_once (3), +.BR pthread_setcancelstate (3), +.BR pthread_setcanceltype (3), +.BR pthread_setspecific (3), +.BR pthread_sigmask (3), +.\"O and +.BR pthread_testcancel (3) diff --git a/draft/man7/pty.7 b/draft/man7/pty.7 new file mode 100644 index 00000000..fe0d59da --- /dev/null +++ b/draft/man7/pty.7 @@ -0,0 +1,273 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2005 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) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-10-14, Akihiro MOTOKI +.\" +.\"WORD: pseudo-terminal µ¼»÷üËö +.\"WORD: character device ¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹ +.\"WORD: pseudo-terminal +.\" +.TH PTY 7 2005-10-10 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O pty \- pseudo-terminal interfaces +pty \- µ¼»÷üËö¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O A pseudo-terminal is a pair of virtual character devices that +.\"O provide a bidirectional communication channel. +µ¼»÷üËö (pseudo-terminal) ¤Ï¡¢ÁÐÊý¸þÄÌ¿®¥Á¥ã¥ó¥Í¥ë¤òÄ󶡤¹¤ë +²¾ÁÛ¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹¤Î¥Ú¥¢¤Ç¤¢¤ë¡£ +.\"O One end of the channel is called the +.\"O .IR master ; +.\"O the other end is called the +.\"O .IR slave . +¥Á¥ã¥ó¥Í¥ë¤Î°ìÊý¤ÎüÅÀ¤Ï +.I ¥Þ¥¹¥¿ (master) +¤È¸Æ¤Ð¤ì¡¢¤â¤¦°ìÊý¤ÎüÅÀ¤Ï +.I ¥¹¥ì¡¼¥Ö (slave) +¤È¸Æ¤Ð¤ì¤ë¡£ +.\"O The slave end of the pseudo-terminal provides an interface +.\"O that behaves exactly like a classical terminal. +.\"O A process that expects to be connected to a terminal, +.\"O can open the slave end of a pseudo-terminal and +.\"O then be driven by a program that has opened the master end. +µ¼»÷üËö¤Î¥¹¥ì¡¼¥Ö¤Ï¡¢ÅÁÅýŪ¤ÊüËö¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò +Ä󶡤¹¤ë¡£Ã¼Ëö¤ËÀܳ¤µ¤ì¤ë¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤ë¥×¥í¥»¥¹¤Ïµ¼»÷üËö¤Î +¥¹¥ì¡¼¥Ö¤ò¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢¤½¤ì°Ê¹ß¤Ï¥Þ¥¹¥¿Â¦¤ò¥ª¡¼¥×¥ó +¤·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤«¤é¤½¤Î¥×¥í¥»¥¹¤òÀ©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O Anything that is written on the master end is provided to the process +.\"O on the slave end as though it was input typed on a terminal. +.\"O For example, writing the interrupt character (usually control-C) +.\"O to the master device would cause an interrupt signal +.\"O .RB ( SIGINT ) +.\"O to be generated for the foreground process group +.\"O that is connected to the slave. +.\"O Conversely, anything that is written to the slave end of the +.\"O pseudo-terminal can be read by the process that is connected to +.\"O the master end. +üËö¤ÇÆþÎϤµ¤ì¤¿¤Î¤ÈƱ¤¸¤è¤¦¤Ë¡¢ +¥Þ¥¹¥¿Â¦¤Ë½ñ¤­¹þ¤Þ¤ì¤¿Á´¤Æ¤Î¥Ç¡¼¥¿¤Ï¡¢¥¹¥ì¡¼¥Ö¦¤Î¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤ë¡£ +Î㤨¤Ð¡¢¥Þ¥¹¥¿¥Ç¥Ð¥¤¥¹¤Ë³ä¤ê¹þ¤ß¥­¥ã¥é¥¯¥¿ (Ä̾ï¤Ï control-C) ¤ò½ñ¤­¹þ¤à¤È¡¢ +¥¹¥ì¡¼¥Ö¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ËÂФ·¤Æ +³ä¤ê¹þ¤ß¥·¥°¥Ê¥ë +.RB ( SIGINT ) +¤¬À¸À®¤µ¤ì¤ë¡£ +È¿ÂФˡ¢µ¼»÷üËö¤Î¥¹¥ì¡¼¥Ö¦¤Ë½ñ¤­¹þ¤Þ¤ì¤¿Á´¤Æ¤Î¥Ç¡¼¥¿¤Ï¡¢ +¥Þ¥¹¥¿Â¦¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¥×¥í¥»¥¹¤«¤éÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O Pseudo-terminals are used by applications such as network login services +.\"O .RB ( ssh "(1), " rlogin "(1), " telnet (1)), +.\"O terminal emulators, +.\"O .BR script (1), +.\"O .BR screen (1), +.\"O and +.\"O .BR expect (1). +µ¼»÷üËö¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥í¥°¥¤¥ó¥µ¡¼¥Ó¥¹ +.RB ( ssh "(1), " rlogin "(1), " telnet (1)) +¤äüËö¥¨¥ß¥å¥ì¡¼¥¿¡¢ +.BR script (1), +.BR screen (1), +.BR expect (1) +¤Ê¤É¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ + +.\"O Historically, two pseudo-terminal APIs have evolved: BSD and System V. +.\"O SUSv1 standardized a pseudo-terminal API based on the System V API, +.\"O and this API should be employed in all new programs that use +.\"O pseudo-terminals. +Îò»ËŪ¤Ë¸«¤ë¤È BSD ¤È System V ¤Î2¼ïÎà¤Îµ¼»÷üËö¤Î API ¤¬È¯Å¸¤·¤Æ¤­¤Æ¤¤¤ë¡£ +SUSv1 ¤Ï System V API ¤Ë´ð¤Å¤¤¤¿µ¼»÷üËö API ¤òɸ½à²½¤·¤Æ¤ª¤ê¡¢ +µ¼»÷üËö¤ò»ÈÍѤ¹¤ë¿·¤·¤¤¥×¥í¥°¥é¥à¤Ï¤¹¤Ù¤Æ¤³¤Î API ¤òºÎÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O Linux provides both BSD-style and (standardized) System V-style +.\"O pseudo-terminals. +.\"O System V-style terminals are commonly called Unix 98 pseudo-terminals +.\"O on Linux systems. +.\"O Since kernel 2.6.4, BSD-style pseudo-terminals are considered deprecated +.\"O (they can be disabled when configuring the kernel); +.\"O Unix 98 pseudo-terminals should be used in new applications. +Linux ¤Ç¤Ï BSD É÷¤È (ɸ½à²½¤µ¤ì¤¿) System V É÷¤Îµ¼»÷üËö¤òÄ󶡤·¤Æ¤¤¤ë¡£ +System V É÷¤ÎüËö¤Ï¡¢Linux ¥·¥¹¥Æ¥à¤Ç¤Ï°ìÈÌ¤Ë Unix 98 µ¼»÷üËö¤È¸Æ¤Ð¤ì¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë 2.6.4 °Ê¹ß¤Ç¤Ï¡¢BSD É÷¤Îµ¼»÷üËö¤ÏÇÑ»ßͽÄê¤È¤ß¤Ê¤µ¤ì¤Æ¤¤¤ë +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¤Ç BSD É÷¤Îµ¼»÷üËö¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë)¡£ +¿·¤·¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢Unix 98 µ¼»÷üËö¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\"O .SS "Unix 98 pseudo-terminals" +.SS "Unix 98 µ¼»÷üËö" +.\"O An unused Unix 98 pseudo-terminal master is opened by calling +.\"O .BR posix_openpt (3). +.\"O (This function opens the master clone device, +.\"O .IR /dev/ptmx ; +.\"O see +.\"O .BR pts (4).) +̤»ÈÍѤΠUnix 98 µ¼»÷üËö¥Þ¥¹¥¿¤ò¥ª¡¼¥×¥ó¤¹¤ë¤Ë¤Ï +.BR posix_openpt (3) +¤ò¸Æ¤Ó½Ð¤¹ +(¤³¤Î´Ø¿ô¤Ï¥Þ¥¹¥¿¡¦¥¯¥í¡¼¥ó¡¦¥Ç¥Ð¥¤¥¹ (master clone device), +.I /dev/ptmx +¤ò¥ª¡¼¥×¥ó¤¹¤ë; +.BR pts (4) +¤ò»²¾È)¡£ +.\"O After performing any program-specific initializations, +.\"O changing the ownership and permissions of the slave device using +.\"O .BR grantpt (3), +.\"O and unlocking the slave using +.\"O .BR unlockpt (3)), +.\"O the corresponding slave device can be opened by passing +.\"O the name returned by +.\"O .BR ptsname (3) +.\"O in a call to +.\"O .BR open (2). +¥×¥í¥°¥é¥à¸ÇÍ­¤Î½é´ü²½½èÍý¤ò¼Â¹Ô¤·¡¢ +.BR grantpt (3) +¤ò»È¤Ã¤Æ¥¹¥ì¡¼¥Ö¥Ç¥Ð¥¤¥¹¤Î½êÍ­¸¢¤äµö²Ä¤òÊѹ¹¤·¡¢ +.BR unlockpt (3) +¤ò»È¤Ã¤Æ¥¹¥ì¡¼¥Ö¤Î¥í¥Ã¥¯²ò½ü¤ò¹Ô¤¦¤È¡¢ +.BR ptsname (3) +¤¬ÊÖ¤¹Ì¾Á°¤òÅϤ·¤Æ +.BR open (2) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤ê +Âбþ¤¹¤ë¥¹¥ì¡¼¥Ö¥Ç¥Ð¥¤¥¹¤ò¥ª¡¼¥×¥ó¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + +.\"O The Linux kernel imposes a limit on the number of available +.\"O Unix 98 pseudo-terminals. +.\"O In kernels up to and including 2.6.3, this limit is configured +.\"O at kernel compilation time +.\"O .RB ( CONFIG_UNIX98_PTYS ), +.\"O and the permitted number of pseudo-terminals can be up to 2048, +.\"O with a default setting of 256. +.\"O Since kernel 2.6.4, the limit is dynamically adjustable via +.\"O .IR /proc/sys/kernel/pty/max , +.\"O and a corresponding file, +.\"O .IR /proc/sys/kernel/pty/nr , +.\"O indicates how many pseudo-terminals are currently in use. +.\"O For further details on these two files, see +.\"O .BR proc (5). +Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ÍøÍѤǤ­¤ë Unix 98 µ¼»÷üËö¤Î¿ô¤Ë¾å¸Â¤òÀߤ±¤Æ¤¤¤ë¡£ +2.6.3 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Î¾å¸Â¤Ï¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤ÎÀßÄê +.RB ( CONFIG_UNIX98_PTYS ) +¤Ç¤¢¤ë¡£µö²Ä¤µ¤ì¤ëµ¼»÷üËö¤Î¿ô¤ÏºÇÂç 2048 ¤Ç¤¢¤ê¡¢ +¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¤Ï 256 ¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.6.4 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¾å¸Â¤Ï +.I /proc/sys/kernel/pty/max +·Ðͳ¤ÇưŪ¤ËÄ´À°²Äǽ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£¤Þ¤¿¡¢ +.I /proc/sys/kernel/pty/nr +¤Ç¸½ºß»ÈÍÑÃæ¤Îµ¼»÷üËö¤Î¿ô¤ò¼èÆÀ¤Ç¤­¤ë¡£ +¤³¤Î 2¤Ä¤Î¥Õ¥¡¥¤¥ë¤Î¾ÜºÙ¤Ï +.BR proc (5) +¤ò»²¾È¡£ +.\"O .SS "BSD pseudo-terminals" +.SS "BSD µ¼»÷üËö" +.\"O BSD-style pseudo-terminals are provided as precreated pairs, with +.\"O names of the form +.\"O .I /dev/ptyXY +.\"O (master) and +.\"O .I /dev/ttyXY +.\"O (slave), +.\"O where X is a letter from the 16-character set [p-za-e], +.\"O and Y is a letter from the 16-character set [0-9a-f]. +.\"O (The precise range of letters in these two sets varies across Unix +.\"O implementations.) +BSD É÷¤Îµ¼»÷üËö¤Ï¤¢¤é¤«¤¸¤áºîÀ®¤µ¤ì¤¿¥Ú¥¢¤È¤·¤ÆÄ󶡤µ¤ì¤ë¡£¤½¤Î̾Á°¤Ï +.I /dev/ptyXY +(¥Þ¥¹¥¿Â¦)¡¢ +.I /dev/ttyXY +(¥¹¥ì¡¼¥Ö¦) ¤Ç¤¢¤ë¡£¤³¤³¤Ç¡¢ +X ¤Ï [p-za-e] ¤Î 16ʸ»ú¤Î¤¦¤Á¤Î°ìʸ»ú¡¢ +Y ¤Ï [0-9a-f] ¤Î 16ʸ»ú¤Î¤¦¤Á¤Î°ìʸ»ú¤Ç¤¢¤ë +(X, Y ¤Ë»È¤ï¤ì¤ëʸ»ú¤ÎÀµ³Î¤ÊÈÏ°Ï¤Ï Unix ¤Î¼ÂÁõ¤Ë¤è¤ê°Û¤Ê¤ë)¡£ +.\"O For example, +.\"O .I /dev/ptyp1 +.\"O and +.\"O .I /dev/ttyp1 +.\"O constitute a BSD pseudo-terminal pair. +Î㤨¤Ð¡¢ +.I /dev/ptyp1 +¤È +.I /dev/ttyp1 +¤Ï BSD µ¼»÷üËö¥Ú¥¢¤ò¹½À®¤¹¤ë¡£ +.\"O A process finds an unused pseudo-terminal pair by trying to +.\"O .BR open (2) +.\"O each pseudo-terminal master until an open succeeds. +.\"O The corresponding pseudo-terminal slave (substitute "tty" +.\"O for "pty" in the name of the master) can then be opened. +¥×¥í¥»¥¹¤¬Ì¤»ÈÍѤε¼»÷üËö¥Ú¥¢¤ò¸«¤Ä¤±¤ë¤Ë¤Ï¡¢ +³Æµ¼»÷üËö¤Î¥Þ¥¹¥¿¤Î +.BR open (2) +¤ò»î¤ß¡¢open ¤¬À®¸ù¤¹¤ë¤Þ¤Ç¤³¤ì¤ò·«¤êÊÖ¤¹¡£ +¥Þ¥¹¥¿¤ò open ¤¹¤ë¤È¡¢Âбþ¤¹¤ëµ¼»÷üËö¤Î¥¹¥ì¡¼¥Ö¤â open ¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë +(¥¹¥ì¡¼¥Ö¤Î̾Á°¤Ï¡¢¥Þ¥¹¥¿¤Î̾Á°¤Î "pty" ¤ò "tty" ¤ËÃÖ¤­´¹¤¨¤¿¤â¤Î¤Ç¤¢¤ë)¡£ +.\"O .SH "FILES" +.SH ¥Õ¥¡¥¤¥ë +.I /dev/ptmx +(Unix 98 ¥Þ¥¹¥¿¡¦¥¯¥í¡¼¥ó¡¦¥Ç¥Ð¥¤¥¹) +.br +.I /dev/pts/* +(Unix 98 ¥¹¥ì¡¼¥Ö¥Ç¥Ð¥¤¥¹) +.br +.I /dev/pty[p-za-e][0-9a-f] +(BSD ¥Þ¥¹¥¿¥Ç¥Ð¥¤¥¹) +.br +.I /dev/tty[p-za-e][0-9a-f] +(BSD ¥¹¥ì¡¼¥Ö¥Ç¥Ð¥¤¥¹) +.\"O .SH "NOTES" +.SH Ãí°Õ +.\"O A description of the +.\"O .B TIOCPKT +.\"O .BR ioctl (2), +.\"O which controls packet mode operation, can be found in +.\"O .BR tty_ioctl (4). +¥Ñ¥±¥Ã¥È¡¦¥â¡¼¥ÉÁàºî¤ÎÀ©¸æ¤ò¹Ô¤¦ +.B TIOCPKT +.BR ioctl (2) +¤ÎÀâÌÀ¤Ï +.BR tty_ioctl (4) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ + +.\"O The BSD +.\"O .BR ioctl (2) +.\"O operations +.\"O .BR TIOCSTOP , +.\"O .BR TIOCSTART , +.\"O .BR TIOCUCNTL , +.\"O and +.\"O .BR TIOCREMOTE +.\"O have not been implemented under Linux. +BSD +.BR ioctl (2) +¤Î +.BR TIOCSTOP , +.BR TIOCSTART , +.BR TIOCUCNTL , +.B TIOCREMOTE +¤Ï¤³¤ì¤Þ¤Ç¤Î¤È¤³¤í Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR select (2), +.BR setsid (2), +.BR forkpty (3), +.BR openpty (3), +.BR termios (3), +.BR pts (4), +.BR tty (4), +.BR tty_ioctl (4) diff --git a/draft/man7/raw.7 b/draft/man7/raw.7 new file mode 100644 index 00000000..2d9a04ce --- /dev/null +++ b/draft/man7/raw.7 @@ -0,0 +1,512 @@ +'\" t +.\" Don't change the first line, it tells man that we need tbl. +.\" This man page is Copyright (C) 1999 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. +.\" $Id: raw.7,v 1.6 1999/06/05 10:32:08 freitag Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2007-01-05, Akihiro MOTOKI , LDP v2.43 +.\" +.\"WORD link level header(s) ¥ê¥ó¥¯¥ì¥Ù¥ë¥Ø¥Ã¥À +.\"WORD effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ ID +.\"WORD capability ¸¢¸Â +.\"WORD route (¥Ñ¥±¥Ã¥È¤Î) ·ÐÏ© +.\" +.TH RAW 7 2008-11-20 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O raw, SOCK_RAW \- Linux IPv4 raw sockets +.SH ̾Á° +raw, SOCK_RAW \- Linux ¤Î IPv4 raw ¥½¥±¥Ã¥È +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.br +.BI "raw_socket = socket(AF_INET, SOCK_RAW, int " protocol ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Raw sockets allow new IPv4 protocols to be implemented in user space. +.\"O A raw socket receives or sends the raw datagram not +.\"O including link level headers. +raw ¥½¥±¥Ã¥È¤ò»È¤¦¤È¡¢¿·¤·¤¤ IPv4 ¥×¥í¥È¥³¥ë¤ò¥æ¡¼¥¶¶õ´Ö¤Ç +¼ÂÁõ¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ raw ¥½¥±¥Ã¥È¤Ï¡¢¥ê¥ó¥¯¥ì¥Ù¥ë¥Ø¥Ã¥À¤ò +´Þ¤Þ¤Ê¤¤ raw ¥Ç¡¼¥¿¥°¥é¥à¤ÎÁ÷¼õ¿®¤¬¤Ç¤­¤ë¡£ + +.\"O The IPv4 layer generates an IP header when sending a packet unless the +.\"O .B IP_HDRINCL +.\"O socket option is enabled on the socket. +.\"O When it is enabled, the packet must contain an IP header. +.\"O For receiving the IP header is always included in the packet. +IPv4 ¥ì¥¤¥ä¤Ï¡¢°·¤Ã¤Æ¤¤¤ë¥½¥±¥Ã¥È¤Ç +.B IP_HDRINCL +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +¥Ñ¥±¥Ã¥È¤òÁ÷¿®¤¹¤ë¤È¤­¤Ë IP ¥Ø¥Ã¥À¤òÀ¸À®¤¹¤ë¡£ +.B IP_HDRINCL +¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¤­¤Ï¡¢¥Ñ¥±¥Ã¥È¤Ë¤Ï +IP ¥Ø¥Ã¥À¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¼õ¿®»þ¤Ë¤Ï¡¢ IP ¥Ø¥Ã¥À¤Ï¾ï¤Ë¥Ñ¥±¥Ã¥È¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ + +.\"O Only processes with an effective user ID of 0 or the +.\"O .B CAP_NET_RAW +.\"O capability are allowed to open raw sockets. +¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤«¡¢ +.B CAP_NET_RAW +¸¢¸Â¤ò»ý¤Ä¥×¥í¥»¥¹¤À¤±¤¬ raw ¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O All packets or errors matching the +.\"O .I protocol +.\"O number specified +.\"O for the raw socket are passed to this socket. +.\"O For a list of the allowed protocols see RFC\ 1700 assigned numbers and +.\"O .BR getprotobyname (3). +¤³¤Î raw ¥½¥±¥Ã¥È¤Ë»ØÄꤵ¤ì¤¿ +.I protocol +ÈÖ¹æ¤Ë¥Þ¥Ã¥Á¤¹¤ëÁ´¤Æ¤Î¥Ñ¥±¥Ã¥È¤È¥¨¥é¡¼¤È¤¬¡¢¤³¤Î¥½¥±¥Ã¥È¤ËÅϤµ¤ì¤ë¡£ +µö²Ä¤µ¤ì¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¤Î¥ê¥¹¥È¤Ï RFC\ 1700 ¤Î³ä¤êÅö¤ÆÈÖ¹æ¤È +.BR getprotobyname (3) +¤ò¸«¤è¡£ + +.\"O A protocol of +.\"O .B IPPROTO_RAW +.\"O implies enabled +.\"O .B IP_HDRINCL +.\"O and is able to send any IP protocol that is specified in the passed +.\"O header. +.\"O Receiving of all IP protocols via +.\"O .B IPPROTO_RAW +.\"O is not possible using raw sockets. +.B IPPROTO_RAW +¤Î¥×¥í¥È¥³¥ë¤Ï°ÅÌۤΤ¦¤Á¤Ë +.B IP_HDRINCL +¤òÍ­¸ú¤Ë¤¹¤ë¤Î¤Ç¡¢ +ÅϤµ¤ì¤¿¥Ø¥Ã¥À¤Ç»ØÄꤵ¤ì¤¿¡¢¤¢¤é¤æ¤ë IP ¥×¥í¥È¥³¥ë¤òÁ÷¿®¤Ç¤­¤ë¡£ +.B IPPROTO_RAW +·Ðͳ¤Ç¤Î¤¢¤é¤æ¤ë IP ¥×¥í¥È¥³¥ë¤Î¼õ¿®¤Ï¡¢ +raw ¥½¥±¥Ã¥È¤òÍѤ¤¤Æ¤Ï¹Ô¤¨¤Ê¤¤¡£ +.\"O +.TS +tab(:) allbox; +c s +l l. +.\"O IP Header fields modified on sending by \fBIP_HDRINCL\fP +.\"O IP Checksum:Always filled in. +.\"O Source Address:Filled in when zero. +.\"O Packet Id:Filled in when zero. +.\"O Total Length:Always filled in. +IP ¥Ø¥Ã¥À¥Õ¥£¡¼¥ë¥É¡£ \fBIP_HDRINCL\fP ¤Ë¤è¤Ã¤ÆÁ÷¿®»þ¤ËÊѹ¹¤µ¤ì¤ë¡£ +IP ¥Á¥§¥Ã¥¯¥µ¥à:¾ï¤ËÊѹ¹¤µ¤ì¤ë¡£ +¥½¡¼¥¹¥¢¥É¥ì¥¹:¸µ¤ÎÃͤ¬ 0 ¤Î»þ¤ËÊѹ¹¤µ¤ì¤ë¡£ +¥Ñ¥±¥Ã¥È ID:¸µ¤ÎÃͤ¬ 0 ¤Î»þ¤ËÊѹ¹¤µ¤ì¤ë¡£ +Á´ÂΤÎŤµ:¾ï¤ËËä¤á¤é¤ì¤ë¡£ +.TE +.\"O.RE +.sp +.PP +.\"NAKANO Aloways filled in. ¤È¤Ï? +.\"O If +.\"O .B IP_HDRINCL +.\"O is specified and the IP header has a nonzero destination address then +.\"O the destination address of the socket is used to route the packet. +.\"O When +.\"O .B MSG_DONTROUTE +.\"O is specified, the destination address should refer to a local interface, +.\"O otherwise a routing table lookup is done anyway but gatewayed routes +.\"O are ignored. +.B IP_HERINCL +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ IP ¥Ø¥Ã¥À¤Ë +0 ¤Ç¤Ê¤¤Á÷¿®À襢¥É¥ì¥¹¤¬µ­Æþ¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ï¡¢ +¤½¤ÎÁ÷¿®À襢¥É¥ì¥¹¤¬¥Ñ¥±¥Ã¥È¤Î·ÐÏ©¤ò·è¤á¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +.B MSG_DONTROUTE +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë»þ¤Ë¤Ï¡¢ +Á÷¿®À襢¥É¥ì¥¹¤Ï¥í¡¼¥«¥ë¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»²¾È¤¹¤ë¤â¤Î¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤µ¤â¤Ê¤¤¤È¡¢¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤Î»²¾È¤Ï¤¤¤º¤ì¤Ë¤»¤è¹Ô¤ï¤ì¤ë¤¬¡¢ +¥²¡¼¥È¥¦¥§¥¤¤¬É¬ÍפʷÐÏ©¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"NAKANO ¥í¡¼¥«¥ë¤Ê¥Í¥Ã¥È¤Ê¤Î¤«¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ê¤Î¤«¡© + +.\"O If +.\"O .B IP_HDRINCL +.\"O isn't set, then IP header options can be set on raw sockets with +.\"O .BR setsockopt (2); +.\"O see +.\"O .BR ip (7) +.\"O for more information. +.B IP_HDRINCL +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +raw ¥½¥±¥Ã¥È¤Î IP ¥Ø¥Ã¥À¥ª¥×¥·¥ç¥ó¤ò +.BR setsockopt (2) +¤òÍѤ¤¤ÆÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¾ÜºÙ¤Ê¾ðÊó¤Ï +.BR ip (7) +¤ò¸«¤è¡£ + +.\"O In Linux 2.2, all IP header fields and options can be set using +.\"O IP socket options. +.\"O This means raw sockets are usually only needed for new +.\"O protocols or protocols with no user interface (like ICMP). +Linux 2.2 ¤Ç¤Ï¡¢ IP ¥Ø¥Ã¥À¤ÎÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤È¥ª¥×¥·¥ç¥ó¤È¤ò +IP ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡£¤·¤¿¤¬¤Ã¤Æ +raw ¥½¥±¥Ã¥È¤¬É¬Íפˤʤë¤Î¤Ï¡¢¿·¤·¤¤¥×¥í¥È¥³¥ë¤òÀ߷פ¹¤ë¾ì¹ç¤«¡¢ +¥æ¡¼¥¶¡¼¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»ý¤¿¤Ê¤¤¥×¥í¥È¥³¥ë (ICMP ¤Ê¤É) ¤ò°·¤¦¾ì¹ç¤Ë +¸Â¤é¤ì¤ë¡£ + +.\"O When a packet is received, it is passed to any raw sockets which have +.\"O been bound to its protocol before it is passed to other protocol handlers +.\"O (e.g., kernel protocol modules). +¥Ñ¥±¥Ã¥È¤Ï¡¢¼õ¿®¤µ¤ì¤ë¤È¤Þ¤º¥×¥í¥È¥³¥ë¤Ë¥Ð¥¤¥ó¥É¤·¤Æ¤¤¤ë +raw ¥½¥±¥Ã¥È¤ËÅϤµ¤ì¡¢ +¤½¤Î¸å¤Ç¾¤Î¥×¥í¥È¥³¥ë¥Ï¥ó¥É¥é (¥«¡¼¥Í¥ë¤Î¥×¥í¥È¥³¥ë¥â¥¸¥å¡¼¥ë¤Ê¤É) +¤ËÅϤµ¤ì¤ë¡£ +.\"O .SS Address Format +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.\"O Raw sockets use the standard +.\"O .I sockaddr_in +.\"O address structure defined in +.\"O .BR ip (7). +.\"O The +.\"O .I sin_port +.\"O field could be used to specify the IP protocol number, +.\"O but it is ignored for sending in Linux 2.2 and should be always +.\"O set to 0 (see BUGS). +.\"O For incoming packets, +.\"O .I sin_port +.\"O is set to the protocol of the packet. +.\"O See the +.\"O .I +.\"O include file for valid IP protocols. +raw ¥½¥±¥Ã¥È¤Ïɸ½à¤Î +.I sockaddr_in +¥¢¥É¥ì¥¹¹½Â¤ÂΤòÍѤ¤¤ë¡£ÄêµÁ¤Ï +.BR ip (7) +¤Ç¤Ê¤µ¤ì¤Æ¤¤¤ë¡£ +.I sin_port +¥Õ¥£¡¼¥ë¥É¤ò IP ¥×¥í¥È¥³¥ëÈÖ¹æ¤Î»ØÄê¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¤¬¡¢ +Linux 2.2 ¤Ç¤Ï¤³¤ì¤ÏÁ÷¿®»þ¤Ë¤Ï̵»ë¤µ¤ì¡¢¾ï¤Ë 0 ¤Ë¤µ¤ì¤ë +(¥Ð¥° ¤Î¹à¤ò»²¾È)¡£ +¼õ¿®¥Ñ¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï¡¢ +.I sin_port +¤Ï¤½¤Î¥Ñ¥±¥Ã¥È¤Î¥×¥í¥È¥³¥ë¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +ÍѤ¤¤ë¤³¤È¤Î¤Ç¤­¤ë IP ¥×¥í¥È¥³¥ë¤Ï¡¢¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ò¸«¤è¡£ +.\"O .SS Socket Options +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.\"O Raw socket options can be set with +.\"O .BR setsockopt (2) +.\"O and read with +.\"O .BR getsockopt (2) +.\"O by passing the +.\"O .B IPPROTO_RAW +.\"O .\" Or SOL_RAW on Linux +.\"O family flag. +raw ¥½¥±¥Ã¥È¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.B IPPROTO_RAW +.\" ¤â¤·¤¯¤Ï Linux ¤Ç¤Ï .I SOL_RAW +¥Õ¥¡¥ß¥ê¡¼¥Õ¥é¥°¤òÍ¿¤¨¤Æ +.BR setsockopt (2) +¤ò¸Æ¤Ù¤ÐÀßÄê¤Ç¤­¡¢ +.BR getsockopt (2) +¤ò¸Æ¤Ù¤Ð¼èÆÀ¤Ç¤­¤ë¡£ +.TP +.B ICMP_FILTER +.\"O Enable a special filter for raw sockets bound to the +.\"O .B IPPROTO_ICMP +.\"O protocol. +.\"O The value has a bit set for each ICMP message type which +.\"O should be filtered out. +.\"O The default is to filter no ICMP messages. +.B IPPROTO_ICMP +¥×¥í¥È¥³¥ë¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤¿ raw ¥½¥±¥Ã¥È¤Î¤¿¤á¤ÎÆüì¤Ê¥Õ¥£¥ë¥¿¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤ÎÃÍ¤Ï ICMP ¥á¥Ã¥»¡¼¥¸¤Î¥¿¥¤¥×¤½¤ì¤¾¤ì¤ËÂФ·¤Æ¡¢¤É¤ì¤ò¥Õ¥£¥ë¥¿¡¼¥¢¥¦¥È +¤¹¤ë¤«¤òɽ¤·¤¿¥Ó¥Ã¥È¥»¥Ã¥È¤Ç¤¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +ICMP ¥á¥Ã¥»¡¼¥¸¤ÏÁ´¤¯¥Õ¥£¥ë¥¿¡¼¤·¤Ê¤¤¡£ +.PP +.\"O In addition, all +.\"O .BR ip (7) +.\"O .B IPPROTO_IP +.\"O socket options valid for datagram sockets are supported. +¤µ¤é¤Ë¡¢¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤Ë»È¤¨¤ëÁ´¤Æ¤Î +.BR ip (7) +.B SOL_IP +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS Error Handling +.SS ¥¨¥é¡¼½èÍý +.\"O Errors originating from the network are only passed to the user when the +.\"O socket is connected or the +.\"O .B IP_RECVERR +.\"O flag is enabled. +.\"O For connected sockets, only +.\"O .B EMSGSIZE +.\"O and +.\"O .B EPROTO +.\"O are passed for compatibility. +.\"O With +.\"O .BR IP_RECVERR , +.\"O all network errors are saved in the error queue. +¥Í¥Ã¥È¥ï¡¼¥¯¤ÇÀ¸¤¸¤¿¥¨¥é¡¼¤¬¥æ¡¼¥¶¤ËÅϤµ¤ì¤ë¤Î¤Ï¡¢ +¥½¥±¥Ã¥È¤¬ÀܳºÑ¤ß¤Î¾ì¹ç¤« +.B IP_RECVERR +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¸Â¤é¤ì¤ë¡£ +ÀܳºÑ¤ß¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï¡¢ +.B EMSGSIZE +¤ª¤è¤Ó +.B EPROTO +¤À¤±¤¬ÅϤµ¤ì¤ë (¸ß´¹À­¤Î¤¿¤á)¡£ +.B IP_RECVERR +¤òÀßÄꤹ¤ë¤È¡¢Á´¤Æ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥é¡¼¤¬¥¨¥é¡¼¥­¥å¡¼¤ËÊݸ¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\"O User tried to send to a broadcast address without having the +.\"O broadcast flag set on the socket. +¥æ¡¼¥¶¡¼¤¬ broadcast ¥Õ¥é¥°¤òÀßÄꤷ¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤òÍѤ¤¤Æ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ËÁ÷¿®¤ò¹Ô¤ª¤¦¤È¤·¤¿¡£ +.TP +.B EFAULT +.\"O An invalid memory address was supplied. +ÉÔÀµ¤Ê¥á¥â¥ê¥¢¥É¥ì¥¹¤¬Í¿¤¨¤é¤ì¤¿¡£ +.TP +.B EINVAL +.\"O Invalid argument. +°ú¿ô¤¬Àµ¤·¤¯¤Ê¤¤¡£ +.TP +.B EMSGSIZE +.\"O Packet too big. +.\"O Either Path MTU Discovery is enabled (the +.\"O .B IP_MTU_DISCOVER +.\"O socket flag) or the packet size exceeds the maximum allowed IPv4 +.\"O packet size of 64KB. +¥Ñ¥±¥Ã¥È¤¬Â礭¤¹¤®¤ë¡£ Path MTU Discoverry ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë +.RB ( IP_MTU_DISCOVER +¥½¥±¥Ã¥È¥Õ¥é¥°) ¤«¡¢¥Ñ¥±¥Ã¥È¤Î¥µ¥¤¥º¤¬ IPv4 ¤Çµö¤µ¤ì¤Æ¤¤¤ë +¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤ÎºÇÂçÃÍ 64KB ¤ò±Û¤¨¤Æ¤¤¤ë¡£ +.TP +.B EOPNOTSUPP +.\"O Invalid flag has been passed to a socket call (like +.\"O .BR MSG_OOB ). +¥½¥±¥Ã¥È¸Æ¤Ó½Ð¤·¤ËÉÔÀµ¤Ê¥Õ¥é¥° +.RB ( MSG_OOB +¤Ê¤É) ¤¬ÅϤµ¤ì¤¿¡£ +.TP +.B EPERM +.\"O The user doesn't have permission to open raw sockets. +.\"O Only processes with an effective user ID of 0 or the +.\"O .B CAP_NET_RAW +.\"O attribute may do that. +¥æ¡¼¥¶¡¼¤Ï raw ¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +¼Â¹Ô¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤«¡¢ +.B CAP_NET_RAW +°À­¤ò»ý¤Ä¥×¥í¥»¥¹¤À¤±¤¬¤³¤ì¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B EPROTO +.\"O An ICMP error has arrived reporting a parameter problem. +¥Ñ¥é¥á¡¼¥¿¤ÎÌäÂê¤òÊó¹ð¤¹¤ë ICMP ¥¨¥é¡¼¤ò¼õ¤±¼è¤Ã¤¿¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .B IP_RECVERR +.\"O and +.\"O .B ICMP_FILTER +.\"O are new in Linux 2.2. +.\"O They are Linux extensions and should not be used in portable programs. +.B IP_RECVERR +¤È +.B ICMP_FILTER +¤Ï Linux 2.2 ¤ÇÅо줷¤¿¡£¤³¤ì¤é¤Ï Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤ÏÍѤ¤¤ë¤Ù¤­¤Ç¤Ê¤¤¡£ + +.\"O Linux 2.0 enabled some bug-to-bug compatibility with BSD in the +.\"O raw socket code when the +.\"O .B SO_BSDCOMPAT +.\"O socket option was set \(em since Linux 2.2, +.\"O this option no longer has that effect. +Linux 2.0 ¤Ç¤Ï +.B SO_BSDCOMPAT +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢ +BSD ¤Î raw ¥½¥±¥Ã¥È¤Ë¤¢¤ë¥Ð¥°¤Ë¸ß´¹À­¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¤¿ \(em +Linux 2.2 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤â¤Ï¤ä¸úÎϤò»ý¤¿¤Ê¤¤¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O By default, raw sockets do path MTU (Maximum Transmission Unit) discovery. +.\"O This means the kernel +.\"O will keep track of the MTU to a specific target IP address and return +.\"O .B EMSGSIZE +.\"O when a raw packet write exceeds it. +.\"O When this happens, the application should decrease the packet size. +.\"O Path MTU discovery can be also turned off using the +.\"O .B IP_MTU_DISCOVER +.\"O socket option or the +.\"O .I /proc/sys/net/ipv4/ip_no_pmtu_disc +.\"O file, see +.\"O .BR ip (7) +.\"O for details. +.\"O When turned off, raw sockets will fragment outgoing packets +.\"O that exceed the interface MTU. +.\"O However, disabling it is not recommended +.\"O for performance and reliability reasons. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢raw ¥½¥±¥Ã¥È¤Ï Path MTU Discovery ¤ò¹Ô¤¦¡£ +¤Ä¤Þ¤ê¡¢¥«¡¼¥Í¥ë¤ÏÆÃÄê¤Î°¸Àè IP ¥¢¥É¥ì¥¹¤Î MTU (Maximum Transmission Unit; +ºÇÂçžÁ÷ñ°Ì) ¤òµ­Ï¿¤·¡¢raw ¥Ñ¥±¥Ã¥È¤Î½ñ¤­¹þ¤ß¤¬ MTU ¤òĶ¤¨¤¿¾ì¹ç +.B EMSGSIZE +¤òÊÖ¤¹¡£ +.B EMSGSIZE +¤òÊÖ¤µ¤ì¤¿¾ì¹ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤ò¾®¤µ¤¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.B IP_MTU_DISCOVER +¤Þ¤¿¤Ï +.I /proc/sys/net/ipv4/ip_no_pmtu_disc +¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ Path MTU Discovery ¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë +(¾ÜºÙ¤Ï +.BR ip (7) +¤ò»²¾È)¡£ +Path MTU Discovery ¤ò̵¸ú¤Ë¤·¤¿¾ì¹ç¤Ï¡¢¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤¬ +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î MTU ¤è¤ê¤âÂ礭¤¤¤È raw ¥½¥±¥Ã¥È¤Ï¤½¤Î¥Ñ¥±¥Ã¥È¤ò +¥Õ¥é¥°¥á¥ó¥È²½¤·¤ÆÁ÷½Ð¤¹¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢À­Ç½¤È¿®ÍêÀ­¤ÎÍýͳ¤«¤é Path MTU Discovery ¤ò +̵¸ú¤Ë¤¹¤ë¤Î¤Ï¿ä¾©¤Ç¤­¤Ê¤¤¡£ + +.\"O A raw socket can be bound to a specific local address using the +.\"O .BR bind (2) +.\"O call. +.\"O If it isn't bound, all packets with the specified IP protocol are received. +.\"O In addition, a RAW socket can be bound to a specific network device using +.\"O .BR SO_BINDTODEVICE ; +.\"O see +.\"O .BR socket (7). +.BR bind (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍѤ¤¤ë¤È¡¢ +raw ¥½¥±¥Ã¥È¤ò +ÆÃÄê¤Î¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Ð¥¤¥ó¥É¤¬¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢»ØÄꤷ¤¿ IP ¥×¥í¥È¥³¥ë¤Î +¤¹¤Ù¤Æ¤Î¥Ñ¥±¥Ã¥È¤¬¼õ¿®¤µ¤ì¤ë¡£ +¤µ¤é¤Ë¡¢ +.B SO_BINDTODEVICE +¤òÍѤ¤¤ì¤Ð raw ¥½¥±¥Ã¥È¤òÆÃÄê¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤Ë +¥Ð¥¤¥ó¥É¤µ¤»¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.BR socket (7) +¤ò¸«¤è¡£ + +.\"O An +.\"O .B IPPROTO_RAW +.\"O socket is send only. +.\"O If you really want to receive all IP packets, use a +.\"O .BR packet (7) +.\"O socket with the +.\"O .B ETH_P_IP +.\"O protocol. +.\"O Note that packet sockets don't reassemble IP fragments, +.\"O unlike raw sockets. +.B IPPROTO_RAW +¥½¥±¥Ã¥È¤ÏÁ÷¿®ÀìÍѤǤ¢¤ë¡£¤â¤·¤É¤¦¤·¤Æ¤â¤¹¤Ù¤Æ¤Î IP ¥Ñ¥±¥Ã¥È¤ò +¼õ¿®¤·¤¿¤¤¾ì¹ç¤Ï¡¢ +.BR packet (7) +¥½¥±¥Ã¥È¤ò +.B ETH_P_IP +¥×¥í¥È¥³¥ë¤ÇÍѤ¤¤ë¤³¤È¡£ +packet ¥½¥±¥Ã¥È¤Ï raw ¥½¥±¥Ã¥È¤Î¤è¤¦¤Ë +IP ¥Õ¥é¥°¥á¥ó¥È¤òºÆ¹½À®¤·¤Ê¤¤¤³¤È¤ËÃí°Õ¡£ + +.\"O If you want to receive all ICMP packets for a datagram socket, +.\"O it is often better to use +.\"O .B IP_RECVERR +.\"O on that particular socket; see +.\"O .BR ip (7). +datagram ¥½¥±¥Ã¥È¤ËÂФ¹¤ë¤¹¤Ù¤Æ¤Î ICMP ¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤·¤¿¤¤¾ì¹ç¤Ï¡¢ +ÆÃÄê¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.B IP_RECVERR +¤òÍѤ¤¤ë¤Û¤¦¤¬Îɤ¤¾ì¹ç¤¬Â¿¤¤¡£ +.BR ip (7) +¤ò¸«¤è¡£ + +.\"O Raw sockets may tap all IP protocols in Linux, even +.\"O protocols like ICMP or TCP which have a protocol module in the kernel. +.\"O In this case, the packets are passed to both the kernel module and the raw +.\"O socket(s). This should not be relied upon in portable programs, many other BSD +.\"O socket implementation have limitations here. +raw ¥½¥±¥Ã¥È¤Ï¡¢ Linux ¤Î¤¹¤Ù¤Æ¤Î IP ¥×¥í¥È¥³¥ë¤ò¼õ¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +ICMP ¤ä TCP ¤Î¤è¤¦¤Ë¡¢¥«¡¼¥Í¥ëÆâÉô¤Ë¥×¥í¥È¥³¥ë¥â¥¸¥å¡¼¥ë¤ò»ý¤Ä¤è¤¦¤Ê +¤â¤Î¤â²Äǽ¤Ç¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢¥Ñ¥±¥Ã¥È¤Ï¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤È +raw ¥½¥±¥Ã¥È¤ÎξÊý¤ËÅϤµ¤ì¤ë (raw ¥½¥±¥Ã¥È¤¬Ê£¿ô¤¢¤ì¤Ð¤½¤ì¤¾¤ì¤ËÅϤµ¤ì¤ë)¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Îµ¡Ç½¤Ë°Í¸¤¹¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¾¤Î¿¤¯¤Î BSD ¤Ë¤ª¤±¤ë¥½¥±¥Ã¥È¤Î¼ÂÁõ¤Ç¤Ï¤³¤ÎÅÀ¤Ë¤ª¤¤¤ÆÀ©¸Â¤¬¤¢¤ë¡£ + +.\"O Linux never changes headers passed from the user (except for filling +.\"O in some zeroed fields as described for +.\"O .BR IP_HDRINCL ). +.\"O This differs from many other implementations of raw sockets. +Linux ¤Ï¥æ¡¼¥¶¡¼¤«¤éÅϤµ¤ì¤¿¥Ø¥Ã¥À¤ò·è¤·¤ÆÊѹ¹¤·¤Ê¤¤ (¤¿¤À¤· +.B IP_HDRINCL +¤ÎÀâÌÀ¤Ë¤¢¤ë¤è¤¦¤Ë¡¢ 0 ¤ò¤¤¤¯¤Ä¤«Ëä¤á¤ë¾ì¹ç¤ò½ü¤¯)¡£ +¤³¤ì¤Ï¾¤Î¿¤¯¤Î raw ¥½¥±¥Ã¥È¤Î¼ÂÁõ¤Ç¤Ï°Û¤Ê¤ë¡£ + +.\"O RAW sockets are generally rather unportable and should be avoided in +.\"O programs intended to be portable. +°ìÈÌ¤Ë raw ¥½¥±¥Ã¥È¤Ï°Ü¿¢À­¤¬¤Ê¤¤¤³¤È¤¬Â¿¤¤¤Î¤Ç¡¢ +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ + +.\"O Sending on raw sockets should take the IP protocol from +.\"O .IR sin_port ; +.\"O this ability was lost in Linux 2.2. +.\"O The workaround is to use +.\"O .BR IP_HDRINCL . +raw ¥½¥±¥Ã¥È¤Ø¤ÎÁ÷¿®¤Ç¤Ï¡¢ IP ¥×¥í¥È¥³¥ë¤ò +.I sin_port +¤«¤é¼èÆÀ¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤Îµ¡Ç½¤Ï Linux 2.2 ¤Ç¤Ï»È¤¨¤Ê¤¯¤Ê¤Ã¤¿¡£ +.B IP_HDRINCL +¤òÍѤ¤¤ì¤ÐƱÍͤΤ³¤È¤¬¼Â¸½¤Ç¤­¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Transparent proxy extensions are not described. +Æ©²á¥×¥í¥¯¥· (transparent proxy) ³ÈÄ¥¤Ë¤Ä¤¤¤Æ¤Ïµ­½Ò¤·¤Æ¤¤¤Ê¤¤¡£ + +.\"O When the +.\"O .B IP_HDRINCL +.\"O option is set, datagrams will not be fragmented and are limited to +.\"O the interface MTU. +.B IP_HDRINCL +¥ª¥×¥·¥ç¥ó¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¥Ç¡¼¥¿¥°¥é¥à¤Ï¥Õ¥é¥°¥á¥ó¥È²½¤µ¤ì¤º¡¢ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î MTU ¤ÎÂ礭¤µ¤ËÀ©¸Â¤µ¤ì¤ë¡£ + +.\"O Setting the IP protocol for sending in +.\"O .I sin_port +.\"O got lost in Linux 2.2. +.\"O The protocol that socket was bound to or that +.\"O was specified in the initial +.\"O .BR socket (2) +.\"O call is always used. +Á÷¿®ÍѤΠIP ¥×¥í¥È¥³¥ë¤ÎÀßÄê¤ò +.I sin_port +¤Ë¤·¤Æ¤ª¤¯µ¡Ç½¤Ï Linux 2.2 ¤«¤é»È¤¨¤Ê¤¯¤Ê¤Ã¤¿¡£ +¥½¥±¥Ã¥È¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¤«¡¢ºÇ½é¤Î +.BR socket (2) +¥³¡¼¥ë¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥×¥í¥È¥³¥ë¤¬¾ï¤ËÍѤ¤¤é¤ì¤ë¡£ +.\"O .\" .SH AUTHORS +.\" .SH Ãø¼Ô +.\"O .\" This man page was written by Andi Kleen. +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï Andi Kleen ¤¬½ñ¤¤¤¿¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR recvmsg (2), +.BR sendmsg (2), +.BR capabilities (7), +.BR ip (7), +.BR socket (7) + +.\"O .B RFC\ 1191 +.\"O for path MTU discovery. +¥Ñ¥¹ MTU ȯ¸«¤Ë´Ø¤¹¤ë¾ðÊó¤Ï +.B RFC\ 1191 +¤Ë¤¢¤ë + +.\"O .B RFC\ 791 +.\"O and the +.\"O .I +.\"O include file for the IP protocol. +IP ¥×¥í¥È¥³¥ë¤Ë´Ø¤·¤Æ¤Ï +.B RFC\ 791 +¤È¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ò»²¾È¡£ diff --git a/draft/man7/regex.7 b/draft/man7/regex.7 new file mode 100644 index 00000000..943c2472 --- /dev/null +++ b/draft/man7/regex.7 @@ -0,0 +1,523 @@ +.\" From Henry Spencer's regex package (as found in the apache +.\" distribution). The package carries the following copyright: +.\" +.\" Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. +.\" This software is not subject to any license of the American Telephone +.\" and Telegraph Company or of the Regents of the University of California. +.\" +.\" Permission is granted to anyone to use this software for any purpose +.\" on any computer system, and to alter it and redistribute it, subject +.\" to the following restrictions: +.\" +.\" 1. The author is not responsible for the consequences of use of this +.\" software, no matter how awful, even if they arise from flaws in it. +.\" +.\" 2. The origin of this software must not be misrepresented, either by +.\" explicit claim or by omission. Since few users ever read sources, +.\" credits must appear in the documentation. +.\" +.\" 3. Altered versions must be plainly marked as such, and must not be +.\" misrepresented as being the original software. Since few users +.\" ever read sources, credits must appear in the documentation. +.\" +.\" 4. This notice may not be removed or altered. +.\" +.\" In order to comply with `credits must appear in the documentation' +.\" I added an AUTHOR paragraph below - aeb. +.\" +.\" In the default nroff environment there is no dagger \(dg. +.\" +.\" 2005-05-11 Removed discussion of `[[:<:]]' and `[[:>:]]', which +.\" appear not to be in the glibc implementation of regcomp +.\" +.ie t .ds dg \(dg +.el .ds dg (!) +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Wed 8 Jul 1998 by NAKANO Takeo +.\" +.\"WORD: regular expression Àµµ¬É½¸½ +.\"WORD: modern RE ¿·¤·¤¤Àµµ¬É½¸½ +.\"WORD: obsolete RE ¸Å¤¤Àµµ¬É½¸½ +.\"WORD: basic RE ´ðËÜÀµµ¬É½¸½ +.\"WORD: extended RE ³ÈÄ¥Àµµ¬É½¸½ +.\"WORD: branch »Þ +.\"WORD: piece ʸÀá +.\"WORD: atom ¥¢¥È¥à +.\"WORD: bound ·«¤êÊÖ¤·»ØÄê +.\"WORD: bracket expression ¥Ö¥é¥±¥Ã¥Èɽ¸½ +.\"WORD: digit ¿ô»ú +.\"WORD: collating sequence ¾È¹ç½ç½ø +.\"WORD: collating element ¾È¹ç½ç½ø¤ÎÍ×ÁÇ +.\"WORD: character class ʸ»ú¥¯¥é¥¹ +.\"WORD: equivalent class Åù²Á¥¯¥é¥¹ +.\"WORD: substring Éôʬʸ»úÎó +.\"WORD: subexpression ÉôʬÀµµ¬É½¸½ +.\" +.TH REGEX 7 2009-01-12 "" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O regex \- POSIX.2 regular expressions +.SH ̾Á° +regex \- POSIX.2 Àµµ¬É½¸½ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Regular expressions ("RE"s), +.\"O as defined in POSIX.2, come in two forms: +.\"O modern REs (roughly those of +.\"O .IR egrep ; +.\"O POSIX.2 calls these "extended" REs) +.\"O and obsolete REs (roughly those of +.\"O .BR ed ; +.\"O POSIX.2 "basic" REs). +.\"O Obsolete REs mostly exist for backward compatibility in some old programs; +.\"O they will be discussed at the end. +.\"O POSIX.2 leaves some aspects of RE syntax and semantics open; +.\"O "\*(dg" marks decisions on these aspects that +.\"O may not be fully portable to other POSIX.2 implementations. +Àµµ¬É½¸½ (Regular expression: RE) ¤Ï POSIX.2 ¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +Æó¤Ä¤Î·Á¼°¤¬¤¢¤ë¡£¿·¤·¤¤Àµµ¬É½¸½ (modern RE) ¤È¸Å¤¤Àµµ¬É½¸½ (obsolete RE) +¤Ç¤¢¤ë¡£¿·¤·¤¤Àµµ¬É½¸½¤Ï¤À¤¤¤¿¤¤ +.I egrep +¤Î¤â¤Î¤ÈƱ¤¸¤Ç¡¢ POSIX.2 ¤Ç¤Ï¡Ö³ÈÄ¥¡×Àµµ¬É½¸½ ("extended" RE) +¤È¸Æ¤Ð¤ì¤Æ¤¤¤ë¡£¸Å¤¤Àµµ¬É½¸½¤Ï¤À¤¤¤¿¤¤ +.BR ed (1) +¤Î¤â¤Î¤ÈƱ¤¸¤Ç¡¢ POSIX.2 ¤Ç¤Ï¡Ö´ðËÜ¡×Àµµ¬É½¸½ ("basic" RE) ¤Ç¤¢¤ë¡£ +¸Å¤¤Àµµ¬É½¸½¤Ï¡¢¸Å¤¤¥×¥í¥°¥é¥à¤È¤Î¸ß´¹À­¤òÊݤĤ¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë¤Ä¤¤¤Æ¤ÏºÇ¸å¤ËµÄÏÀ¤¹¤ë¡£ +POSIX.2 ¤Ç¤Ï¡¢Àµµ¬É½¸½¤Îʸˡ¤äµ­¹æ¤Î°ìÉô¤¬¡¢Ì¤ÄêµÁ¤Î¤Þ¤Þ»Ä¤µ¤ì¤Æ¤¤¤ë¡£ +"\*(dg" ¤Ï¡¢¤³¤Î¤è¤¦¤Ê°ÕÌ£¤Ç¡¢Â¾¤Î POSIX.2 ¤Î¼ÂÁõ¤È +´°Á´¤Ë¤Ï¸ß´¹¤Ç¤Ê¤¤¤«¤âÃΤì¤Ê¤¤Éôʬ¤Ç¤¢¤ë¡£ +.PP +.\"O A (modern) RE is one\*(dg or more nonempty\*(dg \fIbranches\fR, +.\"O separated by \(aq|\(aq. +.\"O It matches anything that matches one of the branches. +(¿·¤·¤¤) Àµµ¬É½¸½¤Ï°ì¤Ä°Ê¾å\*(dg ¤Î¶õÇò¤Ç¤Ê¤¤ \fI»Þ (branch)\fP ¤«¤é¤Ê¤ë¡£ +»Þ¤É¤¦¤·¤Ï \(aq|\(aq ¤Ç¶èÀÚ¤é¤ì¤ë¡£Àµµ¬É½¸½¤Ï¡¢ +»Þ¤Î¤É¤ì¤«¤Ë¥Þ¥Ã¥Á (match) ¤·¤¿¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +.\"O A branch is one\*(dg or more \fIpieces\fR, concatenated. +.\"O It matches a match for the first, followed by a match for the second, etc. +»Þ¤Ï°ì¤Ä°Ê¾å¤ÎʸÀá (piece) ¤¬·ë¹ç¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ +»Þ¤ÏÂè°ì¤ÎʸÀ᤬¥Þ¥Ã¥Á¤·¡¢ +³¤¤¤ÆÂèÆó¤ÎʸÀ᤬¥Þ¥Ã¥Á¤·¡¢... ¤·¤¿¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +.\"O A piece is an \fIatom\fR possibly followed +.\"O by a single\*(dg \(aq*\(aq, \(aq+\(aq, \(aq?\(aq, or \fIbound\fR. +.\"O An atom followed by \(aq*\(aq +.\"O matches a sequence of 0 or more matches of the atom. +.\"O An atom followed by \(aq+\(aq +.\"O matches a sequence of 1 or more matches of the atom. +.\"O An atom followed by \(aq?\(aq +.\"O matches a sequence of 0 or 1 matches of the atom. +ʸÀá¤Ï\fI¥¢¥È¥à (atom)\fR ¤«¤é¤Ê¤ë¡£¤¿¤À¤·¥¢¥È¥à¤Î¸å¤Ë¤Ï°ì¤Ä\*(dg ¤Î \(aq*\(aq, +\(aq+\(aq, \(aq?\(aq ¤¢¤ë¤¤¤Ï \fI·«¤êÊÖ¤·»ØÄê (bound)\fR ¤¬Â³¤¯¤³¤È¤â¤¢¤ë¡£ +\(aq*\(aq ¤¬¸åÃÖ¤µ¤ì¤¿¥¢¥È¥à¤Ï¡¢¥Þ¥Ã¥Á¤·¤¿¥¢¥È¥à¤Î 0 ¸Ä°Ê¾å¤ÎʤӤ˥ޥåÁ¤¹¤ë¡£ +\(aq+\(aq ¤¬¸åÃÖ¤µ¤ì¤¿¥¢¥È¥à¤Ï¡¢¥Þ¥Ã¥Á¤·¤¿¥¢¥È¥à¤Î 1 ¸Ä°Ê¾å¤ÎʤӤ˥ޥåÁ¤¹¤ë¡£ +\(aq?\(aq ¤¬¸åÃÖ¤µ¤ì¤¿¥¢¥È¥à¤Ï¡¢¥Þ¥Ã¥Á¤·¤¿¥¢¥È¥à¤Î 0 ¸Ä¤Þ¤¿¤Ï 1 ¸Ä¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +.\"O A \fIbound\fR is \(aq{\(aq followed by an unsigned decimal integer, +.\"O possibly followed by \(aq,\(aq +.\"O possibly followed by another unsigned decimal integer, +.\"O always followed by \(aq}\(aq. +\fI·«¤êÊÖ¤·»ØÄê\fR¤È¤Ï \(aq{\(aq ¤Ë³¤¤¤Æ¡¢Éä¹æ¤Ê¤· 10 ¿ÊÀ°¿ô¡¢\(aq,\(aq¡¢ +¤â¤¦°ì¤Ä¤Î 10 ¿ÊÀ°¿ô¡¢\(aq}\(aq ¤òʤ٤¿¤â¤Î¤Ç¤¢¤ë¡£\(aq,\(aq ¤ÈÆó¤Ä¤á¤Î +10 ¿ÊÀ°¿ô¤Ï¾Êά¤Ç¤­¤ë¡£Æó¤Ä¤á¤Î 10 ¿ÊÀ°¿ô¤À¤±¤ò¾Êά¤¹¤ë¤³¤È¤â¤Ç¤­¤ë +(ºÇ¸å¤Î `}' ¤Ï¾Êά¤Ç¤­¤Ê¤¤)¡£ +.\"O The integers must lie between 0 and +.\"O .B RE_DUP_MAX +.\"O (255\*(dg) inclusive, +.\"O and if there are two of them, the first may not exceed the second. +.\"O An atom followed by a bound containing one integer \fIi\fR +.\"O and no comma matches +.\"O a sequence of exactly \fIi\fR matches of the atom. +.\"O An atom followed by a bound +.\"O containing one integer \fIi\fR and a comma matches +.\"O a sequence of \fIi\fR or more matches of the atom. +.\"O An atom followed by a bound +.\"O containing two integers \fIi\fR and \fIj\fR matches +.\"O a sequence of \fIi\fR through \fIj\fR (inclusive) matches of the atom. +À°¿ô¤Ï 0 °Ê¾å +.B RE_DUP_MAX +(255\*(dg) °Ê²¼¤Î´Ö¤Ç»ØÄê¤Ç¤­¤ë¡£ +Æó¤Ä»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ºÇ½é¤Î¿ôÃͤϸå¤Î¿ôÃͤò±Û¤¨¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +À°¿ô \fIi\fR ¤À¤±¤«¤é¤Ê¤ë·«¤êÊÖ¤·»ØÄê¤ò¸åÃÖ¤µ¤ì¤¿¥¢¥È¥à¤Ï¡¢ +¥¢¥È¥à¤ò¤Ô¤Ã¤¿¤ê¤Á¤ç¤¦¤É \fIi\fR ¸Ä¤À¤±Ê¤٤¿¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +À°¿ô \fIi\fR ¤È¥³¥ó¥Þ¤¬»ØÄꤵ¤ì¤¿·«¤êÊÖ¤·»ØÄê¤ò¸åÃÖ¤µ¤ì¤¿¥¢¥È¥à¤Ï¡¢ +¥¢¥È¥à¤ò \fIi\fR¸Ä°Ê¾åʤ٤¿¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +À°¿ô \fIi\fR ¤È \fIj\fR ¤¬»ØÄꤵ¤ì¤¿·«¤êÊÖ¤·»ØÄê¤ò¸åÃÖ¤µ¤ì¤¿¥¢¥È¥à¤Ï¡¢ +¥¢¥È¥à¤ò \fIi\fR¸Ä°Ê¾å \fIj\fR ¸Ä°Ê²¼¤À¤±Ê¤٤¿¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +.\"O An atom is a regular expression enclosed in "\fI()\fP" +.\"O (matching a match for the regular expression), +.\"O an empty set of "\fI()\fP" (matching the null string)\*(dg, +.\"O a \fIbracket expression\fR (see below), \(aq.\(aq +.\"O (matching any single character), \(aq^\(aq (matching the null string at the +.\"O beginning of a line), \(aq$\(aq (matching the null string at the +.\"O end of a line), a \(aq\e\(aq followed by one of the characters +.\"O "\fI^.[$()|*+?{\e\fP" +.\"O (matching that character taken as an ordinary character), +.\"O a \(aq\e\(aq followed by any other character\*(dg +.\"O (matching that character taken as an ordinary character, +.\"O as if the \(aq\e\(aq had not been present\*(dg), +.\"O or a single character with no other significance (matching that character). +¥¢¥È¥à¤Î¼ïÎà¤Ï°Ê²¼¤ÎÄ̤ꡣ"\fI()\fP" ¤Ë°Ï¤Þ¤ì¤¿Àµµ¬É½¸½ +(¤½¤ÎÀµµ¬É½¸½¤¬¥Þ¥Ã¥Á¤¹¤ëʸ»úÎó¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡¢ +Ãæ¿È¤¬¶õ¤Î "\fI()\fP" (null ʸ»úÎó¤Ë¥Þ¥Ã¥Á¤¹¤ë)\*(dg¡¢ +\fI¥Ö¥é¥±¥Ã¥Èɽ¸½ (bracket expression\fR :¸å½Ò)¡¢ +\(aq.\(aq (Ǥ°Õ¤Î 1 ʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡¢ +\(aq^\(aq (¹ÔƬ¤Î¶õÇòʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡¢ +\(aq$\(aq (¹ÔËö¤Î¶õÇòʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡¢ +\(aq\e\(aq ¤Ë "\fI^.[$()|*+?{\e\fP" ¤Î¤¤¤º¤ì¤«°ìʸ»ú¤ò¸åÃÖ¤·¤¿¤â¤Î +(Ä̾ï¤Îʸ»ú¤È¤·¤Æ°·¤ï¤ì¡¢¤½¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡¢ +\(aq\e\(aq ¤Ë¤½¤ì°Ê³°¤Îʸ»ú¤ò¸åÃÖ¤·¤¿¤â¤Î\*(dg +(\(aq\e\(aq ¤¬¤Ê¤¤¾ì¹ç¤ÈƱ¤¸¤è¤¦¤Ë¡¢¤½¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë\*(dg)¡¢ +Æä˰ÕÌ£¤ò»ý¤¿¤Ê¤¤Ê¸»ú°ì¤Ä (¤½¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡£ +.\"O A \(aq{\(aq followed by a character other than a digit is an ordinary +.\"O character, not the beginning of a bound\*(dg. +.\"O It is illegal to end an RE with \(aq\e\(aq. +\(aq{\(aq ¤Ï¿ô»ú°Ê³°¤Îʸ»ú¤¬¸åÃÖ¤µ¤ì¤ë¤ÈÄ̾ï¤Îʸ»ú¤È¤·¤Æ°·¤ï¤ì¡¢ +·«¤êÊÖ¤·»ØÄê¤Î»Ï¤Þ¤ê¤È¤Ï¤µ¤ì¤Ê¤¤\*(dg¡£\(aq\e\(aq +¤Ç½ª¤ï¤ëÀµµ¬É½¸½¤ÏÉÔÀµ¤Ê¤â¤Î¤È¤ß¤Ê¤µ¤ì¤ë¡£ +.PP +.\"O A \fIbracket expression\fR is a list of characters enclosed in "\fI[]\fP". +.\"O It normally matches any single character from the list (but see below). +.\"O If the list begins with \(aq^\(aq, +.\"O it matches any single character +.\"O (but see below) \fInot\fR from the rest of the list. +.\"O If two characters in the list are separated by \(aq\-\(aq, this is shorthand +.\"O for the full \fIrange\fR of characters between those two (inclusive) in the +.\"O collating sequence, +.\"O for example, "\fI[0\-9]\fP" in ASCII matches any decimal digit. +.\"O It is illegal\*(dg for two ranges to share an +.\"O endpoint, for example, "\fIa-c-e\fP". +.\"O Ranges are very collating-sequence-dependent, +.\"O and portable programs should avoid relying on them. +\fI¥Ö¥é¥±¥Ã¥Èɽ¸½\fR¤Ï "\fI[]\fP" ¤Ë¤è¤Ã¤ÆÊĤ¸¤é¤ì¤¿Ê¸»ú¤Î¥ê¥¹¥È¤Ç¤¢¤ë¡£ +¤³¤ì¤ÏÄ̾ï¥ê¥¹¥ÈÃæ¤Ë¸ºß¤·¤Æ¤¤¤ëʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +(Îã³°¤¢¤ê¡¢¸å½Ò¡£) ¥ê¥¹¥È¤¬ \(aq^\(aq ¤Ç»Ï¤Þ¤ë¤È¡¢ +\fI¥Ö¥é¥±¥Ã¥Èɽ¸½\fR¤Ï¥ê¥¹¥È¤Ë¸ºß¤·¤Æ\fI¤¤¤Ê¤¤\fRʸ»ú°ì¤Ä¤Ë¥Þ¥Ã¥Á¤¹¤ë +(Îã³°¤¢¤ê¡¢¸å½Ò)¡£ ¥ê¥¹¥ÈÃæ¤ÎÆó¤Ä¤Îʸ»ú¤¬ \(aq\-\(aq ¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¤³¤ì¤Ï¾È¹ç½ç½ø (collating sequence) ¤Ç¤½¤ÎÆó¤Ä¤Îʸ»ú¤Ë¶´¤Þ¤ì¤ë¡¢ +¤¹¤Ù¤Æ¤Îʸ»ú¤ÎʤӤòû½Ì¤·¤¿¤â¤Î¤È¤ß¤Ê¤µ¤ì¤ë (ξü´Þ¤à)¡£ +Î㤨¤Ð "\fI[0\-9]\fP" ¤Ï ASCII ¤Ç¤Ï 10 ¿Ê¤Î¿ô»ú (digit) ¤Î¤¤¤º¤ì¤«¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +Æó¤Ä¤ÎÎΰè»ØÄ꤬üÅÀ¤ò¶¦Í­¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤\*(dg¡£ +¤Ä¤Þ¤ê "\fIa-c-e\fP" ¤Î¤è¤¦¤Ê¤â¤Î¤ÏÉÔÀµ¤Ç¤¢¤ë¡£Îΰè»ØÄê¤Ï¾È¹ç½ç½ø¤Ë¶¯¤¯°Í¸¤¹¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ°Ü¿¢À­¤Î¹â¤¤¥×¥í¥°¥é¥à¤òºî¤ë¾ì¹ç¤Ï¡¢ +Îΰè»ØÄê¤Ë¤ÏÍê¤é¤Ê¤¤¤Û¤¦¤¬Îɤ¤¤À¤í¤¦¡£ +.PP +¡ÚÌõÃí: ¾È¹ç½ç½ø (collating sequence) ¤È¤¤¤¦¤Î¤Ï¡¢¹ñºÝ²½ +(Internationalization) ¤Ë´ØÏ¢¤·¤¿ÍѸì¤Ç¤¹¡£¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Ëñ¸ì¤òÊ +¤Ù¤ëºÝ¤Ë¤Ï¡¢¸À¸ì¤Ë¤è¤Ã¤Æʤ٤ë´ð½à¤¬°Û¤Ê¤ê¤Þ¤¹¡£¾È¹ç½ç½ø¤Ï¡¢¤½¤Îº¹°Û¤ò +µÛ¼ý¤¹¤ë¤¿¤á¤Î»ÅÁȤߤǤ¹¡£ +.PP +Î㤨¤Ð¡¢¥¹¥Ú¥¤¥ó¸ì¤Ç¤Ï ch ¤È¤¤¤¦Ê¸»úʤӤòÆÃÊÌ°·¤¤¤¹¤ë¤¿¤á¡¢¥¢¥ë¥Õ¥¡¥Ù¥Ã +¥È½ç¤¬ a, b, c, ch, d, e, ... ¤Î½ç¤Ë¤Ê¤ë¤½¤¦¤Ç¤¹¡£¤³¤Î¤è¤¦¤Ê¥·¡¼¥±¥ó¥¹ +¤Î¤³¤È¤ò collating sequence ¤È¸À¤¤¤Þ¤¹¡£¤³¤Î¤È¤­ `ch' ¤È¤¤¤¦Ê¸»úʤӤϡ¢ +ñ¸ìÀ°Îó¤ÎºÝ¤Ë¤¢¤¿¤«¤â¡Ö°ìʸ»ú¡×¤Î¤è¤¦¤Ë°·¤ï¤ì¤Þ¤¹¡£¤³¤³¤Ç¡¢ +½ç½øÉÕ¤±¤ò¹Ô¤¦ºÝ¤ËºÇ¾®¤Îñ°Ì¤È¤Ê¤ë¡¢`a'¡¢`b' ¤Îʸ»ú¤ä +`ch' ¤Î¤è¤¦¤ÊÆÃÊ̤Êʸ»úʤӤʤɡ¢¾È¹ç½ç½ø¤ÎÍ×ÁǤΤ³¤È¤ò +collating element ¤È¸À¤¤¤Þ¤¹¡£collating sequence ¤Ï¡¢Ê¸»úñ°Ì¤Ç¤Ï¤Ê¤¯ +collating element ¤òñ°Ì¤È¤·¤ÆÄêµÁ¤µ¤ì¤Þ¤¹¡£¡Û +.PP +.\"O To include a literal \(aq]\(aq in the list, make it the first character +.\"O (following a possible \(aq^\(aq). +.\"O To include a literal \(aq\-\(aq, make it the first or last character, +.\"O or the second endpoint of a range. +.\"O To use a literal `\-' as the first endpoint of a range, +.\"O enclose it in `[.' and `.]' to make it a collating element (see below). +.\"O With the exception of these and some combinations using `[' (see next +.\"O paragraphs), all other special characters, including `\e', lose their +.\"O To use a literal \(aq\-\(aq as the first endpoint of a range, +.\"O enclose it in "\fI[.\fP" and "\fI.]\fP" +.\"O to make it a collating element (see below). +.\"O With the exception of these and some combinations using \(aq[\(aq (see next +.\"O paragraphs), all other special characters, including \(aq\e\(aq, lose their +.\"O special significance within a bracket expression. +ʸ»ú \(aq]\(aq ¤½¤Î¤â¤Î¤ò¥ê¥¹¥È¤ËÆþ¤ì¤¿¤¤¾ì¹ç¤Ï¡¢ +ºÇ½é¤Îʸ»ú¤È¤·¤Æ»ØÄꤹ¤ì¤ÐÎɤ¤ (\(aq^\(aq) ¤Î¸å¤Ë³¤±¤ë¤Î¤Ç¤âÎɤ¤)¡£ +ʸ»ú \(aq\-\(aq ¤½¤Î¤â¤Î¤ò¥ê¥¹¥È¤ËÆþ¤ì¤¿¤¤¾ì¹ç¤Ï¡¢ +ºÇ½é¤«ºÇ¸å¤Îʸ»ú¤È¤¹¤ì¤ÐÎɤ¤¡£ +¤¢¤ë¤¤¤ÏÎΰè»ØÄê¤Î½ªÃ¼Ê¸»ú¤È¤·¤Æ»ØÄꤷ¤Æ¤âÎɤ¤¡£ +\(aq\-\(aq ¤òÎΰè»ØÄê¤ÎÀèƬʸ»ú¤Ë»ØÄꤹ¤ë¤Ë¤Ï¡¢"\fI[.\fP" ¤È "\fI.]\fP" ¤Ç°Ï¤Ã¤Æ¡¢ +¾È¹ç½ç½ø¤ÎÍ×ÁÇ (collating element: ¸å½Ò) ¤Ë¤¹¤ì¤ÐÎɤ¤¡£ +¾¤ÎÆüìʸ»ú ( ¤â´Þ¤à) ¤Ï¡¢ +¥Ö¥é¥±¥Ã¥Èɽ¸½¤ÎÆâÉô¤Ç¤Ï¤¹¤Ù¤ÆÄ̾ï¤Îʸ»ú¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +.PP +.\"O Within a bracket expression, a collating element (a character, +.\"O a multicharacter sequence that collates as if it were a single character, +.\"O or a collating-sequence name for either) +.\"O enclosed in "\fI[.\fP" and "\fI.]\fP" stands for the +.\"O sequence of characters of that collating element. +.\"O The sequence is a single element of the bracket expression's list. +.\"O A bracket expression containing a multicharacter collating element +.\"O can thus match more than one character, +.\"O for example, if the collating sequence includes a "ch" collating element, +.\"O then the RE "\fI[[.ch.]]*c\fP" matches the first five characters +.\"O of "chchcc". +¥Ö¥é¥±¥Ã¥Èɽ¸½¤ÎÆâÉô¤Ç¤Ï¡¢"\fI[.\fP" ¤È "\fI.]\fP" ¤Ë°Ï¤ï¤ì¤¿¾È¹ç½ç½ø¤ÎÍ×ÁǤϡ¢ +¤½¤ÎÍ×ÁǤËÂбþ¤¹¤ëʸ»úʤӤòɽ¤¹¡£ +¡Ö¾È¹ç½ç½ø¤ÎÍ×ÁǡפȤϡ¢ +[1] ʸ»ú¡¢ [2] ñ°ìʸ»ú¤Î¤è¤¦¤Ë°·¤ï¤ì¤ëÊ£¿ôʸ»ú¤Î¥·¡¼¥±¥ó¥¹¡¢ +[3] 1, 2 ¤¤¤º¤ì¤«¤ËÂбþ¤¹¤ë¾È¹ç½ç½ø¾å¤Î̾Á°¡¢¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ +¤³¤Î·«¤êÊÖ¤·¤Ï¡¢¥Ö¥é¥±¥Ã¥Èɽ¸½¤Î¥ê¥¹¥È¤Ë¤ª¤±¤ëñ°ì¤ÎÍ×ÁǤȤʤ롣 +¾åµ­ [2] ¤Î¡¢¡ÖÊ£¿ôʸ»ú¤«¤é¤Ê¤ë¾È¹ç½ç½øÍ×Áǡפò´Þ¤à¥Ö¥é¥±¥Ã¥Èɽ¸½¤Ï¡¢ +¤·¤¿¤¬¤Ã¤Æ°ìʸ»ú°Ê¾å¤Ë¥Þ¥Ã¥Á¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +Î㤨¤Ð¡¢¤â¤·¾È¹ç½ç½ø¤¬ "ch" ¤È¤¤¤¦Í×ÁǤò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +Àµµ¬É½¸½ "\fI[[.ch.]]*c\fP" ¤Ï "chchcc" ¤ÎºÇ½é¤Î 5 ʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +.\"O Within a bracket expression, a collating element enclosed in "\fI[=\fP" and +.\"O "\fI=]\fP" is an equivalence class, standing for the sequences of characters +.\"O of all collating elements equivalent to that one, including itself. +.\"O (If there are no other equivalent collating elements, +.\"O the treatment is as if the enclosing delimiters +.\"O were "\fI[.\fP" and "\fI.]\fP".) +.\"O For example, if o and \o'o^' are the members of an equivalence class, +.\"O then "\fI[[=o=]]\fP", "\fI[[=\o'o^'=]]\fP", +.\"O and "\fI[o\o'o^']\fP" are all synonymous. +.\"O An equivalence class may not\*(dg be an endpoint +.\"O of a range. +¥Ö¥é¥±¥Ã¥Èɽ¸½¤ÎÆâÉô¤Ç¤Ï¡¢"\fI[=\fP" ¤È "\fI=]\fP" ¤Ë°Ï¤Þ¤ì¤¿¾È¹ç½ç½ø¤ÎÍ×ÁǤϡ¢ +Åù²Á¥¯¥é¥¹ (equivalence class) ¤È¤Ê¤ë¡£ +¤³¤ì¤Ï¡¢¤½¤ÎÍ×ÁǤÈÅù²Á¤ÊÍ×ÁǤ¹¤Ù¤Æ¤«¤é¤Ê¤ëʸ»ú¥·¡¼¥±¥ó¥¹ (¼«¿È¤â´Þ¤à) ¤òɽ¤¹¡£ +¾¤ËÅù²Á¤ÊÍ×ÁǤ¬¤Ê¤±¤ì¤Ð¡¢ +¼è¤ê°·¤¤¤Ï "\fI[.\fP" ¤È "\fI.]\fP" ¤Ç°Ï¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +Î㤨¤Ð o ¤È ou ¤¬Åù²Á¥¯¥é¥¹¤Î¥á¥ó¥Ð¡¼¤Ç¤¢¤ì¤Ð¡¢ +"\fI[[=o=]]\fP", "\fI[[=\o'o^'=]]\fP", "\fI[o\o'o^']\fP" ¤Ï¤¹¤Ù¤ÆƱ¤¸°ÕÌ£¤Ë¤Ê¤ë¡£ +Åù²Á¥¯¥é¥¹¤ÏÎΰè»ØÄê¤ÎüÅÀ¤Ë¤Ï¤Ê¤ì¤Ê¤¤\*(dg¡£ +.\" nippon üËö¤Ç¤Ï \o'o^' ¤¬Àµ¤·¤¯½Ð¤Ê¤¤¤Î¤Ç¡¢Î㼨¤òÊѹ¹¤·¤Þ¤·¤¿¡£ +.PP +.\"O Within a bracket expression, the name of a \fIcharacter class\fR enclosed +.\"O in "\fI[:\fP" and "\fI:]\fP" stands for the list +.\"O of all characters belonging to that +.\"O class. +.\"O Standard character class names are: +¥Ö¥é¥±¥Ã¥Èɽ¸½¤ÎÆâÉô¤Ç¤Ï¡¢"\fI[:\fP" ¤È "\fI:]\fP" ¤Ç°Ï¤ï¤ì¤¿\fIʸ»ú¥¯¥é¥¹ +(character class)\fR ¤Ï¤½¤Î¥¯¥é¥¹¤Ë°¤¹¤ë¤¹¤Ù¤Æ¤Îʸ»ú¤Î¥ê¥¹¥È¤òɽ¤¹¡£ +ɸ½à¤ÇÍÑ°Õ¤µ¤ì¤Æ¤¤¤ëʸ»ú¥¯¥é¥¹¤Î̾Á°¤Ï°Ê²¼¤ÎÄ̤ê: +.PP +.RS +.nf +.ta 3c 6c 9c +alnum digit punct +alpha graph space +blank lower upper +cntrl print xdigit +.fi +.RE +.PP +.\"O These stand for the character classes defined in +.\"O .BR wctype (3). +.\"O A locale may provide others. +.\"O A character class may not be used as an endpoint of a range. +¤³¤ì¤é¤Ï +.BR wctype (3) +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëʸ»ú¥¯¥é¥¹¤òɽ¤·¤Æ¤¤¤ë¡£¥í¥±¡¼¥ë (locale) ¤Ë¤è¤Ã¤Æ¡¢ +¤³¤ì¤é°Ê³°¤Î¥¯¥é¥¹¤¬ÄêµÁ¤µ¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +ʸ»ú¥¯¥é¥¹¤ÏÎΰè»ØÄê¤ÎüÅÀ¤Ë¤Ï¤Ê¤ì¤Ê¤¤¡£ +.\" .PP +.\"O .\" As per http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295666 +.\"O .\" The following does not seem to apply in the glibc implementation +.\"O .\" There are two special cases\*(dg of bracket expressions: +.\"O .\" the bracket expressions "\fI[[:<:]]\fP" and "\fI[[:>:]]\fP" match +.\"O .\" the null string at the beginning and end of a word respectively. +.\"O .\" A word is defined as a sequence of +.\"O .\" word characters +.\"O .\" which is neither preceded nor followed by +.\"O .\" word characters. +.\"O .\" A word character is an +.\"O .\" .I alnum +.\"O .\" character (as defined by +.\"O .\" .BR wctype (3)) +.\"O .\" or an underscore. +.\"O .\" This is an extension, +.\"O .\" compatible with but not specified by POSIX.2, +.\"O .\" and should be used with +.\"O .\" caution in software intended to be portable to other systems. +.\" http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295666 ¤Ë¤¢¤ë¤è¤¦¤Ë +.\" °Ê²¼¤Îµ­ºÜ¤Ï glibc ¤Î¼ÂÁõ¤Ë¤Ï¤¢¤Æ¤Ï¤Þ¤é¤Ê¤¤¤è¤¦¤Ç¤¢¤ë¡£ +.\" ¥Ö¥é¥±¥Ã¥Èɽ¸½¤Ë¤Ï¡¢Æüì¤Ê°ÕÌ£¤ò»ý¤Ä¤â¤Î¤¬Æó¤Ä¸ºß¤¹¤ë\*(dg¡£ +.\" ¥Ö¥é¥±¥Ã¥Èɽ¸½ "\fI[[:<:]]\fP" ¤Ï¥ï¡¼¥É (word) ÀèƬ¤Î¥Ì¥ëʸ»úÎó¤Ë¡¢ +.\" "\fI[[:>:]]\fP" ¤Ï¥ï¡¼¥ÉËöÈø¤Î¥Ì¥ëʸ»úÎó¤Ë¤½¤ì¤¾¤ì¥Þ¥Ã¥Á¤¹¤ë¡£ +.\" ¥ï¡¼¥É¤È¤Ï¥ï¡¼¥Éʸ»ú¤ÎʤӤǤ¢¤ê¡¢ +.\" ¥ï¡¼¥Éʸ»ú¤¬Á°ÃÖ¤â¸åÃ֤⤵¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¡£ +.\" ¥ï¡¼¥Éʸ»ú¤Ï +.\" .I alnum +.\" ʸ»ú +.\" .RB ( wctype (3) +.\" ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë) ¤ª¤è¤Ó¥¢¥ó¥À¡¼¥¹¥³¥¢ `_' ¤Ç¤¢¤ë¡£ +.\" ¤³¤ì¤Ï³ÈÄ¥µ­Ë¡¤Ç¤¢¤ê¡¢POSIX.2 ¤ËÈ¿¤·¤Æ¤Ï¤¤¤Ê¤¤¤¬¡¢ +.\" ÄêµÁ¤â¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" ¾¤Î¥·¥¹¥Æ¥à¤È¸ß´¹À­¤ò³ÎÊݤ·¤¿¤¤¥½¥Õ¥È¥¦¥§¥¢¤Ç¤Ï¡¢ +.\" Ãí°Õ¤·¤ÆÍѤ¤¤ë¤è¤¦¤Ë¤¹¤ë¤³¤È¡£ +.PP +.\"O In the event that an RE could match more than one substring of a given +.\"O string, +.\"O the RE matches the one starting earliest in the string. +.\"O If the RE could match more than one substring starting at that point, +.\"O it matches the longest. +.\"O Subexpressions also match the longest possible substrings, subject to +.\"O the constraint that the whole match be as long as possible, +.\"O with subexpressions starting earlier in the RE taking priority over +.\"O ones starting later. +.\"O Note that higher-level subexpressions thus take priority over +.\"O their lower-level component subexpressions. +Àµµ¬É½¸½¤¬¡¢Í¿¤¨¤é¤ì¤¿Ê¸»úÎó¤ÎÊ£¿ô¤ÎÉôʬʸ»úÎó +(substring) ¤Ë¥Þ¥Ã¥Á¤Ç¤­¤ë¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï¡¢ +ºÇ¤âÀèƬ¤Î¶á¤¯¤«¤é»Ï¤Þ¤ë¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +¤½¤Î°ÌÃÖ¤«¤é»Ï¤Þ¤ê¡¢Àµµ¬É½¸½¤¬¥Þ¥Ã¥Á¤Ç¤­¤ëÉôʬʸ»úÎó¤¬Ê£¿ô¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢ +ºÇŤΤâ¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +ÉôʬÀµµ¬É½¸½ (subexpression) ¤âºÇ¤âŤ¤Éôʬʸ»úÎó¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +¤¿¤À¤·¡¢Á´ÂΤΥޥåÁ¤¬ºÇŤǤ¢¤ë¤è¤¦¤Ë¡¢¤È¤¤¤¦¾ò·ï¤¬Í¥À褵¤ì¤ë¡£ +Àµµ¬É½¸½¤ÎÃæ¤ÇÀè¤Ë¸½¤ì¤ëÉôʬÀµµ¬É½¸½¤Ï¡¢¸å¤Ë¸½¤ì¤ë¤â¤Î¤è¤êÍ¥À褵¤ì¤ë¡£ +¤¿¤À¤·¡¢¤è¤ê¹â°Ì¤ÎÉôʬÀµµ¬É½¸½¤Ï¡¢ +¤½¤ì¤ò¹½À®¤¹¤ëÄã°Ì¤ÎÉôʬÀµµ¬É½¸½¤è¤ê¤âÍ¥À褵¤ì¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.PP +.\"O Match lengths are measured in characters, not collating elements. +.\"O A null string is considered longer than no match at all. +.\"O For example, +.\"O "\fIbb*\fP" matches the three middle characters of "abbbc", +.\"O "\fI(wee|week)(knights|nights)\fP" +.\"O matches all ten characters of "weeknights", +.\"O when "\fI(.*).*\fP" is matched against "abc" the parenthesized subexpression +.\"O matches all three characters, and +.\"O when "\fI(a*)*\fP" is matched against "bc" +.\"O both the whole RE and the parenthesized +.\"O subexpression match the null string. +¥Þ¥Ã¥ÁĹ¤Ï¾È¹ç½ç½ø¤ÎÍ×ÁǤǤϤʤ¯¡¢Ê¸»ú¿ô¤òñ°Ì¤È¤·¤Æ¥«¥¦¥ó¥È¤µ¤ì¤ë¡£ +null ʸ»úÎó¤Ï¡¢Á´¤¯¥Þ¥Ã¥Á¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤è¤ê¤âŤ¤¤È¤ß¤Ê¤µ¤ì¤ë¡£ +Î㤨¤Ð "\fIbb*\fP" ¤Ï "abbbc" ¤Î¤Þ¤óÃæ¤Î 3 ʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +"\fI(wee|week)(knights|nights)\fP" ¤Ï "weeknights" ¤ÎÁ´ÂΤ˥ޥåÁ¤¹¤ë¡£ +"\fI(.*).*\fP" ¤ò "abc" ¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¤È¡¢ +³ç¸Ì¤ÎÆâÉô¤ÎÉôʬÀµµ¬É½¸½¤¬ 3 ʸ»ú¤¹¤Ù¤Æ¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +"\fI(a*)*\fP" ¤ò "bc" ¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¤È¡¢Àµµ¬É½¸½Á´ÂΤ⡢ +³ç¸Ì¤Ç³ç¤é¤ì¤¿ÉôʬÀµµ¬É½¸½¤â null ʸ»úÎó¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +.\"O If case-independent matching is specified, +.\"O the effect is much as if all case distinctions had vanished from the +.\"O alphabet. +.\"O When an alphabetic that exists in multiple cases appears as an +.\"O ordinary character outside a bracket expression, it is effectively +.\"O transformed into a bracket expression containing both cases, +.\"O for example, \(aqx\(aq becomes "\fI[xX]\fP". +.\"O When it appears inside a bracket expression, all case counterparts +.\"O of it are added to the bracket expression, so that, for example, "\fI[x]\fP" +.\"O becomes "\fI[xX]\fP" and "\fI[^x]\fP" becomes "\fI[^xX]\fP". +¥Þ¥Ã¥Á¤¬Âçʸ»ú¡¦¾®Ê¸»ú¤ò̵»ë¤¹¤ë¤è¤¦¤Ë»ØÄꤵ¤ì¤ë¤È¡¢ +¥¢¥ë¥Õ¥¡¥Ù¥Ã¥ÈÁ´ÂΤ«¤éÂ羮ʸ»ú¤Î¶èÊ̤¬Ìµ¤¯¤Ê¤Ã¤¿¤«¤Î¤è¤¦¤Ê¸ú²Ì¤È¤Ê¤ë¡£ +Âçʸ»ú¡¦¾®Ê¸»ú¤ò»ý¤Ä¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤¬¥Ö¥é¥±¥Ã¥Èɽ¸½¤Î³°Éô¤Ç +Ä̾ï¤Îʸ»ú¤È¤·¤Æ¸½¤ì¤ë¤È¡¢ +¤³¤ì¤Ï¼Â¸úŪ¤ËÂ羮ξÊý¤Îʸ»ú¤Î¥Ö¥é¥±¥Ã¥Èɽ¸½¤Î¤è¤¦¤ËÊÑ´¹¤µ¤ì¤ë¡£ +¤¹¤Ê¤ï¤Á \(aqx\(aq ¤Ï "\fI[xX]\fP" ¤È¤Ê¤ë¡£¥Ö¥é¥±¥Ã¥Èɽ¸½¤ÎÆâÉô¤Ë¸½¤ì¤ë¤È¡¢ +Âçʸ»ú¤Ê¤é¾®Ê¸»ú¤¬¡¢¾®Ê¸»ú¤Ê¤éÂçʸ»ú¤¬¤½¤Î¥Ö¥é¥±¥Ã¥Èɽ¸½¤Ë²Ã¤¨¤é¤ì¤ë¡£ +¤¹¤Ê¤ï¤Á +"\fI[x]\fP" ¤Ï "\fI[xX]\fP" ¤Ë¡¢"\fI[^x]\fP" ¤Ï "\fI[^xX]\fP" ¤Ë¤Ê¤ë¡£ +.PP +.\"O No particular limit is imposed on the length of REs\*(dg. +.\"O Programs intended to be portable should not employ REs longer +.\"O than 256 bytes, +.\"O as an implementation can refuse to accept such REs and remain +.\"O POSIX-compliant. +Àµµ¬É½¸½¤ÎŤµ¤Ë¤ÏÆäËÀ©¸Â¤Ï¤Ê¤¤\*(dg¡£ +¤¿¤À¤·°Ü¿¢À­¤ò¹â¤¯¤·¤¿¤¤¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +256 ¥Ð¥¤¥È¤è¤êŤ¤Àµµ¬É½¸½¤Ï¼Â¹Ô¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Û¤¦¤¬Îɤ¤¡£ +¤Ê¤¼¤Ê¤é¡¢¤½¤Î¤è¤¦¤ÊÀµµ¬É½¸½¤òµñÈݤ·¡¢ +¤·¤«¤â POSIX ¸ß´¹¤òÊݤĤ褦¤Ê¼ÂÁõ¤¬²Äǽ¤À¤«¤é¤Ç¤¢¤ë¡£ +.PP +.\"O Obsolete ("basic") regular expressions differ in several respects. +.\"O \(aq|\(aq, \(aq+\(aq, and \(aq?\(aq are +.\"O ordinary characters and there is no equivalent +.\"O for their functionality. +.\"O The delimiters for bounds are "\fI\e{\fP" and "\fI\e}\fP", +.\"O with \(aq{\(aq and \(aq}\(aq by themselves ordinary characters. +.\"O The parentheses for nested subexpressions are "\fI\e(\fP" and "\fI\e)\fP", +.\"O with \(aq(\(aq and \(aq)\(aq by themselves ordinary characters. +.\"O \(aq^\(aq is an ordinary character except at the beginning of the +.\"O RE or\*(dg the beginning of a parenthesized subexpression, +.\"O \(aq$\(aq is an ordinary character except at the end of the +.\"O RE or\*(dg the end of a parenthesized subexpression, +.\"O and \(aq*\(aq is an ordinary character if it appears at the beginning of the +.\"O RE or the beginning of a parenthesized subexpression +.\"O (after a possible leading \(aq^\(aq). +¸Å¤¤ ("´ðËÜ") Àµµ¬É½¸½¤Ï¡¢¤¤¤¯¤Ä¤«¤ÎÅÀ¤Ë¤ª¤¤¤Æ°Û¤Ê¤ë¡£ +\(aq|\(aq, \(aq+\(aq, and \(aq?\(aq ¤ÏÄ̾ï¤Îʸ»ú¤È¤Ê¤ë¡£ +Âбþ¤¹¤ëµ¡Ç½¤Ï¸ºß¤·¤Ê¤¤¡£·«¤êÊÖ¤·»ØÄê¤Î¶èÀÚ¤ê¤Ï +"\fI\e{\fP" ¤ª¤è¤Ó "\fI\e}\fP" ¤È¤Ê¤ë¡£\(aq{\(aq ¤È \(aq}\(aq ¤Ï¡¢ +ñÆȤǤÏÄ̾ï¤Îʸ»ú¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +ÉôʬÀµµ¬É½¸½¤ò¥Í¥¹¥È¤¹¤ë³ç¸Ì¤Ï "\fI\e(\fP" ¤ª¤è¤Ó "\fI\e)\fP" ¤È¤Ê¤ê¡¢ +\(aq(\(aq ¤È \(aq)\(aq ¤ÏñÆȤǤÏÄ̾ï¤Îʸ»ú¤È¤Ê¤ë¡£ +\(aq^\(aq ¤ÏÀµµ¬É½¸½¤ÎÀèƬ¤«¡¢ +³ç¸Ì¤Ç¤¯¤¯¤é¤ì¤¿Éôʬɽ¸½¤ÎÀèƬ\*(dg¤ò½ü¤¤¤ÆÄ̾ï¤Îʸ»ú¤È¤Ê¤ë¡£ +\(aq$\(aq ¤ÏÀµµ¬É½¸½¤ÎËöÈø¤«¡¢ +³ç¸Ì¤Ç¤¯¤¯¤é¤ì¤¿ÉôʬÀµµ¬É½¸½¤ÎËöÈø\*(dg¤ò½ü¤¤¤ÆÄ̾ï¤Îʸ»ú¤È¤Ê¤ë¡£ +\(aq*\(aq ¤Ï¡¢Àµµ¬É½¸½¤ÎÀèƬ¤«¡¢ +³ç¸Ì¤Ç¤¯¤¯¤é¤ì¤¿Éôʬʸ»úÎó¤ÎÀèƬ¤ËÃÖ¤«¤ì¤¿¾ì¹ç¤ÏÄ̾ï¤Îʸ»ú¤È¤Ê¤ë +(\(aq^\(aq) ¤¬Á°ÃÖ¤µ¤ì¤Æ¤¤¤Æ¤â¤è¤¤)¡£ +.PP +.\"O Finally, there is one new type of atom, a \fIback reference\fR: +.\"O \(aq\e\(aq followed by a nonzero decimal digit \fId\fR +.\"O matches the same sequence of characters +.\"O matched by the \fId\fRth parenthesized subexpression +.\"O (numbering subexpressions by the positions of their opening parentheses, +.\"O left to right), +.\"O so that, for example, "\fI\e([bc]\e)\e1\fP" matches "bb" or "cc" but not "bc". +ºÇ¸å¤Ë¡¢¥¢¥È¥à¤È¤·¤ÆÊ̤Υ¿¥¤¥×¤¬Â¸ºß¤¹¤ë¡£ +\fI¸åÊý»²¾È (back reference)\fR ¤Ç¤¢¤ë¡£ +\(aq\e\(aq ¤Î¸å¤Ë 0 ¤Ç¤Ê¤¤ 10 ¿Ê¿ôÃÍʸ»ú \fId\fR ¤¬Â³¤¯¤È¡¢ +³ç¸Ì¤Ç¤¯¤¯¤é¤ì¤¿ÉôʬÀµµ¬É½¸½¤Î +\fId\fR ÈÖÌܤ˥ޥåÁ¤·¤¿Ê¸»úʤӤÈƱ¤¸¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +(ÉôʬÀµµ¬É½¸½¤ÎÈÖ¹æÉÕ¤±¤Ï¡¢ +³«¤­³ç¸Ì `(' ¤Î°ÌÃÖ¤¬º¸¤Î¤â¤Î¤«¤é±¦¤Î¤â¤Î¤Ø¸þ¤«¤Ã¤Æ¤Ê¤µ¤ì¤ë¡£) +¤·¤¿¤¬¤Ã¤Æ "\fI\e([bc]\e)\e1\fP" ¤Ï +"bb" ¤Þ¤¿¤Ï "cc" ¤Ë¤Ï¥Þ¥Ã¥Á¤¹¤ë¤¬¡¢"bc" ¤Ë¤Ï¥Þ¥Ã¥Á¤·¤Ê¤¤¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Having two kinds of REs is a botch. +Àµµ¬É½¸½¤¬ 2 ¼ïÎढ¤ë¤Î¤Ï³Ê¹¥°­¤¤¡£ +.PP +.\"O The current POSIX.2 spec says that \(aq)\(aq is an ordinary character in +.\"O the absence of an unmatched \(aq(\(aq; +.\"O this was an unintentional result of a wording error, +.\"O and change is likely. +.\"O Avoid relying on it. +¸½ºß¤Î POSIX.2 µ¬³Ê¤Ë¤ª¤¤¤Æ¤Ï¡¢\(aq)\(aq ¤Ï¡¢ +Âбþ¤¹¤ë \(aq(\(aq ¤¬¤Ê¤¤¾ì¹ç¤Ë¤ÏÄ̾ï¤Îʸ»ú¤È¤·¤Æ°·¤ï¤ì¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤·¤«¤·¤³¤ì¤Ï¡¢ËÜÍè¤Î°Õ¿Þ¤È¤Ï°Û¤Ê¤ëµ­½Ò¾å¤Î¥¨¥é¡¼¤Ç¤¢¤ê¡¢ +½¤Àµ¤µ¤ì¤ë²ÄǽÀ­¤¬¹â¤¤¡£¤³¤ì¤Ë°Í¸¤·¤¿¥³¡¼¥É¤Ï»È¤ï¤Ê¤¤¤³¤È¡£ +.PP +.\"O Back references are a dreadful botch, +.\"O posing major problems for efficient implementations. +.\"O They are also somewhat vaguely defined +.\"O (does +.\"O "\fIa\e(\e(b\e)*\e2\e)*d\fP" match "abbbd"?). +.\"O Avoid using them. +¸åÊý»²¾È¤Ï¤Ò¤É¤¯½ÐÍè¤Î°­¤¤Âåʪ¤Ç¤¢¤ë¡£ +¸úΨ¤ÎÎɤ¤¼ÂÁõ¤ò¤¹¤ë¤Î¤Ï¤È¤Æ¤âÆñ¤·¤¤¡£ +¤Þ¤¿ÄêµÁ¤¬¤¢¤¤¤Þ¤¤¤Ç¤¢¤ë¡£ +("\fIa\e(\e(b\e)*\e2\e)*d\fP" ¤Ï "abbbd" ¤Ë¥Þ¥Ã¥Á¤¹¤ë¤È»×¤¦¤«¡©) +»È¤ï¤Ê¤¤¤Û¤¦¤¬Îɤ¤¡£ +.PP +.\"O POSIX.2's specification of case-independent matching is vague. +.\"O The "one case implies all cases" definition given above +.\"O is current consensus among implementors as to the right interpretation. +POSIX.2 ¤Îµ¬³Ê¤Ç¤Ï¡¢case (Âçʸ»ú¤«¾®Ê¸»ú¤«) +¤Ë°Í¸¤·¤Ê¤¤¥Þ¥Ã¥Á¤Îµ­½Ò¤¬¤¢¤¤¤Þ¤¤¤Ç¤¢¤ë¡£ +¸½ºß¤Î¤È¤³¤í¤Ç¤Ï¡Ö°ì¤Ä¤Î case ¤¬¤¹¤Ù¤Æ¤Î case ¤ò°ÕÌ£¤¹¤ë¡× +¤È¤¤¤¦¾åµ­¤ÎÄêµÁ¤¬Àµ¤·¤¤²ò¼á¤Ç¤¢¤ë¤È¤¤¤¦¤Î¤¬¡¢ +¼ÂÁõ¼Ô¤Î´Ö¤Ç¤Î¶¦ÄÌǧ¼±¤Î¤è¤¦¤Ç¤¢¤ë¡£ +.\" As per http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295666 +.\" The following does not seem to apply in the glibc implementation +.\" .PP +.\"O .\" The syntax for word boundaries is incredibly ugly. +.\" ¥ï¡¼¥É¶­³¦¤Ë´Ø¤¹¤ëʸˡÄêµÁ¤¬Èó¾ï¤Ë½¹¤¤¡£ +.\"O .SH AUTHOR +.SH Ãø¼Ô +.\" Sigh... The page license means we must have the author's name +.\" in the formatted output. +.\"O This page was taken from Henry Spencer's regex package. +¤³¤Î¥Ú¡¼¥¸¤Ï Henry Spencer ¤Î regex ¥Ñ¥Ã¥±¡¼¥¸¤«¤éºÎÏ¿¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR grep (1), +.BR regex (3) +.PP +POSIX.2, section 2.8 (Regular Expression Notation). diff --git a/draft/man7/rtnetlink.7 b/draft/man7/rtnetlink.7 new file mode 100644 index 00000000..1ac6a028 --- /dev/null +++ b/draft/man7/rtnetlink.7 @@ -0,0 +1,731 @@ +'\" t +.\" Don't remove the line above, it tells man that tbl is needed. +.\" This man page is Copyright (C) 1999 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. +.\" Based on the original comments from Alexey Kuznetsov, written with +.\" help from Matthew Wilcox. +.\" $Id: rtnetlink.7,v 1.10 2001/04/04 08:02:19 ysato Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated Mon 6 Dec 1999 by NAKANO Takeo +.\" +.\"WORD queueing dicipline ¥­¥å¡¼¥¤¥ó¥°(¤Î)¥ë¡¼¥ë +.\"WORD permanent ±Ê³Ū¤Ê +.\"WORD neighbor ¶á˵ +.\" +.TH RTNETLINK 7 2008-08-08 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O rtnetlink, NETLINK_ROUTE \- Linux IPv4 routing socket +.SH ̾Á° +rtnetlink, NETLINK_ROUTE \- Linux IPv4 ¥ë¡¼¥Æ¥£¥ó¥°¥½¥±¥Ã¥È +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.br +.B #include +.br +.B #include +.sp +.BI "rtnetlink_socket = socket(AF_NETLINK, int " socket_type ", NETLINK_ROUTE);" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Rtnetlink allows the kernel's routing tables to be read and altered. +.\"O It is used within the kernel to communicate between +.\"O various subsystems, though this usage is not documented here, and for +.\"O communication with user-space programs. +.\"O Network routes, ip addresses, link parameters, neighbor setups, queueing +.\"O disciplines, traffic classes and packet classifiers may all be controlled +.\"O through +.\"O .B NETLINK_ROUTE +.\"O sockets. +.\"O It is based on netlink messages, see +.\"O .BR netlink (7) +.\"O for more information. +.B rtnetlink +¤Ï¥«¡¼¥Í¥ë¤Î¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤òÆɤó¤À¤êÊѹ¹¤·¤¿¤ê +¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£¤³¤ì¤Ï¥«¡¼¥Í¥ë¤¬ÆâÉô¤Î¥µ¥Ö¥·¥¹¥Æ¥à¤È +ÄÌ¿®¤¹¤ë¤¿¤á¤Ë¤âÍѤ¤¤é¤ì¤Æ¤¤¤ë¤¬¡¢¤½¤ì¤Ï¤³¤³¤Ç¤Ïµ­½Ò¤·¤Ê¤¤¡£ +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ï¥æ¡¼¥¶¡¼¶õ´Ö¤Î¥×¥í¥°¥é¥à¤È¤ÎÄÌ¿®¤Ë´Ø¤·¤Æ¤Î¤ß½Ò¤Ù¤ë¡£ +¥Í¥Ã¥È¥ï¡¼¥¯·ÐÏ©¡¦IP ¥¢¥É¥ì¥¹¡¦¥ê¥ó¥¯¥Ñ¥é¥á¡¼¥¿¡¦ +¶á˵ÀßÄê (neighbor setup)¡¦¥­¥å¡¼¥¤¥ó¥°¥ë¡¼¥ë (queueing dicipline)¡¦ +¥È¥é¥Õ¥£¥Ã¥¯¥¯¥é¥¹¡¦¥Ñ¥±¥Ã¥È¤Î¥¯¥é¥¹Ê¬Îà¤Ê¤É¤¬¡¢¤¹¤Ù¤Æ +.B NETLINK_ROUTE +¥½¥±¥Ã¥È¤òÄ̤·¤ÆÀ©¸æ¤Ç¤­¤ë¡£ +.B rtnetlink +¤Ï netlink ¥á¥Ã¥»¡¼¥¸¤ò¥Ù¡¼¥¹¤Ë¤·¤Æ¤¤¤ë¡£¾ÜºÙ¤Ï +.BR netlink (7) +¤ò¸«¤ë¤³¤È¡£ +.\" FIXME ? all these macros could be moved to rtnetlink(3) +.\"O .SS "Routing Attributes" +.SS ¥ë¡¼¥Æ¥£¥ó¥°Â°À­ +.\"O Some rtnetlink messages have optional attributes after the initial header: +rtnetlink ¥á¥Ã¥»¡¼¥¸¤Ë¤Ï¡¢½é´ü¥Ø¥Ã¥À¤Î¸å¤ËÉÕ²ÃŪ¤Ê°À­¤ò +»ý¤Ä¤â¤Î¤¬¤¢¤ë¡£ + +.in +4n +.nf +struct rtattr { + unsigned short rta_len; /* Length of option */ + unsigned short rta_type; /* Type of option */ + /* Data follows */ +}; +.fi +.in + +.\"O These attributes should be only manipulated using the RTA_* macros +.\"O or libnetlink, see +.\"O .BR rtnetlink (3). +¤³¤ì¤é¤Î°À­¤ÎÁàºî¤Ï¡¢ RTA_* ¥Þ¥¯¥í¤« libnetlink ¤òÄ̤·¤Æ¤Î¤ß +¹Ô¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.BR rtnetlink (3) +¤ò¸«¤è¡£ +.\"O .SS Messages +.SS ¥á¥Ã¥»¡¼¥¸ +.\"O Rtnetlink consists of these message types +.\"O (in addition to standard netlink messages): +rtnetlink ¤Ï (ɸ½àŪ¤Ê netlink ¥á¥Ã¥»¡¼¥¸¤Ë²Ã¤¨¤Æ) +°Ê²¼¤Î¥á¥Ã¥»¡¼¥¸¥¿¥¤¥×¤«¤é¹½À®¤µ¤ì¤ë¡£ +.TP +.BR RTM_NEWLINK ", " RTM_DELLINK ", " RTM_GETLINK +.\"O Create, remove or get information about a specific network interface. +.\"O These messages contain an +.\"O .I ifinfomsg +.\"O structure followed by a series of +.\"O .I rtattr +.\"O structures. +»ØÄꤷ¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¾ðÊó¤ò¡¢À¸À®¡¦ºï½ü¡¦¼èÆÀ¤¹¤ë¡£ +¤³¤ì¤é¤Î¥á¥Ã¥»¡¼¥¸¤Ï +.I ifinfomsg +¹½Â¤ÂΤȡ¢¤½¤ì¤Ë³¤¤¤Æ¤¤¤¯¤Ä¤«¤Î +.I rtattr +¹½Â¤ÂΤòȼ¤¦¡£ + +.nf +struct ifinfomsg { + unsigned char ifi_family; /* AF_UNSPEC */ + unsigned short ifi_type; /* Device type */ + int ifi_index; /* Interface index */ + unsigned int ifi_flags; /* Device flags */ + unsigned int ifi_change; /* change mask */ +}; +.fi + +.\" FIXME ifi_type +.\"O .I ifi_flags +.\"O contains the device flags, see +.\"O .BR netdevice (7); +.\"O .I ifi_index +.\"O is the unique interface index, +.\"O .I ifi_change +.\"O is reserved for future use and should be always set to 0xFFFFFFFF. +.I ifi_flags +¤Ï¥Ç¥Ð¥¤¥¹¤Î¥Õ¥é¥°¤Ç¤¢¤ë¡£ +.BR netdevice (7) +¤ò¸«¤è¡£ +.I ifi_index +¤Ï¾¤È½Å¤Ê¤é¤Ê¤¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î index ¤Ç¤¢¤ë¡£ +.I ifi_change +¤Ï¾­Íè¤ÎÍøÍѤΤ¿¤á¤ËͽÌ󤵤ì¤Æ¤ª¤ê¡¢¾ï¤Ë +0xFFFFFFFF ¤Ë¥»¥Ã¥È¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TS +tab(:); +c +l l l. +.\"O Routing attributes +.\"O rta_type:value type:description +.\"O _ +.\"O IFLA_UNSPEC:-:unspecified. +.\"O IFLA_ADDRESS:hardware address:interface L2 address +.\"O IFLA_BROADCAST:hardware address:L2 broadcast address. +.\"O IFLA_IFNAME:asciiz string:Device name. +.\"O IFLA_MTU:unsigned int:MTU of the device. +.\"O IFLA_LINK:int:Link type. +.\"O IFLA_QDISC:asciiz string:Queueing discipline. +.\"O IFLA_STATS:T{ +.\"O see below +.\"O T}:Interface Statistics. +¥ë¡¼¥Æ¥£¥ó¥°Â°À­ +rta_type:Ãͤη¿:ÀâÌÀ +_ +IFLA_UNSPEC:-:»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +IFLA_ADDRESS:hardware address:T{ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ L2 ¥¢¥É¥ì¥¹ +T} +IFLA_BROADCAST:hardware address:T{ +L2 ¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹ +T} +IFLA_IFNAME:asciiz string:¥Ç¥Ð¥¤¥¹Ì¾ +IFLA_MTU:unsigned int:¥Ç¥Ð¥¤¥¹¤Î MTU +IFLA_LINK:int:¥ê¥ó¥¯¥¿¥¤¥× +IFLA_QDISC:asciiz string:¥­¥å¡¼¥¤¥ó¥°¤Î¥ë¡¼¥ë +IFLA_STATS:T{ +²¼µ­»²¾È +T}:¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÎÅý·× +.TE +.sp +.\"O The value type for IFLA_STATS is \fIstruct net_device_stats\fP. +IFLA_STATS ¤ÎÃͤη¿¤Ï \fIstruct net_device_stats\fP ¤Ç¤¢¤ë¡£ +.TP +.BR RTM_NEWADDR ", " RTM_DELADDR ", " RTM_GETADDR +.\"O Add, remove or receive information about an IP address associated with +.\"O an interface. +.\"O In Linux 2.2 an interface can carry multiple IP addresses, +.\"O this replaces the alias device concept in 2.0. +.\"O In Linux 2.2 these messages +.\"O support IPv4 and IPv6 addresses. +.\"O They contain an +.\"O .I ifaddrmsg +.\"O structure, optionally followed by +.\"O .I rtaddr +.\"O routing attributes. +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î IP ¥¢¥É¥ì¥¹¤Î¾ðÊó¤òÄɲᦺï½ü¡¦¼èÆÀ¤¹¤ë¡£ +Linux 2.2 ¤Ç¤Ï¡¢°ì¤Ä¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ËÊ£¿ô¤Î IP ¥¢¥É¥ì¥¹¤ò +ÊÝ»ý¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¡¢¤³¤ì¤Ï 2.0 ¤ÎÊÌ̾¥Ç¥Ð¥¤¥¹¤Î³µÇ°¤òÃÖ¤­´¹¤¨¤ë¡£ +Linux 2.2 ¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥á¥Ã¥»¡¼¥¸¤Ï +IPv4 ¤È IPv6 ¤ÎξÊý¤Î¥¢¥É¥ì¥¹¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Ï +.I ifaddrmsg +¹½Â¤ÂΤòȼ¤¦¡£¤½¤Î¤¢¤È¤Ë +.I rtaddr +¥ë¡¼¥Æ¥£¥ó¥°Â°À­¤¬Â³¤¯¤³¤È¤â¤¢¤ë¡£ + +.nf +struct ifaddrmsg { + unsigned char ifa_family; /* Address type */ + unsigned char ifa_prefixlen; /* Prefixlength of address */ + unsigned char ifa_flags; /* Address flags */ + unsigned char ifa_scope; /* Address scope */ + int ifa_index; /* Interface index */ +}; +.fi + +.\"O .I ifa_family +.\"O is the address family type (currently +.\"O .B AF_INET +.\"O or +.\"O .BR AF_INET6 ), +.\"O .I ifa_prefixlen +.\"O is the length of the address mask of the address if defined for the +.\"O family (like for IPv4), +.\"O .I ifa_scope +.\"O is the address scope, +.\"O .I ifa_index +.\"O is the interface index of the interface the address is associated with. +.\"O .I ifa_flags +.\"O is a flag word of +.\"O .B IFA_F_SECONDARY +.\"O for secondary address (old alias interface), +.\"O .B IFA_F_PERMANENT +.\"O for a permanent address set by the user and other undocumented flags. +.I ifa_family +¤Ï¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Î¥¿¥¤¥×¤Ç¤¢¤ë (¸½ºß¤Ï +.B AF_INET +¤Þ¤¿¤Ï +.BR AF_INET6 )¡£ +.I ifa_prefixlen +¤Ï¥¢¥É¥ì¥¹¤Î¥¢¥É¥ì¥¹¥Þ¥¹¥¯¤ÎŤµ¤Ç¤¢¤ë (IPv4 ¤Î¤è¤¦¤Ë¡¢ +¤½¤Î¥Õ¥¡¥ß¥ê¡¼¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç)¡£ +.I ifa_scope +¤Ï¥¢¥É¥ì¥¹¤Î¥¹¥³¡¼¥×¤Ç¤¢¤ë¡£ +.I ifa_index +¤Ï¥¢¥É¥ì¥¹¤¬´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î index ¤Ç¤¢¤ë¡£ +.I ifa_flags +¤Ï¥Õ¥é¥°¥ï¡¼¥É¤Ç¡¢ +Æó¤Ä¤á¤Î¥¢¥É¥ì¥¹ (¸Å¤¤ÊÌ̾¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹) ¤Î¾ì¹ç¤Ï +.B IFA_F_SECONDARY +¤Ë¡¢±Ê³Ū¤Ê¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï +.B IFA_F_PERMANENT +¤ËŬÍѤµ¤ì¤ë¡£¥æ¡¼¥¶¡¼¤Ë¤è¤Ã¤Æ¥»¥Ã¥È¤µ¤ì¤ë¥Õ¥é¥°¤È¡¢ +undocumented ¤Ê¥Õ¥é¥°¤¬¤¢¤ë¡£ +.TS +tab(:); +c +l l l. +.\"O Attributes +.\"O rta_type:value type:description +.\"O _ +.\"O IFA_UNSPEC:-:unspecified. +.\"O IFA_ADDRESS:raw protocol address:interface address +.\"O IFA_LOCAL:raw protocol address:local address +.\"O IFA_LABEL:asciiz string:name of the interface +.\"O IFA_BROADCAST:raw protocol address:broadcast address. +.\"O IFA_ANYCAST:raw protocol address:anycast address +.\"O IFA_CACHEINFO:struct ifa_cacheinfo:Address information. +°À­ +rta_type:Ãͤη¿:ÀâÌÀ +_ +IFA_UNSPEC:-:»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤ +IFA_ADDRESS:raw protocol address:¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹ +IFA_LOCAL:raw protocol address:¥í¡¼¥«¥ë¥¢¥É¥ì¥¹ +IFA_LABEL:asciiz string:¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î̾Á° +IFA_BROADCAST:raw protocol address:¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹ +IFA_ANYCAST:raw protocol address:anycast ¥¢¥É¥ì¥¹ +IFA_CACHEINFO:struct ifa_cacheinfo:¥¢¥É¥ì¥¹¾ðÊó +.TE +.\" FIXME struct ifa_cacheinfo +.TP +.BR RTM_NEWROUTE ", " RTM_DELROUTE ", " RTM_GETROUTE +.\"O Create, remove or receive information about a network route. +.\"O These messages contain an +.\"O .I rtmsg +.\"O structure with an optional sequence of +.\"O .I rtattr +.\"O structures following. +.\"O For +.\"O .B RTM_GETROUTE +.\"O setting +.\"O .I rtm_dst_len +.\"O and +.\"O .I rtm_src_len +.\"O to 0 means you get all entries for the specified routing table. +¥Í¥Ã¥È¥ï¡¼¥¯·ÐÏ©¤Î¾ðÊó¤òÀ¸À®¡¦ºï½ü¡¦¼èÆÀ¤¹¤ë¡£ +¤³¤ì¤é¤Î¥á¥Ã¥»¡¼¥¸¤Ï +.I rtmsg +¹½Â¤ÂΤòȼ¤¦¡£¤½¤Î¤¢¤È¤Ë¤¤¤¯¤Ä¤«¤Î +.I rtattr +¹½Â¤ÂΤò³¤±¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.B RTM_GETROUTE +¤Ç +.I rtm_dst_len +¤È +.I rtm_src_len +¤Ë 0 ¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢ +»ØÄꤵ¤ì¤¿¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤ÎÁ´¤Æ¤Î¥¨¥ó¥È¥ê¤ò½êÆÀ¤¹¤ë¡£ +.\"O For the other fields except +.\"O .I rtm_table +.\"O and +.\"O .I rtm_protocol +.\"O 0 is the wildcard. +.I rtm_table +¤È +.I rtm_protocol +°Ê³°¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤òÆþ¤ì¤ë¤È¡¢¥ï¥¤¥ë¥É¥«¡¼¥É¤ò°ÕÌ£¤¹¤ë¡£ + +.nf +struct rtmsg { + unsigned char rtm_family; /* Address family of route */ + unsigned char rtm_dst_len; /* Length of destination */ + unsigned char rtm_src_len; /* Length of source */ + unsigned char rtm_tos; /* TOS filter */ + + unsigned char rtm_table; /* Routing table ID */ + unsigned char rtm_protocol; /* Routing protocol; see below */ + unsigned char rtm_scope; /* See below */ + unsigned char rtm_type; /* See below */ + + unsigned int rtm_flags; +}; +.fi +.TS +tab(:); +l l. +.\"O rtm_type:Route type +.\"O _ +.\"O RTN_UNSPEC:unknown route +.\"O RTN_UNICAST:a gateway or direct route +.\"O RTN_LOCAL:a local interface route +.\"O RTN_BROADCAST:T{ +.\"O a local broadcast route (sent as a broadcast) +.\"O T} +.\"O RTN_ANYCAST:T{ +.\"O a local broadcast route (sent as a unicast) +.\"O T} +.\"O RTN_MULTICAST:a multicast route +.\"O RTN_BLACKHOLE:a packet dropping route +.\"O RTN_UNREACHABLE:an unreachable destination +.\"O RTN_PROHIBIT:a packet rejection route +.\"O RTN_THROW:continue routing lookup in another table +.\"O RTN_NAT:a network address translation rule +.\"O RTN_XRESOLVE:T{ +.\"O refer to an external resolver (not implemented) +.\"O T} +rtm_type:·ÐÏ©¤Î¥¿¥¤¥× +_ +RTN_UNSPEC:̤ÃΤηÐÏ© +RTN_UNICAST:¥²¡¼¥È¥¦¥§¥¤¤Þ¤¿¤Ï¥À¥¤¥ì¥¯¥È¤Ê·ÐÏ© +RTN_LOCAL:¥í¡¼¥«¥ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î·ÐÏ© +RTN_BROADCAST:T{ +¥í¡¼¥«¥ë¤Ê¥Ö¥í¡¼¥É¥­¥ã¥¹¥È·ÐÏ© +(¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤È¤·¤ÆÁ÷¿®¤µ¤ì¤ë) +T} +RTN_ANYCAST:T{ +¥í¡¼¥«¥ë¤Ê¥Ö¥í¡¼¥É¥­¥ã¥¹¥È·ÐÏ© +(¥æ¥Ë¥­¥ã¥¹¥È¤È¤·¤ÆÁ÷¿®¤µ¤ì¤ë) +T} +RTN_MULTICAST:¥Þ¥ë¥Á¥­¥ã¥¹¥È·ÐÏ© +RTN_BLACKHOLE:¥Ñ¥±¥Ã¥È¤ò¼Î¤Æ¤ë·ÐÏ© +RTN_UNREACHABLE:Åþã¤Ç¤­¤Ê¤¤¹Ô¤­Àè +RTN_PROHIBIT:¥Ñ¥±¥Ã¥È¤òµñÈݤ¹¤ë·ÐÏ© +RTN_THROW:·Ðϩõº÷¤òÊ̤Υơ¼¥Ö¥ë¤Ç·Ñ³ +RTN_NAT:¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ÎÊÑ´¹¥ë¡¼¥ë +RTN_XRESOLVE:T{ +³°Éô¥ì¥¾¥ë¥Ð¤ò»²¾È (¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +T} +.TE +.TS +tab(:); +l l. +.\"O rtm_protocol:Route origin. +.\"O _ +.\"O RTPROT_UNSPEC:unknown +.\"O RTPROT_REDIRECT:T{ +.\"O by an ICMP redirect (currently unused) +.\"O T} +.\"O RTPROT_KERNEL:by the kernel +.\"O RTPROT_BOOT:during boot +.\"O RTPROT_STATIC:by the administrator +rtm_protocol:·ÐÏ©¤Î¾ðÊó¸» +_ +RTPROT_UNSPEC:ÉÔÌÀ +RTPROT_REDIRECT:T{ +ICMP ¥ê¥À¥¤¥ì¥¯¥È¤Ë¤è¤ë (¸½ºß¤ÏÍѤ¤¤é¤ì¤Ê¤¤) +T} +RTPROT_KERNEL:¥«¡¼¥Í¥ë¤Ë¤è¤ë +RTPROT_BOOT:¥Ö¡¼¥È»þ +RTPROT_STATIC:´ÉÍý¼Ô¤Ë¤è¤ë +.TE + +.\"O Values larger than +.\"O .B RTPROT_STATIC +.\"O are not interpreted by the kernel, they are just for user information. +.\"O They may be used to tag the source of a routing information or to +.\"O distingush between multiple routing daemons. +.\"O See +.\"O .I +.\"O for the routing daemon identifiers which are already assigned. +.B RTPROT_STATIC +¤è¤ê¤âÂ礭¤ÊÃͤϥ«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤Ê¤¤¡£¤³¤ì¤Ï +ñ¤Ê¤ë¥æ¡¼¥¶¡¼¤Ø¤Î¾ðÊó¤Ç¤¢¤ë¡£¤³¤ì¤é¤Ï·ÐÏ©¾ðÊó¤Î¾ðÊ󸻤ò +¥¿¥°ÉÕ¤±¤·¤¿¤ê¡¢Ê£¿ô¤Î¥ë¡¼¥Æ¥£¥ó¥°¥Ç¡¼¥â¥ó¤«¤é¤Î¾ðÊó¤ò +¶èÊ̤¹¤ë¤¿¤á¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +´û¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥ë¡¼¥Æ¥£¥ó¥°¥Ç¡¼¥â¥ó¤Î¼±Ê̻ҤˤĤ¤¤Æ¤Ï +.I +¤ò¸«¤è¡£ + +.\"O .I rtm_scope +.\"O is the distance to the destination: +.I rtm_scope +¤Ï¹Ô¤­Àè¤Ø¤Îµ÷Î¥¤Ç¤¢¤ë¡£ + +.TS +tab(:); +l l. +.\"O RT_SCOPE_UNIVERSE:global route +.\"O RT_SCOPE_SITE:T{ +.\"O interior route in the local autonomous system +.\"O T} +.\"O RT_SCOPE_LINK:route on this link +.\"O RT_SCOPE_HOST:route on the local host +.\"O RT_SCOPE_NOWHERE:destination doesn't exist +RT_SCOPE_UNIVERSE:¥°¥í¡¼¥Ð¥ë¤Ê·ÐÏ© +RT_SCOPE_SITE:T{ +¥í¡¼¥«¥ë¤Ê¼«Î§¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ëÆâÉô·ÐÏ© +T} +RT_SCOPE_LINK:¤³¤Î¥ê¥ó¥¯¾å¤Î·ÐÏ© +RT_SCOPE_HOST:¥í¡¼¥«¥ë¥Û¥¹¥È¾å¤Î·ÐÏ© +RT_SCOPE_NOWHERE:¹Ô¤­À褬¸ºß¤·¤Ê¤¤ +.TE + +.\"O The values between +.\"O .B RT_SCOPE_UNIVERSE +.\"O and +.\"O .B RT_SCOPE_SITE +.\"O are available to the user. +¥æ¡¼¥¶¡¼¤Ï +.B RT_SCOPE_UNIVERSE +¤È +.B RT_SCOPE_SITE +¤Î´Ö¤ÎÃͤòÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O The +.\"O .I rtm_flags +.\"O have the following meanings: +.I rtm_flags +¤Ï°Ê²¼¤Î°ÕÌ£¤ò»ý¤Ä: +.TS +tab(:); +l l. +.\"O RTM_F_NOTIFY:T{ +.\"O if the route changes, notify the user via rtnetlink +.\"O T} +.\"O RTM_F_CLONED:route is cloned from another route +.\"O RTM_F_EQUALIZE:a multipath equalizer (not yet implemented) +RTM_F_NOTIFY:T{ +·ÐÏ©¤¬Êѹ¹¤µ¤ì¤ë¤È¡¢ rtnetlink ¤òÄ̤·¤Æ¥æ¡¼¥¶¡¼¤ËÄÌÃΤ¬¹Ô¤¯¡£ +T} +RTM_F_CLONED:·ÐÏ©¤Ï¾¤Î·ÐÏ©¤Ë¤è¤Ã¤ÆÊ£À½¤µ¤ì¤¿¡£ +RTM_F_EQUALIZE:¥Þ¥ë¥Á¥Ñ¥¹¥¤¥³¥é¥¤¥¶ (¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +.TE + +.\"O .I rtm_table +.\"O specifies the routing table +.I rtm_table +¤Ç¤Ï¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤ò»ØÄꤹ¤ë¡£ +.TS +tab(:); +l l. +.\"O RT_TABLE_UNSPEC:an unspecified routing table +.\"O RT_TABLE_DEFAULT:the default table +.\"O RT_TABLE_MAIN:the main table +.\"O RT_TABLE_LOCAL:the local table +RT_TABLE_UNSPEC:»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë +RT_TABLE_DEFAULT:¥Ç¥Õ¥©¥ë¥È¤Î¥Æ¡¼¥Ö¥ë +RT_TABLE_MAIN:¥á¥¤¥ó¤Î¥Æ¡¼¥Ö¥ë +RT_TABLE_LOCAL:¥í¡¼¥«¥ë¥Æ¡¼¥Ö¥ë +.TE + +.\"O The user may assign arbitrary values between +.\"O .B RT_TABLE_UNSPEC +.\"O and +.\"O .BR RT_TABLE_DEFAULT . +¥æ¡¼¥¶¡¼¤Ï +.B RT_TABLE_UNSPEC +¤È +.BR RT_TABLE_DEFAULT . +¤Î´Ö¤ÎǤ°Õ¤ÎÃͤòÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TS +tab(:); +c +l l l. +.\"O Attributes +.\"O rta_type:value type:description +.\"O _ +.\"O RTA_UNSPEC:-:ignored. +.\"O RTA_DST:protocol address:Route destination address. +.\"O RTA_SRC:protocol address:Route source address. +.\"O RTA_IIF:int:Input interface index. +.\"O RTA_OIF:int:Output interface index. +.\"O RTA_GATEWAY:protocol address:The gateway of the route +.\"O RTA_PRIORITY:int:Priority of route. +.\"O RTA_PREFSRC:: +.\"O RTA_METRICS:int:Route metric +.\"O RTA_MULTIPATH:: +.\"O RTA_PROTOINFO:: +.\"O RTA_FLOW:: +.\"O RTA_CACHEINFO:: +°À­ +rta_type:Ãͤη¿:ÀâÌÀ +_ +RTA_UNSPEC:-:̵»ë¤µ¤ì¤ë +RTA_DST:protocol address:·ÐÏ©¤Î¹Ô¤­À襢¥É¥ì¥¹ +RTA_SRC:protocol address:·ÐÏ©¤Îȯ¿®¸µ¥¢¥É¥ì¥¹ +RTA_IIF:int:ÆþÎÏ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î index +RTA_OIF:int:½ÐÎÏ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î index +RTA_GATEWAY:protocol address:·ÐÏ©¤Î¥²¡¼¥È¥¦¥§¥¤ +RTA_PRIORITY:int:·ÐÏ©¤ÎÍ¥ÀèÅÙ +RTA_PREFSRC:: +RTA_METRICS:int:·ÐÏ©¤Î¥á¥È¥ê¥Ã¥¯ +RTA_MULTIPATH:: +RTA_PROTOINFO:: +RTA_FLOW:: +RTA_CACHEINFO:: +.TE + +.\"O .B Fill these values in! +.B (¤³¤ì¤é¤ÎÃͤòËä¤á¤ë¤³¤È!) +.TP +.BR RTM_NEWNEIGH ", " RTM_DELNEIGH ", " RTM_GETNEIGH +.\"O Add, remove or receive information about a neighbor table +.\"O entry (e.g., an ARP entry). +.\"O The message contains an +.\"O .I ndmsg +.\"O structure. +¶á˵¥Æ¡¼¥Ö¥ë (neighbor table) ¤Î¥¨¥ó¥È¥ê +(Î㤨¤Ð ARP ¥¨¥ó¥È¥ê) ¤Î¾ðÊó¤òÄɲᦺï½ü¡¦¼èÆÀ¤¹¤ë¡£ +¤³¤Î¥á¥Ã¥»¡¼¥¸¤Ï +.I ndmsg +¹½Â¤ÂΤòȼ¤¦¡£ + +.nf +struct ndmsg { + unsigned char ndm_family; + int ndm_ifindex; /* Interface index */ + __u16 ndm_state; /* State */ + __u8 ndm_flags; /* Flags */ + __u8 ndm_type; +}; + +struct nda_cacheinfo { + __u32 ndm_confirmed; + __u32 ndm_used; + __u32 ndm_updated; + __u32 ndm_refcnt; +}; +.fi + +.\"O .I ndm_state +.\"O is a bit mask of the following states: +.I ndm_state +¤Ï°Ê²¼¤Î¾õÂ֤Υӥåȥޥ¹¥¯¤Ç¤¢¤ë: +.TS +tab(:); +l l. +.\"O NUD_INCOMPLETE:a currently resolving cache entry +.\"O NUD_REACHABLE:a confirmed working cache entry +.\"O NUD_STALE:an expired cache entry +.\"O NUD_DELAY:an entry waiting for a timer +.\"O NUD_PROBE:a cache entry that is currently reprobed +.\"O NUD_FAILED:an invalid cache entry +.\"O NUD_NOARP:a device with no destination cache +.\"O NUD_PERMANENT:a static entry +NUD_INCOMPLETE:¸½ºß¥ì¥¾¥ë¥ÖÃæ¤Î¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +NUD_REACHABLE:Æ°ºî³ÎǧºÑ¤ß¤Î¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +NUD_STALE:´ü¸ÂÀÚ¤ì¤Î¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +NUD_DELAY:¥¿¥¤¥ÞÂÔ¤Á¤Î¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +NUD_PROBE:ºÆ³ÎǧÃæ¤Î¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +NUD_FAILED:ÉÔÀµ¤Ê¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +NUD_NOARP:¹Ô¤­À襭¥ã¥Ã¥·¥å¤Î¤Ê¤¤¥Ç¥Ð¥¤¥¹ +NUD_PERMANENT:ÀÅŪ¤Ê¥¨¥ó¥È¥ê +.TE + +.\"O Valid +.\"O .I ndm_flags +.\"O are: +Í­¸ú¤Ê +.I ndm_flags +¤Ï°Ê²¼¤ÎÄ̤ê: +.TS +tab(:); +l l. +.\"O NTF_PROXY:a proxy arp entry +.\"O NTF_ROUTER:an IPv6 router +NTF_PROXY:¥×¥í¥¯¥· arp ¥¨¥ó¥È¥ê +NTF_ROUTER:IPv6 ¥ë¡¼¥¿ +.TE + +.\" FIXME +.\" document the members of the struct better +.\"O The +.\"O .I rtaddr +.\"O struct has the following meanings for the +.\"O .I rta_type +.\"O field: +.I rtaddr +¹½Â¤ÂΤϡ¢ +.I rta_type +¥Õ¥£¡¼¥ë¥É¤Ë±þ¤¸¤Æ¤½¤ì¤¾¤ì°Ê²¼¤Î°ÕÌ£¤ò»ý¤Ä: +.TS +tab(:); +l l. +.\"O NDA_UNSPEC:unknown type +.\"O NDA_DST:a neighbor cache n/w layer destination address +.\"O NDA_LLADDR:a neighbor cache link layer address +.\"O NDA_CACHEINFO:cache statistics. +NDA_UNSPEC:̤ÃΤΥ¿¥¤¥× +NDA_DST:¶á˵¥­¥ã¥Ã¥·¥å¥Í¥Ã¥È¥ï¡¼¥¯ÁؤιԤ­À襢¥É¥ì¥¹ +NDA_LLADDR:¶á˵¥­¥ã¥Ã¥·¥å¥ê¥ó¥¯ÁؤΥ¢¥É¥ì¥¹ +NDA_CACHEINFO:¥­¥ã¥Ã¥·¥å¤ÎÅý·× +.TE + +.\"O If the +.\"O .I rta_type +.\"O field is +.\"O .B NDA_CACHEINFO +.\"O then a +.\"O .I struct nda_cacheinfo +.\"O header follows +.I rta_type +¥Õ¥£¡¼¥ë¥É¤¬ +.B NDA_CACHEINFO +¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I struct nda_cacheinfo +¥Ø¥Ã¥À¤¬Â³¤¯¡£ +.TP +.BR RTM_NEWRULE ", " RTM_DELRULE ", " RTM_GETRULE +.\"O Add, delete or retrieve a routing rule. +.\"O Carries a +.\"O .I struct rtmsg +¥ë¡¼¥Æ¥£¥ó¥°¥ë¡¼¥ë¤òÄɲᦺï½ü¡¦¼èÆÀ¤¹¤ë¡£ +.I struct rtmsg +¤òȼ¤¦¡£ +.\"O +.TP +.BR RTM_NEWQDISC ", " RTM_DELQDISC ", " RTM_GETQDISC +.\"O Add, remove or get a queueing discipline. +.\"O The message contains a +.\"O .I struct tcmsg +.\"O and may be followed by a series of +.\"O attributes. +¥­¥å¡¼¥¤¥ó¥°¥ë¡¼¥ë¤òÄɲᦺï½ü¡¦¼èÆÀ¤¹¤ë¡£ +¤³¤Î¥á¥Ã¥»¡¼¥¸¤Ï +.I struct tcmsg +¤òȼ¤¤¡¢¤Þ¤¿¤½¤Î¤¢¤È¤Ë°À­¤¬¤¤¤¯¤Ä¤«Â³¤¯¤³¤È¤â¤¢¤ë¡£ + +.nf +struct tcmsg { + unsigned char tcm_family; + int tcm_ifindex; /* interface index */ + __u32 tcm_handle; /* Qdisc handle */ + __u32 tcm_parent; /* Parent qdisc */ + __u32 tcm_info; +}; +.fi +.TS +tab(:); +c +l l l. +.\"O Attributes +.\"O rta_type:value type:Description +.\"O _ +.\"O TCA_UNSPEC:-:unspecified +.\"O TCA_KIND:asciiz string:Name of queueing discipline +.\"O TCA_OPTIONS:byte sequence:Qdisc-specific options follow +.\"O TCA_STATS:struct tc_stats:Qdisc statistics. +.\"O TCA_XSTATS:qdisc specific:Module-specific statistics. +.\"O TCA_RATE:struct tc_estimator:Rate limit. +°À­ +rta_type:Ãͤη¿:ÀâÌÀ +_ +TCA_UNSPEC:-:»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤ +TCA_KIND:asciiz string:¥­¥å¡¼¥¤¥ó¥°¥ë¡¼¥ë¤Î̾Á° +TCA_OPTIONS:byte sequence:Qdisc ÆÃÍ­¤Î¥ª¥×¥·¥ç¥ó¤¬Â³¤¯ +TCA_STATS:struct tc_stats:Qdisc ¤ÎÅý·× +TCA_XSTATS:qdisc specific:¥â¥¸¥å¡¼¥ëÆÃÍ­¤ÎÅý·× +TCA_RATE:struct tc_estimator:¥ì¡¼¥ÈÀ©¸Â +.TE + +.\"O In addition various other qdisc module specific attributes are allowed. +.\"O For more information see the appropriate include files. +¤µ¤é¤Ë¡¢ qdisc ¥â¥¸¥å¡¼¥ëÆÃÍ­¤ÎÍÍ¡¹¤Ê°À­¤ò»ØÄê¤Ç¤­¤ë¡£ +¾ÜºÙ¤Ê¾ðÊó¤ÏŬÀڤʥ¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤ò¸«¤è¡£ +.TP +.BR RTM_NEWTCLASS ", " RTM_DELTCLASS ", " RTM_GETTCLASS +.\"O Add, remove or get a traffic class. +.\"O These messages contain a +.\"O .I struct tcmsg +.\"O as described above. +¥È¥é¥Õ¥£¥Ã¥¯¥¯¥é¥¹¤òÄɲᦺï½ü¡¦¼èÆÀ¤¹¤ë¡£ +¤³¤ì¤é¤Î¥á¥Ã¥»¡¼¥¸¤Ï¡¢¾å½Ò¤Î +.I struct tcmsg +¤òȼ¤¦¡£ +.TP +.BR RTM_NEWTFILTER ", " RTM_DELTFILTER ", " RTM_GETTFILTER +.\"O Add, remove or receive information about a traffic filter. +.\"O These messages contain a +.\"O .I struct tcmsg +.\"O as described above. +¥È¥é¥Õ¥£¥Ã¥¯¥Õ¥£¥ë¥¿¡¼¤Î¾ðÊó¤òÄɲᦺï½ü¡¦¼èÆÀ¤¹¤ë¡£ +¤³¤ì¤é¤Î¥á¥Ã¥»¡¼¥¸¤Ï¡¢¾å½Ò¤Î +.I struct tcmsg +¤òȼ¤¦¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .B rtnetlink +.\"O is a new feature of Linux 2.2. +.B rtnetlink +¤Ï Linux 2.2 ¤Î¿·µ¡Ç½¤Ç¤¢¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O This manual page is incomplete. +¤³¤Î man ¥Ú¡¼¥¸¤ÏÉÔ´°Á´¤Ç¤¢¤ë¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR cmsg (3), +.BR rtnetlink (3), +.BR ip (7), +.BR netlink (7) diff --git a/draft/man7/sem_overview.7 b/draft/man7/sem_overview.7 new file mode 100644 index 00000000..f6714c92 --- /dev/null +++ b/draft/man7/sem_overview.7 @@ -0,0 +1,281 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" Updated 2008-08-07, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2009-02-23, Akihiro MOTOKI, LDP v3.19 +.\" +.TH SEM_OVERVIEW 7 2009-02-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sem_overview \- Overview of POSIX semaphores +sem_overview \- POSIX ¥»¥Þ¥Õ¥©¤Î³µÍ× +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O POSIX semaphores allow processes and threads to synchronize their actions. +POSIX ¥»¥Þ¥Õ¥©¤ò»ÈÍѤ¹¤ë¤È¡¢¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É´Ö¤Ç¤½¤ÎÆ°ºî¤ò +Ʊ´ü¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O A semaphore is an integer whose value is never allowed to fall below zero. +.\"O Two operations can be performed on semaphores: +.\"O increment the semaphore value by one +.\"O .RB ( sem_post (3)); +.\"O and decrement the semaphore value by one +.\"O .RB ( sem_wait (3)). +.\"O If the value of a semaphore is currently zero, then a +.\"O .BR sem_wait (3) +.\"O operation will block until the value becomes greater than zero. +¥»¥Þ¥Õ¥©¤ÏÀ°¿ô¤Ç¤¢¤ê¡¢¤½¤ÎÃͤϷ褷¤Æ 0 ̤Ëþ¤Ë¤Ê¤ë¤³¤È¤Ïµö¤µ¤ì¤Ê¤¤¡£ +¥»¥Þ¥Õ¥©¤ËÂФ·¤Æ¤Ç¤­¤ëÁàºî¤Ï 2 ¤Ä¤Ç¤¢¤ë: +¥»¥Þ¥Õ¥©Ãͤò 1 Áý¤ä¤¹ +.RB ( sem_post (3)); +¥»¥Þ¥Õ¥©Ãͤò 1 ¸º¤é¤¹ +.RB ( sem_wait (3))¡£ +¥»¥Þ¥Õ¥©¤ÎÃͤ¬¤¹¤Ç¤Ë 0 ¤Î¾ì¹ç¡¢¥»¥Þ¥Õ¥©Ãͤ¬ 0 ¤è¤êÂ礭¤¯¤Ê¤ë¤Þ¤Ç +.BR sem_wait (3) +Áàºî¤ÏÄä»ß (block) ¤¹¤ë¡£ + +.\"O POSIX semaphores come in two forms: named semaphores and +.\"O unnamed semaphores. +POSIX ¥»¥Þ¥Õ¥©¤Ë¤Ï¡¢Ì¾Á°ÉÕ¤­¥»¥Þ¥Õ¥© (named semaphore) ¤È +̾Á°¤Ê¤·¥»¥Þ¥Õ¥© (unnamed semaphore) ¤Î 2¤Ä¤Î·Á¤¬¤¢¤ë¡£ +.TP +.\"O .B Named semaphores +.B ̾Á°ÉÕ¤­¥»¥Þ¥Õ¥© +.\"O A named semaphore is identified by a name of the form +.\"O .IR /somename ; +.\"O that is, a null-terminated string of up to +.\"O .BI NAME_MAX \-4 +.\"O (i.e., 251) characters consisting of an initial slash, +̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤Ï +.I /somename +¤È¤¤¤¦·Á¼°¤Î̾Á°¤Ç¼±Ê̤µ¤ì¤ë¡£ +¤½¤Î̾Á°¤Ï¡¢ºÇÂç¤Ç +.BI NAME_MAX \-4 +(¤¹¤Ê¤ï¤Á 251) ʸ»ú¤Î 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 tree must exist under /dev/shm, and +.\" the fist subdirectory component must exist as the name +.\" sem.name, and all of the subdirectory components must allow the +.\" required permissions if a user wants to create a semaphore +.\" object in a subdirectory. +.\"O Two processes can operate on the same named semaphore by passing +.\"O the same name to +.\"O .BR sem_open (3). +.BR sem_open (3) +¤ËƱ¤¸Ì¾Á°¤òÅϤ¹¤³¤È¤Ë¤è¤ê¡¢2 ¤Ä¤Î¥×¥í¥»¥¹´Ö¤ÇƱ¤¸Ì¾Á°¤Î¥»¥Þ¥Õ¥© +¤ËÂФ·Áàºî¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O The +.\"O .BR sem_open (3) +.\"O function creates a new named semaphore or opens an existing +.\"O named semaphore. +.\"O After the semaphore has been opened, it can be operated on using +.\"O .BR sem_post (3) +.\"O and +.\"O .BR sem_wait (3). +.\"O When a process has finished using the semaphore, it can use +.\"O .BR sem_close (3) +.\"O to close the semaphore. +.\"O When all processes have finished using the semaphore, +.\"O it can be removed from the system using +.\"O .BR sem_unlink (3). +.BR sem_open (3) +´Ø¿ô¤Ï¡¢¿·¤·¤¤Ì¾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤òºîÀ®¤¹¤ë¤«¡¢´û¤Ë¸ºß¤¹¤ë̾Á°ÉÕ¤­ +¥»¥Þ¥Õ¥©¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +¥»¥Þ¥Õ¥©¤ò¥ª¡¼¥×¥ó¤·¤¿¸å¤Ï¡¢ +.BR sem_post (3) +¤È +.BR sem_wait (3) +¤ò»È¤Ã¤Æ¥»¥Þ¥Õ¥©¤òÁàºî¤Ç¤­¤ë¡£ +¥×¥í¥»¥¹¤¬¥»¥Þ¥Õ¥©¤Î»ÈÍѤò½ª¤¨¤¿ºÝ¤Ï¡¢ +.BR sem_close (3) +¤ò»È¤Ã¤Æ¥»¥Þ¥Õ¥©¤ò¥¯¥í¡¼¥º¤Ç¤­¤ë¡£ +¤¢¤ë¥»¥Þ¥Õ¥©¤ò¤É¤Î¥×¥í¥»¥¹¤â»ÈÍѤ·¤Ê¤¯¤Ê¤ë¤È¡¢ +.BR sem_unlink (3) +¤ò»È¤Ã¤Æ¤½¤Î¥»¥Þ¥Õ¥©¤ò¥·¥¹¥Æ¥à¤«¤éºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.\"O .B Unnamed semaphores (memory-based semaphores) +.B ̾Á°¤Ê¤·¥»¥Þ¥Õ¥© (¥á¥â¥ê¥Ù¡¼¥¹¡¦¥»¥Þ¥Õ¥©) +.\"O An unnamed semaphore does not have a name. +.\"O Instead the semaphore is placed in a region of memory that +.\"O is shared between multiple threads (a +.\"O .IR "thread-shared semaphore" ) +.\"O or processes (a +.\"O .IR "process-shared semaphore" ). +.\"O A thread-shared semaphore is placed in an area of memory shared +.\"O between by the threads of a process, for example, a global variable. +.\"O A process-shared semaphore must be placed in a shared memory region +.\"O (e.g., a System V shared memory segment created using +.\"O .BR semget (2), +.\"O or a POSIX shared memory object built created using +.\"O .BR shm_open (3)). +̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤Ï̾Á°¤ò»ý¤¿¤Ê¤¤¡£¤½¤ÎÂå¤ï¤ê¡¢¥»¥Þ¥Õ¥©¤Ï¡¢ +Ê£¿ô¥¹¥ì¥Ã¥É´Ö¤Ç¶¦Í­¤µ¤ì¤¿¥á¥â¥êÎΰ衢¤â¤·¤¯¤ÏÊ£¿ô¥×¥í¥»¥¹´Ö¤Ç +¶¦Í­¤µ¤ì¤¿¥á¥â¥êÎΰè¤ËÃÖ¤«¤ì¤ë (Á°¼Ô¤ò +.IR "¥¹¥ì¥Ã¥É¶¦Í­¥»¥Þ¥Õ¥© (thread-shared semaphore)" ¡¢ +¸å¼Ô¤ò +.IR "¥×¥í¥»¥¹¶¦Í­¥»¥Þ¥Õ¥© (process-shared semaphore)" +¤È¸Æ¤Ö)¡£¥¹¥ì¥Ã¥É¶¦Í­¥»¥Þ¥Õ¥©¤Ï¡¢Æ±¤¸¥×¥í¥»¥¹Æâ¤Î¥¹¥ì¥Ã¥É´Ö¤Ç¶¦Í­¤µ¤ì¤¿ +¥á¥â¥êÎΰ衢Î㤨¤ÐÂç°èÊÑ¿ô (global variable) ¤ËÇÛÃÖ¤µ¤ì¤ë¡£ +¥×¥í¥»¥¹¶¦Í­¥»¥Þ¥Õ¥©¤Ï¡¢¶¦Í­¥á¥â¥êÎΰè (Î㤨¤Ð¡¢ +.BR semget (2) +¤ò»È¤Ã¤ÆºîÀ®¤Ç¤­¤ë System V ¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ä +.BR shm_open (3) +¤ò»È¤Ã¤ÆºîÀ®¤Ç¤­¤ë POSIX ¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È) +Æâ¤ËÇÛÃÖ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O Before being used, an unnamed semaphore must be initialized using +.\"O .BR sem_init (3). +.\"O It can then be operated on using +.\"O .BR sem_post (3) +.\"O and +.\"O .BR sem_wait (3). +.\"O When the semaphore is no longer required, +.\"O and before the memory in which it is located is deallocated, +.\"O the semaphore should be destroyed using +.\"O .BR sem_destroy (3). +̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤Ï¡¢»ÈÍѤ¹¤ëÁ°¤Ë +.BR sem_init (3) +¤ò»È¤Ã¤Æ½é´ü²½¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥»¥Þ¥Õ¥©¤Ï +.BR sem_post (3) +¤È +.BR sem_wait (3) +¤ò»È¤Ã¤ÆÁàºî¤Ç¤­¤ë¡£ +¥»¥Þ¥Õ¥©¤¬¤â¤Ï¤äɬÍפʤ¯¤Ê¤Ã¤¿¤È¤­¤ä¡¢ +¥»¥Þ¥Õ¥©¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¥á¥â¥ê¤ò²òÊü¤¹¤ëÁ°¤Ë¤Ï¡¢ +.BR sem_destroy (3) +¤ò»È¤Ã¤Æ¥»¥Þ¥Õ¥©¤òÇË´þ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.\"O The remainder of this section describes some specific details +.\"O of the Linux implementation of POSIX semaphores. +¤³¤ÎÀá¤Î»Ä¤ê¤Ç¤Ï¡¢POSIX ¥»¥Þ¥Õ¥©¤Î Linux ¤Î¼ÂÁõ¤Î¾ÜºÙ +¤Ë¤Ä¤¤¤ÆÀâÌÀ¤¹¤ë¡£ +.\"O .SS Versions +.SS ¥Ð¡¼¥¸¥ç¥ó +.\"O Prior to kernel 2.6, Linux only supported unnamed, +.\"O thread-shared semaphores. +.\"O On a system with Linux 2.6 and a glibc that provides the NPTL +.\"O threading implementation, +.\"O a complete implementation of POSIX semaphores is provided. +¥Ð¡¼¥¸¥ç¥ó 2.6 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢Linux ¤Ï +̾Á°¤Ê¤·¤Î¥¹¥ì¥Ã¥É¶¦Í­¥»¥Þ¥Õ¥©¤Î¤ß¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤¿¡£ +Linux 2.6 ¤È NPTL ¥¹¥ì¥Ã¥É¼ÂÁõ¤òÄ󶡤·¤Æ¤¤¤ë glibc ¤¬Æþ¤Ã¤¿ +¥·¥¹¥Æ¥à¤Ç¤Ï¡¢POSIX ¥»¥Þ¥Õ¥©¤Î´°Á´¤Ê¼ÂÁõ¤¬Ä󶡤µ¤ì¤ë¡£ +.\"O .SS Persistence +.SS »ý³À­ +.\"O POSIX named semaphores have kernel persistence: +.\"O if not removed by +.\"O .BR sem_unlink (3), +.\"O a semaphore will exist until the system is shut down. +POSIX ̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤Ï¥«¡¼¥Í¥ëÆâ¤ÇÊÝ»ý¤µ¤ì¤ë¡£ +.BR sem_unlink (3) +¤Çºï½ü¤µ¤ì¤Ê¤±¤ì¤Ð¡¢¥»¥Þ¥Õ¥©¤Ï +¥·¥¹¥Æ¥à¤¬¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤ë¤Þ¤Ç¸ºß¤·Â³¤±¤ë¡£ +.\"O .SS Linking +.SS ¥ê¥ó¥¯ +.\"O Programs using the POSIX semaphores API must be compiled with +.\"O .I cc \-lrt +.\"O to link against the real-time library, +.\"O .IR librt . +POSIX ¥»¥Þ¥Õ¥© API ¤ò»ÈÍѤ·¤¿¥×¥í¥°¥é¥à¤Ï +.I cc \-lrt +¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¡¢¥ê¥¢¥ë¥¿¥¤¥à¥é¥¤¥Ö¥é¥ê +.I librt +¤È¥ê¥ó¥¯¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SS Accessing named semaphores via the file system +.SS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à·Ðͳ¤Ç¤Î̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤Ø¤Î¥¢¥¯¥»¥¹ +.\"O On Linux, named semaphores are created in a virtual file system, +.\"O normally mounted under +.\"O .IR /dev/shm , +.\"O with names of the form +.\"O .IR \fBsem.\fPsomename . +Linux ¤Ç¤Ï¡¢Ì¾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤Ï²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +(virtual file system) Æâ¤Ë +.I \fBsem.\fPsomename +¤È¤¤¤¦·Á¤Î̾Á°¤ÇºîÀ®¤µ¤ì¤ë¡£²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÏÄ̾ï +.I /dev/shm +°Ê²¼¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +.\"O (This is the reason that semaphore names are limited to +.\"O .BI NAME_MAX \-4 +.\"O rather than +.\"O .B NAME_MAX +.\"O characters.) +(¤³¤ì¤¬¡¢¥»¥Þ¥Õ¥©¤Î̾Á°¤Îʸ»ú¿ô¤Î¾å¸Â¤¬ +.B NAME_MAX +¤Ç¤Ï¤Ê¤¯ +.BI NAME_MAX \-4 +¤È¤Ê¤Ã¤Æ¤¤¤ëÍýͳ¤Ç¤¢¤ë¡£) + +.\"O Since Linux 2.6.19, ACLs can be placed on files under this directory, +.\"O to control object permissions on a per-user and per-group basis. +Linux 2.6.19 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¥Ç¥£¥ì¥¯¥È¥êÇÛ²¼¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ ACL ¤ò +ÀßÄê¤Ç¤­¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Îµö²Ä¤ò¥æ¡¼¥¶Ã±°Ì¡¢¥°¥ë¡¼¥×ñ°Ì¤ÇÀ©¸æ¤¹¤ë¤³¤È¤¬ +¤Ç¤­¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O System V semaphores +.\"O .RB ( semget (2), +.\"O .BR semop (2), +.\"O etc.) are an older semaphore API. +.\"O POSIX semaphores provide a simpler, and better designed interface than +.\"O System V semaphores; +.\"O on the other hand POSIX semaphores are less widely available +.\"O (especially on older systems) than System V semaphores. +System V ¥»¥Þ¥Õ¥© +.RB ( semget (2), +.BR semop (2) +¤Ê¤É) ¤Ï¸Å¤¤¥»¥Þ¥Õ¥© API ¤Ç¤¢¤ë¡£ POSIX ¥»¥Þ¥Õ¥©¤Ï System V ¤è¤ê¤â +´Êñ¤Ç¡¢¤¦¤Þ¤¯À߷פµ¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤·¤Æ¤¤¤ë¡£ +°ìÊý¤Ç¡¢POSIX ¥»¥Þ¥Õ¥©¤Ï System V ¥»¥Þ¥Õ¥©¤ÈÈæ¤Ù¤ë¤È +ÍøÍѤǤ­¤ë¥·¥¹¥Æ¥à¤¬¾¯¤Ê¤¤ (Æäˡ¢¸Å¤¤¥·¥¹¥Æ¥à¤Ç¤Ï¾¯¤Ê¤¤)¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O An example of the use of various POSIX semaphore functions is shown in +.\"O .BR sem_wait (3). +³Æ¼ï¤Î POSIX ¥»¥Þ¥Õ¥©´Ø¿ô¤ò»ÈÍѤ·¤¿Î㤬 +.BR sem_wait (3) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sem_close (3), +.BR sem_destroy (3), +.BR sem_getvalue (3), +.BR sem_init (3), +.BR sem_open (3), +.BR sem_post (3), +.BR sem_unlink (3), +.BR sem_wait (3), +.BR pthreads (7) diff --git a/draft/man7/shm_overview.7 b/draft/man7/shm_overview.7 new file mode 100644 index 00000000..ed27f542 --- /dev/null +++ b/draft/man7/shm_overview.7 @@ -0,0 +1,200 @@ +'\" t +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 +.\" +.TH SHM_OVERVIEW 7 2008-06-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O shm_overview \- Overview of POSIX shared memory +shm_overview \- POSIX ¶¦Í­¥á¥â¥ê¤Î³µÍ× +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The POSIX shared memory API allows processes to communicate information +.\"O by sharing a region of memory. +POSIX ¶¦Í­¥á¥â¥ê API ¤ò»ÈÍѤ¹¤ë¤È¡¢¥á¥â¥ê¤Î¤¢¤ëÎΰè¤ò¶¦Í­¤·¤Æ¡¢ +¥×¥í¥»¥¹´Ö¤Ç¾ðÊó¤ò¤ä¤ê¼è¤ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O The interfaces employed in the API are: +¤³¤Î API ¤Ç¤Ï°Ê²¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ºÎÍѤµ¤ì¤Æ¤¤¤ë¡£ +.TP 15 +.BR shm_open (3) +.\"O Create and open a new object, or open an existing object. +.\"O This is analogous to +.\"O .BR open (2). +.\"O The call returns a file descriptor for use by the other +.\"O interfaces listed below. +¿·¤·¤¤¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¤·¥ª¡¼¥×¥ó¤¹¤ë¡¢¤â¤·¤¯¤Ï +´û¸¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£¤³¤ì¤Ï +.BR open (2) +¤ÈƱ¤¸¤Ç¤¢¤ë¡£²¼µ­¤Ë¤¢¤ë¾¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç»ÈÍѤ¹¤ë +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.TP +.BR ftruncate (2) +.\"O Set the size of the shared memory object. +.\"O (A newly created shared memory object has a length of zero.) +¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤ÎÂ礭¤µ¤òÀßÄꤹ¤ë¡£ +.TP +.BR mmap (2) +.\"O Map the shared memory object into the virtual address space +.\"O of the calling process. +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î²¾ÁÛ¥¢¥É¥ì¥¹¶õ´Ö¤Ë¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤ò +¥Þ¥Ã¥×¤¹¤ë¡£ +.TP +.BR munmap (2) +.\"O Unmap the shared memory object from the virtual address space +.\"O of the calling process. +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î²¾ÁÛ¥¢¥É¥ì¥¹¶õ´Ö¤«¤é +¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤ò¥¢¥ó¥Þ¥Ã¥×¤¹¤ë¡£ +.TP +.BR shm_unlink (3) +.\"O Remove a shared memory object name. +¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È̾¤òºï½ü¤¹¤ë¡£ +.TP +.BR close (2) +.\"O Close the file descriptor allocated by +.\"O .BR shm_open (3) +.\"O when it is no longer needed. +.BR shm_open (3) +¤Ç³ä¤êÅö¤Æ¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÍפˤʤ俺ݤˡ¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.TP +.BR fstat (2) +.\"O Obtain a +.\"O .I stat +.\"O structure that describes the shared memory object. +.\"O Among the information returned by this call are the object's +.\"O size +.\"O .RI ( st_size ), +.\"O permissions +.\"O .RI ( st_mode ), +.\"O owner +.\"O .RI ( st_uid ), +.\"O and group +.\"O .RI ( st_gid ). +¤½¤Î¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤¬Æþ¤Ã¤¿ +.I stat +¹½Â¤ÂΤò¼èÆÀ¤¹¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÊÖ¤¹¾ðÊó¤Ë¤Ï¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Î¥µ¥¤¥º +.RI ( st_size )¡¢ +µö²Ä°À­ +.RI ( st_mode )¡¢ +½êÍ­¼Ô +.RI ( st_uid )¡¢ +¥°¥ë¡¼¥× +.RI ( st_gid ) +¤¬¤¢¤ë¡£ +.TP +.BR fchown (2) +.\"O To change the ownership of a shared memory object. +¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤òÊѹ¹¤¹¤ë¡£ +.TP +.BR fchmod (2) +.\"O To change the permissions of a shared memory object. +¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Îµö²Ä°À­¤òÊѹ¹¤¹¤ë¡£ +.\"O .SS Versions +.SS ¥Ð¡¼¥¸¥ç¥ó +.\"O POSIX shared memory is supported since Linux 2.4 and glibc 2.2. +POSIX ¶¦Í­¥á¥â¥ê¤Ï Linux 2.4 ¤È glibc 2.2 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS Persistence +.SS »ý³À­ +.\"O POSIX shared memory objects have kernel persistence: +.\"O a shared memory object will exist until the system is shut down, +.\"O or until all processes have unmapped the object and it has been deleted with +.\"O .BR shm_unlink (3) +POSIX ¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Ï¥«¡¼¥Í¥ëÆâ¤ÇÊÝ»ý¤µ¤ì¤ë¡£ +¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢¥·¥¹¥Æ¥à¤¬¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤ë¤«¡¢ +Á´¤Æ¤Î¥×¥í¥»¥¹¤¬¤½¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¥¢¥ó¥Þ¥Ã¥×¤·¡¢ +.BR shm_unlink (3) +¤Çºï½ü¤µ¤ì¤ë¤Þ¤Ç¡¢Â¸ºß¤·Â³¤±¤ë¡£ +.\"O .SS Linking +.SS ¥ê¥ó¥¯ +.\"O Programs using the POSIX shared memory API must be compiled with +.\"O .I cc \-lrt +.\"O to link against the real-time library, +.\"O .IR librt . +POSIX ¶¦Í­¥á¥â¥ê API ¤ò»ÈÍѤ·¤¿¥×¥í¥°¥é¥à¤Ï +.I cc \-lrt +¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¡¢¥ê¥¢¥ë¥¿¥¤¥à¥é¥¤¥Ö¥é¥ê +.I librt +¤È¥ê¥ó¥¯¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O .SS Accessing shared memory objects via the file system +.SS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à·Ðͳ¤Ç¤Î¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥¢¥¯¥»¥¹ +.\"O On Linux, shared memory objects are created in a +.\"O .RI ( tmpfs ) +.\"O virtual file system, normally mounted under +.\"O .IR /dev/shm . +.\"O Since kernel 2.6.19, Linux supports the use of access control lists (ACLs) +.\"O to control the permissions of objects in the virtual file system. +Linux ¤Ç¤Ï¡¢¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤ÏÄ̾ï +.I /dev/shm +°Ê²¼¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.RI ( tmpfs ) +Æâ¤ËºîÀ®¤µ¤ì¤ë¡£ +¥«¡¼¥Í¥ë 2.6.19 °Ê¹ß¤Î Linux ¤Ç¤Ï¡¢ +²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Îµö²Ä°À­¤ÎÀ©¸æ¤Ë¡¢ +¥¢¥¯¥»¥¹À©¸æ¥ê¥¹¥È (ACL; access control lists) ¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1-2001. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Typically, processes must synchronize their access to a shared +.\"O memory object, using, for example, POSIX semaphores. +Ä̾ï¤Ï¡¢¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¢¥¯¥»¥¹¤¹¤ë¥×¥í¥»¥¹¤Ï¡¢ +POSIX ¥»¥Þ¥Õ¥©¤Ê¤É¤ò»È¤Ã¤Æ¥×¥í¥»¥¹´Ö¤ÇƱ´ü¤ò¤È¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O System V shared memory +.\"O .RB ( shmget (2), +.\"O .BR shmop (2), +.\"O etc.) is an older semaphore API. +.\"O POSIX shared memory provides a simpler, and better designed interface; +.\"O on the other hand POSIX shared memory is somewhat less widely available +.\"O (especially on older systems) than System V shared memory. +System V ¶¦Í­¥á¥â¥ê +.RB ( shmget (2), +.BR shmop (2) +¤Ê¤É) ¤Ï¸Å¤¤¶¦Í­¥á¥â¥ê API ¤Ç¤¢¤ë¡£ +.\"O motoki: ¸¶Ê¸¤Î semaphore API ¤Ï shared memory API ¤Î´Ö°ã¤¤¤À¤í¤¦¡£ +POSIX ¶¦Í­¥á¥â¥ê¤Ï¡¢¤è¤ê´Êñ¤Ç¡¢¤¦¤Þ¤¯À߷פµ¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤·¤Æ¤¤¤ë¡£ +°ìÊý¤Ç¡¢POSIX ¶¦Í­¥á¥â¥ê¤Ï System V ¶¦Í­¥á¥â¥ê¤ÈÈæ¤Ù¤ë¤È +ÍøÍѤǤ­¤ë¥·¥¹¥Æ¥à¤¬¾¯¤Ê¤¤ (Æäˡ¢¸Å¤¤¥·¥¹¥Æ¥à¤Ç¤Ï¾¯¤Ê¤¤)¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fchmod (2), +.BR fchown (2), +.BR fstat (2), +.BR ftruncate (2), +.BR mmap (2), +.BR mprotect (2), +.BR munmap (2), +.BR shmget (2), +.BR shmop (2), +.BR shm_open (3), +.BR shm_unlink (3), +.BR sem_overview (7) diff --git a/draft/man7/signal.7 b/draft/man7/signal.7 new file mode 100644 index 00000000..f31ee961 --- /dev/null +++ b/draft/man7/signal.7 @@ -0,0 +1,1400 @@ +'\" t +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" and Copyright (c) 2002, 2006 by Michael Kerrisk +.\" and 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. +.\" +.\" Modified Sat Jul 24 17:34:08 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Jan 7 01:41:27 1996 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Sun Apr 14 12:02:29 1996 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Sat Nov 13 16:28:23 1999 by Andries Brouwer (aeb@cwi.nl) +.\" Modified 10 Apr 2002, by Michael Kerrisk +.\" Modified 7 Jun 2002, by Michael Kerrisk +.\" Added information on real-time signals +.\" Modified 13 Jun 2002, by Michael Kerrisk +.\" Noted that SIGSTKFLT is in fact unused +.\" 2004-12-03, Modified mtk, added notes on RLIMIT_SIGPENDING +.\" 2006-04-24, mtk, Added text on changing signal dispositions, +.\" signal mask, and pending signals. +.\" 2008-07-04, mtk: +.\" Added section on system call restarting (SA_RESTART) +.\" Added section on stop/cont signals interrupting syscalls. +.\" 2008-10-05, mtk: various additions +.\" +.\" Japanese Version Copyright (c) 1997 Takafumi Naka +.\" and 2005-2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 1997-02-13, Takafumi Naka +.\" Modified 1999-06-22, Tatsuo SEKINE +.\" Modified 1999-07-18, Takafumi Naka +.\" Modified 1999-12-06, NAKANO Takeo , LDP v1.28 +.\" Updated 2003-07-24, Kentaro Shirakata +.\" Updated 2005-02-23, Akihiro MOTOKI +.\" Updated 2006-07-28, Akihiro MOTOKI , LDP v2.36 +.\" Updated 2007-05-28, Akihiro MOTOKI , LDP v2.50 +.\" Updated 2007-09-08, Akihiro MOTOKI , LDP v2.64 +.\" Updated 2008-08-11, Akihiro MOTOKI , LDP v3.05 +.\" Updated 2008-11-21, Akihiro MOTOKI , LDP v3.13 +.\" Updated 2010-04-10, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: disposition ½èÍýÊýË¡ +.\"WORD: pending ½èÍýÂÔ¤Á +.\"WORD: signal handler ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é +.\" +.TH SIGNAL 7 2010-02-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O signal \- overview of signals +.SH ̾Á° +signal \- ¥·¥°¥Ê¥ë¤Î³µÍ× +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Linux supports both POSIX reliable signals (hereinafter +.\"O "standard signals") and POSIX real-time signals. +Linux ¤Ï POSIX ¿®Íꥷ¥°¥Ê¥ë (reliable signal; °Ê¸å "ɸ½à¥·¥°¥Ê¥ë"¤Èɽµ­) +¤È POSIX ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎξÊý¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +.\"O .SS "Signal Dispositions" +.SS ¥·¥°¥Ê¥ë½èÍýÊýË¡ +.\"O Each signal has a current +.\"O .IR disposition , +.\"O which determines how the process behaves when it is delivered +.\"O the signal. +¥·¥°¥Ê¥ë¤Ï¤½¤ì¤¾¤ì¸½ºß¤Î¡Ö½èÍýÊýË¡ (disposition)¡×¤òÊÝ»ý¤·¤Æ¤ª¤ê¡¢ +¤³¤Î½èÍýÊýË¡¤Ë¤è¤ê¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤¿ºÝ¤Ë¥×¥í¥»¥¹¤¬ +¤É¤Î¤è¤¦¤Ê¿¶Éñ¤¤¤ò¤¹¤ë¤«¤¬·è¤Þ¤ë¡£ + +.\"O The entries in the "Action" column of the tables below specify +.\"O the default disposition for each signal, as follows: +¸å½Ò¤Îɽ¤Î "Æ°ºî" ¤ÎÍó¤Î¥¨¥ó¥È¥ê¤Ï³Æ¥·¥°¥Ê¥ë¤Î¥Ç¥Õ¥©¥ë¥È¤Î +½èÍýÊýË¡¤ò¼¨¤·¤Æ¤ª¤ê¡¢°Ê²¼¤Î¤è¤¦¤Ê°ÕÌ£¤ò»ý¤Ä¡£ +.IP Term +.\"O Default action is to terminate the process. +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¥×¥í¥»¥¹½ªÎ»¡£ +.IP Ign +.\"O Default action is to ignore the signal. +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¤³¤Î¥·¥°¥Ê¥ë¤Î̵»ë¡£ +.IP Core +.\"O Default action is to terminate the process and dump core (see +.\"O .BR core (5)). +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¥×¥í¥»¥¹½ªÎ»¤È¥³¥¢¥À¥ó¥×½ÐÎÏ +.RB ( core (5) +»²¾È)¡£ +.IP Stop +.\"O Default action is to stop the process. +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¥×¥í¥»¥¹¤Î°ì»þÄä»ß¡£ +.IP Cont +.\"O Default action is to continue the process if it is currently stopped. +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¡¢¥×¥í¥»¥¹¤¬Ää»ßÃæ¤Î¾ì¹ç¤Ë¤½¤Î¼Â¹Ô¤ÎºÆ³«¡£ +.PP +.\"O A process can change the disposition of a signal using +.\"O .BR sigaction (2) +.\"O or (less portably) +.\"O .BR signal (2). +.\"O Using these system calls, a process can elect one of the +.\"O following behaviors to occur on delivery of the signal: +.\"O perform the default action; ignore the signal; +.\"O or catch the signal with a +.\"O .IR "signal handler" , +.\"O a programmer-defined function that is automatically invoked +.\"O when the signal is delivered. +.\"O (By default, the signal handler is invoked on the +.\"O normal process stack. +.\"O It is possible to arrange that the signal handler +.\"O uses an alternate stack; see +.\"O .BR sigaltstack (2) +.\"O for a discussion of how to do this and when it might be useful.) +¥×¥í¥»¥¹¤Ï¡¢ +.BR sigaction (2) +¤ä +.BR signal (2) +¤ò»È¤Ã¤Æ¡¢¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.RB ( signal (2) +¤ÎÊý¤¬°Ü¿¢À­¤ÏÄ㤤)¡£¥·¥°¥Ê¥ë¤ÎÇÛÁ÷»þ¤Ëµ¯¤³¤ëÆ°ºî¤È¤·¤Æ +¥×¥í¥»¥¹¤¬ÁªÂò¤Ç¤­¤ë¤Î¤Ï¡¢¼¡¤Î¤¤¤º¤ì¤«°ì¤Ä¤Ç¤¢¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤ò¼Â¹Ô¤¹¤ë¡¢¥·¥°¥Ê¥ë¤ò̵»ë¤¹¤ë¡¢ +.I "¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é (signal handler)" +¤Ç¥·¥°¥Ê¥ë¤òÊ᪤¹¤ë¡£¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤È¤Ï¡¢¥·¥°¥Ê¥ëÇÛÁ÷»þ¤Ë +¼«Æ°Åª¤Ëµ¯Æ°¤µ¤ì¤ë¥×¥í¥°¥é¥ÞÄêµÁ¤Î´Ø¿ô¤Ç¤¢¤ë¡£ +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÏÄ̾ï¤Î¥×¥í¥»¥¹¤Î¥¹¥¿¥Ã¥¯¾å¤Çµ¯Æ°¤µ¤ì¤ë¡£ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ÂåÂØ¥¹¥¿¥Ã¥¯ (alternate stack) ¤ò»ÈÍѤ¹¤ë¤è¤¦¤ËÀßÄꤹ¤ë +¤³¤È¤â¤Ç¤­¤ë¡£ÂåÂØ¥¹¥¿¥Ã¥¯¤ò»ÈÍѤ¹¤ë¤è¤¦¤ËÀßÄꤹ¤ëÊýË¡¤È¡¢¤É¤Î¤è¤¦¤ÊºÝ¤Ë +ÂåÂØ¥¹¥¿¥Ã¥¯¤¬Ìò¤ËΩ¤Ä¤«¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤Ë¤Ä¤¤¤Æ¤Ï +.BR sigaltstack (2) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"O The signal disposition is a per-process attribute: +.\"O in a multithreaded application, the disposition of a +.\"O particular signal is the same for all threads. +¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï¥×¥í¥»¥¹Ã±°Ì¤Î°À­¤Ç¤¢¤ë¡£ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢¤¢¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï +Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤ÇƱ¤¸¤Ç¤¢¤ë¡£ + +.\"O A child created via +.\"O .BR fork (2) +.\"O inherits a copy of its parent's signal dispositions. +.\"O During an +.\"O .BR execve (2), +.\"O the dispositions of handled signals are reset to the default; +.\"O the dispositions of ignored signals are left unchanged. +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤Î´Ö¡¢¥Ï¥ó¥É¥é¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È +¤µ¤ì¡¢Ìµ»ë¤È¤Ê¤Ã¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤ÏÊѹ¹¤µ¤ì¤º¤½¤Î¤Þ¤Þ¤È¤Ê¤ë¡£ +.\"O .SS Sending a Signal +.SS ¥·¥°¥Ê¥ë¤ÎÁ÷¿® +.\"O The following system calls and library functions allow +.\"O the caller to send a signal: +°Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ò»È¤Ã¤Æ¡¢ +¸Æ¤Ó½Ð¤·¼Ô¤Ï¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 16 +.BR raise (3) +.\"O Sends a signal to the calling thread. +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.TP +.BR kill (2) +.\"O Sends a signal to a specified process, +.\"O to all members of a specified process group, +.\"O or to all processes on the system. +»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤ä¡¢»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¡¼¡¢ +¥·¥¹¥Æ¥à¤ÎÁ´¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.TP +.BR killpg (2) +.\"O Sends a signal to all of the members of a specified process group. +»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¡¼¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.TP +.BR pthread_kill (3) +.\"O Sends a signal to a specified POSIX thread in the same process as +.\"O the caller. +¸Æ¤Ó½Ð¤·¼Ô¤ÈƱ¤¸¥×¥í¥»¥¹Æâ¤Î»ØÄꤵ¤ì¤¿ POSIX ¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.TP +.BR tgkill (2) +.\"O Sends a signal to a specified thread within a specific process. +.\"O (This is the system call used to implement +.\"O .BR pthread_kill (3).) +»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹Æâ¤Î»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë +(¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ +.BR pthread_kill (3) +¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë)¡£ +.TP +.BR sigqueue (2) +.\"O Sends a real-time signal with accompanying data to a specified process. +»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤ËÉÕ°¥Ç¡¼¥¿¤È¤È¤â¤Ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.\"O .SS Waiting for a Signal to be Caught +.SS ¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤ë¤Î¤òÂÔ¤Ä +.\"O The following system calls suspend execution of the calling process +.\"O or thread until a signal is caught +.\"O (or an unhandled signal terminates the process): +°Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¡¢¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤ë¤Þ¤Ç +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤òÃæÃÇ (suspend) ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +(¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤Ë¤è¤ê¤½¤Î¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿ +¾ì¹ç¤Ë¤â¼Â¹Ô¤ÎÄä»ß¤Ï½ªÎ»¤¹¤ë)¡£ +.TP 16 +.BR pause (2) +.\"O Suspends execution until any signal is caught. +²¿¤«¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤ë¤Þ¤Ç¼Â¹Ô¤òÄä»ß¤¹¤ë¡£ +.TP +.BR sigsuspend (2) +.\"O Temporarily changes the signal mask (see below) and suspends +.\"O execution until one of the unmasked signals is caught. +°ì»þŪ¤Ë¥·¥°¥Ê¥ë¥Þ¥¹¥¯ (²¼µ­»²¾È) ¤òÊѹ¹¤·¡¢ +¥Þ¥¹¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤Î¤¤¤º¤ì¤«¤¬Ê᪤µ¤ì¤ë¤Þ¤Ç +¼Â¹Ô¤òÃæÃǤ¹¤ë¡£ +.\"O .SS Synchronously Accepting a Signal +.SS ¥·¥°¥Ê¥ë¤ÎƱ´ü¼õ¿® +.\"O Rather than asynchronously catching a signal via a signal handler, +.\"O it is possible to synchronously accept the signal, that is, +.\"O to block execution until the signal is delivered, +.\"O at which point the kernel returns information about the +.\"O signal to the caller. +.\"O There are two general ways to do this: +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é·Ðͳ¤Ç¥·¥°¥Ê¥ë¤òÈóƱ´ü (asynchronously) ¤ÇÊ᪤¹¤ë°Ê³°¤Ë¤â¡¢ +¥·¥°¥Ê¥ë¤òƱ´ü (synchronously) ¤·¤Æ¼õ¤±ÉÕ¤±¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +Ʊ´ü¤·¤Æ¼õ¤±ÉÕ¤±¤ë¤È¤Ï¡¢¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¼Â¹Ô¤òÄä»ß (block) +¤¹¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£¥·¥°¥Ê¥ë¤ò¼õ¤±ÉÕ¤±¤¿ºÝ¤Ë¡¢¥«¡¼¥Í¥ë¤Ï +¤½¤Î¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤ò¸Æ¤Ó½Ð¤·¼Ô¤ËÊÖ¤¹¡£ +¤³¤ì¤ò¹Ô¤¦°ìÈÌŪ¤ÊÊýË¡¤¬Æó¤Ä¤¢¤ë¡£ +.IP * 2 +.\"O .BR sigwaitinfo (2), +.\"O .BR sigtimedwait (2), +.\"O and +.\"O .BR sigwait (3) +.\"O suspend execution until one of the signals in a specified +.\"O set is delivered. +.\"O Each of these calls returns information about the delivered signal. +.BR sigwaitinfo (2), +.BR sigtimedwait (2), +.BR sigwait (3) +¤Ï¡¢»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤Î¥·¥°¥Ê¥ë¤Î°ì¤Ä¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¼Â¹Ô¤òÃæÃǤ¹¤ë¡£ +¤É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä´Ø¿ô¤Ç¤â¡¢ÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£ +.IP * +.\"O .BR signalfd (2) +.\"O returns a file descriptor that can be used to read information +.\"O about signals that are delivered to the caller. +.\"O Each +.\"O .BR read (2) +.\"O from this file descriptor blocks until one of the signals +.\"O in the set specified in the +.\"O .BR signalfd (2) +.\"O call is delivered to the caller. +.\"O The buffer returned by +.\"O .BR read (2) +.\"O contains a structure describing the signal. +.BR signalfd (2) +¤¬ÊÖ¤¹¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»È¤¦¤È¡¢¸Æ¤Ó½Ð¤·¸µ¤ËÇÛÁ÷¤µ¤ì¤¿ +¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤òÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î +.BR read (2) +¤Ï¡¢ +.BR signalfd (2) +¤Î¸Æ¤Ó½Ð¤·»þ¤Ë»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤Î¥·¥°¥Ê¥ë¤Î°ì¤Ä¤¬¸Æ¤Ó½Ð¤·¸µ¤Ë +ÇÛÁ÷¤µ¤ì¤ë¤Þ¤ÇÄä»ß (block) ¤¹¤ë¡£ +.BR read (2) +¤¬ÊÖ¤¹¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤ò³ÊǼ¤·¤¿¹½Â¤ÂΤ¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.\"O .SS "Signal Mask and Pending Signals" +.SS ¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤È½èÍýÂÔ¤Á¥·¥°¥Ê¥ë +.\"O A signal may be +.\"O .IR blocked , +.\"O which means that it will not be delivered until it is later unblocked. +.\"O Between the time when it is generated and when it is delivered +.\"O a signal is said to be +.\"O .IR pending . +¥·¥°¥Ê¥ë¤Ï +.I "¥Ö¥í¥Ã¥¯ (block)" +¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¤È¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï +¤½¤Î¸å¥Ö¥í¥Ã¥¯¤ò²ò½ü¤µ¤ì¤ë¤Þ¤ÇÇÛÁ÷¤µ¤ì¤Ê¤¯¤Ê¤ë¡£ +¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤Æ¤«¤éÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¤Î´Ö¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï +.I "½èÍýÂÔ¤Á (pending)" +¤Ç¤¢¤ë¤È¸Æ¤Ð¤ì¤ë¡£ + +.\"O Each thread in a process has an independent +.\"O .IR "signal mask" , +.\"O which indicates the set of signals that the thread is currently blocking. +.\"O A thread can manipulate its signal mask using +.\"O .BR pthread_sigmask (3). +.\"O In a traditional single-threaded application, +.\"O .BR sigprocmask (2) +.\"O can be used to manipulate the signal mask. +¥×¥í¥»¥¹Æâ¤Î³Æ¥¹¥ì¥Ã¥É¤Ï¡¢¤½¤ì¤¾¤ìÆÈΩ¤Ê +.I "¥·¥°¥Ê¥ë¥Þ¥¹¥¯ (signal mask)" +¤ò»ý¤Ä¡£¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï¤½¤Î¥¹¥ì¥Ã¥É¤¬¸½ºß¥Ö¥í¥Ã¥¯¤·¤Æ¤¤¤ë +¥·¥°¥Ê¥ë½¸¹ç¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£ +¥¹¥ì¥Ã¥É¤Ï¡¢ +.BR pthread_sigmask (3) +¤ò»È¤Ã¤Æ¼«Ê¬¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÁàºî¤Ç¤­¤ë¡£ +ÅÁÅýŪ¤Ê¥·¥ó¥°¥ë¥¹¥ì¥Ã¥É¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +.BR sigprocmask (2) +¤ò»È¤Ã¤Æ¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÁàºî¤Ç¤­¤ë¡£ + +.\"O A child created via +.\"O .BR fork (2) +.\"O inherits a copy of its parent's signal mask; +.\"O the signal mask is preserved across +.\"O .BR execve (2). +.BR fork (2) +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÏÊÝ»ý¤µ¤ì¤ë¡£ + +.\"O A signal may be generated (and thus pending) +.\"O for a process as a whole (e.g., when sent using +.\"O .BR kill (2)) +.\"O or for a specific thread (e.g., certain signals, +.\"O such as +.\"O .B SIGSEGV +.\"O and +.\"O .BR SIGFPE , +.\"O generated as a +.\"O consequence of executing a specific machine-language instruction +.\"O are thread directed, as are signals targeted at a specific thread using +.\"O .BR pthread_kill (3)). +.\"O A process-directed signal may be delivered to any one of the +.\"O threads that does not currently have the signal blocked. +.\"O If more than one of the threads has the signal unblocked, then the +.\"O kernel chooses an arbitrary thread to which to deliver the signal. +À¸À®¤µ¤ì¤ë¥·¥°¥Ê¥ë (¤·¤¿¤¬¤Ã¤Æ½èÍýÂÔ¤Á¤È¤Ê¤ë¥·¥°¥Ê¥ë) ¤Ë¤Ï¡¢ +¥×¥í¥»¥¹Á´Âΰ¸¤Æ¤ÈÆÃÄê¤Î¥¹¥ì¥Ã¥É°¸¤Æ¤¬¤¢¤ë¡£ +Î㤨¤Ð¡¢¥×¥í¥»¥¹Á´Âΰ¸¤Æ¤Î¥·¥°¥Ê¥ë¤Ï +.BR kill (2) +¤ò»È¤Ã¤ÆÁ÷¿®¤µ¤ì¤ë¡£ +ÆÃÄê¤Î¥Þ¥·¥ó¸ì¤ÎÌ¿Îá¤Î¼Â¹Ô¤Î·ë²Ì¤È¤·¤ÆÀ¸À®¤µ¤ì¤ë¡¢ +.B SIGSEGV +¤ä +.B SIGFPE +¤Ê¤É¤Î¥·¥°¥Ê¥ë¤Ï¡¢¥¹¥ì¥Ã¥É°¸¤Æ¤È¤Ê¤ë¡£ +¤Þ¤¿¡¢ +.BR pthread_kill (3) +¤ò»È¤Ã¤ÆÆÃÄê¤Î¥¹¥ì¥Ã¥É°¸¤Æ¤ËÀ¸À®¤µ¤ì¤¿¥·¥°¥Ê¥ë¤â +¥¹¥ì¥Ã¥É°¸¤Æ¤È¤Ê¤ë¡£ +¥×¥í¥»¥¹°¸¤Æ¤Î¥·¥°¥Ê¥ë¤Ï¡¢¤½¤Î¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤·¤Æ¤¤¤Ê¤¤¥¹¥ì¥Ã¥É¤Î¤¦¤Á +¤¤¤º¤ì¤«¤Î°ì¤Ä¤ËÇÛÁ÷¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤½¤Î¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤·¤Æ¤¤¤Ê¤¤ +¥¹¥ì¥Ã¥É¤¬Ê£¿ô¤¢¤ë¾ì¹ç¡¢¥·¥°¥Ê¥ë¤òÇÛÁ÷¤¹¤ë¥¹¥ì¥Ã¥É¤Ï¥«¡¼¥Í¥ë¤¬ +̵ºî°Ù¤ËÁªÂò¤¹¤ë¡£ + +.\"O A thread can obtain the set of signals that it currently has pending +.\"O using +.\"O .BR sigpending (2). +.\"O This set will consist of the union of the set of pending +.\"O process-directed signals and the set of signals pending for +.\"O the calling thread. +¥¹¥ì¥Ã¥É¤Ï¡¢ +.BR sigpending (2) +¤ò»È¤Ã¤Æ¡¢¸½ºß½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤ò¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î½¸¹ç¤Ï¡¢¥×¥í¥»¥¹°¸¤Æ¤Î½èÍýÂÔ¤Á¥·¥°¥Ê¥ë¤È +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É°¸¤Æ¤Î¥·¥°¥Ê¥ë¤ÎξÊý¤«¤é¹½À®¤µ¤ì¤ë¡£ + +.\"O A child created via +.\"O .BR fork (2) +.\"O initially has an empty pending signal set; +.\"O the pending signal set is preserved across an +.\"O .BR execve (2). +.BR fork (2) +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ç¤Ï¡¢½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤Ï +¶õ¤Î½¸¹ç¤Ç½é´ü²½¤µ¤ì¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¡¢½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤ÏÊÝ»ý¤µ¤ì¤ë¡£ +.\"O .SS "Standard Signals" +.SS ɸ½à¥·¥°¥Ê¥ë +.\"O Linux supports the standard signals listed below. +.\"O Several signal numbers +.\"O are architecture-dependent, as indicated in the "Value" column. +.\"O (Where three values are given, the first one is usually valid for +.\"O alpha and sparc, +.\"O the middle one for ix86, ia64, ppc, s390, arm and sh, +.\"O and the last one for mips. +Linux ¤Ï°Ê²¼¤Ë¼¨¤¹É¸½à¥·¥°¥Ê¥ë¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +¥·¥°¥Ê¥ëÈÖ¹æ¤Î°ìÉô¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã°Í¸¤Ç¤¢¤ê¡¢"ÃÍ" Íó¤Ë¼¨¤¹Ä̤ê¤Ç¤¢¤ë¡£ +(3¤Ä¤ÎÃͤ¬½ñ¤«¤ì¤Æ¤¤¤ë¤â¤Î¤Ï¡¢ 1¤ÄÌܤ¬ alpha ¤È sparc ¤ÇÄ̾ïÍ­¸ú¤ÊÃÍ¡¢ +¿¿¤óÃ椬 ix86, ia64, ppc, s390, arm, sh ¤Ç¤ÎÃÍ¡¢ºÇ¸å¤¬ mips ¤Ç¤ÎÃͤǤ¢¤ë¡£ +.\" parisc is a law unto itself +.\"O A \- denotes that a signal is absent on the corresponding architecture.) +\- ¤Ï¤½¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤¤¤ÆÂбþ¤¹¤ë¥·¥°¥Ê¥ë¤¬¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£) + +.\"O First the signals described in the original POSIX.1-1990 standard. +ºÇ½é¤Ë¡¢POSIX.1-1990 ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤ò¼¨¤¹¡£ +.TS +l c c l +____ +lB c c l. +.\"O Signal Value Action Comment +¥·¥°¥Ê¥ë ÃÍ Æ°ºî ¥³¥á¥ó¥È +.\"O SIGHUP \01 Term Hangup detected on controlling terminal +.\"O or death of controlling process +SIGHUP \01 Term T{ +À©¸æüËö(controlling terminal)¤Î¥Ï¥ó¥°¥¢¥Ã¥×¸¡½Ð¡¢ +¤Þ¤¿¤ÏÀ©¸æ¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î»à +T} +.\"O SIGINT \02 Term Interrupt from keyboard +.\"O SIGQUIT \03 Core Quit from keyboard +.\"O SIGILL \04 Core Illegal Instruction +.\"O SIGABRT \06 Core Abort signal from \fBabort\fP(3) +.\"O SIGFPE \08 Core Floating point exception +.\"O SIGKILL \09 Term Kill signal +SIGINT \02 Term ¥­¡¼¥Ü¡¼¥É¤«¤é¤Î³ä¤ê¹þ¤ß (Interrupt) +SIGQUIT \03 Core ¥­¡¼¥Ü¡¼¥É¤Ë¤è¤ëÃæ»ß (Quit) +SIGILL \04 Core ÉÔÀµ¤ÊÌ¿Îá +SIGABRT \06 Core \fBabort\fP(3) ¤«¤é¤ÎÃæÃÇ (Abort) ¥·¥°¥Ê¥ë +SIGFPE \08 Core ÉâÆ°¾®¿ôÅÀÎã³° +SIGKILL \09 Term Kill ¥·¥°¥Ê¥ë +.\"O SIGSEGV 11 Core Invalid memory reference +.\"O SIGPIPE 13 Term Broken pipe: write to pipe with no +.\"O readers +.\"O SIGALRM 14 Term Timer signal from \fBalarm\fP(2) +.\"O SIGTERM 15 Term Termination signal +SIGSEGV 11 Core ÉÔÀµ¤Ê¥á¥â¥ê»²¾È +SIGPIPE 13 Term ¥Ñ¥¤¥×Ç˲õ: Æɤ߼ê¤Î̵¤¤¥Ñ¥¤¥×¤Ø¤Î½ñ¤­½Ð¤· +SIGALRM 14 Term \fBalarm\fP(2) ¤«¤é¤Î¥¿¥¤¥Þ¡¼¥·¥°¥Ê¥ë +SIGTERM 15 Term ½ªÎ» (termination) ¥·¥°¥Ê¥ë +.\"O SIGUSR1 30,10,16 Term User-defined signal 1 +.\"O SIGUSR2 31,12,17 Term User-defined signal 2 +.\"O SIGCHLD 20,17,18 Ign Child stopped or terminated +.\"O SIGCONT 19,18,25 Cont Continue if stopped +SIGUSR1 30,10,16 Term ¥æ¡¼¥¶ÄêµÁ¥·¥°¥Ê¥ë 1 +SIGUSR2 31,12,17 Term ¥æ¡¼¥¶ÄêµÁ¥·¥°¥Ê¥ë 2 +SIGCHLD 20,17,18 Ign »Ò¥×¥í¥»¥¹¤Î°ì»þÄä»ß (stop) ¤Þ¤¿¤Ï½ªÎ» +SIGCONT 19,18,25 Cont °ì»þÄä»ß (stop) ¤«¤é¤ÎºÆ³« +.\"O SIGSTOP 17,19,23 Stop Stop process +.\"O SIGTSTP 18,20,24 Stop Stop typed at tty +.\"O SIGTTIN 21,21,26 Stop tty input for background process +.\"O SIGTTOU 22,22,27 Stop tty output for background process +SIGSTOP 17,19,23 Stop ¥×¥í¥»¥¹¤Î°ì»þÄä»ß (stop) +SIGTSTP 18,20,24 Stop üËö (tty) ¤è¤êÆþÎϤµ¤ì¤¿°ì»þÄä»ß (stop) +SIGTTIN 21,21,26 Stop ¥Ð¥Ã¥¯¥°¥é¥ó¥É¥×¥í¥»¥¹¤Î tty ÆþÎÏ +SIGTTOU 22,22,27 Stop ¥Ð¥Ã¥¯¥°¥é¥ó¥É¥×¥í¥»¥¹¤Î tty ½ÐÎÏ +.TE + +.\"O The signals +.\"O .B SIGKILL +.\"O and +.\"O .B SIGSTOP +.\"O cannot be caught, blocked, or ignored. +¥·¥°¥Ê¥ë +.B SIGKILL +¤È +.B SIGSTOP +¤Ï¥­¥ã¥Ã¥Á¡¢¥Ö¥í¥Ã¥¯¡¢Ìµ»ë¤Ç¤­¤Ê¤¤¡£ + +.\"O Next the signals not in the POSIX.1-1990 standard but described in +.\"O SUSv2 and POSIX.1-2001. +¼¡¤Ë¡¢ POSIX.1-1990 ɸ½à¤Ë¤Ï¤Ê¤¤¤¬¡¢ SUSv2 ¤È +POSIX.1-2001 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤ò¼¨¤¹¡£ +.TS +l c c l +____ +lB c c l. +.\"O Signal Value Action Comment +¥·¥°¥Ê¥ë ÃÍ Æ°ºî ¥³¥á¥ó¥È +.\"O SIGBUS 10,7,10 Core Bus error (bad memory access) +.\"O SIGPOLL Term Pollable event (Sys V). +.\"O Synonym for \fBSIGIO\fP +.\"O SIGPROF 27,27,29 Term Profiling timer expired +SIGBUS 10,7,10 Core ¥Ð¥¹¥¨¥é¡¼ (ÉÔÀµ¤Ê¥á¥â¥ê¥¢¥¯¥»¥¹) +SIGPOLL Term ¥Ý¡¼¥ê¥ó¥°²Äǽ¤Ê¥¤¥Ù¥ó¥È (Sys V)¡£ + \fBSIGIO\fP ¤ÈƱµÁ +SIGPROF 27,27,29 Term profiling ¥¿¥¤¥Þ¤Î»þ´ÖÀÚ¤ì +.\"O SIGSYS 12,31,12 Core Bad argument to routine (SVr4) +.\"O SIGTRAP 5 Core Trace/breakpoint trap +.\"O SIGURG 16,23,21 Ign Urgent condition on socket (4.2BSD) +SIGSYS 12,31,12 Core ¥ë¡¼¥Á¥ó¤Ø¤Î°ú¤­¿ô¤¬ÉÔÀµ (SVr4) +SIGTRAP 5 Core ¥È¥ì¡¼¥¹/¥Ö¥ì¡¼¥¯¥Ý¥¤¥ó¥È ¥È¥é¥Ã¥× +SIGURG 16,23,21 Ign T{ +¥½¥±¥Ã¥È¤Î¶ÛµÞ»öÂÖ (urgent condition) (4.2BSD) +T} +.\"O SIGVTALRM 26,26,28 Term Virtual alarm clock (4.2BSD) +.\"O SIGXCPU 24,24,30 Core CPU time limit exceeded (4.2BSD) +.\"O SIGXFSZ 25,25,31 Core File size limit exceeded (4.2BSD) +SIGVTALRM 26,26,28 Term ²¾ÁÛ¥¢¥é¡¼¥à¥¯¥í¥Ã¥¯ (4.2BSD) +SIGXCPU 24,24,30 Core CPU»þ´ÖÀ©¸ÂĶ²á (4.2BSD) +SIGXFSZ 25,25,31 Core ¥Õ¥¡¥¤¥ë¥µ¥¤¥ºÀ©¸Â¤ÎĶ²á (4.2BSD) +.TE + +.\"O Up to and including Linux 2.2, the default behavior for +.\"O .BR SIGSYS ", " SIGXCPU ", " SIGXFSZ ", " +.\"O and (on architectures other than SPARC and MIPS) +.\"O .B SIGBUS +.\"O was to terminate the process (without a core dump). +.\"O (On some other Unix systems the default action for +.\"O .BR SIGXCPU " and " SIGXFSZ +.\"O is to terminate the process without a core dump.) +.\"O Linux 2.4 conforms to the POSIX.1-2001 requirements for these signals, +.\"O terminating the process with a core dump. +Linux 2.2 °ÊÁ°¤Ç¤Ï¡¢ +.BR SIGSYS ", " SIGXCPU ", " SIGXFSZ +¤ª¤è¤Ó SPARC ¤È MIPS °Ê³°¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Î +.B SIGBUS +¤Î¥Ç¥Õ¥©¥ë¥È¤Î¿¶¤ëÉñ¤¤¤Ï (¥³¥¢¥À¥ó¥×½ÐÎϤʤ·¤Î) ¥×¥í¥»¥¹½ªÎ»¤Ç¤¢¤Ã¤¿¡£ +(¾¤Î Unix ¥·¥¹¥Æ¥à¤Ë¤â +.BR SIGXCPU " ¤È " SIGXFSZ +¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤¬¥³¥¢¥À¥ó¥×¤Ê¤·¤Î¥×¥í¥»¥¹½ªÎ»¤Î¤â¤Î¤¬¤¢¤ë¡£) +Linux 2.4 ¤Ç¤Ï¡¢POSIX.1-2001 ¤Ç¤ÎÍ×µá»ÅÍͤ˽àµò¤·¤Æ¡¢ +¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤Ç¡¢¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¡¢¥³¥¢¥À¥ó¥×¤ò½ÐÎϤ¹¤ë +¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ + +.\"O Next various other signals. +¼¡¤Ë¤½¤Î¾¤Î³Æ¼ï¥·¥°¥Ê¥ë¤ò¼¨¤¹¡£ +.TS +l c c l +____ +lB c c l. +.\"O Signal Value Action Comment +¥·¥°¥Ê¥ë ÃÍ Æ°ºî ¥³¥á¥ó¥È +.\"O SIGIOT 6 Core IOT trap. A synonym for \fBSIGABRT\fP +.\"O SIGEMT 7,\-,7 Term +.\"O SIGSTKFLT \-,16,\- Term Stack fault on coprocessor (unused) +.\"O SIGIO 23,29,22 Term I/O now possible (4.2BSD) +.\"O SIGCLD \-,\-,18 Ign A synonym for \fBSIGCHLD\fP +SIGIOT 6 Core IOT ¥È¥é¥Ã¥×¡£\fBSIGABRT\fP ¤ÈƱµÁ +SIGEMT 7,\-,7 Term +SIGSTKFLT \-,16,\- A T{ +¿ôÃͱ黻¥×¥í¥»¥Ã¥µ¤Ë¤ª¤±¤ë¥¹¥¿¥Ã¥¯¥Õ¥©¥ë¥È (̤»ÈÍÑ) +T} +SIGIO 23,29,22 Term Æþ½ÐÎϤ¬²Äǽ¤Ë¤Ê¤Ã¤¿ (4.2BSD) +SIGCLD \-,\-,18 Ign \fBSIGCHLD\fP ¤ÈƱµÁ +.\"O SIGPWR 29,30,19 Term Power failure (System V) +.\"O SIGINFO 29,\-,\- A synonym for \fBSIGPWR\fP +.\"O SIGLOST \-,\-,\- Term File lock lost +.\"O SIGWINCH 28,28,20 Ign Window resize signal (4.3BSD, Sun) +.\"O SIGUNUSED \-,31,\- Core Synonymous with \fBSIGSYS\fP +SIGPWR 29,30,19 Term ÅŸ»ÁÓ¼º (Power failure) (System V) +SIGINFO 29,\-,\- \fBSIGPWR\fP ¤ÈƱµÁ +SIGLOST \-,\-,\- Term ¥Õ¥¡¥¤¥ë¥í¥Ã¥¯¤¬¼º¤ï¤ì¤¿ +SIGWINCH 28,28,20 Ign T{ +¥¦¥£¥ó¥É¥¦ ¥ê¥µ¥¤¥º ¥·¥°¥Ê¥ë (4.3BSD, Sun) +T} +SIGUNUSED \-,31,\- Core \fBSIGSYS\fP ¤ÈƱµÁ +.TE + +.\"O (Signal 29 is +.\"O .B SIGINFO +.\"O / +.\"O .B SIGPWR +.\"O on an alpha but +.\"O .B SIGLOST +.\"O on a sparc.) +(¥·¥°¥Ê¥ë 29 ¤Ï alpha ¤Ç¤Ï +.B SIGINFO +/ +.B SIGPWR +¤À¤¬¡¢sparc ¤Ç¤Ï +.B SIGLOST +¤Ç¤¢¤ë¡£) + +.\"O .B SIGEMT +.\"O is not specified in POSIX.1-2001, but nevertheless appears +.\"O on most other Unix systems, +.\"O where its default action is typically to terminate +.\"O the process with a core dump. +.B SIGEMT +¤Ï POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +¤½¤Î¾¤Î¿¤¯¤Î Unix ¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¿¤¯¤Î¾ì¹ç¡¢¥³¥¢¥À¥ó¥×½ÐÎϤòȼ¤¦¥×¥í¥»¥¹¤Î½ªÎ»¤Ç¤¢¤ë¡£ + +.\"O .B SIGPWR +.\"O (which is not specified in POSIX.1-2001) is typically ignored +.\"O by default on those other Unix systems where it appears. +.B SIGPWR +¤Ï (POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬) ¤³¤Î¥·¥°¥Ê¥ë¤¬Â¸ºß¤¹¤ë +¾¤Î Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¿¤¯¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥ÈÆ°ºî¤Ï̵»ë¤Ç¤¢¤ë¡£ + +.\"O .B SIGIO +.\"O (which is not specified in POSIX.1-2001) is ignored by default +.\"O on several other Unix systems. +.B SIGIO +¤Ï (POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬) ¤¤¤¯¤Ä¤«¤Î¾¤Î Unix ¥·¥¹¥Æ¥à¤Ç¤Ï +¥Ç¥Õ¥©¥ë¥ÈÆ°ºî¤Ï̵»ë¤Ç¤¢¤ë¡£ + +.\"O Where defined, +.\"O .B SIGUNUSED +.\"O is synonymous with +.\"O .\" parisc is the only exception: SIGSYS is 12, SIGUNUSED is 31 +.\"O .B SIGSYS +.\"O on most architectures. +.B SIGUNUSED +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤Û¤È¤ó¤É¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç +.B SIGSYS +¤ÎƱµÁ¸ì¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" parisc is the only exception: SIGSYS is 12, SIGUNUSED is 31 +.\"O .SS "Real-time Signals" +.SS ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë +.\"O Linux supports real-time signals as originally defined in the POSIX.1b +.\"O real-time extensions (and now included in POSIX.1-2001). +Linux ¤Ï¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ï¸µ¡¹ POSIX.1b ¤Î¥ê¥¢¥ë¥¿¥¤¥à³ÈÄ¥¤ÇÄêµÁ¤µ¤ì¤Æ +¤¤¤ë¤â¤Î¤Ç¤¢¤ê¡¢¸½ºß¤Ç¤Ï POSIX.1-2001 ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.\"O The range of supported real-time signals is defined by the macros +.\"O .B SIGRTMIN +.\"O and +.\"O .BR SIGRTMAX . +.\"O POSIX.1-2001 requires that an implementation support at least +.\"O .B _POSIX_RTSIG_MAX +.\"O (8) real-time signals. +Âбþ¤·¤Æ¤¤¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÈϰϤϡ¢¥Þ¥¯¥í +.B SIGRTMIN +¤È +.B SIGRTMAX +¤ÇÄêµÁ¤µ¤ì¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢¾¯¤Ê¤¯¤È¤â +.B _POSIX_RTSIG_MAX +(8) ¸Ä¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ËÂбþ¤·¤¿¼ÂÁõ¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O The Linux kernel supports a range of 32 different real-time +.\"O signals, numbered 33 to 64. +.\"O However, the glibc POSIX threads implementation internally uses +.\"O two (for NPTL) or three (for LinuxThreads) real-time signals +.\"O (see +.\"O .BR pthreads (7)), +.\"O and adjusts the value of +.\"O .B SIGRTMIN +.\"O suitably (to 34 or 35). +Linux ¤Ï¡¢32 ¸Ä¤Î°Û¤Ê¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ËÂбþ¤·¤Æ¤ª¤ê¡¢ +¤½¤ÎÈÖ¹æ¤Ï 33 ¤«¤é 64 ¤Ç¤¢¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢glibc ¤Î POSIX ¥¹¥ì¥Ã¥É¼ÂÁõ¤Ï¡¢ +ÆâÉô¤Ç 2¸Ä (NPTL ¤Î¾ì¹ç) ¤« 3¸Ä (LinuxThreads ¤Î¾ì¹ç) ¤Î +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ò»ÈÍѤ·¤Æ¤ª¤ê +.RB ( pthreads (7) +»²¾È)¡¢ +.B SIGRTMIN +¤ÎÃͤòŬÀÚ¤Ë (34 ¤« 35 ¤Ë) Ä´À°¤¹¤ë¡£ +.\"O Because the range of available real-time signals varies according +.\"O to the glibc threading implementation (and this variation can occur +.\"O at run time according to the available kernel and glibc), +.\"O and indeed the range of real-time signals varies across Unix systems, +.\"O programs should +.\"O .IR "never refer to real-time signals using hard-coded numbers" , +.\"O but instead should always refer to real-time signals using the notation +.\"O .BR SIGRTMIN +n, +.\"O and include suitable (run-time) checks that +.\"O .BR SIGRTMIN +n +.\"O does not exceed +.\"O .BR SIGRTMAX . +ÍøÍѲÄǽ¤Ê¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÈÏ°Ï¤Ï glibc ¤Î¥¹¥ì¥Ã¥É¼ÂÁõ¤Ë¤è¤ê +°Û¤Ê¤ë¤· (»ÈÍѤ¹¤ë¥«¡¼¥Í¥ë¤È glibc ¤Ë¤è¤ê¼Â¹Ô»þ¤Ë¤âÊѲ½¤¹¤ë)¡¢ +Unix ¥·¥¹¥Æ¥à¤Î¼ïÎà¤Ë¤è¤Ã¤Æ¤â°Û¤Ê¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +¥×¥í¥°¥é¥à¤Ç¤Ï¡Ö¥Ï¡¼¥É¥³¡¼¥Ç¥£¥ó¥°¤·¤¿¿ô»ú¤ò»È¤Ã¤Æ¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î +»²¾È¤Ï·è¤·¤Æ¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¯¡×¡¢Âå¤ï¤ê¤Ë +.BR SIGRTMIN +n +¤Î·Á¤Ç»²¾È¤¹¤Ù¤­¤Ç¤¢¤ë¡£¤Þ¤¿¡¢ +.BR SIGRTMIN +n +¤¬ +.B SIGRTMAX +¤òĶ¤¨¤Æ¤¤¤Ê¤¤¤«¤Î¥Á¥§¥Ã¥¯¤ò (¼Â¹Ô»þ¤Ë) ŬÀڤ˹Ԥ¦¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.\"O Unlike standard signals, real-time signals have no predefined meanings: +.\"O the entire set of real-time signals can be used for application-defined +.\"O purposes. +.\"O (Note, however, that the LinuxThreads implementation uses the first +.\"O three real-time signals.) +ɸ½à¥·¥°¥Ê¥ë¤È°Û¤Ê¤ê¡¢¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ë¤Ï +»öÁ°¤ËÄêµÁ¤µ¤ì¤¿°ÕÌ£¤Ï¤Ê¤¤¡£ +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÁ´Éô¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÄêµÁ¤·¤¿ÍÑÅӤ˻Ȥ¨¤ë¡£ +(⤷¡¢LinuxThreads ¼ÂÁõ¤Ç¡¢¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÈÖ¹æ¤Î¤¦¤Á +ºÇ½é¤Î 3¤Ä¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È) +.PP +.\"O The default action for an unhandled real-time signal is to terminate the +.\"O receiving process. +¥Ï¥ó¥É¥ê¥ó¥°¤·¤Ê¤¤¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï +¼õ¿®¤·¤¿¥×¥í¥»¥¹¤Î½ªÎ»¤Ç¤¢¤ë¡£ +.PP +.\"O Real-time signals are distinguished by the following: +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ï°Ê²¼¤ÎÆÃħ¤¬¤¢¤ë: +.IP 1. 4 +.\"O Multiple instances of real-time signals can be queued. +.\"O By contrast, if multiple instances of a standard signal are delivered +.\"O while that signal is currently blocked, then only one instance is queued. +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÏÊ£¿ô¤Î¼ÂÂΤò¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°ìÊý¡¢É¸½à¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢¤½¤Î¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë´Ö¤Ë +Ʊ¤¸¥·¥°¥Ê¥ë¤ÎÊ£¿ô¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤¬ÇÛÁ÷¤µ¤ì¤Æ¤â¡¢ +1 ¤Ä¤À¤±¤¬¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¡£ +.IP 2. 4 +.\"O If the signal is sent using +.\"O .BR sigqueue (2), +.\"O an accompanying value (either an integer or a pointer) can be sent +.\"O with the signal. +¥·¥°¥Ê¥ë¤¬ +.BR sigqueue (2) +¤òÍѤ¤¤ÆÁ÷¿®¤µ¤ì¤¿¾ì¹ç¡¢ +ÉÕ°¥Ç¡¼¥¿ (À°¿ô¤«¥Ý¥¤¥ó¥¿) ¤ò¥·¥°¥Ê¥ë¤È¶¦¤ËÁ÷¿®¤Ç¤­¤ë¡£ +.\"O If the receiving process establishes a handler for this signal using the +.\"O .B SA_SIGINFO +.\"O flag to +.\"O .BR sigaction (2) +.\"O then it can obtain this data via the +.\"O .I si_value +.\"O field of the +.\"O .I siginfo_t +.\"O structure passed as the second argument to the handler. +¼õ¿®Â¦¥×¥í¥»¥¹¤¬ +.BR sigaction (2) +¤Ë +.B SA_SIGINFO +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤷ¤¿¾ì¹ç¡¢ +¤³¤Î¥Ç¡¼¥¿¤Ï +.I siginfo_t +¹½Â¤ÂΤΠ+.I si_value +¥Õ¥£¡¼¥ë¥É·Ðͳ¤Ç¥Ï¥ó¥É¥é¤ÎÂè 2 °ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¡¢ +ÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O Furthermore, the +.\"O .I si_pid +.\"O and +.\"O .I si_uid +.\"O fields of this structure can be used to obtain the PID +.\"O and real user ID of the process sending the signal. +¤µ¤é¤Ë¡¢¤³¤Î¹½Â¤ÂΤΠ+.I si_pid +¤È +.I si_uid +¥Õ¥£¡¼¥ë¥É¤Ç¥·¥°¥Ê¥ë¤òÁ÷¿®¤·¤¿¥×¥í¥»¥¹¤Î PID ¤È¼Â¥æ¡¼¥¶ ID ¤ò +ÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.IP 3. 4 +.\"O Real-time signals are delivered in a guaranteed order. +.\"O Multiple real-time signals of the same type are delivered in the order +.\"O they were sent. +.\"O If different real-time signals are sent to a process, they are delivered +.\"O starting with the lowest-numbered signal. +.\"O (I.e., low-numbered signals have highest priority.) +.\"O By contrast, if multiple standard signals are pending for a process, +.\"O the order in which they are delivered is unspecified. +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ç¤ÏÇÛÁ÷¤µ¤ì¤ë½ç½ø¤¬Êݾڤµ¤ì¤ë¡£ +Ʊ¤¸¥¿¥¤¥×¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÏÁ÷¿®¤µ¤ì¤¿½çÈÖ¤ËÅþÃ夹¤ë¡£ +°Û¤Ê¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤¬°ì¤Ä¤Î¥×¥í¥»¥¹¤ËÁ÷¿®¤µ¤ì¤¿¾ì¹ç¡¢ +ÈÖ¹æ¤Î¾®¤µ¤¤¥·¥°¥Ê¥ë¤«¤éÀè¤ËÅþÃ夹¤ë¡£ +(¤Ä¤Þ¤ê¾®¤µ¤¤ÈÖ¹æ¤Î¥·¥°¥Ê¥ë¤¬¹â¤¤Í¥Àè½ç°Ì¤ò»ý¤Ä¡£) +ÂоÈŪ¤Ë¡¢°ì¤Ä¤Î¥×¥í¥»¥¹¤ËÂФ·¤ÆÊ£¿ô¤Îɸ½à¥·¥°¥Ê¥ë¤¬½èÍýÂÔ¤Á¤È¤Ê¤Ã¤¿¾ì¹ç¡¢ +¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë½ç½ø¤ÏÉÔÄê¤Ç¤¢¤ë¡£ +.PP +.\"O If both standard and real-time signals are pending for a process, +.\"O POSIX leaves it unspecified which is delivered first. +.\"O Linux, like many other implementations, gives priority +.\"O to standard signals in this case. +°ì¤Ä¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æɸ½à¥·¥°¥Ê¥ë¤È¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎξÊý¤¬ +½èÍýÂÔ¤Á¤Î¾ì¹ç¡¢POSIX ¤Ï¤É¤Á¤é¤¬Àè¤ËÇÛÁ÷¤µ¤ì¤ë¤«¤òµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£ +Linux ¤Ç¤Ï¡¢Â¾¤Î¿¤¯¤Î¼ÂÁõ¤ÈƱÍÍ¡¢¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï +ɸ½à¥·¥°¥Ê¥ë¤¬Í¥À褵¤ì¤ë¡£ +.PP +.\"O According to POSIX, an implementation should permit at least +.\"O .B _POSIX_SIGQUEUE_MAX +.\"O (32) real-time signals to be queued to +.\"O a process. +POSIX ¤Ë¤è¤ì¤Ð¡¢1 ¥×¥í¥»¥¹Ëè¤ËºÇÄã +.B _POSIX_SIGQUEUE_MAX +(32) ¸Ä¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ò¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¤Ù¤­¤È¤·¤Æ¤¤¤ë¡£ +.\"O However, Linux does things differently. +.\"O In kernels up to and including 2.6.7, Linux imposes +.\"O a system-wide limit on the number of queued real-time signals +.\"O for all processes. +¤·¤«¤·¡¢ Linux ¤Ç¤Ï°ã¤Ã¤¿¼ÂÁõ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£¥«¡¼¥Í¥ë 2.6.7 ¤Þ¤Ç¤Ï +(2.6.7 ¤ò´Þ¤à)¡¢Á´¥×¥í¥»¥¹¤Ç¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë +¤Î¿ô¤Î¹ç·×¤Ë¤Ä¤¤¤Æ¥·¥¹¥Æ¥àÁ´ÂΤǤÎÀ©¸Â¤¬¤¢¤ë¡£ +.\"O This limit can be viewed and (with privilege) changed via the +.\"O .I /proc/sys/kernel/rtsig-max +.\"O file. +.\"O A related file, +.\"O .IR /proc/sys/kernel/rtsig-nr , +.\"O can be used to find out how many real-time signals are currently queued. +¤³¤ÎÀ©¸Â¤Ï +.I /proc/sys/kernel/rtsig-max +¥Õ¥¡¥¤¥ë¤Ç¸«¤ë¤³¤È¤¬¤Ç¤­¡¢ (¸¢¸Â¤¬¤¢¤ì¤Ð) Êѹ¹¤â¤Ç¤­¤ë¡£ +´Ø·¸¤¹¤ë¥Õ¥¡¥¤¥ë¤È¤·¤Æ¡¢ +.I /proc/sys/kernel/rtsig-nr +¤ò¸«¤ë¤³¤È¤Ç¡¢¤¤¤¯¤Ä¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤¬¸½ºß¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¤«¤ò +ÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.\"O In Linux 2.6.8, these +.\"O .I /proc +.\"O interfaces were replaced by the +.\"O .B RLIMIT_SIGPENDING +.\"O resource limit, which specifies a per-user limit for queued +.\"O signals; see +.\"O .BR setrlimit (2) +.\"O for further details. +Linux 2.6.8 ¤Ç¡¢¤³¤ì¤é¤Î +.I /proc +·Ðͳ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï¡¢ +.B RLIMIT_SIGPENDING +¥ê¥½¡¼¥¹À©¸Â¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +¤³¤ì¤Ï¡¢¥­¥å¡¼¤ËÆþ¤ë¥·¥°¥Ê¥ë¿ô¤Ë´Ø¤·¤Æ¥æ¡¼¥¶Ã±°Ì¤Ë +¾å¸Â¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¾Ü¤·¤¯¤Ï +.BR setrlimit (2) +¤ò»²¾È¡£ +.\"O .SS "Async-signal-safe functions" +.SS "ÈóƱ´ü¥·¥°¥Ê¥ë¤Ç°ÂÁ´¤Ê´Ø¿ô (async-signal-safe functions)" +.PP +.\"O A signal handling routine established by +.\"O .BR sigaction (2) +.\"O or +.\"O .BR signal (2) +.\"O must be very careful, since processing elsewhere may be interrupted +.\"O at some arbitrary point in the execution of the program. +.\"O POSIX has the concept of "safe function". +.\"O If a signal interrupts the execution of an unsafe function, and +.\"O .I handler +.\"O calls an unsafe function, then the behavior of the program is undefined. +¾¤Î¾ì½ê¤Î½èÍý¤Ï¥×¥í¥°¥é¥à¼Â¹Ô¤ÎǤ°Õ¤Î²Õ½ê¤ÇÃæÃǤµ¤ì¤ë¤¿¤á¡¢ +.BR sigaction (2) +¤ä +.BR signal (2) +¤ÇÅÐÏ¿¤¹¤ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Ë¤ÏÈó¾ï¤ËÃí°Õ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +POSIX ¤Ë¤Ï¡Ö°ÂÁ´¤Ê´Ø¿ô (safe function)¡×¤È¤¤¤¦³µÇ°¤¬¤¢¤ë¡£ +¥·¥°¥Ê¥ë¤¬°ÂÁ´¤Ç¤Ê¤¤´Ø¿ô¤Î¼Â¹Ô¤òÃæÃǤ·¡¢¤«¤Ä +.I handler +¤¬°ÂÁ´¤Ç¤Ê¤¤´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¡¢¥×¥í¥°¥é¥à¤ÎµóÆ°¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ + +.\"O POSIX.1-2004 (also known as POSIX.1-2001 Technical Corrigendum 2) +.\"O requires an implementation to guarantee that the following +.\"O functions can be safely called inside a signal handler: +POSIX.1-2004 (POSIX.1-2001 Technical Corrigendum (Àµ¸íɽ) 2 ¤È¤â¸À¤¦) ¤Ç¤Ï¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥éÆâ¤Ç¤Î°ÂÁ´¤Ê¸Æ¤Ó½Ð¤·¤òÊݾڤ¹¤ë¤³¤È¤¬É¬¿Ü¤Î´Ø¿ô¤È¤·¤Æ +°Ê²¼¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +.in +4 +.nf +_Exit() +_exit() +abort() +accept() +access() +aio_error() +aio_return() +aio_suspend() +alarm() +bind() +cfgetispeed() +cfgetospeed() +cfsetispeed() +cfsetospeed() +chdir() +chmod() +chown() +clock_gettime() +close() +connect() +creat() +dup() +dup2() +execle() +execve() +fchmod() +fchown() +fcntl() +fdatasync() +fork() +fpathconf() +fstat() +fsync() +ftruncate() +getegid() +geteuid() +getgid() +getgroups() +getpeername() +getpgrp() +getpid() +getppid() +getsockname() +getsockopt() +getuid() +kill() +link() +listen() +lseek() +lstat() +mkdir() +mkfifo() +open() +pathconf() +pause() +pipe() +poll() +posix_trace_event() +pselect() +raise() +read() +readlink() +recv() +recvfrom() +recvmsg() +rename() +rmdir() +select() +sem_post() +send() +sendmsg() +sendto() +setgid() +setpgid() +setsid() +setsockopt() +setuid() +shutdown() +sigaction() +sigaddset() +sigdelset() +sigemptyset() +sigfillset() +sigismember() +signal() +sigpause() +sigpending() +sigprocmask() +sigqueue() +sigset() +sigsuspend() +sleep() +sockatmark() +socket() +socketpair() +stat() +symlink() +sysconf() +tcdrain() +tcflow() +tcflush() +tcgetattr() +tcgetpgrp() +tcsendbreak() +tcsetattr() +tcsetpgrp() +time() +timer_getoverrun() +timer_gettime() +timer_settime() +times() +umask() +uname() +unlink() +utime() +wait() +waitpid() +write() +.fi +.in +.PP +.\"O POSIX.1-2008 removes fpathconf(), pathconf(), and sysconf() +.\"O from the above list, and adds the following functions: +POSIX.1-2008 ¤Ç¤Ï¡¢¾åµ­¤Î¥ê¥¹¥È¤Î¤¦¤Á fpathconf(), pathconf(), sysconf() +¤¬ºï½ü¤µ¤ì¡¢°Ê²¼¤Î´Ø¿ô¤¬Äɲ䵤줿¡£ +.PP +.in +4n +.nf +execl() +execv() +faccessat() +fchmodat() +fchownat() +fexecve() +fstatat() +futimens() +linkat() +mkdirat() +mkfifoat() +mknod() +mknodat() +openat() +readlinkat() +renameat() +symlinkat() +unlinkat() +utimensat() +utimes() +.fi +.in +.\"O .SS Interruption of System Calls and Library Functions by Signal Handlers +.SS ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ø¤Î³ä¤ê¹þ¤ß +.\"O If a signal handler is invoked while a system call or library +.\"O function call is blocked, then either: +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê¤¬Ää»ß (block) ¤·¤Æ¤¤¤ë´Ö¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ +µ¯Æ°¤µ¤ì¤ë¤È¡¢°Ê²¼¤Î¤É¤Á¤é¤«¤È¤Ê¤ë¡£ +.IP * 2 +.\"O the call is automatically restarted after the signal handler returns; or +¥·¥°¥Ê¥ë¤¬Ê֤俸塢¸Æ¤Ó½Ð¤·¤Ï¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¡£ +.IP * +.\"O the call fails with the error +.\"O .BR EINTR . +¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¡£ +.PP +.\"O Which of these two behaviors occurs depends on the interface and +.\"O whether or not the signal handler was established using the +.\"O .BR SA_RESTART +.\"O flag (see +.\"O .BR sigaction (2)). +.\"O The details vary across Unix systems; +.\"O below, the details for Linux. +¤³¤ì¤é¤ÎÆó¤Ä¤ÎµóÆ°¤Î¤¦¤Á¤É¤Á¤é¤¬µ¯¤³¤ë¤«¤Ï¡¢¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ë¤è¤ê°Í¸¤·¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ +.B SA_RESTART +¥Õ¥é¥° +.RB ( sigaction (2) +»²¾È) ¤ò»È¤Ã¤ÆÀßÄꤵ¤ì¤Æ¤¤¤¿¤«¤Ë¤â°Í¸¤¹¤ë¡£ +¾ÜºÙ¤Ï Unix ¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +Linux ¤Ë¤ª¤±¤ë¾ÜºÙ¤ò°Ê²¼¤ÇÀâÌÀ¤¹¤ë¡£ + +.\"O If a blocked call to one of the following interfaces is interrupted +.\"O by a signal handler, then the call will be automatically restarted +.\"O after the signal handler returns if the +.\"O .BR SA_RESTART +.\"O flag was used; otherwise the call will fail with the error +.\"O .BR EINTR : +.\"O .\" The following system calls use ERESTARTSYS, +.\"O .\" so that they are restartable +°Ê²¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Î¤¤¤º¤ì¤«¤Î¸Æ¤Ó½Ð¤·¤¬Ää»ß¤·¤Æ¤¤¤ë´Ö¤Ë +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢ +.B SA_RESTART +¥Õ¥é¥°¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ì¤Ð¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬Ê֤俸å¤Ë +¤½¤Î¸Æ¤Ó½Ð¤·¤Ï¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¤½¤Î¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.\" °Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï ERESTARTSYS ¤ò»È¤Ã¤Æ¤¤¤ë¡£ +.\" ¤½¤Î¤¿¤á¡¢¤³¤ì¤é¤ÏºÆ¥¹¥¿¡¼¥È¤¬²Äǽ¤Ç¤¢¤ë¡£ +.RS 4 +.IP * 2 +.\"O .BR read (2), +.\"O .BR readv (2), +.\"O .BR write (2), +.\"O .BR writev (2), +.\"O and +.\"O .BR ioctl (2) +.\"O calls on "slow" devices. +.\"O A "slow" device is one where the I/O call may block for an +.\"O indefinite time, for example, a terminal, pipe, or socket. +.\"O (A disk is not a slow device according to this definition.) +.\"O If an I/O call on a slow device has already transferred some +.\"O data by the time it is interrupted by a signal handler, +.\"O then the call will return a success status +.\"O (normally, the number of bytes transferred). +.BR read (2), +.BR readv (2), +.BR write (2), +.BR writev (2), +.BR ioctl (2) +¤Î¡ÖÃÙ¤¤ (slow)¡×¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë¸Æ¤Ó½Ð¤·¡£ +¤³¤³¤Ç¤¤¤¦¡ÖÃÙ¤¤¡×¥Ç¥Ð¥¤¥¹¤È¤Ï¡¢I/O ¸Æ¤Ó½Ð¤·¤¬Ìµ´ü¸Â¤ËÄä»ß (block) ¤¹¤ë +²ÄǽÀ­¤Î¤¢¤ë¥Ç¥Ð¥¤¥¹¤Î¤³¤È¤Ç¡¢Îã¤È¤·¤Æ¤ÏüËö¡¢¥Ñ¥¤¥×¡¢¥½¥±¥Ã¥È¤¬¤¢¤ë +(¤³¤ÎÄêµÁ¤Ç¤Ï¡¢¥Ç¥£¥¹¥¯¤ÏÃÙ¤¤¥Ç¥Ð¥¤¥¹¤Ç¤Ï¤Ê¤¤)¡£ +ÃÙ¤¤¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë I/O ¸Æ¤Ó½Ð¤·¤¬¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿»þÅÀ¤Þ¤Ç¤Ë²¿¤é¤«¤Î¥Ç¡¼¥¿¤ò +¤¹¤Ç¤ËžÁ÷¤·¤Æ¤¤¤ì¤Ð¡¢¸Æ¤Ó½Ð¤·¤ÏÀ®¸ù¥¹¥Æ¡¼¥¿¥¹ +(Ä̾ï¤Ï¡¢Å¾Á÷¤µ¤ì¤¿¥Ð¥¤¥È¿ô) ¤òÊÖ¤¹¤³¤È¤À¤í¤¦¡£ +.IP * +.\"O .BR open (2), +.\"O if it can block (e.g., when opening a FIFO; see +.\"O .BR fifo (7)). +Ää»ß (block) ¤¹¤ë²ÄǽÀ­¤Î¤¢¤ë +.BR open (2) +(Î㤨¤Ð¡¢FIFO ¤Î¥ª¡¼¥×¥ó»þ; +.BR fifo (7) +»²¾È)¡£ +.IP * +.\"O .BR wait (2), +.\"O .BR wait3 (2), +.\"O .BR wait4 (2), +.\"O .BR waitid (2), +.\"O and +.\"O .BR waitpid (2). +.BR wait (2), +.BR wait3 (2), +.BR wait4 (2), +.BR waitid (2), +.BR waitpid (2). +.IP * +.\"O Socket interfaces: +¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.\" If a timeout (setsockopt()) is in effect on the socket, then these +.\" system calls switch to using EINTR. Consequently, they and are not +.\" automatically restarted, and they show the stop/cont behavior +.\" described below. (Verified from 2.6.26 source, and by experiment; mtk) +.\"O .BR accept (2), +.\"O .BR connect (2), +.\"O .BR recv (2), +.\"O .BR recvfrom (2), +.\"O .BR recvmsg (2), +.\"O .BR send (2), +.\"O .BR sendto (2), +.\"O and +.\"O .BR sendmsg (2), +.\"O unless a timeout has been set on the socket (see below). +.BR accept (2), +.BR connect (2), +.BR recv (2), +.BR recvfrom (2), +.BR recvmsg (2), +.BR send (2), +.BR sendto (2), +.BR sendmsg (2). +⤷¡¢¥½¥±¥Ã¥È¤Ë¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç (²¼µ­»²¾È)¡£ +.IP * +.\"O File locking interfaces: +¥Õ¥¡¥¤¥ë¥í¥Ã¥¯ÍÑ¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.\"O .BR flock (2) +.\"O and +.\"O .BR fcntl (2) +.\"O .BR F_SETLKW . +.BR flock (2), +.BR fcntl (2) +.BR F_SETLKW . +.IP * +.\"O POSIX message queue interfaces: +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.BR mq_receive (3), +.BR mq_timedreceive (3), +.BR mq_send (3), +.\"O and +.BR mq_timedsend (3). +.IP * +.BR futex (2) +.B FUTEX_WAIT +.\"O (since Linux 2.6.22; beforehand, always failed with +.\"O .BR EINTR ). +(Linux 2.6.22 °Ê¹ß; ¤½¤ì°ÊÁ°¤Ï¾ï¤Ë +.B EINTR +¤Ç¼ºÇÔ¤·¤Æ¤¤¤¿)¡£ +.IP * +.\"O POSIX semaphore interfaces: +POSIX ¥»¥Þ¥Õ¥©¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.\"O .BR sem_wait (3) +.\"O and +.\"O .BR sem_timedwait (3) +.\"O (since Linux 2.6.22; beforehand, always failed with +.\"O .BR EINTR ). +.BR sem_wait (3), +.BR sem_timedwait (3) +(Linux 2.6.22 °Ê¹ß; ¤½¤ì°ÊÁ°¤Ï¾ï¤Ë +.B EINTR +¤Ç¼ºÇÔ¤·¤Æ¤¤¤¿)¡£ +.RE +.PP +.\"O The following interfaces are never restarted after +.\"O being interrupted by a signal handler, +.\"O regardless of the use of +.\"O .BR SA_RESTART ; +.\"O they always fail with the error +.\"O .B EINTR +.\"O when interrupted by a signal handler: +.\"O .\" These are the system calls that give EINTR or ERESTARTNOHAND +.\"O .\" on interruption by a signal handler. +°Ê²¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï¡¢ +.B SA_RESTART +¤ò»È¤Ã¤Æ¤¤¤ë¤É¤¦¤«¤Ë´Ø¤ï¤é¤º¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¸å¡¢ +ºÆ¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£ +¤³¤ì¤é¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤ë¤È¡¢¾ï¤Ë¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¡£ +.\" ¤³¤ì¤é¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ë³ä¤ê¹þ¤ß¤ÎºÝ¤Ë +.\" EINTR ¤« ERESTARTNOHAND ¤òÊÖ¤¹¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£ +.RS 4 +.IP * 2 +.\"O Socket interfaces, when a timeout has been set on the socket using +.\"O .BR setsockopt (2): +.\"O .BR accept (2), +.\"O .BR recv (2), +.\"O .BR recvfrom (2), +.\"O and +.\"O .BR recvmsg (2), +.\"O if a receive timeout +.\"O .RB ( SO_RCVTIMEO ) +.\"O has been set; +.\"O .BR connect (2), +.\"O .BR send (2), +.\"O .BR sendto (2), +.\"O and +.\"O .BR sendmsg (2), +.\"O if a send timeout +.\"O .RB ( SO_SNDTIMEO ) +.\"O has been set. +.BR setsockopt (2) +¤ò»È¤Ã¤Æ¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹: +.BR accept (2), +.BR recv (2), +.BR recvfrom (2), +.BR recvmsg (2) +¤Ç¼õ¿®¥¿¥¤¥à¥¢¥¦¥È +.RB ( SO_RCVTIMEO ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤È¡¢ +.BR connect (2), +.BR send (2), +.BR sendto (2), +.BR sendmsg (2) +¤ÇÁ÷¿®¥¿¥¤¥à¥¢¥¦¥È +.RB ( SO_SNDTIMEO ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡£ +.IP * +.\"O Interfaces used to wait for signals: +¥·¥°¥Ê¥ëÂÔ¤Á¤Ë»È¤ï¤ì¤ë¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.BR pause (2), +.BR sigsuspend (2), +.BR sigtimedwait (2), +.\"O and +.BR sigwaitinfo (2). +.IP * +.\"O File descriptor multiplexing interfaces: +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿Â¿½Å¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.BR epoll_wait (2), +.BR epoll_pwait (2), +.BR poll (2), +.BR ppoll (2), +.BR select (2), +.\"O and +.BR pselect (2). +.IP * +.\"O System V IPC interfaces: +System V IPC ¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.\" On some other systems, SA_RESTART does restart these system calls +.BR msgrcv (2), +.BR msgsnd (2), +.BR semop (2), +.\"O and +.BR semtimedop (2). +.IP * +.\"O Sleep interfaces: +¥¹¥ê¡¼¥×ÍѤΥ¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.BR clock_nanosleep (2), +.BR nanosleep (2), +.\"O and +.BR usleep (3). +.IP * +.\"O .BR read (2) +.\"O from an +.\"O .BR inotify (7) +.\"O file descriptor. +.BR inotify (7) +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î +.BR read (2). +.IP * +.BR io_getevents (2). +.RE +.PP +.\"O The +.\"O .BR sleep (3) +.\"O function is also never restarted if interrupted by a handler, +.\"O but gives a success return: the number of seconds remaining to sleep. +.BR sleep (3) +´Ø¿ô¤â¡¢¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢·è¤·¤ÆºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +¤·¤«¤·¡¢À®¸ù¤È¤Ê¤ê¡¢»Ä¤Ã¤Æ¤¤¤ëÄä»ß»þ´Ö¤òÊÖ¤¹¡£ +.\"O .SS Interruption of System Calls and Library Functions by Stop Signals +.SS °ì»þÄä»ß¥·¥°¥Ê¥ë¤Ë¤è¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ø¤Î³ä¤ê¹þ¤ß +.\"O On Linux, even in the absence of signal handlers, +.\"O certain blocking interfaces can fail with the error +.\"O .BR EINTR +.\"O after the process is stopped by one of the stop signals +.\"O and then resumed via +.\"O .BR SIGCONT . +.\"O This behavior is not sanctioned by POSIX.1, and doesn't occur +.\"O on other systems. +Linux ¤Ç¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤â¡¢ +¤¤¤¯¤Ä¤«¤Î¥Ö¥í¥Ã¥­¥ó¥°·¿¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï¡¢ +¥×¥í¥»¥¹¤¬°ì»þÄä»ß (stop) ¥·¥°¥Ê¥ë¤Î°ì¤Ä¤Ë¤è¤êÄä»ß¤µ¤ì¡¢ +.B SIGCONT +¤Ë¤è¤êºÆ³«¤µ¤ì¤¿¸å¤Ë¡¢¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤³¤ÎµóÆ°¤Ï POSIX.1 ¤Çǧ¤á¤é¤ì¤Æ¤ª¤é¤º¡¢Â¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ïµ¯¤³¤é¤Ê¤¤¡£ + +.\"O The Linux interfaces that display this behavior are: +¤³¤ÎµóÆ°¤ò¼¨¤¹ Linux ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.RS 4 +.IP * 2 +.\"O Socket interfaces, when a timeout has been set on the socket using +.\"O .BR setsockopt (2): +.\"O .BR accept (2), +.\"O .BR recv (2), +.\"O .BR recvfrom (2), +.\"O and +.\"O .BR recvmsg (2), +.\"O if a receive timeout +.\"O .RB ( SO_RCVTIMEO ) +.\"O has been set; +.\"O .BR connect (2), +.\"O .BR send (2), +.\"O .BR sendto (2), +.\"O and +.\"O .BR sendmsg (2), +.\"O if a send timeout +.\"O .RB ( SO_SNDTIMEO ) +.\"O has been set. +.BR setsockopt (2) +¤ò»È¤Ã¤Æ¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹: +.BR accept (2), +.BR recv (2), +.BR recvfrom (2), +.BR recvmsg (2) +¤Ç¼õ¿®¥¿¥¤¥à¥¢¥¦¥È +.RB ( SO_RCVTIMEO ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤È¡¢ +.BR connect (2), +.BR send (2), +.BR sendto (2), +.BR sendmsg (2) +¤ÇÁ÷¿®¥¿¥¤¥à¥¢¥¦¥È +.RB ( SO_SNDTIMEO ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡£ +.IP * 2 +.BR epoll_wait (2), +.BR epoll_pwait (2). +.IP * +.BR semop (2), +.BR semtimedop (2). +.IP * +.BR sigtimedwait (2), +.BR sigwaitinfo (2). +.IP * +.\"O .BR read (2) +.\"O from an +.\"O .BR inotify (7) +.\"O file descriptor. +.BR inotify (7) +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î +.BR read (2). +.IP * +.\"O Linux 2.6.21 and earlier: +Linux 2.6.21 °ÊÁ°: +.BR futex (2) +.BR FUTEX_WAIT , +.BR sem_timedwait (3), +.BR sem_wait (3). +.IP * +.\"O Linux 2.6.8 and earlier: +Linux 2.6.8 °ÊÁ°: +.BR msgrcv (2), +.BR msgsnd (2). +.IP * +.\"O Linux 2.4 and earlier: +Linux 2.4 °ÊÁ°: +.BR nanosleep (2). +.RE +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O POSIX.1, except as noted. +POSIX.1 (Ãíµ­¤·¤¿ÆâÍưʳ°)¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O .B SIGIO +.\"O and +.\"O .B SIGLOST +.\"O have the same value. +.\"O The latter is commented out in the kernel source, but +.\"O the build process of some software still thinks that +.\"O signal 29 is +.\"O .BR SIGLOST . +.B SIGIO +¤È +.B SIGLOST +¤ÏƱ¤¸Ãͤò»ý¤Ã¤Æ¤¤¤ë¡£ +.B SIGLOST +¤Ï¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¤Ç¤Ï¥³¥á¥ó¥È¥¢¥¦¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤·¤«¤·¡¢¥½¥Õ¥È¥¦¥§¥¢¤Ë¤è¤Ã¤Æ¤Ï¥Ó¥ë¥É¤Î²áÄø¤Ç¥·¥°¥Ê¥ë 29 ¤ò +.B SIGLOST +¤È¤ß¤Ê¤·¤Æ¤·¤Þ¤¦¤â¤Î¤¬¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (1), +.BR getrlimit (2), +.BR kill (2), +.BR killpg (2), +.BR setitimer (2), +.BR setrlimit (2), +.BR sgetmask (2), +.BR sigaction (2), +.BR sigaltstack (2), +.BR signal (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigqueue (2), +.BR sigsuspend (2), +.BR sigwaitinfo (2), +.BR abort (3), +.BR bsd_signal (3), +.BR longjmp (3), +.BR raise (3), +.BR sigset (3), +.BR sigsetops (3), +.BR sigvec (3), +.BR sigwait (3), +.BR strsignal (3), +.BR sysv_signal (3), +.BR core (5), +.BR proc (5), +.BR pthreads (7) diff --git a/draft/man7/socket.7 b/draft/man7/socket.7 new file mode 100644 index 00000000..4c39568b --- /dev/null +++ b/draft/man7/socket.7 @@ -0,0 +1,1348 @@ +'\" t +.\" Don't change the first line, it tells man that we need tbl. +.\" This man page is Copyright (C) 1999 Andi Kleen . +.\" and copyright (c) 1999 Matthew Wilcox. +.\" 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. +.\" +.\" 2002-10-30, Michael Kerrisk, +.\" Added description of SO_ACCEPTCONN +.\" 2004-05-20, aeb, added SO_RCVTIMEO/SO_SNDTIMEO text. +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" A few small grammar fixes +.\" FIXME +.\" The following are not yet documented: +.\" SO_PEERNAME +.\" SO_TIMESTAMPNS +.\" SO_MARK +.\" SO_TIMESTAMPING +.\" SO_PROTOCOL (2.6.32) +.\" SO_DOMAIN (2.6.32) +.\" SO_RXQ_OVFL (2.6.33) +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2003-01-20, Akihiro Motoki +.\" Updated 2005-02-23, Akihiro MOTOKI +.\" Updated 2005-10-05, Akihiro MOTOKI +.\" Updated 2005-12-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.16 +.\" Updated 2005-12-26, Akihiro MOTOKI, Catch up to LDP man-pages 2.18 +.\" Updated 2006-04-15, Akihiro MOTOKI, Catch up to LDP man-pages 2.29 +.\" Updated 2007-01-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.43 +.\" +.\"WORD protocol family ¥×¥í¥È¥³¥ë¥Õ¥¡¥ß¥ê¡¼ +.\"WORD socket type ¥½¥±¥Ã¥È¥¿¥¤¥× +.\"WORD file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD anonymous socket ̾Á°Ìµ¤·¥½¥±¥Ã¥È +.\"WORD asynchronous ÈóƱ´ü (Ū) +.\"WORD credential ¿®Ç¤¾õ +.\"WORD capability ¸¢¸Â +.\"WORD ancillary data Êä½õ¥Ç¡¼¥¿ +.\" +.TH SOCKET 7 2008-12-03 Linux "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O socket \- Linux socket interface +socket \- Linux ¤Î¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.IB sockfd " = socket(int " socket_family ", int " socket_type ", int " protocol ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This manual page describes the Linux networking socket layer user +.\"O interface. +.\"O The BSD compatible sockets +.\"O are the uniform interface +.\"O between the user process and the network protocol stacks in the kernel. +.\"O The protocol modules are grouped into +.\"O .I protocol families +.\"O like +.\"O .BR AF_INET ", " AF_IPX ", " AF_PACKET +.\"O and +.\"O .I socket types +.\"O like +.\"O .B SOCK_STREAM +.\"O or +.\"O .BR SOCK_DGRAM . +.\"O See +.\"O .BR socket (2) +.\"O for more information on families and types. +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï Linux ¥Í¥Ã¥È¥ï¡¼¥¯¤Î¥½¥±¥Ã¥ÈÁؤËÂФ¹¤ë +¥æ¡¼¥¶¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òµ­½Ò¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +BSD ¸ß´¹¥½¥±¥Ã¥È¤Ï¡¢¥æ¡¼¥¶¥×¥í¥»¥¹¤È¥«¡¼¥Í¥ëÆâÉô¤Î +¥Í¥Ã¥È¥ï¡¼¥¯¥×¥í¥È¥³¥ë¥¹¥¿¥Ã¥¯·²¤È¤Î´Ö¤Ë¡¢ +Åý°ìŪ¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¥×¥í¥È¥³¥ë¥â¥¸¥å¡¼¥ë¤Ï +.I "¥×¥í¥È¥³¥ë¥Õ¥¡¥ß¥ê¡¼ (protocol familiy)" +(Î㡧 +.BR AF_INET ", " AF_IPX ", " AF_PACKET ) +¤È +.I "¥½¥±¥Ã¥È¥¿¥¤¥× (socket types)" +(Î㡧 +.BR SOCK_STREAM ", " SOCK_DGRAM ) +¤ËʬÎà¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Ë´Ø¤¹¤ë¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR socket (2) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .SS Socket Layer Functions +.SS ¥½¥±¥Ã¥ÈÁؤδؿô·² +.\"O These functions are used by the user process to send or receive packets +.\"O and to do other socket operations. +.\"O For more information see their respective manual pages. +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥æ¡¼¥¶¥×¥í¥»¥¹¤¬¥Ñ¥±¥Ã¥È¤òÁ÷¼õ¿®¤·¤¿¤ê¡¢¤½¤Î¾¤Î¥½¥±¥Ã¥ÈÁàºî¤ò +¹Ô¤Ã¤¿¤ê¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£¾ÜºÙ¤Ï¤½¤ì¤¾¤ì¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò +¸«¤Æ¤Û¤·¤¤¡£ + +.\"O .BR socket (2) +.\"O creates a socket, +.\"O .BR connect (2) +.\"O connects a socket to a remote socket address, +.\"O the +.\"O .BR bind (2) +.\"O function binds a socket to a local socket address, +.\"O .BR listen (2) +.\"O tells the socket that new connections shall be accepted, and +.\"O .BR accept (2) +.\"O is used to get a new socket with a new incoming connection. +.\"O .BR socketpair (2) +.\"O returns two connected anonymous sockets (only implemented for a few +.\"O local families like +.\"O .BR AF_UNIX ) +.BR socket (2) +¤Ï¥½¥±¥Ã¥È¤òÀ¸À®¤¹¤ë¡£ +.BR connect (2) +¤Ï¥½¥±¥Ã¥È¤ò¥ê¥â¡¼¥È¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ËÀܳ¤¹¤ë¡£ +.BR bind (2) +¤Ï¥½¥±¥Ã¥È¤ò¥í¡¼¥«¥ë¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¡£ +.BR listen (2) +¤Ï¥½¥±¥Ã¥È¤Ë¿·¤·¤¤Àܳ¤¬Í褿¤é¼õ¿®¤¹¤ë¤è¤¦¤ËÅÁ¤¨¡¢ +.BR accept (2) +¤Ï³°Éô¤«¤é¤ä¤Ã¤Æ¤­¤¿Àܳ¤ËÂФ·¤Æ¿·¤·¤¤¥½¥±¥Ã¥È¤òÆÀ¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +.BR socketpair (2) +¤Ï¸ß¤¤¤ËÀܳ¤µ¤ì¤¿Æó¤Ä¤Î̾Á°Ìµ¤·¥½¥±¥Ã¥È (anonymous socket) ¤òÊÖ¤¹ +.RB ( AF_UNIX +¤Î¤è¤¦¤Ê¡¢¤¤¤¯¤Ä¤«¤Î¥í¡¼¥«¥ë¤Ê¥Õ¥¡¥ß¥ê¡¼¤Ç¤·¤«¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤)¡£ +.PP +.\"O .BR send (2), +.\"O .BR sendto (2), +.\"O and +.\"O .BR sendmsg (2) +.\"O send data over a socket, and +.\"O .BR recv (2), +.\"O .BR recvfrom (2), +.\"O .BR recvmsg (2) +.\"O receive data from a socket. +.\"O .BR poll (2) +.\"O and +.\"O .BR select (2) +.\"O wait for arriving data or a readiness to send data. +.\"O In addition, the standard I/O operations like +.\"O .BR write (2), +.\"O .BR writev (2), +.\"O .BR sendfile (2), +.\"O .BR read (2), +.\"O and +.\"O .BR readv (2) +.\"O can be used to read and write data. +.BR send (2), +.BR sendto (2), +.BR sendmsg (2) +¤Ï¥½¥±¥Ã¥È¤òÄ̤·¤Æ¥Ç¡¼¥¿¤òÁ÷¿®¤·¡¢ +.BR recv (2) +.BR recvfrom (2), +.BR recvmsg (2) +¤Ï¥½¥±¥Ã¥È¤«¤é¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ë¡£ +.BR poll (2) +¤È +.BR select (2) +¤Ï¥Ç¡¼¥¿¤ÎÅþÃå¤òÂԤ俤ꡢ¥Ç¡¼¥¿Á÷¿®¤Î½àÈ÷¤¬¤Ç¤­¤ë¤Þ¤ÇÂԤ俤ꤹ¤ë¡£ +¤µ¤é¤Ë¡¢ +.BR write (2), +.BR writev (2), +.BR sendfile (2), +.BR read (2), +.BR readv (2) +¤Î¤è¤¦¤Êɸ½àŪ¤Ê I/O Áàºî¤â¥Ç¡¼¥¿¤ÎÆɤ߽ñ¤­¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O .BR getsockname (2) +.\"O returns the local socket address and +.\"O .BR getpeername (2) +.\"O returns the remote socket address. +.\"O .BR getsockopt (2) +.\"O and +.\"O .BR setsockopt (2) +.\"O are used to set or get socket layer or protocol options. +.\"O .BR ioctl (2) +.\"O can be used to set or read some other options. +.BR getsockbyname (2) +¤Ï¥í¡¼¥«¥ë¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤òÊÖ¤·¡¢ +.BR getpeername (2) +¤Ï¥ê¥â¡¼¥È¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£ +.BR getsockopt (2) +¤È +.BR setsockopt (2) +¤Ï¥½¥±¥Ã¥ÈÁؤΥª¥×¥·¥ç¥ó¤ä¥×¥í¥È¥³¥ë¥ª¥×¥·¥ç¥ó¤Î¼èÆÀ¡¦ÀßÄê¤ËÍѤ¤¤é¤ì¤ë¡£ +¾¤Î¤¤¤¯¤Ä¤«¤Î¥ª¥×¥·¥ç¥ó¤Î¼èÆÀ¡¦ÀßÄê¤Ë¤Ï +.BR ioctl (2) +¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O .BR close (2) +.\"O is used to close a socket. +.\"O .BR shutdown (2) +.\"O closes parts of a full-duplex socket connection. +.BR close (2) +¤Ï¥½¥±¥Ã¥È¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.BR shutdown (2) +¤ÏÁ´Æó½Å¤Ê¥½¥±¥Ã¥ÈÀܳ¤òÉôʬŪ¤Ë¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +.\"O Seeking, or calling +.\"O .BR pread (2) +.\"O or +.\"O .BR pwrite (2) +.\"O with a nonzero position is not supported on sockets. +¥·¡¼¥¯Æ°ºî¤ä¡¢ 0 °Ê³°¤Î°ÌÃÖ¤ËÂФ¹¤ë +.BR pread (2) +¤ä +.BR pwrite (2) +¤Ï¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O It is possible to do nonblocking I/O on sockets by setting the +.\"O .B O_NONBLOCK +.\"O flag on a socket file descriptor using +.\"O .BR fcntl (2). +.\"O Then all operations that would block will (usually) +.\"O return with +.\"O .B EAGAIN +.\"O (operation should be retried later); +Èó¥Ö¥í¥Ã¥­¥ó¥°¤Ê I/O ¤ò¥½¥±¥Ã¥È¤Ç¹Ô¤¦¤³¤È¤Ï²Äǽ¤Ç¡¢ +.BR fcntl (2) +¤ò»È¤Ã¤Æ¥½¥±¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë +.B O_NONBLOCK +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ì¤ÐÎɤ¤¡£ +¤³¤¦¤¹¤ë¤È¥Ö¥í¥Ã¥¯¤µ¤ì¤ëÁàºî¤Ï¡¢ (Ä̾ï) +.B EAGAIN +¥¨¥é¡¼¤ÇÌá¤ë¤³¤È¤Ë¤Ê¤ë +(¸å¤Ç½èÍý¤¬ºÆ»î¹Ô¤µ¤ì¤ë¤³¤È¤¬´üÂÔ¤µ¤ì¤Æ¤¤¤ë)¡£ +.\"O .BR connect (2) +.\"O will return +.\"O .B EINPROGRESS +.\"O error. +.BR connect (2) +¤Ç¤Ï +.B EINPROGRESS +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O The user can then wait for various events via +.\"O .BR poll (2) +.\"O or +.\"O .BR select (2). +¤³¤Î¾ì¹ç¡¢¥æ¡¼¥¶¤Ï¤µ¤Þ¤¶¤Þ¤Ê¥¤¥Ù¥ó¥È¤ò +.BR poll (2) +¤ä +.BR select (2) +¤ò»È¤Ã¤ÆÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£ +.TS +tab(:) allbox; +c s s +l l l. +.\"O I/O events +I/O ¥¤¥Ù¥ó¥È +.\"O Event:Poll flag:Occurrence +¥¤¥Ù¥ó¥È:poll ¥Õ¥é¥°:ÆâÍÆ +.\"O Read:POLLIN:T{ +.\"O New data arrived. +.\"O T} +Read:POLLIN:T{ +¿·¤·¤¤¥Ç¡¼¥¿¤¬ÅþÃ夷¤¿¡£ +T} +.\"O Read:POLLIN:T{ +.\"O A connection setup has been completed +.\"O (for connection-oriented sockets) +.\"O T} +Read:POLLIN:T{ +(Àܳ»Ö¸þ¤Î¥½¥±¥Ã¥È¤Ç) +Àܳ¤ÎÀßÄ꤬½ªÎ»¤·¤¿¡£ +T} +.\"O Read:POLLHUP:T{ +.\"O A disconnection request has been initiated by the other end. +.\"O T} +Read:POLLHUP:T{ +ÀܳÀè¤ÇÀÚÃÇÍ׵᤬À¸À®¤µ¤ì¤¿¡£ +T} +.\"O Read:POLLHUP:T{ +.\"O A connection is broken (only for connection-oriented protocols). +.\"O When the socket is written +.\"O .B SIGPIPE +.\"O is also sent. +.\"O T} +Read:POLLHUP:T{ +Àܳ¤¬²õ¤ì¤¿ (Àܳ»Ö¸þ¤Î¥×¥í¥È¥³¥ë¤Î¤ß)¡£ +¤³¤Î¾ì¹ç¡¢¥½¥±¥Ã¥È¤Ë½ñ¤­¹þ¤ß¤¬¹Ô¤ï¤ì¤ë¤È +.B SIGPIPE +¤âÁ÷¿®¤µ¤ì¤ë¡£ +T} +.\"O Write:POLLOUT:T{ +.\"O Socket has enough send buffer space for writing new data. +.\"O T} +Write:POLLOUT:T{ +¥½¥±¥Ã¥È¤Ë¤Ï¿·¤·¤¤¥Ç¡¼¥¿¤ò½ñ¤­¹þ¤à¤Î¤Ë +½¼Ê¬¤Ê¥Ð¥Ã¥Õ¥¡Îΰ褬¤¢¤ë¡£ +T} +.\"O Read/Write:T{ +.\"O POLLIN| +.\"O .br +.\"O POLLOUT +.\"O T}:T{ +.\"O An outgoing +.\"O .BR connect (2) +.\"O finished. +.\"O T} +Read/Write:T{ +POLLIN| +.br +POLLOUT +T}:T{ +³°Éô¸þ¤±¤Î +.BR connect (2) +¤¬½ªÎ»¤·¤¿¡£ +T} +.\"O Read/Write:POLLERR:An asynchronous error occurred. +Read/Write:POLLERR:T{ +ÈóƱ´üŪ (asynchronous) ¤Ê¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +T} +.\"O Read/Write:POLLHUP:The other end has shut down one direction. +Read/Write:POLLHUP:ÀܳÀ褬ÊÒÊý¸þ¤òÀÚÃǤ·¤¿¡£ +.\"O Exception:POLLPRI:T{ +.\"O Urgent data arrived. +.\"O .B SIGURG +.\"O is sent then. +.\"O T} +Exception:POLLPRI:T{ +¶ÛµÞ¥Ç¡¼¥¿ (urgent data) ¤¬ÅþÃ夷¤¿¡£ +¤³¤Î¾ì¹ç¤Ï +.B SIGURG +¤¬Á÷¿®¤µ¤ì¤ë¡£ +T} +.\" FIXME . The following is not true currently: +.\" It is no I/O event when the connection +.\" is broken from the local end using +.\" .BR shutdown (2) +.\" or +.\" .BR close (2). +.TE + +.PP +.\"O An alternative to +.\"O .BR poll (2) +.\"O and +.\"O .BR select (2) +.\"O is to let the kernel inform the application about events +.\"O via a +.\"O .B SIGIO +.\"O signal. +.\"O For that the +.\"O .B O_ASYNC +.\"O flag must be set on a socket file descriptor via +.\"O .BR fcntl (2) +.\"O and a valid signal handler for +.\"O .B SIGIO +.\"O must be installed via +.\"O .BR sigaction (2). +.\"O See the +.\"O .I Signals +.\"O discussion below. +.BR poll (2) +¤ä +.BR select (2) +¤ò»È¤¦Âå¤ï¤ê¤Ë¡¢¥«¡¼¥Í¥ë¤«¤é¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë +¥¤¥Ù¥ó¥È¤òÄÌÃΤµ¤»¤ë¤Î¤Ë +.B SIGIO +¥·¥°¥Ê¥ë¤ò»È¤¦ÊýË¡¤â¤¢¤ë¡£ +¤³¤ÎÊýË¡¤ò»È¤¦¤Ë¤Ï¡¢ +.BR fcntl (2) +¤òÍѤ¤¤Æ¥½¥±¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë +.B O_ASYNC +¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¡¢ +.B SIGIO +¤ËÂФ¹¤ëÍ­¸ú¤Ê¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò +.BR sigaction (2) +¤Ë¤è¤Ã¤ÆÀßÄꤷ¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +¸å½Ò¤Î +.I ¥·¥°¥Ê¥ë +¤Ë´Ø¤¹¤ëµÄÏÀ¤â»²¹Í¤Ë¤¹¤ë¤³¤È¡£ +.\"O .SS Socket Options +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.\"O These socket options can be set by using +.\"O .BR setsockopt (2) +.\"O and read with +.\"O .BR getsockopt (2) +.\"O with the socket level set to +.\"O .B SOL_SOCKET +.\"O for all sockets: +¤³¤ì¤é¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.BR setsockopt (2) +¤òÍѤ¤¤ì¤ÐÀßÄê¤Ç¤­¡¢ +.BR getsockopt (2) +¤òÍѤ¤¤ì¤Ð¼èÆÀ¤Ç¤­¤ë¡£ +⤷¡¢¤É¤Î¥½¥±¥Ã¥È¤Î¾ì¹ç¤â +¥½¥±¥Ã¥È¥ì¥Ù¥ë¤Ë¤Ï +.B SOL_SOCKET +¤ò»ØÄꤹ¤ë¤³¤È¡£ +.\"O .\" SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in +.\"O .\" W R Stevens, UNPv1 +.\" SO_ACCEPTCONN ¤Ï POSIX.1-2001 ¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢¸µ¤Ï +.\" W R Stevens ¤Î UNPv1 ¤Ë½ñ¤«¤ì¤Æ¤¤¤¿¡£ +.TP +.B SO_ACCEPTCONN +.\"O Returns a value indicating whether or not this socket has been marked +.\"O to accept connections with +.\"O .BR listen (2). +.\"O The value 0 indicates that this is not a listening socket, +.\"O the value 1 indicates that this is a listening socket. +.\"O Can only be read +.\"O with +.\"O .BR getsockopt (2). +¤³¤Î¥½¥±¥Ã¥È¤¬ +.BR listen (2) +¤Ë¤è¤Ã¤ÆÀܳÂÔ¤Á¼õ¤±¾õÂÖ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¼¨¤¹ÃͤòÊÖ¤¹¡£ +ÃÍ 0 ¤Ï listen ¾õÂ֤Υ½¥±¥Ã¥È¤Ç¤Ê¤¤¤³¤È¤ò¡¢ +ÃÍ 1 ¤Ï listen ¾õÂ֤Υ½¥±¥Ã¥È¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.BR getsockopt (2) +¤«¤é¤Î¤ßÆɤ߽Ф·²Äǽ¤Ç¤¢¤ë¡£ +.TP +.B SO_BINDTODEVICE +.\"O Bind this socket to a particular device like \(lqeth0\(rq, +.\"O as specified in the passed interface name. +.\"O If the +.\"O name is an empty string or the option length is zero, the socket device +.\"O binding is removed. +.\"O The passed option is a variable-length null-terminated +.\"O interface name string with the maximum size of +.\"O .BR IFNAMSIZ . +¤³¤Î¥½¥±¥Ã¥È¤ò¡¢°ú¤­¿ô¤ÇÅϤ·¤¿¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹Ì¾¤Ç»ØÄꤵ¤ì¤ë +(\(lqeth0\(rq ¤Î¤è¤¦¤Ê) ÆÃÄê¤Î¥Ç¥Ð¥¤¥¹¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¡£ +̾Á°¤¬¶õʸ»úÎó¤À¤Ã¤¿¤ê¡¢¥ª¥×¥·¥ç¥ó¤ÎŤµ (optlen) ¤¬ 0 ¤Î¾ì¹ç¤Ë¤Ï¡¢ +¥½¥±¥Ã¥È¤Î¥Ð¥¤¥ó¥É¤¬ºï½ü¤µ¤ì¤ë¡£ÅϤ¹¥ª¥×¥·¥ç¥ó¤Ï¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹Ì¾¤¬ +Æþ¤Ã¤¿¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿²ÄÊÑŤÎʸ»úÎó¤Ç¤¢¤ë¡£ +ʸ»úÎó¤ÎºÇÂç¤Î¥µ¥¤¥º¤Ï +.B IFNAMSIX +¤Ç¤¢¤ë¡£ +.\"O If a socket is bound to an interface, +.\"O only packets received from that particular interface are processed by the +.\"O socket. +.\"O Note that this only works for some socket types, particularly +.\"O .B AF_INET +.\"O sockets. +.\"O It is not supported for packet sockets (use normal +.\"O .BR bind (8) +.\"O there). +¥½¥±¥Ã¥È¤¬¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤ë¤È¡¢ +¤½¤ÎÆÃÄê¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤«¤é¼õ¿®¤µ¤ì¤¿¥Ñ¥±¥Ã¥È¤À¤±¤ò½èÍý¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤¤¯¤Ä¤«¤Î¥½¥±¥Ã¥È¥¿¥¤¥×¡¢ÆÃ¤Ë +.B AF_INET +¤ËÂФ·¤Æ¤Î¤ßÆ°ºî¤¹¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¥Ñ¥±¥Ã¥È¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ (Ä̾ï¤Î +.BR bind (8) +¤ò»È¤¦¤³¤È)¡£ +.TP +.B SO_BROADCAST +.\"O Set or get the broadcast flag. +.\"O When enabled, datagram sockets +.\"O receive packets sent to a broadcast address and they are allowed to send +.\"O packets to a broadcast address. +.\"O This option has no effect on stream-oriented sockets. +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥Õ¥é¥°¤òÀßÄꡦ¼èÆÀ¤¹¤ë¡£Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤Ï¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ËÁ÷¤é¤ì¤¿¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤·¤¿¤ê¡¢ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ë¥Ñ¥±¥Ã¥È¤òÁ÷¿®¤·¤¿¤ê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¥¹¥È¥ê¡¼¥à»Ø¸þ¤Î¥½¥±¥Ã¥È¤Ë¤Ï²¿¤Î¸ú²Ì¤â¤Ê¤¤¡£ +.TP +.B SO_BSDCOMPAT +.\"O Enable BSD bug-to-bug compatibility. +.\"O This is used by the UDP protocol module in Linux 2.0 and 2.2. +.\"O If enabled ICMP errors received for a UDP socket will not be passed +.\"O to the user program. +.\"O In later kernel versions, support for this option has been phased out: +.\"O Linux 2.4 silently ignores it, and Linux 2.6 generates a kernel warning +.\"O (printk()) if a program uses this option. +.\"O Linux 2.0 also enabled BSD bug-to-bug compatibility +.\"O options (random header changing, skipping of the broadcast flag) for raw +.\"O sockets with this option, but that was removed in Linux 2.2. +BSD ¤Î¥Ð¥°¤ËÂФ·¤Æ¸ß´¹À­¤ò¼è¤ë¤¿¤á¤Îµ¡Ç½¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤Îµ¡Ç½¤Ï Linux 2.0 ¤È 2.2 ¤Î UDP ¥×¥í¥È¥³¥ë¥â¥¸¥å¡¼¥ë¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ UDP ¥½¥±¥Ã¥È¤Ç¼õ¿®¤µ¤ì¤¿ ICMP ¥¨¥é¡¼¤Ï +¥æ¡¼¥¶¥×¥í¥°¥é¥à¤ËÅϤµ¤ì¤Ê¤¤¡£ +¤³¤ì°Ê¹ß¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Î¥µ¥Ý¡¼¥È¤Ï +Ãʳ¬Åª¤ËÇѻߤµ¤ì¤Æ¤­¤¿¡£ +Linux 2.4 ¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤ÏÌۤäÆ̵»ë¤µ¤ì¡¢ +Linux 2.6 ¤Ç¤Ï¥×¥í¥°¥é¥à¤¬¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤ë¤È (printk() ¤ò»È¤Ã¤Æ) +¥«¡¼¥Í¥ë¤Î·Ù¹ð¥á¥Ã¥»¡¼¥¸¤¬½ÐÎϤµ¤ì¤ë¡£ +Linux 2.0 ¤Ç¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢ +raw ¥½¥±¥Ã¥È¤Ë¤ª¤¤¤Æ¤â BSD ¤Î¥Ð¥° (¥é¥ó¥À¥à¥Ø¥Ã¥ÀÊѹ¹¡¢ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥Õ¥é¥°¤Î¥¹¥­¥Ã¥×) +¤ËÂФ¹¤ë¸ß´¹µ¡Ç½¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£ +¤·¤«¤·¡¢¤³¤Á¤é¤Ï Linux 2.2 ¤Çºï½ü¤µ¤ì¤¿¡£ +.TP +.B SO_DEBUG +.\"O Enable socket debugging. +.\"O Only allowed for processes with the +.\"O .B CAP_NET_ADMIN +.\"O capability or an effective user ID of 0. +¥½¥±¥Ã¥È¤Î¥Ç¥Ð¥Ã¥°µ¡Ç½¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.B CAP_NET_ADMIN +¸¢¸Â¤ò»ý¤Ä¥×¥í¥»¥¹¤«¡¢¼Â¸ú¥æ¡¼¥¶ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤Ç¤·¤« +ÍøÍѤǤ­¤Ê¤¤¡£ +.TP +.B SO_ERROR +.\"O Get and clear the pending socket error. +.\"O Only valid as a +.\"O .BR getsockopt (2). +.\"O Expects an integer. +ÊÝα¤Ë¤Ê¤Ã¤Æ¤¤¤¿¥½¥±¥Ã¥È¥¨¥é¡¼¤ò¼èÆÀ¤·¤Æ¥¯¥ê¥¢¤¹¤ë¡£ +.BR getsockopt (2) +¤Ç¤Î¤ßÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +À°¿ôÃͤò¤È¤ë¡£ +.TP +.B SO_DONTROUTE +.\"O Don't send via a gateway, only send to directly connected hosts. +.\"O The same effect can be achieved by setting the +.\"O .B MSG_DONTROUTE +.\"O flag on a socket +.\"O .BR send (2) +.\"O operation. +.\"O Expects an integer boolean flag. +¥²¡¼¥È¥¦¥§¥¤¤ò·Ðͳ¤»¤º¡¢Ä¾ÀÜÀܳ¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¤ËÁ÷¿®¤¹¤ë¡£ +.BR send (2) +Áàºî¤Ç +.B MSG_DONTROUTE +¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¤¿¾ì¹ç¤âƱ¤¸¸ú²Ì¤¬ÆÀ¤é¤ì¤ë¡£ +¥Ö¡¼¥ëÀ°¿ô¤Î¥Õ¥é¥°¤ò¼è¤ë¡£ +.TP +.B SO_KEEPALIVE +.\"O Enable sending of keep-alive messages on connection-oriented sockets. +.\"O Expects an integer boolean flag. +Àܳ»Ö¸þ¤Î¥½¥±¥Ã¥È¤ËÂФ¹¤ë keep-alive ¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¥Ö¡¼¥ëÃͤÎÀ°¿ô¥Õ¥é¥°¤ò¤È¤ë¡£ +.TP +.B SO_LINGER +.\"O Sets or gets the +.\"O .B SO_LINGER +.\"O option. +.\"O The argument is a +.\"O .I linger +.\"O structure. +.B SO_LINGER +¥ª¥×¥·¥ç¥ó¤ò¼èÆÀ¡¦ÀßÄꤹ¤ë¡£°ú¤­¿ô¤Ë¤Ï +.I linger +¹½Â¤ÂΤò¼è¤ë¡£ +.sp +.in +4n +.nf +struct linger { + int l_onoff; /* linger active */ + int l_linger; /* how many seconds to linger for */ +}; +.fi +.in +.IP +.\"O When enabled, a +.\"O .BR close (2) +.\"O or +.\"O .BR shutdown (2) +.\"O will not return until all queued messages for the socket have been +.\"O successfully sent or the linger timeout has been reached. +.\"O Otherwise, +.\"O the call returns immediately and the closing is done in the background. +.\"O When the socket is closed as part of +.\"O .BR exit (2), +.\"O it always lingers in the background. +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +.BR close (2) +¤ä +.BR shutdown (2) +¤Ï¡¢¤½¤Î¥½¥±¥Ã¥È¤Ë¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤¬¤¹¤Ù¤ÆÁ÷¿®´°Î»¤¹¤ë¤«¡¢ +linger (µï»Ä¤ê) ¥¿¥¤¥à¥¢¥¦¥È¤Ë¤Ê¤ë¤Þ¤ÇÊÖ¤é¤Ê¤¤¡£Ìµ¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +¤³¤ì¤é¤Î¥³¡¼¥ë¤Ï¤¿¤À¤Á¤ËÌá¤ê¡¢¥¯¥í¡¼¥ºÆ°ºî¤Ï¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤Ç¹Ô¤ï¤ì¤ë¡£ +¥½¥±¥Ã¥È¤Î¥¯¥í¡¼¥º¤ò +.BR exit (2) +¤Î°ìÉô¤È¤·¤Æ¹Ô¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢»Ä¤Ã¤Æ¤¤¤ë¥½¥±¥Ã¥È¤Î +¥¯¥í¡¼¥ºÆ°ºî¤Ïɬ¤º¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤ËÁ÷¤é¤ì¤ë¡£ +.TP +.B SO_OOBINLINE +.\"O If this option is enabled, +.\"O out-of-band data is directly placed into the receive data stream. +.\"O Otherwise out-of-band data is only passed when the +.\"O .B MSG_OOB +.\"O flag is set during receiving. +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢ÂÓ°è³°¥Ç¡¼¥¿ (out-of-band data) ¤Ï +¼õ¿®¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥àÃæ¤ËÃÖ¤«¤ì¤ë¡£Í­¸ú¤Ë¤·¤Ê¤±¤ì¤Ð¡¢ +ÂÓ°è³°¥Ç¡¼¥¿¤Ï¼õ¿®»þ¤Ë +.B MSG_OOB +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¸Â¤Ã¤ÆÅϤµ¤ì¤ë¡£ +.\"O .\" don't document it because it can do too much harm. +.\"O .\".B SO_NO_CHECK +.\" ¤¢¤Þ¤ê¤Ë´í¸±¤Ê¤³¤È¤¬¤Ç¤­¤ë¤Î¤Ç¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ïµ­ºÜ¤·¤Ê¤¤¤³¤È¡£ +.\".B SO_NO_CHECK +.TP +.B SO_PASSCRED +.\"O Enable or disable the receiving of the +.\"O .B SCM_CREDENTIALS +.\"O control message. +.\"O For more information see +.\"O .BR unix (7). +.B SCM_CREDENTIALS +À©¸æ¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®¤òÍ­¸ú/̵¸ú¤Ë¤¹¤ë¡£¾ÜºÙ¤Ï +.BR unix (7) +¤ò»²¾È¤Î¤³¤È¡£ +.\" FIXME Document SO_PASSSEC, added in 2.6.18; there is some info +.\" in the 2.6.18 ChangeLog +.TP +.B SO_PEERCRED +.\"O Return the credentials of the foreign process connected to this socket. +.\"O This is only possible for connected +.\"O .B AF_UNIX +.\"O stream sockets and +.\"O .B AF_UNIX +.\"O stream and datagram socket pairs created using +.\"O .BR socketpair (2); +.\"O see +.\"O .BR unix (7). +¤³¤Î¥½¥±¥Ã¥È¤ËÀܳ¤·¤Æ¤­¤¿³°Éô¥×¥í¥»¥¹¤Î¿®Ç¤¾õ (credential) ¤òÊÖ¤¹¡£ +¤³¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÍøÍѤǤ­¤ë¤Î¤Ï¡¢ +Àܳ¤µ¤ì¤¿ +.B AF_UNIX +¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È´Ö¡¢¤ª¤è¤Ó +.BR socketpair (2) +¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿ +.B AF_UNIX +¤Î¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¤È¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤Î¥Ú¥¢¤À¤±¤Ç¤¢¤ë¡£ +.BR unix (7) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O The returned credentials are those that were in effect at the time +.\"O of the call to +.\"O .BR connect (2) +.\"O or +.\"O .BR socketpair (2). +.\"O Argument is a +.\"O .I ucred +.\"O structure. +.\"O Only valid as a +.\"O .BR getsockopt (2). +.BR connect (2) +¤ä +.BR socketpair (2) +¤¬¸Æ¤Ð¤ì¤¿»þ¤ËÍ­¸ú¤Ç¤¢¤Ã¤¿¿®Ç¤¾õ¤¬ÊÖ¤µ¤ì¤ë¡£ +°ú¤­¿ô¤Ï +.I ucred +¹½Â¤ÂΤǤ¢¤ë¡£ +.BR getsockopt (2) +¤Ç¤Î¤ßÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B SO_PRIORITY +.\"O Set the protocol-defined priority for all packets to be sent on +.\"O this socket. +.\"O Linux uses this value to order the networking queues: +.\"O packets with a higher priority may be processed first depending +.\"O on the selected device queueing discipline. +.\"O For +.\"O .BR ip (7), +.\"O this also sets the IP type-of-service (TOS) field for outgoing packets. +.\"O Setting a priority outside the range 0 to 6 requires the +.\"O .B CAP_NET_ADMIN +.\"O capability. +¥×¥í¥È¥³¥ë¤ÇÄêµÁ¤µ¤ì¤¿Í¥ÀèÅÙ¤ò¡¢¤³¤Î¥½¥±¥Ã¥È¤«¤é +Á÷¿®¤µ¤ì¤ëÁ´¤Æ¤Î¥Ñ¥±¥Ã¥È¤Ë¥»¥Ã¥È¤¹¤ë¡£ Linux ¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥­¥å¡¼ÆâÉô¤Î +À°Îó¤Ë¤³¤ÎÃͤòÍѤ¤¤ë¡£¹â¤¤Í¥ÀèÅÙ¤ò»ý¤Ã¤Æ¤¤¤ë¥Ñ¥±¥Ã¥È¤ÏÀè¤Ë½èÍý¤µ¤ì¤ë¡£ +¤¿¤À¤·¤½¤Î¥Ç¥Ð¥¤¥¹¤Î¥­¥å¡¼½èÍý¤Î¤ä¤êÊý¤Ë°Í¸¤¹¤ë¡£ +.BR ip (7) +¤Ç¤Ï¡¢³°¸þ¤±¥Ñ¥±¥Ã¥È¤Î IP type-of-service (TOS) ¥Õ¥£¡¼¥ë¥É¤Ë¤â¤³¤ÎÃͤ¬ÀßÄꤵ¤ì¤ë¡£ +0 ¤«¤é 6 °Ê³°¤ÎÍ¥ÀèÅÙ¤ò¥»¥Ã¥È¤¹¤ë¤Ë¤Ï +.B CAP_NET_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.TP +.B SO_RCVBUF +.\"O Sets or gets the maximum socket receive buffer in bytes. +.\"O The kernel doubles this value (to allow space for bookkeeping overhead) +.\"O when it is set using +.\"O .\" Most (all?) other implementations do not do this -- MTK, Dec 05 +.\"O .BR setsockopt (2), +.\"O and this doubled value is returned by +.\"O .BR getsockopt (2). +.\"O The default value is set by the +.\"O .I /proc/sys/net/core/rmem_default +.\"O file, and the maximum allowed value is set by the +.\"O .I /proc/sys/net/core/rmem_max +.\"O file. +.\"O The minimum (doubled) value for this option is 256. +¥½¥±¥Ã¥È¤Î¼õ¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇÂ祵¥¤¥º¤òÀßÄꡦ¼èÆÀ¤¹¤ë (¥Ð¥¤¥Èñ°Ì)¡£ +.BR setsockopt (2) +¤ò»È¤Ã¤ÆÃͤ¬ÀßÄꤵ¤ì¤¿¤È¤­¤Ë (´ÉÍý¥ª¡¼¥Ð¥Ø¥Ã¥ÉÍѤÎÎΰè¤ò³ÎÊݤ¹¤ë¤¿¤á¤Ë) +¥«¡¼¥Í¥ë¤Ï¤³¤ÎÃͤò 2Çܤ·¡¢ +.\" ¾¤Î¤Û¤È¤ó¤É¤Î (Á´¤Æ¤Î?) ¼ÂÁõ¤Ç¤Ï¤³¤ó¤Ê¤³¤È¤Ï¹Ô¤Ã¤Æ¤¤¤Ê¤¤ -- MTK, Dec 05 +.BR getsockopt (2) +¤Ï¤³¤Î 2Çܤµ¤ì¤¿ÃͤòÊÖ¤¹¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï +.I /proc/sys/net/core/rmem_default +¥Õ¥¡¥¤¥ë¤ÇÀßÄꤵ¤ì¡¢µöÍƤµ¤ì¤ëºÇÂç¤ÎÃÍ¤Ï +.I /proc/sys/net/core/rmem_max +¥Õ¥¡¥¤¥ë¤ÇÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÎºÇ¾®ÃÍ¤Ï (2Çܤ·¤¿ÃͤÇ) 256 ¤Ç¤¢¤ë¡£ +.TP +.\"O .BR SO_RCVBUFFORCE " (since Linux 2.6.14)" +.BR SO_RCVBUFFORCE " (Linux 2.6.14 °Ê¹ß)" +.\"O Using this socket option, a privileged +.\"O .RB ( CAP_NET_ADMIN ) +.\"O process can perform the same task as +.\"O .BR SO_RCVBUF , +.\"O but the +.\"O .I rmem_max +.\"O limit can be overridden. +¤³¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¡¢Æø¢¥×¥í¥»¥¹ +.RB ( CAP_NET_ADMIN +¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Ï +.B SO_RCVBUF +¤ÈƱ¤¸¤³¤È¤ò¼Â¹Ô¤Ç¤­¤ë¡£ +¤¿¤À¤·¡¢¾å¸Â +.I rmem_max +¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.\"O .BR SO_RCVLOWAT " and " SO_SNDLOWAT +.BR SO_RCVLOWAT " ¤È " SO_SNDLOWAT +.\"O Specify the minimum number of bytes in the buffer until the socket layer +.\"O will pass the data to the protocol +.\"O .RB ( SO_SNDLOWAT ) +.\"O or the user on receiving +.\"O .RB ( SO_RCVLOWAT ). +.\"O These two values are initialized to 1. +.\"O .B SO_SNDLOWAT +.\"O is not changeable on Linux +.\"O .RB ( setsockopt (2) +.\"O fails with the error +.\"O .BR ENOPROTOOPT ). +.\"O .B SO_RCVLOWAT +.\"O is changeable +.\"O only since Linux 2.4. +¥Ð¥Ã¥Õ¥¡Ãæ¤Ëί¤á¤ë¤³¤È¤Î¤Ç¤­¤ë¥Ç¡¼¥¿¤ÎºÇ¾®Ãͤò»ØÄꤹ¤ë¡£ +¤³¤Î¥µ¥¤¥º¤ò±Û¤¨¤ë¤È¡¢¥½¥±¥Ã¥ÈÁؤϤ½¤Î¥Ç¡¼¥¿¤ò¥×¥í¥È¥³¥ë¤ËÅϤ· +.RB ( SO_SNDLOWAT )¡¢ +¼õ¿®»þ¤Ë¤Ï¥æ¡¼¥¶¤ËÅϤ¹ +.RB ( SO_RCVLOWAT )¡£ +¤³¤ì¤éÆó¤Ä¤ÎÃÍ¤Ï 1 ¤Ë½é´ü²½¤µ¤ì¤ë¡£ +.B SO_SNDLOWAT +¤Ï Linux ¤Ç¤ÏÊѹ¹¤Ç¤­¤Ê¤¤ +.RB ( setsockopt (2) +¤Ï +.B ENOPROTOOPT +¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë)¡£ +.B SO_RCVLOWAT +¤Ï Linux 2.4 °Ê¹ß¤Ç¤Î¤ßÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +.\"O The +.\"O .BR select (2) +.\"O and +.\"O .BR poll (2) +.\"O system calls currently do not respect the +.\"O .B SO_RCVLOWAT +.\"O setting on Linux, +.\"O and mark a socket readable when even a single byte of data is available. +.\"O A subsequent read from the socket will block until +.\"O .B SO_RCVLOWAT +.\"O bytes are available. +.\"O .\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2 +.\"O .\" Tested on kernel 2.6.14 -- mtk, 30 Nov 05 +¸½¾õ¡¢Linux ¤Ç¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR select (2) +¤È +.BR poll (2) +¤Ï +.B SO_RCVLOWAT +¤ÎÀßÄê¤ò¹Íθ¤ËÆþ¤ì¤º¤ËÆ°ºî¤·¡¢ +¥Ç¡¼¥¿¤¬1¥Ð¥¤¥ÈÍøÍѲÄǽ¤Ë¤Ê¤Ã¤¿¤À¤±¤Ç¤â¡¢ +¥½¥±¥Ã¥È¤ÏÆɤ߽Ф·²Äǽ¤È¤Î¥Þ¡¼¥¯¤ò¤Ä¤±¤ë¡£ +°ìÊý¡¢¤½¤ì¤Ë³¤±¤Æ¹Ô¤¦¥½¥±¥Ã¥È¤«¤é¤Î read ¤Ï +.B SO_RCVLOWAT +¥Ð¥¤¥È¤Î¥Ç¡¼¥¿¤¬ÍøÍѲÄǽ¤Ë¤Ê¤ë¤Þ¤ÇÄä»ß¤·¤Æ¤·¤Þ¤¦¡£ +.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2 +.\" Tested on kernel 2.6.14 -- mtk, 30 Nov 05 +.TP +.\"O .BR SO_RCVTIMEO " and " SO_SNDTIMEO +.BR SO_RCVTIMEO " ¤È " SO_SNDTIMEO +.\"O .\" Not implemented in 2.0. +.\"O .\" Implemented in 2.1.11 for getsockopt: always return a zero struct. +.\"O .\" Implemented in 2.3.41 for setsockopt, and actually used. +.\" 2.0 ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" getsockopt ¤Ë¤Ä¤¤¤Æ¤Ï 2.1.11 ¤Ç¼ÂÁõ¤µ¤ì¤¿¡£¾ï¤Ë 0 ¤Î¹½Â¤ÂΤòÊÖ¤¹¡£ +.\" setsockopt ¤Ë¤Ä¤¤¤Æ¤Ï 2.3.41 ¤Ç¼ÂÁõ¤µ¤ì¡¢¼ÂºÝ¤Ë»È¤ï¤ì¤Æ¤¤¤ë¡£ +.\"O Specify the receiving or sending timeouts until reporting an error. +.\"O The argument is a +.\"O .IR "struct timeval" . +.\"O If an input or output function blocks for this period of time, and +.\"O data has been sent or received, the return value of that function +.\"O will be the amount of data transferred; if no data has been transferred +.\"O and the timeout has been reached then \-1 is returned with +.\"O .I errno +.\"O set to +.\"O .B EAGAIN +.\"O or +.\"O .B EWOULDBLOCK +.\"O .\" in fact to EAGAIN +.\"O just as if the socket was specified to be nonblocking. +.\"O If the timeout is set to zero (the default) +.\"O then the operation will never timeout. +Á÷¿®¡¦¼õ¿®¤Î¥¿¥¤¥à¥¢¥¦¥È¤ò»ØÄꤹ¤ë¡£¤³¤ì¤ò±Û¤¨¤ë¤È¥¨¥é¡¼¤òÊó¹ð¤¹¤ë¡£ +°ú¤­¿ô¤Ï +.I "struct timeval" +¤Ç¤¢¤ë¡£ +Æþ½ÐÎÏ´Ø¿ô¤¬¥¿¥¤¥à¥¢¥¦¥È»þ´Ö¤Î´Ö¥Ö¥í¥Ã¥¯¤µ¤ì¡¢¤«¤Ä¥Ç¡¼¥¿¤ÎÁ÷¿®¤Þ¤¿¤Ï +¼õ¿®¤¬¹Ô¤ï¤ì¤Æ¤¤¤¿¾ì¹ç¤Ï¡¢Å¾Á÷¤µ¤ì¤¿¥Ç¡¼¥¿Î̤¬´Ø¿ô¤ÎÊÖ¤êÃͤȤʤ롣 +²¿¤â¥Ç¡¼¥¿¤¬Å¾Á÷¤µ¤ì¤º¤Ë¥¿¥¤¥à¥¢¥¦¥È¤Ë㤷¤¿¾ì¹ç¤Ï¡¢ +\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤« +.B EWOULDBLOCK +¤òÀßÄꤵ¤ì¡¢ +.\" ¼ÂºÝ¤Ë¤Ï EAGAIN ¤¬ÀßÄꤵ¤ì¤ë +¤¢¤¿¤«¤â¥½¥±¥Ã¥È¤ËÈó¥Ö¥í¥Ã¥­¥ó¥°¤¬»ØÄꤵ¤ì¤¿¤è¤¦¤Ë¸«¤¨¤ë¡£ +¥¿¥¤¥à¥¢¥¦¥ÈÃÍ¤Ë (¥Ç¥Õ¥©¥ë¥ÈÃͤǤ¢¤ë) 0 ¤ËÀßÄꤹ¤ë¤È¡¢ +Áàºî¤Ï·è¤·¤Æ¥¿¥¤¥à¥¢¥¦¥È¤·¤Ê¤¯¤Ê¤ë¡£ +.\"O Timeouts only have effect for system calls that perform socket I/O (e.g., +.\"O .BR read (2), +.\"O .BR recvmsg (2), +.\"O .BR send (2), +.\"O .BR sendmsg (2)); +.\"O timeouts have no effect for +.\"O .BR select (2), +.\"O .BR poll (2), +.\"O .BR epoll_wait (2), +.\"O etc. +¥¿¥¤¥à¥¢¥¦¥È¤¬±Æ¶Á¤òµÚ¤Ü¤¹¤Î¤Ï¡¢ +¥½¥±¥Ã¥È I/O ¤ò¼Â¹Ô¤¹¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤À¤± +(Î㤨¤Ð +.BR read (2), +.BR recvmsg (2), +.BR send (2), +.BR sendmsg (2)) +¤Ç¤¢¤ë¡£ +.BR select (2), +.BR poll (2), +.BR epoll_wait (2) +¤Ê¤É¤Ë¤Ï¥¿¥¤¥à¥¢¥¦¥È¤Ï±Æ¶Á¤òµÚ¤Ü¤µ¤Ê¤¤¡£ +.TP +.B SO_REUSEADDR +.\"O Indicates that the rules used in validating addresses supplied in a +.\"O .BR bind (2) +.\"O call should allow reuse of local addresses. +.\"O For +.\"O .B AF_INET +.\"O sockets this +.\"O means that a socket may bind, except when there +.\"O is an active listening socket bound to the address. +.\"O When the listening socket is bound to +.\"O .B INADDR_ANY +.\"O with a specific port then it is not possible +.\"O to bind to this port for any local address. +.\"O Argument is an integer boolean flag. +.BR bind (2) +¥³¡¼¥ë¤ËÍ¿¤¨¤é¤ì¤¿¥¢¥É¥ì¥¹¤¬Àµ¤·¤¤¤«¤òȽÃǤ¹¤ë¥ë¡¼¥ë¤Ç¡¢ +¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤ÎºÆÍøÍѤò²Äǽ¤Ë¤¹¤ë¡£ +¤Ä¤Þ¤ê +.B AF_INET +¥½¥±¥Ã¥È¤Ê¤é¡¢¤½¤Î¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤¿¥¢¥¯¥Æ¥£¥Ö¤Ê listen +¾õÂ֤Υ½¥±¥Ã¥È¤¬Â¸ºß¤·¤Ê¤¤¸Â¤ê¡¢¥Ð¥¤¥ó¥É¤¬¹Ô¤¨¤ë¡£ +listen ¾õÂ֤Υ½¥±¥Ã¥È¤¬¥¢¥É¥ì¥¹ +.B INADDR_ANY +¤ÇÆÃÄê¤Î¥Ý¡¼¥È¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤³¤Î¥Ý¡¼¥È¤ËÂФ·¤Æ¤Ï¡¢¤É¤ó¤Ê¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤Ç¤â¥Ð¥¤¥ó¥É¤Ç¤­¤Ê¤¤¡£ +°ú¤­¿ô¤Ï¥Ö¡¼¥ëÀ°¿ô¤Î¥Õ¥é¥°¤Ç¤¢¤ë¡£ +.TP +.B SO_SNDBUF +.\"O Sets or gets the maximum socket send buffer in bytes. +.\"O The kernel doubles this value (to allow space for bookkeeping overhead) +.\"O when it is set using +.\"O .\" Most (all?) other implementations do not do this -- MTK, Dec 05 +.\"O .BR setsockopt (2), +.\"O and this doubled value is returned by +.\"O .BR getsockopt (2). +.\"O The default value is set by the +.\"O .I /proc/sys/net/core/wmem_default +.\"O file and the maximum allowed value is set by the +.\"O .I /proc/sys/net/core/wmem_max +.\"O file. +.\"O The minimum (doubled) value for this option is 2048. +¥½¥±¥Ã¥È¤ÎÁ÷¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇÂ祵¥¤¥º¤òÀßÄꡦ¼èÆÀ¤¹¤ë (¥Ð¥¤¥Èñ°Ì)¡£ +.BR setsockopt (2) +¤ò»È¤Ã¤ÆÃͤ¬ÀßÄꤵ¤ì¤¿¤È¤­¤Ë (´ÉÍý¥ª¡¼¥Ð¥Ø¥Ã¥ÉÍѤÎÎΰè¤ò³ÎÊݤ¹¤ë¤¿¤á¤Ë) +¥«¡¼¥Í¥ë¤Ï¤³¤ÎÃͤò 2Çܤ·¡¢ +.\" ¾¤Î¤Û¤È¤ó¤É¤Î (Á´¤Æ¤Î?) ¼ÂÁõ¤Ç¤Ï¤³¤ó¤Ê¤³¤È¤Ï¹Ô¤Ã¤Æ¤¤¤Ê¤¤ -- MTK, Dec 05 +.BR getsockopt (2) +¤Ï¤³¤Î 2Çܤµ¤ì¤¿ÃͤòÊÖ¤¹¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï +.I /proc/sys/net/core/wmem_default +¥Õ¥¡¥¤¥ë¤ÇÀßÄꤵ¤ì¡¢µöÍƤµ¤ì¤ëºÇÂç¤ÎÃÍ¤Ï +.I /proc/sys/net/core/wmem_max +¥Õ¥¡¥¤¥ë¤ÇÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÎºÇ¾®ÃÍ¤Ï (2Çܤ·¤¿ÃͤÇ) 2048 ¤Ç¤¢¤ë¡£ +.TP +.\"O .BR SO_SNDBUFFORCE " (since Linux 2.6.14)" +.BR SO_SNDBUFFORCE " (Linux 2.6.14 °Ê¹ß)" +.\"O Using this socket option, a privileged +.\"O .RB ( CAP_NET_ADMIN ) +.\"O process can perform the same task as +.\"O .BR SO_SNDBUF , +.\"O but the +.\"O .I wmem_max +.\"O limit can be overridden. +¤³¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¡¢Æø¢¥×¥í¥»¥¹ +.RB ( CAP_NET_ADMIN +¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Ï +.B SO_SNDBUF +¤ÈƱ¤¸¤³¤È¤ò¼Â¹Ô¤Ç¤­¤ë¡£ +¤¿¤À¤·¡¢¾å¸Â +.I wmem_max +¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B SO_TIMESTAMP +.\"O Enable or disable the receiving of the +.\"O .B SO_TIMESTAMP +.\"O control message. +.\"O The timestamp control message is sent with level +.\"O .B SOL_SOCKET +.\"O and the +.\"O .I cmsg_data +.\"O field is a +.\"O .I "struct timeval" +.\"O indicating the +.\"O reception time of the last packet passed to the user in this call. +.\"O See +.\"O .BR cmsg (3) +.\"O for details on control messages. +.B SO_TIMESTAMP +À©¸æ¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®¤òÍ­¸ú/̵¸ú¤Ë¤¹¤ë¡£ +¥¿¥¤¥à¥¹¥¿¥ó¥×À©¸æ¥á¥Ã¥»¡¼¥¸¤Ï¥ì¥Ù¥ë +.B SOL_SOCKET +¤ÇÁ÷¿®¤µ¤ì¡¢ +.I cmsg_data +¥Õ¥£¡¼¥ë¥É¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¥æ¡¼¥¶¤ËÅϤ·¤¿ +ºÇ¸å¤Î¥Ñ¥±¥Ã¥È¤Î¼õ¿®»þ¹ï¤ò¼¨¤¹ +.I "struct timeval" +¤Ç¤¢¤ë¡£ +À©¸æ¥á¥Ã¥»¡¼¥¸¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR cmsg (3) +¤ò»²¾È¡£ +.TP +.B SO_TYPE +.\"O Gets the socket type as an integer (like +.\"O .BR SOCK_STREAM ). +.\"O Can only be read +.\"O with +.\"O .BR getsockopt (2). +¥½¥±¥Ã¥È¤Î¥¿¥¤¥×¤òÀ°¿ô¤Ç¼èÆÀ¤¹¤ë (Îã: +.BR SOCK_STREAM )¡£ +.BR getsockopt (2) +¤«¤é¤Î¤ßÆɤ߽Ф·²Äǽ¤Ç¤¢¤ë¡£ +.\"O .SS Signals +.SS ¥·¥°¥Ê¥ë +.\"O When writing onto a connection-oriented socket that has been shut down +.\"O (by the local or the remote end) +.\"O .B SIGPIPE +.\"O is sent to the writing process and +.\"O .B EPIPE +.\"O is returned. +.\"O The signal is not sent when the write call +.\"O specified the +.\"O .B MSG_NOSIGNAL +.\"O flag. +(¥í¡¼¥«¥ë¤â¤·¤¯¤Ï¥ê¥â¡¼¥È¦¤Ç) ÀÚÃǤµ¤ì¤¿ +Àܳ»Ø¸þ (connection-oriented) ¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ +½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤È¡¢¤½¤Î½ñ¤­¹þ¤ß¤ò¹Ô¤Ã¤¿¥×¥í¥»¥¹¤Ë +.B SIGPIPE +¤¬Á÷¤é¤ì¡¢ +.B EPIPE +¤¬ÊÖ¤µ¤ì¤ë¡£ write ¸Æ¤Ó½Ð¤·¤Ë +.B MSG_NOSIGNAL +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¤¤¤¿¾ì¹ç¤Ï¥·¥°¥Ê¥ë¤ÏÁ÷¤é¤ì¤Ê¤¤¡£ +.PP +.\"O When requested with the +.\"O .B FIOSETOWN +.\"O .BR fcntl (2) +.\"O or +.\"O .B SIOCSPGRP +.\"O .BR ioctl (2), +.\"O .B SIGIO +.\"O is sent when an I/O event occurs. +.\"O It is possible to use +.\"O .BR poll (2) +.\"O or +.\"O .BR select (2) +.\"O in the signal handler to find out which socket the event occurred on. +.B FIOSETOWN +.BR fcntl (2) +¤ä +.B SIOCSPGRP +.BR ioctl (2) +¤ò¥×¥í¥»¥¹¤Þ¤¿¤Ï¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë»ØÄꤷ¤Æ¤ª¤¯¤È¡¢ +I/O ¥¤¥Ù¥ó¥È¤¬µ¯¤­¤¿¤È¤­¤Ë +.B SIGIO +¤¬Á÷¤é¤ì¤ë¡£ +.BR poll (2) +¤ä +.BR select (2) +¤ò¥·¥°¥Ê¥ë¥Ï¥ó¥É¥éÆâ¤ÇÍѤ¤¤ì¤Ð¡¢¤É¤Î¥½¥±¥Ã¥È¤Ç¥¤¥Ù¥ó¥È¤¬µ¯¤³¤Ã¤¿¤«¤ò +ÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.\"O An alternative (in Linux 2.2) is to set a real-time signal using the +.\"O .B F_SETSIG +.\"O .BR fcntl (2); +.\"O the handler of the real time signal will be called with +.\"O the file descriptor in the +.\"O .I si_fd +.\"O field of its +.\"O .IR siginfo_t . +.\"O See +.\"O .BR fcntl (2) +.\"O for more information. +(Linux 2.2 ¤Ë¤ª¤±¤ë) Ê̤ÎÊýË¡¤È¤·¤Æ¤Ï¡¢ +.B F_SETSIG +.BR fcntl (2) +¤òÍѤ¤¤Æ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤òÀßÄꤹ¤ë¤ä¤êÊý¤â¤¢¤ë¡£ +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î¥Ï¥ó¥É¥é¤Ï¡¢ +.I siginfo_t +¤Î +.I si_fd +¥Õ¥£¡¼¥ë¥É¤Ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Æþ¤Ã¤¿¾õÂ֤ǸƤӽФµ¤ì¤ë¡£ +¾ÜºÙ¤Ï +.BR fcntl (2) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +.\"O Under some circumstances (e.g., multiple processes accessing a +.\"O single socket), the condition that caused the +.\"O .B SIGIO +.\"O may have already disappeared when the process reacts to the signal. +.\"O If this happens, the process should wait again because Linux +.\"O will resend the signal later. +¾õ¶·¤Ë¤è¤Ã¤Æ¤Ï (Î㤨¤ÐÊ£¿ô¤Î¥×¥í¥»¥¹¤¬°ì¤Ä¤Î¥½¥±¥Ã¥È¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¤¤ë¤Ê¤É)¡¢ +.B SIGIO +¤Î¸¶°ø¤È¤Ê¤Ã¤¿¾õÂ֤ϡ¢¥×¥í¥»¥¹¤¬¤½¤Î¥·¥°¥Ê¥ë¤Ø¤ÎÂбþ¤ò¹Ô¤Ã¤¿¤È¤­¤Ë¤Ï +¾Ã¤¨¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î¾ì¹ç¤Ï¡¢¥×¥í¥»¥¹¤ÏºÆ¤ÓÂԤĤ褦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Linux ¤ÏƱ¤¸¥·¥°¥Ê¥ë¤ò¸å¤ÇºÆÁ÷¤¹¤ë¤«¤é¤Ç¤¢¤ë¡£ +.\" .SS Ancillary Messages +.\"O .SS /proc interfaces +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.\"O The core socket networking parameters can be accessed +.\"O via files in the directory +.\"O .IR /proc/sys/net/core/ . +core ¤Î¥½¥±¥Ã¥È¤Î¥Í¥Ã¥È¥ï¡¼¥­¥ó¥°¥Ñ¥é¥á¡¼¥¿¤Ë¤Ï¡¢ +.I /proc/sys/net/core/ +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤òÄ̤·¤Æ¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.TP +.I rmem_default +.\"O contains the default setting in bytes of the socket receive buffer. +¥½¥±¥Ã¥È¤Î¼õ¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ (¥Ð¥¤¥Èñ°Ì)¡£ +.TP +.I rmem_max +.\"O contains the maximum socket receive buffer size in bytes which a user may +.\"O set by using the +.\"O .B SO_RCVBUF +.\"O socket option. +.B SO_RCVBUF +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤Æ¥æ¡¼¥¶¤¬ÀßÄê¤Ç¤­¤ë +¥½¥±¥Ã¥È¤Î¼õ¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ÎºÇÂçÃÍ (¥Ð¥¤¥Èñ°Ì)¡£ +.TP +.I wmem_default +.\"O contains the default setting in bytes of the socket send buffer. +¥½¥±¥Ã¥È¤ÎÁ÷¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ (¥Ð¥¤¥Èñ°Ì)¡£ +.TP +.I wmem_max +.\"O contains the maximum socket send buffer size in bytes which a user may +.\"O set by using the +.\"O .B SO_SNDBUF +.\"O socket option. +.B SO_SNDBUF +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤Æ¥æ¡¼¥¶¤¬ÀßÄê¤Ç¤­¤ë +¥½¥±¥Ã¥È¤ÎÁ÷¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ÎºÇÂçÃÍ (¥Ð¥¤¥Èñ°Ì)¡£ +.TP +.\"O .IR message_cost " and " message_burst +.IR message_cost " ¤È " message_burst +.\"O configure the token bucket filter used to load limit warning messages +.\"O caused by external network events. +¥È¡¼¥¯¥ó¡¦¥Ð¥±¥Ã¥È¡¦¥Õ¥£¥ë¥¿¡¼¤òÀßÄꤹ¤ë¡£ +¤³¤ì¤Ï³°Éô¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥Ù¥ó¥È¤Ë¤è¤Ã¤Æ°ú¤­µ¯¤³¤µ¤ì¤¿ +Éé²Ù¸Â³¦¤Î·Ù¹ð¥á¥Ã¥»¡¼¥¸¤ËÍѤ¤¤é¤ì¤ë¡£ +.\"NAKANO "load limit" ¤À¤È»×¤¦¤ó¤À¤±¤É... +.TP +.I netdev_max_backlog +.\"O Maximum number of packets in the global input queue. +¥°¥í¡¼¥Ð¥ë¤ÊÆþÎÏ¥­¥å¡¼¤Ë¤ª¤±¤ëºÇÂç¤Î¥Ñ¥±¥Ã¥È¿ô¡£ +.TP +.I optmem_max +.\"O Maximum length of ancillary data and user control data like the iovecs +.\"O per socket. +¥½¥±¥Ã¥È¤¢¤¿¤ê¤Î¡¢Êä½õ¥Ç¡¼¥¿ (ancillary data) ¤È¥æ¡¼¥¶À©¸æ¥Ç¡¼¥¿ +(iovecs ¤Î¤è¤¦¤Ê¤â¤Î) ¤È¤ÎϤκÇÂçĹ¡£ +.\" netdev_fastroute is not documented because it is experimental +.\"O .SS Ioctls +.SS ioctl +.\"O These operations can be accessed using +.\"O .BR ioctl (2): +°Ê²¼¤Ë¼¨¤¹Áàºî¤Ë¤Ï +.BR ioctl (2) +¤òÍѤ¤¤Æ¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ + +.in +4n +.nf +.IB error " = ioctl(" ip_socket ", " ioctl_type ", " &value_result ");" +.fi +.in +.TP +.B SIOCGSTAMP +.\"O Return a +.\"O .I struct timeval +.\"O with the receive timestamp of the last packet passed to the user. +.\"O This is useful for accurate round trip time measurements. +.\"O See +.\"O .BR setitimer (2) +.\"O for a description of +.\"O .IR "struct timeval" . +ºÇ¸å¤Ë¥æ¡¼¥¶¤ËÅϤµ¤ì¤¿¥Ñ¥±¥Ã¥È¤Î¼õ¿®¥¿¥¤¥à¥¹¥¿¥ó¥×¤ò +.I struct timeval +¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +¤³¤ì¤Ï round trip »þ´Ö¤òÀµ³Î¤Ë¬¤ê¤¿¤¤¤È¤­¤ËÊØÍø¤Ç¤¢¤ë¡£ +.I struct timeval +¤ÎÀâÌÀ¤Ï +.BR setitimer (2) +¤ò¸«¤Æ¤Û¤·¤¤¡£ +.\" +.\"O This ioctl should only be used if the socket option +.\"O .B SO_TIMESTAMP +.\"O is not set on the socket. +.\"O Otherwise, it returns the timestamp of the +.\"O last packet that was received while +.\"O .B SO_TIMESTAMP +.\"O was not set, or it fails if no such packet has been received, +.\"O (i.e., +.\"O .BR ioctl (2) +.\"O returns \-1 with +.\"O .I errno +.\"O set to +.\"O .BR ENOENT ). +¤³¤Î ioctl ¤Ï¡¢¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.B SO_TIMESTAMP +¤¬¥½¥±¥Ã¥È¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Î¤ß»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤µ¤â¤Ê¤±¤ì¤Ð¡¢¤³¤Î ioctl ¤Ï +.B SO_TIMESTAMP +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿´Ö¤Ë¼õ¿®¤·¤¿ºÇ¸å¤Î¥Ñ¥±¥Ã¥È¤Î»þ¹ï¤òÊÖ¤¹¤«¡¢ +¤½¤Î¤è¤¦¤Ê¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¼ºÇÔ¤¹¤ë +(¤Ä¤Þ¤ê¡¢ +.BR ioctl (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B ENOENT +¤ò¥»¥Ã¥È¤¹¤ë)¡£ +.TP +.B SIOCSPGRP +.\"O Set the process or process group to send +.\"O .B SIGIO +.\"O or +.\"O .B SIGURG +.\"O signals +.\"O to when an +.\"O asynchronous I/O operation has finished or urgent data is available. +.\"O The argument is a pointer to a +.\"O .IR pid_t . +.\"O If the argument is positive, send the signals to that process. +.\"O If the +.\"O argument is negative, send the signals to the process group with the ID +.\"O of the absolute value of the argument. +.\"O The process may only choose itself or its own process group to receive +.\"O signals unless it has the +.\"O .B CAP_KILL +.\"O capability or an effective UID of 0. +ÈóƱ´ü I/O Áàºî¤Î½ªÎ»»þ¤ä¶ÛµÞ¥Ç¡¼¥¿¤Î¼õ¿®»þ¤Ë +.B SIGIO +¤ä +.B SIGURG +¥·¥°¥Ê¥ë·²¤òÁ÷¤ë¥×¥í¥»¥¹¤ä¥×¥í¥»¥¹¥°¥ë¡¼¥×¤òÀßÄꤹ¤ë¡£ +°ú¤­¿ô¤Ï +.I pid_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +°ú¤­¿ô¤¬Àµ¤À¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£Éé¤À¤È¡¢ +°ú¤­¿ô¤ÎÀäÂÐÃͤò ID ¤Ë»ý¤Ä¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +¥·¥°¥Ê¥ë¼õ¿®Àè¤Ë¤Ï¡¢¼«Ê¬¼«¿È¤Î¥×¥í¥»¥¹ / ¼«Ê¬¤Î½ê°¤¹¤ë¥×¥í¥»¥¹¥°¥ë¡¼¥× +¤·¤«»ØÄê¤Ç¤­¤Ê¤¤¡£Ã¢¤·¡¢ +.B CAP_KILL +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢µÚ¤Ó¼Â¸ú¥æ¡¼¥¶ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤Î¾ì¹ç¤Ï +¤³¤Î¸Â¤ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B FIOASYNC +.\"O Change the +.\"O .B O_ASYNC +.\"O flag to enable or disable asynchronous I/O mode of the socket. +.\"O Asynchronous I/O mode means that the +.\"O .B SIGIO +.\"O signal or the signal set with +.\"O .B F_SETSIG +.\"O is raised when a new I/O event occurs. +.B O_ASYNC +¥Õ¥é¥°¤òÊѹ¹¤·¡¢¥½¥±¥Ã¥È¤ÎÈóƱ´ü (asynchronous) I/O ¥â¡¼¥É¤ò +Í­¸ú/̵¸ú¤Ë¤¹¤ë¡£ÈóƱ´ü I/O ¥â¡¼¥É¤Ç¤Ï¡¢ +¿·¤·¤¤ I/O ¥¤¥Ù¥ó¥È¤¬µ¯¤­¤¿¤È¤­¤Ë¡¢ +.B SIGIO +¥·¥°¥Ê¥ë¤ä +.B F_SETSIG +¤ÇÀßÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¡¦¥»¥Ã¥È¤¬È¯¹Ô¤µ¤ì¤ë¡£ +.IP +.\"O Argument is an integer boolean flag. +°ú¤­¿ô¤Ï¥Ö¡¼¥ëÀ°¿ô¤Î¥Õ¥é¥°¤Ç¤¢¤ë¡£ +.\"O (This operation is synonymous with the use of +.\"O .BR fcntl (2) +.\"O to set the +.\"O .B O_ASYNC +.\"O flag.) +(¤³¤ÎÁàºî¤Ï +.BR fcntl (2) +¤ò»È¤Ã¤Æ +.B O_ASYNC +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤Î¤ÈƱ¤¸°ÕÌ£¤Ç¤¢¤ë¡£) +.\" +.TP +.B SIOCGPGRP +.\"O Get the current process or process group that receives +.\"O .B SIGIO +.\"O or +.\"O .B SIGURG +.\"O signals, +.\"O or 0 +.\"O when none is set. +.B SIGIO +¤ä +.B SIGURG +¤ò¼õ¿®¤·¤¿¥«¥ì¥ó¥È¥×¥í¥»¥¹¡¦¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ò¼èÆÀ¤¹¤ë¡£ +¤Ê¤¤¾ì¹ç¤Ï 0 ¤¬Ê֤롣 +.PP +.\"O Valid +.\"O .BR fcntl (2) +.\"O operations: +Í­¸ú¤Ê +.BR fcntl (2) +Áàºî: +.TP +.B FIOGETOWN +.\"O The same as the +.\"O .B SIOCGPGRP +.\"O .BR ioctl (2). +.B SIOCGPGRP +.BR ioctl (2) +¤ÈƱ¤¸¡£ +.TP +.B FIOSETOWN +.\"O The same as the +.\"O .B SIOCSPGRP +.\"O .BR ioctl (2). +.B SIOCSPGRP +.BR ioctl (2) +¤ÈƱ¤¸¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .B SO_BINDTODEVICE +.\"O was introduced in Linux 2.0.30. +.\"O .B SO_PASSCRED +.\"O is new in Linux 2.2. +.\"O The +.\"O .I /proc +.\"O interfaces was introduced in Linux 2.2. +.B SO_BINDTODEVICE +¤Ï Linux 2.0.30 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.B SO_PASSCRED +¤Ï Linux 2.2 ¤ÇÅо줷¤¿¡£ +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï Linux 2.2 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.\"O .B SO_RCVTIMEO +.\"O and +.\"O .B SO_SNDTIMEO +.\"O are supported since Linux 2.3.41. +.\"O Earlier, timeouts were fixed to +.\"O a protocol-specific setting, and could not be read or written. +.B SO_RCVTIMEO +¤È +.B SO_SNDTIMEO +¤Ï Linux 2.3.41 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤½¤ì°ÊÁ°¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥È¤Ï¥×¥í¥È¥³¥ë¸ÇÍ­¤Î¸ÇÄê¤ÎÀßÄêÃͤǡ¢ +Æɤ߽ñ¤­¤ò¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Linux assumes that half of the send/receive buffer is used for internal +.\"O kernel structures; thus the values in the corresponding +.\"O .I /proc +.\"O files are twice what can be observed on the wire. +Linux ¤Ï¡¢Á÷¼õ¿®¥Ð¥Ã¥Õ¥¡¤ÎȾʬ¤òÆâÉô¤Î¥«¡¼¥Í¥ë¹½Â¤ÂΤÇÍѤ¤¤ë¤È²¾Äꤷ¤Æ¤¤¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢Âбþ¤¹¤ë +.I /proc +¥Õ¥¡¥¤¥ë¤Ï¥Í¥Ã¥È¥ï¡¼¥¯²óÀþ¾å¤Ç¤ÎÂ礭¤µ¤Î 2 Çܤˤʤ롣 + +.\"O Linux will only allow port reuse with the +.\"O .B SO_REUSEADDR +.\"O option +.\"O when this option was set both in the previous program that performed a +.\"O .BR bind (2) +.\"O to the port and in the program that wants to reuse the port. +.\"O This differs from some implementations (e.g., FreeBSD) +.\"O where only the later program needs to set the +.\"O .B SO_REUSEADDR +.\"O option. +.\"O Typically this difference is invisible, since, for example, a server +.\"O program is designed to always set this option. +Linux ¤Ç¤Ï¡¢ +.B SO_REUSEADDR +¥ª¥×¥·¥ç¥ó¤Ç¥Ý¡¼¥È¤ÎºÆÍøÍѤ¬µö²Ä¤µ¤ì¤ë¤Î¤Ï¡¢ +¤½¤Î¥Ý¡¼¥È¤ËÂФ·¤Æ +.BR bind (2) +¤òÁ°¤Ë¼Â¹Ô¤·¤¿¥×¥í¥°¥é¥à¤È¤½¤Î¥Ý¡¼¥È¤òºÆÍøÍÑ +¤·¤è¤¦¤È¤¹¤ë¥×¥í¥°¥é¥à¤ÎξÊý¤Ç +.B SO_REUSEADDR +¤¬¥»¥Ã¥È¤µ¤ì¤¿¾ì¹ç¤Î¤ß¤Ç¤¢¤ë¡£ +¤³¤ÎÆ°ºî¤Ï (FreeBSD ¤Ê¤É¤Î) ¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤È¤Ï°Û¤Ê¤ë¡£¤³¤ì¤é¤Ç¤Ï¡¢ +¸å¤Ç¥Ý¡¼¥È¤òºÆÍøÍѤ·¤è¤¦¤È¤¹¤ë¥×¥í¥°¥é¥à¤Ç +.B SO_REUSEADDR +¥ª¥×¥·¥ç¥ó¤ò¥»¥Ã¥È¤¹¤ë¤À¤±¤Ç¤è¤¤¡£ +¤¿¤¤¤Æ¤¤¤Ï¤³¤Î°ã¤¤¤Ï¸«¤¨¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢Î㤨¤Ð¥µ¡¼¥Ð¥×¥í¥°¥é¥à¤Ï +¾ï¤Ë¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¥»¥Ã¥È¤¹¤ë¤è¤¦¤ËÀ߷פµ¤ì¤ë¤«¤é¤Ç¤¢¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O The +.\"O .B CONFIG_FILTER +.\"O socket options +.\"O .B SO_ATTACH_FILTER +.\"O and +.\"O .B SO_DETACH_FILTER +.\" FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER +.\"O are not documented. +.\"O The suggested interface to use them is via the libpcap +.\"O library. +.B CONFIG_FILTER +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë +.B SO_ATTACH_FILTER +¤È +.B SO_DETACH_FILTER +¤Ë¤Ä¤¤¤Æµ­ºÜ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£¤³¤ì¤é¤Ï libpcap ¥é¥¤¥Ö¥é¥ê¤òÄ̤·¤Æ +ÍѤ¤¤ëÊý¤¬Îɤ¤¡£ +.\"O .\" .SH AUTHORS +.\" .SH Ãø¼Ô +.\"O .\" This man page was written by Andi Kleen. +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï Andi Kleen ¤¬½ñ¤¤¤¿¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR getsockopt (2), +.BR setsockopt (2), +.BR socket (2), +.BR capabilities (7), +.BR ddp (7), +.BR ip (7), +.BR packet (7), +.BR tcp (7), +.BR udp (7), +.BR unix (7) diff --git a/draft/man7/spufs.7 b/draft/man7/spufs.7 new file mode 100644 index 00000000..34687be6 --- /dev/null +++ b/draft/man7/spufs.7 @@ -0,0 +1,829 @@ +.\" This is _*_ nroff _*_ source. Emacs, gimme all those colors :) +.\" +.\" Copyright (c) International Business Machines Corp., 2006 +.\" +.\" 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 +.\" +.\" HISTORY: +.\" 2005-09-28, created by Arnd Bergmann , +.\" Mark Nutter and +.\" Ulrich Weigand +.\" 2006-06-16, revised by Eduardo M. Fleury +.\" 2007-07-10, quite a lot of polishing by mtk +.\" +.TH SPUFS 7 2007-07-10 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O spufs \- the SPU file system +spufs \- SPU ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The SPU file system is used on PowerPC machines that implement the +.\"O Cell Broadband Engine Architecture in order to access Synergistic +.\"O Processor Units (SPUs). +SPU ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢Cell Broadband Engine ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò¼ÂÁõ¤·¤¿ +PowerPC ¥Þ¥·¥ó¤Ë¤ª¤¤¤Æ¡¢Synergistic Processor Unit (SPU) ¤Ë¥¢¥¯¥»¥¹¤¹¤ë +¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ + +.\"O The file system provides a name space similar to POSIX shared +.\"O memory or message queues. +.\"O Users that have write permissions +.\"O on the file system can use +.\"O .BR spu_create (2) +.\"O to establish SPU contexts under the spufs root directory. +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢POSIX ¶¦Í­¥á¥â¥ê¤ä¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ë +»÷¤¿Ì¾Á°¶õ´Ö¤¬Ä󶡤µ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤Ä¥æ¡¼¥¶¤Ï +.BR spu_create (2) +¤ò»È¤Ã¤Æ spufs ¤Î¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë SPU ¥³¥ó¥Æ¥­¥¹¥È¤òºîÀ®¤Ç¤­¤ë¡£ + +.\"O Every SPU context is represented by a directory containing +.\"O a predefined set of files. +.\"O These files can be +.\"O used for manipulating the state of the logical SPU. +.\"O Users can change permissions on those files, but can't +.\"O add or remove files. +³Æ SPU ¥³¥ó¥Æ¥­¥¹¥È¤Ï¡¢¤¢¤é¤«¤¸¤áÄêµÁ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë·²¤ò´Þ¤à +¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤Æɽ¸½¤µ¤ì¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ¡¢ÏÀÍý SPU ¤Î¾õÂÖ¤òÁàºî¤Ç¤­¤ë¡£ +¥æ¡¼¥¶¤Ï¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹µö²Ä¤òÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤ë¤¬¡¢ +¥Õ¥¡¥¤¥ë¤ÎÄɲᦺï½ü¤ò¹Ô¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\"O .SS Mount Options +.SS ¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó +.TP +.B uid= +.\"O set the user owning the mount point; the default is 0 (root). +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò½êÍ­¤¹¤ë¥æ¡¼¥¶¤òÀßÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 0 (root) ¤Ç¤¢¤ë¡£ +.TP +.B gid= +.\"O set the group owning the mount point; the default is 0 (root). +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò½êÍ­¤¹¤ë¥°¥ë¡¼¥×¤òÀßÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 0 (root) ¤Ç¤¢¤ë¡£ +.\"O .SS Files +.SS ¥Õ¥¡¥¤¥ë +.\"O The files in +.\"O .I spufs +.\"O mostly follow the standard behavior for regular system calls like +.\"O .BR read (2) +.\"O or +.\"O .BR write (2), +.\"O but often support only a subset of the operations +.\"O supported on regular file systems. +.\"O This list details the supported +.\"O operations and the deviations from the standard behavior described +.\"O in the respective man pages. +.I spufs +¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç +.BR read (2) +¤ä +.BR write (2) +¤È¤¤¤Ã¤¿Ä̾ï¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ëɸ½àŪ¤Ê¿¶¤ëÉñ¤¤¤ò¼¨¤¹¤¬¡¢ +¿¤¯¤Î¾ì¹çÄ̾ï¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÁàºî¤Î°ìÉôʬ¤À¤±¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£°Ê²¼¤Î¥ê¥¹¥È¤Ç¤Ï¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÁàºî¤È +¤½¤ì¤¾¤ì¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë½ñ¤«¤ì¤Æ¤¤¤ëɸ½àŪ¤Ê¿¶¤ëÉñ¤¤¤È¤Î°ã¤¤¤Ë +¤Ä¤¤¤ÆÀâÌÀ¤¹¤ë¡£ + +.\"O All files that support the +.\"O .BR read (2) +.\"O operation also support +.\"O .BR readv (2) +.\"O and all files that support the +.\"O .BR write (2) +.\"O operation also support +.\"O .BR writev (2). +.BR read (2) +Áàºî¤ËÂбþ¤·¤Æ¤¤¤ëÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¤Ï +.BR readv (2) +¤Ë¤âÂбþ¤·¤Æ¤¤¤ë¡£¤Þ¤¿¡¢ +.BR write (2) +Áàºî¤ËÂбþ¤·¤Æ¤¤¤ëÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¤Ï +.BR writev (2) +¤Ë¤âÂбþ¤·¤Æ¤¤¤ë¡£ + +.\"O All files support the +.\"O .BR access (2) +.\"O and +.\"O .BR stat (2) +.\"O family of operations, but for the latter call, +.\"O the only fields of the returned +.\"O .I stat +.\"O structure that contain reliable information are +.\"O .IR st_mode , +.\"O .IR st_nlink , +.\"O .IR st_uid , +.\"O and +.\"O .IR st_gid . +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢ +.BR access (2) +¤È +.BR stat (2) +·Ï¤ÎÁàºî¤ËÂбþ¤·¤Æ¤¤¤ë¤¬¡¢ +.BR stat (2) +¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿ºÝ¤ËÊÖ¤µ¤ì¤ë +.I stat +¹½Â¤ÂΤΥե£¡¼¥ë¥É¤Î¤¦¤Á¿®Íê¤Ç¤­¤ë¾ðÊó¤¬Æþ¤Ã¤Æ¤¤¤ë¤Î¤Ï +.IR st_mode , +.IR st_nlink , +.IR st_uid , +.I st_gid +¤À¤±¤Ç¤¢¤ë¡£ + +.\"O All files support the +.\"O .BR chmod (2)/ fchmod (2) +.\"O and +.\"O .BR chown (2)/ fchown (2) +.\"O operations, but will not be able to grant permissions that contradict +.\"O the possible operations (e.g., read access on the +.\"O .I wbox +.\"O file). +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¤Ï +.BR chmod (2)/ fchmod (2) +¤È +.BR chown (2)/ fchown (2) +¤ÎÁàºî¤ËÂбþ¤·¤Æ¤¤¤ë¤¬¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤¬Âбþ¤·¤Æ¤¤¤ëÁàºî¤ÈÌ·½â¤¹¤ë¥¢¥¯¥»¥¹µö²Ä¤ò +ÉÕÍ¿¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤ (Î㤨¤Ð¡¢ +.I wbox +¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëÆɤ߽Ф·¥¢¥¯¥»¥¹¤Ê¤É)¡£ + +.\"O The current set of files is: +¸½»þÅÀ¤Ç¤Î¥Õ¥¡¥¤¥ë¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.TP +.B /mem +.\"O the contents of the local storage memory of the SPU. +.\"O This can be accessed like a regular shared memory +.\"O file and contains both code and data in the address +.\"O space of the SPU. +.\"O The possible operations on an open +.\"O .I mem +.\"O file are: +SPU ¤Î¥í¡¼¥«¥ë¥¹¥È¥ì¡¼¥¸¤ÎÆâÍÆ¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÄ̾ï¤Î¶¦Í­¥á¥â¥ê¥Õ¥¡¥¤¥ë¤ÈƱÍͤ˥¢¥¯¥»¥¹¤Ç¤­¡¢ +SPU ¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤Ï¥³¡¼¥É¤È¥Ç¡¼¥¿¤ÎξÊý¤ò³ÊǼ¤Ç¤­¤ë¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I mem +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read "(2), " pread "(2), " write "(2), " pwrite "(2), " lseek (2) +.\"O These operate as usual, with the exception that +.\"O .BR lseek "(2), " write (2) +.\"O and +.\"O .BR pwrite (2) +.\"O are not supported beyond the end of the file. +.\"O The file size +.\"O is the size of the local storage of the SPU, +.\"O which is normally 256 kilobytes. +¤³¤ì¤é¤ÏÄ̾ïÄ̤êÆ°ºî¤¹¤ë¤¬¡¢ +¥Õ¥¡¥¤¥ëËöÈø¤ò±Û¤¨¤Æ¤Î +.BR lseek (2), +.BR write (2), +.BR pwrite (2) +¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤ÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ï SPU ¤Î¥í¡¼¥«¥ë¥¹¥È¥ì¡¼¥¸¤Î¥µ¥¤¥º¤Ç¤¢¤ê¡¢ +Ä̾ï¤Ï 256 ¥­¥í¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +.TP +.BR mmap (2) +.\"O Mapping +.\"O .I mem +.\"O into the process address space provides access to the SPU local +.\"O storage within the process address space. +.\"O Only +.\"O .B MAP_SHARED +.\"O mappings are allowed. +.I mem +¤ò¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¤È¡¢ +¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î°ìÉô¤È¤·¤Æ +SPU ¤Î¥í¡¼¥«¥ë¡¦¥¹¥È¥ì¡¼¥¸¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.RE +.TP +.B /mbox +.\"O The first SPU-to-CPU communication mailbox. +.\"O This file +.\"O is read-only and can be read in units of 32 bits. +.\"O The file can only be used in non-blocking mode and not +.\"O even +.\"O .BR poll (2) +.\"O will block on it. +.\"O The only possible operation on an open +.\"O .I mbox +.\"O file is: +SPU ¤«¤é CPU ¤Ø¤ÎÄÌ¿®ÍѤΰì¤ÄÌܤΥ᡼¥ë¥Ü¥Ã¥¯¥¹¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÆɤ߽Ф·ÀìÍѤǡ¢Æɤ߽Ф·¤Ï 32¥Ó¥Ã¥Èñ°Ì¤Ç¹Ô¤¦¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÈóÄä»ß (non-blocking) ¥â¡¼¥É¤Ç¤Î¤ß»ÈÍѤǤ­¡¢ +.BR poll (2) +¤Ç¤¢¤Ã¤Æ¤â¤³¤Î¥Õ¥¡¥¤¥ë¤ÇÄä»ß (block) ¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I mbox +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.\"O If +.\"O .I count +.\"O is smaller than four, +.\"O .BR read (2) +.\"O returns \-1 and sets +.\"O .I errno +.\"O to +.\"O .BR EINVAL . +.\"O If there is no data available in the mailbox, the return +.\"O value is set to \-1 and +.\"O .I errno +.\"O is set to +.\"O .BR EAGAIN . +.\"O When data +.\"O has been read successfully, four bytes are placed in +.\"O the data buffer and the value four is returned. +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR read (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ë¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç¡¢\-1 ¤¬Ê֤ꡢ +.I errno +¤¬ +.B EAGAIN +¤ËÀßÄꤵ¤ì¤ë¡£¥Ç¡¼¥¿¤ÎÆɤ߽Ф·¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ +4 ¥Ð¥¤¥È¤¬¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¡¢ÊÖ¤êÃͤȤ·¤Æ 4 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.RE +.TP +.B /ibox +.\"O The second SPU-to-CPU communication mailbox. +.\"O This file is similar to the first mailbox file, but can be read +.\"O in blocking I/O mode, thus +.\"O .BR poll (2) +.\"O and similar system calls can be used to monitor this file. +.\"O The possible operations on an open +.\"O .I ibox +.\"O file are: +SPU ¤«¤é CPU ¤Ø¤ÎÄÌ¿®ÍѤÎÆó¤ÄÌܤΥ᡼¥ë¥Ü¥Ã¥¯¥¹¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï°ì¤ÄÌܤΥ᡼¥ë¥Ü¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤È»÷¤Æ¤¤¤ë¤¬¡¢ +Ää»ß (blocking) I/O ¥â¡¼¥É¤Ç¤ÎÆɤ߽Ф·¤¬²Äǽ¤Ç¤¢¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +.BR poll (2) +¤äƱÍͤΥ·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ò´Æ»ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I ibox +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.\"O If +.\"O .I count +.\"O is smaller than four, +.\"O .BR read (2) +.\"O returns \-1 and sets +.\"O .I errno +.\"O to +.\"O .BR EINVAL . +.\"O If there is no data available in the mailbox and the file +.\"O descriptor has been opened with +.\"O .BR O_NONBLOCK , +.\"O the return value is set to \-1 and +.\"O .I errno +.\"O is set to +.\"O .BR EAGAIN . +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR read (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ë¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.B O_NONBLOCK +¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢ÊÖ¤êÃÍ¤Ï \-1 ¤È¤Ê¤ê¡¢ +.I errno +¤Ï +.B EAGAIN +¤ËÀßÄꤵ¤ì¤ë¡£ + +.\"O If there is no data available in the mailbox and the file +.\"O descriptor has been opened without +.\"O .BR O_NONBLOCK , +.\"O the call will +.\"O block until the SPU writes to its interrupt mailbox channel. +.\"O When data has been read successfully, four bytes are placed in +.\"O the data buffer and the value four is returned. +¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ë¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç¤Ç¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.B O_NONBLOCK +¤Ê¤·¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢ +SPU ¤¬¼«Ê¬¤Î³ä¤ê¹þ¤ß¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¥Á¥ã¥Í¥ë (interrupt mailbox channel) +¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤Þ¤Ç +.BR read (2) +¤ÏÄä»ß (block) ¤¹¤ë¡£ +¥Ç¡¼¥¿¤ÎÆɤ߽Ф·¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ +4 ¥Ð¥¤¥È¤¬¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¡¢ÊÖ¤êÃͤȤ·¤Æ 4 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.BR poll (2) +.\"O Poll on the +.\"O .I ibox +.\"O file returns +.\"O .I "(POLLIN | POLLRDNORM)" +.\"O whenever data is available for reading. +.I ibox +¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë +.BR poll (2) +¤Ï¡¢Æɤ߽Ф·¥Ç¡¼¥¿¤¬ÍøÍѲÄǽ¤Ë¤Ê¤ëÅÙ¤Ë +.I "(POLLIN | POLLRDNORM)" +¤òÊÖ¤¹¡£ +.RE +.TP +.B /wbox +.\"O The CPU-to-SPU communication mailbox. +.\"O It is write-only and can be written in units of 32 bits. +.\"O If the mailbox is full, +.\"O .BR write (2) +.\"O will block and +.\"O .BR poll (2) +.\"O can be used to wait for it to become empty again. +.\"O The possible operations on an open +.\"O .I wbox +.\"O file are: +CPU ¤«¤é SPU ¤Ø¤ÎÄÌ¿®ÍѤΥ᡼¥ë¥Ü¥Ã¥¯¥¹¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï½ñ¤­¹þ¤ßÀìÍѤǡ¢½ñ¤­¹þ¤ß¤Ï 32¥Ó¥Ã¥Èñ°Ì¤Ç¹Ô¤¦¡£ +¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤¬°ìÇդξì¹ç¡¢ +.BR write (2) +¤ÏÄä»ß (block) ¤·¡¢ +.BR poll (2) +¤ò»È¤Ã¤Æ¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤ËºÆÅÙ¶õ¤­¤¬¤Ç¤­¤ë¤Þ¤ÇÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I wbox +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR write (2) +.\"O If +.\"O .I count +.\"O is smaller than four, +.\"O .BR write (2) +.\"O returns \-1 and sets +.\"O .I errno +.\"O to +.\"O .BR EINVAL . +.\"O If there is no space available in the mailbox and the file +.\"O descriptor has been opened with +.\"O .BR O_NONBLOCK , +.\"O the return +.\"O value is set to \-1 and +.\"O .I errno +.\"O is set to +.\"O .BR EAGAIN . +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR write (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ë¶õ¤­Îΰ褬¤Ê¤¤¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.B O_NONBLOCK +¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢ÊÖ¤êÃÍ¤Ï \-1 ¤È¤Ê¤ê¡¢ +.I errno +¤Ï +.B EAGAIN +¤ËÀßÄꤵ¤ì¤ë¡£ + +.\"O If there is no space available in the mailbox and the file +.\"O descriptor has been opened without +.\"O .BR O_NONBLOCK , +.\"O the call will +.\"O block until the SPU reads from its PPE mailbox channel. +.\"O When data has been written successfully, +.\"O the system call returns four as its function result. +¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ë¶õ¤­Îΰ褬¤Ê¤¤¾ì¹ç¤Ç¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.B O_NONBLOCK +¤Ê¤·¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢ +SPU ¤¬¼«Ê¬¤Î PPE ¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¥Á¥ã¥Í¥ë¤«¤éÆɤ߽Ф·¤ò¹Ô¤¦¤Þ¤Ç +.BR write (2) +¤ÏÄä»ß (block) ¤¹¤ë¡£ +¥Ç¡¼¥¿¤Î½ñ¤­¹þ¤ß¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ÊÖ¤êÃͤȤ·¤Æ 4 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.BR poll (2) +.\"O A poll on the +.\"O .I wbox +.\"O file returns +.\"O .I "(POLLOUT | POLLWRNORM)" +.\"O whenever space is available for writing. +.I wbox +¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë +.BR poll (2) +¤Ï¡¢½ñ¤­¹þ¤ßÍѤζõ´Ö¤¬ÍøÍѲÄǽ¤Ë¤Ê¤ëÅÙ¤Ë +.I "(POLLOUT | POLLWRNORM)" +¤òÊÖ¤¹¡£ +.RE +.TP +.BR /mbox_stat ", " /ibox_stat ", " /wbox_stat +.\"O These are read-only files that contain the length of the current +.\"O queue of each mailbox, i.e., how many words can be read from +.\"O .IR mbox " or " ibox +.\"O or how many words can be written to +.\"O .I wbox +.\"O without blocking. +.\"O The files can be read only in four-byte units and return +.\"O a big-endian binary integer number. +.\"O The possible operations on an open +.\"O .I *box_stat +.\"O file are: +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤ÏÆɤ߽Ф·ÀìÍѤǡ¢ +³Æ¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Î¸½ºß¤Î¥­¥å¡¼Ä¹¤òÊÝ»ý¤¹¤ë¡£ +¶ñÂÎŪ¤Ë¤Ï¡¢Ää»ß (blocking) ¤»¤º¤Ë¡¢ +.IR mbox " ¤ä " ibox +¤«¤é²¿¥ï¡¼¥É¤òÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¡¢ +.I wbox +¤Ë²¿¥ï¡¼¥É¤ò½ñ¤­¹þ¤à¤³¤È¤¬¤Ç¤­¤ë¤«¡¢¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï 4 ¥Ð¥¤¥Èñ°Ì¤Ç¤Î¤ßÆɤ߽Ф·¤¬²Äǽ¤Ç¡¢ +¥Ó¥Ã¥°¡¦¥¨¥ó¥Ç¥£¥¢¥ó¤ÎÀ°¿ôÃͤòÊÖ¤¹¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I *box_stat +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.\"O If +.\"O .I count +.\"O is smaller than four, +.\"O .BR read (2) +.\"O returns \-1 and sets +.\"O .I errno +.\"O to +.\"O .BR EINVAL . +.\"O Otherwise, a four-byte value is placed in the data buffer. +.\"O This value is the number of elements that can be read from (for +.\"O .I mbox_stat +.\"O and +.\"O .IR ibox_stat ) +.\"O or written to (for +.\"O .IR wbox_stat ) +.\"O the respective mailbox without blocking or getting an +.\"O .B EAGAIN +.\"O error. +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR read (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤Ë 4 ¥Ð¥¤¥È¤ÎÃͤ¬½ñ¤­¹þ¤Þ¤ì¤ë¡£ +¤³¤ÎÃͤϡ¢³Æ¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ë¤ª¤¤¤ÆÄä»ß¤»¤º¤Ë¡¢¤Þ¤¿¤Ï +.B EAGAIN +¥¨¥é¡¼¤Ê¤·¤Ç¡¢Æɤ߽Ф·²Äǽ¤Ê¥¨¥ì¥á¥ó¥È¿ô +.RI ( mbox_stat +¤ä +.I ibox_stat +¤Î¾ì¹ç)¡¢½ñ¤­¹þ¤ß²Äǽ¤Ê¥¨¥ì¥á¥ó¥È¿ô +.RI ( wbox_stat +¤Î¾ì¹ç) ¤Ç¤¢¤ë¡£ +.RE +.TP +.BR /npc ", " /decr ", " /decr_status ", " /spu_tag_mask ", " \ +/event_mask ", " /srr0 +.\"O These files expose internal registers of the SPU. +.\"O The values are represented +.\"O as ASCII strings containing the numeric value of each register. +.\"O These can be used in read/write mode for debugging, but normal +.\"O operation of programs should not rely on these files because +.\"O accesses to any of them except +.\"O .I npc +.\"O require an SPU context save, which is very inefficient. +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï SPU ¤ÎÆâÉô¥ì¥¸¥¹¥¿¤ò¸ø³«¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +Ãͤϡ¢³Æ¥ì¥¸¥¹¥¿¤Î¿ôÃͤò´Þ¤à¥¢¥¹¥­¡¼Ê¸»úÎó¤Çɽ¸½¤µ¤ì¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï¥Ç¥Ð¥Ã¥°ÍѤȤ·¤ÆÆɤ߽Ф·/½ñ¤­¹þ¤ß¤Îξ¥â¡¼¥É¤ÇÍøÍѤǤ­¤ë¤¬¡¢ +¥×¥í¥°¥é¥à¤ÎÄ̾ï¤ÎÁàºî¤Ï¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ë°Í¸¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î¤¦¤Á +.I npc +°Ê³°¤Ø¤Î¥¢¥¯¥»¥¹¤Ç¤Ï SPU ¥³¥ó¥Æ¥­¥¹¥È¤ÎÊݸ¤¬É¬¿Ü¤Ç¤¢¤ê¡¢ +SPU ¥³¥ó¥Æ¥­¥¹¥È¤ÎÊݸ¤ÏÈó¾ï¤Ë¸úΨ¤¬°­¤¤¤«¤é¤Ç¤¢¤ë¡£ +.IP +.\"O The contents of these files are: +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍƤϰʲ¼¤ÎÄ̤ꡣ +.RS +.TP 16 +.I npc +.\"O Next Program Counter +¼¡¤Î¥×¥í¥°¥é¥à¥«¥¦¥ó¥¿ +.TP +.I decr +.\"O SPU Decrementer +SPU Decrementer +.TP +.I decr_status +.\"O Decrementer Status +Decrementer ¤Î¾õÂÖ +.TP +.I spu_tag_mask +.\"O MFC tag mask for SPU DMA +SPU ¤Î DMA ÍѤΠMFA ¥¿¥°¥Þ¥¹¥¯ +.TP +.I event_mask +.\"O Event mask for SPU interrupts +SPU ¤Î³ä¤ê¹þ¤ß¤Î¥¤¥Ù¥ó¥È¥Þ¥¹¥¯ +.TP +.I srr0 +.\"O Interrupt Return address register +³ä¤ê¹þ¤ß¥ê¥¿¡¼¥ó¥¢¥É¥ì¥¹¥ì¥¸¥¹¥¿ +.RE +.IP +.\"O The possible operations on one of these files are: +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.\"O When the +.\"O .I count +.\"O supplied to the +.\"O .BR read (2) +.\"O call is shorter than the required length for the register +.\"O value plus a newline character, subsequent reads from the same +.\"O file descriptor will complete the string, regardless +.\"O of changes to the register by a running SPU task. +.\"O When a complete string has been read, all subsequent read operations +.\"O will return zero bytes and a new file descriptor needs to be opened +.\"O to read a new value. +.BR read (2) +¤ËÅϤµ¤ì¤¿ +.I count +¤¬¥ì¥¸¥¹¥¿ÃͤȲþ¹Ô (newline) ʸ»ú 1 ¸Ä¤ò³ÊǼ¤¹¤ë¤Î¤ËɬÍפÊŤµ¤è¤êû¤¤¾ì¹ç¡¢ +Ʊ¤¸¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò³¤±¤Æ read ¤¹¤ë¤³¤È¤Ç¡¢Ê¸»úÎóÁ´ÂΤòÆɤ߽Ф¹¤³¤È +¤¬¤Ç¤­¤ë¡£¤³¤ÎºÝ¡¢¼Â¹ÔÃæ¤Î SPU ¥¿¥¹¥¯¤Ë¤è¤ê¥ì¥¸¥¹¥¿ÃͤÎÊѹ¹¤Î±Æ¶Á¤Ï¼õ¤±¤Ê¤¤¡£ +ʸ»úÎóÁ´ÂΤ¬Æɤ߽Фµ¤ì¤ë¤È¡¢¤½¤ì°Ê¹ß¤Î read Áàºî¤Ç¤Ï 0 ¥Ð¥¤¥È¤¬ÊÖ¤µ¤ì¡¢ +¿·¤·¤¤ÃͤòÆɤ߽Ф¹¤Ë¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥ª¡¼¥×¥ó¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.TP +.BR write (2) +.\"O A +.\"O .BR write (2) +.\"O operation on the file sets the register to the +.\"O value given in the string. +.\"O The string is parsed from the beginning +.\"O until the first non-numeric character or the end of the buffer. +.\"O Subsequent writes to the same file descriptor overwrite the +.\"O previous setting. +¤³¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î +.BR write (2) +Áàºî¤Ï¥ì¥¸¥¹¥¿Ãͤòʸ»úÎó¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +ʸ»úÎó¤Î²ò¼á¤ÏÀèƬ¤«¤é³«»Ï¤µ¤ì¡¢¿ô»ú°Ê³°¤Îʸ»ú¤¬½é¤á¤ÆÅо줹¤ë¤«¡¢ +¥Ð¥Ã¥Õ¥¡¤ÎËöÈø¤Ë㤹¤ë¤Þ¤Ç¹Ô¤ï¤ì¤ë¡£ +Ʊ¤¸¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ø³¤±¤Æ write ¤ò¹Ô¤¦¤È¡¢ +¸å¤Î write ¤Ë¤è¤êÁ°¤ÎÀßÄ꤬¾å½ñ¤­¤µ¤ì¤ë¡£ +.RE +.TP +.B /fpcr +.\"O This file provides access to the Floating Point Status and +.\"O Control Register as a four-byte file. +.\"O The operations on the +.\"O .I fpcr +.\"O file are: +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤è¤ê Floating Point Status and Control Register ¤Ë +¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÂ礭¤µ 4 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +.I fpcr +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.\"O If +.\"O .I count +.\"O is smaller than four, +.\"O .BR read (2) +.\"O returns \-1 and sets +.\"O .I errno +.\"O to +.\"O .BR EINVAL . +.\"O Otherwise, a four-byte value is placed in the data buffer; +.\"O this is the current value of the +.\"O .I fpcr +.\"O register. +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR read (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤Ë 4 ¥Ð¥¤¥È¤ÎÃͤ¬½ñ¤­¹þ¤Þ¤ì¤ë¡£ +½ñ¤­¹þ¤Þ¤ì¤ëÃÍ¤Ï +.I fpcr +¥ì¥¸¥¹¥¿¤Î¸½ºß¤ÎÃͤǤ¢¤ë¡£ +.TP +.BR write (2) +.\"O If +.\"O .I count +.\"O is smaller than four, +.\"O .BR write (2) +.\"O returns \-1 and sets +.\"O .I errno +.\"O to +.\"O .BR EINVAL . +.\"O Otherwise, a four-byte value is copied from the data buffer, +.\"O updating the value of the +.\"O .I fpcr +.\"O register. +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR write (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ 4 ¥Ð¥¤¥È¤ÎÃͤ¬¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤«¤é¥³¥Ô¡¼¤µ¤ì¡¢ +.I fpcr +¥ì¥¸¥¹¥¿¤ÎÃͤ¬¹¹¿·¤µ¤ì¤ë¡£ +.RE +.TP +.BR /signal1 ", " /signal2 +.\"O The files provide access to the two signal notification channels +.\"O of an SPU. +.\"O These are read-write files that operate on 32-bit words. +.\"O Writing to one of these files triggers an interrupt on the SPU. +.\"O The value written to the signal files can +.\"O be read from the SPU through a channel read or from +.\"O host user space through the file. +.\"O After the value has been read by the SPU, it is reset to zero. +.\"O The possible operations on an open +.\"O .I signal1 +.\"O or +.\"O .I signal2 +.\"O file are: +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ë¤è¤ê +SPU ¤ÎÆó¤Ä¤Î¥·¥°¥Ê¥ëÄÌÃÎ¥Á¥ã¥Í¥ë (signal notification channel) ¤Ë +¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Ï 32 ¥Ó¥Ã¥Èñ°Ì¤ÎÆɤ߽ñ¤­¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î°ì¤Ä¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤È¡¢¤½¤Î SPU ¤Î³ä¤ê¹þ¤ß¤¬ +ȯÀ¸¤¹¤ë¥È¥ê¥¬¡¼¤È¤Ê¤ë¡£ +¥·¥°¥Ê¥ë¥Õ¥¡¥¤¥ë¤Ø½ñ¤­¹þ¤Þ¤ì¤¿Ãͤϡ¢¥Á¥ã¥Í¥ë·Ðͳ¤Ç SPU ¤ÇÆɤ߽Ф·¤¿¤ê¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë·Ðͳ¤Ç¥Û¥¹¥È¤Î¥æ¡¼¥¶¶õ´Ö¤ÇÆɤ߽Ф·¤¿¤ê¤Ç¤­¤ë¡£ +SPU ¤¬ÃͤòÆɤ߽Ф·¤¿¸å¤Ç¤Ï¡¢ÃÍ¤Ï 0 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I signal1 +¤ä +.I signal2 +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.\"O If +.\"O .I count +.\"O is smaller than four, +.\"O .BR read (2) +.\"O returns \-1 and sets +.\"O .I errno +.\"O to +.\"O .BR EINVAL . +.\"O Otherwise, a four-byte value is placed in the data buffer; +.\"O this is the current value of the specified signal notification +.\"O register. +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR read (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤Ë 4 ¥Ð¥¤¥È¤ÎÃͤ¬½ñ¤­¹þ¤Þ¤ì¤ë¡£ +½ñ¤­¹þ¤Þ¤ì¤ëÃͤϡ¢»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ëÄÌÃΥ쥸¥¹¥¿¤Î¸½ºß¤ÎÃͤǤ¢¤ë¡£ +.TP +.BR write (2) +.\"O If +.\"O .I count +.\"O is smaller than four, +.\"O .BR write (2) +.\"O returns \-1 and sets +.\"O .I errno +.\"O to +.\"O .BR EINVAL . +.\"O Otherwise, a four-byte value is copied from the data buffer, +.\"O updating the value of the specified signal notification +.\"O register. +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR write (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ 4 ¥Ð¥¤¥È¤ÎÃͤ¬¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤«¤é¥³¥Ô¡¼¤µ¤ì¡¢ +»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ëÄÌÃΥ쥸¥¹¥¿¤ÎÃͤ¬¹¹¿·¤µ¤ì¤ë¡£ +.\"O The signal notification register will either be replaced with +.\"O the input data or will be updated to the bitwise OR operation +.\"O of the old value and the input data, depending on the contents +.\"O of the +.\"O .I signal1_type +.\"O or +.\"O .I signal2_type +.\"O files respectively. +¥·¥°¥Ê¥ëÄÌÃΥ쥸¥¹¥¿¤Î¹¹¿·¤Ë¤Ï¡¢¥ì¥¸¥¹¥¿ÃͤòÆþÎϥǡ¼¥¿¤ÇÃÖ¤­´¹¤¨¤ë¥â¡¼¥É¤È +°ÊÁ°¤ÎÃͤÈÆþÎϥǡ¼¥¿¤Î¥Ó¥Ã¥Èñ°Ì¤Î OR ¤ò¤È¤Ã¤¿Ãͤ˹¹¿·¤¹¤ë¥â¡¼¥É¤¬¤¢¤ë¡£ +¤É¤Á¤é¤Î¥â¡¼¥É¤Ë¤Ê¤ë¤«¤Ï¡¢¤½¤ì¤¾¤ì +.IR signal1_type , +.I signal2_type +¥Õ¥¡¥¤¥ë¤ÎÆâÍƤˤè¤Ã¤Æ·è¤Þ¤ë¡£ +.RE +.TP +.BR /signal1_type ", " /signal2_type +.\"O These two files change the behavior of the +.\"O .I signal1 +.\"O and +.\"O .I signal2 +.\"O notification files. +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¥·¥°¥Ê¥ëÄÌÃÎ¥Õ¥¡¥¤¥ë +.I signal1 +¤È +.I signal2 +¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¡£ +.\"O They contain a numerical +.\"O ASCII string which is read as either "1" or "0". +.\"O In mode 0 (overwrite), the hardware replaces the contents +.\"O of the signal channel with the data that is written to it. +.\"O In mode 1 (logical OR), the hardware accumulates the bits +.\"O that are subsequently written to it. +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï¿ôÃͤòɽ¤¹¥¢¥¹¥­¡¼Ê¸»úÎó¤òÊÝ»ý¤·¡¢ +Æɤ߽Ф¹¤È "1" ¤« "0" ¤Î¤É¤Á¤é¤«¤¬ÆÀ¤é¤ì¤ë¡£ +¥â¡¼¥É 0 (¾å½ñ¤­¥â¡¼¥É) ¤Ç¤Ï¡¢¥Ï¡¼¥É¥¦¥§¥¢¤Ï¥·¥°¥Ê¥ë¥Á¥ã¥Í¥ë¤ÎÆâÍƤò +¥·¥°¥Ê¥ë¥Á¥ã¥Í¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤ÇÃÖ¤­´¹¤¨¤ë¡£ +¥â¡¼¥É 1 (ÏÀÍý OR ¥â¡¼¥É) ¤Ç¤Ï¡¢¥Ï¡¼¥É¥¦¥§¥¢¤Ï¥·¥°¥Ê¥ë¥Á¥ã¥Í¥ë¤Ë +½ñ¤­¹þ¤Þ¤ì¤¿¥Ó¥Ã¥È¤òÀÑ»»¤·¤Æ¤¤¤¯¡£ +.\"O The possible operations on an open +.\"O .I signal1_type +.\"O or +.\"O .I signal2_type +.\"O file are: +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I signal1_type +¤ä +.I signal2_type +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.\"O When the count supplied to the +.\"O .BR read (2) +.\"O call is shorter than the required length for the digit +.\"O plus a newline character, subsequent reads from the same +.\"O file descriptor will complete the string. +.\"O When a complete string has been read, all subsequent read operations +.\"O will return zero bytes and a new file descriptor needs to be opened +.\"O to read the value again. +.BR read (2) +¤ËÅϤµ¤ì¤¿ +.I count +¤¬¥ì¥¸¥¹¥¿¤Î¿ôÃͤȲþ¹Ô (newline) ʸ»ú 1 ¸Ä¤ò³ÊǼ¤¹¤ë¤Î¤ËɬÍפÊŤµ¤è¤ê +û¤¤¾ì¹ç¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò³¤±¤Æ read ¤¹¤ë¤³¤È¤Ç¡¢ +ʸ»úÎóÁ´ÂΤòÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +ʸ»úÎóÁ´ÂΤ¬Æɤ߽Фµ¤ì¤ë¤È¡¢¤½¤ì°Ê¹ß¤Î read Áàºî¤Ç¤Ï 0 ¥Ð¥¤¥È¤¬ÊÖ¤µ¤ì¡¢ +¿·¤·¤¤ÃͤòÆɤ߽Ф¹¤Ë¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥ª¡¼¥×¥ó¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.TP +.BR write (2) +.\"O A +.\"O .BR write (2) +.\"O operation on the file sets the register to the +.\"O value given in the string. +.\"O The string is parsed from the beginning +.\"O until the first non-numeric character or the end of the buffer. +.\"O Subsequent writes to the same file descriptor overwrite the +.\"O previous setting. +¤³¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î +.BR write (2) +Áàºî¤Ï¥ì¥¸¥¹¥¿Ãͤòʸ»úÎó¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +ʸ»úÎó¤Î²ò¼á¤ÏÀèƬ¤«¤é³«»Ï¤µ¤ì¡¢¿ô»ú°Ê³°¤Îʸ»ú¤¬½é¤á¤ÆÅо줹¤ë¤«¡¢ +¥Ð¥Ã¥Õ¥¡¤ÎËöÈø¤Ë㤹¤ë¤Þ¤Ç¹Ô¤ï¤ì¤ë¡£ +Ʊ¤¸¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ø³¤±¤Æ write ¤ò¹Ô¤¦¤È¡¢ +¸å¤Î write ¤Ë¤è¤êÁ°¤ÎÀßÄ꤬¾å½ñ¤­¤µ¤ì¤ë¡£ +.RE +.\"O .SH EXAMPLE +.SH Îã +.TP +.IR /etc/fstab " entry" +none /spu spufs gid=spu 0 0 +.\" .SH AUTHORS +.\" Arnd Bergmann , +.\" Mark Nutter and +.\" Ulrich Weigand +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR spu_create (2), +.BR spu_run (2) diff --git a/draft/man7/standards.7 b/draft/man7/standards.7 new file mode 100644 index 00000000..65612dd8 --- /dev/null +++ b/draft/man7/standards.7 @@ -0,0 +1,449 @@ +.\" Copyright (c) 2006, Michael Kerrisk +.\" includes some material by other authors that was formerly +.\" in intro.2. +.\" +.\" 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) 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 »Ø¿Ë +.\" +.TH STANDARDS 7 2009-06-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.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. +¥Ù¥ë¸¦µæ½ê¤Ë¤è¤ë¸µÁÄ 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 ¤ò´Þ¤àºÇ½é¤Î¥ê¥ê¡¼¥¹¤Ç¤¢¤ë¡£ + +.\"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. +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 +.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 +.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")¡£ + +.\"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 ) +¤Ç¤¢¤ë)¡£ + +.\"O The POSIX.1-2001 document is broken into four parts: +POSIX.1-2001 ʸ½ñ¤Ï 4¤Ä¤ÎÉôʬ¤Ëʬ¤±¤ë¤³¤È¤¬¤Ç¤­¤ë: + +.BR XBD : +.\"O Definitions, terms and concepts, header file specifications. +ÄêµÁ¡¢ÍѸì¤È³µÇ°¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î»ÅÍÍ¡£ + +.BR XSH : +.\"O Specifications of functions (i.e., system calls and library +.\"O functions in actual implementations). +´Ø¿ô¤Î»ÅÍÍ (´Ø¿ô¤È¤Ï¡¢¼ÂºÝ¤Î¼ÂÁõ¤Ç¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤È +¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î¤³¤È¤Ç¤¢¤ë)¡£ + +.BR XCU : +.\"O Specifications of commands and utilities +.\"O (i.e., the area formerly described by POSIX.2). +¥³¥Þ¥ó¥É¤È¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Î»ÅÍÍ +(°ÊÁ°¡¢ POSIX.2 ¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤¿ÆâÍÆ)¡£ + +.BR XRAT : +.\"O Informative text on the other parts of the standard. +»²¹Í¾ðÊó¤Èµ¬³Ê¤Î¤½¤ì°Ê³°¤ÎÉôʬ + +.\"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 ¤Ç¤â +ɸ½à²½¤µ¤ì¤Æ¤¤¤ë¡£ + +.\"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. +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 ¤Ç¤ÏÇÑ»ßͽÄê¤Î°õ¤¬ÉÕ¤±¤é¤ì¤¿¤ê¡¢ +ɸ½à¤«¤é´°Á´¤Ëºï½ü¤µ¤ì¤¿¤ê¤·¤Æ¤¤¤ë¡£ + +.\"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 ½àµò)" +¤ÎÆó¤Ä¤Ç¤¢¤ë¡£ + +.\"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 +¤Ë¤â½àµò¤·¤Æ¤¤¤ë¤È¹Í¤¨¤Æ¤è¤¤¡£ + +.\"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" +.SH ´ØÏ¢¹àÌÜ +.BR feature_test_macros (7), +.BR libc (7), +.BR posixoptions (7) diff --git a/draft/man7/suffixes.7 b/draft/man7/suffixes.7 new file mode 100644 index 00000000..cab7fdc2 --- /dev/null +++ b/draft/man7/suffixes.7 @@ -0,0 +1,526 @@ +'\" 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 RedHat software package + .rpm RedHat ¤Î¥½¥Õ¥È¥¦¥§¥¢¡¦¥Ñ¥Ã¥±¡¼¥¸ +.\"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/svipc.7 b/draft/man7/svipc.7 new file mode 100644 index 00000000..628a3932 --- /dev/null +++ b/draft/man7/svipc.7 @@ -0,0 +1,516 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 Wed Feb 11 21:29:14 JST 1998 +.\" by HANATAKA Shinya +.\" +.\"WORD: semaphore set ¥»¥Þ¥Õ¥©¡¼½¸¹ç +.\"WORD: shared memory segment ¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È +.\"WORD: message queue ¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼ +.\" +.\" FIXME There is now duplication of some of the information +.\" below in semctl.2, msgctl.2, and shmctl.2 -- MTK, Nov 04 +.TH SVIPC 7 2009-01-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O svipc \- System V interprocess communication mechanisms +svipc \- System V ¥×¥í¥»¥¹´ÖÄÌ¿®µ¡¹½ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.B #include +.B #include +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This manual page refers to the Linux implementation of the System V +.\"O interprocess communication (IPC) mechanisms: +.\"O message queues, semaphore sets, and shared memory segments. +.\"O In the following, the word +.\"O .I resource +.\"O means an instantiation of one among such mechanisms. +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸¤Ï System V ¥×¥í¥»¥¹´ÖÄÌ¿® +(interprocess communication; IPC) µ¡¹½¤Î Linux ¤Ë +¤ª¤±¤ë¼ÂÁõ¤òÀâÌÀ¤¹¤ë¡£ +¤³¤Î¥×¥í¥»¥¹´ÖÄÌ¿®µ¡¹½¤Ë¤Ï¡¢ +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼ (message queue)¡¢¥»¥Þ¥Õ¥©¡¼½¸¹ç (semaphore set)¡¢ +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È (shared memory segment) ¤Ê¤É¤¬¤¢¤ë¡£°Ê²¼¤Ç +.I "»ñ¸» (resource)" +¤È¤¤¤¦ÍѸì¤ò»ÈÍѤ·¤¿¾ì¹ç¤Ë¤Ï¤³¤ì¤é¤Îµ¡¹½¤Î¤É¤ì¤«¤ò°ÕÌ£¤¹¤ë¡£ +.\"O .SS Resource Access Permissions +.SS »ñ¸»¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä +.\"O For each resource, the system uses a common structure of type +.\"O .I "struct ipc_perm" +.\"O to store information needed in determining permissions to perform an +.\"O IPC operation. +¥·¥¹¥Æ¥à¤Î¤½¤ì¤¾¤ì¤Î»ñ¸»¤Ï¡¢IPC ¤Ø¤ÎÁàºî¤òµö²Ä¤¹¤ë¤«¤É¤¦¤«¤ò·èÄꤹ¤ë +¤¿¤á¤Î¾ðÊó¤ò¶¦Ä̤ι½Â¤ÂÎ +.I "struct ipc_perm" +¤Ë³ÊǼ¤·¤Æ»ÈÍѤ¹¤ë¡£ +.\"O The +.\"O .I ipc_perm +.\"O structure, defined by the +.\"O .I +.\"O system header file, includes the following members: +.I ipc_perm +¹½Â¤ÂΤϡ¢¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤Î +.I +¤ËÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢°Ê²¼¤Î¥á¥ó¥Ð¡¼¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +struct ipc_perm { +.\"O uid_t cuid; /* creator user ID */ +.\"O gid_t cgid; /* creator group ID */ +.\"O uid_t uid; /* owner user ID */ +.\"O gid_t gid; /* owner group ID */ +.\"O unsigned short mode; /* r/w permissions */ + uid_t cuid; /* ºîÀ®¼Ô¤Î¥æ¡¼¥¶¡¼ID */ + gid_t cgid; /* ºîÀ®¼Ô¤Î¥°¥ë¡¼¥×ID */ + uid_t uid; /* ½êÍ­¼Ô¤Î¥æ¡¼¥¶¡¼ID */ + gid_t gid; /* ½êÍ­¼Ô¤Î¥°¥ë¡¼¥×ID */ + unsigned short mode; /* Æɤ߽ñ¤­¤Îµö²Ä */ +}; +.fi +.in +.PP +.\"O The +.\"O .I mode +.\"O member of the +.\"O .I ipc_perm +.\"O structure defines, with its lower 9 bits, the access permissions to the +.\"O resource for a process executing an IPC system call. +.\"O The permissions are interpreted as follows: +.I ipc_perm +¹½Â¤ÂΤΠ+.I mode +¥á¥ó¥Ð¡¼¤Ï°Ê²¼¤Î 9 ¥Ó¥Ã¥È¤Ç¡¢¥×¥í¥»¥¹¤Î IPC ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë +¤Ë¤è¤ë»ñ¸»¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä¤òÄêµÁ¤¹¤ë¡£ +µö²Ä¤Ï°Ê²¼¤Î¤è¤¦¤Ë²ò¼á¤µ¤ì¤ë: +.sp +.nf +.\"O 0400 Read by user. +.\"O 0200 Write by user. + 0400 ¥æ¡¼¥¶¡¼¤Ë¤è¤ëÆɤ߹þ¤ß¡£ + 0200 ¥æ¡¼¥¶¡¼¤Ë¤è¤ë½ñ¤­¹þ¤ß¡£ +.sp .5 +.\"O 0040 Read by group. +.\"O 0020 Write by group. + 0040 ¥°¥ë¡¼¥×¤Ë¤è¤ëÆɤ߹þ¤ß¡£ + 0020 ¥°¥ë¡¼¥×¤Ë¤è¤ë½ñ¤­¹þ¤ß¡£ +.sp .5 +.\"O 0004 Read by others. +.\"O 0002 Write by others. + 0004 ¾¿Í¤Ë¤è¤ëÆɤ߹þ¤ß¡£ + 0002 ¾¿Í¤Ë¤è¤ë½ñ¤­¹þ¤ß¡£ +.fi +.PP +.\"O Bits 0100, 0010, and 0001 (the execute bits) are unused by the system. +.\"O Furthermore, +.\"O "write" +.\"O effectively means +.\"O "alter" +.\"O for a semaphore set. +¥·¥¹¥Æ¥à¤Ï¥Ó¥Ã¥È 0100, 0010, 0001 (¼Â¹Ô¥Ó¥Ã¥È) ¤Ï»ÈÍѤ·¤Ê¤¤¡£ +¤µ¤é¤Ë¡¢¥»¥Þ¥Õ¥©¡¼¤Î¾ì¹ç¤Ë¤Ï +"½ñ¤­¹þ¤ß(write)" +¤Ï¼ÂºÝ¤Ë¤Ï +"Êѹ¹(alter)" +¤ò°ÕÌ£¤¹¤ë¡£ +.PP +.\"O The same system header file also defines the following symbolic +.\"O constants: +Ʊ¤¸¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤Ë¤Ï°Ê²¼¤Î¥·¥ó¥Ü¥ë¤ÎÄêµÁ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë: +.TP 14 +.B IPC_CREAT +.\"O Create entry if key doesn't exist. +¥­¡¼(key)¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï¿·¤¿¤Ê¥¨¥ó¥È¥ê¤òºîÀ®¤¹¤ë¡£ +.TP +.B IPC_EXCL +.\"O Fail if key exists. +¥­¡¼(key)¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¼ºÇÔ¤¹¤ë¡£ +.TP +.B IPC_NOWAIT +.\"O Error if request must wait. +Í׵᤬ÂÔ¤¿¤µ¤ì¤ë¾ì¹ç¤Ë¤Ï¥¨¥é¡¼¤Ë¤Ê¤ë¡£ +.TP +.B IPC_PRIVATE +.\"O Private key. +¥×¥é¥¤¥Ù¡¼¥È¡¦¥­¡¼¡£ +.TP +.B IPC_RMID +.\"O Remove resource. +»ñ¸»¤òºï½ü¤¹¤ë¡£ +.TP +.B IPC_SET +.\"O Set resource options. +»ñ¸»¤Ë¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¡£ +.TP +.B IPC_STAT +.\"O Get resource options. +»ñ¸»¤Î¥ª¥×¥·¥ç¥ó¤ò¼èÆÀ¤¹¤ë¡£ +.PP +.\"O Note that +.\"O .B IPC_PRIVATE +.\"O is a +.\"O .I key_t +.\"O type, while all the other symbolic constants are flag fields and can +.\"O be OR'ed into an +.\"O .I int +.\"O type variable. +.B IPC_PRIVATE +¤Ï +.I key_t +·¿¤Ç¤¢¤ë¡£¤½¤Î¾¤ÎÁ´¤Æ¤Î¥·¥ó¥Ü¥ë¤Ï¥Õ¥é¥°¡¦¥Õ¥£¡¼¥ë¥É¤È¤·¤Æ +.I int +ÊÑ¿ô¤Ë OR ±é»»¤Ç³ÊǼ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SS Message Queues +.SS ¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼ +.\"O A message queue is uniquely identified by a positive integer +.\"O .RI "(its " msqid ) +.\"O and has an associated data structure of type +.\"O .IR "struct msqid_ds" , +.\"O defined in +.\"O .IR , +.\"O containing the following members: +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ÏÀµ¤ÎÀ°¿ô +.RI "(" msqid ) +¤Ë¤è¤Ã¤Æ¼±Ê̤µ¤ì¡¢ +.I +¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¹½Â¤ÂÎ +.IR "struct msqid_ds" +¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¥á¥ó¥Ð¡¼¤ò´Þ¤ó¤Ç¤¤¤ë: +.in +4n +.nf + +struct msqid_ds { + struct ipc_perm msg_perm; +.\"O msgqnum_t msg_qnum; /* no of messages on queue */ +.\"O msglen_t msg_qbytes; /* bytes max on a queue */ +.\"O pid_t msg_lspid; /* PID of last msgsnd(2) call */ +.\"O pid_t msg_lrpid; /* PID of last msgrcv(2) call */ +.\"O time_t msg_stime; /* last msgsnd(2) time */ +.\"O time_t msg_rtime; /* last msgrcv(2) time */ +.\"O time_t msg_ctime; /* last change time */ + msgqnum_t msg_qnum; /* ¥­¥å¡¼¤Ë¤¢¤ë¥á¥Ã¥»¡¼¥¸¤Î¿ô */ + msglen_t msg_qbytes; /* ¥­¥å¡¼¤ÎºÇÂç¥Ð¥¤¥È¿ô */ + pid_t msg_lspid; /* ºÇ¸å¤Ë msgsnd(2) ¤ò¤·¤¿ PID */ + pid_t msg_lrpid; /* ºÇ¸å¤Ë msgrcv(2) ¤ò¤·¤¿ PID */ + time_t msg_stime; /* ºÇ¸å¤Ë msgsnd(2) ¤ò¤·¤¿»þ´Ö */ + time_t msg_rtime; /* ºÇ¸å¤Ë msgrcv(2) ¤ò¤·¤¿»þ´Ö */ + time_t msg_ctime; /* ºÇ¸å¤ËÊѹ¹¤µ¤ì¤¿»þ´Ö */ +}; +.fi +.in +.TP 11 +.I msg_perm +.\"O .I ipc_perm +.\"O structure that specifies the access permissions on the message +.\"O queue. +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä¤ò»ØÄꤹ¤ë +.I ipc_perm +¹½Â¤ÂΡ£ +.TP +.I msg_qnum +.\"O Number of messages currently on the message queue. +¸½ºß¡¢¤³¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ë¤¢¤ë¥á¥Ã¥»¡¼¥¸¤Î¿ô¡£ +.TP +.I msg_qbytes +.\"O Maximum number of bytes of message text allowed on the message +.\"O queue. +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¥á¥Ã¥»¡¼¥¸¤ÎºÇÂç¥Ð¥¤¥È¿ô¡£ +.TP +.I msg_lspid +.\"O ID of the process that performed the last +.\"O .BR msgsnd (2) +.\"O system call. +ºÇ¸å¤Ë +.BR msgsnd (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤¿¥×¥í¥»¥¹¤Î ID¡£ +.TP +.I msg_lrpid +.\"O ID of the process that performed the last +.\"O .BR msgrcv (2) +.\"O system call. +ºÇ¸å¤Ë +.BR msgrcv (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤¿¥×¥í¥»¥¹¤Î ID¡£ +.TP +.I msg_stime +.\"O Time of the last +.\"O .BR msgsnd (2) +.\"O system call. +ºÇ¸å¤Ë +.BR msgsnd (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤¿»þ´Ö¡£ +.I msg_rtime +.\"O Time of the last +.\"O .BR msgrcv (2) +.\"O system call. +ºÇ¸å¤Ë +.BR msgrcv (2) +¤ò¹Ô¤Ê¤Ã¤¿»þ´Ö¡£ +.TP +.I msg_ctime +.\"O Time of the last +.\"O system call that changed a member of the +.\"O .I msqid_ds +.\"O structure. +ºÇ¸å¤Ë +.I msqid_ds +¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤¬Êѹ¹¤µ¤ì¤¿»þ´Ö¡£ +.\"O .SS Semaphore Sets +.SS ¥»¥Þ¥Õ¥©¡¼½¸¹ç +.\"O A semaphore set is uniquely identified by a positive integer +.\"O .RI "(its " semid ) +.\"O and has an associated data structure of type +.\"O .IR "struct semid_ds" , +.\"O defined in +.\"O .IR , +.\"O containing the following members: +¥»¥Þ¥Õ¥©¡¼½¸¹ç¤ÏÀµ¤ÎÀ°¿ô +.RI "(" semid ) +¤Ë¤è¤Ã¤Æ¼±Ê̤µ¤ì¡¢ +.I +¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¹½Â¤ÂÎ +.IR "struct semid_ds" +¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¥á¥ó¥Ð¡¼¤ò´Þ¤ó¤Ç¤¤¤ë: +.in +4n +.nf + +struct semid_ds { + struct ipc_perm sem_perm; +.\"O time_t sem_otime; /* last operation time */ +.\"O time_t sem_ctime; /* last change time */ +.\"O unsigned long sem_nsems; /* count of sems in set */ + time_t sem_otime; /* ºÇ¸å¤ËÁàºî¤·¤¿»þ´Ö */ + time_t sem_ctime; /* ºÇ¸å¤ËÊѹ¹¤·¤¿»þ´Ö */ + unsigned long sem_nsems; /* ½¸¹ç¤ÎÃæ¤Ë¤¢¤ë¥»¥Þ¥Õ¥©¡¼¿ô */ +}; +.fi +.in +.TP 11 +.I sem_perm +.\"O .I ipc_perm +.\"O structure that specifies the access permissions on the semaphore +.\"O set. +¥»¥Þ¥Õ¥©¡¼½¸¹ç¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä¤ò»ØÄꤹ¤ë +.I ipc_perm +¹½Â¤ÂΡ£ +.TP +.I sem_otime +.\"O Time of last +.\"O .BR semop (2) +.\"O system call. +ºÇ¸å¤Ë +.BR semop (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤¿»þ´Ö¡£ +.TP +.I sem_ctime +.\"O Time of last +.\"O .BR semctl (2) +.\"O system call that changed a member of the above structure or of one +.\"O semaphore belonging to the set. +ºÇ¸å¤Ë +.BR semctl (2) +¤ò¹Ô¤Ê¤Ã¤Æ¾åµ­¤Î¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤òÊѹ¹¤¹¤ë¤«¡¢¥»¥Þ¥Õ¥©¡¼½¸¹ç¤Ë°¤¹¤ë +¥»¥Þ¥Õ¥©¡¼¤òÊѹ¹¤·¤¿»þ´Ö¡£ +.TP +.I sem_nsems +.\"O Number of semaphores in the set. +.\"O Each semaphore of the set is referenced by a nonnegative integer +.\"O ranging from +.\"O .B 0 +.\"O to +.\"O .IR sem_nsems\-1 . +¥»¥Þ¥Õ¥©¡¼½¸¹ç¤ÎÃæ¤Ë¤¢¤ë¥»¥Þ¥Õ¥©¡¼¤Î¿ô¡£ +½¸¹ç¤ÎÃæ¤Ë¤¢¤ë¤½¤ì¤¾¤ì¤Î¥»¥Þ¥Õ¥©¡¼¤ÏÉé¤Ç¤Ê¤¤À°¿ô¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¡¢ +.B 0 +¤«¤é +.I sem_nsems\-1 +¤Þ¤Ç¤ÎÈÖ¹æ¤ò»ý¤Ä¡£ +.PP +.\"O A semaphore is a data structure of type +.\"O .I "struct sem" +.\"O containing the following members: +¥»¥Þ¥Õ¥©¡¼¤Ï +.I "struct sem" +·¿¤Î¥Ç¡¼¥¿¹½Â¤ÂΤǤ¢¤ê¡¢°Ê²¼¤Î¥á¥ó¥Ð¡¼¤ò´Þ¤ó¤Ç¤¤¤ë: +.in +4n +.nf + +struct sem { +.\"O int semval; /* semaphore value */ +.\"O int sempid; /* PID for last operation */ +.\"O .\" unsigned short semncnt; /* nr awaiting semval to increase */ +.\"O .\" unsigned short semzcnt; /* nr awaiting semval = 0 */ + int semval; /* ¥»¥Þ¥Õ¥©¡¼¤ÎÃÍ */ + int sempid; /* ºÇ¸å¤ËÁàºî¤·¤¿¥×¥í¥»¥¹ ID */ +.\" unsigned short semncnt; /* semval ¤ÎÁý²Ã¤òÂԤĿô */ +.\" unsigned short semzcnt; /* semval = 0 ¤òÂԤĿô */ +}; +.fi +.in +.TP 11 +.I semval +.\"O Semaphore value: a nonnegative integer. +¥»¥Þ¥Õ¥©¡¼ÃÍ: Éé¤Ç¤Ê¤¤À°¿ô¡£ +.TP +.I sempid +.\"O ID of the last process that performed a semaphore operation +.\"O on this semaphore. +¤³¤Î¥»¥Þ¥Õ¥©¡¼¤òºÇ¸å¤ËÁàºî¤·¤¿¥×¥í¥»¥¹¤Î ID¡£ +.\".TP +.\".I semncnt +.\"O .\"Number of processes suspended awaiting for +.\"O .\".I semval +.\"O .\"to increase. +.\".I semval +.\"¤ÎÃͤ¬Áý²Ã¤¹¤ë¤òÂԤäÆÄä»ß¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î¿ô¡£ +.\".TP +.\".I semznt +.\"O .\"Number of processes suspended awaiting for +.\"O .\".I semval +.\"O .\"to become zero. +.\".I semval +.\"¤¬ 0 ¤Ë¤Ê¤ë¤Î¤òÂԤäÆÄä»ß¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î¿ô¡£ +.\"O .SS Shared Memory Segments +.SS ¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È +.\"O A shared memory segment is uniquely identified by a positive integer +.\"O .RI "(its " shmid ) +.\"O and has an associated data structure of type +.\"O .IR "struct shmid_ds" , +.\"O defined in +.\"O .IR , +.\"O containing the following members: +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥È¤ÏÀµ¤ÎÀ°¿ô +.RI "(" shmid ) +¤Ë¤è¤Ã¤Æ¼±Ê̤µ¤ì¡¢ +.I +¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +.IR "struct shmid_ds" +¹½Â¤ÂΤ˷ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¥á¥ó¥Ð¡¼¤ò´Þ¤ó¤Ç¤¤¤ë: +.in +4n +.nf + +struct shmid_ds { + struct ipc_perm shm_perm; +.\"O size_t shm_segsz; /* size of segment */ +.\"O pid_t shm_cpid; /* PID of creator */ +.\"O pid_t shm_lpid; /* PID, last operation */ +.\"O shmatt_t shm_nattch; /* no. of current attaches */ +.\"O time_t shm_atime; /* time of last attach */ +.\"O time_t shm_dtime; /* time of last detach */ +.\"O time_t shm_ctime; /* time of last change */ + size_t shm_segsz; /* ¥»¥°¥á¥ó¥È¤Î¥µ¥¤¥º */ + pid_t shm_cpid; /* ºîÀ®¼Ô¤Î¥×¥í¥»¥¹ ID */ + pid_t shm_lpid; /* ºÇ¸å¤ËÁàºî¤·¤¿¥×¥í¥»¥¹ ID */ + shmatt_t shm_nattch; /* ¸½ºß¡¢Éղ䷤Ƥ¤¤ë¿ô */ + time_t shm_atime; /* ºÇ¸å¤ËÉղä·¤¿»þ´Ö */ + time_t shm_dtime; /* ºÇ¸å¤ËʬΥ¤·¤¿»þ´Ö */ + time_t shm_ctime; /* ºÇ¸å¤ËÊѹ¹¤·¤¿»þ´Ö */ +}; +.fi +.in +.TP 11 +.I shm_perm +.\"O .I ipc_perm +.\"O structure that specifies the access permissions on the shared memory +.\"O segment. +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä¤ò»ØÄꤷ¤¿ +.I ipc_perm +¹½Â¤ÂΡ£ +.TP +.I shm_segsz +.\"O .I shm_segsz +.\"O Size in bytes of the shared memory segment. +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Î¥Ð¥¤¥È¿ô¡£ +.TP +.I shm_cpid +.\"O ID of the process that created the shared memory segment. +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤òºîÀ®¤·¤¿¥×¥í¥»¥¹¤Î ID¡£ +.TP +.I shm_lpid +.\"O ID of the last process that executed a +.\"O .BR shmat (2) +.\"O or +.\"O .BR shmdt (2) +.\"O system call. +ºÇ¸å¤Ë +.BR shmat (2) +¤Þ¤¿¤Ï +.BR shmdt (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¼Â¹Ô¤·¤¿¥×¥í¥»¥¹¤Î ID¡£ +.TP +.I shm_nattch +.\"O Number of current alive attaches for this shared memory segment. +¤³¤Î¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ò¥á¥â¥ê¤ËÉղà (attach) ¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î¿ô¡£ +.TP +.I shm_atime +.\"O Time of the last +.\"O .BR shmat (2) +.\"O system call. +ºÇ¸å¤Ë +.BR shmat (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤¿»þ´Ö¡£ +.TP +.I shm_dtime +.\"O Time of the last +.\"O .BR shmdt (2) +.\"O system call. +ºÇ¸å¤Ë +.BR shmdt (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤¿»þ´Ö¡£ +.TP +.I shm_ctime +.\"O Time of the last +.\"O .BR shmctl (2) +.\"O system call that changed +.\"O .IR shmid_ds . +ºÇ¸å¤Ë +.BR shmctl (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤Æ¡¢ +.I shmid_ds +¹½Â¤ÂΤòÊѹ¹¤·¤¿»þ´Ö¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR ipc (2), +.BR msgctl (2), +.BR msgget (2), +.BR msgrcv (2), +.BR msgsnd (2), +.BR semctl (2), +.BR semget (2), +.BR semop (2), +.BR shmat (2), +.BR shmctl (2), +.BR shmdt (2), +.BR shmget (2), +.BR ftok (3) diff --git a/draft/man7/tcp.7 b/draft/man7/tcp.7 new file mode 100644 index 00000000..ffb8a21b --- /dev/null +++ b/draft/man7/tcp.7 @@ -0,0 +1,1988 @@ +.\" This man page is Copyright (C) 1999 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. +.\" +.\" 2.4 Updates by Nivedita Singhvi 4/20/02 . +.\" Modified, 2004-11-11, Michael Kerrisk and Andries Brouwer +.\" Updated details of interaction of TCP_CORK and TCP_NODELAY. +.\" +.\" 2008-11-21, mtk, many, many updates. +.\" The descriptions of /proc files and socket options should now +.\" be more or less up to date and complete as at Linux 2.6.27 +.\" (other than the remaining FIXMEs in the page source below). +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2002-11-15, NAKANO Takeo +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" Updated 2005-09-07, Akihiro MOTOKI +.\" Updated 2005-12-26, Akihiro MOTOKI +.\" Updated 2006-07-19, Akihiro MOTOKI, LDP v2.36 +.\" Updated 2008-08-07, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-12-31, Akihiro MOTOKI, LDP v3.15 +.\" Updated 2009-03-01, Akihiro MOTOKI, LDP v3.19 +.\" +.\"WORD full duplex connection Á´Æó½ÅÄÌ¿® +.\"WORD listening state ÀܳÂÔ¤Á¼õ¤±¾õÂÖ +.\"WORD denial of service attack DoS ¹¶·â +.\"WORD urgent data ¶ÛµÞ¥Ç¡¼¥¿ +.\" +.TH TCP 7 2009-09-30 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O tcp \- TCP protocol +.SH ̾Á° +tcp \- TCP ¥×¥í¥È¥³¥ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.br +.B #include +.sp +.B tcp_socket = socket(AF_INET, SOCK_STREAM, 0); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This is an implementation of the TCP protocol defined in +.\"O RFC\ 793, RFC\ 1122 and RFC\ 2001 with the NewReno and SACK +.\"O extensions. +.\"O It provides a reliable, stream-oriented, +.\"O full-duplex connection between two sockets on top of +.\"O .BR ip (7), +.\"O for both v4 and v6 versions. +.\"O TCP guarantees that the data arrives in order and +.\"O retransmits lost packets. +.\"O It generates and checks a per-packet checksum to catch +.\"O transmission errors. +.\"O TCP does not preserve record boundaries. +¤³¤ì¤Ï RFC\ 793, RFC\ 1122, RFC\ 2001 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë TCP ¥×¥í¥È¥³¥ë¤ò +NewReno ³ÈÄ¥¤È SACK ³ÈÄ¥¤ò´Þ¤á¤Æ¼ÂÁõ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +TCP ¤Ï¡¢ +.BR ip (7) +¾å¤ÎÆó¤Ä¤Î¥½¥±¥Ã¥È´Ö¤Ë¡¢¿®ÍêÀ­¤Î¹â¤¤¡¢¥¹¥È¥ê¡¼¥à»Ø¸þ¤ÎÁ´Æó½Å +(full-duplex) ÄÌ¿®¤òÄ󶡤¹¤ë¡£ +v4 ¤È v6 ¤ÎξÊý¤Î¥Ð¡¼¥¸¥ç¥ó¤Î +.BR ip (7) +¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +TCP ¤Ï¡¢¥Ç¡¼¥¿¤¬½ç½ø¤ò¼é¤Ã¤ÆÅþÃ夹¤ë¤³¤È¡¢ÅÓÃæ¤Ç¼º¤ï¤ì¤¿¥Ñ¥±¥Ã¥È¤¬ +ºÆÁ÷¤µ¤ì¤ë¤³¤È¤òÊݾڤ¹¤ë¡£¤Þ¤¿¡¢¥Ñ¥±¥Ã¥Èñ°Ì¤Ë¥Á¥§¥Ã¥¯¥µ¥à¤ò +À¸À®¡¢¸¡ºº¤¹¤ë¤³¤È¤Ç¡¢Å¾Á÷¥¨¥é¡¼¤ò¸¡ÃΤ¹¤ë¡£ +TCP ¤Ï¥ì¥³¡¼¥É¶­³¦ (record boundary) ¤òÊݸ¤·¤Ê¤¤¡£ + +.\"O A newly created TCP socket has no remote or local address and is not +.\"O fully specified. +.\"O To create an outgoing TCP connection use +.\"O .BR connect (2) +.\"O to establish a connection to another TCP socket. +.\"O To receive new incoming connections, first +.\"O .BR bind (2) +.\"O the socket to a local address and port and then call +.\"O .BR listen (2) +.\"O to put the socket into the listening state. +.\"O After that a new socket for each incoming connection can be accepted using +.\"O .BR accept (2). +.\"O A socket which has had +.\"O .BR accept (2) +.\"O or +.\"O .BR connect (2) +.\"O successfully called on it is fully specified and may transmit data. +.\"O Data cannot be transmitted on listening or not yet connected sockets. +¿·¤·¤¯À¸À®¤µ¤ì¤¿¤Ð¤«¤ê¤Î TCP ¥½¥±¥Ã¥È¤Ï¡¢ +¥ê¥â¡¼¥È¥¢¥É¥ì¥¹¤«¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤¬¤Ê¤¯¡¢ +¤·¤¿¤¬¤Ã¤Æ¾ÜºÙ¤¬´°Á´¤Ë»ØÄꤵ¤ì¤¿¾õÂ֤ǤϤʤ¤¡£ +³°Éô¤Ø¤Î TCP Àܳ¤òÀ¸À®¤¹¤ë¤Ë¤Ï¡¢ +.BR connect (2) +¤òÍѤ¤¤Æ¤â¤¦°ìÊý¤Î TCP ¥½¥±¥Ã¥È¤Ø¤ÎÀܳ¤ò³ÎΩ¤¹¤ë¡£ +³°Éô¤«¤é¤Î¿·¤¿¤ÊÀܳ¤ò¼õ¤±¤ë¤Ë¤Ï¡¢¤Þ¤º +.BR bind (2) +¤Ç¥½¥±¥Ã¥È¤ò¥í¡¼¥«¥ë¤Ê¥¢¥É¥ì¥¹¤È¥Ý¡¼¥È¤Ë·ë¤Ó¤Ä¤±¡¢¼¡¤Ë +.BR listen (2) +¤ò¸Æ¤ó¤Ç¥½¥±¥Ã¥È¤òÀܳÂÔ¤Á¼õ¤±¾õÂ֤ˤ¹¤ë¡£ +¤½¤Î¸å¡¢ÅþÃ夷¤¿ÀܳÍ×µá¤ËÂФ·¤Æ +.BR accept (2) +¤òÍѤ¤¡¢¥½¥±¥Ã¥È¤ò¿·¤·¤¯À¸À®¤¹¤ë¡£ +.BR accept (2) +¤Þ¤¿¤Ï +.BR connect (2) +¤Î¥³¡¼¥ë¤¬À®¸ù¤·¤¿¥½¥±¥Ã¥È¤Ï¡¢¾ÜºÙ¤¬´°Á´¤Ë»ØÄꤵ¤ì¤¿¾õÂ֤Ȥʤꡢ +¥Ç¡¼¥¿¤Î¤ä¤ê¤È¤ê¤¬²Äǽ¤È¤Ê¤ë¡£ÀܳÂÔ¤Á¼õ¤±¾õÂ֤Π(listening) ¥½¥±¥Ã¥È¤ä¡¢ +Àܳ (connect) ¤µ¤ì¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤òÄ̤·¤Æ¥Ç¡¼¥¿¤ò¤ä¤ê¤È¤ê¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ + +.\"O Linux supports RFC\ 1323 TCP high performance +.\"O extensions. +.\"O These include Protection Against Wrapped +.\"O Sequence Numbers (PAWS), Window Scaling and Timestamps. +.\"O Window scaling allows the use +.\"O of large (> 64K) TCP windows in order to support links with high +.\"O latency or bandwidth. +.\"O To make use of them, the send and receive buffer sizes must be increased. +.\"O They can be set globally with the +.\"O .I /proc/sys/net/ipv4/tcp_wmem +.\"O and +.\"O .I /proc/sys/net/ipv4/tcp_rmem +.\"O files, or on individual sockets by using the +.\"O .B SO_SNDBUF +.\"O and +.\"O .B SO_RCVBUF +.\"O socket options with the +.\"O .BR setsockopt (2) +.\"O call. +Linux ¤Ï RFC\ 1323 ¤Î TCP high performance ³ÈÄ¥¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Ë¤Ï¡¢Protection Against Wrapped Sequence Numbers (PAWS)¡¢ +¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¡¢¥¿¥¤¥à¥¹¥¿¥ó¥×¤Ê¤É¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¤òÍøÍѤ¹¤ë¤È¡¢ÃÙ±ä¤Þ¤¿¤ÏÂÓ°è¤ÎÂ礭¤ÊÀܳ¤Ç¡¢ +(64K °Ê¾å¤Î) µðÂç¤Ê TCP ¥¦¥£¥ó¥É¥¦¤òÍѤ¤¤ë¤³¤È¤¬²Äǽ¤È¤Ê¤ë¡£ +¤³¤ì¤òÍѤ¤¤ë¤Ë¤Ï¡¢Á÷¼õ¿®¤Î¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤òÂ礭¤¯¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥·¥¹¥Æ¥àÁ´ÂΤËÂФ¹¤ë¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ÎÊѹ¹¤Ï¡¢¥Õ¥¡¥¤¥ë +.I /proc/sys/net/ipv4/tcp_wmem +¤È +.I /proc/sys/net/ipv4/tcp_rmem +¤òÍѤ¤¤Æ¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤Þ¤¿¡¢¸Ä¡¹¤Î¥½¥±¥Ã¥È¤Î¤ß¤òÂ礭¤¯¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +.B SO_SNDBUF +¤ä +.B SO_RCVBUF +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤Æ +.BR setsockopt (2) +¥³¡¼¥ë¤òÍѤ¤¤ÆÀßÄꤹ¤ì¤Ð¤è¤¤¡£ + +.\"O The maximum sizes for socket buffers declared via the +.\"O .B SO_SNDBUF +.\"O and +.\"O .B SO_RCVBUF +.\"O mechanisms are limited by the values in the +.\"O .I /proc/sys/net/core/rmem_max +.\"O and +.\"O .I /proc/sys/net/core/wmem_max +.\"O files. +.B SO_SNDBUF +¤ä +.B SO_RCVBUF +¤Î¥á¥«¥Ë¥º¥à¤ÇÀë¸À¤µ¤ì¤ë¥½¥±¥Ã¥È¥Ð¥Ã¥Õ¥¡¤ÎºÇÂ祵¥¤¥º¤Ï¡¢¥Õ¥¡¥¤¥ë +.I /proc/sys/net/core/rmem_max +¤ä +.I /proc/sys/net/core/wmem_max +¤Ç»ØÄꤵ¤ì¤¿¥·¥¹¥Æ¥à¤È¤·¤Æ¤ÎÀ©¸ÂÃͤòĶ¤¨¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\"O Note that TCP actually allocates twice the size of +.\"O the buffer requested in the +.\"O .BR setsockopt (2) +.\"O call, and so a succeeding +.\"O .BR getsockopt (2) +.\"O call will not return the same size of buffer as requested in the +.\"O .BR setsockopt (2) +.\"O call. +TCP ¤Ï¼ÂºÝ¤Ë¤Ï +.BR setsockopt (2) +¥³¡¼¥ë¤¬Í׵ᤷ¤¿¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ÎÆóÇܤò³ä¤êÅö¤Æ¤ë¡£ +¤½¤Î¤¿¤á¡¢¤³¤Î¸å¤Ç +.BR getsockopt (2) +¥³¡¼¥ë¤ò¹Ô¤¦¤È¡¢ +.BR setsockopt (2) +¤ÇÍ׵ᤷ¤¿¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤È¤Ï°Û¤Ê¤ëÃͤ¬Ê֤롣 +.\"O TCP uses the extra space for administrative purposes and internal +.\"O kernel structures, and the +.\"O .I /proc +.\"O file values reflect the +.\"O larger sizes compared to the actual TCP windows. +TCP ¤Ï¤³¤Î;ʬ¤Ê¶õ´Ö¤ò¡¢´ÉÍýÌÜŪ¤ä¥«¡¼¥Í¥ëÆâÉô¤Î¹½Â¤ÂΤËÍѤ¤¤Æ¤¤¤ë¡£ +.I /proc +¥Õ¥¡¥¤¥ë¤ÎÃͤϡ¢¤³¤ì¤é¤òÈ¿±Ç¤·¡¢¼ÂºÝ¤Î TCP ¥¦¥£¥ó¥É¥¦¤è¤ê¤âÂ礭¤ÊÃͤȤʤ롣 +.\"O On individual connections, the socket buffer size must be set prior to the +.\"O .BR listen (2) +.\"O or +.\"O .BR connect (2) +.\"O calls in order to have it take effect. +.\"O See +.\"O .BR socket (7) +.\"O for more information. +³ÆÀܳ¤Ë¤ª¤±¤ë¥½¥±¥Ã¥È¤Î¥Ð¥Ã¥Õ¥¡¥µ¥¤¥ºÊѹ¹¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢ +.BR listen (2) +¤ä +.BR connect (2) +¥³¡¼¥ë¤ÎÁ°¤ËÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR socket (7) +¤ò¸«¤è¡£ +.PP +.\"O TCP supports urgent data. +.\"O Urgent data is used to signal the +.\"O receiver that some important message is part of the data +.\"O stream and that it should be processed as soon as possible. +.\"O To send urgent data specify the +.\"O .B MSG_OOB +.\"O option to +.\"O .BR send (2). +TCP ¤Ï¶ÛµÞ¥Ç¡¼¥¿ (urgent data) ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£¶ÛµÞ¥Ç¡¼¥¿¤Ï +²¿¤é¤«¤Î½ÅÍפʥá¥Ã¥»¡¼¥¸¤¬¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥à¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤³¤È¡¢ +¤½¤Î¥Ç¡¼¥¿¤ò¤Ç¤­¤ë¤À¤±Á᤯½èÍý¤¹¤Ù¤­¤³¤È¡¢¤ò¼õ¿®¼Ô¤ËÅÁ¤¨¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +¶ÛµÞ¥Ç¡¼¥¿¤òÁ÷¤ë¤Ë¤Ï¡¢ +.BR send (2) +¤Ë +.B MSG_OOB +¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¡£ +.\"O When urgent data is received, the kernel sends a +.\"O .B SIGURG +.\"O signal to the process or process group that has been set as the +.\"O socket "owner" using the +.\"O .B SIOCSPGRP +.\"O or +.\"O .B FIOSETOWN +.\"O ioctls (or the POSIX.1-2001-specified +.\"O .BR fcntl (2) +.\"O .B F_SETOWN +.\"O operation). +.\"O When the +.\"O .B SO_OOBINLINE +.\"O socket option is enabled, urgent data is put into the normal +.\"O data stream (a program can test for its location using the +.\"O .B SIOCATMARK +.\"O ioctl described below), +.\"O otherwise it can be only received when the +.\"O .B MSG_OOB +.\"O flag is set for +.\"O .BR recv (2) +.\"O or +.\"O .BR recvmsg (2). +¶ÛµÞ¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï +.B SIGURG +¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ë¡£Á÷¿®Àè¤Ï +.B SIOCSPGRP +¤ä +.B FIOSETOWN +ioctl (¤ä POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë +.BR fcntl (2) +.B F_SETOWN +Áàºî) ¤òÍѤ¤¤Æ¤½¤Î¥½¥±¥Ã¥È¤Î¡Ö½êÍ­¼Ô¡×¤È¤·¤ÆÀßÄꤵ¤ì¤¿ +¥×¥í¥»¥¹¤«¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ç¤¢¤ë¡£ +.B SO_OOBINLINE +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¶ÛµÞ¥Ç¡¼¥¿¤Ï +Ä̾ï¤Î¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥à¤ÎÃæ¤Ëº®¤¼¤ÆÁ÷¤é¤ì¤ë (¥×¥í¥°¥é¥à¤Ï²¼µ­¤Î +.B SIOCATMARK +ioctl ¤ò»È¤Ã¤Æ¶ÛµÞ¥Ç¡¼¥¿¤Î¾ì½ê¤òÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë)¡£ +̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR recv (2) +¤ä +.BR recvmsg (2) +¤Ç +.B MSG_OOB +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ë¤Î¤ß¡¢¶ÛµÞ¥Ç¡¼¥¿¤ò¼õ¿®¤Ç¤­¤ë¡£ + +.\"O Linux 2.4 introduced a number of changes for improved +.\"O throughput and scaling, as well as enhanced functionality. +.\"O Some of these features include support for zero-copy +.\"O .BR sendfile (2), +.\"O Explicit Congestion Notification, new +.\"O management of TIME_WAIT sockets, keep-alive socket options +.\"O and support for Duplicate SACK extensions. +Linux 2.4 ¤Ç¤Ï¿¤¯¤ÎÊѹ¹¤¬¤Ê¤µ¤ì¡¢ +¥¹¥ë¡¼¥×¥Ã¥È¤È¥¹¥±¡¼¥ê¥ó¥°¤¬¸þ¾å¤·¡¢µ¡Ç½¤â¹â¤Þ¤Ã¤¿¡£ +¤³¤ì¤é¤Îµ¡Ç½¤Ë¤Ï¡¢¥¼¥í¥³¥Ô¡¼ +.BR sendfile (2)¡¢ +Explicit Congestion Notification¡¢ +TIME_WAIT ¥½¥±¥Ã¥È¤Î¿·¤·¤¤´ÉÍýË¡¡¢ +keep-alive ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¡¢ +Duplicate SACK ³ÈÄ¥¤Î¥µ¥Ý¡¼¥È¤Ê¤É¤¬¤¢¤ë¡£ +.\"O .SS Address Formats +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.\"O TCP is built on top of IP (see +.\"O .BR ip (7)). +.\"O The address formats defined by +.\"O .BR ip (7) +.\"O apply to TCP. +.\"O TCP only supports point-to-point +.\"O communication; broadcasting and multicasting are not +.\"O supported. +TCP ¤Ï IP ¤Î¾åÁؤ˹½ÃÛ¤µ¤ì¤Æ¤¤¤ë +.RB ( ip (7) +¤ò»²¾È)¡£ +.BR ip (7) +¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï TCP ¤Ë¤âŬÍѤµ¤ì¤ë¡£ +TCP ¤Ï point-to-point ¤ÎÄÌ¿®¤À¤±¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤ä¥Þ¥ë¥Á¥­¥ã¥¹¥È¤Ï¥µ¥Ý¡¼¥È¤·¤Ê¤¤¡£ +.\"O .SS /proc interfaces +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.\"O System-wide TCP parameter settings can be accessed by files in the directory +.\"O .IR /proc/sys/net/ipv4/ . +.\"O In addition, most IP +.\"O .I /proc +.\"O interfaces also apply to TCP; see +.\"O .BR ip (7). +¥·¥¹¥Æ¥àÁ´ÂΤËÂФ¹¤ë TCP ¥Ñ¥é¥á¡¼¥¿¤ÎÀßÄê¤Ë¤Ï¡¢ +.I /proc/sys/net/ipv4/ +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤Ë¤è¤ê¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +¤µ¤é¤Ë¡¢IP ¤Ë´ØÏ¢¤¹¤ë +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¤Û¤È¤ó¤É¤Ï TCP ¤Ë¤Ä¤¤¤Æ¤âŬÍѤµ¤ì¤ë¡£ +.BR ip (7) +¤ò»²¾È¤Î¤³¤È¡£ +.\"O .I Boolean +.\"O take an integer value, with a nonzero value ("true") meaning that +.\"O the corresponding option is enabled, and a zero value ("false") +.\"O meaning that the option is disabled. +.I Boolean +¤ÏÀ°¿ôÃͤǡ¢ +0 °Ê³°¤ÎÃÍ ("true") ¤ÏÂбþ¤¹¤ë¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¡¢ +0 ÃÍ ("false") ¤Ï̵¸ú¡¢¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.TP +.\"O .IR tcp_abc " (Integer; default: 0; since Linux 2.6.15)" +.IR tcp_abc " (Integer; default: 0; Linux 2.6.15 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +.\"O Control the Appropriate Byte Count (ABC), defined in RFC 3465. +.\"O ABC is a way of increasing the congestion window +.\"O .RI ( cwnd ) +.\"O more slowly in response to partial acknowledgments. +RFC 3465 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë Appropriate Byte Count (ABC) ¤òÀ©¸æ¤¹¤ë¡£ +ABC ¤Ï¡¢ÉôʬŪ¤Ê ACK ¤Ë±þ¤¸¤¿íÕíÔ¥¦¥£¥ó¥É¥¦ +.RI ( cwnd ) +¤ÎÁý²Ã¤ò¤è¤ê´Ë¤ä¤«¤Ë¤¹¤ëÊýË¡¤Ç¤¢¤ë¡£ +.\"O Possible values are: +°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë¡£ +.RS +.IP 0 3 +.\"O increase +.\"O .I cwnd +.\"O once per acknowledgment (no ABC) +ACK ¤ò¼õ¿®¤¹¤ëËè¤Ë +.I cwnd +¤òÁý¤ä¤¹ (ABC ¤Ê¤·)¡£ +.IP 1 +.\"O increase +.\"O .I cwnd +.\"O once per acknowledgment of full sized segment +¥Õ¥ë¥µ¥¤¥º¤Î¥»¥°¥á¥ó¥È¤Î ACK ¤ò¼õ¿®¤¹¤ëËè¤Ë +.I cwnd +¤òÁý¤ä¤¹¡£ +.IP 2 +.\"O allow increase +.\"O .I cwnd +.\"O by two if acknowledgment is +.\"O of two segments to compensate for delayed acknowledgments. +ACK ¤¬ÃÙ±ä ACK (delayed acknowledgment) ¤òÁ껦¤¹¤ë¤¿¤á¤Î 2 ¥»¥°¥á¥ó¥È¤Ë +ÂФ¹¤ë ACK ¤Î¾ì¹ç¤Ë¡¢ +.I cwnd +¤ò 2 Áý¤ä¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.RE +.TP +.\"O .IR tcp_abort_on_overflow " (Boolean; default: disabled; since Linux 2.4)" +.IR tcp_abort_on_overflow " (Boolean; default: disabled; Linux 2.4 °Ê¹ß)" +.\" Since 2.3.41 +.\"O Enable resetting connections if the listening service is too +.\"O slow and unable to keep up and accept them. +.\"O It means that if overflow occurred due +.\"O to a burst, the connection will recover. +.\"O Enable this option +.\"O .I only +.\"O if you are really sure that the listening daemon +.\"O cannot be tuned to accept connections faster. +.\"O Enabling this option can harm the clients of your server. +Àܳ¤òÂÔ¤Á¼õ¤±¤Æ¤¤¤ë¥µ¡¼¥Ó¥¹¤¬ÃÙ¤¹¤®¤Æ¡¢¼õ¿®¤Ë¤Ä¤¤¤Æ¤¤¤±¤Ê¤¤¾ì¹ç¤Ë¡¢ +Àܳ¤ò¥ê¥»¥Ã¥È¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +¤³¤ì¤òÍѤ¤¤ë¤È¡¢¥Ð¡¼¥¹¥È¤Ë¤è¤Ã¤Æ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬µ¯¤³¤Ã¤¿¤È¤­¤Ë¡¢ +Àܳ¤ò²óÉü¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Î¤Ï¡¢ +¼õ¿®¥Ç¡¼¥â¥ó¤ò¹â®²½¤Ç¤­¤Ê¤¤¾ì¹ç¤Ë¡Ö¸ÂÄꤹ¤ë¡×¤³¤È¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È¡¢¤½¤Î¥µ¡¼¥Ð¤ËÀܳ¤·¤Æ¤¤¤ë¥¯¥é¥¤¥¢¥ó¥È +¤Ë¤È¤Ã¤Æ¤Ï³²¤Ë¤Ê¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +.\"O .IR tcp_adv_win_scale " (integer; default: 2; since Linux 2.4)" +.IR tcp_adv_win_scale " (integer; default: 2; Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +.\"O Count buffering overhead as +.\"O .IR "bytes/2^tcp_adv_win_scale" , +.\"O if +.\"O .I tcp_adv_win_scale +.\"O is greater than 0; or +.\"O .IR "bytes-bytes/2^(\-tcp_adv_win_scale)" , +.\"O if +.\"O .I tcp_adv_win_scale +.\"O is less than or equal to zero. +¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤Î·×»»ÊýË¡¤ò¡¢ +.I tcp_adv_win_scale +¤¬Àµ¤Î¾ì¹ç¤Ï +.I "bytes/2^tcp_adv_win_scale" +¤Ë¡¢ +.I tcp_adv_win_scale +¤¬É餫 0 ¤Î¾ì¹ç¤Ï +.I "bytes-bytes/2^(\-tcp_adv_win_scale)" +¤È¤¹¤ë¡£ + +.\"O The socket receive buffer space is shared between the +.\"O application and kernel. +.\"O TCP maintains part of the buffer as +.\"O the TCP window, this is the size of the receive window +.\"O advertised to the other end. +.\"O The rest of the space is used +.\"O as the "application" buffer, used to isolate the network +.\"O from scheduling and application latencies. +.\"O The +.\"O .I tcp_adv_win_scale +.\"O default value of 2 implies that the space +.\"O used for the application buffer is one fourth that of the total. +¥½¥±¥Ã¥È¤Î¼õ¿®¥Ð¥Ã¥Õ¥¡¶õ´Ö¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È¥«¡¼¥Í¥ë¤Ç¶¦Í­¤µ¤ì¤ë¡£ +TCP ¤Ï¥Ð¥Ã¥Õ¥¡¤Î°ìÉô¤ò TCP ¥¦¥£¥ó¥É¥¦¤È¤·¤Æ´ÉÍý¤·¡¢ +¤³¤ì¤ò¼õ¿®¥¦¥£¥ó¥É¥¦¤È¤·¤ÆÀܳ¤Î¾ü¤ËÄÌÃΤ¹¤ë¡£ +¶õ´Ö¤Î»Ä¤ê¤Ï¡Ö¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¡×¥Ð¥Ã¥Õ¥¡¤È¤·¤ÆÍѤ¤¤é¤ì¡¢ +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ä¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÃٱ䤫¤é¥Í¥Ã¥È¥ï¡¼¥¯¤ò³ÖÎ¥¤¹¤ë¡£ +.I tcp_adv_win_scale +¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 2 ¤Ç¤¢¤ê¡¢ +¤³¤Î¾ì¹ç¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ð¥Ã¥Õ¥¡¤ÏÁ´ÂΤΠ1/4 ¤Ë¤Ê¤ë¡£ +.TP +.\"O .IR tcp_allowed_congestion_control " (String; default: see text; since Linux 2.4.20)" +.IR tcp_allowed_congestion_control " (String; default: see text; Linux 2.4.20 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +.\"O Show/set the congestion control algorithm choices available to unprivileged +.\"O processes (see the description of the +.\"O .B TCP_CONGESTION +.\"O socket option). +.\"O The list is a subset of those listed in +.\"O .IR tcp_available_congestion_control . +ÈóÆø¢¥×¥í¥»¥¹¤ÇÍøÍѤǤ­¤ëíÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤ÎÁªÂò»è¤òɽ¼¨/ÀßÄꤹ¤ë +.RB ( TCP_CONGESTION +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È)¡£ +¤³¤Î¥ê¥¹¥È¤Ï +.I tcp_available_congestion_control +¤Çɽ¼¨¤µ¤ì¤ë¥ê¥¹¥È¤ÎÉôʬ½¸¹ç¤È¤Ê¤ë¡£ +.\" FIXME How are the items in this delimited? Null bytes, spaces, commas? +.\"O The default value for this list is "reno" plus the default setting of +.\"O .IR tcp_congestion_control . +¤³¤Î¥ê¥¹¥È¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤϡ¢"reno" ¤È +.I tcp_congestion_control +¤Î¥Ç¥Õ¥©¥ë¥ÈÀßÄê¤ò¤¢¤ï¤»¤¿¤â¤Î¤È¤Ê¤ë¡£ +.TP +.\"O .IR tcp_available_congestion_control " (String; read-only; since Linux 2.4.20)" +.IR tcp_available_congestion_control " (String; read-only; Linux 2.4.20 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +.\"O Show a list of the congestion-control algorithms +.\"O that are registered. +ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëíÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤Î¥ê¥¹¥È¤òɽ¼¨¤¹¤ë¡£ +.\" FIXME How are the items in this delimited? Null bytes, spaces, commas? +.\"O This list is a limiting set for the list in +.\"O .IR tcp_allowed_congestion_control . +.\"O More congestion-control algorithms may be available as modules, +.\"O but not loaded. +¤³¤Î¥ê¥¹¥È¤ËºÜ¤Ã¤Æ¤¤¤ë¤â¤Î¤À¤±¤¬¡¢ +.I tcp_allowed_congestion_control +¤Ëɽ¼¨¤µ¤ì¤ë¡£ +¾¤ÎíÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤¬¥â¥¸¥å¡¼¥ë¤È¤·¤ÆÍøÍѲÄǽ¤À¤¬¡¢ +¥â¥¸¥å¡¼¥ë¤¬¥í¡¼¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤â¤¢¤ë¡£ +.TP +.\"O .IR tcp_app_win " (integer; default: 31; since Linux 2.4)" +.IR tcp_app_win " (integer; default: 31; Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +.\"O This variable defines how many +.\"O bytes of the TCP window are reserved for buffering overhead. +¤³¤ÎÊÑ¿ô¤Ï¡¢TCP ¥¦¥£¥ó¥É¥¦¤Î²¿¥Ð¥¤¥Èʬ¤ò +¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥ÉÍѤËͽÌ󤹤뤫¤ò»ØÄꤹ¤ë¡£ + +.\"O A maximum of (\fIwindow/2^tcp_app_win\fP, mss) bytes in the window +.\"O are reserved for the application buffer. +.\"O A value of 0 implies that no amount is reserved. +¤½¤Î¥¦¥£¥ó¥É¥¦¤Î \fIwindow/2^tcp_app_win\fP ¤È mss ¤ÎÂ礭¤¤¤Û¤¦ (¥Ð¥¤¥Èñ°Ì) +¤¬¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ð¥Ã¥Õ¥¡¤È¤·¤ÆͽÌ󤵤ì¤ë¡£ +0 ¤ò»ØÄꤹ¤ë¤È°ìÀÚͽÌóÎΰè¤ò¼è¤é¤Ê¤¤¡£ +.\" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +.TP +.\"O .IR tcp_base_mss " (Integer; default: 512; since Linux 2.6.17)" +.IR tcp_base_mss " (Integer; default: 512; Linux 2.6.17 °Ê¹ß)" +.\"O The initial value of +.\"O .I search_low +.\"O to be used by the packetization layer Path MTU discovery (MTU probing). +.\"O If MTU probing is enabled, +.\"O this is the initial MSS used by the connection. +¥Ñ¥±¥Ã¥È²½¥ì¥¤¥ä¤Î Path MTU discovery (MTU probing) ¤Ç¡¢ +.I search_low +¤Î½é´üÃͤȻÈÍѤµ¤ì¤ëÃÍ¡£ +MTU probing ¤¬Í­¸ú¤Ê¾ì¹ç¡¢¤³¤ÎÃͤϤ½¤ÎÀܳ¤Î MSS ¤Î½é´üÃͤȤʤ롣 +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.\"O .IR tcp_bic " (Boolean; default: disabled; Linux 2.4.27/2.6.6 to 2.6.13)" +.IR tcp_bic " (Boolean; default: disabled; Linux 2.4.27/2.6.6 ¤«¤é 2.6.13 ¤Þ¤Ç)" +.\"O Enable BIC TCP congestion control algorithm. +.\"O BIC-TCP is a sender-side only change that ensures a linear RTT +.\"O fairness under large windows while offering both scalability and +.\"O bounded TCP-friendliness. +.\"O The protocol combines two schemes +.\"O called additive increase and binary search increase. +.\"O When the congestion window is large, additive increase with a large +.\"O increment ensures linear RTT fairness as well as good scalability. +.\"O Under small congestion windows, binary search +.\"O increase provides TCP friendliness. +BIC TCP íÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤òÍ­¸ú¤Ë¤¹¤ë¡£ +BIC-TCP ¤ÏÁ÷¿®Â¦¤Î¤ß¤ÎÊѹ¹¤Ç¡¢ +¥¹¥±¡¼¥é¥Ó¥ê¥Æ¥£¤È TCP ¿ÆÏÂÀ­ (friendliness) ¤ÎξÊý¤òÄ󶡤·¤Ä¤Ä¡¢ +Â礭¤Ê¥¦¥£¥ó¥É¥¦¤Î²¼¤Ç¤ÎÀþ·Á¤Ê RTT ¸øÊ¿À­¤òÊݾڤ¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥×¥í¥È¥³¥ë¤Ç¤Ï additive increase (ÄɲÃŪ¤ÊÁý²Ã) ¤È +binary search increase (Æóʬõº÷Áý²Ã) ¤È¤¤¤ï¤ì¤ëÆó¤Ä¤Î»ÅÁȤߤò +ÁȤ߹ç¤ï¤»¤Æ¤¤¤ë¡£íÕíÔ¥¦¥£¥ó¥É¥¦¤¬Â礭¤¤¤È¤­¤Ï¡¢Áýʬ¤ÎÂ礭¤¤ +additive increase ¤Ë¤è¤ê¡¢¥¹¥±¡¼¥é¥Ó¥ê¥Æ¥£¤ò³ÎÊݤ·¤Ê¤¬¤é +Àþ·Á¤Ê RTT ¸øÊ¿À­¤òÊݾڤ¹¤ë¡£ +íÕíÔ¥¦¥£¥ó¥É¥¦¤¬¾®¤µ¤¤¤È¤­¤Ë¤Ï binary search increase ¤Ë¤è¤ê +TCP ¿ÆÏÂÀ­¤òãÀ®¤·¤Æ¤¤¤ë¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.\"O .IR tcp_bic_low_window " (integer; default: 14; Linux 2.4.27/2.6.6 to 2.6.13)" +.IR tcp_bic_low_window " (integer; default: 14; Linux 2.4.27/2.6.6 °Ê¹ß 2.6.13 ¤Þ¤Ç)" +.\"O Set the threshold window (in packets) where BIC TCP starts to +.\"O adjust the congestion window. +.\"O Below this threshold BIC TCP behaves the same as the default TCP Reno. +BIC TCP ¤¬íÕíÔ¥¦¥£¥ó¥É¥¦¤ÎÄ´À°¤ò³«»Ï¤¹¤ëïçÃÍ¥¦¥£¥ó¥É¥¦ (¥Ñ¥±¥Ã¥Èñ°Ì) +¤òÀßÄꤹ¤ë¡£¤³¤ÎïçÃͤò²¼²ó¤ë¾ì¹ç¡¢BIC TCP ¤Ï¥Ç¥Õ¥©¥ë¥È¤Î TCP Reno ¤È +Ʊ¤¸Æ°ºî¤ò¤¹¤ë¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.\"O .IR tcp_bic_fast_convergence " (Boolean; default: enabled; Linux 2.4.27/2.6.6 to 2.6.13)" +.IR tcp_bic_fast_convergence " (Boolean; default: enabled; Linux 2.4.27/2.6.6 °Ê¹ß 2.6.13 ¤Þ¤Ç)" +.\"O Force BIC TCP to more quickly respond to changes in congestion window. +.\"O Allows two flows sharing the same connection to converge more rapidly. +BIC TCP ¤¬íÕíÔ¥¦¥£¥ó¥É¥¦¤ÎÊѲ½¤Ë¤è¤ê®¤¯È¿±þ¤¹¤ë¤è¤¦¤Ë¤¹¤ë¡£ +Ʊ¤¸¥³¥Í¥¯¥·¥ç¥ó¤ò¶¦Í­¤¹¤ëÆó¤Ä¤Î¥Õ¥í¡¼¤¬°ì¤Ä¤Ë¤Þ¤È¤Þ¤ë¤Î¤ò +¤è¤ê®¤¯¹Ô¤¦¤è¤¦¤Ë¤¹¤ë¡£ +.TP +.\"O .IR tcp_congestion_control " (String; default: see text; since Linux 2.4.13)" +.IR tcp_congestion_control " (String; default: ÀâÌÀ»²¾È; Linux 2.4.13 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +.\"O Set the default congestion-control algorithm to be used for new connections. +.\"O The algorithm "reno" is always available, +.\"O but additional choices may be available depending on kernel configuration. +.\"O The default value for this file is set as part of kernel configuration. +¿·µ¬¤ÎÀܳ¤Ç»ÈÍѤµ¤ì¤ë¥Ç¥Õ¥©¥ë¥È¤ÎíÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤òÀßÄꤹ¤ë¡£ +"reno" ¥¢¥ë¥´¥ê¥º¥à¤Ï¾ï¤ËÍøÍѲÄǽ¤À¤¬¡¢ +¥«¡¼¥Í¥ëÀßÄ꼡Âè¤Ç¤ÏÊ̤ÎÁªÂò»è¤¬ÍøÍѤǤ­¤ë¤³¤È¤â¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤϥ«¡¼¥Í¥ëÀßÄê¤Î°ì¤Ä¤È¤·¤ÆÀßÄꤵ¤ì¤ë¡£ +.TP +.\"O .IR tcp_dma_copybreak " (integer; default: 4096; since Linux 2.6.24)" +.IR tcp_dma_copybreak " (integer; default: 4096; Linux 2.6.24 °Ê¹ß)" +.\"O Lower limit, in bytes, of the size of socket reads that will be +.\"O offloaded to a DMA copy engine, if one is present in the system +.\"O and the kernel was configured with the +.\"O .B CONFIG_NET_DMA +.\"O option. +¥·¥¹¥Æ¥à¤Ë DMA ¥³¥Ô¡¼¥¨¥ó¥¸¥ó¤¬Â¸ºß¤·¡¢¥«¡¼¥Í¥ë¤Ç +.B CONFIG_NET_DMA +¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +DMA ¥³¥Ô¡¼¥¨¥ó¥¸¥ó¤Ë¥ª¥Õ¥í¡¼¥É¤µ¤ì¤ë¥½¥±¥Ã¥È¤ÎÆɤ߹þ¤ß¥µ¥¤¥º¤Î²¼¸ÂÃÍ +(¥Ð¥¤¥Èñ°Ì)¡£ +.TP +.\"O .IR tcp_dsack " (Boolean; default: enabled; since Linux 2.4)" +.IR tcp_dsack " (Boolean; default: enabled; Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +.\"O Enable RFC\ 2883 TCP Duplicate SACK support. +RFC\ 2883 ¤Î TCP Duplicate SACK ¤Î¥µ¥Ý¡¼¥È¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.\"O .IR tcp_ecn " (Boolean; default: disabled; since Linux 2.4)" +.IR tcp_ecn " (Boolean; default: disabled; Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +.\"O Enable RFC\ 2884 Explicit Congestion Notification. +.\"O When enabled, connectivity to some +.\"O destinations could be affected due to older, misbehaving +.\"O routers along the path causing connections to be dropped. +RFC\ 2884 ¤Î Explicit Congestion Notification ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤ì¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢´Ö°ã¤Ã¤¿¿¶Éñ¤¤¤ò¤¹¤ë¸Å¤¤¥ë¡¼¥¿¤¬ +·ÐÏ©¤ÎÅÓÃæ¤Ë¤¢¤ë¤è¤¦¤ÊÀܳÀè¤ËÂФ·¤Æ±Æ¶Á¤¬À¸¤¸¡¢ +¾ì¹ç¤Ë¤è¤Ã¤Æ¤ÏÀܳ¤¬Íî¤Á¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.\"O .IR tcp_fack " (Boolean; default: enabled; since Linux 2.2)" +.IR tcp_fack " (Boolean; default: enabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.92 +.\"O Enable TCP Forward Acknowledgement support. +TCP Forward Acknowledgement ¤Î¥µ¥Ý¡¼¥È¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.\"O .IR tcp_fin_timeout " (integer; default: 60; since Linux 2.2)" +.IR tcp_fin_timeout " (integer; default: 60; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.53 +.\"O This specifies how many seconds to wait for a final FIN packet before the +.\"O socket is forcibly closed. +.\"O This is strictly a violation of the TCP specification, +.\"O but required to prevent denial-of-service attacks. +.\"O In Linux 2.2, the default value was 180. +¥½¥±¥Ã¥È¤ò¶¯À©Åª¤Ë¥¯¥í¡¼¥º¤¹¤ëÁ°¤Ë¡¢ +ºÇ¸å¤Î FIN ¥Ñ¥±¥Ã¥È¤òÂԤĻþ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ +¤³¤ì¤Ï¸·Ì©¤Ë¤Ï TCP ¤Î»ÅÍͤòËþ¤¿¤·¤Æ¤¤¤Ê¤¤¤¬¡¢ +DoS ¹¶·â (denial of service attack) ¤«¤é¿È¤ò¼é¤ë¤¿¤á¤ËɬÍפǤ¢¤ë¡£ +Linux 2.2 ¤Ç¤Ï¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 180 ¤Ç¤¢¤Ã¤¿¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.\"O .IR tcp_frto " (integer; default: 0; since Linux 2.4.21/2.6)" +.IR tcp_frto " (integer; default: 0; Linux 2.4.21/2.6 °Ê¹ß)" +.\" Since 2.4.21/2.5.43 +.\"O Enable F-RTO, an enhanced recovery algorithm for TCP retransmission +.\"O timeouts (RTOs). +.\"O It is particularly beneficial in wireless environments +.\"O where packet loss is typically due to random radio interference +.\"O rather than intermediate router congestion. +.\"O See RFC 4138 for more details. +F-RTO ¤òÍ­¸ú¤Ë¤¹¤ë¡£F-RTO ¤Ï TCP ºÆÁ÷¥¿¥¤¥à¥¢¥¦¥È (RTO) ¤«¤é¤Î +ÉüµìÀ­Ç½¤ò¸þ¾å¤µ¤»¤¿¥¢¥ë¥´¥ê¥º¥à¤Ç¤¢¤ë¡£ +¤³¤Îµ¡Ç½¤Ï̵Àþ´Ä¶­¤ÇÆä˸ú²Ì¤òȯ´ø¤¹¤ë¡£ +̵Àþ´Ä¶­¤Ç¤Ï¡¢Ä̾ï¤Ï¡¢Ãæ´Ö¥ë¡¼¥¿¤ÎíÕíԤǤϤʤ¯¥é¥ó¥À¥à¤Ê̵Àþ¤Î´³¾Ä +¤Ë¤è¤ê¥Ñ¥±¥Ã¥È¥í¥¹¤¬È¯À¸¤¹¤ë¡£ +¾ÜºÙ¤Ï RFC\ 4138 ¤ò»²¾È¡£ + +.\"O This file can have one of the following values: +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤ÎÃͤò¼è¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.RS +.IP 0 3 +.\"O Disabled. +F-RTO ¤ò̵¸ú¤Ë¤¹¤ë¡£ +.IP 1 +.\"O The basic version F-RTO algorithm is enabled. +´ðËÜÈǤΠF-RTO ¥¢¥ë¥´¥ê¥º¥à¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.IP 2 +.\"O Enable SACK-enhanced F-RTO if flow uses SACK. +.\"O The basic version can be used also when +.\"O SACK is in use though in that case scenario(s) exists where F-RTO +.\"O interacts badly with the packet counting of the SACK-enabled TCP flow. +¤½¤Î¥Õ¥í¡¼¤Ç SACK ¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢SACK ³ÈÄ¥ÈǤΠF-RTO ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +´ðËÜÈǤΠF-RTO ¤â SACK ¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤â»ÈÍѤǤ­¤ë¤¬¡¢ +´ðËÜÈǤξì¹ç¤Ë¤Ï F-RTO ¤¬ SACK ¤¬Í­¸ú¤Ë¤Ê¤Ã¤¿ TCP ¥Õ¥í¡¼¤Ç¤Î +¥Ñ¥±¥Ã¥È¿ô·×¬¤È¡¢ÁêÀ­¤¬°­¤¯Áê¸ß´³¾Ä¤¬µ¯¤³¤ë¾ìÌ̤¬Â¸ºß¤¹¤ë¡£ +.RE +.IP +.\"O Before Linux 2.6.22, this parameter was a Boolean value, +.\"O supporting just values 0 and 1 above. +Linu 2.6.22 ¤è¤êÁ°¤Ç¤Ï¡¢¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¥Ö¡¼¥ëÃͤǤ¢¤ê¡¢ +¾åµ­¤Î 0 ¤È 1 ¤Î¤ß¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤¿¡£ +.TP +.\"O .IR tcp_frto_response " (integer; default: 0; since Linux 2.6.22)" +.IR tcp_frto_response " (integer; default: 0; Linux 2.6.22 °Ê¹ß)" +.\"O When F-RTO has detected that a TCP retransmission timeout was spurious +.\"O (i.e, the timeout would have been avoided had TCP set a +.\"O longer retransmission timeout), +.\"O TCP has several options concerning what to do next. +.\"O Possible values are: +F-RTO ¤¬ TCP ºÆÁ÷¥¿¥¤¥à¥¢¥¦¥È¤¬µ¶Êª¤À¤È¸¡½Ð¤·¤¿¾ì¹ç +(¤Ä¤Þ¤ê¡¢TCP ¤¬¤â¤Ã¤ÈŤ¤ºÆÁ÷¥¿¥¤¥à¥¢¥¦¥È¤òÀßÄꤷ¤Æ¤¤¤ì¤Ð +¥¿¥¤¥à¥¢¥¦¥È¤¬Èò¤±¤é¤ì¤¿¾ì¹ç)¡¢ +¼¡¤Ë¤É¤¦¤¹¤ë¤«¤Ë´Ø¤·¤ÆÁªÂò»è¤¬¤¤¤¯¤Ä¤«¤¢¤ë¡£ +°Ê²¼¤ÎÃͤòÁªÂò¤Ç¤­¤ë¡£ +.RS +.IP 0 3 +.\"O Rate halving based; a smooth and conservative response, +.\"O results in halved congestion window +.\"O .RI ( cwnd ) +.\"O and slow-start threshold +.\"O .RI ( ssthresh ) +.\"O after one RTT. +¥ì¡¼¥È¤ò¸µ¤ÎȾʬ¤Ë¤¹¤ë¡£ +³ê¤é¤«¤Ç¡¢ÊݼéŪ¤ÊÈ¿±þ¤ò¹Ô¤¤¡¢RTT 1²óʬ¤Î»þ´Ö¸å¤Ë +íÕíÔ¥¦¥£¥ó¥É¥¦ +.RI ( cwnd ) +¤È¥¹¥í¡¼¥¹¥¿¡¼¥È¤ÎïçÃÍ +.RI ( ssthresh ) +¤¬È¾Ê¬¤Ë¤Ê¤ë¡£ +.IP 1 +.\"O Very conservative response; not recommended because even +.\"O though being valid, it interacts poorly with the rest of Linux TCP; halves +.\"O .I cwnd +.\"O and +.\"O .I ssthresh +.\"O immediately. +Èó¾ï¤ËÊݼéŪ¤ÊÈ¿±þ¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Î»ÈÍѤϿ侩¤µ¤ì¤Ê¤¤¡£ +È¿±þ¤¬Àµ¤·¤«¤Ã¤¿¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢Linux TCP ¤Î¾¤ÎÉôʬ¤È +¤¦¤Þ¤¯Ï¢·È¤Ç¤­¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.I cwnd +¤È +.I ssthresh +¤Ïľ¤Á¤ËȾʬ¤Ë¤µ¤ì¤ë¡£ +.IP 2 +.\"O Aggressive response; undoes congestion-control measures +.\"O that are now known to be unnecessary +.\"O (ignoring the possibility of a lost retransmission that would require +.\"O TCP to be more cautious); +.\"O .I cwnd +.\"O and +.\"O .I ssthresh +.\"O are restored to the values prior to timeout. +.\"O motoki: ³ç¸ÌÆâ (ignoring ¡Á) ¤ÎÉôʬ¤Î°ÕÌ£¤òº£°ì¤ÄÍý²ò¤Ç¤­¤Æ¤¤¤Þ¤»¤ó¡£ +ÀѶËŪ¤ÊÈ¿±þ¡£ +ÉÔÍפÈȽÌÀ¤·¤¿íÕíÔÀ©¸æ¤Î¬Äê¾ðÊó¤ò¼è¤ê¾Ã¤¹ +(TCP ¤¬¤â¤Ã¤ÈÃí°Õ¿¼¤¯°·¤¦¤Ù¤­ºÆÁ÷¤¬¼º¤ï¤ì¤ë²ÄǽÀ­¤ò̵»ë¤¹¤ë)¡£ +¡£ +.I cwnd +¤È +.I ssthresh +¤Ï¥¿¥¤¥à¥¢¥¦¥ÈÁ°¤ÎÃͤËÌᤵ¤ì¤ë¡£ +.RE +.TP +.\"O .IR tcp_keepalive_intvl " (integer; default: 75; since Linux 2.4)" +.IR tcp_keepalive_intvl " (integer; default: 75; Linux 2.4 °Ê¹ß)" +.\" Since 2.3.18 +.\"O The number of seconds between TCP keep-alive probes. +TCP keep-alive ¤Î¥×¥í¡¼¥Ö¤òÁ÷¤ë´Ö³Ö (ÉÃñ°Ì)¡£ +.TP +.\"O .IR tcp_keepalive_probes " (integer; default: 9; since Linux 2.2)" +.IR tcp_keepalive_probes " (integer; default: 9; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.43 +.\"O The maximum number of TCP keep-alive probes to send +.\"O before giving up and killing the connection if +.\"O no response is obtained from the other end. +TCP keep-alive ¥×¥í¡¼¥Ö¤ÎºÇÂç²ó¿ô¡£ +¤³¤Î²ó¿ô¤À¤±»î¤·¤Æ¤âÀܳÀ褫¤éÈ¿±þ¤¬ÆÀ¤é¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢ +¤¢¤­¤é¤á¤ÆÀܳ¤òÀÚÃǤ¹¤ë¡£ +.TP +.\"O .IR tcp_keepalive_time " (integer; default: 7200; since Linux 2.2)" +.IR tcp_keepalive_time " (integer; default: 7200; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.43 +.\"O The number of seconds a connection needs to be idle +.\"O before TCP begins sending out keep-alive probes. +.\"O Keep-alives are only sent when the +.\"O .B SO_KEEPALIVE +.\"O socket option is enabled. +.\"O The default value is 7200 seconds (2 hours). +.\"O An idle connection is terminated after +.\"O approximately an additional 11 minutes (9 probes an interval +.\"O of 75 seconds apart) when keep-alive is enabled. +Àܳ¤¬¥¢¥¤¥É¥ë¾õÂ֤ˤʤäƤ«¤é¡¢keep-alive +¥×¥í¡¼¥Ö¤òÁ÷¿®¤¹¤ë¤Þ¤Ç¤Î»þ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.B SO_KEEPALIVE +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¤È +keep-alive ¤ÏÁ÷¤é¤ì¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 7200 Éà (2 »þ´Ö)¡£ +keep-alive ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¤µ¤é¤Ë¤ª¤è¤½ 11 ʬ (75 Éôֳ֤Π9 ¥×¥í¡¼¥Öʬ) +·Ð²á¤¹¤ë¤È¥¢¥¤¥É¥ë¾õÂÖ¤ÎÀܳ¤Ï½ªÎ»¤µ¤»¤é¤ì¤ë¡£ + +.\"O Note that underlying connection tracking mechanisms and +.\"O application timeouts may be much shorter. +²¼Áؤˤ¢¤ëÀܳÄÉÀ×µ¡¹½¤ä¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Î¥¿¥¤¥à¥¢¥¦¥È¤Ï¡¢ +¤â¤Ã¤È¤º¤Ã¤Èû¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.\"O .IR tcp_low_latency " (Boolean; default: disabled; since Linux 2.4.21/2.6)" +.IR tcp_low_latency " (Boolean; default: disabled; Linux 2.4.21/2.6 °Ê¹ß)" +.\" Since 2.4.21/2.5.60 +.\"O If enabled, the TCP stack makes decisions that prefer lower +.\"O latency as opposed to higher throughput. +.\"O It this option is disabled, then higher throughput is preferred. +.\"O An example of an application where this default should be +.\"O changed would be a Beowulf compute cluster. +Í­¸ú¤Ë¤¹¤ë¤È¡¢TCP ¥¹¥¿¥Ã¥¯¤Ï¥¹¥ë¡¼¥×¥Ã¥È¤ò¹â¤¯¤¹¤ë¤è¤ê¤â +ÃÙ±ä¤ò¾¯¤Ê¤¯¤¹¤ë¤³¤È¤òÍ¥À褷¤ÆȽÃǤò¹Ô¤¦¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò̵¸ú¤Ë¤¹¤ë¤È¡¢¥¹¥ë¡¼¥×¥Ã¥È¤ò¹â¤¯¤¹¤ë¤³¤È¤¬Í¥À褵¤ì¤ë¡£ +¤³¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤòÊѹ¹¤·¤¿Êý¤¬¤è¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÎã¤È¤·¤Æ¤Ï +Beowulf ¥³¥ó¥Ô¥å¡¼¥¿¥¯¥é¥¹¥¿¤¬µó¤²¤é¤ì¤ë¤À¤í¤¦¡£ +.TP +.\"O .IR tcp_max_orphans " (integer; default: see below; since Linux 2.4)" +.IR tcp_max_orphans " (integer; default: see below; Linux 2.4 °Ê¹ß)" +.\" Since 2.3.41 +.\"O The maximum number of orphaned (not attached to any user file +.\"O handle) TCP sockets allowed in the system. +.\"O When this number is exceeded, +.\"O the orphaned connection is reset and a warning is printed. +.\"O This limit exists only to prevent simple denial-of-service attacks. +.\"O Lowering this limit is not recommended. +.\"O Network conditions might require you to increase the number of +.\"O orphans allowed, but note that each orphan can eat up to ~64K +.\"O of unswappable memory. +.\"O The default initial value is set equal to the kernel parameter NR_FILE. +.\"O This initial default is adjusted depending on the memory in the system. +¥·¥¹¥Æ¥à¤¬µöÍƤ¹¤ë¡¢ +orphan ¤Ê (¤É¤Î¥æ¡¼¥¶¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤Ë¤â¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤Ê¤¤) +TCP ¥½¥±¥Ã¥È¤ÎºÇÂç¿ô¡£ +¤³¤Î¿ô¤ò±Û¤¨¤ë¤È¡¢orphan ¤ÊÀܳ¤Ï¥ê¥»¥Ã¥È¤µ¤ì¡¢·Ù¹ð¤¬É½¼¨¤µ¤ì¤ë¡£ +¤³¤ÎÀ©¸Â¤¬Â¸ºß¤¹¤ë¤Î¤Ï¡¢Ã±½ã¤Ê»ÈÍÑÉÔǽ (denial-of-service) ¹¶·â¤ò +Ëɤ°¤¿¤á¤Ë²á¤®¤Ê¤¤¡£¤³¤ÎÃͤò¾®¤µ¤¯¤¹¤ë¤³¤È¤Ï¿ä¾©¤·¤Ê¤¤¡£ +¥Í¥Ã¥È¥ï¡¼¥¯¤Î¾ò·ï¤Ë¤è¤Ã¤Æ¤Ï¡¢¤³¤Î¿ôÃͤòÂ礭¤¯¤·¤Ê¤¤¤È¤¤¤±¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¤¬¡¢ +orphan ¤Ê¥½¥±¥Ã¥È¤Ò¤È¤Ä¤¢¤¿¤ê +64K ÄøÅ٤Υ¹¥ï¥Ã¥×ÉÔ²Äǽ¤Ê¥á¥â¥ê¤ò¾ÃÈñ¤¹¤ë¤³¤È¤âÃí°Õ¤»¤è¡£ +¥Ç¥Õ¥©¥ë¥È¤Î½é´üÃͤϥ«¡¼¥Í¥ë¥Ñ¥é¥á¡¼¥¿¤Î NR_FILE ¤ÈÅù¤·¤¤¡£ +¤³¤Î½é´ü¥Ç¥Õ¥©¥ë¥ÈÃͤϥ·¥¹¥Æ¥à¤Î¥á¥â¥ê¤Ë±þ¤¸¤ÆÄ´À°¤µ¤ì¤ë¡£ +.TP +.\"O .IR tcp_max_syn_backlog " (integer; default: see below; since Linux 2.2)" +.IR tcp_max_syn_backlog " (integer; default: ²¼µ­»²¾È; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.53 +.\"O The maximum number of queued connection requests which have +.\"O still not received an acknowledgement from the connecting client. +.\"O If this number is exceeded, the kernel will begin +.\"O dropping requests. +.\"O The default value of 256 is increased to +.\"O 1024 when the memory present in the system is adequate or +.\"O greater (>= 128Mb), and reduced to 128 for those systems with +.\"O very low memory (<= 32Mb). +.\"O It is recommended that if this +.\"O needs to be increased above 1024, TCP_SYNQ_HSIZE in +.\"O .I include/net/tcp.h +.\"O be modified to keep +.\"O TCP_SYNQ_HSIZE*16<=tcp_max_syn_backlog, and the kernel be +.\"O recompiled. +Àܳ¤·¤Æ¤­¤Æ¤¤¤ë¥¯¥é¥¤¥¢¥ó¥È¤«¤é +ack ¤ò¼õ¿®¤·¤Æ¤¤¤Ê¤¤¾õÂÖ¤ÎÀܳ¥ê¥¯¥¨¥¹¥È¤ò¥­¥å¡¼¤ËÃÖ¤±¤ëºÇÂç¿ô¡£ +¤³¤Î¿ôÃͤò±Û¤¨¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï¥ê¥¯¥¨¥¹¥È¤ò¼Î¤Æ»Ï¤á¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï 256 ¤Ç¡¢ +¥·¥¹¥Æ¥à¤Ë½¼Ê¬¤Ê¥á¥â¥ê¤¬¤¢¤ë (128Mb °Ê¾å) ¾ì¹ç¤Ï 1024 ¤Ë¤Ê¤ê¡¢ +¥á¥â¥ê¤¬Èó¾ï¤Ë¾¯¤Ê¤¤¾ì¹ç (32 Mb °Ê²¼) ¤Ï 128 ¤Ë¤Ê¤ë¡£ +¤³¤Î¿ôÃͤò 1024 °Ê¾å¤ËÁý¤ä¤·¤¿¤¤¾ì¹ç¤Ï¡¢ +.I include/net/tcp.h +¤Î TCP_SYNQ_HSIZE ¤ò +TCP_SYNQ_HSIZE*16<=tcp_max_syn_backlog ¤Î¤è¤¦¤Ë½¤Àµ¤·¡¢ +¥«¡¼¥Í¥ë¤òºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤³¤È¤ò¾©¤á¤ë¡£ +.TP +.\"O .IR tcp_max_tw_buckets " (integer; default: see below; since Linux 2.4)" +.IR tcp_max_tw_buckets " (integer; default: ²¼µ­»²¾È; Linux 2.4 °Ê¹ß)" +.\" Since 2.3.41 +.\"O The maximum number of sockets in TIME_WAIT state allowed in +.\"O the system. +.\"O This limit exists only to prevent simple denial-of-service attacks. +.\"O The default value of NR_FILE*2 is adjusted +.\"O depending on the memory in the system. +.\"O If this number is +.\"O exceeded, the socket is closed and a warning is printed. +¥·¥¹¥Æ¥à¤¬µöÍƤ¹¤ë TIME_WAIT ¾õÂ֤ˤ¢¤ë¥½¥±¥Ã¥È¤ÎºÇÂç¿ô¡£ +¤³¤ÎÀ©¸Â¤¬Â¸ºß¤¹¤ë¤Î¤Ï¡¢ +ñ½ã¤Ê»ÈÍÑÉÔǽ (denial-of-service) ¹¶·â¤òËɤ°¤¿¤á¤Ë²á¤®¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï NR_FILE*2 ¤Ç¡¢¥·¥¹¥Æ¥à¤Î¥á¥â¥ê¤Ë±þ¤¸¤ÆÄ´À°¤µ¤ì¤ë¡£ +¤³¤Î¿ôÃͤò±Û¤¨¤ë¤È¡¢¤½¤Î¤è¤¦¤Ê¥½¥±¥Ã¥È¤Ï¥¯¥í¡¼¥º¤µ¤ì¡¢·Ù¹ð¤¬É½¼¨¤µ¤ì¤ë¡£ +.TP +.\"O .IR tcp_moderate_rcvbuf " (Boolean; default: enabled; since Linux 2.4.17/2.6.7)" +.IR tcp_moderate_rcvbuf " (Boolean; default: enabled; Linux 2.4.17/2.6.7 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +.\"O If enabled, TCP performs receive buffer auto-tuning, +.\"O attempting to automatically size the buffer (no greater than +.\"O .IR tcp_rmem[2] ) +.\"O to match the size required by the path for full throughput. +Í­¸ú¤Ë¤¹¤ë¤È¡¢TCP ¤Ï¼õ¿®¥Ð¥Ã¥Õ¥¡¤Î¼«Æ°Ä´À°¤ò¹Ô¤¦¡£ +¶ñÂÎŪ¤Ë¤Ï¡¢ +.RI ( tcp_rmem[2] +¤òĶ¤¨¤Ê¤¤ÈϰϤÇ) ¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤ò¼«Æ°Åª¤ËÊѲ½¤µ¤»¡¢ +¤½¤Î·ÐÏ©¤ÇºÇÂç¤Î¥¹¥ë¡¼¥×¥Ã¥È¤òãÀ®¤¹¤ë¤Î¤ËɬÍפÊÂ礭¤µ¤Ë¹ç¤ï¤»¤è¤¦¤È¤¹¤ë¡£ +.TP +.\"O .IR tcp_mem " (since Linux 2.4)" +.IR tcp_mem " (Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +.\"O This is a vector of 3 integers: [low, pressure, high]. +.\"O These bounds, measured in units of the system page size, +.\"O are used by TCP to track its memory usage. +.\"O The defaults are calculated at boot time from the amount of +.\"O available memory. +.\"O (TCP can only use +.\"O .I "low memory" +.\"O for this, which is limited to around 900 megabytes on 32-bit systems. +.\"O 64-bit systems do not suffer this limitation.) +¤³¤ì¤Ï 3 ¤Ä¤ÎÀ°¿ô [low, pressure, high] ¤«¤é¤Ê¤ë¥Ù¥¯¥È¥ëÃͤǤ¢¤ë¡£ +¤³¤ì¤é¤Ï TCP ¤¬¥á¥â¥ê»ÈÍÑÎ̤òÄÉÀפ¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë +(»ÈÍÑÎ̤ϥ·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥ºÃ±°Ì¤Ç·×¬¤µ¤ì¤ë)¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï¥Ö¡¼¥È»þ¤ËÍøÍѤǤ­¤ë¥á¥â¥ê¤ÎÎ̤«¤é·×»»¤µ¤ì¤ë¡£ +(¼ÂºÝ¤Ë¤Ï¡¢TCP ¤Ï +.I "low memory" +¤Î¤ß¤ò»ÈÍѤ¹¤ë¡£ÃÍ¤Ï 32¥Ó¥Ã¥È¥·¥¹¥Æ¥à¤Ç¤ÏÌó 900 ¥á¥¬¥Ð¥¤¥È¤ËÀ©¸Â¤µ¤ì¤ë¡£ +64 ¥Ó¥Ã¥È¥·¥¹¥Æ¥à¤Ç¤Ï¤³¤ÎÀ©¸Â¤Ï¤Ê¤¤¡£) +.RS +.TP 10 +.I low +.\"O TCP doesn't regulate its memory allocation when the number +.\"O of pages it has allocated globally is below this number. +TCP ¤Ï¡¢¥°¥í¡¼¥Ð¥ë¤Ë¥¢¥í¥±¡¼¥È¤·¤¿¥Ú¡¼¥¸¤¬¤³¤Î¿ôÃͰʲ¼¤Î¾ì¹ç¤Ï¡¢ +¥á¥â¥ê¥¢¥í¥±¡¼¥·¥ç¥ó¤òÄ´À°¤·¤Ê¤¤¡£ +.TP +.I pressure +.\"O When the amount of memory allocated by TCP +.\"O exceeds this number of pages, TCP moderates its memory consumption. +.\"O This memory pressure state is exited +.\"O once the number of pages allocated falls below +.\"O the +.\"O .I low +.\"O mark. +TCP ¤¬¥¢¥í¥±¡¼¥È¤·¤¿¥á¥â¥ê¤¬¤³¤Î¿ôÃÍʬ¤Î¥Ú¡¼¥¸¿ô¤ò±Û¤¨¤ë¤È¡¢ +TCP ¤Ï¥á¥â¥ê¾ÃÈñ¤òÍÞ¤¨¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¥¢¥í¥±¡¼¥È¤·¤¿¥Ú¡¼¥¸¿ô¤¬ +.I low +°Ê²¼¤Ë¤Ê¤ë¤È¡¢¤³¤Î¥á¥â¥ê°µÇ÷¾õÂÖ¤«¤é椹¤ë¡£ +.TP +.I high +.\"O The maximum number of pages, globally, that TCP will allocate. +.\"O This value overrides any other limits imposed by the kernel. +TCP ¤¬¥°¥í¡¼¥Ð¥ë¤Ë³ä¤êÅö¤Æ¤ë¥Ú¡¼¥¸¿ô¤ÎºÇÂçÃÍ¡£ +¤³¤ÎÃͤϥ«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ²Ý¤µ¤ì¤ë¤¢¤é¤æ¤ëÀ©¸Â¤è¤ê¤âÍ¥À褵¤ì¤ë¡£ +.RE +.TP +.\"O .IR tcp_mtu_probing " (integer; default: 0; since Linux 2.6.17)" +.IR tcp_mtu_probing " (integer; default: 0; Linux 2.6.17 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +.\"O This parameter controls TCP Packetization-Layer Path MTU Discovery. +.\"O The following values may be assigned to the file: +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢TCP ¤Î¥Ñ¥±¥Ã¥È²½¥ì¥¤¥ä¤Î Path MTU discovery ¤òÀ©¸æ¤¹¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï°Ê²¼¤ÎÃͤòÀßÄê¤Ç¤­¤ë¡£ +.RS +.IP 0 3 +.\"O Disabled +̵¸ú¤Ë¤¹¤ë¡£ +.IP 1 +.\"O Disabled by default, enabled when an ICMP black hole detected +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï̵¸ú¤À¤¬¡¢ICMP ¥Ö¥é¥Ã¥¯¥Û¡¼¥ë¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤ÏÍ­¸ú¤Ë¤¹¤ë¡£ +.IP 2 +.\"O Always enabled, use initial MSS of +.\"O .IR tcp_base_mss . +¾ï¤ËÍ­¸ú¤Ë¤¹¤ë¡£ +MSS ¤Î½é´üÃͤȤ·¤Æ +.I tcp_base_mss +¤¬»ÈÍѤµ¤ì¤ë¡£ +.RE +.TP +.\"O .IR tcp_no_metrics_save " (Boolean; default: disabled; since Linux 2.6.6)" +.IR tcp_no_metrics_save " (Boolean; default: disabled; Linux 2.6.6 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +.\"O By default, TCP saves various connection metrics in the route cache +.\"O when the connection closes, so that connections established in the +.\"O near future can use these to set initial conditions. +.\"O Usually, this increases overall performance, +.\"O but it may sometimes cause performance degradation. +.\"O If +.\"O .I tcp_no_metrics_save +.\"O is enabled, TCP will not cache metrics on closing connections. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢TCP ¤ÏÀܳ¥¯¥í¡¼¥º»þ¤Ë³Æ¼ï¤ÎÀܳ¥Ñ¥é¥á¡¼¥¿¤ò +¥ë¡¼¥È¥­¥ã¥Ã¥·¥å (route cache) ¤ËÊݸ¤·¡¢¶á¤¤¾­Íè¤ËÀܳ¤¬³ÎΩ¤µ¤ì¤¿ºÝ¤Ë +¤³¤ì¤é¤Î¾ðÊó¤ò½é´ü¾õÂ֤Ȥ·¤Æ»ÈÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +Ä̾ï¤Ï¡¢¤³¤ì¤Ë¤è¤êÁ´ÂΤȤ·¤ÆÀ­Ç½¤¬¸þ¾å¤¹¤ë¤¬¡¢ +»þ¤È¤·¤ÆÀ­Ç½¤ÎÎô²½¤ò°ú¤­µ¯¤³¤¹¤³¤È¤â¤¢¤ë¡£ +.I tcp_no_metrics_save +¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢TCP ¤ÏÀܳ¥¯¥í¡¼¥º»þ¤ËÀܳ¥Ñ¥é¥á¡¼¥¿¤ò¥­¥ã¥Ã¥·¥å +¤·¤Ê¤¯¤Ê¤ë¡£ +.TP +.\"O .IR tcp_orphan_retries " (integer; default: 8; since Linux 2.4)" +.IR tcp_orphan_retries " (integer; default: 8; Linux 2.4 °Ê¹ß)" +.\" Since 2.3.41 +.\"O The maximum number of attempts made to probe the other +.\"O end of a connection which has been closed by our end. +¤³¤Á¤é¤«¤é¥¯¥í¡¼¥º¤·¤¿Àܳ¤Ë¤Ä¤¤¤Æ¡¢ +ÀèÊý¤ò¥×¥í¡¼¥Ö¤¹¤ëºÇÂç»î¹Ô¿ô¡£ +.TP +.\"O .IR tcp_reordering " (integer; default: 3; since Linux 2.4)" +.IR tcp_reordering " (integer; default: 3; Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +.\"O The maximum a packet can be reordered in a TCP packet stream +.\"O without TCP assuming packet loss and going into slow start. +.\"O It is not advisable to change this number. +.\"O This is a packet reordering detection metric designed to +.\"O minimize unnecessary back off and retransmits provoked by +.\"O reordering of packets on a connection. +TCP ¥Ñ¥±¥Ã¥È¥¹¥È¥ê¡¼¥à¤Ç¥Ñ¥±¥Ã¥È½ç½ø¤ÎµÕž¤¬È¯À¸¤·¤¿¤À¤±¤Ç¤¢¤ê¡¢ +¥Ñ¥±¥Ã¥È¥í¥¹¤¬µ¯¤³¤Ã¤¿¤È¤Ï¤ß¤Ê¤µ¤Ê¤¤¡¢¥Ñ¥±¥Ã¥È¿ô¤ÎºÇÂçÃÍ¡£ +¤³¤ÎÃͤòĶ¤¨¤Æ¥Ñ¥±¥Ã¥È¤Î½ç½øµÕž¤¬µ¯¤³¤ë¤È¡¢¥Ñ¥±¥Ã¥È¥í¥¹¤¬À¸¤¸¤¿¤È +¤ß¤Ê¤·¡¢slow start ¤ËÆþ¤ë¡£ +¤³¤Î¿ôÃͤÏÊѹ¹¤·¤Ê¤¤¤Û¤¦¤¬Îɤ¤¡£ +¤³¤ì¤Ï¡¢ÀܳÃæ¤Î¥Ñ¥±¥Ã¥È¤ÎʤÓÂؤ¨¤Ë¤è¤Ã¤ÆÀ¸¤¸¤ë +ÉÔɬÍפÊ®ÅÙÄã²¼¤äºÆÁ÷¤òºÇ¾®²½¤¹¤ë¤è¤¦¤ËÀ߷פµ¤ì¤¿¡¢ +¥Ñ¥±¥Ã¥ÈʤÓÂؤ¨ (packet reordering) ¤Î¸¡ÃÎ¥á¥È¥ê¥Ã¥¯¤Ê¤Î¤Ç¤¢¤ë¡£ +.TP +.\"O .IR tcp_retrans_collapse " (Boolean; default: enabled; since Linux 2.2)" +.IR tcp_retrans_collapse " (Boolean; default: enabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.96 +.\"O Try to send full-sized packets during retransmit. +ºÆÁ÷¤ÎºÝ¤Ë¥Õ¥ë¥µ¥¤¥º¤Î¥Ñ¥±¥Ã¥È¤òÁ÷¤í¤¦¤È¤¹¤ë¡£ +.TP +.\"O .IR tcp_retries1 " (integer; default: 3; since Linux 2.2)" +.IR tcp_retries1 " (integer; default: 3; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.43 +.\"O The number of times TCP will attempt to retransmit a +.\"O packet on an established connection normally, +.\"O without the extra effort of getting the network layers involved. +.\"O Once we exceed this number of +.\"O retransmits, we first have the network layer +.\"O update the route if possible before each new retransmit. +.\"O The default is the RFC specified minimum of 3. +ÉáÄ̤˳ÎΩ¤µ¤ì¤Æ¤¤¤ëÀܳ¾å¤Ë¡¢ +TCP ¤¬¥Í¥Ã¥È¥ï¡¼¥¯Áؤò´¬¤­¹þ¤Þ¤º¤ËºÆÁ÷¤ò»î¤ß¤ë²ó¿ô¡£ +ºÆÁ÷¤¬¤³¤Î²ó¿ô¤ò±Û¤¨¤ë¤È¡¢¤Þ¤ººÇ½é¤Ë¡¢ +¿·¤·¤¤ºÆÁ÷¤òÁ÷¤ëÁ°¤Ë²Äǽ¤Ê¤é¥Í¥Ã¥È¥ï¡¼¥¯Áؤ˷ÐÏ©¤ò¹¹¿·¤µ¤»¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï RFC ¤¬»ØÄꤷ¤Æ¤¤¤ëºÇ¾¯¿ô¤Ç¤¢¤ë 3¡£ +.TP +.\"O .IR tcp_retries2 " (integer; default: 15; since Linux 2.2)" +.IR tcp_retries2 " (integer; default: 15; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.43 +.\"O The maximum number of times a TCP packet is retransmitted +.\"O in established state before giving up. +.\"O The default value is 15, which corresponds to a duration of +.\"O approximately between 13 to 30 minutes, depending +.\"O on the retransmission timeout. +.\"O The RFC\ 1122 specified +.\"O minimum limit of 100 seconds is typically deemed too short. +³ÎΩ¾õÂÖ¤ÎÀܳ¤Ë¡¢¤³¤Î²ó¿ô TCP ¥Ñ¥±¥Ã¥È¤ÎºÆÁ÷¿®¤ò +¹Ô¤Ê¤Ã¤Æ¤â¤À¤á¤Ê¾ì¹ç¤Ï¤¢¤­¤é¤á¤ë¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 15 ¤Ç¡¢¤³¤ì¤Ï (ºÆÁ÷¤Î¥¿¥¤¥à¥¢¥¦¥È¤Ë°Í¸¤¹¤ë¤¬) +¤ª¤è¤½ 13¡Á30 ʬÄøÅ٤δü´Ö¤ËÂбþ¤¹¤ë¡£ +RFC\ 1122 ¤ÏºÇ¾®¤Î¸Â³¦¤ò 100 ÉäÈÃÖ¤¤¤Æ¤¤¤ë¤¬¡¢ +¤³¤ì¤Ï¤¿¤¤¤Æ¤¤¤Î¾ì¹ç¤Ë¤Ïû¤¹¤®¤ë¤È»×¤ï¤ì¤ë¡£ +.TP +.\"O .IR tcp_rfc1337 " (Boolean; default: disabled; since Linux 2.2)" +.IR tcp_rfc1337 " (Boolean; default: disabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.90 +.\"O Enable TCP behavior conformant with RFC\ 1337. +.\"O When disabled, +.\"O if a RST is received in TIME_WAIT state, we close +.\"O the socket immediately without waiting for the end +.\"O of the TIME_WAIT period. +TCP ¤ÎÆ°ºî¤ò RFC\ 1337 ¤Ë½àµò¤µ¤»¤ë¡£ +̵¸ú¤Ë¤¹¤ë¤È¡¢TIME_WAIT ¾õÂ֤ΤȤ­¤Ë RST ¤¬¼õ¿®¤µ¤ì¤¿¾ì¹ç¡¢ +TIME_WAIT ´ü´Ö¤Î½ªÎ»¤òÂÔ¤¿¤º¤Ë¤½¤Î¥½¥±¥Ã¥È¤òľ¤Á¤Ë¥¯¥í¡¼¥º¤¹¤ë¡£ +.TP +.\"O .IR tcp_rmem " (since Linux 2.4)" +.IR tcp_rmem " (Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +.\"O This is a vector of 3 integers: [min, default, max]. +.\"O These parameters are used by TCP to regulate receive buffer sizes. +.\"O TCP dynamically adjusts the size of the +.\"O receive buffer from the defaults listed below, in the range +.\"O of these values, depending on memory available in the system. +¤³¤ì¤Ï 3 ¤Ä¤ÎÀ°¿ô [min, default, max] ¤«¤é¤Ê¤ë¥Ù¥¯¥È¥ëÃͤǤ¢¤ë¡£ +¤³¤ì¤é¤Ï TCP ¤¬¼õ¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤òÄ´À°¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +TCP ¤Ï¡¢¥·¥¹¥Æ¥à¤ÇÍøÍѤǤ­¤ë¥á¥â¥ê¤Ë±þ¤¸¤Æ¡¢ +¼õ¿®¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò¤³¤ì¤é¤ÎÊÑ¿ô¤ÎÈÏ°Ï¤Ç +°Ê²¼¤Ë¼¨¤¹¥Ç¥Õ¥©¥ë¥È¤«¤éưŪ¤ËÄ´À°¤¹¤ë¡£ +.RS +.TP 10 +.I min +.\"O minimum size of the receive buffer used by each TCP socket. +.\"O The default value is the system page size. +.\"O (On Linux 2.4, the default value is 4K, lowered to +.\"O .B PAGE_SIZE +.\"O bytes in low-memory systems.) +.\"O This value +.\"O is used to ensure that in memory pressure mode, +.\"O allocations below this size will still succeed. +.\"O This is not +.\"O used to bound the size of the receive buffer declared +.\"O using +.\"O .B SO_RCVBUF +.\"O on a socket. +³Æ TCP ¥½¥±¥Ã¥È¤¬ÍѤ¤¤ë¼õ¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇ¾®¥µ¥¤¥º¡£ +¥Ç¥Õ¥©¥ë¥ÈÃͤϥ·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤Ç¤¢¤ë +(Linux 2.4 ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 4K ¥Ð¥¤¥È¤Ç¡¢ +¥á¥â¥ê¤Î¾¯¤Ê¤¤¥·¥¹¥Æ¥à¤Ç¤Ï +.B PAGE_SIZE +¥Ð¥¤¥È¤Ë¸º¤é¤µ¤ì¤ë)¡£ +¤³¤ÎÃͤϡ¢¥á¥â¥ê°µÇ÷¥â¡¼¥É¤Ë¤ª¤¤¤Æ¤â¡¢ +¤³¤Î¥µ¥¤¥º¤Î³ä¤êÅö¤Æ¤¬À®¸ù¤¹¤ë¤³¤È¤òÊݾڤ¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +¤³¤ì¤Ï¡¢ +.B SO_RCVBUF +¤òÍѤ¤¤Æ¥½¥±¥Ã¥È¤ÎºÇÄã¼õ¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤òÀë¸À¤¹¤ëºÝ¤Ë¤ÏÍѤ¤¤é¤ì¤Ê¤¤¡£ +.\"nakano Documentation/networking/ip-sysctls.txt +.\"nakano ¤ò¤ß¤ë¸Â¤ê¤Ç¤Ï¤³¤¦¤¤¤¦ÆâÍƤΤ褦¤Ê¡£ +.TP +.I default +.\"O the default size of the receive buffer for a TCP socket. +.\"O This value overwrites the initial default buffer size from +.\"O the generic global +.\"O .I net.core.rmem_default +.\"O defined for all protocols. +.\"O The default value is 87380 bytes. +.\"O (On Linux 2.4, this will be lowered to 43689 in low-memory systems.) +.\"O If larger receive buffer sizes are desired, this value should +.\"O be increased (to affect all sockets). +.\"O To employ large TCP windows, the +.\"O .I net.ipv4.tcp_window_scaling +.\"O must be enabled (default). +TCP ¥½¥±¥Ã¥È¤Î¼õ¿®¥Ð¥Ã¥Õ¥¡¤Î¥Ç¥Õ¥©¥ë¥È¥µ¥¤¥º¡£ +¤³¤ÎÃͤϡ¢¤¹¤Ù¤Æ¤Î¥×¥í¥È¥³¥ë¤ËÂФ·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡¢ +¥¸¥§¥Í¥ê¥Ã¥¯¤Ê¥°¥í¡¼¥Ð¥ë¤Î¥Ç¥Õ¥©¥ë¥È¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º +.I net.core.rmem_default +¤è¤êÍ¥À褵¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 87380 ¥Ð¥¤¥È¤Ç¤¢¤ë +(Linux 2.4 ¤Ç¤Ï¡¢¥á¥â¥ê¤Î¾¯¤Ê¤¤¥·¥¹¥Æ¥à¤Î¾ì¹ç +43689 ¤Þ¤Ç¸º¤é¤µ¤ì¤ë)¡£ +Â礭¤Ê¼õ¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤¬É¬Íפʾì¹ç¤Ï¡¢ +¤³¤ÎÃͤòÁý¤ä¤¹¤Ù¤­¤Ç¤¢¤ë (¤¹¤Ù¤Æ¤Î¥½¥±¥Ã¥È¤Ë±Æ¶Á¤¹¤ë)¡£ +Â礭¤Ê TCP ¥¦¥£¥ó¥É¥¦¤òÍѤ¤¤ë¤Ë¤Ï¡¢ +.I net.ipv4.tcp_window_scaling +¤òÍ­¸ú¤Ë¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ (¥Ç¥Õ¥©¥ë¥È¤ÏÍ­¸ú)¡£ +.TP +.I max +.\"O the maximum size of the receive buffer used by each TCP socket. +.\"O This value does not override the global +.\"O .IR net.core.rmem_max . +.\"O This is not used to limit the size of the receive buffer declared using +.\"O .B SO_RCVBUF +.\"O on a socket. +.\"O The default value is calculated using the formula +.\"O +.\"O max(87380, min(4MB, \fItcp_mem\fP[1]*PAGE_SIZE/128)) +.\"O +.\"O (On Linux 2.4, the default is 87380*2 bytes, +.\"O lowered to 87380 in low-memory systems). +³Æ TCP ¥½¥±¥Ã¥È¤ÇÍѤ¤¤ë¼õ¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇÂ祵¥¤¥º¡£ +¤³¤ÎÃͤè¤ê¤â¥°¥í¡¼¥Ð¥ë¤Î +.I net.core.rmem_max +¤¬Í¥À褵¤ì¤ë¡£ +¤³¤ì¤Ï¡¢ +.B SO_RCVBUF +¤òÍѤ¤¤Æ¥½¥±¥Ã¥È¤Î¼õ¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥ºÀ©¸Â¤òÀë¸À¤¹¤ëºÝ¤Ë¤ÏÍѤ¤¤é¤ì¤Ê¤¤¡£ +.\"nakano Ʊ¾å¡£ +¥Ç¥Õ¥©¥ë¥ÈÃͤϰʲ¼¤Î¼°¤Ç·×»»¤µ¤ì¤ë¡£ + + max(87380, min(4MB, \fItcp_mem\fP[1]*PAGE_SIZE/128)) + +(Linux 2.4 ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 87380*2 ¥Ð¥¤¥È¤Ç¡¢ +¥á¥â¥ê¤Î¾¯¤Ê¤¤¥·¥¹¥Æ¥à¤Ç¤Ï 87380 ¤Þ¤Ç¸º¤é¤µ¤ì¤ë¡£) +.RE +.TP +.\"O .IR tcp_sack " (Boolean; default: enabled; since Linux 2.2)" +.IR tcp_sack " (Boolean; default: enabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.36 +.\"O Enable RFC\ 2018 TCP Selective Acknowledgements. +RFC\ 2018 ¤Î TCP Selective Acknowledgements ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.\"O .IR tcp_slow_start_after_idle " (Boolean; default: enabled; since Linux 2.6.18)" +.IR tcp_slow_start_after_idle " (Boolean; default: enabled; Linux 2.6.18 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +.\"O If enabled, provide RFC 2861 behavior and time out the congestion +.\"O window after an idle period. +.\"O An idle period is defined as the current RTO (retransmission timeout). +.\"O If disabled, the congestion window will not +.\"O be timed out after an idle period. +Í­¸ú¤Ë¤¹¤ë¤È¡¢RFC 2861 ¤ÎÆ°ºî¤¬¹Ô¤ï¤ì¡¢ +¥¢¥¤¥É¥ë»þ´Ö·Ð²á¸å¤ËíÕíÔ¥¦¥£¥ó¥É¥¦¤ò¥¿¥¤¥à¥¢¥¦¥È¤µ¤»¤ë¡£ +¥¢¥¤¥É¥ë»þ´Ö¤Ï¸½ºß¤Î RTO (ºÆÁ÷¥¿¥¤¥à¥¢¥¦¥È) ¤ÇÄêµÁ¤µ¤ì¤ë¡£ +̵¸ú¤Ë¤¹¤ë¤È¡¢íÕíÔ¥¦¥£¥ó¥É¥¦¤Ï¥¢¥¤¥É¥ë»þ´Ö·Ð²á¸å¤â¥¿¥¤¥à¥¢¥¦¥È¤µ¤ì¤Ê¤¤¡£ +.TP +.\"O .IR tcp_stdurg " (Boolean; default: disabled; since Linux 2.2)" +.IR tcp_stdurg " (Boolean; default: disabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.44 +.\"O If this option is enabled, then use the RFC\ 1122 interpretation +.\"O of the TCP urgent-pointer field. +.\"O .\" RFC\ 793 was ambiguous in its specification of the meaning of the +.\"O .\" urgent pointer. RFC\ 1122 (and RFC\ 961) fixed on a particular +.\"O .\" resolution of this ambiguity (unfortunately the "wrong" one). +.\"O According to this interpretation, the urgent pointer points +.\"O to the last byte of urgent data. +.\"O If this option is disabled, then use the BSD-compatible interpretation of +.\"O the urgent pointer: +.\"O the urgent pointer points to the first byte after the urgent data. +.\"O Enabling this option may lead to interoperability problems. +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢ TCP ¶ÛµÞ¥Ý¥¤¥ó¥¿ (urgent-pointer) +¥Õ¥£¡¼¥ë¥É¤ò RFC\ 1122 ¤Ë½¾¤Ã¤¿²ò¼á¤ò¹Ô¤¦¡£ +.\" RFC\ 793 ¤Ï¶ÛµÞ¥Ý¥¤¥ó¥¿¤Î°ÕÌ£¤Îµ¬Ä꤬ۣËæ¤Ç¤¢¤Ã¤¿¡£ +.\" RFC\ 1122 (¤È RFC\ 961) ¤Ç¤Ï¤³¤ÎÛ£Ë椵¤Ë°ì¤Ä¤Î²ò·èºö¤òÄê¤á¤¿ +.\" (»ÄÇ°¤Ê¤¬¤é "´Ö°ã¤Ã¤¿" ²ò·èºö¤Ç¤¢¤Ã¤¿¤¬)¡£ +¤³¤Î²ò¼á¤Ë½¾¤¦¤È¡¢¶ÛµÞ¥Ý¥¤¥ó¥¿¤Ï¶ÛµÞ¥Ç¡¼¥¿¤ÎºÇ¸å¤Î¥Ð¥¤¥È¤ò»Ø¤¹¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò̵¸ú¤Ë¤¹¤ë¤È¡¢¶ÛµÞ¥Ý¥¤¥ó¥¿¤Î²ò¼á¤¬ BSD ¸ß´¹¤ÎÊýË¡¤Ç +¹Ô¤ï¤ì¤ë: ¶ÛµÞ¥Ý¥¤¥ó¥¿¤Ï¶ÛµÞ¥Ç¡¼¥¿¤Î¸å¤ÎºÇ½é¤Î¥Ð¥¤¥È¤ò»Ø¤¹¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢Áê¸ß±¿ÍÑÀ­¤ËÌäÂ꤬À¸¤¸¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.\"O .IR tcp_syn_retries " (integer; default: 5; since Linux 2.2)" +.IR tcp_syn_retries " (integer; default: 5; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.38 +.\"O The maximum number of times initial SYNs for an active TCP +.\"O connection attempt will be retransmitted. +.\"O This value should not be higher than 255. +.\"O The default value is 5, which corresponds to approximately 180 seconds. +¥¢¥¯¥Æ¥£¥Ö¤Ê TCP Àܳ¤Ë½é´ü SYN ¤ÎºÆÁ÷¤ò»î¤ß¤ëºÇÂç²ó¿ô¡£ +¤³¤Î¿ôÃÍ¤Ï 255 ¤è¤ê¤âÂ礭¤¯¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï 5 ¤Ç¡¢¤ª¤è¤½ 180 ÉäËÂбþ¤¹¤ë¡£ +.TP +.\"O .IR tcp_synack_retries " (integer; default: 5; since Linux 2.2)" +.IR tcp_synack_retries " (integer; default: 5; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.38 +.\"O The maximum number of times a SYN/ACK segment +.\"O for a passive TCP connection will be retransmitted. +.\"O This number should not be higher than 255. +passive ¤Ê TCP Àܳ¤Î SYN/ACK ¥»¥°¥á¥ó¥È¤ÇºÆÁ÷¤ò»î¤ß¤ëºÇÂç¿ô¡£ +¤³¤Î¿ôÃÍ¤Ï 255 ¤è¤ê¤âÂ礭¤¯¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.\"O .IR tcp_syncookies " (Boolean; since Linux 2.2)" +.IR tcp_syncookies " (Boolean; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.43 +.\"O Enable TCP syncookies. +.\"O The kernel must be compiled with +.\"O .BR CONFIG_SYN_COOKIES . +.TCP syncookies ¤òÍ­¸ú¤Ë¤¹¤ë¡£¥«¡¼¥Í¥ë¤Ï +.B CONFIG_SYNCOOKIES +¤ò¤Ä¤±¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\"O Send out syncookies when the syn backlog queue of a socket overflows. +.\"O The syncookies feature attempts to protect a +.\"O socket from a SYN flood attack. +.\"O This should be used as a last resort, if at all. +.\"O This is a violation of the TCP protocol, +.\"O and conflicts with other areas of TCP such as TCP extensions. +.\"O It can cause problems for clients and relays. +.\"O It is not recommended as a tuning mechanism for heavily +.\"O loaded servers to help with overloaded or misconfigured conditions. +.\"O For recommended alternatives see +.\"O .IR tcp_max_syn_backlog , +.\"O .IR tcp_synack_retries , +.\"O and +.\"O .IR tcp_abort_on_overflow . +¥½¥±¥Ã¥È¤Î¥Ð¥Ã¥¯¥í¥°¥­¥å¡¼¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¤È¡¢ +syncookies ¤¬Á÷¿®¤µ¤ì¤ë¡£ +syncookies µ¡Ç½¤Ï¡¢SYN flood ¹¶·â¤«¤é¥½¥±¥Ã¥È¤ò¼é¤í¤¦¤È¤¹¤ë¡£ +¤³¤ì¤Ï¤¤¤º¤ì¤Ë¤·¤Æ¤â¡¢ºÇ½ª¼êÃʤȤ·¤ÆÍѤ¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï TCP ¥×¥í¥È¥³¥ë¤Ë°ãÈ¿¤·¤Æ¤ª¤ê¡¢ +TCP ³ÈÄ¥¤Î¤è¤¦¤Ê¡¢TCP ¤Î¾¤ÎÉôʬ¤È¾×Æͤ·¤Æ¤·¤Þ¤¦¡£ +¥¯¥é¥¤¥¢¥ó¥È¤ä¥ê¥ì¡¼¤ÇÌäÂ꤬µ¯¤³¤ë¤³¤È¤â¤¢¤ë¡£ +²áÉé²Ù¤äÀßÄê´Ö°ã¤¤¤Ë¤è¤Ã¤ÆÉé²Ù¤ÎÂ礭¤Ê¾õÂ֤ˤ¢¤ë¥µ¡¼¥Ð¤òÄ´À°¤·¤Æµß¤¦¤¿¤á¤Î +µ¡¹½¤È¤ß¤Ê¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¤½¤Î¤è¤¦¤ÊÍÑÅӤˤϡ¢Âå¤ï¤ê¤Ë +.IR tcp_max_syn_backlog , +.IR tcp_synack_retries , +.I tcp_abort_on_overflow +¤Ê¤É¤Î»ÈÍѤò¹Í¤¨¤ë¤³¤È¡£ +.TP +.\"O .IR tcp_timestamps " (Boolean; default: enabled; since Linux 2.2)" +.IR tcp_timestamps " (Boolean; default: enabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.36 +.\"O Enable RFC\ 1323 TCP timestamps. +RFC\ 1323 ¤Î TCP timestamps ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.\"O .IR tcp_tso_win_divisor " (integer; default: 3; since Linux 2.6.9)" +.IR tcp_tso_win_divisor " (integer; default: 3; Linux 2.6.9 °Ê¹ß)" +.\"O This parameter controls what percentage of the congestion window +.\"O can be consumed by a single TCP Segmentation Offload (TSO) frame. +.\"O The setting of this parameter is a tradeoff between burstiness and +.\"O building larger TSO frames. +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢°ì¤Ä¤Î TCP Segmentation Offload (TSO) ¥Õ¥ì¡¼¥à¤Ç +¾ÃÈñ¤Ç¤­¤ëíÕíÔ¥¦¥£¥ó¥É¥¦¤Î³ä¹ç (¥Ñ¡¼¥»¥ó¥È) ¤òÀ©¸æ¤¹¤ë¡£ +¥Ð¡¼¥¹¥ÈÀ­¤È¡¢¤É¤ì¤À¤±Â礭¤Ê TSO ¥Õ¥ì¡¼¥à¤ò¹½ÃÛ¤¹¤ë¤«¤Î¤Ï¥È¥ì¡¼¥É¥ª¥Õ¤Ç¤¢¤ê¡¢ +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¤½¤ÎÅٹ礤¤òÀßÄꤹ¤ë¡£ +.TP +.\"O .IR tcp_tw_recycle " (Boolean; default: disabled; since Linux 2.4)" +.IR tcp_tw_recycle " (Boolean; default: disabled; Linux 2.4 °Ê¹ß)" +.\" Since 2.3.15 +.\"O Enable fast recycling of TIME_WAIT sockets. +.\"O Enabling this option is not +.\"O recommended since this causes problems when working +.\"O with NAT (Network Address Translation). +TIME_WAIT ¥½¥±¥Ã¥È¤ÎÁÇÁᤤºÆÍøÍѤòÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢ +NAT (¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹ÊÑ´¹) ¤òÍѤ¤¤Æ¤¤¤ë¤ÈÌäÂ꤬À¸¤¸¤ë¤Î¤Ç¡¢ +¤¢¤Þ¤ê¿ä¾©¤·¤Ê¤¤¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.\"O .IR tcp_tw_reuse " (Boolean; default: disabled; since Linux 2.4.19/2.6)" +.IR tcp_tw_reuse " (Boolean; default: disabled; Linux 2.4.19/2.6 °Ê¹ß)" +.\" Since 2.4.19/2.5.43 +.\"O Allow to reuse TIME_WAIT sockets for new connections when it is +.\"O safe from protocol viewpoint. +.\"O It should not be changed without advice/request of technical experts. +¥×¥í¥È¥³¥ë¤ÎÌ̤«¤é¸«¤ÆÌäÂê¤Ê¤¤¾ì¹ç¤Ë¿·µ¬¥³¥Í¥¯¥·¥ç¥ó¤Ë TIME_WAIT +¾õÂ֤Υ½¥±¥Ã¥È¤òºÆÍøÍѤ¹¤ë¤³¤È¤òµö²Ä¤¹¤ë¡£µ»½ÑŪ¤Ë¾Ü¤·¤¤¿Í¤Î½õ¸À¤ä +Í×ÀÁ¤Ê¤·¤Ë¤³¤Î¥ª¥×¥·¥ç¥ó¤òÊѹ¹¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.\"O .IR tcp_vegas_cong_avoid " (Boolean; default: disabled; Linux 2.2 to 2.6.13)" +.IR tcp_vegas_cong_avoid " (Boolean; default: disabled; Linux 2.2 ¤«¤é 2.6.13 ¤Þ¤Ç)" +.\" Since 2.1.8; removed in 2.6.13 +.\"O Enable TCP Vegas congestion avoidance algorithm. +.\"O TCP Vegas is a sender-side only change to TCP that anticipates +.\"O the onset of congestion by estimating the bandwidth. +.\"O TCP Vegas adjusts the sending rate by modifying the congestion window. +.\"O TCP Vegas should provide less packet loss, but it is +.\"O not as aggressive as TCP Reno. +TCP Vegas íÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤òÍ­¸ú¤Ë¤¹¤ë¡£ +TCP Vegas ¤ÏÂÓ°è¤ò¿ä¬¤¹¤ë¤³¤È¤ÇíÕíԤε¯¤³¤ê»Ï¤á¤òͽÁÛ¤¹¤ë¤è¤¦¤Ë +TCP ¤ÎÁ÷¿®Â¦¤Î¤ß¤ËÊѹ¹¤ò²Ã¤¨¤¿¤â¤Î¤Ç¤¢¤ë¡£ +TCP Vegas ¤ÏíÕíÔ¥¦¥£¥ó¥É¥¦¤ò½¤Àµ¤¹¤ë¤³¤È¤Ç¡¢Á÷¿®¥ì¡¼¥È¤òÄ´À°¤¹¤ë¡£ +TCP Vegas ¤Ï TCP Reno ¤ÈÈæ¤Ù¤Æ¥Ñ¥±¥Ã¥È¥í¥¹¤Ï¾¯¤Ê¤¤¤¬¡¢ +TCP Reno ¤Û¤ÉÀѶËŪ¤ÊµóÆ°¤Ï¤·¤Ê¤¤¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.\"O .IR tcp_westwood " (Boolean; default: disabled; Linux 2.4.26/2.6.3 to 2.6.13)" +.IR tcp_westwood " (Boolean; default: disabled; Linux 2.4.26/2.6.3 ¤«¤é 2.6.13 ¤Þ¤Ç)" +.\"O Enable TCP Westwood+ congestion control algorithm. +.\"O TCP Westwood+ is a sender-side only modification of the TCP Reno +.\"O protocol stack that optimizes the performance of TCP congestion control. +.\"O It is based on end-to-end bandwidth estimation to set +.\"O congestion window and slow start threshold after a congestion episode. +.\"O Using this estimation, TCP Westwood+ adaptively sets a +.\"O slow start threshold and a congestion window which takes into +.\"O account the bandwidth used at the time congestion is experienced. +.\"O TCP Westwood+ significantly increases fairness with respect to +.\"O TCP Reno in wired networks and throughput over wireless links. +TCP Westwood+ íÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤òÍ­¸ú¤Ë¤¹¤ë¡£ +TCP Westwood+ ¤Ï TCP íÕíÔÀ©¸æ¤ÎÀ­Ç½¤òºÇŬ²½¤¹¤ë¤è¤¦¤Ë TCP Reno ¤Î +¥×¥í¥È¥³¥ë¥¹¥¿¥Ã¥¯¤ÎÁ÷¿®Â¦¤Î¤ß¤Ë½¤Àµ¤ò²Ã¤¨¤¿¤â¤Î¤Ç¤¢¤ë¡£ +íÕíÔ¤¬µ¯¤³¤Ã¤¿¸å¤Ç¡¢íÕíÔ¥¦¥£¥ó¥É¥¦¤ä slow start ¤ÎïçÃͤò +ÄÌ¿®Î¾Ã¼´Ö¤ÎÂÓ°è¤Î¿ä¬¤Ë´ð¤Å¤¤¤ÆÀßÄꤹ¤ë¡£ +¤³¤Î¿ä¬¤ò»È¤Ã¤Æ¡¢TCP Westwood+ ¤ÏíÕíÔ¤¬È¯À¸¤·¤¿»þ¤Ë»È¤Ã¤Æ¤¤¤¿ +ÂÓ°è¤ò¹Íθ¤ËÆþ¤ì¤¿ slow start ¤ÎïçÃͤÈíÕíÔ¥¦¥£¥ó¥É¥¦¤òÀßÄꤹ¤ë¡£ +TCP Westwood+ ¤Ï¡¢Í­Àþ¥Í¥Ã¥È¥ï¡¼¥¯¤Ë¤ª¤±¤ë TCP Reno ¤Î¸øÊ¿À­ +(fairness) ¤È¡¢ÌµÀþ¥ê¥ó¥¯¤Ç¤Î¥¹¥ë¡¼¥×¥Ã¥È¤òÂ礭¤¯¸þ¾å¤¹¤ë¡£ +.TP +.\"O .IR tcp_window_scaling " (Boolean; default: enabled; since Linux 2.2)" +.IR tcp_window_scaling " (Boolean; default: enabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.36 +.\"O Enable RFC\ 1323 TCP window scaling. +.\"O This feature allows the use of a large window +.\"O (> 64K) on a TCP connection, should the other end support it. +.\"O Normally, the 16 bit window length field in the TCP header +.\"O limits the window size to less than 64K bytes. +.\"O If larger windows are desired, applications can increase the size of +.\"O their socket buffers and the window scaling option will be employed. +.\"O If +.\"O .I tcp_window_scaling +.\"O is disabled, TCP will not negotiate the use of window +.\"O scaling with the other end during connection setup. +RFC\ 1323 ¤Î TCP ¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤Îµ¡Ç½¤òÍѤ¤¤ë¤È¡¢ÀܳÀ褬Âбþ¤·¤Æ¤¤¤ì¤Ð¡¢ +TCP Àܳ¤ÇÂ礭¤Ê (64K °Ê¾å¤Î) ¥¦¥£¥ó¥É¥¦¤¬»È¤¨¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +Ä̾ï¤Ï TCP ¥Ø¥Ã¥À¤Î¥¦¥¤¥ó¥É¥¦Ä¹¥Õ¥£¡¼¥ë¥É¤Ï 16 ¥Ó¥Ã¥È¤Ê¤Î¤Ç¡¢ +¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤Ï 64K ¥Ð¥¤¥È°Ê²¼¤Ë¸Â¤é¤ì¤ë¡£ +¤â¤Ã¤ÈÂ礭¤Ê¥¦¥£¥ó¥É¥¦¤ò»È¤¤¤¿¤¤¾ì¹ç¤Ï¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥½¥±¥Ã¥È¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òÁý¤ä¤·¤Æ¡¢ +¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¤Î¥ª¥×¥·¥ç¥ó¤òÍøÍѤ¹¤ì¤Ð¤è¤¤¡£ +.I tcp_window_scaling +¤ò̵¸ú¤Ë¤·¤Æ¤¤¤ë¤È¡¢ +TCP ¤Ï¾ü¤È¤ÎÀܳÀßÄê¤ÎºÝ¤Ë¡¢ +¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¤Î¥Í¥´¥·¥¨¡¼¥·¥ç¥ó¤ò¹Ô¤Ê¤ï¤Ê¤¤¡£ +.TP +.\"O .IR tcp_wmem " (since Linux 2.4)" +.IR tcp_wmem " (Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +.\"O This is a vector of 3 integers: [min, default, max]. +.\"O These parameters are used by TCP to regulate send buffer sizes. +.\"O TCP dynamically adjusts the size of the send buffer from the +.\"O default values listed below, in the range of these values, +.\"O depending on memory available. +¤³¤ì¤Ï 3 ¤Ä¤ÎÀ°¿ô [min, default, max] ¤«¤é¤Ê¤ë¥Ù¥¯¥È¥ëÃͤǤ¢¤ë¡£ +¤³¤ì¤é¤Ï TCP ¤¬Á÷¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤òÄ´À°¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +TCP ¤Ï¡¢¥·¥¹¥Æ¥à¤ÇÍøÍѤǤ­¤ë¥á¥â¥ê¤Ë±þ¤¸¤Æ¡¢Á÷¿®¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò +¤³¤ì¤é¤ÎÊÑ¿ô¤ÎÈϰϤǰʲ¼¤Ë¼¨¤¹¥Ç¥Õ¥©¥ë¥È¤«¤éưŪ¤ËÄ´À°¤¹¤ë¡£ +.RS +.TP 10 +.I min +.\"O Minimum size of the send buffer used by each TCP socket. +.\"O The default value is the system page size. +.\"O (On Linux 2.4, the default value is 4K bytes.) +.\"O This value is used to ensure that in memory pressure mode, +.\"O allocations below this size will still succeed. +.\"O This is not used to bound the size of the send buffer declared using +.\"O .B SO_SNDBUF +.\"O on a socket. +³Æ TCP ¥½¥±¥Ã¥È¤¬ÍѤ¤¤ëÁ÷¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇ¾®¥µ¥¤¥º¡£ +¥Ç¥Õ¥©¥ë¥ÈÃͤϥ·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤Ç¤¢¤ë +(Linux 2.4 ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 4K ¤Ç¤¢¤ë)¡£ +¤³¤ÎÃͤϡ¢¥á¥â¥ê°µÇ÷¥â¡¼¥É¤Ë¤ª¤¤¤Æ¤â¡¢ +¤³¤Î¥µ¥¤¥º°Ê²¼¤Î³ä¤êÅö¤Æ¤¬À®¸ù¤¹¤ë¤³¤È¤òÊݾڤ¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +¤³¤ì¤Ï¡¢ +.B SO_SNDBUF +¤òÍѤ¤¤Æ¥½¥±¥Ã¥È¤ÎºÇÄãÁ÷¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤òÀë¸À¤¹¤ëºÝ¤Ë¤ÏÍѤ¤¤é¤ì¤Ê¤¤¡£ +.TP +.I default +.\"O The default size of the send buffer for a TCP socket. +.\"O This value overwrites the initial default buffer size from +.\"O the generic global +.\"O .I /proc/sys/net/core/wmem_default +.\"O defined for all protocols. +.\"O The default value is 16K bytes. +.\"O .\" True in Linux 2.4 and 2.6 +.\"O If larger send buffer sizes are desired, this value +.\"O should be increased (to affect all sockets). +.\"O To employ large TCP windows, the +.\"O .I /proc/sys/net/ipv4/tcp_window_scaling +.\"O must be set to a nonzero value (default). +TCP ¥½¥±¥Ã¥È¤ÎÁ÷¿®¥Ð¥Ã¥Õ¥¡¤Î¥Ç¥Õ¥©¥ë¥È¥µ¥¤¥º¡£ +¤³¤ÎÃͤϡ¢¤¹¤Ù¤Æ¤Î¥×¥í¥È¥³¥ë¤ËÂФ·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡¢ +¥¸¥§¥Í¥ê¥Ã¥¯¤Ê¥°¥í¡¼¥Ð¥ë¤Î¥Ç¥Õ¥©¥ë¥È¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º +.I /proc/sys/net/core/wmem_default +¤è¤êÍ¥À褵¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 16K ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +.\" Linux 2.4 ¤È 2.6 ¤Ç¤ÏÀµ¤·¤¤¡£ +Â礭¤ÊÁ÷¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤¬É¬Íפʾì¹ç¤Ï¡¢ +¤³¤ÎÃͤòÁý¤ä¤¹¤Ù¤­¤Ç¤¢¤ë (¤¹¤Ù¤Æ¤Î¥½¥±¥Ã¥È¤Ë±Æ¶Á¤¹¤ë)¡£ +Â礭¤Ê TCP ¥¦¥£¥ó¥É¥¦¤òÍѤ¤¤ë¤Ë¤Ï¡¢ +.I /proc/sys/net/ipv4/tcp_window_scaling +¤ò 0 °Ê³°¤ÎÃÍ (¥Ç¥Õ¥©¥ë¥ÈÃÍ) ¤Ë¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.I max +.\"O The maximum size of the send buffer used by each TCP socket. +.\"O This value does not override the value in +.\"O .IR /proc/sys/net/core/wmem_max . +.\"O This is not used to limit the size of the send buffer declared using +.\"O .B SO_SNDBUF +.\"O on a socket. +.\"O The default value is calculated using the formula +.\"O +.\"O max(65536, min(4MB, \fItcp_mem\fP[1]*PAGE_SIZE/128)) +.\"O +.\"O (On Linux 2.4, the default value is 128K bytes, +.\"O lowered 64K depending on low-memory systems.) +³Æ TCP ¥½¥±¥Ã¥È¤ÇÍѤ¤¤ëÁ÷¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇÂ祵¥¤¥º¡£ +¤³¤ÎÃͤè¤ê¤â +.IR /proc/sys/net/core/wmem_max +¤¬Í¥À褵¤ì¤ë¡£ +¤³¤ì¤Ï +.B SO_SNDBUF +¤òÍѤ¤¤Æ¥½¥±¥Ã¥È¤ÎÁ÷¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥ºÀ©¸Â¤òÀë¸À¤¹¤ëºÝ¤Ë¤ÏÍѤ¤¤é¤ì¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥ÈÃͤϰʲ¼¤Î¼°¤Ç·×»»¤µ¤ì¤ë¡£ + + max(65536, min(4MB, \fItcp_mem\fP[1]*PAGE_SIZE/128)) + +(Linux 2.4 ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 128K ¥Ð¥¤¥È¤Ç¡¢ +¥á¥â¥ê¤Î¾¯¤Ê¤¤¥·¥¹¥Æ¥à¤Ç¤Ï 64K ¤Ë¤Þ¤Ç¸º¤é¤µ¤ì¤ë¡£) +.RE +.TP +.\"O .IR tcp_workaround_signed_windows " (Boolean; default: disabled; since Linux 2.6.26)" +.IR tcp_workaround_signed_windows " (Boolean; default: disabled; Linux 2.6.26 °Ê¹ß)" +.\"O If enabled, assume that no receipt of a window-scaling option means that the +.\"O remote TCP is broken and treats the window as a signed quantity. +.\"O If disabled, assume that the remote TCP is not broken even if we do +.\"O not receive a window scaling option from it. +Í­¸ú¤Ë¤¹¤ë¤È¡¢¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¥ª¥×¥·¥ç¥ó¤ò¼õ¿®¤·¤Ê¤¤¤Î¤Ï¡¢ +ÀܳÁê¼ê¤Î TCP ¤¬²õ¤ì¤Æ¤¤¤ë¤È¹Í¤¨¡¢¥¦¥£¥ó¥É¥¦¤òÉä¹æÉÕ¤­¤ÎÎ̤Ȥߤʤ¹¡£ +̵¸ú¤Ë¤¹¤ë¤È¡¢ÀܳÁê¼ê¤«¤é¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¥ª¥×¥·¥ç¥ó¤ò¼õ¿®¤·¤Ê¤«¤Ã¤¿ +¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢ÀܳÁê¼ê¤Î TCP ¤¬²õ¤ì¤Æ¤¤¤ë¤È¤Ï¤ß¤Ê¤µ¤Ê¤¤¡£ +.\"O .SS Socket Options +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.\"O To set or get a TCP socket option, call +.\"O .BR getsockopt (2) +.\"O to read or +.\"O .BR setsockopt (2) +.\"O to write the option with the option level argument set to +.\"O .BR IPPROTO_TCP . +TCP ¥½¥±¥Ã¥È¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë°ú¿ô¤Ë +.I IPPROTO_TCP +¤ò»ØÄꤷ¤¿ +.BR setsockopt (2) +¤ÇÀßÄê¤Ç¤­¡¢ +.BR getsockopt (2) +¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +.\"O In addition, +.\"O most +.\"O .B IPPROTO_IP +.\"O socket options are valid on TCP sockets. +.\"O For more information see +.\"O .BR ip (7). +¤µ¤é¤Ë¡¢¤Û¤È¤ó¤É¤Î +.B IPPROTO_IP +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤â TCP ¥½¥±¥Ã¥È¤ËÂФ·¤ÆÍ­¸ú¤Ç¤¢¤ë¡£¾ÜºÙ¤Ï +.BR ip (7) +¤ò¸«¤è¡£ +.\" FIXME Document TCP_CONGESTION (new in 2.6.13) +.TP +.\"O .BR TCP_CORK " (since Linux 2.2)" +.BR TCP_CORK " (Linux 2.2 °Ê¹ß)" +.\" precisely: since 2.1.127 +.\"O If set, don't send out partial frames. +.\"O All queued partial frames are sent when the option is cleared again. +.\"O This is useful for prepending headers before calling +.\"O .BR sendfile (2), +.\"O or for throughput optimization. +.\"O As currently implemented, there is a 200 millisecond ceiling on the time +.\"O for which output is corked by +.\"O .BR TCP_CORK . +.\"O If this ceiling is reached, then queued data is automatically transmitted. +.\"O This option can be combined with +.\"O .B TCP_NODELAY +.\"O only since Linux 2.5.71. +.\"O This option should not be used in code intended to be portable. +¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢ partial ¥Õ¥ì¡¼¥à¤òÁ÷¿®¤·¤Ê¤¤¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬²ò½ü¤µ¤ì¤ë¤È¡¢ +¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤¿ partial ¥Õ¥ì¡¼¥à¤¬Á÷¤é¤ì¤ë¡£¤³¤ì¤Ï +.BR sendfile (2) +¤ò¸Æ¤ÖÁ°¤Ë¥Ø¥Ã¥À¤òÁ°ÃÖ¤·¤¿¤ê¡¢ +¥¹¥ë¡¼¥×¥Ã¥È¤òºÇŬ²½¤·¤¿¤¤¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.B TCP_CORK +¤Ç½ÐÎϤòÍÞ¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë»þ´Ö¤Î¾å¸Â¤Ï 200 ¥ß¥êÉäǤ¢¤ë¡£ +¤³¤Î¾å¸Â¤Ë㤹¤ë¤È¡¢¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤¿¥Ç¡¼¥¿¤Ï¼«Æ°Åª¤ËÁ÷¿®¤µ¤ì¤ë¡£ +Linux 2.5.71 °Ê¹ß¤Ë¤ª¤¤¤Æ¤Î¤ß¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò +.B TCP_NODELAY +¤ÈƱ»þ¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.\"O .BR TCP_DEFER_ACCEPT " (since Linux 2.4)" +.BR TCP_DEFER_ACCEPT " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.38 +.\"O Allow a listener to be awakened only when data arrives on the socket. +.\"O Takes an integer value (seconds), this can +.\"O bound the maximum number of attempts TCP will make to +.\"O complete the connection. +.\"O This option should not be used in code intended to be portable. +¤³¤ì¤òÍѤ¤¤ë¤È¡¢¥ê¥¹¥Ê¤Ï¥Ç¡¼¥¿¤¬¥½¥±¥Ã¥È¤ËÅþÃ夷¤¿»þ¤Î¤ßÌܳФá¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +À°¿ôÃÍ (ÉÃ) ¤ò¤È¤ê¡¢ +TCP ¤¬Àܳ¤ò´°Î»¤·¤è¤¦¤È»î¤ß¤ë²ó¿ô¤òÀ©¸Â¤Ç¤­¤ë¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.\"O .BR TCP_INFO " (since Linux 2.4)" +.BR TCP_INFO " (Linux 2.4 °Ê¹ß)" +.\"O Used to collect information about this socket. +.\"O The kernel returns a \fIstruct tcp_info\fP as defined in the file +.\"O .IR /usr/include/linux/tcp.h . +.\"O This option should not be used in +.\"O code intended to be portable. +¤³¤Î¥½¥±¥Ã¥È¤Î¾ðÊó¤ò¼ý½¸¤¹¤ë¤Î¤ËÍѤ¤¤ë¡£ +¥«¡¼¥Í¥ë¤Ï +.I /usr/include/linux/tcp.h +¥Õ¥¡¥¤¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë +\fIstruct tcp_info\fP ¤òÊÖ¤¹¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.\"O .BR TCP_KEEPCNT " (since Linux 2.4)" +.BR TCP_KEEPCNT " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.18 +.\"O The maximum number of keepalive probes TCP should send +.\"O before dropping the connection. +.\"O This option should not be +.\"O used in code intended to be portable. +Àܳ¤òÍî¤È¤¹Á°¤Ë TCP ¤¬»î¤ß¤ë keepalive ¥×¥í¡¼¥Ö¤ÎºÇÂç²ó¿ô¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.\"O .BR TCP_KEEPIDLE " (since Linux 2.4)" +.BR TCP_KEEPIDLE " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.18 +.\"O The time (in seconds) the connection needs to remain idle +.\"O before TCP starts sending keepalive probes, if the socket +.\"O option +.\"O .B SO_KEEPALIVE +.\"O has been set on this socket. +.\"O This option should not be used in code intended to be portable. +¤³¤Î»þ´Ö (ÉÃñ°Ì) ¤ò±Û¤¨¤ÆÀܳ¤¬¥¢¥¤¥É¥ë¾õÂÖ¤Ëα¤Þ¤Ã¤Æ¤¤¤ë¤È¡¢ +¤³¤Î¥½¥±¥Ã¥È¤Ë +.B SO_KEEPALIVE +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +TCP ¤Ï keepalive ¥×¥í¡¼¥Ö¤òÁ÷¤ê¤Ï¤¸¤á¤ë¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.\"O .BR TCP_KEEPINTVL " (since Linux 2.4)" +.BR TCP_KEEPINTVL " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.18 +.\"O The time (in seconds) between individual keepalive probes. +.\"O This option should not be used in code intended to be portable. +³Æ keepalive ¥×¥í¡¼¥Ö¤Î´Ö³Ö (ÉÃñ°Ì)¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.\"O .BR TCP_LINGER2 " (since Linux 2.4)" +.BR TCP_LINGER2 " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.41 +.\"O The lifetime of orphaned FIN_WAIT2 state sockets. +.\"O This option can be used to override the system-wide setting in the file +.\"O .I /proc/sys/net/ipv4/tcp_fin_timeout +.\"O for this socket. +.\"O This is not to be confused with the +.\"O .BR socket (7) +.\"O level option +.\"O .BR SO_LINGER . +.\"O This option should not be used in code intended to be portable. +orphan ¤µ¤ì¤¿ FIN_WAIT2 ¾õÂ֤Υ½¥±¥Ã¥È¤Î¼÷Ì¿¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È¡¢¥·¥¹¥Æ¥àÁ´ÂΤËŬÍѤµ¤ì¤ë¥Õ¥¡¥¤¥ë +.I /proc/sys/net/ipv4/tcp_fin_timeout +¤ÎÃͤò¡¢¤³¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Î¤ßÊѹ¹¤Ç¤­¤ë¡£ +.BR socket (7) +¥ì¥Ù¥ë¤Î¥ª¥×¥·¥ç¥ó +.B SO_LINGER +¤Èº®Æ±¤·¤Ê¤¤¤³¤È¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B TCP_MAXSEG +.\" Present in Linux 1.0 +.\"O The maximum segment size for outgoing TCP packets. +.\"O If this option is set before connection establishment, it also +.\"O changes the MSS value announced to the other end in the initial packet. +.\"O Values greater than the (eventual) interface MTU have no effect. +.\"O TCP will also impose +.\"O its minimum and maximum bounds over the value provided. +Á÷½Ð TCP ¥Ñ¥±¥Ã¥È¤ÎºÇÂ祻¥°¥á¥ó¥È¥µ¥¤¥º¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÀܳ³ÎΩ¤ÎÁ°¤ËÀßÄꤹ¤ë¤È¡¢ +½é´ü¥Ñ¥±¥Ã¥È¤Ç¾ü¤Ë¥¢¥Ê¥¦¥ó¥¹¤¹¤ë MSS ¤ÎÃͤâÊѲ½¤¹¤ë¡£ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î MTU ¤è¤ê¤âÂ礭¤Ê (¤¢¤ë¤¤¤ÏÂ礭¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿) +Ãͤϸú²Ì¤ò»ý¤¿¤Ê¤¤¡£ +¤Þ¤¿ TCP ¤Ï¡¢¤³¤ÎÃͤè¤ê¤âºÇ¾®¡¦ºÇÂç¤ÎÀ©¸Â¤ÎÊý¤òÍ¥À褹¤ë¡£ +.\" FIXME +.\" Document TCP_MD5SIG, added in Linux 2.6.20, +.\" Needs CONFIG_TCP_MD5SIG +.\" From net/inet/Kconfig +.\" bool "TCP: MD5 Signature Option support (RFC2385) (EXPERIMENTAL)" +.\" RFC2385 specifies a method of giving MD5 protection to TCP sessions. +.\" Its main (only?) use is to protect BGP sessions between core routers +.\" on the Internet. +.\" +.\" There is a TCP_MD5SIG option documented in FreeBSD's tcp(4), +.\" but probably many details are different on Linux +.\" Authors were yoshfuji@linux-ipv6.org and Dave Muller +.\" http://thread.gmane.org/gmane.linux.network/47490 +.\" http://www.daemon-systems.org/man/tcp.4.html +.\" http://article.gmane.org/gmane.os.netbsd.devel.network/3767/match=tcp_md5sig+freebsd +.TP +.B TCP_NODELAY +.\" Present in Linux 1.0 +.\"O If set, disable the Nagle algorithm. +.\"O This means that segments +.\"O are always sent as soon as possible, even if there is only a +.\"O small amount of data. +.\"O When not set, data is buffered until there +.\"O is a sufficient amount to send out, thereby avoiding the +.\"O frequent sending of small packets, which results in poor +.\"O utilization of the network. +.\"O This option is overridden by +.\"O .BR TCP_CORK ; +.\"O however, setting this option forces an explicit flush of +.\"O pending output, even if +.\"O .B TCP_CORK +.\"O is currently set. +ÀßÄꤹ¤ë¤È Nagle ¥¢¥ë¥´¥ê¥º¥à¤ò̵¸ú¤Ë¤¹¤ë¡£ +¤¹¤Ê¤ï¤Á¡¢¥Ç¡¼¥¿Î̤¬¾¯¤Ê¤¤¾ì¹ç¤Ç¤â +³Æ¥»¥°¥á¥ó¥È¤Ï²Äǽ¤Ê¸Â¤êÁ᤯Á÷¿®¤µ¤ì¤ë¡£ +ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢ +Á÷¿®¤¹¤ëʬ¤À¤±Î¯¤Þ¤ë¤Þ¤Ç¥Ç¡¼¥¿¤Ï¥Ð¥Ã¥Õ¥¡¤µ¤ì¡¢ +¾®¤µ¤Ê¥Ñ¥±¥Ã¥È¤òÉÑÈˤËÁ÷¤é¤º¤Ë¤¹¤ß¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¤òÍ­¸ú¤ËÍøÍѤǤ­¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B TCP_CORK +¤Ë¤è¤ê¾å½ñ¤­¤µ¤ì¤ë¡£¤·¤«¤·¤Ê¤¬¤é¡¢ +.B TCP_CORK +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¤È¡¢ +Á÷¿®ÂÔ¤Á¤Î½ÐÎϤòÌÀ¼¨Åª¤ËÁݤ­½Ð¤¹ (flush) ¤³¤È¤Ë¤Ê¤ë¡£ +.TP +.\"O .BR TCP_QUICKACK " (since Linux 2.4.4)" +.BR TCP_QUICKACK " (Linux 2.4.4 °Ê¹ß)" +.\"O Enable quickack mode if set or disable quickack +.\"O mode if cleared. +.\"O In quickack mode, acks are sent +.\"O immediately, rather than delayed if needed in accordance +.\"O to normal TCP operation. +.\"O This flag is not permanent, +.\"O it only enables a switch to or from quickack mode. +.\"O Subsequent operation of the TCP protocol will +.\"O once again enter/leave quickack mode depending on +.\"O internal protocol processing and factors such as +.\"O delayed ack timeouts occurring and data transfer. +.\"O This option should not be used in code intended to be +.\"O portable. +ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È quickack ¥â¡¼¥É¤òÍ­¸ú¤Ë¤·¡¢¥¯¥ê¥¢¤µ¤ì¤ë¤È̵¸ú¤Ë¤¹¤ë¡£ +Ä̾ï¤Î TCP Æ°ºî¤Ç¤Ï ack ¤ÏɬÍפ˱þ¤¸¤ÆÃٱ䤵¤ì¤ë¤Î¤ËÂФ·¡¢ +quickack ¥â¡¼¥É¤Ç¤Ï ack ¤Ï¤¹¤°¤ËÁ÷¿®¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï±Ê³Ū¤Ê¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +quickack ¥â¡¼¥É¤«¤é/¥â¡¼¥É¤ØÀÚ¤êÂؤ¨¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤ì°Ê¹ß¤Î TCP ¥×¥í¥È¥³¥ë¤ÎÆ°ºî¤Ë¤è¤Ã¤Æ¤Ï¡¢ +ÆâÉô¤Î¥×¥í¥È¥³¥ë½èÍý¤ä¡¢ÃÙ±ä ack ¥¿¥¤¥à¥¢¥¦¥È¤ÎȯÀ¸¡¢ +¥Ç¡¼¥¿Å¾Á÷¤Ê¤É¤ÎÍ×°ø¤Ë¤è¤Ã¤Æ¡¢ +ºÆ¤Ó quickack ¤«¤é½Ð¤¿¤êÆþ¤Ã¤¿¤ê¤¹¤ë¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.\"O .BR TCP_SYNCNT " (since Linux 2.4)" +.BR TCP_SYNCNT " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.18 +.\"O Set the number of SYN retransmits that TCP should send before +.\"O aborting the attempt to connect. +.\"O It cannot exceed 255. +.\"O This option should not be used in code intended to be portable. +Àܳ¤Î»î¹Ô¤òÃæ»ß¤µ¤»¤ëÁ°¤Ë TCP ¤¬Á÷¤ë SYN ºÆÁ÷¿ô¤òÀßÄꤹ¤ë¡£ +¤³¤ì¤Ï 255 ¤è¤êÂ礭¤¯¤Ï¤Ç¤­¤Ê¤¤¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.\"O .BR TCP_WINDOW_CLAMP " (since Linux 2.4)" +.BR TCP_WINDOW_CLAMP " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.41 +.\"O Bound the size of the advertised window to this value. +.\"O The kernel imposes a minimum size of SOCK_MIN_RCVBUF/2. +.\"O This option should not be used in code intended to be +.\"O portable. +¹­Ê󤹤륦¥£¥ó¥É¥¦¤Î¥µ¥¤¥º¤ò¤³¤ÎÃͤ˸ÇÄꤹ¤ë¡£ +¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤ÆºÇ¾®¥µ¥¤¥º¤Ï SOCK_MIN_RCVBUF/2 ¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï°Ü¿¢À­¤ÎɬÍפʥ³¡¼¥É¤Ç¤ÏÍѤ¤¤ë¤Ù¤­¤Ç¤Ê¤¤¡£ +.\"O .SS Sockets API +.SS ¥½¥±¥Ã¥È API +.\"O TCP provides limited support for out-of-band data, +.\"O in the form of (a single byte of) urgent data. +.\"O In Linux this means if the other end sends newer out-of-band +.\"O data the older urgent data is inserted as normal data into +.\"O the stream (even when +.\"O .B SO_OOBINLINE +.\"O is not set). +.\"O This differs from BSD-based stacks. +TCP ¤ÏÂÓ°è³°¥Ç¡¼¥¿ (out-of-band data) ¤ò¸ÂÄêŪ¤Ë¥µ¥Ý¡¼¥È¤·¤Æ¤ª¤ê¡¢ +(1 ¥Ð¥¤¥È¤Î) ¶ÛµÞ¥Ç¡¼¥¿¤È¤¤¤¦·Á¤Ç¤¢¤ë¡£ +¤Ä¤Þ¤ê Linux ¤Ë¤ª¤¤¤Æ¤Ï¡¢ +ÀܳÀ褬 (¿·¤·¤¤¤ä¤êÊý¤Î) ÂÓ°è³°¥Ç¡¼¥¿¤òÁ÷¤Ã¤Æ¤­¤¿¾ì¹ç¡¢ +(¸Å¤¤¤ä¤êÊý¤Î) +¶ÛµÞ¥Ç¡¼¥¿¤ÏÄ̾ï¤Î¥Ç¡¼¥¿¤È¤·¤Æ¥¹¥È¥ê¡¼¥à¤ËÁÞÆþ¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë (¤³¤ì¤Ï +.B SO_OOBINLINE +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ç¤âƱÍͤǤ¢¤ë)¡£ +¤³¤ì¤Ï BSD ¥Ù¡¼¥¹¤Î¥¹¥¿¥Ã¥¯¤È¤Ï°Û¤Ê¤ë¡£ +.PP +.\"O Linux uses the BSD compatible interpretation of the urgent +.\"O pointer field by default. +.\"O This violates RFC\ 1122, but is +.\"O required for interoperability with other stacks. +.\"O It can be changed via +.\"O .IR /proc/sys/net/ipv4/tcp_stdurg . +Linux ¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï urgent ¥Ý¥¤¥ó¥¿¥Õ¥£¡¼¥ë¥É¤Î²ò¼á¤Ë +BSD ¸ß´¹¤ÎÊýË¡¤òÍѤ¤¤ë¡£¤³¤ì¤Ï RFC\ 1122 ¤ËÈ¿¤·¤Æ¤¤¤ë¤¬¡¢ +¾¤Î¥¹¥¿¥Ã¥¯¤ÈƱ»þ¤ËÆ°ºî¤µ¤»¤ë¤Ë¤Ï¤ä¤à¤òÆÀ¤Ê¤¤¡£¤³¤ì¤Ï +.I /proc/sys/net/ipv4/tcp_stdurg +¤Ë¤è¤Ã¤ÆÊѹ¹¤Ç¤­¤ë¡£ + +.\"O It is possible to peek at out-of-band data using the +.\"O .IR recv (2) +.\"O .B MSG_PEEK +.\"O flag. +.BR recv (2) +¤Î +.B MSG_PEEK +¥Õ¥é¥°¤ò»È¤¦¤È¡¢ÂÓ°è³°¥Ç¡¼¥¿¤òÇÁ¤­¸«¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.\"O Since version 2.4, Linux supports the use of +.\"O .B MSG_TRUNC +.\"O in the +.\"O .I flags +.\"O argument of +.\"O .BR recv (2) +.\"O (and +.\"O .BR recvmsg (2)). +Linux 2.4 °Ê¹ß¤Ç¤Ï¡¢ +.BR recv (2) +(¤ä +.BR recvmsg (2)) +¤Î +.I flags +°ú¤­¿ô¤Ë +.B MSG_TRUNC +¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O This flag causes the received bytes of data to be discarded, +.\"O rather than passed back in a caller-supplied buffer. +.\"O Since Linux 2.4.4, +.\"O .BR MSG_PEEK +.\"O also has this effect when used in conjunction with +.\"O .BR MSG_OOB +.\"O to receive out-of-band data. +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢¼õ¿®¥Ç¡¼¥¿¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤«¤éÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡ +¤Ë¥³¥Ô¡¼¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ÇÑ´þ¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +Linux 2.4.4 °Ê¹ß¤Ç¤Ï¡¢ +.B MSG_PEEK +¤ò¡¢ÂÓ°è³°¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ë¤¿¤á¤Î +.B MSG_OOB +¤ÈÁȤ߹ç¤ï¤»¤Æ»È¤Ã¤¿¾ì¹ç¤Ë¤â¡¢¤³¤ì¤ÈƱ¤¸¸ú²Ì¤ò»ý¤Ä¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\"O .SS Ioctlsl +.SS ioctl +.\"O These following +.\"O .BR ioctl (2) +.\"O calls return information in +.\"O .IR value . +.\"O The correct syntax is: +°Ê²¼¤Î +.BR ioctl (2) +¸Æ¤Ó½Ð¤·¤Ï +.I value +¤Ë¾ðÊó¤òÆþ¤ì¤ÆÊÖ¤¹¡£ +Àµ¤·¤¤½ñ¼°¤Ï°Ê²¼¤ÎÄ̤ꡣ +.PP +.RS +.nf +.BI int " value"; +.IB error " = ioctl(" tcp_socket ", " ioctl_type ", &" value ");" +.fi +.RE +.PP +.\"O .I ioctl_type +.\"O is one of the following: +.I ioctl_type +¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«°ì¤Ä¤Ç¤¢¤ë: +.TP +.B SIOCINQ +.\"O Returns the amount of queued unread data in the receive buffer. +.\"O The socket must not be in LISTEN state, otherwise an error +.\"O .RB ( EINVAL ) +.\"O is returned. +¼õ¿®¥Ð¥Ã¥Õ¥¡¤Î¥­¥å¡¼¤Ë¤¢¤ë¡¢¤Þ¤ÀÆɤó¤Ç¤¤¤Ê¤¤¥Ç¡¼¥¿¤ÎÎ̤òÊÖ¤¹¡£ +¥½¥±¥Ã¥È¤Ï LISTEN ¾õÂ֤ˤ¢¤Ã¤Æ¤Ï¤Ê¤é¤º¡¢ +¤µ¤â¤Ê¤¤¤È¥¨¥é¡¼ +.RB ( EINVAL ) +¤¬Ê֤롣 +.TP +.B SIOCATMARK +.\"O Returns true (i.e., +.\"O .I value +.\"O is nonzero) if the inbound data stream is at the urgent mark. +¼õ¿®¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥à¤¬¶ÛµÞ¥Þ¡¼¥¯¤Î°ÌÃ֤Ǥ¢¤ì¤Ð¡¢¿¿¤òÊÖ¤¹ (¤Ä¤Þ¤ê +.I value +¤¬ 0 °Ê³°)¡£ +.sp +.\"O If the +.\"O .B SO_OOBINLINE +.\"O socket option is set, and +.\"O .B SIOCATMARK +.\"O returns true, then the +.\"O next read from the socket will return the urgent data. +.\"O If the +.\"O .B SO_OOBINLINE +.\"O socket option is not set, and +.\"O .B SIOCATMARK +.\"O returns true, then the +.\"O next read from the socket will return the bytes following +.\"O the urgent data (to actually read the urgent data requires the +.\"O .B recv(MSG_OOB) +.\"O flag). +.B SO_OOBINLINE +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.B SIOCATMARK +¤¬¿¿¤òÊÖ¤·¤¿¾ì¹ç¡¢¼¡¤Î¥½¥±¥Ã¥È¤«¤é¤ÎÆɤ߹þ¤ß¤Ç¤Ï¶ÛµÞ¥Ç¡¼¥¿¤¬ +ÊÖ¤µ¤ì¤ë¡£ +.B SO_OOBINLINE +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Æ¤ª¤é¤º¡¢ +.B SIOCATMARK +¤¬¿¿¤òÊÖ¤·¤¿¾ì¹ç¡¢¼¡¤Î¥½¥±¥Ã¥È¤«¤é¤ÎÆɤ߹þ¤ß¤Ç¤Ï¶ÛµÞ¥Ç¡¼¥¿¤Ë +³¤¯¥Ç¡¼¥¿¤¬ÊÖ¤µ¤ì¤ë (¼ÂºÝ¤Ë¶ÛµÞ¥Ç¡¼¥¿¤òÆɤ߹þ¤à¤Ë¤Ï +.B recv(MSG_OOB) +¤È¥Õ¥é¥°¤ò¤Ä¤±¤ëɬÍפ¬¤¢¤ë)¡£ + +.\"O Note that a read never reads across the urgent mark. +.\"O If an application is informed of the presence of urgent data via +.\"O .BR select (2) +.\"O (using the +.\"O .I exceptfds +.\"O argument) or through delivery of a +.\"O .B SIGURG +.\"O signal, +.\"O then it can advance up to the mark using a loop which repeatedly tests +.\"O .B SIOCATMARK +.\"O and performs a read (requesting any number of bytes) as long as +.\"O .B SIOCATMARK +.\"O returns false. +¥Ç¡¼¥¿¤Î°ì²ó¤ÎÆɤ߹þ¤ß¤Ç¤Ï¶ÛµÞ¥Þ¡¼¥¯¤ò¸Ù¤¬¤Ã¤Æ¤ÎÆɤ߹þ¤ß¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¶ÛµÞ¥Ç¡¼¥¿¤Î¸ºß¤ò +.RI ( exceptfds +°ú¤­¿ô¤ò»È¤Ã¤Æ) +.BR select (2) +·Ðͳ¤Þ¤¿¤Ï +.B SIGURG +¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤òÄ̤¸¤ÆÃΤ餵¤ì¤¿¾ì¹ç¡¢ +.B SIOCATMARK +¤Î¥Á¥§¥Ã¥¯¤ÈÆɤ߹þ¤ß (²¿¥Ð¥¤¥ÈÆɤ߹þ¤ßÍ×µá¤ò¤·¤Æ¤â¤è¤¤) ¤ò +.B SIOCATMARK +¤¬µ¶¤òÊÖ¤µ¤Ê¤¯¤Ê¤ë¤Þ¤Ç·«¤êÊÖ¤·¹Ô¤¦¤³¤È¤Ç¡¢¶ÛµÞ¥Þ¡¼¥¯¤Î°ÌÃÖ¤Þ¤Ç +Æɤ߿ʤá¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B SIOCOUTQ +.\"O Returns the amount of unsent data in the socket send queue. +.\"O The socket must not be in LISTEN state, otherwise an error +.\"O .RB ( EINVAL ) +.\"O is returned. +¥½¥±¥Ã¥È¤ÎÁ÷¿®¥­¥å¡¼¤Ë»Ä¤Ã¤Æ¤¤¤ë̤Á÷¿®¥Ç¡¼¥¿¤ÎÎ̤òÊÖ¤¹¡£ +¥½¥±¥Ã¥È¤Ï LISTEN ¾õÂ֤ˤ¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +LISTEN ¾õÂ֤ξì¹ç¤Ë¤Ï¥¨¥é¡¼ +.RB ( EINVAL ) +¤È¤Ê¤ë¡£ +.\"O .SS Error Handling +.SS ¥¨¥é¡¼½èÍý +.\"O When a network error occurs, TCP tries to resend the packet. +.\"O If it doesn't succeed after some time, either +.\"O .B ETIMEDOUT +.\"O or the last received error on this connection is reported. +¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥é¡¼¤¬µ¯¤³¤ë¤È¡¢ TCP ¤Ï¥Ñ¥±¥Ã¥È¤ÎºÆÁ÷¤ò»î¤ß¤ë¡£ +²¿²ó¤«¤ä¤Ã¤Æ¤âÀ®¸ù¤·¤Ê¤±¤ì¤Ð¡¢¤³¤ÎÀܳ¤ËÂФ·¤Æ +.B ETIMEOUT +¥¨¥é¡¼¤«ºÇ¸å¤Ë¼õ¿®¤·¤¿¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.\"O Some applications require a quicker error notification. +.\"O This can be enabled with the +.\"O .B IPPROTO_IP +.\"O level +.\"O .B IP_RECVERR +.\"O socket option. +.\"O When this option is enabled, all incoming +.\"O errors are immediately passed to the user program. +.\"O Use this option with care \(em it makes TCP less tolerant to routing +.\"O changes and other normal network conditions. +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï¡¢¤â¤Ã¤ÈÁ᤯¥¨¥é¡¼¤òÃΤ餻¤Æ¤Û¤·¤¤¾ì¹ç¤¬¤¢¤ë¡£ +¤³¤ì¤Ë¤Ï +.B IPPROTO_IP +¥ì¥Ù¥ë¤Î +.B IP_RECVERR +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤ÈÎɤ¤¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +ÅþÃ夷¤¿¥¨¥é¡¼¤Ï¤¹¤Ù¤Æ¤¿¤À¤Á¤Ë¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤ËÅϤµ¤ì¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¿µ½Å¤ËÍѤ¤¤ë¤³¤È \(em ¥ë¡¼¥Æ¥£¥ó¥°¤ÎÊѹ¹¤Ê¤É¡¢ +Ä̾濫¤ê¤¦¤ë¥Í¥Ã¥È¥ï¡¼¥¯¾õÂÖ¤ËÂФ·¤Æ TCP ¤ò¤è¤êÀȼå¤Ë¤·¤Æ¤·¤Þ¤¦¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EAFNOTSUPPORT +.\"O Passed socket address type in +.\"O .I sin_family +.\"O was not +.\"O .BR AF_INET . +.I sin_family +¤ËÅϤµ¤ì¤¿¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Î¥¿¥¤¥×¤¬ +.B AF_INET +¤Ç¤Ï¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPIPE +.\"O The other end closed the socket unexpectedly or a read is +.\"O executed on a shut down socket. +ÀܳÀ褬ͽ´ü¤·¤Ê¤«¤Ã¤¿¤«¤¿¤Á¤Ç¥½¥±¥Ã¥È¤ò¥¯¥í¡¼¥º¤·¤¿¡£ +¤Þ¤¿¤Ï¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤¿¥½¥±¥Ã¥È¤ËÆɤ߹þ¤ß¤¬¼Â¹Ô¤µ¤ì¤¿¡£ +.TP +.B ETIMEDOUT +.\"O The other end didn't acknowledge retransmitted data after some time. +ÀܳÀ褬¡¢²¿²ó¤«¥Ç¡¼¥¿¤òºÆÁ÷¤·¤Æ¤âÈ¿±þ¤·¤Ê¤¤¡£ +.PP +.\"O Any errors defined for +.\"O .BR ip (7) +.\"O or the generic socket layer may also be returned for TCP. +.BR ip (7) +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤ä¡¢¥¸¥§¥Í¥ê¥Ã¥¯¤Ê¥½¥±¥Ã¥ÈÁؤˤª¤±¤ë¥¨¥é¡¼¤â +TCP ¤ËÊÖ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O Support for Explicit Congestion Notification, zero-copy +.\"O .BR sendfile (2), +.\"O reordering support and some SACK extensions +.\"O (DSACK) were introduced in 2.4. +.\"O Support for forward acknowledgement (FACK), TIME_WAIT recycling, +.\"O and per-connection keepalive socket options were introduced in 2.3. +Explicit Congestion Notification¡¢zero-copy ¤Î +.BR sendfile (2)¡¢ +ʤÓÂؤ¨¤Î¥µ¥Ý¡¼¥È¡¢SACK ³ÈÄ¥ (DSACK) ¤Ê¤É¤Î¥µ¥Ý¡¼¥È¤Ï +2.4 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +¥Õ¥©¥ï¡¼¥É³Îǧ (FACK)¡¢TIME_WAIT ¥ê¥µ¥¤¥¯¥ë¡¢Àܳ¤´¤È¤Î keepalive +¤ËÂФ¹¤ë¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ï 2.3 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Not all errors are documented. +¤Þ¤ÀÀâÌÀ¤µ¤ì¤Æ¤¤¤Ê¤¤¥¨¥é¡¼¤¬¤¢¤ë¡£ +.br +.\"O IPv6 is not described. +IPv6 ¤Ë´Ø¤¹¤ëµ­½Ò¤¬¤Ê¤¤¡£ +.\" Only a single Linux kernel version is described +.\" Info for 2.2 was lost. Should be added again, +.\" or put into a separate page. +.\"O .SH .\" AUTHORS +.\" .SH Ãø¼Ô +.\"O .\" This man page was originally written by Andi Kleen. +.\"O .\" It was updated for 2.4 by Nivedita Singhvi with input from +.\"O .\" Alexey Kuznetsov's Documentation/networking/ip-sysctl.txt +.\"O .\" document. +.\" ¤³¤Î man ¥Ú¡¼¥¸¤ÏºÇ½é Andi Kleen ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ +.\" Alexey Kuznetsov ¤Îʸ½ñ Documentation/networking/ip-sysctl.txt +.\" ¤Î¾ðÊó¤ò¸µ¤Ë¡¢Nivedita Singhvi ¤¬ 2.4 ¸þ¤±¤Ë¹¹¿·¤·¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR accept (2), +.BR bind (2), +.BR connect (2), +.BR getsockopt (2), +.BR listen (2), +.BR recvmsg (2), +.BR sendfile (2), +.BR sendmsg (2), +.BR socket (2), +.BR ip (7), +.BR socket (7) +.sp +.\"O RFC\ 793 for the TCP specification. +RFC\ 793: TCP ¤Î»ÅÍÍ¡£ +.br +.\"O RFC\ 1122 for the TCP requirements and a description of the Nagle algorithm. +RFC\ 1122: TCP ¤ÎÍ×µá»ö¹à¤È Nagle ¥¢¥ë¥´¥ê¥º¥à¤Îµ­½Ò¡£ +.br +.\"O RFC\ 1323 for TCP timestamp and window scaling options. +RFC\ 1323: TCP ¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¡¦¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°³Æ¥ª¥×¥·¥ç¥ó¡£ +.br +.\"O RFC\ 1644 for a description of TIME_WAIT assassination hazards. +RFC\ 1644: TIME_WAIT assassination hazard ¤Ë´Ø¤¹¤ëµ­½Ò¡£ +.br +.\"O RFC\ 3168 for a description of Explicit Congestion Notification. +RFC\ 3168: Explicit Congestion Notification ¤Ë´Ø¤¹¤ëµ­½Ò¡£ +.br +.\"O RFC\ 2581 for TCP congestion control algorithms. +RFC\ 2581: TCP íÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¡£ +.br +.\"O RFC\ 2018 and RFC\ 2883 for SACK and extensions to SACK. +RFC\ 2018 ¤È RFC\ 2883: SACK ¤È¤½¤Î³ÈÄ¥¡£ diff --git a/draft/man7/termio.7 b/draft/man7/termio.7 new file mode 100644 index 00000000..19974d14 --- /dev/null +++ b/draft/man7/termio.7 @@ -0,0 +1,95 @@ +.\" Copyright (c) 2006 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. +.\" +.\" 28 Dec 2006 - Initial Creation +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-05-04, Akihiro MOTOKI , LDP v2.44 +.\" +.TH TERMIO 7 2006-12-28 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O termio \- the System V terminal driver interface +termio \- System V üËö¥É¥é¥¤¥Ð¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .B termio +.\"O is the name of the old System V terminal driver interface. +.\"O This interface defined a +.\"O .I termio +.\"O structure used to store terminal settings, and a range of +.\"O .BR ioctl (2) +.\"O operations to get and set terminal attributes. +.B termio +¤Ï¡¢¸Å¤¤ System V üËö¥É¥é¥¤¥Ð¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î̾Á°¤Ç¤¢¤ë¡£ +¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¡¢ +üËöÀßÄê¤òÊÝ»ý¤¹¤ë¤¿¤á¤Î +.I termio +¹½Â¤ÂΡ¢¤ª¤è¤ÓüËö°À­¤ò¼èÆÀ¡¦Êѹ¹¤¹¤ë¤¿¤á¤Î¼ï¡¹¤Î +.BR ioctl (2) +Áàºî¤òÄêµÁ¤·¤Æ¤¤¤¿¡£ + +.\"O The +.\"O .B termio +.\"O interface is now obsolete: POSIX.1-1990 standardized a modified +.\"O version of this interface, under the name +.\"O .BR termios . +.\"O The POSIX.1 data structure differs slightly from the +.\"O System V version, and POSIX.1 defined a suite of functions +.\"O to replace the various +.\"O .BR ioctl (2) +.\"O operations that existed in System V. +.\"O (This was done because +.\"O .BR ioctl (2) +.\"O was unstandardized, and its variadic third argument +.\"O does not allow argument type checking.) +.B termio +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¸½ºß¤Ç¤Ï»þÂåÃÙ¤ì¤Ç¤¢¤ë¡£ +POSIX.1-1990 ¤Ç¡¢¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î½¤ÀµÈǤ¬ +.B termios +¤È¤¤¤¦Ì¾Á°¤Çɸ½à²½¤µ¤ì¤¿¡£ +POSIX.1 ¤Î¥Ç¡¼¥¿¹½Â¤¤Ï System V ÈǤȾ¯¤·°ã¤¤¤¬¤¢¤ë¡£ +¤Þ¤¿¡¢POSIX.1 ¤Ï System V ÈǤǸºß¤·¤¿¼ï¡¹¤Î +.BR ioctl (2) +Áàºî¤òÃÖ¤­´¹¤¨¤ë´Ø¿ô·²¤òÄêµÁ¤·¤¿ +(¤³¤Î¤è¤¦¤Ë¤Ê¤Ã¤¿¤Î¤Ï¡¢ +.BR ioctl (2) +¤¬É¸½à²½¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤³¤È¤È¡¢ +.BR ioctl (2) +¤ÎÂè»°°ú¤­¿ô¤¬²ÄÊÑĹ°ú¤­¿ô¤Ç·¿¥Á¥§¥Ã¥¯¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¤Î¤¬Íýͳ¤Ç¤¢¤ë)¡£ + +.\"O If you're looking for page called "termio", then you can probably +.\"O find most of the information that you seek in either +.\"O .BR termios (3) +.\"O or +.\"O .BR tty_ioctl (4). +"termio" ¤È¤¤¤¦ man page ¤òõ¤·¤Æ¤¤¤ë¤Î¤Ç¤¢¤ì¤Ð¡¢ +õ¤·¤Æ¤¤¤ë¾ðÊó¤Î¤Û¤È¤ó¤É¤Ï +.BR termios (3) +¤« +.BR tty_ioctl (4) +¤Î¤É¤Á¤é¤«¤Ç¸«¤Ä¤«¤ë¤³¤È¤À¤í¤¦¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR termios (3), +.BR tty_ioctl (4) diff --git a/draft/man7/time.7 b/draft/man7/time.7 new file mode 100644 index 00000000..feeb82db --- /dev/null +++ b/draft/man7/time.7 @@ -0,0 +1,337 @@ +.\" Copyright (c) 2006 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. +.\" +.\" 2008-06-24, mtk: added some details about where jiffies come into +.\" play; added section on high-resolution timers. +.\" +.\" Japanese Version Copyright (c) 2006 Yuichi SATO +.\" all rights reserved. +.\" Translated 2006-07-23 by Yuichi SATO , LDP v2.36 +.\" Updated 2007-05-04, Akihiro MOTOKI , LDP v2.44 +.\" Updated 2008-08-10, Akihiro MOTOKI , LDP v3.05 +.\" +.TH TIME 7 2010-02-25 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O time \- overview of time and timers +time \- »þ´Ö¤È¥¿¥¤¥Þ¤Î³µÍ× +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .SS "Real time and process time" +.SS "¼Â»þ´Ö (real time) ¤È¥×¥í¥»¥¹»þ´Ö" +.\"O .I "Real time" +.\"O is defined as time measured from some fixed point, +.\"O either from a standard point in the past +.\"O (see the description of the Epoch and calendar time below), +.\"O or from some point (e.g., the start) in the life of a process +.\"O .RI ( "elapsed time" ). +\fI¼Â»þ´Ö\fR¤Ï¡¢ÆÃÄê¤Î»þÅÀ¤«¤é·×¤Ã¤¿»þ´Ö¤ÈÄêµÁ¤µ¤ì¤ë¡£ +ÆÃÄê¤Î»þÅÀ¤È¤Ï¡¢²áµî¤Îɸ½àŪ¤Ê»þÅÀ +(²¼µ­¤Îµª¸µ (Epoch) ¤È¥«¥ì¥ó¥À»þ¹ï¤ÎÀâÌÀ¤ò»²¾È) ¤ä¡¢ +¥×¥í¥»¥¹¤Î°ìÀ¸¤Ë¤ª¤±¤ë²¿¤é¤«¤Î»þÅÀ (Î㤨¤Ð¡¢³«»Ï»þ) ¤Ç¤¢¤ë +.RI ( "·Ð²á»þ´Ö" )¡£ + +.\"O .I "Process time" +.\"O is defined as the amount of CPU time used by a process. +.\"O This is sometimes divided into +.\"O .I user +.\"O and +.\"O .I system +.\"O components. +\fI¥×¥í¥»¥¹»þ´Ö\fR¤Ï¡¢¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ»È¤ï¤ì¤¿Áí CPU »þ´Ö¤ÈÄêµÁ¤µ¤ì¤ë¡£ +¿¤¯¤Î¾ì¹ç¡¢\fI¥æ¡¼¥¶\fR»þ´Ö¤È\fI¥·¥¹¥Æ¥à\fR»þ´Ö¤Ëʬ¤±¤é¤ì¤ë¡£ +.\"O User CPU time is the time spent executing code in user mode. +.\"O System CPU time is the time spent by the kernel executing +.\"O in system mode on behalf of the process (e.g., executing system calls). +¥æ¡¼¥¶ CPU »þ´Ö¤Ï¡¢¥³¡¼¥É¤ò¥æ¡¼¥¶¥â¡¼¥É¤Ç¼Â¹Ô¤¹¤ë¤Î¤Ë»È¤Ã¤¿»þ´Ö¤Ç¤¢¤ë¡£ +¥·¥¹¥Æ¥à CPU »þ´Ö¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¤¿¤á¤Ë +¥«¡¼¥Í¥ë¤¬¥·¥¹¥Æ¥à¥â¡¼¥É¤Ç¼Â¹Ô¤¹¤ë¤Î¤Ë»È¤Ã¤¿»þ´Ö¤Ç¤¢¤ë +(Î㤨¤Ð¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¼Â¹Ô¤¹¤ë¤Î¤Ë»È¤Ã¤¿»þ´Ö)¡£ +.\"O The +.\"O .BR time (1) +.\"O command can be used to determine the amount of CPU time consumed +.\"O during the execution of a program. +.BR time (1) +¥³¥Þ¥ó¥É¤Ï¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤ËÈñ¤µ¤ì¤¿Áí CPU »þ´Ö¤ò·×¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +.\"O A program can determine the amount of CPU time it has consumed using +.\"O .BR times (2), +.\"O .BR getrusage (2), +.\"O or +.\"O .BR clock (3). +¥×¥í¥°¥é¥à¤Ï¡¢¼«¿È¤¬Èñ¤·¤¿Áí CPU »þ´Ö¤ò +.BR times (2), +.BR getrusage (2), +.BR clock (3) +¤ò»È¤Ã¤Æ·×¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O .SS "The Hardware Clock" +.SS ¥Ï¡¼¥É¥¦¥§¥¢¥¯¥í¥Ã¥¯ +.\"O Most computers have a (battery-powered) hardware clock which the kernel +.\"O reads at boot time in order to initialize the software clock. +¿¤¯¤Î¥³¥ó¥Ô¥å¡¼¥¿¤¬ (ÅÅÃӤǶîÆ°¤µ¤ì¤ë) ¥Ï¡¼¥É¥¦¥§¥¢¥¯¥í¥Ã¥¯¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë¤Ïµ¯Æ°»þ¤Ë¥½¥Õ¥È¥¦¥§¥¢¥¯¥í¥Ã¥¯¤ò½é´ü²½¤¹¤ë¤¿¤á¤Ë +¥Ï¡¼¥É¥¦¥§¥¢¥¯¥í¥Ã¥¯¤òÆɤ߹þ¤à¡£ +.\"O For further details, see +.\"O .BR rtc (4) +.\"O and +.\"O .BR hwclock (8). +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¡¢ +.BR rtc (4) +¤È +.BR hwclock (8) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SS "The Software Clock, HZ, and Jiffies" +.\"Osato: °Ê²¼¤Ç¤Ï jiffies ¤Ïñ¿ô·Á jiffy ¤ËÅý°ì¤·¤Æ¤¤¤ë¡£ +.SS "¥½¥Õ¥È¥¦¥§¥¢¥¯¥í¥Ã¥¯, HZ, Jiffy" +.\"O The accuracy of various system calls that set timeouts, +.\"O (e.g., +.\"O .BR select (2), +.\"O .BR sigtimedwait (2)) +.\"O .\" semtimedop(), mq_timedwait(), io_getevents(), poll() are the same +.\"O .\" futexes and thus sem_timedwait() seem to use high-res timers. +.\"O and measure CPU time (e.g., +.\"O .BR getrusage (2)) +.\"O is limited by the resolution of the +.\"O .IR "software clock" , +.\"O a clock maintained by the kernel which measures time in +.\"O .IR jiffies . +.\"O The size of a jiffy is determined by the value of the kernel constant +.\"O .IR HZ . +¥¿¥¤¥à¥¢¥¦¥È¤òÀßÄꤷ¤¿¤ê (Î㤨¤Ð +.BR select (2), +.BR sigtimedwait (2))¡¢ +.\" semtimedop(), mq_timedwait(), io_getevents(), poll() ¤ÏƱ¤¸ futex ¤Ç¤¢¤ê¡¢ +.\" ¤·¤¿¤¬¤Ã¤Ã¤Æ sem_timedwait() ¤Ï¹âÀºÅÙ¥¿¥¤¥Þ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤è¤¦¤Ç¤¢¤ë¡£ +CPU »þ´Ö¤ò·×¬¤·¤¿¤ê (Î㤨¤Ð +.BR getrusage (2)) ¤¹¤ëÍÍ¡¹¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀºÅÙ¤Ï +.I ¥½¥Õ¥È¥¦¥§¥¢¥¯¥í¥Ã¥¯ +¤Îʬ²òǽ (resolution) ¤ËÀ©¸Â¤µ¤ì¤ë¡£ +¥½¥Õ¥È¥¦¥§¥¢¥¯¥í¥Ã¥¯¤È¤Ï¡¢¥«¡¼¥Í¥ë¤¬´ÉÍý¤¹¤ë +.I jiffy +ñ°Ì¤Ç»þ´Ö¤ò·×¬¤¹¤ë¥¯¥í¥Ã¥¯¤Î¤³¤È¤Ç¤¢¤ë¡£ +jiffy ¤ÎÂ礭¤µ¤Ï¥«¡¼¥Í¥ëÄê¿ô +.I HZ +¤ÎÃͤǷèÄꤵ¤ì¤ë¡£ + +.\"O The value of +.\"O .I HZ +.\"O varies across kernel versions and hardware platforms. +.I HZ +¤ÎÃͤϥ«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤È¥Ï¡¼¥É¥¦¥§¥¢¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç°Û¤Ê¤ë¡£ +.\"O On i386 the situation is as follows: +.\"O on kernels up to and including 2.4.x, HZ was 100, +.\"O giving a jiffy value of 0.01 seconds; +.\"O starting with 2.6.0, HZ was raised to 1000, giving a jiffy of +.\"O 0.001 seconds. +.\"O Since kernel 2.6.13, the HZ value is a kernel +.\"O configuration parameter and can be 100, 250 (the default) or 1000, +.\"O yielding a jiffies value of, respectively, 0.01, 0.004, or 0.001 seconds. +i386 ¤Î¾ì¹ç¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +2.4.x ¤È¤½¤ì¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢HZ ¤Ï 100 ¤Ç¤¢¤Ã¤¿¤Î¤Ç¡¢ +jiffy ¤ÎÃÍ¤Ï 0.01 ÉäˤʤäƤ¤¤¿¡£ +2.6.0 °Ê¹ß¤Ç¤Ï¡¢HZ ¤Ï 1000 ¤ËÁý¤ä¤µ¤ì¤¿¤Î¤Ç¡¢jiffy ¤ÎÃÍ¤Ï 0.001 ÉäǤ¢¤ë¡£ +¥«¡¼¥Í¥ë 2.6.13 °Ê¹ß¤Ç¤Ï¡¢HZ ¤ÎÃͤϥ«¡¼¥Í¥ëÀßÄê¥Ñ¥é¥á¡¼¥¿¤Ë¤Ê¤ê¡¢ +100, 250 (¥Ç¥Õ¥©¥ë¥È), 1000 ¤È¤¤¤¦ÃͤˤǤ­¤ë¡£ +¤½¤ì¤¾¤ì jiffy ¤ÎÃÍ¤Ï 0.01, 0.004, 0.001 Éäˤʤ롣 +.\"O Since kernel 2.6.20, a further frequency is available: +.\"O 300, a number that divides evenly for the common video +.\"O frame rates (PAL, 25 HZ; NTSC, 30 HZ). +¥«¡¼¥Í¥ë 2.6.20 °Ê¹ß¤Ç¤Ï¡¢300 ¤âÍøÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +300 ¤Ï°ìÈÌŪ¤Ê±ÇÁü¥Õ¥ì¡¼¥à¥ì¡¼¥È¤Î¸øÇÜ¿ô¤Ç¤¢¤ë (PAL, 25HZ; NTSC, 30HZ)¡£ + +.\"O The +.\"O .BR times (2) +.\"O system call is a special case. +.\"O It reports times with a granularity defined by the kernel constant +.\"O .IR USER_HZ . +.\"O Userspace applications can determine the value of this constant using +.\"O .IR sysconf(_SC_CLK_TCK) . +.BR times (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÆüì¤Ê¥±¡¼¥¹¤Ç¤¢¤ê¡¢ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ëÄê¿ô +.I USER_HZ +¤ÇÄêµÁ¤µ¤ì¤¿Î³Å٤ǻþ´Ö¤òÊó¹ð¤¹¤ë¡£ +¥æ¡¼¥¶¶õ´Ö¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï +.I sysconf(_SC_CLK_TCK) +¤ò»È¤Ã¤Æ¤³¤ÎÄê¿ô¤ÎÃͤòÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.\" glibc gets this info with a little help from the ELF loader; +.\" see glibc elf/dl-support.c and kernel fs/binfmt_elf.c. +.\" +.\"O .SS "High-Resolution Timers" +.SS "¹âÀºÅÙ¥¿¥¤¥Þ" +.\"O Before Linux 2.6.21, the accuracy of timer and sleep system calls +.\"O (see below) was also limited by the size of the jiffy. +Linux 2.6.21 ¤è¤êÁ°¤Ç¤Ï¡¢¥¿¥¤¥Þ¤ä¥¹¥ê¡¼¥×´ØÏ¢¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀºÅÙ¤â +jiffy ¤Î¥µ¥¤¥º¤Ë¤è¤êÀ©¸Â¤µ¤ì¤Æ¤¤¤¿¡£ + +.\"O Since Linux 2.6.21, Linux supports high-resolution timers (HRTs), +.\"O optionally configurable via +.\"O .BR CONFIG_HIGH_RES_TIMERS . +.\"O On a system that supports HRTs, the accuracy of sleep and timer +.\"O system calls is no longer constrained by the jiffy, +.\"O but instead can be as accurate as the hardware allows +.\"O (microsecond accuracy is typical of modern hardware). +.\"O You can determine whether high-resolution timers are supported by +.\"O checking the resolution returned by a call to +.\"O .BR clock_getres (2) +.\"O or looking at the "resolution" entries in +.\"O .IR /proc/timer_list . +Linux 2.6.21 °Ê¹ß¤Ç¤Ï¡¢Linux ¤Ï¹âÀºÅÙ¥¿¥¤¥Þ (high-resolution timers; HRTs) +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤ª¤ê¡¢ +.B CONFIG_HIGH_RES_TIMERS +¤ÇÀ©¸æ¤Ç¤­¤ë¡£ +¹âÀºÅÙ¥¿¥¤¥Þ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥¿¥¤¥Þ¤È¥¹¥ê¡¼¥×´ØÏ¢¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë +¤ÎÀºÅ٤Ϥâ¤Ï¤ä jiffy ¤ËÀ©Ì󤵤ì¤ë¤³¤È¤Ï¤Ê¤¯¡¢ +¥Ï¡¼¥É¥¦¥§¥¢¤¬µö¤¹¸Â¤ê¤ÎÀºÅ٤Ȥʤë +(ºÇ¶á¤Î¥Ï¡¼¥É¥¦¥§¥¢¤Ç¤Ï¥Þ¥¤¥¯¥íÉÃñ°Ì¤ÎÀºÅÙ¤¬°ìÈÌŪ¤Ç¤¢¤ë)¡£ +¹âÀºÅÙ¥¿¥¤¥Þ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤Ï¡¢ +.BR clock_getres (2) +¤ò¸Æ¤Ó½Ð¤·¤Æʬ²òǽ¤ò³Îǧ¤¹¤ë¤«¡¢ +.I /proc/timer_list +Æâ¤Î "resolution" ¥¨¥ó¥È¥ê¤ò»²¾È¤¹¤ë¤«¤ÇȽÃǤǤ­¤ë¡£ + +.\"O HRTs are not supported on all hardware architectures. +.\"O (Support is provided on x86, arm, and powerpc, among others.) +¹âÀºÅÙ¥¿¥¤¥Þ¤Ï¤¹¤Ù¤Æ¤Î¥Ï¡¼¥É¥¦¥§¥¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë +Ìõ¤Ç¤Ï¤Ê¤¤ (Âбþ¤·¤Æ¤¤¤ë¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ï x86, arm, powerpc ¤Ç¤¢¤ë)¡£ +.\"O .SS "The Epoch" +.SS "µª¸µ" +.\"O Unix systems represent time in seconds since the +.\"O .IR Epoch , +.\"O 1970-01-01 00:00:00 +0000 (UTC). +Unix ¥·¥¹¥Æ¥à¤Ï»þ¹ï¤ò +µª¸µ (1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤ÎÉÿô¤Çɽ¸½¤¹¤ë¡£ + +.\"O A program can determine the +.\"O .I "calendar time" +.\"O using +.\"O .BR gettimeofday (2), +.\"O which returns time (in seconds and microseconds) that have +.\"O elapsed since the Epoch; +¥×¥í¥°¥é¥à¤Ï \fI¥«¥ì¥ó¥À»þ¹ï\fR ¤ò +.BR gettimeofday (2) +¤ò»È¤Ã¤Æ·×¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î´Ø¿ô¤Ïµª¸µ¤«¤é¤Î·Ð²á»þ´Ö¤ò (Éäȥޥ¤¥¯¥íÉäÇ) ÊÖ¤¹¡£ +.\"O .BR time (2) +.\"O provides similar information, but only with accuracy to the +.\"O nearest second. +.\"O The system time can be changed using +.\"O .BR settimeofday (2). +.BR time (2) +¤ÏƱÍͤξðÊó¤òÄ󶡤¹¤ë¤¬¡¢ºÇ¤â¶á¤¤ÉäÎÀºÅÙ¤·¤«¤Ê¤¤¡£ +¥·¥¹¥Æ¥à»þ¹ï¤Ï +.BR settimeofday (2) +¤ÇÊѹ¹¤Ç¤­¤ë¡£ +.\"O .SS "Broken-down time" +.SS "Í×ÁÇÊ̤λþ¹ï" +.\"O Certain library functions use a structure of +.\"O type +.\"O .I tm +.\"O to represent +.\"O .IR "broken-down time" , +.\"O which stores time value separated out into distinct components +.\"O (year, month, day, hour, minute, second, etc.). +¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ÎÃæ¤Ë¤Ï +.I tm +·¿¤Î¹½Â¤ÂΤò»È¤¦¤â¤Î¤¬¤¢¤ë¡£ +¤³¤Î¹½Â¤ÂΤÏ\fIÍ×ÁÇÊ̤λþ¹ï\fR¤òɽ¤·¡¢ +»þ¹ï¤ÎÃͤòÊÌ¡¹¤ÎÍ×ÁÇ (ǯ¡¦·î¡¦Æü¡¦»þ¡¦Ê¬¡¦ÉäʤÉ) ¤Ëʬ¤±¤Æ³ÊǼ¤¹¤ë¡£ +.\"O This structure is described in +.\"O .BR ctime (3), +.\"O which also describes functions that convert between calendar time and +.\"O broken-down time. +¤³¤Î¹½Â¤ÂÎ¤Ï +.BR ctime (3) +¤Ëµ­½Ò¤µ¤ì¤Æ¤ª¤ê¡¢¥«¥ì¥ó¥À»þ¹ï¤òÍ×ÁÇÊ̤λþ¹ï¤ËÊÑ´¹¤¹¤ë +´Ø¿ô¤Ë¤Ä¤¤¤Æ¤âµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O Functions for converting between broken-down time and printable +.\"O string representations of the time are described in +.\"O .BR ctime (3), +.\"O .BR strftime (3), +.\"O and +.\"O .BR strptime (3). +Í×ÁÇÊ̤λþ¹ï¤òɽ¼¨²Äǽ¤Êʸ»úÎó¤ËÊÑ´¹¤¹¤ë´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR ctime (3), +.BR strftime (3), +.BR strptime (3) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS "Sleeping and Setting Timers" +.SS "¥¿¥¤¥Þ¤Î¥¹¥ê¡¼¥×¤ÈÀßÄê" +.\"O Various system calls and functions allow a program to sleep +.\"O (suspend execution) for a specified period of time; see +.\"O .BR nanosleep (2), +.\"O .BR clock_nanosleep (2), +.\"O and +.\"O .BR sleep (3). +ÍÍ¡¹¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤È´Ø¿ô¤Ë¤è¤ê¡¢»ØÄꤵ¤ì¤¿°ìÄê¤Î»þ´Ö¡¢ +¥×¥í¥°¥é¥à¤Ï¥¹¥ê¡¼¥× (¼Â¹Ô¤òÄä»ß) ¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¡£ +.BR nanosleep (2), +.BR clock_nanosleep (2), +.BR sleep (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ + +.\"O Various system calls allow a process to set a timer that expires +.\"O at some point in the future, and optionally at repeated intervals; +.\"O see +.\"O .BR alarm (2), +.\"O .BR getitimer (2), +.\"O .BR timerfd_create (2), +.\"O and +.\"O .BR timer_create (2). +ÍÍ¡¹¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤è¤ê¡¢¥×¥í¥»¥¹¤Ï¾­Íè¤Î¤¢¤ë»þÅÀ¤Ç +Í­¸ú´ü´Ö¤¬½ªÎ»¤¹¤ë¥¿¥¤¥Þ¤òÀßÄê¤Ç¤­¤ë¡£ +¤Þ¤¿¥ª¥×¥·¥ç¥ó¤È¤·¤Æ·«¤êÊÖ¤·´Ö³Ö¤¬»ØÄê¤Ç¤­¤ë¤â¤Î¤â¤¢¤ë¡£ +.BR alarm (2), +.BR getitimer (2), +.BR timerfd_create (2), +.BR timer_create (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR date (1), +.BR time (1), +.BR adjtimex (2), +.BR alarm (2), +.BR clock_gettime (2), +.BR clock_nanosleep (2), +.BR getitimer (2), +.BR getrlimit (2), +.BR getrusage (2), +.BR gettimeofday (2), +.BR nanosleep (2), +.BR stat (2), +.BR time (2), +.BR timer_create (2), +.BR timerfd_create (2), +.BR times (2), +.BR utime (2), +.BR adjtime (3), +.BR clock (3), +.BR clock_getcpuclockid (3), +.BR ctime (3), +.BR pthread_getcpuclockid (3), +.BR sleep (3), +.BR strftime (3), +.BR strptime (3), +.BR timeradd (3), +.BR usleep (3), +.BR rtc (4), +.BR hwclock (8) diff --git a/draft/man7/udp.7 b/draft/man7/udp.7 new file mode 100644 index 00000000..c7e09cb5 --- /dev/null +++ b/draft/man7/udp.7 @@ -0,0 +1,442 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: udp.7,v 1.7 2000/01/22 01:55:05 freitag Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2005-10-09, Kentaro Shirakata +.\" Updated 2007-01-05, Akihiro MOTOKI , LDP v2.43 +.\" Updated 2008-12-29, Akihiro MOTOKI, LDP v3.14 +.\" Updated 2010-04-10, Akihiro MOTOKI, LDP v3.24 +.\" +.TH UDP 7 2009-09-30 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O udp \- User Datagram Protocol for IPv4 +.SH ̾Á° +udp \- IPv4 ¤Î ¥æ¡¼¥¶¡¼¥Ç¡¼¥¿¥°¥é¥à¥×¥í¥È¥³¥ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.B udp_socket = socket(AF_INET, SOCK_DGRAM, 0); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This is an implementation of the User Datagram Protocol +.\"O described in RFC\ 768. +.\"O It implements a connectionless, unreliable datagram packet service. +.\"O Packets may be reordered or duplicated before they arrive. +.\"O UDP generates and checks checksums to catch transmission errors. +¤³¤ì¤Ï RFC\ 768 ¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤ë User Datagram Protocol ¤Î¼ÂÁõ¤Ç¤¢¤ë¡£ +UDP ¤Ï¥³¥Í¥¯¥·¥ç¥ó¥ì¥¹¤Î¡¢¿®ÍêÀ­¤ÎÄ㤤¥Ç¡¼¥¿¥Ñ¥±¥Ã¥È¥µ¡¼¥Ó¥¹¤Ç¤¢¤ë¡£ +¥Ñ¥±¥Ã¥È¤ÏÅþÃåÁ°¤ËʤÓÂؤ¨¤é¤ì¤¿¤êÊ£À½¤µ¤ì¤¿¤ê¤¹¤ë¡£ +UDP ¤ÏžÁ÷¥¨¥é¡¼¤ò¸¡½Ð¤¹¤ë¤¿¤á¤Ë¥Á¥§¥Ã¥¯¥µ¥à¤òÀ¸À®¡¦¥Á¥§¥Ã¥¯¤¹¤ë¡£ + +.\"O When a UDP socket is created, +.\"O its local and remote addresses are unspecified. +.\"O Datagrams can be sent immediately using +.\"O .BR sendto (2) +.\"O or +.\"O .BR sendmsg (2) +.\"O with a valid destination address as an argument. +.\"O When +.\"O .BR connect (2) +.\"O is called on the socket, the default destination address is set and +.\"O datagrams can now be sent using +.\"O .BR send (2) +.\"O or +.\"O .BR write (2) +.\"O without specifying a destination address. +UDP ¥½¥±¥Ã¥È¤¬À¸À®¤µ¤ì¤ë¤È¤­¡¢ +¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤ä¥ê¥â¡¼¥È¥¢¥É¥ì¥¹¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£ +Àµ¤·¤¤¹Ô¤­À襢¥É¥ì¥¹¤ò°ú¿ô¤È¤·¤Æ +.BR sendto (2) +¤ä +.BR sendmsg (2) +¤ò¸Æ¤Ù¤Ð¡¢¥Ç¡¼¥¿¥°¥é¥à¤Ï¤¿¤À¤Á¤ËÁ÷¿®¤µ¤ì¤ë¡£ +¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.BR connect (2) +¤ò¸Æ¤Ö¤È¡¢¥Ç¥Õ¥©¥ë¥È¤Î¹Ô¤­À襢¥É¥ì¥¹¤¬ÀßÄꤵ¤ì¡¢ +.BR send (2) +¤ä +.BR write (2) +¤ò»È¤Ã¤Æ¡¢¹Ô¤­À襢¥É¥ì¥¹¤Î»ØÄê¤Ê¤·¤Ë¥Ç¡¼¥¿¥°¥é¥à¤òÁ÷¿®¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.\"O It is still possible to send to other destinations by passing an +.\"O address to +.\"O .BR sendto (2) +.\"O or +.\"O .BR sendmsg (2). +¤³¤Î¾ì¹ç¤Ç¤â¡¢¹Ô¤­À襢¥É¥ì¥¹¤ò +.BR sendto (2) +¤ä +.BR sendmsg (2) +¤ËÅϤ»¤Ð¡¢¥Ç¥Õ¥©¥ë¥È°Ê³°¤Î¥¢¥É¥ì¥¹¤ËÁ÷¿®²Äǽ¤Ç¤¢¤ë¡£ +.\"O In order to receive packets, the socket can be bound to a local +.\"O address first by using +.\"O .BR bind (2). +¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤¹¤ë¤¿¤á¤Ë¡¢¤Þ¤º¥½¥±¥Ã¥È¤ò +.BR bind (2) +¤òÍѤ¤¤Æ¥í¡¼¥«¥ë¤Ê¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤»¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.\"O Otherwise the socket layer will automatically assign +.\"O a free local port out of the range defined by +.\"O .I /proc/sys/net/ipv4/ip_local_port_range +.\"O and bind the socket to +.\"O .BR INADDR_ANY . +¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢¥½¥±¥Ã¥ÈÁؤϼ«Æ°Åª¤Ë +.I /proc/sys/net/ipv4/ip_local_port_range +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÈϰϤγ°¤Ç¶õ¤¤¤Æ¤¤¤ë¥í¡¼¥«¥ë¤Ê¥Ý¡¼¥È¤ò³ä¤êÅö¤Æ¡¢ +¥½¥±¥Ã¥È¤ò +.B INADDR_ANY +¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¡£ + +.\"O All receive operations return only one packet. +.\"O When the packet is smaller than the passed buffer, only that much +.\"O data is returned, when it is bigger, the packet is truncated and the +.\"O .B MSG_TRUNC +.\"O flag is set. +¼õ¿®Æ°ºî¤Ï¥Ñ¥±¥Ã¥È¤ò°ì¤Ä¤À¤±ÊÖ¤¹¡£ÅϤ·¤¿¥Ð¥Ã¥Õ¥¡¤è¤ê¤â¥Ñ¥±¥Ã¥È¤¬ +¾®¤µ¤±¤ì¤Ð¡¢¤½¤Î¥Ñ¥±¥Ã¥È¤ÎÂ礭¤µ¤Î¥Ç¡¼¥¿¤À¤±¤¬ÊÖ¤µ¤ì¤ë¡£ +µÕ¤Ë¥Ð¥Ã¥Õ¥¡¤è¤ê¤âÂ礭¤¤¾ì¹ç¤Ï¥Ñ¥±¥Ã¥È¤Ï´Ý¤á¤é¤ì¡¢ +.B MSG_TRUNC +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.\"O .B MSG_WAITALL +.\"O is not supported. +.B MSG_WAITALL +¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ + +.\"O IP options may be sent or received using the socket options described in +.\"O .BR ip (7). +.\"O They are only processed by the kernel when the appropriate +.\"O .I /proc +.\"O parameter +.\"O is enabled (but still passed to the user even when it is turned off). +.\"O See +.\"O .BR ip (7). +IP ¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.BR ip (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ÆÆɤ߽ñ¤­¤Ç¤­¤ë¡£ +¤³¤ì¤é¤ÏŬÀÚ¤Ê +.I /proc +¥Ñ¥é¥á¡¼¥¿¤¬Í­¸ú¤Ê¾ì¹ç¤Ë¸Â¤Ã¤Æ¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ½èÍý¤µ¤ì¤ë +(¤·¤«¤·Ìµ¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ç¤â¥æ¡¼¥¶¡¼¤Ë¤ÏÅϤµ¤ì¤ë)¡£ +.BR ip (7) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"O When the +.\"O .B MSG_DONTROUTE +.\"O flag is set on sending, the destination address must refer to a local +.\"O interface address and the packet is only sent to that interface. +.B MSG_DONTROUTE +¥Õ¥é¥°¤¬Á÷¿®»þ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¹Ô¤­À襢¥É¥ì¥¹¤Ï¥í¡¼¥«¥ë¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤«¤é +»²¾È¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¥Ñ¥±¥Ã¥È¤Ï¤½¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤·¤«Á÷¤é¤ì¤Ê¤¤¡£ + +.\"O By default, Linux UDP does path MTU (Maximum Transmission Unit) discovery. +.\"O This means the kernel +.\"O will keep track of the MTU to a specific target IP address and return +.\"O .B EMSGSIZE +.\"O when a UDP packet write exceeds it. +.\"O When this happens, the application should decrease the packet size. +.\"O Path MTU discovery can be also turned off using the +.\"O .B IP_MTU_DISCOVER +.\"O socket option or the +.\"O .I /proc/sys/net/ipv4/ip_no_pmtu_disc +.\"O file; see +.\"O .BR ip (7) +.\"O for details. +.\"O When turned off, UDP will fragment outgoing UDP packets +.\"O that exceed the interface MTU. +.\"O However, disabling it is not recommended +.\"O for performance and reliability reasons. +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢Linux ¤Î UDP ¤Ï Path MTU Discovery ¤ò¹Ô¤¦¡£ +¤Ä¤Þ¤ê¡¢¥«¡¼¥Í¥ë¤ÏÆÃÄê¤Î°¸Àè IP ¥¢¥É¥ì¥¹¤Î MTU (Maximum Transmission Unit; +ºÇÂçžÁ÷ñ°Ì) ¤òµ­Ï¿¤·¡¢UDP ¥Ñ¥±¥Ã¥È¤Î½ñ¤­¹þ¤ß¤¬ MTU ¤òĶ¤¨¤¿¾ì¹ç +.B EMSGSIZE +¤òÊÖ¤¹¡£ +.B EMSGSIZE +¤òÊÖ¤µ¤ì¤¿¾ì¹ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤ò¾®¤µ¤¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.B IP_MTU_DISCOVER +¤Þ¤¿¤Ï +.I /proc/sys/net/ipv4/ip_no_pmtu_disc +¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ Path MTU Discovery ¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë +(¾ÜºÙ¤Ï +.BR ip (7) +¤ò»²¾È)¡£ +Path MTU Discovery ¤ò̵¸ú¤Ë¤·¤¿¾ì¹ç¤Ï¡¢¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤¬ +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î MTU ¤è¤ê¤âÂ礭¤¤¤È UDP ¤Ï¤½¤Î¥Ñ¥±¥Ã¥È¤ò +¥Õ¥é¥°¥á¥ó¥È²½¤·¤ÆÁ÷½Ð¤¹¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢À­Ç½¤È¿®ÍêÀ­¤ÎÍýͳ¤«¤é Path MTU Discovery ¤ò +̵¸ú¤Ë¤¹¤ë¤Î¤Ï¿ä¾©¤Ç¤­¤Ê¤¤¡£ +.\"O .SS Address Format +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.\"O UDP uses the IPv4 +.\"O .I sockaddr_in +.\"O address format described in +.\"O .BR ip (7). +UDP ¤Ï IPv4 ¤Î +.I sockaddr_in +¥¢¥É¥ì¥¹¥Õ¥©¡¼¥Þ¥Ã¥È¤òÍѤ¤¤ë¡£¤³¤ì¤Ï +.BR ip (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS Error Handling +.SS ¥¨¥é¡¼½èÍý +.\"O All fatal errors will be passed to the user as an error return even +.\"O when the socket is not connected. +.\"O This includes asynchronous errors +.\"O received from the network. +.\"O You may get an error for an earlier packet +.\"O that was sent on the same socket. +Ã×̿Ū¤Ê¥¨¥é¡¼¤Ï¡¢¤¿¤È¤¨¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢ +¤¹¤Ù¤Æ¥¨¥é¡¼Ìá¤êÃͤȤ·¤Æ¥æ¡¼¥¶¡¼¤ËÅϤµ¤ì¤ë¡£ +¤³¤ì¤Ë¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¤«¤é¼õ¤±¼è¤ëÈóƱ´ü¥¨¥é¡¼¤â´Þ¤Þ¤ì¤ë¡£ +Ʊ¤¸¥½¥±¥Ã¥È¤ò»È¤Ã¤ÆÁ÷¿®¤·¤¿ÀΤΥѥ±¥Ã¥È¤Ë´Ø¤¹¤ë¥¨¥é¡¼¤ò¼õ¤±¼è¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O This behavior differs from many other BSD socket implementations +.\"O which don't pass any errors unless the socket is connected. +.\"O Linux's behavior is mandated by +.\"O .BR RFC\ 1122 . +¤³¤Î¿¶¤ëÉñ¤¤¤Ï¾¤Î BSD ¥½¥±¥Ã¥È¤Î¼ÂÁõ¤Î¿¤¯¤È¤Ï°Û¤Ê¤ë¡£ +¤³¤ì¤é¤Ç¤Ï¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¥¨¥é¡¼¤òÁ´¤¯ÊÖ¤µ¤Ê¤¤¡£ +Linux ¤Î¿¶¤ëÉñ¤¤¤Ï +.B RFC\ 1122 +¤Ç¤Î»ØÄê¤Ë½¾¤Ã¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +.\"O For compatibility with legacy code, in Linux 2.0 and 2.2 +.\"O it was possible to set the +.\"O .B SO_BSDCOMPAT +.\"O .B SOL_SOCKET +.\"O option to receive remote errors only when the socket has been +.\"O connected (except for +.\"O .B EPROTO +.\"O and +.\"O .BR EMSGSIZE ). +.\"O Locally generated errors are always passed. +.\"O Support for this socket option was removed in later kernels; see +.\"O .BR socket (7) +.\"O for further information. +Linux 2.0 ¤È 2.2 ¤Ç¤Ï¡¢¸Å¤¤¥³¡¼¥É¤È¤Î¸ß´¹À­¤Î¤¿¤á¤Ë¡¢ +.B SO_BSDCOMPAT +.B SOL_SOCKET +¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ì¤Ð¡¢¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤ë +¾ì¹ç¤Ë¸Â¤Ã¤Æ¥ê¥â¡¼¥È¤Î¥¨¥é¡¼¤ò¼õ¿®¤¹¤ë¤è¤¦¤Ë¤Ç¤­¤¿ +.RB ( EPROTO " ¤È " EMSGSIZE +¤ò½ü¤¯)¡£ +¥í¡¼¥«¥ë¤ÇÀ¸À®¤µ¤ì¤¿¥¨¥é¡¼¤Ï¾ï¤ËÅϤµ¤ì¤ë¡£ +¤³¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Î¥µ¥Ý¡¼¥È¤Ï¤½¤ì°Ê¹ß¤Î¥Ð¡¼¥¸¥ç¥ó¤Î Linux ¤Ç +ºï½ü¤µ¤ì¤¿¡£¾ÜºÙ¤Ï +.BR socket (7) +¤ò»²¾È¡£ + +.\"O When the +.\"O .B IP_RECVERR +.\"O option is enabled, all errors are stored in the socket error queue +.\"O and can be received by +.\"O .BR recvmsg (2) +.\"O with the +.\"O .B MSG_ERRQUEUE +.\"O flag set. +.B IP_RECVERR +¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +¤¹¤Ù¤Æ¤Î¥¨¥é¡¼¤Ï¥½¥±¥Ã¥È¤Î¥¨¥é¡¼¥­¥å¡¼¤ËÊݸ¤µ¤ì¤ë¡£ +¤³¤ì¤Ï +.B MSG_ERRQUEUE +¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¤Æ +.BR recvmsg (2) +¤ò¸Æ¤Ù¤Ð¼õ¿®¤Ç¤­¤ë¡£ +.\"O .SS /proc interfaces +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.\"O System-wide UDP parameter settings can be accessed by files in the directory +.\"O .IR /proc/sys/net/ipv4/ . +¥·¥¹¥Æ¥àÁ´ÂΤΠUDP ¥Ñ¥é¥á¡¼¥¿ÀßÄê¤Ë¤Ï¡¢ +.I /proc/sys/net/ipv4/ +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.TP +.\"O .IR udp_mem " (since Linux 2.6.25)" +.IR udp_mem " (Linux 2.6.25 °Ê¹ß)" +.\"O This is a vector of three integers governing the number +.\"O of pages allowed for queueing by all UDP sockets. +¤³¤ì¤Ï 3 ¤Ä¤ÎÀ°¿ô¤«¤é¤Ê¤ë¥Ù¥¯¥È¥ëÃͤǡ¢ +UDP ¤ÎÁ´¥½¥±¥Ã¥È¤Î¥­¥å¡¼¤ÇÍøÍѲÄǽ¤Ê¥Ú¡¼¥¸¿ô¤òÀ©¸æ¤¹¤ë¡£ +.RS +.TP 10 +.I min +.\"O Below this number of pages, UDP is not bothered about its +.\"O memory appetite. +.\"O When the amount of memory allocated by UDP exceeds +.\"O this number, UDP starts to moderate memory usage. +¤³¤Î¥Ú¡¼¥¸¿ô¤è¤ê¾¯¤Ê¤±¤ì¤Ð¡¢UDP ¤Ï¤½¤Î¥á¥â¥ê»ÈÍѤ˴ؤ·¤Æ +´³¾Ä¤µ¤ì¤Ê¤¤¡£ +UDP ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥êÁíÎ̤¬¤³¤ÎÃͤòĶ²á¤¹¤ë¤È¡¢ +UDP ¤Ï¥á¥â¥ê»ÈÍÑÎ̤òÄ´À°¤·»Ï¤á¤ë¡£ +.TP +.I pressure +.\"O This value was introduced to follow the format of +.\"O .IR tcp_mem +.\"O (see +.\"O .BR tcp (7)). +¤³¤ÎÃÍ¤Ï +.I tcp_mem +¤Î·Á¼° +.RB ( tcp (7) +»²¾È) ¤È¹ç¤ï¤»¤ë¤¿¤á¤ËƳÆþ¤µ¤ì¤¿ +.TP +.I max +.\"O Number of pages allowed for queueing by all UDP sockets. +UDP ¤ÎÁ´¥½¥±¥Ã¥È¤Î¥­¥å¡¼¤ÇÍøÍѲÄǽ¤Ê¥Ú¡¼¥¸¿ô¡£ +.RE +.IP +.\"O Defaults values for these three items are +.\"O calculated at boot time from the amount of available memory. +¤³¤ì¤é¤Î 3 ¤Ä¤ÎÃͤΥǥե©¥ë¥ÈÃͤϡ¢ +¥Ö¡¼¥È»þ¤ËÍøÍѲÄǽ¤Ê¥á¥â¥êÁíÎ̤«¤é·×»»¤µ¤ì¤ë¡£ +.TP +.\"O .IR udp_rmem_min " (integer; default value: PAGE_SIZE; since Linux 2.6.25)" +.IR udp_rmem_min " (integer; ¥Ç¥Õ¥©¥ë¥ÈÃÍ: PAGE_SIZE; Linux 2.6.25 °Ê¹ß)" +.\"O Minimal size, in bites, of receive buffers used by UDP sockets in moderation. +.\"O Each UDP socket is able to use the size for receiving data, +.\"O even if total pages of UDP sockets exceed +.\"O .I udp_mem +.\"O pressure. +¥á¥â¥ê»ÈÍÑÎ̤ÎÄ´À°Ãæ¤Ë¡¢UDP ¥½¥±¥Ã¥È¤¬»ÈÍѤǤ­¤ë¼õ¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇ¾®ÃÍ +(¥Ð¥¤¥Èñ°Ì)¡£ +UDP ¤ÎÁ´¥½¥±¥Ã¥È¤Î¥Ú¡¼¥¸»ÈÍÑÎ̤ιç·×¤¬ +.I udp_mem +pressure ¤òĶ²á¤·¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢ +³Æ UDP ¥½¥±¥Ã¥È¤Ï¥Ç¡¼¥¿¤Î¼õ¿®¤Ë¤³¤Î¥µ¥¤¥ºÊ¬¤À¤±¤Ï»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.\"O .IR udp_wmem_min " (integer; default value: PAGE_SIZE; since Linux 2.6.25)" +.IR udp_wmem_min " (integer; ¥Ç¥Õ¥©¥ë¥ÈÃÍ: PAGE_SIZE; Linux 2.6.25 °Ê¹ß)" +.\"O Minimal size, in bytes, of send buffer used by UDP sockets in moderation. +.\"O Each UDP socket is able to use the size for sending data, +.\"O even if total pages of UDP sockets exceed +.\"O .I udp_mem +.\"O pressure. +¥á¥â¥ê»ÈÍÑÎ̤ÎÄ´À°Ãæ¤Ë¡¢UDP ¥½¥±¥Ã¥È¤¬»ÈÍѤǤ­¤ëÁ÷¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇ¾®ÃÍ +(¥Ð¥¤¥Èñ°Ì)¡£ +UDP ¤ÎÁ´¥½¥±¥Ã¥È¤Î¥Ú¡¼¥¸»ÈÍÑÎ̤ιç·×¤¬ +.I udp_mem +pressure ¤òĶ²á¤·¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢ +³Æ UDP ¥½¥±¥Ã¥È¤Ï¥Ç¡¼¥¿¤ÎÁ÷¿®¤Ë¤³¤Î¥µ¥¤¥ºÊ¬¤À¤±¤Ï»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"O \"O .SS "Socket Options" +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.\"O To set or get a UDP socket option, call +.\"O .BR getsockopt (2) +.\"O to read or +.\"O .BR setsockopt (2) +.\"O to write the option with the option level argument set to +.\"O .BR IPPROTO_UDP . +UDP ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÀßÄê¤Þ¤¿¤Ï¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢ +¼èÆÀ¤Ë¤Ï +.BR getsockopt (2) +¤ò¡¢ÀßÄê¤Ë¤Ï +.BR setsockopt (2) +¤ò¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë°ú¿ô¤Ë +.B IPPROTO_UDP +¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤¹¡£ +.TP +.\"O .BR UDP_CORK " (since Linux 2.5.44)" +.BR UDP_CORK " (Linux 2.5.44 °Ê¹ß)" +.\"O If this option is enabled, then all data output on this socket +.\"O is accumulated into a single datagram that is transmitted when +.\"O the option is disabled. +.\"O This option should not be used in code intended to be +.\"O portable. +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤ë¤È¡¢¤³¤Î¥½¥±¥Ã¥È¤ÎÁ´¤Æ¤Î¥Ç¡¼¥¿½ÐÎÏ¤Ï +°ì¤Ä¤Î¥Ç¡¼¥¿¥°¥é¥à¤ËÃßÀѤµ¤ì¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤¬Ìµ¸ú²½¤µ¤ì¤¿»þ¤Ë +Á÷¿®¤µ¤ì¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï°Ü¿¢À­¤ò¹Íθ¤·¤¿¥³¡¼¥É¤Ç¤ÏÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\" FIXME document UDP_ENCAP (new in kernel 2.5.67) +.\" From include/linux/udp.h: +.\" /* UDP encapsulation types */ +.\" #define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */ +.\" #define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ +.\" #define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */ +.\"O .SS Ioctls +.SS ioctl +.\"O These ioctls can be accessed using +.\"O .BR ioctl (2). +°Ê²¼¤Ë¼¨¤¹ ioctl ¤Ï +.BR ioctl (2) +¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.\"O The correct syntax is: +Àµ¤·¤¤Ê¸Ë¡¤Ï°Ê²¼¤ÎÄ̤ꡣ +.PP +.RS +.nf +.BI int " value"; +.IB error " = ioctl(" udp_socket ", " ioctl_type ", &" value ");" +.fi +.RE +.TP +.BR FIONREAD " (" SIOCINQ ) +.\"O Gets a pointer to an integer as argument. +.\"O Returns the size of the next pending datagram in the integer in bytes, +.\"O or 0 when no datagram is pending. +integer ¤Î¥Ý¥¤¥ó¥¿¤ò°ú¿ô¤È¤·¤Æ¼è¤ë¡£ +¼¡¤ËÂÔµ¡¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¥°¥é¥à¤Î¥µ¥¤¥º¤ò¥Ð¥¤¥Èñ°Ì¤ÎÀ°¿ô¤ÇÊÖ¤¹¡£ +ÂÔµ¡¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¥°¥é¥à¤¬¤Ê¤¤¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.TP +.BR TIOCOUTQ " (" SIOCOUTQ ) +.\"O Returns the number of data bytes in the local send queue. +.\"O Only supported with Linux 2.4 and above. +¥í¡¼¥«¥ëÁ÷¿®¥­¥å¡¼¤Ë¤¢¤ë¥Ç¡¼¥¿¥µ¥¤¥º¤ò¥Ð¥¤¥Èñ°Ì¤ÇÊÖ¤¹¡£ +Linux 2.4 °Ê¾å¤Ç¤Î¤ßÂбþ¤·¤Æ¤¤¤ë¡£ +.PP +.\"O In addition all ioctls documented in +.\"O .BR ip (7) +.\"O and +.\"O .BR socket (7) +.\"O are supported. +¤µ¤é¤Ë¡¢ +.BR ip (7) +¤È +.BR socket (7) +¤Ç½Ò¤Ù¤é¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î ioctl ¤âÂбþ¤·¤Æ¤¤¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O All errors documented for +.\"O .BR socket (7) +.\"O or +.\"O .BR ip (7) +.\"O may be returned by a send or receive on a UDP socket. +.BR socket (7) +¤ä +.BR ip (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥¨¥é¡¼¤¬¡¢ +UDP ¥½¥±¥Ã¥È¤ÎÁ÷¼õ¿®¤ÇÊÖ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B ECONNREFUSED +.\"O No receiver was associated with the destination address. +.\"O This might be caused by a previous packet sent over the socket. +¹Ô¤­À襢¥É¥ì¥¹¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤ë¼õ¿®¼Ô¤¬¤¤¤Ê¤¤¡£ +¤³¤ì¤Ï°ÊÁ°¤Î¥Ñ¥±¥Ã¥È¤¬¤½¤Î¥Ñ¥±¥Ã¥È¤ò +¾å½ñ¤­Á÷¿®¤·¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¤³¤È¤¬Â¿¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .B IP_RECVERR +.\"O is a new feature in Linux 2.2. +.B IP_RECVERR +¤Ï Linux 2.2 ¤Î¿·¤·¤¤µ¡Ç½¤Ç¤¢¤ë¡£ +.\"O .\" .SH CREDITS +.\" .SH Ãø¼Ô +.\"O .\" This man page was written by Andi Kleen. +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï Andi Kleen ¤¬½ñ¤¤¤¿¡£ +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR ip (7), +.BR raw (7), +.BR socket (7), +.BR udplite (7) + +.\"O RFC\ 768 for the User Datagram Protocol. +RFC\ 768 : User Datagram Protocol +.br +.\"O RFC\ 1122 for the host requirements. +RFC\ 1122 : ¥Û¥¹¥È¤ÎɬÍ×¾ò·ï +.br +.\"O RFC\ 1191 for a description of path MTU discovery. +RFC\ 1191 : path MTU discovery ¤Îµ­½Ò diff --git a/draft/man7/udplite.7 b/draft/man7/udplite.7 new file mode 100644 index 00000000..ae0c17d5 --- /dev/null +++ b/draft/man7/udplite.7 @@ -0,0 +1,239 @@ +.\" Copyright (c) 2008 by Gerrit Renker +.\" +.\" 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. +.\" +.\" $Id: udplite.7,v 1.12 2008/07/23 15:22:22 gerrit Exp gerrit $ +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.07 +.\" +.TH UDPLITE 7 2008-12-03 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O udplite \- Lightweight User Datagram Protocol +udplite \- ·ÚÎ̤ʥ桼¥¶¡¼¥Ç¡¼¥¿¥°¥é¥à¥×¥í¥È¥³¥ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.\" FIXME . see #defines under `BUGS', +.\" when glibc supports this, add +.\" #include +.sp +.B sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDPLITE); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This is an implementation of the Lightweight User Datagram Protocol +.\"O (UDP-Lite), as described in RFC\ 3828. +¤³¤ì¤Ï RFC\ 3828 ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë·ÚÎ̤ʥ桼¥¶¡¼¥Ç¡¼¥¿¥°¥é¥à¥×¥í¥È¥³¥ë +(Lightweight User Datagram Protocol; UDP-Lite) ¤Î¼ÂÁõ¤Ç¤¢¤ë¡£ + +.\"O UDP-Lite is an extension of UDP (RFC\ 768) to support variable-length +.\"O checksums. +.\"O This has advantages for some types of multimedia transport that +.\"O may be able to make use of slightly damaged datagrams, +.\"O rather than having them discarded by lower-layer protocols. +UDP-Lite ¤Ï UDP (RFC\ 768) ¤Î³ÈÄ¥¤Ç¡¢²ÄÊÑĹ¤Î¥Á¥§¥Ã¥¯¥µ¥à¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¤³¤Î¥×¥í¥È¥³¥ë¤¬¸ú²Ì¤òȯ´ø¤¹¤ë¤Î¤Ï¡¢¾¯¤·¤À¤±²õ¤ì¤¿¥Ç¡¼¥¿¥°¥é¥à¤¬¤¢¤Ã¤¿¾ì¹ç¤Ë¡¢ +¤½¤Î¥Ç¡¼¥¿¥°¥é¥à¤ò²¼°Ì¥ì¥¤¥ä¡¼¤Î¥×¥í¥È¥³¥ë¤ËÇÑ´þ¤µ¤»¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¤½¤ì¤òÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ê¡¢¤¢¤ë¼ï¤Î¥Þ¥ë¥Á¥á¥Ç¥£¥¢Å¾Á÷¤Ë¤ª¤¤¤Æ¤Ç¤¢¤ë¡£ + +.\"O The variable-length checksum coverage is set via a +.\"O .BR setsockopt (2) +.\"O option. +.\"O If this option is not set, the only difference to UDP is +.\"O in using a different IP protocol identifier (IANA number 136). +²ÄÊÑĹ¤Î¥Á¥§¥Ã¥¯¥µ¥à¤ÎÂоÝÈÏ°Ï¤Ï +.BR setsockopt (2) +¥ª¥×¥·¥ç¥ó·Ðͳ¤ÇÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢UDP ¤È°Û¤Ê¤ë¤Î¤Ï +°ã¤¦ IP ¥×¥í¥È¥³¥ë¼±ÊÌ»Ò (IANA ÈÖ¹æ 136) ¤ò»ÈÍѤ¹¤ëÅÀ¤À¤±¤Ç¤¢¤ë¡£ + +.\"O The UDP-Lite implementation is a full extension of +.\"O .BR udp (7), +.\"O i.e., it shares the same API and API behaviour, and in addition +.\"O offers two socket options to control the checksum coverage. +UDP-Lite ¤Î¼ÂÁõ¤Ï +.BR udp (7) +¤Î´°Á´¤Ê³ÈÄ¥¡¢¤¹¤Ê¤ï¤Á API ¤È API ¤ÎÆ°ºî¤ÏƱ¤¸¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë²Ã¤¨¤Æ¡¢2 ¤Ä¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬¥Á¥§¥Ã¥¯¥µ¥à¤ÎÂоÝÈϰϤò +À©¸æ¤¹¤ë¤¿¤á¤ËÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS "Address Format" +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.\"O UDP-Litev4 uses the +.\"O .I sockaddr_in +.\"O address format described in +.\"O .BR ip (7). +.\"O UDP-Litev6 uses the +.\"O .I sockaddr_in6 +.\"O address format described in +.\"O .BR ipv6 (7). +UDP-Litev4 ¤Ï +.BR ip (7) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë +.I sockaddr_in +¥¢¥É¥ì¥¹¤ò»ÈÍѤ¹¤ë¡£ +UDP-Litev6 ¤Ï +.BR ipv6 (7) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë +.I sockaddr_in6 +¥¢¥É¥ì¥¹¤ò»ÈÍѤ¹¤ë¡£ +.\"O .SS "Socket Options" +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.\"O To set or get a UDP-Lite socket option, call +.\"O .BR getsockopt (2) +.\"O to read or +.\"O .BR setsockopt (2) +.\"O to write the option with the option level argument set to +.\"O .BR IPPROTO_UDPLITE . +.\"O In addition, all +.\"O .B IPPROTO_UDP +.\"O socket options are valid on a UDP-Lite socket. +.\"O See +.\"O .BR udp (7) +.\"O for more information. +UDP-Lite ¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÀßÄê/¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢ +¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë°ú¤­¿ô¤Ë +.B IPPROTO_UDPLITE +¤ò»ØÄꤷ¤Æ¡¢¼èÆÀ»þ¤Ë¤Ï +.BR getsockopt (2) +¤ò¡¢ÀßÄê»þ¤Ë¤Ï +.BR setsockopt (2) +¤ò¸Æ¤Ó½Ð¤¹¡£¤µ¤é¤Ë¡¢Á´¤Æ¤Î +.B IPPROTO_UDP +¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ UDP-Lite ¥½¥±¥Ã¥È¤Ç¤â»ÈÍѤǤ­¤ë¡£ +¾ÜºÙ¤Ï +.BR udp (7) +¤ò»²¾È¤Î¤³¤È¡£ + +.\"O The following two options are specific to UDP-Lite. +°Ê²¼¤Î 2 ¤Ä¤¬ UDP-Lite ¤Ë¸ÇÍ­¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +.TP +.BR UDPLITE_SEND_CSCOV +.\"O This option sets the sender checksum coverage and takes an +.\"O .I int +.\"O as argument, with a checksum coverage value in the range 0..2^16-1. +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÏÁ÷¿®Â¦¤Î¥Á¥§¥Ã¥¯¥µ¥à¤ÎÂоÝÈϰϤòÀßÄꤹ¤ë¡£ +.I int +·¿¤ò°ú¤­¿ô¤È¤·¤Æ¼è¤ê¡¢ÀßÄê²Äǽ¤ÊÃͤÎÈÏ°Ï¤Ï 0 ¤«¤é 2^16-1 ¤Þ¤Ç¤Ç¤¢¤ë¡£ + +.\"O A value of 0 means that the entire datagram is always covered. +.\"O Values from 1-7 are illegal (RFC\ 3828, 3.1) and are rounded up to +.\"O the minimum coverage of 8. +ÃÍ 0 ¤Ï¥Ç¡¼¥¿¥°¥é¥àÁ´ÂΤ¬¾ï¤Ë¥Á¥§¥Ã¥¯¥µ¥à¤ÎÂоݤȤʤ뤳¤È¤ò°ÕÌ£¤¹¤ë¡£ +ÃÍ 1¡Á7 ¤ÏÉÔÀµ¤Ç¤¢¤ê (RFC\ 3828 ¤Î 3.1 ¾Ï)¡¢ÈϰϤÎÀßÄê¤È¤·¤ÆºÇ¾®ÃͤǤ¢¤ë +8 ¤ËÀÚ¤ê¾å¤²¤é¤ì¤ë¡£ + +.\"O With regard to IPv6 jumbograms (RFC\ 2675), the UDP-Litev6 checksum +.\"O coverage is limited to the first 2^16-1 octets, as per RFC\ 3828, 3.5. +.\"O Higher values are therefore silently truncated to 2^16-1. +.\"O If in doubt, the current coverage value can always be queried using +.\"O .BR getsockopt (2). +IPv6 ¤Î jumbograms (µðÂç¤Ê¥Ç¡¼¥¿¥°¥é¥à; RFC\ 2675) ¤Î¾ì¹ç¤Ë¤Ï¡¢ +UDP-Litev6 ¤Î¥Á¥§¥Ã¥¯¥µ¥à¤ÎÂоÝÈϰϤϡ¢RFC\ 3828 ¤Î 3.5 ¾Ï¤Ë¤¢¤ë¤è¤¦¤Ë¡¢ +ÀèƬ¤«¤é 2^16-1 ¥ª¥¯¥Æ¥Ã¥È¤Þ¤Ç¤Ë¸ÂÄꤵ¤ì¤ë¡£ +¤½¤Î¤¿¤á¡¢¤½¤ì¤è¤êÂ礭¤ÊÃÍ¤Ï 2^16-1 ¤ËÌۤäÆÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +¸½ºß¤ÎÂоÝÈϰϤÎÃͤòÃΤꤿ¤±¤ì¤Ð¡¢¤¤¤Ä¤Ç¤â +.BR getsockopt (2) +¤ò»È¤Ã¤ÆÃͤòÌ䤤¹ç¤ï¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR UDPLITE_RECV_CSCOV +.\"O This is the receiver-side analogue and uses the same argument format +.\"O and value range as +.\"O .BR UDPLITE_SEND_CSCOV . +.\"O This option is not required to enable traffic with partial checksum +.\"O coverage. +.\"O Its function is that of a traffic filter: when enabled, it +.\"O instructs the kernel to drop all packets which have a coverage +.\"O .I less +.\"O than the specified coverage value. +¤³¤ì¤Ï¼õ¿®Â¦¤Î¥Á¥§¥Ã¥¯¥µ¥à¤ÎÂоÝÈϰϤòÀßÄꤹ¤ë¤â¤Î¤Ç¡¢ +»ÈÍѤµ¤ì¤ë°ú¤­¿ô·Á¼°¤ÈÃͤÎÈÏ°Ï¤Ï +.B UDPLITE_SEND_CSCOV +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ÉôʬŪ¤Ê¥Á¥§¥Ã¥¯¥µ¥àÂоÝÈϰϤò»ý¤Ä¥È¥é¥Õ¥£¥Ã¥¯¤ò +Í­¸ú¤Ë¤¹¤ë¤Î¤ËɬÍפʤ櫓¤Ç¤Ï¤Ê¤¯¡¢¥È¥é¥Õ¥£¥Ã¥¯¥Õ¥£¥ë¥¿¡¼¤È¤·¤Æµ¡Ç½¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤¹¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï»ØÄꤵ¤ì¤¿¥Á¥§¥Ã¥¯¥µ¥àÂоÝÈÏ°Ï +¤è¤ê¤â¡Öû¤«¤¤¡×ÂоÝÈϰϤò»ý¤Ä¥Ñ¥±¥Ã¥È¤òÁ´¤ÆÇÑ´þ¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + +.\"O When the value of +.\"O .B UDPLITE_RECV_CSCOV +.\"O exceeds the actual packet coverage, incoming packets are silently dropped, +.\"O but may generate a warning message in the system log. +.B UDPLITE_RECV_CSCOV +¤ÎÃͤ¬¼ÂºÝ¤Î¥Ñ¥±¥Ã¥È¤Î¥Á¥§¥Ã¥¯¥µ¥àÂоÝÈϰϤè¤ê¤âÂ礭¤¤¾ì¹ç¡¢ +¼õ¿®¤·¤¿¥Ñ¥±¥Ã¥È¤ÏÌۤäÆÇÑ´þ¤µ¤ì¤ë¡£ +¤¿¤À¤·¡¢¥·¥¹¥Æ¥à¥í¥°¤ËÂФ·¤Æ·Ù¹ð¥á¥Ã¥»¡¼¥¸¤¬À¸À®¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\" SO_NO_CHECK exists and is supported by UDPv4, but is +.\" commented out in socket(7), hence also commented out here +.\".PP +.\"Since UDP-Lite mandates checksums, checksumming can not be disabled +.\"via the +.\".B SO_NO_CHECK +.\"option from +.\".BR socket (7). +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O All errors documented for +.\"O .BR udp (7) +.\"O may be returned. +.\"O UDP-Lite does not add further errors. +.BR udp (7) +¤Ë¤Ä¤¤¤Æ½ñ¤«¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥¨¥é¡¼¤ÏÊÖ¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +UDP-Lite ¼«ÂΤϿ·¤¿¤Ê¥¨¥é¡¼¤ÏÄɲ䷤Ƥ¤¤Ê¤¤¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\" FIXME . remove this section once glibc supports UDP-Lite +.\"O Where glibc support is missing, the following definitions are needed: +glibc ¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢°Ê²¼¤ÎÄêµÁ¤ò¹Ô¤¦É¬Íפ¬¤¢¤ë¡£ +.in +4n +.nf + +#define IPPROTO_UDPLITE 136 +.\" The following two are defined in the kernel in linux/net/udplite.h +#define UDPLITE_SEND_CSCOV 10 +#define UDPLITE_RECV_CSCOV 11 +.fi +.in +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.I /proc/net/snmp +.\"O \- basic UDP-Litev4 statistics counters. +\- UDP-Litev4 ¤Î´ðËÜŪ¤ÊÅý·×¾ðÊ󥫥¦¥ó¥¿¡¼¡£ +.br +.I /proc/net/snmp6 +.\"O \- basic UDP-Litev6 statistics counters. +\- UDP-Litev6 ¤Î´ðËÜŪ¤ÊÅý·×¾ðÊ󥫥¦¥ó¥¿¡¼¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O UDP-Litev4/v6 first appeared in Linux 2.6.20. +UDP-Litev4/v6 ¤Ï Linux 2.6.20 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR udp (7), +.BR ip (7), +.BR ipv6 (7), +.BR socket (7) + +RFC\ 3828 for the Lightweight User Datagram Protocol (UDP-Lite) +.br +.I Documentation/networking/udplite.txt diff --git a/draft/man7/unicode.7 b/draft/man7/unicode.7 new file mode 100644 index 00000000..c7c24426 --- /dev/null +++ b/draft/man7/unicode.7 @@ -0,0 +1,540 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) Markus Kuhn, 1995, 2001 +.\" +.\" 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. +.\" +.\" 1995-11-26 Markus Kuhn +.\" First version written +.\" 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: +.\" +.TH UNICODE 7 2001-05-11 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O Unicode \- the 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))" +¤òÄêµÁ¤·¤Æ¤¤¤ë¡£ +UCS ¤Ï¾µ¬³Ê¤Îʸ»ú½¸¹ç¤Îʸ»ú¤òÁ´¤Æ´Þ¤ó¤Ç¤¤¤ë¡£ +¤µ¤é¤Ë¡¢ +.B "ÁÐÊý¸þ¤Î¸ß´¹À­ (round-trip compatibility)" +¤òÊݾڤ¹¤ë¡£ +Î㤨¤Ð¾¤ÎÉä¹æ¤«¤é 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 ¤Ï¸½¼ÂŪ¤ËÃΤé¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¸À¸ì¤òɽ¸½¤¹¤ë¤Î¤ËɬÍפÊʸ»ú¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +¤³¤ì¤Ë¤Ï¥é¥Æ¥óʸ»ú¡¢¥®¥ê¥·¥ãʸ»ú¡¢¥­¥ê¥ëʸ»ú¡¢¥Ø¥Ö¥é¥¤Ê¸»ú¡¢¥¢¥é¥Ó¥¢Ê¸»ú¡¢ +¥¢¥ë¥á¥Ë¥¢Ê¸»ú¡¢¥°¥ë¥¸¥¢Ê¸»ú¤À¤±¤Ç¤Ê¤¯¡¢Ãæ¹ñ¡¦ÆüËÜ¡¦´Ú¹ñ¤Ç»È¤ï¤ì¤Æ¤¤¤ë´Á»ú¡¢ +¤µ¤é¤Ë¤Ï¡¢Ê¿²¾Ì¾¡¢ÊÒ²¾Ì¾¡¢¥Ï¥ó¥°¥ëʸ»ú¡¢ +¥Ç¡¼¥ô¥¡¥Ê¡¼¥¬¥ê¡¼Ê¸»ú¡¢¥Ù¥ó¥¬¥ëʸ»ú¡¢¥°¥ë¥à¥­¡¼Ê¸»ú¡¢¥°¥¸¥ã¥é¡¼¥Èʸ»ú¡¢ +¥ª¥ê¥ä¡¼Ê¸»ú¡¢¥¿¥ß¡¼¥ëʸ»ú¡¢¥Æ¥ë¥°Ê¸»ú¡¢¥«¥Ê¥éʸ»ú¡¢¥Þ¥é¥ä¡¼¥é¥àʸ»ú¡¢ +¥¿¥¤Ê¸»ú¡¢¥é¥ª¥¹Ê¸»ú¡¢¥¯¥á¡¼¥ëʸ»ú¡¢¥Ü¥Ý¥â¥Õ¥©Ê¸»ú (Ãí²»»úÊì)¡¢ +¥Á¥Ù¥Ã¥Èʸ»ú¡¢¥ë¡¼¥óʸ»ú¡¢¥¨¥Á¥ª¥Ô¥¢Ê¸»ú¡¢¥«¥Ê¥À²»Àáʸ»ú¡¢ +¥Á¥§¥í¥­¡¼Ê¸»ú¡¢¥â¥ó¥´¥ëʸ»ú¡¢ +¥ª¥¬¥àʸ»ú¡¢¥ß¥ã¥ó¥Þ¡¼Ê¸»ú¡¢¥·¥ó¥Ï¥éʸ»ú¡¢ +¥¿¡¼¥Êʸ»ú¡¢¥¤ (׳) ʸ»ú¤Ê¤É¤¬´Þ¤Þ¤ì¤ë¡£ +.\"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, +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. +¤³¤Îµ¬³Ê¤Ç¤Ï 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 ¤ÇÄɲ䵤줿Êä½õÌ̤ϡ¢ +ÆÃÄê¤Î²Ê³ØʬÌ¼­½ñ½ÐÈÇ¡¦°õºþ»º¶È¡¦¹â¼¡¥×¥í¥È¥³¥ë¡¦ +²¿¤«¤Î¥Õ¥¡¥ó¤Î´Ö¤Ê¤É¤Ç»È¤ï¤ì¤ëÆüì¤Êʸ»ú¤À¤±¤ò¥«¥Ð¡¼¤¹¤ë¡£ +.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 backwards compatibility with ASCII processing software and +.\"O .B UTF-16 +.\"O for the backwards compatible handling of non-BMP characters up to +.\"O 0x10ffff by UCS-2 software. +¤µ¤é¤Ë¡¢ASCII ¤ò½èÍý¤¹¤ë¥½¥Õ¥È¥¦¥§¥¢¤Ø¤Î²¼°Ì¸ß´¹¤Î¤¿¤á¤Ë +.B UTF-8 +¥¨¥ó¥³¡¼¥É·Á¼°¤¬¤¢¤ë¡£ +¤Þ¤¿¡¢0x10ffff ¤Þ¤Ç¤ÎÈó BMP ʸ»ú¤ò°·¤¦ +UCS-2 Âбþ¥½¥Õ¥È¥¦¥§¥¢¤È¤Î¸ß´¹¤Î¤¿¤á¤Ë +.B UTF-16 +¥¨¥ó¥³¡¼¥É·Á¼°¤¬¤¢¤ë¡£ +.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 +.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)" +¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Ï¥¿¥¤¥×¥é¥¤¥¿¡¼¤Î°ÜÆ°¤·¤Ê¤¤¥¢¥¯¥»¥ó¥È¡¦¥­¡¼¤Ë»÷¤Æ¤¤¤ë¡£ +¹çÀ®Ê¸»ú¤ÏľÁ°¤Îʸ»ú¤Ë¥¢¥¯¥»¥ó¥È¤Î¤ß¤ò²Ã¤¨¤ë¡£ +ºÇ¤â½ÅÍפʥ¢¥¯¥»¥ó¥ÈÉÕ¤­¤Îʸ»ú¤Ï¤½¤ì¼«¿È¤Î¥³¡¼¥É¤ò UCS ¤Ë»ý¤Ã¤Æ¤¤¤ë¡£ +°ìÊý¤Ç¹çÀ®Ê¸»úµ¡¹½¤ÏÁ´¤Æ¤Îʸ»ú¤Ë¥¢¥¯¥»¥ó¥È¤äȯ²»¶èÊÌÉä¹æ¤ò²Ã¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¹çÀ®Ê¸»ú¤Ï¾ï¤Ë¤½¤ì¤¬½¤Àµ¤¹¤ëʸ»ú¤Ë³¤¯¡£ +Î㤨¤Ð¥É¥¤¥Ä¸ì¤Îʸ»ú A ¥¦¥à¥é¥¦¥È ("Latin capital letter A with diaeresis") ¤Ï +UCS ¤ËÁ°¤â¤Ã¤Æ½àÈ÷¤µ¤ì¤¿¥³¡¼¥É 0x00c4 ¤Ç¤â¡¢ +Ä̾ï¤Î A "Latin capital letter A" ¤Ë +"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 +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 ¥Ï¥ó¥°¥ë¡¦¥¸¥ã¥âʸ»ú +(¤¤¤í¤¤¤í¤Ê´Ú¹ñ¡¦Ä«Á¯Ê¸»ú¤ÎÉä¹æ²½¡£ +¤³¤ÎÉä¹æ²½¤Ç¤Ï¡¢¥Ï¥ó¥°¥ë²»Àá¤Î¥°¥ê¥Õ¤¬ +3 ¤Ä¤Þ¤¿¤Ï 2 ¤Ä¤ÎÊì²»¡¦»Ò²»¥³¡¼¥É¤ÎÁȤ߹ç¤ï¤»¤ÇÉä¹æ²½¤µ¤ì¤ë) ¤Ï¥µ¥Ý¡¼¥È¤·¤Ê¤¤¡£ +.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 +Level 3 +.\"O All +.\"O .B UCS +.\"O characters are supported. +Á´¤Æ¤Î +.B UCS +ʸ»ú¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +.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 +¤Î 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 ¤ÎÊä½õÌ̤¬Äɲ䵤ì¤Æ¤¤¤ë¡£ +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 ¥Ó¥Ã¥ÈÀ°¿ô·¿¤Ç¤¢¤ë¡£ +¤½¤ÎÃÍ¤Ï C ¥é¥¤¥Ö¥é¥ê¤Ë¤è¤ê (¤¹¤Ù¤Æ¤Î¥í¥±¡¼¥ë¤Ë¤ª¤¤¤Æ) ¾ï¤Ë +.B UCS +¥³¡¼¥É¤ÎÃͤȤ·¤Æ²ò¼á¤µ¤ì¤ë¡£ +¤³¤ì¤ò GNU C ¥é¥¤¥Ö¥é¥ê¤¬¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÃΤ餻¤ë¤¿¤á¤Îµ¬Ìó¤È¤·¤Æ¡¢ +Äê¿ô +.B __STDC_ISO_10646__ +¤òÄêµÁ¤¹¤ë¡£ +¤³¤ì¤Ï 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 +¥Þ¥ë¥Á¥Ð¥¤¥È¥¨¥ó¥³¡¼¥É¤Ç¤Ï¡¢Æþ½ÐÎÏ¥¹¥È¥ê¡¼¥à¡¦Ã¼ËöÄÌ¿®¡¦ +¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¡¦¥Õ¥¡¥¤¥ë̾¡¦´Ä¶­ÊÑ¿ô¤Ë¤ª¤¤¤Æ¡¢ +UCS/Unicode ¤ò ASCII ¤Î¤è¤¦¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +UTF-8 ¤òʸ»ú¥¨¥ó¥³¡¼¥É¤È¤·¤Æ»È¤¦¤³¤È¤ò +Á´¤Æ¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÃΤ餻¤ë¤¿¤á¤Ë¤Ï¡¢ +("LANG=en_GB.UTF-8" ¤Î¤è¤¦¤Ë) ´Ä¶­ÊÑ¿ô¤ò»È¤Ã¤ÆŬÀÚ¤Ê +.I ¥í¥±¡¼¥ë (locale) +¤òÁªÂò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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) +¤È¤¤¤Ã¤¿¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï¡¢ +ʸ»ú½ÐÎϤǤɤì¤À¤±¥«¡¼¥½¥ë¤¬¿Ê¤ó¤À¤« (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) ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤·¤«¤·°ìÈÌŪ¤Ë¸À¤¨¤Ð¡¢¤â¤·²Äǽ¤Ê¤é¤Ð¤¢¤é¤«¤¸¤á¹çÀ®¤·¤¿Ê¸»ú¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë +(Unicode ¤Ç¤Ï¡¢¤³¤ì¤ò +.B "Normalization Form C (¹çÀ®Ê¸»ú¤ÎÀµµ¬²½·Á¼°)" +¤È¤¤¤¦)¡£ +.\"O .SS Private Area +.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 ¤ÎÈϰϤϡ¢µ¬³Ê¤Ç¤Ï¤¤¤«¤Ê¤ëʸ»ú¤â³ä¤êÅö¤Æ¤º¡¢ +»äŪ¤Ê»ÈÍѤΤ¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +Linux ¥³¥ß¥å¥Ë¥Æ¥£¤Ç¤Ï¡¢ +¤³¤Î¥×¥é¥¤¥Ù¡¼¥È¡¦¥¨¥ê¥¢¤ò¤µ¤é¤ËºÙ¤«¤¯Ê¬³ä¤·¤Æ»ÈÍѤ¹¤ë¡£ +0xe000 ¡Á 0xefff ¤ÎÈϰϤϥ¨¥ó¥É¡¦¥æ¡¼¥¶¡¼¤¬¸Ä¡¹¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +0xf000 ¡Á 0xf8ff ¤ÎÈÏ°Ï¤Ï Linux Zone ¤Ç +Á´¤Æ¤Î Linux ¥æ¡¼¥¶¡¼¤Ç¶¦Ä̤˻ÈÍѤ¹¤ë¡£ +Linux Zone ¤Ø¤Îʸ»ú³ä¤êÅö¤Æ¤ÎÅÐÏ¿¤Ï¡¢ +¸½ºß H. Peter Anvin ¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SS Literature +.SS ʸ¸¥ +.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. + +.\"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 +* +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. + +.\"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 +* +.\"O Unicode Technical Reports. +Unicode µ»½Ñ¥ì¥Ý¡¼¥È¡£ +.RS +http://www.unicode.org/unicode/reports/ +.RE +.TP +* +.\"O Markus Kuhn: UTF-8 and Unicode FAQ for Unix/Linux. +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 +¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤ò¹ØÆɤ¹¤ë¤¿¤á¤Î¾ðÊ󤬤¢¤ë¡£ +Linux ¤Ç Unicode ¤ò»È¤¦¾ì¹ç¤Î¥¢¥É¥Ð¥¤¥¹¤òõ¤¹¤Î¤Ë°ìÈÖÎɤ¤¾ì½ê¤Ç¤¢¤ë¡£ +.RE +.TP +* +Bruno Haible: Unicode HOWTO. +.RS +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 +¥µ¥Ý¡¼¥È¤Ï´°À®¤·¤Æ¤¤¤ë¡£ +XFree86 ¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ï¿Ê¹ÔÃæ¤Ç¤¢¤ë¡£ +.B UTF-8 +¥í¥±¡¼¥ë¤Ç²÷Ŭ¤Ë»È¤¨¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó +(¿¤¯¤Îͭ̾¤Ê¥¨¥Ç¥£¥¿) ¤ÎºîÀ®¤Ï¡¢¤Þ¤À¿Ê¹ÔÃæ¤Ç¤¢¤ë¡£ +.\"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 ¥ï¥¤¥Éʸ»ú¤¬Ä󶡤µ¤ì¤ë¡£ +ñ½ã¤Ê½Å¤ÍÂǤÁ¤Ë¤è¤ë¹çÀ®Ê¸»ú¤¬Ä󶡤µ¤ì¤ë¾ì¹ç¤â¤¢¤ë¡£ +¤·¤«¤·¡¢±¦¤«¤éº¸¤Ø½ñ¤¯Ê¸»ú¤ä¥Ø¥Ö¥é¥¤Ê¸»ú¡¦¥¢¥é¥Ó¥¢Ê¸»ú¡¦¥¤¥ó¥É¸ì·Ïʸ»ú¤Ê¤É¤Î +¹ç»ú¤ÎÃÖ¤­´¹¤¨¤òɬÍפȤ¹¤ëʸ»ú¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"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) diff --git a/draft/man7/units.7 b/draft/man7/units.7 new file mode 100644 index 00000000..9473b5f0 --- /dev/null +++ b/draft/man7/units.7 @@ -0,0 +1,206 @@ +'\" t +.\" 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) 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 +.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 ¥ï¥Ã¥È¤Ç¤¢¤ë¡£ +¼¡¤Ëɸ½àŪ¤ÊÀÜƬ¸ì¤ò¼¨¤¹¡£ +.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 +da ¥Ç¥«(deka) 10^ 1 = 10 +h ¥Ø¥¯¥È(hecto) 10^ 2 = 100 +k ¥­¥í(kilo) 10^ 3 = 1000 +M ¥á¥¬(mega) 10^ 6 = 1000000 +G ¥®¥¬(giga) 10^ 9 = 1000000000 +T ¥Æ¥é(tera) 10^12 = 1000000000000 +P ¥Ú¥¿(peta) 10^15 = 1000000000000000 +E ¥¨¥¯¥µ(exa) 10^18 = 1000000000000000000 +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 ¤È½ñ¤«¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ +.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" ¤ò­¤·¤¿¤â¤Î¤Ë¤Ê¤ë¡£ +.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 +Ti ¥Æ¥Ó(tebi) 2^40 = 1099511627776 +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 +¤â»²¹Í¤Ë¤·¤Æ¤Û¤·¤¤¡£ +.\"O .SS Discussion +.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 ¿Ê¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¤¿¤á¤Ë¤µ¤é¤ËÂçʸ»ú¤Ë¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤«¤Ã¤¿¡£ + +.\"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 ¤Ç¤¢¤ë¡£ + +.\"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 ¿ÊÍѤÎÀÜƬ¸ì¤ò¾µÇ§¤·¡¢ +¤³¤ì¤Ë¤è¤Ã¤Æξ¼Ô¤ò¤Ï¤Ã¤­¤ê¶èÊ̤¹¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤Ã¤¿¡£ + +.\"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 +.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/unix.7 b/draft/man7/unix.7 new file mode 100644 index 00000000..6e13ce94 --- /dev/null +++ b/draft/man7/unix.7 @@ -0,0 +1,674 @@ +.\" This man page is Copyright (C) 1999 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. +.\" +.\" Modified, 2003-12-02, Michael Kerrisk, +.\" Modified, 2003-09-23, Adam Langley +.\" Modified, 2004-05-27, Michael Kerrisk, +.\" Added SOCK_SEQPACKET +.\" 2008-05-27, mtk, Provide a clear description of the three types of +.\" address that can appear in the sockaddr_un structure: pathname, +.\" unnamed, and abstract. +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito and +.\" NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" based on the work by Shouichi Saito +.\" Updated 2003-01-07, Akihiro MOTOKI +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" Updated 2005-12-26, Akihiro MOTOKI +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD abstract namespace Ãê¾Ý̾Á°¶õ´Ö +.\"WORD anonymous socket ̾Á°Ìµ¤·¥½¥±¥Ã¥È +.\"WORD credential ¿®Ç¤¾õ +.\"WORD ancillary message Êä½õ¥á¥Ã¥»¡¼¥¸ +.\"WORD file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\" +.\" ÌõÃí: Ìõ¤¹ºÝ¤â Unix ¤Ï capitalize ¤·¤Æ¤ª¤¯¤³¤È¡£ +.\" LDP_man-pages 1.66¢ª2.01 ¤Ë¤ª¤¤¤Æ unix ¢ª Unix ¤ÎÊѹ¹¤¬¤¢¤ê¡¢ +.\" °Õ¿ÞŪ¤Êɽµ­¤È»×¤ï¤ì¤ë¡£ +.\" +.TH UNIX 7 2008-12-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O unix, AF_UNIX, AF_LOCAL \- Sockets for local +.\"O interprocess communication +unix, AF_UNIX, AF_LOCAL \- ¥í¡¼¥«¥ë¤Ê +¥×¥í¥»¥¹´ÖÄÌ¿®ÍѤΥ½¥±¥Ã¥È +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include + +.IB unix_socket " = socket(AF_UNIX, type, 0);" +.br +.IB error " = socketpair(AF_UNIX, type, 0, int *" sv ");" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .B AF_UNIX +.\"O (also known as +.\"O .BR AF_LOCAL ) +.\"O socket family is used to communicate between processes on the same machine +.\"O efficiently. +.\"O Traditionally, Unix sockets can be either unnamed, +.\"O or bound to a file system pathname (marked as being of type socket). +.B AF_UNIX +.RB ( AF_LOCAL +¤È¤â¸À¤ï¤ì¤ë) ¥½¥±¥Ã¥È¥Õ¥¡¥ß¥ê¡¼¤Ï¡¢Æ±¤¸¥Þ¥·¥ó¾å¤Ç¥×¥í¥»¥¹Æ±»Î¤¬ +¸úΨŪ¤ËÄÌ¿®¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +ÅÁÅýŪ¤Ë¡¢Unix ¥½¥±¥Ã¥È¤Ï¡¢Ì¾Á°¤Ê¤·¤Ë¤â¤Ç¤­¤ë¤·¡¢ +(¥½¥±¥Ã¥È·¿¤Ç¤¢¤ë¤È°õ¤Î¤Ä¤¤¤¿) ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ñ¥¹Ì¾¤Ë +·ë¤ÓÉÕ¤±¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.\"O Linux also supports an abstract namespace which is independent of the +.\"O file system. +¤µ¤é¤Ë Linux ¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Ê¤¤ +Ãê¾Ý̾Á°¶õ´Ö (abstract namespace) ¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ + +.\"O Valid types are: +.\"O .BR SOCK_STREAM , +.\"O for a stream-oriented socket and +.\"O .BR SOCK_DGRAM , +.\"O for a datagram-oriented socket that preserves message boundaries +.\"O (as on most Unix implementations, Unix domain datagram +.\"O sockets are always reliable and don't reorder datagrams); +.\"O and (since Linux 2.6.4) +.\"O .BR SOCK_SEQPACKET , +.\"O for a connection-oriented socket that preserves message boundaries +.\"O and delivers messages in the order that they were sent. +.\" MOTOKI: ¸«¤ä¤¹¤¤¤è¤¦¤Ë .TP ·Á¼°¤ËÊѹ¹ +Í­¸ú¤Ê¥¿¥¤¥×¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.TP +.B SOCK_STREAM +¥¹¥È¥ê¡¼¥à»Ø¸þ¤Î¥½¥±¥Ã¥È +.TP +.B SOCK_DGRAM +¥á¥Ã¥»¡¼¥¸¶­³¦¤òÊݸ¤¹¤ë¥Ç¡¼¥¿¥°¥é¥à»Ø¸þ¤Î¥½¥±¥Ã¥È +(¤Û¤È¤ó¤É¤Î Unix ¤Î¼ÂÁõ¤Ç¤Ï¡¢Unix ¥É¥á¥¤¥ó¡¦¥Ç¡¼¥¿¥°¥é¥à¡¦¥½¥±¥Ã¥È¤Ï +¾ï¤Ë¿®Íê¤Ç¤­¡¢¥Ç¡¼¥¿¥°¥é¥à¤ÎʤÓÂؤ¨¤Ï¹Ô¤ï¤Ê¤¤) +.TP +.B SOCK_SEQPACKET +(Linux 2.6.4 °Ê¹ß¤ÇÍøÍѤǤ­¤ë) +¥á¥Ã¥»¡¼¥¸¶­³¦¤òÊݸ¤·¡¢Á÷¿®¤µ¤ì¤¿½ç½ø¤Ç¥á¥Ã¥»¡¼¥¸¤òÆϤ±¤ëÀܳ»Ø¸þ¥½¥±¥Ã¥È + +.\"O Unix sockets support passing file descriptors or process credentials +.\"O to other processes using ancillary data. +Unix ¥½¥±¥Ã¥È¤Ç¤Ï¡¢Êä½õ¥Ç¡¼¥¿¤ò»È¤Ã¤Æ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ä¥×¥í¥»¥¹¤Î¿®Ç¤¾õ (credential) ¤ò +Á÷¼õ¿®¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.\"O .SS Address Format +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.\"O A Unix domain socket address is represented in the following structure: +Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤Î¥¢¥É¥ì¥¹¤Ï°Ê²¼¤Î¹½Â¤ÂΤÇɽ¸½¤µ¤ì¤ë¡£ +.in +4n +.nf + +#define UNIX_PATH_MAX 108 + +struct sockaddr_un { + sa_family_t sun_family; /* AF_UNIX */ + char sun_path[UNIX_PATH_MAX]; /* pathname */ +}; +.fi +.in +.PP +.\"O .I sun_family +.\"O always contains +.\"O .BR AF_UNIX . +.I sun_family +¤Ë¤Ïɬ¤º +.B AF_UNIX +¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ + +.\"O Three types of address are distinguished in this structure: +¤³¤Î¹½Â¤ÂÎ¤Ç¤Ï 3 ¼ïÎà¤Î¥¢¥É¥ì¥¹¤¬¶èÊ̤µ¤ì¤ë¡£ +.IP * 3 +.\"O .IR pathname : +.\"O a Unix domain socket can be bound to a null-terminated file +.\"O system pathname using +.\"O .BR bind (2). +.\"O When the address of the socket is returned by +.\"O .BR getsockname (2), +.\"O .BR getpeername (2), +.\"O and +.\"O .BR accept (2), +.\"O its length is +.\"O .IR "sizeof(sa_family_t) + strlen(sun_path) + 1" , +.\"O and +.\"O .I sun_path +.\"O contains the null-terminated pathname. +.IR "pathname (¥Ñ¥¹Ì¾)" : +.BR bind (2) +¤ò»È¤Ã¤Æ¡¢Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤ò NULL ½ªÃ¼¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î +¥Ñ¥¹Ì¾¤Ë·ë¤ÓÉÕ¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR getsockname (2), +.BR getpeername (2), +.BR accept (2) +¤¬¥½¥±¥Ã¥È¤Î¥¢¥É¥ì¥¹¤òÊÖ¤¹ºÝ¤Ë¤Ï¡¢ +¤½¤ÎŤµ¤Ï +.I "sizeof(sa_family_t) + strlen(sun_path) + 1" +¤Ç¤¢¤ê¡¢ +.I sun_path +¤Ë NULL ½ªÃ¼¤µ¤ì¤¿¥Ñ¥¹Ì¾¤¬³ÊǼ¤µ¤ì¤ë¡£ +.IP * +.\"O .IR unnamed : +.\"O A stream socket that has not been bound to a pathname using +.\"O .BR bind (2) +.\"O has no name. +.\"O Likewise, the two sockets created by +.\"O .BR socketpair (2) +.\"O are unnamed. +.\"O When the address of an unnamed socket is returned by +.\"O .BR getsockname (2), +.\"O .BR getpeername (2), +.\"O and +.\"O .BR accept (2), +.\"O its length is +.\"O .IR "sizeof(sa_family_t)" , +.\"O and +.\"O .I sun_path +.\"O should not be inspected. +.\"O .\" There is quite some variation across implementations: FreeBSD +.\"O .\" says the length is 16 bytes, HP-UX 11 says it's zero bytes. +.IR "unnamed (̾Á°¤Ê¤·)" : +.BR bind (2) +¤ò»È¤Ã¤Æ¥Ñ¥¹Ì¾¤Ë·ë¤ÓÉÕ¤±¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¥¹¥È¥ê¡¼¥à·¿¤Î¥½¥±¥Ã¥È¤Ï +̾Á°¤ò»ý¤¿¤Ê¤¤¡£Æ±Íͤˡ¢ +.BR socketpair (2) +¤ÇºîÀ®¤µ¤ì¤ë 2 ¤Ä¤Î¥½¥±¥Ã¥È¤â̾Á°¤ò»ý¤¿¤Ê¤¤¡£ +.BR getsockname (2), +.BR getpeername (2), +.BR accept (2) +¤¬Ì¾Á°¤Ê¤·¤Î¥½¥±¥Ã¥È¤Î¥¢¥É¥ì¥¹¤òÊÖ¤¹ºÝ¤Ë¤Ï¡¢ +¤½¤ÎŤµ¤Ï +.I "sizeof(sa_family_t)" +¤Ç¤¢¤ê¡¢ +.I sun_path +¤Ï¸¡ºº¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\" ¼ÂÁõ¤´¤È¤Ë¤«¤Ê¤ê¤Î°ã¤¤¤¬Â¸ºß¤¹¤ë¡£ +.\" FreeBSD ¤Ç¤ÏŤµ¤Ï 16 ¥Ð¥¤¥È¤È¤Ê¤ê¡¢HP-UX ¤Ç¤ÏŤµ¤Ï 0 ¥Ð¥¤¥È¤È¤Ê¤ë¡£ +.IP * +.\"O .IR abstract : +.\"O an abstract socket address is distinguished by the fact that +.\"O .IR sun_path[0] +.\"O is a null byte ('\\0'). +.\"O All of the remaining bytes in +.\"O .I sun_path +.\"O define the "name" of the socket. +.\"O (Null bytes in the name have no special significance.) +.\"O The name has no connection with file system pathnames. +.IR "abstract (Ãê¾Ý)" : +Ãê¾Ý¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï¡¢ +.I sun_path[0] +¤¬¥Ì¥ë¥Ð¥¤¥È ('\\0') ¤Ç¤¢¤ë¤³¤È¤«¤é¶èÊ̤Ǥ­¤ë¡£ +.I sun_path +¤Î»Ä¤ê¤ÎÁ´¥Ð¥¤¥È¤Ë¤è¤ê¥½¥±¥Ã¥È¤Î¡Ö̾Á°¡×¤¬ÄêµÁ¤µ¤ì¤ë +(̾Á°Ãæ¤Î¥Ì¥ë¥Ð¥¤¥È¤Ë¤ÏÆÃÊ̤ʰÕÌ£¤Ï¤Ê¤¤)¡£ +¤³¤Î̾Á°¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ñ¥¹Ì¾¤È¤Ï²¿¤Î´Ø·¸¤â¤Ê¤¤¡£ +.\"O The socket's address in this namespace is given by the rest of the +.\"O bytes in +.\"O .IR sun_path . +.\"O When the address of an abstract socket is returned by +.\"O .BR getsockname (2), +.\"O .BR getpeername (2), +.\"O and +.\"O .BR accept (2), +.\"O its length is +.\"O .IR "sizeof(struct sockaddr_un)" , +.\"O and +.\"O .I sun_path +.\"O contains the abstract name. +.\"O The abstract socket namespace is a nonportable Linux extension. +¤³¤Î̾Á°¶õ´Ö¤Ë¤ª¤±¤ë¥½¥±¥Ã¥È¤Î¥¢¥É¥ì¥¹¤Ï¡¢ +.I sun_path +¤Î»Ä¤ê¤Î¥Ð¥¤¥È¤Çɽ¤µ¤ì¤ë¡£ +.BR getsockname (2), +.BR getpeername (2), +.BR accept (2) +¤¬Ãê¾Ý¥½¥±¥Ã¥È¤Î¥¢¥É¥ì¥¹¤òÊÖ¤¹ºÝ¤Ë¤Ï¡¢¤½¤ÎŤµ¤Ï +.I "sizeof(struct sockaddr_un)" +¤Ç¤¢¤ê¡¢ +.I sun_path +¤ËÃê¾Ý̾Á°¶õ´Ö¤Î̾Á°¤¬³ÊǼ¤µ¤ì¤ë¡£ +¥½¥±¥Ã¥È¤ÎÃê¾Ý̾Á°¶õ´Ö¤Ï Linux ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ê¡¢°Ü¿¢À­¤Ï¤Ê¤¤¡£ +.\"O .SS Socket Options +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.\"O For historical reasons these socket options are specified with a +.\"O .B SOL_SOCKET +.\"O type even though they are +.\"O .B AF_UNIX +.\"O specific. +.\"O They can be set with +.\"O .BR setsockopt (2) +.\"O and read with +.\"O .BR getsockopt (2) +.\"O by specifying +.\"O .B SOL_SOCKET +.\"O as the socket family. +Îò»ËŪ¤ÊÍýͳ¤Ë¤è¤ê¡¢¤³¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤Ï +¤¿¤È¤¨ +.B AF_UNIX +¸ÇÍ­¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤Ã¤Æ¤â +.B SOL_SOCKET +·¿¤Ç»ØÄꤹ¤ë¡£ +¥½¥±¥Ã¥È¥Õ¥¡¥ß¥ê¡¼¤È¤·¤Æ +.B SOL_SOCKET +¤ò»ØÄꤹ¤ë¤È¡¢ +.BR setsockopt (2) +¤Ç¥ª¥×¥·¥ç¥ó¤¬ÀßÄê¤Ç¤­¡¢ +.BR getsockopt (2) +¤Ç¼èÆÀ¤¬¤Ç¤­¤ë¡£ +.\" NAKANO added this TP +.TP +.B SO_PASSCRED +.\"O Enables the receiving of the credentials of the sending process +.\"O ancillary message. +.\"O When this option is set and the socket is not yet connected +.\"O a unique name in the abstract namespace will be generated automatically. +.\"O Expects an integer boolean flag. +Á÷¿®¥×¥í¥»¥¹¤ÎÊä½õ¥á¥Ã¥»¡¼¥¸¤È¤·¤Æ¿®Ç¤¾õ¤ò¼õ¿®¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Æ¡¢¤Þ¤À¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢ +Ãê¾Ý̾Á°¶õ´Ö¤Ë¾¤È½Å¤Ê¤é¤Ê¤¤Ì¾Á°¤¬¼«Æ°Åª¤ËÀ¸À®¤µ¤ì¤ë¡£ +¥Ö¡¼¥ëÀ°¿ôÃͤΥե饰¤ò¼è¤ë¡£ +.\"O .SS Sockets API +.SS ¥½¥±¥Ã¥È API +.\"O The following paragraphs describe domain-specific details and +.\"O unsupported features of the sockets API for Unix domain sockets on Linux. +¤³¤ÎÀá¤Ç¤Ï¡¢Linux ¤Î Unix ¥É¥á¥¤¥ó¡¦¥½¥±¥Ã¥È¤Ç¤Î¡¢ +¥É¥á¥¤¥ó¸ÇÍ­¤Î¾ÜºÙ»ÅÍͤȥ½¥±¥Ã¥È API ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤µ¡Ç½¤Ë +¤Ä¤¤¤ÆÀâÌÀ¤¹¤ë¡£ + +.\"O Unix domain sockets do not support the transmission of +.\"O out-of-band data (the +.\"O .B MSG_OOB +.\"O flag for +.\"O .BR send (2) +.\"O and +.\"O .BR recv (2)). +Unix ¥É¥á¥¤¥ó¡¦¥½¥±¥Ã¥È¤Ç¤Ï¡¢ÂÓ°è³°¥Ç¡¼¥¿ (out-of-band data) ¤Î +Á÷¿® +.RB ( send (2) +¤È +.BR recv (2) +¤Î +.B MSG_OOB +¥Õ¥é¥°) ¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"O The +.\"O .BR send (2) +.\"O .B MSG_MORE +.\"O flag is not supported by Unix domain sockets. +.BR send (2) +.B MSG_MORE +¥Õ¥é¥°¤Ï Unix ¥É¥á¥¤¥ó¡¦¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"O The use of +.\"O .B MSG_TRUNC +.\"O in the +.\"O .I flags +.\"O argument of +.\"O .BR recv (2) +.\"O is not supported by Unix domain sockets. +.BR recv (2) +¤Î +.I flags +°ú¤­¿ô¤Ç¤Î +.B MSG_TRUNC +¤Î»ÈÍÑ¤Ï Unix ¥É¥á¥¤¥ó¡¦¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.\"O The +.\"O .B SO_SNDBUF +.\"O socket option does have an effect for Unix domain sockets, but the +.\"O .B SO_RCVBUF +.\"O option does not. +.\"O For datagram sockets, the +.\"O .B SO_SNDBUF +.\"O value imposes an upper limit on the size of outgoing datagrams. +.\"O This limit is calculated as the doubled (see +.\"O .BR socket (7)) +.\"O option value less 32 bytes used for overhead. +.B SO_SNDBUF +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ï Unix ¥É¥á¥¤¥ó¡¦¥½¥±¥Ã¥È¤Ç¸ú²Ì¤ò»ý¤Ä¤¬¡¢ +.B SO_RCVBUF +¤Ï¸ú²Ì¤¬¤Ê¤¤¡£ +¥Ç¡¼¥¿¥°¥é¥à¡¦¥½¥±¥Ã¥È¤Ç¤Ï¡¢ +.B SO_SNDBUF +¤ÎÃͤ¬½ÐÎϥǡ¼¥¿¥°¥é¥à¤Î¾å¸Â¥µ¥¤¥º¤È¤Ê¤ë¡£ +¼ÂºÝ¤Î¾å¸ÂÃͤϡ¢ +.B SO_SNDBUF +¥ª¥×¥·¥ç¥ó¤È¤·¤ÆÀßÄꤵ¤ì¤¿ÃͤΠ2ÇÜ +.RB ( socket (7) +»²¾È) ¤«¤é¥ª¡¼¥Ð¥Ø¥Ã¥É¤È¤·¤Æ»ÈÍѤµ¤ì¤ë 32 ¥Ð¥¤¥È¤ò°ú¤¤¤¿ÃͤȤʤ롣 +.\"O .SS Ancillary Messages +.SS Êä½õ¥á¥Ã¥»¡¼¥¸ +.\"O Ancillary data is sent and received using +.\"O .BR sendmsg (2) +.\"O and +.\"O .BR recvmsg (2). +Êä½õ¥Ç¡¼¥¿¤òÁ÷¼õ¤¹¤ë¤Ë¤Ï¡¢ +.BR sendmsg (2) +¤ä +.BR recvmsg (2) +¤ò»ÈÍѤ¹¤ë¡£ +.\"O For historical reasons the ancillary message types listed below +.\"O are specified with a +.\"O .B SOL_SOCKET +.\"O type even though they are +.\"O .B AF_UNIX +.\"O specific. +Îò»ËŪ¤ÊÍýͳ¤Ë¤è¤ê¡¢°Ê²¼¤Ë¼¨¤¹Êä½õ¥á¥Ã¥»¡¼¥¸¤Î·¿¤Ï +¤¿¤È¤¨ +.B AF_UNIX +¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤Ã¤Æ¤â +.B SOL_SOCKET +·¿¤Ç»ØÄꤹ¤ë¡£ +.\"O To send them set the +.\"O .I cmsg_level +.\"O field of the struct +.\"O .I cmsghdr +.\"O to +.\"O .B SOL_SOCKET +.\"O and the +.\"O .I cmsg_type +.\"O field to the type. +.\"O For more information see +.\"O .BR cmsg (3). +¤³¤ì¤é¤òÁ÷¤ë¤Ë¤Ï¡¢¹½Â¤ÂÎ +.I cmsghdr +¤Î +.I cmsg_level +¥Õ¥£¡¼¥ë¥É¤Ë +.B SOL_SOCKET +¤ò¥»¥Ã¥È¤·¡¢ +.I cmsg_type +¥Õ¥£¡¼¥ë¥É¤Ë¥¿¥¤¥×¤ò¥»¥Ã¥È¤¹¤ë¡£ +¾ÜºÙ¤Ï +.BR cmsg (3) +¤ò¸«¤è¡£ +.TP +.B SCM_RIGHTS +.\"O Send or receive a set of open file descriptors from another process. +.\"O The data portion contains an integer array of the file descriptors. +.\"O The passed file descriptors behave as though they have been created with +.\"O .BR dup (2). +¾¤Î¥×¥í¥»¥¹¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥»¥Ã¥È¤òÁ÷¼õ¿®¤¹¤ë¡£ +¥Ç¡¼¥¿Éôʬ¤Ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÀ°¿ôÇÛÎó¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +ÅϤµ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤¢¤¿¤«¤â +.BR dup (2) +¤ÇÀ¸À®¤µ¤ì¤¿¤«¤Î¤è¤¦¤Ë¿¶¤ëÉñ¤¦¡£ +.TP +.B SCM_CREDENTIALS +.\"O Send or receive Unix credentials. +.\"O This can be used for authentication. +.\"O The credentials are passed as a +.\"O .I struct ucred +.\"O ancillary message. +.\"O Thus structure is defined in +.\"O .I +.\"O as follows: +Unix ¿®Ç¤¾õ¤òÁ÷¼õ¿®¤¹¤ë¡£¤³¤ì¤Ïǧ¾Ú¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¿®Ç¤¾õ¤Ï¡¢ +.I struct ucred +¤ÎÊä½õ¥á¥Ã¥»¡¼¥¸¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct ucred { + pid_t pid; /* process ID of the sending process */ + uid_t uid; /* user ID of the sending process */ + gid_t gid; /* group ID of the sending process */ +}; +.fi +.in + +.\"O Since glibc 2.8, the +.\"O .B _GNU_SOURCE +.\"O feature test macro must be defined in order to obtain the definition +.\"O of this structure. +glibc 2.8 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¹½Â¤ÂΤÎÄêµÁ¤òÆÀ¤ë¤¿¤á¤Ë¤Ïµ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _GNU_SOURCE +¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\"O The credentials which the sender specifies are checked by the kernel. +.\"O A process with effective user ID 0 is allowed to specify values that do +.\"O not match its own. +Á÷¿®Â¦¤¬»ØÄꤷ¤¿¿®Ç¤¾õ¤Ï¡¢¥«¡¼¥Í¥ë¤¬¥Á¥§¥Ã¥¯¤¹¤ë¡£ +¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤Ë¤Ï¡¢ +¼«Ê¬¼«¿È°Ê³°¤ÎÃͤò»ØÄꤹ¤ë»ö¤¬µö¤µ¤ì¤ë¡£ +.\"O The sender must specify its own process ID (unless it has the capability +.\"O .BR CAP_SYS_ADMIN ), +.\"O its user ID, effective user ID, or saved set-user-ID (unless it has +.\"O .BR CAP_SETUID ), +.\"O and its group ID, effective group ID, or saved set-group-ID +.\"O (unless it has +.\"O .BR CAP_SETGID ). +Á÷¿®Â¦¤Ï°Ê²¼¤Î 3 ¤Ä¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +1) ¼«Ê¬¼«¿È¤Î¥×¥í¥»¥¹ ID +.RB ( CAP_SYS_ADMIN +¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢ +2) ¼«Ê¬¼«¿È¤Î¥æ¡¼¥¶¡¼ ID ¤¢¤ë¤¤¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤«Êݸ set-user-ID +.RB ( CAP_SETUID +¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢ +3) ¼«Ê¬¼«¿È¤Î¥°¥ë¡¼¥× ID ¤¢¤ë¤¤¤Ï¼Â¹Ô¥°¥ë¡¼¥× ID ¤«Êݸ set-group-ID +.RB ( CAP_SETGID +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç)¡£ +.\"O To receive a +.\"O .I struct ucred +.\"O message the +.\"O .B SO_PASSCRED +.\"O option must be enabled on the socket. +.I struct ucred +¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¥½¥±¥Ã¥È¤ËÂФ· +.B SO_PASSCRED +¥ª¥×¥·¥ç¥ó¤òÍ­¸ú¤Ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B EADDRINUSE +.\"O Selected local address is already taken or file system socket +.\"O object already exists. +ÁªÂò¤·¤¿¥½¥±¥Ã¥È¤¬´û¤ËÍѤ¤¤é¤ì¤Æ¤¤¤¿¡£¤Þ¤¿¤Ï¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥½¥±¥Ã¥È¥ª¥Ö¥¸¥§¥¯¥È¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤¿¡£ +.TP +.B ECONNREFUSED +.\"O .BR connect (2) +.\"O called with a socket object that isn't listening. +.\"O This can happen when +.\"O the remote socket does not exist or the filename is not a socket. +listen ¾õÂ֤ˤʤ¤¥½¥±¥Ã¥È¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ·¤Æ +.BR connect (2) +¤¬¸Æ¤Ð¤ì¤¿¡£¥ê¥â¡¼¥È¥½¥±¥Ã¥È¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¡¢ +¥Õ¥¡¥¤¥ë̾¤¬¥½¥±¥Ã¥È¤Ç¤Ï¤Ê¤«¤Ã¤¿¡¢¤Ê¤É¤Î¤È¤­¤Ëµ¯¤³¤ë¡£ +.TP +.B ECONNRESET +.\"O Remote socket was unexpectedly closed. +¥ê¥â¡¼¥È¥½¥±¥Ã¥È¤¬Í½´ü¤·¤Ê¤¤¤«¤¿¤Á¤Ç¥¯¥í¡¼¥º¤µ¤ì¤¿¡£ +.TP +.B EFAULT +.\"O User memory address was not valid. +¥æ¡¼¥¶¡¼¥á¥â¥ê¥¢¥É¥ì¥¹¤¬ÉÔÀµ¡£ +.TP +.B EINVAL +.\"O Invalid argument passed. +.\"O A common cause is the missing setting of AF_UNIX +.\"O in the +.\"O .I sun_type +.\"O field of passed addresses or the socket being in an +.\"O invalid state for the applied operation. +ÅϤ·¤¿°ú¿ô¤¬ÉÔÀµ¡£¤è¤¯¤¢¤ë¸¶°ø¤Ï¡¢ +ÅϤ·¤¿¥¢¥É¥ì¥¹¤Î +.I sun_type +¥Õ¥£¡¼¥ë¥É¤Ë AF_UNIX ¤òÀßÄꤷ¤Ê¤«¤Ã¤¿¡¢ +¹Ô¤ª¤¦¤È¤·¤¿Áàºî¤ËÂФ·¤Æ¥½¥±¥Ã¥È¤Î¾õÂÖ¤¬Í­¸ú¤Ç¤Ï¤Ê¤«¤Ã¤¿¡¢¤Ê¤É¡£ +.TP +.B EISCONN +.\"O .BR connect (2) +.\"O called on an already connected socket or a target address was +.\"O specified on a connected socket. +´û¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.BR connect (2) +¤¬¸Æ¤Ð¤ì¤¿¡£¤Þ¤¿¤Ï¡¢»ØÄꤷ¤¿¥¿¡¼¥²¥Ã¥È¥¢¥É¥ì¥¹¤¬ +´û¤ËÀܳºÑ¤ß¤Î¥½¥±¥Ã¥È¤À¤Ã¤¿¡£ +.TP +.B ENOMEM +.\"O Out of memory. +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B ENOTCONN +.\"O Socket operation needs a target address, but the socket is not connected. +¥½¥±¥Ã¥ÈÁàºî¤Ë¥¿¡¼¥²¥Ã¥È¥¢¥É¥ì¥¹¤¬É¬ÍפÀ¤¬¡¢ +¤³¤Î¥½¥±¥Ã¥È¤ÏÀܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EOPNOTSUPP +.\"O Stream operation called on non-stream oriented socket or tried to +.\"O use the out-of-band data option. +¥¹¥È¥ê¡¼¥à»Ø¸þ¤Ç¤Ê¤¤¥½¥±¥Ã¥È¤ËÂФ·¤Æ¥¹¥È¥ê¡¼¥àÁàºî¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¡£ +¤Þ¤¿¤ÏÂÓ°è³°¥Ç¡¼¥¿¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤è¤¦¤È¤·¤¿¡£ +.TP +.B EPERM +.\"O The sender passed invalid credentials in the +.\"O .IR "struct ucred" . +Á÷¿®¼Ô¤¬ +.I struct ucred +¤ËÉÔÀµ¤Ê¿®Ç¤¾õ¤òÅϤ·¤¿¡£ +.TP +.B EPIPE +.\"O Remote socket was closed on a stream socket. +.\"O If enabled, a +.\"O .B SIGPIPE +.\"O is sent as well. +.\"O This can be avoided by passing the +.\"O .B MSG_NOSIGNAL +.\"O flag to +.\"O .BR sendmsg (2) +.\"O or +.\"O .BR recvmsg (2). +¥ê¥â¡¼¥È¥½¥±¥Ã¥È¤¬¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¾å¤Ç¥¯¥í¡¼¥º¤µ¤ì¤¿¡£ +²Äǽ¤Ê¾ì¹ç¤Ï +.B SIGPIPE +¤âƱ»þ¤ËÁ÷¤é¤ì¤ë¡£¤³¤ì¤òÈò¤±¤ë¤Ë¤Ï +.B MSG_NOSIGNAL +¥Õ¥é¥°¤ò +.BR sendmsg (2) +¤ä +.BR recvmsg (2) +¤ËÅϤ¹¡£ +.TP +.B EPROTONOSUPPORT +.\"O Passed protocol is not AF_UNIX. +ÅϤµ¤ì¤¿¥×¥í¥È¥³¥ë¤¬ AF_UNIX ¤Ç¤Ê¤¤¡£ +.TP +.B EPROTOTYPE +.\"O Remote socket does not match the local socket type +.\"O .RB ( SOCK_DGRAM +.\"O vs. +.\"O .BR SOCK_STREAM ) +¥ê¥â¡¼¥È¥½¥±¥Ã¥È¤È¥í¡¼¥«¥ë¥½¥±¥Ã¥È¤Î¥¿¥¤¥×¤¬°ìÃפ·¤Æ¤¤¤Ê¤«¤Ã¤¿ +.RB ( SOCK_DGRAM +¤È +.BR SOCK_STREAM )¡£ +.TP +.B ESOCKTNOSUPPORT +.\"O Unknown socket type. +̤ÃΤΥ½¥±¥Ã¥È¥¿¥¤¥×¡£ +.PP +.\"O Other errors can be generated by the generic socket layer or +.\"O by the file system while generating a file system socket object. +.\"O See the appropriate manual pages for more information. +¾¤Ë¤âÈÆÍѤΥ½¥±¥Ã¥ÈÁؤǥ¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ë¥½¥±¥Ã¥È¥ª¥Ö¥¸¥§¥¯¥È¤òºî¤í¤¦¤È¤·¤¿¾ì¹ç¤Ë +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë¤³¤È¤¬¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¾ÜºÙ¤ÏŬÀÚ¤Ê man ¥Ú¡¼¥¸¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O .B SCM_CREDENTIALS +.\"O and the abstract namespace were introduced with Linux 2.2 and should not +.\"O be used in portable programs. +.B SCM_CREDENTIALS +¤ÈÃê¾Ý̾Á°¶õ´Ö¤Ï¡¢Linux 2.2 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï»È¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\"O (Some BSD-derived systems also support credential passing, +.\"O but the implementation details differ.) +(BSD ͳÍè¤Î¥·¥¹¥Æ¥à¤ÎÃæ¤Ë¤â¿®Ç¤¾õ¤ÎÁ÷¼õ¿®¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ë¤¬¡¢ +¤½¤Î¼ÂÁõ¤Î¾ÜºÙ¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë) +.\"O .SH NOTES +.SH Ãí°Õ +.\"O In the Linux implementation, sockets which are visible in the +.\"O file system honor the permissions of the directory they are in. +.\"O Their owner, group and their permissions can be changed. +.\"O Creation of a new socket will fail if the process does not have write and +.\"O search (execute) permission on the directory the socket is created in. +.\"O Connecting to the socket object requires read/write permission. +.\"O This behavior differs from many BSD-derived systems which +.\"O ignore permissions for Unix sockets. +.\"O Portable programs should not rely on +.\"O this feature for security. +Linux ¤Î¼ÂÁõ¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤«¤é¸«¤¨¤ë¥½¥±¥Ã¥È¤Ï¡¢ +¤½¤ì¤é¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤Ë½¾¤¦¡£ +¥½¥±¥Ã¥È¤Î½êÍ­¼Ô¡¢¥°¥ë¡¼¥×¡¢¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ÏÊѹ¹¤Ç¤­¤ë¡£ +¿·¤·¤¤¥½¥±¥Ã¥È¤òºî¤ë¤È¤­¡¢ºî¤í¤¦¤È¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ +¥×¥í¥»¥¹¤¬½ñ¤­¹þ¤ß¤È¸¡º÷ (¼Â¹Ô) ¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ºîÀ®¤Ë¼ºÇÔ¤¹¤ë¡£ +¥½¥±¥Ã¥È¥ª¥Ö¥¸¥§¥¯¥È¤ËÀܳ¤¹¤ë¤Ë¤Ï¡¢ read/write ¸¢¸Â¤¬É¬ÍפǤ¢¤ë¡£ +¤³¤ÎÆ°ºî¤Ï¡¢Â¿¤¯¤Î BSD ͳÍè¤Î¥·¥¹¥Æ¥à¤È¤Ï°Û¤Ê¤Ã¤Æ¤¤¤ë +(BSD ¤Ç¤Ï Unix ¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò̵»ë¤¹¤ë)¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +¥»¥­¥å¥ê¥Æ¥£¤ò¤³¤Î»ÅÍͤ˰͸¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +.\"O Binding to a socket with a filename creates a socket +.\"O in the file system that must be deleted by the caller when it is no +.\"O longer needed (using +.\"O .BR unlink (2)). +¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Æ¥½¥±¥Ã¥È¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¤È¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥½¥±¥Ã¥È¤¬À¸À®¤µ¤ì¤ë¡£ +¤³¤ì¤ÏɬÍפʤ¯¤Ê¤Ã¤¿¤È¤­¤Ë¸Æ¤Ó¤À¤·¤¿¥æ¡¼¥¶¡¼¤¬ºï½ü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.RB ( unlink (2) +¤òÍѤ¤¤ë)¡£ +.\"O The usual Unix close-behind semantics apply; the socket can be unlinked +.\"O at any time and will be finally removed from the file system when the last +.\"O reference to it is closed. +Unix ¤ÇÄ̾ï»È¤ï¤ì¤ë¡ÖÇظå¤ÇÊĤ¸¤ëÊý¼°¡×¤¬Å¬ÍѤµ¤ì¤ë¡£ +¥½¥±¥Ã¥È¤Ï¤¤¤Ä¤Ç¤â unlink ¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢ºÇ¸å¤Î»²¾È¤¬ +¥¯¥í¡¼¥º¤µ¤ì¤¿¤È¤­¤Ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤éºï½ü¤µ¤ì¤ë¡£ + +.\"O To pass file descriptors or credentials over a +.\"O .BR SOCK_STREAM , +.\"O you need +.\"O to send or receive at least one byte of nonancillary data in the same +.\"O .BR sendmsg (2) +.\"O or +.\"O .BR recvmsg (2) +.\"O call. +.B SOCK_STREAM +¾å¤Ç¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ä¿®Ç¤¾õ¤òÅϤ¹¤¿¤á¤Ë¤Ï¡¢Æ±¤¸ +.BR sendmsg (2) +¤ä +.BR recvmsg (2) +¥³¡¼¥ë¤ÇÊä½õ¥Ç¡¼¥¿°Ê³°¤Î¥Ç¡¼¥¿¤ò¾¯¤Ê¤¯¤È¤â +1 ¥Ð¥¤¥ÈÁ÷¿®/¼õ¿®¤¹¤ëɬÍפ¬¤¢¤ë¡£ + +.\"O Unix domain stream sockets do not support the notion of out-of-band data. +Unix ¥É¥á¥¤¥ó¤Î¥¹¥È¥ê¡¼¥à¡¦¥½¥±¥Ã¥È¤Ç¤Ï¡¢ +ÂÓ°è³°¥Ç¡¼¥¿¤Î³µÇ°¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤¡£ +.\"O .SH EXAMPLE +.SH Îã +.\"O See +.\"O .BR bind (2). +.BR bind (2) +»²¾È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR recvmsg (2), +.BR sendmsg (2), +.BR socket (2), +.BR socketpair (2), +.BR cmsg (3), +.BR capabilities (7), +.BR credentials (7), +.BR socket (7) diff --git a/draft/man7/uri.7 b/draft/man7/uri.7 new file mode 100644 index 00000000..8df73b63 --- /dev/null +++ b/draft/man7/uri.7 @@ -0,0 +1,1163 @@ +'\" +.\" (C) Copyright 1999-2000 David A. Wheeler (dwheeler@dwheeler.com) +.\" +.\" 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. +.\" +.\" Fragments of this document are directly derived from IETF standards. +.\" For those fragments which are directly derived from such standards, +.\" the following notice applies, which is the standard copyright and +.\" rights announcement of The Internet Society: +.\" +.\" Copyright (C) The Internet Society (1998). All Rights Reserved. +.\" This document and translations of it may be copied and furnished to +.\" others, and derivative works that comment on or otherwise explain it +.\" or assist in its implementation may be prepared, copied, published +.\" and distributed, in whole or in part, without restriction of any +.\" kind, provided that the above copyright notice and this paragraph are +.\" included on all such copies and derivative works. However, this +.\" document itself may not be modified in any way, such as by removing +.\" the copyright notice or references to the Internet Society or other +.\" Internet organizations, except as needed for the purpose of +.\" developing Internet standards in which case the procedures for +.\" copyrights defined in the Internet Standards process must be +.\" followed, or as required to translate it into languages other than English. +.\" +.\" Modified Fri Jul 25 23:00:00 1999 by David A. Wheeler (dwheeler@dwheeler.com) +.\" Modified Fri Aug 21 23:00:00 1999 by David A. Wheeler (dwheeler@dwheeler.com) +.\" Modified Tue Mar 14 2000 by David A. Wheeler (dwheeler@dwheeler.com) +.\" +.\" Japanese Version Copyright (c) 2000 NAKANO Takeo all rights reserved. +.\" Translated San 12 Mar 2000 by NAKANO Takeo +.\" +.\"WORD: generated file (KDE ¤Î) À¸À®¥Õ¥¡¥¤¥ë +.\" +.TH URI 7 2000-03-14 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O uri, url, urn \- uniform resource identifier (URI), including a URL or URN +.SH ̾Á° +uri, url, urn \- uniform resource identifier (URI), URL ¤È URN ¤â´Þ¤à. +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.HP 0.2i +URI = [ absoluteURI | relativeURI ] [ "#" fragment ] +.HP +absoluteURI = scheme ":" ( hierarchical_part | opaque_part ) +.HP +relativeURI = ( net_path | absolute_path | relative_path ) [ "?" query ] +.HP +scheme = "http" | "ftp" | "gopher" | "mailto" | "news" | "telnet" | + "file" | "man" | "info" | "whatis" | "ldap" | "wais" | \&... +.HP +hierarchical_part = ( net_path | absolute_path ) [ "?" query ] +.HP +net_path = "//" authority [ absolute_path ] +.HP +absolute_path = "/" path_segments +.HP +relative_path = relative_segment [ absolute_path ] +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.PP +.\"O A Uniform Resource Identifier (URI) is a short string of characters +.\"O identifying an abstract or physical resource (for example, a web page). +.\"O A Uniform Resource Locator (URL) is a URI +.\"O that identifies a resource through its primary access +.\"O mechanism (e.g., its network "location"), rather than +.\"O by name or some other attribute of that resource. +.\"O A Uniform Resource Name (URN) is a URI +.\"O that must remain globally unique and persistent even when +.\"O the resource ceases to exist or becomes unavailable. +Uniform Resource Identifier (URI) +¤ÏÃê¾ÝŪ¡¦ÊªÍýŪ¤Ê¥ê¥½¡¼¥¹ (web ¥Ú¡¼¥¸¤Ê¤É) +¤ò¼±Ê̤¹¤ë¤¿¤á¤Îû¤¤Ê¸»úÎó¤Ç¤¢¤ë¡£ +Uniform Resource Locator (URL) ¤Ï URI ¤Î°ì¼ï¤Ç¡¢ +¥ê¥½¡¼¥¹¤Î̾Á°¤Ê¤É¤Î°À­¤Ç¤Ç¤Ï¤Ê¤¯¡¢ +¤½¤Î¥ê¥½¡¼¥¹¤ËÂбþ¤¹¤ë¥¢¥¯¥»¥¹¥á¥«¥Ë¥º¥à¤òÄ̤·¤Æ¥ê¥½¡¼¥¹¤ò»ØÄꤹ¤ë +(¤Ä¤Þ¤ê¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î¡Ö¾ì½ê (location)¡×¤ò»ØÄꤹ¤ë)¡£ +Uniform Resource Name (URN) ¤Ï URI ¤Î°ì¼ï¤Ç¡¢ +¤³¤ì¤ÏÂоݤΥ꥽¡¼¥¹¤¬ÇÑ´þ¤µ¤ì¤¿¤êÍøÍѤǤ­¤Ê¤¯¤Ê¤Ã¤¿¾ì¹ç¤Ë¤â¡¢ +¥°¥í¡¼¥Ð¥ë¤Ë¾¤È½Å¤Ê¤ë¤³¤È¤Ê¤¯±Ê³¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O URIs are the standard way to name hypertext link destinations +.\"O for tools such as web browsers. +.\"O The string "http://www.kernelnotes.org" is a URL (and thus it +.\"O is also a URI). +.\"O Many people use the term URL loosely as a synonym for URI +.\"O (though technically URLs are a subset of URIs). +URI ¤Ï¡¢ web ¥Ö¥é¥¦¥¶¤Ê¤É¤Î¥Ä¡¼¥ë¤Ç +¥Ï¥¤¥Ñ¡¼¥Æ¥­¥¹¥È¥ê¥ó¥¯¤Î¥ê¥ó¥¯Àè¤ò»ØÄꤹ¤ë»þ¤Îɸ½àŪ¤ÊÊýË¡¤Ç¤¢¤ë¡£ +ʸ»úÎó "http://www.kernelnotes.org" ¤Ï URL ¤Ç¤¢¤ë (½¾¤Ã¤Æ +URI ¤Ç¤â¤¢¤ë)¡£Â¿¤¯¤Î¿Í¡¹¤Ï¡¢ URL ¤È¤¤¤¦¸ÀÍÕ¤ò¤Û¤Ü URI ¤Î +ƱµÁ¸ì¤È¤·¤Æ»È¤Ã¤Æ¤¤¤ë (¤·¤«¤·µ»½ÑŪ¤Ë¤Ï URL ¤Ï URI ¤Î¥µ¥Ö¥»¥Ã¥È¤Ç¤¢¤ë)¡£ +.PP +.\"O URIs can be absolute or relative. +.\"O An absolute identifier refers to a resource independent of +.\"O context, while a relative +.\"O identifier refers to a resource by describing the difference +.\"O from the current context. +.\"O Within a relative path reference, the complete path segments "." and +.\"O ".." have special meanings: "the current hierarchy level" and "the +.\"O level above this hierarchy level", respectively, just like they do in +.\"O Unix-like systems. +.\"O A path segment which contains a colon +.\"O character can't be used as the first segment of a relative URI path +.\"O (e.g., "this:that"), because it would be mistaken for a scheme name; +.\"O precede such segments with ./ (e.g., "./this:that"). +.\"O Note that descendants of MS-DOS (e.g., Microsoft Windows) replace +.\"O devicename colons with the vertical bar ("|") in URIs, so "C:" becomes "C|". +URI ¤ÏÀäÂÐŪ¤Ë¤âÁêÂÐŪ¤Ë¤â»ØÄê¤Ç¤­¤ë¡£ +ÀäÂÐŪ¤Ê»ØÄê¤Ï¡¢¥ê¥½¡¼¥¹¤ò¥³¥ó¥Æ¥¯¥¹¥È¤Ë°Í¸¤·¤Ê¤¤¤«¤¿¤Á¤Ç»²¾È¤¹¤ë¡£ +ÁêÂÐŪ¤Ê»ØÄê¤Ï¡¢¥ê¥½¡¼¥¹¤ò¸½ºß¤Î¥³¥ó¥Æ¥¯¥¹¥È¤«¤é¤Îº¹°Û¤Ë¤è¤Ã¤Æµ­½Ò¤¹¤ë¡£ +ÁêÂХѥ¹»²¾È¤Ç¤Ï¡¢ "." ¤ª¤è¤Ó ".." ¤À¤±¤Î¥Ñ¥¹Éôʬ (path segment) +¤ÏÆÃÊ̤ʰÕÌ£¤ò»ý¤Á¡¢ +¤½¤ì¤¾¤ì¡Ö¸½ºß¤Î³¬ÁØ¥ì¥Ù¥ë¡×¤ª¤è¤Ó¡Ö¸½ºß¤Î³¬Áؤΰì¤Ä¾å¤Î¥ì¥Ù¥ë¡× +¤È¤·¤Æ°·¤ï¤ì¤ë (Unix-like ¤Ê¥·¥¹¥Æ¥à¤ÈƱÍÍ)¡£ +¥³¥í¥óʸ»ú¤ò´Þ¤à¥Ñ¥¹Éôʬ¤ÏÁêÂÐ URI ¥Ñ¥¹¤ÎÀèƬ¤ËÍѤ¤¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤ +(¤Ä¤Þ¤ê "this:that" ¤Ï¥À¥á)¡£¥¹¥­¡¼¥à̾¤È¶èÊ̤Ǥ­¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï ./ ¤òÁ°ÃÖ¤¹¤ë¤³¤È (¤Ä¤Þ¤ê "./this:that" ¤È¤¹¤ë)¡£ +MS-DOS ¤Î»Ò¹ (Microsoft Windows ¤Ê¤É) ¤Ï¡¢ +¥Ç¥Ð¥¤¥¹Ì¾¤Î¥³¥í¥ó¤ò URI ¤Ç¤Ï¿âľ¥Ð¡¼ ("|") ¤ËÃÖ¤­´¹¤¨¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ "C:" ¤Ï "C|" ¤È¤Ê¤ë¡£ +.PP +.\"O A fragment identifier, if included, refers to a particular named portion +.\"O (fragment) of a resource; text after a \(aq#\(aq identifies the fragment. +.\"O A URI beginning with \(aq#\(aq refers to that fragment in the current resource. +¥Õ¥é¥°¥á¥ó¥È»ØÄê»Ò (fragment identifier) ¤Ï¡¢(¤â¤·´Þ¤Þ¤ì¤Æ¤¤¤ì¤Ð) +¥ê¥½¡¼¥¹Ãæ¤Î̾Á°ÉÕ¤±¤µ¤ì¤¿ÆÃÄê¤ÎÉôʬ (¥Õ¥é¥°¥á¥ó¥È) ¤ò»²¾È¤¹¤ë¡£ +\(aq#\(aq »ØÄê»Ò°Ê¹ß¤Îʸ»úÎ󤬥ե饰¥á¥ó¥È¤ò»ØÄꤹ¤ë¡£ +\(aq#\(aq ¤Ç»Ï¤Þ¤ë URI ¤Ï¸½ºß¤Î¥ê¥½¡¼¥¹Ãæ¤Î¥Õ¥é¥°¥á¥ó¥È¤ò»²¾È¤¹¤ë¡£ +.\"O .SS USAGE +.S ÍøÍÑË¡ +.\"O There are many different URI schemes, each with specific +.\"O additional rules and meanings, but they are intentionally made to be +.\"O as similar as possible. +.\"O For example, many URL schemes +.\"O permit the authority to be the following format, called here an +.\"O .I ip_server +.\"O (square brackets show what's optional): +URI ¤Î¥¹¥­¡¼¥à¤Ë¤Ï¿§¡¹¤Ê¼ïÎब¤¢¤ê¡¢ +¤½¤ì¤¾¤ì¸ÇÍ­¤Î¥ë¡¼¥ë¤ä°ÕÌ£¤¬Äɲ䵤ì¤Æ¤¤¤ë¡£ +¤·¤«¤·¤Ç¤­¤ë¤À¤±Åý°ì¤·¤¿¤â¤Î¤Ë¤·¤è¤¦¤È¤¤¤¦ÅØÎϤâ¤Ê¤µ¤ì¤Æ¤¤¤ë¡£ +Î㤨¤Ð¡¢Â¿¤¯¤Î URL ¥¹¥­¡¼¥à¤Ï¡Öµ¡´Ø (authority)¡×¤ËÂФ·¤Æ°Ê²¼¤Î½ñ¼° +(¤³¤³¤Ç¤Ï +.I ip_server +¤È¸Æ¤Ö¤³¤È¤Ë¤¹¤ë) +¤òµö¤·¤Æ¤¤¤ë (³Ñ³ç¸ÌÆâÉô¤Ï¾Êά²Äǽ)¡£ +.HP +.IR "ip_server = " [ user " [ : " password " ] @ ] " host " [ : " port ] +.PP +.\"O This format allows you to optionally insert a username, +.\"O a user plus password, and/or a port number. +.\"O The +.\"O .I host +.\"O is the name of the host computer, either its name as determined by DNS +.\"O or an IP address (numbers separated by periods). +.\"O Thus the URI +.\"O +.\"O logs into a web server on host xyz.com +.\"O as fred (using fredpassword) using port 8080. +.\"O Avoid including a password in a URI if possible because of the many +.\"O security risks of having a password written down. +.\"O If the URL supplies a username but no password, and the remote +.\"O server requests a password, the program interpreting the URL +.\"O should request one from the user. +¤³¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤Ï¡¢¥æ¡¼¥¶Ì¾¡¢¥æ¡¼¥¶Ì¾+¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄê¤Ç¤­¤ë¡£ +¥Ý¡¼¥ÈÈÖ¹æ¤òÄɲ乤뤳¤È¤â²Äǽ¤Ç¤¢¤ë¡£ +.I host +¤Ï¥Û¥¹¥È¥³¥ó¥Ô¥å¡¼¥¿¤Î̾Á°¤Ç¡¢ DNS ¤ÇÄêµÁ¤µ¤ì¤ë̾Á°¤« IP ¥¢¥É¥ì¥¹ +(¥Ô¥ê¥ª¥É¤Ç¶èÀÚ¤é¤ì¤¿¿ô»ú) ¤Ç»ØÄꤹ¤ë¡£¤·¤¿¤¬¤Ã¤Æ URI + +¤Ï¡¢¥Û¥¹¥È xyz.com ¤Ë fred ¤È¤·¤Æ (¥Ñ¥¹¥ï¡¼¥É¤ò»È¤Ã¤Æ) +¥Ý¡¼¥È 8080 ¤ò»È¤Ã¤Æ¥í¥°¥¤¥ó¤¹¤ë¡£ +¥Ñ¥¹¥ï¡¼¥É¤Ï²Äǽ¤Ê¤é URI ¤Ë¤Ï´Þ¤á¤Ê¤¤¤Û¤¦¤¬Îɤ¤¤À¤í¤¦¡£ +¥Ñ¥¹¥ï¡¼¥É¤òľ½ñ¤­¤¹¤ë¤ÈÍÍ¡¹¤Ê¥»¥­¥å¥ê¥Æ¥£¾å¤Î¥ê¥¹¥¯¤¬À¸¤¸¤ë¤«¤é¤Ç¤¢¤ë¡£ +URL ¤Ë¥æ¡¼¥¶Ì¾¤À¤±¤òÍ¿¤¨¡¢¥Ñ¥¹¥ï¡¼¥É¤òÍ¿¤¨¤Ê¤¤¾ì¹ç¤Ï¡¢ +¥ê¥â¡¼¥È¥µ¡¼¥Ð¤Ï¥Ñ¥¹¥ï¡¼¥É¤òÍ׵ᤷ¤Æ¤¯¤ë¡£ +URL ¤ò²ò¼á¤·¤¿¥×¥í¥°¥é¥à¤¬¡¢¥æ¡¼¥¶¤Ë¤³¤ÎÆþÎϤòÂ¥¤¹¤³¤È¤Ë¤Ê¤í¤¦¡£ +.PP +.\"O Here are some of the most common schemes in use on Unix-like systems +.\"O that are understood by many tools. +.\"O Note that many tools using URIs also have internal schemes or specialized +.\"O schemes; see those tools' documentation for information on those schemes. +°Ê²¼¤Ë¡¢ Unix-like ¤Ê¥·¥¹¥Æ¥à¤ÇÈó¾ï¤ËÎɤ¯ÍѤ¤¤é¤ì¤Æ¤ª¤ê¡¢ +¿¤¯¤Î¥Ä¡¼¥ë¤¬Íý²ò¤¹¤ë¥¹¥­¡¼¥à¤ò¼¨¤¹¡£ +URI ¤ò»È¤¦¥Ä¡¼¥ë¤Î¿¤¯¤Ç¤Ï¡¢ÆâÉô¥¹¥­¡¼¥à¤äÆüì¤Ê¥¹¥­¡¼¥à¤â +»È¤¨¤ë¤³¤È¤¬Â¿¤¤¡£¤½¤Î¤è¤¦¤Ê¥¹¥­¡¼¥à¤Ë´Ø¤·¤Æ¤Ï¥Ä¡¼¥ë¤Î¥É¥­¥å¥á¥ó¥È¤ò¸«¤ë¤³¤È¡£ +.PP +.\"O .B "http \- Web (HTTP) server" +.B "http \- Web (HTTP) ¥µ¡¼¥Ð" +.PP +.RI http:// ip_server / path +.br +.RI http:// ip_server / path ? query +.PP +.\"O This is a URL accessing a web (HTTP) server. +.\"O The default port is 80. +.\"O If the path refers to a directory, the web server will choose what +.\"O to return; usually if there is a file named "index.html" or "index.htm" +.\"O its content is returned, otherwise, a list of the files in the current +.\"O directory (with appropriate links) is generated and returned. +.\"O An example is . +¤³¤ì¤Ï web (HTTP) ¥µ¡¼¥Ð¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î URL ¤Ç¤¢¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î¥Ý¡¼¥È¤Ï 80¡£¥Ñ¥¹¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤ë¤È¤­¤Ï¡¢ +ÊÖ¤µ¤ì¤ë¾ðÊó¤Ï web ¥µ¡¼¥Ð¤¬ÁªÂò¤¹¤ë¡£Ä̾ï¤Ï¡¢ +"index.html" ¤ä "index.htm" ¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¤¬¤¢¤ì¤Ð¡¢¤½¤ÎÆâÍƤ¬ÊÖ¤µ¤ì¤ë¡£ +¤Ê¤±¤ì¤Ð¡¢¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤¬ (ŬÀڤʥê¥ó¥¯¤È¤È¤â¤Ë) À¸À®¤µ¤ì¤Æ +ÊÖ¤µ¤ì¤ë¡£Îã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +.\"O A query can be given in the archaic "isindex" format, consisting of a +.\"O word or phrase and not including an equal sign (=). +.\"O A query can also be in the longer "GET" format, which has one or more +.\"O query entries of the form +.\"O .IR key = value +.\"O separated by the ampersand character (&). +Ì䤤¹ç¤ï¤» (query) ¤ò¡¢¸Å¤¤ "isindex" ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤è¤Ã¤ÆÁ÷¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ïñ¸ì¤Þ¤¿¤Ï¥Õ¥ì¡¼¥º¤«¤é¤Ê¤ê¡¢Åù¹æ (=) ¤Ï´Þ¤Þ¤Ê¤¤¡£ +¤è¤êŤ¤ "GET" ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤âÌ䤤¹ç¤ï¤»¤Ï¹Ô¤¨¤ë¡£ +¤³¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤Ï¡¢°ì¤Ä°Ê¾å¤ÎÌ䤤¹ç¤ï¤»¥¨¥ó¥È¥ê¤¬ +.IR key = value +¤È¤¤¤¦·Á¼°¤Ç´Þ¤Þ¤ì¤ë¡£¤½¤ì¤¾¤ì¤Î¥¨¥ó¥È¥ê¤Ï¥¢¥ó¥Ñ¥µ¥ó¥É (&) ¤Ç¶èÀÚ¤é¤ì¤ë¡£ +.\"O Note that +.\"O .I key +.\"O can be repeated more than once, though it's up to the web server +.\"O and its application programs to determine if there's any meaning to that. +.\"O There is an unfortunate interaction with HTML/XML/SGML and +.\"O the GET query format; when such URIs with more than one key +.\"O are embedded in SGML/XML documents (including HTML), the ampersand +.\"O (&) has to be rewritten as &. +.\"O Note that not all queries use this format; larger forms +.\"O may be too long to store as a URI, so they use a different +.\"O interaction mechanism (called POST) which does +.\"O not include the data in the URI. +.I key +¤ÏÊ£¿ô¸Ä»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£¤·¤«¤·¤½¤ì¤Ë°ÕÌ£¤¬¤¢¤ë¤«¤É¤¦¤«¤Ï +web ¥µ¡¼¥Ð¤È¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤¬·è¤á¤ë¡£ +HTML/XML/SGML ¤È GET Ì䤤¹ç¤ï¤»·Á¼°¤Î´Ö¤Ë¤Ï¡¢ÉÔ¹¬¤Ê´Ø·¸¤¬¤¢¤ë¡£ +°ì¤Ä°Ê¾å¤Î¥­¡¼¤Î´Þ¤Þ¤ì¤ë URI ¤¬ SGML/XML ʸ½ñ (HTML ¤â¤½¤¦) +¤ËËä¤á¤³¤Þ¤ì¤ëºÝ¤Ë¤Ï¡¢¥¢¥ó¥Ñ¥µ¥ó¥É (&) ¤Ï & ¤È½ñ¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Á´¤Æ¤ÎÌ䤤¹ç¤ï¤»¤¬¤³¤Î·Á¼°¤ò»È¤¦¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¥Õ¥©¡¼¥à¤¬Ä¹¤¯¤Ê¤ë¤È URI ¤ËÆþ¤ì¤ë¤Ë¤ÏŤ¹¤®¤ë¤«¤é¡¢ +Ê̤ÎÄÌ¿®¥á¥«¥Ë¥º¥à (POST ¤È¸Æ¤Ð¤ì¤ë) ¤¬ÍѤ¤¤é¤ì¤ë¡£ +POST ¤Ç¤Ï URI ¤Ë¤Ï¥Ç¡¼¥¿¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +.\"O See the Common Gateway Interface specification at +.\"O for more information. +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¡¢ + ¤Ë¤¢¤ë +Common Gateway Interface ¤Î»ÅÍͽñ¤ò¸«¤è¡£ +.PP +.\"O .B "ftp \- File Transfer Protocol (FTP)" +.B "ftp \- ¥Õ¥¡¥¤¥ëžÁ÷¥×¥í¥È¥³¥ë (FTP)" +.PP +.RI ftp:// ip_server / path +.PP +.\"O This is a URL accessing a file through the file transfer protocol (FTP). +.\"O The default port (for control) is 21. +.\"O If no username is included, the username "anonymous" is supplied, and +.\"O in that case many clients provide as the password the requestor's +.\"O Internet email address. +.\"O An example is +.\"O . +¤³¤ì¤Ï¥Õ¥¡¥¤¥ëžÁ÷¥×¥í¥È¥³¥ë (FTP) ¤òÄ̤·¤Æ¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î +URL ¤Ç¤¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Î (À©¸æÍÑ) ¥Ý¡¼¥È¤Ï 21 ¤Ç¤¢¤ë¡£ +¥æ¡¼¥¶Ì¾¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥æ¡¼¥¶Ì¾ anonymous ¤¬Í¿¤¨¤é¤ì¤ë¡£ +¤½¤·¤Æ¤½¤Î¾ì¹ç¤Ë¤Ï¡¢¥¯¥é¥¤¥¢¥ó¥È¤Î¿¤¯¤ÏÍ׵ᤷ¤¿¿Í¤Î +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥á¡¼¥ë¥¢¥É¥ì¥¹¤ò¥Ñ¥¹¥ï¡¼¥É¤È¤·¤ÆÍ¿¤¨¤ë¡£ +Îã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +.\"O .B "gopher \- Gopher server" +.B "gofer \- Gofer ¥µ¡¼¥Ð" +.PP +.RI gopher:// ip_server / "gophertype selector" +.br +.RI gopher:// ip_server / "gophertype selector" %09 search +.br +.RI gopher:// ip_server / "gophertype selector" %09 search %09 gopher+_string +.br +.PP +.\"O The default gopher port is 70. +.\"O .I gophertype +.\"O is a single-character field to denote the +.\"O Gopher type of the resource to +.\"O which the URL refers. +.\"O The entire path may also be empty, in +.\"O which case the delimiting "/" is also optional and the gophertype +.\"O defaults to "1". +¥Ç¥Õ¥©¥ë¥È¤Î gopher ¥Ý¡¼¥È¤Ï 70 ¤Ç¤¢¤ë¡£ +.I gophertype +¤Ï 1 ʸ»ú¤«¤é¤Ê¤ë¥Õ¥£¡¼¥ë¥É¤Ç¡¢ +URL ¤¬»²¾È¤·¤Æ¤¤¤ë Gopher ¤Î¥ê¥½¡¼¥¹¥¿¥¤¥×¤ò¼¨¤¹¡£ +¥Ñ¥¹Á´ÂΤ¬¶õ¤Ç¤¢¤Ã¤Æ¤â¤è¤¯¡¢¤½¤Î¾ì¹ç¤Ï¶èÀÚ¤ê¤Î "/" ¤â¾Êά¤Ç¤­¤ë¡£ +¤³¤Î¤È¤­ gophertype ¤Î¥Ç¥Õ¥©¥ë¥È¤Ï "1" ¤Ë¤Ê¤ë¡£ +.PP +.\"O .I selector +.\"O is the Gopher selector string. +.\"O In the Gopher protocol, +.\"O Gopher selector strings are a sequence of octets which may contain +.\"O any octets except 09 hexadecimal (US-ASCII HT or tab), 0A hexadecimal +.\"O (US-ASCII character LF), and 0D (US-ASCII character CR). +.I selector +¤Ï Gopher ¥»¥ì¥¯¥¿Ê¸»úÎó¤Ç¤¢¤ë¡£Gopher ¥×¥í¥È¥³¥ë¤Ç¤Ï¡¢ +Gopher ¥»¥ì¥¯¥¿Ê¸»úÎó¤Ï¥ª¥¯¥Æ¥Ã¥Èʸ»ú¤«¤é¤Ê¤ê¡¢ +16¿Ê¿ô¤Î 09 (US-ASCII ¤Î HT ¤Þ¤¿¤Ï tab)¡¢ 0A (US-ASCII ¤Î LF ʸ»ú)¡¢ +0D (US-ASCII ¤Î CR ʸ»ú) °Ê³°¤Ê¤é¤É¤ó¤Ê¥ª¥¯¥Æ¥Ã¥È¤â»ØÄê¤Ç¤­¤ë¡£ +.PP +.\"O .B "mailto \- Email address" +.B "mailto \- ÅŻҥ᡼¥ë¥¢¥É¥ì¥¹" +.PP +.RI mailto: email-address +.PP +.\"O This is an email address, usually of the form +.\"O .IR name @ hostname . +.\"O See +.\"O .BR mailaddr (7) +.\"O for more information on the correct format of an email address. +.\"O Note that any % character must be rewritten as %25. +.\"O An example is . +¤³¤ì¤ÏÅŻҥ᡼¥ë¥¢¥É¥ì¥¹¤Ç¡¢Ä̾ï +.IR name @ hostname +¤È¤¤¤¦·Á¼°¤ò¤È¤ë¡£ÅŻҥ᡼¥ë¥¢¥É¥ì¥¹¤ÎÀµ¤·¤¤¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë´Ø¤¹¤ë +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR mailaddr (7) +¤ò¸«¤è¡£ % ʸ»ú¤Ï¤¹¤Ù¤Æ %25 ¤È½ñ¤­Ä¾¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤ËÃí°Õ¡£ +Îã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +.\"O .B "news \- Newsgroup or News message" +.B "news \- ¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¡¦¥Ë¥å¡¼¥¹¥á¥Ã¥»¡¼¥¸" +.PP +.RI news: newsgroup-name +.br +.RI news: message-id +.PP +.\"O A +.\"O .I newsgroup-name +.\"O is a period-delimited hierarchical name, such as +.\"O "comp.infosystems.www.misc". +.\"O If is "*" (as in ), it is used to refer +.\"O to "all available news groups". +.\"O An example is . +.I newsgroup-name +¤Ï¥Ô¥ê¥ª¥É¤Ç¶èÀÚ¤é¤ì¤¿³¬ÁØŪ¤Ê̾Á°¤Ç¤¢¤ë¡£Î㤨¤Ð +"comp.infosystems.www.misc" ¤Ê¤É¡£ + ¤¬ "*" (¤Ä¤Þ¤ê ) ¤Î¾ì¹ç¤Ë¤Ï¡¢ +¡Ö»²¾È¤Ç¤­¤ëÁ´¤Æ¤Î¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¡×¤Î°ÕÌ£¤Ë¤Ê¤ë¡£ +Îã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +.\"O A +.\"O .I message-id +.\"O corresponds to the Message-ID of +.\"O .UR http://www.ietf.org/rfc/rfc1036.txt +.\"O IETF RFC\ 1036, +.\"O .UE +.\"O without the enclosing "<" +.\"O and ">"; it takes the form +.\"O .IR unique @ full_domain_name . +.\"O A message identifier may be distinguished from a news group name by the +.\"O presence of the "@" character. +.I message-id +¤Ï +.UR http://www.ietf.org/rfc/rfc1036.txt +IETF RFC\ 1036 +.UE +¤Î Message-ID ¤«¤é¡¢°Ï¤ß¤Î "<" ¤È ">" ¤ò¼è¤Ã¤¿¤â¤Î¤ËÂбþ¤¹¤ë¡£ +Message-ID ¤Ï +.IR unique @ full_domain_name +¤È¤¤¤¦·Á¼°¤ò¤È¤ë¡£¥á¥Ã¥»¡¼¥¸¤Î»ØÄê¤Ë¤Ï "@" ʸ»ú¤¬´Þ¤Þ¤ì¤ë¤Î¤Ç¡¢ +¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¤Î̾Á°¤È¶èÊ̤Ǥ­¤ë¤À¤í¤¦¡£ +.PP +.\"O .B "telnet \- Telnet login" +.B "telnet \- telnet ¥í¥°¥¤¥ó" +.PP +.RI telnet:// ip_server / +.PP +.\"O The Telnet URL scheme is used to designate interactive text services that +.\"O may be accessed by the Telnet protocol. +.\"O The final "/" character may be omitted. +.\"O The default port is 23. +.\"O An example is . +Telnet URL ¥¹¥­¡¼¥à¤ÏÂÐÏÃŪ¤Ê¥Æ¥­¥¹¥È¥µ¡¼¥Ó¥¹¤Ë Telnet ¥×¥í¥È¥³¥ë¤ò +Ä̤·¤Æ¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ºÇ¸å¤Î "/" ʸ»ú¤Ï¾Êά¤·¤Æ¤è¤¤¡£ +Îã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +.\"O .B "file \- Normal file" +.B "file \- Ä̾ï¤Î¥Õ¥¡¥¤¥ë" +.PP +.RI file:// ip_server / path_segments +.br +.RI file: path_segments +.PP +.\"O This represents a file or directory accessible locally. +.\"O As a special case, +.\"O .I host +.\"O can be the string "localhost" or the empty +.\"O string; this is interpreted as "the machine from which the URL is +.\"O being interpreted". +.\"O If the path is to a directory, the viewer should display the +.\"O directory's contents with links to each containee; +.\"O not all viewers currently do this. +.\"O KDE supports generated files through the URL . +.\"O If the given file isn't found, browser writers may want to try to expand +.\"O the filename via filename globbing +.\"O (see +.\"O .BR glob (7) +.\"O and +.\"O .BR glob (3)). +¤³¤ì¤Ï¥í¡¼¥«¥ë¤ËľÀÜ¥¢¥¯¥»¥¹¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤ò¼¨¤¹¡£ +Æüì¤Ê¥±¡¼¥¹¤È¤·¤Æ¡¢ +.I host +¤Ë¤Ï "localhost" ¤È¤¤¤¦Ê¸»úÎó¤òÍѤ¤¤¿¤ê¡¢¶õʸ»ú¤Ë¤·¤Æ¤â¤è¤¤¡£ +¤³¤ì¤Ï¡ÖURI ¤¬²ò¼á¤µ¤ì¤¿¥Þ¥·¥ó¡×¤È¤ß¤Ê¤µ¤ì¤ë¡£ +path ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¤Ï¡¢¥Ó¥å¡¼¥¢¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍƤò +¥ê¥ó¥¯¤òÄ¥¤Ã¤¿¤«¤¿¤Á¤Çɽ¼¨¤¹¤ë¤È¤è¤¤¤À¤í¤¦¡£ +¤·¤«¤·¸½ºß¤Ï¡¢¤Þ¤ÀÁ´¤Æ¤Î¥Ó¥å¡¼¥¢¤¬¤³¤ÎÆ°ºî¤ò¤¹¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +KDE ¤ÏÀ¸À®¥Õ¥¡¥¤¥ë (generated file) ¤ò URL +¤Î·Á¼°¤Ç¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +Í¿¤¨¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¸«ÉÕ¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +¥Õ¥¡¥¤¥ë̾¤ò¥°¥í¥Ö¤Ë¤è¤Ã¤ÆŸ³«¤¹¤ë¤ÈÎɤ¤¤«¤â¤·¤ì¤Ê¤¤ +.RB ( glob (7) +¤ª¤è¤Ó +.BR glob (3) +¤ò¸«¤è)¡£ +.PP +.\"O The second format (e.g., ) +.\"O is a correct format for referring to +.\"O a local file. +.\"O However, older standards did not permit this format, +.\"O and some programs don't recognize this as a URI. +.\"O A more portable syntax is to use an empty string as the server name, +.\"O for example, +.\"O ; this form does the same thing +.\"O and is easily recognized by pattern matchers and older programs as a URI. +.\"O Note that if you really mean to say "start from the current location," don't +.\"O specify the scheme at all; use a relative address like <../test.txt>, +.\"O which has the side-effect of being scheme-independent. +.\"O An example of this scheme is . +Æó¤Ä¤á¤Î½ñ¼° (Î㤨¤Ð ) ¤â¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë +Àµ¤·¤¤¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤¢¤ë¡£¤·¤«¤·¸Å¤¤É¸½à¤Ç¤Ï¤³¤Î½ñ¼°¤òµö¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤Ç¡¢ +¤³¤ì¤ò URI ¤È¤·¤Æǧ¼±¤·¤Ê¤¤¥×¥í¥°¥é¥à¤â¸ºß¤¹¤ë¡£ +¤è¤êÈÆÍÑŪ¤Êʸˡ¤Ï¡¢¥µ¡¼¥Ð̾¤Ë¶õʸ»ú¤òÍѤ¤¤ë¤â¤Î¡¢ +¤Ä¤Þ¤ê ¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î·Á¼°¤â»Ø¤¹ÆâÍƤÏƱ¤¸¤Ç¤¢¤ê¡¢¥Ñ¥¿¡¼¥ó¥Þ¥Ã¥Á¤ä¤è¤ê¸Å¤¤¥×¥í¥°¥é¥à¤Ç¤â +URI ¤È¤·¤Æǧ¼±¤µ¤ì¤ä¤¹¤¤¡£ +¤â¤·°Õ¿Þ¤¹¤ë¤È¤³¤í¤¬¡Ö¸½ºß¤Î¾ì½ê¤«¤é¥¹¥¿¡¼¥È¡×¤Ê¤é¡¢ +¥¹¥­¡¼¥à¤Ï°ìÀÚÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +<../test.txt> ¤Î¤è¤¦¤Ê¡¢¥¹¥­¡¼¥à¤Ë°Í¸¤·¤Ê¤¤ÁêÂÐ¥ê¥ó¥¯¤òÍѤ¤¤ë¤³¤È¡£ +¤³¤Î¥¹¥­¡¼¥à¤ÎÎã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +.\"O .B "man \- Man page documentation" +.B "man \- man ¥Ú¡¼¥¸Ê¸½ñ" +.PP +.RI man: command-name +.br +.RI man: command-name ( section ) +.PP +.\"O This refers to local online manual (man) reference pages. +.\"O The command name can optionally be followed by a +.\"O parenthesis and section number; see +.\"O .BR man (7) +.\"O for more information on the meaning of the section numbers. +.\"O This URI scheme is unique to Unix-like systems (such as Linux) +.\"O and is not currently registered by the IETF. +.\"O An example is . +¤³¤ì¤Ï¥í¡¼¥«¥ë¤Î¥ª¥ó¥é¥¤¥ó¥Þ¥Ë¥å¥¢¥ë (man) ¥ê¥Õ¥¡¥ì¥¹¥Ú¡¼¥¸¤ò»²¾È¤¹¤ë¡£ +command-name ¤Ë¤Ï³ç¸Ì¤È¥»¥¯¥·¥ç¥óÈÖ¹æ¤òÄɲ䷤Ƥâ¤è¤¤¡£ +¥»¥¯¥·¥ç¥óÈÖ¹æ¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¾Ü¤·¤¯ÃΤꤿ¤¤¾ì¹ç¤Ï +.BR man (7) +¤ò¤ß¤è¡£¤³¤Î URI ¥¹¥­¡¼¥à¤Ï Unix-like ¤Ê¥·¥¹¥Æ¥à (Linux ¤Ê¤É) +¤ËÆÃÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢¸½ºß¤Ï¤Þ¤À IETF ¤Ë¤è¤ëÅÐÏ¿¤Ï¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +Îã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +.\"O .B "info \- Info page documentation" +.B "info \- info ¥Ú¡¼¥¸Ê¸½ñ" +.PP +.RI info: virtual-filename +.br +.RI info: virtual-filename # nodename +.br +.RI info:( virtual-filename ) +.br +.RI info:( virtual-filename ) nodename +.PP +.\"O This scheme refers to online info reference pages (generated from +.\"O texinfo files), +.\"O a documentation format used by programs such as the GNU tools. +.\"O This URI scheme is unique to Unix-like systems (such as Linux) +.\"O and is not currently registered by the IETF. +.\"O As of this writing, GNOME and KDE differ in their URI syntax +.\"O and do not accept the other's syntax. +.\"O The first two formats are the GNOME format; in nodenames all spaces +.\"O are written as underscores. +.\"O The second two formats are the KDE format; +.\"O spaces in nodenames must be written as spaces, even though this +.\"O is forbidden by the URI standards. +.\"O It's hoped that in the future most tools will understand all of these +.\"O formats and will always accept underscores for spaces in nodenames. +.\"O In both GNOME and KDE, if the form without the nodename is used the +.\"O nodename is assumed to be "Top". +.\"O Examples of the GNOME format are and . +.\"O Examples of the KDE format are and . +¤³¤Î¥¹¥­¡¼¥à¤Ï¡¢¥ª¥ó¥é¥¤¥ó¤Î info ¥ê¥Õ¥¡¥ì¥ó¥¹¥Ú¡¼¥¸ +(texinfo ¥Õ¥¡¥¤¥ë¤«¤éÀ¸À®¤µ¤ì¤ë) ¤ò»²¾È¤¹¤ë¡£ info ¥Ú¡¼¥¸¤Ï +GNU ¥Ä¡¼¥ë¤Ê¤É¤Î¥×¥í¥°¥é¥à¤ÇÍѤ¤¤é¤ì¤Æ¤¤¤ëʸ½ñ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤¢¤ë¡£ +¤³¤Î URI ¥¹¥­¡¼¥à¤Ï Unix-like ¤Ê¥·¥¹¥Æ¥à (Linux ¤Ê¤É) +¤ËÆÃÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢¸½ºß¤Ï¤Þ¤À IETF ¤Ë¤è¤ëÅÐÏ¿¤Ï¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤Îʸ½ñ¤Î¼¹É®»þ¤Ë¤ª¤¤¤Æ¡¢ GNOME ¤È KDE ¤Ï¤½¤ì¤¾¤ì°Û¤Ê¤ëʸˡ¤Î URI +¤òÍѤ¤¤Æ¤ª¤ê¡¢¤ª¸ß¤¤Áê¼ê¤Îʸˡ¤ò¼õ¤±Æþ¤ì¤Ê¤¤¡£ +ºÇ½é¤Î 2 ¤Ä¤Î½ñ¼°¤Ï GNOME ¤Î½ñ¼°¤Ç¤¢¤ë¡£¥Î¡¼¥É̾ (nodename) +¤Î¥¹¥Ú¡¼¥¹¤Ï¤¹¤Ù¤Æ¥¢¥ó¥À¡¼¥¹¥³¥¢¤ËÊÑ´¹¤µ¤ì¤ë¡£ +3 ¤Ä¤á¤È 4 ¤Ä¤á¤Ï KDE ¤Î½ñ¼°¤Ç¤¢¤ë¡£¥Î¡¼¥É̾¤Î¥¹¥Ú¡¼¥¹¤Ï +¤½¤Î¤Þ¤Þ¥¹¥Ú¡¼¥¹¤Ç½ñ¤«¤ì¤ë +(URI ¤Îɸ½à¤Ç¤Ï¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¤Î¤À¤¬)¡£ +¾­Íè¤Ï¿¤¯¤Î¥Ä¡¼¥ë¤¬¤³¤ì¤é¤Î½ñ¼°¤¹¤Ù¤Æ¤òÍý²ò¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¡¢ +¥Î¡¼¥É̾¤Î¥¢¥ó¥À¡¼¥¹¥³¥¢¡¢¥¹¥Ú¡¼¥¹¤òξÊý¤È¤âÍý²ò¤Ç¤­¤ë¤è¤¦¤Ë +¤Ê¤ë¤³¤È¤ò´üÂÔ¤·¤¿¤¤¡£ GNOME ¤Ç¤â KDE ¤Ç¤â¡¢ +¥Î¡¼¥É̾¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¤Ï¡¢¥Î¡¼¥É̾¤È¤·¤Æ "Top" ¤¬ÍѤ¤¤é¤ì¤ë¡£ +GNOME ½ñ¼°¤ÎÎã¤È¤·¤Æ¤Ï ¤ä ¤Ê¤É¡¢ +KDE ½ñ¼°¤ÎÎã¤È¤·¤Æ¤Ï ¤ä ¤Ê¤É¡£ +.PP +.\"O .B "whatis \- Documentation search" +.B "whatis \- ʸ½ñ¸¡º÷" +.PP +.RI whatis: string +.PP +.\"O This scheme searches the database of short (one-line) descriptions of +.\"O commands and returns a list of descriptions containing that string. +.\"O Only complete word matches are returned. +.\"O See +.\"O .BR whatis (1). +.\"O This URI scheme is unique to Unix-like systems (such as Linux) +.\"O and is not currently registered by the IETF. +¤³¤Î¥¹¥­¡¼¥à¤Ï¡¢¥³¥Þ¥ó¥É¤Ë´Ø¤¹¤ëû¤¤ (1 ¹Ô¤Î) ÀâÌÀ¤ò½¸¤á¤¿ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¸¡º÷¤·¡¢ string ¤ò´Þ¤àʸ»úÎó¤ò¥ê¥¹¥È¤·¤ÆÊÖ¤¹¡£ +ñ¸ì¤¬´°Á´¤Ë¥Þ¥Ã¥Á¤·¤¿·ë²Ì¤À¤±¤¬ÊÖ¤µ¤ì¤ë¡£ +.BR whatis (1) +¤ò¸«¤è¡£ +¤³¤Î URI ¥¹¥­¡¼¥à¤Ï Unix-like ¤Ê¥·¥¹¥Æ¥à (Linux ¤Ê¤É) +¤ËÆÃÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢¸½ºß¤Ï¤Þ¤À IETF ¤Ë¤è¤ëÅÐÏ¿¤Ï¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O .B "ghelp \- GNOME help documentation" +.B "ghelp \- GNOME ¥Ø¥ë¥×ʸ½ñ" +.PP +.RI ghelp: name-of-application +.PP +.\"O This loads GNOME help for the given application. +.\"O Note that not much documentation currently exists in this format. +Í¿¤¨¤é¤ì¤¿ application ¤ËÂбþ¤¹¤ë GNOME help ¤ò¥í¡¼¥É¤¹¤ë¡£ +¤³¤Î½ñ¼°¤òÍѤ¤¤¿Ê¸½ñ¤Ï¤Þ¤À¤¢¤Þ¤ê¿¤¯¤Ê¤¤¡£ +.PP +.\"O .B "ldap \- Lightweight Directory Access Protocol" +.B "ldap \- ·ÚÎ̥ǥ£¥ì¥¯¥È¥ê¥¢¥¯¥»¥¹¥×¥í¥È¥³¥ë" +.PP +.RI ldap:// hostport +.br +.RI ldap:// hostport / +.br +.RI ldap:// hostport / dn +.br +.RI ldap:// hostport / dn ? attributes +.br +.RI ldap:// hostport / dn ? attributes ? scope +.br +.RI ldap:// hostport / dn ? attributes ? scope ? filter +.br +.RI ldap:// hostport / dn ? attributes ? scope ? filter ? extensions +.PP +.\"O This scheme supports queries to the +.\"O Lightweight Directory Access Protocol (LDAP), a protocol for querying +.\"O a set of servers for hierarchically organized information +.\"O (such as people and computing resources). +.\"O More information on the LDAP URL scheme is available in +.\"O .UR http://www.ietf.org/rfc/rfc2255.txt +.\"O RFC\ 2255. +.\"O .UE +.\"O The components of this URL are: +¤³¤Î¥¹¥­¡¼¥à¤Ï Lightweight Directory Access Protocol (LDAP) +¤Ø¤Î¥¯¥¨¥ê¡¼¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ LDAP ¤ÏÊ£¿ô¤Î¥µ¡¼¥Ð¤Ëʬ»¶¤·¤¿¡¢ +³¬Áز½¤µ¤ì¤¿¾ðÊó (¿Í¡¹¤ä·×»»»ñ¸»¤Ê¤É) ¤ËÌ䤤¹ç¤ï¤»¤ë¤¿¤á¤Î +¥×¥í¥È¥³¥ë¤Ç¤¢¤ë¡£ LDAP ¤Î URL ¥¹¥­¡¼¥à¤Ë´Ø¤¹¤ë¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.UR http://www.ietf.org/rfc/rfc2255.txt +RFC\ 2255 +.UE +¤Ç¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î URL ¤Î³ÆÉô¤Ï°Ê²¼¤ÎÄ̤ê: +.IP hostport 12 +.\"O the LDAP server to query, written as a hostname optionally followed by +.\"O a colon and the port number. +.\"O The default LDAP port is TCP port 389. +.\"O If empty, the client determines which the LDAP server to use. +¥¯¥¨¥ê¡¼¤ò¹Ô¤¦ LDAP ¥µ¡¼¥Ð¡£¥Û¥¹¥È̾¤ò½ñ¤¯¡£Â³¤±¤Æ¥³¥í¥ó¤È¥Ý¡¼¥ÈÈÖ¹æ¤ò +Äɲ乤뤳¤È¤â¤Ç¤­¤ë¡£ LDAP ¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥Ý¡¼¥È¤Ï TCP ¥Ý¡¼¥È 389 ¤Ç¤¢¤ë¡£ +¾Êά¤µ¤ì¤ë¤È¡¢¤É¤Î LDAP ¥µ¡¼¥Ð¤òÍѤ¤¤ë¤«¤Ï¥¯¥é¥¤¥¢¥ó¥È¤¬·èÄꤹ¤ë¡£ +.IP dn +.\"O the LDAP Distinguished Name, which identifies +.\"O the base object of the LDAP search (see +.\"O .UR http://www.ietf.org/rfc/rfc2253.txt +.\"O RFC\ 2253 +.\"O .UE +.\"O section 3). +LDAP ¤Î Distintuished Name (¼±ÊÌ̾)¡£ +LDAP ¸¡º÷¤Î base ¥ª¥Ö¥¸¥§¥¯¥È¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë ( +.UR http://www.ietf.org/rfc/rfc2253.txt +RFC\ 2253 +.UE +¤Î section 3 ¤ò¸«¤è)¡£ +.IP attributes +.\"O a comma-separated list of attributes to be returned; +.\"O see RFC\ 2251 section 4.1.5. +.\"O If omitted, all attributes should be returned. +¥³¥ó¥Þ¶èÀÚ¤ê¤Î¡¢ÊÖ¤µ¤ì¤ë°À­ (attribute) ¤Î¥ê¥¹¥È¡£ +RFC\ 2251 ¤Î section 4.1.5 ¤ò¸«¤è¡£¾Êά¤µ¤ì¤ë¤ÈÁ´¤Æ¤Î°À­¤¬ÊÖ¤µ¤ì¤ë¡£ +.IP scope +.\"O specifies the scope of the search, which can be one of +.\"O "base" (for a base object search), "one" (for a one-level search), +.\"O or "sub" (for a subtree search). +.\"O If scope is omitted, "base" is assumed. +¸¡º÷¤Î¥¹¥³¡¼¥×¤ò»ØÄꤹ¤ë¡£ +"base" (base ¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷), "one" (1 ¥ì¥Ù¥ë¸¡º÷), +"sub" (¥µ¥Ö¥Ä¥ê¡¼¸¡º÷) ¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ +¾Êά¤¹¤ë¤È "base" ¤¬²¾Äꤵ¤ì¤ë¡£ +.IP filter +.\"O specifies the search filter (subset of entries +.\"O to return). +.\"O If omitted, all entries should be returned. +.\"O See +.\"O .UR http://www.ietf.org/rfc/rfc2254.txt +.\"O RFC\ 2254 +.\"O .UE +.\"O section 4. +¸¡º÷¥Õ¥£¥ë¥¿ (ÊÖ¤µ¤ì¤ë¥¨¥ó¥È¥ê¤Î¥µ¥Ö¥»¥Ã¥È) ¤ò»ØÄꤹ¤ë¡£ +¾Êά¤µ¤ì¤ë¤È¡¢Á´¤Æ¤Î¥¨¥ó¥È¥ê¤¬ÊÖ¤µ¤ì¤ë¡£ +.UR http://www.ietf.org/rfc/rfc2254.txt +RFC\ 2254 +.UE +¤Î section 4 ¤ò¸«¤è¡£ +.IP extensions +.\"O a comma-separated list of type=value +.\"O pairs, where the =value portion may be omitted for options not +.\"O requiring it. +.\"O An extension prefixed with a \(aq!\(aq is critical +.\"O (must be supported to be valid), otherwise it is noncritical (optional). +¥³¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¤¿ type=value ¥Ú¥¢¤Î¥ê¥¹¥È¡£ +¤³¤³¤Ç =value ¤ÎÉôʬ¤Ï¡¢¤½¤ì¤òÍ׵ᤷ¤Ê¤¤¥ª¥×¥·¥ç¥ó¤ËÂФ·¤Æ¤Ï +¾Êά¤Ç¤­¤ë¡£ \(aq!\(aq ¤¬Á°ÃÖ¤µ¤ì¤¿ extension ¤Ï critical +(¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤) ¤Ç¤¢¤ê¡¢ +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð critical ¤Ç¤Ï¤Ê¤¤ (¾Êά¤Ç¤­¤ë)¡£ +.PP +.\"O LDAP queries are easiest to explain by example. +.\"O Here's a query that asks ldap.itd.umich.edu for information about +.\"O the University of Michigan in the U.S.: +LDAP ¤Î¥¯¥¨¥ê¡¼¤Ï¡¢Îã¤È¤È¤â¤ËÀâÌÀ¤¹¤ë¤Î¤¬ºÇ¤â´Êñ¤Ç¤¢¤ë¡£ +¼¡¤ÎÎã¤Ï¡¢ ldap.itd.umich.edu ¤Ë¡¢ +U.S. ¤Ë¤¢¤ë University of Michigan ¤Î¾ðÊó¤ò¿Ò¤Í¤ëÎã¤Ç¤¢¤ë¡£ +.PP +.nf +ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US +.fi +.PP +.\"O To just get its postal address attribute, request: +͹ÊØÍѤν»½ê°À­¤À¤±¤ò¼èÆÀ¤¹¤ë¾ì¹ç¤Ï¡¢ +¼¡¤Î¤è¤¦¤Ë¥ê¥¯¥¨¥¹¥È¤¹¤ë: +.PP +.nf +ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US?postalAddress +.fi +.PP +.\"O To ask a host.com at port 6666 for information about the person +.\"O with common name (cn) "Babs Jensen" at University of Michigan, request: +host.com ¤Î¥Ý¡¼¥È 6666 ¤Ë¡¢ University of Michigan ¤Ë¤¤¤ë +common name (cn) ¤¬ "Babs Jenson" ¤Î¿Í¤Î¾ðÊó¤ò¿Ò¤Í¤ë¾ì¹ç¤Ï¡¢ +¼¡¤Î¤è¤¦¤Ë¥ê¥¯¥¨¥¹¥È¤¹¤ë: +.PP +.nf +ldap://host.com:6666/o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen) +.fi +.PP +.\"O .B "wais \- Wide Area Information Servers" +.B "wais \- ¹­°è¾ðÊ󥵡¼¥Ó¥¹" +.PP +.RI wais:// hostport / database +.br +.RI wais:// hostport / database ? search +.br +.RI wais:// hostport / database / wtype / wpath +.PP +.\"O This scheme designates a WAIS database, search, or document +.\"O (see +.\"O .UR http://www.ietf.org/rfc/rfc1625.txt +.\"O IETF RFC\ 1625 +.\"O .UE +.\"O for more information on WAIS). +.\"O Hostport is the hostname, optionally followed by a colon and port number +.\"O (the default port number is 210). +¤³¤Î¥¹¥­¡¼¥à¤Ï WAIS ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢¸¡º÷¡¢Ê¸½ñ¤ò»ØÄꤹ¤ë +(WAIS ¤Ë´Ø¤¹¤ë¾Ü¤·¤¤¾ðÊó¤Ï +.UR http://www.ietf.org/rfc/rfc1625.txt +IETF RFC\ 1625 +.UE +¤ò¸«¤è)¡£ +hostport ¤Ï¡¢¥Û¥¹¥È̾¤Ë¥³¥í¥ó¤È¥Ý¡¼¥ÈÈÖ¹æ¤òÉղä·¤¿¤â¤Î¤Ç¤¢¤ë +(¥³¥í¥ó + ¥Ý¡¼¥ÈÈÖ¹æ¤Ï¾Êά²Ä¡£¥Ç¥Õ¥©¥ë¥È¤Î¥Ý¡¼¥ÈÈÖ¹æ¤Ï 210 ¤Ç¤¢¤ë)¡£ +.PP +.\"O The first form designates a WAIS database for searching. +.\"O The second form designates a particular search of the WAIS database +.\"O .IR database . +.\"O The third form designates a particular document within a WAIS +.\"O database to be retrieved. +.\"O .I wtype +.\"O is the WAIS designation of the type of the object and +.\"O .I wpath +.\"O is the WAIS document-id. +ºÇ½é¤Î½ñ¼°¤Ï WAIS ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë¸¡º÷¤Î»ØÄê¤Ç¤¢¤ë¡£ +Æó¤Ä¤á¤Î½ñ¼°¤ÏÆÃÄê¤Î WAIS ¥Ç¡¼¥¿¥Ù¡¼¥¹ +.I database +¤ËÂФ¹¤ë¸¡º÷¤Î»ØÄê¤Ç¤¢¤ë¡£ +»°¤Ä¤á¤Î½ñ¼°¤Ï WAIS ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤¢¤ëÆÃÄê¤Îʸ½ñ¤ò¼è½Ð¤¹»ØÄê¤Ç¤¢¤ë¡£ +.I wtype +¤Ï WAIS ¤Î¥ª¥Ö¥¸¥§¥¯¥È·Á¼°»ØÄê¤Ç¤¢¤ê¡¢ +.I wpath +¤Ï WAIS document-id ¤Ç¤¢¤ë¡£ +.PP +.\"O .B "other schemes" +.B ¤½¤Î¾¤Î¥¹¥­¡¼¥à +.PP +.\"O There are many other URI schemes. +.\"O Most tools that accept URIs support a set of internal URIs +.\"O (e.g., Mozilla has the about: scheme for internal information, +.\"O and the GNOME help browser has the toc: scheme for various starting +.\"O locations). +.\"O There are many schemes that have been defined but are not as widely +.\"O used at the current time +.\"O (e.g., prospero). +.\"O The nntp: scheme is deprecated in favor of the news: scheme. +.\"O URNs are to be supported by the urn: scheme, with a hierarchical name space +.\"O (e.g., urn:ietf:... would identify IETF documents); at this time +.\"O URNs are not widely implemented. +.\"O Not all tools support all schemes. +¾¤Ë¤â¿¤¯¤Î URI ¥¹¥­¡¼¥à¤¬Â¸ºß¤¹¤ë¡£ +URI ¤ò¼õÉÕ¤±¤ë¤Û¤È¤ó¤É¤Î¥Ä¡¼¥ë¤Ï¡¢ÆâÉô URI ¤Î¥»¥Ã¥È¤ò¥µ¥Ý¡¼¥È¤¹¤ë +(Î㤨¤Ð Mozilla ¤ÏÆâÉô¾ðÊóÍѤΠabout: ¤È¤¤¤¦¥¹¥­¡¼¥à¤ò¼õÉÕ¤±¤ë¤·¡¢ +GNOME ¥Ø¥ë¥×¥Ö¥é¥¦¥¶¤Ï¤¤¤í¤¤¤í¤Ê½ÐȯÅÀÍÑ¤Ë toc: ¤È¤¤¤¦¥¹¥­¡¼¥à¤ò»ý¤Ã¤Æ¤¤¤ë)¡£ +ÄêµÁ¤µ¤ì¤¿¥¹¥­¡¼¥à¤Ï¤¿¤¯¤µ¤ó¤¢¤ë¤¬¡¢¸½»þÅÀ¤Ç¹­¤¯ÍѤ¤¤é¤ì¤Æ¤Ï¤¤¤Ê¤¤ +(Î㤨¤Ð prospero ¤È¤«)¡£ +nntp: ¥¹¥­¡¼¥à¤Ï news: ¥¹¥­¡¼¥à¤¬¹¥¤ó¤ÇÍѤ¤¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤Î¤Ç +»È¤ï¤Ê¤¤¤Û¤¦¤¬Îɤ¤¡£ URN ¤Ï urn: ¥¹¥­¡¼¥à¤Ë¤è¤Ã¤Æ¡¢³¬ÁØŪ¤Ê̾Á°¶õ´Ö +(Î㤨¤Ð urn:ietf:... ¤Ï IETF ʸ½ñ¤ò¼¨¤¹) +¤È¤·¤Æ¥µ¥Ý¡¼¥È¤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¤¬¡¢¸½»þÅÀ¤Ç¤Ï URN ¤Ï¤¢¤Þ¤êÍѤ¤¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +Á´¤Æ¤Î¥Ä¡¼¥ë¤¬Á´¤Æ¤Î¥¹¥­¡¼¥à¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.\"O .SS Character Encoding +.SS ʸ»ú¥¨¥ó¥³¡¼¥É +.PP +.\"O URIs use a limited number of characters so that they can be +.\"O typed in and used in a variety of situations. +URI ¤Ç¤Ï¡¢¿§¡¹¤Ê¾õ¶·²¼¤ÇÆþÎϤǤ­¤ë¤è¤¦¤Ë¡¢Ê¸»ú¤Î¼ïÎà¤òÀ©¸Â¤·¤Æ¤¤¤ë¡£ +.PP +.\"O The following characters are reserved, that is, they may appear in a +.\"O URI but their use is limited to their reserved purpose +.\"O (conflicting data must be escaped before forming the URI): +°Ê²¼¤Îʸ»ú¤ÏͽÌ󤵤ì¤Æ¤¤¤ë¡£¤¹¤Ê¤ï¤Á¡¢¤³¤ì¤é¤Îʸ»ú¤Ï +URI ¤ËÅо줹¤ë¤³¤È¤¬¤¢¤ë¤¬¡¢¤½¤ì¤é¤ÎÍøÍÑË¡ (²ò¼á¤Î¤µ¤ìÊý) ¤Ï +ͽÌ󤵤줿ÌÜŪ¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë (¾×Æͤ¹¤ë¥Ç¡¼¥¿¤Ï +URI ¤Ë¤¹¤ëÁ°¤Ë¥¨¥¹¥±¡¼¥×¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ +.IP + ; / ? : @ & = + $ , +.PP +.\"O Unreserved characters may be included in a URI. +.\"O Unreserved characters +.\"O include upper and lower case English letters, +.\"O decimal digits, and the following +.\"O limited set of punctuation marks and symbols: +̤ͽÌóʸ»ú (unreserved character) ¤Ï URI ¤Ë»È¤Ã¤Æ¤è¤¤¡£ +¤³¤ì¤Ë¤Ï±Ñ»ú¤ÎÂçʸ»ú¤È¾®Ê¸»ú¡¢10 ¿Ê¤Î¿ô»ú¡¢¤ª¤è¤Ó +°Ê²¼¤Î¶çÆÉʸ»ú¡¦µ­¹æ¤¬´Þ¤Þ¤ì¤ë +.IP + \- _ . ! ~ * ' ( ) +.PP +.\"O All other characters must be escaped. +.\"O An escaped octet is encoded as a character triplet, consisting of the +.\"O percent character "%" followed by the two hexadecimal digits +.\"O representing the octet code (you can use upper or lower case letters +.\"O for the hexadecimal digits). +.\"O For example, a blank space must be escaped +.\"O as "%20", a tab character as "%09", and the "&" as "%26". +.\"O Because the percent "%" character always has the reserved purpose of +.\"O being the escape indicator, it must be escaped as "%25". +.\"O It is common practice to escape space characters as the plus symbol (+) +.\"O in query text; this practice isn't uniformly defined +.\"O in the relevant RFCs (which recommend %20 instead) but any tool accepting +.\"O URIs with query text should be prepared for them. +.\"O A URI is always shown in its "escaped" form. +¾¤Îʸ»ú¤Ï¤¹¤Ù¤Æ¥¨¥¹¥±¡¼¥×¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥¨¥¹¥±¡¼¥×¤µ¤ì¤¿¥ª¥¯¥Æ¥Ã¥È¤Ï 3 ʸ»ú¤«¤é¤Ê¤ë: +ÀèƬ¤Ë¥Ñ¡¼¥»¥ó¥Èʸ»ú "%"¡¢¤½¤ì¤Ë³¤±¤Æ¥ª¥¯¥Æ¥Ã¥È¥³¡¼¥É¤òɽ¤¹ +2 ʸ»ú¤Î 16 ¿Ê¿ô»ú¤Ç¤¢¤ë (16 ¿Ê¿ô¤Î±Ñ»ú¤ÏÂçʸ»ú¾®Ê¸»ú¤É¤Á¤é¤Ç¤âÎɤ¤)¡£ +Î㤨¤Ð¶õÇòʸ»ú¤Ï "%20" ¤Î¤è¤¦¤Ë¥¨¥¹¥±¡¼¥×¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¥¿¥Öʸ»ú¤Ï "%09"¡¢ "&" ¤Ï "%26" ¤È¤Ê¤ë¡£ +¥Ñ¡¼¥»¥ó¥Èʸ»ú "%" ¤Ï¾ï¤Ë¥¨¥¹¥±¡¼¥×¤ò¼¨¤¹Í½Ì󤵤줿ÌÜŪ¤ËÍѤ¤¤é¤ì¤ë¤Î¤Ç¡¢ +"%" ¼«¿È¤òɽ¤¹¤Ë¤Ï "%25" ¤È¥¨¥¹¥±¡¼¥×¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥¯¥¨¥ê¡¼¤Î¥Æ¥­¥¹¥È¤Ç¤Ï¡¢¥¹¥Ú¡¼¥¹Ê¸»ú¤ò¥×¥é¥¹µ­¹æ (+) ¤Ç¥¨¥¹¥±¡¼¥×¤¹¤ë¤³¤È¤â +°ìÈ̤ËÎɤ¯¹Ô¤ï¤ì¤ë¡£¤³¤Î´·Îã¤Ï´ØÏ¢ RFC ¤Ç¼ÂºÝ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤ +(Âå¤ï¤ê¤Ë %20 ¤ò¿ä¾©¤·¤Æ¤¤¤ë) ¤¬¡¢¥¯¥¨¥ê¡¼¥Æ¥­¥¹¥È¤ò¼õÉÕ¤±¤ë +¥Ä¡¼¥ë¤Ï¡¢¤³¤Î½ñ¼°¤Ø¤ÎÂбþ¤òÍÑ°Õ¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤í¤¦¡£ +URI ¤Ï¡¢¾ï¤Ë¡Ö¥¨¥¹¥±¡¼¥×¤µ¤ì¤¿¡×¤«¤¿¤Á¤Çɽ¼¨¤µ¤ì¤ë¡£ +.PP +.\"O Unreserved characters can be escaped without changing the semantics +.\"O of the URI, but this should not be done unless the URI is being used +.\"O in a context that does not allow the unescaped character to appear. +.\"O For example, "%7e" is sometimes used instead of "~" in an HTTP URL +.\"O path, but the two are equivalent for an HTTP URL. +̤ͽÌóʸ»ú¤â¥¨¥¹¥±¡¼¥×¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢¤³¤ì¤Ë¤è¤Ã¤Æ +URI ¤Î°ÕÌ£¤¹¤ë¤È¤³¤í¤¬ÊѤï¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¤·¤«¤·URI ¤Ë¤½¤ÎÈ󥨥¹¥±¡¼¥×ʸ»ú¤¬¸½¤ì¤ë¤³¤È¤¬µö¤µ¤ì¤Ê¤¤¤è¤¦¤Ê +Æüì¤Ê¾ì¹ç¤ò½ü¤¤¤Æ¡¢¤³¤ì¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢ HTTP URL ¤Î path ¤Ë¤ª¤¤¤Æ +"%7e" ¤¬ "~" ¤ÎÂå¤ï¤ê¤ËÍѤ¤¤é¤ì¤ë¤³¤È¤¬¤¢¤ë¤¬¡¢ +¤³¤ÎÆó¤Ä¤Ï HTTP URL ¤È¤·¤Æ¤ÏÅù²Á¤Ç¤¢¤ë¡£ +.PP +.\"O For URIs which must handle characters outside the US ASCII character set, +.\"O the HTML 4.01 specification (section B.2) and +.\"O IETF RFC\ 2718 (section 2.2.5) recommend the following approach: +US ASCII ¥­¥ã¥é¥¯¥¿¥»¥Ã¥È°Ê³°¤Îʸ»ú¤ò URI ¤È¤·¤Æ°·¤¦¾ì¹ç¡¢ +HTML 4.1 µ¬³Ê (section B.2) µÚ¤Ó IETF RFC\ 2718 (section 2.2.5) ¤Ï +°Ê²¼¤Î¼êË¡¤òÍѤ¤¤ë¤è¤¦¿ä¾©¤·¤Æ¤¤¤ë¡£ +.IP 1. 4 +.\"O translate the character sequences into UTF-8 (IETF RFC\ 2279) \(em see +.\"O .BR utf-8 (7) +.\"O \(em and then +¥­¥ã¥é¥¯¥¿Îó¤ò UTF-8 (IETF RFC\ 2279, +.BR utf-8 (7) +»²¾È) ¤ËÊÑ´¹¤·¡¢ +.IP 2. +.\"O use the URI escaping mechanism, that is, +.\"O use the %HH encoding for unsafe octets. +URI ¥¨¥¹¥±¡¼¥×µ¡¹½¤òÍѤ¤¤ë¡£ +¤Ä¤Þ¤ê¡¢°ÂÁ´¤Ç¤Ê¤¤¥ª¥¯¥Æ¥Ã¥È¤ò %HH ¤Ç¥¨¥ó¥³¡¼¥É¤¹¤ë¡£ +.\"O .SS Writing a URI +.SS "URI ¤ò½ñ¤¯¤Ë¤Ï" +.\"O When written, URIs should be placed inside double quotes +.\"O (e.g., "http://www.kernelnotes.org"), +.\"O enclosed in angle brackets (e.g., ), +.\"O or placed on a line by themselves. +.\"O A warning for those who use double-quotes: +.\"O .B never +.\"O move extraneous punctuation (such as the period ending a sentence or the +.\"O comma in a list) +.\"O inside a URI, since this will change the value of the URI. +.\"O Instead, use angle brackets instead, or +.\"O switch to a quoting system that never includes extraneous characters +.\"O inside quotation marks. +.\"O This latter system, called the 'new' or 'logical' quoting system by +.\"O "Hart's Rules" and the "Oxford Dictionary for Writers and Editors", +.\"O is preferred practice in Great Britain and hackers worldwide +.\"O (see the +.\"O Jargon File's section on Hacker Writing Style, +.\"O .IR http://www.fwi.uva.nl/~mes/jargon/h/HackerWritingStyle.html , +.\"O for more information). +.\"O Older documents suggested inserting the prefix "URL:" +.\"O just before the URI, but this form has never caught on. +URI ¤ò½ñ¤¯»þ¤Ë¤Ï¡¢¥À¥Ö¥ë¥¯¥©¡¼¥È¤ÎÆâÉô¤Ë½ñ¤¯ +(Îã: "http://www.kernelnotes.org") ¤«¡¢ +angle ¥Ö¥é¥±¥Ã¥È¤Ç°Ï¤à (Îã: ) ¤«¡¢ +°ì¹Ô¤Ë URI ¤À¤±¤ò½ñ¤¯¤«¤¹¤ë¡£ +¥À¥Ö¥ë¥¯¥©¡¼¥È¤ò»È¤¦¿Í¤Ë·Ù¹ð: +\fBÀäÂФË\fP¶çÆÉÅÀ (ʸËö¤Î¥Ô¥ê¥ª¥É¤ä¥ê¥¹¥È¶èÀÚ¤ê¤Î¥³¥ó¥Þ) ¤ò +URI ¤ÎÆâÉô¤Ë°ÜÆ°¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë angle ¥Ö¥é¥±¥Ã¥È¤ò»È¤¦¤«¡¢ +³°¤Ë¤¢¤ëʸ»ú¤ò¥¯¥©¡¼¥Æ¡¼¥·¥ç¥ó¥Þ¡¼¥¯¤ÎÆâÉô¤Ë +·è¤·¤Æ´Þ¤á¤Ê¤¤¤è¤¦¤Ê°úÍÑÊý¼°¤ËÀÚÂؤ¨¤ë¤³¤È¡£ +¸å¼Ô¤ÎÊý¼°¤Ï "Hart's Rules" ¤ä +"Oxford Dictionary for Writers and Editors" ¤Ë¤è¤ì¤Ð +¡Ö¿·¤·¤¤ (new) °úÍÑÊý¼°¡×¤¢¤ë¤¤¤Ï¡ÖÏÀÍýŪ (logical) ¤Ê°úÍÑÊý¼°¡× +¤È¸Æ¤Ð¤ì¤Æ¤ª¤ê¡¢ ¥¤¥®¥ê¥¹¿Í¤äÀ¤³¦Ãæ¤Î¥Ï¥Ã¥«¡¼Ã£¤Ï¤³¤Á¤é¤Î´·½¬¤ò¹¥¤ó¤Ç¤¤¤ë +(¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +Hacker Writing Style ¤Î Jargon File ¤Î¥»¥¯¥·¥ç¥ó +.I http://www.fwi.uva.nl/~mes/jargon/h/HackerWritingStyle.html +¤ò¸«¤è)¡£ +¸Å¤¤Ê¸½ñ¤Ç¤Ï¡¢ "URL:" ¤È¤¤¤¦Ê¸»úÎó¤ò URI ¤ÎľÁ°¤ËÁÞÆþ¤¹¤ë¤³¤È¤ò +´«¤á¤Æ¤¤¤ë¤â¤Î¤â¤¢¤ë¤¬¡¢¤·¤«¤·¤³¤Î·Á¼°¤Ï¤Þ¤Ã¤¿¤¯Î®¹Ô¤·¤Ê¤«¤Ã¤¿¡£ +.PP +.\"O The URI syntax was designed to be unambiguous. +.\"O However, as URIs have become commonplace, traditional media +.\"O (television, radio, newspapers, billboards, etc.) have increasingly +.\"O used abbreviated URI references consisting of +.\"O only the authority and path portions of the identified resource +.\"O (e.g., ). +.\"O Such references are primarily +.\"O intended for human interpretation rather than machine, with the +.\"O assumption that context-based heuristics are sufficient to complete +.\"O the URI (e.g., hostnames beginning with "www" are likely to have +.\"O a URI prefix of "http://" and hostnames beginning with "ftp" likely +.\"O to have a prefix of "ftp://"). +URI ¤Î½ñ¼°¤ÏÛ£Ë椵¤òÇÓ½ü¤¹¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +¤·¤«¤· URI ¤¬¹­¤Þ¤ë¤Ë¤Ä¤ì¡¢ÀΤʤ¬¤é¤Î¥á¥Ç¥£¥¢ (TV¡¢¥é¥¸¥ª¡¢¿·Ê¹¡¢ +´ÇÈĤʤɤʤÉ) ¤Ï URI »²¾È¤ò¾Êά¤·¤¿¤«¤¿¤Á¡¢¤¹¤Ê¤ï¤Á +µ¡´ØÉô¤È¥Ñ¥¹Éô¤À¤±¤Ç¥ê¥½¡¼¥¹¤ò»ØÄꤹ¤ë¤³¤È¤¬Â¿¤¯¤Ê¤Ã¤Æ¤¤¤ë +(Îã: )¡£ +¤³¤Î¤è¤¦¤Ê»²¾È¤Ï¥Þ¥·¥ó¤È¤¤¤¦¤è¤ê¤Ï¿Í´Ö¸þ¤±¤Î¤â¤Î¤Ç¡¢ +¥³¥ó¥Æ¥­¥¹¥È¥Ù¡¼¥¹¤Î¿ä¬¤Ë¤è¤Ã¤Æ URI ¤ÎÊä´°¤¬²Äǽ¤Ç¤¢¤ë¤³¤È¤ò +¤¢¤Æ¤Ë¤·¤Æ¤¤¤ë¤Î¤Ç¤¢¤ë (Î㤨¤Ð "www" ¤Ç¤Ï¤¸¤Þ¤ë¥Û¥¹¥È̾¤Ê¤é +"http://" ¤¬¤Ä¤¯¤À¤í¤¦¤·¡¢ "ftp" ¤Ç¤Ï¤¸¤Þ¤ë¥Û¥¹¥È̾¤Ê¤é +"ftp://" ¤¬¤Ä¤¯¤À¤í¤¦)¡£ +.\"O Many client implementations heuristically resolve these references. +.\"O Such heuristics may +.\"O change over time, particularly when new schemes are introduced. +.\"O Since an abbreviated URI has the same syntax as a relative URL path, +.\"O abbreviated URI references cannot be used where relative URIs are +.\"O permitted, and can only be used when there is no defined base +.\"O (such as in dialog boxes). +.\"O Don't use abbreviated URIs as hypertext links inside a document; +.\"O use the standard format as described here. +¿¤¯¤Î¥¯¥é¥¤¥¢¥ó¥È¤Î¼ÂÁõ¤Ç¤Ï¡¢¤³¤Î¼ï¤Î»²¾È¤ò¿ä¬¤Ë¤è¤Ã¤Æ²ò·è¤¹¤ë¡£ +¤³¤Î¤è¤¦¤Ê¿ä¬¤Ï»þÂå¤È¤È¤â¤ËÊѤï¤ê¤¦¤ë¡£ +Æä˿·¤·¤¤¥¹¥­¡¼¥à¤¬Æ³Æþ¤µ¤ì¤ë¤È¤½¤¦¤Ç¤¢¤ë¡£ +URI ¤Î¾Êά·Á¤Ç¤ÏÁêÂÐ URL ¥Ñ¥¹¤Î¶èÊ̤¬ÉÕ¤±¤é¤ì¤Ê¤¤¤Î¤Ç¡¢ +¾Êά·Á URI »²¾È¤ÏÁêÂÐ URI ¤ÎÍøÍѤǤ­¤ë¤È¤³¤í¤Ç¤Ï»È¤¨¤Ê¤¤¡£ +¤Ä¤Þ¤êÄêµÁºÑ¤ß¤Î¥Ù¡¼¥¹ (¥À¥¤¥¢¥í¥°¥Ü¥Ã¥¯¥¹¤Ê¤É) +¤¬¤Ê¤¤¾ì¹ç¤Ë¸Â¤Ã¤ÆÍøÍѤǤ­¤ë¡£ +.\"nakano: ¤³¤Îʸ̮¤Ç¤Î dialog box ¤È¤Ï¡© +ʸ½ñÆâÉô¤Ç¤Î¥Ï¥¤¥Ñ¡¼¥Æ¥­¥¹¥È¥ê¥ó¥¯¤Ë¤Ï¾Êά·Á URI ¤ò»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¾å½Ò¤Îɸ½à¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»È¤¦¤³¤È¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.PP +.I http://www.ietf.org/rfc/rfc2396.txt +(IETF RFC\ 2396), +.UE +.I http://www.w3.org/TR/REC-html40 +(HTML 4.0). +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Any tool accepting URIs (e.g., a web browser) on a Linux system should +.\"O be able to handle (directly or indirectly) all of the +.\"O schemes described here, including the man: and info: schemes. +.\"O Handling them by invoking some other program is +.\"O fine and in fact encouraged. +Linux ¥·¥¹¥Æ¥à¤Ç URI ¤ò¼õÉÕ¤±¤ë¥Ä¡¼¥ë (Î㤨¤Ð web ¥Ö¥é¥¦¥¶¤Ê¤É) ¤Ï¡¢ +¾å¤Ë¤¢¤²¤¿Á´¤Æ¤Î¥¹¥­¡¼¥à¤ò (ľÀܤޤ¿¤Ï´ÖÀܤË) °·¤¨¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +man: ¤ä info: ¤â´Þ¤á¤Æ¡¢¤Ç¤¢¤ë¡£ +¥¹¥­¡¼¥à¤Î½èÍý¤Ë¾¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤Î¤ÏÎɤ¤¤³¤È¤À¤·¡¢ +¼Â¤Ï¤¹¤¹¤ó¤Ç¤½¤¦¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.\"O Technically the fragment isn't part of the URI. +µ»½ÑŪ¤Ë¤Ï¡¢¥Õ¥é¥°¥á¥ó¥È¤Ï URI ¤Î°ìÉô¤Ç¤Ï¤Ê¤¤¡£ +.PP +.\"O For information on how to embed URIs (including URLs) in a data format, +.\"O see documentation on that format. +.\"O HTML uses the format +.\"O .I text +.\"O . +.\"O Texinfo files use the format @uref{\fIuri\fP}. +.\"O Man and mdoc have the recently added UR macro, or just include the +.\"O URI in the text (viewers should be able to detect :// as part of a URI). +URI (URL ¤â´Þ¤à) ¤ò¥Ç¡¼¥¿¥Õ¥©¡¼¥Þ¥Ã¥È¤ËËä¤á¤³¤àÊýË¡¤Ë´Ø¤¹¤ë¾ðÊó¤Ï¡¢ +¤½¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¥É¥­¥å¥á¥ó¥È¤ò¸«¤è¡£ HTML ¤Ï +\fItext\fP +¤òÍѤ¤¤ë¡£ texinfo ¤Ï @uref{\fIuri\fP} ¤È¤¤¤¦½ñ¼°¤òÍѤ¤¤ë¡£ +man ¤È mdoc ¤Ï¡¢ºÇ¶áÄɲ䵤줿 UR ¥Þ¥¯¥í¤ò»È¤¦¡£ +¤¢¤ë¤¤¤Ï URI ¤ò¤½¤Î¤Þ¤Þ¥Æ¥­¥¹¥È¤ËËä¤á¤³¤à +(¥Ó¥å¡¼¥¢¤¬ :// ¤ò URI ¤Î°ìÉô¤È²ò¼á¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ +.PP +.\"O The GNOME and KDE desktop environments currently vary in the URIs +.\"O they accept, in particular in their respective help browsers. +.\"O To list man pages, GNOME uses while KDE uses , and +.\"O to list info pages, GNOME uses while KDE uses +.\"O (the author of this man page prefers the KDE approach here, though a more +.\"O regular format would be even better). +.\"O In general, KDE uses as a prefix to a set of generated +.\"O files. +¥Ç¥¹¥¯¥È¥Ã¥×´Ä¶­¤Ç¤¢¤ë GNOME ¤È KDE ¤Ï¡¢ +¤½¤ì¤¾¤ì¼õÉÕ¤±¤ë URI ¤¬ (Æäˤ½¤ì¤¾¤ì¤Î¥Ø¥ë¥×¥Ö¥é¥¦¥¶¤Ë¤ª¤¤¤Æ) +°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +man ¥Ú¡¼¥¸¤ò¥ê¥¹¥È¤¹¤ë¤Ë¤Ï¡¢ +GNOME ¤Ç¤Ï ¤òÍѤ¤¡¢ KDE ¤Ç¤Ï ¤òÍѤ¤¤ë¡£ +¤Þ¤¿ info ¥Ú¡¼¥¸¤ò¥ê¥¹¥È¤¹¤ë¤Ë¤Ï¡¢ +GNOME ¤Ç¤Ï ¤òÍѤ¤¡¢ KDE ¤Ç¤Ï ¤òÍѤ¤¤ë +(ËÜ man ¥Ú¡¼¥¸¤ÎÃø¼Ô¤Ï KDE ¤Î¥¢¥×¥í¡¼¥Á¤Î¤Û¤¦¤¬¹¥¤ß¤Ç¤¢¤ë¡£ +¤·¤«¤·¤è¤êɸ½àŪ¤Ê½ñ¼°¤ÎÊý¤¬¹¹¤ËÎɤ¤¤¬)¡£ +°ìÈÌ¤Ë KDE ¤ÏÀ¸À®¥Õ¥¡¥¤¥ë (generated file) ¤Î¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤È¤·¤Æ + ¤òÍѤ¤¤ë¡£ +.\"nakano: °ÕÌ£¥ï¥«¥é¥ó... KDE ¤Ë¾Ü¤·¤¤¿Í¡Á +.\"O KDE prefers documentation in HTML, accessed via the +.\"O . +.\"O GNOME prefers the ghelp scheme to store and find documentation. +.\"O Neither browser handles file: references to directories at the time +.\"O of this writing, making it difficult to refer to an entire directory with +.\"O a browsable URI. +KDE ¤Ï HTML ¤Îʸ½ñ¤ò + ·Ðͳ¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤Î¤¬¹¥¤ß¤Ê¤è¤¦¤Ç¤¢¤ë¡£ +GNOME ¤Ïʸ½ñ¤ÎÊÝ´É¡¦¸¡º÷¤Ë ghelp ¥¹¥­¡¼¥à¤òÍѤ¤¤ëÊýË¡¤ò¼è¤Ã¤Æ¤¤¤ë¤è¤¦¤À¡£ +¤É¤Á¤é¤Î¥Ö¥é¥¦¥¶¤â¡¢¸½»þÅÀ¤Ç¤Ï file: ¤Ë¤è¤ë¥Ç¥£¥ì¥¯¥È¥ê»²¾È¤ò°·¤¨¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¥Ç¥£¥ì¥¯¥È¥êÁ´ÂΤò¥Ö¥é¥¦¥º²Äǽ¤Ê URI ¤Ç»²¾È¤¹¤ë¤³¤È¤¬Æñ¤·¤¤¡£ +.\"O As noted above, these environments differ in how they handle the +.\"O info: scheme, probably the most important variation. +.\"O It is expected that GNOME and KDE +.\"O will converge to common URI formats, and a future +.\"O version of this man page will describe the converged result. +.\"O Efforts to aid this convergence are encouraged. +Àè¤Ë½Ò¤Ù¤¿¤è¤¦¤Ë¡¢¤³¤ì¤éÆó¤Ä¤Î´Ä¶­¤Ç¤Ï info: ¥¹¥­¡¼¥à¤Î +°·¤¤¤¬°Û¤Ê¤Ã¤Æ¤¤¤ë (¤ª¤½¤é¤¯ºÇ¤â½ÅÍפʺ¹°Û¤Ç¤¢¤í¤¦)¡£ +GNOME ¤È KDE ¤¬¶¦ÄÌ URI ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¼ýṲ́¹¤ë¤³¤È¤¬Ë¾¤Þ¤·¤¤¡£ +¤³¤Î man ¥Ú¡¼¥¸¤¬¡¢¾­Íè¤Ï¤½¤Î¼ýṲ́·¤¿·ë²Ì¤òµ­½Ò¤Ç¤­¤ë¤³¤È¤ò˾¤à¡£ +¤³¤Îºî¶È¤Ø¤Î½õÎϤò´­µ¯¤·¤¿¤¤¡£ +.\"O .SS Security +.SS ¥»¥­¥å¥ê¥Æ¥£ +.PP +.\"O A URI does not in itself pose a security threat. +.\"O There is no general guarantee that a URL, which at one time +.\"O located a given resource, will continue to do so. +.\"O Nor is there any +.\"O guarantee that a URL will not locate a different resource at some +.\"O later point in time; such a guarantee can only be +.\"O obtained from the person(s) controlling that namespace and the +.\"O resource in question. +URI ¤½¤Î¤â¤Î¤Ï¥»¥­¥å¥ê¥Æ¥£¤Î¶¼°Ò¤ò°ú¤­µ¯¤³¤¹¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +¤¢¤ë»þÅÀ¤Ç¤Ï¥ê¥½¡¼¥¹¤Î¾ì½ê¤òÍ¿¤¨¤Æ¤¤¤¿ URL ¤¬¡¢ +¤º¤Ã¤È¤½¤¦¤Ç¤¢¤ê¤Ä¤Å¤±¤ë¤È¤¤¤¦ÊݾڤϰìÈ̤ˤϤʤ¤¡£ +¤Þ¤¿¤¢¤ë URL ¤¬¡¢¾­Íè¤Ë¤ÏÊ̤Υ꥽¡¼¥¹¤ò¼¨¤µ¤Ê¤¤¤È¤â¸Â¤é¤Ê¤¤¡£ +¤³¤Î¤è¤¦¤ÊÊݾڤϡ¢¤½¤Î̾Á°¶õ´Ö¤È¥ê¥½¡¼¥¹¤È¤ò´ÉÍý¤·¤Æ¤¤¤ë¸Ä¿Í¤Ë +µ¢¤¹¤ë¤â¤Î¤Ë²á¤®¤Ê¤¤¡£ +.PP +.\"O It is sometimes possible to construct a URL such that an attempt to +.\"O perform a seemingly harmless operation, such as the +.\"O retrieval of an entity associated with the resource, will in fact +.\"O cause a possibly damaging remote operation to occur. +.\"O The unsafe URL +.\"O is typically constructed by specifying a port number other than that +.\"O reserved for the network protocol in question. +.\"O The client unwittingly contacts a site that is in fact +.\"O running a different protocol. +.\"O The content of the URL contains instructions that, when +.\"O interpreted according to this other protocol, cause an unexpected +.\"O operation. +.\"O An example has been the use of a gopher URL to cause an +.\"O unintended or impersonating message to be sent via a SMTP server. +̵³²¤Ë¸«¤¨¤ëÁàºî (¥ê¥½¡¼¥¹¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥¨¥ó¥Æ¥£¥Æ¥£¤Î¼èÆÀ¤Ê¤É) +¤Ë¤è¤Ã¤Æ¡¢¼ÂºÝ¤Ë¤Ï¥ê¥â¡¼¥È¤Ë¥À¥á¡¼¥¸¤òÍ¿¤¨¤ëÆ°ºî¤ò°ú¤­µ¯¤³¤¹¤è¤¦¤Ê +URL ¤òµ­½Ò¤¹¤ë¤³¤È¤â¾ì¹ç¤Ë¤è¤Ã¤Æ¤Ï²Äǽ¤Ç¤¢¤ë¡£ +´í¸±¤Ê URL ¤Îŵ·¿Åª¤Ê¤â¤Î¤Ï¡¢¤½¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥×¥í¥È¥³¥ë¤Ë +ͽÌ󤵤ì¤Æ¤¤¤ë¥Ý¡¼¥ÈÈÖ¹æ¤È¤Ï°Û¤Ê¤ë¥Ý¡¼¥È¤ò»ØÄꤷ¤Æ¤¤¤ë¤â¤Î¤Ç¤¢¤ë¡£ +URL ¤ÎÆâÍƤˤÏÌ¿Î᤬´Þ¤Þ¤ì¤Æ¤¤¤Æ¡¢ +¤½¤Î¥×¥í¥È¥³¥ë¤Ë¤·¤¿¤¬¤Ã¤Æ²ò¼á¤µ¤ì¤¿¤È¤­¡¢ +ͽ´ü¤µ¤ì¤Ê¤¤Æ°ºî¤ò°úµ¯¤³¤¹¤Î¤Ç¤¢¤ë¡£ +Îã¤ò¤¢¤²¤ë¤È¡¢ gopher ¤Î URL ¤Ë¤è¤Ã¤Æ¡¢°Õ¿Þ¤·¤Ê¤¤¥á¥Ã¥»¡¼¥¸¤ä +¤Ê¤ê¤¹¤Þ¤·¥á¥Ã¥»¡¼¥¸¤Ê¤É¤¬ SMTP ¥µ¡¼¥Ð·Ðͳ¤ÇÁ÷¿®¤µ¤ì¤ë¤è¤¦¤Ê¤³¤È¤¬¤¢¤Ã¤¿¡£ +.PP +.\"O Caution should be used when using any URL that specifies a port +.\"O number other than the default for the protocol, especially when it is +.\"O a number within the reserved space. +¤½¤Î¥×¥í¥È¥³¥ë¤Î¥Ç¥Õ¥©¥ë¥È°Ê³°¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤷ¤Æ¤¤¤ë +URL ¤òÍѤ¤¤ë¤È¤­¤Ë¤ÏÃí°Õ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Æäˤ½¤ÎÈֹ椬ͽÌó¶õ´Ö¤ÎÆâÉô¤Ë¤¢¤ë¾ì¹ç¤Ë¤Ï¡£ +.PP +.\"O Care should be taken when a URI contains escaped delimiters for a +.\"O given protocol (for example, CR and LF characters for telnet +.\"O protocols) that these are not unescaped before transmission. +.\"O This might violate the protocol, but avoids the potential for such +.\"O characters to be used to simulate an extra operation or parameter in +.\"O that protocol, which might lead to an unexpected and possibly harmful +.\"O remote operation to be performed. +URI ¤Ë¡¢¤½¤Î¥×¥í¥È¥³¥ë¤ËÂФ¹¤ë¥Ç¥ê¥ß¥¿¤¬¥¨¥¹¥±¡¼¥×¤µ¤ì¤¿¤«¤¿¤Á¤ÇÆþ¤Ã¤Æ¤¤¤ë +¾ì¹ç¤âÃí°Õ¤¬É¬ÍפǤ¢¤ë +(Î㤨¤Ð telnet ¥×¥í¥È¥³¥ë¤ËÂФ¹¤ë CR ʸ»ú¤ä LF ʸ»ú¤Ê¤É)¡£ +¤Ê¤¼¤Ê¤é¤³¤ì¤é¤ÏžÁ÷Á°¤Ë¥¨¥¹¥±¡¼¥×¤¬³°¤µ¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï¥×¥í¥È¥³¥ë¤ËÈ¿¤·¤Æ¤ª¤ê¡¢Í½´ü¤·¤Ê¤¤¡¢¤ª¤½¤é¤¯¤Ï³²¤Ë¤Ê¤ë¤è¤¦¤Ê +¥ê¥â¡¼¥ÈÆ°ºî¤ò°úµ¯¤³¤¹·ë²Ì¤È¤Ê¤ê¤«¤Í¤Ê¤¤¡£ +.PP +.\"O It is clearly unwise to use a URI that contains a password which is +.\"O intended to be secret. +.\"O In particular, the use of a password within +.\"O the "userinfo" component of a URI is strongly recommended against except +.\"O in those rare cases where the "password" parameter is intended to be public. +ÈëÌ©¤Ë¤·¤Æ¤ª¤¯¤Ù¤­¥Ñ¥¹¥ï¡¼¥É¤ò´Þ¤ó¤À URI ¤ò»È¤¦¤Î¤¬ +¸­¤¯¤Ê¤¤¤Î¤ÏÌÀ¤é¤«¤Ç¤¢¤ë¡£Æäˡ¢¥Ñ¥¹¥ï¡¼¥É¤ò URI ¤Î +"userinfo" ¤ÎÉôʬ¤Ë»È¤¦¤Î¤ÏÀäÂФËÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +¤¿¤À¤·¤½¤Î "password" ¤Î¥Ñ¥é¥á¡¼¥¿¤ò°Õ¿ÞŪ¤Ë¸ø³«¤·¤¿¤¤¾ì¹ç¤ÏÊ̤Ǥ¢¤ë¤¬¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.PP +.\"O Documentation may be placed in a variety of locations, so there +.\"O currently isn't a good URI scheme for general online documentation +.\"O in arbitrary formats. +.\"O References of the form +.\"O don't work because different distributions and +.\"O local installation requirements may place the files in different +.\"O directories +.\"O (it may be in /usr/doc, or /usr/local/doc, or /usr/share, +.\"O or somewhere else). +ʸ½ñ¤ÏÍÍ¡¹¤Ê¾ì½ê¤ËÃÖ¤«¤ì¤¦¤ë¡£¤·¤¿¤¬¤Ã¤Æ¸½»þÅÀ¤Ç¤Ï¡¢ +Ǥ°Õ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç½ñ¤«¤ì¤¿°ìÈ̤Υª¥ó¥é¥¤¥óʸ½ñ¤ËÂФ¹¤ëÎɤ¤ URI ¥¹¥­¡¼¥à¤¬ +¸ºß¤·¤Ê¤¤¡£ + ·Á¼°¤Î»²¾È¤Ï»È¤¨¤Ê¤¤¡£¤Ê¤¼¤Ê¤é +¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤ä¥í¡¼¥«¥ë¤Ø¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ÎºÝ¤Î¾ò·ï¤Ë¤è¤Ã¤Æ¡¢ +¥Õ¥¡¥¤¥ë¤Ï°Û¤Ê¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤ë¤³¤È¤¬¤¢¤ë¤«¤é¤Ç¤¢¤ë +(/usr/doc ¤« /usr/local/doc ¤« /usr/share ¤«¤½¤Î¾¤Î¾ì½ê¤«¡¢¤Ê¤É¤Ê¤É)¡£ +.\"O Also, the directory ZZZ usually changes when a version changes +.\"O (though filename globbing could partially overcome this). +.\"O Finally, using the file: scheme doesn't easily support people +.\"O who dynamically load documentation from the Internet (instead of +.\"O loading the files onto a local file system). +¤Þ¤¿¡¢¥Ç¥£¥ì¥¯¥È¥ê ZZZ ¤ÏÄ̾ï¥Ð¡¼¥¸¥ç¥ó¤¬ÊѤï¤ë¤È°Û¤Ê¤Ã¤¿¤â¤Î¤Ë¤Ê¤ë +(¥Õ¥¡¥¤¥ë̾¤Î¥°¥í¥Ö¤Ë¤è¤Ã¤Æ¤¢¤ëÄøÅÙ¹îÉþ¤Ç¤­¤ë¤À¤í¤¦¤¬)¡£ +ºÇ¸å¤Ë¤â¤¦°ì¤Ä¡¢Ê¸½ñ¤ò¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤«¤é (¥í¡¼¥«¥ë¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë +¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯) ưŪ¤Ë¥í¡¼¥É¤¹¤ë¿Í¡¹¤Ï¡¢ +¤Ê¤«¤Ê¤« file: ¥¹¥­¡¼¥à¤ò»È¤Ã¤Æ¤¯¤ì¤Ê¤¤¡£ +.\"O A future URI scheme may be added (e.g., "userdoc:") to permit +.\"O programs to include cross-references to more detailed documentation +.\"O without having to know the exact location of that documentation. +.\"O Alternatively, a future version of the file-system specification may +.\"O specify file locations sufficiently so that the file: scheme will +.\"O be able to locate documentation. +¾­Íè¤Ë¤Ï¿·¤¿¤Ê URI ¥¹¥­¡¼¥à (Î㤨¤Ð "userdoc:" ¤Î¤è¤¦¤Ê) ¤¬Äɲ䵤졢 +¤è¤ê¾Ü¤·¤¤Ê¸½ñ¤Ø¤Î¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹¤¬¡¢ +¤½¤Îʸ½ñ¤ÎÀµ³Î¤Ê¾ì½ê¤ò¥×¥í¥°¥é¥à¤¬ÃΤé¤Ê¤¯¤Æ¤â²Äǽ¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤¢¤ë¤¤¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àµ¬³Ê¤Î¾­Íè¤ÎÈÇ¤Ç +¥Õ¥¡¥¤¥ë¤Î¾ì½ê¤Î»ØÄê¤ò¤è¤ê¸·Ì©¤Ë¤·¤Æ¡¢ +file: ¥¹¥­¡¼¥à¤Ë¤è¤ëʸ½ñ¤Î°ÌÃÖ»ØÄ꤬²Äǽ¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +.\"O Many programs and file formats don't include a way to incorporate +.\"O or implement links using URIs. +¥×¥í¥°¥é¥à¤ä¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¿¤¯¤Ç¤Ï¡¢ +URI ¤ò»È¤Ã¤¿¥ê¥ó¥¯¤ò¼è¤ê¹þ¤ó¤À¤ê¼ÂÁõ¤·¤¿¤ê¤¹¤ëÊýË¡¤¬¤Ê¤¤¡£ +.PP +.\"O Many programs can't handle all of these different URI formats; there +.\"O should be a standard mechanism to load an arbitrary URI that automatically +.\"O detects the users' environment (e.g., text or graphics, +.\"O desktop environment, local user preferences, and currently executing +.\"O tools) and invokes the right tool for any URI. +¥×¥í¥°¥é¥à¤Î¿¤¯¤Ï¡¢¤³¤ì¤é¤Î URI ¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¤¹¤Ù¤Æ¤Ï°·¤¨¤Ê¤¤¡£ +¥æ¡¼¥¶¤Î´Ä¶­ (¥Æ¥­¥¹¥È¤«¥°¥é¥Õ¥£¥Ã¥¯¤«¡¢ +¥Ç¥¹¥¯¥È¥Ã¥×´Ä¶­¡¢¥í¡¼¥«¥ë¥æ¡¼¥¶¤Î¹¥¤ß¡¢ +¸½ºß¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¥Ä¡¼¥ë) ¤Ê¤É¤ò¼«Æ°Åª¤Ë¸¡ÃΤ·¤Æ¡¢ +Ǥ°Õ¤Î URI ¤ò¥í¡¼¥É¤·¡¢¤½¤Î URI ¤ËŬ¤·¤¿¥Ä¡¼¥ë¤òµ¯Æ°¤¹¤ë¤è¤¦¤Ê +ɸ½àŪ¤Ê»ÅÁȤߤ¬¤¢¤ë¤È¤¤¤¤¤Î¤À¤í¤¦¤¬¡£ +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\"O .\" David A. Wheeler (dwheeler@dwheeler.com) wrote this man page. +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï David A. Wheeler (dwheeler@ida.dwheeler.com) ¤¬½ñ¤¤¤¿¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR lynx (1), +.BR man2html (1), +.BR mailaddr (7), +.BR utf-8 (7), +.UR http://www.ietf.org/rfc/rfc2255.txt +IETF RFC\ 2255 +.UE diff --git a/draft/man7/utf-8.7 b/draft/man7/utf-8.7 new file mode 100644 index 00000000..6dd65ec2 --- /dev/null +++ b/draft/man7/utf-8.7 @@ -0,0 +1,495 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) Markus Kuhn, 1996, 2001 +.\" +.\" 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. +.\" +.\" 1995-11-26 Markus Kuhn +.\" First version written +.\" 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 +.SH ̾Á° +UTF-8 \- ASCII ¤È¸ß´¹À­¤Î¤¢¤ë¿¥Ð¥¤¥È Unicode ¤ÎÉä¹æ²½ +.\"O .SH DESCRIPTION +.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 ) +¤Ç¤Ï¡¢Ê¸»ú¤Ï 16 ¥Ó¥Ã¥È¡¦¥ï¡¼¥É (16 ¥Ó¥Ã¥Èʸ»ú¤ÎÎó) ¤Ç¹½À®¤µ¤ì¤ë¡£ +¤³¤ÎÎó¤Ë¤Ï¡¢ +\(aq\\0\(aq ¤ä \(aq/\(aq ¤Î¤è¤¦¤Ê (¥Õ¥¡¥¤¥ë̾¤ä C ¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î°ú¤­¿ô¤ÎÆâÉô¤Ç) +Æüì¤Ê°ÕÌ£¤ò»ý¤Ä 16 ¥Ó¥Ã¥Èʸ»ú¤¬´Þ¤Þ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +¤µ¤é¤Ë¡¢¤Û¤È¤ó¤É¤Î Unix ¥Ä¡¼¥ë¤Ï ASCII ¥Õ¥¡¥¤¥ë¤òÆþÎϤȤ·¤Æ´üÂÔ¤¹¤ë¤Î¤Ç¡¢ +ÂçÉý¤ÊÊѹ¹¤Ê¤·¤Ë¤Ï 16 ¥Ó¥Ã¥È¥ï¡¼¥É¤òʸ»ú¤È¤·¤ÆÆɤळ¤È¤¬¤Ç¤­¤Ê¤¤¡£ +¤³¤ì¤é¤ÎÍýͳ¤«¤é¡¢ +.B UCS-2 +¤Ï¥Õ¥¡¥¤¥ë̾¡¦¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¡¦´Ä¶­ÊÑ¿ô¤Ê¤É¤ËÍѤ¤¤ë¡¢³°ÉôÍѤΠ+.B Unicode +Éä¹æ¤È¤·¤Æ¤ÏÉÔŬÀڤǤ¢¤ë¡£ +Unicode ¤Î¥¹¡¼¥Ñ¡¼¥»¥Ã¥È¤Ç¤¢¤ë +.B "ISO 10646 Universal Character Set (UCS)" +¤Ï 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 +.SS À­¼Á +.\"O The +.\"O .B UTF-8 +.\"O encoding has the following nice properties: +.B UTF-8 +Éä¹æ²½¤Ï°Ê²¼¤Î¤è¤¦¤ÊÁÇÀ²¤·¤¤À­¼Á¤òÈ÷¤¨¤Æ¤¤¤ë: +.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 +* +.\"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 ¤Þ¤Ç¤ÎÈϰϤΥХ¤¥È¤Î¤ß¤ò´Þ¤à +¿¥Ð¥¤¥Èʸ»úÎó¤ËÉä¹æ²½¤µ¤ì¤ë¡£ +¤·¤¿¤¬¤Ã¤Æʸ»úÎó¤Ë +ASCII ¥Ð¥¤¥È¤¬´Þ¤Þ¤ì¤ë¤³¤È¤¬¤Ê¤¯¡¢\(aq\\0\(aq ¤ä \(aq/\(aq ¤ÎÌäÂê¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.TP +* +.\"O The lexicographic sorting order of +.\"O .B UCS-4 +.\"O strings is preserved. +.B UCS-4 +ʸ»úÎó¤Ç¤Ï¼­½ñŪ¥½¡¼¥È¤Î½ç½ø¤¬Êݤ¿¤ì¤ë¡£ +.TP +* +.\"O All possible 2^31 UCS codes can be encoded using +.\"O .BR UTF-8 . +2^31 ¥Ó¥Ã¥È¤Î¤¹¤Ù¤Æ¤Î UCS ¥³¡¼¥É ¤¬ +.B UTF-8 +¤ò»ÈÍѤ·¤ÆÉä¹æ²½¤Ç¤­¤ë¡£ +.TP +* +.\"O The bytes 0xfe and 0xff are never used in the +.\"O .B UTF-8 +.\"O encoding. +.B UTF-8 +Éä¹æ²½¤Ç¤Ï 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 +ʸ»ú¤Î¿¥Ð¥¤¥ÈÎó¤ÎºÇ½é¤Î¥Ð¥¤¥È¤Ï¡¢ +¾ï¤Ë 0xc0 ¤«¤é 0xfd ¤ÎÈϰϤÇɽ¸½¤µ¤ì¡¢ +¤½¤Îʸ»ú¤¬²¿¥Ð¥¤¥È¤Ç¹½À®¤µ¤ì¤Æ¤¤¤ë¤«¤ò¼¨¤¹¡£ +¿¥Ð¥¤¥ÈÎó¤Î»Ä¤ê¤ÎÉôʬ¤Î¥Ð¥¤¥È¤Ï¡¢¤½¤ì¤¾¤ì 0x80 ¤«¤é 0xbf ¤ÎÈϰϤˤ¢¤ë¡£ +¤³¤ì¤Ë¤è¤êƱ´ü¤¬Íưפˤʤꡢ¥¹¥Æ¡¼¥È¥ì¥¹¤ÊÉä¹æ²½¤¬²Äǽ¤Ë¤Ê¤ê¡¢ +¥Ð¥¤¥È¤Îʶ¼º¤ËÂФ·¤Æ·ø¸Ç¤Ë¤Ê¤ë¡£ +.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 +.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 +0x00000000 \- 0x0000007F: +.RI 0 xxxxxxx +.TP +0x00000080 \- 0x000007FF: +.RI 110 xxxxx +.RI 10 xxxxxx +.TP +0x00000800 \- 0x0000FFFF: +.RI 1110 xxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.TP +0x00010000 \- 0x001FFFFF: +.RI 11110 xxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.TP +0x00200000 \- 0x03FFFFFF: +.RI 111110 xx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.TP +0x04000000 \- 0x7FFFFFFF: +.RI 1111110 x +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.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 ¿Ê¿ô¤Çɽ¤ï¤·¤¿Ê¸»ú¥³¡¼¥É¤Î¥Ó¥Ã¥ÈÉôʬ¤¬Âбþ¤¹¤ë¡£ +¤½¤Îʸ»ú¤òɽ¸½¤¹¤ë¤Î¤ËºÇ¤âû¤¤¥Ð¥¤¥ÈÎó¤Î¤ß¤¬»ÈÍѤǤ­¤ë¡£ +.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 +.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 +.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 +.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 +¥í¥±¡¼¥ë¤òÁªÂò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.RS +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 +»ÈÍѤµ¤ì¤Æ¤¤¤ëʸ»úÉä¹æ²½¤òʬ¤«¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥½¥Õ¥È¥¦¥§¥¢¤Ï¡¢ +°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¾ï¤Ë¥í¥±¡¼¥ë¤òÀßÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.RS +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 +.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 +¤È¤¤¤Ã¤¿¥·¥ó¥°¥ë¥Ð¥¤¥È¤ÎÉä¹æ²½¤¬½¬´·¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥×¥í¥°¥é¥Þ¡¼¤Ï¡¢ +¤³¤ì¤Þ¤Ç¤Î 2 ¤Ä¤Î²¾Ä꤬ +.B UTF-8 +¥í¥±¡¼¥ë¤Ë¤ª¤¤¤Æ¤ÏºÇÁáÍ­¸ú¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¤³¤È¤òÃΤäƤª¤¯¤Ù¤­¤À¡£ +.\"O Firstly, a single byte does not necessarily correspond any +.\"O more to a single character. +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 ʸ»ú½ÐÎϤ·¤¿¸å¤Ç +¥«¡¼¥½¥ë¤òɬ¤º¤·¤â 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) +¤È¤¤¤Ã¤¿¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.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%@") ¤Ç¤¢¤ë¡£ +(G0 ¥»¥Ã¥È¤È G1 ¥»¥Ã¥È¤òÀÚÂؤ¨¤ë¤È¤¤¤Ã¤¿) +¤½¤Î¾¤Î 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 +.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 +¤ÎÀ¸À®¼Ô¤Ï¤Ç¤­¤ë¤À¤±Ã»¤¤·Á¼°¤òÍѤ¤¤ë¤è¤¦Í׵ᤷ¤Æ¤¤¤ë¡£ +Î㤨¤Ð¡¢ÀèƬ¥Ð¥¤¥È¤¬ 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 +¤Ç¤Ï¡¢µ¬³Ê¤Ë½àµò¤¹¤ë¥×¥í¥°¥é¥à¤Ï +ºÇû¤Îɽ¸½·Á¼°¤Ç¤Ï¤Ê¤¤ÆþÎϤò¼õ¤±ÉÕ¤±¤Ê¤¤¡¢¤È¤¤¤¦Í×µá»ö¹à¤¬Äɲ䵤줿¡£ +¤³¤ì¤Ï¥»¥­¥å¥ê¥Æ¥£¾å¤ÎÍýͳ¤Ë¤è¤ë¡£ +¥æ¡¼¥¶¡¼ÆþÎϤ¬¥»¥­¥å¥ê¥Æ¥£¾å¤Î´í¸±¤ËÂФ·¥Á¥§¥Ã¥¯¤µ¤ì¤ë¾ì¹ç¡¢ +¥×¥í¥°¥é¥à¤Ï +.B ASCII +ÈǤΠ"/../" ¤ä ";" ¤ä "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 Ãø¼Ô +.\" Markus Kuhn +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR nl_langinfo (3), +.BR setlocale (3), +.BR charsets (7), +.BR unicode (7) diff --git a/draft/man7/x25.7 b/draft/man7/x25.7 new file mode 100644 index 00000000..d6226320 --- /dev/null +++ b/draft/man7/x25.7 @@ -0,0 +1,206 @@ +.\" This man page is Copyright (C) 1998 Heiner Eisen. +.\" 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. +.\" $Id: x25.7,v 1.4 1999/05/18 10:35:12 freitag Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated Mon 6 Dec 1999 by NAKANO Takeo +.\" +.TH X25 7 2008-08-08 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O x25, AF_X25 \- ITU-T X.25 / ISO-8208 protocol interface. +.SH ̾Á° +x25, AF_X25 \- ITU-T X.25 / ISO-8208 ¥×¥í¥È¥³¥ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.B x25_socket = socket(AF_X25, SOCK_SEQPACKET, 0); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O X25 sockets provide an interface to the X.25 packet layer protocol. +.\"O This allows applications to +.\"O communicate over a public X.25 data network as standardized by +.\"O International Telecommunication Union's recommendation X.25 +.\"O (X.25 DTE-DCE mode). +.\"O X25 sockets can also be used for communication +.\"O without an intermediate X.25 network (X.25 DTE-DTE mode) as described +.\"O in ISO-8208. +X25 ¥½¥±¥Ã¥È¤Ï X.25 ¥Ñ¥±¥Ã¥ÈÁØ¥×¥í¥È¥³¥ë¤ËÂФ¹¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥Ñ¥Ö¥ê¥Ã¥¯¤Ê X.25 ¥Ç¡¼¥¿¥Í¥Ã¥È¥ï¡¼¥¯¤Ç +ÄÌ¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ X.25 ¤Ï +International Telecommunication Union's recommendation X.25 +(X.25 DTE-DCE mode) ¤Çɸ½à²½¤µ¤ì¤Æ¤¤¤ë¡£ +X25 ¥½¥±¥Ã¥È¤Ï¡¢Ãæ´ÖÁؤΤʤ¤ X.25 ¥Í¥Ã¥È¥ï¡¼¥¯ (X.25 DTE-DTE mode) +¤Ç¤ÎÄÌ¿®¤Ë¤âÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +DTE-DTE ¥â¡¼¥É¤Ï ISO-8208 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O Message boundaries are preserved \(em a +.\"O .BR read (2) +.\"O from a socket will +.\"O retrieve the same chunk of data as output with the corresponding +.\"O .BR write (2) +.\"O to the peer socket. +.\"O When necessary, the kernel takes care +.\"O of segmenting and reassembling long messages by means of +.\"O the X.25 M-bit. +.\"O There is no hard-coded upper limit for the +.\"O message size. +.\"O However, reassembling of a long message might fail if +.\"O there is a temporary lack of system resources or when other constraints +.\"O (such as socket memory or buffer size limits) become effective. +.\"O If that +.\"O occurs, the X.25 connection will be reset. +¥á¥Ã¥»¡¼¥¸¶­³¦¤ÏÊݸ¤µ¤ì¤ë¡£¥½¥±¥Ã¥È¤«¤é¤Î +.BR read (2) +¤Ï¡¢È¿ÂЦ¤Î¥½¥±¥Ã¥È¤«¤é¤ÎÂбþ¤¹¤ë +.BR write (2) +¤ÈƱ¤¸Â礭¤µ¤Î¥Ç¡¼¥¿¤ò¼õ¤±¼è¤ê¡¢½ÐÎϤ¹¤ë¡£ +ɬÍפ¬¤¢¤ë¾ì¹ç¤Ï¡¢¥«¡¼¥Í¥ë¤¬Ä¹¤¤¥á¥Ã¥»¡¼¥¸¤Î +ʬ³ä (segmenting) ¤ÈºÆ¹½À® (reassembling) ¤ò¹Ô¤¦¡£ +¤³¤ì¤Ë¤Ï X.25 ¤Î M ¥Ó¥Ã¥È¤¬ÍѤ¤¤é¤ì¤ë¡£ +¥á¥Ã¥»¡¼¥¸¥µ¥¤¥º¤Ë¤Ï¡¢¥Ï¡¼¥É¥³¡¼¥Ç¥£¥ó¥°¤µ¤ì¤¿¾å¸Â¤Ï¤Ê¤¤¡£ +¤·¤«¤·¡¢°ì»þŪ¤Ë¥·¥¹¥Æ¥à¥ê¥½¡¼¥¹¤¬Â­¤ê¤Ê¤«¤Ã¤¿¤ê¡¢ +¾¤ÎÀ©Ìó (¥½¥±¥Ã¥È¥á¥â¥ê¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥ºÀ©¸Â¤Ê¤É) ¤¬ +¸ú¤¤¤Æ¤·¤Þ¤¦¤È¡¢Ä¹¤¤¥á¥Ã¥»¡¼¥¸¤ÎºÆ¹½À®¤Ë¤Ï¼ºÇÔ¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î¾ì¹ç¡¢¤½¤Î X.25 Àܳ¤Ï¥ê¥»¥Ã¥È¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.\"O .SS Socket Addresses +.SS ¥½¥±¥Ã¥È¥¢¥É¥ì¥¹ +.\"O The +.\"O .B AF_X25 +.\"O socket address family uses the +.\"O .I struct sockaddr_x25 +.\"O for representing network addresses as defined in ITU-T +.\"O recommendation X.121. +.B AF_X25 +¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤òɽ¤¹¤¿¤á¤Ë +.I struct sockaddr_x25 +¤òÍѤ¤¤ë¡£¤³¤ì¤Ï ITU-T recommendation X.121 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.in +4n +.nf +struct sockaddr_x25 { + sa_family_t sx25_family; /* must be AF_X25 */ + x25_address sx25_addr; /* X.121 Address */ +}; +.fi +.in +.PP +.\"O .I sx25_addr +.\"O contains a char array +.\"O .I x25_addr[] +.\"O to be interpreted as a null-terminated string. +.\"O .I sx25_addr.x25_addr[] +.\"O consists of up to 15 (not counting the terminating 0) ASCII +.\"O characters forming the X.121 address. +.\"O Only the decimal digit characters from \(aq0\(aq to \(aq9\(aq are allowed. +.I sx25_addr +¤Ë¤Ï char ÇÛÎó +.I x25_addr[] +¤ò´Þ¤Þ¤ì¤ë¡£¤³¤ì¤Ï 0 ¤Ç½ªÃ¼¤¹¤ëʸ»úÎó¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +.I sx25_addr.x25_addr[] +¤Ï 15 ¸Ä¤Þ¤Ç¤Î ASCII ʸ»ú¤ò´Þ¤à¤³¤È¤¬¤Ç¤­ (½ªÃ¼¤Î 0 ¤Ï´Þ¤Þ¤Ê¤¤)¡¢ +¤³¤ì¤¬ X.121 ¥¢¥É¥ì¥¹¤ò¤Ê¤¹¡£ +10 ¿Ê¤Î¿ôʸ»ú¡¢\(aq0\(aq ¤«¤é \(aq9\(aq ¤Þ¤Ç¤À¤±¤¬µö¤µ¤ì¤ë¡£ +.\"O .SS Socket Options +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.\"O The following X.25-specific socket options can be set by using +.\"O .BR setsockopt (2) +.\"O and read with +.\"O .BR getsockopt (2) +.\"O with the +.\"O .I level +.\"O argument set to +.\"O .BR SOL_X25 . +°Ê²¼¤Î X.25 ÆÃÍ­¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.BR setsockopt (2) +¤ÇÀßÄê¤Ç¤­¡¢ +.BR getsockopt (2) +¤Ç¼èÆÀ¤Ç¤­¤ë¡£¤³¤Î¤È¤­ +.I level +°ú¤­¿ô¤Ë¤Ï +.B SOL_X25 +¤ò»ØÄꤹ¤ë¡£ +.TP +.B X25_QBITINCL +.\"O Controls whether the X.25 Q-bit (Qualified Data Bit) is accessible by the +.\"O user. +.\"O It expects an integer argument. +.\"O If set to 0 (default), +.\"O the Q-bit is never set for outgoing packets and the Q-bit of incoming +.\"O packets is ignored. +.\"O If set to 1, an additional first byte is prepended +.\"O to each message read from or written to the socket. +.\"O For data read from +.\"O the socket, a 0 first byte indicates that the Q-bits of the corresponding +.\"O incoming data packets were not set. +.\"O A first byte with value 1 indicates +.\"O that the Q-bit of the corresponding incoming data packets was set. +.\"O If the first byte of the data written to the socket is 1 the Q-bit of the +.\"O corresponding outgoing data packets will be set. +.\"O If the first byte is 0 +.\"O the Q-bit will not be set. +X.25 ¤Î Q ¥Ó¥Ã¥È (Qualified ¥Ç¡¼¥¿¥Ó¥Ã¥È) ¤Ë¥æ¡¼¥¶¡¼¤¬¥¢¥¯¥»¥¹ +¤Ç¤­¤ë¤«¤É¤¦¤«¤ò¥³¥ó¥È¥í¡¼¥ë¤¹¤ë¡£À°¿ô¤Î°ú¿ô¤ò¼è¤ë¡£ +0 ¤Ë¥»¥Ã¥È¤¹¤ë¤È¡¢ Q ¥Ó¥Ã¥È¤Ïȯ¿®¥Ñ¥±¥Ã¥È¤Ë¤Ï·è¤·¤Æ¥»¥Ã¥È¤µ¤ì¤º¡¢ +¼õ¿®¥Ñ¥±¥Ã¥È¤Ç¤Ï̵»ë¤µ¤ì¤ë (¥Ç¥Õ¥©¥ë¥È)¡£ +1 ¤Ë¥»¥Ã¥È¤¹¤ë¤È¡¢¥½¥±¥Ã¥È¤«¤éÆɤࡢ¤¢¤ë¤¤¤Ï¥½¥±¥Ã¥È¤ËÁ÷¤ë +¥á¥Ã¥»¡¼¥¸¤½¤ì¤¾¤ì¤ËÀèƬ¥Ð¥¤¥È¤¬Á°ÃÖ¤µ¤ì¤ë¡£ +¥½¥±¥Ã¥È¤«¤éÆɤó¤À¥Ç¡¼¥¿¤Ç¤Ï¡¢ÀèƬ¥Ð¥¤¥È¤¬ 0 ¤À¤È¡¢ +¤³¤ÎÅþÃå¥Ç¡¼¥¿¥Ñ¥±¥Ã¥È¤ËÂбþ¤¹¤ë Q ¥Ó¥Ã¥È¤Ï¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤³¤È¤Ë¤Ê¤ë¡£ +ÀèƬ¥Ð¥¤¥È¤¬ 1 ¤À¤È¡¢ÅþÃå¥Ç¡¼¥¿¥Ñ¥±¥Ã¥È¤Î +Q ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¤³¤È¤Ë¤Ê¤ë¡£ +¥½¥±¥Ã¥È¤Ë½ñ¤­¹þ¤à¥Ç¡¼¥¿¤ÎÀèƬ¥Ð¥¤¥È¤¬ 1 ¤À¤È¡¢ +¤½¤Îȯ¿®¥Ñ¥±¥Ã¥È¤Î Q ¥Ó¥Ã¥È¤ò¥»¥Ã¥È¤¹¤ë¡£ +0 ¤À¤È¡¢ Q ¥Ó¥Ã¥È¤ò¥»¥Ã¥È¤·¤Ê¤¤¡£ +.\"O .SH VERSIONS +.SH ¥Ð¡¼¥¸¥ç¥ó +.\"O The AF_X25 protocol family is a new feature of Linux 2.2. +AF_X25 ¥×¥í¥È¥³¥ë¥Õ¥¡¥ß¥ê¤Ï Linux 2.2 ¤Î¿·µ¡Ç½¤Ç¤¢¤ë¡£ +.\"O .SH BUGS +.SH ¥Ð¥° +.\"O Plenty, as the X.25 PLP implementation is +.\"O .BR CONFIG_EXPERIMENTAL . +X.25 PLP ¼ÂÁõ¤Ï +.B CONFIG_EXPERIMENTAL +¤Ê¤Î¤Ç¡¢¤¿¤¯¤µ¤ó¤¢¤ë¤À¤í¤¦¡£ +.PP +.\"O This man page is incomplete. +¤³¤Î man ¥Ú¡¼¥¸¤Ï´°À®¤·¤Æ¤¤¤Ê¤¤¡£ +.PP +.\"O There is no dedicated application programmer's header file yet; +.\"O you need to include the kernel header file +.\"O .IR . +.\"O .B CONFIG_EXPERIMENTAL +.\"O might also imply that future versions of the +.\"O interface are not binary compatible. +¤Þ¤À¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥Þ¡¼ÍѤΥإåÀ¥Õ¥¡¥¤¥ë¤¬¤Ê¤¤¡£ +¥«¡¼¥Í¥ë¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B CONFIG_EXPERIMENTAL +¤Ê¤Î¤Ç¡¢¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤Ï +¥Ð¥¤¥Ê¥ê¸ß´¹À­¤¬¼º¤ï¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +.\"O X.25 N-Reset events are not propagated to the user process yet. +.\"O Thus, +.\"O if a reset occurred, data might be lost without notice. +X.25 N-Reset ¥¤¥Ù¥ó¥È¤Ï¡¢¤Þ¤À¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤ËÅÁÇŤ·¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¥ê¥»¥Ã¥È¤¬µ¯¤³¤ë¤È¡¢¥Ç¡¼¥¿¤ÏÄÌÃÎ̵¤·¤Ë¼º¤ï¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR socket (2), +.BR socket (7) +.PP +Jonathan Simon Naylor: +.\"O \(lqThe Re-Analysis and Re-Implementation of X.25.\(rq +\(lqX.25 ¤ÎºÆʬÀϤȺƼÂÁõ\(rq +.\"O The URL is +.RS +URL ¤Ï +.I ftp://ftp.pspt.fi/pub/ham/linux/ax25/x25doc.tgz +.RE diff --git a/draft/man8/intro.8 b/draft/man8/intro.8 new file mode 100644 index 00000000..969a9ceb --- /dev/null +++ b/draft/man8/intro.8 @@ -0,0 +1,67 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" and Copyright (C) 2007 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 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 +.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)¡¢ +¥Ï¡¼¥É¥¦¥§¥¢´ØÏ¢¤Î¥³¥Þ¥ó¥É¤È¤¤¤Ã¤¿¡¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ë¤è¤Ã¤Æ¤Î¤ß +»ÈÍѤµ¤ì¤ë/¤Ç¤­¤ë¥³¥Þ¥ó¥É¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤ë¡£ + +.\"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 +.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 new file mode 100644 index 00000000..d92e6966 --- /dev/null +++ b/draft/man8/ld.so.8 @@ -0,0 +1,671 @@ +.\" 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 new file mode 100644 index 00000000..66af3ed3 --- /dev/null +++ b/draft/man8/ldconfig.8 @@ -0,0 +1,279 @@ +.\" -*- nroff -*- +.\" Copyright 1999 SuSE GmbH Nuernberg, Germany +.\" Author: Thorsten Kukuk +.\" +.\" 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; see the file COPYING. If not, +.\" write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +.\" Boston, MA 02111-1307, USA. +.\" +.\" 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 +.\" +.\"WORD: verbose mode ¾ÜºÙɽ¼¨¥â¡¼¥É +.\"WORD: quiet mode ¥á¥Ã¥»¡¼¥¸ÍÞÀ©¥â¡¼¥É +.\" +.TH LDCONFIG 8 2009-04-15 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.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 \ ... +.PD 0 +.PP +.PD +.B /sbin/ldconfig +.B \-l +[ +.B \-v +] +.IR library \ ... +.PD 0 +.PP +.PD +.B /sbin/ldconfig +.B \-p +.\"O .SH DESCRIPTION +.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 +¤Ï½èÍý¤¹¤ë¥é¥¤¥Ö¥é¥ê¤Î¥Ø¥Ã¥ÀÉôʬ¤È¥Õ¥¡¥¤¥ë̾¤ò¥Á¥§¥Ã¥¯¤·¡¢ +¤É¤Î¥Ð¡¼¥¸¥ç¥ó¤ËÂФ·¤Æ¥ê¥ó¥¯¤ò¹¹¿·¤¹¤Ù¤­¤«¤òȽÃǤ¹¤ë¡£ +.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 ¤ò¤Ä¤«¤Ã¤Æ) ÌÀ¼¨¤·¤Æ¤ª¤¯¤ÈÎɤ¤¡£ +.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 +.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 +.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 +.SH ¥Õ¥¡¥¤¥ë +.PD 0 +.TP 20 +.I /lib/ld.so +.\"O run-time linker/loader +¼Â¹Ô»þ¥ê¥ó¥«/¥í¡¼¥À¡¼¡£ +.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 +¤Ë¤¢¤ë¥é¥¤¥Ö¥é¥ê¤Î½ç½øÉÕ¤­¥ê¥¹¥È¡£ +.PD +.\"O .SH SEE ALSO +.SH ´ØÏ¢¹àÌÜ +.BR ldd (1), +.BR ld.so (8) diff --git a/draft/man8/nscd.8 b/draft/man8/nscd.8 new file mode 100644 index 00000000..cd78070e --- /dev/null +++ b/draft/man8/nscd.8 @@ -0,0 +1,153 @@ +.\" -*- nroff -*- +.\" Copyright 1999 SuSE GmbH Nuernberg, Germany +.\" Author: Thorsten Kukuk +.\" +.\" 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; see the file COPYING. If not, +.\" write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +.\" Boston, MA 02111-1307, USA. +.\" +.\" 2008-12-05 Petr Baudis +.\" Rewrite the NOTES section to reflect modern reality +.\" +.\" Japanese Version Copyright (c) 2001, 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated Fri Jun 8 23:20:57 JST 2001 +.\" by Yuichi SATO +.\" Updated & Modified Sat Jan 22 14:11:51 JST 2005 +.\" by Yuichi SATO +.\" Updated 2009-03-05 by Kentaro Shirakata +.\" +.TH NSCD 8 2008-12-05 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O /usr/sbin/nscd \- name service cache daemon +/usr/sbin/nscd \- ¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥­¥ã¥Ã¥·¥å¥Ç¡¼¥â¥ó +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Nscd is a daemon that provides a cache for the most common name service +.\"O requests. +.\"O The default configuration file, +.\"O .IR /etc/nscd.conf , +.\"O determines the behavior of the cache daemon. +.\"O See +.\"O .BR nscd.conf (5). +nscd ¤Ï°ìÈÌŪ¤Ê¥Í¡¼¥à¥µ¡¼¥Ó¥¹¤ËɬÍפÊ¿¤¯¤Î¤â¤Î¤ò +¥­¥ã¥Ã¥·¥å¤È¤·¤ÆÄ󶡤¹¤ë¥Ç¡¼¥â¥ó¤Ç¤¢¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¥Õ¥¡¥¤¥ë +.I /etc/nscd.conf +¤Ç¥­¥ã¥Ã¥·¥å¥Ç¡¼¥â¥ó¤ÎÆ°ºî¤ò·èÄꤹ¤ë¡£ +.BR nscd.conf (5) +¤ò¸«¤è¡£ + +.\"O Nscd provides caching for accesses of the +.\"O .BR passwd (5), +.\"O .BR group (5), +.\"O and +.\"O .BR hosts (5) +.\"O databases through standard libc interfaces, such as +.\"O .BR getpwnam (3), +.\"O .BR getpwuid (3), +.\"O .BR getgrnam (3), +.\"O .BR getgrgid (3), +.\"O .BR gethostbyname (3), +.\"O and others. +nscd ¤Ï +.BR passwd (5), +.BR group (5), +.BR hosts (5) +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¤Î¥­¥ã¥Ã¥·¥å¤ò +.BR getpwnam (3), +.BR getpwuid (3), +.BR getgrnam (3), +.BR getgrgid (3), +.BR gethostbyname (3) +¤Ê¤É¤Îɸ½à libc ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ̤·¤ÆÄ󶡤¹¤ë¡£ + +.\"O There are two caches for each database: +.\"O a positive one for items found, and a negative one +.\"O for items not found. +.\"O Each cache has a separate TTL (time-to-live) +.\"O period for its data. +.\"O Note that the shadow file is specifically not cached. +.\"O .BR getspnam (3) +.\"O calls remain uncached as a result. +³Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ï 2 ¤Ä¤Î¥­¥ã¥Ã¥·¥å¤¬¤¢¤ë¡£ +¹ÎÄêŪ (positive) ¤Ê¥­¥ã¥Ã¥·¥å¤Ï¸«¤Ä¤«¤Ã¤¿¥¢¥¤¥Æ¥à¤ò¥­¥ã¥Ã¥·¥å¤·¡¢ +ÈÝÄêŪ (negative) ¤Ê¥­¥ã¥Ã¥·¥å¤Ï¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¥¢¥¤¥Æ¥à¤ò¥­¥ã¥Ã¥·¥å¤¹¤ë¡£ +³Æ¥­¥ã¥Ã¥·¥å¤Ï¥Ç¡¼¥¿¤Î TTL (time-to-live, À¸Â¸»þ´Ö) ¤ò¸ÄÊ̤˻ý¤Ã¤Æ¤¤¤ë¡£ +ÆÃÎã¤È¤·¤Æ shadow ¥Õ¥¡¥¤¥ë¤Ï¥­¥ã¥Ã¥·¥å¤µ¤ì¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.BR getspnam (3) +¤ò¸Æ¤Ó½Ð¤·¤Æ¤â·ë²Ì¤È¤·¤Æ¥­¥ã¥Ã¥·¥å¤µ¤ì¤Ê¤¤¤Þ¤Þ¤Ë¤Ê¤ë¡£ +.\"O .SH OPTIONS +.SH ¥ª¥×¥·¥ç¥ó +.TP +.B "\-\-help" +.\"O will give you a list with all options and what they do. +Á´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤È¤½¤ÎÆ°ºî¤ò¥ê¥¹¥È¤·¤Æɽ¼¨¤¹¤ë¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O The daemon will try to watch for changes in configuration files +.\"O appropriate for each database (e.g. +.\"O .I /etc/passwd +.\"O for the +.\"O .I passwd +.\"O database or +.\"O .I /etc/hosts +.\"O and +.\"O .I /etc/resolv.conf +.\"O for the +.\"O .I hosts +.\"O database), and flush the cache when these are changed. +¥Ç¡¼¥â¥ó¤Ï( +.I passwd +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ä¤¤¤Æ¤Ï +.IR /etc/passwd ¡¢ +.I hosts +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ä¤¤¤Æ¤Ï +.I /etc/hosts +¤È +.I /etc/resolv.conf +¤È¤¤¤¦¤è¤¦¤Ê)¤½¤ì¤¾¤ì¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¤¿¤á¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ò¸«Ä¥¤Ã¤Æ¡¢ +¤³¤ì¤é¤¬Êѹ¹¤µ¤ì¤ë¤È¥­¥ã¥Ã¥·¥å¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.\"O However, this will happen only after a short delay (unless the +.\"O .BR inotify (7) +.\"O mechanism is available and glibc 2.9 or later is available), +.\"O and this auto-detection does not cover configuration files +.\"O required by nonstandard NSS modules, if any are specified in +.\"O .IR /etc/nsswitch.conf . +¤·¤«¤·¡¢¤³¤ì¤Ï( +.BR inotify (7) +¤¬ÍøÍѲÄǽ¤Ç¡¢glibc 2.9 °Ê¹ß¤¬ÍøÍѲÄǽ¤Ê¾ì¹ç¤ò½ü¤¤¤Æ) +û¤¤ÃÙ±ä¤Î¸å¤Ëµ¯¤³¤ê¡¢¤Þ¤¿¤³¤Î¼«Æ°¸¡½Ð¤ÏÈóɸ½à NSS ¥â¥¸¥å¡¼¥ë¤¬ +.I /etc/nsswitch.conf +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¤½¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ë¤ÏÂбþ¤·¤Ê¤¤¡£ +.\"O In that case, you need to run the following command +.\"O after changing the configuration file of the database so that +.\"O .B nscd +.\"O invalidates its cache: +¤³¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤òÊѹ¹¤·¤¿¸å¡¢ +.B nscd +¤Î¥­¥ã¥Ã¥·¥å¤ò̵¸ú¤Ë¤¹¤ë¤¿¤á¤Ë°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ë: + + $ \fBnscd -i\fP \fI\fP +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR nscd.conf (5), +.BR nsswitch.conf (5) +.\"O .\" .SH AUTHOR +.\" .SH Ãø¼Ô +.\"O .\" .B nscd +.\"O .\" was written by Thorsten Kukuk and Ulrich Drepper. +.\" .B nscd +.\" ¤Ï Thorsten Kukuk ¤È Ulrich Drepper ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ diff --git a/draft/man8/sync.8 b/draft/man8/sync.8 new file mode 100644 index 00000000..030db742 --- /dev/null +++ b/draft/man8/sync.8 @@ -0,0 +1,156 @@ +.\" Reboot/halt and Linux information extracted from Rick Faith's original +.\" sync(8) manpage, dating back to the Linux 0.99 days. The Linux-specific +.\" information is attributed to Linus Torvalds +.\" Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" May be distributed under the GNU General Public License +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jun 13 14:04:28 JST 2000 +.\" by by Yuichi SATO +.\" +.\"WORD: synchronize Ʊ´ü +.\"WORD: superblock ¥¹¡¼¥Ñ¡¼¥Ö¥í¥Ã¥¯ +.\"WORD: halt Ää»ß +.\"WORD: processer ¥×¥í¥»¥Ã¥µ¡¼ +.\" +.TH SYNC 8 1998-11-01 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sync \- synchronize data on disk with memory +sync \- ¥Ç¥£¥¹¥¯¾å¤Î¥Ç¡¼¥¿¤ò¥á¥â¥ê¤ÈƱ´ü¤µ¤»¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B "sync [\-\-help] [\-\-version]" +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .B sync +.\"O writes any data buffered in memory out to disk. +.\"O This can include (but is not limited to) modified superblocks, +.\"O modified inodes, and delayed reads and writes. +.\"O This must be implemented by the kernel; +.\"O The +.\"O .B sync +.\"O program does nothing but exercise the +.\"O .BR sync (2) +.\"O system call. +.B sync +¤Ï¥á¥â¥ê¤Ë¥Ð¥Ã¥Õ¥¡¤µ¤ì¤¿¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¤ò¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤à¡£ +¤³¤ì¤Ë¤Ï¡¢Êѹ¹¤µ¤ì¤¿¥¹¡¼¥Ñ¡¼¥Ö¥í¥Ã¥¯¡¦Êѹ¹¤µ¤ì¤¿ inode¡¦ +Ãٱ䤷¤¿Æɤ߽ñ¤­¤¬´Þ¤Þ¤ì¤ë (¾¤Ë¤â¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤)¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ë¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +¤Ê¤¼¤Ê¤é +.B sync +¥×¥í¥°¥é¥à¤Ï +.BR sync (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¹Ô»È¤¹¤ë¤À¤±¤À¤«¤é¤Ç¤¢¤ë¡£ +.PP +.\"O The kernel keeps data in memory to avoid doing (relatively slow) disk +.\"O reads and writes. +.\"O This improves performance, but if the computer +.\"O crashes, data may be lost or the filesystem corrupted as a result. +.\"O .B sync +.\"O ensures that everything in memory is written to disk. +¥«¡¼¥Í¥ë¤Ï (Èæ³ÓŪÃÙ¤¤) ¥Ç¥£¥¹¥¯¤ÎÆɤ߽ñ¤­¤òÈò¤±¤ë¤¿¤á¡¢ +¥Ç¡¼¥¿¤ò¥á¥â¥ê¤ËÊÝ»ý¤¹¤ë¡£ +¤³¤ì¤Ë¤è¤êÀ­Ç½¤Ï¸þ¾å¤¹¤ë¤¬¡¢¥³¥ó¥Ô¥å¡¼¥¿¤¬¥¯¥é¥Ã¥·¥å¤·¤¿¾ì¹ç¡¢ +·ë²Ì¤È¤·¤Æ¥Ç¡¼¥¿¤¬Â»¼º¤·¤¿¤ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬²õ¤ì¤¿¤ê¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.B sync +¤Ï¥á¥â¥ê¤Ë¤¢¤ëÆâÍƤ¹¤Ù¤Æ¤¬¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¤³¤È¤òÊݾڤ¹¤ë¡£ +.PP +.\"O .B sync +.\"O should be called before the processor is halted in an unusual manner +.\"O (e.g., before causing a kernel panic when debugging new kernel code). +.\"O In general, the processor should be halted using the +.\"O .BR shutdown (8) +.\"O or +.\"O .BR reboot (8) +.\"O or +.\"O .BR halt (8) +.\"O commands, which will attempt to put the system in a quiescent state +.\"O before calling +.\"O .BR sync (2). +.\"O (Various implementations of these commands exist; consult your +.\"O documentation; on some systems one should not call +.\"O .BR reboot (8) +.\"O and +.\"O .BR halt (8) +.\"O directly.) +(¿·¤·¤¤¥«¡¼¥Í¥ë¥³¡¼¥É¤ò¥Ç¥Ð¥Ã¥¯¤·¤Æ¤¤¤Æ¥«¡¼¥Í¥ë¥Ñ¥Ë¥Ã¥¯¤ò°ú¤­µ¯¤³¤¹Á°¤Ê¤É¤Î) +Ä̾ï¤È°Û¤Ê¤ëÊýË¡¤Ç¥×¥í¥»¥Ã¥µ¡¼¤òÄä»ß¤µ¤»¤ëÁ°¤Ë¤Ï¡¢ +.B sync +¤ò¸Æ¤Ó½Ð¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +°ìÈÌŪ¤Ë¤Ï +.BR sync (2) +¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë¡¢ +¥·¥¹¥Æ¥à¤òÀŻ߾õÂ֤ˤµ¤»¤ë +.BR shutdown (8), +.BR reboot (8), +.BR halt (8) +¤È¤¤¤Ã¤¿¥³¥Þ¥ó¥É¤ò»È¤Ã¤Æ¥×¥í¥»¥Ã¥µ¡¼¤òÄä»ß¤µ¤»¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +(¤³¤ì¤é¤Î¥³¥Þ¥ó¥É¤Ë¤Ï¤¤¤í¤¤¤í¤Ê¼ÂÁõ¤¬¤¢¤ë¤Î¤Ç¡¢ +¥É¥­¥å¥á¥ó¥È¤òÅö¤ë¤³¤È¡£ +.BR reboot (8), +.BR halt (8) +¤òľÀܸƤӽФ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¥·¥¹¥Æ¥à¤â¤¢¤ë¡£) +.\"O .SH "OPTIONS" +.SH ¥ª¥×¥·¥ç¥ó +.TP +.B "\-\-help" +.\"O Print a usage message on standard output and exit successfully. +ɸ½à½ÐÎϤ˻ÈÍÑÊýË¡¤Î¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¤ÆÀµ¾ï½ªÎ»¤¹¤ë¡£ +.TP +.B "\-\-version" +.\"O Print version information on standard output, then exit successfully. +ɸ½à½ÐÎϤ˥С¼¥¸¥ç¥ó¾ðÊó¤ò½ÐÎϤ·¤ÆÀµ¾ï½ªÎ»¤¹¤ë¡£ +.TP +.B "\-\-" +.\"O Terminate option list. +¥ª¥×¥·¥ç¥ó¥ê¥¹¥È¤ò½ªÎ»¤¹¤ë¡£ +.\"O .SH ENVIRONMENT +.SH ´Ä¶­ÊÑ¿ô +.\"O The variables \fBLANG\fP, \fBLC_ALL\fP, \fBLC_CTYPE\fP, +.\"O and \fBLC_MESSAGES\fP have the usual meaning. +ÊÑ¿ô \fBLANG\fP, \fBLC_ALL\fP, \fBLC_CTYPE\fP, \fBLC_MESSAGES\fP +¤ÏÄ̾ï¤Î°ÕÌ£¤ò»ý¤Ä¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.2. +.\"O .SH NOTES +.SH Ãí°Õ +.\"O On Linux, +.\"O .B sync +.\"O is only guaranteed to schedule the dirty blocks for writing; it can +.\"O actually take a short time before all the blocks are finally written. +.\"O The +.\"O .BR reboot (8) +.\"O and +.\"O .BR halt (8) +.\"O commands take this into account by sleeping for a few seconds after +.\"O calling +.\"O .BR sync (2). +Linux ¤Ç¤Ï¡¢ +.B sync +¤Ï (¤Þ¤À½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤Ê¤¤) ¥À¡¼¥Æ¥£¤Ê¥Ö¥í¥Ã¥¯¤Î½ñ¤­¹þ¤ß¤ò +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤¹¤ë¤³¤È¤Î¤ß¤òÊݾڤ¹¤ë¡£ +¤Ä¤Þ¤ê¡¢¤¹¤Ù¤Æ¤Î¥Ö¥í¥Ã¥¯¤Î½ñ¤­¹þ¤ß¤¬½ª¤ë¤Þ¤Ç¤Ë¡¢¼ÂºÝ¤Ë¤Ï¾¯¤·»þ´Ö¤¬¤«¤«¤ë¡£ +.BR reboot (8), +.BR halt (8) +¥³¥Þ¥ó¥É¤Ï +.BR sync (2) +¤ò¸Æ¤ó¤À¸å¤Ë¿ôÉô֥¹¥ê¡¼¥×¤¹¤ë¤³¤È¤Ç¡¢¤³¤ì¤ò¹Íθ¤ËÆþ¤ì¤Æ¤¤¤ë¡£ +.PP +.\"O This page describes +.\"O .B sync +.\"O as found in the file\%utils-4.0 package; +.\"O other versions may differ slightly. +¤³¤Î¥Ú¡¼¥¸¤Ç¤Ï file\%utils-4.0 ¥Ñ¥Ã¥±¡¼¥¸¤Ç¤Î +.B sync +¥³¥Þ¥ó¥É¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ +¤½¤Î¾¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¾¯¤·°ã¤¤¤¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sync (2), +.BR halt (8), +.BR reboot (8), +.BR update (8) diff --git a/draft/man8/tzselect.8 b/draft/man8/tzselect.8 new file mode 100644 index 00000000..657e1621 --- /dev/null +++ b/draft/man8/tzselect.8 @@ -0,0 +1,83 @@ +.\" 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 ¹ñÊÌ¥³¡¼¥É +.\" +.TH TZSELECT 8 2007-05-18 "" "Linux System Administration" +.\"O .SH NAME +.\"O tzselect \- select a timezone +.SH ̾Á° +tzselect \- ¥¿¥¤¥à¥¾¡¼¥ó¤òÁªÂò¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B tzselect +.\"O .SH DESCRIPTION +.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 +´Ä¶­ÊÑ¿ô¤ÎÃͤˤ¹¤ë¤ÈÎɤ¤¡£ +.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 +\fBAWK\fP +.\"O Name of a Posix-compliant +Posix ¸ß´¹¤Î +.I awk +.\"O program (default: +.\"O .BR awk ). +¥×¥í¥°¥é¥à (¥Ç¥Õ¥©¥ë¥È¤Ï +.BR awk )¡£ +.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 +.SH ¥Õ¥¡¥¤¥ë +.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 +\fBTZDIR\fP\fI/zone.tab\fP +.\"O Table of country codes, latitude and longitude, TZ values, and +.\"O descriptive comments. +¹ñÊÌ¥³¡¼¥É¡¢·ÐÅÙ¡¦°ÞÅÙ¡¢TZ ¤ÎÃÍ¡¢ÀâÌÀʸ¤«¤é¤Ê¤ëɽ¡£ +.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) +.\" @(#)tzselect.8 1.3 diff --git a/draft/man8/zdump.8 b/draft/man8/zdump.8 new file mode 100644 index 00000000..4b355783 --- /dev/null +++ b/draft/man8/zdump.8 @@ -0,0 +1,71 @@ +.\" 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 +.SH ̾Á° +zdump \- ¥¿¥¤¥à¥¾¡¼¥ó¤ò¥À¥ó¥×¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B zdump +[ +.B \-v +] [ +.B \-c +cutoffyear ] [ zonename ... ] +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .I Zdump +.\"O prints the current time in each +.\"O .I zonename +.\"O named on the command line. +.I zdump +¤Ï +¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç»ØÄꤷ¤¿ +.I zonename +¤½¤ì¤¾¤ì¤Ë¤ª¤±¤ë¸½ºß»þ¹ï¤òɽ¼¨¤¹¤ë¡£ +.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. +Í¿¤¨¤é¤ì¤¿Ç¯¤ÎºÇ½é¤Îº¢¤Ë¤ª¤±¤ë;·×¤Ê½ÐÎϤòÀÚ¤ê¼Î¤Æ¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR tzfile (5), +.BR zic (8) +.\" @(#)zdump.8 7.3 diff --git a/draft/man8/zic.8 b/draft/man8/zic.8 new file mode 100644 index 00000000..d27c146a --- /dev/null +++ b/draft/man8/zic.8 @@ -0,0 +1,658 @@ +.\" 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) ɸ½à (»þ¹ï) +.\" +.TH ZIC 8 2010-02-25 "" "Linux System Administration" +.\"O .SH NAME +.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 +.SH ÀâÌÀ +.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 \- +¤Î¾ì¹ç¤Ï¡¢É¸½àÆþÎϤ«¤éÆɤ߹þ¤à¡£ +.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 +¤ÏÆþÎϤ˰ʲ¼¤Î½ñ¼°¤Î¥ê¥ó¥¯¹Ô¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤Î¤è¤¦¤Ë¿¶¤ëÉñ¤¦¡£ +.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 +¤ÏÆþÎϤ˰ʲ¼¤Î½ñ¼°¤Î¥ê¥ó¥¯¹Ô¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤Î¤è¤¦¤Ë¿¶¤ëÉñ¤¦¡£ +.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 ¤Ç +ɾ²Á¤·¤Æ¤âƱ¤¸Ãͤˤʤë¤è¤¦¤ÊÈϰϤËÀ©¸Â¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È 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 +¤òÍѤ¤¤ë¡£ +.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) ¤Ç¤¢¤ë¡£ +.PP +.\"O A rule line has the form +¥ë¡¼¥ë¹Ô¤Î½ñ¼°¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +.nf +.ti +.5i +.ta \w'Rule\0\0'u +\w'NAME\0\0'u +\w'FROM\0\0'u +\w'1973\0\0'u +\w'TYPE\0\0'u +\w'Apr\0\0'u +\w'lastSun\0\0'u +\w'2:00\0\0'u +\w'SAVE\0\0'u +.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 +.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 +¤Ï°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æǯ¤Î¥¿¥¤¥×¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +.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: +¥ë¡¼¥ë¤¬¸úÎϤò»ý¤ÄÆü¤Î̾Á°¤ò»ØÄꤹ¤ë¡£ +°Ê²¼¤Î¤è¤¦¤Ê½ñ¼°¤òǧ¼±¤¹¤ë: +.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 ¤½¤Î·î¤ÎºÇ¸å¤Î·îÍËÆü +Sun>=8 Âè 8 Æü°Ê¹ß¤ÎºÇ½é¤ÎÆüÍËÆü +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: +¥ë¡¼¥ë¤¬¸úÎϤò»ý¤Ä°ìÆü¤Î¤¦¤Á¤Î»þ¹ï¤òÍ¿¤¨¤ë¡£ +°Ê²¼¤Î¤è¤¦¤Ê½ñ¼°¤òǧ¼±¤¹¤ë: +.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 »þ´Ö·Á¼°¤Î»þ´Ö (Àµ¸á°Ê¹ß) +1:28:14 »þ´Ö¡¦Ê¬¡¦ÉäǤÎɽµ­ +\- 0 ¤ÈƱ¤¸ +.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 +Í¿¤¨¤é¤ì¤¿»þ¹ï¤¬¥í¡¼¥«¥ë¤Ê +.q "ÊÉ»þ·× (wall clock)" +»þ¹ï¤Ç¤¢¤ë; +.I s +Í¿¤¨¤é¤ì¤¿»þ¹ï¤¬¥í¡¼¥«¥ë¤Ê +.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. +¤³¤Î¥ë¡¼¥ë¤¬¸úÎϤò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¥¿¥¤¥à¥¾¡¼¥óû½Ì·¿¤Î +.q "²ÄÊÑÉô (variable part) +¤òÍ¿¤¨¤ë (Î㤨¤Ð +.q EST +¤ä +.q EDT +¤Ë¤ª¤±¤ë +.q S +¤ä +.q D +¤Ê¤É)¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬ +.B \- +¤Ç¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +²ÄÊÑÉô¤Ï¸ºß¤·¤Ê¤¤¡£ +.PP +.\"O A zone line has the form +¥¾¡¼¥ó¹Ô¤Î½ñ¼°¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +.sp +.nf +.ti +.5i +.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 +.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 +¤òÍѤ¤¤Æ¡¢¤É¤³¤¬ +.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 ¥«¥é¥à¤ÈƱ¤¸½ñ¼°¤Ç»ØÄꤹ¤ë¡£ +¤³¤Î¸å¤Ë³¤¯¥«¥é¥à¤Ï¾Êά¤Ç¤­¤ë¡£ +¾Êά¤µ¤ì¤¿¥«¥é¥à¤ËÂФ·¤Æ¤Ï¡¢ +²ÄǽÀ­¤Î¤¢¤ë¤â¤Î¤Î¤¦¤ÁºÇ¤âÁᤤÃͤ¬¥Ç¥Õ¥©¥ë¥È¤ÇÍѤ¤¤é¤ì¤ë¡£ +.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 +¥Õ¥£¡¼¥ë¥É¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¡¢¤³¤Î¾ì¹ç¤Ï¤½¤Î¼¡¤Î¹Ô¤¬ +¤µ¤é¤Ê¤ë·Ñ³¹Ô¤Ë¤Ê¤ë¤³¤È¤È¤Ê¤ë¡£ +.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 +.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. +.PP +.\"O Except for continuation lines, +.\"O lines may appear in any order in the input. +.B LINK-FROM +¥Õ¥£¡¼¥ë¥É¤Ï¥¾¡¼¥ó¹Ô¤Î +.B NAME +¥Õ¥£¡¼¥ë¥É¤¬µ­½Ò¤µ¤ì¤ë¡£ +.B LINK-TO +¥Õ¥£¡¼¥ë¥É¤Ï¤½¤Î¥¾¡¼¥ó¤ÎÊÌ̾¤Ç¤¢¤ë¡£ +.PP +.\"O Lines in the file that describes leap seconds have the following form: +¥Õ¥¡¥¤¥ëÃæ¤Ç±¼Éäòµ­½Ò¤¹¤ë¹Ô¤Ï°Ê²¼¤Î¤è¤¦¤Ê½ñ¼°¤ò»ý¤Ä¡£ +.nf +.ti +.5i +.ta \w'Leap\0\0'u +\w'YEAR\0\0'u +\w'MONTH\0\0'u +\w'DAY\0\0'u +\w'HH:MM:SS\0\0'u +\w'CORR\0\0'u +.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. +.\" See Terry J Quinn, The BIPM and the accurate measure of time, +.\" Proc IEEE 79, 7 (July 1991), 894-905. +.\" or +.\" .q ++ +.\" if two seconds were added +.\" 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 ¤Ê¤é¤Ð +.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" +.SH ´ØÏ¢¹àÌÜ +.BR tzfile (5), +.BR zdump (8) +.\" @(#)zic.8 7.19 diff --git a/obsolete/man1/chgrp.1 b/obsolete/man1/chgrp.1 new file mode 100644 index 00000000..daca35a4 --- /dev/null +++ b/obsolete/man1/chgrp.1 @@ -0,0 +1,91 @@ +.\" Copyright Andries Brouwer, Ragnar Hojland Espinosa and A. Wik, 1998. +.\" +.\" This file may be copied under the conditions described +.\" in the LDP GENERAL PUBLIC LICENSE, Version 1, September 1998 +.\" that should have been distributed together with this file. +.\" +.\" Translated Thu Jan 13 22:39:57 JST 2000 +.\" by FUJIWARA Teruyoshi +.\" +.TH CHGRP 1 "November 1998" "GNU fileutils 4.0" +.SH ̾Á° +chgrp \- ¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×½êÍ­¸¢¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.BI "chgrp [" options "] " "group file..." +.sp +POSIX ÈǤΥª¥×¥·¥ç¥ó: +.B [\-R] +.sp +GNU ÈǤΥª¥×¥·¥ç¥ó(û¤¤·Á¼°): +.B [\-cfvR] +.BI [\-\-reference= rfile ] +.B "[\-\-help] [\-\-version] [\-\-]" +.SH ÀâÌÀ +.B chgrp +¤Ï»ØÄꤵ¤ì¤¿³Æ +.SH "POSIX ÈǤΥª¥×¥·¥ç¥ó" +.I file +¤Î¥°¥ë¡¼¥×½êÍ­¸¢¤ò +.I group +¤ËÊѹ¹¤¹¤ë¡£ +.I group +¤Ë»ØÄꤹ¤ë¤Î¤Ï¡¢¥°¥ë¡¼¥×̾¤Ç¤â¥°¥ë¡¼¥×¤Î¿ôÃÍ ID ¤Î¤É¤Á¤é¤Ç¤â¤è¤¤¡£ +.TP +.B \-R +¥Ç¥£¥ì¥¯¥È¥ê¤È¤½¤ÎÃæ¤Î¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×½êÍ­¸¢¤òºÆµ¢Åª¤ËÊѹ¹¤¹¤ë¡£ +(¥¨¥é¡¼¤¬µ¯¤­¤¿¾ì¹ç¤â¡¢»ß¤Þ¤é¤º¤ËÆ°ºî¤·Â³¤±¤ë¡£) +.SH "GNU ÈǤΥª¥×¥·¥ç¥ó" +.TP +.B "\-c, \-\-changes" +¥°¥ë¡¼¥×¤ò¼ÂºÝ¤ËÊѹ¹¤¹¤ë³Æ +.I file +¤ËÂФ¹¤ëÆ°ºî¤ò¾Ü¤·¤¯É½¼¨¤¹¤ë¡£ +.TP +.B "\-f, \-\-silent, \-\-quiet" +¥°¥ë¡¼¥×¤òÊѹ¹¤Ç¤­¤Ê¤«¤Ã¤¿¥Õ¥¡¥¤¥ë¤Ë´Ø¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Ê¤¤¡£ +.TP +.B "\-h, \-\-no\-dereference" +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬»Ø¤·¤Æ¤¤¤ëÀè¤Ç¤Ï¤Ê¤¯¡¢¥ê¥ó¥¯¤½¤Î¤â¤Î¤ËÂФ·¤ÆÆ°ºî¤¹ +¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»È¤¨¤ë¤Î¤Ï¡¢ +.B lchown +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +.TP +.B "\-v, \-\-verbose" +³Æ +.IR file +¤ËÂФ·¤Æ¹Ô¤Ã¤¿Æ°ºî¤È¹Ô¤ï¤Ê¤«¤Ã¤¿Æ°ºî¤ò¾Ü¤·¤¯É½¼¨¤¹¤ë¡£ +.TP +.B "\-R, \-\-recursive" +¥Ç¥£¥ì¥¯¥È¥ê¤È¤½¤ÎÃæ¤Î¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×½êÍ­¸¢¤òºÆµ¢Åª¤ËÊѹ¹¤¹¤ë¡£ +.TP +.BI "\-\-reference=" "rfile" +(fileutils 4.0 ¤Î¿·¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£) +.I file +¤Î¥°¥ë¡¼¥×½êÍ­¸¢¤ò +.IR rfile +¤Î¥°¥ë¡¼¥×½êÍ­¸¢¤ÈƱ¤¸¤Ë¤¹¤ë¡£ +.SH "GNU ¤Îɸ½à¥ª¥×¥·¥ç¥ó" +.TP +.B "\-\-help" +»ÈÍÑÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤òɸ½à½ÐÎϤËɽ¼¨¤·¤ÆÀµ¾ï½ªÎ»¤¹¤ë¡£ +.TP +.B "\-\-version" +¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɸ½à½ÐÎϤËɽ¼¨¤·¤ÆÀµ¾ï½ªÎ»¤¹¤ë¡£ +.TP +.B "\-\-" +¥ª¥×¥·¥ç¥ó¥ê¥¹¥È¤ÎËöÈø¤ò¼¨¤¹¡£ +.SH ´Ä¶­ÊÑ¿ô +´Ä¶­ÊÑ¿ô LANG, LC_ALL, LC_CTYPEm, LC_MESSAGES ¤ÏÄ̾ïÄ̤ê¤Î°ÕÌ£¤ò»ý¤Ä¡£ +.SH ½àµò +POSIX 1003.2 ¤Ç¤Ï¡¢\-R ¥ª¥×¥·¥ç¥ó¤À¤±¤¬É¬ÍפȤµ¤ì¤Æ¤¤¤ë¡£Â¾¤Î +¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È°Ü¿¢À­¤¬°­¤¯¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH Ãí°Õ +¤³¤Î¥Ú¡¼¥¸¤Ï fileutils-4.0 ¥Ñ¥Ã¥±¡¼¥¸¤ËÆþ¤Ã¤Æ¤¤¤ë +.B chgrp +¥³¥Þ¥ó¥É¤ò²òÀ⤷¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¾¤Î ¥Ð¡¼¥¸¥ç¥ó¤ÎÆ°ºî¤Ï¾¯¤·°ã¤¦¤«¤â¤·¤ì¤Ê¤¤¡£ +Äɲá¦ÄûÀµ¤Ï aeb@cwi.nl °¸¤ËÁ÷¤ë¤³¤È¡£ +¥×¥í¥°¥é¥à¤ËÂФ¹¤ë¥Ð¥°Êó¹ð¤Ï fileutils-bugs@gnu.ai.mit.edu °¸¤ËÁ÷¤ë¤³ +¤È¡£ + + diff --git a/obsolete/man1/dircolors.1 b/obsolete/man1/dircolors.1 new file mode 100644 index 00000000..bba2231c --- /dev/null +++ b/obsolete/man1/dircolors.1 @@ -0,0 +1,131 @@ +.\" Copyright Andries Brouwer, Ragnar Hojland Espinosa and A. Wik, 1998. +.\" +.\" Japanese Version Copyright (c) 1998 Kanda Mitsuru +.\" all rights reserved. +.\" Translated Fri Sep 11 21:02:34 JST 1998 +.\" by Kanda Mitsuru +.\" Updated Thu Aug 31 21:00:12 JST 2000 +.\" by Kentaro Shirakata +.\" +.\" This file may be copied under the conditions described +.\" in the LDP GENERAL PUBLIC LICENSE, Version 1, September 1998 +.\" that should have been distributed together with this file. +.\" +.\" Modified, James Sneeringer , Wed Sep 22 23:21:19 1999 +.\" +.TH DIRCOLORS 1 "November 1998" "GNU fileutils 4.0" +.SH ̾Á° +dircolors \- 'ls' ¤Î¤¿¤á¤Î¿§ÉÕ¤±¤ÎÀßÄê +.SH ½ñ¼° +.B dircolors +.B [\-b] [\-\-sh] [\-\-bourne\-shell] +.B [\-c] [\-\-csh] [\-\-c\-shell] +.B [\-p] [\-\-print\-database] +.B [\-\-help] [\-\-version] +.BI [ FILE ] +.SH ÀâÌÀ +.B dircolors +¤Ï +.B ls +(µÚ¤Ó +.BR dir ¡¢ +¤½¤Î¾) +¤«¤é˾¤ß¤Î¥«¥é¡¼½ÐÎϤòÄêµÁ¤¹¤ë¤¿¤á¤Î¥·¥§¥ë¥³¥Þ¥ó¥É¤Î¥·¡¼¥±¥ó¥¹¤ò½ÐÎϤ¹¤ë¡£ +ŵ·¿Åª¤Ê»ÈÍÑË¡¤Ï°Ê²¼¤ÎÄ̤ê: +.br +.RS +eval `dircolors [OPTION]... [FILE]` +.RE +.PP +¤â¤· +.I FILE +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢ +.B dircolors +¤Ï¥Õ¥¡¥¤¥ë¤Î·¿¤È³ÈÄ¥»Ò¤ËÂФ·¤Æ»ÈÍѤ¹¤ë¿§¤ÎÂбþ¤òµ­½Ò¤·¤¿¤â¤Î¤È¤·¤Æ +¤½¤ì¤òÆɤ߹þ¤à¡£»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¤¢¤é¤«¤¸¤á¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬»ÈÍѤµ¤ì¤ë¡£¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î¾Ü¤·¤¤¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï +`dircolors \-\-print\-database' ¤ò¼Â¹Ô¤¹¤ë¤Èɽ¼¨¤µ¤ì¤ë¡£ +.PP +½ÐÎϤϴĶ­ÊÑ¿ô +.B LS_COLORS +¤òÀßÄꤹ¤ë¥·¥§¥ë¥³¥Þ¥ó¥É¤Ç¤¢¤ë¡£¥³¥Þ¥ó¥É¥é¥¤¥ó¾å¤Ç¥«¥é¡¼½ÐÎϤò»ÈÍѤ¹¤ë¤¿¤á¤Ë +¥·¥§¥ë¤Î¹½Ê¸¤Ë½¾¤Ã¤Æ»ØÄê¤Ç¤­¤ë¡£¤â¤·¤¯¤Ï +.B dircolors +¤Ï +.B SHELL +¤Î´Ä¶­ÊÑ¿ô¤ÎÃͤ«¤é¤½¤ì¤ò¿ä¬¤¹¤ë¡£ +.PP +¤³¤Î¥³¥Þ¥ó¥É¤Î¼Â¹Ô¸å +`ls \-\-color'(¤â¤·¤«¤·¤¿¤é ls ¤Ë¥¨¥¤¥ê¥¢¥¹¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤)¤È¤¹¤ë¤³¤È¤Ç¡¢ +˾¤ß¤Î¿§¤Ç¥Õ¥¡¥¤¥ë¤Î¥ê¥¹¥È¤òɽ¼¨¤¹¤ë¡£ +.PP +.SH ¥ª¥×¥·¥ç¥ó +.TP +.B "\-b, \-\-sh, \-\-bourne\-shell" +Bourne shell ¥³¥Þ¥ó¥É¤ò½ÐÎϤ¹¤ë¡£¤â¤· +.B SHELL +´Ä¶­ÊÑ¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¡¢¤½¤ì¤¬ +.I csh +¤â¤·¤¯¤Ï +.I tcsh +¤Ç½ª¤ï¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤È¤Ê¤ë¡£ +.TP +.B "\-c, \-\-csh, \-\-c\-shell" +C shell ¥³¥Þ¥ó¥É¤ò½ÐÎϤ¹¤ë¡£¤â¤· +.B SHELL +¤¬ +.I csh +¤â¤·¤¯¤Ï +.I tcsh +¤Ç½ª¤ï¤Ã¤Æ¤¤¤ë¤Ê¤é¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤Ë¤Ê¤ë¡£ +.TP +.B "\-p, \-\-print\-database" +(¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿)¥Ç¥Õ¥©¥ë¥È¤Î¥«¥é¡¼ÀßÄê¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò½ÐÎϤ¹¤ë¡£ +¤³¤Î½ÐÎϤϤ½¤ì¼«¿ÈÍ­¸ú¤ÊÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¡¢¼ÂºÝ¤ËÍ­¸ú¤Ê¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.SH "GNU ɸ½à¥ª¥×¥·¥ç¥ó" +.TP +.B "\-\-help" +»ÈÍÑË¡¤òɸ½à½ÐÎϤËɽ¼¨¤¹¤ë¡£ +.TP +.B "\-\-version" +¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɸ½à½ÐÎϤËɽ¼¨¤¹¤ë¡£ +.TP +.B "\-\-" +¥ª¥×¥·¥ç¥ó¤Î½ªÎ»¡£ +.SH ´Ä¶­ÊÑ¿ô +´Ä¶­ÊÑ¿ô SHELL ¤È TERM ¤Ï ŬÀڤʥ·¥§¥ë¥³¥Þ¥ó¥É¤Î·Á¼°¤ò +ȽÄꤹ¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +´Ä¶­ÊÑ¿ô LANG, LC_ALL, LC_TYPE, LC_MESSAGES ¤Ï¤¤¤Ä¤âÄ̤ê¤Î°ÕÌ£¤ò»ý¤Ä¡£ +´Ä¶­ÊÑ¿ô LS_COLORS ¤Ï +.B ls +¤Î¾ðÊó¤òÊÑ´¹¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +.SH ½àµò +.BR ls (1) +¤Î¥«¥é¡¼½ÐÎÏ¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +¤³¤Î¼ÂÁõ¤Ï Slackware Linux ¤ÇÇÛÉÛ¤µ¤ì¤¿ +.BR dircolors / color-ls +¥Ñ¥Ã¥±¡¼¥¸¤È´°Á´¤Ë¸ß´¹¤Ç¤Ï¤Ê¤¤¡£ +Æäˡ¢Z shell ¤È Korn shell ¤Î¤¿¤á¤ÎÆÃÊ̤Υµ¥Ý¡¼¥È¤Ï¸ºß¤·¤Ê¤¤¡£ +¤³¤ì¤é¤Î¥·¥§¥ë¤Î¥æ¡¼¥¶¡¼¤Ï Bourne shell (-b) ¥â¡¼¥É¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ls (1) +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/dir_colors +¥·¥¹¥Æ¥àÁ´ÂΤËŬÍѤµ¤ì¤ë +.B dircolors +¤ÎÀßÄê¥Õ¥¡¥¤¥ë¡£ +.TP +.I ~/.dir_colors +¥æ¡¼¥¶¡¼Ëè¤Î +.B dircolors +¤ÎÀßÄê¥Õ¥¡¥¤¥ë¡£ +.SH Ãí°Õ +¤³¤Î man ¥Ú¡¼¥¸¤Ï +file\%utils-4.0 ¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤ë +.B dircolors +¤òÀâÌÀ¤·¤Æ¤¤¤ë¡£ +¾¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï¤â¤·¤«¤·¤¿¤é¤ï¤º¤«¤Ë°Û¤Ê¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +ÀâÌÀ¤ÎÄûÀµ¤äÄɲäˤĤ¤¤Æ¤Ï +aeb@cwi.nl ¤Ë¥á¡¼¥ë¤·¤Æ¤Û¤·¤¤¡£ +¥×¥í¥°¥é¥à¤Î¥Ð¥°Êó¹ð¤Ï fileutils-bugs@gnu.ai.mit.edu ¤ËÊó¹ð¤·¤Æ¤Û¤·¤¤¡£ diff --git a/obsolete/man1/intro.1 b/obsolete/man1/intro.1 new file mode 100644 index 00000000..6b1023bb --- /dev/null +++ b/obsolete/man1/intro.1 @@ -0,0 +1,41 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 16:53:03 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" 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) +.\" Modified Dec 26, 1999 by Kentaro Shirakata (argrath@yo.rim.or.jp) +.\" +.\"WORD introduction ÀâÌÀ +.\" +.TH INTRO 1 "24 July 1993" "Linux" "Linux Programmer's Manual" +.SH ̾Á° +intro \- ¥æ¡¼¥¶¡¼¥³¥Þ¥ó¥É¤ÎÀâÌÀ +.SH ÀâÌÀ +¤³¤Î¾Ï¤Ï¥æ¡¼¥¶¡¼¥³¥Þ¥ó¥É¤òµ­½Ò¤·¤Æ¤¤¤ë¡£ +.SH Ãø¼Ô +Ãø¼Ô¤ÈÃøºî¸¢(copyright)¤Ë´Ø¤·¤Æ¤Ï³Æ man ¥Ú¡¼¥¸¤Î¥Ø¥Ã¥À¡¼¤ò¸«¤ë¤³¤È¡£ +¤³¤ì¤é¤Ï¥Ú¡¼¥¸¤´¤È¤Ë°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ diff --git a/obsolete/man1/touch.1 b/obsolete/man1/touch.1 new file mode 100644 index 00000000..d98cd1b4 --- /dev/null +++ b/obsolete/man1/touch.1 @@ -0,0 +1,175 @@ +.\" Copyright Andries Brouwer, Ragnar Hojland Espinosa and A. Wik, 1998. +.\" +.\" This file may be copied under the conditions described +.\" in the LDP GENERAL PUBLIC LICENSE, Version 1, September 1998 +.\" that should have been distributed together with this file. +.\" +.\" Translated Thu Jan 13 22:40:16 JST 2000 +.\" by FUJIWARA Teruyoshi +.\" +.TH TOUCH 1 "November 1998" "GNU fileutils 4.0" +.SH ̾Á° +touch \- ¥Õ¥¡¥¤¥ë¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.B touch +.BI "[\-acm][\-r " ref_file "|\-t " time "] " file... +.sp +¸Å¤¤¥Ð¡¼¥¸¥ç¥ó: +.br +.B touch +.BI "[\-acm][" ugly_time "] " file... +.sp +GNU ¥Ð¡¼¥¸¥ç¥ó +.br +.B touch +.BI "[\-acfm] [\-r " file "] [\-t " decimtime ] +.BI "[\-d " time "] [\-\-time={atime,access,use,mtime,modify}]" +.BI "[\-\-date=" time "] [\-\-reference=" file ] +.BI "[\-\-no\-create] [\-\-help] [\-\-version] [\-\-] " file... +.SH ÀâÌÀ +.B touch +¤Ï¡¢»ØÄꤷ¤¿³Æ +.IR file +¤Ë¤Ä¤¤¤Æ¡¢¥¢¥¯¥»¥¹»þ¡¦Êѹ¹»þ¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÊѹ¹¤¹¤ë¡£ +¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¡¢¥¿¥¤¥à¥¹¥¿¥ó¥×¤Ï¸½ºß¤Î»þ¹ï¤ËÊѹ¹¤µ¤ì¤ë¡£ +\-r ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢¥¿¥¤¥à¥¹¥¿¥ó¥×¤Ï +.IR ref_file +¥Õ¥¡¥¤¥ë¤ÈƱ¤¸¥¿¥¤¥à¥¹¥¿¥ó¥×¤Ë¤Ê¤ë¡£ +\-t ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢¥¿¥¤¥à¥¹¥¿¥ó¥×¤Ï +»ØÄꤷ¤¿»þ¹ï +.IR time +¤ËÊѹ¹¤µ¤ì¤ë¡£ +\-a ¤È \-m ¥ª¥×¥·¥ç¥ó¤¬¤É¤Á¤é¤â»ØÄꤵ¤ì¤Ê¤¤¤«¡¢¤¢¤ë¤¤¤ÏξÊý¤È¤â»ØÄꤵ +¤ì¤ë¤È¡¢¥¢¥¯¥»¥¹»þ¹ï¤È¹¹¿·»þ¹ï¤ÏξÊý¤È¤âÊѹ¹¤µ¤ì¤ë¡£ +\-a ¤È \-m ¥ª¥×¥·¥ç¥ó¤ÎÊÒÊý¤À¤±¤¬»ØÄꤵ¤ì¤ë¤È¡¢¥¢¥¯¥»¥¹»þ¹ï¤À¤±¡¢¤Þ¤¿ +¤Ï¹¹¿·»þ¹ï¤À¤±¤¬Êѹ¹¤µ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬¤Þ¤À¸ºß¤·¤Æ¤ª¤é¤º¡¢¤«¤Ä \-c ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +.B touch +¥³¥Þ¥ó¥É¤Ï¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë(¥Õ¥¡¥¤¥ë¤Ï¶õ¤Ç¤¢¤ê¡¢¥â¡¼¥É 0666 ¤ò umask +¤Ç½¤Àµ¤·¤¿¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤¬Í¿¤¨¤é¤ì¤ë)¡£ +.SH "POSIX ÈǤΥª¥×¥·¥ç¥ó" +.TP +.B \-a +.IR file +¤Î¥¢¥¯¥»¥¹»þ¹ï¤òÊѹ¹¤¹¤ë¡£ +.TP +.B \-c +.IR file +¤òºîÀ®¤·¤Ê¤¤¡£ +.TP +.B \-m +.IR file +¤Î½¤Àµ»þ¹ï¤òÊѹ¹¤¹¤ë¡£ +.TP +.BI "\-r " ref_file +¥¿¥¤¥à¥¹¥¿¥ó¥×¤ÎÊѹ¹¸å¤ÎÃͤò +.I ref_file +¤ÈƱ¤¸»þ¹ï¤Ë¤¹¤ë¡£ +.TP +.BI "\-t " time +¥¿¥¤¥à¥¹¥¿¥ó¥×¤ÎÊѹ¹¸å¤ÎÃͤò»ØÄꤷ¤¿»þ¹ï¤Ë¤¹¤ë¡£ +¤³¤Î°ú¿ô¤Ï +.br +.nf + [[CC]YY]MMDDhhmm[.SS] +.br +.fi +¤È¤¤¤¦·Á¼°¤Î 10 ¿Ê¿ô¤Ç¤¢¤ê¡¢°ÕÌ£¤Ï¸«¤¿Ä̤ê¤Ç¤¢¤ë¡£CC ¤ÎÉôʬ¤¬»ØÄꤵ¤ì +¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¡ÖCCYY¡×·Á¼°¤È¤·¤Æ¤ÎÃÍ¤Ï 1969-2068 ¤ÎÈϰϤ«¤éÆÀ¤é¤ì¤ë¡£ +SS ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ÃÍ¤Ï 0 ¤È¤Ê¤ë¡£SS ¤Ë¤Ï 0-61 ¤ÎÃͤò»ØÄê¤Ç¤­ +¤ë¡£¤³¤ì¤Ï¤¦¤ë¤¦Éäò»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ç¤¢¤ë¡£ +ÆÀ¤é¤ì¤ë»þ¹ï¤Ï¡¢´Ä¶­ÊÑ¿ô TZ ¤Ç¼¨¤µ¤ì¤ë¥¿¥¤¥à¥¾¡¼¥ó¤Î»þ¹ï¤È²ò¼á¤µ¤ì¤ë¡£ +ÆÀ¤é¤ì¤ë»þ¹ï¤¬ 1970 ǯ 1 ·î 1 Æü¤è¤êÁ°¤Î¾ì¹ç¤Ï¥¨¥é¡¼¤È¤Ê¤ë¡£ +.SH "POSIX ÈǤ˴ؤ¹¤ë¾Ü¤·¤¤ÀâÌÀ" +2 ÈÖÌܤηÁ¼°¤Ç¸Æ¤Ó½Ð¤¹¾ì¹ç¤Ë¤Ï¡¢ +.I ugly_time +¤¬»þ¹ï¤«¥Õ¥¡¥¤¥ë°ú¿ô¤«¤É¤¦¤«¤¬¾¯¤·Ê¶¤é¤ï¤·¤¤¤È¤¤¤¦·çÅÀ¤¬¤¢¤ë¡£ +\-r ¤â \-t ¤â¤Ê¤±¤ì¤Ð¡¢¤³¤Î°ú¿ô¤Ï»þ¹ï¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +¤³¤Î¾ì¹ç¤Ï¾¯¤Ê¤¯¤È¤â°ú¿ô¤Ï 2 ¤Ä¤¢¤ê¡¢ºÇ½é¤Î°ú¿ô¤Ï 8 ·å¤Þ¤¿¤Ï 10 ·å¤Î +10 ¿Ê¤ÎÀ°¿ôÃͤǤ¢¤ë¡£ +.I ugly_time +¤Î½ñ¼°¤Ï MMDDhhmm[yy] ¤Ç¤¢¤ë¡£yy ¤Ï 69-99 ¤ÎÈÏ°Ï¤Ç 1696-1999 ¤òɽ¤·¡¢ +yy ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¸½ºß¤Îǯ¤È¤¤¤¦°ÕÌ£¤Ë¤Ê¤ë¡£ +.SH "GNU ÈǤ˴ؤ¹¤ë¾Ü¤·¤¤ÀâÌÀ" +ºÇ½é¤Î +.I file +¤¬ +.B "\-t" +¥ª¥×¥·¥ç¥ó¤ËÂФ¹¤ëÀµ¤·¤¤°ú¿ô¤Ç¤¢¤ê¡¢¤«¤Ä +.BR "\-d" , +.BR "\-r" +.B "\-t" +¥ª¥×¥·¥ç¥ó¤Î¤¤¤º¤ì¤Ç¤â¥¿¥¤¥à¥¹¥¿¥ó¥×¤¬»ØÄꤵ¤ì¤Æ¤ª¤é¤º¡¢¤µ¤é¤Ë +`\-\-' °ú¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¤½¤Î°ú¿ô¤ÏÁàºîÂоݤΥե¡¥¤¥ë̾¤Ç¤Ï +¤Ê¤¯¡¢Â¾¤Î¥Õ¥¡¥¤¥ë¤Î»þ¹ï¤ò·è¤á¤ë¤¿¤á¤Î¥Õ¥¡¥¤¥ë¤È²ò¼á¤µ¤ì¤ë¡£ +.PP +¥¢¥¯¥»¥¹»þ¹ï¤È¹¹¿·»þ¹ï¤ÎξÊý¤ò¸½ºß¤Î»þ¹ï¤ËÊѹ¹¤¹¤ë¾ì¹ç¡¢ +.B touch +¥³¥Þ¥ó¥É¤Ï¡¢¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¥æ¡¼¥¶¤¬½êÍ­¤·¤Æ¤¤¤Ê¤¯¤Æ¤â +½ñ¤­¹þ¤ß¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤¬¤¢¤ì¤Ð¡¢¥Õ¥¡¥¤¥ë¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÊѹ¹¤Ç¤­¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢¥æ¡¼¥¶¤Ï¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH "GNU ÈǤΥª¥×¥·¥ç¥ó" +.TP +.B "\-a, \-\-time=atime, \-\-time=access, \-\-time=use" +¥¢¥¯¥»¥¹»þ¹ï¤Î¤ß¤òÊѹ¹¤¹¤ë¡£ +.TP +.B "\-c, \-\-no\-create" +¸ºß¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¤ÎºîÀ®¤ò¹Ô¤ï¤Ê¤¤¡£ +.TP +.BI "\-d, \-\-date=" time +¸½ºß¤Î»þ¹ï¤Ç¤Ï¤Ê¤¯ +.I time +¤ò»È¤¦¡£¤³¤Î»þ¹ï¤Ë¤Ï·î¤Î̾Á°¡¢¥¿¥¤¥à¥¾¡¼¥ó¡¢`am' ¤ä `pm' ¤ò´Þ¤á¤ë¤³¤È +¤¬¤Ç¤­¤ë¡£ +.TP +.B "\-f" +̵»ë¤µ¤ì¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï BSD ÈǤΠ+.BR touch (1) +¤È¤Î¸ß´¹À­¤Î¤¿¤á¤ËÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B "\-m, \-\-time=mtime, \-\-time=modify" +¹¹¿·»þ¹ï¤Î¤ß¤òÊѹ¹¤¹¤ë¡£ +.TP +.BI "\-r " file ", \-\-reference=" file +¸½ºß¤Î»þ¹ï¤Ç¤Ï¤Ê¤¯¡¢ +.I file +¤Î»þ¹ï¤ò»²¾È¤·¤ÆÍѤ¤¤ë¡£ +.TP +.BI "\-t " decimtime +.I decimtime +¤Î½ñ¼°¤Ï MMDDhhmm[[CC]YY][.ss] ¤Ç¤¢¤ë¡£ +¸½ºß¤Î»þ¹ï¤Ç¤Ï¤Ê¤¯°ú¿ô(·î¡¢Æü¡¢»þ¡¢Ê¬¡¢À¤µª(¾Êά²Ä)¡¢Ç¯¡¢ÉÃ(¾Êά²Ä))¤ò +ÍѤ¤¤ë¡£ +¤³¤Î½ñ¼°¤Ï POSIX ¤Î»ÅÍͤ˰ãÈ¿¤·¤Æ¤¤¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH "GNU ɸ½à¤Î¥ª¥×¥·¥ç¥ó" +.TP +.B "\-\-help" +»ÈÍÑÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤òɸ½à½ÐÎϤËɽ¼¨¤·¤ÆÀµ¾ï½ªÎ»¤¹¤ë¡£ +.TP +.B "\-\-version" +¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɸ½à½ÐÎϤËɽ¼¨¤·¤ÆÀµ¾ï½ªÎ»¤¹¤ë¡£ +.TP +.B "\-\-" +¥ª¥×¥·¥ç¥ó¥ê¥¹¥È¤ÎËöÈø¤ò¼¨¤¹¡£ +.SH ´Ä¶­ÊÑ¿ô +´Ä¶­ÊÑ¿ô TZ ¤Ï¡¢Í¿¤¨¤é¤ì¤¿»þ´Ö¤òÍÛ¤ËÊÑ´¹¤¹¤ë¤¿¤á¤ËÍѤ¤¤ë¡£ +´Ä¶­ÊÑ¿ô LANG, LC_ALL, LC_CTYPEm, LC_MESSAGES ¤ÏÄ̾ïÄ̤ê¤Î°ÕÌ£¤ò»ý¤Ä¡£ +.SH ½àµò +POSIX 1003.2 ¤Ë¤Ï¡¢\-t¥ª¥×¥·¥ç¥ó¤Î°ú¿ô¤Î½ñ¼°¤¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¤³¤Î½ñ¼°¤Ï¡¢GNU ¤Ë¤è¤ë¼ÂÁõ¤È°Û¤Ê¤ë¡£ +.SH »ÈÍÑÎã +¥³¥Þ¥ó¥É `\fItouch foo\fP' ¤ò¼Â¹Ô¤¹¤ë¤È¡¢\fIfoo\fP ¤¬Â¸ºß¤·¤Ê¤±¤ì¤Ð +¥Õ¥¡¥¤¥ë \fIfoo\fP ¤¬ºîÀ®¤µ¤ì¡¢Â¸ºß¤¹¤ì¤ÐºÇ½ª¹¹¿·»þ¹ï¤¬¸½ºß¤Ë¤Ê¤ë¡£ +¤³¤Î¥³¥Þ¥ó¥É¤Ï¤è¤¯¡¢ +.BR make +¤ÎÆ°ºî¤òÀ©¸æ¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.SH Ãí°Õ +¤³¤Î¥Ú¡¼¥¸¤Ï fileutils-4.0 ¥Ñ¥Ã¥±¡¼¥¸¤ËÆþ¤Ã¤Æ¤¤¤ë +.B touch +¥³¥Þ¥ó¥É¤ò²òÀ⤷¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¾¤Î ¥Ð¡¼¥¸¥ç¥ó¤ÎÆ°ºî¤Ï¾¯¤·°ã¤¦¤«¤â¤·¤ì¤Ê¤¤¡£ +Äɲá¦ÄûÀµ¤Ï aeb@cwi.nl °¸¤ËÁ÷¤ë¤³¤È¡£ +¥×¥í¥°¥é¥à¤ËÂФ¹¤ë¥Ð¥°Êó¹ð¤Ï fileutils-bugs@gnu.ai.mit.edu °¸¤ËÁ÷¤ë¤³ +¤È¡£ + + diff --git a/obsolete/man2/fdatasync.2 b/obsolete/man2/fdatasync.2 new file mode 100644 index 00000000..c63af494 --- /dev/null +++ b/obsolete/man2/fdatasync.2 @@ -0,0 +1,185 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl) +.\" Copyright (C) 1996 Markus Kuhn. +.\" +.\" [This version merged from two independently written pages - aeb] +.\" +.\" 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. +.\" +.\" 1996-04-12 Andries Brouwer +.\" 1996-04-13 Markus Kuhn +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Feb 22 20:10:07 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Mon May 5 19:46:46 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Wed May 19 03:24:56 JST 2004 +.\" by Yuichi SATO +.\" +.\"WORD: core ¥á¥â¥ê +.\"WORD: synchronize Ʊ´ü¤µ¤»¤ë +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡¡¼ +.\"WORD: flush ¥Õ¥é¥Ã¥·¥å +.\"WORD: access time ¥¢¥¯¥»¥¹»þ¹ï +.\"WORD: database ¥Ç¡¼¥¿¥Ù¡¼¥¹ +.\"WORD: modification time ½¤Àµ»þ¹ï +.\"WORD: inode inode +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\" +.TH FDATASYNC 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O fdatasync \- synchronize a file's in-core data with that on disk +fdatasync \- ¥Õ¥¡¥¤¥ë¤Î¥á¥â¥ê¾å¤Î¥Ç¡¼¥¿¤ò¥Ç¥£¥¹¥¯¾å¤Î¤â¤Î¤ÈƱ´ü¤µ¤»¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.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 fdatasync (): +_POSIX_C_SOURCE\ >=\ 199309L || _XOPEN_SOURCE\ >=\ 500 +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .BR fdatasync () +.\"O flushes all data buffers of a file to disk (before the system +.\"O call returns). +.\"O It resembles +.\"O .BR fsync (2) +.\"O but is not required to update metadata such as the file last access time. +.BR fdatasync () +¤Ï (¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤«¤éÌá¤ëÁ°¤Ë) ¥Õ¥¡¥¤¥ë¤ÎÁ´¤Æ¤Î¥Ç¡¼¥¿¡¦¥Ð¥Ã¥Õ¥¡¡¼¤ò +¥Ç¥£¥¹¥¯¤Ë¥Õ¥é¥Ã¥·¥å (flush) ¤¹¤ë¡£¤³¤ì¤Ï +.BR fsync (2) +¤Ë»÷¤Æ¤¤¤ë¤¬¡¢¥Õ¥¡¥¤¥ë¤ÎºÇ½ª¥¢¥¯¥»¥¹»þ¹ï¤È¤¤¤Ã¤¿¥á¥¿¥Ç¡¼¥¿¤ò¹¹¿·¤·¤Ê¤¤¡£ + +.\"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 (2) +.\"O immediately in order to ensure that the written data is physically +.\"O stored on the harddisk. +.\"O Unfortunately, +.\"O .BR fsync (2) +.\"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 (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ÉÔ¹¬¤Ê¤³¤È¤Ë¡¢ +.BR fsync (2) +¤Ï¾ï¤ËÆó²ó¤Î½ñ¤­¹þ¤ßÁàºî¤ò¹Ô¤Ê¤¦: °ì¤Ä¤Ï¿·¤·¤¯½ñ¤­¹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤ò¡¢ +¤â¤¦°ì¤Ä¤Ï inode ¤Î½¤Àµ»þ¹ï¤ò¹¹¿·¤¹¤ë¤¿¤á¤Ë¡£½¤Àµ»þ¹ï¤¬¥È¥é¥¶¥ó¥¯¥·¥ç¥ó +¤Ë´Ø·¸¤Ê¤±¤ì¤Ð¡¢ +.BR fdatasync () +¤ò»ÈÍѤ¹¤ë¤³¤È¤ÇÉÔɬÍפʥǥ£¥¹¥¯¤Ø¤Î inode ¤Î½ñ¤­¹þ¤ß½èÍý¤ò +Èò¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\"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 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 ½àµò +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 ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I +¤Ë¤ª¤¤¤Æ +.B _POSIX_SYNCHRONIZED_IO +¤¬ 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 NOTES +.SH Ãí°Õ +.\"O In Linux 2.2 and earlier, +.\"O .BR fdatasync () +.\"O is equivalent to +.\"O .BR fsync (2), +.\"O and so has no performance advantage. +Linux 2.2 °ÊÁ°¤Ç¤Ï¡¢ +.BR fdatasync () +¤Ï +.BR fsync (2) +¤ÈÅù²Á¤Ç¤¢¤ê¡¢¤·¤¿¤¬¤Ã¤ÆÀ­Ç½¾å¤ÎÍøÅÀ¤â¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fsync (2), +.BR sync_file_range (2) +.br +B.O. Gallmeister, POSIX.4, O'Reilly, pp. 220-223 and 343. diff --git a/obsolete/man2/gethostid.2 b/obsolete/man2/gethostid.2 new file mode 100644 index 00000000..262a7394 --- /dev/null +++ b/obsolete/man2/gethostid.2 @@ -0,0 +1,153 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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. +.\" +.\" Updated with additions from Mitchum DSouza +.\" Portions Copyright 1993 Mitchum DSouza +.\" +.\" Modified Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated Fri Jun 27 10:04:58 JST 1997 +.\" by SUTO, Mitsuaki +.\" Modified Sun Mar 21 17:24:27 JST 1999 +.\" by HANATAKA Shinya +.\" +.TH GETHOSTID 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O gethostid, sethostid \- get or set the unique identifier of the current host +gethostid, sethostid \- ¸½ºß»ÈÍѤ·¤Æ¤¤¤ë¥Û¥¹¥È¤Ë¸ÇÍ­¤Î¼±Ê̻Ҥò¼èÆÀ¤¹¤ë¡¢¤Þ¤¿¤ÏÀßÄꤹ¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.B long gethostid(void); +.br +.BI "int sethostid(long " hostid ); +.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 sethostid (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.ad b +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O 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. +¸½ºß»ÈÍѤ·¤Æ¤¤¤ë¥Û¥¹¥È¤Ë¸ÇÍ­¤Î 32 ¥Ó¥Ã¥È¤Î¼±Ê̻Ҥò¼èÆÀ/ÀßÄꤹ¤ë¡£ +¤³¤Î 32 ¥Ó¥Ã¥È¤Î¼±Ê̻Ҥϸ½ºß¸ºß¤·¤Æ¤¤¤ëÁ´¤Æ¤Î Unix ¥·¥¹¥Æ¥à +¤ÎÃæ¤ÇÍ£°ì¤Ë¤Ê¤ë¤è¤¦¤Ë·è¤á¤é¤ì¤ë¡£Ä̾ï¤Ï +.BR gethostbyname (3) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë¥í¡¼¥«¥ë¥Þ¥·¥ó¤Î Internet ¥¢¥É¥ì¥¹¤¬Âå¤ï¤ê¤Ë»ÈÍѤµ¤ì¡¢ +ÉáÄ̤ϼ±Ê̻Ҥò¤¢¤¨¤ÆÀßÄꤹ¤ëɬÍפϤʤ¤¡£ + +.\"O The +.\"O .BR sethostid () +.\"O call is restricted to the superuser. +.BR sethostid () +¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤·¤«»ÈÍѤǤ­¤Ê¤¤¡£ + +.\"O The +.\"O .I hostid +.\"O argument is stored in the file +.\"O .IR /etc/hostid . +°ú¤­¿ô +.I hostid +¤Ï +.I /etc/hostid +¥Õ¥¡¥¤¥ë¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.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 ¥Ó¥Ã¥È¤Î¼±Ê̻ҤÎÃͤòÊÖ¤¹¡£ +.\"O .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.I /etc/hostid +.\"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 +.SH Ãí°Õ +.\"O In the glibc implementation, if +.\"O .BR gethostid () +.\"O cannot open +.\"O .IR /etc/hostid , +.\"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 ¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.I /etc/hostid +¤ò¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.BR gethostid () +¤Ï +.BR gethostname (2) +¤ò»È¤Ã¤Æ¥Û¥¹¥È̾¤òÆþ¼ê¤·¡¢¤½¤Î¥Û¥¹¥È̾¤ò +.BR gethostbyname_r (3) +¤ËÅϤ·¥Û¥¹¥È¤Î IPv4 ¥¢¥É¥ì¥¹¤ò¼èÆÀ¤·¤Æ¡¢ +¤½¤Î IPv4 ¥¢¥É¥ì¥¹¤Î¥Ó¥Ã¥ÈÆþ¤ìÂؤ¨¤ò¹Ô¤Ã¤¿ÃͤòÊÖ¤¹¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR hostid (1), +.BR gethostbyname (3) diff --git a/obsolete/man2/mlockall.2 b/obsolete/man2/mlockall.2 new file mode 100644 index 00000000..b4b2c773 --- /dev/null +++ b/obsolete/man2/mlockall.2 @@ -0,0 +1,275 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 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. +.\" +.\" 1995-11-26 Markus Kuhn +.\" First version written +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sun Feb 23 16:33:31 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Fri May 21 03:32:57 JST 2004 +.\" by Yuichi SATO +.\" +.\"WORD: lock ¥í¥Ã¥¯ +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: paging ¥Ú¡¼¥¸¥ó¥° +.\"WORD: code ¥³¡¼¥É +.\"WORD: data ¥Ç¡¼¥¿ +.\"WORD: stack ¥¹¥¿¥Ã¥¯ +.\"WORD: segment ¥»¥°¥á¥ó¥È +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: shared memory ¶¦Í­¥á¥â¥ê +.\"WORD: unlock ¥¢¥ó¥í¥Ã¥¯ +.\"WORD: real-time ¥ê¥¢¥ë¡¦¥¿¥¤¥à +.\"WORD: algorithm ¥¢¥ë¥´¥ê¥º¥à +.\"WORD: security ¥»¥­¥å¥ê¥Æ¥£ +.\"WORD: scheduling ¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +.\"WORD: password ¥Ñ¥¹¥ï¡¼¥É +.\"WORD: secret key ÈëÌ©¸° +.\"WORD: heap ¥Ò¡¼¥×(heap) +.\"WORD: automatic variable ¼«Æ°ÊÑ¿ô +.\"WORD: copy-on-write ½ñ¤­¹þ¤ß»þ¥³¥Ô¡¼ +.\"WORD: flag ¥Õ¥é¥° +.\"WORD: root ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\" +.TH MLOCKALL 2 1995-11-26 "Linux 1.3.43" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O mlockall \- disable paging for calling process +mlockall \- ¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¥ó¥°¤ò¶Ø»ß¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +\fBint mlockall(int \fIflags\fB); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .B mlockall +.\"O disables paging for all pages mapped into the address space of the +.\"O calling process. 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. All mapped pages are guaranteed to be +.\"O resident in RAM when the +.\"O .B mlockall +.\"O system call returns successfully and they are guaranteed to stay in RAM +.\"O until the pages are unlocked again by +.\"O .B munlock +.\"O or +.\"O .B munlockall +.\"O or until the process terminates or starts another program with +.\"O .BR exec . +.B mlockall +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥Ú¡¼¥¸¤Î +¥Ú¡¼¥¸¥ó¥° (paging) ¤ò¶Ø»ß¤¹¤ë¡£¤³¤ì¤Ë¤Ï¥³¡¼¥É¡¢¥Ç¡¼¥¿¡¢¥¹¥¿¥Ã¥¯¤Î +³Æ¥»¥°¥á¥ó¥È¡¢¶¦Í­¥é¥¤¥Ö¥é¥ê¡¢¥«¡¼¥Í¥ë¤Î¥æ¡¼¥¶¡¼¶õ´Ö¥Ç¡¼¥¿¡¢ +¶¦Í­¥á¥â¥ê¡¢¥á¥â¥ê¡¦¥Þ¥Ã¥×¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +.B mlockall +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬À®¸ù¤·¤¿¾ì¹ç¤Ë¤ÏÁ´¤Æ¤Î¥Þ¥Ã¥×¤µ¤ì¤¿¥Ú¡¼¥¸¤Ï RAM ¤Ë +»Ä¤ê³¤±¤ë¤³¤È¤òÊݾڤµ¤ì¤ë¡¢¤½¤·¤Æ +.B munlock +¤ä +.B munlockall +¤Ë¤è¤Ã¤Æ¥Ú¡¼¥¸¤¬¥¢¥ó¥í¥Ã¥¯¤µ¤ì¤¿¤ê¡¢¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¤ê¡¢ +.BR exec +¤Ë¤è¤Ã¤Æ¾¤Î¥×¥í¥°¥é¥à¤ò³«»Ï¤·¤¿¤ê¤¹¤ë¤Þ¤Ç¤Ï RAM ¤Ë»Ä¤ë¤³¤È¤¬ +Êݾڤµ¤ì¤ë¡£ +.\"O Child processes do not inherit page locks across a +.\"O .BR fork . +.BR fork +¤ò¹Ô¤Ê¤Ã¤¿¾ì¹ç¤Ë»Ò¥×¥í¥»¥¹¤Ï¥Ú¡¼¥¸¤Î¥í¥Ã¥¯¤ò·Ñ¾µ¤·¤Ê¤¤¡£ + +.\"O Memory locking has two main applications: real-time algorithms and +.\"O high-security data processing. Real-time applications require +.\"O deterministic timing, and, like scheduling, paging is one major cause +.\"O of unexpected program execution delays. Real-time applications will +.\"O usually also switch to a real-time scheduler with +.\"O .BR sched_setscheduler . +¥á¥â¥ê¤Î¥í¥Ã¥¯¤Ë¤Ï¼ç¤ËÆó¤Ä¤Î»È¤¤Æ»¤¬¤¢¤ë¡£¥ê¥¢¥ë¡¦¥¿¥¤¥à (real-time) +¥¢¥ë¥´¥ê¥º¥à¤È¹â¤¤¥»¥­¥å¥ê¥Æ¥£¤Î¥Ç¡¼¥¿½èÍý¤Ç¤¢¤ë¡£¥ê¥¢¥ë¡¦¥¿¥¤¥à¤Î +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï·èÄêŪ¤Ê¥¿¥¤¥ß¥ó¥°¤ä¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤òÍ׵ᤷ¡¢ +¥Ú¡¼¥¸¥ó¥°¤Ïͽ´ü¤·¤Ê¤¤¥×¥í¥°¥é¥à¤Î¼Â¹ÔÃÙ¤ì¤ò¤â¤¿¤é¤¹½ÅÍפÊÍ×°ø¤Ç¤¢¤ë¡£ +¥ê¥¢¥ë¡¦¥¿¥¤¥à¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤¿¤¤¤Æ¤¤¤Ï +.BR sched_setscheduler +¤Ç¥ê¥¢¥ë¡¦¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¥é¡¼¤ËÊѹ¹¤µ¤ì¤ë¡£ +.\"O Cryptographic security software often handles critical bytes like +.\"O passwords or secret keys as data structures. As a result of paging, +.\"O these secrets could be transfered 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. For security +.\"O applications, only small parts of memory have to be locked, for which +.\"O .B mlock +.\"O is available. +°Å¹æ¤ä¥»¥­¥å¥ê¥Æ¥£¤Î¥½¥Õ¥È¥¦¥§¥¢¤Ï¤·¤Ð¤·¤Ð¥Ñ¥¹¥ï¡¼¥É¤äÈëÌ©¸°¤Î¥Ç¡¼¥¿¤Î +¤è¤¦¤Ê½ÅÍפʥХ¤¥È¤ò°·¤¦¡£¥Ú¡¼¥¸¥ó¥°¤Î·ë²Ì¡¢¤³¤ì¤é¤ÎÈëÌ©¤¬ +¥¹¥ï¥Ã¥×ÍѤθÇÄêÇÞÂΤËžÁ÷¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£¤½¤·¤Æ¤½¤ì¤Ï¥»¥­¥å¥ê¥Æ¥£ +¡¦¥½¥Õ¥È¥¦¥§¥¢¤¬ RAM ¾å¤ÎÈëÌ©¤òºï½ü¤·¤Æ½ªÎ»¤·¤¿¤º¤Ã¤È¸å¤Ë¤Ç¤âŨ¤Ë¤è¤Ã¤Æ +¥¢¥¯¥»¥¹¤¬²Äǽ¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£¥»¥­¥å¥ê¥Æ¥£¡¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï +¥á¥â¥ê¤Î¤Û¤ó¤Î¾®¤µ¤ÊÉôʬ¤Î¤ß¤¬¥í¥Ã¥¯¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤½¤Î¤¿¤á¤Ë +.B mlock +¤¬»ÈÍѤǤ­¤ë¡£ + +.\"O The +.\"O .I flags +.\"O parameter can be constructed from the bitwise OR of the following +.\"O 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. 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 and the number of locked pages exceeds the upper +.\"O limit of allowed locked pages, then the system call which caused the +.\"O new mapping will fail with +.\"O .BR ENOMEM . +.B MCL_FUTURE +¤¬»ØÄꤵ¤ì¤Æ¤ª¤ê¡¢¥í¥Ã¥¯¤µ¤ì¤¿¥Ú¡¼¥¸¤Î¿ô¤¬¥í¥Ã¥¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¥Ú¡¼¥¸¿ô¤Î +¾å¸Â¤òĶ¤¨¤¿¾ì¹ç¤Ë¤Ï¡¢¿·¤·¤¯¥Ú¡¼¥¸¤ò¥Þ¥Ã¥×¤¹¤ë¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï +.BR ENOMEM +¤È¤Ê¤Ã¤Æ¼ºÇÔ¤¹¤ë¡£ +.\"O If these new pages have been mapped by the the growing stack, then the +.\"O kernel will deny stack expansion and send a +.\"O .BR SIGSEGV . +À®Ä¹¤¹¤ë¥¹¥¿¥Ã¥¯¤Ë¤è¤Ã¤Æ¿·¤·¤¤¥Ú¡¼¥¸¤¬¥Þ¥Ã¥×¤µ¤ì¤ë¾ì¹ç¤Ï¡¢¥«¡¼¥Í¥ë¤Ï +¥¹¥¿¥Ã¥¯¤Î³ÈÄ¥¤òµñÈݤ·¡¢ +.BR SIGSEGV +¤òÁ÷¤ë¡£ + +.\"O Real-time processes should reserve enough locked stack pages before +.\"O entering the time-critical section, so that no page fault can be +.\"O caused by function calls. This can be achieved by calling a function +.\"O which has a sufficiently large automatic variable and which writes to +.\"O the memory occupied by this large array in order to touch these stack +.\"O pages. This way, enough pages will be mapped for the stack and can be +.\"O locked into RAM. The dummy writes ensure that not even copy-on-write +.\"O page faults can occur in the critical section. +¥ê¥¢¥ë¡¦¥¿¥¤¥à¡¦¥×¥í¥»¥¹¤Ï´Ø¿ô¸Æ¤Ó½Ð¤·¤Ç¥Ú¡¼¥¸¡¦¥Õ¥©¡¼¥ë¥È¤¬È¯À¸¤·¤Ê¤¤ +¤è¤¦¤Ë»þ´Ö¤¬Ã×̿Ū¤ÊÉôʬ¤ËÆþ¤ëÁ°¤Ë½½Ê¬¤Ê¥í¥Ã¥¯¤µ¤ì¤¿¥¹¥¿¥Ã¥¯¤ò³ÎÊݤ·¤Æ +¤ª¤¯É¬Íפ¬¤¢¤ë¡£¤³¤ì¤Ï½½Ê¬¤ËÂ礭¤Ê¼«Æ°ÊÑ¿ô¤ò³ÎÊݤ¹¤ë´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¡¢ +¤³¤ì¤é¤Î¥¹¥¿¥Ã¥¯ÍѤΥڡ¼¥¸¤¬¥á¥â¥ê¤Ë³ÎÊݤµ¤ì¤ë¤è¤¦¤Ë¤³¤ÎÂ礭¤ÊÇÛÎó¤Ë +½ñ¤­¹þ¤ß¤ò¹Ô¤Ê¤¦¤³¤È¤Ë¤è¤Ã¤ÆãÀ®¤Ç¤­¤ë¡£¤³¤ÎÊýË¡¤Ë¤è¤Ã¤Æ½½Ê¬¤Ê¥Ú¡¼¥¸¤¬ +¥¹¥¿¥Ã¥¯¤Ë¥Þ¥Ã¥×¤µ¤ì¡¢RAM ¤Ë¥í¥Ã¥¯¤µ¤ì¤ë¡£¥À¥ß¡¼¤Î½ñ¤­¹þ¤ß¤ÏÃ×̿Ū¤Ê +Éôʬ¤Ç½ñ¤­¹þ¤ß»þ¥³¥Ô¡¼ (copy-on-write) ¤Ë¤è¤ë¥Ú¡¼¥¸¡¦¥Õ¥©¡¼¥ë¥È¤µ¤¨ +µ¯¤­¤Ê¤¤¤³¤È¤òÊݾڤ¹¤ë¡£ + +.\"O Memory locks do not stack, i.e., pages which have been locked several times +.\"O by calls to +.\"O .B mlockall +.\"O or +.\"O .B mlock +.\"O will be unlocked by a single call to +.\"O .BR munlockall . +¥á¥â¥ê¤Î¥í¥Ã¥¯ (lock) ¤ÏÎßÀѤ·¤Ê¤¤¡£Î㤨¤ÐÊ£¿ô²ó +.B mlock +¤ä +.B mlockall +¤ò¸Æ¤Ó½Ð¤·¤Æ¥í¥Ã¥¯¤µ¤ì¤¿¥Ú¡¼¥¸¤â°ì²ó¤Î +.BR munlockall +¤Ë¤è¤Ã¤Æ¥¢¥ó¥í¥Ã¥¯ (unlock) ¤µ¤ì¤ë¡£ +.\"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. +Ê£¿ô¤Î¾ì½ê¤äÊ£¿ô¤Î¥×¥í¥»¥¹¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ë¥Ú¡¼¥¸¤Ï¡¢¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¾ì½ê¡¢ +°ì¤Ä¤Î¥×¥í¥»¥¹¤Ç¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¸Â¤ê¤Ï RAM ¤Ë»Ä¤ê³¤±¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .B mlockall +.\"O returns zero. On error, \-1 is returned, and +.\"O .I errno +.\"O is set appropriately. +À®¸ù¤·¤¿¾ì¹ç¤Ï¡¢ +.B mlockall +¤Ï¥¼¥í¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +.\"O The process tried to exceed the maximum number of allowed locked +.\"O pages. +µö¤µ¤ì¤ë¾å¸Â¤òĶ¤¨¤ë¿ô¤Î¥Ú¡¼¥¸¤ò¥í¥Ã¥¯¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B EPERM +.\"O The calling process does not have appropriate privileges. Only root +.\"O processes are allowed to lock pages. +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬Å¬ÀÚ¤ÊÆø¢¤ò½êÍ­¤·¤Æ¤¤¤Ê¤¤¡£ +¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Î¥×¥í¥»¥¹¤Î¤ß¤¬¥Ú¡¼¥¸¤ò¥í¥Ã¥¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B EINVAL +.\"O Unknown flags were specified. +̤ÃΤΥե饰¤¬»ØÄꤵ¤ì¤¿¡£ +.\"O .SH AVAILABILITY +.SH Í­¸úÀ­ +.\"O On POSIX systems on which +.\"O .B mlockall +.\"O and +.\"O .B munlockall +.\"O are available, +.\"O .B _POSIX_MEMLOCK +.\"O is defined in to a value greater than 0. (See also +.\"O .BR sysconf (3).) +.B mlockall +¤È +.B munlockall +¤¬ÍøÍѲÄǽ¤Ê POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ + ¤Ë¤ª¤¤¤Æ +.B _POSIX_MEMLOCK +¤¬ 0 ¤è¤êÂ礭¤¤ÃͤËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +.RB ( sysconf (3) +¤ò»²¾È¤¹¤ë¤³¤È)¡£ +.\"O .\" POSIX 1003.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 1003.1-2001 ¤Ç¤Ï¡¢¤³¤ÎÃͤò -1, 0, 200112L ¤Î +.\" ¤É¤ì¤«¤ËÄêµÁ¤¹¤Ù¤­¤È¤·¤Æ¤¤¤ë¡£ +.\" -1 ¤Ï»ÈÍÑÉԲġ¢0 ¤Ï sysconf() ¤ò»È¤Ã¤Æ¿Ò¤Í¤ë¤È¤¤¤¦°ÕÌ£¤Ç¤¢¤ë¡£ +.\" glibc ¤Ç¤Ï¡¢¤³¤ÎÃͤò 1 ¤È¤·¤Æ¤¤¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O POSIX.1b, SVr4. SVr4 documents an additional EAGAIN error code. +POSIX.1b, SVR4. SVr4 ¤Ë¤Ï¾¤Ë EAGAIN ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR munlockall (2), +.BR mlock (2), +.BR munlock (2), +.BR sysconf (3) diff --git a/obsolete/man2/munlock.2 b/obsolete/man2/munlock.2 new file mode 100644 index 00000000..74fa52f4 --- /dev/null +++ b/obsolete/man2/munlock.2 @@ -0,0 +1,164 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 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. +.\" +.\" 1995-11-26 Markus Kuhn +.\" First version written +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sun Feb 23 19:47:50 JST 1997 +.\" by HANATAKA Shinya +.\" Updated Sat Oct 18 JST 2003 by Kentaro Shirakata +.\" Updated Sun May 23 JST 2004 by Kentaro Shirakata +.\" +.\"WORD: paging ¥Ú¡¼¥¸¥ó¥° +.\"WORD: memory ¥á¥â¥ê +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: swap ¥¹¥ï¥Ã¥× +.\"WORD: lock ¥í¥Ã¥¯ +.\"WORD: unlock ¥¢¥ó¥í¥Ã¥¯ +.\"WORD: process ¥×¥í¥»¥¹ +.\" +.TH MUNLOCK 2 2003-08-21 "Linux 2.4" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O munlock \- reenable paging for some parts of memory +munlock \- ¥á¥â¥ê¤Î°ìÉô¤Î¥Ú¡¼¥¸¥ó¥°¤òºÆ³«¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +\fBint munlock(const void *\fIaddr\fB, size_t \fIlen\fB); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .B munlock +.\"O reenables paging for the memory in the range starting at +.\"O .I addr +.\"O with length +.\"O .I len +.\"O bytes. All pages which contain a part of the specified memory range +.\"O can after calling +.\"O .B munlock +.\"O be moved to external swap space again by the kernel. +.B munlock +¤Ï +.I addr +¤«¤é»Ï¤Þ¤ëŤµ +.I len +¥Ð¥¤¥È¤ÎÈϰϤΥá¥â¥ê¤Î¥Ú¡¼¥¸¥ó¥°(paging)¤òºÆ³«(reenable)¤¹¤ë¡£ +»ØÄꤵ¤ì¤¿ÈϰϤΥá¥â¥ê¤ò´Þ¤ó¤Ç¤¤¤ëÁ´¤Æ¤Î¥Ú¡¼¥¸¤Ï +.B munlock +¤ò¸Æ¤Ó½Ð¤·¸å¡¢ +ºÆ¤Ó¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ³°Éô¥¹¥ï¥Ã¥×(swap)¤Ë°ÜÆ°¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + +.\"O Memory locks do not stack, i.e., pages which have been locked several times +.\"O by calls to +.\"O .B mlock +.\"O or +.\"O .B mlockall +.\"O will be unlocked by a single call to +.\"O .B 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. +¥á¥â¥ê¤Î¥í¥Ã¥¯(lock)¤ÏÎßÀѤ·¤Ê¤¤¡£ +¤¹¤Ê¤ï¤ÁÊ£¿ô²ó +.B mlock +¤ä +.B mlockall +¤ò¸Æ¤Ó½Ð¤·¤Æ¥í¥Ã¥¯¤µ¤ì¤¿¥Ú¡¼¥¸¤Ç¤â¡¢ +Âбþ¤¹¤ëÈϰϤËÂФ·¤Æ +.B munlock +¤ò 1 ²ó¸Æ¤Ó½Ð¤·¤¿¤ê +.B munlockall +¤ò¸Æ¤Ó½Ð¤·¤¿¤ê¤¹¤ë¤À¤±¤Ç¥í¥Ã¥¯²ò½ü¤µ¤ì¤ë¡£ +Ê£¿ô¤Î¾ì½ê¤äÊ£¿ô¤Î¥×¥í¥»¥¹¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ë¥Ú¡¼¥¸¤Ï¡¢¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¾ì½ê¡¢ +°ì¤Ä¤Î¥×¥í¥»¥¹¤Ç¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¸Â¤ê¤Ï RAM ¤Ë»Ä¤ê³¤±¤ë¡£ + +.\"O On POSIX systems on which +.\"O .B mlock +.\"O and +.\"O .B munlock +.\"O are available, +.\"O .B _POSIX_MEMLOCK_RANGE +.\"O is defined in and the value +.\"O .B PAGESIZE +.\"O from indicates the number of bytes per page. +.B mlock +¤È +.B munlock +¤¬»ÈÍѲÄǽ¤Ç¤¢¤ë POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï +.B _POSIX_MEMLOCK_RANGE +¤¬ ¤ËÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ ¤Ë¤¢¤ë +.B PAGESIZE +¤ÎÃͤϥڡ¼¥¸¤¢¤¿¤ê¤Î¥Ð¥¤¥È¿ô¤ò¼¨¤·¤Æ¤¤¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O On success, +.\"O .B munlock +.\"O returns zero. 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. +À®¸ù¤·¤¿¾ì¹ç¡¢ +.B munlock +¤Ï¥¼¥í¤òÊÖ¤¹¡¢¥¨¥é¡¼¤Î¾ì¹ç¤¬ \-1 ¤òÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¡¢¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤ª¤±¤ë¥í¥Ã¥¯¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +.\"O Some of the specified address range does not correspond to mapped +.\"O pages in the address space of the process. +»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤ÎÈÏ°Ï¤Ï¥×¥í¥»¥¹¤Ë¥Þ¥Ã¥×¤µ¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö¤È°ìÃפ·¤Ê¤¤¡£ +.TP +.B EINVAL +.\"O (Not on Linux) +.\"O .I addr +.\"O was not a multiple of the page size. +.I addr +¤¬¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ê¤¤¡£ +.LP +.\"O Linux adds +Linux ¤Ç¤Ï¡¢°Ê²¼¤¬Äɲ䵤ì¤ë¡£ +.TP +.\"O .B EINVAL +.\"O .I len +.\"O was negative. +.B EINVAL +.I len +¤¬Éé¤Î¿ô¤Ç¤¢¤ë¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +POSIX.1b, SVr4 +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR mlock (2), +.BR mlockall (2), +.BR munlockall (2) diff --git a/obsolete/man2/munlockall.2 b/obsolete/man2/munlockall.2 new file mode 100644 index 00000000..8c1806b5 --- /dev/null +++ b/obsolete/man2/munlockall.2 @@ -0,0 +1,80 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 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. +.\" +.\" 1995-11-26 Markus Kuhn +.\" First version written +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sun Feb 23 19:48:34 JST 1997 +.\" by HANATAKA Shinya +.\" +.\"WORD: paging ¥Ú¡¼¥¸¥ó¥° +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: lock ¥í¥Ã¥¯ +.\"WORD: unlock ¥¢¥ó¥í¥Ã¥¯ +.\" +.TH MUNLOCKALL 2 "1995-11-26" "Linux 1.3.43" "Linux Programmer's Manual" +.SH ̾Á° +munlockall \- ¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¥ó¥°¤òºÆ³«¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +\fBint munlockall(void); +.fi +.SH ÀâÌÀ +.B munlockall +¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥Ú¡¼¥¸¤Î +¥Ú¡¼¥¸¥ó¥°(paging)¤òºÆ³«(reenable)¤¹¤ë¡£ + +¥á¥â¥ê¤Î¥í¥Ã¥¯(lock)¤ÏÎßÀѤ·¤Ê¤¤¡£Î㤨¤ÐÊ£¿ô²ó +.B mlock +¤ä +.B mlockall +¤ò¸Æ¤Ó½Ð¤·¤Æ¥í¥Ã¥¯¤µ¤ì¤¿¥Ú¡¼¥¸¤â°ì²ó¤Î +.BR munlockall +¤Ë¤è¤Ã¤Æ¥¢¥ó¥í¥Ã¥¯(unlock)¤µ¤ì¤ë¡£ +Ê£¿ô¤Î¾ì½ê¤äÊ£¿ô¤Î¥×¥í¥»¥¹¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ë¥Ú¡¼¥¸¤Ï¡¢¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¾ì½ê¡¢ +°ì¤Ä¤Î¥×¥í¥»¥¹¤Ç¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¸Â¤ê¤Ï RAM ¤Ë»Ä¤ê³¤±¤ë¡£ + +.B mlockall +¤È +.B munlockall +¤¬»ÈÍѲÄǽ¤Ç¤¢¤ë POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï +.B _POSIX_MEMLOCK +¤¬ ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¡¢ +.B munlockall +¤Ï¥¼¥í¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤òÊÖ¤· +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ + +.SH ½àµò +POSIX.1b, SVr4 +.SH ´ØÏ¢¹àÌÜ +.BR mlockall (2), +.BR mlock (2), +.BR munlock (2) diff --git a/obsolete/man2/obsolete.2 b/obsolete/man2/obsolete.2 new file mode 100644 index 00000000..00f8e90b --- /dev/null +++ b/obsolete/man2/obsolete.2 @@ -0,0 +1,74 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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 22 July 1995 by Michael Chastain (mec@duracef.shout.net): +.\" Fixed incorrect word in 'TH' call. +.\" +.\" Modified Tue Oct 22 16:44:55 1996 by Eric S. Raymond +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sun Feb 23 19:51:47 JST 1997 +.\" by HANATAKA Shinya +.\" +.\"WORD: obsolete Çѻߤ¹¤ë +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: implement ¼ÂÁõ +.\"WORD: library ¥é¥¤¥Ö¥é¥ê +.\" +.TH OBSOLETE 2 1995-07-22 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O oldfstat, oldlstat, oldstat, oldolduname, olduname \- obsolete system calls +oldfstat, oldlstat, oldstat, oldolduname, olduname \- Çѻߤµ¤ì¤¿¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.\"O Obsolete system calls. +ÇÑ»ß(obsolete)¤µ¤ì¤¿¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¡£ +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The Linux 2.0 kernel implements these calls to support old executables. +.\"O These calls return structures which have grown since their +.\"O first implementation, +.\"O but old executables must continue to receive old smaller structures. +Linux 2.0 ¥«¡¼¥Í¥ë¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤ò¸Å¤¤¼Â¹Ô¥×¥í¥°¥é¥à¤ò¥µ¥Ý¡¼¥È¤¹¤ë +¤¿¤á¤Ë¼ÂÁõ¤·¤Æ¤¤¤ë¡£¤³¤ì¤é¤Î¥³¡¼¥ë¤ÏºÇ½é¤Î¼ÂÁõ¤è¤êÂ礭¤Ê¹½Â¤ÂΤòÊÖ¤¹¤¬¡¢ +¸Å¤¤¼Â¹Ô¥×¥í¥°¥é¥à¤Ï¸Å¤¤¤è¤ê¾®¤µ¤Ê¹½Â¤ÂΤò¼õ¤±¤È¤ê³¤±¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.\"O Current executables should be linked with current libraries and never +.\"O use these calls. +¸½ºß¤Î¼Â¹Ô¥×¥í¥°¥é¥à¤Ï¸½ºß¤Î¥é¥¤¥Ö¥é¥ê¤È¥ê¥ó¥¯¤µ¤ì¤ë¤Î¤Ç¡¢ +¤³¤ì¤é¤Î¥³¡¼¥ë¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O These calls are unique to Linux and should not be used at all in new programs. +¤³¤ì¤é¤Î¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ·¤Æ +¤Ï¤¤¤±¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fstat (2), +.BR lstat (2), +.BR stat (2), +.BR uname (2), +.BR unimplemented (2) diff --git a/obsolete/man2/setregid.2 b/obsolete/man2/setregid.2 new file mode 100644 index 00000000..202e0589 --- /dev/null +++ b/obsolete/man2/setregid.2 @@ -0,0 +1,110 @@ +.\" 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. +.\" +.\" @(#)setregid.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 09:08:49 1993 by Rik Faith (faith@cs.unc.edu) +.\" Portions extracted from linux/kernel/sys.c: +.\" Copyright (C) 1991, 1992 Linus Torvalds +.\" May be distributed under the GNU General Public License +.\" Changes: Fri Jul 29 10:56:01 BST 1994 by Wilf. +.\" Tue Aug 2 14:56:48 BST 1994 by Wilf due to changes in kernel. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Mar 1 16:43:07 JST 1997 +.\" by HANATAKA Shinya +.\" +.\"WORD: effective group ID ¼Â¸ú¥°¥ë¡¼¥×ID +.\"WORD: real group ID ¼Â¥°¥ë¡¼¥×ID +.\"WORD: saved group ID Êݸ¥°¥ë¡¼¥×ID +.\"WORD: super-user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\" +.TH SETREGID 2 "2nd August 1994" "Linux 1.1.38" "Linux Programmer's Manual" +.SH ̾Á° +setregid, setegid \- ¼Â(real) ¤È ¼Â¸ú(effective)¥°¥ë¡¼¥×ID ¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int setregid(gid_t " rgid ", gid_t " egid ); +.br +.BI "int setegid(gid_t " egid ); +.SH ÀâÌÀ +.B setregid +¤Ï¸½ºß¤Î¥×¥í¥»¥¹¤Î¼Â(real)¥°¥ë¡¼¥×ID ¤È ¼Â¸ú(effective)¥°¥ë¡¼¥×ID ¤ò +ÀßÄꤹ¤ë¡£ÈóÆø¢¥æ¡¼¥¶¡¼¤¬¼Â¥°¥ë¡¼¥×ID ¤ò¼Â¸ú¥°¥ë¡¼¥×ID ¤ËÊѲ½¤µ¤»¤¿ +¤ê¤Ç¤­¤ë¡£ + +Linux 1.1.38 ¤è¤êÁ°¤Ï¡¢ +.B setregid +¤ä +.B setegid +¤¬»ÈÍѤ¹¤ëÊݸ(saved)¥°¥ë¡¼¥×ID ¥Ñ¥é¥À¥¤¥à¤Ï²õ¤ì¤Æ¤¤¤ë¡£ +1.1.38 ¤«¤é¡¢Êݸ¥°¥ë¡¼¥×ID¤«¤é¼Â¸ú¥°¥ë¡¼¥×ID ¤òÀßÄꤹ¤ë¤³¤È¤¬ +²Äǽ¤Ë¤Ê¤Ã¤¿¡£ + +¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Î¤ß¤¬Â¾¤ÎÊѹ¹¤¬¤Ç¤­¤ë¡£ + +¼Â¥°¥ë¡¼¥×ID ¤ä¼Â¸ú¥°¥ë¡¼¥×ID ¤Ë \-1 ¤òÍ¿¤¨¤¿¾ì¹ç¤Ï¡¢ +¥·¥¹¥Æ¥à¤Ï¤½¤Î ID ¤òÊѹ¹¤·¤Ê¤¤¡£ + +¸½ºß(ibc-4.x.x)¤Ç¤Ï¡¢ +.BI setegid( egid ) +¤Ïµ¡Ç½Åª¤Ë +.BI setregid( -1 , " egid" ) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ + +¤â¤·¼Â¥°¥ë¡¼¥×ID ¤¬Êѹ¹¤µ¤ì¤¿¤ê¡¢¼Â¸ú¥°¥ë¡¼¥×ID ¤¬Á°¤Î¼Â¥°¥ë¡¼¥×ID ¤È +°Û¤Ã¤¿ÃͤËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢Êݸ¥°¥ë¡¼¥×ID¤Ë¤Ï¿·¤·¤¤¼Â¸ú¥°¥ë¡¼¥×ID¤ÎÃͤ¬ +ÀßÄꤵ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.TP +.B EPERM +¸½ºß¤Î¥×¥í¥»¥¹¤¬¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ç¤Ê¤¯¡¢Êѹ¹¤¬ +(i) ¼Â¸ú¥°¥ë¡¼¥×ID ¤È ¼Â¥°¥ë¡¼¥×ID ¤òÆþ¤ì´¹¤¨¤ë¡£ +(ii) ÊÒÊý¤ÎÃͤò¾Êý¤ËÀßÄꤹ¤ë¡£ +(iii) ¼Â¸ú¥°¥ë¡¼¥×ID ¤ËÊݸ¥°¥ë¡¼¥×ID ¤ÎÃͤòÀßÄꤹ¤ë¡£ +¤Î¤¤¤º¤ì¤Ç¤â¤Ê¤¤¡£ + +.SH ½àµò +BSD 4.3 ( +.B setregid +´Ø¿ô¥³¡¼¥ë¤Ï BSD 4.2 ¤Ç¸½¤ì¤¿¡£) +.SH ´ØÏ¢¹àÌÜ +.BR getgid (2), +.BR setgid (2) diff --git a/obsolete/man2/sigblock.2 b/obsolete/man2/sigblock.2 new file mode 100644 index 00000000..af666499 --- /dev/null +++ b/obsolete/man2/sigblock.2 @@ -0,0 +1,161 @@ +.\" 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. +.\" +.\" @(#)sigblock.2 6.7 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 10:09:15 1993 by Rik Faith +.\" Modified Fri Aug 11 1995 by Stephen Lee +.\" Modified 1995 by Mike Battersby +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Mon Mar 3 23:27:30 JST 1997 +.\" by HANATAKA Shinya +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: mask ¥Þ¥¹¥¯ +.\"WORD: obsolete ÇÑ»ß +.\"WORD: block ¶Ø»ß(block) +.\"WORD: prototype ·¿Àë¸À +.\" +.TH SIGBLOCK 2 1995-08-31 "Linux 1.3" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigblock, siggetmask, sigsetmask, sigmask \- manipulate the signal mask +sigblock, siggetmask, sigsetmask, sigmask \- ¥·¥°¥Ê¥ë¤Î¥Þ¥¹¥¯¤òÁàºî¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int sigblock(int " mask ); +.sp +.B int siggetmask(void); +.sp +.BI "int sigsetmask(int " mask ); +.sp +.BI "int sigmask(int " signum ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This interface is made obsolete by +.\"O .BR sigprocmask (2). +¤³¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï +.BR sigprocmask (2) +¤Ë¤è¤Ã¤ÆÇÑ»ß (obsolete) ¤µ¤ì¤¿¡£ + +.\"O The +.\"O .BR sigblock () +.\"O system call adds the signals specified in +.\"O .I mask +.\"O to the set of signals currently being blocked from delivery. +.BR sigblock () +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï +.I mask +¤Ç»ØÄꤷ¤¿¥·¥°¥Ê¥ë¤ò¸½ºßÇÛÁ÷¤¬¶Ø»ß (block) ¤µ¤ì¤Æ¤¤¤ë +¥·¥°¥Ê¥ë¤Î½¸¹ç¤ËÄɲ乤롣 +.PP +.\"O The +.\"O .BR sigsetmask () +.\"O system call replaces the set of blocked signals totally with a new set +.\"O specified in +.\"O .IR mask . +.BR sigsetmask () +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½¸¹ç¤ò +.IR mask +¤Ç»ØÄꤵ¤ì¤¿¿·¤·¤¤½¸¹ç¤Ë´°Á´¤ËÃÖ¤­´¹¤¨¤ë¡£ +.\"O Signals are blocked if the corresponding bit in +.\"O .I mask +.\"O is a 1. +¥·¥°¥Ê¥ë¤Ï +.I mask +¤ÎÂбþ¤¹¤ë¥Ó¥Ã¥È¤¬ 1 ¤Î¾ì¹ç¤Ë¶Ø»ß¤µ¤ì¤ë¡£ +.PP +.\"O The current set of blocked signals can be obtained using +.\"O .BR siggetmask (). +¸½ºß¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½¸¹ç¤Ï +.BR siggetmask () +¤ò»ÈÍѤ·¤ÆÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\"O The +.\"O .BR sigmask () +.\"O macro is provided to construct the mask for a given +.\"O .IR signum . +.BR sigmask () +¥Þ¥¯¥í¤ÏÍ¿¤¨¤é¤ì¤¿ +.I signum +¤Î¥Þ¥¹¥¯¤òÁȤßΩ¤Æ¤ë¤¿¤á¤ËÄ󶡤µ¤ì¤ë¡£ + +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O .BR siggetmask () +.\"O returns the current set of masked signals. +.BR siggetmask () +¸½ºß¤Î¥Þ¥¹¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î½¸¹ç¤òÊÖ¤¹¡£ + +.\"O .BR sigsetmask () +.\"O and +.\"O .BR sigblock () +.\"O return the previous set of masked signals. +.BR sigsetmask () +¤È +.BR sigblock () +¤Ïº£¤Þ¤Ç¤Î¥Þ¥¹¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î½¸¹ç¤òÊÖ¤¹¡£ +.\"O .SH NOTES +.SH Ãí°Õ +.\"O Prototypes for these functions are only available if +.\"O .B _BSD_SOURCE +.\"O is defined before the inclusion of any system header file. +¤³¤ì¤é¤Î´Ø¿ô¤Î·¿Àë¸À(prototype)¤ÏÁ´¤Æ¤Î¥·¥¹¥Æ¥à¡¦¥Ø¥Ã¥À¤¬ +¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤ëÁ°¤Ë +.B _BSD_SOURCE +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ßÍ¿¤¨¤é¤ì¤ë¡£ +.PP +.\"O It is not possible to block +.\"O .B SIGKILL +.\"O or +.\"O .B SIGSTOP +.\"O \- this restriction is silently imposed by the system. +.B SIGKILL +¤ä +.B SIGSTOP +¤ò¶Ø»ß¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +\- ¤³¤ÎÀ©¸Â¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤Æ̵¸À¤Î¤¦¤Á¤ËŬÍѤµ¤ì¤ë¡£ + +.\"O .SH "CONFORMING TO" +.SH ½àµò +.\"O 4.4BSD. These function calls appeared in 4.3BSD and are deprecated. +.\"O Use the POSIX signal facilities for new programs. +4.4BSD. ¤³¤ì¤é¤Î´Ø¿ô¤Ï 4.3BSD ¤ÇÅо줷¡¢ÇÑ»ßͽÄê¤Ç¤¢¤ë¡£ +¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï POSIX ¥·¥°¥Ê¥ë¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigprocmask (2), +.BR signal (7) diff --git a/obsolete/man2/sigpause.2 b/obsolete/man2/sigpause.2 new file mode 100644 index 00000000..6037e959 --- /dev/null +++ b/obsolete/man2/sigpause.2 @@ -0,0 +1,141 @@ +.\" Copyright (C) 2004 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. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Mon Mar 3 23:33:12 JST 1997 +.\" by HANATAKA Shinya +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: interrupt ³ä¤ê¹þ¤ß +.\"WORD: mask ¥Þ¥¹¥¯ +.\"WORD: block ¥Ö¥í¥Ã¥¯¤¹¤ë +.\" +.TH SIGPAUSE 2 2004-05-10 "Linux 2.6" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigpause \- atomically release blocked signals and wait for interrupt +sigpause \- ¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤ò¥¢¥È¥ß¥Ã¥¯¤Ë²òÊü (release) ¤·¤Æ³ä¤ê¹þ¤ß (interrupt) ¤òÂÔ¤Ä +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sigpause(int " sigmask "); /* BSD */" +.sp +.BI "int sigpause(int " sig "); /* Unix95 */" +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O Don't use this function. Use +.\"O .BR sigsuspend (2) +.\"O instead. +¤³¤Î´Ø¿ô¤ò»È¤ï¤Ê¤¤¤³¤È¡£ +Âå¤ï¤ê¤Ë +.BR sigsuspend (2) +¤ò»È¤¦¤³¤È¡£ +.LP +.\"O The function +.\"O .BR sigpause () +.\"O is designed to wait for some signal. +´Ø¿ô +.BR sigpause () +¤Ï¥·¥°¥Ê¥ë¤òÂԤĤ褦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +.\"O It changes the process' signal mask (set of blocked signals), +.\"O and then waits for a signal to arrive. +¤³¤Î´Ø¿ô¤Ï¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯ (¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î¥»¥Ã¥È) ¤òÊѹ¹¤·¡¢ +¥·¥°¥Ê¥ë¤¬ÅþÃ夹¤ë¤Î¤òÂԤġ£ +.\"O Upon arrival of a signal, the original signal mask is restored. +¥·¥°¥Ê¥ë¤¬ÅþÃ夹¤ë¤È¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï¸µ¤ËÌᤵ¤ì¤ë¡£ +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O If +.\"O .BR sigpause () +.\"O returns, it was interrupted by a signal and the return value is \-1 +.\"O with +.\"O .I errno +.\"O set to +.\"O .BR EINTR . +.BR sigpause () +¤¬Ê֤俾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤Æ¤ª¤ê¡¢ +ÊÖ¤êÃÍ¤Ï \-1 ¤Ç¡¢ +.I errno +¤Ï +.B EINTR +¤ËÀßÄꤵ¤ì¤ë¡£ +.\"O .SH HISTORY +.SH ÍúÎò +.\"O The classical BSD version of this function appeared in 4.2BSD. +.\"O It sets the process' signal mask to +.\"O .IR sigmask . +¤³¤Î´Ø¿ô¤Î¸ÅŵŪ¤Ê BSD ÈÇ¤Ï 4.2BSD ¤ÇÅо줷¤¿¡£ +¤³¤Î´Ø¿ô¤Ï¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò +.I sigmask +¤ËÀßÄꤹ¤ë¡£ +.\"O When the number of signals was increased above 32, this version +.\"O was replaced by the incompatible Unix95 one, which removes only the +.\"O specified signal +.\"O .I sig +.\"O from the process' signal mask. +¥·¥°¥Ê¥ë¤Î¿ô¤¬ 32 °Ê¾å¤ËÁý²Ã¤·¤¿¤È¤­¤Ë¡¢ +BSD ÈǤϸߴ¹À­¤Î¤Ê¤¤ Unix95 ÈǤËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +Unix95 ÈǤϡ¢»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë +.I sig +¤ò¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤«¤éºï½ü¤¹¤ë¤À¤±¤Ç¤¢¤ë¡£ +.\" __xpg_sigpause: Unix 95, spec 1170, SVID, SVR4, XPG +.\"O The unfortunate situation with two incompatible functions with the +.\"O same name was solved by the +.\"O .BR \%sigsuspend (2) +.\"O function, that takes a +.\"O .B "sigset_t *" +.\"O parameter (instead of an int). +Ʊ¤¸Ì¾Á°¤Ç¸ß´¹À­¤Î¤Ê¤¤ 2 ¤Ä¤Î´Ø¿ô¤¬¤¢¤ë¤È¤¤¤¦ÉÔ¹¬¤Ê»öÂ֤ϡ¢ +.BR \%sigsuspend (2) +´Ø¿ô¤Ë¤è¤Ã¤Æ²ò¾Ã¤µ¤ì¤¿¡£ +¤³¤Î´Ø¿ô¤Ï (int ¤ÎÂå¤ï¤ê¤Ë) +.B "sigset_t *" +°ú¤­¿ô¤ò¤È¤ë¡£ +.LP +.\"O On Linux, this routine is a system call only on the Sparc (sparc64) +.\"O architecture. Libc4 and libc5 only know about the BSD version. +.\"O Glibc uses the BSD version unless _XOPEN_SOURCE is defined. +Linux ¤Ç¤Ï¡¢¤³¤Î¥ë¡¼¥Á¥ó¤Ï Sparc (sparc64) ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Î¤ß +¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +libc4 ¤È libc5 ¤Ë¤Ï BSD ÈǤ·¤«¤Ê¤¤¡£ +glibc ¤Ç¤Ï _XOPEN_SOURCE ¤¬ÄêµÁ¤µ¤ì¤Ê¤¤¸Â¤ê¡¢BSD ÈǤò»È¤¦¡£ +.\"O .\" .SH NOTE +.\"O .\" For the BSD version, one usually uses a zero +.\"O .\" .I sigmask +.\"O .\" to indicate that no signals are to be blocked. +.\" .SH Ãí°Õ +.\" BSD ÈǤǤϡ¢ +.\" .RI ¡Ö sigmask +.\" ¤ò 0 ¤Ë¤·¤Æ¡¢¤É¤Î¥·¥°¥Ê¥ë¤â¥Ö¥í¥Ã¥¯¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡× +.\" ¤È¤¤¤¦¤Î¤¬¤è¤¯»È¤ï¤ì¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigaction (2), +.BR sigblock (2), +.BR sigprocmask (2), +.BR sigsuspend (2), +.BR sigvec (2) diff --git a/obsolete/man2/sigvec.2 b/obsolete/man2/sigvec.2 new file mode 100644 index 00000000..7e44ce52 --- /dev/null +++ b/obsolete/man2/sigvec.2 @@ -0,0 +1,76 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 Tue Oct 22 22:09:26 1996 by Eric S. Raymond +.\" FIXME -- Error conditions need to be documented +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Mon Mar 3 23:37:35 JST 1997 +.\" by HANATAKA Shinya +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: obsolete ÇÑ»ß +.\" +.TH SIGVEC 2 1995-08-31 "Linux 1.3" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O sigvec \- BSD software signal facilities +sigvec \- BSD ¥½¥Õ¥È¥¦¥§¥¢¡¦¥·¥°¥Ê¥ë´Ä¶­ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #include +.sp +.BI "int sigvec(int " sig ", struct sigvec *" vec ", struct sigvec *" ovec ); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O This interface is made obsolete by +.\"O .BR sigaction (2). +¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï +.BR sigaction (2) +¤Ë¤è¤Ã¤ÆÇÑ»ß(obsolete)¤µ¤ì¤¿¡£ +.PP +.\"O Under Linux +.\"O .BR sigvec () +.\"O is #define'd to +.\"O .BR sigaction (), +.\"O and provides at best a rough approximation of the BSD +.\"O .BR sigvec () +.\"O interface. +Linux ¤Ç¤Ï +.BR sigvec () +¤Ï +.BR sigaction () +¤Ë #define ¤µ¤ì¤Æ¤ª¤ê¡¢ +Ä󶡤µ¤ì¤ë¤â¤Î¤Ï BSD +.BR sigvec () +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤È¤ÏÎɤ¯¤Æ¤â +¤ª¤ª¤¶¤Ã¤Ñ¤Ê¶á»÷¤Ë¤¹¤®¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +BSD, SVr4 +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sigaction (2), +.BR signal (2) diff --git a/obsolete/man2/sstk.2 b/obsolete/man2/sstk.2 new file mode 100644 index 00000000..acc91d6f --- /dev/null +++ b/obsolete/man2/sstk.2 @@ -0,0 +1,67 @@ +.\" From the 4.3BSD Architecture Manual - BSD copyright +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Fri Jun 25 02:23:34 JST 2004 +.\" by Yuichi SATO +.\" +.TH SSTK 2 2003-11-11 "" "BSD planned" +.\"O .SH NAME +.SH ̾Á° +.\"O sstk \- change stack size +sstk \- ¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤òÊѹ¹¤¹¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +caddr_t sstk(int incr); +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O (From the 4.3BSD Architecture Manual) +(4.3BSD ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¥Þ¥Ë¥å¥¢¥ë¤è¤ê) +.sp +.\"O Each process begins execution with three logical areas of memories +.\"O called text, data and stack. The text area is read-only and shared, +.\"O while the data and stack areas are private to the process. +³Æ¥×¥í¥»¥¹¤Ï¡¢¥Æ¥­¥¹¥È¡¦¥Ç¡¼¥¿¡¦¥¹¥¿¥Ã¥¯¤È¤¤¤¦ +¥á¥â¥ê¤Î 3 ¤Ä¤ÎÏÀÍýÎΰè¤òÊÝ»ý¤·¤Æ¼Â¹Ô¤ò³«»Ï¤¹¤ë¡£ +¥Æ¥­¥¹¥ÈÎΰè¤ÏÆɤ߹þ¤ßÀìÍѤǶ¦Í­¤µ¤ì¤ë¡£ +°ìÊý¡¢¥Ç¡¼¥¿Îΰè¤È¥¹¥¿¥Ã¥¯Îΰè¤Ï¥×¥í¥»¥¹¤¬¸ø³«¤·¤Ê¤¤Îΰè¤Ç¤¢¤ë¡£ +.\"O Both the data and stack areas may be extended and contracted on +.\"O program request. The call +¥Ç¡¼¥¿Îΰè¤È¥¹¥¿¥Ã¥¯Îΰè¤Ï¥×¥í¥°¥é¥à¤ÎÍ×µá¤Ë¤è¤ê³ÈÂ硦½Ì¾®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¸Æ¤Ó½Ð¤· +.sp +.in +5 +caddr_t addr = sbrk(incr); +.in +.sp +.\"O changes the size of the data area by +.\"O .I incr +.\"O bytes and returns the new end of the data area, while +¤Ï¥Ç¡¼¥¿Îΰè¤Î¥µ¥¤¥º¤ò +.I incr +¥Ð¥¤¥È¤ËÊѹ¹¤·¡¢¥Ç¡¼¥¿Îΰè¤Î¿·¤·¤¤½ªÃ¼¤òÊÖ¤¹¡£ +°ìÊý¡¢ +.sp +.in +5 +caddr_t addr = sstk(incr); +.in +.sp +.\"O changes the size of the stack area. The stack area is also automatically +.\"O extended as needed. On the VAX the text and data areas are adjacent +.\"O in the P0 region, while the stack section is in the P1 region, and +.\"O grows downward. +¤Ï¥¹¥¿¥Ã¥¯Îΰè¤Î¥µ¥¤¥º¤òÊѹ¹¤¹¤ë¡£ +¥¹¥¿¥Ã¥¯Îΰè¤ÏɬÍפ˱þ¤¸¤Æ¼«Æ°Åª¤Ë³ÈÂ礵¤ì¤¿¤ê¤â¤¹¤ë¡£ +VAX ¤Ç¤Ï¡¢¥Æ¥­¥¹¥ÈÎΰè¤È¥Ç¡¼¥¿Îΰè¤Ï P0 Îΰè¤ÎÎÙ¤ê¹ç¤Ã¤¿¾ì½ê¤Ë¤¢¤ë¡£ +¤Þ¤¿¥¹¥¿¥Ã¥¯¶è²è¤Ï P1 Îΰè¤Ë¤¢¤Ã¤Æ¡¢²¼Êý¤ØÀ®Ä¹¤¹¤ë¡£ +.\"O .SH NOTE +.SH Ãí°Õ +.\"O This call is not supported in 4.3BSD or 4.4BSD or glibc or Linux or any +.\"O other known Unix-like system. Some systems have a routine of this name +.\"O that returns ENOSYS. +¤³¤Î¸Æ¤Ó½Ð¤·¤Ï 4.3BSD, 4.4BSD, glibc, Linux, +¤½¤Î¾¤ÎÃΤé¤ì¤Æ¤¤¤ë Unix ·Ï¥·¥¹¥Æ¥à¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤¡£ +ENOSYS ¤òÊÖ¤¹¤è¤¦¤Ê¤³¤Î̾Á°¤Î¥ë¡¼¥Á¥ó¤ò»ý¤Ã¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR sbrk (2) diff --git a/obsolete/man2/undocumented.2 b/obsolete/man2/undocumented.2 new file mode 100644 index 00000000..8d663476 --- /dev/null +++ b/obsolete/man2/undocumented.2 @@ -0,0 +1,35 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This page is in the public domain. +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved. +.\" Translated Mon Mar 5 2003 by Akihiro MOTOKI +.\" +.TH UNDOCUMENTED 2 2003-02-01 "Linux" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +madvise1, +rt_sigaction, +rt_sigpending, +rt_sigprocmask, +rt_sigqueueinfo, +rt_sigreturn, +rt_sigsuspend, +rt_sigtimedwait, +ugetrlimit +.\"O \- undocumented system calls +¥É¥­¥å¥á¥ó¥È¤¬¤Ê¤¤¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.\"O Undocumented system calls. +¥É¥­¥å¥á¥ó¥È¤¬¤Ê¤¤¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë +.\"O .SH DESCRIPTION +.\"O The 2.4.20 kernel knows 253 syscalls for the i386 architecture. +.\"O The above ones have not yet been documented. +.SH ÀâÌÀ +¥«¡¼¥Í¥ë 2.4.20 ¤Ë¤Ï¡¢i386 ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç 253 ¸Ä¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬¤¢¤ë¡£ +¾åµ­¤Î¤â¤Î¤Ë¤Ä¤¤¤Æ¤Ï¤Þ¤À¥É¥­¥å¥á¥ó¥È¤¬ºîÀ®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR obsolete (2), +.BR syscalls (2), +.BR unimplemented (2) diff --git a/obsolete/man3/atol.3 b/obsolete/man3/atol.3 new file mode 100644 index 00000000..bbdd06e8 --- /dev/null +++ b/obsolete/man3/atol.3 @@ -0,0 +1,60 @@ +.\" 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 Mon Mar 29 22:40:19 1993, David Metcalfe +.\" Modified Sat Jul 24 21:37:44 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 +.\" +.TH ATOL 3 "March 29, 1993" "GNU" "Linux Programmer's Manual" +.SH ̾Á° +atol \- ʸ»úÎó¤òlong int·¿¤ËÊÑ´¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long atol(const char *" nptr ); +.fi +.SH ÀâÌÀ +\fBatol()\fP´Ø¿ô¤Ï¡¢\fInptr\fP¤Ë¤è¤Ã¤Æ»Ø¼¨¤µ¤ì¤ëʸ»úÎó¤Î¤Ï¤¸¤á¤ÎÉôʬ¤ò +long int·¿À°¿ô¤ËÊÑ´¹¤¹¤ë¡£ +¤³¤Î¿¶¤ëÉñ¤¤¤Ï¡¢ +\fBatol()\fP´Ø¿ô¤¬¥¨¥é¡¼¤ò¸«¤Ä¤±¤Ê¤¤¤³¤È¤ò½ü¤¤¤Æ¤Ï¡¢ +.sp +.RS +.B strtol(nptr, (char **)NULL, 10); +.RE +.sp +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.SH "ÊÖ¤êÃÍ" +ÊÑ´¹¤µ¤ì¤¿ÃÍ +.SH "½àµò" +SVID 3, POSIX, BSD 4.3, ISO 9899 +.SH "´ØÏ¢¹àÌÜ" +.BR atof "(3), " atoi "(3), " strtod "(3), " strtol "(3), " strtoul (3) diff --git a/obsolete/man3/isinf.3 b/obsolete/man3/isinf.3 new file mode 100644 index 00000000..c72d2fbf --- /dev/null +++ b/obsolete/man3/isinf.3 @@ -0,0 +1,82 @@ +.\" 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-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) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated Tue Feb 17 10:58:21 JST 1998 +.\" by YOSHINO Takashi +.\" Updated Sun Sep 14 JST 2003 by Kentaro Shirakata +.\" +.TH ISINF 3 2002-07-27 "" "Linux Programmer's Manual" +.SH ̾Á° +isinf, isnan, finite \- ̵¸ÂÂç¤ä̵¸úÃÍ(NaN)¤Ç¤¢¤ë¤«¤ò¥Æ¥¹¥È¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int isinf(double " value ); +.sp +.BI "int isinf(double " value ); +.sp +.BI "int isnan(double " value ); +.sp +.BI "int finite(double " value ); +.fi +.SH ÀâÌÀ +\fBisinf()\fP ´Ø¿ô¤Ï¡¢ +\fIvalue\fP ¤¬Éé¤Î̵¸ÂÂç¤òɽ¤¹¾ì¹ç¤Ë¤Ï \-1 ¤ò¡¢ +\fIvalue\fP ¤¬Àµ¤Î̵¸ÂÂç¤òɽ¤¹¾ì¹ç¤Ë¤Ï 1 ¤ò¡¢ +¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.PP +\fBisnan()\fP ´Ø¿ô¤Ï¡¢ +\fIvalue\fP¤¬"¿ôÃͤǤϤʤ¤(not-a-number)"(NaN:̵¸úÃÍ)¾ì¹ç¤Ë¤Ï +¥¼¥í¤Ç¤Ï¤Ê¤¤ÃͤòÊÖ¤·¡¢¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.PP +.\"O The \fBfinite()\fP function returns a non-zero value if \fIvalue\fP is +.\"O neither infinite nor a "not-a-number" (NaN) value, and 0 otherwise. +\fBfinite()\fP ´Ø¿ô¤Ï¡¢\fIvalue\fP ¤¬Ìµ¸ÂÂ礫 "¿ôÃͤǤϤʤ¤"(NaN)ÃͤΠ+¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤·¡¢¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï¥¼¥í¤Ç¤Ï¤Ê¤¤ÃͤòÊÖ¤¹¡£ +.\"O .SH NOTE +.SH Ãí°Õ +.\"O C99 provides additional macros, such as the type-independent +.\"O .BR fpclassify() , +.\"O .BR isinf() +.\"O and +.\"O .BR isnan() . +C99 ¤Ï +.BR fpclassify() , +.BR isinf() , +.B isnan() +¤È¤¤¤¦¡¢·¿¤Ë°Í¸¤·¤Ê¤¤ÄɲäΥޥ¯¥í¤òÄ󶡤·¤Æ¤¤¤ë¡£ +.SH ½àµò +BSD 4.3 +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR fpclassify (3) diff --git a/obsolete/man3/killpg.3 b/obsolete/man3/killpg.3 new file mode 100644 index 00000000..d3fb7961 --- /dev/null +++ b/obsolete/man3/killpg.3 @@ -0,0 +1,112 @@ +.\" (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:04:55 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2004-11-11, Michael Kerrisk, +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Fri Dec 26 15:29:06 JST 1997 +.\" by HIROFUMI Nishizuka +.\" Updated & Modified Thu Feb 17 00:17:33 JST 2005 +.\" by Yuichi SATO +.\" +.TH KILLPG 3 1993-04-04 "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O killpg \- send signal to all members of a process group +killpg \- ¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int killpg(pid_t " pgrp ", int " signal ); +.fi +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O The +.\"O .BR killpg () +.\"O function causes signal +.\"O .I signal +.\"O to be sent to all the processes in the process group +.\"O .I pgrp +.\"O or to the processes' own process group if +.\"O .I pgrp +.\"O is equal to zero. +.BR killpg () +´Ø¿ô¤Ï¡¢¥×¥í¥»¥¹¥°¥ë¡¼¥× +.I pgrp +¤ÎÁ´¤Æ¤Î¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë +.I signal +¤òÁ÷¤ë¡£ +¤â¤· +.I pgrp +¤¬ 0 ¤Ê¤é¤Ð¡¢¤½¤Î¥×¥í¥»¥¹¼«¿È¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.PP +.\"O If +.\"O .I pgrp +.\"O is greater than 1, it is equivalent to: +.I pgrp +¤¬ 1 ¤è¤êÂ礭¤¤¾ì¹ç¤Ï¡¢°Ê²¼¤Î¸Æ¤Ó½Ð¤·¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.nf +.sp +.in +0.5i +.B kill(\-pgrp , signal); +.in -0.5i +.fi +.\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +.\"O The value returned is \-1 on error, or 0 for success. +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï \-1 ¤¬¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\"O .SH ERRORS +.SH ¥¨¥é¡¼ +.\"O Errors are returned in +.\"O .I errno +.\"O and can be one of the following: +°Ê²¼¤Ë¼¨¤¹¥¨¥é¡¼¤Î°ì¤Ä¤¬ +.I errno +¤ËÊÖ¤µ¤ì¤ë: +.TP +.B EINVAL +.\"O for an invalid signal, +¥·¥°¥Ê¥ë¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.TP +.B EPERM +.\"O if the userid of the calling process is not equal to that of the +.\"O process the signal is sent to, and the userid is not that of the +.\"O superuser. +¸Æ¤Ó½Ð¤·¥×¥í¥»¥¹¤Î¥æ¡¼¥¶ ID ¤¬¡¢¥·¥°¥Ê¥ë¤òÁ÷¤é¤ì¤ë¥×¥í¥»¥¹¤Î¥æ¡¼¥¶ ID ¤È +°ìÃפ»¤º¡¢¤«¤Ä¥æ¡¼¥¶ ID ¤¬¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Î ID ¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ESRCH +.\"O for a process group which does not exist, and +¥×¥í¥»¥¹¥°¥ë¡¼¥×¤¬Â¸ºß¤·¤Ê¤¤¡£ +.\"O .SH "CONFORMING TO" +.SH ½àµò +SUSv2, POSIX.1-2001 +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR signal (2), +.BR sigqueue (2), +.BR signal (7) diff --git a/obsolete/man3/labs.3 b/obsolete/man3/labs.3 new file mode 100644 index 00000000..672a2526 --- /dev/null +++ b/obsolete/man3/labs.3 @@ -0,0 +1,55 @@ +.\" 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 Mon Mar 29 22:43:34 1993, David Metcalfe +.\" Modified Sun Jun 6 23:28:55 1993, David Metcalfe +.\" Modified Sat Jul 24 19:04:14 1993, Rik Faith (faith@cs.unc.edu) +.\" +.\" +.\" Japanese Version Copyright (c) 1997 Takashi YOSHINO +.\" all rights reserved. +.\" Translated Tue Jan21 21:20:00 JST 1997 +.\" by Takashi YOSHINO +.\" +.TH LABS 3 "June 6, 1993" "GNU" "Linux Programmer's Manual" +.SH ̾Á° +labs \- ¥í¥ó¥°À°¿ô¤ÎÀäÂÐÃͤò·×»»¤¹¤ë¡¥ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long int labs(long int " j ); +.fi +.SH ÀâÌÀ +\fBlabs()\fP ´Ø¿ô¤Ï¥í¥ó¥°À°¿ô¤Î°ú¿ô\fIj\fP¤ÎÀäÂÐÃͤò·×»»¤¹¤ë¡¥ +.SH "ÊÖ¤êÃÍ" +¥í¥ó¥°À°¿ô¤Î°ú¿ô¤ÎÀäÂÐÃͤòÊÖ¤¹¡¥ +.SH "½àµò" +SVID 3, BSD 4.3, ISO 9899 +.SH Ãí°Õ +ÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ëºÇ¤â¾®¤µ¤¤Éé¤ÎÀ°¿ô¤ÎÀäÂÐÃͤÎÂ礭¤µ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡¥ +.SH "´ØÏ¢¹àÌÜ" +.BR abs "(3), " ceil "(3), " floor "(3), " fabs "(3), " rint (3) diff --git a/obsolete/man3/mblen.3 b/obsolete/man3/mblen.3 new file mode 100644 index 00000000..c61b1b59 --- /dev/null +++ b/obsolete/man3/mblen.3 @@ -0,0 +1,59 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Tue Dec 16 10:10:46 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. +.\" +.\" 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:59:43 1993 by Rik Faith (faith@cs.unc.edu) +.TH MBLEN 3 "March 29, 1993" "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mblen \- °ìʸ»ú¤¢¤¿¤ê¤Î¥Ð¥¤¥È¿ô¤òµá¤á¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int mblen(const char *" s ", size_t " n ); +.fi +.SH ÀâÌÀ +\fBmblen()\fP ´Ø¿ô¤Ïʸ»úÎó \fIs\fP ¤ÎºÇ½é¤Î \fIn\fP ¥Ð¥¤¥È¤ò¥¹¥­¥ã¥ó¤·¡¢ +°ìʸ»ú¤¢¤¿¤ê¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +\fBmblen()\fP ´Ø¿ô¤Ï°Ê²¼¤Î´Ø¿ô¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.sp +.RS +mbtowc((wchat_t *)0, s, n); +.RE +.sp +¤¿¤À¤·¡¢\fBmbtowc()\fP ´Ø¿ô¤Î¥·¥Õ¥È¾õÂ֤αƶÁ¤ò¼õ¤±¤Ê¤¤¡£ +.SH "ÊÖ¤êÃÍ" +\fBmblen()\fP ¤Ï°ìʸ»ú¤¢¤¿¤ê¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¤â¤·Ê¸»ú¤¬Ìµ¸ú¤â¤·¤¯¤Ï 0 ¡¢¤Þ¤¿ \fIs\fP ¤¬ NULL ¤Ê¤é¤Ð \-1 ¤òÊÖ¤¹¡£ +.SH "½àµò" +SVID 3, ISO 9899 +.SH "´ØÏ¢¹àÌÜ" +.BR mbstowcs "(3), " mbtowc "(3), " wcstombs "(3), " wctomb (3) + diff --git a/obsolete/man3/mbstowcs.3 b/obsolete/man3/mbstowcs.3 new file mode 100644 index 00000000..94c64c6a --- /dev/null +++ b/obsolete/man3/mbstowcs.3 @@ -0,0 +1,52 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Tue Dec 16 10:24:55 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. +.\" +.\" 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:59:02 1993 by Rik Faith (faith@cs.unc.edu) +.TH MBSTOWCS 3 "March 29, 1993" "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mbstowcs \- ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t mbstowcs(wchar_t *" pwcs ", const char *" s ", size_t " n ); +.fi +.SH ÀâÌÀ +\fBmbstowcs()\fP ´Ø¿ô¤ÏÇÛÎó \fIs\fP ¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ÎÎó¤ò¥ï¥¤¥Éʸ»ú¤ÎÎó¤Ë +ÊÑ´¹¤·¡¢ÇÛÎó \fIpwcs\fP ¤Ë \fIn\fP ¥Ð¥¤¥È¤Þ¤Ç³ÊǼ¤¹¤ë¡£ +.SH "ÊÖ¤êÃÍ" +\fBmbstowcs()\fP ¤Ï³ÊǼ¤µ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +¤â¤· \fIs\fP ¤¬Ìµ¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò´Þ¤à¾ì¹ç¡¢\-1 ¤òÊÖ¤¹¡£ +.SH "½àµò" +SVID 3, ISO 9899 +.SH "´ØÏ¢¹àÌÜ" +.BR mblen "(3), " mbtowc "(3), " wcstombs "(3), " wctomb (3) + diff --git a/obsolete/man3/mbtowc.3 b/obsolete/man3/mbtowc.3 new file mode 100644 index 00000000..feb1ba30 --- /dev/null +++ b/obsolete/man3/mbtowc.3 @@ -0,0 +1,53 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Tue Dec 16 10:28:46 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. +.\" +.\" 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:58:18 1993 by Rik Faith (faith@cs.unc.edu) +.TH MBTOWC 3 "March 29, 1993" "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mbtowc \- ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int mbtowc(wchar_t *" pwc ", const char *" s ", size_t " n ); +.fi +.SH ÀâÌÀ +\fBmbtowc()\fP ´Ø¿ô¤Ï \fIn\fP ¥Ð¥¤¥È¤ò±Û¤¨¤Ê¤¤¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú \fIs\fP ¤ò +¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤·¡¢\fIpwc\fP ¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¤Ï¥ï¥¤¥Éʸ»ú¤ò \fIpwc\fP +¤Ë³ÊǼ¤¹¤ë¡£ +.SH "ÊÖ¤êÃÍ" +\fBmbtowc()\fP ¤Ï¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¤â¤·¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤¬Í­¸ú¤Ç¤Ê¤±¤ì¤Ð \-1 ¤òÊÖ¤¹¡£ +.SH "½àµò" +SVID 3, ISO 9899 +.SH "´ØÏ¢¹àÌÜ" +.BR mblen "(3), " mbstowcs "(3), " wcstombs "(3), " wctomb (3) + diff --git a/obsolete/man3/readv.3 b/obsolete/man3/readv.3 new file mode 100644 index 00000000..308188d2 --- /dev/null +++ b/obsolete/man3/readv.3 @@ -0,0 +1,113 @@ +.\" (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 18:34:44 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1998 Shigeru Tada +.\" all rights reserved. +.\" Translated Mon, 25 May 1998 +.\" by Shigeru Tada +.\" +.TH READV 3 "April 25, 1993" "GNU" "Linux Programmer's Manual" +.SH ̾Á° +readv, writev \- Ê£¿ô¤Î¥Ð¥Ã¥Õ¥¡¡¼¤òÍѤ¤¤¿¥Õ¥¡¥¤¥ëÆþ½ÐÎÏ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int readv(int " filedes ", const struct iovec *" vector , +.BI " size_t " count ); +.sp +.BI "int writev(int " filedes ", const struct iovec *" vector , +.BI " size_t " count ); +.fi +.SH ÀâÌÀ +.B readv() +´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼\fIfiledes\fP¤ËÏ¢·ë¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤«¤é +\fIcount\fP¥Ö¥í¥Ã¥¯¤ò¡¢\fIvector\fP¤Ç»ØÄꤵ¤ì¤¿Ê£¿ô¤Î¥Ð¥Ã¥Õ¥¡¡¼¤ËÆÉ +¤ß¹þ¤à¡£ +.PP +\fBwritev()\fP´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼\fIfiledes\fP +¤ËÏ¢·ë¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë\fIvector\fP¥Ý¥¤¥ó¥¿¤Ç»ØÄꤵ¤ì¤¿ºÇÂç +\fIcount\fP¥Ö¥í¥Ã¥¯¤Þ¤Ç¤ò¥Ð¥Ã¥Õ¥¡¡¼¤«¤é½ñ¤­¹þ¤à¡£ +.PP +.I vector +¥Ý¥¤¥ó¥¿¤Ï +.PP +.br +.nf +.in 10 +struct iovec { +.in 14 +void *iov_base; /* Starting address */ +size_t iov_len; /* Number of bytes */ +.in 10 +} ; +.fi +.PP +¤Î¤è¤¦¤Ë\fB\fP¤ÎÃæ¤ÇÄêµÁ¤µ¤ì¤ë¹½Â¤ÂÎ\fBiovec\fP¤ò»Ø¤¹¡£ +.PP +¥Ð¥Ã¥Õ¥¡¤Ï +.IR "vector[0]" ", " vector[1] ", ... " "vector[count-1]" . +¤Î½ç¤Ç½èÍý¤µ¤ì¤ë¡£ +.PP +\fBreadv()\fP´Ø¿ô¤ÏÊ£¿ô¤Î¥Ð¥Ã¥Õ¥¡¡¼¤ËÆɤ߹þ¤à¤È¤¤¤¦¤³¤È¤ò½ü¤±¤Ð¡¢ +\fBread(2)\fP¤È¤Þ¤Ã¤¿¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ +.PP +\fBwritev()\fP´Ø¿ô¤ÏÊ£¿ô¤Î¥Ð¥Ã¥Õ¥¡¡¼¤«¤é½ñ¤­¹þ¤à¤È¤¤¤¦¤³¤È¤ò½ü¤±¤Ð¡¢ +\fBwrite(2)\fP¤È¤Þ¤Ã¤¿¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +\fBreadv()\fP´Ø¿ô¤Ï½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +\fBwritev()\fP´Ø¿ô¤ÏÆɤ߹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +\fBreadv()\fP¤È\fBwritev()\fP´Ø¿ô¤Ï¼ºÇÔ¤·¤¿¾ì¹ç\fIerrno\fP¤ò°Ê²¼¤ÎÃÍ¤Ë +ÀßÄꤹ¤ë¡£ +.TP +.B EBADDF +\fI fd\fP¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ï¤Ê¤¤ +.TP +.B EINVAL +\fI fd\fP¤¬¡Ê\fBR readv()\fP¤Î¾ì¹ç¡ËÆɤ߹þ¤á¤Ê¤¤¤«¡¢ +¡Ê\fBR writev()\fP¤Î¾ì¹ç¡Ë½ñ¤­¹þ¤á¤Ê¤¤¡£ +.TP +.B EFAULT +\fI buf\fP¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Ë¤¢¤ë¡£ +.TP +.B EAGAIN +\fB open()\fP´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹»þ¤ËÈóÄä»ß(Non-blocking) I/O ¤¬ÁªÂò¤µ¤ì¤Æ¤ª¤ê¡¢ +¤¹¤°¤Ë¥Ç¡¼¥¿¤¬Æɤ߹þ¤ß²Äǽ¤Ç¤Ï¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINTR +¥Ç¡¼¥¿¤¬°ú¤­ÅϤµ¤ì¤ëÁ°¤Ë¡¢Æɤߤ³¤ß¤¢¤ë¤¤¤Ï½ñ¤­¹þ¤ß¤Ø¤Î +³ä¤ê¹þ¤ß¤¬¤ª¤³¤Ã¤¿¡£ +.SH ½àµò +ÉÔÌÀ +.SH ¥Ð¥° +\fBR readv() "¤¢¤ë¤¤¤Ï" writev()\fP¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤ò +Áàºî¤¹¤ë´Ø¿ô¤ò¡¢stdio¥é¥¤¥Ö¥é¥ê¡¼¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë´Ø¿ô¤ÈÁȤ߹ç¤ï¤»¤Æ¸Æ +¤Ó½Ð¤¹¤³¤È¤Ï¿ä¾©¤Ç¤­¤Ê¤¤¡£¤½¤Î·ë²Ì¤ÏÄêµÁ¤µ¤ì¤Ê¤¤¤â¤Î¤Ç¤¢¤ê¡¤¤ª¤½¤é¤¯ +´üÂÔ¤·¤¿·ë²Ì¤ÏÆÀ¤é¤ì¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR read (2), +.BR write (2) diff --git a/obsolete/man3/snprintf.3 b/obsolete/man3/snprintf.3 new file mode 100644 index 00000000..ee81f063 --- /dev/null +++ b/obsolete/man3/snprintf.3 @@ -0,0 +1,135 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" (c) 1995 by Jim Van Zandt +.\" +.\" 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. +.\" +.\" Added _GNU_SOURCE, aeb, Sat Jul 5 23:10:04 MET 1997 +.\" +.\" Japanese Version Copyright (c) 1998 Akihiro Motoki all rights reserved. +.\" Translated Mon May 25 1998 by Akihiro Motoki +.\" Modified Thu Nov 11 1999 by Akihiro Motoki +.\" +.TH SNPRINTF 3 "16 September 1995" "GNU" "Linux Programmer's Manual" +.\"O .SH NAME +.\"O .snprintf, vsnprintf \- formatted output conversion +.SH ̾Á° +snprintf, vsnprintf \- »ØÄꤷ¤¿½ñ¼°¤Ç½ÐÎϤò¹Ô¤¦ +.\"O .SH SYNOPSIS +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int snprintf ( char *" str ", size_t " n ", " +.br +.BI " const char *" format ", ... );" +.sp +.B #include +.sp +.BI "int vsnprintf ( char *" str ", size_t " n ", " +.br +.BI " const char *" format ", va_list " ap " );" +.\"O .SH DESCRIPTION +.\"O \fBsnprintf\fP writes output to the string \fIstr\fP, under control of +.\"O the \fIformat\fP string that specifies how subsequent arguments are +.\"O converted for output. It is similar to \fBsprintf\fP(3), except that +.\"O \fIn\fP specifies the maximum number of characters to produce. The +.\"O trailing null character is counted towards this limit, so you should +.\"O allocate at least \fIn\fP characters for the string \fIstr\fP. +.SH ÀâÌÀ +\fBsnprintf\fP ´Ø¿ô¤Ï¡¢\fIformat\fP ¤Ç»ØÄꤵ¤ì¤¿½ñ¼°¤Ë½¾¤¤¡¢¤½¤ì°Ê¹ß¤Ë +Í¿¤¨¤é¤ì¤¿°ú¿ô¤òÀ°·Á¤·¤Æ½ÐÎϤ·¡¢½ÐÎϤÏʸ»úÎó \fIstr\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +¤³¤Î´Ø¿ô¤Ï \fBsprintf\fP(3) ¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ ½ÐÎϤµ¤ì¤ë +ºÇÂçʸ»ú¿ô \fIn\fP ¤ò»ØÄê¤Ç¤­¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +ʸ»úÎó¤Î½ªÃ¼¤ò¼¨¤¹¥Ì¥ëʸ»ú¤âºÇÂçʸ»ú¿ô¤Ë´Þ¤Þ¤ì¤ë¤¿¤á¡¢ +½ÐÎÏʸ»úÎó \fIstr\fP ¤Ë¤Ï¾¯¤Ê¤¯¤È¤â \fIn\fP ʸ»ú³ä¤êÅö¤Æ¤ëɬÍפ¬¤¢¤ë¡£ +.PP +.\"O \fBvsnprintf\fP is the equivalent of \fBsnprintf\fP with the variable +.\"O argument list specified directly as for \fBvprintf\fP. +\fBvsnprintf\fP ´Ø¿ô¤Ï²ÄÊѤΰú¿ô¥ê¥¹¥È¤ò¤â¤Ã¤¿ \fBsnprintf\fP ¤ÈÅù²Á¤Ç¤¢¤ë¡£ +°ú¿ô¥ê¥¹¥È¤Ë¤Ä¤¤¤Æ¤Ï \fBvprintf\fP ¤Î¹à¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"O .SH "RETURN VALUE" +.\"O If the output was truncated, the return value is -1, otherwise it is +.\"O the number of characters stored, not including the terminating null. +.\"O (Thus until glibc 2.0.6. Since glibc 2.1 these functions +.\"O return the number of characters (excluding the trailing null) +.\"O which would have been written to the final string if enough space +.\"O had been available.) +.SH ÊÖ¤êÃÍ +½ÐÎϤ¬Ä¹¤¯ÅÓÃæ¤Ç¥«¥Ã¥È¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï -1 ¤òÊÖ¤·¡¢¤½¤ì°Ê³°¤Ï \fIstr\fP ¤ËÊݸ +¤µ¤ì¤¿Ê¸»ú¿ô(ʸ»úÎó¤Î½ªÃ¼¤ò¼¨¤¹'\e0'¤ò½ü¤¯)¤òÊÖ¤¹¡£ +(⤷ glibc 2.0.6 ¤Þ¤Ç¤Î»ÅÍͤǤ¢¤ë¡£ +glibc 2.1 °Ê¹ß¤Ç¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤â¤·ÍøÍѲÄǽ¤Ê½½Ê¬¤Ê¥¹¥Ú¡¼¥¹¤¬¤¢¤ì¤Ð +½ñ¤­¹þ¤Þ¤ì¤¿¤Ç¤¢¤í¤¦Ê¸»ú¿ô(ʸ»úÎó¤Î½ªÃ¼¤ò¼¨¤¹'\e0'¤ò½ü¤¯)¤òÊÖ¤¹¡£) +.\"O .SH EXAMPLE +.SH Îã +.br +.\"O Here is an example program which dynamically enlarges its output buffer, +.\"O and works correctly under both glibc 2.0 and glibc 2.1. +½ÐÎϥХåե¡¤òưŪ¤Ë³ÈÄ¥¤¹¤ë¥×¥í¥°¥é¥àÎã¤ò°Ê²¼¤Ë¼¨¤¹¡£ +¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢glibc 2.0 ¤È glibc 2.1 ¤Î¤É¤Á¤é¤Ç¤âÀµ¤·¤¯Æ°ºî¤¹¤ë¡£ +.br +.sp +.nf +.\"O /* Construct a message describing the value of a +.\"O variable whose name is NAME and whose value is +.\"O VALUE. */ + /* ÊÑ¿ô̾¤È¤½¤ÎÃͤòµ­½Ò¤¹¤ë "value of ÊÑ¿ô̾ is ÃÍ" + ¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤¹¤ë´Ø¿ô */ + char * + make_message (char *name, char *value) + { +.\"O /* Guess we need no more than 100 chars of space. */ + /* ½ÐÎϥХåե¡¤Ï100ʸ»úʬ¤Ç½½Ê¬¤Ç¤¢¤ë¤È²¾Äê */ + int size = 100; + char *buffer = (char *) xmalloc (size); + while (1) + { +.\"O /* Try to print in the allocated space. */ + /* ³ÎÊݺѤߤΥХåե¡¤Ë½ÐÎϤ·¤è¤¦¤È¤¹¤ë */ + int nchars = snprintf (buffer, size, + "value of %s is %s", name, value); +.\"O /* If that worked, return the string. */ + /* À®¸ù¤¹¤ì¤Ð¡¢¥Ð¥Ã¥Õ¥¡Æâ¤Îʸ»úÎó¤òÊÖ¤¹ */ + if (nchars > -1 && nchars < size) + return buffer; +.\"O /* Else try again with more space. */ +.\"O if (nchars > -1) +.\"O size = nchars+1; /* precisely what is needed */ +.\"O else +.\"O size *= 2; /* twice the old size */ + /* ¼ºÇÔ¤¹¤ì¤Ð¡¢¤µ¤é¤Ë¥Ð¥Ã¥Õ¥¡¤ò³ÎÊݤ·¤ÆºÆ»î¹Ô */ + if (nchars > -1) + size = nchars+1; /* ɬÍפʥХåե¡Ä¹¤òÀµ³Î¤Ë³ÎÊÝ */ + else + size *= 2; /* ¥Ð¥Ã¥Õ¥¡Ä¹¤ò£²Çܤˤ¹¤ë */ + buffer = (char *) xrealloc (buffer, size); + } + } +.fi +.RE +.\"O .SH "CONFORMING TO" +.\"O These are GNU extensions, expected to become part of ISO C9x. +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ISO C9x ¤Î°ìÉô¤È¤Ê¤ëͽÄê¤Ç¤¢¤ë¡£ +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR printf "(3), " sprintf "(3), " vsprintf "(3), " stdarg (3) diff --git a/obsolete/man3/wcstombs.3 b/obsolete/man3/wcstombs.3 new file mode 100644 index 00000000..1dbf7bee --- /dev/null +++ b/obsolete/man3/wcstombs.3 @@ -0,0 +1,53 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Tue Dec 16 10:29: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. +.\" +.\" 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 17:42:04 1993 by Rik Faith (faith@cs.unc.edu) +.TH WCSTOMBS 3 "March 29, 1993" "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcstombs \- ¥ï¥¤¥Éʸ»úÎó¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t wcstombs(char *" s ", const wchar_t *" pwcs ", size_t " n ); +.fi +.SH ÀâÌÀ +\fBwcstombs()\fP ´Ø¿ô¤Ï \fIpwcs\fP ¤Ç¼¨¤µ¤ì¤ëÇÛÎó¤Î¥ï¥¤¥Éʸ»ú¤ÎÎó¤ò +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ÎÎó¤ËÊÑ´¹¤·¡¢ÇÛÎó \fIs\fP ¤Ë \fIn\fP ʸ»ú¤Þ¤Ç¤Î¥Þ¥ë¥Á +¥Ð¥¤¥Èʸ»ú¤ò³ÊǼ¤¹¤ë¡£ +.SH "ÊÖ¤êÃÍ" +\fBwcstombs()\fP ¤Ï \fIs\fP ¤Ë³ÊǼ¤µ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¤â¤·\fIpwcs\fP ¤¬Ìµ¸ú¤Ê¥ï¥¤¥Éʸ»ú¤ò´Þ¤à¾ì¹ç¡¢\-1 ¤òÊÖ¤¹¡£ +.SH "½àµò" +SVID 3, ISO 9899 +.SH "´ØÏ¢¹àÌÜ" +.BR mblen "(3), " mbtowc "(3), " mbstowcs "(3), " wctomb (3) + diff --git a/obsolete/man3/wctomb.3 b/obsolete/man3/wctomb.3 new file mode 100644 index 00000000..b96b3135 --- /dev/null +++ b/obsolete/man3/wctomb.3 @@ -0,0 +1,53 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Tue Dec 16 10:30:17 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. +.\" +.\" 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 17:41:18 1993 by Rik Faith (faith@cs.unc.edu) +.TH WCTOMB 3 "March 29, 1993" "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wctomb \- ¥ï¥¤¥Éʸ»ú¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int wctomb(char *" s ", wchar_t " wchar ); +.fi +.SH ÀâÌÀ +\fBwctomb()\fP ´Ø¿ô¤Ï¥ï¥¤¥Éʸ»ú \fIwchar\fP ¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ËÊÑ´¹¤·¡¢ +¤â¤· \fIs\fP ¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¤½¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò \fIs\fP ¤Ç +¼¨¤µ¤ì¤ë°ÌÃ֤˳ÊǼ¤¹¤ë¡£ +.SH "ÊÖ¤êÃÍ" +\fBwctomb()\fP ¤Ï¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥ï¥¤¥Éʸ»ú¤¬Í­¸ú¤Ç¤Ê¤¤¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.SH "½àµò" +SVID 3, ISO 9899 +.SH "´ØÏ¢¹àÌÜ" +.BR mblen "(3), " mbstowcs "(3), " mbtowc "(3), " wcstombs (3) + diff --git a/obsolete/man5/lilo.conf.5 b/obsolete/man5/lilo.conf.5 new file mode 100644 index 00000000..9ebb2790 --- /dev/null +++ b/obsolete/man5/lilo.conf.5 @@ -0,0 +1,456 @@ +.\" @(#)lilo.conf.5 1.0 950728 aeb +.\" This page is based on the lilo docs, which carry the following +.\" COPYING condition: +.\" +.\" LILO program code, documentation and auxiliary programs are +.\" Copyright 1992-1994 Werner Almesberger. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms of parts of or the +.\" whole original or derived work are permitted provided that the +.\" original work is properly attributed to the author. The name of the +.\" author may not be used to endorse or promote products derived from +.\" this software without specific prior written permission. This work +.\" is provided "as is" and without any express or implied warranties. +.\" +.\" Japanese Version Copyright (c) 1996 UEYAMA Rui,TACHIBANA Akira +.\" all rights reserved. +.\" Translated Sat Jul 27 22:54:48 JST 1996 +.\" by UEYAMA Rui +.\" TACHIBANA Akira +.\" Modified Sat May 3 12:31:22 JST 1997 +.\" by SUGIURA Yoshiki +.\" Modified Thu May 6 01:57:32 JST 1999 +.\" by TACHIBANA Akira +.\" Proofed and Modified Fri Aug 20 1999 +.\" by NAKANO Takeo +.\" +.\"WORD: boot loader ¥Ö¡¼¥È¥í¡¼¥À +.\"WORD: boot sector ¥Ö¡¼¥È¥»¥¯¥¿¡¼ +.\"WORD: verbose ñÁÀå +.\" +.TH LILO.CONF 5 "28 July 1995" +.SH ̾Á° +lilo.conf \- lilo ¤ÎÀßÄê¥Õ¥¡¥¤¥ë +.SH ÀâÌÀ +.LP +¤³¤Î¥Õ¥¡¥¤¥ë (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +.IR /etc/lilo.conf ) +¤Ï¡¢¥Ö¡¼¥È¥í¡¼¥À¤Î¥¤¥ó¥¹¥È¡¼¥é¤Ç¤¢¤ë lilo ¤¬Æɤ߹þ¤à +.RB ( lilo (8) +¤ò»²¾È)¡£ +.LP +ÆâÍƤÏÎ㤨¤Ð°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë: +.IP +.nf +boot = /dev/hda +delay = 40 +compact +vga = normal +root = /dev/hda1 +read-only +image = /zImage-2.5.99 + label = try +image = /zImage-1.0.9 + label = 1.0.9 +image = /tamu/vmlinuz + label = tamu + root = /dev/hdb2 + vga = ask +other = /dev/hda3 + label = dos + table = /dev/hda +.fi +.LP +¤³¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤Ï¡¢ +lilo ¤¬ /dev/hda ¤Î Master Boot Record ¤ò +ÍѤ¤¤ë¤è¤¦¤Ëµ­½Ò¤·¤Æ¤¢¤ë¡£ +(¿§¡¹¤Ê lilo ¤Î»È¤¤Êý¤ä¡¢Â¾¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤È¤Î´Ø·¸ +¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï¡¢ lilo ¤Î¥É¥­¥å¥á¥ó¥È¤Ë¤¢¤ë user.tex ¤ò +Æɤळ¤È¡£) +.LP +¥Ö¡¼¥È»þ¡¢¥Ö¡¼¥È¥í¡¼¥À¤Ï 4 Éà (40 x 1/10ÉÃ) ¤Î´Ö +Shift ¥­¡¼¤¬²¡¤µ¤ì¤ë¤Î¤òÂԤġ£ +¥­¡¼¤¬²¡¤µ¤ì¤Ê¤±¤ì¤Ð¡¢ºÇ½é¤Ëµ­½Ò¤·¤Æ¤¢¤ë¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸ +(/zImage-1.5.99: ¤¢¤Ê¤¿¤¬¤Ä¤¤5ʬÁ°¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤Ç¤¢¤í¤¦¥«¡¼¥Í¥ë) +¤Ç¥Ö¡¼¥È¤¹¤ë¡£ +¤â¤·¥­¡¼¤ò²¡¤¹¤È¡¢¥Ö¡¼¥È¥í¡¼¥À¤Ï¤É¤Î¥¤¥á¡¼¥¸¤Ç¥Ö¡¼¥È¤¹¤ë¤«Ê¹¤¤¤Æ¤¯¤ë¡£ +¤É¤ó¤ÊÁªÂò»è¤¬¤¢¤ë¤«Ëº¤ì¤¿»þ¤Ï¡¢[TAB] (¤¢¤ë¤¤¤Ï US ¥­¡¼¥Ü¡¼¥É¤Ê¤é [?]) +¤ò²¡¤¹¤È¥á¥Ë¥å¡¼¤¬½Ð¤ë¡£ +¤³¤³¤Ç´õ˾¤ÎÁªÂò»è¤òÁª¤Ù¤Ð¤è¤¤¡£¾åµ­¤Î¾ì¹ç¤Ê¤é¡¢½ÐÍ褿¤Æ¤Î¥«¡¼¥Í¥ë¡¢ +¸Å¤¤¤¬´Ö°ã¤¤¤Î¤Ê¤¤¥«¡¼¥Í¥ë¡¢ +¾¤Î¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥«¡¼¥Í¥ë +(Ä̾ï¤Î¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ê¤Ë¤«¥Ø¥Þ¤ò¤ä¤Ã¤¿¾ì¹ç¤ÎÊݸ±)¡¢ +¤¢¤ë¤¤¤Ï¾¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤«¤éÁª¤Ö¤³¤È¤¬¤Ç¤­¤ë¡£ +lilo.conf ¤Ë¤Ïimage¤ò16¸Ä¤Þ¤Çµ­½Ò¤Ç¤­¤ë¡£ +.LP +¾åµ­¤Î¤è¤¦¤Ë¡¢ÀßÄê¥Õ¥¡¥¤¥ë¤Ï¤¤¤¯¤Ä¤«¤Î¥°¥í¡¼¥Ð¥ë¥ª¥×¥·¥ç¥ó +(Îã¤Ç¤ÏºÇ½é¤Î6¹Ô) ¤Ç»Ï¤Þ¤ê¡¢¼ï¡¹¤Î image ¥»¥¯¥·¥ç¥ó¤¬¤½¤ì¤Ë³¤¯¡£ +image ¥»¥¯¥·¥ç¥ó¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥ª¥×¥·¥ç¥ó¤Ï¡¢ +¥°¥í¡¼¥Ð¥ë¥ª¥×¥·¥ç¥ó¤ò¾å½ñ¤­¤¹¤ë¡£ + +.SH ¥°¥í¡¼¥Ð¥ë¥ª¥×¥·¥ç¥ó +¿¤¯¤Î¥­¡¼¥ï¡¼¥É¤¬¤¢¤ë¡£°Ê²¼¤ÎÀâÌÀ¤Ï¤Û¤È¤ó¤É +user.tex ¤ÈƱ¤¸¤Ç¤¢¤ë (¤Á¤ç¤Ã¤È¤À¤±Ã»¤¤)¡£ +.TP +.BI "backup=" backup-file +¸µ¤Î ¥Ö¡¼¥È¥»¥¯¥¿¤ò +.IR /boot/boot.NNNN +¤Ç¤Ï¤Ê¤¯¡¢ +.I backup-file +¤Ë¥³¥Ô¡¼¤¹¤ë +( +.IR /dev/null +¤Ê¤É¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¤³¤È¤â²Äǽ¤Ç¤¢¤ë)¡£ +.TP +.BI "boot=" boot-device +¥Ö¡¼¥È¥»¥¯¥¿¡¼¤ò´Þ¤à¥Ç¥Ð¥¤¥¹(Î㤨¤Ð¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó)¤Î +¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë̾¤òÀßÄꤹ¤ë¡£¤³¤Î¥­¡¼¥ï¡¼¥É¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¡¢ +¥Ö¡¼¥È¥»¥¯¥¿¡¼¤Ï¸½ºß¥ë¡¼¥È¤È¤·¤Æ¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¥Ç¥Ð¥¤¥¹¤«¤é +Æɤ߹þ¤ß(¤ª¤è¤Ó¤ª¤½¤é¤¯½ñ¤­½Ð¤·)¤ò¹Ô¤¦¡£ +.TP +.BI "change-rules" +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¥¿¥¤¥×ÈÖ¹æ¤Î¥Ö¡¼¥È»þÊѹ¹ (¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ò±£¤¹¤«¤É¤¦¤«) +¤òÄêµÁ¤¹¤ë¡£ +¾ÜºÙ¤Ï user.tex ¤ÎÃæ¤Î "Partition type change rules" ¥»¥¯¥·¥ç¥ó¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.BI "compact" +¥Ö¡¼¥È¥»¥¯¥¿¡¼ÉÕ¶á¤Ø¤Î read¥ê¥¯¥¨¥¹¥È¤ò¡¢°ì²ó¤Ë¤Þ¤È¤á¤é¤ì¤ë¤«»î¹Ô¤¹¤ë¡£ +¥Þ¥Ã¥×¤ò¾®¤µ¤¯Êݤ俤ޤޤǡ¢¥í¡¼¥É»þ´Ö¤òÈó¾ï¤Ëû½Ì¤Ç¤­¤ë¡£ +Æä˥եí¥Ã¥Ô¥£¥Ç¥£¥¹¥¯¤«¤é¤Î¥Ö¡¼¥È¤ò¹Ô¤¦¾ì¹ç¤Ï `compact' ¤ò»È¤¦¤³¤È¤ò +Á¦¤á¤ë¡£ +.TP +.BI "default=" name +»ØÄꤵ¤ì¤¿¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤ò¥Ç¥Õ¥©¥ë¥È¤Î¥Ö¡¼¥È¥¤¥á¡¼¥¸¤È¤¹¤ë¡£ +`default' ¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¡¢ÀßÄê¥Õ¥¡¥¤¥ë¤ÎºÇ½é¤Ë +µ­½Ò¤¬¸½¤ì¤¿¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤¬¥Ç¥Õ¥©¥ë¥È¤È¤Ê¤ë¡£ +.TP +.BI "delay=" tsecs +¥Ö¡¼¥È¥í¡¼¥À¤¬ºÇ½é¤Î¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤Ç¥Ö¡¼¥È¤¹¤ë¤Þ¤Ç¤ÎÂÔ¤Á»þ´Ö¤ò +0.1ÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢¥­¡¼¥Ü¡¼¥É¤¬ÍøÍѲÄǽ¤Ë +¤Ê¤Ã¤Æ¤«¤é¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤Î¥Ö¡¼¥È¤Þ¤Ç¤Î»þ´Ö¤¬Ã»¤¤¤è¤¦¤Ê¥·¥¹¥Æ¥à¤ËÊØÍø¤Ç¤¢¤ë¡£ +`delay' ¤¬¾Êά¤µ¤ì¤Æ¤¤¤ë¤«¡¢¤Þ¤¿¤Ï 0 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢¥Ö¡¼¥È¥í¡¼¥À +¤ÏÆþÎϤòÂÔ¤¿¤Ê¤¤¡£ +.TP +.BI "disk=" device-name +»ØÄꤵ¤ì¤¿¥Ç¥£¥¹¥¯ÂФ¹¤ëÈóɸ½àŪ¤Ê¥Ñ¥é¥á¡¼¥¿¤òÄêµÁ¤¹¤ë¡£ +¾ÜºÙ¤Ï user.tex ¤ÎÃæ¤Î "Disk geometry" ¥»¥¯¥·¥ç¥ó¤ò»²¾È¤¹¤ë¤³¤È¡£ +ÆÃ¤Ë `bios=' ¥Ñ¥é¥á¡¼¥¿¤ÏÊØÍø¤Ç¤¢¤ë¡£ +BIOS ¤Ï¥Ç¥£¥¹¥¯¤ò 0x80,0x81 ¤È¤¤¤¦É÷¤ËÈÖ¹æ¤Å¤±¤¹¤ë¤¿¤á¡¢Linux ¥«¡¼¥Í¥ë¤Ç¤Î +¥Ç¥£¥¹¥¯¤Îǧ¼±¤È BIOS ¤Ç¤Î¥Ç¥£¥¹¥¯¤Îǧ¼±¤Î´Ö¤ÇÉÔÀ°¹ç¤¬À¸¤º¤ë¾ì¹ç¤¬¤¢¤ë¡£ +(¤³¤ì¤Ï BIOS ¤Î¼ïÎà¤ÈÀßÄê¤Ë°Í¸¤¹¤ë) +¤è¤Ã¤Æ¡¢¤â¤· Linux ¥«¡¼¥Í¥ë¤È BIOS ¤Ç¤Î¥Ç¥£¥¹¥¯¤Îǧ¼±¤òÄ̾ï¤È +°Û¤Ê¤ëÀßÄê¤Ë¤·¤¿¤¤¾ì¹ç¤Ï¡¢¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ë¤è¤Ã¤ÆÂбþ¤òµ­½Ò¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¼¡¤ËÎã¤òµó¤²¤ë¡£ +.sp +.nf + disk=/dev/sda + bios=0x80 + disk=/dev/hda + bios=0x81 +.fi +.sp +¾å¤Îµ­½Ò¤Ç¤Ï¡¢SCSI ¥Ç¥£¥¹¥¯¤ò BIOS ¤¬Ç§¼±¤¹¤ë°ìÈÖÌܤΥǥ£¥¹¥¯¤È¤·¡¢ +(¥×¥é¥¤¥Þ¥ê¥Þ¥¹¥¿¤Ë¤Ä¤Ê¤¬¤Ã¤Æ¤¤¤ë) IDE ¤Î¥Ç¥£¥¹¥¯¤ò BIOS ¤¬Ç§¼±¤¹¤ë +ÆóÈÖÌܤΥǥ£¥¹¥¯¤È¤¹¤ë¡£ +.TP +.BI "disktab=" disktab-file +¥Ç¥£¥¹¥¯¤Î¥Ñ¥é¥á¡¼¥¿¥Æ¡¼¥Ö¥ë̾¤ò»ØÄꤹ¤ë¡£ +`disktab' ¤¬¾Êά¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢¥Þ¥Ã¥×¥¤¥ó¥¹¥È¡¼¥é¤Ï +.I /etc/disktab +¤ò»²¾È¤¹¤ë¡£ +`disktab' ¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤¢¤Þ¤ê¤ªÁ¦¤á¤Ç¤­¤Ê¤¤¡£ +.TP +.BI "fix-table" +lilo ¤Ë¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤Î3D (sector/head/cylinder) ¥¢¥É¥ì¥¹¤Î +Ä´Àá¤òµö²Ä¤¹¤ë¡£¤½¤ì¤¾¤ì¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥¨¥ó¥È¥ê¤Ë¤Ï¡¢ +ºÇ½é¤ÈºÇ¸å¤Î¥»¥¯¥¿¤Î¥ê¥Ë¥¢¥¢¥É¥ì¥¹¤È3D ¥¢¥É¥ì¥¹¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +Ʊ¤¸¥Ç¥£¥¹¥¯¤ò¾¤ÎOS (Î㤨¤Ð¡¢MS/PC-DOS ¤ä OS/2) ¤¬»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤ä +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤¬¥È¥é¥Ã¥¯¤ËÀÚ¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ 3D ¥¢¥É¥ì¥¹¤¬ +ÊѤï¤ë¤«¤â¤·¤ì¤Ê¤¤¡£lilo ¤Ïξ¼Ô¤Î¥¢¥É¥ì¥¹¥¿¥¤¥×¤¬°ìÃפ·¤¿ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ë¤À¤±¥Ö¡¼¥È¥»¥¯¥¿¤òÊݸ¤Ç¤­¤ë¡£ +`fix-table' ¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢lilo ¤Ï´Ö°ã¤Ã¤¿ +3D ¥¹¥¿¡¼¥È¥¢¥É¥ì¥¹¤ò½¤Àµ¤¹¤ë¡£ + +·Ù¹ð¡§ ¾¤ÎOS ¤¬¸å¤Ç¥¢¥É¥ì¥¹¤ò¾å½ñ¤­¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤Þ¤¿¡¢¤³¤ì¤Ï»×¤ï¤ÌÉûºîÍѤò°ú¤­µ¯¤³¤¹¤«¤â¤·¤ì¤Ê¤¤¡£ +Àµ¤·¤¤½¤Àµ¤Ç¤¢¤Ã¤Æ¤â¡¢¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ò¥È¥é¥Ã¥¯¤Ë¹ç¤ï¤»¤è¤¦¤È +¤¹¤ë¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¤³¤ì¤Ë¤è¤Ã¤ÆºÆ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤¬ +¤µ¤ì¤Æ¤·¤Þ¤¦¤«¤âÃΤì¤Ê¤¤¡£ +¤Þ¤¿¤¢¤ë¼ï¤Î¥Ç¥£¥¹¥¯(Î㤨¤Ð¥¢¥É¥ì¥¹ÊÑ´¹¤Î²Äǽ¤Ê¤¤¤¯¤Ä¤«¤ÎLarge EIDE) +¤Ç¤Ï¡¢¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤ÎÆâÍƤ¬¥³¥ó¥Õ¥ê¥¯¥È¤·¡¢½¤Àµ¤Ç¤­¤Ê¤¯¤Ê¤ë +¾ì¹ç¤¬¤¢¤ê¤¦¤ë¡£ +.TP +.BI "force-backup=" backup-file +`backup' ¤ÈƱÍͤÀ¤¬¡¢¥Ð¥Ã¥¯¥¢¥Ã¥×¤¬Â¸ºß¤·¤Æ¤â¾å½ñ¤­¤¹¤ë¡£ +.TP +.BI "ignore-table" +¤ª¤«¤·¤¯¤Ê¤Ã¤¿¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤ò̵»ë¤¹¤ë¤è¤¦ lilo ¤Ë»Ø¼¨¤¹¤ë¡£ +.TP +.BI "install=" boot-sector +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò¿·¤·¤¤¥Ö¡¼¥È¥»¥¯¥¿¤È¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¡£ +`install' ¤¬¾Êά¤µ¤ì¤ë¤È¡¢ +.I /boot/boot.b +¤¬¥Ç¥Õ¥©¥ë¥È¤Ç»È¤ï¤ì¤ë¡£ +.TP +.BI "linear" +sector/head/cylinder ¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤹ¤ëÂå¤ï¤ê¤Ë¡¢¥»¥¯¥¿¤Î¥ê¥Ë¥¢¥¢¥É¥ì¥¹ +¤ò»ÈÍѤ¹¤ë¡£¥ê¥Ë¥¢¥¢¥É¥ì¥¹¤Ï¼Â¹Ô»þ¤Ë·èÄꤵ¤ì¡¢¥Ç¥£¥¹¥¯¤Î¥¸¥ª¥á¥È¥ê¤Ë +°Í¸¤·¤Ê¤¤¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¡¢¥Ö¡¼¥È¥Ç¥£¥¹¥¯¤Î²ÄÈÂÀ­¤¬ +¤Ê¤¯¤Ê¤ë¡£¥Õ¥í¥Ã¥Ô¡¼¤Î³Î¼Â¤Ê¥¸¥ª¥á¥È¥ê¤ò +BIOS ¤¬ÊÖ¤·¤Æ¤¯¤ì¤ë¤È¤Ï¸Â¤é¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.I /sbin/lilo +¤Ï¥Ç¥£¥¹¥¯¤Î¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤Îΰè¤Ø¤Î»²¾È¤ò¤Ä¤¯¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¤Ð¡¢3D ¥»¥¯¥¿¥¢¥É¥ì¥¹¤Ï¥Ö¡¼¥È¤¹¤ë¤Þ¤Ç¤ï¤«¤é¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.TP +.BI "lock" +¤³¤Î¥ª¥×¥·¥ç¥ó°Ê¹ß¤Î¥Ö¡¼¥È¥³¥Þ¥ó¥É¥é¥¤¥ó¤ò°Ê¸å¤Î¥Ç¥Õ¥©¥ë¥È¤È¤·¤Æ +¼«Æ°Åª¤Ëµ­Ï¿¤¹¤ë¡£ +lilo ¤Ï¤³¤Îµ­Ï¿¤ò¡¢¼êÆ°¤Ç²ò½ü¤µ¤ì¤ë¤Þ¤Ç "lock" ¤¹¤ë¡£ +.TP +.BI "map=" map-file +¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤Î¾ì½ê¤ò»ØÄꤹ¤ë¡£`map' ¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¡¢ +.I /boot/map +¤¬»È¤ï¤ì¤ë¡£ +.TP +.BI "message=" message-file +¥Ö¡¼¥È¥×¥í¥ó¥×¥È¤ò½Ð¤¹Á°¤Ë½ÐÎϤ·¤¿¤¤¥á¥Ã¥»¡¼¥¸¤ò´Þ¤à¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¡£ +"LILO"¤È½ÐÎϤµ¤ì¤¿¸å¡¢Shift¥­¡¼¤¬²¡¤µ¤ì¤ë¤Þ¤Ç¤Ï¡¢ +¥á¥Ã¥»¡¼¥¸¤Ï¤Ê¤Ë¤â½ÐÎϤµ¤ì¤Ê¤¤¡£ +¥á¥Ã¥»¡¼¥¸¤ËÀ©¸æʸ»ú FF([Ctrl L]) ¤¬¤¢¤ë¤È¡¢¥³¥ó¥½¡¼¥ë²èÌ̤ò¥¯¥ê¥¢¤¹¤ë¡£ +¥á¥Ã¥»¡¼¥¸¥Õ¥¡¥¤¥ë¤ÎÂ礭¤µ¤ÏºÇÂç 65535 ¥Ð¥¤¥È¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +¥á¥Ã¥»¡¼¥¸¥Õ¥¡¥¤¥ë¤ò½¤Àµ¡¦°ÜÆ°¤·¤¿¾ì¹ç¤Ï¡¢¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤òºÆºîÀ®¤·¤Ê¤±¤ì¤Ð +¤Ê¤é¤Ê¤¤¡£ +.TP +.BI "nowarn" +¾­Í赯¤³¤ê¤¦¤ëÉÔ¶ñ¹ç¤Ë´Ø¤¹¤ë·Ù¹ð¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£ +.TP +.BI "optional" +¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤´¤È¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë `optional' (¾ÜºÙ¤Ï¸å½Ò)¤ò¡¢ +Á´¤Æ¤Î¥«¡¼¥Í¥ë¤ËŬÍѤ¹¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.BI "password=" password +¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤´¤È¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë `password=...' (¾ÜºÙ¤Ï¸å½Ò)¤ò¡¢ +Á´¤Æ¤Î¥«¡¼¥Í¥ë¤ËŬÍѤ¹¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.BI "prompt" +¥­¡¼¤¬²¡¤µ¤ì¤Ê¤¯¤Æ¤â¥Ö¡¼¥È¥×¥í¥ó¥×¥È¤ò½Ð¤¹¤è¤¦¤Ë¤¹¤ë¡£ +`prompt' ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢`timeout' ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢ +̵¿Í±¿Å¾¤Ç¤Î¥ê¥Ö¡¼¥È¤Ï¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +.TP +.BI "restricted" +¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤´¤È¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë `restricted' (¾ÜºÙ¤Ï¸å½Ò)¤ò¡¢ +Á´¤Æ¤Î¥«¡¼¥Í¥ë¤ËŬÍѤ¹¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.BI "serial=" parameters +¥·¥ê¥¢¥ë¥é¥¤¥ó¤«¤é¤ÎÀ©¸æ¤ò²Äǽ¤Ë¤¹¤ë¡£ +»ØÄꤷ¤¿¥·¥ê¥¢¥ë¥Ý¡¼¥È¤ò½é´ü²½¤·¤Æ¡¢¤½¤³¤«¤é¤ÎÆþÎϤâ¼õÉÕ¤±¤ë¡£ +Ä̾ïÄ̤ꥭ¡¼¥Ü¡¼¥É¤«¤é¤ÎÆþÎϤâ²Äǽ¤Ç¤¢¤ë¡£ +¥³¥ó¥½¡¼¥ë¤Ç¥·¥Õ¥È¥­¡¼¤ò²¡¤¹Æ°ºî¤Ï¡¢¥·¥ê¥¢¥ë¥Ý¡¼¥È¤Ç¤Ï +break ¤òÁ÷¤ë¤³¤È¤ËÂбþ¤¹¤ë¡£¤³¤ì¤Ë¤è¤Ã¤Æ¥Ö¡¼¥È¥í¡¼¥À¤Î +Ãí°Õ¤ò°ú¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ +¥â¥Ç¥à¤¬¤Ä¤Ê¤¬¤Ã¤Æ¤¤¤ë¤Ê¤É¡¢¥³¥ó¥½¡¼¥ë¤è¤ê¥»¥­¥å¥ê¥Æ¥£¤¬Ä㤤¾ì¹ç¡¢ +¤¹¤Ù¤Æ¤Î¥Ö¡¼¥È¥¤¥á¡¼¥¸¤ò¥Ñ¥¹¥ï¡¼¥É¤ÇÊݸ¤¿Êý¤¬Îɤ¤¡£ +¥Ñ¥é¥á¡¼¥¿¡¼¤Î½ñ¼°¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.sp +.nf + [,[[]]] +.fi +.sp +: ¥·¥ê¥¢¥ë¥Ý¡¼¥È¤ÎÈÖ¹æ¤ò»ØÄꤹ¤ë¡£0 ¤«¤é»Ï¤Þ¤ë¡£ +Î㤨¤Ð 0 ¤Ï COM1 (ÊÌ̾ /dev/ttyS0) ¤ËÂбþ¤¹¤ë¡£ +¥·¥ê¥¢¥ë¥Ý¡¼¥È¤Ï 0 ¤«¤é 4 ¤Þ¤Ç¤¹¤Ù¤Æ»ÈÍѤǤ­¤ë (¸ºß¤·¤Æ¤¤¤ì¤Ð)¡£ +.sp +: ¥·¥ê¥¢¥ë¥Ý¡¼¥È¤Î®ÅÙ¤ò»ØÄꤹ¤ë¡£110, 150, 300, 600, 1200, +2400, 4800, 9600 bps ¤¬»ØÄê²Äǽ¤Ç¤¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ï2400 bps ¡£ +.sp +: ¥·¥ê¥¢¥ë¥é¥¤¥ó¤ÇÍѤ¤¤é¤ì¤ë¥Ñ¥ê¥Æ¥£¡£ +¥Ö¡¼¥È¥í¡¼¥À¤ÏÆþÎϥѥê¥Æ¥£¤ò̵»ë¤·¤Æ8¥Ó¥Ã¥ÈÌܤò strip ¤¹¤ë¡£ +¼¡¤Î¤É¤ì¤«¤Îʸ»ú (Âçʸ»ú¾®Ê¸»ú¤É¤Á¤é¤Ç¤âÎɤ¤) ¤ò +¥Ñ¥ê¥Æ¥£¤Îµ­½Ò¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +n: ¥Ñ¥ê¥Æ¥£¤ò»ÈÍѤ·¤Ê¤¤ +e: ¶ö¿ô (odd) ¥Ñ¥ê¥Æ¥£¤ò»ÈÍѤ¹¤ë +o: ´ñ¿ô (even) ¥Ñ¥ê¥Æ¥£¤ò»ÈÍѤ¹¤ë +.sp +: ʸ»ú¤Î¥Ó¥Ã¥È¿ô¤ò»ØÄꤹ¤ë¡£7¤È8¤¬»ØÄê¤Ç¤­¤ë¡£ +¥Ñ¥ê¥Æ¥£¤ò»È¤ï¤Ê¤¤¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¤Ï 8 ¤Ç¡¢ +»È¤¦¾ì¹ç¤Ï 7¡£ +.sp +`serial' ¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢`display' ¤Ï¼«Æ°Åª¤Ë20¤Ë¤Ê¤ë¡£ +.sp +Î㡧 "serial=0,2400n8" ¤ÏCOM1 ¤ò¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥é¥á¡¼¥¿¤Ç +½é´ü²½¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.TP +.BI "timeout=" tsecs +¥­¡¼¥Ü¡¼¥ÉÆþÎÏÂÔ¤Á¤Î¥¿¥¤¥à¥¢¥¦¥È»þ´Ö(0.1ÉÃñ°Ì)¤ò»ØÄꤹ¤ë¡£ +¤³¤Î»þ´ÖÆâ¤ËÆþÎϤ¬¤Ê¤¤¾ì¹ç¤Ï¡¢¼«Æ°Åª¤ËºÇ½é¤Î¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤Ç¥Ö¡¼¥È¤¹¤ë¡£ +¥Ñ¥¹¥ï¡¼¥ÉÆþÎÏÂÔ¤Á¤ÇÆþÎϤ¬¤Ê¤¤¾ì¹ç¤âƱÍͤǤ¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Î¥¿¥¤¥à¥¢¥¦¥È +»þ´Ö¤Ï̵¸Â¡£ +.TP +.BI "verbose=" level +¿Ê¹Ô¾õ¶·Êó¹ð¤ÎñÁÀå (verbose) ¥ì¥Ù¥ë¤òÊѹ¹¤¹¤ë¡£ +Â礭¤Ê¿ô¤ò»ØÄꤹ¤ë¤È¡¢¤è¤ê¾ÜºÙ¤ÊÊó¹ð¤ò½ÐÎϤ¹¤ë¡£ +lilo ¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç¹¹¤Ë \-v ¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢ñÁÀå¥ì¥Ù¥ë¤Ï +¤½¤ì¤Ë±þ¤¸¤Æ¾å¤¬¤ë¡£ºÇÂç¤ÎñÁÀå¥ì¥Ù¥ë¤Ï5¡£ + +.LP +°Ê¾å¤Ë²Ã¤¨¡¢¥«¡¼¥Í¥ë¤ËÂФ¹¤ëÀßÄê¥Ñ¥é¥á¡¼¥¿¤È¤·¤Æ +.BR append ", " ramdisk ", " read-only ", " read-write ", " root ", " vga +¤ò¥°¥í¡¼¥Ð¥ë¥ª¥×¥·¥ç¥ó¤ËÀßÄê¤Ç¤­¤ë¡£ +³Æ¡¹¤Î¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤´¤È¤ÎÀßÄê¤È¤·¤Æ»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¡¢ +¤³¤ì¤é¤¬¥Ç¥Õ¥©¥ë¥È¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ + +.SH ¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤´¤È¤Î¥»¥¯¥·¥ç¥ó +¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤´¤È¤Î¥»¥¯¥·¥ç¥ó¤Î»Ï¤Þ¤ê¤Ï¡¢ +Linux ¥«¡¼¥Í¥ë¤Î¥Ö¡¼¥È¥¤¥á¡¼¥¸¤ò´Þ¤à¥Ç¥Ð¥¤¥¹/¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë +.sp +.nf + \fBimage=\fP\fIpathname\fP +.fi +.sp +¤Î¹Ô¤«¡¢¥Ö¡¼¥È¤·¤¿¤¤Ç¤°Õ¤Î¥·¥¹¥Æ¥à¤ò»ØÄꤹ¤ë +.sp +.nf + \fBother=\fP\fIpathname\fP +.fi +.sp +¤È¤¤¤¦¹Ô¤Ç¤¢¤ë¡£ +.LP + +Á°¼Ô¤Î½ñ¼°¤Ç¡¢\fBimage\fP ¹Ô¤¬¥Ç¥Ð¥¤¥¹¤«¤é¤Î¥Ö¡¼¥È¤¬»ØÄꤷ¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.TP +.BI "range=" start-end +.LP +¤Ë¤è¤ê¥Þ¥Ã¥×¤µ¤ì¤ë¥»¥¯¥¿¤ÎÈϰϤò¼¨¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +¸å¼Ô¤Î½ñ¼°¤Î¤è¤¦¤Ë¡¢Â¾¤Î¥·¥¹¥Æ¥à¤ò¥Ö¡¼¥È¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢ +°Ê²¼¤Î3¤Ä¤Î¥ª¥×¥·¥ç¥ó¤¬¤¢¤ë¡£ +.TP +.BI "loader=" chain-loader +»ÈÍѤ¹¤ë chain loader ¤ò»ØÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.I /boot/chain.b +¤ò»ÈÍѤ¹¤ë¡£°ìÈÖÌܤΥϡ¼¥É¥Ç¥£¥¹¥¯°Ê³°¡¢¤Þ¤¿¤Ï¥Õ¥í¥Ã¥Ô¥£¥Ç¥£¥¹¥¯°Ê³°¤Î +¥Ç¥Ð¥¤¥¹¤«¤é¥Ö¡¼¥È¤¹¤ë¾ì¹ç¤Ï¡¢chain loader ¤òɬ¤º»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BI "table=" device +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤ò»ý¤Ã¤Æ¤¤¤ë¥Ç¥Ð¥¤¥¹¤ò»ØÄꤹ¤ë¡£ +¤³¤ì¤ò¾Êά¤·¤¿¾ì¹ç¡¢¥Ö¡¼¥È¥í¡¼¥À¤Ï¥Ö¡¼¥È¤¹¤ë OS ¤Ë +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¾ðÊó¤òÅϤµ¤Ê¤¤¡£(OS ¤Ë¤è¤Ã¤Æ¤Ï¡¢ +¼«Ê¬¤¬¤É¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤«¤é¥Ö¡¼¥È¤µ¤ì¤¿¤«¤ò·è¤á¤ëÊýË¡¤òÊ̤˻ý¤Ã¤Æ¤¤¤ë¡£ +Î㤨¤Ð MS-DOS ¤ÏÄ̾ï¥Ö¡¼¥È¥Ç¥£¥¹¥¯/¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¥¸¥ª¥á¥È¥ê¾ðÊó¤ò +¥Ö¡¼¥È¥»¥¯¥¿¤ËÊݸ¤¹¤ë¡£) +\&'table' ¤Ç»²¾È¤µ¤ì¤Æ¤¤¤ë¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¤Ï¡¢ +.I /sbin/lilo +¤òºÆ¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ë¤³¤È¤ËÃí°Õ¡£ +.TP +.BI "unsafe" +¥Þ¥Ã¥×¤ÎºîÀ®»þ¤Ë¥Ö¡¼¥È¥»¥¯¥¿¤Ë¥¢¥¯¥»¥¹¤·¤Ê¤¤¡£ +¤³¤ì¤Ë¤è¤ê¡¢¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¥Á¥§¥Ã¥¯¤Ê¤É¤ÎÀµÅöÀ­¤Î¸¡ºº¤Ï +¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +¥Ö¡¼¥È¥»¥¯¥¿¤¬¸ÇÄê¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¥Õ¥í¥Ã¥Ô¡¼¾å¤Ë¤¢¤ë¾ì¹ç¤Ë +UNSAFE ¤òÍѤ¤¤ë¤È¡¢¥Þ¥Ã¥×¥¤¥ó¥¹¥È¡¼¥é¤Î¼Â¹Ô»þ¤Ë +¥É¥é¥¤¥Ö¤ËÆɤ߼è¤ê²Äǽ¤Ê¥Ç¥£¥¹¥¯¤òÁÞÆþ¤·¤Ê¤¯¤Æ¤¹¤à¡£ +`unsafe' ¤È `table' ¤ÏƱ»þ¤Ë»ØÄê¤Ç¤­¤Ê¤¤¡£ + +¤¤¤º¤ì¤Î¾ì¹ç¤Ç¤â°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï»ØÄê¤Ç¤­¤ë¡£ +.TP +.BI "label=" name +¥Ö¡¼¥È¥í¡¼¥À¤Ï»ØÄꤹ¤ë¥Ö¡¼¥È¥¤¥á¡¼¥¸¤Î¼±Ê̤ˡ¢(¥Ñ¥¹Ì¾¤ò½ü¤¤¤¿) +¥Õ¥¡¥¤¥ë̾¤ò»È¤¦¡£ +°ã¤Ã¤¿¼±ÊÌ̾¤ò»È¤¦¤³¤È¤â¤Ç¤­¡¢ÊÑ¿ô`label' ¤ËÀßÄꤹ¤ì¤Ð¤è¤¤¡£ +.TP +.BI "alias=" name +Ʊ¤¸¥Ö¡¼¥È¥¤¥á¡¼¥¸¤ÎÆóÈÖÌܤμ±ÊÌ̾¤È¤·¤Æ¡¢ +¤³¤³¤Ç»ØÄꤵ¤ì¤ëÊÌ̾¤ò»È¤¦¤³¤È¤â¤Ç¤­¤ë¡£ +.TP +.BI "lock" +(¾å½Ò) +.TP +.BI "optional" +¥Þ¥Ã¥×ºîÀ®»þ¤ËÍøÍѤǤʤ±¤ì¤Ð¡¢¤³¤Î¥Ö¡¼¥È¥¤¥á¡¼¥¸¤ò¾Êά¤¹¤ë¡£ +¾ï¤Ë¸ºß¤¹¤ë¤È¤Ï¸Â¤é¤Ê¤¤¥Æ¥¹¥ÈÍÑ¥«¡¼¥Í¥ë¤ò +¥Ö¡¼¥È¥¤¥á¡¼¥¸¤Ë»ØÄꤹ¤ëºÝ¤ËÊØÍø¤Ç¤¢¤ë¡£ +.TP +.BI "password=" password +¥Ö¡¼¥È¥¤¥á¡¼¥¸¤ò password ¤ÇÊݸ¤ë¡£ +.TP +.BI "restricted" +¥Ö¡¼¥È¤¹¤ëºÝ¤Î¥Ñ¥¹¥ï¡¼¥ÉÆþÎϤò¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ñ¥é¥á¡¼¥¿ (Î㤨¤Ð single) +¤¬»ØÄꤵ¤ì¤¿¤È¤­¤À¤±Í׵ᤵ¤ì¤ë¤è¤¦¤Ë¤¹¤ë¡£ +.LP + +.SH ¥«¡¼¥Í¥ë¥ª¥×¥·¥ç¥ó +¥Ö¡¼¥È¥¤¥á¡¼¥¸¤¬ Linux ¥«¡¼¥Í¥ë¤Ê¤é¤Ð¡¢¥«¡¼¥Í¥ë¤ËÂФ· +¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ñ¥é¥á¡¼¥¿¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BI "append=" string +¥«¡¼¥Í¥ë¤ËÅϤ¹¥Ñ¥é¥á¡¼¥¿¥é¥¤¥ó¤Ë»ØÄꤹ¤ë¥Ñ¥é¥á¡¼¥¿¤òÄɲ乤롣 +ŵ·¿Åª¤ÊÍøÍÑË¡¤È¤·¤Æ¤Ï¡¢¼«Æ°Åª¤Ë¤Ï¸¡½Ð¤µ¤ì¤Ê¤«¤Ã¤¿¤ê¡¢ +¼«Æ°¸¡ÃΤ¬´í¸±¤Ê¥Ï¡¼¥É¥¦¥§¥¢¤ËÂФ¹¤ë¥Ñ¥é¥á¡¼¥¿¤ò»ØÄꤹ¤ë¾ì¹ç¤Ê¤É¤¬¤¢¤ë¡£ +Îã¤òµó¤²¤ë: +.sp +.nf + append = "hd=64,32,202" +.fi +.sp +.TP +.BI "literal=" string +`append' ¤È»÷¤Æ¤¤¤ë¤¬¡¢¤³¤³¤ËÍ¿¤¨¤¿°Ê³°¤Î¥ª¥×¥·¥ç¥ó (¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Î +ÀßÄê¤Ê¤É) ¤ò¤¹¤Ù¤Æ̵¸ú¤Ë¤¹¤ë¡£ +½ÅÍפʥª¥×¥·¥ç¥ó¤¬ `literal' ¤Ë¤è¤ê°Õ¿Þ¤»¤ºÌµ¸ú¤Ë¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¤¿¤á¡¢ +¤³¤ì¤Ï¥°¥í¡¼¥Ð¥ë¥ª¥×¥·¥ç¥ó¤Ë¤Ï»ØÄê¤Ç¤­¤Ê¤¤¡£ +.TP +.BI "ramdisk=" size +RAM ¥Ç¥£¥¹¥¯¤Î¥µ¥¤¥º¤ò»ØÄꤹ¤ë¡£0¤À¤ÈºîÀ®¤·¤Ê¤¤¡£ +¤³¤ì¤ò¾Êά¤·¤¿¾ì¹ç¡¢ RAM ¥Ç¥£¥¹¥¯¤Î¥µ¥¤¥º¤Ï +¥Ö¡¼¥È¥¤¥á¡¼¥¸¤ËÀßÄꤵ¤ì¤Æ¤¤¤ëÂ礭¤µ¤Ë¤Ê¤ë¡£ +.TP +.BI "read-only" +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥ê¡¼¥É¥ª¥ó¥ê¡¼¤Ç¥Þ¥¦¥ó¥È¤¹¤ë¡£ +Ä̾亮¥¹¥Æ¥à¤Î¥Ö¡¼¥È¥¢¥Ã¥×¥×¥í¥·¡¼¥¸¥ã¤Ï¡¢¸å¤Ç +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÆɤ߽ñ¤­¥â¡¼¥É¤ÇºÆ¥Þ¥¦¥ó¥È¤¹¤ë +(fsck ¤·¤¿¤¢¤È)¡£ +.TP +.BI "read-write" +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÆɤ߽ñ¤­¥â¡¼¥É¤Ç¥Þ¥¦¥ó¥È¤¹¤ë¡£ +.TP +.BI "root=" root\-device +¥ë¡¼¥È¤È¤·¤Æ¥Þ¥¦¥ó¥È¤¹¤ë¥Ç¥Ð¥¤¥¹¤ò»ØÄꤹ¤ë¡£ +¸½ºß¥ë¡¼¥È¤È¤Ê¤Ã¤Æ¤¤¤ë¥Ç¥Ð¥¤¥¹¤ò»ØÄꤹ¤ë¤Ë¤Ï +.I current +¤È¤¤¤¦ÆÃÊ̤Ê̾Á°¤ò»ÈÍѤ¹¤ë¡£ +\-r ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê¥ë¡¼¥È¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¤½¤ÎÊѹ¹¸å¤Î¥Ç¥Ð¥¤¥¹¤¬ÍѤ¤¤é¤ì¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ +¾Êά¤µ¤ì¤ë¤È¡¢¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Ë¤Ï¸½ºß¤Î¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤¬ +Æþ¤Ã¤Æ¤¤¤ë¥Ç¥Ð¥¤¥¹¤¬»ÈÍѤµ¤ì¤ë¡£(¤Þ¤¿¡¢¤³¤ì¤Ï¥«¡¼¥Í¥ë¤Î +Makefile ¤Î ROOT_DEV ¤Ë»ØÄꤷ¤Æ¥³¥ó¥Ñ¥¤¥ë¤¹¤ì¤ÐÊѹ¹¤µ¤ì¤ë¡£ +rdev(8) ¤Ë¤è¤ê¸å¤ÇÊѹ¹¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¢¤ë¡£) +.TP +.BI "vga="mode +¥Ö¡¼¥È»þ¤ËÁªÂò¤µ¤ì¤¿ VGA ¤Î text ¥â¡¼¥É¤ò»ØÄꤹ¤ë¡£ +°Ê²¼¤ÎÃͤ¬»ØÄê¤Ç¤­¤ë (Âçʸ»ú¡¢¾®Ê¸»ú¤ò¶èÊ̤·¤Ê¤¤): +.sp +.BR normal : +Ä̾ï¤Î 80x25 ¥Æ¥­¥¹¥È¥â¡¼¥É¤ò»ØÄꤹ¤ë¡£ +.sp +.BR extended " (¤Þ¤¿¤Ï " ext ): +80x50 ¥Æ¥­¥¹¥È¥â¡¼¥É¤ò»ØÄꤹ¤ë¡£ +.sp +.BR ask : +¥Ö¡¼¥È»þ¤ËÆ°ºî¤òÄä»ß¤·¡¢ÆþÎϤòÍ׵᤹¤ë¡£ +.sp +: Âбþ¤¹¤ë¥Æ¥­¥¹¥È¥â¡¼¥É¤ò»ÈÍѤ¹¤ë¡£ +»ÅÍͤǤ­¤ë¥â¡¼¥É¤Î¥ê¥¹¥È¤Ï¡¢vga=ask ¤È»ØÄꤷ¤Æ¥Ö¡¼¥È»þ¤Ë +[Enter] ¤ò²¡¤¹¤³¤È¤Ç¤ï¤«¤ë¡£ +.sp +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¾Êά¤µ¤ì¤ë¤È¡¢VGA ¥â¡¼¥É¤Ï¸½ºß»ÈÍѤ·¤Æ¤¤¤ë +¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤ÎÀßÄê¤Ë¤Ê¤ë¡£(¤Þ¤¿¡¢¥«¡¼¥Í¥ë¤Î +Makefile ¤ÎSVGA_MODE ¤Ë»ØÄꤷ¤Æ¥³¥ó¥Ñ¥¤¥ë¤¹¤ì¤ÐÊѹ¹²Äǽ¡£ +rdev(8) ¤Ë¤è¤ê¸å¤ÇÊѹ¹¤¹¤ë¤³¤È¤â²Äǽ¡£ + +.SH ´ØÏ¢¹àÌÜ +lilo(8), rdev(8). +.br +lilo ¤Î¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ë¤Ï¡¢¤³¤³¤ÇÍ×Ìó¤·¤¿ÆâÍƤΠ+¾ÜºÙ¤Ê¥É¥­¥å¥á¥ó¥È¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ diff --git a/obsolete/man7/LDP.7 b/obsolete/man7/LDP.7 new file mode 100644 index 00000000..64235537 --- /dev/null +++ b/obsolete/man7/LDP.7 @@ -0,0 +1,138 @@ +.ig \"-*- nroff -*- +Copyright (C) 2000 Stein Gjoen + +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. + +Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be included in +translations approved by the Free Software Foundation instead of in +the original English. + +Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. +Translated 2001-04-01, NAKANO Takeo +Updated 2001-12-06, NAKANO Takeo +Updated 2005-02-21, Akihiro MOTOKI +.. +.TH LDP 7 2001-11-15 "LDP" +.\"O .SH "NAME" +.SH ̾Á° +.\"O LDP \- Intro to the Linux Documentation Project, with help, guides and documents +LDP \- Linux Documentaion Project ¤È¥Ø¥ë¥×¡¢¥¬¥¤¥É¡¢Ê¸½ñ¤Î¾Ò²ð +.\"O .SH "SYNOPSIS" +.SH ÀâÌÀ +.\"O The Linux Documentation Project (LDP) provides a variety of +.\"O free documentation resources including +.\"O guides, FAQs, HOWTOs, and man-pages to the Linux community. +Linux Documentation Project (LDP) ¤ÏÍÍ¡¹¤Ê¥Õ¥ê¡¼¥É¥­¥å¥á¥ó¥È¤ò +Linux ¥³¥ß¥å¥Ë¥Æ¥£¤ËÄ󶡤¹¤ë¥×¥í¥¸¥§¥¯¥È¤Ç¤¹¡£ +Ä󶡤·¤Æ¤¤¤ë¥ê¥½¡¼¥¹¤Ë¤Ï guide ʸ½ñ¡¢ FAQ ʸ½ñ¡¢HOWTO ʸ½ñ¡¢ +man ¥Ú¡¼¥¸¤Ê¤É¤¬¤¢¤ê¤Þ¤¹¡£ +.\"O .SH "AUTHORS" +.SH Ãø¼Ô +.\"O The various documents in the LDP archives are maintained by individual +.\"O authors, and are listed in the beginning of each HOWTO. +.\"O If you have +.\"O any questions or inputs to a document we encourage you to contact the +.\"O authors directly. +LDP ¥¢¡¼¥«¥¤¥Ö¤Ë´Þ¤Þ¤ì¤ëÍÍ¡¹¤Êʸ½ñ¤Ï¡¢ +¤½¤ì¤¾¤ì¸Ä¡¹¤ÎÃø¼Ô¤Ë¤è¤Ã¤Æ°Ý»ý¡¦´ÉÍý¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +Ãø¼Ô¤Î̾Á°¤Ï³Æ HOWTO ¤ÎÀèƬ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢ +ʸ½ñ¤Ë´Ø¤·¤Æ¼ÁÌä¤äÄ󶡾ðÊ󤬤¢¤Ã¤¿¤é¡¢ +¤É¤¦¤¾¤ªµ¤·Ú¤ËÃø¼Ô¤ËľÀÜÏ¢Íí¤ò¼è¤Ã¤Æ¤¯¤À¤µ¤¤¡£ +.\"O .SH "WEB PAGES" +.SH "WEB ¥Ú¡¼¥¸" +.\"O The LDP has its own dedicated web site as do many of +.\"O the various translations projects which are linked from the +.\"O main LDP web site at: +LDP ¤Ë¤Ï web ¥µ¥¤¥È¤¬¤¢¤ê¤Þ¤¹¡£ +ÍÍ¡¹¤Ê¸À¸ì¤Ø¤ÎËÝÌõ¥×¥í¥¸¥§¥¯¥È¤Ø¤Î¥ê¥ó¥¯¤â½¸¤á¤é¤ì¤Æ¤¤¤Þ¤¹¡£ +¾ì½ê¤Ï¼¡¤Î URL ¤Ç¤¹¡£ + +.RS +\fBhttp://www\&.tldp\&.org/\fP +.RE +.\"O .SH "MAN PAGES" +.SH "MAN ¥Ú¡¼¥¸" +.\"O A web page with status information for manual pages and translations +.\"O is found at: +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ª¤è¤Ó¤½¤ÎËÝÌõ¤Ë´Ø¤¹¤ë¾ðÊ󤬽ñ¤«¤ì¤¿ +web ¥Ú¡¼¥¸¤Ï°Ê²¼¤Î URL ¤Ç¤¹¡£ + +.RS +\fBhttp://www\&.win\&.tue\&.nl/~aeb/linux/man/\fP +.RE +.\"O .SH "MAILING LISTS" +.SH ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È +.\"O LDP has a number of mailing lists, such as +LDP ¤Ë¤Ï¿¤¯¤Î¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤¬¤¢¤ê¤Þ¤¹¡£ +.PP +.PD 0 +.TP +.PD +\fB\fP +.\"O Announcements from the LDP project +LDP ¥×¥í¥¸¥§¥¯¥È¤«¤é¤Î¥¢¥Ê¥¦¥ó¥¹ +.TP +\fB\fP +.\"O General discussion on the LDP project +LDP ¥×¥í¥¸¥§¥¯¥È¤Ë´Ø¤¹¤ë°ìÈÌŪ¤ÊµÄÏÀ +.TP +\fB\fP +.\"O Questions about the use of DocBook +DocBook ¤Î»ÈÍѤ˴ؤ¹¤ë¼ÁÌä +.PP +.\"O For subscription information, see the website. +¹ØÆɤ˴ؤ¹¤ë¾ðÊó¤Ï¡¢¥¦¥§¥Ö¥µ¥¤¥È¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£ +.PP +.\"O If you are interested in DocBook beyond the simple markup of your LDP +.\"O document, you may want to consider joining one of the OASIS DocBook +.\"O mailing lists. +.\"O Please see +.\"O \fBhttp://docbook\&.org/mailinglist/index\&.html\fP +.\"O for more information. +LDP ʸ½ñ¤Îñ¤Ê¤ëÁÈÈÇÊýË¡ (markup) ¤È¤·¤Æ¤Ç¤Ï¤Ê¤¯ DocBook ¼«¿È¤Ë¶½Ì£¤ò +¤ª»ý¤Á¤Ê¤é¤Ð¡¢ OASIS ¤Î DocBook ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Î¤É¤ì¤«¤Ë»²²Ã¤ò¹Í¤¨¤Æ¤â +¤¤¤¤¤«¤â¤·¤ì¤Ê¤¤¡£¾Ü¤·¤¤¾ðÊó¤Ï +\fBhttp://docbook\&.org/mailinglist/index\&.html\fP +¤ò¸«¤Æ²¼¤µ¤¤¡£ +.\"O .SH "FILES" +.SH ¥Õ¥¡¥¤¥ë +.\"O Most distributions include the HOWTOs and mini-HOWTOs in the installation +¤Û¤È¤ó¤É¤Î¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ï¡¢ +HOWTO ¤È mini-HOWTO ¤ò°Ê²¼¤Î¾ì½ê¤ËÃÖ¤¤¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£ +.PD 0 +.TP +.\"O \fI/usr/doc/\fP (old place for documentation) +\fI/usr/doc/\fP (¸Å¤¤Ê¸½ñÃÖ¤­¾ì) +.TP +.\"O \fI/usr/share/doc/\fP (new place for documentation) +\fI/usr/share/doc\fP (¿·¤·¤¤Ê¸½ñÃÖ¤­¾ì) +.TP +.\"O \fI/usr/share/doc/HOWTO/\fP (HOWTO files) +\fI/usr/doc/HOWTO/\fP (HOWTO ʸ½ñ) +.TP +.\"O \fI/usr/share/doc/HOWTO/mini/\fP (mini-HOWTO files) +\fI/usr/share/doc/HOWTO/mini/\fP (mini-HOWTO ʸ½ñ) +.PD +.\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR info (1), +.BR man (1), +.BR xman (1x) +.PP +.\"O \fBinfo\fP pages as read with +.\"O .BR emacs (1) +.\"O or +.\"O .BR info (1) +.BR emacs (1) +¤ä +.BR info (1) +¤ÇÆɤá¤ë³Æ \fBinfo\fP ¥Ú¡¼¥¸¡£ diff --git a/obsolete/man8/lilo.8 b/obsolete/man8/lilo.8 new file mode 100644 index 00000000..c395144c --- /dev/null +++ b/obsolete/man8/lilo.8 @@ -0,0 +1,190 @@ +'\" t +.\" @(#)lilo.8 1.0 950728 aeb +.\" This page is based on the lilo docs, which carry the following +.\" COPYING condition: +.\" +.\" LILO program code, documentation and auxiliary programs are +.\" Copyright 1992-1994 Werner Almesberger. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms of parts of or the +.\" whole original or derived work are permitted provided that the +.\" original work is properly attributed to the author. The name of the +.\" author may not be used to endorse or promote products derived from +.\" this software without specific prior written permission. This work +.\" is provided "as is" and without any express or implied warranties. +.\" +.\" Original version, Andries Brouwer (aeb@cwi.nl), 950728 +.\" Added t directive, as Daniel Quinlan asked, 950824 +.\" +.\" Japanese Version Copyright (c) 1996 TACHIBANA Akira +.\" all rights reserved. +.\" Translated Sun Jul 28 17:42:39 JST 1996 +.\" by TACHIBANA Akira +.\" Modified Sat May 3 12:31:22 JST 1997 +.\" by SUGIURA Yoshiki +.\" +.\"WORD: boot loader ¥Ö¡¼¥È¥í¡¼¥À +.\"WORD: boot sector ¥Ö¡¼¥È¥»¥¯¥¿¡¼ +.\"WORD: disk geometry ¥Ç¥£¥¹¥¯¥¸¥ª¥á¥È¥ê +.\" +.TH LILO 8 "28 July 1995" +.SH ̾Á° +lilo \- ¥Ö¡¼¥È¥í¡¼¥À ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë +.SH ½ñ¼° +¼ç¤Ê»È¤¤Êý: +.LP +.B " /sbin/lilo" +\- ¥Ö¡¼¥È¥í¡¼¥À¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë +.LP +¾¤Î»È¤¤Êý: +.LP +.B " /sbin/lilo -q" +\- ¥Þ¥Ã¥×¤òÄ´¤Ù¤ë +.br +.B " /sbin/lilo -R" +\- ¼¡²ó¥ê¥Ö¡¼¥È¤ÇÍ­¸ú¤È¤Ê¤ë¥Ç¥Õ¥©¥ë¥È¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë +.br +.B " /sbin/lilo -I" +\- ¸½ºß¤Î¥«¡¼¥Í¥ë¤Î¥Ñ¥¹Ì¾¤òÄ´¤Ù¤ë +.br +.B " /sbin/lilo {-u|-U}" +\- lilo ¤ò¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë +.SH ÀâÌÀ +.LP +.B lilo +\ \¤Ï¡¢¼¡²ó¥Ö¡¼¥È»þ¤ËÍ­¸ú¤È¤Ê¤ë¥Ö¡¼¥È¥í¡¼¥À¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¡£ +°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤¬¤¢¤ë¡£ +.LP +.TP +.B \-\^v +¤è¤ê¿¤¯¤Î¾ðÊó¤ò½ÐÎϤ¹¤ë¡£°ì¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î \fB-v\fP ¥ª¥×¥·¥ç¥ó¤ò +Í¿¤¨¤ë¤³¤È¤Ç lilo ¤¬½ÐÎϤ¹¤ë¾ðÊ󤬤è¤ê¿¤¯¤Ê¤ë¡£ +.TP +.B \-\^q +¸½ºß¤Î¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤ÎÆâÍƤòɽ¼¨¤¹¤ë¡£ +.B lilo +\ \¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç +.IR "/boot/map" +¤ò»ÈÍѤ¹¤ë¡£¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¥Ö¡¼¥È²Äǽ¤Ê(Ê£¿ô¤Î)¥«¡¼¥Í¥ë¤Î̾Á°¤È +¤½¤Î¾ì½ê¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤½¤ÎÃæ¤Ë¤¢¤ë¥«¡¼¥Í¥ë¤Î̾Á°¤òɽ¼¨¤¹¤ë¡£ +.TP +.BI "\-\^m " map-file +¥Ç¥Õ¥©¥ë¥È¤Î¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤ÎÂå¤ï¤ê¤Ë»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ¹¤ë¡£ +.TP +.BI "\-\^C " config-file +.B lilo +\ \¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÀßÄê¤ò +.IR "/etc/lilo.conf" +\ \¤«¤éÆɤ߹þ¤à¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Ç¥Õ¥©¥ë¥È°Ê³°¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë +»ÈÍѤ¹¤ë¡£ +.TP +.BI "\-\^d " delay +Ê£¿ô¤Î¥«¡¼¥Í¥ë¤ò¥Ö¡¼¥È²Äǽ¤ËÀßÄꤷ¤Æ¤¤¤¿¾ì¹ç¡¢¥Ö¡¼¥È»þ¤Ë Shift ¥­¡¼¤ò²¡¤¹¤È¡¢ +¥Ö¡¼¥È¥í¡¼¥À¤Ï¤É¤Î¥«¡¼¥Í¥ë¤Ç¥Ö¡¼¥È¤¹¤ë¤«¤ÎÆþÎϤòÂԤġ£ +¤½¤Î¾õÂ֤ǥ¿¥¤¥à¥¢¥¦¥È¤¹¤ë¤È¡¢¥ê¥¹¥È¤ÎºÇ½é¤Ë¤¢¤ë¥«¡¼¥Í¥ë¤Ç¥Ö¡¼¥È¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥¿¥¤¥à¥¢¥¦¥È¤¹¤ë¤Þ¤Ç¤Î»þ´Ö¤ò0.1ÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.TP +.BI "\-\^D " label +¥Ö¡¼¥È»þ¤Ë¥ê¥¹¥È¤ÎºÇ½é¤Ë¸½¤ì¤ë¥Ç¥Õ¥©¥ë¥È¥«¡¼¥Í¥ë¤ÎÂå¤ï¤ê¤Ë¡¢ +»ØÄꤵ¤ì¤¿¥é¥Ù¥ë¤Î¥«¡¼¥Í¥ë¤ò»ÈÍѤ¹¤ë¡£ +.TP +.BI "\-\^r " root-directory +Áàºî¤ò¹Ô¤¦Á°¤Ë¡¢ +\fIchroot\fP ¤Ç¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë¡£ +¥Õ¥í¥Ã¥Ô¥£¤Ç¥Ö¡¼¥È¤·ÀßÄê¤ò½¤Àµ¤¹¤ë¤È¤­¤Ë»ÈÍѤ¹¤ë¡£ +.TP +.BI "\-\^t " +¥Æ¥¹¥È¤ò¹Ô¤¦¡£¥Ö¡¼¥È¥»¥¯¥¿¡¼¤ä¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤Ï½ñ´¹¤¨¤Ê¤¤¡£ +\fB-v\fP ¤È¶¦¤Ë»ØÄꤷ¤Æ¡¢ +.B lilo +\ \¤¬²¿¤ò¹Ô¤¦¤«¤ò³Îǧ¤¹¤ë¤³¤È¡£ +.TP +.B "\-\^c" +¥Þ¥Ã¥×¤Î°µ½Ì¤òÍ­¸ú¤Ë¤¹¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢¥Ö¡¼¥È¥»¥¯¥¿¡¼ ÉÕ¶á¤Ø¤Î read ¤ò¥Þ¡¼¥¸ +¤¹¤ë¡£¥Ö¡¼¥È¤Î¥¹¥Ô¡¼¥É¤¬¾å¤¬¤ë(Æä˥եí¥Ã¥Ô¥£¤Î¾ì¹ç)¡£ +.TP +.BI "\-\^f " disk-tab +¥Ç¥£¥¹¥¯¥¸¥ª¥á¥È¥ê¥Ñ¥é¥á¡¼¥¿¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë(¥Ç¥Õ¥©¥ë¥È¤Ï +.IR /etc/disktab ) ¡£ +.TP +.BI "\-\^i " boot-sector +¥Ö¡¼¥È¥»¥¯¥¿¡¼¤È¤·¤Æ»È¤¦¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë(¥Ç¥Õ¥©¥ë¥È¤Ï +.IR /boot/boot.b )¡£ +.TP +.BI "\-\^l" +sector/head/cylinder ¥¢¥É¥ì¥¹¤ÎÂå¤ï¤ê¤Ë¡¢linear sector ¥¢¥É¥ì¥¹¤ò +À¸À®¤¹¤ë¡£ +.TP +.BI "\-\^P " "{fix|ignore}" +linear ¥¢¥É¥ì¥¹¤È sector/head/cylinder ¥¢¥É¥ì¥¹¤¬°ìÃפ·¤Ê¤¯ +¤Ê¤Ã¤¿¤Ê¤É¤Î "°Û¾ï"¤Î¸«¤Ä¤«¤Ã¤¿¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤ò +½¤Éü¤â¤·¤¯¤Ï̵»ë¤¹¤ë¡£ +.TP +.BI "\-\^s " save-file +.B lilo +\ \¤¬¥Ö¡¼¥È¥»¥¯¥¿¡¼¤ò¾å½ñ¤­¤¹¤ë¤È¤­¡¢°ÊÁ°¤ÎÆâÍƤòÊݸ¤¹¤ë¤Î¤Ë¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +.I /boot/boot.NNNN +\ \¤ò»ÈÍѤ¹¤ë¡£ +NNNN ¤¬²¿¤Ë¤Ê¤ë¤«¤Ï¥Ç¥Ð¥¤¥¹¤Ë°Í¸¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢¤½¤ÎÂå¤ï¤ê¤Ë¥Ö¡¼¥È¥»¥¯¥¿¤òÊݸ¤¹¤ë¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤹ¤ë + (¤Þ¤¿¤Ï¡¢\fB-u\fP ¥ª¥×¥·¥ç¥ó¤È¶¦¤Ë»ØÄꤷ¡¢¥Ö¡¼¥È¥»¥¯¥¿¤òÉüµì¤¹¤ë¥Õ¥¡¥¤¥ë̾¤ò +»ØÄꤹ¤ë)¡£ +.TP +.BI "\-\^S " save-file +Ä̾ +.B lilo +\ \¤Ï´û¤Ë¤¢¤ë¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤­¤·¤Ê¤¤¤¬¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È +¾å½ñ¤­¤µ¤ì¤ë¡£ +.TP +.BI "\-\^u " device-name +Êݸ¤µ¤ì¤¿¥Ö¡¼¥È¥»¥¯¥¿¤ò¥³¥Ô¡¼¤·¤Æ +.BR lilo +\ \¤ò¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¡£¤½¤ÎºÝ¥¿¥¤¥à¥¹¥¿¥ó¥×¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +.TP +.BI "\-\^U " device-name +¾å¤Î¥ª¥×¥·¥ç¥ó¤ÈƱÍͤÀ¤¬¥¿¥¤¥à¥¹¥¿¥ó¥×¤ò¥Á¥§¥Ã¥¯¤·¤Ê¤¤¡£ +.TP +.BI "\-\^R " "command line" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¼¡²ó¥Ö¡¼¥È»þ¤Ë»ÈÍѤµ¤ì¤ë¥Ç¥Õ¥©¥ë¥È¤Î¥³¥Þ¥ó¥É¤ò +ÀßÄꤹ¤ë¡£¥Ö¡¼¥È¥í¡¼¥À¤Ï¼¡²ó¥Ö¡¼¥È¸å¤³¤ÎÀßÄê¤òÇË´þ¤¹¤ë¡£ +ÀßÄꤵ¤ì¤¿¥³¥Þ¥ó¥É¤¬Í­¸ú¤Ê¤Î¤Ï°ì²ó¸Â¤ê¤Ç¤¢¤ë¡£ +ŵ·¿Åª¤Ê»ÈÍÑË¡¤Ï¥ê¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤ÎÃæ¤Ç¡¢`shutdown -r' ¤ò¹Ô¤¦Á° +¤Ê¤É¤Ç¤¢¤ë¡£ +.TP +.BI "\-\^I " "label" +¥¹¥¿¡¼¥È¥¢¥Ã¥×¸å¤Ë¡¢´Ä¶­ÊÑ¿ô BOOT_IMAGE ¤Ç¼Â¹Ô¤·¤¿¥«¡¼¥Í¥ë¤Î¥é¥Ù¥ë¤¬ +»²¾È¤Ç¤­¤ë¤è¤¦¤¹¤ë¡£ +¤³¤Î¥³¥Þ¥ó¥É¤Ï°ìÃפ·¤¿¥Ñ¥¹Ì¾¤òɸ½à½ÐÎÏ(stdout)¤Ëɽ¼¨¤¹¤ë¡£ +.TP +.B "\-\^V" +¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òɽ¼¨¤¹¤ë¡£ + +.LP +º¸¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤Ï¡¢±¦¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤Î¥­¡¼¥ï¡¼¥É¤È +Ʊ¤¸°ÕÌ£¤Ç¤¢¤ë¡£ +.IP +.TS +l l. +-b bootdev boot=bootdev +-c compact +-d dsec delay=dsec +-D label default=label +-i bootsector install=bootsector +-f file disktab=file +-l linear +-m mapfile map=mapfile +-P fix fix-table +-P ignore ignore-table +-s file backup=file +-S file force-backup=file +-v verbose=level +.TE +.SH ´ØÏ¢¹àÌÜ +lilo.conf(5). +.br +lilo ¤Î¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ë¤Ï¿¤¯¤Î¥É¥­¥å¥á¥ó¥È¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.SH Ãø¼Ô +Werner Almesberger diff --git a/obsolete/man9/ksoftirqd.9 b/obsolete/man9/ksoftirqd.9 new file mode 100644 index 00000000..97ad008c --- /dev/null +++ b/obsolete/man9/ksoftirqd.9 @@ -0,0 +1,70 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 2003 Matthew Wilcox +.\" +.\" 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 is 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. +.\" +.\" 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 Feb 3 03:08:49 JST 2005 +.\" by Yuichi SATO +.\" +.TH KSOFTIRQD 9 2003-08-24 "Linux 2.6.0" "Linux Programmer's Manual" +.\"O .SH NAME +.SH ̾Á° +.\"O ksoftirqd \- Softirq daemon +ksoftirqd \- softirq ¥Ç¡¼¥â¥ó +.\"O .SH DESCRIPTION +.SH ÀâÌÀ +.\"O .B ksoftirqd +.\"O is a per-cpu kernel thread that runs when the machine is under heavy +.\"O soft-interrupt load. +.\"O Soft interrupts are normally serviced on return from +.\"O a hard interrupt, but it's possible for soft interrupts to be triggered +.\"O more quickly than they can be serviced. +.\"O If a soft interrupt is triggered +.\"O for a second time while soft interrupts are being handled, the +.\"O .B ksoftirq +.\"O daemon is triggered to handle the soft interrupts in process context. +.B ksoftirqd +¤Ï CPU Ëè¤Î¥«¡¼¥Í¥ë¥¹¥ì¥Ã¥É¤Ç¡¢ +¥Þ¥·¥ó¤Î¥½¥Õ¥È³ä¤ê¹þ¤ß (interrupt) ¤ÎÉé²Ù¤¬¹â¤¯¤Ê¤Ã¤¿¤È¤­¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ +¥½¥Õ¥È³ä¤ê¹þ¤ß¤Ï¡¢Ä̾ï¤Ï¥Ï¡¼¥É³ä¤ê¹þ¤ß¤«¤éÊ֤俤Ȥ­¤Ë½èÍý¤µ¤ì¤ë¡£ +¤·¤«¤·¥½¥Õ¥È³ä¤ê¹þ¤ß¤Ï¡¢¤½¤ì¤¬½èÍý¤µ¤ì¤ë¤è¤ê¤â®¤¯¡¢ +¥È¥ê¥¬¤·¤Æ¤ª¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ +¥½¥Õ¥È³ä¤ê¹þ¤ß¤¬½èÍý¤µ¤ì¤Æ¤¤¤ë´Ö¤Ë 2 ²óÌܤΥ½¥Õ¥È³ä¤ê¹þ¤ß¤¬¥È¥ê¥¬¤µ¤ì¤ë¤È¡¢ +.B ksoftirq +¥Ç¡¼¥â¥ó¤¬¥È¥ê¥¬¤µ¤ì¡¢¥½¥Õ¥È³ä¤ê¹þ¤ß¤¬¥×¥í¥»¥¹¥³¥ó¥Æ¥­¥¹¥È¤Ç½èÍý¤µ¤ì¤ë¡£ +.\"Osato: +.\"Osato: service, trigger ¤ÎÎɤ¤Ìõ¤¬»×¤¤¤Ä¤«¤Ê¤¤¡£ +.\"Osato: +.\"O If +.\"O .B ksoftirqd +.\"O is taking more than a tiny percentage of CPU time, this indicates the +.\"O machine is under heavy soft interrupt load. +.B ksoftirqd +¤¬ CPU »þ´Ö¤ò¿ô % °Ê¾å»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¥Þ¥·¥ó¤Î¥½¥Õ¥È³ä¤ê¹þ¤ß¤ÎÉé²Ù¤¬¹â¤¤¤³¤È¤òɽ¤¹¡£ +.\"O .SH HISTORY +.SH ÍúÎò +.\"O .B ksoftirqd +.\"O was introduced during the 2.3 development series as part of the +.\"O softnet work by Alexey Kuznetsov and David Miller. +.B ksoftirqd +¤Ï 2.3 ³«È¯¥·¥ê¡¼¥º¤Ë¤ª¤¤¤Æ¡¢Alexey Kuznetsov ¤È David Miller ¤Ë¤è¤ë +softnet ¤ÎºîÀ®¤Î°ìÉô¤È¤·¤ÆƳÆþ¤µ¤ì¤¿¡£ diff --git a/obsolete_list b/obsolete_list new file mode 100644 index 00000000..b4f6acb1 --- /dev/null +++ b/obsolete_list @@ -0,0 +1,37 @@ +¡ù:LDP man-pages:1.30=>1.31:2000/08/05:chgrp:1:2000/01/23::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:1.31:1998/09/14:dircolors:1:2000/09/14::argrath@ub32.org:Kentaro Shirakata: +¡ù:LDP man-pages:1.52=>1.55:2002/08/06:intro:1:2000/01/14::argrath@yo.rim.or.jp:Kentaro Shirakata: +¡û:LDP man-pages:1.31:1999/03/29:touch:1:2000/01/23::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡ý:LDP man-pages:1.34:1994/08/02:setregid:2:1999/12/03::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:2.07:2003/11/11:sstk:2:2004/07/18::ysato444@yahoo.co.jp:Yuichi SATO: +¡ý:LDP man-pages:1.38:1996/04/12:undocumented:2:1997/12/04::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:1.31:2000/12/05:getpass:3:1997/9/21::nagoya@cc.hit-u.ac.jp:NAGOYA Hiroaki: +¢¡:LDP man-pages:1.22=>1.27:1995/09/16:snprintf:3:1999/11/11::motoki@ptl.abk.nec.co.jp:Akihiro MOTOKI:From 1.28, this page is alias to printf.3. +¡û:LDP man-pages:1.25:1994/09/12:mblen:3:1997/12/16::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka:On 1.26, this page is changed to GNU based. +¡û:LDP man-pages:1.25:1994/09/12:mbstowcs:3:1997/12/16::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka:On 1.26, this page is changed to GNU based. +¡û:LDP man-pages:1.25:1994/09/12:mbtowc:3:1997/12/16::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka:On 1.26, this page is changed to GNU based. +¡ù:LDP man-pages:1.66=>2.01:2004/12/26:mlockall:2:2004/06/13::ysato444@yahoo.co.jp:Yuichi SATO: +¢¡:LDP man-pages:1.60=>1.66=>2.01:2004/12/26:munlock:2:2004/05/23::argrath@ub32.org:Kentaro Shirakata: +¡ù:LDP man-pages:1.66=>2.01:2004/12/26:munlockall:2:1997/02/23::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡ù:LDP man-pages:1.66=>2.01:2004/12/26:isinf:3:2003/10/11::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:1.53:1993/04/25:readv:3:1998/05/25::stada@mech.titech.ac.jp:Shigeru Tada:On 1.54, this page is removed. +¡û:LDP man-pages:1.22:1995/05/18:wcstombs:3:1997/12/16::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka:On 1.26, this page is changed to GNU based. +¡û:LDP man-pages:1.25:1994/09/12:wctomb:3:1997/12/16::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka:On 1.26, this page is changed to GNU based. +¡û:LDP man-pages:1.34:1999/03/29:lilo.conf:5:1999/08/20::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:1.34:1995/07/28:lilo:8:1997/05/17::tati@tky.3web.ne.jp:TACHIBANA Akira: +¡û:LDP man-pages:2.14:1995/08/31:sigblock:2:1997/03/03::hanataka@abyss.rim.or.jp:HANATAKA Shinya:dissap. at 2.16 +¡÷:LDP man-pages:2.14:1995/08/31:siggetmask:2:sigblock:2:dissap. at 2.16 +¡÷:LDP man-pages:2.14:1995/08/31:sigmask:2:sigblock:2:dissap. at 2.16 +¡û:LDP man-pages:2.14:2004/12/26:sigpause:2:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO:dissap. at 2.16 +¡÷:LDP man-pages:2.14:1995/08/31:sigsetmask:2:sigblock:2:dissap. at 2.16 +¡û:LDP man-pages:2.14:2004/12/26:sigvec:2:1999/07/27::hanataka@abyss.rim.or.jp:HANATAKA Shinya:dissap. at 2.16 +¡û:LDP man-pages:2.53:0000/00/00:LDP:7:2005/03/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:2.53:2004/12/26:ksoftirqd:9:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:2.60:1995/07/22:obsolete:2:1997/02/23::hanataka@abyss.rim.or.jp:HANATAKA Shinya:dissap. at 2.63 +¡û:LDP man-pages:2.60:2004/12/26:undocumented:2:2003/03/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI:dissap. at 2.63 +¡û:LDP man-pages:2.60:1993/04/04:killpg:3:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO:dissap. at 2.63 +¡û:LDP man-pages:2.60:1995/07/22:obsolete:2:1997/02/23::hanataka@abyss.rim.or.jp:HANATAKA Shinya:dissap. at 2.63 +¡û:LDP man-pages:2.60:2004/12/26:undocumented:2:2003/03/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI:dissap. at 2.63 +¡û:LDP man-pages:2.60:1993/04/04:killpg:3:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO:dissap. at 2.63 +¡û:LDP man-pages:2.64:2007/07/26:fdatasync:2:2004/06/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.15:2007/07/26:gethostid:2:1999/01/23::hanataka@abyss.rim.or.jp:HANATAKA Shinya:dissap. at 3.16 diff --git a/original/man-pages.lsm b/original/man-pages.lsm new file mode 100644 index 00000000..e8022530 --- /dev/null +++ b/original/man-pages.lsm @@ -0,0 +1,14 @@ +Begin3 +Title: Section 2, 3, 4, 5 and 7 man pages for Linux +Version: 3.24 +Entered-date: 2010-02-25 +Description: Linux manual pages +Keywords: man pages +Author: several +Maintained-by: Michael Kerrisk +Primary-site: ftp://ftp.kernel.org/pub/linux/docs/man-pages + 1608k man-pages-3.24.tar.gz +Alternate-site: ftp://ftp.win.tue.nl/pub/linux-local/manpages +Copying-policy: several; the pages are all freely distributable as long as + nroff source is provided +End diff --git a/original/man1/intro.1 b/original/man1/intro.1 new file mode 100644 index 00000000..33191e57 --- /dev/null +++ b/original/man1/intro.1 @@ -0,0 +1,301 @@ +.\" Copyright (c) 2002 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. +.\" +.\" 2007-10-23 mtk Added intro paragraph about section, plus a paragraph +.\" about exit status values. +.\" +.TH INTRO 1 2007-11-15 "Linux" "Linux User's Manual" +.SH NAME +intro \- Introduction to user commands +.SH DESCRIPTION +Section 1 of the manual describes user commands and tools, +for example, file manipulation tools, shells, compilers, +web browsers, file and image viewers and editors, and so on. + +All commands yield a status value on termination. +This value can be tested (e.g., in most shells the variable +.I $? +contains the status of the last executed command) +to see whether the command completed successfully. +A zero exit status is conventionally used to indicate success, +and a nonzero status means that the command was unsuccessful. +(Details of the exit status can be found in +.BR wait (2).) +A nonzero exit status can be in the range 1 to 255, and some commands +use different nonzero status values to indicate the reason why the +command failed. +.SH NOTES +Linux is a flavor of Unix, and as a first approximation +all user commands under Unix work precisely the same under +Linux (and FreeBSD and lots of other Unix-like systems). +.LP +Under Linux there are GUIs (graphical user interfaces), where you +can point and click and drag, and hopefully get work done without +first reading lots of documentation. +The traditional Unix environment +is a CLI (command line interface), where you type commands to +tell the computer what to do. +That is faster and more powerful, +but requires finding out what the commands are. +Below a bare minimum, to get started. +.SS "Login" +In order to start working, you probably first have to login, +that is, give your username and password. +See also +.BR login (1). +The program +.I login +now starts a +.I shell +(command interpreter) for you. +In case of a graphical login, you get a screen with menus or icons +and a mouse click will start a shell in a window. +See also +.BR xterm (1). +.SS "The shell" +One types commands to the +.IR shell , +the command interpreter. +It is not built-in, but is just a program +and you can change your shell. +Everybody has her own favorite one. +The standard one is called +.IR sh . +See also +.BR ash (1), +.BR bash (1), +.BR csh (1), +.BR zsh (1), +.BR chsh (1). +.LP +A session might go like + +.RS +.nf +.BI "knuth login: " aeb +.BI "Password: " ******** +.BI "% " date +Tue Aug 6 23:50:44 CEST 2002 +.BI "% " cal + August 2002 +Su Mo Tu We Th Fr Sa + 1 2 3 + 4 5 6 7 8 9 10 +11 12 13 14 15 16 17 +18 19 20 21 22 23 24 +25 26 27 28 29 30 31 + +.BI "% " ls +bin tel +.BI "% " "ls \-l" +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" +maja 0501\-1136285 +peter 0136\-7399214 +.BI "% " "cp tel tel2" +.BI "% " "ls \-l" +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" +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" +maja 0501\-1136285 +.B "% " +.fi +.RE +and here typing Control-D ended the session. +The +.B "% " +here was the command prompt \(em it is the shell's way of indicating +that it is ready for the next command. +The prompt can be customized +in lots of ways, and one might include stuff like username, +machine name, current directory, time, etc. +An assignment PS1="What next, master? " +would change the prompt as indicated. +.LP +We see that there are commands +.I date +(that gives date and time), and +.I cal +(that gives a calendar). +.LP +The command +.I ls +lists the contents of the current directory \(em it tells you what +files you have. +With a +.I \-l +option it gives a long listing, +that includes the owner and size and date of the file, and the +permissions people have for reading and/or changing the file. +For example, the file "tel" here is 37 bytes long, owned by aeb +and the owner can read and write it, others can only read it. +Owner and permissions can be changed by the commands +.I chown +and +.IR chmod . +.LP +The command +.I cat +will show the contents of a file. +(The name is from "concatenate and print": all files given as +parameters are concatenated and sent to "standard output", here +the terminal screen.) +.LP +The command +.I cp +(from "copy") will copy a file. +On the other hand, the command +.I mv +(from "move") only renames it. +.LP +The command +.I diff +lists the differences between two files. +Here there was no output because there were no differences. +.LP +The command +.I rm +(from "remove") deletes the file, and be careful! it is gone. +No wastepaper basket or anything. +Deleted means lost. +.LP +The command +.I grep +(from "g/re/p") finds occurrences of a string in one or more files. +Here it finds Maja's telephone number. +.SS "Pathnames and the current directory" +Files live in a large tree, the file hierarchy. +Each has a +.I "pathname" +describing the path from the root of the tree (which is called /) +to the file. +For example, such a full pathname might be /home/aeb/tel. +Always using full pathnames would be inconvenient, and the name +of a file in the current directory may be abbreviated by only giving +the last component. +That is why "/home/aeb/tel" can be abbreviated +to "tel" when the current directory is "/home/aeb". +.LP +The command +.I pwd +prints the current directory. +.LP +The command +.I cd +changes the current directory. +Try "cd /" and "pwd" and "cd" and "pwd". +.SS "Directories" +The command +.I mkdir +makes a new directory. +.LP +The command +.I rmdir +removes a directory if it is empty, and complains otherwise. +.LP +The command +.I find +(with a rather baroque syntax) will find files with given name +or other properties. +For example, "find . \-name tel" would find +the file "tel" starting in the present directory (which is called "."). +And "find / \-name tel" would do the same, but starting at the root +of the tree. +Large searches on a multi-GB disk will be time-consuming, +and it may be better to use +.BR locate (1). +.SS "Disks and Filesystems" +The command +.I mount +will attach the file system found on some disk (or floppy, or CDROM or so) +to the big file system hierarchy. +And +.I umount +detaches it again. +The command +.I df +will tell you how much of your disk is still free. +.SS "Processes" +On a Unix system many user and system processes run simultaneously. +The one you are talking to runs in the +.IR foreground , +the others in the +.IR background . +The command +.I ps +will show you which processes are active and what numbers these +processes have. +The command +.I kill +allows you to get rid of them. +Without option this is a friendly +request: please go away. +And "kill \-9" followed by the number +of the process is an immediate kill. +Foreground processes can often be killed by typing Control-C. +.SS "Getting information" +There are thousands of commands, each with many options. +Traditionally commands are documented on +.IR "man pages" , +(like this one), so that the command "man kill" will document +the use of the command "kill" (and "man man" document the command "man"). +The program +.I man +sends the text through some +.IR pager , +usually +.IR less . +Hit the space bar to get the next page, hit q to quit. +.LP +In documentation it is customary to refer to man pages +by giving the name and section number, as in +.BR man (1). +Man pages are terse, and allow you to find quickly some forgotten +detail. +For newcomers an introductory text with more examples +and explanations is useful. +.LP +A lot of GNU/FSF software is provided with info files. +Type "info info" +for an introduction on the use of the program "info". +.LP +Special topics are often treated in HOWTOs. +Look in +.I /usr/share/doc/howto/en +and use a browser if you find HTML files there. +.\" +.\" Actual examples? Separate section for each of cat, cp, ...? +.\" gzip, bzip2, tar, rpm +.SH "SEE ALSO" +.BR standards (7) diff --git a/original/man1/ldd.1 b/original/man1/ldd.1 new file mode 100644 index 00000000..5646b9c3 --- /dev/null +++ b/original/man1/ldd.1 @@ -0,0 +1,77 @@ +.\" Copyright 1995-2000 David Engel (david@ods.com) +.\" Copyright 1995 Rickard E. Faith (faith@cs.unc.edu) +.\" Copyright 2000 Ben Collins (bcollins@debian.org) +.\" Redone for GLibc 2.2 +.\" Copyright 2000 Jakub Jelinek (jakub@redhat.com) +.\" Corrected. +.\" Most of this was copied from the README file. +.\" Do not restrict distribution. +.\" May be distributed under the GNU General Public License +.TH LDD 1 2000-10-30 "" "Linux Programmer's Manual" +.SH NAME +ldd \- print shared library dependencies +.SH SYNOPSIS +.BR ldd " [OPTION]... FILE..." +.SH DESCRIPTION +.B ldd +prints the shared libraries required by each program or shared library +specified on the command line. +.SH OPTIONS +.TP +.B \-\-version +Print the version number of +.BR ldd . +.TP +.B \-v\ \-\-verbose +Print all information, including, for example, +symbol versioning information. +.TP +.B \-u\ \-\-unused +Print unused direct dependencies. +(Since glibc 2.3.4.) +.TP +.B \-d\ \-\-data\-relocs +Perform relocations and report any missing objects (ELF only). +.TP +.B \-r\ \-\-function\-relocs +Perform relocations for both data objects and functions, and +report any missing objects or functions (ELF only). +.TP +.B \-\-help +Usage information. +.SH NOTES +The standard version of +.B ldd +comes with glibc2. +Libc5 came with an older version, still present +on some systems. +The long options are not supported by the libc5 version. +On the other hand, the glibc2 version does not support +.B \-V +and only has the equivalent +.BR \-\-version . +.LP +The libc5 version of this program will use the name of a library given +on the command line as-is when it contains a \(aq/\(aq; otherwise it +searches for the library in the standard locations. +To run it +on a shared library in the current directory, prefix the name with "./". +.SH BUGS +.B ldd +does not work on a.out shared libraries. +.PP +.B ldd +does not work with some extremely old a.out programs which were +built before +.B ldd +support was added to the compiler releases. +If you use +.B ldd +on one of these programs, the program will attempt to run with +\fIargc\fP = 0 and the results will be unpredictable. +.\" .SH AUTHOR +.\" David Engel. +.\" Roland McGrath and Ulrich Drepper. +.SH SEE ALSO +.BR ld.so (8), +.BR ldconfig (8) diff --git a/original/man1/time.1 b/original/man1/time.1 new file mode 100644 index 00000000..662c696e --- /dev/null +++ b/original/man1/time.1 @@ -0,0 +1,305 @@ +.\" Copyright Andries Brouwer, 2000 +.\" +.\" This page is distributed under GPL. +.\" Some fragments of text came from the time-1.7 info file. +.\" Inspired by kromJx@crosswinds.net. +.\" +.TH TIME 1 2008-11-14 "" "Linux User's Manual" +.SH NAME +time \- time a simple command or give resource usage +.SH SYNOPSIS +.BI "time [" options "] " command " [" arguments... "] " +.SH DESCRIPTION +The +.B time +command runs the specified program +.I command +with the given arguments. +When +.I command +finishes, +.B time +writes a message to standard error giving timing statistics +about this program run. +These statistics consist of (i) the elapsed real time +between invocation and termination, (ii) the user CPU time +(the sum of the +.I tms_utime +and +.I tms_cutime +values in a +.I "struct tms" +as returned by +.BR times (2)), +and (iii) the system CPU time (the sum of the +.I tms_stime +and +.I tms_cstime +values in a +.I "struct tms" +as returned by +.BR times (2)). + +Note: some shells (e.g., +.BR bash (1)) +have a built-in +.B time +command that provides less functionality than the command described here. +To access the real command, you may need to specify its pathname +(something like +.IR /usr/bin/time ). +.SH OPTIONS +.TP +.B \-p +When in the POSIX locale, use the precise traditional format +.IP +.in +4n +"real %f\enuser %f\ensys %f\en" +.in +.IP +(with numbers in seconds) +where the number of decimals in the output for %f is unspecified +but is sufficient to express the clock tick accuracy, and at least one. +.SH "EXIT STATUS" +If +.I command +was invoked, the exit status is that of +.IR command . +Otherwise it is 127 if +.I command +could not be found, 126 if it could be found but could not be invoked, +and some other nonzero value (1-125) if something else went wrong. +.SH ENVIRONMENT +The variables +.BR LANG , +.BR LC_ALL , +.BR LC_CTYPE , +.BR LC_MESSAGES , +.BR LC_NUMERIC , +.BR NLSPATH , +and +.B PATH +are used. +The last one to search for +.IR command . +The remaining ones for the text and formatting of the output. +.SH "GNU VERSION" +Below a description of the GNU 1.7 version of +.BR time . +Disregarding the name of the utility, GNU makes it output lots of +useful information, not only about time used, but also on other +resources like memory, I/O and IPC calls (where available). +The output is formatted using a format string that can be specified +using the +.I \-f +option or the +.B TIME +environment variable. +.LP +The default format string is: +.PP +.in +4n +%Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k +.br +%Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps +.br +.in +.LP +When the +.I \-p +option is given the (portable) output format +.PP +.in +4n +real %e +.br +user %U +.br +sys %S +.br +.in +.PP +is used. +.SS "The format string" +The format is interpreted in the usual printf-like way. +Ordinary characters are directly copied, tab, newline +and backslash are escaped using \et, \en and \e\e, +a percent sign is represented by %%, and otherwise % +indicates a conversion. +The program +.B time +will always add a trailing newline itself. +The conversions follow. +All of those used by +.BR tcsh (1) +are supported. +.LP +.B "Time" +.TP +.B %E +Elapsed real time (in [hours:]minutes:seconds). +.TP +.B %e +(Not in tcsh.) Elapsed real time (in seconds). +.TP +.B %S +Total number of CPU-seconds that the process spent in kernel mode. +.TP +.B %U +Total number of CPU-seconds that the process spent in user mode. +.TP +.B %P +Percentage of the CPU that this job got, computed as (%U + %S) / %E. +.LP +.B "Memory" +.TP +.B %M +Maximum resident set size of the process during its lifetime, in Kbytes. +.TP +.B %t +(Not in tcsh.) Average resident set size of the process, in Kbytes. +.TP +.B %K +Average total (data+stack+text) memory use of the process, +in Kbytes. +.TP +.B %D +Average size of the process's unshared data area, in Kbytes. +.TP +.B %p +(Not in tcsh.) Average size of the process's unshared stack space, in Kbytes. +.TP +.B %X +Average size of the process's shared text space, in Kbytes. +.TP +.B %Z +(Not in tcsh.) System's page size, in bytes. +This is a per-system constant, but varies between systems. +.TP +.B %F +Number of major page faults that occurred while the process was running. +These are faults where the page has to be read in from disk. +.TP +.B %R +Number of minor, or recoverable, page faults. +These are faults for pages that are not valid but which have +not yet been claimed by other virtual pages. +Thus the data +in the page is still valid but the system tables must be updated. +.TP +.B %W +Number of times the process was swapped out of main memory. +.TP +.B %c +Number of times the process was context-switched involuntarily +(because the time slice expired). +.TP +.B %w +Number of waits: times that the program was context-switched voluntarily, +for instance while waiting for an I/O operation to complete. +.LP +.B "I/O" +.TP +.B %I +Number of file system inputs by the process. +.TP +.B %O +Number of file system outputs by the process. +.TP +.B %r +Number of socket messages received by the process. +.TP +.B %s +Number of socket messages sent by the process. +.TP +.B %k +Number of signals delivered to the process. +.TP +.B %C +(Not in tcsh.) Name and command-line arguments of the command being timed. +.TP +.B %x +(Not in tcsh.) Exit status of the command. +.SS "GNU Options" +.TP +.BI "\-f " FORMAT ", \-\-format=" FORMAT +Specify output format, possibly overriding the format specified +in the environment variable TIME. +.TP +.B "\-p, \-\-portability" +Use the portable output format. +.TP +.BI "\-o " FILE ", \-\-output=" FILE +Do not send the results to \fIstderr\fP, but overwrite the specified file. +.TP +.B "\-a, \-\-append" +(Used together with \-o.) Do not overwrite but append. +.TP +.B "\-v, \-\-verbose" +Give very verbose output about all the program knows about. +.SS "GNU Standard Options" +.TP +.B "\-\-help" +Print a usage message on standard output and exit successfully. +.TP +.B "\-V, \-\-version" +Print version information on standard output, then exit successfully. +.TP +.B "\-\-" +Terminate option list. +.SH BUGS +Not all resources are measured by all versions of Unix, +so some of the values might be reported as zero. +The present selection was mostly inspired by the data +provided by 4.2 or 4.3BSD. +.LP +GNU time version 1.7 is not yet localized. +Thus, it does not implement the POSIX requirements. +.LP +The environment variable +.B TIME +was badly chosen. +It is not unusual for systems like +.BR autoconf (1) +or +.BR make (1) +to use environment variables with the name of a utility to override +the utility to be used. +Uses like MORE or TIME for options to programs +(instead of program pathnames) tend to lead to difficulties. +.LP +It seems unfortunate that +.I \-o +overwrites instead of appends. +(That is, the +.I \-a +option should be the default.) +.LP +Mail suggestions and bug reports for GNU +.B time +to +.br +.I bug\-utils@prep.ai.mit.edu +.br +Please include the version of +.BR time , +which you can get by running +.br +.I time \-\-version +.br +and the operating system +and C compiler you used. +.\" .SH AUTHORS +.\" .TP +.\" .IP "David Keppel" +.\" Original version +.\" .IP "David MacKenzie" +.\" POSIXization, autoconfiscation, GNU getoptization, +.\" documentation, other bug fixes and improvements. +.\" .IP "Arne Henrik Juul" +.\" Helped with portability +.\" .IP "Francois Pinard" +.\" Helped with portability +.SH "SEE ALSO" +.BR tcsh (1), +.BR times (2), +.BR wait3 (2) diff --git a/original/man2/_Exit.2 b/original/man2/_Exit.2 new file mode 100644 index 00000000..9f9d2e76 --- /dev/null +++ b/original/man2/_Exit.2 @@ -0,0 +1 @@ +.so man2/_exit.2 diff --git a/original/man2/__clone2.2 b/original/man2/__clone2.2 new file mode 100644 index 00000000..68f41a5b --- /dev/null +++ b/original/man2/__clone2.2 @@ -0,0 +1 @@ +.so man2/clone.2 diff --git a/original/man2/_exit.2 b/original/man2/_exit.2 new file mode 100644 index 00000000..a6d0682e --- /dev/null +++ b/original/man2/_exit.2 @@ -0,0 +1,128 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 Wed Jul 21 23:02:38 1993 by Rik Faith +.\" Modified 2001-11-17, aeb +.\" +.TH _EXIT 2 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH NAME +_exit, _Exit \- terminate the calling process +.SH SYNOPSIS +.B #include +.sp +.BI "void _exit(int " status ); +.sp +.B #include +.sp +.BI "void _Exit(int " status ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR _Exit (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.SH DESCRIPTION +The function +.BR _exit () +terminates the calling process "immediately". +Any open file descriptors +belonging to the process are closed; any children of the process are +inherited by process 1, +.IR init , +and the process's parent is sent a +.B SIGCHLD +signal. +.LP +The value +.I status +is returned to the parent process as the process's exit status, and +can be collected using one of the +.BR wait (2) +family of calls. +.LP +The function +.BR _Exit () +is equivalent to +.BR _exit (). +.SH "RETURN VALUE" +These functions do not return. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001, 4.3BSD. +The function +.BR _Exit () +was introduced by C99. +.SH NOTES +For a discussion on the effects of an exit, the transmission of +exit status, zombie processes, signals sent, etc., see +.BR exit (3). +.LP +The function +.BR _exit () +is like +.BR exit (3), +but does not call any +functions registered with +.BR atexit (3) +or +.BR on_exit (3). +Whether it flushes +standard I/O buffers and removes temporary files created with +.BR tmpfile (3) +is implementation-dependent. +On the other hand, +.BR _exit () +does close open file descriptors, and this may cause an unknown delay, +waiting for pending output to finish. +If the delay is undesired, +it may be useful to call functions like +.BR tcflush (3) +before calling +.BR _exit (). +Whether any pending I/O is canceled, and which pending I/O may be +canceled upon +.BR _exit (), +is implementation-dependent. + +In glibc up to version 2.3, the +.BR _exit () +wrapper function invoked the kernel system call of the same name. +Since glibc 2.3, the wrapper function invokes +.BR exit_group (2), +in order to terminate all of the threads in a process. +.SH "SEE ALSO" +.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) diff --git a/original/man2/_llseek.2 b/original/man2/_llseek.2 new file mode 100644 index 00000000..d15dbee5 --- /dev/null +++ b/original/man2/_llseek.2 @@ -0,0 +1 @@ +.so man2/llseek.2 diff --git a/original/man2/_newselect.2 b/original/man2/_newselect.2 new file mode 100644 index 00000000..e1778431 --- /dev/null +++ b/original/man2/_newselect.2 @@ -0,0 +1 @@ +.so man2/select.2 diff --git a/original/man2/_syscall.2 b/original/man2/_syscall.2 new file mode 100644 index 00000000..1eba3376 --- /dev/null +++ b/original/man2/_syscall.2 @@ -0,0 +1,166 @@ +.\" +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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. +.\" +.\" Tue Jul 6 12:42:46 MDT 1993 +.\" Added "Calling Directly" and supporting paragraphs +.\" +.\" Modified Sat Jul 24 15:19:12 1993 by Rik Faith +.\" +.\" Modified 21 Aug 1994 by Michael Chastain : +.\" Added explanation of arg stacking when 6 or more args. +.\" +.\" Modified 10 June 1995 by Andries Brouwer +.\" +.\" 2007-10-23 mtk: created as a new page, by taking the content +.\" specific to the _syscall() macros from intro(2). +.\" +.TH _SYSCALL 2 2007-12-19 "Linux" "Linux Programmer's Manual" +.SH NAME +_syscall \- invoking a system call without library support (OBSOLETE) +.SH "SYNOPSIS" +.B #include + +A _syscall macro + +desired system call +.SH DESCRIPTION +The important thing to know about a system call is its prototype. +You need to know how many arguments, their types, +and the function return type. +There are seven macros that make the actual call into the system easier. +They have the form: +.sp +.RS +.RI _syscall X ( type , name , type1 , arg1 , type2 , arg2 ,...) +.RE +.PP +where +.IP +\fIX\fP is 0\(en6, which are the number of arguments taken by the +system call +.IP +\fItype\fP is the return type of the system call +.IP +\fIname\fP is the name of the system call +.IP +\fItypeN\fP is the Nth argument's type +.IP +\fIargN\fP is the name of the Nth argument +.PP +These macros create a function called \fIname\fP with the arguments you +specify. +Once you include the _syscall() in your source file, +you call the system call by \fIname\fP. +.SH FILES +.I /usr/include/linux/unistd.h +.SH "CONFORMING TO" +The use of these macros is Linux-specific, and deprecated. +.SH NOTES +Starting around kernel 2.6.18, the _syscall macros were removed +from header files supplied to user space. +Use +.BR syscall (2) +instead. +(Some architectures, notably ia64, never provided the _syscall macros; +on those architectures, +.BR syscall (2) +was always required.) + +The _syscall() macros \fIdo not\fP produce a prototype. +You may have to +create one, especially for C++ users. + +System calls are not required to return only positive or negative error +codes. +You need to read the source to be sure how it will return errors. +Usually, it is the negative of a standard error code, +for example, \-\fBEPERM\fP. +The _syscall() macros will return the result \fIr\fP of the system call +when \fIr\fP is nonnegative, but will return \-1 and set the variable +.I errno +to \-\fIr\fP when \fIr\fP is negative. +For the error codes, see +.BR errno (3). + +When defining a system call, the argument types \fImust\fP be +passed by-value or by-pointer (for aggregates like structs). +.\" The preferred way to invoke system calls that glibc does not know +.\" about yet is via +.\" .BR syscall (2). +.\" However, this mechanism can only be used if using a libc +.\" (such as glibc) that supports +.\" .BR syscall (2), +.\" and if the +.\" .I +.\" header file contains the required SYS_foo definition. +.\" Otherwise, the use of a _syscall macro is required. +.\" +.SH EXAMPLE +.nf +#include +#include +#include +#include /* for _syscallX macros/related stuff */ +#include /* for struct sysinfo */ + +_syscall1(int, sysinfo, struct sysinfo *, info); + +/* Note: if you copy directly from the nroff source, remember to +REMOVE the extra backslashes in the printf statement. */ + +int +main(void) +{ + struct sysinfo s_info; + 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", + s_info.uptime, s_info.loads[0], + s_info.loads[1], s_info.loads[2], + s_info.totalram, s_info.freeram, + s_info.sharedram, s_info.bufferram, + s_info.totalswap, s_info.freeswap, + s_info.procs); + exit(EXIT_SUCCESS); +} +.fi +.SS "Sample Output" +.nf +code error = 0 +uptime = 502034s +Load: 1 min 13376 / 5 min 5504 / 15 min 1152 +RAM: total 15343616 / free 827392 / shared 8237056 +Memory in buffers = 5066752 +Swap: total 27881472 / free 24698880 +Number of processes = 40 +.fi +.SH "SEE ALSO" +.BR intro (2), +.BR syscall (2), +.BR errno (3) diff --git a/original/man2/_sysctl.2 b/original/man2/_sysctl.2 new file mode 100644 index 00000000..9e14d4b1 --- /dev/null +++ b/original/man2/_sysctl.2 @@ -0,0 +1 @@ +.so man2/sysctl.2 diff --git a/original/man2/accept.2 b/original/man2/accept.2 new file mode 100644 index 00000000..3d69b87b --- /dev/null +++ b/original/man2/accept.2 @@ -0,0 +1,385 @@ +.\" Copyright (c) 1983, 1990, 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. +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-10-21 by Eric S. Raymond +.\" Modified 1998-2000 by Andi Kleen to match Linux 2.2 reality +.\" Modified 2002-04-23 by Roger Luethi +.\" Modified 2004-06-17 by Michael Kerrisk +.\" 2008-12-04, mtk, Add documentation of accept4() +.\" +.TH ACCEPT 2 2009-02-23 "Linux" "Linux Programmer's Manual" +.SH NAME +accept \- accept a connection on a socket +.SH SYNOPSIS +.nf +.BR "#include " " /* See NOTES */" +.B #include + +.BI "int accept(int " sockfd ", struct sockaddr *" addr ", socklen_t *" addrlen ); + +.B #define _GNU_SOURCE +.B #include + +.BI "int accept4(int " sockfd ", struct sockaddr *" addr , +.BI " socklen_t *" addrlen ", int " flags ); +.fi +.SH DESCRIPTION +The +.BR accept () +system call is used with connection-based socket types +.RB ( SOCK_STREAM , +.BR SOCK_SEQPACKET ). +It extracts the first connection request on the queue of pending +connections for the listening socket, +.IR sockfd , +creates a new connected socket, and returns a new file +descriptor referring to that socket. +The newly created socket is not in the listening state. +The original socket +.I sockfd +is unaffected by this call. +.PP +The argument +.I sockfd +is a socket that has been created with +.BR socket (2), +bound to a local address with +.BR bind (2), +and is listening for connections after a +.BR listen (2). + +The argument +.I addr +is a pointer to a +.I sockaddr +structure. +This structure is filled in with the address of the peer socket, +as known to the communications layer. +The exact format of the address returned +.I addr +is determined by the socket's address family (see +.BR socket (2) +and the respective protocol man pages). +When +.I addr +is NULL, nothing is filled in; in this case, +.I addrlen +is not used, and should also be NULL. + +The +.I addrlen +argument is a value-result argument: +the caller must initialize it to contain the +size (in bytes) of the structure pointed to by +.IR addr ; +on return it will contain the actual size of the peer address. + +The returned address is truncated if the buffer provided is too small; +in this case, +.I addrlen +will return a value greater than was supplied to the call. +.PP +If no pending +connections are present on the queue, and the socket is not marked as +nonblocking, +.BR accept () +blocks the caller until a connection is present. +If the socket is marked +nonblocking and no pending connections are present on the queue, +.BR accept () +fails with the error +.BR EAGAIN +or +.BR EWOULDBLOCK . +.PP +In order to be notified of incoming connections on a socket, you can use +.BR select (2) +or +.BR poll (2). +A readable event will be delivered when a new connection is attempted and you +may then call +.BR accept () +to get a socket for that connection. +Alternatively, you can set the socket to deliver +.B SIGIO +when activity occurs on a socket; see +.BR socket (7) +for details. +.PP +For certain protocols which require an explicit confirmation, +such as +DECNet, +.BR accept () +can be thought of as merely dequeuing the next connection request and not +implying confirmation. +Confirmation can be implied by +a normal read or write on the new file descriptor, and rejection can be +implied by closing the new socket. +Currently only +DECNet +has these semantics on Linux. + +If +.IR flags +is 0, then +.BR accept4 () +is the same as +.BR accept (). +The following values can be bitwise ORed in +.IR flags +to obtain different behavior: +.TP 16 +.B SOCK_NONBLOCK +Set the +.BR O_NONBLOCK +file status flag on the new open file description. +Using this flag saves extra calls to +.BR fcntl (2) +to achieve the same result. +.TP +.B SOCK_CLOEXEC +Set the close-on-exec +.RB ( FD_CLOEXEC ) +flag on the new file descriptor. +See the description of the +.B O_CLOEXEC +flag in +.BR open (2) +for reasons why this may be useful. +.SH "RETURN VALUE" +On success, +these system calls return a nonnegative integer that is a descriptor +for the accepted socket. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SS "Error Handling" +Linux +.BR accept () +(and +.BR accept4 ()) +passes already-pending network errors on the new socket +as an error code from +.BR accept (). +This behavior differs from other BSD socket +implementations. +For reliable operation the application should detect +the network errors defined for the protocol after +.BR accept () +and treat +them like +.B EAGAIN +by retrying. +In case of TCP/IP these are +.BR ENETDOWN , +.BR EPROTO , +.BR ENOPROTOOPT , +.BR EHOSTDOWN , +.BR ENONET , +.BR EHOSTUNREACH , +.BR EOPNOTSUPP , +and +.BR ENETUNREACH . +.SH ERRORS +.TP +.BR EAGAIN " or " EWOULDBLOCK +.\" Actually EAGAIN on Linux +The socket is marked nonblocking and no connections are +present to be accepted. +POSIX.1-2001 allows either error to be returned for this case, +and does not require these constants to have the same value, +so a portable application should check for both possibilities. +.TP +.B EBADF +The descriptor is invalid. +.TP +.B ECONNABORTED +A connection has been aborted. +.TP +.B EFAULT +The +.I addr +argument is not in a writable part of the user address space. +.TP +.B EINTR +The system call was interrupted by a signal that was caught +before a valid connection arrived; see +.BR signal (7). +.TP +.B EINVAL +Socket is not listening for connections, or +.I addrlen +is invalid (e.g., is negative). +.TP +.B EINVAL +.RB ( accept4 ()) +invalid value in +.IR flags . +.TP +.B EMFILE +The per-process limit of open file descriptors has been reached. +.TP +.B ENFILE +The system limit on the total number of open files has been reached. +.TP +.BR ENOBUFS ", " ENOMEM +Not enough free memory. +This often means that the memory allocation is limited by the socket buffer +limits, not by the system memory. +.TP +.B ENOTSOCK +The descriptor references a file, not a socket. +.TP +.B EOPNOTSUPP +The referenced socket is not of type +.BR SOCK_STREAM . +.TP +.B EPROTO +Protocol error. +.PP +In addition, Linux +.BR accept () +may fail if: +.TP +.B EPERM +Firewall rules forbid connection. +.PP +In addition, network errors for the new socket and as defined +for the protocol may be returned. +Various Linux kernels can +return other errors such as +.BR ENOSR , +.BR ESOCKTNOSUPPORT , +.BR EPROTONOSUPPORT , +.BR ETIMEDOUT . +The value +.B ERESTARTSYS +may be seen during a trace. +.SH VERSIONS +The +.BR accept4 () +system call is available starting with Linux 2.6.28; +support in glibc is available starting with version 2.10. +.SH "CONFORMING TO" +.BR accept (): +POSIX.1-2001, +SVr4, 4.4BSD, +.RB ( accept () +first appeared in 4.2BSD). +.\" 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. +.\" In addition, SUSv2 documents EFAULT and ENOSR. + +.BR accept4 () +is a nonstandard Linux extension. +.LP +On Linux, the new socket returned by +.BR accept () +does \fInot\fP inherit file status flags such as +.B O_NONBLOCK +and +.B O_ASYNC +from the listening socket. +This behavior differs from the canonical BSD sockets implementation. +.\" Some testing seems to show that Tru64 5.1 and HP-UX 11 also +.\" do not inherit file status flags -- MTK Jun 05 +Portable programs should not rely on inheritance or noninheritance +of file status flags and always explicitly set all required flags on +the socket returned from +.BR accept (). +.SH NOTES +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. + +There may not always be a connection waiting after a +.B SIGIO +is delivered or +.BR select (2) +or +.BR poll (2) +return a readability event because the connection might have been +removed by an asynchronous network error or another thread before +.BR accept () +is called. +If this happens then the call will block waiting for the next +connection to arrive. +To ensure that +.BR accept () +never blocks, the passed socket +.I sockfd +needs to have the +.B O_NONBLOCK +flag set (see +.BR socket (7)). +.SS The socklen_t type +The third argument of +.BR accept () +was originally declared as an \fIint *\fP (and is that under libc4 and libc5 +and on many other systems like 4.x BSD, SunOS 4, SGI); a POSIX.1g draft +standard wanted to change it into a \fIsize_t *\fP, and that is what it is +for SunOS 5. +Later POSIX drafts have \fIsocklen_t *\fP, +and so do the Single Unix Specification and glibc2. +Quoting Linus Torvalds: + +.\" .I fails: only italicizes a single line +"_Any_ sane library _must_ have "socklen_t" be the same size +as int. +Anything else breaks any BSD socket layer stuff. +POSIX initially \fIdid\fP make it a size_t, and I (and hopefully others, but +obviously not too many) complained to them very loudly indeed. +Making it a size_t is completely broken, exactly because size_t very +seldom is the same size as "int" on 64-bit architectures, for example. +And it +\fIhas\fP to be the same size as "int" because that's what the BSD socket +interface is. +Anyway, the POSIX people eventually got a clue, and created "socklen_t". +They shouldn't have touched it in the first place, but once they did +they felt it had to have a named type for some unfathomable reason +(probably somebody didn't like losing face over having done the original +stupid thing, so they silently just renamed their blunder)." +.SH EXAMPLE +See +.BR bind (2). +.SH "SEE ALSO" +.BR bind (2), +.BR connect (2), +.BR listen (2), +.BR select (2), +.BR socket (2), +.BR socket (7) diff --git a/original/man2/accept4.2 b/original/man2/accept4.2 new file mode 100644 index 00000000..963dfb54 --- /dev/null +++ b/original/man2/accept4.2 @@ -0,0 +1 @@ +.so man2/accept.2 diff --git a/original/man2/access.2 b/original/man2/access.2 new file mode 100644 index 00000000..20a3fd3a --- /dev/null +++ b/original/man2/access.2 @@ -0,0 +1,240 @@ +.\" 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. +.\" +.TH ACCESS 2 2007-07-10 "Linux" "Linux Programmer's Manual" +.SH NAME +access \- check real user's permissions for a file +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int access(const char *" pathname ", int " mode ); +.fi +.SH DESCRIPTION +.BR access () +checks whether the calling process can access the file +.IR pathname . +If +.I pathname +is a symbolic link, it is dereferenced. + +The +.I mode +specifies the accessibility check(s) to be performed, +and is either the value +.BR F_OK , +.\" F_OK is defined as 0 on every system that I know of. +or a mask consisting of the bitwise OR of one or more of +.BR R_OK ", " W_OK ", and " X_OK . +.B F_OK +tests for the existence of the file. +.BR R_OK ", " W_OK ", and " X_OK +test whether the file exists and grants read, write, and +execute permissions, respectively. + +The check is done using the calling process's +.I real +UID and GID, rather than the effective IDs as is done when +actually attempting an operation (e.g., +.BR open (2)) +on the file. +This allows set-user-ID programs to +easily determine the invoking user's authority. + +If the calling process is privileged (i.e., its real UID is zero), +then an +.B X_OK +check is successful for a regular file if execute permission +is enabled for any of the file owner, group, or other. +.SH "RETURN VALUE" +On success (all requested permissions granted), zero is returned. +On error (at least one bit in +.I mode +asked for a permission that is denied, or some other error occurred), +\-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.BR access () +shall fail if: +.TP +.B EACCES +The requested access would be denied to the file, or search permission +is denied for one of the directories in the path prefix of +.IR pathname . +(See also +.BR path_resolution (7).) +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR pathname . +.TP +.B ENAMETOOLONG +.I pathname +is too long. +.TP +.B ENOENT +A component of +.I pathname +does not exist or is a dangling symbolic link. +.TP +.B ENOTDIR +A component used as a directory in +.I pathname +is not, in fact, a directory. +.TP +.B EROFS +Write permission was requested for a file on a read-only file system. +.PP +.BR access () +may fail if: +.TP +.B EFAULT +.I pathname +points outside your accessible address space. +.TP +.B EINVAL +.I mode +was incorrectly specified. +.TP +.B EIO +An I/O error occurred. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ETXTBSY +Write access was requested to an executable which is being +executed. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH NOTES +.PP +.BR Warning : +Using +.BR access () +to check if a user is authorized to, for example, +open a file before actually doing so using +.BR open (2) +creates a security hole, because the user might exploit the short time +interval between checking and opening the file to manipulate it. +.BR "For this reason, the use of this system call should be avoided" . +.PP +.BR access () +returns an error if any of the access types in +.I mode +is denied, even if some of the other access types in +.I mode +are permitted. +.PP +If the calling process has appropriate privileges (i.e., is superuser), +POSIX.1-2001 permits implementation to indicate success for an +.B X_OK +check even if none of the execute file permission bits are set. +.\" HPU-UX 11 and Tru64 5.1 do this. +Linux does not do this. +.PP +A file is only accessible if the permissions on each of the +directories in the path prefix of +.I pathname +grant search (i.e., execute) access. +If any directory is inaccessible, then the +.BR access () +call will fail, regardless of the permissions on the file itself. +.PP +Only access bits are checked, not the file type or contents. +Therefore, if a directory is found to be writable, +it probably means that files can be created in the directory, +and not that the directory can be written as a file. +Similarly, a DOS file may be found to be "executable," but the +.BR execve (2) +call will still fail. +.PP +.BR access () +may not work correctly on NFS file systems with UID mapping enabled, +because UID mapping is done on the server and hidden from the client, +which checks permissions. +.SH BUGS +In kernel 2.4 (and earlier) there is some strangeness in the handling of +.B X_OK +tests for superuser. +If all categories of execute permission are disabled +for a nondirectory file, then the only +.BR access () +test that returns \-1 is when +.I mode +is specified as just +.BR X_OK ; +if +.B R_OK +or +.B W_OK +is also specified in +.IR mode , +then +.BR access () +returns 0 for such files. +.\" This behavior appears to have been an implementation accident. +Early 2.6 kernels (up to and including 2.6.3) +also behaved in the same way as kernel 2.4. + +In kernels before 2.6.20, +.BR access () +ignored the effect of the +.B MS_NOEXEC +flag if it was used to +.BR mount (2) +the underlying file system. +Since kernel 2.6.20, +.BR access () +honors this flag. +.SH "SEE ALSO" +.BR chmod (2), +.BR chown (2), +.BR faccessat (2), +.BR open (2), +.BR setgid (2), +.BR setuid (2), +.BR stat (2), +.BR euidaccess (3), +.BR credentials (7), +.BR path_resolution (7) diff --git a/original/man2/acct.2 b/original/man2/acct.2 new file mode 100644 index 00000000..622c1f95 --- /dev/null +++ b/original/man2/acct.2 @@ -0,0 +1,144 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 1993-07-22 by Rik Faith +.\" Modified 1993-08-10 by Alan Cox +.\" Modified 1998-11-04 by Tigran Aivazian +.\" Modified 2004-05-27, 2004-06-17, 2004-06-23 by Michael Kerrisk +.\" +.TH ACCT 2 2008-06-16 "Linux" "Linux Programmer's Manual" +.SH NAME +acct \- switch process accounting on or off +.SH SYNOPSIS +.ad l +.nf +.B #include +.sp +.BI "int acct(const char *" filename ); +.fi +.ad b +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR acct (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.SH DESCRIPTION +The +.BR acct () +system call enables or disables process accounting. +If called with the name of an existing file as its argument, +accounting is turned on, +and records for each terminating process are appended to +\fIfilename\fP as it terminates. +An argument of NULL causes accounting to be turned off. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +Write permission is denied for the specified file, +or search permission is denied for one of the directories +in the path prefix of +.I filename +(see also +.BR path_resolution (7)), +or +.I filename +is not a regular file. +.TP +.B EFAULT +.I filename +points outside your accessible address space. +.TP +.B EIO +Error writing to the file +.IR filename . +.TP +.B EISDIR +.I filename +is a directory. +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR filename . +.TP +.B ENAMETOOLONG +.I filename +was too long. +.TP +.B ENFILE +The system limit on the total number of open files has been reached. +.TP +.B ENOENT +The specified filename does not exist. +.TP +.B ENOMEM +Out of memory. +.TP +.B ENOSYS +BSD process accounting has not been enabled when the operating system +kernel was compiled. +The kernel configuration parameter controlling this feature is +.BR CONFIG_BSD_PROCESS_ACCT . +.TP +.B ENOTDIR +A component used as a directory in +.I filename +is not in fact a directory. +.TP +.B EPERM +The calling process has insufficient privilege to enable process accounting. +On Linux the +.B CAP_SYS_PACCT +capability is required. +.TP +.B EROFS +.I filename +refers to a file on a read-only file system. +.TP +.B EUSERS +There are no more free file structures or we ran out of memory. +.SH "CONFORMING TO" +SVr4, 4.3BSD (but not POSIX). +.\" SVr4 documents an EBUSY error condition, but no EISDIR or ENOSYS. +.\" Also AIX and HP-UX document EBUSY (attempt is made +.\" to enable accounting when it is already enabled), as does Solaris +.\" (attempt is made to enable accounting using the same file that is +.\" currently being used). +.SH NOTES +No accounting is produced for programs running when a system crash occurs. +In particular, nonterminating processes are never accounted for. + +The structure of the records written to the accounting file is described in +.BR acct (5). +.SH "SEE ALSO" +.BR acct (5) diff --git a/original/man2/add_key.2 b/original/man2/add_key.2 new file mode 100644 index 00000000..4cd01ab1 --- /dev/null +++ b/original/man2/add_key.2 @@ -0,0 +1,137 @@ +.\" +.\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. +.\" Written by David Howells (dhowells@redhat.com) +.\" +.\" 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. +.\" +.TH ADD_KEY 2 2010-02-25 Linux "Linux Key Management Calls" +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH NAME +add_key \- Add a key to the kernel's key management facility +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "key_serial_t add_key(const char *" type ", const char *" description , +.BI "const void *" payload ", size_t " plen ", key_serial_t " keyring ");" +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH DESCRIPTION +.BR add_key () +asks the kernel to create or update a key of the given +.I type +and +.IR description , +instantiate it with the +.I payload +of length +.IR plen , +and to attach it to the nominated +.I keyring +and to return its serial number. +.P +The key type may reject the data if it's in the wrong format or in some other +way invalid. +.P +If the destination +.I keyring +already contains a key that matches the specified +.IR type " and " description +then, if the key type supports it, that key will be updated rather than a new +key being created; if not, a new key will be created and it will displace the +link to the extant key from the keyring. +.P +The destination +.I keyring +serial number may be that of a valid keyring to which the caller has write +permission, or it may be a special keyring ID: +.TP +.B KEY_SPEC_THREAD_KEYRING +This specifies the caller's thread-specific keyring. +.TP +.B KEY_SPEC_PROCESS_KEYRING +This specifies the caller's process-specific keyring. +.TP +.B KEY_SPEC_SESSION_KEYRING +This specifies the caller's session-specific keyring. +.TP +.B KEY_SPEC_USER_KEYRING +This specifies the caller's UID-specific keyring. +.TP +.B KEY_SPEC_USER_SESSION_KEYRING +This specifies the caller's UID-session keyring. +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH KEY TYPES +There are a number of key types available in the core key management code, and +these can be specified to this function: +.TP +.B \*(lquser\*(rq +Keys of the user-defined key type may contain a blob of arbitrary data, and the +.I description +may be any valid string, though it is preferred that the description be +prefixed with a string representing the service to which the key is of interest +and a colon (for instance +.RB \*(lq afs:mykey \*(rq). +The +.I payload +may be empty or +.B NULL +for keys of this type. +.TP +.B \*(lqkeyring\*(rq +Keyrings are special key types that may contain links to sequences of other +keys of any type. If this interface is used to create a keyring, then a +.B NULL +.I payload +should be specified, and +.I plen +should be zero. +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH RETURN VALUE +On success +.BR add_key () +returns the serial number of the key it created or updated. +On error, the value +.B -1 +will be returned and errno will have been set to an appropriate error. +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH ERRORS +.TP +.B ENOKEY +The keyring doesn't exist. +.TP +.B EKEYEXPIRED +The keyring has expired. +.TP +.B EKEYREVOKED +The keyring has been revoked. +.TP +.B EINVAL +The payload data was invalid. +.TP +.B ENOMEM +Insufficient memory to create a key. +.TP +.B EDQUOT +The key quota for this user would be exceeded by creating this key or linking +it to the keyring. +.TP +.B EACCES +The keyring wasn't available for modification by the user. +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH LINKING +Although this is a Linux system call, it is not present in +.I libc +but can be found rather in +.IR libkeyutils . +When linking, +.B -lkeyutils +should be specified to the linker. +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH SEE ALSO +.BR keyctl (1), +.BR keyctl (2), +.BR request_key (2) diff --git a/original/man2/adjtimex.2 b/original/man2/adjtimex.2 new file mode 100644 index 00000000..286dc952 --- /dev/null +++ b/original/man2/adjtimex.2 @@ -0,0 +1,153 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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 1997-01-31 by Eric S. Raymond +.\" Modified 1997-07-30 by Paul Slootman +.\" Modified 2004-05-27 by Michael Kerrisk +.\" +.TH ADJTIMEX 2 2004-05-27 "Linux" "Linux Programmer's Manual" +.SH NAME +adjtimex \- tune kernel clock +.SH SYNOPSIS +.B #include +.sp +.BI "int adjtimex(struct timex *" "buf" ); +.SH DESCRIPTION +Linux uses David L. Mills' clock adjustment algorithm (see RFC\ 1305). +The system call +.BR adjtimex () +reads and optionally sets adjustment parameters for this algorithm. +It takes a pointer to a +.I timex +structure, updates kernel parameters from field values, +and returns the same structure with current kernel values. +This structure is declared as follows: +.PP +.in +4n +.nf +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 tolerance; /* clock frequency tolerance (ppm) + (read-only) */ + struct timeval time; /* current time (read-only) */ + long tick; /* usecs between clock ticks */ +}; +.fi +.in +.PP +The +.I modes +field determines which parameters, if any, to set. +It may contain a +.RI bitwise- or +combination of zero or more of the following bits: +.PP +.in +4n +.nf +#define ADJ_OFFSET 0x0001 /* time offset */ +#define ADJ_FREQUENCY 0x0002 /* frequency offset */ +#define ADJ_MAXERROR 0x0004 /* maximum time error */ +#define ADJ_ESTERROR 0x0008 /* estimated time error */ +#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() */ +.fi +.in +.PP +Ordinary users are restricted to a zero value for +.IR mode . +Only the superuser may set any parameters. +.br +.ne 12v +.SH "RETURN VALUE" +On success, +.BR adjtimex () +returns the clock state: +.PP +.in +4n +.nf +#define TIME_OK 0 /* clock synchronized */ +#define TIME_INS 1 /* insert leap second */ +#define TIME_DEL 2 /* delete leap second */ +#define TIME_OOP 3 /* leap second in progress */ +#define TIME_WAIT 4 /* leap second has occurred */ +#define TIME_BAD 5 /* clock not synchronized */ +.fi +.in +.PP +On failure, +.BR adjtimex () +returns \-1 and sets +.IR errno . +.SH ERRORS +.TP +.B EFAULT +.I buf +does not point to writable memory. +.TP +.B EINVAL +An attempt is made to set +.I buf.offset +to a value outside the range \-131071 to +131071, +or to set +.I buf.status +to a value other than those listed above, +or to set +.I buf.tick +to a value outside the range +.RB 900000/ HZ +to +.RB 1100000/ HZ , +where +.B HZ +is the system timer interrupt frequency. +.TP +.B EPERM +.I buf.mode +is nonzero and the caller does not have sufficient privilege. +Under Linux the +.B CAP_SYS_TIME +capability is required. +.SH "CONFORMING TO" +.BR adjtimex () +is Linux-specific and should not be used in programs +intended to be portable. +See +.BR adjtime (3) +for a more portable, but less flexible, +method of adjusting the system clock. +.SH "SEE ALSO" +.BR settimeofday (2), +.BR adjtime (3), +.BR capabilities (7), +.BR time (7) diff --git a/original/man2/afs_syscall.2 b/original/man2/afs_syscall.2 new file mode 100644 index 00000000..5d25ea6c --- /dev/null +++ b/original/man2/afs_syscall.2 @@ -0,0 +1 @@ +.so man2/unimplemented.2 diff --git a/original/man2/alarm.2 b/original/man2/alarm.2 new file mode 100644 index 00000000..0a8469e2 --- /dev/null +++ b/original/man2/alarm.2 @@ -0,0 +1,89 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 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 +.\" +.TH ALARM 2 2008-06-12 "Linux" "Linux Programmer's Manual" +.SH NAME +alarm \- set an alarm clock for delivery of a signal +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "unsigned int alarm(unsigned int " seconds ); +.fi +.SH DESCRIPTION +.BR alarm () +arranges for a +.B SIGALRM +signal to be delivered to the calling process in +.I seconds +seconds. + +If +.I seconds +is zero, no new +.BR alarm () +is scheduled. + +In any event any previously set +.BR alarm () +is canceled. +.SH "RETURN VALUE" +.BR alarm () +returns the number of seconds remaining until any previously scheduled +alarm was due to be delivered, or zero if there was no previously +scheduled alarm. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001, 4.3BSD. +.SH NOTES +.BR alarm () +and +.BR setitimer (2) +share the same timer; calls to one will interfere with use of the +other. +.PP +.BR sleep (3) +may be implemented using +.BR SIGALRM ; +mixing calls to +.BR alarm () +and +.BR sleep (3) +is a bad idea. + +Scheduling delays can, as ever, cause the execution of the process to +be delayed by an arbitrary amount of time. +.SH "SEE ALSO" +.BR gettimeofday (2), +.BR pause (2), +.BR select (2), +.BR setitimer (2), +.BR sigaction (2), +.BR signal (2), +.BR sleep (3), +.BR time (7) diff --git a/original/man2/alloc_hugepages.2 b/original/man2/alloc_hugepages.2 new file mode 100644 index 00000000..4ece3a02 --- /dev/null +++ b/original/man2/alloc_hugepages.2 @@ -0,0 +1,149 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 2003 Andries E. 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. +.\" +.TH ALLOC_HUGEPAGES 2 2007-05-31 "Linux" "Linux Programmer's Manual" +.SH NAME +alloc_hugepages, free_hugepages \- allocate or free huge pages +.SH SYNOPSIS +.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); +.sp +.BI "int free_hugepages(void *" addr ); +.\" asmlinkage int sys_free_hugepages(unsigned long addr); +.fi +.SH DESCRIPTION +The system calls +.BR alloc_hugepages () +and +.BR free_hugepages () +were introduced in Linux 2.5.36 and removed again in 2.5.54. +They existed only on i386 and ia64 (when built with +.BR CONFIG_HUGETLB_PAGE ). +In Linux 2.4.20 the syscall numbers exist, +but the calls fail with the error +.BR ENOSYS . +.LP +On i386 the memory management hardware knows about ordinary pages (4 KiB) +and huge pages (2 or 4 MiB). +Similarly ia64 knows about huge pages of +several sizes. +These system calls serve to map huge pages into the +process's memory or to free them again. +Huge pages are locked into memory, and are not swapped. +.LP +The +.I key +argument is an identifier. +When zero the pages are private, and +not inherited by children. +When positive the pages are shared with other applications using the same +.IR key , +and inherited by child processes. +.LP +The +.I addr +argument of +.BR free_hugepages () +tells which page is being freed: it was the return value of a +call to +.BR alloc_hugepages (). +(The memory is first actually freed when all users have released it.) +The +.I addr +argument of +.BR alloc_hugepages () +is a hint, that the kernel may or may not follow. +Addresses must be properly aligned. +.LP +The +.I len +argument is the length of the required segment. +It must be a multiple of the huge page size. +.LP +The +.I prot +argument specifies the memory protection of the segment. +It is one of +.BR PROT_READ , +.BR PROT_WRITE , +.BR PROT_EXEC . +.LP +The +.I flag +argument is ignored, unless +.I key +is positive. +In that case, if +.I flag +is +.BR IPC_CREAT , +then a new huge page segment is created when none +with the given key existed. +If this flag is not set, then +.B ENOENT +is returned when no segment with the given key exists. +.SH "RETURN VALUE" +On success, +.BR alloc_hugepages () +returns the allocated virtual address, and +.BR free_hugepages () +returns zero. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B ENOSYS +The system call is not supported on this kernel. +.SH FILES +.I /proc/sys/vm/nr_hugepages +Number of configured hugetlb pages. +This can be read and written. +.LP +.I /proc/meminfo +Gives info on the number of configured hugetlb pages and on their size +in the three variables HugePages_Total, HugePages_Free, Hugepagesize. +.SH "CONFORMING TO" +These calls are specific to Linux on Intel processors, and should not be +used in programs intended to be portable. +.SH NOTES +These system calls are gone; +they existed only in Linux 2.5.36 through to 2.5.54. +Now the hugetlbfs file system can be used instead. +Memory backed by huge pages (if the CPU supports them) is obtained by +using +.BR mmap (2) +to map files in this virtual file system. +.LP +The maximal number of huge pages can be specified using the +.B hugepages= +boot parameter. + +.\" requires CONFIG_HUGETLB_PAGE (under "Processor type and features") +.\" and CONFIG_HUGETLBFS (under "Filesystems"). +.\" mount -t hugetlbfs hugetlbfs /huge +.\" SHM_HUGETLB diff --git a/original/man2/arch_prctl.2 b/original/man2/arch_prctl.2 new file mode 100644 index 00000000..94c45e23 --- /dev/null +++ b/original/man2/arch_prctl.2 @@ -0,0 +1,143 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2003 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. +.TH ARCH_PRCTL 2 2007-12-26 "Linux" "Linux Programmer's Manual" +.SH NAME +arch_prctl \- set architecture-specific thread state +.SH SYNOPSIS +.nf +.B #include +.br +.B #include +.sp +.BI "int arch_prctl(int " code ", unsigned long " addr ); +.BI "int arch_prctl(int " code ", unsigned long *" addr ); +.fi +.SH DESCRIPTION +The +.BR arch_prctl () +function sets architecture-specific process or thread state. +.I code +selects a subfunction +and passes argument +.I addr +to it; +.I addr +is interpreted as either an +.I "unsigned long" +for the "set" operations, or as an +.IR "unsigned long *" , +for the "get" operations. +.LP +Sub functions for x86-64 are: +.TP +.B ARCH_SET_FS +Set the 64-bit base for the +.I FS +register to +.IR addr . +.TP +.B ARCH_GET_FS +Return the 64-bit base value for the +.I FS +register of the current thread in the +.I unsigned long +pointed to by +.IR addr . +.TP +.B ARCH_SET_GS +Set the 64-bit base for the +.I GS +register to +.IR addr . +.TP +.B ARCH_GET_GS +Return the 64-bit base value for the +.I GS +register of the current thread in the +.I unsigned long +pointed to by +.IR addr . +.SH RETURN VALUE +On success, +.BR arch_prctl () +returns 0; on error, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EFAULT +.I addr +points to an unmapped address or is outside the process address space. +.TP +.B EINVAL +.I code +is not a valid subcommand. +.TP +.B EPERM +.I addr +is outside the process address space. +.\" .SH AUTHOR +.\" Man page written by Andi Kleen. +.SH "CONFORMING TO" +.BR arch_prctl () +is a Linux/x86-64 extension and should not be used in programs intended +to be portable. +.SH NOTES +.BR arch_prctl () +is only supported on Linux/x86-64 for 64-bit programs currently. + +The 64-bit base changes when a new 32-bit segment selector is loaded. + +.B ARCH_SET_GS +is disabled in some kernels. + +Context switches for 64-bit segment bases are rather expensive. +It may be a faster alternative to set a 32-bit base using a +segment selector by setting up an LDT with +.BR modify_ldt (2) +or using the +.BR set_thread_area (2) +system call in kernel 2.5 or later. +.BR arch_prctl () +is only needed when you want to set bases that are larger than 4GB. +Memory in the first 2GB of address space can be allocated by using +.BR mmap (2) +with the +.B MAP_32BIT +flag. + +As of version 2.7, glibc provides no prototype for +.BR arch_prctl (). +You have to declare it yourself for now. +This may be fixed in future glibc versions. + +.I FS +may be already used by the threading library. +.SH "SEE ALSO" +.BR mmap (2), +.BR modify_ldt (2), +.BR prctl (2), +.BR set_thread_area (2) +.sp +AMD X86-64 Programmer's manual diff --git a/original/man2/bdflush.2 b/original/man2/bdflush.2 new file mode 100644 index 00000000..d05efe18 --- /dev/null +++ b/original/man2/bdflush.2 @@ -0,0 +1,113 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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 1997-01-31 by Eric S. Raymond +.\" Modified 2004-06-17 by Michael Kerrisk +.\" +.TH BDFLUSH 2 2004-06-17 "Linux" "Linux Programmer's Manual" +.SH NAME +bdflush \- start, flush, or tune buffer-dirty-flush daemon +.SH SYNOPSIS +.nf +.B #include + +.BI "int bdflush(int " func ", long *" address ); +.BI "int bdflush(int " func ", long " data ); +.fi +.SH DESCRIPTION +.BR bdflush () +starts, flushes, or tunes the buffer-dirty-flush daemon. +Only a privileged process (one with the +.B CAP_SYS_ADMIN +capability) may call +.BR bdflush (). +.PP +If +.I func +is negative or 0, and no daemon has been started, then +.BR bdflush () +enters the daemon code and never returns. +.PP +If +.I func +is 1, +some dirty buffers are written to disk. +.PP +If +.I func +is 2 or more and is even (low bit is 0), then +.I address +is the address of a long word, +and the tuning parameter numbered +.RI "(" "func" "\-2)/2" +is returned to the caller in that address. +.PP +If +.I func +is 3 or more and is odd (low bit is 1), then +.I data +is a long word, +and the kernel sets tuning parameter numbered +.RI "(" "func" "\-3)/2" +to that value. +.PP +The set of parameters, their values, and their valid ranges +are defined in the kernel source file +.IR fs/buffer.c . +.SH "RETURN VALUE" +If +.I func +is negative or 0 and the daemon successfully starts, +.BR bdflush () +never returns. +Otherwise, the return value is 0 on success and \-1 on failure, with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EBUSY +An attempt was made to enter the daemon code after +another process has already entered. +.TP +.B EFAULT +.I address +points outside your accessible address space. +.TP +.B EINVAL +An attempt was made to read or write an invalid parameter number, +or to write an invalid value to a parameter. +.TP +.B EPERM +Caller does not have the +.B CAP_SYS_ADMIN +capability. +.SH "CONFORMING TO" +.BR bdflush () +is Linux-specific and should not be used in programs +intended to be portable. +.SH "SEE ALSO" +.BR fsync (2), +.BR sync (2), +.BR sync (8), +.BR update (8) diff --git a/original/man2/bind.2 b/original/man2/bind.2 new file mode 100644 index 00000000..7e84e450 --- /dev/null +++ b/original/man2/bind.2 @@ -0,0 +1,329 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from /usr/include/sys/socket.h, which does not have +.\" any authorship information in it. It is probably available under the GPL. +.\" +.\" 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. +.\" +.\" +.\" Other portions are from the 6.9 (Berkeley) 3/10/91 man page: +.\" +.\" Copyright (c) 1983 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. +.\" +.\" Modified Mon Oct 21 23:05:29 EDT 1996 by Eric S. Raymond +.\" Modified 1998 by Andi Kleen +.\" $Id: bind.2,v 1.3 1999/04/23 19:56:07 freitag Exp $ +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.TH BIND 2 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH NAME +bind \- bind a name to a socket +.SH SYNOPSIS +.nf +.BR "#include " " /* See NOTES */" +.B #include +.sp +.BI "int bind(int " sockfd ", const struct sockaddr *" addr , +.BI " socklen_t " addrlen ); +.fi +.SH DESCRIPTION +When a socket is created with +.BR socket (2), +it exists in a name space (address family) but has no address assigned to it. +.BR bind () +assigns the address specified to by +.I addr +to the socket referred to by the file descriptor +.IR sockfd . +.I addrlen +specifies the size, in bytes, of the address structure pointed to by +.IR addr . +Traditionally, this operation is called \(lqassigning a name to a socket\(rq. +.PP +It is normally necessary to assign a local address using +.BR bind () +before a +.B SOCK_STREAM +socket may receive connections (see +.BR accept (2)). + +The rules used in name binding vary between address families. +Consult the manual entries in Section 7 for detailed information. +For +.B AF_INET +see +.BR ip (7), +for +.B AF_INET6 +see +.BR ipv6 (7), +for +.B AF_UNIX +see +.BR unix (7), +for +.B AF_APPLETALK +see +.BR ddp (7), +for +.B AF_PACKET +see +.BR packet (7), +for +.B AF_X25 +see +.BR x25 (7) +and for +.B AF_NETLINK +see +.BR netlink (7). + +The actual structure passed for the +.I addr +argument will depend on the address family. +The +.I sockaddr +structure is defined as something like: +.in +4n +.nf + +struct sockaddr { + sa_family_t sa_family; + char sa_data[14]; +} + +.fi +.in +The only purpose of this structure is to cast the structure +pointer passed in +.I addr +in order to avoid compiler warnings. +See EXAMPLE below. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +.\" e.g., privileged port in AF_INET domain +The address is protected, and the user is not the superuser. +.TP +.B EADDRINUSE +The given address is already in use. +.TP +.B EBADF +.I sockfd +is not a valid descriptor. +.TP +.B EINVAL +The socket is already bound to an address. +.\" This may change in the future: see +.\" .I linux/unix/sock.c for details. +.TP +.B ENOTSOCK +.I sockfd +is a descriptor for a file, not a socket. +.PP +The following errors are specific to Unix domain +.RB ( AF_UNIX ) +sockets: +.TP +.B EACCES +Search permission is denied on a component of the path prefix. +(See also +.BR path_resolution (7).) +.TP +.B EADDRNOTAVAIL +A nonexistent interface was requested or the requested +address was not local. +.TP +.B EFAULT +.I addr +points outside the user's accessible address space. +.TP +.B EINVAL +The +.I addrlen +is wrong, or the socket was not in the +.B AF_UNIX +family. +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR addr . +.TP +.B ENAMETOOLONG +.I addr +is too long. +.TP +.B ENOENT +The file does not exist. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOTDIR +A component of the path prefix is not a directory. +.TP +.B EROFS +The socket inode would reside on a read-only file system. +.SH "CONFORMING TO" +SVr4, 4.4BSD, POSIX.1-2001 +.RB ( bind () +first appeared in 4.2BSD). +.\" SVr4 documents an additional +.\" .B ENOSR +.\" general error condition, and +.\" additional +.\" .B EIO +.\" and +.\" .B EISDIR +.\" Unix-domain error conditions. +.SH NOTES +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. + +The third argument of +.BR bind () +is in reality an +.I int +(and this is what 4.x BSD and libc4 and libc5 have). +Some POSIX confusion resulted in the present +.IR socklen_t , +also used by glibc. +See also +.BR accept (2). +.SH BUGS +The transparent proxy options are not described. +.\" FIXME What *are* transparent proxy options? +.SH EXAMPLE +An example of the use of +.BR bind () +with Internet domain sockets can be found in +.BR getaddrinfo (3). + +The following example shows how to bind a stream socket in the Unix +.RB ( AF_UNIX ) +domain, and accept connections: +.\" listen.7 refers to this example. +.\" accept.7 refers to this example. +.\" unix.7 refers to this example. + +.nf +#include +#include +#include +#include +#include + +#define MY_SOCK_PATH "/somepath" +#define LISTEN_BACKLOG 50 + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int +main(int argc, char *argv[]) +{ + int sfd, cfd; + struct sockaddr_un my_addr, peer_addr; + socklen_t peer_addr_size; + + sfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (sfd == \-1) + handle_error("socket"); + + memset(&my_addr, 0, sizeof(struct sockaddr_un)); + /* Clear structure */ + my_addr.sun_family = AF_UNIX; + strncpy(my_addr.sun_path, MY_SOCK_PATH, + sizeof(my_addr.sun_path) \- 1); + + if (bind(sfd, (struct sockaddr *) &my_addr, + sizeof(struct sockaddr_un)) == \-1) + handle_error("bind"); + + if (listen(sfd, LISTEN_BACKLOG) == \-1) + handle_error("listen"); + + /* Now we can accept incoming connections one + at a time using accept(2) */ + + peer_addr_size = sizeof(struct sockaddr_un); + cfd = accept(sfd, (struct sockaddr *) &peer_addr, + &peer_addr_size); + if (cfd == \-1) + handle_error("accept"); + + /* Code to deal with incoming connection(s)... */ + + /* When no longer required, the socket pathname, MY_SOCK_PATH + should be deleted using unlink(2) or remove(3) */ +} +.fi +.SH "SEE ALSO" +.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) diff --git a/original/man2/break.2 b/original/man2/break.2 new file mode 100644 index 00000000..5d25ea6c --- /dev/null +++ b/original/man2/break.2 @@ -0,0 +1 @@ +.so man2/unimplemented.2 diff --git a/original/man2/brk.2 b/original/man2/brk.2 new file mode 100644 index 00000000..5c024c31 --- /dev/null +++ b/original/man2/brk.2 @@ -0,0 +1,154 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Wed Jul 21 19:52:58 1993 by Rik Faith +.\" Modified Sun Aug 21 17:40:38 1994 by Rik Faith +.\" +.TH BRK 2 2008-06-18 "Linux" "Linux Programmer's Manual" +.SH NAME +brk, sbrk \- change data segment size +.SH SYNOPSIS +.B #include +.sp +.BI "int brk(void *" addr ); +.sp +.BI "void *sbrk(intptr_t " increment ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR brk (), +.BR sbrk (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.ad b +.SH DESCRIPTION +.BR brk () +and +.BR sbrk () +change the location of the +.IR "program break" , +which defines the end of the process's data segment +(i.e., the program break is the first location after the end of the +uninitialized data segment). +Increasing the program break has the effect of +allocating memory to the process; +decreasing the break deallocates memory. + +.BR brk () +sets the end of the data segment to the value specified by +.IR addr , +when that value is reasonable, the system has enough memory, +and the process does not exceed its maximum data size (see +.BR setrlimit (2)). + +.BR sbrk () +increments the program's data space by +.I increment +bytes. +Calling +.BR sbrk () +with an +.I increment +of 0 can be used to find the current location of the program break. +.SH "RETURN VALUE" +On success, +.BR brk () +returns zero. +On error, \-1 is returned, and +.I errno +is set to +.BR ENOMEM . +(But see \fILinux Notes\fP below.) + +On success, +.BR sbrk () +returns the previous program break. +(If the break was increased, +then this value is a pointer to the start of the newly allocated memory). +On error, +.I "(void\ *)\ \-1" +is returned, and +.I errno +is set to +.BR ENOMEM . +.SH "CONFORMING TO" +4.3BSD; SUSv1, marked LEGACY in SUSv2, removed in POSIX.1-2001. +.\" +.\" .BR brk () +.\" and +.\" .BR sbrk () +.\" 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). +.SH NOTES +Avoid using +.BR brk () +and +.BR sbrk (): +the +.BR malloc (3) +memory allocation package is the +portable and comfortable way of allocating memory. + +Various systems use various types for the argument of +.BR sbrk (). +Common are \fIint\fP, \fIssize_t\fP, \fIptrdiff_t\fP, \fIintptr_t\fP. +.\" 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 (e.g., XPGv5, AIX, SunOS 5.8, 5.9, FreeBSD 4.7, NetBSD 1.6, +.\" Tru64 5.1, glibc2.2). +.SS Linux Notes +The return value described above for +.BR brk () +is the behavior provided by the glibc wrapper function for the Linux +.BR brk () +system call. +(On most other implementations, the return value from +.BR brk () +is the same; this return value was also specified in SUSv2.) +However, +the actual Linux system call returns the new program break on success. +On failure, the system call returns the current break. +The glibc wrapper function does some work +(i.e., checks whether the new break is less than +.IR addr ) +to provide the 0 and \-1 return values described above. + +On Linux, +.BR sbrk () +is implemented as a library function that uses the +.BR brk () +system call, and does some internal bookkeeping so that it can +return the old break value. +.SH "SEE ALSO" +.BR execve (2), +.BR getrlimit (2), +.BR end (3), +.BR malloc (3) diff --git a/original/man2/cacheflush.2 b/original/man2/cacheflush.2 new file mode 100644 index 00000000..3df44e1a --- /dev/null +++ b/original/man2/cacheflush.2 @@ -0,0 +1,87 @@ +.\" Written by Ralf Baechle (ralf@waldorf-gmbh.de), +.\" Copyright (c) 1994, 1995 Waldorf GMBH +.\" +.\" 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. +.\" +.TH CACHEFLUSH 2 2007-05-26 "Linux" "Linux Programmer's Manual" +.SH NAME +cacheflush \- flush contents of instruction and/or data cache +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int cacheflush(char *" addr ", int "nbytes ", int "cache ); +.fi +.SH DESCRIPTION +.BR cacheflush () +flushes the contents of the indicated cache(s) for the +user addresses in the range +.I addr +to +.IR (addr+nbytes-1) . +.I cache +may be one of: +.TP +.B ICACHE +Flush the instruction cache. +.TP +.B DCACHE +Write back to memory and invalidate the affected valid cache lines. +.TP +.B BCACHE +Same as +.BR (ICACHE|DCACHE) . +.SH "RETURN VALUE" +.BR cacheflush () +returns 0 on success or \-1 on error. +If errors are detected, +.I errno +will indicate the error. +.SH ERRORS +.TP +.B EFAULT +Some or all of the address range +.I addr +to +.I (addr+nbytes-1) +is not accessible. +.TP +.B EINVAL +.I cache +is not one of +.BR ICACHE , +.BR DCACHE , +or +.BR BCACHE . +.SH CONFORMING TO +This Linux-specific system call is only available on MIPS based systems. +.\" 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. +It should not be used in programs intended to be portable. +.\" Irix 6.5 appears to have a cacheflush() syscall -- mtk +.SH BUGS +The current implementation ignores the +.I addr +and +.I nbytes +arguments. +Therefore, the whole cache is always flushed. diff --git a/original/man2/capget.2 b/original/man2/capget.2 new file mode 100644 index 00000000..1d853008 --- /dev/null +++ b/original/man2/capget.2 @@ -0,0 +1,224 @@ +.\" written by Andrew Morgan +.\" may be distributed as per GPL +.\" Modified by David A. Wheeler +.\" Modified 2004-05-27, mtk +.\" Modified 2004-06-21, aeb +.\" Modified 2008-04-28, morgan of kernel.org +.\" Update in line with addition of file capabilities and +.\" 64-bit capability sets in kernel 2.6.2[45]. +.\" Modified 2009-01-26, andi kleen +.\" +.TH CAPGET 2 2009-01-26 "Linux" "Linux Programmer's Manual" +.SH NAME +capget, capset \- set/get capabilities of thread(s) +.SH SYNOPSIS +.B #undef _POSIX_SOURCE +.br +.B #include +.sp +.BI "int capget(cap_user_header_t " hdrp ", cap_user_data_t " datap ); +.sp +.BI "int capset(cap_user_header_t " hdrp ", const cap_user_data_t " datap ); +.SH DESCRIPTION +As of Linux 2.2, +the power of the superuser (root) has been partitioned into +a set of discrete capabilities. +Each thread has a set of effective capabilities identifying +which capabilities (if any) it may currently exercise. +Each thread also has a set of inheritable capabilities that may be +passed through an +.BR execve (2) +call, and a set of permitted capabilities +that it can make effective or inheritable. +.PP +These two functions are the raw kernel interface for getting and +setting thread capabilities. +Not only are these system calls specific to Linux, +but the kernel API is likely to change and use of +these functions (in particular the format of the +.I cap_user_*_t +types) is subject to extension with each kernel revision, +but old programs will keep working. +.sp +The portable interfaces are +.BR cap_set_proc (3) +and +.BR cap_get_proc (3); +if possible you should use those interfaces in applications. +If you wish to use the Linux extensions in applications, you should +use the easier-to-use interfaces +.BR capsetp (3) +and +.BR capgetp (3). +.SS "Current details" +Now that you have been warned, some current kernel details. +The structures are defined as follows. +.sp +.nf +.in +4n +#define _LINUX_CAPABILITY_VERSION_1 0x19980330 +#define _LINUX_CAPABILITY_U32S_1 1 + +#define _LINUX_CAPABILITY_VERSION_2 0x20071026 +#define _LINUX_CAPABILITY_U32S_2 2 + +typedef struct __user_cap_header_struct { + __u32 version; + int pid; +} *cap_user_header_t; + +typedef struct __user_cap_data_struct { + __u32 effective; + __u32 permitted; + __u32 inheritable; +} *cap_user_data_t; +.fi +.in -4n +.sp +.I effective, permitted, inheritable +are bitmasks of the capabilities defined in +.I capability(7). +Note the +.I CAP_* +values are bit indexes and need to be bit-shifted before ORing into +the bit fields. +To define the structures for passing to the system call you have to use the +.I struct __user_cap_header_struct +and +.I struct __user_cap_data_struct +names because the typedefs are only pointers. + +Kernels prior to 2.6.25 prefer +32-bit capabilities with version +.BR _LINUX_CAPABILITY_VERSION_1 , +and kernels 2.6.25+ prefer 64-bit capabilities with version +.BR _LINUX_CAPABILITY_VERSION_2 . +Note, 64-bit capabilities use +.IR datap [0] +and +.IR datap [1], +whereas 32-bit capabilities only use +.IR datap [0]. +.sp +Another change affecting the behavior of these system calls is kernel +support for file capabilities (VFS capability support). +This support is currently a compile time option (added in kernel 2.6.24). +.sp +For +.BR capget () +calls, one can probe the capabilities of any process by specifying its +process ID with the +.I hdrp->pid +field value. +.SS With VFS Capability Support +VFS Capability support creates a file-attribute method for adding +capabilities to privileged executables. +This privilege model obsoletes kernel support for one process +asynchronously setting the capabilities of another. +That is, with VFS support, for +.BR capset () +calls the only permitted values for +.I hdrp->pid +are 0 or +.BR getpid (2), +which are equivalent. +.SS Without VFS Capability Support +When the kernel does not support VFS capabilities, +.BR capset () +calls can operate on the capabilities of the thread specified by the +.I pid +field of +.I hdrp +when that is nonzero, or on the capabilities of the calling thread if +.I pid +is 0. +If +.I pid +refers to a single-threaded process, then +.I pid +can be specified as a traditional process ID; +operating on a thread of a multithreaded process requires a thread ID +of the type returned by +.BR gettid (2). +For +.BR capset (), +.I pid +can also be: \-1, meaning perform the change on all threads except the +caller and +.BR init (8); +or a value less than \-1, in which case the change is applied +to all members of the process group whose ID is \-\fIpid\fP. + +For details on the data, see +.BR capabilities (7). +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. + +The calls will fail with the error +.BR EINVAL , +and set the +.I version +field of +.I hdrp +to the kernel preferred value of +.B _LINUX_CAPABILITY_VERSION_? +when an unsupported +.I version +value is specified. +In this way, one can probe what the current +preferred capability revision is. +.SH ERRORS +.TP +.B EFAULT +Bad memory address. +.I hdrp +must not be NULL. +.I datap +may only be NULL when the user is trying to determine the preferred +capability version format supported by the kernel. +.TP +.B EINVAL +One of the arguments was invalid. +.TP +.B EPERM +An attempt was made to add a capability to the Permitted set, or to set +a capability in the Effective or Inheritable sets that is not in the +Permitted set. +.TP +.B EPERM +The caller attempted to use +.BR capset () +to modify the capabilities of a thread other than itself, +but lacked sufficient privilege. +For kernels supporting VFS +capabilities, this is never permitted. +For kernels lacking VFS +support, the +.B CAP_SETPCAP +capability is required. +(A bug in kernels before 2.6.11 meant that this error could also +occur if a thread without this capability tried to change its +own capabilities by specifying the +.I pid +field as a nonzero value (i.e., the value returned by +.BR getpid (2)) +instead of 0.) +.TP +.B ESRCH +No such thread. +.SH "CONFORMING TO" +These system calls are Linux-specific. +.SH NOTES +The portable interface to the capability querying and setting +functions is provided by the +.I libcap +library and is available here: +.br +http://www.kernel.org/pub/linux/libs/security/linux-privs +.SH "SEE ALSO" +.BR clone (2), +.BR gettid (2), +.BR capabilities (7) diff --git a/original/man2/capset.2 b/original/man2/capset.2 new file mode 100644 index 00000000..9e829cbd --- /dev/null +++ b/original/man2/capset.2 @@ -0,0 +1 @@ +.so man2/capget.2 diff --git a/original/man2/chdir.2 b/original/man2/chdir.2 new file mode 100644 index 00000000..6ca20946 --- /dev/null +++ b/original/man2/chdir.2 @@ -0,0 +1,138 @@ +.\" 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-21 by Rik Faith +.\" Modified 1995-04-15 by Michael Chastain : +.\" Added 'fchdir'. Fixed bugs in error section. +.\" Modified 1996-10-21 by Eric S. Raymond +.\" Modified 1997-08-21 by Joseph S. Myers +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.TH CHDIR 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +chdir, fchdir \- change working directory +.SH SYNOPSIS +.B #include +.sp +.BI "int chdir(const char *" path ); +.br +.BI "int fchdir(int " fd ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR fchdir (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +.BR chdir () +changes the current working directory of the calling process to the +directory specified in +.IR path . +.PP +.BR fchdir () +is identical to +.BR chdir (); +the only difference is that the directory is given as an +open file descriptor. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +Depending on the file system, other errors can be returned. +The more +general errors for +.BR chdir () +are listed below: +.TP +.B EACCES +Search permission is denied for one of the components of +.IR path . +(See also +.BR path_resolution (7).) +.TP +.B EFAULT +.I path +points outside your accessible address space. +.TP +.B EIO +An I/O error occurred. +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR path . +.TP +.B ENAMETOOLONG +.I path +is too long. +.TP +.B ENOENT +The file does not exist. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOTDIR +A component of +.I path +is not a directory. +.PP +The general errors for +.BR fchdir () +are listed below: +.TP +.B EACCES +Search permission was denied on the directory open on +.IR fd . +.TP +.B EBADF +.I fd +is not a valid file descriptor. +.SH "CONFORMING TO" +SVr4, 4.4BSD, POSIX.1-2001. +.SH NOTES +The current working directory is the starting point for interpreting +relative pathnames (those not starting with \(aq/\(aq). + +A child process created via +.BR fork (2) +inherits its parent's current working directory. +The current working directory is left unchanged by +.BR execve (2). + +The prototype for +.BR fchdir () +is only available if +.B _BSD_SOURCE +is defined, or +.B _XOPEN_SOURCE +is defined with the value 500. +.SH "SEE ALSO" +.BR chroot (2), +.BR getcwd (3), +.BR path_resolution (7) diff --git a/original/man2/chmod.2 b/original/man2/chmod.2 new file mode 100644 index 00000000..d621bbef --- /dev/null +++ b/original/man2/chmod.2 @@ -0,0 +1,217 @@ +.\" 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-21 by Rik Faith +.\" Modified 1997-01-12 by Michael Haardt +.\" : NFS details +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.TH CHMOD 2 2008-05-26 "Linux" "Linux Programmer's Manual" +.SH NAME +chmod, fchmod \- change permissions of a file +.SH SYNOPSIS +.B #include +.sp +.BI "int chmod(const char *" path ", mode_t " mode ); +.br +.BI "int fchmod(int " fd ", mode_t " mode ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR fchmod (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +These system calls change the permissions of a file. +They differ only in how the file is specified: +.IP * 2 +.BR chmod () +changes the permissions of the file specified whose pathname is given in +.IR path , +which is dereferenced if it is a symbolic link. +.IP * +.BR fchmod () +changes the permissions of the file referred to by the open file descriptor +.IR fd . +.PP +The new file permissions are specified in +.IR mode , +which is a bit mask created by ORing together zero or +more of the following: +.TP 18 +.BR S_ISUID " (04000)" +set-user-ID (set process effective user ID on +.BR execve (2)) +.TP +.BR S_ISGID " (02000)" +set-group-ID (set process effective group ID on +.BR execve (2); +mandatory locking, as described in +.BR fcntl (2); +take a new file's group from parent directory, as described in +.BR chown (2) +and +.BR mkdir (2)) +.TP +.BR S_ISVTX " (01000)" +sticky bit (restricted deletion flag, as described in +.BR unlink (2)) +.TP +.BR S_IRUSR " (00400)" +read by owner +.TP +.BR S_IWUSR " (00200)" +write by owner +.TP +.BR S_IXUSR " (00100)" +execute/search by owner ("search" applies for directories, +and means that entries within the directory can be accessed) +.TP +.BR S_IRGRP " (00040)" +read by group +.TP +.BR S_IWGRP " (00020)" +write by group +.TP +.BR S_IXGRP " (00010)" +execute/search by group +.TP +.BR S_IROTH " (00004)" +read by others +.TP +.BR S_IWOTH " (00002)" +write by others +.TP +.BR S_IXOTH " (00001)" +execute/search by others +.PP +The effective UID of the calling process must match the owner of the file, +or the process must be privileged (Linux: it must have the +.B CAP_FOWNER +capability). + +If the calling process is not privileged (Linux: does not have the +.B CAP_FSETID +capability), and the group of the file does not match +the effective group ID of the process or one of its +supplementary group IDs, the +.B S_ISGID +bit will be turned off, +but this will not cause an error to be returned. + +As a security measure, depending on the file system, +the set-user-ID and set-group-ID execution bits +may be turned off if a file is written. +(On Linux this occurs if the writing process does not have the +.B CAP_FSETID +capability.) +On some file systems, only the superuser can set the sticky bit, +which may have a special meaning. +For the sticky bit, and for set-user-ID and set-group-ID bits on +directories, see +.BR stat (2). + +On NFS file systems, restricting the permissions will immediately influence +already open files, because the access control is done on the server, but +open files are maintained by the client. +Widening the permissions may be +delayed for other clients if attribute caching is enabled on them. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +Depending on the file system, other errors can be returned. +The more general errors for +.BR chmod () +are listed below: +.TP +.B EACCES +Search permission is denied on a component of the path prefix. +(See also +.BR path_resolution (7).) +.TP +.B EFAULT +.I path +points outside your accessible address space. +.TP +.B EIO +An I/O error occurred. +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR path . +.TP +.B ENAMETOOLONG +.I path +is too long. +.TP +.B ENOENT +The file does not exist. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOTDIR +A component of the path prefix is not a directory. +.TP +.B EPERM +The effective UID does not match the owner of the file, +and the process is not privileged (Linux: it does not have the +.B CAP_FOWNER +capability). +.TP +.B EROFS +The named file resides on a read-only file system. +.PP +The general errors for +.BR fchmod () +are listed below: +.TP +.B EBADF +The file descriptor +.I fd +is not valid. +.TP +.B EIO +See above. +.TP +.B EPERM +See above. +.TP +.B EROFS +See above. +.SH "CONFORMING TO" +4.4BSD, SVr4, POSIX.1-2001. +.SH "SEE ALSO" +.BR chown (2), +.BR execve (2), +.BR fchmodat (2), +.BR open (2), +.BR stat (2), +.BR path_resolution (7) diff --git a/original/man2/chown.2 b/original/man2/chown.2 new file mode 100644 index 00000000..ed1a4576 --- /dev/null +++ b/original/man2/chown.2 @@ -0,0 +1,313 @@ +.\" 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). +.\" +.TH CHOWN 2 2008-06-16 "Linux" "Linux Programmer's Manual" +.SH NAME +chown, fchown, lchown \- change ownership of a file +.SH SYNOPSIS +.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 +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR fchown (), +.BR lchown (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +These system calls change the owner and group of a file. +The differ only in how the file is specified: +.IP * 2 +.BR chown () +changes the ownership of the file specified by +.IR path , +which is dereferenced if it is a symbolic link. +.IP * +.BR fchown () +changes the ownership of the file referred to by the open file descriptor +.IR fd . +.IP * +.BR lchown () +is like +.BR chown (), +but does not dereference symbolic links. +.PP +Only a privileged process (Linux: one with the +.B CAP_CHOWN +capability) may change the owner of a file. +The owner of a file may change the group of the file +to any group of which that owner is a member. +A privileged process (Linux: with +.BR CAP_CHOWN ) +may change the group arbitrarily. + +If the +.I owner +or +.I group +is specified as \-1, then that ID is not changed. + +When the owner or group of an executable file are +changed by an unprivileged user the +.B S_ISUID +and +.B S_ISGID +mode bits are cleared. +POSIX does not specify whether +this also should happen when root does the +.BR chown (); +the Linux behavior depends on the kernel version. +.\" In Linux 2.0 kernels, superuser was like everyone else +.\" In 2.2, up to 2.2.12, these bits were not cleared for superuser. +.\" Since 2.2.13, superuser is once more like everyone else. +In case of a non-group-executable file (i.e., one for which the +.B S_IXGRP +bit is not set) the +.B S_ISGID +bit indicates mandatory locking, and is not cleared by a +.BR chown (). +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +Depending on the file system, other errors can be returned. +The more general errors for +.BR chown () +are listed below. +.TP +.B EACCES +Search permission is denied on a component of the path prefix. +(See also +.BR path_resolution (7).) +.TP +.B EFAULT +.I path +points outside your accessible address space. +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR path . +.TP +.B ENAMETOOLONG +.I path +is too long. +.TP +.B ENOENT +The file does not exist. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOTDIR +A component of the path prefix is not a directory. +.TP +.B EPERM +The calling process did not have the required permissions +(see above) to change owner and/or group. +.TP +.B EROFS +The named file resides on a read-only file system. +.PP +The general errors for +.BR fchown () +are listed below: +.TP +.B EBADF +The descriptor is not valid. +.TP +.B EIO +A low-level I/O error occurred while modifying the inode. +.TP +.B ENOENT +See above. +.TP +.B EPERM +See above. +.TP +.B EROFS +See above. +.SH "CONFORMING TO" +4.4BSD, SVr4, POSIX.1-2001. + +The 4.4BSD version can only be +used by the superuser (that is, ordinary users cannot give away files). +.\" chown(): +.\" SVr4 documents EINVAL, EINTR, ENOLINK and EMULTIHOP returns, but no +.\" ENOMEM. POSIX.1 does not document ENOMEM or ELOOP error conditions. +.\" fchown(): +.\" SVr4 documents additional EINVAL, EIO, EINTR, and ENOLINK +.\" error conditions. +.SH NOTES +When a new file is created (by, for example, +.BR open (2) +or +.BR mkdir (2)), +its owner is made the same as the file system user ID of the +creating process. +The group of the file depends on a range of factors, +including the type of file system, +the options used to mount the file system, +and whether or not the set-group-ID permission bit is enabled +on the parent directory. +If the file system supports the +.I "\-o\ grpid" +(or, synonymously +.IR "\-o\ bsdgroups" ) +and +.I "\-o\ nogrpid" +(or, synonymously +.IR "\-o\ sysvgroups" ) +.BR mount (8) +options, then the rules are as follows: +.IP * 2 +If the file system is mounted with +.IR "\-o\ grpid" , +then the group of a new file is made +the same as that of the parent directory. +.IP * +If the file system is mounted with +.IR "\-o\ nogrpid" +and the set-group-ID bit is disabled on the parent directory, +then the group of a new file is made the same as the +process's file system GID. +.IP * +If the file system is mounted with +.IR "\-o\ nogrpid" +and the set-group-ID bit is enabled on the parent directory, +then the group of a new file is made +the same as that of the parent directory. +.PP +As at Linux 2.6.25, +the +.IR "\-o\ grpid" +and +.IR "\-o\ nogrpid" +mount options are supported by ext2, ext3, ext4, and XFS. +File systems that don't support these mount options follow the +.IR "\-o\ nogrpid" +rules. +.PP +The +.BR chown () +semantics are deliberately violated on NFS file systems +which have UID mapping enabled. +Additionally, the semantics of all system +calls which access the file contents are violated, because +.BR chown () +may cause immediate access revocation on already open files. +Client side +caching may lead to a delay between the time where ownership have +been changed to allow access for a user and the time where the file can +actually be accessed by the user on other clients. + +In versions of Linux prior to 2.1.81 (and distinct from 2.1.46), +.BR chown () +did not follow symbolic links. +Since Linux 2.1.81, +.BR chown () +does follow symbolic links, and there is a new system call +.BR lchown () +that does not follow symbolic links. +Since Linux 2.1.86, this new call (that has the same semantics +as the old +.BR chown ()) +has got the same syscall number, and +.BR chown () +got the newly introduced number. +.SH EXAMPLE +.PP +The following program changes the ownership of the file named in +its second command-line argument to the value specified in its +first command-line argument. +The new owner can be specified either as a numeric user ID, +or as a username (which is converted to a user ID by using +.BR getpwnam (3) +to perform a lookup in the system password file). +.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); + } /* if */ + + exit(EXIT_SUCCESS); +} /* main */ +.fi +.SH "SEE ALSO" +.BR chmod (2), +.BR fchownat (2), +.BR flock (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/chown32.2 b/original/man2/chown32.2 new file mode 100644 index 00000000..f0a5635a --- /dev/null +++ b/original/man2/chown32.2 @@ -0,0 +1 @@ +.so man2/chown.2 diff --git a/original/man2/chroot.2 b/original/man2/chroot.2 new file mode 100644 index 00000000..f1e1f2ec --- /dev/null +++ b/original/man2/chroot.2 @@ -0,0 +1,130 @@ +.\" 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-21 by Rik Faith +.\" Modified 1994-08-21 by Michael Chastain +.\" Modified 1996-06-13 by aeb +.\" Modified 1996-11-06 by Eric S. Raymond +.\" Modified 1997-08-21 by Joseph S. Myers +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.TH CHROOT 2 2008-06-23 "Linux" "Linux Programmer's Manual" +.SH NAME +chroot \- change root directory +.SH SYNOPSIS +.B #include +.sp +.BI "int chroot(const char *" path ); +.SH DESCRIPTION +.BR chroot () +changes the root directory of the calling process to that specified in +.IR path . +This directory will be used for pathnames beginning with \fI/\fP. +The root directory is inherited by all children of the calling process. + +Only a privileged process (Linux: one with the +.B CAP_SYS_CHROOT +capability) may call +.BR chroot (). + +This call changes an ingredient in the pathname resolution process +and does nothing else. + +This call does not change the current working directory, +so that after the call \(aq\fI.\fP\(aq can +be outside the tree rooted at \(aq\fI/\fP\(aq. +In particular, the superuser can escape from a "chroot jail" +by doing: +.nf + + mkdir foo; chroot foo; cd .. +.fi + +This call does not close open file descriptors, and such file +descriptors may allow access to files outside the chroot tree. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +Depending on the file system, other errors can be returned. +The more general errors are listed below: +.TP +.B EACCES +Search permission is denied on a component of the path prefix. +(See also +.BR path_resolution (7).) +.\" Also search permission is required on the final component, +.\" maybe just to guarantee that it is a directory? +.TP +.B EFAULT +.I path +points outside your accessible address space. +.TP +.B EIO +An I/O error occurred. +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR path . +.TP +.B ENAMETOOLONG +.I path +is too long. +.TP +.B ENOENT +The file does not exist. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOTDIR +A component of +.I path +is not a directory. +.TP +.B EPERM +The caller has insufficient privilege. +.SH "CONFORMING TO" +SVr4, 4.4BSD, SUSv2 (marked LEGACY). +This function is not part of POSIX.1-2001. +.\" SVr4 documents additional EINTR, ENOLINK and EMULTIHOP error conditions. +.\" X/OPEN does not document EIO, ENOMEM or EFAULT error conditions. +.SH NOTES +A child process created via +.BR fork (2) +inherits its parent's root directory. +The root directory is left unchanged by +.BR execve (2). + +FreeBSD has a stronger +.BR jail () +system call. +.\" FIXME . eventually say something about containers, +.\" virtual servers, etc.? +.SH "SEE ALSO" +.BR chdir (2), +.BR path_resolution (7) diff --git a/original/man2/clock_getres.2 b/original/man2/clock_getres.2 new file mode 100644 index 00000000..fc28656b --- /dev/null +++ b/original/man2/clock_getres.2 @@ -0,0 +1,235 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 2003 Nick Clifford (zaf@nrc.co.nz), Jan 25, 2003 +.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl), Aug 24, 2003 +.\" +.\" 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. +.\" +.\" 2003-08-23 Martin Schulze improvements +.\" 2003-08-24 aeb, large parts rewritten +.\" 2004-08-06 Christoph Lameter , SMP note +.\" +.TH CLOCK_GETRES 2 2010-02-03 "" "Linux Programmer's Manual" +.SH NAME +clock_getres, clock_gettime, clock_settime \- clock and time functions +.SH SYNOPSIS +.B #include +.sp +.BI "int clock_getres(clockid_t " clk_id ", struct timespec *" res ); + +.BI "int clock_gettime(clockid_t " clk_id ", struct timespec *" tp ); + +.BI "int clock_settime(clockid_t " clk_id ", const struct timespec *" tp ); +.sp +Link with \fI\-lrt\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR clock_getres (), +.BR clock_gettime (), +.BR clock_settime (): +_POSIX_C_SOURCE\ >=\ 199309L +.ad b +.SH DESCRIPTION +The function +.BR clock_getres () +finds the resolution (precision) of the specified clock +.IR clk_id , +and, if +.I res +is non-NULL, stores it in the \fIstruct timespec\fP pointed to by +.IR res . +The resolution of clocks depends on the implementation and cannot be +configured by a particular process. +If the time value pointed to by the argument +.I tp +of +.BR clock_settime () +is not a multiple of +.IR res , +then it is truncated to a multiple of +.IR res . +.PP +The functions +.BR clock_gettime () +and +.BR clock_settime () +retrieve and set the time of the specified clock +.IR clk_id . +.PP +The +.I res +and +.I tp +arguments are +.I timespec +structures, as specified in +.IR : +.sp +.in +4n +.nf +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.fi +.in +.PP +The +.I clk_id +argument is the identifier of the particular clock on which to act. +A clock may be system-wide and hence visible for all processes, or +per-process if it measures time only within a single process. +.LP +All implementations support the system-wide real-time clock, +which is identified by +.BR CLOCK_REALTIME . +Its time represents seconds and nanoseconds since the Epoch. +When its time is changed, timers for a relative interval are +unaffected, but timers for an absolute point in time are affected. +.LP +More clocks may be implemented. +The interpretation of the +corresponding time values and the effect on timers is unspecified. +.LP +Sufficiently recent versions of glibc and the Linux kernel +support the following clocks: +.TP +.B CLOCK_REALTIME +System-wide real-time clock. +Setting this clock requires appropriate privileges. +.TP +.B CLOCK_MONOTONIC +Clock that cannot be set and represents monotonic time since +some unspecified starting point. +.TP +.BR CLOCK_MONOTONIC_RAW " (since Linux 2.6.28; Linux-specific)" +.\" Added in commit 2d42244ae71d6c7b0884b5664cf2eda30fb2ae68, John Stultz +Similar to +.BR CLOCK_MONOTONIC , +but provides access to a raw hardware-based time +that is not subject to NTP adjustments. +.TP +.B CLOCK_PROCESS_CPUTIME_ID +High-resolution per-process timer from the CPU. +.TP +.B CLOCK_THREAD_CPUTIME_ID +Thread-specific CPU-time clock. +.SH "RETURN VALUE" +.BR clock_gettime (), +.BR clock_settime () +and +.BR clock_getres () +return 0 for success, or \-1 for failure (in which case +.I errno +is set appropriately). +.SH ERRORS +.TP +.B EFAULT +.I tp +points outside the accessible address space. +.TP +.B EINVAL +The +.I clk_id +specified is not supported on this system. +.\" 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. +.TP +.B EPERM +.BR clock_settime () +does not have permission to set the clock indicated. +.SH "CONFORMING TO" +SUSv2, POSIX.1-2001. +.SH AVAILABILITY +On POSIX systems on which these functions are available, the symbol +.B _POSIX_TIMERS +is defined in \fI\fP to a value greater than 0. +The symbols +.BR _POSIX_MONOTONIC_CLOCK , +.BR _POSIX_CPUTIME , +.B _POSIX_THREAD_CPUTIME +indicate that +.BR CLOCK_MONOTONIC , +.BR CLOCK_PROCESS_CPUTIME_ID , +.B CLOCK_THREAD_CPUTIME_ID +are available. +(See also +.BR sysconf (3).) +.SH NOTES +.SS Note for SMP systems +The +.B CLOCK_PROCESS_CPUTIME_ID +and +.B CLOCK_THREAD_CPUTIME_ID +clocks are realized on many platforms using timers from the CPUs +(TSC on i386, AR.ITC on Itanium). +These registers may differ between CPUs and as a consequence +these clocks may return +.B bogus results +if a process is migrated to another CPU. +.PP +If the CPUs in an SMP system have different clock sources then +there is no way to maintain a correlation between the timer registers since +each CPU will run at a slightly different frequency. +If that is the case then +.I clock_getcpuclockid(0) +will return +.B ENOENT +to signify this condition. +The two clocks will then only be useful if it +can be ensured that a process stays on a certain CPU. +.PP +The processors in an SMP system do not start all at exactly the same +time and therefore the timer registers are typically running at an offset. +Some architectures include code that attempts to limit these offsets on bootup. +However, the code cannot guarantee to accurately tune the offsets. +Glibc contains no provisions to deal with these offsets (unlike the Linux +Kernel). +Typically these offsets are small and therefore the effects may be +negligible in most cases. +.SH BUGS +According to POSIX.1-2001, a process with "appropriate privileges" may set the +.B CLOCK_PROCESS_CPUTIME_ID +and +.B CLOCK_THREAD_CPUTIME_ID +clocks using +.BR clock_settime (). +On Linux, these clocks are not settable +(i.e., no process has "appropriate privileges"). +.\" See http://bugzilla.kernel.org/show_bug.cgi?id=11972 +.SH "SEE ALSO" +.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) diff --git a/original/man2/clock_gettime.2 b/original/man2/clock_gettime.2 new file mode 100644 index 00000000..5a599b4b --- /dev/null +++ b/original/man2/clock_gettime.2 @@ -0,0 +1 @@ +.so man2/clock_getres.2 diff --git a/original/man2/clock_nanosleep.2 b/original/man2/clock_nanosleep.2 new file mode 100644 index 00000000..87711cf2 --- /dev/null +++ b/original/man2/clock_nanosleep.2 @@ -0,0 +1,249 @@ +.\" 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. +.\" +.TH CLOCK_NANOSLEEP 2 2008-07-09 "Linux" "Linux Programmer's Manual" +.SH NAME +clock_nanosleep \- high-resolution sleep with specifiable clock +.SH SYNOPSIS +.B #include +.nf +.sp +.BI "int clock_nanosleep(clockid_t " clock_id ", int " flags , +.BI " const struct timespec *" request , +.BI " struct timespec *" remain ); +.fi +.sp +Link with \fI\-lrt\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR clock_nanosleep (): +_XOPEN_SOURCE\ >=\ 600 +.SH DESCRIPTION +Like +.BR nanosleep (2), +.BR clock_nanosleep () +allows the caller to sleep for an interval specified +with nanosecond precision. +It differs in allowing the caller to select the clock against +which the sleep interval is to be measured, +and in allowing the sleep interval to be specified as +either an absolute or a relative value. + +The time values passed to and returned by this call are specified using +.I timespec +structures, defined as follows: +.sp +.in +4n +.nf +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds [0 .. 999999999] */ +}; +.fi +.in + +The +.I clock_id +argument specifies the clock against which the sleep interval +is to be measured. +This argument can have one of the following values: +.TP 17 +.BR CLOCK_REALTIME +A settable system-wide real-time clock. +.TP +.BR CLOCK_MONOTONIC +A nonsettable, monotonically increasing clock that measures time +since some unspecified point in the past that does not change after +system startup. +.\" On Linux this clock measures time since boot. +.TP +.BR CLOCK_PROCESS_CPUTIME_ID +A settable per-process clock that measures CPU time consumed +by all threads in the process. +.\" There is some trickery between glibc and the kernel +.\" to deal with the CLOCK_PROCESS_CPUTIME_ID case. +.PP +See +.BR clock_getres (2) +for further details on these clocks. + +If +.I flags +is 0, then the value specified in +.I request +is interpreted as an interval relative to the current +value of the clock specified by +.IR clock_id . + +If +.I flags +is +.BR TIMER_ABSTIME , +then +.I request +is interpreted as an absolute time as measured by the clock, +.IR clock_id . +If +.I request +is less than or equal to the current value of the clock, +then +.BR clock_nanosleep () +returns immediately without suspending the calling thread. + +.BR clock_nanosleep () +suspends the execution of the calling thread +until either at least the time specified by +.IR request +has elapsed, +or a signal is delivered that causes a signal handler to be called or +that terminates the process. + +If the call is interrupted by a signal handler, +.BR clock_nanosleep () +returns \-1, and sets +.I errno +to +.BR EINTR . +In addition, if +.I remain +is not NULL, and +.I flags +was not +.BR TIMER_ABSTIME , +it returns the remaining unslept time in +.IR remain . +This value can then be used to call +.BR clock_nanosleep () +again and complete a (relative) sleep. +.SH "RETURN VALUE" +On successfully sleeping for the requested interval, +.BR clock_nanosleep () +returns 0. +If the call is interrupted by a signal handler or encounters an error, +then it returns a positive error number. +.SH ERRORS +.TP +.B EFAULT +.I request +or +.I remain +specified an invalid address. +.TP +.B EINTR +The sleep was interrupted by a signal handler. +.TP +.B EINVAL +The value in the +.I tv_nsec +field was not in the range 0 to 999999999 or +.I tv_sec +was negative. +.TP +.B EINVAL +.I clock_id +was invalid. +.RB ( CLOCK_THREAD_CPUTIME_ID +is not a permitted value for +.IR clock_id .) +.SH VERSIONS +The +.BR clock_nanosleep () +system call first appeared in Linux 2.6. +Support is available in glibc since version 2.1. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +If the interval specified in +.I request +is not an exact multiple of the granularity underlying clock (see +.BR time (7)), +then the interval will be rounded up to the next multiple. +Furthermore, after the sleep completes, there may still be a delay before +the CPU becomes free to once again execute the calling thread. + +Using an absolute timer is useful for preventing +timer drift problems of the type described in +.BR nanosleep (2). +(Such problems are exacerbated in programs that try to restart +a relative sleep that is repeatedly interrupted by signals.) +To perform a relative sleep that avoids these problems, call +.BR clock_gettime (2) +for the desired clock, +add the desired interval to the returned time value, +and then call +.BR clock_nanosleep () +with the +.B TIMER_ABSTIME +flag. + +.BR clock_nanosleep () +is never restarted after being interrupted by a signal handler, +regardless of the use of the +.BR sigaction (2) +.B SA_SIGACTION +flag. + +The +.I remain +argument is unused, and unnecessary, when +.I flags +is +.BR TIMER_ABSTIME . +(An absolute sleep can be restarted using the same +.I request +argument.) + +POSIX.1 specifies that +.BR clock_nanosleep () +has no effect on signals dispositions or the signal mask. + +POSIX.1 specifies that after changing the value of the +.B CLOCK_REALTIME +clock via +.BR clock_settime (2), +the new clock value shall be used to determine the time +at which a thread blocked on an absolute +.BR clock_nanosleep () +will wake up; +if the new clock value falls past the end of the sleep interval, then the +.BR clock_nanosleep () +call will return immediately. + +POSIX.1 specifies that +changing the value of the +.B CLOCK_REALTIME +clock via +.BR clock_settime (2) +shall have no effect on a thread that is blocked on a relative +.BR clock_nanosleep (). +.SH "SEE ALSO" +.BR nanosleep (2), +.BR timer_create (2), +.BR clock_getres (2), +.BR sleep (3), +.BR usleep (3), +.BR time (7) diff --git a/original/man2/clock_settime.2 b/original/man2/clock_settime.2 new file mode 100644 index 00000000..5a599b4b --- /dev/null +++ b/original/man2/clock_settime.2 @@ -0,0 +1 @@ +.so man2/clock_getres.2 diff --git a/original/man2/clone.2 b/original/man2/clone.2 new file mode 100644 index 00000000..da70d21a --- /dev/null +++ b/original/man2/clone.2 @@ -0,0 +1,1021 @@ +.\" 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. +.\" +.TH CLONE 2 2009-07-18 "Linux" "Linux Programmer's Manual" +.SH NAME +clone, __clone2 \- create a child process +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.\" 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 +.SH DESCRIPTION +.BR clone () +creates a new process, in a manner similar to +.BR fork (2). +It is actually a library function layered on top of the underlying +.BR clone () +system call, hereinafter referred to as +.BR sys_clone . +A description of +.B sys_clone +is given towards the end of this page. + +Unlike +.BR fork (2), +these calls +allow the child process to share parts of its execution context with +the calling process, such as the memory space, the table of file +descriptors, and the table of signal handlers. +(Note that on this manual +page, "calling process" normally corresponds to "parent process". +But see the description of +.B CLONE_PARENT +below.) + +The main use of +.BR clone () +is to implement threads: multiple threads of control in a program that +run concurrently in a shared memory space. + +When the child process is created with +.BR clone (), +it executes the function +application +.IR fn ( arg ). +(This differs from +.BR fork (2), +where execution continues in the child from the point +of the +.BR fork (2) +call.) +The +.I fn +argument is a pointer to a function that is called by the child +process at the beginning of its execution. +The +.I arg +argument is passed to the +.I fn +function. + +When the +.IR fn ( arg ) +function application returns, the child process terminates. +The integer returned by +.I fn +is the exit code for the child process. +The child process may also terminate explicitly by calling +.BR exit (2) +or after receiving a fatal signal. + +The +.I child_stack +argument specifies the location of the stack used by the child process. +Since the child and calling process may share memory, +it is not possible for the child process to execute in the +same stack as the calling process. +The calling process must therefore +set up memory space for the child stack and pass a pointer to this +space to +.BR clone (). +Stacks grow downwards on all processors that run Linux +(except the HP PA processors), so +.I child_stack +usually points to the topmost address of the memory space set up for +the child stack. + +The low byte of +.I flags +contains the number of the +.I "termination signal" +sent to the parent when the child dies. +If this signal is specified as anything other than +.BR SIGCHLD , +then the parent process must specify the +.B __WALL +or +.B __WCLONE +options when waiting for the child with +.BR wait (2). +If no signal is specified, then the parent process is not signaled +when the child terminates. + +.I flags +may also be bitwise-or'ed with zero or more of the following constants, +in order to specify what is shared between the calling process +and the child process: +.TP +.BR CLONE_CHILD_CLEARTID " (since Linux 2.5.49)" +Erase child thread ID at location +.I ctid +in child memory when the child exits, and do a wakeup on the futex +at that address. +The address involved may be changed by the +.BR set_tid_address (2) +system call. +This is used by threading libraries. +.TP +.BR CLONE_CHILD_SETTID " (since Linux 2.5.49)" +Store child thread ID at location +.I ctid +in child memory. +.TP +.B CLONE_FILES +If +.B CLONE_FILES +is set, the calling process and the child process share the same file +descriptor table. +Any file descriptor created by the calling process or by the child +process is also valid in the other process. +Similarly, if one of the processes closes a file descriptor, +or changes its associated flags (using the +.BR fcntl (2) +.B F_SETFD +operation), the other process is also affected. + +If +.B CLONE_FILES +is not set, the child process inherits a copy of all file descriptors +opened in the calling process at the time of +.BR clone (). +(The duplicated file descriptors in the child refer to the +same open file descriptions (see +.BR open (2)) +as the corresponding file descriptors in the calling process.) +Subsequent operations that open or close file descriptors, +or change file descriptor flags, +performed by either the calling +process or the child process do not affect the other process. +.TP +.B CLONE_FS +If +.B CLONE_FS +is set, the caller and the child process share the same file system +information. +This includes the root of the file system, the current +working directory, and the umask. +Any call to +.BR chroot (2), +.BR chdir (2), +or +.BR umask (2) +performed by the calling process or the child process also affects the +other process. + +If +.B CLONE_FS +is not set, the child process works on a copy of the file system +information of the calling process at the time of the +.BR clone () +call. +Calls to +.BR chroot (2), +.BR chdir (2), +.BR umask (2) +performed later by one of the processes do not affect the other process. +.TP +.BR CLONE_IO " (since Linux 2.6.25)" +If +.B CLONE_IO +is set, then the new process shares an I/O context with +the calling process. +If this flag is not set, then (as with +.BR fork (2)) +the new process has its own I/O context. + +.\" The following based on text from Jens Axboe +The I/O context is the I/O scope of the disk scheduler (i.e, +what the I/O scheduler uses to model scheduling of a process's I/O). +If processes share the same I/O context, +they are treated as one by the I/O scheduler. +As a consequence, they get to share disk time. +For some I/O schedulers, +.\" the anticipatory and CFQ scheduler +if two processes share an I/O context, +they will be allowed to interleave their disk access. +If several threads are doing I/O on behalf of the same process +.RB ( aio_read (3), +for instance), they should employ +.BR CLONE_IO +to get better I/O performance. +.\" with CFQ and AS. + +If the kernel is not configured with the +.B CONFIG_BLOCK +option, this flag is a no-op. +.TP +.BR CLONE_NEWIPC " (since Linux 2.6.19)" +If +.B CLONE_NEWIPC +is set, then create the process in a new IPC namespace. +If this flag is not set, then (as with +.BR fork (2)), +the process is created in the same IPC namespace as +the calling process. +This flag is intended for the implementation of containers. + +An IPC namespace consists of the set of identifiers for +System V IPC objects. +(These objects are created using +.BR msgctl (2), +.BR semctl (2), +and +.BR shmctl (2)). +Objects created in an IPC namespace are visible to all other processes +that are members of that namespace, +but are not visible to processes in other IPC namespaces. + +When an IPC namespace is destroyed +(i.e, when the last process that is a member of the namespace terminates), +all IPC objects in the namespace are automatically destroyed. + +Use of this flag requires: a kernel configured with the +.B CONFIG_SYSVIPC +and +.B CONFIG_IPC_NS +options and that the process be privileged +.RB ( CAP_SYS_ADMIN ). +This flag can't be specified in conjunction with +.BR CLONE_SYSVSEM . +.TP +.BR CLONE_NEWNET " (since Linux 2.6.24)" +(The implementation of this flag is not yet complete, +but probably will be mostly complete by about Linux 2.6.28.) + +If +.B CLONE_NEWNET +is set, then create the process in a new network namespace. +If this flag is not set, then (as with +.BR fork (2)), +the process is created in the same network namespace as +the calling process. +This flag is intended for the implementation of containers. + +A network namespace provides an isolated view of the networking stack +(network device interfaces, IPv4 and IPv6 protocol stacks, +IP routing tables, firewall rules, the +.I /proc/net +and +.I /sys/class/net +directory trees, sockets, etc.). +A physical network device can live in exactly one +network namespace. +A virtual network device ("veth") pair provides a pipe-like abstraction +that can be used to create tunnels between network namespaces, +and can be used to create a bridge to a physical network device +in another namespace. + +When a network namespace is freed +(i.e., when the last process in the namespace terminates), +its physical network devices are moved back to the +initial network namespace (not to the parent of the process). + +Use of this flag requires: a kernel configured with the +.B CONFIG_NET_NS +option and that the process be privileged +.RB ( CAP_SYS_ADMIN ). +.TP +.BR CLONE_NEWNS " (since Linux 2.4.19)" +Start the child in a new mount namespace. + +Every process lives in a mount namespace. +The +.I namespace +of a process is the data (the set of mounts) describing the file hierarchy +as seen by that process. +After a +.BR fork (2) +or +.BR clone () +where the +.B CLONE_NEWNS +flag is not set, the child lives in the same mount +namespace as the parent. +The system calls +.BR mount (2) +and +.BR umount (2) +change the mount namespace of the calling process, and hence affect +all processes that live in the same namespace, but do not affect +processes in a different mount namespace. + +After a +.BR clone () +where the +.B CLONE_NEWNS +flag is set, the cloned child is started in a new mount namespace, +initialized with a copy of the namespace of the parent. + +Only a privileged process (one having the \fBCAP_SYS_ADMIN\fP capability) +may specify the +.B CLONE_NEWNS +flag. +It is not permitted to specify both +.B CLONE_NEWNS +and +.B CLONE_FS +in the same +.BR clone () +call. +.TP +.BR CLONE_NEWPID " (since 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 +If +.B CLONE_NEWPID +is set, then create the process in a new PID namespace. +If this flag is not set, then (as with +.BR fork (2)), +the process is created in the same PID namespace as +the calling process. +This flag is intended for the implementation of containers. + +A PID namespace provides an isolated environment for PIDs: +PIDs in a new namespace start at 1, +somewhat like a standalone system, and calls to +.BR fork (2), +.BR vfork (2), +or +.BR clone (2) +will produce processes with PIDs that are unique within the namespace. + +The first process created in a new namespace +(i.e., the process created using the +.BR CLONE_NEWPID +flag) has the PID 1, and is the "init" process for the namespace. +Children that are orphaned within the namespace will be reparented +to this process rather than +.BR init (8). +Unlike the traditional +.B init +process, the "init" process of a PID namespace can terminate, +and if it does, all of the processes in the namespace are terminated. + +PID namespaces form a hierarchy. +When a new PID namespace is created, +the processes in that namespace are visible +in the PID namespace of the process that created the new namespace; +analogously, if the parent PID namespace is itself +the child of another PID namespace, +then processes in the child and parent PID namespaces will both be +visible in the grandparent PID namespace. +Conversely, the processes in the "child" PID namespace do not see +the processes in the parent namespace. +The existence of a namespace hierarchy means that each process +may now have multiple PIDs: +one for each namespace in which it is visible; +each of these PIDs is unique within the corresponding namespace. +(A call to +.BR getpid (2) +always returns the PID associated with the namespace in which +the process lives.) + +After creating the new namespace, +it is useful for the child to change its root directory +and mount a new procfs instance at +.I /proc +so that tools such as +.BR ps (1) +work correctly. +.\" mount -t proc proc /proc +(If +.BR CLONE_NEWNS +is also included in +.IR flags , +then it isn't necessary to change the root directory: +a new procfs instance can be mounted directly over +.IR /proc .) + +Use of this flag requires: a kernel configured with the +.B CONFIG_PID_NS +option and that the process be privileged +.RB ( CAP_SYS_ADMIN ). +This flag can't be specified in conjunction with +.BR CLONE_THREAD . +.TP +.BR CLONE_NEWUTS " (since Linux 2.6.19)" +If +.B CLONE_NEWUTS +is set, then create the process in a new UTS namespace, +whose identifiers are initialized by duplicating the identifiers +from the UTS namespace of the calling process. +If this flag is not set, then (as with +.BR fork (2)), +the process is created in the same UTS namespace as +the calling process. +This flag is intended for the implementation of containers. + +A UTS namespace is the set of identifiers returned by +.BR uname (2); +among these, the domain name and the host name can be modified by +.BR setdomainname (2) +and +.BR +.BR sethostname (2), +respectively. +Changes made to the identifiers in a UTS namespace +are visible to all other processes in the same namespace, +but are not visible to processes in other UTS namespaces. + +Use of this flag requires: a kernel configured with the +.B CONFIG_UTS_NS +option and that the process be privileged +.RB ( CAP_SYS_ADMIN ). +.TP +.BR CLONE_PARENT " (since Linux 2.3.12)" +If +.B CLONE_PARENT +is set, then the parent of the new child (as returned by +.BR getppid (2)) +will be the same as that of the calling process. + +If +.B CLONE_PARENT +is not set, then (as with +.BR fork (2)) +the child's parent is the calling process. + +Note that it is the parent process, as returned by +.BR getppid (2), +which is signaled when the child terminates, so that +if +.B CLONE_PARENT +is set, then the parent of the calling process, rather than the +calling process itself, will be signaled. +.TP +.BR CLONE_PARENT_SETTID " (since Linux 2.5.49)" +Store child thread ID at location +.I ptid +in parent and child memory. +(In Linux 2.5.32-2.5.48 there was a flag +.B CLONE_SETTID +that did this.) +.TP +.BR CLONE_PID " (obsolete)" +If +.B CLONE_PID +is set, the child process is created with the same process ID as +the calling process. +This is good for hacking the system, but otherwise +of not much use. +Since 2.3.21 this flag can be +specified only by the system boot process (PID 0). +It disappeared in Linux 2.5.16. +.TP +.B CLONE_PTRACE +If +.B CLONE_PTRACE +is specified, and the calling process is being traced, +then trace the child also (see +.BR ptrace (2)). +.TP +.BR CLONE_SETTLS " (since Linux 2.5.32)" +The +.I newtls +argument is the new TLS (Thread Local Storage) descriptor. +(See +.BR set_thread_area (2).) +.TP +.B CLONE_SIGHAND +If +.B CLONE_SIGHAND +is set, the calling process and the child process share the same table of +signal handlers. +If the calling process or child process calls +.BR sigaction (2) +to change the behavior associated with a signal, the behavior is +changed in the other process as well. +However, the calling process and child +processes still have distinct signal masks and sets of pending +signals. +So, one of them may block or unblock some signals using +.BR sigprocmask (2) +without affecting the other process. + +If +.B CLONE_SIGHAND +is not set, the child process inherits a copy of the signal handlers +of the calling process at the time +.BR clone () +is called. +Calls to +.BR sigaction (2) +performed later by one of the processes have no effect on the other +process. + +Since Linux 2.6.0-test6, +.I flags +must also include +.B CLONE_VM +if +.B CLONE_SIGHAND +is specified +.TP +.BR CLONE_STOPPED " (since Linux 2.6.0-test2)" +If +.B CLONE_STOPPED +is set, then the child is initially stopped (as though it was sent a +.B SIGSTOP +signal), and must be resumed by sending it a +.B SIGCONT +signal. + +.I "From Linux 2.6.25 this flag is deprecated." +You probably never wanted to use it, +you certainly shouldn't be using it, and soon it will go away. +.\" glibc 2.8 removed this defn from bits/sched.h +.TP +.BR CLONE_SYSVSEM " (since Linux 2.5.10)" +If +.B CLONE_SYSVSEM +is set, then the child and the calling process share +a single list of System V semaphore undo values (see +.BR semop (2)). +If this flag is not set, then the child has a separate undo list, +which is initially empty. +.TP +.BR CLONE_THREAD " (since Linux 2.4.0-test8)" +If +.B CLONE_THREAD +is set, the child is placed in the same thread group as the calling process. +To make the remainder of the discussion of +.B CLONE_THREAD +more readable, the term "thread" is used to refer to the +processes within a thread group. + +Thread groups were a feature added in Linux 2.4 to support the +POSIX threads notion of a set of threads that share a single PID. +Internally, this shared PID is the so-called +thread group identifier (TGID) for the thread group. +Since Linux 2.4, calls to +.BR getpid (2) +return the TGID of the caller. + +The threads within a group can be distinguished by their (system-wide) +unique thread IDs (TID). +A new thread's TID is available as the function result +returned to the caller of +.BR clone (), +and a thread can obtain +its own TID using +.BR gettid (2). + +When a call is made to +.BR clone () +without specifying +.BR CLONE_THREAD , +then the resulting thread is placed in a new thread group +whose TGID is the same as the thread's TID. +This thread is the +.I leader +of the new thread group. + +A new thread created with +.B CLONE_THREAD +has the same parent process as the caller of +.BR clone () +(i.e., like +.BR CLONE_PARENT ), +so that calls to +.BR getppid (2) +return the same value for all of the threads in a thread group. +When a +.B CLONE_THREAD +thread terminates, the thread that created it using +.BR clone () +is not sent a +.B SIGCHLD +(or other termination) signal; +nor can the status of such a thread be obtained +using +.BR wait (2). +(The thread is said to be +.IR detached .) + +After all of the threads in a thread group terminate +the parent process of the thread group is sent a +.B SIGCHLD +(or other termination) signal. + +If any of the threads in a thread group performs an +.BR execve (2), +then all threads other than the thread group leader are terminated, +and the new program is executed in the thread group leader. + +If one of the threads in a thread group creates a child using +.BR fork (2), +then any thread in the group can +.BR wait (2) +for that child. + +Since Linux 2.5.35, +.I flags +must also include +.B CLONE_SIGHAND +if +.B CLONE_THREAD +is specified. + +Signals may be sent to a thread group as a whole (i.e., a TGID) using +.BR kill (2), +or to a specific thread (i.e., TID) using +.BR tgkill (2). + +Signal dispositions and actions are process-wide: +if an unhandled signal is delivered to a thread, then +it will affect (terminate, stop, continue, be ignored in) +all members of the thread group. + +Each thread has its own signal mask, as set by +.BR sigprocmask (2), +but signals can be pending either: for the whole process +(i.e., deliverable to any member of the thread group), +when sent with +.BR kill (2); +or for an individual thread, when sent with +.BR tgkill (2). +A call to +.BR sigpending (2) +returns a signal set that is the union of the signals pending for the +whole process and the signals that are pending for the calling thread. + +If +.BR kill (2) +is used to send a signal to a thread group, +and the thread group has installed a handler for the signal, then +the handler will be invoked in exactly one, arbitrarily selected +member of the thread group that has not blocked the signal. +If multiple threads in a group are waiting to accept the same signal using +.BR sigwaitinfo (2), +the kernel will arbitrarily select one of these threads +to receive a signal sent using +.BR kill (2). +.TP +.BR CLONE_UNTRACED " (since Linux 2.5.46)" +If +.B CLONE_UNTRACED +is specified, then a tracing process cannot force +.B CLONE_PTRACE +on this child process. +.TP +.B CLONE_VFORK +If +.B CLONE_VFORK +is set, the execution of the calling process is suspended +until the child releases its virtual memory +resources via a call to +.BR execve (2) +or +.BR _exit (2) +(as with +.BR vfork (2)). + +If +.B CLONE_VFORK +is not set then both the calling process and the child are schedulable +after the call, and an application should not rely on execution occurring +in any particular order. +.TP +.B CLONE_VM +If +.B CLONE_VM +is set, the calling process and the child process run in the same memory +space. +In particular, memory writes performed by the calling process +or by the child process are also visible in the other process. +Moreover, any memory mapping or unmapping performed with +.BR mmap (2) +or +.BR munmap (2) +by the child or calling process also affects the other process. + +If +.B CLONE_VM +is not set, the child process runs in a separate copy of the memory +space of the calling process at the time of +.BR clone (). +Memory writes or file mappings/unmappings performed by one of the +processes do not affect the other, as with +.BR fork (2). +.SS "sys_clone" +The +.B sys_clone +system call corresponds more closely to +.BR fork (2) +in that execution in the child continues from the point of the +call. +Thus, +.B sys_clone +only requires the +.I flags +and +.I child_stack +arguments, which have the same meaning as for +.BR clone (). +(Note that the order of these arguments differs from +.BR clone ().) + +Another difference for +.B sys_clone +is that the +.I child_stack +argument may be zero, in which case copy-on-write semantics ensure that the +child gets separate copies of stack pages when either process modifies +the stack. +In this case, for correct operation, the +.B CLONE_VM +option should not be specified. + +In Linux 2.4 and earlier, +.BR clone () +does not take arguments +.IR ptid , +.IR tls , +and +.IR ctid . +.SH "RETURN VALUE" +.\" gettid(2) returns current->pid; +.\" getpid(2) returns current->tgid; +On success, the thread ID of the child process is returned +in the caller's thread of execution. +On failure, \-1 is returned +in the caller's context, no child process will be created, and +.I errno +will be set appropriately. +.SH ERRORS +.TP +.B EAGAIN +Too many processes are already running. +.TP +.B EINVAL +.B CLONE_SIGHAND +was specified, but +.B CLONE_VM +was not. +(Since Linux 2.6.0-test6.) +.TP +.B EINVAL +.B CLONE_THREAD +was specified, but +.B CLONE_SIGHAND +was not. +(Since Linux 2.5.35.) +.\" .TP +.\" .B EINVAL +.\" Precisely one of +.\" .B CLONE_DETACHED +.\" and +.\" .B CLONE_THREAD +.\" was specified. +.\" (Since Linux 2.6.0-test6.) +.TP +.B EINVAL +Both +.B CLONE_FS +and +.B CLONE_NEWNS +were specified in +.IR flags . +.TP +.B EINVAL +Both +.B CLONE_NEWIPC +and +.B CLONE_SYSVSEM +were specified in +.IR flags . +.TP +.B EINVAL +Both +.BR CLONE_NEWPID +and +.BR CLONE_THREAD +were specified in +.IR flags . +.TP +.B EINVAL +Returned by +.BR clone () +when a zero value is specified for +.IR child_stack . +.TP +.B EINVAL +.BR CLONE_NEWIPC +was specified in +.IR flags , +but the kernel was not configured with the +.B CONFIG_SYSVIPC +and +.BR CONFIG_IPC_NS +options. +.TP +.B EINVAL +.BR CLONE_NEWNET +was specified in +.IR flags , +but the kernel was not configured with the +.B CONFIG_NET_NS +option. +.TP +.B EINVAL +.BR CLONE_NEWPID +was specified in +.IR flags , +but the kernel was not configured with the +.B CONFIG_PID_NS +option. +.TP +.B EINVAL +.BR CLONE_NEWUTS +was specified in +.IR flags , +but the kernel was not configured with the +.B CONFIG_UTS +option. +.TP +.B ENOMEM +Cannot allocate sufficient memory to allocate a task structure for the +child, or to copy those parts of the caller's context that need to be +copied. +.TP +.B EPERM +.BR CLONE_NEWIPC , +.BR CLONE_NEWNET , +.BR CLONE_NEWNS , +.BR CLONE_NEWPID , +or +.BR CLONE_NEWUTS +was specified by an unprivileged process (process without \fBCAP_SYS_ADMIN\fP). +.TP +.B EPERM +.B CLONE_PID +was specified by a process other than process 0. +.SH VERSIONS +There is no entry for +.BR clone () +in libc5. +glibc2 provides +.BR clone () +as described in this manual page. +.SH "CONFORMING TO" +The +.BR clone () +and +.B sys_clone +calls are Linux-specific and should not be used in programs +intended to be portable. +.SH NOTES +In the kernel 2.4.x series, +.B CLONE_THREAD +generally does not make the parent of the new thread the same +as the parent of the calling process. +However, for kernel versions 2.4.7 to 2.4.18 the +.B CLONE_THREAD +flag implied the +.B CLONE_PARENT +flag (as in kernel 2.6). + +For a while there was +.B CLONE_DETACHED +(introduced in 2.5.32): +parent wants no child-exit signal. +In 2.6.2 the need to give this +together with +.B CLONE_THREAD +disappeared. +This flag is still defined, but has no effect. + +On i386, +.BR clone () +should not be called through vsyscall, but directly through +.IR "int $0x80" . + +On ia64, a different system call is used: +.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 +The +.BR __clone2 () +system call operates in the same way as +.BR clone (), +except that +.I child_stack_base +points to the lowest address of the child's stack area, +and +.I stack_size +specifies the size of the stack pointed to by +.IR child_stack_base . +.SH BUGS +Versions of the GNU C library that include the NPTL threading library +contain a wrapper function for +.BR getpid (2) +that performs caching of PIDs. +This caching relies on support in the glibc wrapper for +.BR clone (), +but as currently implemented, +the cache may not be up to date in some circumstances. +In particular, +if a signal is delivered to the child immediately after the +.BR clone () +call, then a call to +.BR getpid () +in a handler for the signal may return the PID +of the calling process ("the parent"), +if the clone wrapper has not yet had a chance to update the PID +cache in the child. +(This discussion ignores the case where the child was created using +.BR CLONE_THREAD , +when +.BR getpid () +.I should +return the same value in the child and in the process that called +.BR clone (), +since the caller and the child are in the same thread group. +The stale-cache problem also does not occur if the +.I flags +argument includes +.BR CLONE_VM .) +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 +.SH "SEE ALSO" +.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/original/man2/clone2.2 b/original/man2/clone2.2 new file mode 100644 index 00000000..68f41a5b --- /dev/null +++ b/original/man2/clone2.2 @@ -0,0 +1 @@ +.so man2/clone.2 diff --git a/original/man2/close.2 b/original/man2/close.2 new file mode 100644 index 00000000..a2a29612 --- /dev/null +++ b/original/man2/close.2 @@ -0,0 +1,131 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 Wed Jul 21 22:40:25 1993 by Rik Faith +.\" Modified Sat Feb 18 15:27:48 1995 by Michael Haardt +.\" Modified Sun Apr 14 11:40:50 1996 by Andries Brouwer : +.\" 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 Nicolás Lichtmaier +.\" added note about close(2) not guaranteeing that data is safe on close. +.\" +.TH CLOSE 2 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH NAME +close \- close a file descriptor +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int close(int " fd ); +.fi +.SH DESCRIPTION +.BR close () +closes a file descriptor, so that it no longer refers to any file and +may be reused. +Any record locks (see +.BR fcntl (2)) +held on the file it was associated with, +and owned by the process, are removed (regardless of the file +descriptor that was used to obtain the lock). +.PP +If +.I fd +is the last file descriptor referring to the underlying +open file description (see +.BR open (2)), +the resources associated with the open file description are freed; +if the descriptor was the last reference to a file which has been +removed using +.BR unlink (2) +the file is deleted. +.SH "RETURN VALUE" +.BR close () +returns zero on success. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +.I fd +isn't a valid open file descriptor. +.TP +.B EINTR +The +.BR close () +call was interrupted by a signal; see +.BR signal (7). +.TP +.B EIO +An I/O error occurred. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.\" SVr4 documents an additional ENOLINK error condition. +.SH NOTES +Not checking the return value of +.BR close () +is a common but nevertheless +serious programming error. +It is quite possible that errors on a +previous +.BR write (2) +operation are first reported at the final +.BR close (). +Not checking the return value when closing the file may lead to +silent loss of data. +This can especially be observed with NFS +and with disk quota. +.PP +A successful close does not guarantee that the data has been successfully +saved to disk, as the kernel defers writes. +It is not common for a file system +to flush the buffers when the stream is closed. +If you need to be sure that +the data is physically stored use +.BR fsync (2). +(It will depend on the disk hardware at this point.) +.PP +It is probably unwise to close file descriptors while +they may be in use by system calls in +other threads in the same process. +Since a file descriptor may be reused, +there are some obscure race conditions +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 +.\" in use by a system call is closed and then reused by e.g. an +.\" independent open() in some unrelated thread, before the original system +.\" 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. +.SH "SEE ALSO" +.BR fcntl (2), +.BR fsync (2), +.BR open (2), +.BR shutdown (2), +.BR unlink (2), +.BR fclose (3) diff --git a/original/man2/connect.2 b/original/man2/connect.2 new file mode 100644 index 00000000..ea1367e3 --- /dev/null +++ b/original/man2/connect.2 @@ -0,0 +1,267 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from /usr/include/sys/socket.h, which does not have +.\" any authorship information in it. It is probably available under the GPL. +.\" +.\" 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. +.\" +.\" +.\" Other portions are from the 6.9 (Berkeley) 3/10/91 man page: +.\" +.\" Copyright (c) 1983 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. +.\" +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 1998, 1999 by Andi Kleen +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.TH CONNECT 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH NAME +connect \- initiate a connection on a socket +.SH SYNOPSIS +.nf +.BR "#include " " /* See NOTES */" +.br +.B #include +.sp +.BI "int connect(int " sockfd ", const struct sockaddr *" addr , +.BI " socklen_t " addrlen ); +.fi +.SH DESCRIPTION +The +.BR connect () +system call connects the socket referred to by the file descriptor +.I sockfd +to the address specified by +.IR addr . +The +.I addrlen +argument specifies the size of +.IR addr . +The format of the address in +.I addr +is determined by the address space of the socket +.IR sockfd ; +see +.BR socket (2) +for further details. + +If the socket +.I sockfd +is of type +.B SOCK_DGRAM +then +.I addr +is the address to which datagrams are sent by default, and the only +address from which datagrams are received. +If the socket is of type +.B SOCK_STREAM +or +.BR SOCK_SEQPACKET , +this call attempts to make a connection to the socket that is bound +to the address specified by +.IR addr . +.PP +Generally, connection-based protocol sockets may successfully +.BR connect () +only once; connectionless protocol sockets may use +.BR connect () +multiple times to change their association. +Connectionless sockets may +dissolve the association by connecting to an address with the +.I sa_family +member of +.I sockaddr +set to +.BR AF_UNSPEC +(supported on Linux since kernel 2.2). +.SH "RETURN VALUE" +If the connection or binding succeeds, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +The following are general socket errors only. +There may be other domain-specific error codes. +.TP +.B EACCES +For Unix domain sockets, which are identified by pathname: +Write permission is denied on the socket file, +or search permission is denied for one of the directories +in the path prefix. +(See also +.BR path_resolution (7).) +.TP +.BR EACCES ", " EPERM +The user tried to connect to a broadcast address without having the socket +broadcast flag enabled or the connection request failed because of a local +firewall rule. +.TP +.B EADDRINUSE +Local address is already in use. +.TP +.B EAFNOSUPPORT +The passed address didn't have the correct address family in its +.I sa_family +field. +.TP +.B EAGAIN +No more free local ports or insufficient entries in the routing cache. +For +.B AF_INET +see the description of +.I /proc/sys/net/ipv4/ip_local_port_range +.BR ip (7) +for information on how to increase the number of local ports. +.TP +.B EALREADY +The socket is nonblocking and a previous connection attempt has not yet +been completed. +.TP +.B EBADF +The file descriptor is not a valid index in the descriptor table. +.TP +.B ECONNREFUSED +No-one listening on the remote address. +.TP +.B EFAULT +The socket structure address is outside the user's address space. +.TP +.B EINPROGRESS +The socket is nonblocking and the connection cannot be completed +immediately. +It is possible to +.BR select (2) +or +.BR poll (2) +for completion by selecting the socket for writing. +After +.BR select (2) +indicates writability, use +.BR getsockopt (2) +to read the +.B SO_ERROR +option at level +.B SOL_SOCKET +to determine whether +.BR connect () +completed successfully +.RB ( SO_ERROR +is zero) or unsuccessfully +.RB ( SO_ERROR +is one of the usual error codes listed here, +explaining the reason for the failure). +.TP +.B EINTR +The system call was interrupted by a signal that was caught; see +.BR signal (7). +.\" For TCP, the connection will complete asynchronously. +.\" See http://lkml.org/lkml/2005/7/12/254 +.TP +.B EISCONN +The socket is already connected. +.TP +.B ENETUNREACH +Network is unreachable. +.TP +.B ENOTSOCK +The file descriptor is not associated with a socket. +.TP +.B ETIMEDOUT +Timeout while attempting connection. +The server may be too +busy to accept new connections. +Note that for IP sockets the timeout may +be very long when syncookies are enabled on the server. +.SH "CONFORMING TO" +SVr4, 4.4BSD, (the +.BR connect () +function first appeared in 4.2BSD), POSIX.1-2001. +.\" SVr4 documents the additional +.\" general error codes +.\" .BR EADDRNOTAVAIL , +.\" .BR EINVAL , +.\" .BR EAFNOSUPPORT , +.\" .BR EALREADY , +.\" .BR EINTR , +.\" .BR EPROTOTYPE , +.\" and +.\" .BR ENOSR . +.\" It also +.\" documents many additional error conditions not described here. +.SH NOTES +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. + +The third argument of +.BR connect () +is in reality an +.I int +(and this is what 4.x BSD and libc4 and libc5 have). +Some POSIX confusion resulted in the present +.IR socklen_t , +also used by glibc. +See also +.BR accept (2). +.SH EXAMPLE +An example of the use of +.BR connect () +is shown in +.BR getaddrinfo (3). +.SH "SEE ALSO" +.BR accept (2), +.BR bind (2), +.BR getsockname (2), +.BR listen (2), +.BR socket (2), +.BR path_resolution (7) diff --git a/original/man2/creat.2 b/original/man2/creat.2 new file mode 100644 index 00000000..604e1213 --- /dev/null +++ b/original/man2/creat.2 @@ -0,0 +1 @@ +.so man2/open.2 diff --git a/original/man2/create_module.2 b/original/man2/create_module.2 new file mode 100644 index 00000000..714f1034 --- /dev/null +++ b/original/man2/create_module.2 @@ -0,0 +1,62 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.TH CREATE_MODULE 2 2007-06-03 "Linux" "Linux Programmer's Manual" +.SH NAME +create_module \- create a loadable module entry +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "caddr_t create_module(const char *" name ", size_t " size ); +.fi +.SH DESCRIPTION +.BR create_module () +attempts to create a loadable module entry and reserve the kernel memory +that will be needed to hold the module. +This system call requires privilege. +.SH "RETURN VALUE" +On success, returns the kernel address at which the module will reside. +On error \-1 is returned and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EEXIST +A module by that name already exists. +.TP +.B EFAULT +.I name +is outside the program's accessible address space. +.TP +.B EINVAL +The requested size is too small even for the module header information. +.TP +.B ENOMEM +The kernel could not allocate a contiguous block of memory large +enough for the module. +.TP +.B ENOSYS +.BR create_module () +is not supported in this version of the kernel. +.TP +.B EPERM +The caller was not privileged +(did not have the +.B CAP_SYS_MODULE +capability). +.SH VERSIONS +This system call is only present on Linux up until kernel 2.4; +it was removed in Linux 2.6. +.\" Removed in Linux 2.5.48 +.SH "CONFORMING TO" +.BR create_module () +is Linux-specific. +.SH "SEE ALSO" +.BR delete_module (2), +.BR init_module (2), +.BR query_module (2) diff --git a/original/man2/delete_module.2 b/original/man2/delete_module.2 new file mode 100644 index 00000000..90c9d7e9 --- /dev/null +++ b/original/man2/delete_module.2 @@ -0,0 +1,57 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.TH DELETE_MODULE 2 2006-02-09 "Linux" "Linux Programmer's Manual" +.SH NAME +delete_module \- delete a loadable module entry +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int delete_module(const char *" name ); +.fi +.SH DESCRIPTION +.BR delete_module () +attempts to remove an unused loadable module entry. +If +.I name +is NULL, +all unused modules marked auto-clean will be removed. +This system call requires privilege. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBUSY +The module is in use. +.TP +.B EFAULT +.I name +is outside the program's accessible address space. +.TP +.B EINVAL +.I name +was an empty string. +.TP +.B ENOENT +No module by that name exists. +.TP +.B EPERM +The caller was not privileged +(did not have the +.B CAP_SYS_MODULE +capability). +.SH "CONFORMING TO" +.BR delete_module () +is Linux-specific. +.SH "SEE ALSO" +.BR create_module (2), +.BR init_module (2), +.BR query_module (2) diff --git a/original/man2/dup.2 b/original/man2/dup.2 new file mode 100644 index 00000000..c4ac032c --- /dev/null +++ b/original/man2/dup.2 @@ -0,0 +1,209 @@ +.\" 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) 2005, 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 1993-07-21, Rik Faith +.\" Modified 1994-08-21, Michael Chastain : +.\" Fixed typoes. +.\" Modified 1997-01-31, Eric S. Raymond +.\" Modified 2002-09-28, aeb +.\" 2009-01-12, mtk, reordered text in DESCRIPTION and added some +.\" details for dup2(). +.\" 2008-10-09, mtk: add description of dup3() +.\" +.TH DUP 2 2008-10-09 "Linux" "Linux Programmer's Manual" +.SH NAME +dup, dup2, dup3 \- duplicate a file descriptor +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int dup(int " oldfd ); +.BI "int dup2(int " oldfd ", int " newfd ); +.sp +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int dup3(int " oldfd ", int " newfd ", int " flags ); +.fi +.SH DESCRIPTION +These system calls create a copy of the file descriptor +.IR oldfd . + +.BR dup () +uses the lowest-numbered unused descriptor for the new descriptor. + +.BR dup2 () +.RI "makes " newfd " be the copy of " oldfd ", closing " newfd +first if necessary, but note the following: +.IP * 3 +If +.I oldfd +is not a valid file descriptor, then the call fails, and +.I newfd +is not closed. +.IP * +If +.I oldfd +is a valid file descriptor, and +.I newfd +has the same value as +.IR oldfd , +then +.BR dup2 () +does nothing, and returns +.IR newfd . +.PP +After a successful return from one of these system calls, +the old and new file descriptors may be used interchangeably. +They refer to the same open file description (see +.BR open (2)) +and thus share file offset and file status flags; +for example, if the file offset is modified by using +.BR lseek (2) +on one of the descriptors, the offset is also changed for the other. + +The two descriptors do not share file descriptor flags +(the close-on-exec flag). +The close-on-exec flag +.RB ( FD_CLOEXEC ; +see +.BR fcntl (2)) +for the duplicate descriptor is off. + +.BR dup3 () +is the same as +.BR dup2 (), +except that: +.IP * 3 +The caller can force the close-on-exec flag to be set +for the new file descriptor by specifying +.BR O_CLOEXEC +in +.IR flags . +See the description of the same flag in +.BR open (2) +for reasons why this may be useful. +.IP * +.\" FIXME . To confirm with Al Viro that this was intended, and its rationale +If +.IR oldfd +equals +.IR newfd , +then +.BR dup3 () +fails with the error +.BR EINVAL . +.SH "RETURN VALUE" +On success, these system calls +return the new descriptor. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +.I oldfd +isn't an open file descriptor, or +.I newfd +is out of the allowed range for file descriptors. +.TP +.B EBUSY +(Linux only) This may be returned by +.BR dup2 () +or +.BR dup3 () +during a race condition with +.BR open (2) +and +.BR dup (). +.TP +.B EINTR +The +.BR dup2 () +or +.BR dup3 () +call was interrupted by a signal; see +.BR signal (7). +.TP +.B EINVAL +.RB ( dup3 ()) +.I flags +contain an invalid value. +.\" FIXME . To confirm with Al Viro that this was intended, and its rationale +Or, +.I oldfd +was equal to +.IR newfd . +.TP +.B EMFILE +The process already has the maximum number of file +descriptors open and tried to open a new one. +.SH VERSIONS +.BR dup3 () +was added to Linux in version 2.6.27; +glibc support is available starting with +version 2.9. +.SH "CONFORMING TO" +.BR dup (), +.BR dup2 (): +SVr4, 4.3BSD, POSIX.1-2001. + +.BR dup3 () +is Linux-specific. +.\" SVr4 documents additional +.\" EINTR and ENOLINK error conditions. POSIX.1 adds EINTR. +.\" The EBUSY return is Linux-specific. +.SH NOTES +The error returned by +.BR dup2 () +is different from that returned by +.BR fcntl( "..., " F_DUPFD ", ..." ) +when +.I newfd +is out of range. +On some systems +.BR dup2 () +also sometimes returns +.B EINVAL +like +.BR F_DUPFD . + +If +.I newfd +was open, any errors that would have been reported at +.BR close (2) +time are lost. +A careful programmer will not use +.BR dup2 () +or +.BR dup3 () +without closing +.I newfd +first. +.SH "SEE ALSO" +.BR close (2), +.BR fcntl (2), +.BR open (2) diff --git a/original/man2/dup2.2 b/original/man2/dup2.2 new file mode 100644 index 00000000..49a65c65 --- /dev/null +++ b/original/man2/dup2.2 @@ -0,0 +1 @@ +.so man2/dup.2 diff --git a/original/man2/dup3.2 b/original/man2/dup3.2 new file mode 100644 index 00000000..49a65c65 --- /dev/null +++ b/original/man2/dup3.2 @@ -0,0 +1 @@ +.so man2/dup.2 diff --git a/original/man2/epoll_create.2 b/original/man2/epoll_create.2 new file mode 100644 index 00000000..de085221 --- /dev/null +++ b/original/man2/epoll_create.2 @@ -0,0 +1,128 @@ +.\" +.\" 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() +.\" +.TH EPOLL_CREATE 2 2009-01-17 "Linux" "Linux Programmer's Manual" +.SH NAME +epoll_create, epoll_create1 \- open an epoll file descriptor +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int epoll_create(int " size ); +.BI "int epoll_create1(int " flags ); +.fi +.SH DESCRIPTION +.BR epoll_create () +creates an epoll "instance", +requesting the kernel to allocate an event backing store dimensioned for +.I size +descriptors. +The +.I size +is not the maximum size of the backing store but +just a hint to the kernel about how to dimension internal structures. +(Nowadays, +.I size +is ignored; see NOTES below.) + +.BR epoll_create () +returns a file descriptor referring to the new epoll instance. +This file descriptor is used for all the subsequent calls to the +.B epoll +interface. +When no longer required, the file descriptor returned by +.BR epoll_create () +should be closed by using +.BR close (2). +When all file descriptors referring to an epoll instance have been closed, +the kernel destroys the instance +and releases the associated resources for reuse. + +If +.I flags +is 0, then, other than the fact that the obsolete +.I size +argument is dropped, +.BR epoll_create1 () +is the same as +.BR epoll_create (). +The following value can be included in +.IR flags +to obtain different behavior: +.TP +.B EPOLL_CLOEXEC +Set the close-on-exec +.RB ( FD_CLOEXEC ) +flag on the new file descriptor. +See the description of the +.B O_CLOEXEC +flag in +.BR open (2) +for reasons why this may be useful. +.SH "RETURN VALUE" +On success, +these system calls +return a nonnegative file descriptor. +On error, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +.I size +is not positive. +.TP +.B EINVAL +.RB ( epoll_create1 ()) +Invalid value specified in +.IR flags . +.TP +.B EMFILE +The per-user limit on the number of epoll instances imposed by +.I /proc/sys/fs/epoll/max_user_instances +was encountered. +See +.BR epoll (7) +for further details. +.TP +.B ENFILE +The system limit on the total number of open files has been reached. +.TP +.B ENOMEM +There was insufficient memory to create the kernel object. +.SH CONFORMING TO +.BR epoll_create () +is Linux-specific, and was introduced in kernel 2.5.44. +.\" The interface should be finalized by Linux kernel 2.5.66. +.SH NOTES +Since Linux 2.6.8, the +.I size +argument is unused. +(The kernel dynamically sizes the required data structures +without needing this initial hint.) +.SH "SEE ALSO" +.BR close (2), +.BR epoll_ctl (2), +.BR epoll_wait (2), +.BR epoll (7) diff --git a/original/man2/epoll_create1.2 b/original/man2/epoll_create1.2 new file mode 100644 index 00000000..69605b6e --- /dev/null +++ b/original/man2/epoll_create1.2 @@ -0,0 +1 @@ +.so man2/epoll_create.2 diff --git a/original/man2/epoll_ctl.2 b/original/man2/epoll_ctl.2 new file mode 100644 index 00000000..94442092 --- /dev/null +++ b/original/man2/epoll_ctl.2 @@ -0,0 +1,251 @@ +.\" +.\" 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 +.\" +.TH EPOLL_CTL 2 2009-01-17 "Linux" "Linux Programmer's Manual" +.SH NAME +epoll_ctl \- control interface for an epoll descriptor +.SH SYNOPSIS +.B #include +.sp +.BI "int epoll_ctl(int " epfd ", int " op ", int " fd \ +", struct epoll_event *" event ); +.SH DESCRIPTION +This system call performs control operations on the epoll instance +referred to by the file descriptor +.IR epfd . +It requests that the operation +.I op +be performed for the target file descriptor, +.IR fd . + +Valid values for the +.I op +argument are : +.TP +.B EPOLL_CTL_ADD +Register the target file descriptor +.I fd +on the +.B epoll +instance referred to by the file descriptor +.I epfd +and associate the event +.I event +with the internal file linked to +.IR fd . +.TP +.B EPOLL_CTL_MOD +Change the event +.I event +associated with the target file descriptor +.IR fd . +.TP +.B EPOLL_CTL_DEL +Remove (deregister) the target file descriptor +.I fd +from the +.B epoll +instance referred to by +.IR epfd . +The +.I event +is ignored and can be NULL (but see BUGS below). +.PP +The +.I event +argument describes the object linked to the file descriptor +.IR fd . +The +.I struct epoll_event +is defined as : +.sp +.in +4n +.nf +typedef union epoll_data { + void *ptr; + int fd; + __uint32_t u32; + __uint64_t u64; +} epoll_data_t; + +struct epoll_event { + __uint32_t events; /* Epoll events */ + epoll_data_t data; /* User data variable */ +}; +.fi +.in + +The +.I events +member is a bit set composed using the following available event +types: +.TP +.B EPOLLIN +The associated file is available for +.BR read (2) +operations. +.TP +.B EPOLLOUT +The associated file is available for +.BR write (2) +operations. +.TP +.BR EPOLLRDHUP " (since Linux 2.6.17)" +Stream socket peer closed connection, +or shut down writing half of connection. +(This flag is especially useful for writing simple code to detect +peer shutdown when using Edge Triggered monitoring.) +.TP +.B EPOLLPRI +There is urgent data available for +.BR read (2) +operations. +.TP +.B EPOLLERR +Error condition happened on the associated file descriptor. +.BR epoll_wait (2) +will always wait for this event; it is not necessary to set it in +.IR events . +.TP +.B EPOLLHUP +Hang up happened on the associated file descriptor. +.BR epoll_wait (2) +will always wait for this event; it is not necessary to set it in +.IR events . +.TP +.B EPOLLET +Sets the Edge Triggered behavior for the associated file descriptor. +The default behavior for +.B epoll +is Level Triggered. +See +.BR epoll (7) +for more detailed information about Edge and Level Triggered event +distribution architectures. +.TP +.BR EPOLLONESHOT " (since Linux 2.6.2)" +Sets the one-shot behavior for the associated file descriptor. +This means that after an event is pulled out with +.BR epoll_wait (2) +the associated file descriptor is internally disabled and no other events +will be reported by the +.B epoll +interface. +The user must call +.BR epoll_ctl () +with +.B EPOLL_CTL_MOD +to rearm the file descriptor with a new event mask. +.SH "RETURN VALUE" +When successful, +.BR epoll_ctl () +returns zero. +When an error occurs, +.BR epoll_ctl () +returns \-1 and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +.I epfd +or +.I fd +is not a valid file descriptor. +.TP +.B EEXIST +.I op +was +.BR EPOLL_CTL_ADD , +and the supplied file descriptor +.I fd +is already registered with this epoll instance. +.TP +.B EINVAL +.I epfd +is not an +.B epoll +file descriptor, +or +.I fd +is the same as +.IR epfd , +or the requested operation +.I op +is not supported by this interface. +.TP +.B ENOENT +.I op +was +.B EPOLL_CTL_MOD +or +.BR EPOLL_CTL_DEL , +and +.I fd +is not registered with this epoll instance. +.TP +.B ENOMEM +There was insufficient memory to handle the requested +.I op +control operation. +.TP +.B ENOSPC +The limit imposed by +.I /proc/sys/fs/epoll/max_user_watches +was encountered while trying to register +.RB ( EPOLL_CTL_ADD ) +a new file descriptor on an epoll instance. +See +.BR epoll (7) +for further details. +.TP +.B EPERM +The target file +.I fd +does not support +.BR epoll . +.SH CONFORMING TO +.BR epoll_ctl () +is Linux-specific, and was introduced in kernel 2.5.44. +.\" The interface should be finalized by Linux kernel 2.5.66. +.SH NOTES +The +.B epoll +interface supports all file descriptors that support +.BR poll (2). +.SH BUGS +In kernel versions before 2.6.9, the +.B EPOLL_CTL_DEL +operation required a non-NULL pointer in +.IR event , +even though this argument is ignored. +Since Linux 2.6.9, +.I event +can be specified as NULL +when using +.BR EPOLL_CTL_DEL . +Applications that need to be portable to kernels before 2.6.9 +should specify a non-NULL pointer in +.IR event . +.SH "SEE ALSO" +.BR epoll_create (2), +.BR epoll_wait (2), +.BR poll (2), +.BR epoll (7) diff --git a/original/man2/epoll_pwait.2 b/original/man2/epoll_pwait.2 new file mode 100644 index 00000000..9282a706 --- /dev/null +++ b/original/man2/epoll_pwait.2 @@ -0,0 +1 @@ +.so man2/epoll_wait.2 diff --git a/original/man2/epoll_wait.2 b/original/man2/epoll_wait.2 new file mode 100644 index 00000000..2962ff42 --- /dev/null +++ b/original/man2/epoll_wait.2 @@ -0,0 +1,188 @@ +.\" +.\" 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() +.\" +.TH EPOLL_WAIT 2 2009-01-17 "Linux" "Linux Programmer's Manual" +.SH NAME +epoll_wait, epoll_pwait \- wait for an I/O event on an epoll file descriptor +.SH SYNOPSIS +.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 +.SH DESCRIPTION +The +.BR epoll_wait () +system call waits for events on the +.B epoll +instance referred to by the file descriptor +.IR epfd . +The memory area pointed to by +.I events +will contain the events that will be available for the caller. +Up to +.I maxevents +are returned by +.BR epoll_wait (). +The +.I maxevents +argument must be greater than zero. + +The call waits for a maximum time of +.I timeout +milliseconds. +Specifying a +.I timeout +of \-1 makes +.BR epoll_wait () +wait indefinitely, while specifying a +.I timeout +equal to zero makes +.BR epoll_wait () +to return immediately even if no events are available +(return code equal to zero). + +The +.I struct epoll_event +is defined as : +.sp +.in +4n +.nf +typedef union epoll_data { + void *ptr; + int fd; + uint32_t u32; + uint64_t u64; +} epoll_data_t; + +struct epoll_event { + uint32_t events; /* Epoll events */ + epoll_data_t data; /* User data variable */ +}; +.fi +.in + +The +.I data +of each returned structure will contain the same data the user set with an +.BR epoll_ctl (2) +.RB ( EPOLL_CTL_ADD , EPOLL_CTL_MOD ) +while the +.I events +member will contain the returned event bit field. +.SS epoll_pwait() +The relationship between +.BR epoll_wait () +and +.BR epoll_pwait () +is analogous to the relationship between +.BR select (2) +and +.BR pselect (2): +like +.BR pselect (2), +.BR epoll_pwait () +allows an application to safely wait until either a file descriptor +becomes ready or until a signal is caught. + +The following +.BR epoll_pwait () +call: +.nf + + ready = epoll_pwait(epfd, &events, maxevents, timeout, &sigmask); + +.fi +is equivalent to +.I atomically +executing the following calls: +.nf + + sigset_t origmask; + + sigprocmask(SIG_SETMASK, &sigmask, &origmask); + ready = epoll_wait(epfd, &events, maxevents, timeout); + sigprocmask(SIG_SETMASK, &origmask, NULL); +.fi +.PP +The +.I sigmask +argument may be specified as NULL, in which case +.BR epoll_pwait () +is equivalent to +.BR epoll_wait (). +.SH "RETURN VALUE" +When successful, +.BR epoll_wait () +returns the number of file descriptors ready for the requested I/O, or zero +if no file descriptor became ready during the requested +.I timeout +milliseconds. +When an error occurs, +.BR epoll_wait () +returns \-1 and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +.I epfd +is not a valid file descriptor. +.TP +.B EFAULT +The memory area pointed to by +.I events +is not accessible with write permissions. +.TP +.B EINTR +The call was interrupted by a signal handler before any of the +requested events occurred or the +.I timeout +expired; see +.BR signal (7). +.TP +.B EINVAL +.I epfd +is not an +.B epoll +file descriptor, or +.I maxevents +is less than or equal to zero. +.SH VERSIONS +.BR epoll_pwait () +was added to Linux in kernel 2.6.19. + +Glibc support for +.BR epoll_pwait () +is provided starting with version 2.6. +.SH CONFORMING TO +.BR epoll_wait () +is Linux-specific, and was introduced in kernel 2.5.44. +.\" The interface should be finalized by Linux kernel 2.5.66. +.SH "SEE ALSO" +.BR epoll_create (2), +.BR epoll_ctl (2), +.BR epoll (7) diff --git a/original/man2/eventfd.2 b/original/man2/eventfd.2 new file mode 100644 index 00000000..88ca50dd --- /dev/null +++ b/original/man2/eventfd.2 @@ -0,0 +1,398 @@ +.\" Copyright (C) 2008 Michael Kerrisk +.\" starting from a version by 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 +.\" +.\" 2008-10-10, mtk: describe eventfd2(), and EFD_NONBLOCK and EFD_CLOEXEC +.\" +.TH EVENTFD 2 2009-01-26 Linux "Linux Programmer's Manual" +.SH NAME +eventfd \- create a file descriptor for event notification +.SH SYNOPSIS +.B #include +.sp +.BI "int eventfd(unsigned int " initval ", int " flags ); +.SH DESCRIPTION +.BR eventfd () +creates an "eventfd object" that can be used as +an event wait/notify mechanism by userspace applications, +and by the kernel to notify userspace applications of events. +The object contains an unsigned 64-bit integer +.RI ( uint64_t ) +counter that is maintained by the kernel. +This counter is initialized with the value specified in the argument +.IR initval . + +Starting with Linux 2.6.27, the following values may be bitwise ORed in +.IR flags +to change the behaviour of +.BR eventfd (): +.TP 14 +.B EFD_NONBLOCK +Set the +.BR O_NONBLOCK +file status flag on the new open file description. +Using this flag saves extra calls to +.BR fcntl (2) +to achieve the same result. +.TP +.B EFD_CLOEXEC +Set the close-on-exec +.RB ( FD_CLOEXEC ) +flag on the new file descriptor. +See the description of the +.B O_CLOEXEC +flag in +.BR open (2) +for reasons why this may be useful. +.PP +In Linux up to version 2.6.26, the +.I flags +argument is unused, and must be specified as zero. + +As its return value, +.BR eventfd () +returns a new file descriptor that can be used to refer to the +eventfd object. +The following operations can be performed on the file descriptor: +.TP +.BR read (2) +If the eventfd counter has a nonzero value, then a +.BR read (2) +returns 8 bytes containing that value, +and the counter's value is reset to zero. +(The returned value is in host byte order, +i.e., the native byte order for integers on the host machine.) +.IP +If the counter is zero at the time of the +.BR read (2), +then the call either blocks until the counter becomes nonzero, +or fails with the error +.B EAGAIN +if the file descriptor has been made nonblocking. +.IP +A +.BR read (2) +will fail with the error +.B EINVAL +if the size of the supplied buffer is less than 8 bytes. +.TP +.BR write (2) +A +.BR write (2) +call adds the 8-byte integer value supplied in its +buffer to the counter. +The maximum value that may be stored in the counter is the largest +unsigned 64-bit value minus 1 (i.e., 0xfffffffffffffffe). +If the addition would cause the counter's value to exceed +the maximum, then the +.BR write (2) +either blocks until a +.BR read (2) +is performed on the file descriptor, +or fails with the error +.B EAGAIN +if the file descriptor has been made nonblocking. +.IP +A +.BR write (2) +will fail with the error +.B EINVAL +if the size of the supplied buffer is less than 8 bytes, +or if an attempt is made to write the value 0xffffffffffffffff. +.TP +.BR poll "(2), " select "(2) (and similar)" +The returned file descriptor supports +.BR poll (2) +(and analogously +.BR epoll (7)) +and +.BR select (2), +as follows: +.RS +.IP * 3 +The file descriptor is readable +(the +.BR select (2) +.I readfds +argument; the +.BR poll (2) +.B POLLIN +flag) +if the counter has a value greater than 0. +.IP * +The file descriptor is writable +(the +.BR select (2) +.I writefds +argument; the +.BR poll (2) +.B POLLOUT +flag) +if it is possible to write a value of at least "1" without blocking. +.IP * +If an overflow of the counter value was detected, +then +.BR select (2) +indicates the file descriptor as being both readable and writable, and +.BR poll (2) +returns a +.B POLLERR +event. +As noted above, +.BR write (2) +can never overflow the counter. +However an overflow can occur if 2^64 +eventfd "signal posts" were performed by the KAIO +subsystem (theoretically possible, but practically unlikely). +If an overflow has occurred, then +.BR read (2) +will return that maximum +.I uint64_t +value (i.e., 0xffffffffffffffff). +.RE +.IP +The eventfd file descriptor also supports the other file-descriptor +multiplexing APIs: +.BR pselect (2), +.BR ppoll (2), +and +.BR epoll (7). +.TP +.BR close (2) +When the file descriptor is no longer required it should be closed. +When all file descriptors associated with the same eventfd object +have been closed, the resources for object are freed by the kernel. +.PP +A copy of the file descriptor created by +.BR eventfd () +is inherited by the child produced by +.BR fork (2). +The duplicate file descriptor is associated with the same +eventfd object. +File descriptors created by +.BR eventfd () +are preserved across +.BR execve (2). +.SH "RETURN VALUE" +On success, +.BR eventfd () +returns a new eventfd file descriptor. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +.I flags +is invalid; +or, in Linux 2.6.26 or earlier, +.I flags +is nonzero. +.TP +.B EMFILE +The per-process limit on open file descriptors has been reached. +.TP +.B ENFILE +The system-wide limit on the total number of open files has been +reached. +.TP +.B ENODEV +.\" Note from Davide: +.\" The ENODEV error is basically never going to happen if +.\" the kernel boots correctly. That error happen only if during +.\" the kernel initialization, some error occur in the anonymous +.\" inode source initialization. +Could not mount (internal) anonymous inode device. +.TP +.B ENOMEM +There was insufficient memory to create a new +eventfd file descriptor. +.SH VERSIONS +.BR eventfd () +is available on Linux since kernel 2.6.22. +Working support is provided in glibc since version 2.8. +.\" eventfd() is in glibc 2.7, but reportedly does not build +The +.BR eventfd2 () +system call (see NOTES) is available on Linux since kernel 2.6.27. +Since version 2.9, the glibc +.BR eventfd () +wrapper will employ the +.BR eventfd2 () +system call, if it is supported by the kernel. +.SH CONFORMING TO +.BR eventfd () +and +.BR eventfd2 () +are Linux-specific. +.SH NOTES +Applications can use an eventfd file descriptor instead of a pipe (see +.BR pipe (2)) +in all cases where a pipe is used simply to signal events. +The kernel overhead of an eventfd file descriptor +is much lower than that of a pipe, +and only one file descriptor is +required (versus the two required for a pipe). + +When used in the kernel, an eventfd +file descriptor can provide a kernel-userspace bridge allowing, +for example, functionalities like KAIO (kernel AIO) +.\" or eventually syslets/threadlets +to signal to a file descriptor that some operation is complete. + +A key point about an eventfd file descriptor is that it can be +monitored just like any other file descriptor using +.BR select (2), +.BR poll (2), +or +.BR epoll (7). +This means that an application can simultaneously monitor the +readiness of "traditional" files and the readiness of other +kernel mechanisms that support the eventfd interface. +(Without the +.BR eventfd () +interface, these mechanisms could not be multiplexed via +.BR select (2), +.BR poll (2), +or +.BR epoll (7).) +.SS Underlying Linux system calls +There are two underlying Linux system calls: +.BR eventfd () +and the more recent +.BR eventfd2 (). +The former system call does not implement a +.I flags +argument. +The latter system call implements the +.I flags +values described above. +The glibc wrapper function will use +.BR eventfd2 () +where it is available. +.SS Additional glibc features +The GNU C library defines an additional type, +and two functions that attempt to abstract some of the details of +reading and writing on an eventfd file descriptor: +.in +4n +.nf + +typedef uint64_t eventfd_t; + +int eventfd_read(int fd, eventfd_t *value); +int eventfd_write(int fd, eventfd_t value); +.fi +.in + +The functions perform the read and write operations on an +eventfd file descriptor, +returning 0 if the correct number of bytes was transferred, +or \-1 otherwise. +.SH EXAMPLE +.PP +The following program creates an eventfd file descriptor +and then forks to create a child process. +While the parent briefly sleeps, +the child writes each of the integers supplied in the program's +command-line arguments to the eventfd file descriptor. +When the parent has finished sleeping, +it reads from the eventfd file descriptor. + +The following shell session shows a sample run of the program: +.in +4n +.nf + +.RB "$" " ./a.out 1 2 4 7 14" +Child writing 1 to efd +Child writing 2 to efd +Child writing 4 to efd +Child writing 7 to efd +Child writing 14 to efd +Child completed write loop +Parent about to read +Parent read 28 (0x1c) from efd +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include +#include +#include /* Definition of uint64_t */ + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int +main(int argc, char *argv[]) +{ + int efd, j; + uint64_t u; + ssize_t s; + + if (argc < 2) { + fprintf(stderr, "Usage: %s ...\\n", argv[0]); + exit(EXIT_FAILURE); + } + + efd = eventfd(0, 0); + if (efd == \-1) + handle_error("eventfd"); + + switch (fork()) { + case 0: + for (j = 1; j < argc; j++) { + printf("Child writing %s to efd\\n", argv[j]); + u = strtoull(argv[j], NULL, 0); + /* strtoull() allows various bases */ + s = write(efd, &u, sizeof(uint64_t)); + if (s != sizeof(uint64_t)) + handle_error("write"); + } + printf("Child completed write loop\\n"); + + exit(EXIT_SUCCESS); + + default: + sleep(2); + + printf("Parent about to read\\n"); + s = read(efd, &u, sizeof(uint64_t)); + if (s != sizeof(uint64_t)) + handle_error("read"); + printf("Parent read %llu (0x%llx) from efd\\n", + (unsigned long long) u, (unsigned long long) u); + exit(EXIT_SUCCESS); + + case \-1: + handle_error("fork"); + } +} +.fi +.SH "SEE ALSO" +.BR futex (2), +.BR pipe (2), +.BR poll (2), +.BR read (2), +.BR select (2), +.BR signalfd (2), +.BR timerfd_create (2), +.BR write (2), +.BR epoll (7), +.BR sem_overview (7) diff --git a/original/man2/eventfd2.2 b/original/man2/eventfd2.2 new file mode 100644 index 00000000..eddfaa8a --- /dev/null +++ b/original/man2/eventfd2.2 @@ -0,0 +1 @@ +.so man2/eventfd.2 diff --git a/original/man2/execve.2 b/original/man2/execve.2 new file mode 100644 index 00000000..272e3d99 --- /dev/null +++ b/original/man2/execve.2 @@ -0,0 +1,630 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 +.\" 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. +.\" +.\" Modified by Michael Haardt +.\" Modified 1993-07-21 by Rik Faith +.\" Modified 1994-08-21 by Michael Chastain : +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 1999-11-12 by Urs Thuermann +.\" Modified 2004-06-23 by Michael Kerrisk +.\" 2006-09-04 Michael Kerrisk +.\" Added list of process attributes that are not preserved on exec(). +.\" 2007-09-14 Ollie Wild , mtk +.\" Add text describing limits on command-line arguments + environment +.\" +.TH EXECVE 2 2010-01-06 "Linux" "Linux Programmer's Manual" +.SH NAME +execve \- execute program +.SH SYNOPSIS +.B #include +.sp +.BI "int execve(const char *" filename ", char *const " argv "[], " +.br +.BI " char *const " envp []); +.SH DESCRIPTION +.BR execve () +executes the program pointed to by \fIfilename\fP. +\fIfilename\fP must be either a binary executable, or a script +starting with a line of the form: + +.in +4n +.nf +\fB#!\fP \fIinterpreter \fP[optional-arg] +.fi +.in + +For details of the latter case, see "Interpreter scripts" below. + +\fIargv\fP is an array of argument strings passed to the new program. +\fIenvp\fP is an array of strings, conventionally of the form +\fBkey=value\fP, which are passed as environment to the new program. +Both \fIargv\fP and \fIenvp\fP must be terminated by a null pointer. +The argument vector and environment can be accessed by the +called program's main function, when it is defined as: + +.in +4n +.nf +int main(int argc, char *argv[], char *envp[]) +.fi +.in + +.BR execve () +does not return on success, and the text, data, bss, and +stack of the calling process are overwritten by that of the program +loaded. + +If the current program is being ptraced, a \fBSIGTRAP\fP is sent to it +after a successful +.BR execve (). + +If the set-user-ID bit is set on the program file pointed to by +\fIfilename\fP, +and the underlying file system is not mounted +.I nosuid +(the +.B MS_NOSUID +flag for +.BR mount (2)), +and the calling process is not being ptraced, +then the effective user ID of the calling process is changed +to that of the owner of the program file. +Similarly, when the set-group-ID +bit of the program file is set the effective group ID of the calling +process is set to the group of the program file. + +The effective user ID of the process is copied to the saved set-user-ID; +similarly, the effective group ID is copied to the saved set-group-ID. +This copying takes place after any effective ID changes that occur +because of the set-user-ID and set-group-ID permission bits. + +If the executable is an a.out dynamically linked +binary executable containing +shared-library stubs, the Linux dynamic linker +.BR ld.so (8) +is called at the start of execution to bring +needed shared libraries into memory +and link the executable with them. + +If the executable is a dynamically linked ELF executable, the +interpreter named in the PT_INTERP segment is used to load the needed +shared libraries. +This interpreter is typically +\fI/lib/ld-linux.so.1\fP for binaries linked with the +Linux libc 5, or \fI/lib/ld-linux.so.2\fP for binaries linked with the +glibc 2. + +All process attributes are preserved during an +.BR execve (), +except the following: +.IP * +The dispositions of any signals that are being caught are +reset to the default +.RB ( signal (7)). +.IP * +Any alternate signal stack is not preserved +.RB ( sigaltstack (2)). +.IP * +Memory mappings are not preserved +.RB ( mmap (2)). +.IP * +Attached System V shared memory segments are detached +.RB ( shmat (2)). +.IP * +POSIX shared memory regions are unmapped +.RB ( shm_open (3)). +.IP * +Open POSIX message queue descriptors are closed +.RB ( mq_overview (7)). +.IP * +Any open POSIX named semaphores are closed +.RB ( sem_overview (7)). +.IP * +POSIX timers are not preserved +.RB ( timer_create (2)). +.IP * +Any open directory streams are closed +.RB ( opendir (3)). +.IP * +Memory locks are not preserved +.RB ( mlock (2), +.BR mlockall (2)). +.IP * +Exit handlers are not preserved +.RB ( atexit (3), +.BR on_exit (3)). +.IP * +The floating-point environment is reset to the default (see +.BR fenv (3)). +.PP +The process attributes in the preceding list are all specified +in POSIX.1-2001. +The following Linux-specific process attributes are also +not preserved during an +.BR execve (): +.IP * 3 +The +.BR prctl (2) +.B PR_SET_DUMPABLE +flag is set, +unless a set-user-ID or set-group ID program is being executed, +in which case it is cleared. +.IP * +The +.BR prctl (2) +.B PR_SET_KEEPCAPS +flag is cleared. +.IP * +The process name, as set by +.BR prctl (2) +.B PR_SET_NAME +(and displayed by +.IR "ps\ \-o comm" ), +is reset to the name of the new executable file. +.IP * +The termination signal is reset to +.B SIGCHLD +(see +.BR clone (2)). +.PP +Note the following further points: +.IP * 3 +All threads other than the calling thread are destroyed during an +.BR execve (). +Mutexes, condition variables, and other pthreads objects are not preserved. +.IP * +The equivalent of \fIsetlocale(LC_ALL, "C")\fP +is executed at program start-up. +.IP * +POSIX.1-2001 specifies that the dispositions of any signals that +are ignored or set to the default are left unchanged. +POSIX.1-2001 specifies one exception: if +.B SIGCHLD +is being ignored, +then an implementation may leave the disposition unchanged or +reset it to the default; Linux does the former. +.IP * +Any outstanding asynchronous I/O operations are canceled +.RB ( aio_read (3), +.BR aio_write (3)). +.IP * +For the handling of capabilities during +.BR execve (), +see +.BR capabilities (7). +.IP * +By default, file descriptors remain open across an +.BR execve (). +File descriptors that are marked close-on-exec are closed; +see the description of +.B FD_CLOEXEC +in +.BR fcntl (2). +(If a file descriptor is closed, this will cause the release +of all record locks obtained on the underlying file by this process. +See +.BR fcntl (2) +for details.) +POSIX.1-2001 says that if file descriptors 0, 1, and 2 would +otherwise be closed after a successful +.BR execve (), +and the process would gain privilege because the set-user_ID or +set-group_ID permission bit was set on the executed file, +then the system may open an unspecified file for each of these +file descriptors. +As a general principle, no portable program, whether privileged or not, +can assume that these three file descriptors will remain +closed across an +.BR execve (). +.\" 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 +.SS Interpreter scripts +An interpreter script is a text file that has execute +permission enabled and whose first line is of the form: + +.in +4n +.nf +\fB#!\fP \fIinterpreter \fP[optional-arg] +.fi +.in + +The +.I interpreter +must be a valid pathname for an +executable which is not itself a script. +If the +.I filename +argument of +.BR execve () +specifies an interpreter script, then +.I interpreter +will be invoked with the following arguments: + +.in +4n +.nf +\fIinterpreter\fP [optional-arg] \fIfilename\fP arg... +.fi +.in + +where +.I arg... +is the series of words pointed to by the +.I argv +argument of +.BR execve (). + +For portable use, +.I optional-arg +should either be absent, or be specified as a single word (i.e., it +should not contain white space); see NOTES below. +.SS "Limits on size of arguments and environment" +Most Unix implementations impose some limit on the total size +of the command-line argument +.RI ( argv ) +and environment +.RI ( envp ) +strings that may be passed to a new program. +POSIX.1 allows an implementation to advertise this limit using the +.B ARG_MAX +constant (either defined in +.I +or available at run time using the call +.IR "sysconf(_SC_ARG_MAX)" ). + +On Linux prior to kernel 2.6.23, the memory used to store the +environment and argument strings was limited to 32 pages +(defined by the kernel constant +.BR MAX_ARG_PAGES ). +On architectures with a 4-kB page size, +this yields a maximum size of 128 kB. + +On kernel 2.6.23 and later, most architectures support a size limit +derived from the soft +.B RLIMIT_STACK +resource limit (see +.BR getrlimit (2)) +that is in force at the time of the +.BR execve () +call. +(Architectures with no memory management unit are excepted: +they maintain the limit that was in effect before kernel 2.6.23.) +This change allows programs to have a much larger +argument and/or environment list. +.\" 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. +For these architectures, the total size is limited to 1/4 of the allowed +stack size. +(Imposing the 1/4-limit +ensures that the new program always has some stack space.) +.\" Ollie: That doesn't include the lists of pointers, though, +.\" so the actual usage is a bit higher (1 pointer per argument). +Since Linux 2.6.25, +the kernel places a floor of 32 pages on this size limit, +so that, even when +.BR RLIMIT_STACK +is set very low, +applications are guaranteed to have at least as much argument and +environment space as was provided by Linux 2.6.23 and earlier. +(This guarantee was not provided in Linux 2.6.23 and 2.6.24.) +Additionally, the limit per string is 32 pages (the kernel constant +.BR MAX_ARG_STRLEN ), +and the maximum number of strings is 0x7FFFFFFF. +.SH "RETURN VALUE" +On success, +.BR execve () +does not return, on error \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B E2BIG +The total number of bytes in the environment +.RI ( envp ) +and argument list +.RI ( argv ) +is too large. +.TP +.B EACCES +Search permission is denied on a component of the path prefix of +.I filename +or the name of a script interpreter. +(See also +.BR path_resolution (7).) +.TP +.B EACCES +The file or a script interpreter is not a regular file. +.TP +.B EACCES +Execute permission is denied for the file or a script or ELF interpreter. +.TP +.B EACCES +The file system is mounted +.IR noexec . +.TP +.B EFAULT +.I filename +points outside your accessible address space. +.TP +.B EINVAL +An ELF executable had more than one PT_INTERP segment (i.e., tried to +name more than one interpreter). +.TP +.B EIO +An I/O error occurred. +.TP +.B EISDIR +An ELF interpreter was a directory. +.TP +.B ELIBBAD +An ELF interpreter was not in a recognized format. +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.I filename +or the name of a script or ELF interpreter. +.TP +.B EMFILE +The process has the maximum number of files open. +.TP +.B ENAMETOOLONG +.I filename +is too long. +.TP +.B ENFILE +The system limit on the total number of open files has been reached. +.TP +.B ENOENT +The file +.I filename +or a script or ELF interpreter does not exist, or a shared library +needed for file or interpreter cannot be found. +.TP +.B ENOEXEC +An executable is not in a recognized format, is for the wrong +architecture, or has some other format error that means it cannot be +executed. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOTDIR +A component of the path prefix of +.I filename +or a script or ELF interpreter is not a directory. +.TP +.B EPERM +The file system is mounted +.IR nosuid , +the user is not the superuser, +and the file has the set-user-ID or set-group-ID bit set. +.TP +.B EPERM +The process is being traced, the user is not the superuser and the +file has the set-user-ID or set-group-ID bit set. +.TP +.B ETXTBSY +Executable was open for writing by one or more processes. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +POSIX.1-2001 does not document the #! behavior +but is otherwise compatible. +.\" 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. +.SH NOTES +Set-user-ID and set-group-ID processes can not be +.BR ptrace (2)d. + +Linux ignores the set-user-ID and set-group-ID bits on scripts. + +The result of mounting a file system +.I nosuid +varies across Linux kernel versions: +some will refuse execution of set-user-ID and set-group-ID +executables when this would +give the user powers she did not have already (and return +.BR EPERM ), +some will just ignore the set-user-ID and set-group-ID bits and +.BR exec () +successfully. + +A maximum line length of 127 characters is allowed for the first line in +a #! executable shell script. + +The semantics of the +.I optional-arg +argument of an interpreter script vary across implementations. +On Linux, the entire string following the +.I interpreter +name is passed as a single argument to the interpreter, +and this string can include white space. +However, behavior differs on some other systems. +Some systems +.\" e.g., Solaris 8 +use the first white space to terminate +.IR optional-arg . +On some systems, +.\" e.g., FreeBSD before 6.0, but not FreeBSD 6.0 onwards +an interpreter script can have multiple arguments, +and white spaces in +.I optional-arg +are used to delimit the arguments. + +On Linux, +.I argv +can be specified as NULL, +which has the same effect as specifying this argument +as a pointer to a list containing a single NULL pointer. +.B "Do not take advantage of this misfeature!" +It is nonstandard and nonportable: +on most other Unix systems doing this will result in an error +.RB ( EFAULT ). +.\" 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). +.\" + +POSIX.1-2001 says that values returned by +.BR sysconf (3) +should be invariant over the lifetime of a process. +However, since Linux 2.6.23, if the +.BR RLIMIT_STACK +resource limit changes, then the value reported by +.B _SC_ARG_MAX +will also change, +to reflect the fact that the limit on space for holding +command-line arguments and environment variables has changed. +.\" +.\" .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 () +.\" 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. +.SS Historical +With Unix V6 the argument list of an +.BR exec () +call was ended by 0, +while the argument list of +.I main +was ended by \-1. +Thus, this argument list was not directly usable in a further +.BR exec () +call. +Since Unix V7 both are NULL. +.SH EXAMPLE +The following program is designed to be execed by the second program below. +It just echoes its command-line one per line. + +.in +4n +.nf +/* myecho.c */ + +#include +#include + +int +main(int argc, char *argv[]) +{ + int j; + + for (j = 0; j < argc; j++) + printf("argv[%d]: %s\\n", j, argv[j]); + + exit(EXIT_SUCCESS); +} +.fi +.in + +This program can be used to exec the program named in its command-line +argument: +.in +4n +.nf + +/* execve.c */ + +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + char *newargv[] = { NULL, "hello", "world", NULL }; + char *newenviron[] = { NULL }; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + newargv[0] = argv[1]; + + execve(argv[1], newargv, newenviron); + perror("execve"); /* execve() only returns on error */ + exit(EXIT_FAILURE); +} +.fi +.in + +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" +argv[0]: ./myecho +argv[1]: hello +argv[2]: world +.fi +.in + +We can also use these programs to demonstrate the use of a script +interpreter. +To do this we create a script whose "interpreter" is our +.I myecho +program: + +.in +4n +.nf +.RB "$" " cat > script.sh" +.B #! ./myecho script-arg +.B ^D +.RB "$" " chmod +x script.sh" +.fi +.in + +We can then use our program to exec the script: + +.in +4n +.nf +.RB "$" " ./execve ./script.sh" +argv[0]: ./myecho +argv[1]: script-arg +argv[2]: ./script.sh +argv[3]: hello +argv[4]: world +.fi +.in +.SH "SEE ALSO" +.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) diff --git a/original/man2/exit.2 b/original/man2/exit.2 new file mode 100644 index 00000000..9f9d2e76 --- /dev/null +++ b/original/man2/exit.2 @@ -0,0 +1 @@ +.so man2/_exit.2 diff --git a/original/man2/exit_group.2 b/original/man2/exit_group.2 new file mode 100644 index 00000000..1d1f4c9a --- /dev/null +++ b/original/man2/exit_group.2 @@ -0,0 +1,48 @@ +.\" Copyright (C) 2004 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. +.\" +.TH EXIT_GROUP 2 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH NAME +exit_group \- exit all threads in a process +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void exit_group(int " status ); +.fi +.SH DESCRIPTION +This system call is equivalent to +.BR exit (2) +except that it terminates not only the calling thread, but all threads +in the calling process's thread group. +.SH "RETURN VALUE" +This system call does not return. +.SH VERSIONS +This call is present since Linux 2.5.35. +.SH "CONFORMING TO" +This call is Linux-specific. +.SH NOTES +Since glibc 2.3, this is the system call invoked when the +.BR exit (2) +wrapper function is called. +.SH "SEE ALSO" +.BR exit (2) diff --git a/original/man2/faccessat.2 b/original/man2/faccessat.2 new file mode 100644 index 00000000..25fec2e9 --- /dev/null +++ b/original/man2/faccessat.2 @@ -0,0 +1,154 @@ +.\" 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. +.\" +.\" +.TH FACCESSAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +faccessat \- check user's permissions of a file relative to a \ +directory file descriptor +.SH SYNOPSIS +.nf +.B #include /* Definition of AT_* constants */ +.B #include +.sp +.BI "int faccessat(int " dirfd ", const char *" pathname ", int " \ +mode ", int " flags ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR faccessat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +The +.BR faccessat () +system call operates in exactly the same way as +.BR access (2), +except for the differences described in this manual page. + +If the pathname given in +.I pathname +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I dirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR access (2) +for a relative pathname). + +If +.I pathname +is relative and +.I dirfd +is the special value +.BR AT_FDCWD , +then +.I pathname +is interpreted relative to the current working +directory of the calling process (like +.BR access (2)). + +If +.I pathname +is absolute, then +.I dirfd +is ignored. + +.I flags +is constructed by ORing together zero or more of the following values: +.TP +.B AT_EACCESS +Perform access checks using the effective user and group IDs. +By default, +.BR faccessat () +uses the real IDs (like +.BR access (2)). +.TP +.B AT_SYMLINK_NOFOLLOW +If +.I pathname +is a symbolic link, do not dereference it: +instead return information about the link itself. +.SH "RETURN VALUE" +On success, (all requested permissions granted) +.BR faccessat () +returns 0. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR access (2) +can also occur for +.BR faccessat (). +The following additional errors can occur for +.BR faccessat (): +.TP +.B EBADF +.I dirfd +is not a valid file descriptor. +.TP +.B EINVAL +Invalid flag specified in +.IR flags . +.TP +.B ENOTDIR +.I pathname +is relative and +.I dirfd +is a file descriptor referring to a file other than a directory. +.SH VERSIONS +.BR faccessat () +was added to Linux in kernel 2.6.16. +.SH "CONFORMING TO" +POSIX.1-2008. +.SH NOTES +See +.BR openat (2) +for an explanation of the need for +.BR faccessat (). +.SS Glibc Notes +The +.B AT_EACCESS +and +.B AT_SYMLINK_NOFOLLOW +flags are actually implemented within the glibc wrapper function for +.BR faccessat (). +If either of these flags are specified, then the wrapper function employs +.BR fstatat (2) +to determine access permissions. +.SH "SEE ALSO" +.BR access (2), +.BR openat (2), +.BR euidaccess (3), +.BR credentials (7), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/fadvise64.2 b/original/man2/fadvise64.2 new file mode 100644 index 00000000..53f54a12 --- /dev/null +++ b/original/man2/fadvise64.2 @@ -0,0 +1 @@ +.so man2/posix_fadvise.2 diff --git a/original/man2/fadvise64_64.2 b/original/man2/fadvise64_64.2 new file mode 100644 index 00000000..53f54a12 --- /dev/null +++ b/original/man2/fadvise64_64.2 @@ -0,0 +1 @@ +.so man2/posix_fadvise.2 diff --git a/original/man2/fallocate.2 b/original/man2/fallocate.2 new file mode 100644 index 00000000..20172815 --- /dev/null +++ b/original/man2/fallocate.2 @@ -0,0 +1,136 @@ +.\" Copyright (c) 2007 Silicon Graphics, Inc. All Rights Reserved +.\" Written by Dave Chinner +.\" May be distributed as per GNU General Public License version 2. +.\" +.TH FALLOCATE 2 2009-03-13 "Linux" "Linux Programmer's Manual" +.SH NAME +fallocate \- manipulate file space +.SH SYNOPSIS +.nf +#define _GNU_SOURCE +.B #include + +.BI "int fallocate(int " fd ", int " mode ", off_t " offset \ +", off_t " len "); +.fi +.SH DESCRIPTION +This is a nonportable, Linux-specific system call. +For the portable, POSIX.1-specified method of ensuring that space +is allocated for a file, see +.BR posix_fallocate (). + +.BR fallocate () +allows the caller to directly manipulate the allocated disk space +for the file referred to by +.I fd +for the byte range starting at +.I offset +and continuing for +.I len +bytes. + +The +.I mode +argument determines the operation to be performed on the given range. +Currently only one flag is supported for +.IR mode : +.TP +.B FALLOC_FL_KEEP_SIZE +This flag allocates and initializes to zero the disk space +within the range specified by +.I offset +and +.IR len . +After a successful call, subsequent writes into this range +are guaranteed not to fail because of lack of disk space. +Preallocating zeroed blocks beyond the end of the file +is useful for optimizing append workloads. +Preallocating blocks does not change +the file size (as reported by +.BR stat (2)) +even if it is less than +.IR offset + len . +.\" +.\" 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 +If +.B FALLOC_FL_KEEP_SIZE +flag is not specified in +.IR mode , +the default behavior is almost same as when this flag is specified. +The only difference is that on success, +the file size will be changed if +.I "offset + len" +is greater than the file size. +This default behavior closely resembles the behavior of the +.BR posix_fallocate (3) +library function, +and is intended as a method of optimally implementing that function. +.PP +Because allocation is done in block size chunks, +.BR fallocate () +may allocate a larger range than that which was specified. +.SH RETURN VALUE +.BR fallocate () +returns zero on success, and -1 on failure. +.SH ERRORS +.TP +.B EBADF +.I fd +is not a valid file descriptor, or is not opened for writing. +.TP +.B EFBIG +.IR offset + len +exceeds the maximum file size. +.TP +.B EINTR +A signal was caught during execution. +.TP +.B EINVAL +.I offset +was less than 0, or +.I len +was less than or equal to 0. +.TP +.B EIO +An I/O error occurred while reading from or writing to a file system. +.TP +.B ENODEV +.I fd +does not refer to a regular file or a directory. +(If +.I fd +is a pipe or FIFO, a different error results.) +.TP +.B ENOSPC +There is not enough space left on the device containing the file +referred to by +.IR fd . +.TP +.B ENOSYS +The file system containing the file referred to by +.I fd +does not support this operation. +.TP +.B EOPNOTSUPP +The +.I mode +is not supported by the file system containing the file referred to by +.IR fd . +.SH VERSIONS +.BR fallocate () +is available on Linux since kernel 2.6.23. +Support is provided by glibc since version 2.10. +.SH CONFORMING TO +.BR fallocate () +is Linux-specific. +.SH SEE ALSO +.BR ftruncate (2), +.BR posix_fadvise (3), +.BR posix_fallocate (3) diff --git a/original/man2/fchdir.2 b/original/man2/fchdir.2 new file mode 100644 index 00000000..60b9685d --- /dev/null +++ b/original/man2/fchdir.2 @@ -0,0 +1 @@ +.so man2/chdir.2 diff --git a/original/man2/fchmod.2 b/original/man2/fchmod.2 new file mode 100644 index 00000000..92647d2e --- /dev/null +++ b/original/man2/fchmod.2 @@ -0,0 +1 @@ +.so man2/chmod.2 diff --git a/original/man2/fchmodat.2 b/original/man2/fchmodat.2 new file mode 100644 index 00000000..497c8c15 --- /dev/null +++ b/original/man2/fchmodat.2 @@ -0,0 +1,142 @@ +.\" 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. +.\" +.\" +.TH FCHMODAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +fchmodat \- change permissions of a file relative to a directory \ +file descriptor +.SH SYNOPSIS +.nf +.B #include /* Definition of AT_* constants */ +.B #include +.sp +.BI "int fchmodat(int " dirfd ", const char *" pathname ", mode_t " \ +mode ", int " flags ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR fchmodat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +The +.BR fchmodat () +system call operates in exactly the same way as +.BR chmod (2), +except for the differences described in this manual page. + +If the pathname given in +.I pathname +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I dirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR chmod (2) +for a relative pathname). + +If +.I pathname +is relative and +.I dirfd +is the special value +.BR AT_FDCWD , +then +.I pathname +is interpreted relative to the current working +directory of the calling process (like +.BR chmod (2)). + +If +.I pathname +is absolute, then +.I dirfd +is ignored. + +.I flags +can either be 0, or include the following flag: +.TP +.B AT_SYMLINK_NOFOLLOW +If +.I pathname +is a symbolic link, do not dereference it: +instead operate on the link itself. +This flag is not currently implemented. +.SH "RETURN VALUE" +On success, +.BR fchmodat () +returns 0. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR chmod (2) +can also occur for +.BR fchmodat (). +The following additional errors can occur for +.BR fchmodat (): +.TP +.B EBADF +.I dirfd +is not a valid file descriptor. +.TP +.B EINVAL +Invalid flag specified in +.IR flags . +.TP +.B ENOTDIR +.I pathname +is relative and +.I dirfd +is a file descriptor referring to a file other than a directory. +.TP +.B ENOTSUP +.I flags +specified +.BR AT_SYMLINK_NOFOLLOW , +which is not supported. +.SH VERSIONS +.BR fchmodat () +was added to Linux in kernel 2.6.16. +.SH "CONFORMING TO" +POSIX.1-2008. +.SH NOTES +See +.BR openat (2) +for an explanation of the need for +.BR fchmodat (). +.SH "SEE ALSO" +.BR chmod (2), +.BR openat (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/fchown.2 b/original/man2/fchown.2 new file mode 100644 index 00000000..f0a5635a --- /dev/null +++ b/original/man2/fchown.2 @@ -0,0 +1 @@ +.so man2/chown.2 diff --git a/original/man2/fchown32.2 b/original/man2/fchown32.2 new file mode 100644 index 00000000..b8b9452b --- /dev/null +++ b/original/man2/fchown32.2 @@ -0,0 +1 @@ +.so man2/fchown.2 diff --git a/original/man2/fchownat.2 b/original/man2/fchownat.2 new file mode 100644 index 00000000..14ba6461 --- /dev/null +++ b/original/man2/fchownat.2 @@ -0,0 +1,141 @@ +.\" 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. +.\" +.\" +.TH FCHOWNAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +fchownat \- change ownership of a file relative to a directory \ +file descriptor +.SH SYNOPSIS +.nf +.B #include /* Definition of AT_* constants */ +.B #include +.sp +.BI "int fchownat(int " dirfd ", const char *" pathname , +.BI " uid_t " owner ", gid_t " group ", int " flags ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR fchownat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +The +.BR fchownat () +system call operates in exactly the same way as +.BR chown (2), +except for the differences described in this manual page. + +If the pathname given in +.I pathname +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I dirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR chown (2) +for a relative pathname). + +If +.I pathname +is relative and +.I dirfd +is the special value +.BR AT_FDCWD , +then +.I pathname +is interpreted relative to the current working +directory of the calling process (like +.BR chown (2)). + +If +.I pathname +is absolute, then +.I dirfd +is ignored. + +.I flags +can either be 0, or include the following flag: +.TP +.B AT_SYMLINK_NOFOLLOW +If +.I pathname +is a symbolic link, do not dereference it: +instead operate on the link itself, like +.BR lchown (2). +(By default, +.BR fchownat () +dereferences symbolic links, like +.BR chown (2).) +.SH "RETURN VALUE" +On success, +.BR fchownat () +returns 0. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR chown (2) +can also occur for +.BR fchownat (). +The following additional errors can occur for +.BR fchownat (): +.TP +.B EBADF +.I dirfd +is not a valid file descriptor. +.TP +.B EINVAL +Invalid flag specified in +.IR flags . +.TP +.B ENOTDIR +.I pathname +is relative and +.I dirfd +is a file descriptor referring to a file other than a directory. +.SH VERSIONS +.BR fchownat () +was added to Linux in kernel 2.6.16. +.SH "CONFORMING TO" +POSIX.1-2008. +A similar system call exists on Solaris. +.SH NOTES +See +.BR openat (2) +for an explanation of the need for +.BR fchownat (). +.SH "SEE ALSO" +.BR chown (2), +.BR openat (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/fcntl.2 b/original/man2/fcntl.2 new file mode 100644 index 00000000..c51b705c --- /dev/null +++ b/original/man2/fcntl.2 @@ -0,0 +1,1223 @@ +'\" 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 +.\" +.TH FCNTL 2 2009-10-17 "Linux" "Linux Programmer's Manual" +.SH NAME +fcntl \- manipulate file descriptor +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "int fcntl(int " fd ", int " cmd ", ... /* " arg " */ );" +.fi +.SH DESCRIPTION +.BR fcntl () +performs one of the operations described below on the open file descriptor +.IR fd . +The operation is determined by +.IR cmd . + +.BR fcntl () +can take an optional third argument. +Whether or not this argument is required is determined by +.IR cmd . +The required argument type is indicated in parentheses after each +.I cmd +name (in most cases, the required type is +.IR long , +and we identify the argument using the name +.IR arg ), +or +.I void +is specified if the argument is not required. +.SS "Duplicating a file descriptor" +.TP +.BR F_DUPFD " (\fIlong\fP)" +Find the lowest numbered available file descriptor +greater than or equal to +.I arg +and make it be a copy of +.IR fd . +This is different from +.BR dup2 (2), +which uses exactly the descriptor specified. +.IP +On success, the new descriptor is returned. +.IP +See +.BR dup (2) +for further details. +.TP +.BR F_DUPFD_CLOEXEC " (\fIlong\fP; since Linux 2.6.24)" +As for +.BR F_DUPFD , +but additionally set the +close-on-exec flag for the duplicate descriptor. +Specifying this flag permits a program to avoid an additional +.BR fcntl () +.B F_SETFD +operation to set the +.B FD_CLOEXEC +flag. +For an explanation of why this flag is useful, +see the description of +.B O_CLOEXEC +in +.BR open (2). +.SS "File descriptor flags" +The following commands manipulate the flags associated with +a file descriptor. +Currently, only one such flag is defined: +.BR FD_CLOEXEC , +the close-on-exec flag. +If the +.B FD_CLOEXEC +bit is 0, the file descriptor will remain open across an +.BR execve (2), +otherwise it will be closed. +.TP +.BR F_GETFD " (\fIvoid\fP)" +Read the file descriptor flags; +.I arg +is ignored. +.TP +.BR F_SETFD " (\fIlong\fP)" +Set the file descriptor flags to the value specified by +.IR arg . +.SS "File status flags" +Each open file description has certain associated status flags, +initialized by +.BR open (2) +.\" or +.\" .BR creat (2), +and possibly modified by +.BR fcntl (). +Duplicated file descriptors +(made with +.BR dup (2), +.BR fcntl (F_DUPFD), +.BR fork (2), +etc.) refer to the same open file description, and thus +share the same file status flags. + +The file status flags and their semantics are described in +.BR open (2). +.TP +.BR F_GETFL " (\fIvoid\fP)" +Read the file status flags; +.I arg +is ignored. +.TP +.BR F_SETFL " (\fIlong\fP)" +Set the file status flags to the value specified by +.IR arg . +File access mode +.RB ( O_RDONLY ", " O_WRONLY ", " O_RDWR ) +and file creation flags +(i.e., +.BR O_CREAT ", " O_EXCL ", " O_NOCTTY ", " O_TRUNC ) +in +.I arg +are ignored. +On Linux this command can only change the +.BR O_APPEND , +.BR O_ASYNC , +.BR O_DIRECT , +.BR O_NOATIME , +and +.B O_NONBLOCK +flags. +.\" FIXME . According to POSIX.1-2001, O_SYNC should also be modifiable +.\" via fcntl(2), but currently Linux does not permit this +.\" See http://bugzilla.kernel.org/show_bug.cgi?id=5994 +.SS "Advisory locking" +.BR F_GETLK ", " F_SETLK " and " F_SETLKW +are used to acquire, release, and test for the existence of record +locks (also known as file-segment or file-region locks). +The third argument, +.IR lock , +is a pointer to a structure that has at least the following fields +(in unspecified order). +.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 +The +.IR l_whence ", " l_start ", and " l_len +fields of this structure specify the range of bytes we wish to lock. +Bytes past the end of the file may be locked, +but not bytes before the start of the file. + +.I l_start +is the starting offset for the lock, and is interpreted +relative to either: +the start of the file (if +.I l_whence +is +.BR SEEK_SET ); +the current file offset (if +.I l_whence +is +.BR SEEK_CUR ); +or the end of the file (if +.I l_whence +is +.BR SEEK_END ). +In the final two cases, +.I l_start +can be a negative number provided the +offset does not lie before the start of the file. + +.I l_len +specifies the number of bytes to be locked. +If +.I l_len +is positive, then the range to be locked covers bytes +.I l_start +up to and including +.IR l_start + l_len \- 1 . +Specifying 0 for +.I l_len +has the special meaning: lock all bytes starting at the +location specified by +.IR l_whence " and " l_start +through to the end of file, no matter how large the file grows. + +POSIX.1-2001 allows (but does not require) +an implementation to support a negative +.I l_len +value; if +.I l_len +is negative, the interval described by +.I lock +covers bytes +.IR l_start + l_len +up to and including +.IR l_start \-1. +This is supported by Linux since kernel versions 2.4.21 and 2.5.49. + +The +.I l_type +field can be used to place a read +.RB ( F_RDLCK ) +or a write +.RB ( F_WRLCK ) +lock on a file. +Any number of processes may hold a read lock (shared lock) +on a file region, but only one process may hold a write lock +(exclusive lock). +An exclusive lock excludes all other locks, +both shared and exclusive. +A single process can hold only one type of lock on a file region; +if a new lock is applied to an already-locked region, +then the existing lock is converted to the new lock type. +(Such conversions may involve splitting, shrinking, or coalescing with +an existing lock if the byte range specified by the new lock does not +precisely coincide with the range of the existing lock.) +.TP +.BR F_SETLK " (\fIstruct flock *\fP)" +Acquire a lock (when +.I l_type +is +.B F_RDLCK +or +.BR F_WRLCK ) +or release a lock (when +.I l_type +is +.BR F_UNLCK ) +on the bytes specified by the +.IR l_whence ", " l_start ", and " l_len +fields of +.IR lock . +If a conflicting lock is held by another process, +this call returns \-1 and sets +.I errno +to +.B EACCES +or +.BR EAGAIN . +.TP +.BR F_SETLKW " (\fIstruct flock *\fP)" +As for +.BR F_SETLK , +but if a conflicting lock is held on the file, then wait for that +lock to be released. +If a signal is caught while waiting, then the call is interrupted +and (after the signal handler has returned) +returns immediately (with return value \-1 and +.I errno +set to +.BR EINTR ; +see +.BR signal (7)). +.TP +.BR F_GETLK " (\fIstruct flock *\fP)" +On input to this call, +.I lock +describes a lock we would like to place on the file. +If the lock could be placed, +.BR fcntl () +does not actually place it, but returns +.B F_UNLCK +in the +.I l_type +field of +.I lock +and leaves the other fields of the structure unchanged. +If one or more incompatible locks would prevent +this lock being placed, then +.BR fcntl () +returns details about one of these locks in the +.IR l_type ", " l_whence ", " l_start ", and " l_len +fields of +.I lock +and sets +.I l_pid +to be the PID of the process holding that lock. +.P +In order to place a read lock, +.I fd +must be open for reading. +In order to place a write lock, +.I fd +must be open for writing. +To place both types of lock, open a file read-write. +.P +As well as being removed by an explicit +.BR F_UNLCK , +record locks are automatically released when the process +terminates or if it closes +.I any +file descriptor referring to a file on which locks are held. +.\" (Additional file descriptors referring to the same file +.\" may have been obtained by calls to +.\" .BR open "(2), " dup "(2), " dup2 "(2), or " fcntl ().) +This is bad: it means that a process can lose the locks on +a file like +.I /etc/passwd +or +.I /etc/mtab +when for some reason a library function decides to open, read +and close it. +.P +Record locks are not inherited by a child created via +.BR fork (2), +but are preserved across an +.BR execve (2). +.P +Because of the buffering performed by the +.BR stdio (3) +library, the use of record locking with routines in that package +should be avoided; use +.BR read (2) +and +.BR write (2) +instead. +.SS "Mandatory locking" +(Non-POSIX.) +The above record locks may be either advisory or mandatory, +and are advisory by default. + +Advisory locks are not enforced and are useful only between +cooperating processes. + +Mandatory locks are enforced for all processes. +If a process tries to perform an incompatible access (e.g., +.BR read (2) +or +.BR write (2)) +on a file region that has an incompatible mandatory lock, +then the result depends upon whether the +.B O_NONBLOCK +flag is enabled for its open file description. +If the +.B O_NONBLOCK +flag is not enabled, then +system call is blocked until the lock is removed +or converted to a mode that is compatible with the access. +If the +.B O_NONBLOCK +flag is enabled, then the system call fails with the error +.BR EAGAIN . + +To make use of mandatory locks, mandatory locking must be enabled +both on the file system that contains the file to be locked, +and on the file itself. +Mandatory locking is enabled on a file system +using the "\-o mand" option to +.BR mount (8), +or the +.B MS_MANDLOCK +flag for +.BR mount (2). +Mandatory locking is enabled on a file by disabling +group execute permission on the file and enabling the set-group-ID +permission bit (see +.BR chmod (1) +and +.BR chmod (2)). + +The Linux implementation of mandatory locking is unreliable. +See BUGS below. +.SS "Managing signals" +.BR F_GETOWN , +.BR F_SETOWN , +.BR F_GETOWN_EX , +.BR F_SETOWN_EX , +.BR F_GETSIG +and +.B F_SETSIG +are used to manage I/O availability signals: +.TP +.BR F_GETOWN " (\fIvoid\fP)" +Return (as the function result) +the process ID or process group currently receiving +.B SIGIO +and +.B SIGURG +signals for events on file descriptor +.IR fd . +Process IDs are returned as positive values; +process group IDs are returned as negative values (but see BUGS below). +.I arg +is ignored. +.TP +.BR F_SETOWN " (\fIlong\fP)" +Set the process ID or process group ID that will receive +.B SIGIO +and +.B SIGURG +signals for events on file descriptor +.IR fd +to the ID given in +.IR arg . +A process ID is specified as a positive value; +a process group ID is specified as a negative value. +Most commonly, the calling process specifies itself as the owner +(that is, +.I arg +is specified as +.BR getpid (2)). + +.\" From glibc.info: +If you set the +.B O_ASYNC +status flag on a file descriptor by using the +.B F_SETFL +command of +.BR fcntl (), +a +.B SIGIO +signal is sent whenever input or output becomes possible +on that file descriptor. +.B F_SETSIG +can be used to obtain delivery of a signal other than +.BR SIGIO . +If this permission check fails, then the signal is +silently discarded. + +Sending a signal to the owner process (group) specified by +.B F_SETOWN +is subject to the same permissions checks as are described for +.BR kill (2), +where the sending process is the one that employs +.B F_SETOWN +(but see BUGS below). + +If the file descriptor +.I fd +refers to a socket, +.B F_SETOWN +also selects +the recipient of +.B SIGURG +signals that are delivered when out-of-band +data arrives on that socket. +.RB ( SIGURG +is sent in any situation where +.BR select (2) +would report the socket as having an "exceptional condition".) +.\" The following appears to be rubbish. It doesn't seem to +.\" be true according to the kernel source, and I can write +.\" a program that gets a terminal-generated SIGIO even though +.\" it is not the foreground process group of the terminal. +.\" -- MTK, 8 Apr 05 +.\" +.\" If the file descriptor +.\" .I fd +.\" refers to a terminal device, then SIGIO +.\" signals are sent to the foreground process group of the terminal. + +The following was true in 2.6.x kernels up to and including +kernel 2.6.11: +.RS +.IP +If a nonzero value is given to +.B F_SETSIG +in a multithreaded process running with a threading library +that supports thread groups (e.g., NPTL), +then a positive value given to +.B F_SETOWN +has a different meaning: +.\" The relevant place in the (2.6) kernel source is the +.\" 'switch' in fs/fcntl.c::send_sigio_to_task() -- MTK, Apr 2005 +instead of being a process ID identifying a whole process, +it is a thread ID identifying a specific thread within a process. +Consequently, it may be necessary to pass +.B F_SETOWN +the result of +.BR gettid (2) +instead of +.BR getpid (2) +to get sensible results when +.B F_SETSIG +is used. +(In current Linux threading implementations, +a main thread's thread ID is the same as its process ID. +This means that a single-threaded program can equally use +.BR gettid (2) +or +.BR getpid (2) +in this scenario.) +Note, however, that the statements in this paragraph do not apply +to the +.B SIGURG +signal generated for out-of-band data on a socket: +this signal is always sent to either a process or a process group, +depending on the value given to +.BR 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 +The above behavior was accidentally dropped in Linux 2.6.12, +and won't be restored. +From Linux 2.6.32 onwards, use +.BR F_SETOWN_EX +to target +.B SIGIO +and +.B SIGURG +signals at a particular thread. +.TP +.BR F_GETOWN_EX " (struct f_owner_ex *) (since Linux 2.6.32)" +Return the current file descriptor owner settings +as defined by a previous +.BR F_SETOWN_EX +operation. +The information is returned in the structure pointed to by +.IR arg , +which has the following form: +.nf +.in +4n + +struct f_owner_ex { + int type; + pid_t pid; +}; + +.in +.fi +The +.I type +field will have one of the values +.BR F_OWNER_TID , +.BR F_OWNER_PID , +or +.BR F_OWNER_PGRP . +The +.I pid +field is a positive integer representing a thread ID, process ID, +or process group ID. +See +.B F_SETOWN_EX +for more details. +.TP +.BR F_SETOWN_EX " (struct f_owner_ex *) (since Linux 2.6.32)" +This operation performs a similar task to +.BR F_SETOWN . +It allows the caller to direct I/O availability signals +to a specific thread, process, or process group. +The caller specifies the target of signals via +.IR arg , +which is a pointer to a +.IR f_owner_ex +structure. +The +.I type +field has one of the following values, which define how +.I pid +is interpreted: +.RS +.TP +.BR F_OWNER_TID +Send the signal to the thread whose thread ID +(the value returned by a call to +.BR clone (2) +or +.BR gettid (2)) +is specified in +.IR pid . +.TP +.BR F_OWNER_PID +Send the signal to the process whose ID +is specified in +.IR pid . +.TP +.BR F_OWNER_PGRP +Send the signal to the process group whose ID +is specified in +.IR pid . +(Note that, unlike with +.BR F_SETOWN , +a process group ID is specified as a positive value here.) +.RE +.TP +.BR F_GETSIG " (\fIvoid\fP)" +Return (as the function result) +the signal sent when input or output becomes possible. +A value of zero means +.B SIGIO +is sent. +Any other value (including +.BR SIGIO ) +is the +signal sent instead, and in this case additional info is available to +the signal handler if installed with +.BR SA_SIGINFO . +.I arg +is ignored. +.TP +.BR F_SETSIG " (\fIlong\fP)" +Set the signal sent when input or output becomes possible +to the value given in +.IR arg . +A value of zero means to send the default +.B SIGIO +signal. +Any other value (including +.BR SIGIO ) +is the signal to send instead, and in this case additional info +is available to the signal handler if installed with +.BR SA_SIGINFO . +.\" +.\" The following was true only up until 2.6.11: +.\" +.\" Additionally, passing a nonzero value to +.\" .B F_SETSIG +.\" changes the signal recipient from a whole process to a specific thread +.\" within a process. +.\" See the description of +.\" .B F_SETOWN +.\" for more details. + +By using +.B F_SETSIG +with a nonzero value, and setting +.B SA_SIGINFO +for the +signal handler (see +.BR sigaction (2)), +extra information about I/O events is passed to +the handler in a +.I siginfo_t +structure. +If the +.I si_code +field indicates the source is +.BR SI_SIGIO , +the +.I si_fd +field gives the file descriptor associated with the event. +Otherwise, +there is no indication which file descriptors are pending, and you +should use the usual mechanisms +.RB ( select (2), +.BR poll (2), +.BR read (2) +with +.B O_NONBLOCK +set etc.) to determine which file descriptors are available for I/O. + +By selecting a real time signal (value >= +.BR SIGRTMIN ), +multiple I/O events may be queued using the same signal numbers. +(Queuing is dependent on available memory). +Extra information is available +if +.B SA_SIGINFO +is set for the signal handler, as above. + +Note that Linux imposes a limit on the +number of real-time signals that may be queued to a +process (see +.BR getrlimit (2) +and +.BR signal (7)) +and if this limit is reached, then the kernel reverts to +delivering +.BR SIGIO , +and this signal is delivered to the entire +process rather than to a specific thread. +.\" See fs/fcntl.c::send_sigio_to_task() (2.4/2.6) sources -- MTK, Apr 05 +.PP +Using these mechanisms, a program can implement fully asynchronous I/O +without using +.BR select (2) +or +.BR poll (2) +most of the time. +.PP +The use of +.BR O_ASYNC , +.BR F_GETOWN , +.B F_SETOWN +is specific to BSD and Linux. +.BR F_GETOWN_EX , +.BR F_SETOWN_EX , +.BR F_GETSIG , +and +.B F_SETSIG +are Linux-specific. +POSIX has asynchronous I/O and the +.I aio_sigevent +structure to achieve similar things; these are also available +in Linux as part of the GNU C Library (Glibc). +.SS Leases +.B F_SETLEASE +and +.B F_GETLEASE +(Linux 2.4 onwards) are used (respectively) to establish a new lease, +and retrieve the current lease, on the open file description +referred to by the file descriptor +.IR fd . +A file lease provides a mechanism whereby the process holding +the lease (the "lease holder") is notified (via delivery of a signal) +when a process (the "lease breaker") tries to +.BR open (2) +or +.BR truncate (2) +the file referred to by that file descriptor. +.TP +.BR F_SETLEASE " (\fIlong\fP)" +Set or remove a file lease according to which of the following +values is specified in the integer +.IR arg : +.RS +.TP +.B F_RDLCK +Take out a read lease. +This will cause the calling process to be notified when +the file is opened for writing or is truncated. +.\" The following became true in kernel 2.6.10: +.\" See the man-pages-2.09 Changelog for further info. +A read lease can only be placed on a file descriptor that +is opened read-only. +.TP +.B F_WRLCK +Take out a write lease. +This will cause the caller to be notified when +the file is opened for reading or writing or is truncated. +A write lease may be placed on a file only if there are no +other open file descriptors for the file. +.TP +.B F_UNLCK +Remove our lease from the file. +.RE +.P +Leases are associated with an open file description (see +.BR open (2)). +This means that duplicate file descriptors (created by, for example, +.BR fork (2) +or +.BR dup (2)) +refer to the same lease, and this lease may be modified +or released using any of these descriptors. +Furthermore, the lease is released by either an explicit +.B F_UNLCK +operation on any of these duplicate descriptors, or when all +such descriptors have been closed. +.P +Leases may only be taken out on regular files. +An unprivileged process may only take out a lease on a file whose +UID (owner) matches the file system UID of the process. +A process with the +.B CAP_LEASE +capability may take out leases on arbitrary files. +.TP +.BR F_GETLEASE " (\fIvoid\fP)" +Indicates what type of lease is associated with the file descriptor +.I fd +by returning either +.BR F_RDLCK ", " F_WRLCK ", or " F_UNLCK , +indicating, respectively, a read lease , a write lease, or no lease. +.I arg +is ignored. +.PP +When a process (the "lease breaker") performs an +.BR open (2) +or +.BR truncate (2) +that conflicts with a lease established via +.BR F_SETLEASE , +the system call is blocked by the kernel and +the kernel notifies the lease holder by sending it a signal +.RB ( SIGIO +by default). +The lease holder should respond to receipt of this signal by doing +whatever cleanup is required in preparation for the file to be +accessed by another process (e.g., flushing cached buffers) and +then either remove or downgrade its lease. +A lease is removed by performing an +.B F_SETLEASE +command specifying +.I arg +as +.BR F_UNLCK . +If the lease holder currently holds a write lease on the file, +and the lease breaker is opening the file for reading, +then it is sufficient for the lease holder to downgrade +the lease to a read lease. +This is done by performing an +.B F_SETLEASE +command specifying +.I arg +as +.BR F_RDLCK . + +If the lease holder fails to downgrade or remove the lease within +the number of seconds specified in +.I /proc/sys/fs/lease-break-time +then the kernel forcibly removes or downgrades the lease holder's lease. + +Once the lease has been voluntarily or forcibly removed or downgraded, +and assuming the lease breaker has not unblocked its system call, +the kernel permits the lease breaker's system call to proceed. + +If the lease breaker's blocked +.BR open (2) +or +.BR truncate (2) +is interrupted by a signal handler, +then the system call fails with the error +.BR EINTR , +but the other steps still occur as described above. +If the lease breaker is killed by a signal while blocked in +.BR open (2) +or +.BR truncate (2), +then the other steps still occur as described above. +If the lease breaker specifies the +.B O_NONBLOCK +flag when calling +.BR open (2), +then the call immediately fails with the error +.BR EWOULDBLOCK , +but the other steps still occur as described above. + +The default signal used to notify the lease holder is +.BR SIGIO , +but this can be changed using the +.B F_SETSIG +command to +.BR fcntl (). +If a +.B F_SETSIG +command is performed (even one specifying +.BR SIGIO ), +and the signal +handler is established using +.BR SA_SIGINFO , +then the handler will receive a +.I siginfo_t +structure as its second argument, and the +.I si_fd +field of this argument will hold the descriptor of the leased file +that has been accessed by another process. +(This is useful if the caller holds leases against multiple files). +.SS "File and directory change notification (dnotify)" +.TP +.BR F_NOTIFY " (\fIlong\fP)" +(Linux 2.4 onwards) +Provide notification when the directory referred to by +.I fd +or any of the files that it contains is changed. +The events to be notified are specified in +.IR arg , +which is a bit mask specified by ORing together zero or more of +the following bits: +.RS +.sp +.PD 0 +.TP 12 +.B DN_ACCESS +A file was accessed (read, pread, readv) +.TP +.B DN_MODIFY +A file was modified (write, pwrite, writev, truncate, ftruncate). +.TP +.B DN_CREATE +A file was created (open, creat, mknod, mkdir, link, symlink, rename). +.TP +.B DN_DELETE +A file was unlinked (unlink, rename to another directory, rmdir). +.TP +.B DN_RENAME +A file was renamed within this directory (rename). +.TP +.B DN_ATTRIB +The attributes of a file were changed (chown, chmod, utime[s]). +.PD +.RE +.IP +(In order to obtain these definitions, the +.B _GNU_SOURCE +feature test macro must be defined.) + +Directory notifications are normally "one-shot", and the application +must reregister to receive further notifications. +Alternatively, if +.B DN_MULTISHOT +is included in +.IR arg , +then notification will remain in effect until explicitly removed. + +.\" The following does seem a poor API-design choice... +A series of +.B F_NOTIFY +requests is cumulative, with the events in +.I arg +being added to the set already monitored. +To disable notification of all events, make an +.B F_NOTIFY +call specifying +.I arg +as 0. + +Notification occurs via delivery of a signal. +The default signal is +.BR SIGIO , +but this can be changed using the +.B F_SETSIG +command to +.BR fcntl (). +In the latter case, the signal handler receives a +.I siginfo_t +structure as its second argument (if the handler was +established using +.BR SA_SIGINFO ) +and the +.I si_fd +field of this structure contains the file descriptor which +generated the notification (useful when establishing notification +on multiple directories). + +Especially when using +.BR DN_MULTISHOT , +a real time signal should be used for notification, +so that multiple notifications can be queued. + +.B NOTE: +New applications should use the +.I inotify +interface (available since kernel 2.6.13), +which provides a much superior interface for obtaining notifications of +file system events. +See +.BR inotify (7). +.SH "RETURN VALUE" +For a successful call, the return value depends on the operation: +.TP 0.9i +.B F_DUPFD +The new descriptor. +.TP +.B F_GETFD +Value of flags. +.TP +.B F_GETFL +Value of flags. +.TP +.B F_GETLEASE +Type of lease held on file descriptor. +.TP +.B F_GETOWN +Value of descriptor owner. +.TP +.B F_GETSIG +Value of signal sent when read or write becomes possible, or zero +for traditional +.B SIGIO +behavior. +.TP +All other commands +Zero. +.PP +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.BR EACCES " or " EAGAIN +Operation is prohibited by locks held by other processes. +.TP +.B EAGAIN +The operation is prohibited because the file has been memory-mapped by +another process. +.TP +.B EBADF +.I fd +is not an open file descriptor, or the command was +.B F_SETLK +or +.B F_SETLKW +and the file descriptor open mode doesn't match with the +type of lock requested. +.TP +.B EDEADLK +It was detected that the specified +.B F_SETLKW +command would cause a deadlock. +.TP +.B EFAULT +.I lock +is outside your accessible address space. +.TP +.B EINTR +For +.BR F_SETLKW , +the command was interrupted by a signal; see +.BR signal (7). +For +.BR F_GETLK " and " F_SETLK , +the command was interrupted by a signal before the lock was checked or +acquired. +Most likely when locking a remote file (e.g., locking over +NFS), but can sometimes happen locally. +.TP +.B EINVAL +For +.BR F_DUPFD , +.I arg +is negative or is greater than the maximum allowable value. +For +.BR F_SETSIG , +.I arg +is not an allowable signal number. +.TP +.B EMFILE +For +.BR F_DUPFD , +the process already has the maximum number of file descriptors open. +.TP +.B ENOLCK +Too many segment locks open, lock table is full, or a remote locking +protocol failed (e.g., locking over NFS). +.TP +.B EPERM +Attempted to clear the +.B O_APPEND +flag on a file that has the append-only attribute set. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +Only the operations +.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 , +and +.B F_SETOWN +are specified in POSIX.1-2001. + +.B F_DUPFD_CLOEXEC +is specified in POSIX.1-2008. + +.BR F_GETOWN_EX , +.BR F_SETOWN_EX , +.BR F_GETSIG , +.BR F_SETSIG , +.BR F_NOTIFY , +.BR F_GETLEASE , +and +.B F_SETLEASE +are Linux-specific. +(Define the +.B _GNU_SOURCE +macro to obtain these definitions.) +.\" .PP +.\" SVr4 documents additional EIO, ENOLINK and EOVERFLOW error conditions. +.SH NOTES +The errors returned by +.BR dup2 (2) +are different from those returned by +.BR F_DUPFD . + +Since kernel 2.0, there is no interaction between the types of lock +placed by +.BR flock (2) +and +.BR fcntl (). + +Several systems have more fields in +.I "struct flock" +such as, for example, +.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 +Clearly, +.I l_pid +alone is not going to be very useful if the process holding the lock +may live on a different machine. +.SH BUGS +A limitation of the Linux system call conventions on some +architectures (notably i386) means that if a (negative) +process group ID to be returned by +.B F_GETOWN +falls in the range \-1 to \-4095, then the return value is wrongly +interpreted by glibc as an error in the system call; +.\" glibc source: sysdeps/unix/sysv/linux/i386/sysdep.h +that is, the return value of +.BR fcntl () +will be \-1, and +.I errno +will contain the (positive) process group ID. +The Linux-specific +.BR F_SETOWN_EX +and +.BR F_GETOWN_EX +operations avoid this problem. +.\" mtk, Dec 04: some limited testing on alpha and ia64 seems to +.\" indicate that ANY negative PGID value will cause F_GETOWN +.\" to misinterpret the return as an error. Some other architectures +.\" seem to have the same range check as i386. + +In Linux 2.4 and earlier, there is bug that can occur +when an unprivileged process uses +.B F_SETOWN +to specify the owner +of a socket file descriptor +as a process (group) other than the caller. +In this case, +.BR fcntl () +can return \-1 with +.I errno +set to +.BR EPERM , +even when the owner process (group) is one that the caller +has permission to send signals to. +Despite this error return, the file descriptor owner is set, +and signals will be sent to the owner. + +The implementation of mandatory locking in all known versions of Linux +is subject to race conditions which render it unreliable: +.\" http://marc.info/?l=linux-kernel&m=119013491707153&w=2 +a +.BR write (2) +call that overlaps with a lock may modify data after the mandatory lock is +acquired; +a +.BR read (2) +call that overlaps with a lock may detect changes to data that were made +only after a write lock was acquired. +Similar races exist between mandatory locks and +.BR mmap (2). +It is therefore inadvisable to rely on mandatory locking. +.SH "SEE ALSO" +.BR dup2 (2), +.BR flock (2), +.BR open (2), +.BR socket (2), +.BR lockf (3), +.BR capabilities (7), +.BR feature_test_macros (7) +.P +See also +.IR locks.txt , +.IR mandatory-locking.txt , +and +.I dnotify.txt +in the kernel source directory +.IR Documentation/filesystems/ . +(On older kernels, these files are directly under the +.I Documentation/ +directory, and +.I mandatory-locking.txt +is called +.IR mandatory.txt .) diff --git a/original/man2/fcntl64.2 b/original/man2/fcntl64.2 new file mode 100644 index 00000000..fc8ddc17 --- /dev/null +++ b/original/man2/fcntl64.2 @@ -0,0 +1 @@ +.so man2/fcntl.2 diff --git a/original/man2/fdatasync.2 b/original/man2/fdatasync.2 new file mode 100644 index 00000000..3c7494f3 --- /dev/null +++ b/original/man2/fdatasync.2 @@ -0,0 +1 @@ +.so man2/fsync.2 diff --git a/original/man2/fgetxattr.2 b/original/man2/fgetxattr.2 new file mode 100644 index 00000000..d9e5d903 --- /dev/null +++ b/original/man2/fgetxattr.2 @@ -0,0 +1 @@ +.so man2/getxattr.2 diff --git a/original/man2/flistxattr.2 b/original/man2/flistxattr.2 new file mode 100644 index 00000000..117bd2b5 --- /dev/null +++ b/original/man2/flistxattr.2 @@ -0,0 +1 @@ +.so man2/listxattr.2 diff --git a/original/man2/flock.2 b/original/man2/flock.2 new file mode 100644 index 00000000..f009ea33 --- /dev/null +++ b/original/man2/flock.2 @@ -0,0 +1,212 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) and +.\" and Copyright 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 Fri Jan 31 16:26:07 1997 by Eric S. Raymond +.\" Modified Fri Dec 11 17:57:27 1998 by Jamie Lokier +.\" Modified 24 Apr 2002 by Michael Kerrisk +.\" Substantial rewrites and additions +.\" 2005-05-10 mtk, noted that lock conversions are not atomic. +.\" +.TH FLOCK 2 2009-07-25 "Linux" "Linux Programmer's Manual" +.SH NAME +flock \- apply or remove an advisory lock on an open file +.SH SYNOPSIS +.B #include +.sp +.BI "int flock(int " fd ", int " operation ); +.SH DESCRIPTION +Apply or remove an advisory lock on the open file specified by +.IR fd . +The argument +.I operation +is one of the following: +.RS 4 +.TP 9 +.B LOCK_SH +Place a shared lock. +More than one process may hold a shared lock for a given file +at a given time. +.TP +.B LOCK_EX +Place an exclusive lock. +Only one process may hold an exclusive lock for a given +file at a given time. +.TP +.B LOCK_UN +Remove an existing lock held by this process. +.RE +.PP +A call to +.BR flock () +may block if an incompatible lock is held by another process. +To make a nonblocking request, include +.B LOCK_NB +(by +.IR OR ing) +with any of the above operations. + +A single file may not simultaneously have both shared and exclusive locks. + +Locks created by +.BR flock () +are associated with an open file table entry. +This means that duplicate file descriptors (created by, for example, +.BR fork (2) +or +.BR dup (2)) +refer to the same lock, and this lock may be modified +or released using any of these descriptors. +Furthermore, the lock is released either by an explicit +.B LOCK_UN +operation on any of these duplicate descriptors, or when all +such descriptors have been closed. + +If a process uses +.BR open (2) +(or similar) to obtain more than one descriptor for the same file, +these descriptors are treated independently by +.BR flock (). +An attempt to lock the file using one of these file descriptors +may be denied by a lock that the calling process has +already placed via another descriptor. + +A process may only hold one type of lock (shared or exclusive) +on a file. +Subsequent +.BR flock () +calls on an already locked file will convert an existing lock to the new +lock mode. + +Locks created by +.BR flock () +are preserved across an +.BR execve (2). + +A shared or exclusive lock can be placed on a file regardless of the +mode in which the file was opened. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +.I fd +is not an open file descriptor. +.TP +.B EINTR +While waiting to acquire a lock, the call was interrupted by +delivery of a signal caught by a handler; see +.BR signal (7). +.TP +.B EINVAL +.I operation +is invalid. +.TP +.B ENOLCK +The kernel ran out of memory for allocating lock records. +.TP +.B EWOULDBLOCK +The file is locked and the +.B LOCK_NB +flag was selected. +.SH "CONFORMING TO" +4.4BSD (the +.BR flock () +call first appeared in 4.2BSD). +A version of +.BR flock (), +possibly implemented in terms of +.BR fcntl (2), +appears on most Unix systems. +.SH NOTES +.BR flock () +does not lock files over NFS. +Use +.BR fcntl (2) +instead: that does work over NFS, given a sufficiently recent version of +Linux and a server which supports locking. +.PP +Since kernel 2.0, +.BR flock () +is implemented as a system call in its own right rather +than being emulated in the GNU C library as a call to +.BR fcntl (2). +This yields true BSD semantics: +there is no interaction between the types of lock +placed by +.BR flock () +and +.BR fcntl (2), +and +.BR flock () +does not detect deadlock. +.PP +.BR flock () +places advisory locks only; given suitable permissions on a file, +a process is free to ignore the use of +.BR flock () +and perform I/O on the file. +.PP +.BR flock () +and +.BR fcntl (2) +locks have different semantics with respect to forked processes and +.BR dup (2). +On systems that implement +.BR flock () +using +.BR fcntl (2), +the semantics of +.BR flock () +will be different from those described in this manual page. +.PP +Converting a lock +(shared to exclusive, or vice versa) is not guaranteed to be atomic: +the existing lock is first removed, and then a new lock is established. +Between these two steps, +a pending lock request by another process may be granted, +with the result that the conversion either blocks, or fails if +.B LOCK_NB +was specified. +(This is the original BSD behavior, +and occurs on many other implementations.) +.\" Kernel 2.5.21 changed things a little: during lock conversion +.\" it is now the highest priority process that will get the lock -- mtk +.SH "SEE ALSO" +.BR close (2), +.BR dup (2), +.BR execve (2), +.BR fcntl (2), +.BR fork (2), +.BR open (2), +.BR lockf (3) + +See also +.I Documentation/filesystem/locks.txt +in the kernel source +.RI ( Documentation/locks.txt +in older kernels). diff --git a/original/man2/fork.2 b/original/man2/fork.2 new file mode 100644 index 00000000..33107a63 --- /dev/null +++ b/original/man2/fork.2 @@ -0,0 +1,226 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2006 Michael Kerrisk +.\" A few fragments remain from an earlier (1992) page by +.\" Drew Eckhardt (drew@cs.colorado.edu), +.\" +.\" 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 Sat Jul 24 13:22:07 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 21 Aug 1994 by Michael Chastain (mec@shell.portal.com): +.\" Referenced 'clone(2)'. +.\" Modified 1995-06-10, 1996-04-18, 1999-11-01, 2000-12-24 +.\" by Andries Brouwer (aeb@cwi.nl) +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" 2006-09-04, Michael Kerrisk +.\" Greatly expanded, to describe all attributes that differ +.\" parent and child. +.\" +.TH FORK 2 2009-04-27 "Linux" "Linux Programmer's Manual" +.SH NAME +fork \- create a child process +.SH SYNOPSIS +.B #include +.sp +.B pid_t fork(void); +.SH DESCRIPTION +.BR fork () +creates a new process by duplicating the calling process. +The new process, referred to as the \fIchild\fP, +is an exact duplicate of the calling process, +referred to as the \fIparent\fP, except for the following points: +.IP * 3 +The child has its own unique process ID, +and this PID does not match the ID of any existing process group +.RB ( setpgid (2)). +.IP * +The child's parent process ID is the same as the parent's process ID. +.IP * +The child does not inherit its parent's memory locks +.RB ( mlock (2), +.BR mlockall (2)). +.IP * +Process resource utilizations +.RB ( getrusage (2)) +and CPU time counters +.RB ( times (2)) +are reset to zero in the child. +.IP * +The child's set of pending signals is initially empty +.RB ( sigpending (2)). +.IP * +The child does not inherit semaphore adjustments from its parent +.RB ( semop (2)). +.IP * +The child does not inherit record locks from its parent +.RB ( fcntl (2)). +.IP * +The child does not inherit timers from its parent +.RB ( setitimer (2), +.BR alarm (2), +.BR timer_create (2)). +.IP * +The child does not inherit outstanding asynchronous I/O operations +from its parent +.RB ( aio_read (3), +.BR aio_write (3)), +nor does it inherit any asynchronous I/O contexts from its parent +.RB ( see io_setup (2)). +.PP +The process attributes in the preceding list are all specified +in POSIX.1-2001. +The parent and child also differ with respect to the following +Linux-specific process attributes: +.IP * 3 +The child does not inherit directory change notifications (dnotify) +from its parent +(see the description of +.B F_NOTIFY +in +.BR fcntl (2)). +.IP * +The +.BR prctl (2) +.B PR_SET_PDEATHSIG +setting is reset so that the child does not receive a signal +when its parent terminates. +.IP * +Memory mappings that have been marked with the +.BR madvise (2) +.B MADV_DONTFORK +flag are not inherited across a +.BR fork (). +.IP * +The termination signal of the child is always +.B SIGCHLD +(see +.BR clone (2)). +.PP +Note the following further points: +.IP * 3 +The child process is created with a single thread \(em the +one that called +.BR fork (). +The entire virtual address space of the parent is replicated in the child, +including the states of mutexes, condition variables, +and other pthreads objects; the use of +.BR pthread_atfork (3) +may be helpful for dealing with problems that this can cause. +.IP * +The child inherits copies of the parent's set of open file descriptors. +Each file descriptor in the child refers to the same +open file description (see +.BR open (2)) +as the corresponding file descriptor in the parent. +This means that the two descriptors share open file status flags, +current file offset, +and signal-driven I/O attributes (see the description of +.B F_SETOWN +and +.B F_SETSIG +in +.BR fcntl (2)). +.IP * +The child inherits copies of the parent's set of open message +queue descriptors (see +.BR mq_overview (7)). +Each descriptor in the child refers to the same +open message queue description +as the corresponding descriptor in the parent. +This means that the two descriptors share the same flags +.RI ( mq_flags ). +.IP * +The child inherits copies of the parent's set of open directory streams (see +.BR opendir (3)). +POSIX.1-2001 says that the corresponding directory streams +in the parent and child +.I may +share the directory stream positioning; +on Linux/glibc they do not. +.SH "RETURN VALUE" +On success, the PID of the child process is returned in the parent, +and 0 is returned in the child. +On failure, \-1 is returned in the parent, +no child process is created, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EAGAIN +.BR fork () +cannot allocate sufficient memory to copy the parent's page tables and +allocate a task structure for the child. +.TP +.B EAGAIN +It was not possible to create a new process because the caller's +.B RLIMIT_NPROC +resource limit was encountered. +To exceed this limit, the process must have either the +.B CAP_SYS_ADMIN +or the +.B CAP_SYS_RESOURCE +capability. +.TP +.B ENOMEM +.BR fork () +failed to allocate the necessary kernel structures because memory is tight. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH NOTES +.PP +Under Linux, +.BR fork () +is implemented using copy-on-write pages, so the only penalty that it incurs +is the time and memory required to duplicate the parent's page tables, +and to create a unique task structure for the child. + +Since version 2.3.3, +.\" nptl/sysdeps/unix/sysv/linux/fork.c +rather than invoking the kernel's +.BR fork () +system call, +the glibc +.BR fork () +wrapper that is provided as part of the +NPTL threading implementation invokes +.BR clone (2) +with flags that provide the same effect as the traditional system call. +The glibc wrapper invokes any fork handlers that have been +established using +.BR pthread_atfork (3). +.\" and does some magic to ensure that getpid(2) returns the right value. +.SH EXAMPLE +See +.BR pipe (2) +and +.BR wait (2). +.SH "SEE ALSO" +.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) diff --git a/original/man2/free_hugepages.2 b/original/man2/free_hugepages.2 new file mode 100644 index 00000000..d4b906a9 --- /dev/null +++ b/original/man2/free_hugepages.2 @@ -0,0 +1 @@ +.so man2/alloc_hugepages.2 diff --git a/original/man2/fremovexattr.2 b/original/man2/fremovexattr.2 new file mode 100644 index 00000000..38d01ccd --- /dev/null +++ b/original/man2/fremovexattr.2 @@ -0,0 +1 @@ +.so man2/removexattr.2 diff --git a/original/man2/fsetxattr.2 b/original/man2/fsetxattr.2 new file mode 100644 index 00000000..dc078075 --- /dev/null +++ b/original/man2/fsetxattr.2 @@ -0,0 +1 @@ +.so man2/setxattr.2 diff --git a/original/man2/fstat.2 b/original/man2/fstat.2 new file mode 100644 index 00000000..b1a86c19 --- /dev/null +++ b/original/man2/fstat.2 @@ -0,0 +1 @@ +.so man2/stat.2 diff --git a/original/man2/fstat64.2 b/original/man2/fstat64.2 new file mode 100644 index 00000000..2b9971d2 --- /dev/null +++ b/original/man2/fstat64.2 @@ -0,0 +1 @@ +.so man2/fstat.2 diff --git a/original/man2/fstatat.2 b/original/man2/fstatat.2 new file mode 100644 index 00000000..c88c986b --- /dev/null +++ b/original/man2/fstatat.2 @@ -0,0 +1,141 @@ +.\" 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. +.\" +.\" +.TH FSTATAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +fstatat \- get file status relative to a directory file descriptor +.SH SYNOPSIS +.nf +.B #include /* Definition of AT_* constants */ +.B #include +.sp +.BI "int fstatat(int " dirfd ", const char *" pathname ", struct stat *" \ +buf , +.BI " int " flags ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR fstatat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +The +.BR fstatat () +system call operates in exactly the same way as +.BR stat (2), +except for the differences described in this manual page. + +If the pathname given in +.I pathname +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I dirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR stat (2) +for a relative pathname). + +If +.I pathname +is relative and +.I dirfd +is the special value +.BR AT_FDCWD , +then +.I pathname +is interpreted relative to the current working +directory of the calling process (like +.BR stat (2)). + +If +.I pathname +is absolute, then +.I dirfd +is ignored. + +.I flags +can either be 0, or include the following flag: +.TP +.B AT_SYMLINK_NOFOLLOW +If +.I pathname +is a symbolic link, do not dereference it: +instead return information about the link itself, like +.BR lstat (2). +(By default, +.BR fstatat () +dereferences symbolic links, like +.BR stat (2).) +.SH "RETURN VALUE" +On success, +.BR fstatat () +returns 0. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR stat (2) +can also occur for +.BR fstatat (). +The following additional errors can occur for +.BR fstatat (): +.TP +.B EBADF +.I dirfd +is not a valid file descriptor. +.TP +.B EINVAL +Invalid flag specified in +.IR flags . +.TP +.B ENOTDIR +.I pathname +is relative and +.I dirfd +is a file descriptor referring to a file other than a directory. +.SH VERSIONS +.BR fstatat () +was added to Linux in kernel 2.6.16. +.SH "CONFORMING TO" +POSIX.1-2008. +A similar system call exists on Solaris. +.SH NOTES +See +.BR openat (2) +for an explanation of the need for +.BR fstatat (). +.SH "SEE ALSO" +.BR openat (2), +.BR stat (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/fstatat64.2 b/original/man2/fstatat64.2 new file mode 100644 index 00000000..7791269e --- /dev/null +++ b/original/man2/fstatat64.2 @@ -0,0 +1 @@ +.so man2/fstatat.2 diff --git a/original/man2/fstatfs.2 b/original/man2/fstatfs.2 new file mode 100644 index 00000000..923d3c0c --- /dev/null +++ b/original/man2/fstatfs.2 @@ -0,0 +1 @@ +.so man2/statfs.2 diff --git a/original/man2/fstatfs64.2 b/original/man2/fstatfs64.2 new file mode 100644 index 00000000..fde2b22f --- /dev/null +++ b/original/man2/fstatfs64.2 @@ -0,0 +1 @@ +.so man2/fstatfs.2 diff --git a/original/man2/fstatvfs.2 b/original/man2/fstatvfs.2 new file mode 100644 index 00000000..7343466a --- /dev/null +++ b/original/man2/fstatvfs.2 @@ -0,0 +1 @@ +.so man2/statvfs.2 diff --git a/original/man2/fsync.2 b/original/man2/fsync.2 new file mode 100644 index 00000000..58d325a9 --- /dev/null +++ b/original/man2/fsync.2 @@ -0,0 +1,189 @@ +.\" 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 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. +.\" +.TH FSYNC 2 2008-11-07 "Linux" "Linux Programmer's Manual" +.SH NAME +fsync, fdatasync \- synchronize a file's in-core state with storage device +.SH SYNOPSIS +.B #include +.sp +.BI "int fsync(int " fd ); +.sp +.BI "int fdatasync(int " fd ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR fsync (): +_BSD_SOURCE || _XOPEN_SOURCE +.br + || /* since glibc 2.8: */ _POSIX_C_SOURCE\ >=\ 200112L +.\" _POSIX_C_SOURCE\ >=\ 200112L only since glibc 2.8 +.br +.BR fdatasync (): +_POSIX_C_SOURCE\ >=\ 199309L || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +.BR fsync () +transfers ("flushes") all modified in-core data of +(i.e., modified buffer cache pages for) the +file referred to by the file descriptor +.I fd +to the disk device (or other permanent storage device) +where that file resides. +The call blocks until the device reports that the transfer has completed. +It also flushes metadata information associated with the file (see +.BR stat (2)). + +Calling +.BR fsync () +does not necessarily ensure +that the entry in the directory containing the file has also reached disk. +For that an explicit +.BR fsync () +on a file descriptor for the directory is also needed. + +.BR fdatasync () +is similar to +.BR fsync (), +but does not flush modified metadata unless that metadata +is needed in order to allow a subsequent data retrieval to be +correctly handled. +For example, changes to +.I st_atime +or +.I st_mtime +(respectively, time of last access and +time of last modification; see +.BR stat (2)) +do not require flushing because they are not necessary for +a subsequent data read to be handled correctly. +On the other hand, a change to the file size +.RI ( st_size , +as made by say +.BR ftruncate (2)), +would require a metadata flush. + +The aim of +.BR fdatasync () +is to reduce disk activity for applications that do not +require all metadata to be synchronized with the disk. +.SH "RETURN VALUE" +On success, these system calls return zero. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +.I fd +is not a valid file descriptor open for writing. +.TP +.B EIO +An error occurred during synchronization. +.TP +.BR EROFS ", " EINVAL +.I fd +is bound to a special file which does not support synchronization. +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +.SH AVAILABILITY +On POSIX systems on which +.BR fdatasync () +is available, +.B _POSIX_SYNCHRONIZED_IO +is defined in +.I +to a value greater than 0. +(See also +.BR 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. +.SH NOTES +Applications that access databases or log files often write a tiny +data fragment (e.g., one line in a log file) and then call +.BR fsync () +immediately in order to ensure that the written data is physically +stored on the harddisk. +Unfortunately, +.BR fsync () +will always initiate two write operations: one for the newly written +data and another one in order to update the modification time stored +in the inode. +If the modification time is not a part of the transaction +concept +.BR fdatasync () +can be used to avoid unnecessary inode disk write operations. + +If the underlying hard disk has write caching enabled, then +the data may not really be on permanent storage when +.BR fsync () +/ +.BR fdatasync () +return. +.\" See +.\" .BR hdparm (8) +.\" for how to disable that cache for IDE disks. +.LP +When an ext2 file system is mounted with the +.I sync +option, directory entries are also implicitly synced by +.BR fsync (). +.LP +On kernels before 2.4, +.BR fsync () +on big files can be inefficient. +An alternative might be to use the +.B O_SYNC +flag to +.BR open (2). + +In Linux 2.2 and earlier, +.BR fdatasync () +is equivalent to +.BR fsync (), +and so has no performance advantage. +.SH "SEE ALSO" +.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/original/man2/ftruncate.2 b/original/man2/ftruncate.2 new file mode 100644 index 00000000..2ed34f1e --- /dev/null +++ b/original/man2/ftruncate.2 @@ -0,0 +1 @@ +.so man2/truncate.2 diff --git a/original/man2/ftruncate64.2 b/original/man2/ftruncate64.2 new file mode 100644 index 00000000..a8862d3e --- /dev/null +++ b/original/man2/ftruncate64.2 @@ -0,0 +1 @@ +.so man2/ftruncate.2 diff --git a/original/man2/futex.2 b/original/man2/futex.2 new file mode 100644 index 00000000..c1164b9e --- /dev/null +++ b/original/man2/futex.2 @@ -0,0 +1,269 @@ +.\" Page by b.hubert - may be freely modified and distributed +.\" +.\" Niki A. Rahimi (LTC Security Development, narahimi@us.ibm.com) +.\" added ERRORS section. +.\" +.\" Modified 2004-06-17 mtk +.\" Modified 2004-10-07 aeb, added FUTEX_REQUEUE, FUTEX_CMP_REQUEUE +.\" +.\" FIXME +.\" 2.6.14 adds FUTEX_WAKE_OP +.\" 2.6.18 adds (Ingo Molnar) priority inheritance support: +.\" FUTEX_LOCK_PI, FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI. These need +.\" to be documented in the manual page. Probably there is sufficient +.\" material in the kernel source file Documentation/pi-futex.txt. +.\" 2.6.25 adds FUTEX_WAKE_BITSET, FUTEX_WAIT_BITSET +.\" +.TH FUTEX 2 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH NAME +futex \- Fast Userspace Locking system call +.SH SYNOPSIS +.nf +.sp +.B "#include " +.B "#include " +.sp +.BI "int futex(int *" uaddr ", int " op ", int " val \ +", const struct timespec *" timeout , +.br +.BI " int *" uaddr2 ", int " val3 ); +.\" int *? void *? u32 *? +.fi +.SH "DESCRIPTION" +.PP +The +.BR futex () +system call provides a method for +a program to wait for a value at a given address to change, and a +method to wake up anyone waiting on a particular address (while the +addresses for the same memory in separate processes may not be +equal, the kernel maps them internally so the same memory mapped in +different locations will correspond for +.BR futex () +calls). +It is typically used to +implement the contended case of a lock in shared memory, as +described in +.BR futex (7). +.PP +When a +.BR futex (7) +operation did not finish uncontended in userspace, a call needs to be made +to the kernel to arbitrate. +Arbitration can either mean putting the calling +process to sleep or, conversely, waking a waiting process. +.PP +Callers of this function are expected to adhere to the semantics as set out in +.BR futex (7). +As these +semantics involve writing nonportable assembly instructions, this in turn +probably means that most users will in fact be library authors and not +general application developers. +.PP +The +.I uaddr +argument needs to point to an aligned integer which stores the counter. +The operation to execute is passed via the +.I op +argument, along with a value +.IR val . +.PP +Five operations are currently defined: +.TP +.B FUTEX_WAIT +This operation atomically verifies that the futex address +.I uaddr +still contains the value +.IR val , +and sleeps awaiting +.B FUTEX_WAKE +on this futex address. +If the +.I timeout +argument is non-NULL, its contents describe the maximum +duration of the wait, which is infinite otherwise. +The arguments +.I uaddr2 +and +.I val3 +are ignored. + +For +.BR futex (7), +this call is executed if decrementing the count gave a negative value +(indicating contention), and will sleep until another process releases +the futex and executes the +.B FUTEX_WAKE +operation. +.TP +.B FUTEX_WAKE +This operation wakes at most \fIval\fP +processes waiting on this futex address (i.e., inside +.BR FUTEX_WAIT ). +The arguments +.IR timeout , +.I uaddr2 +and +.I val3 +are ignored. + +For +.BR futex (7), +this is executed if incrementing +the count showed that there were waiters, once the futex value has been set +to 1 (indicating that it is available). +.TP +.BR FUTEX_FD " (present up to and including Linux 2.6.25)" +To support asynchronous wakeups, this operation associates a file descriptor +with a futex. +.\" , suitable for .BR poll (2). +If another process executes a +.BR FUTEX_WAKE , +the process will receive the signal number that was passed in +.IR val . +The calling process must close the returned file descriptor after use. +The arguments +.IR timeout , +.I uaddr2 +and +.I val3 +are ignored. + +To prevent race conditions, the caller should test if the futex has +been upped after +.B FUTEX_FD +returns. + +Because it was inherently racy, +.B FUTEX_FD +has been removed from Linux 2.6.26 onwards. +.TP +.BR FUTEX_REQUEUE " (since Linux 2.5.70)" +This operation was introduced in order to avoid a "thundering herd" effect +when +.B FUTEX_WAKE +is used and all processes woken up need to acquire another futex. +This call wakes up +.I val +processes, and requeues all other waiters on the futex at address +.IR uaddr2 . +The arguments +.I timeout +and +.I val3 +are ignored. +.TP +.BR FUTEX_CMP_REQUEUE " (since Linux 2.6.7)" +There was a race in the intended use of +.BR FUTEX_REQUEUE , +so +.B FUTEX_CMP_REQUEUE +was introduced. +This is similar to +.BR FUTEX_REQUEUE , +but first checks whether the location +.I uaddr +still contains the value +.IR val3 . +If not, the operation fails with the error +.BR EAGAIN . +The argument +.I timeout +is ignored. +.SH "RETURN VALUE" +.PP +Depending on which operation was executed, +the returned value for a successful call can have differing meanings. +.TP +.B FUTEX_WAIT +Returns 0 if the process was woken by a +.B FUTEX_WAKE +call. +In case of timeout, +the operation fails with the error +.BR ETIMEDOUT . +If the futex was not equal to the expected value, +the operation fails with the error +.BR EWOULDBLOCK . +Signals (see +.BR signal (7)) +or other spurious wakeups cause +.B FUTEX_WAIT +to fail with the error +.BR EINTR . +.TP +.B FUTEX_WAKE +Returns the number of processes woken up. +.TP +.B FUTEX_FD +Returns the new file descriptor associated with the futex. +.TP +.B FUTEX_REQUEUE +Returns the number of processes woken up. +.TP +.B FUTEX_CMP_REQUEUE +Returns the number of processes woken up. +.PP +In the event of an error, all operations return \-1, and set +.I errno +to indicate the error. +.SH ERRORS +.TP +.B EACCES +No read access to futex memory. +.TP +.B EAGAIN +.B FUTEX_CMP_REQUEUE +found an unexpected futex value. +(This probably indicates a race; +use the safe +.B FUTEX_WAKE +now.) +.TP +.B EFAULT +Error in getting +.I timeout +information from userspace. +.TP +.B EINVAL +An operation was not defined or error in page alignment. +.TP +.B ENFILE +The system limit on the total number of open files has been reached. +.TP +.B ENOSYS +Invalid operation specified in +.IR op . +.SH "VERSIONS" +.PP +Initial futex support was merged in Linux 2.5.7 but with different semantics +from what was described above. +A 4-argument system call with the semantics +given here was introduced in Linux 2.5.40. +In Linux 2.5.70 one argument +was added. +In Linux 2.6.7 a sixth argument was added \(em messy, especially +on the s390 architecture. +.SH "CONFORMING TO" +This system call is Linux-specific. +.SH "NOTES" +.PP +To reiterate, bare futexes are not intended as an easy-to-use abstraction +for end-users. +(There is no wrapper function for this system call in glibc.) +Implementors are expected to be assembly literate and to have +read the sources of the futex userspace library referenced below. +.\" .SH "AUTHORS" +.\" .PP +.\" Futexes were designed and worked on by +.\" Hubertus Franke (IBM Thomas J. Watson Research Center), +.\" Matthew Kirkwood, Ingo Molnar (Red Hat) +.\" and Rusty Russell (IBM Linux Technology Center). +.\" This page written by bert hubert. +.SH "SEE ALSO" +.BR futex (7) +.PP +\fIFuss, Futexes and Furwocks: Fast Userlevel Locking in Linux\fP +(proceedings of the Ottawa Linux Symposium 2002), +futex example library, futex-*.tar.bz2 +. diff --git a/original/man2/futimesat.2 b/original/man2/futimesat.2 new file mode 100644 index 00000000..9c3276ba --- /dev/null +++ b/original/man2/futimesat.2 @@ -0,0 +1,136 @@ +.\" 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. +.\" +.\" +.TH FUTIMESAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +futimesat \- change timestamps of a file relative to a \ +directory file descriptor +.SH SYNOPSIS +.nf +.B #include /* Definition of AT_* constants */ +.sp +.BI "int futimesat(int " dirfd ", const char *" pathname , +.BI " const struct timeval " times [2]); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR futimesat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +This system call is obsolete. +Use +.BR utimensat (2) +instead. + +The +.BR futimesat () +system call operates in exactly the same way as +.BR utimes (2), +except for the differences described in this manual page. + +If the pathname given in +.I pathname +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I dirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR utimes (2) +for a relative pathname). + +If +.I pathname +is relative and +.I dirfd +is the special value +.BR AT_FDCWD , +then +.I pathname +is interpreted relative to the current working +directory of the calling process (like +.BR utimes (2)). + +If +.I pathname +is absolute, then +.I dirfd +is ignored. +.SH "RETURN VALUE" +On success, +.BR futimesat () +returns a 0. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR utimes (2) +can also occur for +.BR futimesat (). +The following additional errors can occur for +.BR futimesat (): +.TP +.B EBADF +.I dirfd +is not a valid file descriptor. +.TP +.B ENOTDIR +.I pathname +is relative and +.I dirfd +is a file descriptor referring to a file other than a directory. +.SH VERSIONS +.BR futimesat () +was added to Linux in kernel 2.6.16. +.SH "CONFORMING TO" +This system call is nonstandard. +It was implemented from a specification that was proposed for POSIX.1, +but that specification was replaced by the one for +.BR utimensat (2). + +A similar system call exists on Solaris. +.SH NOTES +.SS Glibc Notes +If +.I pathname +is NULL, then the glibc +.BR futimesat () +wrapper function updates the times for the file referred to by +.IR dirfd . +.\" The Solaris futimesat() also has this strangeness. +.SH "SEE ALSO" +.BR stat (2), +.BR utimensat (2), +.BR utimes (2), +.BR futimes (3), +.BR path_resolution (7) diff --git a/original/man2/get_kernel_syms.2 b/original/man2/get_kernel_syms.2 new file mode 100644 index 00000000..f520c1d6 --- /dev/null +++ b/original/man2/get_kernel_syms.2 @@ -0,0 +1,79 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.TH GET_KERNEL_SYMS 2 2007-06-03 "Linux" "Linux Programmer's Manual" +.SH NAME +get_kernel_syms \- retrieve exported kernel and module symbols +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int get_kernel_syms(struct kernel_sym *" table ); +.fi +.SH DESCRIPTION +If +.I table +is NULL, +.BR get_kernel_syms () +returns the number of symbols available for query. +Otherwise it fills in a table of structures: +.PP +.in +4n +.nf +struct kernel_sym { + unsigned long value; + char name[60]; +}; +.fi +.in +.PP +The symbols are interspersed with magic symbols of the form +.BI # module-name +with the kernel having an empty name. +The value associated with a symbol of this form is the address at +which the module is loaded. +.PP +The symbols exported from each module follow their magic module tag +and the modules are returned in the reverse of the +order in which they were loaded. +.SH "RETURN VALUE" +On success, returns the number of symbols copied to +.IR table . +On error, \-1 is returned and +.I errno +is set appropriately. +.SH ERRORS +There is only one possible error return: +.TP +.B ENOSYS +.BR get_kernel_syms () +is not supported in this version of the kernel. +.SH VERSIONS +This system call is only present on Linux up until kernel 2.4; +it was removed in Linux 2.6. +.\" Removed in Linux 2.5.48 +.SH "CONFORMING TO" +.BR get_kernel_syms () +is Linux-specific. +.SH BUGS +There is no way to indicate the size of the buffer allocated for +.IR table . +If symbols have been added to the kernel since the +program queried for the symbol table size, memory will be corrupted. +.PP +The length of exported symbol names is limited to 59 characters. +.PP +Because of these limitations, this system call is deprecated in +favor of +.BR query_module (2) +(which is itself nowadays deprecated +in favor of other interfaces described on its manual page). +.SH "SEE ALSO" +.BR create_module (2), +.BR delete_module (2), +.BR init_module (2), +.BR query_module (2) diff --git a/original/man2/get_mempolicy.2 b/original/man2/get_mempolicy.2 new file mode 100644 index 00000000..bbbbab54 --- /dev/null +++ b/original/man2/get_mempolicy.2 @@ -0,0 +1,244 @@ +.\" Copyright 2003,2004 Andi Kleen, SuSE Labs. +.\" and Copyright 2007 Lee Schermerhorn, Hewlett Packard +.\" +.\" 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. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\" 2006-02-03, mtk, substantial wording changes and other improvements +.\" 2007-08-27, Lee Schermerhorn +.\" more precise specification of behavior. +.\" +.TH GET_MEMPOLICY 2 2008-08-15 Linux "Linux Programmer's Manual" +.SH NAME +get_mempolicy \- Retrieve NUMA memory policy for a process +.SH SYNOPSIS +.B "#include " +.nf +.sp +.BI "int get_mempolicy(int *" mode ", unsigned long *" nodemask , +.BI " unsigned long " maxnode ", unsigned long " addr , +.BI " unsigned long " flags ); +.sp +Link with \fI\-lnuma\fP. +.fi +.SH DESCRIPTION +.BR get_mempolicy () +retrieves the NUMA policy of the calling process or of a memory address, +depending on the setting of +.IR flags . + +A NUMA machine has different +memory controllers with different distances to specific CPUs. +The memory policy defines from which node memory is allocated for +the process. + +If +.I flags +is specified as 0, +then information about the calling process's default policy +(as set by +.BR set_mempolicy (2)) +is returned. +The policy returned +.RI [ mode +and +.IR nodemask ] +may be used to restore the process's policy to its state at +the time of the call to +.BR get_mempolicy () +using +.BR set_mempolicy (2). + +If +.I flags +specifies +.BR MPOL_F_MEMS_ALLOWED +(available since Linux 2.6.24), the +.I mode +argument is ignored and the set of nodes [memories] that the +process is allowed to specify in subsequent calls to +.BR mbind (2) +or +.BR set_mempolicy (2) +[in the absense of any +.IR "mode flags" ] +is returned in +.IR nodemask . +It is not permitted to combine +.B MPOL_F_MEMS_ALLOWED +with either +.B MPOL_F_ADDR +or +.BR MPOL_F_NODE . + +If +.I flags +specifies +.BR MPOL_F_ADDR , +then information is returned about the policy governing the memory +address given in +.IR addr . +This policy may be different from the process's default policy if +.BR mbind (2) +or one of the helper functions described in +.BR numa (3) +has been used to establish a policy for the memory range containing +.IR addr . + +If the +.I mode +argument is not NULL, then +.BR get_mempolicy () +will store the policy mode and any optional +.I "mode flags" +of the requested NUMA policy in the location pointed to by this argument. +If +.I nodemask +is not NULL, then the nodemask associated with the policy will be stored +in the location pointed to by this argument. +.I maxnode +specifies the number of node IDs +that can be stored into +.IR nodemask \(emthat +is, the maximum node ID plus one. +The value specified by +.I maxnode +is always rounded to a multiple of +.IR "sizeof(unsigned long)" . + +If +.I flags +specifies both +.B MPOL_F_NODE +and +.BR MPOL_F_ADDR , +.BR get_mempolicy () +will return the node ID of the node on which the address +.I addr +is allocated into the location pointed to by +.IR mode . +If no page has yet been allocated for the specified address, +.BR get_mempolicy () +will allocate a page as if the process had performed a read +[load] access to that address, and return the ID of the node +where that page was allocated. + +If +.I flags +specifies +.BR MPOL_F_NODE , +but not +.BR MPOL_F_ADDR , +and the process's current policy is +.BR MPOL_INTERLEAVE , +then +.BR get_mempolicy () +will return in the location pointed to by a non-NULL +.I mode +argument, +the node ID of the next node that will be used for +interleaving of internal kernel pages allocated on behalf of the process. +.\" Note: code returns next interleave node via 'mode' argument -Lee Schermerhorn +These allocations include pages for memory mapped files in +process memory ranges mapped using the +.BR mmap (2) +call with the +.B MAP_PRIVATE +flag for read accesses, and in memory ranges mapped with the +.B MAP_SHARED +flag for all accesses. + +Other flag values are reserved. + +For an overview of the possible policies see +.BR set_mempolicy (2). +.SH RETURN VALUE +On success, +.BR get_mempolicy () +returns 0; +on error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EFAULT +Part of all of the memory range specified by +.I nodemask +and +.I maxnode +points outside your accessible address space. +.TP +.B EINVAL +The value specified by +.I maxnode +is less than the number of node IDs supported by the system. +Or +.I flags +specified values other than +.B MPOL_F_NODE +or +.BR MPOL_F_ADDR ; +or +.I flags +specified +.B MPOL_F_ADDR +and +.I addr +is NULL, +or +.I flags +did not specify +.B MPOL_F_ADDR +and +.I addr +is not NULL. +Or, +.I flags +specified +.B MPOL_F_NODE +but not +.B MPOL_F_ADDR +and the current process policy is not +.BR MPOL_INTERLEAVE . +Or, +.I flags +specified +.B MPOL_F_MEMS_ALLOWED +with either +.B MPOL_F_ADDR +or +.BR MPOL_F_NODE . +(And there are other +.B EINVAL +cases.) +.SH VERSIONS +The +.BR get_mempolicy () +system call was added to the Linux kernel in version 2.6.7. +.SH CONFORMING TO +This system call is Linux-specific. +.SH NOTES +For information on library support, see +.BR numa (7). +.SH SEE ALSO +.BR getcpu (2), +.BR mbind (2), +.BR mmap (2), +.BR set_mempolicy (2), +.BR numa (3), +.BR numa (7), +.BR numactl (8) diff --git a/original/man2/get_thread_area.2 b/original/man2/get_thread_area.2 new file mode 100644 index 00000000..30d81ef8 --- /dev/null +++ b/original/man2/get_thread_area.2 @@ -0,0 +1,51 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" Written by Kent Yoder. +.TH GET_THREAD_AREA 2 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH NAME +get_thread_area \- Get a Thread Local Storage (TLS) area +.SH "SYNOPSIS" +.B #include +.br +.B #include +.sp +.BI "int get_thread_area(struct user_desc *" u_info ); +.SH "DESCRIPTION" +.BR get_thread_area () +returns an entry in the current thread's Thread Local Storage (TLS) array. +The index of the entry corresponds to the value +of \fIu_info\->entry_number\fP, passed in by the user. +If the value is in bounds, +.BR get_thread_area () +copies the corresponding +TLS entry into the area pointed to by \fIu_info\fP. +.SH "RETURN VALUE" +.BR get_thread_area () +returns 0 on success. +Otherwise, it returns \-1 and sets +.I errno +appropriately. +.SH ERRORS +.TP +.B EFAULT +\fIu_info\fP is an invalid pointer. +.TP +.B EINVAL +\fIu_info\->entry_number\fP is out of bounds. +.SH VERSIONS +A version of +.BR get_thread_area () +first appeared in Linux 2.5.32. +.SH "CONFORMING TO" +.BR get_thread_area () +is Linux-specific and should not be used in programs +that are intended to be portable. +.SH NOTES +Glibc does not provide a wrapper for this system call; +call it using +.BR syscall (2). +.SH "SEE ALSO" +.BR modify_ldt (2), +.BR set_thread_area (2) diff --git a/original/man2/getcontext.2 b/original/man2/getcontext.2 new file mode 100644 index 00000000..4d210686 --- /dev/null +++ b/original/man2/getcontext.2 @@ -0,0 +1,164 @@ +.\" Copyright (C) 2001 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. +.\" +.TH GETCONTEXT 2 2009-03-15 "Linux" "Linux Programmer's Manual" +.SH NAME +getcontext, setcontext \- get or set the user context +.SH SYNOPSIS +.B #include +.sp +.BI "int getcontext(ucontext_t *" ucp ); +.br +.BI "int setcontext(const ucontext_t *" ucp ); +.SH DESCRIPTION +In a System V-like environment, one has the two types +\fImcontext_t\fP and \fIucontext_t\fP defined in +.I +and the four functions +.BR getcontext (), +.BR setcontext (), +.BR makecontext (3) +and +.BR swapcontext (3) +that allow user-level context switching between multiple +threads of control within a process. +.LP +The \fImcontext_t\fP type is machine-dependent and opaque. +The \fIucontext_t\fP type is a structure that has at least +the following fields: +.in +4 +.nf + +typedef struct ucontext { + struct ucontext *uc_link; + sigset_t uc_sigmask; + stack_t uc_stack; + mcontext_t uc_mcontext; + ... +} ucontext_t; + +.fi +.in +with \fIsigset_t\fP and \fIstack_t\fP defined in +.IR . +Here \fIuc_link\fP points to the context that will be resumed +when the current context terminates (in case the current context +was created using +.BR makecontext (3)), +\fIuc_sigmask\fP is the +set of signals blocked in this context (see +.BR sigprocmask (2)), +\fIuc_stack\fP is the stack used by this context (see +.BR sigaltstack (2)), +and \fIuc_mcontext\fP is the +machine-specific representation of the saved context, +that includes the calling thread's machine registers. +.LP +The function +.BR getcontext () +initializes the structure +pointed at by \fIucp\fP to the currently active context. +.LP +The function +.BR setcontext () +restores the user context +pointed at by \fIucp\fP. +A successful call does not return. +The context should have been obtained by a call of +.BR getcontext (), +or +.BR makecontext (3), +or passed as third argument to a signal +handler. +.LP +If the context was obtained by a call of +.BR getcontext (), +program execution continues as if this call just returned. +.LP +If the context was obtained by a call of +.BR makecontext (3), +program execution continues by a call to the function \fIfunc\fP +specified as the second argument of that call to +.BR makecontext (3). +When the function \fIfunc\fP returns, we continue with the +\fIuc_link\fP member of the structure \fIucp\fP specified as the +first argument of that call to +.BR makecontext (3). +When this member is NULL, the thread exits. +.LP +If the context was obtained by a call to a signal handler, +then old standard text says that "program execution continues with the +program instruction following the instruction interrupted +by the signal". +However, this sentence was removed in SUSv2, +and the present verdict is "the result is unspecified". +.SH "RETURN VALUE" +When successful, +.BR getcontext () +returns 0 and +.BR setcontext () +does not return. +On error, both return \-1 and set \fIerrno\fP +appropriately. +.SH ERRORS +None defined. +.SH "CONFORMING TO" +SUSv2, POSIX.1-2001. +POSIX.1-2008 removes the specification of +.BR getcontext (), +citing portability issues, and +recommending that applications be rewritten to use POSIX threads instead. +.SH NOTES +The earliest incarnation of this mechanism was the +.BR setjmp (3)/ longjmp (3) +mechanism. +Since that does not define +the handling of the signal context, the next stage was the +.BR sigsetjmp (3)/ siglongjmp (3) +pair. +The present mechanism gives much more control. +On the other hand, +there is no easy way to detect whether a return from +.BR getcontext () +is from the first call, or via a +.BR setcontext () +call. +The user has to invent her own bookkeeping device, and a register +variable won't do since registers are restored. +.LP +When a signal occurs, the current user context is saved and +a new context is created by the kernel for the signal handler. +Do not leave the handler using +.BR longjmp (3): +it is undefined what would happen with contexts. +Use +.BR siglongjmp (3) +or +.BR setcontext () +instead. +.SH "SEE ALSO" +.BR sigaction (2), +.BR sigaltstack (2), +.BR sigprocmask (2), +.BR longjmp (3), +.BR makecontext (3), +.BR sigsetjmp (3) diff --git a/original/man2/getcpu.2 b/original/man2/getcpu.2 new file mode 100644 index 00000000..03e724ad --- /dev/null +++ b/original/man2/getcpu.2 @@ -0,0 +1,125 @@ +.\" 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 +.TH GETCPU 2 2008-06-03 "Linux" "Linux Programmer's Manual" +.SH NAME +getcpu \- determine CPU and NUMA node on which the calling thread is running +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int getcpu(unsigned *" cpu ", unsigned *" node \ +", struct getcpu_cache *" tcache ); +.fi +.SH DESCRIPTION +The +.BR getcpu () +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 +.I cpu +and +.I node +arguments. +The processor is a unique small integer identifying a CPU. +The node is a unique small identifier identifying a NUMA node. +When either +.I cpu +or +.I node +is NULL nothing is written to the respective pointer. + +The third argument to this system call is nowadays unused. + +The information placed in +.I cpu +is only guaranteed to be current at the time of the call: +unless the CPU affinity has been fixed using +.BR sched_setaffinity (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 +.I cpu +and +.I node +are no longer the current CPU and node. +.SH VERSIONS +.BR getcpu () +was added in kernel 2.6.19 for x86_64 and i386. +.SH CONFORMING TO +.BR getcpu () +is Linux specific. +.SH NOTES +Linux makes a best effort to make this call as fast possible. +The intention of +.BR getcpu () +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 +.BR syscall (2); +or use +.BR sched_getcpu (3) +instead. + +The +.I tcache +argument is unused since Linux 2.6.24. +.\" commit 4307d1e5ada595c87f9a4d16db16ba5edb70dcb1 +.\" Author: Ingo Molnar +.\" Date: Wed Nov 7 18:37:48 2007 +0100 +.\" x86: ignore the sys_getcpu() tcache parameter +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 +.BR getcpu (). +Use of the cache could speed +.BR getcpu () +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. +.\" +.\" ===== 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. +.SH SEE ALSO +.BR mbind (2), +.BR sched_setaffinity (2), +.BR set_mempolicy (2), +.BR sched_getcpu (3), +.BR cpuset (7) diff --git a/original/man2/getcwd.2 b/original/man2/getcwd.2 new file mode 100644 index 00000000..f73c1579 --- /dev/null +++ b/original/man2/getcwd.2 @@ -0,0 +1 @@ +.so man3/getcwd.3 diff --git a/original/man2/getdents.2 b/original/man2/getdents.2 new file mode 100644 index 00000000..d432d0f5 --- /dev/null +++ b/original/man2/getdents.2 @@ -0,0 +1,260 @@ +.\" 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 +.TH GETDENTS 2 2009-07-04 "Linux" "Linux Programmer's Manual" +.SH NAME +getdents \- get directory entries +.SH SYNOPSIS +.nf +.BI "int getdents(unsigned int " fd ", struct linux_dirent *" dirp , +.BI " unsigned int " count ); +.fi +.SH DESCRIPTION +This is not the function you are interested in. +Look at +.BR readdir (3) +for the POSIX conforming C library interface. +This page documents the bare kernel system call interface. +.PP +The system call +.BR getdents () +reads several +.I linux_dirent +structures from the directory +referred to by the open file descriptor +.I fd +into the buffer pointed to by +.IR dirp . +The argument +.I count +specifies the size of that buffer. +.PP +The +.I linux_dirent +structure is declared as follows: +.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 +.I d_ino +is an inode number. +.I d_off +is the distance from the start of the directory to the start of the next +.IR linux_dirent . +.I d_reclen +is the size of this entire +.IR linux_dirent . +.I d_name +is a null-terminated filename. + +.I d_type +is a byte at the end of the structure that indicates the file type. +It contains one of the following values (defined in +.IR ): +.TP 12 +.B DT_BLK +This is a block device. +.TP +.B DT_CHR +This is a character device. +.TP +.B DT_DIR +This is a directory. +.TP +.B DT_FIFO +This is a named pipe (FIFO). +.TP +.B DT_LNK +This is a symbolic link. +.TP +.B DT_REG +This is a regular file. +.TP +.B DT_SOCK +This is a Unix domain socket. +.TP +.B DT_UNKNOWN +The file type is unknown. +.PP +The +.I d_type +field is implemented since Linux 2.6.4. +It occupies a space that was previously a zero-filled padding byte in the +.IR linux_dirent +structure. +Thus, on kernels before 2.6.3, +attempting to access this field always provides the value 0 +.RB ( DT_UNKNOWN ). +.PP +Currently, +.\" kernel 2.6.27 +.\" The same sentence is in readdir.2 +only some file systems (among them: Btrfs, ext2, ext3, and ext4) +have full support for returning the file type in +.IR d_type . +All applications must properly handle a return of +.BR DT_UNKNOWN . +.SH "RETURN VALUE" +On success, the number of bytes read is returned. +On end of directory, 0 is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +Invalid file descriptor +.IR fd . +.TP +.B EFAULT +Argument points outside the calling process's address space. +.TP +.B EINVAL +Result buffer is too small. +.TP +.B ENOENT +No such directory. +.TP +.B ENOTDIR +File descriptor does not refer to a directory. +.SH "CONFORMING TO" +SVr4. +.\" SVr4 documents additional ENOLINK, EIO error conditions. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). +You will need to define the +.I linux_dirent +structure yourself. + +This call supersedes +.BR readdir (2). +.SH EXAMPLE +The program below demonstrates the use of +.BR getdents (). +The following output shows an example of what we see when running this +program on an ext2 directory: + +.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 +.SS Program source +\& +.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 +.SH "SEE ALSO" +.BR readdir (2), +.BR readdir (3) diff --git a/original/man2/getdents64.2 b/original/man2/getdents64.2 new file mode 100644 index 00000000..f3674bac --- /dev/null +++ b/original/man2/getdents64.2 @@ -0,0 +1 @@ +.so man2/getdents.2 diff --git a/original/man2/getdomainname.2 b/original/man2/getdomainname.2 new file mode 100644 index 00000000..44cf7a11 --- /dev/null +++ b/original/man2/getdomainname.2 @@ -0,0 +1,128 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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-08-25 by Nicolás Lichtmaier +.\" Modified 2004-06-17 by Michael Kerrisk +.\" Modified 2008-11-27 by mtk +.\" +.TH GETDOMAINNAME 2 2009-09-27 "Linux" "Linux Programmer's Manual" +.SH NAME +getdomainname, setdomainname \- get/set domain name +.SH SYNOPSIS +.B #include +.sp +.BI "int getdomainname(char *" name ", size_t " len ); +.br +.BI "int setdomainname(const char *" name ", size_t " len ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR getdomainname (), +.BR setdomainname (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.ad b +.SH DESCRIPTION +These functions are used to access or to change the domain name of the +host system. + +.BR setdomainname () +sets the domain name to the value given in the character array +.IR name . +The +.I len +argument specifies the number of bytes in +.IR name . +(Thus, +.I name +does not require a terminating null byte.) + +.BR getdomainname () +returns the null-terminated domain name in the character array +.IR name , +which has a length of +.I len +bytes. +If the null-terminated domain name requires more than \fIlen\fP bytes, +.BR getdomainname () +returns the first \fIlen\fP bytes (glibc) or gives an error (libc). +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.BR setdomainname () +can fail with the following errors: +.TP +.B EFAULT +.I name +pointed outside of user address space. +.TP +.B EINVAL +.I len +was negative or too large. +.TP +.B EPERM +the caller is unprivileged (Linux: does not have the +.B CAP_SYS_ADMIN +capability). +.PP +.BR getdomainname () +can fail with the following errors: +.TP +.B EINVAL +For +.BR getdomainname () +under libc: +.I name +is NULL or +.I name +is longer than +.I len +bytes. +.SH "CONFORMING TO" +POSIX does not specify these calls. +.\" But they appear on most systems... +.SH NOTES +Since Linux 1.0, the limit on the length of a domain name, +including the terminating null byte, is 64 bytes. +In older kernels, it was 8 bytes. + +On most Linux architectures (including x86), +there is no +.BR getdomainname () +system call; instead, glibc implements +.BR getdomainname () +as a library function that returns a copy of the +.I domainname +field returned from a call to +.BR uname (2). +.SH "SEE ALSO" +.BR gethostname (2), +.BR sethostname (2), +.BR uname (2) diff --git a/original/man2/getdtablesize.2 b/original/man2/getdtablesize.2 new file mode 100644 index 00000000..2b45d86f --- /dev/null +++ b/original/man2/getdtablesize.2 @@ -0,0 +1,79 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 2002-04-15 by Roger Luethi and aeb +.\" +.TH GETDTABLESIZE 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +getdtablesize \- get descriptor table size +.SH SYNOPSIS +.B #include +.sp +.B int getdtablesize(void); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR getdtablesize (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +.BR getdtablesize () +returns the maximum number of files a process can have open, +one more than the largest possible value for a file descriptor. +.SH "RETURN VALUE" +The current limit on the number of open files per process. +.SH ERRORS +On Linux, +.BR getdtablesize () +can return any of the errors described for +.BR getrlimit (2); +see NOTES below. +.SH "CONFORMING TO" +SVr4, 4.4BSD (the +.BR getdtablesize () +function first appeared in 4.2BSD). +It is not specified in POSIX.1-2001; +portable applications should employ +.I sysconf(_SC_OPEN_MAX) +instead of this call. +.SH NOTES +.BR getdtablesize () +is implemented as a libc library function. +The glibc version calls +.BR getrlimit (2) +and returns the current +.B RLIMIT_NOFILE +limit, or +.B OPEN_MAX +when that fails. +The libc4 and libc5 versions return +.B OPEN_MAX +(set to 256 since Linux 0.98.4). +.SH "SEE ALSO" +.BR close (2), +.BR dup (2), +.BR getrlimit (2), +.BR open (2) diff --git a/original/man2/getegid.2 b/original/man2/getegid.2 new file mode 100644 index 00000000..d9b10e73 --- /dev/null +++ b/original/man2/getegid.2 @@ -0,0 +1 @@ +.so man2/getgid.2 diff --git a/original/man2/getegid32.2 b/original/man2/getegid32.2 new file mode 100644 index 00000000..d7da7086 --- /dev/null +++ b/original/man2/getegid32.2 @@ -0,0 +1 @@ +.so man2/getegid.2 diff --git a/original/man2/geteuid.2 b/original/man2/geteuid.2 new file mode 100644 index 00000000..165cfe1d --- /dev/null +++ b/original/man2/geteuid.2 @@ -0,0 +1 @@ +.so man2/getuid.2 diff --git a/original/man2/geteuid32.2 b/original/man2/geteuid32.2 new file mode 100644 index 00000000..8e60b779 --- /dev/null +++ b/original/man2/geteuid32.2 @@ -0,0 +1 @@ +.so man2/geteuid.2 diff --git a/original/man2/getgid.2 b/original/man2/getgid.2 new file mode 100644 index 00000000..a78babc6 --- /dev/null +++ b/original/man2/getgid.2 @@ -0,0 +1,50 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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. +.\" +.TH GETGID 2 1993-07-23 "Linux" "Linux Programmer's Manual" +.SH NAME +getgid, getegid \- get group identity +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.B gid_t getgid(void); +.br +.B gid_t getegid(void); +.SH DESCRIPTION +.BR getgid () +returns the real group ID of the calling process. + +.BR getegid () +returns the effective group ID of the calling process. +.SH ERRORS +These functions are always successful. +.SH "CONFORMING TO" +POSIX.1-2001, 4.3BSD. +.SH "SEE ALSO" +.BR getresgid (2), +.BR setgid (2), +.BR setregid (2), +.BR credentials (7) diff --git a/original/man2/getgid32.2 b/original/man2/getgid32.2 new file mode 100644 index 00000000..d9b10e73 --- /dev/null +++ b/original/man2/getgid32.2 @@ -0,0 +1 @@ +.so man2/getgid.2 diff --git a/original/man2/getgroups.2 b/original/man2/getgroups.2 new file mode 100644 index 00000000..9851c870 --- /dev/null +++ b/original/man2/getgroups.2 @@ -0,0 +1,167 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 Thu Oct 31 12:04:29 1996 by Eric S. Raymond +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" 2008-05-03, mtk, expanded and rewrote parts of DESCRIPTION and RETURN +.\" VALUE, made style of page more consistent with man-pages style. +.\" +.TH GETGROUPS 2 2008-06-03 "Linux" "Linux Programmer's Manual" +.SH NAME +getgroups, setgroups \- get/set list of supplementary group IDs +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "int getgroups(int " size ", gid_t " list []); +.sp +.B #include +.sp +.BI "int setgroups(size_t " size ", const gid_t *" list ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR setgroups (): +_BSD_SOURCE +.SH DESCRIPTION +.PP +.BR getgroups () +returns the supplementary group IDs of the calling process in +.IR list . +The argument +.I size +should be set to the maximum number of items that can be stored in the +buffer pointed to by +.IR list . +If the calling process is a member of more than +.I size +supplementary groups, then an error results. +It is unspecified whether the effective group ID of the calling process +is included in the returned list. +(Thus, an application should also call +.BR getegid (2) +and add or remove the resulting value.) + +If +.I size +is zero, +.I list +is not modified, but the total number of supplementary group IDs for the +process is returned. +This allows the caller to determine the size of a dynamically allocated +.I list +to be used in a further call to +.BR getgroups (). +.PP +.BR setgroups () +sets the supplementary group IDs for the calling process. +Appropriate privileges (Linux: the +.B CAP_SETGID +capability) are required. +The +.I size +argument specifies the number of supplementary group IDs +in the buffer pointed to by +.IR list . +.SH "RETURN VALUE" +On success, +.BR getgroups () +returns the number of supplementary group IDs. +On error, \-1 is returned, and +.I errno +is set appropriately. + +On success, +.BR setgroups () +returns 0. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +.I list +has an invalid address. +.PP +.BR getgroups () +can additionally fail with the following error: +.TP +.B EINVAL +.I size +is less than the number of supplementary group IDs, but is not zero. +.PP +.BR setgroups () +can additionally fail with the following errors: +.TP +.B EINVAL +.I size +is greater than +.B NGROUPS_MAX +(32 before Linux 2.6.4; 65536 since Linux 2.6.4). +.TP +.B ENOMEM +Out of memory. +.TP +.B EPERM +The calling process has insufficient privilege. +.SH "CONFORMING TO" +SVr4, 4.3BSD. +The +.BR getgroups () +function is in POSIX.1-2001. +Since +.BR setgroups () +requires privilege, it is not covered by POSIX.1-2001. +.SH NOTES +A process can have up to +.B NGROUPS_MAX +supplementary group IDs +in addition to the effective group ID. +The set of supplementary group IDs +is inherited from the parent process, and preserved across an +.BR execve (2). + +The maximum number of supplementary group IDs can be found using +.BR sysconf (3): +.nf + + long ngroups_max; + ngroups_max = sysconf(_SC_NGROUPS_MAX); + +.fi +The maximum return value of +.BR getgroups () +cannot be larger than one more than this value. +.SH "SEE ALSO" +.BR getgid (2), +.BR setgid (2), +.BR getgrouplist (3), +.BR initgroups (3), +.BR capabilities (7), +.BR credentials (7) diff --git a/original/man2/getgroups32.2 b/original/man2/getgroups32.2 new file mode 100644 index 00000000..0ae4cc0b --- /dev/null +++ b/original/man2/getgroups32.2 @@ -0,0 +1 @@ +.so man2/getgroups.2 diff --git a/original/man2/gethostid.2 b/original/man2/gethostid.2 new file mode 100644 index 00000000..3210db03 --- /dev/null +++ b/original/man2/gethostid.2 @@ -0,0 +1 @@ +.so man3/gethostid.3 diff --git a/original/man2/gethostname.2 b/original/man2/gethostname.2 new file mode 100644 index 00000000..89f28b0c --- /dev/null +++ b/original/man2/gethostname.2 @@ -0,0 +1,170 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 1995-07-22 by Michael Chastain : +.\" 'gethostname' is real system call on Linux/Alpha. +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2000-06-04, 2001-12-15 by aeb +.\" Modified 2004-06-17 by mtk +.\" Modified 2008-11-27 by mtk +.\" +.TH GETHOSTNAME 2 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH NAME +gethostname, sethostname \- get/set hostname +.SH SYNOPSIS +.B #include +.sp +.BI "int gethostname(char *" name ", size_t " len ); +.br +.BI "int sethostname(const char *" name ", size_t " len ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR gethostname (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR sethostname (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.ad b +.SH DESCRIPTION +These system calls are used to access or to change the hostname of the +current processor. + +.BR sethostname () +sets the hostname to the value given in the character array +.IR name . +The +.I len +argument specifies the number of bytes in +.IR name . +(Thus, +.I name +does not require a terminating null byte.) + +.BR gethostname () +returns the null-terminated hostname in the character array +.IR name , +which has a length of +.I len +bytes. +If the null-terminated hostname is too large to fit, +then the name is truncated, and no error is returned (but see NOTES below). +POSIX.1-2001 says that if such truncation occurs, +then it is unspecified whether the returned buffer +includes a terminating null byte. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +.I name +is an invalid address. +.TP +.B EINVAL +.I len +is negative +.\" Can't occur for gethostbyname() wrapper, since 'len' has an +.\" unsigned type; can occur for the underlying system call. +or, for +.BR sethostname (), +.I len +is larger than the maximum allowed size. +.TP +.B ENAMETOOLONG +.RB "(glibc " gethostname ()) +.I len +is smaller than the actual size. +(Before version 2.1, glibc uses +.BR EINVAL +for this case.) +.TP +.B EPERM +For +.BR sethostname (), +the caller did not have the +.B CAP_SYS_ADMIN +capability. +.SH "CONFORMING TO" +SVr4, 4.4BSD (these interfaces first appeared in 4.2BSD). +POSIX.1-2001 specifies +.BR gethostname () +but not +.BR sethostname (). +.SH NOTES +SUSv2 guarantees that "Host names are limited to 255 bytes". +POSIX.1-2001 guarantees that "Host names (not including +the terminating null byte) are limited to +.B HOST_NAME_MAX +bytes". +On Linux, +.B HOST_NAME_MAX +is defined with the value 64, which has been the limit since Linux 1.0 +(earlier kernels imposed a limit of 8 bytes). +.SS Glibc Notes +The GNU C library does not employ the +.BR gethostname () +system call; instead, it implements +.BR gethostname () +as a library function that calls +.BR uname (2) +and copies up to +.I len +bytes from the returned +.I nodename +field into +.IR name . +Having performed the copy, the function then checks if the length of the +.I nodename +was greater than or equal to +.IR len , +and if it is, then the function returns \-1 with +.I errno +set to +.BR ENAMETOOLONG ; +in this case, no null-terminator is included in the returned +.IR name . + +Versions of glibc before 2.2 +.\" At least glibc 2.0 and 2.1, older versions not checked +handle the case where the length of the +.I nodename +was greater than or equal to +.I len +differently: nothing is copied into +.I name +and the function returns \-1 with +.I errno +set to +.BR ENAMETOOLONG . +.SH "SEE ALSO" +.BR getdomainname (2), +.BR setdomainname (2), +.BR uname (2) diff --git a/original/man2/getitimer.2 b/original/man2/getitimer.2 new file mode 100644 index 00000000..dbb46b51 --- /dev/null +++ b/original/man2/getitimer.2 @@ -0,0 +1,225 @@ +.\" Copyright 7/93 by Darren Senn +.\" Based on a similar page Copyright 1992 by Rick Faith +.\" May be freely distributed +.\" Modified Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond +.\" 2005-04-06 mtk, Matthias Lang +.\" Noted MAX_SEC_IN_JIFFIES ceiling +.TH GETITIMER 2 2009-03-15 "Linux" "Linux Programmer's Manual" +.SH NAME +getitimer, setitimer \- get or set value of an interval timer +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int getitimer(int " which ", struct itimerval *" curr_value ); +.br +.BI "int setitimer(int " which ", const struct itimerval *" new_value , +.BI " struct itimerval *" old_value ); +.fi +.SH DESCRIPTION +The system provides each process with three interval timers, +each decrementing in a distinct time domain. +When any timer expires, a signal is sent to the +process, and the timer (potentially) restarts. +.TP 1.5i +.B ITIMER_REAL +decrements in real time, and delivers +.B SIGALRM +upon expiration. +.TP +.B ITIMER_VIRTUAL +decrements only when the process is executing, and delivers +.B SIGVTALRM +upon expiration. +.TP +.B ITIMER_PROF +decrements both when the process executes and when the system is executing +on behalf of the process. +Coupled with +.BR ITIMER_VIRTUAL , +this timer is usually used to profile the time spent by the +application in user and kernel space. +.B SIGPROF +is delivered upon expiration. +.LP +Timer values are defined by the following structures: +.PD 0 +.in +4n +.nf + +struct itimerval { + struct timeval it_interval; /* next value */ + struct timeval it_value; /* current value */ +}; + +struct timeval { + long tv_sec; /* seconds */ + long tv_usec; /* microseconds */ +}; +.fi +.in +.PD +.LP +The function +.BR getitimer () +fills the structure pointed to by +.I curr_value +with the current setting for the timer specified by +.I which +(one of +.BR ITIMER_REAL , +.BR ITIMER_VIRTUAL , +or +.BR ITIMER_PROF ). +The element +.I it_value +is set to the amount of time remaining on the timer, or zero if the timer +is disabled. +Similarly, +.I it_interval +is set to the reset value. + +The function +.BR setitimer () +sets the specified timer to the value in +.IR new_value . +If +.I old_value +is non-NULL, the old value of the timer is stored there. +.LP +Timers decrement from +.I it_value +to zero, generate a signal, and reset to +.IR it_interval . +A timer which is set to zero +.RI ( it_value +is zero or the timer expires and +.I it_interval +is zero) stops. +.LP +Both +.I tv_sec +and +.I tv_usec +are significant in determining the duration of a timer. +.LP +Timers will never expire before the requested time, +but may expire some (short) time afterwards, which depends +on the system timer resolution and on the system load; see +.BR time (7). +(But see BUGS below.) +Upon expiration, a signal will be generated and the timer reset. +If the timer expires while the process is active (always true for +.BR ITIMER_VIRTUAL ) +the signal will be delivered immediately when generated. +Otherwise the +delivery will be offset by a small time dependent on the system loading. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +.IR new_value , +.IR old_value , +or +.I curr_value +is not valid a pointer. +.TP +.B EINVAL +.I which +is not one of +.BR ITIMER_REAL , +.BR ITIMER_VIRTUAL , +or +.BR ITIMER_PROF ; +or (since Linux 2.6.22) one of the +.I tv_usec +fields in the structure pointed to by +.I new_value +contains a value outside the range 0 to 999999. +.SH "CONFORMING TO" +POSIX.1-2001, SVr4, 4.4BSD (this call first appeared in 4.2BSD). +POSIX.1-2008 marks +.BR getitimer () +and +.BR setitimer () +obsolete, recommending the use of the POSIX timers API +.RB ( timer_gettime (2), +.BR timer_settime (2), +etc.) instead. +.SH NOTES +A child created via +.BR fork (2) +does not inherit its parent's interval timers. +Interval timers are preserved across an +.BR execve (2). + +POSIX.1 leaves the +interaction between +.BR setitimer() +and the three interfaces +.BR alarm (2), +.BR sleep (3), +and +.BR usleep (3) +unspecified. +.SH BUGS +The generation and delivery of a signal are distinct, and +only one instance of each of the signals listed above may be pending +for a process. +Under very heavy loading, an +.B ITIMER_REAL +timer may expire before the signal from a previous expiration +has been delivered. +The second signal in such an event will be lost. + +On Linux kernels before 2.6.16, timer values are represented in jiffies. +If a request is made set a timer with a value whose jiffies +representation exceeds +.B MAX_SEC_IN_JIFFIES +(defined in +.IR include/linux/jiffies.h ), +then the timer is silently truncated to this ceiling value. +On Linux/i386 (where, since Linux 2.6.13, +the default jiffy is 0.004 seconds), +this means that the ceiling value for a timer is +approximately 99.42 days. +Since Linux 2.6.16, +the kernel uses a different internal representation for times, +and this ceiling is removed. + +On certain systems (including i386), +Linux kernels before version 2.6.12 have a bug which will produce +premature timer expirations of up to one jiffy under some circumstances. +This bug is fixed in kernel 2.6.12. +.\" 4 Jul 2005: It looks like this bug may remain in 2.4.x. +.\" http://lkml.org/lkml/2005/7/1/165 + +POSIX.1-2001 says that +.BR setitimer () +should fail if a +.I tv_usec +value is specified that is outside of the range 0 to 999999. +However, in kernels up to and including 2.6.21, +Linux does not give an error, but instead silently +adjusts the corresponding seconds value for the timer. +From kernel 2.6.22 onwards, +this nonconformance has been repaired: +an improper +.I tv_usec +value results in an +.B EINVAL +error. +.\" Bugzilla report 25 Apr 2006: +.\" http://bugzilla.kernel.org/show_bug.cgi?id=6443 +.\" "setitimer() should reject noncanonical arguments" +.SH "SEE ALSO" +.BR gettimeofday (2), +.BR sigaction (2), +.BR signal (2), +.BR timer_create (2), +.BR timerfd_create (2), +.BR time (7) diff --git a/original/man2/getpagesize.2 b/original/man2/getpagesize.2 new file mode 100644 index 00000000..297984ed --- /dev/null +++ b/original/man2/getpagesize.2 @@ -0,0 +1,103 @@ +.\" 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. +.\" +.TH GETPAGESIZE 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +getpagesize \- get memory page size +.SH SYNOPSIS +.B #include +.sp +.B int getpagesize(void); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR getpagesize (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +The function +.BR getpagesize () +returns the number of bytes in a page, where a "page" is the thing +used where it says in the description of +.BR mmap (2) +that files are mapped in page-sized units. + +The size of the kind of pages that +.BR mmap (2) +uses, is found using + +.in +4n +.nf +#include +long sz = sysconf(_SC_PAGESIZE); +.fi +.in + +(most systems allow the synonym +.B _SC_PAGE_SIZE +for +.BR _SC_PAGESIZE ), +or + +.in +4n +.nf +#include +int sz = getpagesize(); +.fi +.in +.\" .SH HISTORY +.\" This call first appeared in 4.2BSD. +.SH CONFORMING TO +SVr4, 4.4BSD, SUSv2. +In SUSv2 the +.BR getpagesize () +call is labeled LEGACY, and in POSIX.1-2001 +it has been dropped; +HP-UX does not have this call. +Portable applications should employ +.I sysconf(_SC_PAGESIZE) +instead of this call. +.SH NOTES +Whether +.BR getpagesize () +is present as a Linux system call depends on the architecture. +If it is, it returns the kernel symbol +.BR PAGE_SIZE , +whose value depends on the architecture and machine model. +Generally, one uses binaries that are dependent on the architecture but not +on the machine model, in order to have a single binary +distribution per architecture. +This means that a user program +should not find +.B PAGE_SIZE +at compile time from a header file, +but use an actual system call, at least for those architectures +(like sun4) where this dependency exists. +Here libc4, libc5, glibc 2.0 fail because their +.BR getpagesize () +returns a statically derived value, and does not use a system call. +Things are OK in glibc 2.1. +.SH "SEE ALSO" +.BR mmap (2), +.BR sysconf (3) diff --git a/original/man2/getpeername.2 b/original/man2/getpeername.2 new file mode 100644 index 00000000..95634aab --- /dev/null +++ b/original/man2/getpeername.2 @@ -0,0 +1,120 @@ +.\" 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. +.\" +.\" @(#)getpeername.2 6.5 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 16:37:50 1993 by Rik Faith +.\" Modified Thu Jul 30 14:37:50 1993 by Martin Schulze +.\" Modified Sun Mar 28 21:26:46 1999 by Andries Brouwer +.\" Modified 17 Jul 2002, Michael Kerrisk +.\" Added 'socket' to NAME, so that "man -k socket" will show this page. +.\" +.TH GETPEERNAME 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH NAME +getpeername \- get name of connected peer socket +.SH SYNOPSIS +.B #include +.sp +.BI "int getpeername(int " sockfd ", struct sockaddr *" addr \ +", socklen_t *" addrlen ); +.SH DESCRIPTION +.BR getpeername () +returns the address of the peer connected to the socket +.IR sockfd , +in the buffer pointed to by +.IR addr . +The +.I addrlen +argument should be initialized to indicate the amount of space pointed to +by +.IR addr . +On return it contains the actual size of the name returned (in bytes). +The name is truncated if the buffer provided is too small. + +The returned address is truncated if the buffer provided is too small; +in this case, +.I addrlen +will return a value greater than was supplied to the call. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +The argument +.I sockfd +is not a valid descriptor. +.TP +.B EFAULT +The +.I addr +argument points to memory not in a valid part of the +process address space. +.TP +.B EINVAL +.I addrlen +is invalid (e.g., is negative). +.TP +.B ENOBUFS +Insufficient resources were available in the system +to perform the operation. +.TP +.B ENOTCONN +The socket is not connected. +.TP +.B ENOTSOCK +The argument +.I sockfd +is a file, not a socket. +.SH "CONFORMING TO" +SVr4, 4.4BSD (the +.BR getpeername () +function call first appeared in 4.2BSD), POSIX.1-2001. +.SH NOTES +The third argument of +.BR getpeername () +is in reality an +.I int * +(and this is what 4.x BSD and libc4 and libc5 have). +Some POSIX confusion resulted in the present +.IR socklen_t , +also used by glibc. +See also +.BR accept (2). +.SH "SEE ALSO" +.BR accept (2), +.BR bind (2), +.BR getsockname (2), +.BR ip (7), +.BR socket (7), +.BR unix (7) diff --git a/original/man2/getpgid.2 b/original/man2/getpgid.2 new file mode 100644 index 00000000..d6b107a1 --- /dev/null +++ b/original/man2/getpgid.2 @@ -0,0 +1 @@ +.so man2/setpgid.2 diff --git a/original/man2/getpgrp.2 b/original/man2/getpgrp.2 new file mode 100644 index 00000000..d6b107a1 --- /dev/null +++ b/original/man2/getpgrp.2 @@ -0,0 +1 @@ +.so man2/setpgid.2 diff --git a/original/man2/getpid.2 b/original/man2/getpid.2 new file mode 100644 index 00000000..f04f5fcb --- /dev/null +++ b/original/man2/getpid.2 @@ -0,0 +1,107 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" 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. +.TH GETPID 2 2008-09-23 "Linux" "Linux Programmer's Manual" +.SH NAME +getpid, getppid \- get process identification +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.B pid_t getpid(void); +.br +.B pid_t getppid(void); +.SH DESCRIPTION +.BR getpid () +returns the process ID of the calling process. +(This is often used by +routines that generate unique temporary filenames.) + +.BR getppid () +returns the process ID of the parent of the calling process. +.SH ERRORS +These functions are always successful. +.SH "CONFORMING TO" +POSIX.1-2001, 4.3BSD, SVr4. +.SH NOTES +Since glibc version 2.3.4, +the glibc wrapper function for +.BR getpid () +caches PIDs, +so as to avoid additional system calls when a process calls +.BR getpid () +repeatedly. +Normally this caching is invisible, +but its correct operation relies on support in the wrapper functions for +.BR fork (2), +.BR vfork (2), +and +.BR clone (2): +if an application bypasses the glibc wrappers for these system calls by using +.BR syscall (2), +then a call to +.BR getpid () +in the child will return the wrong value +(to be precise: it will return the PID of the parent process). +.\" The following program demonstrates this "feature": +.\" +.\" #define _GNU_SOURCE +.\" #include +.\" #include +.\" #include +.\" #include +.\" #include +.\" +.\" int +.\" main(int argc, char *argv[]) +.\" { +.\" /* The following statement fills the getpid() cache */ +.\" +.\" printf("parent PID = %ld\n", (long) getpid()); +.\" +.\" if (syscall(SYS_fork) == 0) { +.\" if (getpid() != syscall(SYS_getpid)) +.\" printf("child getpid() mismatch: getpid()=%ld; " +.\" "syscall(SYS_getpid)=%ld\n", +.\" (long) getpid(), (long) syscall(SYS_getpid)); +.\" exit(EXIT_SUCCESS); +.\" } +.\" wait(NULL); +.\"} +See also +.BR clone (2) +for discussion of a case where +.BR getpid () +may return the wrong value even when invoking +.BR clone (2) +via the glibc wrapper function. +.SH "SEE ALSO" +.BR clone (2), +.BR fork (2), +.BR kill (2), +.BR exec (3), +.BR mkstemp (3), +.BR tempnam (3), +.BR tmpfile (3), +.BR tmpnam (3), +.BR credentials (7) diff --git a/original/man2/getpmsg.2 b/original/man2/getpmsg.2 new file mode 100644 index 00000000..5d25ea6c --- /dev/null +++ b/original/man2/getpmsg.2 @@ -0,0 +1 @@ +.so man2/unimplemented.2 diff --git a/original/man2/getppid.2 b/original/man2/getppid.2 new file mode 100644 index 00000000..fca885ee --- /dev/null +++ b/original/man2/getppid.2 @@ -0,0 +1 @@ +.so man2/getpid.2 diff --git a/original/man2/getpriority.2 b/original/man2/getpriority.2 new file mode 100644 index 00000000..1168a637 --- /dev/null +++ b/original/man2/getpriority.2 @@ -0,0 +1,230 @@ +.\" Copyright (c) 1980, 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. +.\" +.\" @(#)getpriority.2 6.9 (Berkeley) 3/10/91 +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-07-01 by Andries Brouwer +.\" Modified 1996-11-06 by Eric S. Raymond +.\" Modified 2001-10-21 by Michael Kerrisk +.\" Corrected statement under EPERM to clarify privileges required +.\" Modified 2002-06-21 by Michael Kerrisk +.\" Clarified meaning of 0 value for 'who' argument +.\" Modified 2004-05-27 by Michael Kerrisk +.\" +.\" FIXME Oct 2008: Denys Vlasenko is working on a PRIO_THREAD feature that +.\" is likely to get included in mainline; this will need to be documented. +.\" +.TH GETPRIORITY 2 2008-05-29 "Linux" "Linux Programmer's Manual" +.SH NAME +getpriority, setpriority \- get/set program scheduling priority +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "int getpriority(int " which ", int " who ); +.br +.BI "int setpriority(int " which ", int " who ", int " prio ); +.SH DESCRIPTION +The scheduling priority of the process, process group, or user, as +indicated by +.I which +and +.I who +is obtained with the +.BR getpriority () +call and set with the +.BR setpriority () +call. + +The value +.I which +is one of +.BR PRIO_PROCESS , +.BR PRIO_PGRP , +or +.BR PRIO_USER , +and +.I who +is interpreted relative to +.I which +(a process identifier for +.BR PRIO_PROCESS , +process group +identifier for +.BR PRIO_PGRP , +and a user ID for +.BR PRIO_USER ). +A zero value for +.I who +denotes (respectively) the calling process, the process group of the +calling process, or the real user ID of the calling process. +.I Prio +is a value in the range \-20 to 19 (but see the Notes below). +The default priority is 0; +lower priorities cause more favorable scheduling. + +The +.BR getpriority () +call returns the highest priority (lowest numerical value) +enjoyed by any of the specified processes. +The +.BR setpriority () +call sets the priorities of all of the specified processes +to the specified value. +Only the superuser may lower priorities. +.SH "RETURN VALUE" +Since +.BR getpriority () +can legitimately return the value \-1, it is necessary +to clear the external variable +.I errno +prior to the +call, then check it afterwards to determine +if \-1 is an error or a legitimate value. +The +.BR setpriority () +call returns 0 if there is no error, or +\-1 if there is. +.SH ERRORS +.TP +.B EINVAL +.I which +was not one of +.BR PRIO_PROCESS , +.BR PRIO_PGRP , +or +.BR PRIO_USER . +.TP +.B ESRCH +No process was located using the +.I which +and +.I who +values specified. +.PP +In addition to the errors indicated above, +.BR setpriority () +may fail if: +.TP +.B EACCES +The caller attempted to lower a process priority, but did not +have the required privilege (on Linux: did not have the +.B CAP_SYS_NICE +capability). +Since Linux 2.6.12, this error only occurs if the caller attempts +to set a process priority outside the range of the +.B RLIMIT_NICE +soft resource limit of the target process; see +.BR getrlimit (2) +for details. +.TP +.B EPERM +A process was located, but its effective user ID did not match +either the effective or the real user ID of the caller, +and was not privileged (on Linux: did not have the +.B CAP_SYS_NICE +capability). +But see NOTES below. +.SH "CONFORMING TO" +SVr4, 4.4BSD (these function calls first appeared in 4.2BSD), +POSIX.1-2001. +.SH NOTES +A child created by +.BR fork (2) +inherits its parent's nice value. +The nice value is preserved across +.BR execve (2). + +The degree to which their relative nice value affects the scheduling of +processes varies across Unix systems, and, +on Linux, across kernel versions. +Starting with kernel 2.6.23, Linux adopted an algorithm that causes +relative differences in nice values to have a much stronger effect. +This causes very low nice values (+19) to truly provide little CPU +to a process whenever there is any other +higher priority load on the system, +and makes high nice values (\-20) deliver most of the CPU to applications +that require it (e.g., some audio applications). + +The details on the condition for +.B EPERM +depend on the system. +The above description is what POSIX.1-2001 says, and seems to be followed on +all System V-like systems. +Linux kernels before 2.6.12 required the real or +effective user ID of the caller to match +the real user of the process \fIwho\fP (instead of its effective user ID). +Linux 2.6.12 and later require +the effective user ID of the caller to match +the real or effective user ID of the process \fIwho\fP. +All BSD-like systems (SunOS 4.1.3, Ultrix 4.2, +4.3BSD, FreeBSD 4.3, OpenBSD-2.5, ...) behave in the same +manner as Linux 2.6.12 and later. +.LP +The actual priority range varies between kernel versions. +Linux before 1.3.36 had \-infinity..15. +Since kernel 1.3.43 Linux has the range \-20..19. +Within the kernel, nice values are actually represented +using the corresponding range 40..1 +(since negative numbers are error codes) and these are the values +employed by the +.BR setpriority () +and +.BR getpriority () +system calls. +The glibc wrapper functions for these system calls handle the +translations between the user-land and kernel representations +of the nice value according to the formula +.IR "unice\ =\ 20\ \-\ knice" . +.LP +On some systems, the range of nice values is \-20..20. +.LP +Including +.I +is not required these days, but increases portability. +(Indeed, +.I +defines the +.I rusage +structure with fields of type +.I struct timeval +defined in +.IR .) +.SH "SEE ALSO" +.BR nice (1), +.BR fork (2), +.BR capabilities (7), +.BR renice (8) +.sp +.I Documentation/scheduler/sched-nice-design.txt +in the kernel source tree (since Linux 2.6.23). diff --git a/original/man2/getresgid.2 b/original/man2/getresgid.2 new file mode 100644 index 00000000..ac4fb7cb --- /dev/null +++ b/original/man2/getresgid.2 @@ -0,0 +1 @@ +.so man2/getresuid.2 diff --git a/original/man2/getresgid32.2 b/original/man2/getresgid32.2 new file mode 100644 index 00000000..2b3240fa --- /dev/null +++ b/original/man2/getresgid32.2 @@ -0,0 +1 @@ +.so man2/getresgid.2 diff --git a/original/man2/getresuid.2 b/original/man2/getresuid.2 new file mode 100644 index 00000000..fb7b5998 --- /dev/null +++ b/original/man2/getresuid.2 @@ -0,0 +1,75 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl) +.\" 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, 2003-05-26, Michael Kerrisk, +.TH GETRESUID 2 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH NAME +getresuid, getresgid \- get real, effective and saved user/group IDs +.SH SYNOPSIS +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int getresuid(uid_t *" ruid ", uid_t *" euid ", uid_t *" suid ); +.br +.BI "int getresgid(gid_t *" rgid ", gid_t *" egid ", gid_t *" sgid ); +.SH DESCRIPTION +.BR getresuid () +returns the real UID, the effective UID, and the saved set-user-ID +of the calling process, in the arguments +.IR ruid , +.IR euid , +and +.IR suid , +respectively. +.BR getresgid () +performs the analogous task for the process's group IDs. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +One of the arguments specified an address outside the calling program's +address space. +.SH VERSIONS +These system calls appeared on Linux starting with kernel 2.1.44. + +The prototypes are given by glibc since version 2.3.2, +provided +.B _GNU_SOURCE +is defined. +.SH "CONFORMING TO" +These calls are nonstandard; +they also appear on HP-UX and some of the BSDs. +.SH "SEE ALSO" +.BR getuid (2), +.BR setresuid (2), +.BR setreuid (2), +.BR setuid (2), +.BR credentials (7), +.BR feature_test_macros (7) diff --git a/original/man2/getresuid32.2 b/original/man2/getresuid32.2 new file mode 100644 index 00000000..ac4fb7cb --- /dev/null +++ b/original/man2/getresuid32.2 @@ -0,0 +1 @@ +.so man2/getresuid.2 diff --git a/original/man2/getrlimit.2 b/original/man2/getrlimit.2 new file mode 100644 index 00000000..35c9eed5 --- /dev/null +++ b/original/man2/getrlimit.2 @@ -0,0 +1,487 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt, March 28, 1992 +.\" and Copyright (c) 2002, 2004, 2005, 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-23 by Rik Faith +.\" Modified 1996-01-13 by Arnt Gulbrandsen +.\" Modified 1996-01-22 by aeb, following a remark by +.\" Tigran Aivazian +.\" Modified 1996-04-14 by aeb, following a remark by +.\" Robert Bihlmeyer +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 2001-05-04 by aeb, following a remark by +.\" Håvard Lygre +.\" Modified 2001-04-17 by Michael Kerrisk +.\" Modified 2002-06-13 by Michael Kerrisk +.\" Added note on nonstandard behavior when SIGCHLD is ignored. +.\" Modified 2002-07-09 by Michael Kerrisk +.\" Enhanced descriptions of 'resource' values for [gs]etrlimit() +.\" Modified 2003-11-28 by aeb, added RLIMIT_CORE +.\" Modified 2004-03-26 by aeb, added RLIMIT_AS +.\" Modified 2004-06-16 by Michael Kerrisk +.\" Added notes on CAP_SYS_RESOURCE +.\" +.\" 2004-11-16 -- mtk: the getrlimit.2 page, which formally included +.\" coverage of getrusage(2), has been split, so that the latter +.\" is now covered in its own getrusage.2. +.\" +.\" Modified 2004-11-16, mtk: A few other minor changes +.\" Modified 2004-11-23, mtk +.\" Added notes on RLIMIT_MEMLOCK, RLIMIT_NPROC, and RLIMIT_RSS +.\" to "CONFORMING TO" +.\" Modified 2004-11-25, mtk +.\" Rewrote discussion on RLIMIT_MEMLOCK to incorporate kernel +.\" 2.6.9 changes. +.\" Added note on RLIMIT_CPU error in older kernels +.\" 2004-11-03, mtk, Added RLIMIT_SIGPENDING +.\" 2005-07-13, mtk, documented RLIMIT_MSGQUEUE limit. +.\" 2005-07-28, mtk, Added descriptions of RLIMIT_NICE and RLIMIT_RTPRIO +.\" 2008-05-07, mtk / Peter Zijlstra, Added description of RLIMIT_RTTIME +.\" +.TH GETRLIMIT 2 2008-10-06 "Linux" "Linux Programmer's Manual" +.SH NAME +getrlimit, setrlimit \- get/set resource limits +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "int getrlimit(int " resource ", struct rlimit *" rlim ); +.br +.BI "int setrlimit(int " resource ", const struct rlimit *" rlim ); +.SH DESCRIPTION +.BR getrlimit () +and +.BR setrlimit () +get and set resource limits respectively. +Each resource has an associated soft and hard limit, as defined by the +.I rlimit +structure (the +.I rlim +argument to both +.BR getrlimit () +and +.BR setrlimit ()): +.PP +.in +4n +.nf +struct rlimit { + rlim_t rlim_cur; /* Soft limit */ + rlim_t rlim_max; /* Hard limit (ceiling for rlim_cur) */ +}; + +.fi +.in +The soft limit is the value that the kernel enforces for the +corresponding resource. +The hard limit acts as a ceiling for the soft limit: +an unprivileged process may only set its soft limit to a value in the +range from 0 up to the hard limit, and (irreversibly) lower its hard limit. +A privileged process (under Linux: one with the +.B CAP_SYS_RESOURCE +capability) may make arbitrary changes to either limit value. +.PP +The value +.B RLIM_INFINITY +denotes no limit on a resource (both in the structure returned by +.BR getrlimit () +and in the structure passed to +.BR setrlimit ()). +.PP +.I resource +must be one of: +.TP +.B RLIMIT_AS +The maximum size of the process's virtual memory (address space) in bytes. +.\" since 2.0.27 / 2.1.12 +This limit affects calls to +.BR brk (2), +.BR mmap (2) +and +.BR mremap (2), +which fail with the error +.B ENOMEM +upon exceeding this limit. +Also automatic stack expansion will fail +(and generate a +.B SIGSEGV +that kills the process if no alternate stack +has been made available via +.BR sigaltstack (2)). +Since the value is a \fIlong\fP, on machines with a 32-bit \fIlong\fP +either this limit is at most 2 GiB, or this resource is unlimited. +.TP +.B RLIMIT_CORE +Maximum size of +.I core +file. +When 0 no core dump files are created. +When nonzero, larger dumps are truncated to this size. +.TP +.B RLIMIT_CPU +CPU time limit in seconds. +When the process reaches the soft limit, it is sent a +.B SIGXCPU +signal. +The default action for this signal is to terminate the process. +However, the signal can be caught, and the handler can return control to +the main program. +If the process continues to consume CPU time, it will be sent +.B SIGXCPU +once per second until the hard limit is reached, at which time +it is sent +.BR SIGKILL . +(This latter point describes Linux 2.2 through 2.6 behavior. +Implementations vary in how they treat processes which continue to +consume CPU time after reaching the soft limit. +Portable applications that need to catch this signal should +perform an orderly termination upon first receipt of +.BR SIGXCPU .) +.TP +.B RLIMIT_DATA +The maximum size of the process's data segment (initialized data, +uninitialized data, and heap). +This limit affects calls to +.BR brk (2) +and +.BR sbrk (2), +which fail with the error +.B ENOMEM +upon encountering the soft limit of this resource. +.TP +.B RLIMIT_FSIZE +The maximum size of files that the process may create. +Attempts to extend a file beyond this limit result in delivery of a +.B SIGXFSZ +signal. +By default, this signal terminates a process, but a process can +catch this signal instead, in which case the relevant system call (e.g., +.BR write (2), +.BR truncate (2)) +fails with the error +.BR EFBIG . +.TP +.BR RLIMIT_LOCKS " (Early Linux 2.4 only)" +.\" to be precise: Linux 2.4.0-test9; no longer in 2.4.25 / 2.5.65 +A limit on the combined number of +.BR flock (2) +locks and +.BR fcntl (2) +leases that this process may establish. +.TP +.B RLIMIT_MEMLOCK +The maximum number of bytes of memory that may be locked +into RAM. +In effect this limit is rounded down to the nearest multiple +of the system page size. +This limit affects +.BR mlock (2) +and +.BR mlockall (2) +and the +.BR mmap (2) +.B MAP_LOCKED +operation. +Since Linux 2.6.9 it also affects the +.BR shmctl (2) +.B SHM_LOCK +operation, where it sets a maximum on the total bytes in +shared memory segments (see +.BR shmget (2)) +that may be locked by the real user ID of the calling process. +The +.BR shmctl (2) +.B SHM_LOCK +locks are accounted for separately from the per-process memory +locks established by +.BR mlock (2), +.BR mlockall (2), +and +.BR mmap (2) +.BR MAP_LOCKED ; +a process can lock bytes up to this limit in each of these +two categories. +In Linux kernels before 2.6.9, this limit controlled the amount of +memory that could be locked by a privileged process. +Since Linux 2.6.9, no limits are placed on the amount of memory +that a privileged process may lock, and this limit instead governs +the amount of memory that an unprivileged process may lock. +.TP +.BR RLIMIT_MSGQUEUE " (Since Linux 2.6.8)" +Specifies the limit on the number of bytes that can be allocated +for POSIX message queues for the real user ID of the calling process. +This limit is enforced for +.BR mq_open (3). +Each message queue that the user creates counts (until it is removed) +against this limit according to the formula: +.nf + + bytes = attr.mq_maxmsg * sizeof(struct msg_msg *) + + attr.mq_maxmsg * attr.mq_msgsize + +.fi +where +.I attr +is the +.I mq_attr +structure specified as the fourth argument to +.BR mq_open (3). + +The first addend in the formula, which includes +.I "sizeof(struct msg_msg *)" +(4 bytes on Linux/i386), ensures that the user cannot +create an unlimited number of zero-length messages (such messages +nevertheless each consume some system memory for bookkeeping overhead). +.TP +.BR RLIMIT_NICE " (since Linux 2.6.12, but see BUGS below)" +Specifies a ceiling to which the process's nice value can be raised using +.BR setpriority (2) +or +.BR nice (2). +The actual ceiling for the nice value is calculated as +.IR "20\ \-\ rlim_cur" . +(This strangeness occurs because negative numbers cannot be specified +as resource limit values, since they typically have special meanings. +For example, +.B RLIM_INFINITY +typically is the same as \-1.) +.TP +.B RLIMIT_NOFILE +Specifies a value one greater than the maximum file descriptor number +that can be opened by this process. +Attempts +.RB ( open (2), +.BR pipe (2), +.BR dup (2), +etc.) +to exceed this limit yield the error +.BR EMFILE . +(Historically, this limit was named +.B RLIMIT_OFILE +on BSD.) +.TP +.B RLIMIT_NPROC +The maximum number of processes (or, more precisely on Linux, threads) +that can be created for the real user ID of the calling process. +Upon encountering this limit, +.BR fork (2) +fails with the error +.BR EAGAIN . +.TP +.B RLIMIT_RSS +Specifies the limit (in pages) of the process's resident set +(the number of virtual pages resident in RAM). +This limit only has effect in Linux 2.4.x, x < 30, and there only +affects calls to +.BR madvise (2) +specifying +.BR MADV_WILLNEED . +.\" As at kernel 2.6.12, this limit still does nothing in 2.6 though +.\" talk of making it do something has surfaced from time to time in LKML +.\" -- MTK, Jul 05 +.TP +.BR RLIMIT_RTPRIO " (Since Linux 2.6.12, but see BUGS)" +Specifies a ceiling on the real-time priority that may be set for +this process using +.BR sched_setscheduler (2) +and +.BR sched_setparam (2). +.TP +.BR RLIMIT_RTTIME " (Since Linux 2.6.25)" +Specifies a limit on the amount of CPU time that a process scheduled +under a real-time scheduling policy may consume without making a blocking +system call. +For the purpose of this limit, +each time a process makes a blocking system call, +the count of its consumed CPU time is reset to zero. +The CPU time count is not reset if the process continues trying to +use the CPU but is preempted, its time slice expires, or it calls +.BR sched_yield (2). + +Upon reaching the soft limit, the process is sent a +.B SIGXCPU +signal. +If the process catches or ignores this signal and +continues consuming CPU time, then +.B SIGXCPU +will be generated once each second until the hard limit is reached, +at which point the process is sent a +.B SIGKILL +signal. + +The intended use of this limit is to stop a runaway +real-time process from locking up the system. +.TP +.BR RLIMIT_SIGPENDING " (Since Linux 2.6.8)" +Specifies the limit on the number of signals +that may be queued for the real user ID of the calling process. +Both standard and real-time signals are counted for the purpose of +checking this limit. +However, the limit is only enforced for +.BR sigqueue (2); +it is always possible to use +.BR kill (2) +to queue one instance of any of the signals that are not already +queued to the process. +.\" This replaces the /proc/sys/kernel/rtsig-max system-wide limit +.\" that was present in kernels <= 2.6.7. MTK Dec 04 +.TP +.B RLIMIT_STACK +The maximum size of the process stack, in bytes. +Upon reaching this limit, a +.B SIGSEGV +signal is generated. +To handle this signal, a process must employ an alternate signal stack +.RB ( sigaltstack (2)). + +Since Linux 2.6.23, +this limit also determines the amount of space used for the process's +command-line arguments and environment variables; for details, see +.BR execve (2). +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +.I rlim +points outside the accessible address space. +.TP +.B EINVAL +.I resource +is not valid; +or, for +.BR setrlimit (): +.I rlim\->rlim_cur +was greater than +.IR rlim\->rlim_max . +.TP +.B EPERM +An unprivileged process tried to use +.BR setrlimit () +to +increase a soft or hard limit above the current hard limit; the +.B CAP_SYS_RESOURCE +capability is required to do this. +Or, the process tried to use +.BR setrlimit () +to increase +the soft or hard +.B RLIMIT_NOFILE +limit above the current kernel +maximum +.RB ( NR_OPEN ). +.SH CONFORMING TO +SVr4, 4.3BSD, POSIX.1-2001. +.B RLIMIT_MEMLOCK +and +.B RLIMIT_NPROC +derive from BSD and are not specified in POSIX.1-2001; +they are present on the BSDs and Linux, but on few other implementations. +.B RLIMIT_RSS +derives from BSD and is not specified in POSIX.1-2001; +it is nevertheless present on most implementations. +.BR RLIMIT_MSGQUEUE , +.BR RLIMIT_NICE , +.BR RLIMIT_RTPRIO , +.BR RLIMIT_RTTIME , +and +.B RLIMIT_SIGPENDING +are Linux-specific. +.SH NOTES +A child process created via +.BR fork (2) +inherits its parent's resource limits. +Resource limits are preserved across +.BR execve (2). + +One can set the resource limits of the shell using the built-in +.IR ulimit +command +.RI ( limit +in +.BR csh (1)). +The shell's resource limits are inherited by the processes that +it creates to execute commands. +.SH BUGS +In older Linux kernels, the +.B SIGXCPU +and +.B SIGKILL +signals delivered when a process encountered the soft and hard +.B RLIMIT_CPU +limits were delivered one (CPU) second later than they should have been. +This was fixed in kernel 2.6.8. + +In 2.6.x kernels before 2.6.17, a +.B RLIMIT_CPU +limit of 0 is wrongly treated as "no limit" (like +.BR RLIM_INFINITY ). +Since Linux 2.6.17, setting a limit of 0 does have an effect, +but is actually treated as a limit of 1 second. +.\" see http://marc.theaimsgroup.com/?l=linux-kernel&m=114008066530167&w=2 + +A kernel bug means that +.B RLIMIT_RTPRIO +does not work in kernel 2.6.12; the problem is fixed in kernel 2.6.13. + +In kernel 2.6.12, there was an off-by-one mismatch +between the priority ranges returned by +.BR getpriority (2) +and +.BR RLIMIT_NICE . +This had the effect that actual ceiling for the nice value +was calculated as +.IR "19\ \-\ rlim_cur" . +This was fixed in kernel 2.6.13. +.\" see http://marc.theaimsgroup.com/?l=linux-kernel&m=112256338703880&w=2 + +Kernels before 2.4.22 did not diagnose the error +.B EINVAL +for +.BR setrlimit () +when +.I rlim\->rlim_cur +was greater than +.IR rlim\->rlim_max . +.SH "SEE ALSO" +.BR dup (2), +.BR fcntl (2), +.BR fork (2), +.BR getrusage (2), +.BR mlock (2), +.BR mmap (2), +.BR open (2), +.BR quotactl (2), +.BR sbrk (2), +.BR shmctl (2), +.BR sigqueue (2), +.BR malloc (3), +.BR ulimit (3), +.BR core (5), +.BR capabilities (7), +.BR signal (7) diff --git a/original/man2/getrusage.2 b/original/man2/getrusage.2 new file mode 100644 index 00000000..2771817b --- /dev/null +++ b/original/man2/getrusage.2 @@ -0,0 +1,172 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt, March 28, 1992 +.\" 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. +.\" +.\" 2004-11-16 -- mtk: the getrlimit.2 page, which formerly included +.\" coverage of getrusage(2), has been split, so that the latter is +.\" now covered in its own getrusage.2. For older details of change +.\" history, etc., see getrlimit.2 +.\" +.\" Modified 2004-11-16, mtk, Noted that the nonconformance +.\" when SIGCHLD is being ignored is fixed in 2.6.9. +.\" 2008-02-22, Sripathi Kodi : Document RUSAGE_THREAD +.\" 2008-05-25, mtk, clarify RUSAGE_CHILDREN + other clean-ups. +.\" +.TH GETRUSAGE 2 2009-08-25 "Linux" "Linux Programmer's Manual" +.SH NAME +getrusage \- get resource usage +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "int getrusage(int " who ", struct rusage *" usage ); +.SH DESCRIPTION +.PP +.BR getrusage () +returns resource usage measures for +.IR who , +which can be one of the following: +.TP +.B RUSAGE_SELF +Return resource usage statistics for the calling process, +which is the sum of resources used by all threads in the process. +.TP +.B RUSAGE_CHILDREN +Return resource usage statistics for all children of the +calling process that have terminated and been waited for. +These statistics will include the resources used by grandchildren, +and further removed descendants, +if all of the intervening descendants waited on their terminated children. +.TP +.BR RUSAGE_THREAD " (since Linux 2.6.26)" +Return resource usage statistics for the calling thread. +.PP +The resource usages are returned in the structure pointed to by +.IR usage , +which has the following form: +.PP +.in +4n +.nf +struct rusage { + struct timeval ru_utime; /* user time used */ + struct timeval ru_stime; /* system time used */ + long ru_maxrss; /* maximum resident set size */ + long ru_ixrss; /* integral shared memory size */ + long ru_idrss; /* integral unshared data size */ + long ru_isrss; /* integral unshared stack size */ + long ru_minflt; /* page reclaims */ + long ru_majflt; /* page faults */ + long ru_nswap; /* swaps */ + long ru_inblock; /* block input operations */ + long ru_oublock; /* block output operations */ + long ru_msgsnd; /* messages sent */ + long ru_msgrcv; /* messages received */ + long ru_nsignals; /* signals received */ + long ru_nvcsw; /* voluntary context switches */ + long ru_nivcsw; /* involuntary context switches */ +}; +.fi +.in +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +.I usage +points outside the accessible address space. +.TP +.B EINVAL +.I who +is invalid. +.SH "CONFORMING TO" +SVr4, 4.3BSD. +POSIX.1-2001 specifies +.BR getrusage (), +but only specifies the fields +.I ru_utime +and +.IR ru_stime . + +.B RUSAGE_THREAD +is Linux-specific. +.SH NOTES +Resource usage metrics are preserved across an +.BR execve (2). + +Including +.I +is not required these days, but increases portability. +(Indeed, +.I struct timeval +is defined in +.IR .) +.PP +In Linux kernel versions before 2.6.9, if the disposition of +.B SIGCHLD +is set to +.B SIG_IGN +then the resource usages of child processes +are automatically included in the value returned by +.BR RUSAGE_CHILDREN , +although POSIX.1-2001 explicitly prohibits this. +This nonconformance is rectified in Linux 2.6.9 and later. +.\" See the description of getrusage() in XSH. +.\" A similar statement was also in SUSv2. +.LP +The structure definition shown at the start of this page +was taken from 4.3BSD Reno. +Not all fields are meaningful under Linux. +In Linux 2.4 only the fields +.IR ru_utime , +.IR ru_stime , +.IR ru_minflt , +and +.I ru_majflt +are maintained. +Since Linux 2.6, +.I ru_nvcsw +and +.I ru_nivcsw +are also maintained. +Since Linux 2.6.22, +.I ru_inblock +and +.I ru_oublock +are also maintained. + +See also the description of +.IR /proc/PID/stat +in +.BR proc (5). +.SH "SEE ALSO" +.BR clock_gettime (2), +.BR getrlimit (2), +.BR times (2), +.BR wait (2), +.BR wait4 (2), +.BR clock (3) diff --git a/original/man2/getsid.2 b/original/man2/getsid.2 new file mode 100644 index 00000000..1ab39193 --- /dev/null +++ b/original/man2/getsid.2 @@ -0,0 +1,77 @@ +.\" Copyright (C) 1996 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. +.\" +.\" Modified Thu Oct 31 14:18:40 1996 by Eric S. Raymond +.\" Modified 2001-12-17, aeb +.TH GETSID 2 2008-12-05 "Linux" "Linux Programmer's Manual" +.SH NAME +getsid \- get session ID +.SH SYNOPSIS +.B #include +.sp +.BI "pid_t getsid(pid_t" " pid" ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR getsid (): +_XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +.I getsid(0) +returns the session ID of the calling process. +.I getsid(p) +returns the session ID of the process with process ID +.IR p . +(The session ID of a process is the process group ID of the +session leader.) +.SH RETURN VALUE +On success, a session ID is returned. +On error, \fI(pid_t)\ \-1\fP will be returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EPERM +A process with process ID +.I p +exists, but it is not in the same session as the calling process, +and the implementation considers this an error. +.TP +.B ESRCH +No process with process ID +.I p +was found. +.SH VERSIONS +This system call is available on Linux since version 2.0. +.\" Linux has this system call since Linux 1.3.44. +.\" There is libc support since libc 5.2.19. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.SH NOTES +Linux does not return +.BR EPERM . +.SH "SEE ALSO" +.BR getpgid (2), +.BR setsid (2), +.BR credentials (7) diff --git a/original/man2/getsockname.2 b/original/man2/getsockname.2 new file mode 100644 index 00000000..cab1bbed --- /dev/null +++ b/original/man2/getsockname.2 @@ -0,0 +1,116 @@ +.\" 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. +.\" +.\" @(#)getsockname.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 16:30:29 1993 by Rik Faith +.\" Modified Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond +.\" Modified Sun Mar 28 21:26:46 1999 by Andries Brouwer +.\" +.TH GETSOCKNAME 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH NAME +getsockname \- get socket name +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int getsockname(int " sockfd ", struct sockaddr *" addr \ +", socklen_t *" addrlen ); +.fi +.SH DESCRIPTION +.BR getsockname () +returns the current address to which the socket +.I sockfd +is bound, in the buffer pointed to by +.IR addr . +The +.I addrlen +argument should be initialized to indicate +the amount of space (in bytes) pointed to by +.IR addr . +On return it contains the actual size of the socket address. + +The returned address is truncated if the buffer provided is too small; +in this case, +.I addrlen +will return a value greater than was supplied to the call. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +The argument +.I sockfd +is not a valid descriptor. +.TP +.B EFAULT +The +.I addr +argument points to memory not in a valid part of the +process address space. +.TP +.B EINVAL +.I addrlen +is invalid (e.g., is negative). +.TP +.B ENOBUFS +Insufficient resources were available in the system +to perform the operation. +.TP +.B ENOTSOCK +The argument +.I sockfd +is a file, not a socket. +.SH "CONFORMING TO" +SVr4, 4.4BSD (the +.BR getsockname () +function call appeared in 4.2BSD), POSIX.1-2001. +.\" SVr4 documents additional ENOMEM +.\" and ENOSR error codes. +.SH NOTES +The third argument of +.BR getsockname () +is in reality an \fIint *\fP +(and this is what 4.x BSD and libc4 and libc5 have). +Some POSIX confusion resulted in the present \fIsocklen_t\fP, +also used by glibc. +See also +.BR accept (2). +.SH "SEE ALSO" +.BR bind (2), +.BR socket (2), +.BR getifaddrs (3), +.BR ip (7), +.BR socket (7), +.BR unix (7) diff --git a/original/man2/getsockopt.2 b/original/man2/getsockopt.2 new file mode 100644 index 00000000..d2922439 --- /dev/null +++ b/original/man2/getsockopt.2 @@ -0,0 +1,207 @@ +.\" 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. +.\" +.\" $Id: getsockopt.2,v 1.1 1999/05/24 14:57:04 freitag Exp $ +.\" +.\" Modified Sat Jul 24 16:19:32 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon Apr 22 02:29:06 1996 by Martin Schulze (joey@infodrom.north.de) +.\" Modified Tue Aug 27 10:52:51 1996 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Thu Jan 23 13:29:34 1997 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Sun Mar 28 21:26:46 1999 by Andries Brouwer (aeb@cwi.nl) +.\" Modified 1999 by Andi Kleen . +.\" Removed most stuff because it is in socket.7 now. +.\" +.TH GETSOCKOPT 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH NAME +getsockopt, setsockopt \- get and set options on sockets +.SH SYNOPSIS +.nf +.BR "#include " " /* See NOTES */" +.br +.B #include +.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 ); +.fi +.SH DESCRIPTION +.BR getsockopt () +and +.BR setsockopt () +manipulate options for the socket referred to by the file descriptor +.IR sockfd . +Options may exist at multiple +protocol levels; they are always present at the uppermost +socket level. + +When manipulating socket options, the level at which the +option resides and the name of the option must be specified. +To manipulate options at the sockets API level, +.I level +is specified as +.BR SOL_SOCKET . +To manipulate options at any +other level the protocol number of the appropriate protocol +controlling the option is supplied. +For example, +to indicate that an option is to be interpreted by the +.B TCP +protocol, +.I level +should be set to the protocol number of +.BR TCP ; +see +.BR getprotoent (3). + +The arguments +.I optval +and +.I optlen +are used to access option values for +.BR setsockopt (). +For +.BR getsockopt () +they identify a buffer in which the value for the +requested option(s) are to be returned. +For +.BR getsockopt (), +.I optlen +is a value-result argument, initially containing the +size of the buffer pointed to by +.IR optval , +and modified on return to indicate the actual size of +the value returned. +If no option value is to be supplied or returned, +.I optval +may be NULL. + +.I Optname +and any specified options are passed uninterpreted to the appropriate +protocol module for interpretation. +The include file +.I +contains definitions for socket level options, described below. +Options at +other protocol levels vary in format and name; consult the appropriate +entries in section 4 of the manual. + +Most socket-level options utilize an +.I int +argument for +.IR optval . +For +.BR setsockopt (), +the argument should be nonzero to enable a boolean option, or zero if the +option is to be disabled. +.PP +For a description of the available socket options see +.BR socket (7) +and the appropriate protocol man pages. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP 10 +.B EBADF +The argument +.I sockfd +is not a valid descriptor. +.TP +.B EFAULT +The address pointed to by +.I optval +is not in a valid part of the process address space. +For +.BR getsockopt (), +this error may also be returned if +.I optlen +is not in a valid part of the process address space. +.TP +.B EINVAL +.I optlen +invalid in +.BR setsockopt (). +In some cases this error can also occur for an invalid value in +.IR optval +(e.g., for the +.B IP_ADD_MEMBERSHIP +option described in +.BR ip (7)). +.TP +.B ENOPROTOOPT +The option is unknown at the level indicated. +.TP +.B ENOTSOCK +The argument +.I sockfd +is a file, not a socket. +.SH "CONFORMING TO" +SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), +POSIX.1-2001. +.\" SVr4 documents additional ENOMEM and ENOSR error codes, but does +.\" not document the +.\" .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO +.\" options +.SH NOTES +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. + +The +.I optlen +argument of +.BR getsockopt () +and +.BR setsockopt () +is in reality an +.I "int [*]" +(and this is what 4.x BSD and libc4 and libc5 have). +Some POSIX confusion resulted in the present +.IR socklen_t , +also used by glibc. +See also +.BR accept (2). +.SH BUGS +Several of the socket options should be handled at lower levels of the +system. +.SH "SEE ALSO" +.BR ioctl (2), +.BR socket (2), +.BR getprotoent (3), +.BR protocols (5), +.BR socket (7), +.BR tcp (7), +.BR unix (7) diff --git a/original/man2/gettid.2 b/original/man2/gettid.2 new file mode 100644 index 00000000..4b1afc5e --- /dev/null +++ b/original/man2/gettid.2 @@ -0,0 +1,71 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 2003 Abhijit Menon-Sen +.\" 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. +.\" +.TH GETTID 2 2008-04-14 "Linux" "Linux Programmer's Manual" +.SH NAME +gettid \- get thread identification +.SH SYNOPSIS +.nf +.B #include +.sp +.B pid_t gettid(void); +.fi +.SH DESCRIPTION +.BR gettid () +returns the caller's thread ID (TID). +In a single-threaded process, the thread ID +is equal to the process ID (PID, as returned by +.BR getpid (2)). +In a multithreaded process, all threads +have the same PID, but each one has a unique TID. +For further details, see the discussion of +.BR CLONE_THREAD +in +.BR clone (2). +.SH "RETURN VALUE" +On success, returns the thread ID of the calling process. +.SH ERRORS +This call is always successful. +.SH VERSIONS +The +.BR gettid () +system call first appeared on Linux in kernel 2.4.11. +.SH "CONFORMING TO" +.BR gettid () +is Linux-specific and should not be used in programs that +are intended to be portable. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). +.\" See http://sourceware.org/bugzilla/show_bug.cgi?id=6399 +.\" "gettid() should have a wrapper" + +The thread ID returned by this call is not the same thing as a +POSIX thread ID (i.e., the opaque value returned by +.BR pthread_self (3)). +.SH "SEE ALSO" +.BR clone (2), +.BR fork (2), +.BR getpid (2) diff --git a/original/man2/gettimeofday.2 b/original/man2/gettimeofday.2 new file mode 100644 index 00000000..817d8fa7 --- /dev/null +++ b/original/man2/gettimeofday.2 @@ -0,0 +1,240 @@ +.\" 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. +.\" +.TH GETTIMEOFDAY 2 2009-03-25 "Linux" "Linux Programmer's Manual" +.SH NAME +gettimeofday, settimeofday \- get / set time +.SH SYNOPSIS +.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 +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR settimeofday (): +_BSD_SOURCE +.SH DESCRIPTION +The functions +.BR gettimeofday () +and +.BR settimeofday () +can get and set the time as well as a timezone. +The +.I tv +argument is a +.I struct timeval +(as specified in +.IR ): +.sp +.in +4n +.nf +struct timeval { + time_t tv_sec; /* seconds */ + suseconds_t tv_usec; /* microseconds */ +}; +.fi +.in +.sp +and gives the number of seconds and microseconds since the Epoch (see +.BR time (2)). +The +.I tz +argument is a +.IR "struct timezone" : +.sp +.in +4n +.nf +struct timezone { + int tz_minuteswest; /* minutes west of Greenwich */ + int tz_dsttime; /* type of DST correction */ +}; +.fi +.in +.PP +If either +.I tv +or +.I tz +is NULL, the corresponding structure is not set or returned. +.\" The following is covered under EPERM below: +.\" .PP +.\" Only the superuser may use +.\" .BR settimeofday (). +.PP +The use of the +.I timezone +structure is obsolete; the +.I tz +argument should normally be specified as NULL. +The +.I tz_dsttime +field has never been used under Linux; it has not +been and will not be supported by libc or glibc. +Each and every occurrence of this field in the kernel source +(other than the declaration) is a bug. +Thus, the following +is purely of historic interest. + +The field +.I tz_dsttime +contains a symbolic constant (values are given below) +that indicates in which part of the year Daylight Saving Time +is in force. +(Note: its value is constant throughout the year: +it does not indicate that DST is in force, it just selects an +algorithm.) +The daylight saving time algorithms defined are as follows : +.in +4n +.nf + +\fBDST_NONE\fP /* not on dst */ +.br +\fBDST_USA\fP /* USA style dst */ +.br +\fBDST_AUST\fP /* Australian style dst */ +.br +\fBDST_WET\fP /* Western European dst */ +.br +\fBDST_MET\fP /* Middle European dst */ +.br +\fBDST_EET\fP /* Eastern European dst */ +.br +\fBDST_CAN\fP /* Canada */ +.br +\fBDST_GB\fP /* Great Britain and Eire */ +.br +\fBDST_RUM\fP /* Rumania */ +.br +\fBDST_TUR\fP /* Turkey */ +.br +\fBDST_AUSTALT\fP /* Australian style with shift in 1986 */ +.fi +.in +.PP +Of course it turned out that the period in which +Daylight Saving Time is in force cannot be given +by a simple algorithm, one per country; indeed, +this period is determined by unpredictable political +decisions. +So this method of representing timezones +has been abandoned. +Under Linux, in a call to +.BR settimeofday () +the +.I tz_dsttime +field should be zero. +.PP +Under Linux there are some peculiar "warp clock" semantics associated +with the +.BR settimeofday () +system call if on the very first call (after booting) +that has a non-NULL +.I tz +argument, the +.I tv +argument is NULL and the +.I tz_minuteswest +field is nonzero. +In such a case it is assumed that the CMOS clock +is on local time, and that it has to be incremented by this amount +to get UTC system time. +No doubt it is a bad idea to use this feature. +.PP +Macros for operating on +.I timeval +structures are described in +.BR timeradd (3). +.SH "RETURN VALUE" +.BR gettimeofday () +and +.BR settimeofday () +return 0 for success, or \-1 for failure (in which case +.I errno +is set appropriately). +.SH ERRORS +.TP +.B EFAULT +One of +.I tv +or +.I tz +pointed outside the accessible address space. +.TP +.B EINVAL +Timezone (or something else) is invalid. +.TP +.B EPERM +The calling process has insufficient privilege to call +.BR settimeofday (); +under Linux the +.B CAP_SYS_TIME +capability is required. +.SH "CONFORMING TO" +SVr4, 4.3BSD. +POSIX.1-2001 describes +.BR gettimeofday () +but not +.BR settimeofday (). +POSIX.1-2008 marks +.BR gettimeofday () +as obsolete, recomending the use of +.BR clock_gettime (2) +instead. +.SH NOTES +.LP +Traditionally, the fields of +.I struct timeval +were of type +.IR long . +.SH "SEE ALSO" +.BR date (1), +.BR adjtimex (2), +.BR time (2), +.BR ctime (3), +.BR ftime (3), +.BR capabilities (7), +.BR time (7) diff --git a/original/man2/getuid.2 b/original/man2/getuid.2 new file mode 100644 index 00000000..3c7edb7c --- /dev/null +++ b/original/man2/getuid.2 @@ -0,0 +1,61 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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. +.\" +.\" Historical remark, aeb, 2004-06-05 +.TH GETUID 2 1993-07-23 "Linux" "Linux Programmer's Manual" +.SH NAME +getuid, geteuid \- get user identity +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.B uid_t getuid(void); +.br +.B uid_t geteuid(void); +.SH DESCRIPTION +.BR getuid () +returns the real user ID of the calling process. + +.BR geteuid () +returns the effective user ID of the calling process. +.SH ERRORS +These functions are always successful. +.SH "CONFORMING TO" +POSIX.1-2001, 4.3BSD. +.SH NOTES +.SS History +In Unix V6 the +.BR getuid () +call returned +.IR "(euid << 8) + uid" . +Unix V7 introduced separate calls +.BR getuid () +and +.BR geteuid (). +.SH "SEE ALSO" +.BR getresuid (2), +.BR setreuid (2), +.BR setuid (2), +.BR credentials (7) diff --git a/original/man2/getuid32.2 b/original/man2/getuid32.2 new file mode 100644 index 00000000..165cfe1d --- /dev/null +++ b/original/man2/getuid32.2 @@ -0,0 +1 @@ +.so man2/getuid.2 diff --git a/original/man2/getxattr.2 b/original/man2/getxattr.2 new file mode 100644 index 00000000..86dfc891 --- /dev/null +++ b/original/man2/getxattr.2 @@ -0,0 +1,152 @@ +.\" +.\" Extended attributes system calls manual pages +.\" +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" 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. +.\" +.TH GETXATTR 2 2001-12-01 "Linux" "Linux Programmer's Manual" +.SH NAME +getxattr, lgetxattr, fgetxattr \- retrieve an extended attribute value +.SH SYNOPSIS +.fam C +.nf +.B #include +.B #include +.sp +.BI "ssize_t getxattr(const char\ *" path ", const char\ *" name , +.BI " void\ *" value ", size_t " size ); +.BI "ssize_t lgetxattr(const char\ *" path ", const char\ *" name , +.BI " void\ *" value ", size_t " size ); +.BI "ssize_t fgetxattr(int " fd ", const char\ *" name , +.BI " void\ *" value ", size_t " size ); +.fi +.fam T +.SH DESCRIPTION +Extended attributes are +.IR name :\c +.I value +pairs associated with inodes (files, directories, symbolic links, etc.). +They are extensions to the normal attributes which are associated +with all inodes in the system (i.e., the +.BR stat (2) +data). +A complete overview of extended attributes concepts can be found in +.BR attr (5). +.PP +.BR getxattr () +retrieves the +.I value +of the extended attribute identified by +.I name +and associated with the given +.I path +in the file system. +The length of the attribute +.I value +is returned. +.PP +.BR lgetxattr () +is identical to +.BR getxattr (), +except in the case of a symbolic link, where the link itself is +interrogated, not the file that it refers to. +.PP +.BR fgetxattr () +is identical to +.BR getxattr (), +only the open file referred to by +.I fd +(as returned by +.BR open (2)) +is interrogated in place of +.IR path . +.PP +An extended attribute +.I name +is a simple null-terminated string. +The name includes a namespace prefix; there may be several, disjoint +namespaces associated with an individual inode. +The value of an extended attribute is a chunk of arbitrary textual or +binary data of specified length. +.PP +An empty buffer of +.I size +zero can be passed into these calls to return the current size of the +named extended attribute, which can be used to estimate the size of a +buffer which is sufficiently large to hold the value associated with +the extended attribute. +.PP +The interface is designed to allow guessing of initial buffer +sizes, and to enlarge buffers when the return value indicates +that the buffer provided was too small. +.SH RETURN VALUE +On success, a positive number is returned indicating the size of the +extended attribute value. +On failure, \-1 is returned and +.I errno +is set appropriately. +.PP +If the named attribute does not exist, or the process has no access to +this attribute, +.I errno +is set to +.BR ENOATTR . +.PP +If the +.I size +of the +.I value +buffer is too small to hold the result, +.I errno +is set to +.BR ERANGE . +.PP +If extended attributes are not supported by the file system, or are disabled, +.I errno +is set to +.BR ENOTSUP . +.PP +The errors documented for the +.BR stat (2) +system call are also applicable here. +.SH VERSIONS +These system calls have been available on Linux since kernel 2.4; +glibc support is provided since version 2.3. +.SH "CONFORMING TO" +These system calls are Linux-specific. +.\" .SH AUTHORS +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" and the SGI XFS development team, +.\" .RI < linux-xfs@oss.sgi.com >. +.\" Please send any bug reports or comments to these addresses. +.SH SEE ALSO +.BR getfattr (1), +.BR setfattr (1), +.BR listxattr (2), +.BR open (2), +.BR removexattr (2), +.BR setxattr (2), +.BR stat (2), +.BR attr (5), +.BR symlink (7) diff --git a/original/man2/gtty.2 b/original/man2/gtty.2 new file mode 100644 index 00000000..5d25ea6c --- /dev/null +++ b/original/man2/gtty.2 @@ -0,0 +1 @@ +.so man2/unimplemented.2 diff --git a/original/man2/idle.2 b/original/man2/idle.2 new file mode 100644 index 00000000..6cfe3e1f --- /dev/null +++ b/original/man2/idle.2 @@ -0,0 +1,63 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from linux/mm/swap.c: +.\" Copyright (C) 1991, 1992 Linus Torvalds +.\" +.\" 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 : +.\" Added text about calling restriction (new in kernel 1.1.20 I believe). +.\" N.B. calling "idle" from user process used to hang process! +.\" Modified Thu Oct 31 14:41:15 1996 by Eric S. Raymond +.\" " +.TH IDLE 2 1994-08-21 "Linux" "Linux Programmer's Manual" +.SH NAME +idle \- make process 0 idle +.SH SYNOPSIS +.B #include +.sp +.B int idle(void); +.SH DESCRIPTION +.BR idle () +is an internal system call used during bootstrap. +It marks the process's pages as swappable, lowers its priority, +and enters the main scheduling loop. +.BR idle () +never returns. +.PP +Only process 0 may call +.BR idle (). +Any user process, even a process with superuser permission, +will receive +.BR EPERM . +.SH "RETURN VALUE" +.BR idle () +never returns for process 0, and always returns \-1 for a user process. +.SH ERRORS +.TP +.B EPERM +Always, for a user process. +.SH VERSIONS +Since 2.3.13 this system call does not exist anymore. +.SH "CONFORMING TO" +This function is Linux-specific, and should not be used in programs +intended to be portable. diff --git a/original/man2/inb.2 b/original/man2/inb.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/inb.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/inb_p.2 b/original/man2/inb_p.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/inb_p.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/init_module.2 b/original/man2/init_module.2 new file mode 100644 index 00000000..d324b51f --- /dev/null +++ b/original/man2/init_module.2 @@ -0,0 +1,102 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.TH INIT_MODULE 2 2006-02-09 "Linux" "Linux Programmer's Manual" +.SH NAME +init_module \- initialize a loadable module entry +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int init_module(const char *" name ", struct module *" image ); +.fi +.SH DESCRIPTION +.BR init_module () +loads the relocated module image into kernel space and runs the +module's +.I init +function. +.PP +The module image begins with a module structure and is followed by +code and data as appropriate. +The module structure is defined as follows: +.PP +.in +4n +.nf +struct module { + unsigned long size_of_struct; + struct module *next; + const char *name; + unsigned long size; + long usecount; + unsigned long flags; + unsigned int nsyms; + unsigned int ndeps; + struct module_symbol *syms; + struct module_ref *deps; + struct module_ref *refs; + int (*init)(void); + void (*cleanup)(void); + const struct exception_table_entry *ex_table_start; + const struct exception_table_entry *ex_table_end; +#ifdef __alpha__ + unsigned long gp; +#endif +}; +.fi +.in +.PP +All of the pointer fields, with the exception of +.I next +and +.IR refs , +are expected to point within the module body and be +initialized as appropriate for kernel space, that is, relocated with +the rest of the module. +.PP +This system call requires privilege. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBUSY +The module's initialization routine failed. +.TP +.B EFAULT +.I name +or +.I image +is outside the program's accessible address space. +.TP +.B EINVAL +Some +.I image +slot is filled in incorrectly, +.I image\->name +does not correspond to the original module name, some +.I image\->deps +entry does not correspond to a loaded module, +or some other similar inconsistency. +.TP +.B ENOENT +No module by that name exists. +.TP +.B EPERM +The caller was not privileged +(did not have the +.B CAP_SYS_MODULE +capability). +.SH "CONFORMING TO" +.BR init_module () +is Linux-specific. +.SH "SEE ALSO" +.BR create_module (2), +.BR delete_module (2), +.BR query_module (2) diff --git a/original/man2/inl.2 b/original/man2/inl.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/inl.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/inl_p.2 b/original/man2/inl_p.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/inl_p.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/inotify_add_watch.2 b/original/man2/inotify_add_watch.2 new file mode 100644 index 00000000..3b75a744 --- /dev/null +++ b/original/man2/inotify_add_watch.2 @@ -0,0 +1,117 @@ +.\" man2/inotify_add_watch.2 - inotify_add_watch man page +.\" +.\" Copyright (C) 2005 Robert Love +.\" and Copyright, 2006 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. +.\" +.\" 2005-07-19 Robert Love - initial version +.\" 2006-02-07 mtk, various changes +.\" +.TH INOTIFY_ADD_WATCH 2 2006-02-07 "Linux" "Linux Programmer's Manual" +.SH NAME +inotify_add_watch \- add a watch to an initialized inotify instance +.SH SYNOPSIS +.B #include +.sp +.BI "int inotify_add_watch(int " fd ", const char *" pathname ", uint32_t " mask ); +.SH DESCRIPTION +.BR inotify_add_watch () +adds a new watch, or modifies an existing watch, +for the file whose location is specified in +.IR pathname ; +the caller must have read permission for this file. +The +.I fd +argument is a file descriptor referring to the +inotify instance whose watch list is to be modified. +The events to be monitored for +.I pathname +are specified in the +.I mask +bit-mask argument. +See +.BR inotify (7) +for a description of the bits that can be set in +.IR mask . + +A successful call to +.BR inotify_add_watch () +returns the unique watch descriptor associated with +.I pathname +for this inotify instance. +If +.I pathname +was not previously being watched by this inotify instance, +then the watch descriptor is newly allocated. +If +.I pathname +was already being watched, then the descriptor +for the existing watch is returned. + +The watch descriptor is returned by later +.BR read (2)s +from the inotify file descriptor. +These reads fetch +.I inotify_event +structures (see +.BR inotify (7)) +indicating file system events; +the watch descriptor inside this structure identifies +the object for which the event occurred. +.SH "RETURN VALUE" +On success, +.BR inotify_add_watch () +returns a nonnegative watch descriptor. +On error \-1 is returned and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +Read access to the given file is not permitted. +.TP +.B EBADF +The given file descriptor is not valid. +.TP +.B EFAULT +.I pathname +points outside of the process's accessible address space. +.TP +.B EINVAL +The given event mask contains no valid events; or +.I fd +is not an inotify file descriptor. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOSPC +The user limit on the total number of inotify watches was reached or the +kernel failed to allocate a needed resource. +.SH VERSIONS +Inotify was merged into the 2.6.13 Linux kernel. +.SH "CONFORMING TO" +This system call is Linux-specific. +.SH "SEE ALSO" +.BR inotify_init (2), +.BR inotify_rm_watch (2), +.BR inotify (7) diff --git a/original/man2/inotify_init.2 b/original/man2/inotify_init.2 new file mode 100644 index 00000000..99ae5cdf --- /dev/null +++ b/original/man2/inotify_init.2 @@ -0,0 +1,101 @@ +.\" man2/inotify_init.2 - inotify_init man page +.\" +.\" Copyright (C) 2005 Robert Love +.\" +.\" 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. +.\" +.\" 2005-07-19 Robert Love - initial version +.\" 2006-02-07 mtk, minor changes +.\" 2008-10-10 mtk: add description of inotify_init1() +.\" +.TH INOTIFY_INIT 2 2008-10-10 "Linux" "Linux Programmer's Manual" +.SH NAME +inotify_init, inotify_init1 \- initialize an inotify instance +.SH SYNOPSIS +.nf +.B #include +.sp +.B "int inotify_init(void);" +.BI "int inotify_init1(int " flags ); +.fi +.SH DESCRIPTION +.BR inotify_init () +initializes a new inotify instance and returns a file descriptor associated +with a new inotify event queue. + +If +.I flags +is 0, then +.BR inotify_init1 () +is the same as +.BR inotify_init (). +The following values can be bitwise ORed in +.IR flags +to obtain different behavior: +.TP 12 +.B IN_NONBLOCK +Set the +.BR O_NONBLOCK +file status flag on the new open file description. +Using this flag saves extra calls to +.BR fcntl (2) +to achieve the same result. +.TP +.B IN_CLOEXEC +Set the close-on-exec +.RB ( FD_CLOEXEC ) +flag on the new file descriptor. +See the description of the +.B O_CLOEXEC +flag in +.BR open (2) +for reasons why this may be useful. +.SH "RETURN VALUE" +On success, these system calls return a new file descriptor. +On error, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +.RB ( inotify_init1 ()) +An invalid value was specified in +.IR flags . +.TP +.B EMFILE +The user limit on the total number of inotify instances has been reached. +.TP +.B ENFILE +The system limit on the total number of file descriptors has been reached. +.TP +.B ENOMEM +Insufficient kernel memory is available. +.SH VERSIONS +.BR inotify_init () +first appeared in Linux 2.6.13. +.BR inotify_init1 () +was added in Linux 2.6.27. +.SH "CONFORMING TO" +These system calls are Linux-specific. +.SH "SEE ALSO" +.BR inotify_add_watch (2), +.BR inotify_rm_watch (2), +.BR inotify (7) diff --git a/original/man2/inotify_init1.2 b/original/man2/inotify_init1.2 new file mode 100644 index 00000000..62c5b44e --- /dev/null +++ b/original/man2/inotify_init1.2 @@ -0,0 +1 @@ +.so man2/inotify_init.2 diff --git a/original/man2/inotify_rm_watch.2 b/original/man2/inotify_rm_watch.2 new file mode 100644 index 00000000..2119b005 --- /dev/null +++ b/original/man2/inotify_rm_watch.2 @@ -0,0 +1,76 @@ +.\" man2/inotify_rm_watch.2 - inotify_rm_watch man page +.\" +.\" Copyright (C) 2005 Robert Love +.\" +.\" 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. +.\" +.\" 2005-07-19 Robert Love - initial version +.\" 2006-02-07 mtk, minor changes +.\" +.TH INOTIFY_RM_WATCH 2 2006-02-07 "Linux" "Linux Programmer's Manual" +.SH NAME +inotify_rm_watch \- remove an existing watch from an inotify instance +.SH SYNOPSIS +.B #include +.sp +.BI "int inotify_rm_watch(int " fd ", uint32_t " wd ); +.\" FIXME . The type of the second argument should probably be "int". +.\" 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 +.SH DESCRIPTION +.BR inotify_rm_watch () +removes the watch associated with the watch descriptor +.I wd +from the inotify instance associated with the file descriptor +.IR fd . + +Removing a watch causes an +.B IN_IGNORED +event to be generated for this watch descriptor. +(See +.BR inotify (7).) +.SH "RETURN VALUE" +On success, +.BR inotify_rm_watch () +returns zero, or \-1 if an error occurred (in which case, +.I errno +is set appropriately). +.SH ERRORS +.TP +.B EBADF +.I fd +is not a valid file descriptor. +.TP +.B EINVAL +The watch descriptor +.I wd +is not valid; or +.I fd +is not an inotify file descriptor. +.SH VERSIONS +Inotify was merged into the 2.6.13 Linux kernel. +.SH "CONFORMING TO" +This system call is Linux-specific. +.SH "SEE ALSO" +.BR inotify_add_watch (2), +.BR inotify_init (2), +.BR inotify (7) diff --git a/original/man2/insb.2 b/original/man2/insb.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/insb.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/insl.2 b/original/man2/insl.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/insl.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/insw.2 b/original/man2/insw.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/insw.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/intro.2 b/original/man2/intro.2 new file mode 100644 index 00000000..10cf9163 --- /dev/null +++ b/original/man2/intro.2 @@ -0,0 +1,89 @@ +.\" 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. +.\" +.\" 2007-10-23 mtk: moved the _syscallN specific material to the +.\" new _syscall(2) page, and substantially enhanced and rewrote +.\" the remaining material on this page. +.\" +.TH INTRO 2 2010-02-03 "Linux" "Linux Programmer's Manual" +.SH NAME +intro \- Introduction to system calls +.SH DESCRIPTION +Section 2 of the manual describes the Linux system calls. +A system call is an entry point into the Linux kernel. +Usually, system calls are not invoked directly: +instead, most system calls have corresponding C library +wrapper functions which perform the steps required +(e.g., trapping to kernel mode) in order to invoke +the system call. +Thus, making a system call looks the same as invoking a normal +library function. + +For a list of the Linux system calls, see +.BR syscalls (2). +.SH RETURN VALUE +On error, most system calls return a negative error number +(i.e., the negated value of one of the constants described in +.BR errno (3)). +The C library wrapper hides this detail from the caller: when a +system call returns a negative value, the wrapper copies the +absolute value into the +.I errno +variable, and returns \-1 as the return value of the wrapper. + +The value returned by a successful system call depends on the call. +Many system calls return 0 on success, but some can return nonzero +values from a successful call. +The details are described in the individual manual pages. + +In some cases, +the programmer must define a feature test macro in order to obtain +the declaration of a system call from the header file specified +in the man page SYNOPSIS section. +In such cases, the required macro is described in the man page. +For further information on feature test macros, see +.BR feature_test_macros (7). +.SH "CONFORMING TO" +Certain terms and abbreviations are used to indicate Unix variants +and standards to which calls in this section conform. +See +.BR standards (7). +.SH NOTES +.SS "Calling Directly" +In most cases, it is unnecessary to invoke a system call directly, +but there are times when the Standard C library does not implement +a nice wrapper function for you. +In this case, the programmer must manually invoke the system call using +.BR syscall (2). +Historically, this was also possible using one of the _syscall macros +described in +.BR _syscall (2). +.SS Authors and Copyright Conditions +Look at the header of the manual page source for the author(s) and copyright +conditions. +Note that these can be different from page to page! +.SH "SEE ALSO" +.BR _syscall (2), +.BR syscall (2), +.BR errno (3), +.BR feature_test_macros (7), +.BR standards (7) diff --git a/original/man2/inw.2 b/original/man2/inw.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/inw.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/inw_p.2 b/original/man2/inw_p.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/inw_p.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/io_cancel.2 b/original/man2/io_cancel.2 new file mode 100644 index 00000000..d7b56ac3 --- /dev/null +++ b/original/man2/io_cancel.2 @@ -0,0 +1,105 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" .de Sh \" Subsection +.\" .br +.\" .if t .Sp +.\" .ne 5 +.\" .PP +.\" \fB\\$1\fP +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .IP "\\$1" \\$2 +.\" .. +.TH IO_CANCEL 2 2008-06-18 "Linux" "Linux Programmer's Manual" +.SH NAME +io_cancel \- cancel an outstanding asynchronous I/O operation +.SH "SYNOPSIS" +.nf +.\" .ad l +.\" .hy 0 +.\" +.B #include +.\"#include +.sp +.\" .HP 16 +.BI "int io_cancel(aio_context_t " ctx_id ", struct iocb *" iocb , +.BI " struct io_event *" result ); +.\" .ad +.\" .hy +.sp +Link with \fI\-laio\fP. +.fi +.SH "DESCRIPTION" +.PP +.BR io_cancel () +attempts to cancel an asynchronous I/O operation previously submitted with +.BR io_submit (2). +\fIctx_id\fP is the AIO context ID of the operation to be canceled. +If the AIO context is found, the event will be canceled and then copied +into the memory pointed to by \fIresult\fP without being placed +into the completion queue. +.SH "RETURN VALUE" +On success, +.BR io_cancel () +returns 0. +For the failure return, see NOTES. +.SH "ERRORS" +.TP +.B EAGAIN +The \fIiocb\fP specified was not canceled. +.TP +.B EFAULT +One of the data structures points to invalid data. +.TP +.B EINVAL +The AIO context specified by \fIctx_id\fP is invalid. +.TP +.B ENOSYS +.BR io_cancel () +is not implemented on this architecture. +.SH "VERSIONS" +.PP +The asynchronous I/O system calls first appeared in Linux 2.5, August 2002. +.SH "CONFORMING TO" +.PP +.BR io_cancel () +is Linux-specific and should not be used +in programs that are intended to be portable. +.SH NOTES +Glibc does not provide a wrapper function for this system call. + +The wrapper provided in +.I libaio +for +.BR io_cancel () +does not follow the usual C library conventions for indicating error: +on error it returns a negated error number +(the negative of one of the values listed in ERRORS). +If the system call is invoked via +.BR syscall (2), +then the return value follows the usual conventions for +indicating an error: \-1, with +.I errno +set to a (positive) value that indicates the error. +.SH "SEE ALSO" +.BR io_destroy (2), +.BR io_getevents (2), +.BR io_setup (2), +.BR io_submit (2) +.\" .SH "NOTES" +.\" +.\" .PP +.\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" +.\" .SH AUTHOR +.\" Kent Yoder. diff --git a/original/man2/io_destroy.2 b/original/man2/io_destroy.2 new file mode 100644 index 00000000..d7e5361b --- /dev/null +++ b/original/man2/io_destroy.2 @@ -0,0 +1,99 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" .de Sh \" Subsection +.\" .br +.\" .if t .Sp +.\" .ne 5 +.\" .PP +.\" \fB\\$1\fP +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .IP "\\$1" \\$2 +.\" .. +.TH IO_DESTROY 2 2008-06-18 "Linux" "Linux Programmer's Manual" +.SH NAME +io_destroy \- destroy an asynchronous I/O context +.SH "SYNOPSIS" +.nf +.\" .ad l +.\" .hy 0 +.B #include +.\" #include +.sp +.\" .HP 17 +.BI "int io_destroy(aio_context_t " ctx ); +.\" .ad +.\" .hy +.sp +Link with \fI\-laio\fP. +.fi +.SH "DESCRIPTION" +.PP +.BR io_destroy () +removes the asynchronous I/O context from the list of +I/O contexts and then destroys it. +.BR io_destroy () +can also cancel any outstanding asynchronous I/O +actions on \fIctx\fP and block on completion. +.SH "RETURN VALUE" +On success, +.BR io_destroy () +returns 0. +For the failure return, see NOTES. +.SH "ERRORS" +.TP +.B EFAULT +The context pointed to is invalid. +.TP +.B EINVAL +The AIO context specified by \fIctx\fP is invalid. +.TP +.B ENOSYS +.BR io_destroy () +is not implemented on this architecture. +.SH "VERSIONS" +.PP +The asynchronous I/O system calls first appeared in Linux 2.5, August 2002. +.SH "CONFORMING TO" +.PP +.BR io_destroy () +is Linux-specific and should not be used in programs +that are intended to be portable. +.SH NOTES +Glibc does not provide a wrapper function for this system call. + +The wrapper provided in +.I libaio +for +.BR io_destroy () +does not follow the usual C library conventions for indicating error: +on error it returns a negated error number +(the negative of one of the values listed in ERRORS). +If the system call is invoked via +.BR syscall (2), +then the return value follows the usual conventions for +indicating an error: \-1, with +.I errno +set to a (positive) value that indicates the error. +.SH "SEE ALSO" +.BR io_cancel (2), +.BR io_getevents (2), +.BR io_setup (2), +.BR io_submit (2) +.\" .SH "NOTES" +.\" +.\" .PP +.\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" +.\" .SH AUTHOR +.\" Kent Yoder. diff --git a/original/man2/io_getevents.2 b/original/man2/io_getevents.2 new file mode 100644 index 00000000..d6a0ac37 --- /dev/null +++ b/original/man2/io_getevents.2 @@ -0,0 +1,114 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" .de Sh \" Subsection +.\" .br +.\" .if t .Sp +.\" .ne 5 +.\" .PP +.\" \fB\\$1\fP +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .IP "\\$1" \\$2 +.\" .. +.TH IO_GETEVENTS 2 2008-07-04 "Linux" "Linux Programmer's Manual" +.SH NAME +io_getevents \- read asynchronous I/O events from the completion queue +.SH "SYNOPSIS" +.nf +.\" .ad l +.\" .hy 0 +.B #include +.B #include +.\" #include +.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 +.sp +Link with \fI\-laio\fP. +.fi +.SH "DESCRIPTION" +.PP +.BR io_getevents () +attempts to read at least \fImin_nr\fP events and +up to \fInr\fP events from the completion queue of the AIO context +specified by \fIctx_id\fP. +\fItimeout\fP specifies the amount of time to wait for events, +where a NULL timeout waits until at least \fImin_nr\fP events +have been seen. +Note that \fItimeout\fP is relative and will be updated if not NULL +and the operation blocks. +.SH "RETURN VALUE" +On success, +.BR io_getevents () +returns the number of events read: 0 if no events are +available, or less than \fImin_nr\fP if the \fItimeout\fP has elapsed. +For the failure return, see NOTES. +.SH "ERRORS" +.TP +.B EFAULT +Either \fIevents\fP or \fItimeout\fP is an invalid pointer. +.TP +.B EINVAL +\fIctx_id\fP is invalid. +\fImin_nr\fP is out of range or \fInr\fP is +out of range. +.TP +.B EINTR +Interrupted by a signal handler; see +.BR signal (7). +.TP +.B ENOSYS +.BR io_getevents () +is not implemented on this architecture. +.SH "VERSIONS" +.PP +The asynchronous I/O system calls first appeared in Linux 2.5, August 2002. +.SH "CONFORMING TO" +.PP +.BR io_getevents () +is Linux-specific and should not be used in +programs that are intended to be portable. +.SH NOTES +Glibc does not provide a wrapper function for this system call. + +The wrapper provided in +.I libaio +for +.BR io_getevents () +does not follow the usual C library conventions for indicating error: +on error it returns a negated error number +(the negative of one of the values listed in ERRORS). +If the system call is invoked via +.BR syscall (2), +then the return value follows the usual conventions for +indicating an error: \-1, with +.I errno +set to a (positive) value that indicates the error. +.SH "SEE ALSO" +.PP +.BR io_cancel (2), +.BR io_destroy (2), +.BR io_setup (2), +.BR io_submit (2), +.BR time (7) +.\" .SH "NOTES" +.\" +.\" .PP +.\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" +.\" .SH AUTHOR +.\" Kent Yoder. diff --git a/original/man2/io_setup.2 b/original/man2/io_setup.2 new file mode 100644 index 00000000..c62a81e7 --- /dev/null +++ b/original/man2/io_setup.2 @@ -0,0 +1,106 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" .de Sh \" Subsection +.\" .br +.\" .if t .Sp +.\" .ne 5 +.\" .PP +.\" \fB\\$1\fP +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .IP "\\$1" \\$2 +.\" .. +.TH IO_SETUP 2 2008-06-18 "Linux" "Linux Programmer's Manual" +.SH NAME +io_setup \- create an asynchronous I/O context +.SH "SYNOPSIS" +.nf +.\" .ad l +.\" .hy 0 +.B #include +.\" #include +.sp +.\" .HP 15 +.BI "int io_setup(unsigned " nr_events ", aio_context_t *" ctxp ); +.\" .ad +.\" .hy +.sp +Link with \fI\-laio\fP. +.fi +.SH "DESCRIPTION" +.PP +.BR io_setup () +creates an asynchronous I/O context capable of receiving +at least \fInr_events\fP. +\fIctxp\fP must not point to an AIO context that already exists, and must +be initialized to 0 prior to the call. +On successful creation of the AIO context, \fI*ctxp\fP is filled in +with the resulting handle. +.SH "RETURN VALUE" +On success, +.BR io_setup () +returns 0. +For the failure return, see NOTES. +.SH "ERRORS" +.TP +.B EAGAIN +The specified \fInr_events\fP exceeds the user's limit of available events. +.TP +.B EFAULT +An invalid pointer is passed for \fIctxp\fP. +.TP +.B EINVAL +\fIctxp\fP is not initialized, or the specified \fInr_events\fP +exceeds internal limits. +\fInr_events\fP should be greater than 0. +.TP +.B ENOMEM +Insufficient kernel resources are available. +.TP +.B ENOSYS +.BR io_setup () +is not implemented on this architecture. +.SH "VERSIONS" +.PP +The asynchronous I/O system calls first appeared in Linux 2.5, August 2002. +.SH "CONFORMING TO" +.PP +.BR io_setup () +is Linux-specific and should not be used in programs +that are intended to be portable. +.SH NOTES +Glibc does not provide a wrapper function for this system call. + +The wrapper provided in +.I libaio +for +.BR io_setup () +does not follow the usual C library conventions for indicating error: +on error it returns a negated error number +(the negative of one of the values listed in ERRORS). +If the system call is invoked via +.BR syscall (2), +then the return value follows the usual conventions for +indicating an error: \-1, with +.I errno +set to a (positive) value that indicates the error. +.SH "SEE ALSO" +.BR io_cancel (2), +.BR io_destroy (2), +.BR io_getevents (2), +.BR io_submit (2) +.\" .SH "NOTES" +.\" .PP +.\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" .SH AUTHOR +.\" Kent Yoder. diff --git a/original/man2/io_submit.2 b/original/man2/io_submit.2 new file mode 100644 index 00000000..f113c51c --- /dev/null +++ b/original/man2/io_submit.2 @@ -0,0 +1,108 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" .de Sh \" Subsection +.\" .br +.\" .if t .Sp +.\" .ne 5 +.\" .PP +.\" \fB\\$1\fP +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .IP "\\$1" \\$2 +.\" .. +.TH IO_SUBMIT 2 2008-06-18 "Linux" "Linux Programmer's Manual" +.SH NAME +io_submit \- submit asynchronous I/O blocks for processing +.SH "SYNOPSIS" +.nf +.\" .ad l +.\" .hy 0 +.B #include +.\" #include +.sp +.\" .HP 16 +.BI "int io_submit(aio_context_t " ctx_id ", long " nr \ +", struct iocb **" iocbpp ); +.\" .ad +.\" .hy +.sp +Link with \fI\-laio\fP. +.fi +.SH "DESCRIPTION" +.PP +.BR io_submit () +queues \fInr\fP I/O request blocks for processing in +the AIO context \fIctx_id\fP. +\fIiocbpp\fP should be an array of \fInr\fP AIO control blocks, +which will be submitted to context \fIctx_id\fP. +.SH "RETURN VALUE" +On success, +.BR io_submit () +returns the number of \fIiocb\fPs submitted (which may be +0 if \fInr\fP is zero). +For the failure return, see NOTES. +.SH "ERRORS" +.TP +.B EAGAIN +Insufficient resources are available to queue any \fIiocb\fPs. +.TP +.B EBADF +The file descriptor specified in the first \fIiocb\fP is invalid. +.TP +.B EFAULT +One of the data structures points to invalid data. +.TP +.B EINVAL +The \fIaio_context\fP specified by \fIctx_id\fP is invalid. +\fInr\fP is less than 0. +The \fIiocb\fP at *iocbpp[0] is not properly initialized, +or the operation specified is invalid for the file descriptor +in the \fIiocb\fP. +.TP +.B ENOSYS +.BR io_submit () +is not implemented on this architecture. +.SH "VERSIONS" +.PP +The asynchronous I/O system calls first appeared in Linux 2.5, August 2002. +.SH "CONFORMING TO" +.PP +.BR io_submit () +is Linux-specific and should not be used in +programs that are intended to be portable. +.SH NOTES +Glibc does not provide a wrapper function for this system call. + +The wrapper provided in +.I libaio +for +.BR io_submit () +does not follow the usual C library conventions for indicating error: +on error it returns a negated error number +(the negative of one of the values listed in ERRORS). +If the system call is invoked via +.BR syscall (2), +then the return value follows the usual conventions for +indicating an error: \-1, with +.I errno +set to a (positive) value that indicates the error. +.SH "SEE ALSO" +.BR io_cancel (2), +.BR io_destroy (2), +.BR io_getevents (2), +.BR io_setup (2) +.\" .SH "NOTES" +.\" .PP +.\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" .SH AUTHOR +.\" Kent Yoder. diff --git a/original/man2/ioctl.2 b/original/man2/ioctl.2 new file mode 100644 index 00000000..02dd4c2c --- /dev/null +++ b/original/man2/ioctl.2 @@ -0,0 +1,145 @@ +.\" Copyright (c) 1980, 1991 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. +.\" +.\" @(#)ioctl.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified 1993-07-23 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 1999-06-25 by Rachael Munns +.\" Modified 2000-09-21 by Andries Brouwer +.\" +.TH IOCTL 2 2000-09-21 "Linux" "Linux Programmer's Manual" +.SH NAME +ioctl \- control device +.SH SYNOPSIS +.B #include +.sp +.BI "int ioctl(int " d ", int " request ", ...);" +.SH DESCRIPTION +The +.BR ioctl () +function manipulates the underlying device parameters of special files. +In particular, many operating characteristics of character special files +(e.g., terminals) may be controlled with +.BR ioctl () +requests. +The argument +.I d +must be an open file descriptor. +.PP +The second argument is a device-dependent request code. +The third argument is an untyped pointer to memory. +It's traditionally +.BI "char *" argp +(from the days before +.B "void *" +was valid C), and will be so named for this discussion. +.PP +An +.BR ioctl () +.I request +has encoded in it whether the argument is an +.I in +parameter or +.I out +parameter, and the size of the argument +.I argp +in bytes. +Macros and defines used in specifying an +.BR ioctl () +.I request +are located in the file +.IR . +.SH "RETURN VALUE" +Usually, on success zero is returned. +A few +.BR ioctl () +requests use the return value as an output parameter +and return a nonnegative value on success. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP 0.7i +.B EBADF +.I d +is not a valid descriptor. +.TP +.B EFAULT +.I argp +references an inaccessible memory area. +.TP +.B EINVAL +.I Request +or +.I argp +is not valid. +.TP +.B ENOTTY +.I d +is not associated with a character special device. +.TP +.B ENOTTY +The specified request does not apply to the kind of object that the +descriptor +.I d +references. +.SH CONFORMING TO +No single standard. +Arguments, returns, and semantics of +.BR ioctl () +vary according to the device driver in question (the call is used as a +catch-all for operations that don't cleanly fit the Unix stream I/O +model). +See +.BR ioctl_list (2) +for a list of many of the known +.BR ioctl () +calls. +The +.BR ioctl () +function call appeared in Version 7 AT&T Unix. +.SH NOTES +In order to use this call, one needs an open file descriptor. +Often the +.BR open (2) +call has unwanted side effects, that can be avoided under Linux +by giving it the +.B O_NONBLOCK +flag. +.SH "SEE ALSO" +.BR execve (2), +.BR fcntl (2), +.BR ioctl_list (2), +.BR open (2), +.\" .BR mt (4), +.BR sd (4), +.BR tty (4) diff --git a/original/man2/ioctl_list.2 b/original/man2/ioctl_list.2 new file mode 100644 index 00000000..97626338 --- /dev/null +++ b/original/man2/ioctl_list.2 @@ -0,0 +1,867 @@ +.\" Ioctl List 1.3.27 +.\" Sun 17 Sep 1995 +.\" Michael Elizabeth Chastain +.\" +.\" +.\" // Copyright +.\" +.\" Ioctl List 1.3.27 is copyright 1995 by Michael Elizabeth Chastain. +.\" It is licensed under the Gnu Public License, Version 2. +.\" +.\" +.\" +.\" // Change Log +.\" +.\" 1.3.27 421 ioctls. +.\" Type information for non-pointer args. +.\" SIOCDEVPRIVATE, SIOCPROTOPRIVATE ioctls. +.\" Descriptions of extended arguments. +.\" +.\" 1.2.9 365 ioctls. +.\" First public version. +.\" +.\" +.\" 2007-12-29 Alain Portal and Michael Kerrisk +.\" : +.\" Various formatting improvements +.TH IOCTL_LIST 2 2007-12-29 "Linux" "Linux Programmer's Manual" +.SH NAME +ioctl_list \- list of ioctl calls in Linux/i386 kernel +.SH DESCRIPTION +This is Ioctl List 1.3.27, a list of ioctl calls in Linux/i386 kernel +1.3.27. +It contains 421 ioctls from +.IR . +For each ioctl, its numerical value, its name, and its argument +type are given. +.PP +An argument type of +.I const struct foo * +means the argument is input to the kernel. +.I struct foo * +means the kernel outputs the argument. +If the kernel uses the argument for both input and output, this is +marked with \fI//\ I-O\fP. +.PP +Some ioctls take more arguments or return more values than a single +structure. +These are marked \fI//\ MORE\fP and documented further in a +separate section. +.PP +This list is very incomplete. +.SS "ioctl structure" +.\" added two sections - aeb +Ioctl command values are 32-bit constants. +In principle these constants are completely arbitrary, but people have +tried to build some structure into them. +.LP +The old Linux situation was that of mostly 16-bit constants, where the +last byte is a serial number, and the preceding byte(s) give a type +indicating the driver. +Sometimes the major number was used: 0x03 +for the +.B HDIO_* +ioctls, 0x06 for the +.B LP* +ioctls. +And sometimes +one or more ASCII letters were used. +For example, +.B TCGETS +has value +0x00005401, with 0x54 = \(aqT\(aq indicating the terminal driver, and +.B CYGETTIMEOUT +has value 0x00435906, with 0x43 0x59 = \(aqC\(aq \(aqY\(aq +indicating the cyclades driver. +.LP +Later (0.98p5) some more information was built into the number. +One has 2 direction bits +(00: none, 01: write, 10: read, 11: read/write) +followed by 14 size bits (giving the size of the argument), +followed by an 8-bit type (collecting the ioctls in groups +for a common purpose or a common driver), and an 8-bit +serial number. +.LP +The macros describing this structure live in \fI\fP +and are +.B _IO(type,nr) +and +.BR "{_IOR,_IOW,_IOWR}(type,nr,size)" . +They use +.I sizeof(size) +so that size is a +misnomer here: this third argument is a data type. +.LP +Note that the size bits are very unreliable: in lots of cases +they are wrong, either because of buggy macros using +.IR sizeof(sizeof(struct)) , +or because of legacy values. +.LP +Thus, it seems that the new structure only gave disadvantages: +it does not help in checking, but it causes varying values +for the various architectures. +.SH "RETURN VALUE" +Decent ioctls return 0 on success and \-1 on error, while +any output value is stored via the argument. +However, +quite a few ioctls in fact return an output value. +This is not yet indicated below. + +// Main table. + +// +.TS +l l l. +0x00008901 FIOSETOWN const int * +0x00008902 SIOCSPGRP const int * +0x00008903 FIOGETOWN int * +0x00008904 SIOCGPGRP int * +0x00008905 SIOCATMAR int * +0x00008906 SIOCGSTAMP timeval * +.TE + +// +.TS +l l l l. +0x00005401 TCGETS struct termios * +0x00005402 TCSETS const struct termios * +0x00005403 TCSETSW const struct termios * +0x00005404 TCSETSF const struct termios * +0x00005405 TCGETA struct termio * +0x00005406 TCSETA const struct termio * +0x00005407 TCSETAW const struct termio * +0x00005408 TCSETAF const struct termio * +0x00005409 TCSBRK int +0x0000540A TCXONC int +0x0000540B TCFLSH int +0x0000540C TIOCEXCL void +0x0000540D TIOCNXCL void +0x0000540E TIOCSCTTY int +0x0000540F TIOCGPGRP pid_t * +0x00005410 TIOCSPGRP const pid_t * +0x00005411 TIOCOUTQ int * +0x00005412 TIOCSTI const char * +0x00005413 TIOCGWINSZ struct winsize * +0x00005414 TIOCSWINSZ const struct winsize * +0x00005415 TIOCMGET int * +0x00005416 TIOCMBIS const int * +0x00005417 TIOCMBIC const int * +0x00005418 TIOCMSET const int * +0x00005419 TIOCGSOFTCAR int * +0x0000541A TIOCSSOFTCAR const int * +0x0000541B FIONREAD int * +0x0000541B TIOCINQ int * +0x0000541C TIOCLINUX const char * // MORE +0x0000541D TIOCCONS void +0x0000541E TIOCGSERIAL struct serial_struct * +0x0000541F TIOCSSERIAL const struct serial_struct * +0x00005420 TIOCPKT const int * +0x00005421 FIONBIO const int * +0x00005422 TIOCNOTTY void +0x00005423 TIOCSETD const int * +0x00005424 TIOCGETD int * +0x00005425 TCSBRKP int +0x00005426 TIOCTTYGSTRUCT struct tty_struct * +0x00005450 FIONCLEX void +0x00005451 FIOCLEX void +0x00005452 FIOASYNC const int * +0x00005453 TIOCSERCONFIG void +0x00005454 TIOCSERGWILD int * +0x00005455 TIOCSERSWILD const int * +0x00005456 TIOCGLCKTRMIOS struct termios * +0x00005457 TIOCSLCKTRMIOS const struct termios * +0x00005458 TIOCSERGSTRUCT struct async_struct * +0x00005459 TIOCSERGETLSR int * +0x0000545A TIOCSERGETMULTI struct serial_multiport_struct * +0x0000545B TIOCSERSETMULTI const struct serial_multiport_struct * +.TE + +// +.TS +l l l l. +0x000089E0 SIOCAX25GETUID const struct sockaddr_ax25 * +0x000089E1 SIOCAX25ADDUID const struct sockaddr_ax25 * +0x000089E2 SIOCAX25DELUID const struct sockaddr_ax25 * +0x000089E3 SIOCAX25NOUID const int * +0x000089E4 SIOCAX25DIGCTL const int * +0x000089E5 SIOCAX25GETPARMS struct ax25_parms_struct * // I-O +0x000089E6 SIOCAX25SETPARMS const struct ax25_parms_struct * +.TE + +// +.TS +l l l l. +0x00007314 STL_BINTR void +0x00007315 STL_BSTART void +0x00007316 STL_BSTOP void +0x00007317 STL_BRESET void +.TE + +// +.TS +l l l l. +0x00005301 CDROMPAUSE void +0x00005302 CDROMRESUME void +0x00005303 CDROMPLAYMSF const struct cdrom_msf * +0x00005304 CDROMPLAYTRKIND const struct cdrom_ti * +0x00005305 CDROMREADTOCHDR struct cdrom_tochdr * +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 +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 +0x00005311 CDROM_GET_UPC struct { char [8]; } * +0x00005312 CDROMRESET void +0x00005313 CDROMVOLREAD struct cdrom_volctrl * +0x00005314 CDROMREADRAW const struct cdrom_msf * // MORE +0x00005315 CDROMREADCOOKED const struct cdrom_msf * // MORE +0x00005316 CDROMSEEK const struct cdrom_msf * +.TE + +// +.TS +l l l l. +0x00002000 CM206CTL_GET_STAT int +0x00002001 CM206CTL_GET_LAST_STAT int +.TE + +// +.TS +l l l l. +0x00435901 CYGETMON struct cyclades_monitor * +0x00435902 CYGETTHRESH int * +0x00435903 CYSETTHRESH int +0x00435904 CYGETDEFTHRESH int * +0x00435905 CYSETDEFTHRESH int +0x00435906 CYGETTIMEOUT int * +0x00435907 CYSETTIMEOUT int +0x00435908 CYGETDEFTIMEOUT int * +0x00435909 CYSETDEFTIMEOUT int +.TE + +// +.TS +l l l l. +0x80046601 EXT2_IOC_GETFLAGS int * +0x40046602 EXT2_IOC_SETFLAGS const int * +0x80047601 EXT2_IOC_GETVERSION int * +0x40047602 EXT2_IOC_SETVERSION const int * +.TE + +// +.TS +l l l l. +0x00000000 FDCLRPRM void +0x00000001 FDSETPRM const struct floppy_struct * +0x00000002 FDDEFPRM const struct floppy_struct * +0x00000003 FDGETPRM struct floppy_struct * +0x00000004 FDMSGON void +0x00000005 FDMSGOFF void +0x00000006 FDFMTBEG void +0x00000007 FDFMTTRK const struct format_descr * +0x00000008 FDFMTEND void +0x0000000A FDSETEMSGTRESH int +0x0000000B FDFLUSH void +0x0000000C FDSETMAXERRS const struct floppy_max_errors * +0x0000000E FDGETMAXERRS struct floppy_max_errors * +0x00000010 FDGETDRVTYP struct { char [16]; } * +0x00000014 FDSETDRVPRM const struct floppy_drive_params * +0x00000015 FDGETDRVPRM struct floppy_drive_params * +0x00000016 FDGETDRVSTAT struct floppy_drive_struct * +0x00000017 FDPOLLDRVSTAT struct floppy_drive_struct * +0x00000018 FDRESET int +0x00000019 FDGETFDCSTAT struct floppy_fdc_state * +0x0000001B FDWERRORCLR void +0x0000001C FDWERRORGET struct floppy_write_errors * +0x0000001E FDRAWCMD struct floppy_raw_cmd * // MORE // I-O +0x00000028 FDTWADDLE void +.TE + +// +.TS +l l l l. +0x0000125D BLKROSET const int * +0x0000125E BLKROGET int * +0x0000125F BLKRRPART void +0x00001260 BLKGETSIZE unsigned long * +0x00001261 BLKFLSBUF void +0x00001262 BLKRASET int +0x00001263 BLKRAGET int * +0x00000001 FIBMAP int * // I-O +0x00000002 FIGETBSZ int * +.TE + +// +.TS +l l l l. +0x00000301 HDIO_GETGEO struct hd_geometry * +0x00000302 HDIO_GET_UNMASKINTR int * +0x00000304 HDIO_GET_MULTCOUNT int * +0x00000307 HDIO_GET_IDENTITY struct hd_driveid * +0x00000308 HDIO_GET_KEEPSETTINGS int * +0x00000309 HDIO_GET_CHIPSET int * +0x0000030A HDIO_GET_NOWERR int * +0x0000030B HDIO_GET_DMA int * +0x0000031F HDIO_DRIVE_CMD int * // I-O +0x00000321 HDIO_SET_MULTCOUNT int +0x00000322 HDIO_SET_UNMASKINTR int +0x00000323 HDIO_SET_KEEPSETTINGS int +0x00000324 HDIO_SET_CHIPSET int +0x00000325 HDIO_SET_NOWERR int +0x00000326 HDIO_SET_DMA int +.TE + +// +.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 +.TE + +// +.TS +l l l l. +0x000089F0 SIOCDEVPLIP struct ifreq * // I-O +.TE + +// +.TS +l l l l. +0x00005490 PPPIOCGFLAGS int * +0x00005491 PPPIOCSFLAGS const int * +0x00005492 PPPIOCGASYNCMAP int * +0x00005493 PPPIOCSASYNCMAP const int * +0x00005494 PPPIOCGUNIT int * +0x00005495 PPPIOCSINPSIG const int * +0x00005497 PPPIOCSDEBUG const int * +0x00005498 PPPIOCGDEBUG int * +0x00005499 PPPIOCGSTAT struct ppp_stats * +0x0000549A PPPIOCGTIME struct ppp_ddinfo * +0x0000549B PPPIOCGXASYNCMAP struct { int [8]; } * +0x0000549C PPPIOCSXASYNCMAP const struct { int [8]; } * +0x0000549D PPPIOCSMRU const int * +0x0000549E PPPIOCRASYNCMAP const int * +0x0000549F PPPIOCSMAXCID const int * +.TE + +// +.TS +l l l l. +0x000089E0 SIOCAIPXITFCRT const char * +0x000089E1 SIOCAIPXPRISLT const char * +0x000089E2 SIOCIPXCFGDATA struct ipx_config_data * +.TE + +// +.TS +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 +0x00004B6C PIO_FONTX const struct console_font_desc * //MORE +0x00004B70 GIO_CMAP struct { char [48]; } * +0x00004B71 PIO_CMAP const struct { char [48]; } +0x00004B2F KIOCSOUND int +0x00004B30 KDMKTONE int +0x00004B31 KDGETLED char * +0x00004B32 KDSETLED int +0x00004B33 KDGKBTYPE char * +0x00004B34 KDADDIO int // MORE +0x00004B35 KDDELIO int // MORE +0x00004B36 KDENABIO void // MORE +0x00004B37 KDDISABIO void // MORE +0x00004B3A KDSETMODE int +0x00004B3B KDGETMODE int * +0x00004B3C KDMAPDISP void // MORE +0x00004B3D KDUNMAPDISP void // MORE +0x00004B40 GIO_SCRNMAP struct { char [E_TABSZ]; } * +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 +0x00004B67 PIO_UNIMAP const struct unimapdesc * // MORE +0x00004B68 PIO_UNIMAPCLR const struct unimapinit * +0x00004B44 KDGKBMODE int * +0x00004B45 KDSKBMODE int +0x00004B62 KDGKBMETA int * +0x00004B63 KDSKBMETA int +0x00004B64 KDGKBLED int * +0x00004B65 KDSKBLED int +0x00004B46 KDGKBENT struct kbentry * // I-O +0x00004B47 KDSKBENT const struct kbentry * +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 +0x00004B4D KDSETKEYCODE const struct kbkeycode * +0x00004B4E KDSIGACCEPT int +.TE + +// +.TS +l l l l. +0x00000601 LPCHAR int +0x00000602 LPTIME int +0x00000604 LPABORT int +0x00000605 LPSETIRQ int +0x00000606 LPGETIRQ int * +0x00000608 LPWAIT int +0x00000609 LPCAREFUL int +0x0000060A LPABORTOPEN int +0x0000060B LPGETSTATUS int * +0x0000060C LPRESET void +0x0000060D LPGETSTATS struct lp_stats * +.TE + +// +.TS +l l l l. +0x000089E0 SIOCGETVIFCNT struct sioc_vif_req * // I-O +0x000089E1 SIOCGETSGCNT struct sioc_sg_req * // I-O +.TE + +// +.TS +l l l l. +0x40086D01 MTIOCTOP const struct mtop * +0x801C6D02 MTIOCGET struct mtget * +0x80046D03 MTIOCPOS struct mtpos * +0x80206D04 MTIOCGETCONFIG struct mtconfiginfo * +0x40206D05 MTIOCSETCONFIG const struct mtconfiginfo * +.TE + +// +.TS +l l l l. +0x000089E0 SIOCNRGETPARMS struct nr_parms_struct * // I-O +0x000089E1 SIOCNRSETPARMS const struct nr_parms_struct * +0x000089E2 SIOCNRDECOBS void +0x000089E3 SIOCNRRTCTL const int * +.TE + +// +.TS +l l l l. +0x00009000 DDIOCSDBG const int * +0x00005382 CDROMAUDIOBUFSIZ int +.TE + +// +.TS +l l l l. +0x00005470 TIOCSCCINI void +0x00005471 TIOCCHANINI const struct scc_modem * +0x00005472 TIOCGKISS struct ioctl_command * // I-O +0x00005473 TIOCSKISS const struct ioctl_command * +0x00005474 TIOCSCCSTAT struct scc_stat * +.TE + +// +.TS +l l l l. +0x00005382 SCSI_IOCTL_GET_IDLUN struct { int [2]; } * +0x00005383 SCSI_IOCTL_TAGGED_ENABLE void +0x00005384 SCSI_IOCTL_TAGGED_DISABLE void +0x00005385 SCSI_IOCTL_PROBE_HOST const int * // MORE +.TE + +// +.TS +l l l l. +0x80027501 SMB_IOC_GETMOUNTUID uid_t * +.TE + +// +.TS +l l l l. +0x0000890B SIOCADDRT const struct rtentry * // MORE +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 +0x00008914 SIOCSIFFLAGS const struct ifreq * +0x00008915 SIOCGIFADDR struct ifreq * // I-O +0x00008916 SIOCSIFADDR const struct ifreq * +0x00008917 SIOCGIFDSTADDR struct ifreq * // I-O +0x00008918 SIOCSIFDSTADDR const struct ifreq * +0x00008919 SIOCGIFBRDADDR struct ifreq * // I-O +0x0000891A SIOCSIFBRDADDR const struct ifreq * +0x0000891B SIOCGIFNETMASK struct ifreq * // I-O +0x0000891C SIOCSIFNETMASK const struct ifreq * +0x0000891D SIOCGIFMETRIC struct ifreq * // I-O +0x0000891E SIOCSIFMETRIC const struct ifreq * +0x0000891F SIOCGIFMEM struct ifreq * // I-O +0x00008920 SIOCSIFMEM const struct ifreq * +0x00008921 SIOCGIFMTU struct ifreq * // I-O +0x00008922 SIOCSIFMTU const struct ifreq * +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 +0x00008929 SIOCGIFSLAVE void +0x00008930 SIOCSIFSLAVE void +0x00008931 SIOCADDMULTI const struct ifreq * +0x00008932 SIOCDELMULTI const struct ifreq * +0x00008940 SIOCADDRTOLD void +0x00008941 SIOCDELRTOLD void +0x00008950 SIOCDARP const struct arpreq * +0x00008951 SIOCGARP struct arpreq * // I-O +0x00008952 SIOCSARP const struct arpreq * +0x00008960 SIOCDRARP const struct arpreq * +0x00008961 SIOCGRARP struct arpreq * // I-O +0x00008962 SIOCSRARP const struct arpreq * +0x00008970 SIOCGIFMAP struct ifreq * // I-O +0x00008971 SIOCSIFMAP const struct ifreq * +.TE + +// +.TS +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 +0x80045104 SNDCTL_SEQ_GETOUTCOUNT int * +0x80045105 SNDCTL_SEQ_GETINCOUNT int * +0x40045106 SNDCTL_SEQ_PERCMODE void +0x40285107 SNDCTL_FM_LOAD_INSTR const struct sbi_instrument * +0x40045108 SNDCTL_SEQ_TESTMIDI const int * +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 +0x4004510D SNDCTL_SEQ_THRESHOLD const int * +0xC004510E SNDCTL_SYNTH_MEMAVL int * // I-O +0x4004510F SNDCTL_FM_4OP_ENABLE const int * +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 +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 +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 +0xC0046D01 SNDCTL_MIDI_MPUMODE const int * +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 +0x00005008 SNDCTL_DSP_POST void +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 +0x800C500C SNDCTL_DSP_GETOSPACE struct audio_buf_info * +0x800C500D SNDCTL_DSP_GETISPACE struct audio_buf_info * +0x0000500E SNDCTL_DSP_NONBLOCK void +0x80045002 SOUND_PCM_READ_RATE int * +0x80045006 SOUND_PCM_READ_CHANNELS int * +0x80045005 SOUND_PCM_READ_BITS int * +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 +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 +0x4FA44308 SNDCTL_COPR_SENDMSG const struct copr_msg * +0x8FA44309 SNDCTL_COPR_RCVMSG struct copr_msg * +0x80044D00 SOUND_MIXER_READ_VOLUME int * +0x80044D01 SOUND_MIXER_READ_BASS int * +0x80044D02 SOUND_MIXER_READ_TREBLE int * +0x80044D03 SOUND_MIXER_READ_SYNTH int * +0x80044D04 SOUND_MIXER_READ_PCM int * +0x80044D05 SOUND_MIXER_READ_SPEAKER int * +0x80044D06 SOUND_MIXER_READ_LINE int * +0x80044D07 SOUND_MIXER_READ_MIC int * +0x80044D08 SOUND_MIXER_READ_CD int * +0x80044D09 SOUND_MIXER_READ_IMIX int * +0x80044D0A SOUND_MIXER_READ_ALTPCM int * +0x80044D0B SOUND_MIXER_READ_RECLEV int * +0x80044D0C SOUND_MIXER_READ_IGAIN int * +0x80044D0D SOUND_MIXER_READ_OGAIN int * +0x80044D0E SOUND_MIXER_READ_LINE1 int * +0x80044D0F SOUND_MIXER_READ_LINE2 int * +0x80044D10 SOUND_MIXER_READ_LINE3 int * +0x80044D1C SOUND_MIXER_READ_MUTE int * +0x80044D1D SOUND_MIXER_READ_ENHANCE int * +0x80044D1E SOUND_MIXER_READ_LOUD int * +0x80044DFF SOUND_MIXER_READ_RECSRC int * +0x80044DFE SOUND_MIXER_READ_DEVMASK int * +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 +.TE + +// +.TS +l l l l. +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 +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 +0x000004D9 UMSDOS_GETVERSION struct umsdos_ioctl * +0x000004DA UMSDOS_INIT_EMD void +0x000004DB UMSDOS_DOS_SETUP const struct umsdos_ioctl * +0x000004DC UMSDOS_RENAME_DOS const struct umsdos_ioctl * +.TE + +// +.TS +l l l l. +0x00005600 VT_OPENQRY int * +0x00005601 VT_GETMODE struct vt_mode * +0x00005602 VT_SETMODE const struct vt_mode * +0x00005603 VT_GETSTATE struct vt_stat * +0x00005604 VT_SENDSIG void +0x00005605 VT_RELDISP int +0x00005606 VT_ACTIVATE int +0x00005607 VT_WAITACTIVE int +0x00005608 VT_DISALLOCATE int +0x00005609 VT_RESIZE const struct vt_sizes * +0x0000560A VT_RESIZEX const struct vt_consize * +.TE + +// More arguments. +Some ioctl's take a pointer to a structure which contains additional +pointers. +These are documented here in alphabetical order. + +.B CDROMREADAUDIO +takes an input pointer +.IR "const struct cdrom_read_audio *" . +The +.I buf +field points to an output buffer of length +.IR "nframes * CD_FRAMESIZE_RAW" . + +.BR CDROMREADCOOKED , +.BR CDROMREADMODE1 , +.BR CDROMREADMODE2 , +and +.B CDROMREADRAW +take an input pointer +.IR "const struct cdrom_msf *" . +They use the same pointer as an output pointer to +.IR "char []" . +The length varies by request. +For +.BR CDROMREADMODE1 , +most drivers use CD_FRAMESIZE, but the Optics Storage +driver uses OPT_BLOCKSIZE instead (both have the numerical value +2048). +.nf + + CDROMREADCOOKED char [CD_FRAMESIZE] + CDROMREADMODE1 char [CD_FRAMESIZE or OPT_BLOCKSIZE] + CDROMREADMODE2 char [CD_FRAMESIZE_RAW0] + CDROMREADRAW char [CD_FRAMESIZE_RAW] + +.fi +.BR EQL_ENSLAVE , +.BR EQL_EMANCIPATE , +.BR EQL_GETSLAVECFG , +.BR EQL_SETSLAVECFG , +.BR EQL_GETMASTERCFG , +and +.B EQL_SETMASTERCFG +take a +.IR "struct ifreq *" . +The +.I ifr_data +field is a pointer to another structure as follows: +.nf + + EQL_ENSLAVE const struct slaving_request * + EQL_EMANCIPATE const struct slaving_request * + 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 +.B FDRAWCMD +takes a +.IR "struct floppy raw_cmd *" . +If +.I flags & FD_RAW_WRITE +is nonzero, then +.I data +points to an input buffer of length +.IR length . +If +.I flags & FD_RAW_READ +is nonzero, then +.I data +points to an output buffer of length +.IR length . + +.B GIO_FONTX +and +.B PIO_FONTX +take a +.I struct console_font_desc * +or a +.IR "const struct console_font_desc *" , +respectively. +.I chardata +points to a buffer of +.IR "char [charcount]" . +This is an output buffer for +.B GIO_FONTX +and an input buffer for +.BR PIO_FONTX . + +.B GIO_UNIMAP +and +.B PIO_UNIMAP +take a +.I struct unimapdesc * +or a +.IR "const struct unimapdesc *" , +respectively. +.I entries +points to a buffer of +.IR "struct unipair [entry_ct]" . +This is an output buffer for +.B GIO_UNIMAP +and an input buffer for +.BR PIO_UNIMAP . + +KDADDIO, KDDELIO, KDDISABIO, and KDENABIO enable or disable access to +I/O ports. +They are essentially alternate interfaces to 'ioperm'. + +.B KDMAPDISP +and +.B KDUNMAPDISP +enable or disable memory mappings or I/O port access. +They are not implemented in the kernel. + +.B SCSI_IOCTL_PROBE_HOST +takes an input pointer +.IR "const int *" , +which is a length. +It uses the same pointer as an output pointer to a +.I char [] +buffer of this length. + +.B SIOCADDRT +and +.B SIOCDELRT +take an input pointer whose type depends on +the protocol: +.nf + + Most protocols const struct rtentry * + AX.25 const struct ax25_route * + NET/ROM const struct nr_route_struct * + +.fi +.B SIOCGIFCONF +takes a +.IR "struct ifconf *" . +The +.I ifc_buf +field points to a buffer of length +.I ifc_len +bytes, into which the kernel writes a list of type +.IR "struct ifreq []" . + +.B SIOCSIFHWADDR +takes an input pointer whose type depends on the protocol: +.nf + + Most protocols const struct ifreq * + AX.25 const char [AX25_ADDR_LEN] + +.fi +.B TIOCLINUX +takes a +.IR "const char *" . +It uses this to distinguish several +independent subcases. +In the table below, +.I N + foo +means +.I foo +after an N-byte pad. +.I struct selection +is implicitly defined in +.IR drivers/char/selection.c +.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 * + +.fi +// Duplicate ioctls + +This list does not include ioctls in the range +.B SIOCDEVPRIVATE +and +.BR SIOCPROTOPRIVATE . +.TS +l l l. +0x00000001 FDSETPRM FIBMAP +0x00000002 FDDEFPRM FIGETBSZ +0x00005382 CDROMAUDIOBUFSIZ SCSI_IOCTL_GET_IDLUN +0x00005402 SNDCTL_TMR_START TCSETS +0x00005403 SNDCTL_TMR_STOP TCSETSW +0x00005404 SNDCTL_TMR_CONTINUE TCSETSF +.TE +.SH SEE ALSO +.BR ioctl (2) diff --git a/original/man2/ioperm.2 b/original/man2/ioperm.2 new file mode 100644 index 00000000..3470a8dc --- /dev/null +++ b/original/man2/ioperm.2 @@ -0,0 +1,110 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de) +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 15:12:05 1993 by Rik Faith +.\" Modified Tue Aug 1 16:27 1995 by Jochen Karrer +.\" +.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" Modified Mon Feb 15 17:28:41 CET 1999 by Andries E. Brouwer +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.TH IOPERM 2 2007-06-15 "Linux" "Linux Programmer's Manual" +.SH NAME +ioperm \- set port input/output permissions +.SH SYNOPSIS +.B #include +/* for libc5 */ +.br +.B #include +/* for glibc */ +.sp +.BI "int ioperm(unsigned long " from ", unsigned long " num ", int " turn_on ); +.SH DESCRIPTION +.BR ioperm () +sets the port access permission bits for the calling process for +\fInum\fP bytes starting from port address \fIfrom\fP to the value +\fIturn_on\fP. +If \fIturn_on\fP is nonzero, the calling process must be privileged +.RB ( CAP_SYS_RAWIO ). + +.\" 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. +Only the first 0x3ff I/O ports can be specified in this manner. +For more ports, the +.BR iopl (2) +system call must be used. + +Permissions are not inherited by the child created by +.BR fork (2). +Permissions are preserved across +.BR execve (2); +this is useful for giving port access permissions to unprivileged +programs. + +This call is mostly for the i386 architecture. +On many other architectures it does not exist or will always +return an error. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +Invalid values for +.I from +or +.IR num . +.TP +.B EIO +(on PowerPC) This call is not supported. +.TP +.B ENOMEM +.\" Could not allocate I/O bitmap. +Out of memory. +.TP +.B EPERM +The calling process has insufficient privilege. +.SH "CONFORMING TO" +.BR ioperm () +is Linux-specific and should not be used in programs +intended to be portable. +.SH NOTES +Libc5 treats it as a system call and has a prototype in +.IR . +Glibc1 does not have a prototype. +Glibc2 has a prototype both in +.I +and in +.IR . +Avoid the latter, it is available on i386 only. +.SH "SEE ALSO" +.BR iopl (2), +.BR capabilities (7) diff --git a/original/man2/iopl.2 b/original/man2/iopl.2 new file mode 100644 index 00000000..a734686a --- /dev/null +++ b/original/man2/iopl.2 @@ -0,0 +1,100 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from linux/kernel/ioport.c (no copyright notice). +.\" +.\" 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 Tue Aug 1 16:47 1995 by Jochen Karrer +.\" +.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" Modified Fri Nov 27 14:50:36 CET 1998 by Andries Brouwer +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.TH IOPL 2 2004-05-27 "Linux" "Linux Programmer's Manual" +.SH NAME +iopl \- change I/O privilege level +.SH SYNOPSIS +.B #include +.sp +.BI "int iopl(int " level ); +.SH DESCRIPTION +.BR iopl () +changes the I/O privilege level of the calling process, as specified in +.IR level . + +This call is necessary to allow 8514-compatible X servers to run under +Linux. +Since these X servers require access to all 65536 I/O ports, the +.BR ioperm (2) +call is not sufficient. + +In addition to granting unrestricted I/O port access, running at a higher +I/O privilege level also allows the process to disable interrupts. +This will probably crash the system, and is not recommended. + +Permissions are inherited by +.BR fork (2) +and +.BR execve (2). + +The I/O privilege level for a normal process is 0. + +This call is mostly for the i386 architecture. +On many other architectures it does not exist or will always +return an error. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +.I level +is greater than 3. +.TP +.B ENOSYS +This call is unimplemented. +.TP +.B EPERM +The calling process has insufficient privilege to call +.BR iopl (); +the +.B CAP_SYS_RAWIO +capability is required. +.SH "CONFORMING TO" +.BR iopl () +is Linux-specific and should not be used in processes +intended to be portable. +.SH NOTES +Libc5 treats it as a system call and has a prototype in +.IR . +Glibc1 does not have a prototype. +Glibc2 has a prototype both in +.I +and in +.IR . +Avoid the latter, it is available on i386 only. +.SH "SEE ALSO" +.BR ioperm (2), +.BR capabilities (7) diff --git a/original/man2/ioprio_get.2 b/original/man2/ioprio_get.2 new file mode 100644 index 00000000..d6d5b3b6 --- /dev/null +++ b/original/man2/ioprio_get.2 @@ -0,0 +1 @@ +.so man2/ioprio_set.2 diff --git a/original/man2/ioprio_set.2 b/original/man2/ioprio_set.2 new file mode 100644 index 00000000..f88562be --- /dev/null +++ b/original/man2/ioprio_set.2 @@ -0,0 +1,322 @@ +.\" This is _*_ nroff _*_ source. Emacs, gimme all those colors :) +.\" +.\" Copyright (c) International Business Machines orp., 2006 +.\" +.\" 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 +.\" +.\" HISTORY: +.\" 2006-04-27, created by Eduardo M. Fleury +.\" with various additions by Michael Kerrisk +.\" +.\" +.TH IOPRIO_SET 2 2008-07-09 "Linux" "Linux Programmer's Manual" +.SH NAME +ioprio_get, ioprio_set \- get/set I/O scheduling class and priority +.SH SYNOPSIS +.nf +.BI "int ioprio_get(int " which ", int " who ); +.BI "int ioprio_set(int " which ", int " who ", int " ioprio ); +.fi +.SH DESCRIPTION +The +.BR ioprio_get () +and +.BR ioprio_set () +system calls respectively get and set the I/O scheduling class and +priority of one or more processes. + +The +.I which +and +.I who +arguments identify the process(es) on which the system +calls operate. +The +.I which +argument determines how +.I who +is interpreted, and has one of the following values: +.TP +.B IOPRIO_WHO_PROCESS +.I who +is a process ID identifying a single process. +.TP +.B IOPRIO_WHO_PGRP +.I who +is a process group ID identifying all the members of a process group. +.TP +.B IOPRIO_WHO_USER +.I who +is a user ID identifying all of the processes that +have a matching real UID. +.PP +If +.I which +is specified as +.B IOPRIO_WHO_PGRP +or +.B IOPRIO_WHO_USER +when calling +.BR ioprio_get (), +and more than one process matches +.IR who , +then the returned priority will be the highest one found among +all of the matching processes. +One priority is said to be +higher than another one if it belongs to a higher priority +class +.RB ( IOPRIO_CLASS_RT +is the highest priority class; +.B IOPRIO_CLASS_IDLE +is the lowest) +or if it belongs to the same priority class as the other process but +has a higher priority level (a lower priority number means a +higher priority level). + +The +.I ioprio +argument given to +.BR ioprio_set () +is a bit mask that specifies both the scheduling class and the +priority to be assigned to the target process(es). +The following macros are used for assembling and dissecting +.I ioprio +values: +.TP +.BI IOPRIO_PRIO_VALUE( class ", " data ) +Given a scheduling +.I class +and priority +.RI ( data ), +this macro combines the two values to produce an +.I ioprio +value, which is returned as the result of the macro. +.TP +.BI IOPRIO_PRIO_CLASS( mask ) +Given +.I mask +(an +.I ioprio +value), this macro returns its I/O class component, that is, +one of the values +.BR IOPRIO_CLASS_RT , +.BR IOPRIO_CLASS_BE , +or +.BR IOPRIO_CLASS_IDLE . +.TP +.BI IOPRIO_PRIO_DATA( mask ) +Given +.I mask +(an +.I ioprio +value), this macro returns its priority +.RI ( data ) +component. +.PP +See the NOTES section for more +information on scheduling classes and priorities. + +I/O priorities are supported for reads and for synchronous +.RB ( O_DIRECT , +.BR O_SYNC ) +writes. +I/O priorities are not supported for asynchronous +writes because they are issued outside the context of the program +dirtying the memory, and thus program-specific priorities do not apply. +.SH "RETURN VALUE" +On success, +.BR ioprio_get () +returns the +.I ioprio +value of the process with highest I/O priority of any of the processes +that match the criteria specified in +.I which +and +.IR who . +On error, \-1 is returned, and +.I errno +is set to indicate the error. +.PP +On success, +.BR ioprio_set () +returns 0. +On error, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +Invalid value for +.I which +or +.IR ioprio . +Refer to the NOTES section for available scheduler +classes and priority levels for +.IR ioprio . +.TP +.B EPERM +The calling process does not have the privilege needed to assign this +.I ioprio +to the specified process(es). +See the NOTES section for more information on required +privileges for +.BR ioprio_set (). +.TP +.B ESRCH +No process(es) could be found that matched the specification in +.I which +and +.IR who . +.SH VERSIONS +These system calls have been available on Linux since +kernel 2.6.13. +.SH "CONFORMING TO" +These system calls are Linux-specific. +.SH NOTES +Glibc does not provide wrapper for these system calls; call them using +.BR syscall (2). + +These system calls only have an effect when used +in conjunction with an I/O scheduler that supports I/O priorities. +As at kernel 2.6.17 the only such scheduler is the Completely Fair Queuing +(CFQ) I/O scheduler. +.SS "Selecting an I/O Scheduler" +I/O Schedulers are selected on a per-device basis via the special +file +.IR /sys/block//queue/scheduler . + +One can view the current I/O scheduler via the +.I /sys +file system. +For example, the following command +displays a list of all schedulers currently loaded in the kernel: +.sp +.RS +.nf +.RB "$" " cat /sys/block/hda/queue/scheduler" +noop anticipatory deadline [cfq] +.fi +.RE +.sp +The scheduler surrounded by brackets is the one actually +in use for the device +.RI ( hda +in the example). +Setting another scheduler is done by writing the name of the +new scheduler to this file. +For example, the following command will set the +scheduler for the +.I hda +device to +.IR cfq : +.sp +.RS +.nf +.RB "$" " su" +Password: +.RB "#" " echo cfq > /sys/block/hda/queue/scheduler" +.fi +.RE +.SS "The Completely Fair Queuing (CFQ) I/O Scheduler" +Since v3 (aka CFQ Time Sliced) CFQ implements +I/O nice levels similar to those +of CPU scheduling. +These nice levels are grouped in three scheduling classes +each one containing one or more priority levels: +.TP +.BR IOPRIO_CLASS_RT " (1)" +This is the real-time I/O class. +This scheduling class is given +higher priority than any other class: +processes from this class are +given first access to the disk every time. +Thus this I/O class needs to be used with some +care: one I/O real-time process can starve the entire system. +Within the real-time class, +there are 8 levels of class data (priority) that determine exactly +how much time this process needs the disk for on each service. +The highest real-time priority level is 0; the lowest is 7. +In the future this might change to be more directly mappable to +performance, by passing in a desired data rate instead. +.TP +.BR IOPRIO_CLASS_BE " (2)" +This is the best-effort scheduling class, +which is the default for any process +that hasn't set a specific I/O priority. +The class data (priority) determines how much +I/O bandwidth the process will get. +Best-effort priority levels are analogous to CPU nice values +(see +.BR getpriority (2)). +The priority level determines a priority relative +to other processes in the best-effort scheduling class. +Priority levels range from 0 (highest) to 7 (lowest). +.TP +.BR IOPRIO_CLASS_IDLE " (3)" +This is the idle scheduling class. +Processes running at this level only get I/O +time when no-one else needs the disk. +The idle class has no class data. +Attention is required when assigning this priority class to a process, +since it may become starved if higher priority processes are +constantly accessing the disk. +.PP +Refer to +.I Documentation/block/ioprio.txt +for more information on the CFQ I/O Scheduler and an example program. +.SS "Required permissions to set I/O priorities" +Permission to change a process's priority is granted or denied based +on two assertions: +.TP +.B "Process ownership" +An unprivileged process may only set the I/O priority of a process +whose real UID +matches the real or effective UID of the calling process. +A process which has the +.B CAP_SYS_NICE +capability can change the priority of any process. +.TP +.B "What is the desired priority" +Attempts to set very high priorities +.RB ( IOPRIO_CLASS_RT ) +require the +.B CAP_SYS_ADMIN +capability. +Kernel versions up to 2.6.24 also required +.B CAP_SYS_ADMIN +to set a very low priority +.RB ( IOPRIO_CLASS_IDLE ), +but since Linux 2.6.25, this is no longer required. +.PP +A call to +.BR ioprio_set () +must follow both rules, or the call will fail with the error +.BR EPERM . +.SH BUGS +.\" 6 May 07: Bug report raised: +.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=4464 +.\" Ulriich Drepper replied that he wasn't going to add these +.\" to glibc. +Glibc does not yet provide a suitable header file defining +the function prototypes and macros described on this page. +Suitable definitions can be found in +.IR linux/ioprio.h . +.SH "SEE ALSO" +.BR getpriority (2), +.BR open (2), +.BR capabilities (7) +.sp +Documentation/block/ioprio.txt in the kernel source tree. diff --git a/original/man2/ipc.2 b/original/man2/ipc.2 new file mode 100644 index 00000000..91feaf67 --- /dev/null +++ b/original/man2/ipc.2 @@ -0,0 +1,70 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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 Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.TH IPC 2 2007-06-28 "Linux" "Linux Programmer's Manual" +.SH NAME +ipc \- System V IPC system calls +.SH SYNOPSIS +.nf +.BI "int ipc(unsigned int " call ", int " first ", int " second \ +", int " third , +.BI " void *" ptr ", long " fifth ); +.fi +.SH DESCRIPTION +.BR ipc () +is a common kernel entry point for the System V IPC calls +for messages, semaphores, and shared memory. +.I call +determines which IPC function to invoke; +the other arguments are passed through to the appropriate call. +.PP +User programs should call the appropriate functions by their usual names. +Only standard library implementors and kernel hackers need to know about +.BR ipc (). +.SH "CONFORMING TO" +.BR ipc () +is Linux-specific, and should not be used in programs +intended to be portable. +.SH NOTES +On a few architectures, for example ia64, there is no +.BR ipc () +system call; instead +.BR msgctl (2), +.BR semctl (2), +.BR shmctl (2), +and so on really are implemented as separate system calls. +.SH "SEE ALSO" +.BR msgctl (2), +.BR msgget (2), +.BR msgrcv (2), +.BR msgsnd (2), +.BR semctl (2), +.BR semget (2), +.BR semop (2), +.BR semtimedop (2), +.BR shmat (2), +.BR shmctl (2), +.BR shmdt (2), +.BR shmget (2) diff --git a/original/man2/keyctl.2 b/original/man2/keyctl.2 new file mode 100644 index 00000000..bd22ba1a --- /dev/null +++ b/original/man2/keyctl.2 @@ -0,0 +1,166 @@ +.\" +.\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. +.\" Written by David Howells (dhowells@redhat.com) +.\" +.\" 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. +.\" +.TH KEYCTL 2 2010-02-25 Linux "Linux Key Management Calls" +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH NAME +keyctl \- Manipulate the kernel's key management facility +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "long keyctl(int " cmd ", ...);" +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH DESCRIPTION +.BR keyctl () +has a number of functions available: +.TP +.B KEYCTL_GET_KEYRING_ID +Ask for a keyring's ID. +.TP +.B KEYCTL_JOIN_SESSION_KEYRING +Join or start named session keyring. +.TP +.B KEYCTL_UPDATE +Update a key. +.TP +.B KEYCTL_REVOKE +Revoke a key. +.TP +.B KEYCTL_CHOWN +Set ownership of a key. +.TP +.B KEYCTL_SETPERM +Set perms on a key. +.TP +.B KEYCTL_DESCRIBE +Describe a key. +.TP +.B KEYCTL_CLEAR +Clear contents of a keyring. +.TP +.B KEYCTL_LINK +Link a key into a keyring. +.TP +.B KEYCTL_UNLINK +Unlink a key from a keyring. +.TP +.B KEYCTL_SEARCH +Search for a key in a keyring. +.TP +.B KEYCTL_READ +Read a key or keyring's contents. +.TP +.B KEYCTL_INSTANTIATE +Instantiate a partially constructed key. +.TP +.B KEYCTL_NEGATE +Negate a partially constructed key. +.TP +.B KEYCTL_SET_REQKEY_KEYRING +Set default request-key keyring. +.TP +.B KEYCTL_SET_TIMEOUT +Set timeout on a key. +.TP +.B KEYCTL_ASSUME_AUTHORITY +Assume authority to instantiate key. +.P +These are wrapped by +.B libkeyutils +into individual functions to permit compiler the compiler to check types. +See the +.B See Also +section at the bottom. +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH RETURN VALUE +On success +.BR keyctl () +returns the serial number of the key it found. +On error, the value +.B -1 +will be returned and errno will have been set to an appropriate error. +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH ERRORS +.TP +.B ENOKEY +No matching key was found or an invalid key was specified. +.TP +.B EKEYEXPIRED +An expired key was found or specified. +.TP +.B EKEYREVOKED +A revoked key was found or specified. +.TP +.B EKEYREJECTED +A rejected key was found or specified. +.TP +.B EDQUOT +The key quota for the caller's user would be exceeded by creating a key or +linking it to the keyring. +.TP +.B EACCES +A key operation wasn't permitted. +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH LINKING +Although this is a Linux system call, it is not present in +.I libc +but can be found rather in +.IR libkeyutils . +When linking, +.B -lkeyutils +should be specified to the linker. +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH SEE ALSO +.BR keyctl (1), +.br +.BR add_key (2), +.br +.BR request_key (2), +.br +.BR keyctl_get_keyring_ID (3), +.br +.BR keyctl_join_session_keyring (3), +.br +.BR keyctl_update (3), +.br +.BR keyctl_revoke (3), +.br +.BR keyctl_chown (3), +.br +.BR keyctl_setperm (3), +.br +.BR keyctl_describe (3), +.br +.BR keyctl_clear (3), +.br +.BR keyctl_link (3), +.br +.BR keyctl_unlink (3), +.br +.BR keyctl_search (3), +.br +.BR keyctl_read (3), +.br +.BR keyctl_instantiate (3), +.br +.BR keyctl_negate (3), +.br +.BR keyctl_set_reqkey_keyring (3), +.br +.BR keyctl_set_timeout (3), +.br +.BR keyctl_assume_authority (3), +.br +.BR keyctl_describe_alloc (3), +.br +.BR keyctl_read_alloc (3), +.br +.BR request-key (8) diff --git a/original/man2/kill.2 b/original/man2/kill.2 new file mode 100644 index 00000000..ad25e676 --- /dev/null +++ b/original/man2/kill.2 @@ -0,0 +1,179 @@ +.\" 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 by Thomas Koenig +.\" Modified 1993-07-23 by Rik Faith +.\" Modified 1993-07-25 by Rik Faith +.\" Modified 1995-11-01 by Michael Haardt +.\" +.\" Modified 1996-04-14 by Andries Brouwer +.\" [added some polishing contributed by Mike Battersby ] +.\" Modified 1996-07-21 by Andries Brouwer +.\" Modified 1997-01-17 by Andries Brouwer +.\" Modified 2001-12-18 by Andries Brouwer +.\" Modified 2002-07-24 by Michael Kerrisk +.\" Added note on historical rules enforced when an unprivileged process +.\" sends a signal. +.\" Modified 2004-06-16 by Michael Kerrisk +.\" Added note on CAP_KILL +.\" Modified 2004-06-24 by aeb +.\" Modified, 2004-11-30, after idea from emmanuel.colbus@ensimag.imag.fr +.\" +.TH KILL 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH NAME +kill \- send signal to a process +.SH SYNOPSIS +.nf +.B #include +.br +.B #include +.sp +.BI "int kill(pid_t " pid ", int " sig ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR kill (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +The +.BR kill () +system call +can be used to send any signal to any process group or process. +.PP +If \fIpid\fP is positive, then signal \fIsig\fP is sent to the +process with the ID specified by \fIpid\fP. +.PP +If \fIpid\fP equals 0, then \fIsig\fP is sent to every process in the +process group of the calling process. +.PP +If \fIpid\fP equals \-1, then \fIsig\fP is sent to every process +for which the calling process has permission to send signals, +except for process 1 (\fIinit\fP), but see below. +.PP +If \fIpid\fP is less than \-1, then \fIsig\fP is sent to every process +in the process group whose ID is \fI\-pid\fP. +.PP +If \fIsig\fP is 0, then no signal is sent, but error checking is still +performed; +this can be used to check for the existence of a process ID or +process group ID. + +For a process to have permission to send a signal +it must either be privileged (under Linux: have the +.B CAP_KILL +capability), or the real or effective +user ID of the sending process must equal the real or +saved set-user-ID of the target process. +In the case of +.B SIGCONT +it suffices when the sending and receiving +processes belong to the same session. +.SH "RETURN VALUE" +On success (at least one signal was sent), zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +An invalid signal was specified. +.TP +.B EPERM +The process does not have permission to send the signal +to any of the target processes. +.TP +.B ESRCH +The pid or process group does not exist. +Note that an existing process might be a zombie, +a process which already committed termination, but +has not yet been +.BR wait (2)ed +for. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH NOTES +The only signals that can be sent to process ID 1, the +.I init +process, are those for which +.I init +has explicitly installed signal handlers. +This is done to assure the +system is not brought down accidentally. +.LP +POSIX.1-2001 requires that \fIkill(\-1,sig)\fP send \fIsig\fP +to all processes that the calling process may send signals to, +except possibly for some implementation-defined system processes. +Linux allows a process to signal itself, but on Linux the call +\fIkill(\-1,sig)\fP does not signal the calling process. +.LP +POSIX.1-2001 requires that if a process sends a signal to itself, +and the sending thread does not have the signal blocked, +and no other thread +has it unblocked or is waiting for it in +.BR sigwait (3), +at least one +unblocked signal must be delivered to the sending thread before the +.BR kill () +returns. +.SS "Linux Notes" +Across different kernel versions, Linux has enforced different rules +for the permissions required for an unprivileged process +to send a signal to another process. +.\" In the 0.* kernels things chopped and changed quite +.\" a bit - MTK, 24 Jul 02 +In kernels 1.0 to 1.2.2, a signal could be sent if the +effective user ID of the sender matched that of the receiver, +or the real user ID of the sender matched that of the receiver. +From kernel 1.2.3 until 1.3.77, a signal could be sent if the +effective user ID of the sender matched either the real or effective +user ID of the receiver. +The current rules, which conform to POSIX.1-2001, were adopted +in kernel 1.3.78. +.SH BUGS +In 2.6 kernels up to and including 2.6.7, +there was a bug that meant that when sending signals to a process group, +.BR kill () +failed with the error +.B EPERM +if the caller did have permission to send the signal to \fIany\fP (rather +than \fIall\fP) of the members of the process group. +Notwithstanding this error return, the signal was still delivered +to all of the processes for which the caller had permission to signal. +.SH "SEE ALSO" +.BR _exit (2), +.BR killpg (2), +.BR signal (2), +.BR sigqueue (2), +.BR tkill (2), +.BR exit (3), +.BR capabilities (7), +.BR credentials (7), +.BR signal (7) diff --git a/original/man2/killpg.2 b/original/man2/killpg.2 new file mode 100644 index 00000000..7df64783 --- /dev/null +++ b/original/man2/killpg.2 @@ -0,0 +1,134 @@ +.\" Copyright (c) 1980, 1991 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. +.\" +.\" @(#)killpg.2 6.5 (Berkeley) 3/10/91 +.\" +.\" Modified Fri Jul 23 21:55:01 1993 by Rik Faith +.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" Modified 2004-06-16 by Michael Kerrisk +.\" Added notes on CAP_KILL +.\" Modified 2004-06-21 by aeb +.\" +.TH KILLPG 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +killpg \- send signal to a process group +.SH SYNOPSIS +.B #include +.sp +.BI "int killpg(int " pgrp ", int " sig ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR killpg (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +.BR killpg () +sends the signal +.I sig +to the process group +.IR pgrp . +See +.BR signal (7) +for a list of signals. + +If +.I pgrp +is 0, +.BR killpg () +sends the signal to the calling process's process group. +(POSIX says: If +.I pgrp +is less than or equal to 1, the behavior is undefined.) + +For a process to have permission to send a signal +it must either be privileged (under Linux: have the +.B CAP_KILL +capability), or the real or effective +user ID of the sending process must equal the real or +saved set-user-ID of the target process. +In the case of +.B SIGCONT +it suffices when the sending and receiving +processes belong to the same session. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +.I Sig +is not a valid signal number. +.TP +.B EPERM +The process does not have permission to send the signal +to any of the target processes. +.TP +.B ESRCH +No process can be found in the process group specified by +.IR pgrp . +.TP +.B ESRCH +The process group was given as 0 but the sending process does not +have a process group. +.SH "CONFORMING TO" +SVr4, 4.4BSD (the +.BR killpg () +function call first appeared in 4BSD), POSIX.1-2001. +.SH NOTES +There are various differences between the permission checking +in BSD-type systems and System V-type systems. +See the POSIX rationale for +.BR kill (). +A difference not mentioned by POSIX concerns the return +value +.BR EPERM : +BSD documents that no signal is sent and +.B EPERM +returned when the permission check failed for at least one target process, +while POSIX documents +.B EPERM +only when the permission check failed for all target processes. + +On Linux, +.BR killpg () +is implemented as a library function that makes the call +.IR "kill(-pgrp,\ sig)" . +.SH "SEE ALSO" +.BR getpgrp (2), +.BR kill (2), +.BR signal (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/original/man2/lchown.2 b/original/man2/lchown.2 new file mode 100644 index 00000000..f0a5635a --- /dev/null +++ b/original/man2/lchown.2 @@ -0,0 +1 @@ +.so man2/chown.2 diff --git a/original/man2/lchown32.2 b/original/man2/lchown32.2 new file mode 100644 index 00000000..8ed3964e --- /dev/null +++ b/original/man2/lchown32.2 @@ -0,0 +1 @@ +.so man2/lchown.2 diff --git a/original/man2/lgetxattr.2 b/original/man2/lgetxattr.2 new file mode 100644 index 00000000..d9e5d903 --- /dev/null +++ b/original/man2/lgetxattr.2 @@ -0,0 +1 @@ +.so man2/getxattr.2 diff --git a/original/man2/link.2 b/original/man2/link.2 new file mode 100644 index 00000000..0f17c3de --- /dev/null +++ b/original/man2/link.2 @@ -0,0 +1,186 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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-23 by Rik Faith +.\" Modified 1994-08-21 by Michael Haardt +.\" Modified 2004-06-23 by Michael Kerrisk +.\" Modified 2005-04-04, as per suggestion by Michael Hardt for rename.2 +.\" +.TH LINK 2 2008-08-21 "Linux" "Linux Programmer's Manual" +.SH NAME +link \- make a new name for a file +.SH SYNOPSIS +.B #include +.sp +.BI "int link(const char *" oldpath ", const char *" newpath ); +.SH DESCRIPTION +.BR link () +creates a new link (also known as a hard link) to an existing file. + +If +.I newpath +exists it will +.I not +be overwritten. + +This new name may be used exactly as the old one for any operation; +both names refer to the same file (and so have the same permissions +and ownership) and it is impossible to tell which name was the +"original". +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +Write access to the directory containing +.I newpath +is denied, or search permission is denied for one of the directories +in the path prefix of +.I oldpath +or +.IR newpath . +(See also +.BR path_resolution (7).) +.TP +.B EEXIST +.I newpath +already exists. +.TP +.B EFAULT +.IR oldpath " or " newpath " points outside your accessible address space." +.TP +.B EIO +An I/O error occurred. +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR oldpath " or " newpath . +.TP +.B EMLINK +The file referred to by +.I oldpath +already has the maximum number of links to it. +.TP +.B ENAMETOOLONG +.IR oldpath " or " newpath " was too long." +.TP +.B ENOENT +A directory component in +.IR oldpath " or " newpath +does not exist or is a dangling symbolic link. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOSPC +The device containing the file has no room for the new directory +entry. +.TP +.B ENOTDIR +A component used as a directory in +.IR oldpath " or " newpath +is not, in fact, a directory. +.TP +.B EPERM +.I oldpath +is a directory. +.TP +.B EPERM +The file system containing +.IR oldpath " and " newpath +does not support the creation of hard links. +.TP +.B EROFS +The file is on a read-only file system. +.TP +.B EXDEV +.IR oldpath " and " newpath +are not on the same mounted file system. +(Linux permits a file system to be mounted at multiple points, but +.BR link () +does not work across different mount points, +even if the same file system is mounted on both.) +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001 (but see NOTES). +.\" SVr4 documents additional ENOLINK and +.\" EMULTIHOP error conditions; POSIX.1 does not document ELOOP. +.\" X/OPEN does not document EFAULT, ENOMEM or EIO. +.SH NOTES +Hard links, as created by +.BR link (), +cannot span file systems. +Use +.BR symlink (2) +if this is required. + +POSIX.1-2001 says that +.BR link () +should dereference +.I oldpath +if it is a symbolic link. +However, since kernel 2.0, +.\" more precisely: since kernel 1.3.56 +Linux does not do so: if +.I oldpath +is a symbolic link, then +.I newpath +is created as a (hard) link to the same symbolic link file +(i.e., +.I newpath +becomes a symbolic link to the same file that +.I oldpath +refers to). +Some other implementations behave in the same manner as Linux. +.\" For example, the default Solaris compilation environment +.\" behaves like Linux, and contributors to a March 2005 +.\" thread in the Austin mailing list reported that some +.\" other (System V) implementations did/do the same -- MTK, Apr 05 +POSIX.1-2008 changes the specification of +.BR link (), +making it implementation-dependent whether or not +.I oldpath +is dereferenced if it is a symbolic link. +For precise control over the treatment of symbolic links when +creating a link, see +.BR linkat (2). +.SH BUGS +On NFS file systems, the return code may be wrong in case the NFS server +performs the link creation and dies before it can say so. +Use +.BR stat (2) +to find out if the link got created. +.SH "SEE ALSO" +.BR ln (1), +.BR linkat (2), +.BR open (2), +.BR rename (2), +.BR stat (2), +.BR symlink (2), +.BR unlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/linkat.2 b/original/man2/linkat.2 new file mode 100644 index 00000000..32ee790b --- /dev/null +++ b/original/man2/linkat.2 @@ -0,0 +1,152 @@ +.\" 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. +.\" +.\" +.TH LINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +linkat \- create a file link relative to directory file descriptors +.SH SYNOPSIS +.nf +.B #include /* Definition of AT_* constants */ +.B #include +.sp +.BI "int linkat(int " olddirfd ", const char *" oldpath , +.BI " int " newdirfd ", const char *" newpath ", int " flags ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR linkat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +The +.BR linkat () +system call operates in exactly the same way as +.BR link (2), +except for the differences described in this manual page. + +If the pathname given in +.I oldpath +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I olddirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR link (2) +for a relative pathname). + +If +.I oldpath +is relative and +.I olddirfd +is the special value +.BR AT_FDCWD , +then +.I oldpath +is interpreted relative to the current working +directory of the calling process (like +.BR link (2)). + +If +.I oldpath +is absolute, then +.I olddirfd +is ignored. + +The interpretation of +.I newpath +is as for +.IR oldpath , +except that a relative pathname is interpreted relative +to the directory referred to by the file descriptor +.IR newdirfd . + +By default, +.BR linkat (), +does not dereference +.I oldpath +if it is a symbolic link (like +.BR link (2)). +Since Linux 2.6.18, the flag +.B AT_SYMLINK_FOLLOW +can be specified in +.I flags +to cause +.I oldpath +to be dereferenced if it is a symbolic link. +Before kernel 2.6.18, the +.I flags +argument was unused, and had to be specified as 0. +.SH "RETURN VALUE" +On success, +.BR linkat () +returns 0. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR link (2) +can also occur for +.BR linkat (). +The following additional errors can occur for +.BR linkat (): +.TP +.B EBADF +.I olddirfd +or +.I newdirfd +is not a valid file descriptor. +.TP +.B ENOTDIR +.I oldpath +is relative and +.I olddirfd +is a file descriptor referring to a file other than a directory; +or similar for +.I newpath +and +.I newdirfd +.SH VERSIONS +.BR linkat () +was added to Linux in kernel 2.6.16. +.SH "CONFORMING TO" +POSIX.1-2008. +.SH NOTES +See +.BR openat (2) +for an explanation of the need for +.BR linkat (). +.SH "SEE ALSO" +.BR link (2), +.BR openat (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/listen.2 b/original/man2/listen.2 new file mode 100644 index 00000000..3fe38d10 --- /dev/null +++ b/original/man2/listen.2 @@ -0,0 +1,172 @@ +.\" Copyright (c) 1983, 1991 The Regents of the University of California. +.\" and Copyright (C) 2007, Michael Kerrisk +.\" 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. +.\" +.\" $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 +.\" +.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" Modified 1998 by Andi Kleen +.\" Modified 11 May 2001 by Sam Varshavchik +.\" +.\" +.TH LISTEN 2 2008-11-20 "Linux" "Linux Programmer's Manual" +.SH NAME +listen \- listen for connections on a socket +.SH SYNOPSIS +.nf +.BR "#include " " /* See NOTES */" +.br +.B #include +.sp +.BI "int listen(int " sockfd ", int " backlog ); +.fi +.SH DESCRIPTION +.BR listen () +marks the socket referred to by +.I sockfd +as a passive socket, that is, as a socket that will +be used to accept incoming connection requests using +.BR accept (2). + +The +.I sockfd +argument is a file descriptor that refers to a socket of type +.B SOCK_STREAM +or +.BR SOCK_SEQPACKET . + +The +.I backlog +argument defines the maximum length +to which the queue of pending connections for +.I sockfd +may grow. +If a connection request arrives when the queue is full, the client +may receive an error with an indication of +.B ECONNREFUSED +or, if the underlying protocol supports retransmission, the request may be +ignored so that a later reattempt at connection succeeds. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EADDRINUSE +Another socket is already listening on the same port. +.TP +.B EBADF +The argument +.I sockfd +is not a valid descriptor. +.TP +.B ENOTSOCK +The argument +.I sockfd +is not a socket. +.TP +.B EOPNOTSUPP +The socket is not of a type that supports the +.BR listen () +operation. +.SH "CONFORMING TO" +4.4BSD, POSIX.1-2001. +The +.BR listen () +function call first appeared in 4.2BSD. +.SH NOTES +To accept connections, the following steps are performed: +.RS 4 +.IP 1. 4 +A socket is created with +.BR socket (2). +.IP 2. +The socket is bound to a local address using +.BR bind (2), +so that other sockets may be +.BR connect (2)ed +to it. +.IP 3. +A willingness to accept incoming connections and a queue limit for incoming +connections are specified with +.BR listen (). +.IP 4. +Connections are accepted with +.BR accept (2). +.RE +.PP +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. + +The behavior of the +.I backlog +argument on TCP sockets changed with Linux 2.2. +Now it specifies the queue length for +.I completely +established sockets waiting to be accepted, +instead of the number of incomplete connection requests. +The maximum length of the queue for incomplete sockets +can be set using +.IR /proc/sys/net/ipv4/tcp_max_syn_backlog . +When syncookies are enabled there is no logical maximum +length and this setting is ignored. +See +.BR tcp (7) +for more information. + +If the +.I backlog +argument is greater than the value in +.IR /proc/sys/net/core/somaxconn , +then it is silently truncated to that value; +the default value in this file is 128. +In kernels before 2.4.25, this limit was a hard coded value, +.BR SOMAXCONN , +with the value 128. +.\" 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. +.SH EXAMPLE +See +.BR bind (2). +.SH "SEE ALSO" +.BR accept (2), +.BR bind (2), +.BR connect (2), +.BR socket (2), +.BR socket (7) diff --git a/original/man2/listxattr.2 b/original/man2/listxattr.2 new file mode 100644 index 00000000..5972d74f --- /dev/null +++ b/original/man2/listxattr.2 @@ -0,0 +1,164 @@ +.\" +.\" Extended attributes system calls manual pages +.\" +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" 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. +.\" +.TH LISTXATTR 2 2001-12-01 "Linux" "Linux Programmer's Manual" +.SH NAME +listxattr, llistxattr, flistxattr \- list extended attribute names +.SH SYNOPSIS +.fam C +.nf +.B #include +.B #include +.sp +.BI "ssize_t listxattr(const char\ *" path ", char\ *" list \ +", size_t " size ); +.BI "ssize_t llistxattr(const char\ *" path ", char\ *" list \ +", size_t " size ); +.BI "ssize_t flistxattr(int " fd ", char\ *" list ", size_t " size ); +.fi +.fam T +.SH DESCRIPTION +Extended attributes are name:value +pairs associated with inodes (files, directories, symbolic links, etc.). +They are extensions to the normal attributes which are associated +with all inodes in the system (i.e., the +.BR stat (2) +data). +A complete overview of extended attributes concepts can be found in +.BR attr (5). +.PP +.BR listxattr () +retrieves the +.I list +of extended attribute names associated with the given +.I path +in the file system. +The list is the set of (null-terminated) names, one after the other. +Names of extended attributes to which the calling process does not +have access may be omitted from the list. +The length of the attribute name +.I list +is returned. +.PP +.BR llistxattr () +is identical to +.BR listxattr (), +except in the case of a symbolic link, where the list of names of +extended attributes associated with the link itself is retrieved, +not the file that it refers to. +.PP +.BR flistxattr () +is identical to +.BR listxattr (), +only the open file referred to by +.I fd +(as returned by +.BR open (2)) +is interrogated in place of +.IR path . +.PP +A single extended attribute +.I name +is a simple null-terminated string. +The name includes a namespace prefix; there may be several, disjoint +namespaces associated with an individual inode. +.PP +An empty buffer of +.I size +zero can be passed into these calls to return the current size of the +list of extended attribute names, which can be used to estimate the +size of a buffer which is sufficiently large to hold the list of names. +.SS Example +The +.I list +of names is returned as an unordered array of null-terminated character +strings (attribute names are separated by null bytes (\(aq\\0\(aq)), like this: +.fam C +.RS +.nf + +user.name1\\0system.name1\\0user.name2\\0 +.fi +.RE +.fam T +.P +Filesystems like ext2, ext3 and XFS which implement POSIX ACLs using +extended attributes, might return a +.I list +like this: +.fam C +.RS +.nf + +system.posix_acl_access\\0system.posix_acl_default\\0 +.fi +.RE +.fam T +.SH RETURN VALUE +On success, a positive number is returned indicating the size of the +extended attribute name list. +On failure, \-1 is returned and +.I errno +is set appropriately. +.PP +If the +.I size +of the +.I list +buffer is too small to hold the result, +.I errno +is set to +.BR ERANGE . +.PP +If extended attributes are not supported by the file system, or are disabled, +.I errno +is set to +.BR ENOTSUP . +.PP +The errors documented for the +.BR stat (2) +system call are also applicable here. +.SH VERSIONS +These system calls have been available on Linux since kernel 2.4; +glibc support is provided since version 2.3. +.SH "CONFORMING TO" +These system calls are Linux-specific. +.\" .SH AUTHORS +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" and the SGI XFS development team, +.\" .RI < linux-xfs@oss.sgi.com >. +.\" Please send any bug reports or comments to these addresses. +.SH SEE ALSO +.BR getfattr (1), +.BR setfattr (1), +.BR getxattr (2), +.BR open (2), +.BR removexattr (2), +.BR setxattr (2), +.BR stat (2), +.BR attr (5), +.BR symlink (7) diff --git a/original/man2/llistxattr.2 b/original/man2/llistxattr.2 new file mode 100644 index 00000000..117bd2b5 --- /dev/null +++ b/original/man2/llistxattr.2 @@ -0,0 +1 @@ +.so man2/listxattr.2 diff --git a/original/man2/llseek.2 b/original/man2/llseek.2 new file mode 100644 index 00000000..8f3d7e84 --- /dev/null +++ b/original/man2/llseek.2 @@ -0,0 +1,84 @@ +.\" 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 10 June 1995 by Andries Brouwer +.\" Modified Thu Oct 31 15:16:23 1996 by Eric S. Raymond +.\" +.TH LLSEEK 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.SH NAME +_llseek \- reposition read/write file offset +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "int _llseek(unsigned int " fd ", unsigned long " offset_high , +.BI " unsigned long " offset_low ", loff_t *" result , +.BI " unsigned int " whence ); +.fi +.SH DESCRIPTION +The +.BR _llseek () +function repositions the offset of the open file associated +with the file descriptor +.I fd +to +.I (offset_high<<32) | offset_low +bytes relative to the beginning of the file, the current position in the file, +or the end of the file, depending on whether +.I whence +is +.BR SEEK_SET , +.BR SEEK_CUR , +or +.BR SEEK_END , +respectively. +It returns the resulting file position in the argument +.IR result . +.SH "RETURN VALUE" +Upon successful completion, +.BR _llseek () +returns 0. +Otherwise, a value of \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EBADF +.I fd +is not an open file descriptor. +.TP +.B EFAULT +Problem with copying results to user space. +.TP +.B EINVAL +.I whence +is invalid. +.SH "CONFORMING TO" +This function is Linux-specific, and should not be used in programs +intended to be portable. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). +.SH "SEE ALSO" +.BR lseek (2), +.BR lseek64 (3) diff --git a/original/man2/lock.2 b/original/man2/lock.2 new file mode 100644 index 00000000..5d25ea6c --- /dev/null +++ b/original/man2/lock.2 @@ -0,0 +1 @@ +.so man2/unimplemented.2 diff --git a/original/man2/lookup_dcookie.2 b/original/man2/lookup_dcookie.2 new file mode 100644 index 00000000..8e091dfa --- /dev/null +++ b/original/man2/lookup_dcookie.2 @@ -0,0 +1,88 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2003 John Levon +.\" +.\" 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 2004-06-17 Michael Kerrisk +.\" +.TH LOOKUP_DCOOKIE 2 2004-06-17 "Linux" "Linux Programmer's Manual" +.SH NAME +lookup_dcookie \- return a directory entry's path +.SH SYNOPSIS +.BI "int lookup_dcookie(u64 " cookie ", char *" buffer ", size_t " len ); +.SH DESCRIPTION +Look up the full path of the directory entry specified by the value +.I cookie +. +The cookie is an opaque identifier uniquely identifying a particular +directory entry. +The buffer given is filled in with the full path of the directory entry. + +For +.BR lookup_dcookie () +to return successfully, +the kernel must still hold a cookie reference to the directory entry. +.SH "RETURN VALUE" +On success, +.BR lookup_dcookie () +returns the length of the path string copied into the buffer. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +The buffer was not valid. +.TP +.B EINVAL +The kernel has no registered cookie/directory entry mappings at the +time of lookup, or the cookie does not refer to a valid directory entry. +.TP +.B ENAMETOOLONG +The name could not fit in the buffer. +.TP +.B ENOMEM +The kernel could not allocate memory for the temporary buffer holding +the path. +.TP +.B EPERM +The process does not have the capability +.B CAP_SYS_ADMIN +required to look up cookie values. +.TP +.B ERANGE +The buffer was not large enough to hold the path of the directory entry. +.SH VERSIONS +Available since Linux 2.5.43. +The +.B ENAMETOOLONG +error return was added in 2.5.70. +.SH "CONFORMING TO" +.BR lookup_dcookie () +is Linux-specific. +.SH "NOTES" +.BR lookup_dcookie () +is a special-purpose system call, currently used only by the oprofile profiler. +It relies on a kernel driver to register cookies for directory entries. + +The path returned may be suffixed by the string " (deleted)" if the directory +entry has been removed. diff --git a/original/man2/lremovexattr.2 b/original/man2/lremovexattr.2 new file mode 100644 index 00000000..38d01ccd --- /dev/null +++ b/original/man2/lremovexattr.2 @@ -0,0 +1 @@ +.so man2/removexattr.2 diff --git a/original/man2/lseek.2 b/original/man2/lseek.2 new file mode 100644 index 00000000..07b374db --- /dev/null +++ b/original/man2/lseek.2 @@ -0,0 +1,165 @@ +'\" t +.\" Copyright (c) 1980, 1991 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. +.\" +.\" @(#)lseek.2 6.5 (Berkeley) 3/10/91 +.\" +.\" Modified 1993-07-23 by Rik Faith +.\" Modified 1995-06-10 by Andries Brouwer +.\" Modified 1996-10-31 by Eric S. Raymond +.\" Modified 1998-01-17 by Michael Haardt +.\" +.\" Modified 2001-09-24 by Michael Haardt +.\" Modified 2003-08-21 by Andries Brouwer +.\" +.TH LSEEK 2 2001-09-24 "Linux" "Linux Programmer's Manual" +.SH NAME +lseek \- reposition read/write file offset +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "off_t lseek(int " fd ", off_t " offset ", int " whence ); +.SH DESCRIPTION +The +.BR lseek () +function repositions the offset of the open file associated with the +file descriptor +.I fd +to the argument +.I offset +according to the directive +.I whence +as follows: +.TP +.B SEEK_SET +The offset is set to +.I offset +bytes. +.TP +.B SEEK_CUR +The offset is set to its current location plus +.I offset +bytes. +.TP +.B SEEK_END +The offset is set to the size of the file plus +.I offset +bytes. +.PP +The +.BR lseek () +function allows the file offset to be set beyond the end +of the file (but this does not change the size of the file). +If data is later written at this point, subsequent reads of the data +in the gap (a "hole") return null bytes (\(aq\\0\(aq) until +data is actually written into the gap. +.SH "RETURN VALUE" +Upon successful completion, +.BR lseek () +returns the resulting offset location as measured in bytes from the +beginning of the file. +Otherwise, a value of \fI(off_t)\ \-1\fP is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EBADF +.I fd +is not an open file descriptor. +.TP +.B EINVAL +.I whence +is not one of +.BR SEEK_SET , +.BR SEEK_CUR , +.BR SEEK_END ; +or the resulting file offset would be negative, +or beyond the end of a seekable device. +.\" Some systems may allow negative offsets for character devices +.\" and/or for remote file systems. +.TP +.B EOVERFLOW +.\" HP-UX 11 says EINVAL for this case (but POSIX.1 says EOVERFLOW) +The resulting file offset cannot be represented in an +.IR off_t . +.TP +.B ESPIPE +.I fd +is associated with a pipe, socket, or FIFO. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH NOTES +This document's use of +.I whence +is incorrect English, but maintained for historical reasons. + +Some devices are incapable of seeking and POSIX does not specify which +devices must support +.BR lseek (). + +On Linux, using +.BR lseek () +on a tty device returns +\fBESPIPE\fP. +.\" Other systems return the number of written characters, +.\" using SEEK_SET to set the counter. (Of written characters.) + +When converting old code, substitute values for \fIwhence\fP with the +following macros: +.TS +c c +l l. +old new +0 SEEK_SET +1 SEEK_CUR +2 SEEK_END +L_SET SEEK_SET +L_INCR SEEK_CUR +L_XTND SEEK_END +.TE +.PP +SVr1-3 returns \fIlong\fP instead of \fIoff_t\fP, BSD returns \fIint\fP. +.PP +Note that file descriptors created by +.BR dup (2) +or +.BR fork (2) +share the current file position pointer, so seeking on such files may be +subject to race conditions. +.SH "SEE ALSO" +.BR dup (2), +.BR fork (2), +.BR open (2), +.BR fseek (3), +.BR lseek64 (3), +.BR posix_fallocate (3) diff --git a/original/man2/lsetxattr.2 b/original/man2/lsetxattr.2 new file mode 100644 index 00000000..dc078075 --- /dev/null +++ b/original/man2/lsetxattr.2 @@ -0,0 +1 @@ +.so man2/setxattr.2 diff --git a/original/man2/lstat.2 b/original/man2/lstat.2 new file mode 100644 index 00000000..b1a86c19 --- /dev/null +++ b/original/man2/lstat.2 @@ -0,0 +1 @@ +.so man2/stat.2 diff --git a/original/man2/lstat64.2 b/original/man2/lstat64.2 new file mode 100644 index 00000000..89b1c84d --- /dev/null +++ b/original/man2/lstat64.2 @@ -0,0 +1 @@ +.so man2/lstat.2 diff --git a/original/man2/madvise.2 b/original/man2/madvise.2 new file mode 100644 index 00000000..fec9fb14 --- /dev/null +++ b/original/man2/madvise.2 @@ -0,0 +1,238 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2001 David Gómez +.\" +.\" 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 +.\" +.TH MADVISE 2 2008-04-22 "Linux" "Linux Programmer's Manual" +.SH NAME +madvise \- give advice about use of memory +.SH SYNOPSIS +.B #include +.sp +.BI "int madvise(void *" addr ", size_t " length ", int " advice ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR madvise (): +_BSD_SOURCE +.SH DESCRIPTION +The +.BR madvise () +system call advises the kernel about how to handle paging input/output in +the address range beginning at address +.I addr +and with size +.I length +bytes. +It allows an application to tell the kernel how it expects to use +some mapped or shared memory areas, so that the kernel can choose +appropriate read-ahead and caching techniques. +This call does not influence the semantics of the application +(except in the case of +.BR MADV_DONTNEED ), +but +may influence its performance. +The kernel is free to ignore the advice. +.LP +The advice is indicated in the +.I advice +argument which can be +.TP +.B MADV_NORMAL +No special treatment. +This is the default. +.TP +.B MADV_RANDOM +Expect page references in random order. +(Hence, read ahead may be less useful than normally.) +.TP +.B MADV_SEQUENTIAL +Expect page references in sequential order. +(Hence, pages in the given range can be aggressively read ahead, +and may be freed soon after they are accessed.) +.TP +.B MADV_WILLNEED +Expect access in the near future. +(Hence, it might be a good idea to read some pages ahead.) +.TP +.B MADV_DONTNEED +Do not expect access in the near future. +(For the time being, the application is finished with the given range, +so the kernel can free resources associated with it.) +Subsequent accesses of pages in this range will succeed, but will result +either in reloading of the memory contents from the underlying mapped file +(see +.BR mmap (2)) +or zero-fill-on-demand pages for mappings +without an underlying file. +.TP +.BR MADV_REMOVE " (Since Linux 2.6.16)" +Free up a given range of pages +and its associated backing store. +Currently, +.\" 2.6.18-rc5 +only shmfs/tmpfs supports this; other file systems return with the +error +.BR 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 +.BR MADV_DONTFORK " (Since Linux 2.6.16)" +.\" See http://lwn.net/Articles/171941/ +Do not make the pages in this range available to the child after a +.BR fork (2). +This is useful to prevent copy-on-write semantics from changing +the physical location of a page(s) if the parent writes to it after a +.BR fork (2). +(Such page relocations cause problems for hardware that +DMAs into the page(s).) +.\" [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 +.BR MADV_DOFORK " (Since Linux 2.6.16)" +Undo the effect of +.BR MADV_DONTFORK , +restoring the default behavior, whereby a mapping is inherited across +.BR fork (2). +.SH "RETURN VALUE" +On success +.BR madvise () +returns zero. +On error, it returns \-1 and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EAGAIN +A kernel resource was temporarily unavailable. +.TP +.B EBADF +The map exists, but the area maps something that isn't a file. +.TP +.B EINVAL +The value +.I len +is negative, +.\" .I len +.\" is zero, +.I addr +is not page-aligned, +.I advice +is not a valid value, or the application is attempting +to release locked or shared pages (with +.BR MADV_DONTNEED ). +.TP +.B EIO +(for +.BR MADV_WILLNEED ) +Paging in this area would exceed the process's +maximum resident set size. +.TP +.B ENOMEM +(for +.BR MADV_WILLNEED ) +Not enough memory: paging in failed. +.TP +.B ENOMEM +Addresses in the specified range are not currently +mapped, or are outside the address space of the process. +.SH "CONFORMING TO" +POSIX.1b. +POSIX.1-2001 describes +.BR posix_madvise (3) +.\" FIXME . Write a posix_fadvise(3) page. +with constants +.BR POSIX_MADV_NORMAL , +etc., +with a behavior close to that described here. +There is a similar +.BR posix_fadvise (2) +for file access. + +.BR MADV_REMOVE , +.BR MADV_DONTFORK , +and +.B MADV_DOFORK +are Linux-specific. +.SH NOTES +.SS "Linux Notes" +.LP +The current Linux implementation (2.4.0) views this system call +more as a command than as advice and hence may return an error +when it cannot do what it usually would do in response to this +advice. +(See the ERRORS description above.) +This is nonstandard behavior. +.LP +The Linux implementation requires that the address +.I addr +be page-aligned, and allows +.I length +to be zero. +If there are some parts of the specified address range +that are not mapped, the Linux version of +.BR madvise () +ignores them and applies the call to the rest (but returns +.B ENOMEM +from the system call, as it should). +.\" .SH HISTORY +.\" The +.\" .BR madvise () +.\" function first appeared in 4.4BSD. +.SH "SEE ALSO" +.BR getrlimit (2), +.BR mincore (2), +.BR mmap (2), +.BR mprotect (2), +.BR msync (2), +.BR munmap (2) diff --git a/original/man2/madvise1.2 b/original/man2/madvise1.2 new file mode 100644 index 00000000..5d25ea6c --- /dev/null +++ b/original/man2/madvise1.2 @@ -0,0 +1 @@ +.so man2/unimplemented.2 diff --git a/original/man2/mbind.2 b/original/man2/mbind.2 new file mode 100644 index 00000000..70dbbfce --- /dev/null +++ b/original/man2/mbind.2 @@ -0,0 +1,447 @@ +.\" Copyright 2003,2004 Andi Kleen, SuSE Labs. +.\" and Copyright 2007 Lee Schermerhorn, Hewlett Packard +.\" +.\" 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. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\" 2006-02-03, mtk, substantial wording changes and other improvements +.\" 2007-08-27, Lee Schermerhorn +.\" more precise specification of behavior. +.\" +.TH MBIND 2 2008-08-15 Linux "Linux Programmer's Manual" +.SH NAME +mbind \- Set memory policy for a memory range +.SH SYNOPSIS +.nf +.B "#include " +.sp +.BI "int mbind(void *" addr ", unsigned long " len ", int " mode , +.BI " unsigned long *" nodemask ", unsigned long " maxnode , +.BI " unsigned " flags ); +.sp +Link with \fI\-lnuma\fP. +.fi +.SH DESCRIPTION +.BR mbind () +sets the NUMA memory policy, +which consists of a policy mode and zero or more nodes, +for the memory range starting with +.I addr +and continuing for +.I len +bytes. +The memory policy defines from which node memory is allocated. + +If the memory range specified by the +.IR addr " and " len +arguments includes an "anonymous" region of memory\(emthat is +a region of memory created using the +.BR mmap (2) +system call with the +.BR MAP_ANONYMOUS \(emor +a memory mapped file, mapped using the +.BR mmap (2) +system call with the +.B MAP_PRIVATE +flag, pages will only be allocated according to the specified +policy when the application writes [stores] to the page. +For anonymous regions, an initial read access will use a shared +page in the kernel containing all zeros. +For a file mapped with +.BR MAP_PRIVATE , +an initial read access will allocate pages according to the +process policy of the process that causes the page to be allocated. +This may not be the process that called +.BR mbind (). + +The specified policy will be ignored for any +.B MAP_SHARED +mappings in the specified memory range. +Rather the pages will be allocated according to the process policy +of the process that caused the page to be allocated. +Again, this may not be the process that called +.BR mbind (). + +If the specified memory range includes a shared memory region +created using the +.BR shmget (2) +system call and attached using the +.BR shmat (2) +system call, +pages allocated for the anonymous or shared memory region will +be allocated according to the policy specified, regardless which +process attached to the shared memory segment causes the allocation. +If, however, the shared memory region was created with the +.B SHM_HUGETLB +flag, +the huge pages will be allocated according to the policy specified +only if the page allocation is caused by the process that calls +.BR mbind () +for that region. + +By default, +.BR mbind () +only has an effect for new allocations; if the pages inside +the range have been already touched before setting the policy, +then the policy has no effect. +This default behavior may be overridden by the +.B MPOL_MF_MOVE +and +.B MPOL_MF_MOVE_ALL +flags described below. + +The +.I mode +argument must specify one of +.BR MPOL_DEFAULT , +.BR MPOL_BIND , +.B MPOL_INTERLEAVE +or +.BR MPOL_PREFERRED . +All policy modes except +.B MPOL_DEFAULT +require the caller to specify via the +.I nodemask +argument, +the node or nodes to which the mode applies. + +The +.I mode +argument may also include an optional +.IR "mode flag ". +The supported +.I "mode flags" +are: +.TP +.BR MPOL_F_STATIC_NODES " (since Linux-2.6.26)" +A nonempty +.I nodemask +specifies physical node ids. +Linux does not remap the +.I nodemask +when the process moves to a different cpuset context, +nor when the set of nodes allowed by the process's +current cpuset context changes. +.TP +.BR MPOL_F_RELATIVE_NODES " (since Linux-2.6.26)" +A nonempty +.I nodemask +specifies node ids that are relative to the set of +node ids allowed by the process's current cpuset. +.PP +.I nodemask +points to a bitmask of nodes containing up to +.I maxnode +bits. +The bit mask size is rounded to the next multiple of +.IR "sizeof(unsigned long)" , +but the kernel will only use bits up to +.IR maxnode . +A NULL value of +.I nodemask +or a +.I maxnode +value of zero specifies the empty set of nodes. +If the value of +.I maxnode +is zero, +the +.I nodemask +argument is ignored. +Where a +.I nodemask +is required, it must contain at least one node that is on-line, +allowed by the process's current cpuset context +[unless the +.B MPOL_F_STATIC_NODES +mode flag is specified], +and contains memory. + +The +.B MPOL_DEFAULT +mode requests that any nondefault policy be removed, +restoring default behavior. +When applied to a range of memory via +.BR mbind (), +this means to use the process policy, +which may have been set with +.BR set_mempolicy (2). +If the mode of the process policy is also +.BR MPOL_DEFAULT , +the system-wide default policy will be used. +The system-wide default policy allocates +pages on the node of the CPU that triggers the allocation. +For +.BR MPOL_DEFAULT , +the +.I nodemask +and +.I maxnode +arguments must be specify the empty set of nodes. + +The +.B MPOL_BIND +mode specifies a strict policy that restricts memory allocation to +the nodes specified in +.IR nodemask . +If +.I nodemask +specifies more than one node, page allocations will come from +the node with the lowest numeric node ID first, until that node +contains no free memory. +Allocations will then come from the node with the next highest +node ID specified in +.I nodemask +and so forth, until none of the specified nodes contain free memory. +Pages will not be allocated from any node not specified in the +.IR nodemask . + +The +.B MPOL_INTERLEAVE +mode specifies that page allocations be interleaved across the +set of nodes specified in +.IR nodemask . +This optimizes for bandwidth instead of latency +by spreading out pages and memory accesses to those pages across +multiple nodes. +To be effective the memory area should be fairly large, +at least 1MB or bigger with a fairly uniform access pattern. +Accesses to a single page of the area will still be limited to +the memory bandwidth of a single node. + +.B MPOL_PREFERRED +sets the preferred node for allocation. +The kernel will try to allocate pages from this +node first and fall back to other nodes if the +preferred nodes is low on free memory. +If +.I nodemask +specifies more than one node ID, the first node in the +mask will be selected as the preferred node. +If the +.I nodemask +and +.I maxnode +arguments specify the empty set, then the memory is allocated on +the node of the CPU that triggered the allocation. +This is the only way to specify "local allocation" for a +range of memory via +.BR mbind (). + +If +.B MPOL_MF_STRICT +is passed in +.I flags +and +.I policy +is not +.BR MPOL_DEFAULT , +then the call will fail with the error +.B EIO +if the existing pages in the memory range don't follow the policy. +.\" According to the kernel code, the following is not true +.\" --Lee Schermerhorn +.\" In 2.6.16 or later the kernel will also try to move pages +.\" to the requested node with this flag. + +If +.B MPOL_MF_MOVE +is specified in +.IR flags , +then the kernel will attempt to move all the existing pages +in the memory range so that they follow the policy. +Pages that are shared with other processes will not be moved. +If +.B MPOL_MF_STRICT +is also specified, then the call will fail with the error +.B EIO +if some pages could not be moved. + +If +.B MPOL_MF_MOVE_ALL +is passed in +.IR flags , +then the kernel will attempt to move all existing pages in the memory range +regardless of whether other processes use the pages. +The calling process must be privileged +.RB ( CAP_SYS_NICE ) +to use this flag. +If +.B MPOL_MF_STRICT +is also specified, then the call will fail with the error +.B EIO +if some pages could not be moved. +.\" --------------------------------------------------------------- +.SH RETURN VALUE +On success, +.BR mbind () +returns 0; +on error, \-1 is returned and +.I errno +is set to indicate the error. +.\" --------------------------------------------------------------- +.SH ERRORS +.\" I think I got all of the error returns. --Lee Schermerhorn +.TP +.B EFAULT +Part or all of the memory range specified by +.I nodemask +and +.I maxnode +points outside your accessible address space. +Or, there was an unmapped hole in the specified memory range. +.TP +.B EINVAL +An invalid value was specified for +.I flags +or +.IR mode ; +or +.I addr + len +was less than +.IR addr ; +or +.I addr +is not a multiple of the system page size. +Or, +.I mode +is +.B MPOL_DEFAULT +and +.I nodemask +specified a nonempty set; +or +.I mode +is +.B MPOL_BIND +or +.B MPOL_INTERLEAVE +and +.I nodemask +is empty. +Or, +.I maxnode +exceeds a kernel-imposed limit. +.\" As at 2.6.23, this limit is "a page worth of bits", e.g., +.\" 8 * 4096 bits, assuming a 4kB page size. +Or, +.I nodemask +specifies one or more node IDs that are +greater than the maximum supported node ID. +Or, none of the node IDs specified by +.I nodemask +are on-line and allowed by the process's current cpuset context, +or none of the specified nodes contain memory. +Or, the +.I mode +argument specified both +.B MPOL_F_STATIC_NODES +and +.BR MPOL_F_RELATIVE_NODES . +.TP +.B EIO +.B MPOL_MF_STRICT +was specified and an existing page was already on a node +that does not follow the policy; +or +.B MPOL_MF_MOVE +or +.B MPOL_MF_MOVE_ALL +was specified and the kernel was unable to move all existing +pages in the range. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B EPERM +The +.I flags +argument included the +.B MPOL_MF_MOVE_ALL +flag and the caller does not have the +.B CAP_SYS_NICE +privilege. +.\" --------------------------------------------------------------- +.SH VERSIONS +The +.BR mbind () +system call was added to the Linux kernel in version 2.6.7. +.SH CONFORMING TO +This system call is Linux-specific. +.SH NOTES +For information on library support, see +.BR numa (7). + +NUMA policy is not supported on a memory mapped file range +that was mapped with the +.B MAP_SHARED +flag. + +The +.B MPOL_DEFAULT +mode can have different effects for +.BR mbind () +and +.BR set_mempolicy (2). +When +.B MPOL_DEFAULT +is specified for +.BR set_mempolicy (2), +the process's policy reverts to system default policy +or local allocation. +When +.B MPOL_DEFAULT +is specified for a range of memory using +.BR mbind (), +any pages subsequently allocated for that range will use +the process's policy, as set by +.BR set_mempolicy (2). +This effectively removes the explicit policy from the +specified range, "falling back" to a possibly nondefault +policy. +To select explicit "local allocation" for a memory range, +specify a +.I mode +of +.B MPOL_PREFERRED +with an empty set of nodes. +This method will work for +.BR set_mempolicy (2), +as well. + +Support for huge page policy was added with 2.6.16. +For interleave policy to be effective on huge page mappings the +policied memory needs to be tens of megabytes or larger. + +.B MPOL_MF_STRICT +is ignored on huge page mappings. + +.B MPOL_MF_MOVE +and +.B MPOL_MF_MOVE_ALL +are only available on Linux 2.6.16 and later. +.SH SEE ALSO +.BR get_mempolicy (2), +.BR getcpu (2), +.BR mmap (2), +.BR set_mempolicy (2), +.BR shmat (2), +.BR shmget (2), +.BR numa (3), +.BR cpuset (7), +.BR numa (7), +.BR numactl (8) diff --git a/original/man2/mincore.2 b/original/man2/mincore.2 new file mode 100644 index 00000000..d827267d --- /dev/null +++ b/original/man2/mincore.2 @@ -0,0 +1,168 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2001 Bert Hubert +.\" 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. +.\" +.\" Created Sun Jun 3 17:23:32 2001 by bert hubert +.\" Slightly adapted, following comments by Hugh Dickins, aeb, 2001-06-04. +.\" Modified, 20 May 2003, Michael Kerrisk +.\" Modified, 30 Apr 2004, Michael Kerrisk +.\" 2005-04-05 mtk, Fixed error descriptions +.\" after message from +.\" 2007-01-08 mtk, rewrote various parts +.\" +.TH MINCORE 2 2008-04-22 "Linux" "Linux Programmer's Manual" +.SH NAME +mincore \- determine whether pages are resident in memory +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "int mincore(void *" addr ", size_t " length ", unsigned char *" vec ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR mincore (): +_BSD_SOURCE || _SVID_SOURCE +.SH DESCRIPTION +.BR mincore () +returns a vector that indicates whether pages +of the calling process's virtual memory are resident in core (RAM), +and so will not cause a disk access (page fault) if referenced. +The kernel returns residency information about the pages +starting at the address +.IR addr , +and continuing for +.I length +bytes. + +The +.I addr +argument must be a multiple of the system page size. +The +.I length +argument need not be a multiple of the page size, +but since residency information is returned for whole pages, +.I length +is effectively rounded up to the next multiple of the page size. +One may obtain the page size +.RB ( PAGE_SIZE ) +using +.IR sysconf(_SC_PAGESIZE) . + +The +.I vec +argument must point to an array containing at least +.I "(length+PAGE_SIZE\-1) / PAGE_SIZE" +bytes. +On return, +the least significant bit of each byte will be set if +the corresponding page is currently resident in memory, +and be clear otherwise. +(The settings of the other bits in each byte are undefined; +these bits are reserved for possible later use.) +Of course the information returned in +.I vec +is only a snapshot: pages that are not +locked in memory can come and go at any moment, and the contents of +.I vec +may already be stale by the time this call returns. +.SH "RETURN VALUE" +On success, +.BR mincore () +returns zero. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.B EAGAIN +kernel is temporarily out of resources. +.TP +.B EFAULT +.I vec +points to an invalid address. +.TP +.B EINVAL +.I addr +is not a multiple of the page size. +.TP +.B ENOMEM +.I length +is greater than +.RI ( TASK_SIZE " \- " addr ). +(This could occur if a negative value is specified for +.IR length , +since that value will be interpreted as a large +unsigned integer.) +In Linux 2.6.11 and earlier, the error +.B EINVAL +was returned for this condition. +.TP +.B ENOMEM +.I addr +to +.I addr ++ +.I length +contained unmapped memory. +.SH VERSIONS +Available since Linux 2.3.99pre1 and glibc 2.2. +.SH "CONFORMING TO" +.BR mincore () +is not specified in POSIX.1-2001, +and it is not available on all Unix implementations. +.\" It is on at least NetBSD, FreeBSD, OpenBSD, Solaris 8, +.\" AIX 5.1, SunOS 4.1 +.\" .SH HISTORY +.\" The +.\" .BR mincore () +.\" function first appeared in 4.4BSD. +.SH BUGS +Before kernel 2.6.21, +.BR mincore () +did not return correct information for +.B MAP_PRIVATE +mappings, or for nonlinear mappings (established using +.BR remap_file_pages (2)). +.\" Linux (up to now, 2.6.5), +.\" .B mincore +.\" does not return correct information for MAP_PRIVATE mappings: +.\" for a MAP_PRIVATE file mapping, +.\" .B mincore +.\" 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 +.\" always reports pages as nonresident; +.\" and for a MAP_PRIVATE, MAP_ANONYMOUS mapping, +.\" .B mincore +.\" always fails with the error +.\" .BR ENOMEM . +.SH "SEE ALSO" +.BR mlock (2), +.BR mmap (2) diff --git a/original/man2/mkdir.2 b/original/man2/mkdir.2 new file mode 100644 index 00000000..e6cb28c5 --- /dev/null +++ b/original/man2/mkdir.2 @@ -0,0 +1,135 @@ +.\" 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. +.\" +.TH MKDIR 2 2008-05-13 "Linux" "Linux Programmer's Manual" +.SH NAME +mkdir \- create a directory +.SH SYNOPSIS +.nf +.B #include +.B #include +.\" .B #include +.sp +.BI "int mkdir(const char *" pathname ", mode_t " mode ); +.fi +.SH DESCRIPTION +.BR mkdir () +attempts to create a directory named +.IR pathname . + +The argument +.I mode +specifies the permissions to use. +It is modified by the process's +.I umask +in the usual way: the permissions of the created directory are +.RI ( mode " & ~" umask " & 0777)." +Other mode bits of the created directory depend on the operating system. +For Linux, see below. + +The newly created directory will be owned by the effective user ID of the +process. +If the directory containing the file has the set-group-ID +bit set, or if the file system is mounted with BSD group semantics +.RI ( "mount -o bsdgroups" +or, synonymously +.IR "mount -o grpid" ), +the new directory will inherit the group ownership from its parent; +otherwise it will be owned by the effective group ID of the process. + +If the parent directory has the set-group-ID bit set then so will the +newly created directory. +.SH "RETURN VALUE" +.BR mkdir () +returns zero on success, or \-1 if an error occurred (in which case, +.I errno +is set appropriately). +.SH ERRORS +.TP +.B EACCES +The parent directory does not allow write permission to the process, +or one of the directories in +.I pathname +did not allow search permission. +(See also +.BR path_resolution (7).) +.TP +.B EEXIST +.I pathname +already exists (not necessarily as a directory). +This includes the case where +.I pathname +is a symbolic link, dangling or not. +.TP +.B EFAULT +.IR pathname " points outside your accessible address space." +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR pathname . +.TP +.B ENAMETOOLONG +.IR pathname " was too long." +.TP +.B ENOENT +A directory component in +.I pathname +does not exist or is a dangling symbolic link. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOSPC +The device containing +.I pathname +has no room for the new directory. +.TP +.B ENOSPC +The new directory cannot be created because the user's disk quota is +exhausted. +.TP +.B ENOTDIR +A component used as a directory in +.I pathname +is not, in fact, a directory. +.TP +.B EPERM +The file system containing +.I pathname +does not support the creation of directories. +.TP +.B EROFS +.I pathname +refers to a file on a read-only file system. +.SH "CONFORMING TO" +SVr4, BSD, POSIX.1-2001. +.\" SVr4 documents additional EIO, EMULTIHOP +.SH NOTES +Under Linux apart from the permission bits, only the +.B S_ISVTX +mode bit is honored. +That is, under Linux the created directory actually gets mode +.RI ( mode " & ~" umask " & 01777)." +See also +.BR stat (2). +.PP +There are many infelicities in the protocol underlying NFS. +Some of these affect +.BR mkdir (). +.SH "SEE ALSO" +.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/original/man2/mkdirat.2 b/original/man2/mkdirat.2 new file mode 100644 index 00000000..82dfe5cf --- /dev/null +++ b/original/man2/mkdirat.2 @@ -0,0 +1,119 @@ +.\" 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. +.\" +.\" +.TH MKDIRAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +mkdirat \- create a directory relative to a directory file descriptor +.SH SYNOPSIS +.nf +.B #include /* Definition of AT_* constants */ +.B #include +.sp +.BI "int mkdirat(int " dirfd ", const char *" pathname ", mode_t " mode ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR mkdirat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +The +.BR mkdirat () +system call operates in exactly the same way as +.BR mkdir (2), +except for the differences described in this manual page. + +If the pathname given in +.I pathname +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I dirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR mkdir (2) +for a relative pathname). + +If +.I pathname +is relative and +.I dirfd +is the special value +.BR AT_FDCWD , +then +.I pathname +is interpreted relative to the current working +directory of the calling process (like +.BR mkdir (2)). + +If +.I pathname +is absolute, then +.I dirfd +is ignored. +.SH "RETURN VALUE" +On success, +.BR mkdirat () +returns 0. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR mkdir (2) +can also occur for +.BR mkdirat (). +The following additional errors can occur for +.BR mkdirat (): +.TP +.B EBADF +.I dirfd +is not a valid file descriptor. +.TP +.B ENOTDIR +.I pathname +is relative and +.I dirfd +is a file descriptor referring to a file other than a directory. +.SH VERSIONS +.BR mkdirat () +was added to Linux in kernel 2.6.16. +.SH "CONFORMING TO" +POSIX.1-2008. +.SH NOTES +See +.BR openat (2) +for an explanation of the need for +.BR mkdirat (). +.SH "SEE ALSO" +.BR mkdir (2), +.BR openat (2), +.BR path_resolution (7) diff --git a/original/man2/mknod.2 b/original/man2/mknod.2 new file mode 100644 index 00000000..43accb5f --- /dev/null +++ b/original/man2/mknod.2 @@ -0,0 +1,212 @@ +.\" 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. +.\" +.\" Modified 1996-08-18 by urs +.\" Modified 2003-04-23 by Michael Kerrisk +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.TH MKNOD 2 2008-12-01 "Linux" "Linux Programmer's Manual" +.SH NAME +mknod \- create a special or ordinary file +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.B #include +.sp +.BI "int mknod(const char *" pathname ", mode_t " mode ", dev_t " dev ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR mknod (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +The system call +.BR mknod () +creates a file system node (file, device special file or +named pipe) named +.IR pathname , +with attributes specified by +.I mode +and +.IR dev . + +The +.I mode +argument specifies both the permissions to use and the type of node +to be created. +It should be a combination (using bitwise OR) of one of the file types +listed below and the permissions for the new node. + +The permissions are modified by the process's +.I umask +in the usual way: the permissions of the created node are +.IR "(mode & ~umask)" . + +The file type must be one of +.BR S_IFREG , +.BR S_IFCHR , +.BR S_IFBLK , +.B S_IFIFO +or +.B S_IFSOCK +.\" (S_IFSOCK since Linux 1.2.4) +to specify a regular file (which will be created empty), character +special file, block special file, FIFO (named pipe), or Unix domain socket, +respectively. +(Zero file type is equivalent to type +.BR S_IFREG .) + +If the file type is +.B S_IFCHR +or +.B S_IFBLK +then +.I dev +specifies the major and minor numbers of the newly created device +special file +.RB ( makedev (3) +may be useful to build the value for +.IR dev ); +otherwise it is ignored. + +If +.I pathname +already exists, or is a symbolic link, this call fails with an +.B EEXIST +error. + +The newly created node will be owned by the effective user ID of the +process. +If the directory containing the node has the set-group-ID +bit set, or if the file system is mounted with BSD group semantics, the +new node will inherit the group ownership from its parent directory; +otherwise it will be owned by the effective group ID of the process. +.SH "RETURN VALUE" +.BR mknod () +returns zero on success, or \-1 if an error occurred (in which case, +.I errno +is set appropriately). +.SH ERRORS +.TP +.B EACCES +The parent directory does not allow write permission to the process, +or one of the directories in the path prefix of +.I pathname +did not allow search permission. +(See also +.BR path_resolution (7).) +.TP +.B EEXIST +.I pathname +already exists. +This includes the case where +.I pathname +is a symbolic link, dangling or not. +.TP +.B EFAULT +.IR pathname " points outside your accessible address space." +.TP +.B EINVAL +.I mode +requested creation of something other than a regular file, device +special file, FIFO or socket. +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR pathname . +.TP +.B ENAMETOOLONG +.IR pathname " was too long." +.TP +.B ENOENT +A directory component in +.I pathname +does not exist or is a dangling symbolic link. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOSPC +The device containing +.I pathname +has no room for the new node. +.TP +.B ENOTDIR +A component used as a directory in +.I pathname +is not, in fact, a directory. +.TP +.B EPERM +.I mode +requested creation of something other than a regular file, +FIFO (named pipe), or Unix domain socket, and the caller +is not privileged (Linux: does not have the +.B CAP_MKNOD +capability); +.\" For Unix domain sockets and regular files, EPERM is only returned in +.\" Linux 2.2 and earlier; in Linux 2.4 and later, unprivileged can +.\" use mknod() to make these files. +also returned if the file system containing +.I pathname +does not support the type of node requested. +.TP +.B EROFS +.I pathname +refers to a file on a read-only file system. +.SH "CONFORMING TO" +SVr4, 4.4BSD, POSIX.1-2001 (but see below). +.\" The Linux version differs from the SVr4 version in that it +.\" does not require root permission to create pipes, also in that no +.\" EMULTIHOP, ENOLINK, or EINTR error is documented. +.SH NOTES +POSIX.1-2001 says: "The only portable use of +.BR mknod () +is to create a FIFO-special file. +If +.I mode +is not +.B S_IFIFO +or +.I dev +is not 0, the behavior of +.BR mknod () +is unspecified." +However, nowadays one should never use +.BR mknod () +for this purpose; one should use +.BR mkfifo (3), +a function especially defined for this purpose. + +Under Linux, this call cannot be used to create directories. +One should make directories with +.BR mkdir (2). +.\" and one should make Unix domain sockets with socket(2) and bind(2). + +There are many infelicities in the protocol underlying NFS. +Some of these affect +.BR mknod (). +.SH "SEE ALSO" +.BR chmod (2), +.BR chown (2), +.BR fcntl (2), +.BR mkdir (2), +.BR mknodat (2), +.BR mount (2), +.BR socket (2), +.BR stat (2), +.BR umask (2), +.BR unlink (2), +.BR makedev (3), +.BR mkfifo (3), +.BR path_resolution (7) diff --git a/original/man2/mknodat.2 b/original/man2/mknodat.2 new file mode 100644 index 00000000..d37da29d --- /dev/null +++ b/original/man2/mknodat.2 @@ -0,0 +1,121 @@ +.\" 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. +.\" +.\" +.TH MKNODAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +mknodat \- create a special or ordinary file relative to a directory +file descriptor +.SH SYNOPSIS +.nf +.B #include /* Definition of AT_* constants */ +.B #include +.sp +.BI "int mknodat(int " dirfd ", const char *" pathname ", mode_t " mode \ +", dev_t " dev ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR mknodat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +The +.BR mknodat () +system call operates in exactly the same way as +.BR mknod (2), +except for the differences described in this manual page. + +If the pathname given in +.I pathname +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I dirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR mknod (2) +for a relative pathname). + +If +.I pathname +is relative and +.I dirfd +is the special value +.BR AT_FDCWD , +then +.I pathname +is interpreted relative to the current working +directory of the calling process (like +.BR mknod (2)). + +If +.I pathname +is absolute, then +.I dirfd +is ignored. +.SH "RETURN VALUE" +On success, +.BR mknodat () +returns 0. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR mknod (2) +can also occur for +.BR mknodat (). +The following additional errors can occur for +.BR mknodat (): +.TP +.B EBADF +.I dirfd +is not a valid file descriptor. +.TP +.B ENOTDIR +.I pathname +is relative and +.I dirfd +is a file descriptor referring to a file other than a directory. +.SH VERSIONS +.BR mknodat () +was added to Linux in kernel 2.6.16. +.SH "CONFORMING TO" +POSIX.1-2008. +.SH NOTES +See +.BR openat (2) +for an explanation of the need for +.BR mknodat (). +.SH "SEE ALSO" +.BR mknod (2), +.BR openat (2), +.BR path_resolution (7) diff --git a/original/man2/mlock.2 b/original/man2/mlock.2 new file mode 100644 index 00000000..07e3119a --- /dev/null +++ b/original/man2/mlock.2 @@ -0,0 +1,329 @@ +.\" 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. +.\" +.TH MLOCK 2 2008-09-25 "Linux" "Linux Programmer's Manual" +.SH NAME +mlock, munlock, mlockall, munlockall \- lock and unlock memory +.SH SYNOPSIS +.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 +.SH DESCRIPTION +.BR mlock () +and +.BR mlockall () +respectively lock part or all of the calling process's virtual address +space into RAM, preventing that memory from being paged to the +swap area. +.BR munlock () +and +.BR munlockall () +perform the converse operation, +respectively unlocking part or all of the calling process's virtual +address space, so that pages in the specified virtual address range may +once more to be swapped out if required by the kernel memory manager. +Memory locking and unlocking are performed in units of whole pages. +.SS "mlock() and munlock()" +.BR mlock () +locks pages in the address range starting at +.I addr +and continuing for +.I len +bytes. +All pages that contain a part of the specified address range are +guaranteed to be resident in RAM when the call returns successfully; +the pages are guaranteed to stay in RAM until later unlocked. + +.BR munlock () +unlocks pages in the address range starting at +.I addr +and continuing for +.I len +bytes. +After this call, all pages that contain a part of the specified +memory range can be moved to external swap space again by the kernel. +.SS "mlockall() and munlockall()" +.BR mlockall () +locks all pages mapped into the address space of the +calling process. +This includes the pages of the code, data and stack +segment, as well as shared libraries, user space kernel data, shared +memory, and memory-mapped files. +All mapped pages are guaranteed +to be resident in RAM when the call returns successfully; +the pages are guaranteed to stay in RAM until later unlocked. + +The +.I flags +argument is constructed as the bitwise OR of one or more of the +following constants: +.TP 1.2i +.B MCL_CURRENT +Lock all pages which are currently mapped into the address space of +the process. +.TP +.B MCL_FUTURE +Lock all pages which will become mapped into the address space of the +process in the future. +These could be for instance new pages required +by a growing heap and stack as well as new memory mapped files or +shared memory regions. +.PP +If +.B MCL_FUTURE +has been specified, then a later system call (e.g., +.BR mmap (2), +.BR sbrk (2), +.BR malloc (3)), +may fail if it would cause the number of locked bytes to exceed +the permitted maximum (see below). +In the same circumstances, stack growth may likewise fail: +the kernel will deny stack expansion and deliver a +.B SIGSEGV +signal to the process. + +.BR munlockall () +unlocks all pages mapped into the address space of the +calling process. +.SH "RETURN VALUE" +On success these system calls return 0. +On error, \-1 is returned, +.I errno +is set appropriately, and no changes are made to any locks in the +address space of the process. +.SH ERRORS +.TP +.B ENOMEM +(Linux 2.6.9 and later) the caller had a nonzero +.B RLIMIT_MEMLOCK +soft resource limit, but tried to lock more memory than the limit +permitted. +This limit is not enforced if the process is privileged +.RB ( CAP_IPC_LOCK ). +.TP +.B ENOMEM +(Linux 2.4 and earlier) the calling process tried to lock more than +half of RAM. +.\" In the case of mlock(), this check is somewhat buggy: it doesn't +.\" take into account whether the to-be-locked range overlaps with +.\" already locked pages. Thus, suppose we allocate +.\" (num_physpages / 4 + 1) of memory, and lock those pages once using +.\" mlock(), and then lock the *same* page range a second time. +.\" In the case, the second mlock() call will fail, since the check +.\" calculates that the process is trying to lock (num_physpages / 2 + 2) +.\" pages, which of course is not true. (MTK, Nov 04, kernel 2.4.28) +.TP +.B EPERM +(Linux 2.6.9 and later) the caller was not privileged +.RB ( CAP_IPC_LOCK ) +and its +.B RLIMIT_MEMLOCK +soft resource limit was 0. +.TP +.B EPERM +(Linux 2.6.8 and earlier) +The calling process has insufficient privilege to call +.BR munlockall (). +Under Linux the +.B CAP_IPC_LOCK +capability is required. +.\"SVr4 documents an additional EAGAIN error code. +.LP +For +.BR mlock () +and +.BR munlock (): +.TP +.B EAGAIN +Some or all of the specified address range could not be locked. +.TP +.B EINVAL +.I len +was negative. +.TP +.B EINVAL +(Not on Linux) +.I addr +was not a multiple of the page size. +.TP +.B ENOMEM +Some of the specified address range does not correspond to mapped +pages in the address space of the process. +.LP +For +.BR mlockall (): +.TP +.B EINVAL +Unknown \fIflags\fP were specified. +.LP +For +.BR munlockall (): +.TP +.B EPERM +(Linux 2.6.8 and earlier) The caller was not privileged +.RB ( CAP_IPC_LOCK ). +.SH "CONFORMING TO" +POSIX.1-2001, SVr4. +.SH AVAILABILITY +On POSIX systems on which +.BR mlock () +and +.BR munlock () +are available, +.B _POSIX_MEMLOCK_RANGE +is defined in \fI\fP and the number of bytes in a page +can be determined from the constant +.B PAGESIZE +(if defined) in \fI\fP or by calling +.IR sysconf(_SC_PAGESIZE) . + +On POSIX systems on which +.BR mlockall () +and +.BR munlockall () +are available, +.B _POSIX_MEMLOCK +is defined in \fI\fP to a value greater than 0. +(See also +.BR sysconf (3).) +.\" POSIX.1-2001: It shall be defined to -1 or 0 or 200112L. +.\" -1: unavailable, 0: ask using sysconf(). +.\" glibc defines it to 1. +.SH "NOTES" +Memory locking has two main applications: real-time algorithms and +high-security data processing. +Real-time applications require +deterministic timing, and, like scheduling, paging is one major cause +of unexpected program execution delays. +Real-time applications will +usually also switch to a real-time scheduler with +.BR sched_setscheduler (2). +Cryptographic security software often handles critical bytes like +passwords or secret keys as data structures. +As a result of paging, +these secrets could be transferred onto a persistent swap store medium, +where they might be accessible to the enemy long after the security +software has erased the secrets in RAM and terminated. +(But be aware that the suspend mode on laptops and some desktop +computers will save a copy of the system's RAM to disk, regardless +of memory locks.) + +Real-time processes that are using +.BR mlockall () +to prevent delays on page faults should reserve enough +locked stack pages before entering the time-critical section, +so that no page fault can be caused by function calls. +This can be achieved by calling a function that allocates a +sufficiently large automatic variable (an array) and writes to the +memory occupied by this array in order to touch these stack pages. +This way, enough pages will be mapped for the stack and can be +locked into RAM. +The dummy writes ensure that not even copy-on-write +page faults can occur in the critical section. + +Memory locks are not inherited by a child created via +.BR fork (2) +and are automatically removed (unlocked) during an +.BR execve (2) +or when the process terminates. + +The memory lock on an address range is automatically removed +if the address range is unmapped via +.BR munmap (2). + +Memory locks do not stack, that is, pages which have been locked several times +by calls to +.BR mlock () +or +.BR mlockall () +will be unlocked by a single call to +.BR munlock () +for the corresponding range or by +.BR munlockall (). +Pages which are mapped to several locations or by several processes stay +locked into RAM as long as they are locked at least at one location or by +at least one process. +.SS "Linux Notes" +Under Linux, +.BR mlock () +and +.BR munlock () +automatically round +.I addr +down to the nearest page boundary. +However, POSIX.1-2001 allows an implementation to require that +.I addr +is page aligned, so portable applications should ensure this. +.SS "Limits and permissions" +In Linux 2.6.8 and earlier, +a process must be privileged +.RB ( CAP_IPC_LOCK ) +in order to lock memory and the +.B RLIMIT_MEMLOCK +soft resource limit defines a limit on how much memory the process may lock. + +Since Linux 2.6.9, no limits are placed on the amount of memory +that a privileged process can lock and the +.B RLIMIT_MEMLOCK +soft resource limit instead defines a limit on how much memory an +unprivileged process may lock. +.SH "BUGS" +In the 2.4 series Linux kernels up to and including 2.4.17, +a bug caused the +.BR mlockall () +.B MCL_FUTURE +flag to be inherited across a +.BR fork (2). +This was rectified in kernel 2.4.18. + +Since kernel 2.6.9, if a privileged process calls +.I mlockall(MCL_FUTURE) +and later drops privileges (loses the +.B CAP_IPC_LOCK +capability by, for example, +setting its effective UID to a nonzero value), +then subsequent memory allocations (e.g., +.BR mmap (2), +.BR brk (2)) +will fail if the +.B RLIMIT_MEMLOCK +resource limit is encountered. +.\" See the following LKML thread: +.\" http://marc.theaimsgroup.com/?l=linux-kernel&m=113801392825023&w=2 +.\" "Rationale for RLIMIT_MEMLOCK" +.\" 23 Jan 2006 +.SH "SEE ALSO" +.BR mmap (2), +.BR setrlimit (2), +.BR shmctl (2), +.BR sysconf (3), +.BR capabilities (7) diff --git a/original/man2/mlockall.2 b/original/man2/mlockall.2 new file mode 100644 index 00000000..5e5b3c74 --- /dev/null +++ b/original/man2/mlockall.2 @@ -0,0 +1 @@ +.so man2/mlock.2 diff --git a/original/man2/mmap.2 b/original/man2/mmap.2 new file mode 100644 index 00000000..af539b64 --- /dev/null +++ b/original/man2/mmap.2 @@ -0,0 +1,656 @@ +.\" 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 +.\" +.TH MMAP 2 2009-09-26 "Linux" "Linux Programmer's Manual" +.SH NAME +mmap, munmap \- map or unmap files or devices into memory +.SH SYNOPSIS +.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 +.SH DESCRIPTION +.BR mmap () +creates a new mapping in the virtual address space of +the calling process. +The starting address for the new mapping is specified in +.IR addr . +The +.I length +argument specifies the length of the mapping. + +If +.I addr +is NULL, +then the kernel chooses the address at which to create the mapping; +this is the most portable method of creating a new mapping. +If +.I addr +is not NULL, +then the kernel takes it as a hint about where to place the mapping; +on Linux, the mapping will be created at a nearby page boundary. +.\" Before Linux 2.6.24, the address was rounded up to the next page +.\" boundary; since 2.6.24, it is rounded down! +The address of the new mapping is returned as the result of the call. + +The contents of a file mapping (as opposed to an anonymous mapping; see +.B MAP_ANONYMOUS +below), are initialized using +.I length +bytes starting at offset +.I offset +in the file (or other object) referred to by the file descriptor +.IR fd . +.I offset +must be a multiple of the page size as returned by +.IR sysconf(_SC_PAGE_SIZE) . +.LP +The +.I prot +argument describes the desired memory protection of the mapping +(and must not conflict with the open mode of the file). +It is either +.B PROT_NONE +or the bitwise OR of one or more of the following flags: +.TP 1.1i +.B PROT_EXEC +Pages may be executed. +.TP +.B PROT_READ +Pages may be read. +.TP +.B PROT_WRITE +Pages may be written. +.TP +.B PROT_NONE +Pages may not be accessed. +.LP +The +.I flags +argument determines whether updates to the mapping +are visible to other processes mapping the same region, +and whether updates are carried through to the underlying file. +This behavior is determined by including exactly one +of the following values in +.IR flags : +.TP 1.1i +.B MAP_SHARED +Share this mapping. +Updates to the mapping are visible to other processes that map this file, +and are carried through to the underlying file. +The file may not actually be updated until +.BR msync (2) +or +.BR munmap () +is called. +.TP +.B MAP_PRIVATE +Create a private copy-on-write mapping. +Updates to the mapping are not visible to other processes +mapping the same file, and are not carried through to +the underlying file. +It is unspecified whether changes made to the file after the +.BR mmap () +call are visible in the mapped region. +.LP +Both of these flags are described in POSIX.1-2001. + +In addition, zero or more of the following values can be ORed in +.IR flags : +.TP +.BR MAP_32BIT " (since Linux 2.4.20, 2.6)" +Put the mapping into the first 2 Gigabytes of the process address space. +This flag is only supported on x86-64, for 64-bit programs. +It was added to allow thread stacks to be allocated somewhere +in the first 2GB of memory, +so as to improve context-switch performance on some early +64-bit processors. +.\" See http://lwn.net/Articles/294642 "Tangled up in threads", 19 Aug 08 +Modern x86-64 processors no longer have this performance problem, +so use of this flag is not required on those systems. +The +.B MAP_32BIT +flag is ignored when +.B MAP_FIXED +is set. +.TP +.B MAP_ANON +Synonym for +.BR MAP_ANONYMOUS . +Deprecated. +.TP +.B MAP_ANONYMOUS +The mapping is not backed by any file; +its contents are initialized to zero. +The +.I fd +and +.I offset +arguments are ignored; +however, some implementations require +.I fd +to be \-1 if +.B MAP_ANONYMOUS +(or +.BR MAP_ANON ) +is specified, +and portable applications should ensure this. +The use of +.B MAP_ANONYMOUS +in conjunction with +.B MAP_SHARED +is only supported on Linux since kernel 2.4. +.TP +.B MAP_DENYWRITE +This flag is ignored. +.\" Introduced in 1.1.36, removed in 1.3.24. +(Long ago, it signaled that attempts to write to the underlying file +should fail with +.BR ETXTBUSY . +But this was a source of denial-of-service attacks.) +.TP +.B MAP_EXECUTABLE +This flag is ignored. +.\" Introduced in 1.1.38, removed in 1.3.24. Flag tested in proc_follow_link. +.\" (Long ago, it signaled that the underlying file is an executable. +.\" However, that information was not really used anywhere.) +.\" Linus talked about DOS related to MAP_EXECUTABLE, but he was thinking of +.\" MAP_DENYWRITE? +.TP +.B MAP_FILE +Compatibility flag. +Ignored. +.\" On some systems, this was required as the opposite of +.\" MAP_ANONYMOUS -- mtk, 1 May 2007 +.TP +.B MAP_FIXED +Don't interpret +.I addr +as a hint: place the mapping at exactly that address. +.I addr +must be a multiple of the page size. +If the memory region specified by +.I addr +and +.I len +overlaps pages of any existing mapping(s), then the overlapped +part of the existing mapping(s) will be discarded. +If the specified address cannot be used, +.BR mmap () +will fail. +Because requiring a fixed address for a mapping is less portable, +the use of this option is discouraged. +.TP +.B MAP_GROWSDOWN +Used for stacks. +Indicates to the kernel virtual memory system that the mapping +should extend downwards in memory. +.TP +.BR MAP_HUGETLB " (since Linux 2.6.32)" +Allocate the mapping using "huge pages." +See the kernel source file +.I Documentation/vm/hugetlbpage.txt +for further information. +.TP +.BR MAP_LOCKED " (since Linux 2.5.37)" +Lock the pages of the mapped region into memory in the manner of +.BR mlock (2). +This flag is ignored in older kernels. +.\" If set, the mapped pages will not be swapped out. +.TP +.BR MAP_NONBLOCK " (since Linux 2.5.46)" +Only meaningful in conjunction with +.BR MAP_POPULATE . +Don't perform read-ahead: +only create page tables entries for pages +that are already present in RAM. +Since Linux 2.6.23, this flag causes +.BR MAP_POPULATE +to do nothing. +One day the combination of +.BR MAP_POPULATE +and +.BR MAP_NONBLOCK +may be reimplemented. +.TP +.B MAP_NORESERVE +Do not reserve swap space for this mapping. +When swap space is reserved, one has the guarantee +that it is possible to modify the mapping. +When swap space is not reserved one might get +.B SIGSEGV +upon a write +if no physical memory is available. +See also the discussion of the file +.I /proc/sys/vm/overcommit_memory +in +.BR proc (5). +In kernels before 2.6, this flag only had effect for +private writable mappings. +.TP +.BR MAP_POPULATE " (since Linux 2.5.46)" +Populate (prefault) page tables for a mapping. +For a file mapping, this causes read-ahead on the file. +Later accesses to the mapping will not be blocked by page faults. +.BR MAP_POPULATE +is only supported for private mappings since Linux 2.6.23. +.LP +Of the above flags, only +.B MAP_FIXED +is specified in POSIX.1-2001. +However, most systems also support +.B MAP_ANONYMOUS +(or its synonym +.BR MAP_ANON ). +.TP +.BR MAP_STACK " (since Linux 2.6.27)" +Allocate the mapping at an address suitable for a process +or thread stack. +This flag is currently a no-op, +but is used in the glibc threading implementation so that +if some architectures require special treatment for stack allocations, +support can later be transparently implemented for 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 +Some systems document the additional flags +.BR MAP_AUTOGROW , +.BR MAP_AUTORESRV , +.BR MAP_COPY , +and +.BR MAP_LOCAL . +.LP +Memory mapped by +.BR mmap () +is preserved across +.BR fork (2), +with the same attributes. +.LP +A file is mapped in multiples of the page size. +For a file that is not +a multiple of the page size, the remaining memory is zeroed when mapped, +and writes to that region are not written out to the file. +The effect of +changing the size of the underlying file of a mapping on the pages that +correspond to added or removed regions of the file is unspecified. +.SS munmap() +The +.BR munmap () +system call deletes the mappings for the specified address range, and +causes further references to addresses within the range to generate +invalid memory references. +The region is also automatically unmapped +when the process is terminated. +On the other hand, closing the file +descriptor does not unmap the region. +.LP +The address +.I addr +must be a multiple of the page size. +All pages containing a part +of the indicated range are unmapped, and subsequent references +to these pages will generate +.BR SIGSEGV . +It is not an error if the +indicated range does not contain any mapped pages. +.SS Timestamps changes for file-backed mappings +For file-backed mappings, the +.I st_atime +field for the mapped file may be updated at any time between the +.BR mmap () +and the corresponding unmapping; the first reference to a mapped +page will update the field if it has not been already. +.LP +The +.I st_ctime +and +.I st_mtime +field for a file mapped with +.B PROT_WRITE +and +.B MAP_SHARED +will be updated after +a write to the mapped region, and before a subsequent +.BR msync (2) +with the +.B MS_SYNC +or +.B MS_ASYNC +flag, if one occurs. +.SH "RETURN VALUE" +On success, +.BR mmap () +returns a pointer to the mapped area. +On error, the value +.B MAP_FAILED +(that is, +.IR "(void\ *)\ \-1" ) +is returned, and +.I errno +is set appropriately. +On success, +.BR munmap () +returns 0, on failure \-1, and +.I errno +is set (probably to +.BR EINVAL ). +.SH ERRORS +.TP +.B EACCES +A file descriptor refers to a non-regular file. +Or +.B MAP_PRIVATE +was requested, but +.I fd +is not open for reading. +Or +.B MAP_SHARED +was requested and +.B PROT_WRITE +is set, but +.I fd +is not open in read/write +.RB ( O_RDWR ) +mode. +Or +.B PROT_WRITE +is set, but the file is append-only. +.TP +.B EAGAIN +The file has been locked, or too much memory has been locked (see +.BR setrlimit (2)). +.TP +.B EBADF +.I fd +is not a valid file descriptor (and +.B MAP_ANONYMOUS +was not set). +.TP +.B EINVAL +We don't like +.IR addr , +.IR length , +or +.I offset +(e.g., they are too large, or not aligned on a page boundary). +.TP +.B EINVAL +(since Linux 2.6.12) +.I length +was 0. +.TP +.B EINVAL +.I flags +contained neither +.B MAP_PRIVATE +or +.BR MAP_SHARED , +or contained both of these values. +.TP +.B ENFILE +.\" This is for shared anonymous segments +.\" [2.6.7] shmem_zero_setup()-->shmem_file_setup()-->get_empty_filp() +The system limit on the total number of open files has been reached. +.\" .TP +.\" .B ENOEXEC +.\" A file could not be mapped for reading. +.TP +.B ENODEV +The underlying file system of the specified file does not support +memory mapping. +.TP +.B ENOMEM +No memory is available, or the process's maximum number of mappings would +have been exceeded. +.TP +.B EPERM +The +.I prot +argument asks for +.B PROT_EXEC +but the mapped area belongs to a file on a file system that +was mounted no-exec. +.\" (Since 2.4.25 / 2.6.0.) +.TP +.B ETXTBSY +.B MAP_DENYWRITE +was set but the object specified by +.I fd +is open for writing. +.LP +Use of a mapped region can result in these signals: +.TP +.B SIGSEGV +Attempted write into a region mapped as read-only. +.TP +.B SIGBUS +Attempted access to a portion of the buffer that does not correspond +to the file (for example, beyond the end of the file, including the +case where another process has truncated the file). +.SH "CONFORMING TO" +SVr4, 4.4BSD, POSIX.1-2001. +.\" SVr4 documents additional error codes ENXIO and ENODEV. +.\" SUSv2 documents additional error codes EMFILE and EOVERFLOW. +.SH AVAILABILITY +On POSIX systems on which +.BR mmap (), +.BR msync (2) +and +.BR munmap () +are available, +.B _POSIX_MAPPED_FILES +is defined in \fI\fP to a value greater than 0. +(See also +.BR sysconf (3).) +.\" POSIX.1-2001: It shall be defined to -1 or 0 or 200112L. +.\" -1: unavailable, 0: ask using sysconf(). +.\" glibc defines it to 1. +.SH NOTES +Since kernel 2.4, this system call has been superseded by +.BR mmap2 (2). +Nowadays, +.\" Since around glibc 2.1/2.2, depending on the platform. +the glibc +.BR mmap () +wrapper function invokes +.BR mmap2 (2) +with a suitably adjusted value for +.IR offset . + +On some hardware architectures (e.g., i386), +.B PROT_WRITE +implies +.BR PROT_READ . +It is architecture dependent whether +.B PROT_READ +implies +.B PROT_EXEC +or not. +Portable programs should always set +.B PROT_EXEC +if they intend to execute code in the new mapping. + +The portable way to create a mapping is to specify +.I addr +as 0 (NULL), and omit +.B MAP_FIXED +from +.IR flags . +In this case, the system chooses the address for the mapping; +the address is chosen so as not to conflict with any existing mapping, +and will not be 0. +If the +.B MAP_FIXED +flag is specified, and +.I addr +is 0 (NULL), then the mapped address will be 0 (NULL). +.SH BUGS +On Linux there are no guarantees like those suggested above under +.BR MAP_NORESERVE . +By default, any process can be killed +at any moment when the system runs out of memory. + +In kernels before 2.6.7, the +.B MAP_POPULATE +flag only has effect if +.I prot +is specified as +.BR PROT_NONE . + +SUSv3 specifies that +.BR mmap () +should fail if +.I length +is 0. +However, in kernels before 2.6.12, +.BR mmap () +succeeded in this case: no mapping was created and the call returned +.IR addr . +Since kernel 2.6.12, +.BR mmap () +fails with the error +.B EINVAL +for this case. +.SH EXAMPLE +.\" FIXME . Add an example here that uses an anonymous shared region for +.\" IPC between parent and child. +.PP +The following program prints part of the file specified in +its first command-line argument to standard output. +The range of bytes to be printed is specified via offset and length +values in the second and third command-line arguments. +The program creates a memory mapping of the required +pages of the file and then uses +.BR write (2) +to output the desired bytes. +.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 +.SH "SEE ALSO" +.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. +.\" +.\" Repeat after me: private read-only mappings are 100% equivalent to +.\" shared read-only mappings. No ifs, buts, or maybes. -- Linus diff --git a/original/man2/mmap2.2 b/original/man2/mmap2.2 new file mode 100644 index 00000000..3ca1bc03 --- /dev/null +++ b/original/man2/mmap2.2 @@ -0,0 +1,93 @@ +.\" 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 +.\" +.TH MMAP2 2 2008-04-22 "Linux" "Linux Programmer's Manual" +.SH NAME +mmap2 \- map files or devices into memory +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void *mmap2(void *" addr ", size_t " length ", int " prot , +.BI " int " flags ", int " fd ", off_t " pgoffset ); +.fi +.SH DESCRIPTION +The +.BR mmap2 () +system call operates in exactly the same way as +.BR mmap (2), +except that the final argument specifies the offset into the +file in 4096-byte units (instead of bytes, as is done by +.BR mmap (2)). +This enables applications that use a 32-bit +.I off_t +to map large files (up to 2^44 bytes). +.SH "RETURN VALUE" +On success, +.BR mmap2 () +returns a pointer to the mapped area. +On error \-1 is returned and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +Problem with getting the data from userspace. +.TP +.B EINVAL +(Various platforms where the page size is not 4096 bytes.) +.I offset * 4096 +is not a multiple of the system page size. +.PP +.BR mmap2 () +can return any of the same errors as +.BR mmap (2). +.SH VERSIONS +.BR mmap2 () +is available since Linux 2.3.31. +.SH "CONFORMING TO" +This system call is Linux-specific. +.SH NOTES +Nowadays, the glibc +.BR mmap () +wrapper function invokes this system call rather than the +.BR mmap (2) +system call. + +On ia64, the unit for +.I offset +is actually the system page size, rather than 4096 bytes. +.\" 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 +.SH "SEE ALSO" +.BR getpagesize (2), +.BR mmap (2), +.BR mremap (2), +.BR msync (2), +.BR shm_open (3) diff --git a/original/man2/modify_ldt.2 b/original/man2/modify_ldt.2 new file mode 100644 index 00000000..aa19b192 --- /dev/null +++ b/original/man2/modify_ldt.2 @@ -0,0 +1,135 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@duracef.shout.net), 22 July 1995. +.\" +.\" 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. +.\" +.TH MODIFY_LDT 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.SH NAME +modify_ldt \- get or set ldt +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int modify_ldt(int " "func" ", void *" "ptr" ", unsigned long " "bytecount" ); +.fi +.SH DESCRIPTION +.BR modify_ldt () +reads or writes the local descriptor table (ldt) for a process. +The ldt is a per-process memory management table used by the i386 processor. +For more information on this table, see an Intel 386 processor handbook. +.PP +When +.I func +is 0, +.BR modify_ldt () +reads the ldt into the memory pointed to by +.IR ptr . +The number of bytes read is the smaller of +.I bytecount +and the actual size of the ldt. +.PP +When +.I func +is 1, +.BR modify_ldt () +modifies one ldt entry. +.I ptr +points to a +.I user_desc +structure +and +.I bytecount +must equal the size of this structure. +.\" +.\" FIXME ? say something about func == 2 and func == 0x11? +.\" In Linux 2.4, func == 2 returned "the default ldt" +.\" In Linux 2.6, func == 2 is a nop, returning a zeroed out structure. +.\" Linux 2.4 and 2.6 implement an operation for func == 0x11 + +The +.I user_desc +structure is defined in \fI\fP as: +.in +4n +.nf + +struct user_desc { + unsigned int entry_number; + unsigned long base_addr; + unsigned int limit; + unsigned int seg_32bit:1; + unsigned int contents:2; + unsigned int read_exec_only:1; + unsigned int limit_in_pages:1; + unsigned int seg_not_present:1; + unsigned int useable:1; +}; +.fi +.in +.PP +In Linux 2.4 and earlier, this structure was named +.IR modify_ldt_ldt_s . +.\" .PP +.\" The ldt is specific for the calling process. Any attempts to change +.\" the ldt to include the address space of another process or the kernel +.\" will result in a segmentation violation when trying to access the memory +.\" outside of the process address space. The memory protection is enforced +.\" at the paging layer. +.SH "RETURN VALUE" +On success, +.BR modify_ldt () +returns either the actual number of bytes read (for reading) +or 0 (for writing). +On failure, +.BR modify_ldt () +returns \-1 and sets +.I errno +to indicate the error. +.SH ERRORS +.TP +.B EFAULT +.I ptr +points outside the address space. +.TP +.B EINVAL +.I ptr +is 0, +or +.I func +is 1 and +.I bytecount +is not equal to the size of the structure +.IR modify_ldt_ldt_s , +or +.I func +is 1 and the new ldt entry has invalid values. +.TP +.B ENOSYS +.I func +is neither 0 nor 1. +.SH "CONFORMING TO" +This call is Linux-specific and should not be used in programs intended +to be portable. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). +.SH "SEE ALSO" +.BR vm86 (2) diff --git a/original/man2/mount.2 b/original/man2/mount.2 new file mode 100644 index 00000000..a79bdca6 --- /dev/null +++ b/original/man2/mount.2 @@ -0,0 +1,450 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1993 Rickard E. Faith +.\" and Copyright (C) 1994 Andries E. Brouwer +.\" and Copyright (C) 2002, 2005 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 1996-11-04 by Eric S. Raymond +.\" Modified 2001-10-13 by Michael Kerrisk +.\" Added note on historical behavior of MS_NOSUID +.\" Modified 2002-05-16 by Michael Kerrisk +.\" Extensive changes and additions +.\" Modified 2002-05-27 by aeb +.\" Modified 2002-06-11 by Michael Kerrisk +.\" Enhanced descriptions of MS_MOVE, MS_BIND, and MS_REMOUNT +.\" Modified 2004-06-17 by Michael Kerrisk +.\" 2005-05-18, mtk, Added MNT_EXPIRE, plus a few other tidy-ups. +.\" 2008-10-06, mtk: move umount*() material into separate umount.2 page. +.\" 2008-10-06, mtk: Add discussion of namespaces. +.\" +.TH MOUNT 2 2009-06-26 "Linux" "Linux Programmer's Manual" +.SH NAME +mount \- mount file system +.SH SYNOPSIS +.nf +.B "#include " +.sp +.BI "int mount(const char *" source ", const char *" target , +.BI " const char *" filesystemtype ", unsigned long " mountflags , +.BI " const void *" data ); +.fi +.SH DESCRIPTION +.BR mount () +attaches the file system specified by +.I source +(which is often a device name, but can also be a directory name +or a dummy) to the directory specified by +.IR target . + +Appropriate privilege (Linux: the +.B CAP_SYS_ADMIN +capability) is required to mount file systems. + +Since Linux 2.4 a single file system can be visible at +multiple mount points, and multiple mounts can be stacked +on the same mount point. +.\" Multiple mounts on same mount point: since 2.3.99pre7. + +Values for the +.I filesystemtype +argument supported by the kernel are listed in +.I /proc/filesystems +(like "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", +"msdos", "proc", "nfs", "iso9660" etc.). +Further types may become available when the appropriate modules +are loaded. + +The +.I mountflags +argument may have the magic number 0xC0ED (\fBMS_MGC_VAL\fP) +in the top 16 bits (this was required in kernel versions prior to 2.4, but +is no longer required and ignored if specified), +and various mount flags (as defined in \fI\fP for libc4 and libc5 +and in \fI\fP for glibc2) in the low order 16 bits: +.\" FIXME 2.6.15 added flags for "shared subtree" functionality: +.\" MS_UNBINDABLE, MS_PRIVATE, MS_SHARED, MS_SLAVE +.\" These need to be documented on this page. +.\" See: +.\" Documentation/filesystems/sharedsubtree.txt +.\" +.\" http://lwn.net/Articles/159077/ +.\" +.\" http://myweb.sudhaa.com:2022/~ram/sharedsubtree/paper/sharedsubtree.1.pdf +.\" Shared-Subtree Concept, Implementation, and Applications in Linux +.\" Al Viro viro@ftp.linux.org.uk +.\" Ram Pai linuxram@us.ibm.com +.\" +.\" http://foss.in/2005/slides/sharedsubtree1.pdf +.\" Shared Subtree Concept and Implementation in the Linux Kernel +.\" Ram Pai +.\" +.\" 2.6.25 Added MS_I_VERSION, which needs to be documented. +.\" +.TP +.BR MS_BIND " (Linux 2.4 onwards)" +.\" since 2.4.0-test9 +Perform a bind mount, making a file or a directory subtree visible at +another point within a file system. +Bind mounts may cross file system boundaries and span +.BR chroot (2) +jails. +The +.IR filesystemtype +and +.IR data +arguments are ignored. +Up until Linux 2.6.26, +.I mountflags +was also ignored +.\" with the exception of the "hidden" MS_REC mountflags bit +(the bind mount has the same mount options as +the underlying mount point). +Since Linux 2.6.26, the +.B MS_RDONLY +flag is honored when making a bind mount. +.TP +.BR MS_DIRSYNC " (since Linux 2.5.19)" +Make directory changes on this file system synchronous. +(This property can be obtained for individual directories +or subtrees using +.BR chattr (1).) +.TP +.B MS_MANDLOCK +Permit mandatory locking on files in this file system. +(Mandatory locking must still be enabled on a per-file basis, +as described in +.BR fcntl (2).) +.\" FIXME Say more about MS_MOVE +.TP +.B MS_MOVE +Move a subtree. +.I source +specifies an existing mount point and +.I target +specifies the new location. +The move is atomic: at no point is the subtree unmounted. +The +.IR filesystemtype ", " mountflags ", and " data +arguments are ignored. +.TP +.B MS_NOATIME +Do not update access times for (all types of) files on this file system. +.TP +.B MS_NODEV +Do not allow access to devices (special files) on this file system. +.TP +.B MS_NODIRATIME +Do not update access times for directories on this file system. +This flag provides a subset of the functionality provided by +.BR MS_NOATIME ; +that is, +.BR MS_NOATIME +implies +.BR MS_NODIRATIME . +.TP +.B MS_NOEXEC +Do not allow programs to be executed from this file system. +.\" (Possibly useful for a file system that contains non-Linux executables. +.\" Often used as a security feature, e.g., to make sure that restricted +.\" users cannot execute files uploaded using ftp or so.) +.TP +.B MS_NOSUID +Do not honor set-user-ID and set-group-ID bits when executing +programs from this file system. +.\" (This is a security feature to prevent users executing set-user-ID and +.\" set-group-ID programs from removable disk devices.) +.TP +.B MS_RDONLY +Mount file system read-only. +.\" +.\" FIXME Document MS_REC, available since 2.4.11. +.\" This flag has meaning in conjunction with MS_BIND and +.\" also with the shared subtree flags. +.TP +.BR MS_RELATIME " (Since Linux 2.6.20)" +When a file on this file system is accessed, +only update the file's last access time (atime) if the current value +of atime is less than or equal to the file's last modification time (mtime) +or last status change time (ctime). +This option is useful for programs, such as +.BR mutt (1), +that need to know when a file has been read since it was last modified. +Since Linux 2.6.30, the kernel defaults to the behavior provided +by this flag (unless +.BR MS_NOATIME +was specified), and the +.B MS_STRICTATIME +flag is required to obtain traditional semantics. +In addition, since Linux 2.6.30, +the file's last access time is always updated if it +is more than 1 day old. +.\" Matthew Garrett notes in the patch that added this behavior +.\" that this lets utilities such as tmpreaper (which deletes +.\" files based on last acces time) work correctly. +.TP +.B MS_REMOUNT +Remount an existing mount. +This allows you to change the +.I mountflags +and +.I data +of an existing mount without having to unmount and remount the file system. +.I source +and +.I target +should be the same values specified in the initial +.BR mount () +call; +.I filesystemtype +is ignored. + +The following +.I mountflags +can be changed: +.BR MS_RDONLY , +.BR MS_SYNCHRONOUS , +.BR MS_MANDLOCK ; +before kernel 2.6.16, the following could also be changed: +.B MS_NOATIME +and +.BR MS_NODIRATIME ; +and, additionally, before kernel 2.4.10, the following could also be changed: +.BR MS_NOSUID , +.BR MS_NODEV , +.BR MS_NOEXEC . +.TP +.BR MS_SILENT " (since Linux 2.6.17)" +Suppress the display of certain +.RI ( printk ()) +warning messages in the kernel log. +This flag supersedes the misnamed and obsolete +.BR MS_VERBOSE +flag (available since Linux 2.4.12), which has the same meaning. +.TP +.BR MS_STRICTATIME " (Since Linux 2.6.30)" +Always update the last access time (atime) when files on this +file system are accessed. +(This was the default behavior before Linux 2.6.30.) +Specifying this flag overrides the effect of setting the +.BR MS_NOATIME +and +.BR MS_RELATIME +flags. +.TP +.B MS_SYNCHRONOUS +Make writes on this file system synchronous (as though +the +.B O_SYNC +flag to +.BR open (2) +was specified for all file opens to this file system). +.PP +From Linux 2.4 onwards, the +.BR MS_NODEV ", " MS_NOEXEC ", and " MS_NOSUID +flags are settable on a per-mount-point basis. +From kernel 2.6.16 onwards, +.B MS_NOATIME +and +.B MS_NODIRATIME +are also settable on a per-mount-point basis. +The +.B MS_RELATIME +flag is also settable on a per-mount-point basis. +.PP +The +.I data +argument is interpreted by the different file systems. +Typically it is a string of comma-separated options +understood by this file system. +See +.BR mount (8) +for details of the options available for each filesystem type. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +The error values given below result from filesystem type independent +errors. +Each filesystem type may have its own special errors and its +own special behavior. +See the kernel source code for details. +.TP +.B EACCES +A component of a path was not searchable. +(See also +.BR path_resolution (7).) +Or, mounting a read-only filesystem was attempted without giving the +.B MS_RDONLY +flag. +Or, the block device +.I source +is located on a filesystem mounted with the +.B MS_NODEV +option. +.\" mtk: Probably: write permission is required for MS_BIND, with +.\" the error EPERM if not present; CAP_DAC_OVERRIDE is required. +.TP +.B EBUSY +.I source +is already mounted. +Or, it cannot be remounted read-only, +because it still holds files open for writing. +Or, it cannot be mounted on +.I target +because +.I target +is still busy (it is the working directory of some task, +the mount point of another device, has open files, etc.). +.TP +.B EFAULT +One of the pointer arguments points outside the user address space. +.TP +.B EINVAL +.I source +had an invalid superblock. +Or, a remount +.RB ( MS_REMOUNT ) +was attempted, but +.I source +was not already mounted on +.IR target . +Or, a move +.RB ( MS_MOVE ) +was attempted, but +.I source +was not a mount point, or was \(aq/\(aq. +.TP +.B ELOOP +Too many links encountered during pathname resolution. +Or, a move was attempted, while +.I target +is a descendant of +.IR source . +.TP +.B EMFILE +(In case no block device is required:) +Table of dummy devices is full. +.TP +.B ENAMETOOLONG +A pathname was longer than +.BR MAXPATHLEN . +.TP +.B ENODEV +.I filesystemtype +not configured in the kernel. +.TP +.B ENOENT +A pathname was empty or had a nonexistent component. +.TP +.B ENOMEM +The kernel could not allocate a free page to copy filenames or data into. +.TP +.B ENOTBLK +.I source +is not a block device (and a device was required). +.TP +.B ENOTDIR +.IR target , +or a prefix of +.IR source , +is not a directory. +.TP +.B ENXIO +The major number of the block device +.I source +is out of range. +.TP +.B EPERM +The caller does not have the required privileges. +.SH "CONFORMING TO" +This function is Linux-specific and should not be used in +programs intended to be portable. +.SH NOTES +The original +.B MS_SYNC +flag was renamed +.B MS_SYNCHRONOUS +in 1.1.69 +when a different +.B MS_SYNC +was added to \fI\fP. +.LP +Before Linux 2.4 an attempt to execute a set-user-ID or set-group-ID program +on a filesystem mounted with +.B MS_NOSUID +would fail with +.BR EPERM . +Since Linux 2.4 the set-user-ID and set-group-ID bits are +just silently ignored in this case. +.\" The change is in patch-2.4.0-prerelease. +.SS Per-process Namespaces +Starting with kernel 2.4.19, Linux provides +per-process mount namespaces. +A mount namespace is the set of file system mounts that +are visible to a process. +Mount-point namespaces can be (and usually are) +shared between multiple processes, +and changes to the namespace (i.e., mounts and unmounts) by one process +are visible to all other processes sharing the same namespace. +(The pre-2.4.19 Linux situation can be considered as one in which +a single namespace was shared by every process on the system.) + +A child process created by +.BR fork (2) +shares its parent's mount namespace; +the mount namespace is preserved across an +.BR execve (2). + +A process can obtain a private mount namespace if: +it was created using the +.BR clone () +.BR CLONE_NEWNS +flag, +in which case its new namespace is initialized to be a +.I copy +of the namespace of the process that called +.BR clone (); +or it calls +.BR unshare (2) +with the +.BR CLONE_NEWNS +flag, +which causes the caller's mount namespace to obtain a private copy +of the namespace that it was previously sharing with other processes, +so that future mounts and unmounts by the caller are invisible +to other processes (except child processes that the caller +subsequently creates) and vice versa. + +The Linux-specific +.I /proc/PID/self +file exposes the list of mount points in the mount +namespace of the process with the specified ID; see +.BR proc (5) +for details. +.SH "SEE ALSO" +.BR umount (2), +.BR path_resolution (7), +.BR mount (8), +.BR umount (8) diff --git a/original/man2/move_pages.2 b/original/man2/move_pages.2 new file mode 100644 index 00000000..3dd1af91 --- /dev/null +++ b/original/man2/move_pages.2 @@ -0,0 +1,226 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" 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. +.\" +.\" FIXME Should programs normally be using this API directly, or should +.\" they rather be using interfaces in the numactl package? +.\" (e.g., compare with recommendation in mbind(2)). +.TH MOVE_PAGES 2 2008-10-06 "Linux" "Linux Programmer's Manual" +.SH NAME +move_pages \- move individual pages of a process to another node +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "long move_pages(int " pid ", unsigned long count, void **" pages , +.BI " const int *" nodes ", int *" status ", int " flags ); +.fi +.SH DESCRIPTION +.BR move_pages () +moves the specified +.I pages +of the process +.I pid +to the memory nodes specified by +.IR nodes . +The result of the move is reflected in +.IR status . +The +.I flags +indicate constraints on the pages to be moved. + +.I pid +is the ID of the process in which pages are to be moved. +To move pages in another process, +the caller must be privileged +.RB ( CAP_SYS_NICE ) +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 +.I pid +is 0 then +.BR move_pages () +moves pages of the calling process. + +.I count +is the number of pages to move. +It defines the size of the three arrays +.IR pages , +.IR nodes , +and +.IR status . + +.I pages +is an array of pointers to the pages that should be moved. +These are pointers that should be aligned to page boundaries. +.\" FIXME what if they are not aligned? +Addresses are specified as seen by the process specified by +.IR pid . + +.I nodes +is an array of integers that specify the desired location for each page. +Each element in the array is a node number. +.I nodes +can also be NULL, in which case +.BR move_pages () +does not move any pages but instead will return the node +where each page currently resides, in the +.I status +array. +Obtaining the status of each page may be necessary to determine +pages that need to be moved. + +.I status +is an array of integers that return the status of each page. +The array only contains valid values if +.BR move_pages () +did not return an error. + +.I flags +specify what types of pages to move. +.B MPOL_MF_MOVE +means that only pages that are in exclusive use by the process +are to be moved. +.B MPOL_MF_MOVE_ALL +means that pages shared between multiple processes can also be moved. +The process must be privileged +.RB ( CAP_SYS_NICE ) +to use +.BR MPOL_MF_MOVE_ALL . +.SH Page states in the status array +The following values can be returned in each element of the +.I status +array. +.TP +.B 0..MAX_NUMNODES +Identifies the node on which the page resides. +.TP +.B -EACCES +The page is mapped by multiple processes and can only be moved if +.B MPOL_MF_MOVE_ALL +is specified. +.TP +.B -EBUSY +The page is currently busy and cannot be moved. +Try again later. +This occurs if a page is undergoing I/O or another kernel subsystem +is holding a reference to the page. +.TP +.B -EFAULT +This is a zero page or the memory area is not mapped by the process. +.TP +.B -EIO +Unable to write back a page. +The page has to be written back +in order to move it since the page is dirty and the file system +does not provide a migration function that would allow the move +of dirty pages. +.TP +.B -EINVAL +A dirty page cannot be moved. +The file system does not +provide a migration function and has no ability to write back pages. +.TP +.B -ENOENT +The page is not present. +.TP +.B -ENOMEM +Unable to allocate memory on target node. +.SH "RETURN VALUE" +On success +.BR move_pages () +returns zero. +.\" FIXME Is the following quite true: does the wrapper in numactl +.\" do the right thing? +On error, it returns \-1, and sets +.I errno +to indicate the error. +.SH ERRORS +.TP +.B E2BIG +Too many pages to move. +.TP +.B EACCES +.\" FIXME Clarify "current cpuset". Is that the cpuset of the caller +.\" or the target? +One of the target nodes is not allowed by the current cpuset. +.TP +.B EFAULT +Parameter array could not be accessed. +.TP +.B EINVAL +Flags other than +.B MPOL_MF_MOVE +and +.B MPOL_MF_MOVE_ALL +was specified or an attempt was made to migrate pages of a kernel thread. +.TP +.B ENODEV +One of the target nodes is not online. +.TP +.B ENOENT +No pages were found that require moving. +All pages are either already +on the target node, not present, had an invalid address or could not be +moved because they were mapped by multiple processes. +.TP +.B EPERM +The caller specified +.B MPOL_MF_MOVE_ALL +without sufficient privileges +.RB ( CAP_SYS_NICE ). +Or, the caller attempted to move pages of a process belonging +to another user but did not have privilege to do so +.RB ( CAP_SYS_NICE ). +.TP +.B ESRCH +Process does not exist. +.SH VERSIONS +.BR move_pages () +first appeared on Linux in version 2.6.18. +.SH CONFORMING TO +This system call is Linux-specific. +.SH "NOTES" +For information on library support, see +.BR numa (7). + +Use +.BR get_mempolicy (2) +with the +.B MPOL_F_MEMS_ALLOWED +flag to obtain the set of nodes that are allowed by +.\" FIXME Clarify "current cpuset". Is that the cpuset of the caller +.\" or the target? +the current cpuset. +Note that this information is subject to change at any +time by manual or automatic reconfiguration of the cpuset. + +Use of this function may result in pages whose location +(node) violates the memory policy established for the +specified addresses (See +.BR mbind (2)] +and/or the specified process [See +.BR set_mempolicy (2)). +That is, memory policy does not constrain the destination +nodes used by +.BR move_pages (). +.SH "SEE ALSO" +.BR get_mempolicy (2), +.BR mbind (2), +.BR set_mempolicy (2), +.BR numa (3), +.BR numa_maps (5), +.BR cpuset (7), +.BR numa (7), +.BR migratepages (8), +.BR numa_stat (8) diff --git a/original/man2/mprotect.2 b/original/man2/mprotect.2 new file mode 100644 index 00000000..d7b9712b --- /dev/null +++ b/original/man2/mprotect.2 @@ -0,0 +1,222 @@ +.\" -*- nroff -*- +.\" Copyright (C) 2007 Michael Kerrisk +.\" and Copyright (C) 1995 Michael Shields . +.\" +.\" 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 author of this work. +.\" +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 1997-05-31 by Andries Brouwer +.\" Modified 2003-08-24 by Andries Brouwer +.\" Modified 2004-08-16 by Andi Kleen +.\" 2007-06-02, mtk: Fairly substantial rewrites and additions, and +.\" a much improved example program. +.\" +.TH MPROTECT 2 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH NAME +mprotect \- set protection on a region of memory +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int mprotect(const void *" addr ", size_t " len ", int " prot ); +.fi +.SH DESCRIPTION +.BR mprotect () +changes protection for the calling process's memory page(s) +containing any part of the address range in the +interval [\fIaddr\fP,\ \fIaddr\fP+\fIlen\fP\-1]. +.I addr +must be aligned to a page boundary. + +If the calling process tries to access memory in a manner +that violates the protection, then the kernel generates a +.B SIGSEGV +signal for the process. +.PP +.I prot +is either +.B PROT_NONE +or a bitwise-or of the other values in the following list: +.TP 1.1i +.B PROT_NONE +The memory cannot be accessed at all. +.TP +.B PROT_READ +The memory can be read. +.TP +.B PROT_WRITE +The memory can be modified. +.TP +.B PROT_EXEC +The memory can be executed. +.\" FIXME +.\" Document PROT_GROWSUP and PROT_GROWSDOWN +.SH "RETURN VALUE" +On success, +.BR mprotect () +returns zero. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +The memory cannot be given the specified access. +This can happen, for example, if you +.BR mmap (2) +a file to which you have read-only access, then ask +.BR mprotect () +to mark it +.BR PROT_WRITE . +.TP +.B EINVAL +\fIaddr\fP is not a valid pointer, +or not a multiple of the system page size. +.\" Or: both PROT_GROWSUP and PROT_GROWSDOWN were specified in 'prot'. +.TP +.B ENOMEM +Internal kernel structures could not be allocated. +.TP +.B ENOMEM +Addresses in the range +.RI [ addr , +.IR addr + len ] +are invalid for the address space of the process, +or specify one or more pages that are not mapped. +(Before kernel 2.4.19, the error +.BR EFAULT +was incorrectly produced for these cases.) +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.\" SVr4 defines an additional error +.\" code EAGAIN. The SVr4 error conditions don't map neatly onto Linux's. +POSIX says that the behavior of +.BR mprotect () +is unspecified if it is applied to a region of memory that +was not obtained via +.BR mmap (2). +.SH NOTES +On Linux it is always permissible to call +.BR mprotect () +on any address in a process's address space (except for the +kernel vsyscall area). +In particular it can be used +to change existing code mappings to be writable. + +Whether +.B PROT_EXEC +has any effect different from +.B PROT_READ +is architecture- and kernel version-dependent. +On some hardware architectures (e.g., i386), +.B PROT_WRITE +implies +.BR PROT_READ . + +POSIX.1-2001 says that an implementation may permit access +other than that specified in +.IR prot , +but at a minimum can only allow write access if +.B PROT_WRITE +has been set, and must not allow any access if +.B PROT_NONE +has been set. +.SH EXAMPLE +.\" sigaction.2 refers to this example +.PP +The program below allocates four pages of memory, makes the third +of these pages read-only, and then executes a loop that walks upwards +through the allocated region modifying bytes. + +An example of what we might see when running the program is the +following: + +.in +4n +.nf +.RB "$" " ./a.out" +Start of region: 0x804c000 +Got SIGSEGV at address: 0x804e000 +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include +#include +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +char *buffer; + +static void +handler(int sig, siginfo_t *si, void *unused) +{ + printf("Got SIGSEGV at address: 0x%lx\\n", + (long) si\->si_addr); + exit(EXIT_FAILURE); +} + +int +main(int argc, char *argv[]) +{ + char *p; + int pagesize; + struct sigaction sa; + + sa.sa_flags = SA_SIGINFO; + sigemptyset(&sa.sa_mask); + sa.sa_sigaction = handler; + if (sigaction(SIGSEGV, &sa, NULL) == \-1) + handle_error("sigaction"); + + pagesize = sysconf(_SC_PAGE_SIZE); + if (pagesize == \-1) + handle_error("sysconf"); + + /* Allocate a buffer aligned on a page boundary; + initial protection is PROT_READ | PROT_WRITE */ + + buffer = memalign(pagesize, 4 * pagesize); + if (buffer == NULL) + handle_error("memalign"); + + printf("Start of region: 0x%lx\\n", (long) buffer); + + if (mprotect(buffer + pagesize * 2, pagesize, + PROT_NONE) == \-1) + handle_error("mprotect"); + + for (p = buffer ; ; ) + *(p++) = \(aqa\(aq; + + printf("Loop completed\\n"); /* Should never happen */ + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR mmap (2), +.BR sysconf (3) diff --git a/original/man2/mpx.2 b/original/man2/mpx.2 new file mode 100644 index 00000000..5d25ea6c --- /dev/null +++ b/original/man2/mpx.2 @@ -0,0 +1 @@ +.so man2/unimplemented.2 diff --git a/original/man2/mq_getsetattr.2 b/original/man2/mq_getsetattr.2 new file mode 100644 index 00000000..8151298a --- /dev/null +++ b/original/man2/mq_getsetattr.2 @@ -0,0 +1,55 @@ +'\" 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. +.\" +.TH MQ_GETSETATTR 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.SH NAME +mq_getsetattr \- get/set message queue attributes +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "mqd_t mq_getsetattr(mqd_t " mqdes ", struct mq_attr *" newattr "," +.BI " struct mq_attr *" oldattr ); +.fi +.SH DESCRIPTION +Do not use this system call. + +This is the low-level system call used to implement +.BR mq_getattr (3) +and +.BR mq_setattr (3). +For an explanation of how this system call operates, +see the description of +.BR mq_setattr (3). +.SH CONFORMING TO +This interface is nonstandard; avoid its use. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). +(Actually, never call it unless you are writing a C library!) +.SH "SEE ALSO" +.BR mq_getattr (3), +.BR mq_overview (7) diff --git a/original/man2/mq_notify.2 b/original/man2/mq_notify.2 new file mode 100644 index 00000000..fda80ff9 --- /dev/null +++ b/original/man2/mq_notify.2 @@ -0,0 +1 @@ +.so man3/mq_notify.3 diff --git a/original/man2/mq_open.2 b/original/man2/mq_open.2 new file mode 100644 index 00000000..54b47668 --- /dev/null +++ b/original/man2/mq_open.2 @@ -0,0 +1 @@ +.so man3/mq_open.3 diff --git a/original/man2/mq_timedreceive.2 b/original/man2/mq_timedreceive.2 new file mode 100644 index 00000000..9fed5f29 --- /dev/null +++ b/original/man2/mq_timedreceive.2 @@ -0,0 +1 @@ +.so man3/mq_receive.3 diff --git a/original/man2/mq_timedsend.2 b/original/man2/mq_timedsend.2 new file mode 100644 index 00000000..28b1eff0 --- /dev/null +++ b/original/man2/mq_timedsend.2 @@ -0,0 +1 @@ +.so man3/mq_send.3 diff --git a/original/man2/mq_unlink.2 b/original/man2/mq_unlink.2 new file mode 100644 index 00000000..4e72f110 --- /dev/null +++ b/original/man2/mq_unlink.2 @@ -0,0 +1 @@ +.so man3/mq_unlink.3 diff --git a/original/man2/mremap.2 b/original/man2/mremap.2 new file mode 100644 index 00000000..f9d40681 --- /dev/null +++ b/original/man2/mremap.2 @@ -0,0 +1,209 @@ +.\" 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. +.\" +.\" 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-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. +.\" +.TH MREMAP 2 2005-09-13 "Linux" "Linux Programmer's Manual" +.SH NAME +mremap \- remap a virtual memory address +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "void *mremap(void *" old_address ", size_t " old_size , +.BI " size_t " new_size ", int " flags ); +.fi +.SH DESCRIPTION +.BR mremap () +expands (or shrinks) an existing memory mapping, potentially +moving it at the same time (controlled by the \fIflags\fP argument and +the available virtual address space). + +\fIold_address\fP is the old address of the virtual memory block that you +want to expand (or shrink). +Note that \fIold_address\fP has to be page +aligned. +\fIold_size\fP is the old size of the +virtual memory block. +\fInew_size\fP is the requested size of the +virtual memory block after the resize. + +In Linux the memory is divided into pages. +A user process has (one or) +several linear virtual memory segments. +Each virtual memory segment has one +or more mappings to real memory pages (in the page table). +Each virtual memory segment has its own +protection (access rights), which may cause +a segmentation violation if the memory is accessed incorrectly (e.g., +writing to a read-only segment). +Accessing virtual memory outside of the +segments will also cause a segmentation violation. + +.BR mremap () +uses the Linux page table scheme. +.BR mremap () +changes the +mapping between virtual addresses and memory pages. +This can be used to implement a very efficient +.BR realloc (3). + +The \fIflags\fP bit-mask argument may be 0, or include the following flag: +.TP +.B MREMAP_MAYMOVE +By default, if there is not sufficient space to expand a mapping +at its current location, then +.BR mremap () +fails. +If this flag is specified, then the kernel is permitted to +relocate the mapping to a new virtual address, if necessary. +If the mapping is relocated, +then absolute pointers into the old mapping location +become invalid (offsets relative to the starting address of +the mapping should be employed). +.TP +.BR MREMAP_FIXED " (since Linux 2.3.31)" +This flag serves a similar purpose to the +.B MAP_FIXED +flag of +.BR mmap (2). +If this flag is specified, then +.BR mremap () +accepts a fifth argument, +.IR "void *new_address" , +which specifies a page-aligned address to which the mapping must +be moved. +Any previous mapping at the address range specified by +.I new_address +and +.I new_size +is unmapped. +If +.B MREMAP_FIXED +is specified, then +.B MREMAP_MAYMOVE +must also be specified. +.PP +If the memory segment specified by +.I old_address +and +.I old_size +is locked (using +.BR mlock (2) +or similar), then this lock is maintained when the segment is +resized and/or relocated. +As a consequence, the amount of memory locked by the process may change. +.SH "RETURN VALUE" +On success +.BR mremap () +returns a pointer to the new virtual memory area. +On error, the value +.B MAP_FAILED +(that is, \fI(void\ *)\ \-1\fP) is returned, +and \fIerrno\fP is set appropriately. +.SH ERRORS +.TP +.B EAGAIN +The caller tried to expand a memory segment that is locked, +but this was not possible without exceeding the +.B RLIMIT_MEMLOCK +resource limit. +.TP +.B EFAULT +"Segmentation fault." Some address in the range +\fIold_address\fP to \fIold_address\fP+\fIold_size\fP is an invalid +virtual memory address for this process. +You can also get +.B EFAULT +even if there exist mappings that cover the +whole address space requested, but those mappings are of different types. +.TP +.B EINVAL +An invalid argument was given. +Possible causes are: \fIold_address\fP was not +page aligned; a value other than +.B MREMAP_MAYMOVE +or +.B MREMAP_FIXED +was specified in +.IR flags ; +.I new_size +was zero; +.I new_size +or +.I new_address +was invalid; +or the new address range specified by +.I new_address +and +.I new_size +overlapped the old address range specified by +.I old_address +and +.IR old_size ; +or +.B MREMAP_FIXED +was specified without also specifying +.BR MREMAP_MAYMOVE . +.TP +.B ENOMEM +The memory area cannot be expanded at the current virtual address, and the +.B MREMAP_MAYMOVE +flag is not set in \fIflags\fP. +Or, there is not enough (virtual) memory available. +.SH "CONFORMING TO" +This call is Linux-specific, and should not be used in programs +intended to be portable. +.\" 4.2BSD had a (never actually implemented) +.\" .BR mremap (2) +.\" call with completely different semantics. +.SH NOTES +Prior to version 2.4, glibc did not expose the definition of +.BR MREMAP_FIXED , +and the prototype for +.BR mremap () +did not allow for the +.I new_address +argument. +.SH "SEE ALSO" +.BR brk (2), +.BR getpagesize (2), +.BR getrlimit (2), +.BR mlock (2), +.BR mmap (2), +.BR sbrk (2), +.BR malloc (3), +.BR realloc (3), +.BR feature_test_macros (7) +.P +Your favorite OS text book for more information on paged memory. +(\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/original/man2/msgctl.2 b/original/man2/msgctl.2 new file mode 100644 index 00000000..2ecbdcfe --- /dev/null +++ b/original/man2/msgctl.2 @@ -0,0 +1,343 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" and Copyright 2004, 2005 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 Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" Modified Sun Feb 18 01:59:29 2001 by Andries E. Brouwer +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on CAP_IPC_OWNER requirement +.\" Modified, 17 Jun 2004, Michael Kerrisk +.\" Added notes on CAP_SYS_ADMIN requirement for IPC_SET and IPC_RMID +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added msqid_ds and ipc_perm structure definitions +.\" 2005-08-02, mtk: Added IPC_INFO, MSG_INFO, MSG_STAT descriptions +.\" +.TH MSGCTL 2 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH NAME +msgctl \- message control operations +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include + +.BI "int msgctl(int " msqid ", int " cmd ", struct msqid_ds *" buf ); +.fi +.SH DESCRIPTION +.BR msgctl () +performs the control operation specified by +.I cmd +on the message queue with identifier +.IR msqid . +.PP +The +.I msqid_ds +data structure is defined in \fI\fP as follows: +.nf +.in +4n + +struct msqid_ds { + struct ipc_perm msg_perm; /* Ownership and permissions */ + time_t msg_stime; /* Time of last msgsnd(2) */ + time_t msg_rtime; /* Time of last msgrcv(2) */ + time_t msg_ctime; /* Time of last change */ + unsigned long __msg_cbytes; /* Current number of bytes in + queue (nonstandard) */ + msgqnum_t msg_qnum; /* Current number of messages + in queue */ + msglen_t msg_qbytes; /* Maximum number of bytes + allowed in queue */ + pid_t msg_lspid; /* PID of last msgsnd(2) */ + pid_t msg_lrpid; /* PID of last msgrcv(2) */ +}; +.in +.fi +.PP +The +.I ipc_perm +structure is defined in \fI\fP as follows +(the highlighted fields are settable using +.BR IPC_SET ): +.PP +.nf +.in +4n +struct ipc_perm { + key_t __key; /* Key supplied to msgget(2) */ + uid_t \fBuid\fP; /* Effective UID of owner */ + gid_t \fBgid\fP; /* Effective GID of owner */ + uid_t cuid; /* Effective UID of creator */ + gid_t cgid; /* Effective GID of creator */ + unsigned short \fBmode\fP; /* Permissions */ + unsigned short __seq; /* Sequence number */ +}; +.in +.fi +.PP +Valid values for +.I cmd +are: +.TP +.B IPC_STAT +Copy information from the kernel data structure associated with +.I msqid +into the +.I msqid_ds +structure pointed to by +.IR buf . +The caller must have read permission on the message queue. +.TP +.B IPC_SET +Write the values of some members of the +.I msqid_ds +structure pointed to by +.I buf +to the kernel data structure associated with this message queue, +updating also its +.I msg_ctime +member. +The following members of the structure are updated: +.IR msg_qbytes , +.IR msg_perm.uid , +.IR msg_perm.gid , +and (the least significant 9 bits of) +.IR msg_perm.mode . +The effective UID of the calling process must match the owner +.RI ( msg_perm.uid ) +or creator +.RI ( msg_perm.cuid ) +of the message queue, or the caller must be privileged. +Appropriate privilege (Linux: the +.B CAP_IPC_RESOURCE +capability) is required to raise the +.I msg_qbytes +value beyond the system parameter +.BR MSGMNB . +.TP +.B IPC_RMID +Immediately remove the message queue, +awakening all waiting reader and writer processes (with an error +return and +.I errno +set to +.BR EIDRM ). +The calling process must have appropriate privileges +or its effective user ID must be either that of the creator or owner +of the message queue. +.TP +.BR IPC_INFO " (Linux-specific)" +Returns information about system-wide message queue limits and +parameters in the structure pointed to by +.IR buf . +This structure is of type +.I msginfo +(thus, a cast is required), +defined in +.I +if the +.B _GNU_SOURCE +feature test macro is defined: +.nf +.in +4n + +struct msginfo { + int msgpool; /* Size in kibibytes of buffer pool + used to hold message data; + unused within kernel */ + int msgmap; /* Maximum number of entries in message + map; unused within kernel */ + int msgmax; /* Maximum number of bytes that can be + written in a single message */ + int msgmnb; /* Maximum number of bytes that can be + written to queue; used to initialize + msg_qbytes during queue creation + (msgget(2)) */ + int msgmni; /* Maximum number of message queues */ + int msgssz; /* Message segment size; + unused within kernel */ + int msgtql; /* Maximum number of messages on all queues + in system; unused within kernel */ + unsigned short int msgseg; + /* Maximum number of segments; + unused within kernel */ +}; + +.in +.fi +The +.IR msgmni , +.IR msgmax , +and +.I msgmnb +settings can be changed via +.I /proc +files of the same name; see +.BR proc (5) +for details. +.TP +.BR MSG_INFO " (Linux-specific)" +Returns a +.I msginfo +structure containing the same information as for +.BR IPC_INFO , +except that the following fields are returned with information +about system resources consumed by message queues: the +.I msgpool +field returns the number of message queues that currently exist +on the system; the +.I msgmap +field returns the total number of messages in all queues +on the system; and the +.I msgtql +field returns the total number of bytes in all messages +in all queues on the system. +.TP +.BR MSG_STAT " (Linux-specific)" +Returns a +.I msqid_ds +structure as for +.BR IPC_STAT . +However, the +.I msqid +argument is not a queue identifier, but instead an index into +the kernel's internal array that maintains information about +all message queues on the system. +.SH "RETURN VALUE" +On success, +.BR IPC_STAT , +.BR IPC_SET , +and +.B IPC_RMID +return 0. +A successful +.B IPC_INFO +or +.B MSG_INFO +operation returns the index of the highest used entry in the +kernel's internal array recording information about all +message queues. +(This information can be used with repeated +.B MSG_STAT +operations to obtain information about all queues on the system.) +A successful +.B MSG_STAT +operation returns the identifier of the queue whose index was given in +.IR msqid . + +On error, \-1 is returned with +.I errno +indicating the error. +.SH ERRORS +On failure, +.I errno +is set to one of the following: +.TP +.B EACCES +The argument +.I cmd +is equal to +.B IPC_STAT +or +.BR MSG_STAT , +but the calling process does not have read permission on the message queue +.IR msqid , +and does not have the +.B CAP_IPC_OWNER +capability. +.TP +.B EFAULT +The argument +.I cmd +has the value +.B IPC_SET +or +.BR IPC_STAT , +but the address pointed to by +.I buf +isn't accessible. +.TP +.B EIDRM +The message queue was removed. +.TP +.B EINVAL +Invalid value for +.I cmd +or +.IR msqid . +Or: for a +.B MSG_STAT +operation, the index value specified in +.I msqid +referred to an array slot that is currently unused. +.TP +.B EPERM +The argument +.I cmd +has the value +.B IPC_SET +or +.BR IPC_RMID , +but the effective user ID of the calling process is not the creator +(as found in +.IR msg_perm.cuid ) +or the owner +(as found in +.IR msg_perm.uid ) +of the message queue, +and the process is not privileged (Linux: it does not have the +.B CAP_SYS_ADMIN +capability). +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.\" SVID does not document the EIDRM error condition. +.SH NOTES +The +.BR IPC_INFO , +.B MSG_STAT +and +.B MSG_INFO +operations are used by the +.BR ipcs (8) +program to provide information on allocated resources. +In the future these may modified or moved to a /proc file system +interface. + +Various fields in the \fIstruct msqid_ds\fP were +typed as +.I short +under Linux 2.2 +and have become +.I long +under Linux 2.4. +To take advantage of this, +a recompilation under glibc-2.1.91 or later should suffice. +(The kernel distinguishes old and new calls by an +.B IPC_64 +flag in +.IR cmd .) +.SH "SEE ALSO" +.BR msgget (2), +.BR msgrcv (2), +.BR msgsnd (2), +.BR capabilities (7), +.BR mq_overview (7), +.BR svipc (7) diff --git a/original/man2/msgget.2 b/original/man2/msgget.2 new file mode 100644 index 00000000..1b304ba5 --- /dev/null +++ b/original/man2/msgget.2 @@ -0,0 +1,222 @@ +.\" Copyright 1993 Giorgio Ciucci +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provflags 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. +.\" +.\" Added correction due to Nick Duffek , aeb, 960426 +.\" Modified Wed Nov 6 04:00:31 1996 by Eric S. Raymond +.\" Modified, 8 Jan 2003, Michael Kerrisk, +.\" Removed EIDRM from errors - that can't happen... +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added notes on /proc files +.\" +.TH MSGGET 2 2004-05-27 "Linux" "Linux Programmer's Manual" +.SH NAME +msgget \- get a message queue identifier +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include + +.BI "int msgget(key_t " key ", int " msgflg ); +.fi +.SH DESCRIPTION +The +.BR msgget () +system call returns the message queue identifier associated +with the value of the +.I key +argument. +A new message queue is created if +.I key +has the value +.B IPC_PRIVATE +or +.I key +isn't +.BR IPC_PRIVATE , +no message queue with the given key +.I key +exists, and +.B IPC_CREAT +is specified in +.IR msgflg . +.PP +If +.I msgflg +specifies both +.B IPC_CREAT +and +.B IPC_EXCL +and a message queue already exists for +.IR key , +then +.BR msgget () +fails with +.I errno +set to +.BR EEXIST . +(This is analogous to the effect of the combination +.B O_CREAT | O_EXCL +for +.BR open (2).) +.PP +Upon creation, the least significant bits of the argument +.I msgflg +define the permissions of the message queue. +These permission bits have the same format and semantics +as the permissions specified for the +.I mode +argument of +.BR open (2). +(The execute permissions are not used.) +.PP +If a new message queue is created, +then its associated data structure +.I msqid_ds +(see +.BR msgctl (2)) +is initialized as follows: +.IP +.I msg_perm.cuid +and +.I msg_perm.uid +are set to the effective user ID of the calling process. +.IP +.I msg_perm.cgid +and +.I msg_perm.gid +are set to the effective group ID of the calling process. +.IP +The least significant 9 bits of +.I msg_perm.mode +are set to the least significant 9 bits of +.IR msgflg . +.IP +.IR msg_qnum , +.IR msg_lspid , +.IR msg_lrpid , +.I msg_stime +and +.I msg_rtime +are set to 0. +.IP +.I msg_ctime +is set to the current time. +.IP +.I msg_qbytes +is set to the system limit +.BR MSGMNB . +.PP +If the message queue already exists the permissions are +verified, and a check is made to see if it is marked for +destruction. +.SH "RETURN VALUE" +If successful, the return value will be the message queue identifier (a +nonnegative integer), otherwise \-1 +with +.I errno +indicating the error. +.SH ERRORS +On failure, +.I errno +is set to one of the following values: +.TP +.B EACCES +A message queue exists for +.IR key , +but the calling process does not have permission to access the queue, +and does not have the +.B CAP_IPC_OWNER +capability. +.TP +.B EEXIST +A message queue exists for +.I key +and +.I msgflg +specified both +.B IPC_CREAT +and +.BR IPC_EXCL . +.TP +.B ENOENT +No message queue exists for +.I key +and +.I msgflg +did not specify +.BR IPC_CREAT . +.TP +.B ENOMEM +A message queue has to be created but the system does not have enough +memory for the new data structure. +.TP +.B ENOSPC +A message queue has to be created but the system limit for the maximum +number of message queues +.RB ( MSGMNI ) +would be exceeded. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.SH NOTES +.B IPC_PRIVATE +isn't a flag field but a +.I key_t +type. +If this special value is used for +.IR key , +the system call ignores everything but the least significant 9 bits of +.I msgflg +and creates a new message queue (on success). +.PP +The following is a system limit on message queue resources affecting a +.BR msgget () +call: +.TP +.B MSGMNI +System wide maximum number of message queues: policy +dependent +(on Linux, this limit can be read and modified via +.IR /proc/sys/kernel/msgmni ). +.SS "Linux Notes" +Until version 2.3.20 Linux would return +.B EIDRM +for a +.BR msgget () +on a message queue scheduled for deletion. +.SH BUGS +The name choice +.B IPC_PRIVATE +was perhaps unfortunate, +.B IPC_NEW +would more clearly show its function. +.SH "SEE ALSO" +.BR msgctl (2), +.BR msgrcv (2), +.BR msgsnd (2), +.BR ftok (3), +.BR capabilities (7), +.BR mq_overview (7), +.BR svipc (7) diff --git a/original/man2/msgop.2 b/original/man2/msgop.2 new file mode 100644 index 00000000..2b29cacb --- /dev/null +++ b/original/man2/msgop.2 @@ -0,0 +1,436 @@ +.\" Copyright 1993 Giorgio Ciucci +.\" +.\" 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 Tue Oct 22 16:40:11 1996 by Eric S. Raymond +.\" Modified Mon Jul 10 21:09:59 2000 by aeb +.\" Modified 1 Jun 2002, Michael Kerrisk +.\" Language clean-ups. +.\" Enhanced and corrected information on msg_qbytes, MSGMNB and MSGMAX +.\" Added note on restart behavior of msgsnd() and msgrcv() +.\" Formatting clean-ups (argument and field names marked as .I +.\" instead of .B) +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added notes on /proc files +.\" FIXME . Add example programs to this page. +.\" +.TH MSGOP 2 2008-04-23 "Linux" "Linux Programmer's Manual" +.SH NAME +msgrcv, msgsnd \- message operations +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.sp +.BI "int msgsnd(int " msqid ", const void *" msgp ", size_t " msgsz \ +", int " msgflg ); +.sp +.BI "ssize_t msgrcv(int " msqid ", void *" msgp ", size_t " msgsz \ +", long " msgtyp , +.BI " int " msgflg ); +.fi +.SH DESCRIPTION +The +.BR msgsnd () +and +.BR msgrcv () +system calls are used, respectively, to send messages to, +and receive messages from, a message queue. +The calling process must have write permission on the message queue +in order to send a message, and read permission to receive a message. +.PP +The +.I msgp +argument is a pointer to caller-defined structure +of the following general form: +.in +4n +.nf + +struct msgbuf { + long mtype; /* message type, must be > 0 */ + char mtext[1]; /* message data */ +}; +.fi +.in +.PP +The +.I mtext +field is an array (or other structure) whose size is specified by +.IR msgsz , +a nonnegative integer value. +Messages of zero length (i.e., no +.I mtext +field) are permitted. +The +.I mtype +field must have a strictly positive integer value. +This value can be +used by the receiving process for message selection +(see the description of +.BR msgrcv () +below). +.SS msgsnd() +The +.BR msgsnd () +system call appends a copy of the message pointed to by +.I msgp +to the message queue whose identifier is specified +by +.IR msqid . +.PP +If sufficient space is available in the queue, +.BR msgsnd () +succeeds immediately. +(The queue capacity is defined by the +.I msg_bytes +field in the associated data structure for the message queue. +During queue creation this field is initialized to +.B MSGMNB +bytes, but this limit can be modified using +.BR msgctl (2).) +If insufficient space is available in the queue, then the default +behavior of +.BR msgsnd () +is to block until space becomes available. +If +.B IPC_NOWAIT +is specified in +.IR msgflg , +then the call instead fails with the error +.BR EAGAIN . + +A blocked +.BR msgsnd () +call may also fail if: +.IP * 2 +the queue is removed, +in which case the system call fails with +.I errno +set to +.BR EIDRM ; +or +.IP * +a signal is caught, in which case the system call fails +with +.I errno +set to +.BR EINTR ; see +.BR signal (7). +.RB ( msgsnd () +is never automatically restarted after being interrupted by a +signal handler, regardless of the setting of the +.B SA_RESTART +flag when establishing a signal handler.) +.PP +Upon successful completion the message queue data structure is updated +as follows: +.IP +.I msg_lspid +is set to the process ID of the calling process. +.IP +.I msg_qnum +is incremented by 1. +.IP +.I msg_stime +is set to the current time. +.SS msgrcv() +The +.BR msgrcv () +system call removes a message from the queue specified by +.I msqid +and places it in the buffer +pointed to by +.IR msgp . +.PP +The argument +.I msgsz +specifies the maximum size in bytes for the member +.I mtext +of the structure pointed to by the +.I msgp +argument. +If the message text has length greater than +.IR msgsz , +then the behavior depends on whether +.B MSG_NOERROR +is specified in +.IR msgflg . +If +.B MSG_NOERROR +is specified, then +the message text will be truncated (and the truncated part will be +lost); if +.B MSG_NOERROR +is not specified, then +the message isn't removed from the queue and +the system call fails returning \-1 with +.I errno +set to +.BR E2BIG . +.PP +The argument +.I msgtyp +specifies the type of message requested as follows: +.IP * 2 +If +.I msgtyp +is 0, +then the first message in the queue is read. +.IP * +If +.I msgtyp +is greater than 0, +then the first message in the queue of type +.I msgtyp +is read, unless +.B MSG_EXCEPT +was specified in +.IR msgflg , +in which case +the first message in the queue of type not equal to +.I msgtyp +will be read. +.IP * +If +.I msgtyp +is less than 0, +then the first message in the queue with the lowest type less than or +equal to the absolute value of +.I msgtyp +will be read. +.PP +The +.I msgflg +argument is a bit mask constructed by ORing together zero or more +of the following flags: +.TP +.B IPC_NOWAIT +Return immediately if no message of the requested type is in the queue. +The system call fails with +.I errno +set to +.BR ENOMSG . +.TP +.B MSG_EXCEPT +Used with +.I msgtyp +greater than 0 +to read the first message in the queue with message type that differs +from +.IR msgtyp . +.TP +.B MSG_NOERROR +To truncate the message text if longer than +.I msgsz +bytes. +.PP +If no message of the requested type is available and +.B IPC_NOWAIT +isn't specified in +.IR msgflg , +the calling process is blocked until one of the following conditions occurs: +.IP * 2 +A message of the desired type is placed in the queue. +.IP * +The message queue is removed from the system. +In this case the system call fails with +.I errno +set to +.BR EIDRM . +.IP * +The calling process catches a signal. +In this case the system call fails with +.I errno +set to +.BR EINTR . +.RB ( msgrcv () +is never automatically restarted after being interrupted by a +signal handler, regardless of the setting of the +.B SA_RESTART +flag when establishing a signal handler.) +.PP +Upon successful completion the message queue data structure is updated +as follows: +.IP +.I msg_lrpid +is set to the process ID of the calling process. +.IP +.I msg_qnum +is decremented by 1. +.IP +.I msg_rtime +is set to the current time. +.SH "RETURN VALUE" +On failure both functions return \-1 +with +.I errno +indicating the error, +otherwise +.BR msgsnd () +returns 0 +and +.BR msgrcv () +returns the number of bytes actually copied into the +.I mtext +array. +.SH ERRORS +When +.BR msgsnd () +fails, +.I errno +will be set to one among the following values: +.TP +.B EACCES +The calling process does not have write permission on the message queue, +and does not have the +.B CAP_IPC_OWNER +capability. +.TP +.B EAGAIN +The message can't be sent due to the +.I msg_qbytes +limit for the queue and +.B IPC_NOWAIT +was specified in +.IR msgflg . +.TP +.B EFAULT +The address pointed to by +.I msgp +isn't accessible. +.TP +.B EIDRM +The message queue was removed. +.TP +.B EINTR +Sleeping on a full message queue condition, the process caught a signal. +.TP +.B EINVAL +Invalid +.I msqid +value, or nonpositive +.I mtype +value, or +invalid +.I msgsz +value (less than 0 or greater than the system value +.BR MSGMAX ). +.TP +.B ENOMEM +The system does not have enough memory to make a copy of the +message pointed to by +.IR msgp . +.PP +When +.BR msgrcv () +fails, +.I errno +will be set to one among the following values: +.TP +.B E2BIG +The message text length is greater than +.I msgsz +and +.B MSG_NOERROR +isn't specified in +.IR msgflg . +.TP +.B EACCES +The calling process does not have read permission on the message queue, +and does not have the +.B CAP_IPC_OWNER +capability. +.TP +.B EAGAIN +No message was available in the queue and +.B IPC_NOWAIT +was specified in +.IR msgflg . +.TP +.B EFAULT +The address pointed to by +.I msgp +isn't accessible. +.TP +.B EIDRM +While the process was sleeping to receive a message, +the message queue was removed. +.TP +.B EINTR +While the process was sleeping to receive a message, +the process caught a signal; see +.BR signal (7). +.TP +.B EINVAL +.I msgqid +was invalid, or +.I msgsz +was less than 0. +.TP +.B ENOMSG +.B IPC_NOWAIT +was specified in +.I msgflg +and no message of the requested type existed on the message queue. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.SH NOTES +The +.I msgp +argument is declared as \fIstruct msgbuf *\fP with +libc4, libc5, glibc 2.0, glibc 2.1. +It is declared as \fIvoid *\fP +with glibc 2.2 and later, as required by SUSv2 and SUSv3. + +The following limits on message queue resources affect the +.BR msgsnd () +call: +.TP +.B MSGMAX +Maximum size for a message text: 8192 bytes +(on Linux, this limit can be read and modified via +.IR /proc/sys/kernel/msgmax ). +.TP +.B MSGMNB +Default maximum size in bytes of a message queue: 16384 bytes +(on Linux, this limit can be read and modified via +.IR /proc/sys/kernel/msgmnb ). +The superuser can increase the size of a message queue beyond +.B MSGMNB +by a +.BR msgctl (2) +system call. +.PP +The implementation has no intrinsic limits for the system wide maximum +number of message headers +.RB ( MSGTQL ) +and for the system wide maximum size in bytes of the message pool +.RB ( MSGPOOL ). +.SH "SEE ALSO" +.BR msgctl (2), +.BR msgget (2), +.BR capabilities (7), +.BR mq_overview (7), +.BR svipc (7) diff --git a/original/man2/msgrcv.2 b/original/man2/msgrcv.2 new file mode 100644 index 00000000..b34869ed --- /dev/null +++ b/original/man2/msgrcv.2 @@ -0,0 +1 @@ +.so man2/msgop.2 diff --git a/original/man2/msgsnd.2 b/original/man2/msgsnd.2 new file mode 100644 index 00000000..b34869ed --- /dev/null +++ b/original/man2/msgsnd.2 @@ -0,0 +1 @@ +.so man2/msgop.2 diff --git a/original/man2/msync.2 b/original/man2/msync.2 new file mode 100644 index 00000000..772cf353 --- /dev/null +++ b/original/man2/msync.2 @@ -0,0 +1,121 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1996 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. +.\" +.TH MSYNC 2 2008-04-22 "Linux" "Linux Programmer's Manual" +.SH NAME +msync \- synchronize a file with a memory map +.SH SYNOPSIS +.B #include +.sp +.BI "int msync(void *" addr ", size_t " length ", int " flags ); +.SH DESCRIPTION +.BR msync () +flushes changes made to the in-core copy of a file that was mapped +into memory using +.BR mmap (2) +back to disk. +Without use of this call +there is no guarantee that changes are written back before +.BR munmap (2) +is called. +To be more precise, the part of the file that +corresponds to the memory area starting at +.I addr +and having length +.I length +is updated. + +The +.I flags +argument may have the bits +.BR MS_ASYNC , +.BR MS_SYNC , +and +.B MS_INVALIDATE +set, but not both +.B MS_ASYNC +and +.BR MS_SYNC . +.B MS_ASYNC +specifies that an update be scheduled, but the call +returns immediately. +.B MS_SYNC +asks for an update and waits for it to complete. +.B MS_INVALIDATE +asks to invalidate other mappings of the same file +(so that they can be updated with the fresh values just written). +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBUSY +.B MS_INVALIDATE +was specified in +.IR flags , +and a memory lock exists for the specified address range. +.TP +.B EINVAL +.I addr +is not a multiple of PAGESIZE; or any bit other than +.BR MS_ASYNC " | " MS_INVALIDATE " | " MS_SYNC +is set in +.IR flags ; +or both +.B MS_SYNC +and +.B MS_ASYNC +are set in +.IR flags . +.TP +.B ENOMEM +The indicated memory (or part of it) was not mapped. +.SH "CONFORMING TO" +POSIX.1-2001. + +This call was introduced in Linux 1.3.21, and then used +.B EFAULT +instead of +.BR ENOMEM . +In Linux 2.4.19 this was changed to the POSIX value +.BR ENOMEM . +.SH AVAILABILITY +On POSIX systems on which +.BR msync () +is available, both +.B _POSIX_MAPPED_FILES +and +.B _POSIX_SYNCHRONIZED_IO +are defined in \fI\fP to a value greater than 0. +(See also +.BR 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. +.SH "SEE ALSO" +.BR mmap (2) +.br +B.O. Gallmeister, POSIX.4, O'Reilly, pp. 128-129 and 389-391. diff --git a/original/man2/munlock.2 b/original/man2/munlock.2 new file mode 100644 index 00000000..5e5b3c74 --- /dev/null +++ b/original/man2/munlock.2 @@ -0,0 +1 @@ +.so man2/mlock.2 diff --git a/original/man2/munlockall.2 b/original/man2/munlockall.2 new file mode 100644 index 00000000..5e5b3c74 --- /dev/null +++ b/original/man2/munlockall.2 @@ -0,0 +1 @@ +.so man2/mlock.2 diff --git a/original/man2/munmap.2 b/original/man2/munmap.2 new file mode 100644 index 00000000..8902d1b3 --- /dev/null +++ b/original/man2/munmap.2 @@ -0,0 +1 @@ +.so man2/mmap.2 diff --git a/original/man2/nanosleep.2 b/original/man2/nanosleep.2 new file mode 100644 index 00000000..5a444752 --- /dev/null +++ b/original/man2/nanosleep.2 @@ -0,0 +1,212 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) Markus Kuhn, 1996 +.\" and Copyright (C) Linux Foundation, 2008, written by 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-10 Markus Kuhn +.\" First version written +.\" Modified, 2004-10-24, aeb +.\" 2008-06-24, mtk +.\" Minor rewrites of some parts. +.\" 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). +.TH NANOSLEEP 2 2009-01-19 "Linux" "Linux Programmer's Manual" +.SH NAME +nanosleep \- high-resolution sleep +.SH SYNOPSIS +.B #include +.sp +.BI "int nanosleep(const struct timespec *" req ", struct timespec *" rem ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR nanosleep (): +_POSIX_C_SOURCE\ >=\ 199309L +.SH DESCRIPTION +.BR nanosleep () +suspends the execution of the calling thread +until either at least the time specified in +.IR *req +has elapsed, or the delivery of a signal +that triggers the invocation of a handler in the calling thread or +that terminates the process. + +If the call is interrupted by a signal handler, +.BR nanosleep () +returns \-1, sets \fIerrno\fP to +.BR EINTR , +and writes the remaining time into the structure pointed to by +.I rem +unless +.I rem +is NULL. +The value of +.I *rem +can then be used to call +.BR nanosleep () +again and complete the specified pause (but see NOTES). + +The structure +.I timespec +is used to specify intervals of time with nanosecond precision. +It is defined as follows: +.sp +.in +4n +.nf +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.fi +.in +.PP +The value of the nanoseconds field must be in the range 0 to 999999999. + +Compared to +.BR sleep (3) +and +.BR usleep (3), +.BR nanosleep () +has the following advantages: +it provides a higher resolution for specifying the sleep interval; +POSIX.1 explicitly specifies that it +does not interact with signals; +and it makes the task of resuming a sleep that has been +interrupted by a signal handler easier. +.SH "RETURN VALUE" +On successfully sleeping for the requested interval, +.BR nanosleep () +returns 0. +If the call is interrupted by a signal handler or encounters an error, +then it returns \-1, with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EFAULT +Problem with copying information from user space. +.TP +.B EINTR +The pause has been interrupted by a signal that was +delivered to the thread. +The remaining sleep time has been written +into \fI*rem\fP so that the thread can easily call +.BR nanosleep () +again and continue with the pause. +.TP +.B EINVAL +The value in the +.I tv_nsec +field was not in the range 0 to 999999999 or +.I tv_sec +was negative. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +If the interval specified in +.I req +is not an exact multiple of the granularity underlying clock (see +.BR time (7)), +then the interval will be rounded up to the next multiple. +Furthermore, after the sleep completes, there may still be a delay before +the CPU becomes free to once again execute the calling thread. + +The fact that +.BR nanosleep () +sleeps for a relative interval can be problematic if the call +is repeatedly restarted after being interrupted by signals, +since the time between the interruptions and restarts of the call +will lead to drift in the time when the sleep finally completes. +This problem can be avoided by using +.BR clock_nanosleep (2) +with an absolute time value. + +POSIX.1 specifies that +.BR nanosleep () +should measure time against the +.B CLOCK_REALTIME +clock. +However, Linux measures the time using the +.B CLOCK_MONOTONIC +clock. +.\" 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 +This probably does not matter, since the POSIX.1 specification for +.BR clock_settime () +says that discontinuous changes in +.B CLOCK_REALTIME +should not affect +.BR nanosleep (): +.RS +.PP +Setting the value of the +.B CLOCK_REALTIME +clock via +.BR clock_settime () +shall +have no effect on threads that are blocked waiting for a relative time +service based upon this clock, including the +.BR nanosleep () +function; ... +Consequently, these time services shall expire when the requested relative +interval elapses, independently of the new or old value of the clock. +.RE +.SS "Old behavior" +In order to support applications requiring much more precise pauses +(e.g., in order to control some time-critical hardware), +.BR nanosleep () +would handle pauses of up to 2\ ms by busy waiting with microsecond +precision when called from a thread scheduled under a real-time policy +like +.B SCHED_FIFO +or +.BR SCHED_RR . +This special extension was removed in kernel 2.5.39, +hence is still present in +current 2.4 kernels, but not in 2.6 kernels. +.SH BUGS +In Linux 2.4, if +.BR nanosleep () +is stopped by a signal (e.g., +.BR SIGTSTP ), +then the call fails with the error +.B EINTR +after the thread is resumed by a +.B SIGCONT +signal. +If the system call is subsequently restarted, +then the time that the thread spent in the stopped state is +\fInot\fP counted against the sleep interval. +.SH "SEE ALSO" +.BR clock_nanosleep (2), +.BR sched_setscheduler (2), +.BR sleep (3), +.BR timer_create (2), +.BR usleep (3), +.BR time (7) diff --git a/original/man2/nfsservctl.2 b/original/man2/nfsservctl.2 new file mode 100644 index 00000000..0a00879d --- /dev/null +++ b/original/man2/nfsservctl.2 @@ -0,0 +1,54 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This text is in the public domain. +.\" +.\" FIXME The description of nfsservctl() on this page +.\" is woefully thin. +.\" +.TH NFSSERVCTL 2 1997-07-16 "Linux" "Linux Programmer's Manual" +.SH NAME +nfsservctl \- syscall interface to kernel nfs daemon +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "long nfsservctl(int " cmd ", struct nfsctl_arg *" argp , +.BI " union nfsctl_res *" resp ); +.fi +.SH DESCRIPTION +.nf +/* + * These are the commands understood by nfsctl(). + */ +#define NFSCTL_SVC 0 /* This is a server process. */ +#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */ +#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */ +#define NFSCTL_EXPORT 3 /* export a file system. */ +#define NFSCTL_UNEXPORT 4 /* unexport a file system. */ +#define NFSCTL_UGIDUPDATE 5 /* update a client's UID/GID map. */ +#define NFSCTL_GETFH 6 /* get an fh (used by mountd) */ + +struct nfsctl_arg { + int ca_version; /* safeguard */ + union { + struct nfsctl_svc u_svc; + struct nfsctl_client u_client; + struct nfsctl_export u_export; + struct nfsctl_uidmap u_umap; + struct nfsctl_fhparm u_getfh; + unsigned int u_debug; + } u; +} + +union nfsctl_res { + struct knfs_fh cr_getfh; + unsigned int cr_debug; +}; +.fi +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH "CONFORMING TO" +This call is Linux-specific. diff --git a/original/man2/nice.2 b/original/man2/nice.2 new file mode 100644 index 00000000..407145b4 --- /dev/null +++ b/original/man2/nice.2 @@ -0,0 +1,111 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt , 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 1996-11-04 by Eric S. Raymond +.\" Modified 2001-06-04 by aeb +.\" Modified 2004-05-27 by Michael Kerrisk +.\" +.TH NICE 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +nice \- change process priority +.SH SYNOPSIS +.B #include +.sp +.BI "int nice(int " inc ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR nice (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.SH DESCRIPTION +.BR nice () +adds +.I inc +to the nice value for the calling process. +(A higher nice value means a low priority.) +Only the super\%user may specify a negative increment, +or priority increase. +The range for nice values is described in +.BR getpriority (2). +.SH "RETURN VALUE" +On success, the new nice value is returned (but see NOTES below). +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EPERM +The calling process attempted to increase its priority by +supplying a negative +.I inc +but has insufficient privileges. +Under Linux the +.B CAP_SYS_NICE +capability is required. +(But see the discussion of the +.B RLIMIT_NICE +resource limit in +.BR setrlimit (2).) +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +However, the Linux and (g)libc +(earlier than glibc 2.2.4) return value is nonstandard, see below. +SVr4 documents an additional +.B EINVAL +error code. +.SH NOTES +SUSv2 and POSIX.1-2001 specify that +.BR nice () +should return the new nice value. +However, the Linux syscall and the +.BR nice () +library function provided in older versions of (g)libc +(earlier than glibc 2.2.4) return 0 on success. +The new nice value can be found using +.BR getpriority (2). + +Since glibc 2.2.4, +.BR nice () +is implemented as a library function that calls +.BR getpriority (2) +to obtain the new nice value to be returned to the caller. +With this implementation, +a successful call can legitimately return \-1. +To reliably detect an error, set +.I errno +to 0 before the call, and check its value when +.BR nice () +returns \-1. +.SH "SEE ALSO" +.BR nice (1), +.BR fork (2), +.BR getpriority (2), +.BR setpriority (2), +.BR capabilities (7), +.BR renice (8) diff --git a/original/man2/oldfstat.2 b/original/man2/oldfstat.2 new file mode 100644 index 00000000..b1a86c19 --- /dev/null +++ b/original/man2/oldfstat.2 @@ -0,0 +1 @@ +.so man2/stat.2 diff --git a/original/man2/oldlstat.2 b/original/man2/oldlstat.2 new file mode 100644 index 00000000..b1a86c19 --- /dev/null +++ b/original/man2/oldlstat.2 @@ -0,0 +1 @@ +.so man2/stat.2 diff --git a/original/man2/oldolduname.2 b/original/man2/oldolduname.2 new file mode 100644 index 00000000..450f7b1c --- /dev/null +++ b/original/man2/oldolduname.2 @@ -0,0 +1 @@ +.so man2/uname.2 diff --git a/original/man2/oldstat.2 b/original/man2/oldstat.2 new file mode 100644 index 00000000..b1a86c19 --- /dev/null +++ b/original/man2/oldstat.2 @@ -0,0 +1 @@ +.so man2/stat.2 diff --git a/original/man2/olduname.2 b/original/man2/olduname.2 new file mode 100644 index 00000000..450f7b1c --- /dev/null +++ b/original/man2/olduname.2 @@ -0,0 +1 @@ +.so man2/uname.2 diff --git a/original/man2/open.2 b/original/man2/open.2 new file mode 100644 index 00000000..11bd65e4 --- /dev/null +++ b/original/man2/open.2 @@ -0,0 +1,850 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" 2008 Greg Banks +.\" +.\" 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 by Rik Faith +.\" Modified 1994-08-21 by Michael Haardt +.\" Modified 1996-04-13 by Andries Brouwer +.\" Modified 1996-05-13 by Thomas Koenig +.\" Modified 1996-12-20 by Michael Haardt +.\" Modified 1999-02-19 by Andries Brouwer +.\" Modified 1998-11-28 by Joseph S. Myers +.\" Modified 1999-06-03 by Michael Haardt +.\" Modified 2002-05-07 by Michael Kerrisk +.\" Modified 2004-06-23 by Michael Kerrisk +.\" 2004-12-08, mtk, reordered flags list alphabetically +.\" 2004-12-08, Martin Pool (& mtk), added O_NOATIME +.\" 2007-09-18, mtk, Added description of O_CLOEXEC + other minor edits +.\" 2008-01-03, mtk, with input from Trond Myklebust +.\" and Timo Sirainen +.\" Rewrite description of O_EXCL. +.\" 2008-01-11, Greg Banks : add more detail +.\" on O_DIRECT. +.\" 2008-02-26, Michael Haardt: Reorganized text for O_CREAT and mode +.\" +.\" FIXME . Apr 08: The next POSIX revision has O_EXEC, O_SEARCH, and +.\" O_TTYINIT. Eventually these may need to be documented. --mtk +.\" FIXME Linux 2.6.33 has O_DSYNC, and a hiddden __O_SYNC. +.\" +.TH OPEN 2 2009-09-20 "Linux" "Linux Programmer's Manual" +.SH NAME +open, creat \- open and possibly create a file or device +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.sp +.BI "int open(const char *" pathname ", int " flags ); +.BI "int open(const char *" pathname ", int " flags ", mode_t " mode ); + +.BI "int creat(const char *" pathname ", mode_t " mode ); +.fi +.SH DESCRIPTION +Given a +.I pathname +for a file, +.BR open () +returns a file descriptor, a small, nonnegative integer +for use in subsequent system calls +.RB ( read "(2), " write "(2), " lseek "(2), " fcntl "(2), etc.)." +The file descriptor returned by a successful call will be +the lowest-numbered file descriptor not currently open for the process. +.PP +By default, the new file descriptor is set to remain open across an +.BR execve (2) +(i.e., the +.B FD_CLOEXEC +file descriptor flag described in +.BR fcntl (2) +is initially disabled; the Linux-specific +.B O_CLOEXEC +flag, described below, can be used to change this default). +The file offset is set to the beginning of the file (see +.BR lseek (2)). +.PP +A call to +.BR open () +creates a new +.IR "open file description" , +an entry in the system-wide table of open files. +This entry records the file offset and the file status flags +(modifiable via the +.BR fcntl (2) +.B F_SETFL +operation). +A file descriptor is a reference to one of these entries; +this reference is unaffected if +.I pathname +is subsequently removed or modified to refer to a different file. +The new open file description is initially not shared +with any other process, +but sharing may arise via +.BR fork (2). +.PP +The argument +.I flags +must include one of the following +.IR "access modes" : +.BR O_RDONLY ", " O_WRONLY ", or " O_RDWR . +These request opening the file read-only, write-only, or read/write, +respectively. + +In addition, zero or more file creation flags and file status flags +can be +.RI bitwise- or 'd +in +.IR flags . +The +.I file creation flags +are +.BR O_CREAT ", " O_EXCL ", " O_NOCTTY ", and " O_TRUNC . +The +.I file status flags +are all of the remaining flags listed below. +.\" FIXME . Actually is it true that the "file status flags" are all of the +.\" remaining flags listed below? SUSv4 divides the flags into: +.\" * Access mode +.\" * File creation +.\" * File status +.\" * Other (O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW) +.\" though it's not clear what the difference between "other" and +.\" "File creation" flags is. (I've raised an Aardvark to see if this +.\" can be clarified in SUSv4; 10 Oct 2008.) +The distinction between these two groups of flags is that +the file status flags can be retrieved and (in some cases) +modified using +.BR fcntl (2). +The full list of file creation flags and file status flags is as follows: +.TP +.B O_APPEND +The file is opened in append mode. +Before each +.BR write (2), +the file offset is positioned at the end of the file, +as if with +.BR lseek (2). +.B O_APPEND +may lead to corrupted files on NFS file systems if more than one process +appends data to a file at once. +.\" For more background, see +.\" http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453946 +.\" http://nfs.sourceforge.net/ +This is because NFS does not support +appending to a file, so the client kernel has to simulate it, which +can't be done without a race condition. +.TP +.B O_ASYNC +Enable signal-driven I/O: +generate a signal +.RB ( SIGIO +by default, but this can be changed via +.BR fcntl (2)) +when input or output becomes possible on this file descriptor. +This feature is only available for terminals, pseudo-terminals, +sockets, and (since Linux 2.6) pipes and FIFOs. +See +.BR fcntl (2) +for further details. +.TP +.BR O_CLOEXEC " (Since Linux 2.6.23)" +Enable the close-on-exec flag for the new file descriptor. +Specifying this flag permits a program to avoid additional +.BR fcntl (2) +.B F_SETFD +operations to set the +.B FD_CLOEXEC +flag. +Additionally, +use of this flag is essential in some multithreaded programs +since using a separate +.BR fcntl (2) +.B F_SETFD +operation to set the +.B FD_CLOEXEC +flag does not suffice to avoid race conditions +where one thread opens a file descriptor at the same +time as another thread does a +.BR fork (2) +plus +.BR execve (2). +.\" This flag fixes only one form of the race condition; +.\" The race can also occur with, for example, descriptors +.\" returned by accept(), pipe(), etc. +.TP +.B O_CREAT +If the file does not exist it will be created. +The owner (user ID) of the file is set to the effective user ID +of the process. +The group ownership (group ID) is set either to +the effective group ID of the process or to the group ID of the +parent directory (depending on file system type and mount options, +and the mode of the parent directory, see the mount options +.I bsdgroups +and +.I sysvgroups +described in +.BR mount (8)). +.\" As at 2.6.25, bsdgroups is supported by ext2, ext3, ext4, and +.\" XFS (since 2.6.14). +.RS +.PP +.I mode +specifies the permissions to use in case a new file is created. +This argument must be supplied when +.B O_CREAT +is specified in +.IR flags ; +if +.B O_CREAT +is not specified, then +.I mode +is ignored. +The effective permissions are modified by +the process's +.I umask +in the usual way: The permissions of the created file are +.IR "(mode\ &\ ~umask)" . +Note that this mode only applies to future accesses of the +newly created file; the +.BR open () +call that creates a read-only file may well return a read/write +file descriptor. +.PP +The following symbolic constants are provided for +.IR mode : +.TP 9 +.B S_IRWXU +00700 user (file owner) has read, write and execute permission +.TP +.B S_IRUSR +00400 user has read permission +.TP +.B S_IWUSR +00200 user has write permission +.TP +.B S_IXUSR +00100 user has execute permission +.TP +.B S_IRWXG +00070 group has read, write and execute permission +.TP +.B S_IRGRP +00040 group has read permission +.TP +.B S_IWGRP +00020 group has write permission +.TP +.B S_IXGRP +00010 group has execute permission +.TP +.B S_IRWXO +00007 others have read, write and execute permission +.TP +.B S_IROTH +00004 others have read permission +.TP +.B S_IWOTH +00002 others have write permission +.TP +.B S_IXOTH +00001 others have execute permission +.RE +.TP +.BR O_DIRECT " (Since Linux 2.4.10)" +Try to minimize cache effects of the I/O to and from this file. +In general this will degrade performance, but it is useful in +special situations, such as when applications do their own caching. +File I/O is done directly to/from user space buffers. +The +.B O_DIRECT +flag on its own makes at an effort to transfer data synchronously, +but does not give the guarantees of the +.B O_SYNC +that data and necessary metadata are transferred. +To guarantee synchronous I/O the +.B O_SYNC +must be used in addition to +.BR O_DIRECT . +See +.B NOTES +below for further discussion. +.sp +A semantically similar (but deprecated) interface for block devices +is described in +.BR raw (8). +.TP +.B O_DIRECTORY +If \fIpathname\fP is not a directory, cause the open to fail. +.\" But see the following and its replies: +.\" http://marc.theaimsgroup.com/?t=112748702800001&r=1&w=2 +.\" [PATCH] open: O_DIRECTORY and O_CREAT together should fail +.\" O_DIRECTORY | O_CREAT causes O_DIRECTORY to be ignored. +This flag is Linux-specific, and was added in kernel version 2.1.126, to +avoid denial-of-service problems if +.BR opendir (3) +is called on a +FIFO or tape device, but should not be used outside of the +implementation of +.BR opendir (3). +.TP +.B O_EXCL +Ensure that this call creates the file: +if this flag is specified in conjunction with +.BR O_CREAT , +and +.I pathname +already exists, then +.BR open () +will fail. +The behavior of +.B O_EXCL +is undefined if +.B O_CREAT +is not specified. + +When these two flags are specified, symbolic links are not followed: +.\" POSIX.1-2001 explicitly requires this behavior. +if +.I pathname +is a symbolic link, then +.BR open () +fails regardless of where the symbolic link points to. + +.B O_EXCL +is only supported on NFS when using NFSv3 or later on kernel 2.6 or later. +In environments where NFS +.B O_EXCL +support is not provided, programs that rely on it +for performing locking tasks will contain a race condition. +Portable programs that want to perform atomic file locking using a lockfile, +and need to avoid reliance on NFS support for +.BR O_EXCL , +can create a unique file on +the same file system (e.g., incorporating hostname and PID), and use +.BR link (2) +to make a link to the lockfile. +If +.BR link (2) +returns 0, the lock is successful. +Otherwise, use +.BR stat (2) +on the unique file to check if its link count has increased to 2, +in which case the lock is also successful. +.TP +.B O_LARGEFILE +(LFS) +Allow files whose sizes cannot be represented in an +.I off_t +(but can be represented in an +.IR off64_t ) +to be opened. +The +.B _LARGEFILE64_SOURCE +macro must be defined in order to obtain this definition. +Setting the +.B _FILE_OFFSET_BITS +feature test macro to 64 (rather than using +.BR O_LARGEFILE ) +is the preferred method of obtaining +method of accessing large files on 32-bit systems (see +.BR feature_test_macros (7)). +.TP +.BR O_NOATIME " (Since Linux 2.6.8)" +Do not update the file last access time (st_atime in the inode) +when the file is +.BR read (2). +This flag is intended for use by indexing or backup programs, +where its use can significantly reduce the amount of disk activity. +This flag may not be effective on all file systems. +One example is NFS, where the server maintains the access time. +.\" The O_NOATIME flag also affects the treatment of st_atime +.\" by mmap() and readdir(2), MTK, Dec 04. +.TP +.B O_NOCTTY +If +.I pathname +refers to a terminal device \(em see +.BR tty (4) +\(em it will not become the process's controlling terminal even if the +process does not have one. +.TP +.B O_NOFOLLOW +If \fIpathname\fP is a symbolic link, then the open fails. +This is a FreeBSD extension, which was added to Linux in version 2.1.126. +Symbolic links in earlier components of the pathname will still be +followed. +.\" The headers from glibc 2.0.100 and later include a +.\" definition of this flag; \fIkernels before 2.1.126 will ignore it if +.\" used\fP. +.TP +.BR O_NONBLOCK " or " O_NDELAY +When possible, the file is opened in nonblocking mode. +Neither the +.BR open () +nor any subsequent operations on the file descriptor which is +returned will cause the calling process to wait. +For the handling of FIFOs (named pipes), see also +.BR fifo (7). +For a discussion of the effect of +.B O_NONBLOCK +in conjunction with mandatory file locks and with file leases, see +.BR fcntl (2). +.TP +.B O_SYNC +The file is opened for synchronous I/O. +Any +.BR write (2)s +on the resulting file descriptor will block the calling process until +the data has been physically written to the underlying hardware. +.IR "But see NOTES below" . +.TP +.B O_TRUNC +If the file already exists and is a regular file and the open mode allows +writing (i.e., is +.B O_RDWR +or +.BR O_WRONLY ) +it will be truncated to length 0. +If the file is a FIFO or terminal device file, the +.B O_TRUNC +flag is ignored. +Otherwise the effect of +.B O_TRUNC +is unspecified. +.PP +Some of these optional flags can be altered using +.BR fcntl (2) +after the file has been opened. + +.BR creat () +is equivalent to +.BR open () +with +.I flags +equal to +.BR O_CREAT|O_WRONLY|O_TRUNC . +.SH "RETURN VALUE" +.BR open () +and +.BR creat () +return the new file descriptor, or \-1 if an error occurred +(in which case, +.I errno +is set appropriately). +.SH ERRORS +.TP +.B EACCES +The requested access to the file is not allowed, or search permission +is denied for one of the directories in the path prefix of +.IR pathname , +or the file did not exist yet and write access to the parent directory +is not allowed. +(See also +.BR path_resolution (7).) +.TP +.B EEXIST +.I pathname +already exists and +.BR O_CREAT " and " O_EXCL +were used. +.TP +.B EFAULT +.I pathname +points outside your accessible address space. +.TP +.B EFBIG +See +.BR EOVERFLOW . +.TP +.B EINTR +While blocked waiting to complete an open of a slow device +(e.g., a FIFO; see +.BR fifo (7)), +the call was interrupted by a signal handler; see +.BR signal (7). +.TP +.B EISDIR +.I pathname +refers to a directory and the access requested involved writing +(that is, +.B O_WRONLY +or +.B O_RDWR +is set). +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR pathname , +or \fBO_NOFOLLOW\fP was specified but +.I pathname +was a symbolic link. +.TP +.B EMFILE +The process already has the maximum number of files open. +.TP +.B ENAMETOOLONG +.I pathname +was too long. +.TP +.B ENFILE +The system limit on the total number of open files has been reached. +.TP +.B ENODEV +.I pathname +refers to a device special file and no corresponding device exists. +(This is a Linux kernel bug; in this situation +.B ENXIO +must be returned.) +.TP +.B ENOENT +.B O_CREAT +is not set and the named file does not exist. +Or, a directory component in +.I pathname +does not exist or is a dangling symbolic link. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOSPC +.I pathname +was to be created but the device containing +.I pathname +has no room for the new file. +.TP +.B ENOTDIR +A component used as a directory in +.I pathname +is not, in fact, a directory, or \fBO_DIRECTORY\fP was specified and +.I pathname +was not a directory. +.TP +.B ENXIO +.BR O_NONBLOCK " | " O_WRONLY +is set, the named file is a FIFO and +no process has the file open for reading. +Or, the file is a device special file and no corresponding device exists. +.TP +.B EOVERFLOW +.I pathname +refers to a regular file that is too large to be opened. +The usual scenario here is that an application compiled +on a 32-bit platform without +.I -D_FILE_OFFSET_BITS=64 +tried to open a file whose size exceeds +.I (2<<31)-1 +bits; +see also +.B O_LARGEFILE +above. +This is the error specified by POSIX.1-2001; +in kernels before 2.6.24, Linux gave the error +.B EFBIG +for this case. +.\" See http://bugzilla.kernel.org/show_bug.cgi?id=7253 +.\" "Open of a large file on 32-bit fails with EFBIG, should be EOVERFLOW" +.\" Reported 2006-10-03 +.TP +.B EPERM +The +.B O_NOATIME +flag was specified, but the effective user ID of the caller +.\" Strictly speaking, it's the file system UID... (MTK) +did not match the owner of the file and the caller was not privileged +.RB ( CAP_FOWNER ). +.TP +.B EROFS +.I pathname +refers to a file on a read-only file system and write access was +requested. +.TP +.B ETXTBSY +.I pathname +refers to an executable image which is currently being executed and +write access was requested. +.TP +.B EWOULDBLOCK +The +.B O_NONBLOCK +flag was specified, and an incompatible lease was held on the file +(see +.BR fcntl (2)). +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +The +.BR O_DIRECTORY , +.BR O_NOATIME , +and +.B O_NOFOLLOW +flags are Linux-specific, and one may need to define +.B _GNU_SOURCE +to obtain their definitions. + +The +.BR O_CLOEXEC +flag is not specified in POSIX.1-2001, +but is specified in POSIX.1-2008. + +.B O_DIRECT +is not specified in POSIX; one has to define +.B _GNU_SOURCE +to get its definition. +.SH NOTES +Under Linux, the +.B O_NONBLOCK +flag indicates that one wants to open +but does not necessarily have the intention to read or write. +This is typically used to open devices in order to get a file descriptor +for use with +.BR ioctl (2). + +Unlike the other values that can be specified in +.IR flags , +the +.I "access mode" +values +.BR O_RDONLY ", " O_WRONLY ", and " O_RDWR , +do not specify individual bits. +Rather, they define the low order two bits of +.IR flags , +and are defined respectively as 0, 1, and 2. +In other words, the combination +.B "O_RDONLY | O_WRONLY" +is a logical error, and certainly does not have the same meaning as +.BR O_RDWR . +Linux reserves the special, nonstandard access mode 3 (binary 11) in +.I flags +to mean: +check for read and write permission on the file and return a descriptor +that can't be used for reading or writing. +This nonstandard access mode is used by some Linux drivers to return a +descriptor that is only to be used for device-specific +.BR ioctl (2) +operations. +.\" See for example util-linux's disk-utils/setfdprm.c +.\" For some background on access mode 3, see +.\" http://thread.gmane.org/gmane.linux.kernel/653123 +.\" "[RFC] correct flags to f_mode conversion in __dentry_open" +.\" LKML, 12 Mar 2008 +.LP +The (undefined) effect of +.B O_RDONLY | O_TRUNC +varies among implementations. +On many systems the file is actually truncated. +.\" Linux 2.0, 2.5: truncate +.\" Solaris 5.7, 5.8: truncate +.\" Irix 6.5: truncate +.\" Tru64 5.1B: truncate +.\" HP-UX 11.22: truncate +.\" FreeBSD 4.7: truncate +.PP +There are many infelicities in the protocol underlying NFS, affecting +amongst others +.BR O_SYNC " and " O_NDELAY . + +POSIX provides for three different variants of synchronized I/O, +corresponding to the flags +.BR O_SYNC , +.BR O_DSYNC , +and +.BR O_RSYNC . +Currently (2.6.31), Linux only implements +.BR O_SYNC , +but glibc maps +.B O_DSYNC +and +.B O_RSYNC +to the same numerical value as +.BR O_SYNC +Most Linux filesystems don't actually implement the POSIX +.B O_SYNC +semantics, which require all metadata updates of a write +to be on disk on returning to userspace, but only the +.B O_DSYNC +semantics, which require only actual file data and metadata necessary +to retrieve it to be on disk by the time the system call returns. + +Note that +.BR open () +can open device special files, but +.BR creat () +cannot create them; use +.BR mknod (2) +instead. +.LP +On NFS file systems with UID mapping enabled, +.BR open () +may +return a file descriptor but, for example, +.BR read (2) +requests are denied +with \fBEACCES\fP. +This is because the client performs +.BR open () +by checking the +permissions, but UID mapping is performed by the server upon +read and write requests. + +If the file is newly created, its +.IR st_atime , +.IR st_ctime , +.I st_mtime +fields +(respectively, time of last access, time of last status change, and +time of last modification; see +.BR stat (2)) +are set +to the current time, and so are the +.I st_ctime +and +.I st_mtime +fields of the +parent directory. +Otherwise, if the file is modified because of the +.B O_TRUNC +flag, its st_ctime and st_mtime fields are set to the current time. +.SS O_DIRECT +.LP +The +.B O_DIRECT +flag may impose alignment restrictions on the length and address +of userspace buffers and the file offset of I/Os. +In Linux alignment +restrictions vary by file system and kernel version and might be +absent entirely. +However there is currently no file system\-independent +interface for an application to discover these restrictions for a given +file or file system. +Some file systems provide their own interfaces +for doing so, for example the +.B XFS_IOC_DIOINFO +operation in +.BR xfsctl (3). +.LP +Under Linux 2.4, transfer sizes, and the alignment of the user buffer +and the file offset must all be multiples of the logical block size +of the file system. +Under Linux 2.6, alignment to 512-byte boundaries +suffices. +.LP +The +.B O_DIRECT +flag was introduced in SGI IRIX, where it has alignment +restrictions similar to those of Linux 2.4. +IRIX has also a +.BR fcntl (2) +call to query appropriate alignments, and sizes. +FreeBSD 4.x introduced +a flag of the same name, but without alignment restrictions. +.LP +.B O_DIRECT +support was added under Linux in kernel version 2.4.10. +Older Linux kernels simply ignore this flag. +Some file systems may not implement the flag and +.BR open () +will fail with +.B EINVAL +if it is used. +.LP +Applications should avoid mixing +.B O_DIRECT +and normal I/O to the same file, +and especially to overlapping byte regions in the same file. +Even when the file system correctly handles the coherency issues in +this situation, overall I/O throughput is likely to be slower than +using either mode alone. +Likewise, applications should avoid mixing +.BR mmap (2) +of files with direct I/O to the same files. +.LP +The behaviour of +.B O_DIRECT +with NFS will differ from local file systems. +Older kernels, or +kernels configured in certain ways, may not support this combination. +The NFS protocol does not support passing the flag to the server, so +.B O_DIRECT +I/O will only bypass the page cache on the client; the server may +still cache the I/O. +The client asks the server to make the I/O +synchronous to preserve the synchronous semantics of +.BR O_DIRECT . +Some servers will perform poorly under these circumstances, especially +if the I/O size is small. +Some servers may also be configured to +lie to clients about the I/O having reached stable storage; this +will avoid the performance penalty at some risk to data integrity +in the event of server power failure. +The Linux NFS client places no alignment restrictions on +.B O_DIRECT +I/O. +.PP +In summary, +.B O_DIRECT +is a potentially powerful tool that should be used with caution. +It is recommended that applications treat use of +.B O_DIRECT +as a performance option which is disabled by default. +.PP +.RS +"The thing that has always disturbed me about O_DIRECT is that the whole +interface is just stupid, and was probably designed by a deranged monkey +on some serious mind-controlling substances." \(em Linus +.RE +.SH BUGS +Currently, it is not possible to enable signal-driven +I/O by specifying +.B O_ASYNC +when calling +.BR open (); +use +.BR fcntl (2) +to enable this flag. +.\" FIXME . Check bugzilla report on open(O_ASYNC) +.\" See http://bugzilla.kernel.org/show_bug.cgi?id=5993 +.SH "SEE ALSO" +.BR chmod (2), +.BR chown (2), +.BR close (2), +.BR dup (2), +.BR fcntl (2), +.BR link (2), +.BR lseek (2), +.BR mknod (2), +.BR mmap (2), +.BR mount (2), +.BR openat (2), +.BR read (2), +.BR socket (2), +.BR stat (2), +.BR umask (2), +.BR unlink (2), +.BR write (2), +.BR fopen (3), +.BR feature_test_macros (7), +.BR fifo (7), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/openat.2 b/original/man2/openat.2 new file mode 100644 index 00000000..8ba7ffee --- /dev/null +++ b/original/man2/openat.2 @@ -0,0 +1,172 @@ +.\" 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. +.\" +.\" +.TH OPENAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +openat \- open a file relative to a directory file descriptor +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int openat(int " dirfd ", const char *" pathname ", int " flags ); +.BI "int openat(int " dirfd ", const char *" pathname ", int " flags \ +", mode_t " mode ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR openat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +The +.BR openat () +system call operates in exactly the same way as +.BR open (2), +except for the differences described in this manual page. + +If the pathname given in +.I pathname +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I dirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR open (2) +for a relative pathname). + +If +.I pathname +is relative and +.I dirfd +is the special value +.BR AT_FDCWD , +then +.I pathname +is interpreted relative to the current working +directory of the calling process (like +.BR open (2)). + +If +.I pathname +is absolute, then +.I dirfd +is ignored. +.SH "RETURN VALUE" +On success, +.BR openat () +returns a new file descriptor. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR open (2) +can also occur for +.BR openat (). +The following additional errors can occur for +.BR openat (): +.TP +.B EBADF +.I dirfd +is not a valid file descriptor. +.TP +.B ENOTDIR +.I pathname +is relative and +.I dirfd +is a file descriptor referring to a file other than a directory. +.SH VERSIONS +.BR openat () +was added to Linux in kernel 2.6.16. +.SH "CONFORMING TO" +POSIX.1-2008. +A similar system call exists on 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 +.\" to refer to the notion of "at a relative location". +.\" +.\" See the following for a discussion of the inconsistent +.\" naming of the *at() functions: +.\" http://www.opengroup.org/austin/mailarchives/ag/msg09103.html +.\" Subject: RE: The naming of at()s is a difficult matter +.\" From: Don Cragun +.\" Date: Tue, 14 Feb 2006 14:56:50 -0800 (PST) +.\" +.SH NOTES +.BR openat () +and other similar system calls suffixed "at" are supported +for two reasons. + +First, +.BR openat () +allows an application to avoid race conditions that could +occur when using +.BR open (2) +to open files in directories other than the current working directory. +These race conditions result from the fact that some component +of the directory prefix given to +.BR open (2) +could be changed in parallel with the call to +.BR open (2). +Such races can be avoided by +opening a file descriptor for the target directory, +and then specifying that file descriptor as the +.I dirfd +argument of +.BR openat (). + +Second, +.BR openat () +allows the implementation of a per-thread "current working +directory", via file descriptor(s) maintained by the application. +(This functionality can also be obtained by tricks based +on the use of +.IR /proc/self/fd/ dirfd, +but less efficiently.) +.SH "SEE ALSO" +.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) diff --git a/original/man2/outb.2 b/original/man2/outb.2 new file mode 100644 index 00000000..df6449fa --- /dev/null +++ b/original/man2/outb.2 @@ -0,0 +1,69 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Paul Gortmaker +.\" (gpg109@rsphy1.anu.edu.au) +.\" Wed Nov 29 10:58:54 EST 1995 +.\" +.\" 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. +.\" +.\" +.TH OUTB 2 1995-11-29 "Linux" "Linux Programmer's Manual" +.SH NAME +outb, outw, outl, outsb, outsw, outsl, +inb, inw, inl, insb, insw, insl, +outb_p, outw_p, outl_p, inb_p, inw_p, inl_p \- port I/O +.SH DESCRIPTION +This family of functions is used to do low-level port input and output. +The out* functions do port output, the in* functions do port input; +the b-suffix functions are byte-width and the w-suffix functions +word-width; the _p-suffix functions pause until the I/O completes. +.LP +They are primarily designed for internal kernel use, +but can be used from user space. +.\" , given the following information +.\" in addition to that given in +.\" .BR outb (9). + +You compile with \fB\-O\fP or \fB\-O2\fP or similar. +The functions +are defined as inline macros, and will not be substituted in without +optimization enabled, causing unresolved references at link time. + +You use +.BR ioperm (2) +or alternatively +.BR iopl (2) +to tell the kernel to allow the user space application to access the +I/O ports in question. +Failure to do this will cause the application +to receive a segmentation fault. +.SH "CONFORMING TO" +.BR outb () +and friends are hardware-specific. +The +.I value +argument is passed first and the +.I port +argument is passed second, +which is the opposite order from most DOS implementations. +.SH "SEE ALSO" +.BR ioperm (2), +.BR iopl (2) diff --git a/original/man2/outb_p.2 b/original/man2/outb_p.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/outb_p.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/outl.2 b/original/man2/outl.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/outl.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/outl_p.2 b/original/man2/outl_p.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/outl_p.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/outsb.2 b/original/man2/outsb.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/outsb.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/outsl.2 b/original/man2/outsl.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/outsl.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/outsw.2 b/original/man2/outsw.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/outsw.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/outw.2 b/original/man2/outw.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/outw.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/outw_p.2 b/original/man2/outw_p.2 new file mode 100644 index 00000000..2c63c754 --- /dev/null +++ b/original/man2/outw_p.2 @@ -0,0 +1 @@ +.so man2/outb.2 diff --git a/original/man2/path_resolution.2 b/original/man2/path_resolution.2 new file mode 100644 index 00000000..b00301db --- /dev/null +++ b/original/man2/path_resolution.2 @@ -0,0 +1,2 @@ +.so man7/path_resolution.7 +.\" FIXME . this link will eventually be removed (created June 2007) diff --git a/original/man2/pause.2 b/original/man2/pause.2 new file mode 100644 index 00000000..892b66f1 --- /dev/null +++ b/original/man2/pause.2 @@ -0,0 +1,63 @@ +.\" 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 Sat Jul 24 14:48:00 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995 by Mike Battersby (mib@deakin.edu.au) +.\" Modified 2000 by aeb, following Michael Kerrisk +.\" +.TH PAUSE 2 2008-10-06 "Linux" "Linux Programmer's Manual" +.SH NAME +pause \- wait for signal +.SH SYNOPSIS +.B #include +.sp +.B int pause(void); +.SH DESCRIPTION +.BR pause () +causes the calling process (or thread) to sleep +until a signal is delivered that either terminates the process or causes +the invocation of a signal-catching function. +.SH "RETURN VALUE" +.BR pause () +only returns when a signal was caught and the +signal-catching function returned. +In this case +.BR pause () +returns \-1, and +.I errno +is set to +.\" .BR ERESTARTNOHAND . +.BR EINTR . +.SH ERRORS +.TP +.B EINTR +a signal was caught and the signal-catching function returned. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH "SEE ALSO" +.BR kill (2), +.BR select (2), +.BR signal (2), +.BR sigsuspend (2) diff --git a/original/man2/pciconfig_iobase.2 b/original/man2/pciconfig_iobase.2 new file mode 100644 index 00000000..5ab29958 --- /dev/null +++ b/original/man2/pciconfig_iobase.2 @@ -0,0 +1 @@ +.so man2/pciconfig_read.2 diff --git a/original/man2/pciconfig_read.2 b/original/man2/pciconfig_read.2 new file mode 100644 index 00000000..a4163e59 --- /dev/null +++ b/original/man2/pciconfig_read.2 @@ -0,0 +1,110 @@ +.\" Contributed by Niki A. Rahimi, LTC Security Development +.\" narahimi@us.ibm.com +.\" May be freely distributed. +.\" +.TH PCICONFIG_READ 2 2003-07-14 "Linux" "Linux Programmer's Manual" +.SH NAME +pciconfig_read, pciconfig_write, pciconfig_iobase \- pci device information handling +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int pciconfig_read(unsigned long " bus ", unsigned long " dfn , +.BI " unsigned long " off ", unsigned long " len ", void *" buf ); +.BI "int pciconfig_write(unsigned long " bus ", unsigned long " dfn , +.BI " unsigned long " off ", unsigned long " len ", void *" buf ); +.BI "int pciconfig_iobase(long " which ", unsigned long " bus , +.BI " unsigned long " devfn ); +.fi +.SH DESCRIPTION +.PP +Most of the interaction with PCI devices is already handled by the +kernel PCI layer, +and thus these calls should not normally need to be accessed from userspace. +.TP +.BR pciconfig_read () +Reads to +.I buf +from device +.I dev +at offset +.I off +value. +.TP +.BR pciconfig_write () +Writes from +.I buf +to device +.I dev +at offset +.I off +value. +.TP +.BR pciconfig_iobase () +You pass it a bus/devfn pair and get a physical address for either the +memory offset (for things like prep, this is 0xc0000000), +the IO base for PIO cycles, or the ISA holes if any. +.SH "RETURN VALUE" +.TP +.BR pciconfig_read () +On success zero is returned. +On error, \-1 is returned and +.I errno +is set appropriately. +.TP +.BR pciconfig_write () +On success zero is returned. +On error, \-1 is returned and +.I errno +is set appropriately. +.TP +.BR pciconfig_iobase () +Returns information on locations of various I/O +regions in physical memory according to the +.I which +value. +Values for +.I which +are: +.BR IOBASE_BRIDGE_NUMBER , +.BR IOBASE_MEMORY , +.BR IOBASE_IO , +.BR IOBASE_ISA_IO , +.BR IOBASE_ISA_MEM . +.SH ERRORS +.TP +.B EINVAL +.I len +value is invalid. +This does not apply to +.BR pciconfig_iobase (). +.TP +.B EIO +I/O error. +.TP +.B ENODEV +For +.BR pciconfig_iobase (), +"hose" value is NULL. +For the other calls, could not find a slot. +.TP +.B ENOSYS +The system has not implemented these calls +.RB ( CONFIG_PCI +not defined). +.TP +.B EOPNOTSUPP +This return value is only valid for +.BR pciconfig_iobase (). +It is returned if the value for +.I which +is invalid. +.TP +.B EPERM +User does not have the \fBCAP_SYS_ADMIN\fP capability. +This does not apply to +.BR pciconfig_iobase (). +.SH "CONFORMING TO" +These calls are Linux-specific, available since Linux 2.0.26/2.1.11. +.SH "SEE ALSO" +.BR capabilities (7) diff --git a/original/man2/pciconfig_write.2 b/original/man2/pciconfig_write.2 new file mode 100644 index 00000000..5ab29958 --- /dev/null +++ b/original/man2/pciconfig_write.2 @@ -0,0 +1 @@ +.so man2/pciconfig_read.2 diff --git a/original/man2/personality.2 b/original/man2/personality.2 new file mode 100644 index 00000000..1c205e61 --- /dev/null +++ b/original/man2/personality.2 @@ -0,0 +1,69 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created Sat Aug 21 1995 Thomas K. Dyas +.\" +.\" typo corrected, aeb, 950825 +.\" added layout change from joey, 960722 +.\" changed prototype, documented 0xffffffff, aeb, 030101 +.\" Modified 2004-11-03 patch from Martin Schulze +.\" +.TH PERSONALITY 2 2003-01-01 "Linux" "Linux Programmer's Manual" +.SH NAME +personality \- set the process execution domain +.SH SYNOPSIS +.B #include +.sp +.BI "int personality(unsigned long " persona ); +.SH DESCRIPTION +Linux supports different execution domains, or personalities, for each +process. +Among other things, execution domains tell Linux how to map +signal numbers into signal actions. +The execution domain system allows +Linux to provide limited support for binaries compiled under other +Unix-like operating systems. + +This function will return the current +.BR personality () +when +.I persona +equals 0xffffffff. +Otherwise, it will make the execution domain +referenced by +.I persona +the new execution domain of the calling process. +.SH "RETURN VALUE" +On success, the previous +.I persona +is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +The kernel was unable to change the personality. +.SH "CONFORMING TO" +.BR personality () +is Linux-specific and should not be used in programs intended to +be portable. diff --git a/original/man2/pipe.2 b/original/man2/pipe.2 new file mode 100644 index 00000000..67fb1f44 --- /dev/null +++ b/original/man2/pipe.2 @@ -0,0 +1,195 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2005, 2008, Michael Kerrisk +.\" (A few fragments remain from an earlier (1992) version by +.\" Drew Eckhardt .) +.\" +.\" 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-23 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 2004-06-17 by Michael Kerrisk +.\" Modified 2005, mtk: added an example program +.\" Modified 2008-01-09, mtk: rewrote DESCRIPTION; minor additions +.\" to EXAMPLE text. +.\" 2008-10-10, mtk: add description of pipe2() +.\" +.TH PIPE 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH NAME +pipe, pipe2 \- create pipe +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int pipe(int " pipefd "[2]);" +.sp +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int pipe2(int " pipefd "[2], int " flags ); +.fi +.SH DESCRIPTION +.BR pipe () +creates a pipe, a unidirectional data channel that +can be used for interprocess communication. +The array +.IR pipefd +is used to return two file descriptors referring to the ends of the pipe. +.IR pipefd[0] +refers to the read end of the pipe. +.IR pipefd[1] +refers to the write end of the pipe. +Data written to the write end of the pipe is buffered by the kernel +until it is read from the read end of the pipe. +For further details, see +.BR pipe (7). + +If +.IR flags +is 0, then +.BR pipe2 () +is the same as +.BR pipe (). +The following values can be bitwise ORed in +.IR flags +to obtain different behavior: +.TP 12 +.B O_NONBLOCK +Set the +.BR O_NONBLOCK +file status flag on the two new open file descriptions. +Using this flag saves extra calls to +.BR fcntl (2) +to achieve the same result. +.TP +.B O_CLOEXEC +Set the close-on-exec +.RB ( FD_CLOEXEC ) +flag on the two new file descriptors. +See the description of the same flag in +.BR open (2) +for reasons why this may be useful. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +.I pipefd +is not valid. +.TP +.B EINVAL +.RB ( pipe2 ()) +Invalid value in +.IR flags . +.TP +.B EMFILE +Too many file descriptors are in use by the process. +.TP +.B ENFILE +The system limit on the total number of open files has been reached. +.SH VERSIONS +.BR pipe2 () +was added to Linux in version 2.6.27; +glibc support is available starting with +version 2.9. +.SH "CONFORMING TO" +.BR pipe (): +POSIX.1-2001. + +.BR pipe2 () +is Linux-specific. +.SH EXAMPLE +.\" fork.2 refers to this example program. +The following program creates a pipe, and then +.BR fork (2)s +to create a child process; +the child inherits a duplicate set of file +descriptors that refer to the same pipe. +After the +.BR fork (2), +each process closes the descriptors that it doesn't need for the pipe +(see +.BR pipe (7)). +The parent then writes the string contained in the program's +command-line argument to the pipe, +and the child reads this string a byte at a time from the pipe +and echoes it on standard output. +.nf + +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int pipefd[2]; + pid_t cpid; + char buf; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + if (pipe(pipefd) == \-1) { + perror("pipe"); + exit(EXIT_FAILURE); + } + + cpid = fork(); + if (cpid == \-1) { + perror("fork"); + exit(EXIT_FAILURE); + } + + if (cpid == 0) { /* Child reads from pipe */ + close(pipefd[1]); /* Close unused write end */ + + while (read(pipefd[0], &buf, 1) > 0) + write(STDOUT_FILENO, &buf, 1); + + write(STDOUT_FILENO, "\\n", 1); + close(pipefd[0]); + _exit(EXIT_SUCCESS); + + } else { /* Parent writes argv[1] to pipe */ + close(pipefd[0]); /* Close unused read end */ + write(pipefd[1], argv[1], strlen(argv[1])); + close(pipefd[1]); /* Reader will see EOF */ + wait(NULL); /* Wait for child */ + exit(EXIT_SUCCESS); + } +} +.fi +.SH "SEE ALSO" +.BR fork (2), +.BR read (2), +.BR socketpair (2), +.BR write (2), +.BR popen (3), +.BR pipe (7) diff --git a/original/man2/pipe2.2 b/original/man2/pipe2.2 new file mode 100644 index 00000000..980e2406 --- /dev/null +++ b/original/man2/pipe2.2 @@ -0,0 +1 @@ +.so man2/pipe.2 diff --git a/original/man2/pivot_root.2 b/original/man2/pivot_root.2 new file mode 100644 index 00000000..1ba587d5 --- /dev/null +++ b/original/man2/pivot_root.2 @@ -0,0 +1,142 @@ +.\" Copyright (C) 2000 by Werner Almesberger +.\" May be distributed under GPL +.\" +.\" Written 2000-02-23 by Werner Almesberger +.\" Modified 2004-06-17 Michael Kerrisk +.\" +.TH PIVOT_ROOT 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.SH NAME +pivot_root \- change the root file system +.SH SYNOPSIS +.BI "int pivot_root(const char *" new_root ", const char *" put_old ); +.SH DESCRIPTION +.BR pivot_root () +moves the root file system of the calling process to the +directory \fIput_old\fP and makes \fInew_root\fP the new root file system +of the calling process. +.\" +.\" The +.\" .B CAP_SYS_ADMIN +.\" capability is required. + +The typical use of +.BR pivot_root () +is during system startup, when the +system mounts a temporary root file system (e.g., an \fBinitrd\fP), then +mounts the real root file system, and eventually turns the latter into +the current root of all relevant processes or threads. + +.BR pivot_root () +may or may not change the current root and the current +working directory of any processes or threads which use the old +root directory. +The caller of +.BR pivot_root () +must ensure that processes with root or current working directory +at the old root operate correctly in either case. +An easy way to ensure this is to change their +root and current working directory to \fInew_root\fP before invoking +.BR pivot_root (). + +The paragraph above is intentionally vague because the implementation +of +.BR pivot_root () +may change in the future. +At the time of writing, +.BR pivot_root () +changes root and current working directory of each process or +thread to \fInew_root\fP if they point to the old root directory. +This +is necessary in order to prevent kernel threads from keeping the old +root directory busy with their root and current working directory, +even if they never access +the file system in any way. +In the future, there may be a mechanism for +kernel threads to explicitly relinquish any access to the file system, +such that this fairly intrusive mechanism can be removed from +.BR pivot_root (). + +Note that this also applies to the calling process: +.BR pivot_root () +may +or may not affect its current working directory. +It is therefore recommended to call +\fBchdir("/")\fP immediately after +.BR pivot_root (). + +The following restrictions apply to \fInew_root\fP and \fIput_old\fP: +.IP \- 3 +They must be directories. +.IP \- 3 +\fInew_root\fP and \fIput_old\fP must not be on the same file system as +the current root. +.IP \- 3 +\fIput_old\fP must be underneath \fInew_root\fP, that is, adding a nonzero +number of \fI/..\fP to the string pointed to by \fIput_old\fP must yield +the same directory as \fInew_root\fP. +.IP \- 3 +No other file system may be mounted on \fIput_old\fP. +.PP +See also +.BR pivot_root (8) +for additional usage examples. + +If the current root is not a mount point (e.g., after +.BR chroot (2) +or +.BR pivot_root (), +see also below), not the old root directory, but the +mount point of that file system is mounted on \fIput_old\fP. + +\fInew_root\fP does not have to be a mount point. +In this case, +\fI/proc/mounts\fP will show the mount point of the file system containing +\fInew_root\fP as root (\fI/\fP). +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +\fIerrno\fP is set appropriately. +.SH ERRORS +.BR pivot_root () +may return (in \fIerrno\fP) any of the errors returned by +.BR stat (2). +Additionally, it may return: +.TP +.B EBUSY +\fInew_root\fP or \fIput_old\fP are on the current root file system, +or a file system is already mounted on \fIput_old\fP. +.TP +.B EINVAL +\fIput_old\fP is not underneath \fInew_root\fP. +.TP +.B ENOTDIR +\fInew_root\fP or \fIput_old\fP is not a directory. +.TP +.B EPERM +The calling process does not have the +.B CAP_SYS_ADMIN +capability. +.SH VERSIONS +.BR pivot_root () +was introduced in Linux 2.3.41. +.SH "CONFORMING TO" +.BR pivot_root () +is Linux-specific and hence is not portable. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). +.SH BUGS +.BR pivot_root () +should not have to change root and current working directory of all other +processes in the system. + +Some of the more obscure uses of +.BR pivot_root () +may quickly lead to +insanity. +.SH "SEE ALSO" +.BR chdir (2), +.BR chroot (2), +.BR stat (2), +.BR initrd (4), +.BR pivot_root (8) diff --git a/original/man2/poll.2 b/original/man2/poll.2 new file mode 100644 index 00000000..da316793 --- /dev/null +++ b/original/man2/poll.2 @@ -0,0 +1,331 @@ +.\" 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. +.\" +.TH POLL 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH NAME +poll, ppoll \- wait for some event on a file descriptor +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int poll(struct pollfd *" fds ", nfds_t " nfds ", int " timeout ); +.sp +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int ppoll(struct pollfd *" fds ", nfds_t " nfds ", " +.BI " const struct timespec *" timeout ", const sigset_t *" sigmask ); +.fi +.SH DESCRIPTION +.BR poll () +performs a similar task to +.BR select (2): +it waits for one of a set of file descriptors to become ready +to perform I/O. + +The set of file descriptors to be monitored is specified in the +.I fds +argument, which is an array of structures of the following form: +.in +4n +.nf + +struct pollfd { + int fd; /* file descriptor */ + short events; /* requested events */ + short revents; /* returned events */ +}; +.in +.fi +.PP +The caller should specify the number of items in the +.I fds +array in +.IR nfds . + +The field +.I fd +contains a file descriptor for an open file. + +The field +.I events +is an input parameter, a bit mask specifying the events the application +is interested in. + +The field +.I revents +is an output parameter, filled by the kernel with the events that +actually occurred. +The bits returned in +.I revents +can include any of those specified in +.IR events , +or one of the values +.BR POLLERR , +.BR POLLHUP , +or +.BR POLLNVAL . +(These three bits are meaningless in the +.I events +field, and will be set in the +.I revents +field whenever the corresponding condition is true.) + +If none of the events requested (and no error) has occurred for any +of the file descriptors, then +.BR poll () +blocks until one of the events occurs. + +The +.I timeout +argument specifies an upper limit on the time for which +.BR poll () +will block, in milliseconds. +Specifying a negative value in +.I timeout +means an infinite timeout. + +The bits that may be set/returned in +.I events +and +.I revents +are defined in \fI\fP: +.RS +.TP +.B POLLIN +There is data to read. +.TP +.B POLLPRI +There is urgent data to read (e.g., out-of-band data on TCP socket; +pseudo-terminal master in packet mode has seen state change in slave). +.TP +.B POLLOUT +Writing now will not block. +.TP +.BR POLLRDHUP " (since Linux 2.6.17)" +Stream socket peer closed connection, +or shut down writing half of connection. +The +.B _GNU_SOURCE +feature test macro must be defined in order to obtain this definition. +.TP +.B POLLERR +Error condition (output only). +.TP +.B POLLHUP +Hang up (output only). +.TP +.B POLLNVAL +Invalid request: +.I fd +not open (output only). +.RE +.PP +When compiling with +.B _XOPEN_SOURCE +defined, one also has the following, +which convey no further information beyond the bits listed above: +.RS +.TP +.B POLLRDNORM +Equivalent to +.BR POLLIN . +.TP +.B POLLRDBAND +Priority band data can be read (generally unused on Linux). +.\" POLLRDBAND is used in the DECnet protocol. +.TP +.B POLLWRNORM +Equivalent to +.BR POLLOUT . +.TP +.B POLLWRBAND +Priority data may be written. +.RE +.PP +Linux also knows about, but does not use +.BR POLLMSG . +.SS ppoll() +The relationship between +.BR poll () +and +.BR ppoll () +is analogous to the relationship between +.BR select (2) +and +.BR pselect (2): +like +.BR pselect (2), +.BR ppoll () +allows an application to safely wait until either a file descriptor +becomes ready or until a signal is caught. +.PP +Other than the difference in the +.I timeout +argument, the following +.BR ppoll () +call: +.nf + + ready = ppoll(&fds, nfds, timeout, &sigmask); + +.fi +is equivalent to +.I atomically +executing the following calls: +.nf + + sigset_t origmask; + + sigprocmask(SIG_SETMASK, &sigmask, &origmask); + ready = poll(&fds, nfds, timeout); + sigprocmask(SIG_SETMASK, &origmask, NULL); +.fi +.PP +See the description of +.BR pselect (2) +for an explanation of why +.BR ppoll () +is necessary. + +If the +.I sigmask +argument is specified as NULL, then +no signal mask manipulation is performed +(and thus +.BR ppoll () +differs from +.BR poll () +only in the precision of the +.I timeout +argument). + +The +.I timeout +argument specifies an upper limit on the amount of time that +.BR ppoll () +will block. +This argument is a pointer to a structure of the following form: +.in +4n +.nf + +struct timespec { + long tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.fi +.in + +If +.I timeout +is specified as NULL, then +.BR ppoll () +can block indefinitely. +.SH "RETURN VALUE" +On success, a positive number is returned; this is +the number of structures which have nonzero +.I revents +fields (in other words, those descriptors with events or errors reported). +A value of 0 indicates that the call timed out and no file +descriptors were ready. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +The array given as argument was not contained in the calling program's +address space. +.TP +.B EINTR +A signal occurred before any requested event; see +.BR signal (7). +.TP +.B EINVAL +The +.I nfds +value exceeds the +.B RLIMIT_NOFILE +value. +.TP +.B ENOMEM +There was no space to allocate file descriptor tables. +.SH VERSIONS +The +.BR poll () +system call was introduced in Linux 2.1.23. +The +.BR poll () +library call was introduced in libc 5.4.28 +(and provides emulation using select(2) if your kernel does not +have a +.BR poll () +system call). + +The +.BR ppoll () +system call was added to Linux in kernel 2.6.16. +The +.BR ppoll () +library call was added in glibc 2.4. +.SH "CONFORMING TO" +.BR poll () +conforms to POSIX.1-2001. +.BR ppoll () +is Linux-specific. +.\" NetBSD 3.0 has a pollts() which is like Linux ppoll(). +.SH NOTES +Some implementations define the nonstandard constant +.B INFTIM +with the value \-1 for use as a +.IR timeout . +This constant is not provided in glibc. +.SS "Linux Notes" +The Linux +.BR ppoll () +system call modifies its +.I timeout +argument. +However, the glibc wrapper function hides this behavior +by using a local variable for the timeout argument that +is passed to the system call. +Thus, the glibc +.BR ppoll () +function does not modify its +.I timeout +argument. +.SH BUGS +See the discussion of spurious readiness notifications under the +BUGS section of +.BR select (2). +.SH "SEE ALSO" +.BR select (2), +.BR select_tut (2), +.BR feature_test_macros (7), +.BR time (7) diff --git a/original/man2/posix_fadvise.2 b/original/man2/posix_fadvise.2 new file mode 100644 index 00000000..838c1b95 --- /dev/null +++ b/original/man2/posix_fadvise.2 @@ -0,0 +1,147 @@ +.\" 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 +.\" +.TH POSIX_FADVISE 2 2003-02-14 "Linux" "Linux Programmer's Manual" +.SH NAME +posix_fadvise \- predeclare an access pattern for file data +.SH SYNOPSIS +.nf +.B #define _XOPEN_SOURCE 600 +.B #include +.sp +.BI "int posix_fadvise(int " fd ", off_t " offset ", off_t " len \ +", int " advice ");" +.fi +.SH DESCRIPTION +Programs can use +.BR posix_fadvise () +to announce an intention to access +file data in a specific pattern in the future, thus allowing the kernel +to perform appropriate optimizations. + +The \fIadvice\fP applies to a (not necessarily existent) region starting +at \fIoffset\fP and extending for \fIlen\fP bytes (or until the end of +the file if \fIlen\fP is 0) within the file referred to by \fIfd\fP. +The advice is not binding; it merely constitutes an expectation on behalf of +the application. + +Permissible values for \fIadvice\fP include: +.TP +.B POSIX_FADV_NORMAL +Indicates that the application has no advice to give about its access +pattern for the specified data. +If no advice is given for an open file, +this is the default assumption. +.TP +.B POSIX_FADV_SEQUENTIAL +The application expects to access the specified data sequentially (with +lower offsets read before higher ones). +.TP +.B POSIX_FADV_RANDOM +The specified data will be accessed in random order. +.TP +.B POSIX_FADV_NOREUSE +The specified data will be accessed only once. +.TP +.B POSIX_FADV_WILLNEED +The specified data will be accessed in the near future. +.TP +.B POSIX_FADV_DONTNEED +The specified data will not be accessed in the near future. +.SH "RETURN VALUE" +On success, zero is returned. +On error, an error number is returned. +.SH ERRORS +.TP +.B EBADF +The \fIfd\fP argument was not a valid file descriptor. +.TP +.B EINVAL +An invalid value was specified for \fIadvice\fP. +.TP +.B ESPIPE +The specified file descriptor refers to a pipe or FIFO. +(Linux actually +returns +.B EINVAL +in this case.) +.SH VERSIONS +.BR posix_fadvise () +appeared in kernel 2.5.60. +Glibc support has been provided since version 2.2. +.\" Actually as fadvise64() -- MTK +.SH "CONFORMING TO" +POSIX.1-2001. +Note that the type of the +.I len +argument was changed from +.I size_t +to +.I off_t +in POSIX.1-2003 TC1. +.SH NOTES +Under Linux, \fBPOSIX_FADV_NORMAL\fP sets the readahead window to the +default size for the backing device; \fBPOSIX_FADV_SEQUENTIAL\fP doubles +this size, and \fBPOSIX_FADV_RANDOM\fP disables file readahead entirely. +These changes affect the entire file, not just the specified region +(but other open file handles to the same file are unaffected). + +\fBPOSIX_FADV_WILLNEED\fP initiates a +nonblocking read of the specified region into the page cache. +The amount of data read may be decreased by the kernel depending +on virtual memory load. +(A few megabytes will usually be fully satisfied, +and more is rarely useful.) + +In kernels before 2.6.18, \fBPOSIX_FADV_NOREUSE\fP had the +same semantics as \fBPOSIX_FADV_WILLNEED\fP. +This was probably a bug; since kernel 2.6.18, this flag is a no-op. + +\fBPOSIX_FADV_DONTNEED\fP attempts to free cached pages associated with +the specified region. +This is useful, for example, while streaming large +files. +A program may periodically request the kernel to free cached data +that has already been used, so that more useful cached pages are not +discarded instead. + +Pages that have not yet been written out will be unaffected, so if the +application wishes to guarantee that pages will be released, it should +call +.BR fsync (2) +or +.BR fdatasync (2) +first. +.SH BUGS +In kernels before 2.6.6, if +.I len +was specified as 0, then this was interpreted literally as "zero bytes", +rather than as meaning "all bytes through to the end of the file". +.SH "SEE ALSO" +.BR readahead (2), +.BR posix_fallocate (3), +.BR posix_madvise (3), +.\" FIXME . Write a posix_fadvise(3) page. +.BR feature_test_macros (7) diff --git a/original/man2/ppoll.2 b/original/man2/ppoll.2 new file mode 100644 index 00000000..227cd0e4 --- /dev/null +++ b/original/man2/ppoll.2 @@ -0,0 +1 @@ +.so man2/poll.2 diff --git a/original/man2/prctl.2 b/original/man2/prctl.2 new file mode 100644 index 00000000..469ae47d --- /dev/null +++ b/original/man2/prctl.2 @@ -0,0 +1,420 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1998 Andries Brouwer (aeb@cwi.nl) +.\" and Copyright (C) 2002 Michael Kerrisk +.\" and Copyright Guillem Jover +.\" +.\" 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 Thu Nov 11 04:19:42 MET 1999, aeb: added PR_GET_PDEATHSIG +.\" Modified 27 Jun 02, Michael Kerrisk +.\" Added PR_SET_DUMPABLE, PR_GET_DUMPABLE, +.\" PR_SET_KEEPCAPS, PR_GET_KEEPCAPS +.\" Modified 2006-08-30 Guillem Jover +.\" Updated Linux versions where the options where introduced. +.\" Added PR_SET_TIMING, PR_GET_TIMING, PR_SET_NAME, PR_GET_NAME, +.\" PR_SET_UNALIGN, PR_GET_UNALIGN, PR_SET_FPEMU, PR_GET_FPEMU, +.\" PR_SET_FPEXC, PR_GET_FPEXC +.\" 2008-04-29 Serge Hallyn, Document PR_CAPBSET_READ and PR_CAPBSET_DROP +.\" 2008-06-13 Erik Bosman, +.\" Document PR_GET_TSC and PR_SET_TSC. +.\" 2008-06-15 mtk, Document PR_SET_SECCOMP, PR_GET_SECCOMP +.\" +.TH PRCTL 2 2008-07-16 "Linux" "Linux Programmer's Manual" +.SH NAME +prctl \- operations on a process +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int prctl(int " option ", unsigned long " arg2 ", unsigned long " arg3 , +.BI " unsigned long " arg4 ", unsigned long " arg5 ); +.fi +.SH DESCRIPTION +.BR prctl () +is called with a first argument describing what to do +(with values defined in \fI\fP), and further +arguments with a significance depending on the first one. +The first argument can be: +.TP +.BR PR_CAPBSET_READ " (since Linux 2.6.25) +Return (as the function result) 1 if the capability specified in +.I arg2 +is in the calling thread's capability bounding set, +or 0 if it is not. +(The capability constants are defined in +.IR .) +The capability bounding set dictates +whether the process can receive the capability through a +file's permitted capability set on a subsequent call to +.BR execve (2). + +If the capability specified in +.I arg2 +is not valid, then the call fails with the error +.BR EINVAL . +.TP +.BR PR_CAPBSET_DROP " (since Linux 2.6.25)" +If the calling thread has the +.B CAP_SETPCAP +capability, then drop the capability specified by +.I arg2 +from the calling thread's capability bounding set. +Any children of the calling thread will inherit the newly +reduced bounding set. + +The call fails with the error: +.B EPERM +if the calling thread does not have the +.BR CAP_SETPCAP ; +.BR EINVAL +if +.I arg2 +does not represent a valid capability; or +.BR EINVAL +if file capabilities are not enabled in the kernel, +in which case bounding sets are not supported. +.TP +.BR PR_SET_DUMPABLE " (since Linux 2.3.20)" +Set the state of the flag determining whether core dumps are produced +for this process upon delivery of a signal whose default behavior is +to produce a core dump. +(Normally this flag is set for a process by default, but it is cleared +when a set-user-ID or set-group-ID program is executed and also by +various system calls that manipulate process UIDs and GIDs). +In kernels up to and including 2.6.12, +.I arg2 +must be either 0 (process is not dumpable) or 1 (process is dumpable). +Between kernels 2.6.13 and 2.6.17, the value 2 was also permitted, +which caused any binary which normally would not be dumped +to be dumped readable by root only; +for security reasons, this feature has been removed. +.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=115270289030630&w=2 +.\" Subject: Fix prctl privilege escalation (CVE-2006-2451) +.\" From: Marcel Holtmann +.\" Date: 2006-07-12 11:12:00 +(See also the description of +.I /proc/sys/fs/suid_dumpable +in +.BR proc (5).) +.TP +.BR PR_GET_DUMPABLE " (since Linux 2.3.20)" +Return (as the function result) the current state of the calling +process's dumpable flag. +.\" Since Linux 2.6.13, the dumpable flag can have the value 2, +.\" but in 2.6.13 PR_GET_DUMPABLE simply returns 1 if the dumpable +.\" flags has a nonzero value. This was fixed in 2.6.14. +.TP +.BR PR_SET_ENDIAN " (since Linux 2.6.18, PowerPC only)" +Set the endian-ness of the calling process to the value given +in \fIarg2\fP, which should be one of the following: +.\" Respectively 0, 1, 2 +.BR PR_ENDIAN_BIG , +.BR PR_ENDIAN_LITTLE , +or +.B PR_ENDIAN_PPC_LITTLE +(PowerPC pseudo little endian). +.TP +.BR PR_GET_ENDIAN " (since Linux 2.6.18, PowerPC only)" +Return the endian-ness of the calling process, +in the location pointed to by +.IR "(int\ *) arg2" . +.TP +.BR PR_SET_FPEMU " (since Linux 2.4.18, 2.5.9, only on ia64)" +Set floating-point emulation control bits to \fIarg2\fP. +Pass \fBPR_FPEMU_NOPRINT\fP to silently emulate fp operations accesses, or +\fBPR_FPEMU_SIGFPE\fP to not emulate fp operations and send +.B SIGFPE +instead. +.TP +.BR PR_GET_FPEMU " (since Linux 2.4.18, 2.5.9, only on ia64)" +Return floating-point emulation control bits, +in the location pointed to by +.IR "(int\ *) arg2" . +.TP +.BR PR_SET_FPEXC " (since Linux 2.4.21, 2.5.32, only on PowerPC)" +Set floating-point exception mode to \fIarg2\fP. +Pass \fBPR_FP_EXC_SW_ENABLE\fP to use FPEXC for FP exception enables, +\fBPR_FP_EXC_DIV\fP for floating-point divide by zero, +\fBPR_FP_EXC_OVF\fP for floating-point overflow, +\fBPR_FP_EXC_UND\fP for floating-point underflow, +\fBPR_FP_EXC_RES\fP for floating-point inexact result, +\fBPR_FP_EXC_INV\fP for floating-point invalid operation, +\fBPR_FP_EXC_DISABLED\fP for FP exceptions disabled, +\fBPR_FP_EXC_NONRECOV\fP for async nonrecoverable exception mode, +\fBPR_FP_EXC_ASYNC\fP for async recoverable exception mode, +\fBPR_FP_EXC_PRECISE\fP for precise exception mode. +.TP +.BR PR_GET_FPEXC " (since Linux 2.4.21, 2.5.32, only on PowerPC)" +Return floating-point exception mode, +in the location pointed to by +.IR "(int\ *) arg2" . +.TP +.BR PR_SET_KEEPCAPS " (since Linux 2.2.18)" +Set the state of the thread's "keep capabilities" flag, +which determines whether the threads's effective and permitted +capability sets are cleared when a change is made to the threads's user IDs +such that the threads's real UID, effective UID, and saved set-user-ID +all become nonzero when at least one of them previously had the value 0. +(By default, these credential sets are cleared). +.I arg2 +must be either 0 (capabilities are cleared) or 1 (capabilities are kept). +This value will be reset to 0 on subsequent calls to +.BR execve (2). +.TP +.BR PR_GET_KEEPCAPS " (since Linux 2.2.18)" +Return (as the function result) the current state of the calling threads's +"keep capabilities" flag. +.TP +.BR PR_SET_NAME " (since Linux 2.6.9)" +Set the process name for the calling process, +using the value in the location pointed to by +.IR "(char\ *) arg2" . +The name can be up to 16 bytes long, +.\" TASK_COMM_LEN in include/linux/sched.h +and should be null-terminated if it contains fewer bytes. +.TP +.BR PR_GET_NAME " (since Linux 2.6.11)" +Return the process name for the calling process, +in the buffer pointed to by +.IR "(char\ *) arg2" . +The buffer should allow space for up to 16 bytes; +the returned string will be null-terminated if it is shorter than that. +.TP +.BR PR_SET_PDEATHSIG " (since Linux 2.1.57)" +Set the parent process death signal +of the calling process to \fIarg2\fP (either a signal value +in the range 1..maxsig, or 0 to clear). +This is the signal that the calling process will get when its +parent dies. +This value is cleared for the child of a +.BR fork (2). +.TP +.BR PR_GET_PDEATHSIG " (since Linux 2.3.15)" +Return the current value of the parent process death signal, +in the location pointed to by +.IR "(int\ *) arg2" . +.TP +.BR PR_SET_SECCOMP " (since Linux 2.6.23)" +.\" See http://thread.gmane.org/gmane.linux.kernel/542632 +.\" [PATCH 0 of 2] seccomp updates +.\" andrea@cpushare.com +Set the secure computing mode for the calling thread. +In the current implementation, +.IR arg2 +must be 1. +After the secure computing mode has been set to 1, +the only system calls that the thread is permitted to make are +.BR read (2), +.BR write (2), +.BR _exit (2), +and +.BR sigreturn (2). +Other system calls result in the delivery of a +.BR SIGKILL +signal. +Secure computing mode is useful for number-crunching applications +that may need to execute untrusted byte code, +perhaps obtained by reading from a pipe or socket. +This operation is only available +if the kernel is configured with CONFIG_SECCOMP enabled. +.TP +.BR PR_GET_SECCOMP " (since Linux 2.6.23)" +Return the secure computing mode of the calling thread. +Not very useful for the current implementation (mode equals 1), +but may be useful for other possible future modes: +if the caller is not in secure computing mode, this operation returns 0; +if the caller is in secure computing mode, then the +.BR prctl () +call will cause a +.B SIGKILL +signal to be sent to the process. +This operation is only available +if the kernel is configured with CONFIG_SECCOMP enabled. +.TP +.BR PR_SET_SECUREBITS " (since Linux 2.6.26)" +Set the "securebits" flags of the calling thread to the value supplied in +.IR arg2 . +See +.BR capabilities (7). +.TP +.BR PR_GET_SECUREBITS " (since Linux 2.6.26)" +Return (as the function result) +the "securebits" flags of the calling thread. +See +.BR capabilities (7). +.TP +.BR PR_SET_TIMING " (since Linux 2.6.0-test4)" +Set whether to use (normal, traditional) statistical process timing or +accurate timestamp based process timing, by passing +.B PR_TIMING_STATISTICAL +.\" 0 +or +.B PR_TIMING_TIMESTAMP +.\" 1 +to \fIarg2\fP. +.B PR_TIMING_TIMESTAMP +is not currently implemented +(attempting to set this mode will yield the error +.BR EINVAL ). +.\" PR_TIMING_TIMESTAMP doesn't do anything in 2.6.26-rc8, +.\" and looking at the patch history, it appears +.\" that it never did anything. +.TP +.BR PR_GET_TIMING " (since Linux 2.6.0-test4)" +Return (as the function result) which process timing method is currently +in use. +.TP +.BR PR_SET_TSC " (since Linux 2.6.26, x86 only)" +Set the state of the flag determining whether the timestamp counter +can be read by the process. +Pass +.B PR_TSC_ENABLE +to +.I arg2 +to allow it to be read, or +.B PR_TSC_SIGSEGV +to generate a +.B SIGSEGV +when the process tries to read the timestamp counter. +.TP +.BR PR_GET_TSC " (since Linux 2.6.26, x86 only)" +Return the state of the flag determining whether the timestamp counter +can be read, +in the location pointed to by +.IR "(int\ *) arg2" . +.TP +.B PR_SET_UNALIGN +(Only on: ia64, since Linux 2.3.48; parisc, since Linux 2.6.15; +PowerPC, since Linux 2.6.18; Alpha, since Linux 2.6.22) +Set unaligned access control bits to \fIarg2\fP. +Pass +\fBPR_UNALIGN_NOPRINT\fP to silently fix up unaligned user accesses, +or \fBPR_UNALIGN_SIGBUS\fP to generate +.B SIGBUS +on unaligned user access. +.TP +.B PR_GET_UNALIGN +(see +.B PR_SET_UNALIGN +for information on versions and architectures) +Return unaligned access control bits, in the location pointed to by +.IR "(int\ *) arg2" . +.SH "RETURN VALUE" +On success, +.BR PR_GET_DUMPABLE , +.BR PR_GET_KEEPCAPS , +.BR PR_CAPBSET_READ , +.BR PR_GET_TIMING , +.BR PR_GET_SECUREBITS , +and (if it returns) +.BR PR_GET_SECCOMP +return the nonnegative values described above. +All other +.I option +values return 0 on success. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +.I arg2 +is an invalid address. +.TP +.B EINVAL +The value of +.I option +is not recognized. +.TP +.B EINVAL +.I arg2 +is not valid value for this +.IR option . +.TP +.B EINVAL +.I option +is +.BR PR_SET_SECCOMP +or +.BR PR_SET_SECCOMP , +and the kernel was not configured with +.BR CONFIG_SECCOMP . +.TP +.B EPERM +.I option +is +.BR PR_SET_SECUREBITS , +and the caller does not have the +.B CAP_SETPCAP +capability, +or tried to unset a "locked" flag, +or tried to set a flag whose corresponding locked flag was set +(see +.BR capabilities (7)). +.TP +.B EPERM +.I option +is +.BR PR_SET_KEEPCAPS , +and the callers's +.B SECURE_KEEP_CAPS_LOCKED +flag is set +(see +.BR capabilities (7)). +.TP +.B EPERM +.I option +is +.BR PR_CAPBSET_DROP , +and the caller does not have the +.B CAP_SETPCAP +capability. +.\" The following can't actually happen, because prctl() in +.\" seccomp mode will cause SIGKILL. +.\" .TP +.\" .B EPERM +.\" .I option +.\" is +.\" .BR PR_SET_SECCOMP , +.\" and secure computing mode is already 1. +.SH VERSIONS +The +.BR prctl () +system call was introduced in Linux 2.1.57. +.\" The library interface was added in glibc 2.0.6 +.SH "CONFORMING TO" +This call is Linux-specific. +IRIX has a +.BR prctl () +system call (also introduced in Linux 2.1.44 +as irix_prctl on the MIPS architecture), +with prototype +.sp +.BI "ptrdiff_t prctl(int " option ", int " arg2 ", int " arg3 ); +.sp +and options to get the maximum number of processes per user, +get the maximum number of processors the calling process can use, +find out whether a specified process is currently blocked, +get or set the maximum stack size, etc. +.SH "SEE ALSO" +.BR signal (2), +.BR core (5) diff --git a/original/man2/pread.2 b/original/man2/pread.2 new file mode 100644 index 00000000..80a01149 --- /dev/null +++ b/original/man2/pread.2 @@ -0,0 +1,104 @@ +.\" 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. +.\" +.TH PREAD 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH NAME +pread, pwrite \- read from or write to a file descriptor at a given offset +.SH SYNOPSIS +.B #define _XOPEN_SOURCE 500 +.sp +.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 ); +.SH DESCRIPTION +.BR pread () +reads up to +.I count +bytes from file descriptor +.I fd +at offset +.I offset +(from the start of the file) into the buffer starting at +.IR buf . +The file offset is not changed. +.PP +.BR pwrite () +writes up to +.I count +bytes from the buffer starting at +.I buf +to the file descriptor +.I fd +at offset +.IR offset . +The file offset is not changed. +.PP +The file referenced by +.I fd +must be capable of seeking. +.SH "RETURN VALUE" +On success, the number of bytes read or written is returned (zero +indicates that nothing was written, in the case of +.BR pwrite (), +or +end of file, in the case of +.BR pread (), +or \-1 on error, in which case +.I errno +is set to indicate the error. +.SH ERRORS +.BR pread () +can fail and set +.I errno +to any error specified for +.BR read (2) +or +.BR lseek (2). +.BR pwrite () +can fail and set +.I errno +to any error specified for +.BR write (2) +or +.BR lseek (2). +.SH VERSIONS +The +.BR pread () +and +.BR pwrite () +system calls were added to Linux in +version 2.1.60; the entries in the i386 system call table were added +in 2.1.69. +C library support (including emulation using +.BR lseek (2) +on older kernels without the system calls) was added in glibc 2.1. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH "SEE ALSO" +.BR lseek (2), +.BR read (2), +.BR write (2), +.BR feature_test_macros (7) diff --git a/original/man2/pread64.2 b/original/man2/pread64.2 new file mode 100644 index 00000000..87eacb23 --- /dev/null +++ b/original/man2/pread64.2 @@ -0,0 +1 @@ +.so man2/pread.2 diff --git a/original/man2/prof.2 b/original/man2/prof.2 new file mode 100644 index 00000000..5d25ea6c --- /dev/null +++ b/original/man2/prof.2 @@ -0,0 +1 @@ +.so man2/unimplemented.2 diff --git a/original/man2/pselect.2 b/original/man2/pselect.2 new file mode 100644 index 00000000..e1778431 --- /dev/null +++ b/original/man2/pselect.2 @@ -0,0 +1 @@ +.so man2/select.2 diff --git a/original/man2/pselect6.2 b/original/man2/pselect6.2 new file mode 100644 index 00000000..e1778431 --- /dev/null +++ b/original/man2/pselect6.2 @@ -0,0 +1 @@ +.so man2/select.2 diff --git a/original/man2/ptrace.2 b/original/man2/ptrace.2 new file mode 100644 index 00000000..4d41e455 --- /dev/null +++ b/original/man2/ptrace.2 @@ -0,0 +1,536 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" changes Copyright 1999 Mike Coleman (mkc@acm.org) +.\" -- major revision to fully document ptrace semantics per recent Linux +.\" kernel (2.2.10) and glibc (2.1.2) +.\" Sun Nov 7 03:18:35 CST 1999 +.\" +.\" 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 Fri Jul 23 23:47:18 1993 by Rik Faith +.\" Modified Fri Jan 31 16:46:30 1997 by Eric S. Raymond +.\" Modified Thu Oct 7 17:28:49 1999 by Andries Brouwer +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" 2006-03-24, Chuck Ebbert <76306.1226@compuserve.com> +.\" Added PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, +.\" PTRACE_SETSIGINFO, PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP +.\" (Thanks to Blaisorblade, Daniel Jacobowitz and others who helped.) +.\" +.TH PTRACE 2 2009-03-30 "Linux" "Linux Programmer's Manual" +.SH NAME +ptrace \- process trace +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "long ptrace(enum __ptrace_request " request ", pid_t " pid ", " +.BI " void *" addr ", void *" data ); +.fi +.SH DESCRIPTION +The +.BR ptrace () +system call provides a means by which a parent process may observe +and control the execution of another process, +and examine and change its core image and registers. +It is primarily used to implement breakpoint debugging and system +call tracing. +.LP +The parent can initiate a trace by calling +.BR fork (2) +and having the resulting child do a +.BR PTRACE_TRACEME , +followed (typically) by an +.BR exec (3). +Alternatively, the parent may commence trace of an existing process using +.BR PTRACE_ATTACH . +.LP +While being traced, the child will stop each time a signal is delivered, +even if the signal is being ignored. +(The exception is +.BR SIGKILL , +which has its usual effect.) +The parent will be notified at its next +.BR wait (2) +and may inspect and modify the child process while it is stopped. +The parent then causes the child to continue, +optionally ignoring the delivered signal +(or even delivering a different signal instead). +.LP +When the parent is finished tracing, it can terminate the child with +.B PTRACE_KILL +or cause it to continue executing in a normal, untraced mode +via +.BR PTRACE_DETACH . +.LP +The value of \fIrequest\fP determines the action to be performed: +.TP +.B PTRACE_TRACEME +Indicates that this process is to be traced by its parent. +Any signal +(except +.BR SIGKILL ) +delivered to this process will cause it to stop and its +parent to be notified via +.BR wait (2). +Also, all subsequent calls to +.BR execve (2) +by this process will cause a +.B SIGTRAP +to be sent to it, +giving the parent a chance to gain control before the new program +begins execution. +A process probably shouldn't make this request if its parent +isn't expecting to trace it. +(\fIpid\fP, \fIaddr\fP, and \fIdata\fP are ignored.) +.LP +The above request is used only by the child process; +the rest are used only by the parent. +In the following requests, \fIpid\fP specifies the child process +to be acted on. +For requests other than +.BR PTRACE_KILL , +the child process must +be stopped. +.TP +.BR PTRACE_PEEKTEXT ", " PTRACE_PEEKDATA +Reads a word at the location +.I addr +in the child's memory, returning the word as the result of the +.BR ptrace () +call. +Linux does not have separate text and data address spaces, so the two +requests are currently equivalent. +(The argument \fIdata\fP is ignored.) +.TP +.B PTRACE_PEEKUSER +.\" PTRACE_PEEKUSR in kernel source, but glibc uses PTRACE_PEEKUSER, +.\" and that is the name that seems common on other systems. +Reads a word at offset +.I addr +in the child's USER area, +which holds the registers and other information about the process +(see \fI\fP). +The word is returned as the result of the +.BR ptrace () +call. +Typically the offset must be word-aligned, though this might vary by +architecture. +See NOTES. +(\fIdata\fP is ignored.) +.TP +.BR PTRACE_POKETEXT ", " PTRACE_POKEDATA +Copies the word +.I data +to location +.I addr +in the child's memory. +As above, the two requests are currently equivalent. +.TP +.B PTRACE_POKEUSER +.\" PTRACE_POKEUSR in kernel source, but glibc uses PTRACE_POKEUSER, +.\" and that is the name that seems common on other systems. +Copies the word +.I data +to offset +.I addr +in the child's USER area. +As above, the offset must typically be word-aligned. +In order to maintain the integrity of the kernel, +some modifications to the USER area are disallowed. +.TP +.BR PTRACE_GETREGS ", " PTRACE_GETFPREGS +Copies the child's general purpose or floating-point registers, +respectively, to location \fIdata\fP in the parent. +See \fI\fP for information on +the format of this data. +(\fIaddr\fP is ignored.) +.TP +.BR PTRACE_GETSIGINFO " (since Linux 2.3.99-pre6)" +Retrieve information about the signal that caused the stop. +Copies a \fIsiginfo_t\fP structure (see +.BR sigaction (2)) +from the child to location \fIdata\fP in the parent. +(\fIaddr\fP is ignored.) +.TP +.BR PTRACE_SETREGS ", " PTRACE_SETFPREGS +Copies the child's general purpose or floating-point registers, +respectively, from location \fIdata\fP in the parent. +As for +.BR PTRACE_POKEUSER , +some general +purpose register modifications may be disallowed. +(\fIaddr\fP is ignored.) +.TP +.BR PTRACE_SETSIGINFO " (since Linux 2.3.99-pre6)" +Set signal information. +Copies a \fIsiginfo_t\fP structure from location \fIdata\fP in the +parent to the child. +This will only affect signals that would normally be delivered to +the child and were caught by the tracer. +It may be difficult to tell +these normal signals from synthetic signals generated by +.BR ptrace () +itself. +(\fIaddr\fP is ignored.) +.TP +.BR PTRACE_SETOPTIONS " (since Linux 2.4.6; see BUGS for caveats)" +Sets ptrace options from \fIdata\fP in the parent. +(\fIaddr\fP is ignored.) +\fIdata\fP is interpreted +as a bit mask of options, which are specified by the following flags: +.RS +.TP +.BR PTRACE_O_TRACESYSGOOD " (since Linux 2.4.6)" +When delivering syscall traps, set bit 7 in the signal number +(i.e., deliver \fI(SIGTRAP | 0x80)\fP +This makes it easy for the tracer to tell the difference +between normal traps and those caused by a syscall. +.RB ( PTRACE_O_TRACESYSGOOD +may not work on all architectures.) +.TP +.BR PTRACE_O_TRACEFORK " (since Linux 2.5.46)" +Stop the child at the next +.BR fork (2) +call with \fISIGTRAP | PTRACE_EVENT_FORK\ <<\ 8\fP and automatically +start tracing the newly forked process, +which will start with a +.BR SIGSTOP . +The PID for the new process can be retrieved with +.BR PTRACE_GETEVENTMSG . +.TP +.BR PTRACE_O_TRACEVFORK " (since Linux 2.5.46)" +Stop the child at the next +.BR vfork (2) +call with \fISIGTRAP | PTRACE_EVENT_VFORK\ <<\ 8\fP and automatically start +tracing the newly vforked process, which will start with a +.BR SIGSTOP . +The PID for the new process can be retrieved with +.BR PTRACE_GETEVENTMSG . +.TP +.BR PTRACE_O_TRACECLONE " (since Linux 2.5.46)" +Stop the child at the next +.BR clone (2) +call with \fISIGTRAP | PTRACE_EVENT_CLONE\ <<\ 8\fP and automatically start +tracing the newly cloned process, which will start with a +.BR SIGSTOP . +The PID for the new process can be retrieved with +.BR PTRACE_GETEVENTMSG . +This option may not catch +.BR clone (2) +calls in all cases. +If the child calls +.BR clone (2) +with the +.B CLONE_VFORK +flag, +.B PTRACE_EVENT_VFORK +will be delivered instead +if +.B PTRACE_O_TRACEVFORK +is set; otherwise if the child calls +.BR clone (2) +with the exit signal set to +.BR SIGCHLD , +.B PTRACE_EVENT_FORK +will be delivered +if +.B PTRACE_O_TRACEFORK +is set. +.TP +.BR PTRACE_O_TRACEEXEC " (since Linux 2.5.46)" +Stop the child at the next +.BR execve (2) +call with \fISIGTRAP | PTRACE_EVENT_EXEC\ <<\ 8\fP. +.TP +.BR PTRACE_O_TRACEVFORKDONE " (since Linux 2.5.60)" +Stop the child at the completion of the next +.BR vfork (2) +call with \fISIGTRAP | PTRACE_EVENT_VFORK_DONE\ <<\ 8\fP. +.TP +.BR PTRACE_O_TRACEEXIT " (since Linux 2.5.60)" +Stop the child at exit with \fISIGTRAP | PTRACE_EVENT_EXIT\ <<\ 8\fP. +The child's exit status can be retrieved with +.BR PTRACE_GETEVENTMSG . +This stop will be done early during process exit when registers +are still available, allowing the tracer to see where the exit occurred, +whereas the normal exit notification is done after the process +is finished exiting. +Even though context is available, the tracer cannot prevent the exit from +happening at this point. +.RE +.TP +.BR PTRACE_GETEVENTMSG " (since Linux 2.5.46)" +Retrieve a message (as an +.IR "unsigned long" ) +about the ptrace event +that just happened, placing it in the location \fIdata\fP in the parent. +For +.B PTRACE_EVENT_EXIT +this is the child's exit status. +For +.BR PTRACE_EVENT_FORK , +.B PTRACE_EVENT_VFORK +and +.B PTRACE_EVENT_CLONE +this +is the PID of the new process. +Since Linux 2.6.18, the PID of the new process is also available +for +.BR PTRACE_EVENT_VFORK_DONE . +(\fIaddr\fP is ignored.) +.TP +.B PTRACE_CONT +Restarts the stopped child process. +If \fIdata\fP is nonzero and not +.BR SIGSTOP , +it is interpreted as a signal to be delivered to the child; +otherwise, no signal is delivered. +Thus, for example, the parent can control +whether a signal sent to the child is delivered or not. +(\fIaddr\fP is ignored.) +.TP +.BR PTRACE_SYSCALL ", " PTRACE_SINGLESTEP +Restarts the stopped child as for +.BR PTRACE_CONT , +but arranges for +the child to be stopped at the next entry to or exit from a system call, +or after execution of a single instruction, respectively. +(The child will also, as usual, be stopped upon receipt of a signal.) +From the parent's perspective, the child will appear to have been +stopped by receipt of a +.BR SIGTRAP . +So, for +.BR PTRACE_SYSCALL , +for example, the idea is to inspect +the arguments to the system call at the first stop, +then do another +.B PTRACE_SYSCALL +and inspect the return value of +the system call at the second stop. +The +.I data +argument is treated as for +.BR PTRACE_CONT . +(\fIaddr\fP is ignored.) +.TP +.BR PTRACE_SYSEMU ", " PTRACE_SYSEMU_SINGLESTEP " (since Linux 2.6.14)" +For +.BR PTRACE_SYSEMU , +continue and stop on entry to the next syscall, +which will not be executed. +For +.BR PTRACE_SYSEMU_SINGLESTEP , +do the same +but also singlestep if not a syscall. +This call is used by programs like +User Mode Linux that want to emulate all the child's system calls. +The +.I data +argument is treated as for +.BR PTRACE_CONT . +(\fIaddr\fP is ignored; +not supported on all architectures.) +.TP +.B PTRACE_KILL +Sends the child a +.B SIGKILL +to terminate it. +(\fIaddr\fP and \fIdata\fP are ignored.) +.TP +.B PTRACE_ATTACH +Attaches to the process specified in +.IR pid , +making it a traced "child" of the calling process; +the behavior of the child is as if it had done a +.BR PTRACE_TRACEME . +The calling process actually becomes the parent of the child +process for most purposes (e.g., it will receive +notification of child events and appears in +.BR ps (1) +output as the child's parent), but a +.BR getppid (2) +by the child will still return the PID of the original parent. +The child is sent a +.BR SIGSTOP , +but will not necessarily have stopped +by the completion of this call; use +.BR wait (2) +to wait for the child to stop. +(\fIaddr\fP and \fIdata\fP are ignored.) +.TP +.B PTRACE_DETACH +Restarts the stopped child as for +.BR PTRACE_CONT , +but first detaches +from the process, undoing the reparenting effect of +.BR PTRACE_ATTACH , +and the effects of +.BR PTRACE_TRACEME . +Although perhaps not intended, under Linux a traced child can be +detached in this way regardless of which method was used to initiate +tracing. +(\fIaddr\fP is ignored.) +.SH "RETURN VALUE" +On success, +.B PTRACE_PEEK* +requests return the requested data, +while other requests return zero. +On error, all requests return \-1, and +.I errno +is set appropriately. +Since the value returned by a successful +.B PTRACE_PEEK* +request may be \-1, the caller must check +.I errno +after such requests to determine whether or not an error occurred. +.SH ERRORS +.TP +.B EBUSY +(i386 only) There was an error with allocating or freeing a debug +register. +.TP +.B EFAULT +There was an attempt to read from or write to an invalid area in +the parent's or child's memory, +probably because the area wasn't mapped or accessible. +Unfortunately, under Linux, different variations of this fault +will return +.B EIO +or +.B EFAULT +more or less arbitrarily. +.TP +.B EINVAL +An attempt was made to set an invalid option. +.TP +.B EIO +\fIrequest\fP is invalid, or an attempt was made to read from or +write to an invalid area in the parent's or child's memory, +or there was a word-alignment violation, +or an invalid signal was specified during a restart request. +.TP +.B EPERM +The specified process cannot be traced. +This could be because the +parent has insufficient privileges (the required capability is +.BR CAP_SYS_PTRACE ); +unprivileged processes cannot trace processes that they +cannot send signals to or those running +set-user-ID/set-group-ID programs, for obvious reasons. +Alternatively, the process may already be being traced, or be +.BR init (8) +(PID 1). +.TP +.B ESRCH +The specified process does not exist, or is not currently being traced +by the caller, or is not stopped (for requests that require that). +.SH "CONFORMING TO" +SVr4, 4.3BSD. +.SH NOTES +Although arguments to +.BR ptrace () +are interpreted according to the prototype given, +glibc currently declares +.BR ptrace () +as a variadic function with only the \fIrequest\fP argument fixed. +This means that unneeded trailing arguments may be omitted, +though doing so makes use of undocumented +.BR gcc (1) +behavior. +.LP +.BR init (8), +the process with PID 1, may not be traced. +.LP +The layout of the contents of memory and the USER area are quite OS- and +architecture-specific. +The offset supplied, and the data returned, +might not entirely match with the definition of +.IR "struct user" . +.\" See http://lkml.org/lkml/2008/5/8/375 +.LP +The size of a "word" is determined by the OS variant +(e.g., for 32-bit Linux it is 32 bits, etc.). +.LP +Tracing causes a few subtle differences in the semantics of +traced processes. +For example, if a process is attached to with +.BR PTRACE_ATTACH , +its original parent can no longer receive notification via +.BR wait (2) +when it stops, and there is no way for the new parent to +effectively simulate this notification. +.LP +When the parent receives an event with +.B PTRACE_EVENT_* +set, +the child is not in the normal signal delivery path. +This means the parent cannot do +.BR ptrace (PTRACE_CONT) +with a signal or +.BR ptrace (PTRACE_KILL). +.BR kill (2) +with a +.B SIGKILL +signal can be used instead to kill the child process +after receiving one of these messages. +.LP +This page documents the way the +.BR ptrace () +call works currently in Linux. +Its behavior differs noticeably on other flavors of Unix. +In any case, use of +.BR ptrace () +is highly OS- and architecture-specific. +.LP +The SunOS man page describes +.BR ptrace () +as "unique and arcane", which it is. +The proc-based debugging interface +present in Solaris 2 implements a superset of +.BR ptrace () +functionality in a more powerful and uniform way. +.SH BUGS +On hosts with 2.6 kernel headers, +.B PTRACE_SETOPTIONS +is declared +with a different value than the one for 2.4. +This leads to applications compiled with such +headers failing when run on 2.4 kernels. +This can be worked around by redefining +.B PTRACE_SETOPTIONS +to +.BR PTRACE_OLDSETOPTIONS , +if that is defined. +.SH "SEE ALSO" +.BR gdb (1), +.BR strace (1), +.BR execve (2), +.BR fork (2), +.BR signal (2), +.BR wait (2), +.BR exec (3), +.BR capabilities (7) diff --git a/original/man2/putpmsg.2 b/original/man2/putpmsg.2 new file mode 100644 index 00000000..5d25ea6c --- /dev/null +++ b/original/man2/putpmsg.2 @@ -0,0 +1 @@ +.so man2/unimplemented.2 diff --git a/original/man2/pwrite.2 b/original/man2/pwrite.2 new file mode 100644 index 00000000..87eacb23 --- /dev/null +++ b/original/man2/pwrite.2 @@ -0,0 +1 @@ +.so man2/pread.2 diff --git a/original/man2/pwrite64.2 b/original/man2/pwrite64.2 new file mode 100644 index 00000000..9290e0a5 --- /dev/null +++ b/original/man2/pwrite64.2 @@ -0,0 +1 @@ +.so man2/pwrite.2 diff --git a/original/man2/query_module.2 b/original/man2/query_module.2 new file mode 100644 index 00000000..bd3034c0 --- /dev/null +++ b/original/man2/query_module.2 @@ -0,0 +1,177 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.TH QUERY_MODULE 2 2007-06-03 "Linux" "Linux Programmer's Manual" +.SH NAME +query_module \- query the kernel for various bits pertaining to modules +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int query_module(const char *" name ", int " which ", void *" buf , +.BI " size_t " bufsize ", size_t *" ret ); +.fi +.SH DESCRIPTION +.BR query_module () +requests information from the kernel about loadable modules. +The returned information is placed in the buffer pointed to by +.IR buf . +The caller must specify the size of +.I buf +in +.IR bufsize . +The precise nature and format of the returned information +depend on the operation specified by +.IR which . +Some operations require +.I name +to identify a currently loaded module, some allow +.I name +to be NULL, indicating the kernel proper. + +The following values can be specified for +.IR which : +.TP +.B 0 +Returns success, if the kernel supports +.BR query_module (). +Used to probe for availability of the system call. +.TP +.B QM_MODULES +Returns the names of all loaded modules. +The returned buffer consists of a sequence of null-terminated strings; +.I ret +is set to the number of +modules. +.\" ret is set on ENOSPC +.TP +.B QM_DEPS +Returns the names of all modules used by the indicated module. +The returned buffer consists of a sequence of null-terminated strings; +.I ret +is set to the number of modules. +.\" ret is set on ENOSPC +.TP +.B QM_REFS +Returns the names of all modules using the indicated module. +This is the inverse of +.BR QM_DEPS . +The returned buffer consists of a sequence of null-terminated strings; +.I ret +is set to the number of modules. +.\" ret is set on ENOSPC +.TP +.B QM_SYMBOLS +Returns the symbols and values exported by the kernel or the indicated +module. +The returned buffer is an array of structures of the following form +.\" ret is set on ENOSPC +.in +4n +.nf + +struct module_symbol { + unsigned long value; + unsigned long name; +}; +.fi +.in +.IP +followed by null-terminated strings. +The value of +.I name +is the character offset of the string relative to the start of +.IR buf ; +.I ret +is set to the number of symbols. +.TP +.B QM_INFO +Returns miscellaneous information about the indicated module. +The output buffer format is: +.in +4n +.nf + +struct module_info { + unsigned long address; + unsigned long size; + unsigned long flags; +}; +.fi +.in +.IP +where +.I address +is the kernel address at which the module resides, +.I size +is the size of the module in bytes, and +.I flags +is a mask of +.BR MOD_RUNNING , +.BR MOD_AUTOCLEAN , +etc. that indicates the current status of the module +(see the kernel source file +.IR include/linux/module.h ). +.I ret +is set to the size of the +.I module_info +structure. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +At least one of +.IR name , +.IR buf , +or +.I ret +was outside the program's accessible address space. +.TP +.B EINVAL +Invalid +.IR which ; +or +.I name +is NULL (indicating "the kernel"), +but this is not permitted with the specified value of +.IR which . +.\" Not permitted with QM_DEPS, QM_REFS, or QM_INFO. +.TP +.B ENOENT +No module by that +.I name +exists. +.TP +.B ENOSPC +The buffer size provided was too small. +.I ret +is set to the minimum size needed. +.TP +.B ENOSYS +.BR query_module () +is not supported in this version of the kernel. +.SH "CONFORMING TO" +.BR query_module () +is Linux-specific. +.SH NOTES +This system call is only present on Linux up until kernel 2.4; +it was removed in Linux 2.6. +.\" Removed in Linux 2.5.48 +Some of the information that was available via +.BR query_module () +can be obtained from +.IR /proc/modules , +.IR /proc/kallsyms , +and +.IR /sys/modules . +.SH "SEE ALSO" +.BR create_module (2), +.BR delete_module (2), +.BR get_kernel_syms (2), +.BR init_module (2) diff --git a/original/man2/quotactl.2 b/original/man2/quotactl.2 new file mode 100644 index 00000000..bb4d9cbe --- /dev/null +++ b/original/man2/quotactl.2 @@ -0,0 +1,243 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1996 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. +.\" +.\" FIXME There is much that is missing and/or out of date in this page. +.\" (There is a quotactl.2 page in the quotactl package that seems to +.\" have more info than this page.) +.\" As things stand the page more or less documents Linux 2.2 reality: +.\" +.\" Linux 2.2 has: +.\" +.\" Q_GETQUOTA +.\" Q_GETSTATS +.\" Q_QUOTAOFF +.\" Q_QUOTAON +.\" Q_RSQUASH (not currently documented) +.\" Q_SETQLIM +.\" Q_SETQUOTA +.\" Q_SETUSE +.\" Q_SYNC +.\" +.\" Linux 2.4 has: +.\" +.\" Q_COMP_QUOTAOFF +.\" Q_COMP_QUOTAON +.\" Q_COMP_SYNC +.\" Q_GETFMT +.\" Q_GETINFO +.\" Q_GETQUOTA +.\" Q_QUOTAOFF +.\" Q_QUOTAON +.\" Q_SETINFO +.\" Q_SETQUOTA +.\" Q_SYNC +.\" Q_V1_GETQUOTA Q_V1_GETSTATS Q_V1_RSQUASH Q_V1_SETQLIM +.\" Q_V1_SETQUOTA Q_V1_SETUSE +.\" Q_V2_GETINFO Q_V2_GETQUOTA Q_V2_SETFLAGS Q_V2_SETGRACE +.\" Q_V2_SETINFO Q_V2_SETQUOTA Q_V2_SETUSE +.\" Q_XGETQSTAT Q_XGETQUOTA Q_XQUOTAOFF Q_XQUOTAON Q_XQUOTARM +.\" Q_XSETQLIM +.\" +.\" Linux 2.6.16 has: +.\" +.\" Q_GETFMT +.\" Q_GETINFO +.\" Q_GETQUOTA +.\" Q_QUOTAOFF +.\" Q_QUOTAON +.\" Q_SETINFO +.\" Q_SETQUOTA +.\" Q_SYNC +.\" Q_XGETQSTAT +.\" Q_XGETQUOTA +.\" Q_XQUOTAOFF +.\" Q_XQUOTAON +.\" Q_XQUOTARM +.\" Q_XQUOTASYNC +.\" Q_XSETQLIM +.\" +.TH QUOTACTL 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.SH NAME +quotactl \- manipulate disk quota +.SH SYNOPSIS +.nf +.B #include +.br +.B #include +.sp +.BI "int quotactl(int " cmd ", const char *" special ", int " id \ +", caddr_t " addr ); +.fi +.SH DESCRIPTION +The quota system defines for each user and/or group a soft limit +and a hard limit bounding the amount of disk space that can be +used on a given file system. +The hard limit cannot be crossed. +The soft limit can be crossed, but warnings will ensue. +Moreover, +the user cannot be above the soft limit for more than one week (by default) +at a time: after this week the soft limit counts as hard limit. + +The +.BR quotactl () +system call manipulates these quota. +Its first argument is +of the form +.BI QCMD( subcmd , type ) +where +.I type +is either +.B USRQUOTA +or +.B GRPQUOTA +(for user quota and group quota, respectively), and +.I subcmd +is described below. + +The second argument +.I special +is the block special device these quota apply to. +It must be mounted. + +The third argument +.I id +is the user or group ID these quota apply to (when relevant). + +The fourth argument +.I addr +is the address of a data structure, depending on the command. + +The +.I subcmd +is one of +.TP 1.1i +.B Q_QUOTAON +Enable quota. +The +.I addr +argument is the pathname of the file containing +the quota for the file system. +.TP +.B Q_QUOTAOFF +Disable quota. +.TP +.B Q_GETQUOTA +Get limits and current usage of disk space. +The +.I addr +argument is a pointer to a dqblk structure (defined in +.IR ). +.TP +.B Q_SETQUOTA +Set limits and current usage; +.I addr +is as before. +.TP +.B Q_SETQLIM +Set limits; +.I addr +is as before. +.TP +.B Q_SETUSE +Set usage. +.TP +.B Q_SYNC +Sync disk copy of a file system's quota. +.TP +.B Q_GETSTATS +Get collected stats. +.SH "RETURN VALUE" +On success, +.BR quotactl () +returns 0. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP 0.9i +.B EACCES +The quota file is not an ordinary file. +.TP +.B EBUSY +.B Q_QUOTAON +was asked, but quotas were enabled already. +.TP +.B EFAULT +Bad +.I addr +value. +.TP +.B EINVAL +.I type +is not a known quota type. +Or, +.I special +could not be found. +.TP +.B EIO +Cannot read or write the quota file. +.TP +.B EMFILE +Too many open files: cannot open quota file. +.TP +.B ENODEV +.I special +cannot be found in the mount table. +.TP +.B ENOPKG +The kernel was compiled without quota support. +.TP +.B ENOTBLK +.I special +is not a block special device. +.TP +.B EPERM +The process was not root (for the file system), and +.B Q_GETQUOTA +was asked for another +.I id +than that of the process itself, or anything other than +.B Q_GETSTATS +or +.B Q_SYNC +was asked. +.TP +.B ESRCH +.B Q_GETQUOTA +or +.B Q_SETQUOTA +or +.B Q_SETUSE +or +.B Q_SETQLIM +was asked for a file system that didn't have quota enabled. +.SH "CONFORMING TO" +BSD. +.SH "SEE ALSO" +.BR quota (1), +.BR getrlimit (2), +.BR setrlimit (2), +.BR ulimit (3), +.BR quotacheck (8), +.BR quotaon (8) diff --git a/original/man2/read.2 b/original/man2/read.2 new file mode 100644 index 00000000..c166ef04 --- /dev/null +++ b/original/man2/read.2 @@ -0,0 +1,190 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 Sat Jul 24 00:06:00 1993 by Rik Faith +.\" Modified Wed Jan 17 16:02:32 1996 by Michael Haardt +.\" +.\" Modified Thu Apr 11 19:26:35 1996 by Andries Brouwer +.\" Modified Sun Jul 21 18:59:33 1996 by Andries Brouwer +.\" Modified Fri Jan 31 16:47:33 1997 by Eric S. Raymond +.\" Modified Sat Jul 12 20:45:39 1997 by Michael Haardt +.\" +.\" +.TH READ 2 2009-02-23 "Linux" "Linux Programmer's Manual" +.SH NAME +read \- read from a file descriptor +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "ssize_t read(int " fd ", void *" buf ", size_t " count ); +.fi +.SH DESCRIPTION +.BR read () +attempts to read up to +.I count +bytes from file descriptor +.I fd +into the buffer starting at +.IR buf . +.PP +If +.I count +is zero, +.BR read () +returns zero and has no other results. +If +.I count +is greater than +.BR SSIZE_MAX , +the result is unspecified. +.SH "RETURN VALUE" +On success, the number of bytes read is returned (zero indicates end of +file), and the file position is advanced by this number. +It is not an error if this number is smaller than the number of bytes +requested; this may happen for example because fewer bytes are actually +available right now (maybe because we were close to end-of-file, or +because we are reading from a pipe, or from a terminal), or because +.BR read () +was interrupted by a signal. +On error, \-1 is returned, and +.I errno +is set appropriately. +In this case it is left unspecified whether +the file position (if any) changes. +.SH ERRORS +.TP +.B EAGAIN +The file descriptor +.I fd +refers to a file other than a socket and has been marked nonblocking +.RB ( O_NONBLOCK ), +and the read would block. +.TP +.BR EAGAIN " or " EWOULDBLOCK +.\" Actually EAGAIN on Linux +The file descriptor +.I fd +refers to a socket and has been marked nonblocking +.RB ( O_NONBLOCK ), +and the read would block. +POSIX.1-2001 allows either error to be returned for this case, +and does not require these constants to have the same value, +so a portable application should check for both possibilities. +.TP +.B EBADF +.I fd +is not a valid file descriptor or is not open for reading. +.TP +.B EFAULT +.I buf +is outside your accessible address space. +.TP +.B EINTR +The call was interrupted by a signal before any data was read; see +.BR signal (7). +.TP +.B EINVAL +.I fd +is attached to an object which is unsuitable for reading; +or the file was opened with the +.B O_DIRECT +flag, and either the address specified in +.IR buf , +the value specified in +.IR count , +or the current file offset is not suitably aligned. +.TP +.B EINVAL +.I fd +was created via a call to +.BR timerfd_create (2) +and the wrong size buffer was given to +.BR read (); +see +.BR timerfd_create (2) +for further information. +.TP +.B EIO +I/O error. +This will happen for example when the process is in a +background process group, tries to read from its controlling tty, +and either it is ignoring or blocking +.B SIGTTIN +or its process group +is orphaned. +It may also occur when there is a low-level I/O error +while reading from a disk or tape. +.TP +.B EISDIR +.I fd +refers to a directory. +.PP +Other errors may occur, depending on the object connected to +.IR fd . +POSIX allows a +.BR read () +that is interrupted after reading some data +to return \-1 (with +.I errno +set to +.BR EINTR ) +or to return the number of bytes already read. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH NOTES +On NFS file systems, reading small amounts of data will only update the +timestamp the first time, subsequent calls may not do so. +This is caused +by client side attribute caching, because most if not all NFS clients +leave st_atime (last file access time) +updates to the server and client side reads satisfied from the +client's cache will not cause st_atime updates on the server as there are no +server side reads. +Unix semantics can be obtained by disabling client +side attribute caching, but in most situations this will substantially +increase server load and decrease performance. +.PP +Many file systems and disks were considered to be fast enough that the +implementation of +.B O_NONBLOCK +was deemed unnecessary. +So, +.B O_NONBLOCK +may not be available on files +and/or disks. +.SH "SEE ALSO" +.BR close (2), +.BR fcntl (2), +.BR ioctl (2), +.BR lseek (2), +.BR open (2), +.BR pread (2), +.BR readdir (2), +.BR readlink (2), +.BR readv (2), +.BR select (2), +.BR write (2), +.BR fread (3) diff --git a/original/man2/readahead.2 b/original/man2/readahead.2 new file mode 100644 index 00000000..886b22ac --- /dev/null +++ b/original/man2/readahead.2 @@ -0,0 +1,97 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 2004, 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. +.\" +.\" 2004-05-40 Created by Michael Kerrisk +.\" 2004-10-05 aeb, minor correction +.\" +.TH READAHEAD 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +readahead \- perform file readahead into page cache +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "ssize_t readahead(int " fd ", off64_t " offset ", size_t " count ); +.fi +.SH DESCRIPTION +.BR readahead () +populates the page cache with data from a file so that subsequent +reads from that file will not block on disk I/O. +The +.I fd +argument is a file descriptor identifying the file which is +to be read. +The +.I offset +argument specifies the starting point from which data is to be read +and +.I count +specifies the number of bytes to be read. +I/O is performed in whole pages, so that +.I offset +is effectively rounded down to a page boundary +and bytes are read up to the next page boundary greater than or +equal to +.IR "(offset+count)" . +.BR readahead () +does not read beyond the end of the file. +.BR readahead () +blocks until the specified data has been read. +The current file offset of the open file referred to by +.I fd +is left unchanged. +.SH "RETURN VALUE" +On success, +.BR readahead () +returns 0; on failure, \-1 is returned, with +.I errno +set to indicate the cause of the error. +.SH ERRORS +.TP +.B EBADF +.I fd +is not a valid file descriptor or is not open for reading. +.TP +.B EINVAL +.I fd +does not refer to a file type to which +.BR readahead () +can be applied. +.SH VERSIONS +The +.BR readahead () +system call appeared in Linux 2.4.13; +glibc support has been provided since version 2.3. +.SH "CONFORMING TO" +The +.BR readahead () +system call is Linux-specific, and its use should be avoided +in portable applications. +.SH "SEE ALSO" +.BR lseek (2), +.BR madvise (2), +.BR mmap (2), +.BR posix_fadvise (2), +.BR read (2) diff --git a/original/man2/readdir.2 b/original/man2/readdir.2 new file mode 100644 index 00000000..4d4ae605 --- /dev/null +++ b/original/man2/readdir.2 @@ -0,0 +1,119 @@ +.\" 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 : +.\" In 1.3.X, returns only one entry each time; return value is different. +.\" Modified 2004-12-01, mtk, fixed headers listed in SYNOPSIS +.\" +.TH READDIR 2 2008-10-02 "Linux" "Linux Programmer's Manual" +.SH NAME +readdir \- read directory entry +.SH SYNOPSIS +.nf +.sp +.BI "int readdir(unsigned int " fd ", struct old_linux_dirent *" dirp "," +.BI " unsigned int " count ); +.fi +.SH DESCRIPTION +This is not the function you are interested in. +Look at +.BR readdir (3) +for the POSIX conforming C library interface. +This page documents the bare kernel system call interface, +which is superseded by +.BR getdents (2). +.PP +.BR readdir () +reads one +.I old_linux_dirent +structure from the directory +referred to by the file descriptor +.I fd +into the buffer pointed to by +.IR dirp . +The argument +.I count +is ignored; at most one +.I old_linux_dirent +structure is read. +.PP +The +.I old_linux_dirent +structure is declared as follows: +.PP +.in +4n +.nf +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) */ +} +.fi +.in +.PP +.I d_ino +is an inode number. +.I d_off +is the distance from the start of the directory to this +.IR old_linux_dirent . +.I d_reclen +is the size of +.IR d_name , +not counting the null terminator. +.I d_name +is a null-terminated filename. +.SH "RETURN VALUE" +On success, 1 is returned. +On end of directory, 0 is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +Invalid file descriptor +.IR fd . +.TP +.B EFAULT +Argument points outside the calling process's address space. +.TP +.B EINVAL +Result buffer is too small. +.TP +.B ENOENT +No such directory. +.TP +.B ENOTDIR +File descriptor does not refer to a directory. +.SH "CONFORMING TO" +This system call is Linux-specific. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). +You will need to define the +.I old_linux_dirent +structure yourself. +.SH "SEE ALSO" +.BR getdents (2), +.BR readdir (3) diff --git a/original/man2/readlink.2 b/original/man2/readlink.2 new file mode 100644 index 00000000..8014d411 --- /dev/null +++ b/original/man2/readlink.2 @@ -0,0 +1,136 @@ +.\" 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. +.\" +.\" @(#)readlink.2 6.8 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 00:10:21 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Tue Jul 9 23:55:17 1996 by aeb +.\" Modified Fri Jan 24 00:26:00 1997 by aeb +.\" +.TH READLINK 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +readlink \- read value of a symbolic link +.SH SYNOPSIS +.B #include +.sp +.BI "ssize_t readlink(const char *" path ", char *" buf ", size_t " bufsiz ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR readlink (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _POSIX_C_SOURCE\ >=\ 200112L +.ad b +.SH DESCRIPTION +.BR readlink () +places the contents of the symbolic link +.I path +in the buffer +.IR buf , +which has size +.IR bufsiz . +.BR readlink () +does not append a null byte to +.IR buf . +It will truncate the contents (to a length of +.I bufsiz +characters), in case the buffer is too small to hold all of the contents. +.SH "RETURN VALUE" +On success, +.BR readlink () +returns the number of bytes placed in +.IR buf . +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EACCES +Search permission is denied for a component of the path prefix. +(See also +.BR path_resolution (7).) +.TP +.B EFAULT +.I buf +extends outside the process's allocated address space. +.TP +.B EINVAL +.I bufsiz +is not positive. +.\" At the glibc level, bufsiz is unsigned, so this error can only occur +.\" if bufsiz==0. However, the in the kernel syscall, bufsiz is signed, +.\" and this error can also occur if bufsiz < 0. +.\" See: http://thread.gmane.org/gmane.linux.man/380 +.\" Subject: [patch 0/3] [RFC] kernel/glibc mismatch of "readlink" syscall? +.TP +.B EINVAL +The named file is not a symbolic link. +.TP +.B EIO +An I/O error occurred while reading from the file system. +.TP +.B ELOOP +Too many symbolic links were encountered in translating the pathname. +.TP +.B ENAMETOOLONG +A pathname, or a component of a pathname, was too long. +.TP +.B ENOENT +The named file does not exist. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOTDIR +A component of the path prefix is not a directory. +.SH "CONFORMING TO" +4.4BSD (the +.BR readlink () +function call appeared in 4.2BSD), +POSIX.1-2001. +.SH NOTES +In versions of glibc up to and including glibc 2.4, the return type of +.BR readlink () +was declared as +.IR int . +Nowadays, the return type is declared as +.IR ssize_t , +as (newly) required in POSIX.1-2001. +.SH "SEE ALSO" +.BR lstat (2), +.BR readlinkat (2), +.BR stat (2), +.BR symlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/readlinkat.2 b/original/man2/readlinkat.2 new file mode 100644 index 00000000..d159c16b --- /dev/null +++ b/original/man2/readlinkat.2 @@ -0,0 +1,122 @@ +.\" 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. +.\" +.\" +.TH READLINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +readlinkat \- read value of a symbolic link relative to +a directory file descriptor +.SH SYNOPSIS +.nf +.B #include /* Definition of AT_* constants */ +.B #include +.sp +.BI "int readlinkat(int " dirfd ", const char *" pathname , +.BI " char *" buf ", size_t " bufsiz ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR readlinkat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +The +.BR readlinkat () +system call operates in exactly the same way as +.BR readlink (2), +except for the differences described in this manual page. + +If the pathname given in +.I pathname +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I dirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR readlink (2) +for a relative pathname). + +If +.I pathname +is relative and +.I dirfd +is the special value +.BR AT_FDCWD , +then +.I pathname +is interpreted relative to the current working +directory of the calling process (like +.BR readlink (2)). + +If +.I pathname +is absolute, then +.I dirfd +is ignored. +.SH "RETURN VALUE" +On success, +.BR readlinkat () +returns the number of bytes placed in +.IR buf . +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR readlink (2) +can also occur for +.BR readlinkat (). +The following additional errors can occur for +.BR readlinkat (): +.TP +.B EBADF +.I dirfd +is not a valid file descriptor. +.TP +.B ENOTDIR +.I pathname +is relative and +.I dirfd +is a file descriptor referring to a file other than a directory. +.SH VERSIONS +.BR readlinkat () +was added to Linux in kernel 2.6.16. +.SH "CONFORMING TO" +POSIX.1-2008. +.SH NOTES +See +.BR openat (2) +for an explanation of the need for +.BR readlinkat (). +.SH "SEE ALSO" +.BR openat (2), +.BR readlink (2), +.BR path_resolution (7) diff --git a/original/man2/readv.2 b/original/man2/readv.2 new file mode 100644 index 00000000..8d5ab233 --- /dev/null +++ b/original/man2/readv.2 @@ -0,0 +1,220 @@ +.\" Copyright (C) 2007 Michael Kerrisk +.\" and 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 18:34:44 1993 by Rik Faith (faith@cs.unc.edu) +.\" Merged readv.[23], 2002-10-17, aeb +.\" 2007-04-30 mtk, A fairly major rewrite to fix errors and +.\" add more details. +.\" +.TH READV 2 2002-10-17 "Linux" "Linux Programmer's Manual" +.SH NAME +readv, writev \- read or write data into multiple buffers +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "ssize_t readv(int " fd ", const struct iovec *" iov ", int " iovcnt ); +.sp +.BI "ssize_t writev(int " fd ", const struct iovec *" iov ", int " iovcnt ); +.fi +.SH DESCRIPTION +The +.BR readv () +function reads +.I iovcnt +buffers from the file associated with the file descriptor +.I fd +into the buffers described by +.I iov +("scatter input"). +.PP +The +.BR writev () +function writes +.I iovcnt +buffers of data described by +.I iov +to the file associated with the file descriptor +.I fd +("gather output"). +.PP +The pointer +.I iov +points to an array of +.I iovec +structures, +defined in +.I +as: +.PP +.br +.in +4n +.nf +struct iovec { + void *iov_base; /* Starting address */ + size_t iov_len; /* Number of bytes to transfer */ +}; +.fi +.in +.PP +The +.BR readv () +function works just like +.BR read (2) +except that multiple buffers are filled. +.PP +The +.BR writev () +function works just like +.BR write (2) +except that multiple buffers are written out. +.PP +Buffers are processed in array order. +This means that +.BR readv () +completely fills +.IR iov [0] +before proceeding to +.IR iov [1], +and so on. +(If there is insufficient data, then not all buffers pointed to by +.I iov +may be filled.) +Similarly, +.BR writev () +writes out the entire contents of +.IR iov [0] +before proceeding to +.IR iov [1], +and so on. +.PP +The data transfers performed by +.BR readv () +and +.BR writev () +are atomic: the data written by +.BR writev () +is written as a single block that is not intermingled with output +from writes in other processes (but see +.BR pipe (7) +for an exception); +analogously, +.BR readv () +is guaranteed to read a contiguous block of data from the file, +regardless of read operations performed in other threads or processes +that have file descriptors referring to the same open file description +(see +.BR open (2)). +.SH "RETURN VALUE" +On success, the +.BR readv () +function returns the number of bytes read; the +.BR writev () +function returns the number of bytes written. +On error, \-1 is returned, and \fIerrno\fP is set appropriately. +.SH ERRORS +The errors are as given for +.BR read (2) +and +.BR write (2). +Additionally the following error is defined: +.TP +.B EINVAL +The sum of the +.I iov_len +values overflows an +.I ssize_t +value. +Or, the vector count \fIiovcnt\fP is less than zero or greater than the +permitted maximum. +.SH "CONFORMING TO" +4.4BSD (the +.BR readv () +and +.BR writev () +functions first appeared in 4.2BSD), POSIX.1-2001. +Linux libc5 used \fIsize_t\fP as the type of the \fIiovcnt\fP argument, +and \fIint\fP as return type for these functions. +.\" The readv/writev system calls were buggy before Linux 1.3.40. +.\" (Says release.libc.) +.SH NOTES +.SS Linux Notes +POSIX.1-2001 allows an implementation to place a limit on +the number of items that can be passed in +.IR iov . +An implementation can advertise its limit by defining +.B IOV_MAX +in +.I +or at run time via the return value from +.IR sysconf(_SC_IOV_MAX) . +On Linux, the limit advertised by these mechanisms is 1024, +which is the true kernel limit. +However, the glibc wrapper functions do some extra work if +they detect that the underlying kernel system call failed because this +limit was exceeded. +In the case of +.BR readv () +the wrapper function allocates a temporary buffer large enough +for all of the items specified by +.IR iov , +passes that buffer in a call to +.BR read (2), +copies data from the buffer to the locations specified by the +.I iov_base +fields of the elements of +.IR iov , +and then frees the buffer. +The wrapper function for +.BR writev () +performs the analogous task using a temporary buffer and a call to +.BR write (2). +.SH BUGS +It is not advisable to mix calls to functions like +.BR readv () +or +.BR writev (), +which operate on file descriptors, with the functions from the stdio +library; the results will be undefined and probably not what you want. +.SH EXAMPLE +The following code sample demonstrates the use of +.BR writev (): + +.in +4n +.nf +char *str0 = "hello "; +char *str1 = "world\\n"; +struct iovec iov[2]; +ssize_t nwritten; + +iov[0].iov_base = str0; +iov[0].iov_len = strlen(str0); +iov[1].iov_base = str1; +iov[1].iov_len = strlen(str1); + +nwritten = writev(STDOUT_FILENO, iov, 2); +.fi +.in +.SH "SEE ALSO" +.BR read (2), +.BR write (2) diff --git a/original/man2/reboot.2 b/original/man2/reboot.2 new file mode 100644 index 00000000..253bd345 --- /dev/null +++ b/original/man2/reboot.2 @@ -0,0 +1,180 @@ +.\" Copyright (c) 1998 Andries Brouwer (aeb@cwi.nl), 24 September 1998 +.\" +.\" 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, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.TH REBOOT 2 2008-02-11 "Linux" "Linux Programmer's Manual" +.SH NAME +reboot \- reboot or enable/disable Ctrl-Alt-Del +.SH SYNOPSIS +/* For libc4 and libc5 the library call and the system call + are identical, and since kernel version 2.1.30 there are + symbolic names LINUX_REBOOT_* for the constants and a + fourth argument to the call: */ +.sp +.B #include +.br +.B #include +.sp +.BI "int reboot(int " magic ", int " magic2 ", int " cmd ", void *" arg ); +.sp +/* Under glibc some of the constants involved have gotten + symbolic names RB_*, and the library call is a 1-argument + wrapper around the 3-argument system call: */ +.sp +.B #include +.br +.B #include +.sp +.BI "int reboot(int " cmd ); +.SH DESCRIPTION +The +.BR reboot () +call reboots the system, or enables/disables the reboot keystroke +(abbreviated CAD, since the default is Ctrl-Alt-Delete; +it can be changed using +.BR loadkeys (1)). +.PP +This system call will fail (with +.BR EINVAL ) +unless +.I magic +equals +.B LINUX_REBOOT_MAGIC1 +(that is, 0xfee1dead) and +.I magic2 +equals +.B LINUX_REBOOT_MAGIC2 +(that is, 672274793). +However, since 2.1.17 also +.B LINUX_REBOOT_MAGIC2A +(that is, 85072278) +and since 2.1.97 also +.B LINUX_REBOOT_MAGIC2B +(that is, 369367448) +and since 2.5.71 also +.B LINUX_REBOOT_MAGIC2C +(that is, 537993216) +are permitted as value for +.IR magic2 . +(The hexadecimal values of these constants are meaningful.) +The +.I cmd +argument can have the following values: +.TP +.B LINUX_REBOOT_CMD_RESTART +(RB_AUTOBOOT, 0x1234567). +The message "Restarting system." is printed, and a default +restart is performed immediately. +If not preceded by a +.BR sync (2), +data will be lost. +.TP +.B LINUX_REBOOT_CMD_HALT +(RB_HALT_SYSTEM, 0xcdef0123; since 1.1.76). +The message "System halted." is printed, and the system is halted. +Control is given to the ROM monitor, if there is one. +If not preceded by a +.BR sync (2), +data will be lost. +.TP +.B LINUX_REBOOT_CMD_POWER_OFF +(0x4321fedc; since 2.1.30). +The message "Power down." is printed, the system is stopped, +and all power is removed from the system, if possible. +If not preceded by a +.BR sync (2), +data will be lost. +.TP +.B LINUX_REBOOT_CMD_RESTART2 +(0xa1b2c3d4; since 2.1.30). +The message "Restarting system with command \(aq%s\(aq" is printed, +and a restart (using the command string given in +.IR arg ) +is performed immediately. +If not preceded by a +.BR sync (2), +data will be lost. +.TP +.B LINUX_REBOOT_CMD_CAD_ON +(RB_ENABLE_CAD, 0x89abcdef). +CAD is enabled. +This means that the CAD keystroke will immediately cause +the action associated with +.BR LINUX_REBOOT_CMD_RESTART . +.TP +.B LINUX_REBOOT_CMD_CAD_OFF +(RB_DISABLE_CAD, 0). +CAD is disabled. +This means that the CAD keystroke will cause a +.B SIGINT +signal to be +sent to init (process 1), whereupon this process may decide upon a +proper action (maybe: kill all processes, sync, reboot). +.LP +Only the superuser may call +.BR reboot (). +.LP +The precise effect of the above actions depends on the architecture. +For the i386 architecture, the additional argument does not do +anything at present (2.1.122), but the type of reboot can be +determined by kernel command-line arguments ("reboot=...") to be +either warm or cold, and either hard or through the BIOS. +.SH "RETURN VALUE" +For the values of +.I cmd +that stop or restart the system, +a successful call to +.BR reboot () +does not return. +For the other +.I cmd +values, zero is returned on success. +In all cases, \-1 is returned on failure, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +Problem with getting userspace data under +.BR LINUX_REBOOT_CMD_RESTART2 . +.TP +.B EINVAL +Bad magic numbers or \fIcmd\fP. +.TP +.B EPERM +The calling process has insufficient privilege to call +.BR reboot (); +the +.B CAP_SYS_BOOT +capability is required. +.SH "CONFORMING TO" +.BR reboot () +is Linux-specific, +and should not be used in programs intended to be portable. +.SH "SEE ALSO" +.BR sync (2), +.BR bootparam (7), +.BR capabilities (7), +.BR ctrlaltdel (8), +.BR halt (8), +.BR reboot (8) diff --git a/original/man2/recv.2 b/original/man2/recv.2 new file mode 100644 index 00000000..cce9d6a4 --- /dev/null +++ b/original/man2/recv.2 @@ -0,0 +1,497 @@ +.\" Copyright (c) 1983, 1990, 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. +.\" +.\" $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 +.\" +.TH RECV 2 2009-03-10 "Linux" "Linux Programmer's Manual" +.SH NAME +recv, recvfrom, recvmsg \- receive a message from a socket +.SH SYNOPSIS +.\" .B #include +.\" .br +.nf +.B #include +.br +.B #include +.sp +.BI "ssize_t recv(int " sockfd ", void *" buf ", size_t " len ", int " flags ); +.sp +.BI "ssize_t recvfrom(int " sockfd ", void *" buf ", size_t " len ", int " flags , +.BI " struct sockaddr *" src_addr ", socklen_t *" addrlen ); +.sp +.BI "ssize_t recvmsg(int " sockfd ", struct msghdr *" msg ", int " flags ); +.fi +.SH DESCRIPTION +The +.BR recvfrom () +and +.BR recvmsg () +calls are used to receive messages from a socket, and may be used +to receive data on a socket whether or not it is connection-oriented. +.PP +If +.I src_addr +is not NULL, and the underlying protocol provides the source address, +this source address is filled in. +When +.I src_addr +is NULL, nothing is filled in; in this case, +.I addrlen +is not used, and should also be NULL. +.\" (Note: for datagram sockets in both the Unix and Internet domains, +.\" .I src_addr +.\" is filled in. +.\" .I src_addr +.\" 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)] +The argument +.I addrlen +is a value-result argument, +which the caller should initialize before the call to +the size of the buffer associated with +.IR src_addr , +and modified on return to indicate the actual size of the source address. +The returned address is truncated if the buffer provided is too small; +in this case, +.I addrlen +will return a value greater than was supplied to the call. +.PP +The +.BR recv () +call is normally used only on a +.I connected +socket (see +.BR connect (2)) +and is identical to +.BR recvfrom () +with a NULL +.I src_addr +argument. +.PP +All three routines return the length of the message on successful +completion. +If a message is too long to fit in the supplied buffer, excess +bytes may be discarded depending on the type of socket the message is +received from. +.PP +If no messages are available at the socket, the receive calls wait for a +message to arrive, unless the socket is nonblocking (see +.BR fcntl (2)), +in which case the value \-1 is returned and the external variable +.I errno +is set to +.BR EAGAIN " or " EWOULDBLOCK . +The receive calls normally return any data available, up to the requested +amount, rather than waiting for receipt of the full amount requested. +.PP +The +.BR select (2) +or +.BR poll (2) +call may be used to determine when more data arrives. +.PP +The +.I flags +argument to a +.BR recv () +call is formed by +.IR OR 'ing +one or more of the following values: +.TP +.BR MSG_CMSG_CLOEXEC " (" recvmsg "() only; since Linux 2.6.23)" +Set the close-on-exec flag for the file descriptor received +via a Unix domain file descriptor using the +.B SCM_RIGHTS +operation (described in +.BR unix (7)). +This flag is useful for the same reasons as the +.B O_CLOEXEC +flag of +.BR open (2). +.TP +.BR MSG_DONTWAIT " (since Linux 2.2)" +Enables nonblocking operation; if the operation would block, +the call fails with the error +.BR EAGAIN " or " EWOULDBLOCK +(this can also be enabled using the +.B O_NONBLOCK +flag with the +.B F_SETFL +.BR fcntl (2)). +.TP +.BR MSG_ERRQUEUE " (since Linux 2.2)" +This flag +specifies that queued errors should be received from the socket error queue. +The error is passed in +an ancillary message with a type dependent on the protocol (for IPv4 +.BR IP_RECVERR ). +The user should supply a buffer of sufficient size. +See +.BR cmsg (3) +and +.BR ip (7) +for more information. +The payload of the original packet that caused the error +is passed as normal data via +.IR msg_iovec . +The original destination address of the datagram that caused the error +is supplied via +.IR msg_name . +.IP +For local errors, no address is passed (this can be checked with the +.I cmsg_len +member of the +.IR cmsghdr ). +For error receives, the +.B MSG_ERRQUEUE +is set in the +.IR msghdr . +After an error has been passed, the pending socket error +is regenerated based on the next queued error and will be passed +on the next socket operation. + +The error is supplied in a +.I sock_extended_err +structure: +.in +4n +.nf + +#define SO_EE_ORIGIN_NONE 0 +#define SO_EE_ORIGIN_LOCAL 1 +#define SO_EE_ORIGIN_ICMP 2 +#define SO_EE_ORIGIN_ICMP6 3 + +struct sock_extended_err +{ + uint32_t ee_errno; /* error number */ + uint8_t ee_origin; /* where the error originated */ + uint8_t ee_type; /* type */ + uint8_t ee_code; /* code */ + uint8_t ee_pad; /* padding */ + uint32_t ee_info; /* additional information */ + uint32_t ee_data; /* other data */ + /* More data may follow */ +}; + +struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *); +.fi +.in +.IP +.I ee_errno +contains the +.I errno +number of the queued error. +.I ee_origin +is the origin code of where the error originated. +The other fields are protocol-specific. +The macro +.B SOCK_EE_OFFENDER +returns a pointer to the address of the network object +where the error originated from given a pointer to the ancillary message. +If this address is not known, the +.I sa_family +member of the +.I sockaddr +contains +.B AF_UNSPEC +and the other fields of the +.I sockaddr +are undefined. +The payload of the packet that caused the error is passed as normal data. +.IP +For local errors, no address is passed (this +can be checked with the +.I cmsg_len +member of the +.IR cmsghdr ). +For error receives, +the +.B MSG_ERRQUEUE +is set in the +.IR msghdr . +After an error has been passed, the pending socket error +is regenerated based on the next queued error and will be passed +on the next socket operation. +.TP +.B MSG_OOB +This flag requests receipt of out-of-band data that would not be received +in the normal data stream. +Some protocols place expedited data +at the head of the normal data queue, and thus this flag cannot +be used with such protocols. +.TP +.B MSG_PEEK +This flag causes the receive operation to +return data from the beginning of the +receive queue without removing that data from the queue. +Thus, a +subsequent receive call will return the same data. +.TP +.BR MSG_TRUNC " (since Linux 2.2)" +For raw +.RB ( AF_PACKET ), +Internet datagram (since Linux 2.4.27/2.6.8), +and netlink (since Linux 2.6.22) sockets: +return the real length of the packet or datagram, +even when it was longer than the passed buffer. +Not implemented for Unix domain +.RB ( unix (7)) +sockets. + +For use with Internet stream sockets, see +.BR tcp (7). +.TP +.BR MSG_WAITALL " (since Linux 2.2)" +This flag requests that the operation block until the full request is +satisfied. +However, the call may still return less data than requested if +a signal is caught, an error or disconnect occurs, or the next data to be +received is of a different type than that returned. +.PP +The +.BR recvmsg () +call uses a +.I msghdr +structure to minimize the number of directly supplied arguments. +This structure is defined as follows in +.IR : +.in +4n +.nf + +struct iovec { /* Scatter/gather array items */ + void *iov_base; /* Starting address */ + size_t iov_len; /* Number of bytes to transfer */ +}; + +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 */ + socklen_t msg_controllen; /* ancillary data buffer len */ + int msg_flags; /* flags on received message */ +}; +.fi +.in +.PP +Here +.I msg_name +and +.I msg_namelen +specify the source address if the socket is unconnected; +.I msg_name +may be given as a null pointer if no names are desired or required. +The fields +.I msg_iov +and +.I msg_iovlen +describe scatter-gather locations, as discussed in +.BR readv (2). +The field +.IR msg_control , +which has length +.IR msg_controllen , +points to a buffer for other protocol control-related messages or +miscellaneous ancillary data. +When +.BR recvmsg () +is called, +.I msg_controllen +should contain the length of the available buffer in +.IR msg_control ; +upon return from a successful call it will contain the length +of the control message sequence. +.PP +The messages are of the form: +.in +4n +.nf + +struct cmsghdr { + socklen_t cmsg_len; /* data byte count, including hdr */ + int cmsg_level; /* originating protocol */ + int cmsg_type; /* protocol-specific type */ +/* followed by + unsigned char cmsg_data[]; */ +}; +.fi +.in +.PP +Ancillary data should only be accessed by the macros defined in +.BR cmsg (3). +.PP +As an example, Linux uses this auxiliary data mechanism to pass extended +errors, IP options or file descriptors over Unix sockets. +.PP +The +.I msg_flags +field in the msghdr is set on return of +.BR recvmsg (). +It can contain several flags: +.TP +.B MSG_EOR +indicates end-of-record; the data returned completed a record (generally +used with sockets of type +.BR SOCK_SEQPACKET ). +.TP +.B MSG_TRUNC +indicates that the trailing portion of a datagram was discarded because the +datagram was larger than the buffer supplied. +.TP +.B MSG_CTRUNC +indicates that some control data were discarded due to lack of space in the +buffer for ancillary data. +.TP +.B MSG_OOB +is returned to indicate that expedited or out-of-band data were received. +.TP +.B MSG_ERRQUEUE +indicates that no data was received but an extended error from the socket +error queue. +.SH "RETURN VALUE" +These calls return the number of bytes received, or \-1 +if an error occurred. +The return value will be 0 when the +peer has performed an orderly shutdown. +.SH ERRORS +These are some standard errors generated by the socket layer. +Additional errors +may be generated and returned from the underlying protocol modules; +see their manual pages. +.TP +.BR EAGAIN " or " EWOULDBLOCK +.\" Actually EAGAIN on Linux +The socket is marked nonblocking and the receive operation +would block, or a receive timeout had been set and the timeout expired +before data was received. +POSIX.1-2001 allows either error to be returned for this case, +and does not require these constants to have the same value, +so a portable application should check for both possibilities. +.TP +.B EBADF +The argument +.I sockfd +is an invalid descriptor. +.TP +.B ECONNREFUSED +A remote host refused to allow the network connection (typically +because it is not running the requested service). +.TP +.B EFAULT +The receive buffer pointer(s) point outside the process's +address space. +.TP +.B EINTR +The receive was interrupted by delivery of a signal before +any data were available; see +.BR signal (7). +.TP +.B EINVAL +Invalid argument passed. +.\" e.g., msg_namelen < 0 for recvmsg() or addrlen < 0 for recvfrom() +.TP +.B ENOMEM +Could not allocate memory for +.BR recvmsg (). +.TP +.B ENOTCONN +The socket is associated with a connection-oriented protocol +and has not been connected (see +.BR connect (2) +and +.BR accept (2)). +.TP +.B ENOTSOCK +The argument +.I sockfd +does not refer to a socket. +.SH "CONFORMING TO" +4.4BSD (these function calls first appeared in 4.2BSD), +POSIX.1-2001. +.LP +POSIX.1-2001 only describes the +.BR MSG_OOB , +.BR MSG_PEEK , +and +.B MSG_WAITALL +flags. +.SH NOTES +The prototypes given above follow glibc2. +The Single Unix Specification agrees, except that it has return values +of type \fIssize_t\fP (while 4.x BSD and libc4 and libc5 all have \fIint\fP). +The +.I flags +argument is \fIint\fP in 4.x BSD, but \fIunsigned int\fP in libc4 and libc5. +The +.I len +argument is \fIint\fP in 4.x BSD, but \fIsize_t\fP in libc4 and libc5. +The +.I addrlen +argument is \fIint\ *\fP in 4.x BSD, libc4 and libc5. +The present \fIsocklen_t\ *\fP was invented by POSIX. +See also +.BR accept (2). + +According to POSIX.1-2001, the +.I msg_controllen +field of the +.I msghdr +structure should be typed as +.IR socklen_t , +but glibc currently (2.4) types it as +.IR 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. +.SH EXAMPLE +An example of the use of +.BR recvfrom () +is shown in +.BR getaddrinfo (3). +.SH "SEE ALSO" +.BR fcntl (2), +.BR getsockopt (2), +.BR read (2), +.BR select (2), +.BR shutdown (2), +.BR socket (2), +.BR cmsg (3), +.BR sockatmark (3), +.BR socket (7) diff --git a/original/man2/recvfrom.2 b/original/man2/recvfrom.2 new file mode 100644 index 00000000..13228c39 --- /dev/null +++ b/original/man2/recvfrom.2 @@ -0,0 +1 @@ +.so man2/recv.2 diff --git a/original/man2/recvmsg.2 b/original/man2/recvmsg.2 new file mode 100644 index 00000000..13228c39 --- /dev/null +++ b/original/man2/recvmsg.2 @@ -0,0 +1 @@ +.so man2/recv.2 diff --git a/original/man2/remap_file_pages.2 b/original/man2/remap_file_pages.2 new file mode 100644 index 00000000..9610fdc2 --- /dev/null +++ b/original/man2/remap_file_pages.2 @@ -0,0 +1,162 @@ +.\" Copyright (C) 2003, Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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. +.\" +.\" 2003-12-10 Initial creation, Michael Kerrisk +.\" 2004-10-28 aeb, corrected prototype, prot must be 0 +.\" +.TH REMAP_FILE_PAGES 2 2008-04-22 "Linux" "Linux Programmer's Manual" +.SH NAME +remap_file_pages \- create a nonlinear file mapping +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int remap_file_pages(void *" addr ", size_t " size ", int " prot , +.BI " ssize_t " pgoff ", int " flags ); +.fi +.SH DESCRIPTION +The +.BR remap_file_pages () +system call is used to create a nonlinear mapping, that is, a mapping +in which the pages of the file are mapped into a nonsequential order +in memory. +The advantage of using +.BR remap_file_pages () +over using repeated calls to +.BR mmap (2) +is that the former approach does not require the kernel to create +additional VMA (Virtual Memory Area) data structures. + +To create a nonlinear mapping we perform the following steps: +.TP 3 +1. +Use +.BR mmap (2) +to create a mapping (which is initially linear). +This mapping must be created with the +.B MAP_SHARED +flag. +.TP +2. +Use one or more calls to +.BR remap_file_pages () +to rearrange the correspondence between the pages of the mapping +and the pages of the file. +It is possible to map the same page of a file +into multiple locations within the mapped region. +.LP +The +.I pgoff +and +.I size +arguments specify the region of the file that is to be relocated +within the mapping: +.I pgoff +is a file offset in units of the system page size; +.I size +is the length of the region in bytes. + +The +.I addr +argument serves two purposes. +First, it identifies the mapping whose pages we want to rearrange. +Thus, +.I addr +must be an address that falls within +a region previously mapped by a call to +.BR mmap (2). +Second, +.I addr +specifies the address at which the file pages +identified by +.I pgoff +and +.I size +will be placed. + +The values specified in +.I addr +and +.I size +should be multiples of the system page size. +If they are not, then the kernel rounds +.I both +values +.I down +to the nearest multiple of the page size. +.\" This rounding is weird, and not consistent with the treatment of +.\" the analogous arguments for munmap()/mprotect() and for mlock(). +.\" MTK, 14 Sep 2005 + +The +.I prot +argument must be specified as 0. + +The +.I flags +argument has the same meaning as for +.BR mmap (2), +but all flags other than +.B MAP_NONBLOCK +are ignored. +.SH "RETURN VALUE" +On success, +.BR remap_file_pages () +returns 0. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +.I addr +does not refer to a valid mapping +created with the +.B MAP_SHARED +flag. +.TP +.B EINVAL +.IR addr , +.IR size , +.IR prot , +or +.I pgoff +is invalid. +.\" And possibly others from vma->vm_ops->populate() +.SH VERSIONS +The +.BR remap_file_pages () +system call appeared in Linux 2.5.46; +glibc support was added in version 2.3.3. +.SH "CONFORMING TO" +The +.BR remap_file_pages () +system call is Linux-specific. +.SH "SEE ALSO" +.BR getpagesize (2), +.BR mmap (2), +.BR mmap2 (2), +.BR mprotect (2), +.BR mremap (2), +.BR msync (2), +.BR feature_test_macros (7) diff --git a/original/man2/removexattr.2 b/original/man2/removexattr.2 new file mode 100644 index 00000000..aae3e66b --- /dev/null +++ b/original/man2/removexattr.2 @@ -0,0 +1,119 @@ +.\" +.\" Extended attributes system calls manual pages +.\" +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" 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. +.\" +.TH REMOVEXATTR 2 2001-12-01 "Linux" "Linux Programmer's Manual" +.SH NAME +removexattr, lremovexattr, fremovexattr \- remove an extended attribute +.SH SYNOPSIS +.fam C +.nf +.B #include +.B #include +.sp +.BI "int removexattr(const char\ *" path ", const char\ *" name ); +.BI "int lremovexattr(const char\ *" path ", const char\ *" name ); +.BI "int fremovexattr(int " fd ", const char\ *" name ); +.fi +.fam T +.SH DESCRIPTION +Extended attributes are +.IR name :\c +value pairs associated with inodes (files, directories, symbolic links, etc.). +They are extensions to the normal attributes which are associated +with all inodes in the system (i.e., the +.BR stat (2) +data). +A complete overview of extended attributes concepts can be found in +.BR attr (5). +.PP +.BR removexattr () +removes the extended attribute identified by +.I name +and associated with the given +.I path +in the file system. +.PP +.BR lremovexattr () +is identical to +.BR removexattr (), +except in the case of a symbolic link, where the extended attribute is +removed from the link itself, not the file that it refers to. +.PP +.BR fremovexattr () +is identical to +.BR removexattr (), +only the extended attribute is removed from the open file referred to by +.I fd +(as returned by +.BR open (2)) +in place of +.IR path . +.PP +An extended attribute name is a simple null-terminated string. +The +.I name +includes a namespace prefix; there may be several, disjoint +namespaces associated with an individual inode. +.SH RETURN VALUE +On success, zero is returned. +On failure, \-1 is returned and +.I errno +is set appropriately. +.PP +If the named attribute does not exist, +.I errno +is set to +.BR ENOATTR . +.PP +If extended attributes are not supported by the file system, or are disabled, +.I errno +is set to +.BR ENOTSUP . +.PP +The errors documented for the +.BR stat (2) +system call are also applicable here. +.SH VERSIONS +These system calls have been available on Linux since kernel 2.4; +glibc support is provided since version 2.3. +.SH "CONFORMING TO" +These system calls are Linux-specific. +.\" .SH AUTHORS +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" and the SGI XFS development team, +.\" .RI < linux-xfs@oss.sgi.com >. +.\" Please send any bug reports or comments to these addresses. +.SH SEE ALSO +.BR getfattr (1), +.BR setfattr (1), +.BR getxattr (2), +.BR listxattr (2), +.BR open (2), +.BR setxattr (2), +.BR stat (2), +.BR attr (5), +.BR symlink (7) diff --git a/original/man2/rename.2 b/original/man2/rename.2 new file mode 100644 index 00000000..c88ca697 --- /dev/null +++ b/original/man2/rename.2 @@ -0,0 +1,250 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt; +.\" 1993,1995 Ian Jackson. +.\" +.\" 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 Sat Jul 24 00:35:52 1993 by Rik Faith +.\" Modified Thu Jun 4 12:21:13 1998 by Andries Brouwer +.\" Modified Thu Mar 3 09:49:35 2005 by Michael Haardt +.\" 2007-03-25, mtk, added various text to DESCRIPTION. +.\" +.TH RENAME 2 2009-03-30 "Linux" "Linux Programmer's Manual" +.SH NAME +rename \- change the name or location of a file +.SH SYNOPSIS +.B #include +.sp +.BI "int rename(const char *" oldpath ", const char *" newpath ); +.SH DESCRIPTION +.BR rename () +renames a file, moving it between directories if required. +Any other hard links to the file (as created using +.BR link (2)) +are unaffected. +Open file descriptors for +.I oldpath +are also unaffected. + +If +.I newpath +already exists it will be atomically replaced (subject to +a few conditions; see ERRORS below), so that there is +no point at which another process attempting to access +.I newpath +will find it missing. + +If +.I oldpath +and +.I newpath +are existing hard links referring to the same file, then +.BR rename () +does nothing, and returns a success status. + +If +.I newpath +exists but the operation fails for some reason +.BR rename () +guarantees to leave an instance of +.I newpath +in place. + +.I oldpath +can specify a directory. +In this case, +.I newpath +must either not exist, or it must specify an empty directory. + +However, when overwriting there will probably be a window in which +both +.I oldpath +and +.I newpath +refer to the file being renamed. + +If +.I oldpath +refers to a symbolic link the link is renamed; if +.I newpath +refers to a symbolic link the link will be overwritten. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +Write permission is denied for the directory containing +.I oldpath +or +.IR newpath , +or, search permission is denied for one of the directories +in the path prefix of +.I oldpath +or +.IR newpath , +or +.I oldpath +is a directory and does not allow write permission (needed to update +the +.I .. +entry). +(See also +.BR path_resolution (7).) +.TP +.B EBUSY +The rename fails because +.IR oldpath " or " newpath +is a directory that is in use by some process (perhaps as +current working directory, or as root directory, or because +it was open for reading) or is in use by the system +(for example as mount point), while the system considers +this an error. +(Note that there is no requirement to return +.B EBUSY +in such +cases \(em there is nothing wrong with doing the rename anyway \(em +but it is allowed to return +.B EBUSY +if the system cannot otherwise +handle such situations.) +.TP +.B EFAULT +.IR oldpath " or " newpath " points outside your accessible address space." +.TP +.B EINVAL +The new pathname contained a path prefix of the old, or, more generally, +an attempt was made to make a directory a subdirectory of itself. +.TP +.B EISDIR +.I newpath +is an existing directory, but +.I oldpath +is not a directory. +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR oldpath " or " newpath . +.TP +.B EMLINK +.I oldpath +already has the maximum number of links to it, or +it was a directory and the directory containing +.I newpath +has the maximum number of links. +.TP +.B ENAMETOOLONG +.IR oldpath " or " newpath " was too long." +.TP +.B ENOENT +The link named by +.I oldpath +does not exist; +or, a directory component in +.I newpath +does not exist; +or, +.I oldpath +or +.I newpath +is an empty string. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOSPC +The device containing the file has no room for the new directory +entry. +.TP +.B ENOTDIR +A component used as a directory in +.IR oldpath " or " newpath +is not, in fact, a directory. +Or, +.I oldpath +is a directory, and +.I newpath +exists but is not a directory. +.TP +.BR ENOTEMPTY " or " EEXIST +.I newpath +is a nonempty directory, that is, contains entries other than "." and "..". +.TP +.BR EPERM " or " EACCES +The directory containing +.I oldpath +has the sticky bit +.RB ( S_ISVTX ) +set and the process's effective user ID is neither +the user ID of the file to be deleted nor that of the directory +containing it, and the process is not privileged +(Linux: does not have the +.B CAP_FOWNER +capability); +or +.I newpath +is an existing file and the directory containing it has the sticky bit set +and the process's effective user ID is neither the user ID of the file +to be replaced nor that of the directory containing it, +and the process is not privileged +(Linux: does not have the +.B CAP_FOWNER +capability); +or the file system containing +.I pathname +does not support renaming of the type requested. +.TP +.B EROFS +The file is on a read-only file system. +.TP +.B EXDEV +.IR oldpath " and " newpath +are not on the same mounted file system. +(Linux permits a file system to be mounted at multiple points, but +.BR rename () +does not work across different mount points, +even if the same file system is mounted on both.) +.SH "CONFORMING TO" +4.3BSD, C89, C99, POSIX.1-2001. +.SH BUGS +On NFS file systems, you can not assume that if the operation +failed the file was not renamed. +If the server does the rename operation +and then crashes, the retransmitted RPC which will be processed when the +server is up again causes a failure. +The application is expected to +deal with this. +See +.BR link (2) +for a similar problem. +.SH "SEE ALSO" +.BR mv (1), +.BR chmod (2), +.BR link (2), +.BR renameat (2), +.BR symlink (2), +.BR unlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/renameat.2 b/original/man2/renameat.2 new file mode 100644 index 00000000..5468890e --- /dev/null +++ b/original/man2/renameat.2 @@ -0,0 +1,134 @@ +.\" 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. +.\" +.\" +.TH RENAMEAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +renameat \- rename a file relative to directory file descriptors +.SH SYNOPSIS +.nf +.B #include /* Definition of AT_* constants */ +.B #include +.sp +.BI "int renameat(int " olddirfd ", const char *" oldpath , +.BI " int " newdirfd ", const char *" newpath ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR renameat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +The +.BR renameat () +system call operates in exactly the same way as +.BR rename (2), +except for the differences described in this manual page. + +If the pathname given in +.I oldpath +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I olddirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR rename (2) +for a relative pathname). + +If +.I oldpath +is relative and +.I olddirfd +is the special value +.BR AT_FDCWD , +then +.I oldpath +is interpreted relative to the current working +directory of the calling process (like +.BR rename (2)). + +If +.I oldpath +is absolute, then +.I olddirfd +is ignored. + +The interpretation of +.I newpath +is as for +.IR oldpath , +except that a relative pathname is interpreted relative +to the directory referred to by the file descriptor +.IR newdirfd . +.SH "RETURN VALUE" +On success, +.BR renameat () +returns 0. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR rename (2) +can also occur for +.BR renameat (). +The following additional errors can occur for +.BR renameat (): +.TP +.B EBADF +.I olddirfd +or +.I newdirfd +is not a valid file descriptor. +.TP +.B ENOTDIR +.I oldpath +is relative and +.I olddirfd +is a file descriptor referring to a file other than a directory; +or similar for +.I newpath +and +.I newdirfd +.SH VERSIONS +.BR renameat () +was added to Linux in kernel 2.6.16. +.SH "CONFORMING TO" +POSIX.1-2008. +.SH NOTES +See +.BR openat (2) +for an explanation of the need for +.BR renameat (). +.SH "SEE ALSO" +.BR openat (2), +.BR rename (2), +.BR path_resolution (7) diff --git a/original/man2/request_key.2 b/original/man2/request_key.2 new file mode 100644 index 00000000..f053f2a2 --- /dev/null +++ b/original/man2/request_key.2 @@ -0,0 +1,141 @@ +.\" +.\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. +.\" Written by David Howells (dhowells@redhat.com) +.\" +.\" 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. +.\" +.TH REQUEST_KEY 2 2010-02-25 Linux "Linux Key Management Calls" +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH NAME +request_key \- Request a key from the kernel's key management facility +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "key_serial_t request_key(const char *" type ", const char *" description , +.BI "const char *" callout_info ", key_serial_t " keyring ");" +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH DESCRIPTION +.BR request_key () +asks the kernel to find a key of the given +.I type +that matches the specified +.I description +and, if successful, to attach it to the nominated +.I keyring +and to return its serial number. +.P +.BR request_key () +first recursively searches all the keyrings attached to the calling process in +the order thread-specific keyring, process-specific keyring and then session +keyring for a matching key. +.P +If +.BR request_key () +is called from a program invoked by +.BR request_key () +on behalf of some other process to generate a key, then the keyrings of that +other process will be searched next, using that other process's UID, GID, +groups and security context to control access. +.P +The keys in each keyring searched are checked for a match before any child +keyrings are recursed into. Only keys that are +.B searchable +for the caller may be found, and only +.B searchable +keyrings may be searched. +.P +If the key is not found then, if +.I callout_info +is set, this function will attempt to look further afield. In such a case, the +.I callout_info +is passed to a userspace service such as +.B /sbin/request\-key +to generate the key. +.P +If that is unsuccessful also, then an error will be returned, and a temporary +negative key will be installed in the nominated +.IR keyring . +This will expire after a few seconds, but will cause subsequent +calls to +.BR request_key () +to fail until it does. +.P +The +.I keyring +serial number may be that of a valid keyring to which the caller has write +permission, or it may be a special keyring ID: +.TP +.B KEY_SPEC_THREAD_KEYRING +This specifies the caller's thread-specific keyring. +.TP +.B KEY_SPEC_PROCESS_KEYRING +This specifies the caller's process-specific keyring. +.TP +.B KEY_SPEC_SESSION_KEYRING +This specifies the caller's session-specific keyring. +.TP +.B KEY_SPEC_USER_KEYRING +This specifies the caller's UID-specific keyring. +.TP +.B KEY_SPEC_USER_SESSION_KEYRING +This specifies the caller's UID-session keyring. +.P +If a key is created, no matter whether it's a valid key or a negative key, it +will displace any other key of the same type and description from the +destination +.IR keyring . +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH RETURN VALUE +On success +.BR request_key () +returns the serial number of the key it found. +On error, the value +.B -1 +will be returned and errno will have been set to an appropriate error. +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH ERRORS +.TP +.B ENOKEY +No matching key was found. +.TP +.B EKEYEXPIRED +An expired key was found, but no replacement could be obtained. +.TP +.B EKEYREVOKED +A revoked key was found, but no replacement could be obtained. +.TP +.B EKEYREJECTED +The attempt to generate a new key was rejected. +.TP +.B ENOMEM +Insufficient memory to create a key. +.TP +.B EINTR +The request was interrupted by a signal. +.TP +.B EDQUOT +The key quota for this user would be exceeded by creating this key or linking +it to the keyring. +.TP +.B EACCES +The keyring wasn't available for modification by the user. +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH LINKING +Although this is a Linux system call, it is not present in +.I libc +but can be found rather in +.IR libkeyutils . +When linking, +.B -lkeyutils +should be specified to the linker. +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.SH SEE ALSO +.BR keyctl (1), +.BR add_key (2), +.BR keyctl (2), +.BR request-key (8) diff --git a/original/man2/rmdir.2 b/original/man2/rmdir.2 new file mode 100644 index 00000000..8455d5cb --- /dev/null +++ b/original/man2/rmdir.2 @@ -0,0 +1,140 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 1997-01-31 by Eric S. Raymond +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.TH RMDIR 2 2008-05-08 "Linux" "Linux Programmer's Manual" +.SH NAME +rmdir \- delete a directory +.SH SYNOPSIS +.B #include +.sp +.BI "int rmdir(const char *" pathname ); +.SH DESCRIPTION +.BR rmdir () +deletes a directory, which must be empty. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +Write access to the directory containing +.I pathname +was not allowed, or one of the directories in the path prefix of +.I pathname +did not allow search permission. +(See also +.BR path_resolution (7). +.TP +.B EBUSY +.I pathname +is currently in use by the system or some process that prevents its +removal. +On Linux this means +.I pathname +is currently used as a mount point +or is the root directory of the calling process. +.TP +.B EFAULT +.IR pathname " points outside your accessible address space." +.TP +.B EINVAL +.I pathname +has +.I . +as last component. +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR pathname . +.TP +.B ENAMETOOLONG +.IR pathname " was too long." +.TP +.B ENOENT +A directory component in +.I pathname +does not exist or is a dangling symbolic link. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOTDIR +.IR pathname , +or a component used as a directory in +.IR pathname , +is not, in fact, a directory. +.TP +.B ENOTEMPTY +.I pathname +contains entries other than +.IR . " and " .. " ;" +or, +.I pathname +has +.I .. +as its final component. +POSIX.1-2001 also allows +.B EEXIST +for this condition. +.TP +.B EPERM +The directory containing +.I pathname +has the sticky bit +.RB ( S_ISVTX ) +set and the process's effective user ID is neither the user ID +of the file to be deleted nor that of the directory containing it, +and the process is not privileged (Linux: does not have the +.B CAP_FOWNER +capability). +.TP +.B EPERM +The file system containing +.I pathname +does not support the removal of directories. +.TP +.B EROFS +.I pathname +refers to a directory on a read-only file system. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH BUGS +Infelicities in the protocol underlying NFS can cause the unexpected +disappearance of directories which are still being used. +.SH "SEE ALSO" +.BR rm (1), +.BR rmdir (1), +.BR chdir (2), +.BR chmod (2), +.BR mkdir (2), +.BR rename (2), +.BR unlink (2), +.BR unlinkat (2) diff --git a/original/man2/rt_sigaction.2 b/original/man2/rt_sigaction.2 new file mode 100644 index 00000000..d642d26c --- /dev/null +++ b/original/man2/rt_sigaction.2 @@ -0,0 +1 @@ +.so man2/sigaction.2 diff --git a/original/man2/rt_sigpending.2 b/original/man2/rt_sigpending.2 new file mode 100644 index 00000000..304adff9 --- /dev/null +++ b/original/man2/rt_sigpending.2 @@ -0,0 +1 @@ +.so man2/sigpending.2 diff --git a/original/man2/rt_sigprocmask.2 b/original/man2/rt_sigprocmask.2 new file mode 100644 index 00000000..5eab7ac8 --- /dev/null +++ b/original/man2/rt_sigprocmask.2 @@ -0,0 +1 @@ +.so man2/sigprocmask.2 diff --git a/original/man2/rt_sigqueueinfo.2 b/original/man2/rt_sigqueueinfo.2 new file mode 100644 index 00000000..5e0a14fc --- /dev/null +++ b/original/man2/rt_sigqueueinfo.2 @@ -0,0 +1 @@ +.so man2/sigqueue.2 diff --git a/original/man2/rt_sigreturn.2 b/original/man2/rt_sigreturn.2 new file mode 100644 index 00000000..830b7b99 --- /dev/null +++ b/original/man2/rt_sigreturn.2 @@ -0,0 +1 @@ +.so man2/sigreturn.2 diff --git a/original/man2/rt_sigsuspend.2 b/original/man2/rt_sigsuspend.2 new file mode 100644 index 00000000..96d99c4c --- /dev/null +++ b/original/man2/rt_sigsuspend.2 @@ -0,0 +1 @@ +.so man2/sigsuspend.2 diff --git a/original/man2/rt_sigtimedwait.2 b/original/man2/rt_sigtimedwait.2 new file mode 100644 index 00000000..ca098e5f --- /dev/null +++ b/original/man2/rt_sigtimedwait.2 @@ -0,0 +1 @@ +.so man2/sigtimedwait.2 diff --git a/original/man2/sbrk.2 b/original/man2/sbrk.2 new file mode 100644 index 00000000..a3711a53 --- /dev/null +++ b/original/man2/sbrk.2 @@ -0,0 +1 @@ +.so man2/brk.2 diff --git a/original/man2/sched_get_priority_max.2 b/original/man2/sched_get_priority_max.2 new file mode 100644 index 00000000..d5bc3007 --- /dev/null +++ b/original/man2/sched_get_priority_max.2 @@ -0,0 +1,112 @@ +.\" 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 +.\" +.TH SCHED_GET_PRIORITY_MAX 2 2006-03-23 "Linux" "Linux Programmer's Manual" +.SH NAME +sched_get_priority_max, sched_get_priority_min \- get static priority range +.SH SYNOPSIS +.B #include +.sp +.BI "int sched_get_priority_max(int " policy ); +.sp +.BI "int sched_get_priority_min(int " policy ); +.SH DESCRIPTION +.BR sched_get_priority_max () +returns the maximum priority value that can be used with the +scheduling algorithm identified by \fIpolicy\fP. +.BR sched_get_priority_min () +returns the minimum priority value that can be used with the +scheduling algorithm identified by \fIpolicy\fP. +Supported \fIpolicy\fP +values are +.BR SCHED_FIFO , +.BR SCHED_RR , +.BR SCHED_OTHER , +and +.BR SCHED_BATCH . +Further details about these policies can be found in +.BR sched_setscheduler (2). + +Processes with numerically higher priority values are scheduled before +processes with numerically lower priority values. +Thus, the value +returned by +.BR sched_get_priority_max () +will be greater than the +value returned by +.BR sched_get_priority_min (). + +Linux allows the static priority value range 1 to 99 for +\fBSCHED_FIFO\fP and \fBSCHED_RR\fP and the priority 0 for +\fBSCHED_OTHER\fP and \fBSCHED_BATCH\fP. +Scheduling priority ranges for the various policies +are not alterable. + +The range of scheduling priorities may vary on other POSIX systems, +thus it is a good idea for portable applications to use a virtual +priority range and map it to the interval given by +.BR sched_get_priority_max () +and +.BR sched_get_priority_min (). +POSIX.1-2001 requires a spread of at least 32 between the maximum and the +minimum values for \fBSCHED_FIFO\fP and \fBSCHED_RR\fP. + +POSIX systems on which +.BR sched_get_priority_max () +and +.BR sched_get_priority_min () +are available define +.B _POSIX_PRIORITY_SCHEDULING +in \fI\fP. +.SH "RETURN VALUE" +On success, +.BR sched_get_priority_max () +and +.BR sched_get_priority_min () +return the maximum/minimum priority value for the named scheduling +policy. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +The argument \fIpolicy\fP does not identify a defined scheduling policy. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH "SEE ALSO" +.BR sched_getaffinity (2), +.BR sched_getparam (2), +.BR sched_getscheduler (2), +.BR sched_setaffinity (2), +.BR sched_setparam (2), +.BR sched_setscheduler (2) +.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/original/man2/sched_get_priority_min.2 b/original/man2/sched_get_priority_min.2 new file mode 100644 index 00000000..17b99f0e --- /dev/null +++ b/original/man2/sched_get_priority_min.2 @@ -0,0 +1 @@ +.so man2/sched_get_priority_max.2 diff --git a/original/man2/sched_getaffinity.2 b/original/man2/sched_getaffinity.2 new file mode 100644 index 00000000..f376c11f --- /dev/null +++ b/original/man2/sched_getaffinity.2 @@ -0,0 +1 @@ +.so man2/sched_setaffinity.2 diff --git a/original/man2/sched_getparam.2 b/original/man2/sched_getparam.2 new file mode 100644 index 00000000..d39facd9 --- /dev/null +++ b/original/man2/sched_getparam.2 @@ -0,0 +1 @@ +.so man2/sched_setparam.2 diff --git a/original/man2/sched_getscheduler.2 b/original/man2/sched_getscheduler.2 new file mode 100644 index 00000000..13aa8279 --- /dev/null +++ b/original/man2/sched_getscheduler.2 @@ -0,0 +1 @@ +.so man2/sched_setscheduler.2 diff --git a/original/man2/sched_rr_get_interval.2 b/original/man2/sched_rr_get_interval.2 new file mode 100644 index 00000000..22119157 --- /dev/null +++ b/original/man2/sched_rr_get_interval.2 @@ -0,0 +1,124 @@ +.\" 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 +.\" +.TH SCHED_RR_GET_INTERVAL 2 2007-04-06 "Linux" "Linux Programmer's Manual" +.SH NAME +sched_rr_get_interval \- get the SCHED_RR interval for the named process +.SH SYNOPSIS +.B #include +.sp +.BI "int sched_rr_get_interval(pid_t " pid ", struct timespec * " tp ); +.SH DESCRIPTION +.BR sched_rr_get_interval () +writes into the \fItimespec\fP structure pointed to by \fItp\fP the +round-robin time quantum for the process identified by \fIpid\fP. + +The \fItimespec\fP structure has the following form: + +.in +4n +.nf +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.fi +.in + +If +\fIpid\fP is zero, the time quantum for the calling process is written +into \fI*tp\fP. +The identified process should be running under the +.B SCHED_RR +scheduling policy. +.\" 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. +.\" +.\" The round-robin time quantum value is not alterable under Linux +.\" 1.3.81. +.\" +POSIX systems on which +.BR sched_rr_get_interval () +is available define +.B _POSIX_PRIORITY_SCHEDULING +in \fI\fP. +.SH "RETURN VALUE" +On success, +.BR sched_rr_get_interval () +returns 0. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +Problem with copying information to userspace. +.TP +.B EINVAL +Invalid pid. +.TP +.B ENOSYS +The system call is not yet implemented (only on rather old kernels). +.TP +.B ESRCH +The process whose ID is \fIpid\fP could not be found. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +.SS Linux Notes +.\" 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. +POSIX does not specify any mechanism for controlling the size of the +round-robin time quantum. +However, Linux provides a (nonportable) method of doing this. +The quantum can be controlled by adjusting the process's nice value (see +.BR setpriority (2)). +Assigning a negative (i.e., high) nice value results in a longer quantum; +assigning a positive (i.e., low) nice value results in a shorter quantum. +The default quantum is 0.1 seconds; +the degree to which changing the nice value affects the +quantum has varied somewhat across kernel versions. +.\" .SH BUGS +.\" As of Linux 1.3.81 +.\" .BR sched_rr_get_interval () +.\" returns with error +.\" ENOSYS, because SCHED_RR has not yet been fully implemented and tested +.\" properly. +.SH "SEE ALSO" +.BR sched_setscheduler (2) +has a description of the Linux scheduling scheme. +.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/original/man2/sched_setaffinity.2 b/original/man2/sched_setaffinity.2 new file mode 100644 index 00000000..bc5f9dd9 --- /dev/null +++ b/original/man2/sched_setaffinity.2 @@ -0,0 +1,230 @@ +.\" man2/sched_setaffinity.2 - sched_setaffinity and sched_getaffinity man page +.\" +.\" Copyright (C) 2002 Robert Love +.\" and Copyright (C) 2006 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. +.\" +.\" 2002-11-19 Robert Love - initial version +.\" 2004-04-20 mtk - fixed description of return value +.\" 2004-04-22 aeb - added glibc prototype history +.\" 2005-05-03 mtk - noted that sched_setaffinity may cause thread +.\" migration and that CPU affinity is a per-thread attribute. +.\" 2006-02-03 mtk -- Major rewrite +.\" 2008-11-12, mtk, removed CPU_*() macro descriptions to a +.\" separate CPU_SET(3) page. +.\" +.TH SCHED_SETAFFINITY 2 2008-11-14 "Linux" "Linux Programmer's Manual" +.SH NAME +sched_setaffinity, sched_getaffinity \- \ +set and get a process's CPU affinity mask +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int sched_setaffinity(pid_t " pid ", size_t " cpusetsize , +.BI " cpu_set_t *" mask ); +.sp +.BI "int sched_getaffinity(pid_t " pid ", size_t " cpusetsize , +.BI " cpu_set_t *" mask ); +.fi +.SH DESCRIPTION +A process's CPU affinity mask determines the set of CPUs on which +it is eligible to run. +On a multiprocessor system, setting the CPU affinity mask +can be used to obtain performance benefits. +For example, +by dedicating one CPU to a particular process +(i.e., setting the affinity mask of that process to specify a single CPU, +and setting the affinity mask of all other processes to exclude that CPU), +it is possible to ensure maximum execution speed for that process. +Restricting a process to run on a single CPU also avoids +the performance cost caused by the cache invalidation that occurs +when a process ceases to execute on one CPU and then +recommences execution on a different CPU. + +A CPU affinity mask is represented by the +.I cpu_set_t +structure, a "CPU set", pointed to by +.IR mask . +A set of macros for manipulating CPU sets is described in +.BR CPU_SET (3). + +.BR sched_setaffinity () +sets the CPU affinity mask of the process whose ID is +.I pid +to the value specified by +.IR mask . +If +.I pid +is zero, then the calling process is used. +The argument +.I cpusetsize +is the length (in bytes) of the data pointed to by +.IR mask . +Normally this argument would be specified as +.IR "sizeof(cpu_set_t)" . + +If the process specified by +.I pid +is not currently running on one of the CPUs specified in +.IR mask , +then that process is migrated to one of the CPUs specified in +.IR mask . + +.BR sched_getaffinity () +writes the affinity mask of the process whose ID is +.I pid +into the +.I cpu_set_t +structure pointed to by +.IR mask . +The +.I cpusetsize +argument specifies the size (in bytes) of +.IR mask . +If +.I pid +is zero, then the mask of the calling process is returned. +.SH "RETURN VALUE" +On success, +.BR sched_setaffinity () +and +.BR sched_getaffinity () +return 0. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +A supplied memory address was invalid. +.TP +.B EINVAL +The affinity bit mask +.I mask +contains no processors that are currently physically on the system +and permitted to the process according to any restrictions that +may be imposed by the "cpuset" mechanism described in +.BR cpuset (7). +.TP +.B EINVAL +.RB ( sched_getaffinity () +and, in kernels before 2.6.9, +.BR sched_setaffinity ()) +.I cpusetsize +is smaller than the size of the affinity mask used by the kernel. +.TP +.B EPERM +.RB ( sched_setaffinity ()) +The calling process does not have appropriate privileges. +The caller needs an effective user ID equal to the user ID +or effective user ID of the process identified by +.IR pid , +or it must possess the +.B CAP_SYS_NICE +capability. +.TP +.B ESRCH +The process whose ID is \fIpid\fP could not be found. +.SH VERSIONS +The CPU affinity system calls were introduced in Linux kernel 2.5.8. +The system call wrappers were introduced in glibc 2.3. +Initially, the glibc interfaces included a +.I cpusetsize +argument, typed as +.IR "unsigned int" . +In glibc 2.3.3, the +.I cpusetsize +argument was removed, but was then restored in glibc 2.3.4, with type +.IR size_t . +.SH "CONFORMING TO" +These system calls are Linux-specific. +.SH "NOTES" +After a call to +.BR sched_setaffinity (), +the set of CPUs on which the process will actually run is +the intersection of the set specified in the +.I mask +argument and the set of CPUs actually present on the system. +The system may further restrict the set of CPUs on which the process +runs if the "cpuset" mechanism described in +.BR cpuset (7) +is being used. +These restrictions on the actual set of CPUs on which the process +will run are silently imposed by the kernel. + +.BR sched_setscheduler (2) +has a description of the Linux scheduling scheme. +.PP +The affinity mask is actually a per-thread attribute that can be +adjusted independently for each of the threads in a thread group. +The value returned from a call to +.BR gettid (2) +can be passed in the argument +.IR pid . +Specifying +.I pid +as 0 will set the attribute for the calling thread, +and passing the value returned from a call to +.BR getpid (2) +will set the attribute for the main thread of the thread group. +(If you are using the POSIX threads API, then use +.BR pthread_setaffinity_np (3) +instead of +.BR sched_setaffinity ().) + +A child created via +.BR fork (2) +inherits its parent's CPU affinity mask. +The affinity mask is preserved across an +.BR execve (2). + +This manual page describes the glibc interface for the CPU affinity calls. +The actual system call interface is slightly different, with the +.I mask +being typed as +.IR "unsigned long *" , +reflecting the fact that the underlying implementation of CPU +sets is a simple bit mask. +On success, the raw +.BR sched_getaffinity () +system call returns the size (in bytes) of the +.I cpumask_t +data type that is used internally by the kernel to +represent the CPU set bit mask. +.SH "SEE ALSO" +.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 sched_getcpu (3), +.BR capabilities (7), +.BR pthread_setaffinity_np (3), +.BR cpuset (7) diff --git a/original/man2/sched_setparam.2 b/original/man2/sched_setparam.2 new file mode 100644 index 00000000..07575137 --- /dev/null +++ b/original/man2/sched_setparam.2 @@ -0,0 +1,126 @@ +.\" 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 +.\" Modified 2004-05-27 by Michael Kerrisk +.\" +.TH SCHED_SETPARAM 2 2006-03-23 "Linux" "Linux Programmer's Manual" +.SH NAME +sched_setparam, sched_getparam \- set and get scheduling parameters +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int sched_setparam(pid_t " pid ", const struct sched_param *" param ); +.sp +.BI "int sched_getparam(pid_t " pid ", struct sched_param *" param ); +.sp +\fBstruct sched_param { + ... + int \fIsched_priority\fB; + ... +}; +.fi +.SH DESCRIPTION +.BR sched_setparam () +sets the scheduling parameters associated with the scheduling policy +for the process identified by \fIpid\fP. +If \fIpid\fP is zero, then +the parameters of the calling process are set. +The interpretation of +the argument \fIparam\fP depends on the scheduling +policy of the process identified by +.IR pid . +See +.BR sched_setscheduler (2) +for a description of the scheduling policies supported under Linux. + +.BR sched_getparam () +retrieves the scheduling parameters for the +process identified by \fIpid\fP. +If \fIpid\fP is zero, then the parameters +of the calling process are retrieved. + +.BR sched_setparam () +checks the validity of \fIparam\fP for the scheduling policy of the +process. +The value \fIparam\->sched_priority\fP must lie within the +range given by +.BR sched_get_priority_min (2) +and +.BR sched_get_priority_max (2). + +For a discussion of the privileges and resource limits related to +scheduling priority and policy, see +.BR sched_setscheduler (2). + +POSIX systems on which +.BR sched_setparam () +and +.BR sched_getparam () +are available define +.B _POSIX_PRIORITY_SCHEDULING +in \fI\fP. +.SH "RETURN VALUE" +On success, +.BR sched_setparam () +and +.BR sched_getparam () +return 0. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +The argument \fIparam\fP does not make sense for the current +scheduling policy. +.TP +.B EPERM +The calling process does not have appropriate privileges +(Linux: does not have the +.B CAP_SYS_NICE +capability). +.TP +.B ESRCH +The process whose ID is \fIpid\fP could not be found. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH "SEE ALSO" +.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) +.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/original/man2/sched_setscheduler.2 b/original/man2/sched_setscheduler.2 new file mode 100644 index 00000000..8cdb8f6c --- /dev/null +++ b/original/man2/sched_setscheduler.2 @@ -0,0 +1,483 @@ +.\" 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 +.\" +.TH SCHED_SETSCHEDULER 2 2008-11-06 "Linux" "Linux Programmer's Manual" +.SH NAME +sched_setscheduler, sched_getscheduler \- +set and get scheduling policy/parameters +.SH SYNOPSIS +.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 +.SH DESCRIPTION +.BR sched_setscheduler () +sets both the scheduling policy and the associated parameters for the +process whose ID is specified in \fIpid\fP. +If \fIpid\fP equals zero, the +scheduling policy and parameters of the calling process will be set. +The interpretation of +the argument \fIparam\fP depends on the selected policy. +Currently, Linux supports the following "normal" +(i.e., non-real-time) scheduling policies: +.TP 14 +.BR SCHED_OTHER +the standard round-robin time-sharing policy; +.\" In the 2.6 kernel sources, SCHED_OTHER is actually called +.\" SCHED_NORMAL. +.TP +.BR SCHED_BATCH +for "batch" style execution of processes; and +.TP +.BR SCHED_IDLE +for running +.I very +low priority background jobs. +.PP +The following "real-time" policies are also supported, +for special time-critical applications that need precise control over +the way in which runnable processes are selected for execution: +.TP 14 +.BR SCHED_FIFO +a first-in, first-out policy; and +.TP +.BR SCHED_RR +a round-robin policy. +.PP +The semantics of each of these policies are detailed below. + +.BR sched_getscheduler () +queries the scheduling policy currently applied to the process +identified by \fIpid\fP. +If \fIpid\fP equals zero, the policy of the +calling process will be retrieved. +.\" +.SS Scheduling Policies +The scheduler is the kernel component that decides which runnable process +will be executed by the CPU next. +Each process has an associated scheduling policy and a \fIstatic\fP +scheduling priority, \fIsched_priority\fP; these are the settings +that are modified by +.BR sched_setscheduler (). +The scheduler makes it decisions based on knowledge of the scheduling +policy and static priority of all processes on the system. + +For processes scheduled under one of the normal scheduling policies +(\fBSCHED_OTHER\fP, \fBSCHED_IDLE\fP, \fBSCHED_BATCH\fP), +\fIsched_priority\fP is not used in scheduling +decisions (it must be specified as 0). + +Processes scheduled under one of the real-time policies +(\fBSCHED_FIFO\fP, \fBSCHED_RR\fP) have a +\fIsched_priority\fP value in the range 1 (low) to 99 (high). +(As the numbers imply, real-time processes always have higher priority +than normal processes.) +Note well: POSIX.1-2001 only requires an implementation to support a +minimum 32 distinct priority levels for the real-time policies, +and some systems supply just this minimum. +Portable programs should use +.BR sched_get_priority_min (2) +and +.BR sched_get_priority_max (2) +to find the range of priorities supported for a particular policy. + +Conceptually, the scheduler maintains a list of runnable +processes for each possible \fIsched_priority\fP value. +In order to determine which process runs next, the scheduler looks for +the nonempty list with the highest static priority and selects the +process at the head of this list. + +A process's scheduling policy determines +where it will be inserted into the list of processes +with equal static priority and how it will move inside this list. + +All scheduling is preemptive: if a process with a higher static +priority becomes ready to run, the currently running process +will be preempted and +returned to the wait list for its static priority level. +The scheduling policy only determines the +ordering within the list of runnable processes with equal static +priority. +.SS SCHED_FIFO: First In-First Out scheduling +\fBSCHED_FIFO\fP can only be used with static priorities higher than +0, which means that when a \fBSCHED_FIFO\fP processes becomes runnable, +it will always immediately preempt any currently running +\fBSCHED_OTHER\fP, \fBSCHED_BATCH\fP, or \fBSCHED_IDLE\fP process. +\fBSCHED_FIFO\fP is a simple scheduling +algorithm without time slicing. +For processes scheduled under the +\fBSCHED_FIFO\fP policy, the following rules apply: +.IP * 3 +A \fBSCHED_FIFO\fP process that has been preempted by another process of +higher priority will stay at the head of the list for its priority and +will resume execution as soon as all processes of higher priority are +blocked again. +.IP * +When a \fBSCHED_FIFO\fP process becomes runnable, it +will be inserted at the end of the list for its priority. +.IP * +A call to +.BR sched_setscheduler () +or +.BR sched_setparam (2) +will put the +\fBSCHED_FIFO\fP (or \fBSCHED_RR\fP) process identified by +\fIpid\fP at the start of the list if it was runnable. +As a consequence, it may preempt the currently running process if +it has the same priority. +(POSIX.1-2001 specifies that the process should go to the end +of the list.) +.\" 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 * +A process calling +.BR sched_yield (2) +will be put at the end of the list. +.PP +No other events will move a process +scheduled under the \fBSCHED_FIFO\fP policy in the wait list of +runnable processes with equal static priority. + +A \fBSCHED_FIFO\fP +process runs until either it is blocked by an I/O request, it is +preempted by a higher priority process, or it calls +.BR sched_yield (2). +.SS SCHED_RR: Round Robin scheduling +\fBSCHED_RR\fP is a simple enhancement of \fBSCHED_FIFO\fP. +Everything +described above for \fBSCHED_FIFO\fP also applies to \fBSCHED_RR\fP, +except that each process is only allowed to run for a maximum time +quantum. +If a \fBSCHED_RR\fP process has been running for a time +period equal to or longer than the time quantum, it will be put at the +end of the list for its priority. +A \fBSCHED_RR\fP process that has +been preempted by a higher priority process and subsequently resumes +execution as a running process will complete the unexpired portion of +its round robin time quantum. +The length of the time quantum can be +retrieved using +.BR sched_rr_get_interval (2). +.\" On Linux 2.4, the length of the RR interval is influenced +.\" by the process nice value -- MTK +.\" +.SS SCHED_OTHER: Default Linux time-sharing scheduling +\fBSCHED_OTHER\fP can only be used at static priority 0. +\fBSCHED_OTHER\fP is the standard Linux time-sharing scheduler that is +intended for all processes that do not require the special +real-time mechanisms. +The process to run is chosen from the static +priority 0 list based on a \fIdynamic\fP priority that is determined only +inside this list. +The dynamic priority is based on the nice value (set by +.BR nice (2) +or +.BR setpriority (2)) +and increased for each time quantum the process is ready to run, +but denied to run by the scheduler. +This ensures fair progress among all \fBSCHED_OTHER\fP processes. +.\" +.SS SCHED_BATCH: Scheduling batch processes +(Since Linux 2.6.16.) +\fBSCHED_BATCH\fP can only be used at static priority 0. +This policy is similar to \fBSCHED_OTHER\fP in that it schedules +the process according to its dynamic priority +(based on the nice value). +The difference is that this policy +will cause the scheduler to always assume +that the process is CPU-intensive. +Consequently, the scheduler will apply a small scheduling +penalty with respect to wakeup behaviour, +so that this process is mildly disfavored in scheduling decisions. + +.\" The following paragraph is drawn largely from the text that +.\" accompanied Ingo Molnar's patch for the implementation of +.\" SCHED_BATCH. +This policy is useful for workloads that are noninteractive, +but do not want to lower their nice value, +and for workloads that want a deterministic scheduling policy without +interactivity causing extra preemptions (between the workload's tasks). +.\" +.SS SCHED_IDLE: Scheduling very low priority jobs +(Since Linux 2.6.23.) +\fBSCHED_IDLE\fP can only be used at static priority 0; +the process nice value has no influence for this policy. + +This policy is intended for running jobs at extremely low +priority (lower even than a +19 nice value with the +.B SCHED_OTHER +or +.B SCHED_BATCH +policies). +.\" +.SS Privileges and resource limits +In Linux kernels before 2.6.12, only privileged +.RB ( CAP_SYS_NICE ) +processes can set a nonzero static priority (i.e., set a real-time +scheduling policy). +The only change that an unprivileged process can make is to set the +.B SCHED_OTHER +policy, and this can only be done if the effective user ID of the caller of +.BR sched_setscheduler () +matches the real or effective user ID of the target process +(i.e., the process specified by +.IR pid ) +whose policy is being changed. + +Since Linux 2.6.12, the +.B RLIMIT_RTPRIO +resource limit defines a ceiling on an unprivileged process's +static priority for the +.B SCHED_RR +and +.B SCHED_FIFO +policies. +The rules for changing scheduling policy and priority are as follows: +.IP * 2 +If an unprivileged process has a nonzero +.B RLIMIT_RTPRIO +soft limit, then it can change its scheduling policy and priority, +subject to the restriction that the priority cannot be set to a +value higher than the maximum of its current priority and its +.B RLIMIT_RTPRIO +soft limit. +.IP * +If the +.B RLIMIT_RTPRIO +soft limit is 0, then the only permitted changes are to lower the priority, +or to switch to a non-real-time policy. +.IP * +Subject to the same rules, +another unprivileged process can also make these changes, +as long as the effective user ID of the process making the change +matches the real or effective user ID of the target process. +.IP * +Special rules apply for the +.BR SCHED_IDLE : +an unprivileged process operating under this policy cannot +change its policy, regardless of the value of its +.BR RLIMIT_RTPRIO +resource limit. +.PP +Privileged +.RB ( CAP_SYS_NICE ) +processes ignore the +.B RLIMIT_RTPRIO +limit; as with older kernels, +they can make arbitrary changes to scheduling policy and priority. +See +.BR getrlimit (2) +for further information on +.BR RLIMIT_RTPRIO . +.SS Response time +A blocked high priority process waiting for the I/O has a certain +response time before it is scheduled again. +The device driver writer +can greatly reduce this response time by using a "slow interrupt" +interrupt handler. +.\" as described in +.\" .BR request_irq (9). +.SS Miscellaneous +Child processes inherit the scheduling policy and parameters across a +.BR fork (2). +The scheduling policy and parameters are preserved across +.BR execve (2). + +Memory locking is usually needed for real-time processes to avoid +paging delays; this can be done with +.BR mlock (2) +or +.BR mlockall (2). + +Since a nonblocking infinite loop in a process scheduled under +\fBSCHED_FIFO\fP or \fBSCHED_RR\fP will block all processes with lower +priority forever, a software developer should always keep available on +the console a shell scheduled under a higher static priority than the +tested application. +This will allow an emergency kill of tested +real-time applications that do not block or terminate as expected. +See also the description of the +.BR RLIMIT_RTTIME +resource limit in +.BR getrlimit (2). + +POSIX systems on which +.BR sched_setscheduler () +and +.BR sched_getscheduler () +are available define +.B _POSIX_PRIORITY_SCHEDULING +in \fI\fP. +.SH "RETURN VALUE" +On success, +.BR sched_setscheduler () +returns zero. +On success, +.BR sched_getscheduler () +returns the policy for the process (a nonnegative integer). +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +The scheduling \fIpolicy\fP is not one of the recognized policies, +or \fIparam\fP does not make sense for the \fIpolicy\fP. +.TP +.B EPERM +The calling process does not have appropriate privileges. +.TP +.B ESRCH +The process whose ID is \fIpid\fP could not be found. +.SH "CONFORMING TO" +POSIX.1-2001 (but see BUGS below). +The \fBSCHED_BATCH\fP and \fBSCHED_IDLE\fP policies are Linux-specific. +.SH NOTES +POSIX.1 does not detail the permissions that an unprivileged +process requires in order to call +.BR sched_setscheduler (), +and details vary across systems. +For example, the Solaris 7 manual page says that +the real or effective user ID of the calling process must +match the real user ID or the save set-user-ID of the target process. +.PP +Originally, Standard Linux was intended as a general-purpose operating +system being able to handle background processes, interactive +applications, and less demanding real-time applications (applications that +need to usually meet timing deadlines). +Although the Linux kernel 2.6 +allowed for kernel preemption and the newly introduced O(1) scheduler +ensures that the time needed to schedule is fixed and deterministic +irrespective of the number of active tasks, true real-time computing +was not possible up to kernel version 2.6.17. +.SS Real-time features in the mainline Linux kernel +.\" FIXME . Probably this text will need some minor tweaking +.\" by about the time of 2.6.30; ask Carsten Emde about this then. +From kernel version 2.6.18 onwards, however, Linux is gradually +becoming equipped with real-time capabilities, +most of which are derived from the former +.I realtime-preempt +patches developed by Ingo Molnar, Thomas Gleixner, +Steven Rostedt, and others. +Until the patches have been completely merged into the +mainline kernel +(this is expected to be around kernel version 2.6.30), +they must be installed to achieve the best real-time performance. +These patches are named: +.in +4n +.nf + +patch-\fIkernelversion\fP-rt\fIpatchversion\fP +.fi +.in +.PP +and can be downloaded from +.IR http://www.kernel.org/pub/linux/kernel/projects/rt/ . + +Without the patches and prior to their full inclusion into the mainline +kernel, the kernel configuration offers only the three preemption classes +.BR CONFIG_PREEMPT_NONE , +.BR CONFIG_PREEMPT_VOLUNTARY , +and +.B CONFIG_PREEMPT_DESKTOP +which respectively provide no, some, and considerable +reduction of the worst-case scheduling latency. + +With the patches applied or after their full inclusion into the mainline +kernel, the additional configuration item +.B CONFIG_PREEMPT_RT +becomes available. +If this is selected, Linux is transformed into a regular +real-time operating system. +The FIFO and RR scheduling policies that can be selected using +.BR sched_setscheduler () +are then used to run a process +with true real-time priority and a minimum worst-case scheduling latency. +.SH BUGS +POSIX says that on success, +.BR sched_setscheduler () +should return the previous scheduling policy. +Linux +.BR sched_setscheduler () +does not conform to this requirement, +since it always returns 0 on success. +.SH "SEE ALSO" +.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 +The kernel source file +.I Documentation/scheduler/sched-rt-group.txt +(since kernel 2.6.25). diff --git a/original/man2/sched_yield.2 b/original/man2/sched_yield.2 new file mode 100644 index 00000000..057e6756 --- /dev/null +++ b/original/man2/sched_yield.2 @@ -0,0 +1,84 @@ +.\" 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 +.\" +.TH SCHED_YIELD 2 2008-10-18 "Linux" "Linux Programmer's Manual" +.SH NAME +sched_yield \- yield the processor +.SH SYNOPSIS +.B #include +.sp +.B int sched_yield(void); +.SH DESCRIPTION +.BR sched_yield () +causes the calling thread to relinquish the CPU. +The thread is moved to the end of the queue for its static +priority and a new thread gets to run. +.SH "RETURN VALUE" +On success, +.BR sched_yield () +returns 0. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +In the Linux implementation, +.BR sched_yield () +always succeeds. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +If the calling thread is the only thread in the highest +priority list at that time, +it will continue to run after a call to +.BR sched_yield (). + +POSIX systems on which +.BR sched_yield () +is available define +.B _POSIX_PRIORITY_SCHEDULING +in \fI\fP. + +Strategic calls to +.BR sched_yield () +can improve performance by giving other threads or processes +a chance to run when (heavily) contended resources (e.g., mutexes) +have been released by the caller. +Avoid calling +.BR sched_yield () +unnecessarily or inappropriately +(e.g., when resources needed by other +schedulable threads are still held by the caller), +since doing so will result in unnecessary context switches, +which will degrade system performance. +.SH "SEE ALSO" +.BR sched_setscheduler (2) +for a description of Linux scheduling. +.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/original/man2/security.2 b/original/man2/security.2 new file mode 100644 index 00000000..5d25ea6c --- /dev/null +++ b/original/man2/security.2 @@ -0,0 +1 @@ +.so man2/unimplemented.2 diff --git a/original/man2/select.2 b/original/man2/select.2 new file mode 100644 index 00000000..e6527e3f --- /dev/null +++ b/original/man2/select.2 @@ -0,0 +1,529 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is copyright (C) 1992 Drew Eckhardt, +.\" copyright (C) 1995 Michael Shields. +.\" +.\" 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-05-18 by Jim Van Zandt +.\" Sun Feb 11 14:07:00 MET 1996 Martin Schulze +.\" * layout slightly modified +.\" +.\" Modified Mon Oct 21 23:05:29 EDT 1996 by Eric S. Raymond +.\" Modified Thu Feb 24 01:41:09 CET 2000 by aeb +.\" Modified Thu Feb 9 22:32:09 CET 2001 by bert hubert , aeb +.\" Modified Mon Nov 11 14:35:00 PST 2002 by Ben Woodard +.\" 2005-03-11, mtk, modified pselect() text (it is now a system +.\" call in 2.6.16. +.\" +.TH SELECT 2 2008-12-05 "Linux" "Linux Programmer's Manual" +.SH NAME +select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \- +synchronous I/O multiplexing +.SH SYNOPSIS +.nf +/* According to POSIX.1-2001 */ +.br +.B #include +.sp +/* According to earlier standards */ +.br +.B #include +.br +.B #include +.br +.B #include +.sp +.BI "int select(int " nfds ", fd_set *" readfds ", fd_set *" writefds , +.BI " fd_set *" exceptfds ", struct timeval *" timeout ); +.sp +.BI "void FD_CLR(int " fd ", fd_set *" set ); +.br +.BI "int FD_ISSET(int " fd ", fd_set *" set ); +.br +.BI "void FD_SET(int " fd ", fd_set *" set ); +.br +.BI "void FD_ZERO(fd_set *" set ); +.sp +.B #include +.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 ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR pselect (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.SH DESCRIPTION +.BR select () +and +.BR pselect () +allow a program to monitor multiple file descriptors, +waiting until one or more of the file descriptors become "ready" +for some class of I/O operation (e.g., input possible). +A file descriptor is considered ready if it is possible to +perform the corresponding I/O operation (e.g., +.BR read (2)) +without blocking. +.PP +The operation of +.BR select () +and +.BR pselect () +is identical, with three differences: +.TP +(i) +.BR select () +uses a timeout that is a +.I struct timeval +(with seconds and microseconds), while +.BR pselect () +uses a +.I struct timespec +(with seconds and nanoseconds). +.TP +(ii) +.BR select () +may update the +.I timeout +argument to indicate how much time was left. +.BR pselect () +does not change this argument. +.TP +(iii) +.BR select () +has no +.I sigmask +argument, and behaves as +.BR pselect () +called with NULL +.IR sigmask . +.PP +Three independent sets of file descriptors are watched. +Those listed in +.I readfds +will be watched to see if characters become +available for reading (more precisely, to see if a read will not +block; in particular, a file descriptor is also ready on end-of-file), +those in +.I writefds +will be watched to see if a write will not block, and +those in +.I exceptfds +will be watched for exceptions. +On exit, the sets are modified in place +to indicate which file descriptors actually changed status. +Each of the three file descriptor sets may be specified as NULL +if no file descriptors are to be watched for the corresponding class +of events. +.PP +Four macros are provided to manipulate the sets. +.BR FD_ZERO () +clears a set. +.BR FD_SET () +and +.BR FD_CLR () +respectively add and remove a given file descriptor from a set. +.BR FD_ISSET () +tests to see if a file descriptor is part of the set; +this is useful after +.BR select () +returns. +.PP +.I nfds +is the highest-numbered file descriptor in any of the three sets, plus 1. +.PP +.I timeout +is an upper bound on the amount of time elapsed before +.BR select () +returns. +If both fields of the +.I timeval +stucture are zero, then +.BR select () +returns immediately. +(This is useful for polling.) +If +.I timeout +is NULL (no timeout), +.BR select () +can block indefinitely. +.PP +.I sigmask +is a pointer to a signal mask (see +.BR sigprocmask (2)); +if it is not NULL, then +.BR pselect () +first replaces the current signal mask by the one pointed to by +.IR sigmask , +then does the "select" function, and then restores the original +signal mask. +.PP +Other than the difference in the precision of the +.I timeout +argument, the following +.BR pselect () +call: +.nf + + ready = pselect(nfds, &readfds, &writefds, &exceptfds, + timeout, &sigmask); + +.fi +is equivalent to +.I atomically +executing the following calls: +.nf + + sigset_t origmask; + + sigprocmask(SIG_SETMASK, &sigmask, &origmask); + ready = select(nfds, &readfds, &writefds, &exceptfds, timeout); + sigprocmask(SIG_SETMASK, &origmask, NULL); +.fi +.PP +The reason that +.BR pselect () +is needed is that if one wants to wait for either a signal +or for a file descriptor to become ready, then +an atomic test is needed to prevent race conditions. +(Suppose the signal handler sets a global flag and +returns. +Then a test of this global flag followed by a call of +.BR select () +could hang indefinitely if the signal arrived just after the test +but just before the call. +By contrast, +.BR pselect () +allows one to first block signals, handle the signals that have come in, +then call +.BR pselect () +with the desired +.IR sigmask , +avoiding the race.) +.SS "The timeout" +The time structures involved are defined in +.I +and look like + +.in +4n +.nf +struct timeval { + long tv_sec; /* seconds */ + long tv_usec; /* microseconds */ +}; +.fi +.in + +and + +.in +4n +.nf +struct timespec { + long tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.fi +.in + +(However, see below on the POSIX.1-2001 versions.) +.PP +Some code calls +.BR select () +with all three sets empty, +.I nfds +zero, and a non-NULL +.I timeout +as a fairly portable way to sleep with subsecond precision. +.PP +On Linux, +.BR select () +modifies +.I timeout +to reflect the amount of time not slept; most other implementations +do not do this. +(POSIX.1-2001 permits either behavior.) +This causes problems both when Linux code which reads +.I timeout +is ported to other operating systems, and when code is ported to Linux +that reuses a \fIstruct timeval\fP for multiple +.BR select ()s +in a loop without reinitializing it. +Consider +.I timeout +to be undefined after +.BR select () +returns. +.\" .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. +.SH "RETURN VALUE" +On success, +.BR select () +and +.BR pselect () +return the number of file descriptors contained in the three returned +descriptor sets (that is, the total number of bits that are set in +.IR readfds , +.IR writefds , +.IR exceptfds ) +which may be zero if the timeout expires before anything interesting happens. +On error, \-1 is returned, and +.I errno +is set appropriately; the sets and +.I timeout +become undefined, so do not +rely on their contents after an error. +.SH ERRORS +.TP +.B EBADF +An invalid file descriptor was given in one of the sets. +(Perhaps a file descriptor that was already closed, +or one on which an error has occurred.) +.TP +.B EINTR +A signal was caught; see +.BR signal (7). +.TP +.B EINVAL +.I nfds +is negative or the value contained within +.I timeout +is invalid. +.TP +.B ENOMEM +unable to allocate memory for internal tables. +.SH VERSIONS +.BR pselect () +was added to Linux in kernel 2.6.16. +Prior to this, +.BR pselect () +was emulated in glibc (but see BUGS). +.SH "CONFORMING TO" +.BR select () +conforms to POSIX.1-2001 and +4.4BSD +.RB ( select () +first appeared in 4.2BSD). +Generally portable to/from +non-BSD systems supporting clones of the BSD socket layer (including +System V variants). +However, note that the System V variant typically +sets the timeout variable before exit, but the BSD variant does not. +.PP +.BR pselect () +is defined in POSIX.1g, and in +POSIX.1-2001. +.SH NOTES +An +.I fd_set +is a fixed size buffer. +Executing +.BR FD_CLR () +or +.BR FD_SET () +with a value of +.I fd +that is negative or is equal to or larger than +.B FD_SETSIZE +will result +in undefined behavior. +Moreover, POSIX requires +.I fd +to be a valid file descriptor. + +Concerning the types involved, the classical situation is that +the two fields of a +.I timeval +structure are typed as +.I long +(as shown above), and the structure is defined in +.IR . +The POSIX.1-2001 situation is + +.in +4n +.nf +struct timeval { + time_t tv_sec; /* seconds */ + suseconds_t tv_usec; /* microseconds */ +}; +.fi +.in + +where the structure is defined in +.I +and the data types +.I time_t +and +.I suseconds_t +are defined in +.IR . +.LP +Concerning prototypes, the classical situation is that one should +include +.I +for +.BR select (). +The POSIX.1-2001 situation is that one should include +.I +for +.BR select () +and +.BR pselect (). + +Libc4 and libc5 do not have a +.I +header; under glibc 2.0 and later this header exists. +Under glibc 2.0 it unconditionally gives the wrong prototype for +.BR pselect (). +Under glibc 2.1 to 2.2.1 it gives +.BR pselect () +when +.B _GNU_SOURCE +is defined. +Since glibc 2.2.2 the requirements are as shown in the SYNOPSIS. +.SS "Linux Notes" +The Linux +.BR pselect () +system call modifies its +.I timeout +argument. +However, the glibc wrapper function hides this behavior +by using a local variable for the timeout argument that +is passed to the system call. +Thus, the glibc +.BR pselect () +function does not modify its timeout argument; +this is the behavior required by POSIX.1-2001. +.SH BUGS +Glibc 2.0 provided a version of +.BR pselect () +that did not take a +.I sigmask +argument. + +Since version 2.1, glibc has provided an emulation of +.BR pselect () +that is implemented using +.BR sigprocmask (2) +and +.BR select (). +This implementation remains vulnerable to the very race condition that +.BR pselect () +was designed to prevent. +On systems that lack +.BR pselect (), +reliable (and more portable) signal trapping can be achieved +using the self-pipe trick +(where a signal handler writes a byte to a pipe whose other end +is monitored by +.BR select () +in the main program.) + +Under Linux, +.BR select () +may report a socket file descriptor as "ready for reading", while +nevertheless a subsequent read blocks. +This could for example +happen when data has arrived but upon examination has wrong +checksum and is discarded. +There may be other circumstances +in which a file descriptor is spuriously reported as ready. +.\" Stevens discusses a case where accept can block after select +.\" returns successfully because of an intervening RST from the client. +Thus it may be safer to use +.B O_NONBLOCK +on sockets that should not block. +.\" Maybe the kernel should have returned EIO in such a situation? + +On Linux, +.BR select () +also modifies +.I timeout +if the call is interrupted by a signal handler (i.e., the +.B EINTR +error return). +This is not permitted by POSIX.1-2001. +The Linux +.BR pselect () +system call has the same behavior, +but the glibc wrapper hides this behavior by internally copying the +.I timeout +to a local variable and passing that variable to the system call. +.SH EXAMPLE +.nf +#include +#include +#include +#include +#include + +int +main(void) +{ + fd_set rfds; + struct timeval tv; + int retval; + + /* Watch stdin (fd 0) to see when it has input. */ + FD_ZERO(&rfds); + FD_SET(0, &rfds); + + /* Wait up to five seconds. */ + tv.tv_sec = 5; + tv.tv_usec = 0; + + retval = select(1, &rfds, NULL, NULL, &tv); + /* Don't rely on the value of tv now! */ + + if (retval == \-1) + perror("select()"); + else if (retval) + printf("Data is available now.\\n"); + /* FD_ISSET(0, &rfds) will be true. */ + else + printf("No data within five seconds.\\n"); + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +For a tutorial with discussion and examples, see +.BR select_tut (2). +.LP +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) diff --git a/original/man2/select_tut.2 b/original/man2/select_tut.2 new file mode 100644 index 00000000..d7bcab53 --- /dev/null +++ b/original/man2/select_tut.2 @@ -0,0 +1,835 @@ +.\" This manpage is copyright (C) 2001 Paul Sheer. +.\" +.\" 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. +.\" +.\" very minor changes, aeb +.\" +.\" Modified 5 June 2002, Michael Kerrisk +.\" 2006-05-13, mtk, removed much material that is redundant with select.2 +.\" various other changes +.\" 2008-01-26, mtk, substantial changes and rewrites +.\" +.TH SELECT_TUT 2 2009-01-26 "Linux" "Linux Programmer's Manual" +.SH NAME +select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \- +synchronous I/O multiplexing +.SH SYNOPSIS +.nf +/* According to POSIX.1-2001 */ +.br +.B #include +.sp +/* According to earlier standards */ +.br +.B #include +.br +.B #include +.br +.B #include +.sp +.BI "int select(int " nfds ", fd_set *" readfds ", fd_set *" writefds , +.BI " fd_set *" exceptfds ", struct timeval *" utimeout ); +.sp +.BI "void FD_CLR(int " fd ", fd_set *" set ); +.br +.BI "int FD_ISSET(int " fd ", fd_set *" set ); +.br +.BI "void FD_SET(int " fd ", fd_set *" set ); +.br +.BI "void FD_ZERO(fd_set *" set ); +.sp +.B #include +.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 ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR pselect (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.SH DESCRIPTION +.BR select () +(or +.BR pselect ()) +is used to efficiently monitor multiple file descriptors, +to see if any of them is, or becomes, "ready"; +that is, to see whether I/O becomes possible, +or an "exceptional condition" has occurred on any of the descriptors. + +Its principal arguments are three "sets" of file descriptors: +\fIreadfds\fP, \fIwritefds\fP, and \fIexceptfds\fP. +Each set is declared as type +.IR fd_set , +and its contents can be manipulated with the macros +.BR FD_CLR (), +.BR FD_ISSET (), +.BR FD_SET (), +and +.BR FD_ZERO (). +A newly declared set should first be cleared using +.BR FD_ZERO (). +.BR select () +modifies the contents of the sets according to the rules +described below; after calling +.BR select () +you can test if a file descriptor is still present in a set with the +.BR FD_ISSET () +macro. +.BR FD_ISSET () +returns nonzero if a specified file descriptor is present in a set +and zero if it is not. +.BR FD_CLR () +removes a file descriptor from a set. +.SS Arguments +.TP +\fIreadfds\fP +This set is watched to see if data is available for reading from any of +its file descriptors. +After +.BR select () +has returned, \fIreadfds\fP will be +cleared of all file descriptors except for those that +are immediately available for reading. +.TP +\fIwritefds\fP +This set is watched to see if there is space to write data to any of +its file descriptors. +After +.BR select () +has returned, \fIwritefds\fP will be +cleared of all file descriptors except for those that +are immediately available for writing. +.TP +\fIexceptfds\fP +This set is watched for "exceptional conditions". +In practice, only one such exceptional condition is common: +the availability of \fIout-of-band\fP (OOB) data for reading +from a TCP socket. +See +.BR recv (2), +.BR send (2), +and +.BR tcp (7) +for more details about OOB data. +(One other less common case where +.BR select (2) +indicates an exceptional condition occurs with pseudo-terminals +in packet mode; see +.BR tty_ioctl (4).) +After +.BR select () +has returned, +\fIexceptfds\fP will be cleared of all file descriptors except for those +for which an exceptional condition has occurred. +.TP +\fInfds\fP +This is an integer one more than the maximum of any file descriptor in +any of the sets. +In other words, while adding file descriptors to each of the sets, +you must calculate the maximum integer value of all of them, +then increment this value by one, and then pass this as \fInfds\fP. +.TP +\fIutimeout\fP +This is the longest time +.BR select () +may wait before returning, even if nothing interesting happened. +If this value is passed as NULL, then +.BR select () +blocks indefinitely waiting for a file descriptor to become ready. +\fIutimeout\fP can be set to zero seconds, which causes +.BR select () +to return immediately, with information about the readiness +of file descriptors at the time of the call. +The structure \fIstruct timeval\fP is defined as: +.IP +.in +4n +.nf +struct timeval { + time_t tv_sec; /* seconds */ + long tv_usec; /* microseconds */ +}; +.fi +.in +.TP +\fIntimeout\fP +This argument for +.BR pselect () +has the same meaning as +.IR utimeout , +but +.I "struct timespec" +has nanosecond precision as follows: +.IP +.in +4n +.nf +struct timespec { + long tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.fi +.in +.TP +\fIsigmask\fP +This argument holds a set of signals that the kernel should unblock +(i.e., remove from the signal mask of the calling thread), +while the caller is blocked inside the +.BR pselect () +call (see +.BR sigaddset (3) +and +.BR sigprocmask (2)). +It may be NULL, +in which case the call does not modify the signal mask on +entry and exit to the function. +In this case, +.BR pselect () +will then behave just like +.BR select (). +.SS Combining Signal and Data Events +.BR pselect () +is useful if you are waiting for a signal as well as +for file descriptor(s) to become ready for I/O. +Programs that receive signals +normally use the signal handler only to raise a global flag. +The global flag will indicate that the event must be processed +in the main loop of the program. +A signal will cause the +.BR select () +(or +.BR pselect ()) +call to return with \fIerrno\fP set to \fBEINTR\fP. +This behavior is essential so that signals can be processed +in the main loop of the program, otherwise +.BR select () +would block indefinitely. +Now, somewhere +in the main loop will be a conditional to check the global flag. +So we must ask: +what if a signal arrives after the conditional, but before the +.BR select () +call? +The answer is that +.BR select () +would block indefinitely, even though an event is actually pending. +This race condition is solved by the +.BR pselect () +call. +This call can be used to set the signal mask to a set of signals +that are only to be received within the +.BR pselect () +call. +For instance, let us say that the event in question +was the exit of a child process. +Before the start of the main loop, we +would block \fBSIGCHLD\fP using +.BR sigprocmask (2). +Our +.BR pselect () +call would enable +.B SIGCHLD +by using an empty signal mask. +Our program would look like: +.PP +.nf +static volatile sig_atomic_t got_SIGCHLD = 0; + +static void +child_sig_handler(int sig) +{ + got_SIGCHLD = 1; +} + +int +main(int argc, char *argv[]) +{ + sigset_t sigmask, empty_mask; + struct sigaction sa; + fd_set readfds, writefds, exceptfds; + int r; + + sigemptyset(&sigmask); + sigaddset(&sigmask, SIGCHLD); + if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == \-1) { + perror("sigprocmask"); + exit(EXIT_FAILURE); + } + + sa.sa_flags = 0; + sa.sa_handler = child_sig_handler; + sigemptyset(&sa.sa_mask); + if (sigaction(SIGCHLD, &sa, NULL) == \-1) { + perror("sigaction"); + exit(EXIT_FAILURE); + } + + sigemptyset(&empty_mask); + + for (;;) { /* main loop */ + /* Initialize readfds, writefds, and exceptfds + before the pselect() call. (Code omitted.) */ + + r = pselect(nfds, &readfds, &writefds, &exceptfds, + NULL, &empty_mask); + if (r == \-1 && errno != EINTR) { + /* Handle error */ + } + + if (got_SIGCHLD) { + got_SIGCHLD = 0; + + /* Handle signalled event here; e.g., wait() for all + terminated children. (Code omitted.) */ + } + + /* main body of program */ + } +} +.fi +.SS Practical +So what is the point of +.BR select ()? +Can't I just read and write to my descriptors whenever I want? +The point of +.BR select () +is that it watches +multiple descriptors at the same time and properly puts the process to +sleep if there is no activity. +Unix programmers often find +themselves in a position where they have to handle I/O from more than one +file descriptor where the data flow may be intermittent. +If you were to merely create a sequence of +.BR read (2) +and +.BR write (2) +calls, you would +find that one of your calls may block waiting for data from/to a file +descriptor, while another file descriptor is unused though ready for I/O. +.BR select () +efficiently copes with this situation. +.SS Select Law +Many people who try to use +.BR select () +come across behavior that is +difficult to understand and produces nonportable or borderline results. +For instance, the above program is carefully written not to +block at any point, even though it does not set its file descriptors to +nonblocking mode. +It is easy to introduce +subtle errors that will remove the advantage of using +.BR select (), +so here is a list of essentials to watch for when using +.BR select (). +.TP 4 +1. +You should always try to use +.BR select () +without a timeout. +Your program +should have nothing to do if there is no data available. +Code that +depends on timeouts is not usually portable and is difficult to debug. +.TP +2. +The value \fInfds\fP must be properly calculated for efficiency as +explained above. +.TP +3. +No file descriptor must be added to any set if you do not intend +to check its result after the +.BR select () +call, and respond appropriately. +See next rule. +.TP +4. +After +.BR select () +returns, all file descriptors in all sets +should be checked to see if they are ready. +.TP +5. +The functions +.BR read (2), +.BR recv (2), +.BR write (2), +and +.BR send (2) +do \fInot\fP necessarily read/write the full amount of data +that you have requested. +If they do read/write the full amount, it's +because you have a low traffic load and a fast stream. +This is not always going to be the case. +You should cope with the case of your +functions only managing to send or receive a single byte. +.TP +6. +Never read/write only in single bytes at a time unless you are really +sure that you have a small amount of data to process. +It is extremely +inefficient not to read/write as much data as you can buffer each time. +The buffers in the example below are 1024 bytes although they could +easily be made larger. +.TP +7. +The functions +.BR read (2), +.BR recv (2), +.BR write (2), +and +.BR send (2) +as well as the +.BR select () +call can return \-1 with +.I errno +set to \fBEINTR\fP, +or with +.I errno +set to \fBEAGAIN\fP (\fBEWOULDBLOCK\fP). +These results must be properly managed (not done properly above). +If your program is not going to receive any signals, then +it is unlikely you will get \fBEINTR\fP. +If your program does not set nonblocking I/O, +you will not get \fBEAGAIN\fP. +.\" Nonetheless, you should still cope with these errors for completeness. +.TP +8. +Never call +.BR read (2), +.BR recv (2), +.BR write (2), +or +.BR send (2) +with a buffer length of zero. +.TP +9. +If the functions +.BR read (2), +.BR recv (2), +.BR write (2), +and +.BR send (2) +fail with errors other than those listed in \fB7.\fP, +or one of the input functions returns 0, indicating end of file, +then you should \fInot\fP pass that descriptor to +.BR select () +again. +In the example below, +I close the descriptor immediately, and then set it to \-1 +to prevent it being included in a set. +.TP +10. +The timeout value must be initialized with each new call to +.BR select (), +since some operating systems modify the structure. +.BR pselect () +however does not modify its timeout structure. +.TP +11. +Since +.BR select () +modifies its file descriptor sets, +if the call is being used in a loop, +then the sets must be reinitialized before each call. +.\" "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 +.\" 11. +.\" I have heard that the Windows socket layer does not cope with OOB data +.\" properly. +.\" It also does not cope with +.\" .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.) +.SS Usleep Emulation +On systems that do not have a +.BR usleep (3) +function, you can call +.BR select () +with a finite timeout and no file descriptors as +follows: +.PP +.nf + struct timeval tv; + tv.tv_sec = 0; + tv.tv_usec = 200000; /* 0.2 seconds */ + select(0, NULL, NULL, NULL, &tv); +.fi +.PP +This is only guaranteed to work on Unix systems, however. +.SH RETURN VALUE +On success, +.BR select () +returns the total number of file descriptors +still present in the file descriptor sets. + +If +.BR select () +timed out, then the return value will be zero. +The file descriptors set should be all +empty (but may not be on some systems). + +A return value of \-1 indicates an error, with \fIerrno\fP being +set appropriately. +In the case of an error, the contents of the returned sets and +the \fIstruct timeout\fP contents are undefined and should not be used. +.BR pselect () +however never modifies \fIntimeout\fP. +.SH NOTES +Generally speaking, +all operating systems that support sockets also support +.BR select (). +.BR select () +can be used to solve +many problems in a portable and efficient way that naive programmers try +to solve in a more complicated manner using +threads, forking, IPCs, signals, memory sharing, and so on. +.PP +The +.BR poll (2) +system call has the same functionality as +.BR select (), +and is somewhat more efficient when monitoring sparse +file descriptor sets. +It is nowadays widely available, but historically was less portable than +.BR select (). +.PP +The Linux-specific +.BR epoll (7) +API provides an interface that is more efficient than +.BR select (2) +and +.BR poll (2) +when monitoring large numbers of file descriptors. +.SH EXAMPLE +Here is an example that better demonstrates the true utility of +.BR select (). +The listing below is a TCP forwarding program that forwards +from one TCP port to another. +.PP +.nf +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int forward_port; + +#undef max +#define max(x,y) ((x) > (y) ? (x) : (y)) + +static int +listen_socket(int listen_port) +{ + struct sockaddr_in a; + int s; + int yes; + + if ((s = socket(AF_INET, SOCK_STREAM, 0)) == \-1) { + perror("socket"); + return \-1; + } + yes = 1; + if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, + (char *) &yes, sizeof(yes)) == \-1) { + perror("setsockopt"); + close(s); + return \-1; + } + memset(&a, 0, sizeof(a)); + a.sin_port = htons(listen_port); + a.sin_family = AF_INET; + if (bind(s, (struct sockaddr *) &a, sizeof(a)) == \-1) { + perror("bind"); + close(s); + return \-1; + } + printf("accepting connections on port %d\\n", listen_port); + listen(s, 10); + return s; +} + +static int +connect_socket(int connect_port, char *address) +{ + struct sockaddr_in a; + int s; + + if ((s = socket(AF_INET, SOCK_STREAM, 0)) == \-1) { + perror("socket"); + close(s); + return \-1; + } + + memset(&a, 0, sizeof(a)); + a.sin_port = htons(connect_port); + a.sin_family = AF_INET; + + if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) { + perror("bad IP address format"); + close(s); + return \-1; + } + + if (connect(s, (struct sockaddr *) &a, sizeof(a)) == \-1) { + perror("connect()"); + shutdown(s, SHUT_RDWR); + close(s); + return \-1; + } + return s; +} + +#define SHUT_FD1 do { \\ + if (fd1 >= 0) { \\ + shutdown(fd1, SHUT_RDWR); \\ + close(fd1); \\ + fd1 = \-1; \\ + } \\ + } while (0) + +#define SHUT_FD2 do { \\ + if (fd2 >= 0) { \\ + shutdown(fd2, SHUT_RDWR); \\ + close(fd2); \\ + fd2 = \-1; \\ + } \\ + } while (0) + +#define BUF_SIZE 1024 + +int +main(int argc, char *argv[]) +{ + int h; + int fd1 = \-1, fd2 = \-1; + char buf1[BUF_SIZE], buf2[BUF_SIZE]; + int buf1_avail, buf1_written; + int buf2_avail, buf2_written; + + if (argc != 4) { + fprintf(stderr, "Usage\\n\\tfwd " + " \\n"); + exit(EXIT_FAILURE); + } + + signal(SIGPIPE, SIG_IGN); + + forward_port = atoi(argv[2]); + + h = listen_socket(atoi(argv[1])); + if (h == \-1) + exit(EXIT_FAILURE); + + for (;;) { + int r, nfds = 0; + fd_set rd, wr, er; + + FD_ZERO(&rd); + FD_ZERO(&wr); + FD_ZERO(&er); + FD_SET(h, &rd); + nfds = max(nfds, h); + if (fd1 > 0 && buf1_avail < BUF_SIZE) { + FD_SET(fd1, &rd); + nfds = max(nfds, fd1); + } + if (fd2 > 0 && buf2_avail < BUF_SIZE) { + FD_SET(fd2, &rd); + nfds = max(nfds, fd2); + } + if (fd1 > 0 && buf2_avail \- buf2_written > 0) { + FD_SET(fd1, &wr); + nfds = max(nfds, fd1); + } + if (fd2 > 0 && buf1_avail \- buf1_written > 0) { + FD_SET(fd2, &wr); + nfds = max(nfds, fd2); + } + if (fd1 > 0) { + FD_SET(fd1, &er); + nfds = max(nfds, fd1); + } + if (fd2 > 0) { + FD_SET(fd2, &er); + nfds = max(nfds, fd2); + } + + r = select(nfds + 1, &rd, &wr, &er, NULL); + + if (r == \-1 && errno == EINTR) + continue; + + if (r == \-1) { + perror("select()"); + exit(EXIT_FAILURE); + } + + if (FD_ISSET(h, &rd)) { + unsigned int l; + struct sockaddr_in client_address; + + memset(&client_address, 0, l = sizeof(client_address)); + r = accept(h, (struct sockaddr *) &client_address, &l); + if (r == \-1) { + perror("accept()"); + } else { + SHUT_FD1; + SHUT_FD2; + buf1_avail = buf1_written = 0; + buf2_avail = buf2_written = 0; + fd1 = r; + fd2 = connect_socket(forward_port, argv[3]); + if (fd2 == \-1) + SHUT_FD1; + else + printf("connect from %s\\n", + inet_ntoa(client_address.sin_addr)); + } + } + + /* NB: read oob data before normal reads */ + + if (fd1 > 0) + if (FD_ISSET(fd1, &er)) { + char c; + + r = recv(fd1, &c, 1, MSG_OOB); + if (r < 1) + SHUT_FD1; + else + send(fd2, &c, 1, MSG_OOB); + } + if (fd2 > 0) + if (FD_ISSET(fd2, &er)) { + char c; + + r = recv(fd2, &c, 1, MSG_OOB); + if (r < 1) + SHUT_FD1; + else + send(fd1, &c, 1, MSG_OOB); + } + if (fd1 > 0) + if (FD_ISSET(fd1, &rd)) { + r = read(fd1, buf1 + buf1_avail, + BUF_SIZE \- buf1_avail); + if (r < 1) + SHUT_FD1; + else + buf1_avail += r; + } + if (fd2 > 0) + if (FD_ISSET(fd2, &rd)) { + r = read(fd2, buf2 + buf2_avail, + BUF_SIZE \- buf2_avail); + if (r < 1) + SHUT_FD2; + else + buf2_avail += r; + } + if (fd1 > 0) + if (FD_ISSET(fd1, &wr)) { + r = write(fd1, buf2 + buf2_written, + buf2_avail \- buf2_written); + if (r < 1) + SHUT_FD1; + else + buf2_written += r; + } + if (fd2 > 0) + if (FD_ISSET(fd2, &wr)) { + r = write(fd2, buf1 + buf1_written, + buf1_avail \- buf1_written); + if (r < 1) + SHUT_FD2; + else + buf1_written += r; + } + + /* check if write data has caught read data */ + + if (buf1_written == buf1_avail) + buf1_written = buf1_avail = 0; + if (buf2_written == buf2_avail) + buf2_written = buf2_avail = 0; + + /* one side has closed the connection, keep + writing to the other side until empty */ + + if (fd1 < 0 && buf1_avail \- buf1_written == 0) + SHUT_FD2; + if (fd2 < 0 && buf2_avail \- buf2_written == 0) + SHUT_FD1; + } + exit(EXIT_SUCCESS); +} +.fi +.PP +The above program properly forwards most kinds of TCP connections +including OOB signal data transmitted by \fBtelnet\fP servers. +It handles the tricky problem of having data flow in both directions +simultaneously. +You might think it more efficient to use a +.BR fork (2) +call and devote a thread to each stream. +This becomes more tricky than you might suspect. +Another idea is to set nonblocking I/O using +.BR fcntl (2). +This also has its problems because you end up using +inefficient timeouts. + +The program does not handle more than one simultaneous connection at a +time, although it could easily be extended to do this with a linked list +of buffers \(em one for each connection. +At the moment, new +connections cause the current connection to be dropped. +.SH SEE ALSO +.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) +.\" .SH AUTHORS +.\" This man page was written by Paul Sheer. diff --git a/original/man2/semctl.2 b/original/man2/semctl.2 new file mode 100644 index 00000000..fba8d7de --- /dev/null +++ b/original/man2/semctl.2 @@ -0,0 +1,515 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" and Copyright 2004, 2005 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 Tue Oct 22 17:53:56 1996 by Eric S. Raymond +.\" Modified Fri Jun 19 10:59:15 1998 by Andries Brouwer +.\" Modified Sun Feb 18 01:59:29 2001 by Andries Brouwer +.\" Modified 20 Dec 2001, Michael Kerrisk +.\" Modified 21 Dec 2001, aeb +.\" Modified 27 May 2004, Michael Kerrisk +.\" Added notes on CAP_IPC_OWNER requirement +.\" Modified 17 Jun 2004, Michael Kerrisk +.\" Added notes on CAP_SYS_ADMIN requirement for IPC_SET and IPC_RMID +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Rewrote semun text +.\" Added semid_ds and ipc_perm structure definitions +.\" 2005-08-02, mtk: Added IPC_INFO, SEM_INFO, SEM_STAT descriptions. +.\" +.TH SEMCTL 2 2009-09-27 "Linux" "Linux Programmer's Manual" +.SH NAME +semctl \- semaphore control operations +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.sp +.BI "int semctl(int " semid ", int " semnum ", int " cmd ", ...);" +.fi +.SH DESCRIPTION +.BR semctl () +performs the control operation specified by +.I cmd +on the semaphore set identified by +.IR semid , +or on the +.IR semnum -th +semaphore of that set. +(The semaphores in a set are numbered starting at 0.) +.PP +This function has three or four arguments, depending on +.IR cmd . +When there are four, the fourth has the type +.IR "union semun" . +The \fIcalling program\fP must define this union as follows: + +.nf +.in +4n +union semun { + int val; /* Value for SETVAL */ + struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ + unsigned short *array; /* Array for GETALL, SETALL */ + struct seminfo *__buf; /* Buffer for IPC_INFO + (Linux-specific) */ +}; +.in +.fi +.PP +The +.I semid_ds +data structure is defined in \fI\fP as follows: +.nf +.in +4n + +struct semid_ds { + struct ipc_perm sem_perm; /* Ownership and permissions */ + time_t sem_otime; /* Last semop time */ + time_t sem_ctime; /* Last change time */ + unsigned short sem_nsems; /* No. of semaphores in set */ +}; +.in +.fi +.PP +The +.I ipc_perm +structure is defined in \fI\fP as follows +(the highlighted fields are settable using +.BR IPC_SET ): +.PP +.nf +.in +4n +struct ipc_perm { + key_t __key; /* Key supplied to semget(2) */ + uid_t \fBuid\fP; /* Effective UID of owner */ + gid_t \fBgid\fP; /* Effective GID of owner */ + uid_t cuid; /* Effective UID of creator */ + gid_t cgid; /* Effective GID of creator */ + unsigned short \fBmode\fP; /* Permissions */ + unsigned short __seq; /* Sequence number */ +}; +.in +.fi +.PP +Valid values for +.I cmd +are: +.TP 10 +.B IPC_STAT +Copy information from the kernel data structure associated with +.I semid +into the +.I semid_ds +structure pointed to by +.IR arg.buf . +The argument +.I semnum +is ignored. +The calling process must have read permission on the semaphore set. +.TP +.B IPC_SET +Write the values of some members of the +.I semid_ds +structure pointed to by +.I arg.buf +to the kernel data structure associated with this semaphore set, +updating also its +.I sem_ctime +member. +The following members of the structure are updated: +.IR sem_perm.uid , +.IR sem_perm.gid , +and (the least significant 9 bits of) +.IR sem_perm.mode . +The effective UID of the calling process must match the owner +.RI ( sem_perm.uid ) +or creator +.RI ( sem_perm.cuid ) +of the semaphore set, or the caller must be privileged. +The argument +.I semnum +is ignored. +.TP +.B IPC_RMID +Immediately remove the semaphore set, +awakening all processes blocked in +.BR semop (2) +calls on the set (with an error return and +.I errno +set to +.BR EIDRM ). +The effective user ID of the calling process must +match the creator or owner of the semaphore set, +or the caller must be privileged. +The argument +.I semnum +is ignored. +.TP +.BR IPC_INFO " (Linux-specific)" +Returns information about system-wide semaphore limits and +parameters in the structure pointed to by +.IR arg.__buf . +This structure is of type +.IR seminfo , +defined in +.I +if the +.B _GNU_SOURCE +feature test macro is defined: +.nf +.in +4n + +struct seminfo { + int semmap; /* Number of entries in semaphore + map; unused within kernel */ + int semmni; /* Maximum number of semaphore sets */ + int semmns; /* Maximum number of semaphores in all + semaphore sets */ + int semmnu; /* System-wide maximum number of undo + structures; unused within kernel */ + int semmsl; /* Maximum number of semaphores in a + set */ + int semopm; /* Maximum number of operations for + semop(2) */ + int semume; /* Maximum number of undo entries per + process; unused within kernel */ + int semusz; /* Size of struct sem_undo */ + int semvmx; /* Maximum semaphore value */ + int semaem; /* Max. value that can be recorded for + semaphore adjustment (SEM_UNDO) */ +}; + +.in +.fi +The +.IR semmsl , +.IR semmns , +.IR semopm , +and +.I semmni +settings can be changed via +.IR /proc/sys/kernel/sem ; +see +.BR proc (5) +for details. +.TP +.BR SEM_INFO " (Linux-specific)" +Returns a +.I seminfo +structure containing the same information as for +.BR IPC_INFO , +except that the following fields are returned with information +about system resources consumed by semaphores: the +.I semusz +field returns the number of semaphore sets that currently exist +on the system; and the +.I semaem +field returns the total number of semaphores in all semaphore sets +on the system. +.TP +.BR SEM_STAT " (Linux-specific)" +Returns a +.I semid_ds +structure as for +.BR IPC_STAT . +However, the +.I semid +argument is not a semaphore identifier, but instead an index into +the kernel's internal array that maintains information about +all semaphore sets on the system. +.TP +.B GETALL +Return +.B semval +(i.e., the current value) +for all semaphores of the set into +.IR arg.array . +The argument +.I semnum +is ignored. +The calling process must have read permission on the semaphore set. +.TP +.B GETNCNT +The system call returns the value of +.B semncnt +for the +.IR semnum \-th +semaphore of the set +(i.e., the number of processes waiting for an increase of +.B semval +for the +.IR semnum \-th +semaphore of the set). +The calling process must have read permission on the semaphore set. +.TP +.B GETPID +The system call returns the value of +.B sempid +for the +.IR semnum \-th +semaphore of the set +(i.e., the PID of the process that executed the last +.BR semop (2) +call for the +.IR semnum \-th +semaphore of the set). +The calling process must have read permission on the semaphore set. +.TP +.B GETVAL +The system call returns the value of +.B semval +for the +.IR semnum \-th +semaphore of the set. +The calling process must have read permission on the semaphore set. +.TP +.B GETZCNT +The system call returns the value of +.B semzcnt +for the +.IR semnum \-th +semaphore of the set +(i.e., the number of processes waiting for +.B semval +of the +.IR semnum \-th +semaphore of the set to become 0). +The calling process must have read permission on the semaphore set. +.TP +.B SETALL +Set +.B semval +for all semaphores of the set using +.IR arg.array , +updating also the +.I sem_ctime +member of the +.I semid_ds +structure associated with the set. +Undo entries (see +.BR semop (2)) +are cleared for altered semaphores in all processes. +If the changes to semaphore values would permit blocked +.BR semop (2) +calls in other processes to proceed, then those processes are woken up. +The argument +.I semnum +is ignored. +The calling process must have alter (write) permission on +the semaphore set. +.TP +.B SETVAL +Set the value of +.B semval +to +.I arg.val +for the +.IR semnum \-th +semaphore of the set, updating also the +.I sem_ctime +member of the +.I semid_ds +structure associated with the set. +Undo entries are cleared for altered semaphores in all processes. +If the changes to semaphore values would permit blocked +.BR semop (2) +calls in other processes to proceed, then those processes are woken up. +The calling process must have alter permission on the semaphore set. +.SH "RETURN VALUE" +On failure +.BR semctl () +returns \-1 +with +.I errno +indicating the error. + +Otherwise the system call returns a nonnegative value depending on +.I cmd +as follows: +.TP 12 +.B GETNCNT +the value of +.BR semncnt . +.TP +.B GETPID +the value of +.BR sempid . +.TP +.B GETVAL +the value of +.BR semval . +.TP +.B GETZCNT +the value of +.BR semzcnt . +.TP +.B IPC_INFO +the index of the highest used entry in the +kernel's internal array recording information about all +semaphore sets. +(This information can be used with repeated +.B SEM_STAT +operations to obtain information about all semaphore sets on the system.) +.TP +.B SEM_INFO +As for +.BR IPC_INFO . +.TP +.B SEM_STAT +the identifier of the semaphore set whose index was given in +.IR semid . +.LP +All other +.I cmd +values return 0 on success. +.SH ERRORS +On failure, +.I errno +will be set to one of the following: +.TP +.B EACCES +The argument +.I cmd +has one of the values +.BR GETALL , +.BR GETPID , +.BR GETVAL , +.BR GETNCNT , +.BR GETZCNT , +.BR IPC_STAT , +.BR SEM_STAT , +.BR SETALL , +or +.B SETVAL +and the calling process does not have the required +permissions on the semaphore set and does not have the +.B CAP_IPC_OWNER +capability. +.TP +.B EFAULT +The address pointed to by +.I arg.buf +or +.I arg.array +isn't accessible. +.TP +.B EIDRM +The semaphore set was removed. +.TP +.B EINVAL +Invalid value for +.I cmd +or +.IR semid . +Or: for a +.B SEM_STAT +operation, the index value specified in +.I semid +referred to an array slot that is currently unused. +.TP +.B EPERM +The argument +.I cmd +has the value +.B IPC_SET +or +.B IPC_RMID +but the effective user ID of the calling process is not the creator +(as found in +.IR sem_perm.cuid ) +or the owner +(as found in +.IR sem_perm.uid ) +of the semaphore set, +and the process does not have the +.B CAP_SYS_ADMIN +capability. +.TP +.B ERANGE +The argument +.I cmd +has the value +.B SETALL +or +.B SETVAL +and the value to which +.B semval +is to be set (for some semaphore of the set) is less than 0 +or greater than the implementation limit +.BR SEMVMX . +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.\" SVr4 documents more error conditions EINVAL and EOVERFLOW. +.SH NOTES +The +.BR IPC_INFO , +.B SEM_STAT +and +.B SEM_INFO +operations are used by the +.BR ipcs (8) +program to provide information on allocated resources. +In the future these may modified or moved to a /proc file system +interface. +.LP +Various fields in a \fIstruct semid_ds\fP were typed as +.I short +under Linux 2.2 +and have become +.I long +under Linux 2.4. +To take advantage of this, +a recompilation under glibc-2.1.91 or later should suffice. +(The kernel distinguishes old and new calls by an +.B IPC_64 +flag in +.IR cmd .) +.PP +In some earlier versions of glibc, the +.I semun +union was defined in \fI\fP, but POSIX.1-2001 requires +that the caller define this union. +On versions of glibc where this union is \fInot\fP defined, +the macro +.B _SEM_SEMUN_UNDEFINED +is defined in \fI\fP. +.PP +The following system limit on semaphore sets affects a +.BR semctl () +call: +.TP +.B SEMVMX +Maximum value for +.BR semval : +implementation dependent (32767). +.LP +For greater portability it is best to always call +.BR semctl () +with four arguments. +.SH "SEE ALSO" +.BR ipc (2), +.BR semget (2), +.BR semop (2), +.BR capabilities (7), +.BR sem_overview (7), +.BR svipc (7) diff --git a/original/man2/semget.2 b/original/man2/semget.2 new file mode 100644 index 00000000..7b1ddf09 --- /dev/null +++ b/original/man2/semget.2 @@ -0,0 +1,285 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 Tue Oct 22 17:54:56 1996 by Eric S. Raymond +.\" Modified 1 Jan 2002, Martin Schulze +.\" Modified 4 Jan 2002, Michael Kerrisk +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added notes on /proc files +.\" Rewrote BUGS note about semget()'s failure to initialize +.\" semaphore values +.\" +.TH SEMGET 2 2004-05-27 "Linux" "Linux Programmer's Manual" +.SH NAME +semget \- get a semaphore set identifier +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.fi +.sp +.BI "int semget(key_t " key , +.BI "int " nsems , +.BI "int " semflg ); +.SH DESCRIPTION +The +.BR semget () +system call returns the semaphore set identifier +associated with the argument +.IR key . +A new set of +.I nsems +semaphores is created if +.I key +has the value +.B IPC_PRIVATE +or if no existing semaphore set is associated with +.I key +and +.B IPC_CREAT +is specified in +.IR semflg . +.PP +If +.I semflg +specifies both +.B IPC_CREAT +and +.B IPC_EXCL +and a semaphore set already exists for +.IR key , +then +.BR semget () +fails with +.I errno +set to +.BR EEXIST . +(This is analogous to the effect of the combination +.B O_CREAT | O_EXCL +for +.BR open (2).) +.PP +Upon creation, the least significant 9 bits of the argument +.I semflg +define the permissions (for owner, group and others) +for the semaphore set. +These bits have the same format, and the same +meaning, as the +.I mode +argument of +.BR open (2) +(though the execute permissions are +not meaningful for semaphores, and write permissions mean permission +to alter semaphore values). +.PP +The values of the semaphores in a newly created set are indeterminate. +(POSIX.1-2001 is explicit on this point.) +Although Linux, like many other implementations, +initializes the semaphore values to 0, +a portable application cannot rely on this: +it should explicitly initialize the semaphores to the desired values. +.\" In truth, every one of the many implementations that I've tested sets +.\" the values to zero, but I suppose there is/was some obscure +.\" implementation out there that does not. +.PP +When creating a new semaphore set, +.BR semget () +initializes the set's associated data structure, +.I semid_ds +(see +.BR semctl (2)), +as follows: +.IP +.I sem_perm.cuid +and +.I sem_perm.uid +are set to the effective user ID of the calling process. +.IP +.I sem_perm.cgid +and +.I sem_perm.gid +are set to the effective group ID of the calling process. +.IP +The least significant 9 bits of +.I sem_perm.mode +are set to the least significant 9 bits of +.IR semflg . +.IP +.I sem_nsems +is set to the value of +.IR nsems . +.IP +.I sem_otime +is set to 0. +.IP +.I sem_ctime +is set to the current time. +.PP +The argument +.I nsems +can be 0 +(a don't care) +when a semaphore set is not being created. +Otherwise +.I nsems +must be greater than 0 +and less than or equal to the maximum number of semaphores per semaphore set +.RB ( SEMMSL ). +.PP +If the semaphore set already exists, the permissions are +verified. +.\" and a check is made to see if it is marked for destruction. +.SH "RETURN VALUE" +If successful, the return value will be the semaphore set identifier +(a nonnegative integer), otherwise \-1 +is returned, with +.I errno +indicating the error. +.SH ERRORS +On failure +.I errno +will be set to one of the following: +.TP +.B EACCES +A semaphore set exists for +.IR key , +but the calling process does not have permission to access the set, +and does not have the +.B CAP_IPC_OWNER +capability. +.TP +.B EEXIST +A semaphore set exists for +.I key +and +.I semflg +specified both +.B IPC_CREAT +and +.BR IPC_EXCL . +.\" .TP +.\" .B EIDRM +.\" The semaphore set is marked to be deleted. +.TP +.B EINVAL +.I nsems +is less than 0 or greater than the limit on the number +of semaphores per semaphore set +.RB ( SEMMSL ), +or a semaphore set corresponding to +.I key +already exists, and +.I nsems +is larger than the number of semaphores in that set. +.TP +.B ENOENT +No semaphore set exists for +.I key +and +.I semflg +did not specify +.BR IPC_CREAT . +.TP +.B ENOMEM +A semaphore set has to be created but the system does not have +enough memory for the new data structure. +.TP +.B ENOSPC +A semaphore set has to be created but the system limit for the maximum +number of semaphore sets +.RB ( SEMMNI ), +or the system wide maximum number of semaphores +.RB ( SEMMNS ), +would be exceeded. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.\" SVr4 documents additional error conditions EFBIG, E2BIG, EAGAIN, +.\" ERANGE, EFAULT. +.SH NOTES +.B IPC_PRIVATE +isn't a flag field but a +.I key_t +type. +If this special value is used for +.IR key , +the system call ignores everything but the least significant 9 bits of +.I semflg +and creates a new semaphore set (on success). +.PP +The following limits on semaphore set resources affect the +.BR semget () +call: +.TP +.B SEMMNI +System wide maximum number of semaphore sets: policy dependent +(on Linux, this limit can be read and modified via the fourth field of +.IR /proc/sys/kernel/sem ). +.\" This /proc file is not available in Linux 2.2 and earlier -- MTK +.TP +.B SEMMSL +Maximum number of semaphores per semid: implementation dependent +(on Linux, this limit can be read and modified via the first field of +.IR /proc/sys/kernel/sem ). +.TP +.B SEMMNS +System wide maximum number of semaphores: policy dependent +(on Linux, this limit can be read and modified via the second field of +.IR /proc/sys/kernel/sem ). +Values greater than +.B SEMMSL * SEMMNI +makes it irrelevant. +.SH BUGS +The name choice +.B IPC_PRIVATE +was perhaps unfortunate, +.B IPC_NEW +would more clearly show its function. +.LP +The semaphores in a set are not initialized by +.BR semget (). +.\" In fact they are initialized to zero on Linux, but POSIX.1-2001 +.\" does not specify this, and we can't portably rely on it. +In order to initialize the semaphores, +.BR semctl (2) +must be used to perform a +.B SETVAL +or a +.B SETALL +operation on the semaphore set. +(Where multiple peers do not know who will be the first to +initialize the set, checking for a nonzero +.I sem_otime +in the associated data structure retrieved by a +.BR semctl (2) +.B IPC_STAT +operation can be used to avoid races.) +.SH "SEE ALSO" +.BR semctl (2), +.BR semop (2), +.BR ftok (3), +.BR capabilities (7), +.BR sem_overview (7), +.BR svipc (7) diff --git a/original/man2/semop.2 b/original/man2/semop.2 new file mode 100644 index 00000000..298cac44 --- /dev/null +++ b/original/man2/semop.2 @@ -0,0 +1,520 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 1996-10-22, Eric S. Raymond +.\" Modified 2002-01-08, Michael Kerrisk +.\" Modified 2003-04-28, Ernie Petrides +.\" Modified 2004-05-27, Michael Kerrisk +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added notes on /proc files +.\" 2005-04-08, mtk, Noted kernel version numbers for semtimedop() +.\" 2007-07-09, mtk, Added an EXAMPLE code segment. +.\" +.TH SEMOP 2 2008-10-04 "Linux" "Linux Programmer's Manual" +.SH NAME +semop, semtimedop \- semaphore operations +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.sp +.BI "int semop(int " semid ", struct sembuf *" sops ", unsigned " nsops ); +.sp +.BI "int semtimedop(int " semid ", struct sembuf *" sops ", unsigned " nsops , +.BI " struct timespec *" timeout ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR semtimedop (): +_GNU_SOURCE +.SH DESCRIPTION +Each semaphore in a semaphore set has the following associated values: +.sp +.in +4n +.nf +unsigned short semval; /* semaphore value */ +unsigned short semzcnt; /* # waiting for zero */ +unsigned short semncnt; /* # waiting for increase */ +pid_t sempid; /* process that did last op */ +.sp +.in -4n +.fi +.BR semop () +performs operations on selected semaphores in the set indicated by +.IR semid . +Each of the +.I nsops +elements in the array pointed to by +.I sops +specifies an operation to be performed on a single semaphore. +The elements of this structure are of type +.IR "struct sembuf" , +containing the following members: +.sp +.in +4n +.nf +unsigned short sem_num; /* semaphore number */ +short sem_op; /* semaphore operation */ +short sem_flg; /* operation flags */ +.sp +.in -4n +.fi +Flags recognized in +.I sem_flg +are +.B IPC_NOWAIT +and +.BR SEM_UNDO . +If an operation specifies +.BR SEM_UNDO , +it will be automatically undone when the process terminates. +.PP +The set of operations contained in +.I sops +is performed in +.IR "array order" , +and +.IR atomically , +that is, the operations are performed either as a complete unit, +or not at all. +The behavior of the system call if not all operations can be +performed immediately depends on the presence of the +.B IPC_NOWAIT +flag in the individual +.I sem_flg +fields, as noted below. + +Each operation is performed on the +.IR sem_num \-th +semaphore of the semaphore set, where the first semaphore of the set +is numbered 0. +There are three types of operation, distinguished by the value of +.IR sem_op . +.PP +If +.I sem_op +is a positive integer, the operation adds this value to +the semaphore value +.RI ( semval ). +Furthermore, if +.B SEM_UNDO +is specified for this operation, the system updates the process undo count +.RI ( semadj ) +for this semaphore. +This operation can always proceed \(em it never forces a process to wait. +The calling process must have alter permission on the semaphore set. +.PP +If +.I sem_op +is zero, the process must have read permission on the semaphore +set. +This is a "wait-for-zero" operation: if +.I semval +is zero, the operation can immediately proceed. +Otherwise, if +.B IPC_NOWAIT +is specified in +.IR sem_flg , +.BR semop () +fails with +.I errno +set to +.B EAGAIN +(and none of the operations in +.I sops +is performed). +Otherwise +.I semzcnt +(the count of processes waiting until this semaphore's value becomes zero) +is incremented by one and the process sleeps until +one of the following occurs: +.IP \(bu 3 +.I semval +becomes 0, at which time the value of +.I semzcnt +is decremented. +.IP \(bu +The semaphore set +is removed: +.BR semop () +fails, with +.I errno +set to +.BR EIDRM . +.IP \(bu +The calling process catches a signal: +the value of +.I semzcnt +is decremented and +.BR semop () +fails, with +.I errno +set to +.BR EINTR . +.IP \(bu +The time limit specified by +.I timeout +in a +.BR semtimedop () +call expires: +.BR semop () +fails, with +.I errno +set to +.BR EAGAIN . +.PP +If +.I sem_op +is less than zero, the process must have alter permission on the +semaphore set. +If +.I semval +is greater than or equal to the absolute value of +.IR sem_op , +the operation can proceed immediately: +the absolute value of +.I sem_op +is subtracted from +.IR semval , +and, if +.B SEM_UNDO +is specified for this operation, the system updates the process undo count +.RI ( semadj ) +for this semaphore. +If the absolute value of +.I sem_op +is greater than +.IR semval , +and +.B IPC_NOWAIT +is specified in +.IR sem_flg , +.BR semop () +fails, with +.I errno +set to +.B EAGAIN +(and none of the operations in +.I sops +is performed). +Otherwise +.I semncnt +(the counter of processes waiting for this semaphore's value to increase) +is incremented by one and the process sleeps until +one of the following occurs: +.IP \(bu 3 +.I semval +becomes greater than or equal to the absolute value of +.IR sem_op , +at which time the value of +.I semncnt +is decremented, the absolute value of +.I sem_op +is subtracted from +.I semval +and, if +.B SEM_UNDO +is specified for this operation, the system updates the process undo count +.RI ( semadj ) +for this semaphore. +.IP \(bu +The semaphore set is removed from the system: +.BR semop () +fails, with +.I errno +set to +.BR EIDRM . +.IP \(bu +The calling process catches a signal: +the value of +.I semncnt +is decremented and +.BR semop () +fails, with +.I errno +set to +.BR EINTR . +.IP \(bu +The time limit specified by +.I timeout +in a +.BR semtimedop () +call expires: the system call fails, with +.I errno +set to +.BR EAGAIN . +.PP +On successful completion, the +.I sempid +value for each semaphore specified in the array pointed to by +.I sops +is set to the process ID of the calling process. +In addition, the +.I sem_otime +.\" and +.\" .I sem_ctime +is set to the current time. +.PP +.BR semtimedop () +behaves identically to +.BR semop () +except that in those cases were the calling process would sleep, +the duration of that sleep is limited by the amount of elapsed +time specified by the +.I timespec +structure whose address is passed in the +.I timeout +argument. +If the specified time limit has been reached, +.BR semtimedop () +fails with +.I errno +set to +.B EAGAIN +(and none of the operations in +.I sops +is performed). +If the +.I timeout +argument is NULL, +then +.BR semtimedop () +behaves exactly like +.BR semop (). +.SH "RETURN VALUE" +If successful +.BR semop () +and +.BR semtimedop () +return 0; +otherwise they return \-1 +with +.I errno +indicating the error. +.SH ERRORS +On failure, +.I errno +is set to one of the following: +.TP +.B E2BIG +The argument +.I nsops +is greater than +.BR SEMOPM , +the maximum number of operations allowed per system +call. +.TP +.B EACCES +The calling process does not have the permissions required +to perform the specified semaphore operations, +and does not have the +.B CAP_IPC_OWNER +capability. +.TP +.B EAGAIN +An operation could not proceed immediately and either +.B IPC_NOWAIT +was specified in +.I sem_flg +or the time limit specified in +.I timeout +expired. +.TP +.B EFAULT +An address specified in either the +.I sops +or the +.I timeout +argument isn't accessible. +.TP +.B EFBIG +For some operation the value of +.I sem_num +is less than 0 or greater than or equal to the number +of semaphores in the set. +.TP +.B EIDRM +The semaphore set was removed. +.TP +.B EINTR +While blocked in this system call, the process caught a signal; see +.BR signal (7). +.TP +.B EINVAL +The semaphore set doesn't exist, or +.I semid +is less than zero, or +.I nsops +has a nonpositive value. +.TP +.B ENOMEM +The +.I sem_flg +of some operation specified +.B SEM_UNDO +and the system does not have enough memory to allocate the undo +structure. +.TP +.B ERANGE +For some operation +.I sem_op+semval +is greater than +.BR SEMVMX , +the implementation dependent maximum value for +.IR semval . +.SH VERSIONS +.BR semtimedop () +first appeared in Linux 2.5.52, +and was subsequently backported into kernel 2.4.22. +Glibc support for +.BR semtimedop () +first appeared in version 2.3.3. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.\" SVr4 documents additional error conditions EINVAL, EFBIG, ENOSPC. +.SH NOTES +The +.I sem_undo +structures of a process aren't inherited by the child produced by +.BR fork (2), +but they are inherited across an +.BR execve (2) +system call. +.PP +.BR semop () +is never automatically restarted after being interrupted by a signal handler, +regardless of the setting of the +.B SA_RESTART +flag when establishing a signal handler. +.PP +.I semadj +is a per-process integer which is simply the (negative) count +of all semaphore operations performed specifying the +.B SEM_UNDO +flag. +When a semaphore's value is directly set using the +.B SETVAL +or +.B SETALL +request to +.BR semctl (2), +the corresponding +.I semadj +values in all processes are cleared. +.PP +The \fIsemval\fP, \fIsempid\fP, \fIsemzcnt\fP, and \fIsemnct\fP values +for a semaphore can all be retrieved using appropriate +.BR semctl (2) +calls. +.PP +The following limits on semaphore set resources affect the +.BR semop () +call: +.TP +.B SEMOPM +Maximum number of operations allowed for one +.BR semop () +call (32) +(on Linux, this limit can be read and modified via the third field of +.IR /proc/sys/kernel/sem ). +.\" This /proc file is not available in Linux 2.2 and earlier -- MTK +.TP +.B SEMVMX +Maximum allowable value for +.IR semval : +implementation dependent (32767). +.PP +The implementation has no intrinsic limits for +the adjust on exit maximum value +.RB ( SEMAEM ), +the system wide maximum number of undo structures +.RB ( SEMMNU ) +and the per-process maximum number of undo entries system parameters. +.SH BUGS +When a process terminates, its set of associated +.I semadj +structures is used to undo the effect of all of the +semaphore operations it performed with the +.B SEM_UNDO +flag. +This raises a difficulty: if one (or more) of these semaphore adjustments +would result in an attempt to decrease a semaphore's value below zero, +what should an implementation do? +One possible approach would be to block until all the semaphore +adjustments could be performed. +This is however undesirable since it could force process termination to +block for arbitrarily long periods. +Another possibility is that such semaphore adjustments could be ignored +altogether (somewhat analogously to failing when +.B IPC_NOWAIT +is specified for a semaphore operation). +Linux adopts a third approach: decreasing the semaphore value +as far as possible (i.e., to zero) and allowing process +termination to proceed immediately. + +In kernels 2.6.x, x <= 10, there is a bug that in some circumstances +prevents a process that is waiting for a semaphore value to become +zero from being woken up when the value does actually become zero. +This bug is fixed in kernel 2.6.11. +.\" The bug report: +.\" http://marc.theaimsgroup.com/?l=linux-kernel&m=110260821123863&w=2 +.\" the fix: +.\" http://marc.theaimsgroup.com/?l=linux-kernel&m=110261701025794&w=2 +.SH EXAMPLE +The following code segment uses +.BR semop () +to atomically wait for the value of semaphore 0 to become zero, +and then increment the semaphore value by one. +.nf + + struct sembuf sops[2]; + int semid; + + /* Code to set \fIsemid\fP omitted */ + + sops[0].sem_num = 0; /* Operate on semaphore 0 */ + sops[0].sem_op = 0; /* Wait for value to equal 0 */ + sops[0].sem_flg = 0; + + sops[1].sem_num = 0; /* Operate on semaphore 0 */ + sops[1].sem_op = 1; /* Increment value by one */ + sops[1].sem_flg = 0; + + if (semop(semid, sops, 2) == \-1) { + perror("semop"); + exit(EXIT_FAILURE); + } +.fi +.SH "SEE ALSO" +.BR semctl (2), +.BR semget (2), +.BR sigaction (2), +.BR capabilities (7), +.BR sem_overview (7), +.BR svipc (7), +.BR time (7) diff --git a/original/man2/semtimedop.2 b/original/man2/semtimedop.2 new file mode 100644 index 00000000..8a406187 --- /dev/null +++ b/original/man2/semtimedop.2 @@ -0,0 +1 @@ +.so man2/semop.2 diff --git a/original/man2/send.2 b/original/man2/send.2 new file mode 100644 index 00000000..c99b77aa --- /dev/null +++ b/original/man2/send.2 @@ -0,0 +1,425 @@ +.\" 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. +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified Oct 1998 by Andi Kleen +.\" Modified Oct 2003 by aeb +.\" Modified 2004-07-01 by mtk +.\" +.TH SEND 2 2009-02-23 "Linux" "Linux Programmer's Manual" +.SH NAME +send, sendto, sendmsg \- send a message on a socket +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "ssize_t send(int " sockfd ", const void *" buf ", size_t " len \ +", int " flags ); + +.BI "ssize_t sendto(int " sockfd ", const void *" buf ", size_t " len \ +", int " flags , +.BI " const struct sockaddr *" dest_addr ", socklen_t " addrlen ); + +.BI "ssize_t sendmsg(int " sockfd ", const struct msghdr *" msg \ +", int " flags ); +.fi +.SH DESCRIPTION +The system calls +.BR send (), +.BR sendto (), +and +.BR sendmsg () +are used to transmit a message to another socket. +.PP +The +.BR send () +call may be used only when the socket is in a +.I connected +state (so that the intended recipient is known). +The only difference between +.BR send () +and +.BR write (2) +is the presence of +.IR flags . +With zero +.I flags +argument, +.BR send () +is equivalent to +.BR write (2). +Also, the following call + + send(sockfd, buf, len, flags); + +is equivalent to + + sendto(sockfd, buf, len, flags, NULL, 0); +.PP +The argument +.I sockfd +is the file descriptor of the sending socket. +.PP +If +.BR sendto () +is used on a connection-mode +.RB ( SOCK_STREAM , +.BR SOCK_SEQPACKET ) +socket, the arguments +.I dest_addr +and +.I addrlen +are ignored (and the error +.B EISCONN +may be returned when they are +not NULL and 0), and the error +.B ENOTCONN +is returned when the socket was not actually connected. +Otherwise, the address of the target is given by +.I dest_addr +with +.I addrlen +specifying its size. +For +.BR sendmsg (), +the address of the target is given by +.IR msg.msg_name , +with +.I msg.msg_namelen +specifying its size. +.PP +For +.BR send () +and +.BR sendto (), +the message is found in +.I buf +and has length +.IR len . +For +.BR sendmsg (), +the message is pointed to by the elements of the array +.IR msg.msg_iov . +The +.BR sendmsg () +call also allows sending ancillary data (also known as control information). +.PP +If the message is too long to pass atomically through the +underlying protocol, the error +.B EMSGSIZE +is returned, and the message is not transmitted. +.PP +No indication of failure to deliver is implicit in a +.BR send (). +Locally detected errors are indicated by a return value of \-1. +.PP +When the message does not fit into the send buffer of the socket, +.BR send () +normally blocks, unless the socket has been placed in nonblocking I/O +mode. +In nonblocking mode it would fail with the error +.B EAGAIN +or +.B EWOULDBLOCK +in this case. +The +.BR select (2) +call may be used to determine when it is possible to send more data. +.PP +The +.I flags +argument is the bitwise OR +of zero or more of the following flags. +.\" FIXME ? document MSG_PROXY (which went away in 2.3.15) +.TP +.BR MSG_CONFIRM " (Since Linux 2.3.15)" +Tell the link layer that forward progress happened: you got a successful +reply from the other side. +If the link layer doesn't get this +it will regularly reprobe the neighbor (e.g., via a unicast ARP). +Only valid on +.B SOCK_DGRAM +and +.B SOCK_RAW +sockets and currently only implemented for IPv4 and IPv6. +See +.BR arp (7) +for details. +.TP +.B MSG_DONTROUTE +Don't use a gateway to send out the packet, only send to hosts on +directly connected networks. +This is usually used only +by diagnostic or routing programs. +This is only defined for protocol +families that route; packet sockets don't. +.TP +.BR MSG_DONTWAIT " (since Linux 2.2)" +Enables nonblocking operation; if the operation would block, +.B EAGAIN +or +.B EWOULDBLOCK +is returned (this can also be enabled using the +.B O_NONBLOCK +flag with the +.B F_SETFL +.BR fcntl (2)). +.TP +.BR MSG_EOR " (since Linux 2.2)" +Terminates a record (when this notion is supported, as for sockets of type +.BR SOCK_SEQPACKET ). +.TP +.BR MSG_MORE " (Since Linux 2.4.4)" +The caller has more data to send. +This flag is used with TCP sockets to obtain the same effect +as the +.B TCP_CORK +socket option (see +.BR tcp (7)), +with the difference that this flag can be set on a per-call basis. + +Since Linux 2.6, this flag is also supported for UDP sockets, and informs +the kernel to package all of the data sent in calls with this flag set +into a single datagram which is only transmitted when a call is performed +that does not specify this flag. +(See also the +.B UDP_CORK +socket option described in +.BR udp (7).) +.TP +.BR MSG_NOSIGNAL " (since Linux 2.2)" +Requests not to send +.B SIGPIPE +on errors on stream oriented sockets when the other end breaks the +connection. +The +.B EPIPE +error is still returned. +.TP +.B MSG_OOB +Sends +.I out-of-band +data on sockets that support this notion (e.g., of type +.BR SOCK_STREAM ); +the underlying protocol must also support +.I out-of-band +data. +.PP +The definition of the +.I msghdr +structure follows. +See +.BR recv (2) +and below for an exact description of its fields. +.in +4n +.nf + +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 */ + socklen_t msg_controllen; /* ancillary data buffer len */ + int msg_flags; /* flags on received message */ +}; +.fi +.in +.PP +You may send control information using the +.I msg_control +and +.I msg_controllen +members. +The maximum control buffer length the kernel can process is limited +per socket by the value in +.IR /proc/sys/net/core/optmem_max ; +see +.BR socket (7). +.\" Still to be documented: +.\" Send file descriptors and user credentials using the +.\" msg_control* fields. +.\" The flags returned in msg_flags. +.SH "RETURN VALUE" +On success, these calls return the number of characters sent. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +These are some standard errors generated by the socket layer. +Additional errors +may be generated and returned from the underlying protocol modules; +see their respective manual pages. +.TP +.B EACCES +(For Unix domain sockets, which are identified by pathname) +Write permission is denied on the destination socket file, +or search permission is denied for one of the directories +the path prefix. +(See +.BR path_resolution (7).) +.TP +.BR EAGAIN " or " EWOULDBLOCK +.\" Actually EAGAIN on Linux +The socket is marked nonblocking and the requested operation +would block. +POSIX.1-2001 allows either error to be returned for this case, +and does not require these constants to have the same value, +so a portable application should check for both possibilities. +.TP +.B EBADF +An invalid descriptor was specified. +.TP +.B ECONNRESET +Connection reset by peer. +.TP +.B EDESTADDRREQ +The socket is not connection-mode, and no peer address is set. +.TP +.B EFAULT +An invalid user space address was specified for an argument. +.TP +.B EINTR +A signal occurred before any data was transmitted; see +.BR signal (7). +.TP +.B EINVAL +Invalid argument passed. +.TP +.B EISCONN +The connection-mode socket was connected already but a +recipient was specified. +(Now either this error is returned, or the recipient specification +is ignored.) +.TP +.B EMSGSIZE +The socket type +.\" (e.g., SOCK_DGRAM ) +requires that message be sent atomically, and the size +of the message to be sent made this impossible. +.TP +.B ENOBUFS +The output queue for a network interface was full. +This generally indicates that the interface has stopped sending, +but may be caused by transient congestion. +(Normally, this does not occur in Linux. +Packets are just silently dropped +when a device queue overflows.) +.TP +.B ENOMEM +No memory available. +.TP +.B ENOTCONN +The socket is not connected, and no target has been given. +.TP +.B ENOTSOCK +The argument +.I sockfd +is not a socket. +.TP +.B EOPNOTSUPP +Some bit in the +.I flags +argument is inappropriate for the socket type. +.TP +.B EPIPE +The local end has been shut down on a connection oriented socket. +In this case the process +will also receive a +.B SIGPIPE +unless +.B MSG_NOSIGNAL +is set. +.SH "CONFORMING TO" +4.4BSD, SVr4, POSIX.1-2001. +These function calls appeared in 4.2BSD. +.LP +POSIX.1-2001 only describes the +.B MSG_OOB +and +.B MSG_EOR +flags. +The +.B MSG_CONFIRM +flag is a Linux extension. +.SH NOTES +The prototypes given above follow the Single Unix Specification, +as glibc2 also does; the +.I flags +argument was \fIint\fP in 4.x BSD, but \fIunsigned int\fP in libc4 and libc5; +the +.I len +argument was \fIint\fP in 4.x BSD and libc4, but \fIsize_t\fP in libc5; +the +.I addrlen +argument was \fIint\fP in 4.x BSD and libc4 and libc5. +See also +.BR accept (2). + +According to POSIX.1-2001, the +.I msg_controllen +field of the +.I msghdr +structure should be typed as +.IR socklen_t , +but glibc currently (2.4) types it as +.IR 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. +.SH BUGS +Linux may return +.B EPIPE +instead of +.BR ENOTCONN . +.SH EXAMPLE +An example of the use of +.BR sendto () +is shown in +.BR getaddrinfo (3). +.SH "SEE ALSO" +.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) diff --git a/original/man2/sendfile.2 b/original/man2/sendfile.2 new file mode 100644 index 00000000..33261932 --- /dev/null +++ b/original/man2/sendfile.2 @@ -0,0 +1,176 @@ +.\" This man page is Copyright (C) 1998 Pawel Krawczyk. +.\" 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. +.\" $Id: sendfile.2,v 1.5 1999/05/18 11:54:11 freitag Exp $ +.\" 2000-11-19 bert hubert : in_fd cannot be socket +.\" +.\" 2004-12-17, mtk +.\" updated description of in_fd and out_fd for 2.6 +.\" Various wording and formatting changes +.\" +.\" 2005-03-31 Martin Pool mmap() improvements +.\" +.TH SENDFILE 2 2010-02-15 "Linux" "Linux Programmer's Manual" +.SH NAME +sendfile \- transfer data between file descriptors +.SH SYNOPSIS +.B #include +.sp +.BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \ + offset ", size_t" " count" ); +.\" The below is too ugly. Comments about glibc versions belong +.\" in the notes, not in the header. +.\" +.\" .B #include +.\" .br +.\" .B #if (__GLIBC__==2 && __GLIBC_MINOR__>=1) || __GLIBC__>2 +.\" .br +.\" .B #include +.\" .br +.\" #else +.\" .br +.\" .B #include +.\" .br +.\" .B /* No system prototype before glibc 2.1. */ +.\" .br +.\" .BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \ +.\" offset ", size_t" " count" ) +.\" .br +.\" .B #endif +.\" +.SH DESCRIPTION +.BR sendfile () +copies data between one file descriptor and another. +Because this copying is done within the kernel, +.BR sendfile () +is more efficient than the combination of +.BR read (2) +and +.BR write (2), +which would require transferring data to and from user space. + +.I in_fd +should be a file descriptor opened for reading and +.I out_fd +should be a descriptor opened for writing. + +If +.I offset +is not NULL, then it points +to a variable holding the file offset from which +.BR sendfile () +will start reading data from +.IR in_fd . +When +.BR sendfile () +returns, this variable +will be set to the offset of the byte following the last byte that was read. +If +.I offset +is not NULL, then +.BR sendfile () +does not modify the current file offset of +.IR in_fd ; +otherwise the current file offset is adjusted to reflect +the number of bytes read from +.IR in_fd . + +If +.I offset +is NULL, then data will be read from +.IR in_fd +starting at the current file offset, +and the file offset will be updated by the call. + +.I count +is the number of bytes to copy between the file descriptors. + +Presently (Linux 2.6.9): +.IR in_fd , +must correspond to a file which supports +.BR mmap (2)-like +operations +(i.e., it cannot be a socket); +and +.I out_fd +must refer to a socket. + +Applications may wish to fall back to +.BR read (2)/ write (2) +in the case where +.BR sendfile () +fails with +.B EINVAL +or +.BR ENOSYS . +.SH "RETURN VALUE" +If the transfer was successful, the number of bytes written to +.I out_fd +is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EAGAIN +Nonblocking I/O has been selected using +.B O_NONBLOCK +and the write would block. +.TP +.B EBADF +The input file was not opened for reading or the output file +was not opened for writing. +.TP +.B EFAULT +Bad address. +.TP +.B EINVAL +Descriptor is not valid or locked, or an +.BR mmap (2)-like +operation is not available for +.IR in_fd . +.TP +.B EIO +Unspecified error while reading from +.IR in_fd . +.TP +.B ENOMEM +Insufficient memory to read from +.IR in_fd . +.SH VERSIONS +.BR sendfile () +is a new feature in Linux 2.2. +The include file +.I +is present since glibc 2.1. +.SH "CONFORMING TO" +Not specified in POSIX.1-2001, or other standards. + +Other Unix systems implement +.BR sendfile () +with different semantics and prototypes. +It should not be used in portable programs. +.SH NOTES +If you plan to use +.BR sendfile () +for sending files to a TCP socket, but need +to send some header data in front of the file contents, you will find +it useful to employ the +.B TCP_CORK +option, described in +.BR tcp (7), +to minimize the number of packets and to tune performance. + +In Linux 2.4 and earlier, +.I out_fd +could refer to a regular file, and +.BR sendfile () +changed the current offset of that file. +.SH "SEE ALSO" +.BR mmap (2), +.BR open (2), +.BR socket (2), +.BR splice (2) + diff --git a/original/man2/sendfile64.2 b/original/man2/sendfile64.2 new file mode 100644 index 00000000..888077b1 --- /dev/null +++ b/original/man2/sendfile64.2 @@ -0,0 +1 @@ +.so man2/sendfile.2 diff --git a/original/man2/sendmsg.2 b/original/man2/sendmsg.2 new file mode 100644 index 00000000..9a61b33b --- /dev/null +++ b/original/man2/sendmsg.2 @@ -0,0 +1 @@ +.so man2/send.2 diff --git a/original/man2/sendto.2 b/original/man2/sendto.2 new file mode 100644 index 00000000..9a61b33b --- /dev/null +++ b/original/man2/sendto.2 @@ -0,0 +1 @@ +.so man2/send.2 diff --git a/original/man2/set_mempolicy.2 b/original/man2/set_mempolicy.2 new file mode 100644 index 00000000..c265d574 --- /dev/null +++ b/original/man2/set_mempolicy.2 @@ -0,0 +1,295 @@ +.\" Copyright 2003,2004 Andi Kleen, SuSE Labs. +.\" and Copyright 2007 Lee Schermerhorn, Hewlett Packard +.\" +.\" 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. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\" 2006-02-03, mtk, substantial wording changes and other improvements +.\" 2007-08-27, Lee Schermerhorn +.\" more precise specification of behavior. +.\" +.TH SET_MEMPOLICY 2 2008-08-15 Linux "Linux Programmer's Manual" +.SH NAME +set_mempolicy \- set default NUMA memory policy for a process and its children +.SH SYNOPSIS +.nf +.B "#include " +.sp +.BI "int set_mempolicy(int " mode ", unsigned long *" nodemask , +.BI " unsigned long " maxnode ); +.sp +Link with \fI\-lnuma\fP. +.fi +.SH DESCRIPTION +.BR set_mempolicy () +sets the NUMA memory policy of the calling process, +which consists of a policy mode and zero or more nodes, +to the values specified by the +.IR mode , +.I nodemask +and +.I maxnode +arguments. + +A NUMA machine has different +memory controllers with different distances to specific CPUs. +The memory policy defines from which node memory is allocated for +the process. + +This system call defines the default policy for the process. +The process policy governs allocation of pages in the process's +address space outside of memory ranges +controlled by a more specific policy set by +.BR mbind (2). +The process default policy also controls allocation of any pages for +memory mapped files mapped using the +.BR mmap (2) +call with the +.B MAP_PRIVATE +flag and that are only read [loaded] from by the process +and of memory mapped files mapped using the +.BR mmap (2) +call with the +.B MAP_SHARED +flag, regardless of the access type. +The policy is only applied when a new page is allocated +for the process. +For anonymous memory this is when the page is first +touched by the application. + +The +.I mode +argument must specify one of +.BR MPOL_DEFAULT , +.BR MPOL_BIND , +.B MPOL_INTERLEAVE +or +.BR MPOL_PREFERRED . +All modes except +.B MPOL_DEFAULT +require the caller to specify via the +.I nodemask +argument one or more nodes. + +The +.I mode +argument may also include an optional +.IR "mode flag" . +The supported +.I "mode flags" +are: +.TP +.BR MPOL_F_STATIC_NODES " (since Linux 2.6.26)" +A nonempty +.I nodemask +specifies physical node ids. +Linux does will not remap the +.I nodemask +when the process moves to a different cpuset context, +nor when the set of nodes allowed by the process's +current cpuset context changes. +.TP +.BR MPOL_F_RELATIVE_NODES " (since Linux 2.6.26)" +A nonempty +.I nodemask +specifies node ids that are relative to the set of +node ids allowed by the process's current cpuset. +.PP +.I nodemask +points to a bit mask of node IDs that contains up to +.I maxnode +bits. +The bit mask size is rounded to the next multiple of +.IR "sizeof(unsigned long)" , +but the kernel will only use bits up to +.IR maxnode . +A NULL value of +.I nodemask +or a +.I maxnode +value of zero specifies the empty set of nodes. +If the value of +.I maxnode +is zero, +the +.I nodemask +argument is ignored. + +Where a +.I nodemask +is required, it must contain at least one node that is on-line, +allowed by the process's current cpuset context, +[unless the +.B MPOL_F_STATIC_NODES +mode flag is specified], +and contains memory. +If the +.B MPOL_F_STATIC_NODES +is set in +.I mode +and a required +.I nodemask +contains no nodes that are allowed by the process's current cpuset context, +the memory policy reverts to +.IR "local allocation" . +This effectively overrides the specified policy until the process's +cpuset context includes one or more of the nodes specified by +.IR nodemask. + +The +.B MPOL_DEFAULT +mode specifies that any nondefault process memory policy be removed, +so that the memory policy "falls back" to the system default policy. +The system default policy is "local allocation"-- +i.e., allocate memory on the node of the CPU that triggered the allocation. +.I nodemask +must be specified as NULL. +If the "local node" contains no free memory, the system will +attempt to allocate memory from a "near by" node. + +The +.B MPOL_BIND +mode defines a strict policy that restricts memory allocation to the +nodes specified in +.IR nodemask . +If +.I nodemask +specifies more than one node, page allocations will come from +the node with the lowest numeric node ID first, until that node +contains no free memory. +Allocations will then come from the node with the next highest +node ID specified in +.I nodemask +and so forth, until none of the specified nodes contain free memory. +Pages will not be allocated from any node not specified in the +.IR nodemask . + +.B MPOL_INTERLEAVE +interleaves page allocations across the nodes specified in +.I nodemask +in numeric node ID order. +This optimizes for bandwidth instead of latency +by spreading out pages and memory accesses to those pages across +multiple nodes. +However, accesses to a single page will still be limited to +the memory bandwidth of a single node. +.\" NOTE: the following sentence doesn't make sense in the context +.\" of set_mempolicy() -- no memory area specified. +.\" To be effective the memory area should be fairly large, +.\" at least 1MB or bigger. + +.B MPOL_PREFERRED +sets the preferred node for allocation. +The kernel will try to allocate pages from this node first +and fall back to "near by" nodes if the preferred node is low on free +memory. +If +.I nodemask +specifies more than one node ID, the first node in the +mask will be selected as the preferred node. +If the +.I nodemask +and +.I maxnode +arguments specify the empty set, then the policy +specifies "local allocation" +(like the system default policy discussed above). + +The process memory policy is preserved across an +.BR execve (2), +and is inherited by child processes created using +.BR fork (2) +or +.BR clone (2). +.SH RETURN VALUE +On success, +.BR set_mempolicy () +returns 0; +on error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EFAULT +Part of all of the memory range specified by +.I nodemask +and +.I maxnode +points outside your accessible address space. +.TP +.B EINVAL +.I mode +is invalid. +Or, +.I mode +is +.B MPOL_DEFAULT +and +.I nodemask +is nonempty, +or +.I mode +is +.B MPOL_BIND +or +.B MPOL_INTERLEAVE +and +.I nodemask +is empty. +Or, +.I maxnode +specifies more than a page worth of bits. +Or, +.I nodemask +specifies one or more node IDs that are +greater than the maximum supported node ID. +Or, none of the node IDs specified by +.I nodemask +are on-line and allowed by the process's current cpuset context, +or none of the specified nodes contain memory. +Or, the +.I mode +argument specified both +.B MPOL_F_STATIC_NODES +and +.BR MPOL_F_RELATIVE_NODES . +.TP +.B ENOMEM +Insufficient kernel memory was available. +.SH VERSIONS +The +.BR set_mempolicy (), +system call was added to the Linux kernel in version 2.6.7. +.SH CONFORMING TO +This system call is Linux-specific. +.SH NOTES +Process policy is not remembered if the page is swapped out. +When such a page is paged back in, it will use the policy of +the process or memory range that is in effect at the time the +page is allocated. + +For information on library support, see +.BR numa (7). +.SH SEE ALSO +.BR get_mempolicy (2), +.BR getcpu (2), +.BR mbind (2), +.BR mmap (2), +.BR numa (3), +.BR cpuset (7), +.BR numa (7), +.BR numactl (8) diff --git a/original/man2/set_thread_area.2 b/original/man2/set_thread_area.2 new file mode 100644 index 00000000..91f3d6b1 --- /dev/null +++ b/original/man2/set_thread_area.2 @@ -0,0 +1,68 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" Author: Kent Yoder +.\" +.TH SET_THREAD_AREA 2 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH NAME +set_thread_area \- Set a Thread Local Storage (TLS) area +.SH "SYNOPSIS" +.B #include +.br +.B #include +.sp +.BI "int set_thread_area(struct user_desc *" u_info ); +.SH "DESCRIPTION" +.BR set_thread_area () +sets an entry in the current thread's Thread Local Storage (TLS) array. +The TLS array entry set by +.BR set_thread_area () +corresponds to the value of +.I u_info\->entry_number +passed in by the user. +If this value is in bounds, +.BR set_thread_area () +copies the TLS descriptor pointed to by +.I u_info +into the thread's TLS array. +.PP +When +.BR set_thread_area () +is passed an +.I entry_number +of \-1, it uses a free TLS entry. +If +.BR set_thread_area () +finds a free TLS entry, the value of +.I u_info\->entry_number +is set upon return to show which entry was changed. +.SH "RETURN VALUE" +.BR set_thread_area () +returns 0 on success, and \-1 on failure, with +.I errno +set appropriately. +.SH "ERRORS" +.TP +.B EINVAL +\fIu_info\->entry_number\fP is out of bounds. +.TP +.B EFAULT +\fIu_info\fP is an invalid pointer. +.TP +.B ESRCH +A free TLS entry could not be located. +.SH "VERSIONS" +A version of +.BR set_thread_area () +first appeared in Linux 2.5.29. +.SH "CONFORMING TO" +.BR set_thread_area () +is Linux-specific and should not be used in programs that are intended +to be portable. +.SH NOTES +Glibc does not provide a wrapper for this system call; +call it using +.BR syscall (2). +.SH "SEE ALSO" +.BR get_thread_area (2) diff --git a/original/man2/set_tid_address.2 b/original/man2/set_tid_address.2 new file mode 100644 index 00000000..133502c0 --- /dev/null +++ b/original/man2/set_tid_address.2 @@ -0,0 +1,93 @@ +.\" Copyright (C) 2004 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. +.\" +.TH SET_TID_ADDRESS 2 2004-09-10 "Linux" "Linux Programmer's Manual" +.SH NAME +set_tid_address \- set pointer to thread ID +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "long set_tid_address(int *" tidptr ); +.fi +.SH DESCRIPTION +The kernel keeps for each process two values called +.I set_child_tid +and +.I clear_child_tid +that are NULL by default. +.SS set_child_tid +If a process is started using +.BR clone (2) +with the +.B CLONE_CHILD_SETTID +flag, +.I set_child_tid +is set to +.IR child_tidptr , +the fifth argument of that system call. +.LP +When +.I set_child_tid +is set, the very first thing the new process does +is writing its PID at this address. +.SS clear_child_tid +If a process is started using +.BR clone (2) +with the +.B CLONE_CHILD_CLEARTID +flag, +.I clear_child_tid +is set to +.IR child_tidptr , +the fifth argument of that system call. +.LP +The system call +.BR set_tid_address () +sets the +.I clear_child_tid +value for the calling process to +.IR tidptr . +.LP +When +.I clear_child_tid +is set, and the process exits, and the process was sharing memory +with other processes or threads, then 0 is written at this address, +and a +.I futex(child_tidptr, FUTEX_WAKE, 1, NULL, NULL, 0); +call is done. +(That is, wake a single process waiting on this futex.) +Errors are ignored. +.SH "RETURN VALUE" +.BR set_tid_address () +always returns the PID of the calling process. +.SH ERRORS +.BR set_tid_address () +always succeeds. +.SH VERSIONS +This call is present since Linux 2.5.48. +Details as given here are valid since Linux 2.5.49. +.SH "CONFORMING TO" +This system call is Linux-specific. +.SH "SEE ALSO" +.BR clone (2), +.BR futex (2) diff --git a/original/man2/setcontext.2 b/original/man2/setcontext.2 new file mode 100644 index 00000000..8bf0b0ce --- /dev/null +++ b/original/man2/setcontext.2 @@ -0,0 +1 @@ +.so man2/getcontext.2 diff --git a/original/man2/setdomainname.2 b/original/man2/setdomainname.2 new file mode 100644 index 00000000..1c1594cb --- /dev/null +++ b/original/man2/setdomainname.2 @@ -0,0 +1 @@ +.so man2/getdomainname.2 diff --git a/original/man2/setegid.2 b/original/man2/setegid.2 new file mode 100644 index 00000000..85032b50 --- /dev/null +++ b/original/man2/setegid.2 @@ -0,0 +1 @@ +.so man2/seteuid.2 diff --git a/original/man2/seteuid.2 b/original/man2/seteuid.2 new file mode 100644 index 00000000..06f3cd40 --- /dev/null +++ b/original/man2/seteuid.2 @@ -0,0 +1,121 @@ +.\" Copyright (C) 2001 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. +.\" +.\" [should really be seteuid.3] +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.TH SETEUID 2 2009-10-17 "Linux" "Linux Programmer's Manual" +.SH NAME +seteuid, setegid \- set effective user or group ID +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "int seteuid(uid_t " euid ); +.br +.BI "int setegid(gid_t " egid ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR seteuid (), +.BR setegid (): +_BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH DESCRIPTION +.BR seteuid () +sets the effective user ID of the calling process. +Unprivileged user processes may only set the effective user ID to the +real user ID, the effective user ID or the saved set-user-ID. + +Precisely the same holds for +.BR setegid () +with "group" instead of "user". +.\" When +.\" .I euid +.\" equals \-1, nothing is changed. +.\" (This is an artifact of the implementation in glibc of seteuid() +.\" using setresuid(2).) +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.\" .TP +.\" .B EINVAL +.TP +.B EPERM +The calling process is not privileged (Linux: does not have the +.B CAP_SETUID +capability in the case of +.BR seteuid (), +or the +.B CAP_SETGID +capability in the case of +.BR setegid ()) +and +.I euid +(respectively, +.IR egid ) +is not the real user (group) ID, the effective user (group) ID, +or the saved set-user-ID (saved set-group-ID). +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +.SH NOTES +Setting the effective user (group) ID to the +saved set-user-ID (saved set-group-ID) is +possible since Linux 1.1.37 (1.1.38). +On an arbitrary system one should check +.BR _POSIX_SAVED_IDS . +.LP +Under libc4, libc5 and glibc 2.0 +.BI seteuid( euid ) +is equivalent to +.BI setreuid(\-1, " euid" ) +and hence may change the saved set-user-ID. +Under glibc 2.1 and later it is equivalent to +.BI setresuid(\-1, " euid" ", \-1)" +and hence does not change the saved set-user-ID. +Similar remarks hold for +.BR setegid (). + +According to POSIX.1, +.BR seteuid () +.RB ( setegid ()) +need not permit +.I euid +.RI ( egid ) +to be the same value as the current effective user (group) ID, +and some implementations do not permit this. +.SH "SEE ALSO" +.BR geteuid (2), +.BR setresuid (2), +.BR setreuid (2), +.BR setuid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/original/man2/setfsgid.2 b/original/man2/setfsgid.2 new file mode 100644 index 00000000..fd03a7d3 --- /dev/null +++ b/original/man2/setfsgid.2 @@ -0,0 +1,104 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created 1995-08-06 Thomas K. Dyas +.\" Modified 2000-07-01 aeb +.\" Modified 2002-07-23 aeb +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.TH SETFSGID 2 2008-12-05 "Linux" "Linux Programmer's Manual" +.SH NAME +setfsgid \- set group identity used for file system checks +.SH SYNOPSIS +.B #include +/* glibc uses */ +.sp +.BI "int setfsgid(uid_t " fsgid ); +.SH DESCRIPTION +The system call +.BR setfsgid () +sets the group ID that the Linux kernel uses to check for all accesses +to the file system. +Normally, the value of +.I fsgid +will shadow the value of the effective group ID. +In fact, whenever the +effective group ID is changed, +.I fsgid +will also be changed to the new value of the effective group ID. + +Explicit calls to +.BR setfsuid (2) +and +.BR setfsgid () +are usually only used by programs such as the Linux NFS server that +need to change what user and group ID is used for file access without a +corresponding change in the real and effective user and group IDs. +A change in the normal user IDs for a program such as the NFS server +is a security hole that can expose it to unwanted signals. +(But see below.) + +.BR setfsgid () +will only succeed if the caller is the superuser or if +.I fsgid +matches either the real group ID, effective group ID, +saved set-group-ID, or the current value of +.IR fsgid . +.SH "RETURN VALUE" +On success, the previous value of +.I fsgid +is returned. +On error, the current value of +.I fsgid +is returned. +.SH VERSIONS +This system call is present in Linux since version 1.2. +.\" This system call is present since Linux 1.1.44 +.\" and in libc since libc 4.7.6. +.SH "CONFORMING TO" +.BR setfsgid () +is Linux-specific and should not be used in programs intended +to be portable. +.SH NOTES +When glibc determines that the argument is not a valid group ID, +it will return \-1 and set \fIerrno\fP to +.B EINVAL +without attempting +the system call. +.LP +Note that at the time this system call was introduced, a process +could send a signal to a process with the same effective user ID. +Today signal permission handling is slightly different. +.SH BUGS +No error messages of any kind are returned to the caller. +At the very +least, +.B EPERM +should be returned when the call fails (because the caller lacks the +.B CAP_SETGID +capability). +.SH "SEE ALSO" +.BR kill (2), +.BR setfsuid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/original/man2/setfsgid32.2 b/original/man2/setfsgid32.2 new file mode 100644 index 00000000..fdb8bdcc --- /dev/null +++ b/original/man2/setfsgid32.2 @@ -0,0 +1 @@ +.so man2/setfsgid.2 diff --git a/original/man2/setfsuid.2 b/original/man2/setfsuid.2 new file mode 100644 index 00000000..737fc9cc --- /dev/null +++ b/original/man2/setfsuid.2 @@ -0,0 +1,104 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created 1995-08-06 Thomas K. Dyas +.\" Modified 2000-07-01 aeb +.\" Modified 2002-07-23 aeb +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.TH SETFSUID 2 2008-12-05 "Linux" "Linux Programmer's Manual" +.SH NAME +setfsuid \- set user identity used for file system checks +.SH SYNOPSIS +.B #include +/* glibc uses */ +.sp +.BI "int setfsuid(uid_t " fsuid ); +.SH DESCRIPTION +The system call +.BR setfsuid () +sets the user ID that the Linux kernel uses to check for all accesses +to the file system. +Normally, the value of +.I fsuid +will shadow the value of the effective user ID. +In fact, whenever the +effective user ID is changed, +.I fsuid +will also be changed to the new value of the effective user ID. + +Explicit calls to +.BR setfsuid () +and +.BR setfsgid (2) +are usually only used by programs such as the Linux NFS server that +need to change what user and group ID is used for file access without a +corresponding change in the real and effective user and group IDs. +A change in the normal user IDs for a program such as the NFS server +is a security hole that can expose it to unwanted signals. +(But see below.) + +.BR setfsuid () +will only succeed if the caller is the superuser or if +.I fsuid +matches either the real user ID, effective user ID, saved set-user-ID, or +the current value of +.IR fsuid . +.SH "RETURN VALUE" +On success, the previous value of +.I fsuid +is returned. +On error, the current value of +.I fsuid +is returned. +.SH VERSIONS +This system call is present in Linux since version 1.2. +.\" This system call is present since Linux 1.1.44 +.\" and in libc since libc 4.7.6. +.SH "CONFORMING TO" +.BR setfsuid () +is Linux-specific and should not be used in programs intended +to be portable. +.SH NOTES +When glibc determines that the argument is not a valid user ID, +it will return \-1 and set \fIerrno\fP to +.B EINVAL +without attempting +the system call. +.LP +Note that at the time this system call was introduced, a process +could send a signal to a process with the same effective user ID. +Today signal permission handling is slightly different. +.SH BUGS +No error messages of any kind are returned to the caller. +At the very +least, +.B EPERM +should be returned when the call fails (because the caller lacks the +.B CAP_SETUID +capability). +.SH "SEE ALSO" +.BR kill (2), +.BR setfsgid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/original/man2/setfsuid32.2 b/original/man2/setfsuid32.2 new file mode 100644 index 00000000..1ea58fd0 --- /dev/null +++ b/original/man2/setfsuid32.2 @@ -0,0 +1 @@ +.so man2/setfsuid.2 diff --git a/original/man2/setgid.2 b/original/man2/setgid.2 new file mode 100644 index 00000000..662e439c --- /dev/null +++ b/original/man2/setgid.2 @@ -0,0 +1,71 @@ +.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.) +.\" +.\" 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. +.\" +.\" Fri Jul 29th 12:56:44 BST 1994 Wilf. +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2002-03-09 by aeb +.\" +.TH SETGID 2 2009-10-17 "Linux" "Linux Programmer's Manual" +.SH NAME +setgid \- set group identity +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "int setgid(gid_t " gid ); +.SH DESCRIPTION +.BR setgid () +sets the effective group ID of the calling process. +If the caller is the +superuser, the real GID and saved set-group-ID are also set. + +Under Linux, +.BR setgid () +is implemented like the POSIX version with the +.B _POSIX_SAVED_IDS +feature. +This allows a set-group-ID program that is not set-user-ID-root +to drop all of its group +privileges, do some un-privileged work, and then reengage the original +effective group ID in a secure manner. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EPERM +The calling process is not privileged (does not have the +\fBCAP_SETGID\fP capability), and +.I gid +does not match the real group ID or saved set-group-ID of +the calling process. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.SH "SEE ALSO" +.BR getgid (2), +.BR setegid (2), +.BR setregid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/original/man2/setgid32.2 b/original/man2/setgid32.2 new file mode 100644 index 00000000..bc8ef19c --- /dev/null +++ b/original/man2/setgid32.2 @@ -0,0 +1 @@ +.so man2/setgid.2 diff --git a/original/man2/setgroups.2 b/original/man2/setgroups.2 new file mode 100644 index 00000000..0ae4cc0b --- /dev/null +++ b/original/man2/setgroups.2 @@ -0,0 +1 @@ +.so man2/getgroups.2 diff --git a/original/man2/setgroups32.2 b/original/man2/setgroups32.2 new file mode 100644 index 00000000..478fb63e --- /dev/null +++ b/original/man2/setgroups32.2 @@ -0,0 +1 @@ +.so man2/setgroups.2 diff --git a/original/man2/sethostid.2 b/original/man2/sethostid.2 new file mode 100644 index 00000000..3210db03 --- /dev/null +++ b/original/man2/sethostid.2 @@ -0,0 +1 @@ +.so man3/gethostid.3 diff --git a/original/man2/sethostname.2 b/original/man2/sethostname.2 new file mode 100644 index 00000000..e1fa2a61 --- /dev/null +++ b/original/man2/sethostname.2 @@ -0,0 +1 @@ +.so man2/gethostname.2 diff --git a/original/man2/setitimer.2 b/original/man2/setitimer.2 new file mode 100644 index 00000000..9518567e --- /dev/null +++ b/original/man2/setitimer.2 @@ -0,0 +1 @@ +.so man2/getitimer.2 diff --git a/original/man2/setpgid.2 b/original/man2/setpgid.2 new file mode 100644 index 00000000..89d7e3d2 --- /dev/null +++ b/original/man2/setpgid.2 @@ -0,0 +1,308 @@ +.\" Copyright (c) 1983, 1991 Regents of the University of California. +.\" and Copyright (C) 2007, Michael Kerrisk +.\" 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. +.\" +.\" @(#)getpgrp.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1995-04-15 by Michael Chastain : +.\" Added 'getpgid'. +.\" Modified 1996-07-21 by Andries Brouwer +.\" Modified 1996-11-06 by Eric S. Raymond +.\" Modified 1999-09-02 by Michael Haardt +.\" Modified 2002-01-18 by Michael Kerrisk +.\" Modified 2003-01-20 by Andries Brouwer +.\" 2007-07-25, mtk, fairly substantial rewrites and rearrangements +.\" of text. +.\" +.TH SETPGID 2 2009-09-20 "Linux" "Linux Programmer's Manual" +.SH NAME +setpgid, getpgid, setpgrp, getpgrp \- set/get process group +.SH SYNOPSIS +.B #include +.sp +.BI "int setpgid(pid_t " pid ", pid_t " pgid ); +.br +.BI "pid_t getpgid(pid_t " pid ); +.sp +.BR "pid_t getpgrp(void);" " /* POSIX.1 version */" +.br +.BI "pid_t getpgrp(pid_t " pid ");\ \ \ \ \ \ \ \ \ " +/* BSD version */ +.sp +.BR "int setpgrp(void);" " /* System V version */" +.br +.BI "int setpgrp(pid_t " pid ", pid_t " pgid ); +/* BSD version */ +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR getpgid (): +_XOPEN_SOURCE\ >=\ 500 +.br +.BR setpgrp () +(POSIX.1): _SVID_SOURCE || _XOPEN_SOURCE >= 500 +.sp +.BR setpgrp "()\ (BSD)," +.BR getpgrp "()\ (BSD):" +_BSD_SOURCE && !\ (_POSIX_SOURCE || _POSIX_C_SOURCE || +_XOPEN_SOURCE || _XOPEN_SOURCE_EXTENDED || _GNU_SOURCE || _SVID_SOURCE) +.ad b +.SH DESCRIPTION +All of these interfaces are available on Linux, +and are used for getting and setting the +process group ID (PGID) of a process. +The preferred, POSIX.1-specified ways of doing this are: +.BR getpgrp (void), +for retrieving the calling process's PGID; and +.BR setpgid (), +for setting a process's PGID. + +.BR setpgid () +sets the PGID of the process specified by +.I pid +to +.IR pgid . +If +.I pid +is zero, then the process ID of the calling process is used. +If +.I pgid +is zero, then the PGID of the process specified by +.I pid +is made the same as its process ID. +If +.BR setpgid () +is used to move a process from one process +group to another (as is done by some shells when creating pipelines), +both process groups must be part of the same session (see +.BR setsid (2) +and +.BR credentials (7)). +In this case, +the \fIpgid\fP specifies an existing process group to be joined and the +session ID of that group must match the session ID of the joining process. + +The POSIX.1 version of +.BR getpgrp (), +which takes no arguments, +returns the PGID of the calling process. + +.BR getpgid () +returns the PGID of the process specified by +.IR pid . +If +.I pid +is zero, the process ID of the calling process is used. +(Retrieving the PGID of a process other than the caller is rarely +necessary, and the POSIX.1 +.BR getpgrp () +is preferred for that task.) + +The System V-style +.BR setpgrp (), +which takes no arguments, is equivalent to +.IR "setpgid(0,\ 0)" . + +The BSD-specific +.BR setpgrp () +call, which takes arguments +.I pid +and +.IR pgid , +is equivalent to +.IR "setpgid(pid, pgid)" . +.\" The true BSD setpgrp() system call differs in allowing the PGID +.\" to be set to arbitrary values, rather than being restricted to +.\" PGIDs in the same session. + +The BSD-specific +.BR getpgrp () +call, which takes a single +.I pid +argument, is equivalent to +.IR "getpgid(pid)" . +.SH "RETURN VALUE" +On success, +.BR setpgid () +and +.BR setpgrp () +return zero. +On error, \-1 is returned, and +.I errno +is set appropriately. + +The POSIX.1 +.BR getpgrp () +always returns the PGID of the caller. + +.BR getpgid (), +and the BSD-specific +.BR getpgrp () +return a process group on success. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +An attempt was made to change the process group ID +of one of the children of the calling process and the child had +already performed an +.BR execve (2) +.RB ( setpgid (), +.BR setpgrp ()). +.TP +.B EINVAL +.I pgid +is less than 0 +.RB ( setpgid (), +.BR setpgrp ()). +.TP +.B EPERM +An attempt was made to move a process into a process group in a +different session, or to change the process +group ID of one of the children of the calling process and the +child was in a different session, or to change the process group ID of +a session leader +.RB ( setpgid (), +.BR setpgrp ()). +.TP +.B ESRCH +For +.BR getpgid (): +.I pid +does not match any process. +For +.BR setpgid (): +.I pid +is not the calling process and not a child of the calling process. +.SH "CONFORMING TO" +.BR setpgid () +and the version of +.BR getpgrp () +with no arguments +conform to POSIX.1-2001. + +POSIX.1-2001 also specifies +.BR getpgid () +and the version of +.BR setpgrp () +that takes no arguments. +(POSIX.1-2008 marks this +.BR setpgrp () +specification as obsolete.) + +The version of +.BR getpgrp () +with one argument and the version of +.BR setpgrp () +that takes two arguments derive from 4.2BSD, +and are not specified by POSIX.1. +.SH NOTES +A child created via +.BR fork (2) +inherits its parent's process group ID. +The PGID is preserved across an +.BR execve (2). + +Each process group is a member of a session and each process is a +member of the session of which its process group is a member. + +A session can have a controlling terminal. +At any time, one (and only one) of the process groups +in the session can be the foreground process group +for the terminal; +the remaining process groups are in the background. +If a signal is generated from the terminal (e.g., typing the +interrupt key to generate +.BR SIGINT ), +that signal is sent to the foreground process group. +(See +.BR termios (3) +for a description of the characters that generate signals.) +Only the foreground process group may +.BR read (2) +from the terminal; +if a background process group tries to +.BR read (2) +from the terminal, then the group is sent a +.B SIGTSTP +signal, which suspends it. +The +.BR tcgetpgrp (3) +and +.BR tcsetpgrp (3) +functions are used to get/set the foreground +process group of the controlling terminal. + +The +.BR setpgid () +and +.BR getpgrp () +calls are used by programs such as +.BR bash (1) +to create process groups in order to implement shell job control. + +If a session has a controlling terminal, and the +.B CLOCAL +flag for that terminal is not set, +and a terminal hangup occurs, then the session leader is sent a +.BR SIGHUP . +If the session leader exits, then a +.B SIGHUP +signal will also be sent to each process in the foreground +process group of the controlling terminal. + +If the exit of the process causes a process group to become orphaned, +and if any member of the newly orphaned process group is stopped, then a +.B SIGHUP +signal followed by a +.B SIGCONT +signal will be sent to each process +in the newly orphaned process group. +.\" exit.3 refers to the following text: +An orphaned process group is one in which the parent of +every member of process group is either itself also a member +of the process group or is a member of a process group +in a different session (see also +.BR credentials (7)). +.SH "SEE ALSO" +.BR getuid (2), +.BR setsid (2), +.BR tcgetpgrp (3), +.BR tcsetpgrp (3), +.BR termios (3), +.BR credentials (7) diff --git a/original/man2/setpgrp.2 b/original/man2/setpgrp.2 new file mode 100644 index 00000000..d6b107a1 --- /dev/null +++ b/original/man2/setpgrp.2 @@ -0,0 +1 @@ +.so man2/setpgid.2 diff --git a/original/man2/setpriority.2 b/original/man2/setpriority.2 new file mode 100644 index 00000000..b1dcfd91 --- /dev/null +++ b/original/man2/setpriority.2 @@ -0,0 +1 @@ +.so man2/getpriority.2 diff --git a/original/man2/setregid.2 b/original/man2/setregid.2 new file mode 100644 index 00000000..ec3ff641 --- /dev/null +++ b/original/man2/setregid.2 @@ -0,0 +1 @@ +.so man2/setreuid.2 diff --git a/original/man2/setregid32.2 b/original/man2/setregid32.2 new file mode 100644 index 00000000..035df172 --- /dev/null +++ b/original/man2/setregid32.2 @@ -0,0 +1 @@ +.so man2/setregid.2 diff --git a/original/man2/setresgid.2 b/original/man2/setresgid.2 new file mode 100644 index 00000000..d6866a1d --- /dev/null +++ b/original/man2/setresgid.2 @@ -0,0 +1 @@ +.so man2/setresuid.2 diff --git a/original/man2/setresgid32.2 b/original/man2/setresgid32.2 new file mode 100644 index 00000000..dec1b953 --- /dev/null +++ b/original/man2/setresgid32.2 @@ -0,0 +1 @@ +.so man2/setresgid.2 diff --git a/original/man2/setresuid.2 b/original/man2/setresuid.2 new file mode 100644 index 00000000..5ba5bb4b --- /dev/null +++ b/original/man2/setresuid.2 @@ -0,0 +1,99 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1997 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. +.\" +.\" Modified, 2003-05-26, Michael Kerrisk, +.TH SETRESUID 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +setresuid, setresgid \- set real, effective and saved user or group ID +.SH SYNOPSIS +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int setresuid(uid_t " ruid ", uid_t " euid ", uid_t " suid ); +.br +.BI "int setresgid(gid_t " rgid ", gid_t " egid ", gid_t " sgid ); +.SH DESCRIPTION +.BR setresuid () +sets the real user ID, the effective user ID, and the +saved set-user-ID of the calling process. + +Unprivileged user processes +may change the real UID, +effective UID, and saved set-user-ID, each to one of: +the current real UID, the current effective UID or the +current saved set-user-ID. + +Privileged processes (on Linux, those having the \fBCAP_SETUID\fP capability) +may set the real UID, effective UID, and +saved set-user-ID to arbitrary values. + +If one of the arguments equals \-1, the corresponding value is not changed. + +Regardless of what changes are made to the real UID, effective UID, +and saved set-user-ID, the file system UID is always set to the same +value as the (possibly new) effective UID. + +Completely analogously, +.BR setresgid () +sets the real GID, effective GID, and saved set-group-ID +of the calling process (and always modifies the file system GID +to be the same as the effective GID), +with the same restrictions for unprivileged processes. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EAGAIN +.I uid +does not match the current UID and this call would +bring that user ID over its +.B RLIMIT_NPROC +resource limit. +.TP +.B EPERM +The calling process is not privileged (did not have the \fBCAP_SETUID\fP +capability) and tried to change the IDs to values that are not permitted. +.SH VERSIONS +These calls are available under Linux since Linux 2.1.44. +.SH "CONFORMING TO" +These calls are nonstandard; +they also appear on HP-UX and some of the BSDs. +.SH NOTES +Under HP-UX and FreeBSD the prototype is found in +.IR . +Under Linux the prototype is provided by glibc since version 2.3.2. +.SH "SEE ALSO" +.BR getresuid (2), +.BR getuid (2), +.BR setfsgid (2), +.BR setfsuid (2), +.BR setreuid (2), +.BR setuid (2), +.BR capabilities (7), +.BR credentials (7), +.BR feature_test_macros (7) diff --git a/original/man2/setresuid32.2 b/original/man2/setresuid32.2 new file mode 100644 index 00000000..d6866a1d --- /dev/null +++ b/original/man2/setresuid32.2 @@ -0,0 +1 @@ +.so man2/setresuid.2 diff --git a/original/man2/setreuid.2 b/original/man2/setreuid.2 new file mode 100644 index 00000000..034a193f --- /dev/null +++ b/original/man2/setreuid.2 @@ -0,0 +1,143 @@ +.\" 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. +.\" +.\" @(#)setregid.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 09:08:49 1993 by Rik Faith +.\" Portions extracted from linux/kernel/sys.c: +.\" Copyright (C) 1991, 1992 Linus Torvalds +.\" May be distributed under the GNU General Public License +.\" Changes: 1994-07-29 by Wilf +.\" 1994-08-02 by Wilf due to change in kernel. +.\" 2004-07-04 by aeb +.\" 2004-05-27 by Michael Kerrisk +.\" +.TH SETREUID 2 2009-10-17 "Linux" "Linux Programmer's Manual" +.SH NAME +setreuid, setregid \- set real and/or effective user or group ID +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "int setreuid(uid_t " ruid ", uid_t " euid ); +.br +.BI "int setregid(gid_t " rgid ", gid_t " egid ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR setreuid (), +.BR setregid (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +.BR setreuid () +sets real and effective user IDs of the calling process. + +Supplying a value of \-1 for either the real or effective user ID forces +the system to leave that ID unchanged. + +Unprivileged processes may only set the effective user ID to the real user ID, +the effective user ID, or the saved set-user-ID. + +Unprivileged users may only set the real user ID to +the real user ID or the effective user ID. + +If the real user ID is set or the effective user ID is set to a value +not equal to the previous real user ID, +the saved set-user-ID will be set to the new effective user ID. + +Completely analogously, +.BR setregid () +sets real and effective group ID's of the calling process, +and all of the above holds with "group" instead of "user". +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EPERM +The calling process is not privileged +(Linux: does not have the +.B CAP_SETUID +capability in the case of +.BR setreuid (), +or the +.B CAP_SETGID +capability in the case of +.BR setregid ()) +and a change other than (i) +swapping the effective user (group) ID with the real user (group) ID, +or (ii) setting one to the value of the other or (iii) setting the +effective user (group) ID to the value of the +saved set-user-ID (saved set-group-ID) was specified. +.SH "CONFORMING TO" +POSIX.1-2001, 4.3BSD (the +.BR setreuid () +and +.BR setregid () +function calls first appeared in 4.2BSD). +.SH NOTES +Setting the effective user (group) ID to the +saved set-user-ID (saved set-group-ID) is +possible since Linux 1.1.37 (1.1.38). + +POSIX.1 does not specify all of possible ID changes that are permitted +on Linux for an unprivileged process. +For +.BR setreuid (), +the effective user ID can be made the same as the +real user ID or the save set-user-ID, +and it is unspecified whether unprivileged processes may set the +real user ID to the real user ID, the effective user ID, or the +saved set-user-ID. +For +.BR setregid (), +the real group ID can be changed to the value of the saved set-group-ID, +and the effective group ID can be changed to the value of +the real group ID or the saved set-group-ID. +The precise details of what ID changes are permitted vary +across implementations. + +POSIX.1 makes no specification about the effect of these calls +on the saved set-user-ID and saved set-group-ID. +.SH "SEE ALSO" +.BR getgid (2), +.BR getuid (2), +.BR seteuid (2), +.BR setgid (2), +.BR setresuid (2), +.BR setuid (2), +.BR capabilities (7) diff --git a/original/man2/setreuid32.2 b/original/man2/setreuid32.2 new file mode 100644 index 00000000..ec3ff641 --- /dev/null +++ b/original/man2/setreuid32.2 @@ -0,0 +1 @@ +.so man2/setreuid.2 diff --git a/original/man2/setrlimit.2 b/original/man2/setrlimit.2 new file mode 100644 index 00000000..df6d7362 --- /dev/null +++ b/original/man2/setrlimit.2 @@ -0,0 +1 @@ +.so man2/getrlimit.2 diff --git a/original/man2/setsid.2 b/original/man2/setsid.2 new file mode 100644 index 00000000..1417c016 --- /dev/null +++ b/original/man2/setsid.2 @@ -0,0 +1,89 @@ +.\" Copyright Michael Haardt (michael@cantor.informatik.rwth-aachen.de) +.\" Sat Aug 27 20:43:50 MET DST 1994 +.\" +.\" 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 Sun Sep 11 19:19:05 1994 +.\" Modified Mon Mar 25 10:19:00 1996 (merged a few +.\" tiny changes from a man page by Charles Livingston). +.\" Modified Sun Jul 21 14:45:46 1996 +.\" +.TH SETSID 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH NAME +setsid \- creates a session and sets the process group ID +.SH SYNOPSIS +.ad l +.B #include +.sp +.B pid_t setsid(void); +.br +.ad b +.SH DESCRIPTION +.BR setsid () +creates a new session if the calling process is not a +process group leader. +The calling process is the leader of the new +session, the process group leader of the new process group, and has no +controlling tty. +The process group ID and session ID of the calling +process are set to the PID of the calling process. +The calling process will be the only process in +this new process group and in this new session. +.SH "RETURN VALUE" +On success, the (new) session ID of the calling process is returned. +On error, +.I "(pid_t)\ \-1" +is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.BR EPERM . +The process group ID of any process +equals the PID of the calling process. +Thus, in particular, +.BR setsid () +fails if the calling process is already a process group leader. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.SH NOTES +A child created via +.BR fork (2) +inherits its parent's session ID. +The session ID is preserved across an +.BR execve (2). + +A process group leader is a process with process group ID equal +to its PID. +In order to be sure that +.BR setsid () +will succeed, +.BR fork (2) +and +.BR _exit (2), +and have the child do +.BR setsid (). +.SH "SEE ALSO" +.BR getsid (2), +.BR setpgid (2), +.BR setpgrp (2), +.BR tcgetsid (3), +.BR credentials (7) diff --git a/original/man2/setsockopt.2 b/original/man2/setsockopt.2 new file mode 100644 index 00000000..d98c7769 --- /dev/null +++ b/original/man2/setsockopt.2 @@ -0,0 +1 @@ +.so man2/getsockopt.2 diff --git a/original/man2/settimeofday.2 b/original/man2/settimeofday.2 new file mode 100644 index 00000000..2b6eff42 --- /dev/null +++ b/original/man2/settimeofday.2 @@ -0,0 +1 @@ +.so man2/gettimeofday.2 diff --git a/original/man2/setuid.2 b/original/man2/setuid.2 new file mode 100644 index 00000000..09cae98d --- /dev/null +++ b/original/man2/setuid.2 @@ -0,0 +1,115 @@ +.\" Copyright (C), 1994, Graeme W. Wilford (Wilf). +.\" +.\" 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. +.\" +.\" Fri Jul 29th 12:56:44 BST 1994 Wilf. +.\" Changes inspired by patch from Richard Kettlewell +.\" , aeb 970616. +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.TH SETUID 2 2010-02-21 "Linux" "Linux Programmer's Manual" +.SH NAME +setuid \- set user identity +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "int setuid(uid_t " uid ); +.SH DESCRIPTION +.BR setuid () +sets the effective user ID of the calling process. +If the effective UID of the caller is root, +the real UID and saved set-user-ID are also set. +.PP +Under Linux, +.BR setuid () +is implemented like the POSIX version with the +.B _POSIX_SAVED_IDS +feature. +This allows a set-user-ID (other than root) program to drop all of its user +privileges, do some un-privileged work, and then reengage the original +effective user ID in a secure manner. +.PP +If the user is root or the program is set-user-ID-root, special care must be +taken. +The +.BR setuid () +function checks the effective user ID of the caller and if it is +the superuser, all process-related user ID's are set to +.IR uid . +After this has occurred, it is impossible for the program to regain root +privileges. +.PP +Thus, a set-user-ID-root program wishing to temporarily drop root +privileges, assume the identity of an unprivileged user, and then regain +root privileges afterwards cannot use +.BR setuid (). +You can accomplish this with +.BR seteuid (2). +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EAGAIN +The +.I uid +does not match the current uid and +.I uid +brings process over its +.B RLIMIT_NPROC +resource limit. +.TP +.B EPERM +The user is not privileged (Linux: does not have the +.B CAP_SETUID +capability) and +.I uid +does not match the real UID or saved set-user-ID of the calling process. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +Not quite compatible with the 4.4BSD call, which +sets all of the real, saved, and effective user IDs. +.\" SVr4 documents an additional EINVAL error condition. +.SH NOTES +.SS Linux Notes +Linux has the concept of file system user ID, normally equal to the +effective user ID. +The +.BR setuid () +call also sets the file system user ID of the calling process. +See +.BR setfsuid (2). +.PP +If +.I uid +is different from the old effective uid, the process will +be forbidden from leaving core dumps. +.SH "SEE ALSO" +.BR getuid (2), +.BR seteuid (2), +.BR setfsuid (2), +.BR setreuid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/original/man2/setuid32.2 b/original/man2/setuid32.2 new file mode 100644 index 00000000..24656c29 --- /dev/null +++ b/original/man2/setuid32.2 @@ -0,0 +1 @@ +.so man2/setuid.2 diff --git a/original/man2/setup.2 b/original/man2/setup.2 new file mode 100644 index 00000000..8d112dc4 --- /dev/null +++ b/original/man2/setup.2 @@ -0,0 +1,71 @@ +.\" 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 Sun Jul 25 10:14:13 1993 by Rik Faith +.\" Modified 15 April 1995 by Michael Chastain +.\" Update calling parameters to Linux 1.2.4 values. +.\" Modified 10 June 1995 by Andries Brouwer +.\" Modified 3 May 1996 by Martin Schulze +.\" Modified Wed Nov 6 04:05:28 1996 by Eric S. Raymond +.\" Modified Sat Jan 29 01:08:23 2000 by aeb +.\" +.TH SETUP 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH NAME +setup \- setup devices and file systems, mount root file system +.SH SYNOPSIS +.B #include +.sp +.B int setup(void); +.SH DESCRIPTION +.BR setup () +is called once from within +.IR linux/init/main.c . +It calls initialization functions for devices and file systems +configured into the kernel and then mounts the root file system. +.PP +No user process may call +.BR setup (). +Any user process, even a process with superuser permission, +will receive +.BR EPERM . +.SH "RETURN VALUE" +.BR setup () +always returns \-1 for a user process. +.SH ERRORS +.TP +.B EPERM +Always, for a user process. +.SH VERSIONS +Since Linux 2.1.121, no such function exists anymore. +.SH "CONFORMING TO" +This function is Linux-specific, and should not be used in programs +intended to be portable, or indeed in any programs at all. +.SH NOTES +The calling sequence varied: at some times +.I setup () +has had a single argument +.I "void *BIOS" +and at other times a single argument +.IR "int magic" . diff --git a/original/man2/setxattr.2 b/original/man2/setxattr.2 new file mode 100644 index 00000000..3c034183 --- /dev/null +++ b/original/man2/setxattr.2 @@ -0,0 +1,162 @@ +.\" +.\" Extended attributes system calls manual pages +.\" +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" 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. +.\" +.TH SETXATTR 2 2001-12-31 "Linux" "Linux Programmer's Manual" +.SH NAME +setxattr, lsetxattr, fsetxattr \- set an extended attribute value +.SH SYNOPSIS +.fam C +.nf +.B #include +.B #include +.sp +.BI "int setxattr(const char\ *" path ", const char\ *" name , +.BI " const void\ *" value ", size_t " size ", int " flags ); +.BI "int lsetxattr(const char\ *" path ", const char\ *" name , +.BI " const void\ *" value ", size_t " size ", int " flags ); +.BI "int fsetxattr(int " fd ", const char\ *" name , +.BI " const void\ *" value ", size_t " size ", int " flags ); +.fi +.fam T +.SH DESCRIPTION +Extended attributes are +.IR name :\c +.I value +pairs associated with inodes (files, directories, symbolic links, etc.). +They are extensions to the normal attributes which are associated +with all inodes in the system (i.e., the +.BR stat (2) +data). +A complete overview of extended attributes concepts can be found in +.BR attr (5). +.PP +.BR setxattr () +sets the +.I value +of the extended attribute identified by +.I name +and associated with the given +.I path +in the file system. +The +.I size +of the +.I value +must be specified. +.PP +.BR lsetxattr () +is identical to +.BR setxattr (), +except in the case of a symbolic link, where the extended attribute is +set on the link itself, not the file that it refers to. +.PP +.BR fsetxattr () +is identical to +.BR setxattr (), +only the extended attribute is set on the open file referred to by +.I fd +(as returned by +.BR open (2)) +in place of +.IR path . +.PP +An extended attribute name is a simple null-terminated string. +The +.I name +includes a namespace prefix; there may be several, disjoint +namespaces associated with an individual inode. +The +.I value +of an extended attribute is a chunk of arbitrary textual or +binary data of specified length. +.PP +The +.I flags +argument can be used to refine the semantics of the operation. +.B XATTR_CREATE +specifies a pure create, which fails if the named +attribute exists already. +.B XATTR_REPLACE +specifies a pure replace operation, which fails if the +named attribute does not already exist. +By default (no flags), the extended attribute will be created if +need be, or will simply replace the value if the attribute exists. +.SH RETURN VALUE +On success, zero is returned. +On failure, \-1 is returned and +.I errno +is set appropriately. +.PP +If +.B XATTR_CREATE +is specified, and the attribute exists already, +.I errno +is set to +.BR EEXIST . +If +.B XATTR_REPLACE +is specified, and the attribute does not exist, +.I errno +is set to +.BR ENOATTR . +.PP +If there is insufficient space remaining to store the extended attribute, +.I errno +is set to either +.BR ENOSPC , +or +.B EDQUOT +if quota enforcement was the cause. +.PP +If extended attributes are not supported by the file system, or are disabled, +.I errno +is set to +.BR ENOTSUP . +.PP +The errors documented for the +.BR stat (2) +system call are also applicable here. +.SH VERSIONS +These system calls have been available on Linux since kernel 2.4; +glibc support is provided since version 2.3. +.SH "CONFORMING TO" +These system calls are Linux-specific. +.\" .SH AUTHORS +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" and the SGI XFS development team, +.\" .RI < linux-xfs@oss.sgi.com >. +.\" Please send any bug reports or comments to these addresses. +.SH SEE ALSO +.BR getfattr (1), +.BR setfattr (1), +.BR getxattr (2), +.BR listxattr (2), +.BR open (2), +.BR removexattr (2), +.BR stat (2), +.BR attr (5), +.BR symlink (7) diff --git a/original/man2/sgetmask.2 b/original/man2/sgetmask.2 new file mode 100644 index 00000000..a1d6f4c4 --- /dev/null +++ b/original/man2/sgetmask.2 @@ -0,0 +1,76 @@ +'\" t +.\" Copyright (c) 2007 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. +.\" +.TH SGETMASK 2 2007-07-05 "Linux" "Linux Programmer's Manual" +.SH NAME +sgetmask, ssetmask \- manipulation of signal mask (obsolete) +.SH SYNOPSIS +.B "long sgetmask(void);" +.sp +.BI "long ssetmask(long " newmask ); +.SH DESCRIPTION +These system calls are obsolete. +.IR "Do not use them" ; +use +.BR sigprocmask (2) +instead. + +.BR sgetmask () +returns the signal mask of the calling process. + +.BR ssetmask () +sets the signal mask of the calling process to the value given in +.IR newmask . +The previous signal mask is returned. + +The signal masks dealt with by these two system calls +are plain bit masks (unlike the +.I sigset_t +used by +.BR sigprocmask (2)); +use +.BR sigmask (3) +to create and inspect these masks. +.SH RETURN VALUE +.BR sgetmask () +always successfully returns the signal mask. +.BR ssetmask () +always succeeds, and returns the previous signal mask. +.SH ERRORS +These system calls always succeed. +.SH CONFORMING TO +These system calls are Linux-specific. +.SH NOTES +Glibc does not provide wrappers for these system calls; use +.BR syscall (2). + +These system calls are unaware of signal numbers greater than 31 +(i.e., real-time signals). + +It is not possible to block +.B SIGSTOP +or +.BR SIGKILL . +.SH SEE ALSO +.BR sigprocmask (2), +.BR signal (7) diff --git a/original/man2/shmat.2 b/original/man2/shmat.2 new file mode 100644 index 00000000..3f3e5a4b --- /dev/null +++ b/original/man2/shmat.2 @@ -0,0 +1 @@ +.so man2/shmop.2 diff --git a/original/man2/shmctl.2 b/original/man2/shmctl.2 new file mode 100644 index 00000000..d8939471 --- /dev/null +++ b/original/man2/shmctl.2 @@ -0,0 +1,409 @@ +.\" Copyright (c) 1993 Luigi P. Bai (lpb@softint.com) July 28, 1993 +.\" and Copyright 1993 Giorgio Ciucci +.\" and Copyright 2004, 2005 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-28, Rik Faith +.\" Modified 1993-11-28, Giorgio Ciucci +.\" Modified 1997-01-31, Eric S. Raymond +.\" Modified 2001-02-18, Andries Brouwer +.\" Modified 2002-01-05, 2004-05-27, 2004-06-17, +.\" Michael Kerrisk +.\" Modified 2004-10-11, aeb +.\" Modified, Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Updated shmid_ds structure definitions +.\" Added information on SHM_DEST and SHM_LOCKED flags +.\" Noted that CAP_IPC_LOCK is not required for SHM_UNLOCK +.\" since kernel 2.6.9 +.\" Modified, 2004-11-25, mtk, notes on 2.6.9 RLIMIT_MEMLOCK changes +.\" 2005-04-25, mtk -- noted aberrant Linux behavior w.r.t. new +.\" attaches to a segment that has already been marked for deletion. +.\" 2005-08-02, mtk: Added IPC_INFO, SHM_INFO, SHM_STAT descriptions. +.\" +.TH SHMCTL 2 2008-08-07 "Linux" "Linux Programmer's Manual" +.SH NAME +shmctl \- shared memory control +.SH SYNOPSIS +.ad l +.B #include +.br +.B #include +.sp +.BI "int shmctl(int " shmid ", int " cmd ", struct shmid_ds *" buf ); +.ad b +.SH DESCRIPTION +.BR shmctl () +performs the control operation specified by +.I cmd +on the shared memory segment whose identifier is given in +.IR shmid . +.PP +The +.I buf +argument is a pointer to a \fIshmid_ds\fP structure, +defined in \fI\fP as follows: +.PP +.in +4n +.nf +struct shmid_ds { + struct ipc_perm shm_perm; /* Ownership and permissions */ + size_t shm_segsz; /* Size of segment (bytes) */ + time_t shm_atime; /* Last attach time */ + time_t shm_dtime; /* Last detach time */ + time_t shm_ctime; /* Last change time */ + pid_t shm_cpid; /* PID of creator */ + pid_t shm_lpid; /* PID of last shmat(2)/shmdt(2) */ + shmatt_t shm_nattch; /* No. of current attaches */ + ... +}; +.fi +.in +.PP +The +.I ipc_perm +structure is defined in \fI\fP as follows +(the highlighted fields are settable using +.BR IPC_SET ): +.PP +.in +4n +.nf +struct ipc_perm { + key_t __key; /* Key supplied to shmget(2) */ + uid_t \fBuid\fP; /* Effective UID of owner */ + gid_t \fBgid\fP; /* Effective GID of owner */ + uid_t cuid; /* Effective UID of creator */ + gid_t cgid; /* Effective GID of creator */ + unsigned short \fBmode\fP; /* \fBPermissions\fP + SHM_DEST and + SHM_LOCKED flags */ + unsigned short __seq; /* Sequence number */ +}; +.fi +.in +.PP +Valid values for +.I cmd +are: +.br +.TP 10 +.B IPC_STAT +Copy information from the kernel data structure associated with +.I shmid +into the +.I shmid_ds +structure pointed to by \fIbuf\fP. +The caller must have read permission on the +shared memory segment. +.TP +.B IPC_SET +Write the values of some members of the +.I shmid_ds +structure pointed to by +.I buf +to the kernel data structure associated with this shared memory segment, +updating also its +.I shm_ctime +member. +The following fields can be changed: +\fIshm_perm.uid\fP, \fIshm_perm.gid\fP, +and (the least significant 9 bits of) \fIshm_perm.mode\fP. +The effective UID of the calling process must match the owner +.RI ( shm_perm.uid ) +or creator +.RI ( shm_perm.cuid ) +of the shared memory segment, or the caller must be privileged. +.TP +.B IPC_RMID +Mark the segment to be destroyed. +The segment will only actually be destroyed +after the last process detaches it (i.e., when the +.I shm_nattch +member of the associated structure +.I shmid_ds +is zero). +The caller must be the owner or creator, or be privileged. +If a segment has been marked for destruction, then the (nonstandard) +.B SHM_DEST +flag of the +.I shm_perm.mode +field in the associated data structure retrieved by +.B IPC_STAT +will be set. +.PP +The caller \fImust\fP ensure that a segment is eventually destroyed; +otherwise its pages that were faulted in will remain in memory or swap. +.TP 10 +.BR IPC_INFO " (Linux-specific)" +Returns information about system-wide shared memory limits and +parameters in the structure pointed to by +.IR buf . +This structure is of type +.I shminfo +(thus, a cast is required), +defined in +.I +if the +.B _GNU_SOURCE +feature test macro is defined: +.nf +.in +4n + +struct shminfo { + unsigned long shmmax; /* Maximum segment size */ + unsigned long shmmin; /* Minimum segment size; + always 1 */ + unsigned long shmmni; /* Maximum number of segments */ + unsigned long shmseg; /* Maximum number of segments + that a process can attach; + unused within kernel */ + unsigned long shmall; /* Maximum number of pages of + shared memory, system-wide */ +}; + +.in +.fi +The +.IR shmmni , +.IR shmmax , +and +.I shmall +settings can be changed via +.I /proc +files of the same name; see +.BR proc (5) +for details. +.TP +.BR SHM_INFO " (Linux-specific)" +Returns a +.I shm_info +structure whose fields contain information +about system resources consumed by shared memory. +This structure is defined in +.I +if the +.B _GNU_SOURCE +feature test macro is defined: +.nf +.in +4n + +struct shm_info { + int used_ids; /* # of currently existing + segments */ + unsigned long shm_tot; /* Total number of shared + memory pages */ + unsigned long shm_rss; /* # of resident shared + memory pages */ + unsigned long shm_swp; /* # of swapped shared + memory pages */ + unsigned long swap_attempts; + /* Unused since Linux 2.4 */ + unsigned long swap_successes; + /* Unused since Linux 2.4 */ +}; +.in +.fi +.TP +.BR SHM_STAT " (Linux-specific)" +Returns a +.I shmid_ds +structure as for +.BR IPC_STAT . +However, the +.I shmid +argument is not a segment identifier, but instead an index into +the kernel's internal array that maintains information about +all shared memory segments on the system. +.PP +The caller can prevent or allow swapping of a shared +memory segment with the following \fIcmd\fP values: +.br +.TP 10 +.BR SHM_LOCK " (Linux-specific)" +Prevent swapping of the shared memory segment. +The caller must fault in +any pages that are required to be present after locking is enabled. +If a segment has been locked, then the (nonstandard) +.B SHM_LOCKED +flag of the +.I shm_perm.mode +field in the associated data structure retrieved by +.B IPC_STAT +will be set. +.TP +.BR SHM_UNLOCK " (Linux-specific)" +Unlock the segment, allowing it to be swapped out. +.PP +In kernels before 2.6.10, only a privileged process +could employ +.B SHM_LOCK +and +.BR SHM_UNLOCK . +Since kernel 2.6.10, an unprivileged process can employ these operations +if its effective UID matches the owner or creator UID of the segment, and +(for +.BR SHM_LOCK ) +the amount of memory to be locked falls within the +.B RLIMIT_MEMLOCK +resource limit (see +.BR 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 +.SH "RETURN VALUE" +A successful +.B IPC_INFO +or +.B SHM_INFO +operation returns the index of the highest used entry in the +kernel's internal array recording information about all +shared memory segments. +(This information can be used with repeated +.B SHM_STAT +operations to obtain information about all shared memory segments +on the system.) +A successful +.B SHM_STAT +operation returns the identifier of the shared memory segment +whose index was given in +.IR shmid . +Other operations return 0 on success. + +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +\fBIPC_STAT\fP or \fBSHM_STAT\fP is requested and +\fIshm_perm.mode\fP does not allow read access for +.IR shmid , +and the calling process does not have the +.B CAP_IPC_OWNER +capability. +.TP +.B EFAULT +The argument +.I cmd +has value +.B IPC_SET +or +.B IPC_STAT +but the address pointed to by +.I buf +isn't accessible. +.TP +.B EIDRM +\fIshmid\fP points to a removed identifier. +.TP +.B EINVAL +\fIshmid\fP is not a valid identifier, or \fIcmd\fP +is not a valid command. +Or: for a +.B SHM_STAT +operation, the index value specified in +.I shmid +referred to an array slot that is currently unused. +.TP +.B ENOMEM +(In kernels since 2.6.9), +.B SHM_LOCK +was specified and the size of the to-be-locked segment would mean +that the total bytes in locked shared memory segments would exceed +the limit for the real user ID of the calling process. +This limit is defined by the +.B RLIMIT_MEMLOCK +soft resource limit (see +.BR setrlimit (2)). +.TP +.B EOVERFLOW +\fBIPC_STAT\fP is attempted, and the GID or UID value +is too large to be stored in the structure pointed to by +.IR buf . +.TP +.B EPERM +\fBIPC_SET\fP or \fBIPC_RMID\fP is attempted, and the +effective user ID of the calling process is not that of the creator +(found in +.IR shm_perm.cuid ), +or the owner +(found in +.IR shm_perm.uid ), +and the process was not privileged (Linux: did not have the +.B CAP_SYS_ADMIN +capability). + +Or (in kernels before 2.6.9), +.B SHM_LOCK +or +.B SHM_UNLOCK +was specified, but the process was not privileged +(Linux: did not have the +.B CAP_IPC_LOCK +capability). +(Since Linux 2.6.9, this error can also occur if the +.B RLIMIT_MEMLOCK +is 0 and the caller is not privileged.) +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.\" SVr4 documents additional error conditions EINVAL, +.\" ENOENT, ENOSPC, ENOMEM, EEXIST. Neither SVr4 nor SVID documents +.\" an EIDRM error condition. +.SH NOTES +The +.BR IPC_INFO , +.B SHM_STAT +and +.B SHM_INFO +operations are used by the +.BR ipcs (8) +program to provide information on allocated resources. +In the future these may modified or moved to a /proc file system +interface. + +Linux permits a process to attach +.RB ( shmat (2)) +a shared memory segment that has already been marked for deletion +using +.IR shmctl(IPC_RMID) . +This feature is not available on other Unix implementations; +portable applications should avoid relying on it. + +Various fields in a \fIstruct shmid_ds\fP were typed as +.I short +under Linux 2.2 +and have become +.I long +under Linux 2.4. +To take advantage of this, +a recompilation under glibc-2.1.91 or later should suffice. +(The kernel distinguishes old and new calls by an +.B IPC_64 +flag in +.IR cmd .) +.SH "SEE ALSO" +.BR mlock (2), +.BR setrlimit (2), +.BR shmget (2), +.BR shmop (2), +.BR capabilities (7), +.BR svipc (7) diff --git a/original/man2/shmdt.2 b/original/man2/shmdt.2 new file mode 100644 index 00000000..3f3e5a4b --- /dev/null +++ b/original/man2/shmdt.2 @@ -0,0 +1 @@ +.so man2/shmop.2 diff --git a/original/man2/shmget.2 b/original/man2/shmget.2 new file mode 100644 index 00000000..9e479b65 --- /dev/null +++ b/original/man2/shmget.2 @@ -0,0 +1,297 @@ +.\" Copyright (c) 1993 Luigi P. Bai (lpb@softint.com) July 28, 1993 +.\" +.\" 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 Wed Jul 28 10:57:35 1993, Rik Faith +.\" Modified Sun Nov 28 16:43:30 1993, Rik Faith +.\" with material from Giorgio Ciucci +.\" Portions Copyright 1993 Giorgio Ciucci +.\" Modified Tue Oct 22 22:03:17 1996 by Eric S. Raymond +.\" Modified, 8 Jan 2003, Michael Kerrisk, +.\" Removed EIDRM from errors - that can't happen... +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added notes on /proc files +.\" +.TH SHMGET 2 2006-05-02 "Linux" "Linux Programmer's Manual" +.SH NAME +shmget \- allocates a shared memory segment +.SH SYNOPSIS +.ad l +.B #include +.br +.B #include +.sp +.BI "int shmget(key_t " key ", size_t " size ", int " shmflg ); +.ad b +.SH DESCRIPTION +.BR shmget () +returns the identifier of the shared memory segment +associated with the value of the argument +.IR key . +A new shared memory segment, with size equal to the value of +.I size +rounded up to a multiple of +.BR PAGE_SIZE , +is created if +.I key +has the value +.B IPC_PRIVATE +or +.I key +isn't +.BR IPC_PRIVATE , +no shared memory segment corresponding to +.I key +exists, and +.B IPC_CREAT +is specified in +.IR shmflg . +.PP +If +.I shmflg +specifies both +.B IPC_CREAT +and +.B IPC_EXCL +and a shared memory segment already exists for +.IR key , +then +.BR shmget () +fails with +.I errno +set to +.BR EEXIST . +(This is analogous to the effect of the combination +.B O_CREAT | O_EXCL +for +.BR open (2).) +.PP +The value +.I shmflg +is composed of: +.TP 12 +.B IPC_CREAT +to create a new segment. +If this flag is not used, then +.BR shmget () +will find the segment associated with \fIkey\fP and check to see if +the user has permission to access the segment. +.TP +.B IPC_EXCL +used with \fBIPC_CREAT\fP to ensure failure if the segment already exists. +.TP +.I mode_flags +(least significant 9 bits) +specifying the permissions granted to the owner, group, and world. +These bits have the same format, and the same +meaning, as the +.I mode +argument of +.BR open (2). +Presently, the execute permissions are not used by the system. +.TP +.BR SHM_HUGETLB " (since Linux 2.6)" +Allocate the segment using "huge pages." +See the kernel source file +.I Documentation/vm/hugetlbpage.txt +for further information. +.TP +.BR SHM_NORESERVE " (since Linux 2.6.15)" +This flag serves the same purpose as the +.BR mmap (2) +.B MAP_NORESERVE +flag. +Do not reserve swap space for this segment. +When swap space is reserved, one has the guarantee +that it is possible to modify the segment. +When swap space is not reserved one might get +.B SIGSEGV +upon a write +if no physical memory is available. +See also the discussion of the file +.I /proc/sys/vm/overcommit_memory +in +.BR proc (5). +.\" As at 2.6.17-rc2, this flag has no effect if SHM_HUGETLB was also +.\" specified. +.PP +When a new shared memory segment is created, +its contents are initialized to zero values, and +its associated data structure, +.I shmid_ds +(see +.BR shmctl (2)), +is initialized as follows: +.IP +.I shm_perm.cuid +and +.I shm_perm.uid +are set to the effective user ID of the calling process. +.IP +.I shm_perm.cgid +and +.I shm_perm.gid +are set to the effective group ID of the calling process. +.IP +The least significant 9 bits of +.I shm_perm.mode +are set to the least significant 9 bit of +.IR shmflg . +.IP +.I shm_segsz +is set to the value of +.IR size . +.IP +.IR shm_lpid , +.IR shm_nattch , +.I shm_atime +and +.I shm_dtime +are set to 0. +.IP +.I shm_ctime +is set to the current time. +.PP +If the shared memory segment already exists, the permissions are +verified, and a check is made to see if it is marked for destruction. +.SH "RETURN VALUE" +A valid segment identifier, +.IR shmid , +is returned on success, \-1 on error. +.SH ERRORS +On failure, +.I errno +is set to one of the following: +.TP +.B EACCES +The user does not have permission to access the +shared memory segment, and does not have the +.B CAP_IPC_OWNER +capability. +.TP +.B EEXIST +.B IPC_CREAT | IPC_EXCL +was specified and the segment exists. +.TP +.B EINVAL +A new segment was to be created and \fIsize\fP < \fBSHMMIN\fP +or \fIsize\fP > \fBSHMMAX\fP, or no new segment was to be created, +a segment with given key existed, but \fIsize\fP is greater than the size +of that segment. +.TP +.B ENFILE +.\" [2.6.7] shmem_zero_setup()-->shmem_file_setup()-->get_empty_filp() +The system limit on the total number of open files has been reached. +.TP +.B ENOENT +No segment exists for the given \fIkey\fP, and +.B IPC_CREAT +was not specified. +.TP +.B ENOMEM +No memory could be allocated for segment overhead. +.TP +.B ENOSPC +All possible shared memory IDs have been taken +.RB ( SHMMNI ), +or allocating a segment of the requested +.I size +would cause the system to exceed the system-wide limit on shared memory +.RB ( SHMALL ). +.TP +.B EPERM +The +.B SHM_HUGETLB +flag was specified, but the caller was not privileged (did not have the +.B CAP_IPC_LOCK +capability). +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.\" SVr4 documents an additional error condition EEXIST. + +.B SHM_HUGETLB +is a nonportable Linux extension. +.SH NOTES +.B IPC_PRIVATE +isn't a flag field but a +.I key_t +type. +If this special value is used for +.IR key , +the system call ignores everything but the least significant 9 bits of +.I shmflg +and creates a new shared memory segment (on success). +.PP +The following limits on shared memory segment resources affect the +.BR shmget () +call: +.TP +.B SHMALL +System wide maximum of shared memory pages +(on Linux, this limit can be read and modified via +.IR /proc/sys/kernel/shmall ). +.TP +.B SHMMAX +Maximum size in bytes for a shared memory segment: policy dependent +(on Linux, this limit can be read and modified via +.IR /proc/sys/kernel/shmmax ). +.TP +.B SHMMIN +Minimum size in bytes for a shared memory segment: implementation +dependent (currently 1 byte, though +.B PAGE_SIZE +is the effective minimum size). +.TP +.B SHMMNI +System wide maximum number of shared memory segments: implementation +dependent (currently 4096, was 128 before Linux 2.3.99; +on Linux, this limit can be read and modified via +.IR /proc/sys/kernel/shmmni ). +.\" 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 +.PP +The implementation has no specific limits for the per-process maximum +number of shared memory segments +.RB ( SHMSEG ). +.SS Linux Notes +Until version 2.3.30 Linux would return +.B EIDRM +for a +.BR shmget () +on a shared memory segment scheduled for deletion. +.SH BUGS +The name choice +.B IPC_PRIVATE +was perhaps unfortunate, +.B IPC_NEW +would more clearly show its function. +.SH "SEE ALSO" +.BR shmat (2), +.BR shmctl (2), +.BR shmdt (2), +.BR ftok (3), +.BR capabilities (7), +.BR shm_overview (7), +.BR svipc (7) diff --git a/original/man2/shmop.2 b/original/man2/shmop.2 new file mode 100644 index 00000000..e836dbdb --- /dev/null +++ b/original/man2/shmop.2 @@ -0,0 +1,289 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 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 +.\" Modified, 19 Sep 2002, Michael Kerrisk +.\" Added SHM_REMAP flag description +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Changed wording and placement of sentence regarding attachment +.\" of segments marked for destruction +.\" +.\" FIXME . Add an example program to this page. +.\" FIXME Linux 2.6.9 added SHM_EXEC, which should be documented +.TH SHMOP 2 2008-06-03 "Linux" "Linux Programmer's Manual" +.SH NAME +shmat, shmdt \- shared memory operations +.SH SYNOPSIS +.nf +.B #include +.B #include + +.BI "void *shmat(int " shmid ", const void *" shmaddr ", int " shmflg ); + +.BI "int shmdt(const void *" shmaddr ); +.fi +.SH DESCRIPTION +.BR shmat () +attaches the shared memory segment identified by +.I shmid +to the address space of the calling process. +The attaching address is specified by +.I shmaddr +with one of the following criteria: +.LP +If +.I shmaddr +is NULL, +the system chooses a suitable (unused) address at which to attach +the segment. +.LP +If +.I shmaddr +isn't NULL +and +.B SHM_RND +is specified in +.IR shmflg , +the attach occurs at the address equal to +.I shmaddr +rounded down to the nearest multiple of +.BR SHMLBA . +Otherwise +.I shmaddr +must be a page-aligned address at which the attach occurs. +.PP +If +.B SHM_RDONLY +is specified in +.IR shmflg , +the segment is attached for reading and the process must have +read permission for the segment. +Otherwise the segment is attached for read and write +and the process must have read and write permission for the segment. +There is no notion of a write-only shared memory segment. +.PP +The (Linux-specific) +.B SHM_REMAP +flag may be specified in +.I shmflg +to indicate that the mapping of the segment should replace +any existing mapping in the range starting at +.I shmaddr +and continuing for the size of the segment. +(Normally an +.B EINVAL +error would result if a mapping already exists in this address range.) +In this case, +.I shmaddr +must not be NULL. +.PP +The +.BR brk (2) +value of the calling process is not altered by the attach. +The segment will automatically be detached at process exit. +The same segment may be attached as a read and as a read-write +one, and more than once, in the process's address space. +.PP +A successful +.BR shmat () +call updates the members of the +.I shmid_ds +structure (see +.BR shmctl (2)) +associated with the shared memory segment as follows: +.IP +.I shm_atime +is set to the current time. +.IP +.I shm_lpid +is set to the process-ID of the calling process. +.IP +.I shm_nattch +is incremented by one. +.PP +.BR shmdt () +detaches the shared memory segment located at the address specified by +.I shmaddr +from the address space of the calling process. +The to-be-detached segment must be currently +attached with +.I shmaddr +equal to the value returned by the attaching +.BR shmat () +call. +.PP +On a successful +.BR shmdt () +call the system updates the members of the +.I shmid_ds +structure associated with the shared memory segment as follows: +.IP +.I shm_dtime +is set to the current time. +.IP +.I shm_lpid +is set to the process-ID of the calling process. +.IP +.I shm_nattch +is decremented by one. +If it becomes 0 and the segment is marked for deletion, +the segment is deleted. +.PP +After a +.BR fork (2) +the child inherits the attached shared memory segments. + +After an +.BR execve (2) +all attached shared memory segments are detached from the process. + +Upon +.BR _exit (2) +all attached shared memory segments are detached from the process. +.SH "RETURN VALUE" +On success +.BR shmat () +returns the address of the attached shared memory segment; on error +.I (void\ *)\ \-1 +is returned, and +.I errno +is set to indicate the cause of the error. + +On success +.BR shmdt () +returns 0; on error \-1 is returned, and +.I errno +is set to indicate the cause of the error. +.SH ERRORS +When +.BR shmat () +fails, +.I errno +is set to one of the following: +.TP +.B EACCES +The calling process does not have the required permissions for +the requested attach type, and does not have the +.B CAP_IPC_OWNER +capability. +.TP +.B EINVAL +Invalid +.I shmid +value, unaligned (i.e., not page-aligned and \fBSHM_RND\fP was not +specified) or invalid +.I shmaddr +value, or can't attach segment at +.IR shmaddr , +or +.B SHM_REMAP +was specified and +.I shmaddr +was NULL. +.TP +.B ENOMEM +Could not allocate memory for the descriptor or for the page tables. +.PP +When +.BR shmdt () +fails, +.I errno +is set as follows: +.TP +.B EINVAL +There is no shared memory segment attached at +.IR shmaddr ; +or, +.\" The following since 2.6.17-rc1: +.I shmaddr +is not aligned on a page boundary. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.\" SVr4 documents an additional error condition EMFILE. + +In SVID 3 (or perhaps earlier) +the type of the \fIshmaddr\fP argument was changed from +.I "char *" +into +.IR "const void *" , +and the returned type of +.BR shmat () +from +.I "char *" +into +.IR "void *" . +(Linux libc4 and libc5 have the +.I "char *" +prototypes; glibc2 has +.IR "void *" .) +.SH NOTES +Using +.BR shmat () +with +.I shmaddr +equal to NULL +is the preferred, portable way of attaching a shared memory segment. +Be aware that the shared memory segment attached in this way +may be attached at different addresses in different processes. +Therefore, any pointers maintained within the shared memory must be +made relative (typically to the starting address of the segment), +rather than absolute. +.PP +On Linux, it is possible to attach a shared memory segment even if it +is already marked to be deleted. +However, POSIX.1-2001 does not specify this behavior and +many other implementations do not support it. +.LP +The following system parameter affects +.BR shmat (): +.TP +.\" FIXME A good explanation of the rationale for the existence +.\" of SHMLBA would be useful here +.B SHMLBA +Segment low boundary address multiple. +Must be page aligned. +For the current implementation the +.B SHMLBA +value is +.BR PAGE_SIZE . +.\" FIXME That last sentence isn't true for all Linux +.\" architectures (i.e., SHMLBA != PAGE_SIZE for some architectures) +.\" -- MTK, Nov 04 +.PP +The implementation places no intrinsic limit on the per-process maximum +number of shared memory segments +.RB ( SHMSEG ). +.SH "SEE ALSO" +.BR brk (2), +.BR mmap (2), +.BR shmctl (2), +.BR shmget (2), +.BR capabilities (7), +.BR shm_overview (7), +.BR svipc (7) diff --git a/original/man2/shutdown.2 b/original/man2/shutdown.2 new file mode 100644 index 00000000..8d6d90f0 --- /dev/null +++ b/original/man2/shutdown.2 @@ -0,0 +1,100 @@ +.\" 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. +.\" +.\" $Id: shutdown.2,v 1.1.1.1 1999/03/21 22:52:23 freitag Exp $ +.\" +.\" Modified Sat Jul 24 09:57:55 1993 by Rik Faith +.\" Modified Tue Oct 22 22:04:51 1996 by Eric S. Raymond +.\" Modified 1998 by Andi Kleen +.\" +.TH SHUTDOWN 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH NAME +shutdown \- shut down part of a full-duplex connection +.SH SYNOPSIS +.B #include +.sp +.BI "int shutdown(int " sockfd ", int " how ); +.SH DESCRIPTION +The +.BR shutdown () +call causes all or part of a full-duplex connection on the socket +associated with +.I sockfd +to be shut down. +If +.I how +is +.BR SHUT_RD , +further receptions will be disallowed. +If +.I how +is +.BR SHUT_WR , +further transmissions will be disallowed. +If +.I how +is +.BR SHUT_RDWR , +further receptions and transmissions will be disallowed. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +.I sockfd +is not a valid descriptor. +.TP +.B ENOTCONN +The specified socket is not connected. +.TP +.B ENOTSOCK +.I sockfd +is a file, not a socket. +.SH "CONFORMING TO" +POSIX.1-2001, 4.4BSD (the +.BR shutdown () +function call first appeared in 4.2BSD). +.SH NOTES +The constants +.BR SHUT_RD , +.BR SHUT_WR , +.B SHUT_RDWR +have the value 0, 1, 2, +respectively, and are defined in +.I +since glibc-2.1.91. +.SH "SEE ALSO" +.BR connect (2), +.BR socket (2), +.BR socket (7) diff --git a/original/man2/sigaction.2 b/original/man2/sigaction.2 new file mode 100644 index 00000000..18510ae0 --- /dev/null +++ b/original/man2/sigaction.2 @@ -0,0 +1,702 @@ +'\" t +.\" Copyright (c) 1994,1995 Mike Battersby +.\" and Copyright 2004, 2005 Michael Kerrisk +.\" based on work by faith@cs.unc.edu +.\" +.\" 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, aeb, 960424 +.\" Modified Fri Jan 31 17:31:20 1997 by Eric S. Raymond +.\" Modified Thu Nov 26 02:12:45 1998 by aeb - add SIGCHLD stuff. +.\" Modified Sat May 8 17:40:19 1999 by Matthew Wilcox +.\" add POSIX.1b signals +.\" Modified Sat Dec 29 01:44:52 2001 by Evan Jones +.\" SA_ONSTACK +.\" Modified 2004-11-11 by Michael Kerrisk +.\" Added mention of SIGCONT under SA_NOCLDSTOP +.\" Added SA_NOCLDWAIT +.\" Modified 2004-11-17 by Michael Kerrisk +.\" Updated discussion for POSIX.1-2001 and SIGCHLD and sa_flags. +.\" Formatting fixes +.\" 2004-12-09, mtk, added SI_TKILL + other minor changes +.\" 2005-09-15, mtk, split sigpending(), sigprocmask(), sigsuspend() +.\" out of this page into separate pages. +.\" +.TH SIGACTION 2 2009-07-25 "Linux" "Linux Programmer's Manual" +.SH NAME +sigaction \- examine and change a signal action +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int sigaction(int " signum ", const struct sigaction *" act , +.BI " struct sigaction *" oldact ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR sigaction (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +The +.BR sigaction () +system call is used to change the action taken by a process on +receipt of a specific signal. +(See +.BR signal (7) +for an overview of signals.) +.PP +.I signum +specifies the signal and can be any valid signal except +.B SIGKILL +and +.BR SIGSTOP . +.PP +If +.I act +is non-NULL, the new action for signal +.I signum +is installed from +.IR act . +If +.I oldact +is non-NULL, the previous action is saved in +.IR oldact . +.PP +The +.I sigaction +structure is defined as something like: +.sp +.in +4n +.nf +struct sigaction { + void (*sa_handler)(int); + void (*sa_sigaction)(int, siginfo_t *, void *); + sigset_t sa_mask; + int sa_flags; + void (*sa_restorer)(void); +}; +.fi +.in +.PP +On some architectures a union is involved: do not assign to both +.I sa_handler +and +.IR sa_sigaction . +.PP +The +.I sa_restorer +element is obsolete and should not be used. +POSIX does not specify a +.I sa_restorer +element. +.PP +.I sa_handler +specifies the action to be associated with +.I signum +and may be +.B SIG_DFL +for the default action, +.B SIG_IGN +to ignore this signal, or a pointer to a signal handling function. +This function receives the signal number as its only argument. +.PP +If +.B SA_SIGINFO +is specified in +.IR sa_flags , +then +.I sa_sigaction +(instead of +.IR sa_handler ) +specifies the signal-handling function for +.IR signum . +This function receives the signal number as its first argument, a +pointer to a +.I siginfo_t +as its second argument and a pointer to a +.I ucontext_t +(cast to \fIvoid\ *\fP) as its third argument. +.PP +.I sa_mask +specifies a mask of signals which should be blocked +(i.e., added to the signal mask of the thread in which +the signal handler is invoked) +during execution of the signal handler. +In addition, the signal which triggered the handler +will be blocked, unless the +.B SA_NODEFER +flag is used. +.PP +.I sa_flags +specifies a set of flags which modify the behavior of the signal. +It is formed by the bitwise OR of zero or more of the following: +.RS 4 +.TP +.B SA_NOCLDSTOP +If +.I signum +is +.BR SIGCHLD , +do not receive notification when child processes stop (i.e., when they +receive one of +.BR SIGSTOP ", " SIGTSTP ", " SIGTTIN +or +.BR SIGTTOU ) +or resume (i.e., they receive +.BR SIGCONT ) +(see +.BR wait (2)). +This flag is only meaningful when establishing a handler for +.BR SIGCHLD . +.TP +.BR SA_NOCLDWAIT " (Since Linux 2.6)" +.\" To be precise: Linux 2.5.60 -- MTK +If +.I signum +is +.BR SIGCHLD , +do not transform children into zombies when they terminate. +See also +.BR waitpid (2). +This flag is only meaningful when establishing a handler for +.BR SIGCHLD , +or when setting that signal's disposition to +.BR SIG_DFL . + +If the +.B SA_NOCLDWAIT +flag is set when establishing a handler for +.BR SIGCHLD , +POSIX.1 leaves it unspecified whether a +.B SIGCHLD +signal is generated when a child process terminates. +On Linux, a +.B SIGCHLD +signal is generated in this case; +on some other implementations, it is not. +.TP +.B SA_NODEFER +Do not prevent the signal from being received from within its own signal +handler. +This flag is only meaningful when establishing a signal handler. +.B SA_NOMASK +is an obsolete, nonstandard synonym for this flag. +.TP +.B SA_ONSTACK +Call the signal handler on an alternate signal stack provided by +.BR sigaltstack (2). +If an alternate stack is not available, the default stack will be used. +This flag is only meaningful when establishing a signal handler. +.TP +.BR SA_RESETHAND +Restore the signal action to the default state once the signal handler +has been called. +This flag is only meaningful when establishing a signal handler. +.B SA_ONESHOT +is an obsolete, nonstandard synonym for this flag. +.TP +.B SA_RESTART +Provide behavior compatible with BSD signal semantics by making certain +system calls restartable across signals. +This flag is only meaningful when establishing a signal handler. +See +.BR signal (7) +for a discussion of system call restarting. +.TP +.BR SA_SIGINFO " (since Linux 2.2)" +The signal handler takes 3 arguments, not one. +In this case, +.I sa_sigaction +should be set instead of +.IR sa_handler . +This flag is only meaningful when establishing a signal handler. +.\" (The +.\" .I sa_sigaction +.\" field was added in Linux 2.1.86.) +.RE +.PP +The +.I siginfo_t +argument to +.I sa_sigaction +is a struct with the following elements: +.sp +.in +4n +.nf +siginfo_t { + int si_signo; /* Signal number */ + int si_errno; /* An errno value */ + int si_code; /* Signal code */ + int si_trapno; /* Trap number that caused + hardware-generated signal + (unused on most architectures) */ +.\" FIXME +.\" si_trapno seems to be only used on SPARC and Alpha; +.\" this page could use a little more detail on its purpose there. + pid_t si_pid; /* Sending process ID */ + uid_t si_uid; /* Real user ID of sending process */ + int si_status; /* Exit value or signal */ + clock_t si_utime; /* User time consumed */ + clock_t si_stime; /* System time consumed */ + sigval_t si_value; /* Signal value */ + int si_int; /* POSIX.1b signal */ + void *si_ptr; /* POSIX.1b signal */ + int si_overrun; /* Timer overrun count; POSIX.1b timers */ + int si_timerid; /* Timer ID; POSIX.1b timers */ +.\" In the kernel: si_tid + void *si_addr; /* Memory location which caused fault */ + int si_band; /* Band event */ + int si_fd; /* File descriptor */ +} +.fi +.in + +.IR si_signo ", " si_errno " and " si_code +are defined for all signals. +.RI ( si_errno +is generally unused on Linux.) +The rest of the struct may be a union, so that one should only +read the fields that are meaningful for the given signal: +.IP * 2 +POSIX.1b signals and +.B SIGCHLD +fill in +.IR si_pid " and " si_uid . +.IP * +POSIX.1b timers (since Linux 2.6) fill in +.I si_overrun +and +.IR si_timerid . +The +.I si_timerid +field is an internal ID used by the kernel to identify +the timer; it is not the same as the timer ID returned by +.BR timer_create (2). +.IP * +.B SIGCHLD +fills in +.IR si_status ", " si_utime " and " si_stime . +The +.I si_utime +and +.I si_stime +fields do not include the times used by waited-for children (unlike +.BR getrusage (2) +and +.BR time (2)). +In kernels up to 2.6, and since 2.6.27, these fields report +CPU time in units of +.IR sysconf(_SC_CLK_TCK) . +In 2.6 kernels before 2.6.27, +a bug meant that these fields reported time in units +of the (configurable) system jiffy (see +.BR time (7)). +\" FIXME . +.\" When si_utime and si_stime where originally implemented, the +.\" measurement unit was HZ, which was the same as clock ticks +.\" (sysconf(_SC_CLK_TCK)). In 2.6, HZ became configurable, and +.\" was *still* used as the unit to return the info these fields, +.\" with the result that the field values depended on the the +.\" configured HZ. Of course, the should have been measured in +.\" USER_HZ instead, so that sysconf(_SC_CLK_TCK) could be used to +.\" convert to seconds. I have a queued patch to fix this: +.\" http://thread.gmane.org/gmane.linux.kernel/698061/ . +.\" This patch made it into 2.6.27. +.\" But note that these fields still don't return the times of +.\" waited-for children (as is done by getrusage() and times() +.\" and wait4()). Solaris 8 does include child times. +.IP * +.IR si_int " and " si_ptr +are specified by the sender of the POSIX.1b signal. +See +.BR sigqueue (2) +for more details. +.IP * +.BR SIGILL , +.BR SIGFPE , +.BR SIGSEGV , +and +.B SIGBUS +fill in +.I si_addr +with the address of the fault. +.B SIGPOLL +fills in +.IR si_band " and " si_fd . +.PP +.I si_code +is a value (not a bit mask) +indicating why this signal was sent. +The following list shows the values which can be placed in +.I si_code +for any signal, along with reason that the signal was generated. +.RS 4 +.TP 15 +.B SI_USER +.BR kill (2) +or +.BR raise (3) +.TP +.B SI_KERNEL +Sent by the kernel. +.TP +.B SI_QUEUE +.BR sigqueue (2) +.TP +.B SI_TIMER +POSIX timer expired +.TP +.B SI_MESGQ +POSIX message queue state changed (since Linux 2.6.6); see +.BR mq_notify (3) +.TP +.B SI_ASYNCIO +AIO completed +.TP +.B SI_SIGIO +queued SIGIO +.TP +.B SI_TKILL +.BR tkill (2) +or +.BR tgkill (2) +(since Linux 2.4.19) +.\" SI_DETHREAD is defined in 2.6.9 sources, but isn't implemented +.\" It appears to have been an idea that was tried during 2.5.6 +.\" through to 2.5.24 and then was backed out. +.RE +.PP +The following values can be placed in +.I si_code +for a +.B SIGILL +signal: +.RS 4 +.TP 15 +.B ILL_ILLOPC +illegal opcode +.TP +.B ILL_ILLOPN +illegal operand +.TP +.B ILL_ILLADR +illegal addressing mode +.TP +.B ILL_ILLTRP +illegal trap +.TP +.B ILL_PRVOPC +privileged opcode +.TP +.B ILL_PRVREG +privileged register +.TP +.B ILL_COPROC +coprocessor error +.TP +.B ILL_BADSTK +internal stack error +.RE +.PP +The following values can be placed in +.I si_code +for a +.B SIGFPE +signal: +.RS 4 +.TP 15 +.B FPE_INTDIV +integer divide by zero +.TP +.B FPE_INTOVF +integer overflow +.TP +.B FPE_FLTDIV +floating-point divide by zero +.TP +.B FPE_FLTOVF +floating-point overflow +.TP +.B FPE_FLTUND +floating-point underflow +.TP +.B FPE_FLTRES +floating-point inexact result +.TP +.B FPE_FLTINV +floating-point invalid operation +.TP +.B FPE_FLTSUB +subscript out of range +.RE +.PP +The following values can be placed in +.I si_code +for a +.B SIGSEGV +signal: +.RS 4 +.TP 15 +.B SEGV_MAPERR +address not mapped to object +.TP +.B SEGV_ACCERR +invalid permissions for mapped object +.RE +.PP +The following values can be placed in +.I si_code +for a +.B SIGBUS +signal: +.RS 4 +.TP 15 +.B BUS_ADRALN +invalid address alignment +.TP +.B BUS_ADRERR +nonexistent physical address +.TP +.B BUS_OBJERR +object-specific hardware error +.RE +.PP +The following values can be placed in +.I si_code +for a +.B SIGTRAP +signal: +.RS 4 +.TP 15 +.B TRAP_BRKPT +process breakpoint +.TP +.B TRAP_TRACE +process trace trap +.RE +.PP +The following values can be placed in +.I si_code +for a +.B SIGCHLD +signal: +.RS 4 +.TP 15 +.B CLD_EXITED +child has exited +.TP +.B CLD_KILLED +child was killed +.TP +.B CLD_DUMPED +child terminated abnormally +.TP +.B CLD_TRAPPED +traced child has trapped +.TP +.B CLD_STOPPED +child has stopped +.TP +.B CLD_CONTINUED +stopped child has continued (since Linux 2.6.9) +.RE +.PP +The following values can be placed in +.I si_code +for a +.B SIGPOLL +signal: +.RS 4 +.TP 15 +.B POLL_IN +data input available +.TP +.B POLL_OUT +output buffers available +.TP +.B POLL_MSG +input message available +.TP +.B POLL_ERR +i/o error +.TP +.B POLL_PRI +high priority input available +.TP +.B POLL_HUP +device disconnected +.RE +.SH "RETURN VALUE" +.BR sigaction () +returns 0 on success and \-1 on error. +.SH ERRORS +.TP +.B EFAULT +.IR act " or " oldact +points to memory which is not a valid part of the process address space. +.TP +.B EINVAL +An invalid signal was specified. +This will also be generated if an attempt +is made to change the action for +.BR SIGKILL " or " SIGSTOP ", " +which cannot be caught or ignored. +.SH "CONFORMING TO" +POSIX.1-2001, SVr4. +.\" SVr4 does not document the EINTR condition. +.SH NOTES +A child created via +.BR fork (2) +inherits a copy of its parent's signal dispositions. +During an +.BR execve (2), +the dispositions of handled signals are reset to the default; +the dispositions of ignored signals are left unchanged. + +According to POSIX, the behavior of a process is undefined after it +ignores a +.BR SIGFPE , +.BR SIGILL , +or +.B SIGSEGV +signal that was not generated by +.BR kill (2) +or +.BR raise (3). +Integer division by zero has undefined result. +On some architectures it will generate a +.B SIGFPE +signal. +(Also dividing the most negative integer by \-1 may generate +.BR SIGFPE .) +Ignoring this signal might lead to an endless loop. +.PP +POSIX.1-1990 disallowed setting the action for +.B SIGCHLD +to +.BR SIG_IGN . +POSIX.1-2001 allows this possibility, so that ignoring +.B SIGCHLD +can be used to prevent the creation of zombies (see +.BR wait (2)). +Nevertheless, the historical BSD and System V behaviors for ignoring +.B SIGCHLD +differ, so that the only completely portable method of ensuring that +terminated children do not become zombies is to catch the +.B SIGCHLD +signal and perform a +.BR wait (2) +or similar. +.PP +POSIX.1-1990 only specified +.BR SA_NOCLDSTOP . +POSIX.1-2001 added +.BR SA_NOCLDWAIT , +.BR SA_RESETHAND , +.BR SA_NODEFER , +and +.BR SA_SIGINFO . +Use of these latter values in +.I sa_flags +may be less portable in applications intended for older +Unix implementations. +.PP +The +.B SA_RESETHAND +flag is compatible with the SVr4 flag of the same name. +.PP +The +.B SA_NODEFER +flag is compatible with the SVr4 flag of the same name under kernels +1.3.9 and newer. +On older kernels the Linux implementation +allowed the receipt of any signal, not just the one we are installing +(effectively overriding any +.I sa_mask +settings). +.PP +.BR sigaction () +can be called with a null second argument to query the current signal +handler. +It can also be used to check whether a given signal is valid for +the current machine by calling it with null second and third arguments. +.PP +It is not possible to block +.BR SIGKILL " or " SIGSTOP +(by specifying them in +.IR sa_mask ). +Attempts to do so are silently ignored. +.PP +See +.BR sigsetops (3) +for details on manipulating signal sets. +.PP +See +.BR signal (7) +for a list of the async-signal-safe functions that can be +safely called inside from inside a signal handler. +.SS Undocumented +Before the introduction of +.B SA_SIGINFO +it was also possible to get some additional information, +namely by using a +.I sa_handler +with second argument of type +.IR "struct sigcontext". +See the relevant kernel sources for details. +This use is obsolete now. +.SH BUGS +In kernels up to and including 2.6.13, specifying +.B SA_NODEFER +in +.I sa_flags +prevents not only the delivered signal from being masked during +execution of the handler, but also the signals specified in +.IR sa_mask . +This bug was fixed in kernel 2.6.14. +.SH EXAMPLE +See +.BR mprotect (2). +.SH "SEE ALSO" +.BR kill (1), +.BR kill (2), +.BR killpg (2), +.BR pause (2), +.BR sigaltstack (2), +.BR signal (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigqueue (2), +.BR sigsuspend (2), +.BR wait (2), +.BR raise (3), +.BR siginterrupt (3), +.BR sigsetops (3), +.BR sigvec (3), +.BR core (5), +.BR signal (7) diff --git a/original/man2/sigaltstack.2 b/original/man2/sigaltstack.2 new file mode 100644 index 00000000..b06bbc85 --- /dev/null +++ b/original/man2/sigaltstack.2 @@ -0,0 +1,230 @@ +'\" t +.\" Copyright (c) 2001, Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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. +.\" +.\" aeb, various minor fixes +.TH SIGALTSTACK 2 2008-10-04 "Linux" "Linux Programmer's Manual" +.SH NAME +sigaltstack \- set and/or get signal stack context +.SH SYNOPSIS +.B #include +.sp +.BI "int sigaltstack(const stack_t *" ss ", stack_t *" oss ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR sigaltstack (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\" .br +.\" .BR sigstack (): +.\" _BSD_SOURCE || _XOPEN_SOURCE >= 500 +.SH DESCRIPTION +.BR sigaltstack () +allows a process to define a new alternate +signal stack and/or retrieve the state of an existing +alternate signal stack. +An alternate signal stack is used during the +execution of a signal handler if the establishment of that handler (see +.BR sigaction (2)) +requested it. + +The normal sequence of events for using an alternate signal stack +is the following: +.TP 3 +1. +Allocate an area of memory to be used for the alternate +signal stack. +.TP +2. +Use +.BR sigaltstack () +to inform the system of the existence and +location of the alternate signal stack. +.TP +3. +When establishing a signal handler using +.BR sigaction (2), +inform the system that the signal handler should be executed +on the alternate signal stack by +specifying the \fBSA_ONSTACK\fP flag. +.P +The \fIss\fP argument is used to specify a new +alternate signal stack, while the \fIoss\fP argument +is used to retrieve information about the currently +established signal stack. +If we are interested in performing just one +of these tasks then the other argument can be specified as NULL. +Each of these arguments is a structure of the following type: +.sp +.in +4n +.nf +typedef struct { + void *ss_sp; /* Base address of stack */ + int ss_flags; /* Flags */ + size_t ss_size; /* Number of bytes in stack */ +} stack_t; +.fi +.in + +To establish a new alternate signal stack, +\fIss.ss_flags\fP is set to zero, and \fIss.ss_sp\fP and +\fIss.ss_size\fP specify the starting address and size of +the stack. +The constant \fBSIGSTKSZ\fP is defined to be large enough +to cover the usual size requirements for an alternate signal stack, +and the constant \fBMINSIGSTKSZ\fP defines the minimum +size required to execute a signal handler. + +When a signal handler is invoked on the alternate stack, +the kernel automatically aligns the address given in \fIss.ss_sp\fP +to a suitable address boundary for the underlying hardware architecture. + +To disable an existing stack, specify \fIss.ss_flags\fP +as \fBSS_DISABLE\fP. +In this case, the remaining fields +in \fIss\fP are ignored. + +If \fIoss\fP is not NULL, then it is used to return information about +the alternate signal stack which was in effect prior to the +call to +.BR sigaltstack (). +The \fIoss.ss_sp\fP and \fIoss.ss_size\fP fields return the starting +address and size of that stack. +The \fIoss.ss_flags\fP may return either of the following values: +.TP +.B SS_ONSTACK +The process is currently executing on the alternate signal stack. +(Note that it is not possible +to change the alternate signal stack if the process is +currently executing on it.) +.TP +.B SS_DISABLE +The alternate signal stack is currently disabled. +.SH "RETURN VALUE" +.BR sigaltstack () +returns 0 on success, or \-1 on failure with +\fIerrno\fP set to indicate the error. +.SH ERRORS +.TP +.B EFAULT +Either \fIss\fP or \fIoss\fP is not NULL and points to an area +outside of the process's address space. +.TP +.B EINVAL +\fIss\fP is not NULL and the \fIss_flags\fP field contains +a nonzero value other than +.BR SS_DISABLE . +.TP +.B ENOMEM +The specified size of the new alternate signal stack +(\fIss.ss_size\fP) was less than \fBMINSTKSZ\fP. +.TP +.B EPERM +An attempt was made to change the alternate signal stack while +it was active (i.e., the process was already executing +on the current alternate signal stack). +.SH "CONFORMING TO" +SUSv2, SVr4, POSIX.1-2001. +.SH NOTES +The most common usage of an alternate signal stack is to handle the +.B SIGSEGV +signal that is generated if the space available for the +normal process stack is exhausted: in this case, a signal handler for +.B SIGSEGV +cannot be invoked on the process stack; if we wish to handle it, +we must use an alternate signal stack. +.P +Establishing an alternate signal stack is useful if a process +expects that it may exhaust its standard stack. +This may occur, for example, because the stack grows so large +that it encounters the upwardly growing heap, or it reaches a +limit established by a call to \fBsetrlimit(RLIMIT_STACK, &rlim)\fP. +If the standard stack is exhausted, the kernel sends +the process a \fBSIGSEGV\fP signal. +In these circumstances the only way to catch this signal is +on an alternate signal stack. +.P +On most hardware architectures supported by Linux, stacks grow +downwards. +.BR sigaltstack () +automatically takes account +of the direction of stack growth. +.P +Functions called from a signal handler executing on an alternate +signal stack will also use the alternate signal stack. +(This also applies to any handlers invoked for other signals while +the process is executing on the alternate signal stack.) +Unlike the standard stack, the system does not +automatically extend the alternate signal stack. +Exceeding the allocated size of the alternate signal stack will +lead to unpredictable results. +.P +A successful call to +.BR execve (2) +removes any existing alternate +signal stack. +A child process created via +.BR fork () +inherits a copy of its parent's alternate signal stack settings. +.P +.BR sigaltstack () +supersedes the older +.BR sigstack () +call. +For backwards compatibility, glibc also provides +.BR sigstack (). +All new applications should be written using +.BR sigaltstack (). +.SS History +4.2BSD had a +.BR sigstack () +system call. +It used a slightly +different struct, and had the major disadvantage that the caller +had to know the direction of stack growth. +.SH EXAMPLE +The following code segment demonstrates the use of +.BR sigaltstack (): + +.in +4n +.nf +stack_t ss; + +ss.ss_sp = malloc(SIGSTKSZ); +if (ss.ss_sp == NULL) + /* Handle error */; +ss.ss_size = SIGSTKSZ; +ss.ss_flags = 0; +if (sigaltstack(&ss, NULL) == \-1) + /* Handle error */; +.fi +.in +.SH "SEE ALSO" +.BR execve (2), +.BR setrlimit (2), +.BR sigaction (2), +.BR siglongjmp (3), +.BR sigsetjmp (3), +.BR signal (7) diff --git a/original/man2/signal.2 b/original/man2/signal.2 new file mode 100644 index 00000000..3df1d1ce --- /dev/null +++ b/original/man2/signal.2 @@ -0,0 +1,278 @@ +.\" Copyright (c) 2000 Andries Brouwer +.\" and Copyright (c) 2007 Michael Kerrisk +.\" and Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" based on work by Rik Faith +.\" and Mike Battersby . +.\" +.\" 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 2004-11-19, mtk: +.\" added pointer to sigaction.2 for details of ignoring SIGCHLD +.\" 2007-06-03, mtk: strengthened portability warning, and rewrote +.\" various sections. +.\" 2008-07-11, mtk: rewrote and expanded portability discussion. +.\" +.TH SIGNAL 2 2008-07-11 "Linux" "Linux Programmer's Manual" +.SH NAME +signal \- ANSI C signal handling +.SH SYNOPSIS +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "sighandler_t signal(int " signum ", sighandler_t " handler ); +.SH DESCRIPTION +The behavior of +.BR signal () +varies across Unix versions, +and has also varied historically across different versions of Linux. +\fBAvoid its use\fP: use +.BR sigaction (2) +instead. +See \fIPortability\fP below. + +.BR signal () +sets the disposition of the signal +.I signum +to +.IR handler , +which is either +.BR SIG_IGN , +.BR SIG_DFL , +or the address of a programmer-defined function (a "signal handler"). + +If the signal +.I signum +is delivered to the process, then one of the following happens: +.TP 3 +* +If the disposition is set to +.BR SIG_IGN , +then the signal is ignored. +.TP +* +If the disposition is set to +.BR SIG_DFL , +then the default action associated with the signal (see +.BR signal (7)) +occurs. +.TP +* +If the disposition is set to a function, +then first either the disposition is reset to +.BR SIG_DFL , +or the signal is blocked (see \fIPortability\fP below), and then +.I handler +is called with argument +.IR signum . +If invocation of the handler caused the signal to be blocked, +then the signal is unblocked upon return from the handler. +.PP +The signals +.B SIGKILL +and +.B SIGSTOP +cannot be caught or ignored. +.SH "RETURN VALUE" +.BR signal () +returns the previous value of the signal handler, or +.B SIG_ERR +on error. +.SH ERRORS +.TP +.B EINVAL +.I signum +is invalid. +.SH "CONFORMING TO" +C89, C99, POSIX.1-2001. +.SH NOTES +The effects of +.BR signal () +in a multithreaded process are unspecified. +.PP +According to POSIX, the behavior of a process is undefined after it +ignores a +.BR SIGFPE , +.BR SIGILL , +or +.B SIGSEGV +signal that was not generated by +.BR kill (2) +or +.BR raise (3). +Integer division by zero has undefined result. +On some architectures it will generate a +.B SIGFPE +signal. +(Also dividing the most negative integer by \-1 may generate +.BR SIGFPE .) +Ignoring this signal might lead to an endless loop. +.PP +See +.BR sigaction (2) +for details on what happens when +.B SIGCHLD +is set to +.BR SIG_IGN . +.PP +See +.BR signal (7) +for a list of the async-signal-safe functions that can be +safely called from inside a signal handler. +.PP +The use of +.I sighandler_t +is a GNU extension. +Various versions of libc predefine this type; libc4 and libc5 define +.IR SignalHandler ; +glibc defines +.I sig_t +and, when +.B _GNU_SOURCE +is defined, also +.IR sighandler_t . +Without use of such a type, the declaration of +.BR signal () +is the somewhat harder to read: +.in +4n +.nf + +.BI "void ( *" signal "(int " signum ", void (*" handler ")(int)) ) (int);" +.fi +.in +.SS Portability +The only portable use of +.BR signal () +is to set a signal's disposition to +.BR SIG_DFL +or +.BR SIG_IGN . +The semantics when using +.BR signal () +to establish a signal handler vary across systems +(and POSIX.1 explicitly permits this variation); +.B do not use it for this purpose. + +POSIX.1 solved the portability mess by specifying +.BR sigaction (2), +which provides explicit control of the semantics when a +signal handler is invoked; use that interface instead of +.BR signal (). + +In the original Unix systems, when a handler that was established using +.BR signal () +was invoked by the delivery of a signal, +the disposition of the signal would be reset to +.BR SIG_DFL , +and the system did not block delivery of further instances of the signal. +System V also provides these semantics for +.BR signal (). +This was bad because the signal might be delivered again +before the handler had a chance to reestablish itself. +Furthermore, rapid deliveries of the same signal could +result in recursive invocations of the handler. + +BSD improved on this situation by changing the semantics of +signal handling +(but, unfortunately, silently changed the semantics +when establishing a handler with +.BR signal ()). +On BSD, when a signal handler is invoked, +the signal disposition is not reset, +and further instances of the signal are blocked from +being delivered while the handler is executing. + +The situation on Linux is as follows: +.IP * 2 +The kernel's +.BR signal () +system call provides System V semantics. +.IP * +By default, in glibc 2 and later, the +.BR signal () +wrapper function does not invoke the kernel system call. +Instead, it calls +.BR sigaction (2) +using flags that supply BSD semantics. +This default behavior is provided as long as the +.B _BSD_SOURCE +feature test macro is defined. +By default, +.B _BSD_SOURCE +is defined; +it is also implicitly defined if one defines +.BR _GNU_SOURCE , +and can of course be explicitly defined. +.sp +On glibc 2 and later, if the +.B _BSD_SOURCE +feature test macro is not defined, then +.BR signal () +provides System V semantics. +(The default implicit definition of +.B _BSD_SOURCE +is not provided if one invokes +.BR gcc (1) +in one of its standard modes +.RI ( -std=xxx " or " -ansi ) +or defines various other feature test macros such as +.BR _POSIX_SOURCE , +.BR _XOPEN_SOURCE , +or +.BR _SVID_SOURCE ; +see +.BR feature_test_macros (7).) +.\" +.\" System V semantics are also provided if one uses the separate +.\" .BR sysv_signal (3) +.\" function. +.IP * +The +.BR signal () +function in Linux libc4 and libc5 provide System V semantics. +If one on a libc5 system includes +.I +instead of +.IR , +then +.BR signal () +provides BSD semantics. +.SH "SEE ALSO" +.BR kill (1), +.BR alarm (2), +.BR kill (2), +.BR killpg (2), +.BR pause (2), +.BR sigaction (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigqueue (2), +.BR sigsuspend (2), +.BR bsd_signal (3), +.BR raise (3), +.BR siginterrupt (3), +.BR sigsetops (3), +.BR sigvec (3), +.BR sysv_signal (3), +.BR feature_test_macros (7), +.BR signal (7) diff --git a/original/man2/signalfd.2 b/original/man2/signalfd.2 new file mode 100644 index 00000000..05d3b089 --- /dev/null +++ b/original/man2/signalfd.2 @@ -0,0 +1,442 @@ +.\" Copyright (C) 2008 Michael Kerrisk +.\" starting from a version by 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 +.\" +.TH SIGNALFD 2 2009-01-13 Linux "Linux Programmer's Manual" +.SH NAME +signalfd \- create a file descriptor for accepting signals +.SH SYNOPSIS +.B #include +.sp +.BI "int signalfd(int " fd ", const sigset_t *" mask ", int " flags ); +.SH DESCRIPTION +.BR signalfd () +creates a file descriptor that can be used to accept signals +targeted at the caller. +This provides an alternative to the use of a signal handler or +.BR sigwaitinfo (2), +and has the advantage that the file descriptor may be monitored by +.BR select (2), +.BR poll (2), +and +.BR epoll (7). + +The +.I mask +argument specifies the set of signals that the caller +wishes to accept via the file descriptor. +This argument is a signal set whose contents can be initialized +using the macros described in +.BR sigsetops (3). +Normally, the set of signals to be received via the +file descriptor should be blocked using +.BR sigprocmask (2), +to prevent the signals being handled according to their default +dispositions. +It is not possible to receive +.B SIGKILL +or +.B SIGSTOP +signals via a signalfd file descriptor; +these signals are silently ignored if specified in +.IR mask . + +If the +.I fd +argument is \-1, +then the call creates a new file descriptor and associates the +signal set specified in +.I mask +with that descriptor. +If +.I fd +is not \-1, +then it must specify a valid existing signalfd file descriptor, and +.I mask +is used to replace the signal set associated with that descriptor. + +Starting with Linux 2.6.27, the following values may be bitwise ORed in +.IR flags +to change the behaviour of +.BR signalfd (): +.TP 14 +.B SFD_NONBLOCK +Set the +.BR O_NONBLOCK +file status flag on the new open file description. +Using this flag saves extra calls to +.BR fcntl (2) +to achieve the same result. +.TP +.B SFD_CLOEXEC +Set the close-on-exec +.RB ( FD_CLOEXEC ) +flag on the new file descriptor. +See the description of the +.B O_CLOEXEC +flag in +.BR open (2) +for reasons why this may be useful. +.PP +In Linux up to version 2.6.26, the +.I flags +argument is unused, and must be specified as zero. + +.BR signalfd () +returns a file descriptor that supports the following operations: +.TP +.BR read (2) +If one or more of the signals specified in +.I mask +is pending for the process, then the buffer supplied to +.BR read (2) +is used to return one or more +.I signalfd_siginfo +structures (see below) that describe the signals. +The +.BR read (2) +returns information for as many signals as are pending and will +fit in the supplied buffer. +The buffer must be at least +.I "sizeof(struct signalfd_siginfo)" +bytes. +The return value of the +.BR read (2) +is the total number of bytes read. +.IP +As a consequence of the +.BR read (2), +the signals are consumed, +so that they are no longer pending for the process +(i.e., will not be caught by signal handlers, +and cannot be accepted using +.BR sigwaitinfo (2)). +.IP +If none of the signals in +.I mask +is pending for the process, then the +.BR read (2) +either blocks until one of the signals in +.I mask +is generated for the process, +or fails with the error +.B EAGAIN +if the file descriptor has been made nonblocking. +.TP +.BR poll "(2), " select "(2) (and similar)" +The file descriptor is readable +(the +.BR select (2) +.I readfds +argument; the +.BR poll (2) +.B POLLIN +flag) +if one or more of the signals in +.I mask +is pending for the process. +.IP +The signalfd file descriptor also supports the other file-descriptor +multiplexing APIs: +.BR pselect (2), +.BR ppoll (2), +and +.BR epoll (7). +.TP +.BR close (2) +When the file descriptor is no longer required it should be closed. +When all file descriptors associated with the same signalfd object +have been closed, the resources for object are freed by the kernel. +.SS The signalfd_siginfo structure +The format of the +.I signalfd_siginfo +structure(s) returned by +.BR read (2)s +from a signalfd file descriptor is as follows: +.in +4n +.nf + +struct signalfd_siginfo { + uint32_t ssi_signo; /* Signal number */ + int32_t ssi_errno; /* Error number (unused) */ + int32_t ssi_code; /* Signal code */ + uint32_t ssi_pid; /* PID of sender */ + uint32_t ssi_uid; /* Real UID of sender */ + int32_t ssi_fd; /* File descriptor (SIGIO) */ + uint32_t ssi_tid; /* Kernel timer ID (POSIX timers) + uint32_t ssi_band; /* Band event (SIGIO) */ + uint32_t ssi_overrun; /* POSIX timer overrun count */ + uint32_t ssi_trapno; /* Trap number that caused signal */ +.\" ssi_trapno is unused on most arches + int32_t ssi_status; /* Exit status or signal (SIGCHLD) */ + int32_t ssi_int; /* Integer sent by sigqueue(2) */ + uint64_t ssi_ptr; /* Pointer sent by sigqueue(2) */ + uint64_t ssi_utime; /* User CPU time consumed (SIGCHLD) */ + uint64_t ssi_stime; /* System CPU time consumed (SIGCHLD) */ + uint64_t ssi_addr; /* Address that generated signal + (for hardware-generated signals) */ + uint8_t pad[\fIX\fP]; /* Pad size to 128 bytes (allow for + additional fields in the future) */ +}; + +.fi +.in +Each of the fields in this structure +is analogous to the similarly named field in the +.I siginfo_t +structure. +The +.I siginfo_t +structure is described in +.BR sigaction (2). +Not all fields in the returned +.I signalfd_siginfo +structure will be valid for a specific signal; +the set of valid fields can be determined from the value returned in the +.I ssi_code +field. +This field is the analog of the +.I siginfo_t +.I si_code +field; see +.BR sigaction (2) +for details. +.SS fork(2) semantics +After a +.BR fork (2), +the child inherits a copy of the signalfd file descriptor. +A +.BR read (2) +from the file descriptor in the child will return information +about signals queued to the child. +.SS execve(2) semantics +Just like any other file descriptor, +a signalfd file descriptor remains open across an +.BR execve (2), +unless it has been marked for close-on-exec (see +.BR fcntl (2)). +Any signals that were available for reading before the +.BR execve (2) +remain available to the newly loaded program. +(This is analogous to traditional signal semantics, +where a blocked signal that is pending remains pending across an +.BR execve (2).) +.SS Thread semantics +The semantics of signalfd file descriptors in a multithreaded program +mirror the standard semantics for signals. +In other words, +when a thread reads from a signalfd file descriptor, +it will read the signals that are directed to the thread +itself and the signals that are directed to the process +(i.e., the entire thread group). +(A thread will not be able to read signals that are directed +to other threads in the process.) +.SH "RETURN VALUE" +On success, +.BR signalfd () +returns a signalfd file descriptor; +this is either a new file descriptor (if +.I fd +was \-1), or +.I fd +if +.I fd +was a valid signalfd file descriptor. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EBADF +The +.I fd +file descriptor is not a valid file descriptor. +.TP +.B EINVAL +.I fd +is not a valid signalfd file descriptor. +.\" or, the +.\" .I sizemask +.\" argument is not equal to +.\" .IR sizeof(sigset_t) ; +.TP +.B EINVAL +.I flags +is invalid; +or, in Linux 2.6.26 or earlier, +.I flags +is nonzero. +.TP +.B EMFILE +The per-process limit of open file descriptors has been reached. +.TP +.B ENFILE +The system-wide limit on the total number of open files has been +reached. +.TP +.B ENODEV +Could not mount (internal) anonymous inode device. +.TP +.B ENOMEM +There was insufficient memory to create a new signalfd file descriptor. +.SH VERSIONS +.BR signalfd () +is available on Linux since kernel 2.6.22. +Working support is provided in glibc since version 2.8. +.\" signalfd() is in glibc 2.7, but reportedly does not build +The +.BR signalfd4 () +system call (see NOTES) is available on Linux since kernel 2.6.27. +.SH CONFORMING TO +.BR signalfd () +and +.BR signalfd4 () +are Linux-specific. +.SH NOTES +The underlying Linux system call requires an additional argument, +.IR "size_t sizemask" , +which specifies the size of the +.I mask +argument. +The glibc +.BR signalfd () +wrapper function does not include this argument, +since it provides the required value for the underlying system call. + +A process can create multiple signalfd file descriptors. +This makes it possible to accept different signals +on different file descriptors. +(This may be useful if monitoring the file descriptors using +.BR select (2), +.BR poll (2), +or +.BR epoll (7): +the arrival of different signals will make different descriptors ready.) +If a signal appears in the +.I mask +of more than one of the file descriptors, then occurrences +of that signal can be read (once) from any one of the descriptors. +.SS Underlying Linux system calls +There are two underlying Linux system calls: +.BR signalfd () +and the more recent +.BR signalfd4 (). +The former system call does not implement a +.I flags +argument. +The latter system call implements the +.I flags +values described above. +Starting with glibc 2.9, the +.BR signalfd () +wrapper function will use +.BR signalfd4 () +where it is available. +.SH BUGS +In kernels before 2.6.25, the +.I ssi_ptr +and +.I ssi_int +fields are not filled in with the data accompanying a signal sent by +.BR sigqueue (2). +.\" The fix also was put into 2.6.24.5 +.SH EXAMPLE +The program below accepts the signals +.B SIGINT +and +.B SIGQUIT +via a signalfd file descriptor. +The program terminates after accepting a +.B SIGQUIT +signal. +The following shell session demonstrates the use of the program: +.in +4n +.nf + +.RB "$" " ./signalfd_demo" +.BR "^C" " # Control\-C generates SIGINT" +Got SIGINT +.B ^C +Got SIGINT +\fB^\\\fP # Control\-\\ generates SIGQUIT +Got SIGQUIT +$ +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int +main(int argc, char *argv[]) +{ + sigset_t mask; + int sfd; + struct signalfd_siginfo fdsi; + ssize_t s; + + sigemptyset(&mask); + sigaddset(&mask, SIGINT); + sigaddset(&mask, SIGQUIT); + + /* Block signals so that they aren\(aqt handled + according to their default dispositions */ + + if (sigprocmask(SIG_BLOCK, &mask, NULL) == \-1) + handle_error("sigprocmask"); + + sfd = signalfd(\-1, &mask, 0); + if (sfd == \-1) + handle_error("signalfd"); + + for (;;) { + s = read(sfd, &fdsi, sizeof(struct signalfd_siginfo)); + if (s != sizeof(struct signalfd_siginfo)) + handle_error("read"); + + if (fdsi.ssi_signo == SIGINT) { + printf("Got SIGINT\\n"); + } else if (fdsi.ssi_signo == SIGQUIT) { + printf("Got SIGQUIT\\n"); + exit(EXIT_SUCCESS); + } else { + printf("Read unexpected signal\\n"); + } + } +} +.fi +.SH "SEE ALSO" +.BR eventfd (2), +.BR poll (2), +.BR read (2), +.BR select (2), +.BR sigaction (2), +.BR sigprocmask (2), +.BR sigwaitinfo (2), +.BR timerfd_create (2), +.BR sigsetops (3), +.BR sigwait (3), +.BR epoll (7), +.BR signal (7) diff --git a/original/man2/signalfd4.2 b/original/man2/signalfd4.2 new file mode 100644 index 00000000..8dbea5cb --- /dev/null +++ b/original/man2/signalfd4.2 @@ -0,0 +1 @@ +.so man2/signalfd.2 diff --git a/original/man2/sigpending.2 b/original/man2/sigpending.2 new file mode 100644 index 00000000..c17de686 --- /dev/null +++ b/original/man2/sigpending.2 @@ -0,0 +1,89 @@ +.\" Copyright (c) 2005 Michael Kerrisk +.\" based on earlier work by faith@cs.unc.edu and +.\" Mike Battersby +.\" +.\" 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-09-15, mtk, Created new page by splitting off from sigaction.2 +.\" +.TH SIGPENDING 2 2008-10-04 "Linux" "Linux Programmer's Manual" +.SH NAME +sigpending \- examine pending signals +.SH SYNOPSIS +.B #include +.sp +.BI "int sigpending(sigset_t *" set ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR sigpending (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +.PP +.BR sigpending () +returns the set of signals that are pending for delivery to the calling +thread (i.e., the signals which have been raised while blocked). +The mask of pending signals is returned in +.IR set . +.SH "RETURN VALUE" +.BR sigpending () +returns 0 on success and \-1 on error. +.SH ERRORS +.TP +.B EFAULT +.I set +points to memory which is not a valid part of the process address space. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +See +.BR sigsetops (3) +for details on manipulating signal sets. + +The set of signals that is pending for a thread +is the union of the set of signals that is pending for that thread +and the set of signals that is pending for the process as a whole; see +.BR signal (7). + +A child created via +.BR fork (2) +initially has an empty pending signal set; +the pending signal set is preserved across an +.BR execve (2). +.SH BUGS +In versions of glibc up to and including 2.2.1, +there is a bug in the wrapper function for +.BR sigpending () +which means that information about pending real-time signals +is not correctly returned. +.SH "SEE ALSO" +.BR kill (2), +.BR sigaction (2), +.BR signal (2), +.BR sigprocmask (2), +.BR sigsuspend (2), +.BR sigsetops (3), +.BR signal (7) diff --git a/original/man2/sigprocmask.2 b/original/man2/sigprocmask.2 new file mode 100644 index 00000000..db5732e4 --- /dev/null +++ b/original/man2/sigprocmask.2 @@ -0,0 +1,141 @@ +.\" Copyright (c) 2005 Michael Kerrisk +.\" based on earlier work by faith@cs.unc.edu and +.\" Mike Battersby +.\" +.\" 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-09-15, mtk, Created new page by splitting off from sigaction.2 +.\" +.TH SIGPROCMASK 2 2008-10-17 "Linux" "Linux Programmer's Manual" +.SH NAME +sigprocmask \- examine and change blocked signals +.SH SYNOPSIS +.B #include +.sp +.BI "int sigprocmask(int " how ", const sigset_t *" set , +.BI "sigset_t *" oldset ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR sigprocmask (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +.BR sigprocmask () +is used to fetch and/or change the signal mask of the calling thread. +The signal mask is the set of signals whose delivery is currently +blocked for the caller +(see also +.BR signal (7) +for more details). + +The behavior of the call is dependent on the value of +.IR how , +as follows. +.TP +.B SIG_BLOCK +The set of blocked signals is the union of the current set and the +.I set +argument. +.TP +.B SIG_UNBLOCK +The signals in +.I set +are removed from the current set of blocked signals. +It is permissible to attempt to unblock a signal which is not blocked. +.TP +.B SIG_SETMASK +The set of blocked signals is set to the argument +.IR set . +.PP +If +.I oldset +is non-NULL, the previous value of the signal mask is stored in +.IR oldset . + +If +.I set +is NULL, then the signal mask is unchanged (i.e., +.I how +is ignored), +but the current value of the signal mask is nevertheless returned in +.I oldset +(if it is not NULL). + +The use of +.BR sigprocmask () +is unspecified in a multithreaded process; see +.BR pthread_sigmask (3). +.SH "RETURN VALUE" +.BR sigprocmask () +returns 0 on success and \-1 on error. +.SH ERRORS +.B EINVAL +The value specified in +.I how +was invalid. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +It is not possible to block +.BR SIGKILL " or " SIGSTOP . +Attempts to do so are silently ignored. + +Each of the threads in a process has its own signal mask. + +A child created via +.BR fork (2) +inherits a copy of its parent's signal mask; +the signal mask is preserved across +.BR execve (2). + +If +.BR SIGBUS , +.BR SIGFPE , +.BR SIGILL , +or +.B SIGSEGV +are generated +while they are blocked, the result is undefined, +unless the signal was generated by the +.BR kill (2), +.BR sigqueue (2), +or +.BR raise (3). +.PP +See +.BR sigsetops (3) +for details on manipulating signal sets. +.SH "SEE ALSO" +.BR kill (2), +.BR pause (2), +.BR sigaction (2), +.BR signal (2), +.BR sigpending (2), +.BR sigqueue (2), +.BR sigsuspend (2), +.BR pthread_sigmask (3), +.BR sigsetops (3), +.BR signal (7) diff --git a/original/man2/sigqueue.2 b/original/man2/sigqueue.2 new file mode 100644 index 00000000..cefd5940 --- /dev/null +++ b/original/man2/sigqueue.2 @@ -0,0 +1,151 @@ +.\" 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. +.\" +.\" added note on self-signaling, aeb, 2002-06-07 +.\" added note on CAP_KILL, mtk, 2004-06-16 +.\" +.TH SIGQUEUE 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +sigqueue, rt_sigqueueinfo \- queue a signal and data to a process +.SH SYNOPSIS +.B #include +.sp +.BI "int sigqueue(pid_t " pid ", int " sig ", const union sigval " value ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR sigqueue (): +_POSIX_C_SOURCE\ >=\ 199309L +.SH DESCRIPTION +.BR sigqueue () +sends the signal specified in +.I sig +to the process whose PID is given in +.IR pid . +The permissions required to send a signal are the same as for +.BR kill (2). +As with +.BR kill (2), +the null signal (0) can be used to check if a process with a given +PID exists. +.PP +The +.I value +argument is used to specify an accompanying item of data (either an integer +or a pointer value) to be sent with the signal, and has the following type: +.sp +.in +4n +.nf +union sigval { + int sival_int; + void *sival_ptr; +}; +.fi +.in + +If the receiving process has installed a handler for this signal using the +.B SA_SIGINFO +flag to +.BR sigaction (2), +then it can obtain this data via the +.I si_value +field of the +.I siginfo_t +structure passed as the second argument to the handler. +Furthermore, the +.I si_code +field of that structure will be set to +.BR SI_QUEUE . +.SH "RETURN VALUE" +On success, +.BR sigqueue () +returns 0, indicating that the signal was successfully +queued to the receiving process. +Otherwise \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EAGAIN +The limit of signals which may be queued has been reached. +(See +.BR signal (7) +for further information.) +.TP +.B EINVAL +.I sig +was invalid. +.TP +.B EPERM +The process does not have permission to send the signal +to the receiving process. +For the required permissions, see +.BR kill (2). +.TP +.B ESRCH +No process has a PID matching +.IR pid . +.SH VERSIONS +This system call first appeared in Linux 2.2. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +If this function results in the sending of a signal to the process +that invoked it, and that signal was not blocked by the calling thread, +and no other threads were willing to handle this signal (either by +having it unblocked, or by waiting for it using +.BR sigwait (3)), +then at least some signal must be delivered to this thread before this +function returns. + +On Linux, the underlying system call is actually named +.BR rt_sigqueueinfo (), +and differs in its third argument, which is the +.I siginfo_t +structure that will be supplied to the receiving process's +signal handler or returned by the receiving process's +.BR sigtimedwait (2) +call. +Inside the glibc +.BR sigqueue () +wrapper, this argument, +.IR info , +is initialized as follows: +.in +4n +.nf + +info.si_signo = sig; /* argument supplied to sigqueue() */ +info.si_code = SI_QUEUE; +info.si_pid = getpid(); /* Process ID of sender */ +info.si_uid = getuid(); /* Real UID of sender */ +info.si_value = val; /* argument supplied to sigqueue() */ +.fi +.in +.SH "SEE ALSO" +.BR kill (2), +.BR sigaction (2), +.BR signal (2), +.BR sigwait (3), +.BR signal (7) diff --git a/original/man2/sigreturn.2 b/original/man2/sigreturn.2 new file mode 100644 index 00000000..67075c0e --- /dev/null +++ b/original/man2/sigreturn.2 @@ -0,0 +1,76 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created Sat Aug 21 1995 Thomas K. Dyas +.\" Modified Tue Oct 22 22:09:03 1996 by Eric S. Raymond +.\" 2008-06-26, mtk, added some more detail on the work done by sigreturn() +.\" +.TH SIGRETURN 2 2008-06-26 "Linux" "Linux Programmer's Manual" +.SH NAME +sigreturn \- return from signal handler and cleanup stack frame +.SH SYNOPSIS +.BI "int sigreturn(unsigned long " __unused ); +.SH DESCRIPTION +When the Linux kernel creates the stack frame for a signal handler, a +call to +.BR sigreturn () +is inserted into the stack frame so that upon +return from the signal handler, +.BR sigreturn () +will be called. + +This +.BR sigreturn () +call undoes everything that was +done\(emchanging the process's signal mask, switching stacks (see +.BR sigaltstack "(2))\(emin " +order to invoke the signal handler: +it restores the process's signal mask, switches stacks, +and restores the process's context (registers, processor flags), +so that the process directly resumes execution +at the point where it was interrupted by the signal. +.SH "RETURN VALUE" +.BR sigreturn () +never returns. +.SH FILES +/usr/src/linux/arch/i386/kernel/signal.c +.br +/usr/src/linux/arch/alpha/kernel/entry.S +.SH "CONFORMING TO" +.BR sigreturn () +is specific to Linux and should not be used in programs intended to be +portable. +.SH NOTES +The +.BR sigreturn () +call is used by the kernel to implement signal handlers. +It should +.B never +be called directly. +Better yet, the specific use of the +.I __unused +argument varies depending on the architecture. +.SH "SEE ALSO" +.BR kill (2), +.BR sigaltstack (2), +.BR signal (2), +.BR signal (7) diff --git a/original/man2/sigsuspend.2 b/original/man2/sigsuspend.2 new file mode 100644 index 00000000..cf85ed87 --- /dev/null +++ b/original/man2/sigsuspend.2 @@ -0,0 +1,113 @@ +.\" Copyright (c) 2005 Michael Kerrisk +.\" based on earlier work by faith@cs.unc.edu and +.\" Mike Battersby +.\" +.\" 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-09-15, mtk, Created new page by splitting off from sigaction.2 +.\" +.TH SIGSUSPEND 2 2008-08-29 "Linux" "Linux Programmer's Manual" +.SH NAME +sigsuspend \- wait for a signal +.SH SYNOPSIS +.B #include +.sp +.BI "int sigsuspend(const sigset_t *" mask ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR sigsuspend (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +.BR sigsuspend () +temporarily replaces the signal mask of the calling process with the +mask given by +.I mask +and then suspends the process until delivery of a signal whose +action is to invoke a signal handler or to terminate a process. + +If the signal terminates the process, then +.BR sigsuspend () +does not return. +If the signal is caught, then +.BR sigsuspend () +returns after the signal handler returns, +and the signal mask is restored to the state before the call to +.BR sigsuspend (). + +It is not possible to block +.B SIGKILL +or +.BR SIGSTOP ; +specifying these signals in +.IR mask , +has no effect on the process's signal mask. +.SH "RETURN VALUE" +.BR sigsuspend () +always returns \-1, normally with the error +.BR EINTR . +.SH ERRORS +.TP +.B EFAULT +.I mask +points to memory which is not a valid part of the process address space. +.TP +.B EINTR +The call was interrupted by a signal. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +.PP +Normally, +.BR sigsuspend () +is used in conjunction with +.BR sigprocmask (2) +in order to prevent delivery of a signal during the execution of a +critical code section. +The caller first blocks the signals with +.BR sigprocmask (2). +When the critical code has completed, the caller then waits for the +signals by calling +.BR sigsuspend () +with the signal mask that was returned by +.BR sigprocmask (2) +(in the +.I oldset +argument). +.PP +See +.BR sigsetops (3) +for details on manipulating signal sets. +.SH "SEE ALSO" +.BR kill (2), +.BR pause (2), +.BR sigaction (2), +.BR signal (2), +.BR sigprocmask (2), +.BR sigwaitinfo (2), +.BR sigsetops (3), +.BR sigwait (3), +.BR signal (7) diff --git a/original/man2/sigtimedwait.2 b/original/man2/sigtimedwait.2 new file mode 100644 index 00000000..1b13df15 --- /dev/null +++ b/original/man2/sigtimedwait.2 @@ -0,0 +1 @@ +.so man2/sigwaitinfo.2 diff --git a/original/man2/sigwaitinfo.2 b/original/man2/sigwaitinfo.2 new file mode 100644 index 00000000..d0a53743 --- /dev/null +++ b/original/man2/sigwaitinfo.2 @@ -0,0 +1,184 @@ +.\" 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. +.\" +.TH SIGWAITINFO 2 2008-10-04 "Linux" "Linux Programmer's Manual" +.SH NAME +sigwaitinfo, sigtimedwait \- synchronously wait for queued signals +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int sigwaitinfo(const sigset_t *" set ", siginfo_t *" info ");" +.sp +.BI "int sigtimedwait(const sigset_t *" set ", siginfo_t *" info ", " +.BI " const struct timespec *" timeout ");" +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR sigwaitinfo (), +.BR sigtimedwait (): +_POSIX_C_SOURCE\ >=\ 199309L +.SH DESCRIPTION +.BR sigwaitinfo () +suspends execution of the calling thread until one of the signals in +.I set +is delivered. +(If one of the signals in +.I set +is already pending for the calling thread, +.BR sigwaitinfo () +will return immediately with information about that signal.) + +.BR sigwaitinfo () +removes the delivered signal from the set of pending +signals and returns the signal number as its function result. +If the +.I info +argument is not NULL, +then it returns a structure of type +.I siginfo_t +(see +.BR sigaction (2)) +containing information about the signal. +.PP +Signals returned via +.BR sigwaitinfo () +are delivered in the usual order; see +.BR signal (7) +for further details. +.PP +.BR sigtimedwait () +operates in exactly the same way as +.BR sigwaitinfo () +except that it has an additional argument, +.IR timeout , +which enables an upper bound to be placed on the time for which +the thread is suspended. +This argument is of the following type: +.sp +.in +4n +.nf +struct timespec { + long tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +} +.fi +.in +.sp +If both fields of this structure are specified as 0, a poll is performed: +.BR sigtimedwait () +returns immediately, either with information about a signal that +was pending for the caller, or with an error +if none of the signals in +.I set +was pending. +.SH "RETURN VALUE" +On success, both +.BR sigwaitinfo () +and +.BR sigtimedwait () +return a signal number (i.e., a value greater than zero). +On failure both calls return \-1, with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EAGAIN +No signal in +.I set +was delivered within the +.I timeout +period specified to +.BR sigtimedwait (). +.TP +.B EINTR +The wait was interrupted by a signal handler; see +.BR signal (7). +(This handler was for a signal other than one of those in +.IR set .) +.TP +.B EINVAL +.I timeout +was invalid. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +In normal usage, the calling program blocks the signals in +.I set +via a prior call to +.BR sigprocmask (2) +(so that the default disposition for these signals does not occur if they +are delivered between successive calls to +.BR sigwaitinfo () +or +.BR sigtimedwait ()) +and does not establish handlers for these signals. +In a multithreaded program, +the signal should be blocked in all threads to prevent +the signal being delivered to a thread other than the one calling +.BR sigwaitinfo () +or +.BR sigtimedwait ()). + +The set of signals that is pending for a given thread is the +union of the set of signals that is pending specifically for that thread +and the set of signals that is pending for the process as a whole (see +.BR signal (7)). + +If multiple threads of a process are blocked +waiting for the same signal(s) in +.BR sigwaitinfo () +or +.BR sigtimedwait (), +then exactly one of the threads will actually receive the +signal if it is delivered to the process as a whole; +which of the threads receives the signal is indeterminate. + +POSIX leaves the meaning of a NULL value for the +.I timeout +argument of +.BR sigtimedwait () +unspecified, permitting the possibility that this has the same meaning +as a call to +.BR sigwaitinfo (), +and indeed this is what is done on Linux. + +On Linux, +.BR sigwaitinfo () +is a library function implemented on top of +.BR sigtimedwait (). +.SH "SEE ALSO" +.BR kill (2), +.BR sigaction (2), +.BR signal (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigqueue (2), +.BR sigsetops (3), +.BR sigwait (3), +.BR signal (7), +.BR time (7) diff --git a/original/man2/socket.2 b/original/man2/socket.2 new file mode 100644 index 00000000..e84b6d54 --- /dev/null +++ b/original/man2/socket.2 @@ -0,0 +1,417 @@ +'\" t +.\" 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. +.\" +.\" $Id: socket.2,v 1.4 1999/05/13 11:33:42 freitag Exp $ +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 1998, 1999 by Andi Kleen +.\" Modified 2002-07-17 by Michael Kerrisk +.\" Modified 2004-06-17 by Michael Kerrisk +.\" +.TH SOCKET 2 2009-01-19 "Linux" "Linux Programmer's Manual" +.SH NAME +socket \- create an endpoint for communication +.SH SYNOPSIS +.BR "#include " " /* See NOTES */" +.br +.B #include +.sp +.BI "int socket(int " domain ", int " type ", int " protocol ); +.SH DESCRIPTION +.BR socket () +creates an endpoint for communication and returns a descriptor. +.PP +The +.I domain +argument specifies a communication domain; this selects the protocol +family which will be used for communication. +These families are defined in +.IR . +The currently understood formats include: +.TS +tab(:); +l l l. +Name:Purpose:Man page +T{ +.BR AF_UNIX ", " AF_LOCAL +T}:T{ +Local communication +T}:T{ +.BR unix (7) +T} +T{ +.B AF_INET +T}:IPv4 Internet protocols:T{ +.BR ip (7) +T} +T{ +.B AF_INET6 +T}:IPv6 Internet protocols:T{ +.BR ipv6 (7) +T} +T{ +.B AF_IPX +T}:IPX \- Novell protocols: +T{ +.B AF_NETLINK +T}:T{ +Kernel user interface device +T}:T{ +.BR netlink (7) +T} +T{ +.B AF_X25 +T}:ITU-T X.25 / ISO-8208 protocol:T{ +.BR x25 (7) +T} +T{ +.B AF_AX25 +T}:T{ +Amateur radio AX.25 protocol +T}: +T{ +.B AF_ATMPVC +T}:Access to raw ATM PVCs: +T{ +.B AF_APPLETALK +T}:Appletalk:T{ +.BR ddp (7) +T} +T{ +.B AF_PACKET +T}:T{ +Low level packet interface +T}:T{ +.BR packet (7) +T} +.TE +.PP +The socket has the indicated +.IR type , +which specifies the communication semantics. +Currently defined types +are: +.TP 16 +.B SOCK_STREAM +Provides sequenced, reliable, two-way, connection-based byte streams. +An out-of-band data transmission mechanism may be supported. +.TP +.B SOCK_DGRAM +Supports datagrams (connectionless, unreliable messages of a fixed +maximum length). +.TP +.B SOCK_SEQPACKET +Provides a sequenced, reliable, two-way connection-based data +transmission path for datagrams of fixed maximum length; a consumer is +required to read an entire packet with each input system call. +.TP +.B SOCK_RAW +Provides raw network protocol access. +.TP +.B SOCK_RDM +Provides a reliable datagram layer that does not guarantee ordering. +.TP +.B SOCK_PACKET +Obsolete and should not be used in new programs; +see +.BR packet (7). +.PP +Some socket types may not be implemented by all protocol families; +for example, +.B SOCK_SEQPACKET +is not implemented for +.BR AF_INET . +.PP +Since Linux 2.6.27, the +.I type +argument serves a second purpose: +in addition to specifying a socket type, +it may include the bitwise OR of any of the following values, +to modify the behavior of +.BR socket (): +.TP 16 +.B SOCK_NONBLOCK +Set the +.BR O_NONBLOCK +file status flag on the new open file description. +Using this flag saves extra calls to +.BR fcntl (2) +to achieve the same result. +.TP +.B SOCK_CLOEXEC +Set the close-on-exec +.RB ( FD_CLOEXEC ) +flag on the new file descriptor. +See the description of the +.B O_CLOEXEC +flag in +.BR open (2) +for reasons why this may be useful. +.PP +The +.I protocol +specifies a particular protocol to be used with the socket. +Normally only a single protocol exists to support a particular +socket type within a given protocol family, in which case +.I protocol +can be specified as 0. +However, it is possible that many protocols may exist, in +which case a particular protocol must be specified in this manner. +The protocol number to use is specific to the \*(lqcommunication domain\*(rq +in which communication is to take place; see +.BR protocols (5). +See +.BR getprotoent (3) +on how to map protocol name strings to protocol numbers. +.PP +Sockets of type +.B SOCK_STREAM +are full-duplex byte streams, similar to pipes. +They do not preserve +record boundaries. +A stream socket must be in +a +.I connected +state before any data may be sent or received on it. +A connection to +another socket is created with a +.BR connect (2) +call. +Once connected, data may be transferred using +.BR read (2) +and +.BR write (2) +calls or some variant of the +.BR send (2) +and +.BR recv (2) +calls. +When a session has been completed a +.BR close (2) +may be performed. +Out-of-band data may also be transmitted as described in +.BR send (2) +and received as described in +.BR recv (2). +.PP +The communications protocols which implement a +.B SOCK_STREAM +ensure that data is not lost or duplicated. +If a piece of data for which +the peer protocol has buffer space cannot be successfully transmitted +within a reasonable length of time, then the connection is considered +to be dead. +When +.B SO_KEEPALIVE +is enabled on the socket the protocol checks in a protocol-specific +manner if the other end is still alive. +A +.B SIGPIPE +signal is raised if a process sends or receives +on a broken stream; this causes naive processes, +which do not handle the signal, to exit. +.B SOCK_SEQPACKET +sockets employ the same system calls as +.B SOCK_STREAM +sockets. +The only difference is that +.BR read (2) +calls will return only the amount of data requested, +and any data remaining in the arriving packet will be discarded. +Also all message boundaries in incoming datagrams are preserved. +.PP +.B SOCK_DGRAM +and +.B SOCK_RAW +sockets allow sending of datagrams to correspondents named in +.BR sendto (2) +calls. +Datagrams are generally received with +.BR recvfrom (2), +which returns the next datagram along with the address of its sender. +.PP +.B SOCK_PACKET +is an obsolete socket type to receive raw packets directly from the +device driver. +Use +.BR packet (7) +instead. +.PP +An +.BR fcntl (2) +.B F_SETOWN +operation can be used to specify a process or process group to receive a +.B SIGURG +signal when the out-of-band data arrives or +.B SIGPIPE +signal when a +.B SOCK_STREAM +connection breaks unexpectedly. +This operation may also be used to set the process or process group +that receives the I/O and asynchronous notification of I/O events via +.BR SIGIO . +Using +.B F_SETOWN +is equivalent to an +.BR ioctl (2) +call with the +.B FIOSETOWN +or +.B SIOCSPGRP +argument. +.PP +When the network signals an error condition to the protocol module (e.g., +using a ICMP message for IP) the pending error flag is set for the socket. +The next operation on this socket will return the error code of the pending +error. +For some protocols it is possible to enable a per-socket error queue +to retrieve detailed information about the error; see +.B IP_RECVERR +in +.BR ip (7). +.PP +The operation of sockets is controlled by socket level +.IR options . +These options are defined in +.IR . +The functions +.BR setsockopt (2) +and +.BR getsockopt (2) +are used to set and get options, respectively. +.SH "RETURN VALUE" +On success, a file descriptor for the new socket is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +Permission to create a socket of the specified type and/or protocol +is denied. +.TP +.B EAFNOSUPPORT +The implementation does not support the specified address family. +.TP +.B EINVAL +Unknown protocol, or protocol family not available. +.TP +.B EINVAL +.\" Since Linux 2.6.27 +Invalid flags in +.IR type . +.TP +.B EMFILE +Process file table overflow. +.TP +.B ENFILE +The system limit on the total number of open files has been reached. +.TP +.BR ENOBUFS " or " ENOMEM +Insufficient memory is available. +The socket cannot be +created until sufficient resources are freed. +.TP +.B EPROTONOSUPPORT +The protocol type or the specified protocol is not +supported within this domain. +.PP +Other errors may be generated by the underlying protocol modules. +.SH "CONFORMING TO" +4.4BSD, POSIX.1-2001. + +The +.B SOCK_NONBLOCK +and +.B SOCK_CLOEXEC +flags are Linux-specific. + +.BR socket () +appeared in 4.2BSD. +It is generally portable to/from +non-BSD systems supporting clones of the BSD socket layer (including +System V variants). +.SH NOTES +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. + +The manifest constants used under 4.x BSD for protocol families +are +.BR PF_UNIX , +.BR PF_INET , +etc., while +.B AF_UNIX +etc. are used for address +families. +However, already the BSD man page promises: "The protocol +family generally is the same as the address family", and subsequent +standards use AF_* everywhere. +.SH EXAMPLE +An example of the use of +.BR socket () +is shown in +.BR getaddrinfo (3). +.SH "SEE ALSO" +.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) +.PP +\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\(rq +is reprinted in +.I UNIX Programmer's Supplementary Documents Volume 1. +.PP +\(lqBSD Interprocess Communication Tutorial\(rq +is reprinted in +.I UNIX Programmer's Supplementary Documents Volume 1. diff --git a/original/man2/socketcall.2 b/original/man2/socketcall.2 new file mode 100644 index 00000000..dda192fb --- /dev/null +++ b/original/man2/socketcall.2 @@ -0,0 +1,71 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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 Tue Oct 22 22:11:53 1996 by Eric S. Raymond +.TH SOCKETCALL 2 2007-06-28 "Linux" "Linux Programmer's Manual" +.SH NAME +socketcall \- socket system calls +.SH SYNOPSIS +.BI "int socketcall(int " call ", unsigned long *" args ); +.SH DESCRIPTION +.BR socketcall () +is a common kernel entry point for the socket system calls. +.I call +determines which socket function to invoke. +.I args +points to a block containing the actual arguments, +which are passed through to the appropriate call. +.PP +User programs should call the appropriate functions by their usual names. +Only standard library implementors and kernel hackers need to know about +.BR socketcall (). +.SH "CONFORMING TO" +This call is specific to Linux, and should not be used in programs +intended to be portable. +.SH NOTES +On a few architectures, for example ia64, there is no +.BR socketcall () +system call; instead +.BR socket (2), +.BR accept (2), +.BR bind (2), +and so on really are implemented as separate system calls. +.SH "SEE ALSO" +.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) diff --git a/original/man2/socketpair.2 b/original/man2/socketpair.2 new file mode 100644 index 00000000..e5f2e2bf --- /dev/null +++ b/original/man2/socketpair.2 @@ -0,0 +1,128 @@ +.\" 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. +.\" +.\" @(#)socketpair.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 2002-07-22 by Michael Kerrisk +.\" Modified 2004-06-17 by Michael Kerrisk +.\" 2008-10-11, mtk: Add description of SOCK_NONBLOCK and SOCK_CLOEXEC +.\" +.TH SOCKETPAIR 2 2008-10-11 "Linux" "Linux Programmer's Manual" +.SH NAME +socketpair \- create a pair of connected sockets +.SH SYNOPSIS +.BR "#include " " /* See NOTES */" +.br +.B #include +.sp +.BI "int socketpair(int " domain ", int " type ", int " protocol \ +", int " sv [2]); +.SH DESCRIPTION +The +.BR socketpair () +call creates an unnamed pair of connected sockets in the specified +.IR domain , +of the specified +.IR type , +and using the optionally specified +.IR protocol . +For further details of these arguments, see +.BR socket (2). + +The descriptors used in referencing the new sockets are returned in +.IR sv [0] +and +.IR sv [1]. +The two sockets are indistinguishable. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EAFNOSUPPORT +The specified address family is not supported on this machine. +.TP +.B EFAULT +The address +.I sv +does not specify a valid part of the process address space. +.TP +.B EMFILE +Too many descriptors are in use by this process. +.TP +.B ENFILE +The system limit on the total number of open files has been reached. +.TP +.B EOPNOTSUPP +The specified protocol does not support creation of socket pairs. +.TP +.B EPROTONOSUPPORT +The specified protocol is not supported on this machine. +.SH "CONFORMING TO" +4.4BSD, POSIX.1-2001. +The +.BR socketpair () +function call appeared in 4.2BSD. +It is generally portable to/from +non-BSD systems supporting clones of the BSD socket layer (including +System V variants). +.SH NOTES +On Linux, the only supported domain for this call is +.B AF_UNIX +(or synonymously, +.BR AF_LOCAL ). +(Most implementations have the same restriction.) + +Since Linux 2.6.27, +.BR socketpair () +supports the +.BR SOCK_NONBLOCK +and +.BR SOCK_CLOEXEC +flags described in +.BR socket (2). + +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. +.SH "SEE ALSO" +.BR pipe (2), +.BR read (2), +.BR socket (2), +.BR write (2), +.BR socket (7), +.BR unix (7) diff --git a/original/man2/splice.2 b/original/man2/splice.2 new file mode 100644 index 00000000..ff2745e6 --- /dev/null +++ b/original/man2/splice.2 @@ -0,0 +1,229 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 2006 Jens Axboe +.\" 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. +.\" +.TH SPLICE 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH NAME +splice \- splice data to/from a pipe +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "ssize_t splice(int " fd_in ", loff_t *" off_in ", int " fd_out , +.BI " loff_t *" off_out ", size_t " len \ +", unsigned int " flags ); +.\" Return type was long before glibc 2.7 +.fi +.SH DESCRIPTION +.BR splice () +moves data between two file descriptors +without copying between kernel address space and user address space. +It transfers up to +.I len +bytes of data from the file descriptor +.I fd_in +to the file descriptor +.IR fd_out , +where one of the descriptors must refer to a pipe. + +If +.I fd_in +refers to a pipe, then +.I off_in +must be NULL. +If +.I fd_in +does not refer to a pipe and +.I off_in +is NULL, then bytes are read from +.I fd_in +starting from the current file offset, +and the current file offset is adjusted appropriately. +If +.I fd_in +does not refer to a pipe and +.I off_in +is not NULL, then +.I off_in +must point to a buffer which specifies the starting +offset from which bytes will be read from +.IR fd_in ; +in this case, the current file offset of +.I fd_in +is not changed. +Analogous statements apply for +.I fd_out +and +.IR off_out . + +The +.I flags +argument is a bit mask that is composed by ORing together +zero or more of the following values: +.TP 1.9i +.B SPLICE_F_MOVE +Attempt to move pages instead of copying. +This is only a hint to the kernel: +pages may still be copied if the kernel cannot move the +pages from the pipe, or if +the pipe buffers don't refer to full pages. +The initial implementation of this flag was buggy: +therefore starting in Linux 2.6.21 it is a no-op +(but is still permitted in a +.BR splice () +call); +in the future, a correct implementation may be restored. +.TP +.B SPLICE_F_NONBLOCK +Do not block on I/O. +This makes the splice pipe operations nonblocking, but +.BR splice () +may nevertheless block because the file descriptors that +are spliced to/from may block (unless they have the +.B O_NONBLOCK +flag set). +.TP +.B SPLICE_F_MORE +More data will be coming in a subsequent splice. +This is a helpful hint when +the +.I fd_out +refers to a socket (see also the description of +.B MSG_MORE +in +.BR send (2), +and the description of +.B TCP_CORK +in +.BR tcp (7)) +.TP +.B SPLICE_F_GIFT +Unused for +.BR splice (); +see +.BR vmsplice (2). +.SH RETURN VALUE +Upon successful completion, +.BR splice () +returns the number of bytes +spliced to or from the pipe. +A return value of 0 means that there was no data to transfer, +and it would not make sense to block, because there are no +writers connected to the write end of the pipe referred to by +.IR fd_in . + +On error, +.BR splice () +returns \-1 and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EBADF +One or both file descriptors are not valid, +or do not have proper read-write mode. +.TP +.B EINVAL +Target file system doesn't support splicing; +target file is opened in append mode; +.\" The append-mode error is given since 2.6.27; in earlier kernels, +.\" splice() in append mode was broken +neither of the descriptors refers to a pipe; or +offset given for nonseekable device. +.TP +.B ENOMEM +Out of memory. +.TP +.B ESPIPE +Either +.I off_in +or +.I off_out +was not NULL, but the corresponding file descriptor refers to a pipe. +.SH VERSIONS +The +.BR splice () +system call first appeared in Linux 2.6.17. +.SH "CONFORMING TO" +This system call is Linux-specific. +.SH NOTES +The three system calls +.BR splice (), +.BR vmsplice (2), +and +.BR tee (2), +provide userspace programs with full control over an arbitrary +kernel buffer, implemented within the kernel using the same type +of buffer that is used for a pipe. +In overview, these system calls perform the following tasks: +.TP 1.2i +.BR splice () +moves data from the buffer to an arbitrary file descriptor, or vice versa, +or from one buffer to another. +.TP +.BR tee (2) +"copies" the data from one buffer to another. +.TP +.BR vmsplice (2) +"copies" data from user space into the buffer. +.PP +Though we talk of copying, actual copies are generally avoided. +The kernel does this by implementing a pipe buffer as a set +of reference-counted pointers to pages of kernel memory. +The kernel creates "copies" of pages in a buffer by creating new +pointers (for the output buffer) referring to the pages, +and increasing the reference counts for the pages: +only pointers are copied, not the pages of the buffer. +.\" +.\" Linus: Now, imagine using the above in a media server, for example. +.\" Let's say that a year or two has passed, so that the video drivers +.\" have been updated to be able to do the splice thing, and what can +.\" you do? You can: +.\" +.\" - splice from the (mpeg or whatever - let's just assume that the video +.\" input is either digital or does the encoding on its own - like they +.\" pretty much all do) video input into a pipe (remember: no copies - the +.\" video input will just DMA directly into memory, and splice will just +.\" set up the pages in the pipe buffer) +.\" - tee that pipe to split it up +.\" - splice one end to a file (ie "save the compressed stream to disk") +.\" - splice the other end to a real-time video decoder window for your +.\" real-time viewing pleasure. +.\" +.\" Linus: Now, the advantage of splice()/tee() is that you can +.\" do zero-copy movement of data, and unlike sendfile() you can +.\" do it on _arbitrary_ data (and, as shown by "tee()", it's more +.\" than just sending the data to somebody else: you can duplicate +.\" the data and choose to forward it to two or more different +.\" users - for things like logging etc.). +.\" +.SH EXAMPLE +See +.BR tee (2). +.SH SEE ALSO +.BR sendfile (2), +.BR tee (2), +.BR vmsplice (2), +.BR feature_test_macros (7) diff --git a/original/man2/spu_create.2 b/original/man2/spu_create.2 new file mode 100644 index 00000000..f8e4a1cf --- /dev/null +++ b/original/man2/spu_create.2 @@ -0,0 +1,269 @@ +.\" Copyright (c) International Business Machines Corp., 2006 +.\" +.\" 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 +.\" +.\" HISTORY: +.\" 2005-09-28, created by Arnd Bergmann +.\" 2006-06-16, revised by Eduardo M. Fleury +.\" 2007-07-10, some polishing by mtk +.\" 2007-09-28, updates for newer kernels by Jeremy Kerr +.\" +.TH SPU_CREATE 2 2007-12-20 Linux "Linux Programmer's Manual" +.SH NAME +spu_create \- create a new spu context +.SH SYNOPSIS +.nf +.B #include +.B #include + +.BI "int spu_create(const char *" pathname ", int " flags ", mode_t " mode ");" +.BI "int spu_create(const char *" pathname ", int " flags ", mode_t " mode "," +.BI " int " neighbor_fd ");" +.fi +.SH DESCRIPTION +The +.BR spu_create () +system call is used on PowerPC machines that implement the +Cell Broadband Engine Architecture in order to access Synergistic +Processor Units (SPUs). +It creates a new logical context for an SPU in +.I pathname +and returns a file descriptor associated with it. +.I pathname +must refer to a nonexistent directory in the mount point of +the SPU file system +.RB ( spufs ). +If +.BR spu_create () +is successful, a directory is created at +.I pathname +and it is populated with the files described in +.BR spufs (7). + +When a context is created, +the returned file descriptor can only be passed to +.BR spu_run (2), +used as the +.I dirfd +argument to the +.B *at +family of system calls (e.g., +.BR openat (2)), +or closed; +other operations are not defined. +A logical SPU +context is destroyed (along with all files created within the context's +.I pathname +directory) once the last reference to the context has gone; +this usually occurs when the file descriptor returned by +.BR spu_create () +is closed. + +The +.I flags +argument can be zero or any bitwise OR-ed +combination of the following constants: +.TP +.B SPU_CREATE_EVENTS_ENABLED +Rather than using signals for reporting DMA errors, use the +.I event +argument to +.BR spu_run (2). +.TP +.B SPU_CREATE_GANG +Create an SPU gang instead of a context. +(A gang is a group of SPU contexts that are +functionally related to each other and which share common scheduling +parameters \(em priority and policy. +In the future, gang scheduling may be implemented causing +the group to be switched in and out as a single unit.) + +A new directory will be created at the location specified by the +.I pathname +argument. +This gang may be used to hold other SPU contexts, by providing +a pathname that is within the gang directory to further calls to +.BR spu_create (). +.TP +.B SPU_CREATE_NOSCHED +Create a context that is not affected by the SPU scheduler. +Once the context is run, +it will not be scheduled out until it is destroyed by +the creating process. + +Because the context cannot be removed from the SPU, some functionality +is disabled for +.BR SPU_CREATE_NOSCHED +contexts. +Only a subset of the files will be +available in this context directory in +.BR spufs . +Additionally, +.BR SPU_CREATE_NOSCHED +contexts cannot dump a core file when crashing. + +Creating +.BR SPU_CREATE_NOSCHED +contexts requires the +.B CAP_SYS_NICE +capability. +.TP +.B SPU_CREATE_ISOLATE +Create an isolated SPU context. +Isolated contexts are protected from some +PPE (PowerPC Processing Element) +operations, +such as access to the SPU local store and the NPC register. + +Creating +.B SPU_CREATE_ISOLATE +contexts also requires the +.B SPU_CREATE_NOSCHED +flag. +.TP +.B SPU_CREATE_AFFINITY_SPU +Create a context with affinity to another SPU context. +This affinity information is used within the SPU scheduling algorithm. +Using this flag requires that a file descriptor referring to +the other SPU context be passed in the +.I neighbor_fd +argument. +.TP +.B SPU_CREATE_AFFINITY_MEM +Create a context with affinity to system memory. +This affinity information +is used within the SPU scheduling algorithm. +.PP +The +.I mode +argument (minus any bits set in the process's +.BR umask (2)) +specifies the permissions used for creating the new directory in +.BR spufs . +See +.BR stat (2) +for a full list of the possible +.I mode +values. +.SH RETURN VALUE +On success, +.BR spu_create () +returns a new file descriptor. +On error, \-1 is returned, and +.I errno +is set to one of the error codes listed below. +.SH ERRORS +.TP +.B EACCES +The current user does not have write access to the +.BR spufs (7) +mount point. +.TP +.B EEXIST +An SPU context already exists at the given path name. +.TP +.B EFAULT +.I pathname +is not a valid string pointer in the +calling process's address space. +.TP +.B EINVAL +.I pathname +is not a directory in the +.BR spufs (7) +mount point, or invalid flags have been provided. +.TP +.B ELOOP +Too many symbolic links were found while resolving +.IR pathname . +.TP +.B EMFILE +The process has reached its maximum open files limit. +.TP +.B ENAMETOOLONG +.I pathname +is too long. +.TP +.B ENFILE +The system has reached the global open files limit. +.TP +.B ENODEV +An isolated context was requested, but the hardware does not support +SPU isolation. +.TP +.B ENOENT +Part of +.I pathname +could not be resolved. +.TP +.B ENOMEM +The kernel could not allocate all resources required. +.TP +.B ENOSPC +There are not enough SPU resources available to create +a new context or the user-specific limit for the number +of SPU contexts has been reached. +.TP +.B ENOSYS +The functionality is not provided by the current system, because +either the hardware does not provide SPUs or the spufs module is not +loaded. +.TP +.B ENOTDIR +A part of +.I pathname +is not a directory. +.TP +.B EPERM +The +.I SPU_CREATE_NOSCHED +flag has been given, but the user does not have the +.B CAP_SYS_NICE +capability. +.SH FILES +.I pathname +must point to a location beneath the mount point of +.BR spufs . +By convention, it gets mounted in +.IR /spu . +.SH VERSIONS +The +.BR spu_create () +system call was added to Linux in kernel 2.6.16. +.SH CONFORMING TO +This call is Linux-specific and only implemented on the PowerPC +architecture. +Programs using this system call are not portable. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). +Note however, that +.BR spu_create () +is meant to be used from libraries that implement a more abstract +interface to SPUs, not to be used from regular applications. +See +.I http://www.bsc.es/projects/deepcomputing/linuxoncell/ +for the recommended libraries. +.SH EXAMPLE +See +.BR spu_run (2) +for an example of the use of +.BR spu_create () +.SH SEE ALSO +.BR close (2), +.BR spu_run (2), +.BR capabilities (7), +.BR spufs (7) diff --git a/original/man2/spu_run.2 b/original/man2/spu_run.2 new file mode 100644 index 00000000..3caf7348 --- /dev/null +++ b/original/man2/spu_run.2 @@ -0,0 +1,263 @@ +.\" Copyright (c) International Business Machines Corp., 2006 +.\" +.\" 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 +.\" +.\" HISTORY: +.\" 2005-09-28, created by Arnd Bergmann +.\" 2006-06-16, revised by Eduardo M. Fleury +.\" 2007-07-10, some polishing by mtk +.\" 2007-09-28, updates for newer kernels, added example +.\" by Jeremy Kerr +.\" +.TH SPU_RUN 2 2007-11-25 Linux "Linux Programmer's Manual" +.SH NAME +spu_run \- execute an SPU context +.SH SYNOPSIS +.nf +.B #include + +.BI "int spu_run(int " fd ", unsigned int *" npc \ +", unsigned int *" event ");" +.fi +.SH DESCRIPTION +The +.BR spu_run () +system call is used on PowerPC machines that implement the +Cell Broadband Engine Architecture in order to access Synergistic +Processor Units (SPUs). +The +.I fd +argument is a file descriptor returned by +.BR spu_create (2) +that refers to a specific SPU context. +When the context gets scheduled to a physical SPU, +it starts execution at the instruction pointer passed in +.IR npc . + +Execution of SPU code happens synchronously, meaning that +.BR spu_run () +blocks while the SPU is still running. +If there is a need +to execute SPU code in parallel with other code on either the +main CPU or other SPUs, a new thread of execution must be created +first (e.g., using +.BR pthread_create (3)). + +When +.BR spu_run () +returns, the current value of the SPU program counter is written to +.IR npc , +so successive calls to +.BR spu_run () +can use the same +.I npc +pointer. + +The +.I event +argument provides a buffer for an extended status code. +If the SPU +context was created with the +.B SPU_CREATE_EVENTS_ENABLED +flag, then this buffer is populated by the Linux kernel before +.BR spu_run () +returns. + +The status code may be one (or more) of the following constants: +.TP +.B SPE_EVENT_DMA_ALIGNMENT +A DMA alignment error occurred. +.TP +.B SPE_EVENT_INVALID_DMA +An invalid MFC DMA command was attempted. +.TP +.B SPE_EVENT_SPE_DATA_STORAGE +A DMA storage error occurred. +.TP +.B SPE_EVENT_SPE_ERROR +An illegal instruction was executed. +.PP +NULL +is a valid value for the +.I event +argument. +In this case, the events will not be reported to the calling process. +.SH RETURN VALUE +On success, +.BR spu_run () +returns the value of the +.I spu_status +register. +On error it returns \-1 and sets +.I errno +to one of the error codes listed below. + +The +.I spu_status +register value is a bit mask of status codes and +optionally a 14-bit code returned from the +.BR stop-and-signal +instruction on the SPU. +The bit masks for the status codes +are: +.TP +.B 0x02 +SPU was stopped by a +.BR stop-and-signal +instruction. +.TP +.B 0x04 +SPU was stopped by a +.BR halt +instruction. +.TP +.B 0x08 +SPU is waiting for a channel. +.TP +.B 0x10 +SPU is in single-step mode. +.TP +.B 0x20 +SPU has tried to execute an invalid instruction. +.TP +.B 0x40 +SPU has tried to access an invalid channel. +.TP +.B 0x3fff0000 +The bits masked with this value contain the code returned from a +.BR stop-and-signal +instruction. +These bits are only valid if the 0x02 bit is set. +.PP +If +.BR spu_run () +has not returned an error, one or more bits among the lower eight +ones are always set. +.SH ERRORS +.TP +.B EBADF +.I fd +is not a valid file descriptor. +.TP +.B EFAULT +.I npc +is not a valid pointer, or +.I event +is non-NULL and an invalid pointer. +.TP +.B EINTR +A signal occurred while +.BR spu_run () +was in progress; see +.BR signal (7). +The +.I npc +value has been updated to the new program counter value if +necessary. +.TP +.B EINVAL +.I fd +is not a valid file descriptor returned from +.BR spu_create (2). +.TP +.B ENOMEM +There was not enough memory available to handle a page fault +resulting from a Memory Flow Controller (MFC) direct memory access. +.TP +.B ENOSYS +The functionality is not provided by the current system, because +either the hardware does not provide SPUs or the spufs module is not +loaded. +.SH VERSIONS +The +.BR spu_run () +system call was added to Linux in kernel 2.6.16. +.SH CONFORMING TO +This call is Linux-specific and only implemented by the PowerPC +architecture. +Programs using this system call are not portable. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). +Note however, that +.BR spu_run () +is meant to be used from libraries that implement a more abstract +interface to SPUs, not to be used from regular applications. +See +.I http://www.bsc.es/projects/deepcomputing/linuxoncell/ +for the recommended libraries. +.SH EXAMPLE +The following is an example of running a simple, one-instruction SPU +program with the +.BR spu_run () +system call. + +.nf +#include +#include +#include +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int main(void) +{ + int context, fd, spu_status; + uint32_t instruction, npc; + + context = spu_create("/spu/example\-context", 0, 0755); + if (context == -1) + handle_error("spu_create"); + + /* write a \(aqstop 0x1234\(aq instruction to the SPU\(aqs + * local store memory + */ + instruction = 0x00001234; + + fd = open("/spu/example\-context/mem", O_RDWR); + if (fd == -1) + handle_error("open"); + write(fd, &instruction, sizeof(instruction)); + + /* set npc to the starting instruction address of the + * SPU program. Since we wrote the instruction at the + * start of the mem file, the entry point will be 0x0 + */ + npc = 0; + + spu_status = spu_run(context, &npc, NULL); + if (spu_status == -1) + handle_error("open"); + + /* we should see a status code of 0x1234002: + * 0x00000002 (spu was stopped due to stop\-and\-signal) + * | 0x12340000 (the stop\-and\-signal code) + */ + printf("SPU Status: 0x%08x\\n", spu_status); + + exit(EXIT_SUCCESS); +} +.fi +.\" .SH AUTHORS +.\" Arnd Bergmann , Jeremy Kerr +.SH SEE ALSO +.BR close (2), +.BR spu_create (2), +.BR capabilities (7), +.BR spufs (7) diff --git a/original/man2/ssetmask.2 b/original/man2/ssetmask.2 new file mode 100644 index 00000000..a7f99d20 --- /dev/null +++ b/original/man2/ssetmask.2 @@ -0,0 +1 @@ +.so man2/sgetmask.2 diff --git a/original/man2/stat.2 b/original/man2/stat.2 new file mode 100644 index 00000000..01f82471 --- /dev/null +++ b/original/man2/stat.2 @@ -0,0 +1,603 @@ +'\" t +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 +.\" Parts Copyright (c) 1995 Nicolai Langfeldt (janl@ifi.uio.no), 1/1/95 +.\" 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 by Michael Haardt +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1995-05-18 by Todd Larason +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 1995-01-09 by Richard Kettlewell +.\" Modified 1998-05-13 by Michael Haardt +.\" Modified 1999-07-06 by aeb & Albert Cahalan +.\" Modified 2000-01-07 by aeb +.\" Modified 2004-06-23 by Michael Kerrisk +.\" 2007-06-08 mtk: Added example program +.\" 2007-07-05 mtk: Added details on underlying system call interfaces +.\" +.TH STAT 2 2009-09-30 "Linux" "Linux Programmer's Manual" +.SH NAME +stat, fstat, lstat \- get file status +.SH SYNOPSIS +.B #include +.br +.B #include +.br +.B #include +.sp +.BI "int stat(const char *" path ", struct stat *" buf ); +.br +.BI "int fstat(int " fd ", struct stat *" buf ); +.br +.BI "int lstat(const char *" path ", struct stat *" buf ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR lstat (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +.PP +These functions return information about a file. +No permissions are required on the file itself, but \(em in the case of +.BR stat () +and +.BR lstat () +\(em +execute (search) permission is required on all of the directories in +.I path +that lead to the file. +.PP +.BR stat () +stats the file pointed to by +.I path +and fills in +.IR buf . + +.BR lstat () +is identical to +.BR stat (), +except that if +.I path +is a symbolic link, then the link itself is stat-ed, +not the file that it refers to. + +.BR fstat () +is identical to +.BR stat (), +except that the file to be stat-ed is specified by the file descriptor +.IR fd . +.PP +All of these system calls return a +.I stat +structure, which contains the following fields: +.PP +.in +4n +.nf +struct stat { + dev_t st_dev; /* ID of device containing file */ + ino_t st_ino; /* inode number */ + mode_t st_mode; /* protection */ + nlink_t st_nlink; /* number of hard links */ + uid_t st_uid; /* user ID of owner */ + gid_t st_gid; /* group ID of owner */ + dev_t st_rdev; /* device ID (if special file) */ + off_t st_size; /* total size, in bytes */ + blksize_t st_blksize; /* blocksize for file system I/O */ + blkcnt_t st_blocks; /* number of 512B blocks allocated */ + time_t st_atime; /* time of last access */ + time_t st_mtime; /* time of last modification */ + time_t st_ctime; /* time of last status change */ +}; +.fi +.in +.PP +The +.I st_dev +field describes the device on which this file resides. +(The +.BR major (3) +and +.BR minor (3) +macros may be useful to decompose the device ID in this field.) + +The +.I st_rdev +field describes the device that this file (inode) represents. + +The +.I st_size +field gives the size of the file (if it is a regular +file or a symbolic link) in bytes. +The size of a symlink is the length of the pathname +it contains, without a trailing null byte. + +The +.I st_blocks +field indicates the number of blocks allocated to the file, 512-byte units. +(This may be smaller than +.IR st_size /512 +when the file has holes.) + +The +.I st_blksize +field gives the "preferred" blocksize for efficient file system I/O. +(Writing to a file in smaller chunks may cause +an inefficient read-modify-rewrite.) +.PP +Not all of the Linux file systems implement all of the time fields. +Some file system types allow mounting in such a way that file +and/or directory accesses do not cause an update of the +.I st_atime +field. +(See +.IR noatime , +.IR nodiratime , +and +.I relatime +in +.BR mount (8), +and related information in +.BR mount (2).) +In addition, +.I st_atime +is not updated if a file is opened with the +.BR O_NOATIME ; +see +.BR open (2). + +The field +.I st_atime +is changed by file accesses, for example, by +.BR execve (2), +.BR mknod (2), +.BR pipe (2), +.BR utime (2) +and +.BR read (2) +(of more than zero bytes). +Other routines, like +.BR mmap (2), +may or may not update +.IR st_atime . + +The field +.I st_mtime +is changed by file modifications, for example, by +.BR mknod (2), +.BR truncate (2), +.BR utime (2) +and +.BR write (2) +(of more than zero bytes). +Moreover, +.I st_mtime +of a directory is changed by the creation or deletion of files +in that directory. +The +.I st_mtime +field is +.I not +changed for changes in owner, group, hard link count, or mode. + +The field +.I st_ctime +is changed by writing or by setting inode information +(i.e., owner, group, link count, mode, etc.). +.PP +The following POSIX macros are defined to check the file type using the +.I st_mode +field: +.RS 4 +.TP 1.2i +.BR S_ISREG (m) +is it a regular file? +.TP +.BR S_ISDIR (m) +directory? +.TP +.BR S_ISCHR (m) +character device? +.TP +.BR S_ISBLK (m) +block device? +.TP +.BR S_ISFIFO (m) +FIFO (named pipe)? +.TP +.BR S_ISLNK (m) +symbolic link? (Not in POSIX.1-1996.) +.TP +.BR S_ISSOCK (m) +socket? (Not in POSIX.1-1996.) +.RE +.PP +The following flags are defined for the +.I st_mode +field: +.in +4n +.TS +lB l l. +S_IFMT 0170000 bit mask for the file type bit fields +S_IFSOCK 0140000 socket +S_IFLNK 0120000 symbolic link +S_IFREG 0100000 regular file +S_IFBLK 0060000 block device +S_IFDIR 0040000 directory +S_IFCHR 0020000 character device +S_IFIFO 0010000 FIFO +S_ISUID 0004000 set UID bit +S_ISGID 0002000 set-group-ID bit (see below) +S_ISVTX 0001000 sticky bit (see below) +S_IRWXU 00700 mask for file owner permissions +S_IRUSR 00400 owner has read permission +S_IWUSR 00200 owner has write permission +S_IXUSR 00100 owner has execute permission +S_IRWXG 00070 mask for group permissions +S_IRGRP 00040 group has read permission +S_IWGRP 00020 group has write permission +S_IXGRP 00010 group has execute permission +S_IRWXO 00007 mask for permissions for others (not in group) +S_IROTH 00004 others have read permission +S_IWOTH 00002 others have write permission +S_IXOTH 00001 others have execute permission +.TE +.in +.P +The set-group-ID bit +.RB ( S_ISGID ) +has several special uses. +For a directory it indicates that BSD semantics is to be used +for that directory: files created there inherit their group ID from +the directory, not from the effective group ID of the creating process, +and directories created there will also get the +.B S_ISGID +bit set. +For a file that does not have the group execution bit +.RB ( S_IXGRP ) +set, +the set-group-ID bit indicates mandatory file/record locking. +.P +The sticky bit +.RB ( S_ISVTX ) +on a directory means that a file +in that directory can be renamed or deleted only by the owner +of the file, by the owner of the directory, and by a privileged +process. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +Search permission is denied for one of the directories +in the path prefix of +.IR path . +(See also +.BR path_resolution (7).) +.TP +.B EBADF +.I fd +is bad. +.TP +.B EFAULT +Bad address. +.TP +.B ELOOP +Too many symbolic links encountered while traversing the path. +.TP +.B ENAMETOOLONG +File name too long. +.TP +.B ENOENT +A component of +.I path +does not exist, or +.I path +is an empty string. +.TP +.B ENOMEM +Out of memory (i.e., kernel memory). +.TP +.B ENOTDIR +A component of the path prefix of +.I path +is not a directory. +.TP +.B EOVERFLOW +.RB ( stat ()) +.I path +refers to a file whose size cannot be represented in the type +.IR off_t . +This can occur when an application compiled on a 32-bit platform without +.I -D_FILE_OFFSET_BITS=64 +calls +.BR stat () +on a file whose size exceeds +.I (2<<31)-1 +bits. +.SH "CONFORMING TO" +These system calls conform to SVr4, 4.3BSD, POSIX.1-2001. +.\" SVr4 documents additional +.\" .BR fstat () +.\" error conditions EINTR, ENOLINK, and EOVERFLOW. SVr4 +.\" documents additional +.\" .BR stat () +.\" and +.\" .BR lstat () +.\" error conditions EINTR, EMULTIHOP, ENOLINK, and EOVERFLOW. + +Use of the +.I st_blocks +and +.I st_blksize +fields may be less portable. +(They were introduced in BSD. +The interpretation differs between systems, +and possibly on a single system when NFS mounts are involved.) +.LP +POSIX does not describe the +.BR S_IFMT , +.BR S_IFSOCK , +.BR S_IFLNK , +.BR S_IFREG , +.BR S_IFBLK , +.BR S_IFDIR , +.BR S_IFCHR , +.BR S_IFIFO , +.B S_ISVTX +bits, but instead demands the use of +the macros +.BR S_ISDIR (), +etc. +The +.BR S_ISLNK () +and +.BR S_ISSOCK () +macros are not in +POSIX.1-1996, but both are present in POSIX.1-2001; +the former is from SVID 4, the latter from SUSv2. +.LP +Unix V7 (and later systems) had +.BR S_IREAD , +.BR S_IWRITE , +.BR S_IEXEC , +where POSIX +prescribes the synonyms +.BR S_IRUSR , +.BR S_IWUSR , +.BR S_IXUSR . +.SS "Other Systems" +Values that have been (or are) in use on various systems: +.TS +l l l l l. +hex name ls octal description +f000 S_IFMT 170000 mask for file type +0000 000000 SCO out-of-service inode; BSD unknown + type; SVID-v2 and XPG2 have both + 0 and 0100000 for ordinary file +1000 S_IFIFO p| 010000 FIFO (named pipe) +2000 S_IFCHR c 020000 character special (V7) +3000 S_IFMPC 030000 multiplexed character special (V7) +4000 S_IFDIR d/ 040000 directory (V7) +5000 S_IFNAM 050000 XENIX named special file + with two subtypes, distinguished by + \fIst_rdev\fP values 1, 2 +0001 S_INSEM s 000001 XENIX semaphore subtype of IFNAM +0002 S_INSHD m 000002 XENIX shared data subtype of IFNAM +6000 S_IFBLK b 060000 block special (V7) +7000 S_IFMPB 070000 multiplexed block special (V7) +8000 S_IFREG - 100000 regular (V7) +9000 S_IFCMP 110000 VxFS compressed +9000 S_IFNWK n 110000 network special (HP-UX) +a000 S_IFLNK l@ 120000 symbolic link (BSD) +b000 S_IFSHAD 130000 Solaris shadow inode for ACL + (not seen by userspace) +c000 S_IFSOCK s= 140000 socket (BSD; also "S_IFSOC" on VxFS) +d000 S_IFDOOR D> 150000 Solaris door +e000 S_IFWHT w% 160000 BSD whiteout (not used for inode) +0200 S_ISVTX 001000 sticky bit: save swapped text even + after use (V7) + reserved (SVID-v2) + On nondirectories: don't cache this + file (SunOS) + On directories: restricted deletion + flag (SVID-v4.2) +0400 S_ISGID 002000 set-group-ID on execution (V7) + for directories: use BSD semantics for + propagation of GID +0400 S_ENFMT 002000 System V file locking enforcement (shared + with S_ISGID) +0800 S_ISUID 004000 set-user-ID on execution (V7) +0800 S_CDF 004000 directory is a context dependent + file (HP-UX) +.TE + +A sticky command appeared in Version 32V AT&T UNIX. +.SH NOTES +Since kernel 2.5.48, the +.I stat +structure supports nanosecond resolution for the three +file timestamp fields. +Glibc exposes the nanosecond component of each field using names either +of the form +.IR st_atim.tv_nsec , +if the +.B _BSD_SOURCE +or +.B _SVID_SOURCE +feature test macro is defined, +or of the form +.IR st_atimensec , +if neither of these macros is defined. +On file systems that do not support subsecond timestamps, +these nanosecond fields are returned with the value 0. +.\" As at kernel 2.6.25, XFS and JFS support nanosecond timestamps, +.\" but ext2, ext3, and Reiserfs do not. +.\" FIXME . SUSv4 specifies nanosecond timestamps. + +On Linux, +.BR lstat () +will generally not trigger automounter action, whereas +.BR stat () +will. + +For most files under the +.I /proc +directory, +.BR stat () +does not return the file size in the +.I st_size +field; instead the field is returned with the value 0. +.SS Underlying kernel interface +Over time, increases in the size of the +.I stat +structure have led to three successive versions of +.BR stat (): +.IR sys_stat () +(slot +.IR __NR_oldstat ), +.IR sys_newstat () +(slot +.IR __NR_stat ), +and +.I sys_stat64() +(new in kernel 2.4; slot +.IR __NR_stat64 ). +The glibc +.BR stat () +wrapper function hides these details from applications, +invoking the most recent version of the system call provided by the kernel, +and repacking the returned information if required for old binaries. +Similar remarks apply for +.BR fstat () +and +.BR lstat (). +.\" +.\" A note from Andries Brouwer, July 2007 +.\" +.\" > Is the story not rather more complicated for some calls like +.\" > stat(2)? +.\" +.\" Yes and no, mostly no. See /usr/include/sys/stat.h . +.\" +.\" The idea is here not so much that syscalls change, but that +.\" the definitions of struct stat and of the types dev_t and mode_t change. +.\" This means that libc (even if it does not call the kernel +.\" but only calls some internal function) must know what the +.\" format of dev_t or of struct stat is. +.\" The communication between the application and libc goes via +.\" the include file that defines a _STAT_VER and +.\" _MKNOD_VER describing the layout of the data that user space +.\" uses. Each (almost each) occurrence of stat() is replaced by +.\" an occurrence of xstat() where the first parameter of xstat() +.\" is this version number _STAT_VER. +.\" +.\" Now, also the definitions used by the kernel change. +.\" But glibc copes with this in the standard way, and the +.\" struct stat as returned by the kernel is repacked into +.\" the struct stat as expected by the application. +.\" Thus, _STAT_VER and this setup cater for the application-libc +.\" interface, rather than the libc-kernel interface. +.\" +.\" (Note that the details depend on gcc being used as c compiler.) +.SH EXAMPLE +The following program calls +.BR stat () +and displays selected fields in the returned +.I stat +structure. +.nf + +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct stat sb; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + if (stat(argv[1], &sb) == \-1) { + perror("stat"); + exit(EXIT_FAILURE); + } + + printf("File type: "); + + switch (sb.st_mode & S_IFMT) { + case S_IFBLK: printf("block device\\n"); break; + case S_IFCHR: printf("character device\\n"); break; + case S_IFDIR: printf("directory\\n"); break; + case S_IFIFO: printf("FIFO/pipe\\n"); break; + case S_IFLNK: printf("symlink\\n"); break; + case S_IFREG: printf("regular file\\n"); break; + case S_IFSOCK: printf("socket\\n"); break; + default: printf("unknown?\\n"); break; + } + + printf("I\-node number: %ld\\n", (long) sb.st_ino); + + printf("Mode: %lo (octal)\\n", + (unsigned long) sb.st_mode); + + printf("Link count: %ld\\n", (long) sb.st_nlink); + printf("Ownership: UID=%ld GID=%ld\\n", + (long) sb.st_uid, (long) sb.st_gid); + + printf("Preferred I/O block size: %ld bytes\\n", + (long) sb.st_blksize); + printf("File size: %lld bytes\\n", + (long long) sb.st_size); + printf("Blocks allocated: %lld\\n", + (long long) sb.st_blocks); + + printf("Last status change: %s", ctime(&sb.st_ctime)); + printf("Last file access: %s", ctime(&sb.st_atime)); + printf("Last file modification: %s", ctime(&sb.st_mtime)); + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR access (2), +.BR chmod (2), +.BR chown (2), +.BR fstatat (2), +.BR readlink (2), +.BR utime (2), +.BR capabilities (7), +.BR symlink (7) diff --git a/original/man2/stat64.2 b/original/man2/stat64.2 new file mode 100644 index 00000000..b1a86c19 --- /dev/null +++ b/original/man2/stat64.2 @@ -0,0 +1 @@ +.so man2/stat.2 diff --git a/original/man2/statfs.2 b/original/man2/statfs.2 new file mode 100644 index 00000000..73ec57f7 --- /dev/null +++ b/original/man2/statfs.2 @@ -0,0 +1,254 @@ +.\" Copyright (C) 2003 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. +.\" +.\" Modified 2003-08-17 by Walter Harms +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.TH STATFS 2 2004-06-23 "Linux" "Linux Programmer's Manual" +.SH NAME +statfs, fstatfs \- get file system statistics +.SH SYNOPSIS +.BR "#include " "/* or */" +.sp +.BI "int statfs(const char *" path ", struct statfs *" buf ); +.br +.BI "int fstatfs(int " fd ", struct statfs *" buf ); +.SH DESCRIPTION +The function +.BR statfs () +returns information about a mounted file system. +.I path +is the pathname of any file within the mounted file system. +.I buf +is a pointer to a +.I statfs +structure defined approximately as follows: + +.in +4n +.nf +struct statfs { + long f_type; /* type of file system (see below) */ + long f_bsize; /* optimal transfer block size */ + long f_blocks; /* total data blocks in file system */ + long f_bfree; /* free blocks in fs */ + long f_bavail; /* free blocks avail to unprivileged user */ + long f_files; /* total file nodes in file system */ + long f_ffree; /* free file nodes in fs */ + fsid_t f_fsid; /* file system id */ + long f_namelen; /* maximum length of filenames */ +}; + +File system types: + + ADFS_SUPER_MAGIC 0xadf5 + AFFS_SUPER_MAGIC 0xADFF + BEFS_SUPER_MAGIC 0x42465331 + BFS_MAGIC 0x1BADFACE + CIFS_MAGIC_NUMBER 0xFF534D42 + CODA_SUPER_MAGIC 0x73757245 + COH_SUPER_MAGIC 0x012FF7B7 + CRAMFS_MAGIC 0x28cd3d45 + DEVFS_SUPER_MAGIC 0x1373 + EFS_SUPER_MAGIC 0x00414A53 + EXT_SUPER_MAGIC 0x137D + EXT2_OLD_SUPER_MAGIC 0xEF51 + EXT2_SUPER_MAGIC 0xEF53 + EXT3_SUPER_MAGIC 0xEF53 + HFS_SUPER_MAGIC 0x4244 + HPFS_SUPER_MAGIC 0xF995E849 + HUGETLBFS_MAGIC 0x958458f6 + ISOFS_SUPER_MAGIC 0x9660 + JFFS2_SUPER_MAGIC 0x72b6 + JFS_SUPER_MAGIC 0x3153464a + MINIX_SUPER_MAGIC 0x137F /* orig. minix */ + MINIX_SUPER_MAGIC2 0x138F /* 30 char minix */ + MINIX2_SUPER_MAGIC 0x2468 /* minix V2 */ + MINIX2_SUPER_MAGIC2 0x2478 /* minix V2, 30 char names */ + MSDOS_SUPER_MAGIC 0x4d44 + NCP_SUPER_MAGIC 0x564c + NFS_SUPER_MAGIC 0x6969 + NTFS_SB_MAGIC 0x5346544e + OPENPROM_SUPER_MAGIC 0x9fa1 + PROC_SUPER_MAGIC 0x9fa0 + QNX4_SUPER_MAGIC 0x002f + REISERFS_SUPER_MAGIC 0x52654973 + ROMFS_MAGIC 0x7275 + SMB_SUPER_MAGIC 0x517B + SYSV2_SUPER_MAGIC 0x012FF7B6 + SYSV4_SUPER_MAGIC 0x012FF7B5 + TMPFS_MAGIC 0x01021994 + UDF_SUPER_MAGIC 0x15013346 + UFS_MAGIC 0x00011954 + USBDEVICE_SUPER_MAGIC 0x9fa2 + VXFS_SUPER_MAGIC 0xa501FCF5 + XENIX_SUPER_MAGIC 0x012FF7B4 + XFS_SUPER_MAGIC 0x58465342 + _XIAFS_SUPER_MAGIC 0x012FD16D +.fi +.in +.PP +Nobody knows what +.I f_fsid +is supposed to contain (but see below). +.PP +Fields that are undefined for a particular file system are set to 0. +.BR fstatfs () +returns the same information about an open file referenced by descriptor +.IR fd . +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +.RB ( statfs ()) +Search permission is denied for a component of the path prefix of +.IR path . +(See also +.BR path_resolution (7).) +.TP +.B EBADF +.RB ( fstatfs ()) +.I fd +is not a valid open file descriptor. +.TP +.B EFAULT +.I buf +or +.I path +points to an invalid address. +.TP +.B EINTR +This call was interrupted by a signal. +.TP +.B EIO +An I/O error occurred while reading from the file system. +.TP +.B ELOOP +.RB ( statfs ()) +Too many symbolic links were encountered in translating +.IR path . +.TP +.B ENAMETOOLONG +.RB ( statfs ()) +.I path +is too long. +.TP +.B ENOENT +.RB ( statfs ()) +The file referred to by +.I path +does not exist. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOSYS +The file system does not support this call. +.TP +.B ENOTDIR +.RB ( statfs ()) +A component of the path prefix of +.I path +is not a directory. +.TP +.B EOVERFLOW +Some values were too large to be represented in the returned struct. +.SH "CONFORMING TO" +Linux-specific. +The Linux +.BR statfs () +was inspired by the 4.4BSD one +(but they do not use the same structure). +.SH NOTES +The kernel has system calls +.BR statfs (), +.BR fstatfs (), +.BR statfs64 (), +and +.BR fstatfs64 () +to support this library call. + +Some systems only have \fI\fP, other systems also have +\fI\fP, where the former includes the latter. +So it seems +including the former is the best choice. + +LSB has deprecated the library calls +.BR statfs () +and +.BR fstatfs () +and tells us to use +.BR statvfs (2) +and +.BR fstatvfs (2) +instead. +.SS The f_fsid field +Solaris, Irix and POSIX have a system call +.BR statvfs (2) +that returns a +.I "struct statvfs" +(defined in +.IR ) +containing an +.I "unsigned long" +.IR f_fsid . +Linux, SunOS, HP-UX, 4.4BSD have a system call +.BR statfs () +that returns a +.I "struct statfs" +(defined in +.IR ) +containing a +.I fsid_t +.IR f_fsid , +where +.I fsid_t +is defined as +.IR "struct { int val[2]; }" . +The same holds for FreeBSD, except that it uses the include file +.IR . + +The general idea is that +.I f_fsid +contains some random stuff such that the pair +.RI ( f_fsid , ino ) +uniquely determines a file. +Some OSes use (a variation on) the device number, or the device number +combined with the file-system type. +Several OSes restrict giving out the +.I f_fsid +field to the superuser only (and zero it for unprivileged users), +because this field is used in the filehandle of the file system +when NFS-exported, and giving it out is a security concern. +.LP +Under some OSes the +.I fsid +can be used as second argument to the +.BR sysfs () +system call. +.SH "SEE ALSO" +.BR stat (2), +.BR statvfs (2), +.BR path_resolution (7) diff --git a/original/man2/statfs64.2 b/original/man2/statfs64.2 new file mode 100644 index 00000000..923d3c0c --- /dev/null +++ b/original/man2/statfs64.2 @@ -0,0 +1 @@ +.so man2/statfs.2 diff --git a/original/man2/statvfs.2 b/original/man2/statvfs.2 new file mode 100644 index 00000000..6530779a --- /dev/null +++ b/original/man2/statvfs.2 @@ -0,0 +1,180 @@ +.\" Copyright (C) 2003 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. +.\" +.\" The pathconf note is from Walter Harms +.\" This is not a system call on Linux +.\" +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.TH STATVFS 2 2003-08-22 "Linux" "Linux Programmer's Manual" +.SH NAME +statvfs, fstatvfs \- get file system statistics +.SH SYNOPSIS +.B #include +.sp +.BI "int statvfs(const char *" path ", struct statvfs *" buf ); +.br +.BI "int fstatvfs(int " fd ", struct statvfs *" buf ); +.SH DESCRIPTION +The function +.BR statvfs () +returns information about a mounted file system. +.I path +is the pathname of any file within the mounted file system. +.I buf +is a pointer to a +.I statvfs +structure defined approximately as follows: + +.in +4n +.nf +struct statvfs { + unsigned long f_bsize; /* file system block size */ + unsigned long f_frsize; /* fragment size */ + fsblkcnt_t f_blocks; /* size of fs in f_frsize units */ + fsblkcnt_t f_bfree; /* # free blocks */ + fsblkcnt_t f_bavail; /* # free blocks for unprivileged users */ + fsfilcnt_t f_files; /* # inodes */ + fsfilcnt_t f_ffree; /* # free inodes */ + fsfilcnt_t f_favail; /* # free inodes for unprivileged users */ + unsigned long f_fsid; /* file system ID */ + unsigned long f_flag; /* mount flags */ + unsigned long f_namemax; /* maximum filename length */ +}; +.fi +.in + +Here the types +.I fsblkcnt_t +and +.I fsfilcnt_t +are defined in +.IR . +Both used to be +.IR "unsigned long" . + +The field +.I f_flag +is a bit mask (of mount flags, see +.BR mount (8)). +Bits defined by POSIX are +.TP +.B ST_RDONLY +Read-only file system. +.TP +.B ST_NOSUID +Set-user-ID/set-group-ID bits are ignored by +.BR exec (3). +.LP +It is unspecified whether all members of the returned struct +have meaningful values on all file systems. + +.BR fstatvfs () +returns the same information about an open file referenced by descriptor +.IR fd . +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +.RB ( statvfs ()) +Search permission is denied for a component of the path prefix of +.IR path . +(See also +.BR path_resolution (7).) +.TP +.B EBADF +.RB ( fstatvfs ()) +.I fd +is not a valid open file descriptor. +.TP +.B EFAULT +.I Buf +or +.I path +points to an invalid address. +.TP +.B EINTR +This call was interrupted by a signal. +.TP +.B EIO +An I/O error occurred while reading from the file system. +.TP +.B ELOOP +.RB ( statvfs ()) +Too many symbolic links were encountered in translating +.IR path . +.TP +.B ENAMETOOLONG +.RB ( statvfs ()) +.I path +is too long. +.TP +.B ENOENT +.RB ( statvfs ()) +The file referred to by +.I path +does not exist. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOSYS +The file system does not support this call. +.TP +.B ENOTDIR +.RB ( statvfs ()) +A component of the path prefix of +.I path +is not a directory. +.TP +.B EOVERFLOW +Some values were too large to be represented in the returned struct. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +The Linux kernel has system calls +.BR statfs (2) +and +.BR fstatfs (2) +to support this library call. + +The current glibc implementations of +.sp +.nf + pathconf(path, _PC_REC_XFER_ALIGN); + pathconf(path, _PC_ALLOC_SIZE_MIN); + pathconf(path, _PC_REC_MIN_XFER_SIZE); +.fi +.sp +respectively use the +.IR f_frsize , +.IR f_frsize , +and +.I f_bsize +fields of the return value of +.IR "statvfs(path,buf)" . +.SH "SEE ALSO" +.BR statfs (2) diff --git a/original/man2/stime.2 b/original/man2/stime.2 new file mode 100644 index 00000000..5e7e2261 --- /dev/null +++ b/original/man2/stime.2 @@ -0,0 +1,73 @@ +.\" 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 2001-03-16 by Andries Brouwer +.\" Modified 2004-05-27 by Michael Kerrisk +.\" +.TH STIME 2 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +stime \- set time +.SH SYNOPSIS +.B #include +.sp +.BI "int stime(time_t *" t ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR stime (): +_SVID_SOURCE +.SH DESCRIPTION +.BR stime () +sets the system's idea of the time and date. +The time, pointed +to by \fIt\fP, is measured in seconds since the +Epoch, 1970-01-01 00:00:00 +0000 (UTC). +.BR stime () +may only be executed by the superuser. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +Error in getting information from user space. +.TP +.B EPERM +The calling process has insufficient privilege. +Under Linux the +.B CAP_SYS_TIME +privilege is required. +.SH "CONFORMING TO" +SVr4. +.SH "SEE ALSO" +.BR date (1), +.BR settimeofday (2), +.BR capabilities (7) diff --git a/original/man2/stty.2 b/original/man2/stty.2 new file mode 100644 index 00000000..5d25ea6c --- /dev/null +++ b/original/man2/stty.2 @@ -0,0 +1 @@ +.so man2/unimplemented.2 diff --git a/original/man2/swapoff.2 b/original/man2/swapoff.2 new file mode 100644 index 00000000..2bd424c1 --- /dev/null +++ b/original/man2/swapoff.2 @@ -0,0 +1 @@ +.so man2/swapon.2 diff --git a/original/man2/swapon.2 b/original/man2/swapon.2 new file mode 100644 index 00000000..63d1c9bb --- /dev/null +++ b/original/man2/swapon.2 @@ -0,0 +1,171 @@ +.\" 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. +.\" +.TH SWAPON 2 2007-06-22 "Linux" "Linux Programmer's Manual" +.SH NAME +swapon, swapoff \- start/stop swapping to file/device +.SH SYNOPSIS +.B #include +.br +.B #include /* to find PAGE_SIZE */ +.br +.B #include +.sp +.BI "int swapon(const char *" path ", int " swapflags ); +.br +.BI "int swapoff(const char *" path ); +.SH DESCRIPTION +.BR swapon () +sets the swap area to the file or block device specified by +.IR path . +.BR swapoff () +stops swapping to the file or block device specified by +.IR path . +.PP +.BR swapon () +takes a +.I swapflags +argument. +If +.I swapflags +has the +.B SWAP_FLAG_PREFER +bit turned on, the new swap area will have a higher priority than default. +The priority is encoded within +.I swapflags +as: +.br +.sp +.I " (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK" +.br +.PP +These functions may only be used by a privileged process (one having the +.B CAP_SYS_ADMIN +capability). +.SS Priority +Each swap area has a priority, either high or low. +The default priority is low. +Within the low-priority areas, +newer areas are even lower priority than older areas. +.PP +All priorities set with +.I swapflags +are high-priority, higher than default. +They may have any nonnegative value chosen by the caller. +Higher numbers mean higher priority. +.PP +Swap pages are allocated from areas in priority order, +highest priority first. +For areas with different priorities, +a higher-priority area is exhausted before using a lower-priority area. +If two or more areas have the same priority, +and it is the highest priority available, +pages are allocated on a round-robin basis between them. +.PP +As of Linux 1.3.6, the kernel usually follows these rules, +but there are exceptions. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBUSY +(for +.BR swapon ()) +The specified +.I path +is already being used as a swap area. +.TP +.B EINVAL +The file +.I path +exists, but refers neither to a regular file nor to a block device; +or, for +.BR swapon (), +the indicated path does not contain a valid swap signature or +resides on an in-memory file system like tmpfs; or, for +.BR swapoff (), +.I path +is not currently a swap area. +.TP +.B ENFILE +The system limit on the total number of open files has been reached. +.TP +.B ENOENT +The file +.I path +does not exist. +.TP +.B ENOMEM +The system has insufficient memory to start swapping. +.TP +.B EPERM +The caller does not have the +.B CAP_SYS_ADMIN +capability. +Alternatively, the maximum number of swap files are already in use; +see NOTES below. +.SH "CONFORMING TO" +These functions are Linux-specific and should not be used in programs +intended to be portable. +The second +.I swapflags +argument was introduced in Linux 1.3.2. +.SH NOTES +The partition or path must be prepared with +.BR mkswap (8). + +There is an upper limit on the number of swap files that may be used, +defined by the kernel constant +.BR MAX_SWAPFILES . +Before kernel 2.4.10, +.B MAX_SWAPFILES +has the value 8; +since kernel 2.4.10, it has the value 32. +Since kernel 2.6.18, the limit is decreased by 2 (thus: 30) +if the kernel is built with the +.B CONFIG_MIGRATION +option +(which reserves two swap table entries for the page migration features of +.BR mbind (2) +and +.BR migrate_pages (2)). +.SH "SEE ALSO" +.BR mkswap (8), +.BR swapoff (8), +.BR swapon (8) diff --git a/original/man2/symlink.2 b/original/man2/symlink.2 new file mode 100644 index 00000000..935ef864 --- /dev/null +++ b/original/man2/symlink.2 @@ -0,0 +1,167 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 1996-04-26 by Nick Duffek +.\" Modified 1996-11-06 by Eric S. Raymond +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.TH SYMLINK 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +symlink \- make a new name for a file +.SH SYNOPSIS +.B #include +.sp +.BI "int symlink(const char *" oldpath ", const char *" newpath ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR symlink (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _POSIX_C_SOURCE\ >=\ 200112L +.ad b +.SH DESCRIPTION +.BR symlink () +creates a symbolic link named +.I newpath +which contains the string +.IR oldpath . + +Symbolic links are interpreted at run time as if the contents of the +link had been substituted into the path being followed to find a file or +directory. + +Symbolic links may contain +.I .. +path components, which (if used at the start of the link) refer to the +parent directories of that in which the link resides. + +A symbolic link (also known as a soft link) may point to an existing +file or to a nonexistent one; the latter case is known as a dangling +link. + +The permissions of a symbolic link are irrelevant; the ownership is +ignored when following the link, but is checked when removal or +renaming of the link is requested and the link is in a directory with +the sticky bit +.RB ( S_ISVTX ) +set. + +If +.I newpath +exists it will +.I not +be overwritten. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +Write access to the directory containing +.I newpath +is denied, or one of the directories in the path prefix of +.I newpath +did not allow search permission. +(See also +.BR path_resolution (7).) +.TP +.B EEXIST +.I newpath +already exists. +.TP +.B EFAULT +.IR oldpath " or " newpath " points outside your accessible address space." +.TP +.B EIO +An I/O error occurred. +.TP +.B ELOOP +Too many symbolic links were encountered in resolving +.IR newpath . +.TP +.B ENAMETOOLONG +.IR oldpath " or " newpath " was too long." +.TP +.B ENOENT +A directory component in +.I newpath +does not exist or is a dangling symbolic link, or +.I oldpath +is the empty string. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOSPC +The device containing the file has no room for the new directory +entry. +.TP +.B ENOTDIR +A component used as a directory in +.I newpath +is not, in fact, a directory. +.TP +.B EPERM +The file system containing +.I newpath +does not support the creation of symbolic links. +.TP +.B EROFS +.I newpath +is on a read-only file system. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.\" SVr4 documents additional error codes EDQUOT and ENOSYS. +.\" See +.\" .BR open (2) +.\" re multiple files with the same name, and NFS. +.SH NOTES +No checking of +.I oldpath +is done. + +Deleting the name referred to by a symlink will actually delete the +file (unless it also has other hard links). +If this behavior is not desired, use +.BR link (2). +.SH "SEE ALSO" +.BR ln (1), +.BR lchown (2), +.BR link (2), +.BR lstat (2), +.BR open (2), +.BR readlink (2), +.BR rename (2), +.BR symlinkat (2), +.BR unlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/symlinkat.2 b/original/man2/symlinkat.2 new file mode 100644 index 00000000..a39df0bc --- /dev/null +++ b/original/man2/symlinkat.2 @@ -0,0 +1,121 @@ +.\" 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. +.\" +.\" +.TH SYMLINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +symlinkat \- create a symbolic link relative to a directory file descriptor +.SH SYNOPSIS +.nf +.B #include /* Definition of AT_* constants */ +.B #include +.sp +.BI "int symlinkat(const char *" oldpath ", int " newdirfd \ +", const char *" newpath ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR symlinkat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +The +.BR symlinkat () +system call operates in exactly the same way as +.BR symlink (2), +except for the differences described in this manual page. + +If the pathname given in +.I newpath +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I newdirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR symlink (2) +for a relative pathname). + +If +.I newpath +is relative and +.I newdirfd +is the special value +.BR AT_FDCWD , +then +.I newpath +is interpreted relative to the current working +directory of the calling process (like +.BR symlink (2)). + +If +.I newpath +is absolute, then +.I newdirfd +is ignored. +.SH "RETURN VALUE" +On success, +.BR symlinkat () +returns 0. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR symlink (2) +can also occur for +.BR symlinkat (). +The following additional errors can occur for +.BR symlinkat (): +.TP +.B EBADF +.I newdirfd +is not a valid file descriptor. +.TP +.B ENOTDIR +.I newpath +is relative and +.I newdirfd +is a file descriptor referring to a file other than a directory. +.SH VERSIONS +.BR symlinkat () +was added to Linux in kernel 2.6.16. +.SH "CONFORMING TO" +POSIX.1-2008. +.SH NOTES +See +.BR openat (2) +for an explanation of the need for +.BR symlinkat (). +.SH "SEE ALSO" +.BR openat (2), +.BR symlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/sync.2 b/original/man2/sync.2 new file mode 100644 index 00000000..2835149a --- /dev/null +++ b/original/man2/sync.2 @@ -0,0 +1,76 @@ +.\" 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 Sat Jul 24 12:02:47 1993 by Rik Faith +.\" Modified 15 Apr 1995 by Michael Chastain : +.\" Added reference to `bdflush(2)'. +.\" Modified 960414 by Andries Brouwer : +.\" Added the fact that since 1.3.20 sync actually waits. +.\" Modified Tue Oct 22 22:27:07 1996 by Eric S. Raymond +.\" Modified 2001-10-10 by aeb, following Michael Kerrisk. +.\" +.TH SYNC 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +sync \- commit buffer cache to disk +.SH SYNOPSIS +.B #include +.sp +.B void sync(void); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR sync (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +.BR sync () +first commits inodes to buffers, and then buffers to disk. +.SH ERRORS +This function is always successful. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH NOTES +Since glibc 2.2.2 the Linux prototype is as listed above, +following the various standards. +In libc4, libc5, and glibc up to 2.2.1 +it was "int sync(void)", and +.BR sync () +always returned 0. +.SH BUGS +According to the standard specification (e.g., POSIX.1-2001), +.BR sync () +schedules the writes, but may return before the actual +writing is done. +However, since version 1.3.20 Linux does actually wait. +(This still does not guarantee data integrity: modern disks have +large caches.) +.SH "SEE ALSO" +.BR bdflush (2), +.BR fdatasync (2), +.BR fsync (2), +.BR sync (8), +.BR update (8) diff --git a/original/man2/sync_file_range.2 b/original/man2/sync_file_range.2 new file mode 100644 index 00000000..cb0fee13 --- /dev/null +++ b/original/man2/sync_file_range.2 @@ -0,0 +1,187 @@ +.\" 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 +.\" +.TH SYNC_FILE_RANGE 2 2010-01-17 "Linux" "Linux Programmer's Manual" +.SH NAME +sync_file_range \- sync a file segment with disk +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "int sync_file_range(int " fd ", off64_t " offset ", off64_t " nbytes , +.BI " unsigned int " flags ); +.fi +.SH DESCRIPTION +.BR sync_file_range () +permits fine control when synchronizing the open file referred to by the +file descriptor +.I fd +with disk. + +.I offset +is the starting byte of the file range to be synchronized. +.I nbytes +specifies the length of the range to be synchronized, in bytes; if +.I nbytes +is zero, then all bytes from +.I offset +through to the end of file are synchronized. +Synchronization is in units of the system page size: +.I offset +is rounded down to a page boundary; +.I (offset+nbytes-1) +is rounded up to a page boundary. + +The +.I flags +bit-mask argument can include any of the following values: +.TP +.B SYNC_FILE_RANGE_WAIT_BEFORE +Wait upon write-out of all pages in the specified range +that have already been submitted to the device driver for write-out +before performing any write. +.TP +.B SYNC_FILE_RANGE_WRITE +Initiate write-out of all dirty pages in the specified +range which are not presently submitted write-out. +Note that even this may block if you attempt to +write more than request queue size. +.TP +.B SYNC_FILE_RANGE_WAIT_AFTER +Wait upon write-out of all pages in the range +after performing any write. +.PP +Specifying +.I flags +as 0 is permitted, as a no-op. +.SS Warning +This system call is extremely dangerous and should not be used in portable +programs. +None of these operations writes out the file's metadata. +Therefore, unless the application is strictly performing overwrites of +already-instantiated disk blocks, there are no guarantees that the data will +be available after a crash. +There is no user interface to know if a write is purely an overwrite. +On filesystem using copy-on-write semantics (e.g., +.IR btrfs ) +an overwrite of existing allocated blocks is impossible. +When writing into preallocated space, +many filesystems also require calls into the block +allocator, which this system call does not sync out to disk. +This system call does not flush disk write caches and thus does not provide +any data integrity on systems with volatile disk write caches. +.SS Some details +.B SYNC_FILE_RANGE_WAIT_BEFORE +and +.B SYNC_FILE_RANGE_WAIT_AFTER +will detect any +I/O errors or +.B ENOSPC +conditions and will return these to the caller. + +Useful combinations of the +.I flags +bits are: +.TP +.B SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE +Ensures that all pages +in the specified range which were dirty when +.BR sync_file_range () +was called are placed +under write-out. +This is a start-write-for-data-integrity operation. +.TP +.B SYNC_FILE_RANGE_WRITE +Start write-out of all dirty pages in the specified range which +are not presently under write-out. +This is an asynchronous flush-to-disk +operation. +This is not suitable for data integrity operations. +.TP +.BR SYNC_FILE_RANGE_WAIT_BEFORE " (or " SYNC_FILE_RANGE_WAIT_AFTER ) +Wait for +completion of write-out of all pages in the specified range. +This can be used after an earlier +.B SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE +operation to wait for completion of that operation, and obtain its result. +.TP +.B SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | \ +SYNC_FILE_RANGE_WAIT_AFTER +This is a write-for-data-integrity operation +that will ensure that all pages in the specified range which were dirty when +.BR sync_file_range () +was called are committed to disk. +.SH RETURN VALUE +On success, +.BR sync_file_range () +returns 0; on failure \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EBADF +.I fd +is not a valid file descriptor. +.TP +.B EINVAL +.I flags +specifies an invalid bit; or +.I offset +or +.I nbytes +is invalid. +.TP +.B EIO +I/O error. +.TP +.B ENOMEM +Out of memory. +.TP +.B ENOSPC +Out of disk space. +.TP +.B ESPIPE +.I fd +refers to something other than a regular file, a block device, +a directory, or a symbolic link. +.\" 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 VERSIONS +.BR sync_file_range () +appeared on Linux in kernel 2.6.17. +.SH "CONFORMING TO" +This system call is Linux-specific, and should be avoided +in portable programs. +.SH "SEE ALSO" +.BR fdatasync (2), +.BR fsync (2), +.BR msync (2), +.BR sync (2), +.BR feature_test_macros (7) diff --git a/original/man2/syscall.2 b/original/man2/syscall.2 new file mode 100644 index 00000000..bc5765d4 --- /dev/null +++ b/original/man2/syscall.2 @@ -0,0 +1,85 @@ +.\" Copyright (c) 1980, 1991, 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. +.\" +.\" @(#)syscall.2 8.1 (Berkeley) 6/16/93 +.\" +.\" +.\" 2002-03-20 Christoph Hellwig +.\" - adopted for Linux +.\" +.TH SYSCALL 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +syscall \- indirect system call +.SH SYNOPSIS +.nf +.BR "#define _GNU_SOURCE " " /* or _BSD_SOURCE or _SVID_SOURCE */" +.B #include +.BR "#include " "/* For SYS_xxx definitions */" + +.BI "int syscall(int " number ", ...);" +.fi +.SH DESCRIPTION +.BR syscall () +performs the system call whose assembly language +interface has the specified +.I number +with the specified arguments. +Symbolic constants for system calls can be found in the header file +.IR . +.SH RETURN VALUE +The return value is defined by the system call being invoked. +In general, a 0 return value indicates success. +A \-1 return value indicates an error, +and an error code is stored in +.IR errno . +.SH NOTES +.BR syscall () +first appeared in +4BSD. +.SH EXAMPLE +.nf +#define _GNU_SOURCE +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + pid_t tid; + + tid = syscall(SYS_gettid); +} +.fi +.SH SEE ALSO +.BR _syscall (2), +.BR intro (2), +.BR syscalls (2) diff --git a/original/man2/syscalls.2 b/original/man2/syscalls.2 new file mode 100644 index 00000000..c6e1cccb --- /dev/null +++ b/original/man2/syscalls.2 @@ -0,0 +1,797 @@ +.\" 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. +.\" +.TH SYSCALLS 2 2009-05-06 "Linux" "Linux Programmer's Manual" +.SH NAME +syscalls \- Linux system calls +.SH SYNOPSIS +Linux system calls. +.SH DESCRIPTION +The system call is the fundamental interface between an application +and the Linux kernel. +.SS System calls and library wrapper functions +System calls are generally not invoked directly, +but rather via wrapper functions in glibc (or perhaps some other library). +For details of direct invocation of a system call, see +.BR intro (2). +Often, but not always, the name of the wrapper function is the same +as the name of the system call that it invokes. +For example, glibc contains a function +.BR truncate () +which invokes the underlying "truncate" system call. + +Often the glibc wrapper function is quite thin, doing little work +other than copying arguments to the right registers +before invoking the system call, +and then setting +.I errno +appropriately after the system call has returned. +(These are the same steps that are performed by +.BR syscall (2), +which can be used to invoke system calls +for which no wrapper function is provided.) +Note: system calls indicate a failure by returning a negative error +number to the caller; +when this happens, +the wrapper function negates the returned error number +(to make it positive), copies it to +.IR errno , +and returns \-1 to the caller of the wrapper. + +Sometimes, however, the wrapper function does some extra work +before invoking the system call. +For example, nowadays there are (for reasons described below) two +related system calls, +.BR truncate (2) +and +.BR truncate64 (2), +and the glibc +.BR truncate () +wrapper function checks which of those system calls +are provided by the kernel and determines which should be employed. +.SS System call list +Below is a list of those system calls that are common to most platforms. +In the list, the +.I Kernel +column indicates the kernel version +for those system calls that were new in Linux 2.2, +or have appeared since that kernel version. +Note the following points: +.IP * 3 +Where no kernel version is indicated, +the system call appeared in kernel 1.0 or earlier. +.IP * +Where a system call is marked "1.2" +this means the system call probably appeared in a 1.1.x kernel version, +and first appeared in a stable kernel with 1.2. +(Development of the 1.2 kernel was initiated from a branch of kernel +1.0.6 via the 1.1.x unstable kernel series.) +.IP * +Where a system call is marked "2.0" +this means the system call probably appeared in a 1.3.x kernel version, +and first appeared in a stable kernel with 2.0. +(Development of the 2.0 kernel was initiated from a branch of kernel +1.2.x, somewhere around 1.2.10, +via the 1.3.x unstable kernel series.) +.\" 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 * +Where a system call is marked "2.2" +this means the system call probably appeared in a 2.1.x kernel version, +and first appeared in a stable kernel with 2.2.0. +(Development of the 2.2 kernel was initiated from a branch of kernel +2.0.21 via the 2.1.x unstable kernel series.) +.IP * +Where a system call is marked "2.4" +this means the system call probably appeared in a 2.3.x kernel version, +and first appeared in a stable kernel with 2.4.0. +(Development of the 2.4 kernel was initiated from a branch of +kernel 2.2.8 via the 2.3.x unstable kernel series.) +.IP * +Where a system call is marked "2.6" +this means the system call probably appeared in a 2.5.x kernel version, +and first appeared in a stable kernel with 2.6.0. +(Development of kernel 2.6 was initiated from a branch +of kernel 2.4.15 via the 2.5.x unstable kernel series.) +.IP * +Starting with kernel 2.6.0, the development model changed, +and new system calls may appear in each 2.6.x release. +In this case, the exact version number where the system call appeared +is shown. +.IP * +In some cases, a system call was added to a stable kernel +series after it branched from the previous stable kernel +series, and then backported into the earlier stable kernel series. +For example some system calls that appeared in 2.6.x were also backported +into a 2.4.x release after 2.4.15. +When this is so, the version where the system call appeared +in both of the major kernel series is listed. +.PP +The list of system calls that are available as at kernel 2.6.28 +(or in a few cases only on older kernels) is as follows: +.\" +.\" 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.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 +\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 +\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) +\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 +\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 +\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 +.\" \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.6 +\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 +On many platforms, including i386, socket calls are all multiplexed +(via glibc wrapper functions) through +.BR socketcall (2) +and similarly System V IPC calls are multiplexed through +.BR ipc (2). +.SH NOTES +Note the following points: +.IP * 3 +Although slots are reserved for them in the system call table, +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 +and +.BR vserver (2) \" __NR_vserver is 273 on Linux 2.6.22/i386 +(see also +.BR unimplemented (2)). +However, +.BR ftime (3), +.BR profil (3) +and +.BR ulimit (3) +exist as library routines. +The slot for +.BR phys (2) +is in use since kernel 2.1.116 for +.BR umount (2); +.BR phys (2) +will never be implemented. +.IP * +The +.BR getpmsg (2) +and +.BR putpmsg (2) +calls are for kernels patched to support STREAMS, +and may never be in the standard kernel. +.\" The security call is for future use. +.PP +Roughly speaking, the code belonging to the system call +with number __NR_xxx defined in +.I /usr/include/asm/unistd.h +can be found in the kernel source in the routine +.IR sys_xxx (). +(The dispatch table for i386 can be found in +.IR /usr/src/linux/arch/i386/kernel/entry.S .) +There are many exceptions, however, mostly because +older system calls were superseded by newer ones, +and this has been treated somewhat unsystematically. +On platforms with +proprietary OS emulation, such as parisc, sparc, sparc64 and alpha, +there are many additional system calls; mips64 also contains a full +set of 32-bit system calls. + +Over time, changes to the interfaces of some system calls have been +necessary. +One reason for such changes was the need to increase the size of +structures or scalar values passed to the system call. +Because of these changes, there are now various groups +of related system calls +(e.g., +.BR truncate (2) +and +.BR truncate64 (2)) +which perform similar tasks, but which vary in +details such as the size of their arguments. +(As noted earlier, applications are generally unaware of this: +the glibc wrapper functions do some work to ensure that the right +system call is invoked, and that ABI compatibility is +preserved for old binaries.) +Examples of systems calls that exist in multiple versions are +the following: +.IP * 3 +By now there are three different versions of +.BR stat (2): +.IR sys_stat () +(slot +.IR __NR_oldstat ), +.IR sys_newstat () +(slot +.IR __NR_stat ), +and +.IR sys_stat64 () +(slot +.IR __NR_stat64 ), +with the last being the most current. +.\" 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 +A similar story applies for +.BR lstat (2) +and +.BR fstat (2). +.IP * +Similarly, the defines +.IR __NR_oldolduname , +.IR __NR_olduname , +and +.I __NR_uname +refer to the routines +.IR sys_olduname (), +.IR sys_uname () +and +.IR sys_newuname (). +.IP * +In Linux 2.0, a new version of +.BR vm86 (2) +appeared, with the old and the new kernel routines being named +.IR sys_vm86old () +and +.IR sys_vm86 (). +.IP * +In Linux 2.4, a new version of +.BR getrlimit (2) +appeared, with the old and the new kernel routines being named +.IR sys_old_getrlimit () +(slot +.IR __NR_getrlimit ) +and +.IR sys_getrlimit () +(slot +.IR __NR_ugetrlimit ). +.IP * +Linux 2.4 increased the size of user and group IDs from 16 to 32 bits. +.\" 64 bit off_t changes: ftruncate64, *stat64, +.\" fcntl64 (because of the flock structure), getdents64, *statfs64 +To support this change, a range of system calls were added +(e.g., +.BR chown32 (2), +.BR getuid32 (2), +.BR getgroups32 (2), +.BR setresuid32 (2)), +superseding earlier calls of the same name without the +"32" suffix. +.IP * +Linux 2.4 added support for applications on 32-bit architectures +to access large files (i.e., files for which the sizes and +file offsets can't be represented in 32 bits.) +To support this change, replacements were required for system calls +that deal with file offsets and sizes. +Thus the following system calls were added: +.BR fcntl64 (2), +.BR ftruncate64 (2), +.BR getdents64 (2), +.BR stat64 (2), +.BR statfs64 (2), +and their analogs that work with file descriptors or +symbolic links. +These system calls supersede the older system calls +which, except in the case of the "stat" calls, +have the same name without the "64" suffix. + +On newer platforms that only have 64-bit file access and 32-bit uids +(e.g., alpha, ia64, s390x) there are no *64 or *32 calls. +Where the *64 and *32 calls exist, the other versions are obsolete. +.IP * +The +.I rt_sig* +calls were added in kernel 2.2 to support the addition +of real-time signals (see +.BR signal (7)). +These system calls supersede the older system calls of the same +name without the "rt_" prefix. +.IP * +The +.BR select (2) +and +.BR mmap (2) +system calls use five or more arguments, +which caused problems the way +argument passing on the i386 used to be set up. +Thus, while other architectures have +.IR sys_select () +and +.IR sys_mmap () +corresponding to +.I __NR_select +and +.IR __NR_mmap , +on i386 one finds +.IR old_select () +and +.IR old_mmap () +(routines that use a pointer to a +argument block) instead. +These days passing five arguments +is not a problem any more, and there is a +.I __NR__newselect +.\" (used by libc 6) +that corresponds directly to +.IR sys_select () +and similarly +.IR __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. +.SH SEE ALSO +.BR syscall (2), +.BR unimplemented (2), +.BR libc (7) diff --git a/original/man2/sysctl.2 b/original/man2/sysctl.2 new file mode 100644 index 00000000..7f2390e9 --- /dev/null +++ b/original/man2/sysctl.2 @@ -0,0 +1,168 @@ +.\" Copyright (C) 1996 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 April 1996 by Andries Brouwer +.\" 960412: Added comments from Stephen Tweedie +.\" Modified Tue Oct 22 22:28:41 1996 by Eric S. Raymond +.\" Modified Mon Jan 5 20:31:04 1998 by aeb. +.\" +.TH SYSCTL 2 2008-11-20 "Linux" "Linux Programmer's Manual" +.SH NAME +sysctl \- read/write system parameters +.SH SYNOPSIS +.nf +.B #include +.br +.B #include +.sp +.BI "int _sysctl(struct __sysctl_args *" args ); +.fi +.SH DESCRIPTION +.B Do not use this system call! +See NOTES. + +The +.BR _sysctl () +call reads and/or writes kernel parameters. +For example, the hostname, +or the maximum number of open files. +The argument has the form +.PP +.in +4n +.nf +struct __sysctl_args { + int *name; /* integer vector describing variable */ + int nlen; /* length of this vector */ + void *oldval; /* 0 or address where to store old value */ + size_t *oldlenp; /* available room for old value, + overwritten by actual size of old value */ + void *newval; /* 0 or address of new value */ + size_t newlen; /* size of new value */ +}; +.fi +.in +.PP +This call does a search in a tree structure, possibly resembling +a directory tree under +.IR /proc/sys , +and if the requested item is found calls some appropriate routine +to read or modify the value. +.SH "RETURN VALUE" +Upon successful completion, +.BR _sysctl () +returns 0. +Otherwise, a value of \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EFAULT +The invocation asked for the previous value by setting +.I oldval +non-NULL, but allowed zero room in +.IR oldlenp . +.TP +.B ENOTDIR +.I name +was not found. +.TP +.B EPERM +No search permission for one of the encountered "directories", +or no read permission where +.I oldval +was nonzero, or no write permission where +.I newval +was nonzero. +.SH "CONFORMING TO" +This call is Linux-specific, and should not be used in programs +intended to be portable. +A +.BR sysctl () +call has been present in Linux since version 1.3.57. +It originated in +4.4BSD. +Only Linux has the +.I /proc/sys +mirror, and the object naming schemes differ between Linux and 4.4BSD, +but the declaration of the +.BR sysctl () +function is the same in both. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). + +Or rather... don't call it: +use of this system call has long been discouraged, +and it is so unloved that +\fBit is likely to disappear in a future kernel version\fP. +.\" See http://lwn.net/Articles/247243/ +Remove it from your programs now; use the +.I /proc/sys +interface instead. +.SH BUGS +The object names vary between kernel versions, +making this system call worthless for applications. +.PP +Not all available objects are properly documented. +.PP +It is not yet possible to change operating system by writing to +.IR /proc/sys/kernel/ostype . +.SH EXAMPLE +.nf +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +int _sysctl(struct __sysctl_args *args ); + +#define OSNAMESZ 100 + +int +main(void) +{ + struct __sysctl_args args; + char osname[OSNAMESZ]; + size_t osnamelth; + int name[] = { CTL_KERN, KERN_OSTYPE }; + + memset(&args, 0, sizeof(struct __sysctl_args)); + args.name = name; + args.nlen = sizeof(name)/sizeof(name[0]); + args.oldval = osname; + args.oldlenp = &osnamelth; + + osnamelth = sizeof(osname); + + if (syscall(SYS__sysctl, &args) == \-1) { + perror("_sysctl"); + exit(EXIT_FAILURE); + } + printf("This machine is running %*s\\n", osnamelth, osname); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR proc (5) diff --git a/original/man2/sysfs.2 b/original/man2/sysfs.2 new file mode 100644 index 00000000..6a45e205 --- /dev/null +++ b/original/man2/sysfs.2 @@ -0,0 +1,101 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created Wed Aug 9 1995 Thomas K. Dyas +.\" +.TH SYSFS 2 1995-08-09 "Linux" "Linux Programmer's Manual" +.SH NAME +sysfs \- get file system type information +.SH SYNOPSIS +.BI "int sysfs(int " option ", const char *" fsname ); + +.BI "int sysfs(int " option ", unsigned int " fs_index ", char *" buf ); + +.BI "int sysfs(int " option ); +.SH DESCRIPTION +.BR sysfs () +returns information about the file system types currently present in +the kernel. +The specific form of the +.BR sysfs () +call and the information returned depends on the +.I option +in effect: +.TP 3 +.B 1 +Translate the file-system identifier string +.I fsname +into a file-system type index. +.TP +.B 2 +Translate the file-system type index +.I fs_index +into a null-terminated file-system identifier string. +This string will +be written to the buffer pointed to by +.IR buf . +Make sure that +.I buf +has enough space to accept the string. +.TP +.B 3 +Return the total number of file system types currently present in the +kernel. +.PP +The numbering of the file-system type indexes begins with zero. +.SH "RETURN VALUE" +On success, +.BR sysfs () +returns the file-system index for option +.BR 1 , +zero for option +.BR 2 , +and the number of currently configured file systems for option +.BR 3 . +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +.RI "Either " fsname " or " buf +is outside your accessible address space. +.TP +.B EINVAL +.I fsname +is not a valid file-system type identifier; +.I fs_index +is out-of-bounds; +.I option +is invalid. +.SH "CONFORMING TO" +SVr4. +.SH NOTES +On Linux with the +.I proc +file system mounted on +.IR /proc , +the same information can be derived from +.IR /proc/filesystems . +.SH BUGS +There is no libc or glibc support. +There is no way to guess how large \fIbuf\fP should be. diff --git a/original/man2/sysinfo.2 b/original/man2/sysinfo.2 new file mode 100644 index 00000000..bf9b9496 --- /dev/null +++ b/original/man2/sysinfo.2 @@ -0,0 +1,95 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (C) 1993 by Dan Miner (dminer@nyx.cs.du.edu) +.\" +.\" Permission is granted to freely distribute or modify this file +.\" for the purpose of improving Linux or its documentation efforts. +.\" If you modify this file, please put a date stamp and HOW you +.\" changed this file. Thanks. -DM +.\" +.\" 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 Nicolás Lichtmaier +.\" +.TH SYSINFO 2 2007-11-15 "Linux" "Linux Programmer's Manual" +.SH NAME +sysinfo \- returns information on overall system statistics +.SH SYNOPSIS +.B #include +.sp +.BI "int sysinfo(struct sysinfo *" info ); +.SH DESCRIPTION +Until Linux 2.3.16, +.BR sysinfo () +used to return information in the following structure: + +.nf +.in +4n +struct sysinfo { + long uptime; /* Seconds since boot */ + unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ + unsigned long totalram; /* Total usable main memory size */ + unsigned long freeram; /* Available memory size */ + unsigned long sharedram; /* Amount of shared memory */ + unsigned long bufferram; /* Memory used by buffers */ + unsigned long totalswap; /* Total swap space size */ + unsigned long freeswap; /* swap space still available */ + unsigned short procs; /* Number of current processes */ + char _f[22]; /* Pads structure to 64 bytes */ +}; +.in +.fi +.PP +and the sizes were given in bytes. + +Since Linux 2.3.23 (i386), 2.3.48 +(all architectures) the structure is: + +.nf +.in +4n +struct sysinfo { + long uptime; /* Seconds since boot */ + unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ + unsigned long totalram; /* Total usable main memory size */ + unsigned long freeram; /* Available memory size */ + unsigned long sharedram; /* Amount of shared memory */ + unsigned long bufferram; /* Memory used by buffers */ + unsigned long totalswap; /* Total swap space size */ + unsigned long freeswap; /* swap space still available */ + unsigned short procs; /* Number of current processes */ + unsigned long totalhigh; /* Total high memory size */ + unsigned long freehigh; /* Available high memory size */ + unsigned int mem_unit; /* Memory unit size in bytes */ + char _f[20\-2*sizeof(long)\-sizeof(int)]; /* Padding for libc5 */ +}; +.in +.fi +.PP +and the sizes are given as multiples of \fImem_unit\fP bytes. + +.BR sysinfo () +provides a simple way of getting overall system statistics. +This is more +portable than reading \fI/dev/kmem\fP. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +pointer to \fIstruct\ sysinfo\fP is invalid +.SH "CONFORMING TO" +This function is Linux-specific, and should not be used in programs +intended to be portable. +.sp +The Linux kernel has a +.BR sysinfo () +system call since 0.98.pl6. +Linux libc contains a +.BR sysinfo () +routine since 5.3.5, and +glibc has one since 1.90. +.SH "SEE ALSO" +.BR proc (5) diff --git a/original/man2/syslog.2 b/original/man2/syslog.2 new file mode 100644 index 00000000..c5d01bbf --- /dev/null +++ b/original/man2/syslog.2 @@ -0,0 +1,257 @@ +.\" 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 +.\" 2008-02-15, Jeremy Kerr +.\" Add info on command type 10; add details on types 6, 7, 8, & 9. +.\" 2008-02-15, Michael Kerrisk +.\" Update LOG_BUF_LEN details; update RETURN VALUE section. +.\" +.TH SYSLOG 2 2008-06-20 "Linux" "Linux Programmer's Manual" +.SH NAME +syslog, klogctl \- read and/or clear kernel message ring buffer; +set console_loglevel +.SH SYNOPSIS +.nf +.BI "int syslog(int " type ", char *" bufp ", int " len ); +.B " /* No wrapper provided in glibc */" +.sp +/* The glibc interface */ +.br +.B "#include " +.sp +.BI "int klogctl(int " type ", char *" bufp ", int " len ); +.fi +.SH DESCRIPTION +If you need the C library function +.BR syslog () +(which talks to +.BR syslogd (8)), +then look at +.BR syslog (3). +The system call of this name is about controlling the kernel +.IR printk () +buffer, and the glibc version is called +.BR klogctl (). + +The \fItype\fP argument determines the action taken by this function. + +Quoting from +.IR kernel/printk.c : +.nf +/* + * Commands to sys_syslog: + * + * 0 \-\- Close the log. Currently a NOP. + * 1 \-\- Open the log. Currently a NOP. + * 2 \-\- Read from the log. + * 3 \-\- Read all messages remaining in the ring buffer. + * 4 \-\- Read and clear all messages remaining in the ring buffer + * 5 \-\- Clear ring buffer. + * 6 \-\- Disable printk to console + * 7 \-\- Enable printk to console + * 8 \-\- Set level of messages printed to console + * 9 \-\- Return number of unread characters in the log buffer + * 10 \-\- Return size of the log buffer + */ +.fi + +Only command types 3 and 10 are allowed to unprivileged processes. +Type 9 was added in 2.4.10; type 10 in 2.6.6. +.SS The kernel log buffer +The kernel has a cyclic buffer of length +.B LOG_BUF_LEN +in which messages given as arguments to the kernel function +.BR printk () +are stored (regardless of their loglevel). +In early kernels, +.B LOG_BUF_LEN +had the value 4096; +from kernel 1.3.54, it was 8192; +from kernel 2.1.113 it was 16384; +since 2.4.23/2.6 the value is a kernel configuration option. +.\" Under "General setup" ==> "Kernel log buffer size" +.\" For 2.6, precisely the option seems to have appeared in 2.5.55. +In recent kernels the size can be queried with command type 10. + +The call +.I "syslog(2,buf,len)" +waits until this kernel log buffer is nonempty, and then reads +at most \fIlen\fP bytes into the buffer \fIbuf\fP. +It returns +the number of bytes read. +Bytes read from the log disappear from +the log buffer: the information can only be read once. +This is the function executed by the kernel when a user program +reads +.IR /proc/kmsg . + +The call +.I syslog(3,buf,len) +will read the last \fIlen\fP bytes from the log buffer (nondestructively), +but will not read more than was written into the buffer since the +last "clear ring buffer" command (which does not clear the buffer at all). +It returns the number of bytes read. + +The call +.I syslog(4,buf,len) +does precisely the same, but also executes the "clear ring buffer" command. + +The call +.I syslog(5,dummy,dummy) +executes just the "clear ring buffer" command. +(In each call where +.I buf +or +.I len +is shown as "dummy", the value of the argument is ignored by the call.) + +The call +.I syslog(6,dummy,dummy) +sets the console log level to minimum, so that no messages are printed +to the console. + +The call +.I syslog(7,dummy,dummy) +sets the console log level to default, so that messages are printed +to the console. + +The call +.I syslog(8,dummy,level) +sets the console log level to +.IR level , +which must be an integer between 1 and 8 (inclusive). +See the +.B loglevel +section for details. + +The call +.I syslog(9,dummy,dummy) +returns the number of bytes currently available to be read +on the kernel log buffer. + +The call +.I syslog(10,dummy,dummy) +returns the total size of the kernel log buffer. +.SS The loglevel +The kernel routine +.BR printk () +will only print a message on the +console, if it has a loglevel less than the value of the variable +.IR console_loglevel . +This variable initially has the value +.B DEFAULT_CONSOLE_LOGLEVEL +(7), but is set to 10 if the +kernel command line contains the word "debug", and to 15 in case +of a kernel fault (the 10 and 15 are just silly, and equivalent to 8). +This variable is set (to a value in the range 1-8) by the call +.IR syslog(8,dummy,value) . +The calls +.I syslog(type,dummy,dummy) +with \fItype\fP equal to 6 or 7, set it to 1 (kernel panics only) +or 7 (all except debugging messages), respectively. + +Every text line in a message has its own loglevel. +This level is +.I "DEFAULT_MESSAGE_LOGLEVEL \- 1" +(6) unless the line starts with +where \fId\fP is a digit in the range 1-7, in which case the level +is \fId\fP. +The conventional meaning of the loglevel is defined in +.I +as follows: + +.nf +#define KERN_EMERG "<0>" /* system is unusable */ +#define KERN_ALERT "<1>" /* action must be taken immediately */ +#define KERN_CRIT "<2>" /* critical conditions */ +#define KERN_ERR "<3>" /* error conditions */ +#define KERN_WARNING "<4>" /* warning conditions */ +#define KERN_NOTICE "<5>" /* normal but significant condition */ +#define KERN_INFO "<6>" /* informational */ +#define KERN_DEBUG "<7>" /* debug-level messages */ +.fi +.SH "RETURN VALUE" +For \fItype\fP equal to 2, 3, or 4, a successful call to +.BR syslog () +returns the number +of bytes read. +For \fItype\fP 9, +.BR syslog () +returns the number of bytes currently +available to be read on the kernel log buffer. +For \fItype\fP 10, +.BR syslog () +returns the total size of the kernel log buffer. +For other values of \fItype\fP, 0 is returned on success. + +In case of error, \-1 is returned, +and \fIerrno\fP is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +Bad arguments (e.g., +bad +.IR type ; +or for +.I type +2, 3, or 4, +.I buf +is NULL, +or +.I len +is less than zero; or for +.I type +8, the +.I level +is outside the range 1 to 8). +.TP +.B EPERM +An attempt was made to change console_loglevel or clear the kernel +message ring buffer by a process without sufficient privilege +(more precisely: without the +.B CAP_SYS_ADMIN +capability). +.TP +.B ERESTARTSYS +System call was interrupted by a signal; nothing was read. +(This can be seen only during a trace.) +.TP +.B ENOSYS +This +.BR syslog () +system call is not available, because the kernel was compiled with the +.BR CONFIG_PRINTK +kernel-configuration option disabled. +.SH "CONFORMING TO" +This system call is Linux-specific and should not be used in programs +intended to be portable. +.SH NOTES +From the very start people noted that it is unfortunate that +a system call and a library routine of the same name are entirely +different animals. +In libc4 and libc5 the number of this call was defined by +.BR SYS_klog . +In glibc 2.0 the syscall is baptized +.BR klogctl (). +.SH "SEE ALSO" +.BR syslog (3) diff --git a/original/man2/tee.2 b/original/man2/tee.2 new file mode 100644 index 00000000..23ffab2c --- /dev/null +++ b/original/man2/tee.2 @@ -0,0 +1,199 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 2006 Jens Axboe +.\" 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. +.\" +.TH TEE 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH NAME +tee \- duplicating pipe content +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "ssize_t tee(int " fd_in ", int " fd_out ", size_t " len \ +", unsigned int " flags ); +.fi +.\" Return type was long before glibc 2.7 +.SH DESCRIPTION +.\" Example programs http://brick.kernel.dk/snaps +.\" +.\" +.\" add a "tee(in, out1, out2)" system call that duplicates the pages +.\" (again, incrementing their reference count, not copying the data) from +.\" one pipe to two other pipes. +.BR tee () +duplicates up to +.I len +bytes of data from the pipe referred to by the file descriptor +.I fd_in +to the pipe referred to by the file descriptor +.IR fd_out . +It does not consume the data that is duplicated from +.IR fd_in ; +therefore, that data can be copied by a subsequent +.BR splice (2). + +.I flags +is a series of modifier flags, which share the name space with +.BR splice (2) +and +.BR vmsplice (2): +.TP 1.9i +.B SPLICE_F_MOVE +Currently has no effect for +.BR tee (); +see +.BR splice (2). +.TP +.B SPLICE_F_NONBLOCK +Do not block on I/O; see +.BR splice (2) +for further details. +.TP +.B SPLICE_F_MORE +Currently has no effect for +.BR tee (), +but may be implemented in the future; see +.BR splice (2). +.TP +.B SPLICE_F_GIFT +Unused for +.BR tee (); +see +.BR vmsplice (2). +.SH RETURN VALUE +Upon successful completion, +.BR tee () +returns the number of bytes that were duplicated between the input +and output. +A return value of 0 means that there was no data to transfer, +and it would not make sense to block, because there are no +writers connected to the write end of the pipe referred to by +.IR fd_in . + +On error, +.BR tee () +returns \-1 and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +.I fd_in +or +.I fd_out +does not refer to a pipe; or +.I fd_in +and +.I fd_out +refer to the same pipe. +.TP +.B ENOMEM +Out of memory. +.SH VERSIONS +The +.BR tee () +system call first appeared in Linux 2.6.17. +.SH "CONFORMING TO" +This system call is Linux-specific. +.SH NOTES +Conceptually, +.BR tee () +copies the data between the two pipes. +In reality no real data copying takes place though: +under the covers, +.BR tee () +assigns data in the output by merely grabbing +a reference to the input. +.SH EXAMPLE +The following example implements a basic +.BR tee (1) +program using the +.BR tee () +system call. +.nf + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int fd; + int len, slen; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd == \-1) { + perror("open"); + exit(EXIT_FAILURE); + } + + do { + /* + * tee stdin to stdout. + */ + len = tee(STDIN_FILENO, STDOUT_FILENO, + INT_MAX, SPLICE_F_NONBLOCK); + + if (len < 0) { + if (errno == EAGAIN) + continue; + perror("tee"); + exit(EXIT_FAILURE); + } else + if (len == 0) + break; + + /* + * Consume stdin by splicing it to a file. + */ + while (len > 0) { + slen = splice(STDIN_FILENO, NULL, fd, NULL, + len, SPLICE_F_MOVE); + if (slen < 0) { + perror("splice"); + break; + } + len \-= slen; + } + } while (1); + + close(fd); + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR splice (2), +.BR vmsplice (2), +.BR feature_test_macros (7) diff --git a/original/man2/tgkill.2 b/original/man2/tgkill.2 new file mode 100644 index 00000000..82fc2d6a --- /dev/null +++ b/original/man2/tgkill.2 @@ -0,0 +1 @@ +.so man2/tkill.2 diff --git a/original/man2/time.2 b/original/man2/time.2 new file mode 100644 index 00000000..bc2eacae --- /dev/null +++ b/original/man2/time.2 @@ -0,0 +1,79 @@ +.\" 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 Sat Jul 24 14:13:40 1993 by Rik Faith +.\" Additions by Joseph S. Myers , 970909 +.\" +.TH TIME 2 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +time \- get time in seconds +.SH SYNOPSIS +.B #include +.sp +.BI "time_t time(time_t *" t ); +.SH DESCRIPTION +.BR time () +returns the time as the number of seconds since the +Epoch, 1970-01-01 00:00:00 +0000 (UTC). + +If +.I t +is non-NULL, +the return value is also stored in the memory pointed to by +.IR t . +.SH "RETURN VALUE" +On success, the value of time in seconds since the Epoch is returned. +On error, \fI((time_t)\ \-1)\fP is returned, and \fIerrno\fP is set +appropriately. +.SH ERRORS +.TP +.B EFAULT +.I t +points outside your accessible address space. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.\" .br +.\" Under 4.3BSD, this call is obsoleted by +.\" .BR gettimeofday (2). +POSIX does not specify any error conditions. +.SH NOTES +POSIX.1 defines +.I seconds since the Epoch +as a value to be interpreted as the number of seconds between a +specified time and the Epoch, according to a formula for conversion +from UTC equivalent to conversion on the naive basis that leap +seconds are ignored and all years divisible by 4 are leap years. +This value is not the same as the actual number of seconds between the time +and the Epoch, because of leap seconds and because clocks are not +required to be synchronized to a standard reference. +The intention is +that the interpretation of seconds since the Epoch values be +consistent; see POSIX.1 Annex B 2.2.2 for further rationale. +.SH "SEE ALSO" +.BR date (1), +.BR gettimeofday (2), +.BR ctime (3), +.BR ftime (3), +.BR time (7) diff --git a/original/man2/timer_create.2 b/original/man2/timer_create.2 new file mode 100644 index 00000000..54323cf7 --- /dev/null +++ b/original/man2/timer_create.2 @@ -0,0 +1,434 @@ +.\" 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. +.TH TIMER_CREATE 2 2009-02-20 Linux "Linux Programmer's Manual" +.SH NAME +timer_create \- create a POSIX per-process timer +.SH SYNOPSIS +.nf +.B #include +.B #include + +.BI "int timer_create(clockid_t " clockid ", struct sigevent *" evp , +.BI " timer_t *" timerid ); +.fi + +Link with \fI\-lrt\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR timer_create (): +_POSIX_C_SOURCE >= 199309 +.SH DESCRIPTION +.BR timer_create () +creates a new per-process interval timer. +The ID of the new timer is returned in the buffer pointed to by +.IR timerid , +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 +.I clockid +argument specifies the clock that the new timer uses to measure time. +It can be specified as one of the following values: +.TP +.B CLOCK_REALTIME +A settable system-wide real-time clock. +.TP +.B CLOCK_MONOTONIC +A nonsettable monotonically increasing clock that measures time +from some unspecified point in the past that does not change +after system startup. +.\" Note: the CLOCK_MONOTONIC_RAW clock added for clock_gettime() +.\" in 2.6.28 is not supported for POSIX timers -- mtk, Feb 2009 +.TP +.BR CLOCK_PROCESS_CPUTIME_ID " (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 +.BR CLOCK_THREAD_CPUTIME_ID " (since Linux 2.6.12)" +A clock that measures (user and system) CPU time consumed by +the calling thread. +.\" The CLOCK_MONOTONIC_RAW that was added in 2.6.28 can't be used +.\" to create a timer -- mtk, Feb 2009 +.PP +As well as the above values, +.I clockid +can be specified as the +.I clockid +returned by a call to +.BR clock_getcpuclockid (3) +or +.BR pthread_getcpuclockid (3). + +The +.I evp +argument points to a +.I sigevent +structure that specifies how the caller +should be notified when the timer expires. +This structure is defined something like the following: + +.in +4n +.nf +union sigval { + int sival_int; + void *sival_ptr; +}; + +struct sigevent { + int sigev_notify; /* Notification method */ + int sigev_signo; /* Timer expiration signal */ + union sigval sigev_value; /* Value accompanying signal or + passed to thread function */ + void (*sigev_notify_function) (union sigval); + /* Function used for thread + notifications (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 +.in + +Some of these fields may be defined as part of a union: +a program should only employ those fields relevant +to the value specified in +.IR sigev_notify . +This field can have the following values: +.TP +.BR SIGEV_NONE +Don't asynchronously notify when the timer expires. +Progress of the timer can be monitored using +.BR timer_gettime (2). +.TP +.BR SIGEV_SIGNAL +Upon timer expiration, generate the signal +.I sigev_signo +for the process. +If +.I sigev_signo +is a real-time signal, +then it will be accompanied by the data specified in +.IR sigev_value +(like the signal-accompanying data for +.BR sigqueue (2)). +At any point in time, +at most one signal is queued to the process for a given timer; see +.BR timer_getoverrun (2) +for more details. +.TP +.BR SIGEV_THREAD +Upon timer expiration, invoke +.I sigev_notify_function +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 +.I sigev_value +as its sole argument. +If +.I sigev_notify_attributes +is not NULL, it should point to a +.I pthread_attr_t +structure that defines attributes for the new thread (see +.BR pthread_attr_init (3)). +.TP +.BR SIGEV_THREAD_ID " (Linux-specific)" +As for +.BR SIGEV_SIGNAL , +but the signal is targeted at the thread whose ID is given in +.IR sigev_notify_thread_id , +which must be a thread in the same process as the caller. +The +.IR sigev_notify_thread_id +field specifies a kernel thread ID, that is, the value returned by +.BR clone (2) +or +.BR gettid (2). +This flag is only intended for use by threading libraries. +.PP +Specifying +.I evp +as NULL is equivalent to specifying a pointer to a +.I sigevent +structure in which +.I sigev_notify +is +.BR SIGEV_SIGNAL , +.I sigev_signo +is +.BR SIGALRM , +and +.I sigev_value.sival_int +is the timer ID. +.SH RETURN VALUE +On success, +.BR timer_create () +returns 0, and the ID of the new timer is placed in +.IR *timerid . +On failure, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EAGAIN +Temporary error during kernel allocation of timer structures. +.TP +.B EINVAL +Clock ID, +.IR sigev_notify , +.IR sigev_signo , +or +.IR sigev_notify_thread_id +is invalid. +.TP +.B ENOMEM +.\" glibc layer: malloc() +Could not allocate memory. +.SH VERSIONS +This system call is available since Linux 2.6. +.SH CONFORMING TO +POSIX.1-2001 +.SH NOTES +A program may create multiple interval timers using +.BR timer_create (). + +Timers are not inherited by the child of a +.BR fork (2), +and are disarmed and deleted during an +.BR execve (2). + +The kernel preallocates a "queued real-time signal" +for each timer created using +.BR timer_create (). +Consequently, the number of timers is limited by the +.BR RLIMIT_SIGPENDING +resource limit (see +.BR setrlimit (2)). + +The timers created by +.BR timer_create () +are commonly known as "POSIX (interval) timers". +The POSIX timers API consists of the following interfaces: +.IP * 3 +.BR timer_create (): +Create a timer. +.IP * +.BR timer_settime (2): +Arm (start) or disarm (stop) a timer. +.IP * +.BR timer_gettime (2): +Fetch the time remaining until the next expiration of a timer, +along with the interval setting of the timer. +.IP * +.BR timer_getoverrun (2): +Return the overrun count for the last timer expiration. +.IP * +.BR timer_delete (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 +.BR SIGEV_THREAD +is implemented within glibc, rather than the kernel. +.IP * +The timer IDs presented at user level are maintained by glibc, +which maps these IDs to the timer IDs employed by the kernel. +.\" 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. +.PP +The POSIX timers system calls first appeared in Linux 2.6. +Prior to this, +glibc provided an incomplete userspace implementation +.RB ( CLOCK_REALTIME +timers only) using POSIX threads, +and current glibc falls back to this implementation on systems +running pre-2.6 Linux kernels. +.SH EXAMPLE +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 10\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); \\ + } 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\\n", (long) *tidp); + + or = timer_getoverrun(*tidp); + if (or == \-1) + errExit("timer_getoverrun"); + else + printf(" overrun count = %d\\n", 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\\n", 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 \\n", + argv[0]); + exit(EXIT_FAILURE); + } + + /* Establish handler for timer signal */ + + printf("Establishing handler for signal %d\\n", 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\\n", 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\\n", (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\\n", atoi(argv[1])); + sleep(atoi(argv[1])); + + /* Unlock the timer signal, so that timer notification + can be delivered */ + + printf("Unblocking signal %d\\n", SIG); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL) == \-1) + errExit("sigprocmask"); + + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR clock_gettime (2), +.BR setitimer (2), +.BR timer_delete (2), +.BR timer_settime (2), +.BR timer_getoverrun (2), +.BR timerfd_create (2), +.BR clock_getcpuclockid (3), +.BR pthread_getcpuclockid (3), +.BR pthreads (7), +.BR signal (7), +.BR time (7) diff --git a/original/man2/timer_delete.2 b/original/man2/timer_delete.2 new file mode 100644 index 00000000..39bb300e --- /dev/null +++ b/original/man2/timer_delete.2 @@ -0,0 +1,71 @@ +.\" 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. +.TH TIMER_DELETE 2 2009-02-20 Linux "Linux Programmer's Manual" +.SH NAME +timer_delete \- delete a POSIX per-process timer +.SH SYNOPSIS +.nf +.B #include + +.BI "int timer_delete(timer_t " timerid ); +.fi + +Link with \fI\-lrt\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR timer_delete (): +_POSIX_C_SOURCE >= 199309 +.SH DESCRIPTION +.BR timer_delete () +deletes the timer whose ID is given in +.IR timerid . +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 RETURN VALUE +On success, +.BR timer_delete () +returns 0. +On failure, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +.I timerid +is not a valid timer ID. +.SH VERSIONS +This system call is available since Linux 2.6. +.SH CONFORMING TO +POSIX.1-2001 +.SH SEE ALSO +.BR clock_gettime (2), +.BR timer_create (2), +.BR timer_settime (2), +.BR timer_getoverrun (2), +.BR time (7) diff --git a/original/man2/timer_getoverrun.2 b/original/man2/timer_getoverrun.2 new file mode 100644 index 00000000..a197adcd --- /dev/null +++ b/original/man2/timer_getoverrun.2 @@ -0,0 +1,137 @@ +.\" 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. +.TH TIMER_GETOVERRUN 2 2009-02-20 Linux "Linux Programmer's Manual" +.SH NAME +timer_getoverrun \- get overrun count for a POSIX per-process timer +.SH SYNOPSIS +.nf +.B #include + +.BI "int timer_getoverrun(timer_t " timerid ); +.fi + +Link with \fI\-lrt\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR timer_getoverrun (): +_POSIX_C_SOURCE >= 199309 +.SH DESCRIPTION +.BR timer_getoverrun () +returns the "overrun count" for the timer referred to by +.IR timerid . +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 +.RB ( SIGEV_SIGNAL ), +and via threads +.RB ( SIGEV_THREAD ). + +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 +.BR sigwaitinfo (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 RETURN VALUE +On success, +.BR timer_getoverrun () +returns the overrun count of the specified timer; +this count may be 0 if no overruns have occurred. +On failure, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +.I timerid +is not a valid timer ID. +.SH VERSIONS +This system call is available since Linux 2.6. +.SH CONFORMING TO +POSIX.1-2001 +.SH NOTES +When timer notifications are delivered via signals +.RB ( SIGEV_SIGNAL ), +on Linux it is also possible to obtain the overrun count via the +.I si_overrun +field of the +.I siginfo_t +structure (see +.BR sigaction (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. + +POSIX.1-2001 only discusses timer overruns in the context of +timer notifications using signals. +.\" FIXME . Austin bug filed, 11 Feb 09 +.SH BUGS +POSIX.1-2001 specifies that if the timer overrun count +is equal to or greater than an implementation-defined maximum, +.BR DELAYTIMER_MAX , +then +.BR timer_getoverrun () +should return +.BR DELAYTIMER_MAX . +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. +.\" Bug filed: http://bugzilla.kernel.org/show_bug.cgi?id=12665 +.\" http://thread.gmane.org/gmane.linux.kernel/113276/ +.SH EXAMPLE +See +.BR timer_create (2). +.SH SEE ALSO +.BR clock_gettime (2), +.BR sigaction (2), +.BR signalfd (2), +.BR sigwaitinfo (2), +.BR timer_create (2), +.BR timer_delete (2), +.BR timer_settime (2), +.BR signal (7), +.BR time (7) diff --git a/original/man2/timer_gettime.2 b/original/man2/timer_gettime.2 new file mode 100644 index 00000000..42015ca6 --- /dev/null +++ b/original/man2/timer_gettime.2 @@ -0,0 +1 @@ +.so man2/timer_settime.2 diff --git a/original/man2/timer_settime.2 b/original/man2/timer_settime.2 new file mode 100644 index 00000000..b0a509bb --- /dev/null +++ b/original/man2/timer_settime.2 @@ -0,0 +1,212 @@ +.\" 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. +.TH TIMER_SETTIME 2 2009-02-20 Linux "Linux Programmer's Manual" +.SH NAME +timer_settime, timer_gettime \- arm/disarm and fetch +state of POSIX per-process timer +.SH SYNOPSIS +.nf +.B #include + +.BI "int timer_settime(timer_t " timerid ", int " flags , +.BI " const struct itimerspec *" new_value , +.BI " struct itimerspec * " old_value ); +.BI "int timer_gettime(timer_t " timerid ", struct itimerspec *" curr_value ); +.fi + +Link with \fI\-lrt\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR timer_settime (), +.BR timer_gettime (): +_POSIX_C_SOURCE >= 199309 +.SH DESCRIPTION +.BR timer_settime () +arms or disarms the timer identified by +.IR timerid . +The +.I new_value +argument is an +.I itimerspec +structure that specifies the new initial value and +the new interval for the timer. +The +.I itimerspec +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 +.I itimerspec +structure is a +.I timespec +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 +.BR timer_create () + +If +.I new_value->it_value +specifies a nonzero value (i.e., either subfield is nonzero), then +.BR timer_settime () +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 +.I new_value->it_value +specifies a zero value +(i.e., both subfields are zero), +then the timer is disarmed. + +The +.I new_value->it_interval +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 +.IR new_value->it_interval . +If +.I new_value->it_interval +specifies a zero value +then the timer expires just once, at the time specified by +.IR it_value . + +By default, the initial expiration time specified in +.I new_value->it_value +is interpreted relative to the current time on the timer's +clock at the time of the call. +This can be modified by specifying +.B TIMER_ABSTIME +in +.IR flags , +in which case +.I new_value->it_value +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 +.IR new_value->it_value . +If the specified absolute time has already passed, +then the timer expires immediately, +and the overrun count (see +.BR timer_getoverrun (2)) +will be set correctly. +.\" By experiment: the overrun count is set correctly, for CLOCK_REALTIME. + +If the value of the +.B CLOCK_REALTIME +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 +.B CLOCK_REALTIME +clock have no effect on relative timers based on that clock. +.\" 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 +.I old_value +is not NULL, then it returns the previous interval of the timer (in +.IR old_value->it_interval ) +and the amount of time until the timer +would previously have next expired (in +.IR old_value->it_value ). + +.BR timer_gettime () +returns the time until next expiration, and the interval, +for the timer specified by +.IR timerid , +in the buffer pointed to by +.IR curr_value . +The time remaining until the next timer expiration is returned in +.IR curr_value->it_value ; +this is always a relative value, regardless of whether the +.BR TIMER_ABSTIME +flag was used when arming the timer. +If the value returned in +.IR curr_value->it_value +is zero, then the timer is currently disarmed. +The timer interval is returned in +.IR curr_value->it_interval . +If the value returned in +.IR curr_value->it_interval +is zero, then this is a "one-shot" timer. +.SH RETURN VALUE +On success, +.BR timer_settime () +and +.BR timer_gettime () +return 0. +On error, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +These functions may fail with the following errors: +.TP +.B EFAULT +.IR new_value , +.IR old_value , +or +.I curr_value +is not a valid pointer. +.TP +.B EINVAL +.I timerid +is invalid. +.\" FIXME . eventually: invalid value in flags +.PP +.BR timer_settime () +may fail with the following errors: +.TP +.B EINVAL +.I new_value.it_value +is negative; or +.I new_value.it_value.tv_nsec +is negative or greater than 999,999,999. +.SH VERSIONS +These system calls are available since Linux 2.6. +.SH CONFORMING TO +POSIX.1-2001 +.SH EXAMPLE +See +.BR timer_create (2). +.SH SEE ALSO +.BR timer_create (2), +.BR timer_settime (2), +.BR timer_getoverrun (2), +.BR time (7) diff --git a/original/man2/timerfd_create.2 b/original/man2/timerfd_create.2 new file mode 100644 index 00000000..c09e0309 --- /dev/null +++ b/original/man2/timerfd_create.2 @@ -0,0 +1,546 @@ +.\" Copyright (C) 2008 Michael Kerrisk +.\" +.\" 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 +.\" +.TH TIMERFD_CREATE 2 2009-03-10 Linux "Linux Programmer's Manual" +.SH NAME +timerfd_create, timerfd_settime, timerfd_gettime \- +timers that notify via file descriptors +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int timerfd_create(int " clockid ", int " flags ); +.sp +.BI "int timerfd_settime(int " fd ", int " flags , +.BI " const struct itimerspec *" new_value , +.BI " struct itimerspec *" old_value ); +.sp +.BI "int timerfd_gettime(int " fd ", struct itimerspec *" curr_value ); +.fi +.SH DESCRIPTION +These system calls create and operate on a timer +that delivers timer expiration notifications via a file descriptor. +They provide an alternative to the use of +.BR setitimer (2) +or +.BR timer_create (2), +with the advantage that the file descriptor may be monitored by +.BR select (2), +.BR poll (2), +and +.BR epoll (7). + +The use of these three system calls is analogous to the use of +.BR timer_create (2), +.BR timer_settime (2), +and +.BR timer_gettime (2). +(There is no analog of +.BR timer_getoverrun (2), +since that functionality is provided by +.BR read (2), +as described below.) +.\" +.SS timerfd_create() +.BR timerfd_create () +creates a new timer object, +and returns a file descriptor that refers to that timer. +The +.I clockid +argument specifies the clock that is used to mark the progress +of the timer, and must be either +.B CLOCK_REALTIME +or +.BR CLOCK_MONOTONIC . +.B CLOCK_REALTIME +is a settable system-wide clock. +.B CLOCK_MONOTONIC +is a nonsettable clock that is not affected +by discontinuous changes in the system clock +(e.g., manual changes to system time). +The current value of each of these clocks can be retrieved using +.BR clock_gettime (2). + +Starting with Linux 2.6.27, the following values may be bitwise ORed in +.IR flags +to change the behavior of +.BR timerfd_create (): +.TP 14 +.B TFD_NONBLOCK +Set the +.BR O_NONBLOCK +file status flag on the new open file description. +Using this flag saves extra calls to +.BR fcntl (2) +to achieve the same result. +.TP +.B TFD_CLOEXEC +Set the close-on-exec +.RB ( FD_CLOEXEC ) +flag on the new file descriptor. +See the description of the +.B O_CLOEXEC +flag in +.BR open (2) +for reasons why this may be useful. +.PP +In Linux versions up to and including 2.6.26, +.I flags +must be specified as zero. +.SS timerfd_settime() +.BR timerfd_settime () +arms (starts) or disarms (stops) +the timer referred to by the file descriptor +.IR fd . + +The +.I new_value +argument specifies the initial expiration and interval for the timer. +The +.I itimer +structure used for this argument contains two fields, +each of which is in turn a structure of type +.IR timespec : +.in +4n +.nf + +struct timespec { + time_t tv_sec; /* Seconds */ + long tv_nsec; /* Nanoseconds */ +}; + +struct itimerspec { + struct timespec it_interval; /* Interval for periodic timer */ + struct timespec it_value; /* Initial expiration */ +}; +.fi +.in +.PP +.I new_value.it_value +specifies the initial expiration of the timer, +in seconds and nanoseconds. +Setting either field of +.I new_value.it_value +to a nonzero value arms the timer. +Setting both fields of +.I new_value.it_value +to zero disarms the timer. + +Setting one or both fields of +.I new_value.it_interval +to nonzero values specifies the period, in seconds and nanoseconds, +for repeated timer expirations after the initial expiration. +If both fields of +.I new_value.it_interval +are zero, the timer expires just once, at the time specified by +.IR new_value.it_value . + +The +.I flags +argument is either 0, to start a relative timer +.RI ( new_value.it_interval +specifies a time relative to the current value of the clock specified by +.IR clockid ), +or +.BR TFD_TIMER_ABSTIME , +to start an absolute timer +.RI ( new_value.it_value +specifies an absolute time for the clock specified by +.IR clockid ; +that is, the timer will expire when the value of that +clock reaches the value specified in +.IR new_value.it_value ). + +The +.I old_value +argument returns a structure containing the setting of the timer that +was current at the time of the call; see the description of +.BR timerfd_gettime () +following. +.\" +.SS timerfd_gettime() +.BR timerfd_gettime () +returns, in +.IR curr_value , +an +.IR itimerspec +structure that contains the current setting of the timer +referred to by the file descriptor +.IR fd . + +The +.I it_value +field returns the amount of time +until the timer will next expire. +If both fields of this structure are zero, +then the timer is currently disarmed. +This field always contains a relative value, regardless of whether the +.BR TFD_TIMER_ABSTIME +flag was specified when setting the timer. + +The +.I it_interval +field returns the interval of the timer. +If both fields of this structure are zero, +then the timer is set to expire just once, at the time specified by +.IR curr_value.it_value . +.SS Operating on a timer file descriptor +The file descriptor returned by +.BR timerfd_create () +supports the following operations: +.TP +.BR read (2) +If the timer has already expired one or more times since +its settings were last modified using +.BR timerfd_settime (), +or since the last successful +.BR read (2), +then the buffer given to +.BR read (2) +returns an unsigned 8-byte integer +.RI ( uint64_t ) +containing the number of expirations that have occurred. +(The returned value is in host byte order, +i.e., the native byte order for integers on the host machine.) +.IP +If no timer expirations have occurred at the time of the +.BR read (2), +then the call either blocks until the next timer expiration, +or fails with the error +.B EAGAIN +if the file descriptor has been made nonblocking +(via the use of the +.BR fcntl (2) +.B F_SETFL +operation to set the +.B O_NONBLOCK +flag). +.IP +A +.BR read (2) +will fail with the error +.B EINVAL +if the size of the supplied buffer is less than 8 bytes. +.TP +.BR poll "(2), " select "(2) (and similar)" +The file descriptor is readable +(the +.BR select (2) +.I readfds +argument; the +.BR poll (2) +.B POLLIN +flag) +if one or more timer expirations have occurred. +.IP +The file descriptor also supports the other file-descriptor +multiplexing APIs: +.BR pselect (2), +.BR ppoll (2), +and +.BR epoll (7). +.TP +.BR close (2) +When the file descriptor is no longer required it should be closed. +When all file descriptors associated with the same timer object +have been closed, +the timer is disarmed and its resources are freed by the kernel. +.\" +.SS fork(2) semantics +After a +.BR fork (2), +the child inherits a copy of the file descriptor created by +.BR timerfd_create (). +The file descriptor refers to the same underlying +timer object as the corresponding file descriptor in the parent, +and +.BR read (2)s +in the child will return information about +expirations of the timer. +.\" +.SS execve(2) semantics +A file descriptor created by +.BR timerfd_create () +is preserved across +.BR execve (2), +and continues to generate timer expirations if the timer was armed. +.SH "RETURN VALUE" +On success, +.BR timerfd_create () +returns a new file descriptor. +On error, \-1 is returned and +.I errno +is set to indicate the error. + +.BR timerfd_settime () +and +.BR timerfd_gettime () +return 0 on success; +on error they return \-1, and set +.I errno +to indicate the error. +.SH ERRORS +.BR timerfd_create () +can fail with the following errors: +.TP +.B EINVAL +The +.I clockid +argument is neither +.B CLOCK_MONOTONIC +nor +.BR CLOCK_REALTIME ; +.TP +.B EINVAL +.I flags +is invalid; +or, in Linux 2.6.26 or earlier, +.I flags +is nonzero. +.TP +.B EMFILE +The per-process limit of open file descriptors has been reached. +.TP +.B ENFILE +The system-wide limit on the total number of open files has been +reached. +.TP +.B ENODEV +Could not mount (internal) anonymous inode device. +.TP +.B ENOMEM +There was insufficient kernel memory to create the timer. +.PP +.BR timerfd_settime () +and +.BR timerfd_gettime () +can fail with the following errors: +.TP +.B EBADF +.I fd +is not a valid file descriptor. +.TP +.B EFAULT +.IR new_value , +.IR old_value , +or +.I curr_value +is not valid a pointer. +.TP +.B EINVAL +.I fd +is not a valid timerfd file descriptor. +.PP +.BR timerfd_settime () +can also fail with the following errors: +.TP +.B EINVAL +.I new_value +is not properly initialized (one of the +.I tv_nsec +falls outside the range zero to 999,999,999). +.TP +.B EINVAL +.\" This case only checked since 2.6.29, and 2.2.2[78].some-stable-version. +.\" In older kernel versions, no check was made for invalid flags. +.I flags +is invalid. +.SH VERSIONS +These system calls are available on Linux since kernel 2.6.25. +Library support is provided by glibc since version 2.8. +.SH CONFORMING TO +These system calls are Linux-specific. +.SH EXAMPLE +The following program creates a timer and then monitors its progress. +The program accepts up to three command-line arguments. +The first argument specifies the number of seconds for +the initial expiration of the timer. +The second argument specifies the interval for the timer, in seconds. +The third argument specifies the number of times the program should +allow the timer to expire before terminating. +The second and third command-line arguments are optional. + +The following shell session demonstrates the use of the program: +.in +4n +.nf + +.RB "$" " a.out 3 1 100" +0.000: timer started +3.000: read: 1; total=1 +4.000: read: 1; total=2 +.BR "^Z " " # type control-Z to suspend the program" +[1]+ Stopped ./timerfd3_demo 3 1 100 +.RB "$ " "fg" " # Resume execution after a few seconds" +a.out 3 1 100 +9.660: read: 5; total=7 +10.000: read: 1; total=8 +11.000: read: 1; total=9 +.BR "^C " " # type control-C to suspend the program" +.fi +.in +.SS Program source +\& +.nf +.\" The commented out code here is what we currently need until +.\" the required stuff is in glibc +.\" +.\" +.\"/* Link with -lrt */ +.\"#define _GNU_SOURCE +.\"#include +.\"#include +.\"#include +.\"#if defined(__i386__) +.\"#define __NR_timerfd_create 322 +.\"#define __NR_timerfd_settime 325 +.\"#define __NR_timerfd_gettime 326 +.\"#endif +.\" +.\"static int +.\"timerfd_create(int clockid, int flags) +.\"{ +.\" return syscall(__NR_timerfd_create, clockid, flags); +.\"} +.\" +.\"static int +.\"timerfd_settime(int fd, int flags, struct itimerspec *new_value, +.\" struct itimerspec *curr_value) +.\"{ +.\" return syscall(__NR_timerfd_settime, fd, flags, new_value, +.\" curr_value); +.\"} +.\" +.\"static int +.\"timerfd_gettime(int fd, struct itimerspec *curr_value) +.\"{ +.\" return syscall(__NR_timerfd_gettime, fd, curr_value); +.\"} +.\" +.\"#define TFD_TIMER_ABSTIME (1 << 0) +.\" +.\"//////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include +#include /* Definition of uint64_t */ + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +static void +print_elapsed_time(void) +{ + static struct timespec start; + struct timespec curr; + static int first_call = 1; + int secs, nsecs; + + if (first_call) { + first_call = 0; + if (clock_gettime(CLOCK_MONOTONIC, &start) == \-1) + handle_error("clock_gettime"); + } + + if (clock_gettime(CLOCK_MONOTONIC, &curr) == \-1) + handle_error("clock_gettime"); + + secs = curr.tv_sec \- start.tv_sec; + nsecs = curr.tv_nsec \- start.tv_nsec; + if (nsecs < 0) { + secs\-\-; + nsecs += 1000000000; + } + printf("%d.%03d: ", secs, (nsecs + 500000) / 1000000); +} + +int +main(int argc, char *argv[]) +{ + struct itimerspec new_value; + int max_exp, fd; + struct timespec now; + uint64_t exp, tot_exp; + ssize_t s; + + if ((argc != 2) && (argc != 4)) { + fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\\n", + argv[0]); + exit(EXIT_FAILURE); + } + + if (clock_gettime(CLOCK_REALTIME, &now) == \-1) + handle_error("clock_gettime"); + + /* Create a CLOCK_REALTIME absolute timer with initial + expiration and interval as specified in command line */ + + new_value.it_value.tv_sec = now.tv_sec + atoi(argv[1]); + new_value.it_value.tv_nsec = now.tv_nsec; + if (argc == 2) { + new_value.it_interval.tv_sec = 0; + max_exp = 1; + } else { + new_value.it_interval.tv_sec = atoi(argv[2]); + max_exp = atoi(argv[3]); + } + new_value.it_interval.tv_nsec = 0; + + fd = timerfd_create(CLOCK_REALTIME, 0); + if (fd == \-1) + handle_error("timerfd_create"); + + if (timerfd_settime(fd, TFD_TIMER_ABSTIME, &new_value, NULL) == \-1) + handle_error("timerfd_settime"); + + print_elapsed_time(); + printf("timer started\\n"); + + for (tot_exp = 0; tot_exp < max_exp;) { + s = read(fd, &exp, sizeof(uint64_t)); + if (s != sizeof(uint64_t)) + handle_error("read"); + + tot_exp += exp; + print_elapsed_time(); + printf("read: %llu; total=%llu\\n", + (unsigned long long) exp, + (unsigned long long) tot_exp); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH BUGS +Currently, +.\" 2.6.29 +.BR timerfd_create () +supports fewer types of clock IDs than +.BR timer_create (2). +.SH "SEE ALSO" +.BR eventfd (2), +.BR poll (2), +.BR read (2), +.BR select (2), +.BR setitimer (2), +.BR signalfd (2), +.BR timer_create (2), +.BR timer_gettime (2), +.BR timer_settime (2), +.BR epoll (7), +.BR time (7) diff --git a/original/man2/timerfd_gettime.2 b/original/man2/timerfd_gettime.2 new file mode 100644 index 00000000..6d129404 --- /dev/null +++ b/original/man2/timerfd_gettime.2 @@ -0,0 +1 @@ +.so man2/timerfd_create.2 diff --git a/original/man2/timerfd_settime.2 b/original/man2/timerfd_settime.2 new file mode 100644 index 00000000..6d129404 --- /dev/null +++ b/original/man2/timerfd_settime.2 @@ -0,0 +1 @@ +.so man2/timerfd_create.2 diff --git a/original/man2/times.2 b/original/man2/times.2 new file mode 100644 index 00000000..9451ffd4 --- /dev/null +++ b/original/man2/times.2 @@ -0,0 +1,210 @@ +.\" 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 Sat Jul 24 14:29:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 961203 and 001211 and 010326 by aeb@cwi.nl +.\" Modified 001213 by Michael Haardt (michael@moria.de) +.\" Modified 13 Jun 02, Michael Kerrisk +.\" Added note on nonstandard behavior when SIGCHLD is ignored. +.\" Modified 2004-11-16, mtk, Noted that the nonconformance when +.\" SIGCHLD is being ignored is fixed in 2.6.9; other minor changes +.\" Modified 2004-12-08, mtk, in 2.6 times() return value changed +.\" 2005-04-13, mtk +.\" Added notes on nonstandard behavior: Linux allows 'buf' to +.\" be NULL, but POSIX.1 doesn't specify this and it's nonportable. +.\" +.TH TIMES 2 2008-06-25 "Linux" "Linux Programmer's Manual" +.SH NAME +times \- get process times +.SH SYNOPSIS +.B #include +.sp +.BI "clock_t times(struct tms *" buf ); +.SH DESCRIPTION +.BR times () +stores the current process times in the +.I "struct tms" +that +.I buf +points to. +The +.I struct tms +is as defined in +.IR : +.sp +.in +4n +.nf +struct tms { + clock_t tms_utime; /* user time */ + clock_t tms_stime; /* system time */ + clock_t tms_cutime; /* user time of children */ + clock_t tms_cstime; /* system time of children */ +}; +.fi +.in +.LP +The +.I tms_utime +field contains the CPU time spent executing instructions +of the calling process. +The +.I tms_stime +field contains the CPU time spent in the system while +executing tasks on behalf of the calling process. +The +.I tms_cutime +field contains the sum of the +.I tms_utime +and +.I tms_cutime +values for all waited-for terminated children. +The +.I tms_cstime +field contains the sum of the +.I tms_stime +and +.I tms_cstime +values for all waited-for terminated children. +.LP +Times for terminated children (and their descendants) +are added in at the moment +.BR wait (2) +or +.BR waitpid (2) +returns their process ID. +In particular, times of grandchildren +that the children did not wait for are never seen. +.LP +All times reported are in clock ticks. +.SH "RETURN VALUE" +.BR times () +returns the number of clock ticks that have elapsed since +an arbitrary point in the past. +The return value may overflow the possible range of type +.IR clock_t . +On error, \fI(clock_t)\ \-1\fP is returned, and +.I errno +is set appropriately. +.\" The only possible error is EFAULT. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH NOTES +The number of clock ticks per second can be obtained using: +.in +4n + +sysconf(_SC_CLK_TCK); +.in +.PP +In POSIX.1-1996 the symbol \fBCLK_TCK\fP (defined in +.IR ) +is mentioned as obsolescent. +It is obsolete now. +.PP +In Linux kernel versions before 2.6.9, +if the disposition of +.B SIGCHLD +is set to +.B SIG_IGN +then the times of terminated children +are automatically included in the +.I tms_cstime +and +.I tms_cutime +fields, although POSIX.1-2001 says that this should only happen +if the calling process +.BR wait (2)s +on its children. +This nonconformance is rectified in Linux 2.6.9 and later. +.\" 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. + +On Linux, the +.I buf +argument can be specified as NULL, with the result that +.BR times () +just returns a function result. +However, POSIX does not specify this behavior, and most +other Unix implementations require a non-NULL value for +.IR buf . +.LP +Note that +.BR clock (3) +also returns a value of type +.IR clock_t , +but this value is measured in units of +.BR CLOCKS_PER_SEC , +not the clock ticks used by +.BR times (). + +On Linux, the "arbitrary point in the past" from which the return value of +.BR times () +is measured has varied across kernel versions. +On Linux 2.4 and earlier this point is the moment the system was booted. +Since Linux 2.6, this point is \fI(2^32/HZ) \- 300\fP +(i.e., about 429 million) seconds before system boot time. +This variability across kernel versions (and across Unix implementations), +combined with the fact that the returned value may overflow the range of +.IR clock_t , +means that a portable application would be wise to avoid using this value. +To measure changes in elapsed time, use +.BR gettimeofday (2) +instead. +.\" .PP +.\" On older systems the number of clock ticks per second is given +.\" by the variable HZ. +.SS "Historical" +SVr1-3 returns +.I long +and the struct members are of type +.I time_t +although they store clock ticks, not seconds since the Epoch. +V7 used +.I long +for the struct members, because it had no type +.I time_t +yet. +.SH BUGS +A limitation of the Linux system call conventions on some architectures +(notably i386) means that on Linux 2.6 there is a small time window +(41 seconds) soon after boot when +.BR times () +can return \-1, falsely indicating that an error occurred. +The same problem can occur when the return value wraps passed +the maximum value that can be stored in +.BR 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 +.SH "SEE ALSO" +.BR time (1), +.BR getrusage (2), +.BR wait (2), +.BR clock (3), +.BR sysconf (3), +.BR time (7) diff --git a/original/man2/tkill.2 b/original/man2/tkill.2 new file mode 100644 index 00000000..a9a2c3a4 --- /dev/null +++ b/original/man2/tkill.2 @@ -0,0 +1,108 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2008 Michael Kerrisk +.\" and 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. +.\" +.\" 2004-05-31, added tgkill, ahu, aeb +.\" 2008-01-15 mtk -- rewote DESCRIPTION +.\" +.TH TKILL 2 2008-10-01 "Linux" "Linux Programmer's Manual" +.SH NAME +tkill, tgkill \- send a signal to a thread +.SH SYNOPSIS +.nf +.BI "int tkill(int " tid ", int " sig ); +.sp +.BI "int tgkill(int " tgid ", int " tid ", int " sig ); +.fi +.SH DESCRIPTION +.BR tgkill () +sends the signal +.I sig +to the thread with the thread ID +.I tid +in the thread group +.IR tgid . +(By contrast, +.BR kill (2) +can only be used to send a signal to a process (i.e., thread group) +as a whole, and the signal will be delivered to an arbitrary +thread within that process.) + +.BR tkill () +is an obsolete predecessor to +.BR tgkill (). +It only allows the target thread ID to be specified, +which may result in the wrong thread being signaled if a thread +terminates and its thread ID is recycled. +Avoid using this system call. + +If +.I tgid +is specified as \-1, +.BR tgkill () +is equivalent to +.BR tkill (). + +These are the raw system call interfaces, meant for internal +thread library use. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and \fIerrno\fP +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +An invalid thread ID, thread group ID, or signal was specified. +.TP +.B EPERM +Permission denied. +For the required permissions, see +.BR kill (2). +.TP +.B ESRCH +No process with the specified thread ID (and thread group ID) exists. +.SH VERSIONS +.BR tkill () +is supported since Linux 2.4.19 / 2.5.4. +.BR tgkill () +was added in Linux 2.5.75. +.SH "CONFORMING TO" +.BR tkill () +and +.BR tgkill () +are Linux-specific and should not be used +in programs that are intended to be portable. +.SH NOTES +See the description of +.B CLONE_THREAD +in +.BR clone (2) +for an explanation of thread groups. + +Glibc does not provide wrappers for these system calls; call them using +.BR syscall (2). +.SH "SEE ALSO" +.BR clone (2), +.BR gettid (2), +.BR kill (2) diff --git a/original/man2/truncate.2 b/original/man2/truncate.2 new file mode 100644 index 00000000..bb261fae --- /dev/null +++ b/original/man2/truncate.2 @@ -0,0 +1,221 @@ +.\" 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 +.\" +.TH TRUNCATE 2 2009-02-28 "Linux" "Linux Programmer's Manual" +.SH NAME +truncate, ftruncate \- truncate a file to a specified length +.SH SYNOPSIS +.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 +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.ad l +.sp +.BR truncate (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR ftruncate (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _POSIX_C_SOURCE\ >=\ 200112L +.ad b +.SH DESCRIPTION +The +.BR truncate () +and +.BR ftruncate () +functions cause the regular file named by +.I path +or referenced by +.I fd +to be truncated to a size of precisely +.I length +bytes. +.LP +If the file previously was larger than this size, the extra data is lost. +If the file previously was shorter, it is extended, and +the extended part reads as null bytes (\(aq\\0\(aq). +.LP +The file offset is not changed. +.LP +If the size changed, then the st_ctime and st_mtime fields +(respectively, time of last status change and +time of last modification; see +.BR stat (2)) +for the file are updated, +and the set-user-ID and set-group-ID permission bits may be cleared. +.LP +With +.BR ftruncate (), +the file must be open for writing; with +.BR truncate (), +the file must be writable. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +For +.BR truncate (): +.TP +.B EACCES +Search permission is denied for a component of the path prefix, +or the named file is not writable by the user. +(See also +.BR path_resolution (7).) +.TP +.B EFAULT +.I Path +points outside the process's allocated address space. +.TP +.B EFBIG +The argument +.I length +is larger than the maximum file size. (XSI) +.TP +.B EINTR +A signal was caught during execution. +.TP +.B EINVAL +The argument +.I length +is negative or larger than the maximum file size. +.TP +.B EIO +An I/O error occurred updating the inode. +.TP +.B EINTR +While blocked waiting to complete, +the call was interrupted by a signal handler; see +.BR fcntl (2) +and +.BR signal (7). +.TP +.B EISDIR +The named file is a directory. +.TP +.B ELOOP +Too many symbolic links were encountered in translating the pathname. +.TP +.B ENAMETOOLONG +A component of a pathname exceeded 255 characters, +or an entire pathname exceeded 1023 characters. +.TP +.B ENOENT +The named file does not exist. +.TP +.B ENOTDIR +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 +The underlying file system does not support extending +a file beyond its current size. +.TP +.B EROFS +The named file resides on a read-only file system. +.TP +.B ETXTBSY +The file is a pure procedure (shared text) file that is being executed. +.PP +For +.BR ftruncate () +the same errors apply, but instead of things that can be wrong with +.IR path , +we now have things that can be wrong with the file descriptor, +.IR fd : +.TP +.B EBADF +.I fd +is not a valid descriptor. +.TP +.BR EBADF " or " EINVAL +.I fd +is not open for writing. +.TP +.B EINVAL +.I fd +does not reference a regular file. +.SH "CONFORMING TO" +4.4BSD, SVr4, POSIX.1-2001 (these calls first appeared in 4.2BSD). +.\" POSIX.1-1996 has +.\" .BR ftruncate (). +.\" POSIX.1-2001 also has +.\" .BR truncate (), +.\" as an XSI extension. +.\" .LP +.\" SVr4 documents additional +.\" .BR truncate () +.\" error conditions EMFILE, EMULTIHP, ENFILE, ENOLINK. SVr4 documents for +.\" .BR ftruncate () +.\" an additional EAGAIN error condition. +.SH NOTES +The above description is for XSI-compliant systems. +For non-XSI-compliant systems, the POSIX standard allows +two behaviors for +.BR ftruncate () +when +.I length +exceeds the file length +(note that +.BR truncate () +is not specified at all in such an environment): +either returning an error, or extending the file. +Like most Unix implementations, Linux follows the XSI requirement +when dealing with native file systems. +However, some nonnative file systems do not permit +.BR truncate () +and +.BR ftruncate () +to be used to extend a file beyond its current length: +a notable example on Linux is VFAT. +.\" At the very least: OSF/1, Solaris 7, and FreeBSD conform, mtk, Jan 2002 +.SH "SEE ALSO" +.BR open (2), +.BR stat (2), +.BR path_resolution (7) diff --git a/original/man2/truncate64.2 b/original/man2/truncate64.2 new file mode 100644 index 00000000..2ed34f1e --- /dev/null +++ b/original/man2/truncate64.2 @@ -0,0 +1 @@ +.so man2/truncate.2 diff --git a/original/man2/tuxcall.2 b/original/man2/tuxcall.2 new file mode 100644 index 00000000..5d25ea6c --- /dev/null +++ b/original/man2/tuxcall.2 @@ -0,0 +1 @@ +.so man2/unimplemented.2 diff --git a/original/man2/ugetrlimit.2 b/original/man2/ugetrlimit.2 new file mode 100644 index 00000000..df6d7362 --- /dev/null +++ b/original/man2/ugetrlimit.2 @@ -0,0 +1 @@ +.so man2/getrlimit.2 diff --git a/original/man2/umask.2 b/original/man2/umask.2 new file mode 100644 index 00000000..f36a8899 --- /dev/null +++ b/original/man2/umask.2 @@ -0,0 +1,121 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 2006, 2008, Michael Kerrisk (mtk.manpages@gmail.com) +.\" (A few fragments remain from an earlier (1992) version written in +.\" 1992 by Drew Eckhardt .) +.\" +.\" 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 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 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. +.TH UMASK 2 2008-01-09 "Linux" "Linux Programmer's Manual" +.SH NAME +umask \- set file mode creation mask +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "mode_t umask(mode_t " mask ); +.SH DESCRIPTION +.BR umask () +sets the calling process's file mode creation mask (umask) to +.I mask +& 0777 (i.e., only the file permission bits of +.I mask +are used), and returns the previous value of the mask. + +The umask is used by +.BR open (2), +.BR mkdir (2), +and other system calls that create files +.\" e.g., mkfifo(), creat(), mknod(), sem_open(), mq_open(), shm_open() +.\" but NOT the System V IPC *get() calls +to modify the permissions placed on newly created files or directories. +Specifically, permissions in the umask are turned off from +the \fImode\fP argument to +.BR open (2) +and +.BR mkdir (2). + +The constants that should be used to specify +.I mask +are described under +.BR stat (2). + +The typical default value for the process umask is +.I S_IWGRP\ |\ S_IWOTH +(octal 022). +In the usual case where the +.I mode +argument to +.BR open (2) +is specified as: +.nf + + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH + +.fi +(octal 0666) when creating a new file, the permissions on the +resulting file will be: +.nf + + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH + +.fi +(because 0666 & ~022 = 0644; i.e., rw\-r\-\-r\-\-). +.SH "RETURN VALUE" +This system call always succeeds and the previous value of the mask +is returned. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH NOTES +A child process created via +.BR fork (2) +inherits its parent's umask. +The umask is left unchanged by +.BR execve (2). + +The umask setting also affects the permissions assigned to POSIX IPC objects +.RB ( mq_open (3), +.BR sem_open (3), +.BR shm_open (3)), +FIFOs +.RB ( mkfifo (3)), +and Unix domain sockets +.RB ( unix (7)) +created by the process. +The umask does not affect the permissions assigned +to System V IPC objects created by the process (using +.BR msgget (2), +.BR semget (2), +.BR shmget (2)). +.SH "SEE ALSO" +.BR chmod (2), +.BR mkdir (2), +.BR open (2), +.BR stat (2) +.\" FIXME . eventually: .BR acl (5) diff --git a/original/man2/umount.2 b/original/man2/umount.2 new file mode 100644 index 00000000..00c40195 --- /dev/null +++ b/original/man2/umount.2 @@ -0,0 +1,166 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1993 Rickard E. Faith +.\" and Copyright (C) 1994 Andries E. Brouwer +.\" and Copyright (C) 2002, 2005 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. +.\" +.\" 2008-10-06, mtk: Created this as a new page by splitting +.\" umount/umount2 material out of mount.2 +.\" +.TH UMOUNT 2 2009-09-03 "Linux" "Linux Programmer's Manual" +.SH NAME +umount, umount2 \- unmount file system +.SH SYNOPSIS +.nf +.B "#include " +.sp +.BI "int umount(const char *" target ); +.sp +.BI "int umount2(const char *" target ", int " flags ); +.fi +.SH DESCRIPTION +.BR umount () +and +.BR umount2 () +remove the attachment of the (topmost) file system mounted on +.IR target . +.\" Note: the kernel naming differs from the glibc naming +.\" umount2 is the glibc name for what the kernel now calls umount +.\" and umount is the glibc name for oldumount + +Appropriate privilege (Linux: the +.B CAP_SYS_ADMIN +capability) is required to unmount file systems. + +Linux 2.1.116 added the +.BR umount2 () +system call, which, like +.BR umount (), +unmounts a target, but allows additional +.I flags +controlling the behavior of the operation: +.TP +.BR MNT_FORCE " (since Linux 2.1.116)" +Force unmount even if busy. +This can cause data loss. +(Only for NFS mounts.) +.TP +.BR MNT_DETACH " (since Linux 2.4.11)" +Perform a lazy unmount: make the mount point unavailable for +new accesses, and actually perform the unmount when the mount point +ceases to be busy. +.TP +.BR MNT_EXPIRE " (since Linux 2.6.8)" +Mark the mount point as expired. +If a mount point is not currently in use, then an initial call to +.BR umount2 () +with this flag fails with the error +.BR EAGAIN , +but marks the mount point as expired. +The mount point remains expired as long as it isn't accessed +by any process. +A second +.BR umount2 () +call specifying +.B MNT_EXPIRE +unmounts an expired mount point. +This flag cannot be specified with either +.B MNT_FORCE +or +.BR MNT_DETACH . +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +The error values given below result from filesystem type independent +errors. +Each filesystem type may have its own special errors and its +own special behavior. +See the kernel source code for details. +.TP +.B EAGAIN +A call to +.BR umount2 () +specifying +.B MNT_EXPIRE +successfully marked an unbusy file system as expired. +.TP +.B EBUSY +.I target +could not be unmounted because it is busy. +.TP +.B EFAULT +.I target +points outside the user address space. +.TP +.B EINVAL +.I target +is not a mount point. +Or, +.BR umount2 () +was called with +.B MNT_EXPIRE +and either +.B MNT_DETACH +or +.BR MNT_FORCE . +.TP +.B ENAMETOOLONG +A pathname was longer than +.BR MAXPATHLEN . +.TP +.B ENOENT +A pathname was empty or had a nonexistent component. +.TP +.B ENOMEM +The kernel could not allocate a free page to copy filenames or data into. +.TP +.B EPERM +The caller does not have the required privileges. +.SH VERSIONS +.BR MNT_DETACH +and +.BR MNT_EXPIRE +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=10092 +are only available in glibc since version 2.11. +.SH "CONFORMING TO" +These functions are Linux-specific and should not be used in +programs intended to be portable. +.SH NOTES +The original +.BR umount () +function was called as \fIumount(device)\fP and would return +.B ENOTBLK +when called with something other than a block device. +In Linux 0.98p4 a call \fIumount(dir)\fP was added, in order to +support anonymous devices. +In Linux 2.3.99-pre7 the call \fIumount(device)\fP was removed, +leaving only \fIumount(dir)\fP (since now devices can be mounted +in more than one place, so specifying the device does not suffice). +.SH "SEE ALSO" +.BR mount (2), +.BR path_resolution (7), +.BR mount (8), +.BR umount (8) diff --git a/original/man2/umount2.2 b/original/man2/umount2.2 new file mode 100644 index 00000000..84ea4190 --- /dev/null +++ b/original/man2/umount2.2 @@ -0,0 +1 @@ +.so man2/umount.2 diff --git a/original/man2/uname.2 b/original/man2/uname.2 new file mode 100644 index 00000000..c1621796 --- /dev/null +++ b/original/man2/uname.2 @@ -0,0 +1,158 @@ +.\" 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. +.\" +.\" 2007-07-05 mtk: Added details on underlying system call interfaces +.\" +.TH UNAME 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH NAME +uname \- get name and information about current kernel +.SH SYNOPSIS +.B #include +.sp +.BI "int uname(struct utsname *" buf ); +.SH DESCRIPTION +.BR uname () +returns system information in the structure pointed to by +.IR buf . +The +.I utsname +struct is defined in +.IR : +.in +4n +.nf + +struct utsname { + char sysname[]; /* Operating system name (e.g., "Linux") */ + char nodename[]; /* Name within "some implementation-defined + network" */ + char release[]; /* OS release (e.g., "2.6.28") */ + char version[]; /* OS version */ + char machine[]; /* Hardware identifier */ +#ifdef _GNU_SOURCE + char domainname[]; /* NIS or YP domain name */ +#endif +}; + +.fi +.in +The length of the arrays in a +.I struct utsname +is unspecified (see NOTES); +the fields are terminated by a null byte (\(aq\\0\(aq). +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +.I buf +is not valid. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +There is no +.BR uname () +call in 4.3BSD. +.PP +The +.I domainname +member (the NIS or YP domain name) is a GNU extension. +.SH NOTES +This is a system call, and the operating system presumably knows +its name, release and version. +It also knows what hardware it runs on. +So, four of the fields of the struct are meaningful. +On the other hand, the field \fInodename\fP is meaningless: +it gives the name of the present machine in some undefined +network, but typically machines are in more than one network +and have several names. +Moreover, the kernel has no way of knowing +about such things, so it has to be told what to answer here. +The same holds for the additional \fIdomainname\fP field. +.LP +To this end Linux uses the system calls +.BR sethostname (2) +and +.BR setdomainname (2). +Note that there is no standard that says that the hostname set by +.BR sethostname (2) +is the same string as the \fInodename\fP field of the struct returned by +.BR uname () +(indeed, some systems allow a 256-byte hostname and an 8-byte nodename), +but this is true on Linux. +The same holds for +.BR setdomainname (2) +and the \fIdomainname\fP field. +.LP +The length of the fields in the struct varies. +Some operating systems +or libraries use a hardcoded 9 or 33 or 65 or 257. +Other systems use +.B SYS_NMLN +or +.B _SYS_NMLN +or +.B UTSLEN +or +.BR _UTSNAME_LENGTH . +Clearly, it is a bad +idea to use any of these constants; just use sizeof(...). +Often 257 is chosen in order to have room for an internet hostname. +.LP +Part of the utsname information is also accessible via +.IR /proc/sys/kernel/ { ostype , +.IR hostname , +.IR osrelease , +.IR version , +.IR domainname }. +.SS Underlying kernel interface +.LP +Over time, increases in the size of the +.I utsname +structure have led to three successive versions of +.BR uname (): +.IR sys_olduname () +(slot +.IR __NR_oldolduname ), +.IR sys_uname () +(slot +.IR __NR_olduname ), +and +.IR sys_newuname () +(slot +.IR __NR_uname) . +The first one +.\" That was back before Linux 1.0 +used length 9 for all fields; +the second +.\" That was also back before Linux 1.0 +used 65; +the third also uses 65 but adds the \fIdomainname\fP field. +The glibc +.BR uname () +wrapper function hides these details from applications, +invoking the most recent version of the system call provided by the kernel. +.SH "SEE ALSO" +.BR uname (1), +.BR getdomainname (2), +.BR gethostname (2) diff --git a/original/man2/unimplemented.2 b/original/man2/unimplemented.2 new file mode 100644 index 00000000..ec4c1a6b --- /dev/null +++ b/original/man2/unimplemented.2 @@ -0,0 +1,65 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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. +.\" +.\" Updated, aeb, 980612 +.\" +.TH UNIMPLEMENTED 2 2007-07-05 "Linux" "Linux Programmer's Manual" +.SH NAME +afs_syscall, break, ftime, getpmsg, gtty, lock, madvise1, mpx, prof, profil, +putpmsg, security, stty, tuxcall, ulimit, vserver \- unimplemented system calls +.SH SYNOPSIS +Unimplemented system calls. +.SH DESCRIPTION +These system calls are not implemented in the Linux 2.6.22 kernel. +.SH "RETURN VALUE" +These system calls always return \-1 and set +.I errno +to +.BR ENOSYS . +.SH NOTES +Note that +.BR ftime (3), +.BR profil (3) +and +.BR ulimit (3) +are implemented as library functions. + +Some system calls, like +.BR alloc_hugepages (2), +.BR free_hugepages (2), +.BR ioperm (2), +.BR iopl (2), +and +.BR vm86 (2) +only exist on certain architectures. + +Some system calls, like +.BR ipc (2), +.BR create_module (2), +.BR init_module (2), +and +.BR delete_module (2) +only exist when the Linux kernel was built with support for them. +.SH "SEE ALSO" +.BR syscalls (2) diff --git a/original/man2/unlink.2 b/original/man2/unlink.2 new file mode 100644 index 00000000..a700ebf4 --- /dev/null +++ b/original/man2/unlink.2 @@ -0,0 +1,157 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Ian Jackson. +.\" +.\" 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 1996-09-08 by Arnt Gulbrandsen +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2001-05-17 by aeb +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.TH UNLINK 2 2004-06-23 "Linux" "Linux Programmer's Manual" +.SH NAME +unlink \- delete a name and possibly the file it refers to +.SH SYNOPSIS +.B #include +.sp +.BI "int unlink(const char *" pathname ); +.SH DESCRIPTION +.BR unlink () +deletes a name from the file system. +If that name was the +last link to a file and no processes have the file open the file is +deleted and the space it was using is made available for reuse. + +If the name was the last link to a file but any processes still have +the file open the file will remain in existence until the last file +descriptor referring to it is closed. + +If the name referred to a symbolic link the link is removed. + +If the name referred to a socket, fifo or device the name for it is +removed but processes which have the object open may continue to use +it. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +Write access to the directory containing +.I pathname +is not allowed for the process's effective UID, or one of the +directories in +.I pathname +did not allow search permission. +(See also +.BR path_resolution (7).) +.TP +.BR EBUSY " (not on Linux)" +The file +.I pathname +cannot be unlinked because it is being used by the system +or another process and the implementation considers this an error. +.TP +.B EFAULT +.I pathname +points outside your accessible address space. +.TP +.B EIO +An I/O error occurred. +.TP +.B EISDIR +.I pathname +refers to a directory. +(This is the non-POSIX value returned by Linux since 2.1.132.) +.TP +.B ELOOP +Too many symbolic links were encountered in translating +.IR pathname . +.TP +.B ENAMETOOLONG +.IR pathname " was too long." +.TP +.B ENOENT +A component in +.I pathname +does not exist or is a dangling symbolic link, or +.I pathname +is empty. +.TP +.B ENOMEM +Insufficient kernel memory was available. +.TP +.B ENOTDIR +A component used as a directory in +.I pathname +is not, in fact, a directory. +.TP +.B EPERM +The system does not allow unlinking of directories, +or unlinking of directories requires privileges that the +calling process doesn't have. +(This is the POSIX prescribed error return; +as noted above, Linux returns +.B EISDIR +for this case.) +.TP +.BR EPERM " (Linux only)" +The file system does not allow unlinking of files. +.TP +.BR EPERM " or " EACCES +The directory containing +.I pathname +has the sticky bit +.RB ( S_ISVTX ) +set and the process's effective UID is neither the UID of the file to +be deleted nor that of the directory containing it, and +the process is not privileged (Linux: does not have the +.B CAP_FOWNER +capability). +.TP +.B EROFS +.I pathname +refers to a file on a read-only file system. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.\" SVr4 documents additional error +.\" conditions EINTR, EMULTIHOP, ETXTBSY, ENOLINK. +.SH BUGS +Infelicities in the protocol underlying NFS can cause the unexpected +disappearance of files which are still being used. +.SH "SEE ALSO" +.BR rm (1), +.BR chmod (2), +.BR link (2), +.BR mknod (2), +.BR open (2), +.BR rename (2), +.BR rmdir (2), +.BR unlinkat (2), +.BR mkfifo (3), +.BR remove (3), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/unlinkat.2 b/original/man2/unlinkat.2 new file mode 100644 index 00000000..86bbe04e --- /dev/null +++ b/original/man2/unlinkat.2 @@ -0,0 +1,158 @@ +.\" 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. +.\" +.\" +.TH UNLINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +unlinkat \- remove a directory entry relative to a directory file descriptor +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int unlinkat(int " dirfd ", const char *" pathname ", int " flags ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR unlinkat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +The +.BR unlinkat () +system call operates in exactly the same way as either +.BR unlink (2) +or +.BR rmdir (2) +(depending on whether or not +.I flags +includes the +.B AT_REMOVEDIR +flag) +except for the differences described in this manual page. + +If the pathname given in +.I pathname +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I dirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR unlink (2) +and +.BR rmdir (2) +for a relative pathname). + +If the pathname given in +.I pathname +is relative and +.I dirfd +is the special value +.BR AT_FDCWD , +then +.I pathname +is interpreted relative to the current working +directory of the calling process (like +.BR unlink (2) +and +.BR rmdir (2)). + +If the pathname given in +.I pathname +is absolute, then +.I dirfd +is ignored. + +.I flags +is a bit mask that can either be specified as 0, or by ORing +together flag values that control the operation of +.BR unlinkat (). +Currently only one such flags is defined: +.TP +.B AT_REMOVEDIR +By default, +.BR unlinkat () +performs the equivalent of +.BR unlink (2) +on +.IR pathname . +If the +.B AT_REMOVEDIR +flag is specified, then +performs the equivalent of +.BR rmdir (2) +on +.IR pathname . +.SH "RETURN VALUE" +On success, +.BR unlinkat () +returns 0. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR unlink (2) +and +.BR rmdir (2) +can also occur for +.BR unlinkat (). +The following additional errors can occur for +.BR unlinkat (): +.TP +.B EBADF +.I dirfd +is not a valid file descriptor. +.TP +.B EINVAL +An invalid flag value was specified in +.IR flags . +.TP +.B ENOTDIR +.I pathname +is relative and +.I dirfd +is a file descriptor referring to a file other than a directory. +.SH VERSIONS +.BR unlinkat () +was added to Linux in kernel 2.6.16. +.SH "CONFORMING TO" +POSIX.1-2008. +A similar system call exists on Solaris. +.SH NOTES +See +.BR openat (2) +for an explanation of the need for +.BR unlinkat (). +.SH "SEE ALSO" +.BR openat (2), +.BR rmdir (2), +.BR unlink (2), +.BR path_resolution (7) diff --git a/original/man2/unshare.2 b/original/man2/unshare.2 new file mode 100644 index 00000000..bd411376 --- /dev/null +++ b/original/man2/unshare.2 @@ -0,0 +1,195 @@ +.\" 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 +.\" +.TH UNSHARE 2 2008-11-20 "Linux" "Linux Programmer's Manual" +.SH NAME +unshare \- disassociate parts of the process execution context +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.\" 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 +.SH DESCRIPTION +.BR unshare () +allows a process to disassociate parts of its execution +context that are currently being shared with other processes. +Part of the execution context, such as the mount namespace, is shared +implicitly when a new process is created using +.BR fork (2) +or +.BR vfork (2), +while other parts, such as virtual memory, may be +shared by explicit request when creating a process using +.BR clone (2). + +The main use of +.BR unshare () +is to allow a process to control its +shared execution context without creating a new process. + +The +.I flags +argument is a bit mask that specifies which parts of +the execution context should be unshared. +This argument is specified by ORing together zero or more +of the following constants: +.TP +.B CLONE_FILES +Reverse the effect of the +.BR clone (2) +.B CLONE_FILES +flag. +Unshare the file descriptor table, so that the calling process +no longer shares its file descriptors with any other process. +.TP +.B CLONE_FS +Reverse the effect of the +.BR clone (2) +.B CLONE_FS +flag. +Unshare file system attributes, so that the calling process +no longer shares its root directory, current directory, +or umask attributes with any other process. +.BR chroot (2), +.BR chdir (2), +or +.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. +This flag has the +.I same +effect as the +.BR clone (2) +.B CLONE_NEWNS +flag. +Unshare the mount namespace, +so that the calling process has a private copy of +its namespace which is not shared with any other process. +Specifying this flag automatically implies +.B CLONE_FS +as well. +.\" 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 +If +.I flags +is specified as zero, then +.BR unshare () +is a no-op; +no changes are made to the calling process's execution context. +.SH RETURN VALUE +On success, zero returned. +On failure, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +An invalid bit was specified in +.IR flags . +.TP +.B ENOMEM +Cannot allocate sufficient memory to copy parts of caller's +context that need to be unshared. +.TP +.B EPERM +.I flags +specified +.B CLONE_NEWNS +but the calling process was not privileged (did not have the +.B CAP_SYS_ADMIN +capability). +.SH VERSIONS +The +.BR unshare () +system call was added to Linux in kernel 2.6.16. +.SH CONFORMING TO +The +.BR unshare () +system call is Linux-specific. +.SH NOTES +Not all of the process attributes that can be shared when +a new process is created using +.BR clone (2) +can be unshared using +.BR unshare (). +In particular, as at kernel 2.6.16, +.BR unshare () +does not implement flags that reverse the effects of +.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 , +or +.\" FIXME . check future kernel versions (e.g., 2.6.17) +.\" to see if CLONE_VM gets implemented. +.BR 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 +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. +.\" +.SH SEE ALSO +.BR clone (2), +.BR fork (2), +.BR vfork (2), +Documentation/unshare.txt diff --git a/original/man2/uselib.2 b/original/man2/uselib.2 new file mode 100644 index 00000000..6d471818 --- /dev/null +++ b/original/man2/uselib.2 @@ -0,0 +1,111 @@ +.\" 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 1996-10-22 by Eric S. Raymond +.\" Modified 2004-06-23 by Michael Kerrisk +.\" Modified 2005-01-09 by aeb +.\" +.TH USELIB 2 2005-01-09 "Linux" "Linux Programmer's Manual" +.SH NAME +uselib \- load shared library +.SH SYNOPSIS +.B #include +.sp +.BI "int uselib(const char *" library ); +.SH DESCRIPTION +The system call +.BR uselib () +serves to load +a shared library to be used by the calling process. +It is given a pathname. +The address where to load is found +in the library itself. +The library can have any recognized +binary format. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +In addition to all of the error codes returned by +.BR open (2) +and +.BR mmap (2), +the following may also be returned: +.TP +.B EACCES +The library specified by +.I library +does not have read or execute permission, or the caller does not have +search permission for one of the directories in the path prefix. +(See also +.BR path_resolution (7).) +.TP +.B ENFILE +The system limit on the total number of open files has been reached. +.TP +.B ENOEXEC +The file specified by +.I library +is not an executable of known type, +e.g., does not have the correct magic numbers. +.SH "CONFORMING TO" +.BR uselib () +is Linux-specific, and should not be used in programs +intended to be portable. +.SH NOTES +.BR uselib () +was used by early libc startup code to load +the shared libraries with names found in an array of names +in the binary. +.LP +.\" libc 4.3.1f - changelog 1993-03-02 +Since libc 4.3.2, startup code tries to prefix these names +with "/usr/lib", "/lib" and "" before giving up. +.\" libc 4.3.4 - changelog 1993-04-21 +In libc 4.3.4 and later these names are looked for in the directories +found in +.BR LD_LIBRARY_PATH , +and if not found there, +prefixes "/usr/lib", "/lib" and "/" are tried. +.LP +From libc 4.4.4 on only the library "/lib/ld.so" is loaded, +so that this dynamic library can load the remaining libraries needed +(again using this call). +This is also the state of affairs in libc5. +.LP +glibc2 does not use this call. +.SH "SEE ALSO" +.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) diff --git a/original/man2/ustat.2 b/original/man2/ustat.2 new file mode 100644 index 00000000..35288265 --- /dev/null +++ b/original/man2/ustat.2 @@ -0,0 +1,116 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created 1995-08-09 Thomas K. Dyas +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2001-03-22 by aeb +.\" Modified 2003-08-04 by aeb +.\" +.TH USTAT 2 2003-08-04 "Linux" "Linux Programmer's Manual" +.SH NAME +ustat \- get file system statistics +.SH SYNOPSIS +.nf +.B #include +.br +.BR "#include " " /* libc[45] */" +.br +.BR "#include " " /* glibc2 */" +.sp +.BI "int ustat(dev_t " dev ", struct ustat *" ubuf ); +.fi +.SH DESCRIPTION +.BR ustat () +returns information about a mounted file system. +.I dev +is a device number identifying a device containing +a mounted file system. +.I ubuf +is a pointer to a \fIustat\fP structure that contains the following +members: +.in +4n +.nf + +daddr_t f_tfree; /* Total free blocks */ +ino_t f_tinode; /* Number of free inodes */ +char f_fname[6]; /* Filsys name */ +char f_fpack[6]; /* Filsys pack name */ +.fi +.in +.PP +The last two fields, +.I f_fname +and +.IR f_fpack , +are not implemented and will +always be filled with null bytes (\(aq\\0\(aq). +.SH "RETURN VALUE" +On success, zero is returned and the +.I ustat +structure pointed to by +.I ubuf +will be filled in. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +.I ubuf +points outside of your accessible address space. +.TP +.B EINVAL +.I dev +does not refer to a device containing a mounted file system. +.TP +.B ENOSYS +The mounted file system referenced by +.I dev +does not support this operation, or any version of Linux before +1.3.16. +.SH "CONFORMING TO" +SVr4. +.\" SVr4 documents additional error conditions ENOLINK, ECOMM, and EINTR +.\" but has no ENOSYS condition. +.SH NOTES +.BR ustat () +is deprecated and has only been provided for compatibility. +All new programs should use +.BR statfs (2) +instead. +.SS "HP-UX Notes" +The HP-UX version of the +.I ustat +structure has an additional field, +.IR f_blksize , +that is unknown elsewhere. +HP-UX warns: +For some file systems, the number of free inodes does not change. +Such file systems will return \-1 in the field +.IR f_tinode . +.\" Some software tries to use this in order to test whether the +.\" underlying file system is NFS. +For some file systems, inodes are dynamically allocated. +Such file systems will return the current number of free inodes. +.SH "SEE ALSO" +.BR stat (2), +.BR statfs (2) diff --git a/original/man2/utime.2 b/original/man2/utime.2 new file mode 100644 index 00000000..c36790c1 --- /dev/null +++ b/original/man2/utime.2 @@ -0,0 +1,187 @@ +.\" 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-06-10 by Andries Brouwer +.\" Modified 2004-06-23 by Michael Kerrisk +.\" Modified 2004-10-10 by Andries Brouwer +.\" +.TH UTIME 2 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH NAME +utime, utimes \- change file last access and modification times +.SH SYNOPSIS +.nf +.B #include +.br +.B #include +.sp +.BI "int utime(const char *" filename ", const struct utimbuf *" times ); +.sp +.B #include +.sp +.BI "int utimes(const char *" filename ", const struct timeval " times [2]); +.fi +.SH DESCRIPTION +The +.BR utime () +system call +changes the access and modification times of the inode specified by +.I filename +to the +.IR actime " and " modtime +fields of +.I times +respectively. + +If +.I times +is NULL, then the access and modification times of the file are set +to the current time. + +Changing timestamps is permitted when: either +the process has appropriate privileges, +or the effective user ID equals the user ID +of the file, or +.I times +is NULL and the process has write permission for the file. + +The +.I utimbuf +structure is: + +.in +4n +.nf +struct utimbuf { + time_t actime; /* access time */ + time_t modtime; /* modification time */ +}; +.fi +.in + +The +.BR utime () +system call +allows specification of timestamps with a resolution of 1 second. + +The +.BR utimes () +system call +is similar, but the +.I times +argument refers to an array rather than a structure. +The elements of this array are +.I timeval +structures, which allow a precision of 1 microsecond for specifying timestamps. +The +.I timeval +structure is: + +.in +4n +.nf +struct timeval { + long tv_sec; /* seconds */ + long tv_usec; /* microseconds */ +}; +.fi +.in +.PP +.IR times [0] +specifies the new access time, and +.IR times [1] +specifies the new modification time. +If +.I times +is NULL, then analogously to +.BR utime (), +the access and modification times of the file are +set to the current time. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +Search permission is denied for one of the directories in +the path prefix of +.I path +(see also +.BR path_resolution (7)). +.TP +.B EACCES +.I times +is NULL, +the caller's effective user ID does not match the owner of the file, +the caller does not have write access to the file, +and the caller is not privileged +(Linux: does not have either the +.B CAP_DAC_OVERRIDE +or the +.B CAP_FOWNER +capability). +.TP +.B ENOENT +.I filename +does not exist. +.TP +.B EPERM +.I times +is not NULL, +the caller's effective UID does not match the owner of the file, +and the caller is not privileged +(Linux: does not have the +.B CAP_FOWNER +capability). +.TP +.B EROFS +.I path +resides on a read-only file system. +.SH "CONFORMING TO" +.BR utime (): +SVr4, POSIX.1-2001. +POSIX.1-2008 marks +.BR utime () +as obsolete. +.br +.BR utimes (): +4.3BSD, POSIX.1-2001. +.SH NOTES +Linux does not allow changing the timestamps on an immutable file, +or setting the timestamps to something other than the current time +on an append-only file. + +In libc4 and libc5, +.BR utimes () +is just a wrapper for +.BR utime () +and hence does not allow a subsecond resolution. +.SH "SEE ALSO" +.BR chattr (1), +.BR futimesat (2), +.BR stat (2), +.BR utimensat (2), +.BR futimes (3), +.BR futimens (3) diff --git a/original/man2/utimensat.2 b/original/man2/utimensat.2 new file mode 100644 index 00000000..a6e15342 --- /dev/null +++ b/original/man2/utimensat.2 @@ -0,0 +1,603 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" 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. +.\" +.TH UTIMENSAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +utimensat, futimens \- change file timestamps with nanosecond precision +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int utimensat(int " dirfd ", const char *" pathname , +.BI " const struct timespec " times "[2], int " flags ); + +.BI "int futimens(int " fd ", const struct timespec " times [2]); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR utimensat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.br +.BR futimens (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_GNU_SOURCE +.SH DESCRIPTION +.BR utimensat () +and +.BR futimens () +update the timestamps of a file with nanosecond precision. +This contrasts with the historical +.BR utime (2) +and +.BR utimes (2), +which permit only second and microsecond precision, respectively, +when setting file timestamps. + +With +.BR utimensat () +the file is specified via the pathname given in +.IR pathname . +With +.BR futimens () +the file whose timestamps are to be updated is specified via +an open file descriptor, +.IR fd . + +For both calls, the new file timestamps are specified in the array +.IR times : +.IR times [0] +specifies the new "last access time" (\fIatime\fP); +.IR times [1] +specifies the new "last modification time" (\fImtime\fP). +Each of the elements of +.I times +specifies a time as the the number of seconds and nanoseconds +since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). +This information is conveyed in a structure of the following form: +.in +4n +.nf + +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.fi +.in +.PP +Updated file timestamps are set to the greatest value +supported by the file system that is not greater than the specified time. + +If the +.I tv_nsec +field of one of the +.I timespec +structures has the special value +.BR UTIME_NOW , +then the corresponding file timestamp is set to the current time. +If the +.I tv_nsec +field of one of the +.I timespec +structures has the special value +.BR UTIME_OMIT , +then the corresponding file timestamp is left unchanged. +In both of these cases, the value of the corresponding +.I tv_sec +.\" 2.6.22 was broken: it is not ignored +field is ignored. + +If +.I times +is NULL, then both timestamps are set to the current time. +.\" +.SS Permissions requirements +To set both file timestamps to the current time (i.e., +.I times +is NULL, or both +.I tv_nsec +fields specify +.BR UTIME_NOW ), +either: +.IP 1. 3 +the caller must have write access to the file; +.\" 2.6.22 was broken here -- for futimens() the check is +.\" based on whether or not the file descriptor is writable, +.\" not on whether the the caller's effective UID has write +.\" permission for the file referred to by the descriptor. +.IP 2. +the caller's effective user ID must match the owner of the file; or +.IP 3. +the caller must have appropriate privileges. +.PP +To make any change other than setting both timestamps to the +current time (i.e., +.I times +is not NULL, and both +.I tv_nsec +fields are not +.B UTIME_NOW +.\" 2.6.22 was broken here: +.\" both must something other than *either* UTIME_OMIT *or* UTIME_NOW. +and both +.I tv_nsec +fields are not +.BR UTIME_OMIT ), +either condition 2 or 3 above must apply. + +If both +.I tv_nsec +fields are specified as +.BR UTIME_OMIT , +then no file ownership or permission checks are performed, +and the file timestamps are not modified, +but other error conditions may still be detected. +.\" +.\" +.SS utimensat() specifics +If +.I pathname +is relative, then by default it is interpreted relative to the +directory referred to by the open file descriptor, +.IR dirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR utimes (2) +for a relative pathname). +See +.BR openat (2) +for an explanation of why this can be useful. +.\" FIXME . Say something about O_SEARCH? (But it's not in current +.\" glibc (Mar 08), or kernel 2.6.25.) + +If +.I pathname +is relative and +.I dirfd +is the special value +.BR AT_FDCWD , +then +.I pathname +is interpreted relative to the current working +directory of the calling process (like +.BR utimes (2)). + +If +.I pathname +is absolute, then +.I dirfd +is ignored. + +The +.I flags +field is a bit mask that may be 0, or include the following constant, +defined in +.IR : +.TP +.B AT_SYMLINK_NOFOLLOW +If +.I pathname +specifies a symbolic link, then update the timestamps of the link, +rather than the file to which it refers. +.SH "RETURN VALUE" +On success, +.BR utimensat () +and +.BR futimens () +return 0. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EACCES +.I times +is NULL, +or both +.I tv_nsec +values are +.BR UTIME_NOW , +and: +.PD 0 +.RS +.IP * 2 +the effective user ID of the caller does not match +the owner of the file, +the caller does not have write access to the file, +and the caller is not privileged +(Linux: does not have either the +.B CAP_FOWNER +or the +.B CAP_DAC_OVERRIDE +capability); or, +.\" But Linux 2.6.22 was broken here. +.\" Traditionally, utime()/utimes() gives the error EACCES for the case +.\" where the timestamp pointer argument is NULL (i.e., set both timestamps +.\" to the current time), and the file is owned by a user other than the +.\" effective UID of the caller, and the file is not writable by the +.\" effective UID of the program. utimensat() also gives this error in the +.\" same case. However, in the same circumstances, when utimensat() is +.\" given a 'times' array in which both tv_nsec fields are UTIME_NOW, which +.\" provides equivalent functionality to specifying 'times' as NULL, the +.\" call succeeds. It should fail with the error EACCES in this case. +.\" +.\" POSIX.1-2008 has the following: +.\" .TP +.\" .B EACCES +.\" .RB ( utimensat ()) +.\" .I fd +.\" was not opened with +.\" .B O_SEARCH +.\" and the permissions of the directory to which +.\" .I fd +.\" refers do not allow searches. +.IP * +the file is marked immutable (see +.BR chattr (1)). +.\" EXT2_IMMUTABLE_FL and similar flags for other file systems. +.RE +.PD +.TP +.B EBADF +.RB ( futimens ()) +.I fd +is not a valid file descriptor. +.TP +.B EBADF +.RB ( utimensat ()) +.I pathname +is a relative pathname, but +.I dirfd +is neither +.BR AT_FDCWD +nor a valid file descriptor. +.TP +.B EFAULT +.I times +pointed to an invalid address; or, +.I dirfd +was +.BR AT_FDCWD , +and +.I pathname +is NULL or an invalid address. +.TP +.B EINVAL +Invalid value in +.IR flags . +.TP +.B EINVAL +Invalid value in one of the +.I tv_nsec +fields (value outside range 0 to 999,999,999, and not +.B UTIME_NOW +or +.BR UTIME_OMIT ); +or an invalid value in one of the +.I tv_sec +fields. +.TP +.B EINVAL +.\" SUSv4 does not specify this error. +.I pathname +is NULL, +.I dirfd +is not +.BR AT_FDCWD , +and +.I flags +contains +.BR AT_SYMLINK_NOFOLLOW . +.TP +.B ELOOP +.RB ( utimensat ()) +Too many symbolic links were encountered in resolving +.IR pathname . +.TP +.B ENAMETOOLONG +.RB ( utimensat ()) +.I pathname +is too long. +.TP +.B ENOENT +.RB ( utimensat ()) +A component of +.I pathname +does not refer to an existing directory or file, +or +.I pathname +is an empty string. +.TP +.B ENOTDIR +.RB ( utimensat ()) +.I pathname +is a relative pathname, but +.I dirfd +is neither +.B AT_FDCWD +nor a file descriptor referring to a directory; +or, one of the prefix components of +.I pathname +is not a directory. +.TP +.B EPERM +The caller attempted to change one or both timestamps to a value +other than the current time, +or to change one of the timestamps to the current time while +leaving the other timestamp unchanged, +(i.e., +.I times +is not NULL, both +.I tv_nsec +fields are not +.BR UTIME_NOW , +and both +.I tv_nsec +fields are not +.BR UTIME_OMIT ) +and: +.PD 0 +.RS +.IP * 2 +the caller's effective user ID does not match the owner of file, +and the caller is not privileged +(Linux: does not have the +.BR CAP_FOWNER +capability); or, +.IP * +.\" Linux 2.6.22 was broken here: +.\" it was not consistent with the old utimes() implementation, +.\" since the case when both tv_nsec fields are UTIME_NOW, was not +.\" treated like the (times == NULL) case. +the file is marked append-only or immutable (see +.BR chattr (1)). +.\" EXT2_IMMUTABLE_FL EXT_APPPEND_FL and similar flags for +.\" other file systems. +.\" +.\" Why the inconsistency (which is described under NOTES) between +.\" EACCES and EPERM, where only EPERM tests for append-only. +.\" (This was also so for the older utimes() implementation.) +.RE +.PD +.TP +.B EROFS +The file is on a read-only file system. +.TP +.B ESRCH +.RB ( utimensat ()) +Search permission is denied for one of the prefix components of +.IR pathname . +.SH VERSIONS +.BR utimensat () +was added to Linux in kernel 2.6.22; +glibc support was added with version 2.6. + +Support for +.BR futimens () +first appeared in glibc 2.6. +.SH "CONFORMING TO" +.BR futimens () +and +.BR utimensat () +are specified in POSIX.1-2008. +.SH NOTES +.BR utimensat () +obsoletes +.BR futimesat (2). + +On Linux, timestamps cannot be changed for a file marked immutable, +and the only change permitted for files marked append-only is to +set the timestamps to the current time. +(This is consistent with the historical behavior of +.BR utime (2) +and +.BR utimes (2) +on Linux.) + +On Linux, +.BR futimens () +is a library function implemented on top of the +.BR utimensat () +system call. +To support this, the Linux +.BR utimensat () +system call implements a nonstandard feature: if +.I pathname +is NULL, then the call modifies the timestamps of +the file referred to by the file descriptor +.I dirfd +(which may refer to any type of file). +Using this feature, the call +.I "futimens(fd,\ times)" +is implemented as: +.nf + + utimensat(fd, NULL, times, 0); +.fi +.SH BUGS +Several bugs afflict +.BR utimensat () +and +.BR futimens () +on kernels before 2.6.26. +These bugs are either nonconformances with the POSIX.1 draft specification +or inconsistencies with historical Linux behavior. +.IP * 2 +POSIX.1 specifies that if one of the +.I tv_nsec +fields has the value +.B UTIME_NOW +or +.BR UTIME_OMIT , +then the value of the corresponding +.I tv_sec +field should be ignored. +Instead, the value of the +.I tv_sec +field is required to be 0 (or the error +.B EINVAL +results). +.IP * +Various bugs mean that for the purposes of permission checking, +the case where both +.I tv_nsec +fields are set to +.BR UTIME_NOW +isn't always treated the same as specifying +.I times +as NULL, +and the case where one +.I tv_nsec +value is +.B UTIME_NOW +and the other is +.B UTIME_OMIT +isn't treated the same as specifying +.I times +as a pointer to an array of structures containing arbitrary time values. +As a result, in some cases: +a) file timestamps can be updated by a process that shouldn't have +permission to perform updates; +b) file timestamps can't be updated by a process that should have +permission to perform updates; and +c) the wrong +.I errno +value is returned in case of an error. +.\" Below, the long description of the errors from the previous bullet +.\" point (abridged because it's too much detail for a man page). +.\" .IP * +.\" If one of the +.\" .I tv_nsec +.\" fields is +.\" .BR UTIME_OMIT +.\" and the other is +.\" .BR UTIME_NOW , +.\" then the error +.\" .B EPERM +.\" should occur if the process's effective user ID does not match +.\" the file owner and the process is not privileged. +.\" Instead, the call successfully changes one of the timestamps. +.\" .IP * +.\" If file is not writable by the effective user ID of the process and +.\" the process's effective user ID does not match the file owner and +.\" the process is not privileged, +.\" and +.\" .I times +.\" is NULL, then the error +.\" .B EACCES +.\" results. +.\" This error should also occur if +.\" .I times +.\" points to an array of structures in which both +.\" .I tv_nsec +.\" fields are +.\" .BR UTIME_NOW . +.\" Instead the call succeeds. +.\" .IP * +.\" If a file is marked as append-only (see +.\" .BR chattr (1)), +.\" then Linux traditionally +.\" (i.e., +.\" .BR utime (2), +.\" .BR utimes (2)), +.\" permits a NULL +.\" .I times +.\" argument to be used in order to update both timestamps to the current time. +.\" For consistency, +.\" .BR utimensat () +.\" and +.\" .BR futimens () +.\" should also produce the same result when given a +.\" .I times +.\" argument that points to an array of structures in which both +.\" .I tv_nsec +.\" fields are +.\" .BR UTIME_NOW . +.\" Instead, the call fails with the error +.\" .BR EPERM . +.\" .IP * +.\" If a file is marked as immutable (see +.\" .BR chattr (1)), +.\" then Linux traditionally +.\" (i.e., +.\" .BR utime (2), +.\" .BR utimes (2)), +.\" gives an +.\" .B EACCES +.\" error if +.\" .I times +.\" is NULL. +.\" For consistency, +.\" .BR utimensat () +.\" and +.\" .BR futimens () +.\" should also produce the same result when given a +.\" .I times +.\" that points to an array of structures in which both +.\" .I tv_nsec +.\" fields are +.\" .BR UTIME_NOW . +.\" Instead, the call fails with the error +.\" .BR EPERM . +.IP * +POSIX.1 says that a process that has \fIwrite access to the file\fP +can make a call with +.I times +as NULL, or with +.I times +pointing to an array of structures in which both +.I tv_nsec +fields are +.BR UTIME_NOW , +in order to update both timestamps to the current time. +However, +.BR futimens () +instead checks whether the +.IR "access mode of the file descriptor allows writing" . +.\" This means that a process with a file descriptor that allows +.\" writing could change the timestamps of a file for which it +.\" does not have write permission; +.\" conversely, a process with a read-only file descriptor won't +.\" be able to update the timestamps of a file, +.\" even if it has write permission on the file. +.SH "SEE ALSO" +.BR chattr (1), +.BR futimesat (2), +.BR openat (2), +.BR stat (2), +.BR utimes (2), +.BR futimes (3), +.BR path_resolution (7), +.BR symlink (7) diff --git a/original/man2/utimes.2 b/original/man2/utimes.2 new file mode 100644 index 00000000..04372d49 --- /dev/null +++ b/original/man2/utimes.2 @@ -0,0 +1 @@ +.so man2/utime.2 diff --git a/original/man2/vfork.2 b/original/man2/vfork.2 new file mode 100644 index 00000000..ef86812a --- /dev/null +++ b/original/man2/vfork.2 @@ -0,0 +1,207 @@ +.\" 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) +.\" +.TH VFORK 2 2009-06-21 "Linux" "Linux Programmer's Manual" +.SH NAME +vfork \- create a child process and block parent +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.B pid_t vfork(void); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR vfork (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +.SS "Standard Description" +(From POSIX.1) +The +.BR vfork () +function has the same effect as +.BR fork (2), +except that the behavior is undefined if the process created by +.BR vfork () +either modifies any data other than a variable of type +.I pid_t +used to store the return value from +.BR vfork (), +or returns from the function in which +.BR vfork () +was called, or calls any other function before successfully calling +.BR _exit (2) +or one of the +.BR exec (3) +family of functions. +.SS "Linux Description" +.BR vfork (), +just like +.BR fork (2), +creates a child process of the calling process. +For details and return value and errors, see +.BR fork (2). +.PP +.BR vfork () +is a special case of +.BR clone (2). +It is used to create new processes without copying the page tables of +the parent process. +It may be useful in performance-sensitive applications +where a child will be created which then immediately issues an +.BR execve (2). +.PP +.BR vfork () +differs from +.BR fork (2) +in that the parent is suspended until the child terminates +(either normally, +by calling +.BR _exit (2), +or abnormally, after delivery of a fatal signal), +or it makes a call to +.BR execve (2). +Until that point, the child shares all memory with its parent, +including the stack. +The child must not return from the current function or call +.BR exit (3), +but may call +.BR _exit (2). +.PP +Signal handlers are inherited, but not shared. +Signals to the parent +arrive after the child releases the parent's memory +(i.e., after the child terminates +or calls +.BR execve (2)). +.SS "Historic Description" +Under Linux, +.BR fork (2) +is implemented using copy-on-write pages, so the only penalty incurred by +.BR fork (2) +is the time and memory required to duplicate the parent's page tables, +and to create a unique task structure for the child. +However, in the bad old days a +.BR fork (2) +would require making a complete copy of the caller's data space, +often needlessly, since usually immediately afterwards an +.BR exec (3) +is done. +Thus, for greater efficiency, BSD introduced the +.BR vfork () +system call, which did not fully copy the address space of +the parent process, but borrowed the parent's memory and thread +of control until a call to +.BR execve (2) +or an exit occurred. +The parent process was suspended while the +child was using its resources. +The use of +.BR vfork () +was tricky: for example, not modifying data +in the parent process depended on knowing which variables are +held in a register. +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +POSIX.1-2008 removes the specification of +.BR vfork (). +The requirements put on +.BR vfork () +by the standards are weaker than those put on +.BR fork (2), +so an implementation where the two are synonymous is compliant. +In particular, the programmer cannot rely on the parent +remaining blocked until the child either terminates or calls +.BR execve (2), +and cannot rely on any specific behavior with respect to shared memory. +.\" In AIXv3.1 vfork is equivalent to fork. +.SH NOTES +.SS Linux Notes +Fork handlers established using +.BR pthread_atfork (3) +are not called when a multithreaded program employing +the NPTL threading library calls +.BR vfork (). +Fork handlers are called in this case in a program using the +LinuxThreads threading library. +(See +.BR pthreads (7) +for a description of Linux threading libraries.) +.SS History +The +.BR vfork () +system call appeared in 3.0BSD. +.\" In the release notes for 4.2BSD Sam Leffler wrote: `vfork: Is still +.\" present, but definitely on its way out'. +In 4.4BSD it was made synonymous to +.BR fork (2) +but NetBSD introduced it again, +cf. http://www.netbsd.org/Documentation/kernel/vfork.html . +In Linux, it has been equivalent to +.BR fork (2) +until 2.2.0-pre6 or so. +Since 2.2.0-pre9 (on i386, somewhat later on +other architectures) it is an independent system call. +Support was added in glibc 2.0.112. +.SH BUGS +It is rather unfortunate that Linux revived this specter from the past. +The BSD man page states: +"This system call will be eliminated when proper system sharing mechanisms +are implemented. +Users should not depend on the memory sharing semantics of +.BR vfork () +as it will, in that case, be made synonymous to +.BR fork (2).\c +" + +Details of the signal handling are obscure and differ between systems. +The BSD man page states: +"To avoid a possible deadlock situation, processes that are children +in the middle of a +.BR vfork () +are never sent +.B SIGTTOU +or +.B SIGTTIN +signals; rather, output or +.IR ioctl s +are allowed and input attempts result in an end-of-file indication." +.\" +.\" As far as I can tell, the following is not true in 2.6.19: +.\" Currently (Linux 2.3.25), +.\" .BR strace (1) +.\" cannot follow +.\" .BR vfork () +.\" and requires a kernel patch. +.SH "SEE ALSO" +.BR clone (2), +.BR execve (2), +.BR fork (2), +.BR unshare (2), +.BR wait (2) diff --git a/original/man2/vhangup.2 b/original/man2/vhangup.2 new file mode 100644 index 00000000..07cf0482 --- /dev/null +++ b/original/man2/vhangup.2 @@ -0,0 +1,67 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.TH VHANGUP 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +vhangup \- virtually hangup the current tty +.SH SYNOPSIS +.B #include +.sp +.B int vhangup(void); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR vhangup (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.ad b +.SH DESCRIPTION +.BR vhangup () +simulates a hangup on the current terminal. +This call arranges for other +users to have a \*(lqclean\*(rq tty at login time. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EPERM +The calling process has insufficient privilege to call +.BR vhangup (); +the +.B CAP_SYS_TTY_CONFIG +capability is required. +.SH "CONFORMING TO" +This call is Linux-specific, and should not be used in programs +intended to be portable. +.SH "SEE ALSO" +.BR capabilities (7), +.BR init (8) diff --git a/original/man2/vm86.2 b/original/man2/vm86.2 new file mode 100644 index 00000000..49fb5e79 --- /dev/null +++ b/original/man2/vm86.2 @@ -0,0 +1,73 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Copyright 1997 Andries E. 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. +.\" +.TH VM86 2 2009-02-20 "Linux" "Linux Programmer's Manual" +.SH NAME +vm86old, vm86 \- enter virtual 8086 mode +.SH SYNOPSIS +.B #include +.sp +.BI "int vm86old(struct vm86_struct *" info ); +.sp +.BI "int vm86(unsigned long " fn ", struct vm86plus_struct *" v86 ); +.SH DESCRIPTION +The system call +.BR vm86 () +was introduced in Linux 0.97p2. +In Linux 2.1.15 and 2.0.28 it was renamed to +.BR vm86old (), +and a new +.BR vm86 () +was introduced. +The definition of \fIstruct vm86_struct\fP was changed +in 1.1.8 and 1.1.9. +.LP +These calls cause the process to enter VM86 mode (virtual-8086 in Intel +literature), and are used by +.BR dosemu . +.PP +VM86 mode is an emulation of real mode within a protected mode task. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EFAULT +This return value is specific to i386 and indicates a problem with getting +userspace data. +.TP +.B ENOSYS +This return value indicates the call is not implemented on the present +architecture. +.TP +.B EPERM +Saved kernel stack exists. +(This is a kernel sanity check; the saved +stack should only exist within vm86 mode itself.) +.SH "CONFORMING TO" +This call is specific to Linux on 32-bit Intel processors, +and should not be used in programs intended to be portable. diff --git a/original/man2/vm86old.2 b/original/man2/vm86old.2 new file mode 100644 index 00000000..bf2581d4 --- /dev/null +++ b/original/man2/vm86old.2 @@ -0,0 +1 @@ +.so man2/vm86.2 diff --git a/original/man2/vmsplice.2 b/original/man2/vmsplice.2 new file mode 100644 index 00000000..421eb3f1 --- /dev/null +++ b/original/man2/vmsplice.2 @@ -0,0 +1,156 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 2006 Jens Axboe +.\" 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. +.\" +.TH VMSPLICE 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH NAME +vmsplice \- splice user pages into a pipe +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.B #include + +.BI "ssize_t vmsplice(int " fd ", const struct iovec *" iov , +.BI " unsigned long " nr_segs ", unsigned int " flags ); +.fi +.\" Return type was long before glibc 2.7 +.SH DESCRIPTION +.\" Linus: vmsplice() system call to basically do a "write to +.\" the buffer", but using the reference counting and VM traversal +.\" to actually fill the buffer. This means that the user needs to +.\" be careful not to reuse the user-space buffer it spliced into +.\" the kernel-space one (contrast this to "write()", which copies +.\" the actual data, and you can thus reuse the buffer immediately +.\" after a successful write), but that is often easy to do. +The +.BR vmsplice () +system call maps +.I nr_segs +ranges of user memory described by +.I iov +into a pipe. +The file descriptor +.I fd +must refer to a pipe. + +The pointer +.I iov +points to an array of +.I iovec +structures as defined in +.IR : + +.in +4n +.nf +struct iovec { + void *iov_base; /* Starting address */ + size_t iov_len; /* Number of bytes */ +}; +.in +.fi + +The +.I flags +argument is a bit mask that is composed by ORing together +zero or more of the following values: +.TP 1.9i +.B SPLICE_F_MOVE +Unused for +.BR vmsplice (); +see +.BR splice (2). +.TP +.B SPLICE_F_NONBLOCK +.\" Not used for vmsplice +.\" May be in the future -- therefore EAGAIN +Do not block on I/O; see +.BR splice (2) +for further details. +.TP +.B SPLICE_F_MORE +Currently has no effect for +.BR vmsplice (), +but may be implemented in the future; see +.BR splice (2). +.TP +.B SPLICE_F_GIFT +The user pages are a gift to the kernel. +The application may not modify this memory ever, +.\" FIXME Explain the following line in a little more detail: +or page cache and on-disk data may differ. +Gifting pages to the kernel means that a subsequent +.BR splice (2) +.B SPLICE_F_MOVE +can successfully move the pages; +if this flag is not specified, then a subsequent +.BR splice (2) +.B SPLICE_F_MOVE +must copy the pages. +Data must also be properly page aligned, both in memory and length. +.\" .... if we expect to later SPLICE_F_MOVE to the cache. +.SH RETURN VALUE +Upon successful completion, +.BR vmsplice () +returns the number of bytes transferred to the pipe. +On error, +.BR vmsplice () +returns \-1 and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EBADF +.I fd +either not valid, or doesn't refer to a pipe. +.TP +.B EINVAL +.I nr_segs +is 0 or greater than +.BR IOV_MAX ; +or memory not aligned if +.B SPLICE_F_GIFT +set. +.TP +.B ENOMEM +Out of memory. +.SH VERSIONS +The +.BR vmsplice () +system call first appeared in Linux 2.6.17. +.SH "CONFORMING TO" +This system call is Linux-specific. +.SH NOTES +.BR vmsplice () +follows the other vectorized read/write type functions when it comes to +limitations on number of segments being passed in. +This limit is +.B IOV_MAX +as defined in +.IR . +At the time of this writing, that limit is 1024. +.SH SEE ALSO +.BR splice (2), +.BR tee (2), +.BR feature_test_macros (7) diff --git a/original/man2/vserver.2 b/original/man2/vserver.2 new file mode 100644 index 00000000..5d25ea6c --- /dev/null +++ b/original/man2/vserver.2 @@ -0,0 +1 @@ +.so man2/unimplemented.2 diff --git a/original/man2/wait.2 b/original/man2/wait.2 new file mode 100644 index 00000000..b2dab89e --- /dev/null +++ b/original/man2/wait.2 @@ -0,0 +1,606 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 by Thomas Koenig +.\" and Copyright (c) 2004 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. +.\" License. +.\" +.\" Modified Sat Jul 24 13:30:06 1993 by Rik Faith +.\" Modified Sun Aug 21 17:42:42 1994 by Rik Faith +.\" (Thanks to Koen Holtman ) +.\" Modified Wed May 17 15:54:12 1995 by Rik Faith +.\" To remove *'s from status in macros (Thanks to Michael Shields). +.\" Modified as suggested by Nick Duffek , aeb, 960426 +.\" Modified Mon Jun 23 14:09:52 1997 by aeb - add EINTR. +.\" Modified Thu Nov 26 02:12:45 1998 by aeb - add SIGCHLD stuff. +.\" Modified Mon Jul 24 21:37:38 2000 by David A. Wheeler +.\" - noted thread issues. +.\" Modified 26 Jun 01 by Michael Kerrisk +.\" Added __WCLONE, __WALL, and __WNOTHREAD descriptions +.\" Modified 2001-09-25, aeb +.\" Modified 26 Jun 01 by Michael Kerrisk, +.\" Updated notes on setting disposition of SIGCHLD to SIG_IGN +.\" 2004-11-11, mtk +.\" Added waitid(2); added WCONTINUED and WIFCONTINUED() +.\" Added text on SA_NOCLDSTOP +.\" Updated discussion of SA_NOCLDWAIT to reflect 2.6 behavior +.\" Much other text rewritten +.\" 2005-05-10, mtk, __W* flags can't be used with waitid() +.\" 2008-07-04, mtk, removed erroneous text about SA_NOCLDSTOP +.\" +.TH WAIT 2 2009-04-21 "Linux" "Linux Programmer's Manual" +.SH NAME +wait, waitpid, waitid \- wait for process to change state +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "pid_t wait(int *" "status" ); + +.BI "pid_t waitpid(pid_t " pid ", int *" status ", int " options ); + +.BI "int waitid(idtype_t " idtype ", id_t " id \ +", siginfo_t *" infop ", int " options ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR waitid (): +_SVID_SOURCE || _XOPEN_SOURCE +.SH DESCRIPTION +All of these system calls are used to wait for state changes +in a child of the calling process, and obtain information +about the child whose state has changed. +A state change is considered to be: the child terminated; +the child was stopped by a signal; or the child was resumed by a signal. +In the case of a terminated child, performing a wait allows +the system to release the resources associated with the child; +if a wait is not performed, then the terminated child remains in +a "zombie" state (see NOTES below). + +If a child has already changed state, then these calls return immediately. +Otherwise they block until either a child changes state or +a signal handler interrupts the call (assuming that system calls +are not automatically restarted using the +.B SA_RESTART +flag of +.BR sigaction (2)). +In the remainder of this page, a child whose state has changed +and which has not yet been waited upon by one of these system +calls is termed +.IR waitable . +.SS "wait() and waitpid()" +The +.BR wait () +system call suspends execution of the calling process until one of its +children terminates. +The call +.I wait(&status) +is equivalent to: +.nf + + waitpid(\-1, &status, 0); +.fi + +The +.BR waitpid () +system call suspends execution of the calling process until a +child specified by +.I pid +argument has changed state. +By default, +.BR waitpid () +waits only for terminated children, but this behavior is modifiable +via the +.I options +argument, as described below. + +The value of +.I pid +can be: +.IP "< \-1" +meaning wait for any child process whose process group ID is +equal to the absolute value of +.IR pid . +.IP \-1 +meaning wait for any child process. +.IP 0 +meaning wait for any child process whose process group ID is +equal to that of the calling process. +.IP "> 0" +meaning wait for the child whose process ID is equal to the +value of +.IR pid . +.PP +The value of +.I options +is an OR of zero or more of the following constants: +.TP 12 +.B WNOHANG +return immediately if no child has exited. +.TP +.B WUNTRACED +also return if a child has stopped +(but not traced via +.BR ptrace (2)). +Status for +.I traced +children which have stopped is provided +even if this option is not specified. +.TP +.BR WCONTINUED " (since Linux 2.6.10)" +also return if a stopped child has been resumed by delivery of +.BR SIGCONT . +.PP +(For Linux-only options, see below.) +.PP +If +.I status +is not NULL, +.BR wait () +and +.BR waitpid () +store status information in the \fIint\fP to which it points. +This integer can be inspected with the following macros (which +take the integer itself as an argument, not a pointer to it, +as is done in +.BR wait () +and +.BR waitpid ()!): +.TP +.BI WIFEXITED( status ) +returns true if the child terminated normally, that is, +by calling +.BR exit (3) +or +.BR _exit (2), +or by returning from main(). +.TP +.BI WEXITSTATUS( status ) +returns the exit status of the child. +This consists of the least significant 8 bits of the +.I status +argument that the child specified in a call to +.BR exit (3) +or +.BR _exit (2) +or as the argument for a return statement in main(). +This macro should only be employed if +.B WIFEXITED +returned true. +.TP +.BI WIFSIGNALED( status ) +returns true if the child process was terminated by a signal. +.TP +.BI WTERMSIG( status ) +returns the number of the signal that caused the child process to +terminate. +This macro should only be employed if +.B WIFSIGNALED +returned true. +.TP +.BI WCOREDUMP( status ) +returns true if the child produced a core dump. +This macro should only be employed if +.B WIFSIGNALED +returned true. +This macro is not specified in POSIX.1-2001 and is not available on +some Unix implementations (e.g., AIX, SunOS). +Only use this enclosed in #ifdef WCOREDUMP ... #endif. +.TP +.BI WIFSTOPPED( status ) +returns true if the child process was stopped by delivery of a signal; +this is only possible if the call was done using +.B WUNTRACED +or when the child is being traced (see +.BR ptrace (2)). +.TP +.BI WSTOPSIG( status ) +returns the number of the signal which caused the child to stop. +This macro should only be employed if +.B WIFSTOPPED +returned true. +.TP +.BI WIFCONTINUED( status ) +(since Linux 2.6.10) +returns true if the child process was resumed by delivery of +.BR SIGCONT . +.SS "waitid()" +The +.BR waitid () +system call (available since Linux 2.6.9) provides more precise +control over which child state changes to wait for. + +The +.I idtype +and +.I id +arguments select the child(ren) to wait for, as follows: +.IP "\fIidtype\fP == \fBP_PID\fP" +Wait for the child whose process ID matches +.IR id . +.IP "\fIidtype\fP == \fBP_PGID\fP" +Wait for any child whose process group ID matches +.IR id . +.IP "\fIidtype\fP == \fBP_ALL\fP" +Wait for any child; +.I id +is ignored. +.PP +The child state changes to wait for are specified by ORing +one or more of the following flags in +.IR options : +.TP 12 +.B WEXITED +Wait for children that have terminated. +.TP +.B WSTOPPED +Wait for children that have been stopped by delivery of a signal. +.TP +.B WCONTINUED +Wait for (previously stopped) children that have been +resumed by delivery of +.BR SIGCONT . +.PP +The following flags may additionally be ORed in +.IR options : +.TP 12 +.B WNOHANG +As for +.BR waitpid (). +.TP +.B WNOWAIT +Leave the child in a waitable state; a later wait call +can be used to again retrieve the child status information. +.PP +Upon successful return, +.BR waitid () +fills in the following fields of the +.I siginfo_t +structure pointed to by +.IR infop : +.TP 12 +\fIsi_pid\fP +The process ID of the child. +.TP +\fIsi_uid\fP +The real user ID of the child. +(This field is not set on most other implementations.) +.TP +\fIsi_signo\fP +Always set to +.BR SIGCHLD . +.TP +\fIsi_status\fP +Either the exit status of the child, as given to +.BR _exit (2) +(or +.BR exit (3)), +or the signal that caused the child to terminate, stop, or continue. +The +.I si_code +field can be used to determine how to interpret this field. +.TP +\fIsi_code\fP +Set to one of: +.B CLD_EXITED +(child called +.BR _exit (2)); +.B CLD_KILLED +(child killed by signal); +.B CLD_DUMPED +(child killed by signal, and dumped core); +.B CLD_STOPPED +(child stopped by signal); +.B CLD_TRAPPED +(traced child has trapped); or +.B CLD_CONTINUED +(child continued by +.BR SIGCONT ). +.PP +If +.B WNOHANG +was specified in +.I options +and there were no children in a waitable state, then +.BR waitid () +returns 0 immediately and +the state of the +.I siginfo_t +structure pointed to by +.I infop +is unspecified. +.\" POSIX.1-2001 leaves this possibility unspecified; most +.\" implementations (including Linux) zero out the structure +.\" in this case, but at at least one implementation (AIX 5.1) +.\" does not -- MTK Nov 04 +To distinguish this case from that where a child was in a +waitable state, zero out the +.I si_pid +field before the call and check for a nonzero value in this field +after the call returns. +.SH "RETURN VALUE" +.BR wait (): +on success, returns the process ID of the terminated child; +on error, \-1 is returned. + +.BR waitpid (): +on success, returns the process ID of the child whose state has changed; +if +.B WNOHANG +was specified and one or more child(ren) specified by +.I pid +exist, but have not yet changed state, then 0 is returned. +On error, \-1 is returned. + +.BR waitid (): +returns 0 on success or +if +.B WNOHANG +was specified and no child(ren) specified by +.I id +has yet changed state; +on error, \-1 is returned. +.\" FIXME: As reported by Vegard Nossum, if infop is NULL, then waitid() +.\" returns the PID of the child. Either this is a bug, or it is intended +.\" behavior that needs to be documented. See my Jan 2009 LKML mail +.\" "waitid() return value strangeness when infop is NULL". +Each of these calls sets +.I errno +to an appropriate value in the case of an error. +.SH ERRORS +.TP +.B ECHILD +(for +.BR wait ()) +The calling process does not have any unwaited-for children. +.TP +.B ECHILD +(for +.BR waitpid () +or +.BR waitid ()) +The process specified by +.I pid +.RB ( waitpid ()) +or +.I idtype +and +.I id +.RB ( waitid ()) +does not exist or is not a child of the calling process. +(This can happen for one's own child if the action for +.B SIGCHLD +is set to +.BR SIG_IGN . +See also the \fILinux Notes\fP section about threads.) +.TP +.B EINTR +.B WNOHANG +was not set and an unblocked signal or a +.B SIGCHLD +was caught; see +.BR signal (7). +.TP +.B EINVAL +The +.I options +argument was invalid. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH NOTES +A child that terminates, but has not been waited for becomes a "zombie". +The kernel maintains a minimal set of information about the zombie +process (PID, termination status, resource usage information) +in order to allow the parent to later perform a wait to obtain +information about the child. +As long as a zombie is not removed from the system via a wait, +it will consume a slot in the kernel process table, and if +this table fills, it will not be possible to create further processes. +If a parent process terminates, then its "zombie" children (if any) +are adopted by +.BR init (8), +which automatically performs a wait to remove the zombies. + +POSIX.1-2001 specifies that if the disposition of +.B SIGCHLD +is set to +.B SIG_IGN +or the +.B SA_NOCLDWAIT +flag is set for +.B SIGCHLD +(see +.BR sigaction (2)), +then children that terminate do not become zombies and a call to +.BR wait () +or +.BR waitpid () +will block until all children have terminated, and then fail with +.I errno +set to +.BR ECHILD . +(The original POSIX standard left the behavior of setting +.B SIGCHLD +to +.B SIG_IGN +unspecified. +Note that even though the default disposition of +.B SIGCHLD +is "ignore", explicitly setting the disposition to +.B SIG_IGN +results in different treatment of zombie process children.) +Linux 2.6 conforms to this specification. +However, Linux 2.4 (and earlier) does not: +if a +.BR wait () +or +.BR waitpid () +call is made while +.B SIGCHLD +is being ignored, the call behaves just as though +.B SIGCHLD +were not being ignored, that is, the call blocks until the next child +terminates and then returns the process ID and status of that child. +.SS Linux Notes +In the Linux kernel, a kernel-scheduled thread is not a distinct +construct from a process. +Instead, a thread is simply a process +that is created using the Linux-unique +.BR clone (2) +system call; other routines such as the portable +.BR pthread_create (3) +call are implemented using +.BR clone (2). +Before Linux 2.4, a thread was just a special case of a process, +and as a consequence one thread could not wait on the children +of another thread, even when the latter belongs to the same thread group. +However, POSIX prescribes such functionality, and since Linux 2.4 +a thread can, and by default will, wait on children of other threads +in the same thread group. +.LP +The following Linux-specific +.I options +are for use with children created using +.BR clone (2); +they cannot be used with +.BR waitid (): +.TP +.B __WCLONE +.\" since 0.99pl10 +Wait for "clone" children only. +If omitted then wait for "non-clone" children only. +(A "clone" child is one which delivers no signal, or a signal other than +.B SIGCHLD +to its parent upon termination.) +This option is ignored if +.B __WALL +is also specified. +.TP +.BR __WALL " (since Linux 2.4)" +.\" since patch-2.3.48 +Wait for all children, regardless of +type ("clone" or "non-clone"). +.TP +.BR __WNOTHREAD " (since Linux 2.4)" +.\" since patch-2.4.0-test8 +Do not wait for children of other threads in +the same thread group. +This was the default before Linux 2.4. +.SH EXAMPLE +.\" fork.2 refers to this example program. +The following program demonstrates the use of +.BR fork (2) +and +.BR waitpid (). +The program creates a child process. +If no command-line argument is supplied to the program, +then the child suspends its execution using +.BR pause (2), +to allow the user to send signals to the child. +Otherwise, if a command-line argument is supplied, +then the child exits immediately, +using the integer supplied on the command line as the exit status. +The parent process executes a loop that monitors the child using +.BR waitpid (), +and uses the W*() macros described above to analyze the wait status value. + +The following shell session demonstrates the use of the program: +.in +4n +.nf + +.RB "$" " ./a.out &" +Child PID is 32360 +[1] 32359 +.RB "$" " kill \-STOP 32360" +stopped by signal 19 +.RB "$" " kill \-CONT 32360" +continued +.RB "$" " kill \-TERM 32360" +killed by signal 15 +[1]+ Done ./a.out +$ +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + pid_t cpid, w; + int status; + + cpid = fork(); + if (cpid == \-1) { + perror("fork"); + exit(EXIT_FAILURE); + } + + if (cpid == 0) { /* Code executed by child */ + printf("Child PID is %ld\\n", (long) getpid()); + if (argc == 1) + pause(); /* Wait for signals */ + _exit(atoi(argv[1])); + + } else { /* Code executed by parent */ + do { + w = waitpid(cpid, &status, WUNTRACED | WCONTINUED); + if (w == \-1) { + perror("waitpid"); + exit(EXIT_FAILURE); + } + + if (WIFEXITED(status)) { + printf("exited, status=%d\\n", WEXITSTATUS(status)); + } else if (WIFSIGNALED(status)) { + printf("killed by signal %d\\n", WTERMSIG(status)); + } else if (WIFSTOPPED(status)) { + printf("stopped by signal %d\\n", WSTOPSIG(status)); + } else if (WIFCONTINUED(status)) { + printf("continued\\n"); + } + } while (!WIFEXITED(status) && !WIFSIGNALED(status)); + exit(EXIT_SUCCESS); + } +} +.fi +.SH "SEE ALSO" +.BR _exit (2), +.BR clone (2), +.BR fork (2), +.BR kill (2), +.BR ptrace (2), +.BR sigaction (2), +.BR signal (2), +.BR wait4 (2), +.BR pthread_create (3), +.BR credentials (7), +.BR signal (7) diff --git a/original/man2/wait3.2 b/original/man2/wait3.2 new file mode 100644 index 00000000..097794b1 --- /dev/null +++ b/original/man2/wait3.2 @@ -0,0 +1 @@ +.so man2/wait4.2 diff --git a/original/man2/wait4.2 b/original/man2/wait4.2 new file mode 100644 index 00000000..eafb109e --- /dev/null +++ b/original/man2/wait4.2 @@ -0,0 +1,152 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" and Copyright (c) 2004 by Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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 13:32:44 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon Jun 23 14:09:52 1997 by aeb - add EINTR. +.\" Modified Tue Jul 7 12:26:42 1998 by aeb - changed return value wait3 +.\" Modified 2004-11-11, Michael Kerrisk +.\" Rewrote much of this page, and removed much duplicated text, +.\" replacing with pointers to wait.2 +.\" +.TH WAIT4 2 2008-09-28 "Linux" "Linux Programmer's Manual" +.SH NAME +wait3, wait4 \- wait for process to change state, BSD style +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.B #include +.sp +.BI "pid_t wait3(int *" "status" ", int " options , +.BI " struct rusage *" rusage ); +.sp +.BI "pid_t wait4(pid_t " pid ", int *" status ", int " options , +.BI " struct rusage *" rusage ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR wait3 (): +_BSD_SOURCE +.br +.BR wait4 (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +The +.BR wait3 () +and +.BR wait4 () +system calls are similar to +.BR waitpid (2), +but additionally return resource usage information about the +child in the structure pointed to by +.IR rusage . +.PP +Other than the use of the +.I rusage +argument, the following +.BR wait3 () +call: +.nf + + wait3(status, options, rusage); + +.fi +is equivalent to: +.nf + + waitpid(\-1, status, options); + +.fi +Similarly, the following +.BR wait4 () +call: +.nf + + wait4(pid, status, options, rusage); + +.fi +is equivalent to: +.nf + + waitpid(pid, status, options); + +.fi +In other words, +.BR wait3 () +waits of any child, while +.BR wait4 () +can be used to select a specific child, or children, on which to wait. +See +.BR wait (2) +for further details. +.PP +If +.I rusage +is not NULL, the +.I struct rusage +to which it points will be filled with accounting information +about the child. +See +.BR getrusage (2) +for details. +.SH "RETURN VALUE" +As for +.BR waitpid (2). +.SH ERRORS +As for +.BR waitpid (2). +.SH "CONFORMING TO" +4.3BSD. +.SH NOTES +Including +.I +is not required these days, but increases portability. +(Indeed, +.I +defines the +.I rusage +structure with fields of type +.I struct timeval +defined in +.IR .) + +On Linux, +.BR wait3 () +is a library function implemented on top of the +.BR wait4 () +system call. +.SH "SEE ALSO" +.BR fork (2), +.BR getrusage (2), +.BR sigaction (2), +.BR signal (2), +.BR wait (2), +.BR signal (7) diff --git a/original/man2/waitid.2 b/original/man2/waitid.2 new file mode 100644 index 00000000..0605b354 --- /dev/null +++ b/original/man2/waitid.2 @@ -0,0 +1 @@ +.so man2/wait.2 diff --git a/original/man2/waitpid.2 b/original/man2/waitpid.2 new file mode 100644 index 00000000..0605b354 --- /dev/null +++ b/original/man2/waitpid.2 @@ -0,0 +1 @@ +.so man2/wait.2 diff --git a/original/man2/write.2 b/original/man2/write.2 new file mode 100644 index 00000000..3f31a318 --- /dev/null +++ b/original/man2/write.2 @@ -0,0 +1,211 @@ +.\" 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 Sat Jul 24 13:35:59 1993 by Rik Faith +.\" Modified Sun Nov 28 17:19:01 1993 by Rik Faith +.\" Modified Sat Jan 13 12:58:08 1996 by Michael Haardt +.\" +.\" Modified Sun Jul 21 18:59:33 1996 by Andries Brouwer +.\" 2001-12-13 added remark by Zack Weinberg +.\" 2007-06-18 mtk: +.\" Added details about seekable files and file offset. +.\" Noted that write() may write less than 'count' bytes, and +.\" gave some examples of why this might occur. +.\" Noted what happens if write() is interrupted by a signal. +.\" +.TH WRITE 2 2009-02-23 "Linux" "Linux Programmer's Manual" +.SH NAME +write \- write to a file descriptor +.SH SYNOPSIS +.B #include +.sp +.BI "ssize_t write(int " fd ", const void *" buf ", size_t " count ); +.SH DESCRIPTION +.BR write () +writes up to +.I count +bytes from the buffer pointed +.I buf +to the file referred to by the file descriptor +.IR fd . + +The number of bytes written may be less than +.I count +if, for example, +there is insufficient space on the underlying physical medium, or the +.B RLIMIT_FSIZE +resource limit is encountered (see +.BR setrlimit (2)), +or the call was interrupted by a signal +handler after having written less than +.I count +bytes. +(See also +.BR pipe (7).) + +For a seekable file (i.e., one to which +.BR lseek (2) +may be applied, for example, a regular file) +writing takes place at the current file offset, +and the file offset is incremented by +the number of bytes actually written. +If the file was +.BR open (2)ed +with +.BR O_APPEND , +the file offset is first set to the end of the file before writing. +The adjustment of the file offset and the write operation +are performed as an atomic step. + +POSIX requires that a +.BR read (2) +which can be proved to occur after a +.BR write () +has returned returns the new data. +Note that not all file systems are POSIX conforming. +.SH "RETURN VALUE" +On success, the number of bytes written is returned (zero indicates +nothing was written). +On error, \-1 is returned, and \fIerrno\fP is set +appropriately. + +If \fIcount\fP is zero and +.I fd +refers to a regular file, then +.BR write () +may return a failure status if one of the errors below is detected. +If no errors are detected, +0 will be returned without causing any other effect. +If +\fIcount\fP is zero and +.I fd +refers to a file other than a regular file, +the results are not specified. +.SH ERRORS +.TP +.B EAGAIN +The file descriptor +.I fd +refers to a file other than a socket and has been marked nonblocking +.RB ( O_NONBLOCK ), +and the write would block. +.TP +.BR EAGAIN " or " EWOULDBLOCK +.\" Actually EAGAIN on Linux +The file descriptor +.I fd +refers to a socket and has been marked nonblocking +.RB ( O_NONBLOCK ), +and the write would block. +POSIX.1-2001 allows either error to be returned for this case, +and does not require these constants to have the same value, +so a portable application should check for both possibilities. +.TP +.B EBADF +.I fd +is not a valid file descriptor or is not open for writing. +.TP +.B EFAULT +.I buf +is outside your accessible address space. +.TP +.B EFBIG +An attempt was made to write a file that exceeds the implementation-defined +maximum file size or the process's file size limit, +or to write at a position past the maximum allowed offset. +.TP +.B EINTR +The call was interrupted by a signal before any data was written; see +.BR signal (7). +.TP +.B EINVAL +.I fd +is attached to an object which is unsuitable for writing; +or the file was opened with the +.B O_DIRECT +flag, and either the address specified in +.IR buf , +the value specified in +.IR count , +or the current file offset is not suitably aligned. +.TP +.B EIO +A low-level I/O error occurred while modifying the inode. +.TP +.B ENOSPC +The device containing the file referred to by +.I fd +has no room for the data. +.TP +.B EPIPE +.I fd +is connected to a pipe or socket whose reading end is closed. +When this happens the writing process will also receive a +.B SIGPIPE +signal. +(Thus, the write return value is seen only if the program +catches, blocks or ignores this signal.) +.PP +Other errors may occur, depending on the object connected to +.IR fd . +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.\" SVr4 documents additional error +.\" conditions EDEADLK, ENOLCK, ENOLNK, ENOSR, ENXIO, or ERANGE. + +Under SVr4 a write may be interrupted and return +.B EINTR +at any point, +not just before any data is written. +.SH NOTES +A successful return from +.BR write () +does not make any guarantee that data has been committed to disk. +In fact, on some buggy implementations, it does not even guarantee +that space has successfully been reserved for the data. +The only way to be sure is to call +.BR fsync (2) +after you are done writing all your data. + +If a +.BR write () +is interrupted by a signal handler before any bytes are written, +then the call fails with the error +.BR EINTR ; +if it is interrupted after at least one byte has been written, +the call succeeds, and returns the number of bytes written. +.SH "SEE ALSO" +.BR close (2), +.BR fcntl (2), +.BR fsync (2), +.BR ioctl (2), +.BR lseek (2), +.BR open (2), +.BR pwrite (2), +.BR read (2), +.BR select (2), +.BR writev (2), +.BR fwrite (3) diff --git a/original/man2/writev.2 b/original/man2/writev.2 new file mode 100644 index 00000000..54e3384e --- /dev/null +++ b/original/man2/writev.2 @@ -0,0 +1 @@ +.so man2/readv.2 diff --git a/original/man3/CMSG_ALIGN.3 b/original/man3/CMSG_ALIGN.3 new file mode 100644 index 00000000..ad67f433 --- /dev/null +++ b/original/man3/CMSG_ALIGN.3 @@ -0,0 +1 @@ +.so man3/cmsg.3 diff --git a/original/man3/CMSG_FIRSTHDR.3 b/original/man3/CMSG_FIRSTHDR.3 new file mode 100644 index 00000000..ad67f433 --- /dev/null +++ b/original/man3/CMSG_FIRSTHDR.3 @@ -0,0 +1 @@ +.so man3/cmsg.3 diff --git a/original/man3/CMSG_NXTHDR.3 b/original/man3/CMSG_NXTHDR.3 new file mode 100644 index 00000000..ad67f433 --- /dev/null +++ b/original/man3/CMSG_NXTHDR.3 @@ -0,0 +1 @@ +.so man3/cmsg.3 diff --git a/original/man3/CMSG_SPACE.3 b/original/man3/CMSG_SPACE.3 new file mode 100644 index 00000000..ad67f433 --- /dev/null +++ b/original/man3/CMSG_SPACE.3 @@ -0,0 +1 @@ +.so man3/cmsg.3 diff --git a/original/man3/CPU_ALLOC.3 b/original/man3/CPU_ALLOC.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_ALLOC.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_ALLOC_SIZE.3 b/original/man3/CPU_ALLOC_SIZE.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_ALLOC_SIZE.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_AND.3 b/original/man3/CPU_AND.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_AND.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_AND_S.3 b/original/man3/CPU_AND_S.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_AND_S.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_CLR.3 b/original/man3/CPU_CLR.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_CLR.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_CLR_S.3 b/original/man3/CPU_CLR_S.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_CLR_S.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_COUNT.3 b/original/man3/CPU_COUNT.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_COUNT.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_COUNT_S.3 b/original/man3/CPU_COUNT_S.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_COUNT_S.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_EQUAL.3 b/original/man3/CPU_EQUAL.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_EQUAL.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_EQUAL_S.3 b/original/man3/CPU_EQUAL_S.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_EQUAL_S.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_FREE.3 b/original/man3/CPU_FREE.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_FREE.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_ISSET.3 b/original/man3/CPU_ISSET.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_ISSET.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_ISSET_S.3 b/original/man3/CPU_ISSET_S.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_ISSET_S.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_OR.3 b/original/man3/CPU_OR.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_OR.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_OR_S.3 b/original/man3/CPU_OR_S.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_OR_S.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_SET.3 b/original/man3/CPU_SET.3 new file mode 100644 index 00000000..46ef2756 --- /dev/null +++ b/original/man3/CPU_SET.3 @@ -0,0 +1,353 @@ +.\" Copyright (C) 2006 Michael Kerrisk +.\" and 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. +.\" +.TH CPU_SET 3 2010-02-21 "Linux" "Linux Programmer's Manual" +.SH NAME +CPU_SET, CPU_CLR, CPU_ISSET, CPU_ZERO, CPU_COUNT, +CPU_AND, CPU_OR, CPU_XOR, CPU_EQUAL, +CPU_ALLOC, CPU_ALLOC_SIZE, CPU_FREE, +CPU_SET_S, CPU_CLR_S, CPU_ISSET_S, CPU_ZERO_S, +CPU_COUNT_S, CPU_AND_S, CPU_OR_S, CPU_XOR_S, CPU_EQUAL_S \- +macros for manipulating CPU sets +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "void CPU_ZERO(cpu_set_t *" set ); +.sp +.BI "void CPU_SET(int " cpu ", cpu_set_t *" set ); +.BI "void CPU_CLR(int " cpu ", cpu_set_t *" set ); +.BI "int CPU_ISSET(int " cpu ", cpu_set_t *" set ); +.sp +.BI "int CPU_COUNT(cpu_set_t *" set ); +.sp +.BI "void CPU_AND(cpu_set_t *" destset , +.BI " cpu_set_t *" srcset1 ", cpu_set_t *" srcset2 ); +.BI "void CPU_OR(cpu_set_t *" destset , +.BI " cpu_set_t *" srcset1 ", cpu_set_t *" srcset2 ); +.BI "void CPU_XOR(cpu_set_t *" destset , +.BI " cpu_set_t *" srcset1 ", cpu_set_t *" srcset2 ); +.sp +.BI "int CPU_EQUAL(cpu_set_t *" set1 ", cpu_set_t *" set2 ); +.sp +.BI "cpu_set_t *CPU_ALLOC(int " num_cpus ); +.BI "void CPU_FREE(cpu_set_t *" set ); +.BI "size_t CPU_ALLOC_SIZE(int " num_cpus ); +.sp +.BI "void CPU_ZERO_S(size_t " setsize ", cpu_set_t *" set ); +.sp +.BI "void CPU_SET_S(int " cpu ", size_t " setsize ", cpu_set_t *" set ); +.BI "void CPU_CLR_S(int " cpu ", size_t " setsize ", cpu_set_t *" set ); +.BI "int CPU_ISSET_S(int " cpu ", size_t " setsize ", cpu_set_t *" set ); +.sp +.BI "int CPU_COUNT_S(size_t " setsize ", cpu_set_t *" set ); +.sp +.BI "void CPU_AND_S(size_t " setsize ", cpu_set_t *" destset , +.BI " cpu_set_t *" srcset1 ", cpu_set_t *" srcset2 ); +.BI "void CPU_OR_S(size_t " setsize ", cpu_set_t *" destset , +.BI " cpu_set_t *" srcset1 ", cpu_set_t *" srcset2 ); +.BI "void CPU_XOR_S(size_t " setsize ", cpu_set_t *" destset , +.BI " cpu_set_t *" srcset1 ", cpu_set_t *" srcset2 ); +.sp +.BI "int CPU_EQUAL_S(size_t " setsize ", cpu_set_t *" set1 \ +", cpu_set_t *" set2 ); +.fi +.SH DESCRIPTION +The +.I cpu_set_t +data structure represents a set of CPUs. +CPU sets are used by +.BR sched_setaffinity (2) +and similar interfaces. + +The +.I cpu_set_t +data type is implemented as a bitset. +However, the data structure treated as considered opaque: +all manipulation of CPU sets should be done via the macros +described in this page. + +The following macros are provided to operate on the CPU set +.IR set : +.TP 17 +.BR CPU_ZERO () +Clears +.IR set , +so that it contains no CPUs. +.TP +.BR CPU_SET () +Add CPU +.I cpu +to +.IR set . +.TP +.BR CPU_CLR () +Remove CPU +.I cpu +from +.IR set . +.TP +.BR CPU_ISSET () +Test to see if CPU +.I cpu +is a member of +.IR set . +.TP +.BR CPU_COUNT () +Return the number of CPUs in +.IR set . +.PP +Where a +.I cpu +argument is specified, it should not produce side effects, +since the above macros may evaluate the argument more than once. +.PP +The first available CPU on the system corresponds to a +.I cpu +value of 0, the next CPU corresponds to a +.I cpu +value of 1, and so on. +The constant +.B CPU_SETSIZE +(currently 1024) specifies a value one greater than the maximum CPU +number that can be stored in +.IR cpu_set_t . + +The following macros perform logical operations on CPU sets: +.TP 17 +.BR CPU_AND () +Store the logical AND of the sets +.I srcset1 +and +.I srcset2 +in +.I destset +(which may be one of the source sets). +.TP +.BR CPU_OR () +Store the logical OR of the sets +.I srcset1 +and +.I srcset2 +in +.I destset +(which may be one of the source sets). +.TP +.BR CPU_XOR () +Store the logical XOR of the sets +.I srcset1 +and +.I srcset2 +in +.I destset +(which may be one of the source sets). +.TP +.BR CPU_EQUAL () +Test whether two CPU set contain exactly the same CPUs. +.SS Dynamically sized CPU sets +Because some applications may require the ability to dynamically +size CPU sets (e.g., to allocate sets larger than that +defined by the standard +.I cpu_set_t +data type), glibc nowadays provides a set of macros to support this. + +The following macros are used to allocate and deallocate CPU sets: +.TP 17 +.BR CPU_ALLOC () +Allocate a CPU set large enough to hold CPUs +in the range 0 to +.IR num_cpus-1 . +.TP +.BR CPU_ALLOC_SIZE () +Return the size in bytes of the CPU set that would be needed to +hold CPUs in the range 0 to +.IR num_cpus-1 . +This macro provides the value that can be used for the +.I setsize +argument in the +.BR CPU_*_S () +macros described below. +.TP +.BR CPU_FREE () +Free a CPU set previously allocated by +.BR CPU_ALLOC (). +.PP +The macros whose names end with "_S" are the analogs of +the similarly named macros without the suffix. +These macros perform the same tasks as their analogs, +but operate on the dynamically allocated CPU set(s) whose size is +.I setsize +bytes. +.SH "RETURN VALUE" +.BR CPU_ISSET () +and +.BR CPU_ISSET_S () +return nonzero if +.I cpu +is in +.IR set ; +otherwise, it returns 0. + +.BR CPU_COUNT () +and +.BR CPU_COUNT_S () +return the number of CPUs in +.IR set . + +.BR CPU_EQUAL () +and +.BR CPU_EQUAL_S () +return nonzero if the two CPU sets are equal; otherwise it returns 0. + +.BR CPU_ALLOC () +returns a pointer on success, or NULL on failure. +(Errors are as for +.BR malloc (3).) + +.BR CPU_ALLOC_SIZE () +returns the number of bytes required to store a +CPU set of the specified cardinality. + +The other functions do not return a value. +.SH VERSIONS +The +.BR CPU_ZERO (), +.BR CPU_SET (), +.BR CPU_CLR (), +and +.BR CPU_ISSET () +macros were added in glibc 2.3.3. + +.BR CPU_COUNT () +first appeared in glibc 2.6. + +.BR CPU_AND (), +.BR CPU_OR (), +.BR CPU_XOR (), +.BR CPU_EQUAL (), +.BR CPU_ALLOC (), +.BR CPU_ALLOC_SIZE (), +.BR CPU_FREE (), +.BR CPU_ZERO_S (), +.BR CPU_SET_S (), +.BR CPU_CLR_S (), +.BR CPU_ISSET_S (), +.BR CPU_AND_S (), +.BR CPU_OR_S (), +.BR CPU_XOR_S (), +and +.BR CPU_EQUAL_S () +first appeared in glibc 2.7. +.SH "CONFORMING TO" +These interfaces are Linux-specific. +.SH NOTES +To duplicate a CPU set, use +.BR memcpy (3). + +Since CPU sets are bitsets allocated in units of long words, +the actual number of CPUs in a dynamically +allocated CPU set will be rounded up to the next multiple of +.IR "sizeof(unsigned long)" . +An application should consider the contents of these extra bits +to be undefined. + +Notwithstanding the similarity in the names, +note that the constant +.B CPU_SETSIZE +indicates the number of CPUs in the +.I cpu_set_t +data type (thus, it is effectively a count of bits in the bitset), +while the +.I setsize +argument of the +.BR CPU_*_S () +macros is a size in bytes. + +The data types for arguments and return values shown +in the SYNOPSIS are hints what about is expected in each case. +However, since these interfaces are implemented as macros, +the compiler won't necessarily catch all type errors +if you violate the suggestions. +.SH EXAMPLE +The following program demonstrates the use of some of the macros +used for dynamically allocated CPU sets. + +.nf +#define _GNU_SOURCE +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + cpu_set_t *cpusetp; + size_t size; + int num_cpus, cpu; + + if (argc < 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + num_cpus = atoi(argv[1]); + + cpusetp = CPU_ALLOC(num_cpus); + if (cpusetp == NULL) { + perror("CPU_ALLOC"); + exit(EXIT_FAILURE); + } + + size = CPU_ALLOC_SIZE(num_cpus); + + CPU_ZERO_S(size, cpusetp); + for (cpu = 0; cpu < num_cpus; cpu += 2) + CPU_SET_S(cpu, size, cpusetp); + + printf("CPU_COUNT() of set: %d\\n", CPU_COUNT_S(size, cpusetp)); + + CPU_FREE(cpusetp); + exit(EXIT_SUCCESS); +} +.fi +.SH BUGS +On 32-bit platforms with glibc 2.8 and earlier, +.BR CPU_ALLOC () +allocates twice as much space as is required, and +.BR CPU_ALLOC_SIZE () +returns a value twice as large as it should. +This bug should not affect the semantics of a program, +but does result in wasted memory +and less efficient operation of the macros that +operate on dynamically allocated CPU sets. +These bugs are fixed in glibc 2.9. +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=7029 +.SH "SEE ALSO" +.BR sched_setaffinity (2), +.BR pthread_attr_setaffinity_np (3), +.BR pthread_setaffinity_np (3), +.BR cpuset (7) diff --git a/original/man3/CPU_SET_S.3 b/original/man3/CPU_SET_S.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_SET_S.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_XOR.3 b/original/man3/CPU_XOR.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_XOR.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_XOR_S.3 b/original/man3/CPU_XOR_S.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_XOR_S.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_ZERO.3 b/original/man3/CPU_ZERO.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_ZERO.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/CPU_ZERO_S.3 b/original/man3/CPU_ZERO_S.3 new file mode 100644 index 00000000..cdc74d47 --- /dev/null +++ b/original/man3/CPU_ZERO_S.3 @@ -0,0 +1 @@ +.so man3/CPU_SET.3 diff --git a/original/man3/FD_CLR.3 b/original/man3/FD_CLR.3 new file mode 100644 index 00000000..e1778431 --- /dev/null +++ b/original/man3/FD_CLR.3 @@ -0,0 +1 @@ +.so man2/select.2 diff --git a/original/man3/FD_ISSET.3 b/original/man3/FD_ISSET.3 new file mode 100644 index 00000000..e1778431 --- /dev/null +++ b/original/man3/FD_ISSET.3 @@ -0,0 +1 @@ +.so man2/select.2 diff --git a/original/man3/FD_SET.3 b/original/man3/FD_SET.3 new file mode 100644 index 00000000..e1778431 --- /dev/null +++ b/original/man3/FD_SET.3 @@ -0,0 +1 @@ +.so man2/select.2 diff --git a/original/man3/FD_ZERO.3 b/original/man3/FD_ZERO.3 new file mode 100644 index 00000000..e1778431 --- /dev/null +++ b/original/man3/FD_ZERO.3 @@ -0,0 +1 @@ +.so man2/select.2 diff --git a/original/man3/HUGE_VAL.3 b/original/man3/HUGE_VAL.3 new file mode 100644 index 00000000..dd04d2c5 --- /dev/null +++ b/original/man3/HUGE_VAL.3 @@ -0,0 +1 @@ +.so man3/INFINITY.3 diff --git a/original/man3/HUGE_VALF.3 b/original/man3/HUGE_VALF.3 new file mode 100644 index 00000000..dd04d2c5 --- /dev/null +++ b/original/man3/HUGE_VALF.3 @@ -0,0 +1 @@ +.so man3/INFINITY.3 diff --git a/original/man3/HUGE_VALL.3 b/original/man3/HUGE_VALL.3 new file mode 100644 index 00000000..dd04d2c5 --- /dev/null +++ b/original/man3/HUGE_VALL.3 @@ -0,0 +1 @@ +.so man3/INFINITY.3 diff --git a/original/man3/INFINITY.3 b/original/man3/INFINITY.3 new file mode 100644 index 00000000..7dbf190b --- /dev/null +++ b/original/man3/INFINITY.3 @@ -0,0 +1,94 @@ +.\" Copyright 2004 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. +.\" +.TH INFINITY 3 2007-07-26 "" "Linux Programmer's Manual" +.SH NAME +INFINITY, NAN, HUGE_VAL, HUGE_VALF, HUGE_VALL \- floating-point constants +.SH SYNOPSIS +.nf +.B #define _ISOC99_SOURCE +.br +.B #include +.sp +.B INFINITY +.sp +.B NAN +.sp +.B HUGE_VAL +.br +.B HUGE_VALF +.br +.B HUGE_VALL +.fi +.SH DESCRIPTION +The macro +.B INFINITY +expands to a \fIfloat\fP constant representing positive infinity. + +The macro +.B NAN +expands to a \fIfloat\fP constant representing a quiet NaN +(when supported). +A +.I quiet +NaN is a NaN ("not-a-number") that does not raise exceptions +when it is used in arithmetic. +The opposite is a +.I signaling +NaN. +See IEC 60559:1989. + +The macros +.BR HUGE_VAL , +.BR HUGE_VALF , +.B HUGE_VALL +expand to constants of types \fIdouble\fP, \fIfloat\fP +and \fIlong double\fP, respectively, +that represent a large positive value, possibly plus infinity. +.SH "CONFORMING TO" +C99. +.SH AVAILABILITY +On a glibc system, the macro +.B HUGE_VAL +is always available. +Availability of the +.B NAN +macro can be tested using +.BR "#ifdef NAN" , +and similarly for +.BR INFINITY , +.BR HUGE_VALF , +.BR HUGE_VALL . +They will be defined by +.I +if +.B _ISOC99_SOURCE +or +.B _GNU_SOURCE +is defined, or +.B __STDC_VERSION__ +is defined +and has a value not less than 199901L. +.SH "SEE ALSO" +.BR fpclassify (3), +.BR feature_test_macros (7), +.BR math_error (7) diff --git a/original/man3/MB_CUR_MAX.3 b/original/man3/MB_CUR_MAX.3 new file mode 100644 index 00000000..c7b8b6de --- /dev/null +++ b/original/man3/MB_CUR_MAX.3 @@ -0,0 +1,41 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" Modified, aeb, 990824 +.\" +.TH MB_CUR_MAX 3 1999-07-04 "Linux" "Linux Programmer's Manual" +.SH NAME +MB_CUR_MAX \- maximum length of a multibyte character in the current locale +.SH SYNOPSIS +.nf +.B #include +.fi +.SH DESCRIPTION +The +.B MB_CUR_MAX +macro defines an integer expression giving +the maximum number of bytes needed to represent a single +wide character in the current locale. +It is locale dependent and therefore not a compile-time constant. +.SH "RETURN VALUE" +An integer in the range [1, +.BR MB_LEN_MAX ]. +The value 1 denotes traditional 8-bit encoded characters. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR MB_LEN_MAX (3), +.BR mblen (3), +.BR mbstowcs (3), +.BR mbtowc (3), +.BR wcstombs (3), +.BR wctomb (3) diff --git a/original/man3/MB_LEN_MAX.3 b/original/man3/MB_LEN_MAX.3 new file mode 100644 index 00000000..a7942c9a --- /dev/null +++ b/original/man3/MB_LEN_MAX.3 @@ -0,0 +1,43 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" Modified, aeb, 990824 +.\" +.TH MB_LEN_MAX 3 1999-07-04 "Linux" "Linux Programmer's Manual" +.SH NAME +MB_LEN_MAX \- maximum multibyte length of a character across all locales +.SH SYNOPSIS +.nf +.B #include +.fi +.SH DESCRIPTION +The +.B MB_LEN_MAX +macro is the upper bound for the number of bytes needed to represent a single +wide character, across all locales. +.SH "RETURN VALUE" +A constant integer greater than zero. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH NOTES +The entities +.B MB_LEN_MAX +and +.I sizeof(wchar_t) +are totally unrelated. +In glibc, +.B MB_LEN_MAX +is typically 6 while +.I sizeof(wchar_t) +is 4. +.SH "SEE ALSO" +.BR MB_CUR_MAX (3) diff --git a/original/man3/NAN.3 b/original/man3/NAN.3 new file mode 100644 index 00000000..dd04d2c5 --- /dev/null +++ b/original/man3/NAN.3 @@ -0,0 +1 @@ +.so man3/INFINITY.3 diff --git a/original/man3/__fbufsize.3 b/original/man3/__fbufsize.3 new file mode 100644 index 00000000..fb0e7c0d --- /dev/null +++ b/original/man3/__fbufsize.3 @@ -0,0 +1 @@ +.so man3/stdio_ext.3 diff --git a/original/man3/__flbf.3 b/original/man3/__flbf.3 new file mode 100644 index 00000000..fb0e7c0d --- /dev/null +++ b/original/man3/__flbf.3 @@ -0,0 +1 @@ +.so man3/stdio_ext.3 diff --git a/original/man3/__fpending.3 b/original/man3/__fpending.3 new file mode 100644 index 00000000..fb0e7c0d --- /dev/null +++ b/original/man3/__fpending.3 @@ -0,0 +1 @@ +.so man3/stdio_ext.3 diff --git a/original/man3/__fpurge.3 b/original/man3/__fpurge.3 new file mode 100644 index 00000000..d7cfd497 --- /dev/null +++ b/original/man3/__fpurge.3 @@ -0,0 +1 @@ +.so man3/fpurge.3 diff --git a/original/man3/__freadable.3 b/original/man3/__freadable.3 new file mode 100644 index 00000000..fb0e7c0d --- /dev/null +++ b/original/man3/__freadable.3 @@ -0,0 +1 @@ +.so man3/stdio_ext.3 diff --git a/original/man3/__freading.3 b/original/man3/__freading.3 new file mode 100644 index 00000000..fb0e7c0d --- /dev/null +++ b/original/man3/__freading.3 @@ -0,0 +1 @@ +.so man3/stdio_ext.3 diff --git a/original/man3/__fsetlocking.3 b/original/man3/__fsetlocking.3 new file mode 100644 index 00000000..fb0e7c0d --- /dev/null +++ b/original/man3/__fsetlocking.3 @@ -0,0 +1 @@ +.so man3/stdio_ext.3 diff --git a/original/man3/__fwritable.3 b/original/man3/__fwritable.3 new file mode 100644 index 00000000..fb0e7c0d --- /dev/null +++ b/original/man3/__fwritable.3 @@ -0,0 +1 @@ +.so man3/stdio_ext.3 diff --git a/original/man3/__fwriting.3 b/original/man3/__fwriting.3 new file mode 100644 index 00000000..fb0e7c0d --- /dev/null +++ b/original/man3/__fwriting.3 @@ -0,0 +1 @@ +.so man3/stdio_ext.3 diff --git a/original/man3/__malloc_hook.3 b/original/man3/__malloc_hook.3 new file mode 100644 index 00000000..421aafcb --- /dev/null +++ b/original/man3/__malloc_hook.3 @@ -0,0 +1 @@ +.so man3/malloc_hook.3 diff --git a/original/man3/__setfpucw.3 b/original/man3/__setfpucw.3 new file mode 100644 index 00000000..5435e93e --- /dev/null +++ b/original/man3/__setfpucw.3 @@ -0,0 +1,60 @@ +.\" Written Sat Mar 8 10:35:08 MEZ 1997 by +.\" J. "MUFTI" Scheurich (mufti@csv.ica.uni-stuttgart.de) +.\" This page is licensed under the GNU General Public License +.\" +.TH __SETFPUCW 3 1997-03-08 "Linux" "Linux Programmer's Manual" +.SH NAME +__setfpucw \- set FPU control word on i386 architecture (obsolete) +.SH SYNOPSIS +.B #include +.sp +.BI "void __setfpucw(unsigned short " control_word ); +.SH DESCRIPTION +.BR __setfpucw () +transfers +.I control_word +to the registers of the FPU (floating-point unit) on the i386 architecture. +This was used to control floating-point precision, +rounding and floating-point exceptions. +.SH CONFORMING TO +This function was a nonstandard GNU extension. +.SH NOTES +As of glibc 2.1 this function does not exist anymore. +There are new functions from C99, with prototypes in +.IR , +to control FPU rounding modes, like +.IR fegetround , +.IR fesetround , +and the floating-point environment, like +.IR fegetenv , +.IR feholdexcept , +.IR fesetenv , +.I feupdateenv +and FPU exception handling, like +.IR feclearexcept , +.IR fegetexceptflag , +.IR feraiseexcept , +.IR fesetexceptflag , +.IR fetestexcept . +.PP +If direct access to the FPU control word is still needed, the +.B _FPU_GETCW +and +.B _FPU_SETCW +macros from +.I +can be used. +.SH EXAMPLE +.B __setfpucw(0x1372) + +Set FPU control word on the i386 architecture to +.br + \- extended precision +.br + \- rounding to nearest +.br + \- exceptions on overflow, zero divide and NaN +.SH "SEE ALSO" +.BR feclearexcept (3) +.br +.I diff --git a/original/man3/_flushlbf.3 b/original/man3/_flushlbf.3 new file mode 100644 index 00000000..fb0e7c0d --- /dev/null +++ b/original/man3/_flushlbf.3 @@ -0,0 +1 @@ +.so man3/stdio_ext.3 diff --git a/original/man3/a64l.3 b/original/man3/a64l.3 new file mode 100644 index 00000000..dbcb8971 --- /dev/null +++ b/original/man3/a64l.3 @@ -0,0 +1,78 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Corrected, aeb, 2002-05-30 +.\" +.TH A64L 3 2007-07-26 "" "Linux Programmer's Manual" +.SH NAME +a64l, l64a \- convert between long and base-64 +.SH SYNOPSIS +.B #include +.sp +.BI "long a64l(char *" str64 ); +.sp +.BI "char *l64a(long " value ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR a64l (), +.BR l64a (): +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +These functions provide a conversion between 32-bit long integers +and little-endian base-64 ASCII strings (of length zero to six). +If the string used as argument for +.BR a64l () +has length greater than six, only the first six bytes are used. +If the type +.I long +has more than 32 bits, then +.BR l64a () +uses only the low order 32 bits of +.IR value , +and +.BR a64l () +sign-extends its 32-bit result. +.LP +The 64 digits in the base-64 system are: +.RS +.nf + +\&\(aq.\(aq represents a 0 +\&\(aq/\(aq represents a 1 +0-9 represent 2-11 +A-Z represent 12-37 +a-z represent 38-63 + +.fi +.RE +So 123 = 59*64^0 + 1*64^1 = "v/". +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +The value returned by +.BR a64l () +may be a pointer to a static buffer, possibly overwritten +by later calls. +.LP +The behavior of +.BR l64a () +is undefined when +.I value +is negative. +If +.I value +is zero, it returns an empty string. +.LP +These functions are broken in glibc before 2.2.5 +(puts most significant digit first). +.LP +This is not the encoding used by +.BR uuencode (1). +.SH "SEE ALSO" +.BR uuencode (1), +.\" .BR itoa (3), +.BR strtoul (3) diff --git a/original/man3/abort.3 b/original/man3/abort.3 new file mode 100644 index 00000000..9de707bf --- /dev/null +++ b/original/man3/abort.3 @@ -0,0 +1,77 @@ +.\" Copyright 2007 (C) Michael Kerrisk +.\" some parts 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 Sat Jul 24 21:46:21 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Aug 4 10:51:53 2000 - patch from Joseph S. Myers +.\" 2007-12-15, mtk, Mostly rewritten +.\" +.TH ABORT 3 2007-12-15 "GNU" "Linux Programmer's Manual" +.SH NAME +abort \- cause abnormal process termination +.SH SYNOPSIS +.nf +.B #include +.sp +.B void abort(void); +.fi +.SH DESCRIPTION +The +.BR abort () +first unblocks the +.B SIGABRT +signal, and then raises that signal for the calling process. +This results in the abnormal termination of the process unless the +.B SIGABRT +signal is caught and the signal handler does not return +(see +.BR longjmp (3)). +.PP +If the +.BR abort () +function causes process termination, +all open streams are closed and flushed. +.PP +If the +.B SIGABRT +signal is ignored, or caught by a handler that returns, the +.BR abort () +function will still terminate the process. +It does this by restoring the default disposition for +.B SIGABRT +and then raising the signal for a second time. +.SH "RETURN VALUE" +The +.BR abort () +function never returns. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001, 4.3BSD, C89, C99. +.SH "SEE ALSO" +.BR gdb (1), +.BR sigaction (2), +.BR exit (3), +.BR longjmp (3), +.BR raise (3) diff --git a/original/man3/abs.3 b/original/man3/abs.3 new file mode 100644 index 00000000..ab21f9d3 --- /dev/null +++ b/original/man3/abs.3 @@ -0,0 +1,122 @@ +.\" 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 Mon Mar 29 22:31:13 1993, David Metcalfe +.\" Modified Sun Jun 6 23:27:50 1993, David Metcalfe +.\" 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 +.\" +.TH ABS 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +abs, labs, llabs, imaxabs \- compute the absolute value of an integer +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int abs(int " j ); +.br +.BI "long int labs(long int " j ); +.br +.BI "long long int llabs(long long int " j ); +.sp +.B #include +.sp +.BI "intmax_t imaxabs(intmax_t " j ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR llabs (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.SH DESCRIPTION +The +.BR abs () +function computes the absolute value of the integer +argument \fIj\fP. +The +.BR labs (), +.BR llabs () +and +.BR imaxabs () +functions compute the absolute value of the argument \fIj\fP of the +appropriate integer type for the function. +.SH "RETURN VALUE" +Returns the absolute value of the integer argument, of the appropriate +integer type for the function. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001, 4.3BSD, C99. +.\" POSIX.1 (1996 edition) only requires the +.\" .BR abs () +.\" function. +C89 only +includes the +.BR abs () +and +.BR labs () +functions; the functions +.BR llabs () +and +.BR imaxabs () +were added in C99. +.SH NOTES +Trying to take the absolute value of the most negative integer +is not defined. +.PP +The +.BR llabs () +function is included in glibc since version 2.0, but +is not in libc5 or libc4. +The +.BR imaxabs () +function is included in +glibc since version 2.1.1. +.PP +For +.BR llabs () +to be declared, it may be necessary to define +\fB_ISOC99_SOURCE\fP or \fB_ISOC9X_SOURCE\fP (depending on the +version of glibc) before including any standard headers. +.PP +GCC handles +.BR abs () +and +.BR labs () +as built-in functions. +GCC 3.0 also handles +.BR llabs () +and +.BR imaxabs () +as built-ins. +.SH "SEE ALSO" +.BR cabs (3), +.BR ceil (3), +.BR fabs (3), +.BR floor (3), +.BR rint (3) diff --git a/original/man3/acos.3 b/original/man3/acos.3 new file mode 100644 index 00000000..39c74912 --- /dev/null +++ b/original/man3/acos.3 @@ -0,0 +1,116 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-07-25 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH ACOS 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +acos, acosf, acosl \- arc cosine function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double acos(double " x ); +.BI "float acosf(float " x ); +.BI "long double acosl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR acosf (), +.BR acosl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR acos () +function calculates the arc cosine of \fIx\fP; that is +the value whose cosine is \fIx\fP. +.SH "RETURN VALUE" +On success, these functions return the arc cosine of +.IR x +in radians; the return value is in the range [0,\ pi]. + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is +1, ++0 is returned. + +If +.I x +is positive infinity or negative infinity, +a domain error occurs, +and a NaN is returned. + +If +.I x +is outside the range [\-1,\ 1], +a domain error occurs, +and a NaN is returned. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is outside the range [\-1,\ 1] +.I errno +is set to +.BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR asin (3), +.BR atan (3), +.BR atan2 (3), +.BR cacos (3), +.BR cos (3), +.BR sin (3), +.BR tan (3) diff --git a/original/man3/acosf.3 b/original/man3/acosf.3 new file mode 100644 index 00000000..66104f71 --- /dev/null +++ b/original/man3/acosf.3 @@ -0,0 +1 @@ +.so man3/acos.3 diff --git a/original/man3/acosh.3 b/original/man3/acosh.3 new file mode 100644 index 00000000..31e43851 --- /dev/null +++ b/original/man3/acosh.3 @@ -0,0 +1,117 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-07-25 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH ACOSH 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +acosh, acoshf, acoshl \- inverse hyperbolic cosine function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double acosh(double " x ); +.br +.BI "float acoshf(float " x ); +.br +.BI "long double acoshl(long double " x ); +.sp +.fi +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR acosh (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR acoshf (), +.BR acoshl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR acosh () +function calculates the inverse hyperbolic cosine of +\fIx\fP; that is the value whose hyperbolic cosine is \fIx\fP. +.SH "RETURN VALUE" +On success, these functions return the inverse hyperbolic cosine of +.IR x . + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is +1, +0 is returned. + +If +.I x +is positive infinity, positive infinity is returned. + +If +.I x +is less than 1, +a domain error occurs, +and the functions return a NaN. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is less than 1 +.I errno +is set to +.BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR asinh (3), +.BR atanh (3), +.BR cacosh (3), +.BR cosh (3), +.BR sinh (3), +.BR tanh (3) diff --git a/original/man3/acoshf.3 b/original/man3/acoshf.3 new file mode 100644 index 00000000..f0f5c7a0 --- /dev/null +++ b/original/man3/acoshf.3 @@ -0,0 +1 @@ +.so man3/acosh.3 diff --git a/original/man3/acoshl.3 b/original/man3/acoshl.3 new file mode 100644 index 00000000..f0f5c7a0 --- /dev/null +++ b/original/man3/acoshl.3 @@ -0,0 +1 @@ +.so man3/acosh.3 diff --git a/original/man3/acosl.3 b/original/man3/acosl.3 new file mode 100644 index 00000000..66104f71 --- /dev/null +++ b/original/man3/acosl.3 @@ -0,0 +1 @@ +.so man3/acos.3 diff --git a/original/man3/addmntent.3 b/original/man3/addmntent.3 new file mode 100644 index 00000000..3c2bb35c --- /dev/null +++ b/original/man3/addmntent.3 @@ -0,0 +1 @@ +.so man3/getmntent.3 diff --git a/original/man3/addseverity.3 b/original/man3/addseverity.3 new file mode 100644 index 00000000..d51b1601 --- /dev/null +++ b/original/man3/addseverity.3 @@ -0,0 +1,68 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" adapted glibc info page +.\" +.\" polished a little, aeb +.TH ADDSEVERITY 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.SH NAME +addseverity \- introduce new severity classes +.SH SYNOPSIS +.nf +.sp +.B #include +.sp +.BI "int addseverity(int " severity ", const char *" s ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR addseverity (): +_SVID_SOURCE +.SH DESCRIPTION +This function allows the introduction of new severity classes +which can be addressed by the +.I severity +argument of the +.BR fmtmsg (3) +function. +By default that latter function only knows how to +print messages for severity 0-4 (with strings (none), HALT, +ERROR, WARNING, INFO). +This call attaches the given string +.I s +to the given value +.IR severity . +If +.I s +is NULL, the severity class with the numeric value +.I severity +is removed. +It is not possible to overwrite or remove one of the default +severity classes. +The severity value must be nonnegative. +.SH "RETURN VALUE" +Upon success, the value +.B MM_OK +is returned. +Upon error, the return value is +.BR MM_NOTOK . +Possible errors include: out of memory, attempt to remove a +nonexistent or default severity class. +.SH VERSIONS +.BR addseverity () +is provided in glibc since version 2.1. +.SH "CONFORMING TO" +This function is not specified in the X/Open Portability Guide +although the +.BR fmtmsg (3) +function is. +It is available on System V +systems. +.SH NOTES +New severity classes can also be added by setting the environment variable +.BR SEV_LEVEL . +.SH "SEE ALSO" +.BR fmtmsg (3) diff --git a/original/man3/adjtime.3 b/original/man3/adjtime.3 new file mode 100644 index 00000000..72434fc6 --- /dev/null +++ b/original/man3/adjtime.3 @@ -0,0 +1,142 @@ +.\" Copyright (c) 2006 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. +.\" +.TH ADJTIME 3 2008-06-22 "Linux" "Linux Programmer's Manual" +.SH NAME +adjtime \- correct the time to synchronize the system clock +.SH SYNOPSIS +.nf +.BI "int adjtime(const struct timeval *" delta ", struct timeval *" olddelta ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR adjtime (): +_BSD_SOURCE +.SH DESCRIPTION +The +.BR adjtime () +function gradually adjusts the system clock (as returned by +.BR gettimeofday (2)). +The amount of time by which the clock is to be adjusted is specified +in the structure pointed to by +.IR delta . +This structure has the following form: +.in +4n +.nf + +struct timeval { + time_t tv_sec; /* seconds */ + suseconds_t tv_usec; /* microseconds */ +}; +.fi +.in +.PP +If the adjustment in +.I delta +is positive, then the system clock is speeded up by some +small percentage (i.e., by adding a small +amount of time to the clock value in each second) until the adjustment +has been completed. +If the adjustment in +.I delta +is negative, then the clock is slowed down in a similar fashion. + +If a clock adjustment from an earlier +.BR adjtime () +call is already in progress +at the time of a later +.BR adjtime () +call, and +.I delta +is not NULL for the later call, then the earlier adjustment is stopped, +but any already completed part of that adjustment is not undone. + +If +.I olddelta +is not NULL, then the buffer that it points to is used to return +the amount of time remaining from any previous adjustment that +has not yet been completed. +.SH "RETURN VALUE" +On success, +.BR adjtime () +returns 0. On failure, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +The adjustment in +.I delta +is outside the permitted range. +.TP +.B EPERM +The caller does not have sufficient privilege to adjust the time. +Under Linux the +.B CAP_SYS_TIME +capability is required. +.SH CONFORMING TO +4.3BSD, System V. +.SH NOTES +The adjustment that +.BR adjtime () +makes to the clock is carried out in such a manner that the clock +is always monotonically increasing. +Using +.BR adjtime () +to adjust the time prevents the problems that can be caused for certain +applications (e.g., +.BR make (1)) +by abrupt positive or negative jumps in the system time. + +.BR adjtime () +is intended to be used to make small adjustments to the system time. +Most systems impose a limit on the adjustment that can be specified in +.IR delta . +In the glibc implementation, +.I delta +must be less than or equal to (INT_MAX / 1000000 \- 2) +and greater than or equal to (INT_MIN / 1000000 + 2) +(respectively 2145 and \-2145 seconds on i386). +.SH BUGS +A longstanding bug +.\" http://sourceware.org/bugzilla/show_bug?id=2449 +.\" http://bugzilla.kernel.org/show_bug.cgi?id=6761 +meant that if +.I delta +was specified as NULL, +no valid information about the outstanding clock adjustment was returned in +.IR olddelta . +(In this circumstance, +.BR adjtime () +should return the outstanding clock adjustment, without changing it.) +This bug is fixed +.\" Thanks to the new adjtimex() ADJ_OFFSET_SS_READ flag +on systems with glibc 2.8 or later and +Linux kernel 2.6.26 or later. +.SH "SEE ALSO" +.BR adjtimex (2), +.BR gettimeofday (2), +.BR time (7) diff --git a/original/man3/aio_cancel.3 b/original/man3/aio_cancel.3 new file mode 100644 index 00000000..0bf26915 --- /dev/null +++ b/original/man3/aio_cancel.3 @@ -0,0 +1,92 @@ +.\" 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. +.\" +.TH AIO_CANCEL 3 2003-11-14 "" "Linux Programmer's Manual" +.SH NAME +aio_cancel \- cancel an outstanding asynchronous I/O request +.SH SYNOPSIS +.B "#include " +.sp +.BI "int aio_cancel(int " fd ", struct aiocb *" aiocbp ); +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +The +.BR aio_cancel () +function attempts to cancel outstanding asynchronous I/O requests +for the file descriptor +.IR fd . +If +.I aiocbp +is NULL, all such requests are canceled. +Otherwise, only the request +described by the control block pointed to by +.I aiocbp +is canceled. +.LP +Normal asynchronous notification occurs for canceled requests. +The request return status is set to \-1, and the request error status +is set to +.BR ECANCELED . +The control block of requests that cannot be canceled is not changed. +.LP +If +.I aiocbp +is not NULL, and +.I fd +differs from the file descriptor with which the asynchronous operation +was initiated, unspecified results occur. +.LP +Which operations are cancellable is implementation-defined. +.\" FreeBSD: not those on raw disk devices. +.SH "RETURN VALUE" +This function returns +.B AIO_CANCELED +if all requests were successfully +canceled. +It returns +.B AIO_NOTCANCELED +when at least one of the +requests specified was not canceled because it was in progress. +In this case one may check the status of individual requests using +.BR aio_error (3). +This function returns +.B AIO_ALLDONE +when all requests had +been completed already before this call. +When some error occurs, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +.I fd +is not a valid file descriptor. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH "SEE ALSO" +.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/original/man3/aio_error.3 b/original/man3/aio_error.3 new file mode 100644 index 00000000..fcc3833d --- /dev/null +++ b/original/man3/aio_error.3 @@ -0,0 +1,74 @@ +.\" 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. +.\" +.TH AIO_ERROR 3 2003-11-14 "" "Linux Programmer's Manual" +.SH NAME +aio_error \- get error status of asynchronous I/O operation +.SH SYNOPSIS +.B "#include " +.sp +.BI "int aio_error(const struct aiocb *" aiocbp ); +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +The +.BR aio_error () +function returns the error status for the asynchronous I/O request +with control block pointed to by +.IR aiocbp . +.SH "RETURN VALUE" +This function returns +.B EINPROGRESS +if the request has not been +completed yet. +It returns +.B ECANCELED +if the request was canceled. +It returns 0 if the request completed successfully. +Otherwise an error value is returned, the same value that would have +been stored in the +.I errno +variable in case of a synchronous +.IR read , +.IR write , +.IR fsync , +or +.I fdatasync +request. +On error, the error value is returned. +.SH ERRORS +.TP +.B EINVAL +.I aiocbp +does not point at a control block for an asynchronous I/O request +of which the return status (see +.BR aio_return (3)) +has not been retrieved yet. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH "SEE ALSO" +.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/original/man3/aio_fsync.3 b/original/man3/aio_fsync.3 new file mode 100644 index 00000000..cd9afc9d --- /dev/null +++ b/original/man3/aio_fsync.3 @@ -0,0 +1,94 @@ +.\" 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. +.\" +.TH AIO_FSYNC 3 2003-11-14 "" "Linux Programmer's Manual" +.SH NAME +aio_fsync \- asynchronous file synchronization +.SH SYNOPSIS +.B "#include " +.sp +.BI "int aio_fsync(int " op ", struct aiocb *" aiocbp ); +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +The +.BR aio_fsync () +function does a sync on all outstanding asynchronous I/O operations +associated with +.IR aiocbp\->aio_fildes . +.LP +More precisely, if +.I op +is +.BR O_SYNC , +then all currently queued I/O operations shall be +completed as if by a call of +.BR fsync (2), +and if +.I op +is +.BR O_DSYNC , +this call is the asynchronous analog of +.BR fdatasync (2). +Note that this is a request only \(em this call does not wait +for I/O completion. +.LP +Apart from +.I aio_fildes +the only field in the structure pointed to by +.I aiocbp +that is used by this call is the +.I aio_sigevent +field (a \fIstruct sigevent\fP) that indicates the desired type of +asynchronous notification at completion. +All other fields are ignored. +.SH "RETURN VALUE" +On success (the sync request was successfully queued) +this function returns 0. +On error \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EAGAIN +Out of resources. +.TP +.B EBADF +.I aio_fildes +is not a valid file descriptor open for writing. +.TP +.B EINVAL +No synchronized I/O for this file is supported, or +.I op +is not +.B O_SYNC +or +.BR O_DSYNC . +.SH "CONFORMING TO" +POSIX.1-2001. +.SH "SEE ALSO" +.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/original/man3/aio_read.3 b/original/man3/aio_read.3 new file mode 100644 index 00000000..1757c472 --- /dev/null +++ b/original/man3/aio_read.3 @@ -0,0 +1,123 @@ +.\" 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. +.\" +.TH AIO_READ 3 2003-11-14 "" "Linux Programmer's Manual" +.SH NAME +aio_read \- asynchronous read +.SH SYNOPSIS +.B "#include " +.sp +.BI "int aio_read(struct aiocb *" aiocbp ); +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +The +.BR aio_read () +function requests an asynchronous "n = read(fd, buf, count)" +with fd, buf, count given by +.IR aiocbp\->aio_fildes , +.IR aiocbp\->aio_buf , +.IR aiocbp\->aio_nbytes , +respectively. +The return status n can be retrieved upon completion using +.BR aio_return (3). +.LP +The data is read starting at the absolute file offset +.IR aiocbp\->aio_offset , +regardless of the current file position. +After this request, +the value of the current file position is unspecified. +.LP +The "asynchronous" means that this call returns as soon as the +request has been enqueued; the read may or may not have completed +when the call returns. +One tests for completion using +.BR aio_error (3). +.LP +If +.B _POSIX_PRIORITIZED_IO +is defined, and this file supports it, +then the asynchronous operation is submitted at a priority equal +to that of the calling process minus +.IR aiocbp\->aio_reqprio . +.LP +The field +.I aiocbp\->aio_lio_opcode +is ignored. +.LP +No data is read from a regular file beyond its maximum offset. +.SH "RETURN VALUE" +On success, 0 is returned. +On error the request is not enqueued, \-1 +is returned, and +.I errno +is set appropriately. +If an error is first detected later, it will +be reported via +.BR aio_return (3) +(returns status \-1) and +.BR aio_error (3) +(error status whatever one would have gotten in +.IR errno , +such as +.BR EBADF ). +.SH ERRORS +.TP +.B EAGAIN +Out of resources. +.TP +.B EBADF +.I aio_fildes +is not a valid file descriptor open for reading. +.TP +.B EINVAL +One or more of +.IR aio_offset , +.IR aio_reqprio , +.I aio_nbytes +are invalid. +.TP +.B ENOSYS +This function is not supported. +.TP +.B EOVERFLOW +The file is a regular file, we start reading before end-of-file +and want at least one byte, but the starting position is past +the maximum offset for this file. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +It is a good idea to zero out the control block before use. +This control block must not be changed while the read operation +is in progress. +The buffer area being read into +.\" or the control block of the operation +must not be accessed during the operation or undefined results may +occur. +The memory areas involved must remain valid. +.SH "SEE ALSO" +.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/original/man3/aio_return.3 b/original/man3/aio_return.3 new file mode 100644 index 00000000..076798a0 --- /dev/null +++ b/original/man3/aio_return.3 @@ -0,0 +1,67 @@ +.\" 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. +.\" +.TH AIO_RETURN 3 2003-11-14 "" "Linux Programmer's Manual" +.SH NAME +aio_return \- get return status of asynchronous I/O operation +.SH SYNOPSIS +.B "#include " +.sp +.BI "ssize_t aio_return(struct aiocb *" aiocbp ); +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +The +.BR aio_return () +function returns the final return status for the asynchronous I/O request +with control block pointed to by +.IR aiocbp . +.LP +This function should be called only once for any given request, after +.BR aio_error (3) +returns something other than +.BR EINPROGRESS . +.SH "RETURN VALUE" +If the asynchronous I/O operation has completed, this function returns +the value that would have been returned in case of a synchronous +.IR read , +.IR write , +or +.I fsync +request. +Otherwise the return value is undefined. +On error, the error value is returned. +.SH ERRORS +.TP +.B EINVAL +.I aiocbp +does not point at a control block for an asynchronous I/O request +of which the return status has not been retrieved yet. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH "SEE ALSO" +.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/original/man3/aio_suspend.3 b/original/man3/aio_suspend.3 new file mode 100644 index 00000000..988419bf --- /dev/null +++ b/original/man3/aio_suspend.3 @@ -0,0 +1,90 @@ +.\" 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. +.\" +.TH AIO_SUSPEND 3 2003-11-14 "" "Linux Programmer's Manual" +.SH NAME +aio_suspend \- wait for asynchronous I/O operation or timeout +.SH SYNOPSIS +.nf +.sp +.B "#include " +.sp +.BI "int aio_suspend(const struct aiocb * const " cblist [], +.br +.BI " int " n ", const struct timespec *" timeout ); +.sp +Link with \fI\-lrt\fP. +.fi +.SH DESCRIPTION +The +.BR aio_suspend () +function suspends the calling process until at least one of the +asynchronous I/O requests in the list +.I cblist +of length +.I n +have completed, a signal is delivered, or +.I timeout +is not NULL and the time interval it indicates has passed. +.LP +Each item in the list must either be NULL (and then is ignored), +or a pointer to a control block on which I/O was initiated using +.BR aio_read (3), +.BR aio_write (3), +or +.BR lio_listio (3). +.LP +If +.B CLOCK_MONOTONIC +is supported, this clock is used to measure +the timeout interval. +.SH "RETURN VALUE" +If this function returns after completion of one of the indicated +requests, it returns 0. +Otherwise it returns \-1 and sets +.I errno +appropriately. +.SH ERRORS +.TP +.B EAGAIN +The call was ended by timeout, before any of the indicated operations +had completed. +.TP +.B EINTR +The call was ended by signal; see +.BR signal (7). +(Possibly the completion signal of one of the operations we were +waiting for.) +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +One can achieve polling by using a non-NULL +.I timeout +that specifies a zero time interval. +.SH "SEE ALSO" +.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/original/man3/aio_write.3 b/original/man3/aio_write.3 new file mode 100644 index 00000000..76088611 --- /dev/null +++ b/original/man3/aio_write.3 @@ -0,0 +1,127 @@ +.\" 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. +.\" +.TH AIO_WRITE 3 2003-11-14 "" "Linux Programmer's Manual" +.SH NAME +aio_write \- asynchronous write +.SH SYNOPSIS +.B "#include " +.sp +.BI "int aio_write(struct aiocb *" aiocbp ); +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +The +.BR aio_write () +function requests an asynchronous "n = write(fd, buf, count)" +with fd, buf, count given by +.IR aiocbp\->aio_fildes , +.IR aiocbp\->aio_buf , +.IR aiocbp\->aio_nbytes , +respectively. +The return status n can be retrieved upon completion using +.BR aio_return (3). +.LP +If +.B O_APPEND +is not set, the data is written starting at the +absolute file offset +.IR aiocbp\->aio_offset , +regardless of the current file position. +If +.B O_APPEND +is set, the data is written at the end of the file. +After this request, the value of the current file position is unspecified. +.LP +The "asynchronous" means that this call returns as soon as the +request has been enqueued; the write may or may not have completed +when the call returns. +One tests for completion using +.BR aio_error (3). +.LP +If +.B _POSIX_PRIORITIZED_IO +is defined, and this file supports it, +then the asynchronous operation is submitted at a priority equal +to that of the calling process minus +.IR aiocbp\->aio_reqprio . +.LP +The field +.I aiocbp\->aio_lio_opcode +is ignored. +.LP +No data is written to a regular file beyond its maximum offset. +.SH "RETURN VALUE" +On success, 0 is returned. +On error the request is not enqueued, \-1 +is returned, and +.I errno +is set appropriately. +If an error is first detected later, it will +be reported via +.BR aio_return (3) +(returns status \-1) and +.BR aio_error (3) +(error status whatever one would have gotten in +.IR errno , +such as +.BR EBADF ). +.SH ERRORS +.TP +.B EAGAIN +Out of resources. +.TP +.B EBADF +.I aio_fildes +is not a valid file descriptor open for writing. +.TP +.B EFBIG +The file is a regular file, we want to write at least one byte, +but the starting position is at or beyond the maximum offset for this file. +.TP +.B EINVAL +One or more of +.IR aio_offset , +.IR aio_reqprio , +.I aio_nbytes +are invalid. +.TP +.B ENOSYS +This function is not supported. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +It is a good idea to zero out the control block before use. +This control block must not be changed while the write operation +is in progress. +The buffer area being written out +.\" or the control block of the operation +must not be accessed during the operation or undefined results may +occur. +The memory areas involved must remain valid. +.SH "SEE ALSO" +.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/original/man3/alloca.3 b/original/man3/alloca.3 new file mode 100644 index 00000000..2d105555 --- /dev/null +++ b/original/man3/alloca.3 @@ -0,0 +1,152 @@ +.\" Copyright (c) 1980, 1991 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. +.\" +.\" @(#)alloca.3 5.1 (Berkeley) 5/2/91 +.\" +.\" Converted Mon Nov 29 11:05:55 1993 by Rik Faith +.\" Modified Tue Oct 22 23:41:56 1996 by Eric S. Raymond +.\" Modified 2002-07-17, aeb +.\" 2008-01-24, mtk: +.\" Various rewrites and additions (notes on longjmp() and SIGSEGV). +.\" Weaken warning against use of alloca() (as per Debian bug 461100). +.\" +.TH ALLOCA 3 2008-01-24 "GNU" "Linux Programmer's Manual" +.SH NAME +alloca \- allocate memory that is automatically freed +.SH SYNOPSIS +.B #include +.sp +.BI "void *alloca(size_t " size ); +.SH DESCRIPTION +The +.BR alloca () +function allocates +.I size +bytes of space in the stack frame of the caller. +This temporary space is +automatically freed when the function that called +.BR alloca () +returns to its caller. +.SH "RETURN VALUE" +The +.BR alloca () +function returns a pointer to the beginning of the allocated space. +If the allocation causes stack overflow, program behavior is undefined. +.SH "CONFORMING TO" +This function is not in POSIX.1-2001. + +There is evidence that the +.BR alloca () +function appeared in 32V, PWB, PWB.2, 3BSD, and 4BSD. +There is a man page for it in 4.3BSD. +Linux uses the GNU version. +.SH NOTES +The +.BR alloca () +function is machine- and compiler-dependent. +For certain applications, +its use can improve efficiency compared to the use of +.BR malloc (3) +plus +.BR free (3). +In certain cases, +it can also simplify memory deallocation in applications that use +.BR longjmp (3) +or +.BR siglongjmp (3). +Otherwise, its use is discouraged. + +Because the space allocated by +.BR alloca () +is allocated within the stack frame, +that space is automatically freed if the function return +is jumped over by a call to +.BR longjmp (3) +or +.BR siglongjmp (3). + +Do not attempt to +.BR free (3) +space allocated by +.BR alloca ()! +.SS Notes on the GNU Version +Normally, +.BR gcc (1) +translates calls to +.BR alloca () +with inlined code. +This is not done when either the +.IR "\-ansi" , +.IR "\-std=c89" , +.IR "\-std=c99" , +or the +.IR "\-fno\-builtin" +option is given +(and the header +.I +is not included). +But beware! +By default the glibc version of +.I +includes +.I +and that contains the line: +.nf + + #define alloca(size) __builtin_alloca (size) + +.fi +with messy consequences if one has a private version of this function. +.LP +The fact that the code is inlined means that it is impossible +to take the address of this function, or to change its behavior +by linking with a different library. +.LP +The inlined code often consists of a single instruction adjusting +the stack pointer, and does not check for stack overflow. +Thus, there is no NULL error return. +.SH BUGS +There is no error indication if the stack frame cannot be extended. +(However, after a failed allocation, the program is likely to receive a +.B SIGSEGV +signal if it attempts to access the unallocated space.) + +On many systems +.BR alloca () +cannot be used inside the list of arguments of a function call, because +the stack space reserved by +.BR alloca () +would appear on the stack in the middle of the space for the +function arguments. +.SH "SEE ALSO" +.BR brk (2), +.BR longjmp (3), +.BR malloc (3) diff --git a/original/man3/alphasort.3 b/original/man3/alphasort.3 new file mode 100644 index 00000000..7e757c7a --- /dev/null +++ b/original/man3/alphasort.3 @@ -0,0 +1 @@ +.so man3/scandir.3 diff --git a/original/man3/argz.3 b/original/man3/argz.3 new file mode 100644 index 00000000..25a6e267 --- /dev/null +++ b/original/man3/argz.3 @@ -0,0 +1 @@ +.so man3/argz_add.3 diff --git a/original/man3/argz_add.3 b/original/man3/argz_add.3 new file mode 100644 index 00000000..a30878e8 --- /dev/null +++ b/original/man3/argz_add.3 @@ -0,0 +1,205 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" based on the description in glibc source and infopages +.\" +.\" Corrections and additions, aeb +.TH ARGZ_ADD 3 2007-05-18 "" "Linux Programmer's Manual" +.SH NAME +argz_add, argz_add_sep, argz_append, argz_count, argz_create, +argz_create_sep, argz_delete, argz_extract, argz_insert, +argz_next, argz_replace, argz_stringify \- functions to handle an argz list +.SH SYNOPSIS +.nf +.B "#include " +.sp +.BI "error_t argz_add(char **" argz ", size_t *" argz_len \ +", const char *" str ); +.sp +.BI "error_t argz_add_sep(char **" argz ", size_t *" argz_len , +.ti 20n +.BI "const char *" str ", int " delim ); +.sp +.BI "error_t argz_append(char **" argz ", size_t *" argz_len , +.ti 20n +.BI "const char *" buf ", size_t " buf_len ); +.sp +.BI "size_t argz_count(const char *" argz ", size_t " argz_len ); +.sp +.BI "error_t argz_create(char * const " argv "[], char **" argz , +.ti 20n +.BI "size_t *" argz_len ); +.sp +.BI "error_t argz_create_sep(const char *" str ", int " sep ", char **" argz , +.ti 20n +.BI "size_t *" argz_len ); +.sp +.BI "error_t argz_delete(char **" argz ", size_t *" argz_len ", char *" entry ); +.sp +.BI "void argz_extract(char *" argz ", size_t " argz_len ", char **" argv ); +.sp +.BI "error_t argz_insert(char **" argz ", size_t *" argz_len ", char *" before , +.ti 20n +.BI "const char *" entry ); +.sp +.BI "char *argz_next(char *" argz ", size_t " argz_len ", const char *" entry ); +.sp +.BI "error_t argz_replace(char **" argz ", size_t *" argz_len \ +", const char *" str , +.ti 20n +.BI "const char *" with ", unsigned int *" replace_count ); +.sp +.BI "void argz_stringify(char *" argz ", size_t " len ", int " sep ); +.fi +.SH DESCRIPTION +These functions are glibc-specific. +.LP +An argz vector is a pointer to a character buffer together with a length. +The intended interpretation of the character buffer is an array +of strings, where the strings are separated by null bytes (\(aq\\0\(aq). +If the length is nonzero, the last byte of the buffer must be a null byte. +.LP +These functions are for handling argz vectors. +The pair (NULL,0) is an argz vector, and, conversely, +argz vectors of length 0 must have NULL pointer. +Allocation of nonempty argz vectors is done using +.BR malloc (3), +so that +.BR free (3) +can be used to dispose of them again. +.LP +.BR argz_add () +adds the string +.I str +at the end of the array +.IR *argz , +and updates +.I *argz +and +.IR *argz_len . +.LP +.BR argz_add_sep () +is similar, but splits the string +.I str +into substrings separated by the delimiter +.IR delim . +For example, one might use this on a Unix search path with +delimiter \(aq:\(aq. +.LP +.BR argz_append () +appends the argz vector +.RI ( buf ,\ buf_len ) +after +.RI ( *argz ,\ *argz_len ) +and updates +.IR *argz +and +.IR *argz_len . +(Thus, +.I *argz_len +will be increased by +.IR buf_len .) +.LP +.BR argz_count () +counts the number of strings, that is, +the number of null bytes (\(aq\\0\(aq), in +.RI ( argz ,\ argz_len ). +.LP +.BR argz_create () +converts a Unix-style argument vector +.IR argv , +terminated by +.IR "(char *) 0" , +into an argz vector +.RI ( *argz ,\ *argz_len ). +.LP +.BR argz_create_sep () +converts the null-terminated string +.I str +into an argz vector +.RI ( *argz ,\ *argz_len ) +by breaking it up at every occurrence of the separator +.IR sep . +.LP +.BR argz_delete () +removes the substring pointed to by +.I entry +from the argz vector +.RI ( *argz ,\ *argz_len ) +and updates +.I *argz +and +.IR *argz_len . +.LP +.BR argz_extract () +is the opposite of +.BR argz_create (). +It takes the argz vector +.RI ( argz ,\ argz_len ) +and fills the array starting at +.I argv +with pointers to the substrings, and a final NULL, +making a Unix-style argv vector. +The array +.I argv +must have room for +.IR argz_count ( argz , argz_len ") + 1" +pointers. +.LP +.BR argz_insert () +is the opposite of +.BR argz_delete (). +It inserts the argument +.I entry +at position +.I before +into the argz vector +.RI ( *argz ,\ *argz_len ) +and updates +.I *argz +and +.IR *argz_len . +If +.I before +is NULL, then +.I entry +will inserted at the end. +.LP +.BR argz_next () +is a function to step trough the argz vector. +If +.I entry +is NULL, the first entry is returned. +Otherwise, the entry +following is returned. +It returns NULL if there is no following entry. +.LP +.BR argz_replace () +replaces each occurrence of +.I str +with +.IR with , +reallocating argz as necessary. +If +.I replace_count +is non-NULL, +.I *replace_count +will be incremented by the number of replacements. +.LP +.BR argz_stringify () +is the opposite of +.BR argz_create_sep (). +It transforms the argz vector into a normal string by replacing +all null bytes (\(aq\\0\(aq) except the last by +.IR sep . +.SH "RETURN VALUE" +All argz functions that do memory allocation have a return type of +\fIerror_t\fP, and return 0 for success, and \fBENOMEM\fP +if an allocation error occurs. +.SH CONFORMING TO +These functions are a GNU extension. +Handle with care. +.SH BUGS +Argz vectors without a terminating null byte may lead to +Segmentation Faults. +.SH "SEE ALSO" +.BR envz_add (3) diff --git a/original/man3/argz_add_sep.3 b/original/man3/argz_add_sep.3 new file mode 100644 index 00000000..25a6e267 --- /dev/null +++ b/original/man3/argz_add_sep.3 @@ -0,0 +1 @@ +.so man3/argz_add.3 diff --git a/original/man3/argz_append.3 b/original/man3/argz_append.3 new file mode 100644 index 00000000..25a6e267 --- /dev/null +++ b/original/man3/argz_append.3 @@ -0,0 +1 @@ +.so man3/argz_add.3 diff --git a/original/man3/argz_count.3 b/original/man3/argz_count.3 new file mode 100644 index 00000000..25a6e267 --- /dev/null +++ b/original/man3/argz_count.3 @@ -0,0 +1 @@ +.so man3/argz_add.3 diff --git a/original/man3/argz_create.3 b/original/man3/argz_create.3 new file mode 100644 index 00000000..25a6e267 --- /dev/null +++ b/original/man3/argz_create.3 @@ -0,0 +1 @@ +.so man3/argz_add.3 diff --git a/original/man3/argz_create_sep.3 b/original/man3/argz_create_sep.3 new file mode 100644 index 00000000..25a6e267 --- /dev/null +++ b/original/man3/argz_create_sep.3 @@ -0,0 +1 @@ +.so man3/argz_add.3 diff --git a/original/man3/argz_delete.3 b/original/man3/argz_delete.3 new file mode 100644 index 00000000..25a6e267 --- /dev/null +++ b/original/man3/argz_delete.3 @@ -0,0 +1 @@ +.so man3/argz_add.3 diff --git a/original/man3/argz_extract.3 b/original/man3/argz_extract.3 new file mode 100644 index 00000000..25a6e267 --- /dev/null +++ b/original/man3/argz_extract.3 @@ -0,0 +1 @@ +.so man3/argz_add.3 diff --git a/original/man3/argz_insert.3 b/original/man3/argz_insert.3 new file mode 100644 index 00000000..25a6e267 --- /dev/null +++ b/original/man3/argz_insert.3 @@ -0,0 +1 @@ +.so man3/argz_add.3 diff --git a/original/man3/argz_next.3 b/original/man3/argz_next.3 new file mode 100644 index 00000000..25a6e267 --- /dev/null +++ b/original/man3/argz_next.3 @@ -0,0 +1 @@ +.so man3/argz_add.3 diff --git a/original/man3/argz_replace.3 b/original/man3/argz_replace.3 new file mode 100644 index 00000000..25a6e267 --- /dev/null +++ b/original/man3/argz_replace.3 @@ -0,0 +1 @@ +.so man3/argz_add.3 diff --git a/original/man3/argz_stringify.3 b/original/man3/argz_stringify.3 new file mode 100644 index 00000000..25a6e267 --- /dev/null +++ b/original/man3/argz_stringify.3 @@ -0,0 +1 @@ +.so man3/argz_add.3 diff --git a/original/man3/asctime.3 b/original/man3/asctime.3 new file mode 100644 index 00000000..84a3baa9 --- /dev/null +++ b/original/man3/asctime.3 @@ -0,0 +1 @@ +.so man3/ctime.3 diff --git a/original/man3/asctime_r.3 b/original/man3/asctime_r.3 new file mode 100644 index 00000000..84a3baa9 --- /dev/null +++ b/original/man3/asctime_r.3 @@ -0,0 +1 @@ +.so man3/ctime.3 diff --git a/original/man3/asin.3 b/original/man3/asin.3 new file mode 100644 index 00000000..ea2ad4d7 --- /dev/null +++ b/original/man3/asin.3 @@ -0,0 +1,115 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-07-25 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH ASIN 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +asin, asinf, asinl \- arc sine function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double asin(double " x ); +.br +.BI "float asinf(float " x ); +.br +.BI "long double asinl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR asinf (), +.BR asinl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR asin () +function calculates the principal value of the arc sine of \fIx\fP; +that is the value whose sine is \fIx\fP. +.SH "RETURN VALUE" +On success, these functions return the principal value of the arc sine of +.IR x +in radians; the return value is in the range [\-pi/2,\ pi/2]. + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is +0 (\-0), ++0 (\-0) is returned. + +If +.I x +is outside the range [\-1,\ 1], +a domain error occurs, +and a NaN is returned. +.\" +.\" POSIX.1-2001 documents an optional range error for subnormal x; +.\" glibc 2.8 does not do this. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is outside the range [\-1,\ 1] +.I errno +is set to +.BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR acos (3), +.BR atan (3), +.BR atan2 (3), +.BR casin (3), +.BR cos (3), +.BR sin (3), +.BR tan (3) diff --git a/original/man3/asinf.3 b/original/man3/asinf.3 new file mode 100644 index 00000000..4c88df08 --- /dev/null +++ b/original/man3/asinf.3 @@ -0,0 +1 @@ +.so man3/asin.3 diff --git a/original/man3/asinh.3 b/original/man3/asinh.3 new file mode 100644 index 00000000..be8cc302 --- /dev/null +++ b/original/man3/asinh.3 @@ -0,0 +1,102 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.TH ASINH 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.SH NAME +asinh, asinhf, asinhl \- inverse hyperbolic sine function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double asinh(double " x ); +.br +.BI "float asinhf(float " x ); +.br +.BI "long double asinhl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR asinh (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR asinhf (), +.BR asinhl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR asinh () +function calculates the inverse hyperbolic sine of +\fIx\fP; that is the value whose hyperbolic sine is \fIx\fP. +.SH "RETURN VALUE" +On success, these functions return the inverse hyperbolic sine of +.IR x . + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is +0 (\-0), +0 (\-0) is returned. + +If +.I x +is positive infinity (negative infinity), +positive infinity (negative infinity) is returned. +.\" +.\" POSIX.1-2001 documents an optional range error for subnormal x; +.\" glibc 2.8 does not do this. +.SH ERRORS +No errors occur. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR acosh (3), +.BR atanh (3), +.BR casinh (3), +.BR cosh (3), +.BR sinh (3), +.BR tanh (3) diff --git a/original/man3/asinhf.3 b/original/man3/asinhf.3 new file mode 100644 index 00000000..93c50342 --- /dev/null +++ b/original/man3/asinhf.3 @@ -0,0 +1 @@ +.so man3/asinh.3 diff --git a/original/man3/asinhl.3 b/original/man3/asinhl.3 new file mode 100644 index 00000000..93c50342 --- /dev/null +++ b/original/man3/asinhl.3 @@ -0,0 +1 @@ +.so man3/asinh.3 diff --git a/original/man3/asinl.3 b/original/man3/asinl.3 new file mode 100644 index 00000000..4c88df08 --- /dev/null +++ b/original/man3/asinl.3 @@ -0,0 +1 @@ +.so man3/asin.3 diff --git a/original/man3/asprintf.3 b/original/man3/asprintf.3 new file mode 100644 index 00000000..0f3cb14b --- /dev/null +++ b/original/man3/asprintf.3 @@ -0,0 +1,69 @@ +.\" 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. +.\" +.\" Text fragments inspired by Martin Schulze . +.\" +.TH ASPRINTF 3 2001-12-18 "GNU" "Linux Programmer's Manual" +.SH NAME +asprintf, vasprintf \- print to allocated string +.SH SYNOPSIS +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int asprintf(char **" strp ", const char *" fmt ", ...);" +.sp +.BI "int vasprintf(char **" strp ", const char *" fmt ", va_list " ap ); +.SH DESCRIPTION +The functions +.BR asprintf () +and +.BR vasprintf () +are analogs of +.BR sprintf (3) +and +.BR vsprintf (3), +except that they allocate a string large enough to hold the output +including the terminating null byte, +and return a pointer to it via the first argument. +This pointer should be passed to +.BR free (3) +to release the allocated storage when it is no longer needed. +.SH "RETURN VALUE" +When successful, these functions return the number of bytes printed, +just like +.BR sprintf (3). +If memory allocation wasn't possible, or some other error occurs, +these functions will return \-1, and the contents of +.I strp +is undefined. +.SH CONFORMING TO +These functions are GNU extensions, not in C or POSIX. +They are also available under *BSD. +The FreeBSD implementation sets +.I strp +to NULL on error. +.SH "SEE ALSO" +.BR free (3), +.BR malloc (3), +.BR printf (3), +.BR feature_test_macros (7) diff --git a/original/man3/assert.3 b/original/man3/assert.3 new file mode 100644 index 00000000..73596e97 --- /dev/null +++ b/original/man3/assert.3 @@ -0,0 +1,77 @@ +.\" 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 21:42:42 1993 by Rik Faith +.\" Modified Tue Oct 22 23:44:11 1996 by Eric S. Raymond +.TH ASSERT 3 2002-08-25 "GNU" "Linux Programmer's Manual" +.SH NAME +assert \- abort the program if assertion is false +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void assert(scalar " expression ); +.fi +.SH DESCRIPTION +If the macro +.B NDEBUG +was defined at the moment +.I +was last included, the macro +.BR assert () +generates no code, and hence does nothing at all. +Otherwise, the macro +.BR assert () +prints an error message to standard error and terminates the program +by calling +.BR abort (3) +if +.I expression +is false (i.e., compares equal to zero). +.LP +The purpose of this macro is to help the programmer find bugs in +his program. +The message "assertion failed in file foo.c, function +do_bar(), line 1287" is of no help at all to a user. +.SH "RETURN VALUE" +No value is returned. +.SH "CONFORMING TO" +POSIX.1-2001, C89, C99. +In C89, +.I expression +is required to be of type +.I int +and undefined behavior results if it is not, but in C99 +it may have any scalar type. +.\" See Defect Report 107 for more details. +.SH BUGS +.BR assert () +is implemented as a macro; if the expression tested has side-effects, +program behavior will be different depending on whether +.B NDEBUG +is defined. +This may create Heisenbugs which go away when debugging +is turned on. +.SH "SEE ALSO" +.BR abort (3), +.BR assert_perror (3), +.BR exit (3) diff --git a/original/man3/assert_perror.3 b/original/man3/assert_perror.3 new file mode 100644 index 00000000..94ca31f2 --- /dev/null +++ b/original/man3/assert_perror.3 @@ -0,0 +1,74 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.\" +.TH ASSERT_PERROR 3 2002-08-25 "GNU" "Linux Programmer's Manual" +.SH NAME +assert_perror \- test errnum and abort +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "void assert_perror(int " errnum ); +.fi +.SH DESCRIPTION +If the macro +.B NDEBUG +was defined at the moment +.I +was last included, the macro +.BR assert_perror () +generates no code, and hence does nothing at all. +Otherwise, the macro +.BR assert_perror () +prints an error message to standard error and terminates the program +by calling +.BR abort (3) +if +.I errnum +is nonzero. +The message contains the filename, function name and +line number of the macro call, and the output of +.IR strerror(errnum) . +.SH "RETURN VALUE" +No value is returned. +.SH "CONFORMING TO" +This is a GNU extension. +.SH BUGS +The purpose of the assert macros is to help the programmer find bugs in +his program, things that cannot happen unless there was a coding mistake. +However, with system or library calls the situation is rather different, +and error returns can happen, and will happen, and should be tested for. +Not by an assert, where the test goes away when +.B NDEBUG +is defined, +but by proper error handling code. +Never use this macro. +.SH "SEE ALSO" +.BR abort (3), +.BR assert (3), +.BR exit (3), +.BR strerror (3), +.BR feature_test_macros (7) diff --git a/original/man3/atan.3 b/original/man3/atan.3 new file mode 100644 index 00000000..dbfd0dd5 --- /dev/null +++ b/original/man3/atan.3 @@ -0,0 +1,101 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.TH ATAN 3 2008-12-02 "" "Linux Programmer's Manual" +.SH NAME +atan, atanf, atanl \- arc tangent function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double atan(double " x ); +.br +.BI "float atanf(float " x ); +.br +.BI "long double atanl( long double " x ); +.sp +.fi +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR atanf (), +.BR atanl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR atan () +function calculates the principal value of the arc tangent of \fIx\fP; +that is the value whose tangent is \fIx\fP. +.SH "RETURN VALUE" +On success, these functions return the principal value of the arc tangent of +.IR x +in radians; the return value is in the range [\-pi/2,\ pi/2]. + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is +0 (\-0), ++0 (\-0) is returned. + +If +.I x +is positive infinity (negative infinity), +pi/2 (\-pi/2) is returned. +.\" +.\" POSIX.1-2001 documents an optional range error for subnormal x; +.\" glibc 2.8 does not do this. +.SH ERRORS +No errors occur. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR acos (3), +.BR asin (3), +.BR atan2 (3), +.BR carg (3), +.BR catan (3), +.BR cos (3), +.BR sin (3), +.BR tan (3) diff --git a/original/man3/atan2.3 b/original/man3/atan2.3 new file mode 100644 index 00000000..fcdc2e13 --- /dev/null +++ b/original/man3/atan2.3 @@ -0,0 +1,172 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.TH ATAN2 3 2008-11-20 "" "Linux Programmer's Manual" +.SH NAME +atan2, atan2f, atan2l \- arc tangent function of two variables +.SH SYNOPSIS +.nf +.B #include + +.BI "double atan2(double " y ", double " x ); +.BI "float atan2f(float " y ", float " x ); +.BI "long double atan2l(long double " y ", long double " x ); + +.fi +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR atan2f (), +.BR atan2l (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR atan2 () +function calculates the principal value of the arc tangent of +.IR y/x , +using the signs of the two arguments to determine +the quadrant of the result. +.SH "RETURN VALUE" +On success, these functions return the principal value of the arc tangent of +.IR y/x +in radians; the return value is in the range [\-pi,\ pi]. + +If +.I y +is +0 (\-0) and +.I x +is less than 0, +pi (\-pi) is returned. + +If +.I y +is +0 (\-0) and +.I x +is greater than 0, +0 (\-0) is returned. + +If +.I y +is less than 0 and +.I x +is +0 or \-0, \-pi/2 is returned. + +If +.I y +is greater than 0 and +.I x +is +0 or \-0, pi/2 is returned. + +.\" POSIX.1 says: +.\" If +.\" .I x +.\" is 0, a pole error shall not occur. +.\" +If either +.I x +or +.I y +is NaN, a NaN is returned. + +.\" POSIX.1 says: +.\" If the result underflows, a range error may occur and +.\" .I y/x +.\" should be returned. +.\" +If +.I y +is +0 (\-0) and +.I x +is \-0, +pi (\-pi) is returned. + +If +.I y +is +0 (\-0) and +.I x +is +0, +0 (\-0) is returned. + +If +.I y +is a finite value greater (less) than 0, and +.I x +is negative infinity, +pi (\-pi) is returned. + +If +.I y +is a finite value greater (less) than 0, and +.I x +is positive infinity, +0 (\-0) is returned. + +If +.I y +is positive infinity (negative infinity), and +.I x +is finite, +pi/2 (\-pi/2) is returned. + +If +.I y +is positive infinity (negative infinity) and +.I x +is negative infinity, +3*pi/4 (-3*pi/4) is returned. + +If +.I y +is positive infinity (negative infinity) and +.I x +is positive infinity, +pi/4 (-pi/4) is returned. +.\" +.\" POSIX.1 says: +.\" If both arguments are 0, a domain error shall not occur. +.SH ERRORS +No errors occur. +.\" POSIX.1 documents an optional underflow error +.\" glibc 2.8 does not do this. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR acos (3), +.BR asin (3), +.BR atan (3), +.BR carg (3), +.BR cos (3), +.BR sin (3), +.BR tan (3) diff --git a/original/man3/atan2f.3 b/original/man3/atan2f.3 new file mode 100644 index 00000000..e445b12b --- /dev/null +++ b/original/man3/atan2f.3 @@ -0,0 +1 @@ +.so man3/atan2.3 diff --git a/original/man3/atan2l.3 b/original/man3/atan2l.3 new file mode 100644 index 00000000..e445b12b --- /dev/null +++ b/original/man3/atan2l.3 @@ -0,0 +1 @@ +.so man3/atan2.3 diff --git a/original/man3/atanf.3 b/original/man3/atanf.3 new file mode 100644 index 00000000..784b32ab --- /dev/null +++ b/original/man3/atanf.3 @@ -0,0 +1 @@ +.so man3/atan.3 diff --git a/original/man3/atanh.3 b/original/man3/atanh.3 new file mode 100644 index 00000000..6e8be430 --- /dev/null +++ b/original/man3/atanh.3 @@ -0,0 +1,148 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.TH ATANH 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +atanh, atanhf, atanhl \- inverse hyperbolic tangent function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double atanh(double " x ); +.br +.BI "float atanhf(float " x ); +.br +.BI "long double atanhl(long double " x ); +.sp +.fi +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR atanh (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR atanhf (), +.BR atanhl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR atanh () +function calculates the inverse hyperbolic tangent of +\fIx\fP; that is the value whose hyperbolic tangent is \fIx\fP. +.SH "RETURN VALUE" +On success, these functions return the inverse hyperbolic tangent of +.IR x . + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is +0 (\-0), +0 (\-0) is returned. + +If +.I x +is +1 or \-1, +a pole error occurs, +and the functions return +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +respectively, with the mathematically correct sign. + +If the absolute value of +.I x +is greater than 1, +a domain error occurs, +and a NaN is returned. +.\" +.\" POSIX.1-2001 documents an optional range error for subnormal x; +.\" glibc 2.8 does not do this. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP less than \-1 or greater than +1 +.I errno +is set to +.BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.TP +Pole error: \fIx\fP is +1 or \-1 +.I errno +is set to +.BR ERANGE +(but see BUGS). +.\" FIXME . glibc actually gives EDOM for this case +A divide-by-zero floating-point exception +.RB ( FE_DIVBYZERO ) +is raised. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH BUGS +For a pole error, +.\" +.\" FIXME . this is as at glibc 2.8; check later if this bug is fixed +.\" This can be seen in sysdeps/ieee754/k_standard.c +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6759 +.I errno +is set to +.BR EDOM ; +POSIX.1 says it should be set to +.BR ERANGE . +.SH "SEE ALSO" +.BR acosh (3), +.BR asinh (3), +.BR catanh (3), +.BR cosh (3), +.BR sinh (3), +.BR tanh (3) diff --git a/original/man3/atanhf.3 b/original/man3/atanhf.3 new file mode 100644 index 00000000..225a3392 --- /dev/null +++ b/original/man3/atanhf.3 @@ -0,0 +1 @@ +.so man3/atanh.3 diff --git a/original/man3/atanhl.3 b/original/man3/atanhl.3 new file mode 100644 index 00000000..225a3392 --- /dev/null +++ b/original/man3/atanhl.3 @@ -0,0 +1 @@ +.so man3/atanh.3 diff --git a/original/man3/atanl.3 b/original/man3/atanl.3 new file mode 100644 index 00000000..784b32ab --- /dev/null +++ b/original/man3/atanl.3 @@ -0,0 +1 @@ +.so man3/atan.3 diff --git a/original/man3/atexit.3 b/original/man3/atexit.3 new file mode 100644 index 00000000..115cd6c1 --- /dev/null +++ b/original/man3/atexit.3 @@ -0,0 +1,159 @@ +.\" 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-07-24, Rik Faith (faith@cs.unc.edu) +.\" Modified 2003-10-25, Walter Harms +.\" +.TH ATEXIT 3 2008-12-05 "Linux" "Linux Programmer's Manual" +.SH NAME +atexit \- register a function to be called at normal process termination +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int atexit(void (*" function )(void)); +.fi +.SH DESCRIPTION +The +.BR atexit () +function registers the given \fIfunction\fP to be +called at normal process termination, either via +.BR exit (3) +or via return from the program's \fImain\fP(). +Functions so registered are called in +the reverse order of their registration; no arguments are passed. + +The same function may be registered multiple times: +it is called once for each registration. +.LP +POSIX.1-2001 requires that an implementation allow at least +.B ATEXIT_MAX +(32) such functions to be registered. +The actual limit supported by an implementation can be obtained using +.BR sysconf (3). +.LP +When a child process is created via +.BR fork (2), +it inherits copies of its parent's registrations. +Upon a successful call to one of the +.BR exec (3) +functions, +all registrations are removed. +.SH "RETURN VALUE" +The +.BR atexit () +function returns the value 0 if successful; otherwise +it returns a nonzero value. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.SH NOTES +Functions registered using +.BR atexit () +(and +.BR on_exit (3)) +are not called if a process terminates abnormally because +of the delivery of a signal. + +If one of the functions registered functions calls +.BR _exit (2), +then any remaining functions are not invoked, +and the other process termination steps performed by +.BR exit (3) +are not performed. + +POSIX.1-2001 says that the result of calling +.BR exit (3) +more than once (i.e., calling +.BR exit (3) +within a function registered using +.BR atexit (3)) +is undefined. +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. +portable programs should not invoke +.BR exit (3) +inside a function registered using +.BR atexit (3). + +The +.BR atexit () +and +.BR on_exit (3) +functions register functions on the same list: +at normal process termination, +the registered functions are invoked in reverse order +of their registration by these two functions. + +POSIX.1-2001 says that the result is undefined if +.BR longjmp (3) +is used to terminate execution of one of the functions registered +.BR atexit (). +.\" In glibc, things seem to be handled okay +.SS "Linux Notes" +Since glibc 2.2.3, +.BR atexit () +(and +.BR on_exit (3)) +can be used within a shared library to establish functions +that are called when the shared library is unloaded. +.SH EXAMPLE +.nf +#include +#include +#include + +void +bye(void) +{ + printf("That was all, folks\en"); +} + +int +main(void) +{ + long a; + int i; + + a = sysconf(_SC_ATEXIT_MAX); + printf("ATEXIT_MAX = %ld\en", a); + + i = atexit(bye); + if (i != 0) { + fprintf(stderr, "cannot set exit function\en"); + exit(EXIT_FAILURE); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR _exit (2), +.BR exit (3), +.BR on_exit (3) diff --git a/original/man3/atof.3 b/original/man3/atof.3 new file mode 100644 index 00000000..f5f53ea7 --- /dev/null +++ b/original/man3/atof.3 @@ -0,0 +1,62 @@ +.\" 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 Mon Mar 29 22:39:24 1993, David Metcalfe +.\" Modified Sat Jul 24 21:39:22 1993, Rik Faith (faith@cs.unc.edu) +.TH ATOF 3 1993-03-29 "GNU" "Linux Programmer's Manual" +.SH NAME +atof \- convert a string to a double +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double atof(const char *" nptr ); +.fi +.SH DESCRIPTION +The +.BR atof () +function converts the initial portion of the string +pointed to by \fInptr\fP to +.IR double . +The behavior is the same as +.sp +.in +4n +strtod(nptr, (char **) NULL); +.in +.sp +except that +.BR atof () +does not detect errors. +.SH "RETURN VALUE" +The converted value. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001, 4.3BSD, C89, C99. +.SH "SEE ALSO" +.BR atoi (3), +.BR atol (3), +.BR strtod (3), +.BR strtol (3), +.BR strtoul (3) diff --git a/original/man3/atoi.3 b/original/man3/atoi.3 new file mode 100644 index 00000000..3055ecd3 --- /dev/null +++ b/original/man3/atoi.3 @@ -0,0 +1,110 @@ +.\" 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 Mon Mar 29 22:39:41 1993, David Metcalfe +.\" 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 +.\" +.TH ATOI 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +atoi, atol, atoll, atoq \- convert a string to an integer +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int atoi(const char *" nptr ); +.br +.BI "long atol(const char *" nptr ); +.br +.BI "long long atoll(const char *" nptr ); +.br +.BI "long long atoq(const char *" nptr ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR atoll (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR atoi () +function converts the initial portion of the string +pointed to by \fInptr\fP to +.IR int . +The behavior is the same as +.sp +.in +4n +strtol(nptr, (char **) NULL, 10); +.in +.sp +except that +.BR atoi () +does not detect errors. +.PP +The +.BR atol () +and +.BR atoll () +functions behave the same as +.BR atoi (), +except that they convert the initial portion of the +string to their return type of \fIlong\fP or \fIlong long\fP. +.BR atoq () +is an obsolete name for +.BR atoll (). +.SH "RETURN VALUE" +The converted value. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001, 4.3BSD, C99. +C89 and +POSIX.1-1996 include the functions +.BR atoi () +and +.BR atol () +only. +.BR atoq () +is a GNU extension. +.SH NOTES +The nonstandard +.BR atoq () +function is not present in libc 4.6.27 +or glibc 2, but is present in libc5 and libc 4.7 (though only as an +inline function in \fI\fP until libc 5.4.44). +The +.BR atoll () +function is present in glibc 2 since version 2.0.2, but +not in libc4 or libc5. +.SH "SEE ALSO" +.BR atof (3), +.BR strtod (3), +.BR strtol (3), +.BR strtoul (3) diff --git a/original/man3/atol.3 b/original/man3/atol.3 new file mode 100644 index 00000000..51f084f1 --- /dev/null +++ b/original/man3/atol.3 @@ -0,0 +1 @@ +.so man3/atoi.3 diff --git a/original/man3/atoll.3 b/original/man3/atoll.3 new file mode 100644 index 00000000..51f084f1 --- /dev/null +++ b/original/man3/atoll.3 @@ -0,0 +1 @@ +.so man3/atoi.3 diff --git a/original/man3/atoq.3 b/original/man3/atoq.3 new file mode 100644 index 00000000..51f084f1 --- /dev/null +++ b/original/man3/atoq.3 @@ -0,0 +1 @@ +.so man3/atoi.3 diff --git a/original/man3/auth_destroy.3 b/original/man3/auth_destroy.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/auth_destroy.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/authnone_create.3 b/original/man3/authnone_create.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/authnone_create.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/authunix_create.3 b/original/man3/authunix_create.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/authunix_create.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/authunix_create_default.3 b/original/man3/authunix_create_default.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/authunix_create_default.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/backtrace.3 b/original/man3/backtrace.3 new file mode 100644 index 00000000..7992825d --- /dev/null +++ b/original/man3/backtrace.3 @@ -0,0 +1,251 @@ +.\" Copyright (C) 2007 Michael Kerrisk +.\" drawing on material by Justin Pryzby +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" References: +.\" glibc manual and source +.TH BACKTRACE 3 2008-06-14 GNU "Linux Programmer's Manual" +.SH NAME +backtrace, backtrace_symbols, backtrace_symbols_fd \- support +for application self-debugging +.SH SYNOPSIS +.B #include + +.B int backtrace(void +.BI ** buffer , +.B int +.IB size ); + +.B char **backtrace_symbols(void *const +.BI * buffer , +.B int +.IB size ); + +.B void backtrace_symbols_fd(void *const +.BI * buffer , +.B int +.IB size , +.B int +.IB fd ); +.SH DESCRIPTION +.BR backtrace () +returns a backtrace for the calling program, +in the array pointed to by +.IR buffer . +A backtrace is the series of currently active function calls for +the program. +Each item in the array pointed to by +.I buffer +is of type \fIvoid *\fP, and is the return address from +the corresponding stack frame. +The +.I size +argument specifies the maximum number of addresses +that can be stored in +.IR buffer . +If the backtrace is larger than +.IR size , +then the addresses corresponding to the +.I size +most recent function calls are returned; +to obtain the complete backtrace, make sure that +.I buffer +and +.I size +are large enough. + +Given the set of addresses returned by +.BR backtrace () +in +.IR buffer , +.BR backtrace_symbols () +translates the addresses into an array of strings that describe +the addresses symbolically. +The +.I size +argument specifies the number of addresses in +.IR buffer . +The symbolic representation of each address consists of the function name +(if this can be determined), a hexadecimal offset into the function, +and the actual return address (in hexadecimal). +The address of the array of string pointers is returned +as the function result of +.BR backtrace_symbols (). +This array is +.BR malloc (3)ed +by +.BR backtrace_symbols (), +and must be freed by the caller. +(The strings pointed to by the array of pointers +need not and should not be freed.) + +.BR backtrace_symbols_fd () +takes the same +.I buffer +and +.I size +arguments as +.BR backtrace_symbols (), +but instead of returning an array of strings to the caller, +it writes the strings, one per line, to the file descriptor +.IR fd . +.BR backtrace_symbols_fd () +does not call +.BR malloc (3), +and so can be employed in situations where the latter function might fail. +.SH "RETURN VALUE" +.BR backtrace () +returns the number of addresses returned in +.IR buffer , +which is not greater than +.IR size . +If the return value is less than +.IR size , +then the full backtrace was stored; if it is equal to +.IR size , +then it may have been truncated, in which case the addresses of the +oldest stack frames are not returned. + +On success, +.BR backtrace_symbols () +returns a pointer to the array +.BR malloc (3)ed +by the call; +on error, NULL is returned. +.SH VERSIONS +.BR backtrace (), +.BR backtrace_symbols (), +and +.BR backtrace_symbols_fd () +are provided in glibc since version 2.1. +.SH CONFORMING TO +These functions are GNU extensions. +.SH NOTES +These functions make some assumptions about how a function's return +address is stored on the stack. +Note the following: +.IP * 3 +Omission of the frame pointers (as +implied by any of +.BR gcc (1)'s +nonzero optimization levels) may cause these assumptions to be +violated. +.IP * +Inlined functions do not have stack frames. +.IP * +Tail-call optimization causes one stack frame to replace another. +.PP +The symbol names may be unavailable without the use of special linker +options. +For systems using the GNU linker, it is necessary to use the +.I \-rdynamic +linker option. +Note that names of "static" functions are not exposed, +and won't be available in the backtrace. +.SH EXAMPLE +The program below demonstrates the use of +.BR backtrace () +and +.BR backtrace_symbols (). +The following shell session shows what we might see when running the +program: +.nf +.in +4n + +.RB "$" " cc \-rdynamic prog.c \-o prog" +.RB "$" " ./prog 3" +backtrace() returned 8 addresses +\&./prog(myfunc3+0x5c) [0x80487f0] +\&./prog [0x8048871] +\&./prog(myfunc+0x21) [0x8048894] +\&./prog(myfunc+0x1a) [0x804888d] +\&./prog(myfunc+0x1a) [0x804888d] +\&./prog(main+0x65) [0x80488fb] +\&/lib/libc.so.6(__libc_start_main+0xdc) [0xb7e38f9c] +\&./prog [0x8048711] +.in +.fi +.SS Program source +\& +.nf +#include +#include +#include +#include + +void +myfunc3(void) +{ + int j, nptrs; +#define SIZE 100 + void *buffer[100]; + char **strings; + + nptrs = backtrace(buffer, SIZE); + printf("backtrace() returned %d addresses\\n", nptrs); + + /* The call backtrace_symbols_fd(buffer, nptrs, STDOUT_FILENO) + would produce similar output to the following: */ + + strings = backtrace_symbols(buffer, nptrs); + if (strings == NULL) { + perror("backtrace_symbols"); + exit(EXIT_FAILURE); + } + + for (j = 0; j < nptrs; j++) + printf("%s\\n", strings[j]); + + free(strings); +} + +static void /* "static" means don\(aqt export the symbol... */ +myfunc2(void) +{ + myfunc3(); +} + +void +myfunc(int ncalls) +{ + if (ncalls > 1) + myfunc(ncalls \- 1); + else + myfunc2(); +} + +int +main(int argc, char *argv[]) +{ + if (argc != 2) { + fprintf(stderr, "%s num\-calls\\n", argv[0]); + exit(EXIT_FAILURE); + } + + myfunc(atoi(argv[1])); + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR gcc (1), +.BR ld (1), +.BR dlopen (3), +.BR malloc (3) diff --git a/original/man3/backtrace_symbols.3 b/original/man3/backtrace_symbols.3 new file mode 100644 index 00000000..936a6b9f --- /dev/null +++ b/original/man3/backtrace_symbols.3 @@ -0,0 +1 @@ +.so man3/backtrace.3 diff --git a/original/man3/backtrace_symbols_fd.3 b/original/man3/backtrace_symbols_fd.3 new file mode 100644 index 00000000..936a6b9f --- /dev/null +++ b/original/man3/backtrace_symbols_fd.3 @@ -0,0 +1 @@ +.so man3/backtrace.3 diff --git a/original/man3/basename.3 b/original/man3/basename.3 new file mode 100644 index 00000000..228c2a39 --- /dev/null +++ b/original/man3/basename.3 @@ -0,0 +1,176 @@ +.\" Copyright (c) 2000 by Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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. +.\" Created, 14 Dec 2000 by Michael Kerrisk +.\" +.TH BASENAME 3 2009-03-30 "GNU" "Linux Programmer's Manual" +.SH NAME +basename, dirname \- parse pathname components +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *dirname(char *" path ); + +.BI "char *basename(char *" path ); +.fi +.SH DESCRIPTION +Warning: there are two different functions +.BR basename () +- see below. +.LP +The functions +.BR dirname () +and +.BR basename () +break a null-terminated pathname string into directory +and filename components. +In the usual case, +.BR dirname () +returns the string up to, but not including, the final \(aq/\(aq, and +.BR basename () +returns the component following the final \(aq/\(aq. +Trailing \(aq/\(aq characters are not counted as part of the pathname. +.PP +If +.I path +does not contain a slash, +.BR dirname () +returns the string "." while +.BR basename () +returns a copy of +.IR path . +If +.I path +is the string "/", then both +.BR dirname () +and +.BR basename () +return the string "/". +If +.I path +is a NULL pointer or points to an empty string, then both +.BR dirname () +and +.BR basename () +return the string ".". +.PP +Concatenating the string returned by +.BR dirname (), +a "/", and the string returned by +.BR basename () +yields a complete pathname. +.PP +Both +.BR dirname () +and +.BR basename () +may modify the contents of +.IR path , +so it may be desirable to pass a copy when calling one of +these functions. +.PP +These functions may return pointers to statically allocated memory +which may be overwritten by subsequent calls. +Alternatively, they may return a pointer to some part of +.IR path , +so that the string referred to by +.I path +should not be modified or freed until the pointer returned by +the function is no longer required. +.PP +The following list of examples (taken from SUSv2) +shows the strings returned by +.BR dirname () +and +.BR basename () +for different paths: +.sp +.nf +.B "path dirname basename" +"/usr/lib" "/usr" "lib" +"/usr/" "/" "usr" +"usr" "." "usr" +"/" "/" "/" +"." "." "." +".." "." ".." +.fi +.SH "RETURN VALUE" +Both +.BR dirname () +and +.BR basename () +return pointers to null-terminated strings. +(Do not pass these pointers to +.BR free (3).) +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +There are two different versions of +.BR basename () +- the POSIX version described above, and the GNU version, which one gets +after +.br +.nf + +.B " #define _GNU_SOURCE" +.br +.B " #include " + +.fi +The GNU version never modifies its argument, and returns the +empty string when +.I path +has a trailing slash, and in particular also when it is "/". +There is no GNU version of +.BR dirname (). +.LP +With glibc, one gets the POSIX version of +.BR basename () +when +.I +is included, and the GNU version otherwise. +.SH BUGS +In the glibc implementation of the POSIX versions of these functions +they modify their argument, and segfault when called with a static string +like "/usr/". +Before glibc 2.2.1, the glibc version of +.BR dirname () +did not correctly handle pathnames with trailing \(aq/\(aq characters, +and generated a segfault if given a NULL argument. +.SH EXAMPLE +.in +4n +.nf +char *dirc, *basec, *bname, *dname; +char *path = "/etc/passwd"; + +dirc = strdup(path); +basec = strdup(path); +dname = dirname(dirc); +bname = basename(basec); +printf("dirname=%s, basename=%s\\n", dname, bname); +.fi +.in +.SH "SEE ALSO" +.BR basename (1), +.BR dirname (1), +.BR feature_test_macros (7) diff --git a/original/man3/bcmp.3 b/original/man3/bcmp.3 new file mode 100644 index 00000000..7db8c1b4 --- /dev/null +++ b/original/man3/bcmp.3 @@ -0,0 +1,72 @@ +.\" 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 Sat Jul 24 21:36:50 1993 by Rik Faith +.\" Modified Tue Oct 22 23:47:36 1996 by Eric S. Raymond +.TH BCMP 3 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH NAME +bcmp \- compare byte sequences +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int bcmp(const void *" s1 ", const void *" s2 ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR bcmp () +function compares the two byte sequences +.I s1 +and +.I s2 +of length +.I n +each. +If they are equal, and in particular if +.I n +is zero, +.BR bcmp () +returns 0. +Otherwise it returns a nonzero result. +.SH "RETURN VALUE" +The +.BR bcmp () +function returns 0 if the byte sequences are equal, +otherwise a nonzero result is returned. +.SH "CONFORMING TO" +4.3BSD. +This function is deprecated (marked as LEGACY in POSIX.1-2001): use +.BR memcmp (3) +in new programs. +POSIX.1-2008 removes the specification of +.BR bcmp (). +.SH "SEE ALSO" +.BR memcmp (3), +.BR strcasecmp (3), +.BR strcmp (3), +.BR strcoll (3), +.BR strncasecmp (3), +.BR strncmp (3) diff --git a/original/man3/bcopy.3 b/original/man3/bcopy.3 new file mode 100644 index 00000000..3c87a6c1 --- /dev/null +++ b/original/man3/bcopy.3 @@ -0,0 +1,71 @@ +.\" 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 Sun Feb 26 14:52:00 1995 by Rik Faith +.\" Modified Tue Oct 22 23:48:10 1996 by Eric S. Raymond +.\" " +.TH BCOPY 3 2009-03-15 "Linux" "Linux Programmer's Manual" +.SH NAME +bcopy \- copy byte sequence +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void bcopy(const void *" src ", void *" dest ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR bcopy () +function copies +.I n +bytes from +.I src +to +.IR dest . +The result is correct, even when both areas overlap. +.SH "RETURN VALUE" +None. +.SH "CONFORMING TO" +4.3BSD. +This function is deprecated (marked as LEGACY in POSIX.1-2001): use +.BR memcpy (3) +or +.BR memmove (3) +in new programs. +Note that the first two arguments +are interchanged for +.BR memcpy (3) +and +.BR memmove (3). +POSIX.1-2008 removes the specification of +.BR bcopy (). +.SH "SEE ALSO" +.BR memccpy (3), +.BR memcpy (3), +.BR memmove (3), +.BR strcpy (3), +.BR strncpy (3) diff --git a/original/man3/be16toh.3 b/original/man3/be16toh.3 new file mode 100644 index 00000000..8b7bc771 --- /dev/null +++ b/original/man3/be16toh.3 @@ -0,0 +1 @@ +.so man3/endian.3 diff --git a/original/man3/be32toh.3 b/original/man3/be32toh.3 new file mode 100644 index 00000000..8b7bc771 --- /dev/null +++ b/original/man3/be32toh.3 @@ -0,0 +1 @@ +.so man3/endian.3 diff --git a/original/man3/be64toh.3 b/original/man3/be64toh.3 new file mode 100644 index 00000000..8b7bc771 --- /dev/null +++ b/original/man3/be64toh.3 @@ -0,0 +1 @@ +.so man3/endian.3 diff --git a/original/man3/bindresvport.3 b/original/man3/bindresvport.3 new file mode 100644 index 00000000..d58c33de --- /dev/null +++ b/original/man3/bindresvport.3 @@ -0,0 +1,100 @@ +.\" Copyright (C) 2007, Michael Kerrisk +.\" and 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. +.\" +.\" 2007-05-31, mtk: Rewrite and substantial additional text. +.\" 2008-12-03, mtk: Rewrote some pieces and fixed some errors +.\" +.TH BINDRESVPORT 3 2008-12-03 "" "Linux Programmer's Manual" +.SH NAME +bindresvport \- bind a socket to a privileged IP port +.SH SYNOPSIS +.nf +.B #include +.B #include +.LP +.BI "int bindresvport(int " sockfd ", struct sockaddr_in *" sin ); +.fi +.SH DESCRIPTION +.LP +.BR bindresvport () +is used to bind a socket descriptor to a privileged anonymous IP port, +that is, a port number arbitrarily selected from the range 512 to 1023. +.\" Glibc actually starts searching with a port # in the range 600 to 1023 + +If the +.BR bind (2) +performed by +.BR bindresvport () +is successful, and +.I sin +is not NULL, then +.I sin\->sin_port +returns the port number actually allocated. + +.I sin +can be NULL, in which case +.I sin\->sin_family +is implicitly taken to be +.BR AF_INET . +However, in this case, +.BR bindresvport () +has no way to return the port number actually allocated. +(This information can later be obtained using +.BR getsockname (2).) +.SH RETURN VALUE +.BR bindresvport () +returns 0 on success; otherwise \-1 is returned and +.I errno +set to indicate the cause of the error. +.SH ERRORS +.BR bindresvport () +can fail for any of the same reasons as +.BR bind (2). +In addition, the following errors may occur: +.TP +.BR EACCES +The caller did not have superuser privilege (to be precise: the +.B CAP_NET_BIND_SERVICE +capability is required). +.TP +.B EADDRINUSE +All privileged ports are in use. +.TP +.BR EAFNOSUPPORT " (" EPFNOSUPPORT " in glibc 2.7 and earlier)" +.I sin +is not NULL and +.I sin->sin_family +is not +.BR AF_INET . +.SH "CONFORMING TO" +Not in POSIX.1-2001. +Present on the BSDs, Solaris, and many other systems. +.SH NOTES +Unlike some +.BR bindresvport () +implementations, +the glibc implementation ignores any value that the caller supplies in +.IR sin\->sin_port . +.SH SEE ALSO +.BR bind (2), +.BR getsockname (2) diff --git a/original/man3/bsd_signal.3 b/original/man3/bsd_signal.3 new file mode 100644 index 00000000..4f8065c3 --- /dev/null +++ b/original/man3/bsd_signal.3 @@ -0,0 +1,97 @@ +.\" 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. +.\" +.TH BSD_SIGNAL 3 2009-03-15 "" "Linux Programmer's Manual" +.SH NAME +bsd_signal \- signal handling with BSD semantics +.SH SYNOPSIS +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "sighandler_t bsd_signal(int " signum ", sighandler_t " handler ); +.SH DESCRIPTION +The +.BR bsd_signal () +function takes the same arguments, and performs the same task, as +.BR signal (2). + +The difference between the two is that +.BR bsd_signal () +is guaranteed to provide reliable signal semantics, that is: +a) the disposition of the signal is not reset to the default +when the handler is invoked; +b) delivery of further instances of the signal is blocked while +the signal handler is executing; and +c) if the handler interrupts a blocking system call, +then the system call is automatically restarted. +A portable application cannot rely on +.BR signal (2) +to provide these guarantees. +.SH "RETURN VALUE" +The +.BR bsd_signal () +function returns the previous value of the signal handler, or +.B SIG_ERR +on error. +.SH ERRORS +As for +.BR signal (2). +.SH "CONFORMING TO" +4.2BSD, POSIX.1-2001. +POSIX.1-2008 removes the specification of +.BR bsd_signal (), +recommending the use of +.BR sigaction (2) +instead. +.SH NOTES +Use of +.BR bsd_signal () +should be avoided; use +.BR sigaction (2) +instead. + +On modern Linux systems, +.BR bsd_signal () +and +.BR signal (2) +are equivalent. +But on older systems, +.BR signal (2) +provided unreliable signal semantics; see +.BR signal (2) +for details. + +The use of +.I sighandler_t +is a GNU extension; +this type is only defined if the +.B _GNU_SOURCE +feature test macro is defined. +.SH "SEE ALSO" +.BR sigaction (2), +.BR signal (2), +.BR sysv_signal (3), +.BR feature_test_macros (7), +.BR signal (7) diff --git a/original/man3/bsearch.3 b/original/man3/bsearch.3 new file mode 100644 index 00000000..eca877f2 --- /dev/null +++ b/original/man3/bsearch.3 @@ -0,0 +1,120 @@ +.\" 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 Mon Mar 29 22:41:16 1993, David Metcalfe +.\" Modified Sat Jul 24 21:35:16 1993, Rik Faith (faith@cs.unc.edu) +.TH BSEARCH 3 2003-11-01 "" "Linux Programmer's Manual" +.SH NAME +bsearch \- binary search of a sorted array +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void *bsearch(const void *" key ", const void *" base , +.BI " size_t " nmemb ", size_t " size , +.BI " int (*" compar ")(const void *, const void *));" +.fi +.SH DESCRIPTION +The +.BR bsearch () +function searches an array of \fInmemb\fP objects, +the initial member of which is pointed to by \fIbase\fP, for a member +that matches the object pointed to by \fIkey\fP. +The size of each member +of the array is specified by \fIsize\fP. +.PP +The contents of the array should be in ascending sorted order according +to the comparison function referenced by \fIcompar\fP. +The \fIcompar\fP +routine is expected to have two arguments which point to the \fIkey\fP +object and to an array member, in that order, and should return an integer +less than, equal to, or greater than zero if the \fIkey\fP object is found, +respectively, to be less than, to match, or be greater than the array +member. +.SH "RETURN VALUE" +The +.BR bsearch () +function returns a pointer to a matching member of the +array, or NULL if no match is found. +If there are multiple elements that +match the key, the element returned is unspecified. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001, C89, C99. +.SH EXAMPLE +The example below first sorts an array of structures using +.BR qsort (3), +then retrieves desired elements using +.BR bsearch (). +.sp +.nf +#include +#include +#include + +struct mi { + int nr; + char *name; +} months[] = { + { 1, "jan" }, { 2, "feb" }, { 3, "mar" }, { 4, "apr" }, + { 5, "may" }, { 6, "jun" }, { 7, "jul" }, { 8, "aug" }, + { 9, "sep" }, {10, "oct" }, {11, "nov" }, {12, "dec" } +}; + +#define nr_of_months (sizeof(months)/sizeof(months[0])) + +static int +compmi(const void *m1, const void *m2) +{ + struct mi *mi1 = (struct mi *) m1; + struct mi *mi2 = (struct mi *) m2; + return strcmp(mi1\->name, mi2\->name); +} + +int +main(int argc, char **argv) +{ + int i; + + qsort(months, nr_of_months, sizeof(struct mi), compmi); + for (i = 1; i < argc; i++) { + struct mi key, *res; + key.name = argv[i]; + res = bsearch(&key, months, nr_of_months, + sizeof(struct mi), compmi); + if (res == NULL) + printf("\(aq%s\(aq: unknown month\en", argv[i]); + else + printf("%s: month #%d\en", res\->name, res\->nr); + } + exit(EXIT_SUCCESS); +} +.fi +.\" this example referred to in qsort.3 +.SH "SEE ALSO" +.BR hsearch (3), +.BR lsearch (3), +.BR qsort (3), +.BR tsearch (3) diff --git a/original/man3/bstring.3 b/original/man3/bstring.3 new file mode 100644 index 00000000..ea6298b2 --- /dev/null +++ b/original/man3/bstring.3 @@ -0,0 +1,91 @@ +.\" 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-04-12, David Metcalfe +.\" Modified 1993-07-24, Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-01-20, Walter Harms +.TH BSTRING 3 2002-01-20 "" "Linux Programmer's Manual" +.SH NAME +bcmp, bcopy, bzero, memccpy, memchr, memcmp, memcpy, memfrob, memmem, +memmove, memset \- byte string operations +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int bcmp(const void *" s1 ", const void *" s2 ", int " n ); +.sp +.BI "void bcopy(const void *" src ", void *" dest ", int " n ); +.sp +.BI "void bzero(void *" s ", int " n ); +.sp +.BI "void *memccpy(void *" dest ", const void *" src ", int " c ", size_t " n ); +.sp +.BI "void *memchr(const void *" s ", int " c ", size_t " n ); +.sp +.BI "int memcmp(const void *" s1 ", const void *" s2 ", size_t " n ); +.sp +.BI "void *memcpy(void *" dest ", const void *" src ", size_t " n ); +.sp +.BI "void *memfrob(void *" s ", size_t " n ); +.sp +.BI "void *memmem(const void *" needle ", size_t " needlelen , +.BI " const void *" haystack ", size_t " haystacklen ); +.sp +.BI "void *memmove(void *" dest ", const void *" src ", size_t " n ); +.sp +.BI "void *memset(void *" s ", int " c ", size_t " n ); +.fi +.SH DESCRIPTION +The byte string functions perform operations on strings (byte arrays) +that are not necessarily null-terminated. +See the individual man pages +for descriptions of each function. +.SH NOTES +The functions +.BR bcmp (), +.BR bcopy () +and +.BR bzero () +are obsolete. +Use +.BR memcmp (), +.BR memcpy () +and +.BR memset () +instead. +.\" The old functions are not even available on some non-GNU/Linux systems. +.SH "SEE ALSO" +.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) diff --git a/original/man3/btowc.3 b/original/man3/btowc.3 new file mode 100644 index 00000000..2cd43f81 --- /dev/null +++ b/original/man3/btowc.3 @@ -0,0 +1,66 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH BTOWC 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH NAME +btowc \- convert single byte to wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wint_t btowc(int " c ); +.fi +.SH DESCRIPTION +The +.BR btowc () +function converts \fIc\fP, +interpreted as a multibyte sequence +of length 1, starting in the initial shift state, to a wide character and +returns it. +If \fIc\fP is +.B EOF +or not a valid multibyte sequence of length 1, +the +.BR btowc () +function returns +.BR WEOF . +.SH "RETURN VALUE" +The +.BR btowc () +function returns the wide character +converted from the single byte \fIc\fP. +If \fIc\fP is +.B EOF +or not a valid multibyte sequence of length 1, +it returns +.BR WEOF . +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH NOTES +The behavior of +.BR btowc () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +This function should never be used. +It does not work for encodings which have +state, and unnecessarily treats single bytes differently from multibyte +sequences. +Use the function +.BR mbtowc () +instead. +.SH "SEE ALSO" +.BR wctob (3), +.BR mbtowc (3) diff --git a/original/man3/btree.3 b/original/man3/btree.3 new file mode 100644 index 00000000..0b77e0d4 --- /dev/null +++ b/original/man3/btree.3 @@ -0,0 +1,247 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)btree.3 8.4 (Berkeley) 8/18/94 +.\" +.TH BTREE 3 1994-08-18 "" "Linux Programmer's Manual" +.\".UC 7 +.SH NAME +btree \- btree database access method +.SH SYNOPSIS +.nf +.ft B +#include +#include +.ft R +.fi +.SH DESCRIPTION +The routine +.BR dbopen (3) +is the library interface to database files. +One of the supported file formats is btree files. +The general description of the database access methods is in +.BR dbopen (3), +this manual page describes only the btree specific information. +.PP +The btree data structure is a sorted, balanced tree structure storing +associated key/data pairs. +.PP +The btree access method specific data structure provided to +.BR dbopen (3) +is defined in the +.I +include file as follows: +.in +4n +.nf + +typedef struct { + unsigned long flags; + unsigned int cachesize; + int maxkeypage; + int minkeypage; + unsigned int psize; + int (*compare)(const DBT *key1, const DBT *key2); + size_t (*prefix)(const DBT *key1, const DBT *key2); + int lorder; +} BTREEINFO; +.fi +.in +.PP +The elements of this structure are as follows: +.TP +.I flags +The flag value is specified by +.IR or 'ing +any of the following values: +.RS +.TP +.B R_DUP +Permit duplicate keys in the tree, that is, +permit insertion if the key to be +inserted already exists in the tree. +The default behavior, as described in +.BR dbopen (3), +is to overwrite a matching key when inserting a new key or to fail if +the +.B R_NOOVERWRITE +flag is specified. +The +.B R_DUP +flag is overridden by the +.B R_NOOVERWRITE +flag, and if the +.B R_NOOVERWRITE +flag is specified, attempts to insert duplicate keys into +the tree will fail. +.IP +If the database contains duplicate keys, the order of retrieval of +key/data pairs is undefined if the +.I get +routine is used, however, +.I seq +routine calls with the +.B R_CURSOR +flag set will always return the logical +"first" of any group of duplicate keys. +.RE +.TP +.I cachesize +A suggested maximum size (in bytes) of the memory cache. +This value is +.I only +advisory, and the access method will allocate more memory rather than fail. +Since every search examines the root page of the tree, caching the most +recently used pages substantially improves access time. +In addition, physical writes are delayed as long as possible, so a moderate +cache can reduce the number of I/O operations significantly. +Obviously, using a cache increases (but only increases) the likelihood of +corruption or lost data if the system crashes while a tree is being modified. +If +.I cachesize +is 0 (no size is specified) a default cache is used. +.TP +.I maxkeypage +The maximum number of keys which will be stored on any single page. +Not currently implemented. +.\" The maximum number of keys which will be stored on any single page. +.\" Because of the way the btree data structure works, +.\" .I maxkeypage +.\" must always be greater than or equal to 2. +.\" If +.\" .I maxkeypage +.\" is 0 (no maximum number of keys is specified) the page fill factor is +.\" made as large as possible (which is almost invariably what is wanted). +.TP +.I minkeypage +The minimum number of keys which will be stored on any single page. +This value is used to determine which keys will be stored on overflow +pages, that is, if a key or data item is longer than the pagesize divided +by the minkeypage value, it will be stored on overflow pages instead +of in the page itself. +If +.I minkeypage +is 0 (no minimum number of keys is specified) a value of 2 is used. +.TP +.I psize +Page size is the size (in bytes) of the pages used for nodes in the tree. +The minimum page size is 512 bytes and the maximum page size is 64K. +If +.I psize +is 0 (no page size is specified) a page size is chosen based on the +underlying file system I/O block size. +.TP +.I compare +Compare is the key comparison function. +It must return an integer less than, equal to, or greater than zero if the +first key argument is considered to be respectively less than, equal to, +or greater than the second key argument. +The same comparison function must be used on a given tree every time it +is opened. +If +.I compare +is NULL (no comparison function is specified), the keys are compared +lexically, with shorter keys considered less than longer keys. +.TP +.I prefix +Prefix is the prefix comparison function. +If specified, this routine must return the number of bytes of the second key +argument which are necessary to determine that it is greater than the first +key argument. +If the keys are equal, the key length should be returned. +Note, the usefulness of this routine is very data-dependent, but, in some +data sets can produce significantly reduced tree sizes and search times. +If +.I prefix +is NULL (no prefix function is specified), +.I and +no comparison function is specified, a default lexical comparison routine +is used. +If +.I prefix +is NULL and a comparison routine is specified, no prefix comparison is +done. +.TP +.I lorder +The byte order for integers in the stored database metadata. +The number should represent the order as an integer; for example, +big endian order would be the number 4,321. +If +.I lorder +is 0 (no order is specified) the current host order is used. +.PP +If the file already exists (and the +.B O_TRUNC +flag is not specified), the +values specified for the arguments +.IR flags , +.I lorder +and +.I psize +are ignored +in favor of the values used when the tree was created. +.PP +Forward sequential scans of a tree are from the least key to the greatest. +.PP +Space freed up by deleting key/data pairs from the tree is never reclaimed, +although it is normally made available for reuse. +This means that the btree storage structure is grow-only. +The only solutions are to avoid excessive deletions, or to create a fresh +tree periodically from a scan of an existing one. +.PP +Searches, insertions, and deletions in a btree will all complete in +O lg base N where base is the average fill factor. +Often, inserting ordered data into btrees results in a low fill factor. +This implementation has been modified to make ordered insertion the best +case, resulting in a much better than normal page fill factor. +.SH ERRORS +The +.I btree +access method routines may fail and set +.I errno +for any of the errors specified for the library routine +.BR dbopen (3). +.SH BUGS +Only big and little endian byte order is supported. +.SH "SEE ALSO" +.BR dbopen (3), +.BR hash (3), +.BR mpool (3), +.BR recno (3) +.sp +.IR "The Ubiquitous B-tree" , +Douglas Comer, ACM Comput. Surv. 11, 2 (June 1979), 121-138. +.sp +.IR "Prefix B-trees" , +Bayer and Unterauer, ACM Transactions on Database Systems, Vol. 2, 1 +(March 1977), 11-26. +.sp +.IR "The Art of Computer Programming Vol. 3: Sorting and Searching" , +D.E. Knuth, 1968, pp 471-480. diff --git a/original/man3/byteorder.3 b/original/man3/byteorder.3 new file mode 100644 index 00000000..a8c03ec9 --- /dev/null +++ b/original/man3/byteorder.3 @@ -0,0 +1,80 @@ +.\" 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 Sat Jul 24 21:29:05 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Thu Jul 26 14:06:20 2001 by Andries Brouwer (aeb@cwi.nl) +.\" +.TH BYTEORDER 3 2009-01-15 "GNU" "Linux Programmer's Manual" +.SH NAME +htonl, htons, ntohl, ntohs \- convert values between host and network +byte order +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "uint32_t htonl(uint32_t " hostlong ); +.sp +.BI "uint16_t htons(uint16_t " hostshort ); +.sp +.BI "uint32_t ntohl(uint32_t " netlong ); +.sp +.BI "uint16_t ntohs(uint16_t " netshort ); +.fi +.SH DESCRIPTION +The +.BR htonl () +function converts the unsigned integer \fIhostlong\fP +from host byte order to network byte order. +.PP +The +.BR htons () +function converts the unsigned short integer \fIhostshort\fP +from host byte order to network byte order. +.PP +The +.BR ntohl () +function converts the unsigned integer \fInetlong\fP +from network byte order to host byte order. +.PP +The +.BR ntohs () +function converts the unsigned short integer \fInetshort\fP +from network byte order to host byte order. +.PP +On the i386 the host byte order is Least Significant Byte first, +whereas the network byte order, as used on the Internet, is Most +Significant Byte first. +.SH "CONFORMING TO" +POSIX.1-2001. + +Some systems require the inclusion of +.I +instead of +.IR . +.SH "SEE ALSO" +.BR endian (3), +.BR gethostbyname (3), +.BR getservent (3) diff --git a/original/man3/bzero.3 b/original/man3/bzero.3 new file mode 100644 index 00000000..5292446e --- /dev/null +++ b/original/man3/bzero.3 @@ -0,0 +1,57 @@ +.\" 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 Sat Jul 24 21:28:17 1993 by Rik Faith +.\" Modified Tue Oct 22 23:49:37 1996 by Eric S. Raymond +.TH BZERO 3 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH NAME +bzero \- write zero-valued bytes +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void bzero(void *" s ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR bzero () +function sets the first +.I n +bytes of the byte area starting at +.I s +to zero (bytes containing \(aq\\0\(aq). +.SH "RETURN VALUE" +None. +.SH "CONFORMING TO" +4.3BSD. +This function is deprecated (marked as LEGACY in POSIX.1-2001): use +.BR memset (3) +in new programs. +POSIX.1-2008 removes the specification of +.BR bzero (). +.SH "SEE ALSO" +.BR memset (3), +.BR swab (3) diff --git a/original/man3/cabs.3 b/original/man3/cabs.3 new file mode 100644 index 00000000..47d2a3b7 --- /dev/null +++ b/original/man3/cabs.3 @@ -0,0 +1,36 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CABS 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +cabs, cabsf, cabsl \- absolute value of a complex number +.SH SYNOPSIS +.B #include +.sp +.BI "double cabs(double complex " z ); +.br +.BI "float cabsf(float complex " z ); +.br +.BI "long double cabsl(long double complex " z ); +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The +.BR cabs () +function returns the absolute value of the complex number +.IR z . +The result is a real number. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH NOTES +The function is actually an alias for +.I "hypot(a,\ b)" +(or, equivalently, +.IR "sqrt(a*a\ +\ b*b)" ). +.SH "SEE ALSO" +.BR abs (3), +.BR cimag (3), +.BR hypot (3), +.BR complex (7) diff --git a/original/man3/cabsf.3 b/original/man3/cabsf.3 new file mode 100644 index 00000000..e50ac96b --- /dev/null +++ b/original/man3/cabsf.3 @@ -0,0 +1 @@ +.so man3/cabs.3 diff --git a/original/man3/cabsl.3 b/original/man3/cabsl.3 new file mode 100644 index 00000000..e50ac96b --- /dev/null +++ b/original/man3/cabsl.3 @@ -0,0 +1 @@ +.so man3/cabs.3 diff --git a/original/man3/cacos.3 b/original/man3/cacos.3 new file mode 100644 index 00000000..b483a0cf --- /dev/null +++ b/original/man3/cacos.3 @@ -0,0 +1,39 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CACOS 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +cacos, cacosf, cacosl \- complex arc cosine +.SH SYNOPSIS +.B #include +.sp +.BI "double complex cacos(double complex " z ); +.br +.BI "float complex cacosf(float complex " z ); +.br +.BI "long double complex cacosl(long double complex " z ); +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The +.BR cacos () +function calculates the complex arc cosine of +.IR z . +If \fIy\ =\ cacos(z)\fP, then \fIz\ =\ ccos(y)\fP. +The real part of +.I y +is chosen in the interval [0,pi]. +.LP +One has: +.nf + + cacos(z) = \-i clog(z + csqrt(z * z \- 1)) +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR ccos (3), +.BR clog (3), +.BR complex (7) diff --git a/original/man3/cacosf.3 b/original/man3/cacosf.3 new file mode 100644 index 00000000..a4f10e17 --- /dev/null +++ b/original/man3/cacosf.3 @@ -0,0 +1 @@ +.so man3/cacos.3 diff --git a/original/man3/cacosh.3 b/original/man3/cacosh.3 new file mode 100644 index 00000000..7bf60c99 --- /dev/null +++ b/original/man3/cacosh.3 @@ -0,0 +1,43 @@ +.\" Copyright 2002 Walter Harms(walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CACOSH 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +cacosh, cacoshf, cacoshl \- complex arc hyperbolic cosine +.SH SYNOPSIS +.B #include +.sp +.BI "double complex cacosh(double complex " z ); +.br +.BI "float complex cacoshf(float complex " z ); +.br +.BI "long double complex cacoshl(long double complex " z ); +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The +.BR cacosh () +function calculates the complex arc hyperpolic cosine of +.IR z . +If \fIy\ =\ cacosh(z)\fP, then \fIz\ =\ ccosh(y)\fP. +The imaginary part of +.I y +is chosen in the interval [\-pi,pi]. +The real part of +.I y +is chosen nonnegative. +.LP +One has: +.nf + + cacosh(z) = (0.5) * clog((1 + z) / (1 \- z)) +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR acosh (3), +.BR cabs (3), +.BR cimag (3), +.BR complex (7) diff --git a/original/man3/cacoshf.3 b/original/man3/cacoshf.3 new file mode 100644 index 00000000..c89c010f --- /dev/null +++ b/original/man3/cacoshf.3 @@ -0,0 +1 @@ +.so man3/cacosh.3 diff --git a/original/man3/cacoshl.3 b/original/man3/cacoshl.3 new file mode 100644 index 00000000..c89c010f --- /dev/null +++ b/original/man3/cacoshl.3 @@ -0,0 +1 @@ +.so man3/cacosh.3 diff --git a/original/man3/cacosl.3 b/original/man3/cacosl.3 new file mode 100644 index 00000000..a4f10e17 --- /dev/null +++ b/original/man3/cacosl.3 @@ -0,0 +1 @@ +.so man3/cacos.3 diff --git a/original/man3/calloc.3 b/original/man3/calloc.3 new file mode 100644 index 00000000..a4b9d445 --- /dev/null +++ b/original/man3/calloc.3 @@ -0,0 +1 @@ +.so man3/malloc.3 diff --git a/original/man3/callrpc.3 b/original/man3/callrpc.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/callrpc.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/canonicalize_file_name.3 b/original/man3/canonicalize_file_name.3 new file mode 100644 index 00000000..50ceb447 --- /dev/null +++ b/original/man3/canonicalize_file_name.3 @@ -0,0 +1,23 @@ +.\" Copyright 2005 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2005 Michael Kerrisk (mtk.manpages@gmail.com). +.\" Distributed under the GNU General Public License. +.\" +.TH CANONICALIZE_FILE_NAME 3 2005-07-14 "GNU" "Linux Programmer's Manual" +.SH NAME +canonicalize_file_name \- return the canonicalized filename +.SH SYNOPSIS +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *canonicalize_file_name(const char *" path ");" +.SH DESCRIPTION +The call +.I canonicalize_file_name(path) +is equivalent to the call +.IR "realpath(path,\ NULL)" . +.SH "CONFORMING TO" +The function is a GNU extension. +.SH "SEE ALSO" +.BR realpath (3), +.BR feature_test_macros (7) diff --git a/original/man3/carg.3 b/original/man3/carg.3 new file mode 100644 index 00000000..32d182aa --- /dev/null +++ b/original/man3/carg.3 @@ -0,0 +1,51 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CARG 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +carg, cargf, cargl \- calculate the argument +.SH SYNOPSIS +.B #include +.sp +.BI "double carg(double complex " z ");" +.br +.BI "float cargf(float complex " z ");" +.br +.BI "long double cargl(long double complex " z ");" +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +A complex number can be described by two real coordinates. +One may use rectangular coordinates and gets + +.nf + z = x + I * y +.fi + +where \fIx\ =\ creal(z)\fP and \fIy\ =\ cimag(z)\fP. +.LP +Or one may use polar coordinates and gets +.nf + + z = r * cexp(I * a) + +.fi +where \fIr\ =\ cabs(z)\fP +is the "radius", the "modulus", the absolute value of \fIz\fP, and +\fIa\ =\ carg(z)\fP +is the "phase angle", the argument of \fIz\fP. +.LP +One has: +.nf + + tan(carg(z)) = cimag(z) / creal(z) +.fi +.SH "RETURN VALUE" +The return value is the range of [\-pi,pi]. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR cabs (3), +.BR complex (7) diff --git a/original/man3/cargf.3 b/original/man3/cargf.3 new file mode 100644 index 00000000..c181aa42 --- /dev/null +++ b/original/man3/cargf.3 @@ -0,0 +1 @@ +.so man3/carg.3 diff --git a/original/man3/cargl.3 b/original/man3/cargl.3 new file mode 100644 index 00000000..c181aa42 --- /dev/null +++ b/original/man3/cargl.3 @@ -0,0 +1 @@ +.so man3/carg.3 diff --git a/original/man3/casin.3 b/original/man3/casin.3 new file mode 100644 index 00000000..f4ff4716 --- /dev/null +++ b/original/man3/casin.3 @@ -0,0 +1,39 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CASIN 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +casin, casinf, casinl \- complex arc sine +.SH SYNOPSIS +.B #include +.sp +.BI "double complex casin(double complex " z ); +.br +.BI "float complex casinf(float complex " z ); +.br +.BI "long double complex casinl(long double complex " z ); +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The +.BR casin () +function calculates the complex arc sine of +.IR z . +If \fIy\ =\ casin(z)\fP, then \fIz\ =\ csin(y)\fP. +The real part of +.I y +is chosen in the interval [\-pi/2,pi/2]. +.LP +One has: +.nf + + casin(z) = \-i clog(iz + csqrt(1 \- z * z)) +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR ccos (3), +.BR clog (3), +.BR complex (7) diff --git a/original/man3/casinf.3 b/original/man3/casinf.3 new file mode 100644 index 00000000..582875fa --- /dev/null +++ b/original/man3/casinf.3 @@ -0,0 +1 @@ +.so man3/casin.3 diff --git a/original/man3/casinh.3 b/original/man3/casinh.3 new file mode 100644 index 00000000..4f35e77f --- /dev/null +++ b/original/man3/casinh.3 @@ -0,0 +1,40 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CASINH 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +casinh, casinhf, casinhl \- complex arc sine hyperbolic +.SH SYNOPSIS +.B #include +.sp +.BI "double complex casinh(double complex " z ); +.br +.BI "float complex casinhf(float complex " z ); +.br +.BI "long double complex casinhl(long double complex " z ); +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The +.BR casinh () +function calculates the complex arc hyperbolic sine of +.IR z . +If \fIy\ =\ casinh(z)\fP, then \fIz\ =\ csinh(y)\fP. +The imaginary part of +.I y +is chosen in the interval [\-pi/2,pi/2]. +.LP +One has: +.nf + + casinh(z) = clog(z + csqrt(z * z + 1)) +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR asinh (3), +.BR cabs (3), +.BR cimag (3), +.BR complex (7) diff --git a/original/man3/casinhf.3 b/original/man3/casinhf.3 new file mode 100644 index 00000000..c2eada89 --- /dev/null +++ b/original/man3/casinhf.3 @@ -0,0 +1 @@ +.so man3/casinh.3 diff --git a/original/man3/casinhl.3 b/original/man3/casinhl.3 new file mode 100644 index 00000000..c2eada89 --- /dev/null +++ b/original/man3/casinhl.3 @@ -0,0 +1 @@ +.so man3/casinh.3 diff --git a/original/man3/casinl.3 b/original/man3/casinl.3 new file mode 100644 index 00000000..582875fa --- /dev/null +++ b/original/man3/casinl.3 @@ -0,0 +1 @@ +.so man3/casin.3 diff --git a/original/man3/catan.3 b/original/man3/catan.3 new file mode 100644 index 00000000..30692bb3 --- /dev/null +++ b/original/man3/catan.3 @@ -0,0 +1,37 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CATAN 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +catan, catanf, catanl \- complex arc tangents +.SH SYNOPSIS +.B #include +.sp +.BI "double complex catan(double complex " z ); +.br +.BI "float complex catanf(float complex " z ); +.br +.BI "long double complex catanl(long double complex " z ); +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The +.BR catan () +function calculates the complex arc tangent of +.IR z . +If \fIy\ =\ catan(z)\fP, then \fIz\ =\ ctan(y)\fP. +The real part of y is chosen in the interval [\-pi/2,pi/2]. +.LP +One has: +.nf + + catan(z) = 1 / 2i clog((1 + iz) / (1 \- iz)) +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR ccos (3), +.BR clog (3), +.BR complex (7) diff --git a/original/man3/catanf.3 b/original/man3/catanf.3 new file mode 100644 index 00000000..d1e25223 --- /dev/null +++ b/original/man3/catanf.3 @@ -0,0 +1 @@ +.so man3/catan.3 diff --git a/original/man3/catanh.3 b/original/man3/catanh.3 new file mode 100644 index 00000000..e3960218 --- /dev/null +++ b/original/man3/catanh.3 @@ -0,0 +1,40 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CATANH 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +catanh, catanhf, catanhl \- complex arc tangents hyperbolic +.SH SYNOPSIS +.B #include +.sp +.BI "double complex catanh(double complex " z ); +.br +.BI "float complex catanhf(float complex " z ); +.br +.BI "long double complex catanhl(long double complex " z ); +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The +.BR catanh () +function calculates the complex arc hyperbolic tangent of +.IR z . +If \fIy\ =\ catanh(z)\fP, then \fIz\ =\ ctanh(y)\fP. +The imaginary part of +.I y +is chosen in the interval [\-pi/2,pi/2]. +.LP +One has: +.nf + + catanh(z) = 0.5 * clog((1 + z) / (1 \- z)) +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR atanh (3), +.BR cabs (3), +.BR cimag (3), +.BR complex (7) diff --git a/original/man3/catanhf.3 b/original/man3/catanhf.3 new file mode 100644 index 00000000..23f22a4a --- /dev/null +++ b/original/man3/catanhf.3 @@ -0,0 +1 @@ +.so man3/catanh.3 diff --git a/original/man3/catanhl.3 b/original/man3/catanhl.3 new file mode 100644 index 00000000..23f22a4a --- /dev/null +++ b/original/man3/catanhl.3 @@ -0,0 +1 @@ +.so man3/catanh.3 diff --git a/original/man3/catanl.3 b/original/man3/catanl.3 new file mode 100644 index 00000000..d1e25223 --- /dev/null +++ b/original/man3/catanl.3 @@ -0,0 +1 @@ +.so man3/catan.3 diff --git a/original/man3/catclose.3 b/original/man3/catclose.3 new file mode 100644 index 00000000..92ff6665 --- /dev/null +++ b/original/man3/catclose.3 @@ -0,0 +1 @@ +.so man3/catopen.3 diff --git a/original/man3/catgets.3 b/original/man3/catgets.3 new file mode 100644 index 00000000..047dd9af --- /dev/null +++ b/original/man3/catgets.3 @@ -0,0 +1,84 @@ +.\" Copyright 1993 Mitchum DSouza +.\" +.\" 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. +.\" +.\" Updated, aeb, 980809 +.TH CATGETS 3 1998-08-09 "" "Linux Programmer's Manual" +.SH NAME +catgets \- get message from a message catalog +.SH SYNOPSIS +.nf +.B #include + +.BI "char *catgets(nl_catd " catalog ", int " set_number \ +", int " message_number , +.BI " const char *" message ); +.fi +.SH DESCRIPTION +.BR catgets () +reads the message +.IR message_number , +in set +.IR set_number , +from the message catalog identified by +.IR catalog , +where +.I catalog +is a catalog descriptor returned from an earlier call to +.BR catopen (3). +The fourth argument +.I message +points to a default message string which will be returned by +.BR catgets () +if the identified message catalog is not currently available. +The +message-text is contained in an internal buffer area and should be copied by +the application if it is to be saved or modified. +The return string is +always terminated with a null byte. +.SH "RETURN VALUE" +.LP +On success, +.BR catgets () +returns a pointer to an internal buffer area +containing the null-terminated message string. +On failure, +.BR catgets () +returns the value +.IR message . +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +These functions are only available in libc.so.4.4.4c and above. +The Jan 1987 X/Open Portability Guide specifies a more subtle +error return: +.I message +is returned if the message catalog specified by +.I catalog +is not available, while an empty string is returned +when the message catalog is available but does not contain +the specified message. +These two possible error returns seem to be discarded in SUSv2 +in favor of always returning +.IR message . +.SH "SEE ALSO" +.BR catopen (3), +.BR setlocale (3) diff --git a/original/man3/catopen.3 b/original/man3/catopen.3 new file mode 100644 index 00000000..db8952e0 --- /dev/null +++ b/original/man3/catopen.3 @@ -0,0 +1,189 @@ +.\" Copyright 1993 Mitchum DSouza +.\" +.\" 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 Thu Dec 13 22:51:19 2001 by Martin Schulze +.\" Modified 2001-12-14 aeb +.\" +.TH CATOPEN 3 2001-12-14 "GNU" "Linux Programmer's Manual" +.SH NAME +catopen, catclose \- open/close a message catalog +.SH SYNOPSIS +.B #include +.sp +.BI "nl_catd catopen(const char *" name ", int " flag ); + +.BI "int catclose(nl_catd " catalog ); +.SH DESCRIPTION +The function +.BR catopen () +opens a message catalog and returns a catalog descriptor. +The descriptor remains valid until +.BR catclose () +or +.BR execve (2). +If a file descriptor is used to implement catalog descriptors +then the +.B FD_CLOEXEC +flag will be set. +.LP +The argument +.I name +specifies the name of the message catalog to be opened. +If +.I name +specifies and absolute path (i.e., contains a \(aq/\(aq), +then +.I name +specifies a pathname for the message catalog. +Otherwise, the environment variable +.B NLSPATH +is used with +.I name +substituted for +.B %N +(see +.BR locale (7)). +It is unspecified whether +.B NLSPATH +will be used when the process has root privileges. +If +.B NLSPATH +does not exist in the environment, +or if a message catalog cannot be opened +in any of the paths specified by it, +then an implementation defined path is used. +This latter default path may depend on the +.B LC_MESSAGES +locale setting when the +.I flag +argument is +.B NL_CAT_LOCALE +and on the +.B LANG +environment variable when the +.I flag +argument is 0. +Changing the +.B LC_MESSAGES +part of the locale may invalidate +open catalog descriptors. +.LP +The +.I flag +argument to +.BR catopen () +is used to indicate the source for the language to use. +If it is set to +.B NL_CAT_LOCALE +then it will use the current locale setting for +.BR LC_MESSAGES . +Otherwise it will use the +.B LANG +environment variable. +.LP +The function +.BR catclose () +closes the message catalog identified by +.IR catalog . +It invalidates any subsequent references to the message catalog +defined by +.IR catalog . +.SH "RETURN VALUE" +The function +.BR catopen () +returns a message catalog descriptor of type +.I nl_catd +on success. +On failure, it returns \fI(nl_catd)\ \-1\fP +and sets +.I errno +to indicate the error. +The possible error values include all +possible values for the +.BR open (2) +call. +.LP +The function +.BR catclose () +returns 0 on success, or \-1 on failure. +.SH ENVIRONMENT +.TP +.B LC_MESSAGES +May be the source of the +.B LC_MESSAGES +locale setting, and thus +determine the language to use if +.I flag +is set to +.BR NL_CAT_LOCALE . +.TP +.B LANG +The language to use if +.I flag +is 0. +.SH "CONFORMING TO" +POSIX.1-2001. +.\" In XPG 1987, Vol. 3 it says: +.\" .I "The flag argument of catopen is reserved for future use" +.\" .IR "and should be set to 0" . +It is unclear what the source was for the constants +.B MCLoadBySet +and +.B MCLoadAll +(see below). +.SH NOTES +The above is the POSIX.1-2001 description. +The glibc value for +.B NL_CAT_LOCALE +is 1. +(Compare +.B MCLoadAll +below.) +The default path varies, but usually looks at a number of places below +.IR /usr/share/locale . +.SS Linux Notes +These functions are available for Linux since libc 4.4.4c. +In the case of linux libc4 and libc5, the catalog descriptor +.I nl_catd +is a +.BR mmap (2)'ed +area of memory and not a file descriptor. +The +.I flag +argument to +.BR catopen () +should be either +.B MCLoadBySet +(=0) or +.B MCLoadAll +(=1). +The former value indicates that a set from the catalog is to be +loaded when needed, whereas the latter causes the initial call to +.BR catopen () +to load the entire catalog into memory. +The default search path varies, but usually looks at a number of places below +.I /etc/locale +and +.IR /usr/lib/locale . +.SH "SEE ALSO" +.BR catgets (3), +.BR setlocale (3) diff --git a/original/man3/cbc_crypt.3 b/original/man3/cbc_crypt.3 new file mode 100644 index 00000000..853c9cbd --- /dev/null +++ b/original/man3/cbc_crypt.3 @@ -0,0 +1 @@ +.so man3/des_crypt.3 diff --git a/original/man3/cbrt.3 b/original/man3/cbrt.3 new file mode 100644 index 00000000..96e2f246 --- /dev/null +++ b/original/man3/cbrt.3 @@ -0,0 +1,82 @@ +.\" Copyright 1995 Jim Van Zandt +.\" +.\" 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. +.\" +.\" changed `square root' into `cube root' - aeb, 950919 +.\" +.\" Modified 2002-07-27 Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH CBRT 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.SH NAME +cbrt, cbrtf, cbrtl \- cube root function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double cbrt(double " x ); +.br +.BI "float cbrtf(float " x ); +.br +.BI "long double cbrtl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR cbrt (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR cbrtf (), +.BR cbrtl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR cbrt () +function returns the (real) cube root of \fIx\fP. +This function cannot fail; every representable real value has a +representable real cube root. +.SH RETURN VALUE +These functions return the cube root of +.IR x . + +If +.I x +is +0, -0, positive infinity, negative infinity, or NaN, +.I x +is returned. +.SH ERRORS +No errors occur. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.\" .BR cbrt () +.\" was a GNU extension. It is now a C99 requirement. +.SH "SEE ALSO" +.BR pow (3), +.BR sqrt (3) diff --git a/original/man3/cbrtf.3 b/original/man3/cbrtf.3 new file mode 100644 index 00000000..b662c9ec --- /dev/null +++ b/original/man3/cbrtf.3 @@ -0,0 +1 @@ +.so man3/cbrt.3 diff --git a/original/man3/cbrtl.3 b/original/man3/cbrtl.3 new file mode 100644 index 00000000..b662c9ec --- /dev/null +++ b/original/man3/cbrtl.3 @@ -0,0 +1 @@ +.so man3/cbrt.3 diff --git a/original/man3/ccos.3 b/original/man3/ccos.3 new file mode 100644 index 00000000..8f35a905 --- /dev/null +++ b/original/man3/ccos.3 @@ -0,0 +1,31 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CCOS 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +ccos, ccosf, ccosl \- complex cosine function +.SH SYNOPSIS +.B #include +.sp +.BI "double complex ccos(double complex " z ");" +.br +.BI "float complex ccosf(float complex " z ");" +.br +.BI "long double complex ccosl(long double complex " z ");" +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The complex cosine function is defined as: +.nf + + ccos(z) = (exp(i * z) + exp(\-i * z)) / 2 +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR cabs (3), +.BR csin (3), +.BR ctan (3), +.BR complex (7) diff --git a/original/man3/ccosf.3 b/original/man3/ccosf.3 new file mode 100644 index 00000000..b4323ffa --- /dev/null +++ b/original/man3/ccosf.3 @@ -0,0 +1 @@ +.so man3/ccos.3 diff --git a/original/man3/ccosh.3 b/original/man3/ccosh.3 new file mode 100644 index 00000000..eb00c3ae --- /dev/null +++ b/original/man3/ccosh.3 @@ -0,0 +1,31 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CCOSH 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +ccosh, ccoshf, ccoshl \- complex hyperbolic cosine +.SH SYNOPSIS +.B #include +.sp +.BI "double complex ccosh(double complex " z ");" +.br +.BI "float complex ccoshf(float complex " z ");" +.br +.BI "long double complex ccoshl(long double complex " z ");" +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The complex hyperbolic cosine function is defined as: +.nf + + ccosh(z) = (exp(z)+exp(\-z))/2 +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR cabs (3), +.BR csinh (3), +.BR ctanh (3), +.BR complex (7) diff --git a/original/man3/ccoshf.3 b/original/man3/ccoshf.3 new file mode 100644 index 00000000..a777fbf7 --- /dev/null +++ b/original/man3/ccoshf.3 @@ -0,0 +1 @@ +.so man3/ccosh.3 diff --git a/original/man3/ccoshl.3 b/original/man3/ccoshl.3 new file mode 100644 index 00000000..a777fbf7 --- /dev/null +++ b/original/man3/ccoshl.3 @@ -0,0 +1 @@ +.so man3/ccosh.3 diff --git a/original/man3/ccosl.3 b/original/man3/ccosl.3 new file mode 100644 index 00000000..b4323ffa --- /dev/null +++ b/original/man3/ccosl.3 @@ -0,0 +1 @@ +.so man3/ccos.3 diff --git a/original/man3/ceil.3 b/original/man3/ceil.3 new file mode 100644 index 00000000..7c50e53d --- /dev/null +++ b/original/man3/ceil.3 @@ -0,0 +1,108 @@ +.\" Copyright 2001 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. +.\" +.TH CEIL 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +ceil, ceilf, ceill \- ceiling function: smallest integral value not +less than argument +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double ceil(double " x ); +.br +.BI "float ceilf(float " x ); +.br +.BI "long double ceill(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR ceilf (), +.BR ceill (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions return the smallest integral value that is not less than +.IR x . + +For example, +.IR ceil(0.5) +is 1.0, and +.IR ceil(\-0.5) +is 0.0. +.SH "RETURN VALUE" +These functions return the ceiling of +.IR x . + +If \fIx\fP is integral, +0, \-0, NaN, or infinite, +\fIx\fP itself is returned. +.SH ERRORS +No errors occur. +POSIX.1-2001 documents a range error for overflows, but see NOTES. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH NOTES +SUSv2 and POSIX.1-2001 contain text about overflow (which might set +.I errno +to +.BR ERANGE , +or raise an +.B FE_OVERFLOW +exception). +In practice, the result cannot overflow on any current machine, +so this error-handling stuff is just nonsense. +.\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point. +(More precisely, overflow can happen only when the maximum value +of the exponent is smaller than the number of mantissa bits. +For the IEEE-754 standard 32-bit and 64-bit floating-point numbers +the maximum value of the exponent is 128 (respectively, 1024), +and the number of mantissa bits is 24 (respectively, 53).) + +The integral value returned by these functions may be too large +to store in an integer type +.RI ( int , +.IR long , +etc.). +To avoid an overflow, which will produce undefined results, +an application should perform a range check on the returned value +before assigning it to an integer type. +.SH "SEE ALSO" +.BR floor (3), +.BR lrint (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3), +.BR trunc (3) diff --git a/original/man3/ceilf.3 b/original/man3/ceilf.3 new file mode 100644 index 00000000..569d1baf --- /dev/null +++ b/original/man3/ceilf.3 @@ -0,0 +1 @@ +.so man3/ceil.3 diff --git a/original/man3/ceill.3 b/original/man3/ceill.3 new file mode 100644 index 00000000..569d1baf --- /dev/null +++ b/original/man3/ceill.3 @@ -0,0 +1 @@ +.so man3/ceil.3 diff --git a/original/man3/cerf.3 b/original/man3/cerf.3 new file mode 100644 index 00000000..ffdf07b7 --- /dev/null +++ b/original/man3/cerf.3 @@ -0,0 +1,39 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CERF 3 2007-12-26 "" "Linux Programmer's Manual" +.SH NAME +cerf, cerff, cerfl, cerfc, cerfcf, cerfcl \- complex error function +.SH SYNOPSIS +.B #include +.sp +.BI "double complex cerf(double complex " z ); +.br +.BI "float complex cerff(float complex " z ); +.br +.BI "long double complex cerfl(long double complex " z ); +.sp +.BI "double complex cerfc(double complex " z ); +.br +.BI "float complex cerfcf(float complex " z ); +.br +.BI "long double complex cerfcl(long double complex " z ); +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The function +.BR cerf () +is the complex version of the error function. +erf(z) = 2/sqrt(pi) * integral from 0 to z of exp(\-t*t) dt. +The function +.BR cerfc () +is defined as cerfc(z) = 1\-cerf(z). +.\" must check 1/sqrt(2*pi) ? +.SH "CONFORMING TO" +The function names are reserved for future use in C99. +.SH AVAILABILITY +Not yet in glibc, as at version 2.8. +.\" But reserved in NAMESPACE. +.SH "SEE ALSO" +.BR erf (3), +.BR complex (7) diff --git a/original/man3/cerfc.3 b/original/man3/cerfc.3 new file mode 100644 index 00000000..57fb417c --- /dev/null +++ b/original/man3/cerfc.3 @@ -0,0 +1 @@ +.so man3/cerf.3 diff --git a/original/man3/cerfcf.3 b/original/man3/cerfcf.3 new file mode 100644 index 00000000..57fb417c --- /dev/null +++ b/original/man3/cerfcf.3 @@ -0,0 +1 @@ +.so man3/cerf.3 diff --git a/original/man3/cerfcl.3 b/original/man3/cerfcl.3 new file mode 100644 index 00000000..57fb417c --- /dev/null +++ b/original/man3/cerfcl.3 @@ -0,0 +1 @@ +.so man3/cerf.3 diff --git a/original/man3/cerff.3 b/original/man3/cerff.3 new file mode 100644 index 00000000..57fb417c --- /dev/null +++ b/original/man3/cerff.3 @@ -0,0 +1 @@ +.so man3/cerf.3 diff --git a/original/man3/cerfl.3 b/original/man3/cerfl.3 new file mode 100644 index 00000000..57fb417c --- /dev/null +++ b/original/man3/cerfl.3 @@ -0,0 +1 @@ +.so man3/cerf.3 diff --git a/original/man3/cexp.3 b/original/man3/cexp.3 new file mode 100644 index 00000000..e5a96e7f --- /dev/null +++ b/original/man3/cexp.3 @@ -0,0 +1,35 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CEXP 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +cexp, cexpf, cexpl \- complex exponential function +.SH SYNOPSIS +.B #include +.sp +.BI "double complex cexp(double complex " z ");" +.br +.BI "float complex cexpf(float complex " z ");" +.br +.BI "long double complex cexpl(long double complex " z ");" +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The function calculates e (2.71828..., the base of natural logarithms) +raised to the power of +.IR z . +.LP +One has: +.nf + + cexp(I * z) = ccos(z) + I * csin(z) +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR cabs (3), +.BR clog (3), +.BR cpow (3), +.BR complex (7) diff --git a/original/man3/cexp2.3 b/original/man3/cexp2.3 new file mode 100644 index 00000000..57092b1e --- /dev/null +++ b/original/man3/cexp2.3 @@ -0,0 +1,29 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CEXP2 3 2008-08-07 "" "Linux Programmer's Manual" +.SH NAME +cexp2, cexp2f, cexp2l \- base-2 exponent of a complex number +.SH SYNOPSIS +.B #include +.sp +.BI "double complex cexp2(double complex " z ");" +.br +.BI "float complex cexp2f(float complex " z ");" +.br +.BI "long double complex cexp2l(long double complex " z ");" +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The function returns 2 raised to the power of +.IR z . +.SH "CONFORMING TO" +These function names are reserved for future use in C99. +.SH AVAILABILITY +Not yet in glibc, as at version 2.8. +.\" But reserved in NAMESPACE. +.SH "SEE ALSO" +.BR cabs (3), +.BR cexp (3), +.BR clog10 (3), +.BR complex (7) diff --git a/original/man3/cexp2f.3 b/original/man3/cexp2f.3 new file mode 100644 index 00000000..759ad34c --- /dev/null +++ b/original/man3/cexp2f.3 @@ -0,0 +1 @@ +.so man3/cexp2.3 diff --git a/original/man3/cexp2l.3 b/original/man3/cexp2l.3 new file mode 100644 index 00000000..759ad34c --- /dev/null +++ b/original/man3/cexp2l.3 @@ -0,0 +1 @@ +.so man3/cexp2.3 diff --git a/original/man3/cexpf.3 b/original/man3/cexpf.3 new file mode 100644 index 00000000..794d7071 --- /dev/null +++ b/original/man3/cexpf.3 @@ -0,0 +1 @@ +.so man3/cexp.3 diff --git a/original/man3/cexpl.3 b/original/man3/cexpl.3 new file mode 100644 index 00000000..794d7071 --- /dev/null +++ b/original/man3/cexpl.3 @@ -0,0 +1 @@ +.so man3/cexp.3 diff --git a/original/man3/cfgetispeed.3 b/original/man3/cfgetispeed.3 new file mode 100644 index 00000000..eb472496 --- /dev/null +++ b/original/man3/cfgetispeed.3 @@ -0,0 +1 @@ +.so man3/termios.3 diff --git a/original/man3/cfgetospeed.3 b/original/man3/cfgetospeed.3 new file mode 100644 index 00000000..eb472496 --- /dev/null +++ b/original/man3/cfgetospeed.3 @@ -0,0 +1 @@ +.so man3/termios.3 diff --git a/original/man3/cfmakeraw.3 b/original/man3/cfmakeraw.3 new file mode 100644 index 00000000..eb472496 --- /dev/null +++ b/original/man3/cfmakeraw.3 @@ -0,0 +1 @@ +.so man3/termios.3 diff --git a/original/man3/cfree.3 b/original/man3/cfree.3 new file mode 100644 index 00000000..4c843c5b --- /dev/null +++ b/original/man3/cfree.3 @@ -0,0 +1,117 @@ +.\" 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. +.\" +.TH CFREE 3 2007-07-26 "" "Linux Programmer's Manual" +.SH NAME +cfree \- free allocated memory +.SH SYNOPSIS +.nf +.sp +.B "#include " +.sp +/* In SunOS 4 */ +.BI "int cfree(void *" ptr ); +.sp +/* In glibc or FreeBSD libcompat */ +.BI "void cfree(void *" ptr ); +.sp +/* In SCO OpenServer */ +.BI "void cfree(char *" ptr ", unsigned " num ", unsigned " size ); +.sp +/* In Solaris watchmalloc.so.1 */ +.BI "void cfree(void *" ptr ", size_t " nelem ", size_t " elsize ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR cfree (): +_BSD_SOURCE || _SVID_SOURCE +.SH DESCRIPTION +This function should never be used. +Use +.BR free (3) +instead. +.SS "1-arg cfree" +In glibc, the function +.BR cfree () +is a synonym for +.BR free (3), +"added for compatibility with SunOS". +.LP +Other systems have other functions with this name. +The declaration is sometimes in +.I +and sometimes in +.IR . +.SS "3-arg cfree" +Some SCO and Solaris versions have malloc libraries with a 3-argument +.BR cfree (), +apparently as an analog to +.BR calloc (3). +.LP +If you need it while porting something, add +.sp +.in +4n +#define cfree(p, n, s) free((p)) +.in +.sp +to your file. +.LP +A frequently asked question is "Can I use +.BR free (3) +to free memory allocated with +.BR calloc (3), +or do I need +.BR cfree ()?" +Answer: use +.BR free (3). +.LP +An SCO manual writes: "The cfree routine is provided for compliance +to the iBCSe2 standard and simply calls free. +The num and size +arguments to cfree are not used." +.SH "RETURN VALUE" +The SunOS version of +.BR cfree () +(which is a synonym for +.BR free (3)) +returns 1 on success and 0 on failure. +In case of error, +.I errno +is set to +.BR EINVAL : +the value of +.I ptr +was not a pointer to a block previously allocated by +one of the routines in the +.BR malloc (3) +family. +.SH "CONFORMING TO" +The 3-argument version of +.BR cfree () +as used by SCO conforms to the iBCSe2 standard: +Intel386 Binary Compatibility Specification, Edition 2. +.SH SEE ALSO +.BR malloc (3) diff --git a/original/man3/cfsetispeed.3 b/original/man3/cfsetispeed.3 new file mode 100644 index 00000000..eb472496 --- /dev/null +++ b/original/man3/cfsetispeed.3 @@ -0,0 +1 @@ +.so man3/termios.3 diff --git a/original/man3/cfsetospeed.3 b/original/man3/cfsetospeed.3 new file mode 100644 index 00000000..eb472496 --- /dev/null +++ b/original/man3/cfsetospeed.3 @@ -0,0 +1 @@ +.so man3/termios.3 diff --git a/original/man3/cfsetspeed.3 b/original/man3/cfsetspeed.3 new file mode 100644 index 00000000..eb472496 --- /dev/null +++ b/original/man3/cfsetspeed.3 @@ -0,0 +1 @@ +.so man3/termios.3 diff --git a/original/man3/cimag.3 b/original/man3/cimag.3 new file mode 100644 index 00000000..20850554 --- /dev/null +++ b/original/man3/cimag.3 @@ -0,0 +1,38 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CIMAG 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +cimag, cimagf, cimagl \- get imaginary part of a complex number +.SH SYNOPSIS +.B #include +.sp +.BI "double cimag(double complex " z ");" +.br +.BI "float cimagf(float complex " z ");" +.br +.BI "long double cimagl(long double complex " z ");" +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The +.BR cimag () +function returns the imaginary part of the complex number +.IR z . +.LP +One has: +.nf + + z = creal(z) + I * cimag(z) +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH NOTES +gcc also supports __imag__. +That is a GNU extension. +.SH "SEE ALSO" +.BR cabs (3), +.BR creal (3), +.BR complex (7) diff --git a/original/man3/cimagf.3 b/original/man3/cimagf.3 new file mode 100644 index 00000000..e806455a --- /dev/null +++ b/original/man3/cimagf.3 @@ -0,0 +1 @@ +.so man3/cimag.3 diff --git a/original/man3/cimagl.3 b/original/man3/cimagl.3 new file mode 100644 index 00000000..e806455a --- /dev/null +++ b/original/man3/cimagl.3 @@ -0,0 +1 @@ +.so man3/cimag.3 diff --git a/original/man3/clearenv.3 b/original/man3/clearenv.3 new file mode 100644 index 00000000..b02f3ec4 --- /dev/null +++ b/original/man3/clearenv.3 @@ -0,0 +1,100 @@ +.\" Copyright 2001 John Levon +.\" +.\" 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, aeb, 2001-10-17. +.TH CLEARENV 3 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +clearenv \- clear the environment +.SH SYNOPSIS +.nf +.B #include +.sp +.B "int clearenv(void);" +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR clearenv (): +_SVID_SOURCE || _XOPEN_SOURCE +.SH DESCRIPTION +The +.BR clearenv () +function clears the environment of all name-value +pairs and sets the value of the external variable +.I environ +to NULL. +.SH "RETURN VALUE" +The +.BR clearenv () +function returns zero on success, and a nonzero +value on failure. +.\" 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". +.SH VERSIONS +Not in libc4, libc5. +In glibc since glibc 2.0. +.SH "CONFORMING TO" +Various Unix variants (DG/UX, HP-UX, QNX, ...). +POSIX.9 (bindings for FORTRAN77). +POSIX.1-1996 did not accept +.BR clearenv () +and +.BR putenv (3), +but changed its mind and scheduled these functions for some +later issue of this standard (cf. B.4.6.1). +However, POSIX.1-2001 +only adds +.BR putenv (3), +and rejected +.BR clearenv (). +.SH NOTES +Used in security-conscious applications. +If it is unavailable +the assignment +.nf + + environ = NULL; + +.fi +will probably do. +.LP +The DG/UX and Tru64 man pages write: If +.I environ +has been modified by anything other than the +.BR putenv (3), +.BR getenv (3), +or +.BR clearenv () +functions, then +.BR clearenv () +will return an error and the process environment will remain unchanged. +.\" .LP +.\" HP-UX has a ENOMEM error return. +.SH "SEE ALSO" +.BR getenv (3), +.BR putenv (3), +.BR setenv (3), +.BR unsetenv (3), +.BR environ (7) diff --git a/original/man3/clearerr.3 b/original/man3/clearerr.3 new file mode 100644 index 00000000..3a95cca9 --- /dev/null +++ b/original/man3/clearerr.3 @@ -0,0 +1 @@ +.so man3/ferror.3 diff --git a/original/man3/clearerr_unlocked.3 b/original/man3/clearerr_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/clearerr_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/clnt_broadcast.3 b/original/man3/clnt_broadcast.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnt_broadcast.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clnt_call.3 b/original/man3/clnt_call.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnt_call.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clnt_control.3 b/original/man3/clnt_control.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnt_control.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clnt_create.3 b/original/man3/clnt_create.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnt_create.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clnt_destroy.3 b/original/man3/clnt_destroy.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnt_destroy.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clnt_freeres.3 b/original/man3/clnt_freeres.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnt_freeres.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clnt_geterr.3 b/original/man3/clnt_geterr.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnt_geterr.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clnt_pcreateerror.3 b/original/man3/clnt_pcreateerror.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnt_pcreateerror.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clnt_perrno.3 b/original/man3/clnt_perrno.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnt_perrno.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clnt_perror.3 b/original/man3/clnt_perror.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnt_perror.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clnt_spcreateerror.3 b/original/man3/clnt_spcreateerror.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnt_spcreateerror.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clnt_sperrno.3 b/original/man3/clnt_sperrno.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnt_sperrno.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clnt_sperror.3 b/original/man3/clnt_sperror.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnt_sperror.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clntraw_create.3 b/original/man3/clntraw_create.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clntraw_create.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clnttcp_create.3 b/original/man3/clnttcp_create.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clnttcp_create.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clntudp_bufcreate.3 b/original/man3/clntudp_bufcreate.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clntudp_bufcreate.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clntudp_create.3 b/original/man3/clntudp_create.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/clntudp_create.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/clock.3 b/original/man3/clock.3 new file mode 100644 index 00000000..704818f4 --- /dev/null +++ b/original/man3/clock.3 @@ -0,0 +1,87 @@ +.\" 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 21:27:01 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 14 Jun 2002, Michael Kerrisk +.\" Added notes on differences from other Unix systems with respect to +.\" waited-for children. +.TH CLOCK 3 2008-08-28 "GNU" "Linux Programmer's Manual" +.SH NAME +clock \- Determine processor time +.SH SYNOPSIS +.nf +.B #include +.sp +.B clock_t clock(void); +.fi +.SH DESCRIPTION +The +.BR clock () +function returns an approximation of processor time used by the program. +.SH "RETURN VALUE" +The value returned is the CPU time used so far as a +.IR clock_t ; +to get the number of seconds used, divide by +.BR CLOCKS_PER_SEC . +If the processor time used is not available or its value cannot +be represented, the function returns the value +.IR (clock_t)\ \-1 . +.SH "CONFORMING TO" +C89, C99, POSIX.1-2001. +POSIX requires that +.B CLOCKS_PER_SEC +equals 1000000 independent +of the actual resolution. +.SH NOTES +The C standard allows for arbitrary values at the start of the program; +subtract the value returned from a call to +.BR clock () +at the start of the program to get maximum portability. +.PP +Note that the time can wrap around. +On a 32-bit system where +.B CLOCKS_PER_SEC +equals 1000000 this function will return the same +value approximately every 72 minutes. +.PP +On several other implementations, +the value returned by +.BR clock () +also includes the times of any children whose status has been +collected via +.BR wait (2) +(or another wait-type call). +Linux does not include the times of waited-for children in the +value returned by +.BR clock (). +.\" 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 +The +.BR times (2) +function, which explicitly returns (separate) information about the +caller and its children, may be preferable. +.SH "SEE ALSO" +.BR clock_gettime (2), +.BR getrusage (2), +.BR times (2) diff --git a/original/man3/clock_getcpuclockid.3 b/original/man3/clock_getcpuclockid.3 new file mode 100644 index 00000000..83875713 --- /dev/null +++ b/original/man3/clock_getcpuclockid.3 @@ -0,0 +1,147 @@ +.\" 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. +.\" +.TH CLOCK_GETCPUCLOCKID 3 2009-02-20 "Linux" "Linux Programmer's Manual" +.SH NAME +clock_getcpuclockid \- obtain ID of a process CPU-time clock +.SH SYNOPSIS +.B #include +.nf +.sp +.BI "int clock_getcpuclockid(pid_t " pid ", clockid_t *" clock_id ); +.fi +.sp +Link with \fI\-lrt\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR clock_getcpuclockid (): +_XOPEN_SOURCE\ >=\ 600 +.SH DESCRIPTION +The +.BR clock_getcpuclockid () +function obtains the ID of the CPU-time clock of the process whose ID is +.IR pid , +and returns it in the location pointed to by +.IR clock_id . +If +.I pid +is zero, then the clock ID of the CPU-time clock +of the calling process is returned. +.SH "RETURN VALUE" +On success, +.BR clock_getcpuclockid () +returns 0; +on error, it returns a positive error number. +.SH ERRORS +.TP +.B ENOSYS +The kernel does not support obtaining the per-process +CPU-time clock of another process, and +.I pid +does not specify the calling process. +.TP +.B EPERM +The caller does not have permission to access +the CPU-time clock of the process specified by +.IR pid . +(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 +.B ESRCH +There is no process with the ID +.IR pid . +.SH VERSIONS +The +.BR clock_getcpuclockid () +function is available in glibc since version 2.2. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +Calling +.BR clock_gettime (2) +with the clock ID obtained by a call to +.BR clock_getcpuclockid () +with a +.I pid +of 0, +is the same as using the clock ID +.BR CLOCK_PROCESS_CPUTIME_ID . +.SH EXAMPLE +The example program below obtains the +CPU-time clock ID of the process whose ID is given on the command line, +and then uses +.BR clock_gettime (2) +to obtain the time on that clock. +An example run is the following: +.in +4n +.nf + +.RB "$" " ./a.out 1" " # Show CPU clock of init process" +CPU-time clock for PID 1 is 2.213466748 seconds +.fi +.in +.SS Program source +\& +.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 \\n", 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\\n", + argv[1], (long) ts.tv_sec, (long) ts.tv_nsec); + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR clock_getres (2), +.BR timer_create (2), +.BR pthread_getcpuclockid (3), +.BR time (7) diff --git a/original/man3/clock_getres.3 b/original/man3/clock_getres.3 new file mode 100644 index 00000000..5b148839 --- /dev/null +++ b/original/man3/clock_getres.3 @@ -0,0 +1,3 @@ +.so man2/clock_getres.2 +.\" This link provided in Section 3 because, by historical accident, +.\" the page was originally in Section 3 -- mtk, Feb 2009 diff --git a/original/man3/clock_gettime.3 b/original/man3/clock_gettime.3 new file mode 100644 index 00000000..5b148839 --- /dev/null +++ b/original/man3/clock_gettime.3 @@ -0,0 +1,3 @@ +.so man2/clock_getres.2 +.\" This link provided in Section 3 because, by historical accident, +.\" the page was originally in Section 3 -- mtk, Feb 2009 diff --git a/original/man3/clock_settime.3 b/original/man3/clock_settime.3 new file mode 100644 index 00000000..5b148839 --- /dev/null +++ b/original/man3/clock_settime.3 @@ -0,0 +1,3 @@ +.so man2/clock_getres.2 +.\" This link provided in Section 3 because, by historical accident, +.\" the page was originally in Section 3 -- mtk, Feb 2009 diff --git a/original/man3/clog.3 b/original/man3/clog.3 new file mode 100644 index 00000000..f158069b --- /dev/null +++ b/original/man3/clog.3 @@ -0,0 +1,44 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CLOG 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +clog, clogf, clogl \- natural logarithm of a complex number +.SH SYNOPSIS +.B #include +.sp +.BI "double complex clog(double complex " z ); +.br +.BI "float complex clogf(float complex " z ); +.br +.BI "long double complex clogl(long double complex " z ); +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The logarithm +.BR clog () +is the inverse function of the exponential +.BR cexp (3). +Thus, if \fIy\ =\ clog(z)\fP, then \fIz\ =\ cexp(y)\fP. +The imaginary part of +.I y +is chosen in the interval [\-pi,pi]. +.LP +One has: +.nf + + clog(z) = log(cabs(z)) + I * carg(z) +.fi +.LP +Note that +.I z +close to zero will cause an overflow. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR cabs (3), +.BR cexp (3), +.BR clog10 (3), +.BR complex (7) diff --git a/original/man3/clog10.3 b/original/man3/clog10.3 new file mode 100644 index 00000000..a7d48ed6 --- /dev/null +++ b/original/man3/clog10.3 @@ -0,0 +1,43 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CLOG10 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +clog10, clog10f, clog10l \- base-10 logarithm of a complex number +.SH SYNOPSIS +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "double complex clog10(double complex " z ); +.br +.BI "float complex clog10f(float complex " z ); +.br +.BI "long double complex clog10l(long double complex " z ); +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The call +.I clog10(z) +is equivalent to +.IR clog(z)/log(10) . +The other functions perform the same task for +.I float +and +.IR "long double" . + +Note that +.I z +close to zero will cause an overflow. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +This function is a GNU extension. +It is reserved for future use in C99. +.SH "SEE ALSO" +.BR cabs (3), +.BR cexp (3), +.BR clog (3), +.BR clog2 (3), +.BR complex (7), +.BR feature_test_macros (7) diff --git a/original/man3/clog10f.3 b/original/man3/clog10f.3 new file mode 100644 index 00000000..5840d54d --- /dev/null +++ b/original/man3/clog10f.3 @@ -0,0 +1 @@ +.so man3/clog10.3 diff --git a/original/man3/clog10l.3 b/original/man3/clog10l.3 new file mode 100644 index 00000000..5840d54d --- /dev/null +++ b/original/man3/clog10l.3 @@ -0,0 +1 @@ +.so man3/clog10.3 diff --git a/original/man3/clog2.3 b/original/man3/clog2.3 new file mode 100644 index 00000000..37337943 --- /dev/null +++ b/original/man3/clog2.3 @@ -0,0 +1,41 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CLOG2 3 2008-08-07 "" "Linux Programmer's Manual" +.SH NAME +clog2, clog2f, clog2l \- base-2 logarithm of a complex number +.SH SYNOPSIS +.B #include +.sp +.BI "double complex clog2(double complex " z ); +.br +.BI "float complex clog2f(float complex " z ); +.br +.BI "long double complex clog2l(long double complex " z ); +.\" .sp +.\" Link with \fI\-lm\fP. +.SH DESCRIPTION +The call +.I clog2(z) +is equivalent to +.IR clog(z)/log(2) . + +The other functions perform the same task for +.I float +and +.IR "long double" . + +Note that +.I z +close to zero will cause an overflow. +.SH "CONFORMING TO" +These function names are reserved for future use in C99. +.SH AVAILABILITY +Not yet in glibc, as at version 2.8. +.\" But reserved in NAMESPACE. +.SH "SEE ALSO" +.BR cabs (3), +.BR cexp (3), +.BR clog (3), +.BR clog10 (3), +.BR complex (7) diff --git a/original/man3/clog2f.3 b/original/man3/clog2f.3 new file mode 100644 index 00000000..23d68341 --- /dev/null +++ b/original/man3/clog2f.3 @@ -0,0 +1 @@ +.so man3/clog2.3 diff --git a/original/man3/clog2l.3 b/original/man3/clog2l.3 new file mode 100644 index 00000000..23d68341 --- /dev/null +++ b/original/man3/clog2l.3 @@ -0,0 +1 @@ +.so man3/clog2.3 diff --git a/original/man3/clogf.3 b/original/man3/clogf.3 new file mode 100644 index 00000000..3cd9533b --- /dev/null +++ b/original/man3/clogf.3 @@ -0,0 +1 @@ +.so man3/clog.3 diff --git a/original/man3/clogl.3 b/original/man3/clogl.3 new file mode 100644 index 00000000..3cd9533b --- /dev/null +++ b/original/man3/clogl.3 @@ -0,0 +1 @@ +.so man3/clog.3 diff --git a/original/man3/closedir.3 b/original/man3/closedir.3 new file mode 100644 index 00000000..170d49d6 --- /dev/null +++ b/original/man3/closedir.3 @@ -0,0 +1,71 @@ +.\" Copyright (C) 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 Sat Jul 24 21:25:52 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl) +.TH CLOSEDIR 3 2008-09-23 "" "Linux Programmer's Manual" +.SH NAME +closedir \- close a directory +.SH SYNOPSIS +.nf +.B #include +.sp +.B #include +.sp +.BI "int closedir(DIR *" dirp ); +.fi +.SH DESCRIPTION +The +.BR closedir () +function closes the directory stream associated with +\fIdirp\fP. +A successful call to +.BR closedir () +also closes the underlying file descriptor associated with +.IR dirp . +The directory stream descriptor \fIdirp\fP is not available +after this call. +.SH "RETURN VALUE" +The +.BR closedir () +function returns 0 on success. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +Invalid directory stream descriptor \fIdirp\fP. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001, 4.3BSD. +.SH "SEE ALSO" +.BR close (2), +.BR opendir (3), +.BR readdir (3), +.BR rewinddir (3), +.BR scandir (3), +.BR seekdir (3), +.BR telldir (3) diff --git a/original/man3/closelog.3 b/original/man3/closelog.3 new file mode 100644 index 00000000..ec352b29 --- /dev/null +++ b/original/man3/closelog.3 @@ -0,0 +1 @@ +.so man3/syslog.3 diff --git a/original/man3/cmsg.3 b/original/man3/cmsg.3 new file mode 100644 index 00000000..101db7b8 --- /dev/null +++ b/original/man3/cmsg.3 @@ -0,0 +1,216 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: cmsg.3,v 1.8 2000/12/20 18:10:31 ak Exp $ +.TH CMSG 3 2008-11-20 "Linux" "Linux Programmer's Manual" +.SH NAME +CMSG_ALIGN, CMSG_SPACE, CMSG_NXTHDR, CMSG_FIRSTHDR \- Access ancillary data +.SH SYNOPSIS +.B #include +.sp +.BI "struct cmsghdr *CMSG_FIRSTHDR(struct msghdr *" msgh ); +.br +.BI "struct cmsghdr *CMSG_NXTHDR(struct msghdr *" msgh ", struct cmsghdr *" cmsg ); +.br +.BI "size_t CMSG_ALIGN(size_t " length ); +.br +.BI "size_t CMSG_SPACE(size_t " length ); +.br +.BI "size_t CMSG_LEN(size_t " length ); +.br +.BI "unsigned char *CMSG_DATA(struct cmsghdr *" cmsg ); +.sp +.nf +struct cmsghdr { + socklen_t cmsg_len; /* data byte count, including header */ + int cmsg_level; /* originating protocol */ + int cmsg_type; /* protocol-specific type */ + /* followed by unsigned char cmsg_data[]; */ +}; +.fi +.SH DESCRIPTION +These macros are used to create and access control messages (also called +ancillary data) that are not a part of the socket payload. +This control information may +include the interface the packet was received on, various rarely used header +fields, an extended error description, a set of file descriptors or Unix +credentials. +For instance, control messages can be used to send +additional header fields such as IP options. +Ancillary data is sent by calling +.BR sendmsg (2) +and received by calling +.BR recvmsg (2). +See their manual pages for more information. +.PP +Ancillary data is a sequence of +.I struct cmsghdr +structures with appended data. +This sequence should only be accessed +using the macros described in this manual page and never directly. +See the specific protocol man pages for the available control message types. +The maximum ancillary buffer size allowed per socket can be set using +.IR /proc/sys/net/core/optmem_max ; +see +.BR socket (7). +.PP +.BR CMSG_FIRSTHDR () +returns a pointer to the first +.I cmsghdr +in the ancillary +data buffer associated with the passed +.IR msghdr . +.PP +.BR CMSG_NXTHDR () +returns the next valid +.I cmsghdr +after the passed +.IR cmsghdr . +It returns NULL when there isn't enough space left in the buffer. +.PP +.BR CMSG_ALIGN (), +given a length, returns it including the required alignment. +This is a +constant expression. +.PP +.BR CMSG_SPACE () +returns the number of bytes an ancillary element with payload of the +passed data length occupies. +This is a constant expression. +.PP +.BR CMSG_DATA () +returns a pointer to the data portion of a +.IR cmsghdr . +.PP +.BR CMSG_LEN () +returns the value to store in the +.I cmsg_len +member of the +.I cmsghdr +structure, taking into account any necessary +alignment. +It takes the data length as an argument. +This is a constant +expression. +.PP +To create ancillary data, first initialize the +.I msg_controllen +member of the +.I msghdr +with the length of the control message buffer. +Use +.BR CMSG_FIRSTHDR () +on the +.I msghdr +to get the first control message and +.BR CMSG_NEXTHDR () +to get all subsequent ones. +In each control message, initialize +.I cmsg_len +(with +.BR CMSG_LEN ()), +the other +.I cmsghdr +header fields, and the data portion using +.BR CMSG_DATA (). +Finally, the +.I msg_controllen +field of the +.I msghdr +should be set to the sum of the +.BR CMSG_SPACE () +of the length of +all control messages in the buffer. +For more information on the +.IR msghdr , +see +.BR recvmsg (2). +.PP +When the control message buffer is too short to store all messages, the +.B MSG_CTRUNC +flag is set in the +.I msg_flags +member of the +.IR msghdr . +.SH "CONFORMING TO" +This ancillary data model conforms to the POSIX.1g draft, 4.4BSD-Lite, +the IPv6 advanced API described in RFC\ 2292 and the SUSv2. +.BR CMSG_ALIGN () +is a Linux extension. +.SH NOTES +For portability, ancillary data should be accessed only using the macros +described here. +.BR CMSG_ALIGN () +is a Linux extension and should be not used in portable programs. +.PP +In Linux, +.BR CMSG_LEN (), +.BR CMSG_DATA (), +and +.BR CMSG_ALIGN () +are constant expressions (assuming their argument is constant); +this could be used to declare the size of global +variables. +This may be not portable, however. +.SH EXAMPLE +This code looks for the +.B IP_TTL +option in a received ancillary buffer: +.PP +.in +4n +.nf +struct msghdr msgh; +struct cmsghdr *cmsg; +int *ttlptr; +int received_ttl; + +/* Receive auxiliary data in msgh */ +for (cmsg = CMSG_FIRSTHDR(&msgh); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msgh,cmsg)) { + if (cmsg\->cmsg_level == IPPROTO_IP + && cmsg\->cmsg_type == IP_TTL) { + ttlptr = (int *) CMSG_DATA(cmsg); + received_ttl = *ttlptr; + break; + } +} +if (cmsg == NULL) { + /* + * Error: IP_TTL not enabled or small buffer + * or I/O error. + */ +} +.fi +.in +.PP +The code below passes an array of file descriptors over a Unix socket using +.BR SCM_RIGHTS : +.PP +.in +4n +.nf +struct msghdr msg = {0}; +struct cmsghdr *cmsg; +int myfds[NUM_FD]; /* Contains the file descriptors to pass. */ +char buf[CMSG_SPACE(sizeof myfds)]; /* ancillary data buffer */ +int *fdptr; + +msg.msg_control = buf; +msg.msg_controllen = sizeof buf; +cmsg = CMSG_FIRSTHDR(&msg); +cmsg\->cmsg_level = SOL_SOCKET; +cmsg\->cmsg_type = SCM_RIGHTS; +cmsg\->cmsg_len = CMSG_LEN(sizeof(int) * NUM_FD); +/* Initialize the payload: */ +fdptr = (int *) CMSG_DATA(cmsg); +memcpy(fdptr, myfds, NUM_FD * sizeof(int)); +/* Sum of the length of all control messages in the buffer: */ +msg.msg_controllen = cmsg\->cmsg_len; +.fi +.in +.SH "SEE ALSO" +.BR recvmsg (2), +.BR sendmsg (2) +.PP +RFC\ 2292 diff --git a/original/man3/confstr.3 b/original/man3/confstr.3 new file mode 100644 index 00000000..cc5c6337 --- /dev/null +++ b/original/man3/confstr.3 @@ -0,0 +1,147 @@ +.\" 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:53:02 1993 by Rik Faith (faith@cs.unc.edu) +.\" FIXME Many more values for 'name' are supported, some of which +.\" are documented under 'info confstr'. +.\" See for the rest. +.\" These should all be added to this page. +.\" See also the POSIX.1-2001 specification of confstr() +.TH CONFSTR 3 2010-02-03 "GNU" "Linux Programmer's Manual" +.SH NAME +confstr \- get configuration dependent string variables +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t confstr(int " "name" ", char *" buf ", size_t " len ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR confstr (): +_POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE +.SH DESCRIPTION +.BR confstr () +gets the value of configuration-dependent string variables. +.PP +The +.I name +argument is the system variable to be queried. +The following variables are supported: +.TP +.BR _CS_GNU_LIBC_VERSION " (GNU C library only; since glibc 2.3.2)" +A string which identifies the GNU C library version on this system +(e.g, "glibc 2.3.4"). +.TP +.BR _CS_GNU_LIBPTHREAD_VERSION " (GNU C library only; since glibc 2.3.2)" +A string which identifies the POSIX implementation supplied by this +C library (e.g, "NPTL 2.3.4" or "linuxthreads-0.10"). +.TP +.B _CS_PATH +A value for the +.B PATH +variable which indicates where all the POSIX.2 standard utilities can +be found. +.PP +If +.I buf +is not NULL and +.I len +is not zero, +.BR confstr () +copies the value of the string to +.I buf +truncated to +.I len \- 1 +characters if necessary, with a null byte (\(aq\\0\(aq) as terminator. +This can be detected by comparing the return value of +.BR confstr () +against +.IR len . +.PP +If +.I len +is zero and +.I buf +is NULL, +.BR confstr () +just returns the value as defined below. +.SH "RETURN VALUE" +If +.I name +is a valid configuration variable, +.BR confstr () +returns the number of bytes (including the terminating null byte) +that would be required to hold the entire value of that variable. +This value may be greater than +.IR len , +which means that the value in +.I buf +is truncated. + +If +.I name +is a valid configuration variable, +but that variable does not have a value, then +.BR confstr () +returns 0. +If +.I name +does not correspond to a valid configuration variable, +.BR confstr () +returns 0, and +.I errno +is set to +.BR EINVAL . +.SH ERRORS +.TP +.B EINVAL +If the value of +.I name +is invalid. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH EXAMPLE +The following code fragment determines the path where to find +the POSIX.2 system utilities: +.br +.nf +.in +4n + +char *pathbuf; +size_t n; + +n = confstr(_CS_PATH,NULL,(size_t) 0); +pathbuf = malloc(n); +if (pathbuf == NULL) + abort(); +confstr(_CS_PATH, pathbuf, n); +.in +.fi +.SH "SEE ALSO" +.BR sh (1), +.BR exec (3), +.BR system (3) diff --git a/original/man3/conj.3 b/original/man3/conj.3 new file mode 100644 index 00000000..dd376d97 --- /dev/null +++ b/original/man3/conj.3 @@ -0,0 +1,36 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CONJ 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +conj, conjf, conjl \- calculate the complex conjugate +.SH SYNOPSIS +.B #include +.sp +.BI "double complex conj(double complex " z ); +.br +.BI "float complex conjf(float complex " z ); +.br +.BI "long double complex conjl(long double complex " z ); +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The +.BR conj () +function returns the complex conjugate value of +.IR z . +That is the value obtained by changing the sign of the imaginary part. +.LP +One has: +.nf + + cabs(z) = csqrt(z * conj(z)) +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR cabs (3), +.BR sqrt (3), +.BR complex (7) diff --git a/original/man3/conjf.3 b/original/man3/conjf.3 new file mode 100644 index 00000000..ef6093f7 --- /dev/null +++ b/original/man3/conjf.3 @@ -0,0 +1 @@ +.so man3/conj.3 diff --git a/original/man3/conjl.3 b/original/man3/conjl.3 new file mode 100644 index 00000000..ef6093f7 --- /dev/null +++ b/original/man3/conjl.3 @@ -0,0 +1 @@ +.so man3/conj.3 diff --git a/original/man3/copysign.3 b/original/man3/copysign.3 new file mode 100644 index 00000000..7da545cb --- /dev/null +++ b/original/man3/copysign.3 @@ -0,0 +1,83 @@ +.\" 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-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-08-10 by Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.TH COPYSIGN 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.SH NAME +copysign, copysignf, copysignl \- copy sign of a number +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double copysign(double " x ", double " y ); +.br +.BI "float copysignf(float " x ", float " y ); +.br +.BI "long double copysignl(long double " x ", long double " y ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR copysign (), +.BR copysignf (), +.BR copysignl (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR copysign () +functions return a value whose absolute value matches +that of \fIx\fP, but whose sign bit matches that of \fIy\fP. +.SH RETURN VALUE +On success, these functions return a value whose magnitude is taken from +.I x +and whose sign is taken from +.IR y . + +If \fIx\fP is a NaN, +a NaN with the sign bit of \fIy\fP is returned. +.SH ERRORS +No errors occur. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.\" 4.3BSD. +This function is defined in IEC 559 (and the appendix with +recommended functions in IEEE 754/IEEE 854). +.SH NOTES +On architectures where the floating-point formats are not IEEE 754 compliant, +the +.BR copysign () +functions may treat a negative zero as positive. +.SH "SEE ALSO" +.BR signbit (3) diff --git a/original/man3/copysignf.3 b/original/man3/copysignf.3 new file mode 100644 index 00000000..46ef5e6d --- /dev/null +++ b/original/man3/copysignf.3 @@ -0,0 +1 @@ +.so man3/copysign.3 diff --git a/original/man3/copysignl.3 b/original/man3/copysignl.3 new file mode 100644 index 00000000..46ef5e6d --- /dev/null +++ b/original/man3/copysignl.3 @@ -0,0 +1 @@ +.so man3/copysign.3 diff --git a/original/man3/cos.3 b/original/man3/cos.3 new file mode 100644 index 00000000..4ee485ca --- /dev/null +++ b/original/man3/cos.3 @@ -0,0 +1,111 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.TH COS 3 2009-02-04 "" "Linux Programmer's Manual" +.SH NAME +cos, cosf, cosl \- cosine function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double cos(double " x ); +.br +.BI "float cosf(float " x ); +.br +.BI "long double cosl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR cosf (), +.BR cosl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR cos () +function returns the cosine of \fIx\fP, where \fIx\fP is +given in radians. +.SH RETURN VALUE +On success, these functions return the cosine of +.IR x . + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is positive infinity or negative infinity, +a domain error occurs, +and a NaN is returned. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is an infinity +.\" .I errno +.\" is set to +.\" .BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.PP +These functions do not set +.IR errno . +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6780 +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD. +.SH "SEE ALSO" +.BR acos (3), +.BR asin (3), +.BR atan (3), +.BR atan2 (3), +.BR ccos (3), +.BR sin (3), +.BR sincos (3), +.BR tan (3) diff --git a/original/man3/cosf.3 b/original/man3/cosf.3 new file mode 100644 index 00000000..9abaea4b --- /dev/null +++ b/original/man3/cosf.3 @@ -0,0 +1 @@ +.so man3/cos.3 diff --git a/original/man3/cosh.3 b/original/man3/cosh.3 new file mode 100644 index 00000000..b9e657db --- /dev/null +++ b/original/man3/cosh.3 @@ -0,0 +1,127 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" 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) +.\" +.TH COSH 3 2008-08-10 "" "Linux Programmer's Manual" +.SH NAME +cosh, coshf, coshl \- hyperbolic cosine function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double cosh(double " x ); +.br +.BI "float coshf(float " x ); +.br +.BI "long double coshl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR coshf (), +.BR coshl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR cosh () +function returns the hyperbolic cosine of \fIx\fP, which +is defined mathematically as: +.nf + + cosh(x) = (exp(x) + exp(\-x)) / 2 +.fi +.SH "RETURN VALUE" +On success, these functions return the hyperbolic cosine of +.IR x . + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is +0 or \-0, 1 is returned. + +If +.I x +is positive infinity or negative infinity, +positive infinity is returned. + +If the result overflows, +a range error occurs, +and the functions return +.RB + HUGE_VAL , +.RB + HUGE_VALF , +or +.RB + HUGE_VALL , +respectively. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Range error: result overflow +.I errno +is set to +.BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD. +.SH BUGS +In glibc version 2.3.4 and earlier, +an overflow floating-point +.RB ( FE_OVERFLOW ) +exception is not raised when an overflow occurs. +.SH "SEE ALSO" +.BR acosh (3), +.BR asinh (3), +.BR atanh (3), +.BR ccos (3), +.BR sinh (3), +.BR tanh (3) diff --git a/original/man3/coshf.3 b/original/man3/coshf.3 new file mode 100644 index 00000000..e9bab10c --- /dev/null +++ b/original/man3/coshf.3 @@ -0,0 +1 @@ +.so man3/cosh.3 diff --git a/original/man3/coshl.3 b/original/man3/coshl.3 new file mode 100644 index 00000000..e9bab10c --- /dev/null +++ b/original/man3/coshl.3 @@ -0,0 +1 @@ +.so man3/cosh.3 diff --git a/original/man3/cosl.3 b/original/man3/cosl.3 new file mode 100644 index 00000000..9abaea4b --- /dev/null +++ b/original/man3/cosl.3 @@ -0,0 +1 @@ +.so man3/cos.3 diff --git a/original/man3/cpow.3 b/original/man3/cpow.3 new file mode 100644 index 00000000..1714358b --- /dev/null +++ b/original/man3/cpow.3 @@ -0,0 +1,35 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CPOW 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +cpow, cpowf, cpowl \- complex power function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double complex cpow(double complex " x ", complex double " z ");" +.br +.BI "float complex cpowf(float complex " x ", complex float " z ");" +.br +.BI "long double complex cpowl(long double complex " x , +.BI " complex long double " z ");" +.sp +Link with \fI\-lm\fP. +.fi +.SH DESCRIPTION +The function calculates +.I x +raised to the power +.IR z . +(With a branch cut for +.I x +along the negative real axis.) +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR cabs (3), +.BR pow (3), +.BR complex (7) diff --git a/original/man3/cpowf.3 b/original/man3/cpowf.3 new file mode 100644 index 00000000..7577fcdf --- /dev/null +++ b/original/man3/cpowf.3 @@ -0,0 +1 @@ +.so man3/cpow.3 diff --git a/original/man3/cpowl.3 b/original/man3/cpowl.3 new file mode 100644 index 00000000..7577fcdf --- /dev/null +++ b/original/man3/cpowl.3 @@ -0,0 +1 @@ +.so man3/cpow.3 diff --git a/original/man3/cproj.3 b/original/man3/cproj.3 new file mode 100644 index 00000000..7d5d0223 --- /dev/null +++ b/original/man3/cproj.3 @@ -0,0 +1,35 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CPROJ 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +cproj, cprojf, cprojl \- project into Riemann Sphere +.SH SYNOPSIS +.B #include +.sp +.BI "double complex cproj(double complex " z ");" +.br +.BI "float complex cprojf(float complex " z ");" +.br +.BI "long double complex cprojl(long double complex " z ");" +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +This function projects a point in the plane onto the surface of a +Riemann Sphere, the one-point compactification of the complex plane. +Each finite point +.I z +projects to +.I z +itself. +Every complex infinite value is projected to a single infinite value, +namely to positive infinity on the real axis. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH NOTES +The glibc implementation is broken and does something entirely different. +.SH "SEE ALSO" +.BR cabs (3), +.BR complex (7) diff --git a/original/man3/cprojf.3 b/original/man3/cprojf.3 new file mode 100644 index 00000000..0a3f31c6 --- /dev/null +++ b/original/man3/cprojf.3 @@ -0,0 +1 @@ +.so man3/cproj.3 diff --git a/original/man3/cprojl.3 b/original/man3/cprojl.3 new file mode 100644 index 00000000..0a3f31c6 --- /dev/null +++ b/original/man3/cprojl.3 @@ -0,0 +1 @@ +.so man3/cproj.3 diff --git a/original/man3/creal.3 b/original/man3/creal.3 new file mode 100644 index 00000000..3d44c546 --- /dev/null +++ b/original/man3/creal.3 @@ -0,0 +1,38 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CREAL 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +creal, crealf, creall \- get real part of a complex number +.SH SYNOPSIS +.B #include +.sp +.BI "double creal(double complex " z ); +.br +.BI "float crealf(float complex " z ); +.br +.BI "long double creall(long double complex " z ); +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The +.BR creal () +function returns the real part of the complex number +.IR z . +.LP +One has: +.nf + + z = creal(z) + I * cimag(z) +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH NOTES +The gcc supports also __real__. +That is a GNU extension. +.SH "SEE ALSO" +.BR cabs (3), +.BR cimag (3), +.BR complex (7) diff --git a/original/man3/crealf.3 b/original/man3/crealf.3 new file mode 100644 index 00000000..4289f71d --- /dev/null +++ b/original/man3/crealf.3 @@ -0,0 +1 @@ +.so man3/creal.3 diff --git a/original/man3/creall.3 b/original/man3/creall.3 new file mode 100644 index 00000000..4289f71d --- /dev/null +++ b/original/man3/creall.3 @@ -0,0 +1 @@ +.so man3/creal.3 diff --git a/original/man3/crypt.3 b/original/man3/crypt.3 new file mode 100644 index 00000000..11397926 --- /dev/null +++ b/original/man3/crypt.3 @@ -0,0 +1,230 @@ +.\" Michael Haardt (michael@cantor.informatik.rwth.aachen.de) +.\" Sat Sep 3 22:00:30 MET DST 1994 +.\" +.\" 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. +.\" +.\" Sun Feb 19 21:32:25 1995, faith@cs.unc.edu edited details away +.\" +.\" TO DO: This manual page should go more into detail how DES is perturbed, +.\" which string will be encrypted, and what determines the repetition factor. +.\" Is a simple repetition using ECB used, or something more advanced? I hope +.\" the presented explanations are at least better than nothing, but by no +.\" means enough. +.\" +.\" added _XOPEN_SOURCE, aeb, 970705 +.\" added GNU MD5 stuff, aeb, 011223 +.\" +.TH CRYPT 3 2008-08-25 "" "Linux Programmer's Manual" +.SH NAME +crypt, crypt_r \- password and data encryption +.SH SYNOPSIS +.nf +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "char *crypt(const char *" key ", const char *" salt ); +.sp +.BI "char *crypt_r(const char *" key ", const char *" salt , +.BI " struct crypt_data *" data ); +.fi +.sp +Link with \fI\-lcrypt\fP. +.SH DESCRIPTION +.BR crypt () +is the password encryption function. +It is based on the Data Encryption +Standard algorithm with variations intended (among other things) to +discourage use of hardware implementations of a key search. +.PP +.I key +is a user's typed password. +.PP +.I salt +is a two-character string chosen from the set +[\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP]. +This string is used to +perturb the algorithm in one of 4096 different ways. +.PP +By taking the lowest 7 bits of each of the first eight characters of the +.IR key , +a 56-bit key is obtained. +This 56-bit key is used to encrypt repeatedly a +constant string (usually a string consisting of all zeros). +The returned +value points to the encrypted password, a series of 13 printable ASCII +characters (the first two characters represent the salt itself). +The return value points to static data whose content is +overwritten by each call. +.PP +Warning: The key space consists of +.if t 2\s-2\u56\s0\d +.if n 2**56 +equal 7.2e16 possible values. +Exhaustive searches of this key space are +possible using massively parallel computers. +Software, such as +.BR crack (1), +is available which will search the portion of this key space that is +generally used by humans for passwords. +Hence, password selection should, +at minimum, avoid common words and names. +The use of a +.BR passwd (1) +program that checks for crackable passwords during the selection process is +recommended. +.PP +The DES algorithm itself has a few quirks which make the use of the +.BR crypt () +interface a very poor choice for anything other than password +authentication. +If you are planning on using the +.BR crypt () +interface for a cryptography project, don't do it: get a good book on +encryption and one of the widely available DES libraries. + +.BR crypt_r () +is a reentrant version of +.BR crypt (). +The structure pointed to by +.I data +is used to store result data and bookkeeping information. +Other than allocating it, +the only thing that the caller should do with this structure is to set +.I data->initialized +to zero before the first call to +.BR crypt_r (). +.SH "RETURN VALUE" +On success, a pointer to the encrypted password is returned. +On error, NULL is returned. +.SH ERRORS +.TP +.B ENOSYS +The +.BR crypt () +function was not implemented, probably because of U.S.A. export restrictions. +.\" 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 +.\" Making encrypted data computed using crypt() publicly available has +.\" to be considered insecure for the given reasons. +.SH "CONFORMING TO" +.BR crypt (): +SVr4, 4.3BSD, POSIX.1-2001. +.BR crypt_r () +is a GNU extension. +.SH NOTES +.SS Glibc Notes +The glibc2 version of this function supports additional +encryption algorithms. + +If +.I salt +is a character string starting with the characters "$\fIid\fP$" +followed by a string terminated by "$": +.RS + +$\fIid\fP$\fIsalt\fP$\fIencrypted\fP + +.RE +then instead of using the DES machine, +.I id +identifies the encryption method used and this then determines how the rest +of the password string is interpreted. +The following values of +.I id +are supported: +.RS +.TS +l l. +ID | Method +_ +1 | MD5 +2a | Blowfish (not in mainline glibc; added in some + | Linux distributions) +.\" openSUSE has Blowfish, but AFAICS, this option is not supported +.\" natively by glibc -- mtk, Jul 08 +.\" +.\" md5 | Sun MD5 +.\" glibc doesn't appear to natively support Sun MD5; I don't know +.\" if any distros add the support. +5 | SHA-256 (since glibc 2.7) +6 | SHA-512 (since glibc 2.7) +.TE +.RE + +So $5$\fIsalt\fP$\fIencrypted\fP is an SHA-256 encoded +password and $6$\fIsalt\fP$\fIencrypted\fP is an +SHA-512 encoded one. + +"\fIsalt\fP" stands for the up to 16 characters +following "$\fIid\fP$" in the salt. +The encrypted part of the password string is the actual computed password. +The size of this string is fixed: +.TS +l l. +MD5 | 22 characters +SHA-256 | 43 characters +SHA-512 | 86 characters +.TE + +The characters in "\fIsalt\fP" and "\fIencrypted\fP" are drawn from the set +[\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP]. +In the SHA implementation the entire +.I key +is significant (instead of only the first +8 bytes in MD5). +.SH "SEE ALSO" +.BR login (1), +.BR passwd (1), +.BR encrypt (3), +.BR getpass (3), +.BR passwd (5), +.BR feature_test_macros (7) diff --git a/original/man3/crypt_r.3 b/original/man3/crypt_r.3 new file mode 100644 index 00000000..3944ebd5 --- /dev/null +++ b/original/man3/crypt_r.3 @@ -0,0 +1 @@ +.so man3/crypt.3 diff --git a/original/man3/csin.3 b/original/man3/csin.3 new file mode 100644 index 00000000..452befd8 --- /dev/null +++ b/original/man3/csin.3 @@ -0,0 +1,31 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CSIN 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +csin, csinf, csinl \- complex sine function +.SH SYNOPSIS +.B #include +.sp +.BI "double complex csin(double complex " z ");" +.br +.BI "float complex csinf(float complex " z ); +.br +.BI "long double complex csinl(long double complex " z ");" +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The complex sine function is defined as: +.nf + + csin(z) = (exp(i * z) \- exp(\-i * z)) / (2 * i) +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR cabs (3), +.BR ccos (3), +.BR ctan (3), +.BR complex (7) diff --git a/original/man3/csinf.3 b/original/man3/csinf.3 new file mode 100644 index 00000000..1ed2a3e7 --- /dev/null +++ b/original/man3/csinf.3 @@ -0,0 +1 @@ +.so man3/csin.3 diff --git a/original/man3/csinh.3 b/original/man3/csinh.3 new file mode 100644 index 00000000..52f08713 --- /dev/null +++ b/original/man3/csinh.3 @@ -0,0 +1,31 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CSINH 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +csinh, csinhf, csinhl \- complex hyperbolic sine +.SH SYNOPSIS +.B #include +.sp +.BI "double complex csinh(double complex " z ");" +.br +.BI "float complex csinhf(float complex " z ");" +.br +.BI "long double complex csinhl(long double complex " z ");" +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The complex hyperbolic sine function is defined as: +.nf + + csinh(z) = (exp(z)\-exp(\-z))/2 +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR cabs (3), +.BR ccosh (3), +.BR ctanh (3), +.BR complex (7) diff --git a/original/man3/csinhf.3 b/original/man3/csinhf.3 new file mode 100644 index 00000000..9f6d66f9 --- /dev/null +++ b/original/man3/csinhf.3 @@ -0,0 +1 @@ +.so man3/csinh.3 diff --git a/original/man3/csinhl.3 b/original/man3/csinhl.3 new file mode 100644 index 00000000..9f6d66f9 --- /dev/null +++ b/original/man3/csinhl.3 @@ -0,0 +1 @@ +.so man3/csinh.3 diff --git a/original/man3/csinl.3 b/original/man3/csinl.3 new file mode 100644 index 00000000..1ed2a3e7 --- /dev/null +++ b/original/man3/csinl.3 @@ -0,0 +1 @@ +.so man3/csin.3 diff --git a/original/man3/csqrt.3 b/original/man3/csqrt.3 new file mode 100644 index 00000000..22655f3e --- /dev/null +++ b/original/man3/csqrt.3 @@ -0,0 +1,31 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CSQRT 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +csqrt, csqrtf, csqrtl \- complex square root +.SH SYNOPSIS +.B #include +.sp +.BI "double complex csqrt(double complex " z ");" +.br +.BI "float complex csqrtf(float complex " z ");" +.br +.BI "long double complex csqrtl(long double complex " z ");" +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +Calculate the square root of a given complex number, +with nonnegative real part, and +with a branch cut along the negative real axis. +(That means that \fIcsqrt(\-1+eps*I)\fP will be close to I while +\fIcsqrt(\-1\-eps*I)\fP will be close to \-I, \fIif eps\fP is a small positive +real number.) +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR cabs (3), +.BR cexp (3), +.BR complex (7) diff --git a/original/man3/csqrtf.3 b/original/man3/csqrtf.3 new file mode 100644 index 00000000..e3cf3290 --- /dev/null +++ b/original/man3/csqrtf.3 @@ -0,0 +1 @@ +.so man3/csqrt.3 diff --git a/original/man3/csqrtl.3 b/original/man3/csqrtl.3 new file mode 100644 index 00000000..e3cf3290 --- /dev/null +++ b/original/man3/csqrtl.3 @@ -0,0 +1 @@ +.so man3/csqrt.3 diff --git a/original/man3/ctan.3 b/original/man3/ctan.3 new file mode 100644 index 00000000..fedfa7f7 --- /dev/null +++ b/original/man3/ctan.3 @@ -0,0 +1,31 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CTAN 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +ctan, ctanf, ctanl \- complex tangent function +.SH SYNOPSIS +.B #include +.sp +.BI "double complex ctan(double complex " z ");" +.br +.BI "float complex ctanf(float complex " z ); +.br +.BI "long double complex ctanl(long double complex " z ");" +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The complex tangent function is defined as: +.nf + + ctan(z) = csin(z) / ccos(z) +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR cabs (3), +.BR ccos (3), +.BR csin (3), +.BR complex (7) diff --git a/original/man3/ctanf.3 b/original/man3/ctanf.3 new file mode 100644 index 00000000..c0f4a660 --- /dev/null +++ b/original/man3/ctanf.3 @@ -0,0 +1 @@ +.so man3/ctan.3 diff --git a/original/man3/ctanh.3 b/original/man3/ctanh.3 new file mode 100644 index 00000000..25928d28 --- /dev/null +++ b/original/man3/ctanh.3 @@ -0,0 +1,32 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH CTANH 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +ctanh, ctanhf, ctanhl \- complex hyperbolic tangent +.SH SYNOPSIS +.B #include +.sp +.BI "double complex ctanh(double complex " z ");" +.br +.BI "float complex ctanhf(float complex " z ); +.br +.BI "long double complex ctanhl(long double complex " z ");" +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The complex hyperbolic tangent function is defined +mathematically as: +.nf + + ctanh(z) = csinh(z) / ccosh(z) +.fi +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR cabs (3), +.BR ccosh (3), +.BR csinh (3), +.BR complex (7) diff --git a/original/man3/ctanhf.3 b/original/man3/ctanhf.3 new file mode 100644 index 00000000..49b92172 --- /dev/null +++ b/original/man3/ctanhf.3 @@ -0,0 +1 @@ +.so man3/ctanh.3 diff --git a/original/man3/ctanhl.3 b/original/man3/ctanhl.3 new file mode 100644 index 00000000..49b92172 --- /dev/null +++ b/original/man3/ctanhl.3 @@ -0,0 +1 @@ +.so man3/ctanh.3 diff --git a/original/man3/ctanl.3 b/original/man3/ctanl.3 new file mode 100644 index 00000000..c0f4a660 --- /dev/null +++ b/original/man3/ctanl.3 @@ -0,0 +1 @@ +.so man3/ctan.3 diff --git a/original/man3/ctermid.3 b/original/man3/ctermid.3 new file mode 100644 index 00000000..69cc3dba --- /dev/null +++ b/original/man3/ctermid.3 @@ -0,0 +1,68 @@ +.\" 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:51:06 1993 by Rik Faith (faith@cs.unc.edu) +.TH CTERMID 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +ctermid \- get controlling terminal name +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *ctermid(char *" "s" ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR ctermid (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.\" From : _XOPEN_SOURCE +.SH DESCRIPTION +.BR ctermid () +returns a string which is the pathname for the current +controlling terminal for this process. +If +.I s +is NULL, +a static buffer is used, otherwise +.I s +points to a buffer used to hold the terminal pathname. +The symbolic constant +.B L_ctermid +is the maximum number of characters in the returned pathname. +.SH "RETURN VALUE" +The pointer to the pathname. +.SH "CONFORMING TO" +Svr4, POSIX.1-2001. +.SH BUGS +The path returned may not uniquely identify the controlling +terminal; it may, for example, be +.IR /dev/tty . +.PP +It is not assured that the program can open the terminal. +.\" in glibc 2.3.x, x >= 4, the glibc headers threw an error +.\" if ctermid() was given an argument; fixed in 2.4. +.SH "SEE ALSO" +.BR ttyname (3) diff --git a/original/man3/ctime.3 b/original/man3/ctime.3 new file mode 100644 index 00000000..d21ac639 --- /dev/null +++ b/original/man3/ctime.3 @@ -0,0 +1,368 @@ +.\" 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 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 +.\" +.TH CTIME 3 2010-02-25 "" "Linux Programmer's Manual" +.SH NAME +asctime, ctime, gmtime, localtime, mktime, asctime_r, ctime_r, gmtime_r, +localtime_r \- transform date and time to broken-down time or ASCII +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *asctime(const struct tm *" tm ); +.br +.BI "char *asctime_r(const struct tm *" tm ", char *" buf ); +.sp +.BI "char *ctime(const time_t *" timep ); +.br +.BI "char *ctime_r(const time_t *" timep ", char *" buf ); +.sp +.BI "struct tm *gmtime(const time_t *" timep ); +.br +.BI "struct tm *gmtime_r(const time_t *" timep ", struct tm *" result ); +.sp +.BI "struct tm *localtime(const time_t *" timep ); +.br +.BI "struct tm *localtime_r(const time_t *" timep ", struct tm *" result ); +.sp +.BI "time_t mktime(struct tm *" tm ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR asctime_r (), +.BR ctime_r (), +.BR gmtime_r (), +.BR localtime_r (): +.br +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.SH DESCRIPTION +The +.BR ctime (), +.BR gmtime () +and +.BR localtime () +functions all take +an argument of data type \fItime_t\fP which represents calendar time. +When interpreted as an absolute time value, it represents the number of +seconds elapsed since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). +.PP +The +.BR asctime () +and +.BR mktime () +functions both take an argument +representing broken-down time which is a representation +separated into year, month, day, etc. +.PP +Broken-down time is stored +in the structure \fItm\fP which is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct tm { + int tm_sec; /* seconds */ + int tm_min; /* minutes */ + int tm_hour; /* hours */ + int tm_mday; /* day of the month */ + int tm_mon; /* month */ + int tm_year; /* year */ + int tm_wday; /* day of the week */ + int tm_yday; /* day in the year */ + int tm_isdst; /* daylight saving time */ +}; +.fi +.in +.PP +The members of the \fItm\fP structure are: +.TP 10 +.I tm_sec +The number of seconds after the minute, normally in the range 0 to 59, +but can be up to 60 to allow for leap seconds. +.TP +.I tm_min +The number of minutes after the hour, in the range 0 to 59. +.TP +.I tm_hour +The number of hours past midnight, in the range 0 to 23. +.TP +.I tm_mday +The day of the month, in the range 1 to 31. +.TP +.I tm_mon +The number of months since January, in the range 0 to 11. +.TP +.I tm_year +The number of years since 1900. +.TP +.I tm_wday +The number of days since Sunday, in the range 0 to 6. +.TP +.I tm_yday +The number of days since January 1, in the range 0 to 365. +.TP +.I tm_isdst +A flag that indicates whether daylight saving time is in effect at the +time described. +The value is positive if daylight saving time is in +effect, zero if it is not, and negative if the information is not +available. +.PP +The call +.BI ctime( t ) +is equivalent to +.BI asctime(localtime( t )) \fR. +It converts the calendar time \fIt\fP into a +null-terminated string of the form +.sp +.RS +"Wed Jun 30 21:49:08 1993\\n" +.RE +.sp +The abbreviations for the days of the week are "Sun", "Mon", "Tue", "Wed", +"Thu", "Fri", and "Sat". +The abbreviations for the months are "Jan", +"Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", and +"Dec". +The return value points to a statically allocated string which +might be overwritten by subsequent calls to any of the date and time +functions. +The function also sets the external +variables \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP (see +.BR tzset (3)) +with information about the current timezone. +The reentrant version +.BR ctime_r () +does the same, but stores the +string in a user-supplied buffer +which should have room for at least 26 bytes. +It need not +set \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP. +.PP +The +.BR gmtime () +function converts the calendar time \fItimep\fP to +broken-down time representation, expressed in Coordinated Universal Time +(UTC). +It may return NULL when the year does not fit into an integer. +The return value points to a statically allocated struct which might be +overwritten by subsequent calls to any of the date and time functions. +The +.BR gmtime_r () +function does the same, but stores the data in a +user-supplied struct. +.PP +The +.BR localtime () +function converts the calendar time \fItimep\fP to +broken-time representation, expressed relative to the user's specified +timezone. +The function acts as if it called +.BR tzset (3) +and sets the external variables \fItzname\fP with +information about the current timezone, \fItimezone\fP with the difference +between Coordinated Universal Time (UTC) and local standard time in +seconds, and \fIdaylight\fP to a nonzero value if daylight savings +time rules apply during some part of the year. +The return value points to a statically allocated struct which might be +overwritten by subsequent calls to any of the date and time functions. +The +.BR localtime_r () +function does the same, but stores the data in a +user-supplied struct. +It need not set \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP. +.PP +The +.BR asctime () +function converts the broken-down time value +\fItm\fP into a null-terminated string with the same format as +.BR ctime (). +The return value points to a statically allocated string which might be +overwritten by subsequent calls to any of the date and time functions. +The +.BR asctime_r () +function does the same, but stores the string in +a user-supplied buffer which should have room for at least 26 bytes. +.PP +The +.BR mktime () +function converts a broken-down time structure, expressed +as local time, to calendar time representation. +The function ignores +the values supplied by the caller in the +.I tm_wday +and +.I tm_yday +fields. +The value specified in the +.I tm_isdst +field informs +.BR mktime () +whether or not daylight saving time (DST) +is in effect for the time supplied in the +.I tm +structure: +a positive value means DST is in effect; +zero means that DST is not in effect; +and a negative value means that +.BR mktime () +should (use timezone information and system databases to) +attempt to determine whether DST is in effect at the specified time. + +The +.BR mktime () +function modifies the fields of the +.IR tm +structure as follows: +.I tm_wday +and +.I tm_yday +are set to values determined from the contents of the other fields; +if structure members are outside their valid interval, they will be +normalized (so that, for example, 40 October is changed into 9 November); +.I tm_isdst +is set (regardless of its initial value) +to a positive value or to 0, respectively, +to indicate whether DST is or is not in effect at the specified time. +Calling +.BR mktime () +also sets the external variable \fItzname\fP with +information about the current timezone. + +If the specified broken-down +time cannot be represented as calendar time (seconds since the Epoch), +.BR mktime () +returns a value of +.I (time_t)\ \-1 +and does not alter the +members of the broken-down time structure. +.SH "RETURN VALUE" +Each of these functions returns the value described, or NULL +(\-1 in case of +.BR mktime ()) +in case an error was detected. +.SH "CONFORMING TO" +POSIX.1-2001. +C89 and C99 specify +.BR asctime (), +.BR ctime (), +.BR gmtime (), +.BR localtime (), +and +.BR mktime (). +POSIX.1-2008 marks +.BR asctime (), +.BR asctime_r (), +.BR ctime (), +and +.BR ctime_r () +as obsolete, +recommending the use of +.BR strftime (3) +instead. +.SH NOTES +The four functions +.BR asctime (), +.BR ctime (), +.BR gmtime () +and +.BR localtime () +return a pointer to static data and hence are not thread-safe. +Thread-safe versions +.BR asctime_r (), +.BR ctime_r (), +.BR gmtime_r () +and +.BR localtime_r () +are specified by SUSv2, and available since libc 5.2.5. + +POSIX.1-2001 says: +"The +.BR asctime (), +.BR ctime (), +.BR gmtime (), +and +.BR localtime () +functions shall return values in one of two static objects: +a broken-down time structure and an array of type +.IR char . +Execution of any of the functions may overwrite the information returned +in either of these objects by any of the other functions." +This can occur in the glibc implementation. +.LP +In many implementations, including glibc, a 0 in +.I tm_mday +is interpreted as meaning the last day of the preceding month. +.LP +The glibc version of \fIstruct tm\fP has additional fields +.sp +.RS +.nf +long tm_gmtoff; /* Seconds east of UTC */ +const char *tm_zone; /* Timezone abbreviation */ +.fi +.RE +.sp +defined when +.B _BSD_SOURCE +was set before including +.IR . +This is a BSD extension, present in 4.3BSD-Reno. + +According to POSIX.1-2004, +.BR localtime () +is required to behave as though +.BR tzset () +was called, while +.BR localtime_r () +does not have this requirement. +.\" See http://thread.gmane.org/gmane.comp.time.tz/2034/ +For portable code +.BR tzset () +should be called before +.BR localtime_r (). +.SH "SEE ALSO" +.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) diff --git a/original/man3/ctime_r.3 b/original/man3/ctime_r.3 new file mode 100644 index 00000000..84a3baa9 --- /dev/null +++ b/original/man3/ctime_r.3 @@ -0,0 +1 @@ +.so man3/ctime.3 diff --git a/original/man3/cuserid.3 b/original/man3/cuserid.3 new file mode 100644 index 00000000..b6d53bf7 --- /dev/null +++ b/original/man3/cuserid.3 @@ -0,0 +1 @@ +.so man3/getlogin.3 diff --git a/original/man3/daemon.3 b/original/man3/daemon.3 new file mode 100644 index 00000000..dabe1be8 --- /dev/null +++ b/original/man3/daemon.3 @@ -0,0 +1,104 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)daemon.3 8.1 (Berkeley) 6/9/93 +.\" Added mentioning of glibc weirdness wrt unistd.h. 5/11/98, Al Viro +.TH DAEMON 3 2009-12-05 "GNU" "Linux Programmer's Manual" +.SH NAME +daemon \- run in the background +.SH SYNOPSIS +.B #include +.sp +.BI "int daemon(int " nochdir ", int " noclose ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR daemon (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.SH DESCRIPTION +The +.BR daemon () +function is for programs wishing to detach themselves from the +controlling terminal and run in the background as system daemons. +.PP +If +.I nochdir +is zero, +.BR daemon () +changes the calling process's current working directory +to the root directory ("/"); +otherwise, the current working directory is left unchanged. +.PP +If +.I noclose +is zero, +.BR daemon () +redirects standard input, standard output and standard error +to \fI/dev/null\fP; +otherwise, no changes are made to these file descriptors. +.SH "RETURN VALUE" +(This function forks, and if the +.BR fork (2) +succeeds, the parent calls +.\" not .IR in order not to underline _ +.BR _exit (2), +so that further errors are seen by the child only.) +On success +.BR daemon () +returns zero. +If an error occurs, +.BR daemon () +returns \-1 and sets +.I errno +to any of the errors specified for the +.BR fork (2) +and +.BR setsid (2). +.SH CONFORMING TO +Not in POSIX.1-2001. +A similar function appears on the BSDs. +The +.BR daemon () +function first appeared in 4.4BSD. +.SH NOTES +The glibc implementation can also return \-1 when +.I /dev/null +exists but is not a character device with the expected +major and minor numbers. +In this case +.I errno +need not be set. +.SH "SEE ALSO" +.BR fork (2), +.BR setsid (2) diff --git a/original/man3/daylight.3 b/original/man3/daylight.3 new file mode 100644 index 00000000..80907636 --- /dev/null +++ b/original/man3/daylight.3 @@ -0,0 +1 @@ +.so man3/tzset.3 diff --git a/original/man3/db.3 b/original/man3/db.3 new file mode 100644 index 00000000..03ede663 --- /dev/null +++ b/original/man3/db.3 @@ -0,0 +1 @@ +.so man3/dbopen.3 diff --git a/original/man3/dbopen.3 b/original/man3/dbopen.3 new file mode 100644 index 00000000..fa403ffb --- /dev/null +++ b/original/man3/dbopen.3 @@ -0,0 +1,552 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)dbopen.3 8.5 (Berkeley) 1/2/94 +.\" +.TH DBOPEN 3 1994-01-02 "" "Linux Programmer's Manual" +.UC 7 +.SH NAME +dbopen \- database access methods +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include + +.BI "DB *dbopen(const char *" file ", int " flags ", int " mode \ +", DBTYPE " type , +.BI " const void *" openinfo ); +.fi +.SH DESCRIPTION +.BR dbopen () +is the library interface to database files. +The supported file formats are btree, hashed and UNIX file oriented. +The btree format is a representation of a sorted, balanced tree structure. +The hashed format is an extensible, dynamic hashing scheme. +The flat-file format is a byte stream file with fixed or variable length +records. +The formats and file format specific information are described in detail +in their respective manual pages +.BR btree (3), +.BR hash (3) +and +.BR recno (3). +.PP +.BR dbopen () +opens +.I file +for reading and/or writing. +Files never intended to be preserved on disk may be created by setting +the +.I file +argument to NULL. +.PP +The +.I flags +and +.I mode +arguments are as specified to the +.BR open (2) +routine, however, only the +.BR O_CREAT , +.BR O_EXCL , +.BR O_EXLOCK , +.BR O_NONBLOCK , +.BR O_RDONLY , +.BR O_RDWR , +.BR O_SHLOCK , +and +.B O_TRUNC +flags are meaningful. +(Note, opening a database file +.B O_WRONLY +is not possible.) +.\"Three additional options may be specified by +.\".IR or 'ing +.\"them into the +.\".I flags +.\"argument. +.\".TP +.\"DB_LOCK +.\"Do the necessary locking in the database to support concurrent access. +.\"If concurrent access isn't needed or the database is read-only this +.\"flag should not be set, as it tends to have an associated performance +.\"penalty. +.\".TP +.\"DB_SHMEM +.\"Place the underlying memory pool used by the database in shared +.\"memory. +.\"Necessary for concurrent access. +.\".TP +.\"DB_TXN +.\"Support transactions in the database. +.\"The DB_LOCK and DB_SHMEM flags must be set as well. +.PP +The +.I type +argument is of type +.I DBTYPE +(as defined in the +.I +include file) and +may be set to +.BR DB_BTREE , +.BR DB_HASH , +or +.BR DB_RECNO . +.PP +The +.I openinfo +argument is a pointer to an access method specific structure described +in the access method's manual page. +If +.I openinfo +is NULL, each access method will use defaults appropriate for the system +and the access method. +.PP +.BR dbopen () +returns a pointer to a +.I DB +structure on success and NULL on error. +The +.I DB +structure is defined in the +.I +include file, and contains at +least the following fields: +.sp +.in +4n +.nf +typedef struct { + DBTYPE type; + int (*close)(const DB *db); + int (*del)(const DB *db, const DBT *key, unsigned int flags); + int (*fd)(const DB *db); + int (*get)(const DB *db, DBT *key, DBT *data, + unsigned int flags); + int (*put)(const DB *db, DBT *key, const DBT *data, + unsigned int flags); + int (*sync)(const DB *db, unsigned int flags); + int (*seq)(const DB *db, DBT *key, DBT *data, + unsigned int flags); +} DB; +.fi +.in +.PP +These elements describe a database type and a set of functions performing +various actions. +These functions take a pointer to a structure as returned by +.BR dbopen (), +and sometimes one or more pointers to key/data structures and a flag value. +.TP +.I type +The type of the underlying access method (and file format). +.TP +.I close +A pointer to a routine to flush any cached information to disk, free any +allocated resources, and close the underlying file(s). +Since key/data pairs may be cached in memory, failing to sync the file +with a +.I close +or +.I sync +function may result in inconsistent or lost information. +.I close +routines return \-1 on error (setting +.IR errno ) +and 0 on success. +.TP +.I del +A pointer to a routine to remove key/data pairs from the database. +.IP +The argument +.I flag +may be set to the following value: +.RS +.TP +.B R_CURSOR +Delete the record referenced by the cursor. +The cursor must have previously been initialized. +.RE +.IP +.I delete +routines return \-1 on error (setting +.IR errno ), +0 on success, and 1 if the specified +.I key +was not in the file. +.TP +.I fd +A pointer to a routine which returns a file descriptor representative +of the underlying database. +A file descriptor referencing the same file will be returned to all +processes which call +.BR dbopen () +with the same +.I file +name. +This file descriptor may be safely used as an argument to the +.BR fcntl (2) +and +.BR flock (2) +locking functions. +The file descriptor is not necessarily associated with any of the +underlying files used by the access method. +No file descriptor is available for in memory databases. +.I fd +routines return \-1 on error (setting +.IR errno ), +and the file descriptor on success. +.TP +.I get +A pointer to a routine which is the interface for keyed retrieval from +the database. +The address and length of the data associated with the specified +.I key +are returned in the structure referenced by +.IR data . +.I get +routines return \-1 on error (setting +.IR errno ), +0 on success, and 1 if the +.I key +was not in the file. +.TP +.I put +A pointer to a routine to store key/data pairs in the database. +.IP +The argument +.I flag +may be set to one of the following values: +.RS +.TP +.B R_CURSOR +Replace the key/data pair referenced by the cursor. +The cursor must have previously been initialized. +.TP +.B R_IAFTER +Append the data immediately after the data referenced by +.IR key , +creating a new key/data pair. +The record number of the appended key/data pair is returned in the +.I key +structure. +(Applicable only to the +.B DB_RECNO +access method.) +.TP +.B R_IBEFORE +Insert the data immediately before the data referenced by +.IR key , +creating a new key/data pair. +The record number of the inserted key/data pair is returned in the +.I key +structure. +(Applicable only to the +.B DB_RECNO +access method.) +.TP +.B R_NOOVERWRITE +Enter the new key/data pair only if the key does not previously exist. +.TP +.B R_SETCURSOR +Store the key/data pair, setting or initializing the position of the +cursor to reference it. +(Applicable only to the +.B DB_BTREE +and +.B DB_RECNO +access methods.) +.RE +.IP +.B R_SETCURSOR +is available only for the +.B DB_BTREE +and +.B DB_RECNO +access +methods because it implies that the keys have an inherent order +which does not change. +.IP +.B R_IAFTER +and +.B R_IBEFORE +are available only for the +.B DB_RECNO +access method because they each imply that the access method is able to +create new keys. +This is only true if the keys are ordered and independent, record numbers +for example. +.IP +The default behavior of the +.I put +routines is to enter the new key/data pair, replacing any previously +existing key. +.IP +.I put +routines return \-1 on error (setting +.IR errno ), +0 on success, and 1 if the +.B R_NOOVERWRITE +.I flag +was set and the key already exists in the file. +.TP +.I seq +A pointer to a routine which is the interface for sequential +retrieval from the database. +The address and length of the key are returned in the structure +referenced by +.IR key , +and the address and length of the data are returned in the +structure referenced +by +.IR data . +.IP +Sequential key/data pair retrieval may begin at any time, and the +position of the "cursor" is not affected by calls to the +.IR del , +.IR get , +.IR put , +or +.I sync +routines. +Modifications to the database during a sequential scan will be reflected +in the scan, that is, +records inserted behind the cursor will not be returned +while records inserted in front of the cursor will be returned. +.IP +The flag value +.B must +be set to one of the following values: +.RS +.TP +.B R_CURSOR +The data associated with the specified key is returned. +This differs from the +.I get +routines in that it sets or initializes the cursor to the location of +the key as well. +(Note, for the +.B DB_BTREE +access method, the returned key is not necessarily an +exact match for the specified key. +The returned key is the smallest key greater than or equal to the specified +key, permitting partial key matches and range searches.) +.TP +.B R_FIRST +The first key/data pair of the database is returned, and the cursor +is set or initialized to reference it. +.TP +.B R_LAST +The last key/data pair of the database is returned, and the cursor +is set or initialized to reference it. +(Applicable only to the +.B DB_BTREE +and +.B DB_RECNO +access methods.) +.TP +.B R_NEXT +Retrieve the key/data pair immediately after the cursor. +If the cursor is not yet set, this is the same as the +.B R_FIRST +flag. +.TP +.B R_PREV +Retrieve the key/data pair immediately before the cursor. +If the cursor is not yet set, this is the same as the +.B R_LAST +flag. +(Applicable only to the +.B DB_BTREE +and +.B DB_RECNO +access methods.) +.RE +.IP +.B R_LAST +and +.B R_PREV +are available only for the +.B DB_BTREE +and +.B DB_RECNO +access methods because they each imply that the keys have an inherent +order which does not change. +.IP +.I seq +routines return \-1 on error (setting +.IR errno ), +0 on success and 1 if there are no key/data pairs less than or greater +than the specified or current key. +If the +.B DB_RECNO +access method is being used, and if the database file +is a character special file and no complete key/data pairs are currently +available, the +.I seq +routines return 2. +.TP +.I sync +A pointer to a routine to flush any cached information to disk. +If the database is in memory only, the +.I sync +routine has no effect and will always succeed. +.IP +The flag value may be set to the following value: +.RS +.TP +.B R_RECNOSYNC +If the +.B DB_RECNO +access method is being used, this flag causes +the sync routine to apply to the btree file which underlies the +recno file, not the recno file itself. +(See the +.I bfname +field of the +.BR recno (3) +manual page for more information.) +.RE +.IP +.I sync +routines return \-1 on error (setting +.IR errno ) +and 0 on success. +.SS "Key/Data Pairs" +Access to all file types is based on key/data pairs. +Both keys and data are represented by the following data structure: +.in +4n +.nf + +typedef struct { + void *data; + size_t size; +} DBT; +.fi +.in +.PP +The elements of the +.I DBT +structure are defined as follows: +.TP +.I data +A pointer to a byte string. +.TP +.I size +The length of the byte string. +.PP +Key and data byte strings may reference strings of essentially unlimited +length although any two of them must fit into available memory at the same +time. +It should be noted that the access methods provide no guarantees about +byte string alignment. +.SH ERRORS +The +.BR dbopen () +routine may fail and set +.I errno +for any of the errors specified for the library routines +.BR open (2) +and +.BR malloc (3) +or the following: +.TP +.B EFTYPE +A file is incorrectly formatted. +.TP +.B EINVAL +A parameter has been specified (hash function, pad byte etc.) that is +incompatible with the current file specification or which is not +meaningful for the function (for example, use of the cursor without +prior initialization) or there is a mismatch between the version +number of file and the software. +.PP +The +.I close +routines may fail and set +.I errno +for any of the errors specified for the library routines +.BR close (2), +.BR read (2), +.BR write (2), +.BR free (3), +or +.BR fsync (2). +.PP +The +.IR del , +.IR get , +.I put +and +.I seq +routines may fail and set +.I errno +for any of the errors specified for the library routines +.BR read (2), +.BR write (2), +.BR free (3) +or +.BR malloc (3). +.PP +The +.I fd +routines will fail and set +.I errno +to +.B ENOENT +for in memory databases. +.PP +The +.I sync +routines may fail and set +.I errno +for any of the errors specified for the library routine +.BR fsync (2). +.SH BUGS +The typedef +.I DBT +is a mnemonic for "data base thang", and was used +because no-one could think of a reasonable name that wasn't already used. +.PP +The file descriptor interface is a kludge and will be deleted in a +future version of the interface. +.PP +None of the access methods provide any form of concurrent access, +locking, or transactions. +.SH "SEE ALSO" +.BR btree (3), +.BR hash (3), +.BR mpool (3), +.BR recno (3) +.sp +.IR "LIBTP: Portable, Modular Transactions for UNIX" , +Margo Seltzer, Michael Olson, USENIX proceedings, Winter 1992. diff --git a/original/man3/des_crypt.3 b/original/man3/des_crypt.3 new file mode 100644 index 00000000..55f228da --- /dev/null +++ b/original/man3/des_crypt.3 @@ -0,0 +1,138 @@ +.\" @(#)des_crypt.3 2.1 88/08/11 4.0 RPCSRC; from 1.16 88/03/02 SMI; +.\" +.\" Taken from libc4 sources, which say: +.\" Copyright (C) 1993 Eric Young - can be distributed under GPL. +.\" +.\" However, the above header line suggests that this file in fact is +.\" Copyright Sun Microsystems, Inc (and is provided for unrestricted use, +.\" see other Sun RPC sources). +.\" +.TH DES_CRYPT 3 2007-05-18 "" "Linux Programmer's Manual" +.SH NAME +des_crypt, ecb_crypt, cbc_crypt, des_setparity, DES_FAILED \- fast +DES encryption +.SH SYNOPSIS +.nf +.\" Sun version +.\" .B #include +.B #include +.LP +.BI "int ecb_crypt(char *" key ", char *" data ", unsigned " datalen , +.BI " unsigned " mode ); +.LP +.BI "int cbc_crypt(char *" key ", char *" data ", unsigned " datalen , +.BI " unsigned " mode ", char *" ivec ); +.LP +.BI "void des_setparity(char *" key ); +.LP +.BI "int DES_FAILED(int " status ); +.fi +.SH DESCRIPTION +.BR ecb_crypt () +and +.BR cbc_crypt () +implement the +NBS +DES +(Data Encryption Standard). +These routines are faster and more general purpose than +.BR crypt (3). +They also are able to utilize +DES +hardware if it is available. +.BR ecb_crypt () +encrypts in +ECB +(Electronic Code Book) +mode, which encrypts blocks of data independently. +.BR cbc_crypt () +encrypts in +CBC +(Cipher Block Chaining) +mode, which chains together +successive blocks. +CBC +mode protects against insertions, deletions and +substitutions of blocks. +Also, regularities in the clear text will +not appear in the cipher text. +.LP +Here is how to use these routines. +The first argument, +.IR key , +is the 8-byte encryption key with parity. +To set the key's parity, which for +DES +is in the low bit of each byte, use +.BR des_setparity (). +The second argument, +.IR data , +contains the data to be encrypted or decrypted. +The +third argument, +.IR datalen , +is the length in bytes of +.IR data , +which must be a multiple of 8. +The fourth argument, +.IR mode , +is formed by +OR 'ing +together some things. +For the encryption direction OR in either +.BR DES_ENCRYPT +or +.BR DES_DECRYPT . +For software versus hardware +encryption, OR in either +.BR DES_HW +or +.BR DES_SW . +If +.BR DES_HW +is specified, and there is no hardware, then the encryption is performed +in software and the routine returns +.BR DESERR_NOHWDEVICE . +For +.BR cbc_crypt (), +the argument +.I ivec +is the 8-byte initialization +vector for the chaining. +It is updated to the next initialization +vector upon return. +.SH RETURN VALUE +.PD 0 +.TP 20 +.BR DESERR_NONE +No error. +.TP +.BR DESERR_NOHWDEVICE +Encryption succeeded, but done in software instead of the requested hardware. +.TP +.BR DESERR_HWERROR +An error occurred in the hardware or driver. +.TP +.BR DESERR_BADPARAM +Bad argument to routine. +.PD +.LP +Given a result status +.IR stat , +the macro +.\" .BR DES_FAILED\c +.\" .BR ( stat ) +.BI DES_FAILED( stat ) +is false only for the first two statuses. +.\" So far the Sun page +.\" Some additions - aeb +.SH VERSIONS +These routines are present in libc 4.6.27 and later, and in +glibc 2.1 and later. +.SH "CONFORMING TO" +4.3BSD. +Not in POSIX.1-2001. +.SH "SEE ALSO" +.BR des (1), +.BR crypt (3), +.BR xcrypt (3) diff --git a/original/man3/des_setparity.3 b/original/man3/des_setparity.3 new file mode 100644 index 00000000..853c9cbd --- /dev/null +++ b/original/man3/des_setparity.3 @@ -0,0 +1 @@ +.so man3/des_crypt.3 diff --git a/original/man3/difftime.3 b/original/man3/difftime.3 new file mode 100644 index 00000000..fde72e54 --- /dev/null +++ b/original/man3/difftime.3 @@ -0,0 +1,71 @@ +.\" 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 Sat Jul 24 19:48:17 1993 by Rik Faith (faith@cs.unc.edu) +.TH DIFFTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual" +.SH NAME +difftime \- calculate time difference +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double difftime(time_t " time1 ", time_t " time0 ); +.fi +.SH DESCRIPTION +The +.BR difftime () +function returns the number of seconds elapsed +between time \fItime1\fP and time \fItime0\fP, represented as a +.IR double . +Each of the times is specified in calendar time, which means its +value is a measurement (in seconds) relative to the +Epoch, 1970-01-01 00:00:00 +0000 (UTC). +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99. +.SH NOTES +On a POSIX system, +.I time_t +is an arithmetic type, and one could just +define +.RS +.nf + +#define difftime(t1,t0) (double)(t1 \- t0) + +.fi +.RE +when the possible overflow in the subtraction is not a concern. +On other systems, the data type +.I time_t +might use some other encoding +where subtraction doesn't work directly. +.SH "SEE ALSO" +.BR date (1), +.BR gettimeofday (2), +.BR time (2), +.BR ctime (3), +.BR gmtime (3), +.BR localtime (3) diff --git a/original/man3/dirfd.3 b/original/man3/dirfd.3 new file mode 100644 index 00000000..8b4971e9 --- /dev/null +++ b/original/man3/dirfd.3 @@ -0,0 +1,91 @@ +.\" Copyright (C) 2002 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. +.\" +.TH DIRFD 3 2008-08-21 "Linux" "Linux Programmer's Manual" +.SH NAME +dirfd \- get directory stream file descriptor +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "int dirfd(DIR *" dirp ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR dirfd (): +_BSD_SOURCE || _SVID_SOURCE +.SH DESCRIPTION +The function +.BR dirfd () +returns the file descriptor associated with the directory stream +.IR dirp . +.LP +This descriptor is the one used internally by the directory stream. +As a result, it is only useful for functions which do not depend on +or alter the file position, such as +.BR fstat (2) +and +.BR fchdir (2). +It will be automatically closed when +.BR closedir (3) +is called. +.SH RETURN VALUE +On success, a nonnegative file descriptor is returned. +On error, \-1 is returned. +.SH ERRORS +POSIX.1-2008 specifies two errors, +neither of which is returned by the current +.\" glibc 2.8 +implementation. +.TP +.B EINVAL +.I dirp +does not refer to a valid directory stream. +.TP +.B ENOTSUP +The implementation does not support the association of a file +descriptor with a directory. +.SH "CONFORMING TO" +POSIX.1-2008. +This function was a BSD extension, present in 4.3BSD-Reno, not in 4.2BSD. +.\" It is present in libc5 (since 5.1.2) and in glibc2. +.SH NOTES +The prototype for +.BR dirfd () +is only available if +.B _BSD_SOURCE +or +.B _SVID_SOURCE +is defined. +.SH "SEE ALSO" +.BR open (2), +.BR closedir (3), +.BR opendir (3), +.BR readdir (3), +.BR rewinddir (3), +.BR scandir (3), +.BR seekdir (3), +.BR telldir (3) diff --git a/original/man3/dirname.3 b/original/man3/dirname.3 new file mode 100644 index 00000000..9099c1ad --- /dev/null +++ b/original/man3/dirname.3 @@ -0,0 +1 @@ +.so man3/basename.3 diff --git a/original/man3/div.3 b/original/man3/div.3 new file mode 100644 index 00000000..9bcd2b54 --- /dev/null +++ b/original/man3/div.3 @@ -0,0 +1,99 @@ +.\" 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-07-24, Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-08-10, 2003-11-01 Walter Harms, aeb +.\" +.TH DIV 3 2007-07-26 "" "Linux Programmer's Manual" +.SH NAME +div, ldiv, lldiv, imaxdiv \- compute quotient and remainder of +an integer division +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "div_t div(int " numerator ", int " denominator ); +.br +.BI "ldiv_t ldiv(long " numerator ", long " denominator ); +.br +.BI "lldiv_t lldiv(long long " numerator ", long long " denominator ); +.sp +.B #include +.sp +.BI "imaxdiv_t imaxdiv(intmax_t " numerator ", intmax_t " denominator ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR lldiv (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.SH DESCRIPTION +The +.BR div () +function computes the value +\fInumerator\fP/\fIdenominator\fP and +returns the quotient and remainder in a structure +named \fIdiv_t\fP that contains +two integer members (in unspecified order) named \fIquot\fP and \fIrem\fP. +The quotient is rounded towards zero. +The result satisfies \fIquot\fP*\fIdenominator\fP+\fIrem\fP = \fInumerator\fP. +.LP +The +.BR ldiv (), +.BR lldiv (), +and +.BR imaxdiv () +functions do the same, +dividing numbers of the indicated type and +returning the result in a structure +of the indicated name, in all cases with fields \fIquot\fP and \fIrem\fP +of the same type as the function arguments. +.SH "RETURN VALUE" +The \fIdiv_t\fP (etc.) structure. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89. +The functions +.BR lldiv () +and +.BR imaxdiv () +were added in C99. +.SH EXAMPLE +After +.nf + + div_t q = div(\-5, 3); + +.fi +the values \fIq.quot\fP and \fIq.rem\fP are \-1 and \-2, respectively. +.SH "SEE ALSO" +.BR abs (3), +.BR remainder (3) diff --git a/original/man3/dl_iterate_phdr.3 b/original/man3/dl_iterate_phdr.3 new file mode 100644 index 00000000..8a1d0472 --- /dev/null +++ b/original/man3/dl_iterate_phdr.3 @@ -0,0 +1,205 @@ +.\" Copyright (c) 2003 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. +.\" License. +.\" +.TH DL_ITERATE_PHDR 3 2007-05-18 "GNU" "Linux Programmer's Manual" +.SH NAME +dl_iterate_phdr \- walk through list of shared objects +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +\fBint dl_iterate_phdr(\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 +.SH DESCRIPTION +The +.BR dl_iterate_phdr () +function allows an application to inquire at run time to find +out which shared objects it has loaded. + +The +.BR dl_iterate_phdr () +function walks through the list of an +application's shared objects and calls the function +.I callback +once for each object, +until either all shared objects have been processed or +.I callback +returns a nonzero value. + +Each call to +.I callback +receives three arguments: +.IR info , +which is a pointer to a structure containing information +about the shared object; +.IR size , +which is the size of the structure pointed to by +.IR info ; +and +.IR data , +which is a copy of whatever value was passed by the calling +program as the second argument (also named +.IR data ) +in the call to +.BR dl_iterate_phdr (). + +The +.I info +argument is a structure of the following type: + +.in +4n +.nf +struct dl_phdr_info { + ElfW(Addr) dlpi_addr; /* Base address of object */ + const char *dlpi_name; /* (Null-terminated) name of + object */ + const ElfW(Phdr) *dlpi_phdr; /* Pointer to array of + ELF program headers + for this object */ + ElfW(Half) dlpi_phnum; /* # of items in \fIdlpi_phdr\fP */ +}; +.fi +.in + +(The +.IR ElfW () +macro definition turns its argument into the name of an ELF data +type suitable for the hardware architecture. +For example, on a 32-bit platform, +ElfW(Addr) yields the data type name Elf32_Addr. +Further information on these types can be found in the +.IR " and " +header files.) + +The +.I dlpi_addr +field indicates the base address of the shared object +(i.e., the difference between the virtual memory address of +the shared object and the offset of that object in the file +from which it was loaded). +The +.I dlpi_name +field is a null-terminated string giving the pathname +from which the shared object was loaded. + +To understand the meaning of the +.I dlpi_phdr +and +.I dlpi_phnum +fields, we need to be aware that an ELF shared object consists +of a number of segments, each of which has a corresponding +program header describing the segment. +The +.I dlpi_phdr +field is a pointer to an array of the program headers for this +shared object. +The +.I dlpi_phnum +field indicates the size of this array. + +These program headers are structures of the following form: +.in +4n +.nf + +typedef struct { + Elf32_Word p_type; /* Segment type */ + Elf32_Off p_offset; /* Segment file offset */ + Elf32_Addr p_vaddr; /* Segment virtual address */ + Elf32_Addr p_paddr; /* Segment physical address */ + Elf32_Word p_filesz; /* Segment size in file */ + Elf32_Word p_memsz; /* Segment size in memory */ + Elf32_Word p_flags; /* Segment flags */ + Elf32_Word p_align; /* Segment alignment */ +} Elf32_Phdr; +.fi +.in + +Note that we can calculate the location of a particular program header, +.IR x , +in virtual memory using the formula: + +.nf + addr == info\->dlpi_addr + info\->dlpi_phdr[x].p_vaddr; +.fi +.SH RETURN VALUE +The +.BR dl_iterate_phdr () +function returns whatever value was returned by the last call to +.IR callback . +.SH VERSIONS +.BR dl_iterate_phdr () +has been supported in glibc since version 2.2.4. +.SH "CONFORMING TO" +The +.BR dl_iterate_phdr () +function is Linux-specific and should be avoided in portable applications. +.SH EXAMPLE +The following program displays a list of pathnames of the +shared objects it has loaded. +For each shared object, the program lists the virtual addresses +at which the object's ELF segments are loaded. + +.nf +#define _GNU_SOURCE +#include +#include +#include + +static int +callback(struct dl_phdr_info *info, size_t size, void *data) +{ + int j; + + printf("name=%s (%d segments)\\n", info\->dlpi_name, + info\->dlpi_phnum); + + for (j = 0; j < info\->dlpi_phnum; j++) + printf("\\t\\t header %2d: address=%10p\\n", j, + (void *) (info\->dlpi_addr + info\->dlpi_phdr[j].p_vaddr)); + return 0; +} + +int +main(int argc, char *argv[]) +{ + dl_iterate_phdr(callback, NULL); + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR ldd (1), +.BR objdump (1), +.BR readelf (1), +.BR dlopen (3), +.BR elf (5), +.BR feature_test_macros (7), +.BR ld.so (8), +and the +.I "Executable and Linking Format Specification" +available at various locations online. diff --git a/original/man3/dladdr.3 b/original/man3/dladdr.3 new file mode 100644 index 00000000..15d09680 --- /dev/null +++ b/original/man3/dladdr.3 @@ -0,0 +1 @@ +.so man3/dlopen.3 diff --git a/original/man3/dlclose.3 b/original/man3/dlclose.3 new file mode 100644 index 00000000..15d09680 --- /dev/null +++ b/original/man3/dlclose.3 @@ -0,0 +1 @@ +.so man3/dlopen.3 diff --git a/original/man3/dlerror.3 b/original/man3/dlerror.3 new file mode 100644 index 00000000..15d09680 --- /dev/null +++ b/original/man3/dlerror.3 @@ -0,0 +1 @@ +.so man3/dlopen.3 diff --git a/original/man3/dlopen.3 b/original/man3/dlopen.3 new file mode 100644 index 00000000..cc4cd4ae --- /dev/null +++ b/original/man3/dlopen.3 @@ -0,0 +1,515 @@ +.\" -*- nroff -*- +.\" Copyright 1995 Yggdrasil Computing, Incorporated. +.\" written by Adam J. Richter (adam@yggdrasil.com), +.\" with typesetting help from Daniel Quinlan (quinlan@yggdrasil.com). +.\" and Copyright 2003 Michael Kerrisk (mtk.manpages@gmail.com). +.\" +.\" 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. +.\" +.\" Modified by David A. Wheeler 2000-11-28. +.\" Applied patch by Terran Melconian, aeb, 2001-12-14. +.\" Modified by Hacksaw 2003-03-13. +.\" Modified by Matt Domsch, 2003-04-09: _init and _fini obsolete +.\" Modified by Michael Kerrisk 2003-05-16. +.\" Modified by Walter Harms: dladdr, dlvsym +.\" Modified by Petr Baudis , 2008-12-04: dladdr caveat +.\" +.TH DLOPEN 3 2008-12-06 "Linux" "Linux Programmer's Manual" +.SH NAME +dladdr, dlclose, dlerror, dlopen, dlsym, dlvsym \- programming interface to +dynamic linking loader +.SH SYNOPSIS +.B #include +.sp +.BI "void *dlopen(const char *" filename ", int " flag ); +.sp +.B "char *dlerror(void);" +.sp +.BI "void *dlsym(void *" handle ", const char *" symbol ); +.sp +.BI "int dlclose(void *" handle ); +.sp +Link with \fI\-ldl\fP. +.SH DESCRIPTION +The four functions +.BR dlopen (), +.BR dlsym (), +.BR dlclose (), +.BR dlerror () +implement the interface to the dynamic linking loader. +.SS "dlerror()" +The function +.BR dlerror () +returns a human readable string describing the most recent error +that occurred from +.BR dlopen (), +.BR dlsym () +or +.BR dlclose () +since the last call to +.BR dlerror (). +It returns NULL if no errors have occurred since initialization or since +it was last called. +.SS "dlopen()" +The function +.BR dlopen () +loads the dynamic library file named by the null-terminated +string +.I filename +and returns an opaque "handle" for the dynamic library. +If +.I filename +is NULL, then the returned handle is for the main program. +If +.I filename +contains a slash ("/"), then it is interpreted as a (relative +or absolute) pathname. +Otherwise, the dynamic linker searches for the library as follows +(see +.BR ld.so (8) +for further details): +.IP o 4 +(ELF only) If the executable file for the calling program +contains a DT_RPATH tag, and does not contain a DT_RUNPATH tag, +then the directories listed in the DT_RPATH tag are searched. +.IP o +If, at the time that the program was started, the environment variable +.B LD_LIBRARY_PATH +was defined to contain a colon-separated list of directories, +then these are searched. +(As a security measure this variable is ignored for set-user-ID and +set-group-ID programs.) +.IP o +(ELF only) If the executable file for the calling program +contains a DT_RUNPATH tag, then the directories listed in that tag +are searched. +.IP o +The cache file +.I /etc/ld.so.cache +(maintained by +.BR ldconfig (8)) +is checked to see whether it contains an entry for +.IR filename . +.IP o +The directories +.I /lib +and +.I /usr/lib +are searched (in that order). +.PP +If the library has dependencies on other shared libraries, +then these are also automatically loaded by the dynamic linker +using the same rules. +(This process may occur recursively, +if those libraries in turn have dependencies, and so on.) +.PP +One of the following two values must be included in +.IR flag : +.TP +.B RTLD_LAZY +Perform lazy binding. +Only resolve symbols as the code that references them is executed. +If the symbol is never referenced, then it is never resolved. +(Lazy binding is only performed for function references; +references to variables are always immediately bound when +the library is loaded.) +.TP +.B RTLD_NOW +If this value is specified, or the environment variable +.B LD_BIND_NOW +is set to a nonempty string, +all undefined symbols in the library are resolved before +.BR dlopen () +returns. +If this cannot be done, an error is returned. +.PP +Zero or more of the following values may also be ORed in +.IR flag : +.TP +.B RTLD_GLOBAL +The symbols defined by this library will be +made available for symbol resolution of subsequently loaded libraries. +.TP +.B RTLD_LOCAL +This is the converse of +.BR RTLD_GLOBAL , +and the default if neither flag is specified. +Symbols defined in this library are not made available to resolve +references in subsequently loaded libraries. +.TP +.BR RTLD_NODELETE " (since glibc 2.2)" +Do not unload the library during +.BR dlclose (). +Consequently, the library's static variables are not reinitialized +if the library is reloaded with +.BR dlopen () +at a later time. +This flag is not specified in POSIX.1-2001. +.\" (But it is present on Solaris.) +.TP +.BR RTLD_NOLOAD " (since glibc 2.2)" +Don't load the library. +This can be used to test if the library is already resident +.RB ( dlopen () +returns NULL if it is not, or the library's handle if it is resident). +This flag can also be used to promote the flags on a library +that is already loaded. +For example, a library that was previously loaded with +.B RTLD_LOCAL +can be reopened with +.BR RTLD_NOLOAD\ |\ RTLD_GLOBAL . +This flag is not specified in POSIX.1-2001. +.\" (But it is present on Solaris.) +.\" +.TP +.BR RTLD_DEEPBIND " (since glibc 2.3.4)" +.\" Inimitably described by UD in +.\" http://sources.redhat.com/ml/libc-hacker/2004-09/msg00083.html. +Place the lookup scope of the symbols in this +library ahead of the global scope. +This means that a self-contained library will use +its own symbols in preference to global symbols with the same name +contained in libraries that have already been loaded. +This flag is not specified in POSIX.1-2001. +.PP +If +.I filename +is a NULL pointer, then the returned handle is for the main program. +When given to +.BR dlsym (), +this handle causes a search for a symbol in the main program, +followed by all shared libraries loaded at program startup, +and then all shared libraries loaded by +.BR dlopen () +with the flag +.BR RTLD_GLOBAL . +.PP +External references in the library are resolved using the libraries +in that library's dependency list and any other libraries previously +opened with the +.B RTLD_GLOBAL +flag. +If the executable was linked with the flag "\-rdynamic" +(or, synonymously, "\-\-export\-dynamic"), +then the global symbols in the executable will also be used +to resolve references in a dynamically loaded library. +.PP +If the same library is loaded again with +.BR dlopen (), +the same file handle is returned. +The dl library maintains reference +counts for library handles, so a dynamic library is not +deallocated until +.BR dlclose () +has been called on it as many times as +.BR dlopen () +has succeeded on it. +The +.BR _init () +routine, if present, is only called once. +But a subsequent call with +.B RTLD_NOW +may force symbol resolution for a library earlier loaded with +.BR RTLD_LAZY . +.PP +If +.BR dlopen () +fails for any reason, it returns NULL. +.SS "dlsym()" +The function +.BR dlsym () +takes a "handle" of a dynamic library returned by +.BR dlopen () +and the +null-terminated symbol name, returning the address where that symbol is +loaded into memory. +If the symbol is not found, in the specified +library or any of the libraries that were automatically loaded by +.BR dlopen () +when that library was loaded, +.BR dlsym () +returns NULL. +(The search performed by +.BR dlsym () +is breadth first through the dependency tree of these libraries.) +Since the value of the symbol could actually be NULL (so that a +NULL return from +.BR dlsym () +need not indicate an error), the correct way to test for an error +is to call +.BR dlerror () +to clear any old error conditions, then call +.BR dlsym (), +and then call +.BR dlerror () +again, saving its return value into a variable, and check whether +this saved value is not NULL. +.PP +There are two special pseudo-handles, +.B RTLD_DEFAULT +and +.BR RTLD_NEXT . +The former will find the first occurrence of the desired symbol +using the default library search order. +The latter +will find the next occurrence of a function in the search order +after the current library. +This allows one to provide a wrapper +around a function in another shared library. +.SS "dlclose()" +The function +.BR dlclose () +decrements the reference count on the dynamic library handle +.IR handle . +If the reference count drops to zero and no other loaded libraries use +symbols in it, then the dynamic library is unloaded. +.LP +The function +.BR dlclose () +returns 0 on success, and nonzero on error. +.SS "The obsolete symbols _init() and _fini()" +The linker recognizes special symbols +.B _init +and +.BR _fini . +If a dynamic library exports a routine named +.BR _init (), +then that code is executed after the loading, before +.BR dlopen () +returns. +If the dynamic library exports a routine named +.BR _fini (), +then that routine is called just before the library is unloaded. +In case you need to avoid linking against the system startup files, +this can be done by using the +.BR gcc (1) +.I \-nostartfiles +command-line option. +.LP +Using these routines, or the gcc +.B \-nostartfiles +or +.B \-nostdlib +options, is not recommended. +Their use may result in undesired behavior, +since the constructor/destructor routines will not be executed +(unless special measures are taken). +.\" void _init(void) __attribute__((constructor)); +.\" void _fini(void) __attribute__((destructor)); +.LP +Instead, libraries should export routines using the +.B __attribute__((constructor)) +and +.B __attribute__((destructor)) +function attributes. +See the gcc info pages for information on these. +Constructor routines are executed before +.BR dlopen () +returns, and destructor routines are executed before +.BR dlclose () +returns. +.SS Glibc extensions: dladdr() and dlvsym() +Glibc adds two functions not described by POSIX, with prototypes +.sp +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int dladdr(void *" addr ", Dl_info *" info ); +.sp +.BI "void *dlvsym(void *" handle ", char *" symbol ", char *" version ); +.fi +.PP +The function +.BR dladdr () +takes a function pointer and tries to resolve name +and file where it is located. +Information is stored in the +.I Dl_info +structure: +.sp +.in +4n +.nf +typedef struct { + const char *dli_fname; /* Pathname of shared object that + contains address */ + void *dli_fbase; /* Address at which shared object + is loaded */ + const char *dli_sname; /* Name of nearest symbol with address + lower than \fIaddr\fP */ + void *dli_saddr; /* Exact address of symbol named + in \fIdli_sname\fP */ +} Dl_info; +.fi +.in +.PP +If no symbol matching +.I addr +could be found, then +.I dli_sname +and +.I dli_saddr +are set to NULL. +.PP +.BR dladdr () +returns 0 on error, and nonzero on success. +.PP +The function +.BR dlvsym (), +provided by glibc since version 2.1, +does the same as +.BR dlsym () +but takes a version string as an additional argument. +.SH "CONFORMING TO" +POSIX.1-2001 describes +.BR dlclose (), +.BR dlerror (), +.BR dlopen (), +and +.BR dlsym (). +.SH NOTES +The symbols +.B RTLD_DEFAULT +and +.B RTLD_NEXT +are defined by +.I +only when +.B _GNU_SOURCE +was defined before including it. +.\" .LP +.\" 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 + +Since glibc 2.2.3, +.BR atexit (3) +can be used to register an exit handler that is automatically +called when a library is unloaded. +.SS History +The dlopen interface standard comes from SunOS. +That system also has +.BR dladdr (), +but not +.BR dlvsym (). +.SH BUGS +Sometimes, the function pointers you pass to +.BR dladdr () +may surprise you. +On some architectures (notably i386 and x86_64), +.I dli_fname +and +.I dli_fbase +may end up pointing back at the object from which you called +.BR dladdr (), +even if the function used as an argument should come from +a dynamically linked library. +.PP +The problem is that the function pointer will still be resolved +at compile time, but merely point to the +.I plt +(Procedure Linkage Table) +section of the original object (which dispatches the call after +asking the dynamic linker to resolve the symbol). +To work around this, +you can try to compile the code to be position-independent: +then, the compiler cannot prepare the pointer +at compile time anymore and today's +.BR gcc (1) +will generate code that just loads the final symbol address from the +.I got +(Global Offset Table) at run time before passing it to +.BR dladdr (). +.SH EXAMPLE +Load the math library, and print the cosine of 2.0: +.nf + +#include +#include +#include + +int +main(int argc, char **argv) +{ + void *handle; + double (*cosine)(double); + char *error; + + handle = dlopen("libm.so", RTLD_LAZY); + if (!handle) { + fprintf(stderr, "%s\en", dlerror()); + exit(EXIT_FAILURE); + } + + dlerror(); /* Clear any existing error */ + + /* Writing: cosine = (double (*)(double)) dlsym(handle, "cos"); + would seem more natural, but the C99 standard leaves + casting from "void *" to a function pointer undefined. + The assignment used below is the POSIX.1\-2003 (Technical + 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. + + if ((error = dlerror()) != NULL) { + fprintf(stderr, "%s\en", error); + exit(EXIT_FAILURE); + } + + printf("%f\en", (*cosine)(2.0)); + dlclose(handle); + exit(EXIT_SUCCESS); +} +.fi +.PP +If this program were in a file named "foo.c", you would build the program +with the following command: +.in +4n +.LP + gcc \-rdynamic \-o foo foo.c \-ldl +.in +.PP +Libraries exporting +.BR _init () +and +.BR _fini () +will want to be compiled as +follows, using \fIbar.c\fP as the example name: +.in +4n +.LP + gcc \-shared \-nostartfiles \-o bar bar.c +.in +.SH "SEE ALSO" +.BR ld (1), +.BR ldd (1), +.BR dl_iterate_phdr (3), +.BR feature_test_macros (7), +.BR rtld-audit (7), +.BR ld.so (8), +.BR ldconfig (8), +ld.so info pages, gcc info pages, ld info pages diff --git a/original/man3/dlsym.3 b/original/man3/dlsym.3 new file mode 100644 index 00000000..15d09680 --- /dev/null +++ b/original/man3/dlsym.3 @@ -0,0 +1 @@ +.so man3/dlopen.3 diff --git a/original/man3/dlvsym.3 b/original/man3/dlvsym.3 new file mode 100644 index 00000000..15d09680 --- /dev/null +++ b/original/man3/dlvsym.3 @@ -0,0 +1 @@ +.so man3/dlopen.3 diff --git a/original/man3/dn_comp.3 b/original/man3/dn_comp.3 new file mode 100644 index 00000000..87a6d0e8 --- /dev/null +++ b/original/man3/dn_comp.3 @@ -0,0 +1 @@ +.so man3/resolver.3 diff --git a/original/man3/dn_expand.3 b/original/man3/dn_expand.3 new file mode 100644 index 00000000..87a6d0e8 --- /dev/null +++ b/original/man3/dn_expand.3 @@ -0,0 +1 @@ +.so man3/resolver.3 diff --git a/original/man3/dprintf.3 b/original/man3/dprintf.3 new file mode 100644 index 00000000..a5413c77 --- /dev/null +++ b/original/man3/dprintf.3 @@ -0,0 +1,78 @@ +.\" 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. +.\" +.\" Text fragments inspired by Martin Schulze . +.\" +.TH DPRINTF 3 2008-08-06 "GNU" "Linux Programmer's Manual" +.SH NAME +dprintf, vdprintf \- print to a file descriptor +.SH SYNOPSIS +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int dprintf(int " fd ", const char *" format ", ...);" +.sp +.BI "int vdprintf(int " fd ", const char *" format ", va_list " ap ); +.SH DESCRIPTION +The functions +.BR dprintf () +and +.BR vdprintf () +(as found in the glibc2 library) are exact analogs of +.BR fprintf (3) +and +.BR vfprintf (3), +except that they output to a file descriptor +.I fd +instead of to a +.I stdio +stream. +.SH "CONFORMING TO" +These functions are GNU extensions that are nowadays specified in +POSIX.1-2008 +.\" .SH NOTES +.\" These functions are GNU extensions, not in C or POSIX. +.\" Clearly, the names were badly chosen. +.\" Many systems (like MacOS) have incompatible functions called +.\" .BR dprintf (), +.\" usually some debugging version of +.\" .BR printf (3), +.\" perhaps with a prototype like +.\" +.\" .BI "void dprintf(int level, const char *" format ", ...);" +.\" +.\" where the first argument is a debugging level (and output is to +.\" .IR stderr ). +.\" Moreover, +.\" .BR dprintf () +.\" (or +.\" .BR DPRINTF ) +.\" is also a popular macro name for a debugging printf. +.\" So, probably, it is better to avoid this function in programs +.\" intended to be portable. +.\" +.\" A better name would have been +.\" .BR fdprintf (). +.SH "SEE ALSO" +.BR printf (3), +.BR feature_test_macros (7) diff --git a/original/man3/drand48.3 b/original/man3/drand48.3 new file mode 100644 index 00000000..5242fb34 --- /dev/null +++ b/original/man3/drand48.3 @@ -0,0 +1,210 @@ +.\" 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 Sat Jul 24 19:46:03 1993 by Rik Faith (faith@cs.unc.edu) +.TH DRAND48 3 2007-07-26 "" "Linux Programmer's Manual" +.SH NAME +drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48, +lcong48 \- generate uniformly distributed pseudo-random numbers +.SH SYNOPSIS +.nf +.B #include +.sp +.B double drand48(void); +.sp +.BI "double erand48(unsigned short " xsubi [3]); +.sp +.B long int lrand48(void); +.sp +.BI "long int nrand48(unsigned short " xsubi [3]); +.sp +.B long int mrand48(void); +.sp +.BI "long int jrand48(unsigned short " xsubi [3]); +.sp +.BI "void srand48(long int " seedval ); +.sp +.BI "unsigned short *seed48(unsigned short " seed16v [3]); +.sp +.BI "void lcong48(unsigned short " param [7]); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +All functions shown above: +.\" .BR drand48 (), +.\" .BR erand48 (), +.\" .BR lrand48 (), +.\" .BR nrand48 (), +.\" .BR mrand48 (), +.\" .BR jrand48 (), +.\" .BR srand48 (), +.\" .BR seed48 (), +.\" .BR lcong48 (): +_SVID_SOURCE || _XOPEN_SOURCE +.ad b +.SH DESCRIPTION +These functions generate pseudo-random numbers using the linear congruential +algorithm and 48-bit integer arithmetic. +.PP +The +.BR drand48 () +and +.BR erand48 () +functions return nonnegative +double-precision floating-point values uniformly distributed between +[0.0, 1.0). +.PP +The +.BR lrand48 () +and +.BR nrand48 () +functions return nonnegative +long integers uniformly distributed between 0 and 2^31. +.PP +The +.BR mrand48 () +and +.BR jrand48 () +functions return signed long +integers uniformly distributed between \-2^31 and 2^31. +.PP +The +.BR srand48 (), +.BR seed48 () +and +.BR lcong48 () +functions are +initialization functions, one of which should be called before using +.BR drand48 (), +.BR lrand48 () +or +.BR mrand48 (). +The functions +.BR erand48 (), +.BR nrand48 () +and +.BR jrand48 () +do not require +an initialization function to be called first. +.PP +All the functions work by generating a sequence of 48-bit integers, +\fIXi\fP, according to the linear congruential formula: +.sp +.nf +.RS +.B Xn+1 = (aXn + c) mod m, where n >= 0 +.RE +.fi +.sp +The parameter \fIm\fP = 2^48, hence 48-bit integer arithmetic is performed. +Unless +.BR lcong48 () +is called, \fIa\fP and \fIc\fP are given by: +.sp +.nf +.RS +.B a = 0x5DEECE66D +.B c = 0xB +.RE +.fi +.sp +The value returned by any of the functions +.BR drand48 (), +.BR erand48 (), +.BR lrand48 (), +.BR nrand48 (), +.BR mrand48 () +or +.BR jrand48 () +is +computed by first generating the next 48-bit \fIXi\fP in the sequence. +Then the appropriate number of bits, according to the type of data item to +be returned, is copied from the high-order bits of \fIXi\fP and transformed +into the returned value. +.PP +The functions +.BR drand48 (), +.BR lrand48 () +and +.BR mrand48 () +store +the last 48-bit \fIXi\fP generated in an internal buffer. +The functions +.BR erand48 (), +.BR nrand48 () +and +.BR jrand48 () +require the calling +program to provide storage for the successive \fIXi\fP values in the array +argument \fIxsubi\fP. +The functions are initialized by placing the initial +value of \fIXi\fP into the array before calling the function for the first +time. +.PP +The initializer function +.BR srand48 () +sets the high order 32-bits of +\fIXi\fP to the argument \fIseedval\fP. +The low order 16-bits are set +to the arbitrary value 0x330E. +.PP +The initializer function +.BR seed48 () +sets the value of \fIXi\fP to +the 48-bit value specified in the array argument \fIseed16v\fP. +The +previous value of \fIXi\fP is copied into an internal buffer and a +pointer to this buffer is returned by +.BR seed48 (). +.PP +The initialization function +.BR lcong48 () +allows the user to specify +initial values for \fIXi\fP, \fIa\fP and \fIc\fP. +Array argument +elements \fIparam[0-2]\fP specify \fIXi\fP, \fIparam[3-5]\fP specify +\fIa\fP, and \fIparam[6]\fP specifies \fIc\fP. +After +.BR lcong48 () +has been called, a subsequent call to either +.BR srand48 () +or +.BR seed48 () +will restore the standard values of \fIa\fP and \fIc\fP. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.SH NOTES +These functions are declared obsolete by SVID 3, which states that +.BR rand (3) +should be used instead. +.SH "SEE ALSO" +.BR rand (3), +.BR random (3) diff --git a/original/man3/drand48_r.3 b/original/man3/drand48_r.3 new file mode 100644 index 00000000..ab25da0d --- /dev/null +++ b/original/man3/drand48_r.3 @@ -0,0 +1,101 @@ +.\" Copyright 2003 Walter Harms, 2004 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. +.\" +.\" Created 2004-10-31. Text taken from a page by Walter Harms, 2003-09-08 +.\" +.TH DRAND48_R 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +drand48_r, erand48_r, lrand48_r, nrand48_r, mrand48_r, jrand48_r, +srand48_r, seed48_r, lcong48_r +\- generate uniformly distributed pseudo-random numbers reentrantly +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int drand48_r(struct drand48_data *" buffer ", double *" result ); +.sp +.BI "int erand48_r(unsigned short " xsubi [3] "," +.br +.BI " struct drand48_data *"buffer ", double *" result ");" +.sp +.BI "int lrand48_r(struct drand48_data *" buffer ", long int *" result ); +.sp +.BI "int nrand48_r(unsigned short int " xsubi[3] "," +.br +.BI " struct drand48_data *"buffer ", long int *" result ");" +.sp +.BI "int mrand48_r(struct drand48_data *" buffer ",long int *" result ");" +.sp +.BI "int jrand48_r(unsigned short int " xsubi[3] "," +.br +.BI " struct drand48_data *" buffer ", long int *" result ");" +.sp +.BI "int srand48_r(long int " seedval ", struct drand48_data *" buffer ");" +.sp +.BI "int seed48_r(unsigned short int " seed16v[3] "," +.br +.BI " struct drand48_data *" buffer ");" +.sp +.BI "int lcong48_r(unsigned short int " param[7] "," +.br +.BI " struct drand48_data *" buffer ");" +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +All functions shown above: +.\" .BR drand48_r (), +.\" .BR erand48_r (), +.\" .BR lrand48_r (), +.\" .BR nrand48_r (), +.\" .BR mrand48_r (), +.\" .BR jrand48_r (), +.\" .BR srand48_r (), +.\" .BR seed48_r (), +.\" .BR lcong48_r (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE +.ad b +.SH DESCRIPTION +These functions are the reentrant analogs of the functions described in +.BR drand48 (3). +Instead of modifying the global random generator state, they use +the supplied data +.IR buffer . + +Before the first use, this struct must be initialized, for example, +by filling it with zeros, or by calling one of the functions +.BR srand48_r (), +.BR seed48_r (), +or +.BR lcong48_r (). +.SH "RETURN VALUE" +The return value is 0. +.SH "CONFORMING TO" +These functions are GNU extensions and are not portable. +.SH "SEE ALSO" +.BR drand48 (3), +.BR rand (3), +.BR random (3) diff --git a/original/man3/drem.3 b/original/man3/drem.3 new file mode 100644 index 00000000..b7a5b23b --- /dev/null +++ b/original/man3/drem.3 @@ -0,0 +1 @@ +.so man3/remainder.3 diff --git a/original/man3/dremf.3 b/original/man3/dremf.3 new file mode 100644 index 00000000..b7a5b23b --- /dev/null +++ b/original/man3/dremf.3 @@ -0,0 +1 @@ +.so man3/remainder.3 diff --git a/original/man3/dreml.3 b/original/man3/dreml.3 new file mode 100644 index 00000000..b7a5b23b --- /dev/null +++ b/original/man3/dreml.3 @@ -0,0 +1 @@ +.so man3/remainder.3 diff --git a/original/man3/dysize.3 b/original/man3/dysize.3 new file mode 100644 index 00000000..8d42c311 --- /dev/null +++ b/original/man3/dysize.3 @@ -0,0 +1,56 @@ +.\" Copyright 2001 Walter Harms (walter.harms@informatik.uni-oldenburg.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. +.\" +.\" aeb: some corrections +.TH DYSIZE 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +dysize \- get number of days for a given year +.SH SYNOPSIS +.B "#include " +.sp +.BI "int dysize(int " year ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR dysize (): +_BSD_SOURCE || _SVID_SOURCE +.SH DESCRIPTION +The function returns 365 for a normal year and 366 for a leap year. +The calculation for leap year is based on: +.sp +(year) %4 == 0 && ((year) %100 != 0 || (year) %400 == 0) +.sp +The formula is defined in the macro +.I __isleap(year) +also found in +.IR . +.SH "CONFORMING TO" +This function occurs in SunOS 4.x. +.SH NOTES +This is a compatibility function only. +Don't use it in new programs. +The SCO version of this function had a year-2000 problem. +.SH "SEE ALSO" +.BR strftime (3) diff --git a/original/man3/eaccess.3 b/original/man3/eaccess.3 new file mode 100644 index 00000000..9e503518 --- /dev/null +++ b/original/man3/eaccess.3 @@ -0,0 +1 @@ +.so man3/euidaccess.3 diff --git a/original/man3/ecb_crypt.3 b/original/man3/ecb_crypt.3 new file mode 100644 index 00000000..853c9cbd --- /dev/null +++ b/original/man3/ecb_crypt.3 @@ -0,0 +1 @@ +.so man3/des_crypt.3 diff --git a/original/man3/ecvt.3 b/original/man3/ecvt.3 new file mode 100644 index 00000000..e32521ca --- /dev/null +++ b/original/man3/ecvt.3 @@ -0,0 +1,114 @@ +.\" 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 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) +.\" +.TH ECVT 3 2009-03-15 "" "Linux Programmer's Manual" +.SH NAME +ecvt, fcvt \- convert a floating-point number to a string +.SH SYNOPSIS +.B #include +.sp +.BI "char *ecvt(double " number ", int " ndigits ", int *" decpt , +.BI "int *" sign ); +.sp +.BI "char *fcvt(double " number ", int " ndigits ", int *" decpt , +.BI "int *" sign ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR ecvt (), +.BR fcvt (): +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +The +.BR ecvt () +function converts \fInumber\fP to a null-terminated +string of \fIndigits\fP digits (where \fIndigits\fP is reduced to a +system-specific limit determined by the precision of a +.IR double ), +and returns a pointer to the string. +The high-order digit is nonzero, unless +.I number +is zero. +The low order digit is rounded. +The string itself does not contain a decimal point; however, +the position of the decimal point relative to the start of the string +is stored in \fI*decpt\fP. +A negative value for \fI*decpt\fP means that +the decimal point is to the left of the start of the string. +If the sign of +\fInumber\fP is negative, \fI*sign\fP is set to a nonzero value, +otherwise it is set to 0. +If +.I number +is zero, it is unspecified whether \fI*decpt\fP is 0 or 1. +.PP +The +.BR fcvt () +function is identical to +.BR ecvt (), +except that +\fIndigits\fP specifies the number of digits after the decimal point. +.SH "RETURN VALUE" +Both the +.BR ecvt () +and +.BR fcvt () +functions return a pointer to a +static string containing the ASCII representation of \fInumber\fP. +The static string is overwritten by each call to +.BR ecvt () +or +.BR fcvt (). +.SH "CONFORMING TO" +SVr2; +marked as LEGACY in POSIX.1-2001. +POSIX.1-2008 removes the specifications of +.BR ecvt () +and +.BR fcvt (), +recommending the use of +.BR sprintf (3) +instead (though +.BR snprintf (3) +may be preferable). +.SH NOTES +Linux libc4 and libc5 specified the type of +.I ndigits +as +.IR size_t . +Not all locales use a point as the radix character ("decimal point"). +.SH "SEE ALSO" +.BR ecvt_r (3), +.BR gcvt (3), +.BR qecvt (3), +.BR setlocale (3), +.BR sprintf (3) diff --git a/original/man3/ecvt_r.3 b/original/man3/ecvt_r.3 new file mode 100644 index 00000000..10abdd2c --- /dev/null +++ b/original/man3/ecvt_r.3 @@ -0,0 +1,94 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.\" +.\" Corrected return types; from Fabian; 2004-10-05 +.\" +.TH ECVT_R 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +ecvt_r, fcvt_r, qecvt_r, qfcvt_r \- convert a floating-point number to a string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int ecvt_r(double " number ", int " ndigits ", int *" decpt , +.BI " int *" sign ", char *" buf ", size_t " len ); +.sp +.BI "int fcvt_r(double " number ", int " ndigits ", int *" decpt , +.BI " int *" sign ", char *" buf ", size_t " len ); +.sp +.BI "int qecvt_r(long double " number ", int " ndigits ", int *" decpt , +.BI " int *" sign ", char *" buf ", size_t " len ); +.sp +.BI "int qfcvt_r(long double " number ", int " ndigits ", int *" decpt , +.BI " int *" sign ", char *" buf ", size_t " len ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR ecvt_r (), +.BR fcvt_r (), +.BR qecvt_r (), +.BR qfcvt_r (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.ad b +.SH DESCRIPTION +The functions +.BR ecvt_r (), +.BR fcvt_r (), +.BR qecvt_r () +and +.BR qfcvt_r () +are identical to +.BR ecvt (3), +.BR fcvt (3), +.BR qecvt (3) +and +.BR qfcvt (3), +respectively, except that they do not return their result in a static +buffer, but instead use the supplied +.I buf +of size +.IR len . +See +.BR ecvt (3) +and +.BR qecvt (3). +.SH "RETURN VALUE" +These functions return 0 on success, and \-1 otherwise. +.SH "CONFORMING TO" +These functions are GNU extensions. +.SH NOTES +These functions are obsolete. +Instead, +.BR sprintf (3) +is recommended. +.SH "SEE ALSO" +.BR ecvt (3), +.BR qecvt (3), +.BR sprintf (3) diff --git a/original/man3/edata.3 b/original/man3/edata.3 new file mode 100644 index 00000000..94843fb0 --- /dev/null +++ b/original/man3/edata.3 @@ -0,0 +1 @@ +.so man3/end.3 diff --git a/original/man3/encrypt.3 b/original/man3/encrypt.3 new file mode 100644 index 00000000..60e5be2a --- /dev/null +++ b/original/man3/encrypt.3 @@ -0,0 +1,160 @@ +.\" Copyright 2000 Nicolás Lichtmaier +.\" Created 2000-07-22 00:52-0300 +.\" +.\" 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. +.\" +.\" Modified 2002-07-23 19:21:35 CEST 2002 Walter Harms +.\" +.\" +.\" Modified 2003-04-04, aeb +.\" +.TH ENCRYPT 3 2003-04-04 "" "Linux Programmer's Manual" +.SH NAME +encrypt, setkey, encrypt_r, setkey_r \- encrypt 64-bit messages +.SH SYNOPSIS +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "void encrypt(char " block "[64], int " edflag ); +.sp +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "void setkey(const char *" key ); +.sp +.B #define _GNU_SOURCE +.br +.B "#include " +.sp +.BI "void setkey_r(const char *" key ", struct crypt_data *" data ); +.br +.BI "void encrypt_r(char *" block ", int " edflag \ +", struct crypt_data *" data ); +.sp +Each of these requires linking with \fI\-lcrypt\fP. +.SH DESCRIPTION +These functions encrypt and decrypt 64-bit messages. +The +.BR setkey () +function sets the key used by +.BR encrypt (). +The +.I key +argument used here is an array of 64 bytes, each of which has +numerical value 1 or 0. +The bytes key[n] where n=8*i-1 are ignored, +so that the effective key length is 56 bits. +.PP +The +.BR encrypt () +function modifies the passed buffer, encoding if +.I edflag +is 0, and decoding if 1 is being passed. +Like the +.I key +argument, also +.I block +is a bit vector representation of the actual value that is encoded. +The result is returned in that same vector. +.PP +These two functions are not reentrant, that is, the key data is +kept in static storage. +The functions +.BR setkey_r () +and +.BR encrypt_r () +are the reentrant versions. +They use the following +structure to hold the key data: +.in +4n +.nf + +struct crypt_data { + char keysched[16 * 8]; + char sb0[32768]; + char sb1[32768]; + char sb2[32768]; + char sb3[32768]; + char crypt_3_buf[14]; + char current_salt[2]; + long int current_saltbits; + int direction; + int initialized; +}; +.fi +.in +.PP +Before calling +.BR setkey_r () +set +.I data\->initialized +to zero. +.SH "RETURN VALUE" +These functions do not return any value. +.SH ERRORS +Set +.I errno +to zero before calling the above functions. +On success, it is unchanged. +.TP +.B ENOSYS +The function is not provided. +(For example because of former USA export restrictions.) +.SH "CONFORMING TO" +The functions +.BR encrypt () +and +.BR setkey () +conform to SVr4, SUSv2, and POSIX.1-2001. +The functions +.BR encrypt_r () +and +.BR setkey_r () +are GNU extensions. +.SH NOTES +In glibc 2.2 these functions use the DES algorithm. +.SH EXAMPLE +You need to link with libcrypt to compile this example with glibc. +To do useful work the +.I key[] +and +.I txt[] +arrays must be filled with a useful bit pattern. +.sp +.nf +#define _XOPEN_SOURCE +#include +#include + +int +main(void) +{ + char key[64]; /* bit pattern for key */ + char txt[64]; /* bit pattern for messages */ + + setkey(key); + encrypt(txt, 0); /* encode */ + encrypt(txt, 1); /* decode */ +} +.fi +.SH "SEE ALSO" +.BR cbc_crypt (3), +.BR crypt (3), +.BR ecb_crypt (3), +.\" .BR fcrypt (3), +.BR feature_test_macros (7) diff --git a/original/man3/encrypt_r.3 b/original/man3/encrypt_r.3 new file mode 100644 index 00000000..e34c9e91 --- /dev/null +++ b/original/man3/encrypt_r.3 @@ -0,0 +1 @@ +.so man3/encrypt.3 diff --git a/original/man3/end.3 b/original/man3/end.3 new file mode 100644 index 00000000..1e411b40 --- /dev/null +++ b/original/man3/end.3 @@ -0,0 +1,111 @@ +.\" Copyright (c) 2008, Linux Foundation, written by 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. +.\" License. +.\" +.TH END 3 2008-07-17 "GNU" "Linux Programmer's Manual" +.SH NAME +etext, edata, end \- end of program segments +.SH SYNOPSIS +.nf +.BI extern " etext" ; +.BI extern " edata" ; +.BI extern " end" ; +.fi +.SH DESCRIPTION +The addresses of these symbols indicate the end of various program +segments: +.TP +.I etext +This is the first address past the end of the text segment +(the program code). +.TP +.I edata +This is the first address past the end of the +initialized data segment. +.TP +.I end +This is the first address past the end of the +uninitialized data segment (also known as the BSS segment). +.SH CONFORMING TO +Although these symbols have long been provided on most Unix systems, +they are not standardized; use with caution. +.SH NOTES +The program must explicitly declare these symbols; +they are not defined in any header file. + +On some systems the names of these symbols are preceded by underscores, +thus: +.IR _etext , +.IR _edata , +and +.IR _end . +These symbols are also defined for programs compiled on Linux. + +At the start of program execution, +the program break will be somewhere near +.IR &end +(perhaps at the start of the following page). +However, the break will change as memory is allocated via +.BR brk (2) +or +.BR malloc (3). +Use +.BR sbrk (2) +with an argument of zero to find the current value of the program break. +.SH EXAMPLE +When run, the program below produces output such as the following: +.in +4n +.nf + +.RB "$" " ./a.out" +First address past: + program text (etext) 0x8048568 + initialized data (edata) 0x804a01c + uninitialized data (end) 0x804a024 +.fi +.in +.SS Program source +\& +.nf +#include +#include + +extern char etext, edata, end; /* The symbols must have some type, + or "gcc -Wall" complains */ + +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); + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR objdump (1), +.BR readelf (1), +.BR sbrk (2), +.BR elf (5) diff --git a/original/man3/endaliasent.3 b/original/man3/endaliasent.3 new file mode 100644 index 00000000..37dcf191 --- /dev/null +++ b/original/man3/endaliasent.3 @@ -0,0 +1 @@ +.so man3/setaliasent.3 diff --git a/original/man3/endfsent.3 b/original/man3/endfsent.3 new file mode 100644 index 00000000..1e6a3eb7 --- /dev/null +++ b/original/man3/endfsent.3 @@ -0,0 +1 @@ +.so man3/getfsent.3 diff --git a/original/man3/endgrent.3 b/original/man3/endgrent.3 new file mode 100644 index 00000000..bde736ff --- /dev/null +++ b/original/man3/endgrent.3 @@ -0,0 +1 @@ +.so man3/getgrent.3 diff --git a/original/man3/endhostent.3 b/original/man3/endhostent.3 new file mode 100644 index 00000000..7d0fb4b7 --- /dev/null +++ b/original/man3/endhostent.3 @@ -0,0 +1 @@ +.so man3/gethostbyname.3 diff --git a/original/man3/endian.3 b/original/man3/endian.3 new file mode 100644 index 00000000..ee040ffa --- /dev/null +++ b/original/man3/endian.3 @@ -0,0 +1,150 @@ +.\" 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. +.\" +.TH ENDIAN 3 2009-01-19 "GNU" "Linux Programmer's Manual" +.SH NAME +htobe16, htole16, be16toh, le16toh, htobe32, htole32, be32toh, le32toh, +htobe64, htole64, be64toh, le64toh \- +convert values between host and big-/little-endian byte order +.SH SYNOPSIS +.nf +.B #define _BSD_SOURCE +.B #include + +.BI "uint16_t htobe16(uint16_t " host_16bits ); +.BI "uint16_t htole16(uint16_t " host_16bits ); +.BI "uint16_t be16toh(uint16_t " big_endian_16bits ); +.BI "uint16_t le16toh(uint16_t " little_endian_16bits ); + +.BI "uint32_t htobe32(uint32_t " host_32bits ); +.BI "uint32_t htole32(uint32_t " host_32bits ); +.BI "uint32_t be32toh(uint32_t " big_endian_32bits ); +.BI "uint32_t le32toh(uint32_t " little_endian_32bits ); + +.BI "uint64_t htobe64(uint64_t " host_64bits ); +.BI "uint64_t htole64(uint64_t " host_64bits ); +.BI "uint64_t be64toh(uint64_t " big_endian_64bits ); +.BI "uint64_t le64toh(uint64_t " little_endian_64bits ); +.fi +.SH DESCRIPTION +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, +.IR nn , +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 VERSIONS +These function were added to glibc in version 2.9. +.SH "CONFORMING TO" +These functions are nonstandard. +Similar functions are present on the BSDs, +where the required header file is +.I +instead of +.IR . +Unfortunately, +NetBSD, FreeBSD, and glibc haven't followed the original +OpenBSD naming convention for these functions, +whereby the +.I nn +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 NOTES +These functions are similar to the older +.BR byteorder (3) +family of functions. +For example, +.BR be32toh () +is identical to +.BR ntohl () . + +The advantage of the +.BR byteorder (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 EXAMPLE +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 Program source +\& +.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\\n", x.u32); + printf("htole32(x.u32) = 0x%x\\n", htole32(x.u32)); + printf("htobe32(x.u32) = 0x%x\\n", htobe32(x.u32)); + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR byteorder (3) diff --git a/original/man3/endmntent.3 b/original/man3/endmntent.3 new file mode 100644 index 00000000..3c2bb35c --- /dev/null +++ b/original/man3/endmntent.3 @@ -0,0 +1 @@ +.so man3/getmntent.3 diff --git a/original/man3/endnetent.3 b/original/man3/endnetent.3 new file mode 100644 index 00000000..70f5670d --- /dev/null +++ b/original/man3/endnetent.3 @@ -0,0 +1 @@ +.so man3/getnetent.3 diff --git a/original/man3/endnetgrent.3 b/original/man3/endnetgrent.3 new file mode 100644 index 00000000..34268f94 --- /dev/null +++ b/original/man3/endnetgrent.3 @@ -0,0 +1 @@ +.so man3/setnetgrent.3 diff --git a/original/man3/endprotoent.3 b/original/man3/endprotoent.3 new file mode 100644 index 00000000..f8cb4bba --- /dev/null +++ b/original/man3/endprotoent.3 @@ -0,0 +1 @@ +.so man3/getprotoent.3 diff --git a/original/man3/endpwent.3 b/original/man3/endpwent.3 new file mode 100644 index 00000000..f2d121b8 --- /dev/null +++ b/original/man3/endpwent.3 @@ -0,0 +1 @@ +.so man3/getpwent.3 diff --git a/original/man3/endrpcent.3 b/original/man3/endrpcent.3 new file mode 100644 index 00000000..923085e2 --- /dev/null +++ b/original/man3/endrpcent.3 @@ -0,0 +1 @@ +.so man3/getrpcent.3 diff --git a/original/man3/endservent.3 b/original/man3/endservent.3 new file mode 100644 index 00000000..eaafb1c1 --- /dev/null +++ b/original/man3/endservent.3 @@ -0,0 +1 @@ +.so man3/getservent.3 diff --git a/original/man3/endspent.3 b/original/man3/endspent.3 new file mode 100644 index 00000000..142c5a5c --- /dev/null +++ b/original/man3/endspent.3 @@ -0,0 +1 @@ +.so man3/getspnam.3 diff --git a/original/man3/endttyent.3 b/original/man3/endttyent.3 new file mode 100644 index 00000000..1cd11e3d --- /dev/null +++ b/original/man3/endttyent.3 @@ -0,0 +1 @@ +.so man3/getttyent.3 diff --git a/original/man3/endusershell.3 b/original/man3/endusershell.3 new file mode 100644 index 00000000..718ed12e --- /dev/null +++ b/original/man3/endusershell.3 @@ -0,0 +1 @@ +.so man3/getusershell.3 diff --git a/original/man3/endutent.3 b/original/man3/endutent.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/endutent.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/endutxent.3 b/original/man3/endutxent.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/endutxent.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/envz.3 b/original/man3/envz.3 new file mode 100644 index 00000000..12e0737e --- /dev/null +++ b/original/man3/envz.3 @@ -0,0 +1 @@ +.so man3/envz_add.3 diff --git a/original/man3/envz_add.3 b/original/man3/envz_add.3 new file mode 100644 index 00000000..e720b4d8 --- /dev/null +++ b/original/man3/envz_add.3 @@ -0,0 +1,139 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" based on the description in glibc source and infopages +.\" +.\" Corrections and additions, aeb +.TH ENVZ_ADD 3 2007-05-18 "" "Linux Programmer's Manual" +.SH NAME +envz_add, envz_entry, envz_get, envz_merge, +envz_remove, envz_strip \- environment string support +.SH SYNOPSIS +.nf +.B "#include " + +.BI "error_t envz_add(char **" envz ", size_t *" envz_len , +.ti 20n +.BI "const char *" name ", const char *" value ); + +.BI "char *envz_entry(const char *" envz ", size_t *" envz_len \ +", const char *" name ); + +.BI "char *envz_get(const char *" envz ", size_t *" envz_len \ +", const char *" name ); + +.BI "error_t envz_merge(char **" envz ", size_t *" envz_len , +.ti 20n +.BI "const char *" envz2 ", size_t " envz2_len ", int " override ); + +.BI "void envz_remove(char **" envz ", size_t *" envz_len \ +", const char *" name ); + +.BI "void envz_strip(char **" envz ", size_t *" envz_len ); +.fi +.SH DESCRIPTION +These functions are glibc-specific. +.LP +An argz vector is a pointer to a character buffer together with a length, +see +.BR argz_add (3). +An envz vector is a special argz vector, namely one where the strings +have the form "name=value". +Everything after the first \(aq=\(aq is considered +to be the value. +If there is no \(aq=\(aq, the value is taken to be NULL. +(While the value in case of a trailing \(aq=\(aq is the empty string "".) +.LP +These functions are for handling envz vectors. +.LP +.BR envz_add () +adds the string +.RI \&" name = value \&" +(in case +.I value +is non-NULL) or +.RI \&" name \&" +(in case +.I value +is NULL) to the envz vector +.RI ( *envz ,\ *envz_len ) +and updates +.I *envz +and +.IR *envz_len . +If an entry with the same +.I name +existed, it is removed. +.LP +.BR envz_entry () +looks for +.I name +in the envz vector +.RI ( envz ,\ envz_len ) +and returns the entry if found, or NULL if not. +.LP +.BR envz_get () +looks for +.I name +in the envz vector +.RI ( envz ,\ envz_len ) +and returns the value if found, or NULL if not. +(Note that the value can also be NULL, namely when there is +an entry for +.I name +without \(aq=\(aq sign.) +.LP +.BR envz_merge () +adds each entry in +.I envz2 +to +.IR *envz , +as if with +.BR envz_add (). +If +.I override +is true, then values in +.I envz2 +will supersede those with the same name in +.IR *envz , +otherwise not. +.LP +.BR envz_remove () +removes the entry for +.I name +from +.RI ( *envz ,\ *envz_len ) +if there was one. +.LP +.BR envz_strip () +removes all entries with value NULL. +.SH "RETURN VALUE" +All envz functions that do memory allocation have a return type of +\fIerror_t\fP, and return 0 for success, and \fBENOMEM\fP +if an allocation error occurs. +.SH "CONFORMING TO" +These functions are a GNU extension. +Handle with care. +.SH EXAMPLE +.nf +#include +#include +#include + +int +main(int argc, char *argv[], char *envp[]) +{ + int i, e_len = 0; + char *str; + + for (i = 0; envp[i] != NULL; i++) + e_len += strlen(envp[i]) + 1; + + str = envz_entry(*envp, e_len, "HOME"); + printf("%s\en", str); + str = envz_get(*envp, e_len, "HOME"); + printf("%s\en", str); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR argz_add (3) diff --git a/original/man3/envz_entry.3 b/original/man3/envz_entry.3 new file mode 100644 index 00000000..12e0737e --- /dev/null +++ b/original/man3/envz_entry.3 @@ -0,0 +1 @@ +.so man3/envz_add.3 diff --git a/original/man3/envz_get.3 b/original/man3/envz_get.3 new file mode 100644 index 00000000..12e0737e --- /dev/null +++ b/original/man3/envz_get.3 @@ -0,0 +1 @@ +.so man3/envz_add.3 diff --git a/original/man3/envz_merge.3 b/original/man3/envz_merge.3 new file mode 100644 index 00000000..12e0737e --- /dev/null +++ b/original/man3/envz_merge.3 @@ -0,0 +1 @@ +.so man3/envz_add.3 diff --git a/original/man3/envz_remove.3 b/original/man3/envz_remove.3 new file mode 100644 index 00000000..12e0737e --- /dev/null +++ b/original/man3/envz_remove.3 @@ -0,0 +1 @@ +.so man3/envz_add.3 diff --git a/original/man3/envz_strip.3 b/original/man3/envz_strip.3 new file mode 100644 index 00000000..12e0737e --- /dev/null +++ b/original/man3/envz_strip.3 @@ -0,0 +1 @@ +.so man3/envz_add.3 diff --git a/original/man3/erand48.3 b/original/man3/erand48.3 new file mode 100644 index 00000000..3133f7d6 --- /dev/null +++ b/original/man3/erand48.3 @@ -0,0 +1 @@ +.so man3/drand48.3 diff --git a/original/man3/erand48_r.3 b/original/man3/erand48_r.3 new file mode 100644 index 00000000..81e9d8ef --- /dev/null +++ b/original/man3/erand48_r.3 @@ -0,0 +1 @@ +.so man3/drand48_r.3 diff --git a/original/man3/erf.3 b/original/man3/erf.3 new file mode 100644 index 00000000..e05eaf89 --- /dev/null +++ b/original/man3/erf.3 @@ -0,0 +1,121 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.TH ERF 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.SH NAME +erf, erff, erfl, \- error function +.SH SYNOPSIS +.nf +.B #include + +.BI "double erf(double " x ); +.BI "float erff(float " x ); +.BI "long double erfl(long double " x ); + +.fi +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR erf (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR erff (), +.BR erfl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600|| _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR erf () +function returns the error function of \fIx\fP, defined +as +.TP + erf(x) = 2/sqrt(pi)* integral from 0 to x of exp(\-t*t) dt +.SH RETURN VALUE +On success, these functions return the error function of +.IR x , +a value in the range [\-1,\ 1]. + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is +0 (\-0), +0 (\-0) is returned. + +If +.I x +is positive infinity (negative infinity), ++1 (\-1) is returned. + +If +.I x +is subnormal, +a range error occurs, +and the return value is 2*x/sqrt(pi). +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Range error: result underflow (\fIx\fP is subnormal) +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An underflow floating-point exception +.RB ( FE_UNDERFLOW ) +is raised. +.PP +These functions do not set +.IR errno . +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6785 +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD. +.SH "SEE ALSO" +.BR cerf (3), +.BR erfc (3), +.BR exp (3) diff --git a/original/man3/erfc.3 b/original/man3/erfc.3 new file mode 100644 index 00000000..dea7cf13 --- /dev/null +++ b/original/man3/erfc.3 @@ -0,0 +1,126 @@ +.\" 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. +.\" +.TH ERFC 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.SH NAME +erfc, erfcf, erfcl \- complementary error function +.SH SYNOPSIS +.nf +.B #include + +.BI "double erfc(double " x ); +.BI "float erfcf(float " x ); +.BI "long double erfcl(long double " x ); + +.fi +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR erfc (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR erfcf (), +.BR erfcl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600|| _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR erfc () +function returns the complementary error function of +.IR x , +that is, 1.0 \- erf(x). +.SH RETURN VALUE +On success, these functions return the complementary error function of +.IR x , +a value in the range [0,2]. + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is +0 or \-0, 1 is returned. + +If +.I x +is positive infinity, ++0 is returned. + +If +.I x +is negative infinity, ++2 is returned. + +If the function result underflows and produces an unrepresentable value, +the return value is 0.0. + +If the function result underflows but produces a representable +(i.e., subnormal) value, +.\" e.g., erfc(27) on x86-32 +that value is returned, and +a range error occurs. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Range error: result underflow (result is subnormal) +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An underflow floating-point exception +.RB ( FE_UNDERFLOW ) +is raised. +.PP +These functions do not set +.IR errno . +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6785 +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD. +.SH NOTES +The +.BR erfc () +functions are provided to avoid the loss accuracy that +would occur for the calculation 1-erf(x) for large values of +.IR x +(for which the value of erf(x) approaches 1). +.SH "SEE ALSO" +.BR cerf (3), +.BR erf (3), +.BR exp (3) diff --git a/original/man3/erfcf.3 b/original/man3/erfcf.3 new file mode 100644 index 00000000..371bd6b5 --- /dev/null +++ b/original/man3/erfcf.3 @@ -0,0 +1 @@ +.so man3/erfc.3 diff --git a/original/man3/erfcl.3 b/original/man3/erfcl.3 new file mode 100644 index 00000000..371bd6b5 --- /dev/null +++ b/original/man3/erfcl.3 @@ -0,0 +1 @@ +.so man3/erfc.3 diff --git a/original/man3/erff.3 b/original/man3/erff.3 new file mode 100644 index 00000000..fc5471fc --- /dev/null +++ b/original/man3/erff.3 @@ -0,0 +1 @@ +.so man3/erf.3 diff --git a/original/man3/erfl.3 b/original/man3/erfl.3 new file mode 100644 index 00000000..fc5471fc --- /dev/null +++ b/original/man3/erfl.3 @@ -0,0 +1 @@ +.so man3/erf.3 diff --git a/original/man3/err.3 b/original/man3/err.3 new file mode 100644 index 00000000..73d50eb9 --- /dev/null +++ b/original/man3/err.3 @@ -0,0 +1,165 @@ +.\" Copyright (c) 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. +.\" +.\" From: @(#)err.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/gen/err.3,v 1.11.2.5 2001/08/17 15:42:32 ru Exp $ +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.TH ERR 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH NAME +err, verr, errx, verrx, warn, vwarn, warnx, vwarnx \- formatted error messages +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void err(int " eval ", const char *" fmt ", ...);" +.sp +.BI "void errx(int " eval ", const char *" fmt ", ...);" +.sp +.BI "void warn(const char *" fmt ", ...);" +.sp +.BI "void warnx(const char *" fmt ", ...);" +.sp +.B #include +.sp +.BI "void verr(int " eval ", const char *" fmt ", va_list " args ); +.sp +.BI "void verrx(int " eval ", const char *" fmt ", va_list " args ); +.sp +.BI "void vwarn(const char *" fmt ", va_list " args ); +.sp +.BI "void vwarnx(const char *" fmt ", va_list " args ); +.fi +.SH DESCRIPTION +The +.BR err () +and +.BR warn () +family of functions display a formatted error message on the standard +error output. +In all cases, the last component of the program name, a colon character, +and a space are output. +If the +.I fmt +argument is not NULL, the +.BR printf (3)-like +formatted error message is output. +The output is terminated by a newline character. +.PP +The +.BR err (), +.BR verr (), +.BR warn (), +and +.BR vwarn () +functions append an error message obtained from +.BR strerror (3) +based on a code or the global variable +.IR errno , +preceded by another colon and space unless the +.I fmt +argument is +NULL. +.PP +The +.BR err (), +.BR verr (), +.BR warn (), +and +.BR vwarn () +functions use the global variable +.I errno +to look up the error message. +.PP +The +.BR errx () +and +.BR warnx () +functions do not append an error message. +.PP +The +.BR err (), +.BR verr (), +.BR errx (), +and +.BR verrx () +functions do not return, but exit with the value of the argument +.IR eval . +.SH EXAMPLES +Display the current +.I errno +information string and exit: +.in +4n +.nf + +if ((p = malloc(size)) == NULL) + err(1, NULL); +if ((fd = open(file_name, O_RDONLY, 0)) == \-1) + err(1, "%s", file_name); +.fi +.in +.PP +Display an error message and exit: +.in +4n +.nf + +if (tm.tm_hour < START_TIME) + errx(1, "too early, wait until %s", start_time_string); +.fi +.in +.PP +Warn of an error: +.in +4n +.nf + +if ((fd = open(raw_device, O_RDONLY, 0)) == \-1) + warnx("%s: %s: trying the block device", + raw_device, strerror(errno)); +if ((fd = open(block_device, O_RDONLY, 0)) == \-1) + err(1, "%s", block_device); +.fi +.in +.SH "CONFORMING TO" +These functions are nonstandard BSD extensions. +.\" .SH HISTORY +.\" The +.\" .BR err () +.\" and +.\" .BR warn () +.\" functions first appeared in +.\" 4.4BSD. +.SH SEE ALSO +.BR error (3), +.BR exit (3), +.BR perror (3), +.BR printf (3), +.BR strerror (3) diff --git a/original/man3/errno.3 b/original/man3/errno.3 new file mode 100644 index 00000000..daa4aece --- /dev/null +++ b/original/man3/errno.3 @@ -0,0 +1,533 @@ +.\" Copyright (c) 1996 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. +.\" +.\" 5 Oct 2002, Modified by Michael Kerrisk +.\" Updated for POSIX.1 2001 +.\" 2004-12-17 Martin Schulze , mtk +.\" Removed errno declaration prototype, added notes +.\" 2006-02-09 Kurt Wall, mtk +.\" Added non-POSIX errors +.\" +.TH ERRNO 3 2008-07-09 "" "Linux Programmer's Manual" +.SH NAME +errno \- number of last error +.SH SYNOPSIS +.B #include +.\".sp +.\".BI "extern int " errno ; +.SH DESCRIPTION +The +.I +header file defines the integer variable +.IR errno , +which is set by system calls and some library functions in the event +of an error to indicate what went wrong. +Its value is significant only when the return value of +the call indicated an error +(i.e., \-1 from most system calls; +\-1 or NULL from most library functions); +a function that succeeds +.I is +allowed to change +.IR errno . + +Valid error numbers are all nonzero; \fIerrno\fP is never set to zero +by any system call or library function. + +For some system calls and library functions (e.g., +.BR getpriority (2)), +\-1 is a valid return on success. +In such cases, a successful return can be distinguished from an error +return by setting +.I errno +to zero before the call, and then, +if the call returns a status that indicates that an error +may have occurred, checking to see if +.I errno +has a nonzero value. + +\fIerrno\fP is defined by the ISO C standard to be a modifiable lvalue +of type \fIint\fP, and must not be explicitly declared; \fIerrno\fP +may be a macro. +\fIerrno\fP is thread-local; setting it in one thread +does not affect its value in any other thread. + +All the error names specified by POSIX.1 +must have distinct values, with the exception of +.B EAGAIN +and +.BR EWOULDBLOCK , +which may be the same. + +.\" The following is now +.\" POSIX.1 (2001 edition) lists the following symbolic error names. Of +.\" these, \fBEDOM\fP and \fBERANGE\fP are in the ISO C standard. ISO C +.\" Amendment 1 defines the additional error number \fBEILSEQ\fP for +.\" coding errors in multibyte or wide characters. +.\" +Below is a list of the symbolic error names that are defined on Linux. +Some of these are marked +.IR POSIX.1 , +indicating that the name is defined by POSIX.1-2001, or +.IR C99 , +indicating that the name is defined by C99. +.TP 16 +.B E2BIG +Argument list too long (POSIX.1) +.TP +.B EACCES +Permission denied (POSIX.1) +.TP +.B EADDRINUSE +Address already in use (POSIX.1) +.TP +.B EADDRNOTAVAIL +Address not available (POSIX.1) +.\" EADV is only an error on HURD(?) +.TP +.B EAFNOSUPPORT +Address family not supported (POSIX.1) +.TP +.B EAGAIN +Resource temporarily unavailable (may be the same value as +.BR EWOULDBLOCK ) +(POSIX.1) +.TP +.B EALREADY +Connection already in progress (POSIX.1) +.TP +.B EBADE +Invalid exchange +.TP +.B EBADF +Bad file descriptor (POSIX.1) +.TP +.B EBADFD +File descriptor in bad state +.TP +.B EBADMSG +Bad message (POSIX.1) +.TP +.B EBADR +Invalid request descriptor +.TP +.B EBADRQC +Invalid request code +.TP +.B EBADSLT +Invalid slot +.\" EBFONT is defined but appears not to be used by kernel or glibc. +.TP +.B EBUSY +Device or resource busy (POSIX.1) +.TP +.B ECANCELED +Operation canceled (POSIX.1) +.TP +.B ECHILD +No child processes (POSIX.1) +.TP +.B ECHRNG +Channel number out of range +.TP +.B ECOMM +Communication error on send +.TP +.B ECONNABORTED +Connection aborted (POSIX.1) +.TP +.B ECONNREFUSED +Connection refused (POSIX.1) +.TP +.B ECONNRESET +Connection reset (POSIX.1) +.TP +.B EDEADLK +Resource deadlock avoided (POSIX.1) +.TP +.B EDEADLOCK +Synonym for +.B EDEADLK +.TP +.B EDESTADDRREQ +Destination address required (POSIX.1) +.TP +.B EDOM +Mathematics argument out of domain of function (POSIX.1, C99) +.\" EDOTDOT is defined but appears to be unused +.TP +.B EDQUOT +.\" POSIX just says "Reserved" +Disk quota exceeded (POSIX.1) +.TP +.B EEXIST +File exists (POSIX.1) +.TP +.B EFAULT +Bad address (POSIX.1) +.TP +.B EFBIG +File too large (POSIX.1) +.TP +.B EHOSTDOWN +Host is down +.TP +.B EHOSTUNREACH +Host is unreachable (POSIX.1) +.TP +.B EIDRM +Identifier removed (POSIX.1) +.TP +.B EILSEQ +Illegal byte sequence (POSIX.1, C99) +.TP +.B EINPROGRESS +Operation in progress (POSIX.1) +.TP +.B EINTR +Interrupted function call (POSIX.1); see +.BR signal (7). +.TP +.B EINVAL +Invalid argument (POSIX.1) +.TP +.B EIO +Input/output error (POSIX.1) +.TP +.B EISCONN +Socket is connected (POSIX.1) +.TP +.B EISDIR +Is a directory (POSIX.1) +.TP +.B EISNAM +Is a named type file +.TP +.B EKEYEXPIRED +Key has expired +.TP +.B EKEYREJECTED +Key was rejected by service +.TP +.B EKEYREVOKED +Key has been revoked +.TP +.B EL2HLT +Level 2 halted +.TP +.B EL2NSYNC +Level 2 not synchronized +.TP +.B EL3HLT +Level 3 halted +.TP +.B EL3RST +Level 3 halted +.TP +.B ELIBACC +Cannot access a needed shared library +.TP +.B ELIBBAD +Accessing a corrupted shared library +.TP +.B ELIBMAX +Attempting to link in too many shared libraries +.TP +.B ELIBSCN +lib section in a.out corrupted +.TP +.B ELIBEXEC +Cannot exec a shared library directly +.TP +.B ELOOP +Too many levels of symbolic links (POSIX.1) +.\" ELNRNG is defined but appears to be unused +.TP +.B EMEDIUMTYPE +Wrong medium type +.TP +.B EMFILE +Too many open files (POSIX.1) +.TP +.B EMLINK +Too many links (POSIX.1) +.TP +.B EMSGSIZE +Message too long (POSIX.1) +.TP +.B EMULTIHOP +.\" POSIX says "Reserved" +Multihop attempted (POSIX.1) +.TP +.B ENAMETOOLONG +Filename too long (POSIX.1) +.\" ENAVAIL is defined, but appears not to be used +.TP +.B ENETDOWN +Network is down (POSIX.1) +.TP +.B ENETRESET +Connection aborted by network (POSIX.1) +.TP +.B ENETUNREACH +Network unreachable (POSIX.1) +.TP +.B ENFILE +Too many open files in system (POSIX.1) +.\" ENOANO is defined but appears to be unused. +.TP +.B ENOBUFS +No buffer space available (POSIX.1 (XSI STREAMS option)) +.\" ENOCSI is defined but appears to be unused. +.TP +.B ENODATA +No message is available on the STREAM head read queue (POSIX.1) +.TP +.B ENODEV +No such device (POSIX.1) +.TP +.B ENOENT +No such file or directory (POSIX.1) +.TP +.B ENOEXEC +Exec format error (POSIX.1) +.TP +.B ENOKEY +Required key not available +.TP +.B ENOLCK +No locks available (POSIX.1) +.TP +.B ENOLINK +.\" POSIX says "Reserved" +Link has been severed (POSIX.1) +.TP +.B ENOMEDIUM +No medium found +.TP +.B ENOMEM +Not enough space (POSIX.1) +.TP +.B ENOMSG +No message of the desired type (POSIX.1) +.TP +.B ENONET +Machine is not on the network +.TP +.B ENOPKG +Package not installed +.TP +.B ENOPROTOOPT +Protocol not available (POSIX.1) +.TP +.B ENOSPC +No space left on device (POSIX.1) +.TP +.B ENOSR +No STREAM resources (POSIX.1 (XSI STREAMS option)) +.TP +.B ENOSTR +Not a STREAM (POSIX.1 (XSI STREAMS option)) +.TP +.B ENOSYS +Function not implemented (POSIX.1) +.TP +.B ENOTBLK +Block device required +.TP +.B ENOTCONN +The socket is not connected (POSIX.1) +.TP +.B ENOTDIR +Not a directory (POSIX.1) +.TP +.B ENOTEMPTY +Directory not empty (POSIX.1) +.\" ENOTNAM is defined but appears to be unused. +.TP +.B ENOTSOCK +Not a socket (POSIX.1) +.TP +.B ENOTSUP +Operation not supported (POSIX.1) +.TP +.B ENOTTY +Inappropriate I/O control operation (POSIX.1) +.TP +.B ENOTUNIQ +Name not unique on network +.TP +.B ENXIO +No such device or address (POSIX.1) +.TP +.B EOPNOTSUPP +Operation not supported on socket (POSIX.1) +.sp +.RB ( ENOTSUP +and +.B EOPNOTSUPP +have the same value on Linux, but +according to POSIX.1 these error values should be distinct.) +.TP +.B EOVERFLOW +Value too large to be stored in data type (POSIX.1) +.TP +.B EPERM +Operation not permitted (POSIX.1) +.TP +.B EPFNOSUPPORT +Protocol family not supported +.TP +.B EPIPE +Broken pipe (POSIX.1) +.TP +.B EPROTO +Protocol error (POSIX.1) +.TP +.B EPROTONOSUPPORT +Protocol not supported (POSIX.1) +.TP +.B EPROTOTYPE +Protocol wrong type for socket (POSIX.1) +.TP +.B ERANGE +Result too large (POSIX.1, C99) +.TP +.B EREMCHG +Remote address changed +.TP +.B EREMOTE +Object is remote +.TP +.B EREMOTEIO +Remote I/O error +.TP +.B ERESTART +Interrupted system call should be restarted +.TP +.B EROFS +Read-only file system (POSIX.1) +.TP +.B ESHUTDOWN +Cannot send after transport endpoint shutdown +.TP +.B ESPIPE +Invalid seek (POSIX.1) +.TP +.B ESOCKTNOSUPPORT +Socket type not supported +.TP +.B ESRCH +No such process (POSIX.1) +.\" ESRMNT is defined but appears not to be used +.TP +.B ESTALE +Stale file handle (POSIX.1) +.sp +This error can occur for NFS and for other file systems +.TP +.B ESTRPIPE +Streams pipe error +.TP +.B ETIME +Timer expired +(POSIX.1 (XSI STREAMS option)) +.sp +(POSIX.1 says "STREAM +.BR ioctl (2) +timeout") +.TP +.B ETIMEDOUT +Connection timed out (POSIX.1) +.\" ETOOMANYREFS is defined, but appears not to be used. +.TP +.B ETXTBSY +Text file busy (POSIX.1) +.TP +.B EUCLEAN +Structure needs cleaning +.TP +.B EUNATCH +Protocol driver not attached +.TP +.B EUSERS +Too many users +.TP +.B EWOULDBLOCK +Operation would block (may be same value as +.BR EAGAIN ) +(POSIX.1) +.TP +.B EXDEV +Improper link (POSIX.1) +.TP +.B EXFULL +Exchange full +.SH NOTES +A common mistake is to do +.in +4n +.nf + +if (somecall() == \-1) { + printf("somecall() failed\en"); + if (errno == ...) { ... } +} + +.fi +.in +where +.I errno +no longer needs to have the value it had upon return from +.IR somecall () +(i.e., it may have been changed by the +.BR printf (3)). +If the value of +.I errno +should be preserved across a library call, it must be saved: +.in +4n +.nf + +if (somecall() == \-1) { + int errsv = errno; + printf("somecall() failed\en"); + if (errsv == ...) { ... } +} +.fi +.in +.PP +It was common in traditional C to declare +.I errno +manually +(i.e., +.IR "extern int errno" ) +instead of including +.IR . +.BR "Do not do this" . +It will not work with modern versions of the C library. +However, on (very) old Unix systems, there may be no +.I +and the declaration is needed. +.SH "SEE ALSO" +.BR err (3), +.BR error (3), +.BR perror (3), +.BR strerror (3) diff --git a/original/man3/error.3 b/original/man3/error.3 new file mode 100644 index 00000000..fc4dfbea --- /dev/null +++ b/original/man3/error.3 @@ -0,0 +1,131 @@ +.\" Copyright (C) 2006 Justin Pryzby +.\" and Copyright (C) 2006 Michael Kerrisk +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" References: +.\" glibc manual and source +.TH ERROR 3 2006-04-25 "GNU" "Linux Programmer's Manual" +.SH NAME +error, error_at_line, error_message_count, error_on_per_line, \ +error_print_progname \- glibc error reporting functions +.SH SYNOPSIS +.nf +\fB#include + +\fBvoid error(int \fIstatus, \fBint\fI errnum, \ +\fBconst char *\fIformat, \fB...); + +\fBvoid error_at_line(int \fIstatus, \fBint \fIerrnum, \ +\fBconst char *\fIfilename, + \fBunsigned int \fIlinenum, \ +\fBconst char *\fIformat, \fB...); + +\fBextern unsigned int \fIerror_message_count\fP; + +\fBextern int \fIerror_one_per_line\fP; + +\fBextern void (* \fIerror_print_progname\fB) (void); +.fi +.SH DESCRIPTION +.BR error () +is a general error reporting function. +It flushes +.IR stdout , +and then outputs to +.I stderr +the program name, a colon and a space, the message specified by the +.BR printf (3)-style +format string \fIformat\fP, and, if \fIerrnum\fP is +nonzero, a second colon and a space followed by the string given by +\fBperror(\fIerrnum\fB)\fP. +Any arguments required for +.I format +should follow +.I format +in the argument list. +The output is terminated by a newline character. + +The program name printed by +.BR error () +is the value of the global variable +.BR program_invocation_name (3). +.I program_invocation_name +initially has the same value as +.IR main ()'s +.IR argv[0] . +The value of this variable can be modified to change the output of +.BR error (). + +If \fIstatus\fP has a nonzero value, then +.BR error () +calls +.BR exit (3) +to terminate the program using the given value as the exit status. + +The +.BR error_at_line () +function is exactly the same as +.BR error (), +except for the addition of the arguments +.I filename +and +.IR linenum . +The output produced is as for +.BR error (), +except that after the program name are written: a colon, the value of +.IR filename , +a colon, and the value of +.IR linenum . +The preprocessor values \fB__LINE__\fP and +\fB__FILE__\fP may be useful when calling +.BR error_at_line (), +but other values can also be used. +For example, these arguments could refer to a location in an input file. + +If the global variable \fIerror_one_per_line\fP is set nonzero, +a sequence of +.BR error_at_line () +calls with the +same value of \fIfilename\fP and \fIlinenum\fP will result in only +one message (the first) being output. + +The global variable \fIerror_message_count\fP counts the number of +messages that have been output by +.BR error () +and +.BR error_at_line (). + +If the global variable \fIerror_print_progname\fP +is assigned the address of a function +(i.e., is not NULL), then that function is called +instead of prefixing the message with the program name and colon. +The function should print a suitable string to +.IR stderr . +.SH "CONFORMING TO" +These functions and variables are GNU extensions, and should not be +used in programs intended to be portable. +.SH SEE ALSO +.BR err (3), +.BR errno (3), +.BR exit (3), +.BR perror (3), +.BR program_invocation_name (3), +.BR strerror (3) diff --git a/original/man3/error_at_line.3 b/original/man3/error_at_line.3 new file mode 100644 index 00000000..7ce8691b --- /dev/null +++ b/original/man3/error_at_line.3 @@ -0,0 +1 @@ +.so man3/error.3 diff --git a/original/man3/error_message_count.3 b/original/man3/error_message_count.3 new file mode 100644 index 00000000..7ce8691b --- /dev/null +++ b/original/man3/error_message_count.3 @@ -0,0 +1 @@ +.so man3/error.3 diff --git a/original/man3/error_on_per_line.3 b/original/man3/error_on_per_line.3 new file mode 100644 index 00000000..7ce8691b --- /dev/null +++ b/original/man3/error_on_per_line.3 @@ -0,0 +1 @@ +.so man3/error.3 diff --git a/original/man3/error_print_progname.3 b/original/man3/error_print_progname.3 new file mode 100644 index 00000000..7ce8691b --- /dev/null +++ b/original/man3/error_print_progname.3 @@ -0,0 +1 @@ +.so man3/error.3 diff --git a/original/man3/errx.3 b/original/man3/errx.3 new file mode 100644 index 00000000..3ee2e497 --- /dev/null +++ b/original/man3/errx.3 @@ -0,0 +1 @@ +.so man3/err.3 diff --git a/original/man3/etext.3 b/original/man3/etext.3 new file mode 100644 index 00000000..94843fb0 --- /dev/null +++ b/original/man3/etext.3 @@ -0,0 +1 @@ +.so man3/end.3 diff --git a/original/man3/ether_aton.3 b/original/man3/ether_aton.3 new file mode 100644 index 00000000..97116203 --- /dev/null +++ b/original/man3/ether_aton.3 @@ -0,0 +1,130 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 2002 Ian Redfern (redferni@logica.com) +.\" +.\" 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 +.\" FreeBSD 4.4 man pages +.\" +.\" Minor additions, aeb, 2002-07-20 +.\" +.TH ETHER_ATON 3 2002-07-20 "GNU" "Linux Programmer's Manual" +.SH NAME +ether_aton, ether_ntoa, ether_ntohost, ether_hostton, ether_line, +ether_ntoa_r, ether_aton_r \- Ethernet address manipulation routines +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *ether_ntoa(const struct ether_addr *" addr ); +.sp +.BI "struct ether_addr *ether_aton(const char *" asc ); +.sp +.BI "int ether_ntohost(char *" hostname ", const struct ether_addr *" addr ); +.sp +.BI "int ether_hostton(const char *" hostname ", struct ether_addr *" addr ); +.sp +.BI "int ether_line(const char *" line ", struct ether_addr *" addr , +.BI " char *" hostname ); +.sp +/* GNU extensions */ +.br +.BI "char *ether_ntoa_r(const struct ether_addr *" addr ", char *" buf ); +.sp +.BI "struct ether_addr *ether_aton_r(const char *" asc , +.BI " struct ether_addr *" addr ); +.fi +.SH DESCRIPTION +.BR ether_aton () +converts the 48-bit Ethernet host address \fIasc\fP +from the standard hex-digits-and-colons notation into binary data in +network byte order and returns a pointer to it in a statically +allocated buffer, which subsequent calls will +overwrite. +.BR ether_aton () +returns NULL if the address is invalid. +.PP +The +.BR ether_ntoa () +function converts the Ethernet host address +\fIaddr\fP given in network byte order to a string in standard +hex-digits-and-colons notation, omitting leading zeros. +The string is returned in a statically allocated buffer, +which subsequent calls will overwrite. +.PP +The +.BR ether_ntohost () +function maps an Ethernet address to the +corresponding hostname in +.I /etc/ethers +and returns nonzero if it cannot be found. +.PP +The +.BR ether_hostton () +function maps a hostname to the +corresponding Ethernet address in +.I /etc/ethers +and returns nonzero if it cannot be found. +.PP +The +.BR ether_line () +function parses a line in +.I /etc/ethers +format (ethernet address followed by whitespace followed by +hostname; \(aq#\(aq introduces a comment) and returns an address +and hostname pair, or nonzero if it cannot be parsed. +The buffer pointed to by +.I hostname +must be sufficiently long, for example, have the same length as +.IR line . +.PP +The functions +.BR ether_ntoa_r () +and +.BR ether_aton_r () +are reentrant +thread-safe versions of +.BR ether_ntoa () +and +.BR ether_aton () +respectively, and do not use static buffers. +.PP +The structure \fIether_addr\fP is defined in +.I +as: +.sp +.in +4n +.nf +struct ether_addr { + uint8_t ether_addr_octet[6]; +} +.fi +.in +.SH "CONFORMING TO" +4.3BSD, SunOS. +.SH BUGS +The glibc 2.2.5 implementation of +.BR ether_line () +is broken. +.SH "SEE ALSO" +.BR ethers (5) diff --git a/original/man3/ether_aton_r.3 b/original/man3/ether_aton_r.3 new file mode 100644 index 00000000..f88e044a --- /dev/null +++ b/original/man3/ether_aton_r.3 @@ -0,0 +1 @@ +.so man3/ether_aton.3 diff --git a/original/man3/ether_hostton.3 b/original/man3/ether_hostton.3 new file mode 100644 index 00000000..f88e044a --- /dev/null +++ b/original/man3/ether_hostton.3 @@ -0,0 +1 @@ +.so man3/ether_aton.3 diff --git a/original/man3/ether_line.3 b/original/man3/ether_line.3 new file mode 100644 index 00000000..f88e044a --- /dev/null +++ b/original/man3/ether_line.3 @@ -0,0 +1 @@ +.so man3/ether_aton.3 diff --git a/original/man3/ether_ntoa.3 b/original/man3/ether_ntoa.3 new file mode 100644 index 00000000..f88e044a --- /dev/null +++ b/original/man3/ether_ntoa.3 @@ -0,0 +1 @@ +.so man3/ether_aton.3 diff --git a/original/man3/ether_ntoa_r.3 b/original/man3/ether_ntoa_r.3 new file mode 100644 index 00000000..f88e044a --- /dev/null +++ b/original/man3/ether_ntoa_r.3 @@ -0,0 +1 @@ +.so man3/ether_aton.3 diff --git a/original/man3/ether_ntohost.3 b/original/man3/ether_ntohost.3 new file mode 100644 index 00000000..f88e044a --- /dev/null +++ b/original/man3/ether_ntohost.3 @@ -0,0 +1 @@ +.so man3/ether_aton.3 diff --git a/original/man3/euidaccess.3 b/original/man3/euidaccess.3 new file mode 100644 index 00000000..b4dfb885 --- /dev/null +++ b/original/man3/euidaccess.3 @@ -0,0 +1,90 @@ +.\" 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. +.\" +.\" +.TH EUIDACCESS 3 2007-07-26 "" "Linux Programmer's Manual" +.SH NAME +euidaccess, eaccess \- check effective user's permissions for a file +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int euidaccess(const char *" pathname ", int " mode ); +.BI "int eaccess(const char *" pathname ", int " mode ); +.fi +.SH DESCRIPTION +Like +.BR access (2), +.BR euidaccess () +checks permissions and existence of the file identified by its argument +.IR pathname . +However, whereas +.BR access (2), +performs checks using the real user and group identifiers of the process, +.BR euidaccess () +uses the effective identifiers. + +.I mode +is a mask consisting of one or more of +.BR R_OK ", " W_OK ", " X_OK " and " F_OK , +with the same meanings as for +.BR access (2). + +.BR eaccess () +is a synonym for +.BR euidaccess (), +provided for compatibility with some other systems. +.SH "RETURN VALUE" +On success (all requested permissions granted), zero is returned. +On error (at least one bit in +.I mode +asked for a permission that is denied, or some other error occurred), +\-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +As for +.BR access (2). +.SH VERSIONS +The +.BR eaccess () +function was added to glibc in version 2.4. +.SH "CONFORMING TO" +These functions are nonstandard. +Some other systems have an +.\" e.g., FreeBSD 6.1. +.BR eaccess () +function. +.SH "SEE ALSO" +.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/original/man3/eventfd_read.3 b/original/man3/eventfd_read.3 new file mode 100644 index 00000000..eddfaa8a --- /dev/null +++ b/original/man3/eventfd_read.3 @@ -0,0 +1 @@ +.so man2/eventfd.2 diff --git a/original/man3/eventfd_write.3 b/original/man3/eventfd_write.3 new file mode 100644 index 00000000..eddfaa8a --- /dev/null +++ b/original/man3/eventfd_write.3 @@ -0,0 +1 @@ +.so man2/eventfd.2 diff --git a/original/man3/exec.3 b/original/man3/exec.3 new file mode 100644 index 00000000..16b66664 --- /dev/null +++ b/original/man3/exec.3 @@ -0,0 +1,213 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)exec.3 6.4 (Berkeley) 4/19/91 +.\" +.\" Converted for Linux, Mon Nov 29 11:12:48 1993, faith@cs.unc.edu +.\" Updated more for Linux, Tue Jul 15 11:54:18 1997, pacman@cqc.com +.\" Modified, 24 Jun 2004, Michael Kerrisk +.\" Added note on casting NULL +.\" +.TH EXEC 3 2009-02-22 "GNU" "Linux Programmer's Manual" +.SH NAME +execl, execlp, execle, execv, execvp \- execute a file +.SH SYNOPSIS +.B #include +.sp +.B extern char **environ; +.sp +.BI "int execl(const char *" path ", const char *" arg ", ...);" +.br +.BI "int execlp(const char *" file ", const char *" arg ", ...);" +.br +.BI "int execle(const char *" path ", const char *" arg , +.br +.BI " ..., char * const " envp "[]);" +.br +.BI "int execv(const char *" path ", char *const " argv "[]);" +.br +.BI "int execvp(const char *" file ", char *const " argv "[]);" +.SH DESCRIPTION +The +.BR exec () +family of functions replaces the current process image with a new process +image. +The functions described in this manual page are front-ends for +.BR execve (2). +(See the manual page for +.BR execve (2) +for further details about the replacement of the current process image.) +.PP +The initial argument for these functions is the pathname of a file which is +to be executed. +.PP +The +.I "const char *arg" +and subsequent ellipses in the +.BR execl (), +.BR execlp (), +and +.BR execle () +functions can be thought of as +.IR arg0 , +.IR arg1 , +\&..., +.IR argn . +Together they describe a list of one or more pointers to null-terminated +strings that represent the argument list available to the executed program. +The first argument, by convention, should point to the filename associated +with the file being executed. +The list of arguments +.I must +be terminated by a NULL +pointer, and, since these are variadic functions, this pointer must be cast +.IR "(char *) NULL" . +.PP +The +.BR execv () +and +.BR execvp () +functions provide an array of pointers to null-terminated strings that +represent the argument list available to the new program. +The first argument, by convention, should point to the filename +associated with the file being executed. +The array of pointers +.I must +be terminated by a NULL pointer. +.PP +The +.BR execle () +function also specifies the environment of the executed process by following +the NULL +pointer that terminates the list of arguments in the argument list or the +pointer to the +.I argv +array with an additional argument. +This additional +argument is an array of pointers to null-terminated strings and +.I must +be terminated by a NULL pointer. +The other functions take the environment for the new process +image from the external variable +.I environ +in the current process. +.SS Special semantics for execlp() and execvp() +.PP +The functions +.BR execlp () +and +.BR execvp () +will duplicate the actions of the shell in searching for an executable file +if the specified filename does not contain a slash (/) character. +The search path is the path specified in the environment by the +.B PATH +variable. +If this variable isn't specified, the default path +":/bin:/usr/bin" is used. +In addition, certain +errors are treated specially. +.PP +If permission is denied for a file (the attempted +.BR execve (2) +failed with the error +.BR EACCES ), +these functions will continue searching the rest of the search path. +If no other file is found, however, +they will return with +.I errno +set to +.BR EACCES . +.PP +If the header of a file isn't recognized (the attempted +.BR execve (2) +failed with the error +.BR ENOEXEC ), +these functions will execute the shell +.RI ( /bin/sh ) +with the path of the file as its first argument. +(If this attempt fails, no further searching is done.) +.SH "RETURN VALUE" +If any of the +.BR exec () +functions returns, an error will have occurred. +The return value is \-1, and +.I errno +will be set to indicate the error. +.SH ERRORS +All of these functions may fail and set +.I errno +for any of the errors specified for the library function +.BR execve (2). +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +On some other systems the default path (used when the environment +does not contain the variable \fBPATH\fR) has the current working +directory listed after +.I /bin +and +.IR /usr/bin , +as an anti-Trojan-horse measure. +Linux uses here the +traditional "current directory first" default path. +.PP +The behavior of +.BR execlp () +and +.BR execvp () +when errors occur while attempting to execute the file is historic +practice, but has not traditionally been documented and is not specified by +the POSIX standard. +BSD (and possibly other systems) do an automatic +sleep and retry if +.B ETXTBSY +is encountered. +Linux treats it as a hard +error and returns immediately. +.PP +Traditionally, the functions +.BR execlp () +and +.BR execvp () +ignored all errors except for the ones described above and +.B ENOMEM +and +.BR E2BIG , +upon which they returned. +They now return if any error other than the ones +described above occurs. +.SH "SEE ALSO" +.BR sh (1), +.BR execve (2), +.BR fork (2), +.BR ptrace (2), +.BR fexecve (3), +.BR environ (7) diff --git a/original/man3/execl.3 b/original/man3/execl.3 new file mode 100644 index 00000000..4bf4872a --- /dev/null +++ b/original/man3/execl.3 @@ -0,0 +1 @@ +.so man3/exec.3 diff --git a/original/man3/execle.3 b/original/man3/execle.3 new file mode 100644 index 00000000..4bf4872a --- /dev/null +++ b/original/man3/execle.3 @@ -0,0 +1 @@ +.so man3/exec.3 diff --git a/original/man3/execlp.3 b/original/man3/execlp.3 new file mode 100644 index 00000000..4bf4872a --- /dev/null +++ b/original/man3/execlp.3 @@ -0,0 +1 @@ +.so man3/exec.3 diff --git a/original/man3/execv.3 b/original/man3/execv.3 new file mode 100644 index 00000000..4bf4872a --- /dev/null +++ b/original/man3/execv.3 @@ -0,0 +1 @@ +.so man3/exec.3 diff --git a/original/man3/execvp.3 b/original/man3/execvp.3 new file mode 100644 index 00000000..4bf4872a --- /dev/null +++ b/original/man3/execvp.3 @@ -0,0 +1 @@ +.so man3/exec.3 diff --git a/original/man3/exit.3 b/original/man3/exit.3 new file mode 100644 index 00000000..6a9ba20e --- /dev/null +++ b/original/man3/exit.3 @@ -0,0 +1,171 @@ +.\" 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. +.\" +.TH EXIT 3 2009-09-20 "Linux" "Linux Programmer's Manual" +.SH NAME +exit \- cause normal process termination +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void exit(int " status ); +.fi +.SH DESCRIPTION +The +.BR exit () +function causes normal process termination and the +value of \fIstatus & 0377\fP is returned to the parent +(see +.BR wait (2)). +.LP +All functions registered with +.BR atexit (3) +and +.BR on_exit (3) +are called, in the reverse order of their registration. +(It is possible for one of these functions to use +.BR atexit (3) +or +.BR on_exit (3) +to register an additional +function to be executed during exit processing; +the new registration is added to the front of the list of functions +that remain to be called.) +If one of these functions does not return +(e.g., it calls +.BR _exit (2), +or kills itself with a signal), +then none of the remaining functions is called, +and further exit processing (in particular, flushing of +.BR stdio (3) +streams) is abandoned. +If a function has been registered multiple times using +.BR atexit (3) +or +.BR on_exit (3), +then it is called as many times as it was registered. +.LP +All open +.BR stdio (3) +streams are flushed and closed. +Files created by +.BR tmpfile (3) +are removed. +.LP +The C standard specifies two constants, +\fBEXIT_SUCCESS\fP and \fBEXIT_FAILURE\fP, +that may be passed to +.BR exit () +to indicate successful or unsuccessful +termination, respectively. +.SH "RETURN VALUE" +The +.BR exit () +function does not return. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001, C89, C99. +.SH NOTES +.LP +It is undefined what happens if one of the +functions registered using +.BR atexit (3) +and +.BR on_exit (3) +calls either +.BR exit () +or +.BR longjmp (3). +.LP +The use of +.B EXIT_SUCCESS +and +.B EXIT_FAILURE +is slightly more portable +(to non-Unix environments) than the use of 0 and some nonzero value +like 1 or \-1. +In particular, VMS uses a different convention. +.LP +BSD has attempted to standardize exit codes; see the file +.IR . +.LP +After +.BR exit (), +the exit status must be transmitted to the +parent process. +There are three cases. +If the parent has set +.BR SA_NOCLDWAIT , +or has set the +.B SIGCHLD +handler to +.BR SIG_IGN , +the status is discarded. +If the parent was waiting on the child +it is notified of the exit status. +In both cases the exiting +process dies immediately. +If the parent has not indicated that +it is not interested in the exit status, but is not waiting, +the exiting process turns into a "zombie" process +(which is nothing but a container for the single byte representing +the exit status) so that the parent can learn the exit status when +it later calls one of the +.BR wait (2) +functions. +.LP +If the implementation supports the +.B SIGCHLD +signal, this signal +is sent to the parent. +If the parent has set +.BR SA_NOCLDWAIT , +it is undefined whether a +.B SIGCHLD +signal is sent. +.LP +If the process is a session leader and its controlling terminal +is the controlling terminal of the session, then each process in +the foreground process group of this controlling terminal +is sent a +.B SIGHUP +signal, and the terminal is disassociated +from this session, allowing it to be acquired by a new controlling +process. +.LP +If the exit of the process causes a process group to become orphaned, +and if any member of the newly orphaned process group is stopped, +then a +.B SIGHUP +signal followed by a +.B SIGCONT +signal will be +sent to each process in this process group. +See +.BR setpgid (2) +for an explanation of orphaned process groups. +.SH "SEE ALSO" +.BR _exit (2), +.BR setpgid (2), +.BR wait (2), +.BR atexit (3), +.BR on_exit (3), +.BR tmpfile (3) diff --git a/original/man3/exp.3 b/original/man3/exp.3 new file mode 100644 index 00000000..856ebcb5 --- /dev/null +++ b/original/man3/exp.3 @@ -0,0 +1,131 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995-08-14 by Arnt Gulbrandsen +.\" Modified 2002-07-27 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH EXP 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +exp, expf, expl \- base-e exponential function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double exp(double " x ); +.br +.BI "float expf(float " x ); +.br +.BI "long double expl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR expf (), +.BR expl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR exp () +function returns the value of e (the base of natural +logarithms) raised to the power of \fIx\fP. +.SH RETURN VALUE +On success, these functions return the exponential value of +.IR x . + +If +.I x +is a NaN, +a NaN is returned. + +If +.I x +is positive infinity, +positive infinity is returned. + +If +.I x +is negative infinity, ++0 is returned. + +If the result underflows, +a range error occurs, +and zero is returned. + +If the result overflows, +a range error occurs, +and the functions return +.RB + HUGE_VAL , +.RB + HUGE_VALF , +or +.RB + HUGE_VALL , +respectively. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. + +The following errors can occur: +.TP +Range error, overflow +.I errno +is set to +.BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.TP +Range error, underflow +.I errno +is set to +.BR ERANGE . +An underflow floating-point exception +.RB ( FE_UNDERFLOW ) +is raised. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR cbrt (3), +.BR cexp (3), +.BR exp10 (3), +.BR exp2 (3), +.BR sqrt (3) diff --git a/original/man3/exp10.3 b/original/man3/exp10.3 new file mode 100644 index 00000000..4ec7d903 --- /dev/null +++ b/original/man3/exp10.3 @@ -0,0 +1,82 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995-08-14 by Arnt Gulbrandsen +.\" Modified 2002-07-27 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.TH EXP10 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH NAME +exp10, exp10f, exp10l \- base-10 exponential function +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "double exp10(double " x ); +.br +.BI "float exp10f(float " x ); +.br +.BI "long double exp10l(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The +.BR exp10 () +function returns the value of 10 +raised to the power of \fIx\fP. +.SH RETURN VALUE +On success, these functions return the base-10 exponential value of +.IR x . + +For various special cases, including the handling of infinity and NaN, +as well as overflows and underflows, see +.BR exp (3). +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. + +For a discussion of the errors that can occur for these functions, see +.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 +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +These functions are GNU extensions. +.SH "SEE ALSO" +.BR cbrt (3), +.BR exp (3), +.BR exp2 (3), +.BR log10 (3), +.BR sqrt (3), +.BR feature_test_macros (7) diff --git a/original/man3/exp10f.3 b/original/man3/exp10f.3 new file mode 100644 index 00000000..705b75e9 --- /dev/null +++ b/original/man3/exp10f.3 @@ -0,0 +1 @@ +.so man3/exp10.3 diff --git a/original/man3/exp10l.3 b/original/man3/exp10l.3 new file mode 100644 index 00000000..705b75e9 --- /dev/null +++ b/original/man3/exp10l.3 @@ -0,0 +1 @@ +.so man3/exp10.3 diff --git a/original/man3/exp2.3 b/original/man3/exp2.3 new file mode 100644 index 00000000..8c981a5e --- /dev/null +++ b/original/man3/exp2.3 @@ -0,0 +1,95 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995-08-14 by Arnt Gulbrandsen +.\" Modified 2002-07-27 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH EXP2 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +exp2, exp2f, exp2l \- base-2 exponential function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double exp2(double " x ); +.br +.BI "float exp2f(float " x ); +.br +.BI "long double exp2l(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR exp2 (), +.BR exp2f (), +.BR exp2l (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR exp2 () +function returns the value of 2 +raised to the power of \fIx\fP. +.SH RETURN VALUE +On success, these functions return the base-2 exponential value of +.IR x . + +For various special cases, including the handling of infinity and NaN, +as well as overflows and underflows, see +.BR exp (3). +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. + +For a discussion of the errors that can occur for these functions, see +.BR exp (3). +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR cbrt (3), +.BR cexp2 (3), +.BR exp (3), +.BR exp10 (3), +.BR sqrt (3) diff --git a/original/man3/exp2f.3 b/original/man3/exp2f.3 new file mode 100644 index 00000000..b69beeac --- /dev/null +++ b/original/man3/exp2f.3 @@ -0,0 +1 @@ +.so man3/exp2.3 diff --git a/original/man3/exp2l.3 b/original/man3/exp2l.3 new file mode 100644 index 00000000..b69beeac --- /dev/null +++ b/original/man3/exp2l.3 @@ -0,0 +1 @@ +.so man3/exp2.3 diff --git a/original/man3/expf.3 b/original/man3/expf.3 new file mode 100644 index 00000000..4b1efda6 --- /dev/null +++ b/original/man3/expf.3 @@ -0,0 +1 @@ +.so man3/exp.3 diff --git a/original/man3/expl.3 b/original/man3/expl.3 new file mode 100644 index 00000000..4b1efda6 --- /dev/null +++ b/original/man3/expl.3 @@ -0,0 +1 @@ +.so man3/exp.3 diff --git a/original/man3/expm1.3 b/original/man3/expm1.3 new file mode 100644 index 00000000..640d57f6 --- /dev/null +++ b/original/man3/expm1.3 @@ -0,0 +1,151 @@ +.\" Copyright 1995 Jim Van Zandt +.\" 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. +.\" +.\" Modified 2002-07-27 Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH EXPM1 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +expm1, expm1f, expm1l \- exponential minus 1 +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double expm1(double " x ); +.br +.BI "float expm1f(float " x ); +.br +.BI "long double expm1l(long double " x ); +.sp +.fi +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR expm1 (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR expm1f (), +.BR expm1l (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +.I expm1(x) +returns a value equivalent to +.nf + + exp(x) \- 1 + +.fi +It is +computed in a way that is accurate even if the value of \fIx\fP is near +zero\(ema case where +.I "exp(x) \- 1" +would be inaccurate due to +subtraction of two numbers that are nearly equal. +.SH RETURN VALUE +On success, these functions return +.IR "exp(x)\ \-\ 1" . + +If +.I x +is a NaN, +a NaN is returned. + +If +.I x +is +0 (\-0), ++0 (\-0) is returned. + +If +.I x +is positive infinity, positive infinity is returned. + +If +.I x +is negative infinity, \-1 is returned. + +If the result overflows, a range error occurs, +and the functions return +.RB - HUGE_VAL , +.RB - HUGE_VALF , +or +.RB - HUGE_VALL , +respectively. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Range error, overflow +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.PP +These functions do not set +.IR errno . +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6788 +.\" +.\" +.\" POSIX.1 specifies an optional range error (underflow) if +.\" x is subnormal. Glibc does not implement this. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.\" BSD. +.SH BUGS +For some large negative +.I x +values (where the function result approaches \-1), +.BR expm1 () +raises a bogus underflow floating-point exception. +.\" FIXME . +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6778 + +For some large positive +.I x +values, +.BR expm1 () +raises a bogus invalid floating-point exception in addition to the expected +overflow exception, and returns a NaN instead of positive infinity. +.\" 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. +.SH "SEE ALSO" +.BR exp (3), +.BR log (3), +.BR log1p (3) diff --git a/original/man3/expm1f.3 b/original/man3/expm1f.3 new file mode 100644 index 00000000..2c9e4eac --- /dev/null +++ b/original/man3/expm1f.3 @@ -0,0 +1 @@ +.so man3/expm1.3 diff --git a/original/man3/expm1l.3 b/original/man3/expm1l.3 new file mode 100644 index 00000000..2c9e4eac --- /dev/null +++ b/original/man3/expm1l.3 @@ -0,0 +1 @@ +.so man3/expm1.3 diff --git a/original/man3/fabs.3 b/original/man3/fabs.3 new file mode 100644 index 00000000..107aa234 --- /dev/null +++ b/original/man3/fabs.3 @@ -0,0 +1,91 @@ +.\" 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 Sat Jul 24 19:42:04 1993 by Rik Faith (faith@cs.unc.edu) +.\" Added fabsl, fabsf, aeb, 2001-06-07 +.\" +.TH FABS 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +fabs, fabsf, fabsl \- absolute value of floating-point number +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double fabs(double " x ); +.br +.BI "float fabsf(float " x ); +.br +.BI "long double fabsl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR fabsf (), +.BR fabsl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR fabs () +functions return the absolute value of the floating-point +number \fIx\fP. +.SH RETURN VALUE +These functions return the absolute value of +.IR x . + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is \-0, +0 is returned. + +If +.I x +is negative infinity or positive infinity, positive infinity is returned. +.SH ERRORS +No errors occur. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR abs (3), +.BR cabs (3), +.BR ceil (3), +.BR floor (3), +.BR labs (3), +.BR rint (3) diff --git a/original/man3/fabsf.3 b/original/man3/fabsf.3 new file mode 100644 index 00000000..0426cf0f --- /dev/null +++ b/original/man3/fabsf.3 @@ -0,0 +1 @@ +.so man3/fabs.3 diff --git a/original/man3/fabsl.3 b/original/man3/fabsl.3 new file mode 100644 index 00000000..0426cf0f --- /dev/null +++ b/original/man3/fabsl.3 @@ -0,0 +1 @@ +.so man3/fabs.3 diff --git a/original/man3/fclose.3 b/original/man3/fclose.3 new file mode 100644 index 00000000..56f79e37 --- /dev/null +++ b/original/man3/fclose.3 @@ -0,0 +1,105 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fclose.3 6.7 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:19:14 1993, faith@cs.unc.edu +.\" +.\" Modified 2000-07-22 by Nicolás Lichtmaier +.\" +.TH FCLOSE 3 2009-02-23 "GNU" "Linux Programmer's Manual" +.SH NAME +fclose \- close a stream +.SH SYNOPSIS +.B #include +.sp +.BI "int fclose(FILE *" fp ); +.SH DESCRIPTION +The +.BR fclose () +function will flushes the stream pointed to by +.I fp +(writing any buffered output data using +.BR fflush (3)) +and closes the underlying file descriptor. +.SH "RETURN VALUE" +Upon successful completion 0 is returned. +Otherwise, +.B EOF +is returned and +.I errno +is set to indicate the error. +In either case any further access +(including another call to +.BR fclose ()) +to the stream results in undefined behavior. +.SH ERRORS +.TP +.B EBADF +The file descriptor underlying +.I fp +is not valid. +.\" This error cannot occur unless you are mixing ANSI C stdio operations and +.\" low-level file operations on the same stream. If you do get this error, +.\" you must have closed the stream's low-level file descriptor using +.\" something like close(fileno(fp)). +.PP +The +.BR fclose () +function may also fail and set +.I errno +for any of the errors specified for the routines +.BR close (2), +.BR write (2) +or +.BR fflush (3). +.SH "CONFORMING TO" +C89, C99. +.SH NOTES +Note that +.BR fclose () +only flushes the user space buffers provided by the +C library. +To ensure that the data is physically stored +on disk the kernel buffers must be flushed too, for example, with +.BR sync (2) +or +.BR fsync (2). +.SH "SEE ALSO" +.BR close (2), +.BR fcloseall (3), +.BR fflush (3), +.BR fopen (3), +.BR setbuf (3) diff --git a/original/man3/fcloseall.3 b/original/man3/fcloseall.3 new file mode 100644 index 00000000..d2dddcbf --- /dev/null +++ b/original/man3/fcloseall.3 @@ -0,0 +1,62 @@ +.\" Copyright (c) 2006 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. +.\" License. +.\" +.TH FCLOSEALL 3 2006-12-27 "GNU" "Linux Programmer's Manual" +.SH NAME +fcloseall \- close all open streams +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.B int fcloseall(void); +.fi +.SH DESCRIPTION +The +.BR fcloseall () +function closes all of the calling process's open streams. +Buffered output for each stream is written before it is closed +(as for +.BR fflush (3)); +buffered input is discarded. + +The standard streams, +.IR stdin , +.IR stdout , +and +.I stderr +are also closed. +.SH "RETURN VALUE" +This function returns 0 if all files were successfully closed; +on error, +.B EOF +is returned. +.SH "CONFORMING TO" +This function is a GNU extension. +.SH "SEE ALSO" +.BR close (2), +.BR fclose (3), +.BR fflush (3), +.BR fopen (3), +.BR setbuf (3), +.BR feature_test_macros (7) diff --git a/original/man3/fcvt.3 b/original/man3/fcvt.3 new file mode 100644 index 00000000..39d37709 --- /dev/null +++ b/original/man3/fcvt.3 @@ -0,0 +1 @@ +.so man3/ecvt.3 diff --git a/original/man3/fcvt_r.3 b/original/man3/fcvt_r.3 new file mode 100644 index 00000000..41ce9ee8 --- /dev/null +++ b/original/man3/fcvt_r.3 @@ -0,0 +1 @@ +.so man3/ecvt_r.3 diff --git a/original/man3/fdim.3 b/original/man3/fdim.3 new file mode 100644 index 00000000..bb3dedda --- /dev/null +++ b/original/man3/fdim.3 @@ -0,0 +1,76 @@ +.\" Copyright 2003 Walter Harms, Andries Brouwer +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" Distributed under GPL. +.\" +.TH FDIM 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +fdim, fdimf, fdiml \- positive difference +.SH SYNOPSIS +.B #include +.sp +.BI "double fdim(double " x ", double " y ); +.br +.BI "float fdimf(float " x ", float " y ); +.br +.BI "long double fdiml(long double " x ", long double " y ); +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR fdimf (), +.BR fdiml (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions return the positive difference, max(\fIx\fP-\fIy\fP,0), +between their arguments. +.SH RETURN VALUE +On success, these functions return the positive difference. + +If +.I x +or +.I y +is a NaN, a NaN is returned. + +If the result overflows, +a range error occurs, +and the functions return +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +respectively. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Range error: result overflow +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.PP +These functions do not set +.IR errno . +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6796 +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR fmax (3) diff --git a/original/man3/fdimf.3 b/original/man3/fdimf.3 new file mode 100644 index 00000000..a4058e45 --- /dev/null +++ b/original/man3/fdimf.3 @@ -0,0 +1 @@ +.so man3/fdim.3 diff --git a/original/man3/fdiml.3 b/original/man3/fdiml.3 new file mode 100644 index 00000000..a4058e45 --- /dev/null +++ b/original/man3/fdiml.3 @@ -0,0 +1 @@ +.so man3/fdim.3 diff --git a/original/man3/fdopen.3 b/original/man3/fdopen.3 new file mode 100644 index 00000000..9a401249 --- /dev/null +++ b/original/man3/fdopen.3 @@ -0,0 +1 @@ +.so man3/fopen.3 diff --git a/original/man3/fdopendir.3 b/original/man3/fdopendir.3 new file mode 100644 index 00000000..55b720e2 --- /dev/null +++ b/original/man3/fdopendir.3 @@ -0,0 +1 @@ +.so man3/opendir.3 diff --git a/original/man3/feclearexcept.3 b/original/man3/feclearexcept.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/feclearexcept.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/fedisableexcept.3 b/original/man3/fedisableexcept.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/fedisableexcept.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/feenableexcept.3 b/original/man3/feenableexcept.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/feenableexcept.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/fegetenv.3 b/original/man3/fegetenv.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/fegetenv.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/fegetexcept.3 b/original/man3/fegetexcept.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/fegetexcept.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/fegetexceptflag.3 b/original/man3/fegetexceptflag.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/fegetexceptflag.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/fegetround.3 b/original/man3/fegetround.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/fegetround.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/feholdexcept.3 b/original/man3/feholdexcept.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/feholdexcept.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/fenv.3 b/original/man3/fenv.3 new file mode 100644 index 00000000..180ff918 --- /dev/null +++ b/original/man3/fenv.3 @@ -0,0 +1,324 @@ +.\" Copyright (c) 2000 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. +.\" +.\" 2000-08-14 added GNU additions from Andreas Jaeger +.\" 2000-12-05 some changes inspired by acahalan's remarks +.\" +.TH FENV 3 2008-08-11 "Linux" "Linux Programmer's Manual" +.SH NAME +feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag, +fetestexcept, fegetenv, fegetround, feholdexcept, fesetround, +fesetenv, feupdateenv, feenableexcept, fedisableexcept, +fegetexcept \- floating-point rounding and exception handling +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int feclearexcept(int " excepts ); +.br +.BI "int fegetexceptflag(fexcept_t *" flagp ", int " excepts ); +.br +.BI "int feraiseexcept(int " excepts ); +.br +.BI "int fesetexceptflag(const fexcept_t *" flagp ", int " excepts ); +.br +.BI "int fetestexcept(int " excepts ); +.sp +.B "int fegetround(void);" +.br +.BI "int fesetround(int " rounding_mode ); +.sp +.BI "int fegetenv(fenv_t *" envp ); +.br +.BI "int feholdexcept(fenv_t *" envp ); +.br +.BI "int fesetenv(const fenv_t *" envp ); +.br +.BI "int feupdateenv(const fenv_t *" envp ); +.fi +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +These eleven functions were defined in C99, and describe the handling +of floating-point rounding and exceptions (overflow, zero-divide etc.). +.SS Exceptions +The +.I divide-by-zero +exception occurs when an operation on finite numbers +produces infinity as exact answer. +.LP +The +.I overflow +exception occurs when a result has to be represented as a +floating-point number, but has (much) larger absolute value than the +largest (finite) floating-point number that is representable. +.LP +The +.I underflow +exception occurs when a result has to be represented as a +floating-point number, but has smaller absolute value than the smallest +positive normalized floating-point number (and would lose much accuracy +when represented as a denormalized number). +.LP +The +.I inexact +exception occurs when the rounded result of an operation +is not equal to the infinite precision result. +It may occur whenever +.I overflow +or +.I underflow +occurs. +.LP +The +.I invalid +exception occurs when there is no well-defined result +for an operation, as for 0/0 or infinity \- infinity or sqrt(\-1). +.SS "Exception handling" +Exceptions are represented in two ways: as a single bit +(exception present/absent), and these bits correspond in some +implementation-defined way with bit positions in an integer, +and also as an opaque structure that may contain more information +about the exception (perhaps the code address where it occurred). +.LP +Each of the macros +.BR FE_DIVBYZERO , +.BR FE_INEXACT , +.BR FE_INVALID , +.BR FE_OVERFLOW , +.B FE_UNDERFLOW +is defined when the implementation supports handling +of the corresponding exception, and if so then +defines the corresponding bit(s), so that one can call +exception handling functions, for example, using the integer argument +.BR FE_OVERFLOW | FE_UNDERFLOW . +Other exceptions may be supported. +The macro +.B FE_ALL_EXCEPT +is the bitwise OR of all bits corresponding to supported exceptions. +.PP +The +.BR feclearexcept () +function clears the supported exceptions represented by the bits +in its argument. +.LP +The +.BR fegetexceptflag () +function stores a representation of the state of the exception flags +represented by the argument +.I excepts +in the opaque object +.IR *flagp . +.LP +The +.BR feraiseexcept () +function raises the supported exceptions represented by the bits in +.IR excepts . +.LP +The +.BR fesetexceptflag () +function sets the complete status for the exceptions represented by +.I excepts +to the value +.IR *flagp . +This value must have been obtained by an earlier call of +.BR fegetexceptflag () +with a last argument that contained all bits in +.IR excepts . +.LP +The +.BR fetestexcept () +function returns a word in which the bits are set that were +set in the argument +.I excepts +and for which the corresponding exception is currently set. +.SS Rounding mode +The rounding mode determines how the result of floating-point operations +is treated when the result cannot be exactly represented in the signifcand. +Various rounding modes may be provided: +round to nearest (the default), +round up (towards positive infinity), +round down (towards negative infinity), and +round towards zero. + +Each of the macros +.BR FE_TONEAREST , +.BR FE_UPWARD , +.BR FE_DOWNWARD , +and +.BR FE_TOWARDZERO +is defined when the implementation supports getting and setting +the corresponding rounding direction. +.LP +The +.BR fegetround () +function returns the macro corresponding to the current +rounding mode. +.LP +The +.BR fesetround () +function sets the rounding mode as specified by its argument +and returns zero when it was successful. + +C99 and POSIX.1-2008 specify an identifier, +.BR FLT_ROUNDS , +defined in +.IR , +which indicates the implementation-defined rounding +behavior for floating-point addition. +This identifier has one of the following values: +.IP \-1 +The rounding mode is not determinable. +.IP 0 +Rounding is towards 0. +.IP 1 +Rounding is towards nearest number. +.IP 2 +Rounding is towards positive infinity. +.IP 3 +Rounding is towards negative infinity. +.PP +Other values represent machine-dependent, nonstandard rounding modes. +.PP +The value of +.BR FLT_ROUNDS +should reflect the current rounding mode as set by +.BR fesetround () +(but see BUGS). +.SS "Floating-point environment" +The entire floating-point environment, including +control modes and status flags, can be handled +as one opaque object, of type +.IR fenv_t . +The default environment is denoted by +.B FE_DFL_ENV +(of type +.IR "const fenv_t *" ). +This is the environment setup at program start and it is defined by +ISO C to have round to nearest, all exceptions cleared and a nonstop +(continue on exceptions) mode. +.LP +The +.BR fegetenv () +function saves the current floating-point environment in the object +.IR *envp . +.LP +The +.BR feholdexcept () +function does the same, then clears all exception flags, +and sets a nonstop (continue on exceptions) mode, +if available. +It returns zero when successful. +.LP +The +.BR fesetenv () +function restores the floating-point environment from +the object +.IR *envp . +This object must be known to be valid, for example, the result of a call to +.BR fegetenv () +or +.BR feholdexcept () +or equal to +.BR FE_DFL_ENV . +This call does not raise exceptions. +.LP +The +.BR feupdateenv () +function installs the floating-point environment represented by +the object +.IR *envp , +except that currently raised exceptions are not cleared. +After calling this function, the raised exceptions will be a bitwise OR +of those previously set with those in +.IR *envp . +As before, the object +.I *envp +must be known to be valid. +.SH "RETURN VALUE" +These functions return zero on success and nonzero if an error occurred. +.\" 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. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +IEC 60559 (IEC 559:1989), ANSI/IEEE 854, C99, POSIX.1-2001. +.SH NOTES +.SS Glibc Notes +If possible, the GNU C Library defines a macro +.B FE_NOMASK_ENV +which represents an environment where every exception raised causes a +trap to occur. +You can test for this macro using +.BR #ifdef . +It is only defined if +.B _GNU_SOURCE +is defined. +The C99 standard does not define a way to set individual bits in the +floating-point mask, for example, to trap on specific flags. +glibc 2.2 supports the functions +.BR feenableexcept () +and +.BR fedisableexcept () +to set individual floating-point traps, and +.BR fegetexcept () +to query the state. +.sp +.nf +.B "#define _GNU_SOURCE" +.br +.B "#include " +.sp +.BI "int feenableexcept(int " excepts ); +.br +.BI "int fedisableexcept(int " excepts ); +.br +.B "int fegetexcept(void);" +.br +.fi +.LP +The +.BR feenableexcept () +and +.BR fedisableexcept () +functions enable (disable) traps for each of the exceptions represented by +.I excepts +and return the previous set of enabled exceptions when successful, +and \-1 otherwise. +The +.BR fegetexcept () +function returns the set of all currently enabled exceptions. +.SH BUGS +C99 specifies that the value of +.B FLT_ROUNDS +should reflect changes to the current rounding mode, as set by +.BR fesetround (). +Currently, +.\" Aug 08, glibc 2.8 +this does not occur: +.B FLT_ROUNDS +always has the value 1. +.\" See http://gcc.gnu.org/ml/gcc/2002-02/msg01535.html +.SH "SEE ALSO" +.BR feature_test_macros (7), +.BR math_error (7) diff --git a/original/man3/feof.3 b/original/man3/feof.3 new file mode 100644 index 00000000..3a95cca9 --- /dev/null +++ b/original/man3/feof.3 @@ -0,0 +1 @@ +.so man3/ferror.3 diff --git a/original/man3/feof_unlocked.3 b/original/man3/feof_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/feof_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/feraiseexcept.3 b/original/man3/feraiseexcept.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/feraiseexcept.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/ferror.3 b/original/man3/ferror.3 new file mode 100644 index 00000000..55f2a1a1 --- /dev/null +++ b/original/man3/ferror.3 @@ -0,0 +1,116 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)ferror.3 6.8 (Berkeley) 6/29/91 +.\" +.\" +.\" Converted for Linux, Mon Nov 29 14:24:40 1993, faith@cs.unc.edu +.\" Added remark on EBADF for fileno, aeb, 2001-03-22 +.\" +.TH FERROR 3 2008-08-29 "" "Linux Programmer's Manual" +.SH NAME +clearerr, feof, ferror, fileno \- check and reset stream status +.SH SYNOPSIS +.B #include +.sp +.BI "void clearerr(FILE *" stream ); + +.BI "int feof(FILE *" stream ); + +.BI "int ferror(FILE *" stream ); + +.BI "int fileno(FILE *" stream ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR fileno (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.SH DESCRIPTION +The function +.BR clearerr () +clears the end-of-file and error indicators for the stream pointed to by +.IR stream . +.PP +The function +.BR feof () +tests the end-of-file indicator for the stream pointed to by +.IR stream , +returning nonzero if it is set. +The end-of-file indicator can only be +cleared by the function +.BR clearerr (). +.PP +The function +.BR ferror () +tests the error indicator for the stream pointed to by +.IR stream , +returning nonzero if it is set. +The error indicator can only be reset by the +.BR clearerr () +function. +.PP +The function +.BR fileno () +examines the argument +.I stream +and returns its integer descriptor. +.PP +For nonlocking counterparts, see +.BR unlocked_stdio (3). +.SH ERRORS +These functions should not fail and do not set the external variable +.IR errno . +(However, in case +.BR fileno () +detects that its argument is not a valid stream, it must +return \-1 and set +.I errno +to +.BR EBADF .) +.SH "CONFORMING TO" +The functions +.BR clearerr (), +.BR feof (), +and +.BR ferror () +conform to C89 and C99. +.SH "SEE ALSO" +.BR open (2), +.BR fdopen (3), +.BR stdio (3), +.BR unlocked_stdio (3) diff --git a/original/man3/ferror_unlocked.3 b/original/man3/ferror_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/ferror_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/fesetenv.3 b/original/man3/fesetenv.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/fesetenv.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/fesetexceptflag.3 b/original/man3/fesetexceptflag.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/fesetexceptflag.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/fesetround.3 b/original/man3/fesetround.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/fesetround.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/fetestexcept.3 b/original/man3/fetestexcept.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/fetestexcept.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/feupdateenv.3 b/original/man3/feupdateenv.3 new file mode 100644 index 00000000..47668e71 --- /dev/null +++ b/original/man3/feupdateenv.3 @@ -0,0 +1 @@ +.so man3/fenv.3 diff --git a/original/man3/fexecve.3 b/original/man3/fexecve.3 new file mode 100644 index 00000000..b8930a1c --- /dev/null +++ b/original/man3/fexecve.3 @@ -0,0 +1,89 @@ +.\" 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. +.\" +.TH FEXECVE 3 2009-02-04 "Linux" "Linux Programmer's Manual" +.SH NAME +fexecve \- execute program specified via file descriptor +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int fexecve(int " fd ", char *const " argv "[], char *const " envp []); +.fi +.SH DESCRIPTION +.BR fexecve () +performs the same task as +.BR execve (2), +with the difference that the file to be executed +is specified via a file descriptor, +.IR fd , +rather than via a pathname. +The file descriptor +.I fd +must be opened read-only, +and the caller must have permission to execute the file that it refers to. +.\" POSIX.1-2008 specifies the O_EXEC flag for open as an alternative, +.\" but Linux doesn't support this flag yet. +.SH "RETURN VALUE" +A successful call to +.BR fexecve () +never returns. +On error, the function returns, with a result value of \-1, and +.I errno +is set appropriately. +.SH ERRORS +Errors are as for +.BR execve (2), +with the following additions: +.TP +.B EINVAL +.I fd +is not a valid file descriptor, or +.I argv +is NULL, or +.I envp +is NULL. +.TP +.B ENOSYS +The +.I /proc +file system could not be accessed. +.SH VERSIONS +.BR fexecve () +is implemented since glibc 2.3.2. +.SH "CONFORMING TO" +POSIX.1-2008. +This function is not specified in POSIX.1-2001, +and is not widely available on other systems. +.SH NOTES +On Linux, +.BR fexecve () +is implemented using the +.BR proc (5) +file system, so +.I /proc +needs to be mounted and available at the time of the call. +.SH "SEE ALSO" +.BR execve (2) diff --git a/original/man3/fflush.3 b/original/man3/fflush.3 new file mode 100644 index 00000000..07c208e4 --- /dev/null +++ b/original/man3/fflush.3 @@ -0,0 +1,113 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fflush.3 5.4 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu +.\" +.\" Modified 2000-07-22 by Nicolás Lichtmaier +.\" Modified 2001-10-16 by John Levon +.\" +.TH FFLUSH 3 2009-09-06 "GNU" "Linux Programmer's Manual" +.SH NAME +fflush \- flush a stream +.SH SYNOPSIS +.B #include +.sp +.BI "int fflush(FILE *" stream ); +.SH DESCRIPTION +For output streams, +.BR fflush () +forces a write of all user-space buffered data for the given output or update +.I stream +via the stream's underlying write function. +For input streams, +.BR fflush () +discards any buffered data that has been fetched from the underlying file, +but has not been by the application. +The open status of the stream is unaffected. +.PP +If the +.I stream +argument is NULL, +.BR fflush () +flushes +.I all +open output streams. +.PP +For a nonlocking counterpart, see +.BR unlocked_stdio (3). +.SH "RETURN VALUE" +Upon successful completion 0 is returned. +Otherwise, +.B EOF +is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EBADF +.I Stream +is not an open stream, or is not open for writing. +.PP +The function +.BR fflush () +may also fail and set +.I errno +for any of the errors specified for +.BR write (2). +.SH "CONFORMING TO" +C89, C99, POSIX.1-2001, POSIX.1-2008. + +The standards do not specify the behavior for input streams. +Most other implementations behave the same as Linux. +.\" Verified on: Solaris 8. +.SH NOTES +Note that +.BR fflush () +only flushes the user space buffers provided by the C library. +To ensure that the data is physically stored on disk +the kernel buffers must be flushed too, for example, with +.BR sync (2) +or +.BR fsync (2). +.SH "SEE ALSO" +.BR fsync (2), +.BR sync (2), +.BR write (2), +.BR fclose (3), +.BR fopen (3), +.BR setbuf (3), +.BR unlocked_stdio (3) diff --git a/original/man3/fflush_unlocked.3 b/original/man3/fflush_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/fflush_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/ffs.3 b/original/man3/ffs.3 new file mode 100644 index 00000000..bc5c2ae2 --- /dev/null +++ b/original/man3/ffs.3 @@ -0,0 +1,77 @@ +.\" 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 Sat Jul 24 19:39:35 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Modified 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH FFS 3 2009-08-27 "GNU" "Linux Programmer's Manual" +.SH NAME +ffs, ffsl, ffsll \- find first bit set in a word +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int ffs(int " i ); +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int ffsl(long int " i ); +.sp +.BI "int ffsll(long long int " i ); +.fi +.SH DESCRIPTION +The +.BR ffs () +function returns the position of the first +(least significant) bit set in the word \fIi\fP. +The least significant bit is position 1 and the +most significant position is, for example, 32 or 64. +The functions +.BR ffsll () +and +.BR ffsl () +do the same but take +arguments of possibly different size. +.SH "RETURN VALUE" +These functions return the position of the first bit set, +or 0 if no bits are set in +.IR i . +.SH "CONFORMING TO" +.BR ffs (): 4.3BSD, POSIX.1-2001. +The +.BR ffsl () +and +.BR ffsll () +are glibc extensions. +.SH NOTES +BSD systems have a prototype in +.IR . +.SH "SEE ALSO" +.BR memchr (3), +.BR feature_test_macros (7) diff --git a/original/man3/ffsl.3 b/original/man3/ffsl.3 new file mode 100644 index 00000000..23c4024a --- /dev/null +++ b/original/man3/ffsl.3 @@ -0,0 +1 @@ +.so man3/ffs.3 diff --git a/original/man3/ffsll.3 b/original/man3/ffsll.3 new file mode 100644 index 00000000..23c4024a --- /dev/null +++ b/original/man3/ffsll.3 @@ -0,0 +1 @@ +.so man3/ffs.3 diff --git a/original/man3/fgetc.3 b/original/man3/fgetc.3 new file mode 100644 index 00000000..4636db71 --- /dev/null +++ b/original/man3/fgetc.3 @@ -0,0 +1 @@ +.so man3/gets.3 diff --git a/original/man3/fgetc_unlocked.3 b/original/man3/fgetc_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/fgetc_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/fgetgrent.3 b/original/man3/fgetgrent.3 new file mode 100644 index 00000000..95b72d41 --- /dev/null +++ b/original/man3/fgetgrent.3 @@ -0,0 +1,98 @@ +.\" 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 Sat Jul 24 19:38:44 1993 by Rik Faith (faith@cs.unc.edu) +.TH FGETGRENT 3 2008-07-10 "GNU" "Linux Programmer's Manual" +.SH NAME +fgetgrent \- get group file entry +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.sp +.BI "struct group *fgetgrent(FILE *" stream ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR fgetgrent (): +_SVID_SOURCE +.SH DESCRIPTION +The +.BR fgetgrent () +function returns a pointer to a structure containing +the group information from the file referred to by +.IR stream . +The first time it is called +it returns the first entry; thereafter, it returns successive entries. +The file referred to by +.I stream +must have the same format as +.I /etc/group +(see +.BR group (5)). +.PP +The \fIgroup\fP structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group ID */ + char **gr_mem; /* group members */ +}; +.fi +.in +.SH "RETURN VALUE" +The +.BR fgetgrent () +function returns a pointer to a +.I group +structure, +or NULL if there are no more entries or an error occurs. +.SH ERRORS +.TP +.B ENOMEM +Insufficient memory to allocate +.I group +structure. +.SH "CONFORMING TO" +SVr4. +.SH "SEE ALSO" +.BR endgrent (3), +.BR fgetgrent_r (3), +.BR fopen (3), +.BR getgrent (3), +.BR getgrgid (3), +.BR getgrnam (3), +.BR putgrent (3), +.BR setgrent (3), +.BR group (5) diff --git a/original/man3/fgetgrent_r.3 b/original/man3/fgetgrent_r.3 new file mode 100644 index 00000000..7c6dfe43 --- /dev/null +++ b/original/man3/fgetgrent_r.3 @@ -0,0 +1 @@ +.so man3/getgrent_r.3 diff --git a/original/man3/fgetpos.3 b/original/man3/fgetpos.3 new file mode 100644 index 00000000..a1487b5a --- /dev/null +++ b/original/man3/fgetpos.3 @@ -0,0 +1 @@ +.so man3/fseek.3 diff --git a/original/man3/fgetpwent.3 b/original/man3/fgetpwent.3 new file mode 100644 index 00000000..ee0a4ba5 --- /dev/null +++ b/original/man3/fgetpwent.3 @@ -0,0 +1,108 @@ +.\" 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 Sat Jul 24 19:37:37 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon May 27 22:40:48 1996 by Martin Schulze (joey@linux.de) +.\" +.TH FGETPWENT 3 2008-07-10 "GNU" "Linux Programmer's Manual" +.SH NAME +fgetpwent \- get password file entry +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.sp +.BI "struct passwd *fgetpwent(FILE *" stream ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR fgetpwent (): +_SVID_SOURCE +.SH DESCRIPTION +The +.BR fgetpwent () +function returns a pointer to a structure containing +the broken out fields of a line in the file \fIstream\fP. +The first time it is called it returns the first entry; +thereafter, it returns successive entries. +The file referred to by +.I stream +must have the same format as +.I /etc/passwd +(see +.BR passwd (5)). +.PP +The \fIpasswd\fP structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct passwd { + char *pw_name; /* username */ + char *pw_passwd; /* user password */ + uid_t pw_uid; /* user ID */ + gid_t pw_gid; /* group ID */ + char *pw_gecos; /* real name */ + char *pw_dir; /* home directory */ + char *pw_shell; /* shell program */ +}; +.fi +.in +.SH "RETURN VALUE" +The +.BR fgetpwent () +function returns a pointer to a +.I passwd +structure, or NULL if +there are no more entries or an error occurs. +.SH ERRORS +.TP +.B ENOMEM +Insufficient memory to allocate +.I passwd +structure. +.SH FILES +.TP +.I /etc/passwd +password database file +.SH "CONFORMING TO" +SVr4. +.SH "SEE ALSO" +.BR endpwent (3), +.BR fgetpwent_r (3), +.BR fopen (3), +.BR getpw (3), +.BR getpwent (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR putpwent (3), +.BR setpwent (3), +.BR passwd (5) diff --git a/original/man3/fgetpwent_r.3 b/original/man3/fgetpwent_r.3 new file mode 100644 index 00000000..b2393bb6 --- /dev/null +++ b/original/man3/fgetpwent_r.3 @@ -0,0 +1 @@ +.so man3/getpwent_r.3 diff --git a/original/man3/fgets.3 b/original/man3/fgets.3 new file mode 100644 index 00000000..4636db71 --- /dev/null +++ b/original/man3/fgets.3 @@ -0,0 +1 @@ +.so man3/gets.3 diff --git a/original/man3/fgets_unlocked.3 b/original/man3/fgets_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/fgets_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/fgetspent.3 b/original/man3/fgetspent.3 new file mode 100644 index 00000000..142c5a5c --- /dev/null +++ b/original/man3/fgetspent.3 @@ -0,0 +1 @@ +.so man3/getspnam.3 diff --git a/original/man3/fgetspent_r.3 b/original/man3/fgetspent_r.3 new file mode 100644 index 00000000..142c5a5c --- /dev/null +++ b/original/man3/fgetspent_r.3 @@ -0,0 +1 @@ +.so man3/getspnam.3 diff --git a/original/man3/fgetwc.3 b/original/man3/fgetwc.3 new file mode 100644 index 00000000..18fa532e --- /dev/null +++ b/original/man3/fgetwc.3 @@ -0,0 +1,86 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon +.TH FGETWC 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +fgetwc, getwc \- read a wide character from a FILE stream +.SH SYNOPSIS +.nf +.B #include +.br +.B #include +.sp +.BI "wint_t fgetwc(FILE *" stream ); +.BI "wint_t getwc(FILE *" stream ); +.fi +.SH DESCRIPTION +The +.BR fgetwc () +function is the wide-character equivalent +of the +.BR fgetc (3) +function. +It reads a wide character from \fIstream\fP and returns it. +If the end of stream is reached, or if \fIferror(stream)\fP becomes true, +it returns +.BR WEOF . +If a wide-character conversion error occurs, it sets +\fIerrno\fP to \fBEILSEQ\fP and returns +.BR WEOF . +.PP +The +.BR getwc () +function or macro functions identically to +.BR fgetwc (). +It may be implemented as a macro, and may evaluate its argument +more than once. +There is no reason ever to use it. +.PP +For nonlocking counterparts, see +.BR unlocked_stdio (3). +.SH "RETURN VALUE" +The +.BR fgetwc () +function returns the next wide-character +from the stream, or +.BR WEOF . +.SH ERRORS +Apart from the usual ones, there is +.TP +.B EILSEQ +The data obtained from the input stream does not +form a valid character. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH NOTES +The behavior of +.BR fgetwc () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +In the absence of additional information passed to the +.BR fopen (3) +call, it is +reasonable to expect that +.BR fgetwc () +will actually read a multibyte sequence +from the stream and then convert it to a wide character. +.SH "SEE ALSO" +.BR fgetws (3), +.BR fputwc (3), +.BR ungetwc (3), +.BR unlocked_stdio (3) diff --git a/original/man3/fgetwc_unlocked.3 b/original/man3/fgetwc_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/fgetwc_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/fgetws.3 b/original/man3/fgetws.3 new file mode 100644 index 00000000..3a7d7a64 --- /dev/null +++ b/original/man3/fgetws.3 @@ -0,0 +1,73 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon +.TH FGETWS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +fgetws \- read a wide-character string from a FILE stream +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *fgetws(wchar_t *" ws ", int " n ", FILE *" stream ); +.fi +.SH DESCRIPTION +The +.BR fgetws () +function is the wide-character equivalent +of the +.BR fgets (3) +function. +It reads a string of at most \fIn\-1\fP wide characters into the +wide-character array pointed to by \fIws\fP, +and adds a terminating L\(aq\\0\(aq character. +It stops reading wide characters after it has encountered and +stored a newline wide character. +It also stops when end of stream is reached. +.PP +The programmer must ensure that there is room for at least \fIn\fP wide +characters at \fIws\fP. +.PP +For a nonlocking counterpart, see +.BR unlocked_stdio (3). +.SH "RETURN VALUE" +The +.BR fgetws () +function, if successful, returns \fIws\fP. +If end of stream +was already reached or if an error occurred, it returns NULL. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH NOTES +The behavior of +.BR fgetws () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +In the absence of additional information passed to the +.BR fopen (3) +call, it is +reasonable to expect that +.BR fgetws () +will actually read a multibyte string +from the stream and then convert it to a wide-character string. +.PP +This function is unreliable, +because it does not permit to deal properly with +null wide characters that may be present in the input. +.SH "SEE ALSO" +.BR fgetwc (3), +.BR unlocked_stdio (3) diff --git a/original/man3/fgetws_unlocked.3 b/original/man3/fgetws_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/fgetws_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/fileno.3 b/original/man3/fileno.3 new file mode 100644 index 00000000..3a95cca9 --- /dev/null +++ b/original/man3/fileno.3 @@ -0,0 +1 @@ +.so man3/ferror.3 diff --git a/original/man3/fileno_unlocked.3 b/original/man3/fileno_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/fileno_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/finite.3 b/original/man3/finite.3 new file mode 100644 index 00000000..91382af1 --- /dev/null +++ b/original/man3/finite.3 @@ -0,0 +1,113 @@ +.\" Copyright 2004 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. +.\" +.TH FINITE 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +finite, finitef, finitel, isinf, isinff, isinfl, isnan, isnanf, isnanl \- +BSD floating-point classification functions +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int finite(double " x ); +.br +.BI "int finitef(float " x ); +.br +.BI "int finitel(long double " x ); +.sp +.BI "int isinf(double " x ); +.br +.BI "int isinff(float " x ); +.br +.BI "int isinfl(long double " x ); +.sp +.BI "int isnan(double " x ); +.br +.BI "int isnanf(float " x ); +.br +.BI "int isnanl(long double " x ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR finite (), +.BR finitef (), +.BR finitel (): +_BSD_SOURCE || _SVID_SOURCE +.br +.BR isinf (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; +.I cc\ -std=c99 +.br +.BR isinff (), +.BR isinfl (): +_BSD_SOURCE || _SVID_SOURCE +.br +.BR isnan (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; +.I cc\ -std=c99 +.br +.BR isnanf (), +.BR isnanl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH DESCRIPTION +The +.BR finite () +functions return a nonzero value if \fIx\fP is neither infinite +nor a "not-a-number" (NaN) value, and 0 otherwise. + +The +.BR isnan () +functions return a nonzero value if \fIx\fP is a NaN value, +and 0 otherwise. + +The +.BR isinf () +functions return 1 if \fIx\fP is positive infinity, \-1 if \fIx\fP +is negative infinity, and 0 otherwise. +.SH NOTES +Note that these functions are obsolete. +C99 defines macros +.BR isfinite (), +.BR isinf (), +and +.BR isnan () +(for all types) replacing them. +Further note that the C99 +.BR isinf () +has weaker guarantees on the return value. +See +.BR fpclassify (3). +.\" +.\" finite* not on HP-UX; they exist on Tru64. +.\" .SH HISTORY +.\" The +.\" .BR finite () +.\" function occurs in 4.3BSD. +.\" see IEEE.3 in the 4.3BSD manual +.SH "SEE ALSO" +.BR fpclassify (3) diff --git a/original/man3/finitef.3 b/original/man3/finitef.3 new file mode 100644 index 00000000..19f709b1 --- /dev/null +++ b/original/man3/finitef.3 @@ -0,0 +1 @@ +.so man3/finite.3 diff --git a/original/man3/finitel.3 b/original/man3/finitel.3 new file mode 100644 index 00000000..19f709b1 --- /dev/null +++ b/original/man3/finitel.3 @@ -0,0 +1 @@ +.so man3/finite.3 diff --git a/original/man3/flockfile.3 b/original/man3/flockfile.3 new file mode 100644 index 00000000..af679850 --- /dev/null +++ b/original/man3/flockfile.3 @@ -0,0 +1,126 @@ +.\" 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. +.\" +.TH FLOCKFILE 3 2008-08-29 "" "Linux Programmer's Manual" +.SH NAME +flockfile, ftrylockfile, funlockfile \- lock FILE for stdio +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void flockfile(FILE *" filehandle ); +.br +.BI "int ftrylockfile(FILE *" filehandle ); +.br +.BI "void funlockfile(FILE *" filehandle ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.ad l +.sp +All functions shown above: +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +The stdio functions are thread-safe. +This is achieved by assigning +to each +.I FILE +object a lockcount and (if the lockcount is nonzero) +an owning thread. +For each library call, these functions wait until the +.I FILE +object +is no longer locked by a different thread, then lock it, do the +requested I/O, and unlock the object again. +.LP +(Note: this locking has nothing to do with the file locking done +by functions like +.BR flock (2) +and +.BR lockf (3).) +.LP +All this is invisible to the C-programmer, but there may be two +reasons to wish for more detailed control. +On the one hand, maybe +a series of I/O actions by one thread belongs together, and should +not be interrupted by the I/O of some other thread. +On the other hand, maybe the locking overhead should be avoided +for greater efficiency. +.LP +To this end, a thread can explicitly lock the +.I FILE +object, +then do its series of I/O actions, then unlock. +This prevents +other threads from coming in between. +If the reason for doing +this was to achieve greater efficiency, one does the I/O with +the nonlocking versions of the stdio functions: with +.BR getc_unlocked (3) +and +.BR putc_unlocked (3) +instead of +.BR getc (3) +and +.BR putc (3). +.LP +The +.BR flockfile () +function waits for \fI*filehandle\fP to be +no longer locked by a different thread, then makes the +current thread owner of \fI*filehandle\fP, and increments +the lockcount. +.LP +The +.BR funlockfile () +function decrements the lock count. +.LP +The +.BR ftrylockfile () +function is a nonblocking version +of +.BR flockfile (). +It does nothing in case some other thread +owns \fI*filehandle\fP, and it obtains ownership and increments +the lockcount otherwise. +.SH "RETURN VALUE" +The +.BR ftrylockfile () +function returns zero for success +(the lock was obtained), and nonzero for failure. +.SH ERRORS +None. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH AVAILABILITY +These functions are available when +.B _POSIX_THREAD_SAFE_FUNCTIONS +is defined. +They are in libc since libc 5.1.1 and in glibc +since glibc 2.0. +.SH "SEE ALSO" +.BR unlocked_stdio (3) diff --git a/original/man3/floor.3 b/original/man3/floor.3 new file mode 100644 index 00000000..43f36a19 --- /dev/null +++ b/original/man3/floor.3 @@ -0,0 +1,98 @@ +.\" Copyright 2001 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. +.\" +.TH FLOOR 3 2008-10-06 "" "Linux Programmer's Manual" +.SH NAME +floor, floorf, floorl \- largest integral value not greater than argument +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double floor(double " x ); +.br +.BI "float floorf(float " x ); +.br +.BI "long double floorl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR floorf (), +.BR floorl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions return the largest integral value that is not greater than +.IR x . + +For example, +.IR floor(0.5) +is 0.0, and +.IR floor(\-0.5) +is \-1.0. +.SH "RETURN VALUE" +These functions return the floor of +.IR x . + +If \fIx\fP is integral, +0, \-0, NaN, or an infinity, +\fIx\fP itself is returned. +.SH ERRORS +No errors occur. +POSIX.1-2001 documents a range error for overflows, but see NOTES. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH NOTES +SUSv2 and POSIX.1-2001 contain text about overflow (which might set +.I errno +to +.BR ERANGE , +or raise an +.B FE_OVERFLOW +exception). +In practice, the result cannot overflow on any current machine, +so this error-handling stuff is just nonsense. +.\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point. +(More precisely, overflow can happen only when the maximum value +of the exponent is smaller than the number of mantissa bits. +For the IEEE-754 standard 32-bit and 64-bit floating-point numbers +the maximum value of the exponent is 128 (respectively, 1024), +and the number of mantissa bits is 24 (respectively, 53).) +.SH "SEE ALSO" +.BR ceil (3), +.BR lrint (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3), +.BR trunc (3) diff --git a/original/man3/floorf.3 b/original/man3/floorf.3 new file mode 100644 index 00000000..1d8e79b2 --- /dev/null +++ b/original/man3/floorf.3 @@ -0,0 +1 @@ +.so man3/floor.3 diff --git a/original/man3/floorl.3 b/original/man3/floorl.3 new file mode 100644 index 00000000..1d8e79b2 --- /dev/null +++ b/original/man3/floorl.3 @@ -0,0 +1 @@ +.so man3/floor.3 diff --git a/original/man3/fma.3 b/original/man3/fma.3 new file mode 100644 index 00000000..814dc2d0 --- /dev/null +++ b/original/man3/fma.3 @@ -0,0 +1,151 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" Distributed under GPL, 2002-07-27 Walter Harms +.\" Modified 2004-11-15, Added further text on FLT_ROUNDS +.\" as suggested by AEB and Fabian Kreutz +.\" +.TH FMA 3 2008-10-06 "" "Linux Programmer's Manual" +.SH NAME +fma, fmaf, fmal \- floating-point multiply and add +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double fma(double " x ", double " y ", double " z ); +.br +.BI "float fmaf(float " x ", float " y ", float " z ); +.br +.BI "long double fmal(long double " x ", long double " y ", long double " z ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR fma (), +.BR fmaf (), +.BR fmal (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR fma () +function computes +.IR x " * " y " + " z . +The result is rounded as one ternary operation according to the +current rounding mode (see +.BR fenv (3)). +.SH RETURN VALUE +These functions return the value of +.IR x " * " y " + " z , +rounded as one ternary operation. + +If +.I x +or +.I y +is a NaN, a NaN is returned. + +If +.I x +times +.I y +is an exact infinity, and +.I z +is an infinity with the opposite sign, +a domain error occurs, +and a NaN is returned. + +.\" 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. +If one of +.I x +or +.I y +is an infinity, the other is 0, and +.I z +is not a NaN, +a domain error occurs, and +a NaN is returned. +.\" POSIX.1 says that a NaN or an implementation-defined value shall +.\" be returned for this case. + +If one of +.I x +or +.I y +is an infinity, and the other is 0, and +.I z +is a NaN, +.\" POSIX.1 makes the domain error optional for this case. +a domain error occurs, and +a NaN is returned. + +If +.I x +times +.I y +is not an infinity times zero (or vice versa), and +.I z +is a NaN, +a NaN is returned. + +If the result overflows, +a range error occurs, and +an infinity with the correct sign is returned. + +If the result underflows, +a range error occurs, and +a signed 0 is returned. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP * \fIy\fP + \fIz\fP, \ +or \fIx\fP * \fIy\fP is invalid and \fIz\fP is not a NaN +.\" .I errno +.\" is set to +.\" .BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.TP +Range error: result overflow +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.TP +Range error: result underflow +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An underflow floating-point exception +.RB ( FE_UNDERFLOW ) +is raised. +.PP +These functions do not set +.IR errno . +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6801 +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR remainder (3), +.BR remquo (3) diff --git a/original/man3/fmaf.3 b/original/man3/fmaf.3 new file mode 100644 index 00000000..e050da05 --- /dev/null +++ b/original/man3/fmaf.3 @@ -0,0 +1 @@ +.so man3/fma.3 diff --git a/original/man3/fmal.3 b/original/man3/fmal.3 new file mode 100644 index 00000000..e050da05 --- /dev/null +++ b/original/man3/fmal.3 @@ -0,0 +1 @@ +.so man3/fma.3 diff --git a/original/man3/fmax.3 b/original/man3/fmax.3 new file mode 100644 index 00000000..fb044796 --- /dev/null +++ b/original/man3/fmax.3 @@ -0,0 +1,53 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" Distributed under GPL +.\" +.TH FMAX 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +fmax, fmaxf, fmaxl \- determine maximum of two floating-point numbers +.SH SYNOPSIS +.B #include +.sp +.BI "double fmax(double " x ", double " y ); +.br +.BI "float fmaxf(float " x ", float " y ); +.br +.BI "long double fmaxl(long double " x ", long double " y ); +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR fmax (), +.BR fmaxf (), +.BR fmaxl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions return the larger value of +.I x +and +.IR y . +.SH RETURN VALUE +These functions return the maximum of +.I x +and +.IR y . + +If one argument is a NaN, the other argument is returned. + +If both arguments are NaN, a NaN is returned. +.SH ERRORS +No errors occur. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR fmin (3) diff --git a/original/man3/fmaxf.3 b/original/man3/fmaxf.3 new file mode 100644 index 00000000..5f68a861 --- /dev/null +++ b/original/man3/fmaxf.3 @@ -0,0 +1 @@ +.so man3/fmax.3 diff --git a/original/man3/fmaxl.3 b/original/man3/fmaxl.3 new file mode 100644 index 00000000..5f68a861 --- /dev/null +++ b/original/man3/fmaxl.3 @@ -0,0 +1 @@ +.so man3/fmax.3 diff --git a/original/man3/fmemopen.3 b/original/man3/fmemopen.3 new file mode 100644 index 00000000..c92924f9 --- /dev/null +++ b/original/man3/fmemopen.3 @@ -0,0 +1,256 @@ +.\" Copyright 2005 walter harms (walter.harms@informatik.uni-oldenburg.de), +.\" and Copyright 2005 Michael Kerrisk +.\" Distributed under the GPL. +.\" 2008-12-04, Petr Baudis : Document open_wmemstream() +.\" +.TH FMEMOPEN 3 2009-09-15 "GNU" "Linux Programmer's Manual" +.SH NAME +fmemopen, open_memstream, open_wmemstream \- open memory as stream +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "FILE *fmemopen(void *"buf ", size_t "size ", const char *" mode ");" + +.BI "FILE *open_memstream(char **" ptr ", size_t *" sizeloc ); + +.B #define _GNU_SOURCE +.B #include + +.BI "FILE *open_wmemstream(wchar_t **" ptr ", size_t *" sizeloc ); +.SH DESCRIPTION +The +.BR fmemopen () +function opens a stream that permits the access specified by +.IR mode . +The stream allows I/O to be performed on the string or memory buffer +pointed to by +.IR buf . +This buffer must be at least +.I size +bytes long. +.PP +The argument +.I mode +is the same as for +.BR fopen (3). +If +.I mode +specifies an append mode, then the initial file position is set to +the location of the first null byte (\(aq\\0\(aq) in the buffer; +otherwise the initial file position is set to the start of the buffer. +Since glibc 2.9, +the letter 'b' may be specified as the second character in +.IR mode . +This provides "binary" mode: +writes don't implicitly add a terminating null byte, and +.BR fseek (3) +.B SEEK_END +is relative to the end of the buffer (i.e., the value specified by the +.I size +argument), rather than the current string length. +.PP +When a stream that has been opened for writing is flushed +.RB ( fflush (3)) +or closed +.RB ( fclose (3)), +a null byte is written at the end of the buffer if there is space. +The caller should ensure that an extra byte is available in the +buffer +(and that +.I size +counts that byte) +to allow for this. + +Attempts to write more than +.I size +bytes to the buffer result in an error. +(By default, such errors will only be visible when the +.I stdio +buffer is flushed. +Disabling buffering with +.I setbuf(fp,\ NULL) +may be useful to detect errors at the time of an output operation. +Alternatively, the caller can explicitly set +.I buf +as the stdio stream buffer, at the same time informing stdio +of the buffer's size, using +.IR "setbuffer(fp, buf, size)" .) +.\" See http://sourceware.org/bugzilla/show_bug.cgi?id=1995 +.\" and +.\" http://sources.redhat.com/ml/libc-alpha/2006-04/msg00064.html +.PP +In a stream opened for reading, +null bytes (\(aq\\0\(aq) in the buffer do not cause read +operations to return an end-of-file indication. +A read from the buffer will only indicate end-of-file +when the file pointer advances +.I size +bytes past the start of the buffer. +.PP +If +.I buf +is specified as NULL, then +.BR fmemopen () +dynamically allocates a buffer +.I size +bytes long. +This is useful for an application that wants to write data to +a temporary buffer and then read it back again. +The buffer is automatically freed when the stream is closed. +Note that the caller has no way to obtain a pointer to the +temporary buffer allocated by this call (but see +.BR open_memstream () +below). + +The +.BR open_memstream () +function opens a stream for writing to a buffer. +The buffer +is dynamically allocated (as with +.BR malloc (3)), +and automatically grows as required. +After closing the stream, the caller should +.BR free (3) +this buffer. + +When the stream is closed +.RB ( fclose (3)) +or flushed +.RB ( fflush (3)), +the locations pointed to by +.I ptr +and +.I sizeloc +are updated to contain, respectively, a pointer to the buffer and the +current size of the buffer. +These values remain valid only as long as the caller +performs no further output on the stream. +If further output is performed, then the stream +must again be flushed before trying to access these variables. + +A null byte is maintained at the end of the buffer. +This byte is +.I not +included in the size value stored at +.IR sizeloc . + +The stream's file position can be changed with +.BR fseek (3) +or +.BR fseeko (3). +Moving the file position past the end +of the data already written fills the intervening space with +zeros. + +The +.BR open_wmemstream () +is similar to +.BR open_memstream (), +but operates on wide characters instead of bytes. +.SH "RETURN VALUE" +Upon successful completion +.BR fmemopen (), +.BR open_memstream () +and +.BR open_wmemstream () +return a +.I FILE +pointer. +Otherwise, NULL is returned and +.I errno +is set to indicate the error. +.SH VERSIONS +.BR fmemopen () +and +.BR open_memstream () +were already available in glibc 1.0.x. +.BR open_wmemstream () +is available since glibc 2.4. +.SH "CONFORMING TO" +POSIX.1-2008. +These functions are not specified in POSIX.1-2001, +and are not widely available on other systems. +.SH NOTES +There is no file descriptor associated with the file stream +returned by these functions +(i.e., +.BR fileno (3) +will return an error if called on the returned stream). +.SH BUGS +In glibc before version 2.7, seeking past the end of a stream created by +.BR open_memstream () +does not enlarge the buffer; instead the +.BR fseek () +call fails, returning \-1. +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=1996 +.SH "EXAMPLE" +The program below uses +.BR fmemopen () +to open an input buffer, and +.BR open_memstream () +to open a dynamically sized output buffer. +The program scans its input string (taken from the program's +first command-line argument) reading integers, +and writes the squares of these integers to the output buffer. +An example of the output produced by this program is the following: +.in +4n +.nf + +.RB "$" " ./a.out \(aq1 23 43\(aq" +size=11; ptr=1 529 1849 +.fi +.in +.SS Program source +\& +.nf +#define _GNU_SOURCE +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int +main(int argc, char *argv[]) +{ + FILE *out, *in; + int v, s; + size_t size; + char *ptr; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + in = fmemopen(argv[1], strlen(argv[1]), "r"); + if (in == NULL) + handle_error("fmemopen"); + + out = open_memstream(&ptr, &size); + if (out == NULL) + handle_error("fmemopen"); + + for (;;) { + s = fscanf(in, "%d", &v); + if (s <= 0) + break; + + s = fprintf(out, "%d ", v * v); + if (s == \-1) + handle_error("fprintf"); + } + fclose(in); + fclose(out); + printf("size=%ld; ptr=%s\\n", (long) size, ptr); + free(ptr); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR fopen (3), +.BR fopencookie (3), +.BR feature_test_macros (7) diff --git a/original/man3/fmin.3 b/original/man3/fmin.3 new file mode 100644 index 00000000..8902ca4f --- /dev/null +++ b/original/man3/fmin.3 @@ -0,0 +1,53 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" Distributed under GPL +.\" +.TH FMIN 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +fmin, fminf, fminl \- determine minimum of two floating-point numbers +.SH SYNOPSIS +.B #include +.sp +.BI "double fmin(double " x ", double " y ); +.br +.BI "float fminf(float " x ", float " y ); +.br +.BI "long double fminl(long double " x ", long double " y ); +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR fmin (), +.BR fminf (), +.BR fminl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions the lesser value of +.I x +and +.IR y . +.SH RETURN VALUE +These functions return the minimum of +.I x +and +.IR y . + +If one argument is a NaN, the other argument is returned. + +If both arguments are NaN, a NaN is returned. +.SH ERRORS +No errors occur. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR fmax (3) diff --git a/original/man3/fminf.3 b/original/man3/fminf.3 new file mode 100644 index 00000000..a86d77d7 --- /dev/null +++ b/original/man3/fminf.3 @@ -0,0 +1 @@ +.so man3/fmin.3 diff --git a/original/man3/fminl.3 b/original/man3/fminl.3 new file mode 100644 index 00000000..a86d77d7 --- /dev/null +++ b/original/man3/fminl.3 @@ -0,0 +1 @@ +.so man3/fmin.3 diff --git a/original/man3/fmod.3 b/original/man3/fmod.3 new file mode 100644 index 00000000..68f875b9 --- /dev/null +++ b/original/man3/fmod.3 @@ -0,0 +1,138 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.TH FMOD 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +fmod, fmodf, fmodl \- floating-point remainder function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double fmod(double " x ", double " y ); +.br +.BI "float fmodf(float " x ", float " y ); +.br +.BI "long double fmodl(long double " x ", long double " y ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR fmodf (), +.BR fmodl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR fmod () +function computes the floating-point remainder of dividing \fIx\fP by +\fIy\fP. +The return value is \fIx\fP \- \fIn\fP * \fIy\fP, where \fIn\fP +is the quotient of \fIx\fP / \fIy\fP, rounded towards zero to an integer. +.SH "RETURN VALUE" +On success, these +functions return the value \fIx\fP\ \-\ \fIn\fP*\fIy\fP, +for some integer \fIn\fP, +such that the returned value has the same sign as +.I x +and a magnitude less than the magnitude of +.IR y . + +If +.I x +or +.I y +is a NaN, a NaN is returned. + +If +.I x +is an infinity, +a domain error occurs, and +a NaN is returned. + +If +.I y +is zero, +a domain error occurs, and +a NaN is returned. + +If +.I x +is +0 (\-0), and +.I y +is not zero, +0 (\-0) is returned. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is an infinity +.\" .I errno +.\" is set to +.\" .BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.IP +These functions do not set +.IR errno +for this case. +.\" 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=6784 +.TP +Domain error: \fIy\fP is zero +.I errno +is set to +.BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.\" POSIX.1 documents an optional underflow error, but AFAICT it doesn't +.\" (can't?) occur -- mtk, Jul 2008 +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR remainder (3) diff --git a/original/man3/fmodf.3 b/original/man3/fmodf.3 new file mode 100644 index 00000000..d014cc04 --- /dev/null +++ b/original/man3/fmodf.3 @@ -0,0 +1 @@ +.so man3/fmod.3 diff --git a/original/man3/fmodl.3 b/original/man3/fmodl.3 new file mode 100644 index 00000000..d014cc04 --- /dev/null +++ b/original/man3/fmodl.3 @@ -0,0 +1 @@ +.so man3/fmod.3 diff --git a/original/man3/fmtmsg.3 b/original/man3/fmtmsg.3 new file mode 100644 index 00000000..62c8d817 --- /dev/null +++ b/original/man3/fmtmsg.3 @@ -0,0 +1,295 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" adapted glibc info page +.\" +.\" This should run as 'Guru Meditation' (amiga joke :) +.\" The function is quite complex and deserves an example +.\" +.\" Polished, aeb, 2003-11-01 +.TH FMTMSG 3 2008-06-14 "" "Linux Programmer's Manual" +.SH NAME +fmtmsg \- print formatted error messages +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int fmtmsg(long " classification ", const char *" label , +.br +.BI " int " severity ", const char *" text , +.br +.BI " const char *" action ", const char *" tag ); +.fi +.SH DESCRIPTION +This function displays a message described by its arguments on the device(s) +specified in the +.I classification +argument. +For messages written to +.IR stderr , +the format depends on the +.B MSGVERB +environment variable. +.LP +The +.I label +argument identifies the source of the message. +The string must consist +of two colon separated parts where the first part has not more +than 10 and the second part not more than 14 characters. +.LP +The +.I text +argument describes the condition of the error. +.LP +The +.I action +argument describes possible steps to recover from the error. +If it is printed, it is prefixed by "TO FIX: ". +.LP +The +.I tag +argument is a reference to the online documentation where more +information can be found. +It should contain the +.I label +value and a unique identification number. +.SS "Dummy arguments" +Each of the arguments can have a dummy value. +The dummy classification value +.B MM_NULLMC +(0L) does not specify any output, so nothing is printed. +The dummy severity value +.B NO_SEV +(0) says that no severity is supplied. +The values +.BR MM_NULLLBL , +.BR MM_NULLTXT , +.BR MM_NULLACT , +.B MM_NULLTAG +are synonyms for +.IR "((char *) 0)" , +the empty string, and +.B MM_NULLSEV +is a synonym for +.BR NO_SEV . +.SS "The classification argument" +The +.I classification +argument is the sum of values describing 4 types of information. +.br +.sp +The first value defines the output channel. +.TP 12n +.B MM_PRINT +Output to +.IR stderr . +.TP +.B MM_CONSOLE +Output to the system console. +.TP +.B "MM_PRINT | MM_CONSOLE" +Output to both. +.PP +The second value is the source of the error: +.TP 12n +.B MM_HARD +A hardware error occurred. +.TP +.B MM_FIRM +A firmware error occurred. +.TP +.B MM_SOFT +A software error occurred. +.PP +The third value encodes the detector of the problem: +.TP 12n +.B MM_APPL +It is detected by an application. +.TP +.B MM_UTIL +It is detected by a utility. +.TP +.B MM_OPSYS +It is detected by the operating system. +.PP +The fourth value shows the severity of the incident: +.TP 12n +.B MM_RECOVER +It is a recoverable error. +.TP +.B MM_NRECOV +It is a nonrecoverable error. +.SS "The severity argument" +The +.I severity +argument can take one of the following values: +.TP 12n +.B MM_NOSEV +No severity is printed. +.TP +.B MM_HALT +This value is printed as HALT. +.TP +.B MM_ERROR +This value is printed as ERROR. +.TP +.B MM_WARNING +This value is printed as WARNING. +.TP +.B MM_INFO +This value is printed as INFO. +.PP +The numeric values are between 0 and 4. +Using +.BR addseverity (3) +or the environment variable +.B SEV_LEVEL +you can add more levels and strings to print. +.SH "RETURN VALUE" +The function can return 4 values: +.TP 12n +.B MM_OK +Everything went smooth. +.TP +.B MM_NOTOK +Complete failure. +.TP +.B MM_NOMSG +Error writing to +.IR stderr . +.TP +.B MM_NOCON +Error writing to the console. +.SH ENVIRONMENT +The environment variable +.B MSGVERB +("message verbosity") can be used to suppress parts of +the output to +.IR stderr . +(It does not influence output to the console.) +When this variable is defined, is non-NULL, and is a colon-separated +list of valid keywords, then only the parts of the message corresponding +to these keywords is printed. +Valid keywords are "label", "severity", "text", "action" and "tag". +.PP +The environment variable +.B SEV_LEVEL +can be used to introduce new severity levels. +By default, only the five severity levels described +above are available. +Any other numeric value would make +.BR fmtmsg () +print nothing. +If the user puts +.B SEV_LEVEL +with a format like +.sp +.RS +SEV_LEVEL=[description[:description[:...]]] +.RE +.sp +in the environment of the process before the first call to +.BR fmtmsg (), +where each description is of the form +.sp +.RS +severity-keyword,level,printstring +.RE +.sp +then +.BR fmtmsg () +will also accept the indicated values for the level (in addition to +the standard levels 0-4), and use the indicated printstring when +such a level occurs. +.LP +The severity-keyword part is not used by +.BR fmtmsg () +but it has to be present. +The level part is a string representation of a number. +The numeric value must be a number greater than 4. +This value must be used in the severity argument of +.BR fmtmsg () +to select this class. +It is not possible to overwrite +any of the predefined classes. +The printstring +is the string printed when a message of this class is processed by +.BR fmtmsg (). +.SH VERSIONS +.BR fmtmsg () +is provided in glibc since version 2.1. +.SH "CONFORMING TO" +The functions +.BR fmtmsg () +and +.BR addseverity (3), +and environment variables +.B MSGVERB +and +.B SEV_LEVEL +come from System V. +The function +.BR fmtmsg () +and the environment variable +.B MSGVERB +are described in POSIX.1-2001. +.SH NOTES +System V and Unixware man pages tell us that these functions +have been replaced by "pfmt() and addsev()" or by "pfmt(), +vpfmt(), lfmt(), and vlfmt()", and will be removed later. +.SH EXAMPLE +.nf +#include +#include +#include + +int +main(void) +{ + long class = MM_PRINT | MM_SOFT | MM_OPSYS | MM_RECOVER; + int err; + + err = fmtmsg(class, "util\-linux:mount", MM_ERROR, + "unknown mount option", "See mount(8).", + "util\-linux:mount:017"); + switch (err) { + case MM_OK: + break; + case MM_NOTOK: + printf("Nothing printed\en"); + break; + case MM_NOMSG: + printf("Nothing printed to stderr\en"); + break; + case MM_NOCON: + printf("No console output\en"); + break; + default: + printf("Unknown error from fmtmsg()\en"); + } + exit(EXIT_SUCCESS); +} +.fi +.PP +The output should be: +.nf + + util\-linux:mount: ERROR: unknown mount option + TO FIX: See mount(8). util\-linux:mount:017 + +.fi +and after +.nf + + MSGVERB=text:action; export MSGVERB + +.fi +the output becomes: +.nf + + unknown mount option + TO FIX: See mount(8). +.fi +.SH "SEE ALSO" +.BR addseverity (3), +.BR perror (3) diff --git a/original/man3/fnmatch.3 b/original/man3/fnmatch.3 new file mode 100644 index 00000000..3f6b8b68 --- /dev/null +++ b/original/man3/fnmatch.3 @@ -0,0 +1,103 @@ +.\" 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:35:54 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon Oct 16 00:16:29 2000 following Joseph S. Myers +.\" +.TH FNMATCH 3 2000-10-15 "GNU" "Linux Programmer's Manual" +.SH NAME +fnmatch \- match filename or pathname +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int fnmatch(const char *" "pattern" ", const char *" string ", int " flags ); +.fi +.SH DESCRIPTION +The +.BR fnmatch () +function checks whether the +.I string +argument matches the +.I pattern +argument, which is a shell wildcard pattern. +.PP +The +.I flags +argument modifies the behavior; it is the bitwise OR of zero or more +of the following flags: +.TP +.B FNM_NOESCAPE +If this flag is set, treat backslash as an ordinary character, +instead of an escape character. +.TP +.B FNM_PATHNAME +If this flag is set, match a slash in +.I string +only with a slash in +.I pattern +and not by an asterisk (*) or a question mark (?) metacharacter, +nor by a bracket expression ([]) containing a slash. +.TP +.B FNM_PERIOD +If this flag is set, a leading period in +.I string +has to be matched exactly by a period in +.IR pattern . +A period is considered to be leading if it is the first character in +.IR string , +or if both +.B FNM_PATHNAME +is set and the period immediately follows a slash. +.TP +.B FNM_FILE_NAME +This is a GNU synonym for \fBFNM_PATHNAME\fR. +.TP +.B FNM_LEADING_DIR +If this flag (a GNU extension) is set, the pattern is considered to be +matched if it matches an initial segment of +.I string +which is followed by a slash. +This flag is mainly for the internal +use of glibc and is only implemented in certain cases. +.TP +.B FNM_CASEFOLD +If this flag (a GNU extension) is set, the pattern is matched +case-insensitively. +.SH "RETURN VALUE" +Zero if +.I string +matches +.IR pattern , +.B FNM_NOMATCH +if there is no match or another nonzero value if there is an error. +.SH "CONFORMING TO" +POSIX.2. +The +.BR FNM_FILE_NAME ", " FNM_LEADING_DIR ", and " FNM_CASEFOLD +flags are GNU extensions. +.SH "SEE ALSO" +.BR sh (1), +.BR glob (3), +.BR scandir (3), +.BR wordexp (3), +.BR glob (7) diff --git a/original/man3/fopen.3 b/original/man3/fopen.3 new file mode 100644 index 00000000..60998b8f --- /dev/null +++ b/original/man3/fopen.3 @@ -0,0 +1,306 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fopen.3 6.8 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu +.\" Modified, aeb, 960421, 970806 +.\" Modified, joey, aeb, 2002-01-03 +.\" +.TH FOPEN 3 2009-02-23 "GNU" "Linux Programmer's Manual" +.SH NAME +fopen, fdopen, freopen \- stream open functions +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "FILE *fopen(const char *" path ", const char *" mode ); + +.BI "FILE *fdopen(int " fd ", const char *" mode ); + +.BI "FILE *freopen(const char *" path ", const char *" mode ", FILE *" stream ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR fdopen (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.SH DESCRIPTION +The +.BR fopen () +function opens the file whose name is the string pointed to by +.I path +and associates a stream with it. +.PP +The argument +.I mode +points to a string beginning with one of the following sequences +(Additional characters may follow these sequences.): +.TP +.B r +Open text file for reading. +The stream is positioned at the beginning of the file. +.TP +.B r+ +Open for reading and writing. +The stream is positioned at the beginning of the file. +.TP +.B w +Truncate file to zero length or create text file for writing. +The stream is positioned at the beginning of the file. +.TP +.B w+ +Open for reading and writing. +The file is created if it does not exist, otherwise it is truncated. +The stream is positioned at the beginning of +the file. +.TP +.B a +Open for appending (writing at end of file). +The file is created if it does not exist. +The stream is positioned at the end of the file. +.TP +.B a+ +Open for reading and appending (writing at end of file). +The file is created if it does not exist. +The initial file position for reading is at the beginning of the file, +but output is always appended to the end of the file. +.PP +The +.I mode +string can also include the letter \(aqb\(aq either as a last character or as +a character between the characters in any of the two-character strings +described above. +This is strictly for compatibility with C89 +and has no effect; the \(aqb\(aq is ignored on all POSIX +conforming systems, including Linux. +(Other systems may treat text files and binary files differently, +and adding the \(aqb\(aq may be a good idea if you do I/O to a binary +file and expect that your program may be ported to non-Unix +environments.) +.PP +See NOTES below for details of glibc extensions for +.IR mode . +.PP +Any created files will have mode +.BR S_IRUSR " | " S_IWUSR " | " S_IRGRP " | " S_IWGRP " | " S_IROTH " | " S_IWOTH +(0666), as modified by the process's umask value (see +.BR umask (2)). +.PP +Reads and writes may be intermixed on read/write streams in any order. +Note that ANSI C requires that a file positioning function intervene +between output and input, unless an input operation encounters end-of-file. +(If this condition is not met, then a read is allowed to return the +result of writes other than the most recent.) +Therefore it is good practice (and indeed sometimes necessary +under Linux) to put an +.BR fseek (3) +or +.BR fgetpos (3) +operation between write and read operations on such a stream. +This operation may be an apparent no-op +(as in \fIfseek(..., 0L, SEEK_CUR)\fP +called for its synchronizing side effect. +.PP +Opening a file in append mode (\fBa\fP as the first character of +.IR mode ) +causes all subsequent write operations to this stream to occur +at end-of-file, as if preceded by an +.nf + + fseek(stream,0,SEEK_END); +.fi +.PP +call. +.PP +The +.BR fdopen () +function associates a stream with the existing file descriptor, +.IR fd . +The +.I mode +of the stream (one of the values "r", "r+", "w", "w+", "a", "a+") +must be compatible with the mode of the file descriptor. +The file position indicator of the new stream is set to that +belonging to +.IR fd , +and the error and end-of-file indicators are cleared. +Modes "w" or "w+" do not cause truncation of the file. +The file descriptor is not dup'ed, and will be closed when +the stream created by +.BR fdopen () +is closed. +The result of applying +.BR fdopen () +to a shared memory object is undefined. +.PP +The +.BR freopen () +function opens the file whose name is the string pointed to by +.I path +and associates the stream pointed to by +.I stream +with it. +The original stream (if it exists) is closed. +The +.I mode +argument is used just as in the +.BR fopen () +function. +The primary use of the +.BR freopen () +function is to change the file associated with a standard text stream +.RI ( stderr ", " stdin ", or " stdout ). +.SH "RETURN VALUE" +Upon successful completion +.BR fopen (), +.BR fdopen () +and +.BR freopen () +return a +.I FILE +pointer. +Otherwise, NULL is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +The +.I mode +provided to +.BR fopen (), +.BR fdopen (), +or +.BR freopen () +was invalid. +.PP +The +.BR fopen (), +.BR fdopen () +and +.BR freopen () +functions may also fail and set +.I errno +for any of the errors specified for the routine +.BR malloc (3). +.PP +The +.BR fopen () +function may also fail and set +.I errno +for any of the errors specified for the routine +.BR open (2). +.PP +The +.BR fdopen () +function may also fail and set +.I errno +for any of the errors specified for the routine +.BR fcntl (2). +.PP +The +.BR freopen () +function may also fail and set +.I errno +for any of the errors specified for the routines +.BR open (2), +.BR fclose (3) +and +.BR fflush (3). +.SH "CONFORMING TO" +The +.BR fopen () +and +.BR freopen () +functions conform to C89. +The +.BR fdopen () +function conforms to POSIX.1-1990. +.SH NOTES +.SS Glibc Notes +The GNU C library allows the following extensions for the string specified in +.IR mode : +.TP +.BR c " (since glibc 2.3.3)" +Do not make the open operation, +or subsequent read and write operations, +thread cancellation points. +.TP +.BR e " (since glibc 2.7)" +Open the file with the +.B O_CLOEXEC +flag. +See +.BR open (2) +for more information. +.TP +.BR m " (since glibc 2.3)" +Attempt to access the file using +.BR mmap (2), +rather than I/O system calls +.RB ( read (2), +.BR write (2)). +Currently, +.\" As at glibc 2.4: +use of +.BR mmap (2) +is only attempted for a file opened for reading. +.TP +.B x +.\" Since glibc 2.0? +Open the file exclusively +(like the +.B O_EXCL +flag of +.BR open (2)). +If the file already exists, +.BR fopen () +fails, and sets +.I errno +to +.BR EEXIST . +This flag is ignored for +.BR fdopen (). +.\" FIXME document /,ccs= charset/ +.SH "SEE ALSO" +.BR open (2), +.BR fclose (3), +.BR fileno (3), +.BR fmemopen (3), +.BR fopencookie (3) diff --git a/original/man3/fopencookie.3 b/original/man3/fopencookie.3 new file mode 100644 index 00000000..80310443 --- /dev/null +++ b/original/man3/fopencookie.3 @@ -0,0 +1,439 @@ +.\" 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. +.\" +.TH FOPENCOOKIE 2 2008-12-05 "Linux" "Linux Programmer's Manual" +.SH NAME +fopencookie \- opening a custom stream +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "FILE *fopencookie(void *" cookie ", const char *" mode , +.BI " cookie_io_functions_t " io_funcs ); +.fi +.SH DESCRIPTION +The +.BR fopencookie () +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, +.BR fopencookie () +is used to implement +.BR fmemopen (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 +.IR "void\ *" +when passed to +.BR fopencookie ()), +but automatically supplies the cookie +as the first argument when calling the hook functions. +.IP * +Call +.BR fopencookie () +to open a new stream and associate the cookie and hook functions +with that stream. +.PP +The +.BR fopencookie () +function serves a purpose similar to +.BR fopen (3): +it opens a new stream and returns a pointer to a +.I FILE +object that is used to operate on that stream. + +The +.I cookie +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 +.I mode +argument serves the same purpose as for +.BR fopen (3). +The following modes are supported: +.IR r , +.IR w , +.IR a , +.IR r+ , +.IR w+ , +and +.IR a+ . +See +.BR fopen (3) +for details. + +The +.I io_funcs +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 +.I cookie_read_function_t *read +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 +.I buf +and +.I size +arguments are, respectively, +a buffer into which input data can be placed and the size of that buffer. +As its function result, the +.I read +function should return the number of bytes copied into +.IR buf , +0 on end of file, or \-1 on error. +The +.I read +function should update the stream offset appropriately. + +If +.I *read +is a NULL pointer, +then reads from the custom stream always return end of file. +.TP +.I cookie_write_function_t *write +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 +.I buf +and +.I size +arguments are, respectively, +a buffer of data to be output to the stream and the size of that buffer. +As its function result, the +.I write +function should return the number of bytes copied from +.IR buf , +or \-1 on error. +The +.I write +function should update the stream offset appropriately. + +If +.I *write +is a NULL pointer, +then output to the stream is discarded. +.TP +.I cookie_seek_function_t *seek +This function implements seek operations on the stream. +When called, it receives three arguments: + + int seek(void *cookie, off64_t *offset, int whence); + +The +.I *offset +argument specifies the new file offset depending on which +of the following three values is supplied in +.IR whence : +.RS +.TP 10 +.B SEEK_SET +The stream offset should be set +.I *offset +bytes from the start of the stream. +.TP +.B SEEK_CUR +.I *offset +should be added to the current stream offset. +.TP +.B SEEK_END +The stream offset should be set to the size of the stream plus +.IR *offset . +.RE +.IP +Before returning, the +.I seek +function should update +.I *offset +to indicate the new stream offset. + +As its function result, the +.I seek +function should return 0 on success, and \-1 on error. + +If +.I *seek +is a NULL pointer, +then it is not possible to perform seek operations on the stream. +.TP +.I cookie_close_function_t *close +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 +.I cookie +argument is the cookie that the programmer supplied when calling +.BR fopencookie (). + +As its function result, the +.I close +function should return 0 on success, and +.B EOF +on error. + +If +.I *close +is NULL, then no special action is performed when the stream is closed. +.SH RETURN VALUE +On success +.BR fopencookie () +returns a pointer to the new stream. +On error, NULL is returned. +.\" .SH ERRORS +.\" It's not clear if errno ever gets set... +.SH CONFORMING TO +This function is a nonstandard GNU extension. +.SH EXAMPLE +The program below implements a custom stream whose functionality +is similar (but not identical) to that available via +.BR fmemopen (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 + +.RB "$" " ./a.out \(aqhello world\(aq" +/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 Program source +\& +.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\\n"); + break; + } + + printf("/%.*s/\\n", nread, buf); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR fclose (3), +.BR fmemopen (3), +.BR fopen (3), +.BR fseek (3), +.BR feature_test_macros (7) diff --git a/original/man3/forkpty.3 b/original/man3/forkpty.3 new file mode 100644 index 00000000..fb4952d5 --- /dev/null +++ b/original/man3/forkpty.3 @@ -0,0 +1 @@ +.so man3/openpty.3 diff --git a/original/man3/fpathconf.3 b/original/man3/fpathconf.3 new file mode 100644 index 00000000..93aa7d48 --- /dev/null +++ b/original/man3/fpathconf.3 @@ -0,0 +1,167 @@ +.\" 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 Wed Jul 28 11:12:26 1993 by Rik Faith (faith@cs.unc.edu) +.TH FPATHCONF 3 1993-04-04 "GNU" "Linux Programmer's Manual" +.SH NAME +fpathconf, pathconf \- get configuration values for files +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "long fpathconf(int " fd ", int " name ); +.br +.BI "long pathconf(char *" path ", int " name ); +.fi +.SH DESCRIPTION +.BR fpathconf () +gets a value for the configuration option +.I name +for the open file descriptor +.IR fd . +.PP +.BR pathconf () +gets a value for configuration option +.I name +for the filename +.IR path . +.PP +The corresponding macros defined in +.I +are minimum values; if an application wants to take advantage of values +which may change, a call to +.BR fpathconf () +or +.BR pathconf () +can be made, which may yield more liberal results. +.PP +Setting +.I name +equal to one of the following constants returns the following +configuration options: +.TP +.B _PC_LINK_MAX +returns the maximum number of links to the file. +If +.I fd +or +.I path +refer to a directory, then the value applies to the whole directory. +The corresponding macro is +.BR _POSIX_LINK_MAX . +.TP +.B _PC_MAX_CANON +returns the maximum length of a formatted input line, where +.I fd +or +.I path +must refer to a terminal. +The corresponding macro is +.BR _POSIX_MAX_CANON . +.TP +.B _PC_MAX_INPUT +returns the maximum length of an input line, where +.I fd +or +.I path +must refer to a terminal. +The corresponding macro is +.BR _POSIX_MAX_INPUT . +.TP +.B _PC_NAME_MAX +returns the maximum length of a filename in the directory +.I path +or +.IR fd +that the process is allowed to create. +The corresponding macro is +.BR _POSIX_NAME_MAX . +.TP +.B _PC_PATH_MAX +returns the maximum length of a relative pathname when +.I path +or +.I fd +is the current working directory. +The corresponding macro is +.BR _POSIX_PATH_MAX . +.TP +.B _PC_PIPE_BUF +returns the size of the pipe buffer, where +.I fd +must refer to a pipe or FIFO and +.I path +must refer to a FIFO. +The corresponding macro is +.BR _POSIX_PIPE_BUF . +.TP +.B _PC_CHOWN_RESTRICTED +returns nonzero if the +.BR chown (2) +call may not be used on this file. +If +.I fd +or +.I path +refer to a directory, then this applies to all files in that +directory. +The corresponding macro is +.BR _POSIX_CHOWN_RESTRICTED . +.TP +.B _PC_NO_TRUNC +returns nonzero if accessing filenames longer than +.B _POSIX_NAME_MAX +generates an error. +The corresponding macro is +.BR _POSIX_NO_TRUNC . +.TP +.B _PC_VDISABLE +returns nonzero if special character processing can be disabled, where +.I fd +or +.I path +must refer to a terminal. +.SH "RETURN VALUE" +The limit is returned, if one exists. +If the system does not have a +limit for the requested resource, \-1 is returned, and +.I errno +is unchanged. +If there is an error, \-1 is returned, and +.I errno +is set to reflect the nature of the error. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +Files with name lengths longer than the value returned for +.I name +equal to +.B _PC_NAME_MAX +may exist in the given directory. +.PP +Some returned values may be huge; they are not suitable for allocating +memory. +.SH "SEE ALSO" +.BR getconf (1), +.BR open (2), +.BR statfs (2), +.BR sysconf (3) diff --git a/original/man3/fpclassify.3 b/original/man3/fpclassify.3 new file mode 100644 index 00000000..bee8991a --- /dev/null +++ b/original/man3/fpclassify.3 @@ -0,0 +1,119 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL, 2002-07-27 Walter Harms +.\" This was done with the help of the glibc manual. +.\" +.\" 2004-10-31, aeb, corrected +.TH FPCLASSIFY 3 2008-08-07 "" "Linux Programmer's Manual" +.SH NAME +fpclassify, isfinite, isnormal, isnan, isinf \- floating-point +classification macros +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int fpclassify(" x ); +.sp +.BI "int isfinite(" x ); +.sp +.BI "int isnormal(" x ); +.sp +.BI "int isnan(" x ); +.sp +.BI "int isinf(" x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (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 (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR isnan (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR isinf (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +Floating point numbers can have special values, such as +infinite or NaN. +With the macro +.BI fpclassify( x ) +you can find out what type +.I x +is. +The macro takes any floating-point expression as argument. +The result is one of the following values: +.TP 14 +.B FP_NAN +.I x +is "Not a Number". +.TP +.B FP_INFINITE +.I x +is either positive infinity or negative infinity. +.TP +.B FP_ZERO +.I x +is zero. +.TP +.B FP_SUBNORMAL +.I x +is too small to be represented in normalized format. +.TP +.B FP_NORMAL +if nothing of the above is correct then it must be a +normal floating-point number. +.LP +The other macros provide a short answer to some standard questions. +.TP 14 +.BI isfinite( x ) +returns a nonzero value if +.br +(fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE) +.TP +.BI isnormal( x ) +returns a nonzero value if +(fpclassify(x) == FP_NORMAL) +.TP +.BI isnan( x ) +returns a nonzero value if +(fpclassify(x) == FP_NAN) +.TP +.BI isinf( x ) +returns 1 if +.I x +is positive infinity, and \-1 if +.I x +is negative infinity. +.SH "CONFORMING TO" +C99, POSIX.1. + +For +.BR isinf (), +the standards merely say that the return value is nonzero +if and only if the argument has an infinite value. +.SH NOTES +In glibc 2.01 and earlier, +.BR isinf () +returns a nonzero value (actually: 1) if +.I x +is positive infinity or negative infinity. +(This is all that C99 requires.) +.SH "SEE ALSO" +.BR finite (3), +.BR INFINITY (3), +.BR isgreater (3), +.BR signbit (3) diff --git a/original/man3/fprintf.3 b/original/man3/fprintf.3 new file mode 100644 index 00000000..975530d9 --- /dev/null +++ b/original/man3/fprintf.3 @@ -0,0 +1 @@ +.so man3/printf.3 diff --git a/original/man3/fpurge.3 b/original/man3/fpurge.3 new file mode 100644 index 00000000..39a6fccf --- /dev/null +++ b/original/man3/fpurge.3 @@ -0,0 +1,82 @@ +.\" 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. +.\" +.TH FPURGE 3 2001-12-15 "" "Linux Programmer's Manual" +.SH NAME +fpurge, __fpurge \- purge a stream +.SH SYNOPSIS +.nf +/* unsupported */ +.B #include +.sp +.BI "int fpurge(FILE *" stream ); +.sp +/* supported */ +.B #include +.br +.B #include +.sp +.BI "void __fpurge(FILE *" stream ); +.fi +.SH DESCRIPTION +The function +.BR fpurge () +clears the buffers of the given stream. +For output streams this discards any unwritten output. +For input streams this discards any input read from the underlying object +but not yet obtained via +.BR getc (3); +this includes any text pushed back via +.BR ungetc (3). +See also +.BR fflush (3). +.LP +The function +.BR __fpurge () +does precisely the same, but without returning a value. +.SH "RETURN VALUE" +Upon successful completion +.BR fpurge () +returns 0. +On error, it returns \-1 and sets +.I errno +appropriately. +.SH ERRORS +.TP +.B EBADF +.I stream +is not an open stream. +.SH "CONFORMING TO" +These functions are nonstandard and not portable. +The function +.BR fpurge () +was introduced in 4.4BSD and is not available under Linux. +The function +.BR __fpurge () +was introduced in Solaris, and is present in glibc 2.1.95 and later. +.SH NOTES +Usually it is a mistake to want to discard input buffers. +.SH "SEE ALSO" +.\" .BR fclean (3), +.BR fflush (3), +.BR setbuf (3), +.BR stdio_ext (3) diff --git a/original/man3/fputc.3 b/original/man3/fputc.3 new file mode 100644 index 00000000..a7c3b57f --- /dev/null +++ b/original/man3/fputc.3 @@ -0,0 +1 @@ +.so man3/puts.3 diff --git a/original/man3/fputc_unlocked.3 b/original/man3/fputc_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/fputc_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/fputs.3 b/original/man3/fputs.3 new file mode 100644 index 00000000..a7c3b57f --- /dev/null +++ b/original/man3/fputs.3 @@ -0,0 +1 @@ +.so man3/puts.3 diff --git a/original/man3/fputs_unlocked.3 b/original/man3/fputs_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/fputs_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/fputwc.3 b/original/man3/fputwc.3 new file mode 100644 index 00000000..9823407c --- /dev/null +++ b/original/man3/fputwc.3 @@ -0,0 +1,83 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH FPUTWC 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +fputwc, putwc \- write a wide character to a FILE stream +.SH SYNOPSIS +.nf +.B #include +.br +.B #include +.sp +.BI "wint_t fputwc(wchar_t " wc ", FILE *" stream ); +.BI "wint_t putwc(wchar_t " wc ", FILE *" stream ); +.fi +.SH DESCRIPTION +The +.BR fputwc () +function is the wide-character +equivalent of the +.BR fputc (3) +function. +It writes the wide character \fIwc\fP to \fIstream\fP. +If +\fIferror(stream)\fP becomes true, it returns +.BR WEOF . +If a wide-character conversion error occurs, +it sets \fIerrno\fP to \fBEILSEQ\fP and returns +.BR WEOF . +Otherwise it returns \fIwc\fP. +.PP +The +.BR putwc () +function or macro functions identically to +.BR fputwc (). +It may be implemented as a macro, and may evaluate its argument +more than once. +There is no reason ever to use it. +.PP +For nonlocking counterparts, see +.BR unlocked_stdio (3). +.SH "RETURN VALUE" +The +.BR fputwc () +function returns \fIwc\fP if no error occurred, or +.B WEOF +to indicate an error. +.SH ERRORS +Apart from the usual ones, there is +.TP +.B EILSEQ +Conversion of \fIwc\fP to the stream's encoding fails. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH NOTES +The behavior of +.BR fputwc () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +In the absence of additional information passed to the +.BR fopen (3) +call, it is +reasonable to expect that +.BR fputwc () +will actually write the multibyte +sequence corresponding to the wide character \fIwc\fP. +.SH "SEE ALSO" +.BR fgetwc (3), +.BR fputws (3), +.BR unlocked_stdio (3) diff --git a/original/man3/fputwc_unlocked.3 b/original/man3/fputwc_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/fputwc_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/fputws.3 b/original/man3/fputws.3 new file mode 100644 index 00000000..eaca0c36 --- /dev/null +++ b/original/man3/fputws.3 @@ -0,0 +1,60 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH FPUTWS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +fputws \- write a wide-character string to a FILE stream +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int fputws(const wchar_t *" ws ", FILE *" stream ); +.fi +.SH DESCRIPTION +The +.BR fputws () +function is the wide-character equivalent of +the +.BR fputs (3) +function. +It writes the wide-character string starting at \fIws\fP, up to but +not including the terminating L\(aq\\0\(aq character, to \fIstream\fP. +.PP +For a nonlocking counterpart, see +.BR unlocked_stdio (3). +.SH "RETURN VALUE" +The +.BR fputws () +function returns a +nonnegative integer if the operation was +successful, or \-1 to indicate an error. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH NOTES +The behavior of +.BR fputws () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +In the absence of additional information passed to the +.BR fopen (3) +call, it is +reasonable to expect that +.BR fputws () +will actually write the multibyte +string corresponding to the wide-character string \fIws\fP. +.SH "SEE ALSO" +.BR fputwc (3), +.BR unlocked_stdio (3) diff --git a/original/man3/fputws_unlocked.3 b/original/man3/fputws_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/fputws_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/fread.3 b/original/man3/fread.3 new file mode 100644 index 00000000..581232e0 --- /dev/null +++ b/original/man3/fread.3 @@ -0,0 +1,103 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fread.3 6.6 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:37:33 1993, faith@cs.unc.edu +.\" Sun Feb 19 21:26:54 1995 by faith, return values +.\" Modified Thu Apr 20 20:43:53 1995 by Jim Van Zandt +.\" Modified Fri May 17 10:21:51 1996 by Martin Schulze +.\" +.TH FREAD 3 1996-05-17 "GNU" "Linux Programmer's Manual" +.SH NAME +fread, fwrite \- binary stream input/output +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t fread(void *" ptr ", size_t " size ", size_t " nmemb \ +", FILE *" stream ); +.sp +.BI "size_t fwrite(const void *" ptr ", size_t " size ", size_t " nmemb , +.BI " FILE *" stream ); +.fi +.SH DESCRIPTION +The function +.BR fread () +reads +.I nmemb +elements of data, each +.I size +bytes long, from the stream pointed to by +.IR stream , +storing them at the location given by +.IR ptr . +.PP +The function +.BR fwrite () +writes +.I nmemb +elements of data, each +.I size +bytes long, to the stream pointed to by +.IR stream , +obtaining them from the location given by +.IR ptr . +.PP +For nonlocking counterparts, see +.BR unlocked_stdio (3). +.SH "RETURN VALUE" +.BR fread () +and +.BR fwrite () +return the number of items successfully read or written (i.e., not the +number of characters). +If an error occurs, or the end-of-file is +reached, the return value is a short item count (or zero). +.PP +.BR fread () +does not distinguish between end-of-file and error, and callers must use +.BR feof (3) +and +.BR ferror (3) +to determine which occurred. +.SH "CONFORMING TO" +C89, POSIX.1-2001. +.SH "SEE ALSO" +.BR read (2), +.BR write (2), +.BR feof (3), +.BR ferror (3), +.BR unlocked_stdio (3) diff --git a/original/man3/fread_unlocked.3 b/original/man3/fread_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/fread_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/free.3 b/original/man3/free.3 new file mode 100644 index 00000000..a4b9d445 --- /dev/null +++ b/original/man3/free.3 @@ -0,0 +1 @@ +.so man3/malloc.3 diff --git a/original/man3/freeaddrinfo.3 b/original/man3/freeaddrinfo.3 new file mode 100644 index 00000000..17f7236a --- /dev/null +++ b/original/man3/freeaddrinfo.3 @@ -0,0 +1 @@ +.so man3/getaddrinfo.3 diff --git a/original/man3/freehostent.3 b/original/man3/freehostent.3 new file mode 100644 index 00000000..82e01df4 --- /dev/null +++ b/original/man3/freehostent.3 @@ -0,0 +1 @@ +.so man3/getipnodebyname.3 diff --git a/original/man3/freeifaddrs.3 b/original/man3/freeifaddrs.3 new file mode 100644 index 00000000..38f977da --- /dev/null +++ b/original/man3/freeifaddrs.3 @@ -0,0 +1 @@ +.so man3/getifaddrs.3 diff --git a/original/man3/freopen.3 b/original/man3/freopen.3 new file mode 100644 index 00000000..9a401249 --- /dev/null +++ b/original/man3/freopen.3 @@ -0,0 +1 @@ +.so man3/fopen.3 diff --git a/original/man3/frexp.3 b/original/man3/frexp.3 new file mode 100644 index 00000000..e5fc4f9e --- /dev/null +++ b/original/man3/frexp.3 @@ -0,0 +1,132 @@ +.\" 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-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-07-27 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH FREXP 3 2008-10-29 "" "Linux Programmer's Manual" +.SH NAME +frexp, frexpf, frexpl \- convert floating-point number to fractional +and integral components +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double frexp(double " x ", int *" exp ); +.br +.BI "float frexpf(float " x ", int *" exp ); +.br +.BI "long double frexpl(long double " x ", int *" exp ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR frexpf (), +.BR frexpl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR frexp () +function is used to split the number \fIx\fP into a +normalized fraction and an exponent which is stored in \fIexp\fP. +.SH "RETURN VALUE" +The +.BR frexp () +function returns the normalized fraction. +If the argument \fIx\fP is not zero, +the normalized fraction is \fIx\fP times a power of two, +and its absolute value is always in the range 1/2 (inclusive) to +1 (exclusive), that is, [0.5,1). + +If \fIx\fP is zero, then the normalized fraction is +zero and zero is stored in \fIexp\fP. + +If +.I x +is a NaN, +a NaN is returned, and the value of +.I *exp +is unspecified. + +If +.I x +is positive infinity (negative infinity), +positive infinity (negative infinity) is returned, and the value of +.I *exp +is unspecified. +.SH ERRORS +No errors occur. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH EXAMPLE +The program below produces results such as the following: +.sp +.nf +.in +4n +.RB "$" " ./a.out 2560" +frexp(2560, &e) = 0.625: 0.625 * 2^12 = 2560 +.RB "$" " ./a.out \-4" +frexp(\-4, &e) = \-0.5: \-0.5 * 2^3 = -4 +.in +.fi +.SS Program source +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + double x, r; + int exp; + + x = strtod(argv[1], NULL); + r = frexp(x, &exp); + + printf("frexp(%g, &e) = %g: %g * %d^%d = %g\\n", + x, r, r, FLT_RADIX, exp, x); + exit(EXIT_SUCCESS); +} /* main */ +.fi +.SH "SEE ALSO" +.BR ldexp (3), +.BR modf (3) diff --git a/original/man3/frexpf.3 b/original/man3/frexpf.3 new file mode 100644 index 00000000..980426f3 --- /dev/null +++ b/original/man3/frexpf.3 @@ -0,0 +1 @@ +.so man3/frexp.3 diff --git a/original/man3/frexpl.3 b/original/man3/frexpl.3 new file mode 100644 index 00000000..980426f3 --- /dev/null +++ b/original/man3/frexpl.3 @@ -0,0 +1 @@ +.so man3/frexp.3 diff --git a/original/man3/fscanf.3 b/original/man3/fscanf.3 new file mode 100644 index 00000000..9fd424bb --- /dev/null +++ b/original/man3/fscanf.3 @@ -0,0 +1 @@ +.so man3/scanf.3 diff --git a/original/man3/fseek.3 b/original/man3/fseek.3 new file mode 100644 index 00000000..31850796 --- /dev/null +++ b/original/man3/fseek.3 @@ -0,0 +1,168 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fseek.3 6.11 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu +.\" +.TH FSEEK 3 1993-11-29 "GNU" "Linux Programmer's Manual" +.SH NAME +fgetpos, fseek, fsetpos, ftell, rewind \- reposition a stream +.SH SYNOPSIS +.B #include +.sp +.BI "int fseek(FILE *" stream ", long " offset ", int " whence ); + +.BI "long ftell(FILE *" stream ); + +.BI "void rewind(FILE *" stream ); + +.BI "int fgetpos(FILE *" stream ", fpos_t *" pos ); +.br +.BI "int fsetpos(FILE *" stream ", fpos_t *" pos ); +.SH DESCRIPTION +The +.BR fseek () +function sets the file position indicator for the stream pointed to by +.IR stream . +The new position, measured in bytes, is obtained by adding +.I offset +bytes to the position specified by +.IR whence . +If +.I whence +is set to +.BR SEEK_SET , +.BR SEEK_CUR , +or +.BR SEEK_END , +the offset is relative to the start of the file, the current position +indicator, or end-of-file, respectively. +A successful call to the +.BR fseek () +function clears the end-of-file indicator for the stream and undoes +any effects of the +.BR ungetc (3) +function on the same stream. +.PP +The +.BR ftell () +function obtains the current value of the file position indicator for the +stream pointed to by +.IR stream . +.PP +The +.BR rewind () +function sets the file position indicator for the stream pointed to by +.I stream +to the beginning of the file. +It is equivalent to: +.PP +.RS +(void) fseek(stream, 0L, SEEK_SET) +.RE +.PP +except that the error indicator for the stream is also cleared (see +.BR clearerr (3)). +.PP +The +.BR fgetpos () +and +.BR fsetpos () +functions are alternate interfaces equivalent to +.BR ftell () +and +.BR fseek () +(with whence set to +.BR SEEK_SET ), +setting and storing the current value of the file offset into or from the +object referenced by +.IR pos . +On some non-Unix systems an +.I fpos_t +object may be a complex object and these routines may be the only way to +portably reposition a text stream. +.SH "RETURN VALUE" +The +.BR rewind () +function returns no value. +Upon successful completion, +.BR fgetpos (), +.BR fseek (), +.BR fsetpos () +return 0, +and +.BR ftell () +returns the current offset. +Otherwise, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EBADF +The +.I stream +specified is not a seekable stream. +.TP +.B EINVAL +The +.I whence +argument to +.BR fseek () +was not +.BR SEEK_SET , +.BR SEEK_END , +or +.BR SEEK_CUR . +.PP +The functions +.BR fgetpos (), +.BR fseek (), +.BR fsetpos (), +and +.BR ftell () +may also fail and set +.I errno +for any of the errors specified for the routines +.BR fflush (3), +.BR fstat (2), +.BR lseek (2), +and +.BR malloc (3). +.SH "CONFORMING TO" +C89, C99. +.SH "SEE ALSO" +.BR lseek (2), +.BR fseeko (3) diff --git a/original/man3/fseeko.3 b/original/man3/fseeko.3 new file mode 100644 index 00000000..41ed2fce --- /dev/null +++ b/original/man3/fseeko.3 @@ -0,0 +1,82 @@ +.\" Copyright 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. +.\" +.TH FSEEKO 3 2001-11-05 "" "Linux Programmer's Manual" +.SH NAME +fseeko, ftello \- seek to or report file position +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int fseeko(FILE *" stream ", off_t " offset ", int " whence ); +.sp +.BI "off_t ftello(FILE *" stream ); +.BI +.fi +.SH DESCRIPTION +The +.BR fseeko () +and +.BR ftello () +functions are identical to +.BR fseek (3) +and +.BR ftell (3) +(see +.BR fseek (3)), +respectively, except that the \fIoffset\fP argument of +.BR fseeko () +and the return value of +.BR ftello () +is of type \fIoff_t\fP +instead of \fIlong\fP. +.LP +On many architectures both \fIoff_t\fP and \fIlong\fP are 32-bit types, +but compilation with +.RS +.nf + +#define _FILE_OFFSET_BITS 64 +.fi +.RE +.PP +will turn \fIoff_t\fP into a 64-bit type. +.SH RETURN VALUE +On successful completion, +.BR fseeko () +returns 0, while +.BR ftello () +returns the current offset. +Otherwise, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +See the ERRORS in +.BR fseek (3). +.SH "CONFORMING TO" +SUSv2, POSIX.1-2001. +.SH NOTES +These functions are found on System V-like systems. +They are not present in libc4, libc5, glibc 2.0 +but are available since glibc 2.1. +.SH "SEE ALSO" +.BR fseek (3) diff --git a/original/man3/fsetpos.3 b/original/man3/fsetpos.3 new file mode 100644 index 00000000..a1487b5a --- /dev/null +++ b/original/man3/fsetpos.3 @@ -0,0 +1 @@ +.so man3/fseek.3 diff --git a/original/man3/ftell.3 b/original/man3/ftell.3 new file mode 100644 index 00000000..a1487b5a --- /dev/null +++ b/original/man3/ftell.3 @@ -0,0 +1 @@ +.so man3/fseek.3 diff --git a/original/man3/ftello.3 b/original/man3/ftello.3 new file mode 100644 index 00000000..d5628f46 --- /dev/null +++ b/original/man3/ftello.3 @@ -0,0 +1 @@ +.so man3/fseeko.3 diff --git a/original/man3/ftime.3 b/original/man3/ftime.3 new file mode 100644 index 00000000..a6ad1af6 --- /dev/null +++ b/original/man3/ftime.3 @@ -0,0 +1,97 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de) +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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 +.\" +.TH FTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual" +.SH NAME +ftime \- return date and time +.SH SYNOPSIS +.B "#include " +.sp +.BI "int ftime(struct timeb *" tp ); +.SH DESCRIPTION +This function returns the current time as seconds and milliseconds +since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). +The time is returned in +.IR tp , +which is declared as follows: +.sp +.in +4n +.nf +struct timeb { + time_t time; + unsigned short millitm; + short timezone; + short dstflag; +}; +.fi +.in +.LP +Here \fItime\fP is the number of seconds since the Epoch, +and \fImillitm\fP is the number of milliseconds since \fItime\fP +seconds since the Epoch. +The \fItimezone\fP field is the local timezone measured in minutes +of time west of Greenwich (with a negative value indicating minutes +east of Greenwich). +The \fIdstflag\fP field +is a flag that, if nonzero, indicates that Daylight Saving time +applies locally during the appropriate part of the year. +.LP +POSIX.1-2001 says that the contents of the \fItimezone\fP and \fIdstflag\fP +fields are unspecified; avoid relying on them. +.SH "RETURN VALUE" +This function always returns 0. +(POSIX.1-2001 specifies, and some systems document, a \-1 error return.) +.SH "CONFORMING TO" +4.2BSD, POSIX.1-2001. +POSIX.1-2008 removes the specification of +.BR ftime (). + +This function is obsolete. +Don't use it. +If the time in seconds +suffices, +.BR time (2) +can be used; +.BR gettimeofday (2) +gives microseconds; +.BR clock_gettime (2) +gives nanoseconds but is not as widely available. +.SH BUGS +.LP +Under libc4 and libc5 the \fImillitm\fP field is meaningful. +But early glibc2 is buggy and returns 0 there; +glibc 2.1.1 is correct again. +.\" .SH HISTORY +.\" The +.\" .BR ftime () +.\" function appeared in 4.2BSD. +.SH "SEE ALSO" +.BR gettimeofday (2), +.BR time (2) diff --git a/original/man3/ftok.3 b/original/man3/ftok.3 new file mode 100644 index 00000000..b8b43f3a --- /dev/null +++ b/original/man3/ftok.3 @@ -0,0 +1,104 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 2001-11-28, by Michael Kerrisk, +.\" Changed data type of proj_id; minor fixes +.\" aeb: further fixes; added notes. +.\" +.TH FTOK 3 2001-11-28 "GNU" "Linux Programmer's Manual" +.SH NAME +ftok \- convert a pathname and a project identifier to a System V IPC key +.SH SYNOPSIS +.nf +.B #include +.B #include +.fi +.sp +.BI "key_t ftok(const char *" pathname ", int " proj_id ); +.SH DESCRIPTION +The +.BR ftok () +function uses the identity of the file named by the given +.I pathname +(which must refer to an existing, accessible file) +and the least significant 8 bits of +.I proj_id +(which must be nonzero) to generate a +.I key_t +type System V IPC key, suitable for use with +.BR msgget (2), +.BR semget (2), +or +.BR shmget (2). +.LP +The resulting value is the same for all pathnames that +name the same file, when the same value of +.I proj_id +is used. +The value returned should be different when the +(simultaneously existing) files or the project IDs differ. +.SH "RETURN VALUE" +On success the generated +.I key_t +value is returned. +On failure \-1 is returned, with +.I errno +indicating the error as for the +.BR stat (2) +system call. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +Under libc4 and libc5 (and under SunOS 4.x) the prototype was: +.sp +.RS +.BI "key_t ftok(char *" pathname ", char " proj_id ); +.RE +.PP +Today +.I proj_id +is an +.IR int , +but still only 8 bits are used. +Typical usage has an ASCII character +.IR proj_id , +that is why the behavior is said to be undefined when +.I proj_id +is zero. +.LP +Of course no guarantee can be given that the resulting +.I key_t +is unique. +Typically, a best effort attempt combines the given +.I proj_id +byte, the lower 16 bits of the inode number, and the +lower 8 bits of the device number into a 32-bit result. +Collisions may easily happen, for example between files on +.I /dev/hda1 +and files on +.IR /dev/sda1 . +.SH "SEE ALSO" +.BR msgget (2), +.BR semget (2), +.BR shmget (2), +.BR stat (2), +.BR svipc (7) diff --git a/original/man3/ftrylockfile.3 b/original/man3/ftrylockfile.3 new file mode 100644 index 00000000..b33c2ee6 --- /dev/null +++ b/original/man3/ftrylockfile.3 @@ -0,0 +1 @@ +.so man3/flockfile.3 diff --git a/original/man3/fts.3 b/original/man3/fts.3 new file mode 100644 index 00000000..cb00216c --- /dev/null +++ b/original/man3/fts.3 @@ -0,0 +1,787 @@ +.\" $NetBSD: fts.3,v 1.13.2.1 1997/11/14 02:09:32 mrg Exp $ +.\" +.\" Copyright (c) 1989, 1991, 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. +.\" 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. +.\" +.\" @(#)fts.3 8.5 (Berkeley) 4/16/94 +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.TH FTS 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH NAME +fts, fts_open, fts_read, fts_children, fts_set, fts_close \- \ +traverse a file hierarchy +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.sp +.BI "FTS *fts_open(char * const *" path_argv ", int " options ", " +.BI " int (*" compar ")(const FTSENT **, const FTSENT **));" +.sp +.BI "FTSENT *fts_read(FTS *" ftsp ); +.sp +.BI "FTSENT *fts_children(FTS *" ftsp ", int " options ); +.sp +.BI "int fts_set(FTS *" ftsp ", FTSENT *" f ", int " options ); +.sp +.BI "int fts_close(FTS *" ftsp ); +.fi +.SH DESCRIPTION +The +fts functions are provided for traversing +file hierarchies. +A simple overview is that the +.BR fts_open () +function returns a "handle" on a file hierarchy, which is then supplied to +the other +fts functions. +The function +.BR fts_read () +returns a pointer to a structure describing one of the files in the file +hierarchy. +The function +.BR fts_children () +returns a pointer to a linked list of structures, each of which describes +one of the files contained in a directory in the hierarchy. +In general, directories are visited two distinguishable times; in preorder +(before any of their descendants are visited) and in postorder (after all +of their descendants have been visited). +Files are visited once. +It is possible to walk the hierarchy "logically" (ignoring symbolic links) +or physically (visiting symbolic links), order the walk of the hierarchy or +prune and/or revisit portions of the hierarchy. +.PP +Two structures are defined (and typedef'd) in the include file +.IR . +The first is +.IR FTS , +the structure that represents the file hierarchy itself. +The second is +.IR FTSENT , +the structure that represents a file in the file +hierarchy. +Normally, an +.I FTSENT +structure is returned for every file in the file +hierarchy. +In this manual page, "file" and +"FTSENT structure" +are generally interchangeable. +The +.I FTSENT +structure contains at least the following fields, which are +described in greater detail below: +.in +4n +.nf + +typedef struct _ftsent { + unsigned short fts_info; /* flags for FTSENT structure */ + char *fts_accpath; /* access path */ + char *fts_path; /* root path */ + short fts_pathlen; /* strlen(fts_path) */ + char *fts_name; /* filename */ + short fts_namelen; /* strlen(fts_name) */ + short fts_level; /* depth (\-1 to N) */ + int fts_errno; /* file errno */ + long fts_number; /* local numeric value */ + void *fts_pointer; /* local address value */ + struct ftsent *fts_parent; /* parent directory */ + struct ftsent *fts_link; /* next file structure */ + struct ftsent *fts_cycle; /* cycle structure */ + struct stat *fts_statp; /* stat(2) information */ +} FTSENT; +.fi +.in +.PP +These fields are defined as follows: +.\" .Bl -tag -width "fts_namelen" +.TP 12 +.IR fts_info +One of the following flags describing the returned +.I FTSENT +structure and +the file it represents. +With the exception of directories without errors +.RB ( FTS_D ), +all of these +entries are terminal, that is, they will not be revisited, nor will any +of their descendants be visited. +.\" .Bl -tag -width FTS_DEFAULT +.RS 12 +.TP 12 +.BR FTS_D +A directory being visited in preorder. +.TP +.BR FTS_DC +A directory that causes a cycle in the tree. +(The +.I fts_cycle +field of the +.I FTSENT +structure will be filled in as well.) +.TP +.BR FTS_DEFAULT +Any +.I FTSENT +structure that represents a file type not explicitly described +by one of the other +.I fts_info +values. +.TP +.BR FTS_DNR +A directory which cannot be read. +This is an error return, and the +.I fts_errno +field will be set to indicate what caused the error. +.TP +.BR FTS_DOT +A file named +"." +or +".." +which was not specified as a filename to +.BR fts_open () +(see +.BR FTS_SEEDOT ). +.TP +.BR FTS_DP +A directory being visited in postorder. +The contents of the +.I FTSENT +structure will be unchanged from when +it was returned in preorder, that is, with the +.I fts_info +field set to +.BR FTS_D . +.TP +.BR FTS_ERR +This is an error return, and the +.I fts_errno +field will be set to indicate what caused the error. +.TP +.BR FTS_F +A regular file. +.TP +.BR FTS_NS +A file for which no +.BR stat (2) +information was available. +The contents of the +.I fts_statp +field are undefined. +This is an error return, and the +.I fts_errno +field will be set to indicate what caused the error. +.TP +.BR FTS_NSOK +A file for which no +.BR stat (2) +information was requested. +The contents of the +.I fts_statp +field are undefined. +.TP +.BR FTS_SL +A symbolic link. +.TP +.BR FTS_SLNONE +A symbolic link with a nonexistent target. +The contents of the +.I fts_statp +field reference the file characteristic information for the symbolic link +itself. +.\" .El +.RE +.TP +.IR fts_accpath +A path for accessing the file from the current directory. +.TP +.IR fts_path +The path for the file relative to the root of the traversal. +This path contains the path specified to +.BR fts_open () +as a prefix. +.TP +.IR fts_pathlen +The length of the string referenced by +.IR fts_path . +.TP +.IR fts_name +The name of the file. +.TP +.IR fts_namelen +The length of the string referenced by +.IR fts_name . +.TP +.IR fts_level +The depth of the traversal, numbered from \-1 to N, where this file +was found. +The +.I FTSENT +structure representing the parent of the starting point (or root) +of the traversal is numbered \-1, and the +.I FTSENT +structure for the root +itself is numbered 0. +.TP +.IR fts_errno +Upon return of a +.I FTSENT +structure from the +.BR fts_children () +or +.BR fts_read () +functions, with its +.I fts_info +field set to +.BR FTS_DNR , +.BR FTS_ERR +or +.BR FTS_NS , +the +.I fts_errno +field contains the value of the external variable +.I errno +specifying the cause of the error. +Otherwise, the contents of the +.I fts_errno +field are undefined. +.TP +.IR fts_number +This field is provided for the use of the application program and is +not modified by the +fts functions. +It is initialized to 0. +.TP +.IR fts_pointer +This field is provided for the use of the application program and is +not modified by the +fts functions. +It is initialized to +NULL. +.TP +.IR fts_parent +A pointer to the +.I FTSENT +structure referencing the file in the hierarchy +immediately above the current file, that is, the directory of which this +file is a member. +A parent structure for the initial entry point is provided as well, +however, only the +.IR fts_level , +.I fts_number +and +.I fts_pointer +fields are guaranteed to be initialized. +.TP +.IR fts_link +Upon return from the +.BR fts_children () +function, the +.I fts_link +field points to the next structure in the NULL-terminated linked list of +directory members. +Otherwise, the contents of the +.I fts_link +field are undefined. +.TP +.IR fts_cycle +If a directory causes a cycle in the hierarchy (see +.BR FTS_DC ), +either because +of a hard link between two directories, or a symbolic link pointing to a +directory, the +.I fts_cycle +field of the structure will point to the +.I FTSENT +structure in the hierarchy that references the same file as the current +.I FTSENT +structure. +Otherwise, the contents of the +.I fts_cycle +field are undefined. +.TP +.IR fts_statp +A pointer to +.BR stat (2) +information for the file. +.\" .El +.PP +A single buffer is used for all of the paths of all of the files in the +file hierarchy. +Therefore, the +.I fts_path +and +.I fts_accpath +fields are guaranteed to be +null-terminated +.I only +for the file most recently returned by +.BR fts_read (). +To use these fields to reference any files represented by other +.I FTSENT +structures will require that the path buffer be modified using the +information contained in that +.I FTSENT +structure's +.I fts_pathlen +field. +Any such modifications should be undone before further calls to +.BR fts_read () +are attempted. +The +.I fts_name +field is always +null-terminated. +.SS fts_open() +The +.BR fts_open () +function takes a pointer to an array of character pointers naming one +or more paths which make up a logical file hierarchy to be traversed. +The array must be terminated by a +NULL +pointer. +.PP +There are +a number of options, at least one of which (either +.BR FTS_LOGICAL +or +.BR FTS_PHYSICAL ) +must be specified. +The options are selected by +.IR or ing +the following values: +.\" .Bl -tag -width "FTS_PHYSICAL" +.TP 13 +.BR FTS_COMFOLLOW +This option causes any symbolic link specified as a root path to be +followed immediately whether or not +.BR FTS_LOGICAL +is also specified. +.TP +.BR FTS_LOGICAL +This option causes the +fts routines to return +.I FTSENT +structures for the targets of symbolic links +instead of the symbolic links themselves. +If this option is set, the only symbolic links for which +.I FTSENT +structures +are returned to the application are those referencing nonexistent files. +Either +.BR FTS_LOGICAL +or +.BR FTS_PHYSICAL +.I must +be provided to the +.BR fts_open () +function. +.TP +.BR FTS_NOCHDIR +As a performance optimization, the +fts functions change directories as they walk the file hierarchy. +This has the side-effect that an application cannot rely on being +in any particular directory during the traversal. +The +.BR FTS_NOCHDIR +option turns off this optimization, and the +fts functions will not change the current directory. +Note that applications should not themselves change their current directory +and try to access files unless +.BR FTS_NOCHDIR +is specified and absolute +pathnames were provided as arguments to +.BR fts_open (). +.TP +.BR FTS_NOSTAT +By default, returned +.I FTSENT +structures reference file characteristic information (the +.I statp +field) for each file visited. +This option relaxes that requirement as a performance optimization, +allowing the +fts functions to set the +.I fts_info +field to +.BR FTS_NSOK +and leave the contents of the +.I statp +field undefined. +.TP +.BR FTS_PHYSICAL +This option causes the +fts routines to return +.I FTSENT +structures for symbolic links themselves instead +of the target files they point to. +If this option is set, +.I FTSENT +structures for all symbolic links in the +hierarchy are returned to the application. +Either +.BR FTS_LOGICAL +or +.BR FTS_PHYSICAL +.I must +be provided to the +.BR fts_open () +function. +.TP +.BR FTS_SEEDOT +By default, unless they are specified as path arguments to +.BR fts_open (), +any files named +"." +or +".." +encountered in the file hierarchy are ignored. +This option causes the +fts routines to return +.I FTSENT +structures for them. +.TP +.BR FTS_XDEV +This option prevents +fts from descending into directories that have a different device number +than the file from which the descent began. +.\" .El +.PP +The argument +.BR compar () +specifies a user-defined function which may be used to order the traversal +of the hierarchy. +It +takes two pointers to pointers to +.I FTSENT +structures as arguments and +should return a negative value, zero, or a positive value to indicate +if the file referenced by its first argument comes before, in any order +with respect to, or after, the file referenced by its second argument. +The +.IR fts_accpath , +.I fts_path +and +.I fts_pathlen +fields of the +.I FTSENT +structures may +.I never +be used in this comparison. +If the +.I fts_info +field is set to +.BR FTS_NS +or +.BR FTS_NSOK , +the +.I fts_statp +field may not either. +If the +.BR compar () +argument is +NULL, +the directory traversal order is in the order listed in +.I path_argv +for the root paths, and in the order listed in the directory for +everything else. +.SS fts_read() +The +.BR fts_read () +function returns a pointer to an +.I FTSENT +structure describing a file in +the hierarchy. +Directories (that are readable and do not cause cycles) are visited at +least twice, once in preorder and once in postorder. +All other files are visited at least once. +(Hard links between directories that do not cause cycles or symbolic +links to symbolic links may cause files to be visited more than once, +or directories more than twice.) +.PP +If all the members of the hierarchy have been returned, +.BR fts_read () +returns +NULL +and sets the external variable +.I errno +to 0. +If an error unrelated to a file in the hierarchy occurs, +.BR fts_read () +returns +NULL +and sets +.I errno +appropriately. +If an error related to a returned file occurs, a pointer to an +.I FTSENT +structure is returned, and +.I errno +may or may not have been set (see +.IR fts_info ). +.PP +The +.I FTSENT +structures returned by +.BR fts_read () +may be overwritten after a call to +.BR fts_close () +on the same file hierarchy stream, or, after a call to +.BR fts_read () +on the same file hierarchy stream unless they represent a file of type +directory, in which case they will not be overwritten until after a call to +.BR fts_read () +after the +.I FTSENT +structure has been returned by the function +.BR fts_read () +in postorder. +.SS fts_children() +The +.BR fts_children () +function returns a pointer to an +.I FTSENT +structure describing the first entry in a NULL-terminated linked list of +the files in the directory represented by the +.I FTSENT +structure most recently returned by +.BR fts_read (). +The list is linked through the +.I fts_link +field of the +.I FTSENT +structure, and is ordered by the user-specified comparison function, if any. +Repeated calls to +.BR fts_children () +will recreate this linked list. +.PP +As a special case, if +.BR fts_read () +has not yet been called for a hierarchy, +.BR fts_children () +will return a pointer to the files in the logical directory specified to +.BR fts_open (), +that is, the arguments specified to +.BR fts_open (). +Otherwise, if the +.I FTSENT +structure most recently returned by +.BR fts_read () +is not a directory being visited in preorder, +or the directory does not contain any files, +.BR fts_children () +returns +NULL +and sets +.I errno +to zero. +If an error occurs, +.BR fts_children () +returns +NULL +and sets +.I errno +appropriately. +.PP +The +.I FTSENT +structures returned by +.BR fts_children () +may be overwritten after a call to +.BR fts_children (), +.BR fts_close () +or +.BR fts_read () +on the same file hierarchy stream. +.PP +.I Option +may be set to the following value: +.\" .Bl -tag -width FTS_NAMEONLY +.TP 13 +.BR FTS_NAMEONLY +Only the names of the files are needed. +The contents of all the fields in the returned linked list of structures +are undefined with the exception of the +.I fts_name +and +.I fts_namelen +fields. +.\" .El +.SS fts_set() +The function +.BR fts_set () +allows the user application to determine further processing for the +file +.I f +of the stream +.IR ftsp . +The +.BR fts_set () +function +returns 0 on success, and \-1 if an error occurs. +.I Option +must be set to one of the following values: +.\" .Bl -tag -width FTS_PHYSICAL +.TP 13 +.BR FTS_AGAIN +Re-visit the file; any file type may be revisited. +The next call to +.BR fts_read () +will return the referenced file. +The +.I fts_stat +and +.I fts_info +fields of the structure will be reinitialized at that time, +but no other fields will have been changed. +This option is meaningful only for the most recently returned +file from +.BR fts_read (). +Normal use is for postorder directory visits, where it causes the +directory to be revisited (in both preorder and postorder) as well as all +of its descendants. +.TP +.BR FTS_FOLLOW +The referenced file must be a symbolic link. +If the referenced file is the one most recently returned by +.BR fts_read (), +the next call to +.BR fts_read () +returns the file with the +.I fts_info +and +.I fts_statp +fields reinitialized to reflect the target of the symbolic link instead +of the symbolic link itself. +If the file is one of those most recently returned by +.BR fts_children (), +the +.I fts_info +and +.I fts_statp +fields of the structure, when returned by +.BR fts_read (), +will reflect the target of the symbolic link instead of the symbolic link +itself. +In either case, if the target of the symbolic link does not exist the +fields of the returned structure will be unchanged and the +.I fts_info +field will be set to +.BR FTS_SLNONE . +.IP +If the target of the link is a directory, the preorder return, followed +by the return of all of its descendants, followed by a postorder return, +is done. +.TP +.BR FTS_SKIP +No descendants of this file are visited. +The file may be one of those most recently returned by either +.BR fts_children () +or +.BR fts_read (). +.\" .El +.SS fts_close() +The +.BR fts_close () +function closes a file hierarchy stream +.I ftsp +and restores the current directory to the directory from which +.BR fts_open () +was called to open +.IR ftsp . +The +.BR fts_close () +function +returns 0 on success, and \-1 if an error occurs. +.SH ERRORS +The function +.BR fts_open () +may fail and set +.I errno +for any of the errors specified for +.BR open (2) +and +.BR malloc (3). +.PP +The function +.BR fts_close () +may fail and set +.I errno +for any of the errors specified for +.BR chdir (2) +and +.BR close (2). +.PP +The functions +.BR fts_read () +and +.BR fts_children () +may fail and set +.I errno +for any of the errors specified for +.BR chdir (2), +.BR malloc (3), +.BR opendir (3), +.BR readdir (3) +and +.BR stat (2). +.PP +In addition, +.BR fts_children (), +.BR fts_open () +and +.BR fts_set () +may fail and set +.I errno +as follows: +.TP +.B EINVAL +The options were invalid. +.SH VERSIONS +These functions are available in Linux since glibc2. +.SH "CONFORMING TO" +4.4BSD. +.\" The following statement is years old, and seems no closer to +.\" being true -- mtk +.\" The +.\" .I fts +.\" utility is expected to be included in a future +.\" POSIX.1 +.\" revision. +.SH SEE ALSO +.BR find (1), +.BR chdir (2), +.BR stat (2), +.BR ftw (3), +.BR qsort (3) diff --git a/original/man3/fts_children.3 b/original/man3/fts_children.3 new file mode 100644 index 00000000..85caf752 --- /dev/null +++ b/original/man3/fts_children.3 @@ -0,0 +1 @@ +.so man3/fts.3 diff --git a/original/man3/fts_close.3 b/original/man3/fts_close.3 new file mode 100644 index 00000000..85caf752 --- /dev/null +++ b/original/man3/fts_close.3 @@ -0,0 +1 @@ +.so man3/fts.3 diff --git a/original/man3/fts_open.3 b/original/man3/fts_open.3 new file mode 100644 index 00000000..85caf752 --- /dev/null +++ b/original/man3/fts_open.3 @@ -0,0 +1 @@ +.so man3/fts.3 diff --git a/original/man3/fts_read.3 b/original/man3/fts_read.3 new file mode 100644 index 00000000..85caf752 --- /dev/null +++ b/original/man3/fts_read.3 @@ -0,0 +1 @@ +.so man3/fts.3 diff --git a/original/man3/fts_set.3 b/original/man3/fts_set.3 new file mode 100644 index 00000000..85caf752 --- /dev/null +++ b/original/man3/fts_set.3 @@ -0,0 +1 @@ +.so man3/fts.3 diff --git a/original/man3/ftw.3 b/original/man3/ftw.3 new file mode 100644 index 00000000..5df6a1bc --- /dev/null +++ b/original/man3/ftw.3 @@ -0,0 +1,392 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de) +.\" and copyright (c) 1999 Andries Brouwer (aeb@cwi.nl) +.\" and copyright (c) 2006 Justin Pryzby +.\" and copyright (c) 2006 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 Sun Jul 25 11:02:22 1993 by Rik Faith (faith@cs.unc.edu) +.\" 2006-05-24, Justin Pryzby +.\" document FTW_ACTIONRETVAL; include .SH "RETURN VALUE"; +.\" 2006-05-24, Justin Pryzby and +.\" Michael Kerrisk +.\" reorganized and rewrote much of the page +.\" 2006-05-24, Michael Kerrisk +.\" Added an example program. +.TH FTW 3 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH NAME +ftw, nftw \- file tree walk +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int ftw(const char *" dirpath , +.BI " int (*" fn ") (const char *" fpath ", const struct stat *" sb , +.BI " int " typeflag ), +.BI " int " nopenfd ); +.sp +.B #define _XOPEN_SOURCE 500 +.B #include +.sp +.BI "int nftw(const char *" dirpath , +.BI " int (*" fn ") (const char *" fpath ", const struct stat *" sb , +.BI " int " typeflag ", struct FTW *" ftwbuf ), +.BI " int " nopenfd ", int " flags ); +.fi +.SH DESCRIPTION +.BR ftw () +walks through the directory tree that is +located under the directory \fIdirpath\fP, +and calls \fIfn\fP() once for each entry in the tree. +By default, directories are handled before the files and +subdirectories they contain (preorder traversal). + +To avoid using up all of the calling process's file descriptors, +\fInopenfd\fP specifies the maximum number of directories that +.BR ftw () +will hold open simultaneously. +When +the search depth exceeds this, +.BR ftw () +will become slower because +directories have to be closed and reopened. +.BR ftw () +uses at most +one file descriptor for each level in the directory tree. + +For each entry found in the tree, +.BR ftw () +calls +\fIfn\fP() with three arguments: +.IR fpath , +.IR sb , +and +.IR typeflag . +.I fpath +is the pathname of the entry relative to +.IR dirpath . +.I sb +is a pointer to the +.I stat +structure returned by a call to +.BR stat (2) +for +.IR fpath . +.I typeflag +is an integer that has one of the following values: +.TP +.B FTW_F +.I fpath +is a regular file. +.TP +.B FTW_D +.I fpath +is a directory. +.TP +.B FTW_DNR +.I fpath +is a directory which can't be read. +.TP +.B FTW_NS +The +.BR stat (2) +call failed on +.IR fpath , +which is not a symbolic link. +.sp +If +.I fpath +is a symbolic link and +.BR stat (2) +failed, POSIX.1-2001 states +that it is undefined whether \fBFTW_NS\fP or \fBFTW_SL\fP (see below) +is passed in +.IR typeflag . +.PP +To stop the tree walk, \fIfn\fP() returns a nonzero value; this +value will become the return value of +.BR ftw (). +As long as \fIfn\fP() returns 0, +.BR ftw () +will continue either until it has traversed the entire tree, +in which case it will return zero, +or until it encounters an error (such as a +.BR malloc (3) +failure), in which case it will return \-1. +.PP +Because +.BR ftw () +uses dynamic data structures, the only safe way to +exit out of a tree walk is to return a nonzero value from \fIfn\fP(). +To allow a signal to terminate the walk without causing a memory leak, +have the handler set a global flag that is checked by \fIfn\fP(). +\fIDon't\fP use +.BR longjmp (3) +unless the program is going to terminate. +.SS nftw() +The function +.BR nftw () +is the same as +.BR ftw (), +except that it has one additional argument, \fIflags\fP, +and calls \fIfn\fP() with one more argument, \fIftwbuf\fP. + +This \fIflags\fP argument is formed by ORing zero or more of the +following flags: +.TP +.BR FTW_ACTIONRETVAL " (since glibc 2.3.3)" +If this glibc-specific flag is set, then +.BR nftw () +handles the return value from +.IR fn () +differently. +.IR fn () +should return one of the following values: +.RS +.TP +.B FTW_CONTINUE +Instructs +.BR nftw () +to continue normally. +.TP +.B FTW_SKIP_SIBLINGS +If \fIfn\fP() returns this value, then +siblings of the current entry will be skipped, +and processing continues in the parent. +.\" If \fBFTW_DEPTH\fP +.\" is set, the entry's parent directory is processed next (with +.\" \fIflag\fP set to \fBFTW_DP\fP). +.TP +.B FTW_SKIP_SUBTREE +If \fIfn\fP() is called with an entry that is a directory +(\fItypeflag\fP is \fBFTW_D\fP), this return +value will prevent objects within that directory from being passed as +arguments to \fIfn\fP(). +.BR nftw () +continues processing with the next sibling of the directory. +.TP +.B FTW_STOP +Causes +.BR nftw () +to return immediately with the return value +\fBFTW_STOP\fP. +.PP +Other return values could be associated with new actions in the future; +\fIfn\fP() should not return values other than those listed above. + +The feature test macro +.B _GNU_SOURCE +must be defined in order to +obtain the definition of \fBFTW_ACTIONRETVAL\fP from \fI\fP. +.RE +.TP +.B FTW_CHDIR +If set, do a +.BR chdir (2) +to each directory before handling its contents. +This is useful if the program needs to perform some action +in the directory in which \fIfpath\fP resides. +.TP +.B FTW_DEPTH +If set, do a post-order traversal, that is, call \fIfn\fP() for +the directory itself \fIafter\fP handling the contents of the directory +and its subdirectories. +(By default, each directory is handled \fIbefore\fP its contents.) +.TP +.B FTW_MOUNT +If set, stay within the same file system +(i.e., do not cross mount points). +.TP +.B FTW_PHYS +If set, do not follow symbolic links. +(This is what you want.) +If not set, symbolic links are followed, but no file is reported twice. +.sp +If \fBFTW_PHYS\fP is not set, but \fBFTW_DEPTH\fP is set, +then the function +.IR fn () +is never called for a directory that would be a descendant of itself. +.LP +For each entry in the directory tree, +.BR nftw () +calls +.IR fn () +with four arguments. +.I fpath +and +.I sb +are as for +.BR ftw (). +.I typeflag +may receive any of the same values as with +.BR ftw (), +or any of the following values: +.TP +.B FTW_DP +.I fpath +is a directory, and \fBFTW_DEPTH\fP was specified in \fIflags\fP. +All of the files +and subdirectories within \fIfpath\fP have been processed. +.TP +.B FTW_SL +.I fpath +is a symbolic link, and \fBFTW_PHYS\fP was set in \fIflags\fP. +.\" To obtain the definition of this constant from +.\" .IR , +.\" either +.\" .B _BSD_SOURCE +.\" must be defined, or +.\" .BR _XOPEN_SOURCE +.\" must be defined with a value of 500 or more. +.TP +.B FTW_SLN +.I fpath +is a symbolic link pointing to a nonexistent file. +(This occurs only if \fBFTW_PHYS\fP is not set.) +.LP +The fourth argument that +.BR nftw () +supplies when calling +\fIfn\fP() +is a structure of type \fIFTW\fP: +.in +4n +.nf + +struct FTW { + int base; + int level; +}; + +.fi +.in +.I base +is the offset of the filename (i.e., basename component) +in the pathname given in +.IR fpath . +.I level +is the depth of +.I fpath +in the directory tree, relative to the root of the tree +.RI ( dirpath , +which has depth 0). +.SH "RETURN VALUE" +These functions return 0 on success, and \-1 if an error occurs. + +If \fIfn\fP() returns nonzero, +then the tree walk is terminated and the value returned by \fIfn\fP() +is returned as the result of +.BR ftw () +or +.BR nftw (). + +If +.BR nftw () +is called with the \fBFTW_ACTIONRETVAL\fP flag, +then the only nonzero value that should be used by \fIfn\fP() +to terminate the tree walk is \fBFTW_STOP\fP, +and that value is returned as the result of +.BR nftw (). +.SH "CONFORMING TO" +POSIX.1-2001, SVr4, SUSv1. +POSIX.1-2008 marks +.BR ftw () +as obsolete. +.SH NOTES +The function +.BR nftw () +and the use of \fBFTW_SL\fP with +.BR ftw () +were introduced in SUSv1. +.LP +On some systems +.BR ftw () +will never use \fBFTW_SL\fP, on other systems \fBFTW_SL\fP occurs only +for symbolic links that do not point to an existing file, +and again on other systems +.BR ftw () +will use \fBFTW_SL\fP for each symbolic link. +For predictable control, use +.BR nftw (). +.LP +Under Linux, libc4 and libc5 and glibc 2.0.6 will +use \fBFTW_F\fP for all objects (files, symbolic links, FIFOs, etc.) +that can be stat'ed but are not a directory. + +The function +.BR nftw () +is available since glibc 2.1. + +\fBFTW_ACTIONRETVAL\fP is glibc-specific. +.SH EXAMPLE +The following program traverses the directory tree under the path named +in its first command-line argument, or under the current directory +if no argument is supplied. +It displays various information about each file. +The second command-line argument can be used to specify characters that +control the value assigned to the \fIflags\fP +argument when calling +.BR nftw (). +.nf + +#define _XOPEN_SOURCE 500 +#include +#include +#include +#include +#include + +static int +display_info(const char *fpath, const struct stat *sb, + int tflag, struct FTW *ftwbuf) +{ + printf("%\-3s %2d %7jd %\-40s %d %s\\n", + (tflag == FTW_D) ? "d" : (tflag == FTW_DNR) ? "dnr" : + (tflag == FTW_DP) ? "dp" : (tflag == FTW_F) ? "f" : + (tflag == FTW_NS) ? "ns" : (tflag == FTW_SL) ? "sl" : + (tflag == FTW_SLN) ? "sln" : "???", + ftwbuf\->level, (intmax_t) sb\->st_size, + fpath, ftwbuf\->base, fpath + ftwbuf\->base); + return 0; /* To tell nftw() to continue */ +} + +int +main(int argc, char *argv[]) +{ + int flags = 0; + + if (argc > 2 && strchr(argv[2], \(aqd\(aq) != NULL) + flags |= FTW_DEPTH; + if (argc > 2 && strchr(argv[2], \(aqp\(aq) != NULL) + flags |= FTW_PHYS; + + if (nftw((argc < 2) ? "." : argv[1], display_info, 20, flags) + == \-1) { + perror("nftw"); + exit(EXIT_FAILURE); + } + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR stat (2), +.BR fts (3), +.BR readdir (3), +.BR feature_test_macros (7) diff --git a/original/man3/funlockfile.3 b/original/man3/funlockfile.3 new file mode 100644 index 00000000..b33c2ee6 --- /dev/null +++ b/original/man3/funlockfile.3 @@ -0,0 +1 @@ +.so man3/flockfile.3 diff --git a/original/man3/futimens.3 b/original/man3/futimens.3 new file mode 100644 index 00000000..a365c7b5 --- /dev/null +++ b/original/man3/futimens.3 @@ -0,0 +1 @@ +.so man2/utimensat.2 diff --git a/original/man3/futimes.3 b/original/man3/futimes.3 new file mode 100644 index 00000000..f0cb6a1c --- /dev/null +++ b/original/man3/futimes.3 @@ -0,0 +1,93 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 2006, 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. +.\" +.TH FUTIMES 3 2008-04-07 "Linux" "Linux Programmer's Manual" +.SH NAME +futimes, lutimes \- change file timestamps +.SH SYNOPSIS +.nf +.B #include + +.BI "int futimes(int " fd ", const struct timeval " tv [2]); + +.BI "int lutimes(const char *" filename ", const struct timeval " tv [2]); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR futimes (), +.BR lutimes (): +_BSD_SOURCE +.SH DESCRIPTION +.BR futimes () +changes the access and modification times of a file in the same way as +.BR utimes (2), +with the difference that the file whose timestamps are to be changed +is specified via a file descriptor, +.IR fd , +rather than via a pathname. + +.BR lutimes () +changes the access and modification times of a file in the same way as +.BR utimes (2), +with the difference that if +.I filename +refers to a symbolic link, then the link is not dereferenced: +instead, the timestamps of the symbolic link are changed. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +Errors are as for +.BR utimes (2), +with the following additions for +.BR futimes (): +.TP +.B EBADF +.I fd +is not a valid file descriptor. +.TP +.B ENOSYS +The +.I /proc +file system could not be accessed. +.SH VERSIONS +.BR futimes () +is available since glibc 2.3. +.BR lutimes () +is available since glibc 2.6, and is implemented using the +.BR utimensat (2) +system call, which is supported since kernel 2.6.22. +.SH "CONFORMING TO" +These functions are not specified in any standard. +Other than Linux, they are only available on the BSDs. +.SH "SEE ALSO" +.BR utimensat (2), +.BR utime (2), +.BR symlink (7) diff --git a/original/man3/fwide.3 b/original/man3/fwide.3 new file mode 100644 index 00000000..67c468e4 --- /dev/null +++ b/original/man3/fwide.3 @@ -0,0 +1,88 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH FWIDE 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +fwide \- set and determine the orientation of a FILE stream +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int fwide(FILE *" stream ", int " mode ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR fwide (): +_XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.SH DESCRIPTION +When \fImode\fP is zero, the +.BR fwide () +function determines the current +orientation of \fIstream\fP. +It returns a positive value if \fIstream\fP is +wide-character oriented, that is, if wide-character I/O is permitted but char +I/O is disallowed. +It returns a negative value if \fIstream\fP is byte oriented, +i.e., if char I/O is permitted but wide-character I/O is disallowed. +It +returns zero if \fIstream\fP has no orientation yet; in this case the next +I/O operation might change the orientation (to byte oriented if it is a char +I/O operation, or to wide-character oriented if it is a wide-character I/O +operation). +.PP +Once a stream has an orientation, it cannot be changed and persists until +the stream is closed. +.PP +When \fImode\fP is nonzero, the +.BR fwide () +function first attempts to set +\fIstream\fP's orientation (to wide-character oriented +if \fImode\fP is greater than 0, or +to byte oriented if \fImode\fP is less than 0). +It then returns a value denoting the +current orientation, as above. +.SH "RETURN VALUE" +The +.BR fwide () +function returns the stream's orientation, after possibly +changing it. +A positive return value means wide-character oriented. +A negative return value means byte oriented. +A return value of zero means undecided. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH NOTES +Wide-character output to a byte oriented stream can be performed through the +.BR fprintf (3) +function with the +.B %lc +and +.B %ls +directives. +.PP +Char oriented output to a wide-character oriented stream can be performed +through the +.BR fwprintf (3) +function with the +.B %c +and +.B %s +directives. +.SH "SEE ALSO" +.BR fprintf (3), +.BR fwprintf (3) diff --git a/original/man3/fwprintf.3 b/original/man3/fwprintf.3 new file mode 100644 index 00000000..56ec9685 --- /dev/null +++ b/original/man3/fwprintf.3 @@ -0,0 +1 @@ +.so man3/wprintf.3 diff --git a/original/man3/fwrite.3 b/original/man3/fwrite.3 new file mode 100644 index 00000000..86906ede --- /dev/null +++ b/original/man3/fwrite.3 @@ -0,0 +1 @@ +.so man3/fread.3 diff --git a/original/man3/fwrite_unlocked.3 b/original/man3/fwrite_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/fwrite_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/gai_strerror.3 b/original/man3/gai_strerror.3 new file mode 100644 index 00000000..17f7236a --- /dev/null +++ b/original/man3/gai_strerror.3 @@ -0,0 +1 @@ +.so man3/getaddrinfo.3 diff --git a/original/man3/gamma.3 b/original/man3/gamma.3 new file mode 100644 index 00000000..fa2e9101 --- /dev/null +++ b/original/man3/gamma.3 @@ -0,0 +1,94 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Modified 2003-11-18, aeb: historical remarks +.\" +.TH GAMMA 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.SH NAME +gamma, gammaf, gammal \- (logarithm of the) gamma function +.SH SYNOPSIS +.B #include +.sp +.BI "double gamma(double " x ");" +.br +.BI "float gammaf(float " x ");" +.br +.BI "long double gammal(long double " x ");" +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR gamma (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.br +.BR gammaf (), +.BR gammal (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.\" Also seems to work: -std=c99 -D_XOPEN_SOURCE +.ad b +.SH DESCRIPTION +These functions are deprecated: instead, use either the +.BR tgamma (3) +or the +.BR lgamma (3) +functions, as appropriate. + +For the definition of the Gamma function, see +.BR tgamma (3). +.SS "*BSD version" +The libm in 4.4BSD and some versions of FreeBSD had a +.BR gamma () +function that computes the Gamma function, as one would expect. +.SS "glibc version" +Glibc has a +.BR gamma () +function that is equivalent to +.BR lgamma (3) +and computes the natural logarithm of the Gamma function. +.SH RETURN VALUE +See +.BR lgamma (3). +.SH ERRORS +See +.BR lgamma (3). +.SH "CONFORMING TO" +Because of historical variations in behavior across systems, +this function is not specified in any standard. +.SH NOTES +.SS History +4.2BSD had a +.BR gamma () +that computed +.RI ln(|Gamma(| x |)|), +leaving the sign of +.RI Gamma(| x |) +in the external integer +.IR signgam . +In 4.3BSD the name was changed to +.BR lgamma (3), +and the man page promises +.sp +.in +4n +"At some time in the future the name gamma will be rehabilitated +and used for the Gamma function" +.in +.sp +This did indeed happen in 4.4BSD, where +.BR gamma () +computes the Gamma function (with no effect on +.IR signgam ). +However, this came too late, and we now have +.BR tgamma (3), +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. +.SH "SEE ALSO" +.BR lgamma (3), +.BR signgam (3), +.BR tgamma (3) diff --git a/original/man3/gammaf.3 b/original/man3/gammaf.3 new file mode 100644 index 00000000..64ab6eec --- /dev/null +++ b/original/man3/gammaf.3 @@ -0,0 +1 @@ +.so man3/gamma.3 diff --git a/original/man3/gammal.3 b/original/man3/gammal.3 new file mode 100644 index 00000000..64ab6eec --- /dev/null +++ b/original/man3/gammal.3 @@ -0,0 +1 @@ +.so man3/gamma.3 diff --git a/original/man3/gcvt.3 b/original/man3/gcvt.3 new file mode 100644 index 00000000..3c4c10c3 --- /dev/null +++ b/original/man3/gcvt.3 @@ -0,0 +1,70 @@ +.\" 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 Sat Jul 24 19:32:25 1993 by Rik Faith (faith@cs.unc.edu) +.TH GCVT 3 2009-03-15 "" "Linux Programmer's Manual" +.SH NAME +gcvt \- convert a floating-point number to a string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *gcvt(double " number ", size_t " ndigit ", char *" buf ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR gcvt (): +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +The +.BR gcvt () +function converts \fInumber\fP to a minimal length null-terminated +ASCII string and stores the result in \fIbuf\fP. +It produces \fIndigit\fP significant digits in either +.BR printf (3) +F format or E format. +.SH "RETURN VALUE" +The +.BR gcvt () +function returns the address of the string pointed to +by \fIbuf\fP. +.SH "CONFORMING TO" +Marked as LEGACY in POSIX.1-2001. +POSIX.1-2008 removes the specification of +.BR gcvt (), +recommending the use of +.BR sprintf (3) +instead (though +.BR snprintf (3) +may be preferable). +.SH "SEE ALSO" +.BR ecvt (3), +.BR fcvt (3), +.BR sprintf (3) diff --git a/original/man3/get_current_dir_name.3 b/original/man3/get_current_dir_name.3 new file mode 100644 index 00000000..f73c1579 --- /dev/null +++ b/original/man3/get_current_dir_name.3 @@ -0,0 +1 @@ +.so man3/getcwd.3 diff --git a/original/man3/get_myaddress.3 b/original/man3/get_myaddress.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/get_myaddress.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/getaddrinfo.3 b/original/man3/getaddrinfo.3 new file mode 100644 index 00000000..d33b8ab4 --- /dev/null +++ b/original/man3/getaddrinfo.3 @@ -0,0 +1,818 @@ +.\" Copyright (c) 2007, 2008 Michael Kerrisk +.\" and Copyright (c) 2006 Ulrich Drepper +.\" A few pieces of an earlier version remain: +.\" Copyright 2000, Sam Varshavchik +.\" +.\" 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: RFC 2553 +.\" +.\" 2005-08-09, mtk, added AI_ALL, AI_ADDRCONFIG, AI_V4MAPPED, +.\" and AI_NUMERICSERV. +.\" 2006-11-25, Ulrich Drepper +.\" Add text describing Internationalized Domain Name extensions. +.\" 2007-06-08, mtk: added example programs +.\" 2008-02-26, mtk; clarify discussion of NULL 'hints' argument; other +.\" minor rewrites. +.\" 2008-06-18, mtk: many parts rewritten +.\" 2008-12-04, Petr Baudis +.\" Describe results ordering and reference /etc/gai.conf. +.\" FIXME . glibc's 2.9 NEWS file documents DCCP and UDP-lite support +.\" and is SCTP support now also there? +.\" +.TH GETADDRINFO 3 2009-09-03 "GNU" "Linux Programmer's Manual" +.SH NAME +getaddrinfo, freeaddrinfo, gai_strerror \- network address and +service translation +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.sp +.BI "int getaddrinfo(const char *" "node" ", const char *" "service" , +.BI " const struct addrinfo *" "hints" , +.BI " struct addrinfo **" "res" ); +.sp +.BI "void freeaddrinfo(struct addrinfo *" "res" ); +.sp +.BI "const char *gai_strerror(int " "errcode" ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.ad l +.in +.sp +.BR getaddrinfo (), +.BR freeaddrinfo (), +.BR gai_strerror (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +Given +.I node +and +.IR service , +which identify an Internet host and a service, +.BR getaddrinfo () +returns one or more +.I addrinfo +structures, each of which contains an Internet address +that can be specified in a call to +.BR bind (2) +or +.BR connect (2). +The +.BR getaddrinfo () +function combines the functionality provided by the +.\" .BR getipnodebyname (3), +.\" .BR getipnodebyaddr (3), +.BR getservbyname (3) +and +.BR getservbyport (3) +functions into a single interface, but unlike the latter functions, +.BR getaddrinfo () +is reentrant and allows programs to eliminate IPv4-versus-IPv6 dependencies. +.PP +The +.I addrinfo +structure used by +.BR getaddrinfo () +contains the following fields: +.sp +.in +4n +.nf +struct addrinfo { + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + size_t ai_addrlen; + struct sockaddr *ai_addr; + char *ai_canonname; + struct addrinfo *ai_next; +}; +.fi +.in +.PP +The +.I hints +argument points to an +.I addrinfo +structure that specifies criteria for selecting the socket address +structures returned in the list pointed to by +.IR res . +If +.I hints +is not NULL it points to an +.I addrinfo +structure whose +.IR ai_family , +.IR ai_socktype , +and +.I ai_protocol +specify criteria that limit the set of socket addresses returned by +.BR getaddrinfo (), +as follows: +.TP 12 +.I ai_family +This field specifies the desired address family for the returned addresses. +Valid values for this field include +.BR AF_INET +and +.BR AF_INET6 . +The value +.B AF_UNSPEC +indicates that +.BR getaddrinfo () +should return socket addresses for any address family +(either IPv4 or IPv6, for example) that can be used with +.I node +and +.IR service . +.TP +.I ai_socktype +This field specifies the preferred socket type, for example +.BR SOCK_STREAM +or +.BR SOCK_DGRAM . +Specifying 0 in this field indicates that socket addresses of any type +can be returned by +.BR getaddrinfo (). +.TP +.I ai_protocol +This field specifies the protocol for the returned socket addresses. +Specifying 0 in this field indicates that socket addresses with +any protocol can be returned by +.BR getaddrinfo (). +.TP +.I ai_flags +This field specifies additional options, described below. +Multiple flags are specified by logically OR-ing them together. +.PP +All the other fields in the structure pointed to by +.I hints +must contain either 0 or a null pointer, as appropriate. +Specifying +.I hints +as NULL is equivalent to setting +.I ai_socktype +and +.I ai_protocol +to 0; +.I ai_family +to +.BR AF_UNSPEC ; +and +.I ai_flags +to +.BR "(AI_V4MAPPED\ |\ AI_ADDRCONFIG)" . + +.I node +specifies either a numerical network address +(for IPv4, numbers-and-dots notation as supported by +.BR inet_aton (3); +for IPv6, hexadecimal string format as supported by +.BR inet_pton (3)), +or a network hostname, whose network addresses are looked up and resolved. +If +.I hints.ai_flags +contains the +.B AI_NUMERICHOST +flag then +.I node +must be a numerical network address. +The +.B AI_NUMERICHOST +flag suppresses any potentially lengthy network host address lookups. +.PP +If the +.B AI_PASSIVE +flag is specified in +.IR hints.ai_flags , +and +.I node +is NULL, +then the returned socket addresses will be suitable for +.BR bind (2)ing +a socket that will +.BR accept (2) +connections. +The returned socket address will contain the "wildcard address" +.RB ( INADDR_ANY +for IPv4 addresses, +.BR IN6ADDR_ANY_INIT +for IPv6 address). +The wildcard address is used by applications (typically servers) +that intend to accept connections on any of the hosts's network addresses. +If +.I node +is not NULL, then the +.B AI_PASSIVE +flag is ignored. +.PP +If the +.B AI_PASSIVE +flag is not set in +.IR hints.ai_flags , +then the returned socket addresses will be suitable for use with +.BR connect (2), +.BR sendto (2), +or +.BR sendmsg (2). +If +.I node +is NULL, +then the network address will be set to the loopback interface address +.RB ( INADDR_LOOPBACK +for IPv4 addresses, +.BR IN6ADDR_LOOPBACK_INIT +for IPv6 address); +this is used by applications that intend to communicate +with peers running on the same host. +.PP +.I service +sets the port in each returned address structure. +If this argument is a service name (see +.BR services (5)), +it is translated to the corresponding port number. +This argument can also be specified as a decimal number, +which is simply converted to binary. +If +.I service +is NULL, then the port number of the returned socket addresses +will be left uninitialized. +If +.B AI_NUMERICSERV +is specified in +.I hints.ai_flags +and +.I service +is not NULL, then +.I service +must point to a string containing a numeric port number. +This flag is used to inhibit the invocation of a name resolution service +in cases where it is known not to be required. +.PP +Either +.I node +or +.IR service , +but not both, may be NULL. +.PP +The +.BR getaddrinfo () +function allocates and initializes a linked list of +.I addrinfo +structures, one for each network address that matches +.I node +and +.IR service , +subject to any restrictions imposed by +.IR hints , +and returns a pointer to the start of the list in +.IR res . +The items in the linked list are linked by the +.I ai_next +field. + +There are several reasons why +the linked list may have more than one +.I addrinfo +structure, including: the network host is multihomed, accessible +over multiple protocols (e.g. both +.BR AF_INET +and +.BR AF_INET6 ); +or the same service is available from multiple socket types (one +.B SOCK_STREAM +address and another +.B SOCK_DGRAM +address, for example). +Normally, the application should try +using the addresses in the order in which they are returned. +The sorting function used within +.BR getaddrinfo () +is defined in RFC\ 3484; the order can be tweaked for a particular +system by editing +.IR /etc/gai.conf +(available since glibc 2.5). +.PP +If +.I hints.ai_flags +includes the +.B AI_CANONNAME +flag, then the +.I ai_canonname +field of the first of the +.I addrinfo +structures in the returned list is set to point to the +official name of the host. +.\" In glibc prior to 2.3.4, the ai_canonname of each addrinfo +.\" structure was set pointing to the canonical name; that was +.\" more than POSIX.1-2001 specified, or other implementations provided. +.\" MTK, Aug 05 + +The remaining fields of each returned +.I addrinfo +structure are initialized as follows: +.IP * 2 +The +.IR ai_family , +.IR ai_socktype , +and +.I ai_protocol +fields return the socket creation parameters (i.e., these fields have +the same meaning as the corresponding arguments of +.BR socket (2)). +For example, +.I ai_family +might return +.B AF_INET +or +.BR AF_INET6 ; +.I ai_socktype +might return +.B SOCK_DGRAM +or +.BR SOCK_STREAM ; +and +.I ai_protocol +returns the protocol for the socket. +.IP * +A pointer to the socket address is placed in the +.I ai_addr +field, and the length of the socket address, in bytes, +is placed in the +.I ai_addrlen +field. +.PP +If +.I hints.ai_flags +includes the +.B AI_ADDRCONFIG +flag, then IPv4 addresses are returned in the list pointed to by +.I res +only if the local system has at least one +IPv4 address configured, and IPv6 addresses are only returned +if the local system has at least one IPv6 address configured. +.PP +If +.I hint.ai_flags +specifies the +.B AI_V4MAPPED +flag, and +.I hints.ai_family +was specified as +.BR AF_INET6 , +and no matching IPv6 addresses could be found, +then return IPv4-mapped IPv6 addresses in the list pointed to by +.IR res . +If both +.B AI_V4MAPPED +and +.B AI_ALL +are specified in +.IR hints.ai_family , +then return both IPv6 and IPv4-mapped IPv6 addresses +in the list pointed to by +.IR res . +.B AI_ALL +is ignored if +.B AI_V4MAPPED +is not also specified. +.PP +The +.BR freeaddrinfo () +function frees the memory that was allocated +for the dynamically allocated linked list +.IR res . +.SS "Extensions to getaddrinfo() for Internationalized Domain Names" +.PP +Starting with glibc 2.3.4, +.BR getaddrinfo () +has been extended to selectively allow the incoming and outgoing +hostnames to be transparently converted to and from the +Internationalized Domain Name (IDN) format (see RFC 3490, +.IR "Internationalizing Domain Names in Applications (IDNA)" ). +Four new flags are defined: +.TP +.B AI_IDN +If this flag is specified, then the node name given in +.I node +is converted to IDN format if necessary. +The source encoding is that of the current locale. + +If the input name contains non-ASCII characters, then the IDN encoding +is used. +Those parts of the node name (delimited by dots) that contain +non-ASCII characters are encoded using ASCII Compatible Encoding (ACE) +before being passed to the name resolution functions. +.\" Implementation Detail: +.\" To minimize effects on system performance the implementation might +.\" want to check whether the input string contains any non-ASCII +.\" characters. If there are none the IDN step can be skipped completely. +.\" On systems which allow not-ASCII safe encodings for a locale this +.\" might be a problem. +.TP +.B AI_CANONIDN +After a successful name lookup, and if the +.B AI_CANONNAME +flag was specified, +.BR getaddrinfo () +will return the canonical name of the +node corresponding to the +.I addrinfo +structure value passed back. +The return value is an exact copy of the value returned by the name +resolution function. + +If the name is encoded using ACE, then it will contain the +.I xn\-\- +prefix for one or more components of the name. +To convert these components into a readable form the +.B AI_CANONIDN +flag can be passed in addition to +.BR AI_CANONNAME . +The resulting string is encoded using the current locale's encoding. +.\" +.\"Implementation Detail: +.\"If no component of the returned name starts with xn\-\- the IDN +.\"step can be skipped, therefore avoiding unnecessary slowdowns. +.TP +.BR AI_IDN_ALLOW_UNASSIGNED ", " AI_IDN_USE_STD3_ASCII_RULES +Setting these flags will enable the +IDNA_ALLOW_UNASSIGNED (allow unassigned Unicode code points) and +IDNA_USE_STD3_ASCII_RULES (check output to make sure it is a STD3 +conforming hostname) +flags respectively to be used in the IDNA handling. +.SH "RETURN VALUE" +.\" FIXME glibc defines the following additional errors, some which +.\" can probably be returned by getaddrinfo(); they need to +.\" be documented. +.\" #ifdef __USE_GNU +.\" #define EAI_INPROGRESS -100 /* Processing request in progress. */ +.\" #define EAI_CANCELED -101 /* Request canceled. */ +.\" #define EAI_NOTCANCELED -102 /* Request not canceled. */ +.\" #define EAI_ALLDONE -103 /* All requests done. */ +.\" #define EAI_INTR -104 /* Interrupted by a signal. */ +.\" #define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ +.\" #endif +.BR getaddrinfo () +returns 0 if it succeeds, or one of the following nonzero error codes: +.TP +.B EAI_ADDRFAMILY +.\" Not in SUSv3 +The specified network host does not have any network addresses in the +requested address family. +.TP +.B EAI_AGAIN +The name server returned a temporary failure indication. +Try again later. +.TP +.B EAI_BADFLAGS +.I hints.ai_flags +contains invalid flags; or, +.I hints.ai_flags +included +.B AI_CANONNAME +and +.I name +was NULL. +.TP +.B EAI_FAIL +The name server returned a permanent failure indication. +.TP +.B EAI_FAMILY +The requested address family is not supported. +.TP +.B EAI_MEMORY +Out of memory. +.TP +.B EAI_NODATA +.\" Not in SUSv3 +The specified network host exists, but does not have any +network addresses defined. +.TP +.B EAI_NONAME +The +.I node +or +.I service +is not known; or both +.I node +and +.I service +are NULL; or +.B AI_NUMERICSERV +was specified in +.I hints.ai_flags +and +.I service +was not a numeric port-number string. +.TP +.B EAI_SERVICE +The requested service is not available for the requested socket type. +It may be available through another socket type. +For example, this error could occur if +.I service +was "shell" (a service only available on stream sockets), and either +.I hints.ai_protocol +was +.BR IPPROTO_UDP , +or +.I hints.ai_socktype +was +.BR SOCK_DGRAM ; +or the error could occur if +.I service +was not NULL, and +.I hints.ai_socktype +was +.BR SOCK_RAW +(a socket type that does not support the concept of services). +.TP +.B EAI_SOCKTYPE +The requested socket type is not supported. +This could occur, for example, if +.I hints.ai_socktype +and +.I hints.ai_protocol +are inconsistent (e.g., +.BR SOCK_DGRAM +and +.BR IPPROTO_TCP , +respectively). +.TP +.B EAI_SYSTEM +Other system error, check +.I errno +for details. +.PP +The +.BR gai_strerror () +function translates these error codes to a human readable string, +suitable for error reporting. +.SH "FILES" +.I /etc/gai.conf +.SH "CONFORMING TO" +POSIX.1-2001. +The +.BR getaddrinfo () +function is documented in RFC\ 2553. +.SH "NOTES" +.BR getaddrinfo () +supports the +.IB address % scope-id +notation for specifying the IPv6 scope-ID. + +.BR AI_ADDRCONFIG , +.BR AI_ALL , +and +.B AI_V4MAPPED +are available since glibc 2.3.3. +.B AI_NUMERICSERV +is available since glibc 2.3.4. + +According to POSIX.1-2001, specifying +.I hints +as NULL should cause +.I ai_flags +to be assumed as 0. +The GNU C library instead assumes a value of +.BR "(AI_V4MAPPED\ |\ AI_ADDRCONFIG)" +for this case, +since this value is considered an improvement on the specification. +.SH EXAMPLE +.\" getnameinfo.3 refers to this example +.\" socket.2 refers to this example +.\" bind.2 refers to this example +.\" connect.2 refers to this example +.\" recvfrom.2 refers to this example +.\" sendto.2 refers to this example +The following programs demonstrate the use of +.BR getaddrinfo (), +.BR gai_strerror (), +.BR freeaddrinfo (), +and +.BR getnameinfo (3). +The programs are an echo server and client for UDP datagrams. +.SS Server program +\& +.nf +#include +#include +#include +#include +#include +#include +#include + +#define BUF_SIZE 500 + +int +main(int argc, char *argv[]) +{ + struct addrinfo hints; + struct addrinfo *result, *rp; + int sfd, s; + struct sockaddr_storage peer_addr; + socklen_t peer_addr_len; + ssize_t nread; + char buf[BUF_SIZE]; + + if (argc != 2) { + fprintf(stderr, "Usage: %s port\\n", argv[0]); + exit(EXIT_FAILURE); + } + + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ + hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */ + hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */ + hints.ai_protocol = 0; /* Any protocol */ + hints.ai_canonname = NULL; + hints.ai_addr = NULL; + hints.ai_next = NULL; + + s = getaddrinfo(NULL, argv[1], &hints, &result); + if (s != 0) { + fprintf(stderr, "getaddrinfo: %s\\n", gai_strerror(s)); + exit(EXIT_FAILURE); + } + + /* getaddrinfo() returns a list of address structures. + Try each address until we successfully bind(2). + If socket(2) (or bind(2)) fails, we (close the socket + and) try the next address. */ + + for (rp = result; rp != NULL; rp = rp\->ai_next) { + sfd = socket(rp\->ai_family, rp\->ai_socktype, + rp\->ai_protocol); + if (sfd == \-1) + continue; + + if (bind(sfd, rp\->ai_addr, rp\->ai_addrlen) == 0) + break; /* Success */ + + close(sfd); + } + + if (rp == NULL) { /* No address succeeded */ + fprintf(stderr, "Could not bind\\n"); + exit(EXIT_FAILURE); + } + + freeaddrinfo(result); /* No longer needed */ + + /* Read datagrams and echo them back to sender */ + + for (;;) { + peer_addr_len = sizeof(struct sockaddr_storage); + nread = recvfrom(sfd, buf, BUF_SIZE, 0, + (struct sockaddr *) &peer_addr, &peer_addr_len); + if (nread == \-1) + continue; /* Ignore failed request */ + + char host[NI_MAXHOST], service[NI_MAXSERV]; + + s = getnameinfo((struct sockaddr *) &peer_addr, + peer_addr_len, host, NI_MAXHOST, + service, NI_MAXSERV, NI_NUMERICSERV); + if (s == 0) + printf("Received %ld bytes from %s:%s\\n", + (long) nread, host, service); + else + fprintf(stderr, "getnameinfo: %s\\n", gai_strerror(s)); + + if (sendto(sfd, buf, nread, 0, + (struct sockaddr *) &peer_addr, + peer_addr_len) != nread) + fprintf(stderr, "Error sending response\\n"); + } +} +.fi +.SS Client program +\& +.nf +#include +#include +#include +#include +#include +#include +#include + +#define BUF_SIZE 500 + +int +main(int argc, char *argv[]) +{ + struct addrinfo hints; + struct addrinfo *result, *rp; + int sfd, s, j; + size_t len; + ssize_t nread; + char buf[BUF_SIZE]; + + if (argc < 3) { + fprintf(stderr, "Usage: %s host port msg...\\n", argv[0]); + exit(EXIT_FAILURE); + } + + /* Obtain address(es) matching host/port */ + + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ + hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */ + hints.ai_flags = 0; + hints.ai_protocol = 0; /* Any protocol */ + + s = getaddrinfo(argv[1], argv[2], &hints, &result); + if (s != 0) { + fprintf(stderr, "getaddrinfo: %s\\n", gai_strerror(s)); + exit(EXIT_FAILURE); + } + + /* getaddrinfo() returns a list of address structures. + Try each address until we successfully connect(2). + If socket(2) (or connect(2)) fails, we (close the socket + and) try the next address. */ + + for (rp = result; rp != NULL; rp = rp\->ai_next) { + sfd = socket(rp\->ai_family, rp\->ai_socktype, + rp\->ai_protocol); + if (sfd == \-1) + continue; + + if (connect(sfd, rp\->ai_addr, rp\->ai_addrlen) != \-1) + break; /* Success */ + + close(sfd); + } + + if (rp == NULL) { /* No address succeeded */ + fprintf(stderr, "Could not connect\\n"); + exit(EXIT_FAILURE); + } + + freeaddrinfo(result); /* No longer needed */ + + /* Send remaining command\-line arguments as separate + datagrams, and read responses from server */ + + for (j = 3; j < argc; j++) { + len = strlen(argv[j]) + 1; + /* +1 for terminating null byte */ + + if (len + 1 > BUF_SIZE) { + fprintf(stderr, + "Ignoring long message in argument %d\\n", j); + continue; + } + + if (write(sfd, argv[j], len) != len) { + fprintf(stderr, "partial/failed write\\n"); + exit(EXIT_FAILURE); + } + + nread = read(sfd, buf, BUF_SIZE); + if (nread == \-1) { + perror("read"); + exit(EXIT_FAILURE); + } + + printf("Received %ld bytes: %s\\n", (long) nread, buf); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.\" .BR getipnodebyaddr (3), +.\" .BR getipnodebyname (3), +.BR gethostbyname (3), +.BR getnameinfo (3), +.BR inet (3), +.BR hostname (7), +.BR ip (7) diff --git a/original/man3/getaliasbyname.3 b/original/man3/getaliasbyname.3 new file mode 100644 index 00000000..37dcf191 --- /dev/null +++ b/original/man3/getaliasbyname.3 @@ -0,0 +1 @@ +.so man3/setaliasent.3 diff --git a/original/man3/getaliasbyname_r.3 b/original/man3/getaliasbyname_r.3 new file mode 100644 index 00000000..37dcf191 --- /dev/null +++ b/original/man3/getaliasbyname_r.3 @@ -0,0 +1 @@ +.so man3/setaliasent.3 diff --git a/original/man3/getaliasent.3 b/original/man3/getaliasent.3 new file mode 100644 index 00000000..37dcf191 --- /dev/null +++ b/original/man3/getaliasent.3 @@ -0,0 +1 @@ +.so man3/setaliasent.3 diff --git a/original/man3/getaliasent_r.3 b/original/man3/getaliasent_r.3 new file mode 100644 index 00000000..37dcf191 --- /dev/null +++ b/original/man3/getaliasent_r.3 @@ -0,0 +1 @@ +.so man3/setaliasent.3 diff --git a/original/man3/getc.3 b/original/man3/getc.3 new file mode 100644 index 00000000..4636db71 --- /dev/null +++ b/original/man3/getc.3 @@ -0,0 +1 @@ +.so man3/gets.3 diff --git a/original/man3/getc_unlocked.3 b/original/man3/getc_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/getc_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/getchar.3 b/original/man3/getchar.3 new file mode 100644 index 00000000..4636db71 --- /dev/null +++ b/original/man3/getchar.3 @@ -0,0 +1 @@ +.so man3/gets.3 diff --git a/original/man3/getchar_unlocked.3 b/original/man3/getchar_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/getchar_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/getcwd.3 b/original/man3/getcwd.3 new file mode 100644 index 00000000..b4d15b9d --- /dev/null +++ b/original/man3/getcwd.3 @@ -0,0 +1,234 @@ +.\" 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 Wed Jul 21 22:35:42 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 18 Mar 1996 by Martin Schulze (joey@infodrom.north.de): +.\" Corrected description of getwd(). +.\" Modified Sat Aug 21 12:32:12 MET 1999 by aeb - applied fix by aj +.\" Modified Mon Dec 11 13:32:51 MET 2000 by aeb +.\" Modified Thu Apr 22 03:49:15 CEST 2002 by Roger Luethi +.\" +.TH GETCWD 3 2009-03-31 "GNU" "Linux Programmer's Manual" +.SH NAME +getcwd, getwd, get_current_dir_name \- Get current working directory +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *getcwd(char *" buf ", size_t " size ); +.sp +.BI "char *getwd(char *" buf ); +.sp +.B "char *get_current_dir_name(void);" +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR getcwd (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR get_current_dir_name (): +_GNU_SOURCE +.SH DESCRIPTION +These functions return a null-terminated string containing an +absolute pathname that is the current working directory of +the calling process. +The pathname is returned as the function result and via the argument +.IR buf , +if present. + +The +.BR getcwd () +function copies an absolute pathname of the current working directory +to the array pointed to by +.IR buf , +which is of length +.IR size . +.PP +If the length of the absolute pathname of the current working directory, +including the terminating null byte, exceeds +.I size +bytes, NULL is returned, and +.I errno +is set to +.BR ERANGE ; +an application should check for this error, and allocate a larger +buffer if necessary. +.PP +As an extension to the POSIX.1-2001 standard, Linux (libc4, libc5, glibc) +.BR getcwd () +allocates the buffer dynamically using +.BR malloc (3) +if +.I buf +is NULL. +In this case, the allocated buffer has the length +.I size +unless +.I size +is zero, when +.I buf +is allocated as big as necessary. +The caller should +.BR free (3) +the returned buffer. + +.BR get_current_dir_name () +will +.BR malloc (3) +an array big enough to hold the absolute pathname of +the current working directory. +If the environment +variable +.B PWD +is set, and its value is correct, then that value will be returned. +The caller should +.BR free (3) +the returned buffer. + +.BR getwd () +does not +.BR malloc (3) +any memory. +The +.I buf +argument should be a pointer to an array at least +.B PATH_MAX +bytes long. +If the length of the absolute pathname of the current working directory, +including the terminating null byte, exceeds +.B PATH_MAX +bytes, NULL is returned, and +.I errno +is set to +.BR ENAMETOOLONG . +(Note that on some systems, +.B PATH_MAX +may not be a compile-time constant; +furthermore, its value may depend on the file system, see +.BR pathconf (3).) +For portability and security reasons, use of +.BR getwd () +is deprecated. +.SH "RETURN VALUE" +On success, these functions return a pointer to a string containing +the pathname of the current working directory. +In the case +.BR getcwd () +and +.BR getwd () +this is the same value as +.IR buf. + +On failure, these functions return NULL, and +.I errno +is set to indicate the error. +The contents of the array pointed to by +.I buf +are undefined on error. +.SH ERRORS +.TP +.B EACCES +Permission to read or search a component of the filename was denied. +.TP +.B EFAULT +.I buf +points to a bad address. +.TP +.B EINVAL +The +.I size +argument is zero and +.I buf +is not a null pointer. +.TP +EINVAL +.BR getwd (): +.I buf +is NULL. +.TP +ENAMETOOLONG +.BR getwd (): +The size of the null-terminated absolute pathname string exceeds +.B PATH_MAX +bytes. +.TP +.B ENOENT +The current working directory has been unlinked. +.TP +.B ERANGE +The +.I size +argument is less than the length of the absolute pathname of the +working directory, including the terminating null byte. +You need to allocate a bigger array and try again. +.SH "CONFORMING TO" +.BR getcwd () +conforms to POSIX.1-2001. +Note however that POSIX.1-2001 leaves the behavior of +.BR getcwd () +unspecified if +.I buf +is NULL. + +.BR getwd () +is present in POSIX.1-2001, but marked LEGACY. +POSIX.1-2008 removes the specification of +.BR getwd (). +Use +.BR getcwd () +instead. +POSIX.1-2001 +does not define any errors for +.BR getwd (). + +.BR get_current_dir_name () +is a GNU extension. +.SH NOTES +Under Linux, the function +.BR getcwd () +is a system call (since 2.1.92). +On older systems it would query +.IR /proc/self/cwd . +If both system call and proc file system are missing, a +generic implementation is called. +Only in that case can +these calls fail under Linux with +.BR EACCES . +.LP +These functions are often used to save the location of the current working +directory for the purpose of returning to it later. +Opening the current +directory (".") and calling +.BR fchdir (2) +to return is usually a faster and more reliable alternative when sufficiently +many file descriptors are available, especially on platforms other than Linux. +.SH "SEE ALSO" +.BR chdir (2), +.BR fchdir (2), +.BR open (2), +.BR unlink (2), +.BR free (3), +.BR malloc (3) diff --git a/original/man3/getdate.3 b/original/man3/getdate.3 new file mode 100644 index 00000000..d87e1f03 --- /dev/null +++ b/original/man3/getdate.3 @@ -0,0 +1,289 @@ +.\" Copyright 2001 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" 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. +.\" +.\" Modified, 2001-12-26, aeb +.\" 2008-09-07, mtk, Various rewrites; added an example program. +.\" +.TH GETDATE 3 2008-09-07 "" "Linux Programmer's Manual" +.SH NAME +getdate, getdate_r \- convert a date-plus-time string to broken-down time +.SH SYNOPSIS +.B "#define _XOPEN_SOURCE 500" +.br +.B "#include " +.sp +.BI "struct tm *getdate(const char *" string ); +.sp +.B "extern int getdate_err;" +.sp +.B "#define _GNU_SOURCE" +.br +.B "#include " +.sp +.BI "int getdate_r(const char *" string ", struct tm *" res ); +.SH DESCRIPTION +The function +.BR getdate () +converts a string representation of a date and time, +contained in the buffer pointed to by +.IR string , +into a broken-down time. +The broken-down time is stored in a +.I tm +structure, and a pointer to this +structure is returned as the function result. +This +.I tm +structure is allocated in static storage, +and consequently it will be overwritten by further calls to +.BR getdate (). + +In contrast to +.BR strptime (3), +(which has a +.I format +argument), +.BR getdate () +uses the formats found in the file +whose full pathname is given in the environment variable +.BR DATEMSK . +The first line in the file that matches the given input string +is used for the conversion. + +The matching is done case insensitively. +Superfluous whitespace, either in the pattern or in the string to +be converted, is ignored. + +The conversion specifications that a pattern can contain are those given for +.BR strptime (3). +One more conversion specification is specified in POSIX.1-2001: +.TP +.B %Z +Timezone name. +This is not implemented in glibc. +.LP +When +.B %Z +is given, the structure containing the broken-down time +is initialized with values corresponding to the current +time in the given timezone. +Otherwise, the structure is initialized to the broken-down time +corresponding to the current local time (as by a call to +.BR localtime (3)). +.LP +When only the weekday is given, the day is taken to be the first such day +on or after today. +.LP +When only the month is given (and no year), the month is taken to +be the first such month equal to or after the current month. +If no day is given, it is the first day of the month. +.LP +When no hour, minute and second are given, the current +hour, minute and second are taken. +.LP +If no date is given, but we know the hour, then that hour is taken +to be the first such hour equal to or after the current hour. + +.BR getdate_r () +is a GNU extension that provides a reentrant version of +.BR getdate (). +Rather than using a global variable to report errors and a static buffer +to return the broken down time, +it returns errors via the function result value, +and returns the resulting broken-down time in the +caller-allocated buffer pointed to by the argument +.IR res . +.SH "RETURN VALUE" +When successful, +.BR getdate () +returns a pointer to a +.IR "struct tm" . +Otherwise, it returns NULL and sets the global variable +.IR getdate_err +to one of the error numbers shown below. +Changes to +.I errno +are unspecified. + +On success +.BR getdate_r () +returns 0; +on error it returns one of the error numbers shown below. +.SH ERRORS +The following errors are returned via +.IR getdate_err +(for +.BR getdate ()) +or as the function result (for +.BR getdate_r ()): +.TP 4n +.B 1 +The +.B DATEMSK +environment variable is not defined, or its value is an empty string. +.TP +.B 2 +The template file specified by +.B DATEMSK +cannot be opened for reading. +.TP +.B 3 +Failed to get file status information. +.\" stat() +.TP +.B 4 +The template file is not a regular file. +.TP +.B 5 +An error was encountered while reading the template file. +.TP +.B 6 +Memory allocation failed (not enough memory available). +.\" Error 6 doesn't seem to occur in glibc +.TP +.B 7 +There is no line in the file that matches the input. +.TP +.B 8 +Invalid input specification. +.SH ENVIRONMENT +.TP +.B DATEMSK +File containing format patterns. +.TP +.BR TZ ", " LC_TIME +Variables used by +.BR strptime (3). +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +The POSIX.1-2001 specification for +.BR strptime (3) +contains conversion specifications using the +.B %E +or +.B %O +modifier, while such specifications are not given for +.BR getdate (). +In glibc, +.BR getdate () +is implemented using +.BR strptime (3), +so that precisely the same conversions are supported by both. +.SH EXAMPLE +The program below calls +.BR getdate () +for each of its command-line arguments, +and for each call displays the values in the fields of the returned +.I tm +structure. +The following shell session demonstrates the operation of the program: + +.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" +Sun Sep 7 06:03:36 CEST 2008 +Call 1 ("Tuesday") succeeded: + tm_sec = 36 + tm_min = 3 + tm_hour = 6 + tm_mday = 9 + tm_mon = 8 + tm_year = 108 + tm_wday = 2 + tm_yday = 252 + tm_isdst = 1 +Call 2 ("2009-12-28") succeeded: + tm_sec = 36 + tm_min = 3 + tm_hour = 6 + tm_mday = 28 + tm_mon = 11 + tm_year = 109 + tm_wday = 1 + tm_yday = 361 + tm_isdst = 0 +Call 3 ("12:22:33") succeeded: + tm_sec = 33 + tm_min = 22 + tm_hour = 12 + tm_mday = 7 + tm_mon = 8 + tm_year = 108 + tm_wday = 0 + tm_yday = 250 + tm_isdst = 1 +.fi +.in +.SS Program source +\& +.nf +#define _GNU_SOURCE 500 +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct tm *tmp; + int j; + + for (j = 1; j < argc; j++) { + tmp = getdate(argv[j]); + + if (tmp == NULL) { + printf("Call %d failed; getdate_err = %d\\n", + 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); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR time (2), +.BR localtime (3), +.BR setlocale (3), +.BR strftime (3), +.BR strptime (3), +.BR feature_test_macros (7) diff --git a/original/man3/getdate_err.3 b/original/man3/getdate_err.3 new file mode 100644 index 00000000..c78ed340 --- /dev/null +++ b/original/man3/getdate_err.3 @@ -0,0 +1 @@ +.so man3/getdate.3 diff --git a/original/man3/getdate_r.3 b/original/man3/getdate_r.3 new file mode 100644 index 00000000..c78ed340 --- /dev/null +++ b/original/man3/getdate_r.3 @@ -0,0 +1 @@ +.so man3/getdate.3 diff --git a/original/man3/getdelim.3 b/original/man3/getdelim.3 new file mode 100644 index 00000000..caf4e489 --- /dev/null +++ b/original/man3/getdelim.3 @@ -0,0 +1 @@ +.so man3/getline.3 diff --git a/original/man3/getdirentries.3 b/original/man3/getdirentries.3 new file mode 100644 index 00000000..3feed8f8 --- /dev/null +++ b/original/man3/getdirentries.3 @@ -0,0 +1,74 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from /usr/include/dirent.h are: +.\" Copyright 1991, 1992 Free Software Foundation +.\" +.\" 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. +.\" +.TH GETDIRENTRIES 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +getdirentries \- get directory entries in a file system-independent format +.SH SYNOPSIS +.B #include +.sp +.BI "ssize_t getdirentries(int " fd ", char *" buf ", size_t " nbytes +.BI ", off_t *" basep ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR getdirentries (): +_BSD_SOURCE || _SVID_SOURCE +.SH DESCRIPTION +Read directory entries from the directory specified by +.I fd +into +.IR buf . +At most +.I nbytes +are read. +Reading starts at offset +.IR *basep , +and +.I *basep +is updated with the new position after reading. +.SH "RETURN VALUE" +.BR getdirentries () +returns the number of bytes read or zero when at the end of the directory. +If an error occurs, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +See the Linux library source code for details. +.SH "CONFORMING TO" +Not in POSIX.1-2001. +Present on the BSDs, and a few other systems. +Use +.BR opendir (3) +and +.BR readdir (3) +instead. +.SH "SEE ALSO" +.BR lseek (2), +.BR open (2) diff --git a/original/man3/getenv.3 b/original/man3/getenv.3 new file mode 100644 index 00000000..ba53c921 --- /dev/null +++ b/original/man3/getenv.3 @@ -0,0 +1,82 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's "POSIX Programmer's Guide" (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" 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) +.\" +.TH GETENV 3 2008-03-17 "GNU" "Linux Programmer's Manual" +.SH NAME +getenv \- get an environment variable +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *getenv(const char *" name ); +.fi +.SH DESCRIPTION +The +.BR getenv () +function searches the environment list to find the +environment variable +.IR name , +and returns a pointer to the corresponding +.I value +string. +.SH "RETURN VALUE" +The +.BR getenv () +function returns a pointer to the value in the +environment, or NULL if there is no match. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001, 4.3BSD, C89, C99. +.SH NOTES +The strings in the environment list are of the form \fIname=value\fP. + +As typically implemented, +.BR getenv () +returns a pointer to a string within the environment list. +The caller must take care not to modify this string, +since that would change the environment of the process. + +The implementation of +.BR getenv () +is not required to be reentrant. +The string pointed to by the return value of +.BR getenv () +may be statically allocated, +and can be modified by a subsequent call to +.BR getenv (), +.BR putenv (3), +.BR setenv (3), +or +.BR unsetenv (3). +.SH "SEE ALSO" +.BR clearenv (3), +.BR putenv (3), +.BR setenv (3), +.BR unsetenv (3), +.BR environ (7) diff --git a/original/man3/getfsent.3 b/original/man3/getfsent.3 new file mode 100644 index 00000000..50b205d4 --- /dev/null +++ b/original/man3/getfsent.3 @@ -0,0 +1,133 @@ +.\" Copyright (C) 2002 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. +.\" +.\" Inspired by a page written by Walter Harms. +.\" +.TH GETFSENT 3 2002-02-28 "GNU" "Linux Programmer's Manual" +.SH NAME +getfsent, getfsspec, getfsfile, setfsent, endfsent \- handle fstab entries +.SH SYNOPSIS +.B #include +.sp +.B "void endfsent(void);" +.sp +.B "struct fstab *getfsent(void);" +.sp +.BI "struct fstab *getfsfile(const char *" mount_point ); +.sp +.BI "struct fstab *getfsspec(const char *" special_file ); +.sp +.B "int setfsent(void);" +.SH DESCRIPTION +These functions read from the file +.IR /etc/fstab . +The \fIstruct fstab\fP is defined by: +.LP +.in +4n +.nf +struct fstab { + char *fs_spec; /* block device name */ + char *fs_file; /* mount point */ + char *fs_vfstype; /* file-sysem type */ + char *fs_mntops; /* mount options */ + const char *fs_type; /* rw/rq/ro/sw/xx option */ + int fs_freq; /* dump frequency, in days */ + int fs_passno; /* pass number on parallel dump */ +}; +.fi +.in +.PP +Here the field +.I fs_type +contains (on a *BSD system) +one of the five strings "rw", "rq", "ro", "sw", "xx" +(read-write, read-write with quota, read-only, swap, ignore). + +The function +.BR setfsent () +opens the file when required and positions it at the first line. +.LP +The function +.BR getfsent () +parses the next line from the file. +(After opening it when required.) +.LP +The function +.BR endfsent () +closes the file when required. +.LP +The function +.BR getfsspec () +searches the file from the start and returns the first entry found +for which the +.I fs_spec +field matches the +.I special_file +argument. +.LP +The function +.BR getfsfile () +searches the file from the start and returns the first entry found +for which the +.I fs_file +field matches the +.I mount_point +argument. +.SH "RETURN VALUE" +Upon success, the functions +.BR getfsent (), +.BR getfsfile (), +and +.BR getfsspec () +return a pointer to a \fIstruct fstab\fP, while +.BR setfsent () +returns 1. +Upon failure or end-of-file, these functions return NULL and 0, respectively. +.\" .SH HISTORY +.\" The +.\" .BR getfsent () +.\" function appeared in 4.0BSD; the other four functions appeared in 4.3BSD. +.SH "CONFORMING TO" +These functions are not in POSIX.1-2001. +Several operating systems have them, +e.g., *BSD, SunOS, Digital Unix, AIX (which also has a +.BR getfstype ()). +HP-UX has functions of the same names, +that however use a \fIstruct checklist\fP +instead of a \fIstruct fstab\fP, +and calls these functions obsolete, superseded by +.BR getmntent (3). +.SH NOTES +These functions are not thread-safe. +.LP +Since Linux allows mounting a block special device in several places, +and since several devices can have the same mount point, where the +last device with a given mount point is the interesting one, +while +.BR getfsfile () +and +.BR getfsspec () +only return the first occurrence, these two functions are not suitable +for use under Linux. +.SH "SEE ALSO" +.BR getmntent (3), +.BR fstab (5) diff --git a/original/man3/getfsfile.3 b/original/man3/getfsfile.3 new file mode 100644 index 00000000..1e6a3eb7 --- /dev/null +++ b/original/man3/getfsfile.3 @@ -0,0 +1 @@ +.so man3/getfsent.3 diff --git a/original/man3/getfsspec.3 b/original/man3/getfsspec.3 new file mode 100644 index 00000000..1e6a3eb7 --- /dev/null +++ b/original/man3/getfsspec.3 @@ -0,0 +1 @@ +.so man3/getfsent.3 diff --git a/original/man3/getgrent.3 b/original/man3/getgrent.3 new file mode 100644 index 00000000..433106f6 --- /dev/null +++ b/original/man3/getgrent.3 @@ -0,0 +1,144 @@ +.\" 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 Sat Jul 24 19:29:54 1993 by Rik Faith (faith@cs.unc.edu) +.TH GETGRENT 3 2009-03-30 "" "Linux Programmer's Manual" +.SH NAME +getgrent, setgrent, endgrent \- get group file entry +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.B struct group *getgrent(void); +.sp +.B void setgrent(void); +.sp +.B void endgrent(void); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR getgrent (), +.BR setgrent (), +.BR endgrent (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.ad b +.SH DESCRIPTION +The +.BR getgrent () +function returns a pointer to a structure containing +the broken-out fields of a record in the group database +(e.g., the local group file +.IR /etc/group , +NIS, and LDAP). +The first time it is called +it returns the first entry; thereafter, it returns successive entries. +.PP +The +.BR setgrent () +function rewinds to the beginning +of the group database, to allow repeated scans. +.PP +The +.BR endgrent () +function is used to close the group database +after all processing has been performed. +.PP +The \fIgroup\fP structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group ID */ + char **gr_mem; /* group members */ +}; +.fi +.in +.SH "RETURN VALUE" +The +.BR getgrent () +function returns a pointer to a +.I group +structure, +or NULL if there are no more entries or an error occurs. +.LP +Upon error, +.I errno +may be set. +If one wants to check +.I errno +after the call, it should be set to zero before the call. + +The return value may point to a static area, and may be overwritten +by subsequent calls to +.BR getgrent (), +.BR getgrgid (3), +or +.BR getgrnam (3). +(Do not pass the returned pointer to +.BR free (3).) +.SH ERRORS +.TP +.B EINTR +A signal was caught. +.TP +.B EIO +I/O error. +.TP +.B EMFILE +The calling process already has too many open files. +.TP +.B ENFILE +Too many open files in the system. +.TP +.B ENOMEM +.\" not in POSIX +Insufficient memory to allocate +.I group +structure. +.TP +.B ERANGE +Insufficient buffer space supplied. +.SH FILES +.TP +.I /etc/group +local group database file +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH "SEE ALSO" +.BR fgetgrent (3), +.BR getgrent_r (3), +.BR getgrgid (3), +.BR getgrnam (3), +.BR getgrouplist (3), +.BR putgrent (3) diff --git a/original/man3/getgrent_r.3 b/original/man3/getgrent_r.3 new file mode 100644 index 00000000..97465668 --- /dev/null +++ b/original/man3/getgrent_r.3 @@ -0,0 +1,185 @@ +.\" 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. +.\" +.TH GETGRENT_R 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +getgrent_r, fgetgrent_r \- get group file entry reentrantly +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int getgrent_r(struct group *" gbuf ", char *" buf , +.br +.BI " size_t " buflen ", struct group **" gbufp ); +.sp +.BI "int fgetgrent_r(FILE *" fp ", struct group *" gbuf ", char *" buf , +.br +.BI " size_t " buflen ", struct group **" gbufp ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR getgrent_r (): +_GNU_SOURCE +.\" FIXME . The FTM requirements seem inconsistent here. File a glibc bug? +.br +.BR fgetgrent_r (): +_SVID_SOURCE +.SH DESCRIPTION +The functions +.BR getgrent_r () +and +.BR fgetgrent_r () +are the reentrant versions of +.BR getgrent (3) +and +.BR fgetgrent (3). +The former reads the next group entry from the stream initialized by +.BR setgrent (3). +The latter reads the next group entry from the stream +.IR fp . +.PP +The \fIgroup\fP structure is defined in +.I +as follows: +.sp +.in +4n +.nf +struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group ID */ + char **gr_mem; /* group members */ +}; +.fi +.in +.sp +The nonreentrant functions return a pointer to static storage, +where this static storage contains further pointers to group +name, password and members. +The reentrant functions described here return all of that in +caller-provided buffers. +First of all there is the buffer +.I gbuf +that can hold a \fIstruct group\fP. +And next the buffer +.I buf +of size +.I buflen +that can hold additional strings. +The result of these functions, the \fIstruct group\fP read from the stream, +is stored in the provided buffer +.IR *gbuf , +and a pointer to this \fIstruct group\fP is returned in +.IR *gbufp . +.SH "RETURN VALUE" +On success, these functions return 0 and +.I *gbufp +is a pointer to the \fIstruct group\fP. +On error, these functions return an error value and +.I *gbufp +is NULL. +.SH ERRORS +.TP +.B ENOENT +No more entries. +.TP +.B ERANGE +Insufficient buffer space supplied. +Try again with larger buffer. +.SH "CONFORMING TO" +These functions are GNU extensions, done in a style resembling +the POSIX version of functions like +.BR getpwnam_r (3). +Other systems use prototype +.sp +.nf +.in +4n +struct group *getgrent_r(struct group *grp, char *buf, + int buflen); +.in +.fi +.sp +or, better, +.sp +.nf +.in +4n +int getgrent_r(struct group *grp, char *buf, int buflen, + FILE **gr_fp); +.in +.fi +.SH NOTES +The function +.BR getgrent_r () +is not really reentrant since it shares the reading position +in the stream with all other threads. +.SH EXAMPLE +.nf +#define _GNU_SOURCE +#include +#include +#include +#define BUFLEN 4096 + +int +main(void) +{ + struct group grp, *grpp; + char buf[BUFLEN]; + int i; + + setgrent(); + while (1) { + i = getgrent_r(&grp, buf, BUFLEN, &grpp); + if (i) + break; + printf("%s (%d):", grpp\->gr_name, grpp\->gr_gid); + for (i = 0; ; i++) { + if (grpp\->gr_mem[i] == NULL) + break; + printf(" %s", grpp\->gr_mem[i]); + } + printf("\en"); + } + endgrent(); + exit(EXIT_SUCCESS); +} +.fi +.\" perhaps add error checking - should use strerror_r +.\" #include +.\" #include +.\" if (i) { +.\" if (i == ENOENT) +.\" break; +.\" printf("getgrent_r: %s", strerror(i)); +.\" exit(EXIT_FAILURE); +.\" } +.SH "SEE ALSO" +.BR fgetgrent (3), +.BR getgrent (3), +.BR getgrgid (3), +.BR getgrnam (3), +.BR putgrent (3), +.BR group (5) diff --git a/original/man3/getgrgid.3 b/original/man3/getgrgid.3 new file mode 100644 index 00000000..f9a97b45 --- /dev/null +++ b/original/man3/getgrgid.3 @@ -0,0 +1 @@ +.so man3/getgrnam.3 diff --git a/original/man3/getgrgid_r.3 b/original/man3/getgrgid_r.3 new file mode 100644 index 00000000..f9a97b45 --- /dev/null +++ b/original/man3/getgrgid_r.3 @@ -0,0 +1 @@ +.so man3/getgrnam.3 diff --git a/original/man3/getgrnam.3 b/original/man3/getgrnam.3 new file mode 100644 index 00000000..e85786ca --- /dev/null +++ b/original/man3/getgrnam.3 @@ -0,0 +1,223 @@ +.\" 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-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2003-11-15 by aeb +.\" +.TH GETGRNAM 3 2009-03-30 "" "Linux Programmer's Manual" +.SH NAME +getgrnam, getgrnam_r, getgrgid, getgrgid_r \- get group file entry +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "struct group *getgrnam(const char *" name ); +.sp +.BI "struct group *getgrgid(gid_t " gid ); +.sp +.BI "int getgrnam_r(const char *" name ", struct group *" grp , +.br +.BI " char *" buf ", size_t " buflen ", struct group **" result ); +.sp +.BI "int getgrgid_r(gid_t " gid ", struct group *" grp , +.br +.BI " char *" buf ", size_t " buflen ", struct group **" result ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.ad l +.in +.sp +.BR getgrnam_r (), +.BR getgrgid_r (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +The +.BR getgrnam () +function returns a pointer to a structure containing +the broken-out fields of the record in the group database +(e.g., the local group file +.IR /etc/group , +NIS, and LDAP) +that matches the group name +.IR name . +.PP +The +.BR getgrgid () +function returns a pointer to a structure containing +the broken-out fields of the record in the group database +that matches the group ID +.IR gid . +.PP +The +.BR getgrnam_r () +and +.BR getgrgid_r () +functions obtain the same information, but store the retrieved +.I group +structure +in the space pointed to by +.IR grp . +This +.I group +structure contains pointers to strings, and these strings +are stored in the buffer +.I buf +of size +.IR buflen . +A pointer to the result (in case of success) or NULL (in case no entry +was found or an error occurred) is stored in +.IR *result . +.PP +The \fIgroup\fP structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group ID */ + char **gr_mem; /* group members */ +}; +.fi +.in +.PP +The maximum needed size for +.I buf +can be found using +.BR sysconf (3) +with the argument +.BR _SC_GETGR_R_SIZE_MAX . +.SH "RETURN VALUE" +The +.BR getgrnam () +and +.BR getgrgid () +functions return a pointer to a +.I group +structure, or NULL if the matching entry +is not found or an error occurs. +If an error occurs, +.I errno +is set appropriately. +If one wants to check +.I errno +after the call, it should be set to zero before the call. +.LP +The return value may point to a static area, and may be overwritten +by subsequent calls to +.BR getgrent (3), +.BR getgrgid (), +or +.BR getgrnam (). +(Do not pass the returned pointer to +.BR free (3).) +.LP +On success, +.BR getgrnam_r () +and +.BR getgrgid_r () +return zero, and set +.IR *result +to +.IR grp . +If no matching group record was found, +these functions return 0 and store NULL in +.IR *result . +In case of error, an error number is returned, and NULL is stored in +.IR *result . +.SH ERRORS +.TP +.BR 0 " or " ENOENT " or " ESRCH " or " EBADF " or " EPERM " or ... " +The given +.I name +or +.I gid +was not found. +.TP +.B EINTR +A signal was caught. +.TP +.B EIO +I/O error. +.TP +.B EMFILE +The maximum number +.RB ( OPEN_MAX ) +of files was open already in the calling process. +.TP +.B ENFILE +The maximum number of files was open already in the system. +.TP +.B ENOMEM +.\" not in POSIX +Insufficient memory to allocate +.I group +structure. +.\" to allocate the group structure, or to allocate buffers +.TP +.B ERANGE +Insufficient buffer space supplied. +.SH FILES +.TP +.I /etc/group +local group database file +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH NOTES +The formulation given above under "RETURN VALUE" is from POSIX.1-2001. +It does not call "not found" an error, hence does not specify what value +.I errno +might have in this situation. +But that makes it impossible to recognize +errors. +One might argue that according to POSIX +.I errno +should be left unchanged if an entry is not found. +Experiments on various +Unix-like systems shows that lots of different values occur in this +situation: 0, ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM and probably others. +.\" more precisely: +.\" AIX 5.1 - gives ESRCH +.\" OSF1 4.0g - gives EWOULDBLOCK +.\" libc, glibc up to version 2.6, Irix 6.5 - give ENOENT +.\" glibc since version 2.7 - give 0 +.\" FreeBSD 4.8, OpenBSD 3.2, NetBSD 1.6 - give EPERM +.\" SunOS 5.8 - gives EBADF +.\" Tru64 5.1b, HP-UX-11i, SunOS 5.7 - give 0 +.SH "SEE ALSO" +.BR endgrent (3), +.BR fgetgrent (3), +.BR getgrent (3), +.BR getpwnam (3), +.BR setgrent (3), +.BR group (5) diff --git a/original/man3/getgrnam_r.3 b/original/man3/getgrnam_r.3 new file mode 100644 index 00000000..f9a97b45 --- /dev/null +++ b/original/man3/getgrnam_r.3 @@ -0,0 +1 @@ +.so man3/getgrnam.3 diff --git a/original/man3/getgrouplist.3 b/original/man3/getgrouplist.3 new file mode 100644 index 00000000..f50eb47a --- /dev/null +++ b/original/man3/getgrouplist.3 @@ -0,0 +1,192 @@ +.\" 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. +.\" +.\" A few pieces remain from an earlier version written in +.\" 2002 by Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH GETGROUPLIST 3 2008-07-03 "GNU" "Linux Programmer's Manual" +.SH NAME +getgrouplist \- get list of groups to which a user belongs +.SH SYNOPSIS +.B #include +.sp +.BI "int getgrouplist(const char *" user ", gid_t " group , +.br +.BI " gid_t *" groups ", int *" ngroups ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR getgrouplist (): +_BSD_SOURCE +.SH DESCRIPTION +The +.BR getgrouplist () +function scans the group database (see +.BR group (5)) +to obtain the list of groups that +.I user +belongs to. +Up to +.I *ngroups +of these groups are returned in the array +.IR groups . + +If it was not among the groups defined for +.I user +in the group database, then +.I group +is included in the list of groups returned by +.BR getgrouplist (); +typically this argument is specified as the group ID from +the password record for +.IR user . + +The +.I ngroups +argument is a value-result argument: +on return it always contains the number of groups found for +.IR user , +including +.IR group ; +this value may be greater than the number of groups stored in +.IR groups . +.SH "RETURN VALUE" +If the number of groups of which +.I user +is a member is less than or equal to +.IR *ngroups , +then the value +.I *ngroups +is returned. + +If the user is a member of more than +.I *ngroups +groups, then +.BR getgrouplist () +returns \-1. +In this case the value returned in +.IR *ngroups +can be used to resize the buffer passed to a further call +.BR getgrouplist (). +.SH "VERSIONS" +This function is present since glibc 2.2.4. +.SH "CONFORMING TO" +This function is nonstandard; it appears on most BSDs. +.SH BUGS +In glibc versions before 2.3.3, +the implementation of this function contains a buffer-overrun bug: +it returns the complete list of groups for +.IR user +in the array +.IR groups , +even when the number of groups exceeds +.IR *ngroups . +.SH EXAMPLE +.PP +The program below displays the group list for the user named in its +first command-line argument. +The second command-line argument specifies the +.I ngroups +value to be supplied to +.BR getgrouplist (). +The following shell session shows examples of the use of this program: +.in +4n +.nf + +.RB "$" " ./a.out cecilia 0" +getgrouplist() returned -1; ngroups = 3 +.RB "$" " ./a.out cecilia 3" +ngroups = 3 +16 (dialout) +33 (video) +100 (users) +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int j, ngroups; + gid_t *groups; + struct passwd *pw; + struct group *gr; + + if (argc != 3) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + ngroups = atoi(argv[2]); + + groups = malloc(ngroups * sizeof (gid_t)); + if (groups == NULL) { + perror("malloc"); + exit(EXIT_FAILURE); + } + + /* Fetch passwd structure (contains first group ID for user) */ + + pw = getpwnam(argv[1]); + if (pw == NULL) { + perror("getpwnam"); + exit(EXIT_SUCCESS); + } + + /* Retrieve group list */ + + if (getgrouplist(argv[1], pw\->pw_gid, groups, &ngroups) == \-1) { + fprintf(stderr, "getgrouplist() returned \-1; ngroups = %d\\n", + ngroups); + exit(EXIT_FAILURE); + } + + /* Display list of retrieved groups, along with group names */ + + fprintf(stderr, "ngroups = %d\\n", ngroups); + for (j = 0; j < ngroups; j++) { + printf("%d", groups[j]); + gr = getgrgid(groups[j]); + if (gr != NULL) + printf(" (%s)", gr\->gr_name); + printf("\\n"); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR getgroups (2), +.BR setgroups (2), +.BR getgrent (3), +.BR group (5), +.BR passwd (5) diff --git a/original/man3/gethostbyaddr.3 b/original/man3/gethostbyaddr.3 new file mode 100644 index 00000000..7d0fb4b7 --- /dev/null +++ b/original/man3/gethostbyaddr.3 @@ -0,0 +1 @@ +.so man3/gethostbyname.3 diff --git a/original/man3/gethostbyaddr_r.3 b/original/man3/gethostbyaddr_r.3 new file mode 100644 index 00000000..7d0fb4b7 --- /dev/null +++ b/original/man3/gethostbyaddr_r.3 @@ -0,0 +1 @@ +.so man3/gethostbyname.3 diff --git a/original/man3/gethostbyname.3 b/original/man3/gethostbyname.3 new file mode 100644 index 00000000..36f2da1b --- /dev/null +++ b/original/man3/gethostbyname.3 @@ -0,0 +1,429 @@ +.\" 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-05-22, David Metcalfe +.\" Modified 1993-07-25, Rik Faith (faith@cs.unc.edu) +.\" Modified 1997-02-16, Andries Brouwer (aeb@cwi.nl) +.\" Modified 1998-12-21, Andries Brouwer (aeb@cwi.nl) +.\" Modified 2000-08-12, Andries Brouwer (aeb@cwi.nl) +.\" Modified 2001-05-19, Andries Brouwer (aeb@cwi.nl) +.\" Modified 2002-08-05, Michael Kerrisk +.\" Modified 2004-10-31, Andries Brouwer +.\" +.TH GETHOSTBYNAME 3 2009-12-03 "" "Linux Programmer's Manual" +.SH NAME +gethostbyname, gethostbyaddr, sethostent, gethostent, endhostent, +h_errno, +herror, hstrerror, +gethostbyaddr_r, +gethostbyname2, gethostbyname2_r, gethostbyname_r, +gethostent_r \- get network host entry +.SH SYNOPSIS +.nf +.B #include +.B extern int h_errno; +.sp +.BI "struct hostent *gethostbyname(const char *" name ); +.sp +.BR "#include " " /* for AF_INET */" +.BI "struct hostent *gethostbyaddr(const void *" addr , +.BI " socklen_t " len ", int " type ); +.sp +.BI "void sethostent(int " stayopen ); +.sp +.B void endhostent(void); +.sp +.BI "void herror(const char *" s ); +.sp +.BI "const char *hstrerror(int " err ); +.sp +/* System V/POSIX extension */ +.br +.B struct hostent *gethostent(void); +.sp +/* GNU extensions */ +.br +.BI "struct hostent *gethostbyname2(const char *" name ", int " af ); +.sp +.B "int gethostent_r(" +.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , +.BI " struct hostent **" result ", int *" h_errnop ); +.sp +.BI "int gethostbyaddr_r(const void *" addr ", socklen_t " len ", int " type , +.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , +.BI " struct hostent **" result ", int *" h_errnop ); +.sp +.BI "int gethostbyname_r(const char *" name , +.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , +.BI " struct hostent **" result ", int *" h_errnop ); +.sp +.BI "int gethostbyname2_r(const char *" name ", int " af, +.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , +.BI " struct hostent **" result ", int *" h_errnop ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR gethostbyname2 (), +.BR gethostent_r (), +.BR gethostbyaddr_r (), +.BR gethostbyname_r (), +.BR gethostbyname2_r (): +_BSD_SOURCE || _SVID_SOURCE + +.BR herror (), +.BR hstrerror () +(since glibc 2.8): _BSD_SOURCE || _SVID_SOURCE || _GNU_SOURCE +.ad b +.SH DESCRIPTION +The +.BR gethostbyname* () +and +.BR gethostbyaddr* () +functions are obsolete. +Applications should use +.BR getaddrinfo (3) +and +.BR getnameinfo (3) +instead. + +The +.BR gethostbyname () +function returns a structure of type +.I hostent +for the given host +.IR name . +Here +.I name +is either a hostname, or an IPv4 address in standard dot notation (as for +.BR inet_addr (3)), +or an IPv6 address in colon (and possibly dot) notation. +(See RFC\ 1884 for the description of IPv6 addresses.) +If +.I name +is an IPv4 or IPv6 address, no lookup is performed and +.BR gethostbyname () +simply copies +.I name +into the +.I h_name +field and its +.I struct in_addr +equivalent into the +.I h_addr_list[0] +field of the returned +.I hostent +structure. +If +.I name +doesn't end in a dot and the environment variable +.B HOSTALIASES +is set, the alias file pointed to by +.B HOSTALIASES +will first be searched for +.I name +(see +.BR hostname (7) +for the file format). +The current domain and its parents are searched unless \fIname\fP +ends in a dot. +.PP +The +.BR gethostbyaddr () +function returns a structure of type \fIhostent\fP +for the given host address \fIaddr\fP of length \fIlen\fP and address type +\fItype\fP. +Valid address types are +.B AF_INET +and +.BR AF_INET6 . +The host address argument is a pointer to a struct of a type depending +on the address type, for example a \fIstruct in_addr *\fP (probably +obtained via a call to +.BR inet_addr (3)) +for address type +.BR AF_INET . +.PP +The +.BR sethostent () +function specifies, if \fIstayopen\fP is true (1), +that a connected TCP socket should be used for the name server queries and +that the connection should remain open during successive queries. +Otherwise, name server queries will use UDP datagrams. +.PP +The +.BR endhostent () +function ends the use of a TCP connection for name +server queries. +.PP +The (obsolete) +.BR herror () +function prints the error message associated +with the current value of \fIh_errno\fP on \fIstderr\fP. +.PP +The (obsolete) +.BR hstrerror () +function takes an error number +(typically \fIh_errno\fP) and returns the corresponding message string. +.PP +The domain name queries carried out by +.BR gethostbyname () +and +.BR gethostbyaddr () +use a combination of any or all of the name server +.BR named (8), +a broken out line from \fI/etc/hosts\fP, and the Network +Information Service (NIS or YP), depending upon the contents of the +\fIorder\fP line in +.IR /etc/host.conf . +.\" (See +.\" .BR resolv+ (8)). +The default action is to query +.BR named (8), +followed by +.IR /etc/hosts . +.PP +The \fIhostent\fP structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +.ne 7 +struct hostent { + char *h_name; /* official name of host */ + char **h_aliases; /* alias list */ + int h_addrtype; /* host address type */ + int h_length; /* length of address */ + char **h_addr_list; /* list of addresses */ +} +#define h_addr h_addr_list[0] /* for backward compatibility */ +.fi +.in +.PP +The members of the \fIhostent\fP structure are: +.TP +.I h_name +The official name of the host. +.TP +.I h_aliases +An array of alternative names for the host, terminated by a NULL pointer. +.TP +.I h_addrtype +The type of address; always +.B AF_INET +or +.B AF_INET6 +at present. +.TP +.I h_length +The length of the address in bytes. +.TP +.I h_addr_list +An array of pointers to network addresses for the host (in network byte +order), terminated by a NULL pointer. +.TP +.I h_addr +The first address in \fIh_addr_list\fP for backward compatibility. +.SH "RETURN VALUE" +The +.BR gethostbyname () +and +.BR gethostbyaddr () +functions return the +.I hostent +structure or a NULL pointer if an error occurs. +On error, the +.I h_errno +variable holds an error number. +When non-NULL, the return value may point at static data, see the notes below. +.SH ERRORS +The variable \fIh_errno\fP can have the following values: +.TP +.B HOST_NOT_FOUND +The specified host is unknown. +.TP +.BR NO_ADDRESS " or " NO_DATA +The requested name is valid but does not have an IP address. +.TP +.B NO_RECOVERY +A nonrecoverable name server error occurred. +.TP +.B TRY_AGAIN +A temporary error occurred on an authoritative name server. +Try again later. +.SH FILES +.TP +.I /etc/host.conf +resolver configuration file +.TP +.I /etc/hosts +host database file +.TP +.I /etc/nsswitch.conf +name service switch configuration +.SH "CONFORMING TO" +POSIX.1-2001 specifies +.BR gethostbyname (), +.BR gethostbyaddr (), +.BR sethostent (), +.BR endhostent (), +.BR gethostent (), +and +.IR h_errno ; +.BR gethostbyname (), +.BR gethostbyaddr (), +and +.IR h_errno +are marked obsolescent in that standard. +POSIX.1-2008 removes the specifications of +.BR gethostbyname (), +.BR gethostbyaddr (), +and +.IR h_errno , +recommending the use of +.BR getaddrinfo (3) +and +.BR getnameinfo (3) +instead. +.SH NOTES +The functions +.BR gethostbyname () +and +.BR gethostbyaddr () +may return pointers to static data, which may be overwritten by +later calls. +Copying the +.I struct hostent +does not suffice, since it contains pointers; a deep copy is required. +.LP +In the original BSD implementation the +.I len +argument +of +.BR gethostbyname () +was an +.IR int . +The SUSv2 standard is buggy and declares the +.I len +argument of +.BR gethostbyaddr () +to be of type +.IR size_t . +(That is wrong, because it has to be +.IR int , +and +.I size_t +is not. +POSIX.1-2001 makes it +.IR socklen_t , +which is OK.) +See also +.BR accept (2). +.LP +The BSD prototype for +.BR gethostbyaddr () +uses +.I const char * +for the first argument. +.SS "System V/POSIX Extension" +POSIX requires the +.BR gethostent () +call, that should return the next entry in the host data base. +When using DNS/BIND this does not make much sense, but it may +be reasonable if the host data base is a file that can be read +line by line. +On many systems a routine of this name reads +from the file +.IR /etc/hosts . +.\" e.g., Linux, FreeBSD, Unixware, HP-UX +It may be available only when the library was built without DNS support. +.\" e.g., FreeBSD, AIX +The glibc version will ignore ipv6 entries. +This function is not reentrant, +and glibc adds a reentrant version +.BR gethostent_r (). +.SS "GNU Extensions" +Glibc2 also has a +.BR gethostbyname2 () +that works like +.BR gethostbyname (), +but permits to specify the address family to which the address must belong. +.LP +Glibc2 also has reentrant versions +.BR gethostent_r (), +.BR gethostbyaddr_r (), +.BR gethostbyname_r () +and +.BR gethostbyname2_r (). +The caller supplies a +.I hostent +structure +.I ret +which will be filled in on success, and a temporary work buffer +.I buf +of size +.IR buflen . +After the call, +.I result +will point to the result on success. +In case of an error +or if no entry is found +.I result +will be NULL. +The functions return 0 on success and a nonzero error number on failure. +In addition to the errors returned by the nonreentrant +versions of these functions, if +.I buf +is too small, the functions will return +.BR ERANGE , +and the call should be retried with a larger buffer. +The global variable +.I h_errno +is not modified, but the address of a variable in which to store error numbers +is passed in +.IR h_errnop . +.SH BUGS +.BR gethostbyname () +does not recognize components of a dotted IPv4 address string +that are expressed in hexadecimal. +.\" http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=482973 +.SH "SEE ALSO" +.BR getaddrinfo (3), +.\" .BR getipnodebyaddr (3), +.\" .BR getipnodebyname (3), +.BR getnameinfo (3), +.BR inet (3), +.BR inet_ntop (3), +.BR inet_pton (3), +.BR resolver (3), +.BR hosts (5), +.BR nsswitch.conf (5), +.BR hostname (7), +.BR named (8) +.\" .BR resolv+ (8) diff --git a/original/man3/gethostbyname2.3 b/original/man3/gethostbyname2.3 new file mode 100644 index 00000000..7d0fb4b7 --- /dev/null +++ b/original/man3/gethostbyname2.3 @@ -0,0 +1 @@ +.so man3/gethostbyname.3 diff --git a/original/man3/gethostbyname2_r.3 b/original/man3/gethostbyname2_r.3 new file mode 100644 index 00000000..7d0fb4b7 --- /dev/null +++ b/original/man3/gethostbyname2_r.3 @@ -0,0 +1 @@ +.so man3/gethostbyname.3 diff --git a/original/man3/gethostbyname_r.3 b/original/man3/gethostbyname_r.3 new file mode 100644 index 00000000..7d0fb4b7 --- /dev/null +++ b/original/man3/gethostbyname_r.3 @@ -0,0 +1 @@ +.so man3/gethostbyname.3 diff --git a/original/man3/gethostent.3 b/original/man3/gethostent.3 new file mode 100644 index 00000000..7d0fb4b7 --- /dev/null +++ b/original/man3/gethostent.3 @@ -0,0 +1 @@ +.so man3/gethostbyname.3 diff --git a/original/man3/gethostent_r.3 b/original/man3/gethostent_r.3 new file mode 100644 index 00000000..7d0fb4b7 --- /dev/null +++ b/original/man3/gethostent_r.3 @@ -0,0 +1 @@ +.so man3/gethostbyname.3 diff --git a/original/man3/gethostid.3 b/original/man3/gethostid.3 new file mode 100644 index 00000000..01b8e892 --- /dev/null +++ b/original/man3/gethostid.3 @@ -0,0 +1,118 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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. +.\" +.\" Updated with additions from Mitchum DSouza +.\" Portions Copyright 1993 Mitchum DSouza +.\" +.\" Modified Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond +.TH GETHOSTID 3 2009-01-13 "Linux" "Linux Programmer's Manual" +.SH NAME +gethostid, sethostid \- get or set the unique identifier of the current host +.SH SYNOPSIS +.B #include +.sp +.B long gethostid(void); +.br +.BI "int sethostid(long " hostid ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR sethostid (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.ad b +.SH DESCRIPTION +.BR gethostid () +and +.BR sethostid () +respectively get or set a unique 32-bit identifier for the current machine. +The 32-bit identifier is intended to be unique among all Unix systems in +existence. +This normally resembles the Internet address for the local +machine, as returned by +.BR gethostbyname (3), +and thus usually never needs to be set. + +The +.BR sethostid () +call is restricted to the superuser. +.SH "RETURN VALUE" +.BR gethostid () +returns the 32-bit identifier for the current host as set by +.BR sethostid (). + +On success, +.BR sethostid () +returns 0; on error, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.BR sethostid () +can fail with the following errors: +.TP +.B EACCES +The caller did not have permission to write to the file used +to store the host ID. +.TP +.B EPERM +The calling process's effective user or group ID is not the same +as its corresponding real ID. +.SH "CONFORMING TO" +4.2BSD; these functions were dropped in 4.4BSD. +SVr4 includes +.BR gethostid () +but not +.BR sethostid (). +POSIX.1-2001 specifies +.BR gethostid () +but not +.BR sethostid (). +.SH NOTES +In the glibc implementation, the +.I hostid +is stored in the file +.IR /etc/hostid . +(In glibc versions before 2.2, the file +.I /var/adm/hostid +was used.) +.\" libc5 used /etc/hostid; libc4 didn't have these functions + +In the glibc implementation, if +.BR gethostid () +cannot open the file containing the host ID, +then it obtains the hostname using +.BR gethostname (2), +passes that hostname to +.BR gethostbyname_r (3) +in order to obtain the host's IPv4 address, +and returns a value obtained by bit-twiddling the IPv4 address. +(This value may not be unique.) +.SH BUGS +It is impossible to ensure that the identifier is globally unique. +.SH "SEE ALSO" +.BR hostid (1), +.BR gethostbyname (3) diff --git a/original/man3/getifaddrs.3 b/original/man3/getifaddrs.3 new file mode 100644 index 00000000..7e8aa259 --- /dev/null +++ b/original/man3/getifaddrs.3 @@ -0,0 +1,283 @@ +.\" 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. +.\" +.TH GETIFADDRS 3 2009-01-23 "GNU" "Linux Programmer's Manual" +.SH NAME +getifaddrs, freeifaddrs \- get interface addresses +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "int getifaddrs(struct ifaddrs **" "ifap" ); +.sp +.BI "void freeifaddrs(struct ifaddrs *" "ifa" ); +.fi +.SH DESCRIPTION +The +.BR getifaddrs () +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 +.IR *ifap . +The list consists of +.I ifaddrs +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 +.I ifa_next +field contains a pointer to the next structure on the list, +or NULL if this is the last item of the list. +.PP +The +.I ifa_name +points to the null-terminated interface name. +.\" The constant +.\" .B IF NAMESIZE +.\" indicates the maximum length of this field. +.PP +The +.I ifa_flags +field contains the interface flags, as returned by the +.B SIOCGIFFLAGS +.BR ioctl (2) +operation (see +.BR netdevice (7) +for a list of these flags). +.PP +The +.I ifa_addr +field points to a structure containing the interface address. +(The +.I sa_family +subfield should be consulted to determine the format of the +address structure.) +.PP +The +.I ifa_netmask +field points to a structure containing the netmask associated with +.IR ifa_addr , +if applicable for the address family. +.PP +Depending on whether the bit +.B IFF_BROADCAST +or +.B IFF_POINTOPOINT +is set in +.I ifa_flags +(only one can be set at a time), +either +.I ifa_broadaddr +will contain the broadcast address associated with +.I ifa_addr +(if applicable for the address family) or +.I ifa_dstaddr +will contain the destination address of the point-to-point interface. +.PP +The +.I ifa_data +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 +.BR getifaddrs () +is dynamically allocated and should be freed using +.BR freeifaddrs () +when no longer needed. +.SH RETURN VALUES +On success, +.BR getifaddrs () +returns zero; +on error, -1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.BR getifaddrs () +may fail and set +.I errno +for any of the errors specified for +.BR socket (2), +.BR bind (2), +.BR getsockname (2), +.BR recvmsg (2), +.BR sendto (2), +.BR malloc (3), +or +.BR realloc (3). +.SH VERSIONS +The +.BR getifaddrs () +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 CONFORMING TO +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 +.I ifa_addr +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 +.I ifa_broadaddr +or +.I ifa_dstaddr +differs on various systems. +.\" , 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 +.SH NOTES +The addresses returned on Linux will usually be the IPv4 and IPv6 addresses +assigned to the interface, but also one +.B AF_PACKET +address per interface containing lower-level details about the interface +and its physical layer. +In this case, the +.I ifa_data +field may contain a pointer to a +.IR "struct net_device_stats" , +defined in +.IR , +which contains various interface attributes and statistics. +.SH EXAMPLE +The program below demonstrates the use of +.BR getifaddrs (), +.BR freeifaddrs (), +and +.BR getnameinfo (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) { + 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\\n", + 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\\n", gai_strerror(s)); + exit(EXIT_FAILURE); + } + printf("\\taddress: <%s>\\n", host); + } + } + + freeifaddrs(ifaddr); + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR bind (2), +.BR getsockname (2), +.BR socket (2), +.BR packet (7), +.BR ifconfig (8) diff --git a/original/man3/getipnodebyaddr.3 b/original/man3/getipnodebyaddr.3 new file mode 100644 index 00000000..82e01df4 --- /dev/null +++ b/original/man3/getipnodebyaddr.3 @@ -0,0 +1 @@ +.so man3/getipnodebyname.3 diff --git a/original/man3/getipnodebyname.3 b/original/man3/getipnodebyname.3 new file mode 100644 index 00000000..b227b61d --- /dev/null +++ b/original/man3/getipnodebyname.3 @@ -0,0 +1,268 @@ +.\" Copyright 2000 Sam Varshavchik +.\" +.\" 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: RFC 2553 +.TH GETIPNODEBYNAME 3 2007-11-15 "Linux" "Linux Programmer's Manual" +.SH NAME +getipnodebyname, getipnodebyaddr, freehostent \- get network +hostnames and addresses +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.sp +.BI "struct hostent *getipnodebyname(const char *" name ", int " af , +.BI " int " flags ", int *" error_num ); +.sp +.BI "struct hostent *getipnodebyaddr(const void *" addr ", size_t " len , +.BI " int " af ", int *" "error_num" ); +.sp +.BI "void freehostent(struct hostent *" "ip" ); +.fi +.SH DESCRIPTION +These functions are deprecated (and unavailable in glibc). +Use +.BR getaddrinfo (3) +and +.BR getnameinfo (3) +instead. +.LP +The +.BR getipnodebyname () +and +.BR getipnodebyaddr () +functions return the names and addresses of a network host. +These functions return a pointer to the +following structure: +.sp +.in +4n +.nf +struct hostent { + char *h_name; + char **h_aliases; + int h_addrtype; + int h_length; + char **h_addr_list; +}; +.in +.fi +.PP +These functions replace the +.BR gethostbyname (3) +and +.BR gethostbyaddr (3) +functions, which could only access the IPv4 network address family. +The +.BR getipnodebyname () +and +.BR getipnodebyaddr () +functions can access multiple network address families. +.PP +Unlike the +.B gethostby +functions, +these functions return pointers to dynamically allocated memory. +The +.BR freehostent () +function is used to release the dynamically allocated memory +after the caller no longer needs the +.I hostent +structure. +.SS getipnodebyname() arguments +The +.BR getipnodebyname () +function +looks up network addresses for the host +specified by the +.I name +argument. +The +.I af +argument specifies one of the following values: +.TP +.B AF_INET +The +.I name +argument points to a dotted-quad IPv4 address or a name +of an IPv4 network host. +.TP +.B AF_INET6 +The +.I name +argument points to a hexadecimal IPv6 address or a name +of an IPv6 network host. +.PP +The +.I flags +argument specifies additional options. +More than one option can be specified by logically OR-ing +them together. +.I flags +should be set to 0 +if no options are desired. +.TP +.B AI_V4MAPPED +This flag is used with +.B AF_INET6 +to request a query for IPv4 addresses instead of +IPv6 addresses; the IPv4 addresses will +be mapped to IPv6 addresses. +.TP +.B AI_ALL +This flag is used with +.B AI_V4MAPPED +to request a query for both IPv4 and IPv6 addresses. +Any IPv4 address found will be mapped to an IPv6 address. +.TP +.B AI_ADDRCONFIG +This flag is used with +.B AF_INET6 +to +further request that queries for IPv6 addresses should not be made unless +the system has at least one IPv6 address assigned to a network interface, +and that queries for IPv4 addresses should not be made unless the +system has at least one IPv4 address assigned to a network interface. +This flag may be used by itself or with the +.B AI_V4MAPPED +flag. +.TP +.B AI_DEFAULT +This flag is equivalent to +.BR "(AI_ADDRCONFIG | AI_V4MAPPED)" . +.SS getipnodebyaddr() arguments +The +.BR getipnodebyaddr () +function +looks up the name of the host whose +network address is +specified by the +.I addr +argument. +The +.I af +argument specifies one of the following values: +.TP +.B AF_INET +The +.I addr +argument points to a +.I struct in_addr +and +.I len +must be set to +.IR "sizeof(struct in_addr)" . +.TP +.B AF_INET6 +The +.I addr +argument points to a +.I struct in6_addr +and +.I len +must be set to +.IR "sizeof(struct in6_addr)" . +.SH "RETURN VALUE" +A null pointer is returned if an error occurred, and +.I error_num +will contain an error code from the following list: +.TP +.B HOST_NOT_FOUND +The hostname or network address was not found. +.TP +.B NO_ADDRESS +The domain name server recognized the network address or name, +but no answer was returned. +This can happen if the network host has only IPv4 addresses and +a request has been made for IPv6 information only, or vice versa. +.TP +.B NO_RECOVERY +The domain name server returned a permanent failure response. +.TP +.B TRY_AGAIN +The domain name server returned a temporary failure response. +You might have better luck next time. +.PP +A successful query returns a pointer to a +.I hostent +structure that contains the following fields: +.TP +.I h_name +This is the official name of this network host. +.TP +.I h_aliases +This is an array of pointers to unofficial aliases for the same host. +The array is terminated by a null pointer. +.TP +.I h_addrtype +This is a copy of the +.I af +argument to +.BR getipnodebyname () +or +.BR getipnodebyaddr (). +.I h_addrtype +will always be +.B AF_INET +if the +.I af +argument was +.BR AF_INET . +.I h_addrtype +will always be +.B AF_INET6 +if the +.I af +argument was +.BR AF_INET6 . +.TP +.I h_length +This field will be set to +.I sizeof(struct in_addr) +if +.I h_addrtype +is +.BR AF_INET , +and to +.I sizeof(struct in6_addr) +if +.I h_addrtype +is +.BR AF_INET6 . +.TP +.I h_addr_list +This is an array of one or more pointers to network address structures for the +network host. +The array is terminated by a null pointer. +.SH "CONFORMING TO" +RFC\ 2553. +.\" Not in POSIX.1-2001. +.SH NOTES +These functions were present in glibc 2.1.91-95, but were +removed again. +Several Unix-like systems support them, but all +call them deprecated. +.SH "SEE ALSO" +.BR getaddrinfo (3), +.BR getnameinfo (3), +.BR inet_ntop (3), +.BR inet_pton (3) diff --git a/original/man3/getline.3 b/original/man3/getline.3 new file mode 100644 index 00000000..8987ac9f --- /dev/null +++ b/original/man3/getline.3 @@ -0,0 +1,171 @@ +.\" Copyright (c) 2001 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. +.TH GETLINE 3 2009-12-05 "GNU" "Linux Programmer's Manual" +.SH NAME +getline, getdelim \- delimited string input +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "ssize_t getline(char **" lineptr ", size_t *" n ", FILE *" stream ); + +.BI "ssize_t getdelim(char **" lineptr ", size_t *" n ", int " delim \ +", FILE *" stream ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in + +Before glibc 2.10: +.br +.BR getline (), +.BR getdelim (): +_GNU_SOURCE + +Since glibc 2.10: +.br +.BR getline (), +.BR getdelim (): +_POSIX_C_SOURCE >= 200809 || _XOPEN_SOURCE >= 700 +.SH DESCRIPTION +.BR getline () +reads an entire line from \fIstream\fP, +storing the address of the buffer containing the text into +.IR "*lineptr" . +The buffer is null-terminated and includes the newline character, if +one was found. + +If +.I "*lineptr" +is NULL, then +.BR getline () +will allocate a buffer for storing the line, +which should be freed by the user program. +(The value in +.I *n +is ignored.) + +Alternatively, before calling +.BR getline (), +.I "*lineptr" +can contain a pointer to a +.BR malloc (3)\-allocated +buffer +.I "*n" +bytes in size. +If the buffer is not large enough to hold the line, +.BR getline () +resizes it with +.BR realloc (3), +updating +.I "*lineptr" +and +.I "*n" +as necessary. + +In either case, on a successful call, +.I "*lineptr" +and +.I "*n" +will be updated to reflect the buffer address and allocated size respectively. + +.BR getdelim () +works like +.BR getline (), +except a line delimiter other than newline can be specified as the +.I delimiter +argument. +As with +.BR getline (), +a delimiter character is not added if one was not present +in the input before end of file was reached. +.SH "RETURN VALUE" +On success, +.BR getline () +and +.BR getdelim () +return the number of characters read, including the delimiter character, +but not including the terminating null byte. +This value can be used +to handle embedded null bytes in the line read. + +Both functions return \-1 on failure to read a line (including end of file +condition). +.SH ERRORS +.TP +.B EINVAL +Bad arguments +.RI ( n +or +.I lineptr +is NULL, or +.I stream +is not valid). +.SH VERSIONS +These functions are available since libc 4.6.27. +.SH "CONFORMING TO" +Both +.BR getline () +and +.BR getdelim () +were originally GNU extensions. +They were standardized in POSIX.1-2008. +.SH "EXAMPLE" +.nf +#define _GNU_SOURCE +#include +#include + +int +main(void) +{ + FILE * fp; + char * line = NULL; + size_t len = 0; + ssize_t read; + + fp = fopen("/etc/motd", "r"); + if (fp == NULL) + exit(EXIT_FAILURE); + + while ((read = getline(&line, &len, fp)) != \-1) { + printf("Retrieved line of length %zu :\en", read); + printf("%s", line); + } + + if (line) + free(line); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR read (2), +.BR fgets (3), +.BR fopen (3), +.BR fread (3), +.BR gets (3), +.BR scanf (3), +.BR feature_test_macros (7) diff --git a/original/man3/getloadavg.3 b/original/man3/getloadavg.3 new file mode 100644 index 00000000..0763f352 --- /dev/null +++ b/original/man3/getloadavg.3 @@ -0,0 +1,70 @@ +.\" Copyright (c) 1989, 1991, 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. 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. +.\" +.\" @(#)getloadavg.3 8.1 (Berkeley) 6/4/93 +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.TH GETLOADAVG 3 2007-12-08 "Linux" "Linux Programmer's Manual" +.SH NAME +getloadavg \- get system load averages +.SH SYNOPSIS +.nf +.B #define _BSD_SOURCE +.B #include +.sp +.BI "int getloadavg(double " loadavg[] ", int " nelem ); +.fi +.SH DESCRIPTION +The +.BR getloadavg () +function returns the number of processes in the system run queue +averaged over various periods of time. +Up to +.I nelem +samples are retrieved and assigned to successive elements of +.IR loadavg []. +The system imposes a maximum of 3 samples, representing averages +over the last 1, 5, and 15 minutes, respectively. +.SH RETURN VALUE +If the load average was unobtainable, \-1 is returned; otherwise, +the number of samples actually retrieved is returned. +.\" .SH HISTORY +.\" The +.\" BR getloadavg () +.\" function appeared in +.\" 4.3BSD Reno . +.SH VERSIONS +This function is available in glibc since version 2.2. +.SH "CONFORMING TO" +Not in POSIX.1-2001. +Present on the BSDs and Solaris. +.\" mdoc seems to have a bug - there must be no newline here +.SH SEE ALSO +.BR uptime (1), +.BR proc (5), +.BR feature_test_macros (7) diff --git a/original/man3/getlogin.3 b/original/man3/getlogin.3 new file mode 100644 index 00000000..eb060d32 --- /dev/null +++ b/original/man3/getlogin.3 @@ -0,0 +1,196 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1995 James R. Van Zandt +.\" +.\" 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. +.\" +.\" 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 +.TH GETLOGIN 3 2008-06-29 "GNU" "Linux Programmer's Manual" +.SH NAME +getlogin, getlogin_r, cuserid \- get username +.SH SYNOPSIS +.B #include +.sp +.B "char *getlogin(void);" +.br +.BI "int getlogin_r(char *" buf ", size_t " bufsize ); +.sp +.B #include +.sp +.BI "char *cuserid(char *" string ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR getlogin_r (): +_REENTRANT || _POSIX_C_SOURCE\ >=\ 199506L +.br +.BR cuserid (): +_XOPEN_SOURCE +.SH DESCRIPTION +.BR getlogin () +returns a pointer to a string containing the name of +the user logged in on the controlling terminal of the process, or a +null pointer if this information cannot be determined. +The string is +statically allocated and might be overwritten on subsequent calls to +this function or to +.BR cuserid (). +.PP +.BR getlogin_r () +returns this same username in the array +.I buf +of size +.IR bufsize . +.PP +.BR cuserid () +returns a pointer to a string containing a username +associated with the effective user ID of the process. +If \fIstring\fP +is not a null pointer, it should be an array that can hold at least +\fBL_cuserid\fP characters; the string is returned in this array. +Otherwise, a pointer to a string in a static area is returned. +This +string is statically allocated and might be overwritten on subsequent +calls to this function or to +.BR getlogin (). +.PP +The macro \fBL_cuserid\fP is an integer constant that indicates how +long an array you might need to store a username. +\fBL_cuserid\fP is declared in \fI\fP. +.PP +These functions let your program identify positively the user who is +running +.RB ( cuserid ()) +or the user who logged in this session +.RB ( getlogin ()). +(These can differ when set-user-ID programs are involved.) +.PP +For most purposes, it is more useful to use the environment variable +\fBLOGNAME\fP to find out who the user is. +This is more flexible +precisely because the user can set \fBLOGNAME\fP arbitrarily. +.SH "RETURN VALUE" +.BR getlogin () +returns a pointer to the username when successful, +and NULL on failure. +.BR getlogin_r () +returns 0 when successful, and nonzero on failure. +.SH ERRORS +POSIX specifies +.TP +.B EMFILE +The calling process already has the maximum allowed number of open files. +.TP +.B ENFILE +The system already has the maximum allowed number of open files. +.TP +.B ENXIO +The calling process has no controlling tty. +.TP +.B ERANGE +(getlogin_r) +The length of the username, including the terminating null byte, +is larger than +.IR bufsize . +.LP +Linux/glibc also has +.TP +.B ENOENT +There was no corresponding entry in the utmp-file. +.TP +.B ENOMEM +Insufficient memory to allocate passwd structure. +.TP +.B ENOTTY +Standard input didn't refer to a terminal. +(See BUGS.) +.SH FILES +.TP +\fI/etc/passwd\fP +password database file +.TP +\fI/var/run/utmp\fP +(traditionally \fI/etc/utmp\fP; +some libc versions used \fI/var/adm/utmp\fP) +.SH "CONFORMING TO" +.BR getlogin () +and +.BR getlogin_r () +specified in POSIX.1-2001. + +System V has a +.BR cuserid () +function which uses the real +user ID rather than the effective user ID. +The +.BR cuserid () +function +was included in the 1988 version of POSIX, +but removed from the 1990 version. +It was present in SUSv2, but removed in POSIX.1-2001. +.LP +OpenBSD has +.BR getlogin () +and +.BR setlogin (), +and a username +associated with a session, even if it has no controlling tty. +.SH BUGS +Unfortunately, it is often rather easy to fool +.BR getlogin (). +Sometimes it does not work at all, because some program messed up +the utmp file. +Often, it gives only the first 8 characters of +the login name. +The user currently logged in on the controlling tty +of our program need not be the user who started it. +Avoid +.BR getlogin () +for security-related purposes. +.LP +Note that glibc does not follow the POSIX specification and uses +.I stdin +instead of +.IR /dev/tty . +A bug. +(Other recent systems, like SunOS 5.8 and HP-UX 11.11 and FreeBSD 4.8 +all return the login name also when +.I stdin +is redirected.) +.LP +Nobody knows precisely what +.BR cuserid () +does; avoid it in portable programs. +Or avoid it altogether: use +.I getpwuid(geteuid()) +instead, if that is +what you meant. +.B Do not use +.BR cuserid (). +.SH "SEE ALSO" +.BR geteuid (2), +.BR getuid (2), +.BR utmp (5) diff --git a/original/man3/getlogin_r.3 b/original/man3/getlogin_r.3 new file mode 100644 index 00000000..b6d53bf7 --- /dev/null +++ b/original/man3/getlogin_r.3 @@ -0,0 +1 @@ +.so man3/getlogin.3 diff --git a/original/man3/getmntent.3 b/original/man3/getmntent.3 new file mode 100644 index 00000000..6c2160d9 --- /dev/null +++ b/original/man3/getmntent.3 @@ -0,0 +1,196 @@ +.\" 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 Sat Jul 24 21:46:57 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 961109, 031115, aeb +.\" +.TH GETMNTENT 3 2009-09-15 "" "Linux Programmer's Manual" +.SH NAME +getmntent, setmntent, addmntent, endmntent, hasmntopt, +getmntent_r \- get file system descriptor file entry +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "FILE *setmntent(const char *" filename ", const char *" type ); +.sp +.BI "struct mntent *getmntent(FILE *" fp ); +.sp +.BI "int addmntent(FILE *" fp ", const struct mntent *" mnt ); +.sp +.BI "int endmntent(FILE *" fp ); +.sp +.BI "char *hasmntopt(const struct mntent *" mnt ", const char *" opt ); +.sp +/* GNU extension */ +.B #include +.sp +.BI "struct mntent *getmntent_r(FILE *" fp ", struct mntent *" mntbuf , +.BI " char *" buf ", int " buflen ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR getmntent_r (): +_BSD_SOURCE || _SVID_SOURCE +.SH DESCRIPTION +These routines are used to access the file system description file +\fI/etc/fstab\fP and the mounted file system description file +\fI/etc/mtab\fP. +.PP +The +.BR setmntent () +function opens the file system description file +\fIfilename\fP and returns a file pointer which can be used by +.BR getmntent (). +The argument \fItype\fP is the type of access +required and can take the same values as the \fImode\fP argument of +.BR fopen (3). +.PP +The +.BR getmntent () +function reads the next line from the file system +description file \fIfp\fP and returns a pointer to a structure +containing the broken out fields from a line in the file. +The pointer +points to a static area of memory which is overwritten by subsequent +calls to +.BR getmntent (). +.PP +The +.BR addmntent () +function adds the +.I mntent +structure \fImnt\fP to +the end of the open file \fIfp\fP. +.PP +The +.BR endmntent () +function closes the file system description file +\fIfp\fP. +.PP +The +.BR hasmntopt () +function scans the \fImnt_opts\fP field (see below) +of the +.I mntent +structure \fImnt\fP for a substring that matches \fIopt\fP. +See \fI\fP and +.BR mount (8) +for valid mount options. +.PP +The reentrant +.BR getmntent_r () +function is similar to +.BR getmntent (), +but stores the \fIstruct mount\fP in the provided +.I *mntbuf +and stores the strings pointed to by the entries in that struct +in the provided array +.I buf +of size +.IR buflen . +.PP +The \fImntent\fP structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct mntent { + char *mnt_fsname; /* name of mounted file system */ + char *mnt_dir; /* file system path prefix */ + char *mnt_type; /* mount type (see mntent.h) */ + char *mnt_opts; /* mount options (see mntent.h) */ + int mnt_freq; /* dump frequency in days */ + int mnt_passno; /* pass number on parallel fsck */ +}; +.fi +.in + +Since fields in the mtab and fstab files are separated by whitespace, +octal escapes are used to represent the four characters space (\e040), +tab (\e011), newline (\e012) and backslash (\e134) in those files +when they occur in one of the four strings in a +.I mntent +structure. +The routines +.BR addmntent () +and +.BR getmntent () +will convert +from string representation to escaped representation and back. +.SH "RETURN VALUE" +The +.BR getmntent () +and +.BR getmntent_r () +functions return +a pointer to the +.I mntent +structure or NULL on failure. +.PP +The +.BR addmntent () +function returns 0 on success and 1 on failure. +.PP +The +.BR endmntent () +function always returns 1. +.PP +The +.BR hasmntopt () +function returns the address of the substring if +a match is found and NULL otherwise. +.SH FILES +.nf +/etc/fstab file system description file +/etc/mtab mounted file system description file +.fi +.SH "CONFORMING TO" +The nonreentrant functions are from SunOS 4.1.3. +A routine +.BR getmntent_r () +was introduced in HP-UX 10, but it returns an int. +The prototype shown above is glibc-only. +.SH NOTES +System V also has a +.BR getmntent () +function but the calling sequence +differs, and the returned structure is different. +Under System V +.I /etc/mnttab +is used. +4.4BSD and Digital Unix have a routine +.BR getmntinfo (), +a wrapper around the system call +.BR getfsstat (). +.SH "SEE ALSO" +.BR fopen (3), +.BR fstab (5), +.BR mount (8) diff --git a/original/man3/getmntent_r.3 b/original/man3/getmntent_r.3 new file mode 100644 index 00000000..3c2bb35c --- /dev/null +++ b/original/man3/getmntent_r.3 @@ -0,0 +1 @@ +.so man3/getmntent.3 diff --git a/original/man3/getnameinfo.3 b/original/man3/getnameinfo.3 new file mode 100644 index 00000000..58c68a49 --- /dev/null +++ b/original/man3/getnameinfo.3 @@ -0,0 +1,301 @@ +.\" This page is in the public domain. +.\" Almost all details are from RFC 2553. +.\" +.\" 2004-12-14, mtk, Added EAI_OVERFLOW error +.\" 2004-12-14 Fixed description of error return +.\" +.TH GETNAMEINFO 3 2009-12-03 "GNU" "Linux Programmer's Manual" +.SH NAME +getnameinfo \- address-to-name translation in protocol-independent manner +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "int getnameinfo(const struct sockaddr *" "sa" ", socklen_t " "salen" , +.BI " char *" "host" ", size_t " "hostlen" , +.BI " char *" "serv" ", size_t " "servlen" ", int " "flags" ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.ad l +.in +.sp +.BR getnameinfo (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +The +.BR getnameinfo () +function is the inverse of +.BR getaddrinfo (3): +it converts a socket address to a corresponding host and service, +in a protocol-independent manner. +It combines the functionality of +.BR gethostbyaddr (3) +and +.BR getservbyport (3), +but unlike those functions, +.BR getaddrinfo (3) +is reentrant and allows programs to eliminate +IPv4-versus-IPv6 dependencies. + +The +.I sa +argument is a pointer to a generic socket address structure +(of type +.I sockaddr_in +or +.IR sockaddr_in6 ) +of size +.I salen +that holds the input IP address and port number. +The arguments +.I host +and +.I serv +are pointers to caller-allocated buffers (of size +.I hostlen +and +.I servlen +respectively) into which +.BR getnameinfo () +places null-terminated strings containing the host and +service names respectively. + +The caller can specify that no hostname (or no service name) +is required by providing a NULL +.I host +(or +.IR serv ) +argument or a zero +.I hostlen +(or +.IR servlen ) +argument. +However, at least one of hostname or service name +must be requested. + +The +.I flags +argument modifies the behavior of +.BR getnameinfo () +as follows: +.TP +.B NI_NAMEREQD +If set, then an error is returned if the hostname cannot be determined. +.TP +.B NI_DGRAM +If set, then the service is datagram (UDP) based rather than +stream (TCP) based. +This is required for the few ports (512-514) +that have different services for UDP and TCP. +.TP +.B NI_NOFQDN +If set, return only the hostname part of the fully qualified domain name +for local hosts. +.TP +.B NI_NUMERICHOST +If set, then the numeric form of the hostname is returned. +.\" For example, by calling +.\" .BR inet_ntop () +.\" instead of +.\" .BR gethostbyaddr (). +(When not set, this will still happen in case the node's name +cannot be determined.) +.\" POSIX.1-2003 has NI_NUMERICSCOPE, but glibc doesn't have it. +.TP +.B NI_NUMERICSERV +If set, then the numeric form of the service address is returned. +(When not set, this will still happen in case the service's name +cannot be determined.) +.SS "Extensions to getaddrinfo() for Internationalized Domain Names" +.PP +Starting with glibc 2.3.4, +.BR getnameinfo () +has been extended to selectively allow +hostnames to be transparently converted to and from the +Internationalized Domain Name (IDN) format (see RFC 3490, +.IR "Internationalizing Domain Names in Applications (IDNA)" ). +Three new flags are defined: +.TP +.B NI_IDN +If this flag is used, then the name found in the lookup process is +converted from IDN format to the locale's encoding if necessary. +ASCII-only names are not affected by the conversion, which +makes this flag usable in existing programs and environments. +.TP +.BR NI_IDN_ALLOW_UNASSIGNED ", " NI_IDN_USE_STD3_ASCII_RULES +Setting these flags will enable the +IDNA_ALLOW_UNASSIGNED (allow unassigned Unicode code points) and +IDNA_USE_STD3_ASCII_RULES (check output to make sure it is a STD3 +conforming hostname) +flags respectively to be used in the IDNA handling. +.SH "RETURN VALUE" +.\" FIXME glibc defines the following additional errors, some which +.\" can probably be returned by getnameinfo(); they need to +.\" be documented. +.\" #ifdef __USE_GNU +.\" #define EAI_INPROGRESS -100 /* Processing request in progress. */ +.\" #define EAI_CANCELED -101 /* Request canceled. */ +.\" #define EAI_NOTCANCELED -102 /* Request not canceled. */ +.\" #define EAI_ALLDONE -103 /* All requests done. */ +.\" #define EAI_INTR -104 /* Interrupted by a signal. */ +.\" #define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ +.\" #endif +On success 0 is returned, and node and service names, if requested, +are filled with null-terminated strings, possibly truncated to fit +the specified buffer lengths. +On error one of the following nonzero error codes is returned: +.TP +.B EAI_AGAIN +The name could not be resolved at this time. +Try again later. +.TP +.B EAI_BADFLAGS +The +.I flags +argument has an invalid value. +.TP +.B EAI_FAIL +A nonrecoverable error occurred. +.TP +.B EAI_FAMILY +The address family was not recognized, +or the address length was invalid for the specified family. +.TP +.B EAI_MEMORY +Out of memory. +.TP +.B EAI_NONAME +The name does not resolve for the supplied arguments. +.B NI_NAMEREQD +is set and the host's name cannot be located, +or neither hostname nor service name were requested. +.TP +.B EAI_OVERFLOW +The buffer pointed to by +.I host +or +.I serv +was too small. +.TP +.B EAI_SYSTEM +A system error occurred. +The error code can be found in +.IR errno . +.PP +The +.BR gai_strerror (3) +function translates these error codes to a human readable string, +suitable for error reporting. +.SH FILES +/etc/hosts +.br +/etc/nsswitch.conf +.br +/etc/resolv.conf +.SH VERSIONS +.BR getnameinfo () +is provided in glibc since version 2.1. +.SH "CONFORMING TO" +RFC\ 2553, POSIX.1-2001. +.SH NOTES +In order to assist the programmer in choosing reasonable sizes +for the supplied buffers, +.I +defines the constants +.in +4n +.nf + +#define NI_MAXHOST 1025 +#define NI_MAXSERV 32 +.fi +.in + +Since glibc 2.8, +these definitions are exposed only if one of the feature test macros +.BR _BSD_SOURCE , +.BR _SVID_SOURCE , +or +.BR _GNU_SOURCE +is defined. +.PP +The former is the constant +.B MAXDNAME +in recent versions of BIND's +.I +header file. +The latter is a guess based on the services listed +in the current Assigned Numbers RFC. +.SH EXAMPLE +The following code tries to get the numeric hostname and service name, +for a given socket address. +Note that there is no hardcoded reference to +a particular address family. + +.in +4n +.nf +struct sockaddr *sa; /* input */ +socklen_t len; /* input */ +char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV]; + +if (getnameinfo(sa, len, hbuf, sizeof(hbuf), sbuf, + sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV) == 0) + printf("host=%s, serv=%s\en", hbuf, sbuf); +.fi +.in + +The following version checks if the socket address has a +reverse address mapping. + +.in +4n +.nf +struct sockaddr *sa; /* input */ +socklen_t len; /* input */ +char hbuf[NI_MAXHOST]; + +if (getnameinfo(sa, len, hbuf, sizeof(hbuf), + NULL, 0, NI_NAMEREQD)) + printf("could not resolve hostname"); +else + printf("host=%s\en", hbuf); +.fi +.in +.PP +An example program using +.BR getnameinfo () +can be found in +.BR getaddrinfo (3). +.SH "SEE ALSO" +.BR accept (2), +.BR getpeername (2), +.BR getsockname (2), +.BR recvfrom (2), +.BR socket (2), +.BR getaddrinfo (3), +.BR gethostbyaddr (3), +.BR getservbyname (3), +.BR getservbyport (3), +.BR inet_ntop (3), +.BR hosts (5), +.BR services (5), +.BR hostname (7), +.BR named (8) +.LP +R. Gilligan, S. Thomson, J. Bound and W. Stevens, +.IR "Basic Socket Interface Extensions for IPv6" , +RFC\ 2553, March 1999. +.LP +Tatsuya Jinmei and Atsushi Onoe, +.IR "An Extension of Format for IPv6 Scoped Addresses" , +internet draft, work in progress. +ftp://ftp.ietf.org/internet\-drafts/draft\-ietf\-ipngwg\-scopedaddr\-format\-02.txt +.LP +Craig Metz, +.IR "Protocol Independence Using the Sockets API" , +Proceedings of the freenix track: +2000 USENIX annual technical conference, June 2000. +http://www.usenix.org/publications/library/proceedings/usenix2000/freenix/metzprotocol.html diff --git a/original/man3/getnetbyaddr.3 b/original/man3/getnetbyaddr.3 new file mode 100644 index 00000000..70f5670d --- /dev/null +++ b/original/man3/getnetbyaddr.3 @@ -0,0 +1 @@ +.so man3/getnetent.3 diff --git a/original/man3/getnetbyaddr_r.3 b/original/man3/getnetbyaddr_r.3 new file mode 100644 index 00000000..316d315b --- /dev/null +++ b/original/man3/getnetbyaddr_r.3 @@ -0,0 +1 @@ +.so man3/getnetent_r.3 diff --git a/original/man3/getnetbyname.3 b/original/man3/getnetbyname.3 new file mode 100644 index 00000000..70f5670d --- /dev/null +++ b/original/man3/getnetbyname.3 @@ -0,0 +1 @@ +.so man3/getnetent.3 diff --git a/original/man3/getnetbyname_r.3 b/original/man3/getnetbyname_r.3 new file mode 100644 index 00000000..316d315b --- /dev/null +++ b/original/man3/getnetbyname_r.3 @@ -0,0 +1 @@ +.so man3/getnetent_r.3 diff --git a/original/man3/getnetent.3 b/original/man3/getnetent.3 new file mode 100644 index 00000000..e694a207 --- /dev/null +++ b/original/man3/getnetent.3 @@ -0,0 +1,139 @@ +.\" 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 Sat Jul 24 21:48:06 1993 by Rik Faith (faith@cs.unc.edu) +.TH GETNETENT 3 2008-08-19 "GNU" "Linux Programmer's Manual" +.SH NAME +getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \- +get network entry +.SH SYNOPSIS +.nf +.B #include +.sp +.B struct netent *getnetent(void); +.sp +.BI "struct netent *getnetbyname(const char *" name ); +.sp +.BI "struct netent *getnetbyaddr(uint32_t " net ", int " type ); +.sp +.BI "void setnetent(int " stayopen ); +.sp +.B void endnetent(void); +.fi +.SH DESCRIPTION +The +.BR getnetent () +function reads the next entry from the networks database +and returns a \fInetent\fP structure containing +the broken-out fields from the entry. +A connection is opened to the database if necessary. +.PP +The +.BR getnetbyname () +function returns a \fInetent\fP structure +for the entry from the database +that matches the network \fIname\fP. +.PP +The +.BR getnetbyaddr () +function returns a \fInetent\fP structure +for the entry from the database +that matches the network number \fInet\fP of type +\fItype\fP. +The +.I net +argument must be in host byte order. +.PP +The +.BR setnetent () +function opens a connection to the database, +and sets the next entry to the first entry. +If \fIstayopen\fP is nonzero, +then the connection to the database +will not be closed between calls to one of the +.BR getnet* () +functions. +.PP +The +.BR endnetent () +function closes the connection to the database. +.PP +The \fInetent\fP structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct netent { + char *n_name; /* official network name */ + char **n_aliases; /* alias list */ + int n_addrtype; /* net address type */ + uint32_t n_net; /* network number */ +} +.fi +.in +.PP +The members of the \fInetent\fP structure are: +.TP +.I n_name +The official name of the network. +.TP +.I n_aliases +A NULL-terminated list of alternative names for the network. +.TP +.I n_addrtype +The type of the network number; always +.BR AF_INET . +.TP +.I n_net +The network number in host byte order. +.SH "RETURN VALUE" +The +.BR getnetent (), +.BR getnetbyname () +and +.BR getnetbyaddr () +functions return a pointer to a +statically allocated \fInetent\fP structure, or a NULL pointer if an +error occurs or the end of the file is reached. +.SH FILES +.TP +.I /etc/networks +networks database file +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +.SH NOTES +In glibc versions before 2.2, the +.I net +argument of +.BR getnetbyaddr () +was of type +.IR long . +.SH "SEE ALSO" +.BR getnetent_r (3), +.BR getprotoent (3), +.BR getservent (3) +.\" .BR networks (5) +.br +RFC\ 1101 diff --git a/original/man3/getnetent_r.3 b/original/man3/getnetent_r.3 new file mode 100644 index 00000000..c1cf7cc9 --- /dev/null +++ b/original/man3/getnetent_r.3 @@ -0,0 +1,143 @@ +.\" 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. +.\" +.TH GETNETENT_R 3 2009-02-21 "GNU" "Linux Programmer's Manual" +.SH NAME +getnetent_r, getnetbyname_r, getnetbyaddr_r \- get +network entry (reentrant) +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int getnetent_r(struct netent *" result_buf ", char *" buf , +.BI " size_t " buflen ", struct netent **" result , +.BI " int *" h_errnop ); +.sp +.BI "int getnetbyname_r(const char *" name , +.BI " struct netent *" result_buf ", char *" buf , +.BI " size_t " buflen ", struct netent **" result , +.BI " int *" h_errnop ); +.sp +.BI "int getnetbyaddr_r(uint32_t " net ", int " type , +.BI " struct netent *" result_buf ", char *" buf , +.BI " size_t " buflen ", struct netent **" result , +.BI " int *" h_errnop ); +.sp +.fi +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.ad l +.in +.sp +.BR getnetent_r (), +.BR getnetbyname_r (), +.BR getnetbyaddr_r (): +_BSD_SOURCE || _SVID_SOURCE +.ad b +.SH DESCRIPTION +The +.BR getnetent_r (), +.BR getnetbyname_r (), +and +.BR getnetbyaddr_r () +functions are the reentrant equivalents of, respectively, +.BR getnetent (3), +.BR getnetbyname (3), +and +.BR getnetbynumber (3). +They differ in the way that the +.I netent +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 +.I netent +structure as the function result, +these functions copy the structure into the location pointed to by +.IR result_buf . + +The +.I buf +array is used to store the string fields pointed to by the returned +.I netent +structure. +(The nonreentrant functions allocate these strings in static storage.) +The size of this array is specified in +.IR buflen . +If +.I buf +is too small, the call fails with the error +.BR ERANGE , +and the caller must try again with a larger buffer. +(A buffer of length 1024 bytes should be sufficient for most applications.) +.\" I can find no information on the required/recommended buffer size; +.\" the nonreentrant functions use a 1024 byte buffer -- mtk. + +If the function call successfully obtains a network record, then +.I *result +is set pointing to +.IR result_buf ; +otherwise, +.I *result +is set to NULL. + +The buffer pointed to by +.I h_errnop +is used to return the value that would be stored in the global variable +.I h_errno +by the nonreentrant versions of these functions. +.\" getnetent.3 doesn't document any use of h_errno, but nevertheless +.\" the nonreentrant functions no seem to set h_errno. +.SH "RETURN VALUE" +On success, these functions return 0. +On error, a positive error number is returned. + +On error, record not found +.RB ( getnetbyname_r (), +.BR getnetbyaddr_r ()), +or end of input +.RB ( getnetent_r ()) +.I result +is set to NULL. +.SH ERRORS +.TP +.B ENOENT +.RB ( getnetent_r ()) +No more records in database. +.TP +.B ERANGE +.I buf +is too small. +Try again with a larger buffer +(and increased +.IR buflen ). +.SH "CONFORMING TO" +These functions are GNU extensions. +Functions with similar names exist on some other systems, +though typically with different calling signatures. +.SH "SEE ALSO" +.BR getnetent (3), +.BR networks (5) diff --git a/original/man3/getnetgrent.3 b/original/man3/getnetgrent.3 new file mode 100644 index 00000000..34268f94 --- /dev/null +++ b/original/man3/getnetgrent.3 @@ -0,0 +1 @@ +.so man3/setnetgrent.3 diff --git a/original/man3/getnetgrent_r.3 b/original/man3/getnetgrent_r.3 new file mode 100644 index 00000000..34268f94 --- /dev/null +++ b/original/man3/getnetgrent_r.3 @@ -0,0 +1 @@ +.so man3/setnetgrent.3 diff --git a/original/man3/getopt.3 b/original/man3/getopt.3 new file mode 100644 index 00000000..6fb3d616 --- /dev/null +++ b/original/man3/getopt.3 @@ -0,0 +1,514 @@ +.\" 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:27:50 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon Aug 30 22:02:34 1995 by Jim Van Zandt +.\" longindex is a pointer, has_arg can take 3 values, using consistent +.\" names for optstring and longindex, "\n" in formats fixed. Documenting +.\" opterr and getopt_long_only. Clarified explanations (borrowing heavily +.\" from the source code). +.\" 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 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. +.\" +.TH GETOPT 3 2010-02-03 "GNU" "Linux Programmer's Manual" +.SH NAME +getopt, getopt_long, getopt_long_only, +optarg, optind, opterr, optopt \- Parse command-line options +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int getopt(int " argc ", char * const " argv[] , +.BI " const char *" optstring ); +.sp +.BI "extern char *" optarg ; +.BI "extern int " optind ", " opterr ", " optopt ; +.sp +.B #include +.sp +.BI "int getopt_long(int " argc ", char * const " argv[] , +.BI " const char *" optstring , +.BI " const struct option *" longopts ", int *" longindex ); +.sp +.BI "int getopt_long_only(int " argc ", char * const " argv[] , +.BI " const char *" optstring , +.BI " const struct option *" longopts ", int *" longindex ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.ad l +.in +.sp +.BR getopt (): +_POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE +.br +.BR getopt_long (), +.BR getopt_long_only (): +_GNU_SOURCE +.ad b +.SH DESCRIPTION +The +.BR getopt () +function parses the command-line arguments. +Its arguments +.I argc +and +.I argv +are the argument count and array as passed to the +.IR main () +function on program invocation. +An element of \fIargv\fP that starts with \(aq\-\(aq +(and is not exactly "\-" or "\-\-") +is an option element. +The characters of this element +(aside from the initial \(aq\-\(aq) are option characters. +If +.BR getopt () +is called repeatedly, it returns successively each of the option characters +from each of the option elements. +.PP +The variable +.I optind +is the index of the next element to be processed in +.IR argv . +The system initializes this value to 1. +The caller can reset it to 1 to restart scanning of the same +.IR argv , +or when scanning a new argument vector. +.PP +If +.BR getopt () +finds another option character, it returns that +character, updating the external variable \fIoptind\fP and a static +variable \fInextchar\fP so that the next call to +.BR getopt () +can +resume the scan with the following option character or +\fIargv\fP-element. +.PP +If there are no more option characters, +.BR getopt () +returns \-1. +Then \fIoptind\fP is the index in \fIargv\fP of the first +\fIargv\fP-element that is not an option. +.PP +.I optstring +is a string containing the legitimate option characters. +If such a +character is followed by a colon, the option requires an argument, so +.BR getopt () +places a pointer to the following text in the same +\fIargv\fP-element, or the text of the following \fIargv\fP-element, in +.IR optarg . +Two colons mean an option takes +an optional arg; if there is text in the current \fIargv\fP-element +(i.e., in the same word as the option name itself, for example, "\-oarg"), +then it is returned in \fIoptarg\fP, otherwise \fIoptarg\fP is set to zero. +This is a GNU extension. +If +.I optstring +contains +.B W +followed by a semicolon, then +.B \-W foo +is treated as the long option +.BR \-\-foo . +(The +.B \-W +option is reserved by POSIX.2 for implementation extensions.) +This behavior is a GNU extension, not available with libraries before +glibc 2. +.PP +By default, +.BR getopt () +permutes the contents of \fIargv\fP as it +scans, so that eventually all the nonoptions are at the end. +Two other modes are also implemented. +If the first character of +\fIoptstring\fP is \(aq+\(aq or the environment variable +.B POSIXLY_CORRECT +is set, then option processing stops as soon as a nonoption argument is +encountered. +If the first character of \fIoptstring\fP is \(aq\-\(aq, then +each nonoption \fIargv\fP-element is handled as if it were the argument of +an option with character code 1. (This is used by programs that were +written to expect options and other \fIargv\fP-elements in any order +and that care about the ordering of the two.) +The special argument "\-\-" forces an end of option-scanning regardless +of the scanning mode. +.PP +If +.BR getopt () +does not recognize an option character, it prints an +error message to \fIstderr\fP, stores the character in \fIoptopt\fP, and +returns \(aq?\(aq. +The calling program may prevent the error message by +setting \fIopterr\fP to 0. +.PP +If +.BR getopt () +finds an option character in \fIargv\fP that was not +included in \fIoptstring\fP, or if it detects a missing option argument, +it returns \(aq?\(aq and sets the external variable \fIoptopt\fP to the +actual option character. +If the first character +(following any optional \(aq+\(aq or \(aq\-\(aq described above) +of \fIoptstring\fP +is a colon (\(aq:\(aq), then +.BR getopt () +returns \(aq:\(aq instead of \(aq?\(aq to +indicate a missing option argument. +If an error was detected, and +the first character of \fIoptstring\fP is not a colon, and +the external variable \fIopterr\fP is nonzero (which is the default), +.BR getopt () +prints an error message. +.SS getopt_long() and getopt_long_only() +The +.BR getopt_long () +function works like +.BR getopt () +except that it also accepts long options, started with two dashes. +(If the program accepts only long options, then +.I optstring +should be specified as an empty string (""), not NULL.) +Long option names may be abbreviated if the abbreviation is +unique or is an exact match for some defined option. +A long option +may take a parameter, of the form +.B \-\-arg=param +or +.BR "\-\-arg param" . +.PP +.I longopts +is a pointer to the first element of an array of +.I struct option +declared in +.I +as +.in +4n +.nf +.sp +struct option { + const char *name; + int has_arg; + int *flag; + int val; +}; +.fi +.in +.PP +The meanings of the different fields are: +.TP +.I name +is the name of the long option. +.TP +.I has_arg +is: +\fBno_argument\fP (or 0) if the option does not take an argument; +\fBrequired_argument\fP (or 1) if the option requires an argument; or +\fBoptional_argument\fP (or 2) if the option takes an optional argument. +.TP +.I flag +specifies how results are returned for a long option. +If \fIflag\fP +is NULL, then +.BR getopt_long () +returns \fIval\fP. (For +example, the calling program may set \fIval\fP to the equivalent short +option character.) +Otherwise, +.BR getopt_long () +returns 0, and +\fIflag\fP points to a variable which is set to \fIval\fP if the +option is found, but left unchanged if the option is not found. +.TP +\fIval\fP +is the value to return, or to load into the variable pointed +to by \fIflag\fP. +.PP +The last element of the array has to be filled with zeros. +.PP +If \fIlongindex\fP is not NULL, it +points to a variable which is set to the index of the long option relative to +.IR longopts . +.PP +.BR getopt_long_only () +is like +.BR getopt_long (), +but \(aq\-\(aq as well +as "\-\-" can indicate a long option. +If an option that starts with \(aq\-\(aq +(not "\-\-") doesn't match a long option, but does match a short option, +it is parsed as a short option instead. +.SH "RETURN VALUE" +If an option was successfully found, then +.BR getopt () +returns the option character. +If all command-line options have been parsed, then +.BR getopt () +returns \-1. +If +.BR getopt () +encounters an option character that was not in +.IR optstring , +then \(aq?\(aq is returned. +If +.BR getopt () +encounters an option with a missing argument, +then the return value depends on the first character in +.IR optstring : +if it is \(aq:\(aq, then \(aq:\(aq is returned; otherwise \(aq?\(aq is returned. +.PP +.BR getopt_long () +and +.BR getopt_long_only () +also return the option +character when a short option is recognized. +For a long option, they +return \fIval\fP if \fIflag\fP is NULL, and 0 otherwise. +Error and \-1 returns are the same as for +.BR getopt (), +plus \(aq?\(aq for an +ambiguous match or an extraneous parameter. +.SH ENVIRONMENT +.TP +.B POSIXLY_CORRECT +If this is set, then option processing stops as soon as a nonoption +argument is encountered. +.TP +.B __GNU_nonoption_argv_flags_ +This variable was used by +.BR bash (1) +2.0 to communicate to glibc which arguments are the results of +wildcard expansion and so should not be considered as options. +This behavior was removed in +.BR bash (1) +version 2.01, but the support remains in glibc. +.SH "CONFORMING TO" +.TP +.BR getopt (): +POSIX.2 and POSIX.1-2001, +provided the environment variable +.B POSIXLY_CORRECT +is set. +Otherwise, the elements of \fIargv\fP aren't really const, because we +permute them. +We pretend they're const in the prototype to be +compatible with other systems. + +The use of \(aq+\(aq and \(aq\-\(aq in +.I optstring +is a GNU extension. + +On some older implementations, +.BR getopt () +was declared in +.IR . +SUSv1 permitted the declaration to appear in either +.I +or +.IR . +POSIX.1-2001 marked the use of +.I +for this purpose as LEGACY. +POSIX.1-2001 does not allow the declaration to appear in +.IR . +.TP +.BR getopt_long "() and " getopt_long_only (): +These functions are GNU extensions. +.SH NOTES +A program that scans multiple argument vectors, +or rescans the same vector more than once, +and wants to make use of GNU extensions such as \(aq+\(aq +and \(aq\-\(aq at the start of +.IR optstring , +or changes the value of +.B POSIXLY_CORRECT +between scans, +must reinitialize +.BR getopt () +by resetting +.I optind +to 0, rather than the traditional value of 1. +(Resetting to 0 forces the invocation of an internal initialization +routine that rechecks +.B POSIXLY_CORRECT +and checks for GNU extensions in +.IR optstring .) +.SH BUGS +The POSIX.2 specification of +.BR getopt () +has a technical error described in POSIX.2 Interpretation 150. +The GNU +implementation (and probably all other implementations) implements the +correct behavior rather than that specified. +.SH EXAMPLE +The following trivial example program uses +.BR getopt () +to handle two program options: +.IR \-n , +with no associated value; and +.IR "\-t val" , +which expects an associated value. +.nf +.sp +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int flags, opt; + int nsecs, tfnd; + + nsecs = 0; + tfnd = 0; + flags = 0; + while ((opt = getopt(argc, argv, "nt:")) != \-1) { + switch (opt) { + case \(aqn\(aq: + flags = 1; + break; + case \(aqt\(aq: + nsecs = atoi(optarg); + tfnd = 1; + break; + default: /* \(aq?\(aq */ + fprintf(stderr, "Usage: %s [\-t nsecs] [\-n] name\\n", + argv[0]); + exit(EXIT_FAILURE); + } + } + + printf("flags=%d; tfnd=%d; optind=%d\\n", flags, tfnd, optind); + + if (optind >= argc) { + fprintf(stderr, "Expected argument after options\\n"); + exit(EXIT_FAILURE); + } + + printf("name argument = %s\\n", argv[optind]); + + /* Other code omitted */ + + exit(EXIT_SUCCESS); +} +.fi +.PP +The following example program illustrates the use of +.BR getopt_long () +with most of its features. +.nf +.sp +#include /* for printf */ +#include /* for exit */ +#include + +int +main(int argc, char **argv) +{ + int c; + int digit_optind = 0; + + while (1) { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 1, 0, \(aqc\(aq}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long(argc, argv, "abc:d:012", + long_options, &option_index); + if (c == \-1) + break; + + switch (c) { + case 0: + printf("option %s", long_options[option_index].name); + if (optarg) + printf(" with arg %s", optarg); + printf("\\n"); + 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"); + digit_optind = this_option_optind; + printf("option %c\\n", c); + break; + + case \(aqa\(aq: + printf("option a\\n"); + break; + + case \(aqb\(aq: + printf("option b\\n"); + break; + + case \(aqc\(aq: + printf("option c with value \(aq%s\(aq\\n", optarg); + break; + + case \(aqd\(aq: + printf("option d with value \(aq%s\(aq\\n", optarg); + break; + + case \(aq?\(aq: + break; + + default: + printf("?? getopt returned character code 0%o ??\\n", c); + } + } + + if (optind < argc) { + printf("non\-option ARGV\-elements: "); + while (optind < argc) + printf("%s ", argv[optind++]); + printf("\\n"); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR getsubopt (3), +.BR feature_test_macros (7) diff --git a/original/man3/getopt_long.3 b/original/man3/getopt_long.3 new file mode 100644 index 00000000..7612d3f6 --- /dev/null +++ b/original/man3/getopt_long.3 @@ -0,0 +1 @@ +.so man3/getopt.3 diff --git a/original/man3/getopt_long_only.3 b/original/man3/getopt_long_only.3 new file mode 100644 index 00000000..7612d3f6 --- /dev/null +++ b/original/man3/getopt_long_only.3 @@ -0,0 +1 @@ +.so man3/getopt.3 diff --git a/original/man3/getpass.3 b/original/man3/getpass.3 new file mode 100644 index 00000000..fbb467d5 --- /dev/null +++ b/original/man3/getpass.3 @@ -0,0 +1,125 @@ +.\" Copyright (c) 2000 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. +.\" +.TH GETPASS 3 2000-12-05 "Linux" "Linux Programmer's Manual" +.SH NAME +getpass \- get a password +.SH SYNOPSIS +.B #include +.sp +.BI "char *getpass( const char *" prompt ); +.SH DESCRIPTION +This function is obsolete. +Do not use it. +.PP +The +.BR getpass () +function opens +.I /dev/tty +(the controlling terminal of the process), outputs the string +.IR prompt , +turns off echoing, reads one line (the "password"), +restores the terminal state and closes +.I /dev/tty +again. +.SH "RETURN VALUE" +The function +.BR getpass () +returns a pointer to a static buffer containing (the first +.B PASS_MAX +bytes of) the password without the trailing +newline, terminated by a null byte (\(aq\\0\(aq). +This buffer may be overwritten by a following call. +On error, the terminal state is restored, +.I errno +is set appropriately, and NULL is returned. +.SH ERRORS +The function may fail if +.TP +.B ENXIO +The process does not have a controlling terminal. +.SH FILES +.I /dev/tty +.\" .SH HISTORY +.\" A +.\" .BR getpass () +.\" function appeared in Version 7 AT&T UNIX. +.SH "CONFORMING TO" +Present in SUSv2, but marked LEGACY. +Removed in POSIX.1-2001. +.SH NOTES +For libc4 and libc5, the prompt is not written to +.I /dev/tty +but to +.IR stderr . +Moreover, if +.I /dev/tty +cannot be opened, the password is read from +.IR stdin . +The static buffer has length 128 so that only the first 127 +bytes of the password are returned. +While reading the password, signal generation +.RB ( SIGINT , +.BR SIGQUIT , +.BR SIGSTOP , +.BR SIGTSTOP ) +is disabled and the corresponding characters +(usually control-C, control-\e, control-Z and control-Y) +are transmitted as part of the password. +Since libc 5.4.19 also line editing is disabled, so that also +backspace and the like will be seen as part of the password. +.PP +For glibc2, if +.I /dev/tty +cannot be opened, the prompt is written to +.I stderr +and the password is read from +.IR stdin . +There is no limit on the length of the password. +Line editing is not disabled. +.PP +According to the SUSv2, the value of +.B PASS_MAX +must be defined in +.I +in case it is smaller than 8, and can in any case be obtained using +.IR sysconf(_SC_PASS_MAX) . +However, POSIX.2 withdraws the constants +.B PASS_MAX +and +.BR _SC_PASS_MAX , +and the function +.BR getpass (). +Libc4 and libc5 have never supported +.B PASS_MAX +or +.BR _SC_PASS_MAX . +Glibc2 accepts +.B _SC_PASS_MAX +and returns +.B BUFSIZ +(e.g., 8192). +.SH BUGS +The calling process should zero the password as soon as possible to avoid +leaving the cleartext password visible in the process's address space. +.SH "SEE ALSO" +.BR crypt (3) diff --git a/original/man3/getprotobyname.3 b/original/man3/getprotobyname.3 new file mode 100644 index 00000000..f8cb4bba --- /dev/null +++ b/original/man3/getprotobyname.3 @@ -0,0 +1 @@ +.so man3/getprotoent.3 diff --git a/original/man3/getprotobyname_r.3 b/original/man3/getprotobyname_r.3 new file mode 100644 index 00000000..9936ea82 --- /dev/null +++ b/original/man3/getprotobyname_r.3 @@ -0,0 +1 @@ +.so man3/getprotoent_r.3 diff --git a/original/man3/getprotobynumber.3 b/original/man3/getprotobynumber.3 new file mode 100644 index 00000000..f8cb4bba --- /dev/null +++ b/original/man3/getprotobynumber.3 @@ -0,0 +1 @@ +.so man3/getprotoent.3 diff --git a/original/man3/getprotobynumber_r.3 b/original/man3/getprotobynumber_r.3 new file mode 100644 index 00000000..9936ea82 --- /dev/null +++ b/original/man3/getprotobynumber_r.3 @@ -0,0 +1 @@ +.so man3/getprotoent_r.3 diff --git a/original/man3/getprotoent.3 b/original/man3/getprotoent.3 new file mode 100644 index 00000000..372c52bb --- /dev/null +++ b/original/man3/getprotoent.3 @@ -0,0 +1,126 @@ +.\" 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 Sat Jul 24 19:26:03 1993 by Rik Faith (faith@cs.unc.edu) +.TH GETPROTOENT 3 2008-08-19 "GNU" "Linux Programmer's Manual" +.SH NAME +getprotoent, getprotobyname, getprotobynumber, setprotoent, +endprotoent \- get protocol entry +.SH SYNOPSIS +.nf +.B #include +.sp +.B struct protoent *getprotoent(void); +.sp +.BI "struct protoent *getprotobyname(const char *" name ); +.sp +.BI "struct protoent *getprotobynumber(int " proto ); +.sp +.BI "void setprotoent(int " stayopen ); +.sp +.B void endprotoent(void); +.fi +.SH DESCRIPTION +The +.BR getprotoent () +function reads the next entry from the protocols database (see +.BR protocols (5)) +and returns a \fIprotoent\fP structure +containing the broken-out fields from the entry. +A connection is opened to the database if necessary. +.PP +The +.BR getprotobyname () +function returns a \fIprotoent\fP structure +for the entry from the database +that matches the protocol name \fIname\fP. +A connection is opened to the database if necessary. +.PP +The +.BR getprotobynumber () +function returns a \fIprotoent\fP structure +for the entry from the database +that matches the protocol number \fInumber\fP. +A connection is opened to the database if necessary. +.PP +The +.BR setprotoent () +function opens a connection to the database, +and sets the next entry to the first entry. +If \fIstayopen\fP is nonzero, +then the connection to the database +will not be closed between calls to one of the +.BR getproto* () +functions. +.PP +The +.BR endprotoent () +function closes the connection to the database. +.PP +The \fIprotoent\fP structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct protoent { + char *p_name; /* official protocol name */ + char **p_aliases; /* alias list */ + int p_proto; /* protocol number */ +} +.fi +.in +.PP +The members of the \fIprotoent\fP structure are: +.TP +.I p_name +The official name of the protocol. +.TP +.I p_aliases +A NULL-terminated list of alternative names for the protocol. +.TP +.I p_proto +The protocol number. +.SH "RETURN VALUE" +The +.BR getprotoent (), +.BR getprotobyname () +and +.BR getprotobynumber () +functions return a pointer to a +statically allocated \fIprotoent\fP structure, or a NULL pointer if an +error occurs or the end of the file is reached. +.SH FILES +.PD 0 +.TP +.I /etc/protocols +protocol database file +.PD +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +.SH "SEE ALSO" +.BR getnetent (3), +.BR getprotoent_r (3), +.BR getservent (3), +.BR protocols (5) diff --git a/original/man3/getprotoent_r.3 b/original/man3/getprotoent_r.3 new file mode 100644 index 00000000..a7fa146f --- /dev/null +++ b/original/man3/getprotoent_r.3 @@ -0,0 +1,235 @@ +.\" 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. +.\" +.TH GETPROTOENT_R 3 2008-08-19 "GNU" "Linux Programmer's Manual" +.SH NAME +getprotoent_r, getprotobyname_r, getprotobynumber_r \- get +protocol entry (reentrant) +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int getprotoent_r(struct protoent *" result_buf ", char *" buf , +.BI " size_t " buflen ", struct protoent **" result ); +.sp +.BI "int getprotobyname_r(const char *" name , +.BI " struct protoent *" result_buf ", char *" buf , +.BI " size_t " buflen ", struct protoent **" result ); +.sp +.BI "int getprotobynumber_r(int " proto , +.BI " struct protoent *" result_buf ", char *" buf , +.BI " size_t " buflen ", struct protoent **" result ); +.sp +.fi +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.ad l +.in +.sp +.BR getprotoent_r (), +.BR getprotobyname_r (), +.BR getprotobynumber_r (): +_BSD_SOURCE || _SVID_SOURCE +.ad b +.SH DESCRIPTION +The +.BR getprotoent_r (), +.BR getprotobyname_r (), +and +.BR getprotobynumber_r () +functions are the reentrant equivalents of, respectively, +.BR getprotoent (3), +.BR getprotobyname (3), +and +.BR getprotobynumber (3). +They differ in the way that the +.I protoent +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 +.I protoent +structure as the function result, +these functions copy the structure into the location pointed to by +.IR result_buf . + +The +.I buf +array is used to store the string fields pointed to by the returned +.I protoent +structure. +(The nonreentrant functions allocate these strings in static storage.) +The size of this array is specified in +.IR buflen . +If +.I buf +is too small, the call fails with the error +.BR ERANGE , +and the caller must try again with a larger buffer. +(A buffer of length 1024 bytes should be sufficient for most applications.) +.\" 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 + +If the function call successfully obtains a protocol record, then +.I *result +is set pointing to +.IR result_buf ; +otherwise, +.I *result +is set to NULL. +.SH "RETURN VALUE" +On success, these functions return 0. +On error, a positive error number is returned. + +On error, record not found +.RB ( getprotobyname_r (), +.BR getprotobynumber_r ()), +or end of input +.RB ( getprotoent_r ()) +.I result +is set to NULL. +.SH ERRORS +.TP +.B ENOENT +.RB ( getprotoent_r ()) +No more records in database. +.TP +.B ERANGE +.I buf +is too small. +Try again with a larger buffer +(and increased +.IR buflen ). +.SH "CONFORMING TO" +These functions are GNU extensions. +Functions with similar names exist on some other systems, +though typically with different calling signatures. +.SH EXAMPLE +The program below uses +.BR getprotobyname_r () +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 +.IR buflen ; +if +.BR getprotobyname_r () +fails with the error +.BR ERANGE , +the program retries with larger buffer sizes. +The following shell session shows a couple of sample runs: +.in +4n +.nf + +.RB "$" " ./a.out tcp 1" +ERANGE! Retrying with larger buffer +getprotobyname_r() returned: 0 (success) (buflen=78) +p_name=tcp; p_proto=6; aliases=TCP +.RB "$" " ./a.out xxx 1" +ERANGE! Retrying with larger buffer +getprotobyname_r() returned: 0 (success) (buflen=100) +Call failed/record not found +.fi +.in +.SS Program source +\& +.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]\\n", argv[0]); + exit(EXIT_FAILURE); + } + + buflen = 1024; + if (argc > 2) + buflen = atoi(argv[2]); + + if (buflen > MAX_BUF) { + printf("Exceeded buffer limit (%d)\\n", 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\\n"); + 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)\\n", MAX_BUF); + exit(EXIT_FAILURE); + } + } + } while (s == ERANGE); + + printf("getprotobyname_r() returned: %s (buflen=%d)\\n", + (s == 0) ? "0 (success)" : (s == ENOENT) ? "ENOENT" : + strerror(s), buflen); + + if (s != 0 || result == NULL) { + printf("Call failed/record not found\\n"); + 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("\\n"); + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR getprotoent (3), +.BR protocols (5) diff --git a/original/man3/getpt.3 b/original/man3/getpt.3 new file mode 100644 index 00000000..a9e1af82 --- /dev/null +++ b/original/man3/getpt.3 @@ -0,0 +1,52 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This man page was written by Jeremy Phelps . +.\" Redistribute and modify at will. +.\" +.TH GETPT 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.SH NAME +getpt \- open the pseudo-terminal master (PTM) +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.B "int getpt(void);" +.fi +.SH DESCRIPTION +.BR getpt () +opens a pseudo-terminal master and returns its file descriptor. +It is equivalent to +.nf + + open(/dev/ptmx, O_RDWR | O_NOCTTY); + +.fi +on Linux systems, though the pseudo-terminal master is located +elsewhere on some systems that use GNU Libc. +.SH "RETURN VALUE" +.BR getpt () +returns an open file descriptor upon successful completion. +Otherwise, it +returns \-1 and sets +.I errno +to indicate the error. +.SH ERRORS +.BR getpt () +can fail with various errors described in +.BR open (2). +.SH VERSIONS +.BR getpt () +is provided in glibc since version 2.1. +.SH CONFORMING TO +.BR getpt () +is glibc-specific; +use +.BR posix_openpt (3) +instead. +.SH "SEE ALSO" +.BR grantpt (3), +.BR posix_openpt (3), +.BR ptsname (3), +.BR unlockpt (3), +.BR ptmx (4), +.BR pty (7) diff --git a/original/man3/getpw.3 b/original/man3/getpw.3 new file mode 100644 index 00000000..9f0a16b6 --- /dev/null +++ b/original/man3/getpw.3 @@ -0,0 +1,108 @@ +.\" 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 Sat Jul 24 19:23:25 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon May 27 21:37:47 1996 by Martin Schulze (joey@linux.de) +.\" +.TH GETPW 3 2007-12-12 "GNU" "Linux Programmer's Manual" +.SH NAME +getpw \- Re-construct password line entry +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.B #include +.sp +.BI "int getpw(uid_t " uid ", char *" buf ); +.fi +.SH DESCRIPTION +The +.BR getpw () +function reconstructs the password line entry for +the given user ID \fIuid\fP in the buffer \fIbuf\fP. +The returned buffer contains a line of format +.sp +.RS +.B name:passwd:uid:gid:gecos:dir:shell +.RE +.PP +The \fIpasswd\fP structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct passwd { + char *pw_name; /* username */ + char *pw_passwd; /* user password */ + uid_t pw_uid; /* user ID */ + gid_t pw_gid; /* group ID */ + char *pw_gecos; /* real name */ + char *pw_dir; /* home directory */ + char *pw_shell; /* shell program */ +}; +.fi +.in +.SH "RETURN VALUE" +The +.BR getpw () +function returns 0 on success; on error, it returns \-1, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +.I buf +is NULL. +.TP +.B ENOENT +No user corresponding to +.IR uid . +.TP +.B ENOMEM +Insufficient memory to allocate +.I passwd +structure. +.SH FILES +.TP +.I /etc/passwd +password database file +.SH "CONFORMING TO" +SVr2. +.SH BUGS +The +.BR getpw () +function is dangerous as it may overflow the provided buffer +.IR buf . +It is obsoleted by +.BR getpwuid (3). +.SH "SEE ALSO" +.BR endpwent (3), +.BR fgetpwent (3), +.BR getpwent (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR putpwent (3), +.BR setpwent (3), +.BR passwd (5) diff --git a/original/man3/getpwent.3 b/original/man3/getpwent.3 new file mode 100644 index 00000000..80cc5ab4 --- /dev/null +++ b/original/man3/getpwent.3 @@ -0,0 +1,154 @@ +.\" 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 Sat Jul 24 19:22:14 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon May 27 21:37:47 1996 by Martin Schulze (joey@linux.de) +.\" +.TH GETPWENT 3 2009-03-30 "GNU" "Linux Programmer's Manual" +.SH NAME +getpwent, setpwent, endpwent \- get password file entry +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.B struct passwd *getpwent(void); +.sp +.B void setpwent(void); +.sp +.B void endpwent(void); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR getpwent (), +.BR setpwent (), +.BR endpwent (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE > = 500 +.ad b +.SH DESCRIPTION +The +.BR getpwent () +function returns a pointer to a structure containing +the broken-out fields of a record from the password database +(e.g., the local password file +.IR /etc/passwd , +NIS, and LDAP). +The first time it +is called it returns the first entry; thereafter, it returns successive +entries. +.PP +The +.BR setpwent () +function rewinds to the beginning +of the password database. +.PP +The +.BR endpwent () +function is used to close the password database +after all processing has been performed. +.PP +The \fIpasswd\fP structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct passwd { + char *pw_name; /* username */ + char *pw_passwd; /* user password */ + uid_t pw_uid; /* user ID */ + gid_t pw_gid; /* group ID */ + char *pw_gecos; /* real name */ + char *pw_dir; /* home directory */ + char *pw_shell; /* shell program */ +}; +.fi +.in +.SH "RETURN VALUE" +The +.BR getpwent () +function returns a pointer to a +.I passwd +structure, or NULL if +there are no more entries or an error occurs. +If an error occurs, +.I errno +is set appropriately. +If one wants to check +.I errno +after the call, it should be set to zero before the call. + +The return value may point to a static area, and may be overwritten +by subsequent calls to +.BR getpwent (), +.BR getpwnam (3), +or +.BR getpwuid (3). +(Do not pass the returned pointer to +.BR free (3).) +.SH ERRORS +.TP +.B EINTR +A signal was caught. +.TP +.B EIO +I/O error. +.TP +.B EMFILE +The maximum number +.RB ( OPEN_MAX ) +of files was open already in the calling process. +.TP +.B ENFILE +The maximum number of files was open already in the system. +.TP +.B ENOMEM +.\" not in POSIX +Insufficient memory to allocate +.I passwd +structure. +.\" to allocate the passwd structure, or to allocate buffers +.TP +.B ERANGE +Insufficient buffer space supplied. +.SH FILES +.TP +.I /etc/passwd +local password database file +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH "SEE ALSO" +.BR fgetpwent (3), +.BR getpw (3), +.BR getpwent_r (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR putpwent (3), +.BR passwd (5) diff --git a/original/man3/getpwent_r.3 b/original/man3/getpwent_r.3 new file mode 100644 index 00000000..b8e4406b --- /dev/null +++ b/original/man3/getpwent_r.3 @@ -0,0 +1,183 @@ +.\" 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. +.\" +.TH GETPWENT_R 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +getpwent_r, fgetpwent_r \- get passwd file entry reentrantly +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int getpwent_r(struct passwd *" pwbuf ", char *" buf , +.br +.BI " size_t " buflen ", struct passwd **" pwbufp ); +.sp +.BI "int fgetpwent_r(FILE *" fp ", struct passwd *" pwbuf ", char *" buf , +.br +.BI " size_t " buflen ", struct passwd **" pwbufp ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR getpwent_r (), +_BSD_SOURCE || _SVID_SOURCE +.br +.BR fgetpwent_r (): +_SVID_SOURCE +.SH DESCRIPTION +The functions +.BR getpwent_r () +and +.BR fgetpwent_r () +are the reentrant versions of +.BR getpwent (3) +and +.BR fgetpwent (3). +The former reads the next passwd entry from the stream initialized by +.BR setpwent (3). +The latter reads the next passwd entry from the stream +.IR fp . +.PP +The \fIpasswd\fP structure is defined in +.I +as follows: +.sp +.in +4n +.nf +struct passwd { + char *pw_name; /* username */ + char *pw_passwd; /* user password */ + uid_t pw_uid; /* user ID */ + gid_t pw_gid; /* group ID */ + char *pw_gecos; /* real name */ + char *pw_dir; /* home directory */ + char *pw_shell; /* shell program */ +}; +.fi +.in +.sp +The nonreentrant functions return a pointer to static storage, +where this static storage contains further pointers to user +name, password, gecos field, home directory and shell. +The reentrant functions described here return all of that in +caller-provided buffers. +First of all there is the buffer +.I pwbuf +that can hold a \fIstruct passwd\fP. +And next the buffer +.I buf +of size +.I buflen +that can hold additional strings. +The result of these functions, the \fIstruct passwd\fP read from the stream, +is stored in the provided buffer +.IR *pwbuf , +and a pointer to this \fIstruct passwd\fP is returned in +.IR *pwbufp . +.SH "RETURN VALUE" +On success, these functions return 0 and +.I *pwbufp +is a pointer to the \fIstruct passwd\fP. +On error, these functions return an error value and +.I *pwbufp +is NULL. +.SH ERRORS +.TP +.B ENOENT +No more entries. +.TP +.B ERANGE +Insufficient buffer space supplied. +Try again with larger buffer. +.SH "CONFORMING TO" +These functions are GNU extensions, done in a style resembling +the POSIX version of functions like +.BR getpwnam_r (3). +Other systems use prototype +.sp +.nf +.in +4n +struct passwd * +getpwent_r(struct passwd *pwd, char *buf, int buflen); +.in +.fi +.sp +or, better, +.sp +.nf +.in +4n +int +getpwent_r(struct passwd *pwd, char *buf, int buflen, + FILE **pw_fp); +.in +.fi +.SH NOTES +The function +.BR getpwent_r () +is not really reentrant since it shares the reading position +in the stream with all other threads. +.SH EXAMPLE +.nf +#define _GNU_SOURCE +#include +#include +#define BUFLEN 4096 + +int +main(void) +{ + struct passwd pw, *pwp; + char buf[BUFLEN]; + int i; + + setpwent(); + while (1) { + i = getpwent_r(&pw, buf, BUFLEN, &pwp); + if (i) + break; + printf("%s (%d)\etHOME %s\etSHELL %s\en", pwp\->pw_name, + pwp\->pw_uid, pwp\->pw_dir, pwp\->pw_shell); + } + endpwent(); + exit(EXIT_SUCCESS); +} +.fi +.\" perhaps add error checking - should use strerror_r +.\" #include +.\" #include +.\" if (i) { +.\" if (i == ENOENT) +.\" break; +.\" printf("getpwent_r: %s", strerror(i)); +.\" exit(EXIT_SUCCESS); +.\" } +.SH "SEE ALSO" +.BR fgetpwent (3), +.BR getpw (3), +.BR getpwent (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR putpwent (3), +.BR passwd (5) diff --git a/original/man3/getpwnam.3 b/original/man3/getpwnam.3 new file mode 100644 index 00000000..4246de68 --- /dev/null +++ b/original/man3/getpwnam.3 @@ -0,0 +1,302 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's "POSIX Programmer's Guide" (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1996-05-27 by Martin Schulze (joey@linux.de) +.\" Modified 2003-11-15 by aeb +.\" 2008-11-07, mtk, Added an example program for getpwnam_r(). +.\" +.TH GETPWNAM 3 2009-03-30 "GNU" "Linux Programmer's Manual" +.SH NAME +getpwnam, getpwnam_r, getpwuid, getpwuid_r \- get password file entry +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "struct passwd *getpwnam(const char *" name ); +.sp +.BI "struct passwd *getpwuid(uid_t " uid ); +.sp +.BI "int getpwnam_r(const char *" name ", struct passwd *" pwd , +.br +.BI " char *" buf ", size_t " buflen ", struct passwd **" result ); +.sp +.BI "int getpwuid_r(uid_t " uid ", struct passwd *" pwd , +.br +.BI " char *" buf ", size_t " buflen ", struct passwd **" result ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR getpwnam_r (), +.BR getpwuid_r (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +The +.BR getpwnam () +function returns a pointer to a structure containing +the broken-out fields of the record in the password database +(e.g., the local password file +.IR /etc/passwd , +NIS, and LDAP) +that matches the username +.IR name . +.PP +The +.BR getpwuid () +function returns a pointer to a structure containing +the broken-out fields of the record in the password database +that matches the user ID +.IR uid . +.PP +The +.BR getpwnam_r () +and +.BR getpwuid_r () +functions obtain the same information, but store the retrieved +.I passwd +structure in the space pointed to by +.IR pwd . +This +.I passwd +structure contains pointers to strings, and these strings +are stored in the buffer +.I buf +of size +.IR buflen . +A pointer to the result (in case of success) or NULL (in case no entry +was found or an error occurred) is stored in +.IR *result . +.PP +The \fIpasswd\fP structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct passwd { + char *pw_name; /* username */ + char *pw_passwd; /* user password */ + uid_t pw_uid; /* user ID */ + gid_t pw_gid; /* group ID */ + char *pw_gecos; /* real name */ + char *pw_dir; /* home directory */ + char *pw_shell; /* shell program */ +}; +.fi +.in +.PP +The maximum needed size for +.I buf +can be found using +.BR sysconf (3) +with the argument +.BR _SC_GETPW_R_SIZE_MAX . +.SH "RETURN VALUE" +The +.BR getpwnam () +and +.BR getpwuid () +functions return a pointer to a +.I passwd +structure, or NULL if the matching entry is not found or +an error occurs. +If an error occurs, +.I errno +is set appropriately. +If one wants to check +.I errno +after the call, it should be set to zero before the call. +.LP +The return value may point to a static area, and may be overwritten +by subsequent calls to +.BR getpwent (3), +.BR getpwnam (), +or +.BR getpwuid (). +(Do not pass the returned pointer to +.BR free (3).) +.LP +On success, +.BR getpwnam_r () +and +.BR getpwuid_r () +return zero, and set +.IR *result +to +.IR pwd . +If no matching password record was found, +these functions return 0 and store NULL in +.IR *result . +In case of error, an error number is returned, and NULL is stored in +.IR *result . +.SH ERRORS +.TP +.BR 0 " or " ENOENT " or " ESRCH " or " EBADF " or " EPERM " or ... " +The given +.I name +or +.I uid +was not found. +.TP +.B EINTR +A signal was caught. +.TP +.B EIO +I/O error. +.TP +.B EMFILE +The maximum number +.RB ( OPEN_MAX ) +of files was open already in the calling process. +.TP +.B ENFILE +The maximum number of files was open already in the system. +.TP +.B ENOMEM +.\" not in POSIX +Insufficient memory to allocate +.I passwd +structure. +.\" This structure is static, allocated 0 or 1 times. No memory leak. (libc45) +.TP +.B ERANGE +Insufficient buffer space supplied. +.SH FILES +.TP +.I /etc/passwd +local password database file +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH NOTES +The formulation given above under "RETURN VALUE" is from POSIX.1-2001. +It does not call "not found" an error, and hence does not specify what value +.I errno +might have in this situation. +But that makes it impossible to recognize +errors. +One might argue that according to POSIX +.I errno +should be left unchanged if an entry is not found. +Experiments on various +Unix-like systems show that lots of different values occur in this +situation: 0, ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM and probably others. +.\" more precisely: +.\" AIX 5.1 - gives ESRCH +.\" OSF1 4.0g - gives EWOULDBLOCK +.\" libc, glibc up to version 2.6, Irix 6.5 - give ENOENT +.\" glibc since version 2.7 - give 0 +.\" FreeBSD 4.8, OpenBSD 3.2, NetBSD 1.6 - give EPERM +.\" SunOS 5.8 - gives EBADF +.\" Tru64 5.1b, HP-UX-11i, SunOS 5.7 - give 0 + +The +.I pw_dir +field contains the name of the initial working directory of the user. +Login programs use the value of this field to initialize the +.B HOME +environment variable for the login shell. +An application that wants to determine its user's home directory +should inspect the value of +.B HOME +(rather than the value +.IR getpwuid(getuid())\->pw_dir ) +since this allows the user to modify their notion of +"the home directory" during a login session. +To determine the (initial) home directory of another user, +it is necessary to use +.I getpwnam("username")\->pw_dir +or similar. +.SH EXAMPLE +The program below demonstrates the use of +.BR getpwnam_r () +to find the full username and user ID for the username +supplied as a command-line argument. + +.nf +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct passwd pwd; + struct passwd *result; + char *buf; + size_t bufsize; + int s; + + if (argc != 2) { + fprintf(stderr, "Usage: %s username\\n", argv[0]); + exit(EXIT_FAILURE); + } + + bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); + if (bufsize == \-1) /* Value was indeterminate */ + bufsize = 16384; /* Should be more than enough */ + + buf = malloc(bufsize); + if (buf == NULL) { + perror("malloc"); + exit(EXIT_FAILURE); + } + + s = getpwnam_r(argv[1], &pwd, buf, bufsize, &result); + if (result == NULL) { + if (s == 0) + printf("Not found\\n"); + else { + errno = s; + perror("getpwnam_r"); + } + exit(EXIT_FAILURE); + } + + printf("Name: %s; UID: %ld\\n", pwd.pw_gecos, (long) pwd.pw_uid); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR endpwent (3), +.BR fgetpwent (3), +.BR getgrnam (3), +.BR getpw (3), +.BR getpwent (3), +.BR getspnam (3), +.BR putpwent (3), +.BR setpwent (3), +.BR passwd (5) diff --git a/original/man3/getpwnam_r.3 b/original/man3/getpwnam_r.3 new file mode 100644 index 00000000..e83dcaf7 --- /dev/null +++ b/original/man3/getpwnam_r.3 @@ -0,0 +1 @@ +.so man3/getpwnam.3 diff --git a/original/man3/getpwuid.3 b/original/man3/getpwuid.3 new file mode 100644 index 00000000..e83dcaf7 --- /dev/null +++ b/original/man3/getpwuid.3 @@ -0,0 +1 @@ +.so man3/getpwnam.3 diff --git a/original/man3/getpwuid_r.3 b/original/man3/getpwuid_r.3 new file mode 100644 index 00000000..e83dcaf7 --- /dev/null +++ b/original/man3/getpwuid_r.3 @@ -0,0 +1 @@ +.so man3/getpwnam.3 diff --git a/original/man3/getrpcbyname.3 b/original/man3/getrpcbyname.3 new file mode 100644 index 00000000..923085e2 --- /dev/null +++ b/original/man3/getrpcbyname.3 @@ -0,0 +1 @@ +.so man3/getrpcent.3 diff --git a/original/man3/getrpcbyname_r.3 b/original/man3/getrpcbyname_r.3 new file mode 100644 index 00000000..78323ea9 --- /dev/null +++ b/original/man3/getrpcbyname_r.3 @@ -0,0 +1 @@ +.so man3/getrpcent_r.3 diff --git a/original/man3/getrpcbynumber.3 b/original/man3/getrpcbynumber.3 new file mode 100644 index 00000000..923085e2 --- /dev/null +++ b/original/man3/getrpcbynumber.3 @@ -0,0 +1 @@ +.so man3/getrpcent.3 diff --git a/original/man3/getrpcbynumber_r.3 b/original/man3/getrpcbynumber_r.3 new file mode 100644 index 00000000..78323ea9 --- /dev/null +++ b/original/man3/getrpcbynumber_r.3 @@ -0,0 +1 @@ +.so man3/getrpcent_r.3 diff --git a/original/man3/getrpcent.3 b/original/man3/getrpcent.3 new file mode 100644 index 00000000..3edbd20c --- /dev/null +++ b/original/man3/getrpcent.3 @@ -0,0 +1,104 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI +.TH GETRPCENT 3 2008-08-19 "" "Linux Programmer's Manual" +.SH NAME +getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent \- get +RPC entry +.SH SYNOPSIS +.nf +.B #include + +.BI "struct rpcent *getrpcent(void);" + +.BI "struct rpcent *getrpcbyname(char *" name ); + +.BI "struct rpcent *getrpcbynumber(int " number ); + +.BI "void setrpcent(int " stayopen ); + +.BI "void endrpcent(void);" +.fi +.SH DESCRIPTION +.LP +.BR getrpcent (), +.BR getrpcbyname (), +and +.BR getrpcbynumber () +each return a pointer to an object with the +following structure containing the broken-out +fields of an entry in the RPC program number data base. +.in +4n +.nf + +struct rpcent { + char *r_name; /* name of server for this RPC program */ + char **r_aliases; /* alias list */ + long r_number; /* RPC program number */ +}; +.fi +.in +.LP +The members of this structure are: +.RS 4 +.TP 12 +.I r_name +The name of the server for this RPC program. +.TP +.I r_aliases +A NULL-terminated list of alternate names for the RPC program. +.TP +.I r_number +The RPC program number for this service. +.RE +.LP +.BR getrpcent () +reads the next entry from the database. +A connection is opened to the database if necessary. +.LP +.BR setrpcent () +function opens a connection to the database, +and sets the next entry to the first entry. +If \fIstayopen\fP is nonzero, +then the connection to the database +will not be closed between calls to one of the +.BR getrpc* () +functions. +.LP +The +.BR endrpcent () +function closes the connection to the database. +.LP +.BR getrpcbyname () +and +.BR getrpcbynumber () +sequentially search from the beginning +of the file until a matching RPC program name or +program number is found, or until end-of-file is encountered. +.SH RETURN VALUE +On success, +.BR getrpcent (), +.BR getrpcbyname (), +and +.BR getrpcbynumber () +return a pointer to a statically allocated +.I rpcent +structure. +A NULL pointer is returned on EOF or error. +.SH FILES +.TP +.I /etc/rpc +RPC program number database. +.SH "CONFORMING TO" +Not in POSIX.1-2001. +Present on the BSDs, Solaris, and many other systems. +.SH BUGS +All information +is contained in a static area +so it must be copied if it is +to be saved. +.SH "SEE ALSO" +.BR getrpcent_r (3), +.BR rpc (5), +.BR rpcinfo (8), +.BR ypserv (8) diff --git a/original/man3/getrpcent_r.3 b/original/man3/getrpcent_r.3 new file mode 100644 index 00000000..098b8ba3 --- /dev/null +++ b/original/man3/getrpcent_r.3 @@ -0,0 +1,132 @@ +.\" 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. +.\" +.TH GETRPCENT_R 3 2008-08-19 "GNU" "Linux Programmer's Manual" +.SH NAME +getrpcent_r, getrpcbyname_r, getrpcbynumber_r \- get +RPC entry (reentrant) +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int getrpcent_r(struct rpcent *" result_buf ", char *" buf , +.BI " size_t " buflen ", struct rpcent **" result ); +.sp +.BI "int getrpcbyname_r(const char *" name , +.BI " struct rpcent *" result_buf ", char *" buf , +.BI " size_t " buflen ", struct rpcent **" result ); +.sp +.BI "int getrpcbynumber_r(int " number , +.BI " struct rpcent *" result_buf ", char *" buf , +.BI " size_t " buflen ", struct rpcent **" result ); +.sp +.fi +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.ad l +.in +.sp +.BR getrpcent_r (), +.BR getrpcbyname_r (), +.BR getrpcbynumber_r (): +_BSD_SOURCE || _SVID_SOURCE +.ad b +.SH DESCRIPTION +The +.BR getrpcent_r (), +.BR getrpcbyname_r (), +and +.BR getrpcbynumber_r () +functions are the reentrant equivalents of, respectively, +.BR getrpcent (3), +.BR getrpcbyname (3), +and +.BR getrpcbynumber (3). +They differ in the way that the +.I rpcent +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 +.I rpcent +structure as the function result, +these functions copy the structure into the location pointed to by +.IR result_buf . + +The +.I buf +array is used to store the string fields pointed to by the returned +.I rpcent +structure. +(The nonreentrant functions allocate these strings in static storage.) +The size of this array is specified in +.IR buflen . +If +.I buf +is too small, the call fails with the error +.BR ERANGE , +and the caller must try again with a larger buffer. +(A buffer of length 1024 bytes should be sufficient for most applications.) +.\" I can find no information on the required/recommended buffer size; +.\" the nonreentrant functions use a 1024 byte buffer -- mtk. + +If the function call successfully obtains an RPC record, then +.I *result +is set pointing to +.IR result_buf ; +otherwise, +.I *result +is set to NULL. +.SH "RETURN VALUE" +On success, these functions return 0. +On error, a positive error number is returned. + +On error, record not found +.RB ( getrpcbyname_r (), +.BR getrpcbynumber_r ()), +or end of input +.RB ( getrpcent_r ()) +.I result +is set to NULL. +.SH ERRORS +.TP +.B ENOENT +.RB ( getrpcent_r ()) +No more records in database. +.TP +.B ERANGE +.I buf +is too small. +Try again with a larger buffer +(and increased +.IR buflen ). +.SH "CONFORMING TO" +These functions are GNU extensions. +Functions with similar names exist on some other systems, +though typically with different calling signatures. +.SH "SEE ALSO" +.BR getrpcent (3), +.BR rpc (5) diff --git a/original/man3/getrpcport.3 b/original/man3/getrpcport.3 new file mode 100644 index 00000000..01c2ab0e --- /dev/null +++ b/original/man3/getrpcport.3 @@ -0,0 +1,34 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)getrpcport.3r 2.2 88/08/02 4.0 RPCSRC; from 1.12 88/02/26 SMI +.TH GETRPCPORT 3 2007-12-23 "" "Linux Programmer's Manual" +.SH NAME +getrpcport \- get RPC port number +.SH SYNOPSIS +.nf +.BI "int getrpcport(char *" host ", int " prognum ", int " versnum \ +", int " proto ); +.fi +.SH DESCRIPTION +.BR getrpcport () +returns the port number for version +.I versnum +of the RPC program +.I prognum +running on +.I host +and using protocol +.IR proto . +It returns 0 if it cannot contact the portmapper, or if +.I prognum +is not registered. +If +.I prognum +is registered but not with version +.IR versnum , +it will still return a port number (for some version of the program) +indicating that the program is indeed registered. +The version mismatch will be detected upon the first call to the service. +.SH "CONFORMING TO" +Not in POSIX.1-2001. +Present on the BSDs, Solaris, and many other systems. diff --git a/original/man3/gets.3 b/original/man3/gets.3 new file mode 100644 index 00000000..f4949e4e --- /dev/null +++ b/original/man3/gets.3 @@ -0,0 +1,179 @@ +.\" 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 Wed Jul 28 11:12:07 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Sep 8 15:48:13 1995 by Andries Brouwer (aeb@cwi.nl) +.TH GETS 3 2008-08-06 "GNU" "Linux Programmer's Manual" +.SH NAME +fgetc, fgets, getc, getchar, gets, ungetc \- input of characters and strings +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int fgetc(FILE *" stream ); + +.BI "char *fgets(char *" "s" ", int " "size" ", FILE *" "stream" ); + +.BI "int getc(FILE *" stream ); + +.B "int getchar(void);" + +.BI "char *gets(char *" "s" ); + +.BI "int ungetc(int " c ", FILE *" stream ); +.fi +.SH DESCRIPTION +.BR fgetc () +reads the next character from +.I stream +and returns it as an +.I unsigned char +cast to an +.IR int , +or +.B EOF +on end of file or error. +.PP +.BR getc () +is equivalent to +.BR fgetc () +except that it may be implemented as a macro which evaluates +.I stream +more than once. +.PP +.BR getchar () +is equivalent to +.BI "getc(" stdin ) \fR. +.PP +.BR gets () +reads a line from +.I stdin +into the buffer pointed to by +.I s +until either a terminating newline or +.BR EOF , +which it replaces with +.BR \(aq\e0\(aq . +No check for buffer overrun is performed (see BUGS below). +.PP +.BR fgets () +reads in at most one less than +.I size +characters from +.I stream +and stores them into the buffer pointed to by +.IR s . +Reading stops after an +.B EOF +or a newline. +If a newline is read, it is stored into the buffer. +A +.B \(aq\e0\(aq +is stored after the last character in the buffer. +.PP +.BR ungetc () +pushes +.I c +back to +.IR stream , +cast to +.IR "unsigned char" , +where it is available for subsequent read operations. +Pushed-back characters +will be returned in reverse order; only one pushback is guaranteed. +.PP +Calls to the functions described here can be mixed with each other and with +calls to other input functions from the +.I stdio +library for the same input stream. +.PP +For nonlocking counterparts, see +.BR unlocked_stdio (3). +.SH "RETURN VALUE" +.BR fgetc (), +.BR getc () +and +.BR getchar () +return the character read as an +.I unsigned char +cast to an +.I int +or +.B EOF +on end of file or error. +.PP +.BR gets () +and +.BR fgets () +return +.I s +on success, and NULL +on error or when end of file occurs while no characters have been read. +.PP +.BR ungetc () +returns +.I c +on success, or +.B EOF +on error. +.SH "CONFORMING TO" +C89, C99, POSIX.1-2001. +LSB deprecates +.BR gets (). +POSIX.1-2008 removes the specification of +.BR gets (). +.SH BUGS +Never use +.BR gets (). +Because it is impossible to tell without knowing the data in advance how many +characters +.BR gets () +will read, and because +.BR gets () +will continue to store characters past the end of the buffer, +it is extremely dangerous to use. +It has been used to break computer security. +Use +.BR fgets () +instead. +.PP +It is not advisable to mix calls to input functions from the +.I stdio +library with low-level calls to +.BR read (2) +for the file descriptor associated with the input stream; the results +will be undefined and very probably not what you want. +.SH "SEE ALSO" +.BR read (2), +.BR write (2), +.BR ferror (3), +.BR fgetwc (3), +.BR fgetws (3), +.BR fopen (3), +.BR fread (3), +.BR fseek (3), +.BR getline (3), +.BR getwchar (3), +.BR puts (3), +.BR scanf (3), +.BR ungetwc (3), +.BR unlocked_stdio (3) diff --git a/original/man3/getservbyname.3 b/original/man3/getservbyname.3 new file mode 100644 index 00000000..eaafb1c1 --- /dev/null +++ b/original/man3/getservbyname.3 @@ -0,0 +1 @@ +.so man3/getservent.3 diff --git a/original/man3/getservbyname_r.3 b/original/man3/getservbyname_r.3 new file mode 100644 index 00000000..b36a4426 --- /dev/null +++ b/original/man3/getservbyname_r.3 @@ -0,0 +1 @@ +.so man3/getservent_r.3 diff --git a/original/man3/getservbyport.3 b/original/man3/getservbyport.3 new file mode 100644 index 00000000..eaafb1c1 --- /dev/null +++ b/original/man3/getservbyport.3 @@ -0,0 +1 @@ +.so man3/getservent.3 diff --git a/original/man3/getservbyport_r.3 b/original/man3/getservbyport_r.3 new file mode 100644 index 00000000..b36a4426 --- /dev/null +++ b/original/man3/getservbyport_r.3 @@ -0,0 +1 @@ +.so man3/getservent_r.3 diff --git a/original/man3/getservent.3 b/original/man3/getservent.3 new file mode 100644 index 00000000..eb994093 --- /dev/null +++ b/original/man3/getservent.3 @@ -0,0 +1,135 @@ +.\" 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 Sat Jul 24 19:19:11 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Wed Oct 18 20:23:54 1995 by Martin Schulze +.\" Modified Mon Apr 22 01:50:54 1996 by Martin Schulze +.\" 2001-07-25 added a clause about NULL proto (Martin Michlmayr or David N. Welton) +.\" +.TH GETSERVENT 3 2008-08-19 "GNU" "Linux Programmer's Manual" +.SH NAME +getservent, getservbyname, getservbyport, setservent, endservent \- +get service entry +.SH SYNOPSIS +.nf +.B #include +.sp +.B struct servent *getservent(void); +.sp +.BI "struct servent *getservbyname(const char *" name ", const char *" proto ); +.sp +.BI "struct servent *getservbyport(int " port ", const char *" proto ); +.sp +.BI "void setservent(int " stayopen ); +.sp +.B void endservent(void); +.fi +.SH DESCRIPTION +The +.BR getservent () +function reads the next entry from the services database (see +.BR services (5)) +and returns a \fIservent\fP structure containing +the broken-out fields from the entry. +A connection is opened to the database if necessary. +.PP +The +.BR getservbyname () +function returns a \fIservent\fP structure +for the entry from the database +that matches the service \fIname\fP using protocol \fIproto\fP. +If \fIproto\fP is NULL, any protocol will be matched. +A connection is opened to the database if necessary. +.PP +The +.BR getservbyport () +function returns a \fIservent\fP structure +for the entry from the database +that matches the port \fIport\fP (given in network byte order) +using protocol \fIproto\fP. +If \fIproto\fP is NULL, any protocol will be matched. +A connection is opened to the database if necessary. +.PP +The +.BR setservent () +function opens a connection to the database, +and sets the next entry to the first entry. +If \fIstayopen\fP is nonzero, +then the connection to the database +will not be closed between calls to one of the +.BR getserv* () +functions. +.PP +The +.BR endservent () +function closes the connection to the database. +.PP +The \fIservent\fP structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct servent { + char *s_name; /* official service name */ + char **s_aliases; /* alias list */ + int s_port; /* port number */ + char *s_proto; /* protocol to use */ +} +.fi +.in +.PP +The members of the \fIservent\fP structure are: +.TP +.I s_name +The official name of the service. +.TP +.I s_aliases +A NULL-terminated list of alternative names for the service. +.TP +.I s_port +The port number for the service given in network byte order. +.TP +.I s_proto +The name of the protocol to use with this service. +.SH "RETURN VALUE" +The +.BR getservent (), +.BR getservbyname () +and +.BR getservbyport () +functions return a pointer to a +statically allocated \fIservent\fP structure, or a NULL pointer if an +error occurs or the end of the file is reached. +.SH FILES +.TP +.I /etc/services +services database file +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +.SH "SEE ALSO" +.BR getnetent (3), +.BR getprotoent (3), +.BR getservent_r (3), +.BR services (5) diff --git a/original/man3/getservent_r.3 b/original/man3/getservent_r.3 new file mode 100644 index 00000000..e87e6c7d --- /dev/null +++ b/original/man3/getservent_r.3 @@ -0,0 +1,239 @@ +.\" 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. +.\" +.TH GETSERVENT_R 3 2008-08-19 "GNU" "Linux Programmer's Manual" +.SH NAME +getservent_r, getservbyname_r, getservbyport_r \- get +service entry (reentrant) +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int getservent_r(struct servent *" result_buf ", char *" buf , +.BI " size_t " buflen ", struct servent **" result ); +.sp +.BI "int getservbyname_r(const char *" name ", const char *" proto , +.BI " struct servent *" result_buf ", char *" buf , +.BI " size_t " buflen ", struct servent **" result ); +.sp +.BI "int getservbyport_r(int " port ", const char *" proto , +.BI " struct servent *" result_buf ", char *" buf , +.BI " size_t " buflen ", struct servent **" result ); +.sp +.fi +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.ad l +.in +.sp +.BR getservent_r (), +.BR getservbyname_r (), +.BR getservbyport_r (): +_BSD_SOURCE || _SVID_SOURCE +.ad b +.SH DESCRIPTION +The +.BR getservent_r (), +.BR getservbyname_r (), +and +.BR getservbyport_r () +functions are the reentrant equivalents of, respectively, +.BR getservent (3), +.BR getservbyname (3), +and +.BR getservbyport (3). +They differ in the way that the +.I servent +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 +.I servent +structure as the function result, +these functions copy the structure into the location pointed to by +.IR result_buf . + +The +.I buf +array is used to store the string fields pointed to by the returned +.I servent +structure. +(The nonreentrant functions allocate these strings in static storage.) +The size of this array is specified in +.IR buflen . +If +.I buf +is too small, the call fails with the error +.BR ERANGE , +and the caller must try again with a larger buffer. +(A buffer of length 1024 bytes should be sufficient for most applications.) +.\" I can find no information on the required/recommended buffer size; +.\" the nonreentrant functions use a 1024 byte buffer -- mtk. + +If the function call successfully obtains a service record, then +.I *result +is set pointing to +.IR result_buf ; +otherwise, +.I *result +is set to NULL. +.SH "RETURN VALUE" +On success, these functions return 0. +On error, a positive error number is returned. + +On error, record not found +.RB ( getservbyname_r (), +.BR getservbyport_r ()), +or end of input +.RB ( getservent_r ()) +.I result +is set to NULL. +.SH ERRORS +.TP +.B ENOENT +.RB ( getservent_r ()) +No more records in database. +.TP +.B ERANGE +.I buf +is too small. +Try again with a larger buffer +(and increased +.IR buflen ). +.SH "CONFORMING TO" +These functions are GNU extensions. +Functions with similar names exist on some other systems, +though typically with different calling signatures. +.SH EXAMPLE +The program below uses +.BR getservbyport_r () +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 +.IR buflen ; +if +.BR getservbyport_r () +fails with the error +.BR ERANGE , +the program retries with larger buffer sizes. +The following shell session shows a couple of sample runs: +.in +4n +.nf + +.RB "$" " ./a.out 7 tcp 1" +ERANGE! Retrying with larger buffer +getservbyport_r() returned: 0 (success) (buflen=87) +s_name=echo; s_proto=tcp; s_port=7; aliases= +.RB "$" " ./a.out 77777 tcp" +getservbyport_r() returned: 0 (success) (buflen=1024) +Call failed/record not found +.fi +.in +.SS Program source +\& +.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]\\n", 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)\\n", 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\\n"); + 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)\\n", MAX_BUF); + exit(EXIT_FAILURE); + } + } + } while (s == ERANGE); + + printf("getservbyport_r() returned: %s (buflen=%d)\\n", + (s == 0) ? "0 (success)" : (s == ENOENT) ? "ENOENT" : + strerror(s), buflen); + + if (s != 0 || result == NULL) { + printf("Call failed/record not found\\n"); + 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("\\n"); + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR getservent (3), +.BR services (5) diff --git a/original/man3/getspent.3 b/original/man3/getspent.3 new file mode 100644 index 00000000..142c5a5c --- /dev/null +++ b/original/man3/getspent.3 @@ -0,0 +1 @@ +.so man3/getspnam.3 diff --git a/original/man3/getspent_r.3 b/original/man3/getspent_r.3 new file mode 100644 index 00000000..142c5a5c --- /dev/null +++ b/original/man3/getspent_r.3 @@ -0,0 +1 @@ +.so man3/getspnam.3 diff --git a/original/man3/getspnam.3 b/original/man3/getspnam.3 new file mode 100644 index 00000000..8914cee2 --- /dev/null +++ b/original/man3/getspnam.3 @@ -0,0 +1,246 @@ +.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) and +.\" Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" +.\" Distributed under GPL +.\" +.TH GETSPNAM 3 2010-02-25 "GNU" "Linux Programmer's Manual" +.SH NAME +getspnam, getspnam_r, getspent, getspent_r, setspent, endspent, +fgetspent, fgetspent_r, sgetspent, sgetspent_r, putspent, +lckpwdf, ulckpwdf \- get shadow password file entry +.SH SYNOPSIS +.nf +/* General shadow password file API */ +.br +.B #include +.sp +.BI "struct spwd *getspnam(const char *" name ); +.sp +.B struct spwd *getspent(void); +.sp +.B void setspent(void); +.sp +.B void endspent(void); +.sp +.BI "struct spwd *fgetspent(FILE *" fp ); +.sp +.BI "struct spwd *sgetspent(const char *" s ); +.sp +.BI "int putspent(struct spwd *" p ", FILE *" fp ); +.sp +.B int lckpwdf(void); +.sp +.B int ulckpwdf(void); +.sp +/* GNU extension */ +.br +.B #include +.sp +.BI "int getspent_r(struct spwd *" spbuf , +.br +.BI " char *" buf ", size_t " buflen ", struct spwd **" spbufp ); +.sp +.BI "int getspnam_r(const char *" name ", struct spwd *" spbuf , +.br +.BI " char *" buf ", size_t " buflen ", struct spwd **" spbufp ); +.sp +.BI "int fgetspent_r(FILE *" fp ", struct spwd *" spbuf , +.br +.BI " char *" buf ", size_t " buflen ", struct spwd **" spbufp ); +.sp +.BI "int sgetspent_r(const char *" s ", struct spwd *" spbuf , +.br +.BI " char *" buf ", size_t " buflen ", struct spwd **" spbufp ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR getspent_r (), +.BR getspnam_r (), +.BR fgetspent_r (), +.BR sgetspent_r (): +_BSD_SOURCE || _SVID_SOURCE +.ad b +.SH DESCRIPTION +Long ago it was considered safe to have encrypted passwords openly +visible in the password file. +When computers got faster and people +got more security-conscious, this was no longer acceptable. +Julianne Frances Haugh implemented the shadow password suite +that keeps the encrypted passwords in +the shadow password database +(e.g., the local shadow password file +.IR /etc/shadow , +NIS, and LDAP), +readable only by root. +.LP +The functions described below resemble those for +the traditional password database +(e.g., see +.BR getpwnam (3) +and +.BR getpwent (3)). +.\" FIXME I've commented out the following for the +.\" moment. The relationship between PAM and nsswitch.conf needs +.\" to be clearly documented in one place, which is pointed to by +.\" the pages for the user, group, and shadow password functions. +.\" (Jul 2005, mtk) +.\" +.\" This shadow password setup has been superseded by PAM +.\" (pluggable authentication modules), and the file +.\" .I /etc/nsswitch.conf +.\" now describes the sources to be used. +.LP +The +.BR getspnam () +function returns a pointer to a structure containing +the broken-out fields of the record in the shadow password database +that matches the username +.IR name . +.LP +The +.BR getspent () +function returns a pointer to the next entry in the shadow password +database. +The position in the input stream is initialized by +.BR setspent (). +When done reading, the program may call +.BR endspent () +so that resources can be deallocated. +.\" some systems require a call of setspent() before the first getspent() +.\" glibc does not +.LP +The +.BR fgetspent () +function is similar to +.BR getspent () +but uses the supplied stream instead of the one implicitly opened by +.BR setspent (). +.LP +The +.BR sgetspent () +function parses the supplied string +.I s +into a struct +.IR spwd . +.LP +The +.BR putspent () +function writes the contents of the supplied struct +.I spwd +.I *p +as a text line in the shadow password file format to the stream +.IR fp . +String entries with value NULL and numerical entries with value \-1 +are written as an empty string. +.LP +The +.BR lckpwdf () +function is intended to protect against multiple simultaneous accesses +of the shadow password database. +It tries to acquire a lock, and returns 0 on success, +or \-1 on failure (lock not obtained within 15 seconds). +The +.BR ulckpwdf () +function releases the lock again. +Note that there is no protection against direct access of the shadow +password file. +Only programs that use +.BR lckpwdf () +will notice the lock. +.LP +These were the functions that formed the original shadow API. +They are widely available. +.\" Also in libc5 +.\" SUN doesn't have sgetspent() +.SS "Reentrant versions" +Analogous to the reentrant functions for the password database, glibc +also has reentrant functions for the shadow password database. +The +.BR getspnam_r () +function is like +.BR getspnam () +but stores the retrieved shadow password structure in the space pointed to by +.IR spbuf . +This shadow password structure contains pointers to strings, and these strings +are stored in the buffer +.I buf +of size +.IR buflen . +A pointer to the result (in case of success) or NULL (in case no entry +was found or an error occurred) is stored in +.IR *spbufp . +.LP +The functions +.BR getspent_r (), +.BR fgetspent_r (), +and +.BR sgetspent_r () +are similarly analogous to their nonreentrant counterparts. +.LP +Some non-glibc systems also have functions with these names, +often with different prototypes. +.\" SUN doesn't have sgetspent_r() +.SS Structure +The shadow password structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct spwd { + char *sp_namp; /* Login name */ + char *sp_pwdp; /* Encrypted password */ + long sp_lstchg; /* Date of last change (measured + in days since 1970-01-01 00:00:00 +0000 (UTC)) */ + long sp_min; /* Min # of days between changes */ + long sp_max; /* Max # of days between changes */ + long sp_warn; /* # of days before password expires + to warn user to change it */ + long sp_inact; /* # of days after password expires + until account is disabled */ + long sp_expire; /* Date when account expires (measured + in days since 1970-01-01 00:00:00 +0000 (UTC)) */ + unsigned long sp_flag; /* Reserved */ +}; +.fi +.in +.SH "RETURN VALUE" +The functions that return a pointer return NULL if no more entries +are available or if an error occurs during processing. +The functions which have \fIint\fP as the return value return 0 for +success and \-1 for failure. +.LP +For the nonreentrant functions, the return value may point to static area, +and may be overwritten by subsequent calls to these functions. +.LP +The reentrant functions return zero on success. +In case of error, an error number is returned. +.SH ERRORS +.TP +.B ERANGE +Supplied buffer is too small. +.SH FILES +.TP +.I /etc/shadow +local shadow password database file +.TP +.I /etc/.pwd.lock +lock file +.LP +The include file +.I +defines the constant +.B _PATH_SHADOW +to the pathname of the shadow password file. +.SH "CONFORMING TO" +The shadow password database and its associated API are +not specified in POSIX.1-2001. +However, many other systems provide a similar API. +.SH "SEE ALSO" +.BR getgrnam (3), +.BR getpwnam (3), +.BR getpwnam_r (3), +.BR shadow (5) diff --git a/original/man3/getspnam_r.3 b/original/man3/getspnam_r.3 new file mode 100644 index 00000000..142c5a5c --- /dev/null +++ b/original/man3/getspnam_r.3 @@ -0,0 +1 @@ +.so man3/getspnam.3 diff --git a/original/man3/getsubopt.3 b/original/man3/getsubopt.3 new file mode 100644 index 00000000..e4ffd598 --- /dev/null +++ b/original/man3/getsubopt.3 @@ -0,0 +1,210 @@ +.\" Copyright (C) 2007 Michael Kerrisk +.\" and Copyright (C) 2007 Justin Pryzby +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.TH GETSUBOPT 3 2008-05-29 "GNU" "Linux Programmer's Manual" +.SH NAME +getsubopt \- parse suboption arguments from a string +.SH SYNOPSIS +.B #define _XOPEN_SOURCE 500 +.br +.B #include + +.BI "int getsubopt(char **"optionp ", char * const *" tokens \ +", char **" valuep ); +.SH DESCRIPTION +.BR getsubopt () +parses the list of comma-separated suboptions provided in +.IR optionp . +(Such a suboption list is typically produced when +.BR getopt (3) +is used to parse a command line; +see for example the \fI-o\fP option of +.BR mount (8).) +Each suboption may include an associated value, +which is separated from the suboption name by an equal sign. +The following is an example of the kind of string +that might be passed in +.IR optionp : +.sp +.in +4n +.B ro,name=xyz +.in + +The +.I tokens +argument is a pointer to a NULL-terminated list of the tokens that +.BR getsubopt () +will look for in +.IR optionp . +The tokens should be distinct, null-terminated strings containing at +least one character, with no embedded equal signs or commas. + +Each call to +.BR getsubopt () +returns information about the next unprocessed suboption in +.IR optionp . +The first equal sign in a suboption (if any) is interpreted as a +separator between the name and the value of that suboption. +The value extends to the next comma, +or (for the last suboption) to the end of the string. +If the name of the suboption matches a known name from +.IR tokens , +and a value string was found, +.BR getsubopt () +sets +.I *valuep +to the address of that string. +The first comma in +.I optionp +is overwritten with a null byte, so +.I *valuep +is precisely the "value string" for that suboption. + +If the suboption is recognized, but no value string was found, +.I *valuep +is set to NULL. + +When +.BR getsubopt () +returns, +.I optionp +points to the next suboption, or to the null character at the end of the +string if the last suboption was just processed. +.SH RETURN VALUE +If the first suboption in +.I optionp +is recognized, +.BR getsubopt () +returns the index of the matching suboption element in +.IR tokens . +Otherwise, \-1 is returned and +.I *valuep +is the entire +.IB name [= value ] +string. + +Since +.I *optionp +is changed, the first suboption before the call to +.BR getsubopt () +is not (necessarily) the same as the first suboption after +.BR getsubopt (). +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES + +Since +.BR getsubopt () +overwrites any commas it finds in the string +.IR *optionp , +that string must be writable; it cannot be a string constant. +.SH EXAMPLE +The following program expects suboptions following a "\-o" option. + +.nf +#define _XOPEN_SOURCE 500 +#include +#include +#include + +int main(int argc, char **argv) +{ + enum { + RO_OPT = 0, + RW_OPT, + NAME_OPT + }; + char *const token[] = { + [RO_OPT] = "ro", + [RW_OPT] = "rw", + [NAME_OPT] = "name", + NULL + }; + char *subopts; + char *value; + int opt; + + int readonly = 0; + int readwrite = 0; + char *name = NULL; + int errfnd = 0; + + while ((opt = getopt(argc, argv, "o:")) != \-1) { + switch (opt) { + case \(aqo\(aq: + subopts = optarg; + while (*subopts != \(aq\\0\(aq && !errfnd) { + + switch (getsubopt(&subopts, token, &value)) { + case RO_OPT: + readonly = 1; + break; + + case RW_OPT: + readwrite = 1; + break; + + case NAME_OPT: + if (value == NULL) { + fprintf(stderr, "Missing value for " + "suboption \(aq%s\(aq\\n", token[NAME_OPT]); + errfnd = 1; + continue; + } + + name = value; + break; + + default: + fprintf(stderr, "No match found " + "for token: /%s/\\n", 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]); + errfnd = 1; + } + break; + + default: + errfnd = 1; + } + } + + if (errfnd || argc == 1) { + fprintf(stderr, "\\nUsage: %s \-o \\n", argv[0]); + fprintf(stderr, "suboptions are \(aqro\(aq, \(aqrw\(aq, " + "and \(aqname=\(aq\\n"); + exit(EXIT_FAILURE); + } + + /* Remainder of program... */ + + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR getopt (3), +.BR feature_test_macros (7) diff --git a/original/man3/getttyent.3 b/original/man3/getttyent.3 new file mode 100644 index 00000000..1cf8ebc1 --- /dev/null +++ b/original/man3/getttyent.3 @@ -0,0 +1,78 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH GETTTYENT 3 2002-07-18 "GNU" "Linux Programmer's Manual" +.SH NAME +getttyent, getttynam, setttyent, endttyent \- get ttys file entry +.SH SYNOPSIS +.B "#include " +.sp +.B "struct ttyent *getttyent(void);" +.sp +.BI "struct ttyent *getttynam(const char *" name ); +.sp +.B "int setttyent(void);" +.sp +.B "int endttyent(void);" +.SH DESCRIPTION +These functions provide an interface to the file +.B _PATH_TTYS +(e.g., +.IR /etc/ttys ). + +The function +.BR setttyent () +opens the file or rewinds it if already open. + +The function +.BR endttyent () +closes the file. + +The function +.BR getttynam () +searches for a given ttyname in the file. +It returns a pointer to a +.I ttyent +structure (description below). + +The function +.BR getttyent () +opens the file +.B _PATH_TTYS +(if necessary) and returns the first entry. +If the file is already open, the next entry. +The +.I ttyent +structure has the form: +.in +4n +.nf + +struct ttyent { + char *ty_name; /* terminal device name */ + char *ty_getty; /* command to execute, usually getty */ + char *ty_type; /* terminal type for termcap */ + int ty_status; /* status flags */ + char *ty_window; /* command to start up window manager */ + char *ty_comment; /* comment field */ +}; +.fi +.in + +.I ty_status +can be: +.br +.nf + +#define TTY_ON 0x01 /* enable logins (start ty_getty program) */ +#define TTY_SECURE 0x02 /* allow UID 0 to login */ +.fi +.SH "CONFORMING TO" +Not in POSIX.1-2001. +Present on the BSDs, and perhaps other systems. +.SH NOTES +Under Linux the file +.IR /etc/ttys , +and the functions described above, are not used. +.SH "SEE ALSO" +.BR ttyname (3), +.BR ttyslot (3) diff --git a/original/man3/getttynam.3 b/original/man3/getttynam.3 new file mode 100644 index 00000000..1cd11e3d --- /dev/null +++ b/original/man3/getttynam.3 @@ -0,0 +1 @@ +.so man3/getttyent.3 diff --git a/original/man3/getumask.3 b/original/man3/getumask.3 new file mode 100644 index 00000000..eec81b1b --- /dev/null +++ b/original/man3/getumask.3 @@ -0,0 +1,62 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.\" +.TH GETUMASK 3 2009-01-20 "GNU" "Linux Programmer's Manual" +.SH NAME +getumask \- get file creation mask +.SH SYNOPSIS +.B #define _GNU_SOURCE +.br +.B "#include " +.br +.B "#include " +.sp +.B "mode_t getumask(void);" +.SH DESCRIPTION +This function returns the current file creation mask. +It is equivalent to +.in +4n +.nf + +mode_t getumask(void) +{ + mode_t mask = umask( 0 ); + umask(mask); + return mask; +} + +.fi +.in +except that it is documented to be thread-safe (that is, shares +a lock with the +.BR umask (2) +library call). +.SH "CONFORMING TO" +This is a vaporware GNU extension. +.SH NOTES +This function is documented but not implemented yet in glibc, +as at version 2.9. +.SH "SEE ALSO" +.BR umask (2) diff --git a/original/man3/getusershell.3 b/original/man3/getusershell.3 new file mode 100644 index 00000000..d50ef8c3 --- /dev/null +++ b/original/man3/getusershell.3 @@ -0,0 +1,84 @@ +.\" 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 Sat Jul 24 19:17:53 1993 by Rik Faith (faith@cs.unc.edu) +.TH GETUSERSHELL 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +getusershell, setusershell, endusershell \- get permitted user shells +.SH SYNOPSIS +.nf +.B #include +.sp +.B char *getusershell(void); +.sp +.B void setusershell(void); +.sp +.B void endusershell(void); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR getusershell (), +.BR setusershell (), +.BR endusershell (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.ad b +.SH DESCRIPTION +The +.BR getusershell () +function returns the next line from the file +\fI/etc/shells\fP, opening the file if necessary. +The line should contain +the pathname of a valid user shell. +If \fI/etc/shells\fP does not exist or +is unreadable, +.BR getusershell () +behaves as if \fI/bin/sh\fP and +\fI/bin/csh\fP were listed in the file. +.PP +The +.BR setusershell () +function rewinds \fI/etc/shells\fP. +.PP +The +.BR endusershell () +function closes \fI/etc/shells\fP. +.SH "RETURN VALUE" +The +.BR getusershell () +function returns a NULL pointer on end-of-file. +.SH FILES +.nf +/etc/shells +.fi +.SH "CONFORMING TO" +4.3BSD. +.SH "SEE ALSO" +.BR shells (5) diff --git a/original/man3/getutent.3 b/original/man3/getutent.3 new file mode 100644 index 00000000..e6a8ebc1 --- /dev/null +++ b/original/man3/getutent.3 @@ -0,0 +1,286 @@ +.\" Copyright 1995 Mark D. Roth (roth@uiuc.edu) +.\" +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Solaris manpages +.\" +.\" Modified Thu Jul 25 14:43:46 MET DST 1996 by Michael Haardt +.\" +.\" +.TH GETUTENT 3 2008-06-29 "" "Linux Programmer's Manual" +.SH NAME +getutent, getutid, getutline, pututline, setutent, endutent, +utmpname \- access utmp file entries +.SH SYNOPSIS +.B #include +.sp +.B struct utmp *getutent(void); +.br +.BI "struct utmp *getutid(struct utmp *" ut ); +.br +.BI "struct utmp *getutline(struct utmp *" ut ); +.sp +.BI "struct utmp *pututline(struct utmp *" ut ); +.sp +.B void setutent(void); +.br +.B void endutent(void); +.sp +.BI "int utmpname(const char *" file ); +.SH DESCRIPTION +New applications should use the POSIX.1-specified "utmpx" versions of +these functions; see CONFORMING TO. + +.BR utmpname () +sets the name of the utmp-format file for the other utmp +functions to access. +If +.BR utmpname () +is not used to set the filename +before the other functions are used, they assume \fB_PATH_UTMP\fP, as +defined in \fI\fP. +.PP +.BR setutent () +rewinds the file pointer to the beginning of the utmp file. +It is generally a good idea to call it before any of the other +functions. +.PP +.BR endutent () +closes the utmp file. +It should be called when the user +code is done accessing the file with the other functions. +.PP +.BR getutent () +reads a line from the current file position in the utmp file. +It returns a pointer to a structure containing the fields of +the line. +The definition of this structure is shown in +.BR utmp (5). +.PP +.BR getutid () +searches forward from the current file position in the utmp +file based upon \fIut\fP. +If \fIut\->ut_type\fP is one of \fBRUN_LVL\fP, +\fBBOOT_TIME\fP, \fBNEW_TIME\fP, or \fBOLD_TIME\fP, +.BR getutid () +will +find the first entry whose \fIut_type\fP field matches \fIut\->ut_type\fP. +If \fIut\->ut_type\fP is one of \fBINIT_PROCESS\fP, \fBLOGIN_PROCESS\fP, +\fBUSER_PROCESS\fP, or \fBDEAD_PROCESS\fP, +.BR getutid () +will find the +first entry whose +.I ut_id +field matches \fIut\->ut_id\fP. +.PP +.BR getutline () +searches forward from the current file position in the utmp file. +It scans entries whose +.I ut_type +is \fBUSER_PROCESS\fP +or \fBLOGIN_PROCESS\fP and returns the first one whose +.I ut_line +field +matches \fIut\->ut_line\fP. +.PP +.BR pututline () +writes the +.I utmp +structure \fIut\fP into the utmp file. +It uses +.BR getutid () +to search for the proper place in the file to insert +the new entry. +If it cannot find an appropriate slot for \fIut\fP, +.BR pututline () +will append the new entry to the end of the file. +.SH "RETURN VALUE" +.BR getutent (), +.BR getutid (), +and +.BR getutline () +return a pointer to a \fIstruct utmp\fP on success, +and NULL on failure (which includes the "record not found" case). +This \fIstruct utmp\fP is allocated in static storage, and may be +overwritten by subsequent calls. + +On success +.BR pututline () +returns +.IR ut ; +on failure, it returns NULL. + +.BR utmpname () +returns 0 if the new name was successfully stored, or \-1 on failure. +.SH ERRORS +.TP +.B ENOMEM +Out of memory. +.TP +.B ESRCH +Record not found. +.PP +.BR setutent (), +.BR pututent (), +and the +.B getut* () +functions can also fail for the reasons described in +.BR open (2). +.SH FILES +/var/run/utmp database of currently logged-in users +.br +/var/log/wtmp database of past user logins +.SH "CONFORMING TO" +XPG2, SVr4. +.LP +In XPG2 and SVID 2 the function +.BR pututline () +is documented to return void, and that is what it does on many systems +(AIX, HP-UX, Linux libc5). +HP-UX introduces a new function +.BR _pututline () +with the prototype given above for +.BR pututline () +(also found in Linux libc5). +.LP +All these functions are obsolete now on non-Linux systems. +POSIX.1-2001, following SUSv1, +does not have any of these functions, but instead uses +.sp +.B #include +.sp +.B struct utmpx *getutxent(void); +.br +.B struct utmpx *getutxid(const struct utmpx *); +.br +.B struct utmpx *getutxline(const struct utmpx *); +.br +.B struct utmpx *pututxline(const struct utmpx *); +.br +.B void setutxent(void); +.br +.B void endutxent(void); +.PP +These functions are provided by glibc, +and perform the same task as their equivalents without the "x", but use +.IR "struct utmpx" , +defined on Linux to be the same as +.IR "struct utmp" . +For completeness, glibc also provides +.BR utmpxname (), +although this function is not specified by POSIX.1. +.PP +On some other systems, +the \fIutmpx\fP structure is a superset of the \fIutmp\fP structure, +with additional fields, and larger versions of the existing fields, +and parallel files are maintained, often +.I /var/*/utmpx +and +.IR /var/*/wtmpx . +.LP +Linux glibc on the other hand does not use a parallel \fIutmpx\fP file +since its \fIutmp\fP structure is already large enough. +The functions \fBgetutxent\fP() +etc. are aliases for \fBgetutent\fP() etc. +.SH NOTES +.SS Glibc Notes +The above functions are not thread-safe. +Glibc adds reentrant versions +.sp +.nf +.BR "#define _GNU_SOURCE" " /* or _SVID_SOURCE or _BSD_SOURCE */" +.B #include +.sp +.BI "int getutent_r(struct utmp *" ubuf ", struct utmp **" ubufp ); +.sp +.BI "int getutid_r(struct utmp *" ut , +.BI " struct utmp *" ubuf ", struct utmp **" ubufp ); +.sp +.BI "int getutline_r(struct utmp *" ut , +.BI " struct utmp *" ubuf ", struct utmp **" ubufp ); +.fi +.sp +These functions are GNU extensions, analogs of the functions of the +same name without the _r suffix. +The +.I ubuf +argument gives these functions a place to store their result. +On success they return 0, and a pointer to the result is written in +.IR *ubufp . +On error these functions return \-1. +There are no utmpx equivalents of the above functions. +(POSIX.1 does not specify such functions.) +.SH EXAMPLE +The following example adds and removes a utmp record, assuming it is run +from within a pseudo terminal. +For usage in a real application, you +should check the return values of +.BR getpwuid (3) +and +.BR ttyname (3). +.PP +.nf +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct utmp entry; + + system("echo before adding entry:;who"); + + entry.ut_type = USER_PROCESS; + entry.ut_pid = getpid(); + strcpy(entry.ut_line, ttyname(STDIN_FILENO) + strlen("/dev/")); + /* only correct for ptys named /dev/tty[pqr][0\-9a\-z] */ + strcpy(entry.ut_id, ttyname(STDIN_FILENO) + strlen("/dev/tty")); + time(&entry.ut_time); + strcpy(entry.ut_user, getpwuid(getuid())\->pw_name); + memset(entry.ut_host, 0, UT_HOSTSIZE); + entry.ut_addr = 0; + setutent(); + pututline(&entry); + + system("echo after adding entry:;who"); + + entry.ut_type = DEAD_PROCESS; + memset(entry.ut_line, 0, UT_LINESIZE); + entry.ut_time = 0; + memset(entry.ut_user, 0, UT_NAMESIZE); + setutent(); + pututline(&entry); + + system("echo after removing entry:;who"); + + endutent(); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR getutmp (3), +.BR utmp (5), +.BR feature_test_macros (7) diff --git a/original/man3/getutent_r.3 b/original/man3/getutent_r.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/getutent_r.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/getutid.3 b/original/man3/getutid.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/getutid.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/getutid_r.3 b/original/man3/getutid_r.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/getutid_r.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/getutline.3 b/original/man3/getutline.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/getutline.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/getutline_r.3 b/original/man3/getutline_r.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/getutline_r.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/getutmp.3 b/original/man3/getutmp.3 new file mode 100644 index 00000000..ef4f83f1 --- /dev/null +++ b/original/man3/getutmp.3 @@ -0,0 +1,69 @@ +.\" 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. +.\" +.TH GETUTMP 3 2008-07-02 "Linux" "Linux Programmer's Manual" +.SH NAME +getutmp, getutmpx \- copy utmp structure to utmpx, and vice versa +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +.BI " void getutmp(const struct utmpx *" ux ", struct utmp *" u ); +.BI " void getutmpx(const struct utmp *" u ", struct utmpx *" ux ); +.fi +.SH DESCRIPTION +The +.BR getutmp () +function copies the fields of the +.I utmpx +structure pointed to by +.I ux +to the corresponding fields of the +.I utmp +structure pointed to by +.IR u . +The +.BR getutmpx () +function performs the converse operation. +.SH RETURN VALUE +These functions do not return a value. +.SH VERSIONS +These functions first appeared in glibc in version 2.1.1. +.SH CONFORMING TO +These functions are nonstandard, but appear on a few other systems, +such as Solaris and NetBSD. +.SH NOTES +These functions exist primarily for compatibility with other +systems where the +.I utmp +and +.I utmpx +structures contain different fields, +or the size of corresponding fields differs. +.\" e.g., on Solaris, the utmpx structure is rather larger than utmp. +On Linux, the two structures contain the same fields, +and the fields have the same sizes. +.SH SEE ALSO +.BR getutent (3), +.BR utmp (5) diff --git a/original/man3/getutmpx.3 b/original/man3/getutmpx.3 new file mode 100644 index 00000000..668ecb5d --- /dev/null +++ b/original/man3/getutmpx.3 @@ -0,0 +1 @@ +.so man3/getutmp.3 diff --git a/original/man3/getutxent.3 b/original/man3/getutxent.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/getutxent.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/getutxid.3 b/original/man3/getutxid.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/getutxid.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/getutxline.3 b/original/man3/getutxline.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/getutxline.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/getw.3 b/original/man3/getw.3 new file mode 100644 index 00000000..12ba803e --- /dev/null +++ b/original/man3/getw.3 @@ -0,0 +1,66 @@ +.\" Copyright (c) 1995 by Jim Van Zandt +.\" +.\" 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. +.TH GETW 3 2007-12-20 "GNU" "Linux Programmer's Manual" +.SH NAME +getw, putw \- input and output of words (ints) +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int getw(FILE *" stream ); + +.BI "int putw(int " w ", FILE *" stream ); +.fi +.SH DESCRIPTION +.BR getw () +reads a word (that is, an \fIint\fP) from \fIstream\fP. +It's provided for compatibility with SVr4. +We recommend you use +.BR fread (3) +instead. +.P +.BR putw () +writes the word \fIw\fP (that is, +an \fIint\fP) to \fIstream\fP. +It is provided for compatibility with SVr4, but we recommend you use +.BR fwrite (3) +instead. +.SH "RETURN VALUE" +Normally, +.BR getw () +returns the word read, and +.BR putw () +returns 0. +On error, they return \fBEOF\fP. +.SH "CONFORMING TO" +SVr4, SUSv2. Not present in POSIX.1-2001. +.SH BUGS +The value returned on error is also a legitimate data value. +.BR ferror (3) +can be used to distinguish between the two cases. +.SH "SEE ALSO" +.BR ferror (3), +.BR fread (3), +.BR fwrite (3), +.BR getc (3), +.BR putc (3) diff --git a/original/man3/getwc.3 b/original/man3/getwc.3 new file mode 100644 index 00000000..358c2d21 --- /dev/null +++ b/original/man3/getwc.3 @@ -0,0 +1 @@ +.so man3/fgetwc.3 diff --git a/original/man3/getwc_unlocked.3 b/original/man3/getwc_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/getwc_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/getwchar.3 b/original/man3/getwchar.3 new file mode 100644 index 00000000..6f6a0a4f --- /dev/null +++ b/original/man3/getwchar.3 @@ -0,0 +1,64 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH GETWCHAR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +getwchar \- read a wide character from standard input +.SH SYNOPSIS +.nf +.B #include +.sp +.B "wint_t getwchar(void);" +.fi +.SH DESCRIPTION +The +.BR getwchar () +function is the wide-character equivalent of the +.BR getchar (3) +function. +It reads a wide character from \fIstdin\fP and returns +it. +If the end of stream is reached, or if \fIferror(stdin)\fP becomes +true, it returns +.BR WEOF . +If a wide-character conversion error occurs, it sets +\fIerrno\fP to \fBEILSEQ\fP and returns +.BR WEOF . +.PP +For a nonlocking counterpart, see +.BR unlocked_stdio (3). +.SH "RETURN VALUE" +The +.BR getwchar () +function returns the next wide-character from +standard input, or +.BR WEOF . +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR getwchar () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +It is reasonable to expect that +.BR getwchar () +will actually +read a multibyte sequence from standard input and then +convert it to a wide character. +.SH "SEE ALSO" +.BR fgetwc (3), +.BR unlocked_stdio (3) diff --git a/original/man3/getwchar_unlocked.3 b/original/man3/getwchar_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/getwchar_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/getwd.3 b/original/man3/getwd.3 new file mode 100644 index 00000000..f73c1579 --- /dev/null +++ b/original/man3/getwd.3 @@ -0,0 +1 @@ +.so man3/getcwd.3 diff --git a/original/man3/glob.3 b/original/man3/glob.3 new file mode 100644 index 00000000..53fbf976 --- /dev/null +++ b/original/man3/glob.3 @@ -0,0 +1,324 @@ +.\" 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 Wed Jul 28 11:12:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon May 13 23:08:50 1996 by Martin Schulze (joey@linux.de) +.\" Modified 11 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) +.\" Modified 990912 by aeb +.\" 2007-10-10 mtk +.\" Added description of GLOB_TILDE_NOMATCH +.\" Expanded the description of various flags +.\" Various wording fixes. +.\" +.TH GLOB 3 2007-10-10 "GNU" "Linux Programmer's Manual" +.SH NAME +glob, globfree \- find pathnames matching a pattern, free memory from glob() +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int glob(const char *" pattern ", int " flags , +.br +.BI " int (*" errfunc ") (const char *" epath ", int " eerrno ), +.br +.BI " glob_t *" pglob ); +.br +.BI "void globfree(glob_t *" pglob ); +.fi +.SH DESCRIPTION +The +.BR glob () +function searches for all the pathnames matching +.I pattern +according to the rules used by the shell (see +.BR glob (7)). +No tilde expansion or parameter substitution is done; if you want +these, use +.BR wordexp (3). +.PP +The +.BR globfree () +function frees the dynamically allocated storage from an earlier call +to +.BR glob (). +.PP +The results of a +.BR glob () +call are stored in the structure pointed to by +.IR pglob . +This structure is of type +.I glob_t +(declared in +.IR ) +and includes the following elements defined by POSIX.2 (more may be +present as an extension): +.PP +.br +.in +4n +.nf +typedef struct { + size_t gl_pathc; /* Count of paths matched so far */ + char **gl_pathv; /* List of matched pathnames. */ + size_t gl_offs; /* Slots to reserve in \fIgl_pathv\fP. */ +} glob_t; +.fi +.in +.PP +Results are stored in dynamically allocated storage. +.PP +The argument +.I flags +is made up of the bitwise OR of zero or more the following symbolic +constants, which modify the behavior of +.BR glob (): +.TP +.B GLOB_ERR +Return upon a read error (because a directory does not +have read permission, for example). +By default, +.BR glob () +attempts carry on despite errors, +reading all of the directories that it can. +.TP +.B GLOB_MARK +Append a slash to each path which corresponds to a directory. +.TP +.B GLOB_NOSORT +Don't sort the returned pathnames. +The only reason to do this is to save processing time. +By default, the returned pathnames are sorted. +.TP +.B GLOB_DOOFFS +Reserve +.I pglob\->gl_offs +slots at the beginning of the list of strings in +.IR pglob\->pathv . +The reserved slots contain NULL pointers. +.TP +.B GLOB_NOCHECK +If no pattern matches, return the original pattern. +By default, +.BR glob () +returns +.B GLOB_NOMATCH +if there are no matches. +.TP +.B GLOB_APPEND +Append the results of this call to the vector of results +returned by a previous call to +.BR glob (). +Do not set this flag on the first invocation of +.BR glob (). +.TP +.B GLOB_NOESCAPE +Don't allow backslash (\(aq\\\(aq) to be used as an escape +character. +Normally, a backslash can be used to quote the following character, +providing a mechanism to turn off the special meaning +metacharacters. +.PP +.I flags +may also include any of the following, which are GNU +extensions and not defined by POSIX.2: +.TP +.B GLOB_PERIOD +Allow a leading period to be matched by metacharacters. +By default, metacharacters can't match a leading period. +.TP +.B GLOB_ALTDIRFUNC +Use alternative functions +.IR pglob\->gl_closedir , +.IR pglob\->gl_readdir , +.IR pglob\->gl_opendir , +.IR pglob\->gl_lstat ", and" +.I pglob\->gl_stat +for file system access instead of the normal library +functions. +.TP +.B GLOB_BRACE +Expand +.BR csh (1) +style brace expressions of the form \fB{a,b}\fR. +Brace expressions can be nested. +Thus, for example, specifying the pattern +"{foo/{,cat,dog},bar}" would return the same results as four separate +.BR glob () +calls using the strings: +"foo/", +"foo/cat", +"foo/dog", +and +"bar". +.TP +.B GLOB_NOMAGIC +If the pattern contains no metacharacters +then it should be returned as the sole matching word, +even if there is no file with that name. +.TP +.B GLOB_TILDE +Carry out tilde expansion. +If a tilde (\(aq~\(aq) is the only character in the pattern, +or an initial tilde is followed immediately by a slash (\(aq/\(aq), +then the home directory of the caller is substituted for +the tilde. +If an initial tilde is followed by a username (e.g., "~andrea/bin"), +then the tilde and username are substituted by the home directory +of that user. +If the username is invalid, or the home directory cannot be +determined, then no substitution is performed. +.TP +.B GLOB_TILDE_CHECK +This provides behavior similar to that of +.BR GLOB_TILDE . +The difference is that if the username is invalid, or the +home directory cannot be determined, then +instead of using the pattern itself as the name, +.BR glob () +returns +.BR GLOB_NOMATCH +to indicate an error. +.TP +.B GLOB_ONLYDIR +This is a +.I hint +to +.BR glob () +that the caller is interested only in directories that match the pattern. +If the implementation can easily determine file-type information, +then nondirectory files are not returned to the caller. +However, the caller must still check that returned files +are directories. +(The purpose of this flag is merely to optimize performance when +the caller is interested only in directories.) +.PP +If +.I errfunc +is not NULL, +it will be called in case of an error with the arguments +.IR epath , +a pointer to the path which failed, and +.IR eerrno , +the value of +.I errno +as returned from one of the calls to +.BR opendir (3), +.BR readdir (3), +or +.BR stat (2). +If +.I errfunc +returns nonzero, or if +.B GLOB_ERR +is set, +.BR glob () +will terminate after the call to +.IR errfunc . +.PP +Upon successful return, +.I pglob\->gl_pathc +contains the number of matched pathnames and +.I pglob\->gl_pathv +contains a pointer to the list of pointers to matched pathnames. +The list of pointers is terminated by a NULL pointer. +.PP +It is possible to call +.BR glob () +several times. +In that case, the +.B GLOB_APPEND +flag has to be set in +.I flags +on the second and later invocations. +.PP +As a GNU extension, +.I pglob\->gl_flags +is set to the flags specified, \fBor\fRed with +.B GLOB_MAGCHAR +if any metacharacters were found. +.SH "RETURN VALUE" +On successful completion, +.BR glob () +returns zero. +Other possible returns are: +.TP +.B GLOB_NOSPACE +for running out of memory, +.TP +.B GLOB_ABORTED +for a read error, and +.TP +.B GLOB_NOMATCH +for no found matches. +.SH "CONFORMING TO" +POSIX.2, POSIX.1-2001. +.SH NOTES +The structure elements +.I gl_pathc +and +.I gl_offs +are declared as +.I size_t +in glibc 2.1, as they should be according to POSIX.2, +but are declared as +.I int +in libc4, libc5 and glibc 2.0. +.SH BUGS +The +.BR glob () +function may fail due to failure of underlying function calls, such as +.BR malloc (3) +or +.BR opendir (3). +These will store their error code in +.IR errno . +.SH EXAMPLE +One example of use is the following code, which simulates typing +.sp +.in +4n +ls \-l *.c ../*.c +.in +.sp +in the shell: +.nf +.in +4n + +glob_t globbuf; + +globbuf.gl_offs = 2; +glob("*.c", GLOB_DOOFFS, NULL, &globbuf); +glob("../*.c", GLOB_DOOFFS | GLOB_APPEND, NULL, &globbuf); +globbuf.gl_pathv[0] = "ls"; +globbuf.gl_pathv[1] = "\-l"; +execvp("ls", &globbuf.gl_pathv[0]); +.in +.fi +.SH "SEE ALSO" +.BR ls (1), +.BR sh (1), +.BR stat (2), +.BR exec (3), +.BR fnmatch (3), +.BR malloc (3), +.BR opendir (3), +.BR readdir (3), +.BR wordexp (3), +.BR glob (7) diff --git a/original/man3/globfree.3 b/original/man3/globfree.3 new file mode 100644 index 00000000..20056c69 --- /dev/null +++ b/original/man3/globfree.3 @@ -0,0 +1 @@ +.so man3/glob.3 diff --git a/original/man3/gmtime.3 b/original/man3/gmtime.3 new file mode 100644 index 00000000..84a3baa9 --- /dev/null +++ b/original/man3/gmtime.3 @@ -0,0 +1 @@ +.so man3/ctime.3 diff --git a/original/man3/gmtime_r.3 b/original/man3/gmtime_r.3 new file mode 100644 index 00000000..84a3baa9 --- /dev/null +++ b/original/man3/gmtime_r.3 @@ -0,0 +1 @@ +.so man3/ctime.3 diff --git a/original/man3/gnu_dev_major.3 b/original/man3/gnu_dev_major.3 new file mode 100644 index 00000000..eabbdd01 --- /dev/null +++ b/original/man3/gnu_dev_major.3 @@ -0,0 +1 @@ +.so man3/makedev.3 diff --git a/original/man3/gnu_dev_makedev.3 b/original/man3/gnu_dev_makedev.3 new file mode 100644 index 00000000..eabbdd01 --- /dev/null +++ b/original/man3/gnu_dev_makedev.3 @@ -0,0 +1 @@ +.so man3/makedev.3 diff --git a/original/man3/gnu_dev_minor.3 b/original/man3/gnu_dev_minor.3 new file mode 100644 index 00000000..eabbdd01 --- /dev/null +++ b/original/man3/gnu_dev_minor.3 @@ -0,0 +1 @@ +.so man3/makedev.3 diff --git a/original/man3/gnu_get_libc_release.3 b/original/man3/gnu_get_libc_release.3 new file mode 100644 index 00000000..7f84005f --- /dev/null +++ b/original/man3/gnu_get_libc_release.3 @@ -0,0 +1 @@ +.so man3/gnu_get_libc_version.3 diff --git a/original/man3/gnu_get_libc_version.3 b/original/man3/gnu_get_libc_version.3 new file mode 100644 index 00000000..e67ef2fd --- /dev/null +++ b/original/man3/gnu_get_libc_version.3 @@ -0,0 +1,76 @@ +.\" 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. +.\" +.TH GNU_GET_LIBC_VERSION 3 2008-07-02 "Linux" "Linux Programmer's Manual" +.SH NAME +gnu_get_libc_version, gnu_get_libc_release \- get glibc version and release +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +.B const char *gnu_get_libc_version(void); +.B const char *gnu_get_libc_release(void); +.fi +.SH DESCRIPTION +The function +.BR gnu_get_libc_version () +returns a string that identifies the glibc version available on the system. + +The function +.BR gnu_get_libc_release () +returns a string indicates the release status of the glibc version +available on the system. +This will be a string such as +.IR "stable" . +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH CONFORMING TO +These functions are glibc-specific. +.SH EXAMPLE +When run, the program below will produce output such as the following: +.in +4n +.nf + +.RB "$" " ./a.out" +GNU libc version: 2.8 +GNU libc release: stable +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + printf("GNU libc version: %s\\n", gnu_get_libc_version()); + printf("GNU libc release: %s\\n", gnu_get_libc_release()); + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR confstr (3) diff --git a/original/man3/grantpt.3 b/original/man3/grantpt.3 new file mode 100644 index 00000000..6391e260 --- /dev/null +++ b/original/man3/grantpt.3 @@ -0,0 +1,69 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This page is in the public domain. - aeb +.\" +.TH GRANTPT 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.SH NAME +grantpt \- grant access to the slave pseudo-terminal +.SH SYNOPSIS +.nf +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "int grantpt(int " fd ");" +.fi +.SH DESCRIPTION +The +.BR grantpt () +function changes the mode and owner of the slave pseudo-terminal device +(pty) corresponding to the master pty referred to by +.IR fd . +The user ID of the slave is set to the real UID of the calling process. +The group ID is set to an unspecified value (e.g., \fItty\fP). +The mode of the slave is set to 0620 (crw\-\-w\-\-\-\-). +.PP +The behavior of +.BR grantpt () +is unspecified if a signal handler is installed to catch +.B SIGCHLD +signals. +.SH "RETURN VALUE" +When successful, +.BR grantpt () +returns 0. +Otherwise, it returns \-1 and sets +.I errno +appropriately. +.SH ERRORS +.TP +.B EACCES +The corresponding slave pty could not be accessed. +.TP +.B EBADF +The +.I fd +argument is not a valid open file descriptor. +.TP +.B EINVAL +The +.I fd +argument is valid but not associated with a master pty. +.SH VERSIONS +.BR grantpt () +is provided in glibc since version 2.1. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +This is part of the Unix98 pty support, see +.BR pts (4). +Many systems implement this function via a set-user-ID helper binary +called "pt_chown". +With Linux devpts no such helper binary is required. +.SH "SEE ALSO" +.BR open (2), +.BR posix_openpt (3), +.BR ptsname (3), +.BR unlockpt (3), +.BR pts (4), +.BR feature_test_macros (7), +.BR pty (7) diff --git a/original/man3/gsignal.3 b/original/man3/gsignal.3 new file mode 100644 index 00000000..f922e834 --- /dev/null +++ b/original/man3/gsignal.3 @@ -0,0 +1,104 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.TH GSIGNAL 3 2007-07-26 "" "Linux Programmer's Manual" +.SH NAME +gsignal, ssignal \- software signal facility +.SH SYNOPSIS +.nf +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "int gsignal(int" signum ); +.sp +.BI "sighandler_t ssignal(int " signum ", sighandler_t " action ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR gsignal (), +.BR ssignal (): +_SVID_SOURCE +.SH DESCRIPTION +Don't use these functions under Linux. +Due to a historical mistake, under Linux these functions are +aliases for +.BR raise (3) +and +.BR signal (2), +respectively. +.LP +Elsewhere, on System V-like systems, these functions implement +software signaling, entirely independent of the classical +.BR signal (2) +and +.BR kill (2) +functions. +The function +.BR ssignal () +defines the action to take when the software signal with +number +.I signum +is raised using the function +.BR gsignal (), +and returns the previous such action or +.BR SIG_DFL . +The function +.BR gsignal () +does the following: if no action (or the action +.BR SIG_DFL ) +was +specified for +.IR signum , +then it does nothing and returns 0. +If the action +.B SIG_IGN +was specified for +.IR signum , +then it does nothing and returns 1. +Otherwise, it resets the action to +.B SIG_DFL +and calls +the action function with argument +.IR signum , +and returns the value returned by that function. +The range of possible values +.I signum +varies (often 1-15 or 1-17). +.SH "CONFORMING TO" +These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris, Tru64. +They are called obsolete under most of these systems, and are +broken under Linux libc and glibc. +Some systems also have +.BR gsignal_r () +and +.BR ssignal_r (). +.SH "SEE ALSO" +.BR kill (2), +.BR signal (2), +.BR raise (3) diff --git a/original/man3/h_errno.3 b/original/man3/h_errno.3 new file mode 100644 index 00000000..7d0fb4b7 --- /dev/null +++ b/original/man3/h_errno.3 @@ -0,0 +1 @@ +.so man3/gethostbyname.3 diff --git a/original/man3/hash.3 b/original/man3/hash.3 new file mode 100644 index 00000000..6768b73a --- /dev/null +++ b/original/man3/hash.3 @@ -0,0 +1,161 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)hash.3 8.6 (Berkeley) 8/18/94 +.\" +.TH HASH 3 1994-08-18 "" "Linux Programmer's Manual" +.UC 7 +.SH NAME +hash \- hash database access method +.SH SYNOPSIS +.nf +.ft B +#include +#include +.ft R +.fi +.SH DESCRIPTION +The routine +.BR dbopen (3) +is the library interface to database files. +One of the supported file formats is hash files. +The general description of the database access methods is in +.BR dbopen (3), +this manual page describes only the hash specific information. +.PP +The hash data structure is an extensible, dynamic hashing scheme. +.PP +The access method specific data structure provided to +.BR dbopen (3) +is defined in the +.I +include file as follows: +.in +4n +.nf + +typedef struct { + unsigned int bsize; + unsigned int ffactor; + unsigned int nelem; + unsigned int cachesize; + uint32_t (*hash)(const void *, size_t); + int lorder; +} HASHINFO; +.fi +.in +.PP +The elements of this structure are as follows: +.TP 10 +.I bsize +defines the hash table bucket size, and is, by default, 256 bytes. +It may be preferable to increase the page size for disk-resident tables +and tables with large data items. +.TP +.I ffactor +indicates a desired density within the hash table. +It is an approximation of the number of keys allowed to accumulate in any +one bucket, determining when the hash table grows or shrinks. +The default value is 8. +.TP +.I nelem +is an estimate of the final size of the hash table. +If not set or set too low, hash tables will expand gracefully as keys +are entered, although a slight performance degradation may be noticed. +The default value is 1. +.TP +.I cachesize +is the suggested maximum size, in bytes, of the memory cache. +This value is +.IR "only advisory" , +and the access method will allocate more memory rather than fail. +.TP +.I hash +is a user-defined hash function. +Since no hash function performs equally well on all possible data, the +user may find that the built-in hash function does poorly on a particular +data set. +A user-specified hash functions must take two arguments (a pointer to a byte +string and a length) and return a 32-bit quantity to be used as the hash +value. +.TP +.I lorder +is the byte order for integers in the stored database metadata. +The number should represent the order as an integer; for example, +big endian order would be the number 4,321. +If +.I lorder +is 0 (no order is specified) the current host order is used. +If the file already exists, the specified value is ignored and the +value specified when the tree was created is used. +.PP +If the file already exists (and the +.B O_TRUNC +flag is not specified), the +values specified for +.IR bsize , +.IR ffactor , +.IR lorder , +and +.I nelem +are +ignored and the values specified when the tree was created are used. +.PP +If a hash function is specified, +.I hash_open +will attempt to determine if the hash function specified is the same as +the one with which the database was created, and will fail if it is not. +.PP +Backward compatible interfaces to the routines described in +.BR dbm (3), +and +.BR ndbm (3) +are provided, however these interfaces are not compatible with +previous file formats. +.SH ERRORS +The +.I hash +access method routines may fail and set +.I errno +for any of the errors specified for the library routine +.BR dbopen (3). +.SH BUGS +Only big and little endian byte order are supported. +.SH "SEE ALSO" +.BR btree (3), +.BR dbopen (3), +.BR mpool (3), +.BR recno (3) +.sp +.IR "Dynamic Hash Tables" , +Per-Ake Larson, Communications of the ACM, April 1988. +.sp +.IR "A New Hash Package for UNIX" , +Margo Seltzer, USENIX Proceedings, Winter 1991. diff --git a/original/man3/hasmntopt.3 b/original/man3/hasmntopt.3 new file mode 100644 index 00000000..3c2bb35c --- /dev/null +++ b/original/man3/hasmntopt.3 @@ -0,0 +1 @@ +.so man3/getmntent.3 diff --git a/original/man3/hcreate.3 b/original/man3/hcreate.3 new file mode 100644 index 00000000..f4a0405d --- /dev/null +++ b/original/man3/hcreate.3 @@ -0,0 +1 @@ +.so man3/hsearch.3 diff --git a/original/man3/hcreate_r.3 b/original/man3/hcreate_r.3 new file mode 100644 index 00000000..f4a0405d --- /dev/null +++ b/original/man3/hcreate_r.3 @@ -0,0 +1 @@ +.so man3/hsearch.3 diff --git a/original/man3/hdestroy.3 b/original/man3/hdestroy.3 new file mode 100644 index 00000000..f4a0405d --- /dev/null +++ b/original/man3/hdestroy.3 @@ -0,0 +1 @@ +.so man3/hsearch.3 diff --git a/original/man3/hdestroy_r.3 b/original/man3/hdestroy_r.3 new file mode 100644 index 00000000..f4a0405d --- /dev/null +++ b/original/man3/hdestroy_r.3 @@ -0,0 +1 @@ +.so man3/hsearch.3 diff --git a/original/man3/herror.3 b/original/man3/herror.3 new file mode 100644 index 00000000..7d0fb4b7 --- /dev/null +++ b/original/man3/herror.3 @@ -0,0 +1 @@ +.so man3/gethostbyname.3 diff --git a/original/man3/hsearch.3 b/original/man3/hsearch.3 new file mode 100644 index 00000000..b392b55f --- /dev/null +++ b/original/man3/hsearch.3 @@ -0,0 +1,337 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" Copyright 1993 Ulrich Drepper (drepper@karlsruhe.gmd.de) +.\" and Copyright 2008, Linux Foundation, written by 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. +.\" +.\" References consulted: +.\" SunOS 4.1.1 man pages +.\" Modified Sat Sep 30 21:52:01 1995 by Jim Van Zandt +.\" Remarks from dhw@gamgee.acad.emich.edu Fri Jun 19 06:46:31 1998 +.\" Modified 2001-12-26, 2003-11-28, 2004-05-20, aeb +.\" 2008-09-02, mtk: various additions and rewrites +.\" 2008-09-03, mtk, restructured somewhat, in part after suggestions from +.\" Timothy S. Nelson +.\" +.TH HSEARCH 3 2008-10-06 "GNU" "Linux Programmer's Manual" +.SH NAME +hcreate, hdestroy, hsearch, hcreate_r, hdestroy_r, +hsearch_r \- hash table management +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int hcreate(size_t " nel ); +.sp +.BI "ENTRY *hsearch(ENTRY " item ", ACTION " action ); +.sp +.B "void hdestroy(void);" +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int hcreate_r(size_t " nel ", struct hsearch_data *" htab ); +.sp +.BI "int hsearch_r(ENTRY " item ", ACTION " action ", ENTRY **" retval , +.BI " struct hsearch_data *" htab ); +.sp +.BI "void hdestroy_r(struct hsearch_data *" htab ); +.fi +.SH DESCRIPTION +The three functions +.BR hcreate (), +.BR hsearch (), +and +.BR hdestroy () +allow the caller to create and manage a hash search table +containing entries consisting of a key (a string) and associated data. +Using these functions, only one hash table can be used at a time. + +The three functions +.BR hcreate_r (), +.BR hsearch_r (), +.BR hdestroy_r () +are reentrant versions that allow a program to use +more than one hash search table at the same time. +The last argument, +.IR htab , +points to a structure that describes the table +on which the function is to operate. +The programmer should treat this structure as opaque +(i.e., do not attempt to directly access or modify +the fields in this structure). + +First a hash table must be created using +.BR hcreate (). +The argument \fInel\fP specifies the maximum number of entries +in the table. +(This maximum cannot be changed later, so choose it wisely.) +The implementation may adjust this value upward to improve the +performance of the resulting hash table. +.\" e.g., in glibc it is raised to the next higher prime number + +The +.BR hcreate_r () +function performs the same task as +.BR hcreate (), +but for the table described by the structure +.IR *htab . +The structure pointed to by +.I htab +must be zeroed before the first call to +.BR hcreate_r (). + +The function +.BR hdestroy () +frees the memory occupied by the hash table that was created by +.BR hcreate (). +After calling +.BR hdestroy () +a new hash table can be created using +.BR hcreate (). +The +.BR hdestroy_r () +function performs the analogous task for a hash table described by +.IR *htab , +which was previously created using +.BR hcreate_r (). + +The +.BR hsearch () +function searches the hash table for an +item with the same key as \fIitem\fP (where "the same" is determined using +.BR strcmp (3)), +and if successful returns a pointer to it. + +The argument \fIitem\fP is of type \fIENTRY\fP, which is defined in +\fI\fP as follows: +.in +4n +.sp +.nf +typedef struct entry { + char *key; + void *data; +} ENTRY; +.in +.fi +.sp +The field \fIkey\fP points to a null-terminated string which is the +search key. +The field \fIdata\fP points to data that is associated with that key. + +The argument \fIaction\fP determines what +.BR hsearch () +does after an unsuccessful search. +This argument must either have the value +.BR ENTER , +meaning insert a copy of +.IR item +(and return a pointer to the new hash table entry as the function result), +or the value +.BR FIND , +meaning that NULL should be returned. +(If +.I action +is +.BR FIND , +then +.I data +is ignored.) + +The +.BR hsearch_r () +function is like +.BR hsearch () +but operates on the hash table described by +.IR *htab . +The +.BR hsearch_r () +function differs from +.BR hsearch () +in that a pointer to the found item is returned in +.IR *retval , +rather than as the function result. +.SH "RETURN VALUE" +.BR hcreate () +and +.BR hcreate_r () +return nonzero on success. +They return 0 on error. + +On success, +.BR hsearch () +returns a pointer to an entry in the hash table. +.BR hsearch () +returns NULL on error, that is, +if \fIaction\fP is \fBENTER\fP and +the hash table is full, or \fIaction\fP is \fBFIND\fP and \fIitem\fP +cannot be found in the hash table. +.BR hsearch_r () +returns nonzero on success, and 0 on error. +.SH ERRORS +.LP +.BR hcreate () +and +.BR hcreate_r () +can fail for the following reasons: +.TP +.B EINVAL +.RB ( hcreate_r ()) +.I htab +is NULL. +.TP +.B ENOMEM +Table full with \fIaction\fP set to \fBENTER\fP. +.TP +.B ESRCH +The \fIaction\fP argument is \fBFIND\fP and no corresponding element +is found in the table. +.\" hdestroy_r() can set errno to EINVAL if 'tab' is NULL. +.PP +.BR hsearch () +and +.BR hsearch_r () +can fail for the following reasons: +.TP +.B ENOMEM +.I action +was +.BR ENTER , +.I key +was not found in the table, +and there was no room in the table to add a new entry. +.TP +.B ESRCH +.I action +was +.BR FIND , +and +.I key +was not found in the table. +.PP +POSIX.1-2001 only specifies the +.B ENOMEM +error. +.SH "CONFORMING TO" +The functions +.BR hcreate (), +.BR hsearch (), +and +.BR hdestroy () +are from SVr4, and are described in POSIX.1-2001. +The functions +.BR hcreate_r (), +.BR hsearch_r (), +and +.BR hdestroy_r () +are GNU extensions. +.SH NOTES +Hash table implementations are usually more efficient when the +table contains enough free space to minimize collisions. +Typically, this means that +.I nel +should be at least 25% larger than the maximum number of elements +that the caller expects to store in the table. + +The +.BR hdestroy () +and +.BR hdestroy _r() +functions do not free the buffers pointed to by the +.I key +and +.I data +elements of the hash table entries. +(It can't do this because it doesn't know +whether these buffers were allocated dynamically.) +If these buffers need to be freed (perhaps because the program +is repeatedly creating and destroying hash tables, +rather than creating a single table whose lifetime +matches that of the program), +then the program must maintain bookkeeping data structures that +allow it to free them. +.SH BUGS +SVr4 and POSIX.1-2001 specify that \fIaction\fP +is significant only for unsuccessful searches, so that an \fBENTER\fP +should not do anything for a successful search. +In libc and glibc (before version 2.3), the +implementation violates the specification, +updating the \fIdata\fP for the given \fIkey\fP in this case. + +Individual hash table entries can be added, but not deleted. +.SH EXAMPLE +.PP +The following program inserts 24 items into a hash table, then prints +some of them. +.nf + +#include +#include +#include + +char *data[] = { "alpha", "bravo", "charlie", "delta", + "echo", "foxtrot", "golf", "hotel", "india", "juliet", + "kilo", "lima", "mike", "november", "oscar", "papa", + "quebec", "romeo", "sierra", "tango", "uniform", + "victor", "whisky", "x\-ray", "yankee", "zulu" +}; + +int +main(void) +{ + ENTRY e, *ep; + int i; + + hcreate(30); + + for (i = 0; i < 24; i++) { + e.key = data[i]; + /* data is just an integer, instead of a + pointer to something */ + e.data = (void *) i; + ep = hsearch(e, ENTER); + /* there should be no failures */ + if (ep == NULL) { + fprintf(stderr, "entry failed\\n"); + exit(EXIT_FAILURE); + } + } + + for (i = 22; i < 26; i++) { + /* print two entries from the table, and + show that two are not in the table */ + e.key = data[i]; + ep = hsearch(e, FIND); + printf("%9.9s \-> %9.9s:%d\\n", e.key, + ep ? ep\->key : "NULL", ep ? (int)(ep\->data) : 0); + } + hdestroy(); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR bsearch (3), +.BR lsearch (3), +.BR malloc (3), +.BR tsearch (3), +.BR feature_test_macros (7) diff --git a/original/man3/hsearch_r.3 b/original/man3/hsearch_r.3 new file mode 100644 index 00000000..f4a0405d --- /dev/null +++ b/original/man3/hsearch_r.3 @@ -0,0 +1 @@ +.so man3/hsearch.3 diff --git a/original/man3/hstrerror.3 b/original/man3/hstrerror.3 new file mode 100644 index 00000000..7d0fb4b7 --- /dev/null +++ b/original/man3/hstrerror.3 @@ -0,0 +1 @@ +.so man3/gethostbyname.3 diff --git a/original/man3/htobe16.3 b/original/man3/htobe16.3 new file mode 100644 index 00000000..8b7bc771 --- /dev/null +++ b/original/man3/htobe16.3 @@ -0,0 +1 @@ +.so man3/endian.3 diff --git a/original/man3/htobe32.3 b/original/man3/htobe32.3 new file mode 100644 index 00000000..8b7bc771 --- /dev/null +++ b/original/man3/htobe32.3 @@ -0,0 +1 @@ +.so man3/endian.3 diff --git a/original/man3/htobe64.3 b/original/man3/htobe64.3 new file mode 100644 index 00000000..8b7bc771 --- /dev/null +++ b/original/man3/htobe64.3 @@ -0,0 +1 @@ +.so man3/endian.3 diff --git a/original/man3/htole16.3 b/original/man3/htole16.3 new file mode 100644 index 00000000..8b7bc771 --- /dev/null +++ b/original/man3/htole16.3 @@ -0,0 +1 @@ +.so man3/endian.3 diff --git a/original/man3/htole32.3 b/original/man3/htole32.3 new file mode 100644 index 00000000..8b7bc771 --- /dev/null +++ b/original/man3/htole32.3 @@ -0,0 +1 @@ +.so man3/endian.3 diff --git a/original/man3/htole64.3 b/original/man3/htole64.3 new file mode 100644 index 00000000..8b7bc771 --- /dev/null +++ b/original/man3/htole64.3 @@ -0,0 +1 @@ +.so man3/endian.3 diff --git a/original/man3/htonl.3 b/original/man3/htonl.3 new file mode 100644 index 00000000..ba374e84 --- /dev/null +++ b/original/man3/htonl.3 @@ -0,0 +1 @@ +.so man3/byteorder.3 diff --git a/original/man3/htons.3 b/original/man3/htons.3 new file mode 100644 index 00000000..ba374e84 --- /dev/null +++ b/original/man3/htons.3 @@ -0,0 +1 @@ +.so man3/byteorder.3 diff --git a/original/man3/hypot.3 b/original/man3/hypot.3 new file mode 100644 index 00000000..f8da331b --- /dev/null +++ b/original/man3/hypot.3 @@ -0,0 +1,154 @@ +.\" 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-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-07-27 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH HYPOT 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +hypot, hypotf, hypotl \- Euclidean distance function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double hypot(double " x ", double " y ); +.br +.BI "float hypotf(float " x ", float " y ); +.br +.BI "long double hypotl(long double " x ", long double " y ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR hypot (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR hypotf (), +.BR hypotl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR hypot () +function returns +.RI sqrt( x * x + y * y ). +This is the length of the hypotenuse of a right-angled triangle +with sides of length +.I x +and +.IR y , +or the distance of the point +.RI ( x , y ) +from the origin. + +The calculation is performed without undue overflow or underflow +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). +.SH RETURN VALUE +On success, these functions return the length of a right-angled triangle +with sides of length +.I x +and +.IR y . + +If +.I x +or +.I y +is an infinity, +positive infinity is returned. + +If +.I x +or +.I y +is a NaN, +and the other argument is not an infinity, +a NaN is returned. + +If the result overflows, +a range error occurs, +and the functions return +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +respectively. + +If both arguments are subnormal, and the result is subnormal, +.\" Actually, could the result not be subnormal if both arguments +.\" are subnormal? I think not -- mtk, Jul 2008 +a range error occurs, +and the correct result is returned. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Range error: result overflow +.I errno +is set to +.BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.TP +Range error: result underflow +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An underflow floating-point exception +.RB ( FE_UNDERFLOW ) +is raised. +.IP +These functions do not set +.IR errno +for this case. +.\" 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 +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD. +.SH "SEE ALSO" +.BR cabs (3), +.BR sqrt (3) diff --git a/original/man3/hypotf.3 b/original/man3/hypotf.3 new file mode 100644 index 00000000..e5c8ab88 --- /dev/null +++ b/original/man3/hypotf.3 @@ -0,0 +1 @@ +.so man3/hypot.3 diff --git a/original/man3/hypotl.3 b/original/man3/hypotl.3 new file mode 100644 index 00000000..e5c8ab88 --- /dev/null +++ b/original/man3/hypotl.3 @@ -0,0 +1 @@ +.so man3/hypot.3 diff --git a/original/man3/iconv.3 b/original/man3/iconv.3 new file mode 100644 index 00000000..8e1880d0 --- /dev/null +++ b/original/man3/iconv.3 @@ -0,0 +1,123 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" +.\" 2000-06-30 correction by Yuichi SATO +.\" 2000-11-15 aeb, fixed prototype +.\" +.TH ICONV 3 2008-09-08 "GNU" "Linux Programmer's Manual" +.SH NAME +iconv \- perform character set conversion +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t iconv(iconv_t " cd , +.BI " char **" inbuf ", size_t *" inbytesleft , +.BI " char **" outbuf ", size_t *" outbytesleft ); +.fi +.SH DESCRIPTION +The argument \fIcd\fP must be a conversion descriptor created using the +function +.BR iconv_open (3). +.PP +The main case is when \fIinbuf\fP is not NULL and \fI*inbuf\fP is not NULL. +In this case, the +.BR iconv () +function converts the multibyte sequence +starting at \fI*inbuf\fP to a multibyte sequence starting at \fI*outbuf\fP. +At most \fI*inbytesleft\fP bytes, starting at \fI*inbuf\fP, will be read. +At most \fI*outbytesleft\fP bytes, starting at \fI*outbuf\fP, will be written. +.PP +The +.BR iconv () +function converts one multibyte character at a time, and for +each character conversion it increments \fI*inbuf\fP and decrements +\fI*inbytesleft\fP by the number of converted input bytes, it increments +\fI*outbuf\fP and decrements \fI*outbytesleft\fP by the number of converted +output bytes, and it updates the conversion state contained in \fIcd\fP. +If the character encoding of the input is stateful, the +.BR iconv () +function can also convert a sequence of input bytes +to an update to the conversion state without producing any output bytes; +such input is called a \fIshift sequence\fP. +The conversion can stop for four reasons: +.PP +1. An invalid multibyte sequence is encountered in the input. +In this case +it sets \fIerrno\fP to \fBEILSEQ\fP and returns +.IR (size_t)\ \-1 . +\fI*inbuf\fP +is left pointing to the beginning of the invalid multibyte sequence. +.PP +2. The input byte sequence has been entirely converted, +that is, \fI*inbytesleft\fP has gone down to 0. +In this case +.BR iconv () +returns the number of +nonreversible conversions performed during this call. +.PP +3. An incomplete multibyte sequence is encountered in the input, and the +input byte sequence terminates after it. +In this case it sets \fIerrno\fP to +\fBEINVAL\fP and returns +.IR (size_t)\ \-1 . +\fI*inbuf\fP is left pointing to the +beginning of the incomplete multibyte sequence. +.PP +4. The output buffer has no more room for the next converted character. +In this case it sets \fIerrno\fP to \fBE2BIG\fP and returns +.IR (size_t)\ \-1 . +.PP +A different case is when \fIinbuf\fP is NULL or \fI*inbuf\fP is NULL, but +\fIoutbuf\fP is not NULL and \fI*outbuf\fP is not NULL. +In this case, the +.BR iconv () +function attempts to set \fIcd\fP's conversion state to the +initial state and store a corresponding shift sequence at \fI*outbuf\fP. +At most \fI*outbytesleft\fP bytes, starting at \fI*outbuf\fP, will be written. +If the output buffer has no more room for this reset sequence, it sets +\fIerrno\fP to \fBE2BIG\fP and returns +.IR (size_t)\ \-1 . +Otherwise it increments +\fI*outbuf\fP and decrements \fI*outbytesleft\fP by the number of bytes +written. +.PP +A third case is when \fIinbuf\fP is NULL or \fI*inbuf\fP is NULL, and +\fIoutbuf\fP is NULL or \fI*outbuf\fP is NULL. +In this case, the +.BR iconv () +function sets \fIcd\fP's conversion state to the initial state. +.SH "RETURN VALUE" +The +.BR iconv () +function returns the number of characters converted in a +nonreversible way during this call; reversible conversions are not counted. +In case of error, it sets \fIerrno\fP and returns +.IR (size_t)\ \-1 . +.SH ERRORS +The following errors can occur, among others: +.TP +.B E2BIG +There is not sufficient room at \fI*outbuf\fP. +.TP +.B EILSEQ +An invalid multibyte sequence has been encountered in the input. +.TP +.B EINVAL +An incomplete multibyte sequence has been encountered in the input. +.SH VERSIONS +This function is available in glibc since version 2.1. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH "SEE ALSO" +.BR iconv_close (3), +.BR iconv_open (3) diff --git a/original/man3/iconv_close.3 b/original/man3/iconv_close.3 new file mode 100644 index 00000000..05e28ac4 --- /dev/null +++ b/original/man3/iconv_close.3 @@ -0,0 +1,40 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.TH ICONV_CLOSE 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH NAME +iconv_close \- deallocate descriptor for character set conversion +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iconv_close(iconv_t " cd ); +.fi +.SH DESCRIPTION +The +.BR iconv_close () +function deallocates a conversion descriptor \fIcd\fP +previously allocated using +.BR iconv_open (3). +.SH "RETURN VALUE" +When successful, the +.BR iconv_close () +function returns 0. +In case of error, it sets +.I errno +and returns \-1. +.SH VERSIONS +This function is available in glibc since version 2.1. +.SH "CONFORMING TO" +UNIX98, POSIX.1-2001. +.SH "SEE ALSO" +.BR iconv (3), +.BR iconv_open (3) diff --git a/original/man3/iconv_open.3 b/original/man3/iconv_open.3 new file mode 100644 index 00000000..dd0aa93e --- /dev/null +++ b/original/man3/iconv_open.3 @@ -0,0 +1,89 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" +.\" 2007-03-31 Bruno Haible, Describe the glibc/libiconv //TRANSLIT +.\" and //IGNORE extensions for 'tocode'. +.\" +.TH ICONV_OPEN 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH NAME +iconv_open \- allocate descriptor for character set conversion +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "iconv_t iconv_open(const char *" tocode ", const char *" fromcode ); +.fi +.SH DESCRIPTION +The +.BR iconv_open () +function allocates a conversion descriptor suitable +for converting byte sequences from character encoding \fIfromcode\fP to +character encoding \fItocode\fP. +.PP +The values permitted for \fIfromcode\fP and \fItocode\fP and the supported +combinations are system-dependent. +For the GNU C library, the permitted +values are listed by the \fBiconv \-\-list\fP command, and all combinations +of the listed values are supported. +Furthermore the GNU C library and the +GNU libiconv library support the following two suffixes: +.TP +//TRANSLIT +When the string "//TRANSLIT" is appended to \fItocode\fP, transliteration +is activated. +This means that when a character cannot be represented in the +target character set, it can be approximated through one or several +similarly looking characters. +.TP +//IGNORE +When the string "//IGNORE" is appended to \fItocode\fP, characters that +cannot be represented in the target character set will be silently discarded. +.PP +The resulting conversion descriptor can be used with +.BR iconv (3) +any number of times. +It remains valid until deallocated using +.BR iconv_close (3). +.PP +A conversion descriptor contains a conversion state. +After creation using +.BR iconv_open (), +the state is in the initial state. +Using +.BR iconv (3) +modifies the descriptor's conversion state. +(This implies that a conversion +descriptor can not be used in multiple threads simultaneously.) +To bring the state back to the initial state, use +.BR iconv (3) +with NULL as \fIinbuf\fP argument. +.SH "RETURN VALUE" +The +.BR iconv_open () +function returns a freshly allocated conversion +descriptor. +In case of error, it sets \fIerrno\fP and returns +.IR (iconv_t)\ \-1 . +.SH ERRORS +The following error can occur, among others: +.TP +.B EINVAL +The conversion from \fIfromcode\fP to \fItocode\fP is not supported by the +implementation. +.SH VERSIONS +This function is available in glibc since version 2.1. +.SH "CONFORMING TO" +UNIX98, POSIX.1-2001. +.SH "SEE ALSO" +.BR iconv (1), +.BR iconv (3), +.BR iconv_close (3) diff --git a/original/man3/ilogb.3 b/original/man3/ilogb.3 new file mode 100644 index 00000000..b4a9776b --- /dev/null +++ b/original/man3/ilogb.3 @@ -0,0 +1,137 @@ +.\" 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. +.\" +.\" Inspired by a page by Walter Harms created 2002-08-10 +.\" +.TH ILOGB 3 2009-02-04 "" "Linux Programmer's Manual" +.SH NAME +ilogb, ilogbf, ilogbl \- get integer exponent of a floating-point value +.SH SYNOPSIS +.B #include +.sp +.BI "int ilogb(double " x ); +.br +.BI "int ilogbf(float " x ); +.br +.BI "int ilogbl(long double " x ); +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR ilogb (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR ilogbf (), +.BR ilogbl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions return the exponent part of their argument +as a signed integer. +When no error occurs, these functions +are equivalent to the corresponding +.BR logb (3) +functions, cast to +.IR int . +.SH RETURN VALUE +On success, these functions return the exponent of +.IR x , +as a signed integer. + +If +.I x +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. +.BR FP_ILOGB0 . +.\" glibc: The numeric value is either `INT_MIN' or `-INT_MAX'. + +If +.I x +is a NaN, then a domain error occurs, and the functions return +.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. + +If +.I x +is negative infinity or positive infinity, then +a domain error occurs, and the functions return +.BR INT_MAX . +.\" +.\" POSIX.1-2001 also says: +.\" If the correct value is greater than {INT_MAX}, {INT_MAX} +.\" shall be returned and a domain error shall occur. +.\" +.\" If the correct value is less than {INT_MIN}, {INT_MIN} +.\" shall be returned and a domain error shall occur. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is 0 or a NaN +.\" .I errno +.\" is set to +.\" .BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.IP +These functions do not set +.IR errno +for this case. +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6794 +.TP +Domain error: \fIx\fP is an infinity +.\" .I errno +.\" is set to +.\" .BR EDOM . +.\" An invalid floating-point exception +.\" .RB ( FE_INVALID ) +.\" is raised. +.IP +These functions do not set +.IR errno +or raise an exception for this case. +.\" 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 +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR log (3), +.BR logb (3), +.BR significand (3) diff --git a/original/man3/ilogbf.3 b/original/man3/ilogbf.3 new file mode 100644 index 00000000..213d00af --- /dev/null +++ b/original/man3/ilogbf.3 @@ -0,0 +1 @@ +.so man3/ilogb.3 diff --git a/original/man3/ilogbl.3 b/original/man3/ilogbl.3 new file mode 100644 index 00000000..213d00af --- /dev/null +++ b/original/man3/ilogbl.3 @@ -0,0 +1 @@ +.so man3/ilogb.3 diff --git a/original/man3/imaxabs.3 b/original/man3/imaxabs.3 new file mode 100644 index 00000000..97db8d2b --- /dev/null +++ b/original/man3/imaxabs.3 @@ -0,0 +1 @@ +.so man3/abs.3 diff --git a/original/man3/imaxdiv.3 b/original/man3/imaxdiv.3 new file mode 100644 index 00000000..934824e3 --- /dev/null +++ b/original/man3/imaxdiv.3 @@ -0,0 +1 @@ +.so man3/div.3 diff --git a/original/man3/index.3 b/original/man3/index.3 new file mode 100644 index 00000000..9e31edbe --- /dev/null +++ b/original/man3/index.3 @@ -0,0 +1,79 @@ +.\" 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 Mon Apr 12 12:54:34 1993, David Metcalfe +.\" Modified Sat Jul 24 19:13:52 1993, Rik Faith (faith@cs.unc.edu) +.TH INDEX 3 2009-03-15 "GNU" "Linux Programmer's Manual" +.SH NAME +index, rindex \- locate character in string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *index(const char *" s ", int " c ); +.sp +.BI "char *rindex(const char *" s ", int " c ); +.fi +.SH DESCRIPTION +The +.BR index () +function returns a pointer to the first occurrence +of the character \fIc\fP in the string \fIs\fP. +.PP +The +.BR rindex () +function returns a pointer to the last occurrence +of the character \fIc\fP in the string \fIs\fP. +.PP +The terminating NULL character is considered to be a part of the +strings. +.SH "RETURN VALUE" +The +.BR index () +and +.BR rindex () +functions return a pointer to +the matched character or NULL if the character is not found. +.SH "CONFORMING TO" +4.3BSD; marked as LEGACY in POSIX.1-2001. +POSIX.1-2008 removes the specifications of +.BR index () +and +.BR rindex (), +recommending +.BR strchr (3) +and +.BR strrchr (3) +instead. +.SH "SEE ALSO" +.BR memchr (3), +.BR strchr (3), +.BR strpbrk (3), +.BR strrchr (3), +.BR strsep (3), +.BR strspn (3), +.BR strstr (3), +.BR strtok (3) diff --git a/original/man3/inet.3 b/original/man3/inet.3 new file mode 100644 index 00000000..c4b32002 --- /dev/null +++ b/original/man3/inet.3 @@ -0,0 +1,306 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" libc.info (from glibc distribution) +.\" Modified Sat Jul 24 19:12:00 1993 by Rik Faith +.\" Modified Sun Sep 3 20:29:36 1995 by Jim Van Zandt +.\" Changed network into host byte order (for inet_network), +.\" Andreas Jaeger , 980130. +.\" 2008-06-19, mtk +.\" Describe the various address forms supported by inet_aton(). +.\" Clarify discussion of inet_lnaof(), inet_netof(), and inet_makeaddr(). +.\" Add discussion of Classful Addressing, noting that it is obsolete. +.\" Added an EXAMPLE program. +.\" +.TH INET 3 2008-06-19 "GNU" "Linux Programmer's Manual" +.SH NAME +inet_aton, inet_addr, inet_network, inet_ntoa, inet_makeaddr, inet_lnaof, +inet_netof \- Internet address manipulation routines +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.sp +.BI "int inet_aton(const char *" cp ", struct in_addr *" inp ); +.sp +.BI "in_addr_t inet_addr(const char *" cp ); +.sp +.BI "in_addr_t inet_network(const char *" cp ); +.sp +.BI "char *inet_ntoa(struct in_addr " in ); +.sp +.BI "struct in_addr inet_makeaddr(int " net ", int " host ); +.sp +.BI "in_addr_t inet_lnaof(struct in_addr " in ); +.sp +.BI "in_addr_t inet_netof(struct in_addr " in ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR inet_aton (), +.BR inet_ntoa (): +_BSD_SOURCE || _SVID_SOURCE +.SH DESCRIPTION +.BR inet_aton () +converts the Internet host address \fIcp\fP from the +IPv4 numbers-and-dots notation into binary form (in network byte order) +and stores it in the structure that \fIinp\fP points to. +.BR inet_aton () +returns nonzero if the address is valid, zero if not. +The address supplied in +.I cp +can have one of the following forms: +.TP 10 +.I a.b.c.d +Each of the four numeric parts specifies a byte of the address; +the bytes are assigned in left-to-right order to produce the binary address. +.TP +.I a.b.c +Parts +.I a +and +.I b +specify the first two bytes of the binary address. +Part +.I c +is interpreted as a 16-bit value that defines the rightmost two bytes +of the binary address. +This notation is suitable for specifying (outmoded) Class B +network addresses. +.TP +.I a.b +Part +.I a +specifies the first byte of the binary address. +Part +.I b +is interpreted as a 24-bit value that defines the rightmost three bytes +of the binary address. +This notation is suitable for specifying (outmoded) Class C +network addresses. +.TP +.I a +The value +.I a +is interpreted as a 32-bit value that is stored directly +into the binary address without any byte rearrangement. +.PP +In all of the above forms, +components of the dotted address can be specified in decimal, +octal (with a leading +.IR 0 ), +or hexadecimal, with a leading +.IR 0X ). +Addresses in any of these forms are collectively termed +.IR "IPV4 numbers-and-dots notation" . +The form that uses exactly four decimal numbers is referred to as +.IR "IPv4 dotted-decimal notation" +(or sometimes: +.IR "IPv4 dotted-quad notation" ). +.PP +The +.BR inet_addr () +function converts the Internet host address +\fIcp\fP from IPv4 numbers-and-dots notation into binary data in network +byte order. +If the input is invalid, +.B INADDR_NONE +(usually \-1) is returned. +Use of this function is problematic because \-1 is a valid address +(255.255.255.255). +Avoid its use in favor of +.BR inet_aton (), +.BR inet_pton (3), +or +.BR getaddrinfo (3) +which provide a cleaner way to indicate error return. +.PP +The +.BR inet_network () +function converts +.IR cp , +a string in IPv4 numbers-and-dots notation, +into a number in host byte order suitable for use as an +Internet network address. +On success, the converted address is returned. +If the input is invalid, \-1 is returned. +.PP +The +.BR inet_ntoa () +function converts the Internet host address +\fIin\fP, given in network byte order, to a string in IPv4 +dotted-decimal notation. +The string is returned in a statically +allocated buffer, which subsequent calls will overwrite. +.PP +The +.BR inet_lnaof () +function returns the local network address part +of the Internet address \fIin\fP. +The returned value is in host byte order. +.PP +The +.BR inet_netof () +function returns the network number part of +the Internet address \fIin\fP. +The returned value is in host byte order. +.PP +The +.BR inet_makeaddr () +function is the converse of +.BR inet_netof () +and +.BR inet_lnaof (). +It returns an Internet host address in network byte order, +created by combining the network number \fInet\fP +with the local address \fIhost\fP, both in +host byte order. +.PP +The structure \fIin_addr\fP as used in +.BR inet_ntoa (), +.BR inet_makeaddr (), +.BR inet_lnaof () +and +.BR inet_netof () +is defined in +.I +as: +.sp +.in +4n +.nf +typedef uint32_t in_addr_t; + +struct in_addr { + in_addr_t s_addr; +}; +.fi +.in +.SH "CONFORMING TO" +4.3BSD. +.BR inet_addr () +and +.BR inet_ntoa () +are specified in POSIX.1-2001. +.BR inet_aton () +is not specified in POSIX.1-2001, but is available on most systems. +.SH NOTES +On the i386 the host byte order is Least Significant Byte +first (little endian), whereas the network byte order, as used on the +Internet, is Most Significant Byte first (big endian). + +.BR inet_lnaof (), +.BR inet_netof (), +and +.BR inet_makeaddr () +are legacy functions that assume they are dealing with +.IR "classful network addresses" . +Classful networking divides IPv4 network addresses into host and network +components at byte boundaries, as follows: +.TP 10 +Class A +This address type is indicated by the value 0 in the +most significant bit of the (network byte ordered) address. +The network address is contained in the most significant byte, +and the host address occupies the remaining three bytes. +.TP +Class B +This address type is indicated by the binary value 10 in the +most significant two bits of the address. +The network address is contained in the two most significant bytes, +and the host address occupies the remaining two bytes. +.TP +Class C +This address type is indicated by the binary value 110 in the +most significant three bits of the address. +The network address is contained in the three most significant bytes, +and the host address occupies the remaining byte. +.PP +Classful network addresses are now obsolete, +having been superseded by Classless Inter-Domain Routing (CIDR), +which divides addresses into network and host components at +arbitrary bit (rather than byte) boundaries. +.SH EXAMPLE +An example of the use of +.BR inet_aton () +and +.BR inet_ntoa () +is shown below. +Here are some example runs: +.in +4n +.nf + +.RB "$" " ./a.out 226.000.000.037" " # Last byte is in octal" +226.0.0.31 +.RB "$" " ./a.out 0x7f.1 " " # First byte is in hex" +127.0.0.1 +.fi +.in +.SS Program source +\& +.nf +#define _BSD_SOURCE +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct in_addr addr; + + if (argc != 2) { + fprintf(stderr, "%s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + if (inet_aton(argv[1], &addr) == 0) { + perror("inet_aton"); + exit(EXIT_FAILURE); + } + + printf("%s\\n", inet_ntoa(addr)); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR byteorder (3), +.BR getaddrinfo (3), +.BR gethostbyname (3), +.BR getnameinfo (3), +.BR getnetent (3), +.BR inet_ntop (3), +.BR inet_pton (3), +.BR hosts (5), +.BR networks (5) diff --git a/original/man3/inet_addr.3 b/original/man3/inet_addr.3 new file mode 100644 index 00000000..0eba30eb --- /dev/null +++ b/original/man3/inet_addr.3 @@ -0,0 +1 @@ +.so man3/inet.3 diff --git a/original/man3/inet_aton.3 b/original/man3/inet_aton.3 new file mode 100644 index 00000000..0eba30eb --- /dev/null +++ b/original/man3/inet_aton.3 @@ -0,0 +1 @@ +.so man3/inet.3 diff --git a/original/man3/inet_lnaof.3 b/original/man3/inet_lnaof.3 new file mode 100644 index 00000000..0eba30eb --- /dev/null +++ b/original/man3/inet_lnaof.3 @@ -0,0 +1 @@ +.so man3/inet.3 diff --git a/original/man3/inet_makeaddr.3 b/original/man3/inet_makeaddr.3 new file mode 100644 index 00000000..4a9e0fd1 --- /dev/null +++ b/original/man3/inet_makeaddr.3 @@ -0,0 +1 @@ +.so man3/inet_addr.3 diff --git a/original/man3/inet_netof.3 b/original/man3/inet_netof.3 new file mode 100644 index 00000000..0eba30eb --- /dev/null +++ b/original/man3/inet_netof.3 @@ -0,0 +1 @@ +.so man3/inet.3 diff --git a/original/man3/inet_network.3 b/original/man3/inet_network.3 new file mode 100644 index 00000000..0eba30eb --- /dev/null +++ b/original/man3/inet_network.3 @@ -0,0 +1 @@ +.so man3/inet.3 diff --git a/original/man3/inet_ntoa.3 b/original/man3/inet_ntoa.3 new file mode 100644 index 00000000..0eba30eb --- /dev/null +++ b/original/man3/inet_ntoa.3 @@ -0,0 +1 @@ +.so man3/inet.3 diff --git a/original/man3/inet_ntop.3 b/original/man3/inet_ntop.3 new file mode 100644 index 00000000..21f1e04b --- /dev/null +++ b/original/man3/inet_ntop.3 @@ -0,0 +1,119 @@ +.\" Copyright 2000 Sam Varshavchik +.\" +.\" 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: RFC 2553 +.TH INET_NTOP 3 2008-11-11 "Linux" "Linux Programmer's Manual" +.SH NAME +inet_ntop \- convert IPv4 and IPv6 addresses from binary to text form +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "const char *inet_ntop(int " "af" ", const void *" "src" , +.BI " char *" "dst" ", socklen_t " "size" ); +.fi +.SH DESCRIPTION +This function converts the network address structure +.I src +in the +.I af +address family into a character string. +The resulting string is copied to the buffer pointed to by +.IR dst , +which must be a non-NULL pointer. +The caller specifies the number of bytes available in this buffer in +the argument +.IR size . +.PP +.BR inet_ntop () +extends the +.BR inet_ntoa (3) +function to support multiple address families, +.BR inet_ntoa (3) +is now considered to be deprecated in favor of +.BR inet_ntop (). +The following address families are currently supported: +.TP +.B AF_INET +.I src +points to a +.I struct in_addr +(in network byte order) +which is converted to an IPv4 network address in +the dotted-decimal format, "\fIddd.ddd.ddd.ddd\fP". +The buffer +.I dst +must be at least +.B INET_ADDRSTRLEN +bytes long. +.TP +.B AF_INET6 +.I src +points to a +.I struct in6_addr +(in network byte order) +which is converted to a representation of this address in the +most appropriate IPv6 network address format for this address. +The buffer +.I dst +must be at least +.B INET6_ADDRSTRLEN +bytes long. +.SH "RETURN VALUE" +On success, +.BR inet_ntop () +returns a non-NULL pointer to +.IR dst . +NULL is returned if there was an error, with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EAFNOSUPPORT +.I af +was not a valid address family. +.TP +.B ENOSPC +The converted address string would exceed the size given by +.IR size . +.SH "CONFORMING TO" +POSIX.1-2001. +Note that RFC\ 2553 defines a prototype where the last argument +.I size +is of type +.IR size_t . +Many systems follow RFC\ 2553. +Glibc 2.0 and 2.1 have +.IR size_t , +but 2.2 and later have +.IR socklen_t . +.\" 2.1.3: size_t, 2.1.91: socklen_t +.SH BUGS +.B AF_INET6 +converts IPv4-mapped IPv6 addresses into an IPv6 format. +.SH EXAMPLE +See +.BR inet_pton (3). +.SH "SEE ALSO" +.BR getnameinfo (3), +.BR inet (3), +.BR inet_pton (3) diff --git a/original/man3/inet_pton.3 b/original/man3/inet_pton.3 new file mode 100644 index 00000000..dfc879f2 --- /dev/null +++ b/original/man3/inet_pton.3 @@ -0,0 +1,216 @@ +.\" Copyright 2000 Sam Varshavchik +.\" 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: RFC 2553 +.TH INET_PTON 3 2008-06-18 "Linux" "Linux Programmer's Manual" +.SH NAME +inet_pton \- convert IPv4 and IPv6 addresses from text to binary form +.SH SYNOPSIS +.nf +.B #include + +.BI "int inet_pton(int " "af" ", const char *" "src" ", void *" "dst" ); +.fi +.SH DESCRIPTION +This function converts the character string +.I src +into a network address structure in the +.I af +address family, then +copies +the network address structure to +.IR dst . +The +.I af +argument must be either +.B AF_INET +or +.BR AF_INET6 . +.PP +The following address families are currently supported: +.TP +.B AF_INET +.I src +points to a character string containing an IPv4 network address in +dotted-decimal format, "\fIddd.ddd.ddd.ddd\fP", where +.I ddd +is a decimal number of up to three digits in the range 0 to 255. +The address is converted to a +.I struct in_addr +and copied to +.IR dst , +which must be +.I sizeof(struct in_addr) +(4) bytes (32 bits) long. +.TP +.B AF_INET6 +.I src +points to a character string containing an IPv6 network address. +The address is converted to a +.I struct in6_addr +and copied to +.IR dst , +which must be +.I sizeof(struct in6_addr) +(16) bytes (128 bits) long. +The allowed formats for IPv6 addresses follow these rules: +.RS +.IP 1. 3 +The preferred format is +.IR x:x:x:x:x:x:x:x . +This form consists of eight hexadecimal numbers, +each of which expresses a 16-bit value (i.e., each +.I x +can be up to 4 hex digits). +.IP 2. +A series of contiguous zero values in the preferred format +can be abbreviated to +.IR :: . +Only one instance of +.I :: +can occur in an address. +For example, the loopback address +.I 0:0:0:0:0:0:0:1 +can be abbreviated as +.IR ::1 . +The wildcard address, consisting of all zeroes, can be written as +.IR :: . +.IP 3. +An alternate format is useful for expressing IPv4-mapped IPv6 addresses. +This form is written as +.IR x:x:x:x:x:x:d.d.d.d , +where the six leading +.IR x s +are hexadecimal values that define the six most-significant +16-bit pieces of the address (i.e., 96 bits), and the +.IR d s +express a value in dotted-decimal notation that +defines the least significant 32 bits of the address. +An example of such an address is +.IR ::FFFF:204.152.189.116 . +.RE +.IP +See RFC 2373 for further details on the representation of IPv6 addresses. +.SH "RETURN VALUE" +.BR inet_pton () +returns 1 on success (network address was successfully converted). +0 is returned if +.I src +does not contain a character string representing a valid network +address in the specified address family. +If +.I af +does not contain a valid address family, \-1 is returned and +.I errno +is set to +.BR EAFNOSUPPORT . +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +Unlike +.BR inet_aton (3) +and +.BR inet_addr (3), +.BR inet_pton () +supports IPv6 addresses. +On the other hand, +.BR inet_pton () +only accepts IPv4 addresses in dotted-decimal notation, whereas +.BR inet_aton (3) +and +.BR inet_addr (3) +allow the more general numbers-and-dots notation (hexadecimal +and octal number formats, and formats that don't require all +four bytes to be explicitly written). +For an interface that handles both IPv6 addresses, and IPv4 +addresses in numbers-and-dots notation, see +.BR getaddrinfo (3). +.SH BUGS +.B AF_INET6 +does not recognize IPv4 addresses. +An explicit IPv4-mapped IPv6 address must be supplied in +.I src +instead. +.SH EXAMPLE +The program below demonstrates the use of +.BR inet_pton () +and +.BR inet_ntop (3). +Here are some example runs: +.in +4n +.nf + +.RB "$" " ./a.out i6 0:0:0:0:0:0:0:0" +:: +.RB "$" " ./a.out i6 1:0:0:0:0:0:0:8" +1::8 +.RB "$" " ./a.out i6 0:0:0:0:0:FFFF:204.152.189.116" +::ffff:204.152.189.116 +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + unsigned char buf[sizeof(struct in6_addr)]; + int domain, s; + char str[INET6_ADDRSTRLEN]; + + if (argc != 3) { + fprintf(stderr, "Usage: %s {i4|i6|} string\\n", argv[0]); + exit(EXIT_FAILURE); + } + + domain = (strcmp(argv[1], "i4") == 0) ? AF_INET : + (strcmp(argv[1], "i6") == 0) ? AF_INET6 : atoi(argv[1]); + + s = inet_pton(domain, argv[2], buf); + if (s <= 0) { + if (s == 0) + fprintf(stderr, "Not in presentation format"); + else + perror("inet_pton"); + exit(EXIT_FAILURE); + } + + if (inet_ntop(domain, buf, str, INET6_ADDRSTRLEN) == NULL) { + perror("inet_ntop"); + exit(EXIT_FAILURE); + } + + printf("%s\\n", str); + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR getaddrinfo (3), +.BR inet (3), +.BR inet_ntop (3) diff --git a/original/man3/infnan.3 b/original/man3/infnan.3 new file mode 100644 index 00000000..a0cbbe39 --- /dev/null +++ b/original/man3/infnan.3 @@ -0,0 +1,73 @@ +.\" 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 Sat Jul 24 19:11:11 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2004-11-12 as per suggestion by Fabian Kreutz/AEB +.\" to note that this function is not available in glibc2. +.\" +.TH INFNAN 3 1993-06-02 "GNU" "Linux Programmer's Manual" +.SH NAME +infnan \- deal with infinite or not-a-number (NaN) result +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double infnan(int " error ); +.fi +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The +.BR infnan () +function returns a suitable value for infinity and +"not-a-number" (NaN) results. +The value of \fIerror\fP can be +.B ERANGE +to represent infinity or anything else to represent NaN. +\fIerrno\fP +is also set. +.SH "RETURN VALUE" +If \fIerror\fP is +.B ERANGE +(Infinity), +.B HUGE_VAL +is returned. +.PP +If \fIerror\fP is \-\fBERANGE\fP (\-Infinity), \-\fBHUGE_VAL\fP is returned. +.PP +If \fIerror\fP is anything else, NAN is returned. +.SH ERRORS +.TP +.B EDOM +The value of \fIerror\fP is "not-a-number" (NaN). +.TP +.B ERANGE +The value of \fIerror\fP is positive infinity or negative infinity. +.SH "CONFORMING TO" +4.3BSD. +.SH NOTES +This obsolete function was provided in +libc4 and libc5, but is not available in glibc2. diff --git a/original/man3/initgroups.3 b/original/man3/initgroups.3 new file mode 100644 index 00000000..113f6560 --- /dev/null +++ b/original/man3/initgroups.3 @@ -0,0 +1,85 @@ +.\" 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-07-24 by Rik Faith +.\" Modified 2004-10-10 by aeb +.\" +.TH INITGROUPS 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +initgroups \- initialize the supplementary group access list +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "int initgroups(const char *" user ", gid_t " group ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR initgroups (): +_BSD_SOURCE +.SH DESCRIPTION +The +.BR initgroups () +function initializes the group access list by +reading the group database \fI/etc/group\fP and using all groups of +which \fIuser\fP is a member. +The additional group \fIgroup\fP is +also added to the list. + +The +.I user +argument must be non-NULL. +.SH "RETURN VALUE" +The +.BR initgroups () +function returns 0 on success. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B ENOMEM +Insufficient memory to allocate group information structure. +.TP +.B EPERM +The calling process has insufficient privilege. +See the underlying system call +.BR setgroups (2). +.SH FILES +.nf +\fI/etc/group\fP group database file +.fi +.SH "CONFORMING TO" +SVr4, 4.3BSD. +.SH "SEE ALSO" +.BR getgroups (2), +.BR setgroups (2), +.BR credentials (7) diff --git a/original/man3/initstate.3 b/original/man3/initstate.3 new file mode 100644 index 00000000..6e34104e --- /dev/null +++ b/original/man3/initstate.3 @@ -0,0 +1 @@ +.so man3/random.3 diff --git a/original/man3/initstate_r.3 b/original/man3/initstate_r.3 new file mode 100644 index 00000000..b01937f4 --- /dev/null +++ b/original/man3/initstate_r.3 @@ -0,0 +1 @@ +.so man3/random_r.3 diff --git a/original/man3/innetgr.3 b/original/man3/innetgr.3 new file mode 100644 index 00000000..34268f94 --- /dev/null +++ b/original/man3/innetgr.3 @@ -0,0 +1 @@ +.so man3/setnetgrent.3 diff --git a/original/man3/insque.3 b/original/man3/insque.3 new file mode 100644 index 00000000..636f0889 --- /dev/null +++ b/original/man3/insque.3 @@ -0,0 +1,96 @@ +.\" peter memishian -- meem@gnu.ai.mit.edu +.\" $Id: insque.3,v 1.2 1996/10/30 21:03:39 meem Exp meem $ +.\" +.\" 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 (5.4.7) +.\" Solaris 2.x, OSF/1, and HP-UX manpages +.\" Curry's "UNIX Systems Programming for SVR4" (O'Reilly & Associates 1996) +.\" +.\" Changed to POSIX, 2003-08-11, aeb+wh +.\" +.TH INSQUE 3 2008-07-11 "" "Linux Programmer's Manual" +.SH NAME +insque, remque \- insert/remove an item from a queue +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void insque(void *" elem ", void *" prev ); + +.BI "void remque(void *" elem ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR insque (), +.BR remque (): +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +.BR insque () +and +.BR remque () +are functions for manipulating +doubly-linked lists. +Each element in the list is a structure of +which the first two structure elements are a forward and a +backward pointer. + +.BR insque () +inserts the element pointed to by \fIelem\fP +immediately after the element pointed to by \fIprev\fP, which must +not be NULL. + +.BR remque () +removes the element pointed to by \fIelem\fP from the +doubly-linked list. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH "NOTES" +Traditionally (e.g., SunOS, Linux libc 4 and libc 5), +the arguments of these functions were of type \fIstruct qelem *\fP, +defined as: + +.in +4n +.nf +struct qelem { + struct qelem *q_forw; + struct qelem *q_back; + char q_data[1]; +}; +.fi +.in + +This is still what you will get if +.B _GNU_SOURCE +is defined before +including \fI\fP. + +The location of the prototypes for these functions differs among several +versions of Unix. +The above is the POSIX version. +Some systems place them in \fI\fP. +Linux libc4 and libc 5 placed them +in \fI\fP. diff --git a/original/man3/intro.3 b/original/man3/intro.3 new file mode 100644 index 00000000..119bc5b5 --- /dev/null +++ b/original/man3/intro.3 @@ -0,0 +1,97 @@ +.\" 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. +.\" +.\" 2007-10-23 mtk, Nearly a complete rewrite of the earlier page. +.TH INTRO 3 2010-02-03 "Linux" "Linux Programmer's Manual" +.SH NAME +intro \- Introduction to library functions +.SH DESCRIPTION +Section 3 of the manual describes all library functions excluding the library +functions (system call wrappers) described in section 2, +which implement system calls. + +Many of the functions described in the section are part of the +Standard C Library +.RI ( libc ). +Some functions are part of other libraries (e.g., +the math library, +.IR libm , +or the real-time library, +.IR librt ) +in which case the manual page will indicate the linker +option needed to link against the required library +(e.g., +.I \-lm +and +.IR \-lrt , +respectively, +for the aforementioned libraries). + +In some cases, +the programmer must define a feature test macro in order to obtain +the declaration of a function from the header file specified +in the man page SYNOPSIS section. +In such cases, the required macro is described in the man page. +For further information on feature test macros, see +.BR feature_test_macros (7). +.\" +.\" There +.\" are various function groups which can be identified by a letter which +.\" is appended to the chapter number: +.\" .IP (3C) +.\" 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) +.\" These functions are parts of the +.\" .BR stdio (3) +.\" library. They are contained in the standard C library libc. +.\" .IP (3M) +.\" 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 compiler, which needs the option \fI\-lm\fP. +.\" .IP (3F) +.\" These functions are part of the FORTRAN library libF77. There are no +.\" special compiler flags needed to use these functions. +.\" .IP (3X) +.\" Various special libraries. The manual pages documenting their functions +.\" specify the library names. +.SH "CONFORMING TO" +Certain terms and abbreviations are used to indicate Unix variants +and standards to which calls in this section conform. +See +.BR standards (7). +.SH NOTES +.SS Authors and Copyright Conditions +Look at the header of the manual page source for the author(s) and copyright +conditions. +Note that these can be different from page to page! +.SH "SEE ALSO" +.BR intro (2), +.BR errno (3), +.BR feature_test_macros (7), +.BR libc (7), +.BR standards (7) diff --git a/original/man3/iruserok.3 b/original/man3/iruserok.3 new file mode 100644 index 00000000..b58efefa --- /dev/null +++ b/original/man3/iruserok.3 @@ -0,0 +1 @@ +.so man3/rcmd.3 diff --git a/original/man3/isalnum.3 b/original/man3/isalnum.3 new file mode 100644 index 00000000..0b69c754 --- /dev/null +++ b/original/man3/isalnum.3 @@ -0,0 +1 @@ +.so man3/isalpha.3 diff --git a/original/man3/isalpha.3 b/original/man3/isalpha.3 new file mode 100644 index 00000000..a3222881 --- /dev/null +++ b/original/man3/isalpha.3 @@ -0,0 +1,198 @@ +.\" 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:10:00 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Aug 21 17:51:50 1994 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sat Sep 2 21:52:01 1995 by Jim Van Zandt +.\" Modified Mon May 27 22:55:26 1996 by Martin Schulze (joey@linux.de) +.\" +.TH ISALPHA 3 2009-03-15 "GNU" "Linux Programmer's Manual" +.SH NAME +isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower, +isprint, ispunct, isspace, isupper, isxdigit \- character +classification routines +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int isalnum(int " "c" ); +.br +.BI "int isalpha(int " "c" ); +.br +.BI "int isascii(int " "c" ); +.br +.BI "int isblank(int " "c" ); +.br +.BI "int iscntrl(int " "c" ); +.br +.BI "int isdigit(int " "c" ); +.br +.BI "int isgraph(int " "c" ); +.br +.BI "int islower(int " "c" ); +.br +.BI "int isprint(int " "c" ); +.br +.BI "int ispunct(int " "c" ); +.br +.BI "int isspace(int " "c" ); +.br +.BI "int isupper(int " "c" ); +.br +.BI "int isxdigit(int " "c" ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR isascii (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.br +.BR isblank (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions check whether +.IR c , +which must have the value of an +.I unsigned char +or +.BR EOF , +falls into a certain character class according to the current locale. +.TP +.BR isalnum () +checks for an alphanumeric character; it is equivalent to +.BI "(isalpha(" c ") || isdigit(" c "))" \fR. +.TP +.BR isalpha () +checks for an alphabetic character; in the standard \fB"C"\fP +locale, it is equivalent to +.BI "(isupper(" c ") || islower(" c "))" \fR. +In some locales, there may be additional characters for which +.BR isalpha () +is true\(emletters which are neither upper case nor lower +case. +.TP +.BR isascii () +checks whether \fIc\fP is a 7-bit +.I unsigned char +value that fits into +the ASCII character set. +.TP +.BR isblank () +checks for a blank character; that is, a space or a tab. +.TP +.BR iscntrl () +checks for a control character. +.TP +.BR isdigit () +checks for a digit (0 through 9). +.TP +.BR isgraph () +checks for any printable character except space. +.TP +.BR islower () +checks for a lower-case character. +.TP +.BR isprint () +checks for any printable character including space. +.TP +.BR ispunct () +checks for any printable character which is not a space or an +alphanumeric character. +.TP +.BR isspace () +checks for white-space characters. +In the +.B """C""" +and +.B """POSIX""" +locales, these are: space, form-feed +.RB ( \(aq\ef\(aq ), +newline +.RB ( \(aq\en\(aq ), +carriage return +.RB ( \(aq\er\(aq ), +horizontal tab +.RB ( \(aq\et\(aq ), +and vertical tab +.RB ( \(aq\ev\(aq ). +.TP +.BR isupper () +checks for an uppercase letter. +.TP +.BR isxdigit () +checks for a hexadecimal digits, that is, one of +.br +.BR "0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F" . +.SH "RETURN VALUE" +The values returned are nonzero if the character +.I c +falls into the tested class, and a zero value +if not. +.SH "CONFORMING TO" +C99, 4.3BSD. +C89 specifies all of these functions except +.BR isascii () +and +.BR isblank (). +.BR isascii () +is a BSD extension +and is also an SVr4 extension. +.BR isblank () +conforms to POSIX.1-2001 and C99 7.4.1.3. +POSIX.1-2008 marks +.BR isascii () +as obsolete, +noting that it cannot be used portably in a localized application. +.SH NOTES +The details of what characters belong into which class depend on the current +locale. +For example, +.BR isupper () +will not recognize an A-umlaut (\(:A) as an uppercase letter in the default +.B "C" +locale. +.SH "SEE ALSO" +.BR iswalnum (3), +.BR iswalpha (3), +.BR iswblank (3), +.BR iswcntrl (3), +.BR iswdigit (3), +.BR iswgraph (3), +.BR iswlower (3), +.BR iswprint (3), +.BR iswpunct (3), +.BR iswspace (3), +.BR iswupper (3), +.BR iswxdigit (3), +.BR setlocale (3), +.BR toascii (3), +.BR tolower (3), +.BR toupper (3), +.BR ascii (7), +.BR locale (7) diff --git a/original/man3/isascii.3 b/original/man3/isascii.3 new file mode 100644 index 00000000..0b69c754 --- /dev/null +++ b/original/man3/isascii.3 @@ -0,0 +1 @@ +.so man3/isalpha.3 diff --git a/original/man3/isatty.3 b/original/man3/isatty.3 new file mode 100644 index 00000000..a1c48a7e --- /dev/null +++ b/original/man3/isatty.3 @@ -0,0 +1,64 @@ +.\" 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. +.\" +.TH ISATTY 3 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH NAME +isatty \- test whether a file descriptor refers to a terminal +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int isatty(int " fd ); +.fi +.SH DESCRIPTION +The +.BR isatty () +function tests whether +.I fd +is an open file descriptor referring to a terminal. +.SH RETURN VALUE +.BR isatty () +returns 1 if +.I fd +is an open file descriptor referring to a terminal; +otherwise 0 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EBADF +.I fd +is not a valid file descriptor. +.TP +.B EINVAL +.I fd +refers to a file other than a terminal. +POSIX.1-2001 specifies the error +.BR ENOTTY +.\" FIXME File a bug for this? +for this case. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH "SEE ALSO" +.BR fstat (2), +.BR ttyname (3) diff --git a/original/man3/isblank.3 b/original/man3/isblank.3 new file mode 100644 index 00000000..0b69c754 --- /dev/null +++ b/original/man3/isblank.3 @@ -0,0 +1 @@ +.so man3/isalpha.3 diff --git a/original/man3/iscntrl.3 b/original/man3/iscntrl.3 new file mode 100644 index 00000000..0b69c754 --- /dev/null +++ b/original/man3/iscntrl.3 @@ -0,0 +1 @@ +.so man3/isalpha.3 diff --git a/original/man3/isdigit.3 b/original/man3/isdigit.3 new file mode 100644 index 00000000..0b69c754 --- /dev/null +++ b/original/man3/isdigit.3 @@ -0,0 +1 @@ +.so man3/isalpha.3 diff --git a/original/man3/isfinite.3 b/original/man3/isfinite.3 new file mode 100644 index 00000000..17676c2c --- /dev/null +++ b/original/man3/isfinite.3 @@ -0,0 +1 @@ +.so man3/fpclassify.3 diff --git a/original/man3/isgraph.3 b/original/man3/isgraph.3 new file mode 100644 index 00000000..0b69c754 --- /dev/null +++ b/original/man3/isgraph.3 @@ -0,0 +1 @@ +.so man3/isalpha.3 diff --git a/original/man3/isgreater.3 b/original/man3/isgreater.3 new file mode 100644 index 00000000..ebea0366 --- /dev/null +++ b/original/man3/isgreater.3 @@ -0,0 +1,91 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" 2002-07-27 Walter Harms +.\" this was done with the help of the glibc manual +.\" +.TH ISGREATER 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +isgreater, isgreaterequal, isless, islessequal, islessgreater, +isunordered \- floating-point relational tests without exception for NaN +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int isgreater(" x ", " y ); +.sp +.BI "int isgreaterequal(" x ", " y ); +.sp +.BI "int isless(" x ", " y ); +.sp +.BI "int islessequal(" x ", " y ); +.sp +.BI "int islessgreater(" x ", " y ); +.sp +.BI "int isunordered(" x ", " y ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +All functions described here: +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The normal relation operations (like \fB<\fP, "less than") +will fail if one of the operands is NaN. +This will cause an exception. +To avoid this, C99 defines these macros. +The macros are guaranteed to evaluate their operands only once. +The operands can be of any real floating-point type. +.TP +.BR isgreater () +determines \fI(x)\ >\ (y)\fP without an exception +if \fIx\fP or \fIy\fP is NaN. +.TP +.BR isgreaterequal () +determines \fI(x)\ >=\ (y)\fP without an exception +if \fIx\fP or \fIy\fP is NaN. +.TP +.BR isless () +determines \fI(x)\ <\ (y)\fP without an exception +if \fIx\fP or \fIy\fP is NaN. +.TP +.BR islessequal () +determines \fI(x)\ <=\ (y)\fP without an exception +if \fIx\fP or \fIy\fP is NaN. +.TP +.BR islessgreater () +determines \fI(x)\ < (y) || (x) >\ (y)\fP +without an exception if \fIx\fP or \fIy\fP is NaN. +This macro is not equivalent to \fIx\ !=\ y\fP because that expression is +true if \fIx\fP or \fIy\fP is NaN. +.TP +.BR isunordered () +determines whether its arguments are unordered, that is, whether +at least one of the arguments is a NaN. +.SH RETURN VALUE +The macros other than +.BR isunordered () +return the result of the relational comparison; +these macros return 0 if either argument is a NaN. + +.BR isunordered () +returns 1 if \fIx\fP or \fIy\fP is NaN and 0 otherwise. +.SH ERRORS +No errors occur. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH NOTES +Not all hardware supports these functions, +and where hardware support isn't provided, they will be emulated by macros. +This will result in a performance penalty. +Don't use these functions if NaN is of no concern for you. +.SH "SEE ALSO" +.BR fpclassify (3), +.BR isnan (3) diff --git a/original/man3/isgreaterequal.3 b/original/man3/isgreaterequal.3 new file mode 100644 index 00000000..24410b96 --- /dev/null +++ b/original/man3/isgreaterequal.3 @@ -0,0 +1 @@ +.so man3/isgreater.3 diff --git a/original/man3/isinf.3 b/original/man3/isinf.3 new file mode 100644 index 00000000..17676c2c --- /dev/null +++ b/original/man3/isinf.3 @@ -0,0 +1 @@ +.so man3/fpclassify.3 diff --git a/original/man3/isinff.3 b/original/man3/isinff.3 new file mode 100644 index 00000000..19f709b1 --- /dev/null +++ b/original/man3/isinff.3 @@ -0,0 +1 @@ +.so man3/finite.3 diff --git a/original/man3/isinfl.3 b/original/man3/isinfl.3 new file mode 100644 index 00000000..19f709b1 --- /dev/null +++ b/original/man3/isinfl.3 @@ -0,0 +1 @@ +.so man3/finite.3 diff --git a/original/man3/isless.3 b/original/man3/isless.3 new file mode 100644 index 00000000..24410b96 --- /dev/null +++ b/original/man3/isless.3 @@ -0,0 +1 @@ +.so man3/isgreater.3 diff --git a/original/man3/islessequal.3 b/original/man3/islessequal.3 new file mode 100644 index 00000000..24410b96 --- /dev/null +++ b/original/man3/islessequal.3 @@ -0,0 +1 @@ +.so man3/isgreater.3 diff --git a/original/man3/islessgreater.3 b/original/man3/islessgreater.3 new file mode 100644 index 00000000..24410b96 --- /dev/null +++ b/original/man3/islessgreater.3 @@ -0,0 +1 @@ +.so man3/isgreater.3 diff --git a/original/man3/islower.3 b/original/man3/islower.3 new file mode 100644 index 00000000..0b69c754 --- /dev/null +++ b/original/man3/islower.3 @@ -0,0 +1 @@ +.so man3/isalpha.3 diff --git a/original/man3/isnan.3 b/original/man3/isnan.3 new file mode 100644 index 00000000..17676c2c --- /dev/null +++ b/original/man3/isnan.3 @@ -0,0 +1 @@ +.so man3/fpclassify.3 diff --git a/original/man3/isnanf.3 b/original/man3/isnanf.3 new file mode 100644 index 00000000..19f709b1 --- /dev/null +++ b/original/man3/isnanf.3 @@ -0,0 +1 @@ +.so man3/finite.3 diff --git a/original/man3/isnanl.3 b/original/man3/isnanl.3 new file mode 100644 index 00000000..19f709b1 --- /dev/null +++ b/original/man3/isnanl.3 @@ -0,0 +1 @@ +.so man3/finite.3 diff --git a/original/man3/isnormal.3 b/original/man3/isnormal.3 new file mode 100644 index 00000000..17676c2c --- /dev/null +++ b/original/man3/isnormal.3 @@ -0,0 +1 @@ +.so man3/fpclassify.3 diff --git a/original/man3/isprint.3 b/original/man3/isprint.3 new file mode 100644 index 00000000..0b69c754 --- /dev/null +++ b/original/man3/isprint.3 @@ -0,0 +1 @@ +.so man3/isalpha.3 diff --git a/original/man3/ispunct.3 b/original/man3/ispunct.3 new file mode 100644 index 00000000..0b69c754 --- /dev/null +++ b/original/man3/ispunct.3 @@ -0,0 +1 @@ +.so man3/isalpha.3 diff --git a/original/man3/isspace.3 b/original/man3/isspace.3 new file mode 100644 index 00000000..0b69c754 --- /dev/null +++ b/original/man3/isspace.3 @@ -0,0 +1 @@ +.so man3/isalpha.3 diff --git a/original/man3/isunordered.3 b/original/man3/isunordered.3 new file mode 100644 index 00000000..24410b96 --- /dev/null +++ b/original/man3/isunordered.3 @@ -0,0 +1 @@ +.so man3/isgreater.3 diff --git a/original/man3/isupper.3 b/original/man3/isupper.3 new file mode 100644 index 00000000..0b69c754 --- /dev/null +++ b/original/man3/isupper.3 @@ -0,0 +1 @@ +.so man3/isalpha.3 diff --git a/original/man3/iswalnum.3 b/original/man3/iswalnum.3 new file mode 100644 index 00000000..9b515258 --- /dev/null +++ b/original/man3/iswalnum.3 @@ -0,0 +1,71 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH ISWALNUM 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +iswalnum \- test for alphanumeric wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iswalnum(wint_t " wc ); +.fi +.SH DESCRIPTION +The +.BR iswalnum () +function is the wide-character equivalent of the +.BR isalnum (3) +function. +It tests whether \fIwc\fP is a wide character +belonging to the wide-character class "alnum". +.PP +The wide-character class "alnum" is a subclass of the wide-character class +"graph", and therefore also a subclass of the wide-character class "print". +.PP +Being a subclass of the wide-character class "print", +the wide-character class +"alnum" is disjoint from the wide-character class "cntrl". +.PP +Being a subclass of the wide-character class "graph", +the wide-character class "alnum" is disjoint from +the wide-character class "space" and its subclass "blank". +.PP +The wide-character class "alnum" is disjoint from the wide-character class +"punct". +.PP +The wide-character class "alnum" is the union of the wide-character classes +"alpha" and "digit". +As such, it also contains the wide-character class +"xdigit". +.PP +The wide-character class "alnum" always contains at least the letters \(aqA\(aq +to \(aqZ\(aq, \(aqa\(aq to \(aqz\(aq and the digits \(aq0\(aq to \(aq9\(aq. +.SH "RETURN VALUE" +The +.BR iswalnum () +function returns nonzero +if \fIwc\fP is a wide character +belonging to the wide-character class "alnum". +Otherwise it returns zero. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR iswalnum () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR isalnum (3), +.BR iswctype (3) diff --git a/original/man3/iswalpha.3 b/original/man3/iswalpha.3 new file mode 100644 index 00000000..fc7f543a --- /dev/null +++ b/original/man3/iswalpha.3 @@ -0,0 +1,75 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH ISWALPHA 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +iswalpha \- test for alphabetic wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iswalpha(wint_t " wc ); +.fi +.SH DESCRIPTION +The +.BR iswalpha () +function is the wide-character equivalent of the +.BR isalpha (3) +function. +It tests whether \fIwc\fP is a wide character +belonging to the wide-character class "alpha". +.PP +The wide-character class "alpha" is a subclass of the +wide-character class "alnum", +and therefore also a subclass of the wide-character class "graph" and +of the wide-character class "print". +.PP +Being a subclass of the wide-character class "print", +the wide-character class +"alpha" is disjoint from the wide-character class "cntrl". +.PP +Being a subclass of the wide-character class "graph", +the wide-character class "alpha" is disjoint from +the wide-character class "space" and its subclass "blank". +.PP +Being a subclass of the wide-character class "alnum", +the wide-character class "alpha" is disjoint from the +wide-character class "punct". +.PP +The wide-character class "alpha" is disjoint from the wide-character class +"digit". +.PP +The wide-character class "alpha" contains the wide-character classes "upper" +and "lower". +.PP +The wide-character class "alpha" always contains at least the +letters \(aqA\(aq to \(aqZ\(aq and \(aqa\(aq to \(aqz\(aq. +.SH "RETURN VALUE" +The +.BR iswalpha () +function returns nonzero +if \fIwc\fP is a wide character +belonging to the wide-character class "alpha". +Otherwise it returns zero. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR iswalpha () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR isalpha (3), +.BR iswctype (3) diff --git a/original/man3/iswblank.3 b/original/man3/iswblank.3 new file mode 100644 index 00000000..86499d1b --- /dev/null +++ b/original/man3/iswblank.3 @@ -0,0 +1,73 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH ISWBLANK 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +iswblank \- test for whitespace wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iswblank(wint_t " wc ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR iswblank (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR iswblank () +function is the wide-character equivalent of the +.BR isblank (3) +function. +It tests whether \fIwc\fP is a wide character +belonging to the wide-character class "blank". +.PP +The wide-character class "blank" is a subclass of the wide-character class +"space". +.PP +Being a subclass of the wide-character class "space", +the wide-character class "blank" is disjoint from the +wide-character class "graph" and therefore also disjoint +from its subclasses "alnum", "alpha", "upper", "lower", "digit", +"xdigit", "punct". +.PP +The wide-character class "blank" always contains +at least the space character +and the control character \(aq\\t\(aq. +.SH "RETURN VALUE" +The +.BR iswblank () +function returns nonzero +if \fIwc\fP is a wide character +belonging to the wide-character class "blank". +Otherwise it returns zero. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +The behavior of +.BR iswblank () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR isblank (3), +.BR iswctype (3) diff --git a/original/man3/iswcntrl.3 b/original/man3/iswcntrl.3 new file mode 100644 index 00000000..c7b6a404 --- /dev/null +++ b/original/man3/iswcntrl.3 @@ -0,0 +1,56 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH ISWCNTRL 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +iswcntrl \- test for control wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iswcntrl(wint_t " wc ); +.fi +.SH DESCRIPTION +The +.BR iswcntrl () +function is the wide-character equivalent of the +.BR iscntrl (3) +function. +It tests whether \fIwc\fP is a wide character +belonging to the wide-character class "cntrl". +.PP +The wide-character class "cntrl" is disjoint from the wide-character class +"print" and therefore also disjoint from its subclasses "graph", "alpha", +"upper", "lower", "digit", "xdigit", "punct". +.PP +For an unsigned char \fIc\fP, \fIiscntrl(c)\fP +implies \fIiswcntrl(btowc(c))\fP, +but not vice versa. +.SH "RETURN VALUE" +The +.BR iswcntrl () +function returns nonzero if \fIwc\fP is a +wide character belonging to the wide-character class "cntrl". +Otherwise it returns zero. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR iswcntrl () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR iscntrl (3), +.BR iswctype (3) diff --git a/original/man3/iswctype.3 b/original/man3/iswctype.3 new file mode 100644 index 00000000..fa8747be --- /dev/null +++ b/original/man3/iswctype.3 @@ -0,0 +1,68 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH ISWCTYPE 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +iswctype \- wide-character classification +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iswctype(wint_t " wc ", wctype_t " desc ); +.fi +.SH DESCRIPTION +If \fIwc\fP is a wide character having the character property designated by +\fIdesc\fP (or in other words: belongs to the character class designated by +\fIdesc\fP), the +.BR iswctype () +function returns nonzero. +Otherwise it +returns zero. +If \fIwc\fP is +.BR WEOF , +zero is returned. +.PP +\fIdesc\fP must be a character property descriptor +returned by the +.BR wctype () +function. +.SH "RETURN VALUE" +The +.BR iswctype () +function returns nonzero if +the \fIwc\fP has the designated +property. +Otherwise it returns 0. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR iswctype () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR iswalnum (3), +.BR iswalpha (3), +.BR iswblank (3), +.BR iswcntrl (3), +.BR iswdigit (3), +.BR iswgraph (3), +.BR iswlower (3), +.BR iswprint (3), +.BR iswpunct (3), +.BR iswspace (3), +.BR iswupper (3), +.BR iswxdigit (3), +.BR wctype (3) diff --git a/original/man3/iswdigit.3 b/original/man3/iswdigit.3 new file mode 100644 index 00000000..72ff1274 --- /dev/null +++ b/original/man3/iswdigit.3 @@ -0,0 +1,74 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH ISWDIGIT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +iswdigit \- test for decimal digit wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iswdigit(wint_t " wc ); +.fi +.SH DESCRIPTION +The +.BR iswdigit () +function is the wide-character equivalent of the +.BR isdigit (3) +function. +It tests whether \fIwc\fP is a wide character +belonging to the wide-character class "digit". +.PP +The wide-character class "digit" is a subclass of the wide-character class +"xdigit", and therefore also a subclass +of the wide-character class "alnum", of +the wide-character class "graph" and of the wide-character class "print". +.PP +Being a subclass of the wide character +class "print", the wide-character class +"digit" is disjoint from the wide-character class "cntrl". +.PP +Being a subclass of the wide-character class "graph", +the wide-character class +"digit" is disjoint from the wide-character class "space" and its subclass +"blank". +.PP +Being a subclass of the wide-character +class "alnum", the wide-character class +"digit" is disjoint from the wide-character class "punct". +.PP +The wide-character class "digit" is +disjoint from the wide-character class +"alpha" and therefore also disjoint from its subclasses "lower", "upper". +.PP +The wide-character class "digit" always +contains exactly the digits \(aq0\(aq to \(aq9\(aq. +.SH "RETURN VALUE" +The +.BR iswdigit () +function returns nonzero +if \fIwc\fP is a wide character +belonging to the wide-character class "digit". +Otherwise it returns zero. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR iswdigit () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR isdigit (3), +.BR iswctype (3) diff --git a/original/man3/iswgraph.3 b/original/man3/iswgraph.3 new file mode 100644 index 00000000..5cb088b8 --- /dev/null +++ b/original/man3/iswgraph.3 @@ -0,0 +1,67 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH ISWGRAPH 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +iswgraph \- test for graphic wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iswgraph(wint_t " wc ); +.fi +.SH DESCRIPTION +The +.BR iswgraph () +function is the wide-character equivalent of the +.BR isgraph (3) +function. +It tests whether \fIwc\fP is a wide character +belonging to the wide-character class "graph". +.PP +The wide-character class "graph" is a subclass of the wide-character class +"print". +.PP +Being a subclass of the wide-character class "print", +the wide-character class +"graph" is disjoint from the wide-character class "cntrl". +.PP +The wide-character class "graph" is disjoint from the wide-character class +"space" and therefore also disjoint from its subclass "blank". +.\" Note: UNIX98 (susv2/xbd/locale.html) says that "graph" and "space" may +.\" have characters in common, except U+0020. But C99 (ISO/IEC 9899:1999 +.\" section 7.25.2.1.10) says that "space" and "graph" are disjoint. +.PP +The wide-character class "graph" contains all the wide characters from the +wide-character class "print" except the space character. +It therefore contains +the wide-character classes "alnum" and "punct". +.SH "RETURN VALUE" +The +.BR iswgraph () +function returns nonzero +if \fIwc\fP is a wide character +belonging to the wide-character class "graph". +Otherwise it returns zero. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR iswgraph () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR isgraph (3), +.BR iswctype (3) diff --git a/original/man3/iswlower.3 b/original/man3/iswlower.3 new file mode 100644 index 00000000..e6fa00be --- /dev/null +++ b/original/man3/iswlower.3 @@ -0,0 +1,82 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH ISWLOWER 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +iswlower \- test for lowercase wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iswlower(wint_t " wc ); +.fi +.SH DESCRIPTION +The +.BR iswlower () +function is the wide-character equivalent of the +.BR islower (3) +function. +It tests whether \fIwc\fP is a wide character +belonging to the wide-character class "lower". +.PP +The wide-character class "lower" is a subclass of the wide-character class +"alpha", and therefore also a subclass +of the wide-character class "alnum", of +the wide-character class "graph" and of the wide-character class "print". +.PP +Being a subclass of the wide-character class "print", +the wide-character class +"lower" is disjoint from the wide-character class "cntrl". +.PP +Being a subclass of the wide-character class "graph", +the wide-character class "lower" is disjoint from the +wide-character class "space" and its subclass "blank". +.PP +Being a subclass of the wide-character class "alnum", +the wide-character class +"lower" is disjoint from the wide-character class "punct". +.PP +Being a subclass of the wide-character class "alpha", +the wide-character class +"lower" is disjoint from the wide-character class "digit". +.PP +The wide-character class "lower" contains at least +those characters \fIwc\fP +which are equal to \fItowlower(wc)\fP and different +from \fItowupper(wc)\fP. +.PP +The wide-character class "lower" always contains +at least the letters \(aqa\(aq to \(aqz\(aq. +.SH "RETURN VALUE" +The +.BR iswlower () +function returns nonzero +if \fIwc\fP is a wide character +belonging to the wide-character class "lower". +Otherwise it returns zero. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR iswlower () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +This function is not very appropriate for dealing with Unicode characters, +because Unicode knows about three cases: upper, lower and title case. +.SH "SEE ALSO" +.BR islower (3), +.BR iswctype (3), +.BR towlower (3) diff --git a/original/man3/iswprint.3 b/original/man3/iswprint.3 new file mode 100644 index 00000000..64800ad0 --- /dev/null +++ b/original/man3/iswprint.3 @@ -0,0 +1,53 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH ISWPRINT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +iswprint \- test for printing wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iswprint(wint_t " wc ); +.fi +.SH DESCRIPTION +The +.BR iswprint () +function is the wide-character equivalent of the +.BR isprint (3) +function. +It tests whether \fIwc\fP is a wide character +belonging to the wide-character class "print". +.PP +The wide-character class "print" is disjoint from the wide-character class +"cntrl". +.PP +The wide-character class "print" contains the wide-character class "graph". +.SH "RETURN VALUE" +The +.BR iswprint () +function returns nonzero if \fIwc\fP is a +wide character belonging to the wide-character class "print". +Otherwise it returns zero. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR iswprint () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR isprint (3), +.BR iswctype (3) diff --git a/original/man3/iswpunct.3 b/original/man3/iswpunct.3 new file mode 100644 index 00000000..58c9d2ac --- /dev/null +++ b/original/man3/iswpunct.3 @@ -0,0 +1,69 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH ISWPUNCT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +iswpunct \- test for punctuation or symbolic wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iswpunct(wint_t " wc ); +.fi +.SH DESCRIPTION +The +.BR iswpunct () +function is the wide-character equivalent of the +.BR ispunct (3) +function. +It tests whether \fIwc\fP is a wide character +belonging to the wide-character class "punct". +.PP +The wide-character class "punct" is a subclass of the wide-character class +"graph", and therefore also a subclass of the wide-character class "print". +.PP +The wide-character class "punct" is disjoint from the wide-character class +"alnum" and therefore also disjoint from its subclasses "alpha", "upper", +"lower", "digit", "xdigit". +.PP +Being a subclass of the wide-character class "print", +the wide-character class +"punct" is disjoint from the wide-character class "cntrl". +.PP +Being a subclass of the wide-character class "graph", +the wide-character class +"punct" is disjoint from the wide-character class "space" and its subclass +"blank". +.SH "RETURN VALUE" +The +.BR iswpunct () +function returns nonzero +if \fIwc\fP is a wide-character +belonging to the wide-character class "punct". +Otherwise it returns zero. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR iswpunct () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +This function's name is a misnomer when dealing with Unicode characters, +because the wide-character class "punct" contains both punctuation characters +and symbol (math, currency, etc.) characters. +.SH "SEE ALSO" +.BR ispunct (3), +.BR iswctype (3) diff --git a/original/man3/iswspace.3 b/original/man3/iswspace.3 new file mode 100644 index 00000000..e13a2f28 --- /dev/null +++ b/original/man3/iswspace.3 @@ -0,0 +1,61 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH ISWSPACE 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +iswspace \- test for whitespace wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iswspace(wint_t " wc ); +.fi +.SH DESCRIPTION +The +.BR iswspace () +function is the wide-character equivalent of the +.BR isspace (3) +function. +It tests whether \fIwc\fP is a wide character +belonging to the wide-character class "space". +.PP +The wide-character class "space" is disjoint from the wide-character class +"graph" and therefore also disjoint from its subclasses "alnum", "alpha", +"upper", "lower", "digit", "xdigit", "punct". +.\" Note: UNIX98 (susv2/xbd/locale.html) says that "space" and "graph" may +.\" have characters in common, except U+0020. But C99 (ISO/IEC 9899:1999 +.\" section 7.25.2.1.10) says that "space" and "graph" are disjoint. +.PP +The wide-character class "space" contains the wide-character class "blank". +.PP +The wide-character class "space" always contains at least the space character +and the control +characters \(aq\\f\(aq, \(aq\\n\(aq, \(aq\\r\(aq, \(aq\\t\(aq, \(aq\\v\(aq. +.SH "RETURN VALUE" +The +.BR iswspace () +function returns nonzero if \fIwc\fP is a wide character +belonging to the wide-character class "space". +Otherwise it returns zero. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR iswspace () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR isspace (3), +.BR iswctype (3) diff --git a/original/man3/iswupper.3 b/original/man3/iswupper.3 new file mode 100644 index 00000000..9dc49c52 --- /dev/null +++ b/original/man3/iswupper.3 @@ -0,0 +1,75 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH ISWUPPER 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +iswupper \- test for uppercase wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iswupper(wint_t " wc ); +.fi +.SH DESCRIPTION +The +.BR iswupper () +function is the wide-character equivalent of the +.BR isupper (3) +function. +It tests whether \fIwc\fP is a wide character +belonging to the wide-character class "upper". +.PP +The wide-character class "upper" is a subclass of the wide-character class +"alpha", and therefore also a subclass of the wide-character class "alnum", of +the wide-character class "graph" and of the wide-character class "print". +.PP +Being a subclass of the wide-character class "print", the wide-character class +"upper" is disjoint from the wide-character class "cntrl". +.PP +Being a subclass of the wide-character class "graph", the wide-character class +"upper" is disjoint from the wide-character class "space" and its subclass +"blank". +.PP +Being a subclass of the wide-character class "alnum", the wide-character class +"upper" is disjoint from the wide-character class "punct". +.PP +Being a subclass of the wide-character class "alpha", the wide-character class +"upper" is disjoint from the wide-character class "digit". +.PP +The wide-character class "upper" contains at least those characters \fIwc\fP +which are equal to \fItowupper(wc)\fP and different from \fItowlower(wc)\fP. +.PP +The wide-character class "upper" always contains at least the +letters \(aqA\(aq to \(aqZ\(aq. +.SH "RETURN VALUE" +The +.BR iswupper () +function returns nonzero if \fIwc\fP is a wide character +belonging to the wide-character class "upper". +Otherwise it returns zero. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR iswupper () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +This function is not very appropriate for dealing with Unicode characters, +because Unicode knows about three cases: upper, lower and title case. +.SH "SEE ALSO" +.BR isupper (3), +.BR iswctype (3), +.BR towupper (3) diff --git a/original/man3/iswxdigit.3 b/original/man3/iswxdigit.3 new file mode 100644 index 00000000..3e4fdc80 --- /dev/null +++ b/original/man3/iswxdigit.3 @@ -0,0 +1,66 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH ISWXDIGIT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +iswxdigit \- test for hexadecimal digit wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int iswxdigit(wint_t " wc ); +.fi +.SH DESCRIPTION +The +.BR iswxdigit () +function is the wide-character equivalent of the +.BR isxdigit (3) +function. +It tests whether \fIwc\fP is a wide character +belonging to the wide-character class "xdigit". +.PP +The wide-character class "xdigit" is a subclass of the wide-character class +"alnum", and therefore also a subclass of the wide-character class "graph" and +of the wide-character class "print". +.PP +Being a subclass of the wide-character class "print", the wide-character class +"xdigit" is disjoint from the wide-character class "cntrl". +.PP +Being a subclass of the wide-character class "graph", the wide-character class +"xdigit" is disjoint from the wide-character class "space" and its subclass +"blank". +.PP +Being a subclass of the wide-character class "alnum", the wide-character class +"xdigit" is disjoint from the wide-character class "punct". +.PP +The wide-character class "xdigit" always contains at least the +letters \(aqA\(aq to \(aqF\(aq, \(aqa\(aq to \(aqf\(aq +and the digits \(aq0\(aq to \(aq9\(aq. +.SH "RETURN VALUE" +The +.BR iswxdigit () +function returns nonzero if \fIwc\fP is a wide character +belonging to the wide-character class "xdigit". +Otherwise it returns zero. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR iswxdigit () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR iswctype (3), +.BR isxdigit (3) diff --git a/original/man3/isxdigit.3 b/original/man3/isxdigit.3 new file mode 100644 index 00000000..0b69c754 --- /dev/null +++ b/original/man3/isxdigit.3 @@ -0,0 +1 @@ +.so man3/isalpha.3 diff --git a/original/man3/j0.3 b/original/man3/j0.3 new file mode 100644 index 00000000..535f9283 --- /dev/null +++ b/original/man3/j0.3 @@ -0,0 +1,154 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified Sat Jul 24 19:08:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-08-25, aeb +.\" Modified 2004-11-12 as per suggestion by Fabian Kreutz/AEB +.\" 2008-07-24, mtk, moved yxx() material into separate y0.3 page +.\" +.TH J0 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +j0, j0f, j0l, j1, j1f, j1l, jn, jnf, jnl \- +Bessel functions of the first kind +.SH SYNOPSIS +.nf +.B #include +.sp +.fi +.BI "double j0(double " x ); +.br +.BI "double j1(double " x ); +.br +.BI "double jn(int " n ", double " x ); +.sp +.BI "float j0f(float " x ); +.br +.BI "float j1f(float " x ); +.br +.BI "float jnf(int " n ", float " x ); +.sp +.BI "long double j0l(long double " x ); +.br +.BI "long double j1l(long double " x ); +.br +.BI "long double jnl(int " n ", long double " x ); +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR j0 (), +.BR j1 (), +.BR jn (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE +.br +.BR j0f (), +.BR j0l (), +.BR j1f (), +.BR j1l (), +.BR jnf (), +.BR jnl (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.\" Also seems to work: -std=c99 -D_XOPEN_SOURCE +.ad b +.SH DESCRIPTION +The +.BR j0 () +and +.BR j1 () +functions return Bessel functions of \fIx\fP +of the first kind of orders 0 and 1, respectively. +The +.BR jn () +function +returns the Bessel function of \fIx\fP of the first kind of order \fIn\fP. +.PP +The +.BR j0f () +etc. and +.BR j0l () +etc. functions are versions that take and return +.I float +and +.I "long double" +values, respectively. +.SH RETURN VALUE +On success, these functions return the appropriate +Bessel value of the first kind for +.IR x . + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is too large in magnitude, +or the result underflows, +a range error occurs, +and the return value is 0. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Range error: result underflow, or \fIx\fP is too large in magnitude +.I errno +is set to +.BR ERANGE . +.\" An underflow floating-point exception +.\" .RB ( FE_UNDERFLOW ) +.\" is raised. +.PP +These functions do not raise exceptions for +.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 +.SH "CONFORMING TO" +The functions returning +.I double +conform to SVr4, 4.3BSD, +POSIX.1-2001. +The others are nonstandard functions that also exist on the BSDs. +.SH BUGS +There are errors of up to 2e\-16 in the values returned by +.BR j0 (), +.BR j1 () +and +.BR jn () +for values of \fIx\fP between \-8 and 8. +.SH SEE ALSO +.BR y0 (3) diff --git a/original/man3/j0f.3 b/original/man3/j0f.3 new file mode 100644 index 00000000..6dc18188 --- /dev/null +++ b/original/man3/j0f.3 @@ -0,0 +1 @@ +.so man3/j0.3 diff --git a/original/man3/j0l.3 b/original/man3/j0l.3 new file mode 100644 index 00000000..6dc18188 --- /dev/null +++ b/original/man3/j0l.3 @@ -0,0 +1 @@ +.so man3/j0.3 diff --git a/original/man3/j1.3 b/original/man3/j1.3 new file mode 100644 index 00000000..6dc18188 --- /dev/null +++ b/original/man3/j1.3 @@ -0,0 +1 @@ +.so man3/j0.3 diff --git a/original/man3/j1f.3 b/original/man3/j1f.3 new file mode 100644 index 00000000..6dc18188 --- /dev/null +++ b/original/man3/j1f.3 @@ -0,0 +1 @@ +.so man3/j0.3 diff --git a/original/man3/j1l.3 b/original/man3/j1l.3 new file mode 100644 index 00000000..6dc18188 --- /dev/null +++ b/original/man3/j1l.3 @@ -0,0 +1 @@ +.so man3/j0.3 diff --git a/original/man3/jn.3 b/original/man3/jn.3 new file mode 100644 index 00000000..6dc18188 --- /dev/null +++ b/original/man3/jn.3 @@ -0,0 +1 @@ +.so man3/j0.3 diff --git a/original/man3/jnf.3 b/original/man3/jnf.3 new file mode 100644 index 00000000..6dc18188 --- /dev/null +++ b/original/man3/jnf.3 @@ -0,0 +1 @@ +.so man3/j0.3 diff --git a/original/man3/jnl.3 b/original/man3/jnl.3 new file mode 100644 index 00000000..6dc18188 --- /dev/null +++ b/original/man3/jnl.3 @@ -0,0 +1 @@ +.so man3/j0.3 diff --git a/original/man3/jrand48.3 b/original/man3/jrand48.3 new file mode 100644 index 00000000..3133f7d6 --- /dev/null +++ b/original/man3/jrand48.3 @@ -0,0 +1 @@ +.so man3/drand48.3 diff --git a/original/man3/jrand48_r.3 b/original/man3/jrand48_r.3 new file mode 100644 index 00000000..81e9d8ef --- /dev/null +++ b/original/man3/jrand48_r.3 @@ -0,0 +1 @@ +.so man3/drand48_r.3 diff --git a/original/man3/key_decryptsession.3 b/original/man3/key_decryptsession.3 new file mode 100644 index 00000000..bc4bb02b --- /dev/null +++ b/original/man3/key_decryptsession.3 @@ -0,0 +1 @@ +.so man3/key_setsecret.3 diff --git a/original/man3/key_encryptsession.3 b/original/man3/key_encryptsession.3 new file mode 100644 index 00000000..bc4bb02b --- /dev/null +++ b/original/man3/key_encryptsession.3 @@ -0,0 +1 @@ +.so man3/key_setsecret.3 diff --git a/original/man3/key_gendes.3 b/original/man3/key_gendes.3 new file mode 100644 index 00000000..bc4bb02b --- /dev/null +++ b/original/man3/key_gendes.3 @@ -0,0 +1 @@ +.so man3/key_setsecret.3 diff --git a/original/man3/key_secretkey_is_set.3 b/original/man3/key_secretkey_is_set.3 new file mode 100644 index 00000000..bc4bb02b --- /dev/null +++ b/original/man3/key_secretkey_is_set.3 @@ -0,0 +1 @@ +.so man3/key_setsecret.3 diff --git a/original/man3/key_setsecret.3 b/original/man3/key_setsecret.3 new file mode 100644 index 00000000..b7c4d7f4 --- /dev/null +++ b/original/man3/key_setsecret.3 @@ -0,0 +1,65 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" I had no way the check the functions out +.\" be careful +.TH KEY_SETSECRET 3 2002-07-18 "" "Linux Programmer's Manual" +.SH NAME +key_decryptsession, key_encryptsession, key_setsecret, key_gendes, +key_secretkey_is_set \- interfaces to rpc keyserver daemon +.SH SYNOPSIS +.B "#include " +.sp +.BI "int key_decryptsession(const char *" remotename , +.BI "des_block *" deskey ); +.sp +.BI "int key_encryptsession(const char *" remotename , +.BI "des_block *" deskey ); +.sp +.BI "int key_gendes(des_block *" deskey ); +.sp +.BI "int key_setsecret(const char *" key ); +.sp +.B "int key_secretkey_is_set(void);" +.SH DESCRIPTION +The functions here are used within the RPC's secure authentication +mechanism (AUTH_DES). +There should be no need for user programs to +use this functions. + +The function +.BR key_decryptsession () +uses the (remote) server netname and takes the DES key +for decrypting. +It uses the public key of the server and the +secret key associated with the effective UID of the calling process. + +The function +.BR key_encryptsession () +is the inverse of +.BR key_decryptsession (). +It encrypts the DES keys with the public key of the server and +the secret key associated with the effective UID of the calling process. + +The function +.BR key_gendes () +is used to ask the keyserver for a secure conversation key. + +The function +.BR key_setsecret () +is used to set the key for the effective UID of the calling process. + +The function +.BR key_secretkey_is_set () +can be used to determine whether a key has been +set for the effective UID of the calling process. +.SH "RETURN VALUE" +These functions return 1 on success and 0 on failure. +.SH NOTES +Note that we talk about two types of encryption here. +One is asymmetric using a public and secret key. +The other is symmetric, the +64-bit DES. +.PP +These routines were part of the Linux/Doors-project, abandoned by now. +.SH "SEE ALSO" +.BR crypt (3) diff --git a/original/man3/klogctl.3 b/original/man3/klogctl.3 new file mode 100644 index 00000000..bbe6ab28 --- /dev/null +++ b/original/man3/klogctl.3 @@ -0,0 +1 @@ +.so man2/syslog.2 diff --git a/original/man3/l64a.3 b/original/man3/l64a.3 new file mode 100644 index 00000000..e54ce272 --- /dev/null +++ b/original/man3/l64a.3 @@ -0,0 +1 @@ +.so man3/a64l.3 diff --git a/original/man3/labs.3 b/original/man3/labs.3 new file mode 100644 index 00000000..97db8d2b --- /dev/null +++ b/original/man3/labs.3 @@ -0,0 +1 @@ +.so man3/abs.3 diff --git a/original/man3/lckpwdf.3 b/original/man3/lckpwdf.3 new file mode 100644 index 00000000..142c5a5c --- /dev/null +++ b/original/man3/lckpwdf.3 @@ -0,0 +1 @@ +.so man3/getspnam.3 diff --git a/original/man3/lcong48.3 b/original/man3/lcong48.3 new file mode 100644 index 00000000..3133f7d6 --- /dev/null +++ b/original/man3/lcong48.3 @@ -0,0 +1 @@ +.so man3/drand48.3 diff --git a/original/man3/lcong48_r.3 b/original/man3/lcong48_r.3 new file mode 100644 index 00000000..81e9d8ef --- /dev/null +++ b/original/man3/lcong48_r.3 @@ -0,0 +1 @@ +.so man3/drand48_r.3 diff --git a/original/man3/ldexp.3 b/original/man3/ldexp.3 new file mode 100644 index 00000000..dafb6292 --- /dev/null +++ b/original/man3/ldexp.3 @@ -0,0 +1,131 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2004-10-31 by aeb +.\" +.TH LDEXP 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +ldexp, ldexpf, ldexpl \- multiply floating-point number by integral power of 2 +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double ldexp(double " x ", int " exp ); +.br +.BI "float ldexpf(float " x ", int " exp ); +.br +.BI "long double ldexpl(long double " x ", int " exp ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR ldexpf (), +.BR ldexpl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR ldexp () +function returns the result of multiplying the floating-point number +.I x +by 2 raised to the power +.IR exp . +.SH RETURN VALUE +On success, these functions return +.IR "x * (2^exp)" . + +If +.I exp +is zero, then +.I x +is returned. + +If +.I x +is a NaN, +a NaN is returned. + +If +.I x +is positive infinity (negative infinity), +positive infinity (negative infinity) is returned. + +If the result underflows, +an range error occurs, +and zero is returned. + +If the result overflows, +a range error occurs, +and the functions return +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +respectively, with a sign the same as +.IR x . +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Range error, overflow +.I errno +is set to +.BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.TP +Range error, underflow +.I errno +is set to +.BR ERANGE . +An underflow floating-point exception +.RB ( FE_UNDERFLOW ) +is raised. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR frexp (3), +.BR modf (3), +.BR scalbln (3) diff --git a/original/man3/ldexpf.3 b/original/man3/ldexpf.3 new file mode 100644 index 00000000..0e74a023 --- /dev/null +++ b/original/man3/ldexpf.3 @@ -0,0 +1 @@ +.so man3/ldexp.3 diff --git a/original/man3/ldexpl.3 b/original/man3/ldexpl.3 new file mode 100644 index 00000000..0e74a023 --- /dev/null +++ b/original/man3/ldexpl.3 @@ -0,0 +1 @@ +.so man3/ldexp.3 diff --git a/original/man3/ldiv.3 b/original/man3/ldiv.3 new file mode 100644 index 00000000..934824e3 --- /dev/null +++ b/original/man3/ldiv.3 @@ -0,0 +1 @@ +.so man3/div.3 diff --git a/original/man3/le16toh.3 b/original/man3/le16toh.3 new file mode 100644 index 00000000..8b7bc771 --- /dev/null +++ b/original/man3/le16toh.3 @@ -0,0 +1 @@ +.so man3/endian.3 diff --git a/original/man3/le32toh.3 b/original/man3/le32toh.3 new file mode 100644 index 00000000..8b7bc771 --- /dev/null +++ b/original/man3/le32toh.3 @@ -0,0 +1 @@ +.so man3/endian.3 diff --git a/original/man3/le64toh.3 b/original/man3/le64toh.3 new file mode 100644 index 00000000..8b7bc771 --- /dev/null +++ b/original/man3/le64toh.3 @@ -0,0 +1 @@ +.so man3/endian.3 diff --git a/original/man3/lfind.3 b/original/man3/lfind.3 new file mode 100644 index 00000000..24179b4d --- /dev/null +++ b/original/man3/lfind.3 @@ -0,0 +1 @@ +.so man3/lsearch.3 diff --git a/original/man3/lgamma.3 b/original/man3/lgamma.3 new file mode 100644 index 00000000..fc37333a --- /dev/null +++ b/original/man3/lgamma.3 @@ -0,0 +1,159 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" based on glibc infopages +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" +.TH LGAMMA 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +lgamma, lgammaf, lgammal, lgamma_r, lgammaf_r, lgammal_r, signgam \- +log gamma function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double lgamma(double " x ); +.br +.BI "float lgammaf(float " x ); +.br +.BI "long double lgammal(long double " x ); +.sp +.BI "double lgamma_r(double " x ", int *" signp ); +.br +.BI "float lgammaf_r(float " x ", int *" signp ); +.br +.BI "long double lgammal_r(long double " x ", int *" signp ); +.sp +.BI "extern int " signgam ; +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR lgamma (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR lgammaf (), +.BR lgammal (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR lgamma_r (), +.BR lgammaf_r (), +.BR lgammal_r (): +_BSD_SOURCE || _SVID_SOURCE +.br +.IR signgam : +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.ad b +.SH DESCRIPTION +For the definition of the Gamma function, see +.BR tgamma (3). +.PP +The +.BR lgamma () +function returns the natural logarithm of +the absolute value of the Gamma function. +The sign of the Gamma function is returned in the +external integer \fIsigngam\fP declared in +.IR . +It is 1 when the Gamma function is positive or zero, \-1 +when it is negative. +.PP +Since using a constant location +.I signgam +is not thread-safe, the functions +.BR lgamma_r () +etc. have +been introduced; they return the sign via the argument +.IR signp . +.SH RETURN VALUE +On success, these functions return the natural logarithm of Gamma(x). + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is 1 or 2, +0 is returned. + +If +.I x +is positive infinity or negative infinity, +positive infinity is returned. + +If +.I x +is a nonpositive integer, +a pole error occurs, +and the functions return +.RB + HUGE_VAL , +.RB + HUGE_VALF , +or +.RB + HUGE_VALL , +respectively. + +If the result overflows, +a range error occurs, +.\" e.g., lgamma(DBL_MAX) +and the functions return +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +respectively, with the correct mathematical sign. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Pole error: \fIx\fP is a nonpositive integer +.I errno +is set to +.\" FIXME . glibc 2.8 gives EDOM! +.BR ERANGE +(but see BUGS). +A divide-by-zero floating-point exception +.RB ( FE_DIVBYZERO ) +is raised. +.TP +Range error: result overflow +.I errno +is set to +.BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.\" glibc (as at 2.8) also supports an inexact +.\" exception for various cases. +.SH "CONFORMING TO" +The +.BR lgamma () +functions are specified in C99 and POSIX.1-2001. +.I signgam +is specified in POSIX.1-2001, but not in C99. +The +.BR lgamma_r () +functions are nonstandard, but present on several other systems. +.SH BUGS +For a pole error, +.\" +.\" FIXME . this is as at glibc 2.8; check later if this bug is fixed +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6777 +.I errno +is set to +.BR EDOM ; +POSIX.1 says it should be set to +.BR ERANGE . +.SH "SEE ALSO" +.BR tgamma (3) diff --git a/original/man3/lgamma_r.3 b/original/man3/lgamma_r.3 new file mode 100644 index 00000000..be0ed98e --- /dev/null +++ b/original/man3/lgamma_r.3 @@ -0,0 +1 @@ +.so man3/lgamma.3 diff --git a/original/man3/lgammaf.3 b/original/man3/lgammaf.3 new file mode 100644 index 00000000..be0ed98e --- /dev/null +++ b/original/man3/lgammaf.3 @@ -0,0 +1 @@ +.so man3/lgamma.3 diff --git a/original/man3/lgammaf_r.3 b/original/man3/lgammaf_r.3 new file mode 100644 index 00000000..be0ed98e --- /dev/null +++ b/original/man3/lgammaf_r.3 @@ -0,0 +1 @@ +.so man3/lgamma.3 diff --git a/original/man3/lgammal.3 b/original/man3/lgammal.3 new file mode 100644 index 00000000..be0ed98e --- /dev/null +++ b/original/man3/lgammal.3 @@ -0,0 +1 @@ +.so man3/lgamma.3 diff --git a/original/man3/lgammal_r.3 b/original/man3/lgammal_r.3 new file mode 100644 index 00000000..be0ed98e --- /dev/null +++ b/original/man3/lgammal_r.3 @@ -0,0 +1 @@ +.so man3/lgamma.3 diff --git a/original/man3/llabs.3 b/original/man3/llabs.3 new file mode 100644 index 00000000..97db8d2b --- /dev/null +++ b/original/man3/llabs.3 @@ -0,0 +1 @@ +.so man3/abs.3 diff --git a/original/man3/lldiv.3 b/original/man3/lldiv.3 new file mode 100644 index 00000000..934824e3 --- /dev/null +++ b/original/man3/lldiv.3 @@ -0,0 +1 @@ +.so man3/div.3 diff --git a/original/man3/llrint.3 b/original/man3/llrint.3 new file mode 100644 index 00000000..d1c0af3b --- /dev/null +++ b/original/man3/llrint.3 @@ -0,0 +1 @@ +.so man3/lrint.3 diff --git a/original/man3/llrintf.3 b/original/man3/llrintf.3 new file mode 100644 index 00000000..d1c0af3b --- /dev/null +++ b/original/man3/llrintf.3 @@ -0,0 +1 @@ +.so man3/lrint.3 diff --git a/original/man3/llrintl.3 b/original/man3/llrintl.3 new file mode 100644 index 00000000..d1c0af3b --- /dev/null +++ b/original/man3/llrintl.3 @@ -0,0 +1 @@ +.so man3/lrint.3 diff --git a/original/man3/llround.3 b/original/man3/llround.3 new file mode 100644 index 00000000..bcc9b0fd --- /dev/null +++ b/original/man3/llround.3 @@ -0,0 +1 @@ +.so man3/lround.3 diff --git a/original/man3/llroundf.3 b/original/man3/llroundf.3 new file mode 100644 index 00000000..bcc9b0fd --- /dev/null +++ b/original/man3/llroundf.3 @@ -0,0 +1 @@ +.so man3/lround.3 diff --git a/original/man3/llroundl.3 b/original/man3/llroundl.3 new file mode 100644 index 00000000..bcc9b0fd --- /dev/null +++ b/original/man3/llroundl.3 @@ -0,0 +1 @@ +.so man3/lround.3 diff --git a/original/man3/localeconv.3 b/original/man3/localeconv.3 new file mode 100644 index 00000000..7b6a1da3 --- /dev/null +++ b/original/man3/localeconv.3 @@ -0,0 +1,64 @@ +.\" 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:01:20 1993 by Rik Faith (faith@cs.unc.edu) +.TH LOCALECONV 3 1993-04-25 "GNU" "Linux Programmer's Manual" +.SH NAME +localeconv \- get numeric formatting information +.SH SYNOPSIS +.nf +.B #include +.sp +.B struct lconv *localeconv(void); +.fi +.SH DESCRIPTION +The +.BR localeconv () +function returns a pointer to a +.I struct lconv +for the current locale. +This structure is shown in +.BR locale (7), +and contains all values associated with the locale categories +.B LC_NUMERIC +and +.BR LC_MONETARY . +Programs may also use the functions +.BR printf (3) +and +.BR strfmon (3), +which behave according to the actual locale in use. +.SH "CONFORMING TO" +C89, C99. +.SH BUGS +The +.BR printf (3) +family of functions may or may not honor the current locale. +.SH "SEE ALSO" +.BR locale (1), +.BR localedef (1), +.BR isalpha (3), +.BR nl_langinfo (3), +.BR setlocale (3), +.BR strcoll (3), +.BR strftime (3), +.BR locale (7) diff --git a/original/man3/localtime.3 b/original/man3/localtime.3 new file mode 100644 index 00000000..84a3baa9 --- /dev/null +++ b/original/man3/localtime.3 @@ -0,0 +1 @@ +.so man3/ctime.3 diff --git a/original/man3/localtime_r.3 b/original/man3/localtime_r.3 new file mode 100644 index 00000000..84a3baa9 --- /dev/null +++ b/original/man3/localtime_r.3 @@ -0,0 +1 @@ +.so man3/ctime.3 diff --git a/original/man3/lockf.3 b/original/man3/lockf.3 new file mode 100644 index 00000000..3da9dda7 --- /dev/null +++ b/original/man3/lockf.3 @@ -0,0 +1,152 @@ +.\" Copyright 1997 Nicolás Lichtmaier +.\" Created Thu Aug 7 00:44:00 ART 1997 +.\" +.\" 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. +.\" +.\" Added section stuff, aeb, 2002-04-22. +.\" Corrected include file, drepper, 2003-06-15. +.\" +.TH LOCKF 3 2009-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +lockf \- apply, test or remove a POSIX lock on an open file +.SH SYNOPSIS +.B #include +.sp +.BI "int lockf(int " fd ", int " cmd ", off_t " len ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR lockf (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +Apply, test or remove a POSIX lock on a section of an open file. +The file is specified by +.IR fd , +a file descriptor open for writing, the action by +.IR cmd , +and the section consists of byte positions +.IR pos .. pos + len \-1 +if +.I len +is positive, and +.IR pos \- len .. pos \-1 +if +.I len +is negative, where +.I pos +is the current file position, and if +.I len +is zero, the section extends from the current file position to +infinity, encompassing the present and future end-of-file positions. +In all cases, the section may extend past current end-of-file. +.LP +On Linux, +.BR lockf () +is just an interface on top of +.BR fcntl (2) +locking. +Many other systems implement +.BR lockf () +in this way, but note that POSIX.1-2001 leaves the relationship between +.BR lockf () +and +.BR fcntl (2) +locks unspecified. +A portable application should probably avoid mixing calls +to these interfaces. +.LP +Valid operations are given below: +.TP +.B F_LOCK +Set an exclusive lock on the specified section of the file. +If (part of) this section is already locked, the call +blocks until the previous lock is released. +If this section overlaps an earlier locked section, +both are merged. +File locks are released as soon as the process holding the locks +closes some file descriptor for the file. +A child process does not inherit these locks. +.TP +.B F_TLOCK +Same as +.B F_LOCK +but the call never blocks and returns an error instead if the file is +already locked. +.TP +.B F_ULOCK +Unlock the indicated section of the file. +This may cause a locked section to be split into two locked sections. +.TP +.B F_TEST +Test the lock: return 0 if the specified section +is unlocked or locked by this process; return \-1, set +.I errno +to +.B EAGAIN +.RB ( EACCES +on some other systems), +if another process holds a lock. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.BR EACCES " or " EAGAIN +The file is locked and +.B F_TLOCK +or +.B F_TEST +was specified, or the operation is prohibited because the file has +been memory-mapped by another process. +.TP +.B EBADF +.I fd +is not an open file descriptor. +.TP +.B EDEADLK +The command was +.B T_LOCK +and this lock operation would cause a deadlock. +.TP +.B EINVAL +An invalid operation was specified in +.IR fd . +.TP +.B ENOLCK +Too many segment locks open, lock table is full. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +.SH "SEE ALSO" +.BR fcntl (2), +.BR flock (2) +.br +There are also +.I locks.txt +and +.I mandatory-locking.txt +in the kernel source directory +.IR Documentation/filesystems . +(On older kernels, these files are directly under the +.I Documentation/ +directory, and +.I mandatory-locking.txt +is called +.IR mandatory.txt .) diff --git a/original/man3/log.3 b/original/man3/log.3 new file mode 100644 index 00000000..d0426c20 --- /dev/null +++ b/original/man3/log.3 @@ -0,0 +1,137 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995-08-14 by Arnt Gulbrandsen +.\" Modified 2002-07-27 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH LOG 3 2008-08-10 "" "Linux Programmer's Manual" +.SH NAME +log, logf, logl \- natural logarithmic function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double log(double " x ); +.br +.BI "float logf(float " x ); +.br +.BI "long double logl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR logf (), +.BR logl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR log () +function returns the natural logarithm of \fIx\fP. +.SH RETURN VALUE +On success, these functions return the natural logarithm of +.IR x . + +If +.I x +is a NaN, +a NaN is returned. + +If +.I x +is 1, the result is +0. + +If +.I x +is positive infinity, +positive infinity is returned. + +If +.I x +is zero, +then a pole error occurs, and the functions return +.RB - HUGE_VAL , +.RB - HUGE_VALF , +or +.RB - HUGE_VALL , +respectively. + +If +.I x +is negative (including negative infinity), then +a domain error occurs, and a NaN (not a number) is returned. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is negative +.I errno +is set to +.BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.TP +Pole error: \fIx\fP is zero +.I errno +is set to +.BR ERANGE . +A divide-by-zero floating-point exception +.RB ( FE_DIVBYZERO ) +is raised. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH BUGS +In glibc 2.5 and earlier, +taking the +.BR log () +of a NaN produces a bogus invalid floating-point +.RB ( FE_INVALID ) +exception. +.SH "SEE ALSO" +.BR cbrt (3), +.BR clog (3), +.BR log1p (3), +.BR sqrt (3) diff --git a/original/man3/log10.3 b/original/man3/log10.3 new file mode 100644 index 00000000..5528d94e --- /dev/null +++ b/original/man3/log10.3 @@ -0,0 +1,91 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995-08-14 by Arnt Gulbrandsen +.\" Modified 2002-07-27 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH LOG10 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +log10, log10f, log10l \- base-10 logarithmic function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double log10(double " x ); +.br +.BI "float log10f(float " x ); +.br +.BI "long double log10l(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR log10f (), +.BR log10l (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR log10 () +function returns the base 10 logarithm of \fIx\fP. +.SH RETURN VALUE +On success, these functions return the base 10 logarithm of +.IR x . + +For special cases, including where +.I x +is 0, 1, negative, infinity, or NaN, see +.BR log (3). +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. + +For a discussion of the errors that can occur for these functions, see +.BR log (3). +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR cbrt (3), +.BR clog10 (3), +.BR exp10 (3), +.BR sqrt (3) diff --git a/original/man3/log10f.3 b/original/man3/log10f.3 new file mode 100644 index 00000000..dfa5796e --- /dev/null +++ b/original/man3/log10f.3 @@ -0,0 +1 @@ +.so man3/log10.3 diff --git a/original/man3/log10l.3 b/original/man3/log10l.3 new file mode 100644 index 00000000..dfa5796e --- /dev/null +++ b/original/man3/log10l.3 @@ -0,0 +1 @@ +.so man3/log10.3 diff --git a/original/man3/log1p.3 b/original/man3/log1p.3 new file mode 100644 index 00000000..10f863ac --- /dev/null +++ b/original/man3/log1p.3 @@ -0,0 +1,133 @@ +.\" Copyright 1995 Jim Van Zandt +.\" 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. +.\" +.\" Modified 2002-07-27 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.TH LOG1P 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +log1p, log1pf, log1pl \- logarithm of 1 plus argument +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double log1p(double " x ); +.br +.BI "float log1pf(float " x ); +.br +.BI "long double log1pl(long double " x ); +.sp +.fi +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR log1p (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR log1pf (), +.BR log1pl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +.I log1p(x) +returns a value equivalent to +.nf + + log (1 + \fIx\fP) + +.fi +It is computed in a way +that is accurate even if the value of \fIx\fP is near zero. +.SH RETURN VALUE +On success, these functions return the natural logarithm of +.IR "(1\ +\ x)" . + +If +.I x +is a NaN, +a NaN is returned. + +If +.I x +is positive infinity, positive infinity is returned. + +If +.I x +is \-1, a pole error occurs, +and the functions return +.RB - HUGE_VAL , +.RB - HUGE_VALF , +or +.RB - HUGE_VALL , +respectively. + +If +.I x +is less than \-1 (including negative infinity), +a domain error occurs, +and a NaN (not a number) is returned. +.\" POSIX.1 specifies a possible range error if x is subnormal +.\" glibc 2.8 doesn't do this +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is less than \-1 +.\" .I errno +.\" is set to +.\" .BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.TP +Pole error: \fIx\fP is \-1 +.\" .I errno +.\" is set to +.\" .BR ERANGE . +A divide-by-zero floating-point exception +.RB ( FE_DIVBYZERO ) +is raised. +.PP +These functions do not set +.IR 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 +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.\" BSD +.SH "SEE ALSO" +.BR exp (3), +.BR expm1 (3), +.BR log (3) diff --git a/original/man3/log1pf.3 b/original/man3/log1pf.3 new file mode 100644 index 00000000..a4dec80e --- /dev/null +++ b/original/man3/log1pf.3 @@ -0,0 +1 @@ +.so man3/log1p.3 diff --git a/original/man3/log1pl.3 b/original/man3/log1pl.3 new file mode 100644 index 00000000..a4dec80e --- /dev/null +++ b/original/man3/log1pl.3 @@ -0,0 +1 @@ +.so man3/log1p.3 diff --git a/original/man3/log2.3 b/original/man3/log2.3 new file mode 100644 index 00000000..6a86b9ab --- /dev/null +++ b/original/man3/log2.3 @@ -0,0 +1,93 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995-08-14 by Arnt Gulbrandsen +.\" Modified 2002-07-27 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH LOG2 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +log2, log2f, log2l \- base-2 logarithmic function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double log2(double " x ); +.br +.BI "float log2f(float " x ); +.br +.BI "long double log2l(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR log2 (), +.BR log2f (), +.BR log2l (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR log2 () +function returns the base 2 logarithm of \fIx\fP. +.SH RETURN VALUE +On success, these functions return the base 2 logarithm of +.IR x . + +For special cases, including where +.I x +is 0, 1, negative, infinity, or NaN, see +.BR log (3). +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. + +For a discussion of the errors that can occur for these functions, see +.BR log (3). +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR cbrt (3), +.BR clog2 (3), +.BR sqrt (3) diff --git a/original/man3/log2f.3 b/original/man3/log2f.3 new file mode 100644 index 00000000..23aeb4ad --- /dev/null +++ b/original/man3/log2f.3 @@ -0,0 +1 @@ +.so man3/log2.3 diff --git a/original/man3/log2l.3 b/original/man3/log2l.3 new file mode 100644 index 00000000..23aeb4ad --- /dev/null +++ b/original/man3/log2l.3 @@ -0,0 +1 @@ +.so man3/log2.3 diff --git a/original/man3/logb.3 b/original/man3/logb.3 new file mode 100644 index 00000000..4540f9c4 --- /dev/null +++ b/original/man3/logb.3 @@ -0,0 +1,134 @@ +.\" 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. +.\" +.\" Inspired by a page by Walter Harms created 2002-08-10 +.\" +.TH LOGB 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +logb, logbf, logbl \- get exponent of a floating-point value +.SH SYNOPSIS +.B #include +.sp +.BI "double logb(double " x ); +.br +.BI "float logbf(float " x ); +.br +.BI "long double logbl(long double " x ); +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR logb (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR logbf (), +.BR logbl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions extract the exponent from the +internal floating-point representation of +.I x +and return it as a floating-point value. +The integer constant +.BR FLT_RADIX , +defined in +.IR , +indicates the radix used for the system's floating-point representation. +If +.B FLT_RADIX +is 2, +.BI logb( x ) +is equal to +.BI floor(log2( x ))\fR, +except that it is probably faster. +.LP +If +.I x +is subnormal, +.BR logb () +returns the exponent +.I x +would have if it were normalized. +.SH RETURN VALUE +On success, these functions return the exponent of +.IR x . + +If +.I x +is a NaN, +a NaN is returned. + +If +.I x +is zero, then a pole error occurs, and the functions return +.RB - HUGE_VAL , +.RB - HUGE_VALF , +or +.RB - HUGE_VALL , +respectively. + +If +.I x +is negative infinity or positive infinity, then +positive infinity is returned. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Pole error: \fIx\fP is 0 +.\" .I errno +.\" is set to +.\" .BR ERANGE . +A divide-by-zero floating-point exception +.RB ( FE_DIVBYZERO ) +is raised. +.PP +These functions do not set +.IR 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 +.\" +.\" .SH HISTORY +.\" The +.\" .BR logb () +.\" function occurs in 4.3BSD. +.\" see IEEE.3 in the 4.3BSD manual +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR ilogb (3), +.BR log (3) diff --git a/original/man3/logbf.3 b/original/man3/logbf.3 new file mode 100644 index 00000000..4a70936a --- /dev/null +++ b/original/man3/logbf.3 @@ -0,0 +1 @@ +.so man3/logb.3 diff --git a/original/man3/logbl.3 b/original/man3/logbl.3 new file mode 100644 index 00000000..4a70936a --- /dev/null +++ b/original/man3/logbl.3 @@ -0,0 +1 @@ +.so man3/logb.3 diff --git a/original/man3/logf.3 b/original/man3/logf.3 new file mode 100644 index 00000000..7807e764 --- /dev/null +++ b/original/man3/logf.3 @@ -0,0 +1 @@ +.so man3/log.3 diff --git a/original/man3/login.3 b/original/man3/login.3 new file mode 100644 index 00000000..d15d8732 --- /dev/null +++ b/original/man3/login.3 @@ -0,0 +1,125 @@ +.\" 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. +.\" +.\" Derived from text written by Martin Schulze (or taken from glibc.info) +.\" and text written by Paul Thompson - both copyright 2002. +.\" +.TH LOGIN 3 2004-05-06 "GNU" "Linux Programmer's Manual" +.SH NAME +login, logout \- write utmp and wtmp entries +.SH SYNOPSIS +.B #include +.sp +.BI "void login(const struct utmp *" ut ); +.sp +.BI "int logout(const char *" ut_line ); +.sp +Link with \fI\-lutil\fP. +.SH DESCRIPTION +The utmp file records who is currently using the system. +The wtmp file records all logins and logouts. +See +.BR utmp (5). +.LP +The function +.BR login () +takes the supplied \fIstruct utmp\fP, +.IR ut , +and writes it to both the utmp and the wtmp file. +.LP +The function +.BR logout () +clears the entry in the utmp file again. +.SS "GNU Details" +More precisely, +.BR login () +takes the argument +.I ut +struct, fills the field +.I ut\->ut_type +(if there is such a field) with the value +.BR USER_PROCESS , +and fills the field +.I ut\->ut_pid +(if there is such a field) with the process ID of the calling process. +Then it tries to fill the field +.IR ut\->ut_line . +It takes the first of \fIstdin\fP, \fIstdout\fP, \fIstderr\fP +that is a tty, and +stores the corresponding pathname minus a possible leading \fI/dev/\fP +into this field, and then writes the struct to the utmp file. +On the other hand, if no tty name was found, this field is filled with "???" +and the struct is not written to the utmp file. +After this, the struct is written to the wtmp file. +.LP +The +.BR logout () +function searches the utmp file for an entry matching the +.I ut_line +argument. +If a record is found, it is updated by zeroing out the +.I ut_name +and +.I ut_host +fields, updating the +.I ut_tv +timestamp field and setting +.I ut_type +(if there is such a field) to +.BR DEAD_PROCESS . +.SH "RETURN VALUE" +The +.BR logout () +function returns 1 if the entry was successfully written to the +database, or 0 if an error occurred. +.SH FILES +.TP +.I /var/run/utmp +user accounting database, configured through +.B _PATH_UTMP +in +.I +.TP +.I /var/log/wtmp +user accounting log file, configured through +.B _PATH_WTMP +in +.I +.SH "CONFORMING TO" +Not in POSIX.1-2001. +Present on the BSDs. +.SH NOTES +Note that the +member +.I ut_user +of +.I struct utmp +is called +.I ut_name +in BSD. +Therefore, +.I ut_name +is defined as an alias for +.I ut_user +in +.IR . +.SH "SEE ALSO" +.BR getutent (3), +.BR utmp (5) diff --git a/original/man3/login_tty.3 b/original/man3/login_tty.3 new file mode 100644 index 00000000..fb4952d5 --- /dev/null +++ b/original/man3/login_tty.3 @@ -0,0 +1 @@ +.so man3/openpty.3 diff --git a/original/man3/logl.3 b/original/man3/logl.3 new file mode 100644 index 00000000..7807e764 --- /dev/null +++ b/original/man3/logl.3 @@ -0,0 +1 @@ +.so man3/log.3 diff --git a/original/man3/logout.3 b/original/man3/logout.3 new file mode 100644 index 00000000..a1ee6725 --- /dev/null +++ b/original/man3/logout.3 @@ -0,0 +1 @@ +.so man3/login.3 diff --git a/original/man3/logwtmp.3 b/original/man3/logwtmp.3 new file mode 100644 index 00000000..0dc4dea3 --- /dev/null +++ b/original/man3/logwtmp.3 @@ -0,0 +1 @@ +.so man3/updwtmp.3 diff --git a/original/man3/longjmp.3 b/original/man3/longjmp.3 new file mode 100644 index 00000000..f26702c9 --- /dev/null +++ b/original/man3/longjmp.3 @@ -0,0 +1,126 @@ +.\" Written by Michael Haardt, Fri Nov 25 14:51:42 MET 1994 +.\" +.\" 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. +.\" +.\" Added siglongjmp, Sun Mar 2 22:03:05 EST 1997, jrv@vanzandt.mv.com +.\" Modifications, Sun Feb 26 14:39:45 1995, faith@cs.unc.edu +.\" " +.TH LONGJMP 3 2009-01-13 "" "Linux Programmer's Manual" +.SH NAME +longjmp, siglongjmp \- nonlocal jump to a saved stack context +.SH SYNOPSIS +.nf +.B #include + +.BI "void longjmp(jmp_buf " env ", int " val ); + +.BI "void siglongjmp(sigjmp_buf " env ", int " val ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR siglongjmp (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_C_SOURCE +.SH DESCRIPTION +.BR longjmp () +and +.BR setjmp (3) +are useful for dealing with errors +and interrupts encountered in a low-level subroutine of a program. +.BR longjmp () +restores the environment saved by the last call of +.BR setjmp (3) +with the corresponding \fIenv\fP argument. +After +.BR longjmp () +is completed, program execution continues as if the +corresponding call of +.BR setjmp (3) +had just returned the value +\fIval\fP. +.BR longjmp () +cannot cause 0 to be returned. +If +.BR longjmp () +is invoked with a second argument of 0, 1 will be returned instead. +.P +.BR siglongjmp () +is similar to +.BR longjmp () +except for the type of +its \fIenv\fP argument. +If, and only if, the +.BR sigsetjmp (3) +call that set this +\fIenv\fP used a nonzero \fIsavesigs\fP flag, +.BR siglongjmp () +also restores the signal mask that was saved by +.BR sigsetjmp (3). +.SH "RETURN VALUE" +These functions never return. +.SH "CONFORMING TO" +C89, C99, and POSIX.1-2001 specify +.BR longjmp (). +POSIX.1-2001 specifies +.BR siglongjmp (). +.SH NOTES +POSIX does not specify whether +.BR longjmp () +will restore the signal context (see +.BR setjmp (3) +for some more details). +If you want to portably save and restore signal masks, use +.BR sigsetjmp () +and +.BR siglongjmp (). +.P +The values of automatic variables are unspecified after a call to +.BR longjmp () +if they meet all the following criteria: +.IP \(bu 3 +they are local to the function that made the corresponding +.BR setjmp (3) +call; +.IP \(bu +their values are changed between the calls to +.BR setjmp (3) +and +.BR longjmp (); +and +.IP \(bu +they are not declared as +.IR volatile . +.P +Analogous remarks apply for +.BR siglongjmp (). +.P +.BR longjmp () +and +.BR siglongjmp () +make programs hard to +understand and maintain. +If possible an alternative should be used. +.SH "SEE ALSO" +.BR setjmp (3), +.BR sigsetjmp (3) diff --git a/original/man3/lrand48.3 b/original/man3/lrand48.3 new file mode 100644 index 00000000..3133f7d6 --- /dev/null +++ b/original/man3/lrand48.3 @@ -0,0 +1 @@ +.so man3/drand48.3 diff --git a/original/man3/lrand48_r.3 b/original/man3/lrand48_r.3 new file mode 100644 index 00000000..81e9d8ef --- /dev/null +++ b/original/man3/lrand48_r.3 @@ -0,0 +1 @@ +.so man3/drand48_r.3 diff --git a/original/man3/lrint.3 b/original/man3/lrint.3 new file mode 100644 index 00000000..bb1fac54 --- /dev/null +++ b/original/man3/lrint.3 @@ -0,0 +1,110 @@ +.\" Copyright 2001 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. +.\" +.TH LRINT 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +lrint, lrintf, lrintl, llrint, llrintf, llrintl \- round to nearest integer +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "long int lrint(double " x ); +.br +.BI "long int lrintf(float " x ); +.br +.BI "long int lrintl(long double " x ); +.sp +.BI "long long int llrint(double " x ); +.br +.BI "long long int llrintf(float " x ); +.br +.BI "long long int llrintl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +All functions shown above: +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions round their argument to the nearest integer value, +using the current rounding direction (see +.BR fesetround (3)). + +Note that unlike +.BR rint (3), +etc., the return type of these functions differs from +that of their arguments. +.SH "RETURN VALUE" +These functions return the rounded integer value. + +If +.I x +is a NaN or an infinity, +or the rounded value is too large to be stored in a +.I long +.RI ( "long long" +in the case of the +.B ll* +functions) +then a domain error occurs, and the return value is unspecified. +.\" The return value is -(LONG_MAX - 1) or -(LLONG_MAX -1) +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is a NaN or infinite, or the rounded value is too large +.\" .I errno +.\" is set to +.\" .BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.PP +These functions do not set +.IR errno . +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6798 +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR ceil (3), +.BR floor (3), +.BR lround (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3) diff --git a/original/man3/lrintf.3 b/original/man3/lrintf.3 new file mode 100644 index 00000000..d1c0af3b --- /dev/null +++ b/original/man3/lrintf.3 @@ -0,0 +1 @@ +.so man3/lrint.3 diff --git a/original/man3/lrintl.3 b/original/man3/lrintl.3 new file mode 100644 index 00000000..d1c0af3b --- /dev/null +++ b/original/man3/lrintl.3 @@ -0,0 +1 @@ +.so man3/lrint.3 diff --git a/original/man3/lround.3 b/original/man3/lround.3 new file mode 100644 index 00000000..e8cd196f --- /dev/null +++ b/original/man3/lround.3 @@ -0,0 +1,113 @@ +.\" Copyright 2001 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. +.\" +.TH LROUND 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +lround, lroundf, lroundl, llround, llroundf, llroundl \- round to +nearest integer, away from zero +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "long int lround(double " x ); +.br +.BI "long int lroundf(float " x ); +.br +.BI "long int lroundl(long double " x ); +.sp +.BI "long long int llround(double " x ); +.br +.BI "long long int llroundf(float " x ); +.br +.BI "long long int llroundl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +All functions shown above: +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions round their argument to the nearest integer value, +rounding away from zero, +regardless of the current rounding direction (see +.BR fenv (3)). + +Note that unlike +.BR round (3), +.BR ceil (3), +etc., the return type of these functions differs from +that of their arguments. +.SH "RETURN VALUE" +These functions return the rounded integer value. + +If +.I x +is a NaN or an infinity, +or the rounded value is too large to be stored in a +.I long +.RI ( "long long" +in the case of the +.B ll* +functions) +then a domain error occurs, and the return value is unspecified. +.\" The return value is -(LONG_MAX - 1) or -(LLONG_MAX -1) +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is a NaN or infinite, or the rounded value is too large +.\" .I errno +.\" is set to +.\" .BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.PP +These functions do not set +.IR errno . +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6797 +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR ceil (3), +.BR floor (3), +.BR lrint (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3) diff --git a/original/man3/lroundf.3 b/original/man3/lroundf.3 new file mode 100644 index 00000000..bcc9b0fd --- /dev/null +++ b/original/man3/lroundf.3 @@ -0,0 +1 @@ +.so man3/lround.3 diff --git a/original/man3/lroundl.3 b/original/man3/lroundl.3 new file mode 100644 index 00000000..bcc9b0fd --- /dev/null +++ b/original/man3/lroundl.3 @@ -0,0 +1 @@ +.so man3/lround.3 diff --git a/original/man3/lsearch.3 b/original/man3/lsearch.3 new file mode 100644 index 00000000..9f047657 --- /dev/null +++ b/original/man3/lsearch.3 @@ -0,0 +1,74 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" Copyright 1995 Jim Van Zandt +.\" +.\" 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. +.\" +.\" Corrected prototype and include, aeb, 990927 +.TH LSEARCH 3 1999-09-27 "GNU" "Linux Programmer's Manual" +.SH NAME +lfind, lsearch \- linear search of an array +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void *lfind(const void *" key ", const void *" base ", size_t *" nmemb , +.BI " size_t " size ", int(*" compar ")(const void *, const void *));" +.sp +.BI "void *lsearch(const void *" key ", void *" base ", size_t *" nmemb , +.BI " size_t " size ", int(*" compar ")(const void *, const void *));" +.fi +.SH DESCRIPTION +.BR lfind () +and +.BR lsearch () +perform a linear search for +\fIkey\fP in the array \fIbase\fP which has \fI*nmemb\fP elements of +\fIsize\fP bytes each. +The comparison function referenced by +\fIcompar\fP is expected to have two arguments which point to the +\fIkey\fP object and to an array member, in that order, and which +returns zero if the \fIkey\fP object matches the array member, and +nonzero otherwise. +.PP +If +.BR lsearch () +does not find a matching element, then the \fIkey\fP +object is inserted at the end of the table, and \fI*nmemb\fP is +incremented. +In particular, one should know that a matching element +exists, or that more room is available. +.SH "RETURN VALUE" +.BR lfind () +returns a pointer to a matching member of the array, or +NULL if no match is found. +.BR lsearch () +returns a pointer to +a matching member of the array, or to the newly added member if no +match is found. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +Present in libc since libc-4.6.27. +.SH BUGS +The naming is unfortunate. +.SH "SEE ALSO" +.BR bsearch (3), +.BR hsearch (3), +.BR tsearch (3) diff --git a/original/man3/lseek64.3 b/original/man3/lseek64.3 new file mode 100644 index 00000000..2c989350 --- /dev/null +++ b/original/man3/lseek64.3 @@ -0,0 +1,160 @@ +.\" Copyright 2004 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. +.\" +.TH LSEEK64 3 2004-12-11 "Linux" "Linux Programmer's Manual" +.SH NAME +lseek64 \- reposition 64-bit read/write file offset +.SH SYNOPSIS +.B #define _LARGEFILE64_SOURCE +.br +.B #include +.br +.B #include +.sp +.BI "off64_t lseek64(int " fd ", off64_t " offset ", int " whence ); +.SH DESCRIPTION +The +.BR lseek (2) +family of functions reposition the offset of the open file associated +with the file descriptor +.I fd +to +.I offset +bytes relative to the start, current position, or end of the file, +when +.I whence +has the value +.BR SEEK_SET , +.BR SEEK_CUR , +or +.BR SEEK_END , +respectively. +.LP +For more details, return value, and errors, see +.BR lseek (2). +.PP +Four interfaces are available: +.BR lseek (2), +.BR lseek64 (), +.BR llseek (2), +and the raw system call +.BR _llseek (2). +.SS lseek +Prototype: +.nf +.sp +.in +4n +.BI "off_t lseek(int " fd ", off_t " offset ", int " whence ); +.in +.fi +.sp +.BR lseek (2) +uses the type +.IR off_t . +This is a 32-bit signed type on 32-bit architectures, unless one +compiles with +.nf +.sp +.in +4n +#define _FILE_OFFSET_BITS 64 +.in +.sp +.fi +in which case it is a 64-bit signed type. +.SS lseek64 +Prototype: +.nf +.sp +.in +4n +.BI "off64_t lseek64(int " fd ", off64_t " offset ", int " whence ); +.in +.fi +.sp +The library routine +.BR lseek64 () +uses a 64-bit type even when +.I off_t +is a 32-bit type. +Its prototype (and the type +.IR off64_t ) +is available only when one compiles with +.nf +.sp +.in +4n +#define _LARGEFILE64_SOURCE +.in +.sp +.fi +The function +.BR lseek64 () +.\" in glibc 2.0.94, not in 2.0.6 +is available since glibc 2.1, and is defined to be an alias for +.BR llseek (). +.SS llseek +Prototype: +.nf +.sp +.in +4n +.BI "loff_t llseek(int " fd ", loff_t " offset ", int " whence ); +.in +.fi +.sp +The type +.I loff_t +is a 64-bit signed type. +The library routine +.BR llseek () +.\" in libc 5.0.9, not in 4.7.6 +is available in libc5 and glibc and works without special defines. +Its prototype was given in +.I +with libc5, but glibc does not provide a prototype. +This is bad, since a prototype is needed. +Users should add +the above prototype, or something equivalent, to their own source. +When users complained about data loss caused by a miscompilation of +.BR e2fsck (8), +glibc 2.1.3 added the link-time warning +.sp +.in +4n +"the \`llseek\' function may be dangerous; use \`lseek64\' instead." +.in +.sp +This makes this function unusable if one desires a warning-free +compilation. +.SS _llseek +All the above functions are implemented in terms of this system call. +The prototype is: +.nf +.sp +.in +4n +.BI "int _llseek(int " fd ", off_t " offset_hi ", off_t " offset_lo , +.BI " loff_t *" result ", int " whence ); +.in +.fi +.sp +For more details, see +.BR llseek (2). +.SH "SEE ALSO" +.BR llseek (2), +.BR lseek (2), +.BR feature_test_macros (7) diff --git a/original/man3/lutimes.3 b/original/man3/lutimes.3 new file mode 100644 index 00000000..31459803 --- /dev/null +++ b/original/man3/lutimes.3 @@ -0,0 +1 @@ +.so man3/futimes.3 diff --git a/original/man3/major.3 b/original/man3/major.3 new file mode 100644 index 00000000..eabbdd01 --- /dev/null +++ b/original/man3/major.3 @@ -0,0 +1 @@ +.so man3/makedev.3 diff --git a/original/man3/makecontext.3 b/original/man3/makecontext.3 new file mode 100644 index 00000000..730438b8 --- /dev/null +++ b/original/man3/makecontext.3 @@ -0,0 +1,222 @@ +.\" Copyright (C) 2001 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. +.\" 2006-08-02, mtk, Added example program +.\" +.TH MAKECONTEXT 3 2009-03-31 "GNU" "Linux Programmer's Manual" +.SH NAME +makecontext, swapcontext \- manipulate user context +.SH SYNOPSIS +.B #include +.sp +.BI "void makecontext(ucontext_t *" ucp ", void (*" func )(), +.BI "int " argc ", ...);" +.sp +.BI "int swapcontext(ucontext_t *" oucp ", ucontext_t *" ucp ); +.SH DESCRIPTION +In a System V-like environment, one has the type \fIucontext_t\fP defined in +.I +and the four functions +.BR getcontext (2), +.BR setcontext (2), +.BR makecontext () +and +.BR swapcontext () +that allow user-level context switching +between multiple threads of control within a process. +.LP +For the type and the first two functions, see +.BR getcontext (2). +.LP +The +.BR makecontext () +function modifies the context pointed to +by \fIucp\fP (which was obtained from a call to +.BR getcontext (2)). +Before invoking +.BR makecontext (), +the caller must allocate a new stack +for this context and assign its address to \fIucp\->uc_stack\fP, +and define a successor context and +assign its address to \fIucp\->uc_link\fP. + +When this context is later activated (using +.BR setcontext (2) +or +.BR swapcontext ()) +the function \fIfunc\fP is called, +and passed the series of integer +.RI ( int ) +arguments that follow +.IR argc ; +the caller must specify the number of these arguments in +.IR argc . +When this function returns, the successor context is activated. +If the successor context pointer is NULL, the thread exits. +.LP +The +.BR swapcontext () +function saves the current context in +the structure pointed to by \fIoucp\fP, and then activates the +context pointed to by \fIucp\fP. +.SH "RETURN VALUE" +When successful, +.BR swapcontext () +does not return. +(But we may return later, in case \fIoucp\fP is +activated, in which case it looks like +.BR swapcontext () +returns 0.) +On error, +.BR swapcontext () +returns \-1 and +sets \fIerrno\fP appropriately. +.SH ERRORS +.TP +.B ENOMEM +Insufficient stack space left. +.SH VERSIONS +.BR makecontext () +and +.BR swapcontext () +are provided in glibc since version 2.1. +.SH "CONFORMING TO" +SUSv2, POSIX.1-2001. +POSIX.1-2008 removes the specifications of +.BR makecontext () +and +.BR swapcontext (), +citing portability issues, and +recommending that applications be rewritten to use POSIX threads instead. +.SH NOTES +The interpretation of \fIucp\->uc_stack\fP is just as in +.BR sigaltstack (2), +namely, this struct contains the start and length of a memory area +to be used as the stack, regardless of the direction of growth of +the stack. +Thus, it is not necessary for the user program to +worry about this direction. + +On architectures where +.I int +and pointer types are the same size +(e.g., x86-32, where both types are 32 bits), +you may be able to get away with passing pointers as arguments to +.BR makecontext () +following +.IR argc . +However, doing this is not guaranteed to be portable, +is undefined according to the standards, +and won't work on architectures where pointers are larger than +.IR int s. +Nevertheless, starting with version 2.8, glibc makes some changes to +.BR makecontext (3), +to permit this on some 64-bit architectures (e.g., x86-64). +.SH EXAMPLE +.PP +The example program below demonstrates the use of +.BR getcontext (2), +.BR makecontext (), +and +.BR swapcontext (). +Running the program produces the following output: +.in +4n +.nf + +.RB "$" " ./a.out" +main: swapcontext(&uctx_main, &uctx_func2) +func2: started +func2: swapcontext(&uctx_func2, &uctx_func1) +func1: started +func1: swapcontext(&uctx_func1, &uctx_func2) +func2: returning +func1: returning +main: exiting +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include + +static ucontext_t uctx_main, uctx_func1, uctx_func2; + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +static void +func1(void) +{ + printf("func1: started\\n"); + printf("func1: swapcontext(&uctx_func1, &uctx_func2)\\n"); + if (swapcontext(&uctx_func1, &uctx_func2) == \-1) + handle_error("swapcontext"); + printf("func1: returning\\n"); +} + +static void +func2(void) +{ + printf("func2: started\\n"); + printf("func2: swapcontext(&uctx_func2, &uctx_func1)\\n"); + if (swapcontext(&uctx_func2, &uctx_func1) == \-1) + handle_error("swapcontext"); + printf("func2: returning\\n"); +} + +int +main(int argc, char *argv[]) +{ + char func1_stack[16384]; + char func2_stack[16384]; + + if (getcontext(&uctx_func1) == \-1) + handle_error("getcontext"); + uctx_func1.uc_stack.ss_sp = func1_stack; + uctx_func1.uc_stack.ss_size = sizeof(func1_stack); + uctx_func1.uc_link = &uctx_main; + makecontext(&uctx_func1, func1, 0); + + if (getcontext(&uctx_func2) == \-1) + handle_error("getcontext"); + uctx_func2.uc_stack.ss_sp = func2_stack; + uctx_func2.uc_stack.ss_size = sizeof(func2_stack); + /* Successor context is f1(), unless argc > 1 */ + uctx_func2.uc_link = (argc > 1) ? NULL : &uctx_func1; + makecontext(&uctx_func2, func2, 0); + + printf("main: swapcontext(&uctx_main, &uctx_func2)\\n"); + if (swapcontext(&uctx_main, &uctx_func2) == \-1) + handle_error("swapcontext"); + + printf("main: exiting\\n"); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR getcontext (2), +.BR sigaction (2), +.BR sigaltstack (2), +.BR sigprocmask (2), +.BR sigsetjmp (3) diff --git a/original/man3/makedev.3 b/original/man3/makedev.3 new file mode 100644 index 00000000..3e1abfe9 --- /dev/null +++ b/original/man3/makedev.3 @@ -0,0 +1,81 @@ +.\" 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. +.\" +.TH MAKEDEV 3 2008-12-01 "Linux" "Linux Programmer's Manual" +.SH NAME +makedev, major, minor \- manage a device number +.SH SYNOPSIS +.nf +.B #define _BSD_SOURCE +.B #include + +.BI "dev_t makedev(int " maj ", int " min ); + +.BI "int major(dev_t " dev ); +.BI "int minor(dev_t " dev ); + +.fi +.SH DESCRIPTION +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 +.IR dev_t . + +Given major and minor device IDs, +.BR makedev () +combines these to produce a device ID, returned as the function result. +This device ID can be given to +.BR mknod (2), +for example. + +The +.BR major () +and +.BR minor () +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 +.BR stat (2). +.SH "CONFORMING TO" +The +.BR makedev () +.BR major () +and +.BR minor () +functions are not specified in POSIX.1, +but are present on many other systems. +.\" The BSDs, HP-UX, Solaris, AIX, Irix +.SH NOTES +These interfaces are defined as macros. +Since glibc 2.3.3, +they have been aliases for three GNU-specific functions: +.BR gnu_dev_makedev (3), +.BR gnu_dev_major (3), +and +.BR gnu_dev_minor (3). +The latter names are exported, but the traditional names are more portable. +.SH "SEE ALSO" +.BR mknod (2), +.BR stat (2) diff --git a/original/man3/malloc.3 b/original/man3/malloc.3 new file mode 100644 index 00000000..8f86849c --- /dev/null +++ b/original/man3/malloc.3 @@ -0,0 +1,268 @@ +.\" 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(). +.\" +.TH MALLOC 3 2009-01-13 "GNU" "Linux Programmer's Manual" +.SH NAME +calloc, malloc, free, realloc \- Allocate and free dynamic memory +.SH SYNOPSIS +.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 +.SH DESCRIPTION +.BR calloc () +allocates memory for an array of +.I nmemb +elements of +.I size +bytes each and returns a pointer to the allocated memory. +The memory is set to zero. +If +.I nmemb +or +.I size +is 0, then +.BR calloc () +returns either NULL, +.\" glibc does this: +or a unique pointer value that can later be successfully passed to +.BR free (). +.PP +.BR malloc () +allocates +.I size +bytes and returns a pointer to the allocated memory. +The memory is not cleared. +If +.I size +is 0, then +.BR malloc () +returns either NULL, +.\" glibc does this: +or a unique pointer value that can later be successfully passed to +.BR free (). +.PP +.BR free () +frees the memory space pointed to by +.IR ptr , +which must have been returned by a previous call to +.BR malloc (), +.BR calloc () +or +.BR realloc (). +Otherwise, or if +.I free(ptr) +has already been called before, undefined behavior occurs. +If +.I ptr +is NULL, no operation is performed. +.PP +.BR realloc () +changes the size of the memory block pointed to by +.I ptr +to +.I size +bytes. +The contents will be unchanged to the minimum of the old and new sizes; +newly allocated memory will be uninitialized. +If +.I ptr +is NULL, then the call is equivalent to +.IR malloc(size) , +for all values of +.IR size ; +if +.I size +is equal to zero, +and +.I ptr +is not NULL, then the call is equivalent to +.IR free(ptr) . +Unless +.I ptr +is NULL, it must have been returned by an earlier call to +.BR malloc (), +.BR calloc () +or +.BR realloc (). +If the area pointed to was moved, a +.I free(ptr) +is done. +.SH "RETURN VALUE" +For +.BR calloc () +and +.BR malloc (), +return a pointer to the allocated memory, which is suitably +aligned for any kind of variable. +On error, these functions return NULL. +NULL may also be returned by a successful call to +.BR malloc () +with a +.I size +of zero, +or by a successful call to +.BR calloc () +with +.I nmemb +or +.I size +equal to zero. +.PP +.BR free () +returns no value. +.PP +.BR realloc () +returns a pointer to the newly allocated memory, which is suitably +aligned for any kind of variable and may be different from +.IR ptr , +or NULL if the request fails. +If +.I size +was equal to 0, either NULL or a pointer suitable to be passed to +.BR free () +is returned. +If +.BR realloc () +fails the original block is left untouched; it is not freed or moved. +.SH "CONFORMING TO" +C89, C99. +.SH NOTES +Normally, +.BR malloc () +allocates memory from the heap, and adjusts the size of the heap +as required, using +.BR sbrk (2). +When allocating blocks of memory larger than +.B MMAP_THRESHOLD +bytes, the glibc +.BR malloc () +implementation allocates the memory as a private anonymous mapping using +.BR mmap (2). +.B MMAP_THRESHOLD +is 128 kB by default, but is adjustable using +.BR mallopt (3). +.\" FIXME . there is no mallopt(3) man page yet. +Allocations performed using +.BR mmap (2) +are unaffected by the +.B RLIMIT_DATA +resource limit (see +.BR getrlimit (2)). + +The Unix98 standard requires +.BR malloc (), +.BR calloc (), +and +.BR realloc () +to set +.I errno +to +.B ENOMEM +upon failure. +Glibc assumes that this is done +(and the glibc versions of these routines do this); if you +use a private malloc implementation that does not set +.IR errno , +then certain library routines may fail without having +a reason in +.IR errno . +.LP +Crashes in +.BR malloc (), +.BR calloc (), +.BR realloc (), +or +.BR free () +are almost always related to heap corruption, such as overflowing +an allocated chunk or freeing the same pointer twice. +.PP +Recent versions of Linux libc (later than 5.4.23) and glibc (2.x) +include a +.BR malloc () +implementation which is tunable via environment variables. +When +.B MALLOC_CHECK_ +is set, a special (less efficient) implementation is used which +is designed to be tolerant against simple errors, such as double +calls of +.BR free () +with the same argument, or overruns of a single byte (off-by-one +bugs). +Not all such errors can be protected against, however, and +memory leaks can result. +If +.B MALLOC_CHECK_ +is set to 0, any detected heap corruption is silently ignored; +if set to 1, a diagnostic message is printed on \fIstderr\fP; +if set to 2, +.BR abort (3) +is called immediately; +if set to 3, a diagnostic message is printed on \fIstderr\fP +and the program is aborted. +Using a nonzero +.B MALLOC_CHECK_ +value can be useful because otherwise +a crash may happen much later, and the true cause for the problem +is then very hard to track down. +.SH BUGS +By default, Linux follows an optimistic memory allocation strategy. +This means that when +.BR malloc () +returns non-NULL there is no guarantee that the memory really +is available. +This is a really bad bug. +In case it turns out that the system is out of memory, +one or more processes will be killed by the infamous OOM killer. +In case Linux is employed under circumstances where it would be +less desirable to suddenly lose some randomly picked processes, +and moreover the kernel version is sufficiently recent, +one can switch off this overcommitting behavior using a command like: +.in +4n +.nf + +.RB "#" " echo 2 > /proc/sys/vm/overcommit_memory" + +.fi +.in +See also the kernel Documentation directory, files +.I vm/overcommit-accounting +and +.IR sysctl/vm.txt . +.SH "SEE ALSO" +.BR brk (2), +.\" .BR mallopt (3), +.BR mmap (2), +.BR alloca (3), +.BR posix_memalign (3) diff --git a/original/man3/malloc_hook.3 b/original/man3/malloc_hook.3 new file mode 100644 index 00000000..f3f55408 --- /dev/null +++ b/original/man3/malloc_hook.3 @@ -0,0 +1,134 @@ +.\" 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? +.TH MALLOC_HOOK 3 2002-07-20 "GNU" "Linux Programmer's Manual" +.SH NAME +__malloc_hook, __malloc_initialize_hook, +__memalign_hook, __free_hook, __realloc_hook, +__after_morecore_hook \- malloc debugging variables +.SH SYNOPSIS +.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 +.SH DESCRIPTION +The GNU C library lets you modify the behavior of +.BR malloc (3), +.BR realloc (3), +and +.BR free (3) +by specifying appropriate hook functions. +You can use these hooks +to help you debug programs that use dynamic memory allocation, +for example. +.LP +The variable +.B __malloc_initialize_hook +points at a function that is called once when the malloc implementation +is initialized. +This is a weak variable, so it can be overridden in +the application with a definition like the following: +.br +.nf + void (*__malloc_initialize_hook)(void) = my_init_hook; +.fi +.br +Now the function +.IR my_init_hook () +can do the initialization of all hooks. +.LP +The four functions pointed to by +.BR __malloc_hook , +.BR __realloc_hook , +.BR __memalign_hook , +.B __free_hook +have a prototype like the functions +.BR malloc (3), +.BR realloc (3), +.BR memalign (3), +.BR free (3), +respectively, except that they have a final argument +.I caller +that gives the address of the caller of +.BR malloc (3), +etc. +.LP +The variable +.B __after_morecore_hook +points at a function that is called each time after +.BR sbrk (2) +was asked for more memory. +.SH "CONFORMING TO" +These functions are GNU extensions. +.SH "EXAMPLE" +Here is a short example of how to use these variables. +.sp +.nf +#include +#include + +/* Prototypes for our hooks. */ +static void my_init_hook(void); +static void *my_malloc_hook(size_t, const void *); + +/* Variables to save original hooks. */ +static void *(*old_malloc_hook)(size_t, const void *); + +/* Override initializing hook from the C library. */ +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; + + /* Restore all old hooks */ + __malloc_hook = old_malloc_hook; + + /* Call recursively */ + result = malloc(size); + + /* Save underlying hooks */ + old_malloc_hook = __malloc_hook; + + /* printf() might call malloc(), so protect it too. */ + printf("malloc(%u) called from %p returns %p\\n", + (unsigned int) size, caller, result); + + /* Restore our own hooks */ + __malloc_hook = my_malloc_hook; + + return result; +} +.fi +.SH "SEE ALSO" +.BR mallinfo (3), +.BR malloc (3), +.BR mcheck (3), +.BR mtrace (3) diff --git a/original/man3/matherr.3 b/original/man3/matherr.3 new file mode 100644 index 00000000..5b94f167 --- /dev/null +++ b/original/man3/matherr.3 @@ -0,0 +1,422 @@ +'\" 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. +.\" +.TH MATHERR 3 2008-07-21 "Linux" "Linux Programmer's Manual" +.SH NAME +matherr \- SVID math library exception handling +.SH SYNOPSIS +.nf +.B #define _SVID_SOURCE +.B #include + +.BI "int matherr(struct exception *" exc ); + +.B extern _LIB_VERSION_TYPE _LIB_VERSION; +.fi +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The System V Interface Definition (SVID) specifies that various +math functions should invoke a function called +.BR matherr () +if a math exception is detected. +This function is called before the math function returns; +after +.BR matherr () +returns, the system then returns to the math function, +which in turn returns to the caller. + +The +.BR matherr () +mechanism is supported by glibc, but is now obsolete: +new applications should use the techniques described in +.BR math_error (7) +and +.BR fenv (3). +This page documents the glibc +.BR matherr () +mechanism as an aid for maintaining and porting older applications. + +To employ +.BR matherr (), +the programmer must define the +.B _SVID_SOURCE +feature test macro, and assign the value +.B _SVID_ +to the external variable +.BR _LIB_VERSION . + +The system provides a default version of +.BR matherr (). +This version does nothing, and returns zero +(see below for the significance of this). +The default +.BR matherr () +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 +.I exception +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 +.I type +field has one of the following values: +.TP 12 +.B DOMAIN +A domain error occurred (the function argument was outside the range +for which the function is defined). +The return value depends on the function; +.I errno +is set to +.BR EDOM . +.TP +.B SING +A pole error occurred (the function result is an infinity). +The return value in most cases is +.B HUGE +(the largest single precision floating-point number), +appropriately signed. +In most cases, +.I errno +is set to +.BR EDOM . +.TP +.B OVERFLOW +An overflow occurred. +In most cases, the value +.B HUGE +is returned, and +.I errno +is set to +.BR ERANGE . +.TP +.B UNDERFLOW +An underflow occurred. +0.0 is returned, and +.I errno +is set to +.BR ERANGE . +.TP +.B TLOSS +Total loss of significance. +0.0 is returned, and +.I errno +is set to +.BR ERANGE . +.TP +.B PLOSS +Partial loss of significance. +This value is unused on glibc +(and many other systems). +.PP +The +.I arg1 +and +.I arg2 +fields are the arguments supplied to the function +.RI ( arg2 +is undefined for functions that take only one argument). + +The +.I retval +field specifies the return value that the math +function will return to its caller. +The programmer-defined +.BR matherr () +can modify this field to change the return value of the math function. + +If the +.BR matherr () +function returns zero, then the system sets +.I errno +as described above, and may print an error message on standard error +(see below). + +If the +.BR matherr () +function returns a nonzero value, then the system does not set +.IR errno , +and doesn't print an error message. +.SS Math functions that employ matherr() +The table below lists the functions and circumstances in which +.BR matherr () +is called. +The "Type" column indicates the value assigned to +.I exc\->type +when calling +.BR matherr (). +The "Result" column is the default return value assigned to +.IR exc\->retval . + +The "Msg?" and "errno" columns describe the default behavior if +.BR matherr () +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 +acosh(x<1) DOMAIN NAN y EDOM \" retval is 0.0/0.0 +atanh(|x|>1) DOMAIN NAN y EDOM \" retval is 0.0/0.0 +atanh(|x|==1) SING (x>0.0)? y EDOM \" retval is x/0.0 +\ \ 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 +log2(0) SING \-HUGE n EDOM \" different from log() +log2(x<0) DOMAIN -HUGE n EDOM \" different from log() +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**neg DOMAIN 0.0 y EDOM \" +0 and -0 +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 +remainder(x,0) DOMAIN NAN y EDOM \" retval is 0.0/0.0 +.TE +.SH EXAMPLE +The example program demonstrates the use of +.BR matherr () +when calling +.BR log (3). +The program takes up to three command-line arguments. +The first argument is the floating-point number to be given to +.BR log (3). +If the optional second argument is provided, then +.B _LIB_VERSION +is set to +.B _SVID_ +so that +.BR matherr () +is called, and the integer supplied in the +command-line argument is used as the return value from +.BR matherr (). +If the optional third command-line argument is supplied, +then it specifies an alternative return value that +.BR matherr () +should assign as the return value of the math function. + +The following example run, where +.BR log (3) +is given an argument of 0.0, does not use +.BR matherr() : + +.in +4n +.nf +.RB "$" " ./a.out 0.0" +errno: Numerical result out of range +x=-inf +.fi +.in + +In the following run, +.BR matherr () +is called, and returns 0: + +.in +4n +.nf +.RB "$" " ./a.out 0.0 0" +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, +.BR matherr () +is called, and returns a nonzero value: + +.in +4n +.nf +.RB "$" " ./a.out 0.0 1" +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 +.I errno +was not set. + +In the following run, +.BR matherr () +is called, changes the return value of the math function, +and returns a nonzero value: + +.in +4n +.nf +.RB "$" " ./a.out 0.0 1 12345.0" +matherr SING exception in log() function + args: 0.000000, 0.000000 + retval: -340282346638528859811704183484516925440.000000 +x=12345.000000 +.fi +.in +.SS Program source +\& +.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\\n", + (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\\n", + exc\->arg1, exc->arg2); + fprintf(stderr, " retval: %f\\n", 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 " + " [ []]\\n", 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\\n", x); + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR fenv (3), +.BR math_error (7), +.BR standards (7) diff --git a/original/man3/mblen.3 b/original/man3/mblen.3 new file mode 100644 index 00000000..1e65e35b --- /dev/null +++ b/original/man3/mblen.3 @@ -0,0 +1,83 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH MBLEN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +mblen \- determine number of bytes in next multibyte character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int mblen(const char *" s ", size_t " n ); +.fi +.SH DESCRIPTION +If \fIs\fP is not a NULL pointer, the +.BR mblen () +function inspects at most +\fIn\fP bytes of the multibyte string starting at \fIs\fP and extracts the +next complete multibyte character. +It uses a static anonymous shift state only +known to the +.BR mblen () +function. +If the multibyte character is not the null wide +character, it returns the number of bytes that were consumed from \fIs\fP. +If the multibyte character is the null wide character, it returns 0. +.PP +If the \fIn\fP bytes starting at \fIs\fP do not contain a complete multibyte +character, +.BR mblen () +returns \-1. +This can happen even if +\fIn\fP is greater than or equal to \fIMB_CUR_MAX\fP, +if the multibyte string contains redundant shift sequences. +.PP +If the multibyte string starting at \fIs\fP contains an invalid multibyte +sequence before the next complete character, +.BR mblen () +also returns \-1. +.PP +If \fIs\fP is a NULL pointer, the +.BR mblen () +function +.\" The Dinkumware doc and the Single Unix specification say this, but +.\" glibc doesn't implement this. +resets the shift state, only known to this function, to the initial state, and +returns nonzero if the encoding has nontrivial shift state, or zero if the +encoding is stateless. +.SH "RETURN VALUE" +The +.BR mblen () +function returns the number of +bytes parsed from the multibyte +sequence starting at \fIs\fP, if a non-null wide character was recognized. +It returns 0, if a null wide character was recognized. +It returns \-1, if an +invalid multibyte sequence was encountered or if it couldn't parse a complete +multibyte character. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR mblen () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +The function +.BR mbrlen (3) +provides a better interface to the same +functionality. +.SH "SEE ALSO" +.BR mbrlen (3) diff --git a/original/man3/mbrlen.3 b/original/man3/mbrlen.3 new file mode 100644 index 00000000..f1a0e2e7 --- /dev/null +++ b/original/man3/mbrlen.3 @@ -0,0 +1,77 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH MBRLEN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +mbrlen \- determine number of bytes in next multibyte character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t mbrlen(const char *" s ", size_t " n ", mbstate_t *" ps ); +.fi +.SH DESCRIPTION +The +.BR mbrlen () +function inspects at most \fIn\fP bytes of the multibyte +string starting at \fIs\fP and extracts the next complete multibyte character. +It updates the shift state \fI*ps\fP. +If the multibyte character is not the +null wide character, it returns the number of bytes that were consumed from +\fIs\fP. +If the multibyte character is the null wide character, it resets the +shift state \fI*ps\fP to the initial state and returns 0. +.PP +If the \fIn\fP bytes starting at \fIs\fP do not contain a complete multibyte +character, +.BR mbrlen () +returns \fI(size_t)\ \-2\fP. +This can happen even if +\fIn\fP >= \fIMB_CUR_MAX\fP, if the multibyte string contains redundant shift +sequences. +.PP +If the multibyte string starting at \fIs\fP contains an invalid multibyte +sequence before the next complete character, +.BR mbrlen () +returns +\fI(size_t)\ \-1\fP and sets \fIerrno\fP to \fBEILSEQ\fP. +In this case, +the effects on \fI*ps\fP are undefined. +.PP +If \fIps\fP is a NULL pointer, a static anonymous state only known to the +.BR mbrlen () +function is used instead. +.SH "RETURN VALUE" +The +.BR mbrlen () +function returns the number of bytes +parsed from the multibyte +sequence starting at \fIs\fP, if a non-null wide character was recognized. +It returns 0, if a null wide character was recognized. +It returns +.I "(size_t)\ \-1" +and sets \fIerrno\fP to \fBEILSEQ\fP, if an invalid multibyte sequence was +encountered. +It returns \fI(size_t)\ \-2\fP if it couldn't parse a complete multibyte +character, meaning that \fIn\fP should be increased. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR mbrlen () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR mbrtowc (3) diff --git a/original/man3/mbrtowc.3 b/original/man3/mbrtowc.3 new file mode 100644 index 00000000..2d64f19a --- /dev/null +++ b/original/man3/mbrtowc.3 @@ -0,0 +1,110 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH MBRTOWC 3 2001-11-22 "GNU" "Linux Programmer's Manual" +.SH NAME +mbrtowc \- convert a multibyte sequence to a wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t mbrtowc(wchar_t *" pwc ", const char *" s ", size_t " n \ +", mbstate_t *" ps ); +.fi +.SH DESCRIPTION +The main case for this function is when \fIs\fP is not NULL and \fIpwc\fP is +not NULL. +In this case, the +.BR mbrtowc () +function inspects at most \fIn\fP +bytes of the multibyte string starting at \fIs\fP, extracts the next complete +multibyte character, converts it to a wide character and stores it at +\fI*pwc\fP. +It updates the shift state \fI*ps\fP. +If the converted wide +character is not L\(aq\\0\(aq, it returns the number of bytes that were consumed +from \fIs\fP. +If the converted wide character is L\(aq\\0\(aq, it resets the shift +state \fI*ps\fP to the initial state and returns 0. +.PP +If the \fIn\fP bytes starting at \fIs\fP do not contain a complete multibyte +character, +.BR mbrtowc () +returns \fI(size_t)\ \-2\fP. +This can happen even if +\fIn\fP >= \fIMB_CUR_MAX\fP, if the multibyte string contains redundant shift +sequences. +.PP +If the multibyte string starting at \fIs\fP contains an invalid multibyte +sequence before the next complete character, +.BR mbrtowc () +returns +\fI(size_t)\ \-1\fP and sets \fIerrno\fP to \fBEILSEQ\fP. +In this case, +the effects on \fI*ps\fP are undefined. +.PP +A different case is when \fIs\fP is not NULL but \fIpwc\fP is NULL. +In this +case the +.BR mbrtowc () +function behaves as above, except that it does not +store the converted wide character in memory. +.PP +A third case is when \fIs\fP is NULL. +In this case, \fIpwc\fP and \fIn\fP are +ignored. +If the conversion state represented by \fI*ps\fP denotes an +incomplete multibyte character conversion, the +.BR mbrtowc () +function +returns \fI(size_t)\ \-1\fP, sets \fIerrno\fP to \fBEILSEQ\fP, and +leaves \fI*ps\fP in an undefined state. +Otherwise, the +.BR mbrtowc () +function +puts \fI*ps\fP in the initial state and returns 0. +.PP +In all of the above cases, if \fIps\fP is a NULL pointer, a static anonymous +state only known to the mbrtowc function is used instead. +Otherwise, \fI*ps\fP must be a valid \fImbstate_t\fP object. +An \fImbstate_t\fP object \fIa\fP can be initialized to the initial state +by zeroing it, for example using +.sp +.in +4n +memset(&a, 0, sizeof(a)); +.in +.SH "RETURN VALUE" +The +.BR mbrtowc () +function returns the number of bytes parsed from the +multibyte sequence starting at \fIs\fP, if a non-L\(aq\\0\(aq wide character +was recognized. +It returns 0, if a L\(aq\\0\(aq wide character was recognized. +It returns +.I (size_t)\ \-1 +and sets \fIerrno\fP to \fBEILSEQ\fP, if an invalid multibyte sequence was +encountered. +It returns \fI(size_t)\ \-2\fP if it couldn't parse a complete multibyte +character, meaning that \fIn\fP should be increased. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR mbrtowc () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR mbsrtowcs (3) diff --git a/original/man3/mbsinit.3 b/original/man3/mbsinit.3 new file mode 100644 index 00000000..7533cf6f --- /dev/null +++ b/original/man3/mbsinit.3 @@ -0,0 +1,85 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH MBSINIT 3 2000-11-20 "GNU" "Linux Programmer's Manual" +.SH NAME +mbsinit \- test for initial shift state +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int mbsinit(const mbstate_t *" ps ); +.fi +.SH DESCRIPTION +Character conversion between the multibyte representation and the wide +character representation uses conversion state, of type \fImbstate_t\fP. +Conversion of a string uses a finite-state machine; when it is interrupted +after the complete conversion of a number of characters, it may need to +save a state for processing the remaining characters. +Such a conversion +state is needed for the sake of encodings such as ISO-2022 and UTF-7. +.PP +The initial state is the state at the beginning of conversion of a string. +There are two kinds of state: The one used by multibyte to wide character +conversion functions, such as +.BR mbsrtowcs (3), +and the one used by wide +character to multibyte conversion functions, such as +.BR wcsrtombs (3), +but they both fit in a \fImbstate_t\fP, and they both have the same +representation for an initial state. +.PP +For 8-bit encodings, all states are equivalent to the initial state. +For multibyte encodings like UTF-8, EUC-*, BIG5 or SJIS, the wide character +to multibyte conversion functions never produce non-initial states, but the +multibyte to wide-character conversion functions like +.BR mbrtowc (3) +do +produce non-initial states when interrupted in the middle of a character. +.PP +One possible way to create an +.I mbstate_t +in initial state is to set it to zero: +.nf + + mbstate_t state; + memset(&state,0,sizeof(mbstate_t)); +.fi +.PP +On Linux, the following works as well, but might generate compiler warnings: +.nf + + mbstate_t state = { 0 }; +.fi +.PP +The function +.BR mbsinit () +tests whether \fI*ps\fP corresponds to an +initial state. +.SH "RETURN VALUE" +.BR mbsinit () +returns nonzero if \fI*ps\fP is an initial state, or if +\fIps\fP is a null pointer. +Otherwise it returns 0. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR mbsinit () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR mbsrtowcs (3), +.BR wcsrtombs (3) diff --git a/original/man3/mbsnrtowcs.3 b/original/man3/mbsnrtowcs.3 new file mode 100644 index 00000000..61e13763 --- /dev/null +++ b/original/man3/mbsnrtowcs.3 @@ -0,0 +1,106 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.TH MBSNRTOWCS 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +mbsnrtowcs \- convert a multibyte string to a wide-character string +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "size_t mbsnrtowcs(wchar_t *" dest ", const char **" src , +.BI " size_t " nms ", size_t " len ", mbstate_t *" ps ); +.fi +.SH DESCRIPTION +The +.BR mbsnrtowcs () +function is like the +.BR mbsrtowcs (3) +function, except that +the number of bytes to be converted, starting at \fI*src\fP, is limited to +\fInms\fP. +.PP +If \fIdest\fP is not a NULL pointer, the +.BR mbsnrtowcs () +function converts at +most \fInms\fP bytes from the +multibyte string \fI*src\fP to a wide-character string starting at \fIdest\fP. +At most \fIlen\fP wide characters are written to \fIdest\fP. +The shift state +\fI*ps\fP is updated. +The conversion is effectively performed by repeatedly +calling +.I "mbrtowc(dest, *src, n, ps)" +where \fIn\fP is some +positive number, as long as this call succeeds, and then incrementing +\fIdest\fP by one and \fI*src\fP by the number of bytes consumed. +The +conversion can stop for three reasons: +.IP 1. 3 +An invalid multibyte sequence has been encountered. +In this case \fI*src\fP +is left pointing to the invalid multibyte sequence, +.I (size_t)\ \-1 +is returned, +and \fIerrno\fP is set to \fBEILSEQ\fP. +.IP 2. +The \fInms\fP limit forces a stop, +or \fIlen\fP non-L\(aq\\0\(aq wide characters +have been stored at \fIdest\fP. +In this case \fI*src\fP is left pointing to the +next multibyte sequence to be converted, and the number of wide characters +written to \fIdest\fP is returned. +.IP 3. +The multibyte string has been completely converted, including the +terminating \(aq\\0\(aq +(which has the side effect of bringing back \fI*ps\fP to the +initial state). +In this case \fI*src\fP is set to NULL, and the number of wide +characters written to \fIdest\fP, +excluding the terminating L\(aq\\0\(aq character, +is returned. +.PP +If \fIdest\fP is NULL, \fIlen\fP is ignored, and the conversion proceeds as +above, except that the converted wide characters +are not written out to memory, +and that no destination length limit exists. +.PP +In both of the above cases, if \fIps\fP is a NULL pointer, a static anonymous +state only known to the mbsnrtowcs function is used instead. +.PP +The programmer must ensure that there is room for at least \fIlen\fP wide +characters at \fIdest\fP. +.SH "RETURN VALUE" +The +.BR mbsnrtowcs () +function returns the number of wide characters +that make up the converted part of the wide-character string, +not including the terminating null wide character. +If an invalid multibyte sequence was +encountered, +.I (size_t)\ \-1 +is returned, and \fIerrno\fP set to \fBEILSEQ\fP. +.SH "CONFORMING TO" +This function is a GNU extension. +.SH NOTES +The behavior of +.BR mbsnrtowcs () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +Passing NULL as \fIps\fP is not multithread safe. +.SH "SEE ALSO" +.BR iconv (3), +.BR mbsrtowcs (3) diff --git a/original/man3/mbsrtowcs.3 b/original/man3/mbsrtowcs.3 new file mode 100644 index 00000000..0aaf70ba --- /dev/null +++ b/original/man3/mbsrtowcs.3 @@ -0,0 +1,98 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH MBSRTOWCS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +mbsrtowcs \- convert a multibyte string to a wide-character string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t mbsrtowcs(wchar_t *" dest ", const char **" src , +.BI " size_t " len ", mbstate_t *" ps ); +.fi +.SH DESCRIPTION +If \fIdest\fP is not a NULL pointer, the +.BR mbsrtowcs () +function converts the +multibyte string \fI*src\fP to a wide-character string starting at \fIdest\fP. +At most \fIlen\fP wide characters are written to \fIdest\fP. +The shift state +\fI*ps\fP is updated. +The conversion is effectively performed by repeatedly +calling +.I "mbrtowc(dest, *src, n, ps)" +where \fIn\fP is some +positive number, as long as this call succeeds, and then incrementing +\fIdest\fP by one and \fI*src\fP by the number of bytes consumed. +The conversion can stop for three reasons: +.IP 1. 3 +An invalid multibyte sequence has been encountered. +In this case \fI*src\fP +is left pointing to the invalid multibyte sequence, +.I (size_t)\ \-1 +is returned, +and \fIerrno\fP is set to \fBEILSEQ\fP. +.IP 2. +\fIlen\fP non-L\(aq\\0\(aq wide characters have been stored at \fIdest\fP. +In this +case \fI*src\fP is left pointing to the next +multibyte sequence to be converted, +and the number of wide characters written to \fIdest\fP is returned. +.IP 3. +The multibyte string has been completely converted, including the +terminating \(aq\\0\(aq (which has the side +effect of bringing back \fI*ps\fP to the +initial state). +In this case \fI*src\fP is set to NULL, and the number of wide +characters written to \fIdest\fP, +excluding the terminating L\(aq\\0\(aq character, is returned. +.PP +If \fIdest\fP is NULL, \fIlen\fP is ignored, +and the conversion proceeds as above, +except that the converted wide characters are not written out to memory, +and that no length limit exists. +.PP +In both of the above cases, +if \fIps\fP is a NULL pointer, a static anonymous +state only known to the +.BR mbsrtowcs () +function is used instead. +.PP +The programmer must ensure that there is room for at least \fIlen\fP wide +characters at \fIdest\fP. +.SH "RETURN VALUE" +The +.BR mbsrtowcs () +function returns the number of wide characters that make +up the converted part of the wide-character string, not including the +terminating null wide character. +If an invalid multibyte sequence was +encountered, +.I (size_t)\ \-1 +is returned, and \fIerrno\fP set to \fBEILSEQ\fP. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR mbsrtowcs () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +Passing NULL as \fIps\fP is not multithread safe. +.SH "SEE ALSO" +.BR iconv (3), +.BR mbsnrtowcs (3), +.BR mbstowcs (3) diff --git a/original/man3/mbstowcs.3 b/original/man3/mbstowcs.3 new file mode 100644 index 00000000..d1b0c5e5 --- /dev/null +++ b/original/man3/mbstowcs.3 @@ -0,0 +1,83 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH MBSTOWCS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +mbstowcs \- convert a multibyte string to a wide-character string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t mbstowcs(wchar_t *" dest ", const char *" src ", size_t " n ); +.fi +.SH DESCRIPTION +If \fIdest\fP is not a NULL pointer, +the +.BR mbstowcs () +function converts the +multibyte string \fIsrc\fP to a wide-character string starting at \fIdest\fP. +At most \fIn\fP wide characters are written to \fIdest\fP. +The conversion starts +in the initial state. +The conversion can stop for three reasons: +.IP 1. 3 +An invalid multibyte sequence has been encountered. +In this case +.I (size_t)\ \-1 +is returned. +.IP 2. +\fIn\fP non-L\(aq\\0\(aq wide characters have been stored at \fIdest\fP. +In this +case the number of wide characters written to \fIdest\fP is returned, but the +shift state at this point is lost. +.IP 3. +The multibyte string has been completely converted, including the +terminating \(aq\\0\(aq. +In this case the number of wide characters written to +\fIdest\fP, excluding the terminating L\(aq\\0\(aq character, is returned. +.PP +The programmer must ensure that there is room for at least \fIn\fP wide +characters at \fIdest\fP. +.PP +If \fIdest\fP is NULL, \fIn\fP is ignored, and the conversion proceeds as +above, except that the converted wide characters are not written out to memory, +and that no length limit exists. +.PP +In order to avoid the case 2 above, the programmer should make sure \fIn\fP is +greater or equal to \fImbstowcs(NULL,src,0)+1\fP. +.SH "RETURN VALUE" +The +.BR mbstowcs () +function returns the number of wide characters that make +up the converted part of the wide-character string, not including the +terminating null wide character. +If an invalid multibyte sequence was +encountered, +.I (size_t)\ \-1 +is returned. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR mbstowcs () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +The function +.BR mbsrtowcs (3) +provides a better interface to the same +functionality. +.SH "SEE ALSO" +.BR mbsrtowcs (3) diff --git a/original/man3/mbtowc.3 b/original/man3/mbtowc.3 new file mode 100644 index 00000000..c5022261 --- /dev/null +++ b/original/man3/mbtowc.3 @@ -0,0 +1,94 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH MBTOWC 3 2001-07-04 "GNU" "Linux Programmer's Manual" +.SH NAME +mbtowc \- convert a multibyte sequence to a wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int mbtowc(wchar_t *" pwc ", const char *" s ", size_t " n ); +.fi +.SH DESCRIPTION +The main case for this function is when \fIs\fP is not NULL and \fIpwc\fP is +not NULL. +In this case, the +.BR mbtowc () +function inspects at most \fIn\fP +bytes of the multibyte string starting at \fIs\fP, +extracts the next complete +multibyte character, converts it to a wide character and stores it at +\fI*pwc\fP. +It updates an internal shift state only known to the mbtowc +function. +If \fIs\fP does not point to a \(aq\\0\(aq byte, it returns the number +of bytes that were consumed from \fIs\fP, otherwise it returns 0. +.PP +If the \fIn\fP bytes starting at \fIs\fP do not contain a complete multibyte +character, or if they contain an invalid multibyte sequence, +.BR mbtowc () +returns \-1. +This can happen even if \fIn\fP >= \fIMB_CUR_MAX\fP, +if the multibyte string contains redundant shift sequences. +.PP +A different case is when \fIs\fP is not NULL but \fIpwc\fP is NULL. +In this +case the +.BR mbtowc () +function behaves as above, except that it does not +store the converted wide character in memory. +.PP +A third case is when \fIs\fP is NULL. +In this case, \fIpwc\fP and \fIn\fP are +ignored. +The +.BR mbtowc () +function +.\" The Dinkumware doc and the Single Unix specification say this, but +.\" glibc doesn't implement this. +resets the shift state, only known to this function, +to the initial state, and +returns nonzero if the encoding has nontrivial shift state, or zero if the +encoding is stateless. +.SH "RETURN VALUE" +If \fIs\fP is not NULL, the +.BR mbtowc () +function returns the number of +consumed bytes starting at \fIs\fP, or 0 if \fIs\fP points to a null byte, +or \-1 upon failure. +.PP +If \fIs\fP is NULL, the +.BR mbtowc () +function +returns nonzero if the encoding +has nontrivial shift state, or zero if the encoding is stateless. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR mbtowc () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +This function is not multithread safe. +The function +.BR mbrtowc (3) +provides +a better interface to the same functionality. +.SH "SEE ALSO" +.BR MB_CUR_MAX (3), +.BR mbrtowc (3), +.BR mbstowcs (3) diff --git a/original/man3/memalign.3 b/original/man3/memalign.3 new file mode 100644 index 00000000..791d4c80 --- /dev/null +++ b/original/man3/memalign.3 @@ -0,0 +1 @@ +.so man3/posix_memalign.3 diff --git a/original/man3/memccpy.3 b/original/man3/memccpy.3 new file mode 100644 index 00000000..c38edabc --- /dev/null +++ b/original/man3/memccpy.3 @@ -0,0 +1,58 @@ +.\" 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 Sat Jul 24 18:57:24 1993 by Rik Faith (faith@cs.unc.edu) +.TH MEMCCPY 3 2009-01-13 "GNU" "Linux Programmer's Manual" +.SH NAME +memccpy \- copy memory area +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void *memccpy(void *" dest ", const void *" src ", int " c ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR memccpy () +function copies no more than \fIn\fP bytes from +memory area \fIsrc\fP to memory area \fIdest\fP, stopping when the +character \fIc\fP is found. + +If the memory areas overlap, the results are undefined. +.SH "RETURN VALUE" +The +.BR memccpy () +function returns a pointer to the next character +in \fIdest\fP after \fIc\fP, or NULL if \fIc\fP was not found in the +first \fIn\fP characters of \fIsrc\fP. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH "SEE ALSO" +.BR bcopy (3), +.BR memcpy (3), +.BR memmove (3), +.BR strcpy (3), +.BR strncpy (3) diff --git a/original/man3/memchr.3 b/original/man3/memchr.3 new file mode 100644 index 00000000..71b6b822 --- /dev/null +++ b/original/man3/memchr.3 @@ -0,0 +1,140 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and 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. +.\" +.\" Modified Mon Apr 12 12:49:57 1993, David Metcalfe +.\" Modified Sat Jul 24 18:56:22 1993, Rik Faith (faith@cs.unc.edu) +.\" Modified Wed Feb 20 21:09:36 2002, Ian Redfern (redferni@logica.com) +.\" 2008-07-09, mtk, add rawmemchr() +.\" +.TH MEMCHR 3 2009-12-04 "" "Linux Programmer's Manual" +.SH NAME +memchr, memrchr, rawmemchr \- scan memory for a character +.SH SYNOPSIS +.nf +.B #include + +.BI "void *memchr(const void *" s ", int " c ", size_t " n ); + +.BI "void *memrchr(const void *" s ", int " c ", size_t " n ); + +.BI "void *rawmemchr(const void *" s ", int " c ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR memrchr (), +.BR rawmemchr (): +_GNU_SOURCE +.SH DESCRIPTION +The +.BR memchr () +function scans the first \fIn\fP bytes of the memory +area pointed to by \fIs\fP for the character \fIc\fP. +The first byte to +match \fIc\fP (interpreted as an unsigned character) stops the operation. +.PP +The +.BR memrchr () +function is like the +.BR memchr () +function, +except that it searches backwards from the end of the \fIn\fP bytes +pointed to by \fIs\fP instead of forwards from the beginning. + +The +.BR rawmemchr () +function is similar to +.BR memchr (): +it assumes (i.e., the programmer knows for certain) +that the character +.I c +lies somewhere in the string +.IR s , +and so performs an optimized search +for the character +.IR c +(i.e., no checking for the terminating null byte, or use of an argument, +.IR n , +to limit the range of the search). +If the character +.I c +is not in the string +.IR s , +then +.BR rawmemchr () +may proceed to search beyond the end of the string, +and the result is unspecified. +The folowing call is a fast means of locating a string's +terminating null byte: +.in +4n +.nf + +char *p = rawmemchr(s,\ \(aq\\0\(aq); +.fi +.in +.SH "RETURN VALUE" +The +.BR memchr () +and +.BR memrchr () +functions return a pointer +to the matching byte or NULL if the character does not occur in +the given memory area. + +The +.BR rawmemchr () +function returns a pointer to the matching byte, if one is found. +If no matching byte is found, the result is unspecified. +.SH VERSIONS +.BR rawmemchr () +first appeared in glibc in version 2.1. + +.BR memrchr () +first appeared in glibc in version 2.2. +.SH "CONFORMING TO" +The +.BR memchr () +function conforms to SVr4, 4.3BSD, C89, C99, POSIX.1-2001. + +The +.BR memrchr () +function is a GNU extension, available since glibc 2.1.91. + +The +.BR rawmemchr () +function is a GNU extension, available since glibc 2.1. +.SH "SEE ALSO" +.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) diff --git a/original/man3/memcmp.3 b/original/man3/memcmp.3 new file mode 100644 index 00000000..6d9975ba --- /dev/null +++ b/original/man3/memcmp.3 @@ -0,0 +1,61 @@ +.\" 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 Sat Jul 24 18:55:27 1993 by Rik Faith (faith@cs.unc.edu) +.TH MEMCMP 3 1993-04-10 "" "Linux Programmer's Manual" +.SH NAME +memcmp \- compare memory areas +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int memcmp(const void *" s1 ", const void *" s2 ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR memcmp () +function compares the first \fIn\fP bytes of the +memory areas \fIs1\fP and \fIs2\fP. +It returns an integer less than, +equal to, or greater than zero if \fIs1\fP is found, respectively, to +be less than, to match, or be greater than \fIs2\fP. +.SH "RETURN VALUE" +The +.BR memcmp () +function returns an integer less than, equal to, or +greater than zero if the first \fIn\fP bytes of \fIs1\fP is found, +respectively, to be less than, to match, or be greater than the first +\fIn\fP bytes of \fIs2\fP. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR bcmp (3), +.BR strcasecmp (3), +.BR strcmp (3), +.BR strcoll (3), +.BR strncasecmp (3), +.BR strncmp (3), +.BR wmemcmp (3) diff --git a/original/man3/memcpy.3 b/original/man3/memcpy.3 new file mode 100644 index 00000000..0c3baf1f --- /dev/null +++ b/original/man3/memcpy.3 @@ -0,0 +1,59 @@ +.\" 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 Sun Jul 25 10:41:09 1993 by Rik Faith (faith@cs.unc.edu) +.TH MEMCPY 3 1993-04-10 "" "Linux Programmer's Manual" +.SH NAME +memcpy \- copy memory area +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void *memcpy(void *" dest ", const void *" src ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR memcpy () +function copies \fIn\fP bytes from memory area +\fIsrc\fP to memory area \fIdest\fP. +The memory areas should not overlap. +Use +.BR memmove (3) +if the memory areas do overlap. +.SH "RETURN VALUE" +The +.BR memcpy () +function returns a pointer to \fIdest\fP. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR bcopy (3), +.BR memccpy (3), +.BR memmove (3), +.BR mempcpy (3), +.BR strcpy (3), +.BR strncpy (3), +.BR wmemcpy (3) diff --git a/original/man3/memfrob.3 b/original/man3/memfrob.3 new file mode 100644 index 00000000..316e583e --- /dev/null +++ b/original/man3/memfrob.3 @@ -0,0 +1,62 @@ +.\" 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 Sat Jul 24 18:54:45 1993 by Rik Faith (faith@cs.unc.edu) +.TH MEMFROB 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +memfrob \- frobnicate (encrypt) a memory area +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "void *memfrob(void *" s ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR memfrob () +function encrypts the first \fIn\fP bytes of the +memory area \fIs\fP by exclusive-ORing each character with the number +42. +The effect can be reversed by using +.BR memfrob () +on the +encrypted memory area. +.PP +Note that this function is not a proper encryption routine as the XOR +constant is fixed, and is only suitable for hiding strings. +.SH "RETURN VALUE" +The +.BR memfrob () +function returns a pointer to the encrypted memory +area. +.SH "CONFORMING TO" +The +.BR memfrob () +function is unique to the +GNU C Library. +.SH "SEE ALSO" +.BR strfry (3) diff --git a/original/man3/memmem.3 b/original/man3/memmem.3 new file mode 100644 index 00000000..81b4179c --- /dev/null +++ b/original/man3/memmem.3 @@ -0,0 +1,65 @@ +.\" 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 +.\" 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. +.TH MEMMEM 3 2008-12-05 "GNU" "Linux Programmer's Manual" +.SH NAME +memmem \- locate a substring +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "void *memmem(const void *" haystack ", size_t " haystacklen , +.BI " const void *" needle ", size_t " needlelen ); +.fi +.SH DESCRIPTION +The +.BR memmem () +function finds the start of the first occurrence +of the substring \fIneedle\fP of length \fIneedlelen\fP in the memory +area \fIhaystack\fP of length \fIhaystacklen\fP. +.SH "RETURN VALUE" +The +.BR memmem () +function returns a pointer to the beginning of the +substring, or NULL if the substring is not found. +.SH "CONFORMING TO" +This function is a GNU extension. +.SH BUGS +This function was broken in Linux libraries up to and including libc 5.0.9; +there the \fIneedle\fP and \fIhaystack\fP arguments were interchanged, +and a pointer to the end of the first occurrence of \fIneedle\fP +was returned. + +Both old and new libc's have the bug that if \fIneedle\fP is empty, +\fIhaystack\-1\fP (instead of \fIhaystack\fP) is returned. +And glibc 2.0 makes it worse, returning a pointer to the +last byte of \fIhaystack\fP. +This is fixed in glibc 2.1. +.SH "SEE ALSO" +.BR strstr (3), +.BR feature_test_macros (7) diff --git a/original/man3/memmove.3 b/original/man3/memmove.3 new file mode 100644 index 00000000..24c5e798 --- /dev/null +++ b/original/man3/memmove.3 @@ -0,0 +1,63 @@ +.\" 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 Sat Jul 24 18:49:59 1993 by Rik Faith (faith@cs.unc.edu) +.TH MEMMOVE 3 1993-04-10 "GNU" "Linux Programmer's Manual" +.SH NAME +memmove \- copy memory area +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void *memmove(void *" dest ", const void *" src ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR memmove () +function copies \fIn\fP bytes from memory area +\fIsrc\fP to memory area \fIdest\fP. +The memory areas may overlap: copying takes place as though +the bytes in +.I src +are first copied into a temporary array that does not overlap +.I src +or +.IR dest , +and the bytes are then copied from the temporary array to +.IR dest . +.SH "RETURN VALUE" +The +.BR memmove () +function returns a pointer to \fIdest\fP. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR bcopy (3), +.BR memccpy (3), +.BR memcpy (3), +.BR strcpy (3), +.BR strncpy (3), +.BR wmemmove (3) diff --git a/original/man3/mempcpy.3 b/original/man3/mempcpy.3 new file mode 100644 index 00000000..bf18bb80 --- /dev/null +++ b/original/man3/mempcpy.3 @@ -0,0 +1,72 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" Heavily based on glibc infopages, copyright Free Software Foundation +.\" +.\" aeb, 2003, polished a little +.TH MEMPCPY 3 2008-08-12 "GNU" "Linux Programmer's Manual" +.SH NAME +mempcpy, wmempcpy \- copy memory area +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n ); +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR mempcpy () +function is nearly identical to the +.BR memcpy (3) +function. +It copies +.I n +bytes from the object beginning at +.I src +into the object pointed to by +.IR dest . +But instead of returning the value of +.I dest +it returns a pointer to the byte following the last written byte. +.PP +This function is useful in situations where a number of objects +shall be copied to consecutive memory positions. +.PP +The +.BR wmempcpy () +function is identical but takes +.I wchar_t +type arguments and copies +.I n +wide characters. +.SH "RETURN VALUE" +\fIdest\fP + \fIn\fP. +.SH VERSIONS +.BR mempcpy () +first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +This function is a GNU extension. +.SH "EXAMPLE" +.nf +void * +combine(void *o1, size_t s1, void *o2, size_t s2) +{ + void *result = malloc(s1 + s2); + if (result != NULL) + mempcpy(mempcpy(result, o1, s1), o2, s2); + return result; +} +.fi +.SH "SEE ALSO" +.BR memccpy (3), +.BR memcpy (3), +.BR memmove (3), +.BR wmemcpy (3), +.BR feature_test_macros (7) diff --git a/original/man3/memrchr.3 b/original/man3/memrchr.3 new file mode 100644 index 00000000..b62c8f10 --- /dev/null +++ b/original/man3/memrchr.3 @@ -0,0 +1 @@ +.so man3/memchr.3 diff --git a/original/man3/memset.3 b/original/man3/memset.3 new file mode 100644 index 00000000..377b3494 --- /dev/null +++ b/original/man3/memset.3 @@ -0,0 +1,52 @@ +.\" 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 Sat Jul 24 18:49:23 1993 by Rik Faith (faith@cs.unc.edu) +.TH MEMSET 3 1993-04-11 "GNU" "Linux Programmer's Manual" +.SH NAME +memset \- fill memory with a constant byte +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void *memset(void *" s ", int " c ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR memset () +function fills the first \fIn\fP bytes of the +memory area pointed to by \fIs\fP with the constant byte \fIc\fP. +.SH "RETURN VALUE" +The +.BR memset () +function returns a pointer to the memory area +\fIs\fP. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR bzero (3), +.BR swab (3), +.BR wmemset (3) diff --git a/original/man3/minor.3 b/original/man3/minor.3 new file mode 100644 index 00000000..eabbdd01 --- /dev/null +++ b/original/man3/minor.3 @@ -0,0 +1 @@ +.so man3/makedev.3 diff --git a/original/man3/mkdtemp.3 b/original/man3/mkdtemp.3 new file mode 100644 index 00000000..98a9e3c9 --- /dev/null +++ b/original/man3/mkdtemp.3 @@ -0,0 +1,83 @@ +.\" Copyright 2001 John Levon +.\" Based on mkstemp(3), Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and 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. +.TH MKDTEMP 3 2008-08-21 "GNU" "Linux Programmer's Manual" +.SH NAME +mkdtemp \- create a unique temporary directory +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *mkdtemp(char *" template ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR mkdtemp (): +_BSD_SOURCE +.SH DESCRIPTION +The +.BR mkdtemp () +function generates a uniquely named temporary +directory from \fItemplate\fP. +The last six characters of \fItemplate\fP +must be XXXXXX and these are replaced with a string that makes the +directory name unique. +The directory is then created with +permissions 0700. +Since it will be modified, +.I template +must not be a string constant, but should be declared as a character array. +.SH "RETURN VALUE" +The +.BR mkdtemp () +function returns a pointer to the modified template +string on success, and NULL on failure, in which case +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +The last six characters of \fItemplate\fP were not XXXXXX. +Now \fItemplate\fP is unchanged. +.PP +Also see +.BR mkdir (2) +for other possible values for \fIerrno\fP. +.SH VERSIONS +Available since glibc 2.1.91. +.SH "CONFORMING TO" +POSIX.1-2008. +This function is present on the BSDs. +.\" As at 2006, this function is being considered for a revision of POSIX.1 +.\" Also in NetBSD 1.4. +.SH "SEE ALSO" +.BR mkdir (2), +.BR mkstemp (3), +.BR mktemp (3), +.BR tempnam (3), +.BR tmpfile (3), +.BR tmpnam (3) diff --git a/original/man3/mkfifo.3 b/original/man3/mkfifo.3 new file mode 100644 index 00000000..35b46b5f --- /dev/null +++ b/original/man3/mkfifo.3 @@ -0,0 +1,111 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1995 James R. Van Zandt +.\" +.\" 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. +.\" +.\" changed section from 2 to 3, aeb, 950919 +.\" +.TH MKFIFO 3 2008-06-12 "GNU" "Linux Programmer's Manual" +.SH NAME +mkfifo \- make a FIFO special file (a named pipe) +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "int mkfifo(const char *" pathname ", mode_t " mode ); +.fi +.SH DESCRIPTION +.BR mkfifo () +makes a FIFO special file with name \fIpathname\fP. +\fImode\fP specifies the FIFO's permissions. +It is modified by the +process's \fBumask\fP in the usual way: the permissions of the created +file are \fB(\fP\fImode\fP\fB & ~umask)\fP. +.PP +A FIFO special file is similar to a pipe, except that it is created +in a different way. +Instead of being an anonymous communications +channel, a FIFO special file is entered into the file system by +calling +.BR mkfifo (). +.PP +Once you have created a FIFO special file in this way, any process can +open it for reading or writing, in the same way as an ordinary file. +However, it has to be open at both ends simultaneously before you can +proceed to do any input or output operations on it. +Opening a FIFO for reading normally blocks until some +other process opens the same FIFO for writing, and vice versa. +See +.BR fifo (7) +for nonblocking handling of FIFO special files. +.SH "RETURN VALUE" +On success +.BR mkfifo () +returns 0. +In the case of an error, \-1 is returned (in which case, \fIerrno\fP +is set appropriately). +.SH ERRORS +.TP +.B EACCES +One of the directories in \fIpathname\fP did not allow search +(execute) permission. +.TP +.B EEXIST +\fIpathname\fP already exists. +This includes the case where +.I pathname +is a symbolic link, dangling or not. +.TP +.B ENAMETOOLONG +Either the total length of \fIpathname\fP is greater than +\fBPATH_MAX\fP, or an individual filename component has a length +greater than \fBNAME_MAX\fP. +In the GNU system, there is no imposed +limit on overall filename length, but some file systems may place +limits on the length of a component. +.TP +.B ENOENT +A directory component in \fIpathname\fP does not exist or is a +dangling symbolic link. +.TP +.B ENOSPC +The directory or file system has no room for the new file. +.TP +.B ENOTDIR +A component used as a directory in \fIpathname\fP is not, in fact, a +directory. +.TP +.B EROFS +\fIpathname\fP refers to a read-only file system. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH "SEE ALSO" +.BR mkfifo (1), +.BR close (2), +.BR open (2), +.BR read (2), +.BR stat (2), +.BR umask (2), +.BR write (2), +.BR mkfifoat (3), +.BR fifo (7) diff --git a/original/man3/mkfifoat.3 b/original/man3/mkfifoat.3 new file mode 100644 index 00000000..8e4dd26b --- /dev/null +++ b/original/man3/mkfifoat.3 @@ -0,0 +1,122 @@ +.\" 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. +.\" +.\" +.TH MKFIFOAT 3 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +mkfifoat \- make a FIFO (named pipe) relative to a directory file descriptor +.SH SYNOPSIS +.nf +.B #include /* Definition of AT_* constants */ +.B #include +.sp +.BI "int mkfifoat(int " dirfd ", const char *" pathname ", mode_t " mode ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR mkfifoat (): +.br +Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +Before glibc 2.10: +_ATFILE_SOURCE +.SH DESCRIPTION +The +.BR mkfifoat () +system call operates in exactly the same way as +.BR mkfifo (3), +except for the differences described in this manual page. + +If the pathname given in +.I pathname +is relative, then it is interpreted relative to the directory +referred to by the file descriptor +.I dirfd +(rather than relative to the current working directory of +the calling process, as is done by +.BR mkfifo (3) +for a relative pathname). + +If +.I pathname +is relative and +.I dirfd +is the special value +.BR AT_FDCWD , +then +.I pathname +is interpreted relative to the current working +directory of the calling process (like +.BR mkfifo (3)). + +If +.I pathname +is absolute, then +.I dirfd +is ignored. +.SH "RETURN VALUE" +On success, +.BR mkfifoat () +returns 0. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +The same errors that occur for +.BR mkfifo (3) +can also occur for +.BR mkfifoat (). +The following additional errors can occur for +.BR mkfifoat (): +.TP +.B EBADF +.I dirfd +is not a valid file descriptor. +.TP +.B ENOTDIR +.I pathname +is a relative path and +.I dirfd +is a file descriptor referring to a file other than a directory. +.SH VERSIONS +.BR mkfifoat () +was added to glibc in version 2.4. +It is implemented using +.BR mknod (2), +available on Linux since kernel 2.6.16. +.SH "CONFORMING TO" +POSIX.1-2008. +.SH NOTES +See +.BR openat (2) +for an explanation of the need for +.BR mkfifoat (). +.SH "SEE ALSO" +.BR openat (2), +.BR mkfifo (3), +.BR path_resolution (7) diff --git a/original/man3/mkostemp.3 b/original/man3/mkostemp.3 new file mode 100644 index 00000000..08cc2dea --- /dev/null +++ b/original/man3/mkostemp.3 @@ -0,0 +1 @@ +.so man3/mkstemp.3 diff --git a/original/man3/mkstemp.3 b/original/man3/mkstemp.3 new file mode 100644 index 00000000..bea792f6 --- /dev/null +++ b/original/man3/mkstemp.3 @@ -0,0 +1,144 @@ +.\" 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 +.\" +.TH MKSTEMP 3 2008-06-19 "GNU" "Linux Programmer's Manual" +.SH NAME +mkstemp, mkostemp \- create a unique temporary file +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int mkstemp(char *" template ); +.sp +.BI "int mkostemp (char *" template ", int " flags ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR mkstemp (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR mkostemp (): +_GNU_SOURCE +.SH DESCRIPTION +The +.BR mkstemp () +function generates a unique temporary filename from +.IR template , +creates and opens the file, +and returns an open file descriptor for the file. + +The last six characters of +.I template +must be "XXXXXX" and these are replaced with a string that makes the +filename unique. +Since it will be modified, +.I template +must not be a string constant, but should be declared as a character array. + +The file is created with +permissions 0600, that is, read plus write for owner only. +(In glibc versions 2.06 and earlier, the file is created with permissions 0666, +that is, read and write for all users.) +The returned file descriptor provides both read and write access to the file. +The file is opened with the +.BR open (2) +.B O_EXCL +flag, guaranteeing that the caller is the process that creates the file. + +.BR mkostemp () +is like +.BR mkstemp (), +with the difference that flags as for +.BR open (2) +may be specified in +.IR flags +(e.g., +.BR O_APPEND , +.BR O_SYNC ). +.SH "RETURN VALUE" +On success, these functions return the file descriptor +of the temporary file. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EEXIST +Could not create a unique temporary filename. +Now the contents of \fItemplate\fP are undefined. +.TP +.B EINVAL +The last six characters of \fItemplate\fP were not XXXXXX. +Now \fItemplate\fP is unchanged. +.PP +These functions may also fail with any of the errors described for +.BR open (2). +.SH VERSIONS +.BR mkostemp () +is available since glibc 2.7. +.SH "CONFORMING TO" +.BR mkstemp (): +4.3BSD, POSIX.1-2001. +.BR mkostemp (): +is a glibc extension. +.SH NOTES +The old behavior of creating a file with mode 0666 may be +a security risk, especially since other Unix flavors use 0600, +and somebody might overlook this detail when porting programs. + +More generally, the POSIX specification of +.BR mkstemp () +does not say anything +about file modes, so the application should make sure its +file mode creation mask (see +.BR umask (2)) +is set appropriately before calling +.BR mkstemp () +(and +.BR mkostemp ()). + +The prototype for +.BR mktemp () +is in +.I +for libc4, libc5, glibc1; glibc2 follows POSIX.1 and has the prototype in +.IR . +.SH "SEE ALSO" +.BR mkdtemp (3), +.BR mktemp (3), +.BR tempnam (3), +.BR tmpfile (3), +.BR tmpnam (3) diff --git a/original/man3/mktemp.3 b/original/man3/mktemp.3 new file mode 100644 index 00000000..a34fe988 --- /dev/null +++ b/original/man3/mktemp.3 @@ -0,0 +1,100 @@ +.\" Copyright (C) 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 Sat Jul 24 18:48:06 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Jun 23 01:26:34 1995 by Andries Brouwer (aeb@cwi.nl) +.\" (prompted by Scott Burkett ) +.\" Modified Sun Mar 28 23:44:38 1999 by Andries Brouwer (aeb@cwi.nl) +.\" +.TH MKTEMP 3 2008-08-06 "GNU" "Linux Programmer's Manual" +.SH NAME +mktemp \- make a unique temporary filename +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *mktemp(char *" template ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR mktemp (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +The +.BR mktemp () +function generates a unique temporary filename +from \fItemplate\fP. +The last six characters of \fItemplate\fP must +be XXXXXX and these are replaced with a string that makes the +filename unique. +Since it will be modified, +.I template +must not be a string constant, but should be declared as a character array. +.SH "RETURN VALUE" +The +.BR mktemp () +function always returns \fItemplate\fP. +If a unique name was created, the last six bytes of \fItemplate\fP will +have been modified in such a way that the resulting name is unique +(i.e., does not exist already) +If a unique name could not be created, +\fItemplate\fP is made an empty string. +.SH ERRORS +.TP +.B EINVAL +The last six characters of \fItemplate\fP were not XXXXXX. +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +POSIX.1-2008 removes the specification of +.BR mktemp (). +.SH NOTES +The prototype is in +.I +for libc4, libc5, glibc1; glibc2 follows the Single Unix Specification +and has the prototype in +.IR . +.SH BUGS +Never use +.BR mktemp (). +Some implementations follow 4.3BSD +and replace XXXXXX by the current process ID and a single letter, +so that at most 26 different names can be returned. +Since on the one hand the names are easy to guess, and on the other +hand there is a race between testing whether the name exists and +opening the file, every use of +.BR mktemp () +is a security risk. +The race is avoided by +.BR mkstemp (3). +.SH "SEE ALSO" +.BR mkstemp (3), +.BR tempnam (3), +.BR tmpfile (3), +.BR tmpnam (3) diff --git a/original/man3/mktime.3 b/original/man3/mktime.3 new file mode 100644 index 00000000..84a3baa9 --- /dev/null +++ b/original/man3/mktime.3 @@ -0,0 +1 @@ +.so man3/ctime.3 diff --git a/original/man3/mmap64.3 b/original/man3/mmap64.3 new file mode 100644 index 00000000..34c06efc --- /dev/null +++ b/original/man3/mmap64.3 @@ -0,0 +1 @@ +.so man2/mmap2.2 diff --git a/original/man3/modf.3 b/original/man3/modf.3 new file mode 100644 index 00000000..cfb1e428 --- /dev/null +++ b/original/man3/modf.3 @@ -0,0 +1,91 @@ +.\" 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-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-07-27 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" +.TH MODF 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +modf, modff, modfl \- extract signed integral and fractional values from +floating-point number +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double modf(double " x ", double *" iptr ); +.br +.BI "float modff(float " x ", float *" iptr ); +.br +.BI "long double modfl(long double " x ", long double *" iptr ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR modf (), +.BR modl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR modf () +function breaks the argument \fIx\fP into an integral +part and a fractional part, each of which has the same sign as \fIx\fP. +The integral part is stored in the location pointed to by \fIiptr\fP. +.SH "RETURN VALUE" +The +.BR modf () +function returns the fractional part of \fIx\fP. + +If +.I x +is a NaN, a NaN is returned, and +.IR *iptr +is set to a NaN. + +If +.I x +is positive infinity (negative infinity), +0 (-0) is returned, and +.IR *iptr +is set to positive infinity (negative infinity). +.SH ERRORS +No errors occur. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR frexp (3), +.BR ldexp (3) diff --git a/original/man3/modff.3 b/original/man3/modff.3 new file mode 100644 index 00000000..84af2e33 --- /dev/null +++ b/original/man3/modff.3 @@ -0,0 +1 @@ +.so man3/modf.3 diff --git a/original/man3/modfl.3 b/original/man3/modfl.3 new file mode 100644 index 00000000..84af2e33 --- /dev/null +++ b/original/man3/modfl.3 @@ -0,0 +1 @@ +.so man3/modf.3 diff --git a/original/man3/mpool.3 b/original/man3/mpool.3 new file mode 100644 index 00000000..40e421cd --- /dev/null +++ b/original/man3/mpool.3 @@ -0,0 +1,226 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)mpool.3 8.1 (Berkeley) 6/4/93 +.\" +.TH MPOOL 3 1993-06-04 "" "Linux Programmer's Manual" +.UC 7 +.SH NAME +mpool \- shared memory buffer pool +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "MPOOL *mpool_open(DBT *" key ", int " fd ", pgno_t " pagesize \ +", pgno_t " maxcache ); +.sp +.BI "void mpool_filter(MPOOL *" mp ", void (*pgin)(void *, pgno_t, void *)," +.BI " void (*" pgout ")(void *, pgno_t, void *)," +.BI " void *" pgcookie ); +.sp +.BI "void *mpool_new(MPOOL *" mp ", pgno_t *" pgnoaddr ); +.sp +.BI "void *mpool_get(MPOOL *" mp ", pgno_t " pgno ", unsigned int " flags ); +.sp +.BI "int mpool_put(MPOOL *" mp ", void *" pgaddr ", unsigned int " flags ); +.sp +.BI "int mpool_sync(MPOOL *" mp ); +.sp +.BI "int mpool_close(MPOOL *" mp ); +.fi +.SH DESCRIPTION +.I Mpool +is the library interface intended to provide page oriented buffer management +of files. +The buffers may be shared between processes. +.PP +The function +.BR mpool_open () +initializes a memory pool. +The +.I key +argument is the byte string used to negotiate between multiple +processes wishing to share buffers. +If the file buffers are mapped in shared memory, all processes using +the same key will share the buffers. +If +.I key +is NULL, the buffers are mapped into private memory. +The +.I fd +argument is a file descriptor for the underlying file, which must be seekable. +If +.I key +is non-NULL and matches a file already being mapped, the +.I fd +argument is ignored. +.PP +The +.I pagesize +argument is the size, in bytes, of the pages into which the file is broken up. +The +.I maxcache +argument is the maximum number of pages from the underlying file to cache +at any one time. +This value is not relative to the number of processes which share a file's +buffers, but will be the largest value specified by any of the processes +sharing the file. +.PP +The +.BR mpool_filter () +function is intended to make transparent input and output processing of the +pages possible. +If the +.I pgin +function is specified, it is called each time a buffer is read into the memory +pool from the backing file. +If the +.I pgout +function is specified, it is called each time a buffer is written into the +backing file. +Both functions are called with the +.I pgcookie +pointer, the page number and a pointer to the page to being read or written. +.PP +The function +.BR mpool_new () +takes an +.I MPOOL +pointer and an address as arguments. +If a new page can be allocated, a pointer to the page is returned and +the page number is stored into the +.I pgnoaddr +address. +Otherwise, NULL is returned and +.I errno +is set. +.PP +The function +.BR mpool_get () +takes an +.I MPOOL +pointer and a page number as arguments. +If the page exists, a pointer to the page is returned. +Otherwise, NULL is returned and +.I errno +is set. +The +.I flags +argument is not currently used. +.PP +The function +.BR mpool_put () +unpins the page referenced by +.IR pgaddr . +.I pgaddr +must be an address previously returned by +.BR mpool_get () +or +.BR mpool_new (). +The flag value is specified by +.IR or 'ing +any of the following values: +.TP +.B MPOOL_DIRTY +The page has been modified and needs to be written to the backing file. +.PP +.BR mpool_put () +returns 0 on success and \-1 if an error occurs. +.PP +The function +.BR mpool_sync () +writes all modified pages associated with the +.I MPOOL +pointer to the +backing file. +.BR mpool_sync () +returns 0 on success and \-1 if an error occurs. +.PP +The +.BR mpool_close () +function free's up any allocated memory associated with the memory pool +cookie. +Modified pages are +.B not +written to the backing file. +.BR mpool_close () +returns 0 on success and \-1 if an error occurs. +.SH ERRORS +The +.BR mpool_open () +function may fail and set +.I errno +for any of the errors specified for the library routine +.BR malloc (3). +.PP +The +.BR mpool_get () +function may fail and set +.I errno +for the following: +.TP 15 +.B EINVAL +The requested record doesn't exist. +.PP +The +.BR mpool_new () +and +.BR mpool_get () +functions may fail and set +.I errno +for any of the errors specified for the library routines +.BR read (2), +.BR write (2), +and +.BR malloc (3). +.PP +The +.BR mpool_sync () +function may fail and set +.I errno +for any of the errors specified for the library routine +.BR write (2). +.PP +The +.BR mpool_close () +function may fail and set +.I errno +for any of the errors specified for the library routine +.BR free (3). +.SH "CONFORMING TO" +Not in POSIX.1-2001. +Present on the BSDs. +.SH "SEE ALSO" +.BR btree (3), +.BR dbopen (3), +.BR hash (3), +.BR recno (3) diff --git a/original/man3/mq_close.3 b/original/man3/mq_close.3 new file mode 100644 index 00000000..1a543751 --- /dev/null +++ b/original/man3/mq_close.3 @@ -0,0 +1,72 @@ +'\" 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. +.\" +.TH MQ_CLOSE 3 2006-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +mq_close \- close a message queue descriptor +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "mqd_t mq_close(mqd_t " mqdes ); +.fi +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +.BR mq_close () +closes the message queue descriptor +.IR mqdes . + +If the calling process has attached a notification request +to this message queue via +.IR mqdes , +then this request is removed, +and another process can now attach a notification request. +.SH RETURN VALUE +On success +.BR mq_close () +returns 0; on error, \-1 is returned, with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EBADF +The descriptor specified in +.I mqdes +is invalid. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +All open message queues are automatically closed on process termination, +or upon +.BR execve (2). +.SH "SEE ALSO" +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR mq_overview (7) diff --git a/original/man3/mq_getattr.3 b/original/man3/mq_getattr.3 new file mode 100644 index 00000000..e9402e66 --- /dev/null +++ b/original/man3/mq_getattr.3 @@ -0,0 +1,154 @@ +'\" 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. +.\" +.TH MQ_GETATTR 3 2008-09-29 "Linux" "Linux Programmer's Manual" +.SH NAME +mq_getattr, mq_setattr \- get/set message queue attributes +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "mqd_t mq_getattr(mqd_t " mqdes ", struct mq_attr *" attr ); + +.BI "mqd_t mq_setattr(mqd_t " mqdes ", struct mq_attr *" newattr "," +.BI " struct mq_attr *" oldattr ); +.fi +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +.BR mq_getattr () +and +.BR mq_setattr () +respectively retrieve and modify attributes of the message queue +referred to by the descriptor +.IR mqdes . + +.BR mq_getattr () +returns an +.I mq_attr +structure in the buffer pointed by +.IR attr . +This structure is defined as: +.in +4n +.nf + +struct mq_attr { + long mq_flags; /* Flags: 0 or O_NONBLOCK */ + long mq_maxmsg; /* Max. # of messages on queue */ + long mq_msgsize; /* Max. message size (bytes) */ + long mq_curmsgs; /* # of messages currently in queue */ +}; +.fi +.in +.PP +The +.I mq_flags +field contains flags associated with the open message queue description. +This field is initialized when the queue is created by +.BR mq_open (3). +The only flag that can appear in this field is +.BR O_NONBLOCK . + +The +.I mq_maxmsg +and +.I mq_msgsize +fields are set when the message queue is created by +.BR mq_open (3). +The +.I mq_maxmsg +field is an upper limit on the number of messages +that may be placed on the queue using +.BR mq_send (3). +The +.I mq_msgsize +field is an upper limit on the size of messages +that may be placed on the queue. +Both of these fields must have a value greater than zero. +Two +.I /proc +files that place ceilings on the values for these fields are described in +.BR mq_open (3). + +The +.I mq_curmsgs +field returns the number of messages currently held in the queue. + +.BR mq_setattr () +sets message queue attributes using information supplied in the +.I mq_attr +structure pointed to by +.IR newattr . +The only attribute that can be modified is the setting of the +.B O_NONBLOCK +flag in +.IR mq_flags . +The other fields in +.I newattr +are ignored. +If the +.I oldattr +field is not NULL, +then the buffer that it points to is used to return an +.I mq_attr +structure that contains the same information that is returned by +.BR mq_getattr (). +.SH RETURN VALUE +On success +.BR mq_getattr () +and +.BR mq_setattr () +return 0; on error, \-1 is returned, with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EBADF +The descriptor specified in +.I mqdes +is invalid. +.TP +.B EINVAL +.I newattr\->mq_flags +contained set bits other than +.BR O_NONBLOCK . +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +On Linux, +.BR mq_getattr () +and +.BR mq_setattr () +are library functions layered on top of the +.BR mq_getsetattr (2) +system call. +.SH "SEE ALSO" +.BR mq_close (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR mq_overview (7) diff --git a/original/man3/mq_notify.3 b/original/man3/mq_notify.3 new file mode 100644 index 00000000..32d729e4 --- /dev/null +++ b/original/man3/mq_notify.3 @@ -0,0 +1,282 @@ +'\" 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. +.\" +.TH MQ_NOTIFY 3 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH NAME +mq_notify \- register for notification when a message is available +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "mqd_t mq_notify(mqd_t " mqdes ", const struct sigevent *" notification ); +.fi +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +.BR mq_notify () +allows the calling process to register or unregister for delivery of +an asynchronous notification when a new message arrives on +the empty message queue referred to by the descriptor +.IR mqdes . + +The +.I notification +argument is a pointer to a +.I sigevent +structure that is defined something like the following: +.in +4n +.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 for thread + notification */ + void *sigev_notify_attributes; + /* Thread function attributes */ +}; +.fi +.in +.PP +If +.I notification +is a non-NULL pointer, then +.BR mq_notify () +registers the calling process to receive message notification. +The +.I sigev_notify +field of the +.I sigevent +to which +.I notification +points specifies how notification is to be performed. +This field has one of the following values: +.TP +.B SIGEV_NONE +A "null" notification: the calling process is registered as the target +for notification, but when a message arrives, no notification is sent. +.\" When is SIGEV_NONE useful? +.TP +.B SIGEV_SIGNAL +Notify the process by sending the signal specified in +.IR sigev_signo . +If the signal is caught with a signal handler that +was registered using the +.BR sigaction (2) +.B SA_SIGINFO +flag, then the following fields are set in the +.I siginfo_t +structure that is passed as the second argument of the handler: +.I si_code +is set to +.BR SI_MESGQ ; +.I si_signo +is set to the signal number; +.I si_value +is set to the value specified in +.IR notification\->sigev_value ; +.\" I don't know of other implementations that set +.\" si_pid and si_uid -- MTK +.I si_pid +is set to the PID of the process that sent the message; and +.I si_uid +is set to the real user ID of the sending process. +The same information is available if the signal is accepted using +.BR sigwaitinfo (2). +.TP +.B SIGEV_THREAD +Deliver notification by invoking +.I notification\->sigev_notify_function +as the start function of a new thread. +The function is invoked with +.I notification\->sigev_value +as its sole argument. +If +.I notification\->sigev_notify_attributes +is not NULL, then it should point to a +.I pthread_attr_t +structure that defines attributes for the thread (see +.BR pthread_attr_init (3)). +.PP +Only one process can be registered to receive notification +from a message queue. + +If +.I notification +is NULL, and the calling process is currently registered to receive +notifications for this message queue, then the registration is removed; +another process can then register to receive a message notification +for this queue. + +Message notification only occurs when a new message arrives and +the queue was previously empty. +If the queue was not empty at the time +.BR mq_notify () +was called, then a notification will only occur after +the queue is emptied and a new message arrives. + +If another process or thread is waiting to read a message +from an empty queue using +.BR mq_receive (3), +then any message notification registration is ignored: +the message is delivered to the process or thread calling +.BR mq_receive (3), +and the message notification registration remains in effect. + +Notification occurs once: after a notification is delivered, +the notification registration is removed, +and another process can register for message notification. +If the notified process wishes to receive the next notification, +it can use +.BR mq_notify () +to request a further notification. +This should be done before emptying all unread messages from the queue. +(Placing the queue in nonblocking mode is useful for emptying +the queue of messages without blocking once it is empty.) +.SH RETURN VALUE +On success +.BR mq_notify () +returns 0; on error, \-1 is returned, with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EBADF +The descriptor specified in +.I mqdes +is invalid. +.TP +.B EBUSY +Another process has already registered to receive notification +for this message queue. +.TP +.B EINVAL +.I notification\->sigev_notify +is not one of the permitted values; or +.I notification\->sigev_notify +is +.B SIGEV_SIGNAL +and +.I notification\->sigev_signo +is not a valid signal number. +.TP +.B ENOMEM +Insufficient memory. +.PP +POSIX.1-2008 says that an implementation +.I may +generate an +.B EINVAL +.\" Linux does not do this +error if +.I notification +is NULL, and the caller is not currently registered to receive +notifications for the queue +.IR mqdes . +.SH CONFORMING TO +POSIX.1-2001. +.SH EXAMPLE +The following program registers a notification request for the +message queue named in its command-line argument. +Notification is performed by creating a thread. +The thread executes a function which reads one message from the +queue and then terminates the process. +.nf + +#include +#include +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +static void /* Thread start function */ +tfunc(union sigval sv) +{ + struct mq_attr attr; + ssize_t nr; + void *buf; + mqd_t mqdes = *((mqd_t *) sv.sival_ptr); + + /* Determine max. msg size; allocate buffer to receive msg */ + + if (mq_getattr(mqdes, &attr) == \-1) + handle_error("mq_getattr"); + buf = malloc(attr.mq_msgsize); + if (buf == NULL) + handle_error("malloc"); + + nr = mq_receive(mqdes, buf, attr.mq_msgsize, NULL); + if (nr == \-1) + handle_error("mq_receive"); + + printf("Read %ld bytes from MQ\\n", (long) nr); + free(buf); + exit(EXIT_SUCCESS); /* Terminate the process */ +} + +int +main(int argc, char *argv[]) +{ + mqd_t mqdes; + struct sigevent not; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + mqdes = mq_open(argv[1], O_RDONLY); + if (mqdes == (mqd_t) \-1) + handle_error("mq_open"); + + not.sigev_notify = SIGEV_THREAD; + not.sigev_notify_function = tfunc; + not.sigev_notify_attributes = NULL; + not.sigev_value.sival_ptr = &mqdes; /* Arg. to thread func. */ + if (mq_notify(mqdes, ¬) == \-1) + handle_error("mq_notify"); + + pause(); /* Process will be terminated by thread function */ +} +.fi +.SH "SEE ALSO" +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR mq_overview (7) diff --git a/original/man3/mq_open.3 b/original/man3/mq_open.3 new file mode 100644 index 00000000..514e9c64 --- /dev/null +++ b/original/man3/mq_open.3 @@ -0,0 +1,237 @@ +'\" 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. +.\" +.TH MQ_OPEN 3 2009-02-20 "Linux" "Linux Programmer's Manual" +.SH NAME +mq_open \- open a message queue +.SH SYNOPSIS +.nf +.BR "#include " " /* For O_* constants */" +.BR "#include " " /* For mode constants */" +.B #include +.sp +.BI "mqd_t mq_open(const char *" name ", int " oflag ); +.BI "mqd_t mq_open(const char *" name ", int " oflag ", mode_t " mode , +.BI " struct mq_attr *" attr ); +.fi +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +.BR mq_open () +creates a new POSIX message queue or opens an existing queue. +The queue is identified by +.IR name . +For details of the construction of +.IR name , +see +.BR mq_overview (7). + +The +.I oflag +argument specifies flags that control the operation of the call. +(Definitions of the flags values can be obtained by including +.IR .) +Exactly one of the following must be specified in +.IR oflag : +.TP +.B O_RDONLY +Open the queue to receive messages only. +.TP +.B O_WRONLY +Open the queue to send messages only. +.TP +.B O_RDWR +Open the queue to both send and receive messages. +.PP +Zero or more of the following flags can additionally be +.IR OR ed +in +.IR oflag : +.TP +.B O_NONBLOCK +Open the queue in nonblocking mode. +In circumstances where +.BR mq_receive (3) +and +.BR mq_send (3) +would normally block, these functions instead fail with the error +.BR EAGAIN . +.TP +.B O_CREAT +Create the message queue if it does not exist. +The owner (user ID) of the message queue is set to the effective +user ID of the calling process. +The group ownership (group ID) is set to the effective group ID +of the calling process. +.\" In reality the file system IDs are used on Linux. +.TP +.B O_EXCL +If +.B O_CREAT +was specified in +.IR oflag , +and a queue with the given +.I name +already exists, then fail with the error +.BR EEXIST . +.PP +If +.B O_CREAT +is specified in +.IR oflag , +then two additional arguments must be supplied. +The +.I mode +argument specifies the permissions to be placed on the new queue, +as for +.BR open (2). +(Symbolic definitions for the permissions bits can be obtained by including +.IR .) +The permissions settings are masked against the process umask. +The +.I attr +argument specifies attributes for the queue. +See +.BR mq_getattr (3) +for details. +If +.I attr +is NULL, then the queue is created with implementation-defined +default attributes. +.SH RETURN VALUE +On success, +.BR mq_open () +returns a message queue descriptor for use by other +message queue functions. +On error, +.BR mq_open () +returns +.IR "(mqd_t)\ \-1", +with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EACCES +The queue exists, but the caller does not have permission to +open it in the specified mode. +.TP +.B EACCES +.I name +contained more than one slash. +.\" Note that this isn't consistent with the same case for sem_open() +.TP +.B EEXIST +Both +.B O_CREAT +and +.B O_EXCL +were specified in +.IR oflag , +but a queue with this +.I name +already exists. +.TP +.B EINVAL +.B O_CREAT +was specified in +.IR oflag , +and +.I attr +was not NULL, but +.I attr\->mq_maxmsg +or +.I attr\->mq_msqsize +was invalid. +Both of these fields must be greater than zero. +In a process that is unprivileged (does not have the +.B CAP_SYS_RESOURCE +capability), +.I attr\->mq_maxmsg +must be less than or equal to the +.I msg_max +limit, and +.I attr\->mq_msgsize +must be less than or equal to the +.I msgsize_max +limit. +In addition, even in a privileged process, +.I attr\->mq_maxmsg +cannot exceed the +.B HARD_MAX +limit. +(See +.BR mq_overview (7) +for details of these limits.) +.TP +.B EMFILE +The process already has the maximum number of files and +message queues open. +.TP +.B ENAMETOOLONG +.I name +was too long. +.TP +.B ENFILE +The system limit on the total number of open files and message queues +has been reached. +.TP +.B ENOENT +The +.B O_CREAT +flag was not specified in +.IR oflag , +and no queue with this +.I name +exists. +.TP +.B ENOENT +.I name +was just "/" followed by no other characters. +.\" Note that this isn't consistent with the same case for sem_open() +.TP +.B ENOMEM +Insufficient memory. +.TP +.B ENOSPC +Insufficient space for the creation of a new message queue. +This probably occurred because the +.I queues_max +limit was encountered; see +.BR mq_overview (7). +.SH CONFORMING TO +POSIX.1-2001. +.SH BUGS +In kernels before 2.6.14, +the process umask was not applied to the permissions specified in +.IR mode . +.SH "SEE ALSO" +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR mq_overview (7) diff --git a/original/man3/mq_receive.3 b/original/man3/mq_receive.3 new file mode 100644 index 00000000..04ecd640 --- /dev/null +++ b/original/man3/mq_receive.3 @@ -0,0 +1,162 @@ +'\" 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. +.\" +.TH MQ_RECEIVE 3 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +mq_receive, mq_timedreceive \- receive a message from a message queue +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "ssize_t mq_receive(mqd_t " mqdes ", char *" msg_ptr , +.BI " size_t " msg_len ", unsigned *" msg_prio ); +.sp +.B #define _XOPEN_SOURCE 600 +.B #include +.B #include +.sp +.BI "ssize_t mq_timedreceive(mqd_t " mqdes ", char *" msg_ptr , +.BI " size_t " msg_len ", unsigned *" msg_prio , +.BI " const struct timespec *" abs_timeout ); +.fi +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +.BR mq_receive () +removes the oldest message with the highest priority from +the message queue referred to by the descriptor +.IR mqdes , +and places it in the buffer pointed to by +.IR msg_ptr . +The +.I msg_len +argument specifies the size of the buffer pointed to by +.IR msg_ptr ; +this must be greater than the +.I mq_msgsize +attribute of the queue (see +.BR mq_getattr (3)). +If +.I prio +is not NULL, then the buffer to which it points is used +to return the priority associated with the received message. + +If the queue is empty, then, by default, +.BR mq_receive () +blocks until a message becomes available, +or the call is interrupted by a signal handler. +If the +.B O_NONBLOCK +flag is enabled for the message queue description, +then the call instead fails immediately with the error +.BR EAGAIN . + +.BR mq_timedreceive () +behaves just like +.BR mq_receive (), +except that if the queue is empty and the +.B O_NONBLOCK +flag is not enabled for the message queue description, then +.I abs_timeout +points to a structure which specifies a ceiling on the time for which +the call will block. +This ceiling is an absolute timeout in seconds and nanoseconds +since the Epoch, 1970-01-01 00:00:00 +0000 (UTC), and it is +specified in the following structure: +.sp +.in +4n +.nf +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; + +.fi +.in +If no message is available, +and the timeout has already expired by the time of the call, +.BR mq_timedreceive () +returns immediately. +.SH RETURN VALUE +On success, +.BR mq_receive () +and +.BR mq_timedreceive () +return the number of bytes in the received message; +on error, \-1 is returned, with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EAGAIN +The queue was empty, and the +.B O_NONBLOCK +flag was set for the message queue description referred to by +.IR mqdes . +.TP +.B EBADF +The descriptor specified in +.I mqdes +was invalid. +.TP +.B EINTR +The call was interrupted by a signal handler; see +.BR signal (7). +.TP +.B EINVAL +The call would have blocked, and +.I abs_timeout +was invalid, either because +.I tv_sec +was less than zero, or because +.I tv_nsec +was less than zero or greater than 1000 million. +.TP +.B EMSGSIZE +.I msg_len +was less than the +.I mq_msgsize +attribute of the message queue. +.TP +.B ETIMEDOUT +The call timed out before a message could be transferred. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +On Linux, +.BR mq_timedreceive () +is a system call, and +.BR mq_receive () +is a library function layered on top of that system call. +.SH "SEE ALSO" +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR feature_test_macros (7), +.BR mq_overview (7), +.BR time (7) diff --git a/original/man3/mq_send.3 b/original/man3/mq_send.3 new file mode 100644 index 00000000..276f05e5 --- /dev/null +++ b/original/man3/mq_send.3 @@ -0,0 +1,167 @@ +'\" 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. +.\" +.TH MQ_SEND 3 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +mq_send, mq_timedsend \- send a message to a message queue +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "mqd_t mq_send(mqd_t " mqdes ", const char *" msg_ptr , +.BI " size_t " msg_len ", unsigned " msg_prio ); +.sp +.B #define _XOPEN_SOURCE 600 +.B #include +.B #include +.sp +.BI "mqd_t mq_timedsend(mqd_t " mqdes ", const char *" msg_ptr , +.BI " size_t " msg_len ", unsigned " msg_prio , +.BI " const struct timespec *" abs_timeout ); +.fi +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +.BR mq_send () +adds the message pointed to by +.I msg_ptr +to the message queue referred to by the descriptor +.IR mqdes . +The +.I msg_len +argument specifies the length of the message pointed to by +.IR msg_ptr ; +this length must be less than or equal to the queue's +.I mq_msgsize +attribute. +Zero-length messages are allowed. + +The +.I msg_prio +argument is a nonnegative integer that specifies the priority +of this message. +Messages are placed on the queue in decreasing order of priority, +with newer messages of the same priority being placed after +older messages with the same priority. + +If the message queue is already full +(i.e., the number of messages on the queue equals the queue's +.I mq_maxmsg +attribute), then, by default, +.BR mq_send () +blocks until sufficient space becomes available to allow the message +to be queued, or until the call is interrupted by a signal handler. +If the +.B O_NONBLOCK +flag is enabled for the message queue description, +then the call instead fails immediately with the error +.BR EAGAIN . + +.BR mq_timedsend () +behaves just like +.BR mq_send (), +except that if the queue is full and the +.B O_NONBLOCK +flag is not enabled for the message queue description, then +.I abs_timeout +points to a structure which specifies a ceiling on the time for which +the call will block. +This ceiling is an absolute timeout in seconds and nanoseconds +since the Epoch, 1970-01-01 00:00:00 +0000 (UTC), and it is +specified in the following structure: +.sp +.in +4n +.nf +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; + +.fi +.in +If the message queue is full, +and the timeout has already expired by the time of the call, +.BR mq_timedsend () +returns immediately. +.SH RETURN VALUE +On success, +.BR mq_send () +and +.BR mq_timedsend () +return zero; on error, \-1 is returned, with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EAGAIN +The queue was empty, and the +.B O_NONBLOCK +flag was set for the message queue description referred to by +.IR mqdes . +.TP +.B EBADF +The descriptor specified in +.I mqdes +was invalid. +.TP +.B EINTR +The call was interrupted by a signal handler; see +.BR signal (7). +.TP +.B EINVAL +The call would have blocked, and +.I abs_timeout +was invalid, either because +.I tv_sec +was less than zero, or because +.I tv_nsec +was less than zero or greater than 1000 million. +.TP +.B EMSGSIZE +.I msg_len +was greater than the +.I mq_msgsize +attribute of the message queue. +.TP +.B ETIMEDOUT +The call timed out before a message could be transferred. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +On Linux, +.BR mq_timedsend () +is a system call, and +.BR mq_send () +is a library function layered on top of that system call. +.SH "SEE ALSO" +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_unlink (3), +.BR feature_test_macros (7), +.BR mq_overview (7), +.BR time (7) diff --git a/original/man3/mq_setattr.3 b/original/man3/mq_setattr.3 new file mode 100644 index 00000000..a3818a20 --- /dev/null +++ b/original/man3/mq_setattr.3 @@ -0,0 +1 @@ +.so man3/mq_getattr.3 diff --git a/original/man3/mq_timedreceive.3 b/original/man3/mq_timedreceive.3 new file mode 100644 index 00000000..9fed5f29 --- /dev/null +++ b/original/man3/mq_timedreceive.3 @@ -0,0 +1 @@ +.so man3/mq_receive.3 diff --git a/original/man3/mq_timedsend.3 b/original/man3/mq_timedsend.3 new file mode 100644 index 00000000..28b1eff0 --- /dev/null +++ b/original/man3/mq_timedsend.3 @@ -0,0 +1 @@ +.so man3/mq_send.3 diff --git a/original/man3/mq_unlink.3 b/original/man3/mq_unlink.3 new file mode 100644 index 00000000..174c4bdc --- /dev/null +++ b/original/man3/mq_unlink.3 @@ -0,0 +1,71 @@ +'\" 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. +.\" +.TH MQ_UNLINK 3 2006-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +mq_unlink \- remove a message queue +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "mqd_t mq_unlink(const char *" name ); +.fi +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +.BR mq_unlink () +removes the specified message queue +.IR name . +The message queue name is removed immediately. +The queue itself is destroyed once any other processes that have +the queue open close their descriptors referring to the queue. +.SH RETURN VALUE +On success +.BR mq_unlink () +returns 0; on error, \-1 is returned, with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EACCES +The caller does not have permission to unlink this message queue. +.TP +.B ENAMETOOLONG +.I name +was too long. +.TP +.B ENOENT +There is no message queue with the given +.IR name . +.SH CONFORMING TO +POSIX.1-2001. +.SH "SEE ALSO" +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_overview (7) diff --git a/original/man3/mrand48.3 b/original/man3/mrand48.3 new file mode 100644 index 00000000..3133f7d6 --- /dev/null +++ b/original/man3/mrand48.3 @@ -0,0 +1 @@ +.so man3/drand48.3 diff --git a/original/man3/mrand48_r.3 b/original/man3/mrand48_r.3 new file mode 100644 index 00000000..81e9d8ef --- /dev/null +++ b/original/man3/mrand48_r.3 @@ -0,0 +1 @@ +.so man3/drand48_r.3 diff --git a/original/man3/mtrace.3 b/original/man3/mtrace.3 new file mode 100644 index 00000000..dc84732a --- /dev/null +++ b/original/man3/mtrace.3 @@ -0,0 +1,43 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" the glibc-info pages are very helpful here +.TH MTRACE 3 2002-07-20 "GNU" "Linux Programmer's Manual" +.SH NAME +mtrace, muntrace \- malloc debugging +.SH SYNOPSIS +.B "#include " +.sp +.B "void mtrace(void);" +.sp +.B "void muntrace(void);" +.SH DESCRIPTION +The function +.BR mtrace () +installs handlers for +.BR malloc (3), +.BR realloc (3) +and +.BR free (3). +The function +.BR muntrace () +disables these handlers. +.br +The environment variable +.B MALLOC_TRACE +defines a file where +.BR mtrace () +writes its output. +This file must be writable to the user or +.BR mtrace () +will do nothing. +If the file is not empty it will be truncated. +.SH "CONFORMING TO" +These are GNU extensions. +.SH NOTES +The output of +.BR mtrace () +will be ASCII but not in a friendly format. +So glibc comes with a perl-script called mtrace to make sense of it. +.SH "SEE ALSO" +.BR malloc (3), +.BR malloc_hook (3) diff --git a/original/man3/muntrace.3 b/original/man3/muntrace.3 new file mode 100644 index 00000000..2b03d107 --- /dev/null +++ b/original/man3/muntrace.3 @@ -0,0 +1 @@ +.so man3/mtrace.3 diff --git a/original/man3/nan.3 b/original/man3/nan.3 new file mode 100644 index 00000000..9c36110f --- /dev/null +++ b/original/man3/nan.3 @@ -0,0 +1,70 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" Based on glibc infopages +.\" +.\" Corrections by aeb +.TH NAN 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH NAME +nan, nanf, nanl \- return 'Not a Number' +.SH SYNOPSIS +.B #include +.sp +.BI "double nan(const char *" tagp ); +.br +.BI "float nanf(const char *" tagp ); +.br +.BI "long double nanl(const char *" tagp ); +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR nan (), +.BR nanf (), +.BR nanl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.SH DESCRIPTION +These functions return a representation (determined by +.IR tagp ) +of a quiet NaN. +If the implementation does not support +quiet NaNs, these functions return zero. +.LP +The call +.I nan("char-sequence") +is equivalent to: +.nf + + strtod("NAN(char-sequence)", NULL); +.fi +.PP +Similarly, calls to +.BR nanf () +and +.BR nanl () +are equivalent to analogous calls to +.BR strtof (3) +and +.BR strtold (3). +.PP +The argument +.I tagp +is used in an unspecified manner. +On IEEE 754 systems, there are many representations of NaN, and +.I tagp +selects one. +On other systems it may do nothing. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +See also IEC 559 and the appendix with +recommended functions in IEEE 754/IEEE 854. +.SH "SEE ALSO" +.BR isnan (3), +.BR strtod (3), +.BR math_error (7) diff --git a/original/man3/nanf.3 b/original/man3/nanf.3 new file mode 100644 index 00000000..08e9aa7c --- /dev/null +++ b/original/man3/nanf.3 @@ -0,0 +1 @@ +.so man3/nan.3 diff --git a/original/man3/nanl.3 b/original/man3/nanl.3 new file mode 100644 index 00000000..08e9aa7c --- /dev/null +++ b/original/man3/nanl.3 @@ -0,0 +1 @@ +.so man3/nan.3 diff --git a/original/man3/nearbyint.3 b/original/man3/nearbyint.3 new file mode 100644 index 00000000..3300c2c4 --- /dev/null +++ b/original/man3/nearbyint.3 @@ -0,0 +1 @@ +.so man3/rint.3 diff --git a/original/man3/nearbyintf.3 b/original/man3/nearbyintf.3 new file mode 100644 index 00000000..3300c2c4 --- /dev/null +++ b/original/man3/nearbyintf.3 @@ -0,0 +1 @@ +.so man3/rint.3 diff --git a/original/man3/nearbyintl.3 b/original/man3/nearbyintl.3 new file mode 100644 index 00000000..3300c2c4 --- /dev/null +++ b/original/man3/nearbyintl.3 @@ -0,0 +1 @@ +.so man3/rint.3 diff --git a/original/man3/netlink.3 b/original/man3/netlink.3 new file mode 100644 index 00000000..37ff6b95 --- /dev/null +++ b/original/man3/netlink.3 @@ -0,0 +1,90 @@ +.\" This manpage copyright 1998 by Andi Kleen. Subject to the GPL. +.\" Based on the original comments from Alexey Kuznetsov +.\" $Id: netlink.3,v 1.1 1999/05/14 17:17:24 freitag Exp $ +.TH NETLINK 3 1999-05-14 "GNU" "Linux Programmer's Manual" +.SH NAME +netlink \- Netlink macros +.SH SYNOPSIS +.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 +.br +.B #include +.sp +.BI "int NLMSG_ALIGN(size_t " len ); +.br +.BI "int NLMSG_LENGTH(size_t " len ); +.br +.BI "int NLMSG_SPACE(size_t " len ); +.br +.BI "void *NLMSG_DATA(struct nlmsghdr *" nlh ); +.br +.BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len ); +.br +.BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len ); +.br +.BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len ); +.fi +.SH DESCRIPTION +.I +defines several standard macros to access or create a netlink datagram. +They are similar in spirit to the macros defined in +.BR cmsg (3) +for auxiliary data. +The buffer passed to and from a netlink socket should +only be accessed using these macros. +.TP +.BR NLMSG_ALIGN () +Round the length of a netlink message up to align it properly. +.TP +.BR NLMSG_LENGTH () +Given the payload length, +.IR len , +this macro returns the aligned length to store in the +.I nlmsg_len +field of the +.IR nlmsghdr . +.TP +.BR NLMSG_SPACE () +Return the number of bytes that a netlink message with payload of +.I len +would occupy. +.TP +.BR NLMSG_DATA () +Return a pointer to the payload associated with the passed +.IR nlmsghdr . +.TP +.\" this is bizarre, maybe the interface should be fixed. +.BR NLMSG_NEXT () +Get the next +.I nlmsghdr +in a multipart message. +The caller must check if the current +.I nlmsghdr +didn't have the +.B NLMSG_DONE +set \(em this function doesn't return NULL on end. +The +.I len +argument is an lvalue containing the remaining length +of the message buffer. +This macro decrements it by the length of the message header. +.TP +.BR NLMSG_OK () +Return true if the netlink message is not truncated and ok to parse. +.TP +.BR NLMSG_PAYLOAD () +Return the length of the payload associated with the +.IR nlmsghdr . +.SH CONFORMING TO +These macros are nonstandard Linux extensions. +.SH NOTES +It is often better to use netlink via +.I libnetlink +than via the low-level kernel interface. +.SH "SEE ALSO" +.BR netlink (7) +.br +and ftp://ftp.inr.ac.ru/ip-routing/iproute2* for libnetlink diff --git a/original/man3/nextafter.3 b/original/man3/nextafter.3 new file mode 100644 index 00000000..37e4e0a4 --- /dev/null +++ b/original/man3/nextafter.3 @@ -0,0 +1,156 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" Distributed under GPL +.\" Based on glibc infopages +.TH NEXTAFTER 3 2009-12-05 "GNU" "Linux Programmer's Manual" +.SH NAME +nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \- +floating-point number manipulation +.SH SYNOPSIS +.B #include +.sp +.BI "double nextafter(double " x ", double " y ); +.br +.BI "float nextafterf(float " x ", float " y ); +.br +.BI "long double nextafterl(long double " x ", long double " y ); +.sp +.BI "double nexttoward(double " x ", long double " y ); +.br +.BI "float nexttowardf(float " x ", long double " y ); +.br +.BI "long double nexttowardl(long double " x ", long double " y ); +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR nextafter (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR nextafterf (), +.BR nextafterl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR nexttoward (), +.BR nexttowardf (), +.BR nexttowardl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR nextafter () +functions return the next representable floating-point value following +.I x +in the direction of +.IR y . +If +.I y +is less than +.IR x , +these functions will return the largest representable number less than +.IR x . + +If \fIx\fP equals \fIy\fP, the functions return \fIy\fP. + +The +.BR nexttoward () +functions do the same as the +.BR nextafter () +functions, except that they have a +.I "long double" +second argument. +.SH RETURN VALUE +On success, +these functions return the next representable floating-point value after +.I x +in the direction of +.IR y . + +If +.I x +equals +.IR y , +then +.I y +(cast to the same type as +.IR x ) +is returned. + +If +.I x +or +.I y +is a NaN, +a NaN is returned. + +If +.I x +is finite, +.\" e.g., DBL_MAX +and the result would overflow, +a range error occurs, +and the functions return +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +respectively, with the correct mathematical sign. + +If +.I x +is not equal to +.IR y , +and the correct function result would be subnormal, zero, or underflow, +a range error occurs, +and either the correct value (if it can be represented), +or 0.0, is returned. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Range error: result overflow +.\" e.g., nextafter(DBL_MAX, HUGE_VAL); +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.TP +Range error: result is subnormal or underflows +.\" e.g., nextafter(DBL_MIN, 0.0); +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An underflow floating-point exception +.RB ( FE_UNDERFLOW ) +is raised. +.PP +These functions do not set +.IR errno . +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6799 +.SH "CONFORMING TO" +C99, POSIX.1-2001. +This function is defined in IEC 559 (and the appendix with +recommended functions in IEEE 754/IEEE 854). +.SH BUGS +In glibc version 2.5 and earlier, these functions do not raise an underflow +floating-point +.RB ( FE_UNDERFLOW ) +exception when an underflow occurs. +.SH "SEE ALSO" +.BR nearbyint (3) diff --git a/original/man3/nextafterf.3 b/original/man3/nextafterf.3 new file mode 100644 index 00000000..531e48f4 --- /dev/null +++ b/original/man3/nextafterf.3 @@ -0,0 +1 @@ +.so man3/nextafter.3 diff --git a/original/man3/nextafterl.3 b/original/man3/nextafterl.3 new file mode 100644 index 00000000..531e48f4 --- /dev/null +++ b/original/man3/nextafterl.3 @@ -0,0 +1 @@ +.so man3/nextafter.3 diff --git a/original/man3/nexttoward.3 b/original/man3/nexttoward.3 new file mode 100644 index 00000000..531e48f4 --- /dev/null +++ b/original/man3/nexttoward.3 @@ -0,0 +1 @@ +.so man3/nextafter.3 diff --git a/original/man3/nexttowardf.3 b/original/man3/nexttowardf.3 new file mode 100644 index 00000000..531e48f4 --- /dev/null +++ b/original/man3/nexttowardf.3 @@ -0,0 +1 @@ +.so man3/nextafter.3 diff --git a/original/man3/nexttowardl.3 b/original/man3/nexttowardl.3 new file mode 100644 index 00000000..531e48f4 --- /dev/null +++ b/original/man3/nexttowardl.3 @@ -0,0 +1 @@ +.so man3/nextafter.3 diff --git a/original/man3/nftw.3 b/original/man3/nftw.3 new file mode 100644 index 00000000..1a5c9c92 --- /dev/null +++ b/original/man3/nftw.3 @@ -0,0 +1 @@ +.so man3/ftw.3 diff --git a/original/man3/nl_langinfo.3 b/original/man3/nl_langinfo.3 new file mode 100644 index 00000000..a0317b36 --- /dev/null +++ b/original/man3/nl_langinfo.3 @@ -0,0 +1,121 @@ +.\" Copyright (c) 2001 Markus Kuhn +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 manual +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" Corrected prototype, 2002-10-18, aeb +.\" +.TH NL_LANGINFO 3 2001-05-11 "GNU" "Linux Programmer's Manual" +.SH NAME +nl_langinfo \- query language and locale information +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *nl_langinfo(nl_item " item ); +.fi +.SH DESCRIPTION +The +.BR nl_langinfo () +function provides access to locale information +in a more flexible way than +.BR localeconv (3) +does. +Individual and additional elements of the locale categories can +be queried. +.PP +Examples for the locale elements that can be specified in \fIitem\fP +using the constants defined in \fI\fP are: +.TP +.BR CODESET \ (LC_CTYPE) +Return a string with the name of the character encoding used in the +selected locale, such as "UTF-8", "ISO-8859-1", or "ANSI_X3.4-1968" +(better known as US-ASCII). +This is the same string that you get with +"locale charmap". +For a list of character encoding names, +try "locale \-m", cf.\& +.BR locale (1). +.TP +.BR D_T_FMT \ (LC_TIME) +Return a string that can be used as a format string for +.BR strftime (3) +to represent time and date in a locale-specific way. +.TP +.BR D_FMT \ (LC_TIME) +Return a string that can be used as a format string for +.BR strftime (3) +to represent a date in a locale-specific way. +.TP +.BR T_FMT \ (LC_TIME) +Return a string that can be used as a format string for +.BR strftime (3) +to represent a time in a locale-specific way. +.TP +.BR DAY_ "{1\(en7} (LC_TIME)" +Return name of the \fIn\fP-th day of the week. [Warning: this follows +the US convention DAY_1 = Sunday, not the international convention +(ISO 8601) that Monday is the first day of the week.] +.TP +.BR ABDAY_ "{1\(en7} (LC_TIME)" +Return abbreviated name of the \fIn\fP-th day of the week. +.TP +.BR MON_ "{1\(en12} (LC_TIME)" +Return name of the \fIn\fP-th month. +.TP +.BR ABMON_ "{1\(en12} (LC_TIME)" +Return abbreviated name of the \fIn\fP-th month. +.TP +.BR RADIXCHAR \ (LC_NUMERIC) +Return radix character (decimal dot, decimal comma, etc.). +.TP +.BR THOUSEP \ (LC_NUMERIC) +Return separator character for thousands (groups of three digits). +.TP +.BR YESEXPR \ (LC_MESSAGES) +Return a regular expression that can be used with the +.BR regex (3) +function to recognize a positive response to a yes/no question. +.TP +.BR NOEXPR \ (LC_MESSAGES) +Return a regular expression that can be used with the +.BR regex (3) +function to recognize a negative response to a yes/no question. +.TP +.BR CRNCYSTR \ (LC_MONETARY) +Return the currency symbol, preceded by "\-" if the symbol should +appear before the value, "+" if the symbol should appear after the +value, or "." if the symbol should replace the radix character. +.PP +The above list covers just some examples of items that can be requested. +For a more detailed list, consult +.IR "The GNU C Library Reference Manual" . +.SH "RETURN VALUE" +If no locale has been selected for the appropriate category, +.BR nl_langinfo () +returns a pointer to the corresponding string in the +"C" locale. +.PP +If \fIitem\fP is not valid, a pointer to an empty string is returned. +.PP +This pointer may point to static data that may be overwritten on the +next call to +.BR nl_langinfo () +or +.BR setlocale (3). +.SH "CONFORMING TO" +SUSv2, POSIX.1-2001. +.SH "SEE ALSO" +.BR locale (1), +.BR localeconv (3), +.BR setlocale (3), +.BR charsets (7), +.BR locale (7) +.br +The GNU C Library Reference Manual diff --git a/original/man3/nrand48.3 b/original/man3/nrand48.3 new file mode 100644 index 00000000..3133f7d6 --- /dev/null +++ b/original/man3/nrand48.3 @@ -0,0 +1 @@ +.so man3/drand48.3 diff --git a/original/man3/nrand48_r.3 b/original/man3/nrand48_r.3 new file mode 100644 index 00000000..81e9d8ef --- /dev/null +++ b/original/man3/nrand48_r.3 @@ -0,0 +1 @@ +.so man3/drand48_r.3 diff --git a/original/man3/ntohl.3 b/original/man3/ntohl.3 new file mode 100644 index 00000000..ba374e84 --- /dev/null +++ b/original/man3/ntohl.3 @@ -0,0 +1 @@ +.so man3/byteorder.3 diff --git a/original/man3/ntohs.3 b/original/man3/ntohs.3 new file mode 100644 index 00000000..ba374e84 --- /dev/null +++ b/original/man3/ntohs.3 @@ -0,0 +1 @@ +.so man3/byteorder.3 diff --git a/original/man3/offsetof.3 b/original/man3/offsetof.3 new file mode 100644 index 00000000..427da8d2 --- /dev/null +++ b/original/man3/offsetof.3 @@ -0,0 +1,100 @@ +.\" Copyright (C) 2006 Justin Pryzby +.\" and Copyright (C) 2006 Michael Kerrisk +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" References: +.\" /usr/lib/gcc/i486-linux-gnu/4.1.1/include/stddef.h +.\" glibc-doc +.TH OFFSETOF 3 2008-07-12 "GNU" "Linux Programmer's Manual" +.SH NAME +offsetof \- offset of a structure member +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t offsetof(" type ", " member ); +.fi +.SH DESCRIPTION +The macro +.BR offsetof () +returns the offset of the field +\fImember\fP from the start of the structure \fItype\fP. + +This macro is useful because the sizes of the fields that compose +a structure can vary across implementations, +and compilers may insert different numbers of padding +bytes between fields. +Consequently, an element's offset is not necessarily +given by the sum of the sizes of the previous elements. + +A compiler error will result if +\fImember\fP is not aligned to a byte boundary +(i.e., it is a bit field). +.SH "RETURN VALUE" +.BR offsetof () +returns the offset of the given +.I member +within the given +.IR type , +in units of bytes. +.SH "CONFORMING TO" +C89, C99, POSIX.1-2001. +.SH EXAMPLE +On a Linux/i386 system, when compiled using the default +.BR gcc (1) +options, the program below produces the following output: +.in +4n +.nf + +.RB "$" " ./a.out" +offsets: i=0; c=4; d=8 a=16 +sizeof(struct s)=16 +.fi +.nf +.SS Program source +\& +.nf +#include +#include +#include + +int +main(void) +{ + struct s { + int i; + char c; + double d; + char a[]; + }; + + /* Output is compiler dependent */ + + printf("offsets: i=%ld; c=%ld; d=%ld a=%ld\\n", + (long) offsetof(struct s, i), + (long) offsetof(struct s, c), + (long) offsetof(struct s, d), + (long) offsetof(struct s, a)); + printf("sizeof(struct s)=%ld\\n", (long) sizeof(struct s)); + + exit(EXIT_SUCCESS); +} +.fi diff --git a/original/man3/on_exit.3 b/original/man3/on_exit.3 new file mode 100644 index 00000000..b7016e78 --- /dev/null +++ b/original/man3/on_exit.3 @@ -0,0 +1,82 @@ +.\" 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-04-02, David Metcalfe +.\" Modified 1993-07-25, Rik Faith (faith@cs.unc.edu) +.TH ON_EXIT 3 2008-12-05 "GNU" "Linux Programmer's Manual" +.SH NAME +on_exit \- register a function to be called at normal process termination +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int on_exit(void (*" function ")(int , void *), void *" arg ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR on_exit (): +_BSD_SOURCE || _SVID_SOURCE +.SH DESCRIPTION +The +.BR on_exit () +function registers the given \fIfunction\fP to be +called at normal process termination, whether via +.BR exit (3) +or via return from the program's \fImain\fP(). +The \fIfunction\fP is passed the status argument given to the last call to +.BR exit (3) +and the \fIarg\fP argument from +.BR on_exit (). + +The same function may be registered multiple times: +it is called once for each registration. + +When a child process is created via +.BR fork (2), +it inherits copies of its parent's registrations. +Upon a successful call to one of the +.BR exec (3) +functions, all registrations are removed. +.SH "RETURN VALUE" +The +.BR on_exit () +function returns the value 0 if successful; otherwise +it returns a nonzero value. +.SH "CONFORMING TO" +This function comes from SunOS 4, but is also present in +libc4, libc5 and glibc. +It no longer occurs in Solaris (SunOS 5). +Avoid this function, and use the standard +.BR atexit (3) +instead. +.SH "SEE ALSO" +.BR _exit (2), +.BR atexit (3), +.BR exit (3) diff --git a/original/man3/open_memstream.3 b/original/man3/open_memstream.3 new file mode 100644 index 00000000..afcad2fa --- /dev/null +++ b/original/man3/open_memstream.3 @@ -0,0 +1 @@ +.so man3/fmemopen.3 diff --git a/original/man3/open_wmemstream.3 b/original/man3/open_wmemstream.3 new file mode 100644 index 00000000..afcad2fa --- /dev/null +++ b/original/man3/open_wmemstream.3 @@ -0,0 +1 @@ +.so man3/fmemopen.3 diff --git a/original/man3/opendir.3 b/original/man3/opendir.3 new file mode 100644 index 00000000..a5c64a3e --- /dev/null +++ b/original/man3/opendir.3 @@ -0,0 +1,127 @@ +.\" Copyright (C) 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 Sat Jul 24 18:46:01 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl) +.\" 2007-07-30 Ulrich Drepper : document fdopendir(). +.TH OPENDIR 3 2008-08-06 "GNU" "Linux Programmer's Manual" +.SH NAME +opendir, fdopendir \- open a directory +.SH SYNOPSIS +.nf +.B #include +.br +.B #include +.sp +.BI "DIR *opendir(const char *" name ); +.BI "DIR *fdopendir(int " fd ); +.fi +.SH DESCRIPTION +The +.BR opendir () +function opens a directory stream corresponding to the +directory \fIname\fP, and returns a pointer to the directory stream. +The stream is positioned at the first entry in the directory. + +The +.BR fdopendir () +function +is like +.BR opendir (), +but returns a directory stream for the directory referred +to by the open file descriptor +.IR fd . +After a successful call to +.BR fdopendir (), +.I fd +is used internally by the implementation, +and should not otherwise be used by the application. +.SH "RETURN VALUE" +The +.BR opendir () +and +.BR fdopendir () +functions return a pointer to the directory stream. +On error, NULL is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EACCES +Permission denied. +.TP +.B EBADF +.I fd +is not a valid file descriptor opened for reading. +.TP +.B EMFILE +Too many file descriptors in use by process. +.TP +.B ENFILE +Too many files are currently open in the system. +.TP +.B ENOENT +Directory does not exist, or \fIname\fP is an empty string. +.TP +.B ENOMEM +Insufficient memory to complete the operation. +.TP +.B ENOTDIR +\fIname\fP is not a directory. +.SH VERSIONS +.BR fdopendir () +is available in glibc since version 2.4. +.SH "CONFORMING TO" +.BR opendir () +is present on SVr4, 4.3BSD, and specified in POSIX.1-2001. +.BR fdopendir () +is specified in POSIX.1-2008. +.SH NOTES +The underlying file descriptor of the directory stream can be obtained using +.BR dirfd (3). + +The +.BR opendir () +function sets the close-on-exec flag for the file descriptor underlying the +.IR "DIR *" . +The +.BR fdopendir () +function leaves the setting of the close-on-exec +flag unchanged for the file descriptor, +.IR fd . +POSIX.1-200x leaves it unspecified whether a successful call to +.BR fdopendir () +will set the close-on-exec flag for the file descriptor, +.IR fd . +.SH "SEE ALSO" +.BR open (2), +.BR closedir (3), +.BR dirfd (3), +.BR readdir (3), +.BR rewinddir (3), +.BR scandir (3), +.BR seekdir (3), +.BR telldir (3) diff --git a/original/man3/openlog.3 b/original/man3/openlog.3 new file mode 100644 index 00000000..ec352b29 --- /dev/null +++ b/original/man3/openlog.3 @@ -0,0 +1 @@ +.so man3/syslog.3 diff --git a/original/man3/openpty.3 b/original/man3/openpty.3 new file mode 100644 index 00000000..e033af07 --- /dev/null +++ b/original/man3/openpty.3 @@ -0,0 +1,172 @@ +.\" Copyright (c) OpenBSD Group +.\" 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. 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. +.\" +.\" Converted into a manpage again by Martin Schulze +.\" +.\" Added -lutil remark, 030718 +.\" +.TH OPENPTY 3 2003-07-18 "GNU" "Linux Programmer's Manual" +.SH NAME +openpty, login_tty, forkpty \- tty utility functions +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int openpty(int *" amaster ", int *" aslave ", char *" name , +.BI " struct termios *" termp ", struct winsize *" winp ); +.sp +.BI "pid_t forkpty(int *" amaster ", char *" name ", struct termios *" termp , +.BI " struct winsize *" winp ); +.sp +.B #include +.sp +.BI "int login_tty(int " fd ); +.sp +Link with \fI\-lutil\fP. +.fi +.SH DESCRIPTION +The +.BR openpty () +function finds an available pseudo-terminal and returns file descriptors +for the master and slave in +.I amaster +and +.IR aslave . +If +.I name +is not NULL, the filename of the slave is returned in +.IR name . +If +.I termp +is not NULL, the terminal parameters of the slave will be set to the +values in +.IR termp . +If +.I winp +is not NULL, the window size of the slave will be set to the values in +.IR winp . + +The +.BR login_tty () +function prepares for a login on the tty +.I fd +(which may be a real tty device, or the slave of a pseudo-terminal as +returned by +.BR openpty ()) +by creating a new session, making +.I fd +the controlling terminal for the calling process, setting +.I fd +to be the standard input, output, and error streams of the current +process, and closing +.IR fd . + +The +.BR forkpty () +function combines +.BR openpty (), +.BR fork (2), +and +.BR login_tty () +to create a new process operating in a pseudo-terminal. +The file +descriptor of the master side of the pseudo-terminal is returned in +.IR amaster , +and the filename of the slave in +.I name +if it is not NULL. +The +.I termp +and +.I winp +arguments, if not NULL, +will determine the terminal attributes and window size of the slave +side of the pseudo-terminal. +.SH "RETURN VALUE" +If a call to +.BR openpty (), +.BR login_tty (), +or +.BR forkpty () +is not successful, \-1 is returned and +.I errno +is set to indicate the error. +Otherwise, +.BR openpty (), +.BR login_tty (), +and the child process of +.BR forkpty () +return 0, and the parent process of +.BR forkpty () +returns the process ID of the child process. +.SH ERRORS +.BR openpty () +will fail if: +.TP +.B ENOENT +There are no available ttys. +.LP +.BR login_tty () +will fail if +.BR ioctl (2) +fails to set +.I fd +to the controlling terminal of the calling process. +.LP +.BR forkpty () +will fail if either +.BR openpty () +or +.BR fork (2) +fails. +.SH "CONFORMING TO" +These are BSD functions, present in libc5 and glibc2. +.SH NOTES +.\" These functions are included in libutil, hence you'll need to add +.\" .B \-lutil +.\" to your compiler command line. +.\" +In versions of glibc before 2.0.92, +.BR openpty () +returns file descriptors for a BSD pseudo-terminal pair; +since glibc 2.0.92, +it first attempts to open a Unix 98 pseudo-terminal pair, +and falls back to opening a BSD pseudo-terminal pair if that fails. +.SH BUGS +Nobody knows how much space should be reserved for +.IR name . +So, calling +.BR openpty () +or +.BR forkpty () +with non-NULL +.I name +may not be secure. +.SH "SEE ALSO" +.BR fork (2), +.BR ttyname (3), +.BR pty (7) diff --git a/original/man3/optarg.3 b/original/man3/optarg.3 new file mode 100644 index 00000000..7612d3f6 --- /dev/null +++ b/original/man3/optarg.3 @@ -0,0 +1 @@ +.so man3/getopt.3 diff --git a/original/man3/opterr.3 b/original/man3/opterr.3 new file mode 100644 index 00000000..7612d3f6 --- /dev/null +++ b/original/man3/opterr.3 @@ -0,0 +1 @@ +.so man3/getopt.3 diff --git a/original/man3/optind.3 b/original/man3/optind.3 new file mode 100644 index 00000000..7612d3f6 --- /dev/null +++ b/original/man3/optind.3 @@ -0,0 +1 @@ +.so man3/getopt.3 diff --git a/original/man3/optopt.3 b/original/man3/optopt.3 new file mode 100644 index 00000000..7612d3f6 --- /dev/null +++ b/original/man3/optopt.3 @@ -0,0 +1 @@ +.so man3/getopt.3 diff --git a/original/man3/passwd2des.3 b/original/man3/passwd2des.3 new file mode 100644 index 00000000..01b6ce65 --- /dev/null +++ b/original/man3/passwd2des.3 @@ -0,0 +1 @@ +.so man3/xcrypt.3 diff --git a/original/man3/pathconf.3 b/original/man3/pathconf.3 new file mode 100644 index 00000000..46d8c8b1 --- /dev/null +++ b/original/man3/pathconf.3 @@ -0,0 +1 @@ +.so man3/fpathconf.3 diff --git a/original/man3/pclose.3 b/original/man3/pclose.3 new file mode 100644 index 00000000..663d4a08 --- /dev/null +++ b/original/man3/pclose.3 @@ -0,0 +1 @@ +.so man3/popen.3 diff --git a/original/man3/perror.3 b/original/man3/perror.3 new file mode 100644 index 00000000..28ddb819 --- /dev/null +++ b/original/man3/perror.3 @@ -0,0 +1,139 @@ +.\" Copyright (c) 1994 Michael Haardt (michael@moria.de), 1994-06-04 +.\" Copyright (c) 1995 Michael Haardt +.\" (michael@cantor.informatik.rwth-aachen.de), 1995-03-16 +.\" Copyright (c) 1996 Andries Brouwer (aeb@cwi.nl), 1996-01-13 +.\" +.\" 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-01-13 aeb: merged in some text contributed by Melvin Smith +.\" (msmith@falcon.mercer.peachnet.edu) and various other changes. +.\" Modified 1996-05-16 by Martin Schulze (joey@infodrom.north.de) +.\" +.TH PERROR 3 2007-07-26 "" "Linux Programmer's Manual" +.SH NAME +perror \- print a system error message +.SH SYNOPSIS +.B #include +.sp +.BI "void perror(const char " *s ); +.sp +.B #include +.sp +.BI "const char *" sys_errlist []; +.br +.BI "int " sys_nerr ; +.br +.BI "int " errno ; +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.IR sys_errlist , +.IR sys_nerr : +_BSD_SOURCE +.SH DESCRIPTION +The routine +.BR perror () +produces a message on the standard error output, describing the last +error encountered during a call to a system or library function. +First (if +.I s +is not NULL and +.I *s +is not a null byte (\(aq\\0\(aq)) the argument string +.I s +is printed, followed by a colon and a blank. +Then the message and a new-line. + +To be of most use, the argument string should include the name +of the function that incurred the error. +The error number is taken from +the external variable +.IR errno , +which is set when errors occur but not +cleared when successful calls are made. + +The global error list +.IR sys_errlist "[]" +indexed by +.I errno +can be used to obtain the error message without the newline. +The largest message number provided in the table is +.IR sys_nerr " \-1." +Be careful when directly accessing this list because new error values +may not have been added to +.IR sys_errlist "[]." + +When a system call fails, it usually returns \-1 and sets the +variable +.I errno +to a value describing what went wrong. +(These values can be found in +.IR .) +Many library functions do likewise. +The function +.BR perror () +serves to translate this error code into human-readable form. +Note that +.I errno +is undefined after a successful library call: +this call may well change this variable, even though it succeeds, +for example because it internally used some other library function that failed. +Thus, if a failing call is not immediately followed by a call to +.BR perror (), +the value of +.I errno +should be saved. +.SH "CONFORMING TO" +The function +.BR perror () +and the external +.I errno +(see +.BR errno (3)) +conform to C89, C99, 4.3BSD, POSIX.1-2001. +The externals +.I sys_nerr +and +.I sys_errlist +conform to BSD. +.SH NOTES +The externals +.I sys_nerr +and +.I sys_errlist +are defined by glibc, but in +.IR . +.\" and only when _BSD_SOURCE is defined. +.\" When +.\" .B _GNU_SOURCE +.\" is defined, the symbols +.\" .I _sys_nerr +.\" and +.\" .I _sys_errlist +.\" are provided. +.SH "SEE ALSO" +.BR err (3), +.BR errno (3), +.BR error (3), +.BR strerror (3) diff --git a/original/man3/pmap_getmaps.3 b/original/man3/pmap_getmaps.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/pmap_getmaps.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/pmap_getport.3 b/original/man3/pmap_getport.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/pmap_getport.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/pmap_rmtcall.3 b/original/man3/pmap_rmtcall.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/pmap_rmtcall.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/pmap_set.3 b/original/man3/pmap_set.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/pmap_set.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/pmap_unset.3 b/original/man3/pmap_unset.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/pmap_unset.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/popen.3 b/original/man3/popen.3 new file mode 100644 index 00000000..bc5ce14c --- /dev/null +++ b/original/man3/popen.3 @@ -0,0 +1,203 @@ +.\" Copyright 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. +.\" +.\" @(#)popen.3 6.4 (Berkeley) 4/30/91 +.\" +.\" Converted for Linux, Mon Nov 29 14:45:38 1993, faith@cs.unc.edu +.\" Modified Sat May 18 20:37:44 1996 by Martin Schulze (joey@linux.de) +.\" Modified 7 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) +.\" +.TH POPEN 3 2010-02-03 "GNU" "Linux Programmer's Manual" +.SH NAME +popen, pclose \- pipe stream to or from a process +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "FILE *popen(const char *" command ", const char *" type ); +.sp +.BI "int pclose(FILE *" stream ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.ad l +.in +.sp +.BR popen (), +.BR pclose (): +_POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE +.ad b +.SH DESCRIPTION +The +.BR popen () +function opens a process by creating a pipe, forking, and invoking the +shell. +Since a pipe is by definition unidirectional, the +.I type +argument may specify only reading or writing, not both; the resulting +stream is correspondingly read-only or write-only. +.PP +The +.I command +argument is a pointer to a null-terminated string containing a shell +command line. +This command is passed to +.I /bin/sh +using the +.B \-c +flag; interpretation, if any, is performed by the shell. +The +.I type +argument is a pointer to a null-terminated string which must contain +either the letter \(aqr\(aq for reading or the letter \(aqw\(aq for writing. +Since glibc 2.9, +this argument can additionally include the letter \(aqe\(aq, +which causes the close-on-exec flag +.RB ( FD_CLOEXEC ) +to be set on the underlying file descriptor; +see the description of the +.B O_CLOEXEC +flag in +.BR open (2) +for reasons why this may be useful. +.PP +The return value from +.BR popen () +is a normal standard I/O stream in all respects save that it must be closed +with +.BR pclose () +rather than +.BR fclose (3). +Writing to such a stream writes to the standard input of the command; the +command's standard output is the same as that of the process that called +.BR popen (), +unless this is altered by the command itself. +Conversely, reading from a +"popened" stream reads the command's standard output, and the command's +standard input is the same as that of the process that called +.BR popen (). +.PP +Note that output +.BR popen () +streams are fully buffered by default. +.PP +The +.BR pclose () +function waits for the associated process to terminate and returns the exit +status of the command as returned by +.BR wait4 (2). +.SH "RETURN VALUE" +The +.BR popen () +function returns NULL if the +.BR fork (2) +or +.BR pipe (2) +calls fail, or if it cannot allocate memory. +.PP +The +.BR pclose () +function returns \-1 if +.\" These conditions actually give undefined results, so I commented +.\" them out. +.\" .I stream +.\" is not associated with a "popen()ed" command, if +.\".I stream +.\" already "pclose()d", or if +.BR wait4 (2) +returns an error, or some other error is detected. +.SH ERRORS +The +.BR popen () +function does not set +.I errno +if memory allocation fails. +If the underlying +.BR fork (2) +or +.BR pipe (2) +fails, +.I errno +is set appropriately. +If the +.I type +argument is invalid, and this condition is detected, +.I errno +is set to +.BR EINVAL . +.PP +If +.BR pclose () +cannot obtain the child status, +.I errno +is set to +.BR ECHILD . +.SH "CONFORMING TO" +POSIX.1-2001. + +The \(aqe\(aq value for +.I type +is a Linux extension. +.SH BUGS +Since the standard input of a command opened for reading shares its seek +offset with the process that called +.BR popen (), +if the original process has done a buffered read, the command's input +position may not be as expected. +Similarly, the output from a command +opened for writing may become intermingled with that of the original +process. +The latter can be avoided by calling +.BR fflush (3) +before +.BR popen (). +.PP +Failure to execute the shell is indistinguishable from the shell's failure +to execute command, or an immediate exit of the command. +The only hint is an exit status of 127. +.\" .SH HISTORY +.\" A +.\" .BR popen () +.\" and a +.\" .BR pclose () +.\" function appeared in Version 7 AT&T UNIX. +.SH "SEE ALSO" +.BR sh (1), +.BR fork (2), +.BR pipe (2), +.BR wait4 (2), +.BR fclose (3), +.BR fflush (3), +.BR fopen (3), +.BR stdio (3), +.BR system (3) diff --git a/original/man3/posix_fallocate.3 b/original/man3/posix_fallocate.3 new file mode 100644 index 00000000..7ce53a38 --- /dev/null +++ b/original/man3/posix_fallocate.3 @@ -0,0 +1,119 @@ +.\" 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. +.\" +.TH POSIX_FALLOCATE 3 2009-09-30 "GNU" "Linux Programmer's Manual" +.SH NAME +posix_fallocate \- allocate file space +.SH SYNOPSIS +.nf +.B #define _XOPEN_SOURCE 600 +.B #include +.sp +.BI "int posix_fallocate(int " fd ", off_t " offset ", off_t " len ); +.fi +.SH DESCRIPTION +The function +.BR posix_fallocate () +ensures that disk space is allocated for the file referred to by the +descriptor +.I fd +for the bytes in the range starting at +.I offset +and continuing for +.I len +bytes. +After a successful call to +.BR posix_fallocate (), +subsequent writes to bytes in the specified range are +guaranteed not to fail because of lack of disk space. + +If the size of the file is less than +.IR offset + len , +then the file is increased to this size; +otherwise the file size is left unchanged. +.SH "RETURN VALUE" +.BR posix_fallocate () +returns zero on success, or an error number on failure. +Note that +.I errno +is not set. +.SH "ERRORS" +.TP +.B EBADF +.I fd +is not a valid file descriptor, or is not opened for writing. +.TP +.B EFBIG +.I offset+len +exceeds the maximum file size. +.TP +.B EINVAL +.I offset +was less than 0, or +.I len +was less than or equal to 0. +.TP +.B ENODEV +.I fd +does not refer to a regular file. +.TP +.B ENOSPC +There is not enough space left on the device containing the file +referred to by +.IR fd . +.TP +.B ESPIPE +.I fd +refers to a pipe of file descriptor. +.SH VERSIONS +.BR posix_fallocate () +is available since glibc 2.1.94. +.SH "CONFORMING TO" +POSIX.1-2001. + +POSIX.1-2008 says that an implementation +.I shall +give the +.B EINVAL +error if +.I len +was 0, or +.I offset +was less than 0. +POSIX.1-2001 says that an implementation +.I shall +give the +.B EINVAL +error if +.I len +is less than 0, or +.I offset +was less than 0, and +.I may +give the error if +.I len +equals zero. +.SH "SEE ALSO" +.BR fallocate (2), +.BR lseek (2), +.BR posix_fadvise (2), +.BR feature_test_macros (7) diff --git a/original/man3/posix_memalign.3 b/original/man3/posix_memalign.3 new file mode 100644 index 00000000..e9e5ee62 --- /dev/null +++ b/original/man3/posix_memalign.3 @@ -0,0 +1,214 @@ +.\" 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 +.TH POSIX_MEMALIGN 3 2009-03-30 "GNU" "Linux Programmer's Manual" +.SH NAME +posix_memalign, memalign, valloc \- Allocate aligned memory +.SH SYNOPSIS +.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 +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR posix_memalign (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH DESCRIPTION +The function +.BR posix_memalign () +allocates +.I size +bytes and places the address of the allocated memory in +.IR "*memptr" . +The address of the allocated memory will be a multiple of +.IR "alignment" , +which must be a power of two and a multiple of +.IR "sizeof(void *)". +If +.I size +is 0, then +.BR posix_memalign () +returns either NULL, +.\" glibc does this: +or a unique pointer value that can later be successfully passed to +.BR free (). + +The obsolete function +.BR memalign () +allocates +.I size +bytes and returns a pointer to the allocated memory. +The memory address will be a multiple of +.IR "boundary" , +which must be a power of two. +.\" The behavior of memalign() for size==0 is as for posix_memalign() +.\" but no standards govern this. + +The obsolete function +.BR valloc () +allocates +.I size +bytes and returns a pointer to the allocated memory. +The memory address will be a multiple of the page size. +It is equivalent to +.IR "memalign(sysconf(_SC_PAGESIZE),size)" . + +For all three routines, the memory is not zeroed. +.SH "RETURN VALUE" +.BR memalign () +and +.BR valloc () +return the pointer to the allocated memory, or NULL if the request fails. + +.BR posix_memalign () +returns zero on success, or one of the error values listed in the +next section on failure. +Note that +.I errno +is not set. +.SH "ERRORS" +.TP +.B EINVAL +The +.I alignment +argument was not a power of two, or was not a multiple of +.IR "sizeof(void *)" . +.TP +.B ENOMEM +There was insufficient memory to fulfill the allocation request. +.SH VERSIONS +The functions +.BR memalign () +and +.BR valloc () +have been available in all Linux libc libraries. +The function +.BR posix_memalign () +is available since glibc 2.1.91. +.SH "CONFORMING TO" +The function +.BR valloc () +appeared in 3.0BSD. +It is documented as being obsolete in 4.3BSD, +and as legacy in SUSv2. +It does not appear in POSIX.1-2001. +The function +.BR memalign () +appears in SunOS 4.1.3 but not in 4.4BSD. +The function +.BR posix_memalign () +comes from POSIX.1d. +.SS Headers +Everybody agrees that +.BR posix_memalign () +is declared in \fI\fP. + +On some systems +.BR memalign () +is declared in \fI\fP instead of \fI\fP. + +According to SUSv2, +.BR valloc () +is declared in \fI\fP. +Libc4,5 and glibc declare it in \fI\fP and perhaps also in +\fI\fP +(namely, if +.B _GNU_SOURCE +is defined, or +.B _BSD_SOURCE +is defined, or, +for glibc, if +.B _XOPEN_SOURCE_EXTENDED +is defined, or, equivalently, +.B _XOPEN_SOURCE +is defined to a value not less than 500). +.SH NOTES +On many systems there are alignment restrictions, for example, on buffers +used for direct block device I/O. +POSIX specifies the +.I "pathconf(path,_PC_REC_XFER_ALIGN)" +call that tells what alignment is needed. +Now one can use +.BR posix_memalign () +to satisfy this requirement. + +.BR posix_memalign () +verifies that +.I alignment +matches the requirements detailed above. +.BR memalign () +may not check that the +.I boundary +argument is correct. + +POSIX requires that memory obtained from +.BR posix_memalign () +can be freed using +.BR free (3). +Some systems provide no way to reclaim memory allocated with +.BR memalign () +or +.BR valloc () +(because one can only pass to +.BR free (3) +a pointer gotten from +.BR malloc (3), +while, for example, +.BR memalign () +would call +.BR malloc (3) +and then align the obtained value). +.\" Other systems allow passing the result of +.\" .IR valloc () +.\" to +.\" .IR free (3), +.\" but not to +.\" .IR realloc (3). +The glibc implementation +allows memory obtained from any of these three routines to be +reclaimed with +.BR free (3). + +The glibc +.BR malloc (3) +always returns 8-byte aligned memory addresses, so these routines are only +needed if you require larger alignment values. +.SH "SEE ALSO" +.BR brk (2), +.BR getpagesize (2), +.BR free (3), +.BR malloc (3) diff --git a/original/man3/posix_openpt.3 b/original/man3/posix_openpt.3 new file mode 100644 index 00000000..862d688d --- /dev/null +++ b/original/man3/posix_openpt.3 @@ -0,0 +1,104 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2004 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. +.\" +.TH POSIX_OPENPT 3 2007-07-26 "" "Linux Programmer's Manual" +.SH NAME +posix_openpt \- open a pseudo-terminal device +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "int posix_openpt(int " flags ");" +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR posix_openpt (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH DESCRIPTION +The +.BR posix_openpt () +function opens an unused pseudo-terminal master device, returning a +file descriptor that can be used to refer to that device. + +The +.I flags +argument is a bit mask that ORs together zero or more of +the following flags: +.TP +.B O_RDWR +Open the device for both reading and writing. +It is usual to specify this flag. +.TP +.B O_NOCTTY +Do not make this device the controlling terminal for the process. +.SH "RETURN VALUE" +On success, +.BR posix_openpt () +returns a nonnegative file descriptor which is the lowest +numbered unused descriptor. +On failure, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +See +.BR open (2). +.SH VERSIONS +Glibc support for +.BR posix_openpt () +has been provided since version 2.2.1. +.SH "CONFORMING TO" +.BR posix_openpt () +is part of the Unix98 pseudo-terminal support (see +.BR pts (4)). +This function is specified in POSIX.1-2001. +.SH NOTES +This function is a recent invention in POSIX. +Some Unix implementations that support System V +(aka Unix 98) pseudo-terminals don't have this function, but it +is easy to implement: +.in +4n +.nf + +int +posix_openpt(int flags) +{ + return open("/dev/ptmx", flags); +} +.fi +.in +.SH "SEE ALSO" +.BR open (2), +.BR getpt (3), +.BR grantpt (3), +.BR ptsname (3), +.BR unlockpt (3), +.BR pts (4), +.BR pty (7) diff --git a/original/man3/pow.3 b/original/man3/pow.3 new file mode 100644 index 00000000..dad07b7b --- /dev/null +++ b/original/man3/pow.3 @@ -0,0 +1,355 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995-08-14 by Arnt Gulbrandsen +.\" Modified 2002-07-27 by Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.TH POW 3 2008-08-10 "" "Linux Programmer's Manual" +.SH NAME +pow, powf, powl \- power functions +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double pow(double " x ", double " y ); +.br +.BI "float powf(float " x ", float " y ); +.br +.BI "long double powl(long double " x ", long double " y ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR powf (), +.BR powl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR pow () +function returns the value of \fIx\fP raised to the +power of \fIy\fP. +.SH RETURN VALUE +On success, these functions return the value of +.I x +to the power of +.IR y . + +If +.I x +is a finite value less than 0, and +.I y +is a finite noninteger, a domain error occurs, +.\" The domain error is generated at least as far back as glibc 2.4 +and a NaN is returned. + +If the result overflows, +a range error occurs, +.\" The range error is generated at least as far back as glibc 2.4 +and the functions return +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +respectively, with the mathematically correct sign. + +If result underflows, and is not representable, +a range error occurs, +and 0.0 is returned. +.\" 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. + +Except as specified below, if +.I x +or +.I y +is a NaN, the result is a NaN. + +If +.I x +is +1, the result is 1.0 (even if +.I y +is a NaN). + +If +.I y +is 0, the result is 1.0 (even if +.I x +is a NaN). + +If +.I x +is +0 (\-0), +and +.I y +is an odd integer greater than 0, +the result is +0 (\-0). + +If +.I x +is 0, +and +.I y +greater than 0 and not an odd integer, +the result is +0. + +If +.I x +is \-1, +and +.I y +is positive infinity or negative infinity, +the result is 1.0. + +If the absolute value of +.I x +is less than 1, +and +.I y +is negative infinity, +the result is positive infinity. + +If the absolute value of +.I x +is greater than 1, +and +.I y +is negative infinity, +the result is +0. + +If the absolute value of +.I x +is less than 1, +and +.I y +is positive infinity, +the result is +0. + +If the absolute value of +.I x +is greater than 1, +and +.I y +is positive infinity, +the result is positive infinity. + +If +.I x +is negative infinity, +and +.I y +is an odd integer less than 0, +the result is \-0. + +If +.I x +is negative infinity, +and +.I y +less than 0 and not an odd integer, +the result is +0. + +If +.I x +is negative infinity, +and +.I y +is an odd integer greater than 0, +the result is negative infinity. + +If +.I x +is negative infinity, +and +.I y +greater than 0 and not an odd integer, +the result is positive infinity. + +If +.I x +is positive infinity, +and +.I y +less than 0, +the result is +0. + +If +.I x +is positive infinity, +and +.I y +greater than 0, +the result is positive infinity. + +If +.I x +is +0 or -0, +and +.I y +is an odd integer less than 0, +a pole error occurs and +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +is returned, +with the same sign as +.IR x . + +If +.I x +is +0 or -0, +and +.I y +is less than 0 and not an odd integer, +a pole error occurs and +.\" The pole error is generated at least as far back as glibc 2.4 +.RB + HUGE_VAL , +.RB + HUGE_VALF , +or +.RB + HUGE_VALL , +is returned. +.SH ERRORS +.\" FIXME . review status of this error +.\" longstanding bug report for glibc: +.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=369 +.\" For negative x, and -large and +large y, glibc 2.8 gives incorrect +.\" results +.\" pow(-0.5,-DBL_MAX)=nan +.\" EDOM FE_INVALID nan; fail-errno fail-except fail-result; +.\" FAIL (expected: range-error-overflow (ERANGE, FE_OVERFLOW); +INF) +.\" +.\" pow(-1.5,-DBL_MAX)=nan +.\" EDOM FE_INVALID nan; fail-errno fail-except fail-result; +.\" FAIL (expected: range-error-underflow (ERANGE, FE_UNDERFLOW); +0) +.\" +.\" pow(-0.5,DBL_MAX)=nan +.\" EDOM FE_INVALID nan; fail-errno fail-except fail-result; +.\" FAIL (expected: range-error-underflow (ERANGE, FE_UNDERFLOW); +0) +.\" +.\" 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) +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is negative, and \fIy\fP is a finite noninteger +.I errno +is set to +.BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.TP +Pole error: \fIx\fP is zero, and \fIy\fP is negative +.I errno +is set to +.BR ERANGE +(but see BUGS). +.\" FIXME . glibc 2.8 gives EDOM +A divide-by-zero floating-point exception +.RB ( FE_DIVBYZERO ) +is raised. +.TP +Range error: the result overflows +.I errno +is set to +.BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.TP +Range error: the result underflows +.I errno +is set to +.BR ERANGE . +An underflow floating-point exception +.RB ( FE_UNDERFLOW ) +is raised. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH BUGS +For a pole error, +.\" +.\" FIXME . this is as at glibc 2.8; check later if this bug is fixed +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776 +.I errno +is set to +.BR EDOM ; +POSIX.1 says it should be set to +.BR ERANGE . + +If +.I x +is negative, +then large negative or positive +.I y +values yield a NaN as the function result, with +.I errno +set to +.BR EDOM , +and an invalid +.RB ( FE_INVALID ) +floating-point exception. +For example, with +.BR pow (), +one sees this behavior when the absolute value of +.I y +is greater than about 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 + +In version 2.3.2 and earlier, +.\" 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. +when an overflow or underflow error occurs, glibc's +.BR pow () +generates a bogus invalid floating-point exception +.RB ( FE_INVALID ) +in addition to the overflow or underflow exception. +.SH "SEE ALSO" +.BR cbrt (3), +.BR cpow (3), +.BR sqrt (3) diff --git a/original/man3/pow10.3 b/original/man3/pow10.3 new file mode 100644 index 00000000..ff632eb9 --- /dev/null +++ b/original/man3/pow10.3 @@ -0,0 +1,54 @@ +.\" Copyright 2004 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. +.\" +.TH POW10 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +pow10, pow10f, pow10l \- base-10 power functions +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "double pow10(double " x ); +.br +.BI "float pow10f(float " x ); +.br +.BI "long double pow10l(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +The +.BR pow10 () +function returns the value of 10 raised to the +power \fIx\fP. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +This is a GNU extension. +.SH NOTES +These functions are identical to the functions listed under +.BR exp10 (3). +.SH "SEE ALSO" +.BR exp10 (3), +.BR pow (3), +.BR feature_test_macros (7) diff --git a/original/man3/pow10f.3 b/original/man3/pow10f.3 new file mode 100644 index 00000000..8a715801 --- /dev/null +++ b/original/man3/pow10f.3 @@ -0,0 +1 @@ +.so man3/pow10.3 diff --git a/original/man3/pow10l.3 b/original/man3/pow10l.3 new file mode 100644 index 00000000..8a715801 --- /dev/null +++ b/original/man3/pow10l.3 @@ -0,0 +1 @@ +.so man3/pow10.3 diff --git a/original/man3/powf.3 b/original/man3/powf.3 new file mode 100644 index 00000000..63da756f --- /dev/null +++ b/original/man3/powf.3 @@ -0,0 +1 @@ +.so man3/pow.3 diff --git a/original/man3/powl.3 b/original/man3/powl.3 new file mode 100644 index 00000000..63da756f --- /dev/null +++ b/original/man3/powl.3 @@ -0,0 +1 @@ +.so man3/pow.3 diff --git a/original/man3/printf.3 b/original/man3/printf.3 new file mode 100644 index 00000000..897bcf13 --- /dev/null +++ b/original/man3/printf.3 @@ -0,0 +1,1071 @@ +.\" Copyright (c) 1999 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. +.\" +.\" +.\" Earlier versions of this page influenced the present text. +.\" It was derived from a Berkeley page with version +.\" @(#)printf.3 6.14 (Berkeley) 7/30/91 +.\" converted for Linux by faith@cs.unc.edu, updated by +.\" Helmut.Geyer@iwr.uni-heidelberg.de, agulbra@troll.no and Bruno Haible. +.\" +.\" 1999-11-25 aeb - Rewritten, using SUSv2 and C99. +.\" 2000-07-26 jsm28@hermes.cam.ac.uk - three small fixes +.\" 2000-10-16 jsm28@hermes.cam.ac.uk - more fixes +.\" +.TH PRINTF 3 2008-12-19 "GNU" "Linux Programmer's Manual" +.SH NAME +printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, +vsnprintf \- formatted output conversion +.SH SYNOPSIS +.B #include +.sp +.BI "int printf(const char *" format ", ...);" +.br +.BI "int fprintf(FILE *" stream ", const char *" format ", ...);" +.br +.BI "int sprintf(char *" str ", const char *" format ", ...);" +.br +.BI "int snprintf(char *" str ", size_t " size ", const char *" format ", ...);" +.sp +.B #include +.sp +.BI "int vprintf(const char *" format ", va_list " ap ); +.br +.BI "int vfprintf(FILE *" stream ", const char *" format ", va_list " ap ); +.br +.BI "int vsprintf(char *" str ", const char *" format ", va_list " ap ); +.br +.BI "int vsnprintf(char *" str ", size_t " size ", const char *" format \ +", va_list " ap ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR snprintf (), +.BR vsnprintf (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I "cc -std=c99" +.ad b +.SH DESCRIPTION +The functions in the +.BR printf () +family produce output according to a +.I format +as described below. +The functions +.BR printf () +and +.BR vprintf () +write output to +.IR stdout , +the standard output stream; +.BR fprintf () +and +.BR vfprintf () +write output to the given output +.IR stream ; +.BR sprintf (), +.BR snprintf (), +.BR vsprintf () +and +.BR vsnprintf () +write to the character string +.IR str . +.PP +The functions +.BR snprintf () +and +.BR vsnprintf () +write at most +.I size +bytes (including the trailing null byte (\(aq\e0\(aq)) to +.IR str . +.PP +The functions +.BR vprintf (), +.BR vfprintf (), +.BR vsprintf (), +.BR vsnprintf () +are equivalent to the functions +.BR printf (), +.BR fprintf (), +.BR sprintf (), +.BR snprintf (), +respectively, except that they are called with a +.I va_list +instead of a variable number of arguments. +These functions do not call the +.I va_end +macro. +Because they invoke the +.I va_arg +macro, the value of +.I ap +is undefined after the call. +See +.BR stdarg (3). +.PP +These eight functions write the output under the control of a +.I format +string that specifies how subsequent arguments (or arguments accessed via +the variable-length argument facilities of +.BR stdarg (3)) +are converted for output. + +C99 and POSIX.1-2001 specify that the results are undefined if a call to +.BR sprintf (), +.BR snprintf (), +.BR vsprintf (), +or +.BR vsnprintf () +would cause copying to take place between objects that overlap +(e.g., if the target string array and one of the supplied input arguments +refer to the same buffer). +See NOTES. +.SS "Return value" +Upon successful return, these functions return the number of characters +printed (not including the +trailing \(aq\e0\(aq used to end output to strings). + +The functions +.BR snprintf () +and +.BR vsnprintf () +do not write more than +.I size +bytes (including the trailing \(aq\e0\(aq). +If the output was truncated due to this limit then the return value +is the number of characters (not including the trailing \(aq\e0\(aq) +which would have been written to the final string if enough space +had been available. +Thus, a return value of +.I size +or more means that the output was truncated. +(See also below under NOTES.) + +If an output error is encountered, a negative value is returned. +.SS "Format of the format string" +The format string is a character string, beginning and ending +in its initial shift state, if any. +The format string is composed of zero or more directives: ordinary +characters (not +.BR % ), +which are copied unchanged to the output stream; +and conversion specifications, each of which results in fetching zero or +more subsequent arguments. +Each conversion specification is introduced by +the character +.BR % , +and ends with a +.IR "conversion specifier" . +In between there may be (in this order) zero or more +.IR flags , +an optional minimum +.IR "field width" , +an optional +.I precision +and an optional +.IR "length modifier" . + +The arguments must correspond properly (after type promotion) with the +conversion specifier. +By default, the arguments are used in the order +given, where each \(aq*\(aq and each conversion specifier asks for the next +argument (and it is an error if insufficiently many arguments are given). +One can also specify explicitly which argument is taken, +at each place where an argument is required, by writing "%m$" instead +of \(aq%\(aq and "*m$" instead of \(aq*\(aq, +where the decimal integer m denotes +the position in the argument list of the desired argument, indexed starting +from 1. +Thus, +.in +4n +.nf + +printf("%*d", width, num); + +.fi +.in +and +.in +4n +.nf + +printf("%2$*1$d", width, num); + +.fi +.in +are equivalent. +The second style allows repeated references to the +same argument. +The C99 standard does not include the style using \(aq$\(aq, +which comes from the Single Unix Specification. +If the style using +\(aq$\(aq is used, it must be used throughout for all conversions taking an +argument and all width and precision arguments, but it may be mixed +with "%%" formats which do not consume an argument. +There may be no +gaps in the numbers of arguments specified using \(aq$\(aq; for example, if +arguments 1 and 3 are specified, argument 2 must also be specified +somewhere in the format string. + +For some numeric conversions a radix character ("decimal point") or +thousands' grouping character is used. +The actual character used +depends on the +.B LC_NUMERIC +part of the locale. +The POSIX locale +uses \(aq.\(aq as radix character, and does not have a grouping character. +Thus, +.in +4n +.nf + + printf("%\(aq.2f", 1234567.89); + +.fi +.in +results in "1234567.89" in the POSIX locale, in "1234567,89" in the +nl_NL locale, and in "1.234.567,89" in the da_DK locale. +.SS "The flag characters" +The character % is followed by zero or more of the following flags: +.TP +.B # +The value should be converted to an "alternate form". +For +.B o +conversions, the first character of the output string is made zero +(by prefixing a 0 if it was not zero already). +For +.B x +and +.B X +conversions, a nonzero result has the string "0x" (or "0X" for +.B X +conversions) prepended to it. +For +.BR a , +.BR A , +.BR e , +.BR E , +.BR f , +.BR F , +.BR g , +and +.B G +conversions, the result will always contain a decimal point, even if no +digits follow it (normally, a decimal point appears in the results of those +conversions only if a digit follows). +For +.B g +and +.B G +conversions, trailing zeros are not removed from the result as they would +otherwise be. +For other conversions, the result is undefined. +.TP +.B \&0 +The value should be zero padded. +For +.BR d , +.BR i , +.BR o , +.BR u , +.BR x , +.BR X , +.BR a , +.BR A , +.BR e , +.BR E , +.BR f , +.BR F , +.BR g , +and +.B G +conversions, the converted value is padded on the left with zeros rather +than blanks. +If the +.B \&0 +and +.B \- +flags both appear, the +.B \&0 +flag is ignored. +If a precision is given with a numeric conversion +.RB ( d , +.BR i , +.BR o , +.BR u , +.BR x , +and +.BR X ), +the +.B \&0 +flag is ignored. +For other conversions, the behavior is undefined. +.TP +.B \- +The converted value is to be left adjusted on the field boundary. +(The default is right justification.) +Except for +.B n +conversions, the converted value is padded on the right with blanks, rather +than on the left with blanks or zeros. +A +.B \- +overrides a +.B \&0 +if both are given. +.TP +.B \(aq \(aq +(a space) A blank should be left before a positive number +(or empty string) produced by a signed conversion. +.TP +.B + +A sign (+ or \-) should always be placed before a number produced by a signed +conversion. +By default a sign is used only for negative numbers. +A +.B + +overrides a space if both are used. +.PP +The five flag characters above are defined in the C standard. +The SUSv2 specifies one further flag character. +.TP +.B \(aq +For decimal conversion +.RB ( i , +.BR d , +.BR u , +.BR f , +.BR F , +.BR g , +.BR G ) +the output is to be grouped with thousands' grouping characters +if the locale information indicates any. +Note that many versions of +.BR gcc (1) +cannot parse this option and will issue a warning. +SUSv2 does not +include \fI%\(aqF\fP. +.PP +glibc 2.2 adds one further flag character. +.TP +.B I +For decimal integer conversion +.RB ( i , +.BR d , +.BR u ) +the output uses the locale's alternative output digits, if any. +For example, since glibc 2.2.3 this will give Arabic-Indic digits +in the Persian ("fa_IR") locale. +.\" outdigits keyword in locale file +.SS "The field width" +An optional decimal digit string (with nonzero first digit) specifying +a minimum field width. +If the converted value has fewer characters +than the field width, it will be padded with spaces on the left +(or right, if the left-adjustment flag has been given). +Instead of a decimal digit string one may write "*" or "*m$" +(for some decimal integer \fIm\fP) to specify that the field width +is given in the next argument, or in the \fIm\fP-th argument, respectively, +which must be of type +.IR int . +A negative field width is taken as a \(aq\-\(aq flag followed by a +positive field width. +In no case does a nonexistent or small field width cause truncation of a +field; if the result of a conversion is wider than the field width, the +field is expanded to contain the conversion result. +.SS "The precision" +An optional precision, in the form of a period (\(aq.\(aq) followed by an +optional decimal digit string. +Instead of a decimal digit string one may write "*" or "*m$" +(for some decimal integer m) to specify that the precision +is given in the next argument, or in the m-th argument, respectively, +which must be of type +.IR int . +If the precision is given as just \(aq.\(aq, or the precision is negative, +the precision is taken to be zero. +This gives the minimum number of digits to appear for +.BR d , +.BR i , +.BR o , +.BR u , +.BR x , +and +.B X +conversions, the number of digits to appear after the radix character for +.BR a , +.BR A , +.BR e , +.BR E , +.BR f , +and +.B F +conversions, the maximum number of significant digits for +.B g +and +.B G +conversions, or the maximum number of characters to be printed from a +string for +.B s +and +.B S +conversions. +.SS "The length modifier" +Here, "integer conversion" stands for +.BR d , +.BR i , +.BR o , +.BR u , +.BR x , +or +.B X +conversion. +.TP +.B hh +A following integer conversion corresponds to a +.I signed char +or +.I unsigned char +argument, or a following +.B n +conversion corresponds to a pointer to a +.I signed char +argument. +.TP +.B h +A following integer conversion corresponds to a +.I short int +or +.I unsigned short int +argument, or a following +.B n +conversion corresponds to a pointer to a +.I short int +argument. +.TP +.B l +(ell) A following integer conversion corresponds to a +.I long int +or +.I unsigned long int +argument, or a following +.B n +conversion corresponds to a pointer to a +.I long int +argument, or a following +.B c +conversion corresponds to a +.I wint_t +argument, or a following +.B s +conversion corresponds to a pointer to +.I wchar_t +argument. +.TP +.B ll +(ell-ell). +A following integer conversion corresponds to a +.I long long int +or +.I unsigned long long int +argument, or a following +.B n +conversion corresponds to a pointer to a +.I long long int +argument. +.TP +.B L +A following +.BR a , +.BR A , +.BR e , +.BR E , +.BR f , +.BR F , +.BR g , +or +.B G +conversion corresponds to a +.I long double +argument. +(C99 allows %LF, but SUSv2 does not.) +.TP +.B q +("quad". 4.4BSD and Linux libc5 only. +Don't use.) +This is a synonym for +.BR ll . +.TP +.B j +A following integer conversion corresponds to an +.I intmax_t +or +.I uintmax_t +argument. +.TP +.B z +A following integer conversion corresponds to a +.I size_t +or +.I ssize_t +argument. +(Linux libc5 has +.B Z +with this meaning. +Don't use it.) +.TP +.B t +A following integer conversion corresponds to a +.I ptrdiff_t +argument. +.PP +The SUSv2 only knows about the length modifiers +.B h +(in +.BR hd , +.BR hi , +.BR ho , +.BR hx , +.BR hX , +.BR hn ) +and +.B l +(in +.BR ld , +.BR li , +.BR lo , +.BR lx , +.BR lX , +.BR ln , +.BR lc , +.BR ls ) +and +.B L +(in +.BR Le , +.BR LE , +.BR Lf , +.BR Lg , +.BR LG ). +.SS "The conversion specifier" +A character that specifies the type of conversion to be applied. +The conversion specifiers and their meanings are: +.TP +.BR d ", " i +The +.I int +argument is converted to signed decimal notation. +The precision, if any, gives the minimum number of digits +that must appear; if the converted value requires fewer digits, it is +padded on the left with zeros. +The default precision is 1. +When 0 is printed with an explicit precision 0, the output is empty. +.TP +.BR o ", " u ", " x ", " X +The +.I "unsigned int" +argument is converted to unsigned octal +.RB ( o ), +unsigned decimal +.RB ( u ), +or unsigned hexadecimal +.RB ( x +and +.BR X ) +notation. +The letters +.B abcdef +are used for +.B x +conversions; the letters +.B ABCDEF +are used for +.B X +conversions. +The precision, if any, gives the minimum number of digits +that must appear; if the converted value requires fewer digits, it is +padded on the left with zeros. +The default precision is 1. +When 0 is printed with an explicit precision 0, the output is empty. +.TP +.BR e ", " E +The +.I double +argument is rounded and converted in the style +.if \w'\*(Pm'=0 .ds Pm \(+- +.RB [\-]d \&. ddd e \\*(Pmdd +where there is one digit before the decimal-point character and the number +of digits after it is equal to the precision; if the precision is missing, +it is taken as 6; if the precision is zero, no decimal-point character +appears. +An +.B E +conversion uses the letter +.B E +(rather than +.BR e ) +to introduce the exponent. +The exponent always contains at least two +digits; if the value is zero, the exponent is 00. +.TP +.BR f ", " F +The +.I double +argument is rounded and converted to decimal notation in the style +.RB [\-]ddd \&. ddd, +where the number of digits after the decimal-point character is equal to +the precision specification. +If the precision is missing, it is taken as +6; if the precision is explicitly zero, no decimal-point character appears. +If a decimal point appears, at least one digit appears before it. + +(The SUSv2 does not know about +.B F +and says that character string representations for infinity and NaN +may be made available. +The C99 standard specifies "[\-]inf" or "[\-]infinity" +for infinity, and a string starting with "nan" for NaN, in the case of +.B f +conversion, and "[\-]INF" or "[\-]INFINITY" or "NAN*" in the case of +.B F +conversion.) +.TP +.BR g ", " G +The +.I double +argument is converted in style +.B f +or +.B e +(or +.B F +or +.B E +for +.B G +conversions). +The precision specifies the number of significant digits. +If the precision is missing, 6 digits are given; if the precision is zero, +it is treated as 1. +Style +.B e +is used if the exponent from its conversion is less than \-4 or greater +than or equal to the precision. +Trailing zeros are removed from the +fractional part of the result; a decimal point appears only if it is +followed by at least one digit. +.TP +.BR a ", " A +(C99; not in SUSv2) For +.B a +conversion, the +.I double +argument is converted to hexadecimal notation (using the letters abcdef) +in the style +.RB [\-] 0x h \&. hhhh p \\*(Pmd; +for +.B A +conversion the prefix +.BR 0X , +the letters ABCDEF, and the exponent separator +.B P +is used. +There is one hexadecimal digit before the decimal point, +and the number of digits after it is equal to the precision. +The default precision suffices for an exact representation of the value +if an exact representation in base 2 exists +and otherwise is sufficiently large to distinguish values of type +.IR double . +The digit before the decimal point is unspecified for nonnormalized +numbers, and nonzero but otherwise unspecified for normalized numbers. +.TP +.B c +If no +.B l +modifier is present, the +.I int +argument is converted to an +.IR "unsigned char" , +and the resulting character is written. +If an +.B l +modifier is present, the +.I wint_t +(wide character) argument is converted to a multibyte sequence by a call +to the +.BR wcrtomb (3) +function, with a conversion state starting in the initial state, and the +resulting multibyte string is written. +.TP +.B s +If no +.B l +modifier is present: The +.I "const char *" +argument is expected to be a pointer to an array of character type (pointer +to a string). +Characters from the array are written up to (but not +including) a terminating null byte (\(aq\\0\(aq); +if a precision is specified, no more than the number specified +are written. +If a precision is given, no null byte need be present; +if the precision is not specified, or is greater than the size of the +array, the array must contain a terminating null byte. + +If an +.B l +modifier is present: The +.I "const wchar_t *" +argument is expected to be a pointer to an array of wide characters. +Wide characters from the array are converted to multibyte characters +(each by a call to the +.BR wcrtomb (3) +function, with a conversion state starting in the initial state before +the first wide character), up to and including a terminating null +wide character. +The resulting multibyte characters are written up to +(but not including) the terminating null byte. +If a precision is +specified, no more bytes than the number specified are written, but +no partial multibyte characters are written. +Note that the precision +determines the number of +.I bytes +written, not the number of +.I wide characters +or +.IR "screen positions" . +The array must contain a terminating null wide character, unless a +precision is given and it is so small that the number of bytes written +exceeds it before the end of the array is reached. +.TP +.B C +(Not in C99, but in SUSv2.) +Synonym for +.BR lc . +Don't use. +.TP +.B S +(Not in C99, but in SUSv2.) +Synonym for +.BR ls . +Don't use. +.TP +.B p +The +.I "void *" +pointer argument is printed in hexadecimal (as if by +.B %#x +or +.BR %#lx ). +.TP +.B n +The number of characters written so far is stored into the integer +indicated by the +.I "int *" +(or variant) pointer argument. +No argument is converted. +.TP +.B m +(Glibc extension.) +Print output of +.IR strerror(errno) . +No argument is required. +.TP +.B % +A \(aq%\(aq is written. +No argument is converted. +The complete conversion +specification is \(aq%%\(aq. +.SH "CONFORMING TO" +The +.BR fprintf (), +.BR printf (), +.BR sprintf (), +.BR vprintf (), +.BR vfprintf (), +and +.BR vsprintf () +functions conform to C89 and C99. +The +.BR snprintf () +and +.BR vsnprintf () +functions conform to C99. +.PP +Concerning the return value of +.BR snprintf (), +SUSv2 and C99 contradict each other: when +.BR snprintf () +is called with +.IR size =0 +then SUSv2 stipulates an unspecified return value less than 1, +while C99 allows +.I str +to be NULL in this case, and gives the return value (as always) +as the number of characters that would have been written in case +the output string has been large enough. +.PP +Linux libc4 knows about the five C standard flags. +It knows about the length modifiers \fBh\fP, \fBl\fP, \fBL\fP, +and the conversions +\fBc\fP, \fBd\fP, \fBe\fP, \fBE\fP, \fBf\fP, \fBF\fP, +\fBg\fP, \fBG\fP, \fBi\fP, \fBn\fP, \fBo\fP, \fBp\fP, +\fBs\fP, \fBu\fP, \fBx\fP, and \fBX\fP, +where \fBF\fP is a synonym for \fBf\fP. +Additionally, it accepts \fBD\fP, \fBO\fP, and \fBU\fP as synonyms +for \fBld\fP, \fBlo\fP, and \fBlu\fP. +(This is bad, and caused serious bugs later, when +support for \fB%D\fP disappeared.) +No locale-dependent radix character, +no thousands' separator, no NaN or infinity, no "%m$" and "*m$". +.PP +Linux libc5 knows about the five C standard flags and the \(aq flag, +locale, "%m$" and "*m$". +It knows about the length modifiers \fBh\fP, \fBl\fP, \fBL\fP, +\fBZ\fP, and \fBq\fP, but accepts \fBL\fP and \fBq\fP +both for \fIlong double\fP and for \fIlong long int\fP (this is a bug). +It no longer recognizes \fBF\fP, \fBD\fP, \fBO\fP, and \fBU\fP, +but adds the conversion character +.BR m , +which outputs +.IR strerror(errno) . +.PP +glibc 2.0 adds conversion characters \fBC\fP and \fBS\fP. +.PP +glibc 2.1 adds length modifiers \fBhh\fP, \fBj\fP, \fBt\fP, and \fBz\fP +and conversion characters \fBa\fP and \fBA\fP. +.PP +glibc 2.2 adds the conversion character \fBF\fP with C99 semantics, +and the flag character \fBI\fP. +.SH NOTES +Some programs imprudently rely on code such as the following + + sprintf(buf, "%s some further text", buf); + +to append text to +.IR buf . +However, the standards explicitly note that the results are undefined +if source and destination buffers overlap when calling +.BR sprintf (), +.BR snprintf (), +.BR vsprintf (), +and +.BR vsnprintf (). +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=7075 +Depending on the version of +.BR gcc (1) +used, and the compiler options employed, calls such as the above will +.B not +produce the expected results. + +The glibc implementation of the functions +.BR snprintf () +and +.BR vsnprintf () +conforms to the C99 standard, that is, behaves as described above, +since glibc version 2.1. +Until glibc 2.0.6 they would return \-1 +when the output was truncated. +.\" .SH HISTORY +.\" Unix V7 defines the three routines +.\" .BR printf (), +.\" .BR fprintf (), +.\" .BR sprintf (), +.\" and has the flag \-, the width or precision *, the length modifier l, +.\" and the conversions doxfegcsu, and also D,O,U,X as synonyms for ld,lo,lu,lx. +.\" This is still true for 2.9.1BSD, but 2.10BSD has the flags +.\" #, + and and no longer mentions D,O,U,X. +.\" 2.11BSD has +.\" .BR vprintf (), +.\" .BR vfprintf (), +.\" .BR vsprintf (), +.\" and warns not to use D,O,U,X. +.\" 4.3BSD Reno has the flag 0, the length modifiers h and L, +.\" and the conversions n, p, E, G, X (with current meaning) +.\" and deprecates D,O,U. +.\" 4.4BSD introduces the functions +.\" .BR snprintf () +.\" and +.\" .BR vsnprintf (), +.\" and the length modifier q. +.\" FreeBSD also has functions +.\" .BR asprintf () +.\" and +.\" .BR vasprintf (), +.\" that allocate a buffer large enough for +.\" .BR sprintf (). +.\" In glibc there are functions +.\" .BR dprintf () +.\" and +.\" .BR vdprintf () +.\" that print to a file descriptor instead of a stream. +.SH BUGS +Because +.BR sprintf () +and +.BR vsprintf () +assume an arbitrarily long string, callers must be careful not to overflow +the actual space; this is often impossible to assure. +Note that the length +of the strings produced is locale-dependent and difficult to predict. +Use +.BR snprintf () +and +.BR vsnprintf () +instead (or +.BR asprintf (3) +and +.BR vasprintf (3)). +.PP +Linux libc4.[45] does not have a +.BR snprintf (), +but provides a libbsd that contains an +.BR snprintf () +equivalent to +.BR sprintf (), +that is, one that ignores the +.I size +argument. +Thus, the use of +.BR snprintf () +with early libc4 leads to serious security problems. +.PP +Code such as +.BI printf( foo ); +often indicates a bug, since +.I foo +may contain a % character. +If +.I foo +comes from untrusted user input, it may contain \fB%n\fP, causing the +.BR printf () +call to write to memory and creating a security hole. +.\" .PP +.\" Some floating-point conversions under early libc4 +.\" caused memory leaks. +.SH EXAMPLE +.if \w'\*(Pi'=0 .ds Pi pi +To print \*(Pi to five decimal places: +.in +4n +.nf + +#include +#include +fprintf(stdout, "pi = %.5f\en", 4 * atan(1.0)); +.fi +.in +.PP +To print a date and time in the form "Sunday, July 3, 10:02", +where +.I weekday +and +.I month +are pointers to strings: +.in +4n +.nf + +#include +fprintf(stdout, "%s, %s %d, %.2d:%.2d\en", + weekday, month, day, hour, min); +.fi +.in +.PP +Many countries use the day-month-year order. +Hence, an internationalized version must be able to print +the arguments in an order specified by the format: +.in +4n +.nf + +#include +fprintf(stdout, format, + weekday, month, day, hour, min); + +.fi +.in +where +.I format +depends on locale, and may permute the arguments. +With the value: +.in +4n +.nf + +"%1$s, %3$d. %2$s, %4$d:%5$.2d\en" + +.fi +.in +one might obtain "Sonntag, 3. Juli, 10:02". +.PP +To allocate a sufficiently large string and print into it +(code correct for both glibc 2.0 and glibc 2.1): +.nf + +#include +#include +#include + +char * +make_message(const char *fmt, ...) +{ + /* Guess we need no more than 100 bytes. */ + int n, size = 100; + char *p, *np; + va_list ap; + + if ((p = malloc(size)) == NULL) + return NULL; + + while (1) { + /* Try to print in the allocated space. */ + va_start(ap, fmt); + n = vsnprintf(p, size, fmt, ap); + va_end(ap); + /* If that worked, return the string. */ + if (n > \-1 && n < size) + return p; + /* Else try again with more space. */ + if (n > \-1) /* glibc 2.1 */ + size = n+1; /* precisely what is needed */ + else /* glibc 2.0 */ + size *= 2; /* twice the old size */ + if ((np = realloc (p, size)) == NULL) { + free(p); + return NULL; + } else { + p = np; + } + } +} +.fi +.SH "SEE ALSO" +.BR printf (1), +.BR asprintf (3), +.BR dprintf (3), +.BR scanf (3), +.BR setlocale (3), +.BR wcrtomb (3), +.BR wprintf (3), +.BR locale (5) diff --git a/original/man3/profil.3 b/original/man3/profil.3 new file mode 100644 index 00000000..e042161d --- /dev/null +++ b/original/man3/profil.3 @@ -0,0 +1,83 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 Fri Jun 23 01:35:19 1995 Andries Brouwer +.\" (prompted by Bas V. de Bakker ) +.\" Corrected (and moved to man3), 980612, aeb +.TH PROFIL 3 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +profil \- execution time profile +.SH SYNOPSIS +.B #include +.sp +.BI "int profil(unsigned short *" buf ", size_t " bufsiz \ +", size_t " offset ", unsigned int " scale ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR profil (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.SH DESCRIPTION +This routine provides a means to find out in what areas your program +spends most of its time. +The argument +.I buf +points to +.I bufsiz +bytes of core. +Every virtual 10 milliseconds, the user's program counter (PC) +is examined: +.I offset +is subtracted and the result is multiplied by +.I scale +and divided by 65536. +If the resulting value is less than +.IR bufsiz , +then the corresponding entry in +.I buf +is incremented. +If +.I buf +is NULL, profiling is disabled. +.SH "RETURN VALUE" +Zero is always returned. +.SH "CONFORMING TO" +Similar to a call in SVr4 (but not POSIX.1-2001). +.SH BUGS +.BR profil () +cannot be used on a program that also uses +.B ITIMER_PROF +interval timers (see +.BR setitimer (2)). + +True kernel profiling provides more accurate results. +Libc 4.4 contained a kernel patch providing a system call profil. +.SH "SEE ALSO" +.BR gprof (1), +.BR setitimer (2), +.BR sigaction (2), +.BR signal (2) diff --git a/original/man3/program_invocation_name.3 b/original/man3/program_invocation_name.3 new file mode 100644 index 00000000..12a54997 --- /dev/null +++ b/original/man3/program_invocation_name.3 @@ -0,0 +1,62 @@ +.\" Copyright (C) 2006 Michael Kerrisk +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.TH INVOCATION_NAME 3 2006-04-29 "GNU" "Linux Programmer's Manual" +.SH NAME +program_invocation_name, program_invocation_short_name \- \ +obtain name used to invoke calling program +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "extern char *" program_invocation_name ; +.BI "extern char *" program_invocation_short_name ; +.fi +.SH DESCRIPTION +.I program_invocation_name +contains the name that was used to invoke the calling program. +This is the same as the value of +.I argv[0] +in +.IR main (), +with the difference that the scope of +.I program_invocation_name +is global. + +.I program_invocation_short_name +contains the basename component of name that was used to invoke +the calling program. +That is, it is the same value as +.IR program_invocation_name , +with all text up to and including the final slash (/), if any, removed. + +These variables are automatically initialized by the glibc run-time +startup code. +.SH "CONFORMING TO" +These variables are GNU extensions, and should not be +used in programs intended to be portable. +.SH NOTES +The Linux-specific +.I /proc/[number]/cmdline +file provides access to similar information. +.SH SEE ALSO +.BR proc (5), +.BR feature_test_macros (7) diff --git a/original/man3/program_invocation_short_name.3 b/original/man3/program_invocation_short_name.3 new file mode 100644 index 00000000..f603f6c7 --- /dev/null +++ b/original/man3/program_invocation_short_name.3 @@ -0,0 +1 @@ +.so man3/program_invocation_name.3 diff --git a/original/man3/psignal.3 b/original/man3/psignal.3 new file mode 100644 index 00000000..128fe8f4 --- /dev/null +++ b/original/man3/psignal.3 @@ -0,0 +1,71 @@ +.\" 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 Sat Jul 24 18:45:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" FIXME glibc 2.10 adds psiginfo(), specified in SUSv4. This function +.\" should be documented, probably on this page. +.TH PSIGNAL 3 2008-08-21 "GNU" "Linux Programmer's Manual" +.SH NAME +psignal \- print signal message +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void psignal(int " sig ", const char *" s ); +.sp +.BI "extern const char *const " sys_siglist []; +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR psignal (): +_SVID_SOURCE || _BSD_SOURCE +.br +.IR sys_siglist : +_BSD_SOURCE +.SH DESCRIPTION +The +.BR psignal () +function displays a message on \fIstderr\fP +consisting of the string \fIs\fP, a colon, a space, and a string +describing the signal number \fIsig\fP. +If \fIsig\fP is invalid, +the message displayed will indicate an unknown signal. +.PP +The array \fIsys_siglist\fP holds the signal description strings +indexed by signal number. +.SH "RETURN VALUE" +The +.BR psignal () +function returns no value. +.SH "CONFORMING TO" +POSIX.1-2008, 4.3BSD. +.SH "SEE ALSO" +.BR perror (3), +.BR strsignal (3) diff --git a/original/man3/pthread_attr_destroy.3 b/original/man3/pthread_attr_destroy.3 new file mode 100644 index 00000000..4e7c9494 --- /dev/null +++ b/original/man3/pthread_attr_destroy.3 @@ -0,0 +1 @@ +.so man3/pthread_attr_init.3 diff --git a/original/man3/pthread_attr_getaffinity_np.3 b/original/man3/pthread_attr_getaffinity_np.3 new file mode 100644 index 00000000..c6af8fa4 --- /dev/null +++ b/original/man3/pthread_attr_getaffinity_np.3 @@ -0,0 +1 @@ +.so man3/pthread_attr_setaffinity_np.3 diff --git a/original/man3/pthread_attr_getdetachstate.3 b/original/man3/pthread_attr_getdetachstate.3 new file mode 100644 index 00000000..c57ecd59 --- /dev/null +++ b/original/man3/pthread_attr_getdetachstate.3 @@ -0,0 +1 @@ +.so man3/pthread_attr_setdetachstate.3 diff --git a/original/man3/pthread_attr_getguardsize.3 b/original/man3/pthread_attr_getguardsize.3 new file mode 100644 index 00000000..766ca2f1 --- /dev/null +++ b/original/man3/pthread_attr_getguardsize.3 @@ -0,0 +1 @@ +.so man3/pthread_attr_setguardsize.3 diff --git a/original/man3/pthread_attr_getinheritsched.3 b/original/man3/pthread_attr_getinheritsched.3 new file mode 100644 index 00000000..65239cb7 --- /dev/null +++ b/original/man3/pthread_attr_getinheritsched.3 @@ -0,0 +1 @@ +.so man3/pthread_attr_setinheritsched.3 diff --git a/original/man3/pthread_attr_getschedparam.3 b/original/man3/pthread_attr_getschedparam.3 new file mode 100644 index 00000000..3f830fdc --- /dev/null +++ b/original/man3/pthread_attr_getschedparam.3 @@ -0,0 +1 @@ +.so man3/pthread_attr_setschedparam.3 diff --git a/original/man3/pthread_attr_getschedpolicy.3 b/original/man3/pthread_attr_getschedpolicy.3 new file mode 100644 index 00000000..10f740c2 --- /dev/null +++ b/original/man3/pthread_attr_getschedpolicy.3 @@ -0,0 +1 @@ +.so man3/pthread_attr_setschedpolicy.3 diff --git a/original/man3/pthread_attr_getscope.3 b/original/man3/pthread_attr_getscope.3 new file mode 100644 index 00000000..965fd629 --- /dev/null +++ b/original/man3/pthread_attr_getscope.3 @@ -0,0 +1 @@ +.so man3/pthread_attr_setscope.3 diff --git a/original/man3/pthread_attr_getstack.3 b/original/man3/pthread_attr_getstack.3 new file mode 100644 index 00000000..2b20d7ed --- /dev/null +++ b/original/man3/pthread_attr_getstack.3 @@ -0,0 +1 @@ +.so man3/pthread_attr_setstack.3 diff --git a/original/man3/pthread_attr_getstackaddr.3 b/original/man3/pthread_attr_getstackaddr.3 new file mode 100644 index 00000000..49d8a85d --- /dev/null +++ b/original/man3/pthread_attr_getstackaddr.3 @@ -0,0 +1 @@ +.so man3/pthread_attr_setstackaddr.3 diff --git a/original/man3/pthread_attr_getstacksize.3 b/original/man3/pthread_attr_getstacksize.3 new file mode 100644 index 00000000..52431f58 --- /dev/null +++ b/original/man3/pthread_attr_getstacksize.3 @@ -0,0 +1 @@ +.so man3/pthread_attr_setstacksize.3 diff --git a/original/man3/pthread_attr_init.3 b/original/man3/pthread_attr_init.3 new file mode 100644 index 00000000..c1a982c3 --- /dev/null +++ b/original/man3/pthread_attr_init.3 @@ -0,0 +1,307 @@ +.\" 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. +.\" +.TH PTHREAD_ATTR_INIT 3 2008-11-11 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_attr_init, pthread_attr_destroy \- initialize and destroy +thread attributes object +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_attr_init(pthread_attr_t *" attr ); +.BI "int pthread_attr_destroy(pthread_attr_t *" attr ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_attr_init () +function initializes the thread attributes object pointed to by +.IR attr +with default attribute values. +After this call, individual attributes of the object can be set +using various related functions (listed under SEE ALSO), +and then the object can be used in one or more +.BR pthread_create (3) +calls that create threads. + +Calling +.BR pthread_attr_init () +on a thread attributes object that has already been initialized +results in undefined behavior. + +When a thread attributes object is no longer required, +it should be destroyed using the +.BR pthread_attr_destroy () +function. +Destroying a thread attributes object has no effect +on threads that were created using that object. + +Once a thread attributes object has been destroyed, +it can be reinitialized using +.BR pthread_attr_init (). +Any other use of a destroyed thread attributes object +has undefined results. +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +.SH ERRORS +POSIX.1-2001 documents an +.B ENOMEM +error for +.BR pthread_attr_init (); +on Linux these functions always succeed +(but portable and future-proof applications should nevertheless +handle a possible error return). +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +The +.I pthread_attr_t +type should be treated as opaque: +any access to the object other than via pthreads functions +is nonportable and produces undefined results. +.SH EXAMPLE +The program below optionally makes use of +.BR pthread_attr_init () +and various related functions to initialize a thread attributes +object that is used to create a single thread. +Once created, the thread uses the +.BR pthread_getattr_np () +function (a nonstandard GNU extension) to retrieve the thread's +attributes, and then displays those attributes. + +If the program is run with no command-line argument, +then it passes NULL as the +.I attr +argument of +.BR pthread_create (3), +so that the thread is created with default attributes. +Running the program on Linux/x86-32 with the NPTL threading implementation, +we see the following: + +.in +4n +.nf +.\" Results from glibc 2.8, SUSE 11.0; Oct 2008 +.RB "$" " ulimit \-s" " # No stack imit ==> default stack size is 2MB" +unlimited +.RB "$" " ./a.out" +Thread attributes: + Detach state = PTHREAD_CREATE_JOINABLE + Scope = PTHREAD_SCOPE_SYSTEM + Inherit scheduler = PTHREAD_INHERIT_SCHED + Scheduling policy = SCHED_OTHER + Scheduling priority = 0 + Guard size = 4096 bytes + Stack address = 0x40196000 + Stack size = 0x201000 bytes +.fi +.in + +When we supply a stack size as a command-line argument, +the program initializes a thread attributes object, +sets various attributes in that object, +and passes a pointer to the object in the call to +.BR pthread_create (3). +Running the program on Linux/x86-32 with the NPTL threading implementation, +we see the following: + +.in +4n +.nf +.\" Results from glibc 2.8, SUSE 11.0; Oct 2008 +.RB "$" " ./a.out 0x3000000" +posix_memalign() allocated at 0x40197000 +Thread attributes: + Detach state = PTHREAD_CREATE_DETACHED + Scope = PTHREAD_SCOPE_SYSTEM + Inherit scheduler = PTHREAD_EXPLICIT_SCHED + Scheduling policy = SCHED_OTHER + Scheduling priority = 0 + Guard size = 0 bytes + Stack address = 0x40197000 + Stack size = 0x3000000 bytes +.fi +.in +.SS Program source +\& +.nf +#define _GNU_SOURCE /* To get pthread_getattr_np() declaration */ +#include +#include +#include +#include +#include + +#define handle_error_en(en, msg) \\ + do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0) + +static void +display_pthread_attr(pthread_attr_t *attr, char *prefix) +{ + int s, i; + size_t v; + void *stkaddr; + struct sched_param sp; + + s = pthread_attr_getdetachstate(attr, &i); + if (s != 0) + handle_error_en(s, "pthread_attr_getdetachstate"); + printf("%sDetach state = %s\\n", prefix, + (i == PTHREAD_CREATE_DETACHED) ? "PTHREAD_CREATE_DETACHED" : + (i == PTHREAD_CREATE_JOINABLE) ? "PTHREAD_CREATE_JOINABLE" : + "???"); + + s = pthread_attr_getscope(attr, &i); + if (s != 0) + handle_error_en(s, "pthread_attr_getscope"); + printf("%sScope = %s\\n", prefix, + (i == PTHREAD_SCOPE_SYSTEM) ? "PTHREAD_SCOPE_SYSTEM" : + (i == PTHREAD_SCOPE_PROCESS) ? "PTHREAD_SCOPE_PROCESS" : + "???"); + + s = pthread_attr_getinheritsched(attr, &i); + if (s != 0) + handle_error_en(s, "pthread_attr_getinheritsched"); + printf("%sInherit scheduler = %s\\n", prefix, + (i == PTHREAD_INHERIT_SCHED) ? "PTHREAD_INHERIT_SCHED" : + (i == PTHREAD_EXPLICIT_SCHED) ? "PTHREAD_EXPLICIT_SCHED" : + "???"); + + s = pthread_attr_getschedpolicy(attr, &i); + if (s != 0) + handle_error_en(s, "pthread_attr_getschedpolicy"); + printf("%sScheduling policy = %s\\n", prefix, + (i == SCHED_OTHER) ? "SCHED_OTHER" : + (i == SCHED_FIFO) ? "SCHED_FIFO" : + (i == SCHED_RR) ? "SCHED_RR" : + "???"); + + s = pthread_attr_getschedparam(attr, &sp); + if (s != 0) + handle_error_en(s, "pthread_attr_getschedparam"); + printf("%sScheduling priority = %d\\n", prefix, sp.sched_priority); + + s = pthread_attr_getguardsize(attr, &v); + if (s != 0) + handle_error_en(s, "pthread_attr_getguardsize"); + printf("%sGuard size = %d bytes\\n", prefix, v); + + s = pthread_attr_getstack(attr, &stkaddr, &v); + if (s != 0) + handle_error_en(s, "pthread_attr_getstack"); + printf("%sStack address = %p\\n", prefix, stkaddr); + printf("%sStack size = 0x%x bytes\\n", prefix, v); +} + +static void * +thread_start(void *arg) +{ + int s; + pthread_attr_t gattr; + + /* pthread_getattr_np() is a non\-standard GNU extension that + retrieves the attributes of the thread specified in its + first argument */ + + s = pthread_getattr_np(pthread_self(), &gattr); + if (s != 0) + handle_error_en(s, "pthread_getattr_np"); + + printf("Thread attributes:\\n"); + display_pthread_attr(&gattr, "\\t"); + + exit(EXIT_SUCCESS); /* Terminate all threads */ +} + +int +main(int argc, char *argv[]) +{ + pthread_t thr; + pthread_attr_t attr; + pthread_attr_t *attrp; /* NULL or &attr */ + int s; + + attrp = NULL; + + /* If a command\-line argument was supplied, use it to set the + stack\-size attribute and set a few other thread attributes, + and set attrp pointing to thread attributes object */ + + if (argc > 1) { + int stack_size; + void *sp; + + attrp = &attr; + + s = pthread_attr_init(&attr); + if (s != 0) + handle_error_en(s, "pthread_attr_init"); + + s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + if (s != 0) + handle_error_en(s, "pthread_attr_setdetachstate"); + + s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); + if (s != 0) + handle_error_en(s, "pthread_attr_setinheritsched"); + + stack_size = strtoul(argv[1], NULL, 0); + + s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size); + if (s != 0) + handle_error_en(s, "posix_memalign"); + + printf("posix_memalign() allocated at %p\\n", sp); + + s = pthread_attr_setstack(&attr, sp, stack_size); + if (s != 0) + handle_error_en(s, "pthread_attr_setstack"); + } + + s = pthread_create(&thr, attrp, &thread_start, NULL); + if (s != 0) + handle_error_en(s, "pthread_create"); + + if (attrp != NULL) { + s = pthread_attr_destroy(attrp); + if (s != 0) + handle_error_en(s, "pthread_attr_destroy"); + } + + pause(); /* Terminates when other thread calls exit() */ +} +.fi +.SH SEE ALSO +.BR pthread_attr_setaffinity_np (3), +.BR pthread_attr_setdetachstate (3), +.BR pthread_attr_setguardsize (3), +.BR pthread_attr_setinheritsched (3), +.BR pthread_attr_setschedparam (3), +.BR pthread_attr_setschedpolicy (3), +.BR pthread_attr_setscope (3), +.BR pthread_attr_setstack (3), +.BR pthread_attr_setstackaddr (3), +.BR pthread_attr_setstacksize (3), +.BR pthread_create (3), +.BR pthread_getattr_np (3), +.BR pthreads (7) diff --git a/original/man3/pthread_attr_setaffinity_np.3 b/original/man3/pthread_attr_setaffinity_np.3 new file mode 100644 index 00000000..efd63ea7 --- /dev/null +++ b/original/man3/pthread_attr_setaffinity_np.3 @@ -0,0 +1,120 @@ +.\" 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. +.\" +.TH PTHREAD_ATTR_SETAFFINITY_NP 3 2009-02-01 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_attr_setaffinity_np, pthread_attr_getaffinity_np \- set/get +CPU affinity attribute in thread attributes object +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "int pthread_attr_setaffinity_np(pthread_attr_t *" attr , +.BI " size_t " cpusetsize ", const cpu_set_t *" cpuset ); +.BI "int pthread_attr_getaffinity_np(pthread_attr_t *" attr , +.BI " size_t " cpusetsize ", cpu_set_t *" cpuset ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_attr_setaffinity_np () +function +sets the CPU affinity mask attribute of the +thread attributes object referred to by +.I attr +to the value specified in +.IR cpuset . +This attribute determines the CPU affinity mask +of a thread created using the thread attributes object +.IR attr . + +The +.BR pthread_attr_getaffinity_np () +function +returns the CPU affinity mask attribute of the thread attributes object +referred to by +.IR attr +in the buffer pointed to by +.IR cpuset . + +The argument +.I cpusetsize +is the length (in bytes) of the buffer pointed to by +.IR cpuset . +Typically, this argument would be specified as +.IR sizeof(cpu_set_t) . + +For more details on CPU affinity masks, see +.BR sched_setaffinity (2). +For a description of a set of macros +that can be used to manipulate and inspect CPU sets, see +.BR CPU_SET (3). +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +.SH ERRORS +.TP +.BR EINVAL +.RB ( pthread_attr_setaffinity_np ()) +.I cpuset +specified a CPU that was outside the set supported by the kernel. +(The kernel configuration option +.BR CONFIG_NR_CPUS +defines the range of the set supported by the kernel data type +.\" cpumask_t +used to represent CPU sets.) +.\" The raw sched_getaffinity() system call returns the size (in bytes) +.\" of the cpumask_t type. +.TP +.B EINVAL +.RB ( pthread_attr_getaffinity_np ()) +A CPU in the affinity mask of the thread attributes object referred to by +.I attr +lies outside the range specified by +.IR cpusetsize +(i.e., +.IR cpuset / cpusetsize +is too small). +.TP +.B ENOMEM +.RB ( pthread_attr_setaffinity_np ()) +Could not allocate memory. +.SH VERSIONS +These functions are provided by glibc since version 2.3.4. +.SH CONFORMING TO +These functions are nonstandard GNU extensions; +hence the suffix "_np" (nonportable) in the names. +.SH NOTES +In glibc 2.3.3 only, +versions of these functions were provided that did not have a +.I cpusetsize +argument. +Instead the CPU set size given to the underlying system calls was always +.IR sizeof(cpu_set_t) . +.SH SEE ALSO +.BR sched_setaffinity (2), +.BR pthread_attr_init (3), +.BR pthread_setaffinity_np (3), +.BR cpuset (7), +.BR pthreads (7) diff --git a/original/man3/pthread_attr_setdetachstate.3 b/original/man3/pthread_attr_setdetachstate.3 new file mode 100644 index 00000000..e03d7ca9 --- /dev/null +++ b/original/man3/pthread_attr_setdetachstate.3 @@ -0,0 +1,113 @@ +.\" 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. +.\" +.TH PTHREAD_ATTR_SETDETACHSTATE 3 2010-02-03 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_attr_setdetachstate, pthread_attr_getdetachstate \- +set/get detach state attribute in thread attributes object +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_attr_setdetachstate(pthread_attr_t *" attr \ +", int " detachstate ); +.BI "int pthread_attr_getdetachstate(pthread_attr_t *" attr \ +", int *" detachstate ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_attr_setdetachstate () +function sets the detach state attribute of the +thread attributes object referred to by +.IR attr +to the value specified in +.IR detachstate . +The detach state attribute determines whether a thread created using +the thread attributes object +.I attr +will be created in a joinable or a detached state. + +The following values may be specified in +.IR detachstate : +.TP +.B PTHREAD_CREATE_DETACHED +Threads that are created using +.I attr +will be created in a detached state. +.TP +.B PTHREAD_CREATE_JOINABLE +Threads that are created using +.I attr +will be created in a joinable state. +.PP +The default setting of the detach state attribute in a newly initialized +thread attributes object is +.BR PTHREAD_CREATE_JOINABLE . + +The +.BR pthread_attr_getdetachstate () +returns the detach state attribute of the thread attributes object +.IR attr +in the buffer pointed to by +.IR detachstate . +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +.SH ERRORS +.BR pthread_attr_setdetachstate (3) +can fail with the following error: +.TP +.B EINVAL +An invalid value was specified in +.IR detachstate . +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +See +.BR pthread_create (3) +for more details on detached and joinable threads. + +A thread that is created in a joinable state should +eventually either be joined using +.BR pthread_join (3) +or detached using +.BR pthread_detach (3); +see +.BR pthread_create (3). + +It is an error to specify the thread ID of +a thread that was created in a detached state +in a later call to +.BR pthread_detach (3) +or +.BR pthread_join (3). +.SH EXAMPLE +See +.BR pthread_attr_init (3). +.SH SEE ALSO +.BR pthread_attr_init (3), +.BR pthread_create (3), +.BR pthread_detach (3), +.BR pthread_join (3), +.BR pthreads (7) diff --git a/original/man3/pthread_attr_setguardsize.3 b/original/man3/pthread_attr_setguardsize.3 new file mode 100644 index 00000000..6f69fbbd --- /dev/null +++ b/original/man3/pthread_attr_setguardsize.3 @@ -0,0 +1,162 @@ +.\" 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. +.\" +.TH PTHREAD_ATTR_SETGUARDSIZE 3 2008-10-24 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_attr_setguardsize, pthread_attr_getguardsize \- set/get guard size +attribute in thread attributes object +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_attr_setguardsize(pthread_attr_t *" attr \ +", size_t " guardsize ); +.BI "int pthread_attr_getguardsize(pthread_attr_t *" attr \ +", size_t *" guardsize ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_attr_setguardsize () +function sets the guard size attribute of the +thread attributes object referred to by +.I attr +to the value specified in +.IR guardsize . + +If +.I guardsize +is greater than 0, +then for each new thread created using +.I attr +the system allocates an additional region of at least +.I guardsize +bytes at the end of the thread's stack to act as the guard area +for the stack (but see BUGS). + +If +.I guardsize +is 0, then new threads created with +.I attr +will not have a guard area. + +The default guard size is the same as the system page size. + +If the stack address attribute has been set in +.I attr +(using +.BR pthread_attr_setstack (3) +or +.BR pthread_attr_setstackaddr (3)), +meaning that the caller is allocating the thread's stack, +then the guard size attribute is ignored +(i.e., no guard area is created by the system): +it is the application's responsibility to handle stack overflow +(perhaps by using +.BR mprotect (2) +to manually define a guard area at the end of the stack +that it has allocated). + +The +.BR pthread_attr_getguardsize () +function returns the guard size attribute of the +thread attributes object referred to by +.I attr +in the buffer pointed to by +.IR guardsize . +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +.SH ERRORS +POSIX.1-2001 documents an +.B EINVAL +error if +.I attr +or +.I guardsize +is invalid. +On Linux these functions always succeed +(but portable and future-proof applications should nevertheless +handle a possible error return). +.SH VERSIONS +These functions are provided by glibc since version 2.1. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +A guard area consists of virtual memory pages that are protected +to prevent read and write access. +If a thread overflows its stack into the guard area, +then, on most hard architectures, it receives a +.B SIGSEGV +signal, thus notifying it of the overflow. +Guard areas start on page boundaries, +and the guard size is internally rounded up to +the system page size when creating a thread. +(Nevertheless, +.BR pthread_attr_getguardsize () +returns the guard size that was set by +.BR pthread_attr_setguardsize ().) + +Setting a guard size of 0 may be useful to save memory +in an application that creates many threads +and knows that stack overflow can never occur. + +Choosing a guard size larger than the default size +may be necessary for detecting stack overflows +if a thread allocates large data structures on the stack. +.SH BUGS +As at glibc 2.8, the NPTL threading implementation includes +the guard area within the stack size allocation, +rather than allocating extra space at the end of the stack, +as POSIX.1 requires. +(This can result in an +.B EINVAL +error from +.BR pthread_create (3) +if the guard size value is too large, +leaving no space for the actual stack.) + +The obsolete LinuxThreads implementation did the right thing, +allocating extra space at the end of the stack for the guard area. +.\" glibc includes the guardsize within the allocated stack size, +.\" which looks pretty clearly to be in violation of POSIX. +.\" +.\" Filed bug, 22 Oct 2008: +.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973 +.\" +.\" Older reports: +.\" https//bugzilla.redhat.com/show_bug.cgi?id=435337 +.\" Reportedly, LinuxThreads did the right thing, allocating +.\" extra space at the end of the stack: +.\" http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html +.SH EXAMPLE +See +.BR pthread_getattr_np (3). +.SH SEE ALSO +.BR mmap (2), +.BR mprotect (2), +.BR pthread_attr_init (3), +.BR pthread_create (3), +.BR pthread_attr_setstack (3), +.BR pthread_attr_setstacksize (3), +.BR pthreads (7) diff --git a/original/man3/pthread_attr_setinheritsched.3 b/original/man3/pthread_attr_setinheritsched.3 new file mode 100644 index 00000000..b858f72a --- /dev/null +++ b/original/man3/pthread_attr_setinheritsched.3 @@ -0,0 +1,127 @@ +.\" 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. +.\" +.TH PTHREAD_ATTR_SETINHERITSCHED 3 2008-11-10 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_attr_setinheritsched, pthread_attr_getinheritsched \- set/get +inherit scheduler attribute in thread attributes object +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_attr_setinheritsched(pthread_attr_t *" attr , +.BI " int " inheritsched ); +.BI "int pthread_attr_getinheritsched(pthread_attr_t *" attr , +.BI " int *" inheritsched ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_attr_setinheritsched () +function sets the inherit scheduler attribute of the +thread attributes object referred to by +.IR attr +to the value specified in +.IR inheritsched . +The inherit scheduler attribute determines whether a thread created using +the thread attributes object +.I attr +will inherit its scheduling attributes from the calling thread +or whether it will take them from +.IR attr . + +The following values may be specified in +.IR inheritsched : +.TP +.B PTHREAD_INHERIT_SCHED +Threads that are created using +.I attr +inherit scheduling attributes from the creating thread; +the scheduling attributes in +.I attr +are ignored. +.TP +.B PTHREAD_EXPLICIT_SCHED +Threads that are created using +.I attr +take their scheduling attributes from the values specified +by the attributes object. +.\" FIXME what are the defaults for scheduler settings? +.PP +The default setting of the inherit scheduler attribute in +a newly initialized thread attributes object is +.BR PTHREAD_INHERIT_SCHED . + +The +.BR pthread_attr_getinheritsched () +returns the inherit scheduler attribute of the thread attributes object +.IR attr +in the buffer pointed to by +.IR inheritsched . +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +.SH ERRORS +.BR pthread_attr_setinheritsched () +can fail with the following error: +.TP +.B EINVAL +Invalid value in +.IR inheritsched . +.PP +POSIX.1-2001 also documents an optional +.B ENOTSUP +error ("attempt was made to set the attribute to an unsupported value") for +.BR pthread_attr_setinheritsched (). +.\" .SH VERSIONS +.\" Available since glibc 2.0. +.SH CONFORMING TO +POSIX.1-2001. +.SH EXAMPLE +See +.BR pthread_setschedparam (3). +.SH BUGS +As at glibc 2.8, if a thread attributes object is initialized using +.BR pthread_attr_init (3), +then the scheduling policy of the attributes object is set to +.BR SCHED_OTHER +and the scheduling priority is set to 0. +However, if the inherit scheduler attribute is then set to +.BR PTHREAD_EXPLICIT_SCHED , +then a thread created using the attribute object +wrongly inherits its scheduling attributes from the creating thread. +This bug does not occur if either the scheduling policy or +scheduling priority attribute is explicitly set +in the thread attributes object before calling +.BR pthread_create (3). +.\" FIXME . Track status of the following bug: +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=7007 +.SH SEE ALSO +.BR sched_setscheduler (2), +.BR pthread_attr_init (3), +.BR pthread_attr_setschedparam (3), +.BR pthread_attr_setschedpolicy (3), +.BR pthread_create (3), +.BR pthread_setschedparam (3), +.BR pthread_setschedprio (3), +.BR pthreads (7) diff --git a/original/man3/pthread_attr_setschedparam.3 b/original/man3/pthread_attr_setschedparam.3 new file mode 100644 index 00000000..9b6ac5d8 --- /dev/null +++ b/original/man3/pthread_attr_setschedparam.3 @@ -0,0 +1,104 @@ +.\" 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. +.\" +.TH PTHREAD_ATTR_SETSCHEDPARAM 3 2010-02-03 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_attr_setschedparam, pthread_attr_getschedparam \- set/get +scheduling parameter attributes in thread attributes object +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_attr_setschedparam(pthread_attr_t *" attr , +.BI " const struct sched_param *" param ); +.BI "int pthread_attr_getschedparam(pthread_attr_t *" attr , +.BI " struct sched_param *" param ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_attr_setschedparam () +function sets the scheduling parameter attributes of the +thread attributes object referred to by +.IR attr +to the values specified in the buffer pointed to by +.IR param . +These attributes determine the scheduling parameters of +a thread created using the thread attributes object +.IR attr . + +The +.BR pthread_attr_getschedparam () +returns the scheduling parameter attributes of the thread attributes object +.IR attr +in the buffer pointed to by +.IR param . + +Scheduling parameters are maintained in the following structure: + +.in +4n +.nf +struct sched_param { + int sched_priority; /* Scheduling priority */ +}; +.fi +.in + +As can be seen, only one scheduling parameter is supported. +For details of the permitted ranges for scheduling priorities +in each scheduling policy, see +.BR sched_setscheduler (2). +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +.SH ERRORS +POSIX.1 documents +.B EINVAL +and +.B ENOTSUP +errors for +.BR pthread_attr_setschedparam (). +On Linux these functions always succeed +(but portable and future-proof applications should nevertheless +handle a possible error return). +.\" .SH VERSIONS +.\" Available since glibc 2.0. +.SH CONFORMING TO +POSIX.1-2001. +.SH EXAMPLE +See +.BR pthread_setschedparam (3). +.SH NOTES +See +.BR pthread_attr_setschedpolicy (3) +for a list of the thread scheduling policies supported on Linux. +.SH SEE ALSO +.BR sched_get_priority_min (2), +.BR sched_setscheduler (2), +.BR pthread_attr_init (3), +.BR pthread_attr_setinheritsched (3), +.BR pthread_attr_setschedpolicy (3), +.BR pthread_create (3), +.BR pthread_setschedparam (3), +.BR pthread_setschedprio (3), +.BR pthreads (7) diff --git a/original/man3/pthread_attr_setschedpolicy.3 b/original/man3/pthread_attr_setschedpolicy.3 new file mode 100644 index 00000000..5a183e70 --- /dev/null +++ b/original/man3/pthread_attr_setschedpolicy.3 @@ -0,0 +1,99 @@ +.\" 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. +.\" +.TH PTHREAD_ATTR_SETSCHEDPOLICY 3 2010-02-03 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_attr_setschedpolicy, pthread_attr_getschedpolicy \- set/get +scheduling policy attribute in thread attributes object +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_attr_setschedpolicy(pthread_attr_t *" attr \ +", int " policy ); +.BI "int pthread_attr_getschedpolicy(pthread_attr_t *" attr \ +", int " *policy ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_attr_setschedpolicy () +function sets the scheduling policy attribute of the +thread attributes object referred to by +.IR attr +to the value specified in +.IR policy . +This attribute determines the scheduling policy of +a thread created using the thread attributes object +.IR attr . + +The supported values for +.I policy +are +.BR SCHED_FIFO , +.BR SCHED_RR , +and +.BR SCHED_OTHER , +with the semantics described in +.BR sched_setscheduler (2). +.\" FIXME . pthread_setschedparam() places no restriction on the policy, +.\" but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=7013 + +The +.BR pthread_attr_getschedpolicy () +returns the scheduling policy attribute of the thread attributes object +.IR attr +in the buffer pointed to by +.IR policy . +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +.SH ERRORS +.BR pthread_attr_setschedpolicy () +can fail with the following error: +.TP +.B EINVAL +Invalid value in +.IR policy . +.PP +POSIX.1-2001 also documents an optional +.B ENOTSUP +error ("attempt was made to set the attribute to an unsupported value") for +.BR pthread_attr_setschedpolicy (). +.\" .SH VERSIONS +.\" Available since glibc 2.0. +.SH CONFORMING TO +POSIX.1-2001. +.SH EXAMPLE +See +.BR pthread_setschedparam (3). +.SH SEE ALSO +.BR sched_setscheduler (2), +.BR pthread_attr_init (3), +.BR pthread_attr_setinheritsched (3), +.BR pthread_attr_setschedparam (3), +.BR pthread_create (3), +.BR pthread_setschedparam (3), +.BR pthread_setschedprio (3), +.BR pthreads (7) diff --git a/original/man3/pthread_attr_setscope.3 b/original/man3/pthread_attr_setscope.3 new file mode 100644 index 00000000..74d38656 --- /dev/null +++ b/original/man3/pthread_attr_setscope.3 @@ -0,0 +1,124 @@ +.\" 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. +.\" +.TH PTHREAD_ATTR_SETSCOPE 3 2008-10-24 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_attr_setscope, pthread_attr_getscope \- set/get contention scope +attribute in thread attributes object +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_attr_setscope(pthread_attr_t *" attr \ +", int " scope ); +.BI "int pthread_attr_getscope(pthread_attr_t *" attr \ +", int *" scope ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_attr_setscope () +function sets the contention scope attribute of the +thread attributes object referred to by +.I attr +to the value specified in +.IR scope . +The contention scope attribute defines the set of threads +against which a thread competes for resources such as the CPU. +POSIX.1-2001 specifies two possible values for +.IR scope : +.TP +.B PTHREAD_SCOPE_SYSTEM +The thread competes for resources with all other threads +in all processes on the system that are in the same scheduling +allocation domain (a group of one or more processors). +.B PTHREAD_SCOPE_SYSTEM +threads are scheduled relative to one another +according to their scheduling policy and priority. +.TP +.B PTHREAD_SCOPE_PROCESS +The thread competes for resources with all other threads +in the same process that were also created with the +.BR PTHREAD_SCOPE_PROCESS +contention scope. +.BR PTHREAD_SCOPE_PROCESS +threads are scheduled relative to other threads in the process +according to their scheduling policy and priority. +POSIX.1-2001 leaves it unspecified how these threads contend +with other threads in other process on the system or +with other threads in the same process that +were created with the +.B PTHREAD_SCOPE_SYSTEM +contention scope. +.PP +POSIX.1-2001 only requires that an implementation support one of these +contention scopes, but permits both to be supported. +Linux supports +.BR PTHREAD_SCOPE_SYSTEM , +but not +.BR PTHREAD_SCOPE_PROCESS . + +The +.BR pthread_attr_getscope () +function returns the contention scope attribute of the +thread attributes object referred to by +.I attr +in the buffer pointed to by +.IR scope . +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +.SH ERRORS +.BR pthread_attr_setscope () +can fail with the following errors: +.TP +.B EINVAL +An invalid value was specified in +.IR scope . +.TP +.B ENOTSUP +.IR scope +specified the value +.BR PTHREAD_SCOPE_PROCESS , +which is not supported on Linux. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +The +.B PTHREAD_SCOPE_SYSTEM +contention scope typically indicates that a userspace thread is +bound directly to a single kernel-scheduling entity. +This is the case on Linux for the obsolete LinuxThreads implementation +and the modern NPTL implementation, +which are both 1:1 threading implementations. + +POSIX.1-2001 specifies that the default contention scope is +implementation-defined. +.SH SEE ALSO +.BR pthread_attr_init (3), +.BR pthread_attr_setaffinity_np (3), +.BR pthread_attr_setinheritsched (3), +.BR pthread_attr_setschedparam (3), +.BR pthread_attr_setschedpolicy (3), +.BR pthread_create (3), +.BR pthreads (7) diff --git a/original/man3/pthread_attr_setstack.3 b/original/man3/pthread_attr_setstack.3 new file mode 100644 index 00000000..38c699b8 --- /dev/null +++ b/original/man3/pthread_attr_setstack.3 @@ -0,0 +1,161 @@ +.\" 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. +.\" +.TH PTHREAD_ATTR_SETSTACK 3 2008-10-24 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_attr_setstack, pthread_attr_getstack \- set/get stack +attributes in thread attributes object +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_attr_setstack(pthread_attr_t *" attr , +.BI " void *" stackaddr ", size_t " stacksize ); +.BI "int pthread_attr_getstack(pthread_attr_t *" attr , +.BI " void **" stackaddr ", size_t *" stacksize ); +.sp +Compile and link with \fI\-pthread\fP. +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR pthread_attr_getstack (), +.BR pthread_attr_setstack (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH DESCRIPTION +The +.BR pthread_attr_setstack () +function sets the stack address and stack size attributes of the +thread attributes object referred to by +.I attr +to the values specified in +.IR stackaddr +and +.IR stacksize , +respectively. +These attributes specify the location and size of the stack that should +be used by a thread that is created using the thread attributes object +.IR attr . + +.I stackaddr +should point to the lowest addressable byte of a buffer of +.I stacksize +bytes that was allocated by the caller. +The pages of the allocated buffer should be both readable and writable. + +The +.BR pthread_attr_getstack () +function returns the stack address and stack size attributes of the +thread attributes object referred to by +.I attr +in the buffers pointed to by +.IR stackaddr +and +.IR stacksize , +respectively. +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +.SH ERRORS +.BR pthread_attr_setstack () +can fail with the following error: +.TP +.B EINVAL +.I stacksize +is less than +.BR PTHREAD_STACK_MIN +(16384) bytes. +On some systems, this error may also occur if +.IR stackaddr +or +.IR "stackaddr\ +\ stacksize" +is not suitably aligned. +.PP +POSIX.1-2001 also documents an +.BR EACCES +error if the stack area described by +.I stackaddr +and +.I stacksize +is not both readable and writable by the caller. +.SH VERSIONS +These functions are provided by glibc since version 2.2. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +These functions are provided for applications that must ensure that +a thread's stack is placed in a particular location. +For most applications, this is not necessary, +and the use of these functions should be avoided. +(Use +.BR pthread_attr_setstacksize (3) +if an application simply requires a stack size other than the default.) + +When an application employs +.BR pthread_attr_setstack (), +it takes over the responsibility of allocating the stack. +Any guard size value that was set using +.BR pthread_attr_setguardsize (3) +is ignored. +If deemed necessary, +it is the application's responsibility to allocate a guard area +(one or more pages protected against reading and writing) +to handle the possibility of stack overflow. + +The address specified in +.I stackaddr +should be suitably aligned: +for full portability, align it on a page boundary +.RI ( sysconf(_SC_PAGESIZE) ). +.BR posix_memalign (3) +may be useful for allocation. +Probably, +.IR stacksize +should also be a multiple of the system page size. + +If +.I attr +is used to create multiple threads, then the caller must change the +stack address attribute between calls to +.BR pthread_create (3); +otherwise, the threads will attempt to use the same memory area +for their stacks, and chaos will ensue. +.BR +.SH EXAMPLE +See +.BR pthread_attr_init (3). +.SH SEE ALSO +.BR mmap (2), +.BR mprotect (2), +.BR posix_memalign (3), +.BR pthread_attr_init (3), +.BR pthread_attr_setguardsize (3), +.BR pthread_attr_setstackaddr (3), +.BR pthread_attr_setstacksize (3), +.BR pthread_create (3), +.BR pthreads (7) diff --git a/original/man3/pthread_attr_setstackaddr.3 b/original/man3/pthread_attr_setstackaddr.3 new file mode 100644 index 00000000..a11b48a8 --- /dev/null +++ b/original/man3/pthread_attr_setstackaddr.3 @@ -0,0 +1,112 @@ +.\" 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. +.\" +.TH PTHREAD_ATTR_SETSTACKADDR 3 2008-10-24 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_attr_setstackaddr, pthread_attr_getstackaddr \- +set/get stack address attribute in thread attributes object +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_attr_setstackaddr(pthread_attr_t *" attr \ +", void *" stackaddr ); +.BI "int pthread_attr_getstackaddr(pthread_attr_t *" attr \ +", void **" stackaddr ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +These functions are obsolete: +.B do not use them. +Use +.BR pthread_attr_setstack (3) +and +.BR pthread_attr_getstack (3) +instead. + +The +.BR pthread_attr_setstackaddr () +function sets the stack address attribute of the +thread attributes object referred to by +.I attr +to the value specified in +.IR stackaddr . +This attribute specifies the location of the stack that should +be used by a thread that is created using the thread attributes object +.IR attr . + +.I stackaddr +should point to a buffer of at least +.B PTHREAD_STACK_MIN +bytes that was allocated by the caller. +The pages of the allocated buffer should be both readable and writable. + +The +.BR pthread_attr_getstackaddr () +function returns the stack address attribute of the +thread attributes object referred to by +.I attr +in the buffer pointed to by +.IR stackaddr . +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +.SH ERRORS +No errors are defined +(but applications should nevertheless +handle a possible error return). +.SH VERSIONS +These functions are provided by glibc since version 2.1. +.SH CONFORMING TO +POSIX.1-2001 specifies these functions but marks them as obsolete. +POSIX.1-2008 removes the specification of these functions. +.SH NOTES +.I Do not use these functions! +They cannot be portably used, since they provide no way of specifying +the direction of growth or the range of the stack. +For example, on architectures with a stack that grows downwards, +.I stackaddr +specifies the next address past the +.I highest +address of the allocated stack area. +However, on architectures with a stack that grows upwards, +.I stackaddr +specifies the +.I lowest +address in the allocated stack area. +By contrast, the +.I stackaddr +used by +.BR pthread_attr_setstack (3) +and +.BR pthread_attr_getstack (3), +is always a pointer to the lowest address in the allocated stack area +(and the +.I stacksize +argument specifies the range of the stack). +.SH SEE ALSO +.BR pthread_attr_init (3), +.BR pthread_attr_setstack (3), +.BR pthread_attr_setstacksize (3), +.BR pthread_create (3), +.BR pthreads (7) diff --git a/original/man3/pthread_attr_setstacksize.3 b/original/man3/pthread_attr_setstacksize.3 new file mode 100644 index 00000000..deccf0c8 --- /dev/null +++ b/original/man3/pthread_attr_setstacksize.3 @@ -0,0 +1,114 @@ +.\" 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. +.\" +.TH PTHREAD_ATTR_SETSTACKSIZE 3 2008-11-05 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_attr_setstacksize, pthread_attr_getstacksize \- set/get stack size +attribute in thread attributes object +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_attr_setstacksize(pthread_attr_t *" attr \ +", size_t " stacksize ); +.BI "int pthread_attr_getstacksize(pthread_attr_t *" attr \ +", size_t *" stacksize ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_attr_setstacksize () +function sets the stack size attribute of the +thread attributes object referred to by +.I attr +to the value specified in +.IR stacksize . + +The stack size attribute determines the minimum size (in bytes) that +will be allocated for threads created using the thread attributes object +.IR attr . + +The +.BR pthread_attr_getstacksize () +function returns the stack size attribute of the +thread attributes object referred to by +.I attr +in the buffer pointed to by +.IR stacksize . +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +.SH ERRORS +.BR pthread_attr_setstacksize () +can fail with the following error: +.TP +.B EINVAL +The stack size is less than +.BR PTHREAD_STACK_MIN +(16384) bytes. +.PP +On some systems, +.\" e.g., MacOS +.BR pthread_attr_setstacksize () +can fail with the error +.B EINVAL +if +.I stacksize +is not a multiple of the system page size. +.SH VERSIONS +These functions are provided by glibc since version 2.1. +.SH CONFORMING TO +POSIX.1-2001. +.SH EXAMPLE +See +.BR pthread_create (3). +.SH NOTES +For details on the default stack size of new threads, see +.BR pthread_create (3). + +A thread's stack size is fixed at the time of thread creation. +Only the main thread can dynamically grow its stack. + +The +.BR pthread_attr_setstack (3) +function allows an application to set both the size and location +of a caller-allocated stack that is to be used by a thread. +.SH BUGS +As at glibc 2.8, +if the specified +.I stacksize +is not a multiple of +.BR STACK_ALIGN +(16 bytes on most architectures), it may be rounded +.IR downwards , +in violation of POSIX.1-2001, which says that the allocated stack will +be at least +.I stacksize +bytes. +.SH SEE ALSO +.BR getrlimit (2), +.BR pthread_attr_init (3), +.BR pthread_attr_setguardsize (3), +.BR pthread_attr_setstack (3), +.BR pthread_create (3), +.BR pthreads (7) diff --git a/original/man3/pthread_cancel.3 b/original/man3/pthread_cancel.3 new file mode 100644 index 00000000..b1dd2087 --- /dev/null +++ b/original/man3/pthread_cancel.3 @@ -0,0 +1,229 @@ +.\" 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. +.\" +.TH PTHREAD_CANCEL 3 2008-11-17 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_cancel \- send a cancellation request to a thread +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_cancel(pthread_t " thread ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_cancel () +function sends a cancellation request to the thread +.IR thread . +Whether and when the target thread +reacts to the cancellation request depends on +two attributes that are under the control of that thread: +its cancelability \fIstate\fP and \fItype\fP. + +A thread's cancelability state, determined by +.BR pthread_setcancelstate (3), +can be +.I enabled +(the default for new threads) or +.IR disabled . +If a thread has disabled cancellation, +then a cancellation request remains queued until the thread +enables cancellation. +If a thread has enabled cancellation, +then its cancelability type determines when cancellation occurs. + +A thread's cancellation type, determined by +.BR pthread_setcanceltype (3), +may be either +.IR asynchronous +or +.IR deferred +(the default for new threads). +Asynchronous cancelability +means that the thread can be canceled at any time +(usually immediately, but the system does not guarantee this). +Deferred cancelability means that cancellation will be delayed until +the thread next calls a function that is a +.IR "cancellation point" . +A list of functions that are or may be cancellation points is provided in +.IR pthreads (7). + +When a cancellation requested is acted on, the following steps occur for +.IR thread +(in this order): +.IP 1. 3 +Cancellation clean-up handlers are popped +(in the reverse of the order in which they were pushed) and called. +(See +.BR pthread_cleanup_push (3).) +.IP 2. +Thread-specific data destructors are called, +in an unspecified order. +(See +.BR pthread_key_create (3).) +.IP 3. +The thread is terminated. +(See +.BR pthread_exit (3).) +.PP +The above steps happen asynchronously with respect to the +.BR pthread_cancel () +call; +the return status of +.BR pthread_cancel () +merely informs the caller whether the cancellation request +was successfully queued. +.PP +After a canceled thread has terminated, +a join with that thread using +.BR pthread_join (3) +obtains +.B PTHREAD_CANCELED +as the thread's exit status. +(Joining with a thread is the only way to know that cancellation +has completed.) +.SH RETURN VALUE +On success, +.BR pthread_cancel () +returns 0; +on error, it returns a nonzero error number. +.SH ERRORS +.TP +.B ESRCH +No thread with the ID +.I thread +could be found. +.\" .SH VERSIONS +.\" Available since glibc 2.0 +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +On Linux, cancellation is implemented using signals. +Under the NPTL threading implementation, +the first real-time signal (i.e., signal 32) is used for this purpose. +On LinuxThreads, the second real-time signal is used, +if real-time signals are available, otherwise +.B SIGUSR2 +is used. +.SH EXAMPLE +The program below creates a thread and then cancels it. +The main thread joins with the canceled thread to check +that its exit status was +.BR PTHREAD_CANCELED . +The following shell session shows what happens when we run the program: + +.in +4n +.nf +$ ./a.out +thread_func(): started; cancellation disabled +main(): sending cancellation request +thread_func(): about to enable cancellation +main(): thread was canceled +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include +#include +#include + +#define handle_error_en(en, msg) \\ + do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0) + +static void * +thread_func(void *ignored_argument) +{ + int s; + + /* Disable cancellation for a while, so that we don\(aqt + immediately react to a cancellation request */ + + s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); + if (s != 0) + handle_error_en(s, "pthread_setcancelstate"); + + printf("thread_func(): started; cancellation disabled\\n"); + sleep(5); + printf("thread_func(): about to enable cancellation\\n"); + + s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); + if (s != 0) + handle_error_en(s, "pthread_setcancelstate"); + + /* sleep() is a cancellation point */ + + sleep(1000); /* Should get canceled while we sleep */ + + /* Should never get here */ + + printf("thread_func(): not canceled!\\n"); + return NULL; +} + +int +main(void) +{ + pthread_t thr; + void *res; + int s; + + /* Start a thread and then send it a cancellation request */ + + s = pthread_create(&thr, NULL, &thread_func, NULL); + if (s != 0) + handle_error_en(s, "pthread_create"); + + sleep(2); /* Give thread a chance to get started */ + + printf("main(): sending cancellation request\\n"); + s = pthread_cancel(thr); + if (s != 0) + handle_error_en(s, "pthread_cancel"); + + /* Join with thread to see what its exit status was */ + + s = pthread_join(thr, &res); + if (s != 0) + handle_error_en(s, "pthread_join"); + + if (res == PTHREAD_CANCELED) + printf("main(): thread was canceled\\n"); + else + printf("main(): thread wasn\(aqt canceled (shouldn\(aqt happen!)\\n"); + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR pthread_cleanup_push (3), +.BR pthread_create (3), +.BR pthread_exit (3), +.BR pthread_join (3), +.BR pthread_key_create (3), +.BR pthread_setcancelstate (3), +.BR pthread_setcanceltype (3), +.BR pthread_testcancel (3), +.BR pthreads (7) diff --git a/original/man3/pthread_cleanup_pop.3 b/original/man3/pthread_cleanup_pop.3 new file mode 100644 index 00000000..fb0e68bc --- /dev/null +++ b/original/man3/pthread_cleanup_pop.3 @@ -0,0 +1 @@ +.so man3/pthread_cleanup_push.3 diff --git a/original/man3/pthread_cleanup_pop_restore_np.3 b/original/man3/pthread_cleanup_pop_restore_np.3 new file mode 100644 index 00000000..c47e20a0 --- /dev/null +++ b/original/man3/pthread_cleanup_pop_restore_np.3 @@ -0,0 +1 @@ +.so man3/pthread_cleanup_push_defer_np.3 diff --git a/original/man3/pthread_cleanup_push.3 b/original/man3/pthread_cleanup_push.3 new file mode 100644 index 00000000..57ebe2e8 --- /dev/null +++ b/original/man3/pthread_cleanup_push.3 @@ -0,0 +1,313 @@ +.\" 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. +.\" +.TH PTHREAD_CLEANUP_PUSH 3 2008-11-24 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_cleanup_push, pthread_cleanup_pop \- push and pop +thread cancellation clean-up handlers +.SH SYNOPSIS +.nf +.B #include + +.BI "void pthread_cleanup_push(void (*" routine ")(void *)," +.BI " void *" arg ); +.BI "void pthread_cleanup_pop(int " execute ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +These functions manipulate the calling thread's stack of +thread-cancellation clean-up handlers. +A clean-up handler is a function that is automatically executed +when a thread is canceled (or in various other circumstances +described below); +it might, for example, unlock a mutex so that +it becomes available to other threads in the process. + +The +.BR pthread_cleanup_push () +function pushes +.I routine +onto the top of the stack of clean-up handlers. +When +.I routine +is later invoked, it will be given +.I arg +as its argument. + +The +.BR pthread_cleanup_pop () +function removes the routine at the top of the stack of clean-up handlers, +and optionally executes it if +.I execute +is nonzero. + +A cancellation clean-up handler is popped from the stack +and executed in the following circumstances: +.IP 1. 3 +When a thread is canceled, +all of the stacked clean-up handlers are popped and executed in +the reverse of the order in which they were pushed onto the stack. +.IP 2. +When a thread terminates by calling +.BR pthread_exit (3), +all clean-up handlers are executed as described in the preceding point. +(Clean-up handlers are \fInot\fP called if the thread terminates by +performing a +.I return +from the thread start function.) +.IP 3. +When a thread calls +.BR pthread_cleanup_pop () +with a nonzero +.I execute +argument, the top-most clean-up handler is popped and executed. +.PP +POSIX.1 permits +.BR pthread_cleanup_push () +and +.BR pthread_cleanup_pop () +to be implemented as macros that expand to text +containing \(aq\fB{\fP\(aq and \(aq\fB}\fP\(aq, respectively. +For this reason, the caller must ensure that calls to these +functions are paired within the same function, +and at the same lexical nesting level. +(In other words, a clean-up handler is only established +during the execution of a specified section of code.) + +Calling +.BR longjmp (3) +.RB ( siglongjmp (3)) +produces undefined results if any call has been made to +.BR pthread_cleanup_push () +or +.BR pthread_cleanup_pop () +without the matching call of the pair since the jump buffer +was filled by +.BR setjmp (3) +.RB ( sigsetjmp (3)). +Likewise, calling +.BR longjmp (3) +.RB ( siglongjmp (3)) +from inside a clean-up handler produces undefined results +unless the jump buffer was also filled by +.BR setjmp (3) +.RB ( sigsetjmp (3)) +inside the handler. +.SH RETURN VALUE +These functions do not return a value. +.SH ERRORS +There are no errors. +.\" SH VERSIONS +.\" Available since glibc 2.0 +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +On Linux, the +.BR pthread_cleanup_push () +and +.BR pthread_cleanup_pop () +functions \fIare\fP implemented as macros that expand to text +containing \(aq\fB{\fP\(aq and \(aq\fB}\fP\(aq, respectively. +This means that variables declared within the scope of +paired calls to these functions will only be visible within that scope. + +POSIX.1 +.\" The text was actually added in the 2004 TC2 +says that the effect of using +.IR return , +.IR break , +.IR continue , +or +.IR goto +to prematurely leave a block bracketed +.BR pthread_cleanup_push () +and +.BR pthread_cleanup_pop () +is undefined. +Portable applications should avoid doing this. +.SH EXAMPLE +The program below provides a simple example of the use of the functions +described in this page. +The program creates a thread that executes a loop bracketed by +.BR pthread_cleanup_push () +and +.BR pthread_cleanup_pop (). +This loop increments a global variable, +.IR cnt , +once each second. +Depending on what command-line arguments are supplied, +the main thread sends the other thread a cancellation request, +or sets a global variable that causes the other thread +to exit its loop and terminate normally (by doing a +.IR return ). + +In the following shell session, +the main thread sends a cancellation request to the other thread: + +.in +4n +.nf +$ \fB./a.out\fP +New thread started +cnt = 0 +cnt = 1 +Canceling thread +Called clean-up handler +Thread was canceled; cnt = 0 +.fi +.in + +From the above, we see that the thread was canceled, +and that the cancellation clean-up handler was called +and it reset the value of the global variable +.I cnt +to 0. + +In the next run, the main program sets a +global variable that causes other thread to terminate normally: + +.in +4n +.nf +$ \fB./a.out x\fP +New thread started +cnt = 0 +cnt = 1 +Thread terminated normally; cnt = 2 +.fi +.in + +From the above, we see that the clean-up handler was not executed (because +.I cleanup_pop_arg +was 0), and therefore the value of +.I cnt +was not reset. + +In the next run, the main program sets a global variable that +causes the other thread to terminate normally, +and supplies a nonzero value for +.IR cleanup_pop_arg : + +.in +4n +.nf +$ \fB./a.out x 1\fP +New thread started +cnt = 0 +cnt = 1 +Called clean-up handler +Thread terminated normally; cnt = 0 +.fi +.in + +In the above, we see that although the thread was not canceled, +the clean-up handler was executed, because the argument given to +.BR pthread_cleanup_pop () +was nonzero. +.SS Program source +\& +.nf +#include +#include +#include +#include +#include +#include + +#define handle_error_en(en, msg) \\ + do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0) + +static int done = 0; +static int cleanup_pop_arg = 0; +static int cnt = 0; + +static void +cleanup_handler(void *arg) +{ + printf("Called clean\-up handler\\n"); + cnt = 0; +} + +static void * +thread_start(void *arg) +{ + time_t start, curr; + + printf("New thread started\\n"); + + pthread_cleanup_push(cleanup_handler, NULL); + + curr = start = time(NULL); + + while (!done) { + pthread_testcancel(); /* A cancellation point */ + if (curr < time(NULL)) { + curr = time(NULL); + printf("cnt = %d\\n", cnt); /* A cancellation point */ + cnt++; + } + } + + pthread_cleanup_pop(cleanup_pop_arg); + return NULL; +} + +int +main(int argc, char *argv[]) +{ + pthread_t thr; + int s; + void *res; + + s = pthread_create(&thr, NULL, thread_start, NULL); + if (s != 0) + handle_error_en(s, "pthread_create"); + + sleep(2); /* Allow new thread to run a while */ + + if (argc > 1) { + if (argc > 2) + cleanup_pop_arg = atoi(argv[2]); + done = 1; + + } else { + printf("Canceling thread\\n"); + s = pthread_cancel(thr); + if (s != 0) + handle_error_en(s, "pthread_cancel"); + } + + s = pthread_join(thr, &res); + if (s != 0) + handle_error_en(s, "pthread_join"); + + if (res == PTHREAD_CANCELED) + printf("Thread was canceled; cnt = %d\\n", cnt); + else + printf("Thread terminated normally; cnt = %d\\n", cnt); + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR pthread_cancel (3), +.BR pthread_cleanup_push_defer_np (3), +.BR pthread_setcancelstate (3), +.BR pthread_testcancel (3), +.BR pthreads (7) diff --git a/original/man3/pthread_cleanup_push_defer_np.3 b/original/man3/pthread_cleanup_push_defer_np.3 new file mode 100644 index 00000000..ca4cacb7 --- /dev/null +++ b/original/man3/pthread_cleanup_push_defer_np.3 @@ -0,0 +1,106 @@ +.\" 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. +.\" +.TH PTHREAD_CLEANUP_PUSH_DEFER_NP 3 2008-12-04 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np \- push and pop +thread cancellation clean-up handlers while saving cancelability type +.SH SYNOPSIS +.nf +.B #include + +.BI "void pthread_cleanup_push_defer_np(void (*" routine ")(void *)," +.BI " void *" arg ); +.BI "void pthread_cleanup_pop_restore_np(int " execute ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +These functions are the same as +.BR pthread_cleanup_push (3) +and +.BR pthread_cleanup_pop (3), +except for the differences noted on this page. + +Like +.BR pthread_cleanup_push (3), +.BR pthread_cleanup_push_defer_np () +pushes +.I routine +onto the thread's stack of cancellation clean-up handlers. +In addition, it also saves the thread's current cancelability type, +and sets the cancelability type to "deferred" (see +.BR pthread_setcanceltype (3)); +this ensures that cancellation clean-up will occur +even if the thread's cancelability type was "asynchronous" +before the the call. + +Like +.BR pthread_cleanup_pop (3), +.BR pthread_cleanup_pop_restore_np () +pops the top-most clean-up handler from the thread's +stack of cancellation clean-up handlers. +In addition, it restores the thread's cancelability +type to its value at the time of the matching +.BR pthread_cleanup_push_defer_np (). + +The caller must ensure that calls to these +functions are paired within the same function, +and at the same lexical nesting level. +Other restrictions apply, as described in +.BR pthread_cleanup_push (3). + +This sequence of calls: + +.in +4n +.nf +pthread_cleanup_push_defer_np(routine, arg); +pthread_cleanup_pop_restore_np(execute); +.fi +.in + +is equivalent to (but shorter and more efficient than): + +.\" As far as I can see, LinuxThreads reverses the two substeps +.\" in the push and pop below. +.in +4n +.nf +int oldtype; + +pthread_cleanup_push(routine, arg); +pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype); +\&... +pthread_setcanceltype(oldtype, NULL); +pthread_cleanup_pop(execute); +.fi +.in +.\" SH VERSIONS +.\" Available since glibc 2.0 +.SH CONFORMING TO +These functions are nonstandard GNU extensions; +hence the suffix "_np" (nonportable) in the names. +.SH SEE ALSO +.BR pthread_cancel (3), +.BR pthread_cleanup_push (3), +.BR pthread_setcancelstate (3), +.BR pthread_testcancel (3), +.BR pthreads (7) diff --git a/original/man3/pthread_create.3 b/original/man3/pthread_create.3 new file mode 100644 index 00000000..72647694 --- /dev/null +++ b/original/man3/pthread_create.3 @@ -0,0 +1,377 @@ +.\" 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. +.\" +.TH PTHREAD_CREATE 3 2008-11-11 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_create \- create a new thread +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_create(pthread_t *" thread ", const pthread_attr_t *" attr , +.BI " void *(*" start_routine ") (void *), void *" arg ); +.fi +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_create () +function starts a new thread in the calling process. +The new thread starts execution by invoking +.IR start_routine (); +.IR arg +is passed as the sole argument of +.IR start_routine (). + +The new thread terminates in one of the following ways: +.IP * 2 +It calls +.BR pthread_exit (3), +specifying an exit status value that is available to another thread +in the same process that calls +.BR pthread_join (3). +.IP * +It returns from +.IR start_routine (). +This is equivalent to calling +.BR pthread_exit (3) +with the value supplied in the +.I return +statement. +.IP * +It is canceled (see +.BR pthread_cancel (3)). +.IP * +Any of the threads in the process calls +.BR exit (3), +or the main thread performs a return from +.IR main (). +This causes the termination of all threads in the process. +.PP +The +.I attr +argument points to a +.I pthread_attr_t +structure whose contents are used at thread creation time to +determine attributes for the new thread; +this structure is initialized using +.BR pthread_attr_init (3) +and related functions. +If +.I attr +is NULL, +then the thread is created with default attributes. + +Before returning, a successful call to +.BR pthread_create () +stores the ID of the new thread in the buffer pointed to by +.IR thread ; +this identifier is used to refer to the thread +in subsequent calls to other pthreads functions. + +The new thread inherits a copy of the creating thread's signal mask +.RB ( pthread_sigmask (3)). +The set of pending signals for the new thread is empty +.RB ( sigpending (2)). +The new thread does not inherit the creating thread's +alternate signal stack +.RB ( sigaltstack (2)). + +The new thread inherits the calling thread's floating-point environment +.RB ( fenv (3)). + +The initial value of the new thread's CPU-time clock is 0 +(see +.BR pthread_getcpuclockid (3)). +.\" CLOCK_THREAD_CPUTIME_ID in clock_gettime(2) +.SS Linux-specific details +The new thread inherits copies of the calling thread's capability sets +(see +.BR capabilities (7)) +and CPU affinity mask (see +.BR sched_setaffinity (2)). +.SH RETURN VALUE +On success, +.BR pthread_create () +returns 0; +on error, it returns an error number, and the contents of +.IR *thread +are undefined. +.SH ERRORS +.TP +.B EAGAIN +Insufficient resources to create another thread, +or a system-imposed limit on the number of threads was encountered. +The latter case may occur in two ways: +the +.BR RLIMIT_NPROC +soft resource limit (set via +.BR setrlimit (2)), +which limits the number of process for a real user ID, +was reached; +or the kernel's system-wide limit on the number of threads, +.IR /proc/sys/kernel/threads-max , +was reached. +.TP +.B EINVAL +Invalid settings in +.IR attr . +.TP +.\" FIXME . Test the following +.B EPERM +No permission to set the scheduling policy and parameters specified in +.IR attr . +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +See +.BR pthread_self (3) +for further information on the thread ID returned in +.IR *thread +by +.BR pthread_create (). +Unless real-time scheduling policies are being employed, +after a call to +.BR pthread_create (), +it is indeterminate which thread\(emthe caller or the new thread\(emwill +next execute. + +A thread may either be +.I joinable +or +.IR detached . +If a thread is joinable, then another thread can call +.BR pthread_join (3) +to wait for the thread to terminate and fetch its exit status. +Only when a terminated joinable thread has been joined are +the last of its resources released back to the system. +When a detached thread terminates, +its resources are automatically released back to the system: +it is not possible to join with the thread in order to obtain +its exit status. +Making a thread detached is useful for some types of daemon threads +whose exit status the application does not need to care about. +By default, a new thread is created in a joinable state, unless +.I attr +was set to create the thread in a detached state (using +.BR pthread_attr_setdetachstate (3)). + +.\" FIXME . Perhaps some of the following detail should be in +.\" a future pthread_attr_setstacksize(3) page. +On Linux/x86-32, the default stack size for a new thread is 2 megabytes. +Under the NPTL threading implementation, if the +.BR RLIMIT_STACK +soft resource limit +.IR "at the time the program started" +has any value other than "unlimited", +then it determines the default stack size of new threads. +Using +.BR pthread_attr_setstacksize (3), +the stack size attribute can be explicitly set in the +.I attr +argument used to create a thread, +in order to obtain a stack size other than the default. +.SH EXAMPLE +The program below demonstrates the use of +.BR pthread_create (), +as well as a number of other functions in the pthreads API. + +In the following run, +on a system providing the NPTL threading implementation, +the stack size defaults to the value given by the +"stack size" resource limit: + +.in +4n +.nf +.RB "$" " ulimit \-s" +8192 # The stack size limit is 8 MB (0x80000 bytes) +.RB "$" " ./a.out hola salut servus" +Thread 1: top of stack near 0xb7dd03b8; argv_string=hola +Thread 2: top of stack near 0xb75cf3b8; argv_string=salut +Thread 3: top of stack near 0xb6dce3b8; argv_string=servus +Joined with thread 1; returned value was HOLA +Joined with thread 2; returned value was SALUT +Joined with thread 3; returned value was SERVUS +.fi +.in + +In the next run, the program explicitly sets a stack size of 1MB (using +.BR pthread_attr_setstacksize (3)) +for the created threads: + +.in +4n +.nf +.RB "$" " ./a.out \-s 0x100000 hola salut servus" +Thread 1: top of stack near 0xb7d723b8; argv_string=hola +Thread 2: top of stack near 0xb7c713b8; argv_string=salut +Thread 3: top of stack near 0xb7b703b8; argv_string=servus +Joined with thread 1; returned value was HOLA +Joined with thread 2; returned value was SALUT +Joined with thread 3; returned value was SERVUS +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include +#include +#include +#include +#include + +#define handle_error_en(en, msg) \\ + do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0) + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +struct thread_info { /* Used as argument to thread_start() */ + pthread_t thread_id; /* ID returned by pthread_create() */ + int thread_num; /* Application\-defined thread # */ + char *argv_string; /* From command\-line argument */ +}; + +/* Thread start function: display address near top of our stack, + and return upper\-cased copy of argv_string */ + +static void * +thread_start(void *arg) +{ + struct thread_info *tinfo = (struct thread_info *) arg; + char *uargv, *p; + + printf("Thread %d: top of stack near %p; argv_string=%s\\n", + tinfo\->thread_num, &p, tinfo->argv_string); + + uargv = strdup(tinfo\->argv_string); + if (uargv == NULL) + handle_error("strdup"); + + for (p = uargv; *p != \(aq\\0\(aq; p++) + *p = toupper(*p); + + return uargv; +} + +int +main(int argc, char *argv[]) +{ + int s, tnum, opt, num_threads; + struct thread_info *tinfo; + pthread_attr_t attr; + int stack_size; + void *res; + + /* The "\-s" option specifies a stack size for our threads */ + + stack_size = \-1; + while ((opt = getopt(argc, argv, "s:")) != \-1) { + switch (opt) { + case \(aqs\(aq: + stack_size = strtoul(optarg, NULL, 0); + break; + + default: + fprintf(stderr, "Usage: %s [\-s stack-size] arg...\\n", + argv[0]); + exit(EXIT_FAILURE); + } + } + + num_threads = argc \- optind; + + /* Initialize thread creation attributes */ + + s = pthread_attr_init(&attr); + if (s != 0) + handle_error_en(s, "pthread_attr_init"); + + if (stack_size > 0) { + s = pthread_attr_setstacksize(&attr, stack_size); + if (s != 0) + handle_error_en(s, "pthread_attr_setstacksize"); + } + + /* Allocate memory for pthread_create() arguments */ + + tinfo = calloc(num_threads, sizeof(struct thread_info)); + if (tinfo == NULL) + handle_error("calloc"); + + /* Create one thread for each command\-line argument */ + + for (tnum = 0; tnum < num_threads; tnum++) { + tinfo[tnum].thread_num = tnum + 1; + tinfo[tnum].argv_string = argv[optind + tnum]; + + /* The pthread_create() call stores the thread ID into + corresponding element of tinfo[] */ + + s = pthread_create(&tinfo[tnum].thread_id, &attr, + &thread_start, &tinfo[tnum]); + if (s != 0) + handle_error_en(s, "pthread_create"); + } + + /* Destroy the thread attributes object, since it is no + longer needed */ + + s = pthread_attr_destroy(&attr); + if (s != 0) + handle_error_en(s, "pthread_attr_destroy"); + + /* Now join with each thread, and display its returned value */ + + for (tnum = 0; tnum < num_threads; tnum++) { + s = pthread_join(tinfo[tnum].thread_id, &res); + if (s != 0) + handle_error_en(s, "pthread_join"); + + printf("Joined with thread %d; returned value was %s\\n", + tinfo[tnum].thread_num, (char *) res); + free(res); /* Free memory allocated by thread */ + } + + free(tinfo); + exit(EXIT_SUCCESS); +} +.fi +.SH BUGS +In the obsolete LinuxThreads implementation, +each of the threads in a process has a different process ID. +This is in violation of the POSIX threads specification, +and is the source of many other nonconformances to the standard; see +.BR pthreads (7). +.SH SEE ALSO +.BR getrlimit (2), +.BR pthread_attr_init (3), +.BR pthread_cancel (3), +.BR pthread_detach (3), +.BR pthread_equal (3), +.BR pthread_exit (3), +.BR pthread_getattr_np (3), +.BR pthread_join (3), +.BR pthread_self (3), +.BR pthreads (7) diff --git a/original/man3/pthread_detach.3 b/original/man3/pthread_detach.3 new file mode 100644 index 00000000..be6256d7 --- /dev/null +++ b/original/man3/pthread_detach.3 @@ -0,0 +1,101 @@ +.\" 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. +.\" +.TH PTHREAD_DETACH 3 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_detach \- detach a thread +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_detach(pthread_t " thread ); +.fi +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_detach () +function marks the thread identified by +.IR thread +as detached. +When a detached thread terminates, +its resources are automatically released back to the system without +the need for another thread to join with the terminated thread. + +Attempting to detach an already detached thread results +in unspecified behavior. +.SH RETURN VALUE +On success, +.BR pthread_detach () +returns 0; +on error, it returns an error number. +.SH ERRORS +.TP +.B EINVAL +.I thread +is not a joinable thread. +.TP +.B ESRCH +No thread with the ID +.I thread +could be found. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +Once a thread has been detached, it can't be joined with +.BR pthread_join (3) +or be made joinable again. + +A new thread can be created in a detached state using +.BR pthread_attr_setdetachstate (3) +to set the detached attribute of the +.I attr +argument of +.BR pthread_create (3). + +The detached attribute merely determines the behavior of the system +when the thread terminates; +it does not prevent the thread from being terminated +if the process terminates using +.BR exit (3) +(or equivalently, if the main thread returns). + +Either +.BR pthread_join (3) +or +.BR pthread_detach () +should be called for each thread that an application creates, +so that system resources for the thread can be released. +(But note that the resources of all threads are freed when the +process terminates.) +.SH EXAMPLE +The following statement detaches the calling thread: + + pthread_detach(pthread_self()); +.SH SEE ALSO +.BR pthread_attr_setdetachstate (3), +.BR pthread_cancel (3), +.BR pthread_create (3), +.BR pthread_exit (3), +.BR pthread_join (3), +.BR pthreads (7) diff --git a/original/man3/pthread_equal.3 b/original/man3/pthread_equal.3 new file mode 100644 index 00000000..b8efa20d --- /dev/null +++ b/original/man3/pthread_equal.3 @@ -0,0 +1,56 @@ +.\" 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. +.\" +.TH PTHREAD_EQUAL 3 2009-03-30 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_equal \- compare thread IDs +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_equal(pthread_t " t1 ", pthread_t " t2 ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_equal () +function compares two thread identifiers. +.SH RETURN VALUE +If the two thread IDs are equal, +.BR pthread_equal () +returns a nonzero value; otherwise, it returns 0. +.SH ERRORS +This function always succeeds. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +The +.BR pthread_equal () +function is necessary because thread IDs should be considered opaque: +there is no portable way for applications to directly compare two +.I pthread_t +values. +.SH SEE ALSO +.BR pthread_create (3), +.BR pthread_self (3), +.BR pthreads (7) diff --git a/original/man3/pthread_exit.3 b/original/man3/pthread_exit.3 new file mode 100644 index 00000000..8991acd1 --- /dev/null +++ b/original/man3/pthread_exit.3 @@ -0,0 +1,105 @@ +.\" 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. +.\" +.TH PTHREAD_EXIT 3 2009-03-30 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_exit \- terminate calling thread +.SH SYNOPSIS +.nf +.B #include + +.BI "void pthread_exit(void *" retval ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_exit () +function terminates the calling thread and returns a value via +.I retval +that (if the thread is joinable) +is available to another thread in the same process that calls +.BR pthread_join (3). + +Any clean-up handlers established by +.BR pthread_cleanup_push (3) +that have not yet been popped, +are popped (in the reverse of the order in which they were pushed) +and executed. +If the thread has any thread-specific data, then, +after the clean-up handlers have been executed, +the corresponding destructor functions are called, +in an unspecified order. + +When a thread terminates, +process-shared resources (e.g., mutexes, condition variables, +semaphores, and file descriptors) are not released, +and functions registered using +.BR atexit (3) +are not called. + +After the last thread in a process terminates, +the process terminates as by calling +.BR exit (3) +with an exit status of zero; +thus, process-shared resources +are released and functions registered using +.BR atexit (3) +are called. +.SH RETURN VALUE +This function does not return to the caller. +.SH ERRORS +This function always succeeds. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +Performing a return from the start function of any thread other +than the main thread results in an implicit call to +.BR pthread_exit (), +using the function's return value as the thread's exit status. + +To allow other threads to continue execution, +the main thread should terminate by calling +.BR pthread_exit () +rather than +.BR exit (3). + +The value pointed to by +.IR retval +should not be located on the calling thread's stack, +since the contents of that stack are undefined after the thread terminates. +.SH BUGS +Currently, +.\" Linux 2.6.27 +there are limitations in the kernel implementation logic for +.BR wait (2)ing +on a stopped thread group with a dead thread group leader. +This can manifest in problems such as a locked terminal if a stop signal is +sent to a foreground process whose thread group leader has already called +.BR pthread_exit (3). +.\" FIXME . review a later kernel to see if this gets fixed +.\" http://thread.gmane.org/gmane.linux.kernel/611611 +.\" http://marc.info/?l=linux-kernel&m=122525468300823&w=2 +.SH SEE ALSO +.BR pthread_create (3), +.BR pthread_join (3), +.BR pthreads (7) diff --git a/original/man3/pthread_getaffinity_np.3 b/original/man3/pthread_getaffinity_np.3 new file mode 100644 index 00000000..c4cd6af7 --- /dev/null +++ b/original/man3/pthread_getaffinity_np.3 @@ -0,0 +1 @@ +.so man3/pthread_setaffinity_np.3 diff --git a/original/man3/pthread_getattr_np.3 b/original/man3/pthread_getattr_np.3 new file mode 100644 index 00000000..f89172ae --- /dev/null +++ b/original/man3/pthread_getattr_np.3 @@ -0,0 +1,355 @@ +.\" 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. +.\" +.TH PTHREAD_GETATTR_NP 3 2008-11-11 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_getattr_np \- get attributes of created thread +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "int pthread_getattr_np(pthread_t " thread ", pthread_attr_t *" attr ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_getattr_np () +function initializes the thread attributes object referred to by +.I attr +so that it contains actual attribute values describing the running thread +.IR thread . + +The returned attribute values may differ from +the corresponding attribute values passed in the +.I attr +object that was used to create the thread using +.BR pthread_create (3). +In particular, the following attributes may differ: +.IP * 2 +the detach state, since a joinable thread may have detached itself +after creation; +.IP * +the stack size, +which the implementation may align to a suitable boundary. +.IP * +and the guard size, +which the implementation may round upwards to a multiple of the page size, +or ignore (i.e., treat as 0), +if the application is allocating its own stack. +.PP +Furthermore, if the stack address attribute was not set +in the thread attributes object used to create the thread, +then the returned thread attributes object will report the actual +stack address that the implementation selected for the thread. + +When the thread attributes object returned by +.BR pthread_getattr_np () +is no longer required, it should be destroyed using +.BR pthread_attr_destroy (3). +.SH RETURN VALUE +On success, this function returns 0; +on error, it returns a nonzero error number. +.SH ERRORS +.TP +.B ENOMEM +.\" Can happen (but unlikely) while trying to allocate memory for cpuset +Insufficient memory. +.PP +In addition, if +.I thread +refers to the main thread, then +.BR pthread_getattr_np () +can fail because of errors from various underlying calls: +.BR fopen (3), +if +.IR /proc/self/maps +can't be opened; +and +.BR getrlimit (2), +if the +.BR RLIMIT_STACK +resource limit is not supported. +.SH VERSIONS +This function is available in glibc since version 2.2.3. +.SH CONFORMING TO +This function is a nonstandard GNU extension. +hence the suffix "_np" (nonportable) in the name. +.SH EXAMPLE +The program below demonstrates the use of +.BR pthread_getattr_np (). +The program creates a thread that then uses +.BR pthread_getattr_np () +to retrieve and display its guard size, stack address, +and stack size attributes. +Command-line arguments can be used to set these attributes +to values other than the default when creating the thread. +The shell sessions below demonstrate the use of the program. + +In the first run, on an x86-32 system, +a thread is created using default attributes: + +.in +4n +.nf +.RB "$" " ulimit \-s" " # No stack limit ==> default stack size is 2MB" +unlimited +.RB "$" " ./a.out" +Attributes of created thread: + Guard size = 4096 bytes + Stack address = 0x40196000 (EOS = 0x40397000) + Stack size = 0x201000 (2101248) bytes +.fi +.in + +In the following run, we see that if a guard size is specified, +it is rounded up to the next multiple of the system page size +(4096 bytes on x86-32): + +.in +4n +.nf +.RB "$" " ./a.out \-g 4097" +Thread attributes object after initializations: + Guard size = 4097 bytes + Stack address = (nil) + Stack size = 0x0 (0) bytes + +Attributes of created thread: + Guard size = 8192 bytes + Stack address = 0x40196000 (EOS = 0x40397000) + Stack size = 0x201000 (2101248) bytes +.fi +.in +.\".in +4n +.\".nf +.\"$ ./a.out \-s 0x8000 +.\"Thread attributes object after initializations: +.\" Guard size = 4096 bytes +.\" Stack address = 0xffff8000 (EOS = (nil)) +.\" Stack size = 0x8000 (32768) bytes +.\" +.\"Attributes of created thread: +.\" Guard size = 4096 bytes +.\" Stack address = 0x4001e000 (EOS = 0x40026000) +.\" Stack size = 0x8000 (32768) bytes +.\".fi +.\".in + +In the last run, the program manually allocates a stack for the thread. +In this case, the guard size attribute is ignored. + +.in +4n +.nf +.RB "$" " ./a.out \-g 4096 \-s 0x8000 \-a" +Allocated thread stack at 0x804d000 + +Thread attributes object after initializations: + Guard size = 4096 bytes + Stack address = 0x804d000 (EOS = 0x8055000) + Stack size = 0x8000 (32768) bytes + +Attributes of created thread: + Guard size = 0 bytes + Stack address = 0x804d000 (EOS = 0x8055000) + Stack size = 0x8000 (32768) bytes +.fi +.in +.SS Program source +\& +.nf +#define _GNU_SOURCE /* To get pthread_getattr_np() declaration */ +#include +#include +#include +#include +#include + +#define handle_error_en(en, msg) \\ + do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0) + +static void +display_stack_related_attributes(pthread_attr_t *attr, char *prefix) +{ + int s; + size_t stack_size, guard_size; + void *stack_addr; + + s = pthread_attr_getguardsize(attr, &guard_size); + if (s != 0) + handle_error_en(s, "pthread_attr_getguardsize"); + printf("%sGuard size = %d bytes\\n", prefix, guard_size); + + s = pthread_attr_getstack(attr, &stack_addr, &stack_size); + if (s != 0) + handle_error_en(s, "pthread_attr_getstack"); + printf("%sStack address = %p", prefix, stack_addr); + if (stack_size > 0) + printf(" (EOS = %p)", (char *) stack_addr + stack_size); + printf("\\n"); + printf("%sStack size = 0x%x (%d) bytes\\n", + prefix, stack_size, stack_size); +} + +static void +display_thread_attributes(pthread_t thread, char *prefix) +{ + int s; + pthread_attr_t attr; + + s = pthread_getattr_np(thread, &attr); + if (s != 0) + handle_error_en(s, "pthread_getattr_np"); + + display_stack_related_attributes(&attr, prefix); + + s = pthread_attr_destroy(&attr); + if (s != 0) + handle_error_en(s, "pthread_attr_destroy"); +} + +static void * /* Start function for thread we create */ +thread_start(void *arg) +{ + printf("Attributes of created thread:\\n"); + display_thread_attributes(pthread_self(), "\\t"); + + exit(EXIT_SUCCESS); /* Terminate all threads */ +} + +static void +usage(char *pname, char *msg) +{ + if (msg != NULL) + fputs(msg, stderr); + fprintf(stderr, "Usage: %s [\-s stack-size [-a]]" + " [\-g guard-size]\\n", pname); + fprintf(stderr, "\\t\\t\-a means program should allocate stack\\n"); + exit(EXIT_FAILURE); +} + +static pthread_attr_t * /* Get thread attributes from command line */ +get_thread_attributes_from_cl(int argc, char *argv[], + pthread_attr_t *attrp) +{ + int s, opt, allocate_stack; + long stack_size, guard_size; + void *stack_addr; + pthread_attr_t *ret_attrp = NULL; /* Set to attrp if we initialize + a thread attributes object */ + allocate_stack = 0; + stack_size = \-1; + guard_size = \-1; + + while ((opt = getopt(argc, argv, "ag:s:")) != \-1) { + switch (opt) { + case \(aqa\(aq: allocate_stack = 1; break; + case \(aqg\(aq: guard_size = strtoul(optarg, NULL, 0); break; + case \(aqs\(aq: stack_size = strtoul(optarg, NULL, 0); break; + default: usage(argv[0], NULL); + } + } + + if (allocate_stack && stack_size == \-1) + usage(argv[0], "Specifying \-a without -s makes no sense\\n"); + + if (argc > optind) + usage(argv[0], "Extraneous command\-line arguments\\n"); + + if (stack_size >= 0 || guard_size > 0) { + ret_attrp = attrp; + + s = pthread_attr_init(attrp); + if (s != 0) + handle_error_en(s, "pthread_attr_init"); + } + + if (stack_size >= 0) { + if (!allocate_stack) { + s = pthread_attr_setstacksize(attrp, stack_size); + if (s != 0) + handle_error_en(s, "pthread_attr_setstacksize"); + } else { + s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE), + stack_size); + if (s != 0) + handle_error_en(s, "posix_memalign"); + printf("Allocated thread stack at %p\\n\\n", stack_addr); + + s = pthread_attr_setstack(attrp, stack_addr, stack_size); + if (s != 0) + handle_error_en(s, "pthread_attr_setstacksize"); + } + } + + if (guard_size >= 0) { + s = pthread_attr_setguardsize(attrp, guard_size); + if (s != 0) + handle_error_en(s, "pthread_attr_setstacksize"); + } + + return ret_attrp; +} + +int +main(int argc, char *argv[]) +{ + int s; + pthread_t thr; + pthread_attr_t attr; + pthread_attr_t *attrp = NULL; /* Set to &attr if we initialize + a thread attributes object */ + + attrp = get_thread_attributes_from_cl(argc, argv, &attr); + + if (attrp != NULL) { + printf("Thread attributes object after initializations:\\n"); + display_stack_related_attributes(attrp, "\\t"); + printf("\\n"); + } + + s = pthread_create(&thr, attrp, &thread_start, NULL); + if (s != 0) + handle_error_en(s, "pthread_create"); + + if (attrp != NULL) { + s = pthread_attr_destroy(attrp); + if (s != 0) + handle_error_en(s, "pthread_attr_destroy"); + } + + pause(); /* Terminates when other thread calls exit() */ +} +.fi +.SH SEE ALSO +.BR pthread_attr_getaffinity_np (3), +.BR pthread_attr_getdetachstate (3), +.BR pthread_attr_getguardsize (3), +.BR pthread_attr_getinheritsched (3), +.BR pthread_attr_getschedparam (3), +.BR pthread_attr_getschedpolicy (3), +.BR pthread_attr_getscope (3), +.BR pthread_attr_getstack (3), +.BR pthread_attr_getstackaddr (3), +.BR pthread_attr_getstacksize (3), +.BR pthread_attr_init (3), +.BR pthread_create (3), +.BR pthreads (7) diff --git a/original/man3/pthread_getconcurrency.3 b/original/man3/pthread_getconcurrency.3 new file mode 100644 index 00000000..8b2d5439 --- /dev/null +++ b/original/man3/pthread_getconcurrency.3 @@ -0,0 +1 @@ +.so man3/pthread_setconcurrency.3 diff --git a/original/man3/pthread_getcpuclockid.3 b/original/man3/pthread_getcpuclockid.3 new file mode 100644 index 00000000..de03fe50 --- /dev/null +++ b/original/man3/pthread_getcpuclockid.3 @@ -0,0 +1,173 @@ +.\" 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. +.\" +.TH PTHREAD_GETCPUCLOCKID 3 2009-02-08 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_getcpuclockid \- retrieve ID of a thread's CPU time clock +.SH SYNOPSIS +.nf +.B #include +.B #include + +.BI "int pthread_getcpuclockid(pthread_t " thread ", clockid_t *" clock_id); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_getcpuclockid () +function returns the clock ID for the CPU time clock of the thread +.IR thread . +.\" The clockid is constructed as follows: +.\" *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE) +.\" where CLOCK_IDFIELD_SIZE is 3. +.SH RETURN VALUE +On success, this function returns 0; +on error, it returns a nonzero error number. +.SH ERRORS +.TP +.B ENOENT +.\" CLOCK_THREAD_CPUTIME_ID not defined +Per-thread CPU time clocks are not supported by the system. +.\" +.\" Looking at nptl/pthread_getcpuclockid.c an ERANGE error would +.\" be possible if kernel thread IDs took more than 29 bits (which +.\" they currently cannot). +.TP +.B ESRCH +No thread with the ID +.I thread +could be found. +.SH VERSIONS +This function is available in glibc since version 2.2. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +When +.I thread +refers to the calling thread, +this function returns an identifier that refers to the same clock +manipulated by +.BR clock_gettime (2) +and +.BR clock_settime (2) +when given the clock ID +.BR CLOCK_THREAD_CPUTIME_ID . +.SH EXAMPLE +The program below creates a thread and then uses +.BR clock_gettime (2) +to retrieve the total process CPU time, +and the per-thread CPU time consumed by the two threads. +The following shell session shows an example run: +.in +4n +.nf +$ \fB./a.out\fP +Main thread sleeping +Subthread starting infinite loop +Main thread consuming some CPU time... +Process total CPU time: 1.368 +Main thread CPU time: 0.376 +Subthread CPU time: 0.992 +.fi +.in +.SS Program source +\& +.nf +/* Link with "-lrt" */ + +#include +#include +#include +#include +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +#define handle_error_en(en, msg) \\ + do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0) + +static void * +thread_start(void *arg) +{ + printf("Subthread starting infinite loop\\n"); + for (;;) + continue; +} + +static void +pclock(char *msg, clockid_t cid) +{ + struct timespec ts; + + printf("%s", msg); + if (clock_gettime(cid, &ts) == \-1) + handle_error("clock_gettime"); + printf("%4ld.%03ld\\n", ts.tv_sec, ts.tv_nsec / 1000000); +} + +int +main(int argc, char *argv[]) +{ + pthread_t thread; + clockid_t cid; + int j, s; + + s = pthread_create(&thread, NULL, thread_start, NULL); + if (s != 0) + handle_error_en(s, "pthread_create"); + + printf("Main thread sleeping\\n"); + sleep(1); + + printf("Main thread consuming some CPU time...\\n"); + for (j = 0; j < 2000000; j++) + getppid(); + + pclock("Process total CPU time: ", CLOCK_PROCESS_CPUTIME_ID); + + s = pthread_getcpuclockid(pthread_self(), &cid); + if (s != 0) + handle_error_en(s, "pthread_getcpuclockid"); + pclock("Main thread CPU time: ", cid); + + /* The preceding 4 lines of code could have been replaced by: + pclock("Main thread CPU time: ", CLOCK_THREAD_CPUTIME_ID); */ + + s = pthread_getcpuclockid(thread, &cid); + if (s != 0) + handle_error_en(s, "pthread_getcpuclockid"); + pclock("Subthread CPU time: 1 ", cid); + + exit(EXIT_SUCCESS); /* Terminates both threads */ +} +.fi +.SH SEE ALSO +.BR clock_gettime (2), +.BR clock_settime (2), +.BR timer_create (2), +.BR clock_getcpuclockid (3), +.BR pthread_self (3), +.BR pthreads (7), +.BR time (7) diff --git a/original/man3/pthread_getschedparam.3 b/original/man3/pthread_getschedparam.3 new file mode 100644 index 00000000..67299c57 --- /dev/null +++ b/original/man3/pthread_getschedparam.3 @@ -0,0 +1 @@ +.so man3/pthread_setschedparam.3 diff --git a/original/man3/pthread_join.3 b/original/man3/pthread_join.3 new file mode 100644 index 00000000..bda80114 --- /dev/null +++ b/original/man3/pthread_join.3 @@ -0,0 +1,131 @@ +.\" 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. +.\" +.TH PTHREAD_JOIN 3 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_join \- join with a terminated thread +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_join(pthread_t " thread ", void **" retval ); +.fi +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_join () +function waits for the thread specified by +.IR thread +to terminate. +If that thread has already terminated, then +.BR pthread_join () +returns immediately. +The thread specified by +.I thread +must be joinable. + +If +.I retval +is not NULL, then +.BR pthread_join () +copies the exit status of the target thread +(i.e., the value that the target thread supplied to +.BR pthread_exit (3)) +into the location pointed to by +.IR *retval . +If the target thread was canceled, then +.B PTHREAD_CANCELED +is placed in +.IR *retval . + +If multiple threads simultaneously try to join with the same thread, +the results are undefined. +If the thread calling +.BR pthread_join () +is canceled, then the target thread will remain joinable +(i.e., it will not be detached). +.SH RETURN VALUE +On success, +.BR pthread_join () +returns 0; +on error, it returns an error number. +.SH ERRORS +.TP +.B EDEADLK +A deadlock was detected +.\" The following verified by testing on glibc 2.8/NPTL: +(e.g., two threads tried to join with each other); +or +.\" The following verified by testing on glibc 2.8/NPTL: +.I thread +specifies the calling thread. +.TP +.B EINVAL +.I thread +is not a joinable thread. +.TP +.B EINVAL +Another thread is already waiting to join with this thread. +.\" POSIX.1-2001 does not specify this error case. +.TP +.B ESRCH +No thread with the ID +.I thread +could be found. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +After a successful call to +.BR pthread_join (), +the caller is guaranteed that the target thread has terminated. + +Joining with a thread that has previously been joined results in +undefined behavior. + +Failure to join with a thread that is joinable +(i.e., one that is not detached), +produces a "zombie thread". +Avoid doing this, +since each zombie thread consumes some system resources, +and when enough zombie threads have accumulated, +it will no longer be possible to create new threads (or processes). + +There is no pthreads analog of +.IR "waitpid(-1,\ &status,\ 0)" , +that is, "join with any terminated thread". +If you believe you need this functionality, +you probably need to rethink your application design. + +All of the threads in a process are peers: +any thread can join with any other thread in the process. +.SH EXAMPLE +See +.BR pthread_create (3). +.SH SEE ALSO +.BR pthread_cancel (3), +.BR pthread_create (3), +.BR pthread_detach (3), +.BR pthread_exit (3), +.BR pthread_tryjoin_np (3), +.BR pthreads (7) diff --git a/original/man3/pthread_kill.3 b/original/man3/pthread_kill.3 new file mode 100644 index 00000000..7b04d9d2 --- /dev/null +++ b/original/man3/pthread_kill.3 @@ -0,0 +1,81 @@ +.\" 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. +.\" +.TH PTHREAD_KILL 3 2009-01-28 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_kill \- send a signal to a thread +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_kill(pthread_t " thread ", int " sig ); +.fi +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_kill () +function sends the signal +.I sig +to +.IR thread , +another thread in the same process as the caller. +The signal is asynchronously directed to +.IR thread . + +If +.I sig +is 0, then no signal is sent, but error checking is still performed; +this can be used to check for the existence of a thread ID. +.SH RETURN VALUE +On success, +.BR pthread_kill () +returns 0; +on error, it returns an error number, and no signal is sent. +.SH ERRORS +.TP +.B ESRCH +No thread with the ID +.I thread +could be found. +.TP +.B EINVAL +An invalid signal was specified. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +Signal dispositions are process-wide: +if a signal handler is installed, +the handler will be invoked in the thread +.IR thread , +but if the disposition of the signal is "stop", "continue", or "terminate", +this action will affect the whole process. +.SH SEE ALSO +.BR kill (2) +.BR sigaction (2), +.BR sigpending (2), +.BR pthread_self (3), +.BR pthread_sigmask (3), +.BR raise (3), +.BR pthreads (7), +.BR signal (7) diff --git a/original/man3/pthread_kill_other_threads_np.3 b/original/man3/pthread_kill_other_threads_np.3 new file mode 100644 index 00000000..c96b91d0 --- /dev/null +++ b/original/man3/pthread_kill_other_threads_np.3 @@ -0,0 +1,68 @@ +.\" 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. +.\" +.TH PTHREAD_KILL_OTHER_THREADS_NP 3 2009-01-28 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_kill_other_threads_np \- terminate all other threads in process +.SH SYNOPSIS +.nf +.B #include + +.B void pthread_kill_other_threads_np(void); +.fi +.SH DESCRIPTION +.BR pthread_kill_other_threads_np () +only has an effect in the LinuxThreads threading implementation. +On that implementation, +calling this function causes the immediate termination of +all threads in the application, +except the calling thread. +The cancellation state and cancellation type of the +to-be-terminated threads are ignored, +and the cleanup handlers are not called in those threads. +.\" .SH VERSIONS +.\" Available since glibc 2.0 +.SH CONFORMING TO +This function is a nonstandard GNU extension. +.SH NOTES +.BR pthread_kill_other_threads_np () +is intended to be called just before a thread calls +.BR execve (2) +or a similar function. +This function is designed to address a limitation in the obsolete +LinuxThreads implementation whereby the other threads of an application +are not automatically terminated (as POSIX.1-2001 requires) during +.BR execve (2). + +In the NPTL threading implementation, +.BR pthread_kill_other_threads_np () +exists, but does nothing. +(Nothing needs to be done, +because the implementation does the right thing during an +.BR execve (2).) +.SH "SEE ALSO" +.BR execve (2), +.BR pthread_setcancelstate (3), +.BR pthread_setcanceltype (3), +.BR pthread_cancel (3), +.BR pthreads (7) diff --git a/original/man3/pthread_self.3 b/original/man3/pthread_self.3 new file mode 100644 index 00000000..ce026e3a --- /dev/null +++ b/original/man3/pthread_self.3 @@ -0,0 +1,76 @@ +.\" 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. +.\" +.TH PTHREAD_SELF 3 2008-10-24 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_self \- obtain ID of the calling thread +.SH SYNOPSIS +.nf +.B #include + +.B pthread_t pthread_self(void); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_self () +function returns the ID of the calling thread. +This is the same value that is returned in +.IR *thread +in the +.BR pthread_create (3) +call that created this thread. +.SH RETURN VALUE +This function always succeeds, returning the calling thread's ID. +.SH ERRORS +This function always succeeds. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +POSIX.1 allows an implementation wide freedom in choosing +the type used to represent a thread ID; +for example, representation using either an arithmetic type or +a structure is permitted. +Therefore, variables of type +.I pthread_t +can't portably be compared using the C equality operator (\fB==\fP); +use +.BR pthread_equal (3) +instead. + +Thread identifiers should be considered opaque: +any attempt to use a thread ID other than in pthreads calls +is nonportable and can lead to unspecified results. + +Thread IDs are only guaranteed to be unique within a process. +A thread ID may be reused after a terminated thread has been joined, +or a detached thread has terminated. + +The thread ID returned by +.BR pthread_self () +is not the same thing as the kernel thread ID returned by a call to +.BR gettid (2). +.SH SEE ALSO +.BR pthread_create (3), +.BR pthread_equal (3), +.BR pthreads (7) diff --git a/original/man3/pthread_setaffinity_np.3 b/original/man3/pthread_setaffinity_np.3 new file mode 100644 index 00000000..6f3e4881 --- /dev/null +++ b/original/man3/pthread_setaffinity_np.3 @@ -0,0 +1,210 @@ +.\" 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. +.\" +.TH PTHREAD_SETAFFINITY_NP 3 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_setaffinity_np, pthread_getaffinity_np \- set/get +CPU affinity of a thread +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "int pthread_setaffinity_np(pthread_t " thread ", size_t " cpusetsize , +.BI " const cpu_set_t *" cpuset ); +.BI "int pthread_getaffinity_np(pthread_t " thread ", size_t " cpusetsize , +.BI " cpu_set_t *" cpuset ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_setaffinity_np () +function +sets the CPU affinity mask of the thread +.I thread +to the CPU set pointed to by +.IR cpuset . +If the call is successful, +and the thread is not currently running on one of the CPUs in +.IR cpuset , +then it is migrated to one of those CPUs. + +The +.BR pthread_getaffinity_np () +function returns the CPU affinity mask of the thread +.I thread +in the buffer pointed to by +.IR cpuset . + +For more details on CPU affinity masks, see +.BR sched_setaffinity (2). +For a description of a set of macros +that can be used to manipulate and inspect CPU sets, see +.BR CPU_SET (3). + +The argument +.I cpusetsize +is the length (in bytes) of the buffer pointed to by +.IR cpuset . +Typically, this argument would be specified as +.IR sizeof(cpu_set_t) . +(It may be some other value, if using the macros described in +.BR CPU_SET (3) +for dynamically allocating a CPU set.) +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +.SH ERRORS +.TP +.B EFAULT +A supplied memory address was invalid. +.TP +.B EINVAL +.RB ( pthread_setaffinity_np ()) +The affinity bit mask +.I mask +contains no processors that are currently physically on the system +and permitted to the thread according to any restrictions that +may be imposed by the "cpuset" mechanism described in +.BR cpuset (7). +.TP +.BR EINVAL +.RB ( pthread_setaffinity_np ()) +.I cpuset +specified a CPU that was outside the set supported by the kernel. +(The kernel configuration option +.BR CONFIG_NR_CPUS +.\" FIXME . ? +.\" Loic Domaigne commented: it seems that in the future the +.\" kernel developers want to make cpumask-t dynamic, so +.\" CONFIG_NR_CPUS might become obsolete in the future. +defines the range of the set supported by the kernel data type +.\" cpumask_t +used to represent CPU sets.) +.\" The raw sched_getaffinity() system call returns the size (in bytes) +.\" of the cpumask_t type. +.TP +.B EINVAL +.RB ( pthread_getaffinity_np ()) +.I cpusetsize +is smaller than the size of the affinity mask used by the kernel. +.TP +.B ESRCH +No thread with the ID +.I thread +could be found. +.SH VERSIONS +These functions are provided by glibc since version 2.3.4. +.SH CONFORMING TO +These functions are nonstandard GNU extensions; +hence the suffix "_np" (nonportable) in the names. +.SH NOTES +After a call to +.BR pthread_setaffinity_np (), +the set of CPUs on which the thread will actually run is +the intersection of the set specified in the +.I cpuset +argument and the set of CPUs actually present on the system. +The system may further restrict the set of CPUs on which the thread +runs if the "cpuset" mechanism described in +.BR cpuset (7) +is being used. +These restrictions on the actual set of CPUs on which the thread +will run are silently imposed by the kernel. + +These functions are implemented on top of the +.BR sched_setaffinity (2) +and +.BR sched_getaffinity (2) +system calls. + +In glibc 2.3.3 only, +versions of these functions were provided that did not have a +.I cpusetsize +argument. +Instead the CPU set size given to the underlying system calls was always +.IR sizeof(cpu_set_t) . + +A new thread created by +.BR pthread_create () +inherits a copy of its creator's CPU affinity mask. +.SH EXAMPLE +In the following program, the main thread uses +.BR pthread_setaffinity_np () +to set its CPU affinity mask to include CPUs 0 to 7 +(which may not all be available on the system), +and then calls +.BR pthread_getaffinity_np () +to check the resulting CPU affinity mask of the thread. + +.nf +#define _GNU_SOURCE +#include +#include +#include +#include + +#define handle_error_en(en, msg) \\ + do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0) + +int +main(int argc, char *argv[]) +{ + int s, j; + cpu_set_t cpuset; + pthread_t thread; + + thread = pthread_self(); + + /* Set affinity mask to include CPUs 0 to 7 */ + + CPU_ZERO(&cpuset); + for (j = 0; j < 8; j++) + CPU_SET(j, &cpuset); + + s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset); + if (s != 0) + handle_error_en(s, "pthread_setaffinity_np"); + + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset); + if (s != 0) + handle_error_en(s, "pthread_getaffinity_np"); + + printf("Set returned by pthread_getaffinity_np() contained:\\n"); + for (j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + printf(" CPU %d\\n", j); + + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR sched_getcpu (3), +.BR sched_setaffinity (2), +.BR sched_setscheduler (2), +.BR pthread_attr_setaffinity_np (3), +.BR pthread_self (3), +.BR cpuset (7), +.BR pthreads (7) diff --git a/original/man3/pthread_setcancelstate.3 b/original/man3/pthread_setcancelstate.3 new file mode 100644 index 00000000..55b89f92 --- /dev/null +++ b/original/man3/pthread_setcancelstate.3 @@ -0,0 +1,178 @@ +.\" 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. +.\" +.TH PTHREAD_SETCANCELSTATE 3 2008-11-24 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_setcancelstate, pthread_setcanceltype \- +set cancelability state and type +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_setcancelstate(int " state ", int *" oldstate ); +.BI "int pthread_setcanceltype(int " type ", int *" oldtype ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_setcancelstate () +sets the cancelability state of the calling thread to the value +given in +.IR state . +The previous cancelability state of the thread is returned +in the buffer pointed to by +.IR oldstate . +The +.I state +argument must have one of the following values: +.TP +.B PTHREAD_CANCEL_ENABLE +The thread is cancelable. +This is the default cancelability state in all new threads, +including the initial thread. +The thread's cancelability type determines when a cancelable thread +will respond to a cancellation request. +.TP +.B PTHREAD_CANCEL_DISABLE +The thread is not cancelable. +If a cancellation request is received, +it is blocked until cancelability is enabled. +.PP +The +.BR pthread_setcanceltype () +sets the cancelability type of the calling thread to the value +given in +.IR type . +The previous cancelability type of the thread is returned +in the buffer pointed to by +.IR oldtype . +The +.I type +argument must have one of the following values: +.TP +.B PTHREAD_CANCEL_DEFERRED +A cancellation request is deferred until the thread next calls +a function that is a cancellation point (see +.BR pthreads (7)). +This is the default cancelability type in all new threads, +including the initial thread. +.TP +.B PTHREAD_CANCEL_ASYNCHRONOUS +The thread can be canceled at any time. +(Typically, +it will be canceled immediately upon receiving a cancellation request, +but the system doesn't guarantee this.) +.PP +The set-and-get operation performed by each of these functions +is atomic with respect to other threads in the process +calling the same function. +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +.SH ERRORS +The +.BR pthread_setcancelstate () +can fail with the following error: +.TP +.B EINVAL +Invalid value for +.IR state . +.PP +The +.BR pthread_setcanceltype () +can fail with the following error: +.TP +.B EINVAL +Invalid value for +.IR type . +.\" .SH VERSIONS +.\" Available since glibc 2.0 +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +For details of what happens when a thread is canceled, see +.BR pthread_cancel (3). + +Briefly disabling cancelability is useful +if a thread performs some critical action +that must not be interrupted by a cancellation request. +Beware of disabling cancelability for long periods, +or around operations that may block for long periods, +since that will render the thread unresponsive to cancellation requests. + +Setting the cancelability type to +.B PTHREAD_CANCEL_ASYNCHRONOUS +is rarely useful. +Since the thread could be canceled at +.I any +time, it cannot safely reserve resources (e.g., allocating memory with +.BR malloc (3)), +acquire mutexes, semaphores, or locks, and so on. +Reserving resources is unsafe because the application has no way of +knowing what the state of these resources is when the thread is canceled; +that is, did cancellation occur before the resources were reserved, +while they were reserved, or after they were released? +Furthermore, some internal data structures +(e.g., the linked list of free blocks managed by the +.BR malloc (3) +family of functions) may be left in an inconsistent state +if cancellation occurs in the middle of the function call. +Consequently, clean-up handlers cease to be useful. +Functions that can be safely asynchronously canceled are called +.IR "async-cancel-safe functions" . +POSIX.1-2001 only requires that +.BR pthread_cancel (3), +.BR pthread_setcancelstate (), +and +.BR pthread_setcanceltype () +be async-cancel-safe. +In general, other library functions +can't be safely called from an asynchronously cancelable thread. +One of the few circumstances in which asynchronous cancelability is useful +is for cancellation of a thread that is in a pure compute-bound loop. + +The Linux threading implementations permit the +.I oldstate +argument of +.BR pthread_setcancelstate () +to be NULL, in which case the information about the previous +cancelability state is not returned to the caller. +Many other implementations also permit a NULL +.I oldstat +argument, +.\" It looks like at least Solaris, FreeBSD and Tru64 support this. +but POSIX.1-2001 does not specify this point, +so portable applications should always specify a non-NULL value in +.IR oldstate . +A precisely analogous set of statements applies for the +.I oldtype +argument of +.BR pthread_setcanceltype (). +.SH EXAMPLE +See +.BR pthread_cancel (3). +.SH SEE ALSO +.BR pthread_cleanup_push (3), +.BR pthread_cancel (3), +.BR pthread_testcancel (3), +.BR pthreads (7) diff --git a/original/man3/pthread_setcanceltype.3 b/original/man3/pthread_setcanceltype.3 new file mode 100644 index 00000000..9625bc20 --- /dev/null +++ b/original/man3/pthread_setcanceltype.3 @@ -0,0 +1 @@ +.so man3/pthread_setcancelstate.3 diff --git a/original/man3/pthread_setconcurrency.3 b/original/man3/pthread_setconcurrency.3 new file mode 100644 index 00000000..cd336331 --- /dev/null +++ b/original/man3/pthread_setconcurrency.3 @@ -0,0 +1,99 @@ +.\" Copyright (c) 2009 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. +.\" +.TH PTHREAD_SETCONCURRENCY 3 2009-04-10 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_setconcurrency, pthread_getconcurrency \- set/get +the concurrency level +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_setconcurrency(int " new_level ); +.BI "int pthread_getconcurrency(void); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_setconcurrency () +function informs the implementation of the application's +desired concurrency level, specified in +.IR new_level . +The implementation only takes this as a hint: +POSIX.1 does not specify the level of concurrency that +should be provided as a result of calling +.BR pthread_setconcurrency (). + +Specifying +.I new_level +as 0 instructs the implementation to manage the concurrency level +as it deems appropriate. + +.BR pthread_getconcurrency () +returns the current value of the concurrency level for this process. +.SH RETURN VALUE +On success, +.BR pthread_setconcurrency () +returns 0; +on error, it returns a nonzero error number. + +.BR pthread_getconcurrency () +always succeeds, returning the concurrency level set by a previous call to +.BR pthread_setconcurrency (), +or 0, if +.BR pthread_setconcurrency () +has not previously been called. +.SH ERRORS +.BR pthread_setconcurrency () +can fail with the following error: +.TP +.B EINVAL +.I new_level +is negative. +.PP +POSIX.1-2001 also documents an +.BR EAGAIN +error ("the value specified by +.I new_level +would cause a system resource to be exceeded"). +.SH VERSIONS +These functions are available in glibc since version 2.1. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +The default concurrency level is 0. + +Concurrency levels are only meaningful for M:N threading implementations, +where at any moment a subset of a process's set of user-level threads +may be bound to a smaller number of kernel-scheduling entities. +Setting the concurrency level allows the application to +give the system a hint as to the number of kernel-scheduling entities +that should be provided for efficient execution of the application. + +Both LinuxThreads and NPTL are 1:1 threading implementations, +so setting the concurrency level has no meaning. +In other words, +on Linux these functions merely exist for compatibility with other systems, +and they have no effect on the execution of a program. +.SH SEE ALSO +.BR pthread_attr_setscope (3), +.BR pthreads (7) diff --git a/original/man3/pthread_setschedparam.3 b/original/man3/pthread_setschedparam.3 new file mode 100644 index 00000000..aba23ded --- /dev/null +++ b/original/man3/pthread_setschedparam.3 @@ -0,0 +1,439 @@ +.\" 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. +.\" +.TH PTHREAD_SETSCHEDPARAM 3 2008-11-17 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_setschedparam, pthread_getschedparam \- set/get +scheduling policy and parameters of a thread +.SH SYNOPSIS +.nf +.B #include + +.BI "pthread_setschedparam(pthread_t " thread ", int " policy , +.BI " const struct sched_param *" param ); +.BI "pthread_getschedparam(pthread_t " thread ", int *" policy , +.BI " struct sched_param *" param ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_setschedparam () +function sets the scheduling policy and parameters of the thread +.IR thread . + +.I policy +specifies the new scheduling policy for +.IR thread . +The supported values for +.IR policy , +and their semantics, are described in +.BR sched_setscheduler (2). +.\" FIXME . pthread_setschedparam() places no restriction on the policy, +.\" but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=7013 + +The structure pointed to by +.I param +specifies the new scheduling parameters for +.IR thread . +Scheduling parameters are maintained in the following structure: + +.in +4n +.nf +struct sched_param { + int sched_priority; /* Scheduling priority */ +}; +.fi +.in + +As can be seen, only one scheduling parameter is supported. +For details of the permitted ranges for scheduling priorities +in each scheduling policy, see +.BR sched_setscheduler (2). + +The +.BR pthread_getschedparam () +function returns the scheduling policy and parameters of the thread +.IR thread , +in the buffers pointed to by +.I policy +and +.IR param , +respectively. +The returned priority value is that set by the most recent +.BR pthread_setschedparam (), +.BR pthread_setschedprio (3), +or +.BR pthread_create (3) +call that affected +.IR thread . +The returned priority does not reflect any temporary priority adjustments +as a result of calls to any priority inheritance or +priority ceiling functions (see, for example, +.BR pthread_mutexattr_setprioceiling (3) +and +.BR pthread_mutexattr_setprotocol (3)). +.\" FIXME . nptl/pthread_setschedparam.c has the following +.\" /* If the thread should have higher priority because of some +.\" PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */ +.\" Eventually (perhaps after writing the mutexattr pages), we +.\" may want to add something on the topic to this page. +.SH RETURN VALUE +On success, these functions return 0; +on error, they return a nonzero error number. +If +.BR pthread_setschedparam () +fails, the scheduling policy and parameters of +.I thread +are not changed. +.SH ERRORS +Both of these functions can fail with the following error: +.TP +.B ESRCH +No thread with the ID +.I thread +could be found. +.PP +.BR pthread_setschedparam () +may additionally fail with the following errors: +.TP +.B EINVAL +.I policy +is not a recognized policy, or +.I param +does not make sense for the +.IR policy . +.TP +.B EPERM +The caller does not have appropriate privileges +to set the specified scheduling policy and parameters. +.PP +POSIX.1-2001 also documents an +.B ENOTSUP +("attempt was made to set the policy or scheduling parameters +to an unsupported value") error for +.BR pthread_setschedparam (). +.\" .SH VERSIONS +.\" Available since glibc 2.0 +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +For a description of the permissions required to, and the effect of, +changing a thread's scheduling policy and priority, +and details of the permitted ranges for priorities +in each scheduling policy, see +.BR sched_setscheduler (2). +.SH EXAMPLE +The program below demonstrates the use of +.BR pthread_setschedparam () +and +.BR pthread_getschedparam (), +as well as the use of a number of other scheduling-related +pthreads functions. + +In the following run, the main thread sets its scheduling policy to +.BR SCHED_FIFO +with a priority of 10, +and initializes a thread attributes object with +a scheduling policy attribute of +.BR SCHED_RR +and a scheduling priority attribute of 20. +The program then sets (using +.BR pthread_attr_setinheritsched (3)) +the inherit scheduler attribute of the thread attributes object to +.BR PTHREAD_EXPLICIT_SCHED , +meaning that threads created using this attributes object should +take their scheduling attributes from the thread attributes object. +The program then creates a thread using the thread attributes object, +and that thread displays its scheduling policy and priority. +.in +4n +.nf + +$ \fBsu\fP # Need privilege to set real-time scheduling policies +Password: +# \fB./a.out \-mf10 \-ar20 \-i e\fP +Scheduler settings of main thread + policy=SCHED_FIFO, priority=10 + +Scheduler settings in \(aqattr\(aq + policy=SCHED_RR, priority=20 + inheritsched is EXPLICIT + +Scheduler attributes of new thread + policy=SCHED_RR, priority=20 +.fi +.in + +In the above output, one can see that the scheduling policy and priority +were taken from the values specified in the thread attributes object. + +The next run is the same as the previous, +except that the inherit scheduler attribute is set to +.BR PTHREAD_INHERIT_SCHED , +meaning that threads created using the thread attributes object should +ignore the scheduling attributes specified in the attributes object +and instead take their scheduling attributes from the creating thread. + +.in +4n +.nf +# \fB./a.out \-mf10 \-ar20 \-i i\fP +Scheduler settings of main thread + policy=SCHED_FIFO, priority=10 + +Scheduler settings in \(aqattr\(aq + policy=SCHED_RR, priority=20 + inheritsched is INHERIT + +Scheduler attributes of new thread + policy=SCHED_FIFO, priority=10 +.fi +.in + +In the above output, one can see that the scheduling policy and priority +were taken from the creating thread, +rather than the thread attributes object. + +Note that if we had omitted the +.IR "\-i\ i" +option, the output would have been the same, since +.BR PTHREAD_INHERIT_SCHED +is the default for the inherit scheduler attribute. +.SS Program source +\& +.nf +/* pthreads_sched_test.c */ + +#include +#include +#include +#include +#include + +#define handle_error_en(en, msg) \\ + do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0) + +static void +usage(char *prog_name, char *msg) +{ + if (msg != NULL) + fputs(msg, stderr); + + fprintf(stderr, "Usage: %s [options]\\n", prog_name); + fprintf(stderr, "Options are:\\n"); +#define fpe(msg) fprintf(stderr, "\\t%s", msg); /* Shorter */ + fpe("\-a Set scheduling policy and priority in\\n"); + fpe(" thread attributes object\\n"); + fpe(" can be\\n"); + fpe(" f SCHED_FIFO\\n"); + fpe(" r SCHED_RR\\n"); + fpe(" o SCHED_OTHER\\n"); + fpe("\-A Use default thread attributes object\\n"); + fpe("\-i {e|s} Set inherit scheduler attribute to\\n"); + fpe(" \(aqexplicit\(aq or \(aqinherit\(aq\\n"); + fpe("\-m Set scheduling policy and priority on\\n"); + fpe(" main thread before pthread_create() call\\n"); + exit(EXIT_FAILURE); +} /* usage */ + +static int +get_policy(char p, int *policy) +{ + switch (p) { + case \(aqf\(aq: *policy = SCHED_FIFO; return 1; + case \(aqr\(aq: *policy = SCHED_RR; return 1; + case \(aqo\(aq: *policy = SCHED_OTHER; return 1; + default: return 0; + } +} /* get_policy */ + +static void +display_sched_attr(int policy, struct sched_param *param) +{ + printf(" policy=%s, priority=%d\\n", + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + param\->sched_priority); +} /* display_sched_attr */ + +static void +display_thread_sched_attr(char *msg) +{ + int policy, s; + struct sched_param param; + + s = pthread_getschedparam(pthread_self(), &policy, ¶m); + if (s != 0) + handle_error_en(s, "pthread_getschedparam"); + + printf("%s\\n", msg); + display_sched_attr(policy, ¶m); +} /* display_thread_sched_attr */ + +static void * +thread_start(void *arg) +{ + display_thread_sched_attr("Scheduler attributes of new thread"); + + return NULL; +} /* thread_start */ + +int +main(int argc, char *argv[]) +{ + int s, opt, inheritsched, use_null_attrib, policy; + pthread_t thread; + pthread_attr_t attr; + pthread_attr_t *attrp; + char *attr_sched_str, *main_sched_str, *inheritsched_str; + struct sched_param param; + + /* Process command\-line options */ + + use_null_attrib = 0; + attr_sched_str = NULL; + main_sched_str = NULL; + inheritsched_str = NULL; + + while ((opt = getopt(argc, argv, "a:Ai:m:")) != \-1) { + switch (opt) { + case \(aqa\(aq: attr_sched_str = optarg; break; + case \(aqA\(aq: use_null_attrib = 1; break; + case \(aqi\(aq: inheritsched_str = optarg; break; + case \(aqm\(aq: main_sched_str = optarg; break; + default: usage(argv[0], "Unrecognized option\\n"); + } + } + + if (use_null_attrib && + (inheritsched_str != NULL || attr_sched_str != NULL)) + usage(argv[0], "Can\(aqt specify \-A with \-i or \-a\\n"); + + /* Optionally set scheduling attributes of main thread, + and display the attributes */ + + if (main_sched_str != NULL) { + if (!get_policy(main_sched_str[0], &policy)) + usage(argv[0], "Bad policy for main thread (\-s)\\n"); + param.sched_priority = strtol(&main_sched_str[1], NULL, 0); + + s = pthread_setschedparam(pthread_self(), policy, ¶m); + if (s != 0) + handle_error_en(s, "pthread_setschedparam"); + } + + display_thread_sched_attr("Scheduler settings of main thread"); + printf("\\n"); + + /* Initialize thread attributes object according to options */ + + attrp = NULL; + + if (!use_null_attrib) { + s = pthread_attr_init(&attr); + if (s != 0) + handle_error_en(s, "pthread_attr_init"); + attrp = &attr; + } + + if (inheritsched_str != NULL) { + if (inheritsched_str[0] == \(aqe\(aq) + inheritsched = PTHREAD_EXPLICIT_SCHED; + else if (inheritsched_str[0] == \(aqi\(aq) + inheritsched = PTHREAD_INHERIT_SCHED; + else + usage(argv[0], "Value for \-i must be \(aqe\(aq or \(aqi\(aq\\n"); + + s = pthread_attr_setinheritsched(&attr, inheritsched); + if (s != 0) + handle_error_en(s, "pthread_attr_setinheritsched"); + } + + if (attr_sched_str != NULL) { + if (!get_policy(attr_sched_str[0], &policy)) + usage(argv[0], + "Bad policy for \(aqattr\(aq (\-a)\\n"); + param.sched_priority = strtol(&attr_sched_str[1], NULL, 0); + + s = pthread_attr_setschedpolicy(&attr, policy); + if (s != 0) + handle_error_en(s, "pthread_attr_setschedpolicy"); + s = pthread_attr_setschedparam(&attr, ¶m); + if (s != 0) + handle_error_en(s, "pthread_attr_setschedparam"); + } + + /* If we initialized a thread attributes object, display + the scheduling attributes that were set in the object */ + + if (attrp != NULL) { + s = pthread_attr_getschedparam(&attr, ¶m); + if (s != 0) + handle_error_en(s, "pthread_attr_getschedparam"); + s = pthread_attr_getschedpolicy(&attr, &policy); + if (s != 0) + handle_error_en(s, "pthread_attr_getschedpolicy"); + + printf("Scheduler settings in \(aqattr\(aq\\n"); + display_sched_attr(policy, ¶m); + + s = pthread_attr_getinheritsched(&attr, &inheritsched); + printf(" inheritsched is %s\\n", + (inheritsched == PTHREAD_INHERIT_SCHED) ? "INHERIT" : + (inheritsched == PTHREAD_EXPLICIT_SCHED) ? "EXPLICIT" : + "???"); + printf("\\n"); + } + + /* Create a thread that will display its scheduling attributes */ + + s = pthread_create(&thread, attrp, &thread_start, NULL); + if (s != 0) + handle_error_en(s, "pthread_create"); + + /* Destroy unneeded thread attributes object */ + + s = pthread_attr_destroy(&attr); + if (s != 0) + handle_error_en(s, "pthread_attr_destroy"); + + s = pthread_join(thread, NULL); + if (s != 0) + handle_error_en(s, "pthread_join"); + + exit(EXIT_SUCCESS); +} /* main */ +.fi +.SH SEE ALSO +.BR getrlimit (2), +.BR sched_get_priority_min (2), +.BR sched_setscheduler (2), +.BR pthread_attr_init (3), +.BR pthread_attr_setinheritsched (3), +.BR pthread_attr_setschedparam (3), +.BR pthread_attr_setschedpolicy (3), +.BR pthread_setschedprio (3), +.BR pthread_create (3), +.BR pthread_self (3), +.BR pthreads (7) diff --git a/original/man3/pthread_setschedprio.3 b/original/man3/pthread_setschedprio.3 new file mode 100644 index 00000000..4a96acf1 --- /dev/null +++ b/original/man3/pthread_setschedprio.3 @@ -0,0 +1,99 @@ +.\" 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. +.\" +.TH PTHREAD_SETSCHEDPRIO 3 2008-11-06 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_setschedprio \- set scheduling priority of a thread +.SH SYNOPSIS +.nf +.B #include + +.BI "pthread_setschedprio(pthread_t " thread ", int " prio ); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_setschedprio () +function sets the scheduling priority of the thread +.I thread +to the value specified in +.IR prio . +(By contrast +.BR pthread_setschedparam (3) +changes both the scheduling policy and priority of a thread.) +.\" FIXME . nptl/pthread_setschedprio.c has the following +.\" /* If the thread should have higher priority because of some +.\" PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */ +.\" Eventually (perhaps after writing the mutexattr pages), we +.\" may want to add something on the topic to this page. +.\" nptl/pthread_setschedparam.c has a similar case. +.SH RETURN VALUE +On success, this function returns 0; +on error, it returns a nonzero error number. +If +.BR pthread_setschedprio () +fails, the scheduling priority of +.I thread +is not changed. +.SH ERRORS +.TP +.B EINVAL +.I prio +is not valid for the scheduling policy of the specified thread. +.TP +.B EPERM +The caller does not have appropriate privileges +to set the specified priority. +.TP +.B ESRCH +No thread with the ID +.I thread +could be found. +.PP +POSIX.1-2001 also documents an +.B ENOTSUP +("attempt was made to set the priority +to an unsupported value") error for +.BR pthread_setschedparam (). +.SH VERSIONS +This function is available in glibc since version 2.3.4. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +For a description of the permissions required to, and the effect of, +changing a thread's scheduling priority, +and details of the permitted ranges for priorities +in each scheduling policy, see +.BR sched_setscheduler (2). +.SH SEE ALSO +.BR getrlimit (2), +.BR sched_get_priority_min (2), +.BR sched_setscheduler (2), +.BR pthread_attr_init (3), +.BR pthread_attr_setinheritsched (3), +.BR pthread_attr_setschedparam (3), +.BR pthread_attr_setschedpolicy (3), +.BR pthread_setschedparam (3), +.BR pthread_create (3), +.BR pthread_self (3), +.BR pthreads (7) diff --git a/original/man3/pthread_sigmask.3 b/original/man3/pthread_sigmask.3 new file mode 100644 index 00000000..1361550c --- /dev/null +++ b/original/man3/pthread_sigmask.3 @@ -0,0 +1,141 @@ +.\" 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. +.\" +.TH PTHREAD_SIGMASK 3 2009-01-25 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_sigmask \- examine and change mask of blocked signals +.SH SYNOPSIS +.nf +.B #include + +.BI "int pthread_sigmask(int " how ", const sigset_t *" set \ +", sigset_t *" oldset ); +.fi +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +The +.BR pthread_sigmask () +function is just like +.BR sigprocmask (2), +with the difference that its use in multithreaded programs +is explicitly specified by POSIX.1-2001. +Other differences are noted in this page. + +For a description of the arguments and operation of this function, see +.BR sigprocmask (2). +.SH RETURN VALUE +On success, +.BR pthread_sigmask () +returns 0; +on error, it returns an error number. +.SH ERRORS +See +.BR sigprocmask (2). +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +A new thread inherits a copy of its creator's signal mask. +.SH EXAMPLE +The program below blocks some signals in the main thread, +and then creates a dedicated thread to fetch those signals via +.BR sigwait (3). +The following shell session demonstrates its use: + +.in +4n +.nf +.RB "$" " ./a.out &" +[1] 5423 +.RB "$" " kill \-QUIT %1" +Signal handling thread got signal 3 +.RB "$" " kill \-USR1 %1" +Signal handling thread got signal 10 +.RB "$" " kill \-TERM %1" +[1]+ Terminated ./a.out +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include +#include +#include +#include + +/* Simple error handling functions */ + +#define handle_error_en(en, msg) \\ + do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0) + +static void * +sig_thread(void *arg) +{ + sigset_t *set = (sigset_t *) arg; + int s, sig; + + for (;;) { + s = sigwait(set, &sig); + if (s != 0) + handle_error_en(s, "sigwait"); + printf("Signal handling thread got signal %d\\n", sig); + } +} + +int +main(int argc, char *argv[]) +{ + pthread_t thread; + sigset_t set; + int s; + + /* Block SIGINT; other threads created by main() will inherit + a copy of the signal mask. */ + + sigemptyset(&set); + sigaddset(&set, SIGQUIT); + sigaddset(&set, SIGUSR1); + s = pthread_sigmask(SIG_BLOCK, &set, NULL); + if (s != 0) + handle_error_en(s, "pthread_sigmask"); + + s = pthread_create(&thread, NULL, &sig_thread, (void *) &set); + if (s != 0) + handle_error_en(s, "pthread_create"); + + /* Main thread carries on to create other threads and/or do + other work */ + + pause(); /* Dummy pause so we can test program */ +} +.fi +.SH SEE ALSO +.BR sigaction (2), +.BR sigpending (2), +.BR sigprocmask (2) +.BR pthread_create (3), +.BR pthread_kill (3), +.BR sigsetops (3), +.BR pthreads (7), +.BR signal (7) diff --git a/original/man3/pthread_testcancel.3 b/original/man3/pthread_testcancel.3 new file mode 100644 index 00000000..45c2862f --- /dev/null +++ b/original/man3/pthread_testcancel.3 @@ -0,0 +1,64 @@ +.\" 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. +.\" +.TH PTHREAD_TESTCANCEL 3 2008-11-17 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_testcancel \- request delivery of any pending cancellation request +.SH SYNOPSIS +.nf +.B #include + +.B void pthread_testcancel(void); +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +Calling +.BR pthread_testcancel () +creates a cancellation point within the calling thread, +so that a thread that is otherwise executing code that contains +no cancellation points will respond to a cancellation request. + +If cancelability is disabled (using +.BR pthread_setcancelstate (3)), +or no cancellation request is pending, +then a call to +.BR pthread_cancel () +has no effect. +.SH RETURN VALUE +This function does not return a value. +If the calling thread is canceled as a consequence of a call +to this function, then the function does not return. +.SH ERRORS +This function always succeeds. +.\" SH VERSIONS +.\" Available since glibc 2.0 +.SH CONFORMING TO +POSIX.1-2001. +.SH EXAMPLE +See +.BR pthread_cleanup_push (3). +.SH SEE ALSO +.BR pthread_cancel (3), +.BR pthread_cleanup_push (3), +.BR pthread_setcancelstate (3), +.BR pthreads (7) diff --git a/original/man3/pthread_timedjoin_np.3 b/original/man3/pthread_timedjoin_np.3 new file mode 100644 index 00000000..a741f46b --- /dev/null +++ b/original/man3/pthread_timedjoin_np.3 @@ -0,0 +1 @@ +.so man3/pthread_tryjoin_np.3 diff --git a/original/man3/pthread_tryjoin_np.3 b/original/man3/pthread_tryjoin_np.3 new file mode 100644 index 00000000..7b3035db --- /dev/null +++ b/original/man3/pthread_tryjoin_np.3 @@ -0,0 +1,137 @@ +.\" 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. +.\" +.TH PTHREAD_TRYJOIN_NP 3 2008-11-11 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_tryjoin_np, pthread_timedjoin_np \- try to join with a +terminated thread +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "int pthread_tryjoin_np(pthread_t " thread ", void **" retval ); + +.BI "int pthread_timedjoin_np(pthread_t " thread ", void **" retval , +.BI " const struct timespec *" abstime ); +.fi +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +These functions operate in the same way as +.BR pthread_join (3), +except for the differences described on this page. + +The +.BR pthread_tryjoin_np () +function performs a nonblocking join with the thread +.IR thread , +returning the exit status of the thread in +.IR *retval . +If +.I thread +has not yet terminated, then instead of blocking, as is done by +.BR pthread_join (3), +the call returns an error. + +The +.BR pthread_timedjoin_np () +function performs a join-with-timeout. +If +.I thread +has not yet terminated, +then the call blocks until a maximum time, specified in +.IR abstime . +If the timeout expires before +.I thread +terminates, +the call returns an error. +The +.I abstime +argument is a structure of the following form, +specifying an absolute time measured since the Epoch (see +.BR time (2)): + +.in +4n +.nf +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.fi +.in +.SH RETURN VALUE +On success, +these functions return 0; +on error, they return an error number. +.SH ERRORS +These functions can fail with the same errors as +.BR pthread_join (3). +.BR pthread_tryjoin_np () +can in addition fail with the following error: +.TP +.B EBUSY +.I thread +had not yet terminated at the time of the call. +.PP +.BR pthread_timedjoin_np () +can in addition fail with the following error: +.TP +.BR ETIMEDOUT +The call timed out before +.I thread +terminated. +.PP +.BR pthread_timedjoin_np () +never returns the error +.BR EINTR . +.SH VERSIONS +These functions first appeared in glibc in version 2.3.3. +.SH CONFORMING TO +These functions are nonstandard GNU extensions; +hence the suffix "_np" (nonportable) in the names. +.SH EXAMPLE +The following code waits to join for up to 5 seconds: + +.nf + struct timespec ts; + int s; + + ... + + if (clock_gettime(CLOCK_REALTIME, &ts) == \-1) { + /* Handle error */ + } + + ts.tv_sec += 5; + + s = pthread_timedjoin_np(thread, NULL, &ts); + if (s != 0) { + /* Handle error */ + } +.fi +.SH SEE ALSO +.BR clock_gettime (2), +.BR pthread_join (3), +.BR pthread_exit (3), +.BR pthreads (7) diff --git a/original/man3/pthread_yield.3 b/original/man3/pthread_yield.3 new file mode 100644 index 00000000..40e89508 --- /dev/null +++ b/original/man3/pthread_yield.3 @@ -0,0 +1,62 @@ +.\" Copyright (c) 2009 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. +.\" +.TH PTHREAD_YIELD 3 2009-04-10 "Linux" "Linux Programmer's Manual" +.SH NAME +pthread_yield \- yield the processor +.SH SYNOPSIS +.nf +.B #include + +.B int pthread_yield(void); +.fi +.sp +Compile and link with \fI\-pthread\fP. +.SH DESCRIPTION +.BR pthread_yield () +causes the calling thread to relinquish the CPU. +The thread is placed at the end of the run queue for its static +priority and another thread is scheduled to run. +For further details, see +.BR sched_yield (2) +.SH RETURN VALUE +On success, +.BR pthread_yield () +returns 0; +on error, it returns an error number. +.SH ERRORS +On Linux, this call always succeeds +(but portable and future-proof applications should nevertheless +handle a possible error return). +.SH CONFORMING TO +This call is nonstandard, but present on several other systems. +Use the standardized +.BR sched_yield (2) +instead. +.\" e.g., the BSDs, Tru64, AIX, and Irix. +.SH NOTES +On Linux, this function is implemented as a call to +.BR sched_yield (2). +.SH SEE ALSO +.BR sched_setscheduler (2), +.BR sched_yield (2) +.BR pthreads (7) diff --git a/original/man3/ptsname.3 b/original/man3/ptsname.3 new file mode 100644 index 00000000..6f08374e --- /dev/null +++ b/original/man3/ptsname.3 @@ -0,0 +1,98 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This page is in the public domain. - aeb +.\" +.\" 2004-12-17, mtk, added description of ptsname_r() + ERRORS +.\" +.TH PTSNAME 3 2008-09-03 "" "Linux Programmer's Manual" +.SH NAME +ptsname, ptsname_r \- get the name of the slave pseudo-terminal +.SH SYNOPSIS +.nf +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "char *ptsname(int " fd ");" +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int ptsname_r(int " fd ", char *" buf ", size_t " buflen ");" +.fi +.SH DESCRIPTION +The +.BR ptsname () +function returns the name of the slave pseudo-terminal (pty) device +corresponding to the master referred to by +.IR fd . + +The +.BR ptsname_r () +function is the reentrant equivalent of +.BR ptsname (). +It returns the name of the slave pseudo-terminal device as a +null-terminated string in the buffer pointed to by +.IR buf . +The +.I buflen +argument specifies the number of bytes available in +.IR buf . +.SH "RETURN VALUE" +On success, +.BR ptsname () +returns a pointer to a string in static storage which will be +overwritten by subsequent calls. +This pointer must not be freed. +On failure, a NULL pointer is returned. + +On success, +.BR ptsname_r () +returns 0. +On failure, a nonzero value is returned +and +.I errno +is set to indicate the error. +.\" In fact the errno value is also returned as the function +.\" result -- MTK, Dec 04 +.SH ERRORS +.TP +.B EINVAL +.RB ( ptsname_r () +only) +.I buf +is NULL. +.TP +.B ENOTTY +.I fd +does not refer to a pseudo-terminal master device. +.TP +.B ERANGE +.RB ( ptsname_r () +only) +.I buf +is too small. +.SH VERSIONS +.BR ptsname () +is provided in glibc since version 2.1. +.SH "CONFORMING TO" +.BR ptsname () +is part of the Unix98 pseudo-terminal support (see +.BR pts (4)). +This function is specified in POSIX.1-2001. + +.BR ptsname_r () +is a Linux extension. +A version of this function is documented on Tru64 and HP-UX, but +on those implementations, \-1 is returned on error, with +.I errno +set to indicate the error. +Avoid using this function in portable programs. +.SH "SEE ALSO" +.BR grantpt (3), +.BR posix_openpt (3), +.BR ttyname (3), +.BR unlockpt (3), +.BR pts (4), +.BR feature_test_macros (7), +.BR pty (7) diff --git a/original/man3/ptsname_r.3 b/original/man3/ptsname_r.3 new file mode 100644 index 00000000..0a5f98d4 --- /dev/null +++ b/original/man3/ptsname_r.3 @@ -0,0 +1 @@ +.so man3/ptsname.3 diff --git a/original/man3/putc.3 b/original/man3/putc.3 new file mode 100644 index 00000000..a7c3b57f --- /dev/null +++ b/original/man3/putc.3 @@ -0,0 +1 @@ +.so man3/puts.3 diff --git a/original/man3/putc_unlocked.3 b/original/man3/putc_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/putc_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/putchar.3 b/original/man3/putchar.3 new file mode 100644 index 00000000..a7c3b57f --- /dev/null +++ b/original/man3/putchar.3 @@ -0,0 +1 @@ +.so man3/puts.3 diff --git a/original/man3/putchar_unlocked.3 b/original/man3/putchar_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/putchar_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/putenv.3 b/original/man3/putenv.3 new file mode 100644 index 00000000..a35c7ab0 --- /dev/null +++ b/original/man3/putenv.3 @@ -0,0 +1,119 @@ +.\" 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 +.\" Single UNIX Specification, Version 2 +.\" Modified Thu Apr 8 15:00:12 1993, David Metcalfe +.\" Modified Sat Jul 24 18:44:45 1993, Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Feb 14 21:47:50 1997 by Andries Brouwer (aeb@cwi.nl) +.\" 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) +.TH PUTENV 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +putenv \- change or add an environment variable +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int putenv(char *" string ); +.\" Not: const char * +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR putenv (): +_SVID_SOURCE || _XOPEN_SOURCE +.SH DESCRIPTION +The +.BR putenv () +function adds or changes the value of environment +variables. +The argument \fIstring\fP is of the form \fIname\fP=\fIvalue\fP. +If \fIname\fP does not already exist in the environment, then +\fIstring\fP is added to the environment. +If \fIname\fP does exist, +then the value of \fIname\fP in the environment is changed to +\fIvalue\fP. +The string pointed to by \fIstring\fP becomes part of the environment, +so altering the string changes the environment. +.SH "RETURN VALUE" +The +.BR putenv () +function returns zero on success, +or nonzero if an error occurs. +.SH ERRORS +.TP +.B ENOMEM +Insufficient space to allocate new environment. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001, 4.3BSD. +.SH NOTES +The +.BR putenv () +function is not required to be reentrant, and the +one in libc4, libc5 and glibc 2.0 is not, but the glibc 2.1 version is. +.LP +Description for libc4, libc5, glibc: +If the argument \fIstring\fP is of the form \fIname\fP, +and does not contain an \(aq=\(aq character, then the variable \fIname\fP +is removed from the environment. +If +.BR putenv () +has to allocate a new array \fIenviron\fP, +and the previous array was also allocated by +.BR putenv (), +then it will be freed. +In no case will the old storage associated +to the environment variable itself be freed. +.LP +The libc4 and libc5 and glibc 2.1.2 versions conform to SUSv2: +the pointer \fIstring\fP given to +.BR putenv () +is used. +In particular, this string becomes part of the environment; +changing it later will change the environment. +(Thus, it is an error is to call +.BR putenv () +with an automatic variable +as the argument, then return from the calling function while \fIstring\fP +is still part of the environment.) +However, glibc 2.0-2.1.1 differs: a copy of the string is used. +On the one hand this causes a memory leak, and on the other hand +it violates SUSv2. +This has been fixed in glibc 2.1.2. +.LP +The 4.4BSD version, like glibc 2.0, uses a copy. +.LP +SUSv2 removes the \fIconst\fP from the prototype, and so does glibc 2.1.3. +.SH "SEE ALSO" +.BR clearenv (3), +.BR getenv (3), +.BR setenv (3), +.BR unsetenv (3), +.BR environ (7) diff --git a/original/man3/putgrent.3 b/original/man3/putgrent.3 new file mode 100644 index 00000000..ef376c3c --- /dev/null +++ b/original/man3/putgrent.3 @@ -0,0 +1,43 @@ +.\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH PUTGRENT 3 2003-09-09 "GNU" "Linux Programmer's Manual" +.SH NAME +putgrent \- write a group database entry to a file +.SH SYNOPSIS +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int putgrent(const struct group *" grp ", FILE *" fp ); +.SH DESCRIPTION +The +.BR putgrent () +function is the counterpart for +.BR fgetgrent (3). +The function writes the content of the provided \fIstruct group\fP into the +file pointed to by +.IR fp . +The list of group members must be NULL-terminated or NULL-initialized. +.sp +The \fIstruct group\fP is defined as follows: +.sp +.in +4n +.nf +struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group ID */ + char **gr_mem; /* group members */ +}; +.fi +.in +.SH "RETURN VALUE" +The function returns zero on success, and a nonzero value on error. +.SH "CONFORMING TO" +This function is a GNU extension. +.SH "SEE ALSO" +.BR fgetgrent (3), +.BR getgrent (3), +.BR group (5), +.BR feature_test_macros (7) diff --git a/original/man3/putpwent.3 b/original/man3/putpwent.3 new file mode 100644 index 00000000..2b185f71 --- /dev/null +++ b/original/man3/putpwent.3 @@ -0,0 +1,86 @@ +.\" 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 Sat Jul 24 18:43:46 1993 by Rik Faith (faith@cs.unc.edu) +.TH PUTPWENT 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +putpwent \- write a password file entry +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.sp +.BI "int putpwent(const struct passwd *" p ", FILE *" stream ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR putpwent (): +_SVID_SOURCE +.SH DESCRIPTION +The +.BR putpwent () +function writes a password entry from the +structure \fIp\fP in the file associated with \fIstream\fP. +.PP +The \fIpasswd\fP structure is defined in \fI\fP as follows: +.sp +.in +4n +.nf +struct passwd { + char *pw_name; /* username */ + char *pw_passwd; /* user password */ + uid_t pw_uid; /* user ID */ + gid_t pw_gid; /* group ID */ + char *pw_gecos; /* real name */ + char *pw_dir; /* home directory */ + char *pw_shell; /* shell program */ +}; +.fi +.in +.SH "RETURN VALUE" +The +.BR putpwent () +function returns 0 on success, or \-1 if an error +occurs. +.SH ERRORS +.TP +.B EINVAL +Invalid (NULL) argument given. +.SH "CONFORMING TO" +SVr4. +.SH "SEE ALSO" +.BR endpwent (3), +.BR fgetpwent (3), +.BR getpw (3), +.BR getpwent (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR setpwent (3) diff --git a/original/man3/puts.3 b/original/man3/puts.3 new file mode 100644 index 00000000..0784b4ce --- /dev/null +++ b/original/man3/puts.3 @@ -0,0 +1,122 @@ +.\" 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 18:42:59 1993 by Rik Faith (faith@cs.unc.edu) +.TH PUTS 3 1993-04-04 "GNU" "Linux Programmer's Manual" +.SH NAME +fputc, fputs, putc, putchar, puts \- output of characters and strings +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int fputc(int " c ", FILE *" stream ); + +.BI "int fputs(const char *" "s" ", FILE *" "stream" ); + +.BI "int putc(int " c ", FILE *" stream ); + +.BI "int putchar(int " c ); + +.BI "int puts(const char *" "s" ); +.fi +.SH DESCRIPTION +.BR fputc () +writes the character +.IR c , +cast to an +.IR "unsigned char" , +to +.IR stream . +.PP +.BR fputs () +writes the string +.I s +to +.IR stream , +without its trailing +.BR \(aq\e0\(aq . +.PP +.BR putc () +is equivalent to +.BR fputc () +except that it may be implemented as a macro which evaluates +.I stream +more than once. +.PP +.BI "putchar(" c ); +is equivalent to +.BI "putc(" c , stdout ). +.PP +.BR puts () +writes the string +.I s +and a trailing newline +to +.IR stdout . +.PP +Calls to the functions described here can be mixed with each other and with +calls to other output functions from the +.I stdio +library for the same output stream. +.PP +For nonlocking counterparts, see +.BR unlocked_stdio (3). +.SH "RETURN VALUE" +.BR fputc (), +.BR putc () +and +.BR putchar () +return the character written as an +.I unsigned char +cast to an +.I int +or +.B EOF +on error. +.PP +.BR puts () +and +.BR fputs () +return a nonnegative number on success, or +.B EOF +on error. +.SH "CONFORMING TO" +C89, C99. +.SH BUGS +It is not advisable to mix calls to output functions from the +.I stdio +library with low-level calls to +.BR write (2) +for the file descriptor associated with the same output stream; the results +will be undefined and very probably not what you want. +.SH "SEE ALSO" +.BR write (2), +.BR ferror (3), +.BR fopen (3), +.BR fputwc (3), +.BR fputws (3), +.BR fseek (3), +.BR fwrite (3), +.BR gets (3), +.BR putwchar (3), +.BR scanf (3), +.BR unlocked_stdio (3) diff --git a/original/man3/putspent.3 b/original/man3/putspent.3 new file mode 100644 index 00000000..142c5a5c --- /dev/null +++ b/original/man3/putspent.3 @@ -0,0 +1 @@ +.so man3/getspnam.3 diff --git a/original/man3/pututline.3 b/original/man3/pututline.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/pututline.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/pututxline.3 b/original/man3/pututxline.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/pututxline.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/putw.3 b/original/man3/putw.3 new file mode 100644 index 00000000..75093455 --- /dev/null +++ b/original/man3/putw.3 @@ -0,0 +1 @@ +.so man3/getw.3 diff --git a/original/man3/putwc.3 b/original/man3/putwc.3 new file mode 100644 index 00000000..81826be5 --- /dev/null +++ b/original/man3/putwc.3 @@ -0,0 +1 @@ +.so man3/fputwc.3 diff --git a/original/man3/putwc_unlocked.3 b/original/man3/putwc_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/putwc_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/putwchar.3 b/original/man3/putwchar.3 new file mode 100644 index 00000000..79406e6a --- /dev/null +++ b/original/man3/putwchar.3 @@ -0,0 +1,62 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH PUTWCHAR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +putwchar \- write a wide character to standard output +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wint_t putwchar(wchar_t " wc ); +.fi +.SH DESCRIPTION +The +.BR putwchar () +function is the wide-character equivalent of the +.BR putchar (3) +function. +It writes the wide character \fIwc\fP to \fIstdout\fP. +If \fIferror(stdout)\fP becomes true, it returns +.BR WEOF . +If a wide character +conversion error occurs, it sets \fIerrno\fP to \fBEILSEQ\fP and returns +.BR WEOF . +Otherwise it returns \fIwc\fP. +.PP +For a nonlocking counterpart, see +.BR unlocked_stdio (3). +.SH "RETURN VALUE" +The +.BR putwchar () +function returns \fIwc\fP if no error occurred, or +.B WEOF +to indicate an error. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR putwchar () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +It is reasonable to expect that +.BR putwchar () +will actually write +the multibyte sequence corresponding to the wide character \fIwc\fP. +.SH "SEE ALSO" +.BR fputwc (3), +.BR unlocked_stdio (3) diff --git a/original/man3/putwchar_unlocked.3 b/original/man3/putwchar_unlocked.3 new file mode 100644 index 00000000..858bd084 --- /dev/null +++ b/original/man3/putwchar_unlocked.3 @@ -0,0 +1 @@ +.so man3/unlocked_stdio.3 diff --git a/original/man3/qecvt.3 b/original/man3/qecvt.3 new file mode 100644 index 00000000..f5302ead --- /dev/null +++ b/original/man3/qecvt.3 @@ -0,0 +1,85 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.\" +.TH QECVT 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +qecvt, qfcvt, qgcvt \- convert a floating-point number to a string +.SH SYNOPSIS +.B #include +.sp +.BI "char *qecvt(long double " number ", int " ndigits ", int *" decpt , +.BI "int *" sign ); +.sp +.BI "char *qfcvt(long double " number ", int " ndigits ", int *" decpt , +.BI "int *" sign ); +.sp +.BI "char *qgcvt(long double " number ", int " ndigit ", char *" buf ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR qecvt (), +.BR qfcvt (), +.BR qgcvt (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.ad b +.SH DESCRIPTION +The functions +.BR qecvt (), +.BR qfcvt () +and +.BR qgcvt () +are identical to +.BR ecvt (3), +.BR fcvt (3) +and +.BR gcvt (3) +respectively, except that they use a +.I "long double" +argument +.IR number . +See +.BR ecvt (3) +and +.BR gcvt (3). +.SH "CONFORMING TO" +SVr4. +Not seen in most common Unix implementations, +but occurs in SunOS. +Not supported by libc4 and libc5. +Supported by glibc. +.SH NOTES +These functions are obsolete. +Instead, +.BR sprintf (3) +is recommended. +.SH "SEE ALSO" +.BR ecvt (3), +.BR ecvt_r (3), +.BR gcvt (3), +.BR sprintf (3) diff --git a/original/man3/qecvt_r.3 b/original/man3/qecvt_r.3 new file mode 100644 index 00000000..41ce9ee8 --- /dev/null +++ b/original/man3/qecvt_r.3 @@ -0,0 +1 @@ +.so man3/ecvt_r.3 diff --git a/original/man3/qfcvt.3 b/original/man3/qfcvt.3 new file mode 100644 index 00000000..7e583109 --- /dev/null +++ b/original/man3/qfcvt.3 @@ -0,0 +1 @@ +.so man3/qecvt.3 diff --git a/original/man3/qfcvt_r.3 b/original/man3/qfcvt_r.3 new file mode 100644 index 00000000..41ce9ee8 --- /dev/null +++ b/original/man3/qfcvt_r.3 @@ -0,0 +1 @@ +.so man3/ecvt_r.3 diff --git a/original/man3/qgcvt.3 b/original/man3/qgcvt.3 new file mode 100644 index 00000000..7e583109 --- /dev/null +++ b/original/man3/qgcvt.3 @@ -0,0 +1 @@ +.so man3/qecvt.3 diff --git a/original/man3/qsort.3 b/original/man3/qsort.3 new file mode 100644 index 00000000..87ef1294 --- /dev/null +++ b/original/man3/qsort.3 @@ -0,0 +1,120 @@ +.\" 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-07-24, Rik Faith (faith@cs.unc.edu) +.\" 2006-01-15, mtk, Added example program. +.\" +.\" FIXME glibc 2.8 added qsort_r(), which needs to be documented. +.\" +.TH QSORT 3 2009-09-15 "" "Linux Programmer's Manual" +.SH NAME +qsort \- sorts an array +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void qsort(void *" base ", size_t " nmemb ", size_t " size , +.BI " int(*" compar ")(const void *, const void *));" +.fi +.SH DESCRIPTION +The +.BR qsort () +function sorts an array with \fInmemb\fP elements of +size \fIsize\fP. +The \fIbase\fP argument points to the start of the +array. +.PP +The contents of the array are sorted in ascending order according to a +comparison function pointed to by \fIcompar\fP, which is called with two +arguments that point to the objects being compared. +.PP +The comparison function must return an integer less than, equal to, or +greater than zero if the first argument is considered to be respectively +less than, equal to, or greater than the second. +If two members compare +as equal, their order in the sorted array is undefined. +.SH "RETURN VALUE" +The +.BR qsort () +function returns no value. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99. +.SH NOTES +Library routines suitable for use as the +.I compar +argument include +.BR alphasort (3) +and +.BR versionsort (3). +To compare C strings, the comparison function can call +.BR strcmp (3), +as shown in the example below. +.SH EXAMPLE +For one example of use, see the example under +.BR bsearch (3). + +Another example is the following program, +which sorts the strings given in its command-line arguments: +.sp +.nf +#include +#include +#include + +static int +cmpstringp(const void *p1, const void *p2) +{ + /* The actual arguments to this function are "pointers to + pointers to char", but strcmp(3) arguments are "pointers + to char", hence the following cast plus dereference */ + + return strcmp(* (char * const *) p1, * (char * const *) p2); +} + +int +main(int argc, char *argv[]) +{ + int j; + + if (argc < 2) { + fprintf(stderr, "Usage: %s ...\\n", argv[0]); + exit(EXIT_FAILURE); + } + + qsort(&argv[1], argc \- 1, sizeof(char *), cmpstringp); + + for (j = 1; j < argc; j++) + puts(argv[j]); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR sort (1), +.BR alphasort (3), +.BR strcmp (3), +.BR versionsort (3) diff --git a/original/man3/queue.3 b/original/man3/queue.3 new file mode 100644 index 00000000..414664e5 --- /dev/null +++ b/original/man3/queue.3 @@ -0,0 +1,487 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)queue.3 8.2 (Berkeley) 1/24/94 +.\" +.\" hch, 2002-03-25 +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.TH QUEUE 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH NAME +LIST_ENTRY, LIST_HEAD, LIST_INIT, LIST_INSERT_AFTER, \ +LIST_INSERT_HEAD, LIST_REMOVE, TAILQ_ENTRY, TAILQ_HEAD, \ +TAILQ_INIT, TAILQ_INSERT_AFTER, TAILQ_INSERT_HEAD, TAILQ_INSERT_TAIL, \ +TAILQ_REMOVE, CIRCLEQ_ENTRY, CIRCLEQ_HEAD, CIRCLEQ_INIT, \ +CIRCLEQ_INSERT_AFTER, CIRCLEQ_INSERT_BEFORE, \ +CIRCLEQ_INSERT_HEAD, CIRCLEQ_INSERT_TAIL, \ +CIRCLEQ_REMOVE \- implementations of lists, tail queues, and circular queues +.SH SYNOPSIS +.nf +.B #include + +.BI "LIST_ENTRY(" TYPE ); +.BI "LIST_HEAD(" HEADNAME ", " TYPE ); +.BI "LIST_INIT(LIST_HEAD *" head ); +.BI "LIST_INSERT_AFTER(LIST_ENTRY *" listelm ", " +.BI " TYPE *" elm ", LIST_ENTRY " NAME ); +.BI "LIST_INSERT_HEAD(LIST_HEAD *" head ", " +.BI " TYPE *" elm ", LIST_ENTRY " NAME ); +.BI "LIST_REMOVE(TYPE *" elm ", LIST_ENTRY " NAME ); + +.BI "TAILQ_ENTRY(" TYPE ); +.BI "TAILQ_HEAD("HEADNAME ", " TYPE ); +.BI "TAILQ_INIT(TAILQ_HEAD *" head ); +.BI "TAILQ_INSERT_AFTER(TAILQ_HEAD *" head ", TYPE *" listelm ", " +.BI " TYPE *" elm ", TAILQ_ENTRY " NAME ); +.BI "TAILQ_INSERT_HEAD(TAILQ_HEAD *" head ", " +.BI " TYPE *" elm ", TAILQ_ENTRY " NAME ); +.BI "TAILQ_INSERT_TAIL(TAILQ_HEAD *" head ", " +.BI " TYPE *" elm ", TAILQ_ENTRY " NAME ); +.BI "TAILQ_REMOVE(TAILQ_HEAD *" head ", TYPE *" elm ", TAILQ_ENTRY " NAME ); + +.BI CIRCLEQ_ENTRY( TYPE ); +.BI "CIRCLEQ_HEAD(" HEADNAME ", " TYPE ); +.BI "CIRCLEQ_INIT(CIRCLEQ_HEAD *" head ); +.BI "CIRCLEQ_INSERT_AFTER(CIRCLEQ_HEAD *" head ", TYPE *" listelm ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.BI "CIRCLEQ_INSERT_BEFORE(CIRCLEQ_HEAD *" head ", TYPE *" listelm ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.BI "CIRCLEQ_INSERT_HEAD(CIRCLEQ_HEAD *" head ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.BI "CIRCLEQ_INSERT_TAIL(CIRCLEQ_HEAD *" head ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.BI "CIRCLEQ_REMOVE(CIRCLEQ_HEAD *" head ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.fi +.SH DESCRIPTION +These macros define and operate on three types of data structures: +lists, tail queues, and circular queues. +All three structures support the following functionality: +.sp +.RS 4 +.PD 0 +.IP * 4 +Insertion of a new entry at the head of the list. +.IP * +Insertion of a new entry after any element in the list. +.IP * +Removal of any entry in the list. +.IP * +Forward traversal through the list. +.PD +.RE +.PP +Lists are the simplest of the three data structures and support +only the above functionality. + +Tail queues add the following functionality: +.RS 4 +.IP * 4 +Entries can be added at the end of a list. +.RE +.PP +However: +.sp +.RS 4 +.PD 0 +.IP 1. 4 +All list insertions and removals must specify the head of the list. +.IP 2. +Each head entry requires two pointers rather than one. +.IP 3. +Code size is about 15% greater and operations run about 20% slower +than lists. +.PD +.RE +.PP +Circular queues add the following functionality: +.sp +.RS 4 +.PD 0 +.IP * 4 +Entries can be added at the end of a list. +.IP * +Entries can be added before another entry. +.IP * +They may be traversed backwards, from tail to head. +.PD +.RE +.PP +However: +.sp +.RS 4 +.PD 0 +.IP 1. 4 +All list insertions and removals must specify the head of the list. +.IP 2. +Each head entry requires two pointers rather than one. +.IP 3. +The termination condition for traversal is more complex. +.IP 4. +Code size is about 40% greater and operations run about 45% slower +than lists. +.PD +.RE +.PP +In the macro definitions, +.I TYPE +is the name of a user-defined structure, +that must contain a field of type +.BR "LIST_ENTRY" , +.BR "TAILQ_ENTRY" , +or +.BR "CIRCLEQ_ENTRY" , +named +.IR NAME . +The argument +.I HEADNAME +is the name of a user-defined structure that must be declared +using the macros +.BR "LIST_HEAD" , +.BR "TAILQ_HEAD" , +or +.BR "CIRCLEQ_HEAD" . +See the examples below for further explanation of how these +macros are used. +.SS Lists +A list is headed by a structure defined by the +.B LIST_HEAD +macro. +This structure contains a single pointer to the first element +on the list. +The elements are doubly linked so that an arbitrary element can be +removed without traversing the list. +New elements can be added to the list after an existing element or +at the head of the list. +A +.B LIST_HEAD +structure is declared as follows: +.in +4n +.nf + +LIST_HEAD(HEADNAME, TYPE) head; +.fi +.in +.PP +where +.I HEADNAME +is the name of the structure to be defined, and +.I TYPE +is the type of the elements to be linked into the list. +A pointer to the head of the list can later be declared as: +.in +4n +.nf + +struct HEADNAME *headp; +.fi +.in +.PP +(The names +.IR "head" +and +.IR "headp" +are user selectable.) +.PP +The macro +.B LIST_ENTRY +declares a structure that connects the elements in +the list. +.PP +The macro +.B LIST_INIT +initializes the list referenced by +.IR head . +.PP +The macro +.B LIST_INSERT_HEAD +inserts the new element +.I elm +at the head of the list. +.PP +The macro +.B LIST_INSERT_AFTER +inserts the new element +.I elm +after the element +.IR listelm . +.PP +The macro +.B LIST_REMOVE +removes the element +.I elm +from the list. +.SS List Example +.nf +LIST_HEAD(listhead, entry) head; +struct listhead *headp; /* List head. */ +struct entry { + ... + LIST_ENTRY(entry) entries; /* List. */ + ... +} *n1, *n2, *np; + +LIST_INIT(&head); /* Initialize the list. */ + +n1 = malloc(sizeof(struct entry)); /* Insert at the head. */ +LIST_INSERT_HEAD(&head, n1, entries); + +n2 = malloc(sizeof(struct entry)); /* Insert after. */ +LIST_INSERT_AFTER(n1, n2, entries); + /* Forward traversal. */ +for (np = head.lh_first; np != NULL; np = np\->entries.le_next) + np\-> ... + +while (head.lh_first != NULL) /* Delete. */ + LIST_REMOVE(head.lh_first, entries); +.fi +.SS Tail Queues +A tail queue is headed by a structure defined by the +.B TAILQ_HEAD +macro. +This structure contains a pair of pointers, +one to the first element in the tail queue and the other to +the last element in the tail queue. +The elements are doubly linked so that an arbitrary element can be +removed without traversing the tail queue. +New elements can be added to the tail queue after an existing element, +at the head of the tail queue, or at the end of the tail queue. +A +.B TAILQ_HEAD +structure is declared as follows: +.in +4n +.nf + +TAILQ_HEAD(HEADNAME, TYPE) head; +.fi +.in +.PP +where +.IR "HEADNAME" +is the name of the structure to be defined, and +.IR "TYPE" +is the type of the elements to be linked into the tail queue. +A pointer to the head of the tail queue can later be declared as: +.in +4n +.nf + +struct HEADNAME *headp; +.fi +.in +.PP +(The names +.IR "head" +and +.IR "headp" +are user selectable.) +.PP +The macro +.B TAILQ_ENTRY +declares a structure that connects the elements in +the tail queue. +.PP +The macro +.B TAILQ_INIT +initializes the tail queue referenced by +.IR head . +.PP +The macro +.B TAILQ_INSERT_HEAD +inserts the new element +.I elm +at the head of the tail queue. +.PP +The macro +.B TAILQ_INSERT_TAIL +inserts the new element +.I elm +at the end of the tail queue. +.PP +The macro +.B TAILQ_INSERT_AFTER +inserts the new element +.I elm +after the element +.IR listelm . +.PP +The macro +.B TAILQ_REMOVE +removes the element +.I elm +from the tail queue. +.SS Tail Queue Example +.nf +TAILQ_HEAD(tailhead, entry) head; +struct tailhead *headp; /* Tail queue head. */ +struct entry { + ... + TAILQ_ENTRY(entry) entries; /* Tail queue. */ + ... +} *n1, *n2, *np; + +TAILQ_INIT(&head); /* Initialize the queue. */ + +n1 = malloc(sizeof(struct entry)); /* Insert at the head. */ +TAILQ_INSERT_HEAD(&head, n1, entries); + +n1 = malloc(sizeof(struct entry)); /* Insert at the tail. */ +TAILQ_INSERT_TAIL(&head, n1, entries); + +n2 = malloc(sizeof(struct entry)); /* Insert after. */ +TAILQ_INSERT_AFTER(&head, n1, n2, entries); + /* Forward traversal. */ +for (np = head.tqh_first; np != NULL; np = np\->entries.tqe_next) + np\-> ... + /* Delete. */ +while (head.tqh_first != NULL) + TAILQ_REMOVE(&head, head.tqh_first, entries); +.fi +.SS Circular Queues +A circular queue is headed by a structure defined by the +.B CIRCLEQ_HEAD +macro. +This structure contains a pair of pointers, +one to the first element in the circular queue and the other to the +last element in the circular queue. +The elements are doubly linked so that an arbitrary element can be +removed without traversing the queue. +New elements can be added to the queue after an existing element, +before an existing element, at the head of the queue, or at the end +of the queue. +A +.B CIRCLEQ_HEAD +structure is declared as follows: +.in +4n +.nf + +CIRCLEQ_HEAD(HEADNAME, TYPE) head; +.fi +.in +.PP +where +.IR "HEADNAME" +is the name of the structure to be defined, and +.IR "TYPE" +is the type of the elements to be linked into the circular queue. +A pointer to the head of the circular queue can later be declared as: +.in +4n +.nf + +struct HEADNAME *headp; +.fi +.in +.PP +(The names +.IR "head" +and +.IR "headp" +are user selectable.) +.PP +The macro +.B CIRCLEQ_ENTRY +declares a structure that connects the elements in +the circular queue. +.PP +The macro +.B CIRCLEQ_INIT +initializes the circular queue referenced by +.IR head . +.PP +The macro +.B CIRCLEQ_INSERT_HEAD +inserts the new element +.I elm +at the head of the circular queue. +.PP +The macro +.B CIRCLEQ_INSERT_TAIL +inserts the new element +.I elm +at the end of the circular queue. +.PP +The macro +.B CIRCLEQ_INSERT_AFTER +inserts the new element +.I elm +after the element +.IR listelm . +.PP +The macro +.B CIRCLEQ_INSERT_BEFORE +inserts the new element +.I elm +before the element +.IR listelm . +.PP +The macro +.B CIRCLEQ_REMOVE +removes the element +.I elm +from the circular queue. +.SS Circular Queue Example +.nf +CIRCLEQ_HEAD(circleq, entry) head; +struct circleq *headp; /* Circular queue head. */ +struct entry { + ... + CIRCLEQ_ENTRY(entry) entries; /* Circular queue. */ + ... +} *n1, *n2, *np; + +CIRCLEQ_INIT(&head); /* Initialize the circular queue. */ + +n1 = malloc(sizeof(struct entry)); /* Insert at the head. */ +CIRCLEQ_INSERT_HEAD(&head, n1, entries); + +n1 = malloc(sizeof(struct entry)); /* Insert at the tail. */ +CIRCLEQ_INSERT_TAIL(&head, n1, entries); + +n2 = malloc(sizeof(struct entry)); /* Insert after. */ +CIRCLEQ_INSERT_AFTER(&head, n1, n2, entries); + +n2 = malloc(sizeof(struct entry)); /* Insert before. */ +CIRCLEQ_INSERT_BEFORE(&head, n1, n2, entries); + /* Forward traversal. */ +for (np = head.cqh_first; np != (void *)&head; + np = np\->entries.cqe_next) + np\-> ... + /* Reverse traversal. */ +for (np = head.cqh_last; np != (void *)&head; np = np\->entries.cqe_prev) + np\-> ... + /* Delete. */ +while (head.cqh_first != (void *)&head) + CIRCLEQ_REMOVE(&head, head.cqh_first, entries); +.fi +.SH "CONFORMING TO" +Not in POSIX.1-2001. +Present on the BSDs. +The +queue functions first appeared in +4.4BSD. diff --git a/original/man3/raise.3 b/original/man3/raise.3 new file mode 100644 index 00000000..6fcd41b0 --- /dev/null +++ b/original/man3/raise.3 @@ -0,0 +1,70 @@ +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" 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. +.\" License. +.\" Modified Sat Jul 24 18:40:56 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995 by Mike Battersby (mib@deakin.edu.au) +.\" +.TH RAISE 3 2008-10-17 "GNU" "Linux Programmer's Manual" +.SH NAME +raise \- send a signal to the caller +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int raise(int " sig ); +.fi +.SH DESCRIPTION +The +.BR raise () +function sends a signal to the calling process or thread. +In a single-threaded program it is equivalent to +.sp +.in +4n +.nf +kill(getpid(), sig); +.fi +.in +.PP +In a multithreaded program it is equivalent to +.sp +.in +4n +.nf +pthread_kill(pthread_self(), sig); +.fi +.in +.PP +If the signal causes a handler to be called, +.BR raise () +will only return after the signal handler has returned. +.SH "RETURN VALUE" +.BR raise () +returns 0 on success, and nonzero for failure. +.SH "CONFORMING TO" +C89, C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR getpid (2), +.BR kill (2), +.BR sigaction (2), +.BR signal (2), +.BR pthread_kill (3), +.BR signal (7) diff --git a/original/man3/rand.3 b/original/man3/rand.3 new file mode 100644 index 00000000..e65e69e3 --- /dev/null +++ b/original/man3/rand.3 @@ -0,0 +1,167 @@ +.\" 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, Nicolás Lichtmaier +.\" with contribution from Francesco Potorti +.\" Modified 2003-11-15, aeb, added rand_r +.\" +.TH RAND 3 2008-08-29 "" "Linux Programmer's Manual" +.SH NAME +rand, rand_r, srand \- pseudo-random number generator +.SH SYNOPSIS +.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 +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR rand_r (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.SH DESCRIPTION +The +.BR rand () +function returns a pseudo-random integer in +the range [0,\ \fBRAND_MAX\fR]. +.PP +The +.BR srand () +function sets its argument as the seed for a new +sequence of pseudo-random integers to be returned by +.BR rand (). +These sequences are repeatable by calling +.BR srand () +with the same +seed value. +.PP +If no seed value is provided, the +.BR rand () +function is automatically +seeded with a value of 1. +.PP +The function +.BR rand () +is not reentrant or thread-safe, since it +uses hidden state that is modified on each call. +This might just be +the seed value to be used by the next call, or it might be something +more elaborate. +In order to get reproducible behavior in a threaded +application, this state must be made explicit. +The function +.BR rand_r () +is supplied with a pointer to an +.IR "unsigned int" , +to be used as state. +This is a very small amount of state, so this function will be a weak +pseudo-random generator. +Try +.BR drand48_r (3) +instead. +.SH "RETURN VALUE" +The +.BR rand () +and +.BR rand_r () +functions return a value +between 0 and +.BR RAND_MAX . +The +.BR srand () +function returns no value. +.SH "CONFORMING TO" +The functions +.BR rand () +and +.BR srand () +conform to SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +The function +.BR rand_r () +is from POSIX.1-2001. +POSIX.1-2008 marks +.BR rand_r () +as obsolete. +.SH NOTES +The versions of +.BR rand () +and +.BR srand () +in the Linux C Library use +the same random number generator as +.BR random (3) +and +.BR srandom (3), +so +the lower-order bits should be as random as the higher-order bits. +However, on older +.BR rand () +implementations, and on current implementations on different systems, +the lower-order bits are much less random than the higher-order bits. +Do not use this function in applications intended to be portable +when good randomness is needed. +(Use +.BR random (3) +instead.) +.SH EXAMPLE +POSIX.1-2001 gives the following example of an implementation of +.BR rand () +and +.BR srand (), +possibly useful when one needs the same sequence on two different machines. +.sp +.in +4n +.nf +static unsigned long next = 1; + +/* RAND_MAX assumed to be 32767 */ +int myrand(void) { + next = next * 1103515245 + 12345; + return((unsigned)(next/65536) % 32768); +} + +void mysrand(unsigned seed) { + next = seed; +} +.fi +.in +.SH "SEE ALSO" +.BR drand48 (3), +.BR random (3) diff --git a/original/man3/rand_r.3 b/original/man3/rand_r.3 new file mode 100644 index 00000000..b007c2fc --- /dev/null +++ b/original/man3/rand_r.3 @@ -0,0 +1 @@ +.so man3/rand.3 diff --git a/original/man3/random.3 b/original/man3/random.3 new file mode 100644 index 00000000..7568dc1b --- /dev/null +++ b/original/man3/random.3 @@ -0,0 +1,164 @@ +.\" 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 Sun Mar 28 00:25:51 1993, David Metcalfe +.\" Modified Sat Jul 24 18:13:39 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Aug 20 21:47:07 2000, aeb +.\" +.TH RANDOM 3 2009-02-03 "GNU" "Linux Programmer's Manual" +.SH NAME +random, srandom, initstate, setstate \- random number generator +.SH SYNOPSIS +.nf +.B #include +.sp +.B long int random(void); + +.BI "void srandom(unsigned int " seed ); + +.BI "char *initstate(unsigned int " seed ", char *" state ", size_t " n ); +.br +.BI "char *setstate(char *" state ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR random (), +.BR srandom (), +.BR initstate (), +.BR setstate (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.ad b +.SH DESCRIPTION +The +.BR random () +function uses a nonlinear additive feedback random +number generator employing a default table of size 31 long integers to +return successive pseudo-random numbers in +the range from 0 to \fBRAND_MAX\fR. +The period of this random number generator is very large, approximately +.IR "16\ *\ ((2^31)\ \-\ 1)" . +.PP +The +.BR srandom () +function sets its argument as the seed for a new +sequence of pseudo-random integers to be returned by +.BR random (). +These sequences are repeatable by calling +.BR srandom () +with the same +seed value. +If no seed value is provided, the +.BR random () +function +is automatically seeded with a value of 1. +.PP +The +.BR initstate () +function allows a state array \fIstate\fP to +be initialized for use by +.BR random (). +The size of the state array +\fIn\fP is used by +.BR initstate () +to decide how sophisticated a +random number generator it should use \(em the larger the state array, +the better the random numbers will be. +\fIseed\fP is the seed for the +initialization, which specifies a starting point for the random number +sequence, and provides for restarting at the same point. +.PP +The +.BR setstate () +function changes the state array used by the +.BR random () +function. +The state array \fIstate\fP is used for +random number generation until the next call to +.BR initstate () +or +.BR setstate (). +\fIstate\fP must first have been initialized +using +.BR initstate () +or be the result of a previous call of +.BR setstate (). +.SH "RETURN VALUE" +The +.BR random () +function returns a value between 0 and +.BR RAND_MAX . +The +.BR srandom () +function returns no value. +The +.BR initstate () +and +.BR setstate () +functions return a pointer to the previous state +array, or NULL on error. +.SH ERRORS +.TP +.B EINVAL +A state array of less than 8 bytes was specified to +.BR initstate (). +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +.SH NOTES +Current "optimal" values for the size of the state array \fIn\fP are +8, 32, 64, 128, and 256 bytes; other amounts will be rounded down to +the nearest known amount. +Using less than 8 bytes will cause an +error. +.PP +This function should not be used in cases where multiple threads use +.BR random () +and the behavior should be reproducible. +Use +.BR random_r (3) +for that purpose. +.PP +Random-number generation is a complex topic. +.I Numerical Recipes in C: The Art of Scientific Computing +(William H. Press, Brian P. Flannery, Saul A. Teukolsky, William +T. Vetterling; New York: Cambridge University Press, 2007, 3rd ed.) +provides an excellent discussion of practical random-number generation +issues in Chapter 7 (Random Numbers). +.PP +For a more theoretical discussion which also covers many practical issues +in depth, see Chapter 3 (Random Numbers) in Donald E. Knuth's +.IR "The Art of Computer Programming" , +volume 2 (Seminumerical Algorithms), 2nd ed.; Reading, Massachusetts: +Addison-Wesley Publishing Company, 1981. +.SH "SEE ALSO" +.BR drand48 (3), +.BR rand (3), +.BR random_r (3), +.BR srand (3) diff --git a/original/man3/random_r.3 b/original/man3/random_r.3 new file mode 100644 index 00000000..db64996e --- /dev/null +++ b/original/man3/random_r.3 @@ -0,0 +1,128 @@ +.\" Copyright 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. +.\" +.\" +.TH RANDOM_R 3 2008-03-07 "GNU" "Linux Programmer's Manual" +.SH NAME +random_r, srandom_r, initstate_r, setstate_r \- reentrant +random number generator +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int random_r(struct random_data *" buf ", int32_t *" result ); + +.BI "int srandom_r(unsigned int " seed ", struct random_data *" buf ); + +.BI "int initstate_r(unsigned int " seed ", char *" statebuf , +.BI " size_t " statelen ", struct random_data *" buf ); +.br +.BI "int setstate_r(char *" statebuf ", struct random_data *" buf ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR random_r (), +.BR srandom_r (), +.BR initstate_r (), +.BR setstate_r (): +_SVID_SOURCE || _BSD_SOURCE +.ad b +.SH DESCRIPTION +These functions are the reentrant equivalents +of the functions described in +.BR random (3). +They are suitable for use in multithreaded programs where each thread +needs to obtain an independent, reproducible sequence of random numbers. + +The +.BR random_r () +function is like +.BR random (3), +except that instead of using state information maintained +in a global variable, +it uses the state information in the argument pointed to by +.IR buf . +The generated random number is returned in the argument +.IR result . + +The +.BR srandom_r () +function is like +.BR srandom (3), +except that it initializes the seed for the random number generator +whose state is maintained in the object pointed to by +.IR buf , +instead of the seed associated with the global state variable. + +The +.BR initstate_r () +function is like +.BR initstate (3) +except that it initializes the state in the object pointed to by +.IR buf , +rather than initializing the global state variable. + +The +.BR setstate_r () +function is like +.BR setstate (3) +except that it modifies the state in the object pointer to by +.IR buf , +rather than modifying the global state variable. +.SH "RETURN VALUE" +All of these functions return 0 on success, or \-1 on error. +.SH ERRORS +.TP +.B EINVAL +A state array of less than 8 bytes was specified to +.BR initstate_r (). +.TP +.B EINVAL +The +.I statebuf +or +.I buf +argument to +.BR setstate_r () +was NULL. +.TP +.B EINVAL +The +.I buf +or +.I result +argument to +.BR random_r () +was NULL. +.SH "CONFORMING TO" +These functions are nonstandard glibc extensions. +.\" These functions appear to be on Tru64, but don't seem to be on +.\" Solaris, HP-UX, or FreeBSD. +.SH "SEE ALSO" +.BR drand48 (3), +.BR rand (3), +.BR random (3) diff --git a/original/man3/rawmemchr.3 b/original/man3/rawmemchr.3 new file mode 100644 index 00000000..b62c8f10 --- /dev/null +++ b/original/man3/rawmemchr.3 @@ -0,0 +1 @@ +.so man3/memchr.3 diff --git a/original/man3/rcmd.3 b/original/man3/rcmd.3 new file mode 100644 index 00000000..0c4e386e --- /dev/null +++ b/original/man3/rcmd.3 @@ -0,0 +1,223 @@ +.\" $NetBSD: rcmd.3,v 1.9 1996/05/28 02:07:39 mrg Exp $ +.\" +.\" Copyright (c) 1983, 1991, 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. +.\" +.\" @(#)rcmd.3 8.1 (Berkeley) 6/4/93 +.\" +.\" Contributed as Linux man page by David A. Holland, 970908 +.\" I have not checked whether the Linux situation is exactly the same. +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.TH RCMD 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH NAME +rcmd, rresvport, iruserok, ruserok \- routines for returning a +stream to a remote command +.SH SYNOPSIS +.nf +.B #include \ \ \fP/* Or on some systems */ +.sp +.BI "int rcmd(char **" ahost ", int " inport ", const char *" locuser ", " +.BI " const char *" remuser ", const char *" cmd ", int *" fd2p ); +.sp +.BI "int rresvport(int *" port ); +.sp +.BI "int iruserok(uint32_t " raddr ", int " superuser ", " +.BI " const char *" ruser ", const char *" luser ); +.sp +.BI "int ruserok(const char *" rhost ", int " superuser ", " +.BI " const char *" ruser ", const char *" luser ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR rcmd (), +.BR rresvport (), +.BR ruserok (): +_BSD_SOURCE +.SH DESCRIPTION +The +.BR rcmd () +function is used by the superuser to execute a command on +a remote machine using an authentication scheme based +on privileged port numbers. +The +.BR rresvport () +function +returns a descriptor to a socket +with an address in the privileged port space. +The +.BR iruserok () +and +.BR ruserok () +functions are used by servers +to authenticate clients requesting service with +.BR rcmd (). +All four functions are present in the same file and are used +by the +.BR rshd (8) +server (among others). +.PP +The +.BR rcmd () +function +looks up the host +.I *ahost +using +.BR gethostbyname (3), +returning \-1 if the host does not exist. +Otherwise +.I *ahost +is set to the standard name of the host +and a connection is established to a server +residing at the well-known Internet port +.IR inport . +.PP +If the connection succeeds, +a socket in the Internet domain of type +.BR SOCK_STREAM +is returned to the caller, and given to the remote +command as +.IR stdin +and +.IR stdout . +If +.I fd2p +is nonzero, then an auxiliary channel to a control +process will be set up, and a descriptor for it will be placed +in +.IR *fd2p . +The control process will return diagnostic +output from the command (unit 2) on this channel, and will also +accept bytes on this channel as being Unix signal numbers, to be +forwarded to the process group of the command. +If +.I fd2p +is 0, then the +.IR stderr +(unit 2 of the remote +command) will be made the same as the +.IR stdout +and no +provision is made for sending arbitrary signals to the remote process, +although you may be able to get its attention by using out-of-band data. +.PP +The protocol is described in detail in +.BR rshd (8). +.PP +The +.BR rresvport () +function is used to obtain a socket with a privileged +address bound to it. +This socket is suitable for use by +.BR rcmd () +and several other functions. +Privileged Internet ports are those in the range 0 to 1023. +Only the superuser is allowed to bind an address of this sort to a socket. +.PP +The +.BR iruserok () +and +.BR ruserok () +functions take a remote host's IP address or name, respectively, +two usernames and a flag indicating whether the local user's +name is that of the superuser. +Then, if the user is +.I not +the superuser, it checks the +.IR /etc/hosts.equiv +file. +If that lookup is not done, or is unsuccessful, the +.IR .rhosts +in the local user's home directory is checked to see if the request for +service is allowed. +.PP +If this file does not exist, is not a regular file, is owned by anyone +other than the user or the superuser, or is writable by anyone other +than the owner, the check automatically fails. +Zero is returned if the machine name is listed in the +.IR hosts.equiv +file, or the host and remote username are found in the +.IR .rhosts +file; otherwise +.BR iruserok () +and +.BR ruserok () +return \-1. +If the local domain (as obtained from +.BR gethostname (2)) +is the same as the remote domain, only the machine name need be specified. +.PP +If the IP address of the remote host is known, +.BR iruserok () +should be used in preference to +.BR ruserok (), +as it does not require trusting the DNS server for the remote host's domain. +.SH RETURN VALUE +The +.BR rcmd () +function +returns a valid socket descriptor on success. +It returns \-1 on error and prints a diagnostic message on the standard error. +.PP +The +.BR rresvport () +function +returns a valid, bound socket descriptor on success. +It returns \-1 on error with the global value +.I errno +set according to the reason for failure. +The error code +.BR EAGAIN +is overloaded to mean "All network ports in use." +.SH "CONFORMING TO" +Not in POSIX.1-2001. +Present on the BSDs, Solaris, and many other systems. +These +functions appeared in +4.2BSD. +.SH BUGS +.BR iruserok () +is not declared in glibc headers. +.\" Bug filed 25 Nov 2007: +.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=5399 +.SH SEE ALSO +.BR rlogin (1), +.BR rsh (1), +.BR intro (2), +.BR rexec (3), +.BR rexecd (8), +.BR rlogind (8), +.BR rshd (8) diff --git a/original/man3/re_comp.3 b/original/man3/re_comp.3 new file mode 100644 index 00000000..04ce94ce --- /dev/null +++ b/original/man3/re_comp.3 @@ -0,0 +1,73 @@ +.\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.) +.\" +.\" 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. +.\" +.\" Wed Jun 14 16:10:28 BST 1995 Wilf. (G.Wilford@@ee.surrey.ac.uk) +.\" +.TH RE_COMP 3 1995-07-14 "GNU" "Linux Programmer's Manual" +.SH NAME +re_comp, re_exec \- BSD regex functions +.SH SYNOPSIS +.B #define _REGEX_RE_COMP +.br +.B #include +.br +.B #include +.sp +.BI "char *re_comp(char *" regex ); +.sp +.BI "int re_exec(char *" string ); +.SH DESCRIPTION +.BR re_comp () +is used to compile the null-terminated regular expression pointed to by +.IR regex . +The compiled pattern occupies a static area, the pattern buffer, +which is overwritten by subsequent use of +.BR re_comp (). +If +.I regex +is NULL, +no operation is performed and the pattern buffer's contents are not +altered. + +.BR re_exec () +is used to assess whether the null-terminated string pointed to by +.I string +matches the previously compiled +.IR regex . +.SH "RETURN VALUE" +.BR re_comp () +returns NULL on successful compilation of +.I regex +otherwise it returns a pointer to an appropriate error message. + +.BR re_exec () +returns 1 for a successful match, zero for failure. +.SH "CONFORMING TO" +4.3BSD. +.SH NOTES +These functions are obsolete; the functions documented in +.BR regcomp (3) +should be used instead. +.SH "SEE ALSO" +.BR regcomp (3), +.BR regex (7), +GNU regex manual diff --git a/original/man3/re_exec.3 b/original/man3/re_exec.3 new file mode 100644 index 00000000..36aba391 --- /dev/null +++ b/original/man3/re_exec.3 @@ -0,0 +1 @@ +.so man3/re_comp.3 diff --git a/original/man3/readdir.3 b/original/man3/readdir.3 new file mode 100644 index 00000000..90499a67 --- /dev/null +++ b/original/man3/readdir.3 @@ -0,0 +1,249 @@ +.\" Copyright (C) 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 Sat Jul 24 16:09:49 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl) +.\" Modified 22 July 1996 by Andries Brouwer (aeb@cwi.nl) +.\" 2007-07-30 Ulrich Drepper , mtk: +.\" Rework discussion of nonstandard structure fields. +.\" 2008-09-11, mtk, Document readdir_r(). +.\" +.TH READDIR 3 2009-07-04 "" "Linux Programmer's Manual" +.SH NAME +readdir, readdir_r \- read a directory +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "struct dirent *readdir(DIR *" dirp ); +.sp +.BI "int readdir_r(DIR *" dirp ", struct dirent *" entry \ +", struct dirent **" result ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.ad l +.in +.sp +.BR readdir_r (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +The +.BR readdir () +function returns a pointer to a \fIdirent\fP structure +representing the next directory entry in the directory stream pointed +to by \fIdirp\fP. +It returns NULL on reaching the end of the directory stream or if +an error occurred. +.PP +On Linux, the +.I dirent +structure is defined as follows: +.PP +.in +4n +.nf +struct dirent { + ino_t d_ino; /* inode number */ + off_t d_off; /* offset to the next dirent */ + unsigned short d_reclen; /* length of this record */ + unsigned char d_type; /* type of file; not supported + by all file system types */ + char d_name[256]; /* filename */ +}; +.fi +.in +.PP +The only fields in the +.I dirent +structure that are mandated by POSIX.1 are: +.IR d_name [], +of unspecified size, with at most +.B NAME_MAX +characters preceding the terminating null byte; +and (as an XSI extension) +.IR d_ino . +The other fields are unstandardized, and not present on all systems; +see NOTES below for some further details. +.PP +The data returned by +.BR readdir () +may be overwritten by subsequent calls to +.BR readdir () +for the same directory stream. + +The +.BR readdir_r () +function is a reentrant version of +.BR readdir (). +It reads the next directory entry from the directory stream +.IR dirp , +and returns it in the caller-allocated buffer pointed to by +.IR entry . +(See NOTES for information on allocating this buffer.) +A pointer to the returned item is placed in +.IR *result ; +if the end of the directory stream was encountered, +then NULL is instead returned in +.IR *result . +.SH "RETURN VALUE" +On success, +.BR readdir () +returns a pointer to a +.I dirent +structure. +(This structure may be statically allocated; do not attempt to +.BR free (3) +it.) +If the end of the directory stream is reached, NULL is returned and +.I errno +is not changed. +If an error occurs, NULL is returned and +.I errno +is set appropriately. + +The +.BR readdir_r () +function returns 0 on success. +On error, it returns a positive error number. +If the end of the directory stream is reached, +.BR readdir_r () +returns 0, and returns NULL in +.IR *result . +.SH ERRORS +.TP +.B EBADF +Invalid directory stream descriptor \fIdirp\fP. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH NOTES +Only the fields +.I d_name +and +.I d_ino +are specified in POSIX.1-2001. +The remaining fields are available on many, but not all systems. +Under glibc, +programs can check for the availability of the fields not defined +in POSIX.1 by testing whether the macros +.BR _DIRENT_HAVE_D_NAMLEN , +.BR _DIRENT_HAVE_D_RECLEN , +.BR _DIRENT_HAVE_D_OFF , +or +.B _DIRENT_HAVE_D_TYPE +are defined. + +Other than Linux, the +.I d_type +field is available mainly only on BSD systems. +This field makes it possible to avoid the expense of calling +.BR lstat (2) +if further actions depend on the type of the file. +If the +.B _BSD_SOURCE +feature test macro is defined, +then glibc defines the following macro constants +for the value returned in +.IR d_type : +.TP 12 +.B DT_BLK +This is a block device. +.TP +.B DT_CHR +This is a character device. +.TP +.B DT_DIR +This is a directory. +.TP +.B DT_FIFO +This is a named pipe (FIFO). +.TP +.B DT_LNK +This is a symbolic link. +.TP +.B DT_REG +This is a regular file. +.TP +.B DT_SOCK +This is a Unix domain socket. +.TP +.B DT_UNKNOWN +The file type is unknown. +.\" The glibc manual says that on some systems this is the only +.\" value returned +.PP +If the file type could not be determined, the value +.B DT_UNKNOWN +is returned in +.IR d_type . + +Currently, +.\" kernel 2.6.27 +.\" The same sentence is in getdents.2 +only some file systems (among them: Btrfs, ext2, ext3, and ext4) +have full support returning the file type in +.IR d_type . +All applications must properly handle a return of +.BR DT_UNKNOWN . + +Since POSIX.1 does not specify the size of the +.I d_name +field, and other nonstandard fields may precede that field within the +.I dirent +structure, portable applications that use +.BR readdir_r () +should allocate the buffer whose address is passed in +.IR entry +as follows: +.in +4n +.nf + +len = offsetof(struct dirent, d_name) + + pathconf(dirpath, _PC_NAME_MAX) + 1 +entryp = malloc(len); + +.fi +.in +(POSIX.1 requires that +.I d_name +is the last field in a +.IR "struct dirent" .) +.SH "SEE ALSO" +.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), +.BR feature_test_macros (7) diff --git a/original/man3/readdir_r.3 b/original/man3/readdir_r.3 new file mode 100644 index 00000000..8caecce0 --- /dev/null +++ b/original/man3/readdir_r.3 @@ -0,0 +1 @@ +.so man3/readdir.3 diff --git a/original/man3/realloc.3 b/original/man3/realloc.3 new file mode 100644 index 00000000..a4b9d445 --- /dev/null +++ b/original/man3/realloc.3 @@ -0,0 +1 @@ +.so man3/malloc.3 diff --git a/original/man3/realpath.3 b/original/man3/realpath.3 new file mode 100644 index 00000000..73e6fdbd --- /dev/null +++ b/original/man3/realpath.3 @@ -0,0 +1,209 @@ +.\" Copyright (C) 1999 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. +.\" +.\" Rewritten old page, 990824, aeb@cwi.nl +.\" 2004-12-14, mtk, added discussion of resolved_path == NULL +.\" +.TH REALPATH 3 2009-02-23 "" "Linux Programmer's Manual" +.SH NAME +realpath \- return the canonicalized absolute pathname +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "char *realpath(const char *" path ", char *" resolved_path ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR realpath (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +.BR realpath () +expands all symbolic links and resolves references +to +.IR "/./" ", " "/../" +and extra \(aq/\(aq +characters in the null-terminated string named by +.I path +to produce a canonicalized absolute pathname. +The resulting pathname is stored as a null-terminated string, +up to a maximum of +.B PATH_MAX +bytes, +in the buffer pointed to by +.IR resolved_path . +The resulting path will have no symbolic link, +.I "/./" +or +.I "/../" +components. + +If +.I resolved_path +is specified as NULL, then +.BR realpath () +uses +.BR malloc (3) +to allocate a buffer of up to +.B PATH_MAX +bytes to hold the resolved pathname, +and returns a pointer to this buffer. +The caller should deallocate this buffer using +.BR free (3). +.\" Even if we use resolved_path == NULL, then realpath() will still +.\" return ENAMETOOLONG if the resolved pathname would exceed PATH_MAX +.\" bytes -- MTK, Dec 04 +.\" .SH HISTORY +.\" The +.\" .BR realpath () +.\" function first appeared in 4.4BSD, contributed by Jan-Simon Pendry. +.SH "RETURN VALUE" +If there is no error, +.BR realpath () +returns a pointer to the +.IR resolved_path . + +Otherwise it returns a NULL pointer, and the contents +of the array +.I resolved_path +are undefined, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EACCES +Read or search permission was denied for a component of the path prefix. +.TP +.B EINVAL +Either +.I path +or +.I resolved_path +is NULL. +(In libc5 this would just cause a segfault.) +But, see NOTES below. +.TP +.B EIO +An I/O error occurred while reading from the file system. +.TP +.B ELOOP +Too many symbolic links were encountered in translating the pathname. +.TP +.B ENAMETOOLONG +A component of a pathname exceeded +.B NAME_MAX +characters, or an entire pathname exceeded +.B PATH_MAX +characters. +.TP +.B ENOENT +The named file does not exist. +.TP +.B ENOTDIR +A component of the path prefix is not a directory. +.SH VERSIONS +On Linux this function appeared in libc 4.5.21. +.SH "CONFORMING TO" +4.4BSD, POSIX.1-2001. + +POSIX.1-2001 says that the behavior if +.I resolved_path +is NULL is implementation-defined. +POSIX.1-2008 specifies the behavior described in this page. +.SH NOTES +In 4.4BSD and Solaris the limit on the pathname length is +.B MAXPATHLEN +(found in \fI\fP). +SUSv2 prescribes +.B PATH_MAX +and +.BR NAME_MAX , +as found in \fI\fP or provided by the +.BR pathconf (3) +function. +A typical source fragment would be +.LP +.in +4n +.nf +#ifdef PATH_MAX + path_max = PATH_MAX; +#else + path_max = pathconf(path, _PC_PATH_MAX); + if (path_max <= 0) + path_max = 4096; +#endif +.fi +.in +.LP +(But see the BUGS section.) +.LP +The 4.4BSD, Linux and SUSv2 versions always return an absolute +pathname. +Solaris may return a relative pathname when the +.I path +argument is relative. +The prototype of +.BR realpath () +is given in \fI\fP in libc4 and libc5, +but in \fI\fP everywhere else. +.SH BUGS +The POSIX.1-2001 standard version of this function is broken by design, +since it is impossible to determine a suitable size for the output buffer, +.IR resolved_path . +According to POSIX.1-2001 a buffer of size +.B PATH_MAX +suffices, but +.B PATH_MAX +need not be a defined constant, and may have to be obtained using +.BR pathconf (3). +And asking +.BR pathconf (3) +does not really help, since, on the one hand POSIX warns that +the result of +.BR pathconf (3) +may be huge and unsuitable for mallocing memory, +and on the other hand +.BR pathconf (3) +may return \-1 to signify that +.B PATH_MAX +is not bounded. +The +.I "resolved_path\ ==\ NULL" +feature, not standardized in POSIX.1-2001, +but standardized in POSIX.1-2008, allows this design problem to be avoided. +.LP +The libc4 and libc5 implementation contains a buffer overflow +(fixed in libc-5.4.13). +Thus, set-user-ID programs like +.BR mount (8) +need a private version. +.SH "SEE ALSO" +.BR readlink (2), +.BR canonicalize_file_name (3), +.BR getcwd (3), +.BR pathconf (3), +.BR sysconf (3) diff --git a/original/man3/recno.3 b/original/man3/recno.3 new file mode 100644 index 00000000..abbec51e --- /dev/null +++ b/original/man3/recno.3 @@ -0,0 +1,224 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)recno.3 8.5 (Berkeley) 8/18/94 +.\" +.TH RECNO 3 1994-08-18 "" "Linux Programmer's Manual" +.UC 7 +.SH NAME +recno \- record number database access method +.SH SYNOPSIS +.nf +.ft B +#include +#include +.ft R +.fi +.SH DESCRIPTION +The routine +.BR dbopen (3) +is the library interface to database files. +One of the supported file formats is record number files. +The general description of the database access methods is in +.BR dbopen (3), +this manual page describes only the recno specific information. +.PP +The record number data structure is either variable or fixed-length +records stored in a flat-file format, accessed by the logical record +number. +The existence of record number five implies the existence of records +one through four, and the deletion of record number one causes +record number five to be renumbered to record number four, as well +as the cursor, if positioned after record number one, to shift down +one record. +.PP +The recno access method specific data structure provided to +.BR dbopen (3) +is defined in the +.I +include file as follows: +.PP +.in +4n +.nf +typedef struct { + unsigned long flags; + unsigned int cachesize; + unsigned int psize; + int lorder; + size_t reclen; + unsigned char bval; + char *bfname; +} RECNOINFO; +.fi +.in +.PP +The elements of this structure are defined as follows: +.TP +flags +The flag value is specified by +.IR or 'ing +any of the following values: +.RS +.TP +.B R_FIXEDLEN +The records are fixed-length, not byte delimited. +The structure element +.I reclen +specifies the length of the record, and the structure element +.I bval +is used as the pad character. +Any records, inserted into the database, that are less than +.I reclen +bytes long are automatically padded. +.TP +.B R_NOKEY +In the interface specified by +.BR dbopen (3), +the sequential record retrieval fills in both the caller's key and +data structures. +If the +.B R_NOKEY +flag is specified, the +.I cursor +routines are not required to fill in the key structure. +This permits applications to retrieve records at the end of files without +reading all of the intervening records. +.TP +.B R_SNAPSHOT +This flag requires that a snapshot of the file be taken when +.BR dbopen (3) +is called, instead of permitting any unmodified records to be read from +the original file. +.RE +.TP +.I cachesize +A suggested maximum size, in bytes, of the memory cache. +This value is +.B only +advisory, and the access method will allocate more memory rather than fail. +If +.I cachesize +is 0 (no size is specified) a default cache is used. +.TP +.I psize +The recno access method stores the in-memory copies of its records +in a btree. +This value is the size (in bytes) of the pages used for nodes in that tree. +If +.I psize +is 0 (no page size is specified) a page size is chosen based on the +underlying file system I/O block size. +See +.BR btree (3) +for more information. +.TP +.I lorder +The byte order for integers in the stored database metadata. +The number should represent the order as an integer; for example, +big endian order would be the number 4,321. +If +.I lorder +is 0 (no order is specified) the current host order is used. +.TP +.I reclen +The length of a fixed-length record. +.TP +.I bval +The delimiting byte to be used to mark the end of a record for +variable-length records, and the pad character for fixed-length +records. +If no value is specified, newlines ("\en") are used to mark the end +of variable-length records and fixed-length records are padded with +spaces. +.TP +.I bfname +The recno access method stores the in-memory copies of its records +in a btree. +If +.I bfname +is non-NULL, it specifies the name of the btree file, +as if specified as the filename for a +.BR dbopen (3) +of a btree file. +.PP +The data part of the key/data pair used by the +.I recno +access method +is the same as other access methods. +The key is different. +The +.I data +field of the key should be a pointer to a memory location of type +.IR recno_t , +as defined in th +.I +include file. +This type is normally the largest unsigned integral type available to +the implementation. +The +.I size +field of the key should be the size of that type. +.PP +Because there can be no metadata associated with the underlying +recno access method files, any changes made to the default values +(e.g., fixed record length or byte separator value) must be explicitly +specified each time the file is opened. +.PP +In the interface specified by +.BR dbopen (3), +using the +.I put +interface to create a new record will cause the creation of multiple, +empty records if the record number is more than one greater than the +largest record currently in the database. +.SH ERRORS +The +.I recno +access method routines may fail and set +.I errno +for any of the errors specified for the library routine +.BR dbopen (3) +or the following: +.TP +.B EINVAL +An attempt was made to add a record to a fixed-length database that +was too large to fit. +.SH BUGS +Only big and little endian byte order is supported. +.SH "SEE ALSO" +.BR btree (3), +.BR dbopen (3), +.BR hash (3), +.BR mpool (3) +.sp +.IR "Document Processing in a Relational Database System" , +Michael Stonebraker, Heidi Stettner, Joseph Kalash, Antonin Guttman, +Nadene Lynn, Memorandum No. UCB/ERL M82/32, May 1982. diff --git a/original/man3/regcomp.3 b/original/man3/regcomp.3 new file mode 100644 index 00000000..c0daaf0f --- /dev/null +++ b/original/man3/regcomp.3 @@ -0,0 +1 @@ +.so man3/regex.3 diff --git a/original/man3/regerror.3 b/original/man3/regerror.3 new file mode 100644 index 00000000..c0daaf0f --- /dev/null +++ b/original/man3/regerror.3 @@ -0,0 +1 @@ +.so man3/regex.3 diff --git a/original/man3/regex.3 b/original/man3/regex.3 new file mode 100644 index 00000000..f915e09f --- /dev/null +++ b/original/man3/regex.3 @@ -0,0 +1,299 @@ +.\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.) +.\" +.\" 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. +.\" +.\" Wed Jun 14 16:10:28 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk) +.\" Tiny change in formatting - aeb, 950812 +.\" Modified 8 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) +.\" +.\" show the synopsis section nicely +.de xx +.in \\n(INu+\\$1 +.ti -\\$1 +.. +.TH REGEX 3 2008-05-29 "GNU" "Linux Programmer's Manual" +.SH NAME +regcomp, regexec, regerror, regfree \- POSIX regex functions +.SH SYNOPSIS +.nf +.B #include +.B #include + +.BI "int regcomp(regex_t *" preg ", const char *" regex ", int " cflags ); + +.BI "int regexec(const regex_t *" preg ", const char *" string \ +", size_t " nmatch , +.BI " regmatch_t " pmatch[] ", int " eflags ); + +.BI "size_t regerror(int " errcode ", const regex_t *" preg ", char *" errbuf , +.BI " size_t " errbuf_size ); + +.BI "void regfree(regex_t *" preg ); +.fi +.SH DESCRIPTION +.SS "POSIX Regex Compiling" +.BR regcomp () +is used to compile a regular expression into a form that is suitable +for subsequent +.BR regexec () +searches. + +.BR regcomp () +is supplied with +.IR preg , +a pointer to a pattern buffer storage area; +.IR regex , +a pointer to the null-terminated string and +.IR cflags , +flags used to determine the type of compilation. + +All regular expression searching must be done via a compiled pattern +buffer, thus +.BR regexec () +must always be supplied with the address of a +.BR regcomp () +initialized pattern buffer. + +.I cflags +may be the +.RB bitwise- or +of one or more of the following: +.TP +.B REG_EXTENDED +Use +.B POSIX +Extended Regular Expression syntax when interpreting +.IR regex . +If not set, +.B POSIX +Basic Regular Expression syntax is used. +.TP +.B REG_ICASE +Do not differentiate case. +Subsequent +.BR regexec () +searches using this pattern buffer will be case insensitive. +.TP +.B REG_NOSUB +Support for substring addressing of matches is not required. +The +.I nmatch +and +.I pmatch +arguments to +.BR regexec () +are ignored if the pattern buffer supplied was compiled with this flag set. +.TP +.B REG_NEWLINE +Match-any-character operators don't match a newline. + +A nonmatching list +.RB ( [^...] ) +not containing a newline does not match a newline. + +Match-beginning-of-line operator +.RB ( ^ ) +matches the empty string immediately after a newline, regardless of +whether +.IR eflags , +the execution flags of +.BR regexec (), +contains +.BR REG_NOTBOL . + +Match-end-of-line operator +.RB ( $ ) +matches the empty string immediately before a newline, regardless of +whether +.I eflags +contains +.BR REG_NOTEOL . +.SS "POSIX Regex Matching" +.BR regexec () +is used to match a null-terminated string +against the precompiled pattern buffer, +.IR preg . +.I nmatch +and +.I pmatch +are used to provide information regarding the location of any matches. +.I eflags +may be the +.RB bitwise- or +of one or both of +.B REG_NOTBOL +and +.B REG_NOTEOL +which cause changes in matching behavior described below. +.TP +.B REG_NOTBOL +The match-beginning-of-line operator always fails to match (but see the +compilation flag +.B REG_NEWLINE +above) +This flag may be used when different portions of a string are passed to +.BR regexec () +and the beginning of the string should not be interpreted as the +beginning of the line. +.TP +.B REG_NOTEOL +The match-end-of-line operator always fails to match (but see the +compilation flag +.B REG_NEWLINE +above) +.SS "Byte Offsets" +Unless +.B REG_NOSUB +was set for the compilation of the pattern buffer, it is possible to +obtain substring match addressing information. +.I pmatch +must be dimensioned to have at least +.I nmatch +elements. +These are filled in by +.BR regexec () +with substring match addresses. +Any unused structure elements will contain the value \-1. + +The +.I regmatch_t +structure which is the type of +.I pmatch +is defined in +.IR . + +.in +4n +.nf +typedef struct { + regoff_t rm_so; + regoff_t rm_eo; +} regmatch_t; +.fi +.in + +Each +.I rm_so +element that is not \-1 indicates the start offset of the next largest +substring match within the string. +The relative +.I rm_eo +element indicates the end offset of the match, +which is the offset of the first character after the matching text. +.SS "Posix Error Reporting" +.BR regerror () +is used to turn the error codes that can be returned by both +.BR regcomp () +and +.BR regexec () +into error message strings. + +.BR regerror () +is passed the error code, +.IR errcode , +the pattern buffer, +.IR preg , +a pointer to a character string buffer, +.IR errbuf , +and the size of the string buffer, +.IR errbuf_size . +It returns the size of the +.I errbuf +required to contain the null-terminated error message string. +If both +.I errbuf +and +.I errbuf_size +are nonzero, +.I errbuf +is filled in with the first +.I "errbuf_size \- 1" +characters of the error message and a terminating null. +.SS "POSIX Pattern Buffer Freeing" +Supplying +.BR regfree () +with a precompiled pattern buffer, +.I preg +will free the memory allocated to the pattern buffer by the compiling +process, +.BR regcomp (). +.SH "RETURN VALUE" +.BR regcomp () +returns zero for a successful compilation or an error code for failure. + +.BR regexec () +returns zero for a successful match or +.B REG_NOMATCH +for failure. +.SH ERRORS +The following errors can be returned by +.BR regcomp (): +.TP +.B REG_BADBR +Invalid use of back reference operator. +.TP +.B REG_BADPAT +Invalid use of pattern operators such as group or list. +.TP +.B REG_BADRPT +Invalid use of repetition operators such as using \(aq*\(aq +as the first character. +.TP +.B REG_EBRACE +Un-matched brace interval operators. +.TP +.B REG_EBRACK +Un-matched bracket list operators. +.TP +.B REG_ECOLLATE +Invalid collating element. +.TP +.B REG_ECTYPE +Unknown character class name. +.TP +.B REG_EEND +Non specific error. +This is not defined by POSIX.2. +.TP +.B REG_EESCAPE +Trailing backslash. +.TP +.B REG_EPAREN +Un-matched parenthesis group operators. +.TP +.B REG_ERANGE +Invalid use of the range operator, e.g., the ending point of the range +occurs prior to the starting point. +.TP +.B REG_ESIZE +Compiled regular expression requires a pattern buffer larger than 64Kb. +This is not defined by POSIX.2. +.TP +.B REG_ESPACE +The regex routines ran out of memory. +.TP +.B REG_ESUBREG +Invalid back reference to a subexpression. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH "SEE ALSO" +.BR grep (1), +.BR regex (7), +GNU regex manual diff --git a/original/man3/regexec.3 b/original/man3/regexec.3 new file mode 100644 index 00000000..c0daaf0f --- /dev/null +++ b/original/man3/regexec.3 @@ -0,0 +1 @@ +.so man3/regex.3 diff --git a/original/man3/regfree.3 b/original/man3/regfree.3 new file mode 100644 index 00000000..c0daaf0f --- /dev/null +++ b/original/man3/regfree.3 @@ -0,0 +1 @@ +.so man3/regex.3 diff --git a/original/man3/registerrpc.3 b/original/man3/registerrpc.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/registerrpc.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/remainder.3 b/original/man3/remainder.3 new file mode 100644 index 00000000..aafc88c0 --- /dev/null +++ b/original/man3/remainder.3 @@ -0,0 +1,202 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-08-10 Walter Harms +.\" (walter.harms@informatik.uni-oldenburg.de) +.\" Modified 2003-11-18, 2004-10-05 aeb +.\" +.TH REMAINDER 3 2009-02-04 "" "Linux Programmer's Manual" +.SH NAME +drem, dremf, dreml, remainder, remainderf, remainderl \- \ +floating-point remainder function +.SH SYNOPSIS +.nf +.B #include +.sp +/* The C99 versions */ +.BI "double remainder(double " x ", double " y ); +.BI "float remainderf(float " x ", float " y ); +.BI "long double remainderl(long double " x ", long double " y ); +.sp +/* 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 ); +.sp +.fi +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR remainder (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR remainderf (), +.BR remainderl (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR drem (), +.BR dremf (), +.BR dreml (): +_SVID_SOURCE || _BSD_SOURCE +.ad b +.SH DESCRIPTION +The +.BR remainder () +function computes the remainder of dividing +.I x +by +.IR y . +The return value is +\fIx\fP\-\fIn\fP*\fIy\fP, +where +.I n +is the value +.IR "x\ /\ y" , +rounded to the nearest integer. +If the absolute value of +\fIx\fP\-\fIn\fP*\fIy\fP +is 0.5, +.I n +is chosen to be even. + +These functions are unaffected by the current rounding mode (see +.BR fenv (3)). +.LP +The +.BR drem () +function does precisely the same thing. +.SH "RETURN VALUE" +On success, these +functions return the floating-point remainder, +\fIx\fP\-\fIn\fP*\fIy\fP. +If the return value is 0, it has the sign of +.IR x . + +If +.I x +or +.I y +is a NaN, a NaN is returned. + +If +.I x +is an infinity, +and +.I y +is not a NaN, +a domain error occurs, and +a NaN is returned. + +If +.I y +is zero, +.\" FIXME . Instead, glibc gives a domain error even if x is a NaN +and +.I x +is not a NaN, +.\" Interestingly, remquo(3) does not have the same problem. +a domain error occurs, and +a NaN is returned. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is an infinity and \fIy\fP is not a NaN +.\" .I errno +.\" is set to +.\" .BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.IP +These functions do not set +.IR errno +for this case. +.\" 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 +Domain error: \fIy\fP is zero\" [XXX see bug above] and \fIx\fP is not a NaN +.I errno +is set to +.BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.SH "CONFORMING TO" +.\" IEC 60559. +The functions +.BR remainder (), +.BR remainderf (), +and +.BR remainderl () +are specified in C99 and POSIX.1-2001. + +The function +.BR drem () +is from 4.3BSD. +The +.I float +and +.I "long double" +variants +.BR dremf () +and +.BR dreml () +exist on some systems, such as Tru64 and glibc2. +Avoid the use of these functions in favor of +.BR remainder () +etc. +.SH BUGS +The call + + remainder(nan(""), 0); + +returns a NaN, as expected, but wrongly causes a domain error; +it should yield a silent NaN. +.\" FIXME . this bug occurs as at glibc 2.8. +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6779 +.SH EXAMPLE +The call "remainder(29.0, 3.0)" returns \-1. +.SH "SEE ALSO" +.BR div (3), +.BR fmod (3), +.BR remquo (3) diff --git a/original/man3/remainderf.3 b/original/man3/remainderf.3 new file mode 100644 index 00000000..b7a5b23b --- /dev/null +++ b/original/man3/remainderf.3 @@ -0,0 +1 @@ +.so man3/remainder.3 diff --git a/original/man3/remainderl.3 b/original/man3/remainderl.3 new file mode 100644 index 00000000..b7a5b23b --- /dev/null +++ b/original/man3/remainderl.3 @@ -0,0 +1 @@ +.so man3/remainder.3 diff --git a/original/man3/remove.3 b/original/man3/remove.3 new file mode 100644 index 00000000..6e44dfc3 --- /dev/null +++ b/original/man3/remove.3 @@ -0,0 +1,91 @@ +.\" This file is derived from unlink.2, which has the following copyright: +.\" +.\" --snip-- +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Ian Jackson. +.\" +.\" 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. +.\" --snip-- +.\" +.\" Edited into remove.3 shape by: +.\" Graeme W. Wilford (G.Wilford@ee.surrey.ac.uk) on 13th July 1994 +.\" +.TH REMOVE 3 2008-12-03 "GNU" "Linux Programmer's Manual" +.SH NAME +remove \- remove a file or directory +.SH SYNOPSIS +.B #include +.sp +.BI "int remove(const char *" pathname ); +.SH DESCRIPTION +.BR remove () +deletes a name from the file system. +It calls +.BR unlink (2) +for files, and +.BR rmdir (2) +for directories. + +If the removed name was the +last link to a file and no processes have the file open, the file is +deleted and the space it was using is made available for reuse. + +If the name was the last link to a file, +but any processes still have the file open, +the file will remain in existence until the last file +descriptor referring to it is closed. + +If the name referred to a symbolic link, the link is removed. + +If the name referred to a socket, FIFO, or device, the name is removed, +but processes which have the object open may continue to use it. +.SH "RETURN VALUE" +On success, zero is returned. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +The errors that occur are those for +.BR unlink (2) +and +.BR rmdir (2). +.SH "CONFORMING TO" +C89, C99, 4.3BSD, POSIX.1-2001. +.SH NOTES +Under libc4 and libc5, +.BR remove () +was an alias for +.BR unlink (2) +(and hence would not remove directories). +.SH BUGS +Infelicities in the protocol underlying NFS can cause the unexpected +disappearance of files which are still being used. +.SH "SEE ALSO" +.BR rm (1), +.BR unlink (1), +.BR link (2), +.BR mknod (2), +.BR open (2), +.BR rename (2), +.BR rmdir (2), +.BR unlink (2), +.BR mkfifo (3), +.BR symlink (7) diff --git a/original/man3/remque.3 b/original/man3/remque.3 new file mode 100644 index 00000000..a0c88361 --- /dev/null +++ b/original/man3/remque.3 @@ -0,0 +1 @@ +.so man3/insque.3 diff --git a/original/man3/remquo.3 b/original/man3/remquo.3 new file mode 100644 index 00000000..fb5cdd9b --- /dev/null +++ b/original/man3/remquo.3 @@ -0,0 +1,119 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" Distributed under GPL +.\" based on glibc infopages +.\" polished, aeb +.TH REMQUO 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH NAME +remquo, remquof, remquol \- remainder and part of quotient +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double remquo(double " x ", double " y ", int *" quo ); +.br +.BI "float remquof(float " x ", float " y ", int *" quo ); +.br +.BI "long double remquol(long double " x ", long double " y ", int *" quo ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR remquo (), +.BR remquof (), +.BR remquol (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions compute the remainder and part of the quotient +upon division of +.I x +by +.IR y . +A few bits of the quotient are stored via the +.I quo +pointer. +The remainder is returned as the function result. + +The value of the remainder is the same as that computed by the +.BR remainder (3) +function. + +The value stored via the +.I quo +pointer has the sign of +.IR "x\ /\ y" +and agrees with the quotient in at least the low order 3 bits. + +For example, \fIremquo(29.0,\ 3.0)\fP returns \-1.0 and might store 2. +Note that the actual quotient might not fit in an integer. +.\" A possible application of this function might be the computation +.\" of sin(x). Compute remquo(x, pi/2, &quo) or so. +.\" +.\" glibc, UnixWare: return 3 bits +.\" MacOS 10: return 7 bits +.SH RETURN VALUE +On success, these functions return the same value as +the analogous functions described in +.BR remainder (3). + +If +.I x +or +.I y +is a NaN, a NaN is returned. + +If +.I x +is an infinity, +and +.I y +is not a NaN, +a domain error occurs, and +a NaN is returned. + +If +.I y +is zero, +and +.I x +is not a NaN, +a domain error occurs, and +a NaN is returned. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is an infinity or \fIy\fP is 0, \ +and the other argument is not a NaN +.\" .I errno +.\" is set to +.\" .BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.PP +These functions do not set +.IR errno . +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6802 +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR fmod (3), +.BR logb (3), +.BR remainder (3) diff --git a/original/man3/remquof.3 b/original/man3/remquof.3 new file mode 100644 index 00000000..458f0512 --- /dev/null +++ b/original/man3/remquof.3 @@ -0,0 +1 @@ +.so man3/remquo.3 diff --git a/original/man3/remquol.3 b/original/man3/remquol.3 new file mode 100644 index 00000000..458f0512 --- /dev/null +++ b/original/man3/remquol.3 @@ -0,0 +1 @@ +.so man3/remquo.3 diff --git a/original/man3/res_init.3 b/original/man3/res_init.3 new file mode 100644 index 00000000..87a6d0e8 --- /dev/null +++ b/original/man3/res_init.3 @@ -0,0 +1 @@ +.so man3/resolver.3 diff --git a/original/man3/res_mkquery.3 b/original/man3/res_mkquery.3 new file mode 100644 index 00000000..87a6d0e8 --- /dev/null +++ b/original/man3/res_mkquery.3 @@ -0,0 +1 @@ +.so man3/resolver.3 diff --git a/original/man3/res_query.3 b/original/man3/res_query.3 new file mode 100644 index 00000000..87a6d0e8 --- /dev/null +++ b/original/man3/res_query.3 @@ -0,0 +1 @@ +.so man3/resolver.3 diff --git a/original/man3/res_querydomain.3 b/original/man3/res_querydomain.3 new file mode 100644 index 00000000..87a6d0e8 --- /dev/null +++ b/original/man3/res_querydomain.3 @@ -0,0 +1 @@ +.so man3/resolver.3 diff --git a/original/man3/res_search.3 b/original/man3/res_search.3 new file mode 100644 index 00000000..87a6d0e8 --- /dev/null +++ b/original/man3/res_search.3 @@ -0,0 +1 @@ +.so man3/resolver.3 diff --git a/original/man3/res_send.3 b/original/man3/res_send.3 new file mode 100644 index 00000000..87a6d0e8 --- /dev/null +++ b/original/man3/res_send.3 @@ -0,0 +1 @@ +.so man3/resolver.3 diff --git a/original/man3/resolver.3 b/original/man3/resolver.3 new file mode 100644 index 00000000..ed4e906f --- /dev/null +++ b/original/man3/resolver.3 @@ -0,0 +1,269 @@ +.\" 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-07-25 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2004-10-31 by aeb +.\" +.TH RESOLVER 3 2008-11-07 "GNU" "Linux Programmer's Manual" +.SH NAME +res_init, res_query, res_search, res_querydomain, res_mkquery, res_send, +dn_comp, dn_expand \- resolver routines +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.B extern struct state _res; +.sp +.B int res_init(void); +.sp +.BI "int res_query(const char *" dname ", int " class ", int " type , +.RS +.BI "unsigned char *" answer ", int " anslen ); +.RE +.sp +.BI "int res_search(const char *" dname ", int " class ", int " type , +.RS +.BI "unsigned char *" answer ", int " anslen ); +.RE +.sp +.BI "int res_querydomain(const char *" name ", const char *" domain , +.RS +.BI "int " class ", int " type ", unsigned char *" answer , +.BI "int " anslen ); +.RE +.sp +.BI "int res_mkquery(int " op ", const char *" dname ", int " class , +.RS +.BI "int " type ", char *" data ", int " datalen ", struct rrec *" newrr , +.BI "char *" buf ", int " buflen ); +.RE +.sp +.BI "int res_send(const char *" msg ", int " msglen ", char *" answer , +.RS +.BI "int " anslen ); +.RE +.sp +.BI "int dn_comp(unsigned char *" exp_dn ", unsigned char *" comp_dn , +.RS +.BI "int " length ", unsigned char **" dnptrs ", unsigned char *" exp_dn , +.BI "unsigned char **" lastdnptr ); +.RE +.sp +.BI "int dn_expand(unsigned char *" msg ", unsigned char *" eomorig , +.RS +.BI "unsigned char *" comp_dn ", char *" exp_dn , +.BI "int " length ); +.RE +.fi +.sp +Link with \fI\-lresolv\fP. +.SH DESCRIPTION +These functions make queries to and interpret the responses from Internet +domain name servers. +.PP +The +.BR res_init () +function reads the configuration files (see +resolv.conf(5)) to get the default domain name, search order and name +server address(es). +If no server is given, the local host is tried. +If no domain is given, that associated with the local host is used. +It can be overridden with the environment variable +.BR LOCALDOMAIN . +.BR res_init () +is normally executed by the first call to one of the +other functions. +.PP +The +.BR res_query () +function queries the name server for the +fully qualified domain name \fIname\fP of specified \fItype\fP and +\fIclass\fP. +The reply is left in the buffer \fIanswer\fP of length +\fIanslen\fP supplied by the caller. +.PP +The +.BR res_search () +function makes a query and waits for the response +like +.BR res_query (), +but in addition implements the default and search +rules controlled by +.B RES_DEFNAMES +and +.B RES_DNSRCH +(see description of +\fI_res\fP options below). +.PP +The +.BR res_querydomain () +function makes a query using +.BR res_query () +on the concatenation of \fIname\fP and \fIdomain\fP. +.PP +The following functions are lower-level routines used by +.BR res_query (). +.PP +The +.BR res_mkquery () +function constructs a query message in \fIbuf\fP +of length \fIbuflen\fP for the domain name \fIdname\fP. +The query type +\fIop\fP is usually +.BR QUERY , +but can be any of the types defined in +\fI\fP. +\fInewrr\fP is currently unused. +.PP +The +.BR res_send () +function sends a preformatted query given in +\fImsg\fP of length \fImsglen\fP and returns the answer in \fIanswer\fP +which is of length \fIanslen\fP. +It will call +.BR res_init (), +if it +has not already been called. +.PP +The +.BR dn_comp () +function compresses the domain name \fIexp_dn\fP +and stores it in the buffer \fIcomp_dn\fP of length \fIlength\fP. +The compression uses an array of pointers \fIdnptrs\fP to previously +compressed names in the current message. +The first pointer points +to the beginning of the message and the list ends with NULL. +The limit of the array is specified by \fIlastdnptr\fP. +If \fIdnptr\fP is NULL, domain names are not compressed. +If \fIlastdnptr\fP is NULL, the list +of labels is not updated. +.PP +The +.BR dn_expand () +function expands the compressed domain name +\fIcomp_dn\fP to a full domain name, which is placed in the buffer +\fIexp_dn\fP of size \fIlength\fP. +The compressed name is contained +in a query or reply message, and \fImsg\fP points to the beginning of +the message. +.PP +The resolver routines use global configuration and state information +contained in the structure \fI_res\fP, which is defined in +\fI\fP. +The only field that is normally manipulated by the +user is \fI_res.options\fP. +This field can contain the bitwise "OR" +of the following options: +.TP +.B RES_INIT +True if +.BR res_init () +has been called. +.TP +.B RES_DEBUG +Print debugging messages. +.TP +.B RES_AAONLY +Accept authoritative answers only. +.BR res_send () +continues until +it finds an authoritative answer or returns an error. [Not currently +implemented]. +.TP +.B RES_USEVC +Use TCP connections for queries rather than UDP datagrams. +.TP +.B RES_PRIMARY +Query primary domain name server only. +.TP +.B RES_IGNTC +Ignore truncation errors. +Don't retry with TCP. [Not currently +implemented]. +.TP +.B RES_RECURSE +Set the recursion desired bit in queries. +Recursion is carried out +by the domain name server, not by +.BR res_send (). +[Enabled by default]. +.TP +.B RES_DEFNAMES +If set, +.BR res_search () +will append the default domain name to +single component names, i.e., those that do not contain a dot. +[Enabled by default]. +.TP +.B RES_STAYOPEN +Used with +.B RES_USEVC +to keep the TCP connection open between queries. +.TP +.B RES_DNSRCH +If set, +.BR res_search () +will search for hostnames in the current +domain and in parent domains. +This option is used by +.BR gethostbyname (3). +[Enabled by default]. +.SH "RETURN VALUE" +The +.BR res_init () +function returns 0 on success, or \-1 if an error +occurs. +.PP +The +.BR res_query (), +.BR res_search (), +.BR res_querydomain (), +.BR res_mkquery () +and +.BR res_send () +functions return the length +of the response, or \-1 if an error occurs. +.PP +The +.BR dn_comp () +and +.BR dn_expand () +functions return the length +of the compressed name, or \-1 if an error occurs. +.SH FILES +.nf +/etc/resolv.conf resolver configuration file +/etc/host.conf resolver configuration file +.fi +.SH "CONFORMING TO" +4.3BSD. +.SH "SEE ALSO" +.BR gethostbyname (3), +.BR resolv.conf (5), +.BR resolver (5), +.BR hostname (7), +.BR named (8) diff --git a/original/man3/rewind.3 b/original/man3/rewind.3 new file mode 100644 index 00000000..a1487b5a --- /dev/null +++ b/original/man3/rewind.3 @@ -0,0 +1 @@ +.so man3/fseek.3 diff --git a/original/man3/rewinddir.3 b/original/man3/rewinddir.3 new file mode 100644 index 00000000..0ce7ecf2 --- /dev/null +++ b/original/man3/rewinddir.3 @@ -0,0 +1,57 @@ +.\" Copyright (C) 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 Sat Jul 24 18:29:11 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl) +.TH REWINDDIR 3 1995-06-11 "" "Linux Programmer's Manual" +.SH NAME +rewinddir \- reset directory stream +.SH SYNOPSIS +.nf +.B #include +.sp +.B #include +.sp +.BI "void rewinddir(DIR *" dirp ); +.fi +.SH DESCRIPTION +The +.BR rewinddir () +function resets the position of the directory +stream \fIdirp\fP to the beginning of the directory. +.SH "RETURN VALUE" +The +.BR rewinddir () +function returns no value. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH "SEE ALSO" +.BR closedir (3), +.BR opendir (3), +.BR readdir (3), +.BR scandir (3), +.BR seekdir (3), +.BR telldir (3) diff --git a/original/man3/rexec.3 b/original/man3/rexec.3 new file mode 100644 index 00000000..f7faa108 --- /dev/null +++ b/original/man3/rexec.3 @@ -0,0 +1,135 @@ +.\" Copyright (c) 1983, 1991, 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. +.\" +.\" @(#)rexec.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libcompat/4.3/rexec.3,v 1.12 2004/07/02 23:52:14 ru Exp $ +.\" +.\" Taken from FreeBSD 5.4; not checked against Linux reality (mtk) +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.TH REXEC 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH NAME +rexec \- return stream to a remote command +.SH SYNOPSIS +.nf +.sp +.BI "int rexec(char **" ahost ", int " inport ", char *" user ", " +.BI " char *" passwd ", char *" cmd ", int *" fd2p ); +.\" This function requires _BSD_SOURCE on Linux +.fi +.SH DESCRIPTION +This interface is obsoleted by +.BR rcmd (3). + +The +.BR rexec () +function +looks up the host +.IR *ahost +using +.BR gethostbyname (3), +returning \-1 if the host does not exist. +Otherwise +.IR *ahost +is set to the standard name of the host. +If a username and password are both specified, then these +are used to authenticate to the foreign host; otherwise +the environment and then the user's +.I .netrc +file in his +home directory are searched for appropriate information. +If all this fails, the user is prompted for the information. +.PP +The port +.I inport +specifies which well-known DARPA Internet port to use for +the connection; the call +.I "getservbyname(""exec"", ""tcp"")" +(see +.BR getservent (3)) +will return a pointer to a structure that contains the necessary port. +The protocol for connection is described in detail in +.BR rexecd (8). +.PP +If the connection succeeds, +a socket in the Internet domain of type +.BR SOCK_STREAM +is returned to +the caller, and given to the remote command as +.IR stdin +and +.IR stdout . +If +.I fd2p +is nonzero, then an auxiliary channel to a control +process will be setup, and a descriptor for it will be placed +in +.IR *fd2p . +The control process will return diagnostic +output from the command (unit 2) on this channel, and will also +accept bytes on this channel as being +Unix +signal numbers, to be +forwarded to the process group of the command. +The diagnostic +information returned does not include remote authorization failure, +as the secondary connection is set up after authorization has been +verified. +If +.I fd2p +is 0, then the +.IR stderr +(unit 2 of the remote +command) will be made the same as the +.IR stdout +and no +provision is made for sending arbitrary signals to the remote process, +although you may be able to get its attention by using out-of-band data. +.SH "CONFORMING TO" +Not in POSIX.1-2001. +Present on the BSDs, Solaris, and many other systems. +The +.BR rexec () +function appeared in +4.2BSD. +.SH BUGS +The +.BR rexec () +function sends the unencrypted password across the network. +.PP +The underlying service is considered a big security hole and therefore +not enabled on many sites, see +.BR rexecd (8) +for explanations. +.SH SEE ALSO +.BR rcmd (3), +.BR rexecd (8) diff --git a/original/man3/rindex.3 b/original/man3/rindex.3 new file mode 100644 index 00000000..a9cd4b34 --- /dev/null +++ b/original/man3/rindex.3 @@ -0,0 +1 @@ +.so man3/index.3 diff --git a/original/man3/rint.3 b/original/man3/rint.3 new file mode 100644 index 00000000..d911be67 --- /dev/null +++ b/original/man3/rint.3 @@ -0,0 +1,123 @@ +.\" Copyright 2001 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. +.\" +.TH RINT 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +nearbyint, nearbyintf, nearbyintl, rint, rintf, rintl \- round +to nearest integer +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double nearbyint(double " x ); +.br +.BI "float nearbyintf(float " x ); +.br +.BI "long double nearbyintl(long double " x ); +.sp +.BI "double rint(double " x ); +.br +.BI "float rintf(float " x ); +.br +.BI "long double rintl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR nearbyint (), +.BR nearbyintf (), +.BR nearbyintl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR rint (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR rintf (), +.BR rintl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR nearbyint () +functions round their argument to an integer value in floating-point +format, using the current rounding direction (see +.BR fesetround (3)) +and without raising the +.I inexact +exception. +.LP +The +.BR rint () +functions do the same, but will raise the +.I inexact +exception +.RB ( FE_INEXACT , +checkable via +.BR fetestexcept (3)) +when the result differs in value from the argument. +.SH "RETURN VALUE" +These functions return the rounded integer value. + +If \fIx\fP is integral, +0, \-0, NaN, or infinite, +\fIx\fP itself is returned. +.SH ERRORS +No errors occur. +POSIX.1-2001 documents a range error for overflows, but see NOTES. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH NOTES +SUSv2 and POSIX.1-2001 contain text about overflow (which might set +.I errno +to +.BR ERANGE , +or raise an +.B FE_OVERFLOW +exception). +In practice, the result cannot overflow on any current machine, +so this error-handling stuff is just nonsense. +(More precisely, overflow can happen only when the maximum value +of the exponent is smaller than the number of mantissa bits. +For the IEEE-754 standard 32-bit and 64-bit floating-point numbers +the maximum value of the exponent is 128 (respectively, 1024), +and the number of mantissa bits is 24 (respectively, 53).) + +If you want to store the rounded value in an integer type, +you probably want to use one of the functions described in +.BR lrint (3) +instead. +.SH "SEE ALSO" +.BR ceil (3), +.BR floor (3), +.BR lrint (3), +.BR round (3), +.BR trunc (3) diff --git a/original/man3/rintf.3 b/original/man3/rintf.3 new file mode 100644 index 00000000..3300c2c4 --- /dev/null +++ b/original/man3/rintf.3 @@ -0,0 +1 @@ +.so man3/rint.3 diff --git a/original/man3/rintl.3 b/original/man3/rintl.3 new file mode 100644 index 00000000..3300c2c4 --- /dev/null +++ b/original/man3/rintl.3 @@ -0,0 +1 @@ +.so man3/rint.3 diff --git a/original/man3/round.3 b/original/man3/round.3 new file mode 100644 index 00000000..52eabcce --- /dev/null +++ b/original/man3/round.3 @@ -0,0 +1,105 @@ +.\" Copyright 2001 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. +.\" +.TH ROUND 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +round, roundf, roundl \- round to nearest integer, away from zero +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double round(double " x ); +.br +.BI "float roundf(float " x ); +.br +.BI "long double roundl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR round (), +.BR roundf (), +.BR roundl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions round \fIx\fP to the nearest integer, but +round halfway cases away from zero (regardless of the current rounding +direction, see +.BR fenv (3)), +instead of to the nearest even integer like +.BR rint (3). + +For example, +.IR round(0.5) +is 1.0, and +.IR round(\-0.5) +is \-1.0. +.SH "RETURN VALUE" +These functions return the rounded integer value. + +If \fIx\fP is integral, +0, \-0, NaN, or infinite, +\fIx\fP itself is returned. +.SH ERRORS +No errors occur. +POSIX.1-2001 documents a range error for overflows, but see NOTES. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH NOTES +POSIX.1-2001 contains text about overflow (which might set +.I errno +to +.BR ERANGE , +or raise an +.B FE_OVERFLOW +exception). +In practice, the result cannot overflow on any current machine, +so this error-handling stuff is just nonsense. +.\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point. +(More precisely, overflow can happen only when the maximum value +of the exponent is smaller than the number of mantissa bits. +For the IEEE-754 standard 32-bit and 64-bit floating-point numbers +the maximum value of the exponent is 128 (respectively, 1024), +and the number of mantissa bits is 24 (respectively, 53).) + +If you want to store the rounded value in an integer type, +you probably want to use one of the functions described in +.BR lround (3) +instead. +.SH "SEE ALSO" +.BR ceil (3), +.BR floor (3), +.BR lround (3), +.BR nearbyint (3), +.BR rint (3), +.BR trunc (3) diff --git a/original/man3/roundf.3 b/original/man3/roundf.3 new file mode 100644 index 00000000..f7ab3867 --- /dev/null +++ b/original/man3/roundf.3 @@ -0,0 +1 @@ +.so man3/round.3 diff --git a/original/man3/roundl.3 b/original/man3/roundl.3 new file mode 100644 index 00000000..f7ab3867 --- /dev/null +++ b/original/man3/roundl.3 @@ -0,0 +1 @@ +.so man3/round.3 diff --git a/original/man3/rpc.3 b/original/man3/rpc.3 new file mode 100644 index 00000000..6d87f44c --- /dev/null +++ b/original/man3/rpc.3 @@ -0,0 +1,1114 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)rpc.3n 2.4 88/08/08 4.0 RPCSRC; from 1.19 88/06/24 SMI +.\" +.\" 2007-12-30, mtk, Convert function prototypes to modern C syntax +.\" +.TH RPC 3 2008-07-17 "" "Linux Programmer's Manual" +.SH NAME +rpc \- library routines for remote procedure calls +.SH "SYNOPSIS AND DESCRIPTION" +These routines allow C programs to make procedure +calls on other machines across the network. +First, the client calls a procedure to send a data packet to the server. +Upon receipt of the packet, the server calls a dispatch routine +to perform the requested service, and then sends back a reply. +Finally, the procedure call returns to the client. +.\" .LP +.\" We don't have an rpc_secure.3 page at the moment -- MTK, 19 Sep 05 +.\" Routines that are used for Secure RPC (DES authentication) are described in +.\" .BR rpc_secure (3). +.\" Secure RPC can be used only if DES encryption is available. +.LP +To take use of these routines, include the header file +.IR "" . + +The prototypes below make use of the following types: +.in +4n +.nf + +typedef int \fIbool_t\fP; + +typedef bool_t (*\fIxdrproc_t\fP) (XDR *, void *,...); + +typedef bool_t (*\fIresultproc_t\fP) (caddr_t resp, + struct sockaddr_in *raddr); +.fi +.in +.LP +See the header files for the declarations of the +.IR AUTH , +.IR CLIENT , +.IR SVCXPRT , +and +.IR XDR +types. +.LP +.nf +.BI "void auth_destroy(AUTH *" auth ); +.fi +.IP +A macro that destroys the authentication information associated with +.IR auth . +Destruction usually involves deallocation of private data structures. +The use of +.I auth +is undefined after calling +.BR auth_destroy (). +.LP +.nf +.BI "AUTH *authnone_create(void);" +.fi +.IP +Create and return an RPC +authentication handle that passes nonusable authentication +information with each remote procedure call. +This is the default authentication used by RPC. +.LP +.nf +.BI "AUTH *authunix_create(char *" host ", int " uid ", int " gid , +.BI " int " len ", int *" aup_gids ); +.fi +.IP +Create and return an RPC authentication handle that contains +authentication information. +The parameter +.I host +is the name of the machine on which the information was created; +.I uid +is the user's user ID; +.I gid +is the user's current group ID; +.I len +and +.I aup_gids +refer to a counted array of groups to which the user belongs. +It is easy to impersonate a user. +.LP +.nf +.BI "AUTH *authunix_create_default(void);" +.fi +.IP +Calls +.BR authunix_create () +with the appropriate parameters. +.LP +.nf +.BI "int callrpc(char *" host ", unsigned long " prognum , +.BI " unsigned long " versnum ", unsigned long " procnum , +.BI " xdrproc_t " inproc ", char *" in , +.BI " xdrproc_t " outproc ", char *" out ); +.fi +.IP +Call the remote procedure associated with +.IR prognum , +.IR versnum , +and +.I procnum +on the machine, +.IR host . +The parameter +.I in +is the address of the procedure's argument(s), and +.I out +is the address of where to place the result(s); +.I inproc +is used to encode the procedure's parameters, and +.I outproc +is used to decode the procedure's results. +This routine returns zero if it succeeds, or the value of +.B "enum clnt_stat" +cast to an integer if it fails. +The routine +.BR clnt_perrno () +is handy for translating failure statuses into messages. +.IP +Warning: calling remote procedures with this routine +uses UDP/IP as a transport; see +.BR clntudp_create () +for restrictions. +You do not have control of timeouts or authentication using this routine. +.LP +.nf +.BI "enum clnt_stat clnt_broadcast(unsigned long " prognum , +.BI " unsigned long " versnum ", unsigned long " procnum , +.BI " xdrproc_t " inproc ", char *" in , +.BI " xdrproc_t " outproc ", char *" out , +.BI " resultproc_t " eachresult ); +.fi +.IP +Like +.BR callrpc (), +except the call message is broadcast to all locally +connected broadcast nets. +Each time it receives a response, this routine calls +.BR eachresult (), +whose form is: +.IP +.in +4n +.nf +.BI "eachresult(char *" out ", struct sockaddr_in *" addr ); +.fi +.in +.IP +where +.I out +is the same as +.I out +passed to +.BR clnt_broadcast (), +except that the remote procedure's output is decoded there; +.I addr +points to the address of the machine that sent the results. +If +.BR eachresult () +returns zero, +.BR clnt_broadcast () +waits for more replies; otherwise it returns with appropriate status. +.IP +Warning: broadcast sockets are limited in size to the +maximum transfer unit of the data link. +For ethernet, this value is 1500 bytes. +.LP +.nf +.BI "enum clnt_stat clnt_call(CLIENT *" clnt ", unsigned long " procnum , +.BI " xdrproc_t " inproc ", char *" in , +.BI " xdrproc_t " outproc ", char *" out , +.BI " struct timeval " tout ); +.fi +.IP +A macro that calls the remote procedure +.I procnum +associated with the client handle, +.IR clnt , +which is obtained with an RPC client creation routine such as +.BR clnt_create (). +The parameter +.I in +is the address of the procedure's argument(s), and +.I out +is the address of where to place the result(s); +.I inproc +is used to encode the procedure's parameters, and +.I outproc +is used to decode the procedure's results; +.I tout +is the time allowed for results to come back. +.LP +.nf +.BI "clnt_destroy(CLIENT *" clnt ); +.fi +.IP +A macro that destroys the client's RPC handle. +Destruction usually involves deallocation +of private data structures, including +.I clnt +itself. +Use of +.I clnt +is undefined after calling +.BR clnt_destroy (). +If the RPC library opened the associated socket, it will close it also. +Otherwise, the socket remains open. +.LP +.nf +.BI "CLIENT *clnt_create(char *" host ", unsigned long " prog , +.BI " unsigned long " vers ", char *" proto ); +.fi +.IP +Generic client creation routine. +.I host +identifies the name of the remote host where the server is located. +.I proto +indicates which kind of transport protocol to use. +The currently supported values for this field are \(lqudp\(rq +and \(lqtcp\(rq. +Default timeouts are set, but can be modified using +.BR clnt_control (). +.IP +Warning: Using UDP has its shortcomings. +Since UDP-based RPC messages can only hold up to 8 Kbytes of encoded data, +this transport cannot be used for procedures that take +large arguments or return huge results. +.LP +.nf +.BI "bool_t clnt_control(CLIENT *" cl ", int " req ", char *" info ); +.fi +.IP +A macro used to change or retrieve various information +about a client object. +.I req +indicates the type of operation, and +.I info +is a pointer to the information. +For both UDP and TCP, the supported values of +.I req +and their argument types and what they do are: +.IP +.in +4n +.nf +\fBCLSET_TIMEOUT\fP \fIstruct timeval\fP // set total timeout +\fBCLGET_TIMEOUT\fP \fIstruct timeval\fP // get total timeout +.fi +.in +.IP +Note: if you set the timeout using +.BR clnt_control (), +the timeout parameter passed to +.BR clnt_call () +will be ignored in all future calls. +.IP +.in +4n +.nf +\fBCLGET_SERVER_ADDR\fP \fIstruct sockaddr_in \fP // get server's address +.fi +.in +.IP +The following operations are valid for UDP only: +.IP +.in +4n +.nf +\fBCLSET_RETRY_TIMEOUT\fP \fIstruct timeval\fP // set the retry timeout +\fBCLGET_RETRY_TIMEOUT\fP \fIstruct timeval\fP // get the retry timeout +.fi +.in +.IP +The retry timeout is the time that "UDP RPC" +waits for the server to reply before +retransmitting the request. +.LP +.nf +.BI "clnt_freeres(CLIENT * " clnt ", xdrproc_t " outproc ", char *" out ); +.fi +.IP +A macro that frees any data allocated by the RPC/XDR +system when it decoded the results of an RPC call. +The parameter +.I out +is the address of the results, and +.I outproc +is the XDR routine describing the results. +This routine returns one if the results were successfully freed, +and zero otherwise. +.LP +.nf +.BI "void clnt_geterr(CLIENT *" clnt ", struct rpc_err *" errp ); +.fi +.IP +A macro that copies the error structure out of the client +handle to the structure at address +.IR errp . +.LP +.nf +.BI "void clnt_pcreateerror(char *" s ); +.fi +.IP +Print a message to standard error indicating why a client RPC +handle could not be created. +The message is prepended with string +.I s +and a colon. +Used when a +.BR clnt_create (), +.BR clntraw_create (), +.BR clnttcp_create (), +or +.BR clntudp_create () +call fails. +.LP +.nf +.BI "void clnt_perrno(enum clnt_stat " stat ); +.fi +.IP +Print a message to standard error corresponding +to the condition indicated by +.IR stat . +Used after +.BR callrpc (). +.LP +.nf +.BI "clnt_perror(CLIENT *" clnt ", char *" s ); +.fi +.IP +Print a message to standard error indicating why an RPC call failed; +.I clnt +is the handle used to do the call. +The message is prepended with string +.I s +and a colon. +Used after +.BR clnt_call (). +.LP +.nf +.BI "char *clnt_spcreateerror(char *" s ); +.fi +.IP +Like +.BR clnt_pcreateerror (), +except that it returns a string instead of printing to the standard error. +.IP +Bugs: returns pointer to static data that is overwritten on each call. +.LP +.nf +.BI "char *clnt_sperrno(enum clnt_stat " stat ); +.fi +.IP +Take the same arguments as +.BR clnt_perrno (), +but instead of sending a message to the standard error indicating why an RPC +call failed, return a pointer to a string which contains the message. +The string ends with a NEWLINE. +.IP +.BR clnt_sperrno () +is used instead of +.BR clnt_perrno () +if the program does not have a standard error (as a program +running as a server quite likely does not), or if the programmer +does not want the message to be output with +.BR printf (3), +or if a message format different than that supported by +.BR clnt_perrno () +is to be used. +Note: unlike +.BR clnt_sperror () +and +.BR clnt_spcreaterror (), +.BR clnt_sperrno () +returns pointer to static data, but the +result will not get overwritten on each call. +.LP +.nf +.BI "char *clnt_sperror(CLIENT *" rpch ", char *" s ); +.fi +.IP +Like +.BR clnt_perror (), +except that (like +.BR clnt_sperrno ()) +it returns a string instead of printing to standard error. +.IP +Bugs: returns pointer to static data that is overwritten on each call. +.LP +.nf +.BI "CLIENT *clntraw_create(unsigned long " prognum \ +", unsigned long " versnum ); +.fi +.IP +This routine creates a toy RPC client for the remote program +.IR prognum , +version +.IR versnum . +The transport used to pass messages to the service is +actually a buffer within the process's address space, so the +corresponding RPC server should live in the same address space; see +.BR svcraw_create (). +This allows simulation of RPC and acquisition of RPC +overheads, such as round trip times, without any kernel interference. +This routine returns NULL if it fails. +.LP +.nf +.BI "CLIENT *clnttcp_create(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " int *" sockp ", unsigned int " sendsz \ +", unsigned int " recvsz ); +.fi +.IP +This routine creates an RPC client for the remote program +.IR prognum , +version +.IR versnum ; +the client uses TCP/IP as a transport. +The remote program is located at Internet address +.IR *addr . +If +.\"The following inline font conversion is necessary for the hyphen indicator +\fIaddr\->sin_port\fR +is zero, then it is set to the actual port that the remote +program is listening on (the remote +.B portmap +service is consulted for this information). +The parameter +.I sockp +is a socket; if it is +.BR RPC_ANYSOCK , +then this routine opens a new one and sets +.IR sockp . +Since TCP-based RPC uses buffered I/O, +the user may specify the size of the send and receive buffers +with the parameters +.I sendsz +and +.IR recvsz ; +values of zero choose suitable defaults. +This routine returns NULL if it fails. +.LP +.nf +.BI "CLIENT *clntudp_create(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " struct timeval " wait ", int *" sockp ); +.fi +.IP +This routine creates an RPC client for the remote program +.IR prognum , +version +.IR versnum ; +the client uses use UDP/IP as a transport. +The remote program is located at Internet address +.IR addr . +If +\fIaddr\->sin_port\fR +is zero, then it is set to actual port that the remote +program is listening on (the remote +.B portmap +service is consulted for this information). +The parameter +.I sockp +is a socket; if it is +.BR RPC_ANYSOCK , +then this routine opens a new one and sets +.IR sockp . +The UDP transport resends the call message in intervals of +.I wait +time until a response is received or until the call times out. +The total time for the call to time out is specified by +.BR clnt_call (). +.IP +Warning: since UDP-based RPC messages can only hold up to 8 Kbytes +of encoded data, this transport cannot be used for procedures +that take large arguments or return huge results. +.LP +.nf +.BI "CLIENT *clntudp_bufcreate(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " struct timeval " wait ", int *" sockp , +.BI " unsigned int " sendsize ", unsigned int "recosize ); +.fi +.IP +This routine creates an RPC client for the remote program +.IR prognum , +on +.IR versnum ; +the client uses use UDP/IP as a transport. +The remote program is located at Internet address +.IR addr . +If +\fIaddr\->sin_port\fR +is zero, then it is set to actual port that the remote +program is listening on (the remote +.B portmap +service is consulted for this information). +The parameter +.I sockp +is a socket; if it is +.BR RPC_ANYSOCK , +then this routine opens a new one and sets +.IR sockp . +The UDP transport resends the call message in intervals of +.I wait +time until a response is received or until the call times out. +The total time for the call to time out is specified by +.BR clnt_call (). +.IP +This allows the user to specify the maximum packet +size for sending and receiving UDP-based RPC messages. +.LP +.nf +.BI "void get_myaddress(struct sockaddr_in *" addr ); +.fi +.IP +Stuff the machine's IP address into +.IR *addr , +without consulting the library routines that deal with +.IR /etc/hosts . +The port number is always set to +.BR htons(PMAPPORT) . +.LP +.nf +.BI "struct pmaplist *pmap_getmaps(struct sockaddr_in *" addr ); +.fi +.IP +A user interface to the +.B portmap +service, which returns a list of the current RPC +program-to-port mappings on the host located at IP address +.IR *addr . +This routine can return NULL. +The command +.IR "rpcinfo\ \-p" +uses this routine. +.LP +.nf +.BI "unsigned short pmap_getport(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " unsigned int " protocol ); +.fi +.IP +A user interface to the +.B portmap +service, which returns the port number +on which waits a service that supports program number +.IR prognum , +version +.IR versnum , +and speaks the transport protocol associated with +.IR protocol . +The value of +.I protocol +is most likely +.B IPPROTO_UDP +or +.BR IPPROTO_TCP . +A return value of zero means that the mapping does not exist +or that the RPC system failed to contact the remote +.B portmap +service. +In the latter case, the global variable +.I rpc_createerr +contains the RPC status. +.LP +.nf +.BI "enum clnt_stat pmap_rmtcall(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " unsigned long " procnum , +.BI " xdrproc_t " inproc ", char *" in , +.BI " xdrproc_t " outproc ", char *" out , +.BI " struct timeval " tout ", unsigned long *" portp ); +.fi +.IP +A user interface to the +.B portmap +service, which instructs +.B portmap +on the host at IP address +.I *addr +to make an RPC call on your behalf to a procedure on that host. +The parameter +.I *portp +will be modified to the program's port number if the procedure succeeds. +The definitions of other parameters are discussed +in +.BR callrpc () +and +.BR clnt_call (). +This procedure should be used for a \(lqping\(rq and nothing else. +See also +.BR clnt_broadcast (). +.LP +.nf +.BI "bool_t pmap_set(unsigned long " prognum ", unsigned long " versnum , +.BI " unsigned int " protocol ", unsigned short " port ); +.fi +.IP +A user interface to the +.B portmap +service, which establishes a mapping between the triple +.RI [ prognum , versnum , protocol\fR] +and +.I port +on the machine's +.B portmap +service. +The value of +.I protocol +is most likely +.B IPPROTO_UDP +or +.BR IPPROTO_TCP . +This routine returns one if it succeeds, zero otherwise. +Automatically done by +.BR svc_register (). +.LP +.nf +.BI "bool_t pmap_unset(unsigned long " prognum ", unsigned long " versnum ); +.fi +.IP +A user interface to the +.B portmap +service, which destroys all mapping between the triple +.RI [ prognum , versnum , *\fR] +and +.B ports +on the machine's +.B portmap +service. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "int registerrpc(unsigned long " prognum ", unsigned long " versnum , +.BI " unsigned long " procnum ", char *(*" procname ")(char *)," +.BI " xdrproc_t " inproc ", xdrproc_t " outproc ); +.fi +.IP +Register procedure +.I procname +with the RPC service package. +If a request arrives for program +.IR prognum , +version +.IR versnum , +and procedure +.IR procnum , +.I procname +is called with a pointer to its parameter(s); +.I progname +should return a pointer to its static result(s); +.I inproc +is used to decode the parameters while +.I outproc +is used to encode the results. +This routine returns zero if the registration succeeded, \-1 otherwise. +.IP +Warning: remote procedures registered in this form +are accessed using the UDP/IP transport; see +.BR svcudp_create () +for restrictions. +.LP +.nf +.BI "struct rpc_createerr " rpc_createerr ; +.fi +.IP +A global variable whose value is set by any RPC client creation routine +that does not succeed. +Use the routine +.BR clnt_pcreateerror () +to print the reason why. +.LP +.nf +.BI "void svc_destroy(SVCXPRT *" xprt ); +.fi +.IP +A macro that destroys the RPC service transport handle, +.IR xprt . +Destruction usually involves deallocation +of private data structures, including +.I xprt +itself. +Use of +.I xprt +is undefined after calling this routine. +.LP +.nf +.BI "fd_set " svc_fdset ; +.fi +.IP +A global variable reflecting the RPC service side's +read file descriptor bit mask; it is suitable as a parameter to the +.BR select (2) +system call. +This is only of interest if a service implementor does not call +.BR svc_run (), +but rather does his own asynchronous event processing. +This variable is read-only (do not pass its address to +.BR select (2)!), +yet it may change after calls to +.BR svc_getreqset () +or any creation routines. +.LP +.nf +.BI "int " svc_fds ; +.fi +.IP +Similar to +.BR svc_fdset , +but limited to 32 descriptors. +This interface is obsoleted by +.BR svc_fdset . +.LP +.nf +.BI "svc_freeargs(SVCXPRT *" xprt ", xdrproc_t " inproc ", char *" in ); +.fi +.IP +A macro that frees any data allocated by the RPC/XDR +system when it decoded the arguments to a service procedure using +.BR svc_getargs (). +This routine returns 1 if the results were successfully freed, +and zero otherwise. +.LP +.nf +.BI "svc_getargs(SVCXPRT *" xprt ", xdrproc_t " inproc ", char *" in ); +.fi +.IP +A macro that decodes the arguments of an RPC request +associated with the RPC service transport handle, +.IR xprt . +The parameter +.I in +is the address where the arguments will be placed; +.I inproc +is the XDR routine used to decode the arguments. +This routine returns one if decoding succeeds, and zero otherwise. +.LP +.nf +.BI "struct sockaddr_in *svc_getcaller(SVCXPRT *" xprt ); +.fi +.IP +The approved way of getting the network address of the caller +of a procedure associated with the RPC service transport handle, +.IR xprt . +.LP +.nf +.BI "void svc_getreqset(fd_set *" rdfds ); +.fi +.IP +This routine is only of interest if a service implementor does not call +.BR svc_run (), +but instead implements custom asynchronous event processing. +It is called when the +.BR select (2) +system call has determined that an RPC request has arrived on some +RPC socket(s); +.I rdfds +is the resultant read file descriptor bit mask. +The routine returns when all sockets associated with the value of +.I rdfds +have been serviced. +.LP +.nf +.BI "void svc_getreq(int " rdfds ); +.fi +.IP +Similar to +.BR svc_getreqset (), +but limited to 32 descriptors. +This interface is obsoleted by +.BR svc_getreqset (). +.LP +.nf +.BI "bool_t svc_register(SVCXPRT *" xprt ", unsigned long " prognum , +.BI " unsigned long " versnum , +.BI " void (*" dispatch ")(svc_req *, SVCXPRT *)," +.BI " unsigned long " protocol ); +.fi +.IP +Associates +.I prognum +and +.I versnum +with the service dispatch procedure, +.IR dispatch . +If +.I protocol +is zero, the service is not registered with the +.B portmap +service. +If +.I protocol +is nonzero, then a mapping of the triple +.RI [ prognum , versnum , protocol\fR] +to +\fIxprt\->xp_port\fR +is established with the local +.B portmap +service (generally +.I protocol +is zero, +.B IPPROTO_UDP +or +.BR IPPROTO_TCP ). +The procedure +.I dispatch +has the following form: +.in +4n +.nf + +dispatch(struct svc_req *request, SVCXPRT *xprt); +.fi +.in +.IP +The +.BR svc_register () +routine returns one if it succeeds, and zero otherwise. +.LP +.nf +.B "void svc_run(void);" +.fi +.IP +This routine never returns. +It waits for RPC requests to arrive, and calls the appropriate service +procedure using +.BR svc_getreq () +when one arrives. +This procedure is usually waiting for a +.BR select (2) +system call to return. +.LP +.nf +.BI "bool_t svc_sendreply(SVCXPRT *" xprt ", xdrproc_t " outproc \ +", char *" out ); +.fi +.IP +Called by an RPC service's dispatch routine to send the results of a +remote procedure call. +The parameter +.I xprt +is the request's associated transport handle; +.I outproc +is the XDR routine which is used to encode the results; and +.I out +is the address of the results. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "void svc_unregister(unsigned long " prognum ", unsigned long " versnum ); +.fi +.IP +Remove all mapping of the double +.RI [ prognum , versnum ] +to dispatch routines, and of the triple +.RI [ prognum , versnum , *\fR] +to port number. +.LP +.nf +.BI "void svcerr_auth(SVCXPRT *" xprt ", enum auth_stat " why ); +.fi +.IP +Called by a service dispatch routine that refuses to perform +a remote procedure call due to an authentication error. +.LP +.nf +.BI "void svcerr_decode(SVCXPRT *" xprt ); +.fi +.IP +Called by a service dispatch routine that cannot successfully +decode its parameters. +See also +.BR svc_getargs (). +.LP +.nf +.BI "void svcerr_noproc(SVCXPRT *" xprt ); +.fi +.IP +Called by a service dispatch routine that does not implement +the procedure number that the caller requests. +.LP +.nf +.BI "void svcerr_noprog(SVCXPRT *" xprt ); +.fi +.IP +Called when the desired program is not registered with the RPC package. +Service implementors usually do not need this routine. +.LP +.nf +.BI "void svcerr_progvers(SVCXPRT *" xprt ); +.fi +.IP +Called when the desired version of a program is not registered +with the RPC package. +Service implementors usually do not need this routine. +.LP +.nf +.BI "void svcerr_systemerr(SVCXPRT *" xprt ); +.fi +.IP +Called by a service dispatch routine when it detects a system +error not covered by any particular protocol. +For example, if a service can no longer allocate storage, +it may call this routine. +.LP +.nf +.BI "void svcerr_weakauth(SVCXPRT *" xprt ); +.fi +.IP +Called by a service dispatch routine that refuses to perform +a remote procedure call due to insufficient authentication parameters. +The routine calls +.BR "svcerr_auth(xprt, AUTH_TOOWEAK)" . +.LP +.nf +.BI "SVCXPRT *svcfd_create(int " fd ", unsigned int " sendsize , +.BI " unsigned int " recvsize ); +.fi +.IP +Create a service on top of any open descriptor. +Typically, this descriptor is a connected socket for a stream protocol such +as TCP. +.I sendsize +and +.I recvsize +indicate sizes for the send and receive buffers. +If they are zero, a reasonable default is chosen. +.LP +.nf +.BI "SVCXPRT *svcraw_create(void);" +.fi +.IP +This routine creates a toy RPC +service transport, to which it returns a pointer. +The transport is really a buffer within the process's address space, +so the corresponding RPC client should live in the same address space; see +.BR clntraw_create (). +This routine allows simulation of RPC and acquisition of RPC +overheads (such as round trip times), without any kernel interference. +This routine returns NULL if it fails. +.LP +.nf +.BI "SVCXPRT *svctcp_create(int " sock ", unsigned int " send_buf_size , +.BI " unsigned int " recv_buf_size ); +.fi +.IP +This routine creates a TCP/IP-based RPC +service transport, to which it returns a pointer. +The transport is associated with the socket +.IR sock , +which may be +.BR RPC_ANYSOCK , +in which case a new socket is created. +If the socket is not bound to a local TCP +port, then this routine binds it to an arbitrary port. +Upon completion, +\fIxprt\->xp_sock\fR +is the transport's socket descriptor, and +\fIxprt\->xp_port\fR +is the transport's port number. +This routine returns NULL if it fails. +Since TCP-based RPC uses buffered I/O, +users may specify the size of buffers; values of zero +choose suitable defaults. +.LP +.nf +.BI "SVCXPRT *svcudp_bufcreate(int " sock ", unsigned int " sendsize , +.BI " unsigned int " recosize ); +.fi +.IP +This routine creates a UDP/IP-based RPC +service transport, to which it returns a pointer. +The transport is associated with the socket +.IR sock , +which may be +.BR RPC_ANYSOCK , +in which case a new socket is created. +If the socket is not bound to a local UDP +port, then this routine binds it to an arbitrary port. +Upon completion, +\fIxprt\->xp_sock\fR +is the transport's socket descriptor, and +\fIxprt\->xp_port\fR +is the transport's port number. +This routine returns NULL if it fails. +.IP +This allows the user to specify the maximum packet size for sending and +receiving UDP-based RPC messages. +.LP +.nf +.BI "SVCXPRT *svcudp_create(int " sock ); +.fi +.IP +This call is equivalent to +\fIsvcudp_bufcreate(sock,SZ,SZ)\fP +for some default size \fISZ\fP. +.LP +.nf +.BI "bool_t xdr_accepted_reply(XDR *" xdrs ", struct accepted_reply *" ar ); +.fi +.IP +Used for encoding RPC reply messages. +This routine is useful for users who wish to generate +RPC-style messages without using the RPC package. +.LP +.nf +.BI "bool_t xdr_authunix_parms(XDR *" xdrs ", struct authunix_parms *" aupp ); +.fi +.IP +Used for describing Unix credentials. +This routine is useful for users +who wish to generate these credentials without using the RPC +authentication package. +.LP +.nf +.BI "void xdr_callhdr(XDR *" xdrs ", struct rpc_msg *" chdr ); +.fi +.IP +Used for describing RPC call header messages. +This routine is useful for users who wish to generate +RPC-style messages without using the RPC package. +.LP +.nf +.BI "bool_t xdr_callmsg(XDR *" xdrs ", struct rpc_msg *" cmsg ); +.fi +.IP +Used for describing RPC call messages. +This routine is useful for users who wish to generate RPC-style +messages without using the RPC package. +.LP +.nf +.BI "bool_t xdr_opaque_auth(XDR *" xdrs ", struct opaque_auth *" ap ); +.fi +.IP +Used for describing RPC authentication information messages. +This routine is useful for users who wish to generate +RPC-style messages without using the RPC package. +.LP +.nf +.BI "bool_t xdr_pmap(XDR *" xdrs ", struct pmap *" regs ); +.fi +.IP +Used for describing parameters to various +.B portmap +procedures, externally. +This routine is useful for users who wish to generate +these parameters without using the +.B pmap +interface. +.LP +.nf +.BI "bool_t xdr_pmaplist(XDR *" xdrs ", struct pmaplist **" rp ); +.fi +.IP +Used for describing a list of port mappings, externally. +This routine is useful for users who wish to generate +these parameters without using the +.B pmap +interface. +.LP +.nf +.BI "bool_t xdr_rejected_reply(XDR *" xdrs ", struct rejected_reply *" rr ); +.fi +.IP +Used for describing RPC reply messages. +This routine is useful for users who wish to generate +RPC-style messages without using the RPC package. +.LP +.nf +.BI "bool_t xdr_replymsg(XDR *" xdrs ", struct rpc_msg *" rmsg ); +.fi +.IP +Used for describing RPC reply messages. +This routine is useful for users who wish to generate +RPC style messages without using the RPC package. +.LP +.nf +.BI "void xprt_register(SVCXPRT *" xprt ); +.fi +.IP +After RPC service transport handles are created, +they should register themselves with the RPC service package. +This routine modifies the global variable +.IR svc_fds . +Service implementors usually do not need this routine. +.LP +.nf +.BI "void xprt_unregister(SVCXPRT *" xprt ); +.fi +.IP +Before an RPC service transport handle is destroyed, +it should unregister itself with the RPC service package. +This routine modifies the global variable +.IR svc_fds . +Service implementors usually do not need this routine. +.SH "SEE ALSO" +.\" We don't have an rpc_secure.3 page in the set at the moment -- MTK, 19 Sep 05 +.\" .BR rpc_secure (3), +.BR xdr (3) +.br +The following manuals: +.RS +Remote Procedure Calls: Protocol Specification +.br +Remote Procedure Call Programming Guide +.br +rpcgen Programming Guide +.br +.RE +.IR "RPC: Remote Procedure Call Protocol Specification" , +RFC\ 1050, Sun Microsystems, Inc., +USC-ISI. diff --git a/original/man3/rpmatch.3 b/original/man3/rpmatch.3 new file mode 100644 index 00000000..fd3f186f --- /dev/null +++ b/original/man3/rpmatch.3 @@ -0,0 +1,132 @@ +.\" Copyright (C) 2006 Justin Pryzby +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" References: +.\" glibc manual and source +.\" +.\" 2006-05-19, mtk, various edits and example program +.\" +.TH RPMATCH 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +rpmatch \- determine if the answer to a question is affirmative or negative +.SH SYNOPSIS +.nf +.B #include + +.BI "int rpmatch(const char *" response ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR rpmatch (): +_SVID_SOURCE +.SH DESCRIPTION +.BR rpmatch () +handles a user response to yes or no questions, with +support for internationalization. + +\fIresponse\fP should be a null-terminated string containing a +user-supplied response, perhaps obtained with +.BR fgets (3) +or +.BR getline (3). + +The user's language preference is taken into account per the +environment variables \fBLANG\fP, \fBLC_MESSAGES\fP, and \fBLC_ALL\fP, +if the program has called +.BR setlocale (3) +to effect their changes. + +Regardless of the locale, responses matching \fB^[Yy]\fP are always +accepted as affirmative, and those matching \fB^[Nn]\fP are always +accepted as negative. +.SH "RETURN VALUE" +After examining +.IR response , +.BR rpmatch () +returns 0 for a recognized negative response ("no"), 1 +for a recognized positive response ("yes"), and \-1 when the value +of \fIresponse\fP is unrecognized. +.SH ERRORS +A return value of \-1 may indicate either an invalid input, or some +other error. +It is incorrect to only test if the return value is nonzero. + +.BR rpmatch () +can fail for any of the reasons that +.BR regcomp (3) +or +.BR regexec (3) +can fail; the cause of the error +is not available from \fIerrno\fP or anywhere else, but indicates a +failure of the regex engine (but this case is indistinguishable from +that of an unrecognized value of \fIresponse\fP). +.SH "CONFORMING TO" +.BR rpmatch () +is not required by any standard, but +is available on a few other systems. +.\" It is available on at least AIX 5.1 and FreeBSD 6.0. +.SH BUGS +The +.BR rpmatch () +implementation looks at only the first character +of \fIresponse\fP. +As a consequence, "nyes" returns 0, and +"ynever; not in a million years" returns 1. +It would be preferable to accept input strings much more +strictly, for example (using the extended regular +expression notation described in +.BR regex (7)): +\fB^([yY]|yes|YES)$\fP and \fB^([nN]|no|NO)$\fP. +.SH EXAMPLE +The following program displays the results when +.BR rpmatch () +is applied to the string given in the program's command-line argument. +.nf + +#define _SVID_SOURCE +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + if (argc != 2 || strcmp(argv[1], "\-\-help") == 0) { + fprintf(stderr, "%s response\\n", argv[0]); + exit(EXIT_FAILURE); + } + + setlocale(LC_ALL, ""); + printf("rpmatch() returns: %d\\n", rpmatch(argv[1])); + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR fgets (3), +.BR getline (3), +.BR nl_langinfo (3), +.BR regcomp (3), +.BR setlocale (3) diff --git a/original/man3/rresvport.3 b/original/man3/rresvport.3 new file mode 100644 index 00000000..b58efefa --- /dev/null +++ b/original/man3/rresvport.3 @@ -0,0 +1 @@ +.so man3/rcmd.3 diff --git a/original/man3/rtime.3 b/original/man3/rtime.3 new file mode 100644 index 00000000..e19429e3 --- /dev/null +++ b/original/man3/rtime.3 @@ -0,0 +1,124 @@ +.\" Copyright 2003 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" Modified 2003-04-04 Walter Harms +.\" +.\" +.\" Slightly polished, aeb, 2003-04-06 +.\" +.TH RTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual" +.SH NAME +rtime \- get time from a remote machine +.SH SYNOPSIS +.nf +.B "#include " +.sp +.BI "int rtime(struct sockaddr_in *" addrp ", struct rpc_timeval *" timep , +.BI " struct rpc_timeval *" timeout ); +.fi +.SH DESCRIPTION +This function uses the Time Server Protocol as described in +RFC\ 868 to obtain the time from a remote machine. +.LP +The Time Server Protocol gives the time in seconds since +00:00:00 UTC, 1 Jan 1900, +and this function subtracts the appropriate constant in order to +convert the result to seconds since the +Epoch, 1970-01-01 00:00:00 +0000 (UTC). +.LP +When +.I timeout +is non-NULL, the udp/time socket (port 37) is used. +Otherwise, the tcp/time socket (port 37) is used. +.SH "RETURN VALUE" +On success, 0 is returned, and the obtained 32-bit time value is stored in +.IR timep\->tv_sec . +In case of error \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +All errors for underlying functions +.RB ( sendto (2), +.BR poll (2), +.BR recvfrom (2), +.BR connect (2), +.BR read (2)) +can occur. +Moreover: +.TP +.B EIO +The number of returned bytes is not 4. +.TP +.B ETIMEDOUT +The waiting time as defined in timeout has expired. +.SH "NOTES" +Only IPv4 is supported. +.LP +Some +.I in.timed +versions only support TCP. +Try the example program with +.I use_tcp +set to 1. +.LP +Libc5 uses the prototype +.br +int rtime(struct sockaddr_in *, struct timeval *, struct timeval *); +.br +and requires +.I +instead of +.IR . +.SH "BUGS" +.BR rtime () +in glibc 2.2.5 and earlier does not work properly on 64-bit machines. +.SH "EXAMPLE" +This example requires that port 37 is up and open. +You may check +that the time entry within +.I /etc/inetd.conf +is not commented out. +.br +The program connects to a computer called "linux". +Using "localhost" does not work. +The result is the localtime of the computer "linux". +.sp +.nf +#include +#include +#include +#include +#include +#include +#include + +int use_tcp = 0; +char *servername = "linux"; + +int +main(void) +{ + struct sockaddr_in name; + struct rpc_timeval time1 = {0,0}; + struct rpc_timeval timeout = {1,0}; + struct hostent *hent; + int ret; + + memset((char *) &name, 0, sizeof(name)); + sethostent(1); + hent = gethostbyname(servername); + memcpy((char *) &name.sin_addr, hent\->h_addr, hent\->h_length); + + ret = rtime(&name, &time1, use_tcp ? NULL : &timeout); + if (ret < 0) + perror("rtime error"); + else + printf("%s\\n", ctime((time_t *) &time1.tv_sec)); + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.\" .BR netdate (1), +.BR ntpdate (1), +.\" .BR rdate (1), +.BR inetd (8) diff --git a/original/man3/rtnetlink.3 b/original/man3/rtnetlink.3 new file mode 100644 index 00000000..21203c88 --- /dev/null +++ b/original/man3/rtnetlink.3 @@ -0,0 +1,121 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: rtnetlink.3,v 1.2 1999/05/18 10:35:10 freitag Exp $ +.TH RTNETLINK 3 2010-01-11 "GNU" "Linux Programmer's Manual" +.SH NAME +rtnetlink \- macros to manipulate rtnetlink messages +.SH SYNOPSIS +.B #include +.br +.B #include +.br +.B #include +.br +.B #include + +.BI "rtnetlink_socket = socket(AF_NETLINK, int " socket_type \ +", NETLINK_ROUTE);" +.sp +.BI "int RTA_OK(struct rtattr *" rta ", int " rtabuflen ); +.sp +.BI "void *RTA_DATA(struct rtattr *" rta ); +.sp +.BI "unsigned int RTA_PAYLOAD(struct rtattr *" rta ); +.sp +.BI "struct rtattr *RTA_NEXT(struct rtattr *" rta \ +", unsigned int " rtabuflen ); +.sp +.BI "unsigned int RTA_LENGTH(unsigned int " length ); +.sp +.BI "unsigned int RTA_SPACE(unsigned int "length ); +.SH DESCRIPTION +All +.BR rtnetlink (7) +messages consist of a +.BR netlink (7) +message header and appended attributes. +The attributes should be only +manipulated using the macros provided here. +.PP +.BI RTA_OK( rta ", " attrlen ) +returns true if +.I rta +points to a valid routing attribute; +.I attrlen +is the running length of the attribute buffer. +When not true then you must assume there are no more attributes in the +message, even if +.I attrlen +is nonzero. +.PP +.BI RTA_DATA( rta ) +returns a pointer to the start of this attribute's data. +.PP +.BI RTA_PAYLOAD( rta ) +returns the length of this attribute's data. +.PP +.BI RTA_NEXT( rta ", " attrlen ) +gets the next attribute after +.IR rta . +Calling this macro will update +.IR attrlen . +You should use +.B RTA_OK +to check the validity of the returned pointer. +.PP +.BI RTA_LENGTH( len ) +returns the length which is required for +.I len +bytes of data plus the header. +.PP +.BI RTA_SPACE( len ) +returns the amount of space which will be needed in a message with +.I len +bytes of data. +.SH CONFORMING TO +These macros are nonstandard Linux extensions. +.SH BUGS +This manual page is incomplete. +.SH EXAMPLE +.\" FIXME ? would be better to use libnetlink in the EXAMPLE code here + +Creating a rtnetlink message to set the MTU of a device: +.nf + #include + + ... + + struct { + struct nlmsghdr nh; + struct ifinfomsg if; + char attrbuf[512]; + } req; + + struct rtattr *rta; + unsigned int mtu = 1000; + + int rtnetlink_sk = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); + + memset(&req, 0, sizeof(req)); + req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); + req.nh.nlmsg_flags = NLM_F_REQUEST; + req.nh.nlmsg_type = RTM_NEWLINK; + req.if.ifi_family = AF_UNSPEC; + req.if.ifi_index = INTERFACE_INDEX; + req.if.ifi_change = 0xffffffff; /* ???*/ + rta = (struct rtattr *)(((char *) &req) + + NLMSG_ALIGN(req.nh.nlmsg_len)); + rta\->rta_type = IFLA_MTU; + rta\->rta_len = 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 "SEE ALSO" +.BR netlink (3), +.BR netlink (7), +.BR rtnetlink (7) diff --git a/original/man3/ruserok.3 b/original/man3/ruserok.3 new file mode 100644 index 00000000..b58efefa --- /dev/null +++ b/original/man3/ruserok.3 @@ -0,0 +1 @@ +.so man3/rcmd.3 diff --git a/original/man3/scalb.3 b/original/man3/scalb.3 new file mode 100644 index 00000000..269d29db --- /dev/null +++ b/original/man3/scalb.3 @@ -0,0 +1,190 @@ +.\" 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. +.\" +.TH SCALB 3 2009-03-15 "" "Linux Programmer's Manual" +.SH NAME +scalb, scalbf, scalbl \- multiply floating-point number +by integral power of radix (OBSOLETE) +.SH SYNOPSIS +.B #include +.sp +.BI "double scalb(double " x ", double " exp ); +.br +.BI "float scalbf(float " x ", double " exp ); +.br +.BI "long double scalbl(long double " x ", double " exp ); +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR scalb (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR scalbf (), +.BR scalbl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH DESCRIPTION +These functions multiply their first argument +.I x +by +.B FLT_RADIX +(probably 2) +to the power of +.IR exp , +that is: +.nf + + x * FLT_RADIX ** exp +.fi + +The definition of +.B FLT_RADIX +can be obtained by including +.IR . +.\" not in /usr/include but in a gcc lib +.SH RETURN VALUE +On success, these functions return \fIx\fP * \fBFLT_RADIX\fP ** \fIexp\fP. + +If +.I x +or +.I exp +is a NaN, a NaN is returned. + +If +.I x +is positive infinity (negative infinity), +and +.I exp +is not negative infinity, +positive infinity (negative infinity) is returned. + +If +.I x +is +0 (\-0), and +.I exp +is not positive infinity, +0 (\-0) is returned. + +If +.I x +is zero, and +.I exp +is positive infinity, +a domain error occurs, and +a NaN is returned. + +If +.I x +is an infinity, +and +.I exp +is negative infinity, +a domain error occurs, and +a NaN is returned. + +If the result overflows, +a range error occurs, +and the functions return +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +respectively, with a sign the same as +.IR x . + +If the result underflows, +a range error occurs, +and the functions return zero, with a sign the same as +.IR x . +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is 0, and \fIexp\fP is positive infinity, \ +or \fIx\fP is positive infinity and \fIexp\fP is negative infinity \ +and the other argument is not a NaN +.\" .I errno +.\" is set to +.\" .BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.TP +Range error, overflow +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.TP +Range error, underflow +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An underflow floating-point exception +.RB ( FE_UNDERFLOW ) +is raised. +.PP +These functions do not set +.IR 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 +.SH "CONFORMING TO" +.BR scalb () +is specified in POSIX.1-2001, but marked obsolescent. +POSIX.1-2008 removes the specification of +.BR scalb (), +recommending the use of +.BR scalbln (3), +.BR scalblnf (3), +or +.BR scalblnl (3) +instead. +The +.BR scalb () +function is from 4.3BSD. + +.BR scalbf () +and +.BR scalbl () +are unstandardized; +.BR scalbf () +is nevertheless present on several other systems +.\" 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. +.SH "SEE ALSO" +.BR ldexp (3), +.BR scalbln (3) diff --git a/original/man3/scalbf.3 b/original/man3/scalbf.3 new file mode 100644 index 00000000..5a33fb82 --- /dev/null +++ b/original/man3/scalbf.3 @@ -0,0 +1 @@ +.so man3/scalb.3 diff --git a/original/man3/scalbl.3 b/original/man3/scalbl.3 new file mode 100644 index 00000000..5a33fb82 --- /dev/null +++ b/original/man3/scalbl.3 @@ -0,0 +1 @@ +.so man3/scalb.3 diff --git a/original/man3/scalbln.3 b/original/man3/scalbln.3 new file mode 100644 index 00000000..1ae2193f --- /dev/null +++ b/original/man3/scalbln.3 @@ -0,0 +1,163 @@ +.\" 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. +.\" +.TH SCALBLN 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +scalbn, scalbnf, scalbnl, scalbln, scalblnf, scalblnl \- +multiply floating-point number by integral power of radix +.SH SYNOPSIS +.B #include +.sp +.BI "double scalbln(double " x ", long int " exp ); +.br +.BI "float scalblnf(float " x ", long int " exp ); +.br +.BI "long double scalblnl(long double " x ", long int " exp ); +.sp +.BI "double scalbn(double " x ", int " exp ); +.br +.BI "float scalbnf(float " x ", int " exp ); +.br +.BI "long double scalbnl(long double " x ", int " exp ); +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR scalbln (), +.BR scalblnf (), +.BR scalblnl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR scalbn (), +.BR scalbnf (), +.BR scalbnl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions multiply their first argument +.I x +by +.B FLT_RADIX +(probably 2) +to the power of +.IR exp , +that is: +.nf + + x * FLT_RADIX ** exp +.fi + +The definition of +.B FLT_RADIX +can be obtained by including +.IR . +.\" not in /usr/include but in a gcc lib +.SH RETURN VALUE +On success, these functions return \fIx\fP * \fBFLT_RADIX\fP ** \fIexp\fP. + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is positive infinity (negative infinity), +positive infinity (negative infinity) is returned. + +If +.I x +is +0 (\-0), +0 (\-0) is returned. + +If the result overflows, +a range error occurs, +and the functions return +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +respectively, with a sign the same as +.IR x . + +If the result underflows, +a range error occurs, +and the functions return zero, with a sign the same as +.IR x . +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Range error, overflow +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.TP +Range error, underflow +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An underflow floating-point exception +.RB ( FE_UNDERFLOW ) +is raised. +.PP +These functions do not set +.IR errno . +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6803 +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH NOTES +These functions differ from the obsolete functions described in +.BR scalb (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 +.BR scalb (3) +have a second argument of type +.IR double . + +If +.B FLT_RADIX +equals 2 (which is usual), then +.BR scalbn () +is equivalent to +.BR ldexp (3). +.SH "SEE ALSO" +.BR ldexp (3), +.BR scalb (3) diff --git a/original/man3/scalblnf.3 b/original/man3/scalblnf.3 new file mode 100644 index 00000000..58d82f2d --- /dev/null +++ b/original/man3/scalblnf.3 @@ -0,0 +1 @@ +.so man3/scalbln.3 diff --git a/original/man3/scalblnl.3 b/original/man3/scalblnl.3 new file mode 100644 index 00000000..58d82f2d --- /dev/null +++ b/original/man3/scalblnl.3 @@ -0,0 +1 @@ +.so man3/scalbln.3 diff --git a/original/man3/scalbn.3 b/original/man3/scalbn.3 new file mode 100644 index 00000000..58d82f2d --- /dev/null +++ b/original/man3/scalbn.3 @@ -0,0 +1 @@ +.so man3/scalbln.3 diff --git a/original/man3/scalbnf.3 b/original/man3/scalbnf.3 new file mode 100644 index 00000000..58d82f2d --- /dev/null +++ b/original/man3/scalbnf.3 @@ -0,0 +1 @@ +.so man3/scalbln.3 diff --git a/original/man3/scalbnl.3 b/original/man3/scalbnl.3 new file mode 100644 index 00000000..58d82f2d --- /dev/null +++ b/original/man3/scalbnl.3 @@ -0,0 +1 @@ +.so man3/scalbln.3 diff --git a/original/man3/scandir.3 b/original/man3/scandir.3 new file mode 100644 index 00000000..8ea5fec4 --- /dev/null +++ b/original/man3/scandir.3 @@ -0,0 +1,176 @@ +.\" Copyright (C) 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 Sat Jul 24 18:26:16 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Thu Apr 11 17:11:33 1996 by Andries Brouwer (aeb@cwi.nl): +.\" Corrected type of compar routines, as suggested by +.\" Miguel Barreiro (enano@avalon.yaix.es). Added example. +.\" Modified Sun Sep 24 20:15:46 2000 by aeb, following Petter Reinholdtsen. +.\" Modified 2001-12-26 by aeb, following Joey. Added versionsort. +.\" +.TH SCANDIR 3 2009-02-10 "GNU" "Linux Programmer's Manual" +.SH NAME +scandir, alphasort, versionsort \- scan a directory for matching entries +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int scandir(const char *" dirp ", struct dirent ***" namelist , +.RS +.BI "int (*" filter ")(const struct dirent *)," +.BI "int (*" compar ")(const struct dirent **, const struct dirent **));" +.RE +.sp +.BI "int alphasort(const void *" a ", const void *" b ); +.sp +.BI "int versionsort(const void *" a ", const void *" b ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR scandir (), +.BR alphasort (): +_BSD_SOURCE || _SVID_SOURCE +.br +.BR versionsort (): +_GNU_SOURCE +.SH DESCRIPTION +The +.BR scandir () +function scans the directory \fIdirp\fP, calling +\fIfilter\fP() on each directory entry. +Entries for which +\fIfilter\fP() returns nonzero are stored in strings allocated via +.BR malloc (3), +sorted using +.BR qsort (3) +with the comparison +function \fIcompar\fP(), and collected in array \fInamelist\fP +which is allocated via +.BR malloc (3). +If \fIfilter\fP is NULL, all entries are selected. +.LP +The +.BR alphasort () +and +.BR versionsort () +functions can be used as the comparison function +.IR compar (). +The former sorts directory entries using +.BR strcoll (3), +the latter using +.BR strverscmp (3) +on the strings \fI(*a)\->d_name\fP and \fI(*b)\->d_name\fP. +.SH "RETURN VALUE" +The +.BR scandir () +function returns the number of directory entries +selected or \-1 if an error occurs. +.PP +The +.BR alphasort () +and +.BR versionsort () +functions return an integer less than, equal to, +or greater than zero if the first argument is considered to be +respectively less than, equal to, or greater than the second. +.SH ERRORS +.TP +.B ENOMEM +Insufficient memory to complete the operation. +.SH VERSIONS +.BR versionsort () +was added to glibc in version 2.1. +.SH "CONFORMING TO" +.BR alphasort () +and +.BR scandir () +are specified in POSIX.1-2008, and are widely available. +.BR versionsort () +is a GNU extension. +.LP +The functions +.BR scandir () +and +.BR alphasort () +are from 4.3BSD, and have been available under Linux since libc4. +Libc4 and libc5 use the more precise prototype +.sp +.nf + int alphasort(const struct dirent ** a, + const struct dirent **b); +.fi +.sp +but glibc 2.0 returns to the imprecise BSD prototype. +.LP +The function +.BR versionsort () +is a GNU extension, available since glibc 2.1. +.LP +Since glibc 2.1, +.BR alphasort () +calls +.BR strcoll (3); +earlier it used +.BR strcmp (3). +.SH EXAMPLE +.nf +#define _SVID_SOURCE +/* print files in current directory in reverse order */ +#include + +int +main(void) +{ + struct dirent **namelist; + int n; + + n = scandir(".", &namelist, 0, alphasort); + if (n < 0) + perror("scandir"); + else { + while (n\-\-) { + printf("%s\en", namelist[n]\->d_name); + free(namelist[n]); + } + free(namelist); + } +} +.fi +.SH "SEE ALSO" +.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) diff --git a/original/man3/scanf.3 b/original/man3/scanf.3 new file mode 100644 index 00000000..7662003d --- /dev/null +++ b/original/man3/scanf.3 @@ -0,0 +1,716 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)scanf.3 6.14 (Berkeley) 1/8/93 +.\" +.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu +.\" modified to resemble the GNU libio setup used in the Linux libc +.\" used in versions 4.x (x>4) and 5 Helmut.Geyer@iwr.uni-heidelberg.de +.\" Modified, aeb, 970121 +.\" 2005-07-14, mtk, added description of %n$ form; various text +.\" incorporated from the GNU C library documentation ((C) The +.\" Free Software Foundation); other parts substantially rewritten. +.\" +.\" 2008-06-23, mtk +.\" Add ERRORS section. +.\" Document the 'a' and 'm' modifiers for dynamic string allocation. +.\" +.TH SCANF 3 2008-07-12 "GNU" "Linux Programmer's Manual" +.SH NAME +scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf \- input format conversion +.SH SYNOPSIS +.nf +.B #include + +.BI "int scanf(const char *" format ", ...);" +.BI "int fscanf(FILE *" stream ", const char *" format ", ...);" +.BI "int sscanf(const char *" str ", const char *" format ", ...);" +.sp +.B #include + +.BI "int vscanf(const char *" format ", va_list " ap ); +.BI "int vsscanf(const char *" str ", const char *" format ", va_list " ap ); +.BI "int vfscanf(FILE *" stream ", const char *" format ", va_list " ap ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR vscanf (), +.BR vsscanf (), +.BR vfscanf (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I "cc -std=c99" +.SH DESCRIPTION +The +.BR scanf () +family of functions scans input according to +.I format +as described below. +This format may contain +.IR "conversion specifications" ; +the results from such conversions, if any, +are stored in the locations pointed to by the +.I pointer +arguments that follow +.IR format . +Each +.I pointer +argument must be of a type that is appropriate for the value returned +by the corresponding conversion specification. + +If the number of conversion specifications in +.I format +exceeds the number of +.I pointer +arguments, the results are undefined. +If the number of +.I pointer +arguments exceeds the number of conversion specifications, then the excess +.I pointer +arguments are evaluated, but are otherwise ignored. + +The +.BR scanf () +function reads input from the standard input stream +.IR stdin , +.BR fscanf () +reads input from the stream pointer +.IR stream , +and +.BR sscanf () +reads its input from the character string pointed to by +.IR str . +.PP +The +.BR vfscanf () +function is analogous to +.BR vfprintf (3) +and reads input from the stream pointer +.I stream +using a variable argument list of pointers (see +.BR stdarg (3). +The +.BR vscanf () +function scans a variable argument list from the standard input and the +.BR vsscanf () +function scans it from a string; these are analogous to the +.BR vprintf (3) +and +.BR vsprintf (3) +functions respectively. +.PP +The +.I format +string consists of a sequence of +.I directives +which describe how to process the sequence of input characters. +If processing of a directive fails, no further input is read, and +.BR scanf () +returns. +A "failure" can be either of the following: +.IR "input failure" , +meaning that input characters were unavailable, or +.IR "matching failure" , +meaning that the input was inappropriate (see below). + +A directive is one of the following: +.TP +\(bu +A sequence of white-space characters (space, tab, newline, etc.; see +.BR isspace (3)). +This directive matches any amount of white space, +including none, in the input. +.TP +\(bu +An ordinary character (i.e., one other than white space or \(aq%\(aq). +This character must exactly match the next character of input. +.TP +\(bu +A conversion specification, +which commences with a \(aq%\(aq (percent) character. +A sequence of characters from the input is converted according to +this specification, and the result is placed in the corresponding +.I pointer +argument. +If the next item of input does not match the conversion specification, +the conversion fails \(em this is a +.IR "matching failure" . +.PP +Each +.I conversion specification +in +.I format +begins with either the character \(aq%\(aq or the character sequence +"\fB%\fP\fIn\fP\fB$\fP" +(see below for the distinction) followed by: +.TP +\(bu +An optional \(aq*\(aq assignment-suppression character: +.BR scanf () +reads input as directed by the conversion specification, +but discards the input. +No corresponding +.I pointer +argument is required, and this specification is not +included in the count of successful assignments returned by +.BR scanf (). +.TP +\(bu +An optional \(aqa\(aq character. +This is used with string conversions, and relieves the caller of the +need to allocate a corresponding buffer to hold the input: instead, +.BR scanf () +allocates a buffer of sufficient size, +and assigns the address of this buffer to the corresponding +.I pointer +argument, which should be a pointer to a +.I "char *" +variable (this variable does not need to be initialized before the call). +The caller should subsequently +.BR free (3) +this buffer when it is no longer required. +This is a GNU extension; +C99 employs the \(aqa\(aq character as a conversion specifier (and +it can also be used as such in the GNU implementation). +.TP +\(bu +An optional decimal integer which specifies the +.IR "maximum field width" . +Reading of characters stops either when this maximum is reached or +when a nonmatching character is found, whichever happens first. +Most conversions discard initial white space characters (the exceptions +are noted below), +and these discarded characters don't count towards the maximum field width. +String input conversions store a null terminator (\(aq\\0\(aq) +to mark the end of the input; +the maximum field width does not include this terminator. +.TP +\(bu +An optional +.IR "type modifier character" . +For example, the +.B l +type modifier is used with integer conversions such as +.B %d +to specify that the corresponding +.I pointer +argument refers to a +.I "long int" +rather than a pointer to an +.IR int . +.TP +\(bu +A +.I "conversion specifier" +that specifies the type of input conversion to be performed. +.PP +The conversion specifications in +.I format +are of two forms, either beginning with \(aq%\(aq or beginning with +"\fB%\fP\fIn\fP\fB$\fP". +The two forms should not be mixed in the same +.I format +string, except that a string containing +"\fB%\fP\fIn\fP\fB$\fP" +specifications can include +.B %% +and +.BR %* . +If +.I format +contains \(aq%\(aq +specifications then these correspond in order with successive +.I pointer +arguments. +In the +"\fB%\fP\fIn\fP\fB$\fP" +form (which is specified in POSIX.1-2001, but not C99), +.I n +is a decimal integer that specifies that the converted input should +be placed in the location referred to by the +.IR n -th +.I pointer +argument following +.IR format . +.SS Conversions +The following +.I "type modifier characters" +can appear in a conversion specification: +.TP +.B h +Indicates that the conversion will be one of +\fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP, or \fBn\fP +and the next pointer is a pointer to a +.I short int +or +.I unsigned short int +(rather than +.IR int ). +.TP +.B hh +As for +.BR h , +but the next pointer is a pointer to a +.I signed char +or +.IR "unsigned char" . +.TP +.B j +As for +.BR h , +but the next pointer is a pointer to an +.I intmax_t +or a +.IR uintmax_t . +This modifier was introduced in C99. +.TP +.B l +Indicates either that the conversion will be one of +\fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP, or \fBn\fP +and the next pointer is a pointer to a +.I long int +or +.I unsigned long int +(rather than +.IR int ), +or that the conversion will be one of +\fBe\fP, \fBf\fP, or \fBg\fP +and the next pointer is a pointer to +.I double +(rather than +.IR float ). +Specifying two +.B l +characters is equivalent to +.BR L . +If used with +.B %c +or +.B %s +the corresponding parameter is considered +as a pointer to a wide character or wide-character string respectively. +.\" This use of l was introduced in Amendment 1 to ISO C90. +.TP +.B L +Indicates that the conversion will be either +\fBe\fP, \fBf\fP, or \fBg\fP +and the next pointer is a pointer to +.I "long double" +or the conversion will be +\fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, or \fBx\fP +and the next pointer is a pointer to +.IR "long long" . +.\" MTK, Jul 05: The following is no longer true for modern +.\" ANSI C (i.e., C99): +.\" (Note that long long is not an +.\" ANSI C +.\" type. Any program using this will not be portable to all +.\" architectures). +.TP +.B q +equivalent to +.BR L . +This specifier does not exist in ANSI C. +.TP +.B t +As for +.BR h , +but the next pointer is a pointer to a +.IR ptrdiff_t . +This modifier was introduced in C99. +.TP +.B z +As for +.BR h , +but the next pointer is a pointer to a +.IR size_t . +This modifier was introduced in C99. +.PP +The following +.I "conversion specifiers" +are available: +.TP +.B % +Matches a literal \(aq%\(aq. +That is, +.B %\&% +in the format string matches a +single input \(aq%\(aq character. +No conversion is done (but initial white space characters are discarded), +and assignment does not occur. +.TP +.B d +Matches an optionally signed decimal integer; +the next pointer must be a pointer to +.IR int . +.TP +.B D +Equivalent to +.IR ld ; +this exists only for backwards compatibility. +(Note: thus only in libc4. +In libc5 and glibc the +.B %D +is silently ignored, causing old programs to fail mysteriously.) +.TP +.B i +Matches an optionally signed integer; the next pointer must be a pointer to +.IR int . +The integer is read in base 16 if it begins with +.I 0x +or +.IR 0X , +in base 8 if it begins with +.IR 0 , +and in base 10 otherwise. +Only characters that correspond to the base are used. +.TP +.B o +Matches an unsigned octal integer; the next pointer must be a pointer to +.IR "unsigned int" . +.TP +.B u +Matches an unsigned decimal integer; the next pointer must be a +pointer to +.IR "unsigned int" . +.TP +.B x +Matches an unsigned hexadecimal integer; the next pointer must +be a pointer to +.IR "unsigned int" . +.TP +.B X +Equivalent to +.BR x . +.TP +.B f +Matches an optionally signed floating-point number; the next pointer must +be a pointer to +.IR float . +.TP +.B e +Equivalent to +.BR f . +.TP +.B g +Equivalent to +.BR f . +.TP +.B E +Equivalent to +.BR f . +.TP +.B a +(C99) Equivalent to +.BR f . +.TP +.B s +Matches a sequence of non-white-space characters; +the next pointer must be a pointer to character array that is +long enough to hold the input sequence and the terminating null +character (\(aq\\0\(aq), which is added automatically. +The input string stops at white space or at the maximum field +width, whichever occurs first. +.TP +.B c +Matches a sequence of characters whose length is specified by the +.I maximum field width +(default 1); the next pointer must be a pointer to +.IR char , +and there must be enough room for all the characters (no terminating +null byte +is added). +The usual skip of leading white space is suppressed. +To skip white space first, use an explicit space in the format. +.TP +.B \&[ +Matches a nonempty sequence of characters from the specified set of +accepted characters; the next pointer must be a pointer to +.IR char , +and there must be enough room for all the characters in the string, plus a +terminating null byte. +The usual skip of leading white space is suppressed. +The string is to be made up of characters in (or not in) a particular set; +the set is defined by the characters between the open bracket +.B [ +character and a close bracket +.B ] +character. +The set +.I excludes +those characters if the first character after the open bracket is a +circumflex +.RB ( ^ ). +To include a close bracket in the set, make it the first character after +the open bracket or the circumflex; any other position will end the set. +The hyphen character +.B \- +is also special; when placed between two other characters, it adds all +intervening characters to the set. +To include a hyphen, make it the last +character before the final close bracket. +For instance, +.B [^]0\-9\-] +means +the set "everything except close bracket, zero through nine, and hyphen". +The string ends with the appearance of a character not in the (or, with a +circumflex, in) set or when the field width runs out. +.TP +.B p +Matches a pointer value (as printed by +.B %p +in +.BR printf (3); +the next pointer must be a pointer to a pointer to +.IR void . +.TP +.B n +Nothing is expected; instead, the number of characters consumed thus far +from the input is stored through the next pointer, which must be a pointer +to +.IR int . +This is +.I not +a conversion, although it can be suppressed with the +.B * +assignment-suppression character. +The C standard says: "Execution of a +.B %n +directive does not increment +the assignment count returned at the completion of execution" +but the Corrigendum seems to contradict this. +Probably it is wise +not to make any assumptions on the effect of +.B %n +conversions on the return value. +.SH "RETURN VALUE" +These functions return the number of input items +successfully matched and assigned, +which can be fewer than provided for, +or even zero in the event of an early matching failure. + +The value +.B EOF +is returned if the end of input is reached before either the first +successful conversion or a matching failure occurs. +.B EOF +is also returned if a read error occurs, +in which case the error indicator for the stream (see +.BR ferror (3)) +is set, and +.I errno +is set indicate the error. +.SH ERRORS +.TP +.B EAGAIN +The file descriptor underlying +.I stream +is marked nonblocking, and the read operation would block. +.TP +.B EBADF +The file descriptor underlying +.I stream +is invalid, or not open for reading. +.TP +.B EILSEQ +Input byte sequence does not form a valid character. +.TP +.B EINTR +The read operation was interrupted by a signal; see +.BR signal (7). +.TP +.B EINVAL +Not enough arguments; or +.I format +is NULL. +.TP +.B ENOMEM +Out of memory. +.TP +.B ERANGE +The result of an integer conversion would exceed the size +that can be stored in the corresponding integer type. +.SH "CONFORMING TO" +The functions +.BR fscanf (), +.BR scanf (), +and +.BR sscanf () +conform to C89 and C99 and POSIX.1-2001. +These standards do not specify the +.B ERANGE +error. +.PP +The +.B q +specifier is the 4.4BSD notation for +.IR "long long" , +while +.B ll +or the usage of +.B L +in integer conversions is the GNU notation. +.PP +The Linux version of these functions is based on the +.I GNU +.I libio +library. +Take a look at the +.I info +documentation of +.I GNU +.I libc (glibc-1.08) +for a more concise description. +.SH NOTES +The GNU C library supports a nonstandard extension that causes +the library to dynamically allocate a string of sufficient size +for input strings for the +.B %s +and +\fB%a[\fP\fIrange\fP\fB]\fP +conversion specifiers. +.\" This feature seems to be present at least as far back as glibc 2.0. +To make use of this feature, specify +.B a +as a length modifier (thus +.B %as +or +\fB%a[\fP\fIrange\fP\fB]\fP). +The caller must +.BR free (3) +the returned string, as in the following example: +.in +4n +.nf + +char *p; +int n; + +errno = 0; +n = scanf("%a[a-z]", &p); +if (n == 1) { + printf("read: %s\\n", p); + free(p); +} else if (errno != 0) { + perror("scanf"); +} else { + fprintf(stderr, "No matching characters\\n"): +} +.fi +.in +.PP +As shown in the above example, it is only necessary to call +.BR free (3) +if the +.BR scanf () +call successfully read a string. +.PP +The +.B a +modifier is not available if the program is compiled with +.I "gcc -std=c99" +or +.IR "gcc -D_ISOC99_SOURCE" +(unless +.B _GNU_SOURCE +is also specified), in which case the +.B a +is interpreted as a specifier for floating-point numbers (see above). + +Since version 2.7, glibc also provides the +.B m +modifier for the same purpose as the +.BR a +modifier. +The +.B m +modifier has the following advantages: +.IP * 2 +It may also be applied to +.B %c +conversion specifiers (e.g., +.BR %3mc ). +.IP * +It avoids ambiguity with respect to the +.B %a +floating-point conversion specifier (and is unaffected by +.IR "gcc -std=c99" +etc.) +.IP * +It is specified in the upcoming revision of the POSIX.1 standard. +.SH BUGS +All functions are fully C89 conformant, but provide the +additional specifiers +.B q +and +.B a +as well as an additional behavior of the +.B L +and +.B l +specifiers. +The latter may be considered to be a bug, as it changes the +behavior of specifiers defined in C89. +.PP +Some combinations of the type modifiers and conversion +specifiers defined by ANSI C do not make sense +(e.g. +.BR "%Ld" ). +While they may have a well-defined behavior on Linux, this need not +to be so on other architectures. +Therefore it usually is better to use +modifiers that are not defined by ANSI C at all, that is, use +.B q +instead of +.B L +in combination with +\fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, and \fBX\fP +conversions or +.BR ll . +.PP +The usage of +.B q +is not the same as on 4.4BSD, +as it may be used in float conversions equivalently to +.BR L . +.SH "SEE ALSO" +.BR getc (3), +.BR printf (3), +.BR setlocale (3), +.BR strtod (3), +.BR strtol (3), +.BR strtoul (3) diff --git a/original/man3/sched_getcpu.3 b/original/man3/sched_getcpu.3 new file mode 100644 index 00000000..12a42a13 --- /dev/null +++ b/original/man3/sched_getcpu.3 @@ -0,0 +1,83 @@ +.\" 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. +.\" +.TH SCHED_GETCPU 3 2009-12-08 "Linux" "Linux Programmer's Manual" +.SH NAME +sched_getcpu \- determine CPU on which the calling thread is running +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include + +.B int sched_getcpu(void); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR sched_getcpu (): +_BSD_SOURCE || _SVID_SOURCE +.SH DESCRIPTION +.BR sched_getcpu () +returns the number of the CPU on which the calling thread is currently executing. +.SH RETURN VALUE +On success, +.BR sched_getcpu () +returns a nonnegative CPU number. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B ENOSYS +This kernel does not implement +.BR getcpu (2). +.SH VERSIONS +This function is available since glibc 2.6. +.SH CONFORMING TO +.BR sched_getcpu () +is glibc specific. +.SH NOTES +The call +.in +4n +.nf + +cpu = sched_getcpu(); + +.fi +.in +is equivalent to the following +.BR getcpu (2) +call: +.in +4n +.nf + +int c, s; +s = getcpu(&c, NULL, NULL); +cpu = (s == -1) ? s : c; +.fi +.in +.SH SEE ALSO +.BR getcpu (2) diff --git a/original/man3/seed48.3 b/original/man3/seed48.3 new file mode 100644 index 00000000..3133f7d6 --- /dev/null +++ b/original/man3/seed48.3 @@ -0,0 +1 @@ +.so man3/drand48.3 diff --git a/original/man3/seed48_r.3 b/original/man3/seed48_r.3 new file mode 100644 index 00000000..81e9d8ef --- /dev/null +++ b/original/man3/seed48_r.3 @@ -0,0 +1 @@ +.so man3/drand48_r.3 diff --git a/original/man3/seekdir.3 b/original/man3/seekdir.3 new file mode 100644 index 00000000..6286e34c --- /dev/null +++ b/original/man3/seekdir.3 @@ -0,0 +1,79 @@ +.\" 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 Sat Jul 24 18:25:21 1993 by Rik Faith (faith@cs.unc.edu) +.TH SEEKDIR 3 2009-03-11 "" "Linux Programmer's Manual" +.SH NAME +seekdir \- set the position of the next readdir() call in the directory +stream. +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void seekdir(DIR *" dirp ", long " offset ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR seekdir (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.SH DESCRIPTION +The +.BR seekdir () +function sets the location in the directory stream +from which the next +.BR readdir (2) +call will start. +.BR seekdir () +should be used with an +.I offset +returned by +.BR telldir (3). +.SH "RETURN VALUE" +The +.BR seekdir () +function returns no value. +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +.SH NOTES +In glibc up to version 2.1.1, the type of the +.I offset +argument was +.IR off_t . +POSIX.1-2001 specifies +.IR long , +and this is the type used since glibc 2.1.2. +.SH "SEE ALSO" +.BR lseek (2), +.BR closedir (3), +.BR opendir (3), +.BR readdir (3), +.BR rewinddir (3), +.BR scandir (3), +.BR telldir (3) diff --git a/original/man3/sem_close.3 b/original/man3/sem_close.3 new file mode 100644 index 00000000..0d4bbaf8 --- /dev/null +++ b/original/man3/sem_close.3 @@ -0,0 +1,66 @@ +'\" 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. +.\" +.TH SEM_CLOSE 3 2006-03-25 "Linux" "Linux Programmer's Manual" +.SH NAME +sem_close \- close a named semaphore +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int sem_close(sem_t *" sem ); +.fi +.sp +Link with \fI\-lrt\fP or \fI\-pthread\fP. +.SH DESCRIPTION +.BR sem_close () +closes the named semaphore referred to by +.IR sem , +allowing any resources that the system has allocated to +the calling process for this semaphore to be freed. +.SH RETURN VALUE +On success +.BR sem_close () +returns 0; on error, \-1 is returned, with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +.I sem +is not a valid semaphore. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +All open named semaphores are automatically closed on process +termination, or upon +.BR execve (2). +.SH "SEE ALSO" +.BR sem_getvalue (3), +.BR sem_open (3), +.BR sem_post (3), +.BR sem_unlink (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/original/man3/sem_destroy.3 b/original/man3/sem_destroy.3 new file mode 100644 index 00000000..a3c75f49 --- /dev/null +++ b/original/man3/sem_destroy.3 @@ -0,0 +1,78 @@ +'\" 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. +.\" +.TH SEM_DESTROY 3 2006-03-25 "Linux" "Linux Programmer's Manual" +.SH NAME +sem_destroy \- destroy an unnamed semaphore +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int sem_destroy(sem_t *" sem ); +.fi +.sp +Link with \fI\-lrt\fP or \fI\-pthread\fP. +.SH DESCRIPTION +.BR sem_destroy () +destroys the unnamed semaphore at the address pointed to by +.IR sem . + +Only a semaphore that has been initialized by +.BR sem_init (3) +should be destroyed using +.BR sem_destroy (). + +Destroying a semaphore that other processes or threads are +currently blocked on (in +.BR sem_wait (3)) +produces undefined behavior. + +Using a semaphore that has been destroyed produces undefined results, +until the semaphore has been reinitialized using +.BR sem_init (3). +.SH RETURN VALUE +.BR sem_destroy () +returns 0 on success; +on error, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +.I sem +is not a valid semaphore. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +An unnamed semaphore should be destroyed with +.BR sem_destroy () +before the memory in which it is located is deallocated. +Failure to do this can result in resource leaks on some implementations. +.\" But not on NPTL, where sem_destroy () is a no-op.. +.SH "SEE ALSO" +.BR sem_init (3), +.BR sem_post (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/original/man3/sem_getvalue.3 b/original/man3/sem_getvalue.3 new file mode 100644 index 00000000..a379964a --- /dev/null +++ b/original/man3/sem_getvalue.3 @@ -0,0 +1,74 @@ +'\" 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. +.\" +.TH SEM_GETVALUE 3 2006-03-25 "Linux" "Linux Programmer's Manual" +.SH NAME +sem_getvalue \- get the value of a semaphore +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int sem_getvalue(sem_t *" sem ", int *" sval ); +.fi +.sp +Link with \fI\-lrt\fP or \fI\-pthread\fP. +.SH DESCRIPTION +.BR sem_getvalue () +places the current value of the semaphore pointed to +.I sem +into the integer pointed to by +.IR sval . + +If one or more processes or threads are blocked +waiting to lock the semaphore with +.BR sem_wait (3), +POSIX.1-2001 permits two possibilities for the value returned in +.IR sval : +either 0 is returned; +or a negative number whose absolute value is the count +of the number of processes and threads currently blocked in +.BR sem_wait (3). +Linux adopts the former behavior. +.SH RETURN VALUE +.BR sem_getvalue () +returns 0 on success; +on error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +.I sem +is not a valid semaphore. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +The value of the semaphore may already have changed by the time +.BR sem_getvalue () +returns. +.SH "SEE ALSO" +.BR sem_post (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/original/man3/sem_init.3 b/original/man3/sem_init.3 new file mode 100644 index 00000000..4051547f --- /dev/null +++ b/original/man3/sem_init.3 @@ -0,0 +1,106 @@ +'\" 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. +.\" +.TH SEM_INIT 3 2008-07-27 "Linux" "Linux Programmer's Manual" +.SH NAME +sem_init \- initialize an unnamed semaphore +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int sem_init(sem_t *" sem ", int " pshared ", unsigned int " value ); +.fi +.sp +Link with \fI\-lrt\fP or \fI\-pthread\fP. +.SH DESCRIPTION +.BR sem_init () +initializes the unnamed semaphore at the address pointed to by +.IR sem . +The +.I value +argument specifies the initial value for the semaphore. + +The +.I pshared +argument indicates whether this semaphore is to be shared +between the threads of a process, or between processes. + +If +.I pshared +has the value 0, +then the semaphore is shared between the threads of a process, +and should be located at some address that is visible to all threads +(e.g., a global variable, or a variable allocated dynamically on +the heap). + +If +.I pshared +is nonzero, then the semaphore is shared between processes, +and should be located in a region of shared memory (see +.BR shm_open (3), +.BR mmap (2), +and +.BR shmget (2)). +(Since a child created by +.BR fork (2) +inherits its parent's memory mappings, it can also access the semaphore.) +Any process that can access the shared memory region +can operate on the semaphore using +.BR sem_post (3), +.BR sem_wait (3), +etc. + +Initializing a semaphore that has already been initialized +results in undefined behavior. +.SH RETURN VALUE +.BR sem_init () +returns 0 on success; +on error, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +.I value +exceeds +.BR SEM_VALUE_MAX . +.TP +.B ENOSYS +.I pshared +is nonzero, +but the system does not support process-shared semaphores (see +.BR sem_overview (7)). +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +Bizarrely, POSIX.1-2001 does not specify the value that should +be returned by a successful call to +.BR sem_init (). +POSIX.1-2008 rectifies this, specifying the zero return on success. +.SH "SEE ALSO" +.BR sem_destroy (3), +.BR sem_post (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/original/man3/sem_open.3 b/original/man3/sem_open.3 new file mode 100644 index 00000000..3ae65d08 --- /dev/null +++ b/original/man3/sem_open.3 @@ -0,0 +1,178 @@ +'\" 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. +.\" +.TH SEM_OPEN 3 2009-02-20 "Linux" "Linux Programmer's Manual" +.SH NAME +sem_open \- initialize and open a named semaphore +.SH SYNOPSIS +.nf +.BR "#include " " /* For O_* constants */" +.BR "#include " " /* For mode constants */" +.B #include +.sp +.BI "sem_t *sem_open(const char *" name ", int " oflag ); +.BI "sem_t *sem_open(const char *" name ", int " oflag ", " +.BI " mode_t " mode ", unsigned int " value ); +.fi +.sp +Link with \fI\-lrt\fP or \fI\-pthread\fP. +.SH DESCRIPTION +.BR sem_open () +creates a new POSIX semaphore or opens an existing semaphore. +The semaphore is identified by +.IR name . +For details of the construction of +.IR name , +see +.BR sem_overview (7). + +The +.I oflag +argument specifies flags that control the operation of the call. +(Definitions of the flags values can be obtained by including +.IR .) +If +.B O_CREAT +is specified in +.IR oflag , +then the semaphore is created if +it does not already exist. +The owner (user ID) of the semaphore is set to the effective +user ID of the calling process. +The group ownership (group ID) is set to the effective group ID +of the calling process. +.\" In reality the file system IDs are used on Linux. +If both +.B O_CREAT +and +.B O_EXCL +are specified in +.IR oflag , +then an error is returned if a semaphore with the given +.I name +already exists. +.PP +If +.B O_CREAT +is specified in +.IR oflag , +then two additional arguments must be supplied. +The +.I mode +argument specifies the permissions to be placed on the new semaphore, +as for +.BR open (2). +(Symbolic definitions for the permissions bits can be obtained by including +.IR .) +The permissions settings are masked against the process umask. +Both read and write permission should be granted to each class of +user that will access the semaphore. +The +.I value +argument specifies the initial value for the new semaphore. +If +.B O_CREAT +is specified, and a semaphore with the given +.I name +already exists, then +.I mode +and +.I value +are ignored. +.SH RETURN VALUE +On success, +.BR sem_open () +returns the address of the new semaphore; +this address is used when calling other semaphore-related functions. +On error, +.BR sem_open () +returns +.BR SEM_FAILED , +with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EACCES +The semaphore exists, but the caller does not have permission to +open it. +.TP +.B EEXIST +Both +.B O_CREAT +and +.B O_EXCL +were specified in +.IR oflag , +but a semaphore with this +.I name +already exists. +.TP +.B EINVAL +.I value +was greater than +.BR SEM_VALUE_MAX . +.TP +.B EINVAL +.I name +consists of just "/", followed by no other characters. +.TP +.B EMFILE +The process already has the maximum number of files and open. +.TP +.B ENAMETOOLONG +.I name +was too long. +.TP +.B ENFILE +The system limit on the total number of open files has been reached. +.TP +.B ENOENT +The +.B O_CREAT +flag was not specified in +.IR oflag +and no semaphore with this +.I name +exists; +or, +.\" this error can occur if we have a name of the (nonportable) form +.\" /dir/name, and the directory /dev/shm/dir does not exist. +.B O_CREAT +was specified, but +.I name +wasn't well formed. +.TP +.B ENOMEM +Insufficient memory. +.SH CONFORMING TO +POSIX.1-2001. +.SH "SEE ALSO" +.BR sem_close (3), +.BR sem_getvalue (3), +.BR sem_post (3), +.BR sem_unlink (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/original/man3/sem_post.3 b/original/man3/sem_post.3 new file mode 100644 index 00000000..cb19a0cf --- /dev/null +++ b/original/man3/sem_post.3 @@ -0,0 +1,73 @@ +'\" 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. +.\" +.TH SEM_POST 3 2009-03-30 "Linux" "Linux Programmer's Manual" +.SH NAME +sem_post \- unlock a semaphore +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int sem_post(sem_t *" sem ); +.fi +.sp +Link with \fI\-lrt\fP or \fI\-pthread\fP. +.SH DESCRIPTION +.BR sem_post () +increments (unlocks) the semaphore pointed to by +.IR sem . +If the semaphore's value consequently becomes greater than zero, +then another process or thread blocked in a +.BR sem_wait (3) +call will be woken up and proceed to lock the semaphore. +.SH RETURN VALUE +.BR sem_post () +returns 0 on success; +on error, the value of the semaphore is left unchanged, +\-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +.I sem +is not a valid semaphore. +.TP +.B EOVERFLOW +.\" Added in POSIX.1-2008 TC1 (Austin Interpretation 213) +The maximum allowable value for a semaphore would be exceeded. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +.BR sem_post () +is async-signal-safe: +it may be safely called within a signal handler. +.SH EXAMPLE +See +.BR sem_wait (3). +.SH "SEE ALSO" +.BR sem_getvalue (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/original/man3/sem_timedwait.3 b/original/man3/sem_timedwait.3 new file mode 100644 index 00000000..c7b43fa8 --- /dev/null +++ b/original/man3/sem_timedwait.3 @@ -0,0 +1 @@ +.so man3/sem_wait.3 diff --git a/original/man3/sem_trywait.3 b/original/man3/sem_trywait.3 new file mode 100644 index 00000000..c7b43fa8 --- /dev/null +++ b/original/man3/sem_trywait.3 @@ -0,0 +1 @@ +.so man3/sem_wait.3 diff --git a/original/man3/sem_unlink.3 b/original/man3/sem_unlink.3 new file mode 100644 index 00000000..30b90355 --- /dev/null +++ b/original/man3/sem_unlink.3 @@ -0,0 +1,69 @@ +'\" 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. +.\" +.TH SEM_UNLINK 3 2006-03-25 "Linux" "Linux Programmer's Manual" +.SH NAME +sem_unlink \- remove a named semaphore +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int sem_unlink(const char *" name ); +.fi +.sp +Link with \fI\-lrt\fP or \fI\-pthread\fP. +.SH DESCRIPTION +.BR sem_unlink () +removes the named semaphore referred to by +.IR name . +The semaphore name is removed immediately. +The semaphore is destroyed once all other processes that have +the semaphore open close it. +.SH RETURN VALUE +On success +.BR sem_unlink () +returns 0; on error, \-1 is returned, with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EACCES +The caller does not have permission to unlink this semaphore. +.TP +.B ENAMETOOLONG +.I name +was too long. +.TP +.B ENOENT +There is no semaphore with the given +.IR name . +.SH CONFORMING TO +POSIX.1-2001. +.SH "SEE ALSO" +.BR sem_getvalue (3), +.BR sem_open (3), +.BR sem_post (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/original/man3/sem_wait.3 b/original/man3/sem_wait.3 new file mode 100644 index 00000000..9523593d --- /dev/null +++ b/original/man3/sem_wait.3 @@ -0,0 +1,268 @@ +'\" 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. +.\" +.TH SEM_WAIT 3 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +sem_wait, sem_timedwait, sem_trywait \- lock a semaphore +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int sem_wait(sem_t *" sem ); +.sp +.BI "int sem_trywait(sem_t *" sem ); +.sp +.BI "int sem_timedwait(sem_t *" sem ", const struct timespec *" abs_timeout ); +.fi +.sp +Link with \fI\-lrt\fP or \fI\-pthread\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR sem_timedwait (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.SH DESCRIPTION +.BR sem_wait () +decrements (locks) the semaphore pointed to by +.IR sem . +If the semaphore's value is greater than zero, +then the decrement proceeds, and the function returns, immediately. +If the semaphore currently has the value zero, +then the call blocks until either it becomes possible to perform +the decrement (i.e., the semaphore value rises above zero), +or a signal handler interrupts the call. + +.BR sem_trywait () +is the same as +.BR sem_wait (), +except that if the decrement cannot be immediately performed, +then call returns an error +.RI ( errno +set to +.BR EAGAIN ) +instead of blocking. + +.BR sem_timedwait () +is the same as +.BR sem_wait (), +except that +.I abs_timeout +specifies a limit on the amount of time that the call +should block if the decrement cannot be immediately performed. +The +.I abs_timeout +argument points to a structure that specifies an absolute timeout +in seconds and nanoseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). +This structure is defined as follows: + +.nf +.in +4n +struct timespec { + time_t tv_sec; /* Seconds */ + long tv_nsec; /* Nanoseconds [0 .. 999999999] */ +}; +.in +.fi +.PP +If the timeout has already expired by the time of the call, +and the semaphore could not be locked immediately, +then +.BR sem_timedwait () +fails with a timeout error +.RI ( errno +set to +.BR ETIMEDOUT ). + +If the operation can be performed immediately, then +.BR sem_timedwait () +never fails with a timeout error, regardless of the value of +.IR abs_timeout . +Furthermore, the validity of +.I abs_timeout +is not checked in this case. +.SH RETURN VALUE +All of these functions return 0 on success; +on error, the value of the semaphore is left unchanged, +\-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINTR +The call was interrupted by a signal handler; see +.BR signal (7). +.TP +.B EINVAL +.I sem +is not a valid semaphore. +.PP +The following additional error can occur for +.BR sem_trywait (): +.TP +.B EAGAIN +The operation could not be performed without blocking (i.e., the +semaphore currently has the value zero). +.PP +The following additional errors can occur for +.BR sem_timedwait (): +.TP +.B EINVAL +The value of +.I abs_timeout.tv_nsecs +is less than 0, or greater than or equal to 1000 million. +.TP +.B ETIMEDOUT +The call timed out before the semaphore could be locked. +.\" POSIX.1-2001 also allows EDEADLK -- "A deadlock condition +.\" was detected", but this does not occur on Linux(?). +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +A signal handler always interrupts a blocked call to +one of these functions, regardless of the use of the +.BR sigaction (2) +.B SA_RESTART +flag. +.\" sem_wait() is always interrupted on most other implementations, +.\" but on FreeBSD 5.4 SA_RESTART does cause restarting. +.SH EXAMPLE +.PP +The (somewhat trivial) program shown below operates on an +unnamed semaphore. +The program expects two command-line arguments. +The first argument specifies a seconds value that is used to +set an alarm timer to generate a +.B SIGALRM +signal. +This handler performs a +.BR sem_post (3) +to increment the semaphore that is being waited on in +.I main() +using +.BR sem_timedwait (). +The second command-line argument specifies the length +of the timeout, in seconds, for +.BR sem_timedwait (). +The following shows what happens on two different runs of the program: + +.in +4n +.nf +.RB "$" " ./a.out 2 3" +About to call sem_timedwait() +sem_post() from handler +sem_getvalue() from handler; value = 1 +sem_timedwait() succeeded +.RB "$" " ./a.out 2 1" +About to call sem_timedwait() +sem_timedwait() timed out +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include +#include +#include +#include +#include +#include + +sem_t sem; + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +static void +handler(int sig) +{ + write(STDOUT_FILENO, "sem_post() from handler\\n", 24); + if (sem_post(&sem) == \-1) { + write(STDERR_FILENO, "sem_post() failed\\n", 18); + _exit(EXIT_FAILURE); + } +} + +int +main(int argc, char *argv[]) +{ + struct sigaction sa; + struct timespec ts; + int s; + + if (argc != 3) { + fprintf(stderr, "Usage: %s \\n", + argv[0]); + exit(EXIT_FAILURE); + } + + if (sem_init(&sem, 0, 0) == \-1) + handle_error("sem_init"); + + /* Establish SIGALRM handler; set alarm timer using argv[1] */ + + sa.sa_handler = handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + if (sigaction(SIGALRM, &sa, NULL) == \-1) + handle_error("sigaction"); + + alarm(atoi(argv[1])); + + /* Calculate relative interval as current time plus + number of seconds given argv[2] */ + + if (clock_gettime(CLOCK_REALTIME, &ts) == \-1) + handle_error("clock_gettime"); + + ts.tv_sec += atoi(argv[2]); + + printf("main() about to call sem_timedwait()\\n"); + while ((s = sem_timedwait(&sem, &ts)) == \-1 && errno == EINTR) + continue; /* Restart if interrupted by handler */ + + /* Check what happened */ + + if (s == \-1) { + if (errno == ETIMEDOUT) + printf("sem_timedwait() timed out\\n"); + else + perror("sem_timedwait"); + } else + printf("sem_timedwait() succeeded\\n"); + + exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE); +} +.fi +.SH "SEE ALSO" +.BR clock_gettime (2), +.BR sem_getvalue (3), +.BR sem_post (3), +.BR sem_overview (7), +.BR time (7) diff --git a/original/man3/setaliasent.3 b/original/man3/setaliasent.3 new file mode 100644 index 00000000..fdfb4033 --- /dev/null +++ b/original/man3/setaliasent.3 @@ -0,0 +1,149 @@ +.\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Polished a bit, added a little, aeb +.\" +.TH SETALIASENT 3 2003-09-09 "GNU" "Linux Programmer's Manual" +.SH NAME +setaliasent, endaliasent, getaliasent, getaliasent_r, +getaliasbyname, getaliasbyname_r \- read an alias entry +.SH SYNOPSIS +.B #include +.sp +.B "void setaliasent(void);" +.sp +.B "void endaliasent(void);" +.sp +.B "struct aliasent *getaliasent(void);" +.sp +.BI "int getaliasent_r(struct aliasent *" result "," +.br +.BI " char *" buffer ", size_t " buflen ", struct aliasent **" res ); +.sp +.BI "struct aliasent *getaliasbyname(const char *" name ); +.sp +.BI "int getaliasbyname_r(const char *" name ", struct aliasent *" result , +.br +.BI " char *" buffer ", size_t " buflen ", struct aliasent **" res ); +.SH DESCRIPTION +One of the databases available with the Name Service Switch (NSS) +is the aliases database, that contains mail aliases. +(To find out which databases are supported, try \fIgetent \-\-help\fP.) +Six functions are provided to access the aliases database. +.PP +The +.BR getaliasent () +function returns a pointer to a structure containing +the group information from the aliases database. +The first time it is called it returns the first entry; +thereafter, it returns successive entries. +.PP +The +.BR setaliasent () +function rewinds the file pointer to the beginning of the +aliases database. +.PP +The +.BR endaliasent () +function closes the aliases database. +.PP +.BR getaliasent_r () +is the reentrant version of the previous function. +The requested structure +is stored via the first argument but the programmer needs to fill the other +arguments also. +Not providing enough space causes the function to fail. +.PP +The function +.BR getaliasbyname () +takes the name argument and searches the aliases database. +The entry is returned as a pointer to a +.IR "struct aliasent" . +.PP +.BR getaliasbyname_r () +is the reentrant version of the previous function. +The requested structure +is stored via the second argument but the programmer needs to fill the other +arguments also. +Not providing enough space causes the function to fail. +.PP +The +.I "struct aliasent" +is defined in +.IR : +.in +4n +.nf + +struct aliasent { + char *alias_name; /* alias name */ + size_t alias_members_len; + char **alias_members; /* alias name list */ + int alias_local; +}; +.fi +.in +.SH "RETURN VALUE" +The functions +.BR getaliasent_r () +and +.BR getaliasbyname_r () +return a nonzero value on error. +.SH FILES +The default alias database is the file +.IR /etc/aliases . +This can be changed in the +.I /etc/nsswitch.conf +file. +.SH "CONFORMING TO" +These routines are glibc-specific. +The NeXT has similar routines: +.in +4n +.nf + +#include + +void alias_setent(void); +void alias_endent(void); +alias_ent *alias_getent(void); +alias_ent *alias_getbyname(char *name); +.fi +.in +.SH EXAMPLE +The following example compiles with +.IR "gcc example.c \-o example" . +It will dump all names in the alias database. +.sp +.nf +#include +#include +#include +#include + +int +main(void) +{ + struct aliasent *al; + setaliasent(); + for (;;) { + al = getaliasent(); + if (al == NULL) + break; + printf("Name: %s\\n", al\->alias_name); + } + if (errno) { + perror("reading alias"); + exit(EXIT_FAILURE); + } + endaliasent(); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR getgrent (3), +.BR getpwent (3), +.BR getspent (3), +.BR aliases (5) +.\" +.\" /etc/sendmail/aliases +.\" Yellow Pages +.\" newaliases, postalias diff --git a/original/man3/setbuf.3 b/original/man3/setbuf.3 new file mode 100644 index 00000000..b9d41a91 --- /dev/null +++ b/original/man3/setbuf.3 @@ -0,0 +1,205 @@ +.\" Copyright (c) 1980, 1991 Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)setbuf.3 6.10 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 14:55:24 1993, faith@cs.unc.edu +.\" Added section to BUGS, Sun Mar 12 22:28:33 MET 1995, +.\" Thomas.Koenig@ciw.uni-karlsruhe.de +.\" Correction, Sun, 11 Apr 1999 15:55:18, +.\" Martin Vicente +.\" Correction, 2000-03-03, Andreas Jaeger +.\" Added return value for setvbuf, aeb, +.\" +.TH SETBUF 3 2008-06-26 "Linux" "Linux Programmer's Manual" +.SH NAME +setbuf, setbuffer, setlinebuf, setvbuf \- stream buffering operations +.SH SYNOPSIS +.nf +.B #include + +.BI "void setbuf(FILE *" stream ", char *" buf ); + +.BI "void setbuffer(FILE *" stream ", char *" buf ", size_t " size ); + +.BI "void setlinebuf(FILE *" stream ); + +.BI "int setvbuf(FILE *" stream ", char *" buf ", int " mode \ +", size_t " size ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR setbuffer (), +.BR setlinebuf (): +_BSD_SOURCE +.SH DESCRIPTION +The three types of buffering available are unbuffered, block buffered, and +line buffered. +When an output stream is unbuffered, information appears on +the destination file or terminal as soon as written; when it is block +buffered many characters are saved up and written as a block; when it is +line buffered characters are saved up until a newline is output or input is +read from any stream attached to a terminal device (typically \fIstdin\fP). +The function +.BR fflush (3) +may be used to force the block out early. +(See +.BR fclose (3).) +Normally all files are block buffered. +When the first I/O operation occurs on a file, +.BR malloc (3) +is called, and a buffer is obtained. +If a stream refers to a terminal (as +.I stdout +normally does) it is line buffered. +The standard error stream +.I stderr +is always unbuffered by default. +.PP +The +.BR setvbuf () +function may be used on any open stream to change its buffer. +The +.I mode +argument must be one of the following three macros: +.RS +.TP +.B _IONBF +unbuffered +.TP +.B _IOLBF +line buffered +.TP +.B _IOFBF +fully buffered +.RE +.PP +Except for unbuffered files, the +.I buf +argument should point to a buffer at least +.I size +bytes long; this buffer will be used instead of the current buffer. +If the argument +.I buf +is NULL, +only the mode is affected; a new buffer will be allocated on the next read +or write operation. +The +.BR setvbuf () +function may only be used after opening a stream and before any other +operations have been performed on it. +.PP +The other three calls are, in effect, simply aliases for calls to +.BR setvbuf (). +The +.BR setbuf () +function is exactly equivalent to the call +.PP +.in +4n +setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ); +.in +.PP +The +.BR setbuffer () +function is the same, except that the size of the buffer is up to the +caller, rather than being determined by the default +.BR BUFSIZ . +The +.BR setlinebuf () +function is exactly equivalent to the call: +.PP +.in +4n +setvbuf(stream, (char *) NULL, _IOLBF, 0); +.in +.SH "RETURN VALUE" +The function +.BR setvbuf () +returns 0 on success. +It returns nonzero on failure +.RI ( mode +is invalid or the request cannot be honored). +It may set +.I errno +on failure. + +The other functions do not return a value. +.SH "CONFORMING TO" +The +.BR setbuf () +and +.BR setvbuf () +functions conform to C89 and C99. +.SH BUGS +The +.BR setbuffer () +and +.BR setlinebuf () +functions are not portable to versions of BSD before 4.2BSD, and +are available under Linux since libc 4.5.21. +On 4.2BSD and 4.3BSD systems, +.BR setbuf () +always uses a suboptimal buffer size and should be avoided. +.P +You must make sure that the space that +.I buf +points to still exists by the time +.I stream +is closed, which also happens at program termination. +For example, the following is invalid: +.nf +.sp +#include + +int +main(void) +{ + char buf[BUFSIZ]; + setbuf(stdin, buf); + printf("Hello, world!\\n"); + return 0; +} +.fi +.SH "SEE ALSO" +.BR fclose (3), +.BR fflush (3), +.BR fopen (3), +.BR fread (3), +.BR malloc (3), +.BR printf (3), +.BR puts (3) diff --git a/original/man3/setbuffer.3 b/original/man3/setbuffer.3 new file mode 100644 index 00000000..dc02d9e8 --- /dev/null +++ b/original/man3/setbuffer.3 @@ -0,0 +1 @@ +.so man3/setbuf.3 diff --git a/original/man3/setenv.3 b/original/man3/setenv.3 new file mode 100644 index 00000000..c40705d8 --- /dev/null +++ b/original/man3/setenv.3 @@ -0,0 +1,132 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and Copyright (C) 2004, 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified Sat Jul 24 18:20:58 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Feb 14 21:47:50 1997 by Andries Brouwer (aeb@cwi.nl) +.\" Modified 9 Jun 2004, Michael Kerrisk +.\" Changed unsetenv() prototype; added EINVAL error +.\" Noted nonstandard behavior of setenv() if name contains '=' +.\" 2005-08-12, mtk, glibc 2.3.4 fixed the "name contains '='" bug +.\" +.TH SETENV 3 2009-09-20 "GNU" "Linux Programmer's Manual" +.SH NAME +setenv \- change or add an environment variable +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int setenv(const char *" name ", const char *" value ", int " overwrite ); +.sp +.BI "int unsetenv(const char *" name ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR setenv (), +.BR unsetenv (): +_BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH DESCRIPTION +The +.BR setenv () +function adds the variable \fIname\fP to the +environment with the value \fIvalue\fP, if \fIname\fP does not +already exist. +If \fIname\fP does exist in the environment, then +its value is changed to \fIvalue\fP if \fIoverwrite\fP is nonzero; +if \fIoverwrite\fP is zero, then the value of \fIname\fP is not +changed. +This function makes copies of the strings pointed to by +.I name +and +.I value +(by contrast with +.BR putenv (3)). +.PP +The +.BR unsetenv () +function deletes the variable \fIname\fP from +the environment. +If +.I name +does not exist in the environment, +then the function succeeds, and the environment is unchanged. +.SH "RETURN VALUE" +The +.BR setenv () +function returns zero on success, +or \-1 on error, with +.I errno +set to indicate the cause of the error. + +The +.BR unsetenv () +function returns zero on success, +or \-1 on error, with +.I errno +set to indicate the cause of the error. +.SH "ERRORS" +.TP +.B EINVAL +.I name +is NULL, points to a string of length 0, +or contains an \(aq=\(aq character. +.TP +.B ENOMEM +Insufficient memory to add a new variable to the environment. +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +.SH "NOTES" +POSIX.1-2001 does not require +.BR setenv () +or +.BR unsetenv () +to be reentrant. + +Prior to glibc 2.2.2, +.BR unsetenv () +was prototyped +as returning \fIvoid\fP; more recent glibc versions follow the +POSIX.1-2001-compliant prototype shown in the SYNOPSIS. +.SH BUGS +POSIX.1-2001 specifies that if +.I name +contains an \(aq=\(aq character, then +.BR setenv () +should fail with the error +.BR EINVAL ; +however, versions of glibc before 2.3.4 allowed an \(aq=\(aq sign in +.IR name . +.SH "SEE ALSO" +.BR clearenv (3), +.BR getenv (3), +.BR putenv (3), +.BR environ (7) diff --git a/original/man3/setfsent.3 b/original/man3/setfsent.3 new file mode 100644 index 00000000..1e6a3eb7 --- /dev/null +++ b/original/man3/setfsent.3 @@ -0,0 +1 @@ +.so man3/getfsent.3 diff --git a/original/man3/setgrent.3 b/original/man3/setgrent.3 new file mode 100644 index 00000000..bde736ff --- /dev/null +++ b/original/man3/setgrent.3 @@ -0,0 +1 @@ +.so man3/getgrent.3 diff --git a/original/man3/sethostent.3 b/original/man3/sethostent.3 new file mode 100644 index 00000000..7d0fb4b7 --- /dev/null +++ b/original/man3/sethostent.3 @@ -0,0 +1 @@ +.so man3/gethostbyname.3 diff --git a/original/man3/sethostid.3 b/original/man3/sethostid.3 new file mode 100644 index 00000000..3210db03 --- /dev/null +++ b/original/man3/sethostid.3 @@ -0,0 +1 @@ +.so man3/gethostid.3 diff --git a/original/man3/setjmp.3 b/original/man3/setjmp.3 new file mode 100644 index 00000000..b23d7fb9 --- /dev/null +++ b/original/man3/setjmp.3 @@ -0,0 +1,119 @@ +.\" Written by Michael Haardt, Fri Nov 25 14:51:42 MET 1994 +.\" +.\" 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. +.\" +.\" Added sigsetjmp, Sun Mar 2 22:03:05 EST 1997, jrv@vanzandt.mv.com +.\" Modifications, Sun Feb 26 14:39:45 1995, faith@cs.unc.edu +.\" " +.TH SETJMP 3 2009-06-26 "" "Linux Programmer's Manual" +.SH NAME +setjmp, sigsetjmp \- save stack context for nonlocal goto +.SH SYNOPSIS +.B #include +.sp +.nf +.BI "int setjmp(jmp_buf " env ); + +.BI "int sigsetjmp(sigjmp_buf " env ", int " savesigs ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR setjmp (): +see NOTES. +.br +.BR sigsetjmp (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_C_SOURCE +.SH DESCRIPTION +.BR setjmp () +and +.BR longjmp (3) +are useful for dealing with errors +and interrupts encountered in a low-level subroutine of a program. +.BR setjmp () +saves the stack context/environment in \fIenv\fP for +later use by +.BR longjmp (3). +The stack context will be invalidated +if the function which called +.BR setjmp () +returns. +.P +.BR sigsetjmp () +is similar to +.BR setjmp (). +If, and only if, \fIsavesigs\fP is nonzero, +the process's current signal mask is saved in \fIenv\fP +and will be restored if a +.BR siglongjmp (3) +is later performed with this \fIenv\fP. +.SH "RETURN VALUE" +.BR setjmp () +and +.BR sigsetjmp () +return 0 if returning directly, and +nonzero when returning from +.BR longjmp (3) +or +.BR siglongjmp (3) +using the saved context. +.SH "CONFORMING TO" +C89, C99, and POSIX.1-2001 specify +.BR setjmp (). +POSIX.1-2001 specifies +.BR sigsetjmp (). +.SH NOTES +POSIX does not specify whether +.BR setjmp () +will save the signal mask. +In System V it will not. +In 4.3BSD it will, and there +is a function \fB_setjmp\fP that will not. +By default, Linux/glibc follows the System V behavior, +but the BSD behavior is provided if the +.BR _BSD_SOURCE +feature test macro is defined and none of +.BR _POSIX_SOURCE , +.BR _POSIX_C_SOURCE , +.BR _XOPEN_SOURCE , +.BR _XOPEN_SOURCE_EXTENDED , +.BR _GNU_SOURCE , +or +.B _SVID_SOURCE +is defined. + +If you want to portably save and restore signal masks, use +.BR sigsetjmp () +and +.BR siglongjmp (). +.P +.BR setjmp () +and +.BR sigsetjmp () +make programs hard to understand +and maintain. +If possible an alternative should be used. +.SH "SEE ALSO" +.BR longjmp (3), +.BR siglongjmp (3) diff --git a/original/man3/setkey.3 b/original/man3/setkey.3 new file mode 100644 index 00000000..e34c9e91 --- /dev/null +++ b/original/man3/setkey.3 @@ -0,0 +1 @@ +.so man3/encrypt.3 diff --git a/original/man3/setkey_r.3 b/original/man3/setkey_r.3 new file mode 100644 index 00000000..e34c9e91 --- /dev/null +++ b/original/man3/setkey_r.3 @@ -0,0 +1 @@ +.so man3/encrypt.3 diff --git a/original/man3/setlinebuf.3 b/original/man3/setlinebuf.3 new file mode 100644 index 00000000..dc02d9e8 --- /dev/null +++ b/original/man3/setlinebuf.3 @@ -0,0 +1 @@ +.so man3/setbuf.3 diff --git a/original/man3/setlocale.3 b/original/man3/setlocale.3 new file mode 100644 index 00000000..102187a5 --- /dev/null +++ b/original/man3/setlocale.3 @@ -0,0 +1,198 @@ +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" and Copyright 1999 by Bruno Haible (haible@clisp.cons.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. +.\" License. +.\" Modified Sat Jul 24 18:20:12 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Tue Jul 15 16:49:10 1997 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Sun Jul 4 14:52:16 1999 by Bruno Haible (haible@clisp.cons.org) +.\" Modified Tue Aug 24 17:11:01 1999 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Tue Feb 6 03:31:55 2001 by Andries Brouwer (aeb@cwi.nl) +.\" +.TH SETLOCALE 3 2008-12-05 "GNU" "Linux Programmer's Manual" +.SH NAME +setlocale \- set the current locale +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *setlocale(int " category ", const char *" locale ); +.fi +.SH DESCRIPTION +The +.BR setlocale () +function is used to set or query the program's current locale. +.PP +If +.I locale +is not NULL, +the program's current locale is modified according to the arguments. +The argument +.I category +determines which parts of the program's current locale should be modified. +.TP +.B LC_ALL +for all of the locale. +.TP +.B LC_COLLATE +for regular expression matching (it determines the meaning +of range expressions and equivalence classes) and string collation. +.TP +.B LC_CTYPE +for regular expression matching, character classification, conversion, +case-sensitive comparison, and wide character functions. +.TP +.B LC_MESSAGES +for localizable natural-language messages. +.TP +.B LC_MONETARY +for monetary formatting. +.TP +.B LC_NUMERIC +for number formatting (such as the decimal point and the thousands separator). +.TP +.B LC_TIME +for time and date formatting. +.PP +The argument +.I locale +is a pointer to a character string containing the +required setting of +.IR category . +Such a string is either a well-known constant like "C" or "da_DK" +(see below), or an opaque string that was returned by another call of +.BR setlocale (). +.PP +If +.I locale +is +.BR """""" , +each part of the locale that should be modified is set according to the +environment variables. +The details are implementation-dependent. +For glibc, first (regardless of +.IR category ), +the environment variable +.B LC_ALL +is inspected, +next the environment variable with the same name as the category +.RB ( LC_COLLATE , +.BR LC_CTYPE , +.BR LC_MESSAGES , +.BR LC_MONETARY , +.BR LC_NUMERIC , +.BR LC_TIME ) +and finally the environment variable +.BR LANG . +The first existing environment variable is used. +If its value is not a valid locale specification, the locale +is unchanged, and +.BR setlocale () +returns NULL. +.PP +The locale +.B """C""" +or +.B """POSIX""" +is a portable locale; its +.B LC_CTYPE +part corresponds to the 7-bit ASCII +character set. +.PP +A locale name is typically of the form +.IR language "[_" territory "][." codeset "][@" modifier "]," +where +.I language +is an ISO 639 language code, +.I territory +is an ISO 3166 country code, and +.I codeset +is a character set or encoding identifier like +.B "ISO-8859-1" +or +.BR "UTF-8" . +For a list of all supported locales, try "locale \-a", cf.\& +.BR locale (1). +.PP +If +.I locale +is NULL, the current locale is only queried, not modified. +.PP +On startup of the main program, the portable +.B """C""" +locale is selected as default. +A program may be made portable to all locales by calling: +.nf + + setlocale(LC_ALL, ""); + +.fi +after program initialization, by using the values returned +from a +.BR localeconv (3) +call +for locale-dependent information, by using the multibyte and wide +character functions for text processing if +.BR "MB_CUR_MAX > 1" , +and by using +.BR strcoll (3), +.BR wcscoll (3) +or +.BR strxfrm (3), +.BR wcsxfrm (3) +to compare strings. +.SH "RETURN VALUE" +A successful call to +.BR setlocale () +returns an opaque string that corresponds to the locale set. +This string may be allocated in static storage. +The string returned is such that a subsequent call with that string +and its associated category will restore that part of the process's +locale. +The return value is NULL if the request cannot be honored. +.SH "CONFORMING TO" +C89, C99, POSIX.1-2001. +.SH NOTES +Linux (that is, glibc) supports the portable locales +.BR """C""" " and " """POSIX""" . +In the good old days there used to be support for +the European Latin-1 +.B """ISO-8859-1""" +locale (e.g., in libc-4.5.21 and libc-4.6.27), and the Russian +.B """KOI-8""" +(more precisely, "koi-8r") locale (e.g., in libc-4.6.27), +so that having an environment variable \fILC_CTYPE=ISO-8859-1\fP +sufficed to make +.BR isprint (3) +return the right answer. +These days non-English speaking Europeans have to work a bit harder, +and must install actual locale files. +.SH "SEE ALSO" +.BR locale (1), +.BR localedef (1), +.BR isalpha (3), +.BR localeconv (3), +.BR nl_langinfo (3), +.BR rpmatch (3), +.BR strcoll (3), +.BR strftime (3), +.BR charsets (7), +.BR locale (7) diff --git a/original/man3/setlogmask.3 b/original/man3/setlogmask.3 new file mode 100644 index 00000000..77d8d16c --- /dev/null +++ b/original/man3/setlogmask.3 @@ -0,0 +1,73 @@ +.\" 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. +.\" +.TH SETLOGMASK 3 2001-10-05 "" "Linux Programmer's Manual" +.SH NAME +setlogmask \- set log priority mask +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int setlogmask(int " mask ); +.fi +.SH DESCRIPTION +A process has a log priority mask that determines which calls to +.BR syslog (3) +may be logged. +All other calls will be ignored. +Logging is enabled for the priorities that have the corresponding +bit set in +.IR mask . +The initial mask is such that logging is enabled for all priorities. +.LP +The +.BR setlogmask () +function sets this logmask for the calling process, +and returns the previous mask. +If the mask argument is 0, the current logmask is not modified. +.LP +The eight priorities are +.BR LOG_EMERG , +.BR LOG_ALERT , +.BR LOG_CRIT , +.BR LOG_ERR , +.BR LOG_WARNING , +.BR LOG_NOTICE , +.BR LOG_INFO , +and +.BR LOG_DEBUG . +The bit corresponding to a priority \fIp\fP is \fBLOG_MASK\fP(\fIp\fP). +Some systems also provide a macro \fBLOG_UPTO\fP(\fIp\fP) for the mask +of all priorities in the above list up to and including \fIp\fP. +.SH "RETURN VALUE" +This function returns the previous log priority mask. +.SH ERRORS +None. +.\" .SH NOTES +.\" The glibc logmask handling was broken in versions before glibc 2.1.1. +.SH "CONFORMING TO" +POSIX.1-2001. +Note that the description in POSIX.1-2001 is flawed. +.SH "SEE ALSO" +.BR closelog (3), +.BR openlog (3), +.BR syslog (3) diff --git a/original/man3/setmntent.3 b/original/man3/setmntent.3 new file mode 100644 index 00000000..3c2bb35c --- /dev/null +++ b/original/man3/setmntent.3 @@ -0,0 +1 @@ +.so man3/getmntent.3 diff --git a/original/man3/setnetent.3 b/original/man3/setnetent.3 new file mode 100644 index 00000000..70f5670d --- /dev/null +++ b/original/man3/setnetent.3 @@ -0,0 +1 @@ +.so man3/getnetent.3 diff --git a/original/man3/setnetgrent.3 b/original/man3/setnetgrent.3 new file mode 100644 index 00000000..e5ea2dde --- /dev/null +++ b/original/man3/setnetgrent.3 @@ -0,0 +1,105 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" based on glibc infopages +.\" polished - aeb +.TH SETNETGRENT 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +setnetgrent, endnetgrent, getnetgrent, getnetgrent_r, innetgr \- +handle network group entries +.SH SYNOPSIS +.nf +.B #include + +.BI "int setnetgrent(const char *" netgroup ); + +.B "void endnetgrent(void);" + +.BI "int getnetgrent(char **" host ", char **" user ", char **" domain ); + +.BI "int getnetgrent_r(char **" host ", char **" user "," +.BI " char **" domain ", char *" buf ", int " buflen ); + +.BI "int innetgr(const char *" netgroup ", const char *" host "," +.BI " const char *" user ", const char *" domain ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR setnetgrent (), +.BR endnetgrent (), +.BR getnetgrent (), +.BR getnetgrent_r (), +.BR innetgr (): +_BSD_SOURCE || _SVID_SOURCE +.ad b +.SH DESCRIPTION +The +.I netgroup +is a SunOS invention. +A netgroup database is a list of string triples +.RI ( hostname ", " username ", " domainname ) +or other netgroup names. +Any of the elements in a triple can be empty, +which means that anything matches. +The functions described here allow access to the netgroup databases. +The file +.I /etc/nsswitch.conf +defines what database is searched. +.PP +The +.BR setnetgrent () +call defines the netgroup that will be searched by subsequent +.BR getnetgrent () +calls. +The +.BR getnetgrent () +function retrieves the next netgroup entry, and returns pointers in +.IR host , +.IR user , +.IR domain . +A NULL pointer means that the corresponding entry matches any string. +The pointers are valid only as long as there is no call to other +netgroup-related functions. +To avoid this problem you can use the GNU function +.BR getnetgrent_r () +that stores the strings in the supplied buffer. +To free all allocated buffers use +.BR endnetgrent (). +.PP +In most cases you only want to check if the triplet +.RI ( hostname ", " username ", " domainname ) +is a member of a netgroup. +The function +.BR innetgr () +can be used for this without calling the above three functions. +Again, a NULL pointer is a wildcard and matches any string. +The function is thread-safe. +.SH "RETURN VALUE" +These functions return 1 on success and 0 for failure. +.SH FILES +.I /etc/netgroup +.br +.I /etc/nsswitch.conf +.SH CONFORMING TO +These functions are not in POSIX.1-2001, but +.BR setnetgrent (), +.BR endnetgrent (), +.BR getnetgrent (), +and +.BR innetgr () +are available on most Unix systems. +.BR getnetgrent_r () +is not widely available on other systems. +.\" getnetgrent_r() is on Solaris 8 and AIX 5.1, but not the BSDs. +.SH NOTES +In the BSD implementation, +.BR setnetgrent () +returns void. +.SH "SEE ALSO" +.BR sethostent (3), +.BR setprotoent (3), +.BR setservent (3) diff --git a/original/man3/setprotoent.3 b/original/man3/setprotoent.3 new file mode 100644 index 00000000..f8cb4bba --- /dev/null +++ b/original/man3/setprotoent.3 @@ -0,0 +1 @@ +.so man3/getprotoent.3 diff --git a/original/man3/setpwent.3 b/original/man3/setpwent.3 new file mode 100644 index 00000000..f2d121b8 --- /dev/null +++ b/original/man3/setpwent.3 @@ -0,0 +1 @@ +.so man3/getpwent.3 diff --git a/original/man3/setrpcent.3 b/original/man3/setrpcent.3 new file mode 100644 index 00000000..923085e2 --- /dev/null +++ b/original/man3/setrpcent.3 @@ -0,0 +1 @@ +.so man3/getrpcent.3 diff --git a/original/man3/setservent.3 b/original/man3/setservent.3 new file mode 100644 index 00000000..eaafb1c1 --- /dev/null +++ b/original/man3/setservent.3 @@ -0,0 +1 @@ +.so man3/getservent.3 diff --git a/original/man3/setspent.3 b/original/man3/setspent.3 new file mode 100644 index 00000000..142c5a5c --- /dev/null +++ b/original/man3/setspent.3 @@ -0,0 +1 @@ +.so man3/getspnam.3 diff --git a/original/man3/setstate.3 b/original/man3/setstate.3 new file mode 100644 index 00000000..6e34104e --- /dev/null +++ b/original/man3/setstate.3 @@ -0,0 +1 @@ +.so man3/random.3 diff --git a/original/man3/setstate_r.3 b/original/man3/setstate_r.3 new file mode 100644 index 00000000..b01937f4 --- /dev/null +++ b/original/man3/setstate_r.3 @@ -0,0 +1 @@ +.so man3/random_r.3 diff --git a/original/man3/setttyent.3 b/original/man3/setttyent.3 new file mode 100644 index 00000000..1cd11e3d --- /dev/null +++ b/original/man3/setttyent.3 @@ -0,0 +1 @@ +.so man3/getttyent.3 diff --git a/original/man3/setusershell.3 b/original/man3/setusershell.3 new file mode 100644 index 00000000..718ed12e --- /dev/null +++ b/original/man3/setusershell.3 @@ -0,0 +1 @@ +.so man3/getusershell.3 diff --git a/original/man3/setutent.3 b/original/man3/setutent.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/setutent.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/setutxent.3 b/original/man3/setutxent.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/setutxent.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/setvbuf.3 b/original/man3/setvbuf.3 new file mode 100644 index 00000000..dc02d9e8 --- /dev/null +++ b/original/man3/setvbuf.3 @@ -0,0 +1 @@ +.so man3/setbuf.3 diff --git a/original/man3/sgetspent.3 b/original/man3/sgetspent.3 new file mode 100644 index 00000000..142c5a5c --- /dev/null +++ b/original/man3/sgetspent.3 @@ -0,0 +1 @@ +.so man3/getspnam.3 diff --git a/original/man3/sgetspent_r.3 b/original/man3/sgetspent_r.3 new file mode 100644 index 00000000..142c5a5c --- /dev/null +++ b/original/man3/sgetspent_r.3 @@ -0,0 +1 @@ +.so man3/getspnam.3 diff --git a/original/man3/shm_open.3 b/original/man3/shm_open.3 new file mode 100644 index 00000000..0c87c3dd --- /dev/null +++ b/original/man3/shm_open.3 @@ -0,0 +1,279 @@ +.\" 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. +.\" +.\" FIXME . Add an example to this page +.TH SHM_OPEN 3 2009-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +shm_open, shm_unlink \- Create/open or unlink POSIX shared memory objects +.SH SYNOPSIS +.B #include +.br +.BR "#include " " /* For mode constants */" +.br +.BR "#include " " /* For O_* constants */" +.sp +.BI "int shm_open(const char *" name ", int " oflag ", mode_t " mode ); +.sp +.BI "int shm_unlink(const char *" name ); +.sp +Link with \fI\-lrt\fP. +.SH DESCRIPTION +.BR shm_open () +creates and opens a new, or opens an existing, POSIX shared memory object. +A POSIX shared memory object is in effect a handle which can +be used by unrelated processes to +.BR mmap (2) +the same region of shared memory. +The +.BR shm_unlink () +function performs the converse operation, +removing an object previously created by +.BR shm_open (). +.LP +The operation of +.BR shm_open () +is analogous to that of +.BR open (2). +.I name +specifies the shared memory object to be created or opened. +For portable use, +a shared memory object should be identified by a name of the form +.IR /somename ; +that is, a null-terminated string of up to +.BI NAME_MAX +(i.e., 255) characters consisting of an initial slash, +.\" 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. +followed by one or more characters, none of which are slashes. +.\" 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. +.LP +.I oflag +is a bit mask created by ORing together exactly one of +.B O_RDONLY +or +.B O_RDWR +and any of the other flags listed here: +.TP 1.1i +.B O_RDONLY +Open the object for read access. +A shared memory object opened in this way can only be +.BR mmap (2)ed +for read (\fBPROT_READ\fP) access. +.TP +.B O_RDWR +Open the object for read-write access. +.TP +.B O_CREAT +Create the shared memory object if it does not exist. +The user and group ownership of the object are taken +from the corresponding effective IDs of the calling process, +.\" 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) +and the object's +permission bits are set according to the low-order 9 bits of +.IR mode , +except that those bits set in the process file mode +creation mask (see +.BR umask (2)) +are cleared for the new object. +A set of macro constants which can be used to define +.I mode +is listed in +.BR open (2). +(Symbolic definitions of these constants can be obtained by including +.IR .) +.sp +A new shared memory object initially has zero length \(em the size of the +object can be set using +.BR ftruncate (2). +The newly allocated bytes of a shared memory +object are automatically initialized to 0. +.TP +.B O_EXCL +If +.B O_CREAT +was also specified, and a shared memory object with the given +.I name +already exists, return an error. +The check for the existence of the object, and its creation if it +does not exist, are performed atomically. +.TP +.B O_TRUNC +If the shared memory object already exists, truncate it to zero bytes. +.LP +Definitions of these flag values can be obtained by including +.IR . +.LP +On successful completion +.BR shm_open () +returns a new file descriptor referring to the shared memory object. +This file descriptor is guaranteed to be the lowest-numbered file descriptor +not previously opened within the process. +The +.B FD_CLOEXEC +flag (see +.BR fcntl (2)) +is set for the file descriptor. + +The file descriptor is normally used in subsequent calls +to +.BR ftruncate (2) +(for a newly created object) and +.BR mmap (2). +After a call to +.BR mmap (2) +the file descriptor may be closed without affecting the memory mapping. + +The operation +of +.BR shm_unlink () +is analogous to +.BR unlink (2): +it removes a shared memory object name, and, once all processes +have unmapped the object, de-allocates and +destroys the contents of the associated memory region. +After a successful +.BR shm_unlink (), +attempts to +.BR shm_open () +an object with the same +.I name +will fail (unless +.B O_CREAT +was specified, in which case a new, distinct object is created). +.SH "RETURN VALUE" +On success, +.BR shm_open () +returns a nonnegative file descriptor. +On failure, +.BR shm_open () +returns \-1. +.BR shm_unlink () +returns 0 on success, or \-1 on error. +.SH ERRORS +On failure, +.I errno +is set to indicate the cause of the error. +Values which may appear in +.I errno +include the following: +.TP +.B EACCES +Permission to +.BR shm_unlink () +the shared memory object was denied. +.TP +.B EACCES +Permission was denied to +.BR shm_open () +.I name +in the specified +.IR mode , +or +.B O_TRUNC +was specified and the caller does not have write permission on the object. +.TP +.B EEXIST +Both +.B O_CREAT +and +.B O_EXCL +were specified to +.BR shm_open () +and the shared memory object specified by +.I name +already exists. +.TP +.B EINVAL +The +.I name +argument to +.BR shm_open () +was invalid. +.TP +.B EMFILE +The process already has the maximum number of files open. +.TP +.B ENAMETOOLONG +The length of +.I name +exceeds +.BR PATH_MAX . +.TP +.B ENFILE +The limit on the total number of files open on the system has been +reached. +.TP +.B ENOENT +An attempt was made to +.BR shm_open () +a +.I name +that did not exist, and +.B O_CREAT +was not specified. +.TP +.B ENOENT +An attempt was to made to +.BR shm_unlink () +a +.I name +that does not exist. +.SH VERSIONS +These functions are provided in glibc 2.2 and later. +.SH "CONFORMING TO" +POSIX.1-2001. +.LP +POSIX.1-2001 says that the group ownership of a newly created shared +memory object is set to either the calling process's effective group ID +or "a system default group ID". +.SH "NOTES" +.LP +POSIX leaves the behavior of the combination of +.B O_RDONLY +and +.B O_TRUNC +unspecified. +On Linux, this will successfully truncate an existing +shared memory object \(em this may not be so on other Unix systems. +.LP +The POSIX shared memory object implementation on Linux 2.4 makes use +of a dedicated file system, which is normally +mounted under +.IR /dev/shm . +.SH "SEE ALSO" +.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) diff --git a/original/man3/shm_unlink.3 b/original/man3/shm_unlink.3 new file mode 100644 index 00000000..74f29865 --- /dev/null +++ b/original/man3/shm_unlink.3 @@ -0,0 +1 @@ +.so man3/shm_open.3 diff --git a/original/man3/sigaddset.3 b/original/man3/sigaddset.3 new file mode 100644 index 00000000..c7307810 --- /dev/null +++ b/original/man3/sigaddset.3 @@ -0,0 +1 @@ +.so man3/sigsetops.3 diff --git a/original/man3/sigandset.3 b/original/man3/sigandset.3 new file mode 100644 index 00000000..c7307810 --- /dev/null +++ b/original/man3/sigandset.3 @@ -0,0 +1 @@ +.so man3/sigsetops.3 diff --git a/original/man3/sigblock.3 b/original/man3/sigblock.3 new file mode 100644 index 00000000..5582b115 --- /dev/null +++ b/original/man3/sigblock.3 @@ -0,0 +1 @@ +.so man3/sigvec.3 diff --git a/original/man3/sigdelset.3 b/original/man3/sigdelset.3 new file mode 100644 index 00000000..c7307810 --- /dev/null +++ b/original/man3/sigdelset.3 @@ -0,0 +1 @@ +.so man3/sigsetops.3 diff --git a/original/man3/sigemptyset.3 b/original/man3/sigemptyset.3 new file mode 100644 index 00000000..c7307810 --- /dev/null +++ b/original/man3/sigemptyset.3 @@ -0,0 +1 @@ +.so man3/sigsetops.3 diff --git a/original/man3/sigfillset.3 b/original/man3/sigfillset.3 new file mode 100644 index 00000000..c7307810 --- /dev/null +++ b/original/man3/sigfillset.3 @@ -0,0 +1 @@ +.so man3/sigsetops.3 diff --git a/original/man3/siggetmask.3 b/original/man3/siggetmask.3 new file mode 100644 index 00000000..5582b115 --- /dev/null +++ b/original/man3/siggetmask.3 @@ -0,0 +1 @@ +.so man3/sigvec.3 diff --git a/original/man3/sighold.3 b/original/man3/sighold.3 new file mode 100644 index 00000000..c4e1d3ca --- /dev/null +++ b/original/man3/sighold.3 @@ -0,0 +1 @@ +.so man3/sigset.3 diff --git a/original/man3/sigignore.3 b/original/man3/sigignore.3 new file mode 100644 index 00000000..c4e1d3ca --- /dev/null +++ b/original/man3/sigignore.3 @@ -0,0 +1 @@ +.so man3/sigset.3 diff --git a/original/man3/siginterrupt.3 b/original/man3/siginterrupt.3 new file mode 100644 index 00000000..ad8e2733 --- /dev/null +++ b/original/man3/siginterrupt.3 @@ -0,0 +1,86 @@ +.\" 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 Sun Jul 25 10:40:51 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Apr 14 16:20:34 1996 by Andries Brouwer (aeb@cwi.nl) +.TH SIGINTERRUPT 3 2009-03-15 "" "Linux Programmer's Manual" +.SH NAME +siginterrupt \- allow signals to interrupt system calls +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int siginterrupt(int " sig ", int " flag ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR siginterrupt (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +The +.BR siginterrupt () +function changes the restart behavior when +a system call is interrupted by the signal \fIsig\fP. +If the \fIflag\fP +argument is false (0), then system calls will be restarted if interrupted +by the specified signal \fIsig\fP. +This is the default behavior in Linux. +However, when a new signal handler is specified with the +.BR signal (2) +function, the system call is interrupted by default. +.PP +If the \fIflag\fP argument is true (1) and no data has been transferred, +then a system call interrupted by the signal \fIsig\fP will return \-1 +and \fIerrno\fP will be set to +.BR EINTR . +.PP +If the \fIflag\fP argument is true (1) and data transfer has started, +then the system call will be interrupted and will return the actual +amount of data transferred. +.SH "RETURN VALUE" +The +.BR siginterrupt () +function returns 0 on success, or \-1 if the +signal number \fIsig\fP is invalid. +.SH ERRORS +.TP +.B EINVAL +The specified signal number is invalid. +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +POSIX.1-2008 marks +.BR siginterrupt () +as obsolete, recommending the use of +.BR sigaction (2) +with the +.B SA_RESTART +flag instead. +.SH "SEE ALSO" +.BR signal (2) diff --git a/original/man3/sigisemptyset.3 b/original/man3/sigisemptyset.3 new file mode 100644 index 00000000..c7307810 --- /dev/null +++ b/original/man3/sigisemptyset.3 @@ -0,0 +1 @@ +.so man3/sigsetops.3 diff --git a/original/man3/sigismember.3 b/original/man3/sigismember.3 new file mode 100644 index 00000000..c7307810 --- /dev/null +++ b/original/man3/sigismember.3 @@ -0,0 +1 @@ +.so man3/sigsetops.3 diff --git a/original/man3/siglongjmp.3 b/original/man3/siglongjmp.3 new file mode 100644 index 00000000..183a7604 --- /dev/null +++ b/original/man3/siglongjmp.3 @@ -0,0 +1 @@ +.so man3/longjmp.3 diff --git a/original/man3/sigmask.3 b/original/man3/sigmask.3 new file mode 100644 index 00000000..5582b115 --- /dev/null +++ b/original/man3/sigmask.3 @@ -0,0 +1 @@ +.so man3/sigvec.3 diff --git a/original/man3/signbit.3 b/original/man3/signbit.3 new file mode 100644 index 00000000..a3de8c3b --- /dev/null +++ b/original/man3/signbit.3 @@ -0,0 +1,56 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" Distributed under GPL +.\" Based on glibc infopages, copyright Free Software Foundation +.TH SIGNBIT 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.SH NAME +signbit \- test sign of a real floating-point number +.SH SYNOPSIS +.B "#include " +.sp +.BI "int signbit(" x ");" +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR signbit (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +.BR signbit () +is a generic macro which can work on all real floating-point types. +It returns a nonzero value if the value of +.I x +has its sign bit set. +.PP +This is not the same as +.IR "x < 0.0" , +because IEEE 754 floating point allows zero to be signed. +The comparison +.IR "-0.0 < 0.0" +is false, but +.IR "signbit(\-0.0)" +will return a nonzero value. + +NaNs and infinities have a sign bit. +.SH RETURN VALUE +The +.BR signbit () +macro returns nonzero if the sign of +.I x +is negative; otherwise it returns zero. +.SH ERRORS +No errors occur. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +This function is defined in IEC 559 (and the appendix with +recommended functions in IEEE 754/IEEE 854). +.SH "SEE ALSO" +.BR copysign (3) diff --git a/original/man3/signgam.3 b/original/man3/signgam.3 new file mode 100644 index 00000000..be0ed98e --- /dev/null +++ b/original/man3/signgam.3 @@ -0,0 +1 @@ +.so man3/lgamma.3 diff --git a/original/man3/significand.3 b/original/man3/significand.3 new file mode 100644 index 00000000..1f56dc4c --- /dev/null +++ b/original/man3/significand.3 @@ -0,0 +1,52 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" heavily based on glibc infopages, copyright Free Software Foundation +.TH SIGNIFICAND 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH NAME +significand, significandf, significandl \- +get mantissa of floating-point number +.SH SYNOPSIS +.B #include +.sp +.BI "double significand(double " x ); +.br +.BI "float significandf(float " x ); +.br +.BI "long double significandl(long double " x ); +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR significand (), +.BR significandf (), +.BR significandl (): +_SVID_SOURCE || _BSD_SOURCE +.ad b +.SH DESCRIPTION +The +.BR significand () +function returns the mantissa of +.I x +scaled to the range [1,2). +It is equivalent to +.sp +.in +4n +scalb(x, (double) \-ilogb(x)) +.in +.PP +This function exists mainly for use in certain standardized tests +for IEEE 754 conformance. +.SH CONFORMING TO +These functions are nonstandard; the +.I double +version is available on a number of other systems. +.\" .SH HISTORY +.\" This function came from BSD. +.SH "SEE ALSO" +.BR ilogb (3), +.BR scalb (3) diff --git a/original/man3/significandf.3 b/original/man3/significandf.3 new file mode 100644 index 00000000..4ae39f58 --- /dev/null +++ b/original/man3/significandf.3 @@ -0,0 +1 @@ +.so man3/significand.3 diff --git a/original/man3/significandl.3 b/original/man3/significandl.3 new file mode 100644 index 00000000..4ae39f58 --- /dev/null +++ b/original/man3/significandl.3 @@ -0,0 +1 @@ +.so man3/significand.3 diff --git a/original/man3/sigorset.3 b/original/man3/sigorset.3 new file mode 100644 index 00000000..c7307810 --- /dev/null +++ b/original/man3/sigorset.3 @@ -0,0 +1 @@ +.so man3/sigsetops.3 diff --git a/original/man3/sigpause.3 b/original/man3/sigpause.3 new file mode 100644 index 00000000..29a0dcc2 --- /dev/null +++ b/original/man3/sigpause.3 @@ -0,0 +1,105 @@ +.\" Copyright (C) 2004 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. +.\" +.TH SIGPAUSE 3 2005-12-01 "Linux" "Linux Programmer's Manual" +.SH NAME +sigpause \- atomically release blocked signals and wait for interrupt +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int sigpause(int " sigmask "); /* BSD */" +.sp +.BI "int sigpause(int " sig "); /* System V / Unix95 */" +.fi +.SH DESCRIPTION +Don't use this function. +Use +.BR sigsuspend (2) +instead. +.LP +The function +.BR sigpause () +is designed to wait for some signal. +It changes the process's signal mask (set of blocked signals), +and then waits for a signal to arrive. +Upon arrival of a signal, the original signal mask is restored. +.SH "RETURN VALUE" +If +.BR sigpause () +returns, it was interrupted by a signal and the return value is \-1 +with +.I errno +set to +.BR EINTR . +.SH CONFORMING TO +The System V version of +.BR sigpause () +is standardized in POSIX.1-2001. +.SH NOTES +.SS History +The classical BSD version of this function appeared in 4.2BSD. +It sets the process's signal mask to +.IR sigmask . +Unix95 standardized the incompatible System V version of +this function, which removes only the specified signal +.I sig +from the process's signal mask. +.\" __xpg_sigpause: Unix 95, spec 1170, SVID, SVr4, XPG +The unfortunate situation with two incompatible functions with the +same name was solved by the +.BR \%sigsuspend (2) +function, that takes a +.I "sigset_t *" +argument (instead of an +.IR int ). +.SS Linux Notes +On Linux, this routine is a system call only on the Sparc (sparc64) +architecture. + +Libc4 and libc5 only know about the BSD version. + +Glibc uses the BSD version if the +.B _BSD_SOURCE +feature test macro is defined and none of +.BR _POSIX_SOURCE , +.BR _POSIX_C_SOURCE , +.BR _XOPEN_SOURCE , +.BR _GNU_SOURCE , +or +.B _SVID_SOURCE +is defined. +The System V version is used if +.B _XOPEN_SOURCE +is defined. +.\" +.\" For the BSD version, one usually uses a zero +.\" .I sigmask +.\" to indicate that no signals are to be blocked. +.SH "SEE ALSO" +.BR kill (2), +.BR sigaction (2), +.BR sigprocmask (2), +.BR sigsuspend (2), +.BR sigblock (3), +.BR sigvec (3), +.BR feature_test_macros (7) diff --git a/original/man3/sigrelse.3 b/original/man3/sigrelse.3 new file mode 100644 index 00000000..c4e1d3ca --- /dev/null +++ b/original/man3/sigrelse.3 @@ -0,0 +1 @@ +.so man3/sigset.3 diff --git a/original/man3/sigset.3 b/original/man3/sigset.3 new file mode 100644 index 00000000..bba080cc --- /dev/null +++ b/original/man3/sigset.3 @@ -0,0 +1,259 @@ +'\" t +.\" Copyright (c) 2005 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. +.\" +.TH SIGSET 3 2009-03-15 "Linux" "Linux Programmer's Manual" +.SH NAME +sigset, sighold, sigrelse, sigignore \- System V signal API +.SH SYNOPSIS +.B #define _XOPEN_SOURCE 500 +.br +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "sighandler_t sigset(int " sig ", sighandler_t " disp ); +.sp +.BI "int sighold(int " sig ); +.sp +.BI "int sigrelse(int " sig ); +.sp +.BI "int sigignore(int " sig ); +.SH DESCRIPTION +These functions are provided in glibc as a compatibility interface +for programs that make use of the historical System V signal API. +This API is obsolete: new applications should use the POSIX signal API +.RB ( sigaction (2), +.BR sigprocmask (2), +etc.) + +The +.BR sigset () +function modifies the disposition of the signal +.IR sig . +The +.I disp +argument can be the address of a signal handler function, +or one of the following constants: +.TP +.B SIG_DFL +Reset the disposition of +.I sig +to the default. +.TP +.B SIG_IGN +Ignore +.IR sig . +.TP +.B SIG_HOLD +Add +.I sig +to the process's signal mask, but leave the disposition of +.I sig +unchanged. +.PP +If +.I disp +specifies the address of a signal handler, then +.I sig +is added to the process's signal mask during execution of the handler. +.PP +If +.I disp +was specified as a value other than +.BR SIG_HOLD , +then +.I sig +is removed from the process's signal mask. +.PP +The dispositions for +.B SIGKILL +and +.B SIGSTOP +cannot be changed. +.PP +The +.BR sighold () +function adds +.I sig +to the calling process's signal mask. + +The +.BR sigrelse () +function removes +.I sig +from the calling process's signal mask. + +The +.BR sigignore () +function sets the disposition of +.I sig +to +.BR SIG_IGN . +.SH RETURN VALUE +On success, +.BR sigset () +returns +.B SIG_HOLD +if +.I sig +was blocked before the call, +or the signal's previous disposition +if it was not blocked before the call. +On error, +.BR sigset () +returns \-1, with +.I errno +set to indicate the error. +(But see BUGS below.) + +The +.BR sighold (), +.BR sigrelse (), +and +.BR sigignore () +functions return 0 on success; on error, these functions return \-1 and set +.I errno +to indicate the error. +.SH ERRORS +For +.BR sigset () +see the ERRORS under +.BR sigaction (2) +and +.BR sigprocmask (2). + +For +.BR sighold () +and +.BR sigrelse () +see the ERRORS under +.BR sigprocmask (2). + +For +.BR sigignore (), +see the errors under +.BR sigaction (2). +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +These functions are obsolete: do not use them in new programs. +POSIX.1-2008 marks +.BR sighold (), +.BR sigignore (), +.BR sigpause (), +.BR sigrelse (), +and +.BR sigset () +as obsolete, recommending the use of +.BR sigaction (2), +.BR sigprocmask (2), +.BR pthread_sigmask (3), +and +.BR sigsuspend (2) +instead. +.SH NOTES +These functions appeared in glibc version 2.1. + +The +.I sighandler_t +type is a GNU extension; it is only used on this page to make the +.BR sigset () +prototype more easily readable. + +The +.BR sigset () +function provides reliable signal handling semantics (as when calling +.BR sigaction (2) +with +.I sa_mask +equal to 0). + +On System V, the +.BR signal () +function provides unreliable semantics (as when calling +.BR sigaction (2) +with +.I sa_mask +equal to +.IR "SA_RESETHAND | SA_NODEFER" ). +On BSD, +.BR signal () +provides reliable semantics. +POSIX.1-2001 leaves these aspects of +.BR signal () +unspecified. +See +.BR signal (2) +for further details. + +In order to wait for a signal, +BSD and System V both provided a function named +.BR sigpause (3), +but this function has a different argument on the two systems. +See +.BR sigpause (3) +for details. +.SH BUGS +In versions of glibc before 2.2, +.BR sigset () +did not unblock +.I sig +if +.I disp +was specified as a value other than +.BR SIG_HOLD . + +In versions of glibc before 2.5, +.BR sigset () +does not correctly return the previous disposition of the signal +in two cases. +First, if +.I disp +is specified as +.BR SIG_HOLD , +then a successful +.BR sigset () +always returns +.BR SIG_HOLD . +Instead, it should return the previous disposition of the signal +(unless the signal was blocked, in which case +.B SIG_HOLD +should be returned). +Second, if the signal is currently blocked, then +the return value of a successful +.BR sigset () +should be +.BR SIG_HOLD . +Instead, the previous disposition of the signal is returned. +These problems have been fixed since glibc 2.5. +.\" See http://sourceware.org/bugzilla/show_bug.cgi?id=1951 +.SH "SEE ALSO" +.BR kill (2), +.BR pause (2), +.BR sigaction (2), +.BR signal (2), +.BR sigprocmask (2), +.BR raise (3), +.BR sigpause (3), +.BR sigvec (3), +.BR feature_test_macros (7), +.BR signal (7) diff --git a/original/man3/sigsetjmp.3 b/original/man3/sigsetjmp.3 new file mode 100644 index 00000000..7cf497fc --- /dev/null +++ b/original/man3/sigsetjmp.3 @@ -0,0 +1 @@ +.so man3/setjmp.3 diff --git a/original/man3/sigsetmask.3 b/original/man3/sigsetmask.3 new file mode 100644 index 00000000..5582b115 --- /dev/null +++ b/original/man3/sigsetmask.3 @@ -0,0 +1 @@ +.so man3/sigvec.3 diff --git a/original/man3/sigsetops.3 b/original/man3/sigsetops.3 new file mode 100644 index 00000000..a24b4e3e --- /dev/null +++ b/original/man3/sigsetops.3 @@ -0,0 +1,168 @@ +.\" Copyright (c) 1994 Mike Battersby +.\" +.\" 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 aeb, 960721 +.\" 2005-11-21, mtk, added descriptions of sigisemptyset(), sigandset(), +.\" and sigorset() +.\" 2007-10-26 mdw added wording that a sigset_t must be initialized +.\" prior to use +.\" +.TH SIGSETOPS 3 2008-09-01 "Linux" "Linux Programmer's Manual" +.SH NAME +sigemptyset, sigfillset, sigaddset, sigdelset, sigismember \- POSIX +signal set operations. +.SH SYNOPSIS +.B #include +.sp +.BI "int sigemptyset(sigset_t *" set ); +.sp +.BI "int sigfillset(sigset_t *" set ); +.sp +.BI "int sigaddset(sigset_t *" set ", int " signum ); +.sp +.BI "int sigdelset(sigset_t *" set ", int " signum ); +.sp +.BI "int sigismember(const sigset_t *" set ", int " signum ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR sigemptyset (), +.BR sigfillset (), +.BR sigaddset (), +.BR sigdelset (), +.BR sigismember (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +These functions allow the manipulation of POSIX signal sets. +.PP +.BR sigemptyset () +initializes the signal set given by +.I set +to empty, with all signals excluded from the set. +.PP +.BR sigfillset () +initializes +.I set +to full, including all signals. +.PP +.BR sigaddset () +and +.BR sigdelset () +add and delete respectively signal +.I signum +from +.IR set . +.PP +.BR sigismember () +tests whether +.I signum +is a member of +.IR set . +.PP +Objects of type +.I sigset_t +must be initialized by a call to either +.BR sigemptyset () +or +.BR sigfillset () +before being passed to the functions +.BR sigaddset (), +.BR sigdelset () +and +.BR sigismember () +or the additional glibc functions described below +.RB ( sigisemptyset (), +.BR sigandset (), +and +.BR sigorset ()). +The results are undefined if this is not done. +.SH "RETURN VALUE" +.BR sigemptyset (), +.BR sigfillset (), +.BR sigaddset (), +and +.BR sigdelset () +return 0 on success and \-1 on error. +.PP +.BR sigismember () +returns 1 if +.I signum +is a member of +.IR set , +0 if +.I signum +is not a member, and \-1 on error. +.SH ERRORS +.TP +.B EINVAL +.I sig +is not a valid signal. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +.SS Glibc Notes +If the +.B _GNU_SOURCE +feature test macro is defined, then \fI\fP +exposes three other functions for manipulating signal +sets. +.TP +.BI "int sigisemptyset(sigset_t *" set ); +returns 1 if +.I set +contains no signals, and 0 otherwise. +.TP +.BI "int sigorset(sigset_t *" dest ", sigset_t *" left \ +", sigset_t *" right ); +places the union of the sets +.I left +and +.I right +in +.IR dest . +.TP +.BI "int sigandset(sigset_t *" dest ", sigset_t *" left \ +", sigset_t *" right ); +places the intersection of the sets +.I left +and +.I right +in +.IR dest . +.PP +.BR sigorset () +and +.BR sigandset () +return 0 on success, and \-1 on failure. +.PP +These functions are nonstandard (a few other systems provide similar +functions) and their use should be avoided in portable applications. +.SH "SEE ALSO" +.BR sigaction (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigsuspend (2) diff --git a/original/man3/sigvec.3 b/original/man3/sigvec.3 new file mode 100644 index 00000000..ee4b2a63 --- /dev/null +++ b/original/man3/sigvec.3 @@ -0,0 +1,259 @@ +'\" t +.\" Copyright (c) 2005 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. +.\" +.TH SIGVEC 3 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +sigvec, sigblock, sigsetmask, siggetmask, sigmask \- BSD signal API +.SH SYNOPSIS +.B #include +.sp +.BI "int sigvec(int " sig ", struct sigvec *" vec ", struct sigvec *" ovec ); +.sp +.BI "int sigmask(int " signum ); +.sp +.BI "int sigblock(int " mask ); +.sp +.BI "int sigsetmask(int " mask ); +.sp +.B int siggetmask(void); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +All functions shown above: +_BSD_SOURCE +.SH DESCRIPTION +These functions are provided in glibc as a compatibility interface +for programs that make use of the historical BSD signal API. +This API is obsolete: new applications should use the POSIX signal API +.RB ( sigaction (2), +.BR sigprocmask (2), +etc.) + +The +.BR sigvec () +function sets and/or gets the disposition of the signal +.I sig +(like the POSIX +.BR sigaction (2)). +If +.I vec +is not NULL, it points to a +.I sigvec +structure that defines the new disposition for +.IR sig . +If +.I ovec +is not NULL, it points to a +.I sigvec +structure that is used to return the previous disposition of +.IR sig . +To obtain the current disposition of +.I sig +without changing it, specify NULL for +.IR vec , +and a non-NULL pointer for +.IR ovec . + +The dispositions for +.B SIGKILL +and +.B SIGSTOP +cannot be changed. + +The +.I sigvec +structure has the following form: +.in +4n +.nf + +struct sigvec { + void (*sv_handler)(); /* Signal disposition */ + int sv_mask; /* Signals to be blocked in handler */ + int sv_flags; /* Flags */ +}; + +.fi +.in +The +.I sv_handler +field specifies the disposition of the signal, and is either: +the address of a signal handler function; or +.B SIG_DFL +meaning the default disposition applies for the signal; or +.B SIG_IGN +meaning that the signal is ignored. + +If +.I sv_handler +specifies the address of a signal handler, then +.I sv_mask +specifies a mask of signals that are to be blocked while +the handler is executing. +In addition, the signal for which the handler is invoked is +also blocked by default. +Attempts to block +.B SIGKILL +or +.B SIGSTOP +are silently ignored. + +If +.I sv_handler +specifies the address of a signal handler, then the +.I sv_flags +field specifies flags controlling what happens when the handler is called. +This field may contain zero or more of the following flags: +.TP +.B SV_INTERRUPT +If the signal handler interrupts a blocking system call, +then upon return from the handler the system call will not be restarted: +instead it will fail with the error +.BR EINTR . +If this flag is not specified, then system calls are restarted +by default. +.TP +.B SV_RESETHAND +Reset the disposition of the signal to the default +before calling the signal handler. +If this flag is not specified, then the handler remains established +until explicitly removed by a later call to +.BR sigvec () +or until the process performs an +.BR execve (2). +.TP +.B SV_ONSTACK +Handle the signal on the alternate signal stack +(historically established under BSD using the obsolete +.BR sigstack () +function; the POSIX replacement is +.BR sigaltstack (2)). +.PP +The +.BR sigmask () +function constructs and returns a "signal mask" for +.IR signum . +For example, we can initialize the +.I vec.sv_mask +field given to +.BR sigvec () +using code such as the following: +.nf + + vec.sv_mask = sigmask(SIGQUIT) | sigpause(SIGABRT); + /* Block SIGQUIT and SIGABRT during + handler execution */ +.fi +.PP +The +.BR sigblock () +function adds the signals in +.I mask +to the process's signal mask +(like POSIX +.IR sigprocmask(SIG_BLOCK) ), +and returns the process's previous signal mask. +Attempts to block +.B SIGKILL +or +.B SIGSTOP +are silently ignored. +.PP +The +.BR sigsetmask () +function sets the process's signal mask to the value given in +.I mask +(like POSIX +.IR sigprocmask(SIG_SETMASK) ), +and returns the process's previous signal mask. +.PP +The +.BR siggetmask () +function returns the process's current signal mask. +This call is equivalent to +.IR sigblock(0) . +.SH RETURN VALUE +The +.BR sigvec () +function returns 0 on success; on error, it returns \-1 and sets +.I errno +to indicate the error. + +The +.BR sigblock () +and +.BR sigsetmask () +functions return the previous signal mask. + +The +.BR sigmask () +function returns the signal mask for +.IR signum . +.SH ERRORS +See the ERRORS under +.BR sigaction (2) +and +.BR sigprocmask (2). +.SH "CONFORMING TO" +All of these functions were in +4.3BSD, except +.BR siggetmask (), +whose origin is unclear. +These functions are obsolete: do not use them in new programs. +.SH NOTES +On 4.3BSD, the +.BR signal () +function provided reliable semantics (as when calling +.BR sigvec () +with +.I vec.sv_mask +equal to 0). +On System V, +.BR signal () +provides unreliable semantics. +POSIX.1-2001 leaves these aspects of +.BR signal () +unspecified. +See +.BR signal (2) +for further details. + +In order to wait for a signal, +BSD and System V both provided a function named +.BR sigpause (3), +but this function has a different argument on the two systems. +See +.BR sigpause (3) +for details. +.SH "SEE ALSO" +.BR kill (2), +.BR pause (2), +.BR sigaction (2), +.BR signal (2), +.BR sigprocmask (2), +.BR raise (3), +.BR sigpause (3), +.BR sigset (3), +.BR signal (7) diff --git a/original/man3/sigwait.3 b/original/man3/sigwait.3 new file mode 100644 index 00000000..b7da0e58 --- /dev/null +++ b/original/man3/sigwait.3 @@ -0,0 +1,93 @@ +.\" 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. +.\" +.TH SIGWAIT 3 2009-02-10 "Linux" "Linux Programmer's Manual" +.SH NAME +sigwait \- wait for a signal +.SH SYNOPSIS +.nf +.B #include + +.BI " int sigwait(const sigset_t *" set ", int *" sig ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR sigwait (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +The +.BR sigwait () +function suspends execution of the calling thread until the +delivery of one of the signals specified in the signal set +.IR set . +The function accepts the signal +(removes it from the pending list of signals), +and returns the signal number in +.IR sig . + +The operation of +.BR sigwait () +is the same as +.BR sigwaitinfo (), +except that: +.IP * 2 +.BR sigwait () +only returns the signal number, rather than a +.I siginfo_t +structure describing the signal. +.IP * +The return values of the two functions are different. +.SH RETURN VALUE +On success, +.BR sigwait () +returns 0. +On error, it returns a positive error number. +.SH ERRORS +.TP +.B EINVAL +.\" Does not occur for glibc. +.I set +contains an invalid signal number. +.SH CONFORMING TO +POSIX.1-2001. +.SH NOTES +.BR sigwait () +is implemented using +.BR sigtimedwait (2). +.SH EXAMPLES +See +.BR pthread_sigmask (3). +.SH SEE ALSO +.BR sigaction (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigsuspend (2), +.BR sigwaitinfo (2), +.BR sigsetops (3), +.BR signal (7) diff --git a/original/man3/sin.3 b/original/man3/sin.3 new file mode 100644 index 00000000..9f0d1e95 --- /dev/null +++ b/original/man3/sin.3 @@ -0,0 +1,114 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.TH SIN 3 2009-02-04 "" "Linux Programmer's Manual" +.SH NAME +sin, sinf, sinl \- sine function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double sin(double " x ); +.br +.BI "float sinf(float " x ); +.br +.BI "long double sinl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR sinf (), +.BR sinl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR sin () +function returns the sine of \fIx\fP, where \fIx\fP is +given in radians. +.SH RETURN VALUE +On success, these functions return the sine of +.IR x . + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is positive infinity or negative infinity, +a domain error occurs, +and a NaN is returned. +.\" +.\" POSIX.1 allows an optional range error for subnormal x +.\" glibc 2.8 doesn't do this +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is an infinity +.\" .I errno +.\" is set to +.\" .BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.PP +These functions do not set +.IR errno . +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6781 +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR acos (3), +.BR asin (3), +.BR atan (3), +.BR atan2 (3), +.BR cos (3), +.BR csin (3), +.BR sincos (3), +.BR tan (3) diff --git a/original/man3/sincos.3 b/original/man3/sincos.3 new file mode 100644 index 00000000..bde90d82 --- /dev/null +++ b/original/man3/sincos.3 @@ -0,0 +1,78 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL, 2002-07-27 Walter Harms +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" +.TH SINCOS 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH NAME +sincos, sincosf, sincosl \- calculate sin and cos simultaneously +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "void sincos(double " x ", double *" sin ", double *" cos ); +.br +.BI "void sincosf(float " x ", float *" sin ", float *" cos ); +.br +.BI "void sincosl(long double " x ", long double *" sin ", long double *" cos ); +.fi +.sp +Link with \fI\-lm\fP. +.SH DESCRIPTION +Several applications need sine and cosine of the same angle +.IR x . +This function computes both at the same time, and stores the results in +.I *sin +and +.IR *cos . + +If +.I x +is a NaN, +a NaN is returned in +.I *sin +and +.IR *cos . + +If +.I x +is positive infinity or negative infinity, +a domain error occurs, and +a NaN is returned in +.I *sin +and +.IR *cos . +.SH RETURN VALUE +These functions return +.IR void . +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is an infinity +.\" .I errno +.\" is set to +.\" .BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.PP +These functions do not set +.IR 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. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +This function is a GNU extension. +.SH "SEE ALSO" +.BR cos (3), +.BR sin (3), +.BR tan (3), +.BR feature_test_macros (7) diff --git a/original/man3/sincosf.3 b/original/man3/sincosf.3 new file mode 100644 index 00000000..9faef654 --- /dev/null +++ b/original/man3/sincosf.3 @@ -0,0 +1 @@ +.so man3/sincos.3 diff --git a/original/man3/sincosl.3 b/original/man3/sincosl.3 new file mode 100644 index 00000000..9faef654 --- /dev/null +++ b/original/man3/sincosl.3 @@ -0,0 +1 @@ +.so man3/sincos.3 diff --git a/original/man3/sinf.3 b/original/man3/sinf.3 new file mode 100644 index 00000000..eab51f4a --- /dev/null +++ b/original/man3/sinf.3 @@ -0,0 +1 @@ +.so man3/sin.3 diff --git a/original/man3/sinh.3 b/original/man3/sinh.3 new file mode 100644 index 00000000..6e81e65d --- /dev/null +++ b/original/man3/sinh.3 @@ -0,0 +1,127 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" 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) +.\" +.TH SINH 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +sinh, sinhf, sinhl \- hyperbolic sine function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double sinh(double " x ); +.br +.BI "float sinhf(float " x ); +.br +.BI "long double sinhl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR sinhf (), +.BR sinhl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR sinh () +function returns the hyperbolic sine of \fIx\fP, which +is defined mathematically as: +.nf + + sinh(x) = (exp(x) \- exp(\-x)) / 2 +.fi +.SH "RETURN VALUE" +On success, these functions return the hyperbolic sine of +.IR x . + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is +0 (\-0), +0 (\-0) is returned. + +If +.I x +is positive infinity (negative infinity), +positive infinity (negative infinity) is returned. + +If the result overflows, +a range error occurs, +and the functions return +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +respectively, with the same sign as +.IR x . +.\" +.\" POSIX.1-2001 documents an optional range error (underflow) +.\" for subnormal x; +.\" glibc 2.8 does not do this. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Range error: result overflow +.I errno +is set to +.BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR acosh (3), +.BR asinh (3), +.BR atanh (3), +.BR cosh (3), +.BR csinh (3), +.BR tanh (3) diff --git a/original/man3/sinhf.3 b/original/man3/sinhf.3 new file mode 100644 index 00000000..dc3ce941 --- /dev/null +++ b/original/man3/sinhf.3 @@ -0,0 +1 @@ +.so man3/sinh.3 diff --git a/original/man3/sinhl.3 b/original/man3/sinhl.3 new file mode 100644 index 00000000..dc3ce941 --- /dev/null +++ b/original/man3/sinhl.3 @@ -0,0 +1 @@ +.so man3/sinh.3 diff --git a/original/man3/sinl.3 b/original/man3/sinl.3 new file mode 100644 index 00000000..eab51f4a --- /dev/null +++ b/original/man3/sinl.3 @@ -0,0 +1 @@ +.so man3/sin.3 diff --git a/original/man3/sleep.3 b/original/man3/sleep.3 new file mode 100644 index 00000000..12bc0c5c --- /dev/null +++ b/original/man3/sleep.3 @@ -0,0 +1,63 @@ +.\" 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 18:16:02 1993 by Rik Faith (faith@cs.unc.edu) +.TH SLEEP 3 2010-02-03 "GNU" "Linux Programmer's Manual" +.SH NAME +sleep \- Sleep for the specified number of seconds +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "unsigned int sleep(unsigned int " "seconds" ); +.fi +.SH DESCRIPTION +.BR sleep () +makes the calling thread sleep until +.I seconds +seconds have elapsed or a signal arrives which is not ignored. +.SH "RETURN VALUE" +Zero if the requested time has elapsed, +or the number of seconds left to sleep, +if the call was interrupted by a signal handler. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH BUGS +.BR sleep () +may be implemented using +.BR SIGALRM ; +mixing calls to +.BR alarm (2) +and +.BR sleep () +is a bad idea. +.PP +Using +.BR longjmp (3) +from a signal handler or modifying the handling of +.B SIGALRM +while sleeping will cause undefined results. +.SH "SEE ALSO" +.BR alarm (2), +.BR nanosleep (2), +.BR signal (2), +.BR signal (7) diff --git a/original/man3/snprintf.3 b/original/man3/snprintf.3 new file mode 100644 index 00000000..975530d9 --- /dev/null +++ b/original/man3/snprintf.3 @@ -0,0 +1 @@ +.so man3/printf.3 diff --git a/original/man3/sockatmark.3 b/original/man3/sockatmark.3 new file mode 100644 index 00000000..f0b2efea --- /dev/null +++ b/original/man3/sockatmark.3 @@ -0,0 +1,134 @@ +.\" Copyright (c) 2006, Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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. +.\" +.TH SOCKATMARK 3 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH NAME +sockatmark \- determine whether socket is at out-of-band mark +.SH SYNOPSIS +.B #include +.sp +.BI "int sockatmark(int " sockfd ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR sockatmark (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH DESCRIPTION +.BR sockatmark () +returns a value indicating whether or not the socket referred +to by the file descriptor +.I sockfd +is at the out-of-band mark. +If the socket is at the mark, then 1 is returned; +if the socket is not at the mark, 0 is returned. +This function does not remove the out-of-band mark. +.SH "RETURN VALUE" +A successful call to +.BR sockatmark () +returns 1 if the socket is at the out-of-band mark, or 0 if it is not. +On error, \-1 is returned and \fIerrno\fP is set to indicate the error. +.SH ERRORS +.TP +.B EBADF +.I sockfd +is not a valid file descriptor. +.TP +.B EINVAL +.\" POSIX.1 says ENOTTY for this case +.I sockfd +is not a file descriptor to which +.BR sockatmark () +can be applied. +.SH VERSIONS +.BR sockatmark () +was added to glibc in version 2.2.4. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +If +.BR sockatmark () +returns 1, then the out-of-band data can be read using the +.B MSG_OOB +flag of +.BR recv (2). + +Out-of-band data is only supported on some stream socket protocols. + +.BR sockatmark () +can safely be called from a handler for the +.B SIGURG +signal. + +.BR sockatmark () +is implemented using the +.B SIOCATMARK +.BR ioctl (2) +operation. +.SH BUGS +Prior to glibc 2.4, +.BR sockatmark () +did not work. +.SH EXAMPLE +The following code can be used after receipt of a +.B SIGURG +signal to read (and discard) all data up to the mark, +and then read the byte of data at the mark: +.nf + + char buf[BUF_LEN]; + char oobdata; + int atmark, s; + + for (;;) { + atmark = sockatmark(sockfd); + if (atmark == \-1) { + perror("sockatmark"); + break; + } + + if (atmark) + break; + + s = read(sockfd, buf, BUF_LEN) <= 0); + if (s == \-1) + perror("read"); + if (s <= 0) + break; + } + + if (atmark == 1) { + if (recv(sockfd, &oobdata, 1, MSG_OOB) == \-1) { + perror("recv"); + ... + } + } +.fi +.SH "SEE ALSO" +.BR fcntl (2), +.BR recv (2), +.BR send (2), +.BR tcp (7) diff --git a/original/man3/sprintf.3 b/original/man3/sprintf.3 new file mode 100644 index 00000000..975530d9 --- /dev/null +++ b/original/man3/sprintf.3 @@ -0,0 +1 @@ +.so man3/printf.3 diff --git a/original/man3/sqrt.3 b/original/man3/sqrt.3 new file mode 100644 index 00000000..95723c8c --- /dev/null +++ b/original/man3/sqrt.3 @@ -0,0 +1,108 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.TH SQRT 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +sqrt, sqrtf, sqrtl \- square root function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double sqrt(double " x ); +.br +.BI "float sqrtf(float " x ); +.br +.BI "long double sqrtl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR sqrtf (), +.BR sqrtl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR sqrt () +function returns the nonnegative square root of \fIx\fP. +.SH "RETURN VALUE" +On success, these functions return the square root of +.IR x . + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is +0 (\-0), +0 (\-0) is returned. + +If +.I x +is positive infinity, positive infinity is returned. + +If +.I x +is less than \-0, +a domain error occurs, +and a NaN is returned. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP less than \-0 +.I errno +is set to +.BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR cbrt (3), +.BR csqrt (3), +.BR hypot (3) diff --git a/original/man3/sqrtf.3 b/original/man3/sqrtf.3 new file mode 100644 index 00000000..81258bbc --- /dev/null +++ b/original/man3/sqrtf.3 @@ -0,0 +1 @@ +.so man3/sqrt.3 diff --git a/original/man3/sqrtl.3 b/original/man3/sqrtl.3 new file mode 100644 index 00000000..81258bbc --- /dev/null +++ b/original/man3/sqrtl.3 @@ -0,0 +1 @@ +.so man3/sqrt.3 diff --git a/original/man3/srand.3 b/original/man3/srand.3 new file mode 100644 index 00000000..b007c2fc --- /dev/null +++ b/original/man3/srand.3 @@ -0,0 +1 @@ +.so man3/rand.3 diff --git a/original/man3/srand48.3 b/original/man3/srand48.3 new file mode 100644 index 00000000..3133f7d6 --- /dev/null +++ b/original/man3/srand48.3 @@ -0,0 +1 @@ +.so man3/drand48.3 diff --git a/original/man3/srand48_r.3 b/original/man3/srand48_r.3 new file mode 100644 index 00000000..81e9d8ef --- /dev/null +++ b/original/man3/srand48_r.3 @@ -0,0 +1 @@ +.so man3/drand48_r.3 diff --git a/original/man3/srandom.3 b/original/man3/srandom.3 new file mode 100644 index 00000000..6e34104e --- /dev/null +++ b/original/man3/srandom.3 @@ -0,0 +1 @@ +.so man3/random.3 diff --git a/original/man3/srandom_r.3 b/original/man3/srandom_r.3 new file mode 100644 index 00000000..b01937f4 --- /dev/null +++ b/original/man3/srandom_r.3 @@ -0,0 +1 @@ +.so man3/random_r.3 diff --git a/original/man3/sscanf.3 b/original/man3/sscanf.3 new file mode 100644 index 00000000..9fd424bb --- /dev/null +++ b/original/man3/sscanf.3 @@ -0,0 +1 @@ +.so man3/scanf.3 diff --git a/original/man3/ssignal.3 b/original/man3/ssignal.3 new file mode 100644 index 00000000..047cab28 --- /dev/null +++ b/original/man3/ssignal.3 @@ -0,0 +1 @@ +.so man3/gsignal.3 diff --git a/original/man3/stdarg.3 b/original/man3/stdarg.3 new file mode 100644 index 00000000..67b4538a --- /dev/null +++ b/original/man3/stdarg.3 @@ -0,0 +1,309 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)stdarg.3 6.8 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:11:11 1993, faith@cs.unc.edu +.\" Additions, 2001-10-14, aeb +.\" +.TH STDARG 3 2001-10-14 "" "Linux Programmer's Manual" +.SH NAME +stdarg, va_start, va_arg, va_end, va_copy \- variable argument lists +.SH SYNOPSIS +.B #include +.sp +.BI "void va_start(va_list " ap ", " last ); +.br +.IB type " va_arg(va_list " ap ", " type ); +.br +.BI "void va_end(va_list " ap ); +.br +.BI "void va_copy(va_list " dest ", va_list " src ); +.SH DESCRIPTION +A function may be called with a varying number of arguments of varying +types. +The include file +.I +declares a type +.I va_list +and defines three macros for stepping through a list of arguments whose +number and types are not known to the called function. +.PP +The called function must declare an object of type +.I va_list +which is used by the macros +.BR va_start (), +.BR va_arg (), +and +.BR va_end (). +.SS va_start() +The +.BR va_start () +macro initializes +.I ap +for subsequent use by +.BR va_arg () +and +.BR va_end (), +and must be called first. +.PP +The argument +.I last +is the name of the last argument before the variable argument list, that is, +the last argument of which the calling function knows the type. +.PP +Because the address of this argument may be used in the +.BR va_start () +macro, it should not be declared as a register variable, +or as a function or an array type. +.SS va_arg() +The +.BR va_arg () +macro expands to an expression that has the type and value of the next +argument in the call. +The argument +.I ap +is the +.I va_list +.I ap +initialized by +.BR va_start (). +Each call to +.BR va_arg () +modifies +.I ap +so that the next call returns the next argument. +The argument +.I type +is a type name specified so that the type of a pointer to an object that +has the specified type can be obtained simply by adding a * to +.IR type . +.PP +The first use of the +.BR va_arg () +macro after that of the +.BR va_start () +macro returns the argument after +.IR last . +Successive invocations return the values of the remaining arguments. +.PP +If there is no next argument, or if +.I type +is not compatible with the type of the actual next argument (as promoted +according to the default argument promotions), random errors will occur. +.PP +If +.I ap +is passed to a function that uses +.BI va_arg( ap , type ) +then the value of +.I ap +is undefined after the return of that function. +.SS va_end() +Each invocation of +.BR va_start () +must be matched by a corresponding invocation of +.BR va_end () +in the same function. +After the call +.BI va_end( ap ) +the variable +.I ap +is undefined. +Multiple traversals of the list, each +bracketed by +.BR va_start () +and +.BR va_end () +are possible. +.BR va_end () +may be a macro or a function. +.SS va_copy() +.\" Proposal from clive@demon.net, 1997-02-28 +An obvious implementation would have a +.I va_list +be a pointer to the stack frame of the variadic function. +In such a setup (by far the most common) there seems +nothing against an assignment +.in +4n +.nf + +va_list aq = ap; + +.fi +.in +Unfortunately, there are also systems that make it an +array of pointers (of length 1), and there one needs +.in +4n +.nf + +va_list aq; +*aq = *ap; + +.fi +.in +Finally, on systems where arguments are passed in registers, +it may be necessary for +.BR va_start () +to allocate memory, store the arguments there, and also +an indication of which argument is next, so that +.BR va_arg () +can step through the list. +Now +.BR va_end () +can free the allocated memory again. +To accommodate this situation, C99 adds a macro +.BR va_copy (), +so that the above assignment can be replaced by +.in +4n +.nf + +va_list aq; +va_copy(aq, ap); +\&... +va_end(aq); + +.fi +.in +Each invocation of +.BR va_copy () +must be matched by a corresponding invocation of +.BR va_end () +in the same function. +Some systems that do not supply +.BR va_copy () +have +.B __va_copy +instead, since that was the name used in the draft proposal. +.SH "CONFORMING TO" +The +.BR va_start (), +.BR va_arg (), +and +.BR va_end () +macros conform to C89. +C99 defines the +.BR va_copy () +macro. +.SH NOTES +These macros are +.I not +compatible with the historic macros they replace. +A backward compatible version can be found in the include file +.IR . +.PP +The historic setup is: +.in +4n +.nf + +#include + +void +foo(va_alist) + va_dcl +{ + va_list ap; + + va_start(ap); + while (...) { + ... + x = va_arg(ap, type); + ... + } + va_end(ap); +} + +.fi +.in +On some systems, +.I va_end +contains a closing \(aq}\(aq matching a \(aq{\(aq in +.IR va_start , +so that both macros must occur in the same function, and in a way +that allows this. +.SH BUGS +Unlike the +.B varargs +macros, the +.B stdarg +macros do not permit programmers to code a function with no fixed +arguments. +This problem generates work mainly when converting +.B varargs +code to +.B stdarg +code, but it also creates difficulties for variadic functions that wish to +pass all of their arguments on to a function that takes a +.I va_list +argument, such as +.BR vfprintf (3). +.SH EXAMPLE +The function +.I foo +takes a string of format characters and prints out the argument associated +with each format character based on the type. +.nf + +#include +#include + +void +foo(char *fmt, ...) +{ + va_list ap; + int d; + char c, *s; + + va_start(ap, fmt); + while (*fmt) + switch (*fmt++) { + case \(aqs\(aq: /* string */ + s = va_arg(ap, char *); + printf("string %s\en", s); + break; + case \(aqd\(aq: /* int */ + d = va_arg(ap, int); + printf("int %d\en", d); + break; + case \(aqc\(aq: /* char */ + /* need a cast here since va_arg only + takes fully promoted types */ + c = (char) va_arg(ap, int); + printf("char %c\en", c); + break; + } + va_end(ap); +} +.fi diff --git a/original/man3/stderr.3 b/original/man3/stderr.3 new file mode 100644 index 00000000..752ae279 --- /dev/null +++ b/original/man3/stderr.3 @@ -0,0 +1 @@ +.so man3/stdin.3 diff --git a/original/man3/stdin.3 b/original/man3/stdin.3 new file mode 100644 index 00000000..18804eaa --- /dev/null +++ b/original/man3/stdin.3 @@ -0,0 +1,155 @@ +.\" From dholland@burgundy.eecs.harvard.edu Tue Mar 24 18:08:15 1998 +.\" +.\" This man page was written in 1998 by David A. Holland +.\" and placed in the Public Domain. Polished a bit by aeb. +.\" 2005-06-16 mtk, mentioned freopen() +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.TH STDIN 3 2008-07-14 "Linux" "Linux Programmer's Manual" +.SH NAME +stdin, stdout, stderr \- standard I/O streams +.SH SYNOPSIS +.nf +.B #include + +.BI "extern FILE *" stdin ; +.BI "extern FILE *" stdout ; +.BI "extern FILE *" stderr ; +.fi +.SH DESCRIPTION +Under normal circumstances every Unix program has three streams opened +for it when it starts up, one for input, one for output, and one for +printing diagnostic or error messages. +These are typically attached to +the user's terminal (see +.BR tty (4) +but might instead refer to files or other devices, depending on what +the parent process chose to set up. +(See also the "Redirection" section of +.BR sh (1).) +.PP +The input stream is referred to as "standard input"; the output stream is +referred to as "standard output"; and the error stream is referred to +as "standard error". +These terms are abbreviated to form the symbols +used to refer to these files, namely +.IR stdin , +.IR stdout , +and +.IR stderr . + +Each of these symbols is a +.BR stdio (3) +macro of type pointer to +.IR FILE , +and can be used with functions like +.BR fprintf (3) +or +.BR fread (3). +.PP +Since +.IR FILE s +are a buffering wrapper around Unix file descriptors, the +same underlying files may also be accessed using the raw Unix file +interface, that is, the functions like +.BR read (2) +and +.BR lseek (2). +.PP +On program startup, the integer file descriptors +associated with the streams +.IR stdin , +.IR stdout , +and +.I stderr +are 0, 1, and 2, respectively. +The preprocessor symbols +.BR STDIN_FILENO , +.BR STDOUT_FILENO , +and +.B STDERR_FILENO +are defined with these values in +\fI\fP. +(Applying +.BR freopen (3) +to one of these streams can change the file descriptor number +associated with the stream.) +.PP +Note that mixing use of +.IR FILE s +and raw file descriptors can produce +unexpected results and should generally be avoided. +(For the masochistic among you: POSIX.1, section 8.2.3, describes +in detail how this interaction is supposed to work.) +A general rule is that file descriptors are handled in the kernel, +while stdio is just a library. +This means for example, that after an +.BR exec (3), +the child inherits all open file descriptors, but all old streams +have become inaccessible. +.PP +Since the symbols +.IR stdin , +.IR stdout , +and +.I stderr +are specified to be macros, assigning to them is nonportable. +The standard streams can be made to refer to different files +with help of the library function +.BR freopen (3), +specially introduced to make it possible to reassign +.IR stdin , +.IR stdout , +and +.IR stderr . +The standard streams are closed by a call to +.BR exit (3) +and by normal program termination. +.SH "CONFORMING TO" +The +.IR stdin , +.IR stdout , +and +.I stderr +macros conform to C89 +and this standard also stipulates that these three +streams shall be open at program startup. +.SH NOTES +The stream +.I stderr +is unbuffered. +The stream +.I stdout +is line-buffered when it points to a terminal. +Partial lines will not +appear until +.BR fflush (3) +or +.BR exit (3) +is called, or a newline is printed. +This can produce unexpected +results, especially with debugging output. +The buffering mode of the standard streams (or any other stream) +can be changed using the +.BR setbuf (3) +or +.BR setvbuf (3) +call. +Note that in case +.I stdin +is associated with a terminal, there may also be input buffering +in the terminal driver, entirely unrelated to stdio buffering. +(Indeed, normally terminal input is line buffered in the kernel.) +This kernel input handling can be modified using calls like +.BR tcsetattr (3); +see also +.BR stty (1), +and +.BR termios (3). +.SH SEE ALSO +.BR csh (1), +.BR sh (1), +.BR open (2), +.BR fopen (3), +.BR stdio (3) diff --git a/original/man3/stdio.3 b/original/man3/stdio.3 new file mode 100644 index 00000000..724579a5 --- /dev/null +++ b/original/man3/stdio.3 @@ -0,0 +1,254 @@ +.\" Copyright (c) 1990, 1991 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. +.\" +.\" @(#)stdio.3 6.5 (Berkeley) 5/6/91 +.\" +.\" Converted for Linux, Mon Nov 29 16:07:22 1993, faith@cs.unc.edu +.\" Modified, 2001-12-26, aeb +.\" +.TH STDIO 3 2001-12-26 "" "Linux Programmer's Manual" +.SH NAME +stdio \- standard input/output library functions +.SH SYNOPSIS +.B #include +.sp +.BI "FILE *" stdin ; +.br +.BI "FILE *" stdout ; +.br +.BI "FILE *" stderr ; +.SH DESCRIPTION +The standard I/O library provides a simple and efficient buffered stream +I/O interface. +Input and output is mapped into logical data streams and the +physical I/O characteristics are concealed. +The functions and macros are +listed below; more information is available from the individual man pages. +.PP +A stream is associated with an external file (which may be a physical +device) by +.I opening +a file, which may involve creating a new file. +Creating an existing file +causes its former contents to be discarded. +If a file can support positioning requests (such as a disk file, +as opposed to a terminal) then a +.I file position indicator +associated with the stream is positioned at the start of the file (byte +zero), unless the file is opened with append mode. +If append mode is used, +it is unspecified whether the position indicator will be placed at the +start or the end of the file. +The position indicator is maintained by +subsequent reads, writes and positioning requests. +All input occurs as if the characters were read by successive calls to the +.BR fgetc (3) +function; all output takes place as if all characters were written by +successive calls to the +.BR fputc (3) +function. +.PP +A file is disassociated from a stream by +.I closing +the file. +Output streams are flushed (any unwritten buffer contents are +transferred to the host environment) before the stream is disassociated from +the file. +The value of a pointer to a +.I FILE +object is indeterminate after a file is closed (garbage). +.PP +A file may be subsequently reopened, by the same or another program +execution, and its contents reclaimed or modified (if it can be +repositioned at the start). +If the main function returns to its original +caller, or the +.BR exit (3) +function is called, all open files are closed (hence all output streams are +flushed) before program termination. +Other methods of program termination, +such as +.BR abort (3) +do not bother about closing files properly. +.PP +At program startup, three text streams are predefined and need not be +opened explicitly \(em +.I standard input +(for reading conventional input), \(em +.I standard output +(for writing conventional input), and +.I standard error +(for writing diagnostic output). +These streams are abbreviated +.IR stdin , stdout +and +.IR stderr . +When opened, the standard error stream is not fully buffered; the standard +input and output streams are fully buffered if and only if the streams do +not to refer to an interactive device. +.PP +Output streams that refer to terminal devices are always line buffered by +default; pending output to such streams is written automatically whenever +an input stream that refers to a terminal device is read. +In cases where a +large amount of computation is done after printing part of a line on an +output terminal, it is necessary to +.BR fflush (3) +the standard output before going off and computing so that the output will +appear. +.PP +The +.I stdio +library is a part of the library +.B libc +and routines are automatically loaded as needed by the compilers +.BR cc (1) +and +.BR pc (1). +The +SYNOPSIS +sections of the following manual pages indicate which include files are to +be used, what the compiler declaration for the function looks like and +which external variables are of interest. +.PP +The following are defined as macros; these names may not be reused without +first removing their current definitions with +.BR #undef : +.BR BUFSIZ , +.BR EOF , +.BR FILENAME_MAX , +.BR FOPEN_MAX , +.BR L_cuserid , +.BR L_ctermid , +.BR L_tmpnam , +.BR NULL , +.BR SEEK_END , +.BR SEEK_SET , +.BR SEEK_CUR , +.BR TMP_MAX , +.BR clearerr , +.BR feof , +.BR ferror , +.BR fileno , +.\" Not on Linux: .BR fropen , +.\" Not on Linux: .BR fwopen , +.BR getc , +.BR getchar , +.BR putc , +.BR putchar , +.BR stderr , +.BR stdin , +.BR stdout . +Function versions of the macro functions +.BR feof , +.BR ferror , +.BR clearerr , +.BR fileno , +.BR getc , +.BR getchar , +.BR putc , +and +.B putchar +exist and will be used if the macros definitions are explicitly removed. +.SS "List of Functions" +.TS +; +lb lb +lb l. +Function Description +_ +clearerr check and reset stream status +fclose close a stream +fdopen stream open functions +feof check and reset stream status +ferror check and reset stream status +fflush flush a stream +fgetc get next character or word from input stream +fgetpos reposition a stream +fgets get a line from a stream +fileno return the integer descriptor of the argument stream +fopen stream open functions +fprintf formatted output conversion +fpurge flush a stream +fputc output a character or word to a stream +fputs output a line to a stream +fread binary stream input/output +freopen stream open functions +fscanf input format conversion +fseek reposition a stream +fsetpos reposition a stream +ftell reposition a stream +fwrite binary stream input/output +getc get next character or word from input stream +getchar get next character or word from input stream +gets get a line from a stream +getw get next character or word from input stream +mktemp make temporary filename (unique) +perror system error messages +printf formatted output conversion +putc output a character or word to a stream +putchar output a character or word to a stream +puts output a line to a stream +putw output a character or word to a stream +remove remove directory entry +rewind reposition a stream +scanf input format conversion +setbuf stream buffering operations +setbuffer stream buffering operations +setlinebuf stream buffering operations +setvbuf stream buffering operations +sprintf formatted output conversion +sscanf input format conversion +strerror system error messages +sys_errlist system error messages +sys_nerr system error messages +tempnam temporary file routines +tmpfile temporary file routines +tmpnam temporary file routines +ungetc un-get character from input stream +vfprintf formatted output conversion +vfscanf input format conversion +vprintf formatted output conversion +vscanf input format conversion +vsprintf formatted output conversion +vsscanf input format conversion +.TE +.SH "CONFORMING TO" +The +.I stdio +library conforms to C89. +.SH "SEE ALSO" +.BR close (2), +.BR open (2), +.BR read (2), +.BR write (2), +.BR stdout (3), +.BR unlocked_stdio (3) diff --git a/original/man3/stdio_ext.3 b/original/man3/stdio_ext.3 new file mode 100644 index 00000000..6e58cf85 --- /dev/null +++ b/original/man3/stdio_ext.3 @@ -0,0 +1,132 @@ +.\" 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. +.\" +.TH STDIO_EXT 3 2001-12-16 "" "Linux Programmer's Manual" +.SH NAME +__fbufsize, __flbf, __fpending, __fpurge, __freadable, +__freading, __fsetlocking, __fwritable, __fwriting, _flushlbf \- +interfaces to stdio FILE structure +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.BI "size_t __fbufsize(FILE *" stream ); +.br +.BI "size_t __fpending(FILE *" stream ); +.br +.BI "int __flbf(FILE *" stream ); +.br +.BI "int __freadable(FILE *" stream ); +.br +.BI "int __fwritable(FILE *" stream ); +.br +.BI "int __freading(FILE *" stream ); +.br +.BI "int __fwriting(FILE *" stream ); +.br +.BI "int __fsetlocking(FILE *" stream ", int " type ); +.br +.B "void _flushlbf(void);" +.br +.BI "void __fpurge(FILE *" stream ); +.SH DESCRIPTION +Solaris introduced routines to allow portable access to the +internals of the +.I FILE +structure, and glibc also implemented these. +.LP +The +.BR __fbufsize () +function returns the size of the buffer currently used +by the given stream. +.LP +The +.BR __fpending () +function returns the number of bytes in the output buffer. +For wide-oriented streams the unit is wide characters. +This function is undefined on buffers in reading mode, +or opened read-only. +.LP +The +.BR __flbf () +function returns a nonzero value if the stream is line-buffered, +and zero otherwise. +.LP +The +.BR __freadable () +function returns a nonzero value if the stream allows reading, +and zero otherwise. +.LP +The +.BR __fwritable () +function returns a nonzero value if the stream allows writing, +and zero otherwise. +.LP +The +.BR __freading () +function returns a nonzero value if the stream is read-only, or +if the last operation on the stream was a read operation, +and zero otherwise. +.LP +The +.BR __fwriting () +function returns a nonzero value if the stream is write-only (or +append-only), or if the last operation on the stream was a write +operation, and zero otherwise. +.LP +The +.BR __fsetlocking () +function can be used to select the desired type of locking on the stream. +It returns the current type. +The +.I type +argument can take the following three values: +.TP +.B FSETLOCKING_INTERNAL +Perform implicit locking around every operation on the given stream +(except for the *_unlocked ones). +This is the default. +.TP +.B FSETLOCKING_BYCALLER +The caller will take care of the locking (possibly using +.BR flockfile (3) +in case there is more than one thread), and the stdio routines +will not do locking until the state is reset to +.BR FSETLOCKING_INTERNAL . +.TP +.B FSETLOCKING_QUERY +Don't change the type of locking. +(Only return it.) +.LP +The +.BR _flushlbf () +function flushes all line-buffered streams. +(Presumably so that +output to a terminal is forced out, say before reading keyboard input.) +.LP +The +.BR __fpurge () +function discards the contents of the stream's buffer. +.SH "SEE ALSO" +.BR flockfile (3), +.BR fpurge (3) diff --git a/original/man3/stdout.3 b/original/man3/stdout.3 new file mode 100644 index 00000000..752ae279 --- /dev/null +++ b/original/man3/stdout.3 @@ -0,0 +1 @@ +.so man3/stdin.3 diff --git a/original/man3/stpcpy.3 b/original/man3/stpcpy.3 new file mode 100644 index 00000000..f5f3740e --- /dev/null +++ b/original/man3/stpcpy.3 @@ -0,0 +1,88 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1995 James R. Van Zandt +.\" +.\" 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. +.\" +.TH STPCPY 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH NAME +stpcpy \- copy a string returning a pointer to its end +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *stpcpy(char *" dest ", const char *" src ); +.fi +.SH DESCRIPTION +The +.BR stpcpy () +function copies the string pointed to by \fIsrc\fP +(including the terminating \(aq\\0\(aq character) to the array pointed to by +\fIdest\fP. +The strings may not overlap, and the destination string +\fIdest\fP must be large enough to receive the copy. +.SH "RETURN VALUE" +.BR stpcpy () +returns a pointer to the \fBend\fP of the string +\fIdest\fP (that is, the address of the terminating null byte) +rather than the beginning. +.SH "CONFORMING TO" +This function is not part of the C or POSIX.1 standards, and is +not customary on Unix systems, but is not a GNU invention either. +Perhaps it comes from MS-DOS. +Nowadays, it is also present on the BSDs. +.SH EXAMPLE +For example, this program uses +.BR stpcpy () +to concatenate \fBfoo\fP and +\fBbar\fP to produce \fBfoobar\fP, which it then prints. +.in +4n +.nf + +#define _GNU_SOURCE +#include +#include + +int +main(void) +{ + char buffer[20]; + char *to = buffer; + + to = stpcpy(to, "foo"); + to = stpcpy(to, "bar"); + printf("%s\\n", buffer); +} +.fi +.in +.SH BUGS +This function may overrun the buffer +.IR dest . +.SH "SEE ALSO" +.BR bcopy (3), +.BR memccpy (3), +.BR memcpy (3), +.BR memmove (3), +.BR strcpy (3), +.BR wcpcpy (3), +.BR feature_test_macros (7) diff --git a/original/man3/stpncpy.3 b/original/man3/stpncpy.3 new file mode 100644 index 00000000..239603a1 --- /dev/null +++ b/original/man3/stpncpy.3 @@ -0,0 +1,52 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" +.\" Corrected, aeb, 990824 +.TH STPNCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +stpncpy \- copy a fixed-size string, returning a pointer to its end +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *stpncpy(char *" dest ", const char *" src ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR stpncpy () +function copies at most \fIn\fP characters from the string +pointed to by \fIsrc\fP, including the terminating \(aq\\0\(aq character, +to the array pointed to by \fIdest\fP. +Exactly \fIn\fP characters are written at +\fIdest\fP. +If the length \fIstrlen(src)\fP is smaller than \fIn\fP, the +remaining characters in the array pointed to by \fIdest\fP are filled +with \(aq\\0\(aq characters. +If the length \fIstrlen(src)\fP is greater or equal to +\fIn\fP, the string pointed to by \fIdest\fP will +not be \(aq\\0\(aq terminated. +.PP +The strings may not overlap. +.PP +The programmer must ensure that there is room for at least \fIn\fP characters +at \fIdest\fP. +.SH "RETURN VALUE" +.BR stpncpy () +returns a pointer to the terminating null +in \fIdest\fP, or, if \fIdest\fP is not null-terminated, +\fIdest + n\fP. +.SH "CONFORMING TO" +This function is a GNU extension. +.SH "SEE ALSO" +.BR strncpy (3), +.BR wcpncpy (3), +.BR feature_test_macros (7) diff --git a/original/man3/strcasecmp.3 b/original/man3/strcasecmp.3 new file mode 100644 index 00000000..43d0ecbc --- /dev/null +++ b/original/man3/strcasecmp.3 @@ -0,0 +1,70 @@ +.\" 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 Sat Jul 24 18:12:45 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRCASECMP 3 1993-04-11 "" "Linux Programmer's Manual" +.SH NAME +strcasecmp, strncasecmp \- compare two strings ignoring case +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int strcasecmp(const char *" s1 ", const char *" s2 ); +.sp +.BI "int strncasecmp(const char *" s1 ", const char *" s2 ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR strcasecmp () +function compares the two strings \fIs1\fP and +\fIs2\fP, ignoring the case of the characters. +It returns an integer +less than, equal to, or greater than zero if \fIs1\fP is found, +respectively, to be less than, to match, or be greater than \fIs2\fP. +.PP +The +.BR strncasecmp () +function is similar, except it only compares +the first \fIn\fP characters of \fIs1\fP. +.SH "RETURN VALUE" +The +.BR strcasecmp () +and +.BR strncasecmp () +functions return +an integer less than, equal to, or greater than zero if \fIs1\fP +(or the first \fIn\fP bytes thereof) is found, respectively, to be +less than, to match, or be greater than \fIs2\fP. +.SH "CONFORMING TO" +4.4BSD, POSIX.1-2001. +.SH "SEE ALSO" +.BR bcmp (3), +.BR memcmp (3), +.BR strcmp (3), +.BR strcoll (3), +.BR strncmp (3), +.BR wcscasecmp (3), +.BR wcsncasecmp (3) diff --git a/original/man3/strcasestr.3 b/original/man3/strcasestr.3 new file mode 100644 index 00000000..2feb2c57 --- /dev/null +++ b/original/man3/strcasestr.3 @@ -0,0 +1 @@ +.so man3/strstr.3 diff --git a/original/man3/strcat.3 b/original/man3/strcat.3 new file mode 100644 index 00000000..26f80255 --- /dev/null +++ b/original/man3/strcat.3 @@ -0,0 +1,105 @@ +.\" 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 Sat Jul 24 18:11:47 1993 by Rik Faith (faith@cs.unc.edu) +.\" 2007-06-15, Marc Boyer + mtk +.\" Improve discussion of strncat(). +.TH STRCAT 3 2008-06-13 "GNU" "Linux Programmer's Manual" +.SH NAME +strcat, strncat \- concatenate two strings +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *strcat(char *" dest ", const char *" src ); +.sp +.BI "char *strncat(char *" dest ", const char *" src ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR strcat () +function appends the \fIsrc\fP string to the +\fIdest\fP string, overwriting the null byte (\(aq\\0\(aq) at the end of +\fIdest\fP, and then adds a terminating null byte. +The strings may not overlap, and the \fIdest\fP string must have +enough space for the result. +.PP +The +.BR strncat () +function is similar, except that +.IP * 3 +it will use at most \fIn\fP characters from \fIsrc\fP; and +.IP * +\fIsrc\fP does not need to be null-terminated if it contains +\fIn\fP or more characters. +.PP +As with +.BR strcat (), +the resulting string in \fIdest\fP is always null-terminated. +.PP +If \fIsrc\fP contains \fIn\fP or more characters, +.BR strncat () +writes \fIn+1\fP characters to \fIdest\fP (\fIn\fP +from \fIsrc\fP plus the terminating null byte). +Therefore, the size of \fIdest\fP must be at least +\fIstrlen(dest)+n+1\fP. + +A simple implementation of +.BR strncat () +might be: +.in +4n +.nf + +char* +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++) + dest[dest_len + i] = src[i]; + dest[dest_len + i] = \(aq\\0\(aq; + + return dest; +} +.fi +.in +.SH "RETURN VALUE" +The +.BR strcat () +and +.BR strncat () +functions return a pointer to the resulting string \fIdest\fP. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99. +.SH "SEE ALSO" +.BR bcopy (3), +.BR memccpy (3), +.BR memcpy (3), +.BR strcpy (3), +.BR strncpy (3), +.BR wcscat (3), +.BR wcsncat (3) diff --git a/original/man3/strchr.3 b/original/man3/strchr.3 new file mode 100644 index 00000000..615e64ed --- /dev/null +++ b/original/man3/strchr.3 @@ -0,0 +1,105 @@ +.\" 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 Mon Apr 12 12:51:24 1993, David Metcalfe +.\" 2006-05-19, Justin Pryzby +.\" Document strchrnul(3). +.\" +.TH STRCHR 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH NAME +strchr, strrchr, strchrnul \- locate character in string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *strchr(const char *" s ", int " c ); +.sp +.BI "char *strrchr(const char *" s ", int " c ); +.sp +.B #define _GNU_SOURCE +.B #include +.sp +.BI "char *strchrnul(const char *" s ", int " c ); +.fi +.SH DESCRIPTION +The +.BR strchr () +function returns a pointer to the first occurrence +of the character \fIc\fP in the string \fIs\fP. +.PP +The +.BR strrchr () +function returns a pointer to the last occurrence +of the character \fIc\fP in the string \fIs\fP. +.PP +The +.BR strchrnul () +function is like +.BR strchr () +except that if \fIc\fP is not found in \fIs\fP, +then it returns a pointer to the null byte +at the end of \fIs\fP, rather than NULL. +.PP +Here "character" means "byte"; these functions do not work with +wide or multibyte characters. +.SH "RETURN VALUE" +The +.BR strchr () +and +.BR strrchr () +functions return a pointer to +the matched character or NULL if the character is not found. + +The +.BR strchrnul () +function returns a pointer to +the matched character, +or a pointer to the null +byte at the end of \fIs\fP (i.e., \fIs+strlen(s)\fP) +if the character is not found. +.SH VERSIONS +.BR strchrnul () +first appeared in glibc in version 2.1.1. +.SH "CONFORMING TO" +.BR strchr () +and +.BR strrchr () +are in SVr4, 4.3BSD, C89, C99. +.BR strchrnul () +is a GNU extension. +.SH "SEE ALSO" +.BR index (3), +.BR memchr (3), +.BR rindex (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), +.BR feature_test_macros (7) diff --git a/original/man3/strchrnul.3 b/original/man3/strchrnul.3 new file mode 100644 index 00000000..322b7a89 --- /dev/null +++ b/original/man3/strchrnul.3 @@ -0,0 +1 @@ +.so man3/strchr.3 diff --git a/original/man3/strcmp.3 b/original/man3/strcmp.3 new file mode 100644 index 00000000..4797e717 --- /dev/null +++ b/original/man3/strcmp.3 @@ -0,0 +1,73 @@ +.\" 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 Sat Jul 24 18:08:52 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2001-08-31, aeb +.\" +.TH STRCMP 3 2009-04-21 "" "Linux Programmer's Manual" +.SH NAME +strcmp, strncmp \- compare two strings +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int strcmp(const char *" s1 ", const char *" s2 ); +.sp +.BI "int strncmp(const char *" s1 ", const char *" s2 ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR strcmp () +function compares the two strings \fIs1\fP and +\fIs2\fP. +It returns an integer less than, equal to, or greater +than zero if \fIs1\fP is found, respectively, to be less than, +to match, or be greater than \fIs2\fP. +.PP +The +.BR strncmp () +function is similar, except it only compares +the first (at most) \fIn\fP characters of \fIs1\fP and \fIs2\fP. +.SH "RETURN VALUE" +The +.BR strcmp () +and +.BR strncmp () +functions return an integer +less than, equal to, or greater than zero if \fIs1\fP (or the first +\fIn\fP bytes thereof) is found, respectively, to be less than, to +match, or be greater than \fIs2\fP. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99. +.SH "SEE ALSO" +.BR bcmp (3), +.BR memcmp (3), +.BR strcasecmp (3), +.BR strcoll (3), +.BR strncasecmp (3), +.BR strverscmp (3), +.BR wcscmp (3), +.BR wcsncmp (3) diff --git a/original/man3/strcoll.3 b/original/man3/strcoll.3 new file mode 100644 index 00000000..d5fc5d21 --- /dev/null +++ b/original/man3/strcoll.3 @@ -0,0 +1,69 @@ +.\" 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 Sun Jul 25 10:40:44 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRCOLL 3 1993-04-12 "GNU" "Linux Programmer's Manual" +.SH NAME +strcoll \- compare two strings using the current locale +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int strcoll(const char *" s1 ", const char *" s2 ); +.fi +.SH DESCRIPTION +The +.BR strcoll () +function compares the two strings \fIs1\fP and +\fIs2\fP. +It returns an integer less than, equal to, or greater +than zero if \fIs1\fP is found, respectively, to be less than, +to match, or be greater than \fIs2\fP. +The comparison is based on +strings interpreted as appropriate for the program's current locale +for category \fBLC_COLLATE\fP. (See +.BR setlocale (3).) +.SH "RETURN VALUE" +The +.BR strcoll () +function returns an integer less than, equal to, +or greater than zero if \fIs1\fP is found, respectively, to be less +than, to match, or be greater than \fIs2\fP, when both are interpreted +as appropriate for the current locale. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99. +.SH NOTES +In the \fI"POSIX"\fP or \fI"C"\fP locales +.BR strcoll () +is equivalent to +.BR strcmp (3). +.SH "SEE ALSO" +.BR bcmp (3), +.BR memcmp (3), +.BR setlocale (3), +.BR strcasecmp (3), +.BR strcmp (3), +.BR strxfrm (3) diff --git a/original/man3/strcpy.3 b/original/man3/strcpy.3 new file mode 100644 index 00000000..adf36f06 --- /dev/null +++ b/original/man3/strcpy.3 @@ -0,0 +1,142 @@ +.\" Copyright (C) 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 Sat Jul 24 18:06:49 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Aug 25 23:17:51 1995 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Wed Dec 18 00:47:18 1996 by Andries Brouwer (aeb@cwi.nl) +.\" 2007-06-15, Marc Boyer + mtk +.\" Improve discussion of strncpy(). +.\" +.TH STRCPY 3 2009-12-04 "GNU" "Linux Programmer's Manual" +.SH NAME +strcpy, strncpy \- copy a string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *strcpy(char *" dest ", const char *" src ); +.sp +.BI "char *strncpy(char *" dest ", const char *" src ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR strcpy () +function copies the string pointed to by \fIsrc\fP, +including the terminating null byte (\(aq\\0\(aq), +to the buffer pointed to by \fIdest\fP. +The strings may not overlap, and the destination string +\fIdest\fP must be large enough to receive the copy. +.PP +The +.BR strncpy () +function is similar, except that at most +\fIn\fP bytes of \fIsrc\fP are copied. +.BR Warning : +If there is no null byte +among the first \fIn\fP bytes of \fIsrc\fP, +the string placed in \fIdest\fP will not be null-terminated. +.PP +If the length of +.I src +is less than +.IR n , +.BR strncpy () +pads the remainder of +.I dest +with null bytes. +.PP +A simple implementation of +.BR strncpy () +might be: +.in +4n +.nf + +char* +strncpy(char *dest, const char *src, size_t n){ + size_t i; + + for (i = 0 ; i < n && src[i] != \(aq\\0\(aq ; i++) + dest[i] = src[i]; + for ( ; i < n ; i++) + dest[i] = \(aq\\0\(aq; + + return dest; +} +.fi +.in +.SH "RETURN VALUE" +The +.BR strcpy () +and +.BR strncpy () +functions return a pointer to +the destination string \fIdest\fP. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99. +.SH NOTES +Some programmers consider +.BR strncpy () +to be inefficient and error prone. +If the programmer knows (i.e., includes code to test!) +that the size of \fIdest\fP is greater than +the length of \fIsrc\fP, then +.BR strcpy () +can be used. + +If there is no terminating null byte in the first \fIn\fP +characters of \fIsrc\fP, +.BR strncpy () +produces an unterminated string in \fIdest\fP. +Programmers often prevent this mistake by forcing termination +as follows: +.in +4n +.nf + +strncpy(buf, str, n); +if (n > 0) + buf[n \- 1]= \(aq\\0\(aq; +.fi +.in +.SH BUGS +If the destination string of a +.BR strcpy () +is not large enough, then anything might happen. +Overflowing fixed-length string buffers is a favorite cracker technique +for taking complete control of the machine. +Any time a program reads or copies data into a buffer, +the program first needs to check that there's enough space. +This may be unnecessary if you can show that overflow is impossible, +but be careful: programs can get changed over time, +in ways that may make the impossible possible. +.SH "SEE ALSO" +.BR bcopy (3), +.BR memccpy (3), +.BR memcpy (3), +.BR memmove (3), +.BR stpcpy (3), +.BR strdup (3), +.BR wcscpy (3), +.BR wcsncpy (3) diff --git a/original/man3/strcspn.3 b/original/man3/strcspn.3 new file mode 100644 index 00000000..26284f29 --- /dev/null +++ b/original/man3/strcspn.3 @@ -0,0 +1 @@ +.so man3/strspn.3 diff --git a/original/man3/strdup.3 b/original/man3/strdup.3 new file mode 100644 index 00000000..2b0eb6e1 --- /dev/null +++ b/original/man3/strdup.3 @@ -0,0 +1,108 @@ +.\" 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 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 +.TH STRDUP 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +strdup, strndup, strdupa, strndupa \- duplicate a string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *strdup(const char *" s ); +.sp +.BI "char *strndup(const char *" s ", size_t " n ); +.br +.BI "char *strdupa(const char *" s ); +.br +.BI "char *strndupa(const char *" s ", size_t " n ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR strdup (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR strndup (), +.BR strdupa (), +.BR strndupa (): +_GNU_SOURCE +.SH DESCRIPTION +The +.BR strdup () +function returns a pointer to a new string which +is a duplicate of the string \fIs\fP. +Memory for the new string is +obtained with +.BR malloc (3), +and can be freed with +.BR free (3). + +The +.BR strndup () +function is similar, but only copies at most +\fIn\fP characters. +If \fIs\fP is longer than \fIn\fP, only \fIn\fP +characters are copied, and a terminating null byte (\(aq\\0\(aq) is added. + +.BR strdupa () +and +.BR strndupa () +are similar, but use +.BR alloca (3) +to allocate the buffer. +They are only available when using the GNU +GCC suite, and suffer from the same limitations described in +.BR alloca (3). +.SH "RETURN VALUE" +The +.BR strdup () +function returns a pointer to the duplicated +string, or NULL if insufficient memory was available. +.SH ERRORS +.TP +.B ENOMEM +Insufficient memory available to allocate duplicate string. +.SH "CONFORMING TO" +.\" 4.3BSD-Reno, not (first) 4.3BSD. +.BR strdup () +conforms to SVr4, 4.3BSD, POSIX.1-2001. +.BR strndup (), +.BR strdupa (), +and +.BR strndupa () +are GNU extensions. +.SH "SEE ALSO" +.BR alloca (3), +.BR calloc (3), +.BR free (3), +.BR malloc (3), +.BR realloc (3), +.BR wcsdup (3) diff --git a/original/man3/strdupa.3 b/original/man3/strdupa.3 new file mode 100644 index 00000000..2dd8f88c --- /dev/null +++ b/original/man3/strdupa.3 @@ -0,0 +1 @@ +.so man3/strdup.3 diff --git a/original/man3/strerror.3 b/original/man3/strerror.3 new file mode 100644 index 00000000..800190fe --- /dev/null +++ b/original/man3/strerror.3 @@ -0,0 +1,181 @@ +.\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and Copyright (C) 2005, 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:05:30 1993 by Rik Faith +.\" Modified Fri Feb 16 14:25:17 1996 by Andries Brouwer +.\" Modified Sun Jul 21 20:55:44 1996 by Andries Brouwer +.\" Modified Mon Oct 15 21:16:25 2001 by John Levon +.\" Modified Tue Oct 16 00:04:43 2001 by Andries Brouwer +.\" Modified Fri Jun 20 03:04:30 2003 by Andries Brouwer +.\" 2005-12-13, mtk, Substantial rewrite of strerror_r() description +.\" Addition of extra material on portability and standards. +.\" +.TH STRERROR 3 2009-03-30 "" "Linux Programmer's Manual" +.SH NAME +strerror, strerror_r \- return string describing error number +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *strerror(int " errnum ); +.sp +.BI "int strerror_r(int " errnum ", char *" buf ", size_t " buflen ); + /* XSI-compliant */ +.sp +.BI "char *strerror_r(int " errnum ", char *" buf ", size_t " buflen ); + /* GNU-specific */ +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +The XSI-compliant version of +.BR strerror_r () +is provided if: +.br +(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !\ _GNU_SOURCE +.br +Otherwise, the GNU-specific version is provided. +.SH DESCRIPTION +The +.BR strerror () +function returns a pointer to a string that describes the error +code passed in the argument \fIerrnum\fP, possibly using the +.B LC_MESSAGES +part of the current locale to select the appropriate language. +This string must not be modified by the application, but may be +modified by a subsequent call to +.BR perror (3) +or +.BR strerror (). +No library function will modify this string. + +The +.BR strerror_r () +function is similar to +.BR strerror (), +but is +thread safe. +This function is available in two versions: +an XSI-compliant version specified in POSIX.1-2001 +(available since glibc 2.3.4), +and a GNU-specific version (available since glibc 2.0). +The XSI-compliant version is provided with the feature test macros +settings shown in the SYNOPSIS; +otherwise the GNU-specific version is provided. +If no feature test macros are explicitly defined, +then (since glibc 2.4) +.B _POSIX_SOURCE +is defined by default with the value +200112L, so that the XSI-compliant version of +.BR strerror_r () +is provided by default. + +The XSI-compliant +.BR strerror_r () +is preferred for portable applications. +It returns the error string in the user-supplied buffer +.I buf +of length +.IR buflen . + +The GNU-specific +.BR strerror_r () +returns a pointer to a string containing the error message. +This may be either a pointer to a string that the function stores in +.IR buf , +or a pointer to some (immutable) static string +(in which case +.I buf +is unused). +If the function stores a string in +.IR buf , +then at most +.I buflen +bytes are stored (the string may be truncated if +.I buflen +is too small) and the string always includes a terminating null byte. +.SH "RETURN VALUE" +The +.BR strerror () +and the GNU-specific +.BR strerror_r () +functions return +the appropriate error description string, +or an "Unknown error nnn" message if the error number is unknown. + +The XSI-compliant +.BR strerror_r () +function returns 0 on success; +on error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +The value of +.I errnum +is not a valid error number. +.TP +.B ERANGE +Insufficient storage was supplied to contain the error description string. +.SH "CONFORMING TO" +.BR strerror () +is specified by POSIX.1-2001, C89, C99. +.BR strerror_r () +is specified by POSIX.1-2001. + +The GNU-specific +.BR strerror_r () +function is a nonstandard extension. + +POSIX.1-2001 permits +.BR strerror () +to set +.I errno +if the call encounters an error, but does not specify what +value should be returned as the function result in the event of an error. +On some systems, +.\" e.g., Solaris 8, HP-UX 11 +.BR strerror () +returns NULL if the error number is unknown. +On other systems, +.\" e.g., FreeBSD 5.4, Tru64 5.1B +.BR strerror () +returns a string something like "Error nnn occurred" and sets +.I errno +to +.B EINVAL +if the error number is unknown. +.SH "SEE ALSO" +.BR err (3), +.BR errno (3), +.BR error (3), +.BR perror (3), +.BR strsignal (3) diff --git a/original/man3/strerror_r.3 b/original/man3/strerror_r.3 new file mode 100644 index 00000000..649dd6d9 --- /dev/null +++ b/original/man3/strerror_r.3 @@ -0,0 +1 @@ +.so man3/strerror.3 diff --git a/original/man3/strfmon.3 b/original/man3/strfmon.3 new file mode 100644 index 00000000..02134993 --- /dev/null +++ b/original/man3/strfmon.3 @@ -0,0 +1,168 @@ +.\" Copyright (c) 2000 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. +.\" +.TH STRFMON 3 2000-12-05 "Linux" "Linux Programmer's Manual" +.SH NAME +strfmon \- convert monetary value to a string +.SH SYNOPSIS +.B #include +.sp +.BI "ssize_t strfmon(char *" s ", size_t " max ", const char *" format , +.B "...);" +.SH DESCRIPTION +The +.BR strfmon () +function formats the specified amounts +according to the format specification \fIformat\fP and places the +result in the character array \fIs\fP of size \fImax\fP. +.PP +Ordinary characters in \fIformat\fP are copied to \fIs\fP +without conversion. +Conversion specifiers are introduced by a \(aq%\(aq +character. +Immediately following it there can be zero or more +of the following flags: +.TP +.BI = f +The single-byte character +.I f +is used as the numeric fill character (to be used with +a left precision, see below). +When not specified, the space character is used. +.TP +.B ^ +Do not use any grouping characters that might be defined +for the current locale. +By default, grouping is enabled. +.TP +.BR ( " or " + +The ( flag indicates that negative amounts should be enclosed between +parentheses. +The + flag indicates that signs should be handled +in the default way, that is, amounts are preceded by the locale's +sign indication, for example, nothing for positive, "\-" for negative. +.TP +.B ! +Omit the currency symbol. +.TP +.B \- +Left justify all fields. +The default is right justification. +.LP +Next, there may be a field width: a decimal digit string specifying +a minimum field width in bytes. +The default is 0. +A result smaller than this width is padded with spaces +(on the left, unless the left-justify flag was given). +.LP +Next, there may be a left precision of the form "#" followed by +a decimal digit string. +If the number of digits left of the +radix character is smaller than this, the representation is +padded on the left with the numeric fill character. +Grouping characters are not counted in this field width. +.LP +Next, there may be a right precision of the form "." followed by +a decimal digit string. +The amount being formatted is rounded to +the specified number of digits prior to formatting. +The default is specified in the +.I frac_digits +and +.I int_frac_digits +items of the current locale. +If the right precision is 0, no radix character is printed. +(The radix character here is determined by +.BR LC_MONETARY , +and may differ from that specified by +.BR LC_NUMERIC .) +.LP +Finally, the conversion specification must be ended with a +conversion character. +The three conversion characters are +.TP +.B % +(In this case the entire specification must be exactly "%%".) +Put a \(aq%\(aq character in the result string. +.TP +.B i +One argument of type +.I double +is converted using the locale's international currency format. +.TP +.B n +One argument of type +.I double +is converted using the locale's national currency format. +.SH "RETURN VALUE" +The +.BR strfmon () +function returns the number of characters placed +in the array \fIs\fP, not including the terminating null byte, +provided the string, including the terminating null byte, fits. +Otherwise, it sets +.I errno +to +.BR E2BIG , +returns \-1, and the contents of the array is undefined. +.SH "CONFORMING TO" +Not in POSIX.1-2001. +Present on several other systems. +.SH EXAMPLE +The call +.in +4n +.nf + +strfmon(buf, sizeof(buf), "[%^=*#6n] [%=*#6i]", + 1234.567, 1234.567); + +.fi +.in +outputs +.in +4n + +[ fl **1234,57] [ NLG **1 234,57] + +.in +in the Dutch locale (with fl for "florijnen" and NLG for Netherlands Guilders). +The grouping character is very ugly because it takes as much space +as a digit, while it should not take more than half that, +and will no doubt cause confusion. +Surprisingly, the "fl" is preceded and followed by a space, +and "NLG" is preceded by one and followed by two spaces. +This may be a bug in the locale files. +The Italian, Australian, Swiss +and Portuguese locales yield +.in +4n + +[ L. **1235] [ ITL **1.235] +.br +[ $**1234.57] [ AUD **1,234.57] +.br +[Fr. **1234,57] [CHF **1.234,57] +.br +[ **1234$57Esc] [ **1.234$57PTE ] +.in +.SH "SEE ALSO" +.BR setlocale (3), +.BR sprintf (3), +.BR locale (7) diff --git a/original/man3/strfry.3 b/original/man3/strfry.3 new file mode 100644 index 00000000..2e642f97 --- /dev/null +++ b/original/man3/strfry.3 @@ -0,0 +1,59 @@ +.\" 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 Sun Jul 25 10:39:43 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRFRY 3 1993-04-12 "GNU" "Linux Programmer's Manual" +.SH NAME +strfry \- randomize a string +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *strfry(char *" string ); +.fi +.SH DESCRIPTION +The +.BR strfry () +function randomizes the contents of \fIstring\fP by +using +.BR rand (3) +to randomly swap characters in the string. +The result is an anagram of \fIstring\fP. +.SH "RETURN VALUE" +The +.BR strfry () +functions returns a pointer to the randomized +string. +.SH "CONFORMING TO" +The +.BR strfry () +function is unique to the +GNU C Library. +.SH "SEE ALSO" +.BR memfrob (3), +.BR feature_test_macros (7) diff --git a/original/man3/strftime.3 b/original/man3/strftime.3 new file mode 100644 index 00000000..0143958e --- /dev/null +++ b/original/man3/strftime.3 @@ -0,0 +1,517 @@ +.\" 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 +.\" GNU texinfo documentation on glibc date/time functions. +.\" Modified Sat Jul 24 18:03:44 1993 by Rik Faith (faith@cs.unc.edu) +.\" Applied fix by Wolfgang Franke, aeb, 961011 +.\" Corrected return value, aeb, 970307 +.\" Added Single Unix Spec conversions and %z, aeb/esr, 990329. +.\" 2005-11-22 mtk, added Glibc Notes covering optional 'flag' and +.\" 'width' components of conversion specifications. +.\" +.TH STRFTIME 3 2010-01-17 "GNU" "Linux Programmer's Manual" +.SH NAME +strftime \- format date and time +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t strftime(char *" s ", size_t " max ", const char *" format , +.BI " const struct tm *" tm ); +.fi +.SH DESCRIPTION +The +.BR strftime () +function formats the broken-down time \fItm\fP +according to the format specification \fIformat\fP and places the +result in the character array \fIs\fP of size \fImax\fP. +.\" FIXME POSIX says: Local timezone information is used as though +.\" strftime() called tzset(). But this doesn't appear to be the case +.PP +The format specification is a null-terminated string and may contain +special character sequences called +.IR "conversion specifications", +each of which is introduced by a \(aq%\(aq character and terminated by +some other character known as a +.IR "conversion specifier character". +All other character sequences are +.IR "ordinary character sequences". +.PP +The characters of ordinary character sequences (including the null byte) +are copied verbatim from \fIformat\fP to \fIs\fP. However, the characters +of conversion specifications are replaced as follows: +.TP +.B %a +The abbreviated weekday name according to the current locale. +.TP +.B %A +The full weekday name according to the current locale. +.TP +.B %b +The abbreviated month name according to the current locale. +.TP +.B %B +The full month name according to the current locale. +.TP +.B %c +The preferred date and time representation for the current locale. +.TP +.B %C +The century number (year/100) as a 2-digit integer. (SU) +.TP +.B %d +The day of the month as a decimal number (range 01 to 31). +.TP +.B %D +Equivalent to +.BR %m/%d/%y . +(Yecch \(em for Americans only. +Americans should note that in other countries +.B %d/%m/%y +is rather common. +This means that in international context this format is +ambiguous and should not be used.) (SU) +.TP +.B %e +Like +.BR %d , +the day of the month as a decimal number, but a leading +zero is replaced by a space. (SU) +.TP +.B %E +Modifier: use alternative format, see below. (SU) +.TP +.B %F +Equivalent to +.B %Y-%m-%d +(the ISO\ 8601 date format). (C99) +.TP +.B %G +The ISO\ 8601 week-based year (see NOTES) with century as a decimal number. +The 4-digit year corresponding to the ISO week number (see +.BR %V ). +This has the same format and value as +.BR %Y , +except that if the ISO week number belongs to the previous or next year, +that year is used instead. (TZ) +.TP +.B %g +Like +.BR %G , +but without century, that is, with a 2-digit year (00-99). (TZ) +.TP +.B %h +Equivalent to +.BR %b . +(SU) +.TP +.B %H +The hour as a decimal number using a 24-hour clock (range 00 to 23). +.TP +.B %I +The hour as a decimal number using a 12-hour clock (range 01 to 12). +.TP +.B %j +The day of the year as a decimal number (range 001 to 366). +.TP +.B %k +The hour (24-hour clock) as a decimal number (range 0 to 23); +single digits are preceded by a blank. +(See also +.BR %H .) +(TZ) +.TP +.B %l +The hour (12-hour clock) as a decimal number (range 1 to 12); +single digits are preceded by a blank. +(See also +.BR %I .) +(TZ) +.TP +.B %m +The month as a decimal number (range 01 to 12). +.TP +.B %M +The minute as a decimal number (range 00 to 59). +.TP +.B %n +A newline character. (SU) +.TP +.B %O +Modifier: use alternative format, see below. (SU) +.TP +.B %p +Either "AM" or "PM" according to the given time value, or the +corresponding strings for the current locale. +Noon is treated as "PM" and midnight as "AM". +.TP +.B %P +Like +.B %p +but in lowercase: "am" or "pm" or a corresponding +string for the current locale. (GNU) +.TP +.B %r +The time in a.m. or p.m. notation. +In the POSIX locale this is equivalent to +.BR "%I:%M:%S %p" . +(SU) +.TP +.B %R +The time in 24-hour notation (\fB%H:%M\fP). (SU) +For a version including the seconds, see +.B %T +below. +.TP +.B %s +The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). (TZ) +.TP +.B %S +The second as a decimal number (range 00 to 60). +(The range is up to 60 to allow for occasional leap seconds.) +.TP +.B %t +A tab character. (SU) +.TP +.B %T +The time in 24-hour notation (\fB%H:%M:%S\fP). (SU) +.TP +.B %u +The day of the week as a decimal, range 1 to 7, Monday being 1. +See also +.BR %w . +(SU) +.TP +.B %U +The week number of the current year as a decimal number, +range 00 to 53, starting with the first Sunday as the first day +of week 01. +See also +.B %V +and +.BR %W . +.TP +.B %V +The ISO\ 8601 week number (see NOTES) of the current year as a decimal number, +range 01 to 53, where week 1 is the first week that has at least +4 days in the new year. +See also +.B %U +and +.BR %W . +(SU) +.TP +.B %w +The day of the week as a decimal, range 0 to 6, Sunday being 0. +See also +.BR %u . +.TP +.B %W +The week number of the current year as a decimal number, +range 00 to 53, starting with the first Monday as the first day of week 01. +.TP +.B %x +The preferred date representation for the current locale without the time. +.TP +.B %X +The preferred time representation for the current locale without the date. +.TP +.B %y +The year as a decimal number without a century (range 00 to 99). +.TP +.B %Y +The year as a decimal number including the century. +.TP +.B %z +The +.I +hhmm +or +.I -hhmm +numeric timezone (that is, the hour and minute offset from UTC). (SU) +.TP +.B %Z +The timezone or name or abbreviation. +.TP +.B %+ +.\" Nov 05 -- Not in Linux/glibc, but is in some BSDs (according to +.\" their man pages) +The date and time in +.BR date (1) +format. (TZ) +(Not supported in glibc2.) +.TP +.B %% +A literal \(aq%\(aq character. +.PP +Some conversion specifications can be modified by preceding the +conversion specifier character by the +.B E +or +.B O +.I modifier +to indicate that an alternative format should be used. +If the alternative format or specification does not exist for +the current locale, the behavior will be as if the unmodified +conversion specification were used. (SU) +The Single Unix Specification mentions +.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 , +where the effect of the +.B O +modifier is to use +alternative numeric symbols (say, roman numerals), and that of the +E modifier is to use a locale-dependent alternative representation. +.PP +The broken-down time structure \fItm\fP is defined in \fI\fP. +See also +.BR ctime (3). +.SH "RETURN VALUE" +The +.BR strftime () +function returns the number of characters placed +in the array \fIs\fP, not including the terminating null byte, +provided the string, including the terminating null byte, fits. +Otherwise, it returns 0, and the contents of the array is undefined. +(This behavior applies since at least libc 4.4.4; +very old versions of libc, such as libc 4.4.1, +would return \fImax\fP if the array was too small.) +.LP +Note that the return value 0 does not necessarily indicate an error; +for example, in many locales +.B %p +yields an empty string. +.SH ENVIRONMENT +The environment variables +.B TZ +and +.B LC_TIME +are used. +.SH "CONFORMING TO" +SVr4, C89, C99. +There are strict inclusions between the set of conversions +given in ANSI C (unmarked), those given in the Single Unix Specification +(marked SU), those given in Olson's timezone package (marked TZ), +and those given in glibc (marked GNU), except that +.B %+ +is not supported in glibc2. +On the other hand glibc2 has several more extensions. +POSIX.1 only refers to ANSI C; POSIX.2 describes under +.BR date (1) +several extensions that could apply to +.BR strftime () +as well. +The +.B %F +conversion is in C99 and POSIX.1-2001. + +In SUSv2, the +.B %S +specifier allowed a range of 00 to 61, +to allow for the theoretical possibility of a minute that +included a double leap second +(there never has been such a minute). +.SH NOTES +.SS ISO 8601 Week Dates +.BR %G , +.BR %g , +and +.BR %V +yield values calculated from the week-based year defined by the +ISO\ 8601 standard. +In this system, weeks start on a Monday, and are numbered from 01, +for the first week, up to 52 or 53, for the last week. +Week 1 is the first week where four or more days fall within the +new year (or, synonymously, week 01 is: +the first week of the year that contains a Thursday; +or, the week that has 4 January in it). +When three of fewer days of the first calendar week of the new year fall +within that year, +then the ISO 8601 week-based system counts those days as part of week 53 +of the preceding year. +For example, 1 January 2010 is a Friday, +meaning that just three days of that calendar week fall in 2010. +Thus, the ISO\ 8601 week-based system considers these days to be part of +week 53 (\fB%V\fP) of the year 2009 (\fB%G\fP) ; +week 01 of ISO\ 8601 year 2010 starts on Monday, 4 January 2010. +.SS Glibc Notes +Glibc provides some extensions for conversion specifications. +(These extensions are not specified in POSIX.1-2001, but a few other +systems provide similar features.) +.\" HP-UX and Tru64 also have features like this. +Between the \(aq%\(aq character and the conversion specifier character, +an optional +.I flag +and field +.I width +may be specified. +(These precede the +.B E +or +.B O +modifiers, if present.) + +The following flag characters are permitted: +.TP +.B _ +(underscore) +Pad a numeric result string with spaces. +.TP +.B \- +(dash) +Do not pad a numeric result string. +.TP +.B 0 +Pad a numeric result string with zeros even if the conversion +specifier character uses space-padding by default. +.TP +.B ^ +Convert alphabetic characters in result string to upper case. +.TP +.B # +Swap the case of the result string. +(This flag only works with certain conversion specifier characters, +and of these, it is only really useful with +.BR %Z .) +.PP +An optional decimal width specifier may follow the (possibly absent) flag. +If the natural size of the field is smaller than this width, +then the result string is padded (on the left) to the specified width. +.SH BUGS +Some buggy versions of +.BR gcc (1) +complain about the use of +.BR %c : +.IR "warning: `%c' yields only last 2 digits of year in some locales" . +Of course programmers are encouraged to use +.BR %c , +it gives the preferred date and time representation. +One meets all kinds of strange obfuscations +to circumvent this +.BR gcc (1) +problem. +A relatively clean one is to add an +intermediate function +.in +4n +.nf + +size_t +my_strftime(char *s, size_t max, const char *fmt, + const struct tm *tm) +{ + return strftime(s, max, fmt, tm); +} +.fi +.in + +Nowadays, +.BR gcc (1) +provides the \fI\-Wno\-format\-y2k\fP option to prevent the warning, +so that the above workaround is no longer required. +.SH EXAMPLES +.BR "RFC\ 2822-compliant date format" +(with an English locale for %a and %b) +.PP +.in +2n +"%a,\ %d\ %b\ %Y\ %T\ %z" +.PP +.BR "RFC\ 822-compliant date format" +(with an English locale for %a and %b) +.PP +.in +2n +"%a,\ %d\ %b\ %y\ %T\ %z" +.SS Example Program +The program below can be used to experiment with +.BR strftime (). +.PP +Some examples of the result string produced by the glibc implementation of +.BR strftime () +are as follows: +.in +4n +.nf + +.RB "$" " ./a.out \(aq%m\(aq" +Result string is "11" +.RB "$" " ./a.out \(aq%5m\(aq" +Result string is "00011" +.RB "$" " ./a.out \(aq%_5m\(aq" +Result string is " 11" +.fi +.in +.PP +Here's the program source: +.nf + +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + char outstr[200]; + time_t t; + struct tm *tmp; + + t = time(NULL); + tmp = localtime(&t); + if (tmp == NULL) { + perror("localtime"); + exit(EXIT_FAILURE); + } + + if (strftime(outstr, sizeof(outstr), argv[1], tmp) == 0) { + fprintf(stderr, "strftime returned 0"); + exit(EXIT_FAILURE); + } + + printf("Result string is \\"%s\\"\\n", outstr); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR date (1), +.BR time (2), +.BR ctime (3), +.BR setlocale (3), +.BR sprintf (3), +.BR strptime (3) diff --git a/original/man3/string.3 b/original/man3/string.3 new file mode 100644 index 00000000..00e55e4c --- /dev/null +++ b/original/man3/string.3 @@ -0,0 +1,116 @@ +.\" 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 Sun Jul 25 10:54:31 1993, Rik Faith (faith@cs.unc.edu) +.TH STRING 3 2010-02-25 "" "Linux Programmer's Manual" +.SH NAME +stpcpy, strcasecmp, strcat, strchr, strcmp, strcoll, strcpy, strcspn, +strdup, strfry, strlen, strncat, strncmp, strncpy, strncasecmp, strpbrk, +strrchr, strsep, strspn, strstr, strtok, strxfrm, index, rindex +\- string operations +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int strcasecmp(const char *" s1 ", const char *" s2 ); +.sp +.BI "int strncasecmp(const char *" s1 ", const char *" s2 ", size_t " n ); +.sp +.BI "char *index(const char *" s ", int " c ); +.sp +.BI "char *rindex(const char *" s ", int " c ); +.sp +.B #include +.sp +.BI "char *stpcpy(char *" dest ", const char *" src ); +.sp +.BI "char *strcat(char *" dest ", const char *" src ); +.sp +.BI "char *strchr(const char *" s ", int " c ); +.sp +.BI "int strcmp(const char *" s1 ", const char *" s2 ); +.sp +.BI "int strcoll(const char *" s1 ", const char *" s2 ); +.sp +.BI "char *strcpy(char *" dest ", const char *" src ); +.sp +.BI "size_t strcspn(const char *" s ", const char *" reject ); +.sp +.BI "char *strdup(const char *" s ); +.sp +.BI "char *strfry(char *" string ); +.sp +.BI "size_t strlen(const char *" s ); +.sp +.BI "char *strncat(char *" dest ", const char *" src ", size_t " n ); +.sp +.BI "int strncmp(const char *" s1 ", const char *" s2 ", size_t " n ); +.sp +.BI "char *strncpy(char *" dest ", const char *" src ", size_t " n ); +.sp +.BI "char *strpbrk(const char *" s ", const char *" accept ); +.sp +.BI "char *strrchr(const char *" s ", int " c ); +.sp +.BI "char *strsep(char **" stringp ", const char *" delim ); +.sp +.BI "size_t strspn(const char *" s ", const char *" accept ); +.sp +.BI "char *strstr(const char *" haystack ", const char *" needle ); +.sp +.BI "char *strtok(char *" s ", const char *" delim ); +.sp +.BI "size_t strxfrm(char *" dest ", const char *" src ", size_t " n ); +.fi +.SH DESCRIPTION +The string functions perform string operations on null-terminated +strings. +See the individual man pages for descriptions of each function. +.SH "SEE ALSO" +.BR index (3), +.BR rindex (3), +.BR strcasecmp (3), +.BR stpcpy (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) diff --git a/original/man3/strlen.3 b/original/man3/strlen.3 new file mode 100644 index 00000000..e7e51837 --- /dev/null +++ b/original/man3/strlen.3 @@ -0,0 +1,51 @@ +.\" 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 Sat Jul 24 18:02:26 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRLEN 3 1993-04-12 "" "Linux Programmer's Manual" +.SH NAME +strlen \- calculate the length of a string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t strlen(const char *" s ); +.fi +.SH DESCRIPTION +The +.BR strlen () +function calculates the length of the string +\fIs\fP, not including the terminating \(aq\\0\(aq character. +.SH "RETURN VALUE" +The +.BR strlen () +function returns the number of characters in \fIs\fP. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99. +.SH "SEE ALSO" +.BR string (3), +.BR wcslen (3), +.BR wcsnlen (3) diff --git a/original/man3/strncasecmp.3 b/original/man3/strncasecmp.3 new file mode 100644 index 00000000..fd3b6715 --- /dev/null +++ b/original/man3/strncasecmp.3 @@ -0,0 +1 @@ +.so man3/strcasecmp.3 diff --git a/original/man3/strncat.3 b/original/man3/strncat.3 new file mode 100644 index 00000000..dc3a1ca1 --- /dev/null +++ b/original/man3/strncat.3 @@ -0,0 +1 @@ +.so man3/strcat.3 diff --git a/original/man3/strncmp.3 b/original/man3/strncmp.3 new file mode 100644 index 00000000..1007f434 --- /dev/null +++ b/original/man3/strncmp.3 @@ -0,0 +1 @@ +.so man3/strcmp.3 diff --git a/original/man3/strncpy.3 b/original/man3/strncpy.3 new file mode 100644 index 00000000..ff7476a8 --- /dev/null +++ b/original/man3/strncpy.3 @@ -0,0 +1 @@ +.so man3/strcpy.3 diff --git a/original/man3/strndup.3 b/original/man3/strndup.3 new file mode 100644 index 00000000..2dd8f88c --- /dev/null +++ b/original/man3/strndup.3 @@ -0,0 +1 @@ +.so man3/strdup.3 diff --git a/original/man3/strndupa.3 b/original/man3/strndupa.3 new file mode 100644 index 00000000..2dd8f88c --- /dev/null +++ b/original/man3/strndupa.3 @@ -0,0 +1 @@ +.so man3/strdup.3 diff --git a/original/man3/strnlen.3 b/original/man3/strnlen.3 new file mode 100644 index 00000000..57b13c35 --- /dev/null +++ b/original/man3/strnlen.3 @@ -0,0 +1,43 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" +.TH STRNLEN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +strnlen \- determine the length of a fixed-size string +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.sp +.B #include +.sp +.BI "size_t strnlen(const char *" s ", size_t " maxlen ); +.fi +.SH DESCRIPTION +The +.BR strnlen () +function returns the number of characters in the string +pointed to by \fIs\fP, not including the terminating \(aq\\0\(aq character, +but at most \fImaxlen\fP. +In doing this, +.BR strnlen () +looks only at the first +\fImaxlen\fP characters at \fIs\fP and never beyond \fIs+maxlen\fP. +.SH "RETURN VALUE" +The +.BR strnlen () +function returns \fIstrlen(s)\fP, if that is less than +\fImaxlen\fP, or \fImaxlen\fP +if there is no \(aq\\0\(aq character among the first +\fImaxlen\fP characters pointed to by \fIs\fP. +.SH "CONFORMING TO" +This function is a GNU extension. +.SH "SEE ALSO" +.BR strlen (3), +.BR feature_test_macros (7) diff --git a/original/man3/strpbrk.3 b/original/man3/strpbrk.3 new file mode 100644 index 00000000..2e161fe7 --- /dev/null +++ b/original/man3/strpbrk.3 @@ -0,0 +1,59 @@ +.\" 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 Sat Jul 24 18:01:24 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRPBRK 3 1993-04-12 "" "Linux Programmer's Manual" +.SH NAME +strpbrk \- search a string for any of a set of characters +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *strpbrk(const char *" s ", const char *" accept ); +.fi +.SH DESCRIPTION +The +.BR strpbrk () +function locates the first occurrence in the +string \fIs\fP of any of the characters in the string \fIaccept\fP. +.SH "RETURN VALUE" +The +.BR strpbrk () +function returns a pointer to the character in +\fIs\fP that matches one of the characters in \fIaccept\fP, or NULL +if no such character is found. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99. +.SH "SEE ALSO" +.BR index (3), +.BR memchr (3), +.BR rindex (3), +.BR strchr (3), +.BR strsep (3), +.BR strspn (3), +.BR strstr (3), +.BR strtok (3), +.BR wcspbrk (3) diff --git a/original/man3/strptime.3 b/original/man3/strptime.3 new file mode 100644 index 00000000..ffcb4e9c --- /dev/null +++ b/original/man3/strptime.3 @@ -0,0 +1,414 @@ +.\" Copyright 1993 Mitchum DSouza +.\" +.\" 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, jmv@lucifer.dorms.spbu.ru, 1999-11-08 +.\" Modified, aeb, 2000-04-07 +.\" Updated from glibc docs, C. Scott Ananian, 2001-08-25 +.\" Modified, aeb, 2001-08-31 +.\" Modified, wharms 2001-11-12, remark on white space and example +.\" +.TH STRPTIME 3 2009-12-05 "GNU" "Linux Programmer's Manual" +.SH NAME +strptime \- convert a string representation of time to a time tm structure +.SH SYNOPSIS +.BR "#define _XOPEN_SOURCE" " /* glibc2 needs this */" +.br +.B #include +.sp +.BI "char *strptime(const char *" s ", const char *" format , +.BI "struct tm *" tm ); +.SH DESCRIPTION +The +.BR strptime () +function is the converse function to +.BR strftime (3) +and converts the character string pointed to by +.I s +to values which are stored in the +.I tm +structure pointed to by +.IR tm , +using the format specified by +.IR format . +Here +.I format +is a character string that consists of field descriptors and text characters, +reminiscent of +.BR scanf (3). +Each field descriptor consists of a +.B % +character followed by another character that specifies the replacement +for the field descriptor. +All other characters in the +.I format +string must have a matching character in the input string, +except for whitespace, which matches zero or more +whitespace characters in the input string. +There should be white\%space or other alphanumeric characters +between any two field descriptors. +.PP +The +.BR strptime () +function processes the input string from left +to right. +Each of the three possible input elements (whitespace, +literal, or format) are handled one after the other. +If the input cannot be matched to the format string the function stops. +The remainder of the format and input strings are not processed. +.PP +The supported input field descriptors are listed below. +In case a text string (such as a weekday or month name) +is to be matched, the comparison is case insensitive. +In case a number is to be matched, leading zeros are +permitted but not required. +.TP +.B %% +The +.B % +character. +.TP +.BR %a " or " %A +The weekday name according to the current locale, +in abbreviated form or the full name. +.TP +.BR %b " or " %B " or " %h +The month name according to the current locale, +in abbreviated form or the full name. +.TP +.B %c +The date and time representation for the current locale. +.TP +.B %C +The century number (0-99). +.TP +.BR %d " or " %e +The day of month (1-31). +.TP +.B %D +Equivalent to +.BR %m/%d/%y . +(This is the American style date, very confusing +to non-Americans, especially since +.B %d/%m/%y +is widely used in Europe. +The ISO 8601 standard format is +.BR %Y-%m-%d .) +.TP +.B %H +The hour (0-23). +.TP +.B %I +The hour on a 12-hour clock (1-12). +.TP +.B %j +The day number in the year (1-366). +.TP +.B %m +The month number (1-12). +.TP +.B %M +The minute (0-59). +.TP +.B %n +Arbitrary whitespace. +.TP +.B %p +The locale's equivalent of AM or PM. +(Note: there may be none.) +.TP +.B %r +The 12-hour clock time (using the locale's AM or PM). +In the POSIX locale equivalent to +.BR "%I:%M:%S %p" . +If \fIt_fmt_ampm\fP is empty in the +.B LC_TIME +part of the current locale +then the behavior is undefined. +.TP +.B %R +Equivalent to +.BR %H:%M . +.TP +.B %S +The second (0-60; 60 may occur for leap seconds; +earlier also 61 was allowed). +.TP +.B %t +Arbitrary whitespace. +.TP +.B %T +Equivalent to +.BR %H:%M:%S . +.TP +.B %U +The week number with Sunday the first day of the week (0-53). +The first Sunday of January is the first day of week 1. +.TP +.B %w +The weekday number (0-6) with Sunday = 0. +.TP +.B %W +The week number with Monday the first day of the week (0-53). +The first Monday of January is the first day of week 1. +.TP +.B %x +The date, using the locale's date format. +.TP +.B %X +The time, using the locale's time format. +.TP +.B %y +The year within century (0-99). +When a century is not otherwise specified, values in the range 69-99 refer +to years in the twentieth century (1969-1999); values in the +range 00-68 refer to years in the twenty-first century (2000-2068). +.TP +.B %Y +The year, including century (for example, 1991). +.LP +Some field descriptors can be modified by the E or O modifier characters +to indicate that an alternative format or specification should be used. +If the +alternative format or specification does not exist in the current locale, the +unmodified field descriptor is used. +.LP +The E modifier specifies that the input string may contain +alternative locale-dependent versions of the date and time representation: +.TP +.B %Ec +The locale's alternative date and time representation. +.TP +.B %EC +The name of the base year (period) in the locale's alternative representation. +.TP +.B %Ex +The locale's alternative date representation. +.TP +.B %EX +The locale's alternative time representation. +.TP +.B %Ey +The offset from +.B %EC +(year only) in the locale's alternative representation. +.TP +.B %EY +The full alternative year representation. +.LP +The O modifier specifies that the numerical input may be in an +alternative locale-dependent format: +.TP +.BR %Od " or " %Oe +The day of the month using the locale's alternative numeric symbols; +leading zeros are permitted but not required. +.TP +.B %OH +The hour (24-hour clock) using the locale's alternative numeric symbols. +.TP +.B %OI +The hour (12-hour clock) using the locale's alternative numeric symbols. +.TP +.B %Om +The month using the locale's alternative numeric symbols. +.TP +.B %OM +The minutes using the locale's alternative numeric symbols. +.TP +.B %OS +The seconds using the locale's alternative numeric symbols. +.TP +.B %OU +The week number of the year (Sunday as the first day of the week) +using the locale's alternative numeric symbols. +.TP +.B %Ow +The number of the weekday (Sunday=0) using the locale's alternative +numeric symbols. +.TP +.B %OW +The week number of the year (Monday as the first day of the week) +using the locale's alternative numeric symbols. +.TP +.B %Oy +The year (offset from +.BR %C ) +using the locale's alternative numeric symbols. +.LP +The broken-down time structure \fItm\fP is defined in \fI\fP +as follows: +.sp +.in +4n +.nf +struct tm { + int tm_sec; /* seconds */ + int tm_min; /* minutes */ + int tm_hour; /* hours */ + int tm_mday; /* day of the month */ + int tm_mon; /* month */ + int tm_year; /* year */ + int tm_wday; /* day of the week */ + int tm_yday; /* day in the year */ + int tm_isdst; /* daylight saving time */ +}; +.fi +.in +.SH "RETURN VALUE" +The return value of the function is a pointer to the first character +not processed in this function call. +In case the input string +contains more characters than required by the format string the return +value points right after the last consumed input character. +In case +the whole input string is consumed the return value points to the null +byte at the end of the string. +If +.BR strptime () +fails to match all +of the format string and therefore an error occurred the function +returns NULL. +.SH "CONFORMING TO" +SUSv2, POSIX.1-2001. +.SH NOTES +.LP +In principle, this function does not initialize \fItm\fP but +only stores the values specified. +This means that \fItm\fP should be initialized before the call. +Details differ a bit between different Unix systems. +The glibc implementation does not touch those fields which are not +explicitly specified, except that it recomputes the +.I tm_wday +and +.I tm_yday +field if any of the year, month, or day elements changed. +.PP +This function is available since libc 4.6.8. +Linux libc4 and libc5 includes define the prototype unconditionally; +glibc2 includes provide a prototype only when +.B _XOPEN_SOURCE +or +.B _GNU_SOURCE +are defined. +.PP +Before libc 5.4.13 whitespace +(and the \(aqn\(aq and \(aqt\(aq specifications) was not handled, +no \(aqE\(aq and \(aqO\(aq locale modifier characters were accepted, +and the \(aqC\(aq specification was a synonym for the \(aqc\(aq specification. +.PP +The \(aqy\(aq (year in century) specification is taken to specify a year +in the 20th century by libc4 and libc5. +It is taken to be a year +in the range 1950-2049 by glibc 2.0. +It is taken to be a year in +1969-2068 since glibc 2.1. +.\" In libc4 and libc5 the code for %I is broken (fixed in glibc; +.\" %OI was fixed in glibc 2.2.4). +.SS Glibc Notes +For reasons of symmetry, glibc tries to support for +.BR strptime () +the same format characters as for +.BR strftime (3). +(In most cases the corresponding fields are parsed, but no field in \fItm\fP +is changed.) +This leads to +.TP +.B %F +Equivalent to \fB%Y-%m-%d\fP, the ISO 8601 date format. +.TP +.B %g +The year corresponding to the ISO week number, but without the century +(0-99). +.TP +.B %G +The year corresponding to the ISO week number. +(For example, 1991.) +.TP +.B %u +The day of the week as a decimal number (1-7, where Monday = 1). +.TP +.B %V +The ISO 8601:1988 week number as a decimal number (1-53). +If the week (starting on Monday) containing 1 January has four or more days +in the new year, then it is considered week 1. +Otherwise, it is the last week +of the previous year, and the next week is week 1. +.TP +.B %z +An RFC-822/ISO 8601 standard timezone specification. +.TP +.B %Z +The timezone name. +.LP +Similarly, because of GNU extensions to +.BR strftime (3), +.B %k +is accepted as a synonym for +.BR %H , +and +.B %l +should be accepted +as a synonym for +.BR %I , +and +.B %P +is accepted as a synonym for +.BR %p . +Finally +.TP +.B %s +The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). +Leap seconds are not counted unless leap second support is available. +.LP +The glibc implementation does not require whitespace between +two field descriptors. +.SH EXAMPLE +The following example demonstrates the use of +.BR strptime () +and +.BR strftime (3). +.sp +.nf +#define _XOPEN_SOURCE +#include +#include +#include +#include + +int +main(void) +{ + struct tm tm; + char buf[255]; + + memset(&tm, 0, sizeof(struct tm)); + strptime("2001\-11\-12 18:31:01", "%Y\-%m\-%d %H:%M:%S", &tm); + strftime(buf, sizeof(buf), "%d %b %Y %H:%M", &tm); + puts(buf); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR time (2), +.BR getdate (3), +.BR scanf (3), +.BR setlocale (3), +.BR strftime (3), +.BR feature_test_macros (7) diff --git a/original/man3/strrchr.3 b/original/man3/strrchr.3 new file mode 100644 index 00000000..322b7a89 --- /dev/null +++ b/original/man3/strrchr.3 @@ -0,0 +1 @@ +.so man3/strchr.3 diff --git a/original/man3/strsep.3 b/original/man3/strsep.3 new file mode 100644 index 00000000..d1552863 --- /dev/null +++ b/original/man3/strsep.3 @@ -0,0 +1,94 @@ +.\" 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 Sat Jul 24 18:00:10 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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) +.\" +.TH STRSEP 3 2009-01-16 "GNU" "Linux Programmer's Manual" +.SH NAME +strsep \- extract token from string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *strsep(char **" stringp ", const char *" delim ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR strsep (): +_BSD_SOURCE +.SH DESCRIPTION +If \fI*stringp\fP is NULL, the +.BR strsep () +function returns NULL +and does nothing else. +Otherwise, this function finds the first token +in the string \fI*stringp\fP, where tokens +are delimited by symbols in the string \fIdelim\fP. +This token is terminated with a \(aq\\0\(aq character +(by overwriting the delimiter) +and \fI*stringp\fP is updated to point past the token. +In case no delimiter was found, the token is taken to be +the entire string \fI*stringp\fP, and \fI*stringp\fP is made NULL. +.SH "RETURN VALUE" +The +.BR strsep () +function returns a pointer to the token, +that is, it returns the original value of \fI*stringp\fP. +.SH "CONFORMING TO" +4.4BSD. +.SH NOTES +The +.BR strsep () +function was introduced as a replacement for +.BR strtok (3), +since the latter cannot handle empty fields. +However, +.BR strtok (3) +conforms to C89/C99 and hence is more portable. +.SH BUGS +Be cautious when using this function. +If you do use it, note that: +.IP * 2 +This function modifies its first argument. +.IP * +This function cannot be used on constant strings. +.IP * +The identity of the delimiting character is lost. +.SH "SEE ALSO" +.BR index (3), +.BR memchr (3), +.BR rindex (3), +.BR strchr (3), +.BR strpbrk (3), +.BR strspn (3), +.BR strstr (3), +.BR strtok (3) diff --git a/original/man3/strsignal.3 b/original/man3/strsignal.3 new file mode 100644 index 00000000..53954da1 --- /dev/null +++ b/original/man3/strsignal.3 @@ -0,0 +1,69 @@ +.\" 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 Sat Jul 24 17:59:03 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRSIGNAL 3 2008-08-21 "GNU" "Linux Programmer's Manual" +.SH NAME +strsignal \- return string describing signal +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *strsignal(int " sig ); +.sp +.BI "extern const char * const " sys_siglist []; +.fi +.SH DESCRIPTION +The +.BR strsignal () +function returns a string describing the signal +number passed in the argument \fIsig\fP. +The string can only be used +until the next call to +.BR strsignal (). +.PP +The array \fIsys_siglist\fP holds the signal description strings +indexed by signal number. +The +.BR strsignal () +function should be +used if possible instead of this array. +.SH "RETURN VALUE" +The +.BR strsignal () +function returns the appropriate description +string, or an unknown signal message if the signal number is invalid. +On some systems (but not on Linux), a NULL pointer may be +returned instead for an invalid signal number. +.SH "CONFORMING TO" +POSIX.1-2008. +Present on Solaris and the BSDs. +.SH "SEE ALSO" +.BR psignal (3), +.BR strerror (3), +.BR feature_test_macros (7) diff --git a/original/man3/strspn.3 b/original/man3/strspn.3 new file mode 100644 index 00000000..71b0f6ef --- /dev/null +++ b/original/man3/strspn.3 @@ -0,0 +1,75 @@ +.\" 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 Sat Jul 24 17:57:50 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRSPN 3 1993-04-12 "" "Linux Programmer's Manual" +.SH NAME +strspn, strcspn \- search a string for a set of characters +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t strspn(const char *" s ", const char *" accept ); +.sp +.BI "size_t strcspn(const char *" s ", const char *" reject ); +.fi +.SH DESCRIPTION +The +.BR strspn () +function calculates the length of the initial +segment of \fIs\fP which consists entirely of characters in +\fIaccept\fP. +.PP +The +.BR strcspn () +function calculates the length of the initial +segment of \fIs\fP which consists entirely of characters not in +\fIreject\fP. +.SH "RETURN VALUE" +The +.BR strspn () +function returns the number of characters in +the initial segment of \fIs\fP which consist only of characters +from \fIaccept\fP. +.PP +The +.BR strcspn () +function returns the number of characters in +the initial segment of \fIs\fP which are not in the string +\fIreject\fP. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99. +.SH "SEE ALSO" +.BR index (3), +.BR memchr (3), +.BR rindex (3), +.BR strchr (3), +.BR strpbrk (3), +.BR strsep (3), +.BR strstr (3), +.BR strtok (3), +.BR wcscspn (3), +.BR wcsspn (3) diff --git a/original/man3/strstr.3 b/original/man3/strstr.3 new file mode 100644 index 00000000..c64ad584 --- /dev/null +++ b/original/man3/strstr.3 @@ -0,0 +1,85 @@ +.\" 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 Sat Jul 24 17:56:43 1993 by Rik Faith (faith@cs.unc.edu) +.\" Added history, aeb, 980113. +.\" 2005-05-05 mtk: added strcasestr() +.\" +.TH STRSTR 3 2005-04-05 "GNU" "Linux Programmer's Manual" +.SH NAME +strstr, strcasestr \- locate a substring +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *strstr(const char *" haystack ", const char *" needle ); +.sp +.B #define _GNU_SOURCE +.sp +.B #include +.sp +.BI "char *strcasestr(const char *" haystack ", const char *" needle ); +.fi +.SH DESCRIPTION +The +.BR strstr () +function finds the first occurrence of the substring +\fIneedle\fP in the string \fIhaystack\fP. +The terminating \(aq\\0\(aq characters are not compared. + +The +.BR strcasestr () +function is like +.BR strstr (), +but ignores the case of both arguments. +.SH "RETURN VALUE" +These functions return a pointer to the beginning of the +substring, or NULL if the substring is not found. +.SH "CONFORMING TO" +The +.BR strstr () +function conforms to C89 and C99. +The +.BR strcasestr () +function is a nonstandard extension. +.SH BUGS +Early versions of Linux libc (like 4.5.26) would not allow +an empty \fIneedle\fP argument for +.BR strstr (). +Later versions (like 4.6.27) work correctly, +and return \fIhaystack\fP when \fIneedle\fP is empty. +.SH "SEE ALSO" +.BR index (3), +.BR memchr (3), +.BR rindex (3), +.BR strcasecmp (3), +.BR strchr (3), +.BR strpbrk (3), +.BR strsep (3), +.BR strspn (3), +.BR strtok (3), +.BR wcsstr (3), +.BR feature_test_macros (7) diff --git a/original/man3/strtod.3 b/original/man3/strtod.3 new file mode 100644 index 00000000..32cc136d --- /dev/null +++ b/original/man3/strtod.3 @@ -0,0 +1,175 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)strtod.3 5.3 (Berkeley) 6/29/91 +.\" +.\" Modified Sun Aug 21 17:16:22 1994 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sat May 04 19:34:31 MET DST 1996 by Michael Haardt +.\" (michael@cantor.informatik.rwth-aachen.de) +.\" Added strof, strtold, aeb, 2001-06-07 +.\" +.TH STRTOD 3 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH NAME +strtod, strtof, strtold \- convert ASCII string to floating-point number +.SH SYNOPSIS +.B #include +.sp +.BI "double strtod(const char *" nptr ", char **" endptr ); +.br +.BI "float strtof(const char *" nptr ", char **" endptr ); +.br +.BI "long double strtold(const char *" nptr ", char **" endptr ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR strtof (), +.BR strtold (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.SH DESCRIPTION +The +.BR strtod (), +.BR strtof (), +and +.BR strtold () +functions convert the initial portion of the string pointed to by +.I nptr +to +.IR double , +.IR float , +and +.I long double +representation, respectively. + +The expected form of the (initial portion of the) string is +optional leading white space as recognized by +.BR isspace (3), +an optional plus (\(aq+\(aq) or minus sign (\(aq\-\(aq) and then either +(i) a decimal number, or (ii) a hexadecimal number, +or (iii) an infinity, or (iv) a NAN (not-a-number). +.LP +A +.I "decimal number" +consists of a nonempty sequence of decimal digits +possibly containing a radix character (decimal point, locale-dependent, +usually \(aq.\(aq), optionally followed by a decimal exponent. +A decimal exponent consists of an \(aqE\(aq or \(aqe\(aq, followed by an +optional plus or minus sign, followed by a nonempty sequence of +decimal digits, and indicates multiplication by a power of 10. +.LP +A +.I "hexadecimal number" +consists of a "0x" or "0X" followed by a nonempty sequence of +hexadecimal digits possibly containing a radix character, +optionally followed by a binary exponent. +A binary exponent +consists of a \(aqP\(aq or \(aqp\(aq, followed by an optional +plus or minus sign, followed by a nonempty sequence of +decimal digits, and indicates multiplication by a power of 2. +At least one of radix character and binary exponent must be present. +.LP +An +.I infinity +is either "INF" or "INFINITY", disregarding case. +.LP +A +.I NAN +is "NAN" (disregarding case) optionally followed by \(aq(\(aq, +a sequence of characters, followed by \(aq)\(aq. +The character string specifies in an implementation-dependent +way the type of 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. +.SH "RETURN VALUE" +These functions return the converted value, if any. + +If +.I endptr +is not NULL, +a pointer to the character after the last character used in the conversion +is stored in the location referenced by +.IR endptr . + +If no conversion is performed, zero is returned and the value of +.I nptr +is stored in the location referenced by +.IR endptr . + +If the correct value would cause overflow, plus or minus +.B HUGE_VAL +.RB ( HUGE_VALF , +.BR HUGE_VALL ) +is returned (according to the sign of the value), and +.B ERANGE +is stored in +.IR errno . +If the correct value would cause underflow, zero is +returned and +.B ERANGE +is stored in +.IR errno . +.SH ERRORS +.TP +.B ERANGE +Overflow or underflow occurred. +.SH "CONFORMING TO" +C89 describes +.BR strtod (), +C99 +describes the other two functions. +.SH NOTES +Since +0 can legitimately be returned +on both success and failure, the calling program should set +.I errno +to 0 before the call, +and then determine if an error occurred by checking whether +.I errno +has a nonzero value after the call. +.SH EXAMPLE +See the example on the +.BR strtol (3) +manual page; +the use of the functions described in this manual page is similar. +.SH "SEE ALSO" +.BR atof (3), +.BR atoi (3), +.BR atol (3), +.BR strtol (3), +.BR strtoul (3) diff --git a/original/man3/strtof.3 b/original/man3/strtof.3 new file mode 100644 index 00000000..ac3e4a55 --- /dev/null +++ b/original/man3/strtof.3 @@ -0,0 +1 @@ +.so man3/strtod.3 diff --git a/original/man3/strtoimax.3 b/original/man3/strtoimax.3 new file mode 100644 index 00000000..f83a28a1 --- /dev/null +++ b/original/man3/strtoimax.3 @@ -0,0 +1,64 @@ +.\" 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. +.\" +.TH STRTOIMAX 3 2003-11-28 "" "Linux Programmer's Manual" +.SH NAME +strtoimax, strtoumax \- convert string to integer +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "intmax_t strtoimax(const char *" nptr ", char **" endptr ", int " base ); +.br +.BI "uintmax_t strtoumax(const char *" nptr ", char **" endptr ", int " base ); +.fi +.SH DESCRIPTION +These functions are just like +.BR strtol (3) +and +.BR strtoul (3), +except that they return a value of type +.I intmax_t +and +.IR uintmax_t , +respectively. +.SH "RETURN VALUE" +On success, the converted value is returned. +If nothing was found to convert, zero is returned. +On overflow or underflow +.B INTMAX_MAX +or +.B INTMAX_MIN +or +.B UINTMAX_MAX +is returned, and +.I errno +is set to +.BR ERANGE . +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH "SEE ALSO" +.BR imaxabs (3), +.BR imaxdiv (3), +.BR strtol (3), +.BR strtoul (3), +.BR wcstoimax (3) diff --git a/original/man3/strtok.3 b/original/man3/strtok.3 new file mode 100644 index 00000000..e4da37c2 --- /dev/null +++ b/original/man3/strtok.3 @@ -0,0 +1,205 @@ +.\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl) +.\" and Copyright (C) 2005 Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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. +.\" +.\" Rewritten old page, 960210, aeb@cwi.nl +.\" Updated, added strtok_r. 2000-02-13 Nicolás Lichtmaier +.\" 2005-11-17, mtk: Substantial parts rewritten +.\" +.TH STRTOK 3 2008-10-29 "GNU" "Linux Programmer's Manual" +.SH NAME +strtok, strtok_r \- extract tokens from strings +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *strtok(char *" str ", const char *" delim ); +.sp +.BI "char *strtok_r(char *" str ", const char *" delim ", char **" saveptr ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR strtok_r (): +_SVID_SOURCE || _BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 1 || +_XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH DESCRIPTION +The +.BR strtok () +function parses a string into a sequence of tokens. +On the first call to +.BR strtok () +the string to be parsed should be +specified in \fIstr\fP. +In each subsequent call that should parse the same string, +\fIstr\fP should be NULL. + +The \fIdelim\fP argument specifies a set of characters that +delimit the tokens in the parsed string. +The caller may specify different strings in \fIdelim\fP in successive +calls that parse the same string. + +Each call to +.BR strtok () +returns a pointer to a +null-terminated string containing the next token. +This string does not include the delimiting character. +If no more tokens are found, +.BR strtok () +returns NULL. + +A sequence of two or more contiguous delimiter characters in +the parsed string is considered to be a single delimiter. +Delimiter characters at the start or end of the string are ignored. +Put another way: the tokens returned by +.BR strtok () +are always nonempty strings. + +The +.BR strtok_r () +function is a reentrant version +.BR strtok (). +The \fIsaveptr\fP argument is a pointer to a +\fIchar *\fP variable that is used internally by +.BR strtok_r () +in order to maintain context between successive calls that parse the +same string. + +On the first call to +.BR strtok_r (), +.I str +should point to the string to be parsed, and the value of +.I saveptr +is ignored. +In subsequent calls, \fIstr\fP should be NULL, and +\fIsaveptr\fP should be unchanged since the previous call. + +Different strings may be parsed concurrently using sequences of calls to +.BR strtok_r () +that specify different \fIsaveptr\fP arguments. +.SH "RETURN VALUE" +The +.BR strtok () +and +.BR strtok_r () +functions return a pointer to +the next token, or NULL if there are no more tokens. +.SH "CONFORMING TO" +.TP +.BR strtok () +SVr4, POSIX.1-2001, 4.3BSD, C89, C99. +.TP +.BR strtok_r () +POSIX.1-2001. +.SH BUGS +Be cautious when using these functions. +If you do use them, note that: +.IP * 2 +These functions modify their first argument. +.IP * +These functions cannot be used on constant strings. +.IP * +The identity of the delimiting character is lost. +.IP * +The +.BR strtok () +function uses a static buffer while parsing, so it's not thread safe. +Use +.BR strtok_r () +if this matters to you. +.SH EXAMPLE +The program below uses nested loops that employ +.BR strtok_r () +to break a string into a two-level hierarchy of tokens. +The first command-line argument specifies the string to be parsed. +The second argument specifies the delimiter character(s) +to be used to separate that string into "major" tokens. +The third argument specifies the delimiter character(s) +to be used to separate the "major" tokens into subtokens. +.PP +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" +1: a/bbb///cc + \-\-> a + \-\-> bbb + \-\-> cc +2: xxx + \-\-> xxx +3: yyy + \-\-> yyy +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + char *str1, *str2, *token, *subtoken; + char *saveptr1, *saveptr2; + int j; + + if (argc != 4) { + fprintf(stderr, "Usage: %s string delim subdelim\\n", + argv[0]); + exit(EXIT_FAILURE); + } + + for (j = 1, str1 = argv[1]; ; j++, str1 = NULL) { + token = strtok_r(str1, argv[2], &saveptr1); + if (token == NULL) + break; + printf("%d: %s\\n", j, token); + + for (str2 = token; ; str2 = NULL) { + subtoken = strtok_r(str2, argv[3], &saveptr2); + if (subtoken == NULL) + break; + printf("\t \-\-> %s\\n", subtoken); + } + } + + exit(EXIT_SUCCESS); +} /* main */ +.fi +.SH "SEE ALSO" +.BR index (3), +.BR memchr (3), +.BR rindex (3), +.BR strchr (3), +.BR strpbrk (3), +.BR strsep (3), +.BR strspn (3), +.BR strstr (3), +.BR wcstok (3) diff --git a/original/man3/strtok_r.3 b/original/man3/strtok_r.3 new file mode 100644 index 00000000..19095a01 --- /dev/null +++ b/original/man3/strtok_r.3 @@ -0,0 +1 @@ +.so man3/strtok.3 diff --git a/original/man3/strtol.3 b/original/man3/strtol.3 new file mode 100644 index 00000000..426fee7a --- /dev/null +++ b/original/man3/strtol.3 @@ -0,0 +1,260 @@ +.\" 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 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 +.TH STRTOL 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +strtol, strtoll, strtoq \- convert a string to a long integer +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "long int strtol(const char *" nptr ", char **" endptr ", int " base ); +.sp +.BI "long long int strtoll(const char *" nptr ", char **" endptr \ +", int " base ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR strtoll (): +XOPEN_SOURCE >= 600 || _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR strtol () +function converts the initial part of the string +in \fInptr\fP to a long integer value according to the given \fIbase\fP, +which must be between 2 and 36 inclusive, or be the special value 0. +.PP +The string may begin with an arbitrary amount of white space (as +determined by +.BR isspace (3)) +followed by a single optional \(aq+\(aq or \(aq\-\(aq sign. +If \fIbase\fP is zero or 16, the string may then include a +"0x" prefix, and the number will be read in base 16; otherwise, a +zero \fIbase\fP is taken as 10 (decimal) unless the next character +is \(aq0\(aq, in which case it is taken as 8 (octal). +.PP +The remainder of the string is converted to a +.I long int +value +in the obvious manner, stopping at the first character which is not a +valid digit in the given base. +(In bases above 10, the letter \(aqA\(aq in +either upper or lower case represents 10, \(aqB\(aq represents 11, and so +forth, with \(aqZ\(aq representing 35.) +.PP +If \fIendptr\fP is not NULL, +.BR strtol () +stores the address of the +first invalid character in \fI*endptr\fP. +If there were no digits at +all, +.BR strtol () +stores the original value of \fInptr\fP in +\fI*endptr\fP (and returns 0). +In particular, if \fI*nptr\fP is not \(aq\\0\(aq but \fI**endptr\fP +is \(aq\\0\(aq on return, the entire string is valid. +.PP +The +.BR strtoll () +function works just like the +.BR strtol () +function but returns a long long integer value. +.SH "RETURN VALUE" +The +.BR strtol () +function returns the result of the conversion, +unless the value would underflow or overflow. +If an underflow occurs, +.BR strtol () +returns +.BR LONG_MIN . +If an overflow occurs, +.BR strtol () +returns +.BR LONG_MAX . +In both cases, \fIerrno\fP is set to +.BR ERANGE . +Precisely the same holds for +.BR strtoll () +(with +.B LLONG_MIN +and +.B LLONG_MAX +instead of +.B LONG_MIN +and +.BR LONG_MAX ). +.SH ERRORS +.TP +.B EINVAL +(not in C99) +The given +.I base +contains an unsupported value. +.TP +.B ERANGE +The resulting value was out of range. +.LP +The implementation may also set \fIerrno\fP to \fBEINVAL\fP in case +no conversion was performed (no digits seen, and 0 returned). +.SH "CONFORMING TO" +.BR strtol () +conforms to SVr4, 4.3BSD, C89, C99 and POSIX.1-2001, and +.BR strtoll () +to C99 and POSIX.1-2001. +.SH NOTES +Since +.BR strtol () +can legitimately return 0, +.BR LONG_MAX , +or +.B LONG_MIN +.RB ( LLONG_MAX +or +.B LLONG_MIN +for +.BR strtoll ()) +on both success and failure, the calling program should set +.I errno +to 0 before the call, +and then determine if an error occurred by checking whether +.I errno +has a nonzero value after the call. + +In locales other than the "C" locale, other strings may also be accepted. +(For example, the thousands separator of the current locale may be +supported.) +.LP +BSD also has +.sp +.in +4n +.nf +.BI "quad_t strtoq(const char *" nptr ", char **" endptr ", int " base ); +.sp +.in +.fi +with completely analogous definition. +Depending on the wordsize of the current architecture, this +may be equivalent to +.BR strtoll () +or to +.BR strtol (). +.SH EXAMPLE +The program shown below demonstrates the use of +.BR strtol (). +The first command-line argument specifies a string from which +.BR strtol () +should parse a number. +The second (optional) argument specifies the base to be used for +the conversion. +(This argument is converted to numeric form using +.BR atoi (3), +a function that performs no error checking and +has a simpler interface than +.BR strtol ().) +Some examples of the results produced by this program are the following: +.in +4n +.nf + +.RB "$" " ./a.out 123" +strtol() returned 123 +.RB "$" " ./a.out \(aq 123\(aq" +strtol() returned 123 +.RB "$" " ./a.out 123abc" +strtol() returned 123 +Further characters after number: abc +.RB "$" " ./a.out 123abc 55" +strtol: Invalid argument +.RB "$" " ./a.out \(aq\(aq" +No digits were found +.RB "$" " ./a.out 4000000000" +strtol: Numerical result out of range +.fi +.in +.SS Program source +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int base; + char *endptr, *str; + long val; + + if (argc < 2) { + fprintf(stderr, "Usage: %s str [base]\\n", argv[0]); + exit(EXIT_FAILURE); + } + + str = argv[1]; + base = (argc > 2) ? atoi(argv[2]) : 10; + + errno = 0; /* To distinguish success/failure after call */ + val = strtol(str, &endptr, base); + + /* Check for various possible errors */ + + if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN)) + || (errno != 0 && val == 0)) { + perror("strtol"); + exit(EXIT_FAILURE); + } + + if (endptr == str) { + fprintf(stderr, "No digits were found\\n"); + exit(EXIT_FAILURE); + } + + /* If we got here, strtol() successfully parsed a number */ + + printf("strtol() returned %ld\\n", val); + + if (*endptr != \(aq\\0\(aq) /* Not necessarily an error... */ + printf("Further characters after number: %s\\n", endptr); + + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR atof (3), +.BR atoi (3), +.BR atol (3), +.BR strtod (3), +.BR strtoul (3) diff --git a/original/man3/strtold.3 b/original/man3/strtold.3 new file mode 100644 index 00000000..ac3e4a55 --- /dev/null +++ b/original/man3/strtold.3 @@ -0,0 +1 @@ +.so man3/strtod.3 diff --git a/original/man3/strtoll.3 b/original/man3/strtoll.3 new file mode 100644 index 00000000..d0903939 --- /dev/null +++ b/original/man3/strtoll.3 @@ -0,0 +1 @@ +.so man3/strtol.3 diff --git a/original/man3/strtoq.3 b/original/man3/strtoq.3 new file mode 100644 index 00000000..d0903939 --- /dev/null +++ b/original/man3/strtoq.3 @@ -0,0 +1 @@ +.so man3/strtol.3 diff --git a/original/man3/strtoul.3 b/original/man3/strtoul.3 new file mode 100644 index 00000000..656ef775 --- /dev/null +++ b/original/man3/strtoul.3 @@ -0,0 +1,188 @@ +.\" 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 Sun Jul 25 10:54:03 1993 by Rik Faith (faith@cs.unc.edu) +.\" Fixed typo, aeb, 950823 +.\" 2002-02-22, joey, mihtjel: Added strtoull() +.\" +.TH STRTOUL 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +strtoul, strtoull, strtouq \- convert a string to an unsigned long integer +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "unsigned long int strtoul(const char *" nptr ", char **" endptr \ +", int " base ); +.sp +.BI "unsigned long long int strtoull(const char *" nptr ", char **" endptr , +.BI " int " base ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR strtoull (): +XOPEN_SOURCE >= 600 || _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR strtoul () +function converts the initial part of the string +in \fInptr\fP to an +.I "unsigned long int" +value according to the +given \fIbase\fP, which must be between 2 and 36 inclusive, or be +the special value 0. +.PP +The string may begin with an arbitrary amount of white space (as +determined by +.BR isspace (3)) +followed by a single optional \(aq+\(aq or \(aq\-\(aq +sign. +If \fIbase\fP is zero or 16, the string may then include a +"0x" prefix, and the number will be read in base 16; otherwise, a +zero \fIbase\fP is taken as 10 (decimal) unless the next character +is \(aq0\(aq, in which case it is taken as 8 (octal). +.PP +The remainder of the string is converted to an +.I "unsigned long int" +value in the obvious manner, +stopping at the first character which is not a +valid digit in the given base. +(In bases above 10, the letter \(aqA\(aq in +either upper or lower case represents 10, \(aqB\(aq represents 11, and so +forth, with \(aqZ\(aq representing 35.) +.PP +If \fIendptr\fP is not NULL, +.BR strtoul () +stores the address of the +first invalid character in \fI*endptr\fP. +If there were no digits at +all, +.BR strtoul () +stores the original value of \fInptr\fP in +\fI*endptr\fP (and returns 0). +In particular, if \fI*nptr\fP is not \(aq\\0\(aq but \fI**endptr\fP +is \(aq\\0\(aq on return, the entire string is valid. +.PP +The +.BR strtoull () +function works just like the +.BR strtoul () +function but returns an +.I "unsigned long long int" +value. +.SH "RETURN VALUE" +The +.BR strtoul () +function returns either the result of the conversion +or, if there was a leading minus sign, the negation of the result of the +conversion represented as an unsigned value, +unless the original (nonnegated) value would overflow; in +the latter case, +.BR strtoul () +returns +.B ULONG_MAX +and sets \fIerrno\fP to +.BR ERANGE . +Precisely the same holds for +.BR strtoull () +(with +.B ULLONG_MAX +instead of +.BR ULONG_MAX ). +.SH ERRORS +.TP +.B EINVAL +(not in C99) +The given +.I base +contains an unsupported value. +.TP +.B ERANGE +The resulting value was out of range. +.LP +The implementation may also set \fIerrno\fP to \fBEINVAL\fP in case +no conversion was performed (no digits seen, and 0 returned). +.SH "CONFORMING TO" +.BR strtoul () +conforms to SVr4, C89, C99 and POSIX-2001, and +.BR strtoull () +to C99 and POSIX.1-2001. +.SH NOTES +Since +.BR strtoul () +can legitimately return 0 or +.B LONG_MAX +.RB ( LLONG_MAX +for +.BR strtoull ()) +on both success and failure, the calling program should set +.I errno +to 0 before the call, +and then determine if an error occurred by checking whether +.I errno +has a nonzero value after the call. + +In locales other than the "C" locale, other strings may be accepted. +(For example, the thousands separator of the current locale may be +supported.) +.LP +BSD also has +.sp +.in +4n +.nf +.BI "u_quad_t strtouq(const char *" nptr ", char **" endptr ", int " base ); +.sp +.in -4n +.fi +with completely analogous definition. +Depending on the wordsize of the current architecture, this +may be equivalent to +.BR strtoull () +or to +.BR strtoul (). + +Negative values are considered valid input and are +silently converted to the equivalent +.I "unsigned long int" +value. +.SH EXAMPLE +See the example on the +.BR strtol (3) +manual page; +the use of the functions described in this manual page is similar. +.SH "SEE ALSO" +.BR atof (3), +.BR atoi (3), +.BR atol (3), +.BR strtod (3), +.BR strtol (3) diff --git a/original/man3/strtoull.3 b/original/man3/strtoull.3 new file mode 100644 index 00000000..3340a837 --- /dev/null +++ b/original/man3/strtoull.3 @@ -0,0 +1 @@ +.so man3/strtoul.3 diff --git a/original/man3/strtoumax.3 b/original/man3/strtoumax.3 new file mode 100644 index 00000000..753be84d --- /dev/null +++ b/original/man3/strtoumax.3 @@ -0,0 +1 @@ +.so man3/strtoimax.3 diff --git a/original/man3/strtouq.3 b/original/man3/strtouq.3 new file mode 100644 index 00000000..3340a837 --- /dev/null +++ b/original/man3/strtouq.3 @@ -0,0 +1 @@ +.so man3/strtoul.3 diff --git a/original/man3/strverscmp.3 b/original/man3/strverscmp.3 new file mode 100644 index 00000000..18e4f16a --- /dev/null +++ b/original/man3/strverscmp.3 @@ -0,0 +1,93 @@ +.\" 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. +.\" +.TH STRVERSCMP 3 2001-12-19 "GNU" "Linux Programmer's Manual" +.SH NAME +strverscmp \- compare two version strings +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int strverscmp(const char *" s1 ", const char *" s2 ); +.fi +.SH DESCRIPTION +Often one has files +.IR jan1 ", " jan2 ", ..., " jan9 ", " jan10 ", ..." +and it feels wrong when +.BR ls (1) +orders them +.IR jan1 ", " jan10 ", ..., " jan2 ", ..., " jan9 . +.\" classical solution: "rename jan jan0 jan?" +In order to rectify this, GNU introduced the +.I \-v +option to +.BR ls (1), +which is implemented using +.BR versionsort (3), +which again uses +.BR strverscmp (). + +Thus, the task of +.BR strverscmp () +is to compare two strings and find the "right" order, while +.BR strcmp (3) +only finds the lexicographic order. +This function does not use +the locale category +.BR LC_COLLATE , +so is meant mostly for situations +where the strings are expected to be in ASCII. + +What this function does is the following. +If both strings are equal, return 0. +Otherwise find the position +between two bytes with the property that before it both strings are equal, +while directly after it there is a difference. +Find the largest consecutive digit strings containing (or starting at, +or ending at) this position. +If one or both of these is empty, +then return what +.BR strcmp (3) +would have returned (numerical ordering of byte values). +Otherwise, compare both digit strings numerically, where digit strings with +one or more leading zeros are interpreted as if they have a decimal point +in front (so that in particular digit strings with more leading zeros +come before digit strings with fewer leading zeros). +Thus, the ordering is +.IR 000 ", " 00 ", " 01 ", " 010 ", " 09 ", " 0 ", " 1 ", " 9 ", " 10 . +.SH "RETURN VALUE" +The +.BR strverscmp () +function returns an integer +less than, equal to, or greater than zero if \fIs1\fP +is found, respectively, to be earlier than, equal to, +or later than \fIs2\fP. +.SH "CONFORMING TO" +This function is a GNU extension. +.SH "SEE ALSO" +.BR rename (1), +.BR strcasecmp (3), +.BR strcmp (3), +.BR strcoll (3), +.BR feature_test_macros (7) diff --git a/original/man3/strxfrm.3 b/original/man3/strxfrm.3 new file mode 100644 index 00000000..71d8510f --- /dev/null +++ b/original/man3/strxfrm.3 @@ -0,0 +1,76 @@ +.\" 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 Sun Jul 25 10:41:28 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRXFRM 3 1993-04-12 "GNU" "Linux Programmer's Manual" +.SH NAME +strxfrm \- string transformation +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t strxfrm(char *" dest ", const char *" src ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR strxfrm () +function transforms the \fIsrc\fP string into a +form such that the result of +.BR strcmp (3) +on two strings that have +been transformed with +.BR strxfrm () +is the same as the result of +.BR strcoll (3) +on the two strings before their transformation. +The first \fIn\fP characters of the transformed string are placed in +\fIdest\fP. +The transformation is based on the program's current +locale for category \fBLC_COLLATE\fP. (See +.BR setlocale (3)). +.SH "RETURN VALUE" +The +.BR strxfrm () +function returns the number of bytes required to +store the transformed string in \fIdest\fP excluding the +terminating \(aq\\0\(aq character. +If the value returned is \fIn\fP or more, the +contents of \fIdest\fP are indeterminate. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99. +.SH NOTES +In the \fI"POSIX"\fP or \fI"C"\fP locales +.BR strxfrm () +is equivalent to +copying the string with +.BR strncpy (3). +.SH "SEE ALSO" +.BR bcmp (3), +.BR memcmp (3), +.BR setlocale (3), +.BR strcasecmp (3), +.BR strcmp (3), +.BR strcoll (3) diff --git a/original/man3/svc_destroy.3 b/original/man3/svc_destroy.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svc_destroy.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svc_freeargs.3 b/original/man3/svc_freeargs.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svc_freeargs.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svc_getargs.3 b/original/man3/svc_getargs.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svc_getargs.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svc_getcaller.3 b/original/man3/svc_getcaller.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svc_getcaller.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svc_getreq.3 b/original/man3/svc_getreq.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svc_getreq.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svc_getreqset.3 b/original/man3/svc_getreqset.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svc_getreqset.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svc_register.3 b/original/man3/svc_register.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svc_register.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svc_run.3 b/original/man3/svc_run.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svc_run.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svc_sendreply.3 b/original/man3/svc_sendreply.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svc_sendreply.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svc_unregister.3 b/original/man3/svc_unregister.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svc_unregister.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svcerr_auth.3 b/original/man3/svcerr_auth.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svcerr_auth.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svcerr_decode.3 b/original/man3/svcerr_decode.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svcerr_decode.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svcerr_noproc.3 b/original/man3/svcerr_noproc.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svcerr_noproc.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svcerr_noprog.3 b/original/man3/svcerr_noprog.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svcerr_noprog.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svcerr_progvers.3 b/original/man3/svcerr_progvers.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svcerr_progvers.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svcerr_systemerr.3 b/original/man3/svcerr_systemerr.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svcerr_systemerr.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svcerr_weakauth.3 b/original/man3/svcerr_weakauth.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svcerr_weakauth.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svcfd_create.3 b/original/man3/svcfd_create.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svcfd_create.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svcraw_create.3 b/original/man3/svcraw_create.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svcraw_create.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svctcp_create.3 b/original/man3/svctcp_create.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svctcp_create.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svcudp_bufcreate.3 b/original/man3/svcudp_bufcreate.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svcudp_bufcreate.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/svcudp_create.3 b/original/man3/svcudp_create.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/svcudp_create.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/swab.3 b/original/man3/swab.3 new file mode 100644 index 00000000..c131623e --- /dev/null +++ b/original/man3/swab.3 @@ -0,0 +1,60 @@ +.\" 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 Sat Jul 24 17:52:15 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2001-12-15, aeb +.TH SWAB 3 2001-12-15 "" "Linux Programmer's Manual" +.SH NAME +swab \- swap adjacent bytes +.SH SYNOPSIS +.nf +.B #define _XOPEN_SOURCE +.B #include +.sp +.BI "void swab(const void *" from ", void *" to ", ssize_t " n ); +.fi +.SH DESCRIPTION +The +.BR swab () +function copies \fIn\fP bytes from the array pointed +to by \fIfrom\fP to the array pointed to by \fIto\fP, exchanging +adjacent even and odd bytes. +This function is used to exchange data +between machines that have different low/high byte ordering. +.LP +This function does nothing when \fIn\fP is negative. +When \fIn\fP is positive and odd, it handles \fIn\-1\fP bytes +as above, and does something unspecified with the last byte. +(In other words, \fIn\fP should be even.) +.SH "RETURN VALUE" +The +.BR swab () +function returns no value. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +.SH "SEE ALSO" +.BR bstring (3), +.BR feature_test_macros (7) diff --git a/original/man3/swapcontext.3 b/original/man3/swapcontext.3 new file mode 100644 index 00000000..cdccd64e --- /dev/null +++ b/original/man3/swapcontext.3 @@ -0,0 +1 @@ +.so man3/makecontext.3 diff --git a/original/man3/swprintf.3 b/original/man3/swprintf.3 new file mode 100644 index 00000000..56ec9685 --- /dev/null +++ b/original/man3/swprintf.3 @@ -0,0 +1 @@ +.so man3/wprintf.3 diff --git a/original/man3/sys_errlist.3 b/original/man3/sys_errlist.3 new file mode 100644 index 00000000..837f1a19 --- /dev/null +++ b/original/man3/sys_errlist.3 @@ -0,0 +1 @@ +.so man3/perror.3 diff --git a/original/man3/sys_nerr.3 b/original/man3/sys_nerr.3 new file mode 100644 index 00000000..837f1a19 --- /dev/null +++ b/original/man3/sys_nerr.3 @@ -0,0 +1 @@ +.so man3/perror.3 diff --git a/original/man3/sysconf.3 b/original/man3/sysconf.3 new file mode 100644 index 00000000..f2ba8df0 --- /dev/null +++ b/original/man3/sysconf.3 @@ -0,0 +1,340 @@ +.\" 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: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) +.TH SYSCONF 3 2007-12-12 "GNU" "Linux Programmer's Manual" +.SH NAME +sysconf \- Get configuration information at runtime +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "long sysconf(int " "name" ); +.fi +.SH DESCRIPTION +POSIX allows an application to test at compile or run time +whether certain options are supported, or what the value is +of certain configurable constants or limits. +.LP +At compile time this is done by including +.I +and/or +.I +and testing the value of certain macros. +.LP +At run time, one can ask for numerical values using the present function +.BR sysconf (). +On can ask for numerical values that may depend +on the file system a file is in using the calls +.BR fpathconf (3) +and +.BR pathconf (3). +One can ask for string values using +.BR confstr (3). +.LP +The values obtained from these functions are system configuration constants. +They do not change during the lifetime of a process. +.\" except that sysconf(_SC_OPEN_MAX) may change answer after a call +.\" to setrlimit( ) which changes the RLIMIT_NOFILE soft limit +.LP +For options, typically, there is a constant +.B _POSIX_FOO +that may be defined in +.IR . +If it is undefined, one should ask at run time. +If it is defined to \-1, then the option is not supported. +If it is defined to 0, then relevant functions and headers exist, +but one has to ask at runtime what degree of support is available. +If it is defined to a value other than \-1 or 0, then the option is +supported. +Usually the value (such as 200112L) indicates the year and month +of the POSIX revision describing the option. +Glibc uses the value 1 +to indicate support as long as the POSIX revision has not been published yet. +.\" and 999 to indicate support for options no longer present in the latest +.\" standard. (?) +The +.BR sysconf () +argument will be +.BR _SC_FOO . +For a list of options, see +.BR posixoptions (7). +.LP +For variables or limits, typically, there is a constant +.BR _FOO , +maybe defined in +.IR , +or +.BR _POSIX_FOO , +maybe defined in +.IR . +The constant will not be defined if the limit is unspecified. +If the constant is defined, it gives a guaranteed value, and +a greater value might actually be supported. +If an application wants to take advantage of values which may change +between systems, a call to +.BR sysconf () +can be made. +The +.BR sysconf () +argument will be +.BR _SC_FOO . +.SS "POSIX.1 Variables" +We give the name of the variable, the name of the +.BR sysconf () +argument used to inquire about its value, +and a short description. +.LP +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. +.TP +.BR ARG_MAX " - " _SC_ARG_MAX +The maximum length of the arguments to the +.BR exec (3) +family of functions. +Must not be less than +.B _POSIX_ARG_MAX +(4096). +.TP +.BR CHILD_MAX " - " _SC_CHILD_MAX +The max number of simultaneous processes per user ID. +Must not be less than +.B _POSIX_CHILD_MAX +(25). +.TP +.BR HOST_NAME_MAX " - " _SC_HOST_NAME_MAX +Max length of a hostname, not including the terminating null byte, +as returned by +.BR gethostname (2). +Must not be less than +.B _POSIX_HOST_NAME_MAX +(255). +.TP +.BR LOGIN_NAME_MAX " - " _SC_LOGIN_NAME_MAX +Maximum length of a login name, including the terminating null byte. +Must not be less than +.B _POSIX_LOGIN_NAME_MAX +(9). +.TP +.BR "" "clock ticks - " _SC_CLK_TCK +The number of clock ticks per second. +The corresponding variable is obsolete. +It was of course called +.BR CLK_TCK . +(Note: the macro +.B CLOCKS_PER_SEC +does not give information: it must equal 1000000.) +.TP +.BR OPEN_MAX " - " _SC_OPEN_MAX +The maximum number of files that a process can have open at any time. +Must not be less than +.B _POSIX_OPEN_MAX +(20). +.TP +.BR PAGESIZE " - " _SC_PAGESIZE +Size of a page in bytes. +Must not be less than 1. +(Some systems use PAGE_SIZE instead.) +.TP +.BR RE_DUP_MAX " - " _SC_RE_DUP_MAX +The number of repeated occurrences of a BRE permitted by +.BR regexec (3) +and +.BR regcomp (3). +Must not be less than +.B _POSIX2_RE_DUP_MAX +(255). +.TP +.BR STREAM_MAX " - " _SC_STREAM_MAX +The maximum number of streams that a process can have open at any +time. +If defined, it has the same value as the standard C macro +.BR FOPEN_MAX . +Must not be less than +.B _POSIX_STREAM_MAX +(8). +.TP +.B SYMLOOP_MAX +The maximum number of symbolic links seen in a pathname before resolution +returns +.BR ELOOP . +Must not be less than +.B _POSIX_SYMLOOP_MAX +(8). +.TP +.BR TTY_NAME_MAX " - " _SC_TTY_NAME_MAX +The maximum length of terminal device name, +including the terminating null byte. +Must not be less than +.B _POSIX_TTY_NAME_MAX +(9). +.TP +.BR TZNAME_MAX " - " _SC_TZNAME_MAX +The maximum number of bytes in a timezone name. +Must not be less than +.B _POSIX_TZNAME_MAX +(6). +.TP +.BR _POSIX_VERSION " - " _SC_VERSION +indicates the year and month the POSIX.1 standard was approved in the +format +.BR YYYYMML ; +the value +.B 199009L +indicates the Sept. 1990 revision. +.SS "POSIX.2 Variables" +Next, the POSIX.2 values, giving limits for utilities. +.TP +.BR BC_BASE_MAX " - " _SC_BC_BASE_MAX +indicates the maximum +.I obase +value accepted by the +.BR bc (1) +utility. +.TP +.BR BC_DIM_MAX " - " _SC_BC_DIM_MAX +indicates the maximum value of elements permitted in an array by +.BR bc (1). +.TP +.BR BC_SCALE_MAX " - " _SC_BC_SCALE_MAX +indicates the maximum +.I scale +value allowed by +.BR bc (1). +.TP +.BR BC_STRING_MAX " - " _SC_BC_STRING_MAX +indicates the maximum length of a string accepted by +.BR bc (1). +.TP +.BR COLL_WEIGHTS_MAX " - " _SC_COLL_WEIGHTS_MAX +indicates the maximum numbers of weights that can be assigned to an +entry of the +.B LC_COLLATE order +keyword in the locale definition file, +.TP +.BR EXPR_NEST_MAX " - " _SC_EXPR_NEST_MAX +is the maximum number of expressions which can be nested within +parentheses by +.BR expr (1). +.TP +.BR LINE_MAX " - " _SC_LINE_MAX +The maximum length of a utility's input line length, either from +standard input or from a file. +This includes length for a trailing +newline. +.TP +.BR RE_DUP_MAX " - " _SC_RE_DUP_MAX +The maximum number of repeated occurrences of a regular expression when +the interval notation +.B \e{m,n\e} +is used. +.TP +.BR POSIX2_VERSION " - " _SC_2_VERSION +indicates the version of the POSIX.2 standard in the format of +YYYYMML. +.TP +.BR POSIX2_C_DEV " - " _SC_2_C_DEV +indicates whether the POSIX.2 C language development facilities are +supported. +.TP +.BR POSIX2_FORT_DEV " - " _SC_2_FORT_DEV +indicates whether the POSIX.2 FORTRAN development utilities are +supported. +.TP +.BR POSIX2_FORT_RUN " - " _SC_2_FORT_RUN +indicates whether the POSIX.2 FORTRAN runtime utilities are supported. +.TP +.BR _POSIX2_LOCALEDEF " - " _SC_2_LOCALEDEF +indicates whether the POSIX.2 creation of locates via +.BR localedef (1) +is supported. +.TP +.BR POSIX2_SW_DEV " - " _SC_2_SW_DEV +indicates whether the POSIX.2 software development utilities option is +supported. +.PP +These values also exist, but may not be standard. +.TP +.BR "" " - " _SC_PHYS_PAGES +The number of pages of physical memory. +Note that it is possible +for the product of this value and the value of +.B _SC_PAGE_SIZE +to overflow. +.TP +.BR "" " - " _SC_AVPHYS_PAGES +The number of currently available pages of physical memory. +.TP +.BR "" " - " _SC_NPROCESSORS_CONF +The number of processors configured. +.TP +.BR "" " - " _SC_NPROCESSORS_ONLN +The number of processors currently online (available). +.SH "RETURN VALUE" +If +.I name +is invalid, \-1 is returned, and +.I errno +is set to +.BR EINVAL . +Otherwise, the value returned is the value of the system resource and +.I errno +is not changed. +In the case of options, a positive value is returned if a queried option +is available, and \-1 if it is not. +In the case of limits, \-1 means that there is no definite limit. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH BUGS +It is difficult to use +.B ARG_MAX +because it is not specified how much of the argument space for +.BR exec (3) +is consumed by the user's environment variables. +.PP +Some returned values may be huge; they are not suitable for allocating +memory. +.SH "SEE ALSO" +.BR bc (1), +.BR expr (1), +.BR getconf (1), +.BR locale (1), +.BR fpathconf (3), +.BR pathconf (3), +.BR posixoptions (7) diff --git a/original/man3/syslog.3 b/original/man3/syslog.3 new file mode 100644 index 00000000..cb58342d --- /dev/null +++ b/original/man3/syslog.3 @@ -0,0 +1,312 @@ +.\" Written Feb 1994 by Steve Greenland (stevegr@neosoft.com) +.\" +.\" 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. +.\" +.\" Updated 1999.12.19 by Karl M. Hegbloom +.\" +.\" Updated 13 Oct 2001, Michael Kerrisk +.\" Added description of vsyslog +.\" Added descriptions of LOG_ODELAY and LOG_NOWAIT +.\" Added brief description of facility and option arguments +.\" Added CONFORMING TO section +.\" 2001-10-13, aeb, minor changes +.\" Modified 13 Dec 2001, Martin Schulze +.\" Modified 3 Jan 2002, Michael Kerrisk +.\" +.TH SYSLOG 3 2008-11-12 "Linux" "Linux Programmer's Manual" +.SH NAME +closelog, openlog, syslog, vsyslog \- send messages to the system logger +.SH SYNOPSIS +.B #include +.sp +.BI "void openlog(const char *" ident ", int " option ", int " facility ); +.br +.BI "void syslog(int " priority ", const char *" format ", ...);" +.br +.B "void closelog(void);" +.sp +.B #include +.sp +.BI "void vsyslog(int " priority ", const char *" format ", va_list " ap ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR vsyslog (): +_BSD_SOURCE +.SH DESCRIPTION +.BR closelog () +closes the descriptor being used to write to the system logger. +The use of +.BR closelog () +is optional. +.sp +.BR openlog () +opens a connection to the system logger for a program. +The string pointed to by +.I ident +is prepended to every message, and is typically set to the program name. +The +.I option +argument specifies flags which control the operation of +.BR openlog () +and subsequent calls to +.BR syslog (). +The +.I facility +argument establishes a default to be used if +none is specified in subsequent calls to +.BR syslog (). +Values for +.I option +and +.I facility +are given below. +The use of +.BR openlog () +is optional; it will automatically be called by +.BR syslog () +if necessary, in which case +.I ident +will default to NULL. +.sp +.BR syslog () +generates a log message, which will be distributed by +.BR syslogd (8). +The +.I priority +argument is formed by ORing the +.I facility +and the +.I level +values (explained below). +The remaining arguments +are a +.IR format , +as in +.BR printf (3) +and any arguments required by the +.IR format , +except that the two character sequence +.B %m +will be replaced by +the error message string +.IR strerror ( errno ). +A trailing newline may be added if needed. + +The function +.BR vsyslog () +performs the same task as +.BR syslog () +with the difference that it takes a set of arguments which have +been obtained using the +.BR stdarg (3) +variable argument list macros. + +The subsections below list the parameters used to set the values of +.IR option , " facility" ", and " priority . +.SS option +The +.I option +argument to +.BR openlog () +is an OR of any of these: +.TP 15 +.B LOG_CONS +Write directly to system console if there is an error while sending to +system logger. +.TP +.B LOG_NDELAY +Open the connection immediately (normally, the connection is opened when +the first message is logged). +.TP +.B LOG_NOWAIT +Don't wait for child processes that may have been created while logging +the message. +(The GNU C library does not create a child process, so this +option has no effect on Linux.) +.TP +.B LOG_ODELAY +The converse of +.BR LOG_NDELAY ; +opening of the connection is delayed until +.BR syslog () +is called. +(This is the default, and need not be specified.) +.TP +.B LOG_PERROR +(Not in POSIX.1-2001.) +Print to \fIstderr\fP as well. +.TP +.B LOG_PID +Include PID with each message. +.SS facility +The +.I facility +argument is used to specify what type of program is logging the message. +This lets the configuration file specify that messages from different +facilities will be handled differently. +.TP 15 +.B LOG_AUTH +security/authorization messages (DEPRECATED Use +.B LOG_AUTHPRIV +instead) +.TP +.B LOG_AUTHPRIV +security/authorization messages (private) +.TP +.B LOG_CRON +clock daemon +.RB ( cron " and " at ) +.TP +.B LOG_DAEMON +system daemons without separate facility value +.TP +.B LOG_FTP +ftp daemon +.TP +.B LOG_KERN +kernel messages (these can't be generated from user processes) +.\" LOG_KERN has the value 0; if used as a facility, zero translates to: +.\" "use the default facility". +.TP +.BR LOG_LOCAL0 " through " LOG_LOCAL7 +reserved for local use +.TP +.B LOG_LPR +line printer subsystem +.TP +.B LOG_MAIL +mail subsystem +.TP +.B LOG_NEWS +USENET news subsystem +.TP +.B LOG_SYSLOG +messages generated internally by +.BR syslogd (8) +.TP +.BR LOG_USER " (default)" +generic user-level messages +.TP +.B LOG_UUCP +UUCP subsystem +.SS level +This determines the importance of the message. +The levels are, in order of decreasing importance: +.TP 15 +.B LOG_EMERG +system is unusable +.TP +.B LOG_ALERT +action must be taken immediately +.TP +.B LOG_CRIT +critical conditions +.TP +.B LOG_ERR +error conditions +.TP +.B LOG_WARNING +warning conditions +.TP +.B LOG_NOTICE +normal, but significant, condition +.TP +.B LOG_INFO +informational message +.TP +.B LOG_DEBUG +debug-level message +.LP +The function +.BR setlogmask (3) +can be used to restrict logging to specified levels only. +.SH "CONFORMING TO" +The functions +.BR openlog (), +.BR closelog (), +and +.BR syslog () +(but not +.BR vsyslog ()) +are specified in SUSv2 and POSIX.1-2001. +POSIX.1-2001 specifies only the +.B LOG_USER +and +.B LOG_LOCAL* +values for +.IR facility . +However, with the exception of +.B LOG_AUTHPRIV +and +.BR LOG_FTP , +the other +.I facility +values appear on most Unix systems. +The +.B LOG_PERROR +value for +.I option +is not specified by POSIX.1-2001, but is available +in most versions of Unix. +.\" .SH HISTORY +.\" A +.\" .BR syslog () +.\" function call appeared in 4.2BSD. +.\" 4.3BSD documents +.\" .BR openlog (), +.\" .BR syslog (), +.\" .BR closelog (), +.\" and +.\" .BR setlogmask (). +.\" 4.3BSD-Reno also documents +.\" .BR vsyslog (). +.\" Of course early v* functions used the +.\" .I +.\" mechanism, which is not compatible with +.\" .IR . +.SH NOTES +The argument +.I ident +in the call of +.BR openlog () +is probably stored as-is. +Thus, if the string it points to +is changed, +.BR syslog () +may start prepending the changed string, and if the string +it points to ceases to exist, the results are undefined. +Most portable is to use a string constant. +.LP +Never pass a string with user-supplied data as a format, +use the following instead: +.nf + + syslog(priority, "%s", string); +.fi +.SH "SEE ALSO" +.BR logger (1), +.BR setlogmask (3), +.BR syslog.conf (5), +.BR syslogd (8) diff --git a/original/man3/system.3 b/original/man3/system.3 new file mode 100644 index 00000000..fc5512a4 --- /dev/null +++ b/original/man3/system.3 @@ -0,0 +1,151 @@ +.\" 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:51:15 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 11 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) +.\" Modified 14 May 2001, 23 Sep 2001 by aeb +.\" 2004-12-20, mtk +.\" +.TH SYSTEM 3 2004-12-20 "" "Linux Programmer's Manual" +.SH NAME +system \- execute a shell command +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int system(const char *" "command" ); +.fi +.SH DESCRIPTION +.BR system () +executes a command specified in +.I command +by calling +.BR "/bin/sh \-c" +.IR command , +and returns after the command has been completed. +During execution of the command, +.B SIGCHLD +will be blocked, and +.B SIGINT +and +.B SIGQUIT +will be ignored. +.SH "RETURN VALUE" +The value returned is \-1 on error (e.g. +.BR fork (2) +failed), +and the return status of the command otherwise. +This latter return status is in the format +specified in +.BR wait (2). +Thus, the exit code of the command will be +.IR WEXITSTATUS(status) . +In case +.I "/bin/sh" +could not be executed, the exit status will be that of +a command that does +.IR exit(127) . +.PP +If the value of +.I command +is NULL, +.BR system () +returns nonzero if the shell is available, and zero if not. +.PP +.BR system () +does not affect the wait status of any other children. +.SH "CONFORMING TO" +C89, C99, POSIX.1-2001. +.SH NOTES +.PP +If the +.B _XOPEN_SOURCE +feature test macro is defined, then the macros described in +.BR wait (2) +.RB ( WEXITSTATUS (), +etc.) are made available when including +.IR . +.PP +As mentioned, +.BR system () +ignores +.B SIGINT +and +.BR SIGQUIT . +This may make programs that call it +from a loop uninterruptible, unless they take care themselves +to check the exit status of the child. +E.g. +.br +.nf + + while (something) { + int ret = system("foo"); + + if (WIFSIGNALED(ret) && + (WTERMSIG(ret) == SIGINT || WTERMSIG(ret) == SIGQUIT)) + break; + } +.fi +.PP +Do not use +.BR system () +from a program with set-user-ID or set-group-ID privileges, +because strange values for some environment variables +might be used to subvert system integrity. +Use the +.BR exec (3) +family of functions instead, but not +.BR execlp (3) +or +.BR execvp (3). +.BR system () +will not, in fact, work properly from programs with set-user-ID or +set-group-ID privileges on systems on which +.I /bin/sh +is bash version 2, since bash 2 drops privileges on startup. +(Debian uses a modified bash which does not do this when invoked as +.BR sh .) +.PP +In versions of glibc before 2.1.3, the check for the availability of +.I /bin/sh +was not actually performed if +.I command +was NULL; instead it was always assumed to be available, and +.BR system () +always returned 1 in this case. +Since glibc 2.1.3, this check is performed because, even though +POSIX.1-2001 requires a conforming implementation to provide +a shell, that shell may not be available or executable if +the calling program has previously called +.BR chroot (2) +(which is not specified by POSIX.1-2001). +.PP +It is possible for the shell command to return 127, so that code is not +a sure indication that the +.BR execve (2) +call failed. +.SH "SEE ALSO" +.BR sh (1), +.BR signal (2), +.BR wait (2), +.BR exec (3) diff --git a/original/man3/sysv_signal.3 b/original/man3/sysv_signal.3 new file mode 100644 index 00000000..c2a891fc --- /dev/null +++ b/original/man3/sysv_signal.3 @@ -0,0 +1,90 @@ +.\" 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. +.\" +.TH SYSV_SIGNAL 3 2007-05-04 "" "Linux Programmer's Manual" +.SH NAME +sysv_signal \- signal handling with System V semantics +.SH SYNOPSIS +.B #define _GNU_SOURCE +.br +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "sighandler_t sysv_signal(int " signum ", sighandler_t " handler ); +.SH DESCRIPTION +The +.BR sysv_signal () +function takes the same arguments, and performs the same task, as +.BR signal (2). + +However +.BR sysv_signal () +provides the System V unreliable signal semantics, that is: +a) the disposition of the signal is reset to the default +when the handler is invoked; +b) delivery of further instances of the signal is not blocked while +the signal handler is executing; and +c) if the handler interrupts (certain) blocking system calls, +then the system call is not automatically restarted. +.SH "RETURN VALUE" +The +.BR sysv_signal () +function returns the previous value of the signal handler, or +.B SIG_ERR +on error. +.SH ERRORS +As for +.BR signal (2). +.SH "CONFORMING TO" +This function is nonstandard. +.SH NOTES +Use of +.BR sysv_signal () +should be avoided; use +.BR sigaction (2) +instead. + +On older Linux systems, +.BR sysv_signal () +and +.BR signal (2) +were equivalent. +But on newer systems, +.BR signal (2) +provides reliable signal semantics; see +.BR signal (2) +for details. + +The use of +.I sighandler_t +is a GNU extension; +this type is only defined if +the +.B _GNU_SOURCE +feature test macro is defined. +.SH "SEE ALSO" +.BR sigaction (2), +.BR signal (2), +.BR bsd_signal (3), +.BR feature_test_macros (7), +.BR signal (7) diff --git a/original/man3/tan.3 b/original/man3/tan.3 new file mode 100644 index 00000000..a45c3ad0 --- /dev/null +++ b/original/man3/tan.3 @@ -0,0 +1,140 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.TH TAN 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +tan, tanf, tanl \- tangent function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double tan(double " x ); +.br +.BI "float tanf(float " x ); +.br +.BI "long double tanl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR tanf (), +.BR tanl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR tan () +function returns the tangent of \fIx\fP, where \fIx\fP is +given in radians. +.SH RETURN VALUE +On success, these functions return the tangent of +.IR x . + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is positive infinity or negative infinity, +a domain error occurs, +and a NaN is returned. + +If the correct result would overflow, +a range error occurs, +and the functions return +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +respectively, with the mathematically correct sign. +.\" 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. +.\" Testing certainly seems to bear this out. -- mtk, Jul 08 +.\" +.\" POSIX.1 allows an optional underflow error; +.\" glibc 2.8 doesn't do this +.\" POSIX.1 an optional range error for subnormal x; +.\" glibc 2.8 doesn't do this +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is an infinity +.\" .I errno +.\" is set to +.\" .BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.TP +Range error: result overflow +.\" 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 . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.PP +These functions do not set +.IR errno . +.\" FIXME . Is it intentional that these functions do not set +.\" errno (at least for domain error)? +.\" Bug raised: http://sourceware.org/bugzilla/show_bug.cgi?id=6782 +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR acos (3), +.BR asin (3), +.BR atan (3), +.BR atan2 (3), +.BR cos (3), +.BR ctan (3), +.BR sin (3) diff --git a/original/man3/tanf.3 b/original/man3/tanf.3 new file mode 100644 index 00000000..58e5a165 --- /dev/null +++ b/original/man3/tanf.3 @@ -0,0 +1 @@ +.so man3/tan.3 diff --git a/original/man3/tanh.3 b/original/man3/tanh.3 new file mode 100644 index 00000000..859c09e0 --- /dev/null +++ b/original/man3/tanh.3 @@ -0,0 +1,103 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.TH TANH 3 2008-08-05 "" "Linux Programmer's Manual" +.SH NAME +tanh, tanhf, tanhl \- hyperbolic tangent function +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double tanh(double " x ); +.br +.BI "float tanhf(float " x ); +.br +.BI "long double tanhl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR tanhf (), +.BR tanhl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR tanh () +function returns the hyperbolic tangent of \fIx\fP, which +is defined mathematically as: +.nf + + tanh(x) = sinh(x) / cosh(x) +.fi +.SH "RETURN VALUE" +On success, these functions return the hyperbolic tangent of +.IR x . + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is +0 (\-0), +0 (\-0) is returned. + +If +.I x +is positive infinity (negative infinity), ++1 (\-1) is returned. +.\" +.\" POSIX.1-2001 documents an optional range error (underflow) +.\" for subnormal x; +.\" glibc 2.8 does not do this. +.SH ERRORS +No errors occur. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +The variant returning +.I double +also conforms to +SVr4, 4.3BSD, C89. +.SH "SEE ALSO" +.BR acosh (3), +.BR asinh (3), +.BR atanh (3), +.BR cosh (3), +.BR ctanh (3), +.BR sinh (3) diff --git a/original/man3/tanhf.3 b/original/man3/tanhf.3 new file mode 100644 index 00000000..3556edba --- /dev/null +++ b/original/man3/tanhf.3 @@ -0,0 +1 @@ +.so man3/tanh.3 diff --git a/original/man3/tanhl.3 b/original/man3/tanhl.3 new file mode 100644 index 00000000..3556edba --- /dev/null +++ b/original/man3/tanhl.3 @@ -0,0 +1 @@ +.so man3/tanh.3 diff --git a/original/man3/tanl.3 b/original/man3/tanl.3 new file mode 100644 index 00000000..58e5a165 --- /dev/null +++ b/original/man3/tanl.3 @@ -0,0 +1 @@ +.so man3/tan.3 diff --git a/original/man3/tcdrain.3 b/original/man3/tcdrain.3 new file mode 100644 index 00000000..eb472496 --- /dev/null +++ b/original/man3/tcdrain.3 @@ -0,0 +1 @@ +.so man3/termios.3 diff --git a/original/man3/tcflow.3 b/original/man3/tcflow.3 new file mode 100644 index 00000000..eb472496 --- /dev/null +++ b/original/man3/tcflow.3 @@ -0,0 +1 @@ +.so man3/termios.3 diff --git a/original/man3/tcflush.3 b/original/man3/tcflush.3 new file mode 100644 index 00000000..eb472496 --- /dev/null +++ b/original/man3/tcflush.3 @@ -0,0 +1 @@ +.so man3/termios.3 diff --git a/original/man3/tcgetattr.3 b/original/man3/tcgetattr.3 new file mode 100644 index 00000000..eb472496 --- /dev/null +++ b/original/man3/tcgetattr.3 @@ -0,0 +1 @@ +.so man3/termios.3 diff --git a/original/man3/tcgetpgrp.3 b/original/man3/tcgetpgrp.3 new file mode 100644 index 00000000..d883cfa1 --- /dev/null +++ b/original/man3/tcgetpgrp.3 @@ -0,0 +1,118 @@ +.\" Copyright (C) 2002 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. +.\" +.TH TCGETPGRP 3 2003-01-28 "GNU" "Linux Programmer's Manual" +.SH NAME +tcgetpgrp, tcsetpgrp \- get and set terminal foreground process group +.SH SYNOPSIS +.B "#include " +.sp +.BI "pid_t tcgetpgrp(int " fd ); +.sp +.BI "int tcsetpgrp(int " fd ", pid_t " pgrp ); +.SH DESCRIPTION +The function +.BR tcgetpgrp () +returns the process group ID of the foreground process group on the +terminal associated to +.IR fd , +which must be the controlling terminal of the calling process. +.\" The process itself may be a background process. +.LP +The function +.BR tcsetpgrp () +makes the process group with process group ID \fIpgrp\fP +the foreground process group on the terminal associated to +.IR fd , +which must be the controlling terminal of the calling process, +and still be associated with its session. +Moreover, \fIpgrp\fP must be a (nonempty) process group belonging to +the same session as the calling process. +.LP +If +.BR tcsetpgrp () +is called by a member of a background process group in its session, +and the calling process is not blocking or ignoring +.BR SIGTTOU , +a +.B SIGTTOU +signal is sent to all members of this background process group. +.SH "RETURN VALUE" +When +.I fd +refers to the controlling terminal of the calling process, +the function +.BR tcgetpgrp () +will return the foreground process group ID of that terminal +if there is one, and some value larger than 1 that is not +presently a process group ID otherwise. +When +.I fd +does not refer to the controlling terminal of the calling process, +\-1 is returned, and +.I errno +is set appropriately. +.LP +When successful, +.BR tcsetpgrp () +returns 0. +Otherwise, it returns \-1, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +.I fd +is not a valid file descriptor. +.TP +.B EINVAL +.I pgrp +has an unsupported value. +.TP +.B ENOTTY +The calling process does not have a controlling terminal, or +it has one but it is not described by +.IR fd , +or, for +.BR tcsetpgrp (), +this controlling terminal is no longer associated with the session +of the calling process. +.TP +.B EPERM +.I pgrp +has a supported value, but is not the process group ID of a +process in the same session as the calling process. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +These functions are implemented via the +.B TIOCGPGRP +and +.B TIOCSPGRP +ioctls. +.SS History +The ioctls appeared in 4.2BSD. +The functions are POSIX inventions. +.SH "SEE ALSO" +.BR setpgid (2), +.BR setsid (2), +.BR credentials (7) diff --git a/original/man3/tcgetsid.3 b/original/man3/tcgetsid.3 new file mode 100644 index 00000000..3a2085df --- /dev/null +++ b/original/man3/tcgetsid.3 @@ -0,0 +1,72 @@ +.\" Copyright (C) 2002 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. +.\" +.TH TCGETSID 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.SH NAME +tcgetsid \- get session ID +.SH SYNOPSIS +.B #define _XOPEN_SOURCE 500 +.br +.B "#include " +.sp +.BI "pid_t tcgetsid(int " fd ); +.SH DESCRIPTION +The function +.BR tcgetsid () +returns the session ID of the current session that has the +terminal associated to +.I fd +as controlling terminal. +This terminal must be the controlling terminal of the calling process. +.SH "RETURN VALUE" +When +.I fd +refers to the controlling terminal of our session, +the function +.BR tcgetsid () +will return the session ID of this session. +Otherwise, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +.I fd +is not a valid file descriptor. +.TP +.B ENOTTY +The calling process does not have a controlling terminal, or +it has one but it is not described by +.IR fd . +.SH VERSIONS +.BR tcgetsid () +is provided in glibc since version 2.1. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +This function is implemented via the +.B TIOCGSID +.BR ioctl (2), +present +since Linux 2.1.71. +.SH "SEE ALSO" +.BR getsid (2) diff --git a/original/man3/tcsendbreak.3 b/original/man3/tcsendbreak.3 new file mode 100644 index 00000000..eb472496 --- /dev/null +++ b/original/man3/tcsendbreak.3 @@ -0,0 +1 @@ +.so man3/termios.3 diff --git a/original/man3/tcsetattr.3 b/original/man3/tcsetattr.3 new file mode 100644 index 00000000..eb472496 --- /dev/null +++ b/original/man3/tcsetattr.3 @@ -0,0 +1 @@ +.so man3/termios.3 diff --git a/original/man3/tcsetpgrp.3 b/original/man3/tcsetpgrp.3 new file mode 100644 index 00000000..1a8b3604 --- /dev/null +++ b/original/man3/tcsetpgrp.3 @@ -0,0 +1 @@ +.so man3/tcgetpgrp.3 diff --git a/original/man3/tdelete.3 b/original/man3/tdelete.3 new file mode 100644 index 00000000..72f12519 --- /dev/null +++ b/original/man3/tdelete.3 @@ -0,0 +1 @@ +.so man3/tsearch.3 diff --git a/original/man3/tdestroy.3 b/original/man3/tdestroy.3 new file mode 100644 index 00000000..72f12519 --- /dev/null +++ b/original/man3/tdestroy.3 @@ -0,0 +1 @@ +.so man3/tsearch.3 diff --git a/original/man3/telldir.3 b/original/man3/telldir.3 new file mode 100644 index 00000000..d54779c5 --- /dev/null +++ b/original/man3/telldir.3 @@ -0,0 +1,78 @@ +.\" 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 Sat Jul 24 17:48:42 1993 by Rik Faith (faith@cs.unc.edu) +.TH TELLDIR 3 2009-03-11 "" "Linux Programmer's Manual" +.SH NAME +telldir \- return current location in directory stream +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "long telldir(DIR *" dirp ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR telldir (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.SH DESCRIPTION +The +.BR telldir () +function returns the current location associated with +the directory stream \fIdirp\fP. +.SH "RETURN VALUE" +On success, the +.BR telldir () +function returns the current location +in the directory stream. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EBADF +Invalid directory stream descriptor \fIdirp\fP. +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +.SH NOTES +In glibc up to version 2.1.1, the return type of +.BR telldir () +was +.IR off_t . +POSIX.1-2001 specifies +.IR long , +and this is the type used since glibc 2.1.2. +.SH "SEE ALSO" +.BR closedir (3), +.BR opendir (3), +.BR readdir (3), +.BR rewinddir (3), +.BR scandir (3), +.BR seekdir (3) diff --git a/original/man3/tempnam.3 b/original/man3/tempnam.3 new file mode 100644 index 00000000..6275e4d7 --- /dev/null +++ b/original/man3/tempnam.3 @@ -0,0 +1,168 @@ +.\" Copyright (c) 1999 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. +.\" +.TH TEMPNAM 3 2008-08-06 "" "Linux Programmer's Manual" +.SH NAME +tempnam \- create a name for a temporary file +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *tempnam(const char *" dir ", const char *" pfx ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR tempnam (): +_BSD_SOURCE || _SVID_SOURCE +.SH DESCRIPTION +The +.BR tempnam () +function returns a pointer to a string that is a valid filename, +and such that a file with this name did not exist when +.BR tempnam () +checked. +The filename suffix of the pathname generated will start with +.I pfx +in case +.I pfx +is a non-NULL string of at most five bytes. +The directory prefix part of the pathname generated is required to +be "appropriate" (often that at least implies writable). + +Attempts to find an appropriate directory go through the following +steps: +.TP 3 +a) +In case the environment variable +.B TMPDIR +exists and +contains the name of an appropriate directory, that is used. +.TP +b) +Otherwise, if the +.I dir +argument is non-NULL and appropriate, it is used. +.TP +c) +Otherwise, +.I P_tmpdir +(as defined in +.IR ) +is used when appropriate. +.TP +d) +Finally an implementation-defined directory may be used. +.PP +The string returned by +.BR tempnam () +is allocated using +.BR malloc (3) +and hence should be freed by +.BR free (3). +.SH "RETURN VALUE" +The +.BR tempnam () +function returns a pointer to a unique temporary +filename, or NULL if a unique name cannot be generated. +.SH ERRORS +.TP +.B ENOMEM +Allocation of storage failed. +.SH "CONFORMING TO" +SVr4, 4.3BSD, POSIX.1-2001. +POSIX.1-2008 marks +.BR tempnam () +as obsolete. +.SH NOTES +Although +.BR tempnam () +generates names that are difficult to guess, +it is nevertheless possible that between the time that +.BR tempnam () +returns a pathname, and the time that the program opens it, +another program might create that pathname using +.BR open (2), +or create it as a symbolic link. +This can lead to security holes. +To avoid such possibilities, use the +.BR open (2) +.B O_EXCL +flag to open the pathname. +Or better yet, use +.BR mkstemp (3) +or +.BR tmpfile (3). + +SUSv2 does not mention the use of +.BR TMPDIR ; +glibc will use it only +when the program is not set-user-ID. +On SVr4, the directory used under \fBd)\fP is +.I /tmp +(and this is what glibc does). +.LP +Because it dynamically allocates memory used to return the pathname, +.BR tempnam () +is reentrant, and thus thread safe, unlike +.BR tmpnam (3). +.LP +The +.BR tempnam () +function generates a different string each time it is called, +up to +.B TMP_MAX +(defined in +.IR ) +times. +If it is called more than +.B TMP_MAX +times, +the behavior is implementation defined. +.LP +.BR tempnam () +uses at most the first five bytes from +.IR pfx . + +The glibc implementation of +.BR tempnam () +will fail with the error +.B EEXIST +upon failure to find a unique name. +.SH BUGS +The precise meaning of "appropriate" is undefined; +it is unspecified how accessibility of a directory is determined. + +Never use this function. +Use +.BR mkstemp (3) +or +.BR tmpfile (3) +instead. +.SH "SEE ALSO" +.BR mkstemp (3), +.BR mktemp (3), +.BR tmpfile (3), +.BR tmpnam (3) diff --git a/original/man3/termios.3 b/original/man3/termios.3 new file mode 100644 index 00000000..3d096c1c --- /dev/null +++ b/original/man3/termios.3 @@ -0,0 +1,970 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de) +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 1993-07-24 by Rik Faith +.\" Modified 1995-02-25 by Jim Van Zandt +.\" Modified 1995-09-02 by Jim Van Zandt +.\" moved to man3, aeb, 950919 +.\" Modified 2001-09-22 by Michael Kerrisk +.\" Modified 2001-12-17, aeb +.\" Modified 2004-10-31, aeb +.\" 2006-12-28, mtk: +.\" Added .SS headers to give some structure to this page; and a +.\" small amount of reordering. +.\" Added a section on canonical and noncanonical mode. +.\" Enhanced the discussion of "raw" mode for cfmakeraw(). +.\" Document CMSPAR. +.\" +.TH TERMIOS 3 2007-11-26 "Linux" "Linux Programmer's Manual" +.SH NAME +termios, tcgetattr, tcsetattr, tcsendbreak, tcdrain, tcflush, tcflow, +cfmakeraw, cfgetospeed, cfgetispeed, cfsetispeed, cfsetospeed, cfsetspeed \- +get and set terminal attributes, line control, get and set baud rate +.SH SYNOPSIS +.nf +.B #include +.br +.B #include +.sp +.BI "int tcgetattr(int " fd ", struct termios *" termios_p ); +.sp +.BI "int tcsetattr(int " fd ", int " optional_actions , +.BI " const struct termios *" termios_p ); +.sp +.BI "int tcsendbreak(int " fd ", int " duration ); +.sp +.BI "int tcdrain(int " fd ); +.sp +.BI "int tcflush(int " fd ", int " queue_selector ); +.sp +.BI "int tcflow(int " fd ", int " action ); +.sp +.BI "void cfmakeraw(struct termios *" termios_p ); +.sp +.BI "speed_t cfgetispeed(const struct termios *" termios_p ); +.sp +.BI "speed_t cfgetospeed(const struct termios *" termios_p ); +.sp +.BI "int cfsetispeed(struct termios *" termios_p ", speed_t " speed ); +.sp +.BI "int cfsetospeed(struct termios *" termios_p ", speed_t " speed ); +.sp +.BI "int cfsetspeed(struct termios *" termios_p ", speed_t " speed ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR cfsetspeed (), +.BR cfmakeraw (): +_BSD_SOURCE +.SH DESCRIPTION +The termios functions describe a general terminal interface that is +provided to control asynchronous communications ports. +.SS "The termios structure" +.LP +Many of the functions described here have a \fItermios_p\fP argument +that is a pointer to a \fItermios\fP structure. +This structure contains at least the following members: +.sp +.in +4n +.nf +tcflag_t c_iflag; /* input modes */ +tcflag_t c_oflag; /* output modes */ +tcflag_t c_cflag; /* control modes */ +tcflag_t c_lflag; /* local modes */ +cc_t c_cc[NCCS]; /* control chars */ +.fi +.in +.PP +The values that may be assigned to these fields are described below. +In the case of the first four bit-mask fields, +the definitions of some of the associated flags that may be set are +only exposed if a specific feature test macro (see +.BR feature_test_macros (7)) +is defined, as noted in brackets ("[]"). +.PP +In the descriptions below, "not in POSIX" means that the +value is not specified in POSIX.1-2001, +and "XSI" means that the value is specified in POSIX.1-2001 +as part of the XSI extension. +.PP +\fIc_iflag\fP flag constants: +.TP +.B IGNBRK +Ignore BREAK condition on input. +.TP +.B BRKINT +If \fBIGNBRK\fP is set, a BREAK is ignored. +If it is not set +but \fBBRKINT\fP is set, then a BREAK causes the input and output +queues to be flushed, and if the terminal is the controlling +terminal of a foreground process group, it will cause a +\fBSIGINT\fP to be sent to this foreground process group. +When neither \fBIGNBRK\fP nor \fBBRKINT\fP are set, a BREAK +reads as a null byte (\(aq\\0\(aq), except when \fBPARMRK\fP is set, +in which case it reads as the sequence \\377 \\0 \\0. +.TP +.B IGNPAR +Ignore framing errors and parity errors. +.TP +.B PARMRK +If \fBIGNPAR\fP is not set, prefix a character with a parity error or +framing error with \\377 \\0. +If neither \fBIGNPAR\fP nor \fBPARMRK\fP +is set, read a character with a parity error or framing error +as \\0. +.TP +.B INPCK +Enable input parity checking. +.TP +.B ISTRIP +Strip off eighth bit. +.TP +.B INLCR +Translate NL to CR on input. +.TP +.B IGNCR +Ignore carriage return on input. +.TP +.B ICRNL +Translate carriage return to newline on input (unless \fBIGNCR\fP is set). +.TP +.B IUCLC +(not in POSIX) Map uppercase characters to lowercase on input. +.TP +.B IXON +Enable XON/XOFF flow control on output. +.TP +.B IXANY +(XSI) Typing any character will restart stopped output. +(The default is to allow just the START character to restart output.) +.TP +.B IXOFF +Enable XON/XOFF flow control on input. +.TP +.B IMAXBEL +(not in POSIX) Ring bell when input queue is full. +Linux does not implement this bit, and acts as if it is always set. +.TP +.BR IUTF8 " (since Linux 2.6.4)" +(not in POSIX) Input is UTF8; +this allows character-erase to be correctly performed in cooked mode. +.PP +\fIc_oflag\fP flag constants defined in POSIX.1: +.TP +.B OPOST +Enable implementation-defined output processing. +.PP +The remaining \fIc_oflag\fP flag constants are defined in POSIX.1-2001, +unless marked otherwise. +.TP +.B OLCUC +(not in POSIX) Map lowercase characters to uppercase on output. +.TP +.B ONLCR +(XSI) Map NL to CR-NL on output. +.TP +.B OCRNL +Map CR to NL on output. +.TP +.B ONOCR +Don't output CR at column 0. +.TP +.B ONLRET +Don't output CR. +.TP +.B OFILL +Send fill characters for a delay, rather than using a timed delay. +.TP +.B OFDEL +(not in POSIX) Fill character is ASCII DEL (0177). +If unset, fill character is ASCII NUL (\(aq\\0\(aq). +(Not implemented on Linux.) +.TP +.B NLDLY +Newline delay mask. +Values are \fBNL0\fP and \fBNL1\fP. +[requires +.B _BSD_SOURCE +or +.B _SVID_SOURCE +or +.BR _XOPEN_SOURCE ] +.TP +.B CRDLY +Carriage return delay mask. +Values are \fBCR0\fP, \fBCR1\fP, \fBCR2\fP, or \fBCR3\fP. +[requires +.B _BSD_SOURCE +or +.B _SVID_SOURCE +or +.BR _XOPEN_SOURCE ] +.TP +.B TABDLY +Horizontal tab delay mask. +Values are \fBTAB0\fP, \fBTAB1\fP, \fBTAB2\fP, \fBTAB3\fP (or \fBXTABS\fP). +A value of TAB3, that is, XTABS, expands tabs to spaces +(with tab stops every eight columns). +[requires +.B _BSD_SOURCE +or +.B _SVID_SOURCE +or +.BR _XOPEN_SOURCE ] +.TP +.B BSDLY +Backspace delay mask. +Values are \fBBS0\fP or \fBBS1\fP. +(Has never been implemented.) +[requires +.B _BSD_SOURCE +or +.B _SVID_SOURCE +or +.BR _XOPEN_SOURCE ] +.TP +.B VTDLY +Vertical tab delay mask. +Values are \fBVT0\fP or \fBVT1\fP. +.TP +.B FFDLY +Form feed delay mask. +Values are \fBFF0\fP or \fBFF1\fP. +[requires +.B _BSD_SOURCE +or +.B _SVID_SOURCE +or +.BR _XOPEN_SOURCE ] +.PP +\fIc_cflag\fP flag constants: +.TP +.B CBAUD +(not in POSIX) Baud speed mask (4+1 bits). +[requires +.B _BSD_SOURCE +or +.BR _SVID_SOURCE ] +.TP +.B CBAUDEX +(not in POSIX) Extra baud speed mask (1 bit), included in +.BR CBAUD . +[requires +.B _BSD_SOURCE +or +.BR _SVID_SOURCE ] +.sp +(POSIX says that the baud speed is stored in the +.I termios +structure without specifying where precisely, and provides +.BR cfgetispeed () +and +.BR cfsetispeed () +for getting at it. +Some systems use bits selected by +.B CBAUD +in +.IR c_cflag , +other systems use separate fields, for example, +.I sg_ispeed +and +.IR sg_ospeed .) +.TP +.B CSIZE +Character size mask. +Values are \fBCS5\fP, \fBCS6\fP, \fBCS7\fP, or \fBCS8\fP. +.TP +.B CSTOPB +Set two stop bits, rather than one. +.TP +.B CREAD +Enable receiver. +.TP +.B PARENB +Enable parity generation on output and parity checking for input. +.TP +.B PARODD +If set, then parity for input and output is odd; +otherwise even parity is used. +.TP +.B HUPCL +Lower modem control lines after last process closes the device (hang up). +.TP +.B CLOCAL +Ignore modem control lines. +.TP +.B LOBLK +(not in POSIX) Block output from a noncurrent shell layer. +For use by \fBshl\fP (shell layers). (Not implemented on Linux.) +.TP +.B CIBAUD +(not in POSIX) Mask for input speeds. +The values for the +.B CIBAUD +bits are +the same as the values for the +.B CBAUD +bits, shifted left +.B IBSHIFT +bits. +[requires +.B _BSD_SOURCE +or +.BR _SVID_SOURCE ] +(Not implemented on Linux.) +.TP +.B CMSPAR +(not in POSIX) +Use "stick" (mark/space) parity (supported on certain serial +devices): if +.B PARODD +is set, the parity bit is always 1; if +.B PARODD +is not set, then the parity bit is always 0). +[requires +.B _BSD_SOURCE +or +.BR _SVID_SOURCE ] +.TP +.B CRTSCTS +(not in POSIX) Enable RTS/CTS (hardware) flow control. +[requires +.B _BSD_SOURCE +or +.BR _SVID_SOURCE ] +.PP +\fIc_lflag\fP flag constants: +.TP +.B ISIG +When any of the characters INTR, QUIT, SUSP, or DSUSP are received, +generate the corresponding signal. +.TP +.B ICANON +Enable canonical mode (described below). +.TP +.B XCASE +(not in POSIX; not supported under Linux) +If \fBICANON\fP is also set, terminal is uppercase only. +Input is converted to lowercase, except for characters preceded by \\. +On output, uppercase characters are preceded by \\ and lowercase +characters are converted to uppercase. +[requires _BSD_SOURCE or _SVID_SOURCE or _XOPEN_SOURCE] +.\" glibc is probably now wrong to allow +.\" Define +.\" .B _XOPEN_SOURCE +.\" to expose +.\" .BR XCASE . +.TP +.B ECHO +Echo input characters. +.TP +.B ECHOE +If \fBICANON\fP is also set, the ERASE character erases the preceding +input character, and WERASE erases the preceding word. +.TP +.B ECHOK +If \fBICANON\fP is also set, the KILL character erases the current line. +.TP +.B ECHONL +If \fBICANON\fP is also set, echo the NL character even if ECHO is not set. +.TP +.B ECHOCTL +(not in POSIX) If \fBECHO\fP is also set, ASCII control signals other than +TAB, NL, START, and STOP are echoed as \fB^X\fP, +where X is the character with +ASCII code 0x40 greater than the control signal. +For example, character +0x08 (BS) is echoed as \fB^H\fP. +[requires +.B _BSD_SOURCE +or +.BR _SVID_SOURCE ] +.TP +.B ECHOPRT +(not in POSIX) If \fBICANON\fP and \fBIECHO\fP are also set, characters +are printed as they are being erased. +[requires +.B _BSD_SOURCE +or +.BR _SVID_SOURCE ] +.TP +.B ECHOKE +(not in POSIX) If \fBICANON\fP is also set, KILL is echoed by erasing +each character on the line, as specified by \fBECHOE\fP and \fBECHOPRT\fP. +[requires +.B _BSD_SOURCE +or +.BR _SVID_SOURCE ] +.TP +.B DEFECHO +(not in POSIX) Echo only when a process is reading. +(Not implemented on Linux.) +.TP +.B FLUSHO +(not in POSIX; not supported under Linux) +Output is being flushed. +This flag is toggled by typing +the DISCARD character. +[requires +.B _BSD_SOURCE +or +.BR _SVID_SOURCE ] +.TP +.B NOFLSH +Disable flushing the input and output queues when generating the +.BR SIGINT , +.BR SIGQUIT , +and +.B SIGSUSP +signals. +.\" Stevens lets SIGSUSP only flush the input queue +.TP +.B TOSTOP +Send the +.B SIGTTOU +signal to the process group of a background process +which tries to write to its controlling terminal. +.TP +.B PENDIN +(not in POSIX; not supported under Linux) +All characters in the input queue are reprinted when +the next character is read. +.RB ( bash (1) +handles typeahead this way.) +[requires +.B _BSD_SOURCE +or +.BR _SVID_SOURCE ] +.TP +.B IEXTEN +Enable implementation-defined input processing. +This flag, as well as \fBICANON\fP must be enabled for the +special characters EOL2, LNEXT, REPRINT, WERASE to be interpreted, +and for the \fBIUCLC\fP flag to be effective. +.PP +The \fIc_cc\fP array defines the special control characters. +The symbolic indices (initial values) and meaning are: +.TP +.B VINTR +(003, ETX, Ctrl-C, or also 0177, DEL, rubout) +Interrupt character. +Send a +.B SIGINT +signal. +Recognized when +.B ISIG +is set, and then not passed as input. +.TP +.B VQUIT +(034, FS, Ctrl-\e) +Quit character. +Send +.B SIGQUIT +signal. +Recognized when +.B ISIG +is set, and then not passed as input. +.TP +.B VERASE +(0177, DEL, rubout, or 010, BS, Ctrl-H, or also #) +Erase character. +This erases the previous not-yet-erased character, +but does not erase past EOF or beginning-of-line. +Recognized when +.B ICANON +is set, and then not passed as input. +.TP +.B VKILL +(025, NAK, Ctrl-U, or Ctrl-X, or also @) +Kill character. +This erases the input since the last EOF or beginning-of-line. +Recognized when +.B ICANON +is set, and then not passed as input. +.TP +.B VEOF +(004, EOT, Ctrl-D) +End-of-file character. +More precisely: this character causes the pending tty buffer to be sent +to the waiting user program without waiting for end-of-line. +If it is the first character of the line, the +.BR read (2) +in the user program returns 0, which signifies end-of-file. +Recognized when +.B ICANON +is set, and then not passed as input. +.TP +.B VMIN +Minimum number of characters for noncanonical read. +.TP +.B VEOL +(0, NUL) +Additional end-of-line character. +Recognized when +.B ICANON +is set. +.TP +.B VTIME +Timeout in deciseconds for noncanonical read. +.TP +.B VEOL2 +(not in POSIX; 0, NUL) +Yet another end-of-line character. +Recognized when +.B ICANON +is set. +.TP +.B VSWTCH +(not in POSIX; not supported under Linux; 0, NUL) +Switch character. +(Used by \fBshl\fP only.) +.TP +.B VSTART +(021, DC1, Ctrl-Q) +Start character. +Restarts output stopped by the Stop character. +Recognized when +.B IXON +is set, and then not passed as input. +.TP +.B VSTOP +(023, DC3, Ctrl-S) +Stop character. +Stop output until Start character typed. +Recognized when +.B IXON +is set, and then not passed as input. +.TP +.B VSUSP +(032, SUB, Ctrl-Z) +Suspend character. +Send +.B SIGTSTP +signal. +Recognized when +.B ISIG +is set, and then not passed as input. +.TP +.B VDSUSP +(not in POSIX; not supported under Linux; 031, EM, Ctrl-Y) +Delayed suspend character: +send +.B SIGTSTP +signal when the character is read by the user program. +Recognized when +.B IEXTEN +and +.B ISIG +are set, and the system supports +job control, and then not passed as input. +.TP +.B VLNEXT +(not in POSIX; 026, SYN, Ctrl-V) +Literal next. +Quotes the next input character, depriving it of +a possible special meaning. +Recognized when +.B IEXTEN +is set, and then not passed as input. +.TP +.B VWERASE +(not in POSIX; 027, ETB, Ctrl-W) +Word erase. +Recognized when +.B ICANON +and +.B IEXTEN +are set, and then not passed as input. +.TP +.B VREPRINT +(not in POSIX; 022, DC2, Ctrl-R) +Reprint unread characters. +Recognized when +.B ICANON +and +.B IEXTEN +are set, and then not passed as input. +.TP +.B VDISCARD +(not in POSIX; not supported under Linux; 017, SI, Ctrl-O) +Toggle: start/stop discarding pending output. +Recognized when +.B IEXTEN +is set, and then not passed as input. +.TP +.B VSTATUS +(not in POSIX; not supported under Linux; +status request: 024, DC4, Ctrl-T). +.LP +These symbolic subscript values are all different, except that +.BR VTIME , +.B VMIN +may have the same value as +.BR VEOL , +.BR VEOF , +respectively. +In noncanonical mode the special character meaning is replaced +by the timeout meaning. +For an explanation of +.B VMIN +and +.BR VTIME , +see the description of +noncanonical mode below. +.SS "Retrieving and changing terminal settings" +.PP +.BR tcgetattr () +gets the parameters associated with the object referred by \fIfd\fP and +stores them in the \fItermios\fP structure referenced by +\fItermios_p\fP. +This function may be invoked from a background process; +however, the terminal attributes may be subsequently changed by a +foreground process. +.LP +.BR tcsetattr () +sets the parameters associated with the terminal (unless support is +required from the underlying hardware that is not available) from the +\fItermios\fP structure referred to by \fItermios_p\fP. +\fIoptional_actions\fP specifies when the changes take effect: +.IP \fBTCSANOW\fP +the change occurs immediately. +.IP \fBTCSADRAIN\fP +the change occurs after all output written to +.I fd +has been transmitted. +This function should be used when changing +parameters that affect output. +.IP \fBTCSAFLUSH\fP +the change occurs after all output written to the object referred by +.I fd +has been transmitted, and all input that has been received but not read +will be discarded before the change is made. +.SS "Canonical and noncanonical mode" +The setting of the +.B ICANON +canon flag in +.I c_lflag +determines whether the terminal is operating in canonical mode +.RB ( ICANON +set) or +noncanonical mode +.RB ( ICANON +unset). +By default, +.B ICANON +set. + +In canonical mode: +.IP * 2 +Input is made available line by line. +An input line is available when one of the line delimiters +is typed (NL, EOL, EOL2; or EOF at the start of line). +Except in the case of EOF, the line delimiter is included +in the buffer returned by +.BR read (2). +.IP * 2 +Line editing is enabled (ERASE, KILL; +and if the +.B IEXTEN +flag is set: WERASE, REPRINT, LNEXT). +A +.BR read (2) +returns at most one line of input; if the +.BR read (2) +requested fewer bytes than are available in the current line of input, +then only as many bytes as requested are read, +and the remaining characters will be available for a future +.BR read (2). +.PP +In noncanonical mode input is available immediately (without +the user having to type a line-delimiter character), +and line editing is disabled. +The settings of MIN +.RI ( c_cc[VMIN] ) +and TIME +.RI ( c_cc[VTIME] ) +determine the circumstances in which a +.BR read (2) +completes; there are four distinct cases: +.IP * 2 +MIN == 0; TIME == 0: +If data is available, +.BR read (2) +returns immediately, with the lesser of the number of bytes +available, or the number of bytes requested. +If no data is available, +.BR read (2) +returns 0. +.IP * 2 +MIN > 0; TIME == 0: +.BR read (2) +blocks until the lesser of MIN bytes or the number of bytes requested +are available, and returns the lesser of these two values. +.IP * 2 +MIN == 0; TIME > 0: +TIME specifies the limit for a timer in tenths of a second. +The timer is started when +.BR read (2) +is called. +.BR read (2) +returns either when at least one byte of data is available, +or when the timer expires. +If the timer expires without any input becoming available, +.BR read (2) +returns 0. +.IP * 2 +MIN > 0; TIME > 0: +TIME specifies the limit for a timer in tenths of a second. +Once an initial byte of input becomes available, +the timer is restarted after each further byte is received. +.BR read (2) +returns either when the lesser of the number of bytes requested or +MIN byte have been read, +or when the inter-byte timeout expires. +Because the timer is only started after the initial byte +becomes available, at least one byte will be read. +.SS "Raw mode" +.LP +.BR cfmakeraw () +sets the terminal to something like the +"raw" mode of the old Version 7 terminal driver: +input is available character by character, +echoing is disabled, and all special processing of +terminal input and output characters is disabled. +The terminal attributes are set as follows: +.nf + + termios_p\->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP + | INLCR | IGNCR | ICRNL | IXON); + termios_p\->c_oflag &= ~OPOST; + termios_p\->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); + termios_p\->c_cflag &= ~(CSIZE | PARENB); + termios_p\->c_cflag |= CS8; +.fi +.SS "Line control" +.LP +.BR tcsendbreak () +transmits a continuous stream of zero-valued bits for a specific +duration, if the terminal is using asynchronous serial data +transmission. +If \fIduration\fP is zero, it transmits zero-valued bits +for at least 0.25 seconds, and not more that 0.5 seconds. +If \fIduration\fP is not zero, it sends zero-valued bits for some +implementation-defined length of time. +.LP +If the terminal is not using asynchronous serial data transmission, +.BR tcsendbreak () +returns without taking any action. +.LP +.BR tcdrain () +waits until all output written to the object referred to by +.I fd +has been transmitted. +.LP +.BR tcflush () +discards data written to the object referred to by +.I fd +but not transmitted, or data received but not read, depending on the +value of +.IR queue_selector : +.IP \fBTCIFLUSH\fP +flushes data received but not read. +.IP \fBTCOFLUSH\fP +flushes data written but not transmitted. +.IP \fBTCIOFLUSH\fP +flushes both data received but not read, and data written but not +transmitted. +.LP +.BR tcflow () +suspends transmission or reception of data on the object referred to by +.IR fd , +depending on the value of +.IR action : +.IP \fBTCOOFF\fP +suspends output. +.IP \fBTCOON\fP +restarts suspended output. +.IP \fBTCIOFF\fP +transmits a STOP character, which stops the terminal device from +transmitting data to the system. +.IP \fBTCION\fP +transmits a START character, which starts the terminal device +transmitting data to the system. +.LP +The default on open of a terminal file is that neither its input nor its +output is suspended. +.SS "Line speed" +The baud rate functions are provided for getting and setting the values +of the input and output baud rates in the \fItermios\fP structure. +The new values do not take effect +until +.BR tcsetattr () +is successfully called. + +Setting the speed to \fBB0\fP instructs the modem to "hang up". +The actual bit rate corresponding to \fBB38400\fP may be altered with +.BR setserial (8). +.LP +The input and output baud rates are stored in the \fItermios\fP +structure. +.LP +.BR cfgetospeed () +returns the output baud rate stored in the \fItermios\fP structure +pointed to by +.IR termios_p . +.LP +.BR cfsetospeed () +sets the output baud rate stored in the \fItermios\fP structure pointed +to by \fItermios_p\fP to \fIspeed\fP, which must be one of these constants: +.nf + +.ft B + B0 + B50 + B75 + B110 + B134 + B150 + B200 + B300 + B600 + B1200 + B1800 + B2400 + B4800 + B9600 + B19200 + B38400 + B57600 + B115200 + B230400 +.ft P + +.fi +The zero baud rate, \fBB0\fP, +is used to terminate the connection. +If B0 is specified, the modem control lines shall no longer be asserted. +Normally, this will disconnect the line. +\fBCBAUDEX\fP is a mask +for the speeds beyond those defined in POSIX.1 (57600 and above). +Thus, \fBB57600\fP & \fBCBAUDEX\fP is nonzero. +.LP +.BR cfgetispeed () +returns the input baud rate stored in the \fItermios\fP structure. +.LP +.BR cfsetispeed () +sets the input baud rate stored in the \fItermios\fP structure to +.IR speed , +which must be specified as one of the \fBBnnn\fP constants listed above for +.BR cfsetospeed (). +If the input baud rate is set to zero, the input baud rate will be +equal to the output baud rate. +.LP +.BR cfsetspeed () +is a 4.4BSD extension. +It takes the same arguments as +.BR cfsetispeed (), +and sets both input and output speed. +.SH "RETURN VALUE" +.LP +.BR cfgetispeed () +returns the input baud rate stored in the +\fItermios\fP +structure. +.LP +.BR cfgetospeed () +returns the output baud rate stored in the \fItermios\fP structure. +.LP +All other functions return: +.IP 0 +on success. +.IP \-1 +on failure and set +.I errno +to indicate the error. +.LP +Note that +.BR tcsetattr () +returns success if \fIany\fP of the requested changes could be +successfully carried out. +Therefore, when making multiple changes +it may be necessary to follow this call with a further call to +.BR tcgetattr () +to check that all changes have been performed successfully. +.SH CONFORMING TO +.BR tcgetattr (), +.BR tcsetattr (), +.BR tcsendbreak (), +.BR tcdrain (), +.BR tcflush (), +.BR tcflow (), +.BR cfgetispeed (), +.BR cfgetospeed (), +.BR cfsetispeed (), +and +.BR cfsetospeed () +are specified in POSIX.1-2001. + +.BR cfmakeraw () +and +.BR cfsetspeed () +are nonstandard, but available on the BSDs. +.SH NOTES +Unix V7 and several later systems have a list of baud rates +where after the fourteen values B0, ..., B9600 one finds the +two constants EXTA, EXTB ("External A" and "External B"). +Many systems extend the list with much higher baud rates. +.LP +The effect of a nonzero \fIduration\fP with +.BR tcsendbreak () +varies. +SunOS specifies a break of +.I "duration\ *\ N" +seconds, where \fIN\fP is at least 0.25, and not more than 0.5. +Linux, AIX, DU, Tru64 send a break of +.I duration +milliseconds. +FreeBSD and NetBSD and HP-UX and MacOS ignore the value of +.IR duration . +Under Solaris and Unixware, +.BR tcsendbreak () +with nonzero +.I duration +behaves like +.BR tcdrain (). +.\" libc4 until 4.7.5, glibc for sysv: EINVAL for duration > 0. +.\" libc4.7.6, libc5, glibc for unix: duration in ms. +.\" glibc for bsd: duration in us +.\" glibc for sunos4: ignore duration +.SH "SEE ALSO" +.BR stty (1), +.BR console_ioctl (4), +.BR tty_ioctl (4), +.BR setserial (8) diff --git a/original/man3/tfind.3 b/original/man3/tfind.3 new file mode 100644 index 00000000..72f12519 --- /dev/null +++ b/original/man3/tfind.3 @@ -0,0 +1 @@ +.so man3/tsearch.3 diff --git a/original/man3/tgamma.3 b/original/man3/tgamma.3 new file mode 100644 index 00000000..3f70e01c --- /dev/null +++ b/original/man3/tgamma.3 @@ -0,0 +1,176 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" Based on glibc infopages +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" Modified 2004-11-15, fixed error noted by Fabian Kreutz +.\" +.TH TGAMMA 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH NAME +tgamma, tgammaf, tgammal \- true gamma function +.SH SYNOPSIS +.B #include +.sp +.BI "double tgamma(double " x ); +.br +.BI "float tgammaf(float " x ); +.br +.BI "long double tgammal(long double " x ); +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR tgamma (), +.BR tgammaf (), +.BR tgammal (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The Gamma function is defined by +.sp + Gamma(x) = integral from 0 to infinity of t^(x\-1) e^\-t dt +.sp +It is defined for every real number except for nonpositive integers. +For nonnegative integral \fIm\fP one has +.sp + Gamma(m+1) = m! +.sp +and, more generally, for all \fIx\fP: +.sp + Gamma(x+1) = x * Gamma(x) +.sp +Furthermore, the following is valid for all values of \fIx\fP +outside the poles: +.sp + Gamma(x) * Gamma(1 \- x) = PI / sin(PI * x) +.PP +.SH RETURN VALUE +On success, these functions return Gamma(x). + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is positive infinity, positive infinity is returned. + +If +.I x +is a negative integer, or is negative infinity, +a domain error occurs, +and a NaN is returned. + +If the result overflows, +a range error occurs, +and the functions return +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +respectively, with the correct mathematical sign. + +If the result underflows, +a range error occurs, +and the functions return 0, with the correct mathematical sign. + +If +.I x +is -0 or +0, +a pole error occurs, +and the functions return +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +respectively, with the same sign as the 0. +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is a negative integer, or negative infinity +.\" FIXME . errno is not set to EDOM for x == -inf +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6809 +.I errno +is set to +.BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised (but see BUGS). +.TP +Pole error: \fIx\fP is +0 or \-0 +.I errno +is set to +.BR ERANGE . +A divide-by-zero floating-point exception +.RB ( FE_DIVBYZERO ) +is raised. +.TP +Range error: result overflow +.I errno +is set to +.BR ERANGE . +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.PP +glibc also gives the following error which is not specified +in C99 or POSIX.1-2001. +.TP +Range error: result underflow +.\" e.g., tgamma(-172.5) on glibc 2.8/x86-32 +.\" .I errno +.\" is set to +.\" .BR ERANGE . +An underflow floating-point exception +.RB ( FE_UNDERFLOW ) +is raised. +.IP +.I errno +is not set for this case. +.\" 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. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH NOTES +This function had to be called "true gamma function" +since there is already a function +.BR gamma (3) +that returns something else (see +.BR gamma (3) +for details). +.SH BUGS +If +.I x +is negative infinity, +.I errno +is not set (it should be set to +.BR EDOM ). +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6809 + +In glibc versions 2.3.3 and earlier, +an argument of +0 or -0 incorrectly produced a domain error +.RI ( errno +set to +.B EDOM +and an +.B FE_INVALID +exception raised), rather than a pole error. +.SH "SEE ALSO" +.BR gamma (3), +.BR lgamma (3) diff --git a/original/man3/tgammaf.3 b/original/man3/tgammaf.3 new file mode 100644 index 00000000..4a0248a0 --- /dev/null +++ b/original/man3/tgammaf.3 @@ -0,0 +1 @@ +.so man3/tgamma.3 diff --git a/original/man3/tgammal.3 b/original/man3/tgammal.3 new file mode 100644 index 00000000..4a0248a0 --- /dev/null +++ b/original/man3/tgammal.3 @@ -0,0 +1 @@ +.so man3/tgamma.3 diff --git a/original/man3/timegm.3 b/original/man3/timegm.3 new file mode 100644 index 00000000..98a40047 --- /dev/null +++ b/original/man3/timegm.3 @@ -0,0 +1,101 @@ +.\" 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. +.\" +.TH TIMEGM 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +timegm, timelocal \- inverses of gmtime and localtime +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "time_t timelocal(struct tm *" tm ); +.sp +.BI "time_t timegm(struct tm *" tm ); +.sp +.fi +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR timelocal (), +.BR timegm (): +_BSD_SOURCE || _SVID_SOURCE +.SH DESCRIPTION +The functions +.BR timelocal () +and +.BR timegm () +are the inverses of +.BR localtime (3) +and +.BR gmtime (3). +.SH "CONFORMING TO" +These functions are nonstandard GNU extensions +that are also present on the BSDs. +Avoid their use; see NOTES. +.SH NOTES +The +.BR timelocal () +function is equivalent to the POSIX standard function +.BR mktime (3). +There is no reason to ever use it. +.LP +For a portable version of +.BR timegm (), +set the +.B TZ +environment variable to UTC, call +.BR mktime (3) +and restore the value of +.BR TZ . +Something like + +.in +4n +.nf +#include +#include + +time_t +my_timegm(struct tm *tm) +{ + time_t ret; + char *tz; + + tz = getenv("TZ"); + setenv("TZ", "", 1); + tzset(); + ret = mktime(tm); + if (tz) + setenv("TZ", tz, 1); + else + unsetenv("TZ"); + tzset(); + return ret; +} +.fi +.in +.SH "SEE ALSO" +.BR gmtime (3), +.BR localtime (3), +.BR mktime (3), +.BR tzset (3) diff --git a/original/man3/timelocal.3 b/original/man3/timelocal.3 new file mode 100644 index 00000000..45d4c090 --- /dev/null +++ b/original/man3/timelocal.3 @@ -0,0 +1 @@ +.so man3/timegm.3 diff --git a/original/man3/timeradd.3 b/original/man3/timeradd.3 new file mode 100644 index 00000000..5b288c47 --- /dev/null +++ b/original/man3/timeradd.3 @@ -0,0 +1,150 @@ +.\" Copyright (c) 2007 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. +.\" +.\" 2007-07-31, mtk, Created +.\" +.TH TIMERADD 3 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +timeradd, timersub, timercmp, timerclear, timerisset \- timeval operations +.SH SYNOPSIS +.nf +.B #include + +.BI "void timeradd(struct timeval *" a ", struct timeval *" b , +.BI " struct timeval *" res ); + +.BI "void timersub(struct timeval *" a ", struct timeval *" b , +.BI " struct timeval *" res ); + +.BI "void timerclear(struct timeval *" tvp ); + +.BI "int timerisset(struct timeval *" tvp ); + +.BI "int timercmp(struct timeval *" a ", struct timeval *" b ", " CMP ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +All functions shown above: +_BSD_SOURCE +.SH DESCRIPTION +The macros are provided to operate on +.I timeval +structures, defined in +.I +as: +.sp +.in +4n +.nf +struct timeval { + time_t tv_sec; /* seconds */ + suseconds_t tv_usec; /* microseconds */ +}; +.fi +.in +.PP +.BR timeradd () +adds the time values in +.I a +and +.IR b , +and places the sum in the +.I timeval +pointed to by +.IR res . +The result is normalized such that +.I res\->tv_usec +has a value in the range 0 to 999,999. + +.BR timersub () +subtracts the time value in +.I b +from the time value in +.IR a , +and places the result in the +.I timeval +pointed to by +.IR res . +The result is normalized such that +.I res\->tv_usec +has a value in the range 0 to 999,999. + +.BR timerclear () +zeros out the +.I timeval +structure pointed to by +.IR tvp , +so that it represents the Epoch: 1970-01-01 00:00:00 +0000 (UTC). + +.BR timerisset () +returns true (nonzero) if either field of the +.I timeval +structure pointed to by +.I tvp +contains a nonzero value. + +.BR timercmp () +compares the timer values in +.I a +and +.I b +using the comparison operator +.IR CMP , +and returns true (nonzero) or false (0) depending on +the result of the comparison. +Some systems (but not Linux/glibc), +have a broken +.BR timercmp () +implementation, +.\" 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) +in which +.I CMP +of +.IR >= , +.IR <= , +and +.I == +do not work; +portable applications can instead use + + !timercmp(..., <) + !timercmp(..., >) + !timercmp(..., !=) +.SH RETURN VALUE +.BR timerisset () +and +.BR timercmp () +return true (nonzero) or false (0). +.SH ERRORS +No errors are defined. +.SH CONFORMING TO +Not in POSIX.1-2001. +Present on most BSD derivatives. +.SH "SEE ALSO" +.BR gettimeofday (2), +.BR time (7) diff --git a/original/man3/timerclear.3 b/original/man3/timerclear.3 new file mode 100644 index 00000000..8e977c98 --- /dev/null +++ b/original/man3/timerclear.3 @@ -0,0 +1 @@ +.so man3/timeradd.3 diff --git a/original/man3/timercmp.3 b/original/man3/timercmp.3 new file mode 100644 index 00000000..8e977c98 --- /dev/null +++ b/original/man3/timercmp.3 @@ -0,0 +1 @@ +.so man3/timeradd.3 diff --git a/original/man3/timerisset.3 b/original/man3/timerisset.3 new file mode 100644 index 00000000..8e977c98 --- /dev/null +++ b/original/man3/timerisset.3 @@ -0,0 +1 @@ +.so man3/timeradd.3 diff --git a/original/man3/timersub.3 b/original/man3/timersub.3 new file mode 100644 index 00000000..8e977c98 --- /dev/null +++ b/original/man3/timersub.3 @@ -0,0 +1 @@ +.so man3/timeradd.3 diff --git a/original/man3/timezone.3 b/original/man3/timezone.3 new file mode 100644 index 00000000..80907636 --- /dev/null +++ b/original/man3/timezone.3 @@ -0,0 +1 @@ +.so man3/tzset.3 diff --git a/original/man3/tmpfile.3 b/original/man3/tmpfile.3 new file mode 100644 index 00000000..88a691bd --- /dev/null +++ b/original/man3/tmpfile.3 @@ -0,0 +1,91 @@ +.\" 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 Sat Jul 24 17:46:57 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2001-11-17, aeb +.TH TMPFILE 3 2008-07-14 "" "Linux Programmer's Manual" +.SH NAME +tmpfile \- create a temporary file +.SH SYNOPSIS +.nf +.B #include +.sp +.B FILE *tmpfile(void); +.fi +.SH DESCRIPTION +The +.BR tmpfile () +function opens a unique temporary file +in binary read/write (w+b) mode. +The file will be automatically deleted when it is closed or the +program terminates. +.SH "RETURN VALUE" +The +.BR tmpfile () +function returns a stream descriptor, or NULL if +a unique filename cannot be generated or the unique file cannot be +opened. +In the latter case, \fIerrno\fP is set to indicate the error. +.SH ERRORS +.TP +.B EACCES +Search permission denied for directory in file's path prefix. +.TP +.B EEXIST +Unable to generate a unique filename. +.TP +.B EINTR +The call was interrupted by a signal. +.TP +.B EMFILE +Too many file descriptors in use by the process. +.TP +.B ENFILE +Too many files open in the system. +.TP +.B ENOSPC +There was no room in the directory to add the new filename. +.TP +.B EROFS +Read-only file system. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001. +.SH NOTES +POSIX.1-2001 specifies: +an error message may be written to \fIstdout\fP if the stream +cannot be opened. +.LP +The standard does not specify the directory that +.BR tmpfile () +will use. +Glibc will try the path prefix \fIP_tmpdir\fP defined +in \fI\fP, and if that fails the directory \fI/tmp\fP. +.SH "SEE ALSO" +.BR exit (3), +.BR mkstemp (3), +.BR mktemp (3), +.BR tempnam (3), +.BR tmpnam (3) diff --git a/original/man3/tmpnam.3 b/original/man3/tmpnam.3 new file mode 100644 index 00000000..7f29e366 --- /dev/null +++ b/original/man3/tmpnam.3 @@ -0,0 +1,153 @@ +.\" Copyright (c) 1999 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. +.\" +.\" 2003-11-15, aeb, added tmpnam_r +.\" +.TH TMPNAM 3 2008-08-06 "" "Linux Programmer's Manual" +.SH NAME +tmpnam, tmpnam_r \- create a name for a temporary file +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *tmpnam(char *" s ); +.fi +.SH DESCRIPTION +The +.BR tmpnam () +function returns a pointer to a string that is a valid filename, +and such that a file with this name did not exist at some point +in time, so that naive programmers may think it +a suitable name for a temporary file. +If the argument +.I s +is NULL this name is generated in an internal static buffer +and may be overwritten by the next call to +.BR tmpnam (). +If +.I s +is not NULL, the name is copied to the character array (of length +at least +.IR L_tmpnam ) +pointed to by +.I s +and the value +.I s +is returned in case of success. +.LP +The pathname that is created, has a directory prefix +.IR P_tmpdir . +(Both +.I L_tmpnam +and +.I P_tmpdir +are defined in +.IR , +just like the +.B TMP_MAX +mentioned below.) +.SH "RETURN VALUE" +The +.BR tmpnam () +function returns a pointer to a unique temporary +filename, or NULL if a unique name cannot be generated. +.SH ERRORS +No errors are defined. +.SH "CONFORMING TO" +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +POSIX.1-2008 marks +.BR tmpnam () +as obsolete. +.SH NOTES +The +.BR tmpnam () +function generates a different string each time it is called, +up to +.B TMP_MAX +times. +If it is called more than +.B TMP_MAX +times, +the behavior is implementation defined. +.LP +Although +.BR tmpnam () +generates names that are difficult to guess, +it is nevertheless possible that between the time that +.BR tmpnam () +returns a pathname, and the time that the program opens it, +another program might create that pathname using +.BR open (2), +or create it as a symbolic link. +This can lead to security holes. +To avoid such possibilities, use the +.BR open (2) +.B O_EXCL +flag to open the pathname. +Or better yet, use +.BR mkstemp (3) +or +.BR tmpfile (3). +.LP +Portable applications that use threads cannot call +.BR tmpnam () +with a NULL argument if either +.B _POSIX_THREADS +or +.B _POSIX_THREAD_SAFE_FUNCTIONS +is defined. +.LP +A POSIX draft proposed to use a function +.BR tmpnam_r () +defined by +.sp +.nf +.in +4n +char * +tmpnam_r(char *s) +{ + return s ? tmpnam(s) : NULL; +} +.in +.fi +.sp +apparently as a warning not to use NULL. +A few systems implement it. +To get a glibc prototype for this function, +define +.B _SVID_SOURCE +or +.B _BSD_SOURCE +before including +.IR . +.SH BUGS +Never use this function. +Use +.BR mkstemp (3) +or +.BR tmpfile (3) +instead. +.SH "SEE ALSO" +.BR mkstemp (3), +.BR mktemp (3), +.BR tempnam (3), +.BR tmpfile (3) diff --git a/original/man3/tmpnam_r.3 b/original/man3/tmpnam_r.3 new file mode 100644 index 00000000..c1bd6dc1 --- /dev/null +++ b/original/man3/tmpnam_r.3 @@ -0,0 +1 @@ +.so man3/tmpnam.3 diff --git a/original/man3/toascii.3 b/original/man3/toascii.3 new file mode 100644 index 00000000..f117e3cf --- /dev/null +++ b/original/man3/toascii.3 @@ -0,0 +1,63 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" Copyright (c) 1995 by Jim Van Zandt +.\" +.\" 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. +.\" +.\" Added BUGS section, aeb, 950919 +.\" +.TH TOASCII 3 2009-03-15 "GNU" "Linux Programmer's Manual" +.SH NAME +toascii \- convert character to ASCII +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int toascii(int " "c" ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR toascii (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.SH DESCRIPTION +.BR toascii () +converts \fIc\fP to a 7-bit \fIunsigned char\fP value +that fits into the ASCII character set, by clearing the +high-order bits. +.SH "RETURN VALUE" +The value returned is that of the converted character. +.SH "CONFORMING TO" +SVr4, BSD, POSIX.1-2001. +POSIX.1-2008 marks +.BR toascii () +as obsolete, +noting that it cannot be use portably in a localized application. +.SH BUGS +Many people will be unhappy if you use this function. +This function will convert accented letters into random characters. +.SH "SEE ALSO" +.BR isascii (3), +.BR tolower (3), +.BR toupper (3) diff --git a/original/man3/tolower.3 b/original/man3/tolower.3 new file mode 100644 index 00000000..033f16e9 --- /dev/null +++ b/original/man3/tolower.3 @@ -0,0 +1 @@ +.so man3/toupper.3 diff --git a/original/man3/toupper.3 b/original/man3/toupper.3 new file mode 100644 index 00000000..12677b46 --- /dev/null +++ b/original/man3/toupper.3 @@ -0,0 +1,76 @@ +.\" 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:45:39 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2000-02-13 by Nicolás Lichtmaier +.TH TOUPPER 3 1993-04-04 "GNU" "Linux Programmer's Manual" +.SH NAME +toupper, tolower \- convert letter to upper or lower case +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int toupper(int " "c" ); +.br +.BI "int tolower(int " "c" ); +.fi +.SH DESCRIPTION +.BR toupper () +converts the letter +.I c +to upper case, if possible. +.PP +.BR tolower () +converts the letter +.I c +to lower case, if possible. +.PP +If +.I c +is not an +.I "unsigned char" +value, or +.BR EOF , +the behavior of these functions +is undefined. +.SH "RETURN VALUE" +The value returned is that of the converted letter, or +.I c +if the conversion was not possible. +.SH "CONFORMING TO" +C89, C99, 4.3BSD. +.SH BUGS +The details of what constitutes an uppercase or lowercase letter depend +on the current locale. +For example, the default +.B """C""" +locale does not know about umlauts, so no conversion is done for them. +.PP +In some non-English locales, there are lowercase letters with no +corresponding uppercase equivalent; the German sharp s is one +example. +.SH "SEE ALSO" +.BR isalpha (3), +.BR setlocale (3), +.BR towlower (3), +.BR towupper (3), +.BR locale (7) diff --git a/original/man3/towctrans.3 b/original/man3/towctrans.3 new file mode 100644 index 00000000..05f11b40 --- /dev/null +++ b/original/man3/towctrans.3 @@ -0,0 +1,51 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH TOWCTRANS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +towctrans \- wide-character transliteration +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wint_t towctrans(wint_t " wc ", wctrans_t " desc ); +.fi +.SH DESCRIPTION +If \fIwc\fP is a wide character, the +.BR towctrans () +function +translates it according to the transliteration descriptor \fIdesc\fP. +If \fIwc\fP is \fBWEOF\fP, \fBWEOF\fP is returned. +.PP +\fIdesc\fP must be a transliteration descriptor returned by +the +.BR wctrans (3) +function. +.SH "RETURN VALUE" +The +.BR towctrans () +function returns the translated wide character, +or \fBWEOF\fP if \fIwc\fP is \fBWEOF\fP. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR towctrans () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR towlower (3), +.BR towupper (3), +.BR wctrans (3) diff --git a/original/man3/towlower.3 b/original/man3/towlower.3 new file mode 100644 index 00000000..b0aa56da --- /dev/null +++ b/original/man3/towlower.3 @@ -0,0 +1,53 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH TOWLOWER 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +towlower \- convert a wide character to lowercase +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wint_t towlower(wint_t " wc ); +.fi +.SH DESCRIPTION +The +.BR towlower () +function is the wide-character equivalent of the +.BR tolower (3) +function. +If \fIwc\fP is a wide character, it is converted to +lowercase. +Characters which do not have case are returned unchanged. +If \fIwc\fP is \fBWEOF\fP, \fBWEOF\fP is returned. +.SH "RETURN VALUE" +The +.BR towlower () +function returns the lowercase equivalent of \fIwc\fP, +or \fBWEOF\fP if \fIwc\fP is \fBWEOF\fP. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR towlower () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +This function is not very appropriate for dealing with Unicode characters, +because Unicode knows about three cases: upper, lower and title case. +.SH "SEE ALSO" +.BR iswlower (3), +.BR towctrans (3), +.BR towupper (3) diff --git a/original/man3/towupper.3 b/original/man3/towupper.3 new file mode 100644 index 00000000..33bd30ae --- /dev/null +++ b/original/man3/towupper.3 @@ -0,0 +1,53 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH TOWUPPER 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +towupper \- convert a wide character to uppercase +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wint_t towupper(wint_t " wc ); +.fi +.SH DESCRIPTION +The +.BR towupper () +function is the wide-character equivalent of the +.BR toupper (3) +function. +If \fIwc\fP is a wide character, it is converted to +uppercase. +Characters which do not have case are returned unchanged. +If \fIwc\fP is \fBWEOF\fP, \fBWEOF\fP is returned. +.SH "RETURN VALUE" +The +.BR towupper () +function returns the uppercase equivalent of \fIwc\fP, +or \fBWEOF\fP if \fIwc\fP is \fBWEOF\fP. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR towupper () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +This function is not very appropriate for dealing with Unicode characters, +because Unicode knows about three cases: upper, lower and title case. +.SH "SEE ALSO" +.BR iswupper (3), +.BR towctrans (3), +.BR towlower (3) diff --git a/original/man3/trunc.3 b/original/man3/trunc.3 new file mode 100644 index 00000000..1ba68f88 --- /dev/null +++ b/original/man3/trunc.3 @@ -0,0 +1,79 @@ +.\" 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. +.\" +.TH TRUNC 3 2008-08-11 "" "Linux Programmer's Manual" +.SH NAME +trunc, truncf, truncl \- round to integer, towards zero +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double trunc(double " x ); +.br +.BI "float truncf(float " x ); +.br +.BI "long double truncl(long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR trunc (), +.BR truncf (), +.BR truncl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +These functions round \fIx\fP to the nearest integer +not larger in absolute value. +.SH "RETURN VALUE" +These functions return the rounded integer value. + +If \fIx\fP is integral, infinite, or NaN, \fIx\fP itself is returned. +.SH ERRORS +No errors occur. +.SH VERSIONS +These functions first appeared in glibc in version 2.1. +.SH "CONFORMING TO" +C99, POSIX.1-2001. +.SH NOTES +The integral value returned by these functions may be too large +to store in an integer type +.RI ( int , +.IR long , +etc.). +To avoid an overflow, which will produce undefined results, +an application should perform a range check on the returned value +before assigning it to an integer type. +.SH "SEE ALSO" +.BR ceil (3), +.BR floor (3), +.BR lrint (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3) diff --git a/original/man3/truncf.3 b/original/man3/truncf.3 new file mode 100644 index 00000000..b8593416 --- /dev/null +++ b/original/man3/truncf.3 @@ -0,0 +1 @@ +.so man3/trunc.3 diff --git a/original/man3/truncl.3 b/original/man3/truncl.3 new file mode 100644 index 00000000..b8593416 --- /dev/null +++ b/original/man3/truncl.3 @@ -0,0 +1 @@ +.so man3/trunc.3 diff --git a/original/man3/tsearch.3 b/original/man3/tsearch.3 new file mode 100644 index 00000000..565d3313 --- /dev/null +++ b/original/man3/tsearch.3 @@ -0,0 +1,263 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" Copyright 1995 by Jim Van Zandt +.\" +.\" 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. +.\" +.TH TSEARCH 3 2008-09-23 "GNU" "Linux Programmer's Manual" +.SH NAME +tsearch, tfind, tdelete, twalk, tdestroy \- manage a binary tree +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void *tsearch(const void *" key ", void **" rootp , +.BI " int (*" compar ")(const void *, const void *));" +.sp +.BI "void *tfind(const void *" key ", const void **" rootp , +.BI " int (*" compar ")(const void *, const void *));" +.sp +.BI "void *tdelete(const void *" key ", void **" rootp , +.BI " int (*" compar ")(const void *, const void *));" +.sp +.BI "void twalk(const void *" root ", void (*" action ")(const void *" nodep , +.BI " const VISIT " which , +.BI " const int " depth "));" +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "void tdestroy(void *" root ", void (*" free_node ")(void *" nodep )); +.fi +.SH DESCRIPTION +.BR tsearch (), +.BR tfind (), +.BR twalk (), +and +.BR tdelete () +manage a +binary tree. +They are generalized from Knuth (6.2.2) Algorithm T. +The first field in each node of the tree is a pointer to the +corresponding data item. +(The calling program must store the actual data.) +\fIcompar\fP points to a comparison routine, which takes +pointers to two items. +It should return an integer which is negative, +zero, or positive, depending on whether the first item is less than, +equal to, or greater than the second. +.PP +.BR tsearch () +searches the tree for an item. +\fIkey\fP points to the item to be searched for. +\fIrootp\fP points to a variable which points to the root of the tree. +If the tree is empty, +then the variable that \fIrootp\fP points to should be set to NULL. +If the item is found in the tree, then +.BR tsearch () +returns a pointer +to it. +If it is not found, then +.BR tsearch () +adds it, and returns a +pointer to the newly added item. +.PP +.BR tfind () +is like +.BR tsearch (), +except that if the item is not +found, then +.BR tfind () +returns NULL. +.PP +.BR tdelete () +deletes an item from the tree. +Its arguments are the same as for +.BR tsearch (). +.PP +.BR twalk () +performs depth-first, left-to-right traversal of a binary +tree. +\fIroot\fP points to the starting node for the traversal. +If that node is not the root, then only part of the tree will be visited. +.BR twalk () +calls the user function \fIaction\fP each time a node is +visited (that is, three times for an internal node, and once for a +leaf). +\fIaction\fP, in turn, takes three arguments. +The first is a pointer to the node being visited. +The second is an integer which +takes on the values \fBpreorder\fP, \fBpostorder\fP, and +\fBendorder\fP depending on whether this is the first, second, or +third visit to the internal node, or \fBleaf\fP if it is the single +visit to a leaf node. +(These symbols are defined in \fI\fP.) +The third argument is the depth of the node, with +zero being the root. +.PP +(More commonly, \fBpreorder\fP, \fBpostorder\fP, and \fBendorder\fP +are known as \fBpreorder\fP, \fBinorder\fP, and \fBpostorder\fP: +before visiting the children, after the first and before the second, +and after visiting the children. +Thus, the choice of name \fBpost\%order\fP +is rather confusing.) +.PP +.BR tdestroy () +removes the whole tree pointed to by \fIroot\fP, +freeing all resources allocated by the +.BR tsearch () +function. +For the data in each tree node the function \fIfree_node\fP is called. +The pointer to the data is passed as the argument to the function. +If no such work is necessary \fIfree_node\fP must point to a function +doing nothing. +.SH "RETURN VALUE" +.BR tsearch () +returns a pointer to a matching item in the tree, or to +the newly added item, or NULL if there was insufficient memory +to add the item. +.BR tfind () +returns a pointer to the item, or +NULL if no match is found. +If there are multiple elements that match the key, +the element returned is unspecified. +.PP +.BR tdelete () +returns a pointer to the parent of the item deleted, or +NULL if the item was not found. +.PP +.BR tsearch (), +.BR tfind (), +and +.BR tdelete () +also +return NULL if \fIrootp\fP was NULL on entry. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +The function +.BR tdestroy () +is a GNU extension. +.SH NOTES +.BR twalk () +takes a pointer to the root, while the other functions +take a pointer to a variable which points to the root. +.PP +.BR twalk () +uses \fBpostorder\fP to mean "after the left subtree, but +before the right subtree". +Some authorities would call this +"inorder", and reserve "postorder" to mean "after both subtrees". +.PP +.BR tdelete () +frees the memory required for the node in the tree. +The user is responsible for freeing the memory for the corresponding +data. +.PP +The example program depends on the fact that +.BR twalk () +makes no +further reference to a node after calling the user function with +argument "endorder" or "leaf". +This works with the GNU library +implementation, but is not in the System V documentation. +.SH EXAMPLE +The following program inserts twelve random numbers into a binary +tree, where duplicate numbers are collapsed, then prints the numbers +in order. +.sp +.nf +#define _GNU_SOURCE /* Expose declaration of tdestroy() */ +#include +#include +#include +#include + +void *root = NULL; + +void * +xmalloc(unsigned n) +{ + void *p; + p = malloc(n); + if (p) + return p; + fprintf(stderr, "insufficient memory\\n"); + exit(EXIT_FAILURE); +} + +int +compare(const void *pa, const void *pb) +{ + if (*(int *) pa < *(int *) pb) + return \-1; + if (*(int *) pa > *(int *) pb) + return 1; + return 0; +} + +void +action(const void *nodep, const VISIT which, const int depth) +{ + int *datap; + + switch (which) { + case preorder: + break; + case postorder: + datap = *(int **) nodep; + printf("%6d\\n", *datap); + break; + case endorder: + break; + case leaf: + datap = *(int **) nodep; + printf("%6d\\n", *datap); + break; + } +} + +int +main(void) +{ + int i, *ptr; + void *val; + + srand(time(NULL)); + for (i = 0; i < 12; i++) { + ptr = (int *) xmalloc(sizeof(int)); + *ptr = rand() & 0xff; + val = tsearch((void *) ptr, &root, compare); + if (val == NULL) + exit(EXIT_FAILURE); + else if ((*(int **) val) != ptr) + free(ptr); + } + twalk(root, action); + tdestroy(root, free); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR bsearch (3), +.BR hsearch (3), +.BR lsearch (3), +.BR qsort (3), +.BR feature_test_macros (7) diff --git a/original/man3/ttyname.3 b/original/man3/ttyname.3 new file mode 100644 index 00000000..08fb2b7b --- /dev/null +++ b/original/man3/ttyname.3 @@ -0,0 +1,77 @@ +.\" Copyright (c) 1995 Jim Van Zandt +.\" +.\" 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 2001-12-13, Martin Schulze +.\" Added ttyname_r, aeb, 2002-07-20 +.\" +.TH TTYNAME 3 2008-07-14 "Linux" "Linux Programmer's Manual" +.SH NAME +ttyname, ttyname_r \- return name of a terminal +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "char *ttyname(int " fd ); + +.BI "int ttyname_r(int " fd ", char *" buf ", size_t " buflen ); +.fi +.SH DESCRIPTION +The function +.BR ttyname () +returns a pointer to the null-terminated pathname of the terminal device +that is open on the file descriptor \fIfd\fP, or NULL on error +(for example, if \fIfd\fP is not connected to a terminal). +The return value may point to static data, possibly overwritten by the +next call. +The function +.BR ttyname_r () +stores this pathname in the buffer +.I buf +of length +.IR buflen . +.SH "RETURN VALUE" +The function +.BR ttyname () +returns a pointer to a pathname on success. +On error, NULL is returned, and +.I errno +is set appropriately. +The function +.BR ttyname_r () +returns 0 on success, and an error number upon error. +.SH ERRORS +.BR ttyname_r (): +.TP +.B EBADF +Bad file descriptor. +.TP +.B ENOTTY +File descriptor does not refer to a terminal device. +.TP +.B ERANGE +.I buflen +was too small to allow storing the pathname. +.SH "CONFORMING TO" +4.2BSD, POSIX.1-2001. +.SH "SEE ALSO" +.BR fstat (2), +.BR isatty (3) diff --git a/original/man3/ttyname_r.3 b/original/man3/ttyname_r.3 new file mode 100644 index 00000000..aaa18ee8 --- /dev/null +++ b/original/man3/ttyname_r.3 @@ -0,0 +1 @@ +.so man3/ttyname.3 diff --git a/original/man3/ttyslot.3 b/original/man3/ttyslot.3 new file mode 100644 index 00000000..681d8c60 --- /dev/null +++ b/original/man3/ttyslot.3 @@ -0,0 +1,143 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.\" +.TH TTYSLOT 3 2007-11-26 "GNU" "Linux Programmer's Manual" +.SH NAME +ttyslot \- find the slot of the current user's terminal in some file +.SH SYNOPSIS +.BR "#include " " /* on BSD-like systems, and Linux */" +.br +.BR "#include " " /* on System V-like systems */" +.sp +.B "int ttyslot(void);" +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR ttyslot (): +_BSD_SOURCE || (_XOPEN_SOURCE_EXTENDED && !\ _XOPEN_SOURCE\ >=\ 500) +.ad b +.SH DESCRIPTION +The legacy function +.BR ttyslot () +returns the index of the current user's entry in some file. +.LP +Now "What file?" you ask. +Well, let's first look at some history. +.SS "Ancient History" +There used to be a file +.I /etc/ttys +in Unix V6, that was read by the +.BR init (8) +program to find out what to do with each terminal line. +Each line consisted of three characters. +The first character was either \(aq0\(aq or \(aq1\(aq, +where \(aq0\(aq meant "ignore". +The second character denoted the terminal: \(aq8\(aq stood for "/dev/tty8". +The third character was an argument to +.BR getty (8) +indicating the sequence of line speeds to try (\(aq\-\(aq was: start trying +110 baud). +Thus a typical line was "18\-". +A hang on some line was solved by changing the \(aq1\(aq to a \(aq0\(aq, +signaling init, changing back again, and signaling init again. +.LP +In Unix V7 the format was changed: here the second character +was the argument to +.BR getty (8) +indicating the sequence of line speeds to try (\(aq0\(aq was: cycle through +300-1200-150-110 baud; \(aq4\(aq was for the on-line console DECwriter) +while the rest of the line contained the name of the tty. +Thus a typical line was "14console". +.LP +Later systems have more elaborate syntax. +System V-like systems have +.I /etc/inittab +instead. +.SS "Ancient History (2)" +On the other hand, there is the file +.I /etc/utmp +listing the people currently logged in. +It is maintained by +.BR login (1). +It has a fixed size, and the appropriate index in the file was +determined by +.BR login (1) +using the +.BR ttyslot () +call to find the number of the line in +.I /etc/ttys +(counting from 1). +.SS "The semantics of ttyslot" +Thus, the function +.BR ttyslot () +returns the index of the controlling terminal of the calling process +in the file +.IR /etc/ttys , +and that is (usually) the same as the index of the entry for the +current user in the file +.IR /etc/utmp . +BSD still has the +.I /etc/ttys +file, but System V-like systems do not, and hence cannot refer to it. +Thus, on such systems the documentation says that +.BR ttyslot () +returns the current user's index in the user accounting data base. +.SH "RETURN VALUE" +If successful, this function returns the slot number. +On error (e.g., if none of the file descriptors 0, 1 or 2 is +associated with a terminal that occurs in this data base) +it returns 0 on Unix V6 and V7 and BSD-like systems, +but \-1 on System V-like systems. +.SH "CONFORMING TO" +SUSv1; marked as LEGACY in SUSv2; removed in POSIX.1-2001. +SUSv2 requires \-1 on error. +.SH NOTES +The utmp file is found various places on various systems, such as +.IR /etc/utmp , +.IR /var/adm/utmp , +.IR /var/run/utmp . +.LP +The glibc2 implementation of this function reads the file +.BR _PATH_TTYS , +defined in +.I +as "/etc/ttys". +It returns 0 on error. +Since Linux systems do not usually have "/etc/ttys", it will +always return 0. +.LP +Minix also has +.IR fttyslot ( fd ). +.\" .SH HISTORY +.\" .BR ttyslot () +.\" appeared in Unix V7. +.SH "SEE ALSO" +.BR getttyent (3), +.BR ttyname (3), +.BR utmp (5) diff --git a/original/man3/twalk.3 b/original/man3/twalk.3 new file mode 100644 index 00000000..72f12519 --- /dev/null +++ b/original/man3/twalk.3 @@ -0,0 +1 @@ +.so man3/tsearch.3 diff --git a/original/man3/tzname.3 b/original/man3/tzname.3 new file mode 100644 index 00000000..80907636 --- /dev/null +++ b/original/man3/tzname.3 @@ -0,0 +1 @@ +.so man3/tzset.3 diff --git a/original/man3/tzset.3 b/original/man3/tzset.3 new file mode 100644 index 00000000..a5ac158d --- /dev/null +++ b/original/man3/tzset.3 @@ -0,0 +1,235 @@ +.\" 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 Sun Jul 25 11:01:58 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2001-11-13, aeb +.\" Modified 2004-12-01 mtk and Martin Schulze +.\" +.TH TZSET 3 2010-02-25 "" "Linux Programmer's Manual" +.SH NAME +tzset, tzname, timezone, daylight \- initialize time conversion information +.SH SYNOPSIS +.nf +.B #include +.sp +.B void tzset (void); +.sp +.BI "extern char *" tzname [2]; +.BI "extern long " timezone ; +.BI "extern int " daylight ; +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR tzset (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.br +.IR tzname : +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.br +.IR timezone : +_SVID_SOURCE || _XOPEN_SOURCE +.br +.IR daylight : +_SVID_SOURCE || _XOPEN_SOURCE +.SH DESCRIPTION +The +.BR tzset () +function initializes the \fItzname\fP variable from the +.B TZ +environment variable. +This function is automatically called by the +other time conversion functions that depend on the timezone. +In a System-V-like environment, it will also set the variables \fItimezone\fP +(seconds West of UTC) and \fIdaylight\fP (to 0 if this timezone does not +have any daylight saving time rules, or to nonzero if there is a time during +the year when daylight saving time applies). +.PP +If the +.B TZ +variable does not appear in the environment, the \fItzname\fP +variable is initialized with the best approximation of local wall clock +time, as specified by the +.BR tzfile (5)-format +file \fIlocaltime\fP +found in the system timezone directory (see below). +(One also often sees +.I /etc/localtime +used here, a symlink to the right file in the system timezone directory.) +.PP +If the +.B TZ +variable does appear in the environment but its value is empty +or its value cannot be interpreted using any of the formats specified +below, Coordinated Universal Time (UTC) is used. +.PP +The value of +.B TZ +can be one of three formats. +The first format is used +when there is no daylight saving time in the local timezone: +.sp +.RS +.I std offset +.RE +.sp +The \fIstd\fP string specifies the name of the timezone and must be +three or more alphabetic characters. +The \fIoffset\fP string immediately +follows \fIstd\fP and specifies the time value to be added to the local +time to get Coordinated Universal Time (UTC). +The \fIoffset\fP is positive +if the local timezone is west of the Prime Meridian and negative if it is +east. +The hour must be between 0 and 24, and the minutes and seconds +0 and 59. +.PP +The second format is used when there is daylight saving time: +.sp +.RS +.I std offset dst [offset],start[/time],end[/time] +.RE +.sp +There are no spaces in the specification. +The initial \fIstd\fP and +\fIoffset\fP specify the standard timezone, as described above. +The \fIdst\fP string and \fIoffset\fP specify the name and offset for the +corresponding daylight saving timezone. +If the offset is omitted, +it default to one hour ahead of standard time. +.PP +The \fIstart\fP field specifies when daylight saving time goes into +effect and the \fIend\fP field specifies when the change is made back to +standard time. +These fields may have the following formats: +.TP +J\fIn\fP +This specifies the Julian day with \fIn\fP between 1 and 365. +February 29 is never counted even in leap years. +.TP +.I n +This specifies the Julian day with \fIn\fP between 1 and 365. +February 29 is counted in leap years. +.TP +M\fIm\fP.\fIw\fP.\fId\fP +This specifies day \fId\fP (0 <= \fId\fP <= 6) of week \fIw\fP +(1 <= \fIw\fP <= 5) of month \fIm\fP (1 <= \fIm\fP <= 12). +Week 1 is +the first week in which day \fId\fP occurs and week 5 is the last week +in which day \fId\fP occurs. +Day 0 is a Sunday. +.PP +The \fItime\fP fields specify when, in the local time currently in effect, +the change to the other time occurs. +If omitted, the default is 02:00:00. + +Here is an example for New Zealand, +where the standard time (NZST) is 12 hours ahead of UTC, +and daylight saving time (NZDT), 13 hours ahead of UTC, +runs from the first Sunday in October to the third Sunday in March, +and the changeovers happen at the default time of 02:00:00: +.nf + + TZ="NZST-12.00:00NZDT-13:00:00,M10.1.0,M3.3.0" +.fi +.PP +The third format specifies that the timezone information should be read +from a file: +.sp +.RS +:[filespec] +.RE +.sp +If the file specification \fIfilespec\fP is omitted, the timezone +information is read from the file +.I localtime +in the system timezone directory, which nowadays usually is +.IR /usr/share/zoneinfo . +This file is in +.BR tzfile (5) +format. +If \fIfilespec\fP is given, it specifies another +.BR tzfile (5)-format +file to read the timezone information from. +If \fIfilespec\fP does not begin with a \(aq/\(aq, the file specification is +relative to the system timezone directory. +.PP +Here's an example, once more for New Zealand: +.nf + + TZ=":Pacific/Auckland" +.fi +.SH FILES +The system timezone directory used depends on the (g)libc version. +Libc4 and libc5 use +.IR /usr/lib/zoneinfo , +and, since libc-5.4.6, +when this doesn't work, will try +.IR /usr/share/zoneinfo . +Glibc2 will use the environment variable +.BR TZDIR , +when that exists. +Its default depends on how it was installed, but normally is +.IR /usr/share/zoneinfo . +.LP +This timezone directory contains the files +.nf +localtime local timezone file +posixrules rules for POSIX-style TZ's +.fi +.LP +Often +.I /etc/localtime +is a symlink to the file +.I localtime +or to the correct timezone file in the system timezone directory. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001, 4.3BSD. +.SH NOTES +Note that the variable \fIdaylight\fP does not indicate that daylight +saving time applies right now. +It used to give the number of some +algorithm (see the variable \fItz_dsttime\fP in +.BR gettimeofday (2)). +It has been obsolete for many years but is required by SUSv2. +.LP +4.3BSD had a function +.BI "char *timezone(" zone ", " dst ) +that returned the +name of the timezone corresponding to its first argument (minutes +West of UTC). +If the second argument was 0, the standard name was used, +otherwise the daylight saving time version. +.SH "SEE ALSO" +.BR date (1), +.BR gettimeofday (2), +.BR time (2), +.BR ctime (3), +.BR getenv (3), +.BR tzfile (5) diff --git a/original/man3/ualarm.3 b/original/man3/ualarm.3 new file mode 100644 index 00000000..755440da --- /dev/null +++ b/original/man3/ualarm.3 @@ -0,0 +1,124 @@ +.\" 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. +.\" +.TH UALARM 3 2008-08-06 "" "Linux Programmer's Manual" +.SH NAME +ualarm \- schedule signal after given number of microseconds +.SH SYNOPSIS +.nf +.B "#include " +.sp +.BI "useconds_t ualarm(useconds_t " usecs ", useconds_t " interval ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR ualarm (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +The +.BR ualarm () +function causes the signal +.B SIGALRM +to be sent to the invoking process after (not less than) +.I usecs +microseconds. +The delay may be lengthened slightly by any system activity +or by the time spent processing the call or by the +granularity of system timers. +.LP +Unless caught or ignored, the +.B SIGALRM +signal will terminate the process. +.LP +If the +.I interval +argument is nonzero, further +.B SIGALRM +signals will be sent every +.I interval +microseconds after the first. +.SH "RETURN VALUE" +This function returns the number of microseconds remaining for +any alarm that was previously set, or 0 if no alarm was pending. +.SH ERRORS +.TP +.B EINTR +Interrupted by a signal. +.TP +.B EINVAL +\fIusecs\fP or \fIinterval\fP is not smaller than 1000000. +(On systems where that is considered an error.) +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +POSIX.1-2001 marks +.BR ualarm () +as obsolete. +POSIX.1-2008 removes the specification of +.BR ualarm (). +4.3BSD, SUSv2, and POSIX do not define any errors. +.SH NOTES +The type +.I useconds_t +is an unsigned integer type capable of holding integers +in the range [0,1000000]. +On the original BSD implementation, and in glibc before version 2.1, +the arguments to +.BR ualarm () +were instead typed as +.IR "unsigned int" . +Programs will be more portable if they never mention +.I useconds_t +explicitly. +.LP +The interaction of this function with +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) +is unspecified. +.LP +This function is obsolete. +Use +.BR setitimer (2) +or POSIX interval timers +.RB ( timer_create (2), +etc.) +instead. +.SH "SEE ALSO" +.BR alarm (2), +.BR getitimer (2), +.BR nanosleep (2), +.BR select (2), +.BR setitimer (2), +.BR usleep (3), +.BR time (7) diff --git a/original/man3/ulckpwdf.3 b/original/man3/ulckpwdf.3 new file mode 100644 index 00000000..142c5a5c --- /dev/null +++ b/original/man3/ulckpwdf.3 @@ -0,0 +1 @@ +.so man3/getspnam.3 diff --git a/original/man3/ulimit.3 b/original/man3/ulimit.3 new file mode 100644 index 00000000..7c9ad076 --- /dev/null +++ b/original/man3/ulimit.3 @@ -0,0 +1,87 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1996 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. +.\" +.\" Moved to man3, aeb, 980612 +.\" +.TH ULIMIT 3 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH NAME +ulimit \- get and set user limits +.SH SYNOPSIS +.B #include +.sp +.BI "long ulimit(int " cmd ", long " newlimit ); +.SH DESCRIPTION +Warning: This routine is obsolete. +Use +.BR getrlimit (2), +.BR setrlimit (2), +and +.BR sysconf (3) +instead. +For the shell command +.BR ulimit (), +see +.BR bash (1). + +The +.BR ulimit () +call will get or set some limit for the calling process. +The +.I cmd +argument can have one of the following values. +.TP +.B UL_GETFSIZE +Return the limit on the size of a file, in units of 512 bytes. +.TP +.B UL_SETFSIZE +Set the limit on the size of a file. +.TP +.B 3 +(Not implemented for Linux.) +Return the maximum possible address of the data segment. +.TP +.B 4 +(Implemented but no symbolic constant provided.) +Return the maximum number of files that the calling process can open. +.SH "RETURN VALUE" +On success, +.BR ulimit () +returns a nonnegative value. +On error, \-1 is returned, and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EPERM +A unprivileged process tried to increase a limit. +.SH "CONFORMING TO" +SVr4, POSIX.1-2001. +POSIX.1-2008 marks +.BR ulimit () +as obsolete. +.SH "SEE ALSO" +.BR bash (1), +.BR getrlimit (2), +.BR setrlimit (2), +.BR sysconf (3) diff --git a/original/man3/undocumented.3 b/original/man3/undocumented.3 new file mode 100644 index 00000000..01be94ea --- /dev/null +++ b/original/man3/undocumented.3 @@ -0,0 +1,190 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1995 Jim Van Zandt +.\" From jrv@vanzandt.mv.com Mon Sep 4 21:11:50 1995 +.\" +.\" 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. +.\" +.\" 1996-11-08, meem@sherilyn.wustl.edu, corrections +.\" 2004-10-31, aeb, changed maintainer address, updated list +.\" +.TH UNDOCUMENTED 3 2010-02-10 "Linux" "Linux Programmer's Manual" +.SH NAME +none \- undocumented library functions +.SH SYNOPSIS +Undocumented library functions +.SH DESCRIPTION +This man page mentions those library functions which are implemented in +the standard libraries but not yet documented in man pages. +.SS Solicitation +If you have information about these functions, +please look in the source code, write a man page (using a style +similar to that of the other Linux section 3 man pages), and send it to +.B mtk.manpages@gmail.com +for inclusion in the next man page release. +.SS "The List" + +.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) diff --git a/original/man3/ungetc.3 b/original/man3/ungetc.3 new file mode 100644 index 00000000..4636db71 --- /dev/null +++ b/original/man3/ungetc.3 @@ -0,0 +1 @@ +.so man3/gets.3 diff --git a/original/man3/ungetwc.3 b/original/man3/ungetwc.3 new file mode 100644 index 00000000..9d3fb4ae --- /dev/null +++ b/original/man3/ungetwc.3 @@ -0,0 +1,63 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH UNGETWC 3 1999-09-19 "GNU" "Linux Programmer's Manual" +.SH NAME +ungetwc \- push back a wide character onto a FILE stream +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wint_t ungetwc(wint_t " wc ", FILE *" stream ); +.fi +.SH DESCRIPTION +The +.BR ungetwc () +function is the wide-character equivalent of the +.BR ungetc (3) +function. +It pushes back a wide character onto \fIstream\fP and returns it. +.PP +If \fIwc\fP is \fBWEOF\fP, it returns \fBWEOF\fP. +If \fIwc\fP is an invalid wide character, +it sets \fIerrno\fP to \fBEILSEQ\fP and returns \fBWEOF\fP. +.PP +If \fIwc\fP is a valid wide character, it is pushed back onto the stream +and thus becomes available for future wide-character read operations. +The file-position indicator is decremented by one or more. +The end-of-file +indicator is cleared. +The backing storage of the file is not affected. +.PP +Note: \fIwc\fP need not be the last wide-character read from the stream; +it can be any other valid wide character. +.PP +If the implementation supports multiple push-back operations in a row, the +pushed-back wide characters will be read in reverse order; however, only one +level of push-back is guaranteed. +.SH "RETURN VALUE" +The +.BR ungetwc () +function returns \fIwc\fP when successful, or \fBWEOF\fP upon +failure. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR ungetwc () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR fgetwc (3) diff --git a/original/man3/unlocked_stdio.3 b/original/man3/unlocked_stdio.3 new file mode 100644 index 00000000..1af59030 --- /dev/null +++ b/original/man3/unlocked_stdio.3 @@ -0,0 +1,131 @@ +.\" 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. +.\" +.TH UNLOCKED_STDIO 3 2008-08-29 "" "Linux Programmer's Manual" +.SH NAME +getc_unlocked, getchar_unlocked, putc_unlocked, +putchar_unlocked \- nonlocking stdio functions +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int getc_unlocked(FILE *" stream ); +.B "int getchar_unlocked(void);" +.BI "int putc_unlocked(int " c ", FILE *" stream ); +.BI "int putchar_unlocked(int " c ); +.sp +.BI "void clearerr_unlocked(FILE *" stream ); +.BI "int feof_unlocked(FILE *" stream ); +.BI "int ferror_unlocked(FILE *" stream ); +.BI "int fileno_unlocked(FILE *" stream ); +.BI "int fflush_unlocked(FILE *" stream ); +.BI "int fgetc_unlocked(FILE *" stream ); +.BI "int fputc_unlocked(int " c ", FILE *" stream ); +.BI "size_t fread_unlocked(void *" ptr ", size_t " size ", size_t " n , +.BI " FILE *" stream ); +.BI "size_t fwrite_unlocked(const void *" ptr ", size_t " size ", size_t " n , +.BI " FILE *" stream ); +.sp +.BI "char *fgets_unlocked(char *" s ", int " n ", FILE *" stream ); +.BI "int fputs_unlocked(const char *" s ", FILE *" stream ); +.sp +.B #include +.sp +.BI "wint_t getwc_unlocked(FILE *" stream ); +.B "wint_t getwchar_unlocked(void);" +.BI "wint_t fgetwc_unlocked(FILE *" stream ); +.BI "wint_t fputwc_unlocked(wchar_t " wc ", FILE *" stream ); +.BI "wint_t putwc_unlocked(wchar_t " wc ", FILE *" stream ); +.BI "wint_t putwchar_unlocked(wchar_t " wc ); +.BI "wchar_t *fgetws_unlocked(wchar_t *" ws ", int " n ", FILE *" stream ); +.BI "int fputws_unlocked(const wchar_t *" ws ", FILE *" stream ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.ad l +.in +.sp +.BR getc_unlocked (), +.BR getchar_unlocked (), +.BR putc_unlocked (), +.BR putchar_unlocked (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE || +_BSD_SOURCE || _SVID_SOURCE +.sp +.BR clearerr_unlocked (), +.BR feof_unlocked (), +.BR ferror_unlocked (), +.BR fileno_unlocked (), +.BR fflush_unlocked (), +.BR fgetc_unlocked (), +.BR fputc_unlocked (), +.BR fread_unlocked (), +.BR fwrite_unlocked (): +_BSD_SOURCE || _SVID_SOURCE +.sp +.BR fgets_unlocked (), +.BR fputs_unlocked (), +.BR getwc_unlocked (), +.BR getwchar_unlocked (), +.BR fgetwc_unlocked (), +.BR fputwc_unlocked (), +.BR putwchar_unlocked (), +.BR fgetws_unlocked (), +.BR fputws_unlocked (): +_GNU_SOURCE +.ad b +.SH DESCRIPTION +Each of these functions has the same behavior as its counterpart +without the "_unlocked" suffix, except that they do not use locking +(they do not set locks themselves, and do not test for the presence +of locks set by others) and hence are thread-unsafe. +See +.BR flockfile (3). +.SH "CONFORMING TO" +The four functions +.BR getc_unlocked (), +.BR getchar_unlocked (), +.BR putc_unlocked (), +.BR putchar_unlocked () +are in POSIX.1-2001. + +The nonstandard +.BR *_unlocked () +variants occur on a few Unix systems, and are available in recent glibc. +.\" E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and +.\" moved to a compatibility library. +.\" Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked, +.\" feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked, +.\" fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked, +.\" fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked, +.\" ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked, +.\" getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked, +.\" putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked, +.\" putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked, +.\" ungetc_unlocked, ungetwc_unlocked. +They should probably not be used. +.SH "SEE ALSO" +.BR flockfile (3), +.BR stdio (3), +.BR feature_test_macros (7) diff --git a/original/man3/unlockpt.3 b/original/man3/unlockpt.3 new file mode 100644 index 00000000..8c165a97 --- /dev/null +++ b/original/man3/unlockpt.3 @@ -0,0 +1,53 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This page is in the public domain. - aeb +.\" +.TH UNLOCKPT 3 2008-06-14 "" "Linux Programmer's Manual" +.SH NAME +unlockpt \- unlock a pseudo-terminal master/slave pair +.SH SYNOPSIS +.nf +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "int unlockpt(int " fd ");" +.fi +.SH DESCRIPTION +The +.BR unlockpt () +function unlocks the slave pseudo-terminal device +(pty) corresponding to the master pty referred to by +.IR fd . +.PP +.BR unlockpt () +should be called before opening the slave side of a pty. +.SH "RETURN VALUE" +When successful, +.BR unlockpt () +returns 0. +Otherwise, it returns \-1 and sets +.I errno +appropriately. +.SH ERRORS +.TP +.B EBADF +The +.I fd +argument is not a file descriptor open for writing. +.TP +.B EINVAL +The +.I fd +argument is not associated with a master pty. +.SH VERSIONS +.BR unlockpt () +is provided in glibc since version 2.1. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH "SEE ALSO" +.BR grantpt (3), +.BR posix_openpt (3), +.BR ptsname (3), +.BR pts (4), +.BR feature_test_macros (7), +.BR pty (7) diff --git a/original/man3/unsetenv.3 b/original/man3/unsetenv.3 new file mode 100644 index 00000000..19ec56c2 --- /dev/null +++ b/original/man3/unsetenv.3 @@ -0,0 +1 @@ +.so man3/setenv.3 diff --git a/original/man3/updwtmp.3 b/original/man3/updwtmp.3 new file mode 100644 index 00000000..ce45b27c --- /dev/null +++ b/original/man3/updwtmp.3 @@ -0,0 +1,83 @@ +.\" Copyright 1997 Nicolás Lichtmaier +.\" Created Wed Jul 2 23:27:34 ART 1997 +.\" +.\" 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. +.\" +.\" Added info on availability, aeb, 971207 +.\" Added -lutil remark, 030718 +.\" 2008-07-02, mtk, document updwtmpx() +.\" +.TH UPDWTMP 3 2008-07-02 "GNU" "Linux Programmer's Manual" +.SH NAME +updwtmp, logwtmp \- append an entry to the wtmp file +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void updwtmp(const char *" wtmp_file ", const struct utmp *" ut ); +.br +.BI "void logwtmp(const char *" line ", const char *" name \ +", const char *" host ); +.fi +.SH DESCRIPTION +.BR updwtmp () +appends the utmp structure +.I ut +to the wtmp file. +.PP +.BR logwtmp () +constructs a utmp structure using +.IR line ", " name ", " host , +current time and current process ID. +Then it calls +.BR updwtmp () +to append the structure to the wtmp file. +.SH FILES +.TP +.I /var/log/wtmp +database of past user logins +.SH "CONFORMING TO" +Not in POSIX.1-2001. +Present on Solaris, NetBSD, and perhaps other systems. +.SH AVAILABILITY +Both functions are available under glibc2, but not under libc5. +However, +.BR logwtmp () +used to occur in the old libbsd. +These days, the +.BR logwtmp () +function is included in libutil. +(Hence you'll need to add \fI\-lutil\fP +to your compiler command line to get it.) +.SH NOTES +For consistency with the other "utmpx" functions (see +.BR getutxent (3)), +glibc provides (since version 2.1): +.nf +.sp +.B #include +.sp +.BI "void updwtmpx (const char *" wtmpx_file ", const struct utmpx *" utx ); +.fi +.PP +This function performs the same task as +.BR updwtmp (), +but differs in that it takes a +.I utmpx +structure as its last argument. +.SH "SEE ALSO" +.BR getutxent (3), +.BR wtmp (5) diff --git a/original/man3/updwtmpx.3 b/original/man3/updwtmpx.3 new file mode 100644 index 00000000..0dc4dea3 --- /dev/null +++ b/original/man3/updwtmpx.3 @@ -0,0 +1 @@ +.so man3/updwtmp.3 diff --git a/original/man3/usleep.3 b/original/man3/usleep.3 new file mode 100644 index 00000000..9b403b48 --- /dev/null +++ b/original/man3/usleep.3 @@ -0,0 +1,126 @@ +.\" 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-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2001-04-01 by aeb +.\" Modified 2003-07-23 by aeb +.\" +.TH USLEEP 3 2007-07-26 "" "Linux Programmer's Manual" +.SH NAME +usleep \- suspend execution for microsecond intervals +.SH SYNOPSIS +.nf +.B "#include " +.sp +.BI "int usleep(useconds_t " usec ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR usleep (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH DESCRIPTION +The +.BR usleep () +function suspends execution of the calling process for +(at least) \fIusec\fP microseconds. +The sleep may be lengthened slightly +by any system activity or by the time spent processing the call or by the +granularity of system timers. +.SH "RETURN VALUE" +0 on success, \-1 on error. +.SH ERRORS +.TP +.B EINTR +Interrupted by a signal; see +.BR signal (7). +.TP +.B EINVAL +\fIusec\fP is not smaller than 1000000. +(On systems where that is considered an error.) +.SH "CONFORMING TO" +4.3BSD, POSIX.1-2001. +POSIX.1-2001 declares this function obsolete; use +.BR nanosleep (2) +instead. +POSIX.1-2008 removes the specification of +.BR usleep (). + +On the original BSD implementation, +and in glibc before version 2.2.2, the return type of this function is +.IR void . +The POSIX version returns +.IR int , +and this is also the prototype used since glibc 2.2.2. + +Only the +.B EINVAL +error return is documented by SUSv2 and POSIX.1-2001. +.SH NOTES +The type +.I useconds_t +is an unsigned integer type capable of holding integers +in the range [0,1000000]. +Programs will be more portable +if they never mention this type explicitly. +Use +.in +4n +.nf +.sp +#include +\&... + unsigned int usecs; +\&... + usleep(usecs); +.fi +.in +.LP +The interaction of this function with the +.B SIGALRM +signal, and with 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 ualarm (3) +is unspecified. +.SH "SEE ALSO" +.BR alarm (2), +.BR getitimer (2), +.BR nanosleep (2), +.BR select (2), +.BR setitimer (2), +.BR sleep (3), +.BR ualarm (3), +.BR time (7) diff --git a/original/man3/utmpname.3 b/original/man3/utmpname.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/utmpname.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/utmpxname.3 b/original/man3/utmpxname.3 new file mode 100644 index 00000000..29c36b72 --- /dev/null +++ b/original/man3/utmpxname.3 @@ -0,0 +1 @@ +.so man3/getutent.3 diff --git a/original/man3/va_arg.3 b/original/man3/va_arg.3 new file mode 100644 index 00000000..c419248e --- /dev/null +++ b/original/man3/va_arg.3 @@ -0,0 +1 @@ +.so man3/stdarg.3 diff --git a/original/man3/va_copy.3 b/original/man3/va_copy.3 new file mode 100644 index 00000000..c419248e --- /dev/null +++ b/original/man3/va_copy.3 @@ -0,0 +1 @@ +.so man3/stdarg.3 diff --git a/original/man3/va_end.3 b/original/man3/va_end.3 new file mode 100644 index 00000000..c419248e --- /dev/null +++ b/original/man3/va_end.3 @@ -0,0 +1 @@ +.so man3/stdarg.3 diff --git a/original/man3/va_start.3 b/original/man3/va_start.3 new file mode 100644 index 00000000..c419248e --- /dev/null +++ b/original/man3/va_start.3 @@ -0,0 +1 @@ +.so man3/stdarg.3 diff --git a/original/man3/valloc.3 b/original/man3/valloc.3 new file mode 100644 index 00000000..791d4c80 --- /dev/null +++ b/original/man3/valloc.3 @@ -0,0 +1 @@ +.so man3/posix_memalign.3 diff --git a/original/man3/vasprintf.3 b/original/man3/vasprintf.3 new file mode 100644 index 00000000..5a8753a9 --- /dev/null +++ b/original/man3/vasprintf.3 @@ -0,0 +1 @@ +.so man3/asprintf.3 diff --git a/original/man3/vdprintf.3 b/original/man3/vdprintf.3 new file mode 100644 index 00000000..fa36f35d --- /dev/null +++ b/original/man3/vdprintf.3 @@ -0,0 +1 @@ +.so man3/dprintf.3 diff --git a/original/man3/verr.3 b/original/man3/verr.3 new file mode 100644 index 00000000..3ee2e497 --- /dev/null +++ b/original/man3/verr.3 @@ -0,0 +1 @@ +.so man3/err.3 diff --git a/original/man3/verrx.3 b/original/man3/verrx.3 new file mode 100644 index 00000000..3ee2e497 --- /dev/null +++ b/original/man3/verrx.3 @@ -0,0 +1 @@ +.so man3/err.3 diff --git a/original/man3/versionsort.3 b/original/man3/versionsort.3 new file mode 100644 index 00000000..7e757c7a --- /dev/null +++ b/original/man3/versionsort.3 @@ -0,0 +1 @@ +.so man3/scandir.3 diff --git a/original/man3/vfprintf.3 b/original/man3/vfprintf.3 new file mode 100644 index 00000000..975530d9 --- /dev/null +++ b/original/man3/vfprintf.3 @@ -0,0 +1 @@ +.so man3/printf.3 diff --git a/original/man3/vfscanf.3 b/original/man3/vfscanf.3 new file mode 100644 index 00000000..9fd424bb --- /dev/null +++ b/original/man3/vfscanf.3 @@ -0,0 +1 @@ +.so man3/scanf.3 diff --git a/original/man3/vfwprintf.3 b/original/man3/vfwprintf.3 new file mode 100644 index 00000000..56ec9685 --- /dev/null +++ b/original/man3/vfwprintf.3 @@ -0,0 +1 @@ +.so man3/wprintf.3 diff --git a/original/man3/vprintf.3 b/original/man3/vprintf.3 new file mode 100644 index 00000000..975530d9 --- /dev/null +++ b/original/man3/vprintf.3 @@ -0,0 +1 @@ +.so man3/printf.3 diff --git a/original/man3/vscanf.3 b/original/man3/vscanf.3 new file mode 100644 index 00000000..9fd424bb --- /dev/null +++ b/original/man3/vscanf.3 @@ -0,0 +1 @@ +.so man3/scanf.3 diff --git a/original/man3/vsnprintf.3 b/original/man3/vsnprintf.3 new file mode 100644 index 00000000..975530d9 --- /dev/null +++ b/original/man3/vsnprintf.3 @@ -0,0 +1 @@ +.so man3/printf.3 diff --git a/original/man3/vsprintf.3 b/original/man3/vsprintf.3 new file mode 100644 index 00000000..975530d9 --- /dev/null +++ b/original/man3/vsprintf.3 @@ -0,0 +1 @@ +.so man3/printf.3 diff --git a/original/man3/vsscanf.3 b/original/man3/vsscanf.3 new file mode 100644 index 00000000..9fd424bb --- /dev/null +++ b/original/man3/vsscanf.3 @@ -0,0 +1 @@ +.so man3/scanf.3 diff --git a/original/man3/vswprintf.3 b/original/man3/vswprintf.3 new file mode 100644 index 00000000..56ec9685 --- /dev/null +++ b/original/man3/vswprintf.3 @@ -0,0 +1 @@ +.so man3/wprintf.3 diff --git a/original/man3/vsyslog.3 b/original/man3/vsyslog.3 new file mode 100644 index 00000000..ec352b29 --- /dev/null +++ b/original/man3/vsyslog.3 @@ -0,0 +1 @@ +.so man3/syslog.3 diff --git a/original/man3/vwarn.3 b/original/man3/vwarn.3 new file mode 100644 index 00000000..3ee2e497 --- /dev/null +++ b/original/man3/vwarn.3 @@ -0,0 +1 @@ +.so man3/err.3 diff --git a/original/man3/vwarnx.3 b/original/man3/vwarnx.3 new file mode 100644 index 00000000..3ee2e497 --- /dev/null +++ b/original/man3/vwarnx.3 @@ -0,0 +1 @@ +.so man3/err.3 diff --git a/original/man3/vwprintf.3 b/original/man3/vwprintf.3 new file mode 100644 index 00000000..56ec9685 --- /dev/null +++ b/original/man3/vwprintf.3 @@ -0,0 +1 @@ +.so man3/wprintf.3 diff --git a/original/man3/warn.3 b/original/man3/warn.3 new file mode 100644 index 00000000..3ee2e497 --- /dev/null +++ b/original/man3/warn.3 @@ -0,0 +1 @@ +.so man3/err.3 diff --git a/original/man3/warnx.3 b/original/man3/warnx.3 new file mode 100644 index 00000000..3ee2e497 --- /dev/null +++ b/original/man3/warnx.3 @@ -0,0 +1 @@ +.so man3/err.3 diff --git a/original/man3/wcpcpy.3 b/original/man3/wcpcpy.3 new file mode 100644 index 00000000..a8dffb59 --- /dev/null +++ b/original/man3/wcpcpy.3 @@ -0,0 +1,48 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.TH WCPCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcpcpy \- copy a wide-character string, returning a pointer to its end +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "wchar_t *wcpcpy(wchar_t *" dest ", const wchar_t *" src ); +.fi +.SH DESCRIPTION +The +.BR wcpcpy () +function is the wide-character equivalent of the +.BR stpcpy (3) +function. +It copies the wide-character string pointed to by \fIsrc\fP, +including the terminating L\(aq\\0\(aq character, to the array pointed to by +\fIdest\fP. +.PP +The strings may not overlap. +.PP +The programmer must ensure that there +is room for at least \fIwcslen(src)+1\fP +wide characters at \fIdest\fP. +.SH "RETURN VALUE" +.BR wcpcpy () +returns a pointer to the end of the wide-character string +\fIdest\fP, that is, a pointer to the terminating L\(aq\\0\(aq character. +.SH "CONFORMING TO" +This function is a GNU extension. +.SH "SEE ALSO" +.BR strcpy (3), +.BR wcscpy (3), +.BR feature_test_macros (7) diff --git a/original/man3/wcpncpy.3 b/original/man3/wcpncpy.3 new file mode 100644 index 00000000..76f9c5b3 --- /dev/null +++ b/original/man3/wcpncpy.3 @@ -0,0 +1,58 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.TH WCPNCPY 3 2003-11-01 "GNU" "Linux Programmer's Manual" +.SH NAME +wcpncpy \- copy a fixed-size string of wide characters, +returning a pointer to its end +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "wchar_t *wcpncpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR wcpncpy () +function is the wide-character equivalent +of the +.BR stpncpy (3) +function. +It copies at most \fIn\fP wide characters from the wide-character +string pointed to by \fIsrc\fP, +including the terminating L\(aq\\0\(aq character, +to the array pointed to by \fIdest\fP. +Exactly \fIn\fP wide characters are +written at \fIdest\fP. +If the length \fIwcslen(src)\fP is smaller than \fIn\fP, +the remaining wide characters in the array pointed to +by \fIdest\fP are filled with L\(aq\\0\(aq characters. +If the length \fIwcslen(src)\fP is greater or equal +to \fIn\fP, the string pointed to by \fIdest\fP will +not be L\(aq\\0\(aq terminated. +.PP +The strings may not overlap. +.PP +The programmer must ensure that there is room for at least \fIn\fP wide +characters at \fIdest\fP. +.SH "RETURN VALUE" +.BR wcpncpy () +returns a pointer to the last wide character written, that is, +\fIdest + n \- 1\fP. +.SH "CONFORMING TO" +This function is a GNU extension. +.SH "SEE ALSO" +.BR stpncpy (3), +.BR wcsncpy (3), +.BR feature_test_macros (7) diff --git a/original/man3/wcrtomb.3 b/original/man3/wcrtomb.3 new file mode 100644 index 00000000..a782bbb7 --- /dev/null +++ b/original/man3/wcrtomb.3 @@ -0,0 +1,84 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCRTOMB 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcrtomb \- convert a wide character to a multibyte sequence +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t wcrtomb(char *" s ", wchar_t " wc ", mbstate_t *" ps ); +.fi +.SH DESCRIPTION +The main case for this function is when \fIs\fP is +not NULL and \fIwc\fP is not +L\(aq\\0\(aq. +In this case, the +.BR wcrtomb () +function +converts the wide character \fIwc\fP +to its multibyte representation and stores it +at the beginning of the character +array pointed to by \fIs\fP. +It updates the shift state \fI*ps\fP, and +returns the length of said multibyte representation, +that is, the number of bytes +written at \fIs\fP. +.PP +A different case is when \fIs\fP is not NULL but \fIwc\fP is L\(aq\\0\(aq. +In this +case the +.BR wcrtomb () +function stores at +the character array pointed to by +\fIs\fP the shift sequence needed to +bring \fI*ps\fP back to the initial state, +followed by a \(aq\\0\(aq byte. +It updates the shift state \fI*ps\fP (i.e., brings +it into the initial state), +and returns the length of the shift sequence plus +one, that is, the number of bytes written at \fIs\fP. +.PP +A third case is when \fIs\fP is NULL. +In this case \fIwc\fP is ignored, +and the function effectively returns wcrtomb(buf,L\(aq\\0\(aq,\fIps\fP) where +buf is an internal anonymous buffer. +.PP +In all of the above cases, if \fIps\fP is a NULL pointer, a static anonymous +state only known to the +.BR wcrtomb () +function is used instead. +.SH "RETURN VALUE" +The +.BR wcrtomb () +function returns the number of +bytes that have been or would +have been written to the byte array at \fIs\fP. +If \fIwc\fP can not be +represented as a multibyte sequence (according to the current locale), +.I (size_t)\ \-1 +is returned, and \fIerrno\fP set to \fBEILSEQ\fP. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR wcrtomb () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +Passing NULL as \fIps\fP is not multithread safe. +.SH "SEE ALSO" +.BR wcsrtombs (3) diff --git a/original/man3/wcscasecmp.3 b/original/man3/wcscasecmp.3 new file mode 100644 index 00000000..409d071a --- /dev/null +++ b/original/man3/wcscasecmp.3 @@ -0,0 +1,57 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.TH WCSCASECMP 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH NAME +wcscasecmp \- compare two wide-character strings, ignoring case +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int wcscasecmp(const wchar_t *" s1 ", const wchar_t *" s2 ); +.fi +.SH DESCRIPTION +The +.BR wcscasecmp () +function is the wide-character equivalent of the +.BR strcasecmp (3) +function. +It compares the wide-character string pointed to +by \fIs1\fP and the wide-character string pointed to by \fIs2\fP, ignoring +case differences +.RB ( towupper (3), +.BR towlower (3)). +.SH "RETURN VALUE" +The +.BR wcscasecmp () +function returns zero if the wide-character strings at +\fIs1\fP and \fIs2\fP are equal except for case distinctions. +It returns a +positive integer if \fIs1\fP is greater than \fIs2\fP, ignoring case. +It +returns a negative integer if \fIs1\fP is smaller +than \fIs2\fP, ignoring case. +.SH "CONFORMING TO" +POSIX.1-2008. +This function is not specified in POSIX.1-2001, +and is not widely available on other systems. +.SH NOTES +The behavior of +.BR wcscasecmp () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR strcasecmp (3), +.BR wcscmp (3) diff --git a/original/man3/wcscat.3 b/original/man3/wcscat.3 new file mode 100644 index 00000000..9585ad99 --- /dev/null +++ b/original/man3/wcscat.3 @@ -0,0 +1,47 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSCAT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcscat \- concatenate two wide-character strings +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *wcscat(wchar_t *" dest ", const wchar_t *" src ); +.fi +.SH DESCRIPTION +The +.BR wcscat () +function is the wide-character equivalent +of the +.BR strcat (3) +function. +It copies the wide-character string pointed to by \fIsrc\fP, +including the terminating L\(aq\\0\(aq character, +to the end of the wide-character string pointed to by \fIdest\fP. +.PP +The strings may not overlap. +.PP +The programmer must ensure that there is room for at least +\fIwcslen(dest) + wcslen(src) + 1\fP wide characters at \fIdest\fP. +.SH "RETURN VALUE" +.BR wcscat () +returns \fIdest\fP. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR strcat (3), +.BR wcpcpy (3), +.BR wcscpy (3), +.BR wcsncat (3) diff --git a/original/man3/wcschr.3 b/original/man3/wcschr.3 new file mode 100644 index 00000000..5da6c4c0 --- /dev/null +++ b/original/man3/wcschr.3 @@ -0,0 +1,45 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSCHR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcschr \- search a wide character in a wide-character string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *wcschr(const wchar_t *" wcs ", wchar_t " wc ); +.fi +.SH DESCRIPTION +The +.BR wcschr () +function is the wide-character equivalent +of the +.BR strchr (3) +function. +It searches the first occurrence of \fIwc\fP in the wide-character +string pointed to by \fIwcs\fP. +.SH "RETURN VALUE" +The +.BR wcschr () +function returns a pointer to the first occurrence of +\fIwc\fP in the wide-character string pointed to by \fIwcs\fP, or NULL if +\fIwc\fP does not occur in the string. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR strchr (3), +.BR wcspbrk (3), +.BR wcsrchr (3), +.BR wcsstr (3), +.BR wmemchr (3) diff --git a/original/man3/wcscmp.3 b/original/man3/wcscmp.3 new file mode 100644 index 00000000..336eedf5 --- /dev/null +++ b/original/man3/wcscmp.3 @@ -0,0 +1,48 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSCMP 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcscmp \- compare two wide-character strings +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int wcscmp(const wchar_t *" s1 ", const wchar_t *" s2 ); +.fi +.SH DESCRIPTION +The +.BR wcscmp () +function is the wide-character equivalent +of the +.BR strcmp (3) +function. +It compares the wide-character string pointed to by \fIs1\fP and the +wide-character string pointed to by \fIs2\fP. +.SH "RETURN VALUE" +The +.BR wcscmp () +function returns zero if the wide-character strings at +\fIs1\fP and \fIs2\fP are equal. +It returns an integer greater than zero if +at the first differing position \fIi\fP, the corresponding wide-character +\fIs1[i]\fP is greater than \fIs2[i]\fP. +It returns an integer less than zero if +at the first differing position \fIi\fP, the corresponding wide-character +\fIs1[i]\fP is less than \fIs2[i]\fP. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR strcmp (3), +.BR wcscasecmp (3), +.BR wmemcmp (3) diff --git a/original/man3/wcscpy.3 b/original/man3/wcscpy.3 new file mode 100644 index 00000000..64fb6fee --- /dev/null +++ b/original/man3/wcscpy.3 @@ -0,0 +1,49 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcscpy \- copy a wide-character string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *wcscpy(wchar_t *" dest ", const wchar_t *" src ); +.fi +.SH DESCRIPTION +The +.BR wcscpy () +function is the wide-character equivalent +of the +.BR strcpy (3) +function. +It copies the wide-character string pointed to by \fIsrc\fP, +including the terminating L\(aq\\0\(aq character, to the array pointed to by +\fIdest\fP. +.PP +The strings may not overlap. +.PP +The programmer must ensure that there is +room for at least \fIwcslen(src)+1\fP +wide characters at \fIdest\fP. +.SH "RETURN VALUE" +.BR wcscpy () +returns \fIdest\fP. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR strcpy (3), +.BR wcpcpy (3), +.BR wcscat (3), +.BR wcsdup (3), +.BR wmemcpy (3) diff --git a/original/man3/wcscspn.3 b/original/man3/wcscspn.3 new file mode 100644 index 00000000..c6c84a21 --- /dev/null +++ b/original/man3/wcscspn.3 @@ -0,0 +1,53 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSCSPN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcscspn \- search a wide-character string for any of a set of wide characters +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t wcscspn(const wchar_t *" wcs ", const wchar_t *" reject ); +.fi +.SH DESCRIPTION +The +.BR wcscspn () +function is the wide-character equivalent +of the +.BR strcspn (3) +function. +It determines the length of the longest initial segment of \fIwcs\fP +which consists entirely of wide-characters not listed in \fIreject\fP. +In +other words, it searches for the first occurrence in the wide-character +string \fIwcs\fP of any of the characters in the wide-character string +\fIreject\fP. +.SH "RETURN VALUE" +The +.BR wcscspn () +function returns the number of +wide characters in the longest +initial segment of \fIwcs\fP which consists entirely of wide-characters not +listed in \fIreject\fP. +In other words, it returns the position of the first +occurrence in the wide-character string \fIwcs\fP +of any of the characters in +the wide-character string \fIreject\fP, +or \fIwcslen(wcs)\fP if there is none. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR strcspn (3), +.BR wcspbrk (3), +.BR wcsspn (3) diff --git a/original/man3/wcsdup.3 b/original/man3/wcsdup.3 new file mode 100644 index 00000000..7149f159 --- /dev/null +++ b/original/man3/wcsdup.3 @@ -0,0 +1,57 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.TH WCSDUP 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH NAME +wcsdup \- duplicate a wide-character string +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "wchar_t *wcsdup(const wchar_t *" s ); +.fi +.SH DESCRIPTION +The +.BR wcsdup () +function is the wide-character equivalent +of the +.BR strdup (3) +function. +It allocates and returns a new wide-character string whose initial +contents is a duplicate of the wide-character string pointed to by \fIs\fP. +.PP +Memory for the new wide-character string is +obtained with +.BR malloc (3), +and should be freed with +.BR free (3). +.SH "RETURN VALUE" +The +.BR wcsdup () +function returns a pointer +to the new wide-character string, +or NULL if sufficient memory was not available. +.SH ERRORS +.TP +.B ENOMEM +Insufficient memory available to allocate duplicate string. +.SH "CONFORMING TO" +POSIX.1-2008. +This function is not specified in POSIX.1-2001, +and is not widely available on other systems. +.\" present in libc5 and glibc 2.0 and later +.SH "SEE ALSO" +.BR strdup (3), +.BR wcscpy (3), +.BR feature_test_macros (7) diff --git a/original/man3/wcslen.3 b/original/man3/wcslen.3 new file mode 100644 index 00000000..a9e376ea --- /dev/null +++ b/original/man3/wcslen.3 @@ -0,0 +1,40 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSLEN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcslen \- determine the length of a wide-character string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t wcslen(const wchar_t *" s ); +.fi +.SH DESCRIPTION +The +.BR wcslen () +function is the wide-character equivalent +of the +.BR strlen (3) +function. +It determines the length of the wide-character string pointed to +by \fIs\fP, not including the terminating L\(aq\\0\(aq character. +.SH "RETURN VALUE" +The +.BR wcslen () +function returns the +number of wide characters in \fIs\fP. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR strlen (3) diff --git a/original/man3/wcsncasecmp.3 b/original/man3/wcsncasecmp.3 new file mode 100644 index 00000000..0af2d633 --- /dev/null +++ b/original/man3/wcsncasecmp.3 @@ -0,0 +1,60 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.TH WCSNCASECMP 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH NAME +wcsncasecmp \- compare two fixed-size wide-character strings, ignoring case +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int wcsncasecmp(const wchar_t *" s1 ", const wchar_t *" s2 ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR wcsncasecmp () +function is the wide-character equivalent of the +.BR strncasecmp (3) +function. +It compares the wide-character string pointed to +by \fIs1\fP and the wide-character string +pointed to by \fIs2\fP, but at most +\fIn\fP wide characters from each string, ignoring case differences +.RB ( towupper (3), +.BR towlower (3)). +.SH "RETURN VALUE" +The +.BR wcsncasecmp () +function returns zero +if the wide-character strings at +\fIs1\fP and \fIs2\fP, +truncated to at most length \fIn\fP, are equal except +for case distinctions. +It returns a positive integer if truncated \fIs1\fP is +greater than truncated \fIs2\fP, ignoring case. +It returns a negative integer +if truncated \fIs1\fP is smaller than truncated \fIs2\fP, ignoring case. +.SH "CONFORMING TO" +POSIX.1-2008. +This function is not specified in POSIX.1-2001, +and is not widely available on other systems. +.SH NOTES +The behavior of +.BR wcsncasecmp () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR strncasecmp (3), +.BR wcsncmp (3) diff --git a/original/man3/wcsncat.3 b/original/man3/wcsncat.3 new file mode 100644 index 00000000..b82c932f --- /dev/null +++ b/original/man3/wcsncat.3 @@ -0,0 +1,44 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSNCAT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcsncat \- concatenate two wide-character strings +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *wcsncat(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR wcsncat () +function is the wide-character equivalent of the +.BR strncat (3) +function. +It copies at most \fIn\fP wide characters from the wide-character +string pointed to by \fIsrc\fP to the end of the wide-character string pointed +to by \fIdest\fP, and adds a terminating L\(aq\\0\(aq character. +.PP +The strings may not overlap. +.PP +The programmer must ensure that there is room for at least +\fIwcslen(dest) + n + 1\fP wide characters at \fIdest\fP. +.SH "RETURN VALUE" +.BR wcsncat () +returns \fIdest\fP. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR strncat (3), +.BR wcscat (3) diff --git a/original/man3/wcsncmp.3 b/original/man3/wcsncmp.3 new file mode 100644 index 00000000..33121d21 --- /dev/null +++ b/original/man3/wcsncmp.3 @@ -0,0 +1,50 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSNCMP 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcsncmp \- compare two fixed-size wide-character strings +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int wcsncmp(const wchar_t *" s1 ", const wchar_t *" s2 ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR wcsncmp () +function is the wide-character equivalent of the +.BR strncmp (3) +function. +It compares the wide-character string pointed to by \fIs1\fP and the +wide-character string pointed to by \fIs2\fP, but at most \fIn\fP wide +characters from each string. +In each string, the comparison extends only up +to the first occurrence of a L\(aq\\0\(aq character, if any. +.SH "RETURN VALUE" +The +.BR wcsncmp () +function returns zero if the wide-character strings at +\fIs1\fP and \fIs2\fP, truncated to at most length \fIn\fP, are equal. +It returns an integer greater than zero if at the first differing position +\fIi\fP (\fIi\fP < \fIn\fP), +the corresponding wide-character \fIs1[i]\fP is +greater than \fIs2[i]\fP. +It returns an integer less than zero if at the first +differing position \fIi\fP (\fIi\fP < \fIn\fP), the corresponding +wide-character \fIs1[i]\fP is less than \fIs2[i]\fP. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR strncmp (3), +.BR wcsncasecmp (3) diff --git a/original/man3/wcsncpy.3 b/original/man3/wcsncpy.3 new file mode 100644 index 00000000..445113be --- /dev/null +++ b/original/man3/wcsncpy.3 @@ -0,0 +1,53 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSNCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcsncpy \- copy a fixed-size string of wide characters +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *wcsncpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR wcsncpy () +function is the wide-character equivalent of the +.BR strncpy (3) +function. +It copies at most \fIn\fP wide characters from the wide-character +string pointed to by \fIsrc\fP, +including the terminating L\(aq\\0\(aq character, +to the array pointed to by \fIdest\fP. +Exactly \fIn\fP wide characters are +written at \fIdest\fP. +If the length \fIwcslen(src)\fP is smaller than \fIn\fP, +the remaining wide characters in the array +pointed to by \fIdest\fP are filled +with L\(aq\\0\(aq characters. +If the length \fIwcslen(src)\fP is greater or equal +to \fIn\fP, the string pointed to by \fIdest\fP +will not be L\(aq\\0\(aq terminated. +.PP +The strings may not overlap. +.PP +The programmer must ensure that there is room for at least \fIn\fP wide +characters at \fIdest\fP. +.SH "RETURN VALUE" +.BR wcsncpy () +returns \fIdest\fP. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR strncpy (3) diff --git a/original/man3/wcsnlen.3 b/original/man3/wcsnlen.3 new file mode 100644 index 00000000..0d21a3fd --- /dev/null +++ b/original/man3/wcsnlen.3 @@ -0,0 +1,47 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.TH WCSNLEN 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +wcsnlen \- determine the length of a fixed-size wide-character string +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "size_t wcsnlen(const wchar_t *" s ", size_t " maxlen ); +.fi +.SH DESCRIPTION +The +.BR wcsnlen () +function is the wide-character equivalent +of the +.BR strnlen (3) +function. +It returns the number of wide-characters in the string pointed to by +\fIs\fP, not including the terminating L\(aq\\0\(aq character, but at most +\fImaxlen\fP. +In doing this, +.BR wcsnlen () +looks only at the first \fImaxlen\fP +wide-characters at \fIs\fP and never beyond \fIs+maxlen\fP. +.SH "RETURN VALUE" +The +.BR wcsnlen () +function returns \fIwcslen(s)\fP, if that is less than +\fImaxlen\fP, or \fImaxlen\fP if there is no L\(aq\\0\(aq character among the +first \fImaxlen\fP wide characters pointed to by \fIs\fP. +.SH "CONFORMING TO" +This function is a GNU extension. +.SH "SEE ALSO" +.BR strnlen (3), +.BR wcslen (3) diff --git a/original/man3/wcsnrtombs.3 b/original/man3/wcsnrtombs.3 new file mode 100644 index 00000000..85fd5bce --- /dev/null +++ b/original/man3/wcsnrtombs.3 @@ -0,0 +1,109 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.TH WCSNRTOMBS 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +wcsnrtombs \- convert a wide-character string to a multibyte string +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "size_t wcsnrtombs(char *" dest ", const wchar_t **" src ", size_t " nwc , +.BI " size_t " len ", mbstate_t *" ps ); +.fi +.SH DESCRIPTION +The +.BR wcsnrtombs () +function is like the +.BR wcsrtombs (3) +function, +except that the number of wide characters to be converted, +starting at \fI*src\fP, is limited to \fInwc\fP. +.PP +If \fIdest\fP is not a NULL pointer, +the +.BR wcsnrtombs () +function converts +at most \fInwc\fP wide characters from +the wide-character string \fI*src\fP to a multibyte string starting at +\fIdest\fP. +At most \fIlen\fP bytes are written to \fIdest\fP. +The shift state +\fI*ps\fP is updated. +The conversion is effectively performed by repeatedly +calling +.IR "wcrtomb(dest, *src, ps)" , +as long as this call succeeds, +and then incrementing \fIdest\fP by the +number of bytes written and \fI*src\fP +by one. +The conversion can stop for three reasons: +.PP +1. A wide character has been encountered that can not be represented as a +multibyte sequence (according to the current locale). +In this case \fI*src\fP +is left pointing to the invalid wide character, +.I (size_t)\ \-1 +is returned, +and \fIerrno\fP is set to \fBEILSEQ\fP. +.PP +2. \fInwc\fP wide characters have been +converted without encountering a L\(aq\\0\(aq, +or the length limit forces a stop. +In this case \fI*src\fP is left pointing +to the next wide character to be converted, and the number of bytes written +to \fIdest\fP is returned. +.PP +3. The wide-character string has been completely converted, including the +terminating L\(aq\\0\(aq (which has the side effect of bringing back \fI*ps\fP +to the initial state). +In this case \fI*src\fP is set to NULL, and the number +of bytes written to \fIdest\fP, excluding the terminating \(aq\\0\(aq byte, is +returned. +.PP +If \fIdest\fP is NULL, \fIlen\fP is ignored, +and the conversion proceeds as above, +except that the converted bytes are not written out to memory, and that +no destination length limit exists. +.PP +In both of the above cases, +if \fIps\fP is a NULL pointer, a static anonymous +state only known to the wcsnrtombs function is used instead. +.PP +The programmer must ensure that there is room for at least \fIlen\fP bytes +at \fIdest\fP. +.SH "RETURN VALUE" +The +.BR wcsnrtombs () +function returns +the number of bytes that make up the +converted part of multibyte sequence, +not including the terminating null byte. +If a wide character was encountered which +could not be converted, +.I (size_t)\ \-1 +is returned, and \fIerrno\fP set to \fBEILSEQ\fP. +.SH "CONFORMING TO" +This function is a GNU extension. +.SH NOTES +The behavior of +.BR wcsnrtombs () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +Passing NULL as \fIps\fP is not multithread safe. +.SH "SEE ALSO" +.BR iconv (3), +.BR wcsrtombs (3) diff --git a/original/man3/wcspbrk.3 b/original/man3/wcspbrk.3 new file mode 100644 index 00000000..3069b434 --- /dev/null +++ b/original/man3/wcspbrk.3 @@ -0,0 +1,46 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSPBRK 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcspbrk \- search a wide-character string for any of a set of wide characters +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *wcspbrk(const wchar_t *" wcs ", const wchar_t *" accept ); +.fi +.SH DESCRIPTION +The +.BR wcspbrk () +function is the wide-character equivalent +of the +.BR strpbrk (3) +function. +It searches for the first occurrence in the wide-character +string pointed to by \fIwcs\fP of any of the +characters in the wide-character +string pointed to by \fIaccept\fP. +.SH "RETURN VALUE" +The +.BR wcspbrk () +function returns a pointer to the first occurrence in +\fIwcs\fP of any of the characters listed in \fIaccept\fP. +If \fIwcs\fP +contains none of these characters, NULL is returned. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR strpbrk (3), +.BR wcschr (3), +.BR wcscspn (3) diff --git a/original/man3/wcsrchr.3 b/original/man3/wcsrchr.3 new file mode 100644 index 00000000..e7bfb7d0 --- /dev/null +++ b/original/man3/wcsrchr.3 @@ -0,0 +1,42 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSRCHR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcsrchr \- search a wide character in a wide-character string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *wcsrchr(const wchar_t *" wcs ", wchar_t " wc ); +.fi +.SH DESCRIPTION +The +.BR wcsrchr () +function is the wide-character equivalent +of the +.BR strrchr (3) +function. +It searches the last occurrence of \fIwc\fP in the wide-character +string pointed to by \fIwcs\fP. +.SH "RETURN VALUE" +The +.BR wcsrchr () +function returns a pointer to the last occurrence of +\fIwc\fP in the wide-character string pointed to by \fIwcs\fP, or NULL if +\fIwc\fP does not occur in the string. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR strrchr (3), +.BR wcschr (3) diff --git a/original/man3/wcsrtombs.3 b/original/man3/wcsrtombs.3 new file mode 100644 index 00000000..34187f7b --- /dev/null +++ b/original/man3/wcsrtombs.3 @@ -0,0 +1,104 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSRTOMBS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcsrtombs \- convert a wide-character string to a multibyte string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t wcsrtombs(char *" dest ", const wchar_t **" src , +.BI " size_t " len ", mbstate_t *" ps ); +.fi +.SH DESCRIPTION +If \fIdest\fP is not a NULL pointer, +the +.BR wcsrtombs () +function converts +the wide-character string \fI*src\fP to a multibyte string starting at +\fIdest\fP. +At most \fIlen\fP bytes are written to \fIdest\fP. +The shift state +\fI*ps\fP is updated. +The conversion is effectively performed by repeatedly +calling +.IR "wcrtomb(dest, *src, ps)" , +as long as this call succeeds, +and then incrementing \fIdest\fP by the +number of bytes written and \fI*src\fP +by one. +The conversion can stop for three reasons: +.PP +1. A wide character has been encountered that can not be represented as a +multibyte sequence (according to the current locale). +In this case \fI*src\fP +is left pointing to the invalid wide character, +.I (size_t)\ \-1 +is returned, +and +.I errno +is set to \fBEILSEQ\fP. +.PP +2. The length limit forces a stop. +In this case \fI*src\fP is left pointing +to the next wide character to be converted, +and the number of bytes written to +\fIdest\fP is returned. +.PP +3. The wide-character string has been completely converted, including the +terminating L\(aq\\0\(aq (which has the side effect of bringing back \fI*ps\fP +to the initial state). +In this case \fI*src\fP is set to NULL, and the number +of bytes written to \fIdest\fP, excluding the terminating \(aq\\0\(aq byte, is +returned. +.PP +If \fIdest\fP is NULL, \fIlen\fP is ignored, +and the conversion proceeds as above, except that the converted bytes +are not written out to memory, and that +no length limit exists. +.PP +In both of the above cases, +if \fIps\fP is a NULL pointer, a static anonymous +state only known to the wcsrtombs function is used instead. +.PP +The programmer must ensure that there is room for at least \fIlen\fP bytes +at \fIdest\fP. +.SH "RETURN VALUE" +The +.BR wcsrtombs () +function returns +the number of bytes that make up the +converted part of multibyte sequence, +not including the terminating null byte. +If a wide character was encountered +which could not be converted, +.I (size_t)\ \-1 +is returned, and +.I errno +set to \fBEILSEQ\fP. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR wcsrtombs () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +Passing NULL as \fIps\fP is not multithread safe. +.SH "SEE ALSO" +.BR iconv (3), +.BR wcsnrtombs (3), +.BR wcstombs (3) diff --git a/original/man3/wcsspn.3 b/original/man3/wcsspn.3 new file mode 100644 index 00000000..6c8991e3 --- /dev/null +++ b/original/man3/wcsspn.3 @@ -0,0 +1,51 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSSPN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcsspn \- advance in a wide-character string, skipping +any of a set of wide characters +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t wcsspn(const wchar_t *" wcs ", const wchar_t *" accept ); +.fi +.SH DESCRIPTION +The +.BR wcsspn () +function is the wide-character equivalent of the +.BR strspn (3) +function. +It determines the length of the longest initial segment of \fIwcs\fP +which consists entirely of wide-characters listed in \fIaccept\fP. +In other +words, it searches for the first occurrence in the wide-character string +\fIwcs\fP of a wide-character not contained in the wide-character string +\fIaccept\fP. +.SH "RETURN VALUE" +The +.BR wcsspn () +function returns the number of +wide characters in the longest +initial segment of \fIwcs\fP which consists entirely of wide-characters listed +in \fIaccept\fP. +In other words, it returns the position of the first +occurrence in the wide-character string \fIwcs\fP of a wide-character not +contained in the wide-character string \fIaccept\fP, or \fIwcslen(wcs)\fP +if there is none. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR strspn (3), +.BR wcscspn (3) diff --git a/original/man3/wcsstr.3 b/original/man3/wcsstr.3 new file mode 100644 index 00000000..731ca03b --- /dev/null +++ b/original/man3/wcsstr.3 @@ -0,0 +1,47 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSSTR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcsstr \- locate a substring in a wide-character string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *wcsstr(const wchar_t *" haystack ", const wchar_t *" needle ); +.fi +.SH DESCRIPTION +The +.BR wcsstr () +function is the wide-character equivalent of the +.BR strstr (3) +function. +It searches for the first occurrence of the wide-character string +\fIneedle\fP (without its terminating L\(aq\\0\(aq character) as a substring in +the wide-character string \fIhaystack\fP. +.SH "RETURN VALUE" +The +.BR wcsstr () +function returns a pointer to the first occurrence of +\fIneedle\fP in \fIhaystack\fP. +It returns NULL if \fIneedle\fP does not occur +as a substring in \fIhaystack\fP. +.PP +Note the special case: +If \fIneedle\fP is the empty wide-character string, +the return value is always \fIhaystack\fP itself. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR strstr (3), +.BR wcschr (3) diff --git a/original/man3/wcstoimax.3 b/original/man3/wcstoimax.3 new file mode 100644 index 00000000..29d40f2f --- /dev/null +++ b/original/man3/wcstoimax.3 @@ -0,0 +1,57 @@ +.\" 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. +.\" +.TH WCSTOIMAX 3 2003-11-01 "" "Linux Programmer's Manual" +.SH NAME +wcstoimax, wcstoumax \- convert wide-character string to integer +.SH SYNOPSIS +.nf +.B #include +.br +.B #include +.sp +.BI "intmax_t wcstoimax(const wchar_t *" nptr ", wchar_t **" endptr \ +", int " base ); +.br +.BI "uintmax_t wcstoumax(const wchar_t *" nptr ", wchar_t **" endptr \ +", int " base ); +.fi +.SH DESCRIPTION +These functions are just like +.BR wcstol (3) +and +.BR wcstoul (3), +except that they return a value of type +.I intmax_t +and +.IR uintmax_t , +respectively. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR imaxabs (3), +.BR imaxdiv (3), +.BR strtoimax (3), +.BR strtoumax (3), +.\" FIXME . the pages referred to by the following xrefs are not yet written +.BR wcstol (3), +.BR wcstoul (3) diff --git a/original/man3/wcstok.3 b/original/man3/wcstok.3 new file mode 100644 index 00000000..16dd7891 --- /dev/null +++ b/original/man3/wcstok.3 @@ -0,0 +1,80 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSTOK 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcstok \- split wide-character string into tokens +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *wcstok(wchar_t *" wcs ", const wchar_t *" delim \ +", wchar_t **" ptr ); +.fi +.SH DESCRIPTION +The +.BR wcstok () +function is the wide-character equivalent of the +.BR strtok (3) +function, +with an added argument to make it multithread-safe. +It can be used +to split a wide-character string \fIwcs\fP into tokens, where a token is +defined as a substring not containing any wide-characters from \fIdelim\fP. +.PP +The search starts at \fIwcs\fP, if \fIwcs\fP is not NULL, +or at \fI*ptr\fP, if \fIwcs\fP is NULL. +First, any delimiter wide-characters are skipped, that is, the +pointer is advanced beyond any wide-characters which occur in \fIdelim\fP. +If the end of the wide-character string is now +reached, +.BR wcstok () +returns NULL, to indicate that no tokens +were found, and stores an appropriate value in \fI*ptr\fP, +so that subsequent calls to +.BR wcstok () +will continue to return NULL. +Otherwise, the +.BR wcstok () +function recognizes the beginning of a token +and returns a pointer to it, but before doing that, it zero-terminates the +token by replacing the next wide-character which occurs in \fIdelim\fP with +a L\(aq\\0\(aq character, +and it updates \fI*ptr\fP so that subsequent calls will +continue searching after the end of recognized token. +.SH "RETURN VALUE" +The +.BR wcstok () +function returns a pointer to the next token, +or NULL if no further token was found. +.SH "CONFORMING TO" +C99. +.SH NOTES +The original \fIwcs\fP wide-character string is destructively modified during +the operation. +.SH EXAMPLE +The following code loops over the tokens contained in a wide-character string. +.sp +.nf +wchar_t *wcs = ...; +wchar_t *token; +wchar_t *state; +for (token = wcstok(wcs, " \\t\\n", &state); + token != NULL; + token = wcstok(NULL, " \\t\\n", &state)) { + ... +} +.fi +.SH "SEE ALSO" +.BR strtok (3), +.BR wcschr (3) diff --git a/original/man3/wcstombs.3 b/original/man3/wcstombs.3 new file mode 100644 index 00000000..0516f353 --- /dev/null +++ b/original/man3/wcstombs.3 @@ -0,0 +1,83 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCSTOMBS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcstombs \- convert a wide-character string to a multibyte string +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "size_t wcstombs(char *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH DESCRIPTION +If \fIdest\fP is not a NULL pointer, the +.BR wcstombs () +function converts +the wide-character string \fIsrc\fP to a multibyte string starting at +\fIdest\fP. +At most \fIn\fP bytes are written to \fIdest\fP. +The conversion +starts in the initial state. +The conversion can stop for three reasons: +.PP +1. A wide character has been encountered that can not be represented as a +multibyte sequence (according to the current locale). +In this case +.I (size_t)\ \-1 +is returned. +.PP +2. The length limit forces a stop. +In this case the number of bytes written to +\fIdest\fP is returned, but the shift state at this point is lost. +.PP +3. The wide-character string has been completely converted, including the +terminating L\(aq\\0\(aq. +In this case the conversion ends in the initial state. +The number of bytes written to \fIdest\fP, +excluding the terminating \(aq\\0\(aq byte, is returned. +.PP +The programmer must ensure that there is room for at least \fIn\fP bytes +at \fIdest\fP. +.PP +If \fIdest\fP is NULL, \fIn\fP is ignored, and the conversion proceeds as +above, except that the converted bytes are not written out to memory, +and that no length limit exists. +.PP +In order to avoid the case 2 above, the programmer should make sure \fIn\fP +is greater or equal to \fIwcstombs(NULL,src,0)+1\fP. +.SH "RETURN VALUE" +The +.BR wcstombs () +function returns the number of bytes that make up the +converted part of multibyte sequence, not including the terminating null byte. +If a wide character was encountered which could not be +converted, +.I (size_t)\ \-1 +is returned. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR wcstombs () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +The function +.BR wcsrtombs (3) +provides a thread safe interface to +the same functionality. +.SH "SEE ALSO" +.BR wcsrtombs (3) diff --git a/original/man3/wcstoumax.3 b/original/man3/wcstoumax.3 new file mode 100644 index 00000000..f3aa5d2a --- /dev/null +++ b/original/man3/wcstoumax.3 @@ -0,0 +1 @@ +.so man3/wcstoimax.3 diff --git a/original/man3/wcswidth.3 b/original/man3/wcswidth.3 new file mode 100644 index 00000000..c1f0c0ab --- /dev/null +++ b/original/man3/wcswidth.3 @@ -0,0 +1,49 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.TH WCSWIDTH 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +wcswidth \- determine columns needed for a fixed-size wide-character string +.SH SYNOPSIS +.nf +.B #define _XOPEN_SOURCE +.B #include +.sp +.BI "int wcswidth(const wchar_t *" s ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR wcswidth () +function returns the +number of columns needed to represent +the wide-character string pointed to by \fIs\fP, but at most \fIn\fP wide +characters. +If a nonprintable wide character occurs among these characters, +\-1 is returned. +.SH "RETURN VALUE" +The +.BR wcswidth () +function +returns the number of column positions for the +wide-character string \fIs\fP, truncated to at most length \fIn\fP. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +The behavior of +.BR wcswidth () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR iswprint (3), +.BR wcwidth (3) diff --git a/original/man3/wctob.3 b/original/man3/wctob.3 new file mode 100644 index 00000000..b41576be --- /dev/null +++ b/original/man3/wctob.3 @@ -0,0 +1,61 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCTOB 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH NAME +wctob \- try to represent a wide character as a single byte +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int wctob(wint_t " c ); +.fi +.SH DESCRIPTION +The +.BR wctob () +function tests whether +the multibyte representation of the +wide character \fIc\fP, starting in the initial state, consists of a single +byte. +If so, it is returned as an +.IR "unsigned char" . +.PP +Never use this function. +It cannot help you in writing internationalized +programs. +Internationalized programs must never distinguish single-byte and +multibyte characters. +.SH "RETURN VALUE" +The +.BR wctob () +function returns the single-byte representation of \fIc\fP, +if it exists, of \fBEOF\fP otherwise. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR wctob () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +This function should never be used. +Internationalized programs must never +distinguish single-byte and multibyte characters. +Use the function +.BR wctomb (3) +instead. +.SH "SEE ALSO" +.BR btowc (3), +.BR wctomb (3) diff --git a/original/man3/wctomb.3 b/original/man3/wctomb.3 new file mode 100644 index 00000000..5a40d5de --- /dev/null +++ b/original/man3/wctomb.3 @@ -0,0 +1,82 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCTOMB 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wctomb \- convert a wide character to a multibyte sequence +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int wctomb(char *" s ", wchar_t " wc ); +.fi +.SH DESCRIPTION +If \fIs\fP is not NULL, +the +.BR wctomb () +function converts the wide character +\fIwc\fP to its multibyte representation and stores it at the beginning of +the character array pointed to by \fIs\fP. +It updates the shift state, which +is stored in a static anonymous variable +only known to the wctomb function, +and returns the length of said multibyte representation, +that is, the number of +bytes written at \fIs\fP. +.PP +The programmer must ensure that there is +room for at least \fBMB_CUR_MAX\fP +bytes at \fIs\fP. +.PP +If \fIs\fP is NULL, the +.BR wctomb () +function +.\" The Dinkumware doc and the Single Unix specification say this, but +.\" glibc doesn't implement this. +resets the shift state, only known to this function, +to the initial state, and +returns nonzero if the encoding has nontrivial shift state, +or zero if the encoding is stateless. +.SH "RETURN VALUE" +If \fIs\fP is not NULL, the +.BR wctomb () +function +returns the number of bytes +that have been written to the byte array at \fIs\fP. +If \fIwc\fP can not be +represented as a multibyte sequence (according +to the current locale), \-1 is returned. +.PP +If \fIs\fP is NULL, the +.BR wctomb () +function returns nonzero if the +encoding has nontrivial shift state, or zero if the encoding is stateless. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR wctomb () +depends on the +.B LC_CTYPE +category of the +current locale. +.PP +This function is not multithread safe. +The function +.BR wcrtomb (3) +provides +a better interface to the same functionality. +.SH "SEE ALSO" +.BR MB_CUR_MAX (3), +.BR wcrtomb (3), +.BR wcstombs (3) diff --git a/original/man3/wctrans.3 b/original/man3/wctrans.3 new file mode 100644 index 00000000..e79cf74f --- /dev/null +++ b/original/man3/wctrans.3 @@ -0,0 +1,63 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCTRANS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wctrans \- wide-character translation mapping +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wctrans_t wctrans(const char *" name ); +.fi +.SH DESCRIPTION +The \fIwctrans_t\fP type represents a mapping +which can map a wide character to +another wide character. +Its nature is implementation-dependent, but the special +value \fI(wctrans_t)\ 0\fP denotes an invalid mapping. +Nonzero \fIwctrans_t\fP +values can be passed to the +.BR towctrans (3) +function to actually perform +the wide-character mapping. +.PP +The +.BR wctrans () +function returns a mapping, given by its name. +The set of +valid names depends on the +.B LC_CTYPE +category of the current locale, but the +following names are valid in all locales. +.nf + "tolower" \- realizes the \fBtolower\fP(3) mapping + "toupper" \- realizes the \fBtoupper\fP(3) mapping +.fi +.SH "RETURN VALUE" +The +.BR wctrans () +function returns a mapping descriptor if the \fIname\fP +is valid. +Otherwise it returns \fI(wctrans_t) 0\fP. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR wctrans () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR towctrans (3) diff --git a/original/man3/wctype.3 b/original/man3/wctype.3 new file mode 100644 index 00000000..9ee15c2a --- /dev/null +++ b/original/man3/wctype.3 @@ -0,0 +1,74 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WCTYPE 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wctype \- wide-character classification +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wctype_t wctype(const char *" name ); +.fi +.SH DESCRIPTION +The \fBwctype_t\fP type represents a property which a wide character may or +may not have. +In other words, it represents a class of wide characters. +This type's nature is implementation-dependent, but the special value +\fI(wctype_t) 0\fP denotes an invalid property. +Nonzero \fBwctype_t\fP values +can be passed to the +.BR iswctype (3) +function +to actually test whether a given +wide character has the property. +.PP +The +.BR wctype () +function returns a property, given by its name. +The set of +valid names depends on the +.B LC_CTYPE +category of the current locale, but the +following names are valid in all locales. +.nf + "alnum" \- realizes the \fBisalnum\fP(3) classification function + "alpha" \- realizes the \fBisalpha\fP(3) classification function + "blank" \- realizes the \fBisblank\fP(3) classification function + "cntrl" \- realizes the \fBiscntrl\fP(3) classification function + "digit" \- realizes the \fBisdigit\fP(3) classification function + "graph" \- realizes the \fBisgraph\fP(3) classification function + "lower" \- realizes the \fBislower\fP(3) classification function + "print" \- realizes the \fBisprint\fP(3) classification function + "punct" \- realizes the \fBispunct\fP(3) classification function + "space" \- realizes the \fBisspace\fP(3) classification function + "upper" \- realizes the \fBisupper\fP(3) classification function + "xdigit" \- realizes the \fBisxdigit\fP(3) classification function +.fi +.SH "RETURN VALUE" +The +.BR wctype () +function returns a property descriptor +if the \fIname\fP is valid. +Otherwise it returns \fI(wctype_t) 0\fP. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR wctype () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR iswctype (3) diff --git a/original/man3/wcwidth.3 b/original/man3/wcwidth.3 new file mode 100644 index 00000000..9707ae99 --- /dev/null +++ b/original/man3/wcwidth.3 @@ -0,0 +1,55 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.TH WCWIDTH 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wcwidth \- determine columns needed for a wide character +.SH SYNOPSIS +.nf +.B #define _XOPEN_SOURCE +.B #include +.sp +.BI "int wcwidth(wchar_t " c ); +.fi +.SH DESCRIPTION +The +.BR wcwidth () +function returns the number of columns +needed to represent the wide character \fIc\fP. +If \fIc\fP is a printable wide character, the value +is at least 0. +If \fIc\fP is L\(aq\\0\(aq, the value is 0. +Otherwise \-1 is returned. +.SH "RETURN VALUE" +The +.BR wcwidth () +function returns the number of +column positions for \fIc\fP. +.SH "CONFORMING TO" +POSIX.1-2001. + +Note that glibc before 2.2.5 used the prototype +.br +.nf +.BI "int wcwidth(wint_t " c ); +.fi +.SH NOTES +The behavior of +.BR wcwidth () +depends on the +.B LC_CTYPE +category of the +current locale. +.SH "SEE ALSO" +.BR iswprint (3), +.BR wcswidth (3), +.BR feature_test_macros (7) diff --git a/original/man3/wmemchr.3 b/original/man3/wmemchr.3 new file mode 100644 index 00000000..505be094 --- /dev/null +++ b/original/man3/wmemchr.3 @@ -0,0 +1,41 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WMEMCHR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wmemchr \- search a wide character in a wide-character array +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *wmemchr(const wchar_t *" s ", wchar_t " c ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR wmemchr () +function is the wide-character equivalent of the +.BR memchr (3) +function. +It searches the \fIn\fP wide characters starting at \fIs\fP for +the first occurrence of the wide character \fIc\fP. +.SH "RETURN VALUE" +The +.BR wmemchr () +function returns a pointer to the first occurrence of \fIc\fP +among the \fIn\fP wide characters starting at \fIs\fP, or NULL if \fIc\fP does +not occur among these. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR memchr (3), +.BR wcschr (3) diff --git a/original/man3/wmemcmp.3 b/original/man3/wmemcmp.3 new file mode 100644 index 00000000..36802fb6 --- /dev/null +++ b/original/man3/wmemcmp.3 @@ -0,0 +1,48 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.TH WMEMCMP 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wmemcmp \- compare two arrays of wide-characters +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int wmemcmp(const wchar_t *" s1 ", const wchar_t *" s2 ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR wmemcmp () +function is the wide-character equivalent of the +.BR memcmp (3) +function. +It compares the \fIn\fP wide-characters starting at \fIs1\fP and the +\fIn\fP wide-characters starting at \fIs2\fP. +.SH "RETURN VALUE" +The +.BR wmemcmp () +function returns +zero if the wide-character arrays of size +\fIn\fP at \fIs1\fP and \fIs2\fP are equal. +It returns an integer greater than +zero if at the first differing position \fIi\fP (\fIi\fP < \fIn\fP), the +corresponding wide-character \fIs1[i]\fP is greater than \fIs2[i]\fP. +It returns an integer less than zero if +at the first differing position \fIi\fP +(\fIi\fP < \fIn\fP), the corresponding +wide-character \fIs1[i]\fP is less than +\fIs2[i]\fP. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR memcmp (3), +.BR wcscmp (3) diff --git a/original/man3/wmemcpy.3 b/original/man3/wmemcpy.3 new file mode 100644 index 00000000..ec0358b1 --- /dev/null +++ b/original/man3/wmemcpy.3 @@ -0,0 +1,48 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WMEMCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wmemcpy \- copy an array of wide-characters +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *wmemcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR wmemcpy () +function is the wide-character equivalent of the +.BR memcpy (3) +function. +It copies \fIn\fP wide characters from the array starting at +\fIsrc\fP to the array starting at \fIdest\fP. +.PP +The arrays may not overlap; use +.BR wmemmove (3) +to copy between overlapping +arrays. +.PP +The programmer must ensure that there is room for at least \fIn\fP wide +characters at \fIdest\fP. +.SH "RETURN VALUE" +.BR wmemcpy () +returns \fIdest\fP. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR memcpy (3), +.BR wcscpy (3), +.BR wmemmove (3), +.BR wmempcpy (3) diff --git a/original/man3/wmemmove.3 b/original/man3/wmemmove.3 new file mode 100644 index 00000000..42ad51fa --- /dev/null +++ b/original/man3/wmemmove.3 @@ -0,0 +1,43 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WMEMMOVE 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wmemmove \- copy an array of wide-characters +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *wmemmove(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR wmemmove () +function is the wide-character equivalent of the +.BR memmove (3) +function. +It copies \fIn\fP wide characters from the array +starting at \fIsrc\fP to the array starting at \fIdest\fP. +The arrays may +overlap. +.PP +The programmer must ensure that there is room for at least \fIn\fP wide +characters at \fIdest\fP. +.SH "RETURN VALUE" +.BR wmemmove () +returns \fIdest\fP. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR memmove (3), +.BR wmemcpy (3) diff --git a/original/man3/wmempcpy.3 b/original/man3/wmempcpy.3 new file mode 100644 index 00000000..26750cb6 --- /dev/null +++ b/original/man3/wmempcpy.3 @@ -0,0 +1 @@ +.so man3/mempcpy.3 diff --git a/original/man3/wmemset.3 b/original/man3/wmemset.3 new file mode 100644 index 00000000..e18fc681 --- /dev/null +++ b/original/man3/wmemset.3 @@ -0,0 +1,37 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WMEMSET 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH NAME +wmemset \- fill an array of wide-characters with a constant wide character +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "wchar_t *wmemset(wchar_t *" wcs ", wchar_t " wc ", size_t " n ); +.fi +.SH DESCRIPTION +The +.BR wmemset () +function is the wide-character equivalent of the +.BR memset (3) +function. +It fills the array of \fIn\fP wide-characters starting at \fIwcs\fP +with \fIn\fP copies of the wide character \fIwc\fP. +.SH "RETURN VALUE" +.BR wmemset () +returns \fIwcs\fP. +.SH "CONFORMING TO" +C99. +.SH "SEE ALSO" +.BR memset (3) diff --git a/original/man3/wordexp.3 b/original/man3/wordexp.3 new file mode 100644 index 00000000..4a30b32e --- /dev/null +++ b/original/man3/wordexp.3 @@ -0,0 +1,214 @@ +.\" 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. +.\" +.TH WORDEXP 3 2008-07-14 "" "Linux Programmer's Manual" +.SH NAME +wordexp, wordfree \- perform word expansion like a posix-shell +.SH SYNOPSIS +.B "#include " +.sp +.BI "int wordexp(const char *" s ", wordexp_t *" p ", int " flags ); +.sp +.BI "void wordfree(wordexp_t *" p ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR wordexp (), +.BR wordfree (): +_XOPEN_SOURCE +.SH DESCRIPTION +The function +.BR wordexp () +performs a shell-like expansion of the string +.I s +and returns the result in the structure pointed to by +.IR p . +The data type +.I wordexp_t +is a structure that at least has the fields +.IR we_wordc , +.IR we_wordv , +and +.IR we_offs . +The field +.I we_wordc +is a +.I size_t +that gives the number of words in the expansion of +.IR s . +The field +.I we_wordv +is a +.I char ** +that points to the array of words found. +The field +.I we_offs +of type +.I size_t +is sometimes (depending on +.IR flags , +see below) used to indicate the number of initial elements in the +.I we_wordv +array that should be filled with NULLs. +.LP +The function +.BR wordfree () +frees the allocated memory again. +More precisely, it does not free +its argument, but it frees the array +.I we_wordv +and the strings that points to. +.SS "The string argument" +Since the expansion is the same as the expansion by the shell (see +.BR sh (1)) +of the parameters to a command, the string +.I s +must not contain characters that would be illegal in shell command +parameters. +In particular, there must not be any unescaped +newline or |, &, ;, <, >, (, ), {, } characters +outside a command substitution or parameter substitution context. +.LP +If the argument +.I s +contains a word that starts with an unquoted comment character #, +then it is unspecified whether that word and all following words +are ignored, or the # is treated as a non-comment character. +.SS "The expansion" +The expansion done consists of the following stages: +tilde expansion (replacing ~user by user's home directory), +variable substitution (replacing $FOO by the value of the environment +variable FOO), command substitution (replacing $(command) or \`command\` +by the output of command), arithmetic expansion, field splitting, +wildcard expansion, quote removal. +.LP +The result of expansion of special parameters +($@, $*, $#, $?, $\-, $$, $!, $0) is unspecified. +.LP +Field splitting is done using the environment variable $IFS. +If it is not set, the field separators are space, tab and newline. +.SS "The output array" +The array +.I we_wordv +contains the words found, followed by a NULL. +.SS "The flags argument" +The +.I flag +argument is a bitwise inclusive OR of the following values: +.TP +.B WRDE_APPEND +Append the words found to the array resulting from a previous call. +.TP +.B WRDE_DOOFFS +Insert +.I we_offs +initial NULLs in the array +.IR we_wordv . +(These are not counted in the returned +.IR we_wordc .) +.TP +.B WRDE_NOCMD +Don't do command substitution. +.TP +.B WRDE_REUSE +The argument +.I p +resulted from a previous call to +.BR wordexp (), +and +.BR wordfree () +was not called. +Reuse the allocated storage. +.TP +.B WRDE_SHOWERR +Normally during command substitution +.I stderr +is redirected to +.IR /dev/null . +This flag specifies that +.I stderr +is not to be redirected. +.TP +.B WRDE_UNDEF +Consider it an error if an undefined shell variable is expanded. +.SH "RETURN VALUE" +In case of success 0 is returned. +In case of error +one of the following five values is returned. +.TP +.B WRDE_BADCHAR +Illegal occurrence of newline or one of |, &, ;, <, >, (, ), {, }. +.TP +.B WRDE_BADVAL +An undefined shell variable was referenced, and the +.B WRDE_UNDEF +flag +told us to consider this an error. +.TP +.B WRDE_CMDSUB +Command substitution occurred, and the +.B WRDE_NOCMD +flag told us to consider this an error. +.TP +.B WRDE_NOSPACE +Out of memory. +.TP +.B WRDE_SYNTAX +Shell syntax error, such as unbalanced parentheses or +unmatched quotes. +.SH VERSIONS +.BR wordexp () +and +.BR wordfree () +are provided in glibc since version 2.1. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH EXAMPLE +The output of the following example program +is approximately that of "ls [a-c]*.c". +.LP +.nf +#include +#include +#include + +int +main(int argc, char **argv) +{ + wordexp_t p; + char **w; + int i; + + wordexp("[a-c]*.c", &p, 0); + w = p.we_wordv; + for (i = 0; i < p.we_wordc; i++) + printf("%s\en", w[i]); + wordfree(&p); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR fnmatch (3), +.BR glob (3) diff --git a/original/man3/wordfree.3 b/original/man3/wordfree.3 new file mode 100644 index 00000000..f0035e0b --- /dev/null +++ b/original/man3/wordfree.3 @@ -0,0 +1 @@ +.so man3/wordexp.3 diff --git a/original/man3/wprintf.3 b/original/man3/wprintf.3 new file mode 100644 index 00000000..6222c998 --- /dev/null +++ b/original/man3/wprintf.3 @@ -0,0 +1,227 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.TH WPRINTF 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH NAME +wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf \- formatted +wide-character output conversion +.SH SYNOPSIS +.nf +.B #include +.B #include +.sp +.BI "int wprintf(const wchar_t *" format ", ...);" +.BI "int fwprintf(FILE *" stream ", const wchar_t *" format ", ...);" +.BI "int swprintf(wchar_t *" wcs ", size_t " maxlen , +.BI " const wchar_t *" format ", ...);" +.sp +.BI "int vwprintf(const wchar_t *" format ", va_list " args ); +.BI "int vfwprintf(FILE *" stream ", const wchar_t *" format ", va_list " args ); +.BI "int vswprintf(wchar_t *" wcs ", size_t " maxlen , +.BI " const wchar_t *" format ", va_list " args ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +All functions shown above: +.\" .BR wprintf (), +.\" .BR fwprintf (), +.\" .BR swprintf (), +.\" .BR vwprintf (), +.\" .BR vfwprintf (), +.\" .BR vswprintf (): +_XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH DESCRIPTION +The +.BR wprintf () +family of functions is +the wide-character equivalent of the +.BR printf (3) +family of functions. +It performs formatted output of wide +characters. +.PP +The +.BR wprintf () +and +.BR vwprintf () +functions +perform wide-character output to \fIstdout\fP. +\fIstdout\fP must not be byte oriented; see +.BR fwide (3) +for more information. +.PP +The +.BR fwprintf () +and +.BR vfwprintf () +functions +perform wide-character output to \fIstream\fP. +\fIstream\fP must not be byte oriented; see +.BR fwide (3) +for more information. +.PP +The +.BR swprintf () +and +.BR vswprintf () +functions +perform wide-character output +to an array of wide characters. +The programmer must ensure that there is +room for at least \fImaxlen\fP wide +characters at \fIwcs\fP. +.PP +These functions are like +the +.BR printf (3), +.BR vprintf (3), +.BR fprintf (3), +.BR vfprintf (3), +.BR sprintf (3), +.BR vsprintf (3) +functions except for the +following differences: +.TP +.B \(bu +The \fIformat\fP string is a wide-character string. +.TP +.B \(bu +The output consists of wide characters, not bytes. +.TP +.B \(bu +.BR swprintf () +and +.BR vswprintf () +take a \fImaxlen\fP argument, +.BR sprintf (3) +and +.BR vsprintf (3) +do not. +.RB ( snprintf (3) +and +.BR vsnprintf (3) +take a \fImaxlen\fP argument, but these functions do not return \-1 upon +buffer overflow on Linux.) +.PP +The treatment of the conversion characters \fBc\fP and \fBs\fP is different: +.TP +.B c +If no +.B l +modifier is present, the +.I int +argument is converted to a wide character by a call to the +.BR btowc (3) +function, and the resulting wide character is written. +If an +.B l +modifier is present, the +.I wint_t +(wide character) argument is written. +.TP +.B s +If no +.B l +modifier is present: The +.I "const\ char\ *" +argument is expected to be a pointer to an array of character type +(pointer to a string) containing a multibyte character sequence beginning +in the initial shift state. +Characters from the array are converted to +wide characters (each by a call to the +.BR mbrtowc (3) +function with a conversion state starting in the initial state before +the first byte). +The resulting wide characters are written up to +(but not including) the terminating null wide character. +If a precision is +specified, no more wide characters than the number specified are written. +Note that the precision determines the number of +.I wide characters +written, not the number of +.I bytes +or +.IR "screen positions" . +The array must contain a terminating null byte, unless a precision is given +and it is so small that the number of converted wide characters reaches it +before the end of the array is reached. +If an +.B l +modifier is present: The +.I "const\ wchar_t\ *" +argument is expected to be a pointer to an array of wide characters. +Wide characters from the array are written up to (but not including) a +terminating null wide character. +If a precision is specified, no more than +the number specified are written. +The array must contain a terminating null +wide character, unless a precision is given and it is smaller than or equal +to the number of wide characters in the array. +.SH "RETURN VALUE" +The functions return the number of wide characters written, excluding the +terminating null wide character in +case of the functions +.BR swprintf () +and +.BR vswprintf (). +They return \-1 when an error occurs. +.SH "CONFORMING TO" +C99. +.SH NOTES +The behavior of +.BR wprintf () +et al. depends +on the +.B LC_CTYPE +category of the +current locale. +.PP +If the \fIformat\fP string contains non-ASCII wide characters, the program +will only work correctly if the +.B LC_CTYPE +category of the current locale at +run time is the same as the +.B LC_CTYPE +category of the current locale at +compile time. +This is because the +.I wchar_t +representation is platform- and locale-dependent. +(The glibc represents +wide characters using their Unicode (ISO-10646) code point, but other +platforms don't do this. +Also, the use of C99 universal character names +of the form \\unnnn does not solve this problem.) +Therefore, in +internationalized programs, the \fIformat\fP string should consist of ASCII +wide characters only, or should be constructed at run time in an +internationalized way (e.g., using +.BR gettext (3) +or +.BR iconv (3), +followed by +.BR mbstowcs (3)). +.SH "SEE ALSO" +.BR fprintf (3), +.BR fputwc (3), +.BR fwide (3), +.BR printf (3), +.BR snprintf (3) +.\" .BR wscanf (3) diff --git a/original/man3/xcrypt.3 b/original/man3/xcrypt.3 new file mode 100644 index 00000000..cc292236 --- /dev/null +++ b/original/man3/xcrypt.3 @@ -0,0 +1,69 @@ +.\" Copyright 2003 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" this is the 3rd type of interface for cryptographic routines +.\" 1. encrypt() expects a bit field +.\" 2. cbc_crypt() byte values +.\" 3. xencrypt() a hexstring +.\" to bad to be true :( +.\" +.TH XCRYPT 3 2003-04-04 "" "Linux Programmer's Manual" +.SH NAME +xencrypt, xdecrypt, passwd2des \- RFS password encryption +.SH SYNOPSIS +.B "#include " +.sp +.BI "void passwd2des(char " *passwd ", char *" key ");" +.sp +.BI "int xencrypt(char *" secret ", char *" passwd ");" +.sp +.BI "int xdecrypt(char *" secret ", char *" passwd ");" +.SH DESCRIPTION +The function +.BR passwd2des () +takes a character string +.I passwd +of arbitrary length and fills a character array +.I key +of length 8. +The array +.I key +is suitable for use as DES key. +It has odd parity set in bit 0 of each byte. +Both other functions described here use this function to turn their +argument +.I passwd +into a DES key. +.LP +The +.BR xencrypt () +function takes the ASCII character string +.I secret +given in hex, +.\" (over the alphabet 0123456789abcdefABCDEF), +which must have a length that is a multiple of 16, +encrypts it using the DES key derived from +.I passwd +by +.BR passwd2des (), +and outputs the result again in +.I secret +as a hex string +.\" (over the alphabet 0123456789abcdef) +of the same length. +.LP +The +.BR xdecrypt () +function performs the converse operation. +.SH "RETURN VALUE" +The functions +.BR xencrypt () +and +.BR xdecrypt () +return 1 on success and 0 on error. +.SH VERSIONS +These routines are present in libc 4.6.27 and later, and in +glibc 2.1 and later. +.SH BUGS +The prototypes are missing from the abovementioned include file. +.SH "SEE ALSO" +.BR cbc_crypt (3) diff --git a/original/man3/xdecrypt.3 b/original/man3/xdecrypt.3 new file mode 100644 index 00000000..01b6ce65 --- /dev/null +++ b/original/man3/xdecrypt.3 @@ -0,0 +1 @@ +.so man3/xcrypt.3 diff --git a/original/man3/xdr.3 b/original/man3/xdr.3 new file mode 100644 index 00000000..da02912e --- /dev/null +++ b/original/man3/xdr.3 @@ -0,0 +1,550 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)xdr.3n 2.2 88/08/03 4.0 RPCSRC; from 1.16 88/03/14 SMI +.\" +.\" 2007-12-30, mtk, Convert function prototypes to modern C syntax +.\" +.TH XDR 3 2007-12-30 "" "Linux Programmer's Manual" +.SH NAME +xdr \- library routines for external data representation +.SH "SYNOPSIS AND DESCRIPTION" +.LP +These routines allow C programmers to describe +arbitrary data structures in a machine-independent fashion. +Data for remote procedure calls are transmitted using these +routines. + +The prototypes below are declared in +.I +and make use of the following types: +.in +4n +.nf + +typedef int \fIbool_t\fP; + +typedef bool_t (*\fIxdrproc_t\fP) (XDR *, void *,...); +.fi +.in +.LP +For the declaration of the +.I XDR +type, see +.IR . +.LP +.nf +.BI "bool_t xdr_array(XDR *" xdrs ", char **" arrp ", unsigned int *" sizep , +.BI " unsigned int " maxsize ", unsigned int " elsize , +.BI " xdrproc_t " elproc ); +.fi +.IP +A filter primitive that translates between variable-length arrays +and their corresponding external representations. +The argument +.I arrp +is the address of the pointer to the array, while +.I sizep +is the address of the element count of the array; +this element count cannot exceed +.IR maxsize . +The argument +.I elsize +is the +.I sizeof +each of the array's elements, and +.I elproc +is an XDR filter that translates between +the array elements' C form, and their external +representation. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_bool(XDR *" xdrs ", bool_t *" bp ); +.fi +.IP +A filter primitive that translates between booleans (C +integers) +and their external representations. +When encoding data, this +filter produces values of either one or zero. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_bytes(XDR *" xdrs ", char **" sp ", unsigned int *" sizep , +.BI " unsigned int " maxsize ); +.fi +.IP +A filter primitive that translates between counted byte +strings and their external representations. +The argument +.I sp +is the address of the string pointer. +The length of the +string is located at address +.IR sizep ; +strings cannot be longer than +.IR maxsize . +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_char(XDR *" xdrs ", char *" cp ); +.fi +.IP +A filter primitive that translates between C characters +and their external representations. +This routine returns one if it succeeds, zero otherwise. +Note: encoded characters are not packed, and occupy 4 bytes each. +For arrays of characters, it is worthwhile to +consider +.BR xdr_bytes (), +.BR xdr_opaque () +or +.BR xdr_string (). +.LP +.nf +.BI "void xdr_destroy(XDR *" xdrs ); +.fi +.IP +A macro that invokes the destroy routine associated with the XDR stream, +.IR xdrs . +Destruction usually involves freeing private data structures +associated with the stream. +Using +.I xdrs +after invoking +.BR xdr_destroy () +is undefined. +.LP +.nf +.BI "bool_t xdr_double(XDR *" xdrs ", double *" dp ); +.fi +.IP +A filter primitive that translates between C +.I double +precision numbers and their external representations. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_enum(XDR *" xdrs ", enum_t *" ep ); +.fi +.IP +A filter primitive that translates between C +.IR enum s +(actually integers) and their external representations. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_float(XDR *" xdrs ", float *" fp ); +.fi +.IP +A filter primitive that translates between C +.IR float s +and their external representations. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "void xdr_free(xdrproc_t " proc ", char *" objp ); +.fi +.IP +Generic freeing routine. +The first argument is the XDR routine for the object being freed. +The second argument is a pointer to the object itself. +Note: the pointer passed to this routine is +.I not +freed, but what it points to +.I is +freed (recursively). +.LP +.nf +.BI "unsigned int xdr_getpos(XDR *" xdrs ); +.fi +.IP +A macro that invokes the get-position routine +associated with the XDR stream, +.IR xdrs . +The routine returns an unsigned integer, +which indicates the position of the XDR byte stream. +A desirable feature of XDR +streams is that simple arithmetic works with this number, +although the XDR stream instances need not guarantee this. +.LP +.nf +.BI "long *xdr_inline(XDR *" xdrs ", int " len ); +.fi +.IP +A macro that invokes the inline routine associated with the XDR stream, +.IR xdrs . +The routine returns a pointer +to a contiguous piece of the stream's buffer; +.I len +is the byte length of the desired buffer. +Note: pointer is cast to +.IR "long *" . +.IP +Warning: +.BR xdr_inline () +may return NULL (0) +if it cannot allocate a contiguous piece of a buffer. +Therefore the behavior may vary among stream instances; +it exists for the sake of efficiency. +.LP +.nf +.BI "bool_t xdr_int(XDR *" xdrs ", int *" ip ); +.fi +.IP +A filter primitive that translates between C integers +and their external representations. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_long(XDR *" xdrs ", long *" lp ); +.fi +.IP +A filter primitive that translates between C +.I long +integers and their external representations. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "void xdrmem_create(XDR *" xdrs ", char *" addr ", unsigned int " size , +.BI " enum xdr_op " op ); +.fi +.IP +This routine initializes the XDR stream object pointed to by +.IR xdrs . +The stream's data is written to, or read from, +a chunk of memory at location +.I addr +whose length is no more than +.I size +bytes long. +The +.I op +determines the direction of the XDR stream (either +.BR XDR_ENCODE , +.BR XDR_DECODE , +or +.BR XDR_FREE ). +.LP +.nf +.BI "bool_t xdr_opaque(XDR *" xdrs ", char *" cp ", unsigned int " cnt ); +.fi +.IP +A filter primitive that translates between fixed size opaque data +and its external representation. +The argument +.I cp +is the address of the opaque object, and +.I cnt +is its size in bytes. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_pointer(XDR *" xdrs ", char **" objpp , +.BI " unsigned int " objsize ", xdrproc_t " xdrobj ); +.fi +.IP +Like +.BR xdr_reference () +except that it serializes NULL pointers, whereas +.BR xdr_reference () +does not. +Thus, +.BR xdr_pointer () +can represent +recursive data structures, such as binary trees or +linked lists. +.LP +.nf +.BI "void xdrrec_create(XDR *" xdrs ", unsigned int " sendsize , +.BI " unsigned int " recvsize ", char *" handle , +.BI " int (*" readit ") (char *, char *, int)," +.BI " int (*" writeit ") (char *, char *, int));" +.fi +.IP +This routine initializes the XDR stream object pointed to by +.IR xdrs . +The stream's data is written to a buffer of size +.IR sendsize ; +a value of zero indicates the system should use a suitable default. +The stream's data is read from a buffer of size +.IR recvsize ; +it too can be set to a suitable default by passing a zero value. +When a stream's output buffer is full, +.I writeit +is called. +Similarly, when a stream's input buffer is empty, +.I readit +is called. +The behavior of these two routines is similar to +the system calls +.BR read (2) +and +.BR write (2), +except that +.I handle +is passed to the former routines as the first argument. +Note: the XDR stream's +.I op +field must be set by the caller. +.IP +Warning: this XDR stream implements an intermediate record stream. +Therefore there are additional bytes in the stream +to provide record boundary information. +.LP +.nf +.BI "bool_t xdrrec_endofrecord(XDR *" xdrs ", int " sendnow ); +.fi +.IP +This routine can be invoked only on streams created by +.BR xdrrec_create (). +The data in the output buffer is marked as a completed record, +and the output buffer is optionally written out if +.I sendnow +is nonzero. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdrrec_eof(XDR *" xdrs ); +.fi +.IP +This routine can be invoked only on streams created by +.BR xdrrec_create (). +After consuming the rest of the current record in the stream, +this routine returns one if the stream has no more input, +zero otherwise. +.LP +.nf +.BI "bool_t xdrrec_skiprecord(XDR *" xdrs ); +.fi +.IP +This routine can be invoked only on +streams created by +.BR xdrrec_create (). +It tells the XDR implementation that the rest of the current record +in the stream's input buffer should be discarded. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_reference(XDR *" xdrs ", char **" pp ", unsigned int " size , +.BI " xdrproc_t " proc ); +.fi +.IP +A primitive that provides pointer chasing within structures. +The argument +.I pp +is the address of the pointer; +.I size +is the +.I sizeof +the structure that +.I *pp +points to; and +.I proc +is an XDR procedure that filters the structure +between its C form and its external representation. +This routine returns one if it succeeds, zero otherwise. +.IP +Warning: this routine does not understand NULL pointers. +Use +.BR xdr_pointer () +instead. +.LP +.nf +.BI "xdr_setpos(XDR *" xdrs ", unsigned int " pos ); +.fi +.IP +A macro that invokes the set position routine associated with +the XDR stream +.IR xdrs . +The argument +.I pos +is a position value obtained from +.BR xdr_getpos (). +This routine returns one if the XDR stream could be repositioned, +and zero otherwise. +.IP +Warning: it is difficult to reposition some types of XDR +streams, so this routine may fail with one +type of stream and succeed with another. +.LP +.nf +.BI "bool_t xdr_short(XDR *" xdrs ", short *" sp ); +.fi +.IP +A filter primitive that translates between C +.I short +integers and their external representations. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "void xdrstdio_create(XDR *" xdrs ", FILE *" file ", enum xdr_op " op ); +.fi +.IP +This routine initializes the XDR stream object pointed to by +.IR xdrs . +The XDR stream data is written to, or read from, the +.I stdio +stream +.IR file . +The argument +.I op +determines the direction of the XDR stream (either +.BR XDR_ENCODE , +.BR XDR_DECODE , +or +.BR XDR_FREE ). +.IP +Warning: the destroy routine associated with such XDR streams calls +.BR fflush (3) +on the +.I file +stream, but never +.BR fclose (3). +.LP +.nf +.BI "bool_t xdr_string(XDR *" xdrs ", char **" sp ", unsigned int " maxsize ); +.fi +.IP +A filter primitive that translates between C strings and +their corresponding external representations. +Strings cannot be longer than +.IR maxsize . +Note: +.I sp +is the address of the string's pointer. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_u_char(XDR *" xdrs ", unsigned char *" ucp ); +.fi +.IP +A filter primitive that translates between +.I unsigned +C characters and their external representations. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned *" up ); +.fi +.IP +A filter primitive that translates between C +.I unsigned +integers and their external representations. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_u_long(XDR *" xdrs ", unsigned long *" ulp ); +.fi +.IP +A filter primitive that translates between C +.I "unsigned long" +integers and their external representations. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_u_short(XDR *" xdrs ", unsigned short *" usp ); +.fi +.IP +A filter primitive that translates between C +.I "unsigned short" +integers and their external representations. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_union(XDR *" xdrs ", int *" dscmp ", char *" unp , +.BI " struct xdr_discrim *" choices , +.BI " xdrproc_t " defaultarm "); /* may equal NULL */" +.fi +.IP +A filter primitive that translates between a discriminated C +.I union +and its corresponding external representation. +It first +translates the discriminant of the union located at +.IR dscmp . +This discriminant is always an +.IR enum_t . +Next the union located at +.I unp +is translated. +The argument +.I choices +is a pointer to an array of +.BR xdr_discrim () +structures. +Each structure contains an ordered pair of +.RI [ value , proc ]. +If the union's discriminant is equal to the associated +.IR value , +then the +.I proc +is called to translate the union. +The end of the +.BR xdr_discrim () +structure array is denoted by a routine of value NULL. +If the discriminant is not found in the +.I choices +array, then the +.I defaultarm +procedure is called (if it is not NULL). +Returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_vector(XDR *" xdrs ", char *" arrp ", unsigned int " size , +.BI " unsigned int " elsize ", xdrproc_t " elproc ); +.fi +.IP +A filter primitive that translates between fixed-length arrays +and their corresponding external representations. +The argument +.I arrp +is the address of the pointer to the array, while +.I size +is the element count of the array. +The argument +.I elsize +is the +.I sizeof +each of the array's elements, and +.I elproc +is an XDR filter that translates between +the array elements' C form, and their external +representation. +This routine returns one if it succeeds, zero otherwise. +.LP +.nf +.BI "bool_t xdr_void(void);" +.fi +.IP +This routine always returns one. +It may be passed to RPC routines that require a function argument, +where nothing is to be done. +.LP +.nf +.BI "bool_t xdr_wrapstring(XDR *" xdrs ", char **" sp ); +.fi +.IP +A primitive that calls +.B "xdr_string(xdrs, sp,MAXUN.UNSIGNED );" +where +.B MAXUN.UNSIGNED +is the maximum value of an unsigned integer. +.BR xdr_wrapstring () +is handy because the RPC package passes a maximum of two XDR +routines as arguments, and +.BR xdr_string (), +one of the most frequently used primitives, requires three. +Returns one if it succeeds, zero otherwise. +.SH "SEE ALSO" +.BR rpc (3) +.LP +The following manuals: +.RS +eXternal Data Representation Standard: Protocol Specification +.br +eXternal Data Representation: Sun Technical Notes +.br +.IR "XDR: External Data Representation Standard" , +RFC\ 1014, Sun Microsystems, Inc., +USC-ISI. +.RE diff --git a/original/man3/xdr_accepted_reply.3 b/original/man3/xdr_accepted_reply.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/xdr_accepted_reply.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/xdr_array.3 b/original/man3/xdr_array.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_array.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_authunix_parms.3 b/original/man3/xdr_authunix_parms.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/xdr_authunix_parms.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/xdr_bool.3 b/original/man3/xdr_bool.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_bool.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_bytes.3 b/original/man3/xdr_bytes.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_bytes.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_callhdr.3 b/original/man3/xdr_callhdr.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/xdr_callhdr.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/xdr_callmsg.3 b/original/man3/xdr_callmsg.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/xdr_callmsg.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/xdr_char.3 b/original/man3/xdr_char.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_char.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_destroy.3 b/original/man3/xdr_destroy.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_destroy.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_double.3 b/original/man3/xdr_double.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_double.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_enum.3 b/original/man3/xdr_enum.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_enum.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_float.3 b/original/man3/xdr_float.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_float.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_free.3 b/original/man3/xdr_free.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_free.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_getpos.3 b/original/man3/xdr_getpos.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_getpos.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_inline.3 b/original/man3/xdr_inline.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_inline.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_int.3 b/original/man3/xdr_int.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_int.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_long.3 b/original/man3/xdr_long.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_long.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_opaque.3 b/original/man3/xdr_opaque.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_opaque.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_opaque_auth.3 b/original/man3/xdr_opaque_auth.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/xdr_opaque_auth.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/xdr_pmap.3 b/original/man3/xdr_pmap.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/xdr_pmap.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/xdr_pmaplist.3 b/original/man3/xdr_pmaplist.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/xdr_pmaplist.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/xdr_pointer.3 b/original/man3/xdr_pointer.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_pointer.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_reference.3 b/original/man3/xdr_reference.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_reference.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_rejected_reply.3 b/original/man3/xdr_rejected_reply.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/xdr_rejected_reply.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/xdr_replymsg.3 b/original/man3/xdr_replymsg.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/xdr_replymsg.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/xdr_setpos.3 b/original/man3/xdr_setpos.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_setpos.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_short.3 b/original/man3/xdr_short.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_short.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_string.3 b/original/man3/xdr_string.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_string.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_u_char.3 b/original/man3/xdr_u_char.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_u_char.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_u_int.3 b/original/man3/xdr_u_int.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_u_int.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_u_long.3 b/original/man3/xdr_u_long.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_u_long.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_u_short.3 b/original/man3/xdr_u_short.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_u_short.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_union.3 b/original/man3/xdr_union.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_union.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_vector.3 b/original/man3/xdr_vector.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_vector.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_void.3 b/original/man3/xdr_void.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_void.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdr_wrapstring.3 b/original/man3/xdr_wrapstring.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdr_wrapstring.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdrmem_create.3 b/original/man3/xdrmem_create.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdrmem_create.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdrrec_create.3 b/original/man3/xdrrec_create.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdrrec_create.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdrrec_endofrecord.3 b/original/man3/xdrrec_endofrecord.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdrrec_endofrecord.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdrrec_eof.3 b/original/man3/xdrrec_eof.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdrrec_eof.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdrrec_skiprecord.3 b/original/man3/xdrrec_skiprecord.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdrrec_skiprecord.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xdrstdio_create.3 b/original/man3/xdrstdio_create.3 new file mode 100644 index 00000000..7ff092d0 --- /dev/null +++ b/original/man3/xdrstdio_create.3 @@ -0,0 +1 @@ +.so man3/xdr.3 diff --git a/original/man3/xencrypt.3 b/original/man3/xencrypt.3 new file mode 100644 index 00000000..01b6ce65 --- /dev/null +++ b/original/man3/xencrypt.3 @@ -0,0 +1 @@ +.so man3/xcrypt.3 diff --git a/original/man3/xprt_register.3 b/original/man3/xprt_register.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/xprt_register.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/xprt_unregister.3 b/original/man3/xprt_unregister.3 new file mode 100644 index 00000000..b1847116 --- /dev/null +++ b/original/man3/xprt_unregister.3 @@ -0,0 +1 @@ +.so man3/rpc.3 diff --git a/original/man3/y0.3 b/original/man3/y0.3 new file mode 100644 index 00000000..8775e202 --- /dev/null +++ b/original/man3/y0.3 @@ -0,0 +1,235 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified Sat Jul 24 19:08:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-08-25, aeb +.\" Modified 2004-11-12 as per suggestion by Fabian Kreutz/AEB +.\" 2008-07-24, mtk, created this page, based on material from j0.3. +.\" +.TH Y0 3 2008-08-10 "" "Linux Programmer's Manual" +.SH NAME +y0, y0f, y0l, y1, y1f, y1l, yn, ynf, ynl \- +Bessel functions of the second kind +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "double y0(double " x ); +.br +.BI "double y1(double " x ); +.br +.BI "double yn(int " n ", double " x ); +.sp +.BI "float y0f(float " x ); +.br +.BI "float y1f(float " x ); +.br +.BI "float ynf(int " n ", float " x ); +.sp +.BI "long double y0l(long double " x ); +.br +.BI "long double y1l(long double " x ); +.br +.BI "long double ynl(int " n ", long double " x ); +.fi +.sp +Link with \fI\-lm\fP. +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR y0 (), +.BR y1 (), +.BR yn (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE +.br +.BR y0f (), +.BR y0l (), +.BR y1f (), +.BR y1l (), +.BR ynf (), +.BR ynl (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.\" Also seems to work: -std=c99 -D_XOPEN_SOURCE +.ad b +.SH DESCRIPTION +.PP +The +.BR y0 () +and +.BR y1 () +functions return Bessel functions of \fIx\fP +of the second kind of orders 0 and 1, respectively. +The +.BR yn () +function +returns the Bessel function of \fIx\fP of the second kind of order \fIn\fP. +.PP +The value of \fIx\fP must be positive. +.PP +The +.BR y0f () +etc. and +.BR y0l () +etc. functions are versions that take and return +.I float +and +.I "long double" +values, respectively. +.SH RETURN VALUE +On success, these functions return the appropriate +Bessel value of the second kind for +.IR x . + +If +.I x +is a NaN, a NaN is returned. + +If +.I x +is negative, +a domain error occurs, +and the functions return +.RB - HUGE_VAL , +.RB - HUGE_VALF , +or +.RB - HUGE_VALL , +respectively. +(POSIX.1-2001 also allows a NaN return for this case.) + +If +.I x +is 0.0, +a pole error occurs, +and the functions return +.RB - HUGE_VAL , +.RB - HUGE_VALF , +or +.RB - HUGE_VALL , +respectively. + +If the result underflows, +a range error occurs, +and the functions return 0.0 + +If the result overflows, +a range error occurs, +and the functions return +.RB - HUGE_VAL , +.RB - HUGE_VALF , +or +.RB - HUGE_VALL , +respectively. +(POSIX.1-2001 also allows a 0.0 return for this case.) +.SH ERRORS +See +.BR math_error (7) +for information on how to determine whether an error has occurred +when calling these functions. +.PP +The following errors can occur: +.TP +Domain error: \fIx\fP is negative +.I errno +is set to +.BR EDOM . +An invalid floating-point exception +.RB ( FE_INVALID ) +is raised. +.TP +Pole error: \fIx\fP is 0.0 +.\" Before POSIX.1-2001 TC2, this was (inconsistently) specified +.\" as a range error. +.I errno +is set to +.\" FIXME . y0(0.0) gives EDOM +.BR ERANGE +(but see BUGS). +No +.B FE_DIVBYZERO +exception is returned by +.BR fetestexcept (3) +for this case. +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6808 +.TP +Range error: result underflow +.\" e.g., y0(1e33) on glibc 2.8/x86-32 +.I errno +is set to +.BR 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 +No +.B FE_UNDERFLOW +exception is returned by +.BR fetestexcept (3) +for this case. +.TP +Range error: result overflow +.\" e.g., yn(10, 1e-40) on glibc 2.8/x86-32 +.\" .I errno +.\" is set to +.\" .BR ERANGE . +.I errno +is not set for this case. +.\" FIXME . Is it intentional that errno is not set? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6808 +An overflow floating-point exception +.RB ( FE_OVERFLOW ) +is raised. +.SH "CONFORMING TO" +The functions returning +.I double +conform to SVr4, 4.3BSD, +POSIX.1-2001. +The others are nonstandard functions that also exist on the BSDs. +.SH BUGS +On a pole error, these functions set +.I errno +to +.BR EDOM , +instead of +.BR ERANGE +as POSIX.1-2004 requires. +.\" FIXME . +.\" Bug raised: http://sourceware.org/bugzilla/show_bug.cgi?id=6807 + +In glibc version 2.3.2 and earlier, +.\" 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. +these functions do not raise an invalid floating-point exception +.RB ( FE_INVALID ) +when a domain error occurs. +.SH SEE ALSO +.BR j0 (3) diff --git a/original/man3/y0f.3 b/original/man3/y0f.3 new file mode 100644 index 00000000..88b3c999 --- /dev/null +++ b/original/man3/y0f.3 @@ -0,0 +1 @@ +.so man3/y0.3 diff --git a/original/man3/y0l.3 b/original/man3/y0l.3 new file mode 100644 index 00000000..88b3c999 --- /dev/null +++ b/original/man3/y0l.3 @@ -0,0 +1 @@ +.so man3/y0.3 diff --git a/original/man3/y1.3 b/original/man3/y1.3 new file mode 100644 index 00000000..88b3c999 --- /dev/null +++ b/original/man3/y1.3 @@ -0,0 +1 @@ +.so man3/y0.3 diff --git a/original/man3/y1f.3 b/original/man3/y1f.3 new file mode 100644 index 00000000..88b3c999 --- /dev/null +++ b/original/man3/y1f.3 @@ -0,0 +1 @@ +.so man3/y0.3 diff --git a/original/man3/y1l.3 b/original/man3/y1l.3 new file mode 100644 index 00000000..88b3c999 --- /dev/null +++ b/original/man3/y1l.3 @@ -0,0 +1 @@ +.so man3/y0.3 diff --git a/original/man3/yn.3 b/original/man3/yn.3 new file mode 100644 index 00000000..88b3c999 --- /dev/null +++ b/original/man3/yn.3 @@ -0,0 +1 @@ +.so man3/y0.3 diff --git a/original/man3/ynf.3 b/original/man3/ynf.3 new file mode 100644 index 00000000..88b3c999 --- /dev/null +++ b/original/man3/ynf.3 @@ -0,0 +1 @@ +.so man3/y0.3 diff --git a/original/man3/ynl.3 b/original/man3/ynl.3 new file mode 100644 index 00000000..88b3c999 --- /dev/null +++ b/original/man3/ynl.3 @@ -0,0 +1 @@ +.so man3/y0.3 diff --git a/original/man4/console.4 b/original/man4/console.4 new file mode 100644 index 00000000..6b58630d --- /dev/null +++ b/original/man4/console.4 @@ -0,0 +1,93 @@ +.\" Copyright (c) 1994 Andries Brouwer (aeb@cwi.nl), Mon Oct 31 21:03:19 MET 1994 +.\" +.\" 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. +.\" +.\" Modified, Sun Feb 26 14:58:45 1995, faith@cs.unc.edu +.\" " +.TH CONSOLE 4 1994-10-31 "Linux" "Linux Programmer's Manual" +.SH NAME +console \- console terminal and virtual consoles +.SH DESCRIPTION +A Linux system has up to 63 \fIvirtual consoles\fP +(character devices with major number 4 and minor number 1 to 63), +usually called \fI/dev/tty\fP\fIn\fP with 1 \(<= \fIn\fP \(<= 63. +The current console is also addressed by +\fI/dev/console\fP or \fI/dev/tty0\fP, the character device with +major number 4 and minor number 0. +The device files /dev/* are usually created using the script MAKEDEV, +or using +.BR mknod (1), +usually with mode 0622 and owner root.tty. +.LP +Before kernel version 1.1.54 the number of virtual consoles was +compiled into the kernel (in tty.h: #define NR_CONSOLES 8) +and could be changed by editing and recompiling. +Since version 1.1.54 virtual consoles are created on the fly, +as soon as they are needed. +.LP +Common ways to start a process on a console are: +(a) tell +.BR init (8) +(in +.BR inittab (5)) +to start a +.BR mingetty (8) +(or +.BR agetty (8)) +on the console; +(b) ask +.BR openvt (1) +to start a process on the console; +(c) start X \(em it will find the first unused console, +and display its output there. +(There is also the ancient +.BR doshell (8).) +.LP +Common ways to switch consoles are: (a) use Alt+F\fIn\fP or +Ctrl+Alt+F\fIn\fP to switch to console \fIn\fP; AltGr+F\fIn\fP +might bring you to console \fIn\fP+12 [here Alt and AltGr refer +to the left and right Alt keys, respectively]; +(b) use Alt+RightArrow or Alt+LeftArrow to cycle through +the presently allocated consoles; (c) use the program +.BR chvt (1). +(The key mapping is user settable, see +.BR loadkeys (1); +the above mentioned key combinations are according to the default settings.) +.LP +The command +.BR deallocvt (1) +(formerly \fBdisalloc\fP) +will free the memory taken by the screen buffers for consoles +that no longer have any associated process. +.SS Properties +Consoles carry a lot of state. +I hope to document that some other time. +The most important fact is that the consoles simulate vt100 terminals. +In particular, a console is reset to the initial state by printing the two +characters ESC c. +All escape sequences can be found in +.BR console_codes (4). +.SH FILES +.I /dev/console +.br +.I /dev/tty* +.SH "SEE ALSO" +.BR chvt (1), +.BR deallocvt (1), +.BR loadkeys (1), +.BR mknod (1), +.BR openvt (1), +.BR console_codes (4), +.BR console_ioctl (4), +.BR tty (4), +.BR ttyS (4), +.BR charsets (7), +.BR agetty (8), +.BR init (8), +.BR mapscrn (8), +.BR mingetty (8), +.BR resizecons (8), +.BR setfont (8) diff --git a/original/man4/console_codes.4 b/original/man4/console_codes.4 new file mode 100644 index 00000000..2a806b7b --- /dev/null +++ b/original/man4/console_codes.4 @@ -0,0 +1,638 @@ +'\" t +.\" Copyright (c) 1996 Andries Brouwer , Mon Oct 31 22:13:04 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. +.\" +.\" This is combined from many sources. +.\" For Linux, the definitive source is of course console.c. +.\" About vt100-like escape sequences in general there are +.\" the ISO 6429 and ISO 2022 norms, the descriptions of +.\" an actual vt100, and the xterm docs (ctlseqs.ms). +.\" Substantial portions of this text are derived from a write-up +.\" by Eric S. Raymond . +.\" +.\" Tiny correction, aeb, 961107. +.\" +.\" 2006-05-27, Several corrections - Thomas E. Dickey +.\" +.TH CONSOLE_CODES 4 2008-01-01 "Linux" "Linux Programmer's Manual" +.SH NAME +console_codes \- Linux console escape and control sequences +.SH DESCRIPTION +The Linux console implements a large subset of the VT102 and ECMA-48/ISO +6429/ANSI X3.64 terminal controls, plus certain private-mode sequences +for changing the color palette, character-set mapping, etc. +In the tabular descriptions below, the second column gives ECMA-48 or DEC +mnemonics (the latter if prefixed with DEC) for the given function. +Sequences without a mnemonic are neither ECMA-48 nor VT102. +.LP +After all the normal output processing has been done, and a +stream of characters arrives at the console driver for actual +printing, the first thing that happens is a translation from +the code used for processing to the code used for printing. +.LP +If the console is in UTF-8 mode, then the incoming bytes are +first assembled into 16-bit Unicode codes. +Otherwise each byte is transformed according to the current mapping table +(which translates it to a Unicode value). +See the \fBCharacter Sets\fP section below for discussion. +.LP +In the normal case, the Unicode value is converted to a font index, +and this is stored in video memory, so that the corresponding glyph +(as found in video ROM) appears on the screen. +Note that the use of Unicode (and the design of the PC hardware) +allows us to use 512 different glyphs simultaneously. +.LP +If the current Unicode value is a control character, or we are +currently processing an escape sequence, the value will treated +specially. +Instead of being turned into a font index and rendered as +a glyph, it may trigger cursor movement or other control functions. +See the \fBLinux Console Controls\fP section below for discussion. +.LP +It is generally not good practice to hard-wire terminal controls into +programs. +Linux supports a +.BR terminfo (5) +database of terminal capabilities. +Rather than emitting console escape sequences by hand, you will almost +always want to use a terminfo-aware screen library or utility such as +.BR ncurses (3), +.BR tput (1), +or +.BR reset (1). +.SS "Linux Console Controls" +This section describes all the control characters and escape sequences +that invoke special functions (i.e., anything other than writing a +glyph at the current cursor location) on the Linux console. +.PP +.B "Control characters" +.sp +A character is a control character if (before transformation +according to the mapping table) it has one of the 14 codes +00 (NUL), 07 (BEL), 08 (BS), 09 (HT), 0a (LF), 0b (VT), +0c (FF), 0d (CR), 0e (SO), 0f (SI), 18 (CAN), 1a (SUB), +1b (ESC), 7f (DEL). +One can set a "display control characters" mode (see below), +and allow 07, 09, 0b, 18, 1a, 7f to be displayed as glyphs. +On the other hand, in UTF-8 mode all codes 00-1f are regarded +as control characters, regardless of any "display control characters" +mode. +.PP +If we have a control character, it is acted upon immediately +and then discarded (even in the middle of an escape sequence) +and the escape sequence continues with the next character. +(However, ESC starts a new escape sequence, possibly aborting a previous +unfinished one, and CAN and SUB abort any escape sequence.) +The recognized control characters are BEL, BS, HT, LF, VT, FF, +CR, SO, SI, CAN, SUB, ESC, DEL, CSI. +They do what one would expect: +.HP +BEL (0x07, \fB^G\fP) beeps; +.HP +BS (0x08, \fB^H\fP) backspaces one column +(but not past the beginning of the line); +.HP +HT (0x09, \fB^I\fP) goes to the next tab stop or to the end of the line +if there is no earlier tab stop; +.HP +LF (0x0A, \fB^J\fP), VT (0x0B, \fB^K\fP) and +FF (0x0C, \fB^L\fP) all give a linefeed, +and if LF/NL (new-line mode) is set also a carriage return; +.HP +CR (0x0D, \fB^M\fP) gives a carriage return; +.HP +SO (0x0E, \fB^N\fP) activates the G1 character set; +.HP +SI (0x0F, \fB^O\fP) activates the G0 character set; +.HP +CAN (0x18, \fB^X\fP) and SUB (0x1A, \fB^Z\fP) interrupt escape sequences; +.HP +ESC (0x1B, \fB^[\fP) starts an escape sequence; +.HP +DEL (0x7F) is ignored; +.HP +CSI (0x9B) is equivalent to ESC [. +.PP +.B "ESC- but not CSI-sequences" +.TS +l l l. +ESC c RIS Reset. +ESC D IND Linefeed. +ESC E NEL Newline. +ESC H HTS Set tab stop at current column. +ESC M RI Reverse linefeed. +ESC Z DECID T{ +DEC private identification. The kernel +returns the string ESC [ ? 6 c, claiming +that it is a VT102. +T} +ESC 7 DECSC T{ +Save current state (cursor coordinates, +attributes, character sets pointed at by G0, G1). +T} +ESC 8 DECRC Restore state most recently saved by ESC 7. +ESC [ CSI Control sequence introducer +ESC % Start sequence selecting character set +ESC % @ \0\0\0Select default (ISO 646 / ISO 8859-1) +ESC % G \0\0\0Select UTF-8 +ESC % 8 \0\0\0Select UTF-8 (obsolete) +ESC # 8 DECALN DEC screen alignment test \- fill screen with E's. +ESC ( Start sequence defining G0 character set +ESC ( B \0\0\0Select default (ISO 8859-1 mapping) +ESC ( 0 \0\0\0Select VT100 graphics mapping +ESC ( U \0\0\0Select null mapping \- straight to character ROM +ESC ( K \0\0\0Select user mapping \- the map that is loaded by + \0\0\0the utility \fBmapscrn\fP(8). +ESC ) Start sequence defining G1 + (followed by one of B, 0, U, K, as above). +ESC > DECPNM Set numeric keypad mode +ESC = DECPAM Set application keypad mode +ESC ] OSC T{ +(Should be: Operating system command) +ESC ] P \fInrrggbb\fP: set palette, with parameter +given in 7 hexadecimal digits after the final P :-(. +Here \fIn\fP is the color (0-15), and \fIrrggbb\fP indicates +the red/green/blue values (0-255). +ESC ] R: reset palette +T} +.TE +.PP +.B "ECMA-48 CSI sequences" +.sp +CSI (or ESC [) is followed by a sequence of parameters, +at most NPAR (16), that are decimal numbers separated by +semicolons. +An empty or absent parameter is taken to be 0. +The sequence of parameters may be preceded by a single question mark. +.PP +However, after CSI [ (or ESC [ [) a single character is read +and this entire sequence is ignored. +(The idea is to ignore an echoed function key.) +.PP +The action of a CSI sequence is determined by its final character. +.TS +l l l. +@ ICH Insert the indicated # of blank characters. +A CUU Move cursor up the indicated # of rows. +B CUD Move cursor down the indicated # of rows. +C CUF Move cursor right the indicated # of columns. +D CUB Move cursor left the indicated # of columns. +E CNL Move cursor down the indicated # of rows, to column 1. +F CPL Move cursor up the indicated # of rows, to column 1. +G CHA Move cursor to indicated column in current row. +H CUP Move cursor to the indicated row, column (origin at 1,1). +J ED Erase display (default: from cursor to end of display). + ESC [ 1 J: erase from start to cursor. + ESC [ 2 J: erase whole display. +K EL Erase line (default: from cursor to end of line). + ESC [ 1 K: erase from start of line to cursor. + ESC [ 2 K: erase whole line. +L IL Insert the indicated # of blank lines. +M DL Delete the indicated # of lines. +P DCH Delete the indicated # of characters on the current line. +X ECH Erase the indicated # of characters on the current line. +a HPR Move cursor right the indicated # of columns. +c DA Answer ESC [ ? 6 c: "I am a VT102". +d VPA Move cursor to the indicated row, current column. +e VPR Move cursor down the indicated # of rows. +f HVP Move cursor to the indicated row, column. +g TBC Without parameter: clear tab stop at the current position. + ESC [ 3 g: delete all tab stops. +h SM Set Mode (see below). +l RM Reset Mode (see below). +m SGR Set attributes (see below). +n DSR Status report (see below). +q DECLL Set keyboard LEDs. + ESC [ 0 q: clear all LEDs + ESC [ 1 q: set Scroll Lock LED + ESC [ 2 q: set Num Lock LED + ESC [ 3 q: set Caps Lock LED +r DECSTBM Set scrolling region; parameters are top and bottom row. +s ? Save cursor location. +u ? Restore cursor location. +\` HPA Move cursor to indicated column in current row. +.TE +.PP +.B ECMA-48 Set Graphics Rendition +.sp +The ECMA-48 SGR sequence ESC [ \fIparameters\fP m sets display +attributes. +Several attributes can be set in the same sequence, separated by +semicolons. +An empty parameter (between semicolons or string initiator or +terminator) is interpreted as a zero. +.TS +l l. +param result +0 reset all attributes to their defaults +1 set bold +2 set half-bright (simulated with color on a color display) +4 T{ +set underscore (simulated with color on a color display) +(the colors used to simulate dim or underline are set +using ESC ] ...) +T} +5 set blink +7 set reverse video +10 T{ +reset selected mapping, display control flag, +and toggle meta flag (ECMA-48 says "primary font"). +T} +11 T{ +select null mapping, set display control flag, +reset toggle meta flag (ECMA-48 says "first alternate font"). +T} +12 T{ +select null mapping, set display control flag, +set toggle meta flag (ECMA-48 says "second alternate font"). +The toggle meta flag +causes the high bit of a byte to be toggled +before the mapping table translation is done. +T} +21 set normal intensity (ECMA-48 says "doubly underlined") +22 set normal intensity +24 underline off +25 blink off +27 reverse video off +30 set black foreground +31 set red foreground +32 set green foreground +33 set brown foreground +34 set blue foreground +35 set magenta foreground +36 set cyan foreground +37 set white foreground +38 set underscore on, set default foreground color +39 set underscore off, set default foreground color +40 set black background +41 set red background +42 set green background +43 set brown background +44 set blue background +45 set magenta background +46 set cyan background +47 set white background +49 set default background color +.TE +.PP +.B ECMA-48 Mode Switches +.TP +ESC [ 3 h +DECCRM (default off): Display control chars. +.TP +ESC [ 4 h +DECIM (default off): Set insert mode. +.TP +ESC [ 20 h +LF/NL (default off): Automatically follow echo of LF, VT or FF with CR. +.\" +.PP +.B ECMA-48 Status Report Commands +.\" +.TP +ESC [ 5 n +Device status report (DSR): Answer is ESC [ 0 n (Terminal OK). +.TP +ESC [ 6 n +Cursor position report (CPR): Answer is ESC [ \fIy\fP ; \fIx\fP R, +where \fIx,y\fP is the cursor location. +.\" +.PP +.B DEC Private Mode (DECSET/DECRST) sequences +.sp +.\" +These are not described in ECMA-48. +We list the Set Mode sequences; +the Reset Mode sequences are obtained by replacing the final \(aqh\(aq +by \(aql\(aq. +.TP +ESC [ ? 1 h +DECCKM (default off): When set, the cursor keys send an ESC O prefix, +rather than ESC [. +.TP +ESC [ ? 3 h +DECCOLM (default off = 80 columns): 80/132 col mode switch. +The driver sources note that this alone does not suffice; some user-mode +utility such as +.BR resizecons (8) +has to change the hardware registers on the console video card. +.TP +ESC [ ? 5 h +DECSCNM (default off): Set reverse-video mode. +.TP +ESC [ ? 6 h +DECOM (default off): When set, cursor addressing is relative to +the upper left corner of the scrolling region. +.TP +ESC [ ? 7 h +DECAWM (default on): Set autowrap on. +In this mode, a graphic +character emitted after column 80 (or column 132 of DECCOLM is on) +forces a wrap to the beginning of the following line first. +.TP +ESC [ ? 8 h +DECARM (default on): Set keyboard autorepeat on. +.TP +ESC [ ? 9 h +X10 Mouse Reporting (default off): Set reporting mode to 1 (or reset to +0) \(em see below. +.TP +ESC [ ? 25 h +DECTECM (default on): Make cursor visible. +.TP +ESC [ ? 1000 h +X11 Mouse Reporting (default off): Set reporting mode to 2 (or reset +to 0) \(em see below. +.\" +.PP +.B Linux Console Private CSI Sequences +.sp +.\" +The following sequences are neither ECMA-48 nor native VT102. +They are native to the Linux console driver. +Colors are in SGR parameters: +0 = black, 1 = red, 2 = green, 3 = brown, 4 = blue, 5 = magenta, 6 = +cyan, 7 = white. +.TS +l l. +ESC [ 1 ; \fIn\fP ] Set color \fIn\fP as the underline color +ESC [ 2 ; \fIn\fP ] Set color \fIn\fP as the dim color +ESC [ 8 ] Make the current color pair the default attributes. +ESC [ 9 ; \fIn\fP ] Set screen blank timeout to \fIn\fP minutes. +ESC [ 10 ; \fIn\fP ] Set bell frequency in Hz. +ESC [ 11 ; \fIn\fP ] Set bell duration in msec. +ESC [ 12 ; \fIn\fP ] Bring specified console to the front. +ESC [ 13 ] Unblank the screen. +ESC [ 14 ; \fIn\fP ] Set the VESA powerdown interval in minutes. +.TE +.SS "Character Sets" +The kernel knows about 4 translations of bytes into console-screen +symbols. +The four tables are: a) Latin1 \-> PC, +b) VT100 graphics \-> PC, c) PC \-> PC, d) user-defined. +.PP +There are two character sets, called G0 and G1, and one of them +is the current character set. +(Initially G0.) +Typing \fB^N\fP causes G1 to become current, +\fB^O\fP causes G0 to become current. +.PP +These variables G0 and G1 point at a translation table, and can be +changed by the user. +Initially they point at tables a) and b), respectively. +The sequences ESC ( B and ESC ( 0 and ESC ( U and ESC ( K cause G0 to +point at translation table a), b), c) and d), respectively. +The sequences ESC ) B and ESC ) 0 and ESC ) U and ESC ) K cause G1 to +point at translation table a), b), c) and d), respectively. +.PP +The sequence ESC c causes a terminal reset, which is what you want if the +screen is all garbled. +The oft-advised "echo ^V^O" will only make G0 current, +but there is no guarantee that G0 points at table a). +In some distributions there is a program +.BR reset (1) +that just does "echo ^[c". +If your terminfo entry for the console is correct +(and has an entry rs1=\\Ec), then "tput reset" will also work. +.PP +The user-defined mapping table can be set using +.BR mapscrn (8). +The result of the mapping is that if a symbol c is printed, the symbol +s = map[c] is sent to the video memory. +The bitmap that corresponds to +s is found in the character ROM, and can be changed using +.BR setfont (8). +.SS "Mouse Tracking" +The mouse tracking facility is intended to return +.BR xterm (1)-compatible +mouse status reports. +Because the console driver has no way to know +the device or type of the mouse, these reports are returned in the +console input stream only when the virtual terminal driver receives +a mouse update ioctl. +These ioctls must be generated by a mouse-aware +user-mode application such as the +.BR gpm (8) +daemon. +.PP +The mouse tracking escape sequences generated by +\fBxterm\fP(1) encode numeric parameters in a single character as +\fIvalue\fP+040. +For example, \(aq!\(aq is 1. +The screen coordinate system is 1-based. +.PP +The X10 compatibility mode sends an escape sequence on button press +encoding the location and the mouse button pressed. +It is enabled by sending ESC [ ? 9 h and disabled with ESC [ ? 9 l. +On button press, \fBxterm\fP(1) sends +ESC [ M \fIbxy\fP (6 characters). +Here \fIb\fP is button\-1, +and \fIx\fP and \fIy\fP are the x and y coordinates of the mouse +when the button was pressed. +This is the same code the kernel also produces. +.PP +Normal tracking mode (not implemented in Linux 2.0.24) sends an escape +sequence on both button press and release. +Modifier information is also sent. +It is enabled by sending ESC [ ? 1000 h and disabled with +ESC [ ? 1000 l. +On button press or release, \fBxterm\fP(1) sends ESC [ M +\fIbxy\fP. +The low two bits of \fIb\fP encode button information: +0=MB1 pressed, 1=MB2 pressed, 2=MB3 pressed, 3=release. +The upper bits encode what modifiers were down when the button was +pressed and are added together: 4=Shift, 8=Meta, 16=Control. +Again \fIx\fP and +\fIy\fP are the x and y coordinates of the mouse event. +The upper left corner is (1,1). +.SS "Comparisons With Other Terminals" +Many different terminal types are described, like the Linux console, +as being "VT100-compatible". +Here we discuss differences between the +Linux console and the two most important others, the DEC VT102 and +.BR xterm (1). +.\" +.PP +.B Control-character handling +.sp +The VT102 also recognized the following control characters: +.HP +NUL (0x00) was ignored; +.HP +ENQ (0x05) triggered an answerback message; +.HP +DC1 (0x11, \fB^Q\fP, XON) resumed transmission; +.HP +DC3 (0x13, \fB^S\fP, XOFF) caused VT100 to ignore (and stop transmitting) +all codes except XOFF and XON. +.LP +VT100-like DC1/DC3 processing may be enabled by the tty driver. +.LP +The +.BR xterm (1) +program (in VT100 mode) recognizes the control characters +BEL, BS, HT, LF, VT, FF, CR, SO, SI, ESC. +.\" +.PP +.B Escape sequences +.sp +VT100 console sequences not implemented on the Linux console: +.TS +l l l. +ESC N SS2 Single shift 2. (Select G2 character set for the next + character only.) +ESC O SS3 Single shift 3. (Select G3 character set for the next + character only.) +ESC P DCS Device control string (ended by ESC \\) +ESC X SOS Start of string. +ESC ^ PM Privacy message (ended by ESC \\) +ESC \\ ST String terminator +ESC * ... Designate G2 character set +ESC + ... Designate G3 character set +.TE +.PP +The program +.BR xterm (1) +(in VT100 mode) recognizes ESC c, ESC # 8, ESC >, ESC =, +ESC D, ESC E, ESC H, ESC M, ESC N, ESC O, ESC P ... ESC \\, +ESC Z (it answers ESC [ ? 1 ; 2 c, "I am a VT100 with +advanced video option") +and ESC ^ ... ESC \\ with the same meanings as indicated above. +It accepts ESC (, ESC ), ESC *, ESC + followed by 0, A, B for +the DEC special character and line drawing set, UK, and US-ASCII, +respectively. +.PP +The user can configure \fBxterm\fP(1) to respond to VT220-specific +control sequences, and it will identify itself as a VT52, VT100, and +up depending on the way it is configured and initialized. +.PP +It accepts ESC ] (OSC) for the setting of certain resources. +In addition to the ECMA-48 string terminator (ST), +\fBxterm\fP(1) accepts a BEL to terminate an OSC string. +These are a few of the OSC control sequences recognized by \fBxterm\fP(1): +.TS +l l. +ESC ] 0 ; \fItxt\fP ST Set icon name and window title to \fItxt\fP. +ESC ] 1 ; \fItxt\fP ST Set icon name to \fItxt\fP. +ESC ] 2 ; \fItxt\fP ST Set window title to \fItxt\fP. +ESC ] 4 ; \fInum\fP; \fItxt\fP ST Set ANSI color \fInum\fP to \fItxt\fP. +ESC ] 10 ; \fItxt\fP ST Set dynamic text color to \fItxt\fP. +ESC ] 4 6 ; \fIname\fP ST Change log file to \fIname\fP (normally disabled + by a compile-time option) +ESC ] 5 0 ; \fIfn\fP ST Set font to \fIfn\fP. +.TE +.PP +It recognizes the following with slightly modified meaning +(saving more state, behaving closer to VT100/VT220): +.TS +l l l. +ESC 7 DECSC Save cursor +ESC 8 DECRC Restore cursor +.TE +.PP +It also recognizes +.TS +l l l. +ESC F Cursor to lower left corner of screen (if enabled by + \fBxterm\fP(1)'s \fBhpLowerleftBugCompat\fP resource) +ESC l Memory lock (per HP terminals). + Locks memory above the cursor. +ESC m Memory unlock (per HP terminals). +ESC n LS2 Invoke the G2 character set. +ESC o LS3 Invoke the G3 character set. +ESC | LS3R Invoke the G3 character set as GR. +ESC } LS2R Invoke the G2 character set as GR. +ESC ~ LS1R Invoke the G1 character set as GR. +.TE +.PP +It also recognizes ESC % and provides a more complete UTF-8 +implementation than Linux console. +.\" +.PP +.B CSI Sequences +.sp +Old versions of \fBxterm\fP(1), for example, from X11R5, +interpret the blink SGR as a bold SGR. +Later versions which implemented ANSI colors, for example, +XFree86 3.1.2A in 1995, improved this by allowing +the blink attribute to be displayed as a color. +Modern versions of xterm implement blink SGR as blinking text +and still allow colored text as an alternate rendering of SGRs. +Stock X11R6 versions did not recognize the color-setting SGRs until +the X11R6.8 release, which incorporated XFree86 xterm. +All ECMA-48 CSI sequences recognized by Linux are also recognized by +.IR xterm , +however \fBxterm\fP(1) implements several ECMA-48 and DEC control sequences +not recognized by Linux. +.PP +The \fBxterm\fP(1) +program recognizes all of the DEC Private Mode sequences listed +above, but none of the Linux private-mode sequences. +For discussion of \fBxterm\fP(1)'s +own private-mode sequences, refer to the +\fIXterm Control Sequences\fP +document by +Edward Moy, +Stephen Gildea, +and Thomas E. Dickey +available with the X distribution. +That document, though terse, is much longer than this manual page. +For a chronological overview, +.PP +.in +4n +http://invisible-island.net/xterm/xterm.log.html +.in +.PP +details changes to xterm. +.PP +The \fIvttest\fP program +.PP +.in +4n +http://invisible-island.net/vttest/ +.in +.PP +demonstrates many of these control sequences. +The \fBxterm\fP(1) source distribution also contains sample +scripts which exercise other features. +.SH NOTES +ESC 8 (DECRC) is not able to restore the character set changed with +ESC %. +.SH BUGS +In 2.0.23, CSI is broken, and NUL is not ignored inside +escape sequences. +.PP +Some older kernel versions (after 2.0) interpret 8-bit control +sequences. +These "C1 controls" use codes between 128 and 159 to replace +ESC [, ESC ] and similar two-byte control sequence initiators. +There are fragments of that in modern kernels (either overlooked or +broken by changes to support UTF-8), +but the implementation is incomplete and should be regarded +as unreliable. +.PP +Linux "private mode" sequences do not follow the rules in ECMA-48 +for private mode control sequences. +In particular, those ending with ] do not use a standard terminating +character. +The OSC (set palette) sequence is a greater problem, +since \fBxterm\fP(1) may interpret this as a control sequence +which requires a string terminator (ST). +Unlike the \fBsetterm\fP(1) sequences which will be ignored (since +they are invalid control sequences), the palette sequence will make +\fBxterm\fP(1) appear to hang (though pressing the return-key +will fix that). +To accommodate applications which have been hardcoded to use Linux +control sequences, +set the \fBxterm\fP(1) resource \fBbrokenLinuxOSC\fP to true. +.PP +An older version of this document implied that Linux recognizes the +ECMA-48 control sequence for invisible text. +It is ignored. +.SH "SEE ALSO" +.BR console (4), +.BR console_ioctl (4), +.BR charsets (7) diff --git a/original/man4/console_ioctl.4 b/original/man4/console_ioctl.4 new file mode 100644 index 00000000..7e438aaf --- /dev/null +++ b/original/man4/console_ioctl.4 @@ -0,0 +1,638 @@ +.\" Copyright (c) 1995 Jim Van Zandt and aeb +.\" Sun Feb 26 11:46:23 MET 1995 +.\" +.\" 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, Sun Feb 26 15:04:20 1995, faith@cs.unc.edu +.\" Modified, Thu Apr 20 22:08:17 1995, jrv@vanzandt.mv.com +.\" Modified, Mon Sep 18 22:32:47 1995, hpa@storm.net (H. Peter Anvin) +.\" FIXME The following are not documented: +.\" KDFONTOP (since 2.1.111) +.\" KDGKBDIACRUC (since 2.6.24) +.\" KDSKBDIACR +.\" KDSKBDIACRUC (since 2.6.24) +.\" KDKBDREP (since 2.1.113) +.\" KDMAPDISP (not implemented as at 2.6.27) +.\" KDUNMAPDISP (not implemented as at 2.6.27) +.\" VT_LOCKSWITCH (since 1.3.47, needs CAP_SYS_TTY_CONFIG) +.\" VT_UNLOCKSWITCH (since 1.3.47, needs CAP_SYS_TTY_CONFIG) +.\" VT_GETHIFONTMASK (since 2.6.18) +.\" +.TH CONSOLE_IOCTL 4 2009-02-28 "Linux" "Linux Programmer's Manual" +.SH NAME +console_ioctl \- ioctl's for console terminal and virtual consoles +.SH DESCRIPTION +The following Linux-specific +.BR ioctl (2) +requests are supported. +Each requires a third argument, assumed here to be \fIargp\fP. +.IP \fBKDGETLED\fP +Get state of LEDs. +\fIargp\fP points to a \fIchar\fP. +The lower three bits +of \fI*argp\fP are set to the state of the LEDs, as follows: + + LED_CAP 0x04 caps lock led + LEC_NUM 0x02 num lock led + LED_SCR 0x01 scroll lock led +.IP \fBKDSETLED\fP +Set the LEDs. +The LEDs are set to correspond to the lower three bits of +\fIargp\fP. +However, if a higher order bit is set, +the LEDs revert to normal: displaying the state of the +keyboard functions of caps lock, num lock, and scroll lock. +.LP +Before 1.1.54, the LEDs just reflected the state of the corresponding +keyboard flags, and KDGETLED/KDSETLED would also change the keyboard +flags. +Since 1.1.54 the leds can be made to display arbitrary +information, but by default they display the keyboard flags. +The following two ioctl's are used to access the keyboard flags. +.IP \fBKDGKBLED\fP +Get keyboard flags CapsLock, NumLock, ScrollLock (not lights). +\fIargp\fP points to a char which is set to the flag state. +The low order three bits (mask 0x7) get the current flag state, +and the low order bits of the next nibble (mask 0x70) get +the default flag state. +(Since 1.1.54.) +.IP \fBKDSKBLED\fP +Set keyboard flags CapsLock, NumLock, ScrollLock (not lights). +\fIargp\fP has the desired flag state. +The low order three bits (mask 0x7) have the flag state, +and the low order bits of the next nibble (mask 0x70) have +the default flag state. +(Since 1.1.54.) +.IP \fBKDGKBTYPE\fP +Get keyboard type. +This returns the value KB_101, defined as 0x02. +.IP \fBKDADDIO\fP +Add I/O port as valid. +Equivalent to \fIioperm(arg,1,1)\fP. +.IP \fBKDDELIO\fP +Delete I/O port as valid. +Equivalent to \fIioperm(arg,1,0)\fP. +.IP \fBKDENABIO\fP +Enable I/O to video board. +Equivalent to \fIioperm(0x3b4, 0x3df-0x3b4+1, 1)\fP. +.IP \fBKDDISABIO\fP +Disable I/O to video board. +Equivalent to \fIioperm(0x3b4, 0x3df-0x3b4+1, 0)\fP. +.IP \fBKDSETMODE\fP +Set text/graphics mode. +\fIargp\fP is one of these: + + KD_TEXT 0x00 + KD_GRAPHICS 0x01 +.IP \fBKDGETMODE\fP +Get text/graphics mode. +\fIargp\fP points to a \fIlong\fP which is set to one +of the above values. +.IP \fBKDMKTONE\fP +Generate tone of specified length. +The lower 16 bits of \fIargp\fP specify the period in clock cycles, +and the upper 16 bits give the duration in msec. +If the duration is zero, the sound is turned off. +Control returns immediately. +For example, \fIargp\fP = (125<<16) + 0x637 would specify +the beep normally associated with a ctrl-G. +(Thus since 0.99pl1; broken in 2.1.49-50.) +.IP \fBKIOCSOUND\fP +Start or stop sound generation. +The lower 16 bits of +\fIargp\fP specify the period in clock cycles +(that is, \fIargp\fP = 1193180/frequency). +\fIargp\fP = 0 turns sound off. +In either case, control returns immediately. +.IP \fBGIO_CMAP\fP +Get the current default color map from kernel. +\fIargp\fP points to +a 48-byte array. +(Since 1.3.3.) +.IP \fBPIO_CMAP\fP +Change the default text-mode color map. +\fIargp\fP points to a +48-byte array which contains, in order, the Red, Green, and Blue +values for the 16 available screen colors: 0 is off, and 255 is full +intensity. +The default colors are, in order: black, dark red, dark +green, brown, dark blue, dark purple, dark cyan, light grey, dark +grey, bright red, bright green, yellow, bright blue, bright purple, +bright cyan and white. +(Since 1.3.3.) +.IP \fBGIO_FONT\fP +Gets 256-character screen font in expanded form. +\fIargp\fP points to an 8192 byte array. +Fails with error code \fBEINVAL\fP if the +currently loaded font is a 512-character font, or if the console is +not in text mode. +.IP \fBGIO_FONTX\fP +Gets screen font and associated information. +\fIargp\fP points to a +\fIstruct consolefontdesc\fP (see \fBPIO_FONTX\fP). +On call, the +\fIcharcount\fP field should be set to the maximum number of +characters that would fit in the buffer pointed to by \fIchardata\fP. +On return, the \fIcharcount\fP and \fIcharheight\fP are filled with +the respective data for the currently loaded font, and the +\fIchardata\fP array contains the font data if the initial value of +\fIcharcount\fP indicated enough space was available; otherwise the +buffer is untouched and \fIerrno\fP is set to \fBENOMEM\fP. +(Since 1.3.1.) +.IP \fBPIO_FONT\fP +Sets 256-character screen font. +Load font into the EGA/VGA character +generator. +\fIargp\fP points to a 8192 byte map, with 32 bytes per +character. +Only first \fIN\fP of them are used for an 8x\fIN\fP font +(0 < \fIN\fP <= 32). +This call also invalidates the Unicode mapping. +.IP \fBPIO_FONTX\fP +Sets screen font and associated rendering information. +\fIargp\fP +points to a + +.in +4n +.nf +struct consolefontdesc { + unsigned short charcount; /* characters in font + (256 or 512) */ + unsigned short charheight; /* scan lines per + character (1-32) */ + char *chardata; /* font data in + expanded form */ +}; +.fi +.in + +If necessary, the screen will be appropriately resized, and +\fBSIGWINCH\fP sent to the appropriate processes. +This call also invalidates the Unicode mapping. +(Since 1.3.1.) +.IP \fBPIO_FONTRESET\fP +Resets the screen font, size and Unicode mapping to the bootup +defaults. +\fIargp\fP is unused, but should be set to NULL to +ensure compatibility with future versions of Linux. +(Since 1.3.28.) +.IP \fBGIO_SCRNMAP\fP +Get screen mapping from kernel. +\fIargp\fP points to an area of size +E_TABSZ, which is loaded with the font positions used to display each +character. +This call is likely to return useless information if the +currently loaded font is more than 256 characters. +.IP \fBGIO_UNISCRNMAP\fP +Get full Unicode screen mapping from kernel. +\fIargp\fP points to an +area of size E_TABSZ*sizeof(unsigned short), which is loaded with the +Unicodes each character represent. +A special set of Unicodes, +starting at U+F000, are used to represent "direct to font" mappings. +(Since 1.3.1.) +.IP \fBPIO_SCRNMAP\fP +Loads the "user definable" (fourth) table in the kernel which maps +bytes into console screen symbols. +\fIargp\fP points to an area of +size E_TABSZ. +.IP \fBPIO_UNISCRNMAP\fP +Loads the "user definable" (fourth) table in the kernel which maps +bytes into Unicodes, which are then translated into screen symbols +according to the currently loaded Unicode-to-font map. +Special Unicodes starting at U+F000 can be used to map directly to the font +symbols. +(Since 1.3.1.) +.IP \fBGIO_UNIMAP\fP +Get Unicode-to-font mapping from kernel. +\fIargp\fP points to a + +.in +4n +.nf +struct unimapdesc { + unsigned short entry_ct; + struct unipair *entries; +}; +.fi +.in + +where \fIentries\fP points to an array of + +.in +4n +.nf +struct unipair { + unsigned short unicode; + unsigned short fontpos; +}; +.fi +.in + +(Since 1.1.92.) +.IP \fBPIO_UNIMAP\fP +Put unicode-to-font mapping in kernel. + \fIargp\fP points to a +\fIstruct unimapdesc\fP. +(Since 1.1.92) +.IP \fBPIO_UNIMAPCLR\fP +Clear table, possibly advise hash algorithm. +\fIargp\fP points to a + +.in +4n +.nf +struct unimapinit { + unsigned short advised_hashsize; /* 0 if no opinion */ + unsigned short advised_hashstep; /* 0 if no opinion */ + unsigned short advised_hashlevel; /* 0 if no opinion */ +}; +.fi +.in + +(Since 1.1.92.) +.IP \fBKDGKBMODE\fP +Gets current keyboard mode. +\fIargp\fP points to a \fIlong\fP which is set to one +of these: + + K_RAW 0x00 + K_XLATE 0x01 + K_MEDIUMRAW 0x02 + K_UNICODE 0x03 +.IP \fBKDSKBMODE\fP +Sets current keyboard mode. +\fIargp\fP is a \fIlong\fP equal to one of the above values. +.IP \fBKDGKBMETA\fP +Gets meta key handling mode. +\fIargp\fP points to a \fIlong\fP which is +set to one of these: + + K_METABIT 0x03 set high order bit + K_ESCPREFIX 0x04 escape prefix +.IP \fBKDSKBMETA\fP +Sets meta key handling mode. +\fIargp\fP is a \fIlong\fP equal to one of the above values. +.IP \fBKDGKBENT\fP +Gets one entry in key translation table (keycode to action code). +\fIargp\fP points to a + +.in +4n +.nf +struct kbentry { + unsigned char kb_table; + unsigned char kb_index; + unsigned short kb_value; +}; +.fi +.in + +with the first two members filled in: +\fIkb_table\fP selects the key table (0 <= \fIkb_table\fP < MAX_NR_KEYMAPS), +and \fIkb_index\fP is the keycode (0 <= \fIkb_index\fP < NR_KEYS). +\fIkb_value\fP is set to the corresponding action code, +or K_HOLE if there is no such key, +or K_NOSUCHMAP if \fIkb_table\fP is invalid. +.IP \fBKDSKBENT\fP +Sets one entry in translation table. +\fIargp\fP points to +a \fIstruct kbentry\fP. +.IP \fBKDGKBSENT\fP +Gets one function key string. +\fIargp\fP points to a + +.in +4n +.nf +struct kbsentry { + unsigned char kb_func; + unsigned char kb_string[512]; +}; +.fi +.in + +\fIkb_string\fP is set to the (null-terminated) string corresponding to +the \fIkb_func\fPth function key action code. +.IP \fBKDSKBSENT\fP +Sets one function key string entry. +\fIargp\fP points to +a \fIstruct kbsentry\fP. +.IP \fBKDGKBDIACR\fP +Read kernel accent table. +\fIargp\fP points to a + +.in +4n +.nf +struct kbdiacrs { + unsigned int kb_cnt; + struct kbdiacr kbdiacr[256]; +}; +.fi +.in + +where \fIkb_cnt\fP is the number of entries in the array, each of which +is a + +.in +4n +.nf +struct kbdiacr { + unsigned char diacr; + unsigned char base; + unsigned char result; +}; +.fi +.in +.IP \fBKDGETKEYCODE\fP +Read kernel keycode table entry (scan code to keycode). +\fIargp\fP points to a + +.in +4n +.nf +struct kbkeycode { + unsigned int scancode; + unsigned int keycode; +}; +.fi +.in + +\fIkeycode\fP is set to correspond to the given \fIscancode\fP. +(89 <= \fIscancode\fP <= 255 only. +For 1 <= \fIscancode\fP <= 88, \fIkeycode\fP==\fIscancode\fP.) +(Since 1.1.63.) +.IP \fBKDSETKEYCODE\fP +Write kernel keycode table entry. +\fIargp\fP points to +a \fIstruct kbkeycode\fP. +(Since 1.1.63.) +.IP \fBKDSIGACCEPT\fP +The calling process indicates its willingness to accept the signal +\fIargp\fP when it is generated by pressing an appropriate key combination. +(1 <= \fIargp\fP <= NSIG). +(See spawn_console() in linux/drivers/char/keyboard.c.) +.IP \fBVT_OPENQRY\fP +Returns the first available (non-opened) console. +\fIargp\fP points to an \fIint\fP which is set to the +number of the vt (1 <= \fI*argp\fP <= MAX_NR_CONSOLES). +.IP \fBVT_GETMODE\fP +Get mode of active vt. +\fIargp\fP points to a + +.in +4n +.nf +struct vt_mode { + char mode; /* vt mode */ + char waitv; /* if set, hang on writes if not active */ + short relsig; /* signal to raise on release req */ + short acqsig; /* signal to raise on acquisition */ + short frsig; /* unused (set to 0) */ +}; +.fi +.in + +which is set to the mode of the active vt. +\fImode\fP is set to one of these values: + + VT_AUTO auto vt switching + VT_PROCESS process controls switching + VT_ACKACQ acknowledge switch +.IP \fBVT_SETMODE\fP +Set mode of active vt. +\fIargp\fP points to +a \fIstruct vt_mode\fP. +.IP \fBVT_GETSTATE\fP +Get global vt state info. +\fIargp\fP points to a + +.in +4n +.nf +struct vt_stat { + unsigned short v_active; /* active vt */ + unsigned short v_signal; /* signal to send */ + unsigned short v_state; /* vt bit mask */ +}; +.fi +.in + +For each vt in use, the corresponding bit in the \fIv_state\fP member is set. +(Kernels 1.0 through 1.1.92.) +.IP \fBVT_RELDISP\fP +Release a display. +.IP \fBVT_ACTIVATE\fP +Switch to vt \fIargp\fP (1 <= \fIargp\fP <= MAX_NR_CONSOLES). +.IP \fBVT_WAITACTIVE\fP +Wait until vt \fIargp\fP has been activated. +.IP \fBVT_DISALLOCATE\fP +Deallocate the memory associated with vt \fIargp\fP. +(Since 1.1.54.) +.IP \fBVT_RESIZE\fP +Set the kernel's idea of screensize. +\fIargp\fP points to a + +.in +4n +.nf +struct vt_sizes { + unsigned short v_rows; /* # rows */ + unsigned short v_cols; /* # columns */ + unsigned short v_scrollsize; /* no longer used */ +}; +.fi +.in + +Note that this does not change the videomode. +See +.BR resizecons (8). +(Since 1.1.54.) +.IP \fBVT_RESIZEX\fP +Set the kernel's idea of various screen parameters. +\fIargp\fP points to a + +.in +4n +.nf +struct vt_consize { + unsigned short v_rows; /* number of rows */ + unsigned short v_cols; /* number of columns */ + unsigned short v_vlin; /* number of pixel rows + on screen */ + unsigned short v_clin; /* number of pixel rows + per character */ + unsigned short v_vcol; /* number of pixel columns + on screen */ + unsigned short v_ccol; /* number of pixel columns + per character */ +}; +.fi +.in + +Any parameter may be set to zero, indicating "no change", but if +multiple parameters are set, they must be self-consistent. +Note that this does not change the videomode. +See +.BR resizecons (8). +(Since 1.3.3.) +.PP +The action of the following ioctls depends on the first byte in the struct +pointed to by \fIargp\fP, referred to here as the \fIsubcode\fP. +These are legal only for the superuser or the owner of the current tty. +.IP "\fBTIOCLINUX, subcode=0\fP" +Dump the screen. +Disappeared in 1.1.92. (With kernel 1.1.92 or later, read from +/dev/vcsN or /dev/vcsaN instead.) +.IP "\fBTIOCLINUX, subcode=1\fP" +Get task information. +Disappeared in 1.1.92. +.IP "\fBTIOCLINUX, subcode=2\fP" +Set selection. +\fIargp\fP points to a +.in +4n +.nf + +struct { + char subcode; + short xs, ys, xe, ye; + short sel_mode; +}; + +.fi +.in +\fIxs\fP and \fIys\fP are the starting column and row. +\fIxe\fP and \fIye\fP are the ending +column and row. +(Upper left corner is row=column=1.) +\fIsel_mode\fP is 0 for character-by-character selection, +1 for word-by-word selection, +or 2 for line-by-line selection. +The indicated screen characters are highlighted and saved +in the static array sel_buffer in devices/char/console.c. +.IP "\fBTIOCLINUX, subcode=3\fP" +Paste selection. +The characters in the selection buffer are +written to \fIfd\fP. +.IP "\fBTIOCLINUX, subcode=4\fP" +Unblank the screen. +.IP "\fBTIOCLINUX, subcode=5\fP" +Sets contents of a 256-bit look up table defining characters in a "word", +for word-by-word selection. +(Since 1.1.32.) +.IP "\fBTIOCLINUX, subcode=6\fP" +\fIargp\fP points to a char which is set to the value of the kernel +variable \fIshift_state\fP. +(Since 1.1.32.) +.IP "\fBTIOCLINUX, subcode=7\fP" +\fIargp\fP points to a char which is set to the value of the kernel +variable \fIreport_mouse\fP. +(Since 1.1.33.) +.IP "\fBTIOCLINUX, subcode=8\fP" +Dump screen width and height, cursor position, and all the +character-attribute pairs. +(Kernels 1.1.67 through 1.1.91 only. +With kernel 1.1.92 or later, read from /dev/vcsa* instead.) +.IP "\fBTIOCLINUX, subcode=9\fP" +Restore screen width and height, cursor position, and all the +character-attribute pairs. +(Kernels 1.1.67 through 1.1.91 only. +With kernel 1.1.92 or later, write to /dev/vcsa* instead.) +.IP "\fBTIOCLINUX, subcode=10\fP" +Handles the Power Saving +feature of the new generation of monitors. +VESA screen blanking mode is set to \fIargp\fP[1], which governs what +screen blanking does: + + \fI0\fP: Screen blanking is disabled. + + \fI1\fP: The current video adapter +register settings are saved, then the controller is programmed to turn off +the vertical synchronization pulses. +This puts the monitor into "standby" mode. +If your monitor has an Off_Mode timer, then +it will eventually power down by itself. + + \fI2\fP: The current +settings are saved, then both the vertical and horizontal +synchronization pulses are turned off. +This puts the monitor into "off" mode. +If your monitor has no Off_Mode timer, +or if you want your monitor to power down immediately when the +blank_timer times out, then you choose this option. +(\fICaution:\fP Powering down frequently will damage the monitor.) + +(Since 1.1.76.) +.SH "RETURN VALUE" +On success, 0 is returned. +On error \-1 is returned, and \fIerrno\fP is set. +.SH ERRORS +\fIerrno\fP may take on these values: +.TP +.B EBADF +The file descriptor is invalid. +.TP +.B ENOTTY +The file descriptor is not associated with a character special device, +or the specified request does not apply to it. +.TP +.B EINVAL +The file descriptor or \fIargp\fP is invalid. +.TP +.B EPERM +Insufficient permission. +.SH NOTES +.BR Warning : +Do not regard this man page as documentation of the Linux console ioctl's. +This is provided for the curious only, as an alternative to reading the +source. +Ioctl's are undocumented Linux internals, liable to be changed +without warning. +(And indeed, this page more or less describes the +situation as of kernel version 1.1.94; +there are many minor and not-so-minor +differences with earlier versions.) + +Very often, ioctl's are introduced for communication between the +kernel and one particular well-known program (fdisk, hdparm, setserial, +tunelp, loadkeys, selection, setfont, etc.), and their behavior will be +changed when required by this particular program. + +Programs using these ioctl's will not be portable to other versions +of Unix, will not work on older versions of Linux, and will not work +on future versions of Linux. + +Use POSIX functions. +.SH "SEE ALSO" +.BR dumpkeys (1), +.BR kbd_mode (1), +.BR loadkeys (1), +.BR mknod (1), +.BR setleds (1), +.BR setmetamode (1), +.BR execve (2), +.BR fcntl (2), +.BR ioperm (2), +.BR termios (3), +.BR console (4), +.BR console_codes (4), +.BR mt (4), +.BR sd (4), +.BR tty (4), +.BR tty_ioctl (4), +.BR ttyS (4), +.BR vcs (4), +.BR vcsa (4), +.BR charsets (7), +.BR mapscrn (8), +.BR resizecons (8), +.BR setfont (8), +.IR /usr/include/linux/kd.h , +.I /usr/include/linux/vt.h diff --git a/original/man4/cpuid.4 b/original/man4/cpuid.4 new file mode 100644 index 00000000..4cdc3e5f --- /dev/null +++ b/original/man4/cpuid.4 @@ -0,0 +1,93 @@ +.\" 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. +.\" +.TH CPUID 4 2009-03-31 "Linux" "Linux Programmer's Manual" +.SH NAME +cpuid \- x86 CPUID access device +.SH DESCRIPTION +CPUID provides an interface for querying information about the x86 CPU. + +This device is accessed by +.B lseek (2) +or +.B pread (2) +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 +.IR %eax , +and the upper 32 bits of the file position as the incoming +.IR %ecx , +the latter intended for "counting" +.I eax +levels like +.IR eax=4 . + +This driver uses +.IR /dev/cpu/CPUNUM/cpuid , +where +.I CPUNUM +is the minor number, +and on an SMP box will direct the access to CPU +.I CPUNUM +as listed in +.IR /proc/cpuinfo . + +This file is protected so that it can only be read by the user +.IR root , +or members of the group +.IR root . +.SH NOTES +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 +.I cpuid +is reported by the kernel in cooked form either in +.I /proc/cpuinfo +or through subdirectories in +.IR /sys/devices/system/cpu . +Direct CPUID access through this device should only +be used in exceptional cases. + +The +.I cpuid +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 SEE ALSO +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/original/man4/dsp56k.4 b/original/man4/dsp56k.4 new file mode 100644 index 00000000..0ecd71d2 --- /dev/null +++ b/original/man4/dsp56k.4 @@ -0,0 +1,118 @@ +'\" t +.\" Copyright (c) 2000 lars brinkhoff +.\" +.\" 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, Thu Jan 27 19:16:19 CET 2000, lars@nocrew.org +.\" +.TH DSP56K 4 2000-03-01 "Linux" "Linux Programmer's Manual" +.SH NAME +dsp56k \- DSP56001 interface device +.SH SYNOPSIS +.nf +#include +.sp +.BI "ssize_t read(int " fd ", void *" data ", size_t " length ); +.BI "ssize_t write(int " fd ", void *" data ", size_t " length ); + +.BI "int ioctl(int " fd ", DSP56K_UPLOAD, struct dsp56k_upload *" program ); +.BI "int ioctl(int " fd ", DSP56K_SET_TX_WSIZE, int " wsize ); +.BI "int ioctl(int " fd ", DSP56K_SET_RX_WSIZE, int " wsize ); +.BI "int ioctl(int " fd ", DSP56K_HOST_FLAGS, struct dsp56k_host_flags *" flags ); +.BI "int ioctl(int " fd ", DSP56K_HOST_CMD, int " cmd ); +.fi +.SH CONFIGURATION +The dsp56k device is a character device with major number 55 and minor +number 0. +.SH DESCRIPTION +The Motorola DSP56001 is a fully programmable 24-bit digital signal +processor found in Atari Falcon030-compatible computers. +The \fIdsp56k\fP special file is used to control the DSP56001, and +to send and receive data using the bidirectional handshaked host +port. +.PP +To send a data stream to the signal processor, use +.BR write (2) +to the +device, and +.BR read (2) +to receive processed data. +The data can be sent or +received in 8, 16, 24, or 32-bit quantities on the host side, but will +always be seen as 24-bit quantities in the DSP56001. +.PP +The following +.BR ioctl (2) +calls are used to control the +\fIdsp56k\fP device: +.IP \fBDSP56K_UPLOAD\fP +resets the DSP56001 and uploads a program. +The third +.BR ioctl (2) +argument must be a pointer to a \fIstruct dsp56k_binary\fP with members +\fIbin\fP pointing to a DSP56001 binary program, and \fIlen\fP set to +the length of the program, counted in 24-bit words. +.IP \fBDSP56K_SET_TX_WSIZE\fP +sets the transmit word size. +Allowed values are in the range 1 to 4, +and is the number of bytes that will be sent at a time to the +DSP56001. +These data quantities will either be padded with zero +bytes, or truncated to fit the native 24-bit data format of the +DSP56001. +.IP \fBDSP56K_SET_RX_WSIZE\fP +sets the receive word size. +Allowed values are in the range 1 to 4, +and is the number of bytes that will be received at a time from the +DSP56001. +These data quantities will either truncated, or padded with +a null byte (\(aq\\0\(aq) to fit the native 24-bit data format of the DSP56001. +.IP \fBDSP56K_HOST_FLAGS\fP +read and write the host flags. +The host flags are four +general-purpose bits that can be read by both the hosting computer and +the DSP56001. +Bits 0 and 1 can be written by the host, and bits 2 and +3 can be written by the DSP56001. + +To access the host flags, the third +.BR ioctl (2) +argument must be a pointer +to a \fIstruct dsp56k_host_flags\fP. +If bit 0 or 1 is set in the +\fIdir\fP member, the corresponding bit in \fIout\fP will be written +to the host flags. +The state of all host flags will be returned in +the lower four bits of the \fIstatus\fP member. +.IP \fBDSP56K_HOST_CMD\fP +sends a host command. +Allowed values are in the range 0 to 31, and is a +user-defined command handled by the program running in the DSP56001. +.SH FILES +/dev/dsp56k +.\" .SH AUTHORS +.\" Fredrik Noring , lars brinkhoff , +.\" Tomas Berndtsson . +.SH "SEE ALSO" +.IR linux/include/asm-m68k/dsp56k.h , +.IR linux/drivers/char/dsp56k.c , +.IR http://dsp56k.nocrew.org/ , +DSP56000/DSP56001 Digital Signal Processor User's Manual diff --git a/original/man4/epoll.4 b/original/man4/epoll.4 new file mode 100644 index 00000000..3032ccf5 --- /dev/null +++ b/original/man4/epoll.4 @@ -0,0 +1,2 @@ +.so man7/epoll.7 +.\" FIXME . this link will eventually be removed (created Apr 2006) diff --git a/original/man4/fd.4 b/original/man4/fd.4 new file mode 100644 index 00000000..734c40c9 --- /dev/null +++ b/original/man4/fd.4 @@ -0,0 +1,215 @@ +'\" t +.\" Copyright (c) 1993 Michael Haardt (michael@cantor.informatik.rwth-aachen.de) +.\" and 1994,1995 Alain Knaff (Alain.Knaff@imag.fr) +.\" +.\" 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, Sun Feb 26 15:00:02 1995, faith@cs.unc.edu +.\" +.TH FD 4 1995-01-29 "Linux" "Linux Programmer's Manual" +.SH NAME +fd \- floppy disk device +.SH CONFIGURATION +Floppy drives are block devices with major number 2. +Typically they +are owned by root.floppy (i.e., user root, group floppy) and have +either mode 0660 (access checking via group membership) or mode 0666 +(everybody has access). +The minor +numbers encode the device type, drive number, and controller number. +For each device type (that is, combination of density and track count) +there is a base minor number. +To this base number, add the drive's +number on its controller and 128 if the drive is on the secondary +controller. +In the following device tables, \fIn\fP represents the +drive number. +.PP +\fBWarning: If you use formats with more tracks +than supported by your drive, you may cause it mechanical damage.\fP +Trying once if more tracks than the usual 40/80 are supported should not +damage it, but no warranty is given for that. +Don't create device +entries for those formats to prevent their usage if you are not sure. +.PP +Drive independent device files which automatically detect the media +format and capacity: +.TS +l l. +Name Base minor # +_ +\fBfd\fP\fIn\fP 0 +.TE +.PP +5.25 inch double density device files: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBd360\fP 360K 40 9 2 4 +.TE +.PP +5.25 inch high density device files: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBh360\fP 360K 40 9 2 20 +\fBfd\fP\fIn\fP\fBh410\fP 410K 41 10 2 48 +\fBfd\fP\fIn\fP\fBh420\fP 420K 42 10 2 64 +\fBfd\fP\fIn\fP\fBh720\fP 720K 80 9 2 24 +\fBfd\fP\fIn\fP\fBh880\fP 880K 80 11 2 80 +\fBfd\fP\fIn\fP\fBh1200\fP 1200K 80 15 2 8 +\fBfd\fP\fIn\fP\fBh1440\fP 1440K 80 18 2 40 +\fBfd\fP\fIn\fP\fBh1476\fP 1476K 82 18 2 56 +\fBfd\fP\fIn\fP\fBh1494\fP 1494K 83 18 2 72 +\fBfd\fP\fIn\fP\fBh1600\fP 1600K 80 20 2 92 +.TE +.PP +3.5 inch double density device files: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBD360\fP 360K 80 9 1 12 +\fBfd\fP\fIn\fP\fBD720\fP 720K 80 9 2 16 +\fBfd\fP\fIn\fP\fBD800\fP 800K 80 10 2 120 +\fBfd\fP\fIn\fP\fBD1040\fP 1040K 80 13 2 84 +\fBfd\fP\fIn\fP\fBD1120\fP 1120K 80 14 2 88 +.TE +.PP +3.5 inch high density device files: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBH360\fP 360K 40 9 2 12 +\fBfd\fP\fIn\fP\fBH720\fP 720K 80 9 2 16 +\fBfd\fP\fIn\fP\fBH820\fP 820K 82 10 2 52 +\fBfd\fP\fIn\fP\fBH830\fP 830K 83 10 2 68 +\fBfd\fP\fIn\fP\fBH1440\fP 1440K 80 18 2 28 +\fBfd\fP\fIn\fP\fBH1600\fP 1600K 80 20 2 124 +\fBfd\fP\fIn\fP\fBH1680\fP 1680K 80 21 2 44 +\fBfd\fP\fIn\fP\fBH1722\fP 1722K 82 21 2 60 +\fBfd\fP\fIn\fP\fBH1743\fP 1743K 83 21 2 76 +\fBfd\fP\fIn\fP\fBH1760\fP 1760K 80 22 2 96 +\fBfd\fP\fIn\fP\fBH1840\fP 1840K 80 23 2 116 +\fBfd\fP\fIn\fP\fBH1920\fP 1920K 80 24 2 100 +.TE +.PP +3.5 inch extra density device files: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBE2880\fP 2880K 80 36 2 32 +\fBfd\fP\fIn\fP\fBCompaQ\fP 2880K 80 36 2 36 +\fBfd\fP\fIn\fP\fBE3200\fP 3200K 80 40 2 104 +\fBfd\fP\fIn\fP\fBE3520\fP 3520K 80 44 2 108 +\fBfd\fP\fIn\fP\fBE3840\fP 3840K 80 48 2 112 +.TE +.SH DESCRIPTION +\fBfd\fP special files access the floppy disk drives in raw mode. +The following +.BR ioctl (2) +calls are supported by \fBfd\fP devices: +.IP \fBFDCLRPRM\fP +clears the media information of a drive (geometry of disk in drive). +.IP \fBFDSETPRM\fP +sets the media information of a drive. +The media information will be +lost when the media is changed. +.IP \fBFDDEFPRM\fP +sets the media information of a drive (geometry of disk in drive). +The media information will not be lost when the media is changed. +This will disable autodetection. +In order to reenable autodetection, you +have to issue an \fBFDCLRPRM\fP. +.IP \fBFDGETDRVTYP\fP +returns the type of a drive (name parameter). +For formats which work +in several drive types, \fBFDGETDRVTYP\fP returns a name which is +appropriate for the oldest drive type which supports this format. +.IP \fBFDFLUSH\fP +invalidates the buffer cache for the given drive. +.IP \fBFDSETMAXERRS\fP +sets the error thresholds for reporting errors, aborting the operation, +recalibrating, resetting, and reading sector by sector. +.IP \fBFDSETMAXERRS\fP +gets the current error thresholds. +.IP \fBFDGETDRVTYP\fP +gets the internal name of the drive. +.IP \fBFDWERRORCLR\fP +clears the write error statistics. +.IP \fBFDWERRORGET\fP +reads the write error statistics. +These include the total number of +write errors, the location and disk of the first write error, and the +location and disk of the last write error. +Disks are identified by a +generation number which is incremented at (almost) each disk change. +.IP \fBFDTWADDLE\fP +Switch the drive motor off for a few microseconds. +This might be +needed in order to access a disk whose sectors are too close together. +.IP \fBFDSETDRVPRM\fP +sets various drive parameters. +.IP \fBFDGETDRVPRM\fP +reads these parameters back. +.IP \fBFDGETDRVSTAT\fP +gets the cached drive state (disk changed, write protected et al.) +.IP \fBFDPOLLDRVSTAT\fP +polls the drive and return its state. +.IP \fBFDGETFDCSTAT\fP +gets the floppy controller state. +.IP \fBFDRESET\fP +resets the floppy controller under certain conditions. +.IP \fBFDRAWCMD\fP +sends a raw command to the floppy controller. +.PP +For more precise information, consult also the \fI\fP and +\fI\fP include files, as well as the manual page for +floppycontrol. +.SH FILES +/dev/fd* +.SH NOTES +The various formats allow to read and write many types of disks. +However, if a floppy is formatted with a too small inter sector gap, +performance may drop, up to needing a few seconds to access an entire +track. +To prevent this, use interleaved formats. +It is not possible to +read floppies which are formatted using GCR (group code recording), +which is used by Apple II and Macintosh computers (800k disks). +Reading floppies which are hard sectored (one hole per sector, with +the index hole being a little skewed) is not supported. +This used to be common with older 8 inch floppies. +.\" .SH AUTHORS +.\" Alain Knaff (Alain.Knaff@imag.fr), David Niemi +.\" (niemidc@clark.net), Bill Broadhurst (bbroad@netcom.com). +.SH "SEE ALSO" +.BR chown (1), +.BR floppycontrol (1), +.BR getfdprm (1), +.BR mknod (1), +.BR superformat (1), +.BR mount (8), +.BR setfdprm (8) diff --git a/original/man4/fifo.4 b/original/man4/fifo.4 new file mode 100644 index 00000000..17f777d5 --- /dev/null +++ b/original/man4/fifo.4 @@ -0,0 +1,2 @@ +.so man7/fifo.7 +.\" FIXME . this link will eventually be removed (created Apr 2006) diff --git a/original/man4/full.4 b/original/man4/full.4 new file mode 100644 index 00000000..d83d3063 --- /dev/null +++ b/original/man4/full.4 @@ -0,0 +1,54 @@ +.\" -*- nroff -*- +.\" +.\" This man-page is Copyright (C) 1997 John S. Kallal +.\" +.\" 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. +.\" +.\" correction, aeb, 970825 +.TH FULL 4 2007-11-24 "Linux" "Linux Programmer's Manual" +.SH NAME +full \- always full device +.SH CONFIGURATION +If your system does not have \fI/dev/full\fP created already, it +can be created with the following commands: +.nf + + mknod \-m 666 /dev/full c 1 7 + chown root:root /dev/full +.fi +.SH DESCRIPTION +File \fI/dev/full\fP has major device number 1 +and minor device number 7. +.LP +Writes to the \fI/dev/full\fP device will fail with an +.B ENOSPC +error. +This can be used to test how a program handles disk-full errors. + +Reads from the \fI/dev/full\fP device will return \\0 characters. + +Seeks on \fI/dev/full\fP will always succeed. +.SH FILES +/dev/full +.SH "SEE ALSO" +.BR mknod (1), +.BR null (4), +.BR zero (4) diff --git a/original/man4/futex.4 b/original/man4/futex.4 new file mode 100644 index 00000000..d2244517 --- /dev/null +++ b/original/man4/futex.4 @@ -0,0 +1,2 @@ +.so man7/futex.7 +.\" FIXME . this link will eventually be removed (created Apr 2006) diff --git a/original/man4/hd.4 b/original/man4/hd.4 new file mode 100644 index 00000000..76da22e9 --- /dev/null +++ b/original/man4/hd.4 @@ -0,0 +1,100 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 16:56:20 1993 by Rik Faith +.\" Modified Mon Oct 21 21:38:51 1996 by Eric S. Raymond +.\" (and some more by aeb) +.\" +.TH HD 4 1992-12-17 "Linux" "Linux Programmer's Manual" +.SH NAME +hd \- MFM/IDE hard disk devices +.SH DESCRIPTION +The \fBhd*\fP devices are block devices to access MFM/IDE hard disk drives +in raw mode. +The master drive on the primary IDE controller (major device +number 3) is \fBhda\fR; the slave drive is \fBhdb\fR. +The master drive of the second controller (major device number 22) +is \fBhdc\fR and the slave \fBhdd\fR. +.LP +General IDE block device names have the form +.BI hd X\c +, or +.BI hd XP\c +, where +.I X +is a letter denoting the physical drive, and +.I P +is a number denoting the partition on that physical drive. +The first form, +.BI hd X, +is used to address the whole drive. +Partition numbers are assigned in the order the partitions +are discovered, and only nonempty, nonextended partitions +get a number. +However, partition numbers 1-4 are given to the +four partitions described in the MBR (the "primary" partitions), +regardless of whether they are unused or extended. +Thus, the first logical partition will be +.BI hd X 5\c +\&. +Both DOS-type partitioning and BSD-disklabel partitioning are supported. +You can have at most 63 partitions on an IDE disk. +.LP +For example, +.I /dev/hda +refers to all of the first IDE drive in the system; and +.I /dev/hdb3 +refers to the third DOS "primary" partition on the second one. +.LP +They are typically created by: +.RS +.sp +mknod \-m 660 /dev/hda b 3 0 +.br +mknod \-m 660 /dev/hda1 b 3 1 +.br +mknod \-m 660 /dev/hda2 b 3 2 +.br +\&... +.br +mknod \-m 660 /dev/hda8 b 3 8 +.br +mknod \-m 660 /dev/hdb b 3 64 +.br +mknod \-m 660 /dev/hdb1 b 3 65 +.br +mknod \-m 660 /dev/hdb2 b 3 66 +.br +\&... +.br +mknod \-m 660 /dev/hdb8 b 3 72 +.br +chown root:disk /dev/hd* +.RE +.SH FILES +/dev/hd* +.SH "SEE ALSO" +.BR chown (1), +.BR mknod (1), +.BR sd (4), +.BR mount (8) diff --git a/original/man4/initrd.4 b/original/man4/initrd.4 new file mode 100644 index 00000000..47a3271d --- /dev/null +++ b/original/man4/initrd.4 @@ -0,0 +1,483 @@ +.\" -*- nroff -*- +.\" This man-page is Copyright (C) 1997 John S. Kallal +.\" +.\" 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 author(s) of this work. +.\" +.\" If the you wish to distribute versions of this work under other +.\" conditions than the above, please contact the author(s) at the following +.\" for permission: +.\" +.\" John S. Kallal - +.\" email: +.\" mail: 518 Kerfoot Farm RD, Wilmington, DE 19803-2444, USA +.\" phone: (302)654-5478 +.\" +.\" $Id: initrd.4,v 0.9 1997/11/07 05:05:32 kallal Exp kallal $ +.TH INITRD 4 2009-04-04 "Linux" "Linux Programmer's Manual" +.SH NAME +initrd \- boot loader initialized RAM disk +.SH CONFIGURATION +The +.I /dev/initrd +is a read-only block device assigned +major number 1 and minor number 250. +Typically +.I /dev/initrd +is owned by +.I root.disk +with mode 0400 (read access by root only). +If the Linux system does not have +.I /dev/initrd +already created, it can be created with the following commands: +.nf +\fB + mknod \-m 400 /dev/initrd b 1 250 + chown root:disk /dev/initrd +\fP +.fi +.PP +Also, support for both "RAM disk" and "Initial RAM disk" +(e.g. +.BR CONFIG_BLK_DEV_RAM=y +and +.BR CONFIG_BLK_DEV_INITRD=y ) +must be compiled directly into the Linux kernel to use +.IR /dev/initrd . +When using +.IR /dev/initrd , +the RAM disk driver cannot be loaded as a module. +.\" +.\" +.\" +.SH DESCRIPTION +The special file +.I /dev/initrd +is a read-only block device. +This device is a RAM disk that is initialized (e.g., loaded) +by the boot loader before the kernel is started. +The kernel then can use +.IR /dev/initrd "'s " +contents for a two-phase system boot-up. +.PP +In the first boot-up phase, the kernel starts up +and mounts an initial root file-system from the contents of +.I /dev/initrd +(e.g., RAM disk initialized by the boot loader). +In the second phase, additional drivers or other modules +are loaded from the initial root device's contents. +After loading the additional modules, a new root file system +(i.e., the normal root file system) is mounted from a +different device. +.\" +.\" +.\" +.SS "Boot-up Operation" +When booting up with +.BR initrd , +the system boots as follows: +.IP 1. 3 +The boot loader loads the kernel program and +.IR /dev/initrd 's +contents into memory. +.IP 2. +On kernel startup, +the kernel uncompresses and copies the contents of the device +.I /dev/initrd +onto device +.I /dev/ram0 +and then frees the memory used by +.IR /dev/initrd . +.IP 3. +The kernel then read-write mounts the device +.I /dev/ram0 +as the initial root file system. +.IP 4. +If the indicated normal root file system is also the initial +root file-system (e.g. +.IR /dev/ram0 ) +then the kernel skips to the last step for the usual boot sequence. +.IP 5. +If the executable file +.IR /linuxrc +is present in the initial root file-system, +.I /linuxrc +is executed with UID 0. +(The file +.I /linuxrc +must have executable permission. +The file +.I /linuxrc +can be any valid executable, including a shell script.) +.IP 6. +If +.I /linuxrc +is not executed or when +.I /linuxrc +terminates, the normal root file system is mounted. +(If +.I /linuxrc +exits with any file-systems mounted on the initial root +file-system, then the behavior of the kernel is +.BR UNSPECIFIED . +See the NOTES section for the current kernel behavior.) +.IP 7. +If the normal root file system has a directory +.IR /initrd , +the device +.I /dev/ram0 +is moved from +.IR / +to +.IR /initrd . +Otherwise if the directory +.IR /initrd +does not exist, the device +.I /dev/ram0 +is unmounted. +(When moved from +.IR / +to +.IR /initrd , +.I /dev/ram0 +is not unmounted and therefore processes can remain running from +.IR /dev/ram0 . +If directory +.I /initrd +does not exist on the normal root file system +and any processes remain running from +.IR /dev/ram0 +when +.I /linuxrc +exits, the behavior of the kernel is +.BR UNSPECIFIED . +See the NOTES section for the current kernel behavior.) +.IP 8. +The usual boot sequence (e.g., invocation of +.IR /sbin/init ) +is performed on the normal root file system. +.\" +.\" +.\" +.SS Options +The following boot loader options, when used with +.BR initrd , +affect the kernel's boot-up operation: +.TP +.BI initrd= "filename" +Specifies the file to load as the contents of +.IR /dev/initrd . +For +.B LOADLIN +this is a command-line option. +For +.B LILO +you have to use this command in the +.B LILO +configuration file +.IR /etc/lilo.config . +The filename specified with this +option will typically be a gzipped file-system image. +.TP +.I noinitrd +This boot option disables the two-phase boot-up operation. +The kernel performs the usual boot sequence as if +.I /dev/initrd +was not initialized. +With this option, any contents of +.I /dev/initrd +loaded into memory by the boot loader contents are preserved. +This option permits the contents of +.I /dev/initrd +to be any data and need not be limited to a file system image. +However, device +.I /dev/initrd +is read-only and can be read only one time after system startup. +.TP +.BI root= "device-name" +Specifies the device to be used as the normal root file system. +For +.B LOADLIN +this is a command-line option. +For +.B LILO +this is a boot time option or +can be used as an option line in the +.B LILO +configuration file +.IR /etc/lilo.config . +The device specified by the this option must be a mountable +device having a suitable root file-system. +.\" +.\" +.\" +.SS "Changing the Normal Root File System" +By default, +the kernel's settings +(e.g., set in the kernel file with +.BR rdev (8) +or compiled into the kernel file), +or the boot loader option setting +is used for the normal root file systems. +For an NFS-mounted normal root file system, one has to use the +.B nfs_root_name +and +.B nfs_root_addrs +boot options to give the NFS settings. +For more information on NFS-mounted root see the kernel documentation file +.BR Documentation/filesystems/nfsroot.txt . +For more information on setting the root file system see also the +.BR LILO +and +LOADLIN +documentation. +.PP +It is also possible for the +.I /linuxrc +executable to change the normal root device. +For +.I /linuxrc +to change the normal root device, +.IR /proc +must be mounted. +After mounting +.IR /proc , +.I /linuxrc +changes the normal root device by writing into the proc files +.IR /proc/sys/kernel/real-root-dev , +.IR /proc/sys/kernel/nfs-root-name , +and +.IR /proc/sys/kernel/nfs-root-addrs . +For a physical root device, the root device is changed by having +.I /linuxrc +write the new root file system device number into +.IR /proc/sys/kernel/real-root-dev . +For an NFS root file system, the root device is changed by having +.I /linuxrc +write the NFS setting into files +.IR /proc/sys/kernel/nfs-root-name +and +.I /proc/sys/kernel/nfs-root-addrs +and then writing 0xff (e.g., the pseudo-NFS-device number) into file +.IR /proc/sys/kernel/real-root-dev . +For example, the following shell command line would change +the normal root device to +.IR /dev/hdb1 : +.nf + + echo 0x365 >/proc/sys/kernel/real-root-dev + +.fi +For an NFS example, the following shell command lines would change the +normal root device to the NFS directory +.I /var/nfsroot +on a local networked NFS server with IP number 193.8.232.7 for a system with +IP number 193.8.232.7 and named "idefix": +.nf + + echo /var/nfsroot >/proc/sys/kernel/nfs-root-name + echo 193.8.232.2:193.8.232.7::255.255.255.0:idefix \\ + >/proc/sys/kernel/nfs-root-addrs + echo 255 >/proc/sys/kernel/real-root-dev +.fi + +.BR Note : +The use of +.I /proc/sys/kernel/real-root-dev +to change the root file system is obsolete. +See the kernel source file +.I Documentation/initrd.txt +as well as +.BR pivot_root (2) +and +.BR pivot_root (8) +for information on the modern method of changing the root file system. +.\" FIXME the manual page should describe the pivot_root mechanism. +.\" +.\" +.\" +.SS Usage +The main motivation for implementing +.B initrd +was to allow for modular kernel configuration at system installation. +.PP +A possible system installation scenario is as follows: +.IP 1. 3 +The loader program boots from floppy or other media with a minimal kernel +(e.g., support for +.IR /dev/ram , +.IR /dev/initrd , +and the ext2 file-system) and loads +.IR /dev/initrd +with a gzipped version of the initial file-system. +.IP 2. +The executable +.I /linuxrc +determines what is needed to (1) mount the normal root file-system +(i.e., device type, device drivers, file system) and (2) the +distribution media (e.g., CD-ROM, network, tape, ...). +This can be done by asking the user, by auto-probing, +or by using a hybrid approach. +.IP 3. +The executable +.I /linuxrc +loads the necessary modules from the initial root file-system. +.IP 4. +The executable +.I /linuxrc +creates and populates the root file system. +(At this stage the normal root file system does not have to be a +completed system yet.) +.IP 5. +The executable +.IR /linuxrc +sets +.IR /proc/sys/kernel/real-root-dev , +unmount +.IR /proc , +the normal root file system and any other file +systems it has mounted, and then terminates. +.IP 6. +The kernel then mounts the normal root file system. +.IP 7. +Now that the file system is accessible and intact, +the boot loader can be installed. +.IP 8. +The boot loader is configured to load into +.I /dev/initrd +a file system with the set of modules that was used to bring up the system. +(e.g., Device +.I /dev/ram0 +can be modified, then unmounted, and finally, the image is written from +.I /dev/ram0 +to a file.) +.IP 9. +The system is now bootable and additional installation tasks can be +performed. +.PP +The key role of +.I /dev/initrd +in the above is to reuse the configuration data during normal system operation +without requiring initial kernel selection, a large generic kernel or, +recompiling the kernel. +.PP +A second scenario is for installations where Linux runs on systems with +different hardware configurations in a single administrative network. +In such cases, it may be desirable to use only a small set of kernels +(ideally only one) and to keep the system-specific part of configuration +information as small as possible. +In this case, create a common file +with all needed modules. +Then, only the +.I /linuxrc +file or a file executed by +.I /linuxrc +would be different. +.PP +A third scenario is more convenient recovery disks. +Because information like the location of the root file-system +partition is not needed at boot time, the system loaded from +.I /dev/initrd +can use a dialog and/or auto-detection followed by a +possible sanity check. +.PP +Last but not least, Linux distributions on CD-ROM may use +.B initrd +for easy installation from the CD-ROM. +The distribution can use +.B LOADLIN +to directly load +.I /dev/initrd +from CD-ROM without the need of any floppies. +The distribution could also use a +.B LILO +boot floppy and then bootstrap a bigger ram disk via +.IR /dev/initrd +from the CD-ROM. +.\" +.\" +.\" +.SH FILES +.I /dev/initrd +.br +.I /dev/ram0 +.br +.I /linuxrc +.br +.I /initrd +.\" +.\" +.\" +.SH NOTES +.IP 1. 3 +With the current kernel, any file systems that remain mounted when +.I /dev/ram0 +is moved from +.I / +to +.I /initrd +continue to be accessible. +However, the +.I /proc/mounts +entries are not updated. +.IP 2. +With the current kernel, if directory +.I /initrd +does not exist, then +.I /dev/ram0 +will +.B not +be fully unmounted if +.I /dev/ram0 +is used by any process or has any file-system mounted on it. +If +.IR /dev/ram0 +is +.B not +fully unmounted, then +.I /dev/ram0 +will remain in memory. +.IP 3. +Users of +.I /dev/initrd +should not depend on the behavior give in the above notes. +The behavior may change in future versions of the Linux kernel. +.\" +.\" +.\" +.\" .SH AUTHORS +.\" The kernel code for device +.\" .BR initrd +.\" was written by Werner Almesberger and +.\" Hans Lermen . +.\" The code for +.\" .BR initrd +.\" was added to the baseline Linux kernel in development version 1.3.73. +.SH "SEE ALSO" +.BR chown (1), +.BR mknod (1), +.BR ram (4), +.BR freeramdisk (8), +.BR rdev (8) + +The documentation file +.I initrd.txt +in the kernel source package, the LILO documentation, +the LOADLIN documentation, the SYSLINUX documentation. diff --git a/original/man4/intro.4 b/original/man4/intro.4 new file mode 100644 index 00000000..3926b820 --- /dev/null +++ b/original/man4/intro.4 @@ -0,0 +1,38 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 16:57:14 1993 by Rik Faith (faith@cs.unc.edu) +.TH INTRO 4 2007-10-23 "Linux" "Linux Programmer's Manual" +.SH NAME +intro \- Introduction to special files +.SH DESCRIPTION +Section 4 of the manual describes special files (devices). +.SH FILES +/dev/* \(em device files +.SH NOTES +.SS Authors and Copyright Conditions +Look at the header of the manual page source for the author(s) and copyright +conditions. +Note that these can be different from page to page! +.SH "SEE ALSO" +.BR standards (7) diff --git a/original/man4/kmem.4 b/original/man4/kmem.4 new file mode 100644 index 00000000..d4c1762c --- /dev/null +++ b/original/man4/kmem.4 @@ -0,0 +1 @@ +.so man4/mem.4 diff --git a/original/man4/lp.4 b/original/man4/lp.4 new file mode 100644 index 00000000..89b2b54a --- /dev/null +++ b/original/man4/lp.4 @@ -0,0 +1,127 @@ +'\" t +.\" Copyright (c) Michael Haardt (michael@cantor.informatik.rwth-aachen.de), +.\" Sun Jan 15 19:16:33 1995 +.\" +.\" 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, Sun Feb 26 15:02:58 1995, faith@cs.unc.edu +.TH LP 4 1995-01-15 "Linux" "Linux Programmer's Manual" +.SH NAME +lp \- line printer devices +.SH SYNOPSIS +.B #include +.SH CONFIGURATION +\fBlp\fP[0\(en2] are character devices for the parallel line printers; +they have major number 6 and minor number 0\(en2. +The minor numbers +correspond to the printer port base addresses 0x03bc, 0x0378 and 0x0278. +Usually they have mode 220 and are owned by root and group lp. +You can use printer ports either with polling or with interrupts. +Interrupts are recommended when high traffic is expected, for example, +for laser printers. +For usual dot matrix printers polling will usually be enough. +The default is polling. +.SH DESCRIPTION +The following +.BR ioctl (2) +calls are supported: +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPTIME, int \fP\fIarg\fP\fB)\fP" +Sets the amount of time that the driver sleeps before rechecking the printer +when the printer's buffer appears to be filled to \fIarg\fP. +If you have a fast printer, decrease this number; +if you have a slow printer then increase it. +This is in hundredths of a second, the default 2 +being 0.02 seconds. +It only influences the polling driver. +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCHAR, int \fP\fIarg\fP\fB)\fP" +Sets the maximum number of busy-wait iterations which the polling driver does +while waiting for the printer to get ready for receiving a character to +\fIarg\fP. +If printing is too slow, increase this number; if the +system gets too slow, decrease this number. +The default is 1000. +It only influences the polling driver. +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORT, int \fP\fIarg\fP\fB)\fP" +If \fIarg\fP is 0, the printer driver will retry on errors, otherwise +it will abort. +The default is 0. +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORTOPEN, int \fP\fIarg\fP\fB)\fP" +If \fIarg\fP is 0, +.BR open (2) +will be aborted on error, otherwise error will be ignored. +The default is to ignore it. +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCAREFUL, int \fP\fIarg\fP\fB)\fP" +If \fIarg\fP is 0, then the out-of-paper, offline and error signals are +required to be false on all writes, otherwise they are ignored. +The default is to ignore them. +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPWAIT, int \fP\fIarg\fP\fB)\fP" +Sets the number of busy waiting iterations to wait before strobing the +printer to accept a just-written character, and the number of iterations to +wait before turning the strobe off again, +to \fIarg\fP. +The specification says this time should be 0.5 +microseconds, but experience has shown the delay caused by the code is +already enough. +For that reason, the default value is 0. +This is used for both the polling and the interrupt driver. +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPSETIRQ, int \fP\fIarg\fP\fB)\fP" +This +.BR ioctl (2) +requires superuser privileges. +It takes an +.I int +containing the new IRQ as argument. +As a side effect, the printer will be reset. +When \fIarg\fP is 0, the polling driver will be used, which is also default. +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETIRQ, int *\fP\fIarg\fP\fB)\fP" +Stores the currently used IRQ in \fIarg\fP. +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETSTATUS, int *\fP\fIarg\fP\fB)\fP" +Stores the value of the status port in \fIarg\fP. +The bits have the following meaning: +.TS +l l. +LP_PBUSY inverted busy input, active high +LP_PACK unchanged acknowledge input, active low +LP_POUTPA unchanged out-of-paper input, active high +LP_PSELECD unchanged selected input, active high +LP_PERRORP unchanged error input, active low +.TE +.sp +Refer to your printer manual for the meaning of the signals. +Note that undocumented bits may also be set, depending on your printer. +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPRESET)\fP" +Resets the printer. +No argument is used. +.SH FILES +/dev/lp* +.\" .SH AUTHORS +.\" The printer driver was originally written by Jim Weigand and Linus +.\" Torvalds. +.\" It was further improved by Michael K.\& Johnson. +.\" The interrupt code was written by Nigel Gamble. +.\" Alan Cox modularized it. +.\" LPCAREFUL, LPABORT, LPGETSTATUS were added by Chris Metcalf. +.SH "SEE ALSO" +.BR chmod (1), +.BR chown (1), +.BR mknod (1), +.BR lpcntl (8), +.BR tunelp (8) diff --git a/original/man4/mem.4 b/original/man4/mem.4 new file mode 100644 index 00000000..460163d8 --- /dev/null +++ b/original/man4/mem.4 @@ -0,0 +1,84 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 16:59:10 1993 by Rik Faith (faith@cs.unc.edu) +.TH MEM 4 1992-11-21 "Linux" "Linux Programmer's Manual" +.SH NAME +mem, kmem, port \- system memory, kernel memory and system ports +.SH DESCRIPTION +\fBmem\fP is a character device file +that is an image of the main memory of the computer. +It may be used, for example, to examine (and even patch) the system. +.LP +Byte addresses in +.B mem +are interpreted as physical memory addresses. +References to nonexistent locations cause errors to be returned. +.LP +Examining and patching is likely to lead to unexpected results +when read-only or write-only bits are present. +.LP +It is typically created by: +.RS +.sp +mknod \-m 660 /dev/mem c 1 1 +.br +chown root:kmem /dev/mem +.RE +.LP +The file +.B kmem +is the same as +.BR mem , +except that the kernel virtual memory +rather than physical memory is accessed. +.LP +It is typically created by: +.RS +.sp +mknod \-m 640 /dev/kmem c 1 2 +.br +chown root:kmem /dev/kmem +.RE +.LP +\fBport\fP is similar to +.BR mem , +but the I/O ports are accessed. +.LP +It is typically created by: +.RS +.sp +mknod \-m 660 /dev/port c 1 4 +.br +chown root:mem /dev/port +.RE +.SH FILES +.I /dev/mem +.br +.I /dev/kmem +.br +.I /dev/port +.SH "SEE ALSO" +.BR chown (1), +.BR mknod (1), +.BR ioperm (2) diff --git a/original/man4/mouse.4 b/original/man4/mouse.4 new file mode 100644 index 00000000..29b4da07 --- /dev/null +++ b/original/man4/mouse.4 @@ -0,0 +1,154 @@ +'\" t +.\"roff.\" Copyright +.\" This manpage is Copyright (C) 1996 Michael Haardt. +.\" Updates Nov 1998, 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. +.TH MOUSE 4 1996-02-10 "Linux" "Linux Programmer's Manual" +.SH NAME +mouse \- serial mouse interface +.SH CONFIGURATION +Serial mice are connected to a serial RS232/V24 dialout line, see +.BR ttyS (4) +for a description. +.SH DESCRIPTION +.SS Introduction +The pinout of the usual 9 pin plug as used for serial mice is: +.TS +center; +r c l. +pin name used for +2 RX Data +3 TX -12 V, Imax = 10 mA +4 DTR +12 V, Imax = 10 mA +7 RTS +12 V, Imax = 10 mA +5 GND Ground +.TE + +This is the specification, in fact 9 V suffices with most mice. +.PP +The mouse driver can recognize a mouse by dropping RTS to low and raising +it again. +About 14 ms later the mouse will send 0x4D (\(aqM\(aq) on the data line. +After a further 63 ms, a Microsoft-compatible 3-button mouse will send +0x33 (\(aq3\(aq). +.PP +The relative mouse movement is sent as \fIdx\fP (positive means right) +and \fIdy\fP (positive means down). +Various mice can operate at different speeds. +To select speeds, cycle through the +speeds 9600, 4800, 2400 and 1200 bit/s, each time writing the two characters +from the table below and waiting 0.1 seconds. +The following table shows available speeds and the strings that select them: +.TS +center; +l l. +bit/s string +9600 *q +4800 *p +2400 *o +1200 *n +.TE + +The first byte of a data packet can be used to synchronization purposes. +.SS "Microsoft protocol" +The \fBMicrosoft\fP protocol uses 1 start bit, 7 data bits, no parity +and one stop bit at the speed of 1200 bits/sec. +Data is sent to RxD in 3-byte packets. +The \fIdx\fP and \fIdy\fP movements are sent as +two's-complement, \fIlb\fP (\fIrb\fP) are set when the left (right) +button is pressed: +.TS +center; +r c c c c c c c. +byte d6 d5 d4 d3 d2 d1 d0 +1 1 lb rb dy7 dy6 dx7 dx6 +2 0 dx5 dx4 dx3 dx2 dx1 dx0 +3 0 dy5 dy4 dy3 dy2 dy1 dy0 +.TE +.SS "3-button Microsoft protocol" +Original Microsoft mice only have two buttons. +However, there are some +three button mice which also use the Microsoft protocol. +Pressing or +releasing the middle button is reported by sending a packet with zero +movement and no buttons pressed. +(Thus, unlike for the other two buttons, the status of the middle +button is not reported in each packet.) +.SS "Logitech protocol" +Logitech serial 3-button mice use a different extension of the +Microsoft protocol: when the middle button is up, the above 3-byte +packet is sent. +When the middle button is down a 4-byte packet is +sent, where the 4th byte has value 0x20 (or at least has the 0x20 +bit set). +In particular, a press of the middle button is reported +as 0,0,0,0x20 when no other buttons are down. +.SS "Mousesystems protocol" +The \fBMousesystems\fP protocol uses 1 start bit, 8 data bits, no parity +and two stop bits at the speed of 1200 bits/sec. +Data is sent to RxD in +5-byte packets. +\fIdx\fP is sent as the sum of the two two's-complement +values, \fIdy\fP is send as negated sum of the two two's-complement +values. +\fIlb\fP (\fImb\fP, \fIrb\fP) are cleared when the left (middle, +right) button is pressed: +.TS +center; +r c c c c c c c c. +byte d7 d6 d5 d4 d3 d2 d1 d0 +1 1 0 0 0 0 lb mb rb +2 0 dxa6 dxa5 dxa4 dxa3 dxa2 dxa1 dxa0 +3 0 dya6 dya5 dya4 dya3 dya2 dya1 dya0 +4 0 dxb6 dxb5 dxb4 dxb3 dxb2 dxb1 dxb0 +5 0 dyb6 dyb5 dyb4 dyb3 dyb2 dyb1 dyb0 +.TE + +Bytes 4 and 5 describe the change that occurred since bytes 2 and 3 +were transmitted. +.SS "Sun protocol" +The \fBSun\fP protocol is the 3-byte version of the above 5-byte +Mousesystems protocol: the last two bytes are not sent. +.SS "MM protocol" +The \fBMM\fP protocol uses 1 start bit, 8 data bits, odd parity and one +stop bit at the speed of 1200 bits/sec. +Data is sent to RxD in 3-byte +packets. +\fIdx\fP and \fIdy\fP are sent as single signed values, the +sign bit indicating a negative value. +\fIlb\fP (\fImb\fP, \fIrb\fP) are +set when the left (middle, right) button is pressed: +.TS +center; +r c c c c c c c c. +byte d7 d6 d5 d4 d3 d2 d1 d0 +1 1 0 0 dxs dys lb mb rb +2 0 dx6 dx5 dx4 dx3 dx2 dx1 dx0 +3 0 dy6 dy5 dy4 dy3 dy2 dy1 dy0 +.TE +.SH FILES +.TP +.I /dev/mouse +A commonly used symlink pointing to a mouse device. +.SH "SEE ALSO" +.BR ttyS (4), +.BR gpm (8) diff --git a/original/man4/msr.4 b/original/man4/msr.4 new file mode 100644 index 00000000..ec172d16 --- /dev/null +++ b/original/man4/msr.4 @@ -0,0 +1,56 @@ +.\" 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. +.\" +.TH MSR 4 2009-03-31 "Linux" "Linux Programmer's Manual" +.SH NAME +msr \- x86 CPU MSR access device +.SH DESCRIPTION +.I /dev/cpu/CPUNUM/msr +provides an interface to read and write the model-specific +registers (MSRs) of an x86 CPU. +.I CPUNUM +is the number of the CPU to access as listed in +.IR /proc/cpuinfo . + +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 +.IR root , +or members of the group +.IR root . +.SH NOTES +The +.I msr +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 SEE ALSO +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/original/man4/null.4 b/original/man4/null.4 new file mode 100644 index 00000000..0a206807 --- /dev/null +++ b/original/man4/null.4 @@ -0,0 +1,55 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:00:12 1993 by Rik Faith (faith@cs.unc.edu) +.TH NULL 4 2009-02-23 "Linux" "Linux Programmer's Manual" +.SH NAME +null, zero \- data sink +.SH DESCRIPTION +Data written to a \fBnull\fP or \fBzero\fP special file is discarded. +.PP +Reads from the \fBnull\fP special file always return end of file (i.e., +.BR read (2) +returns 0), whereas +reads from \fBzero\fP always return bytes containing zero (\e0 characters). +.LP +\fBnull\fP and \fBzero\fP are typically created by: +.RS +.sp +mknod \-m 666 /dev/null c 1 3 +.br +mknod \-m 666 /dev/zero c 1 5 +.br +chown root:root /dev/null /dev/zero +.RE +.SH FILES +.I /dev/null +.br +.I /dev/zero +.SH NOTES +If these devices are not writable and readable for all users, many +programs will act strangely. +.SH "SEE ALSO" +.BR chown (1), +.BR mknod (1), +.BR full (4) diff --git a/original/man4/port.4 b/original/man4/port.4 new file mode 100644 index 00000000..d4c1762c --- /dev/null +++ b/original/man4/port.4 @@ -0,0 +1 @@ +.so man4/mem.4 diff --git a/original/man4/ptmx.4 b/original/man4/ptmx.4 new file mode 100644 index 00000000..b50d4e71 --- /dev/null +++ b/original/man4/ptmx.4 @@ -0,0 +1 @@ +.so man4/pts.4 diff --git a/original/man4/pts.4 b/original/man4/pts.4 new file mode 100644 index 00000000..b64806a9 --- /dev/null +++ b/original/man4/pts.4 @@ -0,0 +1,72 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This man page was written by Jeremy Phelps . +.\" Notes added - aeb +.\" Redistribute and revise at will. +.\" +.TH PTS 4 2002-10-09 "Linux" "Linux Programmer's Manual" +.SH NAME +ptmx, pts \- pseudo-terminal master and slave +.SH DESCRIPTION +The file \fI/dev/ptmx\fP is a character file with major number 5 and +minor number 2, usually of mode 0666 and owner.group of root.root. +It is used to create a pseudo-terminal master and slave pair. +.PP +When a process opens \fI/dev/ptmx\fP, it gets a file +descriptor for a pseudo-terminal master (PTM), +and a pseudo-terminal slave (PTS) device is created in the +.I /dev/pts +directory. +Each file descriptor obtained by opening \fI/dev/ptmx\fP +is an independent PTM with its own associated PTS, whose path can +be found by passing the descriptor to +.BR ptsname (3). +.PP +Before opening the pseudo-terminal slave, you must pass the master's file +descriptor to +.BR grantpt (3) +and +.BR unlockpt (3). +.PP +Once both the pseudo-terminal master and slave are open, the slave provides +processes with an interface that is identical to that of a real terminal. +.PP +Data written to the slave is presented on the master descriptor as input. +Data written to the master is presented to the slave as input. +.PP +In practice, pseudo-terminals are used for implementing terminal emulators +such as +.BR xterm (1), +in which data read from the pseudo-terminal master is interpreted by the +application in the same way +a real terminal would interpret the data, and for implementing remote-login +programs such as +.BR sshd (8), +in which data read from the pseudo-terminal master is sent across the network +to a client program that is connected to a terminal or terminal emulator. +.PP +Pseudo-terminals can also be used to send input to programs that normally +refuse to read input from pipes (such as +.BR su (1), +and +.BR passwd (1)). +.SH FILES +.IR /dev/ptmx , +.I /dev/pts/* +.SH NOTES +The Linux support for the above (known as Unix98 pty naming) +is done using the +.I devpts +file system, that should be mounted on +.IR /dev/pts . +.LP +Before this Unix98 scheme, master ptys were called +.IR /dev/ptyp0 ", ..." +and slave ptys +.IR /dev/ttyp0 ", ..." +and one needed lots of preallocated device nodes. +.SH "SEE ALSO" +.BR getpt (3), +.BR grantpt (3), +.BR ptsname (3), +.BR unlockpt (3), +.BR pty (7) diff --git a/original/man4/ram.4 b/original/man4/ram.4 new file mode 100644 index 00000000..78062eb6 --- /dev/null +++ b/original/man4/ram.4 @@ -0,0 +1,43 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:01:11 1993 by Rik Faith (faith@cs.unc.edu) +.TH RAM 4 1992-11-21 "Linux" "Linux Programmer's Manual" +.SH NAME +ram \- ram disk device +.SH DESCRIPTION +The \fIram\fP device is a block device to access the ram disk in raw mode. +.LP +It is typically created by: +.RS +.sp +mknod \-m 660 /dev/ram b 1 1 +.br +chown root:disk /dev/ram +.RE +.SH FILES +/dev/ram +.SH "SEE ALSO" +.BR chown (1), +.BR mknod (1), +.BR mount (8) diff --git a/original/man4/random.4 b/original/man4/random.4 new file mode 100644 index 00000000..2307e074 --- /dev/null +++ b/original/man4/random.4 @@ -0,0 +1,219 @@ +.\" Copyright (c) 1997 John S. Kallal (kallal@voicenet.com) +.\" +.\" 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. +.\" +.\" Some changes by tytso and aeb. +.\" +.\" 2004-12-16, John V. Belmonte/mtk, Updated init and quit scripts +.\" 2004-04-08, AEB, Improved description of read from /dev/urandom +.\" 2008-06-20, George Spelvin , +.\" Matt Mackall +.\" Add a Usage subsection that recommends most users to use +.\" /dev/urandom, and emphasizes parsimonious usage of /dev/random. +.\" +.TH RANDOM 4 2008-06-20 "Linux" "Linux Programmer's Manual" +.SH NAME +random, urandom \- kernel random number source devices +.SH DESCRIPTION +The character special files \fI/dev/random\fP and +\fI/dev/urandom\fP (present since Linux 1.3.30) +provide an interface to the kernel's random number generator. +File \fI/dev/random\fP has major device number 1 +and minor device number 8. +File \fI/dev/urandom\fP has major device number 1 and minor device number 9. +.LP +The random number generator gathers environmental noise +from device drivers and other sources into an entropy pool. +The generator also keeps an estimate of the +number of bits of noise in the entropy pool. +From this entropy pool random numbers are created. +.LP +When read, the \fI/dev/random\fP device will only return random bytes +within the estimated number of bits of noise in the entropy +pool. +\fI/dev/random\fP should be suitable for uses that need very +high quality randomness such as one-time pad or key generation. +When the entropy pool is empty, reads from \fI/dev/random\fP will block +until additional environmental noise is gathered. +.LP +A read from the \fI/dev/urandom\fP device will not block +waiting for more entropy. +As a result, if there is not sufficient entropy in the +entropy pool, the returned values are theoretically vulnerable to a +cryptographic attack on the algorithms used by the driver. +Knowledge of how to do this is not available in the current unclassified +literature, but it is theoretically possible that such an attack may +exist. +If this is a concern in your application, use \fI/dev/random\fP +instead. +.SS Usage +If you are unsure about whether you should use +.IR /dev/random +or +.IR /dev/urandom , +then probably you want to use the latter. +As a general rule, +.IR /dev/urandom +should be used for everything except long-lived GPG/SSL/SSH keys. + +If a seed file is saved across reboots as recommended above (all major +Linux distributions have done this since 2000 at least), the output is +cryptographically secure against attackers without local root access as +soon as it is reloaded in the boot sequence, and perfectly adequate for +network encryption session keys. +Since reads from +.I /dev/random +may block, users will usually want to open it in nonblocking mode +(or perform a read with timeout), +and provide some sort of user notification if the desired +entropy is not immediately available. + +The kernel random-number generator is designed to produce a small +amount of high-quality seed material to seed a +cryptographic pseudo-random number generator (CPRNG). +It is designed for security, not speed, and is poorly +suited to generating large amounts of random data. +Users should be very economical in the amount of seed +material that they read from +.IR /dev/urandom +(and +.IR /dev/random ); +unnecessarily reading large quantities of data from this device will have +a negative impact on other users of the device. + +The amount of seed material required to generate a cryptographic key +equals the effective key size of the key. +For example, a 3072-bit RSA +or Diffie-Hellman private key has an effective key size of 128 bits +(it requires about 2^128 operations to break) so a key generator only +needs 128 bits (16 bytes) of seed material from +.IR /dev/random . + +While some safety margin above that minimum is reasonable, as a guard +against flaws in the CPRNG algorithm, no cryptographic primitive +available today can hope to promise more than 256 bits of security, +so if any program reads more than 256 bits (32 bytes) from the kernel +random pool per invocation, or per reasonable reseed interval (not less +than one minute), that should be taken as a sign that its cryptography is +.I not +skilfully implemented. +.SS Configuration +If your system does not have +\fI/dev/random\fP and \fI/dev/urandom\fP created already, they +can be created with the following commands: + +.nf + mknod \-m 644 /dev/random c 1 8 + mknod \-m 644 /dev/urandom c 1 9 + chown root:root /dev/random /dev/urandom +.fi + +When a Linux system starts up without much operator interaction, +the entropy pool may be in a fairly predictable state. +This reduces the actual amount of noise in the entropy pool +below the estimate. +In order to counteract this effect, it helps to carry +entropy pool information across shut-downs and start-ups. +To do this, add the following lines to an appropriate script +which is run during the Linux system start-up sequence: + +.nf + echo "Initializing random number generator..." + random_seed=/var/run/random-seed + # Carry a random seed from start-up to start-up + # Load and then save the whole entropy pool + if [ \-f $random_seed ]; then + cat $random_seed >/dev/urandom + else + touch $random_seed + fi + chmod 600 $random_seed + poolfile=/proc/sys/kernel/random/poolsize + [ \-r $poolfile ] && bytes=\`cat $poolfile\` || bytes=512 + dd if=/dev/urandom of=$random_seed count=1 bs=$bytes +.fi + +Also, add the following lines in an appropriate script which is +run during the Linux system shutdown: + +.nf + # Carry a random seed from shut-down to start-up + # Save the whole entropy pool + echo "Saving random seed..." + random_seed=/var/run/random-seed + touch $random_seed + chmod 600 $random_seed + poolfile=/proc/sys/kernel/random/poolsize + [ \-r $poolfile ] && bytes=\`cat $poolfile\` || bytes=512 + dd if=/dev/urandom of=$random_seed count=1 bs=$bytes +.fi +.SS "/proc Interface" +The files in the directory +.I /proc/sys/kernel/random +(present since 2.3.16) provide an additional interface to the +.I /dev/random +device. +.LP +The read-only file +.I entropy_avail +gives the available entropy. +Normally, this will be 4096 (bits), +a full entropy pool. +.LP +The file +.I poolsize +gives the size of the entropy pool. +The semantics of this file vary across kernel versions: +.RS +.TP 12 +Linux 2.4: +This file gives the size of the entropy pool in +.IR bytes . +Normally, this file will have the value 512, but it is writable, +and can be changed to any value for which an algorithm is available. +The choices are 32, 64, 128, 256, 512, 1024, or 2048. +.TP +Linux 2.6: +This file is read-only, and gives the size of the entropy pool in +.IR bits . +It contains the value 4096. +.RE +.LP +The file +.I read_wakeup_threshold +contains the number of bits of entropy required for waking up processes +that sleep waiting for entropy from +.IR /dev/random . +The default is 64. +The file +.I write_wakeup_threshold +contains the number of bits of entropy below which we wake up +processes that do a +.BR select (2) +or +.BR poll (2) +for write access to +.IR /dev/random . +These values can be changed by writing to the files. +.LP +The read-only files +.I uuid +and +.I boot_id +contain random strings like 6fd5a44b-35f4-4ad4-a9b9-6b9be13e1fe9. +The former is generated afresh for each read, the latter was +generated once. +.SH FILES +/dev/random +.br +/dev/urandom +.\" .SH AUTHOR +.\" The kernel's random number generator was written by +.\" Theodore Ts'o (tytso@athena.mit.edu). +.SH "SEE ALSO" +mknod (1) +.br +RFC\ 1750, "Randomness Recommendations for Security" diff --git a/original/man4/rtc.4 b/original/man4/rtc.4 new file mode 100644 index 00000000..e67eec6a --- /dev/null +++ b/original/man4/rtc.4 @@ -0,0 +1,340 @@ +.\" rtc.4 +.\" Copyright 2002 Urs Thuermann (urs@isnogud.escape.de) +.\" +.\" 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. +.\" +.\" $Id: rtc.4,v 1.4 2005/12/05 17:19:49 urs Exp $ +.\" +.\" 2006-02-08 Various additions by mtk +.\" 2006-11-26 cleanup, cover the generic rtc framework; David Brownell +.\" +.TH RTC 4 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +rtc \- real-time clock +.SH SYNOPSIS +#include +.sp +.BI "int ioctl(" fd ", RTC_" request ", " param ");" +.SH DESCRIPTION +This is the interface to drivers for real-time clocks (RTCs). + +Most computers have one or more hardware clocks which record the +current "wall clock" time. +These are called "Real Time Clocks" (RTCs). +One of these usually has battery backup power so that it tracks the time +even while the computer is turned off. +RTCs often provide alarms and other interrupts. + +All i386 PCs, and ACPI based systems, have an RTC that is compatible with +the Motorola MC146818 chip on the original PC/AT. +Today such an RTC is usually integrated into the mainboard's chipset +(south bridge), and uses a replaceable coin-sized backup battery. + +Non-PC systems, such as embedded systems built around system-on-chip +processors, use other implementations. +They usually won't offer the same functionality as the RTC from a PC/AT. +.SS RTC vs System Clock +RTCs should not be confused with the system clock, which is +a software clock maintained by the kernel and used to implement +.BR gettimeofday (2) +and +.BR time (2), +as well as setting timestamps on files, etc. +The system clock reports seconds and microseconds since a start point, +defined to be the POSIX Epoch: 1970-01-01 00:00:00 +0000 (UTC). +(One common implementation counts timer interrupts, once +per "jiffy", at a frequency of 100, 250, or 1000 Hz.) +That is, it is supposed to report wall clock time, which RTCs also do. + +A key difference between an RTC and the system clock is that RTCs +run even when the system is in a low power state (including "off"), +and the system clock can't. +Until it is initialized, the system clock can only report time since +system boot ... not since the POSIX Epoch. +So at boot time, and after resuming from a system low power state, the +system clock will often be set to the current wall clock time using an RTC. +Systems without an RTC need to set the system clock using another clock, +maybe across the network or by entering that data manually. +.SS RTC functionality +RTCs can be read and written with +.BR hwclock (8), +or directly with the ioctl requests listed below. + +Besides tracking the date and time, many RTCs can also generate +interrupts +.IP * 3 +on every clock update (i.e., once per second); +.IP * +at periodic intervals with a frequency that can be set to +any power-of-2 multiple in the range 2 Hz to 8192 Hz; +.IP * +on reaching a previously specified alarm time. +.PP +Each of those interrupt sources can be enabled or disabled separately. +On many systems, the alarm interrupt can be configured as a system wakeup +event, which can resume the system from a low power state such as +Suspend-to-RAM (STR, called S3 in ACPI systems), +Hibernation (called S4 in ACPI systems), +or even "off" (called S5 in ACPI systems). +On some systems, the battery backed RTC can't issue +interrupts, but another one can. + +The +.I /dev/rtc +(or +.IR /dev/rtc0 , +.IR /dev/rtc1 , +etc.) +device can be opened only once (until it is closed) and it is read-only. +On +.BR read (2) +and +.BR select (2) +the calling process is blocked until the next interrupt from that RTC +is received. +Following the interrupt, the process can read a long integer, of which +the least significant byte contains a bit mask encoding +the types of interrupt that occurred, +while the remaining 3 bytes contain the number of interrupts since the +last +.BR read (2). +.SS ioctl(2) interface +The following +.BR ioctl (2) +requests are defined on file descriptors connected to RTC devices: +.TP +.B RTC_RD_TIME +Returns this RTC's time in the following structure: +.IP +.in +4n +.nf +struct rtc_time { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; /* unused */ + int tm_yday; /* unused */ + int tm_isdst; /* unused */ +}; +.fi +.in +.IP +The fields in this structure have the same meaning and ranges as for the +.I tm +structure described in +.BR gmtime (3). +A pointer to this structure should be passed as the third +.BR ioctl (2) +argument. +.TP +.B RTC_SET_TIME +Sets this RTC's time to the time specified by the +.I rtc_time +structure pointed to by the third +.BR ioctl (2) +argument. +To set the +RTC's time the process must be privileged (i.e., have the +.B CAP_SYS_TIME +capability). +.TP +.BR RTC_ALM_READ ", " RTC_ALM_SET +Read and set the alarm time, for RTCs that support alarms. +The alarm interrupt must be separately enabled or disabled using the +.BR RTC_AIE_ON ", " RTC_AIE_OFF +requests. +The third +.BR ioctl (2) +argument is a pointer to an +.I rtc_time +structure. +Only the +.IR tm_sec , +.IR tm_min , +and +.I tm_hour +fields of this structure are used. +.TP +.BR RTC_IRQP_READ ", " RTC_IRQP_SET +Read and set the frequency for periodic interrupts, +for RTCs that support periodic interrupts. +The periodic interrupt must be separately enabled or disabled using the +.BR RTC_PIE_ON ", " RTC_PIE_OFF +requests. +The third +.BR ioctl (2) +argument is an +.I "unsigned long\ *" +or an +.IR "unsigned long" , +respectively. +The value is the frequency in interrupts per second. +The set of allowable frequencies is the multiples of two +in the range 2 to 8192. +Only a privileged process (i.e., one having the +.B CAP_SYS_RESOURCE +capability) can set frequencies above the value specified in +.IR /proc/sys/dev/rtc/max-user-freq . +(This file contains the value 64 by default.) +.TP +.BR RTC_AIE_ON ", " RTC_AIE_OFF +Enable or disable the alarm interrupt, for RTCs that support alarms. +The third +.BR ioctl (2) +argument is ignored. +.TP +.BR RTC_UIE_ON ", " RTC_UIE_OFF +Enable or disable the interrupt on every clock update, +for RTCs that support this once-per-second interrupt. +The third +.BR ioctl (2) +argument is ignored. +.TP +.BR RTC_PIE_ON ", " RTC_PIE_OFF +Enable or disable the periodic interrupt, +for RTCs that support these periodic interrupts. +The third +.BR ioctl (2) +argument is ignored. +Only a privileged process (i.e., one having the +.B CAP_SYS_RESOURCE +capability) can enable the periodic interrupt if the frequency is +currently set above the value specified in +.IR /proc/sys/dev/rtc/max-user-freq . +.TP +.BR RTC_EPOCH_READ ", " RTC_EPOCH_SET +Many RTCs encode the year in an 8-bit register which is either +interpreted as an 8-bit binary number or as a BCD number. +In both cases, +the number is interpreted relative to this RTC's Epoch. +The RTC's Epoch is +initialized to 1900 on most systems but on Alpha and MIPS it might +also be initialized to 1952, 1980, or 2000, depending on the value of +an RTC register for the year. +With some RTCs, +these operations can be used to read or to set the RTC's Epoch, +respectively. +The third +.BR ioctl (2) +argument is a +.I "unsigned long\ *" +or a +.IR "unsigned long" , +respectively, and the value returned (or assigned) is the Epoch. +To set the RTC's Epoch the process must be privileged (i.e., have the +.B CAP_SYS_TIME +capability). +.TP +.BR RTC_WKALM_RD ", " RTC_WKALM_SET +Some RTCs support a more powerful alarm interface, using these ioctls +to read or write the RTC's alarm time (respectively) with this structure: +.PP +.RS +.in +4n +.nf +struct rtc_wkalrm { + unsigned char enabled; + unsigned char pending; + struct rtc_time time; +}; +.fi +.in +.RE +.IP +The +.I enabled +flag is used to enable or disable the alarm interrupt, +or to read its current status; when using these calls, +.BR RTC_AIE_ON " and " RTC_AIE_OFF +are not used. +The +.I pending +flag is used by +.B RTC_WKALM_RD +to report a pending interrupt +(so it's mostly useless on Linux, except when talking +to the RTC managed by EFI firmware). +The +.I time +field is as used with +.B RTC_ALM_READ +and +.B RTC_ALM_SET +except that the +.IR tm_mday , +.IR tm_mon , +and +.I tm_year +fields are also valid. +A pointer to this structure should be passed as the third +.BR ioctl (2) +argument. +.SH FILES +.IR /dev/rtc ", " +.IR /dev/rtc0 ", " +.IR /dev/rtc1 ", " +etc: RTC special character device files. + +.IR /proc/driver/rtc : +status of the (first) RTC. +.SH NOTES +When the kernel's system time is synchronized with an external +reference using +.BR adjtimex (2) +it will update a designated RTC periodically every 11 minutes. +To do so, the kernel has to briefly turn off periodic interrupts; +this might affect programs using that RTC. + +An RTC's Epoch has nothing to do with the POSIX Epoch which is only +used for the system clock. + +If the year according to the RTC's Epoch and the year register is +less than 1970 it is assumed to be 100 years later, that is, between 2000 +and 2069. + +Some RTCs support "wildcard" values in alarm fields, to support +scenarios like periodic alarms at fifteen minutes after every hour, +or on the first day of each month. +Such usage is nonportable; +portable user space code only expects a single alarm interrupt, and +will either disable or reinitialize the alarm after receiving it. + +Some RTCs support periodic interrupts with periods that are multiples +of a second rather than fractions of a second; +multiple alarms; +programmable output clock signals; +nonvolatile memory; +and other hardware +capabilities that are not currently exposed by this API. +.SH "SEE ALSO" +.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), +/usr/src/linux/Documentation/rtc.txt diff --git a/original/man4/sd.4 b/original/man4/sd.4 new file mode 100644 index 00000000..2c459cfd --- /dev/null +++ b/original/man4/sd.4 @@ -0,0 +1,135 @@ +.\" sd.4 +.\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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. +.\" +.TH SD 4 1992-12-17 "Linux" "Linux Programmer's Manual" +.SH NAME +sd \- Driver for SCSI Disk Drives +.SH SYNOPSIS +.nf +.BR "#include " "/* for HDIO_GETGEO */" +.BR "#include " "/* for BLKGETSIZE and BLKRRPART */" +.fi +.SH CONFIGURATION +The block device name has the following form: +.BI sd lp, +where +.I l +is a letter denoting the physical drive, and +.I p +is a number denoting the partition on that physical drive. +Often, the partition number, +.IR p , +will be left off when the device corresponds to the whole drive. + +SCSI disks have a major device number of 8, and a minor device number of +the form (16 * +.IR drive_number ") + " partition_number , +where +.I drive_number +is the number of the physical drive in order of detection, and +.I partition_number +is as follows: +.sp +partition 0 is the whole drive +.br +partitions 1-4 are the DOS "primary" partitions +.br +partitions 5-8 are the DOS "extended" (or "logical") partitions + +For example, +.I /dev/sda +will have major 8, minor 0, and will refer to all of the first SCSI drive +in the system; and +.I /dev/sdb3 +will have major 8, minor 19, and will refer to the third DOS "primary" +partition on the second SCSI drive in the system. + +At this time, only block devices are provided. +Raw devices have not yet been implemented. +.SH DESCRIPTION +The following +.IR ioctl s +are provided: +.TP +.B HDIO_GETGEO +.RS +Returns the BIOS disk parameters in the following structure: +.in +4n +.nf + +struct hd_geometry { + unsigned char heads; + unsigned char sectors; + unsigned short cylinders; + unsigned long start; +}; +.fi +.in + +A pointer to this structure is passed as the +.BR ioctl (2) +parameter. + +The information returned in the parameter is the disk geometry of the drive +.I "as understood by DOS!" +This geometry is +.I not +the physical geometry of the drive. +It is used when constructing the +drive's partition table, however, and is needed for convenient operation +of +.BR fdisk (1), +.BR efdisk (1), +and +.BR lilo (1). +If the geometry information is not available, zero will be returned for all +of the parameters. +.RE +.TP +.B BLKGETSIZE +Returns the device size in sectors. +The +.BR ioctl (2) +parameter should be a pointer to a +.IR long . +.TP +.B BLKRRPART +Forces a reread of the SCSI disk partition tables. +No parameter is needed. + +The +.BR scsi (4) +.BR ioctl (2) +operations are also supported. +If the +.BR ioctl (2) +parameter is required, and it is NULL, then +.BR ioctl (2) +will fail with the error +.BR EINVAL . +.SH FILES +/dev/sd[a\-h]: the whole device +.br +/dev/sd[a\-h][0\-8]: individual block partitions +.\".SH "SEE ALSO" +.\".BR scsi (4) diff --git a/original/man4/sk98lin.4 b/original/man4/sk98lin.4 new file mode 100644 index 00000000..58d9ab47 --- /dev/null +++ b/original/man4/sk98lin.4 @@ -0,0 +1,605 @@ +.\" (C)Copyright 1999-2003 Marvell(R) -- linux@syskonnect.de +.\" sk98lin.4 1.1 2003/12/17 10:03:18 +.\" This manpage can be viewed using `groff -Tascii -man sk98lin.4 | less` +.\" +.\" 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. +.\" +.TH SK98LIN 4 2007-11-25 "Linux" "Linux Programmer's Manual" +.SH NAME +sk98lin \- Marvell/SysKonnect Gigabit Ethernet driver v6.21 +.SH SYNOPSIS +.B insmod sk98lin.o +.RB [ Speed_A=\c +.IR i,j,... ] +.RB [ Speed_B=\c +.IR i,j,... ] +.RB [ AutoNeg_A=\c +.IR i,j,... ] +.RB [ AutoNeg_B=\c +.IR i,j,... ] +.RB [ DupCap_A=\c +.IR i,j,... ] +.RB [ DupCap_B=\c +.IR i,j,... ] +.RB [ FlowCtrl_A=\c +.IR i,j,... ] +.RB [ FlowCtrl_B=\c +.IR i,j,... ] +.RB [ Role_A=\c +.IR i,j,... ] +.RB [ Role_B=\c +.IR i,j,... ] +.RB [ ConType=\c +.IR i,j,... ] +.RB [ Moderation=\c +.IR i,j,... ] +.RB [ IntsPerSec=\c +.IR i,j,... ] +.RB [ PrefPort=\c +.IR i,j,... ] +.RB [ RlmtMode=\c +.IR i,j,... ] +.SH DESCRIPTION +.ad l +.hy 0 +.B sk98lin +is the Gigabit Ethernet driver for +Marvell and SysKonnect network adapter cards. +It supports SysKonnect SK-98xx/SK-95xx +compliant Gigabit Ethernet Adapter and +any Yukon compliant chipset. + +When loading the driver using insmod, +parameters for the network adapter cards +might be stated as a sequence of comma separated commands. +If for instance two network adapters are installed and AutoNegotiation on +Port A of the first adapter should be ON, +but on the Port A of the second adapter switched OFF, one must enter: + + insmod sk98lin.o AutoNeg_A=On,Off + +After +.B sk98lin +is bound to one or more adapter cards and the +.I /proc +file system is mounted on your system, a dedicated statistics file +will be created in folder +.I /proc/net/sk98lin +for all ports of the installed network adapter cards. +Those files are named +.I eth[x] +whereas +.I x +is the number of the interface that has been assigned to a +dedicated port by the system. + +If loading is finished, any desired IP address can be +assigned to the respective +.I eth[x] +interface using the +.BR ifconfig (8) +command. +This causes the adapter to connect to the Ethernet and to display a status +message on the console saying "ethx: network connection up using port y" +followed by the configured or detected connection parameters. + +The +.B sk98lin +also supports large frames (also called jumbo frames). +Using jumbo frames can improve throughput tremendously when +transferring large amounts of data. +To enable large frames, the MTU (maximum transfer unit) size +for an interface is to be set to a high value. +The default MTU size is 1500 and can be changed up to 9000 (bytes). +Setting the MTU size can be done when assigning the IP address +to the interface or later by using the +.BR ifconfig (8) +command with the mtu parameter. +If for instance eth0 needs an IP +address and a large frame MTU size, +the following two commands might be used: + + ifconfig eth0 10.1.1.1 + ifconfig eth0 mtu 9000 + +Those two commands might even be combined into one: + + ifconfig eth0 10.1.1.1 mtu 9000 + +Note that large frames can only be used if permitted by +your network infrastructure. +This means, that any switch being used in your Ethernet must +also support large frames. +Quite some switches support large frames, +but need to be configured to do so. +Most of the times, their default setting is to support only +standard frames with an MTU size of 1500 (bytes). +In addition to the switches inside the network, +all network adapters that are to be used must also be +enabled regarding jumbo frames. +If an adapter is not set to receive large frames it will simply drop them. + +Switching back to the standard Ethernet frame size can be done by using the +.BR ifconfig (8) +command again: + + ifconfig eth0 mtu 1500 + +The Marvell/SysKonnect Gigabit Ethernet driver for Linux is able to +support VLAN and Link Aggregation according to +IEEE standards 802.1, 802.1q, and 802.3ad. +Those features are only available after installation of open source modules +which can be found on the Internet: + +.IR VLAN \c +: http://www.candelatech.com/~greear/vlan.html +.br +.I Link +.IR Aggregation \c +: http://www.st.rim.or.jp/~yumo + +.br +Note that Marvell/SysKonnect does not offer any support for these +open source modules and does not take the responsibility for any +kind of failures or problems arising when using these modules. +.SS Parameters +.TP +.BI Speed_A= i,j,... +This parameter is used to set the speed capabilities of port A of an +adapter card. +It is only valid for Yukon copper adapters. +Possible values are: +.IR 10 , +.IR 100 , +.I 1000 +or +.I Auto +whereas +.I Auto +is the default. +Usually, the speed is negotiated between the two ports +during link establishment. +If this fails, +a port can be forced to a specific setting with this parameter. +.TP +.BI Speed_B= i,j,... +This parameter is used to set the speed capabilities of port B of +an adapter card. +It is only valid for Yukon copper adapters. +Possible values are: +.IR 10 , +.IR 100 , +.I 1000 +or +.I Auto +whereas +.I Auto +is the default. +Usually, the speed is negotiated between the two ports during link +establishment. +If this fails, +a port can be forced to a specific setting with this parameter. +.TP +.BI AutoNeg_A= i,j,... +Enables or disables the use of autonegotiation of port A of an adapter card. +Possible values are: +.IR On , +.I Off +or +.I Sense +whereas +.I On +is the default. +The +.I Sense +mode automatically detects whether the link partner supports +auto-negotiation or not. +.TP +.BI AutoNeg_B= i,j,... +Enables or disables the use of autonegotiation of port B of an adapter card. +Possible values are: +.IR On , +.I Off +or +.I Sense +whereas +.I On +is the default. +The +.I Sense +mode automatically detects whether the link partner supports +auto-negotiation or not. +.TP +.BI DupCap_A= i,j,... +This parameter indicates the duplex mode to be used for port A +of an adapter card. +Possible values are: +.IR Half , +.I Full +or +.I Both +whereas +.I Both +is the default. +This parameter is only relevant if AutoNeg_A of port A is not set to +.IR Sense . +If AutoNeg_A is set to +.IR On , +all three values of DupCap_A ( +.IR Half , +.I Full +or +.IR Both ) +might be stated. +If AutoNeg_A is set to +.IR Off , +only DupCap_A values +.I Full +and +.I Half +are allowed. +This DupCap_A parameter is useful if your link partner does not +support all possible duplex combinations. +.TP +.BI DupCap_B= i,j,... +This parameter indicates the duplex mode to be used for port B +of an adapter card. +Possible values are: +.IR Half , +.I Full +or +.I Both +whereas +.I Both +is the default. +This parameter is only relevant if AutoNeg_B of port B is not set to +.IR Sense . +If AutoNeg_B is set to +.IR On , +all three values of DupCap_B ( +.IR Half , +.I Full +or +.IR Both ) +might be stated. +If AutoNeg_B is set to +.IR Off , +only DupCap_B values +.I Full +and +.I Half +are allowed. +This DupCap_B parameter is useful if your link partner does not +support all possible duplex combinations. +.TP +.BI FlowCtrl_A= i,j,... +This parameter can be used to set the flow control capabilities the +port reports during auto-negotiation. +Possible values are: +.IR Sym , +.IR SymOrRem , +.I LocSend +or +.I None +whereas +.I SymOrRem +is the default. +The different modes have the following meaning: + +.br +.I Sym += Symmetric + both link partners are allowed to send PAUSE frames +.br +.I SymOrRem += SymmetricOrRemote + both or only remote partner are allowed to send PAUSE frames +.br +.I LocSend += LocalSend + only local link partner is allowed to send PAUSE frames +.br +.I None += None + no link partner is allowed to send PAUSE frames + +Note that this parameter is ignored if AutoNeg_A is set to +.IR Off . +.TP +.BI FlowCtrl_B= i,j,... +This parameter can be used to set the flow control capabilities the +port reports during auto-negotiation. +Possible values are: +.IR Sym , +.IR SymOrRem , +.I LocSend +or +.I None +whereas +.I SymOrRem +is the default. +The different modes have the following meaning: + +.I Sym += Symmetric + both link partners are allowed to send PAUSE frames +.br +.I SymOrRem += SymmetricOrRemote + both or only remote partner are allowed to send PAUSE frames +.br +.I LocSend += LocalSend + only local link partner is allowed to send PAUSE frames +.br +.I None += None + no link partner is allowed to send PAUSE frames +.br + +Note that this parameter is ignored if AutoNeg_B is set to +.IR Off . +.TP +.BI Role_A= i,j,... +This parameter is only valid for 1000Base-T adapter cards. +For two 1000Base-T ports to communicate, +one must take the role of the master (providing timing information), +while the other must be the slave. +Possible values are: +.IR Auto , +.I Master +or +.I Slave +whereas +.I Auto +is the default. +Usually, the role of a port is negotiated between two ports during +link establishment, but if that fails the port A of an adapter card +can be forced to a specific setting with this parameter. +.TP +.BI Role_B= i,j,... +This parameter is only valid for 1000Base-T adapter cards. +For two 1000Base-T ports to communicate, one must take +the role of the master (providing timing information), +while the other must be the slave. +Possible values are: +.IR Auto , +.I Master +or +.I Slave +whereas +.I Auto +is the default. +Usually, the role of a port is negotiated between +two ports during link establishment, but if that fails +the port B of an adapter card can be forced to a +specific setting with this parameter. +.TP +.BI ConType= i,j,... +This parameter is a combination of all five per-port parameters +within one single parameter. +This simplifies the configuration of both ports of an adapter card. +The different values of this variable reflect the +most meaningful combinations of port parameters. +Possible values and their corresponding combination of per-port parameters: + +.nf +ConType | DupCap AutoNeg FlowCtrl Role Speed +--------+------------------------------------------- +\fIAuto\fP | Both On SymOrRem Auto Auto +.br +\fI100FD\fP | Full Off None Auto 100 +.br +\fI100HD\fP | Half Off None Auto 100 +.br +\fI10FD\fP | Full Off None Auto 10 +.br +\fI10HD\fP | Half Off None Auto 10 + +.fi +Stating any other port parameter together with this +.I ConType +parameter will result in a merged configuration of those settings. +This is due to +the fact, that the per-port parameters (e.g. +.IR Speed_A ) +have a higher priority than the combined variable +.IR ConType . +.TP +.BI Moderation= i,j,... +Interrupt moderation is employed to limit the maximum number of interrupts +the driver has to serve. +That is, one or more interrupts (which indicate any transmit or +receive packet to be processed) are queued until the driver processes them. +When queued interrupts are to be served, is determined by the +.I IntsPerSec +parameter, which is explained later below. +Possible moderation modes are: +.IR None , +.I Static +or +.I Dynamic +whereas +.I None +is the default. +The different modes have the following meaning: + +.I None +No interrupt moderation is applied on the adapter card. +Therefore, each transmit or receive interrupt is served immediately +as soon as it appears on the interrupt line of the adapter card. + +.br +.I Static +Interrupt moderation is applied on the adapter card. +All transmit and receive interrupts are queued until +a complete moderation interval ends. +If such a moderation interval ends, all queued interrupts +are processed in one big bunch without any delay. +The term +.I Static +reflects the fact, that interrupt moderation is always enabled, +regardless how much network load is currently passing via a +particular interface. +In addition, the duration of the moderation interval has a fixed +length that never changes while the driver is operational. + +.br +.I Dynamic +Interrupt moderation might be applied on the adapter card, +depending on the load of the system. +If the driver detects that the system load is too high, +the driver tries to shield the system against too much network +load by enabling interrupt moderation. +If \(em at a later time \(em the CPU utilization decreases +again (or if the network load is negligible) the interrupt +moderation will automatically be disabled. + +Interrupt moderation should be used when the driver has to +handle one or more interfaces with a high network load, +which \(em as a consequence \(em leads also to a high CPU utilization. +When moderation is applied in such high network load situations, +CPU load might be reduced by 20-30% on slow computers. + +Note that the drawback of using interrupt moderation is an increase of +the round-trip-time (RTT), due to the queuing and serving of +interrupts at dedicated moderation times. +.TP +.BI IntsPerSec= i,j,... +This parameter determines the length of any interrupt moderation interval. +Assuming that static interrupt moderation is to be used, an +.I IntsPerSec +parameter value of 2000 will lead to an interrupt moderation interval of +500 microseconds. +Possible values for this parameter are in the range of +30...40000 (interrupts per second). +The default value is 2000. + +This parameter is only used, if either static or dynamic interrupt moderation +is enabled on a network adapter card. +This parameter is ignored if no moderation is applied. + +Note that the duration of the moderation interval is to be chosen with care. +At first glance, selecting a very long duration (e.g., only 100 interrupts per +second) seems to be meaningful, but the increase of packet-processing delay +is tremendous. +On the other hand, selecting a very short moderation time might +compensate the use of any moderation being applied. +.TP +.BI PrefPort= i,j,... +This parameter is used to force the preferred port to +A or B (on dual-port network adapters). +The preferred port is the one that is used if both ports A and B are +detected as fully functional. +Possible values are: +.I A +or +.I B +whereas +.I A +is the default. +.TP +.BI RlmtMode= i,j,... +RLMT monitors the status of the port. +If the link of the active port fails, +RLMT switches immediately to the standby link. +The virtual link is maintained as long as at least one "physical" link is up. +This parameters states how RLMT should monitor both ports. +Possible values are: +.IR CheckLinkState , +.IR CheckLocalPort , +.I CheckSeg +or +.I DualNet +whereas +.I CheckLinkState +is the default. +The different modes have the following meaning: + +.I CheckLinkState +Check link state only: RLMT uses the link state reported by the adapter +hardware for each individual port to determine whether a port can be used +for all network traffic or not. + +.br +.I CheckLocalPort +In this mode, RLMT monitors the network path between the two +ports of an adapter by regularly exchanging packets between them. +This mode requires a network configuration in which the +two ports are able to "see" each other (i.e., there +must not be any router between the ports). + +.br +.I CheckSeg +Check local port and segmentation: +This mode supports the same functions as the CheckLocalPort +mode and additionally checks network segmentation between the ports. +Therefore, this mode is only to be used if Gigabit Ethernet +switches are installed on the network that have been +configured to use the Spanning Tree protocol. + +.br +.I DualNet +In this mode, ports A and B are used as separate devices. +If you have a dual port adapter, port A will be configured as +.IR eth[x] +and port B as +.IR eth[x+1] . +Both ports can be used independently with distinct IP addresses. +The preferred port setting is not used. +RLMT is turned off. + +Note that RLMT modes +.I CheckLocalPort +and +.I CheckLinkState +are designed to operate in configurations where a +network path between the ports on one adapter exists. +Moreover, they are not designed to work where adapters are +connected back-to-back. +.SH FILES +.TP +.I /proc/net/sk98lin/eth[x] +.br +The statistics file of a particular interface of an adapter card. +It contains generic information about the adapter card plus a detailed +summary of all transmit and receive counters. +.TP +.I /usr/src/linux/Documentation/networking/sk98lin.txt +.br +This is the +.I README +file of the +.I sk98lin +driver. +It contains a detailed installation HOWTO and describes all parameters +of the driver. +It denotes also common problems and provides the solution to them. +.SH BUGS +Report any bugs to linux@syskonnect.de +.\" .SH AUTHORS +.\" Ralph Roesler \(em rroesler@syskonnect.de +.\" .br +.\" Mirko Lindner \(em mlindner@syskonnect.de +.SH "SEE ALSO" +.BR ifconfig (8), +.BR insmod (8), +.BR modprobe (8) diff --git a/original/man4/st.4 b/original/man4/st.4 new file mode 100644 index 00000000..64478348 --- /dev/null +++ b/original/man4/st.4 @@ -0,0 +1,959 @@ +.\" Copyright 1995 Robert K. Nichols (Robert.K.Nichols@att.com) +.\" Copyright 1999-2005 Kai Mäkisara (Kai.Makisara@kolumbus.fi) +.\" +.\" 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. +.TH ST 4 2007-12-16 "Linux" "Linux Programmer's Manual" +.SH NAME +st \- SCSI tape device +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int ioctl(int " fd ", int " request " [, (void *)" arg3 "]);" +.BI "int ioctl(int " fd ", MTIOCTOP, (struct mtop *)" mt_cmd ); +.BI "int ioctl(int " fd ", MTIOCGET, (struct mtget *)" mt_status ); +.BI "int ioctl(int " fd ", MTIOCPOS, (struct mtpos *)" mt_pos ); +.fi +.SH DESCRIPTION +The +.B st +driver provides the interface to a variety of SCSI tape devices. +Currently, the driver takes control of all detected devices of type +\(lqsequential-access\(rq. +The +.B st +driver uses major device number 9. +.PP +Each device uses eight minor device numbers. +The lowermost five bits +in the minor numbers are assigned sequentially in the order of +detection. +In the 2.6 kernel, the bits above the eight lowermost bits are +concatenated to the five lowermost bits to form the tape number. +The minor numbers can be grouped into +two sets of four numbers: the principal (auto-rewind) minor device numbers, +.IR n , +and the \(lqno-rewind\(rq device numbers, +.RI ( n " + 128)." +Devices opened using the principal device number will be sent a +.BR REWIND +command when they are closed. +Devices opened using the \(lqno-rewind\(rq device number will not. +(Note that using an auto-rewind device for positioning the tape with, +for instance, mt does not lead to the desired result: the tape is +rewound after the mt command and the next command starts from the +beginning of the tape). +.PP +Within each group, four minor numbers are available to define +devices with different characteristics (block size, compression, +density, etc.) +When the system starts up, only the first device is available. +The other three are activated when the default +characteristics are defined (see below). +(By changing compile-time +constants, it is possible to change the balance between the maximum +number of tape drives and the number of minor numbers for each +drive. +The default allocation allows control of 32 tape drives. +For instance, it is possible to control up to 64 tape drives +with two minor numbers for different options.) +.PP +Devices are typically created by: +.in +4n +.nf + +mknod \-m 666 /dev/st0 c 9 0 +mknod \-m 666 /dev/st0l c 9 32 +mknod \-m 666 /dev/st0m c 9 64 +mknod \-m 666 /dev/st0a c 9 96 +mknod \-m 666 /dev/nst0 c 9 128 +mknod \-m 666 /dev/nst0l c 9 160 +mknod \-m 666 /dev/nst0m c 9 192 +mknod \-m 666 /dev/nst0a c 9 224 +.fi +.in +.PP +There is no corresponding block device. +.PP +The driver uses an internal buffer that has to be large enough to hold +at least one tape block. +In kernels before 2.1.121, the buffer is +allocated as one contiguous block. +This limits the block size to the +largest contiguous block of memory the kernel allocator can provide. +The limit is currently 128 kB for 32-bit architectures and +256 kB for 64-bit architectures. +In newer kernels the driver +allocates the buffer in several parts if necessary. +By default, the +maximum number of parts is 16. +This means that the maximum block size +is very large (2 MB if allocation of 16 blocks of 128 kB succeeds). +.PP +The driver's internal buffer size is determined by a compile-time +constant which can be overridden with a kernel startup option. +In addition to this, the driver tries to allocate a larger temporary +buffer at run time if necessary. +However, run-time allocation of large +contiguous blocks of memory may fail and it is advisable not to rely +too much on dynamic buffer allocation with kernels older than 2.1.121 +(this applies also to demand-loading the driver with kerneld or kmod). +.PP +The driver does not specifically support any tape drive brand or +model. +After system start-up the tape device options are defined by +the drive firmware. +For example, if the drive firmware selects fixed-block mode, +the tape device uses fixed-block mode. +The options can +be changed with explicit +.BR ioctl (2) +calls and remain in effect when the device is closed and reopened. +Setting the options affects both the auto-rewind and the nonrewind +device. +.PP +Different options can be specified for the different devices within +the subgroup of four. +The options take effect when the device is +opened. +For example, the system administrator can define +one device that writes in fixed-block mode with a certain block size, +and one which writes in variable-block mode (if the drive supports +both modes). +.PP +The driver supports +.B tape partitions +if they are supported by the drive. +(Note that the tape partitions +have nothing to do with disk partitions. +A partitioned tape can be +seen as several logical tapes within one medium.) +Partition support has to be enabled with an +.BR ioctl (2). +The tape +location is preserved within each partition across partition changes. +The partition used for subsequent tape operations is +selected with an +.BR ioctl (2). +The partition switch is executed together with +the next tape operation in order to avoid unnecessary tape +movement. +The maximum number of partitions on a tape is defined by a +compile-time constant (originally four). +The driver contains an +.BR ioctl (2) +that can format a tape with either one or two partitions. +.PP +Device +.I /dev/tape +is usually created as a hard or soft link to the default tape device +on the system. +.PP +Starting from kernel 2.6.2, the driver exports in the sysfs directory +.I /sys/class/scsi_tape +the attached devices and some parameters assigned to the devices. +.SS "Data Transfer" +The driver supports operation in both fixed-block mode and +variable-block mode (if supported by the drive). +In fixed-block mode the drive +writes blocks of the specified size and the block size is not +dependent on the byte counts of the write system calls. +In variable-block mode one tape block is written for each write call +and the byte +count determines the size of the corresponding tape block. +Note that +the blocks on the tape don't contain any information about the +writing mode: when reading, the only important thing is to use +commands that accept the block sizes on the tape. +.PP +In variable-block mode the read byte count does not have to match +the tape block size exactly. +If the byte count is larger than the +next block on tape, the driver returns the data and the function +returns the actual block size. +If the block size is larger than the +byte count, the requested amount of data from the start of the block +is returned and the rest of the block is discarded. +.PP +In fixed-block mode the read byte counts can be arbitrary if +buffering is enabled, or a multiple of the tape block size if +buffering is disabled. +Kernels before 2.1.121 allow writes with +arbitrary byte count if buffering is enabled. +In all other cases +(kernel before 2.1.121 with buffering disabled or newer kernel) the +write byte count must be a multiple of the tape block size. +.PP +In the 2.6 kernel, the driver tries to use direct transfers between the user +buffer and the device. +If this is not possible, the driver's internal buffer +is used. +The reasons for not using direct transfers include improper alignment +of the user buffer (default is 512 bytes but this can be changed by the HBA +driver), one of more pages of the user buffer not reachable by the +SCSI adapter, etc. +.PP +A filemark is automatically written to tape if the last tape operation +before close was a write. +.PP +When a filemark is encountered while reading, the following +happens. +If there are data remaining in the buffer when the filemark +is found, the buffered data is returned. +The next read returns zero +bytes. +The following read returns data from the next file. +The end of +recorded data is signaled by returning zero bytes for two consecutive +read calls. +The third read returns an error. +.SS Ioctls +The driver supports three +.BR ioctl (2) +requests. +Requests not recognized by the +.B st +driver are passed to the +.B SCSI +driver. +The definitions below are from +.IR /usr/include/linux/mtio.h : +.SS "MTIOCTOP \(em Perform a tape operation" +.PP +This request takes an argument of type +.IR "(struct mtop *)" . +Not all drives support all operations. +The driver returns an +.B EIO +error if the drive rejects an operation. +.PP +.in +4n +.nf +/* Structure for MTIOCTOP \- mag tape op command: */ +struct mtop { + short mt_op; /* operations defined below */ + int mt_count; /* how many of them */ +}; +.fi +.in +.PP +Magnetic Tape operations for normal tape use: +.TP 14 +.B MTBSF +Backward space over +.I mt_count +filemarks. +.TP +.B MTBSFM +Backward space over +.I mt_count +filemarks. +Reposition the tape to the EOT side of the last filemark. +.TP +.B MTBSR +Backward space over +.I mt_count +records (tape blocks). +.TP +.B MTBSS +Backward space over +.I mt_count +setmarks. +.TP +.B MTCOMPRESSION +Enable compression of tape data within the drive if +.I mt_count +is nonzero and disable compression if +.I mt_count +is zero. +This command uses the MODE page 15 supported by most DATs. +.TP +.B MTEOM +Go to the end of the recorded media (for appending files). +.TP +.B MTERASE +Erase tape. +With 2.6 kernel, short erase (mark tape empty) is performed if the +argument is zero. +Otherwise long erase (erase all) is done. +.TP +.B MTFSF +Forward space over +.I mt_count +filemarks. +.TP +.B MTFSFM +Forward space over +.I mt_count +filemarks. +Reposition the tape to the BOT side of the last filemark. +.TP +.B MTFSR +Forward space over +.I mt_count +records (tape blocks). +.TP +.B MTFSS +Forward space over +.I mt_count +setmarks. +.TP +.B MTLOAD +Execute the SCSI load command. +A special case is available for some HP +autoloaders. +If +.I mt_count +is the constant +.B MT_ST_HPLOADER_OFFSET +plus a number, the number is +sent to the drive to control the autoloader. +.TP +.B MTLOCK +Lock the tape drive door. +.TP +.B MTMKPART +Format the tape into one or two partitions. +If +.I mt_count +is nonzero, it gives the size of the first partition and the second +partition contains the rest of the tape. +If +.I mt_count +is zero, the tape is formatted into one partition. +This command is not allowed for a drive unless the partition support +is enabled for the drive (see +.BR MT_ST_CAN_PARTITIONS +below). +.TP +.B MTNOP +No op \(em flushes the driver's buffer as a side effect. +Should be used before reading status with +.BR MTIOCGET . +.TP +.B MTOFFL +Rewind and put the drive off line. +.TP +.B MTRESET +Reset drive. +.TP +.B MTRETEN +Re-tension tape. +.TP +.B MTREW +Rewind. +.TP +.B MTSEEK +Seek to the tape block number specified in +.IR mt_count . +This operation requires either a SCSI-2 drive that supports the +.B LOCATE +command (device-specific address) +or a Tandberg-compatible SCSI-1 drive (Tandberg, Archive +Viper, Wangtek, ...). +The block number should be one that was previously returned by +.BR MTIOCPOS +if device-specific addresses are used. +.TP +.B MTSETBLK +Set the drive's block length to the value specified in +.IR mt_count . +A block length of zero sets the drive to variable block size mode. +.TP +.B MTSETDENSITY +Set the tape density to the code in +.IR mt_count . +The density codes supported by a drive can be found from the drive +documentation. +.TP +.B MTSETPART +The active partition is switched to +.IR mt_count . +The partitions are numbered from zero. +This command is not allowed for +a drive unless the partition support is enabled for the drive (see +.B MT_ST_CAN_PARTITIONS +below). +.TP +.B MTUNLOAD +Execute the SCSI unload command (does not eject the tape). +.TP +.B MTUNLOCK +Unlock the tape drive door. +.TP +.B MTWEOF +Write +.I mt_count +filemarks. +.TP +.B MTWSM +Write +.I mt_count +setmarks. +.PP +Magnetic Tape operations for setting of device options (by the superuser): +.TP 8 +.B MTSETDRVBUFFER +Set various drive and driver options according to bits encoded in +.IR mt_count . +These consist of the drive's buffering mode, a set of Boolean driver +options, the buffer write threshold, defaults for the block size and +density, and timeouts (only in kernels 2.1 and later). +A single operation can affect only one item in the list above (the +Booleans counted as one item.) +.IP +A value having zeros in the high-order 4 bits will be used to set the +drive's buffering mode. +The buffering modes are: +.RS 12 +.IP 0 4 +The drive will not report +.BR GOOD +status on write commands until the data +blocks are actually written to the medium. +.IP 1 +The drive may report +.BR GOOD +status on write commands as soon as all the +data has been transferred to the drive's internal buffer. +.IP 2 +The drive may report +.BR GOOD +status on write commands as soon as (a) all +the data has been transferred to the drive's internal buffer, and +(b) all buffered data from different initiators has been successfully +written to the medium. +.RE +.IP +To control the write threshold the value in +.I mt_count +must include the constant +.BR MT_ST_WRITE_THRESHOLD +logically ORed with a block count in the low 28 bits. +The block count refers to 1024-byte blocks, not the physical block +size on the tape. +The threshold cannot exceed the driver's internal buffer size (see +DESCRIPTION, above). +.IP +To set and clear the Boolean options +the value in +.I mt_count +must include one of the constants +.BR MT_ST_BOOLEANS , +.BR MT_ST_SETBOOLEANS , +.BR MT_ST_CLEARBOOLEANS , +or +.BR MT_ST_DEFBOOLEANS +logically or'ed with +whatever combination of the following options is desired. +Using +.BR MT_ST_BOOLEANS +the options can be set to the values +defined in the corresponding bits. +With +.BR MT_ST_SETBOOLEANS +the options can be selectively set and with +.BR MT_ST_DEFBOOLEANS +selectively cleared. +.IP "" +The default options for a tape device are set with +.BR MT_ST_DEFBOOLEANS . +A nonactive tape device (e.g., device with +minor 32 or 160) is activated when the default options for it are +defined the first time. +An activated device inherits from the device +activated at start-up the options not set explicitly. +.IP "" +The Boolean options are: +.RS +.TP +.BR MT_ST_BUFFER_WRITES " (Default: true)" +Buffer all write operations in fixed-block mode. +If this option is false and the drive uses a fixed block size, then +all write operations must be for a multiple of the block size. +This option must be set false to write reliable multivolume archives. +.BR MT_ST_ASYNC_WRITES " (Default: true)" +When this option is true, write operations return immediately without +waiting for the data to be transferred to the drive if the data fits +into the driver's buffer. +The write threshold determines how full the buffer must be before a +new SCSI write command is issued. +Any errors reported by the drive will be held until the next +operation. +This option must be set false to write reliable multivolume archives. +.TP +.BR MT_ST_READ_AHEAD " (Default: true)" +This option causes the driver to provide read buffering and +read-ahead in fixed-block mode. +If this option is false and the drive uses a fixed block size, then +all read operations must be for a multiple of the block size. +.TP +.BR MT_ST_TWO_FM " (Default: false)" +This option modifies the driver behavior when a file is closed. +The normal action is to write a single filemark. +If the option is true the driver will write two filemarks and +backspace over the second one. +.IP +Note: +This option should not be set true for QIC tape drives since they are +unable to overwrite a filemark. +These drives detect the end of recorded data by testing for blank tape +rather than two consecutive filemarks. +Most other current drives also +detect the end of recorded data and using two filemarks is usually +necessary only when interchanging tapes with some other systems. +.TP +.BR MT_ST_DEBUGGING " (Default: false)" +This option turns on various debugging messages from the driver +(effective only if the driver was compiled with +.B DEBUG +defined nonzero). +.TP +.BR MT_ST_FAST_EOM " (Default: false)" +This option causes the +.B MTEOM +operation to be sent directly to the +drive, potentially speeding up the operation but causing the driver to +lose track of the current file number normally returned by the +.B MTIOCGET +request. +If +.B MT_ST_FAST_EOM +is false the driver will respond to an +.B MTEOM +request by forward spacing over files. +.TP +.BR MT_ST_AUTO_LOCK " (Default: false)" +When this option is true, the drive door is locked when the device is +opened and unlocked when it is closed. +.TP +.BR MT_ST_DEF_WRITES " (Default: false)" +The tape options (block size, mode, compression, etc.) may change +when changing from one device linked to a drive to another device +linked to the same drive depending on how the devices are +defined. +This option defines when the changes are enforced by the +driver using SCSI-commands and when the drives auto-detection +capabilities are relied upon. +If this option is false, the driver +sends the SCSI-commands immediately when the device is changed. +If the +option is true, the SCSI-commands are not sent until a write is +requested. +In this case the drive firmware is allowed to detect the +tape structure when reading and the SCSI-commands are used only to +make sure that a tape is written according to the correct specification. +.TP +.BR MT_ST_CAN_BSR " (Default: false)" +When read-ahead is used, the tape must sometimes be spaced backward to the +correct position when the device is closed and the SCSI command to +space backwards over records is used for this purpose. +Some older +drives can't process this command reliably and this option can be used +to instruct the driver not to use the command. +The end result is that, +with read-ahead and fixed-block mode, the tape may not be correctly +positioned within a file when the device is closed. +With 2.6 kernel, the +default is true for drives supporting SCSI-3. +.TP +.BR MT_ST_NO_BLKLIMS " (Default: false)" +Some drives don't accept the +.B "READ BLOCK LIMITS" +SCSI command. +If this is used, the driver does not use the command. +The drawback is +that the driver can't check before sending commands if the selected +block size is acceptable to the drive. +.TP +.BR MT_ST_CAN_PARTITIONS " (Default: false)" +This option enables support for several partitions within a +tape. +The option applies to all devices linked to a drive. +.TP +.BR MT_ST_SCSI2LOGICAL " (Default: false)" +This option instructs the driver to use the logical block addresses +defined in the SCSI-2 standard when performing the seek and tell +operations (both with +.B MTSEEK +and +.B MTIOCPOS +commands and when changing tape +partition). +Otherwise the device-specific addresses are used. +It is highly advisable to set this option if the drive supports the +logical addresses because they count also filemarks. +There are some +drives that only support the logical block addresses. +.TP +.BR MT_ST_SYSV " (Default: false)" +When this option is enabled, the tape devices use the SystemV +semantics. +Otherwise the BSD semantics are used. +The most important +difference between the semantics is what happens when a device used +for reading is closed: in System V semantics the tape is spaced forward +past the next filemark if this has not happened while using the +device. +In BSD semantics the tape position is not changed. +.TP +.BR MT_NO_WAIT " (Default: false)" +Enables immediate mode (i.e., don't wait for the command to finish) for some +commands (e.g., rewind). +.PP +An example: +.in +4n +.nf + +struct mtop mt_cmd; +mt_cmd.mt_op = MTSETDRVBUFFER; +mt_cmd.mt_count = MT_ST_BOOLEANS | + MT_ST_BUFFER_WRITES | MT_ST_ASYNC_WRITES; +ioctl(fd, MTIOCTOP, mt_cmd); +.fi +.in +.RE +.IP "" +The default block size for a device can be set with +.B MT_ST_DEF_BLKSIZE +and the default density code can be set with +.BR MT_ST_DEFDENSITY . +The values for the parameters are or'ed +with the operation code. +.IP "" +With kernels 2.1.x and later, the timeout values can be set with the +subcommand +.B MT_ST_SET_TIMEOUT +ORed with the timeout in seconds. +The long timeout (used for rewinds and other commands +that may take a long time) can be set with +.BR MT_ST_SET_LONG_TIMEOUT . +The kernel defaults are very long to +make sure that a successful command is not timed out with any +drive. +Because of this the driver may seem stuck even if it is only +waiting for the timeout. +These commands can be used to set more +practical values for a specific drive. +The timeouts set for one device +apply for all devices linked to the same drive. +.IP "" +Starting from kernels 2.4.19 and 2.5.43, the driver supports a status +bit which indicates whether the drive requests cleaning. +The method used by the +drive to return cleaning information is set using the +.B MT_ST_SEL_CLN +subcommand. +If the value is zero, the cleaning +bit is always zero. +If the value is one, the TapeAlert data defined +in the SCSI-3 standard is used (not yet implemented). +Values 2-17 are +reserved. +If the lowest eight bits are >= 18, bits from the extended +sense data are used. +The bits 9-16 specify a mask to select the bits +to look at and the bits 17-23 specify the bit pattern to look for. +If the bit pattern is zero, one or more bits under the mask indicate +the cleaning request. +If the pattern is nonzero, the pattern must match +the masked sense data byte. +.SS "MTIOCGET \(em Get status" +.PP +This request takes an argument of type +.IR "(struct mtget *)" . +.PP +.in +4n +.nf +/* structure for MTIOCGET \- mag tape get status command */ +struct mtget { + long mt_type; + long mt_resid; + /* the following registers are device dependent */ + long mt_dsreg; + long mt_gstat; + long mt_erreg; + /* The next two fields are not always used */ + daddr_t mt_fileno; + daddr_t mt_blkno; +}; +.fi +.in +.IP \fImt_type\fP 11 +The header file defines many values for +.IR mt_type , +but the current driver reports only the generic types +.B MT_ISSCSI1 +(Generic SCSI-1 tape) +and +.B MT_ISSCSI2 +(Generic SCSI-2 tape). +.IP \fImt_resid\fP +contains the current tape partition number. +.IP \fImt_dsreg\fP +reports the drive's current settings for block size (in the low 24 +bits) and density (in the high 8 bits). +These fields are defined by +.BR MT_ST_BLKSIZE_SHIFT , +.BR MT_ST_BLKSIZE_MASK , +.BR MT_ST_DENSITY_SHIFT , +and +.BR MT_ST_DENSITY_MASK . +.IP \fImt_gstat\fP +reports generic (device independent) status information. +The header file defines macros for testing these status bits: +.RS +.HP 4 +\fBGMT_EOF\fP(\fIx\fP): +The tape is positioned just after a filemark +(always false after an +.B MTSEEK +operation). +.HP +\fBGMT_BOT\fP(\fIx\fP): +The tape is positioned at the beginning of the first file (always false +after an +.B MTSEEK +operation). +.HP +\fBGMT_EOT\fP(\fIx\fP): +A tape operation has reached the physical End Of Tape. +.HP +\fBGMT_SM\fP(\fIx\fP): +The tape is currently positioned at a setmark +(always false after an +.B MTSEEK +operation). +.HP +\fBGMT_EOD\fP(\fIx\fP): +The tape is positioned at the end of recorded data. +.HP +\fBGMT_WR_PROT\fP(\fIx\fP): +The drive is write-protected. +For some drives this can also mean that the drive does not support +writing on the current medium type. +.HP +\fBGMT_ONLINE\fP(\fIx\fP): +The last +.BR open (2) +found the drive with a tape in place and ready for operation. +.HP +\fBGMT_D_6250\fP(\fIx\fP), \fBGMT_D_1600\fP(\fIx\fP), \fBGMT_D_800\fP(\fIx\fP): +This \(lqgeneric\(rq status information reports the current +density setting for 9-track \(12" tape drives only. +.HP +\fBGMT_DR_OPEN\fP(\fIx\fP): +The drive does not have a tape in place. +.HP +\fBGMT_IM_REP_EN\fP(\fIx\fP): +Immediate report mode. +This bit is set if there are no guarantees that +the data has been physically written to the tape when the write call +returns. +It is set zero only when the driver does not buffer data and +the drive is set not to buffer data. +.HP +\fBGMT_CLN\fP(\fIx\fP): +The drive has requested cleaning. +Implemented in kernels since 2.4.19 and 2.5.43. +.RE +.IP \fImt_erreg\fP +The only field defined in +.I mt_erreg +is the recovered error count in the low 16 bits (as defined by +.BR MT_ST_SOFTERR_SHIFT +and +.BR MT_ST_SOFTERR_MASK . +Due to inconsistencies in the way drives report recovered errors, this +count is often not maintained (most drives do not by default report +soft errors but this can be changed with a SCSI MODE SELECT command). +.IP \fImt_fileno\fP +reports the current file number (zero-based). +This value is set to \-1 when the file number is unknown (e.g., after +.BR MTBSS +or +.BR MTSEEK ). +.IP \fImt_blkno\fP +reports the block number (zero-based) within the current file. +This value is set to \-1 when the block number is unknown (e.g., after +.BR MTBSF , +.BR MTBSS , +or +.BR MTSEEK ). +.SS "MTIOCPOS \(em Get tape position" +.PP +This request takes an argument of type +.I "(struct mtpos *)" +and reports the drive's notion of the current tape block number, +which is not the same as +.I mt_blkno +returned by +.BR MTIOCGET . +This drive must be a SCSI-2 drive that supports the +.B "READ POSITION" +command (device-specific address) +or a Tandberg-compatible SCSI-1 drive (Tandberg, Archive +Viper, Wangtek, ... ). +.PP +.in +4n +.nf +/* structure for MTIOCPOS \- mag tape get position command */ +struct mtpos { + long mt_blkno; /* current block number */ +}; +.fi +.in +.SH "RETURN VALUE" +.TP 14 +.TP +.B EACCES +An attempt was made to write or erase a write-protected tape. +(This error is not detected during +.BR open (2).) +.TP +.B EBUSY +The device is already in use or the driver was unable to allocate a +buffer. +.TP +.B EFAULT +The command parameters point to memory not belonging to the calling +process. +.TP +.B EINVAL +An +.BR ioctl (2) +had an invalid argument, or a requested block size was invalid. +.TP +.B EIO +The requested operation could not be completed. +.TP +.B ENOMEM +The byte count in +.BR read (2) +is smaller than the next physical block on the tape. +(Before 2.2.18 and 2.4.0-test6 the extra bytes have been +silently ignored.) +.TP +.B ENOSPC +A write operation could not be completed because the tape reached +end-of-medium. +.TP +.B ENOSYS +Unknown +.BR ioctl (2). +.TP +.B ENXIO +During opening, the tape device does not exist. +.TP +.B EOVERFLOW +An attempt was made to read or write a variable-length block that is +larger than the driver's internal buffer. +.TP +.B EROFS +Open is attempted with +.B O_WRONLY +or +.B O_RDWR +when the tape in the drive is write-protected. +.SH FILES +.TP 12 +.I /dev/st* +the auto-rewind SCSI tape devices +.TP 12 +.I /dev/nst* +the nonrewind SCSI tape devices +.\" .SH AUTHOR +.\" The driver has been written by Kai M\(:akisara (Kai.Makisara@metla.fi) +.\" starting from a driver written by Dwayne Forsyth. +.\" Several other +.\" people have also contributed to the driver. +.SH NOTES +.IP 1. 4 +When exchanging data between systems, both systems have to agree on +the physical tape block size. +The parameters of a drive after startup +are often not the ones most operating systems use with these +devices. +Most systems use drives in variable-block mode if the drive +supports that mode. +This applies to most modern drives, including +DATs, 8mm helical scan drives, DLTs, etc. +It may be advisable to use +these drives in variable-block mode also in Linux (i.e., use +.B MTSETBLK +or +.B MTSETDEFBLK +at system startup to set the mode), at least when +exchanging data with a foreign system. +The drawback of +this is that a fairly large tape block size has to be used to get +acceptable data transfer rates on the SCSI bus. +.IP 2. +Many programs (e.g., +.BR tar (1)) +allow the user to specify the blocking +factor on the command line. +Note that this determines the physical block +size on tape only in variable-block mode. +.IP 3. +In order to use SCSI tape drives, the basic SCSI driver, +a SCSI-adapter driver and the SCSI tape driver must be either +configured into the kernel or loaded as modules. +If the SCSI-tape +driver is not present, the drive is recognized but the tape support +described in this page is not available. +.IP 4. +The driver writes error messages to the console/log. +The SENSE +codes written into some messages are automatically translated to text +if verbose SCSI messages are enabled in kernel configuration. +.IP 5. +The driver's internal buffering allows good throughput in fixed-block +mode also with small +.BR read (2) +and +.BR write (2) +byte counts. +With direct transfers +this is not possible and may cause a surprise when moving to the 2.6 +kernel. +The solution is to tell the software to use larger transfers (often +telling it to use larger blocks). +If this is not possible, direct transfers can be disabled. +.\" .SH COPYRIGHT +.\" Copyright \(co 1995 Robert K. Nichols. +.\" .br +.\" Copyright \(co 1999-2005 Kai M\(:akisara. +.\" .PP +.\" 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. +.\" Additional permissions are contained in the header of the source file. +.SH "SEE ALSO" +.BR mt (1) +.PP +The file +.I drivers/scsi/README.st +or +.I Documentation/scsi/st.txt +(kernel >= 2.6) in the kernel sources contains +the most recent information about the driver and its configuration +possibilities. diff --git a/original/man4/tty.4 b/original/man4/tty.4 new file mode 100644 index 00000000..c7826ba9 --- /dev/null +++ b/original/man4/tty.4 @@ -0,0 +1,74 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2003-04-07 by Michael Kerrisk +.\" +.TH TTY 4 2003-04-07 "Linux" "Linux Programmer's Manual" +.SH NAME +tty \- controlling terminal +.SH DESCRIPTION +The file \fI/dev/tty\fP is a character file with major number 5 and +minor number 0, usually of mode 0666 and owner.group root.tty. +It is a synonym for the controlling terminal of a process, if any. +.LP +In addition to the +.BR ioctl (2) +requests supported by the device that +\fBtty\fP refers to, the +.BR ioctl (2) +request \fBTIOCNOTTY\fP is supported. +.SS TIOCNOTTY +Detach the calling process from its controlling terminal. +.sp +If the process is the session leader, +then +.B SIGHUP +and +.B SIGCONT +signals are sent to the foreground process group +and all processes in the current session lose their controlling tty. +.sp +This +.BR ioctl (2) +call only works on file descriptors connected +to \fI/dev/tty\fP. +It is used by daemon processes when they are invoked +by a user at a terminal. +The process attempts to open \fI/dev/tty\fP. +If the open succeeds, it +detaches itself from the terminal by using \fBTIOCNOTTY\fP, while if the +open fails, it is obviously not attached to a terminal and does not need +to detach itself. +.SH FILES +/dev/tty +.SH "SEE ALSO" +.BR chown (1), +.BR mknod (1), +.BR ioctl (2), +.BR termios (3), +.BR console (4), +.BR tty_ioctl (4), +.BR ttyS (4), +.BR agetty (8), +.BR mingetty (8) diff --git a/original/man4/ttyS.4 b/original/man4/ttyS.4 new file mode 100644 index 00000000..fc489c9d --- /dev/null +++ b/original/man4/ttyS.4 @@ -0,0 +1,52 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:03:24 1993 by Rik Faith (faith@cs.unc.edu) +.TH TTYS 4 1992-12-19 "Linux" "Linux Programmer's Manual" +.SH NAME +ttyS \- serial terminal lines +.SH DESCRIPTION +\fBttyS[0\-3]\fP are character devices for the serial terminal lines. +.LP +They are typically created by: +.RS +.sp +mknod \-m 660 /dev/ttyS0 c 4 64 # base address 0x3f8 +.br +mknod \-m 660 /dev/ttyS1 c 4 65 # base address 0x2f8 +.br +mknod \-m 660 /dev/ttyS2 c 4 66 # base address 0x3e8 +.br +mknod \-m 660 /dev/ttyS3 c 4 67 # base address 0x2e8 +.br +chown root:tty /dev/ttyS[0\-3] +.RE +.SH FILES +/dev/ttyS[0\-3] +.SH "SEE ALSO" +.BR chown (1), +.BR mknod (1), +.BR tty (4), +.BR agetty (8), +.BR mingetty (8), +.BR setserial (8) diff --git a/original/man4/tty_ioctl.4 b/original/man4/tty_ioctl.4 new file mode 100644 index 00000000..d4f912fc --- /dev/null +++ b/original/man4/tty_ioctl.4 @@ -0,0 +1,492 @@ +.\" Copyright 2002 Walter Harms +.\" and Andries Brouwer . +.\" Distributed under GPL. +.\" +.TH TTY_IOCTL 4 2008-10-29 "Linux" "Linux Programmer's Manual" +.SH NAME +tty_ioctl \- ioctls for terminals and serial lines +.SH SYNOPSIS +.B "#include " +.sp +.BI "int ioctl(int " fd ", int " cmd ", ...);" +.SH DESCRIPTION +The +.BR ioctl () +call for terminals and serial ports accepts many possible command arguments. +Most require a third argument, of varying type, here called \fIargp\fP +or \fIarg\fP. +.LP +Use of +.I ioctl +makes for nonportable programs. +Use the POSIX interface described in +.BR termios (3) +whenever possible. +.SS "Get and Set Terminal Attributes" +.TP +.BI "TCGETS struct termios *" argp +Equivalent to +.IR "tcgetattr(fd, argp)" . +.br +Get the current serial port settings. +.TP +.BI "TCSETS const struct termios *" argp +Equivalent to +.IR "tcsetattr(fd, TCSANOW, argp)" . +.br +Set the current serial port settings. +.TP +.BI "TCSETSW const struct termios *" argp +Equivalent to +.IR "tcsetattr(fd, TCSADRAIN, argp)" . +.br +Allow the output buffer to drain, and +set the current serial port settings. +.TP +.BI "TCSETSF const struct termios *" argp +Equivalent to +.IR "tcsetattr(fd, TCSAFLUSH, argp)" . +.br +Allow the output buffer to drain, discard pending input, and +set the current serial port settings. +.LP +The following four ioctls are just like +.BR TCGETS , +.BR TCSETS , +.BR TCSETSW , +.BR TCSETSF , +except that they take a +.I "struct termio *" +instead of a +.IR "struct termios *" . +.TP +.BI "TCGETA struct termio *" argp +.TP +.BI "TCSETA const struct termio *" argp +.TP +.BI "TCSETAW const struct termio *" argp +.TP +.BI "TCSETAF const struct termio *" argp +.SS "Locking the termios structure" +The +.I termios +structure of a terminal can be locked. +The lock is itself a +.I termios +structure, with nonzero bits or fields indicating a +locked value. +.TP +.BI "TIOCGLCKTRMIOS struct termios *" argp +Gets the locking status of the +.I termios +structure of the terminal. +.TP +.BI "TIOCSLCKTRMIOS const struct termios *" argp +Sets the locking status of the +.I termios +structure of the terminal. +Only root (more precisely: a process with the +.BR CAP_SYS_ADMIN +capability) can do this. +.SS "Get and Set Window Size" +Window sizes are kept in the kernel, but not used by the kernel +(except in the case of virtual consoles, where the kernel will +update the window size when the size of the virtual console changes, +for example, by loading a new font). + +The following constants and structure are defined in +.IR . +.TP +.BI "TIOCGWINSZ struct winsize *" argp +Get window size. +.TP +.BI "TIOCSWINSZ const struct winsize *" argp +Set window size. +.LP +The struct used by these ioctls is defined as + +.in +4n +.nf +struct winsize { + unsigned short ws_row; + unsigned short ws_col; + unsigned short ws_xpixel; /* unused */ + unsigned short ws_ypixel; /* unused */ +}; +.fi +.in + +When the window size changes, a +.B SIGWINCH +signal is sent to the +foreground process group. +.SS "Sending a Break" +.TP +.BI "TCSBRK int " arg +Equivalent to +.IR "tcsendbreak(fd, arg)" . +.br +If the terminal is using asynchronous serial data transmission, and +.I arg +is zero, then send a break (a stream of zero bits) for between +0.25 and 0.5 seconds. +If the terminal is not using asynchronous +serial data transmission, then either a break is sent, or the function +returns without doing anything. +When +.I arg +is nonzero, nobody knows what will happen. + +(SVr4, UnixWare, Solaris, Linux treat +.I "tcsendbreak(fd,arg)" +with nonzero +.I arg +like +.IR "tcdrain(fd)" . +SunOS treats +.I arg +as a multiplier, and sends a stream of bits +.I arg +times as long as done for zero +.IR arg . +DG/UX and AIX treat +.I arg +(when nonzero) as a time interval measured in milliseconds. +HP-UX ignores +.IR arg .) +.TP +.BI "TCSBRKP int " arg +So-called "POSIX version" of +.BR TCSBRK . +It treats nonzero +.I arg +as a timeinterval measured in deciseconds, and does nothing +when the driver does not support breaks. +.TP +.B "TIOCSBRK void" +Turn break on, that is, start sending zero bits. +.TP +.B "TIOCCBRK void" +Turn break off, that is, stop sending zero bits. +.SS "Software flow control" +.TP +.BI "TCXONC int " arg +Equivalent to +.IR "tcflow(fd, arg)" . +.br +See +.BR tcflow (3) +for the argument values +.BR TCOOFF , +.BR TCOON , +.BR TCIOFF , +.BR TCION . +.SS "Buffer count and flushing" +.TP +.BI "FIONREAD int *" argp +Get the number of bytes in the input buffer. +.TP +.BI "TIOCINQ int *" argp +Same as +.BR FIONREAD . +.TP +.BI "TIOCOUTQ int *" argp +Get the number of bytes in the output buffer. +.TP +.BI "TCFLSH int " arg +Equivalent to +.IR "tcflush(fd, arg)" . +.br +See +.BR tcflush (3) +for the argument values +.BR TCIFLUSH , +.BR TCOFLUSH , +.BR TCIOFLUSH . +.SS "Faking input" +.TP +.BI "TIOCSTI const char *" argp +Insert the given byte in the input queue. +.SS "Redirecting console output" +.TP +.B "TIOCCONS void" +Redirect output that would have gone to +.I /dev/console +or +.I /dev/tty0 +to the given terminal. +If that was a pseudo-terminal master, send it to the slave. +In Linux before version 2.6.10, +anybody can do this as long as the output was not redirected yet; +since version 2.6.10, only root (a process with the +.BR CAP_SYS_ADMIN +capability) may do this. +If output was redirected already +.B EBUSY +is returned, +but redirection can be stopped by using this ioctl with +.I fd +pointing at +.I /dev/console +or +.IR /dev/tty0 . +.SS "Controlling terminal" +.TP +.BI "TIOCSCTTY int " arg +Make the given terminal the controlling terminal of the calling process. +The calling process must be a session leader and not have a +controlling terminal already. +If this terminal is already the controlling terminal +of a different session group then the ioctl fails with +.BR EPERM , +unless the caller is root (more precisely: has the +.BR CAP_SYS_ADMIN +capability) and +.I arg +equals 1, in which case the terminal is stolen, and all processes that had +it as controlling terminal lose it. +.TP +.B TIOCNOTTY void +If the given terminal was the controlling terminal of the calling process, +give up this controlling terminal. +If the process was session leader, +then send +.B SIGHUP +and +.B SIGCONT +to the foreground process group +and all processes in the current session lose their controlling terminal. +.SS "Process group and session ID" +.TP +.BI "TIOCGPGRP pid_t *" argp +When successful, equivalent to +.IR "*argp = tcgetpgrp(fd)" . +.br +Get the process group ID of the foreground process group on this terminal. +.TP +.BI "TIOCSPGRP const pid_t *" argp +Equivalent to +.IR "tcsetpgrp(fd, *argp)" . +.br +Set the foreground process group ID of this terminal. +.TP +.BI "TIOCGSID pid_t *" argp +Get the session ID of the given terminal. +This will fail with +.B ENOTTY +in case the terminal is not a master pseudo-terminal +and not our controlling terminal. +Strange. +.SS "Exclusive mode" +.TP +.B "TIOCEXCL void" +Put the terminal into exclusive mode. +No further +.BR open (2) +operations on the terminal are permitted. +(They will fail with +.BR EBUSY , +except for root, that is, a process with the +.BR CAP_SYS_ADMIN +capability.) +.TP +.B "TIOCNXCL void" +Disable exclusive mode. +.SS "Line discipline" +.TP +.BI "TIOCGETD int *" argp +Get the line discipline of the terminal. +.TP +.BI "TIOCSETD const int *" argp +Set the line discipline of the terminal. +.SS "Pseudo-terminal ioctls" +.TP +.BI "TIOCPKT const int *" argp +Enable (when +.RI * argp +is nonzero) or disable packet mode. +Can be applied to the master side of a pseudo-terminal only (and will return +.B ENOTTY +otherwise). +In packet mode, each subsequent +.BR read (2) +will return a packet that either contains a single nonzero control byte, +or has a single byte containing zero (\(aq\0\(aq) followed by data +written on the slave side of the pseudo-terminal. +If the first byte is not +.B TIOCPKT_DATA +(0), it is an OR of one +or more of the following bits: + +.nf +TIOCPKT_FLUSHREAD The read queue for the terminal is flushed. +TIOCPKT_FLUSHWRITE The write queue for the terminal is flushed. +TIOCPKT_STOP Output to the terminal is stopped. +TIOCPKT_START Output to the terminal is restarted. +TIOCPKT_DOSTOP The start and stop characters are \fB^S\fP/\fB^Q\fP. +TIOCPKT_NOSTOP The start and stop characters are not \fB^S\fP/\fB^Q\fP. +.fi + +While this mode is in use, the presence +of control status information to be read +from the master side may be detected by a +.BR select (2) +for exceptional conditions. + +This mode is used by +.BR rlogin (1) +and +.BR rlogind (8) +to implement a remote-echoed, +locally \fB^S\fP/\fB^Q\fP flow-controlled remote login. + +The BSD ioctls +.BR TIOCSTOP , +.BR TIOCSTART , +.BR TIOCUCNTL , +.B TIOCREMOTE +have not been implemented under Linux. +.SS "Modem control" +.TP +.BI "TIOCMGET int *" argp +get the status of modem bits. +.TP +.BI "TIOCMSET const int *" argp +set the status of modem bits. +.TP +.BI "TIOCMBIC const int *" argp +clear the indicated modem bits. +.TP +.BI "TIOCMBIS const int *" argp +set the indicated modem bits. +.LP +Bits used by these four ioctls: + +.nf +TIOCM_LE DSR (data set ready/line enable) +TIOCM_DTR DTR (data terminal ready) +TIOCM_RTS RTS (request to send) +TIOCM_ST Secondary TXD (transmit) +TIOCM_SR Secondary RXD (receive) +TIOCM_CTS CTS (clear to send) +TIOCM_CAR DCD (data carrier detect) +TIOCM_CD see TIOCM_CAR +TIOCM_RNG RNG (ring) +TIOCM_RI see TIOCM_RNG +TIOCM_DSR DSR (data set ready) +.fi +.SS "Marking a line as local" +.TP +.BI "TIOCGSOFTCAR int *" argp +("Get software carrier flag") +Get the status of the CLOCAL flag in the c_cflag field of the +.I termios +structure. +.TP +.BI "TIOCSSOFTCAR const int *" argp +("Set software carrier flag") +Set the CLOCAL flag in the +.I termios +structure when +.RI * argp +is nonzero, and clear it otherwise. +.LP +If the +.B CLOCAL +flag for a line is off, the hardware carrier detect (DCD) +signal is significant, and an +.BR open (2) +of the corresponding terminal will block until DCD is asserted, +unless the +.B O_NONBLOCK +flag is given. +If +.B CLOCAL +is set, the line behaves as if DCD is always asserted. +The software carrier flag is usually turned on for local devices, +and is off for lines with modems. +.SS "Linux-specific" +For the +.B TIOCLINUX +ioctl, see +.BR console_ioctl (4). +.SS "Kernel debugging" +.B "#include " +.TP +.BI "TIOCTTYGSTRUCT struct tty_struct *" argp +Get the +.I tty_struct +corresponding to +.IR fd . +.\" +.\" .SS "Serial info" +.\" .BR "#include " +.\" .sp +.\" .TP +.\" .BI "TIOCGSERIAL struct serial_struct *" argp +.\" Get serial info. +.\" .TP +.\" .BI "TIOCSSERIAL const struct serial_struct *" argp +.\" Set serial info. +.SH "RETURN VALUE" +The +.BR ioctl () +system call returns 0 on success. +On error it returns \-1 and sets +.I errno +appropriately. +.SH ERRORS +.TP +.B EINVAL +Invalid command parameter. +.TP +.B ENOIOCTLCMD +Unknown command. +.TP +.B ENOTTY +Inappropriate +.IR fd . +.TP +.B EPERM +Insufficient permission. +.SH EXAMPLE +Check the condition of DTR on the serial port. + +.nf +#include +#include +#include + +int +main(void) +{ + int fd, serial; + + fd = open("/dev/ttyS0", O_RDONLY); + ioctl(fd, TIOCMGET, &serial); + if (serial & TIOCM_DTR) + puts("TIOCM_DTR is not set"); + else + puts("TIOCM_DTR is set"); + close(fd); +} +.fi +.SH "SEE ALSO" +.BR ioctl (2), +.BR termios (3), +.BR console_ioctl (4), +.BR pty (7) +.\" +.\" FIONBIO const int * +.\" FIONCLEX void +.\" FIOCLEX void +.\" FIOASYNC const int * +.\" from serial.c: +.\" TIOCSERCONFIG void +.\" TIOCSERGWILD int * +.\" TIOCSERSWILD const int * +.\" TIOCSERGSTRUCT struct async_struct * +.\" TIOCSERGETLSR int * +.\" TIOCSERGETMULTI struct serial_multiport_struct * +.\" TIOCSERSETMULTI const struct serial_multiport_struct * +.\" TIOCGSERIAL, TIOCSSERIAL (see above) diff --git a/original/man4/urandom.4 b/original/man4/urandom.4 new file mode 100644 index 00000000..b95979fa --- /dev/null +++ b/original/man4/urandom.4 @@ -0,0 +1 @@ +.so man4/random.4 diff --git a/original/man4/vcs.4 b/original/man4/vcs.4 new file mode 100644 index 00000000..6887a44a --- /dev/null +++ b/original/man4/vcs.4 @@ -0,0 +1,154 @@ +.\" Copyright (c) 1995 James R. Van Zandt +.\" Sat Feb 18 09:11:07 EST 1995 +.\" +.\" 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, Sun Feb 26 15:08:05 1995, faith@cs.unc.edu +.\" 2007-12-17, Samuel Thibault : +.\" document the VT_GETHIFONTMASK ioctl +.\" " +.TH VCS 4 2007-12-17 "Linux" "Linux Programmer's Manual" +.SH NAME +vcs, vcsa \- virtual console memory +.SH DESCRIPTION +\fI/dev/vcs0\fP is a character device with major number 7 and minor number +0, usually of mode 0644 and owner root.tty. +It refers to the memory of the currently +displayed virtual console terminal. +.LP +\fI/dev/vcs[1\-63]\fP are character devices for virtual console +terminals, they have major number 7 and minor number 1 to 63, usually +mode 0644 and owner root.tty. +\fI/dev/vcsa[0\-63]\fP are the same, but +using +.IR "unsigned short" s +(in host byte order) that include attributes, +and prefixed with four bytes giving the screen +dimensions and cursor position: \fIlines\fP, \fIcolumns\fP, \fIx\fP, \fIy\fP. +(\fIx\fP = \fIy\fP = 0 at the top left corner of the screen.) + +When a 512-character font is loaded, +the 9th bit position can be fetched by applying the +.BR ioctl (2) +\fBVT_GETHIFONTMASK\fP operation +(available in Linux kernels 2.6.18 and above) +on \fI/dev/tty[1\-63]\fP; +the value is returned in the +.I "unsigned short" +pointed to by the third +.BR ioctl (2) +argument. +.PP +These devices replace the screendump +.BR ioctl (2) +operations of +.BR console (4), +so the system +administrator can control access using file system permissions. +.PP +The devices for the first eight virtual consoles may be created by: + +.nf + for x in 0 1 2 3 4 5 6 7 8; do + mknod \-m 644 /dev/vcs$x c 7 $x; + mknod \-m 644 /dev/vcsa$x c 7 $[$x+128]; + done + chown root:tty /dev/vcs* +.fi + +No +.BR ioctl (2) +requests are supported. +.SH FILES +/dev/vcs[0\-63] +.br +/dev/vcsa[0\-63] +.\" .SH AUTHOR +.\" Andries Brouwer +.SH VERSIONS +Introduced with version 1.1.92 of the Linux kernel. +.SH EXAMPLE +You may do a screendump on vt3 by switching to vt1 and typing +\fIcat /dev/vcs3 >foo\fP. +Note that the output does not contain +newline characters, so some processing may be required, like +in \fIfold \-w 81 /dev/vcs3 | lpr\fP or (horrors) +\fIsetterm \-dump 3 \-file /proc/self/fd/1\fP. +.LP +The \fI/dev/vcsa0\fP device is used for Braille support. + +This program displays the character and screen attributes under the +cursor of the second virtual console, then changes the background color +there: + +.nf +#include +#include +#include +#include +#include +#include + +int +main(void) +{ + int fd; + char *device = "/dev/vcsa2"; + char *console = "/dev/tty2"; + struct {unsigned char lines, cols, x, y;} scrn; + unsigned short s; + unsigned short mask; + unsigned char ch, attrib; + + fd = open(console, O_RDWR); + if (fd < 0) { + perror(console); + exit(EXIT_FAILURE); + } + if (ioctl(fd, VT_GETHIFONTMASK, &mask) < 0) { + perror("VT_GETHIFONTMASK"); + exit(EXIT_FAILURE); + } + (void) close(fd); + fd = open(device, O_RDWR); + if (fd < 0) { + perror(device); + exit(EXIT_FAILURE); + } + (void) read(fd, &scrn, 4); + (void) lseek(fd, 4 + 2*(scrn.y*scrn.cols + scrn.x), 0); + (void) read(fd, &s, 2); + ch = s & 0xff; + if (attrib & mask) + ch |= 0x100; + attrib = ((s & ~mask) >> 8); + printf("ch=\(aq%c\(aq attrib=0x%02x\\n", ch, attrib); + attrib ^= 0x10; + (void) lseek(fd, \-1, 1); + (void) write(fd, &attrib, 1); + exit(EXIT_SUCCESS); +} +.fi +.SH "SEE ALSO" +.BR console (4), +.BR tty (4), +.BR ttyS (4), +.BR gpm (8) diff --git a/original/man4/vcsa.4 b/original/man4/vcsa.4 new file mode 100644 index 00000000..ffe8d9be --- /dev/null +++ b/original/man4/vcsa.4 @@ -0,0 +1 @@ +.so man4/vcs.4 diff --git a/original/man4/wavelan.4 b/original/man4/wavelan.4 new file mode 100644 index 00000000..ef9e974e --- /dev/null +++ b/original/man4/wavelan.4 @@ -0,0 +1,166 @@ +.\" From jt@hplb.hpl.hp.com Thu Dec 19 18:31:49 1996 +.\" From: Jean Tourrilhes +.\" Address: HP Labs, Filton Road, Stoke Gifford, Bristol BS12 6QZ, U.K. +.\" Jean II - HPLB - '96 +.\" wavelan.c.4 +.\" +.\" Provenance of this page is unclear. Licensed under the GPL, +.\" after inquiries with Jean Tourrilhes and Bruce Janson +.\" (mtk, July 2006) +.\" +.TH WAVELAN 4 1996-10-22 "Linux" "Linux Programmer's Manual" +.\" +.\" NAME part +.\" +.SH NAME +wavelan \- AT&T GIS WaveLAN ISA device driver +.\" +.\" SYNOPSIS part +.\" +.SH SYNOPSIS +.BI "insmod wavelan_cs.o [io=" B,B.. "] [ irq=" I,I.. "] [name=" N,N.. ] +.\" +.\" DESCRIPTION part +.\" +.SH DESCRIPTION +.I wavelan +is the low-level device driver for the NCR / AT&T / Lucent +.B WaveLAN ISA +and Digital (DEC) +.B RoamAbout DS +wireless ethernet adapter. +This driver is available as a module or +might be compiled in the kernel. +This driver supports multiple cards +in both forms (up to 4) and allocates the next available ethernet +device (eth0..eth#) for each card found, unless a device name is +explicitly specified (see below). +This device name will be reported +in the kernel log file with the MAC address, NWID and frequency used +by the card. +.\" +.\" PARAMETER part +.\" +.SS Parameters +This section apply to the module form (parameters passed on the +.BR insmod (8) +command line). +If the driver is included in the kernel, use the +.I ether=IRQ,IO,NAME +syntax on the kernel command line. +.TP +.B io +Specify the list of base address where to search for wavelan cards +(setting by dip switch on the card). +If you don't specify any io +address, the driver will scan 0x390 and 0x3E0 addresses, which might +conflict with other hardware... +.TP +.B irq +Set the list of irq that each wavelan card should use (the value is +saved in permanent storage for future use). +.TP +.B name +Set the list of name to be used for each wavelan cards device (name +used by +.BR ifconfig (8)). +.\" +.\" WIRELESS part +.\" +.SS "Wireless Extensions" +Use +.BR iwconfig (8) +to manipulate wireless extensions. +.\" NWID sub part +.SS NWID (or domain) +Set the network ID +.RI [ 0 +to +.IR FFFF ] +or disable it +.RI [ off ]. +As the NWID is stored in the card Permanent Storage Area, it will be +reuse at any further invocation of the driver. +.\" Frequency sub part +.SS Frequency & channels +For the 2.4GHz 2.00 Hardware, you are able to set the frequency by +specifying one of the 10 defined channels +.RI ( 2.412, +.I 2.422, 2.425, 2.4305, 2.432, 2.442, 2.452, 2.460, 2.462 +or +.IR 2.484 ) +or directly by its value. +The frequency is changed immediately and +permanently. +Frequency availability depends on the regulations... +.\" Spy sub part +.SS Statistics spy +Set a list of MAC addresses in the driver (up to 8) and get the last +quality of link for each of those (see +.BR iwspy (8)). +.\" /proc/net/wireless part +.SS /proc/net/wireless +.I status +is the status reported by the modem. +.I Link quality +reports the quality of the modulation on the air (direct sequence +spread spectrum) [max = 16]. +.I Level +and +.I Noise +refer to the signal level and noise level [max = 64]. +The +.I crypt discarded packet +and +.I misc discarded packet +counters are not implemented. +.\" +.\" IOCTL part +.\" +.SS "Private Ioctl" +You may use +.BR iwpriv (8) +to manipulate private ioctls. +.\" threshold part +.SS Quality and Level threshold +Enable you the define the quality and level threshold used by the +modem (packet below that level are discarded). +.\" Histogram part +.SS Histogram +This functionality allow to set a number of signal level intervals and +to count the number of packets received in each of those defined +intervals. +This distribution might be used to calculate the mean value +and standard deviation of the signal level. +.\" +.\" SPECIFIC part +.\" +.SS "Specific Notes" +This driver will fail to detect some +.B non-NCR/ATT&T/Lucent +Wavelan cards. +If this happens for you, you must look in the source code on +how to add your card to the detection routine. +.PP +Some of the mentioned features are optional. +You may enable to disable +them by changing flags in the driver header and recompile. +.\" +.\" AUTHOR part +.\" +.\" .SH AUTHOR +.\" Bruce Janson \(em bruce@cs.usyd.edu.au +.\" .br +.\" Jean Tourrilhes \(em jt@hplb.hpl.hp.com +.\" .br +.\" (and others; see source code for details) +.\" +.\" SEE ALSO part +.\" +.SH "SEE ALSO" +.BR wavelan_cs (4), +.BR ifconfig (8), +.BR insmod (8), +.BR iwconfig (8), +.BR iwpriv (8), +.BR iwspy (8) diff --git a/original/man4/zero.4 b/original/man4/zero.4 new file mode 100644 index 00000000..15a39be0 --- /dev/null +++ b/original/man4/zero.4 @@ -0,0 +1 @@ +.so man4/null.4 diff --git a/original/man5/acct.5 b/original/man5/acct.5 new file mode 100644 index 00000000..17793afb --- /dev/null +++ b/original/man5/acct.5 @@ -0,0 +1,177 @@ +.\" 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. +.\" +.TH ACCT 5 2008-06-15 "Linux" "Linux Programmer's Manual" +.SH NAME +acct \- process accounting file +.SH SYNOPSIS +.B #include +.SH DESCRIPTION +If the kernel is built with the process accounting option enabled +.RB ( CONFIG_BSD_PROCESS_ACCT ), +then calling +.BR acct (2) +starts process accounting, for example: + +.in +4n +acct("/var/log/pacct"); +.in + +When process accounting is enabled, the kernel writes a record +to the accounting file as each process on the system terminates. +This record contains information about the terminated process, +and is defined in +.I +as follows: + +.in +4n +.nf +#define ACCT_COMM 16 + +typedef u_int16_t comp_t; + +struct acct { + char ac_flag; /* Accounting flags */ + u_int16_t ac_uid; /* Accounting user ID */ + u_int16_t ac_gid; /* Accounting group ID */ + u_int16_t ac_tty; /* Controlling terminal */ + u_int32_t ac_btime; /* Process creation time + (seconds since the Epoch) */ + comp_t ac_utime; /* User CPU time */ + comp_t ac_stime; /* System CPU time */ + comp_t ac_etime; /* Elapsed time */ + comp_t ac_mem; /* Average memory usage (kB) */ + comp_t ac_io; /* Characters transferred (unused) */ + comp_t ac_rw; /* Blocks read or written (unused) */ + comp_t ac_minflt; /* Minor page faults */ + comp_t ac_majflt; /* Major page faults */ + comp_t ac_swaps; /* Number of swaps (unused) */ + u_int32_t ac_exitcode; /* Process termination status + (see wait(2)) */ + char ac_comm[ACCT_COMM+1]; + /* Command name (basename of last + executed command; null-terminated) */ + char ac_pad[\fIX\fP]; /* padding bytes */ +}; + +enum { /* Bits that may be set in ac_flag field */ + AFORK = 0x01, /* Has executed fork, but no exec */ + ASU = 0x02, /* Used superuser privileges */ + ACORE = 0x08, /* Dumped core */ + AXSIG = 0x10 /* Killed by a signal */ +}; +.fi +.in +.PP +The +.I comp_t +data type is a floating-point value consisting of a 3-bit, base-8 exponent, +and a 13-bit mantissa. +A value, +.IR c , +of this type can be converted to a (long) integer as follows: +.nf + + v = (c & 0x1fff) << (((c >> 13) & 0x7) * 3); +.fi +.PP +The +.IR ac_utime , +.IR ac_stime , +and +.I ac_etime +fields measure time in "clock ticks"; divide these values by +.I sysconf(_SC_CLK_TCK) +to convert them to seconds. +.SS Version 3 Accounting File Format +Since kernel 2.6.8, +an optional alternative version of the accounting file can be produced +if the +.B CONFIG_BSD_PROCESS_ACCT_V3 +option is set when building the kernel. +With this option is set, +the records written to the accounting file contain additional fields, +and the width of +.I c_uid +and +.I ac_gid +fields is widened from 16 to 32 bits +(in line with the increased size of UID and GIDs in Linux 2.4 and later). +The records are defined as follows: + +.in +4n +.nf +struct acct_v3 { + char ac_flag; /* Flags */ + char ac_version; /* Always set to ACCT_VERSION (3) */ + u_int16_t ac_tty; /* Controlling terminal */ + u_int32_t ac_exitcode; /* Process termination status */ + u_int32_t ac_uid; /* Real user ID */ + u_int32_t ac_gid; /* Real group ID */ + u_int32_t ac_pid; /* Process ID */ + u_int32_t ac_ppid; /* Parent process ID */ + u_int32_t ac_btime; /* Process creation time */ + float ac_etime; /* Elapsed time */ + comp_t ac_utime; /* User CPU time */ + comp_t ac_stime; /* System time */ + comp_t ac_mem; /* Average memory usage (kB) */ + comp_t ac_io; /* Characters transferred (unused) */ + comp_t ac_rw; /* Blocks read or written + (unused) */ + comp_t ac_minflt; /* Minor page faults */ + comp_t ac_majflt; /* Major page faults */ + comp_t ac_swaps; /* Number of swaps (unused) */ + char ac_comm[ACCT_COMM]; /* Command name */ +}; + +.fi +.in +.SH VERSIONS +The +.I acct_v3 +structure is defined in glibc since version 2.6. +.SH CONFORMING TO +Process accounting originated on BSD. +Although it is present on most systems, it is not standardized, +and the details vary somewhat between systems. +.SH NOTES +Records in the accounting file are ordered by termination time of +the process. + +In kernels up to and including 2.6.9, +a separate accounting record is written for each thread created using +the NPTL threading library; +since Linux 2.6.10, +a single accounting record is written for the entire process +on termination of the last thread in the process. + +The +.I proc/sys/kernel/acct +file, described in +.BR proc (5), +defines settings that control the behavior of process accounting +when disk space runs low. +.SH "SEE ALSO" +.BR lastcomm (1), +.BR acct (2), +.BR accton (8), +.BR sa (8) diff --git a/original/man5/charmap.5 b/original/man5/charmap.5 new file mode 100644 index 00000000..349fe686 --- /dev/null +++ b/original/man5/charmap.5 @@ -0,0 +1,129 @@ +.\" Hey emacs, this is -*- nroff -*- +.\" +.\" This file is part of locale(1) which displays the settings of the +.\" current locale. +.\" Copyright (C) 1994 Jochen Hein (Hein@Student.TU-Clausthal.de) +.\" +.\" 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, USA. +.\" +.TH CHARMAP 5 1994-11-28 "" "Linux User Manual" +.SH NAME +charmap \- character symbols to define character encodings +.SH DESCRIPTION +A character set description (charmap) defines a character set of +available characters and their encodings. +All supported character +sets should have the +.B portable character set +as a proper subset. +.\" Not true anymore: +.\" The portable character set is defined in the file +.\" .I /usr/lib/nls/charmap/POSIX +.\" .I /usr/share/i18n/charmap/POSIX +.\" for reference purposes. +.SS Syntax +The charmap file starts with a header, that may consist of the +following keywords: +.TP +.I +is followed by the name of the codeset. +.TP +.I +is followed by the max number of bytes for a multibyte-character. +Multibyte characters are currently not supported. +The default value +is 1. +.TP +.I +is followed by the min number of bytes for a character. +This +value must be less or equal than +.BR mb_cur_max . +If not specified, it defaults to +.BR mb_cur_max . +.TP +.I +is followed by a character that should be used as the +escape-character for the rest of the file to mark characters that +should be interpreted in a special way. +It defaults to +the backslash ( +.B \\\\ +). +.TP +.I +is followed by a character that will be used as the +comment-character for the rest of the file. +It defaults to the +number sign ( +.B # +). +.PP +The charmap-definition itself starts with the keyword +.B CHARMAP +in column 1. + +The following lines may have one of the two following forms to +define the character-encodings: +.TP +.I +This form defines exactly one character and its encoding. +.TP +.I ... +This form defines a couple of characters. +This is only useful for +multibyte-characters, which are currently not implemented. +.PP +The last line in a charmap-definition file must contain +.B END CHARMAP. +.SS "Symbolic Names" +A +.B symbolic name +for a character contains only characters of the +.B portable character set. +The name itself is enclosed between angle brackets. +Characters following an +.B +are interpreted as itself; for example, the sequence +.B "<\\\\\\\\\\\\>>" +represents the symbolic name +.B "\\\\>" +enclosed in angle brackets. +.SS "Character Encoding" +The +encoding may be in each of the following three forms: +.TP +.I d +with a decimal number +.TP +.I x +with a hexadecimal number +.TP +.I +with an octal number. +.\" FIXME comments +.\" FIXME char ... char +.SH FILES +.I /usr/share/i18n/charmaps/* +.\" .SH AUTHOR +.\" Jochen Hein (jochen.hein@delphi.central.de) +.SH "CONFORMING TO" +POSIX.2. +.SH "SEE ALSO" +.BR locale (1), +.BR localedef (1), +.BR localeconv (3), +.BR setlocale (3), +.BR locale (5) diff --git a/original/man5/complex.5 b/original/man5/complex.5 new file mode 100644 index 00000000..329ba484 --- /dev/null +++ b/original/man5/complex.5 @@ -0,0 +1,2 @@ +.so man7/complex.7 +.\" FIXME . this link will eventually be removed (created Apr 2006) diff --git a/original/man5/core.5 b/original/man5/core.5 new file mode 100644 index 00000000..47b9602d --- /dev/null +++ b/original/man5/core.5 @@ -0,0 +1,382 @@ +.\" Copyright (c) 2006, 2008 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. +.\" +.TH CORE 5 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +core \- core dump file +.SH DESCRIPTION +The default action of certain signals is to cause a process to terminate +and produce a +.IR "core dump file" , +a disk file containing an image of the process's memory at +the time of termination. +This image can be used in a debugger (e.g., +.BR gdb (1)) +to inspect the state of the program at the time that it terminated. +A list of the signals which cause a process to dump core can be found in +.BR signal (7). + +A process can set its soft +.B RLIMIT_CORE +resource limit to place an upper limit on the size of the core dump file +that will be produced if it receives a "core dump" signal; see +.BR getrlimit (2) +for details. + +There are various circumstances in which a core dump file is +not produced: +.IP * 3 +The process does not have permission to write the core file. +(By default the core file is called +.IR core , +and is created in the current working directory. +See below for details on naming.) +Writing the core file will fail if the directory in which +it is to be created is nonwritable, +or if a file with the same name exists and +is not writable +or is not a regular file +(e.g., it is a directory or a symbolic link). +.IP * +A (writable, regular) file with the same name as would be used for the +core dump already exists, but there is more than one hard link to that +file. +.IP * +The file system where the core dump file would be created is full; +or has run out of inodes; or is mounted read-only; +or the user has reached their quota for the file system. +.IP * +The directory in which the core dump file is to be created does +not exist. +.IP * +The +.B RLIMIT_CORE +(core file size) or +.B RLIMIT_FSIZE +(file size) resource limits for the process are set to zero; see +.BR getrlimit (2) +and the documentation of the shell's +.I ulimit +command +.RI ( limit +in +.BR csh (1)). +.IP * +The binary being executed by the process does not have read +permission enabled. +.IP * +The process is executing a set-user-ID (set-group-ID) program +that is owned by a user (group) other than the real user (group) +ID of the process. +(However, see the description of the +.BR prctl (2) +.B PR_SET_DUMPABLE +operation, and the description of the +.I /proc/sys/fs/suid_dumpable +.\" FIXME . Perhaps relocate discussion of /proc/sys/fs/suid_dumpable +.\" and PR_SET_DUMPABLE to this page? +file in +.BR proc (5).) +.SS Naming of core dump files +By default, a core dump file is named +.IR core , +but the +.I /proc/sys/kernel/core_pattern +file (since Linux 2.6 and 2.4.21) +can be set to define a template that is used to name core dump files. +The template can contain % specifiers which are substituted +by the following values when a core file is created: +.PP +.RS 4 +.PD 0 +.TP 4 +%% +a single % character +.TP +%p +PID of dumped process +.TP +%u +(numeric) real UID of dumped process +.TP +%g +(numeric) real GID of dumped process +.TP +%s +number of signal causing dump +.TP +%t +time of dump, expressed as seconds since the +Epoch, 1970-01-01 00:00:00 +0000 (UTC) +.TP +%h +hostname (same as \fInodename\fP returned by \fBuname\fP(2)) +.TP +%e +executable filename (without path prefix) +.TP +%c +core file size soft resource limit of crashing process (since Linux 2.6.24) +.PD +.RE +.PP +A single % at the end of the template is dropped from the +core filename, as is the combination of a % followed by any +character other than those listed above. +All other characters in the template become a literal +part of the core filename. +The template may include \(aq/\(aq characters, which are interpreted +as delimiters for directory names. +The maximum size of the resulting core filename is 128 bytes (64 bytes +in kernels before 2.6.19). +The default value in this file is "core". +For backward compatibility, if +.I /proc/sys/kernel/core_pattern +does not include "%p" and +.I /proc/sys/kernel/core_uses_pid +(see below) +is nonzero, then .PID will be appended to the core filename. + +Since version 2.4, Linux has also provided +a more primitive method of controlling +the name of the core dump file. +If the +.I /proc/sys/kernel/core_uses_pid +file contains the value 0, then a core dump file is simply named +.IR core . +If this file contains a nonzero value, then the core dump file includes +the process ID in a name of the form +.IR core.PID . +.SS Piping core dumps to a program +Since kernel 2.6.19, Linux supports an alternate syntax for the +.I /proc/sys/kernel/core_pattern +file. +If the first character of this file is a pipe symbol (\fB|\fP), +then the remainder of the line is interpreted as a program to be +executed. +Instead of being written to a disk file, the core dump is given as +standard input to the program. +Note the following points: +.IP * 3 +The program must be specified using an absolute pathname (or a +pathname relative to the root directory, \fI/\fP), +and must immediately follow the '|' character. +.IP * +The process created to run the program runs as user and group +.IR root . +.IP * +Command-line arguments can be supplied to the +program (since kernel 2.6.24), +delimited by white space (up to a total line length of 128 bytes). +.IP * +The command-line arguments can include any of +the % specifiers listed above. +For example, to pass the PID of the process that is being dumped, specify +.I %p +in an argument. +.SS Controlling which mappings are written to the core dump +Since kernel 2.6.23, the Linux-specific +.IR /proc/PID/coredump_filter +file can be used to control which memory segments are written to the +core dump file in the event that a core dump is performed for the +process with the corresponding process ID. + +The value in the file is a bit mask of memory mapping types (see +.BR mmap (2)). +If a bit is set in the mask, then memory mappings of the +corresponding type are dumped; otherwise they are not dumped. +The bits in this file have the following meanings: +.PP +.PD 0 +.RS 4 +.TP +bit 0 +Dump anonymous private mappings. +.TP +bit 1 +Dump anonymous shared mappings. +.TP +bit 2 +Dump file-backed private mappings. +.TP +bit 3 +Dump file-backed shared mappings. +.\" file-backed shared mappings of course also update the underlying +.\" mapped file. +.RE +.PD +.PP +The default value of +.I coredump_filter +is 0x3; +this reflects traditional Linux behavior and means that +only anonymous memory segments are dumped. + +Memory-mapped I/O pages such as frame buffer are never dumped, and +virtual DSO pages are always dumped, regardless of the +.I coredump_filter +value. + +A child process created via +.BR fork (2) +inherits its parents +.I coredump_filter +value; +the +.I coredump_filter +value is preserved across an +.BR execve (2). + +It can be useful to set +.I coredump_filter +in the parent shell before running a program, for example: + +.in +4n +.nf +.RB "$" " echo 0x7 > /proc/self/coredump_filter" +.RB "$" " ./some_program" +.fi +.in +.PP +This file is only provided if the kernel was built with the +.B CONFIG_ELF_CORE +configuration option. +.SH NOTES +The +.BR gdb (1) +.I gcore +command can be used to obtain a core dump of a running process. + +If a multithreaded process (or, more precisely, a process that +shares its memory with another process by being created with the +.B CLONE_VM +flag of +.BR clone (2)) +dumps core, then the process ID is always appended to the core filename, +unless the process ID was already included elsewhere in the +filename via a %p specification in +.IR /proc/sys/kernel/core_pattern . +(This is primarily useful when employing the LinuxThreads implementation, +where each thread of a process has a different PID.) +.\" Always including the PID in the name of the core file made +.\" sense for LinuxThreads, where each thread had a unique PID, +.\" but doesn't seem to serve any purpose with NPTL, where all the +.\" threads in a process share the same PID (as POSIX.1 requires). +.\" Probably the behavior is maintained so that applications using +.\" LinuxThreads continue appending the PID (the kernel has no easy +.\" way of telling which threading implementation the userspace +.\" application is using). -- mtk, April 2006 +.SH EXAMPLE +The program below can be used to demonstrate the use of the +pipe syntax in the +.I /proc/sys/kernel/core_pattern +file. +The following shell session demonstrates the use of this program +(compiled to create an executable named +.IR core_pattern_pipe_test ): +.PP +.in +4n +.nf +.RB "$" " cc \-o core_pattern_pipe_test core_pattern_pipe_test.c" +.RB "$" " su" +Password: +.RB "#" " echo \(aq|$PWD/core_pattern_pipe_test %p \ +UID=%u GID=%g sig=%s\(aq > \e" +.B " /proc/sys/kernel/core_pattern" +.RB "#" " exit" +.RB "$" " sleep 100" +.BR "^\e" " # type control-backslash" +Quit (core dumped) +.RB "$" " cat core.info" +argc=5 +argc[0]= +argc[1]=<20575> +argc[2]= +argc[3]= +argc[4]= +Total bytes in core dump: 282624 +.fi +.in +.SS Program source +\& +.nf +/* core_pattern_pipe_test.c */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +#define BUF_SIZE 1024 + +int +main(int argc, char *argv[]) +{ + int tot, j; + ssize_t nread; + char buf[BUF_SIZE]; + FILE *fp; + char cwd[PATH_MAX]; + + /* Change our current working directory to that of the + crashing process */ + + snprintf(cwd, PATH_MAX, "/proc/%s/cwd", argv[1]); + chdir(cwd); + + /* Write output to file "core.info" in that directory */ + + fp = fopen("core.info", "w+"); + if (fp == NULL) + exit(EXIT_FAILURE); + + /* Display command\-line arguments given to core_pattern + pipe program */ + + fprintf(fp, "argc=%d\\n", argc); + for (j = 0; j < argc; j++) + fprintf(fp, "argc[%d]=<%s>\\n", j, argv[j]); + + /* Count bytes in standard input (the core dump) */ + + tot = 0; + while ((nread = read(STDIN_FILENO, buf, BUF_SIZE)) > 0) + tot += nread; + fprintf(fp, "Total bytes in core dump: %d\\n", tot); + + exit(EXIT_SUCCESS); +} +.fi +.SH SEE ALSO +.BR bash (1), +.BR gdb (1), +.BR getrlimit (2), +.BR mmap (2), +.BR prctl (2), +.BR sigaction (2), +.BR elf (5), +.BR proc (5), +.BR pthreads (7), +.BR signal (7) diff --git a/original/man5/dir_colors.5 b/original/man5/dir_colors.5 new file mode 100644 index 00000000..93e9b935 --- /dev/null +++ b/original/man5/dir_colors.5 @@ -0,0 +1,363 @@ +.\" +.\" manpage for /etc/dir_colors, config file for dircolors(1) +.\" extracted from color-ls 3.12.0.3 dircolors(1) manpage +.\" +.\" This file may be copied under the conditions described +.\" in the LDP GENERAL PUBLIC LICENSE, Version 1, September 1998 +.\" that should have been distributed together with this file. +.\" +.\" Modified Sat Dec 22 22:25:33 2001 by Martin Schulze +.\" +.TH DIR_COLORS 5 2001-12-26 "GNU" "Linux User Manual" +.SH NAME +dir_colors \- configuration file for dircolors(1) +.SH DESCRIPTION +The program +.BR ls (1) +uses the environment variable +.B LS_COLORS +to determine the colors in which the filenames are to be displayed. +This environment variable is usually set by a command like + +.RS +eval \`dircolors some_path/dir_colors\` +.RE + +found in a system default shell initialization file, like +.I /etc/profile +or +.IR /etc/csh.cshrc . +(See also +.BR dircolors (1).) +Usually, the file used here is +.I /etc/DIR_COLORS +and can be overridden by a +.I .dir_colors +file in one's home directory. +.PP +This configuration file consists of several statements, one per line. +Anything right of a hash mark (#) is treated as a comment, if the +hash mark is at the beginning of a line or is preceded by at least one +whitespace. +Blank lines are ignored. +.PP +The +.I global +section of the file consists of any statement before the first +.B TERM +statement. +Any statement in the global section of the file is +considered valid for all terminal types. +Following the global section +is one or more +.I terminal-specific +sections, preceded by one or more +.B TERM +statements which specify the terminal types (as given by the +.B TERM +environment variable) the following declarations apply to. +It is always possible to override a global declaration by a subsequent +terminal-specific one. +.PP +The following statements are recognized; case is insignificant: +.TP +.B TERM \fIterminal-type\fR +Starts a terminal-specific section and specifies which terminal it +applies to. +Multiple +.B TERM +statements can be used to create a section which applies for several +terminal types. +.TP +.B COLOR yes|all|no|none|tty +(Slackware only; ignored by GNU +.BR dircolors (1).) +Specifies that colorization should always be enabled (\fIyes\fR or +\fIall\fR), never enabled (\fIno\fR or \fInone\fR), or enabled only if +the output is a terminal (\fItty\fR). +The default is \fIno\fR. +.TP +.B EIGHTBIT yes|no +(Slackware only; ignored by GNU +.BR dircolors (1).) +Specifies that eight-bit ISO 8859 characters should be enabled by +default. +For compatibility reasons, this can also be specified as 1 for +\fIyes\fR or 0 for \fIno\fR. +The default is \fIno\fR. +.TP +.B OPTIONS \fIoptions\fR +(Slackware only; ignored by GNU +.BR dircolors (1).) +Adds command-line options to the default +.B ls +command line. +The options can be any valid +.B ls +command-line options, and should include the leading minus sign. +Note that +.B dircolors +does not verify the validity of these options. +.TP +.B NORMAL \fIcolor-sequence\fR +Specifies the color used for normal (nonfilename) text. +.TP +.B FILE \fIcolor-sequence\fR +Specifies the color used for a regular file. +.TP +.B DIR \fIcolor-sequence\fR +Specifies the color used for directories. +.TP +.B LINK \fIcolor-sequence\fR +Specifies the color used for a symbolic link. +.TP +.B ORPHAN \fIcolor-sequence\fR +Specifies the color used for an orphaned symbolic link (one which +points to a nonexistent file). +If this is unspecified, +.B ls +will use the +.B LINK +color instead. +.TP +.B MISSING \fIcolor-sequence\fR +Specifies the color used for a missing file (a nonexistent file which +nevertheless has a symbolic link pointing to it). +If this is unspecified, +.B ls +will use the +.B FILE +color instead. +.TP +.B FIFO \fIcolor-sequence\fR +Specifies the color used for a FIFO (named pipe). +.TP +.B SOCK \fIcolor-sequence\fR +Specifies the color used for a socket. +.TP +.B DOOR \fIcolor-sequence\fR +(Supported since fileutils 4.1) +Specifies the color used for a door (Solaris 2.5 and later). +.TP +.B BLK \fIcolor-sequence\fR +Specifies the color used for a block device special file. +.TP +.B CHR \fIcolor-sequence\fR +Specifies the color used for a character device special file. +.TP +.B EXEC \fIcolor-sequence\fR +Specifies the color used for a file with the executable attribute set. +.TP +.B LEFTCODE \fIcolor-sequence\fR +Specifies the +.I "left code" +for non-ISO\ 6429 terminals (see below). +.TP +.B RIGHTCODE \fIcolor-sequence\fR +Specifies the +.I "right code" +for non-ISO\ 6429 terminals (see below). +.TP +.B ENDCODE \fIcolor-sequence\fR +Specifies the +.I "end code" +for non-ISO\ 6429 terminals (see below). +.TP +\fB*\fIextension\fR \fIcolor-sequence\fR +Specifies the color used for any file that ends in \fIextension\fR. +.TP +\fB .\fIextension\fR \fIcolor-sequence\fR +Same as \fB*\fR.\fIextension\fR. +Specifies the color used for any file that +ends in .\fIextension\fR. +Note that the period is included in the +extension, which makes it impossible to specify an extension not +starting with a period, such as +.B ~ +for +.B emacs +backup files. +This form should be considered obsolete. +.SS "ISO 6429 (ANSI) Color Sequences" +Most color-capable ASCII terminals today use ISO 6429 (ANSI) color sequences, +and many common terminals without color capability, including +.B xterm +and the widely used and cloned DEC VT100, will recognize ISO 6429 color +codes and harmlessly eliminate them from the output or emulate them. +.B ls +uses ISO 6429 codes by default, assuming colorization is enabled. + +ISO 6429 color sequences are composed of sequences of numbers +separated by semicolons. +The most common codes are: +.sp +.RS +.2i +.ta 1.0i +.nf + 0 to restore default color + 1 for brighter colors + 4 for underlined text + 5 for flashing text +30 for black foreground +31 for red foreground +32 for green foreground +33 for yellow (or brown) foreground +34 for blue foreground +35 for purple foreground +36 for cyan foreground +37 for white (or gray) foreground +40 for black background +41 for red background +42 for green background +43 for yellow (or brown) background +44 for blue background +45 for purple background +46 for cyan background +47 for white (or gray) background +.fi +.RE +.sp +Not all commands will work on all systems or display devices. +.PP +.B ls +uses the following defaults: +.sp +.RS +.2i +.ta 1.0i 2.5i +.nf +\fBNORMAL\fR 0 Normal (nonfilename) text +\fBFILE\fR 0 Regular file +\fBDIR\fR 32 Directory +\fBLINK\fR 36 Symbolic link +\fBORPHAN\fR undefined Orphaned symbolic link +\fBMISSING\fR undefined Missing file +\fBFIFO\fR 31 Named pipe (FIFO) +\fBSOCK\fR 33 Socket +\fBBLK\fR 44;37 Block device +\fBCHR\fR 44;37 Character device +\fBEXEC\fR 35 Executable file +.fi +.RE +.sp +A few terminal programs do not recognize the default +properly. +If all text gets colorized after you do a directory +listing, change the +.B NORMAL +and +.B FILE +codes to the numerical codes for your normal foreground and background +colors. +.SS "Other Terminal Types (Advanced Configuration)" +If you have a color-capable (or otherwise highlighting) terminal (or +printer!) which uses a different set of codes, you can still generate +a suitable setup. +To do so, you will have to use the +.BR LEFTCODE , +.BR RIGHTCODE , +and +.B ENDCODE +definitions. +.PP +When writing out a filename, +.B ls +generates the following output sequence: +.B LEFTCODE +.I typecode +.B RIGHTCODE +.I filename +.BR ENDCODE , +where the +.I typecode +is the color sequence that depends on the type or name of file. +If the +.B ENDCODE +is undefined, the sequence +.B "LEFTCODE NORMAL RIGHTCODE" +will be used instead. +The purpose of the left- and rightcodes is +merely to reduce the amount of typing necessary (and to hide ugly +escape codes away from the user). +If they are not appropriate for +your terminal, you can eliminate them by specifying the respective +keyword on a line by itself. +.PP +.B NOTE: +If the +.B ENDCODE +is defined in the global section of the setup file, it +.I cannot +be undefined in a terminal-specific section of the file. +This means any +.B NORMAL +definition will have no effect. +A different +.B ENDCODE +can, however, be specified, which would have the same effect. +.SS "Escape Sequences" +To specify control- or blank characters in the color sequences or +filename extensions, either C-style \e-escaped notation or +.BR stty \-style +^-notation can be used. +The C-style notation +includes the following characters: +.sp +.RS +.2i +.ta 1.0i +.nf +\fB\ea\fR Bell (ASCII 7) +\fB\eb\fR Backspace (ASCII 8) +\fB\ee\fR Escape (ASCII 27) +\fB\ef\fR Form feed (ASCII 12) +\fB\en\fR Newline (ASCII 10) +\fB\er\fR Carriage Return (ASCII 13) +\fB\et\fR Tab (ASCII 9) +\fB\ev\fR Vertical Tab (ASCII 11) +\fB\e?\fR Delete (ASCII 127) +\fB\e\fInnn\fR Any character (octal notation) +\fB\ex\fInnn\fR Any character (hexadecimal notation) +\fB\e_\fR Space +\fB\e\e\fR Backslash (\e) +\fB\e^\fR Caret (^) +\fB\e#\fR Hash mark (#) +.fi +.RE +.sp +Please note that escapes are necessary to enter a space, backslash, +caret, or any control character anywhere in the string, as well as a +hash mark as the first character. +.SH FILES +.TP +.I /etc/DIR_COLORS +System-wide configuration file. +.TP +.I ~/.dir_colors +Per-user configuration file. +.PP +This page describes the +.B dir_colors +file format as used in the fileutils-4.1 package; +other versions may differ slightly. +.SH NOTES +The default +.B LEFTCODE +and +.B RIGHTCODE +definitions, which are used by ISO 6429 terminals are: +.sp +.RS +.2i +.ta 1.0i +.nf +\fBLEFTCODE\fR \ee[ +\fBRIGHTCODE\fR m +.fi +.RE +.sp +The default +.B ENDCODE +is undefined. +.SH "SEE ALSO" +.BR dircolors (1), +.BR ls (1), +.BR stty (1), +.BR xterm (1) diff --git a/original/man5/elf.5 b/original/man5/elf.5 new file mode 100644 index 00000000..20ed3d8e --- /dev/null +++ b/original/man5/elf.5 @@ -0,0 +1,1878 @@ +.\" $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 +.\" +.TH ELF 5 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH NAME +elf \- format of Executable and Linking Format (ELF) files +.SH SYNOPSIS +.nf +.\" .B #include +.B #include +.fi +.SH DESCRIPTION +The header file +.I +defines the format of ELF executable binary files. +Amongst these files are +normal executable files, relocatable object files, core files and shared +libraries. +.PP +An executable file using the ELF file format consists of an ELF header, +followed by a program header table or a section header table, or both. +The ELF header is always at offset zero of the file. +The program header +table and the section header table's offset in the file are defined in the +ELF header. +The two tables describe the rest of the particularities of +the file. +.PP +.\" Applications which wish to process ELF binary files for their native +.\" architecture only should include +.\" .I +.\" in their source code. +.\" These applications should need to refer to +.\" all the types and structures by their generic names +.\" "Elf_xxx" +.\" and to the macros by +.\" ELF_xxx". +.\" Applications written this way can be compiled on any architecture, +.\" regardless of whether the host is 32-bit or 64-bit. +.\" .PP +.\" Should an application need to process ELF files of an unknown +.\" architecture, then the application needs to explicitly use either +.\" "Elf32_xxx" +.\" or +.\" "Elf64_xxx" +.\" type and structure names. +.\" Likewise, the macros need to be identified by +.\" "ELF32_xxx" +.\" or +.\" "ELF64_xxx". +.\" .PP +This header file describes the above mentioned headers as C structures +and also includes structures for dynamic sections, relocation sections and +symbol tables. +.PP +The following types are used for N-bit architectures (N=32,64, +.I ElfN +stands for +.I Elf32 +or +.IR Elf64 , +.I uintN_t +stands for +.I uint32_t +or +.IR uint64_t ): +.in +4n +.nf + +ElfN_Addr Unsigned program address, uintN_t +ElfN_Off Unsigned file offset, uintN_t +ElfN_Section Unsigned section index, uint16_t +ElfN_Versym Unsigned version symbol information, 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 +.\" Elf32_Size Unsigned object size +.fi +.in +.PP +(Note: The *BSD terminology is a bit different. +There +.I Elf64_Half +is +twice as large as +.IR Elf32_Half , +and +.I Elf64Quarter +is used for +.IR uint16_t . +In order to avoid confusion these types are replaced by explicit ones +in the below.) +.PP +All data structures that the file format defines follow the +"natural" +size and alignment guidelines for the relevant class. +If necessary, +data structures contain explicit padding to ensure 4-byte alignment +for 4-byte objects, to force structure sizes to a multiple of 4, etc. +.PP +The ELF header is described by the type +.I Elf32_Ehdr +or +.IR 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 +The fields have the following meanings: +.\" .Bl -tag -width "e_phentsize" +.TP 12 +.IR e_ident +This array of bytes specifies to interpret the file, +independent of the processor or the file's remaining contents. +Within this array everything is named by macros, which start with +the prefix +.BR EI_ +and may contain values which start with the prefix +.BR ELF . +The following macros are defined: +.RS 12 +.\" .Bl -tag -width "EI_VERSION" \" EI_ABIVERSION +.TP 12 +.BR EI_MAG0 +The first byte of the magic number. +It must be filled with +.BR ELFMAG0 . +(0: 0x7f) +.TP +.BR EI_MAG1 +The second byte of the magic number. +It must be filled with +.BR ELFMAG1 . +(1: \(aqE\(aq) +.TP +.BR EI_MAG2 +The third byte of the magic number. +It must be filled with +.BR ELFMAG2 . +(2: \(aqL\(aq) +.TP +.BR EI_MAG3 +The fourth byte of the magic number. +It must be filled with +.BR ELFMAG3 . +(3: \(aqF\(aq) +.TP +.BR EI_CLASS +The fifth byte identifies the architecture for this binary: +.RS 12 +.\" .Bl -tag -width "ELFCLASSNONE" -compact +.TP 14 +.PD 0 +.BR ELFCLASSNONE +This class is invalid. +.TP +.BR ELFCLASS32 +This defines the 32-bit architecture. +It supports machines with files +and virtual address spaces up to 4 Gigabytes. +.TP +.BR ELFCLASS64 +This defines the 64-bit architecture. +.PD +.RE +.\" .El +.TP +.BR EI_DATA +The sixth byte specifies the data encoding of the processor-specific +data in the file. +Currently these encodings are supported: +.\" .Bl -tag -width "ELFDATA2LSB" -compact +.RS 12 +.TP 14 +.PD 0 +.BR ELFDATANONE +Unknown data format. +.TP +.BR ELFDATA2LSB +Two's complement, little-endian. +.TP +.BR ELFDATA2MSB +Two's complement, big-endian. +.PD +.RE +.\" .El +.TP +.PD 0 +.BR EI_VERSION +The version number of the ELF specification: +.\" .Bl -tag -width "EV_CURRENT" -compact +.RS 12 +.TP 14 +.BR EV_NONE +Invalid version. +.TP +.BR EV_CURRENT +Current version. +.PD +.RE +.\".El +.TP +.BR EI_OSABI +This byte identifies the operating system +and ABI to which the object is targeted. +Some fields in other ELF structures have flags +and values that have platform-specific meanings; +the interpretation of those fields is determined by the value of this byte. +E.g.: +.\" .Bl -tag -width "ELFOSABI_STANDALONE" -compact +.RS 12 +.TP 20 +.PD 0 +.BR ELFOSABI_NONE +Same as 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 +.\" .TP +.\" .BR ELFOSABI_MONTEREY +.\" Monterey project ABI. 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 +ARM architecture ABI. +.\" 97 +.TP +.BR ELFOSABI_STANDALONE +Stand-alone (embedded) ABI. +.\" 255 +.\" .El +.PD +.RE +.TP +.BR EI_ABIVERSION +This byte identifies the version of the ABI +to which the object is targeted. +This field is used to distinguish among incompatible versions of an ABI. +The interpretation of this version number +is dependent on the ABI identified by the +.B EI_OSABI +field. +Applications conforming to this specification use the value 0. +.TP +.BR EI_PAD +Start of padding. +These bytes are reserved and set to zero. +Programs +which read them should ignore them. +The value for +.B EI_PAD +will change in +the future if currently unused bytes are given meanings. +.TP +.BR EI_BRAND +Start of architecture identification. +.TP +.BR EI_NIDENT +The size of the +.I e_ident +array. +.\" .El +.RE +.TP +.IR e_type +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 +An unknown type. +.TP +.BR ET_REL +A relocatable file. +.TP +.BR ET_EXEC +An executable file. +.TP +.BR ET_DYN +A shared object. +.TP +.BR ET_CORE +A core file. +.PD +.RE +.\" .El +.TP +.IR e_machine +This member specifies the required architecture for an individual file. +E.g.: +.RS 12 +.\" .Bl -tag -width "EM_MIPS_RS4_BE" -compact +.TP 12 +.PD 0 +.BR EM_NONE +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 +.\" .TP +.\" .BR EM_486 +.\" Intel 80486. +.\" 6 +.TP +.BR EM_860 +Intel 80860. +.\" 7 +.TP +.BR EM_MIPS +MIPS RS3000 (big-endian only). +.\" 8 +.\" EM_S370 +.\" 9 +.\" .TP +.\" .BR EM_MIPS_RS4_BE +.\" MIPS RS4000 (big-endian only). Deprecated. +.\" 10 +.\" EM_MIPS_RS3_LE (MIPS R3000 little-endian) +.\" 10 +.TP +.BR EM_PARISC +HP/PA. +.\" 15 +.TP +.BR EM_SPARC32PLUS +SPARC with enhanced instruction set. +.\" 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 +.\" .TP +.\" .BR EM_ALPHA +.\" Compaq [DEC] Alpha. +.\" .TP +.\" .BR EM_ALPHA_EXP +.\" Compaq [DEC] Alpha with enhanced instruction set. +.PD +.RE +.\" .El +.TP +.IR e_version +This member identifies the file version: +.\" .Bl -tag -width "EV_CURRENT" -compact +.RS 12 +.TP 12 +.PD 0 +.BR EV_NONE +Invalid version. +.TP +.BR EV_CURRENT +Current version. +.\" .El +.PD +.RE +.TP +.IR e_entry +This member gives the virtual address to which the system first transfers +control, thus starting the process. +If the file has no associated entry +point, this member holds zero. +.TP +.IR e_phoff +This member holds the program header table's file offset in bytes. +If +the file has no program header table, this member holds zero. +.TP +.IR e_shoff +This member holds the section header table's file offset in bytes. +If the +file has no section header table this member holds zero. +.TP +.IR e_flags +This member holds processor-specific flags associated with the file. +Flag names take the form EF_`machine_flag'. +Currently no flags have been defined. +.TP +.IR e_ehsize +This member holds the ELF header's size in bytes. +.TP +.IR e_phentsize +This member holds the size in bytes of one entry in the file's program header +table; all entries are the same size. +.TP +.IR e_phnum +This member holds the number of entries in the program header +table. +Thus the product of +.IR e_phentsize +and +.IR e_phnum +gives the table's size +in bytes. +If a file has no program header, +.IR e_phnum +holds the value zero. +.TP +.IR e_shentsize +This member holds a sections header's size in bytes. +A section header is one +entry in the section header table; all entries are the same size. +.TP +.IR e_shnum +This member holds the number of entries in the section header table. +Thus +the product of +.IR e_shentsize +and +.IR e_shnum +gives the section header table's size in bytes. +If a file has no section +header table, +.IR e_shnum +holds the value of zero. +.TP +.IR e_shstrndx +This member holds the section header table index of the entry associated +with the section name string table. +If the file has no section name string +table, this member holds the value +.BR SHN_UNDEF . +.RS 12 +.\" .Bl -tag -width "SHN_LORESERVE" +.TP 14 +.BR SHN_UNDEF +This value marks an undefined, missing, irrelevant, or otherwise meaningless +section reference. +For example, a symbol +"defined" +relative to section number +.BR SHN_UNDEF +is an undefined symbol. +.TP +.BR SHN_LORESERVE +This value specifies the lower bound of the range of reserved indices. +.TP +.BR SHN_LOPROC +Values greater than or equal to +.BR SHN_HIPROC +are reserved for processor-specific semantics. +.TP +.BR SHN_HIPROC +Values less than or equal to +.BR SHN_LOPROC +are reserved for processor-specific semantics. +.TP +.BR SHN_ABS +This value specifies absolute values for the corresponding reference. +For +example, symbols defined relative to section number +.BR SHN_ABS +have absolute values and are not affected by relocation. +.TP +.BR SHN_COMMON +Symbols defined relative to this section are common symbols, such as Fortran +COMMON or unallocated C external variables. +.TP +.BR SHN_HIRESERVE +This value specifies the upper bound of the range of reserved +indices between +.BR SHN_LORESERVE +and +.BR SHN_HIRESERVE , +inclusive; the values do +not reference the section header table. +That is, the section header table +does +.I not +contain entries for the reserved indices. +.RE +.\" .El +.\" .El +.PP +An executable or shared object file's program header table is an array of +structures, each describing a segment or other information the system needs +to prepare the program for execution. +An object file +.IR segment +contains one or more +.IR sections . +Program headers are meaningful only for executable and shared object files. +A file specifies its own program header size with the ELF header's +.IR e_phentsize +and +.IR e_phnum +members. +The ELF program header is described by the type +.I Elf32_Phdr +or +.I Elf64_Phdr +depending on the architecture: +.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 +The main difference between the 32-bit and the 64-bit program header lies +in the location of the +.IR p_flags +member in the total struct. +.\" .Bl -tag -width "p_offset" +.TP 12 +.IR p_type +This member of the Phdr struct tells what kind of segment this array +element describes or how to interpret the array element's information. +.\" .Bl -tag -width "PT_DYNAMIC" +.RS 12 +.TP 12 +.BR PT_NULL +The array element is unused and the other members' values are undefined. +This lets the program header have ignored entries. +.TP +.BR PT_LOAD +The array element specifies a loadable segment, described by +.IR p_filesz +and +.IR p_memsz . +The bytes from the file are mapped to the beginning of the memory +segment. +If the segment's memory size +.IR p_memsz +is larger than the file size +.IR p_filesz , +the +"extra" +bytes are defined to hold the value 0 and to follow the segment's +initialized area. +The file size may not be larger than the memory size. +Loadable segment entries in the program header table appear in ascending +order, sorted on the +.IR p_vaddr +member. +.TP +.BR PT_DYNAMIC +The array element specifies dynamic linking information. +.TP +.BR PT_INTERP +The array element specifies the location and size of a null-terminated +pathname to invoke as an interpreter. +This segment type is meaningful +only for executable files (though it may occur for shared objects). +However it may not occur more than once in a file. +If it is present, it must precede any loadable segment entry. +.TP +.BR PT_NOTE +The array element specifies the location and size for auxiliary information. +.TP +.BR PT_SHLIB +This segment type is reserved but has unspecified semantics. +Programs that +contain an array element of this type do not conform to the ABI. +.TP +.BR PT_PHDR +The array element, if present, specifies the location and size of the program +header table itself, both in the file and in the memory image of the program. +This segment type may not occur more than once in a file. +Moreover, it may +only occur if the program header table is part of the memory image of the +program. +If it is present, it must precede any loadable segment entry. +.TP +.BR PT_LOPROC +Values greater than or equal to +.BR PT_HIPROC +are reserved for processor-specific semantics. +.TP +.BR PT_HIPROC +Values less than or equal to +.BR PT_LOPROC +are reserved for processor-specific semantics. +.BR PT_GNU_STACK +GNU extension which is used by the Linux kernel to control the state of the +stack via the flags set in the +.IR p_flags +member. +.\" .El +.RE +.TP +.IR p_offset +This member holds the offset from the beginning of the file at which +the first byte of the segment resides. +.TP +.IR p_vaddr +This member holds the virtual address at which the first byte of the +segment resides in memory. +.TP +.IR p_paddr +On systems for which physical addressing is relevant, this member is +reserved for the segment's physical address. +Under +BSD +this member is +not used and must be zero. +.TP +.IR p_filesz +This member holds the number of bytes in the file image of the segment. +It may be zero. +.TP +.IR p_memsz +This member holds the number of bytes in the memory image of the segment. +It may be zero. +.TP +.IR p_flags +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 +An executable segment. +.TP +.BR PF_W +A writable segment. +.TP +.BR PF_R +A readable segment. +.PD +.RE +.\" .El +.IP +A text segment commonly has the flags +.BR PF_X +and +.BR PF_R . +A data segment commonly has +.BR PF_X , +.BR PF_W +and +.BR PF_R . +.TP +.IR p_align +This member holds the value to which the segments are aligned in memory +and in the file. +Loadable process segments must have congruent values for +.IR p_vaddr +and +.IR p_offset , +modulo the page size. +Values of zero and one mean no alignment is required. +Otherwise, +.IR p_align +should be a positive, integral power of two, and +.IR p_vaddr +should equal +.IR p_offset , +modulo +.IR p_align . +.\" .El +.PP +A file's section header table lets one locate all the file's sections. +The +section header table is an array of +.I Elf32_Shdr +or +.I Elf64_Shdr +structures. +The +ELF header's +.IR e_shoff +member gives the byte offset from the beginning of the file to the section +header table. +.IR e_shnum +holds the number of entries the section header table contains. +.IR e_shentsize +holds the size in bytes of each entry. +.PP +A section header table index is a subscript into this array. +Some section +header table indices are reserved. +An object file does not have sections for +these special indices: +.\" .Bl -tag -width "SHN_LORESERVE" +.TP 14 +.BR SHN_UNDEF +This value marks an undefined, missing, irrelevant or otherwise meaningless +section reference. +.TP +.BR SHN_LORESERVE +This value specifies the lower bound of the range of reserved indices. +.TP +.BR SHN_LOPROC +Values greater than or equal to +.BR SHN_HIPROC +are reserved for processor-specific semantics. +.TP +.BR SHN_HIPROC +Values less than or equal to +.BR SHN_LOPROC +are reserved for processor-specific semantics. +.TP +.BR SHN_ABS +This value specifies the absolute value for the corresponding reference. +For +example, a symbol defined relative to section number +.BR SHN_ABS +has an absolute value and is not affected by relocation. +.TP +.BR SHN_COMMON +Symbols defined relative to this section are common symbols, such as FORTRAN +COMMON or unallocated C external variables. +.TP +.BR SHN_HIRESERVE +This value specifies the upper bound of the range of reserved indices. +The +system reserves indices between +.BR SHN_LORESERVE +and +.BR SHN_HIRESERVE , +inclusive. +The section header table does not contain entries for the +reserved indices. +.\" .El +.PP +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 +No real differences exist between the 32-bit and 64-bit section headers. +.\" .Bl -tag -width "sh_addralign" +.TP 10 +.IR sh_name +This member specifies the name of the section. +Its value is an index +into the section header string table section, giving the location of +a null-terminated string. +.TP +.IR sh_type +This member categorizes the section's contents and semantics. +.\" .Bl -tag -width "SHT_PROGBITS" +.RS 10 +.TP 15 +.BR SHT_NULL +This value marks the section header as inactive. +It does not +have an associated section. +Other members of the section header +have undefined values. +.TP +.BR SHT_PROGBITS +This section holds information defined by the program, whose +format and meaning are determined solely by the program. +.TP +.BR SHT_SYMTAB +This section holds a symbol table. +Typically, +.BR SHT_SYMTAB +provides symbols for link editing, though it may also be used +for dynamic linking. +As a complete symbol table, it may contain +many symbols unnecessary for dynamic linking. +An object file can +also contain a +.BR SHT_DYNSYM +section. +.TP +.BR SHT_STRTAB +This section holds a string table. +An object file may have multiple +string table sections. +.TP +.BR SHT_RELA +This section holds relocation entries with explicit addends, such +as type +.IR Elf32_Rela +for the 32-bit class of object files. +An object may have multiple +relocation sections. +.TP +.BR SHT_HASH +This section holds a symbol hash table. +An object participating in +dynamic linking must contain a symbol hash table. +An object file may +have only one hash table. +.TP +.BR SHT_DYNAMIC +This section holds information for dynamic linking. +An object file may +have only one dynamic section. +.TP +.BR SHT_NOTE +This section holds information that marks the file in some way. +.TP +.BR SHT_NOBITS +A section of this type occupies no space in the file but otherwise +resembles +.BR SHT_PROGBITS . +Although this section contains no bytes, the +.IR sh_offset +member contains the conceptual file offset. +.TP +.BR SHT_REL +This section holds relocation offsets without explicit addends, such +as type +.IR Elf32_Rel +for the 32-bit class of object files. +An object file may have multiple +relocation sections. +.TP +.BR SHT_SHLIB +This section is reserved but has unspecified semantics. +.TP +.BR SHT_DYNSYM +This section holds a minimal set of dynamic linking symbols. +An +object file can also contain a +.BR SHT_SYMTAB +section. +.TP +.BR SHT_LOPROC +This value up to and including +.BR SHT_HIPROC +is reserved for processor-specific semantics. +.TP +.BR SHT_HIPROC +This value down to and including +.BR SHT_LOPROC +is reserved for processor-specific semantics. +.TP +.BR SHT_LOUSER +This value specifies the lower bound of the range of indices reserved for +application programs. +.TP +.BR SHT_HIUSER +This value specifies the upper bound of the range of indices reserved for +application programs. +Section types between +.BR SHT_LOUSER +and +.BR SHT_HIUSER +may be used by the application, without conflicting with current or future +system-defined section types. +.\" .El +.RE +.TP +.IR sh_flags +Sections support one-bit flags that describe miscellaneous attributes. +If a flag bit is set in +.IR sh_flags , +the attribute is +"on" +for the section. +Otherwise, the attribute is +"off" +or does not apply. +Undefined attributes are set to zero. +.\" .Bl -tag -width "SHF_EXECINSTR" -compact +.RS 10 +.TP 15 +.BR SHF_WRITE +This section contains data that should be writable during process +execution. +.TP +.BR SHF_ALLOC +This section occupies memory during process execution. +Some control +sections do not reside in the memory image of an object file. +This +attribute is off for those sections. +.TP +.BR SHF_EXECINSTR +This section contains executable machine instructions. +.TP +.BR SHF_MASKPROC +All bits included in this mask are reserved for processor-specific +semantics. +.RE +.\" .El +.TP +.IR sh_addr +If this section appears in the memory image of a process, this member +holds the address at which the section's first byte should reside. +Otherwise, the member contains zero. +.TP +.IR sh_offset +This member's value holds the byte offset from the beginning of the file +to the first byte in the section. +One section type, +.BR SHT_NOBITS , +occupies no space in the file, and its +.IR sh_offset +member locates the conceptual placement in the file. +.TP +.IR sh_size +This member holds the section's size in bytes. +Unless the section type +is +.BR SHT_NOBITS , +the section occupies +.IR sh_size +bytes in the file. +A section of type +.BR SHT_NOBITS +may have a nonzero size, but it occupies no space in the file. +.TP +.IR sh_link +This member holds a section header table index link, whose interpretation +depends on the section type. +.TP +.IR sh_info +This member holds extra information, whose interpretation depends on the +section type. +.TP +.IR sh_addralign +Some sections have address alignment constraints. +If a section holds a +doubleword, the system must ensure doubleword alignment for the entire +section. +That is, the value of +.IR sh_addr +must be congruent to zero, modulo the value of +.IR sh_addralign . +Only zero and positive integral powers of two are allowed. +Values of zero +or one mean the section has no alignment constraints. +.TP +.IR sh_entsize +Some sections hold a table of fixed-sized entries, such as a symbol table. +For such a section, this member gives the size in bytes for each entry. +This member contains zero if the section does not hold a table of +fixed-size entries. +.\" .El +.PP +Various sections hold program and control information: +.\" .Bl -tag -width ".shstrtab" +.TP 10 +.IR .bss +This section holds uninitialized data that contributes to the program's +memory image. +By definition, the system initializes the data with zeros +when the program begins to run. +This section is of type +.BR SHT_NOBITS . +The attribute types are +.BR SHF_ALLOC +and +.BR SHF_WRITE . +.TP +.IR .comment +This section holds version control information. +This section is of type +.BR SHT_PROGBITS . +No attribute types are used. +.TP +.IR .ctors +This section holds initialized pointers to the C++ constructor functions. +This section is of type +.BR SHT_PROGBITS . +The attribute types are +.BR SHF_ALLOC +and +.BR SHF_WRITE . +.TP +.IR .data +This section holds initialized data that contribute to the program's +memory image. +This section is of type +.BR SHT_PROGBITS . +The attribute types are +.BR SHF_ALLOC +and +.BR SHF_WRITE . +.TP +.IR .data1 +This section holds initialized data that contribute to the program's +memory image. +This section is of type +.BR SHT_PROGBITS . +The attribute types are +.BR SHF_ALLOC +and +.BR SHF_WRITE . +.TP +.IR .debug +This section holds information for symbolic debugging. +The contents +are unspecified. +This section is of type +.BR SHT_PROGBITS . +No attribute types are used. +.TP +.IR .dtors +This section holds initialized pointers to the C++ destructor functions. +This section is of type +.BR SHT_PROGBITS . +The attribute types are +.BR SHF_ALLOC +and +.BR SHF_WRITE . +.TP +.IR .dynamic +This section holds dynamic linking information. +The section's attributes +will include the +.BR SHF_ALLOC +bit. +Whether the +.BR SHF_WRITE +bit is set is processor-specific. +This section is of type +.BR SHT_DYNAMIC . +See the attributes above. +.TP +.IR .dynstr +This section holds strings needed for dynamic linking, most commonly +the strings that represent the names associated with symbol table entries. +This section is of type +.BR SHT_STRTAB . +The attribute type used is +.BR SHF_ALLOC . +.TP +.IR .dynsym +This section holds the dynamic linking symbol table. +This section is of type +.BR SHT_DYNSYM . +The attribute used is +.BR SHF_ALLOC . +.TP +.IR .fini +This section holds executable instructions that contribute to the process +termination code. +When a program exits normally the system arranges to +execute the code in this section. +This section is of type +.BR SHT_PROGBITS . +The attributes used are +.BR SHF_ALLOC +and +.BR SHF_EXECINSTR . +.TP +.IR .gnu.version +This section holds the version symbol table, an array of +.I ElfN_Half +elements. +This section is of type +.BR SHT_GNU_versym . +The attribute type used is +.BR SHF_ALLOC . +.TP +.IR .gnu.version_d +This section holds the version symbol definitions, a table of +.I ElfN_Verdef +structures. +This section is of type +.BR SHT_GNU_verdef . +The attribute type used is +.BR SHF_ALLOC . +.TP +.IR .gnu.version_r +This section holds the version symbol needed elements, a table of +.I ElfN_Verneed +structures. +This section is of +type +.BR SHT_GNU_versym . +The attribute type used is +.BR SHF_ALLOC . +.TP +.IR .got +This section holds the global offset table. +This section is of type +.BR SHT_PROGBITS . +The attributes are processor specific. +.TP +.IR .hash +This section holds a symbol hash table. +This section is of type +.BR SHT_HASH . +The attribute used is +.BR SHF_ALLOC . +.TP +.IR .init +This section holds executable instructions that contribute to the process +initialization code. +When a program starts to run the system arranges to +execute the code in this section before calling the main program entry point. +This section is of type +.BR SHT_PROGBITS . +The attributes used are +.BR SHF_ALLOC +and +.BR SHF_EXECINSTR . +.TP +.IR .interp +This section holds the pathname of a program interpreter. +If the file has +a loadable segment that includes the section, the section's attributes will +include the +.BR SHF_ALLOC +bit. +Otherwise, that bit will be off. +This section is of type +.BR SHT_PROGBITS . +.TP +.IR .line +This section holds line number information for symbolic debugging, which +describes the correspondence between the program source and the machine code. +The contents are unspecified. +This section is of type +.BR SHT_PROGBITS . +No attribute types are used. +.TP +.IR .note +This section holds information in the +"Note Section" +format described below. +This section is of type +.BR SHT_NOTE . +No attribute types are used. +OpenBSD +native executables usually contain a +.I .note.openbsd.ident +section to identify themselves, for the kernel to bypass any compatibility +ELF binary emulation tests when loading the file. +.TP +.IR .note.GNU-stack +This section is used in Linux object files for declaring stack attributes. +This section is of type +.BR SHT_PROGBITS . +The only attribute used is +.BR SHF_EXECINSTR . +This indicates to the GNU linker that the object file requires an +executable stack. +.TP +.IR .plt +This section holds the procedure linkage table. +This section is of type +.BR SHT_PROGBITS . +The attributes are processor specific. +.TP +.IR .relNAME +This section holds relocation information as described below. +If the file +has a loadable segment that includes relocation, the section's attributes +will include the +.BR SHF_ALLOC +bit. +Otherwise the bit will be off. +By convention, +"NAME" +is supplied by the section to which the relocations apply. +Thus a relocation +section for +.BR .text +normally would have the name +.BR .rel.text . +This section is of type +.BR SHT_REL . +.TP +.IR .relaNAME +This section holds relocation information as described below. +If the file +has a loadable segment that includes relocation, the section's attributes +will include the +.BR SHF_ALLOC +bit. +Otherwise the bit will be off. +By convention, +"NAME" +is supplied by the section to which the relocations apply. +Thus a relocation +section for +.BR .text +normally would have the name +.BR .rela.text . +This section is of type +.BR SHT_RELA . +.TP +.IR .rodata +This section holds read-only data that typically contributes to a +nonwritable segment in the process image. +This section is of type +.BR SHT_PROGBITS . +The attribute used is +.BR SHF_ALLOC . +.TP +.IR .rodata1 +This section holds read-only data that typically contributes to a +nonwritable segment in the process image. +This section is of type +.BR SHT_PROGBITS . +The attribute used is +.BR SHF_ALLOC . +.TP +.IR .shstrtab +This section holds section names. +This section is of type +.BR SHT_STRTAB . +No attribute types are used. +.TP +.IR .strtab +This section holds strings, most commonly the strings that represent the +names associated with symbol table entries. +If the file has a loadable +segment that includes the symbol string table, the section's attributes +will include the +.BR SHF_ALLOC +bit. +Otherwise the bit will be off. +This section is of type +.BR SHT_STRTAB . +.TP +.IR .symtab +This section holds a symbol table. +If the file has a loadable segment +that includes the symbol table, the section's attributes will include +the +.BR SHF_ALLOC +bit. +Otherwise the bit will be off. +This section is of type +.BR SHT_SYMTAB . +.TP +.IR .text +This section holds the +"text", +or executable instructions, of a program. +This section is of type +.BR SHT_PROGBITS . +The attributes used are +.BR SHF_ALLOC +and +.BR SHF_EXECINSTR . +.\" .El +.PP +String table sections hold null-terminated character sequences, commonly +called strings. +The object file uses these strings to represent symbol +and section names. +One references a string as an index into the string +table section. +The first byte, which is index zero, is defined to hold +a null byte (\(aq\\0\(aq). +Similarly, a string table's last byte is defined to +hold a null byte, ensuring null termination for all strings. +.PP +An object file's symbol table holds information needed to locate and +relocate a program's symbolic definitions and references. +A symbol table +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 +The 32-bit and 64-bit versions have the same members, just in a different +order. +.\" .Bl -tag -width "st_value" +.TP 10 +.IR st_name +This member holds an index into the object file's symbol string table, +which holds character representations of the symbol names. +If the value +is nonzero, it represents a string table index that gives the symbol +name. +Otherwise, the symbol table has no name. +.TP +.IR st_value +This member gives the value of the associated symbol. +.TP +.IR st_size +Many symbols have associated sizes. +This member holds zero if the symbol +has no size or an unknown size. +.TP +.IR st_info +This member specifies the symbol's type and binding attributes: +.\" .Bl -tag -width "STT_SECTION" +.RS 10 +.TP 12 +.BR STT_NOTYPE +The symbol's type is not defined. +.TP +.BR STT_OBJECT +The symbol is associated with a data object. +.TP +.BR STT_FUNC +The symbol is associated with a function or other executable code. +.TP +.BR STT_SECTION +The symbol is associated with a section. +Symbol table entries of +this type exist primarily for relocation and normally have +.BR STB_LOCAL +bindings. +.TP +.BR STT_FILE +By convention, the symbol's name gives the name of the source file +associated with the object file. +A file symbol has +.BR STB_LOCAL +bindings, its section index is +.BR SHN_ABS , +and it precedes the other +.BR STB_LOCAL +symbols of the file, if it is present. +.TP +.BR STT_LOPROC +This value up to and including +.BR STT_HIPROC +is reserved for processor-specific semantics. +.TP +.BR STT_HIPROC +This value down to and including +.BR STT_LOPROC +is reserved for processor-specific semantics. +.\" .El +.\" .Bl -tag -width "STB_GLOBAL" +.TP +.BR STB_LOCAL +Local symbols are not visible outside the object file containing their +definition. +Local symbols of the same name may exist in multiple files +without interfering with each other. +.TP +.BR STB_GLOBAL +Global symbols are visible to all object files being combined. +One file's +definition of a global symbol will satisfy another file's undefined +reference to the same symbol. +.TP +.BR STB_WEAK +Weak symbols resemble global symbols, but their definitions have lower +precedence. +.TP +.BR STB_LOPROC +This value up to and including +.BR STB_HIPROC +is reserved for processor-specific semantics. +.TP +.BR STB_HIPROC +This value down to and including +.BR STB_LOPROC +is reserved for processor-specific semantics. +.IP +There are macros for packing and unpacking the binding and type fields: +.IP +.BR ELF32_ST_BIND (info) +or +.BR ELF64_ST_BIND (info) +extract a binding from an +.I st_info +value. +.IP +.BR ELF32_ST_TYPE (info) +or +.BR ELF64_ST_TYPE (info) +.br +extract a type from an +.I st_info +value. +.IP +.BR ELF32_ST_INFO "(bind, type)" +or +.BR ELF64_ST_INFO "(bind, type)" +.br +convert a binding and a type into an +.I st_info +value. +.RE +.\" .El +.TP +.IR st_other +This member defines the symbol visibility. +.\" .Bl -tag -width "STV_PROTECTED" +.RS 10 +.TP 16 +.PD 0 +.BR STV_DEFAULT +Default symbol visibility rules. +.TP +.BR STV_INTERNAL +Processor-specific hidden class. +.TP +.BR STV_HIDDEN +Symbol is unavailable in other modules. +.TP +.BR STV_PROTECTED +Not preemptible, not exported. +.PD +.PP +There are macros for extracting the visibility type: +.PP +.BR ELF32_ST_VISIBILITY (other) +or +.BR ELF64_ST_VISIBILITY (other) +.RE +.\" .El +.TP +.IR st_shndx +Every symbol table entry is +"defined" +in relation to some section. +This member holds the relevant section +header table index. +.\" .El +.PP +Relocation is the process of connecting symbolic references with +symbolic definitions. +Relocatable files must have information that +describes how to modify their section contents, thus allowing executable +and shared object files to hold the right information for a process's +program image. +Relocation entries are these data. +.PP +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 +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 +This member gives the location at which to apply the relocation action. +For a relocatable file, the value is the byte offset from the beginning +of the section to the storage unit affected by the relocation. +For an +executable file or shared object, the value is the virtual address of +the storage unit affected by the relocation. +.TP +.IR r_info +This member gives both the symbol table index with respect to which the +relocation must be made and the type of relocation to apply. +Relocation +types are processor specific. +When the text refers to a relocation +entry's relocation type or symbol table index, it means the result of +applying +.BR ELF_[32|64]_R_TYPE +or +.BR ELF[32|64]_R_SYM , +respectively, to the entry's +.IR r_info +member. +.TP +.IR r_addend +This member specifies a constant addend used to compute the value to be +stored into the relocatable field. +.\" .El +.PP +The .dynamic section contains a series of structures that hold relevant +dynamic linking information. +The d_tag member controls the interpretation +of 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 +This member may have any of the following values: +.\" .Bl -tag -width "DT_SYMBOLIC" +.RS 10 +.TP 12 +.BR DT_NULL +Marks end of dynamic section +.TP +.BR DT_NEEDED +String table offset to name of a needed library +.TP +.BR DT_PLTRELSZ +Size in bytes of PLT relocs +.TP +.BR DT_PLTGOT +Address of PLT and/or GOT +.TP +.BR DT_HASH +Address of symbol hash table +.TP +.BR DT_STRTAB +Address of string table +.TP +.BR DT_SYMTAB +Address of symbol table +.TP +.BR DT_RELA +Address of Rela relocs table +.TP +.BR DT_RELASZ +Size in bytes of Rela table +.TP +.BR DT_RELAENT +Size in bytes of a Rela table entry +.TP +.BR DT_STRSZ +Size in bytes of string table +.TP +.BR DT_SYMENT +Size in bytes of a symbol table entry +.TP +.BR DT_INIT +Address of the initialization function +.TP +.BR DT_FINI +Address of the termination function +.TP +.BR DT_SONAME +String table offset to name of shared object +.TP +.BR DT_RPATH +String table offset to library search path (deprecated) +.TP +.BR DT_SYMBOLIC +Alert linker to search this shared object before the executable for symbols +.TP +.BR DT_REL +Address of Rel relocs table +.TP +.BR DT_RELSZ +Size in bytes of Rel table +.TP +.BR DT_RELENT +Size in bytes of a Rel table entry +.TP +.BR DT_PLTREL +Type of reloc the PLT refers (Rela or Rel) +.TP +.BR DT_DEBUG +Undefined use for debugging +.TP +.BR DT_TEXTREL +Absence of this indicates no relocs should apply to a nonwritable segment +.TP +.BR DT_JMPREL +Address of reloc entries solely for the PLT +.TP +.BR DT_BIND_NOW +Instruct dynamic linker to process all relocs before transferring control to +the executable +.TP +.BR DT_RUNPATH +String table offset to library search path +.TP +.BR DT_LOPROC +Start of processor-specific semantics +.TP +.BR DT_HIPROC +End of processor-specific semantics +.RE +.\" .El +.TP +.IR d_val +This member represents integer values with various interpretations. +.TP +.IR d_ptr +This member represents program virtual addresses. +When interpreting +these addresses, the actual address should be computed based on the +original file value and memory base address. +Files do not contain +relocation entries to fixup these addresses. +.TP +.I _DYNAMIC +Array containing all the dynamic structures in the .dynamic section. +This is automatically populated by the linker. +.\" .El +.SH NOTES +.\" OpenBSD +.\" ELF support first appeared in +.\" OpenBSD 1.2, +.\" although not all supported platforms use it as the native +.\" binary file format. +ELF first appeared in +System V. +The ELF format is an adopted standard. +.\" .SH AUTHORS +.\" The original version of this manual page was written by +.\" .An Jeroen Ruigrok van der Werven +.\" .Aq asmodai@FreeBSD.org +.\" with inspiration from BSDi's +.\" .Bsx +.\" .Nm elf +.\" man page. +.SH SEE ALSO +.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/original/man5/environ.5 b/original/man5/environ.5 new file mode 100644 index 00000000..36189bfe --- /dev/null +++ b/original/man5/environ.5 @@ -0,0 +1,2 @@ +.so man7/environ.7 +.\" FIXME . this link will eventually be removed (created Apr 2006) diff --git a/original/man5/filesystems.5 b/original/man5/filesystems.5 new file mode 100644 index 00000000..5a5c01ca --- /dev/null +++ b/original/man5/filesystems.5 @@ -0,0 +1,184 @@ +.\" Copyright 1996 Daniel Quinlan (Daniel.Quinlan@linux.org) +.\" +.\" 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. +.\" +.\" 2007-12-14 mtk Added Reiserfs, XFS, JFS. +.\" +.TH FILESYSTEMS 5 2007-12-14 "Linux" "Linux Programmer's Manual" +.nh +.SH NAME +filesystems \- Linux file-system types: minix, ext, ext2, ext3, Reiserfs, +XFS, JFS, xia, msdos, +umsdos, vfat, proc, nfs, iso9660, hpfs, sysv, smb, ncpfs +.SH DESCRIPTION +When, as is customary, the +.B proc +file system is mounted on +.IR /proc , +you can find in the file +.I /proc/filesystems +which file systems your kernel currently supports. +If you need a currently unsupported one, insert the corresponding +module or recompile the kernel. + +In order to use a file system, you have to +.I mount +it; see +.BR mount (8). + +Below a short description of a few of the available file systems. +.TP 10 +.B "minix" +is the file system used in the Minix operating system, the first to run +under Linux. +It has a number of shortcomings: a 64MB partition size +limit, short filenames, a single timestamp, etc. +It remains useful for floppies and RAM disks. +.TP +.B ext +is an elaborate extension of the +.B minix +file system. +It has been completely superseded by the second version +of the extended file system +.RB ( ext2 ) +and has been removed from the kernel (in 2.1.21). +.TP +.B ext2 +is the high performance disk file system used by Linux for fixed disks +as well as removable media. +The second extended file system was designed as an extension of the +extended file system +.RB ( ext ). +.B ext2 +offers the best performance (in terms of speed and CPU usage) of +the file systems supported under Linux. +.TP +.B ext3 +is a journaling version of the ext2 file system. +It is easy to +switch back and forth between ext2 and ext3. +.TP +.B Reiserfs +is a journaling file system, designed by Hans Reiser, +that was integrated into Linux in kernel 2.4.1. +.TP +.B XFS +is a journaling file system, developed by SGI, +that was integrated into Linux in kernel 2.4.20. +.TP +.B JFS +is a journaling file system, developed by IBM, +that was integrated into Linux in kernel 2.4.24. +.TP +.B xiafs +was designed and implemented to be a stable, safe file system by +extending the Minix file system code. +It provides the basic most +requested features without undue complexity. +The +.B xia +file system is no longer actively developed or maintained. +It was removed from the kernel in 2.1.21. +.TP +.B msdos +is the file system used by DOS, Windows, and some OS/2 computers. +.B msdos +filenames can be no longer than 8 characters, followed by an +optional period and 3 character extension. +.TP +.B umsdos +is an extended DOS file system used by Linux. +It adds capability for +long filenames, UID/GID, POSIX permissions, and special files +(devices, named pipes, etc.) under the DOS file system, without +sacrificing compatibility with DOS. +.TP +.B vfat +is an extended DOS file system used by Microsoft Windows95 and Windows NT. +VFAT adds the capability to use long filenames under the MSDOS file system. +.TP +.B proc +is a pseudo file system which is used as an interface to kernel data +structures rather than reading and interpreting +.IR /dev/kmem . +In particular, its files do not take disk space. +See +.BR proc (5). +.TP +.B iso9660 +is a CD-ROM file system type conforming to the ISO 9660 standard. +.RS +.TP +.B "High Sierra" +Linux supports High Sierra, the precursor to the ISO 9660 standard for +CD-ROM file systems. +It is automatically recognized within the +.B iso9660 +file-system support under Linux. +.TP +.B "Rock Ridge" +Linux also supports the System Use Sharing Protocol records specified +by the Rock Ridge Interchange Protocol. +They are used to further describe the files in the +.B iso9660 +file system to a Unix host, and provide information such as long +filenames, UID/GID, POSIX permissions, and devices. +It is automatically recognized within the +.B iso9660 +file-system support under Linux. +.RE +.TP +.B hpfs +is the High Performance Filesystem, used in OS/2. +This file system is +read-only under Linux due to the lack of available documentation. +.TP +.B sysv +is an implementation of the SystemV/Coherent file system for Linux. +It implements all of Xenix FS, SystemV/386 FS, and Coherent FS. +.TP +.B nfs +is the network file system used to access disks located on remote computers. +.TP +.B smb +is a network file system that supports the SMB protocol, used by +Windows for Workgroups, Windows NT, and Lan Manager. +.sp +To use +.B smb +fs, you need a special mount program, which can be found in the ksmbfs +package, found at +.IR ftp://sunsite.unc.edu/pub/Linux/system/Filesystems/smbfs . +.TP +.B ncpfs +is a network file system that supports the NCP protocol, used by +Novell NetWare. +.sp +To use +.BR ncpfs , +you need special programs, which can be found at +.IR ftp://linux01.gwdg.de/pub/ncpfs . +.SH "SEE ALSO" +.BR proc (5), +.BR fsck (8), +.BR mkfs (8), +.BR mount (8) diff --git a/original/man5/fs.5 b/original/man5/fs.5 new file mode 100644 index 00000000..3ec300ca --- /dev/null +++ b/original/man5/fs.5 @@ -0,0 +1 @@ +.so man5/filesystems.5 diff --git a/original/man5/ftpusers.5 b/original/man5/ftpusers.5 new file mode 100644 index 00000000..df4f3586 --- /dev/null +++ b/original/man5/ftpusers.5 @@ -0,0 +1,50 @@ +.\" Copyright (c) 2000 Christoph J. Thompson +.\" +.\" 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. +.\" +.\" 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. +.TH FTPUSERS 5 2000-08-27 "Linux" "Linux Programmer's Manual" +.SH NAME +ftpusers \- list of users that may not log in via the FTP daemon +.SH DESCRIPTION +The text file +.B ftpusers +contains a list of users that may not log in using the +File Transfer Protocol (FTP) server daemon. +This file is used not merely for +system administration purposes but for improving security within a TCP/IP +networked environment. +It will typically contain a list of the users that +either have no business using ftp or have too many privileges to be allowed +to log in through the FTP server daemon. +Such users usually include root, daemon, bin, uucp, and news. +If your FTP server daemon doesn't use +.B ftpusers +then it is suggested that you read its documentation to find out how to +block access for certain users. +Washington University FTP server Daemon +(wuftpd) and Professional FTP Daemon (proftpd) are known to make use of +.BR ftpusers . +.SS Format +The format of +.B ftpusers +is very simple. +There is one account name (or username) per line. +Lines starting with a # are ignored. +.SH FILES +.I /etc/ftpusers +.SH "SEE ALSO" +.BR passwd (5), +.BR proftpd (8), +.BR wuftpd (8) diff --git a/original/man5/group.5 b/original/man5/group.5 new file mode 100644 index 00000000..6467948d --- /dev/null +++ b/original/man5/group.5 @@ -0,0 +1,59 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:06:03 1993 by Rik Faith (faith@cs.unc.edu) +.TH GROUP 5 2009-10-17 "Linux" "Linux Programmer's Manual" +.SH NAME +group \- user group file +.SH DESCRIPTION +\fI/etc/group\fP is a text file which defines the groups on the system. +There is one entry per line, with the following format: +.sp +.RS +group_name:password:GID:user_list +.RE +.sp +The field descriptions are: +.IP group_name +the name of the group. +.IP password +the (encrypted) group password. +If this field is empty, no password is needed. +.IP GID +the numerical group ID. +.IP user_list +a list of the usernames that are members of this group, separated by commas. +.SH FILES +/etc/group +.SH BUGS +As the 4.2BSD +.BR initgroups (3) +man page says: No-one seems to keep +.I /etc/group +up-to-date. +.SH "SEE ALSO" +.BR login (1), +.BR newgrp (1), +.BR getgrent (3), +.BR getgrnam (3), +.BR passwd (5) diff --git a/original/man5/host.conf.5 b/original/man5/host.conf.5 new file mode 100644 index 00000000..189e2e98 --- /dev/null +++ b/original/man5/host.conf.5 @@ -0,0 +1,203 @@ +.\" Copyright (c) 1997 Martin Schulze (joey@infodrom.north.de) +.\" +.\" 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. +.\" +.\" Much of the text is copied from the manpage of resolv+(8). +.\" +.\" 2003-08-23 Martin Schulze Updated according to glibc 2.3.2 +.TH HOST.CONF 5 2003-08-23 "Linux" "Linux System Administration" +.SH NAME +host.conf \- resolver configuration file +.SH DESCRIPTION +The file +.I /etc/host.conf +contains configuration information specific to the resolver library. +It should contain one configuration keyword per line, followed by +appropriate configuration information. +The keywords recognized are +.IR order ", " trim ", " multi ", " nospoof ", " spoof ", and " reorder . +These keywords are described below. +.TP +.I order +This keyword specifies how host lookups are to be performed. +It should be followed by one or more lookup methods, separated by commas. +Valid methods are +.IR bind ", " hosts ", and " nis . +.TP +.I trim +This keyword may be listed more than once. +Each time it should be +followed by a list of domains, separated by colons (\(aq:\(aq), semicolons +(\(aq;\(aq) or commas (\(aq,\(aq), with the leading dot. +When set, the +resolv+ library will automatically trim the given domain name from the +end of any hostname resolved via DNS. +This is intended for use with +local hosts and domains. +(Related note: trim will not affect hostnames +gathered via NIS or the hosts file. +Care should be taken to +ensure that the first hostname for each entry in the hosts file is +fully qualified or unqualified, as appropriate for the local +installation.) +.TP +.I multi +Valid values are +.IR on " and " off . +If set to +.IR on , +the resolv+ library will return all valid addresses for a host that +appears in the +.I /etc/hosts +file, +instead of only the first. +This is +.I off +by default, as it may cause a substantial performance loss at sites +with large hosts files. +.TP +.I nospoof +Valid values are +.IR on " and " off . +If set to +.IR on , +the resolv+ library will attempt to prevent hostname spoofing to +enhance the security of +.BR rlogin " and " rsh . +It works as follows: after performing a host address lookup, resolv+ +will perform a hostname lookup for that address. +If the two hostnames +do not match, the query will fail. +The default value is +.IR off . +.TP +.I spoofalert +Valid values are +.IR on " and " off . +If this option is set to +.I on +and the +.I nospoof +option is also set, resolv+ will log a warning of the error via the +syslog facility. +The default value is +.IR off . +.TP +.I spoof +Valid values are +.IR off ", " nowarn " and " warn . +If this option is set to +.IR off , +spoofed addresses are permitted and no warnings will be emitted +via the syslog facility. +If this option is set to +.IR warn , +resolv+ will attempt to prevent hostname spoofing to +enhance the security and log a warning of the error via the syslog +facility. +If this option is set to +.IR nowarn , +the resolv+ library will attempt to prevent hostname spoofing to +enhance the security but not emit warnings via the syslog facility. +Setting this option to anything else is equal to setting it to +.IR nowarn . +.TP +.I reorder +Valid values are +.IR on " and " off . +If set to +.IR on , +resolv+ will attempt to reorder host addresses so that local addresses +(i.e., on the same subnet) are listed first when a +.BR gethostbyname (3) +is performed. +Reordering is done for all lookup methods. +The default value is +.IR off . +.SH ENVIRONMENT +There are six environment variables that can be used to allow users to +override the behavior which is configured in +.IR /etc/host.conf . +.TP +.B RESOLV_HOST_CONF +If set this variable points to a file that should be read instead of +.IR /etc/host.conf . +.TP +.B RESOLV_SERV_ORDER +Overrides the +.I order +command. +.TP +.B RESOLV_SPOOF_CHECK +Overrides the +.IR nospoof ", " spoofalert " and " spoof +commands in the same way as the +.I spoof +command is parsed. +Valid values are +.IR off ", " nowarn " and " warn . +.TP +.B RESOLV_MULTI +Overrides the +.I multi +command. +.TP +.B RESOLV_REORDER +Overrides the +.I reorder +command. +.TP +.B RESOLV_ADD_TRIM_DOMAINS +A list of domains, separated by colons (\(aq:\(aq), semicolons (\(aq;\(aq) or +commas (\(aq,\(aq), with the leading dot, which will be added to the list of +domains that should be trimmed. +.TP +.B RESOLV_OVERRIDE_TRIM_DOMAINS +A list of domains, separated by colons (\(aq:\(aq), semicolons (\(aq;\(aq) or +commas (\(aq,\(aq), with the leading dot, which will replace the list of +domains that should be trimmed. +Overrides the +.I trim +command. +.SH FILES +.TP +.I /etc/host.conf +Resolver configuration file +.TP +.I /etc/resolv.conf +Resolver configuration file +.TP +.I /etc/hosts +Local hosts database +.SH NOTES +The following differences exist compared to the original implementation. +A new command +.I spoof +and a new environment variable +.B RESOLV_SPOOF_CHECK +can take arguments like +.IR off ", " nowarn " and " warn . +Line comments can appear anywhere and not only at the beginning of a line. +.SH "SEE ALSO" +.BR gethostbyname (3), +.BR hostname (7), +.BR named (8), +.BR resolv+ (8) diff --git a/original/man5/hosts.5 b/original/man5/hosts.5 new file mode 100644 index 00000000..64c1dfee --- /dev/null +++ b/original/man5/hosts.5 @@ -0,0 +1,124 @@ +.\" Hey, Emacs! This is an -*- nroff -*- source file. +.\" Copyright (c) 2000 Manoj Srivastava +.\" +.\" 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. +.\" +.\" Minor polishing, aeb +.\" Modified, 2002-06-16, Mike Coleman +.\" +.TH HOSTS 5 2002-06-16 "Linux" "Linux Programmer's Manual" +.SH NAME +hosts \- The static table lookup for hostnames +.SH SYNOPSIS +.B /etc/hosts +.SH DESCRIPTION +This manual page describes the format of the +.I /etc/hosts +file. +This file is a simple text file that associates IP addresses +with hostnames, one line per IP address. +For each host a single +line should be present with the following information: +.RS +.PP +IP_address canonical_hostname [aliases...] +.RE +.PP +Fields of the entry are separated by any number of blanks and/or +tab characters. +Text from a "#" character until the end of the line is +a comment, and is ignored. +Host names may contain only alphanumeric +characters, minus signs ("\-"), and periods ("."). +They must begin with an +alphabetic character and end with an alphanumeric character. +Optional aliases provide for name changes, alternate spellings, +shorter hostnames, or generic hostnames (for example, +.IR localhost ). +.PP +The Berkeley Internet Name Domain (BIND) Server implements the +Internet name server for Unix systems. +It augments or replaces the +.I /etc/hosts +file or hostname lookup, and frees a host from relying on +.I /etc/hosts +being up to date and complete. +.PP +In modern systems, even though the host table has been superseded by +DNS, it is still widely used for: +.TP +.B bootstrapping +Most systems have a small host table containing the name and address +information for important hosts on the local network. +This is useful +when DNS is not running, for example during system bootup. +.TP +.B NIS +Sites that use NIS use the host table as input to the NIS host +database. +Even though NIS can be used with DNS, most NIS sites still +use the host table with an entry for all local hosts as a backup. +.TP +.B isolated nodes +Very small sites that are isolated from the network use the host table +instead of DNS. +If the local information rarely changes, and the +network is not connected to the Internet, DNS offers little +advantage. +.SH FILES +.I /etc/hosts +.SH NOTES +Modifications to this file normally take effect immediately, +except in cases where the file is cached by applications. +.SS "Historical Notes" +RFC\ 952 gave the original format for the host table, though it has +since changed. + +Before the advent of DNS, the host table was the only way of resolving +hostnames on the fledgling Internet. +Indeed, this file could be +created from the official host data base maintained at the Network +Information Control Center (NIC), though local changes were often +required to bring it up to date regarding unofficial aliases and/or +unknown hosts. +The NIC no longer maintains the hosts.txt files, +though looking around at the time of writing (circa 2000), there are +historical hosts.txt files on the WWW. +I just found three, from 92, +94, and 95. +.SH EXAMPLE +.nf +127.0.0.1 localhost +192.168.1.10 foo.mydomain.org foo +192.168.1.13 bar.mydomain.org bar +146.82.138.7 master.debian.org master +209.237.226.90 www.opensource.org +.fi +.SH "SEE ALSO" +.BR hostname (1), +.BR resolver (3), +.BR resolver (5), +.BR hostname (7), +.BR named (8), +Internet RFC\ 952 +.\" .SH AUTHOR +.\" This manual page was written by Manoj Srivastava , +.\" for the Debian GNU/Linux system. diff --git a/original/man5/hosts.equiv.5 b/original/man5/hosts.equiv.5 new file mode 100644 index 00000000..dfee0235 --- /dev/null +++ b/original/man5/hosts.equiv.5 @@ -0,0 +1,65 @@ +.\" Copyright (c) 1995 Peter Tobias +.\" This file may be distributed under the GNU General Public License. +.TH HOSTS.EQUIV 5 2003-08-24 "Linux" "Linux Programmer's Manual" +.SH NAME +/etc/hosts.equiv \- list of hosts and users that are granted "trusted" +\fBr\fP command access to your system +.SH DESCRIPTION +The \fBhosts.equiv\fP file allows or denies hosts and users to use +the \fBr\fP-commands (e.g., \fBrlogin\fP, \fBrsh\fP or \fBrcp\fP) without +supplying a password. +.PP +The file uses the following format: +.TP +\fI[ + | \- ]\fP \fI[hostname]\fP \fI[username]\fP +.PP +The \fIhostname\fP is the name of a host which is logically equivalent +to the local host. +Users logged into that host are allowed to access +like-named user accounts on the local host without supplying a password. +The \fIhostname\fP may be (optionally) preceded by a plus (+) sign. +If the plus sign is used alone it allows any host to access your system. +You can explicitly deny access to a host by preceding the \fIhostname\fP +by a minus (\-) sign. +Users from that host must always supply a password. +For security reasons you should always use the FQDN of the hostname and +not the short hostname. +.PP +The \fIusername\fP entry grants a specific user access to all user +accounts (except root) without supplying a password. +That means the +user is NOT restricted to like-named accounts. +The \fIusername\fP may +be (optionally) preceded by a plus (+) sign. +You can also explicitly +deny access to a specific user by preceding the \fIusername\fP with +a minus (\-) sign. +This says that the user is not trusted no matter +what other entries for that host exist. +.PP +Netgroups can be specified by preceding the netgroup by an @ sign. +.PP +Be extremely careful when using the plus (+) sign. +A simple typographical +error could result in a standalone plus sign. +A standalone plus sign is +a wildcard character that means "any host"! +.SH FILES +.I /etc/hosts.equiv +.SH NOTES +Some systems will only honor the contents of this file when it has owner +root and no write permission for anybody else. +Some exceptionally +paranoid systems even require that there be no other hard links to the file. +.PP +Modern systems use the Pluggable Authentication Modules library (PAM). +With PAM a standalone plus sign is only considered a wildcard +character which means "any host" when the word +.I promiscuous +is added to the auth component line in your PAM file for +the particular service +.RB "(e.g., " rlogin ). +.SH "SEE ALSO" +.BR rhosts (5), +.BR rlogind (8), +.BR rshd (8) diff --git a/original/man5/intro.5 b/original/man5/intro.5 new file mode 100644 index 00000000..2a36fcd9 --- /dev/null +++ b/original/man5/intro.5 @@ -0,0 +1,38 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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) +.TH INTRO 5 2007-10-23 "Linux" "Linux Programmer's Manual" +.SH NAME +intro \- Introduction to file formats +.SH DESCRIPTION +Section 5 of the manual describes various file formats and protocols, +and the corresponding C structures, if any. +.SH NOTES +.SS Authors and Copyright Conditions +Look at the header of the manual page source for the author(s) and copyright +conditions. +Note that these can be different from page to page! +.SH "SEE ALSO" +.BR standards (7) diff --git a/original/man5/ipc.5 b/original/man5/ipc.5 new file mode 100644 index 00000000..c5bca410 --- /dev/null +++ b/original/man5/ipc.5 @@ -0,0 +1 @@ +.so man7/svipc.7 diff --git a/original/man5/issue.5 b/original/man5/issue.5 new file mode 100644 index 00000000..d890a70f --- /dev/null +++ b/original/man5/issue.5 @@ -0,0 +1,41 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sun Jul 25 11:06:22 1993 by Rik Faith +.\" Modified Mon Oct 21 17:47:19 EDT 1996 by Eric S. Raymond +.TH ISSUE 5 1993-07-24 "Linux" "Linux Programmer's Manual" +.SH NAME +issue \- prelogin message and identification file +.SH DESCRIPTION +The file \fI/etc/issue\fP is a text file which contains a message or +system identification to be printed before the login prompt. +It may contain various \fB@\fP\fIchar\fP and \fB\e\fP\fIchar\fP +sequences, if supported by the +.BR getty -type +program employed on the system. +.SH FILES +/etc/issue +.SH "SEE ALSO" +.BR motd (5), +.BR agetty (8), +.BR mingetty (8) diff --git a/original/man5/locale.5 b/original/man5/locale.5 new file mode 100644 index 00000000..83ce0e40 --- /dev/null +++ b/original/man5/locale.5 @@ -0,0 +1,617 @@ +.\" Hey Emacs, this is -*- nroff -*- +.\" +.\" This file is part of locale(1) which displays the settings of the +.\" current locale. +.\" Copyright (C) 1994 Jochen Hein (Hein@Student.TU-Clausthal.de) +.\" Copyright (C) 2008 Petr Baudis (pasky@suse.cz) +.\" +.\" 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, USA. +.\" +.\" 2008-06-17 Petr Baudis +.\" LC_TIME: Describe first_weekday and first_workday +.\" +.TH LOCALE 5 2008-06-17 "Linux" "Linux User Manual" +.SH NAME +locale \- Describes a locale definition file +.SH DESCRIPTION +The +.B locale +definition files contains all the information that the +.BR localedef (1) +command needs to convert it into the binary locale database. + +The definition files consist of sections which each describe a +locale category in detail. +.SS Syntax +The locale definition file starts with a header that may consist +of the following keywords: +.TP +.I +is followed by a character that should be used as the +escape-character for the rest of the file to mark characters that +should be interpreted in a special way. +It defaults to the backslash (\\). +.TP +.I +is followed by a character that will be used as the +comment-character for the rest of the file. +It defaults to the number sign (#). +.PP +The locale definition has one part for each locale category. +Each part can be copied from another existing locale or +can be defined from scratch. +If the category should be copied, +the only valid keyword in the definition is +.B copy +followed by the name of the locale which should be copied. +.\" FIXME glibc 2.2.2 added new nonstandard locale categories: +.\" LC_ADDRESS, LC_IDENTIFICATION, LC_MEASUREMENT, LC_NAME, +.\" LC_PAPER, LC_TELEPHONE. These need to be documented. +.SS LC_CTYPE +The definition for the +.B LC_CTYPE +category starts with the string +.I LC_CTYPE +in the first column. + +There are the following keywords allowed: +.TP +.I upper +followed by a list of uppercase letters. +The letters +.B A +through +.B Z +are included automatically. +Characters also specified as +.BR cntrl , +.BR digit , +.BR punct , +or +.B space +are not allowed. +.TP +.I lower +followed by a list of lowercase letters. +The letters +.B a +through +.B z +are included automatically. +Characters also specified as +.BR cntrl , +.BR digit , +.BR punct , +or +.B space +are not allowed. +.TP +.I alpha +followed by a list of letters. +All character specified as either +.B upper +or +.B lower +are automatically included. +Characters also specified as +.BR cntrl , +.BR digit , +.BR punct , +or +.B space +are not allowed. +.TP +.I digit +followed by the characters classified as numeric digits. +Only the +digits +.B 0 +through +.B 9 +are allowed. +They are included by default in this class. +.TP +.I space +followed by a list of characters defined as white-space +characters. +Characters also specified as +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR graph , +or +.B xdigit +are not allowed. +The characters +.BR , +.BR , +.BR , +.BR , +.BR , +and +.B +are automatically included. +.TP +.I cntrl +followed by a list of control characters. +Characters also specified as +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR punct , +.BR graph , +.BR print , +or +.B xdigit +are not allowed. +.TP +.I punct +followed by a list of punctuation characters. +Characters also +specified as +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR cntrl , +.BR xdigit , +or the +.B +character are not allowed. +.TP +.I graph +followed by a list of printable characters, not including the +.B +character. +The characters defined as +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR xdigit , +and +.B punct +are automatically included. +Characters also specified as +.B cntrl +are not allowed. +.TP +.I print +followed by a list of printable characters, including the +.B +character. +The characters defined as +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR xdigit , +.BR punct , +and the +.B +character are automatically included. +Characters also specified as +.B cntrl +are not allowed. +.TP +.I xdigit +followed by a list of characters classified as hexadecimal +digits. +The decimal digits must be included followed by one or +more set of six characters in ascending order. +The following +characters are included by default: +.B 0 +through +.BR 9 , +.B a +through +.BR f , +.B A +through +.BR F . +.TP +.I blank +followed by a list of characters classified as +.BR blank . +The characters +.B +and +.B +are automatically included. +.TP +.I toupper +followed by a list of mappings from lowercase to uppercase +letters. +Each mapping is a pair of a lowercase and an uppercase letter +separated with a +.B , +and enclosed in parentheses. +The members of the list are separated +with semicolons. +.TP +.I tolower +followed by a list of mappings from uppercase to lowercase +letters. +If the keyword tolower is not present, the reverse of the +toupper list is used. +.PP +The +.B LC_CTYPE +definition ends with the string +.IR "END LC_CYTPE" . +.SS LC_COLLATE +The +.B LC_COLLATE +category defines the rules for collating characters. +Due to +limitations of libc not all POSIX-options are implemented. + +The definition starts with the string +.B LC_COLLATE +in the first column. + +There are the following keywords allowed: +.TP +.I collating-element +.TP +.I collating-symbol +.PP +The order-definition starts with a line: +.TP +.I order_start +.PP +followed by a list of keywords out of +.BR forward , +.BR backward , +or +.BR position . +The order definition consists of lines that describe the order +and is terminated with the keyword +.TP +.IR order_end . +.PP +For more details see the sources in +.I /usr/lib/nls/src +notably the examples +.BR POSIX , +.B Example +and +.B Example2 +.PP +The +.B LC_COLLATE +definition ends with the string +.IR "END LC_COLLATE" . +.SS LC_MONETARY +The definition starts with the string +.B LC_MONETARY +in the first column. + +There are the following keywords allowed: +.TP +.I int_curr_symbol +followed by the international currency symbol. +This must be a +4-character string containing the international currency symbol as +defined by the ISO 4217 standard (three characters) followed by a +separator. +.TP +.I currency_symbol +followed by the local currency symbol. +.TP +.I mon_decimal_point +followed by the string that will be used as the decimal delimiter +when formatting monetary quantities. +.TP +.I mon_thousands_sep +followed by the string that will be used as a group separator +when formatting monetary quantities. +.TP +.I mon_grouping +followed by a string that describes the formatting of numeric +quantities. +.TP +.I positive_sign +followed by a string that is used to indicate a positive sign for +monetary quantities. +.TP +.I negative_sign +followed by a string that is used to indicate a negative sign for +monetary quantities. +.TP +.I int_frac_digits +followed by the number of fractional digits that should be used when +formatting with the +.BR int_curr_symbol . +.TP +.I frac_digits +followed by the number of fractional digits that should be used when +formatting with the +.BR currency_symbol . +.TP +.I p_cs_precedes +followed by an integer set to +.B 1 +if the +.I currency_symbol +or +.I int_curr_symbol +should precede the formatted monetary quantity or set to +.B 0 +if the symbol succeeds the value. +.TP +.I p_sep_by_space +followed by an integer. +.RS +.TP +.B 0 +means that no space should be printed between the symbol and the +value. +.TP +.B 1 +means that a space should be printed between the symbol and the +value. +.TP +.B 2 +means that a space should be printed between the symbol and the +sign string, if adjacent. +.RE +.TP +.I n_cs_precedes +.RS +.TP +.B 0 +- the symbol succeeds the value. +.TP +.B 1 +- the symbol precedes the value. +.RE +.TP +.I n_sep_by_space +An integer set to +.B 0 +if no space separates the +.I currency_symbol +or +.I int_curr_symbol +from the value for a negative monetary quantity, set to +.B 1 +if a space separates the symbol from the value and set to +.B 2 +if a space separates the symbol and the sign string, if adjacent. +.TP +.I p_sign_posn +.RS +.TP +.B 0 +Parentheses enclose the quantity and the +.I currency_symbol +or +.IR int_curr_symbol . +.TP +.B 1 +The sign string precedes the quantity and the +.I currency_symbol +or the +.IR int_curr_symbol . +.TP +.B 2 +The sign string succeeds the quantity and the +.I currency_symbol +or the +.IR int_curr_symbol . +.TP +.B 3 +The sign string precedes the +.I currency_symbol +or the +.IR int_curr_symbol . +.TP +.B 4 +The sign string succeeds the +.I currency_symbol +or the +.IR int_curr_symbol . +.RE +.TP +.I n_sign_posn +.RS +.TP +.B 0 +Parentheses enclose the quantity and the +.I currency_symbol +or +.IR int_curr_symbol . +.TP +.B 1 +The sign string precedes the quantity and the +.I currency_symbol +or the +.IR int_curr_symbol . +.TP +.B 2 +The sign string succeeds the quantity and the +.I currency_symbol +or the +.IR int_curr_symbol . +.TP +.B 3 +The sign string precedes the +.I currency_symbol +or the +.IR int_curr_symbol . +.TP +.B 4 +The sign string succeeds the +.I currency_symbol +or the +.IR int_curr_symbol . +.RE +.PP +The +.B LC_MONETARY +definition ends with the string +.IR "END LC_MONETARY" . +.SS LC_NUMERIC +The definition starts with the string +.B LC_NUMERIC +in the first column. + +The following keywords are allowed: +.TP +.I decimal_point +followed by the string that will be used as the decimal delimiter +when formatting numeric quantities. +.TP +.I thousands_sep +followed by the string that will be used as a group separator +when formatting numeric quantities. +.TP +.I grouping +followed by a string that describes the formatting of numeric +quantities. +.PP +The +.B LC_NUMERIC +definition ends with the string +.IR "END LC_NUMERIC" . +.SS LC_TIME +The definition starts with the string +.B LC_TIME +in the first column. + +The following keywords are allowed: +.TP +.I abday +followed by a list of abbreviated weekday names. +The list starts with the first day of the week +as specified by +.I week +(Sunday by default). +.TP +.I day +followed by a list of weekday names. +The list starts with the first day of the week +as specified by +.I week +(Sunday by default). +.TP +.I abmon +followed by a list of abbreviated month names. +.TP +.I mon +followed by a list of month names. +.TP +.I am_pm +The appropriate representation of the +.B am +and +.B pm +strings. +.TP +.I d_t_fmt +The appropriate date and time format. +.TP +.I d_fmt +The appropriate date format. +.TP +.I t_fmt +The appropriate time format. +.TP +.I t_fmt_ampm +The appropriate time format when using 12h clock format. +.TP +.I week +followed by a list of three values: +The number of days in a week (by default 7), +a date of beginning of the week (by default corresponds to Sunday), +and the minimal length of the first week in year (by default 4). +Regarding the start of the week, +.B 19971130 +shall be used for Sunday and +.B 19971201 +shall be used for Monday. +Thus, countries using +.B 19971130 +should have local Sunday name as the first day in the +.I day +list, +while countries using +.B 19971201 +should have Monday translation as the first item in the +.I day +list. +.TP +.IR first_weekday " (since glibc 2.2)" +Number of the first day from the +.I day +list to be shown in calendar applications. +The default value of +.B 1 +corresponds to either Sunday or Monday depending +on the value of the second +.I week +list item. +.TP +.IR first_workday " (since glibc 2.2)" +Number of the first working day from the +.I day +list. +.PP +The +.B LC_TIME +definition ends with the string +.IR "END LC_TIME" . +.SS LC_MESSAGES +The definition starts with the string +.B LC_MESSAGES +in the first column. + +The following keywords are allowed: +.TP +.I yesexpr +followed by a regular expression that describes possible +yes-responses. +.TP +.I noexpr +followed by a regular expression that describes possible +no-responses. +.PP +The +.B LC_MESSAGES +definition ends with the string +.IR "END LC_MESSAGES" . + +See the POSIX.2 standard for details. +.SH FILES +/usr/lib/locale/ +\(em database for the current locale setting of that category +.br +/usr/lib/nls/charmap/* \(em charmap-files +.SH "CONFORMING TO" +POSIX.2, ISO/IEC 14652. +.SH BUGS +This manual page isn't complete. +.\" .SH AUTHOR +.\" Jochen Hein (Hein@Student.TU-Clausthal.de) +.SH "SEE ALSO" +.BR locale (1), +.BR localedef (1), +.BR localeconv (3), +.BR setlocale (3), +.BR charmap (5) diff --git a/original/man5/motd.5 b/original/man5/motd.5 new file mode 100644 index 00000000..cef58771 --- /dev/null +++ b/original/man5/motd.5 @@ -0,0 +1,41 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:08:16 1993 by Rik Faith +.\" Modified Mon Oct 21 17:47:19 EDT 1996 by Eric S. Raymond +.TH MOTD 5 1992-12-29 "Linux" "Linux Programmer's Manual" +.SH NAME +motd \- message of the day +.SH DESCRIPTION +The contents of \fI/etc/motd\fP are displayed by +.BR login (1) +after a successful login but just before it executes the login shell. + +The abbreviation "motd" stands for "message of the day", and this file +has been traditionally used for exactly that (it requires much less disk +space than mail to all users). +.SH FILES +/etc/motd +.SH "SEE ALSO" +.BR login (1), +.BR issue (5) diff --git a/original/man5/networks.5 b/original/man5/networks.5 new file mode 100644 index 00000000..37b524d7 --- /dev/null +++ b/original/man5/networks.5 @@ -0,0 +1,78 @@ +.\" 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 +.\" +.TH NETWORKS 5 2008-09-04 "GNU/Linux" "Linux System Administration" +.SH NAME +networks \- network name information +.SH DESCRIPTION +The file +.I /etc/networks +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 +.I name number aliases ... +.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. + +The field descriptions are: + +.TP +.I name +The symbolic name for the network. +Network names can contain any printable characters execept +white-space characters or the comment character. +.TP +.I number +The official number for this network in numbers-and-dots notation (see +.BR inet (3)). +The trailing ".0" (for the host component of the network address) may be omitted. +.TP +.I aliases +Optional aliases for the network. +.LP + +This file is read by the +.BR route (8) +and +.BR netstat (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 FILES +.TP +.I /etc/networks +The networks definition file. +.SH "SEE ALSO" +.BR getnetbyaddr (3), +.BR getnetbyname (3), +.BR getnetent (3), +.BR route (8), +.BR netstat (8) diff --git a/original/man5/nologin.5 b/original/man5/nologin.5 new file mode 100644 index 00000000..d84a5666 --- /dev/null +++ b/original/man5/nologin.5 @@ -0,0 +1,39 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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) +.TH NOLOGIN 5 1992-12-29 "Linux" "Linux Programmer's Manual" +.SH NAME +nologin \- prevent unprivileged users from logging into the system +.SH DESCRIPTION +If the file \fI/etc/nologin\fP exists, +.BR login (1) +will allow access only to root. +Other users will +be shown the contents of this file and their logins will be refused. +.SH FILES +/etc/nologin +.SH "SEE ALSO" +.BR login (1), +.BR shutdown (8) diff --git a/original/man5/nscd.conf.5 b/original/man5/nscd.conf.5 new file mode 100644 index 00000000..e564b34e --- /dev/null +++ b/original/man5/nscd.conf.5 @@ -0,0 +1,190 @@ +.\" -*- nroff -*- +.\" Copyright (c) 1999, 2000 SuSE GmbH Nuernberg, Germany +.\" Author: Thorsten Kukuk +.\" +.\" 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; see the file COPYING. If not, +.\" write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +.\" Boston, MA 02111-1307, USA. +.\" +.TH NSCD.CONF 5 1999-10-01 "GNU" "Linux Programmer's Manual" +.SH NAME +/etc/nscd.conf \- name service cache daemon configuration file +.SH DESCRIPTION +The file +.I /etc/nscd.conf +is read from +.BR nscd (8) +at startup. +Each line specifies either an attribute and a value, or an +attribute, service, and a value. +Fields are separated either by SPACE +or TAB characters. +A \(aq#\(aq (number sign) indicates the beginning of a +comment; following characters, up to the end of the line, +are not interpreted by nscd. + +Valid services are \fIpasswd\fP, \fIgroup\fP, or \fIhosts\fP. + +.B logfile +.I debug-file-name +.RS +Specifies name of the file to which debug info should be written. +.RE + +.B debug-level +.I value +.RS +Sets the desired debug level. +.RE + +.B threads +.I number +.RS +This is the number of threads that are started to wait for +requests. +At least five threads will always be created. +.RE + +.B server-user +.I user +.RS +If this option is set, nscd will run as this user and not as root. +If a separate cache for every user is used (\-S parameter), this +option is ignored. +.RE + +.B enable-cache +.I service +.I +.RS +Enables or disables the specified +.I service +cache. +.RE + +.B positive-time-to-live +.I service +.I value +.RS +Sets the TTL (time-to-live) for positive entries (successful queries) +in the specified cache for +.IR service . +.I Value +is in seconds. +Larger values increase cache hit rates and reduce mean +response times, but increase problems with cache coherence. +.RE + +.B negative-time-to-live +.I service +.I value +.RS +Sets the TTL (time-to-live) for negative entries (unsuccessful queries) +in the specified cache for +.IR service . +.I Value +is in seconds. +Can result in significant performance improvements if there +are several files owned by UIDs (user IDs) not in system databases (for +example untarring the linux kernel sources as root); should be kept small +to reduce cache coherency problems. +.RE + +.B suggested-size +.I service +.I value +.RS +This is the internal hash table size, +.I value +should remain a prime number for optimum efficiency. +.RE + +.B check-files +.I service +.I +.RS +Enables or disables checking the file belonging to the specified +.I service +for changes. +The files are +.IR /etc/passwd , +.IR /etc/group , +and +.IR /etc/hosts . +.RE + +.B max-threads +.I threads +.RS +Specifies the maximum number of threads to be started. +.RE + +.B stat-user +.I username +.RS +Specifies the user who is allowed to request statistics. +.RE + +.B reload-count +unlimited | +.I number +.RS +Limit on the number of times a cached entry gets reloaded without being used +before it gets removed. +The default is 5. +.RE + +.B paranoia +.I +.RS +Enabling paranoia mode causes nscd to restart itself periodically. +.RE + +.B restart-interval +.I time +.RS +Sets the restart interval to +.I time +seconds +if periodic restart is enabled by enabling +.B paranoia +mode. +.RE + +.B persistent +.I service +.I +.RS +Keep the content of the cache for +.I service +over server restarts; useful when +.B paranoia +mode is set. +.RE + +.B shared +.I service +.I +.RS +The memory mapping of the nscd databases for +.I service +is shared with the clients so +that they can directly search in them instead of having to ask the +daemon over the socket each time a lookup is performed. +.RE +.SH "SEE ALSO" +.BR nscd (8) +.\" .SH AUTHOR +.\" .B nscd +.\" was written by Thorsten Kukuk and Ulrich Drepper. diff --git a/original/man5/nsswitch.conf.5 b/original/man5/nsswitch.conf.5 new file mode 100644 index 00000000..c4f16a28 --- /dev/null +++ b/original/man5/nsswitch.conf.5 @@ -0,0 +1,285 @@ +.\" Copyright (c) 1998, 1999 Thorsten Kukuk (kukuk@vt.uni-paderborn.de) +.\" +.\" 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 manual page based on the GNU C Library info pages. +.\" FIXME ? The use of quotes on this page is inconsistent with the +.\" rest of man-pages. +.\" +.TH NSSWITCH.CONF 5 1999-01-17 "Linux" "Linux Programmer's Manual" +.SH NAME +nsswitch.conf \- System Databases and Name Service Switch configuration file +.SH DESCRIPTION +Various functions in the C Library need to be configured to work +correctly in the local environment. +Traditionally, this was done by +using files (e.g., \fI/etc/passwd\fP), but other nameservices (like the +Network Information Service (NIS) and the Domain Name Service (DNS)) +became popular, and were hacked into the C library, usually with a fixed +search order. +.LP +The Linux libc5 with NYS support and the GNU C Library 2.x (libc.so.6) +contain a cleaner solution of this problem. +It is designed after a method +used by Sun Microsystems in the C library of Solaris 2. +We follow their +name and call this scheme "Name Service Switch" (NSS). +The sources for +the "databases" and their lookup order are specified in the +.I /etc/nsswitch.conf +file. +.LP +The following databases are available in the NSS: +.TP +.B aliases +Mail aliases, used by +.BR sendmail (8). +Presently ignored. +.TP +.B ethers +Ethernet numbers. +.TP +.B group +Groups of users, used by +.BR getgrent (3) +functions. +.TP +.B hosts +Host names and numbers, used by +.BR gethostbyname (3) +and similar functions. +.TP +.B netgroup +Network wide list of hosts and users, used for access rules. +C libraries before glibc 2.1 only support netgroups over NIS. +.TP +.B networks +Network names and numbers, used by +.BR getnetent (3) +functions. +.TP +.B passwd +User passwords, used by +.BR getpwent (3) +functions. +.TP +.B protocols +Network protocols, used by +.BR getprotoent (3) +functions. +.TP +.B publickey +Public and secret keys for Secure_RPC used by NFS and NIS+. +.TP +.B rpc +Remote procedure call names and numbers, used by +.BR getrpcbyname (3) +and similar functions. +.TP +.B services +Network services, used by +.BR getservent (3) +functions. +.TP +.B shadow +Shadow user passwords, used by +.BR getspnam (3). +.LP +An example +.I /etc/nsswitch.conf +(namely, the default used when +.I /etc/nsswitch.conf +is missing): +.sp 1n +.PD 0 +.TP 16 +passwd: +compat +.TP +group: +compat +.TP +shadow: +compat +.sp 1n +.TP +hosts: +dns [!UNAVAIL=return] files +.TP +networks: +nis [NOTFOUND=return] files +.TP +ethers: +nis [NOTFOUND=return] files +.TP +protocols: +nis [NOTFOUND=return] files +.TP +rpc: +nis [NOTFOUND=return] files +.TP +services: +nis [NOTFOUND=return] files +.PD +.LP +The first column is the database. +The rest of the line specifies how the lookup process works. +You can specify the way it works for each database individually. +.LP +The configuration specification for each database can contain two +different items: +.PD 0 +.TP +* The service specification like `files', `db', or `nis'. +.TP +* The reaction on lookup result like `[NOTFOUND=return]'. +.PD +.LP +For libc5 with NYS, the allowed service specifications are `files', `nis', +and `nisplus'. +For hosts, you could specify `dns' as extra service, for +passwd and group `compat', but not for shadow. +.LP +For glibc, you must have a file called +.BI /lib/libnss_SERVICE.so. X +for every SERVICE you are using. +On a standard installation, you could use +`files', `db', `nis', and `nisplus'. +For hosts, you could specify `dns' as +extra service, for passwd, group, and shadow `compat'. +These services will not +be used by libc5 with NYS. +The version number +.I X +is 1 for glibc 2.0 and 2 for glibc 2.1. +.LP +The second item in the specification gives the user much finer +control on the lookup process. +Action items are placed between two +service names and are written within brackets. +The general form is +.LP +`[' ( `!'? STATUS `=' ACTION )+ `]' +.LP +where +.sp 1n +.PD 0 +.TP +STATUS => success | notfound | unavail | tryagain +.TP +ACTION => return | continue +.PD +.LP +The case of the keywords is insignificant. +The STATUS values are +the results of a call to a lookup function of a specific service. +They mean: +.TP +.B success +No error occurred and the wanted entry is returned. +The default +action for this is `return'. +.TP +.B notfound +The lookup process works ok but the needed value was not found. +The default action is `continue'. +.TP +.B unavail +The service is permanently unavailable. +This can either mean the +needed file is not available, or, for DNS, the server is not +available or does not allow queries. +The default action is +`continue'. +.TP +.B tryagain +The service is temporarily unavailable. +This could mean a file is +locked or a server currently cannot accept more connections. +The default action is `continue'. +.SS Interaction with +/\- syntax (compat mode) +Linux libc5 without NYS does not have the name service switch but does +allow the user some policy control. +In +.I /etc/passwd +you could have entries of the form +user or +@netgroup +(include the specified user from the NIS passwd map), +\-user or \-@netgroup (exclude the specified user), +and + (include every user, except the excluded ones, from the NIS +passwd map). +Since most people only put a + at the end of +.I /etc/passwd +to include everything from NIS, the switch provides a faster +alternative for this case (`passwd: files nis') which doesn't +require the single + entry in +.IR /etc/passwd , +.IR /etc/group , +and +.IR /etc/shadow . +If this is not sufficient, the NSS `compat' service provides full ++/\- semantics. +By default, the source is `nis', but this may be +overridden by specifying `nisplus' as source for the pseudo-databases +.BR passwd_compat , +.B group_compat +and +.BR shadow_compat . +These pseudo-databases are only available in GNU C Library. +.SH FILES +A service named SERVICE is implemented by a shared object library named +.BI libnss_SERVICE.so. X +that resides in +.IR /lib . +.TP 25 +.PD 0 +.I /etc/nsswitch.conf +configuration file +.TP +.BI /lib/libnss_compat.so. X +implements `compat' source for glibc2 +.TP +.BI /lib/libnss_db.so. X +implements `db' source for glibc2 +.TP +.BI /lib/libnss_dns.so. X +implements `dns' source for glibc2 +.TP +.BI /lib/libnss_files.so. X +implements `files' source for glibc2 +.TP +.BI /lib/libnss_hesiod.so. X +implements `hesiod' source for glibc2 +.TP +.BI /lib/libnss_nis.so. X +implements `nis' source for glibc2 +.TP +.I /lib/libnss_nisplus.so.2 +implements `nisplus' source for glibc 2.1 +.PD +.SH NOTES +Within each process that uses +.BR nsswitch.conf , +the entire file is read only once; if the file is later changed, the +process will continue using the old configuration. +.LP +With Solaris, it isn't possible to link programs using the NSS Service +statically. +With Linux, this is no problem. diff --git a/original/man5/numa_maps.5 b/original/man5/numa_maps.5 new file mode 100644 index 00000000..de68c0b7 --- /dev/null +++ b/original/man5/numa_maps.5 @@ -0,0 +1,5 @@ +.so man7/numa.7 +.\" As part of the numactl() package, the /proc/PID/numa_maps +.\" documentation was in a numa_maps.5 page; this link +.\" ensures that "man 5 numa_maps" still works. +.\" Eventually, we may want to remove it -- mtk, Aug 2008 diff --git a/original/man5/passwd.5 b/original/man5/passwd.5 new file mode 100644 index 00000000..35b4bf66 --- /dev/null +++ b/original/man5/passwd.5 @@ -0,0 +1,142 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sun Jul 25 10:46:28 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Aug 21 18:12:27 1994 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Jun 18 01:53:57 1995 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Mon Jan 5 20:24:40 MET 1998 by Michael Haardt +.\" (michael@cantor.informatik.rwth-aachen.de) +.TH PASSWD 5 1998-01-05 "Linux" "Linux Programmer's Manual" +.SH NAME +passwd \- password file +.SH DESCRIPTION +.B Passwd +is a text file, that contains a list of the system's accounts, +giving for each account some useful information like user ID, +group ID, home directory, shell, etc. +Often, it also contains the encrypted passwords for each account. +It should have general read permission (many utilities, like +.BR ls (1) +use it to map user IDs to usernames), but write access only for the +superuser. +.PP +In the good old days there was no great problem with this general +read permission. +Everybody could read the encrypted passwords, but the +hardware was too slow to crack a well-chosen password, and moreover, the +basic assumption used to be that of a friendly user-community. +These days many people run some version of the shadow password suite, where +.I /etc/passwd +has asterisks (*) instead of encrypted passwords, +and the encrypted passwords are in +.I /etc/shadow +which is readable by the superuser only. +.PP +Regardless of whether shadow passwords are used, many sysadmins +use an asterisk in the encrypted password field to make sure +that this user can not authenticate him- or herself using a +password. +(But see the Notes below.) +.PP +If you create a new login, first put an asterisk in the password field, +then use +.BR passwd (1) +to set it. +.PP +There is one entry per line, and each line has the format: +.sp +.RS +account:password:UID:GID:GECOS:directory:shell +.RE +.sp +The field descriptions are: +.RS +.TP 1.0in +.I account +the name of the user on the system. +It should not contain capital letters. +.TP +.I password +the encrypted user password, an asterisk (*), or the letter \(aqx\(aq. +(See +.BR pwconv (8) +for an explanation of \(aqx\(aq.) +.TP +.I UID +the numerical user ID. +.TP +.I GID +the numerical primary group ID for this user. +.TP +.I GECOS +This field is optional and only used for informational purposes. +Usually, it contains the full username. +GECOS means General Electric +Comprehensive Operating System, which has been renamed to GCOS when +GE's large systems division was sold to Honeywell. +Dennis Ritchie has reported: "Sometimes we sent printer output or +batch jobs to the GCOS machine. +The gcos field in the password file was a place to stash the +information for the $IDENTcard. +Not elegant." +.TP +.I directory +the user's +.B $HOME +directory. +.TP +.I shell +the program to run at login (if empty, use +.IR /bin/sh ). +If set to a nonexistent executable, the user will be unable to login +through +.BR login (1). +.RE +.SH FILES +.I /etc/passwd +.SH NOTES +If you want to create +user groups, their GIDs must be equal and there must be an entry in +\fI/etc/group\fP, or no group will exist. +.PP +If the encrypted password is set to an asterisk, the user will be unable +to login using +.BR login (1), +but may still login using +.BR rlogin (1), +run existing processes and initiate new ones through +.BR rsh (1), +.BR cron (8), +.BR at (1), +or mail filters, etc. +Trying to lock an account by simply changing the +shell field yields the same result and additionally allows the use of +.BR su (1). +.SH "SEE ALSO" +.BR login (1), +.BR passwd (1), +.BR su (1), +.BR getpwent (3), +.BR getpwnam (3), +.BR group (5), +.BR shadow (5) diff --git a/original/man5/proc.5 b/original/man5/proc.5 new file mode 100644 index 00000000..9b8757eb --- /dev/null +++ b/original/man5/proc.5 @@ -0,0 +1,2608 @@ +.\" 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. +.\" +.TH PROC 5 2009-09-30 "Linux" "Linux Programmer's Manual" +.SH NAME +proc \- process information pseudo-file system +.SH DESCRIPTION +The +.I proc +file system is a pseudo-file system which is used as an interface to +kernel data structures. +It is commonly mounted at +.IR /proc . +Most of it is read-only, but some files allow kernel variables to be +changed. +.LP +The following outline gives a quick tour through the +.I /proc +hierarchy. +.PD 1 +.TP +.I /proc/[pid] +There is a numerical subdirectory for each running process; the +subdirectory is named by the process ID. +Each such subdirectory contains the following +pseudo-files and directories. +.\" FIXME Describe /proc/[pid]/attr and +.\" /proc/[pid]/task/[tid]/attr +.\" This is a directory +.\" Added in ??? +.\" CONFIG_SECURITY +.\" +.TP +.IR /proc/[pid]/auxv " (since 2.6.0-test7)" +This contains the contents of the ELF interpreter information passed +to the process at exec time. +The format is one \fIunsigned long\fP ID +plus one \fIunsigned long\fP value for each entry. +The last entry contains two zeros. +.\" 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 +This holds the complete command line for the process, +unless the process is a zombie. +.\" In 2.3.26, this also used to be true if the process was swapped out. +In the latter case, there is nothing in this file: +that is, a read on this file will return 0 characters. +The command-line arguments appear in this file as a set of +null-separated strings, +with a further null byte (\(aq\\0\(aq) after the last string. +.TP +.IR /proc/[pid]/coredump_filter " (since kernel 2.6.23)" +See +.BR core (5). +.TP +.IR /proc/[pid]/cpuset " (since kernel 2.6.12)" +.\" and/proc/[pid]/task/[tid]/cpuset +See +.BR cpuset (7). +.TP +.I /proc/[pid]/cwd +This is a symbolic link to the current working directory of the process. +To find out the current working directory of process 20, +for instance, you can do this: + +.in +4n +.nf +.RB "$" " cd /proc/20/cwd; /bin/pwd" +.fi +.in + +Note that the +.I pwd +command is often a shell built-in, and might +not work properly. +In +.BR bash (1), +you may use +.IR "pwd\ \-P" . + +.\" The following was still true as at kernel 2.6.13 +In a multithreaded process, the contents of this symbolic link +are not available if the main thread has already terminated +(typically by calling +.BR pthread_exit (3)). +.TP +.I /proc/[pid]/environ +This file contains the environment for the process. +The entries are separated by null bytes (\(aq\\0\(aq), +and there may be a null byte at the end. +Thus, to print out the environment of process 1, you would do: +.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 +Under Linux 2.2 and later, this file is a symbolic link +containing the actual pathname of the executed command. +This symbolic link can be dereferenced normally; attempting to open +it will open the executable. +You can even type +.I /proc/[pid]/exe +to run another copy of the same executable as is being run by +process [pid]. +.\" The following was still true as at kernel 2.6.13 +In a multithreaded process, the contents of this symbolic link +are not available if the main thread has already terminated +(typically by calling +.BR pthread_exit (3)). + +Under Linux 2.0 and earlier +.I /proc/[pid]/exe +is a pointer to the binary which was executed, +and appears as a symbolic link. +A +.BR readlink (2) +call on this file under Linux 2.0 returns a string in the format: + + [device]:inode + +For example, [0301]:1502 would be inode 1502 on device major 03 (IDE, +MFM, etc. drives) minor 01 (first partition on the first drive). + +.BR find (1) +with the +.I \-inum +option can be used to locate the file. +.TP +.I /proc/[pid]/fd +This is a subdirectory containing one entry for each file which the +process has open, named by its file descriptor, and which is a +symbolic link to the actual file. +Thus, 0 is standard input, 1 standard output, 2 standard error, etc. + +.\" The following was still true as at kernel 2.6.13 +In a multithreaded process, the contents of this directory +are not available if the main thread has already terminated +(typically by calling +.BR pthread_exit (3)). + +Programs that will take a filename as a command-line argument, +but will not take input from standard input if no argument is supplied, +or that write to a file named as a command-line argument, +but will not send their output to standard output +if no argument is supplied, can nevertheless be made to use +standard input or standard out using +.IR /proc/[pid]/fd . +For example, assuming that +.I \-i +is the flag designating an input file and +.I \-o +is the flag designating an output file: +.in +4n +.nf + +.RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..." +.fi +.in + +and you have a working filter. +.\" The following is not true in my tests (MTK): +.\" Note that this will not work for +.\" programs that seek on their files, as the files in the fd directory +.\" are not seekable. + +.I /proc/self/fd/N +is approximately the same as +.I /dev/fd/N +in some Unix and Unix-like systems. +Most Linux MAKEDEV scripts symbolically link +.I /dev/fd +to +.IR /proc/self/fd , +in fact. + +Most systems provide symbolic links +.IR /dev/stdin , +.IR /dev/stdout , +and +.IR /dev/stderr , +which respectively link to the files +.IR 0 , +.IR 1 , +and +.IR 2 +in +.IR /proc/self/fd . +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 +.IR /proc/[pid]/fdinfo/ " (since kernel 2.6.22)" +This is a subdirectory containing one entry for each file which the +process has open, named by its file descriptor. +The contents of each file can be read to obtain information +about the corresponding file descriptor, for example: +.in +4n +.nf + +.RB "$" " cat /proc/12015/fdinfo/4" +pos: 1000 +flags: 01002002 +.fi +.in + +The +.I pos +field is a decimal number showing the current file offset. +The +.I flags +field is an octal number that displays the +file access mode and file status flags (see +.BR open (2)). + +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 +.IR /proc/[pid]/limits " (since kernel 2.6.24)" +This file displays the soft limit, hard limit, and units of measurement +for each of the process's resource limits (see +.BR getrlimit (2)). +The file is protected to only allow reading by the real UID of the process. +.TP +.I /proc/[pid]/maps +A file containing the currently mapped memory regions and their access +permissions. + +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 + +where "address" is the address space in the process that it occupies, +"perms" is a set of permissions: + +.nf +.in +5 +r = read +w = write +x = execute +s = shared +p = private (copy on write) +.fi +.in + +"offset" is the offset into the file/whatever, "dev" is the device +(major:minor), and "inode" is the inode on that device. +0 indicates that no inode is associated with the memory region, +as the case would be with BSS (uninitialized data). + +Under Linux 2.0 there is no field giving pathname. +.TP +.I /proc/[pid]/mem +This file can be used to access the pages of a process's memory through +.BR open (2), +.BR read (2), +and +.BR lseek (2). +.TP +.IR /proc/[pid]/mountinfo " (since Linux 2.6.26)" +.\" This info adapted from Documentation/filesystems/proc.txt +This file contains information about mount points. +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 +The numbers in parentheses are labels for the descriptions below: +.RS 7 +.TP 5 +(1) +mount ID: unique identifier of the mount (may be reused after +.BR umount (2)). +.TP +(2) +parent ID: ID of parent mount (or of self for the top of the mount tree). +.TP +(3) +major:minor: value of +.I st_dev +for files on file system (see +.BR stat (2)). +.TP +(4) +root: root of the mount within the file system. +.TP +(5) +mount point: mount point relative to the process's root. +.TP +(6) +mount options: per-mount options. +.TP +(7) +optional fields: zero or more fields of the form "tag[:value]". +.TP +(8) +separator: marks the end of the optional fields. +.TP +(9) +file system type: name of file system in the form "type[.subtype]". +.TP +(10) +mount source: file system-specific information or "none". +.TP +(11) +super options: per-super block options. +.RE +.IP +Parsers should ignore all unrecognized optional fields. +Currently the possible optional fields are: +.RS 12 +.TP 18 +shared:X +mount is shared in peer group X +.TP +master:X +mount is slave to peer group X +.TP +propagate_from:X +mount is slave and receives propagation from peer group X (*) +.TP +unbindable +mount is unbindable +.RE +.IP +(*) X is the closest dominant peer group under the process's root. +If X is the immediate master of the mount, +or if there is no dominant peer group under the same root, +then only the "master:X" field is present +and not the "propagate_from:X" field. + +For more information on mount propagation see: +.I Documentation/filesystems/sharedsubtree.txt +in the kernel source tree. +.TP +.IR /proc/[pid]/mounts " (since Linux 2.4.19)" +This is a list of all the file systems currently mounted in the +process's mount namespace. +The format of this file is documented in +.BR fstab (5). +Since kernel version 2.6.15, this file is pollable: +after opening the file for reading, a change in this file +(i.e., a file system mount or unmount) causes +.BR select (2) +to mark the file descriptor as readable, and +.BR poll (2) +and +.BR epoll_wait (2) +mark the file as having an error condition. +.TP +.IR /proc/[pid]/mountstats " (since Linux 2.6.17)" +This file exports information (statistics, configuration information) +about the mount points in the process's name space. +Lines in this file have the form: +.nf + +device /dev/sda7 mounted on /home with fstype ext3 [statistics] +( 1 ) ( 2 ) (3 ) (4) +.fi +.IP +The fields in each line are: +.RS 7 +.TP 5 +(1) +The name of the mounted device +(or "nodevice" if there is no corresponding device). +.TP +(2) +The mount point within the file system tree. +.TP +(3) +The file system type. +.TP +(4) +Optional statistics and configuration information. +Currently (as at Linux 2.6.26), only NFS file systems export +information via this field. +.RE +.IP +This file is only readable by the owner of the process. +.TP +.IR /proc/[pid]/numa_maps " (since Linux 2.6.14)" +See +.BR numa (7). +.TP +.IR /proc/[pid]/oom_adj " (since Linux 2.6.11)" +This file can be used to adjust the score used to select which process +should be killed in an out-of-memory (OOM) situation. +The kernel uses this value for a bit-shift operation of the process's +.IR oom_score +value: +valid values are in the range \-16 to +15, +plus the special value \-17, +which disables OOM-killing altogether for this process. +A positive score increases the likelihood of this +process being killed by the OOM-killer; +a negative score decreases the likelihood. +The default value for this file is 0; +a new process inherits its parent's +.I oom_adj +setting. +A process must be privileged +.RB ( CAP_SYS_RESOURCE ) +to update this file. +.TP +.IR /proc/[pid]/oom_score " (since Linux 2.6.11)" +.\" See mm/oom_kill.c::badness() in the 2.6.25 sources +This file displays the current score that the kernel gives to +this process for the purpose of selecting a process +for the OOM-killer. +A higher score means that the process is more likely to be +selected by the OOM-killer. +The basis for this score is the amount of memory used by the process, +with increases (+) or decreases (\-) for factors including: +.\" See mm/oom_kill.c::badness() in the 2.6.25 sources +.RS +.IP * 2 +whether the process creates a lot of children using +.BR fork (2) +(+); +.IP * +whether the process has been running a long time, +or has used a lot of CPU time (\-); +.IP * +whether the process has a low nice value (i.e., > 0) (+); +.IP * +whether the process is privileged (\-); and +.\" More precisely, if it has CAP_SYS_ADMIN or CAP_SYS_RESOURCE +.IP * +whether the process is making direct hardware access (\-). +.\" More precisely, if it has CAP_SYS_RAWIO +.RE +.IP +The +.I oom_score +also reflects the bit-shift adjustment specified by the +.I oom_adj +setting for the process. +.\" FIXME Describe /proc/[pid]/pagemap +.\" Added in 2.6.25 +.\" CONFIG_PROC_PAGE_MONITOR +.TP +.I /proc/[pid]/root +Unix and Linux support the idea of a per-process root of the +file system, set by the +.BR chroot (2) +system call. +This file is a symbolic link that points to the process's +root directory, and behaves as exe, fd/*, etc. do. + +.\" The following was still true as at kernel 2.6.13 +In a multithreaded process, the contents of this symbolic link +are not available if the main thread has already terminated +(typically by calling +.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 +.IR /proc/[pid]/smaps " (since Linux 2.6.14)" +.\" CONFIG_PROC_PAGE_MONITOR +This file shows memory consumption for each of the process's mappings. +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 +The first of these lines shows the same information as is displayed +for the mapping in +.IR /proc/[pid]/maps . +The remaining lines show the size of the mapping, +the amount of the mapping that is currently resident in RAM, +the number of clean and dirty shared pages in the mapping, +and the number of clean and dirty private pages in the mapping. + +This file is only present if the +.B CONFIG_MMU +kernel configuration +option is enabled. +.TP +.I /proc/[pid]/stat +Status information about the process. +This is used by +.BR ps (1). +It is defined in +.IR /usr/src/linux/fs/proc/array.c "." + +The fields, in order, with their proper +.BR scanf (3) +format specifiers, are: +.RS +.TP 12 +\fIpid\fP %d +The process ID. +.TP +\fIcomm\fP %s +The filename of the executable, in parentheses. +This is visible whether or not the executable is swapped out. +.TP +\fIstate\fP %c +One character from the string "RSDZTW" where R is running, S is +sleeping in an interruptible wait, D is waiting in uninterruptible +disk sleep, Z is zombie, T is traced or stopped (on a signal), +and W is paging. +.TP +\fIppid\fP %d +The PID of the parent. +.TP +\fIpgrp\fP %d +The process group ID of the process. +.TP +\fIsession\fP %d +The session ID of the process. +.TP +\fItty_nr\fP %d +The controlling terminal of the process. +(The minor device number is contained in the combination of bits +31 to 20 and 7 to 0; +the major device number is in bits 15 t0 8.) +.TP +\fItpgid\fP %d +.\" This field and following, up to and including wchan added 0.99.1 +The ID of the foreground process group of the controlling +terminal of the process. +.TP +\fIflags\fP %u (%lu before Linux 2.6.22) +The kernel flags word of the process. +For bit meanings, +see the PF_* defines in +.IR . +Details depend on the kernel version. +.TP +\fIminflt\fP %lu +The number of minor faults the process has made which have not +required loading a memory page from disk. +.TP +.\" field 11 +\fIcminflt\fP %lu +The number of minor faults that the process's +waited-for children have made. +.TP +\fImajflt\fP %lu +The number of major faults the process has made which have +required loading a memory page from disk. +.TP +\fIcmajflt\fP %lu +The number of major faults that the process's +waited-for children have made. +.TP +\fIutime\fP %lu +Amount of time that this process has been scheduled in user mode, +measured in clock ticks (divide by +.IR sysconf(_SC_CLK_TCK) . +This includes guest time, \fIguest_time\fP +(time spent running a virtual CPU, see below), +so that applications that are not aware of the guest time field +do not lose that time from their calculations. +.TP +\fIstime\fP %lu +Amount of time that this process has been scheduled in kernel mode, +measured in clock ticks (divide by +.IR sysconf(_SC_CLK_TCK) . +.TP +\fIcutime\fP %ld +Amount of time that this process's +waited-for children have been scheduled in user mode, +measured in clock ticks (divide by +.IR sysconf(_SC_CLK_TCK) . +(See also +.BR times (2).) +This includes guest time, \fIcguest_time\fP +(time spent running a virtual CPU, see below). +.TP +\fIcstime\fP %ld +Amount of time that this process's +waited-for children have been scheduled in kernel mode, +measured in clock ticks (divide by +.IR sysconf(_SC_CLK_TCK) . +.TP +\fIpriority\fP %ld +(Explanation for Linux 2.6) +For processes running a real-time scheduling policy +.RI ( policy +below; see +.BR sched_setscheduler (2)), +this is the negated scheduling priority, minus one; +that is, a number in the range \-2 to \-100, +corresponding to real-time priorities 1 to 99. +For processes running under a non-real-time scheduling policy, +this is the raw nice value +.RB ( setpriority (2)) +as represented in the kernel. +The kernel stores nice values as numbers +in the range 0 (high) to 39 (low), +corresponding to the user-visible nice range of \-20 to 19. + +Before Linux 2.6, this was a scaled value based on +the scheduler weighting given to this process. +.\" And back in kernel 1.2 days things were different again. +.TP +\fInice\fP %ld +The nice value (see +.BR setpriority (2)), +a value in the range 19 (low priority) to \-20 (high priority). +.\" Back in kernel 1.2 days things were different. +.TP +.\" .TP +.\" \fIcounter\fP %ld +.\" The current maximum size in jiffies of the process's next timeslice, +.\" or what is currently left of its current timeslice, if it is the +.\" currently running process. +.\" .TP +.\" \fItimeout\fP %u +.\" The time in jiffies of the process's next timeout. +.\" timeout was removed sometime around 2.1/2.2 +\fInum_threads\fP %ld +Number of threads in this process (since Linux 2.6). +Before kernel 2.6, this field was hard coded to 0 as a placeholder +for an earlier removed field. +.TP +.\" field 21 +\fIitrealvalue\fP %ld +The time in jiffies before the next +.B SIGALRM +is sent to the process due to an interval timer. +Since kernel 2.6.17, this field is no longer maintained, +and is hard coded as 0. +.TP +\fIstarttime\fP %llu (was %lu before Linux 2.6) +The time in jiffies the process started after system boot. +.TP +\fIvsize\fP %lu +Virtual memory size in bytes. +.TP +\fIrss\fP %ld +Resident Set Size: number of pages the process has in real memory. +This is just the pages which +count towards text, data, or stack space. +This does not include pages +which have not been demand-loaded in, or which are swapped out. +.TP +\fIrsslim\fP %lu +Current soft limit in bytes on the rss of the process; +see the description of +.B RLIMIT_RSS +in +.BR getpriority (2). +.TP +\fIstartcode\fP %lu +The address above which program text can run. +.TP +\fIendcode\fP %lu +The address below which program text can run. +.TP +\fIstartstack\fP %lu +The address of the start (i.e., bottom) of the stack. +.TP +\fIkstkesp\fP %lu +The current value of ESP (stack pointer), as found in the +kernel stack page for the process. +.TP +\fIkstkeip\fP %lu +The current EIP (instruction pointer). +.TP +.\" field 31 +\fIsignal\fP %lu +The bitmap of pending signals, displayed as a decimal number. +Obsolete, because it does not provide information on real-time signals; use +.I /proc/[pid]/status +instead. +.TP +\fIblocked\fP %lu +The bitmap of blocked signals, displayed as a decimal number. +Obsolete, because it does not provide information on real-time signals; use +.I /proc/[pid]/status +instead. +.TP +\fIsigignore\fP %lu +The bitmap of ignored signals, displayed as a decimal number. +Obsolete, because it does not provide information on real-time signals; use +.I /proc/[pid]/status +instead. +.TP +\fIsigcatch\fP %lu +The bitmap of caught signals, displayed as a decimal number. +Obsolete, because it does not provide information on real-time signals; use +.I /proc/[pid]/status +instead. +.TP +\fIwchan\fP %lu +This is the "channel" in which the process is waiting. +It is the +address of a system call, and can be looked up in a namelist if you +need a textual name. +(If you have an up-to-date +.IR /etc/psdatabase , +then +try \fIps \-l\fP to see the WCHAN field in action.) +.TP +\fInswap\fP %lu +.\" nswap was added in 2.0 +Number of pages swapped (not maintained). +.TP +\fIcnswap\fP %lu +.\" cnswap was added in 2.0 +Cumulative \fInswap\fP for child processes (not maintained). +.TP +\fIexit_signal\fP %d (since Linux 2.1.22) +Signal to be sent to parent when we die. +.TP +\fIprocessor\fP %d (since Linux 2.2.8) +CPU number last executed on. +.TP +\fIrt_priority\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22) +Real-time scheduling priority, a number in the range 1 to 99 for +processes scheduled under a real-time policy, +or 0, for non-real-time processes (see +.BR sched_setscheduler (2)). +.TP +.\" field 41 +\fIpolicy\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22) +Scheduling policy (see +.BR sched_setscheduler (2)). +Decode using the SCHED_* constants in +.IR linux/sched.h . +.TP +\fIdelayacct_blkio_ticks\fP %llu (since Linux 2.6.18) +Aggregated block I/O delays, measured in clock ticks (centiseconds). +.TP +\fIguest_time\fP %lu (since Linux 2.6.24) +Guest time of the process (time spent running a virtual CPU +for a guest operating system), measured in clock ticks (divide by +.IR sysconf(_SC_CLK_TCK) . +.TP +\fIcguest_time\fP %ld (since Linux 2.6.24) +Guest time of the process's children, measured in clock ticks (divide by +.IR sysconf(_SC_CLK_TCK) . +.RE +.TP +.I /proc/[pid]/statm +Provides information about memory usage, measured in pages. +The columns are: +.in +4n +.nf + +size total program size + (same as VmSize in \fI/proc/[pid]/status\fP) +resident resident set size + (same as VmRSS in \fI/proc/[pid]/status\fP) +share shared pages (from shared mappings) +text text (code) +.\" (not including libs; broken, includes data segment) +lib library (unused in Linux 2.6) +data data + stack +.\" (including libs; broken, includes library text) +dt dirty pages (unused in Linux 2.6) +.fi +.in +.TP +.I /proc/[pid]/status +Provides much of the information in +.I /proc/[pid]/stat +and +.I /proc/[pid]/statm +in a format that's easier for humans to parse. +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 +The fields are as follows: +.RS +.IP * 2 +.IR Name : +Command run by this process. +.IP * +.IR State : +Current state of the process. One of +"R (running)", +"S (sleeping)", +"D (disk sleep)", +"T (stopped)", +"T (tracing stop)", +"Z (zombie)", +or +"X (dead)". +.IP * +.IR Tgid : +Thread group ID (i.e., Process ID). +.IP * +.IR Pid : +Thread ID (see +.BR gettid (2)). +.IP * +.IR TracerPid : +PID of process tracing this process (0 if not being traced). +.IP * +.IR Uid ", " Gid : +Real, effective, saved set, and file system UIDs (GIDs). +.IP * +.IR FDSize : +Number of file descriptor slots currently allocated. +.IP * +.IR Groups : +Supplementary group list. +.IP * +.IR VmPeak : +Peak virtual memory size. +.IP * +.IR VmSize : +Virtual memory size. +.IP * +.IR VmLck : +Locked memory size. +.IP * +.IR VmHWM : +Peak resident set size ("high water mark"). +.IP * +.IR VmRSS : +Resident set size. +.IP * +.IR VmData ", " VmStk ", " VmExe : +Size of data, stack, and text segments. +.IP * +.IR VmLib : +Shared library code size. +.IP * +.IR VmPTE : +Page table entries size (since Linux 2.6.10). +.IP * +.IR Threads : +Number of threads in process containing this thread. +.IP * +.IR SigPnd ", " ShdPnd : +Number of signals pending for thread and for process as a whole (see +.BR pthreads (7) +and +.BR signal (7)). +.IP * +.IR SigBlk ", " SigIgn ", " SigCgt : +Masks indicating signals being blocked, ignored, and caught (see +.BR signal (7)). +.IP * +.IR CapInh ", " CapPrm ", " CapEff : +Masks of capabilities enabled in inheritable, permitted, and effective sets +(see +.BR capabilities (7)). +.IP * +.IR CapBnd : +Capability Bounding set +(since kernel 2.6.26, see +.BR capabilities (7)). +.IP * +.IR Cpus_allowed : +Mask of CPUs on which this process may run +(since Linux 2.6.24, see +.BR cpuset (7)). +.IP * +.IR Cpus_allowed_list : +Same as previous, but in "list format" +(since Linux 2.6.26, see +.BR cpuset (7)). +.IP * +.IR Mems_allowed : +Mask of memory nodes allowed to this process +(since Linux 2.6.24, see +.BR cpuset (7)). +.IP * +.IR Mems_allowed_list : +Same as previous, but in "list format" +(since Linux 2.6.26, see +.BR cpuset (7)). +.IP * +.IR voluntary_context_switches ", " nonvoluntary_context_switches : +Number of voluntary and involuntary context switches (since Linux 2.6.23). +.RE +.TP +.IR /proc/[pid]/task " (since Linux 2.6.0-test6)" +This is a directory that contains one subdirectory +for each thread in the process. +The name of each subdirectory is the numerical thread ID +.RI ( [tid] ) +of the thread (see +.BR gettid (2)). +Within each of these subdirectories, there is a set of +files with the same names and contents as under the +.I /proc/[pid] +directories. +For attributes that are shared by all threads, the contents for +each of the files under the +.I task/[tid] +subdirectories will be the same as in the corresponding +file in the parent +.I /proc/[pid] +directory +(e.g., in a multithreaded process, all of the +.I task/[tid]/cwd +files will have the same value as the +.I /proc/[pid]/cwd +file in the parent directory, since all of the threads in a process +share a working directory). +For attributes that are distinct for each thread, +the corresponding files under +.I task/[tid] +may have different values (e.g., various fields in each of the +.I task/[tid]/status +files may be different for each thread). + +.\" The following was still true as at kernel 2.6.13 +In a multithreaded process, the contents of the +.I /proc/[pid]/task +directory are not available if the main thread has already terminated +(typically by calling +.BR pthread_exit (3)). +.TP +.I /proc/apm +Advanced power management version and battery information when +.B CONFIG_APM +is defined at kernel compilation time. +.TP +.I /proc/bus +Contains subdirectories for installed busses. +.TP +.I /proc/bus/pccard +Subdirectory for PCMCIA devices when +.B CONFIG_PCMCIA +is set at kernel compilation time. +.TP +.I /proc/bus/pccard/drivers +.TP +.I /proc/bus/pci +Contains various bus subdirectories and pseudo-files containing +information about PCI busses, installed devices, and device +drivers. +Some of these files are not ASCII. +.TP +.I /proc/bus/pci/devices +Information about PCI devices. +They may be accessed through +.BR lspci (8) +and +.BR setpci (8). +.TP +.I /proc/cmdline +Arguments passed to the Linux kernel at boot time. +Often done via a boot manager such as +.BR lilo (8) +or +.BR grub (8). +.TP +.IR /proc/config.gz " (since Linux 2.6)" +This file exposes the configuration options that were used +to build the currently running kernel, +in the same format as they would be shown in the +.I .config +file that resulted when configuring the kernel (using +.IR "make xconfig" , +.IR "make config" , +or similar). +The file contents are compressed; view or search them using +.BR zcat (1), +.BR zgrep (1), +etc. +As long as no changes have been made to the following file, +the contents of +.I /proc/config.gz +are the same as those provided by : +.in +4n +.nf + +cat /lib/modules/$(uname -r)/build/.config +.fi +.in +.IP +.I /proc/config.gz +is only provided if the kernel is configured with +.BR CONFIG_IKCONFIG_PROC . +.TP +.I /proc/cpuinfo +This is a collection of CPU and system architecture dependent items, +for each supported architecture a different list. +Two common entries are \fIprocessor\fP which gives CPU number and +\fIbogomips\fP; a system constant that is calculated +during kernel initialization. +SMP machines have information for +each CPU. +.TP +.I /proc/devices +Text listing of major numbers and device groups. +This can be used by MAKEDEV scripts for consistency with the kernel. +.TP +.IR /proc/diskstats " (since Linux 2.5.69)" +This file contains disk I/O statistics for each disk device. +See the kernel source file +.I Documentation/iostats.txt +for further information. +.TP +.I /proc/dma +This is a list of the registered \fIISA\fP DMA (direct memory access) +channels in use. +.TP +.I /proc/driver +Empty subdirectory. +.TP +.I /proc/execdomains +List of the execution domains (ABI personalities). +.TP +.I /proc/fb +Frame buffer information when +.B CONFIG_FB +is defined during kernel compilation. +.TP +.I /proc/filesystems +A text listing of the file systems which are supported by the kernel, +namely file systems which were compiled into the kernel or whose kernel +modules are currently loaded. +(See also +.BR filesystems (5).) +If a file system is marked with "nodev", +this means that it does not require a block device to be mounted +(e.g., virtual file system, network file system). + +Incidentally, this file may be used by +.BR mount (8) +when no file system is specified and it didn't manage to determine the +file system type. +Then file systems contained in this file are tried +(excepted those that are marked with "nodev"). +.TP +.I /proc/fs +Empty subdirectory. +.TP +.I /proc/ide +This directory +exists on systems with the IDE bus. +There are directories for each IDE channel and attached device. +Files include: + +.in +4n +.nf +cache buffer size in KB +capacity number of sectors +driver driver version +geometry physical and logical geometry +identify in hexadecimal +media media type +model manufacturer's model number +settings drive settings +smart_thresholds in hexadecimal +smart_values in hexadecimal +.fi +.in + +The +.BR hdparm (8) +utility provides access to this information in a friendly format. +.TP +.I /proc/interrupts +This is used to record the number of interrupts per CPU per IO device. +Since Linux 2.6.24, +for the i386 and x86_64 architectures, at least, this also includes +interrupts internal to the system (that is, not associated with a device +as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt), +and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling +interrupt), CAL (remote function call interrupt), and possibly others. +Very easy to read formatting, done in ASCII. +.TP +.I /proc/iomem +I/O memory map in Linux 2.4. +.TP +.I /proc/ioports +This is a list of currently registered Input-Output port regions that +are in use. +.TP +.IR /proc/kallsyms " (since Linux 2.5.71)" +This holds the kernel exported symbol definitions used by the +.BR modules (X) +tools to dynamically link and bind loadable modules. +In Linux 2.5.47 and earlier, a similar file with slightly different syntax +was named +.IR ksyms . +.TP +.I /proc/kcore +This file represents the physical memory of the system and is stored +in the ELF core file format. +With this pseudo-file, and an unstripped +kernel +.RI ( /usr/src/linux/vmlinux ) +binary, GDB can be used to +examine the current state of any kernel data structures. + +The total length of the file is the size of physical memory (RAM) plus +4KB. +.TP +.I /proc/kmsg +This file can be used instead of the +.BR syslog (2) +system call to read kernel messages. +A process must have superuser +privileges to read this file, and only one process should read this +file. +This file should not be read if a syslog process is running +which uses the +.BR syslog (2) +system call facility to log kernel messages. + +Information in this file is retrieved with the +.BR dmesg (1) +program. +.TP +.IR /proc/ksyms " (Linux 1.1.23-2.5.47)" +See +.IR /proc/kallsyms . +.TP +.I /proc/loadavg +The first three fields in this file are load average figures +giving the number of jobs in the run queue (state R) +or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes. +They are the same as the load average numbers given by +.BR uptime (1) +and other programs. +The fourth field consists of two numbers separated by a slash (/). +The first of these is the number of currently executing kernel +scheduling entities (processes, threads); +this will be less than or equal to the number of CPUs. +The value after the slash is the number of kernel scheduling entities +that currently exist on the system. +The fifth field is the PID of the process that was most +recently created on the system. +.TP +.I /proc/locks +This file shows current file locks +.RB ( flock "(2) and " fcntl (2)) +and leases +.RB ( fcntl (2)). +.TP +.IR /proc/malloc " (only up to and including Linux 2.2)" +.\" It looks like this only ever did something back in 1.0 days +This file is only present if +.B CONFIG_DEBUG_MALLOC +was defined during compilation. +.TP +.I /proc/meminfo +This file reports statistics about memory usage on the system. +It is used by +.BR free (1) +to report the amount of free and used memory (both physical and swap) +on the system as well as the shared memory and buffers used by the +kernel. +.TP +.I /proc/modules +A text list of the modules that have been loaded by the system. +See also +.BR lsmod (8). +.TP +.I /proc/mounts +Before kernel 2.4.19, this file was a list +of all the file systems currently mounted on the system. +With the introduction of per-process mount namespaces in +Linux 2.4.19, this file became a link to +.IR /proc/self/mounts , +which lists the mount points of the process's own mount namespace. +The format of this file is documented in +.BR fstab (5). +.TP +.I /proc/mtrr +Memory Type Range Registers. +See the kernel source file +.I Documentation/mtrr.txt +for details. +.TP +.I /proc/net +various net pseudo-files, all of which give the status of some part of +the networking layer. +These files contain ASCII structures and are, +therefore, readable with +.BR cat (1). +However, the standard +.BR netstat (8) +suite provides much cleaner access to these files. +.TP +.I /proc/net/arp +This holds an ASCII readable dump of the kernel ARP table used for +address resolutions. +It will show both dynamically learned and preprogrammed ARP entries. +The format is: + +.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 + +Here "IP address" is the IPv4 address of the machine and the "HW type" +is the hardware type of the address from RFC\ 826. +The flags are the internal +flags of the ARP structure (as defined in +.IR /usr/include/linux/if_arp.h ) +and +the "HW address" is the data link layer mapping for that IP address if +it is known. +.TP +.I /proc/net/dev +The dev pseudo-file contains network device status information. +This gives +the number of received and sent packets, the number of errors and +collisions +and other basic statistics. +These are used by the +.BR ifconfig (8) +program to report device status. +The format is: + +.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 +.\" No information. +.\" .TP +.\" .I /proc/net/ipx_route +.\" No information. +.TP +.I /proc/net/dev_mcast +Defined in +.IR /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 +Internet Group Management Protocol. +Defined in +.IR /usr/src/linux/net/core/igmp.c . +.TP +.I /proc/net/rarp +This file uses the same format as the +.I arp +file and contains the current reverse mapping database used to provide +.BR rarp (8) +reverse address lookup services. +If RARP is not configured into the +kernel, +this file will not be present. +.TP +.I /proc/net/raw +Holds a dump of the RAW socket table. +Much of the information is not of +use +apart from debugging. +The "sl" value is the kernel hash slot for the +socket, +the "local_address" is the local address and protocol number pair. +\&"St" is +the internal status of the socket. +The "tx_queue" and "rx_queue" are the +outgoing and incoming data queue in terms of kernel memory usage. +The "tr", "tm\->when", and "rexmits" fields are not used by RAW. +The "uid" +field holds the effective UID of the creator of the socket. +.\" .TP +.\" .I /proc/net/route +.\" No information, but looks similar to +.\" .BR route (8). +.TP +.I /proc/net/snmp +This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP +management +information bases for an SNMP agent. +.TP +.I /proc/net/tcp +Holds a dump of the TCP socket table. +Much of the information is not +of use apart from debugging. +The "sl" value is the kernel hash slot +for the socket, the "local_address" is the local address and port number pair. +The "rem_address" is the remote address and port number pair +(if connected). +\&"St" is the internal status of the socket. +The "tx_queue" and "rx_queue" are the +outgoing and incoming data queue in terms of kernel memory usage. +The "tr", "tm\->when", and "rexmits" fields hold internal information of +the kernel socket state and are only useful for debugging. +The "uid" +field holds the effective UID of the creator of the socket. +.TP +.I /proc/net/udp +Holds a dump of the UDP socket table. +Much of the information is not of +use apart from debugging. +The "sl" value is the kernel hash slot for the +socket, the "local_address" is the local address and port number pair. +The "rem_address" is the remote address and port number pair +(if connected). "St" is the internal status of the socket. +The "tx_queue" and "rx_queue" are the outgoing and incoming data queue +in terms of kernel memory usage. +The "tr", "tm\->when", and "rexmits" fields +are not used by UDP. +The "uid" +field holds the effective UID of the creator of the socket. +The format is: + +.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 +Lists the Unix domain sockets present within the system and their +status. +The format is: +.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 + +Here "Num" is the kernel table slot number, "RefCount" is the number +of users of the socket, "Protocol" is currently always 0, "Flags" +represent the internal kernel flags holding the status of the +socket. +Currently, type is always "1" (Unix domain datagram sockets are +not yet supported in the kernel). +\&"St" is the internal state of the +socket and Path is the bound path (if any) of the socket. +.TP +.I /proc/partitions +Contains major and minor numbers of each partition as well as number +of blocks and partition name. +.TP +.I /proc/pci +This is a listing of all PCI devices found during kernel initialization +and their configuration. + +This file has been deprecated in favor of a new +.I /proc +interface for PCI +.RI ( /proc/bus/pci ). +It became optional in Linux 2.2 (available with +.B CONFIG_PCI_OLD_PROC +set at kernel compilation). +It became once more nonoptionally enabled in Linux 2.4. +Next, it was deprecated in Linux 2.6 (still available with +.B CONFIG_PCI_LEGACY_PROC +set), and finally removed altogether since 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 +A directory with the +.I scsi +mid-level pseudo-file and various SCSI low-level +driver directories, +which contain a file for each SCSI host in this system, all of +which give the status of some part of the SCSI IO subsystem. +These files contain ASCII structures and are, therefore, readable with +.BR cat (1). + +You can also write to some of the files to reconfigure the subsystem or +switch certain features on or off. +.TP +.I /proc/scsi/scsi +This is a listing of all SCSI devices known to the kernel. +The listing is similar to the one seen during bootup. +scsi currently supports only the \fIadd-single-device\fP command which +allows root to add a hotplugged device to the list of known devices. + +The command +.in +4n +.nf + +echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi + +.fi +.in +will cause +host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0. +If there +is already a device known on this address or the address is invalid, an +error will be returned. +.TP +.I /proc/scsi/[drivername] +\fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740, +aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic, +scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000. +These directories show up for all drivers that registered at least one +SCSI HBA. +Every directory contains one file per registered host. +Every host-file is named after the number the host was assigned during +initialization. + +Reading these files will usually show driver and host configuration, +statistics, etc. + +Writing to these files allows different things on different hosts. +For example, with the \fIlatency\fP and \fInolatency\fP commands, +root can switch on and off command latency measurement code in the +eata_dma driver. +With the \fIlockup\fP and \fIunlock\fP commands, +root can control bus lockups simulated by the scsi_debug driver. +.TP +.I /proc/self +This directory refers to the process accessing the +.I /proc +file system, +and is identical to the +.I /proc +directory named by the process ID of the same process. +.TP +.I /proc/slabinfo +Information about kernel caches. +Since Linux 2.6.16 this file is only present if the +.B CONFIG_SLAB +kernel configuration option is enabled. +The columns in +.I /proc/slabinfo +are: +.in +4n +.nf + +cache-name +num-active-objs +total-objs +object-size +num-active-slabs +total-slabs +num-pages-per-slab +.fi +.in + +See +.BR slabinfo (5) +for details. +.TP +.I /proc/stat +kernel/system statistics. +Varies with architecture. +Common +entries include: +.RS +.TP +\fIcpu 3357 0 4313 1362393\fP +The amount of time, measured in units of +USER_HZ (1/100ths of a second on most architectures, use +.IR sysconf(_SC_CLK_TCK) +to obtain the right value), +.\" 1024 on Alpha and ia64 +that the system spent in user mode, +user mode with low priority (nice), system mode, and the +idle task, respectively. +.\" FIXME Actually, the following info about the /proc/stat 'cpu' field +.\" does not seem to be quite right (at least in 2.6.12) +The last value should be USER_HZ times the +second entry in the uptime pseudo-file. + +In Linux 2.6 this line includes three additional columns: +.I iowait +\- time waiting for I/O to complete (since 2.5.41); +.I irq +\- time servicing interrupts (since 2.6.0-test4); +.I softirq +\- time servicing softirqs (since 2.6.0-test4). + +Since Linux 2.6.11, there is an eighth column, +.I steal +\- stolen time, which is the time spent in other operating systems when +running in a virtualized environment + +Since Linux 2.6.24, there is a ninth column, +.IR guest , +which is the time spent running a virtual CPU for guest +operating systems under the control of the Linux kernel. +.\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de +.TP +\fIpage 5741 1808\fP +The number of pages the system paged in and the number that were paged +out (from disk). +.TP +\fIswap 1 0\fP +The number of swap pages that have been brought in and out. +.TP +.\" FIXME The following is not the full picture for the 'intr' of +.\" /proc/stat on 2.6: +\fIintr 1462898\fP +This line shows counts of interrupts serviced since boot time, +for each of the possible system interrupts. +The first column is the total of all interrupts serviced; +each subsequent column is the total for a particular interrupt. +.TP +\fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP... +(major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written) +.br +(Linux 2.4 only) +.TP +\fIctxt 115315\fP +The number of context switches that the system underwent. +.TP +\fIbtime 769041601\fP +boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). +.TP +\fIprocesses 86031\fP +Number of forks since boot. +.TP +\fIprocs_running 6\fP +Number of processes in runnable state. +(Linux 2.5.45 onwards.) +.TP +\fIprocs_blocked 2\fP +Number of processes blocked waiting for I/O to complete. +(Linux 2.5.45 onwards.) +.RE +.TP +.I /proc/swaps +Swap areas in use. +See also +.BR swapon (8). +.TP +.I /proc/sys +This directory (present since 1.3.57) contains a number of files +and subdirectories corresponding to kernel variables. +These variables can be read and sometimes modified using +the \fI/proc\fP file system, and the (deprecated) +.BR sysctl (2) +system call. +Presently, there are subdirectories +.IR abi ", " debug ", " dev ", " fs ", " kernel ", " net ", " proc ", " +.IR rxrpc ", " sunrpc " and " vm +that each contain more files and subdirectories. +.TP +.IR /proc/sys/abi " (since Linux 2.4.10)" +This directory may contain files with application binary information. +.\" On some systems, it is not present. +See the kernel source file +.I Documentation/sysctl/abi.txt +for more information. +.TP +.I /proc/sys/debug +This directory may be empty. +.TP +.I /proc/sys/dev +This directory contains device-specific information (e.g., +.IR dev/cdrom/info ). +On +some systems, it may be empty. +.TP +.I /proc/sys/fs +This contains the subdirectories +.IR binfmt_misc ", " epoll ", " inotify ", and " mqueue , +and files +.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 ", and " super-nr . +.TP +.I /proc/sys/fs/binfmt_misc +Documentation for files in this directory can be found +in the kernel sources in +.IR Documentation/binfmt_misc.txt . +.TP +.IR /proc/sys/fs/dentry-state " (since Linux 2.2)" +This file contains information about the status of the +directory cache (dcache). +The file contains six numbers, +.IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), " +.I want_pages +(pages requested by system) and two dummy values. +.RS +.IP * 2 +.I nr_dentry +is the number of allocated dentries (dcache entries). +This field is unused in Linux 2.2. +.IP * +.I nr_unused +is the number of unused dentries. +.IP * +.I age_limit +.\" looks like this is unused in kernels 2.2 to 2.6 +is the age in seconds after which dcache entries +can be reclaimed when memory is short. +.IP * +.I want_pages +.\" looks like this is unused in kernels 2.2 to 2.6 +is nonzero when the kernel has called shrink_dcache_pages() and the +dcache isn't pruned yet. +.RE +.TP +.I /proc/sys/fs/dir-notify-enable +This file can be used to disable or enable the +.I dnotify +interface described in +.BR fcntl (2) +on a system-wide basis. +A value of 0 in this file disables the interface, +and a value of 1 enables it. +.TP +.I /proc/sys/fs/dquot-max +This file shows the maximum number of cached disk quota entries. +On some (2.4) systems, it is not present. +If the number of free cached disk quota entries is very low and +you have some awesome number of simultaneous system users, +you might want to raise the limit. +.TP +.I /proc/sys/fs/dquot-nr +This file shows the number of allocated disk quota +entries and the number of free disk quota entries. +.TP +.IR /proc/sys/fs/epoll " (since Linux 2.6.28)" +This directory contains the file +.IR max_user_watches , +which can be used to limit the amount of kernel memory consumed by the +.I epoll +interface. +For further details, see +.BR epoll (7). +.TP +.I /proc/sys/fs/file-max +This file defines +a system-wide limit on the number of open files for all processes. +(See also +.BR setrlimit (2), +which can be used by a process to set the per-process limit, +.BR RLIMIT_NOFILE , +on the number of files it may open.) +If you get lots +of error messages about running out of file handles, +try increasing this value: +.br + +.br +.nf +.ft CW +echo 100000 > /proc/sys/fs/file-max +.fi +.ft + +The kernel constant +.B NR_OPEN +imposes an upper limit on the value that may be placed in +.IR file-max . + +If you increase +.IR /proc/sys/fs/file-max "," +be sure to increase +.I /proc/sys/fs/inode-max +to 3-4 times the new +value of +.IR /proc/sys/fs/file-max "," +or you will run out of inodes. +.TP +.I /proc/sys/fs/file-nr +This (read-only) file gives the number of files presently opened. +It contains three numbers: the number of allocated file handles; +the number of free file handles; and the maximum number of file handles. +The kernel allocates file handles dynamically, but it +doesn't free them again. +If the number of allocated files is close to the +maximum, you should consider increasing the maximum. +When the number of free file handles is +large, you've encountered a peak in your usage of file +handles and you probably don't need to increase the maximum. +.TP +.I /proc/sys/fs/inode-max +This file contains the maximum number of in-memory inodes. +On some (2.4) systems, it may not be present. +This value should be 3-4 times larger +than the value in +.IR file-max , +since \fIstdin\fP, \fIstdout\fP +and network sockets also need an inode to handle them. +When you regularly run out of inodes, you need to increase this value. +.TP +.I /proc/sys/fs/inode-nr +This file contains the first two values from +.IR inode-state . +.TP +.I /proc/sys/fs/inode-state +This file +contains seven numbers: +.IR nr_inodes , +.IR nr_free_inodes , +.IR preshrink , +and four dummy values. +.I nr_inodes +is the number of inodes the system has allocated. +This can be slightly more than +.I inode-max +because Linux allocates them one page full at a time. +.I nr_free_inodes +represents the number of free inodes. +.I preshrink +is nonzero when the +.I nr_inodes +> +.I inode-max +and the system needs to prune the inode list instead of allocating more. +.TP +.IR /proc/sys/fs/inotify " (since Linux 2.6.13)" +This directory contains files +.IR max_queued_events ", " max_user_instances ", and " max_user_watches , +that can be used to limit the amount of kernel memory consumed by the +.I inotify +interface. +For further details, see +.BR inotify (7). +.TP +.I /proc/sys/fs/lease-break-time +This file specifies the grace period that the kernel grants to a process +holding a file lease +.RB ( fcntl (2)) +after it has sent a signal to that process notifying it +that another process is waiting to open the file. +If the lease holder does not remove or downgrade the lease within +this grace period, the kernel forcibly breaks the lease. +.TP +.I /proc/sys/fs/leases-enable +This file can be used to enable or disable file leases +.RB ( fcntl (2)) +on a system-wide basis. +If this file contains the value 0, leases are disabled. +A nonzero value enables leases. +.TP +.IR /proc/sys/fs/mqueue " (since Linux 2.6.6)" +This directory contains files +.IR msg_max ", " msgsize_max ", and " queues_max , +controlling the resources used by POSIX message queues. +See +.BR mq_overview (7) +for details. +.TP +.IR /proc/sys/fs/overflowgid " and " /proc/sys/fs/overflowuid +These files +allow you to change the value of the fixed UID and GID. +The default is 65534. +Some file systems only support 16-bit UIDs and GIDs, although in Linux +UIDs and GIDs are 32 bits. +When one of these file systems is mounted +with writes enabled, any UID or GID that would exceed 65535 is translated +to the overflow value before being written to disk. +.TP +.IR /proc/sys/fs/suid_dumpable " (since Linux 2.6.13)" +.\" The following is based on text from Documentation/sysctl/kernel.txt +The value in this file determines whether core dump files are +produced for set-user-ID or otherwise protected/tainted binaries. +Three different integer values can be specified: +.sp +\fI0\ (default)\fP +This provides the traditional (pre-Linux 2.6.13) behavior. +A core dump will not be produced for a process which has +changed credentials (by calling +.BR seteuid (2), +.BR setgid (2), +or similar, or by executing a set-user-ID or set-group-ID program) +or whose binary does not have read permission enabled. +.sp +\fI1\ ("debug")\fP +All processes dump core when possible. +The core dump is owned by the file system user ID of the dumping process +and no security is applied. +This is intended for system debugging situations only. +Ptrace is unchecked. +.sp +\fI2\ ("suidsafe")\fP +Any binary which normally would not be dumped (see "0" above) +is dumped readable by root only. +This allows the user to remove the core dump file but not to read it. +For security reasons core dumps in this mode will not overwrite one +another or other files. +This mode is appropriate when administrators are +attempting to debug problems in a normal environment. +.TP +.I /proc/sys/fs/super-max +This file +controls the maximum number of superblocks, and +thus the maximum number of mounted file systems the kernel +can have. +You only need to increase +.I super-max +if you need to mount more file systems than the current value in +.I super-max +allows you to. +.TP +.I /proc/sys/fs/super-nr +This file +contains the number of file systems currently mounted. +.TP +.I /proc/sys/kernel +This directory contains files controlling a range of kernel parameters, +as described below. +.TP +.I /proc/sys/kernel/acct +This file +contains three numbers: +.IR highwater , +.IR lowwater , +and +.IR frequency . +If BSD-style process accounting is enabled these values control +its behavior. +If free space on file system where the log lives goes below +.I lowwater +percent accounting suspends. +If free space gets above +.I highwater +percent accounting resumes. +.I frequency +determines +how often the kernel checks the amount of free space (value is in +seconds). +Default values are 4, 2 and 30. +That is, suspend accounting if 2% or less space is free; resume it +if 4% or more space is free; consider information about amount of free space +valid for 30 seconds. +.TP +.IR /proc/sys/kernel/cap-bound " (from Linux 2.2 to 2.6.24)" +This file holds the value of the kernel +.I "capability bounding set" +(expressed as a signed decimal number). +This set is ANDed against the capabilities permitted to a process +during +.BR execve (2). +Starting with Linux 2.6.25, +the system-wide capability bounding set disappeared, +and was replaced by a per-thread bounding set; see +.BR capabilities (7). +.TP +.I /proc/sys/kernel/core_pattern +See +.BR core (5). +.TP +.I /proc/sys/kernel/core_uses_pid +See +.BR core (5). +.TP +.I /proc/sys/kernel/ctrl-alt-del +This file +controls the handling of Ctrl-Alt-Del from the keyboard. +When the value in this file is 0, Ctrl-Alt-Del is trapped and +sent to the +.BR init (8) +program to handle a graceful restart. +When the value is greater than zero, Linux's reaction to a Vulcan +Nerve Pinch (tm) will be an immediate reboot, without even +syncing its dirty buffers. +Note: when a program (like dosemu) has the keyboard in "raw" +mode, the ctrl-alt-del is intercepted by the program before it +ever reaches the kernel tty layer, and it's up to the program +to decide what to do with it. +.TP +.I /proc/sys/kernel/hotplug +This file +contains the path for the hotplug policy agent. +The default value in this file is +.IR /sbin/hotplug . +.TP +.IR /proc/sys/kernel/domainname " and " /proc/sys/kernel/hostname +can be used to set the NIS/YP domainname and the +hostname of your box in exactly the same way as the commands +.BR domainname (1) +and +.BR hostname (1), +that is: + +.in +4n +.nf +.RB "#" " echo \(aqdarkstar\(aq > /proc/sys/kernel/hostname" +.RB "#" " echo \(aqmydomain\(aq > /proc/sys/kernel/domainname" +.fi +.in + +has the same effect as + +.in +4n +.nf +.RB "#" " hostname \(aqdarkstar\(aq" +.RB "#" " domainname \(aqmydomain\(aq" +.fi +.in + +Note, however, that the classic darkstar.frop.org has the +hostname "darkstar" and DNS (Internet Domain Name Server) +domainname "frop.org", not to be confused with the NIS (Network +Information Service) or YP (Yellow Pages) domainname. +These two +domain names are in general different. +For a detailed discussion +see the +.BR hostname (1) +man page. +.TP +.I /proc/sys/kernel/htab-reclaim +(PowerPC only) If this file is set to a nonzero value, +the PowerPC htab +(see kernel file +.IR Documentation/powerpc/ppc_htab.txt ) +is pruned +each time the system hits the idle loop. +.TP +.I /proc/sys/kernel/l2cr +(PowerPC only) This file +contains a flag that controls the L2 cache of G3 processor +boards. +If 0, the cache is disabled. +Enabled if nonzero. +.TP +.I /proc/sys/kernel/modprobe +This file contains the path for the kernel module loader. +The default value is +.IR /sbin/modprobe . +The file is only present if the kernel is built with the +.B CONFIG_KMOD +option enabled. +It is described by the kernel source file +.I Documentation/kmod.txt +(only present in kernel 2.4 and earlier). +.TP +.I /proc/sys/kernel/msgmax +This file defines +a system-wide limit specifying the maximum number of bytes in +a single message written on a System V message queue. +.TP +.I /proc/sys/kernel/msgmni +This file defines the system-wide limit on the number of +message queue identifiers. +(This file is only present in Linux 2.4 onwards.) +.TP +.I /proc/sys/kernel/msgmnb +This file defines a system-wide parameter used to initialize the +.I msg_qbytes +setting for subsequently created message queues. +The +.I msg_qbytes +setting specifies the maximum number of bytes that may be written to the +message queue. +.TP +.IR /proc/sys/kernel/ostype " and " /proc/sys/kernel/osrelease +These files +give substrings of +.IR /proc/version . +.TP +.IR /proc/sys/kernel/overflowgid " and " /proc/sys/kernel/overflowuid +These files duplicate the files +.I /proc/sys/fs/overflowgid +and +.IR /proc/sys/fs/overflowuid . +.TP +.I /proc/sys/kernel/panic +This file gives read/write access to the kernel variable +.IR panic_timeout . +If this is zero, the kernel will loop on a panic; if nonzero +it indicates that the kernel should autoreboot after this number +of seconds. +When you use the +software watchdog device driver, the recommended setting is 60. +.TP +.IR /proc/sys/kernel/panic_on_oops " (since Linux 2.5.68)" +This file controls the kernel's behavior when an oops +or BUG is encountered. +If this file contains 0, then the system +tries to continue operation. +If it contains 1, then the system +delays a few seconds (to give klogd time to record the oops output) +and then panics. +If the +.I /proc/sys/kernel/panic +file is also nonzero then the machine will be rebooted. +.TP +.IR /proc/sys/kernel/pid_max " (since Linux 2.5.34)" +This file specifies the value at which PIDs wrap around +(i.e., the value in this file is one greater than the maximum PID). +The default value for this file, 32768, +results in the same range of PIDs as on earlier kernels. +On 32-bit platforms, 32768 is the maximum value for +.IR pid_max . +On 64-bit systems, +.I pid_max +can be set to any value up to 2^22 +.RB ( PID_MAX_LIMIT , +approximately 4 million). +.\" 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 +.IR /proc/sys/kernel/powersave-nap " (PowerPC only)" +This file contains a flag. +If set, Linux-PPC will use the "nap" mode of +powersaving, +otherwise the "doze" mode will be used. +.TP +.I /proc/sys/kernel/printk +The four values in this file are +.IR console_loglevel , +.IR default_message_loglevel , +.IR minimum_console_level , +and +.IR default_console_loglevel . +These values influence +.I printk() +behavior when printing or logging error messages. +See +.BR syslog (2) +for more info on the different loglevels. +Messages with a higher priority than +.I console_loglevel +will be printed to the console. +Messages without an explicit priority will be printed with priority +.IR default_message_level . +.I minimum_console_loglevel +is the minimum (highest) value to which +.I console_loglevel +can be set. +.I default_console_loglevel +is the default value for +.IR console_loglevel . +.TP +.IR /proc/sys/kernel/pty " (since Linux 2.6.4)" +This directory contains two files relating to the number of Unix 98 +pseudo-terminals (see +.BR pts (4)) +on the system. +.TP +.I /proc/sys/kernel/pty/max +This file defines the maximum number of pseudo-terminals. +.TP +.I /proc/sys/kernel/pty/nr +This read-only file +indicates how many pseudo-terminals are currently in use. +.TP +.I /proc/sys/kernel/random +This directory +contains various parameters controlling the operation of the file +.IR /dev/random . +See +.BR random (4) +for further information. +.TP +.I /proc/sys/kernel/real-root-dev +This file is documented in the kernel source file +.IR Documentation/initrd.txt . +.TP +.IR /proc/sys/kernel/reboot-cmd " (Sparc only) " +This file seems to be a way to give an argument to the SPARC +ROM/Flash boot loader. +Maybe to tell it what to do after +rebooting? +.TP +.I /proc/sys/kernel/rtsig-max +(Only in kernels up to and including 2.6.7; see +.BR setrlimit (2)) +This file can be used to tune the maximum number +of POSIX real-time (queued) signals that can be outstanding +in the system. +.TP +.I /proc/sys/kernel/rtsig-nr +(Only in kernels up to and including 2.6.7.) +This file shows the number POSIX real-time signals currently queued. +.TP +.IR /proc/sys/kernel/sem " (since Linux 2.4)" +This file contains 4 numbers defining limits for System V IPC semaphores. +These fields are, in order: +.RS +.IP SEMMSL 8 +The maximum semaphores per semaphore set. +.IP SEMMNS 8 +A system-wide limit on the number of semaphores in all semaphore sets. +.IP SEMOPM 8 +The maximum number of operations that may be specified in a +.BR semop (2) +call. +.IP SEMMNI 8 +A system-wide limit on the maximum number of semaphore identifiers. +.RE +.TP +.I /proc/sys/kernel/sg-big-buff +This file +shows the size of the generic SCSI device (sg) buffer. +You can't tune it just yet, but you could change it at +compile time by editing +.I include/scsi/sg.h +and changing +the value of +.BR SG_BIG_BUFF . +However, there shouldn't be any reason to change this value. +.TP +.I /proc/sys/kernel/shmall +This file +contains the system-wide limit on the total number of pages of +System V shared memory. +.TP +.I /proc/sys/kernel/shmmax +This file +can be used to query and set the run-time limit +on the maximum (System V IPC) shared memory segment size that can be +created. +Shared memory segments up to 1GB are now supported in the +kernel. +This value defaults to +.BR SHMMAX . +.TP +.I /proc/sys/kernel/shmmni +(available in Linux 2.4 and onwards) +This file +specifies the system-wide maximum number of System V shared memory +segments that can be created. +.TP +.I /proc/sys/kernel/sysrq +This file controls the functions allowed to be invoked by the SysRq key. +By default, +the file contains 1 meaning that every possible SysRq request is allowed +(in older kernel versions, SysRq was disabled by default, +and you were required to specifically enable it at run-time, +but this is not the case any more). +Possible values in this file are: + + 0 - disable sysrq completely + 1 - enable all functions of sysrq + >1 - bitmask of allowed sysrq functions, as follows: + 2 - enable control of console logging level + 4 - enable control of keyboard (SAK, unraw) + 8 - enable debugging dumps of processes etc. + 16 - enable sync command + 32 - enable remount read-only + 64 - enable signalling of processes (term, kill, oom-kill) + 128 - allow reboot/poweroff + 256 - allow nicing of all real-time tasks + +This file is only present if the +.B CONFIG_MAGIC_SYSRQ +kernel configuration option is enabled. +For further details see the kernel source file +.IR Documentation/sysrq.txt . +.TP +.I /proc/sys/kernel/version +This file contains a string like: + + #5 Wed Feb 25 21:49:24 MET 1998 + +The "#5" means that +this is the fifth kernel built from this source base and the +date behind it indicates the time the kernel was built. +.TP +.IR /proc/sys/kernel/threads-max " (since Linux 2.3.11)" +This file specifies the system-wide limit on the number of +threads (tasks) that can be created on the system. +.TP +.IR /proc/sys/kernel/zero-paged " (PowerPC only) " +This file +contains a flag. +When enabled (nonzero), Linux-PPC will pre-zero pages in +the idle loop, possibly speeding up get_free_pages. +.TP +.I /proc/sys/net +This directory contains networking stuff. +Explanations for some of the files under this directory can be found in +.BR tcp (7) +and +.BR ip (7). +.TP +.I /proc/sys/net/core/somaxconn +This file defines a ceiling value for the +.I backlog +argument of +.BR listen (2); +see the +.BR listen (2) +manual page for details. +.TP +.I /proc/sys/proc +This directory may be empty. +.TP +.I /proc/sys/sunrpc +This directory supports Sun remote procedure call for network file system +(NFS). +On some systems, it is not present. +.TP +.I /proc/sys/vm +This directory contains files for memory management tuning, buffer and +cache management. +.TP +.IR /proc/sys/vm/drop_caches " (since Linux 2.6.16)" +Writing to this file causes the kernel to drop clean caches, dentries and +inodes from memory, causing that memory to become free. + +To free pagecache, use +.IR "echo 1 > /proc/sys/vm/drop_caches" ; +to free dentries and inodes, use +.IR "echo 2 > /proc/sys/vm/drop_caches" ; +to free pagecache, dentries and inodes, use +.IR "echo 3 > /proc/sys/vm/drop_caches" . + +Because this is a nondestructive operation and dirty objects +are not freeable, the +user should run +.BR sync (8) +first. +.TP +.IR /proc/sys/vm/swappiness +.\" The following is from Documentation/sysctl/vm.txt +The value in this file controls how aggressively the kernel will swap +memory pages. +Higher values increase agressiveness, lower values +descrease aggressiveness. +The default value is 60. +.TP +.IR /proc/sys/vm/legacy_va_layout " (since Linux 2.6.9)" +.\" The following is from Documentation/filesystems/proc.txt +If nonzero, this disables the new 32-bit memory-mapping layout; +the kernel will use the legacy (2.4) layout for all processes. +.TP +.IR /proc/sys/vm/oom_dump_tasks " (since Linux 2.6.25)" +.\" The following is from Documentation/sysctl/vm.txt +Enables a system-wide task dump (excluding kernel threads) to be +produced when the kernel performs an OOM-killing. +The dump includes the following information +for each task (thread, process): +thread ID, real user ID, thread group ID (process ID), +virtual memory size, resident set size, +the CPU that the task is scheduled on, +oom_adj score (see the description of +.IR /proc/[pid]/oom_adj ), +and command name. +This is helpful to determine why the OOM-killer was invoked +and to identify the rogue task that caused it. + +If this contains the value zero, this information is suppressed. +On very large systems with thousands of tasks, +it may not be feasible to dump the memory state information for each one. +Such systems should not be forced to incur a performance penalty in +OOM situations when the information may not be desired. + +If this is set to nonzero, this information is shown whenever the +OOM-killer actually kills a memory-hogging task. + +The default value is 0. +.TP +.IR /proc/sys/vm/oom_kill_allocating_task " (since Linux 2.6.24)" +.\" The following is from Documentation/sysctl/vm.txt +This enables or disables killing the OOM-triggering task in +out-of-memory situations. + +If this is set to zero, the OOM-killer will scan through the entire +tasklist and select a task based on heuristics to kill. +This normally selects a rogue memory-hogging task that +frees up a large amount of memory when killed. + +If this is set to nonzero, the OOM-killer simply kills the task that +triggered the out-of-memory condition. +This avoids a possibly expensive tasklist scan. + +If +.I /proc/sys/vm/panic_on_oom +is nonzero, it takes precedence over whatever value is used in +.IR /proc/sys/vm/oom_kill_allocating_task . + +The default value is 0. +.TP +.I /proc/sys/vm/overcommit_memory +This file contains the kernel virtual memory accounting mode. +Values are: +.RS +.IP +0: heuristic overcommit (this is the default) +.br +1: always overcommit, never check +.br +2: always check, never overcommit +.RE +.IP +In mode 0, calls of +.BR mmap (2) +with +.B MAP_NORESERVE +are not checked, and the default check is very weak, +leading to the risk of getting a process "OOM-killed". +Under Linux 2.4 any nonzero value implies mode 1. +In mode 2 (available since Linux 2.6), the total virtual address space +on the system is limited to (SS + RAM*(r/100)), +where SS is the size of the swap space, and RAM +is the size of the physical memory, and r is the contents of the file +.IR /proc/sys/vm/overcommit_ratio . +.TP +.I /proc/sys/vm/overcommit_ratio +See the description of +.IR /proc/sys/vm/overcommit_memory . +.TP +.IR /proc/sys/vm/panic_on_oom " (since Linux 2.6.18)" +.\" The following is adapted from Documentation/sysctl/vm.txt +This enables or disables a kernel panic in +an out-of-memory situation. + +If this file is set to the value 0, +the kernel's OOM-killer will kill some rogue process. +Usually, the OOM-killer is able to kill a rogue process and the +system will survive. + +If this file is set to the value 1, +then the kernel normally panics when out-of-memory happens. +However, if a process limits allocations to certain nodes +using memory policies +.RB ( mbind (2) +.BR MPOL_BIND ) +or cpusets +.RB ( cpuset (7)) +and those nodes reach memory exhaustion status, +one process may be killed by the OOM-killer. +No panic occurs in this case: +because other nodes' memory may be free, +this means the system as a whole may not have reached +an out-of-memory situation yet. + +If this file is set to the value 2, +the kernel always panics when an out-of-memory condition occurs. + +The default value is 0. +1 and 2 are for failover of clustering. +Select either according to your policy of failover. +.TP +.IR /proc/sysrq-trigger " (since Linux 2.4.21)" +Writing a character to this file triggers the same SysRq function as +typing ALT-SysRq- (see the description of +.IR /proc/sys/kernel/sysrq ). +This file is normally only writable by +.IR root . +For further details see the kernel source file +.IR Documentation/sysrq.txt . +.TP +.I /proc/sysvipc +Subdirectory containing the pseudo-files +.IR msg ", " sem " and " shm "." +These files list the System V Interprocess Communication (IPC) objects +(respectively: message queues, semaphores, and shared memory) +that currently exist on the system, +providing similar information to that available via +.BR ipcs (1). +These files have headers and are formatted (one IPC object per line) +for easy understanding. +.BR svipc (7) +provides further background on the information shown by these files. +.TP +.I /proc/tty +Subdirectory containing the pseudo-files and subdirectories for +tty drivers and line disciplines. +.TP +.I /proc/uptime +This file contains two numbers: the uptime of the system (seconds), +and the amount of time spent in idle process (seconds). +.TP +.I /proc/version +This string identifies the kernel version that is currently running. +It includes the contents of +.IR /proc/sys/kernel/ostype , +.I /proc/sys/kernel/osrelease +and +.IR /proc/sys/kernel/version . +For example: +.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 +.IR /proc/vmstat " (since Linux 2.6)" +This file displays various virtual memory statistics. +.TP +.IR /proc/zoneinfo " (since Linux 2.6.13)" +This file display information about memory zones. +This is useful for analyzing virtual memory behavior. +.\" FIXME more should be said about /proc/zoneinfo +.SH NOTES +Many strings (i.e., the environment and command line) are in +the internal format, with subfields terminated by null bytes (\(aq\\0\(aq), +so you +may find that things are more readable if you use \fIod \-c\fP or \fItr +"\\000" "\\n"\fP to read them. +Alternatively, \fIecho \`cat \`\fP works well. + +This manual page is incomplete, possibly inaccurate, and is the kind +of thing that needs to be updated very often. +.\" .SH ACKNOWLEDGEMENTS +.\" The material on /proc/sys/fs and /proc/sys/kernel is closely based on +.\" kernel source documentation files written by Rik van Riel. +.SH "SEE ALSO" +.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 +The kernel source files: +.IR Documentation/filesystems/proc.txt , +.IR Documentation/sysctl/vm.txt diff --git a/original/man5/protocols.5 b/original/man5/protocols.5 new file mode 100644 index 00000000..d4140931 --- /dev/null +++ b/original/man5/protocols.5 @@ -0,0 +1,83 @@ +.\" Copyright (c) 1995 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., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\" +.\" 1995-10-18 Martin Schulze +.\" * first released +.\" 2002-09-22 Seth W. Klein +.\" * protocol numbers are now assigned by the IANA +.\" +.TH PROTOCOLS 5 2008-09-23 "Linux" "Linux Programmer's Manual" +.SH NAME +protocols \- the protocols definition file +.SH DESCRIPTION +This file is a plain ASCII file, describing the various DARPA internet +protocols that are available from the TCP/IP subsystem. +It should be +consulted instead of using the numbers in the ARPA include files, or, +even worse, just guessing them. +These numbers will occur in the +protocol field of any IP header. + +Keep this file untouched since changes would result in incorrect IP +packages. +Protocol numbers and names are specified by the IANA +(Internet Assigned Numbers Authority). +.\" .. by the DDN Network Information Center. + +Each line is of the following format: + +.RS +.I protocol number aliases ... +.RE + +where the fields are delimited by spaces or tabs. +Empty lines are ignored. +If a line contains a hash mark (#), the hash mark and the part +of the line following it are ignored. + +The field descriptions are: +.TP +.I protocol +the native name for the protocol. +For example +.IR ip , +.IR tcp , +or +.IR udp . +.TP +.I number +the official number for this protocol as it will appear within the IP +header. +.TP +.I aliases +optional aliases for the protocol. +.LP +This file might be distributed over a network using a network-wide +naming service like Yellow Pages/NIS or BIND/Hesiod. +.SH FILES +.TP +.I /etc/protocols +The protocols definition file. +.SH "SEE ALSO" +.BR getprotoent (3) + +http://www.iana.org/assignments/protocol-numbers diff --git a/original/man5/resolv.conf.5 b/original/man5/resolv.conf.5 new file mode 100644 index 00000000..52328353 --- /dev/null +++ b/original/man5/resolv.conf.5 @@ -0,0 +1,263 @@ +.\" Copyright (c) 1986 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms are permitted +.\" provided that the above copyright notice and this paragraph are +.\" duplicated in all such forms and that any documentation, +.\" advertising materials, and other materials related to such +.\" distribution and use acknowledge that the software was developed +.\" by the University of California, Berkeley. The name of the +.\" University may not be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" @(#)resolver.5 5.9 (Berkeley) 12/14/89 +.\" $Id: resolver.5,v 8.6 1999/05/21 00:01:02 vixie Exp $ +.\" +.\" Added ndots remark by Bernhard R. Link - debian bug #182886 +.\" +.TH RESOLV.CONF 5 2009-03-01 "" "Linux Programmer's Manual" +.UC 4 +.SH NAME +resolv.conf \- resolver configuration file +.SH SYNOPSIS +.B /etc/resolv.conf +.SH DESCRIPTION +The +.I resolver +is a set of routines in the C library +that provide access to the Internet Domain Name System (DNS). +The resolver configuration file contains information that is read +by the resolver routines the first time they are invoked by a process. +The file is designed to be human readable and contains a list of +keywords with values that provide various types of resolver information. +.LP +On a normally configured system this file should not be necessary. +The only name server to be queried will be on the local machine; +the domain name is determined from the hostname +and the domain search path is constructed from the domain name. +.LP +The different configuration options are: +.TP +\fBnameserver\fP Name server IP address +Internet address (in dot notation) of a name server +that the resolver should query. +Up to +.B MAXNS +(currently 3, see \fI\fP) name servers may be listed, +one per keyword. +If there are multiple servers, +the resolver library queries them in the order listed. +If no \fBnameserver\fP entries are present, +the default is to use the name server on the local machine. +(The algorithm used is to try a name server, and if the query times out, +try the next, until out of name servers, +then repeat trying all the name servers +until a maximum number of retries are made.) +.TP +\fBdomain\fP Local domain name. +Most queries for names within this domain can use short names +relative to the local domain. +If no \fBdomain\fP entry is present, the domain is determined +from the local hostname returned by +.BR gethostname (2); +the domain part is taken to be everything after the first \(aq.\(aq. +Finally, if the hostname does not contain a domain part, the root +domain is assumed. +.TP +\fBsearch\fP Search list for host-name lookup. +The search list is normally determined from the local domain name; +by default, it contains only the local domain name. +This may be changed by listing the desired domain search path +following the \fIsearch\fP keyword with spaces or tabs separating +the names. +Resolver queries having fewer than +.I ndots +dots (default is 1) in them will be attempted using each component +of the search path in turn until a match is found. +For environments with multiple subdomains please read +.BI "options ndots:" n +below to avoid man-in-the-middle attacks and unnecessary +traffic for the root-dns-servers. +.\" When having a resolv.conv with a line +.\" search subdomain.domain.tld domain.tld +.\" and doing a hostlookup, for example by +.\" ping host.anothersubdomain +.\" it sends dns-requests for +.\" host.anothersubdomain. +.\" host.anothersubdomain.subdomain.domain.tld. +.\" host.anothersubdomain.domain.tld. +.\" thus not only causing unnecessary traffic for the root-dns-servers +.\" but broadcasting information to the outside and making man-in-the-middle +.\" attacks possible. +Note that this process may be slow and will generate a lot of network +traffic if the servers for the listed domains are not local, +and that queries will time out if no server is available +for one of the domains. +.IP +The search list is currently limited to six domains +with a total of 256 characters. +.TP +\fBsortlist\fP +This option allows addresses returned by +.BR gethostbyname (3) +to be sorted. +A sortlist is specified by IP-address-netmask pairs. +The netmask is +optional and defaults to the natural netmask of the net. +The IP address +and optional network pairs are separated by slashes. +Up to 10 pairs may +be specified. +Here is an example: + +.in +4n +sortlist 130.155.160.0/255.255.240.0 130.155.0.0 +.in +.br +.TP +\fBoptions\fP +Options allows certain internal resolver variables to be modified. +The syntax is +.RS +.IP +\fBoptions\fP \fIoption\fP \fI...\fP +.LP +where \fIoption\fP is one of the following: +.TP +\fBdebug\fP +.\" Since glibc 2.2? +sets +.BR RES_DEBUG +in +.IR _res.options . +.TP +.BI ndots: n +.\" Since glibc 2.2 +sets a threshold for the number of dots which +must appear in a name given to +.BR res_query (3) +(see +.BR resolver (3)) +before an \fIinitial absolute query\fP will be made. +The default for +\fIn\fP is 1, meaning that if there are any dots in a name, the name +will be tried first as an absolute name before any \fIsearch list\fP +elements are appended to it. +The value for this option is silently capped to 15. +.TP +.BI timeout: n +.\" Since glibc 2.2 +sets the amount of time the resolver will wait for a +response from a remote name server before retrying the +query via a different name server. +Measured in seconds, +the default is +.BR RES_TIMEOUT +(currently 5, see \fI\fP). +The value for this option is silently capped to 30. +.TP +.BI attempts: n +sets the number of times the resolver will send a +query to its name servers before giving up and returning +an error to the calling application. +The default is +.BR RES_DFLRETRY +(currently 2, see \fI\fP). +The value for this option is silently capped to 5. +.TP +.B rotate +.\" Since glibc 2.2 +sets +.BR RES_ROTATE +in +.IR _res.options , +which causes round robin selection of nameservers from among those listed. +This has the effect of spreading the query load among all listed servers, +rather than having all clients try the first listed server first every time. +.TP +.B no-check-names +.\" since glibc 2.2 +sets +.BR RES_NOCHECKNAME +in +.IR _res.options , +which disables the modern BIND checking of incoming hostnames and +mail names for invalid characters such as underscore (_), non-ASCII, +or control characters. +.TP +.B inet6 +.\" Since glibc 2.2 +sets +.BR RES_USE_INET6 +in +.IR _res.options . +This has the effect of trying a AAAA query before an A query inside the +.BR gethostbyname (3) +function, and of mapping IPv4 responses in IPv6 "tunneled form" +if no AAAA records are found but an A record set exists. +.TP +.BR ip6-bytestring " (since glibc 2.3.4)" +sets +.BR RES_USE_BSTRING +in +.IR _res.options . +This causes reverse IPv6 lookups to be made using the bit-label format +described in RFC\ 2673; +if this option is not set, then nibble format is used. +.TP +.BR ip6-dotint / no-ip6-dotint " (since glibc 2.3.4)" +Clear/set +.BR RES_NOIP6DOTINT +in +.IR _res.options . +When this option is clear +.RB ( ip6-dotint ), +reverse IPv6 lookups are made in the (deprecated) +.I ip6.int +zone; +when this option is set +.RB ( no-ip6-dotint ), +reverse IPv6 lookups are made in the +.I ip6.arpa +zone by default. +This option is set by default. +.TP +.BR edns0 " (since glibc 2.6)" +sets +.BR RES_USE_EDNSO +in +.IR _res.options . +This enables support for the DNS extensions described in RFC\ 2671. +.RE +.LP +The \fIdomain\fP and \fIsearch\fP keywords are mutually exclusive. +If more than one instance of these keywords is present, +the last instance wins. +.LP +The \fIsearch\fP keyword of a system's \fIresolv.conf\fP file can be +overridden on a per-process basis by setting the environment variable +.B LOCALDOMAIN +to a space-separated list of search domains. +.LP +The \fIoptions\fP keyword of a system's \fIresolv.conf\fP file can be +amended on a per-process basis by setting the environment variable +.B RES_OPTIONS +to a space-separated list of resolver options +as explained above under \fBoptions\fP. +.LP +The keyword and value must appear on a single line, and the keyword +(e.g., \fBnameserver\fP) must start the line. +The value follows the keyword, separated by white space. +.SH FILES +.IR /etc/resolv.conf , +.I +.SH "SEE ALSO" +.BR gethostbyname (3), +.BR resolver (3), +.BR hostname (7), +.BR named (8) +.br +Name Server Operations Guide for BIND diff --git a/original/man5/resolver.5 b/original/man5/resolver.5 new file mode 100644 index 00000000..86104b96 --- /dev/null +++ b/original/man5/resolver.5 @@ -0,0 +1 @@ +.so man5/resolv.conf.5 diff --git a/original/man5/rpc.5 b/original/man5/rpc.5 new file mode 100644 index 00000000..40503939 --- /dev/null +++ b/original/man5/rpc.5 @@ -0,0 +1,76 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)rpc.5 2.2 88/08/03 4.0 RPCSRC; from 1.4 87/11/27 SMI; +.TH RPC 5 1985-09-26 "" "Linux Programmer's Manual" +.SH NAME +rpc \- rpc program number data base +.SH SYNOPSIS +.B /etc/rpc +.SH DESCRIPTION +The +.I rpc +file contains user readable names that +can be used in place of RPC program numbers. +Each line has the following information: +.HP 10 +name of server for the RPC program +.br +.ns +.HP 10 +RPC program number +.br +.ns +.HP 10 +aliases +.LP +Items are separated by any number of blanks and/or +tab characters. +A \(aq#\(aq indicates the beginning of a comment; characters from +the \(aq#\(aq to the end of the line are not interpreted by routines +which search the file. +.LP +Here is an example of the \fI/etc/rpc\fP file from the Sun RPC Source +distribution. +.nf +.ta 1.5i +0.5i +1.0i +1.0i +# +# rpc 88/08/01 4.0 RPCSRC; from 1.12 88/02/07 SMI +# +portmapper 100000 portmap sunrpc +rstatd 100001 rstat rstat_svc rup perfmeter +rusersd 100002 rusers +nfs 100003 nfsprog +ypserv 100004 ypprog +mountd 100005 mount showmount +ypbind 100007 +walld 100008 rwall shutdown +yppasswdd 100009 yppasswd +etherstatd 100010 etherstat +rquotad 100011 rquotaprog quota rquota +sprayd 100012 spray +3270_mapper 100013 +rje_mapper 100014 +selection_svc 100015 selnsvc +database_svc 100016 +rexd 100017 rex +alis 100018 +sched 100019 +llockmgr 100020 +nlockmgr 100021 +x25.inr 100022 +statmon 100023 +status 100024 +bootparam 100026 +ypupdated 100028 ypupdate +keyserv 100029 keyserver +tfsd 100037 +nsed 100038 +nsemntd 100039 +.fi +.DT +.SH FILES +.TP +.I /etc/rpc +RPC program number data base +.SH "SEE ALSO" +.BR getrpcent (3) diff --git a/original/man5/securetty.5 b/original/man5/securetty.5 new file mode 100644 index 00000000..b797e3be --- /dev/null +++ b/original/man5/securetty.5 @@ -0,0 +1,44 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sun Jul 25 11:06:27 1993 by Rik Faith (faith@cs.unc.edu) +.TH SECURETTY 5 1992-12-29 "Linux" "Linux Programmer's Manual" +.SH NAME +securetty \- file which lists ttys from which root can log in +.SH DESCRIPTION +The file +.I /etc/securetty +is used by (some versions of) +.BR login (1). +The file contains the device names of tty lines +(one per line, without leading +.IR /dev/ ) +on which root is allowed to login. +See +.BR login.defs (5) +if you use the shadow suite. +.SH FILES +.I /etc/securetty +.SH "SEE ALSO" +.BR login (1), +.BR login.defs (5) diff --git a/original/man5/services.5 b/original/man5/services.5 new file mode 100644 index 00000000..3f272a43 --- /dev/null +++ b/original/man5/services.5 @@ -0,0 +1,220 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1996 Austin Donnelly , +.\" with additional material Copyright (c) 1995 Martin Schulze +.\" +.\" +.\" 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 manpage was made by merging two independently written manpages, +.\" one written by Martin Schulze (18 Oct 95), the other written by +.\" Austin Donnelly, (9 Jan 96). +.\" +.\" Thu Jan 11 12:14:41 1996 Austin Donnelly +.\" * Merged two services(5) manpages +.\" +.TH SERVICES 5 2008-09-23 "Linux" "Linux Programmer's Manual" +.SH NAME +services \- Internet network services list +.SH DESCRIPTION +.B services +is a plain ASCII file providing a mapping between human-friendly textual +names for internet services, and their underlying assigned port +numbers and protocol types. +Every networking program should look into +this file to get the port number (and protocol) for its service. +The C library routines +.BR getservent (3), +.BR getservbyname (3), +.BR getservbyport (3), +.BR setservent (3), +and +.BR endservent (3) +support querying this file from programs. + +Port numbers are assigned by the IANA (Internet Assigned Numbers +Authority), and their current policy is to assign both TCP and UDP +protocols when assigning a port number. +Therefore, most entries will +have two entries, even for TCP-only services. + +Port numbers below 1024 (so-called "low numbered" ports) can only be +bound to by root (see +.BR bind (2), +.BR tcp (7), +and +.BR udp (7)). +This is so clients connecting to low numbered ports can trust +that the service running on the port is the standard implementation, +and not a rogue service run by a user of the machine. +Well-known port numbers specified by the IANA are normally +located in this root-only space. + +The presence of an entry for a service in the +.B services +file does not necessarily mean that the service is currently running +on the machine. +See +.BR inetd.conf (5) +for the configuration of Internet services offered. +Note that not all +networking services are started by +.BR inetd (8), +and so won't appear in +.BR inetd.conf (5). +In particular, news (NNTP) and mail (SMTP) servers are often +initialized from the system boot scripts. + +The location of the +.B services +file is defined by +.B _PATH_SERVICES +in +.IR "." +This is usually set to +.IR /etc/services "." + +Each line describes one service, and is of the form: +.IP +\f2service-name\ \ \ port\f3/\f2protocol\ \ \ \f1[\f2aliases ...\f1] +.TP +where: +.TP 10 +.I service-name +is the friendly name the service is known by and looked up under. +It is case sensitive. +Often, the client program is named after the +.IR service-name "." +.TP +.I port +is the port number (in decimal) to use for this service. +.TP +.I protocol +is the type of protocol to be used. +This field should match an entry +in the +.BR protocols (5) +file. +Typical values include +.B tcp +and +.BR udp . +.TP +.I aliases +is an optional space or tab separated list of other names for this +service (but see the BUGS section below). +Again, the names are case +sensitive. +.PP +Either spaces or tabs may be used to separate the fields. + +Comments are started by the hash sign (#) and continue until the end +of the line. +Blank lines are skipped. + +The +.I service-name +should begin in the first column of the file, since leading spaces are +not stripped. +.I service-names +can be any printable characters excluding space and tab. +However, a conservative choice of characters should be used to minimize +compatibility problems. +E.g., a\-z, 0\-9, and hyphen (\-) would seem a +sensible choice. + +Lines not matching this format should not be present in the +file. +(Currently, they are silently skipped by +.BR getservent (3), +.BR getservbyname (3), +and +.BR getservbyport (3). +However, this behavior should not be relied on.) + +.\" The following is not true as at glibc 2.8 (a line with a comma is +.\" ignored by getservent()); it's not clear if/when it was ever true. +.\" As a backwards compatibility feature, the slash (/) between the +.\" .I port +.\" number and +.\" .I protocol +.\" name can in fact be either a slash or a comma (,). +.\" Use of the comma in +.\" modern installations is deprecated. +.\" +This file might be distributed over a network using a network-wide +naming service like Yellow Pages/NIS or BIND/Hesiod. + +A sample +.B services +file might look like this: +.RS +.nf +.sp +.ta 3i +netstat 15/tcp +qotd 17/tcp quote +msp 18/tcp # message send protocol +msp 18/udp # message send protocol +chargen 19/tcp ttytst source +chargen 19/udp ttytst source +ftp 21/tcp +# 22 \- unassigned +telnet 23/tcp +.fi +.RE +.SH FILES +.TP +.I /etc/services +The Internet network services list +.TP +.I +Definition of +.B _PATH_SERVICES +.\" .SH BUGS +.\" It's not clear when/if the following was ever true; +.\" it isn't true for glibc 2.8: +.\" There is a maximum of 35 aliases, due to the way the +.\" .BR getservent (3) +.\" code is written. +.\" +.\" It's not clear when/if the following was ever true; +.\" it isn't true for glibc 2.8: +.\" Lines longer than +.\" .B BUFSIZ +.\" (currently 1024) characters will be ignored by +.\" .BR getservent (3), +.\" .BR getservbyname (3), +.\" and +.\" .BR getservbyport (3). +.\" However, this will also cause the next line to be mis-parsed. +.SH "SEE ALSO" +.BR listen (2), +.BR endservent (3), +.BR getservbyname (3), +.BR getservbyport (3), +.BR getservent (3), +.BR setservent (3), +.BR inetd.conf (5), +.BR protocols (5), +.BR inetd (8) + +Assigned Numbers RFC, most recently RFC\ 1700, (AKA STD0002) diff --git a/original/man5/shells.5 b/original/man5/shells.5 new file mode 100644 index 00000000..e70ec7bb --- /dev/null +++ b/original/man5/shells.5 @@ -0,0 +1,54 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Thu May 20 20:45:48 MET DST 1993 +.\" +.\" 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 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) +.TH SHELLS 5 1993-11-21 "" "Linux Programmer's Manual" +.SH NAME +shells \- pathnames of valid login shells +.SH DESCRIPTION +.I /etc/shells +is a text file which contains the full pathnames of valid login shells. +This file is consulted by +.BR chsh (1) +and available to be queried by other programs. +.PP +Be aware that there are programs which consult this file to +find out if a user is a normal user. +E.g.: ftp daemons traditionally +disallow access to users with shells not included in this file. +.SH FILES +.I /etc/shells +.SH EXAMPLE +.I /etc/shells +may contain the following paths: +.sp +.RS +.I /bin/sh +.br +.I /bin/csh +.RE +.SH "SEE ALSO" +.BR chsh (1), +.BR getusershell (3) diff --git a/original/man5/slabinfo.5 b/original/man5/slabinfo.5 new file mode 100644 index 00000000..99b02b09 --- /dev/null +++ b/original/man5/slabinfo.5 @@ -0,0 +1,123 @@ +.\" Copyright (c) 2001 Andreas Dilger (adilger@turbolinux.com) +.\" +.\" 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. +.\" +.TH SLABINFO 5 2007-09-30 "" "Linux Programmer's Manual" +.SH NAME +/proc/slabinfo \- Kernel slab allocator statistics +.SH SYNOPSIS +.B cat /proc/slabinfo +.SH DESCRIPTION +Frequently used objects in the Linux kernel +(buffer heads, inodes, dentries, etc.) +have their own cache. +The file +.I /proc/slabinfo +gives statistics. +For example: +.LP +.in +4n +.nf +% cat /proc/slabinfo +slabinfo \- version: 1.1 +kmem_cache 60 78 100 2 2 1 +blkdev_requests 5120 5120 96 128 128 1 +mnt_cache 20 40 96 1 1 1 +inode_cache 7005 14792 480 1598 1849 1 +dentry_cache 5469 5880 128 183 196 1 +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 +\&... +.fi +.in +.LP +For each slab cache, the cache name, the number of currently +active objects, the total number of available objects, the +size of each object in bytes, the number of pages with at +least one active object, the total number of allocated pages, +and the number of pages per slab are given. + +Note that because of object alignment and slab cache overhead, +objects are not normally packed tightly into pages. +Pages with even one in-use object are considered in-use and cannot be +freed. + +Kernels compiled with slab cache statistics will also have +"(statistics)" in the first line of output, and will have 5 +additional columns, namely: the high water mark of active +objects; the number of times objects have been allocated; +the number of times the cache has grown (new pages added +to this cache); the number of times the cache has been +reaped (unused pages removed from this cache); and the +number of times there was an error allocating new pages +to this cache. +If slab cache statistics are not enabled +for this kernel, these columns will not be shown. + +SMP systems will also have "(SMP)" in the first line of +output, and will have two additional columns for each slab, +reporting the slab allocation policy for the CPU-local +cache (to reduce the need for inter-CPU synchronization +when allocating objects from the cache). +The first column is the per-CPU limit: the maximum number of objects that +will be cached for each CPU. +The second column is the +batchcount: the maximum number of free objects in the +global cache that will be transferred to the per-CPU cache +if it is empty, or the number of objects to be returned +to the global cache if the per-CPU cache is full. + +If both slab cache statistics and SMP are defined, there +will be four additional columns, reporting the per-CPU +cache statistics. +The first two are the per-CPU cache +allocation hit and miss counts: the number of times an +object was or was not available in the per-CPU cache +for allocation. +The next two are the per-CPU cache free +hit and miss counts: the number of times a freed object +could or could not fit within the per-CPU cache limit, +before flushing objects to the global cache. + +It is possible to tune the SMP per-CPU slab cache limit +and batchcount via: + +.in +4n +.nf +echo "\fIcache_name limit batchcount\fP" > /proc/slabinfo +.fi +.in +.SH FILES +.I +.SH VERSIONS +.I /proc/slabinfo +exists since Linux 2.1.23. +SMP per-CPU caches exist since Linux 2.4.0-test3. +.SH NOTES +Since Linux 2.6.16 the file +.I /proc/slabinfo +is only present if the +.B CONFIG_SLAB +kernel configuration option is enabled. diff --git a/original/man5/termcap.5 b/original/man5/termcap.5 new file mode 100644 index 00000000..76566146 --- /dev/null +++ b/original/man5/termcap.5 @@ -0,0 +1,472 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 formatting Sat Jul 24 17:13:38 1993, Rik Faith (faith@cs.unc.edu) +.\" Modified (extensions and corrections) +.\" Sun May 1 14:21:25 MET DST 1994 Michael Haardt +.\" If mistakes in the capabilities are found, please send a bug report to: +.\" michael@moria.de +.\" Modified Mon Oct 21 17:47:19 EDT 1996 by Eric S. Raymond (esr@thyrsus.com) +.TH TERMCAP 5 1996-10-21 "Linux" "Linux Programmer's Manual" +.SH NAME +termcap \- terminal capability database +.SH DESCRIPTION +The termcap database is an obsolete facility for describing the +capabilities of character-cell terminals and printers. +It is retained only for capability with old programs; +new ones should use the +.BR terminfo (5) +database and associated libraries. +.LP +.I /etc/termcap +is an ASCII file (the database master) that lists the capabilities of +many different types of terminals. +Programs can read termcap to find +the particular escape codes needed to control the visual attributes of +the terminal actually in use. +(Other aspects of the terminal are +handled by +.BR stty (1).) +The termcap database is indexed on the +.B TERM +environment variable. +.LP +Termcap entries must be defined on a single logical line, with \(aq\\\(aq +used to suppress the newline. +Fields are separated by \(aq:\(aq. +The first field of each entry starts at the left-hand margin, +and contains a list of names for the terminal, separated by \(aq|\(aq. +.LP +The first subfield may (in BSD termcap entries from versions 4.3 and +prior) contain a short name consisting of two characters. +This short name may consist of capital or small letters. +In 4.4BSD termcap entries this field is omitted. +.LP +The second subfield (first, in the newer 4.4BSD format) contains the +name used by the environment variable +.BR TERM . +It should be spelled in lowercase letters. +Selectable hardware capabilities should be marked +by appending a hyphen and a suffix to this name. +See below for an example. +Usual suffixes are w (more than 80 characters wide), am +(automatic margins), nam (no automatic margins), and rv (reverse video +display). +The third subfield contains a long and descriptive name for +this termcap entry. +.LP +Subsequent fields contain the terminal capabilities; any continued +capability lines must be indented one tab from the left margin. +.LP +Although there is no defined order, it is suggested to write first +boolean, then numeric, and then string capabilities, each sorted +alphabetically without looking at lower or upper spelling. +Capabilities of similar functions can be written in one line. +.LP +.nf +Example for: +.sp +Head line: vt|vt101|DEC VT 101 terminal in 80 character mode:\e +Head line: Vt|vt101-w|DEC VT 101 terminal in (wide) 132 character mode:\e +Boolean: :bs:\e +Numeric: :co#80:\e +String: :sr=\eE[H:\e +.fi +.SS "Boolean Capabilities" +.nf +5i Printer will not echo on screen +am Automatic margins which means automatic line wrap +bs Control-H (8 dec.) performs a backspace +bw Backspace on left margin wraps to previous line and right margin +da Display retained above screen +db Display retained below screen +eo A space erases all characters at cursor position +es Escape sequences and special characters work in status line +gn Generic device +hc This is a hardcopy terminal +HC The cursor is hard to see when not on bottom line +hs Has a status line +hz Hazeltine bug, the terminal can not print tilde characters +in Terminal inserts null bytes, not spaces, to fill whitespace +km Terminal has a meta key +mi Cursor movement works in insert mode +ms Cursor movement works in standout/underline mode +NP No pad character +NR ti does not reverse te +nx No padding, must use XON/XOFF +os Terminal can overstrike +ul Terminal underlines although it can not overstrike +xb Beehive glitch, f1 sends ESCAPE, f2 sends \fB^C\fP +xn Newline/wraparound glitch +xo Terminal uses xon/xoff protocol +xs Text typed over standout text will be displayed in standout +xt Teleray glitch, destructive tabs and odd standout mode +.fi +.SS "Numeric Capabilities" +.nf +co Number of columns +dB Delay in milliseconds for backspace on hardcopy terminals +dC Delay in milliseconds for carriage return on hardcopy terminals +dF Delay in milliseconds for form feed on hardcopy terminals +dN Delay in milliseconds for new line on hardcopy terminals +dT Delay in milliseconds for tabulator stop on hardcopy terminals +dV Delay in milliseconds for vertical tabulator stop on + hardcopy terminals +it Difference between tab positions +lh Height of soft labels +lm Lines of memory +lw Width of soft labels +li Number of lines +Nl Number of soft labels +pb Lowest baud rate which needs padding +sg Standout glitch +ug Underline glitch +vt virtual terminal number +ws Width of status line if different from screen width +.fi +.SS "String Capabilities" +.nf +!1 shifted save key +!2 shifted suspend key +!3 shifted undo key +#1 shifted help key +#2 shifted home key +#3 shifted input key +#4 shifted cursor left key +%0 redo key +%1 help key +%2 mark key +%3 message key +%4 move key +%5 next-object key +%6 open key +%7 options key +%8 previous-object key +%9 print key +%a shifted message key +%b shifted move key +%c shifted next key +%d shifted options key +%e shifted previous key +%f shifted print key +%g shifted redo key +%h shifted replace key +%i shifted cursor right key +%j shifted resume key +&0 shifted cancel key +&1 reference key +&2 refresh key +&3 replace key +&4 restart key +&5 resume key +&6 save key +&7 suspend key +&8 undo key +&9 shifted begin key +*0 shifted find key +*1 shifted command key +*2 shifted copy key +*3 shifted create key +*4 shifted delete character +*5 shifted delete line +*6 select key +*7 shifted end key +*8 shifted clear line key +*9 shifted exit key +@0 find key +@1 begin key +@2 cancel key +@3 close key +@4 command key +@5 copy key +@6 create key +@7 end key +@8 enter/send key +@9 exit key +al Insert one line +AL Insert %1 lines +ac Pairs of block graphic characters to map alternate character set +ae End alternative character set +as Start alternative character set for block graphic characters +bc Backspace, if not \fB^H\fP +bl Audio bell +bt Move to previous tab stop +cb Clear from beginning of line to cursor +cc Dummy command character +cd Clear to end of screen +ce Clear to end of line +ch Move cursor horizontally only to column %1 +cl Clear screen and cursor home +cm Cursor move to row %1 and column %2 (on screen) +CM Move cursor to row %1 and column %2 (in memory) +cr Carriage return +cs Scroll region from line %1 to %2 +ct Clear tabs +cv Move cursor vertically only to line %1 +dc Delete one character +DC Delete %1 characters +dl Delete one line +DL Delete %1 lines +dm Begin delete mode +do Cursor down one line +DO Cursor down #1 lines +ds Disable status line +eA Enable alternate character set +ec Erase %1 characters starting at cursor +ed End delete mode +ei End insert mode +ff Formfeed character on hardcopy terminals +fs Return character to its position before going to status line +F1 The string sent by function key f11 +F2 The string sent by function key f12 +F3 The string sent by function key f13 +\&... \&... +F9 The string sent by function key f19 +FA The string sent by function key f20 +FB The string sent by function key f21 +\&... \&... +FZ The string sent by function key f45 +Fa The string sent by function key f46 +Fb The string sent by function key f47 +\&... \&... +Fr The string sent by function key f63 +hd Move cursor a half line down +ho Cursor home +hu Move cursor a half line up +i1 Initialization string 1 at login +i3 Initialization string 3 at login +is Initialization string 2 at login +ic Insert one character +IC Insert %1 characters +if Initialization file +im Begin insert mode +ip Insert pad time and needed special characters after insert +iP Initialization program +K1 upper left key on keypad +K2 center key on keypad +K3 upper right key on keypad +K4 bottom left key on keypad +K5 bottom right key on keypad +k0 Function key 0 +k1 Function key 1 +k2 Function key 2 +k3 Function key 3 +k4 Function key 4 +k5 Function key 5 +k6 Function key 6 +k7 Function key 7 +k8 Function key 8 +k9 Function key 9 +k; Function key 10 +ka Clear all tabs key +kA Insert line key +kb Backspace key +kB Back tab stop +kC Clear screen key +kd Cursor down key +kD Key for delete character under cursor +ke turn keypad off +kE Key for clear to end of line +kF Key for scrolling forward/down +kh Cursor home key +kH Cursor hown down key +kI Insert character/Insert mode key +kl Cursor left key +kL Key for delete line +kM Key for exit insert mode +kN Key for next page +kP Key for previous page +kr Cursor right key +kR Key for scrolling backward/up +ks Turn keypad on +kS Clear to end of screen key +kt Clear this tab key +kT Set tab here key +ku Cursor up key +l0 Label of zeroth function key, if not f0 +l1 Label of first function key, if not f1 +l2 Label of first function key, if not f2 +\&... \&... +la Label of tenth function key, if not f10 +le Cursor left one character +ll Move cursor to lower left corner +LE Cursor left %1 characters +LF Turn soft labels off +LO Turn soft labels on +mb Start blinking +MC Clear soft margins +md Start bold mode +me End all mode like so, us, mb, md and mr +mh Start half bright mode +mk Dark mode (Characters invisible) +ML Set left soft margin +mm Put terminal in meta mode +mo Put terminal out of meta mode +mp Turn on protected attribute +mr Start reverse mode +MR Set right soft margin +nd Cursor right one character +nw Carriage return command +pc Padding character +pf Turn printer off +pk Program key %1 to send string %2 as if typed by user +pl Program key %1 to execute string %2 in local mode +pn Program soft label %1 to show string %2 +po Turn the printer on +pO Turn the printer on for %1 (<256) bytes +ps Print screen contents on printer +px Program key %1 to send string %2 to computer +r1 Reset string 1 to set terminal to sane modes +r2 Reset string 2 to set terminal to sane modes +r3 Reset string 3 to set terminal to sane modes +RA disable automatic margins +rc Restore saved cursor position +rf Reset string filename +RF Request for input from terminal +RI Cursor right %1 characters +rp Repeat character %1 for %2 times +rP Padding after character sent in replace mode +rs Reset string +RX Turn off XON/XOFF flow control +sa Set %1 %2 %3 %4 %5 %6 %7 %8 %9 attributes +SA enable automatic margins +sc Save cursor position +se End standout mode +sf Normal scroll one line +SF Normal scroll %1 lines +so Start standout mode +sr Reverse scroll +SR scroll back %1 lines +st Set tabulator stop in all rows at current column +SX Turn on XON/XOFF flow control +ta move to next hardware tab +tc Read in terminal description from another entry +te End program that uses cursor motion +ti Begin program that uses cursor motion +ts Move cursor to column %1 of status line +uc Underline character under cursor and move cursor right +ue End underlining +up Cursor up one line +UP Cursor up %1 lines +us Start underlining +vb Visible bell +ve Normal cursor visible +vi Cursor invisible +vs Standout cursor +wi Set window from line %1 to %2 and column %3 to %4 +XF XOFF character if not \fB^S\fP +.fi +.LP +There are several ways of defining the control codes for string capabilities: +.LP +Every normal character represents itself, +except \(aq^\(aq, \(aq\e\(aq, and \(aq%\(aq. +.LP +A \fB^x\fP means Control-x. +Control-A equals 1 decimal. +.LP +\ex means a special code. +x can be one of the following characters: +.RS +E Escape (27) +.br +n Linefeed (10) +.br +r Carriage return (13) +.br +t Tabulation (9) +.br +b Backspace (8) +.br +f Form feed (12) +.br +0 Null character. +A \exxx specifies the octal character xxx. +.RE +.IP i +Increments parameters by one. +.IP r +Single parameter capability +.IP + +Add value of next character to this parameter and do binary output +.IP 2 +Do ASCII output of this parameter with a field with of 2 +.IP d +Do ASCII output of this parameter with a field with of 3 +.IP % +Print a \(aq%\(aq +.LP +If you use binary output, then you should avoid the null character +because it terminates the string. +You should reset tabulator expansion +if a tabulator can be the binary output of a parameter. +.IP Warning: +The above metacharacters for parameters may be wrong, they document Minix +termcap which may not be compatible with Linux termcap. +.LP +The block graphic characters can be specified by three string capabilities: +.IP as +start the alternative charset +.IP ae +end it +.IP ac +pairs of characters. +The first character is the name of the block graphic +symbol and the second characters is its definition. +.LP +The following names are available: +.sp +.nf ++ right arrow (>) +, left arrow (<) +\&. down arrow (v) +0 full square (#) +I lantern (#) +- upper arrow (^) +\&' rhombus (+) +a chess board (:) +f degree (') +g plus-minus (#) +h square (#) +j right bottom corner (+) +k right upper corner (+) +l left upper corner (+) +m left bottom corner (+) +n cross (+) +o upper horizontal line (-) +q middle horizontal line (-) +s bottom horizontal line (_) +t left tee (+) +u right tee (+) +v bottom tee (+) +w normal tee (+) +x vertical line (|) +~ paragraph (???) +.fi +.sp +The values in parentheses are suggested defaults which are used by curses, +if the capabilities are missing. +.SH "SEE ALSO" +.BR ncurses (3), +.BR termcap (3), +.BR terminfo (5) diff --git a/original/man5/ttytype.5 b/original/man5/ttytype.5 new file mode 100644 index 00000000..03235725 --- /dev/null +++ b/original/man5/ttytype.5 @@ -0,0 +1,68 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:17:50 1993 by Rik Faith +.\" Modified Thu Oct 19 21:25:21 MET 1995 by Martin Schulze +.\" Modified Mon Oct 21 17:47:19 EDT 1996 by Eric S. Raymond +.\" xk +.TH TTYTYPE 5 1993-07-24 "Linux" "Linux Programmer's Manual" +.SH NAME +ttytype \- terminal device to default terminal type mapping +.SH DESCRIPTION +The +.I /etc/ttytype +file associates termcap/terminfo terminal type names +with tty lines. +Each line consists of a terminal type, followed by +whitespace, followed by a tty name (a device name without the +.IR /dev/ ") prefix." + +This association is used by the program +.BR tset (1) +to set the environment variable +.B TERM +to the default terminal name for +the user's current tty. + +This facility was designed for a traditional time-sharing environment +featuring character-cell terminals hardwired to a Unix minicomputer. +It is little used on modern workstation and personal Unixes. +.SH FILES +.TP +.I /etc/ttytype +the tty definitions file. +.SH EXAMPLE +A typical +.I /etc/ttytype +is: +.RS +.sp +con80x25 tty1 +.br +vt320 ttys0 +.RE +.SH "SEE ALSO" +.BR termcap (5), +.BR terminfo (5), +.BR agetty (8), +.BR mingetty (8) diff --git a/original/man5/tzfile.5 b/original/man5/tzfile.5 new file mode 100644 index 00000000..1e41c7e2 --- /dev/null +++ b/original/man5/tzfile.5 @@ -0,0 +1,134 @@ +.\" @(#)tzfile.5 7.11 +.\" This file is in the public domain, so clarified as of +.\" 1996-06-05 by Arthur David Olson . +.TH TZFILE 5 1996-06-05 "" "Linux Programmer's Manual" +.SH NAME +tzfile \- timezone information +.SH SYNOPSIS +.B #include +.SH DESCRIPTION +The timezone information files used by +.BR tzset (3) +begin with the magic characters "TZif" to identify then as +timezone information files, +followed by sixteen bytes reserved for future use, +followed by six four-byte values of type +.IR long , +written in a "standard" byte order +(the high-order byte of the value is written first). +These values are, +in order: +.TP +.I tzh_ttisgmtcnt +The number of UTC/local indicators stored in the file. +.TP +.I tzh_ttisstdcnt +The number of standard/wall indicators stored in the file. +.TP +.I tzh_leapcnt +The number of leap seconds for which data is stored in the file. +.TP +.I tzh_timecnt +The number of "transition times" for which data is stored +in the file. +.TP +.I tzh_typecnt +The number of "local time types" for which data is stored +in the file (must not be zero). +.TP +.I tzh_charcnt +The number of characters of "timezone abbreviation strings" +stored in the file. +.PP +The above header is followed by +.I tzh_timecnt +four-byte values of type +.IR long , +sorted in ascending order. +These values are written in "standard" byte order. +Each is used as a transition time (as returned by +.BR time (2)) +at which the rules for computing local time change. +Next come +.I tzh_timecnt +one-byte values of type +.IR "unsigned char" ; +each one tells which of the different types of "local time" types +described in the file is associated with the same-indexed transition time. +These values serve as indices into an array of +.I ttinfo +structures that appears next in the file; +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 +Each structure is written as a four-byte value for +.I tt_gmtoff +of type +.IR long , +in a standard byte order, followed by a one-byte value for +.I tt_isdst +and a one-byte value for +.IR tt_abbrind . +In each structure, +.I tt_gmtoff +gives the number of seconds to be added to UTC, +.I tt_isdst +tells whether +.I tm_isdst +should be set by +.BR localtime (3), +and +.I tt_abbrind +serves as an index into the array of timezone abbreviation characters +that follow the +.I ttinfo +structure(s) in the file. +.PP +Then there are +.I tzh_leapcnt +pairs of four-byte values, written in standard byte order; +the first value of each pair gives the time +(as returned by +.BR time (2)) +at which a leap second occurs; +the second gives the +.I total +number of leap seconds to be applied after the given time. +The pairs of values are sorted in ascending order by time. +.PP +Then there are +.I tzh_ttisstdcnt +standard/wall indicators, each stored as a one-byte value; +they tell whether the transition times associated with local time types +were specified as standard time or wall clock time, +and are used when a timezone file is used in handling POSIX-style +timezone environment variables. +.PP +Finally, there are +.I tzh_ttisgmtcnt +UTC/local indicators, each stored as a one-byte value; +they tell whether the transition times associated with local time types +were specified as UTC or local time, +and are used when a timezone file is used in handling POSIX-style +timezone environment variables. +.PP +.I Localtime +uses the first standard-time +.I ttinfo +structure in the file +(or simply the first +.I ttinfo +structure in the absence of a standard-time structure) +if either +.I tzh_timecnt +is zero or the time argument is less than the first transition time recorded +in the file. diff --git a/original/man5/utmp.5 b/original/man5/utmp.5 new file mode 100644 index 00000000..45b40f7e --- /dev/null +++ b/original/man5/utmp.5 @@ -0,0 +1,349 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@cantor.informatik.rwth-aachen.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 1993-07-25 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995-02-26 by Michael Haardt +.\" Modified 1996-07-20 by Michael Haardt +.\" Modified 1997-07-02 by Nicolás Lichtmaier +.\" Modified 2004-10-31 by aeb, following Gwenole Beauchesne +.TH UTMP 5 2008-10-10 "Linux" "Linux Programmer's Manual" +.SH NAME +utmp, wtmp \- login records +.SH SYNOPSIS +.B #include +.SH DESCRIPTION +The +.I utmp +file allows one to discover information about who is currently using the +system. +There may be more users currently using the system, because not +all programs use utmp logging. +.PP +.B Warning: +.I utmp +must not be writable by the user class "other", +because many system programs (foolishly) +depend on its integrity. +You risk faked system logfiles and +modifications of system files if you leave +.I utmp +writable to any user other than the owner and group owner of the file. +.PP +The file is a sequence of +.I utmp +structures, +declared as follows in +.IR +(note that this is only one of several definitions +around; details depend on the version of libc): +.in +4n +.nf +.sp +/* Values for ut_type field, below */ + +#define EMPTY 0 /* Record does not contain valid info + (formerly known as UT_UNKNOWN on Linux) */ +#define RUN_LVL 1 /* Change in system run-level (see + \fBinit\fP(8)) */ +#define BOOT_TIME 2 /* Time of system boot (in \fIut_tv\fP) */ +#define NEW_TIME 3 /* Time after system clock change + (in \fIut_tv\fP) */ +#define OLD_TIME 4 /* Time before system clock change + (in \fIut_tv\fP) */ +#define INIT_PROCESS 5 /* Process spawned by \fBinit\fP(8) */ +#define LOGIN_PROCESS 6 /* Session leader process for user login */ +#define USER_PROCESS 7 /* Normal process */ +#define DEAD_PROCESS 8 /* Terminated process */ +#define ACCOUNTING 9 /* Not implemented */ + +#define UT_LINESIZE 32 +#define UT_NAMESIZE 32 +#define UT_HOSTSIZE 256 + +struct exit_status { /* Type for ut_exit, below */ + short int e_termination; /* Process termination status */ + short int e_exit; /* Process exit status */ +}; + +struct utmp { + short ut_type; /* Type of record */ + pid_t ut_pid; /* PID of login process */ + char ut_line[UT_LINESIZE]; /* Device name of tty \- "/dev/" */ + char ut_id[4]; /* Terminal name suffix, + or inittab(5) ID */ + char ut_user[UT_NAMESIZE]; /* Username */ + char ut_host[UT_HOSTSIZE]; /* Hostname for remote login, or + kernel version for run-level + messages */ + struct exit_status ut_exit; /* Exit status of a process + marked as DEAD_PROCESS; not + used by Linux init(8) */ + /* The ut_session and ut_tv fields must be the same size when + compiled 32- and 64-bit. This allows data files and shared + memory to be shared between 32- and 64-bit applications. */ +#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32 + int32_t ut_session; /* Session ID (\fBgetsid\fP(2)), + used for windowing */ + struct { + int32_t tv_sec; /* Seconds */ + int32_t tv_usec; /* Microseconds */ + } ut_tv; /* Time entry was made */ +#else + long ut_session; /* Session ID */ + struct timeval ut_tv; /* Time entry was made */ +#endif + + int32_t ut_addr_v6[4]; /* Internet address of remote + host; IPv4 address uses + just ut_addr_v6[0] */ + char __unused[20]; /* Reserved for future use */ +}; + +/* Backwards compatibility hacks */ +#define ut_name ut_user +#ifndef _NO_UT_TIME +#define ut_time ut_tv.tv_sec +#endif +#define ut_xtime ut_tv.tv_sec +#define ut_addr ut_addr_v6[0] +.sp +.fi +.in +This structure gives the name of the special file associated with the +user's terminal, the user's login name, and the time of login in the form +of +.BR time (2). +String fields are terminated by \fB\(aq\e0\(aq\fP +if they are shorter than the size +of the field. +.PP +The first entries ever created result from +.BR init (8) +processing +.BR inittab (5). +Before an entry is processed, though, +.BR init (8) +cleans up utmp by setting \fIut_type\fP to \fBDEAD_PROCESS\fP, clearing +\fIut_user\fP, \fIut_host\fP, and \fIut_time\fP with null bytes for each +record which \fIut_type\fP is not \fBDEAD_PROCESS\fP or \fBRUN_LVL\fP +and where no process with PID \fIut_pid\fP exists. +If no empty record +with the needed \fIut_id\fP can be found, +.BR init (8) +creates a new one. +It sets \fIut_id\fP from the inittab, \fIut_pid\fP and \fIut_time\fP to the +current values, and \fIut_type\fP to \fBINIT_PROCESS\fP. +.PP +.BR mingetty (8) +(or +.BR agetty (8)) +locates the entry by the PID, changes \fIut_type\fP to +\fBLOGIN_PROCESS\fP, changes \fIut_time\fP, sets \fIut_line\fP, and waits +for connection to be established. +.BR login (1), +after a user has been +authenticated, changes \fIut_type\fP to \fBUSER_PROCESS\fP, changes +\fIut_time\fP, and sets \fIut_host\fP and \fIut_addr\fP. +Depending on +.BR mingetty (8) +(or +.BR agetty (8)) +and +.BR login (1), +records may be located by +\fIut_line\fP instead of the preferable \fIut_pid\fP. +.PP +When +.BR init (8) +finds that a process has exited, it locates its utmp +entry by \fIut_pid\fP, sets \fIut_type\fP to \fBDEAD_PROCESS\fP, and +clears \fIut_user\fP, \fIut_host\fP and \fIut_time\fP with null bytes. +.PP +.BR xterm (1) +and other terminal emulators directly create a +\fBUSER_PROCESS\fP record and generate the \fIut_id\fP by using the +string that suffix part of the terminal name (the characters +following \fI/dev/[pt]ty\fP). +If they find a \fBDEAD_PROCESS\fP for this ID, +they recycle it, otherwise they create a new entry. +If they can, they +will mark it as \fBDEAD_PROCESS\fP on exiting and it is advised that +they null \fIut_line\fP, \fIut_time\fP, \fIut_user\fP, and \fIut_host\fP +as well. +.PP +.BR telnetd (8) +sets up a \fBLOGIN_PROCESS\fP entry and leaves the rest to +.BR login (1) +as usual. +After the telnet session ends, +.BR telnetd (8) +cleans up utmp in the described way. +.PP +The \fIwtmp\fP file records all logins and logouts. +Its format is exactly like \fIutmp\fP except that a null username +indicates a logout +on the associated terminal. +Furthermore, the terminal name \fB~\fP +with username \fBshutdown\fP or \fBreboot\fP indicates a system +shutdown or reboot and the pair of terminal names \fB|\fP/\fB}\fP +logs the old/new system time when +.BR date (1) +changes it. +\fIwtmp\fP is maintained by +.BR login (1), +.BR init (8), +and some versions of +.BR getty (8) +(e.g., +.BR mingetty (8) +or +.BR agetty (8)). +None of these programs creates the file, so if it is +removed, record-keeping is turned off. +.SH FILES +/var/run/utmp +.br +/var/log/wtmp +.SH "CONFORMING TO" +.PP +POSIX.1 does not specify a +.I utmp +structure, but rather one named +.IR utmpx , +with specifications for the fields +.IR ut_type , +.IR ut_pid , +.IR ut_line , +.IR ut_id , +.IR ut_user , +and +.IR ut_tv . +POSIX.1 does not specify the lengths of the +.I ut_line +and +.I ut_user +fields. + +Linux defines the +.I utmpx +structure to be the same as the +.I utmp +structure. +.SS Comparison with Historical Systems +Linux utmp entries conform neither to v7/BSD nor to System V; they are a +mix of the two. + +v7/BSD has fewer fields; most importantly it lacks +\fIut_type\fP, which causes native v7/BSD-like programs to display (for +example) dead or login entries. +Further, there is no configuration file +which allocates slots to sessions. +BSD does so because it lacks \fIut_id\fP fields. + +In Linux (as in System V), the \fIut_id\fP field of a +record will never change once it has been set, which reserves that slot +without needing a configuration file. +Clearing \fIut_id\fP may result +in race conditions leading to corrupted utmp entries and potential +security holes. +Clearing the abovementioned fields by filling them +with null bytes is not required by System V semantics, +but makes it possible to run +many programs which assume BSD semantics and which do not modify utmp. +Linux uses the BSD conventions for line contents, as documented above. +.PP +.\" mtk: What is the referrent of "them" in the following sentence? +.\" System V only uses the type field to mark them and logs +.\" informative messages such as \fB"new time"\fP in the line field. +System V has no \fIut_host\fP or \fIut_addr_v6\fP fields. +.SH NOTES +.PP +Unlike various other +systems, where utmp logging can be disabled by removing the file, utmp +must always exist on Linux. +If you want to disable +.BR who (1) +then do not make utmp world readable. +.PP +The file format is machine-dependent, so it is recommended that it be +processed only on the machine architecture where it was created. +.PP +Note that on \fIbiarch\fP platforms, that is, systems which can run both +32-bit and 64-bit applications (x86-64, ppc64, s390x, etc.), +\fIut_tv\fP is the same size in 32-bit mode as in 64-bit mode. +The same goes for \fIut_session\fP and \fIut_time\fP if they are present. +This allows data files and shared memory to be shared between +32-bit and 64-bit applications. +This is achieved by changing the type of +.I ut_session +to +.IR int32_t , +and that of +.I ut_tv +to a struct with two +.I int32_t +fields +.I tv_sec +and +.IR tv_usec . +Since \fIut_tv\fP may not be the same as \fIstruct timeval\fP, +then instead of the call: +.in +4n +.nf +.sp +gettimeofday((struct timeval *) &ut.ut_tv, NULL); +.fi +.in + +the following method of setting this field is recommended: +.in +4n +.nf +.sp +struct utmp ut; +struct timeval tv; + +gettimeofday(&tv, NULL); +ut.ut_tv.tv_sec = tv.tv_sec; +ut.ut_tv.tv_usec = tv.tv_usec; +.fi +.in +.PP +Note that the \fIutmp\fP struct from libc5 has changed in libc6. +Because of this, +binaries using the old libc5 struct will corrupt +.IR /var/run/utmp " and/or " /var/log/wtmp . +.SH BUGS +This man page is based on the libc5 one, things may work differently now. +.SH "SEE ALSO" +.BR ac (1), +.BR date (1), +.BR last (1), +.BR login (1), +.BR who (1), +.BR getutent (3), +.BR getutmp (3), +.BR login (3), +.BR logout (3), +.BR logwtmp (3), +.BR updwtmp (3), +.BR init (8) diff --git a/original/man5/utmpx.5 b/original/man5/utmpx.5 new file mode 100644 index 00000000..1fa9e5a5 --- /dev/null +++ b/original/man5/utmpx.5 @@ -0,0 +1 @@ +.so man5/utmp.5 diff --git a/original/man5/wtmp.5 b/original/man5/wtmp.5 new file mode 100644 index 00000000..1fa9e5a5 --- /dev/null +++ b/original/man5/wtmp.5 @@ -0,0 +1 @@ +.so man5/utmp.5 diff --git a/original/man6/intro.6 b/original/man6/intro.6 new file mode 100644 index 00000000..1fa780cd --- /dev/null +++ b/original/man6/intro.6 @@ -0,0 +1,35 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:19:57 1993 by Rik Faith (faith@cs.unc.edu) +.TH INTRO 6 2007-10-23 "Linux" "Linux Programmer's Manual" +.SH NAME +intro \- Introduction to games +.SH DESCRIPTION +Section 6 of the manual describes all the games and funny little programs +available on the system. +.SH NOTES +.SS Authors and Copyright Conditions +Look at the header of the manual page source for the author(s) and copyright +conditions. +Note that these can be different from page to page! diff --git a/original/man7/armscii-8.7 b/original/man7/armscii-8.7 new file mode 100644 index 00000000..77ffe52a --- /dev/null +++ b/original/man7/armscii-8.7 @@ -0,0 +1,141 @@ +'\" t -*- coding: ARMSCII-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. +.\" +.\" +.TH ARMSCII-8 7 2009-01-21 "Linux" "Linux Programmer's Manual" +.nh +.SH NAME +armscii-8 \- Armenian Character Set encoded in octal, decimal, and +hexadecimal +.SH DESCRIPTION +The Armenian Standard Code for Information Interchange, +8-bit coded character set. +.SS "ARMSCII-8 Characters" +The following table displays the characters in ARMSCII-8, which +are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 219 dc Ü ARMENIAN CAPITAL LETTER NOW +335 220 dd Ý ARMENIAN SMALL LETTER NOW +336 221 de Þ ARMENIAN CAPITAL LETTER SHA +337 222 df ß ARMENIAN SMALL LETTER SHA +340 223 e0 à ARMENIAN CAPITAL LETTER VO +341 224 e1 á ARMENIAN SMALL LETTER VO +342 225 e2 â ARMENIAN CAPITAL LETTER CHA +343 226 e3 ã ARMENIAN SMALL LETTER CHA +344 227 e4 ä ARMENIAN CAPITAL LETTER PEH +345 228 e5 å ARMENIAN SMALL LETTER PEH +346 229 e6 æ ARMENIAN CAPITAL LETTER JHEH +347 230 e7 ç ARMENIAN SMALL LETTER JHEH +350 231 e8 è ARMENIAN CAPITAL LETTER RA +351 232 e9 é ARMENIAN SMALL LETTER RA +352 233 ea ê ARMENIAN CAPITAL LETTER SEH +353 234 eb ë ARMENIAN SMALL LETTER SEH +354 235 ec ì ARMENIAN CAPITAL LETTER VEW +355 236 ed í ARMENIAN SMALL LETTER VEW +356 237 ee î ARMENIAN CAPITAL LETTER TIWN +357 238 ef ï ARMENIAN SMALL LETTER TIWN +360 239 f0 ð ARMENIAN CAPITAL LETTER REH +361 240 f1 ñ ARMENIAN SMALL LETTER REH +362 241 f2 ò ARMENIAN CAPITAL LETTER CO +363 242 f3 ó ARMENIAN SMALL LETTER CO +364 243 f4 ô ARMENIAN CAPITAL LETTER YIWN +365 244 f5 õ ARMENIAN SMALL LETTER YIWN +366 245 f6 ö ARMENIAN CAPITAL LETTER PIWR +367 246 f7 ÷ ARMENIAN SMALL LETTER PIWR +370 247 f8 ø ARMENIAN CAPITAL LETTER KEH +371 248 f9 ù ARMENIAN SMALL LETTER KEH +372 249 fa ú ARMENIAN CAPITAL LETTER OH +373 250 fb û ARMENIAN SMALL LETTER OH +374 251 fc ü ARMENIAN CAPITAL LETTER FEH +375 252 fd ý ARMENIAN SMALL LETTER FEH +376 253 fe þ ARMENIAN APOSTROPHE +.TE +.SH "SEE ALSO" +.BR ascii (7) + diff --git a/original/man7/arp.7 b/original/man7/arp.7 new file mode 100644 index 00000000..59973aef --- /dev/null +++ b/original/man7/arp.7 @@ -0,0 +1,308 @@ +'\" t +.\" This man page is Copyright (C) 1999 Matthew Wilcox . +.\" 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. +.\" Modified June 1999 Andi Kleen +.\" $Id: arp.7,v 1.10 2000/04/27 19:31:38 ak Exp $ +.TH ARP 7 2008-11-25 "Linux" "Linux Programmer's Manual" +.SH NAME +arp \- Linux ARP kernel module. +.SH DESCRIPTION +This kernel protocol module implements the Address Resolution +Protocol defined in RFC\ 826. +It is used to convert between Layer2 hardware addresses +and IPv4 protocol addresses on directly connected networks. +The user normally doesn't interact directly with this module except to +configure it; +instead it provides a service for other protocols in the kernel. + +A user process can receive ARP packets by using +.BR packet (7) +sockets. +There is also a mechanism for managing the ARP cache +in user-space by using +.BR netlink (7) +sockets. +The ARP table can also be controlled via +.BR ioctl (2) +on any +.B AF_INET +socket. + +The ARP module maintains a cache of mappings between hardware addresses +and protocol addresses. +The cache has a limited size so old and less +frequently used entries are garbage-collected. +Entries which are marked +as permanent are never deleted by the garbage-collector. +The cache can +be directly manipulated by the use of ioctls and its behavior can be +tuned by the +.I /proc +interfaces described below. + +When there is no positive feedback for an existing mapping after some +time (see the +.I /proc +interfaces below), a neighbor cache entry is considered stale. +Positive feedback can be gotten from a higher layer; for example from +a successful TCP ACK. +Other protocols can signal forward progress +using the +.B MSG_CONFIRM +flag to +.BR sendmsg (2). +When there is no forward progress, ARP tries to reprobe. +It first tries to ask a local arp daemon +.B app_solicit +times for an updated MAC address. +If that fails and an old MAC address is known, a unicast probe is sent +.B ucast_solicit +times. +If that fails too, it will broadcast a new ARP +request to the network. +Requests are only sent when there is data queued +for sending. + +Linux will automatically add a nonpermanent proxy arp entry when it +receives a request for an address it forwards to and proxy arp is +enabled on the receiving interface. +When there is a reject route for the target, no proxy arp entry is added. +.SS Ioctls +Three ioctls are available on all +.B AF_INET +sockets. +They take a pointer to a +.I struct arpreq +as their argument. + +.in +4n +.nf +struct arpreq { + struct sockaddr arp_pa; /* protocol address */ + struct sockaddr arp_ha; /* hardware address */ + int arp_flags; /* flags */ + struct sockaddr arp_netmask; /* netmask of protocol address */ + char arp_dev[16]; +}; +.fi +.in + +.BR SIOCSARP ", " SIOCDARP " and " SIOCGARP +respectively set, delete and get an ARP mapping. +Setting and deleting ARP maps are privileged operations and may +only be performed by a process with the +.B CAP_NET_ADMIN +capability or an effective UID of 0. + +.I arp_pa +must be an +.B AF_INET +socket and +.I arp_ha +must have the same type as the device which is specified in +.IR arp_dev . +.I arp_dev +is a zero-terminated string which names a device. +.RS +.TS +tab(:) allbox; +c s +l l. +\fIarp_flags\fR +flag:meaning +ATF_COM:Lookup complete +ATF_PERM:Permanent entry +ATF_PUBL:Publish entry +ATF_USETRAILERS:Trailers requested +ATF_NETMASK:Use a netmask +ATF_DONTPUB:Don't answer +.TE +.RE + +.PP +If the +.B ATF_NETMASK +flag is set, then +.I arp_netmask +should be valid. +Linux 2.2 does not support proxy network ARP entries, so this +should be set to 0xffffffff, or 0 to remove an existing proxy arp entry. +.B ATF_USETRAILERS +is obsolete and should not be used. +.SS /proc interfaces +ARP supports a range of +.I /proc +interfaces to configure parameters on a global or per-interface basis. +The interfaces can be accessed by reading or writing the +.I /proc/sys/net/ipv4/neigh/*/* +files. +Each interface in the system has its own directory in +.IR /proc/sys/net/ipv4/neigh/ . +The setting in the "default" directory is used for all newly created +devices. +Unless otherwise specified, time-related interfaces are specified +in seconds. +.TP +.IR anycast_delay " (since Linux 2.2)" +.\" Precisely: 2.1.79 +The maximum number of jiffies to delay before replying to a +IPv6 neighbor solicitation message. +Anycast support is not yet implemented. +Defaults to 1 second. +.TP +.IR app_solicit " (since Linux 2.2)" +.\" Precisely: 2.1.79 +The maximum number of probes to send to the user space ARP daemon via +netlink before dropping back to multicast probes (see +.IR mcast_solicit ). +Defaults to 0. +.TP +.IR base_reachable_time " (since Linux 2.2)" +.\" Precisely: 2.1.79 +Once a neighbor has been found, the entry is considered to be valid +for at least a random value between +.IR base_reachable_time "/2 and 3*" base_reachable_time /2. +An entry's validity will be extended if it receives positive feedback +from higher level protocols. +Defaults to 30 seconds. +This file is now obsolete in favor of +.IR base_reachable_time_ms . +.TP +.IR base_reachable_time_ms " (since Linux 2.6.12)" +As for +.IR base_reachable_time , +but measures time in milliseconds. +Defaults to 30000 milliseconds. +.TP +.IR delay_first_probe_time " (since Linux 2.2)" +.\" Precisely: 2.1.79 +Delay before first probe after it has been decided that a neighbor +is stale. +Defaults to 5 seconds. +.TP +.IR gc_interval " (since Linux 2.2)" +.\" Precisely: 2.1.79 +How frequently the garbage collector for neighbor entries +should attempt to run. +Defaults to 30 seconds. +.TP +.IR gc_stale_time " (since Linux 2.2)" +.\" Precisely: 2.1.79 +Determines how often to check for stale neighbor entries. +When a neighbor entry is considered stale, it is resolved again before +sending data to it. +Defaults to 60 seconds. +.TP +.IR gc_thresh1 " (since Linux 2.2)" +.\" Precisely: 2.1.79 +The minimum number of entries to keep in the ARP cache. +The garbage collector will not run if there are fewer than +this number of entries in the cache. +Defaults to 128. +.TP +.IR gc_thresh2 " (since Linux 2.2)" +.\" Precisely: 2.1.79 +The soft maximum number of entries to keep in the ARP cache. +The garbage collector will allow the number of entries to exceed +this for 5 seconds before collection will be performed. +Defaults to 512. +.TP +.IR gc_thresh3 " (since Linux 2.2)" +.\" Precisely: 2.1.79 +The hard maximum number of entries to keep in the ARP cache. +The garbage collector will always run if there are more than +this number of entries in the cache. +Defaults to 1024. +.TP +.IR locktime " (since Linux 2.2)" +.\" Precisely: 2.1.79 +The minimum number of jiffies to keep an ARP entry in the cache. +This prevents ARP cache thrashing if there is more than one potential +mapping (generally due to network misconfiguration). +Defaults to 1 second. +.TP +.IR mcast_solicit " (since Linux 2.2)" +.\" Precisely: 2.1.79 +The maximum number of attempts to resolve an address by +multicast/broadcast before marking the entry as unreachable. +Defaults to 3. +.TP +.IR proxy_delay " (since Linux 2.2)" +.\" Precisely: 2.1.79 +When an ARP request for a known proxy-ARP address is received, delay up to +.I proxy_delay +jiffies before replying. +This is used to prevent network flooding in some cases. +Defaults to 0.8 seconds. +.TP +.IR proxy_qlen " (since Linux 2.2)" +.\" Precisely: 2.1.79 +The maximum number of packets which may be queued to proxy-ARP addresses. +Defaults to 64. +.TP +.IR retrans_time " (since Linux 2.2)" +.\" Precisely: 2.1.79 +The number of jiffies to delay before retransmitting a request. +Defaults to 1 second. +This file is now obsolete in favor of +.IR retrans_time_ms . +.TP +.IR retrans_time_ms " (since Linux 2.6.12)" +The number of milliseconds to delay before retransmitting a request. +Defaults to 1000 milliseconds. +.TP +.IR ucast_solicit " (since Linux 2.2)" +.\" Precisely: 2.1.79 +The maximum number of attempts to send unicast probes before asking +the ARP daemon (see +.IR app_solicit ). +Defaults to 3. +.TP +.IR unres_qlen " (since Linux 2.2)" +.\" Precisely: 2.1.79 +The maximum number of packets which may be queued for each unresolved +address by other network layers. +Defaults to 3. +.SH VERSIONS +The +.I struct arpreq +changed in Linux 2.0 to include the +.I arp_dev +member and the ioctl numbers changed at the same time. +Support for the old ioctls was dropped in Linux 2.2. + +Support for proxy arp entries for networks (netmask not equal 0xffffffff) +was dropped in Linux 2.2. +It is replaced by automatic proxy arp setup by +the kernel for all reachable hosts on other interfaces (when +forwarding and proxy arp is enabled for the interface). + +The +.I neigh/* +interfaces did not exist before Linux 2.2. +.SH BUGS +Some timer settings are specified in jiffies, which is architecture- +and kernel version-dependent; see +.BR time (7). + +There is no way to signal positive feedback from user space. +This means connection-oriented protocols implemented in user space +will generate excessive ARP traffic, because ndisc will regularly +reprobe the MAC address. +The same problem applies for some kernel protocols (e.g., NFS over UDP). + +This man page mashes IPv4 specific and shared between IPv4 and IPv6 +functionality together. +.SH "SEE ALSO" +.BR capabilities (7), +.BR ip (7) +.PP +RFC\ 826 for a description of ARP. +.br +RFC\ 2461 for a description of IPv6 neighbor discovery and the base +algorithms used. +.LP +Linux 2.2+ IPv4 ARP uses the IPv6 algorithms when applicable. diff --git a/original/man7/ascii.7 b/original/man7/ascii.7 new file mode 100644 index 00000000..88e282f1 --- /dev/null +++ b/original/man7/ascii.7 @@ -0,0 +1,199 @@ +'\" 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 +.\" 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 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1994-05-15 by Daniel Quinlan (quinlan@yggdrasil.com) +.\" Modified 1994-11-22 by Daniel Quinlan (quinlan@yggdrasil.com) +.\" Modified 1995-07-11 by Daniel Quinlan (quinlan@yggdrasil.com) +.\" Modified 1996-12-18 by Michael Haardt and aeb +.\" Modified 1999-05-31 by Dimitri Papadopoulos (dpo@club-internet.fr) +.\" Modified 1999-08-08 by Michael Haardt (michael@moria.de) +.\" Modified 2004-04-01 by aeb +.\" +.TH ASCII 7 2009-02-12 "Linux" "Linux Programmer's Manual" +.SH NAME +ascii \- the ASCII character set encoded in octal, decimal, and hexadecimal +.SH DESCRIPTION +ASCII is the American Standard Code for Information Interchange. +It is a 7-bit code. +Many 8-bit codes (such as ISO 8859-1, the +Linux default character set) contain ASCII as their lower half. +The international counterpart of ASCII is known as ISO 646. +.LP +The following table contains the 128 ASCII characters. +.LP +C program \f(CW\(aq\eX\(aq\fP escapes are noted. +.if t \{\ +.in 1i +.ft CW +\} +.TS +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 @ +001 1 01 SOH (start of heading) 101 65 41 A +002 2 02 STX (start of text) 102 66 42 B +003 3 03 ETX (end of text) 103 67 43 C +004 4 04 EOT (end of transmission) 104 68 44 D +005 5 05 ENQ (enquiry) 105 69 45 E +006 6 06 ACK (acknowledge) 106 70 46 F +007 7 07 BEL \(aq\ea\(aq (bell) 107 71 47 G +010 8 08 BS \(aq\eb\(aq (backspace) 110 72 48 H +011 9 09 HT \(aq\et\(aq (horizontal tab) 111 73 49 I +012 10 0A LF \(aq\en\(aq (new line) 112 74 4A J +013 11 0B VT \(aq\ev\(aq (vertical tab) 113 75 4B K +014 12 0C FF \(aq\ef\(aq (form feed) 114 76 4C L +015 13 0D CR \(aq\er\(aq (carriage ret) 115 77 4D M +016 14 0E SO (shift out) 116 78 4E N +017 15 0F SI (shift in) 117 79 4F O +020 16 10 DLE (data link escape) 120 80 50 P +021 17 11 DC1 (device control 1) 121 81 51 Q +022 18 12 DC2 (device control 2) 122 82 52 R +023 19 13 DC3 (device control 3) 123 83 53 S +024 20 14 DC4 (device control 4) 124 84 54 T +025 21 15 NAK (negative ack.) 125 85 55 U +026 22 16 SYN (synchronous idle) 126 86 56 V +027 23 17 ETB (end of trans. blk) 127 87 57 W +030 24 18 CAN (cancel) 130 88 58 X +031 25 19 EM (end of medium) 131 89 59 Y +032 26 1A SUB (substitute) 132 90 5A Z +033 27 1B ESC (escape) 133 91 5B [ +034 28 1C FS (file separator) 134 92 5C \e \(aq\e\e\(aq +035 29 1D GS (group separator) 135 93 5D ] +036 30 1E RS (record separator) 136 94 5E ^ +037 31 1F US (unit separator) 137 95 5F \&_ +040 32 20 SPACE 140 96 60 \` +041 33 21 ! 141 97 61 a +042 34 22 " 142 98 62 b +043 35 23 # 143 99 63 c +044 36 24 $ 144 100 64 d +045 37 25 % 145 101 65 e +046 38 26 & 146 102 66 f +047 39 27 \' 147 103 67 g +050 40 28 ( 150 104 68 h +051 41 29 ) 151 105 69 i +052 42 2A * 152 106 6A j +053 43 2B + 153 107 6B k +054 44 2C , 154 108 6C l +055 45 2D \- 155 109 6D m +056 46 2E . 156 110 6E n +057 47 2F / 157 111 6F o +060 48 30 0 160 112 70 p +061 49 31 1 161 113 71 q +062 50 32 2 162 114 72 r +063 51 33 3 163 115 73 s +064 52 34 4 164 116 74 t +065 53 35 5 165 117 75 u +066 54 36 6 166 118 76 v +067 55 37 7 167 119 77 w +070 56 38 8 170 120 78 x +071 57 39 9 171 121 79 y +072 58 3A : 172 122 7A z +073 59 3B ; 173 123 7B { +074 60 3C < 174 124 7C | +075 61 3D = 175 125 7D } +076 62 3E > 176 126 7E ~ +077 63 3F ? 177 127 7F DEL +.TE +.if t \{\ +.in +.ft P +\} +.SS Tables +For convenience, let us give more compact tables in hex and decimal. +.sp +.nf +.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 +3: # 3 C S c s 3: ! + 5 ? I S ] g q { +4: $ 4 D T d t 4: " , 6 @ J T ^ h r | +5: % 5 E U e u 5: # \- 7 A K U _ i s } +6: & 6 F V f v 6: $ . 8 B L V \` j t ~ +7: \' 7 G W g w 7: % / 9 C M W a k u DEL +8: ( 8 H X h x 8: & 0 : D N X b l v +9: ) 9 I Y i y 9: \' 1 ; E O Y c m w +A: * : J Z j z +B: + ; K [ k { +C: , < L \e l | +D: \- = M ] m } +E: . > N ^ n ~ +F: / ? O _ o DEL +.if t \{\ +.in +.ft P +\} +.fi +.SH NOTES +.SS History +An +.B ascii +manual page appeared in Version 7 of AT&T UNIX. +.LP +On older terminals, the underscore code is displayed as a left arrow, +called backarrow, the caret is displayed as an up-arrow and the vertical +bar has a hole in the middle. +.LP +Uppercase and lowercase characters differ by just one bit and the +ASCII character 2 differs from the double quote by just one bit, too. +That made it much easier to encode characters mechanically or with a +non-microcontroller-based electronic keyboard and that pairing was found +on old teletypes. +.LP +The ASCII standard was published by the United States of America +Standards Institute (USASI) in 1968. +.\" +.\" ASA was the American Standards Association and X3 was an ASA sectional +.\" committee on computers and data processing. Its name changed to +.\" American National Standards Committee X3 (ANSC-X3) and now it is known +.\" as Accredited Standards Committee X3 (ASC X3). It is accredited by ANSI +.\" and administered by ITI. The subcommittee X3.2 worked on coded +.\" character sets; the task group working on ASCII appears to have been +.\" designated X3.2.4. In 1966, ASA became the United States of America +.\" Standards Institute (USASI) and published ASCII in 1968. It became the +.\" American National Standards Institute (ANSI) in 1969 and is the +.\" U.S. member body of ISO; private and nonprofit. +.\" +.SH "SEE ALSO" +.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) diff --git a/original/man7/boot.7 b/original/man7/boot.7 new file mode 100644 index 00000000..2b2ec17a --- /dev/null +++ b/original/man7/boot.7 @@ -0,0 +1,205 @@ +.\" Written by Oron Peled . +.\" May be distributed subject to the GPL. +.\" +.\" I tried to be as much generic in the description as possible: +.\" - General boot sequence is applicable to almost any +.\" OS/Machine (DOS/PC, Linux/PC, Solaris/SPARC, CMS/S390) +.\" - kernel and init(8) is applicable to almost any Unix/Linux +.\" - boot scripts are applicable to SYSV-R4 based Unix/Linux +.\" +.\" Modified 2004-11-03 patch from Martin Schulze +.\" +.TH BOOT 7 2007-06-03 "Linux" "Linux Programmer's Manual" +.SH NAME +boot-scripts \- General description of boot sequence +.SH DESCRIPTION +.LP +The boot sequence varies in details among systems +but can be roughly divided to the following steps: +(i) hardware boot, (ii) OS loader, +(iii) kernel startup, (iv) init and inittab, +(v) boot scripts. +We will describe each of these in more detail below. +.SS "Hardware-boot" +After power-on or hard reset, control is given +to a program stored on read-only memory (normally +PROM). +In PC we usually call this program the \fBBIOS\fR. + +This program normally makes a basic self-test of the +machine and accesses nonvolatile memory to read +further parameters. +This memory in the PC is +battery-backed CMOS memory, so most people +refer to it as the \fBCMOS\fR, although outside +of the PC world, it is usually called \fBnvram\fR +(nonvolatile ram). + +The parameters stored in the nvram vary between +systems, but as a minimum, the hardware boot program +should know what is the boot device, or which devices +to probe as possible boot devices. + +Then the hardware boot stage accesses the boot device, +loads the OS Loader, which is located on a fixed position +on the boot device, and transfers control to it. +.TP +Note: +We do not cover here booting from network. +Those who want +to investigate this subject may want to research: +DHCP, TFTP, PXE, Etherboot. +.SS "OS Loader" +In PC, the OS Loader is located in the first sector +of the boot device \- this is the \fBMBR\fR +(Master Boot Record). + +In most systems, this primary loader is very +limited due to various constraints. +Even on non-PC systems +there are some limitations to the size and complexity +of this loader, but the size limitation of the PC MBR +(512 bytes including the partition table) makes it +almost impossible to squeeze a full OS Loader into it. + +Therefore, most operating systems make the primary loader +call a secondary OS loader which may be located on +a specified disk partition. + +In Linux the OS loader is normally +.BR lilo (8) +or +.BR grub (8). +Both of them may install either as secondary loaders +(where the DOS installed MBR points to them), or +as a two part loader where they provide special MBR +containing the bootstrap code to load the second part +of the loader from the root partition. + +The main job of the OS Loader is to locate the kernel +on the disk, load it and run it. +Most OS loaders allow +interactive use, to enable specification of alternative +kernel (maybe a backup in case the last compiled one +isn't functioning) and to pass optional parameters +to the kernel. +.SS "Kernel Startup" +When the kernel is loaded, it initializes the devices (via +their drivers), starts the swapper (it is a "kernel process", +called kswapd in modern Linux kernels), and mounts the root +file system (/). + +Some of the parameters that may be passed to the kernel +relate to these activities (e.g: You can override the +default root file system). +For further information +on Linux kernel parameters read +.BR bootparam (7). + +Only then the kernel creates the first (user land) +process which is numbered 1. +This process executes the +program +.IR /sbin/init , +passing any parameters that weren't handled by the kernel already. +.SS "init and inittab" +When init starts it reads +.I /etc/inittab +for further instructions. +This file defines what should be run in different \fIrun-levels\fR. + +This gives the system administrator an easy management scheme, where +each run-level is associated with a set of services (e.g: +\fBS\fR is \fIsingle-user\fR, on \fB2\fR most network +services start, etc.). +The administrator may change the current +run-level via +.BR init (8) +and query the current run-level via +.BR runlevel (8). + +However, since it is not convenient to manage individual services +by editing this file, inittab only bootstraps a set of scripts +that actually start/stop the individual services. +.SS "Boot Scripts" + +.TP +Note: +The following description applies to System V release 4 based system, which +currently covers most commercial Unix systems (Solaris, HP-UX, Irix, Tru64) +as well as the major Linux distributions (RedHat, Debian, Mandrake, +Suse, Caldera). +Some systems (Slackware Linux, FreeBSD, OpenBSD) +have a somewhat different scheme of boot scripts. +.LP +For each managed service (mail, nfs server, cron, etc.) there is +a single startup script located in a specific directory +.RI ( /etc/init.d +in most versions of Linux). +Each of these scripts accepts as a single argument +the word "start" \-\- causing it to start the service, or the word +\&"stop" \-\- causing it to stop the service. +The script may optionally +accept other "convenience" parameters (e.g: "restart", to stop and then +start, "status" do display the service status). +Running the script +without parameters displays the possible arguments. +.SS "Sequencing Directories" +To make specific scripts start/stop at specific run-levels and in +specific order, there are \fIsequencing directories\fR. +These +are normally in \fI/etc/rc[0\-6S].d\fR. +In each of these directories +there are links (usually symbolic) to the scripts in the \fI/etc/init.d\fR +directory. + +A primary script (usually \fI/etc/rc\fR) is called from +.BR inittab (5) +and calls the services scripts via the links in the sequencing directories. +All links with names that begin with \(aqS\(aq are being called with +the argument "start" (thereby starting the service). +All links with +names that begin with \(aqK\(aq are being called with the argument "stop" +(thereby stopping the service). + +To define the starting or stopping order within the same run-level, +the names of the links contain order-numbers. +Also, to make the names clearer, they usually +end with the name of the service they refer to. +Example: +the link \fI/etc/rc2.d/S80sendmail\fR starts the sendmail service on +runlevel 2. +This happens after \fI/etc/rc2.d/S12syslog\fR is run +but before \fI/etc/rc2.d/S90xfs\fR is run. + +To manage the boot order and run-levels, we have to manage these links. +However, on many versions of Linux, there are tools to help with this task +(e.g: +.BR chkconfig (8)). +.SS "Boot Configuration" +Usually the daemons started may optionally receive command-line options +and parameters. +To allow system administrators to change these +parameters without editing the boot scripts themselves, +configuration files are used. +These are located in a specific +directory (\fI/etc/sysconfig\fR on RedHat systems) and are +used by the boot scripts. + +In older Unix systems, these files contained the actual command line +options for the daemons, but in modern Linux systems (and also +in HP-UX), these files just contain shell variables. +The boot scripts in \fI/etc/init.d\fR +\fBsource\fR the configuration +files, and then use the variable values. +.SH FILES +.LP +.IR /etc/init.d/ , +.IR /etc/rc[S0\-6].d/ , +.I /etc/sysconfig/ +.SH SEE ALSO +.BR inittab (5), +.BR bootparam (7), +.BR init (8), +.BR runlevel (8), +.BR shutdown (8) diff --git a/original/man7/bootparam.7 b/original/man7/bootparam.7 new file mode 100644 index 00000000..31b41588 --- /dev/null +++ b/original/man7/bootparam.7 @@ -0,0 +1,1306 @@ +.\" Copyright (c) 1995,1997 Paul Gortmaker and Andries Brouwer +.\" +.\" 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 man page written 950814 by aeb, based on Paul Gortmaker's HOWTO +.\" (dated v1.0.1, 15/08/95). +.\" Major update, aeb, 970114. +.\" FIXME ? The use of quotes on this page is inconsistent with the +.\" rest of man-pages. +.\" +.TH BOOTPARAM 7 2007-12-16 "Linux" "Linux Programmer's Manual" +.SH NAME +bootparam \- Introduction to boot time parameters of the Linux kernel +.SH DESCRIPTION +The Linux kernel accepts certain 'command-line options' or 'boot time +parameters' at the moment it is started. +In general this is used to +supply the kernel with information about hardware parameters that +the kernel would not be able to determine on its own, or to avoid/override +the values that the kernel would otherwise detect. + +When the kernel is booted directly by the BIOS (say from a floppy to +which you copied a kernel using 'cp zImage /dev/fd0'), +you have no opportunity to specify any parameters. +So, in order to take advantage of this possibility you have to +use software that is able to pass parameters, like LILO or loadlin. +For a few parameters one can also modify the kernel image itself, +using rdev, see +.BR rdev (8) +for further details. + +The LILO program (LInux LOader) written by Werner Almesberger is the +most commonly used. +It has the ability to boot various kernels, and +stores the configuration information in a plain text file. +(See +.BR lilo (8) +and +.BR lilo.conf (5).) +LILO can boot DOS, OS/2, Linux, FreeBSD, UnixWare, etc., and is quite flexible. + +The other commonly used Linux loader is 'LoadLin' which is a DOS +program that has the capability to launch a Linux kernel from the DOS +prompt (with boot-args) assuming that certain resources are available. +This is good for people that want to launch Linux from DOS. + +It is also very useful if you have certain hardware which relies on +the supplied DOS driver to put the hardware into a known state. +A common example is 'SoundBlaster Compatible' sound cards that require +the DOS driver to twiddle a few mystical registers to put the card +into a SB compatible mode. +Booting DOS with the supplied driver, and +then loading Linux from the DOS prompt with loadlin avoids the reset +of the card that happens if one rebooted instead. +.SS "The Argument List" +The kernel command line is parsed into a list of strings +(boot arguments) separated by spaces. +Most of the boot args take the form of: +.IP +name[=value_1][,value_2]...[,value_10] +.LP +where 'name' is a unique keyword that is used to identify what part of +the kernel the associated values (if any) are to be given to. +Note the limit of 10 is real, as the present code only handles 10 comma +separated parameters per keyword. +(However, you can reuse the same +keyword with up to an additional 10 parameters in unusually +complicated situations, assuming the setup function supports it.) + +Most of the sorting goes on in linux/init/main.c. +First, the kernel +checks to see if the argument is any of the special arguments 'root=', +\&'nfsroot=', 'nfsaddrs=', 'ro', 'rw', 'debug' or 'init'. +The meaning of these special arguments is described below. + +Then it walks a list of setup functions (contained in the bootsetups +array) to see if the specified argument string (such as 'foo') has +been associated with a setup function ('foo_setup()') for a particular +device or part of the kernel. +If you passed the kernel the line +foo=3,4,5,6 then the kernel would search the bootsetups array to see +if 'foo' was registered. +If it was, then it would call the setup +function associated with 'foo' (foo_setup()) and hand it the arguments +3, 4, 5 and 6 as given on the kernel command line. + +Anything of the form 'foo=bar' that is not accepted as a setup function +as described above is then interpreted as an environment variable to +be set. +A (useless?) example would be to use 'TERM=vt100' as a boot +argument. + +Any remaining arguments that were not picked up by the kernel and were +not interpreted as environment variables are then passed onto process +one, which is usually the init program. +The most common argument that +is passed to the init process is the word 'single' which instructs init +to boot the computer in single user mode, and not launch all the usual +daemons. +Check the manual page for the version of init installed on +your system to see what arguments it accepts. +.SS "General Non-device Specific Boot Arguments" +.TP +.B "'init=...'" +This sets the initial command to be executed by the kernel. +If this is not set, or cannot be found, the kernel will try +.IR /sbin/init , +then +.IR /etc/init , +then +.IR /bin/init , +then +.I /bin/sh +and panic if all of this fails. +.TP +.B "'nfsaddrs=...'" +This sets the nfs boot address to the given string. +This boot address is used in case of a net boot. +.TP +.B "'nfsroot=...'" +This sets the nfs root name to the given string. +If this string +does not begin with '/' or ',' or a digit, then it is prefixed by +\&'/tftpboot/'. +This root name is used in case of a net boot. +.TP +.B "'no387'" +(Only when +.B CONFIG_BUGi386 +is defined.) +Some i387 coprocessor chips have bugs that show up when used in 32 bit +protected mode. +For example, some of the early ULSI-387 chips would +cause solid lockups while performing floating-point calculations. +Using the 'no387' boot arg causes Linux to ignore the maths +coprocessor even if you have one. +Of course you must then have your +kernel compiled with math emulation support! +.TP +.B "'no-hlt'" +(Only when +.B CONFIG_BUGi386 +is defined.) +Some of the early i486DX-100 chips have a problem with the 'hlt' +instruction, in that they can't reliably return to operating mode +after this instruction is used. +Using the 'no-hlt' instruction tells +Linux to just run an infinite loop when there is nothing else to do, +and to not halt the CPU. +This allows people with these broken chips +to use Linux. +.TP +.B "'root=...'" +This argument tells the kernel what device is to be used as the root +file system while booting. +The default of this setting is determined +at compile time, and usually is the value of the root device of the +system that the kernel was built on. +To override this value, and +select the second floppy drive as the root device, one would +use 'root=/dev/fd1'. +(The root device can also be set using +.BR rdev (8).) + +The root device can be specified symbolically or numerically. +A symbolic specification has the form /dev/XXYN, where XX designates +the device type ('hd' for ST-506 compatible hard disk, with Y in +\&'a'-'d'; 'sd' for SCSI compatible disk, with Y in 'a'-'e'; +\&'ad' for Atari ACSI disk, with Y in 'a'-'e', +\&'ez' for a Syquest EZ135 parallel port removable drive, with Y='a', +\&'xd' for XT compatible disk, with Y either 'a' or 'b'; 'fd' for +floppy disk, with Y the floppy drive number \(em fd0 would be +the DOS 'A:' drive, and fd1 would be 'B:'), Y the driver letter or +number, and N the number (in decimal) of the partition on this device +(absent in the case of floppies). +Recent kernels allow many other +types, mostly for CD-ROMs: nfs, ram, scd, mcd, cdu535, aztcd, cm206cd, +gscd, sbpcd, sonycd, bpcd. +(The type nfs specifies a net boot; ram refers to a ram disk.) + +Note that this has nothing to do with the designation of these +devices on your file system. +The '/dev/' part is purely conventional. + +The more awkward and less portable numeric specification of the above +possible root devices in major/minor format is also accepted. +(E.g., /dev/sda3 is major 8, minor 3, so you could use 'root=0x803' as an +alternative.) +.TP +.BR 'ro' " and " 'rw' +The 'ro' option tells the kernel to mount the root file system +as 'read-only' so that file system consistency check programs (fsck) +can do their work on a quiescent file system. +No processes can +write to files on the file system in question until it is 'remounted' +as read/write capable, for example, by 'mount \-w \-n \-o remount /'. +(See also +.BR mount (8).) + +The 'rw' option tells the kernel to mount the root file system read/write. +This is the default. + +The choice between read-only and read/write can also be set using +.BR rdev (8). +.TP +.B "'reserve=...'" +This is used to protect I/O port regions from probes. +The form of the command is: +.IP +.BI reserve= iobase,extent[,iobase,extent]... +.sp +In some machines it may be necessary to prevent device drivers from +checking for devices (auto-probing) in a specific region. +This may be +because of hardware that reacts badly to the probing, or hardware +that would be mistakenly identified, or merely +hardware you don't want the kernel to initialize. + +The reserve boot-time argument specifies an I/O port region that +shouldn't be probed. +A device driver will not probe a reserved region, +unless another boot argument explicitly specifies that it do so. + +For example, the boot line +.IP +reserve=0x300,32 blah=0x300 +.IP +keeps all device drivers except the driver for 'blah' from probing +0x300\-0x31f. +.TP +.B "'mem=...'" +The BIOS call defined in the PC specification that returns +the amount of installed memory was only designed to be able +to report up to 64MB. +Linux uses this BIOS call at boot to +determine how much memory is installed. +If you have more than 64MB of +RAM installed, you can use this boot arg to tell Linux how much memory +you have. +The value is in decimal or hexadecimal (prefix 0x), +and the suffixes 'k' (times 1024) or 'M' (times 1048576) can be used. +Here is a quote from Linus on usage of the 'mem=' parameter. + +.in +0.5i +The kernel will accept any 'mem=xx' parameter you give it, and if it +turns out that you lied to it, it will crash horribly sooner or later. +The parameter indicates the highest addressable RAM address, so +\&'mem=0x1000000' means you have 16MB of memory, for example. +For a 96MB machine this would be 'mem=0x6000000'. + +NOTE NOTE NOTE: some machines might use the top of memory for BIOS +caching or whatever, so you might not actually have up to the full +96MB addressable. +The reverse is also true: some chipsets will map +the physical memory that is covered by the BIOS area into the area +just past the top of memory, so the top-of-mem might actually be 96MB ++ 384kB for example. +If you tell linux that it has more memory than +it actually does have, bad things will happen: maybe not at once, but +surely eventually. +.in + +You can also use the boot argument 'mem=nopentium' to turn off 4 MB +page tables on kernels configured for IA32 systems with a pentium or newer +CPU. +.TP +.B "'panic=N'" +By default the kernel will not reboot after a panic, but this option +will cause a kernel reboot after N seconds (if N is greater than zero). +This panic timeout can also be set by "echo N > /proc/sys/kernel/panic". +.TP +.B "'reboot=[warm|cold][,[bios|hard]]'" +(Only when +.B CONFIG_BUGi386 +is defined.) +Since 2.0.22 a reboot is by default a cold reboot. +One asks for the old default with 'reboot=warm'. +(A cold reboot may be required to reset certain hardware, +but might destroy not yet written data in a disk cache. +A warm reboot may be faster.) +By default a reboot is hard, by asking the keyboard controller +to pulse the reset line low, but there is at least one type +of motherboard where that doesn't work. +The option 'reboot=bios' will +instead jump through the BIOS. +.TP +.BR 'nosmp' " and " 'maxcpus=N' +(Only when __SMP__ is defined.) +A command-line option of 'nosmp' or 'maxcpus=0' will disable SMP +activation entirely; an option 'maxcpus=N' limits the maximum number +of CPUs activated in SMP mode to N. +.SS "Boot Arguments for Use by Kernel Developers" +.TP +.B "'debug'" +Kernel messages are handed off to the kernel log daemon klogd so that they +may be logged to disk. +Messages with a priority above +.I console_loglevel +are also printed on the console. +(For these levels, see \fI\fP.) +By default this variable is set to log anything more important than +debug messages. +This boot argument will cause the kernel to also +print the messages of DEBUG priority. +The console loglevel can also be set at run time via an option +to klogd. +See +.BR klogd (8). +.TP +.B "'profile=N'" +It is possible to enable a kernel profiling function, +if one wishes to find out where the kernel is spending its CPU cycles. +Profiling is enabled by setting the variable +.I prof_shift +to a nonzero value. +This is done either by specifying +.B CONFIG_PROFILE +at compile time, or by giving the 'profile=' option. +Now the value that +.I prof_shift +gets will be N, when given, or +.BR CONFIG_PROFILE_SHIFT , +when that is given, or 2, the default. +The significance of this variable is that it +gives the granularity of the profiling: each clock tick, if the +system was executing kernel code, a counter is incremented: +.IP +profile[address >> prof_shift]++; +.sp +The raw profiling information can be read from +.IR /proc/profile . +Probably you'll want to use a tool such as readprofile.c to digest it. +Writing to +.I /proc/profile +will clear the counters. +.TP +.B "'swap=N1,N2,N3,N4,N5,N6,N7,N8'" +Set the eight parameters max_page_age, page_advance, page_decline, +page_initial_age, age_cluster_fract, age_cluster_min, pageout_weight, +bufferout_weight that control the kernel swap algorithm. +For kernel tuners only. +.TP +.B "'buff=N1,N2,N3,N4,N5,N6'" +Set the six parameters max_buff_age, buff_advance, buff_decline, +buff_initial_age, bufferout_weight, buffermem_grace that control +kernel buffer memory management. +For kernel tuners only. +.SS "Boot Arguments for Ramdisk Use" +(Only if the kernel was compiled with +.BR CONFIG_BLK_DEV_RAM .) +In general it is a bad idea to use a ramdisk under Linux \(em +the system will use available memory more efficiently itself. +But while booting (or while constructing boot floppies) +it is often useful to load the floppy contents into a +ramdisk. +One might also have a system in which first +some modules (for file system or hardware) must be loaded +before the main disk can be accessed. + +In Linux 1.3.48, ramdisk handling was changed drastically. +Earlier, the memory was allocated statically, and there was +a 'ramdisk=N' parameter to tell its size. +(This could also +be set in the kernel image at compile time, or by use of +.BR rdev (8).) +These days ram disks use the buffer cache, and grow dynamically. +For a lot of information (e.g., how to use +.BR rdev (8) +in conjunction with the new ramdisk setup), see +.IR /usr/src/linux/Documentation/ramdisk.txt . + +There are four parameters, two boolean and two integral. +.TP +.B "'load_ramdisk=N'" +If N=1, do load a ramdisk. +If N=0, do not load a ramdisk. +(This is the default.) +.TP +.B "'prompt_ramdisk=N'" +If N=1, do prompt for insertion of the floppy. +(This is the default.) +If N=0, do not prompt. +(Thus, this parameter is never needed.) +.TP +.BR 'ramdisk_size=N' " or (obsolete) " 'ramdisk=N' +Set the maximal size of the ramdisk(s) to N kB. +The default is 4096 (4 MB). +.TP +.B "'ramdisk_start=N'" +Sets the starting block number (the offset on the floppy where +the ramdisk starts) to N. +This is needed in case the ramdisk follows a kernel image. +.TP +.B "'noinitrd'" +(Only if the kernel was compiled with +.B CONFIG_BLK_DEV_RAM +and +.BR CONFIG_BLK_DEV_INITRD .) +These days it is possible to compile the kernel to use initrd. +When this feature is enabled, the boot process will load the kernel +and an initial ramdisk; then the kernel converts initrd into +a "normal" ramdisk, which is mounted read-write as root device; +then /linuxrc is executed; afterwards the "real" root file system is mounted, +and the initrd file system is moved over to /initrd; finally +the usual boot sequence (e.g., invocation of /sbin/init) is performed. + +For a detailed description of the initrd feature, see +.IR /usr/src/linux/Documentation/initrd.txt . + +The 'noinitrd' option tells the kernel that although it was compiled for +operation with initrd, it should not go through the above steps, but +leave the initrd data under +.IR /dev/initrd . +(This device can be used only once: the data is freed as soon as +the last process that used it has closed +.IR /dev/initrd .) +.SS "Boot Arguments for SCSI Devices" +General notation for this section: + +.I iobase +-- the first I/O port that the SCSI host occupies. +These are specified in hexadecimal notation, +and usually lie in the range from 0x200 to 0x3ff. + +.I irq +-- the hardware interrupt that the card is configured to use. +Valid values will be dependent on the card in question, but will +usually be 5, 7, 9, 10, 11, 12, and 15. +The other values are usually +used for common peripherals like IDE hard disks, floppies, serial +ports, etc. + +.I scsi-id +-- the ID that the host adapter uses to identify itself on the +SCSI bus. +Only some host adapters allow you to change this value, as +most have it permanently specified internally. +The usual default value +is 7, but the Seagate and Future Domain TMC-950 boards use 6. + +.I parity +-- whether the SCSI host adapter expects the attached devices +to supply a parity value with all information exchanges. +Specifying a one indicates parity checking is enabled, +and a zero disables parity checking. +Again, not all adapters will support selection of parity +behavior as a boot argument. +.TP +.B "'max_scsi_luns=...'" +A SCSI device can have a number of 'subdevices' contained within +itself. +The most common example is one of the new SCSI CD-ROMs that +handle more than one disk at a time. +Each CD is addressed as a +\&'Logical Unit Number' (LUN) of that particular device. +But most +devices, such as hard disks, tape drives and such are only one device, +and will be assigned to LUN zero. + +Some poorly designed SCSI devices cannot handle being probed for +LUNs not equal to zero. +Therefore, if the compile-time flag +.B CONFIG_SCSI_MULTI_LUN +is not set, newer kernels will by default only probe LUN zero. + +To specify the number of probed LUNs at boot, one enters +\&'max_scsi_luns=n' as a boot arg, where n is a number between one and +eight. +To avoid problems as described above, one would use n=1 to +avoid upsetting such broken devices. +.TP +.B "SCSI tape configuration" +Some boot time configuration of the SCSI tape driver can be achieved +by using the following: +.IP +.BI st= buf_size[,write_threshold[,max_bufs]] +.sp +The first two numbers are specified in units of kB. +The default +.I buf_size +is 32kB, and the maximum size that can be specified is a +ridiculous 16384kB. +The +.I write_threshold +is the value at which the buffer is committed to tape, with a +default value of 30kB. +The maximum number of buffers varies +with the number of drives detected, and has a default of two. +An example usage would be: +.IP +st=32,30,2 +.IP +Full details can be found in the file +.I Documentation/scsi/st.txt +(or +.I drivers/scsi/README.st +for older kernels) in the kernel source. +.TP +.B "Adaptec aha151x, aha152x, aic6260, aic6360, SB16-SCSI configuration" +The aha numbers refer to cards and the aic numbers refer to the actual +SCSI chip on these type of cards, including the Soundblaster-16 SCSI. + +The probe code for these SCSI hosts looks for an installed BIOS, and +if none is present, the probe will not find your card. +Then you will +have to use a boot arg of the form: +.IP +.BI aha152x= iobase[,irq[,scsi-id[,reconnect[,parity]]]] +.IP +If the driver was compiled with debugging enabled, a sixth +value can be specified to set the debug level. + +All the parameters are as described at the top of this section, and the +.I reconnect +value will allow device disconnect/reconnect if a nonzero value +is used. +An example usage is as follows: +.IP +aha152x=0x340,11,7,1 +.IP +Note that the parameters must be specified in order, meaning that if +you want to specify a parity setting, then you will have to specify an +iobase, irq, scsi-id and reconnect value as well. +.TP +.B "Adaptec aha154x configuration" +The aha1542 series cards have an i82077 floppy controller onboard, +while the aha1540 series cards do not. +These are busmastering cards, +and have parameters to set the "fairness" that is used to share +the bus with other devices. +The boot arg looks like the following. +.IP +.BI aha1542= iobase[,buson,busoff[,dmaspeed]] +.IP +Valid iobase values are usually one of: 0x130, 0x134, 0x230, 0x234, +0x330, 0x334. +Clone cards may permit other values. + +The +.IR buson ", " busoff +values refer to the number of microseconds that the +card dominates the ISA bus. +The defaults are 11us on, and 4us off, so +that other cards (such as an ISA LANCE Ethernet card) have a chance to +get access to the ISA bus. + +The +.I dmaspeed +value refers to the rate (in MB/s) at which the DMA +(Direct Memory Access) transfers proceed. +The default is 5MB/s. +Newer revision cards allow you to select this value as part of the +soft-configuration, older cards use jumpers. +You can use values up to +10MB/s assuming that your motherboard is capable of handling it. +Experiment with caution if using values over 5MB/s. +.TP +.B "Adaptec aha274x, aha284x, aic7xxx configuration" +These boards can accept an argument of the form: +.IP +.BI aic7xxx= extended,no_reset +.IP +The +.I extended +value, if nonzero, indicates that extended translation for large +disks is enabled. +The +.I no_reset +value, if nonzero, tells the driver not to reset the SCSI bus when +setting up the host adapter at boot. +.TP +.B "AdvanSys SCSI Hosts configuration ('advansys=')" +The AdvanSys driver can accept up to four i/o addresses that will be +probed for an AdvanSys SCSI card. +Note that these values (if used) do +not effect EISA or PCI probing in any way. +They are only used for +probing ISA and VLB cards. +In addition, if the driver has been +compiled with debugging enabled, the level of debugging output can be +set by adding an 0xdeb[0-f] parameter. +The 0-f allows setting the +level of the debugging messages to any of 16 levels of verbosity. +.TP +.B "AM53C974" +.IP +.BI AM53C974= host-scsi-id,target-scsi-id,max-rate,max-offset +.TP +.B "BusLogic SCSI Hosts configuration ('BusLogic=')" +.IP +.BI BusLogic= N1,N2,N3,N4,N5,S1,S2,... +.IP +For an extensive discussion of the BusLogic command line parameters, +see +.I /usr/src/linux/drivers/scsi/BusLogic.c +(lines 3149-3270 in the kernel version I am looking at). +The text +below is a very much abbreviated extract. + +The parameters N1-N5 are integers. +The parameters S1,... are strings. +N1 is the I/O Address at which the Host Adapter is located. +N2 is the Tagged Queue Depth to use for Target Devices that support +Tagged Queuing. +N3 is the Bus Settle Time in seconds. +This is the amount of time +to wait between a Host Adapter Hard Reset which +initiates a SCSI Bus Reset and issuing any SCSI Commands. +N4 is the Local Options (for one Host Adapter). +N5 is the Global Options (for all Host Adapters). + +The string options are used to provide control over Tagged Queuing +(TQ:Default, TQ:Enable, TQ:Disable, TQ:), over +Error Recovery (ER:Default, ER:HardReset, ER:BusDeviceReset, +ER:None, ER:), and over Host Adapter Probing +(NoProbe, NoProbeISA, NoSortPCI). +.TP +.B "EATA/DMA configuration" +The default list of i/o ports to be probed can be changed by +.IP +.BI eata= iobase,iobase,...\fP. +.TP +.B "Future Domain TMC-16x0 configuration" +.IP +.BI fdomain= iobase,irq[,adapter_id] +.TP +.B "Great Valley Products (GVP) SCSI controller configuration" +.IP +.BI gvp11= dma_transfer_bitmask +.TP +.B "Future Domain TMC-8xx, TMC-950 configuration" +.IP +.BI tmc8xx= mem_base,irq +.IP +The +.I mem_base +value is the value of the memory mapped I/O region that +the card uses. +This will usually be one of the following values: +0xc8000, 0xca000, 0xcc000, 0xce000, 0xdc000, 0xde000. +.TP +.B "IN2000 configuration" +.IP +.BI in2000= S +.IP +where S is a comma-separated string of items keyword[:value]. +Recognized keywords (possibly with value) are: +ioport:addr, noreset, nosync:x, period:ns, disconnect:x, +debug:x, proc:x. +For the function of these parameters, see +.IR /usr/src/linux/drivers/scsi/in2000.c . +.TP +.B "NCR5380 and NCR53C400 configuration" +The boot arg is of the form +.IP +.BI ncr5380= iobase,irq,dma +.IP +or +.IP +.BI ncr53c400= iobase,irq +.IP +If the card doesn't use interrupts, then an IRQ value of 255 (0xff) will +disable interrupts. +An IRQ value of 254 means to autoprobe. +More details can be found in the file +.I Documentation/scsi/g_NCR5380.txt +(or +.I drivers/scsi/README.g_NCR5380 +for older kernels) in the kernel source. +.TP +.B "NCR53C8xx configuration" +.IP +.BI ncr53c8xx= S +.IP +where S is a comma-separated string of items keyword:value. +Recognized keywords are: mpar (master_parity), spar (scsi_parity), +disc (disconnection), specf (special_features), ultra (ultra_scsi), +fsn (force_sync_nego), tags (default_tags), sync (default_sync), +verb (verbose), debug (debug), burst (burst_max). +For the function of the assigned values, see +.IR /usr/src/linux/drivers/scsi/ncr53c8xx.c . +.TP +.B "NCR53c406a configuration" +.IP +.BI ncr53c406a= iobase[,irq[,fastpio]] +.IP +Specify irq = 0 for noninterrupt driven mode. +Set fastpio = 1 for fast pio mode, 0 for slow mode. +.TP +.B "Pro Audio Spectrum configuration" +The PAS16 uses a NC5380 SCSI chip, and newer models support +jumperless configuration. +The boot arg is of the form: +.IP +.BI pas16= iobase,irq +.IP +The only difference is that you can specify an IRQ value of 255, which +will tell the driver to work without using interrupts, albeit at a +performance loss. +The iobase is usually 0x388. +.TP +.B "Seagate ST-0x configuration" +If your card is not detected at boot time, +you will then have to use a boot arg of the form: +.IP +.BI st0x= mem_base,irq +.IP +The +.I mem_base +value is the value of the memory mapped I/O region that +the card uses. +This will usually be one of the following values: +0xc8000, 0xca000, 0xcc000, 0xce000, 0xdc000, 0xde000. +.TP +.B "Trantor T128 configuration" +These cards are also based on the NCR5380 chip, and accept the +following options: +.IP +.BI t128= mem_base,irq +.IP +The valid values for +.I mem_base +are as follows: 0xcc000, 0xc8000, 0xdc000, 0xd8000. +.TP +.B "UltraStor 14F/34F configuration" +The default list of i/o ports to be probed can be changed by +.IP +.BI eata= iobase,iobase,... . +.TP +.B "WD7000 configuration" +.IP +.BI wd7000= irq,dma,iobase +.TP +.B "Commodore Amiga A2091/590 SCSI controller configuration" +.IP +.BI wd33c93= S +.IP +where S is a comma-separated string of options. +Recognized options are +nosync:bitmask, nodma:x, period:ns, disconnect:x, debug:x, +clock:x, next. +For details, see +.IR /usr/src/linux/drivers/scsi/wd33c93.c . +.SS "Hard Disks" +.TP +.B "IDE Disk/CD-ROM Driver Parameters" +The IDE driver accepts a number of parameters, which range from disk +geometry specifications, to support for broken controller chips. +Drive-specific options are specified by using 'hdX=' with X in 'a'-'h'. + +Non-drive-specific options are specified with the prefix 'hd='. +Note that using a drive-specific prefix for a non-drive-specific option +will still work, and the option will just be applied as expected. + +Also note that 'hd=' can be used to refer to the next unspecified +drive in the (a, ..., h) sequence. +For the following discussions, +the 'hd=' option will be cited for brevity. +See the file +.I Documentation/ide.txt +(or +.I drivers/block/README.ide +for older kernels) in the kernel source for more details. +.TP +.B "The 'hd=cyls,heads,sects[,wpcom[,irq]]' options" +These options are used to specify the physical geometry of the disk. +Only the first three values are required. +The cylinder/head/sectors +values will be those used by fdisk. +The write precompensation value +is ignored for IDE disks. +The IRQ value specified will be the IRQ +used for the interface that the drive resides on, and is not really a +drive-specific parameter. +.TP +.B "The 'hd=serialize' option" +The dual IDE interface CMD-640 chip is broken as designed such that +when drives on the secondary interface are used at the same time as +drives on the primary interface, it will corrupt your data. +Using this +option tells the driver to make sure that both interfaces are never +used at the same time. +.TP +.B "The 'hd=dtc2278' option" +This option tells the driver that you have a DTC-2278D IDE interface. +The driver then tries to do DTC-specific operations to enable the +second interface and to enable faster transfer modes. +.TP +.B "The 'hd=noprobe' option" +Do not probe for this drive. +For example, +.IP +hdb=noprobe hdb=1166,7,17 +.IP +would disable the probe, but still specify the drive geometry so +that it would be registered as a valid block device, and hence +usable. +.TP +.B "The 'hd=nowerr' option" +Some drives apparently have the +.B WRERR_STAT +bit stuck on permanently. +This enables a work-around for these broken devices. +.TP +.B "The 'hd=cdrom' option" +This tells the IDE driver that there is an ATAPI compatible CD-ROM +attached in place of a normal IDE hard disk. +In most cases the CD-ROM +is identified automatically, but if it isn't then this may help. +.TP +.B "Standard ST-506 Disk Driver Options ('hd=')" +The standard disk driver can accept geometry arguments for the disks +similar to the IDE driver. +Note however that it only expects three +values (C/H/S); any more or any less and it will silently ignore you. +Also, it only accepts 'hd=' as an argument, that is, 'hda=' +and so on are not valid here. +The format is as follows: +.IP +hd=cyls,heads,sects +.IP +If there are two disks installed, the above is repeated with the +geometry parameters of the second disk. +.TP +.B "XT Disk Driver Options ('xd=')" +If you are unfortunate enough to be using one of these old 8 bit cards +that move data at a whopping 125kB/s then here is the scoop. +If the card is not recognized, you will have to use a boot arg of the form: +.IP +xd=type,irq,iobase,dma_chan +.IP +The type value specifies the particular manufacturer of the card, +overriding autodetection. +For the types to use, consult the +.I drivers/block/xd.c +source file of the kernel you are using. +The type is an index in the list +.I xd_sigs +and in the course of time +.\" 1.1.50, 1.3.81, 1.3.99, 2.0.34, 2.1.67, 2.1.78, 2.1.127 +types have been added to or deleted from the middle of the list, +changing all type numbers. +Today (Linux 2.5.0) the types are +0=generic; 1=DTC 5150cx; 2,3=DTC 5150x; 4,5=Western Digital; +6,7,8=Seagate; 9=Omti; 10=XEBEC, and where here several types are +given with the same designation, they are equivalent. + +The xd_setup() function does no checking on the values, and assumes +that you entered all four values. +Don't disappoint it. +Here is an +example usage for a WD1002 controller with the BIOS disabled/removed, +using the 'default' XT controller parameters: +.IP +xd=2,5,0x320,3 +.TP +.B "Syquest's EZ* removable disks" +.IP +.BI ez= iobase[,irq[,rep[,nybble]]] +.SS "IBM MCA Bus Devices" +See also +.IR /usr/src/linux/Documentation/mca.txt . +.TP +.B "PS/2 ESDI hard disks" +It is possible to specify the desired geometry at boot time: +.IP +.BI ed= cyls,heads,sectors. +.IP +For a ThinkPad-720, add the option +.IP +.BR tp720=1 . +.TP +.B "IBM Microchannel SCSI Subsystem configuration" +.IP +.BI ibmmcascsi= N +.IP +where N is the \fIpun\fP (SCSI ID) of the subsystem. +.TP +.B "The Aztech Interface" +The syntax for this type of card is: +.IP +aztcd=iobase[,magic_number] +.IP +If you set the magic_number to 0x79 then the driver will try and run +anyway in the event of an unknown firmware version. +All other values +are ignored. +.TP +.B "Parallel port CD-ROM drives" +Syntax: +.IP +pcd.driveN=prt,pro,uni,mod,slv,dly +.br +pcd.nice=nice +.IP +where 'port' is the base address, 'pro' is the protocol number, 'uni' +is the unit selector (for chained devices), 'mod' is the mode (or \-1 +to choose the best automatically), 'slv' is 1 if it should be a slave, +and 'dly' is a small integer for slowing down port accesses. +The 'nice' parameter controls the driver's use of idle CPU time, at the +expense of some speed. +.TP +.B "The CDU-31A and CDU-33A Sony Interface" +This CD-ROM interface is found on some of the Pro Audio Spectrum sound +cards, and other Sony supplied interface cards. +The syntax is as follows: +.IP +cdu31a=iobase,[irq[,is_pas_card]] +.IP +Specifying an IRQ value of zero tells the driver that hardware +interrupts aren't supported (as on some PAS cards). +If your card +supports interrupts, you should use them as it cuts down on the CPU +usage of the driver. + +The +.I is_pas_card +should be entered as 'PAS' if using a Pro Audio Spectrum card, +and otherwise it should not be specified at all. +.TP +.B "The CDU-535 Sony Interface" +The syntax for this CD-ROM interface is: +.IP +sonycd535=iobase[,irq] +.IP +A zero can be used for the I/O base as a 'placeholder' if one wishes +to specify an IRQ value. +.TP +.B "The GoldStar Interface" +The syntax for this CD-ROM interface is: +.IP +gscd=iobase +.TP +.B "The ISP16 CD-ROM Interface" +Syntax: +.IP +isp16=[iobase[,irq[,dma[,type]]]] +.IP +(three integers and a string). +If the type is given as 'noisp16', +the interface will not be configured. +Other recognized types +are: 'Sanyo", 'Sony', 'Panasonic' and 'Mitsumi'. +.TP +.B "The Mitsumi Standard Interface" +The syntax for this CD-ROM interface is: +.IP +mcd=iobase,[irq[,wait_value]] +.IP +The +.I wait_value +is used as an internal timeout value for people who are +having problems with their drive, and may or may not be implemented +depending on a compile-time #define. +The Mitsumi FX400 is an IDE/ATAPI CD-ROM player and does not use +the mcd driver. +.TP +.B "The Mitsumi XA/MultiSession Interface" +This is for the same hardware as above, but the driver has extended features. +Syntax: +.IP +mcdx=iobase[,irq] +.TP +.B "The Optics Storage Interface" +The syntax for this type of card is: +.IP +optcd=iobase +.TP +.B "The Phillips CM206 Interface" +The syntax for this type of card is: +.IP +cm206=[iobase][,irq] +.IP +The driver assumes numbers between 3 and 11 are IRQ values, and +numbers between 0x300 and 0x370 are I/O ports, so you can specify one, +or both numbers, in any order. +It also accepts 'cm206=auto' to enable +autoprobing. +.TP +.B "The Sanyo Interface" +The syntax for this type of card is: +.IP +sjcd=iobase[,irq[,dma_channel]] +.TP +.B "The SoundBlaster Pro Interface" +The syntax for this type of card is: +.IP +sbpcd=iobase,type +.IP +where type is one of the following (case sensitive) strings: +\&'SoundBlaster', 'LaserMate', or 'SPEA'. +The I/O base is that of the +CD-ROM interface, and not that of the sound portion of the card. +.SS "Ethernet Devices" +Different drivers make use of different parameters, but they all at +least share having an IRQ, an I/O port base value, and a name. +In its most generic form, it looks something like this: +.IP +ether=irq,iobase[,param_1[,...param_8]],name +.IP +The first nonnumeric argument is taken as the name. +The param_n values (if applicable) usually have different meanings for each +different card/driver. +Typical param_n values are used to specify +things like shared memory address, interface selection, DMA channel +and the like. + +The most common use of this parameter is to force probing for a second +ethercard, as the default is to only probe for one. +This can be accomplished with a simple: +.IP +ether=0,0,eth1 +.IP +Note that the values of zero for the IRQ and I/O base in the above +example tell the driver(s) to autoprobe. + +The Ethernet-HowTo has extensive documentation on using multiple +cards and on the card/driver-specific implementation +of the param_n values where used. +Interested readers should refer to +the section in that document on their particular card. +.SS "The Floppy Disk Driver" +There are many floppy driver options, and they are all listed in +.I Documentation/floppy.txt +(or +.I drivers/block/README.fd +for older kernels) in the kernel source. +This information is taken directly +from that file. +.TP +.B "floppy=mask,allowed_drive_mask" +Sets the bit mask of allowed drives to mask. +By default, only units 0 +and 1 of each floppy controller are allowed. +This is done because +certain nonstandard hardware (ASUS PCI motherboards) mess up the +keyboard when accessing units 2 or 3. +This option is somewhat +obsoleted by the cmos option. +.TP +.B "floppy=all_drives" +Sets the bit mask of allowed drives to all drives. +Use this if you have +more than two drives connected to a floppy controller. +.TP +.B "floppy=asus_pci" +Sets the bit mask to allow only units 0 and 1. +(The default) +.TP +.B "floppy=daring" +Tells the floppy driver that you have a well behaved floppy +controller. +This allows more efficient and smoother operation, but +may fail on certain controllers. +This may speed up certain operations. +.TP +.B "floppy=0,daring" +Tells the floppy driver that your floppy controller should be used +with caution. +.TP +.B "floppy=one_fdc" +Tells the floppy driver that you have only floppy controller (default) +.TP +.BR floppy=two_fdc " or " floppy=address,two_fdc +Tells the floppy driver that you have two floppy controllers. +The second floppy controller is assumed to be at address. +If address is +not given, 0x370 is assumed. +.TP +.B "floppy=thinkpad" +Tells the floppy driver that you have a Thinkpad. +Thinkpads use an +inverted convention for the disk change line. +.TP +.B "floppy=0,thinkpad" +Tells the floppy driver that you don't have a Thinkpad. +.TP +.B "floppy=drive,type,cmos" +Sets the cmos type of drive to type. +Additionally, this drive is +allowed in the bit mask. +This is useful if you have more than two +floppy drives (only two can be described in the physical cmos), or if +your BIOS uses nonstandard CMOS types. +Setting the CMOS to 0 for the +first two drives (default) makes the floppy driver read the physical +cmos for those drives. +.TP +.B "floppy=unexpected_interrupts" +Print a warning message when an unexpected interrupt is received +(default behavior) +.TP +.BR floppy=no_unexpected_interrupts " or " floppy=L40SX +Don't print a message when an unexpected interrupt is received. +This is needed on IBM L40SX laptops in certain video modes. +(There seems to +be an interaction between video and floppy. +The unexpected interrupts +only affect performance, and can safely be ignored.) +.SS "The Sound Driver" +The sound driver can also accept boot args to override the compiled in +values. +This is not recommended, as it is rather complex. +It is described in the kernel source file +.IR Documentation/sound/oss/README.OSS +.RI ( drivers/sound/Readme.linux +in older kernel versions). +It accepts +a boot arg of the form: +.IP +sound=device1[,device2[,device3...[,device10]]] +.IP +where each deviceN value is of the following format 0xTaaaId and the +bytes are used as follows: + +T \- device type: 1=FM, 2=SB, 3=PAS, 4=GUS, 5=MPU401, 6=SB16, +7=SB16-MPU401 + +aaa \- I/O address in hex. + +I \- interrupt line in hex (i.e 10=a, 11=b, ...) + +d \- DMA channel. + +As you can see it gets pretty messy, and you are better off to compile +in your own personal values as recommended. +Using a boot arg of +\&'sound=0' will disable the sound driver entirely. +.SS "ISDN Drivers" +.TP +.B "The ICN ISDN driver" +Syntax: +.IP +icn=iobase,membase,icn_id1,icn_id2 +.IP +where icn_id1,icn_id2 are two strings used to identify the +card in kernel messages. +.TP +.B "The PCBIT ISDN driver" +Syntax: +.IP +pcbit=membase1,irq1[,membase2,irq2] +.IP +where membaseN is the shared memory base of the N'th card, and irqN is +the interrupt setting of the N'th card. +The default is IRQ 5 and +membase 0xD0000. +.TP +.B "The Teles ISDN driver" +Syntax: +.IP +teles=iobase,irq,membase,protocol,teles_id +.IP +where iobase is the i/o port address of the card, membase is the +shared memory base address of the card, irq is the interrupt channel +the card uses, and teles_id is the unique ASCII string identifier. +.SS "Serial Port Drivers" +.TP +.B "The RISCom/8 Multiport Serial Driver ('riscom8=')" +Syntax: +.IP +riscom=iobase1[,iobase2[,iobase3[,iobase4]]] +.IP +More details can be found in +.IR /usr/src/linux/Documentation/riscom8.txt . +.TP +.B "The DigiBoard Driver ('digi=')" +If this option is used, it should have precisely six parameters. +Syntax: +.IP +digi=status,type,altpin,numports,iobase,membase +.IP +The parameters maybe given as integers, or as strings. +If strings are used, then iobase and membase should be given +in hexadecimal. +The integer arguments (fewer may be given) are in order: +status (Enable(1) or Disable(0) this card), +type (PC/Xi(0), PC/Xe(1), PC/Xeve(2), PC/Xem(3)), +altpin (Enable(1) or Disable(0) alternate pin arrangement), +numports (number of ports on this card), +iobase (I/O Port where card is configured (in HEX)), +membase (base of memory window (in HEX)). +Thus, the following two boot prompt arguments are equivalent: +.IP +digi=E,PC/Xi,D,16,200,D0000 +.br +digi=1,0,0,16,0x200,851968 +.IP +More details can be found in +.IR /usr/src/linux/Documentation/digiboard.txt . +.TP +.B "The Baycom Serial/Parallel Radio Modem" +Syntax: +.IP +baycom=iobase,irq,modem +.IP +There are precisely 3 parameters; for several cards, give +several 'baycom=' commands. +The modem parameter is a string +that can take one of the values ser12, ser12*, par96, par96*. +Here the * denotes that software DCD is to be used, and +ser12/par96 chooses between the supported modem types. +For more details, see the file +.I Documentation/networking/baycom.txt +(or +.I drivers/net/README.baycom +for older kernels) in the kernel source. +.TP +.B "Soundcard radio modem driver" +Syntax: +.IP +soundmodem=iobase,irq,dma[,dma2[,serio[,pario]]],0,mode +.IP +All parameters except the last are integers; +the dummy 0 is required because of a bug in the setup code. +The mode parameter is a string with syntax hw:modem, +where hw is one of sbc, wss, wssfdx and modem is one of +afsk1200, fsk9600. +.SS "The Line Printer Driver" +.TP +.B "'lp='" +Syntax: +.IP +lp=0 +.br +lp=auto +.br +lp=reset +.br +lp=port[,port...] +.IP +You can tell the printer driver what ports to use and what ports not +to use. +The latter comes in handy if you don't want the printer driver +to claim all available parallel ports, so that other drivers +(e.g., PLIP, PPA) can use them instead. + +The format of the argument is multiple port names. +For example, +lp=none,parport0 would use the first parallel port for lp1, and +disable lp0. +To disable the printer driver entirely, one can use +lp=0. +.TP +.B "WDT500/501 driver" +Syntax: +.IP +wdt=io,irq +.SS "Mouse Drivers" +.TP +.B "'bmouse=irq'" +The busmouse driver only accepts one parameter, that being the +hardware IRQ value to be used. +.TP +.B "'msmouse=irq'" +And precisely the same is true for the msmouse driver. +.TP +.B "ATARI mouse setup" +.IP +atamouse=threshold[,y-threshold] +.IP +If only one argument is given, it is used for both +x-threshold and y-threshold. +Otherwise, the first argument +is the x-threshold, and the second the y-threshold. +These values must lie between 1 and 20 (inclusive); the default is 2. +.SS "Video Hardware" +.TP +.B "'no-scroll'" +This option tells the console driver not to use hardware scroll +(where a scroll is effected by moving the screen origin in video +memory, instead of moving the data). +It is required by certain +Braille machines. +.\" .SH AUTHORS +.\" Linus Torvalds (and many others) +.SH "SEE ALSO" +.BR lilo.conf (5), +.BR klogd (8), +.BR lilo (8), +.BR mount (8), +.BR rdev (8) + +Large parts of this man page have been derived from the +Boot Parameter HOWTO (version 1.0.1) written by Paul Gortmaker. +More information may be found in this (or a more recent) HOWTO. +An up-to-date source of information is +.IR /usr/src/linux/Documentation/kernel-parameters.txt . diff --git a/original/man7/capabilities.7 b/original/man7/capabilities.7 new file mode 100644 index 00000000..c09c0555 --- /dev/null +++ b/original/man7/capabilities.7 @@ -0,0 +1,924 @@ +.\" Copyright (c) 2002 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. +.\" +.\" 6 Aug 2002 - Initial Creation +.\" Modified 2003-05-23, Michael Kerrisk, +.\" Modified 2004-05-27, Michael Kerrisk, +.\" 2004-12-08, mtk Added O_NOATIME for CAP_FOWNER +.\" 2005-08-16, mtk, Added CAP_AUDIT_CONTROL and CAP_AUDIT_WRITE +.\" 2008-07-15, Serge Hallyn +.\" Document file capabilities, per-process capability +.\" bounding set, changed semantics for CAP_SETPCAP, +.\" and other changes in 2.6.2[45]. +.\" Add CAP_MAC_ADMIN, CAP_MAC_OVERRIDE, CAP_SETFCAP. +.\" 2008-07-15, mtk +.\" Add text describing circumstances in which CAP_SETPCAP +.\" (theoretically) permits a thread to change the +.\" capability sets of another thread. +.\" Add section describing rules for programmatically +.\" adjusting thread capability sets. +.\" Describe rationale for capability bounding set. +.\" Document "securebits" flags. +.\" Add text noting that if we set the effective flag for one file +.\" capability, then we must also set the effective flag for all +.\" other capabilities where the permitted or inheritable bit is set. +.\" +.TH CAPABILITIES 7 2010-01-31 "Linux" "Linux Programmer's Manual" +.SH NAME +capabilities \- overview of Linux capabilities +.SH DESCRIPTION +For the purpose of performing permission checks, +traditional Unix implementations distinguish two categories of processes: +.I privileged +processes (whose effective user ID is 0, referred to as superuser or root), +and +.I unprivileged +processes (whose effective UID is nonzero). +Privileged processes bypass all kernel permission checks, +while unprivileged processes are subject to full permission +checking based on the process's credentials +(usually: effective UID, effective GID, and supplementary group list). + +Starting with kernel 2.2, Linux divides the privileges traditionally +associated with superuser into distinct units, known as +.IR capabilities , +which can be independently enabled and disabled. +Capabilities are a per-thread attribute. +.\" +.SS Capabilities List +The following list shows the capabilities implemented on Linux, +and the operations or behaviors that each capability permits: +.TP +.BR CAP_AUDIT_CONTROL " (since Linux 2.6.11)" +Enable and disable kernel auditing; change auditing filter rules; +retrieve auditing status and filtering rules. +.TP +.BR CAP_AUDIT_WRITE " (since Linux 2.6.11)" +Write records to kernel auditing log. +.TP +.B CAP_CHOWN +Make arbitrary changes to file UIDs and GIDs (see +.BR chown (2)). +.TP +.B CAP_DAC_OVERRIDE +Bypass file read, write, and execute permission checks. +(DAC is an abbreviation of "discretionary access control".) +.TP +.B CAP_DAC_READ_SEARCH +Bypass file read permission checks and +directory read and execute permission checks. +.TP +.B CAP_FOWNER +.PD 0 +.RS +.IP * 2 +Bypass permission checks on operations that normally +require the file system UID of the process to match the UID of +the file (e.g., +.BR chmod (2), +.BR utime (2)), +excluding those operations covered by +.B CAP_DAC_OVERRIDE +and +.BR CAP_DAC_READ_SEARCH ; +.IP * +set extended file attributes (see +.BR chattr (1)) +on arbitrary files; +.IP * +set Access Control Lists (ACLs) on arbitrary files; +.IP * +ignore directory sticky bit on file deletion; +.IP * +specify +.B O_NOATIME +for arbitrary files in +.BR open (2) +and +.BR fcntl (2). +.RE +.PD +.TP +.B CAP_FSETID +Don't clear set-user-ID and set-group-ID permission +bits when a file is modified; +set the set-group-ID bit for a file whose GID does not match +the file system or any of the supplementary GIDs of the calling process. +.TP +.B CAP_IPC_LOCK +Lock memory +.RB ( mlock (2), +.BR mlockall (2), +.BR mmap (2), +.BR shmctl (2)). +.TP +.B CAP_IPC_OWNER +Bypass permission checks for operations on System V IPC objects. +.TP +.B CAP_KILL +Bypass permission checks for sending signals (see +.BR kill (2)). +This includes use of the +.BR ioctl (2) +.B KDSIGACCEPT +operation. +.\" FIXME CAP_KILL also has an effect for threads + setting child +.\" termination signal to other than SIGCHLD: without this +.\" capability, the termination signal reverts to SIGCHLD +.\" if the child does an exec(). What is the rationale +.\" for this? +.TP +.BR CAP_LEASE " (since Linux 2.4)" +Establish leases on arbitrary files (see +.BR fcntl (2)). +.TP +.B CAP_LINUX_IMMUTABLE +Set the +.B FS_APPEND_FL +and +.B FS_IMMUTABLE_FL +.\" These attributes are now available on ext2, ext3, Reiserfs, XFS, JFS +i-node flags (see +.BR chattr (1)). +.TP +.BR CAP_MAC_ADMIN " (since Linux 2.6.25)" +Override Mandatory Access Control (MAC). +Implemented for the Smack Linux Security Module (LSM). +.TP +.BR CAP_MAC_OVERRIDE " (since Linux 2.6.25)" +Allow MAC configuration or state changes. +Implemented for the Smack LSM. +.TP +.BR CAP_MKNOD " (since Linux 2.4)" +Create special files using +.BR mknod (2). +.TP +.B CAP_NET_ADMIN +Perform various network-related operations +(e.g., setting privileged socket options, +enabling multicasting, interface configuration, +modifying routing tables). +.TP +.B CAP_NET_BIND_SERVICE +Bind a socket to Internet domain privileged ports +(port numbers less than 1024). +.TP +.B CAP_NET_BROADCAST +(Unused) Make socket broadcasts, and listen to multicasts. +.TP +.B CAP_NET_RAW +Use RAW and PACKET sockets. +.\" Also various IP options and setsockopt(SO_BINDTODEVICE) +.TP +.B CAP_SETGID +Make arbitrary manipulations of process GIDs and supplementary GID list; +forge GID when passing socket credentials via Unix domain sockets. +.TP +.BR CAP_SETFCAP " (since Linux 2.6.24)" +Set file capabilities. +.TP +.B CAP_SETPCAP +If file capabilities are not supported: +grant or remove any capability in the +caller's permitted capability set to or from any other process. +(This property of +.B CAP_SETPCAP +is not available when the kernel is configured to support +file capabilities, since +.B CAP_SETPCAP +has entirely different semantics for such kernels.) + +If file capabilities are supported: +add any capability from the calling thread's bounding set +to its inheritable set; +drop capabilities from the bounding set (via +.BR prctl (2) +.BR PR_CAPBSET_DROP ); +make changes to the +.I securebits +flags. +.TP +.B CAP_SETUID +Make arbitrary manipulations of process UIDs +.RB ( setuid (2), +.BR setreuid (2), +.BR setresuid (2), +.BR setfsuid (2)); +make forged UID when passing socket credentials via Unix domain sockets. +.\" FIXME CAP_SETUID also an effect in exec(); document this. +.TP +.B CAP_SYS_ADMIN +.PD 0 +.RS +.IP * 2 +Perform a range of system administration operations including: +.BR quotactl (2), +.BR mount (2), +.BR umount (2), +.BR swapon (2), +.BR swapoff (2), +.BR sethostname (2), +and +.BR setdomainname (2); +.IP * +perform +.B IPC_SET +and +.B IPC_RMID +operations on arbitrary System V IPC objects; +.IP * +perform operations on +.I trusted +and +.I security +Extended Attributes (see +.BR attr (5)); +.IP * +use +.BR lookup_dcookie (2); +.IP * +use +.BR ioprio_set (2) +to assign +.B IOPRIO_CLASS_RT +and (before Linux 2.6.25) +.B IOPRIO_CLASS_IDLE +I/O scheduling classes; +.IP * +forge UID when passing socket credentials; +.IP * +exceed +.IR /proc/sys/fs/file-max , +the system-wide limit on the number of open files, +in system calls that open files (e.g., +.BR accept (2), +.BR execve (2), +.BR open (2), +.BR pipe (2)); +.IP * +employ +.B CLONE_NEWNS +flag with +.BR clone (2) +and +.BR unshare (2); +.IP * +perform +.B KEYCTL_CHOWN +and +.B KEYCTL_SETPERM +.BR keyctl (2) +operations. +.RE +.PD +.TP +.B CAP_SYS_BOOT +Use +.BR reboot (2) +and +.BR kexec_load (2). +.TP +.B CAP_SYS_CHROOT +Use +.BR chroot (2). +.TP +.B CAP_SYS_MODULE +Load and unload kernel modules +(see +.BR init_module (2) +and +.BR delete_module (2)); +in kernels before 2.6.25: +drop capabilities from the system-wide capability bounding set. +.TP +.B CAP_SYS_NICE +.PD 0 +.RS +.IP * 2 +Raise process nice value +.RB ( nice (2), +.BR setpriority (2)) +and change the nice value for arbitrary processes; +.IP * +set real-time scheduling policies for calling process, +and set scheduling policies and priorities for arbitrary processes +.RB ( sched_setscheduler (2), +.BR sched_setparam (2)); +.IP * +set CPU affinity for arbitrary processes +.RB ( sched_setaffinity (2)); +.IP * +set I/O scheduling class and priority for arbitrary processes +.RB ( ioprio_set (2)); +.IP * +apply +.BR migrate_pages (2) +to arbitrary processes and allow processes +to be migrated to arbitrary nodes; +.\" FIXME CAP_SYS_NICE also has the following effect for +.\" migrate_pages(2): +.\" do_migrate_pages(mm, &old, &new, +.\" capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE); +.IP * +apply +.BR move_pages (2) +to arbitrary processes; +.IP * +use the +.B MPOL_MF_MOVE_ALL +flag with +.BR mbind (2) +and +.BR move_pages (2). +.RE +.PD +.TP +.B CAP_SYS_PACCT +Use +.BR acct (2). +.TP +.B CAP_SYS_PTRACE +Trace arbitrary processes using +.BR ptrace (2) +.TP +.B CAP_SYS_RAWIO +Perform I/O port operations +.RB ( iopl (2) +and +.BR ioperm (2)); +access +.IR /proc/kcore . +.TP +.B CAP_SYS_RESOURCE +.PD 0 +.RS +.IP * 2 +Use reserved space on ext2 file systems; +.IP * +make +.BR ioctl (2) +calls controlling ext3 journaling; +.IP * +override disk quota limits; +.IP * +increase resource limits (see +.BR setrlimit (2)); +.IP * +override +.B RLIMIT_NPROC +resource limit; +.IP * +raise +.I msg_qbytes +limit for a System V message queue above the limit in +.I /proc/sys/kernel/msgmnb +(see +.BR msgop (2) +and +.BR msgctl (2)). +.RE +.PD +.TP +.B CAP_SYS_TIME +Set system clock +.RB ( settimeofday (2), +.BR stime (2), +.BR adjtimex (2)); +set real-time (hardware) clock. +.TP +.B CAP_SYS_TTY_CONFIG +Use +.BR vhangup (2). +.\" +.SS Past and Current Implementation +A full implementation of capabilities requires that: +.IP 1. 3 +For all privileged operations, +the kernel must check whether the thread has the required +capability in its effective set. +.IP 2. +The kernel must provide system calls allowing a thread's capability sets to +be changed and retrieved. +.IP 3. +The file system must support attaching capabilities to an executable file, +so that a process gains those capabilities when the file is executed. +.PP +Before kernel 2.6.24, only the first two of these requirements are met; +since kernel 2.6.24, all three requirements are met. +.\" +.SS Thread Capability Sets +Each thread has three capability sets containing zero or more +of the above capabilities: +.TP +.IR Permitted : +This is a limiting superset for the effective +capabilities that the thread may assume. +It is also a limiting superset for the capabilities that +may be added to the inheritable set by a thread that does not have the +.B CAP_SETPCAP +capability in its effective set. + +If a thread drops a capability from its permitted set, +it can never reacquire that capability (unless it +.BR execve (2)s +either a set-user-ID-root program, or +a program whose associated file capabilities grant that capability). +.TP +.IR Inheritable : +This is a set of capabilities preserved across an +.BR execve (2). +It provides a mechanism for a process to assign capabilities +to the permitted set of the new program during an +.BR execve (2). +.TP +.IR Effective : +This is the set of capabilities used by the kernel to +perform permission checks for the thread. +.PP +A child created via +.BR fork (2) +inherits copies of its parent's capability sets. +See below for a discussion of the treatment of capabilities during +.BR execve (2). +.PP +Using +.BR capset (2), +a thread may manipulate its own capability sets (see below). +.\" +.SS File Capabilities +Since kernel 2.6.24, the kernel supports +associating capability sets with an executable file using +.BR setcap (8). +The file capability sets are stored in an extended attribute (see +.BR setxattr (2)) +named +.IR "security.capability" . +Writing to this extended attribute requires the +.BR CAP_SETFCAP +capability. +The file capability sets, +in conjunction with the capability sets of the thread, +determine the capabilities of a thread after an +.BR execve (2). + +The three file capability sets are: +.TP +.IR Permitted " (formerly known as " forced ): +These capabilities are automatically permitted to the thread, +regardless of the thread's inheritable capabilities. +.TP +.IR Inheritable " (formerly known as " allowed ): +This set is ANDed with the thread's inheritable set to determine which +inheritable capabilities are enabled in the permitted set of +the thread after the +.BR execve (2). +.TP +.IR Effective : +This is not a set, but rather just a single bit. +If this bit is set, then during an +.BR execve (2) +all of the new permitted capabilities for the thread are +also raised in the effective set. +If this bit is not set, then after an +.BR execve (2), +none of the new permitted capabilities is in the new effective set. + +Enabling the file effective capability bit implies +that any file permitted or inheritable capability that causes a +thread to acquire the corresponding permitted capability during an +.BR execve (2) +(see the transformation rules described below) will also acquire that +capability in its effective set. +Therefore, when assigning capabilities to a file +.RB ( setcap (8), +.BR cap_set_file (3), +.BR cap_set_fd (3)), +if we specify the effective flag as being enabled for any capability, +then the effective flag must also be specified as enabled +for all other capabilities for which the corresponding permitted or +inheritable flags is enabled. +.\" +.SS Transformation of Capabilities During execve() +.PP +During an +.BR execve (2), +the kernel calculates the new capabilities of +the process using the following algorithm: +.in +4n +.nf + +P'(permitted) = (P(inheritable) & F(inheritable)) | + (F(permitted) & cap_bset) + +P'(effective) = F(effective) ? P'(permitted) : 0 + +P'(inheritable) = P(inheritable) [i.e., unchanged] + +.fi +.in +where: +.RS 4 +.IP P 10 +denotes the value of a thread capability set before the +.BR execve (2) +.IP P' +denotes the value of a capability set after the +.BR execve (2) +.IP F +denotes a file capability set +.IP cap_bset +is the value of the capability bounding set (described below). +.RE +.\" +.SS Capabilities and execution of programs by root +In order to provide an all-powerful +.I root +using capability sets, during an +.BR execve (2): +.IP 1. 3 +If a set-user-ID-root program is being executed, +or the real user ID of the process is 0 (root) +then the file inheritable and permitted sets are defined to be all ones +(i.e., all capabilities enabled). +.IP 2. +If a set-user-ID-root program is being executed, +then the file effective bit is defined to be one (enabled). +.PP +The upshot of the above rules, +combined with the capabilities transformations described above, +is that when a process +.BR execve (2)s +a set-user-ID-root program, or when a process with an effective UID of 0 +.BR execve (2)s +a program, +it gains all capabilities in its permitted and effective capability sets, +except those masked out by the capability bounding set. +.\" If a process with real UID 0, and nonzero effective UID does an +.\" exec(), then it gets all capabilities in its +.\" permitted set, and no effective capabilities +This provides semantics that are the same as those provided by +traditional Unix systems. +.SS Capability bounding set +The capability bounding set is a security mechanism that can be used +to limit the capabilities that can be gained during an +.BR execve (2). +The bounding set is used in the following ways: +.IP * 2 +During an +.BR execve (2), +the capability bounding set is ANDed with the file permitted +capability set, and the result of this operation is assigned to the +thread's permitted capability set. +The capability bounding set thus places a limit on the permitted +capabilities that may be granted by an executable file. +.IP * +(Since Linux 2.6.25) +The capability bounding set acts as a limiting superset for +the capabilities that a thread can add to its inheritable set using +.BR capset (2). +This means that if a capability is not in the bounding set, +then a thread can't add this capability to its +inheritable set, even if it was in its permitted capabilities, +and thereby cannot have this capability preserved in its +permitted set when it +.BR execve (2)s +a file that has the capability in its inheritable set. +.PP +Note that the bounding set masks the file permitted capabilities, +but not the inherited capabilities. +If a thread maintains a capability in its inherited set +that is not in its bounding set, +then it can still gain that capability in its permitted set +by executing a file that has the capability in its inherited set. +.PP +Depending on the kernel version, the capability bounding set is either +a system-wide attribute, or a per-process attribute. +.PP +.B "Capability bounding set prior to Linux 2.6.25" +.PP +In kernels before 2.6.25, the capability bounding set is a system-wide +attribute that affects all threads on the system. +The bounding set is accessible via the file +.IR /proc/sys/kernel/cap-bound . +(Confusingly, this bit mask parameter is expressed as a +signed decimal number in +.IR /proc/sys/kernel/cap-bound .) + +Only the +.B init +process may set capabilities in the capability bounding set; +other than that, the superuser (more precisely: programs with the +.B CAP_SYS_MODULE +capability) may only clear capabilities from this set. + +On a standard system the capability bounding set always masks out the +.B CAP_SETPCAP +capability. +To remove this restriction (dangerous!), modify the definition of +.B CAP_INIT_EFF_SET +in +.I include/linux/capability.h +and rebuild the kernel. + +The system-wide capability bounding set feature was added +to Linux starting with kernel version 2.2.11. +.\" +.PP +.B "Capability bounding set from Linux 2.6.25 onwards" +.PP +From Linux 2.6.25, the +.I "capability bounding set" +is a per-thread attribute. +(There is no longer a system-wide capability bounding set.) + +The bounding set is inherited at +.BR fork (2) +from the thread's parent, and is preserved across an +.BR execve (2). + +A thread may remove capabilities from its capability bounding set using the +.BR prctl (2) +.B PR_CAPBSET_DROP +operation, provided it has the +.B CAP_SETPCAP +capability. +Once a capability has been dropped from the bounding set, +it cannot be restored to that set. +A thread can determine if a capability is in its bounding set using the +.BR prctl (2) +.B PR_CAPBSET_READ +operation. + +Removing capabilities from the bounding set is only supported if file +capabilities are compiled into the kernel +(CONFIG_SECURITY_FILE_CAPABILITIES). +In that case, the +.B init +process (the ancestor of all processes) begins with a full bounding set. +If file capabilities are not compiled into the kernel, then +.B init +begins with a full bounding set minus +.BR CAP_SETPCAP , +because this capability has a different meaning when there are +no file capabilities. + +Removing a capability from the bounding set does not remove it +from the thread's inherited set. +However it does prevent the capability from being added +back into the thread's inherited set in the future. +.\" +.\" +.SS Effect of User ID Changes on Capabilities +To preserve the traditional semantics for transitions between +0 and nonzero user IDs, +the kernel makes the following changes to a thread's capability +sets on changes to the thread's real, effective, saved set, +and file system user IDs (using +.BR setuid (2), +.BR setresuid (2), +or similar): +.IP 1. 3 +If one or more of the real, effective or saved set user IDs +was previously 0, and as a result of the UID changes all of these IDs +have a nonzero value, +then all capabilities are cleared from the permitted and effective +capability sets. +.IP 2. +If the effective user ID is changed from 0 to nonzero, +then all capabilities are cleared from the effective set. +.IP 3. +If the effective user ID is changed from nonzero to 0, +then the permitted set is copied to the effective set. +.IP 4. +If the file system user ID is changed from 0 to nonzero (see +.BR setfsuid (2)) +then the following capabilities are cleared from the effective set: +.BR CAP_CHOWN , +.BR CAP_DAC_OVERRIDE , +.BR CAP_DAC_READ_SEARCH , +.BR CAP_FOWNER , +.BR CAP_FSETID , +.B CAP_LINUX_IMMUTABLE +(since Linux 2.2.30), +.BR CAP_MAC_OVERRIDE , +and +.B CAP_MKNOD +(since Linux 2.2.30). +If the file system UID is changed from nonzero to 0, +then any of these capabilities that are enabled in the permitted set +are enabled in the effective set. +.PP +If a thread that has a 0 value for one or more of its user IDs wants +to prevent its permitted capability set being cleared when it resets +all of its user IDs to nonzero values, it can do so using the +.BR prctl (2) +.B PR_SET_KEEPCAPS +operation. +.\" +.SS Programmatically adjusting capability sets +A thread can retrieve and change its capability sets using the +.BR capget (2) +and +.BR capset (2) +system calls. +However, the use of +.BR cap_get_proc (3) +and +.BR cap_set_proc (3), +both provided in the +.I libcap +package, +is preferred for this purpose. +The following rules govern changes to the thread capability sets: +.IP 1. 3 +If the caller does not have the +.B CAP_SETPCAP +capability, +the new inheritable set must be a subset of the combination +of the existing inheritable and permitted sets. +.IP 2. +(Since kernel 2.6.25) +The new inheritable set must be a subset of the combination of the +existing inheritable set and the capability bounding set. +.IP 3. +The new permitted set must be a subset of the existing permitted set +(i.e., it is not possible to acquire permitted capabilities +that the thread does not currently have). +.IP 4. +The new effective set must be a subset of the new permitted set. +.SS The """securebits"" flags: establishing a capabilities-only environment +.\" For some background: +.\" see http://lwn.net/Articles/280279/ and +.\" http://article.gmane.org/gmane.linux.kernel.lsm/5476/ +Starting with kernel 2.6.26, +and with a kernel in which file capabilities are enabled, +Linux implements a set of per-thread +.I securebits +flags that can be used to disable special handling of capabilities for UID 0 +.RI ( root ). +These flags are as follows: +.TP +.B SECBIT_KEEP_CAPS +Setting this flag allows a thread that has one or more 0 UIDs to retain +its capabilities when it switches all of its UIDs to a nonzero value. +If this flag is not set, +then such a UID switch causes the thread to lose all capabilities. +This flag is always cleared on an +.BR execve (2). +(This flag provides the same functionality as the older +.BR prctl (2) +.B PR_SET_KEEPCAPS +operation.) +.TP +.B SECBIT_NO_SETUID_FIXUP +Setting this flag stops the kernel from adjusting capability sets when +the threads's effective and file system UIDs are switched between +zero and nonzero values. +(See the subsection +.IR "Effect of User ID Changes on Capabilities" .) +.TP +.B SECBIT_NOROOT +If this bit is set, then the kernel does not grant capabilities +when a set-user-ID-root program is executed, or when a process with +an effective or real UID of 0 calls +.BR execve (2). +(See the subsection +.IR "Capabilities and execution of programs by root" .) +.PP +Each of the above "base" flags has a companion "locked" flag. +Setting any of the "locked" flags is irreversible, +and has the effect of preventing further changes to the +corresponding "base" flag. +The locked flags are: +.BR SECBIT_KEEP_CAPS_LOCKED , +.BR SECBIT_NO_SETUID_FIXUP_LOCKED , +and +.BR SECBIT_NOROOT_LOCKED . +.PP +The +.I securebits +flags can be modified and retrieved using the +.BR prctl (2) +.B PR_SET_SECUREBITS +and +.B PR_GET_SECUREBITS +operations. +The +.B CAP_SETPCAP +capability is required to modify the flags. + +The +.I securebits +flags are inherited by child processes. +During an +.BR execve (2), +all of the flags are preserved, except +.B SECURE_KEEP_CAPS +which is always cleared. + +An application can use the following call to lock itself, +and all of its descendants, +into an environment where the only way of gaining capabilities +is by executing a program with associated file capabilities: +.in +4n +.nf + +prctl(PR_SET_SECUREBITS, + SECBIT_KEEP_CAPS_LOCKED | + SECBIT_NO_SETUID_FIXUP | + SECBIT_NO_SETUID_FIXUP_LOCKED | + SECBIT_NOROOT | + SECBIT_NOROOT_LOCKED); +.fi +.in +.SH "CONFORMING TO" +.PP +No standards govern capabilities, but the Linux capability implementation +is based on the withdrawn POSIX.1e draft standard; see +.IR http://wt.xpilot.org/publications/posix.1e/ . +.SH NOTES +Since kernel 2.5.27, capabilities are an optional kernel component, +and can be enabled/disabled via the CONFIG_SECURITY_CAPABILITIES +kernel configuration option. + +The +.I /proc/PID/task/TID/status +file can be used to view the capability sets of a thread. +The +.I /proc/PID/status +file shows the capability sets of a process's main thread. + +The +.I libcap +package provides a suite of routines for setting and +getting capabilities that is more comfortable and less likely +to change than the interface provided by +.BR capset (2) +and +.BR capget (2). +This package also provides the +.BR setcap (8) +and +.BR getcap (8) +programs. +It can be found at +.br +.IR http://www.kernel.org/pub/linux/libs/security/linux-privs . + +Before kernel 2.6.24, and since kernel 2.6.24 if +file capabilities are not enabled, a thread with the +.B CAP_SETPCAP +capability can manipulate the capabilities of threads other than itself. +However, this is only theoretically possible, +since no thread ever has +.BR CAP_SETPCAP +in either of these cases: +.IP * 2 +In the pre-2.6.25 implementation the system-wide capability bounding set, +.IR /proc/sys/kernel/cap-bound , +always masks out this capability, and this can not be changed +without modifying the kernel source and rebuilding. +.IP * +If file capabilities are disabled in the current implementation, then +.B init +starts out with this capability removed from its per-process bounding +set, and that bounding set is inherited by all other processes +created on the system. +.SH "SEE ALSO" +.BR capget (2), +.BR prctl (2), +.BR setfsuid (2), +.BR cap_clear (3), +.BR cap_copy_ext (3), +.BR cap_from_text (3), +.BR cap_get_file (3), +.BR cap_get_proc (3), +.BR cap_init (3), +.BR capgetp (3), +.BR capsetp (3), +.BR credentials (7), +.BR pthreads (7), +.BR getcap (8), +.BR setcap (8) +.PP +.I include/linux/capability.h +in the kernel source diff --git a/original/man7/charsets.7 b/original/man7/charsets.7 new file mode 100644 index 00000000..71eeeed5 --- /dev/null +++ b/original/man7/charsets.7 @@ -0,0 +1,362 @@ +.\" Copyright (c) 1996 Eric S. Raymond +.\" and Andries Brouwer +.\" +.\" 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. +.\" +.\" This is combined from many sources, including notes by aeb and +.\" research by esr. Portions derive from a writeup by Roman Czyborra. +.\" +.\" Last changed by David Starner . +.TH CHARSETS 7 2008-06-03 "Linux" "Linux Programmer's Manual" +.SH NAME +charsets \- programmer's view of character sets and internationalization +.SH DESCRIPTION +Linux is an international operating system. +Various of its utilities +and device drivers (including the console driver) support multilingual +character sets including Latin-alphabet letters with diacritical +marks, accents, ligatures, and entire non-Latin alphabets including +Greek, Cyrillic, Arabic, and Hebrew. +.LP +This manual page presents a programmer's-eye view of different +character-set standards and how they fit together on Linux. +Standards +discussed include ASCII, ISO 8859, KOI8-R, Unicode, ISO 2022 and +ISO 4873. +The primary emphasis is on character sets actually used as +locale character sets, not the myriad others that can be found in data +from other systems. +.LP +A complete list of charsets used in an officially supported locale in glibc +2.2.3 is: 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 and TIS-620 (in no +particular order.) +(Romanian may be switching to ISO-8859-16.) +.SS ASCII +ASCII (American Standard Code For Information Interchange) is the original +7-bit character set, originally designed for American English. +It is currently described by the ECMA-6 standard. +.LP +Various ASCII variants replacing the dollar sign with other currency +symbols and replacing punctuation with non-English alphabetic characters +to cover German, French, Spanish and others in 7 bits exist. +All are +deprecated; glibc doesn't support locales whose character sets aren't +true supersets of ASCII. +(These sets are also known as ISO-646, a close +relative of ASCII that permitted replacing these characters.) +.LP +As Linux was written for hardware designed in the US, it natively +supports ASCII. +.SS ISO 8859 +ISO 8859 is a series of 15 8-bit character sets all of which have US +ASCII in their low (7-bit) half, invisible control characters in +positions 128 to 159, and 96 fixed-width graphics in positions 160-255. +.LP +Of these, the most important is ISO 8859-1 (Latin-1). +It is natively +supported in the Linux console driver, fairly well supported in X11R6, +and is the base character set of HTML. +.LP +Console support for the other 8859 character sets is available under +Linux through user-mode utilities (such as +.BR setfont (8)) +.\" // some distributions still have the deprecated consolechars +that modify keyboard bindings and the EGA graphics +table and employ the "user mapping" font table in the console +driver. +.LP +Here are brief descriptions of each set: +.TP +8859-1 (Latin-1) +Latin-1 covers most Western European languages such as Albanian, Catalan, +Danish, Dutch, English, Faroese, Finnish, French, German, Galician, +Irish, Icelandic, Italian, Norwegian, Portuguese, Spanish, and +Swedish. +The lack of the ligatures Dutch ij, French oe and old-style +,,German`` quotation marks is considered tolerable. +.TP +8859-2 (Latin-2) +Latin-2 supports most Latin-written Slavic and Central European +languages: Croatian, Czech, German, Hungarian, Polish, Rumanian, +Slovak, and Slovene. +.TP +8859-3 (Latin-3) +Latin-3 is popular with authors of Esperanto, Galician, and Maltese. +(Turkish is now written with 8859-9 instead.) +.TP +8859-4 (Latin-4) +Latin-4 introduced letters for Estonian, Latvian, and Lithuanian. +It is essentially obsolete; see 8859-10 (Latin-6) and 8859-13 (Latin-7). +.TP +8859-5 +Cyrillic letters supporting Bulgarian, Byelorussian, Macedonian, +Russian, Serbian and Ukrainian. +Ukrainians read the letter "ghe" +with downstroke as "heh" and would need a ghe with upstroke to write a +correct ghe. +See the discussion of KOI8-R below. +.TP +8859-6 +Supports Arabic. +The 8859-6 glyph table is a fixed font of separate +letter forms, but a proper display engine should combine these +using the proper initial, medial, and final forms. +.TP +8859-7 +Supports Modern Greek. +.TP +8859-8 +Supports modern Hebrew without niqud (punctuation signs). +Niqud and full-fledged Biblical Hebrew are outside the scope of this +character set; under Linux, UTF-8 is the preferred encoding for +these. +.TP +8859-9 (Latin-5) +This is a variant of Latin-1 that replaces Icelandic letters with +Turkish ones. +.TP +8859-10 (Latin-6) +Latin 6 adds the last Inuit (Greenlandic) and Sami (Lappish) letters +that were missing in Latin 4 to cover the entire Nordic area. +RFC 1345 listed a preliminary and different "latin6". +Skolt Sami still +needs a few more accents than these. +.TP +8859-11 +This only exists as a rejected draft standard. +The draft standard +was identical to TIS-620, which is used under Linux for Thai. +.TP +8859-12 +This set does not exist. +While Vietnamese has been suggested for this +space, it does not fit within the 96 (noncombining) characters ISO +8859 offers. +UTF-8 is the preferred character set for Vietnamese use +under Linux. +.TP +8859-13 (Latin-7) +Supports the Baltic Rim languages; in particular, it includes Latvian +characters not found in Latin-4. +.TP +8859-14 (Latin-8) +This is the Celtic character set, covering Gaelic and Welsh. +This charset also contains the dotted characters needed for Old Irish. +.TP +8859-15 (Latin-9) +This adds the Euro sign and French and Finnish letters that were missing in +Latin-1. +.TP +8859-16 (Latin-10) +This set covers many of the languages covered by 8859-2, and supports +Romanian more completely then that set does. +.SS KOI8-R +KOI8-R is a non-ISO character set popular in Russia. +The lower half +is US ASCII; the upper is a Cyrillic character set somewhat better +designed than ISO 8859-5. +KOI8-U is a common character set, based off +KOI8-R, that has better support for Ukrainian. +Neither of these sets +are ISO-2022 compatible, unlike the ISO-8859 series. +.LP +Console support for KOI8-R is available under Linux through user-mode +utilities that modify keyboard bindings and the EGA graphics table, +and employ the "user mapping" font table in the console driver. +.\" Thanks to Tomohiro KUBOTA for the following sections about +.\" national standards. +.SS JIS X 0208 +JIS X 0208 is a Japanese national standard character set. +Though there are some more Japanese national standard character sets (like +JIS X 0201, JIS X 0212, and JIS X 0213), this is the most important one. +Characters are mapped into a 94x94 two-byte matrix, +whose each byte is in the range 0x21-0x7e. +Note that JIS X 0208 is a character set, not an encoding. +This means that JIS X 0208 +itself is not used for expressing text data. +JIS X 0208 is used +as a component to construct encodings such as EUC-JP, Shift_JIS, +and ISO-2022-JP. +EUC-JP is the most important encoding for Linux +and includes US ASCII and JIS X 0208. +In EUC-JP, JIS X 0208 +characters are expressed in two bytes, each of which is the +JIS X 0208 code plus 0x80. +.SS KS X 1001 +KS X 1001 is a Korean national standard character set. +Just as +JIS X 0208, characters are mapped into a 94x94 two-byte matrix. +KS X 1001 is used like JIS X 0208, as a component +to construct encodings such as EUC-KR, Johab, and ISO-2022-KR. +EUC-KR is the most important encoding for Linux and includes +US ASCII and KS X 1001. +KS C 5601 is an older name for KS X 1001. +.SS GB 2312 +GB 2312 is a mainland Chinese national standard character set used +to express simplified Chinese. +Just like JIS X 0208, characters are +mapped into a 94x94 two-byte matrix used to construct EUC-CN. +EUC-CN +is the most important encoding for Linux and includes US ASCII and +GB 2312. +Note that EUC-CN is often called as GB, GB 2312, or CN-GB. +.SS Big5 +Big5 is a popular character set in Taiwan to express traditional +Chinese. +(Big5 is both a character set and an encoding.) +It is a superset of US ASCII. +Non-ASCII characters are expressed in two bytes. +Bytes 0xa1-0xfe are used as leading bytes for two-byte characters. +Big5 and its extension is widely used in Taiwan and Hong Kong. +It is not ISO 2022-compliant. +.SS TIS 620 +TIS 620 is a Thai national standard character set and a superset +of US ASCII. +Like ISO 8859 series, Thai characters are mapped into +0xa1-0xfe. +TIS 620 is the only commonly used character set under +Linux besides UTF-8 to have combining characters. +.SS UNICODE +Unicode (ISO 10646) is a standard which aims to unambiguously represent every +character in every human language. +Unicode's structure permits 20.1 bits to encode every character. +Since most computers don't include 20.1-bit +integers, Unicode is usually encoded as 32-bit integers internally and +either a series of 16-bit integers (UTF-16) (needing two 16-bit integers +only when encoding certain rare characters) or a series of 8-bit bytes +(UTF-8). +Information on Unicode is available at . +.LP +Linux represents Unicode using the 8-bit Unicode Transformation Format +(UTF-8). +UTF-8 is a variable length encoding of Unicode. +It uses 1 +byte to code 7 bits, 2 bytes for 11 bits, 3 bytes for 16 bits, 4 bytes +for 21 bits, 5 bytes for 26 bits, 6 bytes for 31 bits. +.LP +Let 0,1,x stand for a zero, one, or arbitrary bit. +A byte 0xxxxxxx +stands for the Unicode 00000000 0xxxxxxx which codes the same symbol +as the ASCII 0xxxxxxx. +Thus, ASCII goes unchanged into UTF-8, and +people using only ASCII do not notice any change: not in code, and not +in file size. +.LP +A byte 110xxxxx is the start of a 2-byte code, and 110xxxxx 10yyyyyy +is assembled into 00000xxx xxyyyyyy. +A byte 1110xxxx is the start +of a 3-byte code, and 1110xxxx 10yyyyyy 10zzzzzz is assembled +into xxxxyyyy yyzzzzzz. +(When UTF-8 is used to code the 31-bit ISO 10646 +then this progression continues up to 6-byte codes.) +.LP +For most people who use ISO-8859 character sets, this means that the +characters outside of ASCII are now coded with two bytes. +This tends +to expand ordinary text files by only one or two percent. +For Russian +or Greek users, this expands ordinary text files by 100%, since text in +those languages is mostly outside of ASCII. +For Japanese users this means +that the 16-bit codes now in common use will take three bytes. +While there +are algorithmic conversions from some character sets (esp. ISO-8859-1) to +Unicode, general conversion requires carrying around conversion tables, +which can be quite large for 16-bit codes. +.LP +Note that UTF-8 is self-synchronizing: 10xxxxxx is a tail, any other +byte is the head of a code. +Note that the only way ASCII bytes occur +in a UTF-8 stream, is as themselves. +In particular, there are no +embedded NULs (\(aq\\0\(aq) or \(aq/\(aqs that form part of some larger code. +.LP +Since ASCII, and, in particular, NUL and \(aq/\(aq, are unchanged, the +kernel does not notice that UTF-8 is being used. +It does not care at +all what the bytes it is handling stand for. +.LP +Rendering of Unicode data streams is typically handled through +"subfont" tables which map a subset of Unicode to glyphs. +Internally +the kernel uses Unicode to describe the subfont loaded in video RAM. +This means that in UTF-8 mode one can use a character set with 512 +different symbols. +This is not enough for Japanese, Chinese and +Korean, but it is enough for most other purposes. +.LP +At the current time, the console driver does not handle combining +characters. +So Thai, Sioux and any other script needing combining +characters can't be handled on the console. +.SS "ISO 2022 and ISO 4873" +The ISO 2022 and 4873 standards describe a font-control model +based on VT100 practice. +This model is (partially) supported +by the Linux kernel and by +.BR xterm (1). +It is popular in Japan and Korea. +.LP +There are 4 graphic character sets, called G0, G1, G2 and G3, +and one of them is the current character set for codes with +high bit zero (initially G0), and one of them is the current +character set for codes with high bit one (initially G1). +Each graphic character set has 94 or 96 characters, and is +essentially a 7-bit character set. +It uses codes either +040-0177 (041-0176) or 0240-0377 (0241-0376). +G0 always has size 94 and uses codes 041-0176. +.LP +Switching between character sets is done using the shift functions +\fB^N\fP (SO or LS1), \fB^O\fP (SI or LS0), ESC n (LS2), ESC o (LS3), +ESC N (SS2), ESC O (SS3), ESC ~ (LS1R), ESC } (LS2R), ESC | (LS3R). +The function LS\fIn\fP makes character set G\fIn\fP the current one +for codes with high bit zero. +The function LS\fIn\fPR makes character set G\fIn\fP the current one +for codes with high bit one. +The function SS\fIn\fP makes character set G\fIn\fP (\fIn\fP=2 or 3) +the current one for the next character only (regardless of the value +of its high order bit). +.LP +A 94-character set is designated as G\fIn\fP character set +by an escape sequence ESC ( xx (for G0), ESC ) xx (for G1), +ESC * xx (for G2), ESC + xx (for G3), where xx is a symbol +or a pair of symbols found in the ISO 2375 International +Register of Coded Character Sets. +For example, ESC ( @ selects the ISO 646 character set as G0, +ESC ( A selects the UK standard character set (with pound +instead of number sign), ESC ( B selects ASCII (with dollar +instead of currency sign), ESC ( M selects a character set +for African languages, ESC ( ! A selects the Cuban character +set, etc. etc. +.LP +A 96-character set is designated as G\fIn\fP character set +by an escape sequence ESC \- xx (for G1), ESC . xx (for G2) +or ESC / xx (for G3). +For example, ESC \- G selects the Hebrew alphabet as G1. +.LP +A multibyte character set is designated as G\fIn\fP character set +by an escape sequence ESC $ xx or ESC $ ( xx (for G0), +ESC $ ) xx (for G1), ESC $ * xx (for G2), ESC $ + xx (for G3). +For example, ESC $ ( C selects the Korean character set for G0. +The Japanese character set selected by ESC $ B has a more +recent version selected by ESC & @ ESC $ B. +.LP +ISO 4873 stipulates a narrower use of character sets, where G0 +is fixed (always ASCII), so that G1, G2 and G3 +can only be invoked for codes with the high order bit set. +In particular, \fB^N\fP and \fB^O\fP are not used anymore, ESC ( xx +can be used only with xx=B, and ESC ) xx, ESC * xx, ESC + xx +are equivalent to ESC \- xx, ESC . xx, ESC / xx, respectively. +.SH "SEE ALSO" +.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) diff --git a/original/man7/complex.7 b/original/man7/complex.7 new file mode 100644 index 00000000..5680f092 --- /dev/null +++ b/original/man7/complex.7 @@ -0,0 +1,57 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.TH COMPLEX 7 2009-07-25 "" "Linux Programmer's Manual" +.SH NAME +complex \- basics of complex mathematics +.SH SYNOPSIS +.B #include +.SH DESCRIPTION +Complex numbers are numbers of the form z = a+b*i, where a and b are +real numbers and i = sqrt(\-1), so that i*i = \-1. +.br +There are other ways to represent that number. +The pair (a,b) of real +numbers may be viewed as a point in the plane, given by X- and +Y-coordinates. +This same point may also be described by giving +the pair of real numbers (r,phi), where r is the distance to the origin O, +and phi the angle between the X-axis and the line Oz. +Now +z = r*exp(i*phi) = r*(cos(phi)+i*sin(phi)). +.PP +The basic operations are defined on z = a+b*i and w = c+d*i as: +.TP +.B addition: z+w = (a+c) + (b+d)*i +.TP +.B multiplication: z*w = (a*c \- b*d) + (a*d + b*c)*i +.TP +.B division: z/w = ((a*c + b*d)/(c*c + d*d)) + ((b*c \- a*d)/(c*c + d*d))*i +.PP +Nearly all math function have a complex counterpart but there are +some complex-only functions. +.SH EXAMPLE +Your C-compiler can work with complex numbers if it supports the C99 standard. +Link with \fI\-lm\fP. +The imaginary unit is represented by I. +.sp +.nf +/* check that exp(i * pi) == \-1 */ +#include /* for atan */ +#include +#include + +int +main(void) +{ + double pi = 4 * atan(1.0); + double complex z = cexp(I * pi); + printf("%f + %f * i\\n", creal(z), cimag(z)); +} +.fi +.SH "SEE ALSO" +.BR cabs (3), +.BR carg (3), +.BR cexp (3), +.BR cimag (3), +.BR creal (3) diff --git a/original/man7/cp1251.7 b/original/man7/cp1251.7 new file mode 100644 index 00000000..f170444a --- /dev/null +++ b/original/man7/cp1251.7 @@ -0,0 +1,175 @@ +'\" t -*- coding: CP1251 -*- +.\" 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. +.TH CP1251 7 2009-01-15 "Linux" "Linux Programmer's Manual" +.SH NAME +cp1251 \- the CP\ 1251 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The Windows Code Pages include several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +CP\ 1251 encodes the characters used in Cyrillic scripts. +.\" (In my system with glibc-2.8-20080929 +.\" I found only bg_BG and be_BY locales using this encoding). +The following table displays the characters in CP\ 1251, which +are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for CP\ 1251. +.TS +l l l c lp-1. +Oct Dec Hex Char Description +_ +200 128 80 € CYRILLIC CAPITAL LETTER DJE +201 129 81  CYRILLIC CAPITAL LETTER GJE +202 130 82 ‚ SINGLE LOW-9 QUOTATION MARK +203 131 83 ƒ CYRILLIC SMALL LETTER GJE +204 132 84 „ DOUBLE LOW-9 QUOTATION MARK +205 133 85 … HORIZONTAL ELLIPSIS +206 134 86 † DAGGER +207 135 87 ‡ DOUBLE DAGGER +210 136 88 ˆ EURO SIGN +211 137 89 ‰ PER MILLE SIGN +212 138 8a Š CYRILLIC CAPITAL LETTER LJE +213 139 8b ‹ SINGLE LEFT-POINTING ANGLE QUOTATION MARK +214 140 8c Œ CYRILLIC CAPITAL LETTER NJE +215 141 8d  CYRILLIC CAPITAL LETTER KJE +216 142 8e Ž CYRILLIC CAPITAL LETTER TSHE +217 143 8f  CYRILLIC CAPITAL LETTER DZHE +220 144 90  CYRILLIC SMALL LETTER DJE +221 145 91 ‘ LEFT SINGLE QUOTATION MARK +222 146 92 ’ RIGHT SINGLE QUOTATION MARK +223 147 93 “ LEFT DOUBLE QUOTATION MARK +224 148 94 ” RIGHT DOUBLE QUOTATION MARK +225 149 95 • BULLET +226 150 96 – EN DASH +227 151 97 — EM DASH +230 152 98 UNDEFINED +231 153 99 ™ TRADE MARK SIGN +232 154 9a š CYRILLIC SMALL LETTER LJE +233 155 9b › SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +234 156 9c œ CYRILLIC SMALL LETTER NJE +235 157 9d  CYRILLIC SMALL LETTER KJE +236 158 9e ž CYRILLIC SMALL LETTER TSHE +237 159 9f Ÿ CYRILLIC SMALL LETTER DZHE +240 160 a0   NO-BREAK SPACE +241 161 a1 ¡ CYRILLIC CAPITAL LETTER SHORT U +242 162 a2 ¢ CYRILLIC SMALL LETTER SHORT U +243 163 a3 £ CYRILLIC CAPITAL LETTER JE +244 164 a4 ¤ CURRENCY SIGN +245 165 a5 ¥ CYRILLIC CAPITAL LETTER GHE WITH UPTURN +246 166 a6 ¦ BROKEN BAR +247 167 a7 § SECTION SIGN +250 168 a8 ¨ CYRILLIC CAPITAL LETTER IO +251 169 a9 © COPYRIGHT SIGN +252 170 aa ª CYRILLIC CAPITAL LETTER UKRAINIAN IE +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 ¯ CYRILLIC CAPITAL LETTER YI +260 176 b0 ° DEGREE SIGN +261 177 b1 ± PLUS-MINUS SIGN +262 178 b2 ² CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I +263 179 b3 ³ CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +264 180 b4 ´ CYRILLIC SMALL LETTER GHE WITH UPTURN +265 181 b5 µ MICRO SIGN +266 182 b6 ¶ PILCROW SIGN +267 183 b7 · MIDDLE DOT +270 184 b8 ¸ CYRILLIC SMALL LETTER IO +271 185 b9 ¹ NUMERO SIGN +272 186 ba º CYRILLIC SMALL LETTER UKRAINIAN IE +273 187 bb » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +274 188 bc ¼ CYRILLIC SMALL LETTER JE +275 189 bd ½ CYRILLIC CAPITAL LETTER DZE +276 190 be ¾ CYRILLIC SMALL LETTER DZE +277 191 bf ¿ CYRILLIC SMALL LETTER YI +300 192 c0 À CYRILLIC CAPITAL LETTER A +301 193 c1 Á CYRILLIC CAPITAL LETTER BE +302 194 c2  CYRILLIC CAPITAL LETTER VE +303 195 c3 à CYRILLIC CAPITAL LETTER GHE +304 196 c4 Ä CYRILLIC CAPITAL LETTER DE +305 197 c5 Å CYRILLIC CAPITAL LETTER IE +306 198 c6 Æ CYRILLIC CAPITAL LETTER ZHE +307 199 c7 v CYRILLIC CAPITAL LETTER ZE +310 200 c8 È CYRILLIC CAPITAL LETTER I +311 201 c9 É CYRILLIC CAPITAL LETTER SHORT I +312 202 ca Ê CYRILLIC CAPITAL LETTER KA +313 203 cb Ë CYRILLIC CAPITAL LETTER EL +314 204 cc Ì CYRILLIC CAPITAL LETTER EM +315 205 cd Í CYRILLIC CAPITAL LETTER EN +316 206 ce Î CYRILLIC CAPITAL LETTER O +317 207 cf Ï CYRILLIC CAPITAL LETTER PE +320 208 d0 Ð CYRILLIC CAPITAL LETTER ER +321 209 d1 Ñ CYRILLIC CAPITAL LETTER ES +322 210 d2 Ò CYRILLIC CAPITAL LETTER TE +323 211 d3 Ó CYRILLIC CAPITAL LETTER U +324 212 d4 Ô CYRILLIC CAPITAL LETTER EF +325 213 d5 Õ CYRILLIC CAPITAL LETTER HA +326 214 d6 Ö CYRILLIC CAPITAL LETTER TSE +327 215 d7 × CYRILLIC CAPITAL LETTER CHE +330 216 d8 Ø CYRILLIC CAPITAL LETTER SHA +331 217 d9 Ù CYRILLIC CAPITAL LETTER SHCHA +332 218 da Ú CYRILLIC CAPITAL LETTER HARD SIGN +333 219 db Û CYRILLIC CAPITAL LETTER YERU +334 219 dc Ü CYRILLIC CAPITAL LETTER SOFT SIGN +335 220 dd Ý CYRILLIC CAPITAL LETTER E +336 221 de Þ CYRILLIC CAPITAL LETTER YU +337 222 df ß CYRILLIC CAPITAL LETTER YA +340 223 e0 à CYRILLIC SMALL LETTER A +341 224 e1 á CYRILLIC SMALL LETTER BE +342 225 e2 â CYRILLIC SMALL LETTER VE +343 226 e3 ã CYRILLIC SMALL LETTER GHE +344 227 e4 ä CYRILLIC SMALL LETTER DE +345 228 e5 å CYRILLIC SMALL LETTER IE +346 229 e6 æ CYRILLIC SMALL LETTER ZHE +347 230 e7 ç CYRILLIC SMALL LETTER ZE +350 231 e8 è CYRILLIC SMALL LETTER I +351 232 e9 é CYRILLIC SMALL LETTER SHORT I +352 233 ea ê CYRILLIC SMALL LETTER KA +353 234 eb ë CYRILLIC SMALL LETTER EL +354 235 ec ì CYRILLIC SMALL LETTER EM +355 236 ed í CYRILLIC SMALL LETTER EN +356 237 ee î CYRILLIC SMALL LETTER O +357 238 ef ï CYRILLIC SMALL LETTER PE +360 239 f0 ð CYRILLIC SMALL LETTER ER +361 240 f1 ñ CYRILLIC SMALL LETTER ES +362 241 f2 ò CYRILLIC SMALL LETTER TE +363 242 f3 ó CYRILLIC SMALL LETTER U +364 243 f4 ô CYRILLIC SMALL LETTER EF +365 244 f5 õ CYRILLIC SMALL LETTER HA +366 245 f6 ö CYRILLIC SMALL LETTER TSE +367 246 f7 ÷ CYRILLIC SMALL LETTER CHE +370 247 f8 ø CYRILLIC SMALL LETTER SHA +371 248 f9 ù CYRILLIC SMALL LETTER SHCHA +372 249 fa ú CYRILLIC SMALL LETTER HARD SIGN +373 250 fb û CYRILLIC SMALL LETTER YERU +374 251 fc ü CYRILLIC SMALL LETTER SOFT SIGN +375 252 fd ý CYRILLIC SMALL LETTER E +376 253 fe þ CYRILLIC SMALL LETTER YU +377 254 ff ÿ CYRILLIC SMALL LETTER YA +.TE +.SH NOTES +CP\ 1251 is also known as Windows Cyrillic. +.SH "SEE ALSO" +.BR ascii (7) diff --git a/original/man7/cpuset.7 b/original/man7/cpuset.7 new file mode 100644 index 00000000..1430dd77 --- /dev/null +++ b/original/man7/cpuset.7 @@ -0,0 +1,1503 @@ +.\" 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. +.\" +.TH CPUSET 7 2008-11-12 "Linux" "Linux Programmer's Manual" +.SH NAME +cpuset \- confine processes to processor and memory node subsets +.SH DESCRIPTION +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 +.IR /dev/cpuset . +.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 +.B nodev cpuset +in the file +.IR /proc/filesystems . +By mounting the cpuset file system (see the +.B EXAMPLE +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 +.RI ( /dev/cpuset ) +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 +.BR fork (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 +.BR sched_setaffinity (2) +scheduling affinity mechanism and the +.BR mbind (2) +and +.BR set_mempolicy (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 +.I /dev/cpuset +represents a cpuset and contains a fixed set of pseudo-files +describing the state of that cpuset. +.PP +New cpusets are created using the +.BR mkdir (2) +system call or the +.BR mkdir (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 +.BR mkdir (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 +.BR rmdir (2) +or +.BR rmdir (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 +.BR cat (1), +and +.BR echo (1), +or from a program by using file I/O library functions or system calls, +such as +.BR open (2), +.BR read (2), +.BR write (2), +and +.BR close (2). +.PP +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. +.\" ====================== tasks ====================== +.TP +.I tasks +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 +.I tasks +file (with or without a trailing newline.) + +.B Warning: +only one PID may be written to the +.I tasks +file at a time. +If a string is written that contains more +than one PID, only the first one will be used. +.\" =================== notify_on_release =================== +.TP +.I notify_on_release +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\fR section, below. +.\" ====================== cpus ====================== +.TP +.I cpus +List of the physical numbers of the CPUs on which processes +in that cpuset are allowed to execute. +See \fBList Format\fR below for a description of the +format of +.IR cpus . + +The CPUs allowed to a cpuset may be changed by +writing a new list to its +.I cpus +file. +.\" ==================== cpu_exclusive ==================== +.TP +.I cpu_exclusive +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). + +Two cpusets are +.I sibling +cpusets if they share the same parent cpuset in the +.I /dev/cpuset +hierarchy. +Two cpusets are +.I cousin +cpusets if neither is the ancestor of the other. +Regardless of the +.I cpu_exclusive +setting, if one cpuset is the ancestor of another, +and if both of these cpusets have nonempty +.IR cpus , +then their +.I cpus +must overlap, because the +.I cpus +of any cpuset are always a subset of the +.I cpus +of its parent cpuset. +.\" ====================== mems ====================== +.TP +.I mems +List of memory nodes on which processes in this cpuset are +allowed to allocate memory. +See \fBList Format\fR below for a description of the +format of +.IR mems . +.\" ==================== mem_exclusive ==================== +.TP +.I mem_exclusive +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\fR cpuset (see below.) +By default this is off (0). +Newly created cpusets also initially default this to off (0). + +Regardless of the +.I mem_exclusive +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. +.\" ==================== mem_hardwall ==================== +.TP +.IR mem_hardwall " (since Linux 2.6.26)" +Flag (0 or 1). +If set (1), the cpuset is a \fBHardwall\fR cpuset (see below.) +Unlike \fBmem_exclusive\fR, +there is no constraint on whether cpusets +marked \fBmem_hardwall\fR 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). +.\" ==================== memory_migrate ==================== +.TP +.IR memory_migrate " (since Linux 2.6.16)" +Flag (0 or 1). +If set (1), then memory migration is enabled. +By default this is off (0). +See the \fBMemory Migration\fR section, below. +.\" ==================== memory_pressure ==================== +.TP +.IR memory_pressure " (since Linux 2.6.16)" +A measure of how much memory pressure the processes in this +cpuset are causing. +See the \fBMemory Pressure\fR section, below. +Unless +.I memory_pressure_enabled +is enabled, always has value zero (0). +This file is read-only. +See the +.B WARNINGS +section, below. +.\" ================= memory_pressure_enabled ================= +.TP +.IR memory_pressure_enabled " (since Linux 2.6.16)" +Flag (0 or 1). +This file is only present in the root cpuset, normally +.IR /dev/cpuset . +If set (1), the +.I memory_pressure +calculations are enabled for all cpusets in the system. +By default this is off (0). +See the +\fBMemory Pressure\fR section, below. +.\" ================== memory_spread_page ================== +.TP +.IR memory_spread_page " (since Linux 2.6.17)" +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\fR section, below. +.\" ================== memory_spread_slab ================== +.TP +.IR memory_spread_slab " (since Linux 2.6.17)" +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\fR section, below. +.\" ================== sched_load_balance ================== +.TP +.IR sched_load_balance " (since Linux 2.6.24)" +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, +.I unless +some other cpuset with overlapping CPUs has its +.I sched_load_balance +flag set. +See \fBScheduler Load Balancing\fR, below, for further details. +.\" ================== sched_relax_domain_level ================== +.TP +.IR sched_relax_domain_level " (since Linux 2.6.26)" +Integer, between \-1 and a small positive value. +The +.I sched_relax_domain_level +controls the width of the range of CPUs over which the kernel scheduler +performs immediate rebalancing of runnable tasks across CPUs. +If +.I sched_load_balance +is disabled, then the setting of +.I sched_relax_domain_level +does not matter, as no such load balancing is done. +If +.I sched_load_balance +is enabled, then the higher the value of the +.IR sched_relax_domain_level , +the wider +the range of CPUs over which immediate load balancing is attempted. +See \fBScheduler Relax Domain Level\fR, below, for further details. +.\" ================== proc cpuset ================== +.PP +In addition to the above pseudo-files in each directory below +.IR /dev/cpuset , +each process has a pseudo-file, +.IR /proc//cpuset , +that displays the path of the process's cpuset directory +relative to the root of the cpuset file system. +.\" ================== proc status ================== +.PP +Also the +.I /proc//status +file for each process has four added lines, +displaying the process's +.I Cpus_allowed +(on which CPUs it may be scheduled) and +.I Mems_allowed +(on which memory nodes it may obtain memory), +in the two formats \fBMask Format\fR and \fBList Format\fR (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 +The "allowed" fields were added in Linux 2.6.24; +the "allowed_list" fields were added in Linux 2.6.26. +.\" ================== EXTENDED CAPABILITIES ================== +.SH EXTENDED CAPABILITIES +In addition to controlling which +.I cpus +and +.I mems +a process is allowed to use, cpusets provide the following +extended capabilities. +.\" ================== Exclusive Cpusets ================== +.SS Exclusive Cpusets +If a cpuset is marked +.I cpu_exclusive +or +.IR mem_exclusive , +no other cpuset, other than a direct ancestor or descendant, +may share any of the same CPUs or memory nodes. +.PP +A cpuset that is +.I mem_exclusive +restricts kernel allocations for +buffer cache pages and other internal kernel data pages +commonly shared by the kernel across +multiple users. +All cpusets, whether +.I mem_exclusive +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 +.I mem_exclusive +cpuset to hold all the jobs, and construct child, +.RI non- mem_exclusive +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 +.I mem_exclusive +cpuset. +.\" ================== Hardwall ================== +.SS Hardwall +A cpuset that has +.I mem_exclusive +or +.I mem_hardwall +set is a +.I hardwall +cpuset. +A +.I hardwall +cpuset restricts kernel allocations for page, buffer, +and other data commonly shared by the kernel across multiple users. +All cpusets, whether +.I hardwall +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 +.I hardwall +cpuset to hold +all the jobs, and construct child cpusets for each individual +job which are not +.I hardwall +cpusets. +.PP +Only a small amount of kernel memory, such as requests from +interrupt handlers, is allowed to be taken outside even a +.I hardwall +cpuset. +.\" ================== Notify On Release ================== +.SS Notify On Release +If the +.I notify_on_release +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 +.IR /sbin/cpuset_release_agent , +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 +.I notify_on_release +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 +.I notify_on_release +setting. +.PP +The command +.I /sbin/cpuset_release_agent +is invoked, with the name +.RI ( /dev/cpuset +relative path) +of the to-be-released cpuset in +.IR argv[1] . +.PP +The usual contents of the command +.I /sbin/cpuset_release_agent +is simply the shell script: +.in +4n +.nf + +#!/bin/sh +rmdir /dev/cpuset/$1 +.fi +.in +.PP +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. +.\" ================== Memory Pressure ================== +.SS Memory Pressure +The +.I memory_pressure +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 +.IR /dev/cpuset/memory_pressure_enabled , +it is not computed for any cpuset, and reads from any +.I memory_pressure +always return zero, as represented by the ASCII string "0\en". +See the \fBWARNINGS\fR 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 \(em memory +pressure in a cpuset \(em with a single read, rather than having to +query and accumulate results over all the (dynamically changing) +set of processes in the cpuset. +.PP +The +.I memory_pressure +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 +The +.I memory_pressure +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. +.\" ================== Memory Spread ================== +.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 +.I memory_spread_page +and +.IR memory_spread_slab . +.PP +If the per-cpuset Boolean flag file +.I memory_spread_page +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 +.I memory_spread_slab +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 +.BR brk (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 +.BR mbind (2) +or +.BR set_mempolicy (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 +.I memory_spread_page +and +.I memory_spread_slab +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 +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. +.\" ================== Memory Migration ================== +.SS Memory Migration +Normally, under the default setting (disabled) of +.IR memory_migrate , +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 +.I mems +subsequently changes. +.PP +When memory migration is enabled in a cpuset, if the +.I mems +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 +.I memory_migrate +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 +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. +.\" ================== Scheduler Load Balancing ================== +.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 +.BR sched_setaffinity (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 +.I sched_load_balance +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\fR, 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 +.I sched_load_balance +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 +.BR sched_setaffinity (2)) +from any CPU in that cpuset to any other. +.PP +When the per-cpuset flag +.I sched_load_balance +is disabled, then the +scheduler will avoid load balancing across the CPUs in that cpuset, +\fIexcept\fR in so far as is necessary because some overlapping cpuset +has +.I sched_load_balance +enabled. +.PP +So, for example, if the top cpuset has the flag +.I sched_load_balance +enabled, then the scheduler will load balance across all +CPUs, and the setting of the +.I sched_load_balance +flag in other cpusets has no effect, +as we're already fully load balancing. +.PP +Therefore in the above two situations, the flag +.I sched_load_balance +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 +Of course, processes pinned to a particular CPU can be left in a cpuset +that disables +.I sched_load_balance +as those processes aren't going anywhere else anyway. +.\" ================== Scheduler Relax Domain Level ================== +.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 +.IR time (7). +The setting of +.I sched_relax_domain_level +only applies to immediate load balancing. +Regardless of the +.I sched_relax_domain_level +setting, periodic load balancing is attempted over all CPUs +(unless disabled by turning off +.IR sched_load_balance .) +In any case, of course, tasks will only be scheduled to run on +CPUs allowed by their cpuset, as modified by +.BR sched_setaffinity (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 +.I sched_relax_domain_level +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 +.I sched_relax_domain_level +have the following meanings. +.sp +.PD 0 +.IP \fB(1)\fR 4 +Perform immediate load balancing across Hyper-Thread +siblings on the same core. +.IP \fB(2)\fR +Perform immediate load balancing across other cores in the same package. +.IP \fB(3)\fR +Perform immediate load balancing across other CPUs +on the same node or blade. +.IP \fB(4)\fR +Perform immediate load balancing across over several +(implementation detail) nodes [On NUMA systems]. +.IP \fB(5)\fR +Perform immediate load balancing across over all CPUs +in system [On NUMA systems]. +.PD +.PP +The +.I sched_relax_domain_level +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 +.I sched_relax_domain_level +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 +.I sched_relax_domain_level +values, then the highest such value +applies to all CPUs in any of the overlapping cpusets. +In such cases, +the value \fBminus one (\-1)\fR is the lowest value, overridden by any +other value, and the value \fBzero (0)\fR is the next lowest value. +.SH FORMATS +The following formats are used to represent sets of +CPUs and memory nodes. +.\" ================== Mask Format ================== +.SS Mask Format +The \fBMask Format\fR is used to represent CPU and memory-node bitmasks +in the +.I /proc//status +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\fR: +.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 +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. +.\" ================== List Format ================== +.SS List Format +The \fBList Format\fR for +.I cpus +and +.I mems +is a comma-separated list of CPU or memory-node +numbers and ranges of numbers, in ASCII decimal. +.PP +Examples of the \fBList Format\fR: +.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 +.IR cpu_exclusive +if its parent is. +.IP * +It can only be marked +.IR mem_exclusive +if its parent is. +.IP * +If it is +.IR cpu_exclusive , +its CPUs may not overlap any sibling. +.IP * +If it is +.IR memory_exclusive , +its memory nodes may not overlap any sibling. +.\" ================== PERMISSIONS ================== +.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 +.IR /dev/cpuset . +.PP +For instance, a process can put itself in some other cpuset (than +its current one) if it can write the +.I tasks +file for that cpuset. +This requires execute permission on the encompassing directories +and write permission on the +.I tasks +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 +.BR kill (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 +.I cpus +or +.I mems +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 +.B cd +or +.BR chdir (2) +to its cpuset directory beneath +.IR /dev/cpuset , +which is a bit unusual) +or if some user code converts the relative cpuset path to a +full file-system path. +.PP +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, +.IR /dev/cpuset ). +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 +.IR /dev/cpuset . +Furthermore, it is common practice for carefully written +user code to verify the presence of the pseudo-file +.I /dev/cpuset/tasks +in order to verify that the cpuset pseudo-file system +is currently mounted. +.\" ================== WARNINGS ================== +.SH WARNINGS +.SS Enabling memory_pressure +By default, the per-cpuset file +.I memory_pressure +always contains zero (0). +Unless this feature is enabled by writing "1" to the pseudo-file +.IR /dev/cpuset/memory_pressure_enabled , +the kernel does +not compute per-cpuset +.IR memory_pressure . +.SS Using the echo command +When using the +.B echo +command at the shell prompt to change the values of cpuset files, +beware that the built-in +.B echo +command in some shells does not display an error message if the +.BR write (2) +system call fails. +.\" Gack! csh(1)'s echo does this +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 +.B echo +command might not display any error. +It is better to use the +.B /bin/echo +external command to change cpuset file settings, as this +command will display +.BR write (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 +.I cpus_allowed +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 +You can use the +.BR rename (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. +.\" ================== ERRORS ================== +.SH ERRORS +The Linux kernel implementation of cpusets sets +.I errno +to specify the reason for a failed system call affecting cpusets. +.PP +The possible +.I errno +settings and their meaning when set on +a failed cpuset call are as listed below. +.TP +.B E2BIG +Attempted a +.BR write (2) +on a special cpuset file +with a length larger than some kernel-determined upper +limit on the length of such writes. +.TP +.B EACCES +Attempted to +.BR write (2) +the process ID (PID) of a process to a cpuset +.I tasks +file when one lacks permission to move that process. +.TP +.B EACCES +Attempted to add, using +.BR write (2), +a CPU or memory node to a cpuset, when that CPU or memory node was +not already in its parent. +.TP +.B EACCES +Attempted to set, using +.BR write (2), +.I cpu_exclusive +or +.I mem_exclusive +on a cpuset whose parent lacks the same setting. +.TP +.B EACCES +Attempted to +.BR write (2) +a +.I memory_pressure +file. +.TP +.B EACCES +Attempted to create a file in a cpuset directory. +.TP +.B EBUSY +Attempted to remove, using +.BR rmdir (2), +a cpuset with attached processes. +.TP +.B EBUSY +Attempted to remove, using +.BR rmdir (2), +a cpuset with child cpusets. +.TP +.B EBUSY +Attempted to remove +a CPU or memory node from a cpuset +that is also in a child of that cpuset. +.TP +.B EEXIST +Attempted to create, using +.BR mkdir (2), +a cpuset that already exists. +.TP +.B EEXIST +Attempted to +.BR rename (2) +a cpuset to a name that already exists. +.TP +.B EFAULT +Attempted to +.BR read (2) +or +.BR write (2) +a cpuset file using +a buffer that is outside the writing processes accessible address space. +.TP +.B EINVAL +Attempted to change a cpuset, using +.BR write (2), +in a way that would violate a +.I cpu_exclusive +or +.I mem_exclusive +attribute of that cpuset or any of its siblings. +.TP +.B EINVAL +Attempted to +.BR write (2) +an empty +.I cpus +or +.I mems +list to a cpuset which has attached processes or child cpusets. +.TP +.B EINVAL +Attempted to +.BR write (2) +a +.I cpus +or +.I mems +list which included a range with the second number smaller than +the first number. +.TP +.B EINVAL +Attempted to +.BR write (2) +a +.I cpus +or +.I mems +list which included an invalid character in the string. +.TP +.B EINVAL +Attempted to +.BR write (2) +a list to a +.I cpus +file that did not include any online CPUs. +.TP +.B EINVAL +Attempted to +.BR write (2) +a list to a +.I mems +file that did not include any online memory nodes. +.TP +.B EINVAL +Attempted to +.BR write (2) +a list to a +.I mems +file that included a node that held no memory. +.TP +.B EIO +Attempted to +.BR write (2) +a string to a cpuset +.I tasks +file that +does not begin with an ASCII decimal integer. +.TP +.B EIO +Attempted to +.BR rename (2) +a cpuset into a different directory. +.TP +.B ENAMETOOLONG +Attempted to +.BR read (2) +a +.I /proc//cpuset +file for a cpuset path that is longer than the kernel page size. +.TP +.B ENAMETOOLONG +Attempted to create, using +.BR mkdir (2), +a cpuset whose base directory name is longer than 255 characters. +.TP +.B ENAMETOOLONG +Attempted to create, using +.BR mkdir (2), +a cpuset whose full pathname, +including the mount point (typically "/dev/cpuset/") prefix, +is longer than 4095 characters. +.TP +.B ENODEV +The cpuset was removed by another process at the same time as a +.BR write (2) +was attempted on one of the pseudo-files in the cpuset directory. +.TP +.B ENOENT +Attempted to create, using +.BR mkdir (2), +a cpuset in a parent cpuset that doesn't exist. +.TP +.B ENOENT +Attempted to +.BR access (2) +or +.BR open (2) +a nonexistent file in a cpuset directory. +.TP +.B ENOMEM +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 +.B ENOSPC +Attempted to +.BR write (2) +the process ID (PID) +of a process to a cpuset +.I tasks +file when the cpuset had an empty +.I cpus +or empty +.I mems +setting. +.TP +.B ENOSPC +Attempted to +.BR write (2) +an empty +.I cpus +or +.I mems +setting to a cpuset that +has tasks attached. +.TP +.B ENOTDIR +Attempted to +.BR rename (2) +a nonexistent cpuset. +.TP +.B EPERM +Attempted to remove a file from a cpuset directory. +.TP +.B ERANGE +Specified a +.I cpus +or +.I mems +list to the kernel which included a number too large for the kernel +to set in its bitmasks. +.TP +.B ESRCH +Attempted to +.BR write (2) +the process ID (PID) of a nonexistent process to a cpuset +.I tasks +file. +.\" ================== VERSIONS ================== +.SH VERSIONS +Cpusets appeared in version 2.6.12 of the Linux kernel. +.\" ================== NOTES ================== +.SH NOTES +Despite its name, the +.I pid +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 +.BR gettid (2) +can be passed in the argument +.IR pid . +.\" ================== BUGS ================== +.SH BUGS +.I memory_pressure +cpuset files can be opened +for writing, creation, or truncation, but then the +.BR write (2) +fails with +.I errno +set to +.BR EACCES , +and the creation and truncation options on +.BR open (2) +have no effect. +.\" ================== EXAMPLE ================== +.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 +.BR mkdir (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 + +.RB "$" " mkdir /dev/cpuset" +.RB "$" " mount \-t cpuset cpuset /dev/cpuset" +.RB "$" " cd /dev/cpuset" +.RB "$" " mkdir Charlie" +.RB "$" " cd Charlie" +.RB "$" " /bin/echo 2-3 > cpus" +.RB "$" " /bin/echo 1 > mems" +.RB "$" " /bin/echo $$ > tasks" +# The current shell is now running in cpuset Charlie +# The next line should display '/Charlie' +.RB "$" " cat /proc/self/cpuset" +.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 +.I alpha +(CPUs 4-7 and memory nodes 2-3) to a new cpuset +.I beta +(CPUs 16-19 and memory nodes 8-9). +.IP 2) +First create the new cpuset +.IR beta . +.IP 3) +Then allow CPUs 16-19 and memory nodes 8-9 in +.IR beta . +.IP 4) +Then enable +.I memory_migration +in +.IR beta . +.IP 5) +Then move each process from +.I alpha +to +.IR beta . +.PD +.PP +The following sequence of commands accomplishes this. +.in +4n +.nf + +.RB "$" " cd /dev/cpuset" +.RB "$" " mkdir beta" +.RB "$" " cd beta" +.RB "$" " /bin/echo 16-19 > cpus" +.RB "$" " /bin/echo 8-9 > mems" +.RB "$" " /bin/echo 1 > memory_migrate" +.RB "$" " while read i; do /bin/echo $i; done < ../alpha/tasks > tasks" +.fi +.in +.PP +The above should move any processes in +.I alpha +to +.IR beta , +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 + +.RB "$" " cp ../alpha/tasks tasks" +.fi +.in +.PP +The +.I while +loop, rather than the seemingly easier use of the +.BR cp (1) +command, was necessary because +only one process PID at a time may be written to the +.I tasks +file. +.PP +The same effect (writing one PID at a time) as the +.I while +loop can be accomplished more efficiently, in fewer keystrokes and in +syntax that works on any shell, but alas more obscurely, by using the +.B \-u +(unbuffered) option of +.BR sed (1): +.in +4n + +.nf +.RB "$" " sed \-un p < ../alpha/tasks > tasks" +.fi +.in +.\" ================== SEE ALSO ================== +.SH SEE ALSO +.BR taskset (1), +.BR get_mempolicy (2), +.BR getcpu (2), +.BR mbind (2), +.BR sched_getaffinity (2), +.BR sched_setaffinity (2), +.BR sched_setscheduler (2), +.BR set_mempolicy (2), +.BR CPU_SET (3), +.BR proc (5), +.BR numa (7), +.BR migratepages (8), +.BR numactl (8) +.PP +The kernel source file +.IR Documentation/cpusets.txt . diff --git a/original/man7/credentials.7 b/original/man7/credentials.7 new file mode 100644 index 00000000..25bd94f0 --- /dev/null +++ b/original/man7/credentials.7 @@ -0,0 +1,280 @@ +.\" Copyright (c) 2007 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. +.\" +.\" 2007-06-13 Creation +.\" +.TH CREDENTIALS 7 2008-06-03 "Linux" "Linux Programmer's Manual" +.SH NAME +credentials \- process identifiers +.SH DESCRIPTION +.SS Process ID (PID) +Each process has a unique nonnegative integer identifier +that is assigned when the process is created using +.BR fork (2). +A process can obtain its PID using +.BR getpid (2). +A PID is represented using the type +.I pid_t +(defined in +.IR ). + +PIDs are used in a range of system calls to identify the process +affected by the call, for example: +.BR kill (2), +.BR ptrace (2), +.BR setpriority (2) +.\" .BR sched_rr_get_interval (2), +.\" .BR sched_getaffinity (2), +.\" .BR sched_setaffinity (2), +.\" .BR sched_getparam (2), +.\" .BR sched_setparam (2), +.\" .BR sched_setscheduler (2), +.\" .BR sched_getscheduler (2), +.BR setpgid (2), +.\" .BR getsid (2), +.BR setsid (2), +.BR sigqueue (2), +and +.BR waitpid (2). +.\" .BR waitid (2), +.\" .BR wait4 (2), + +A process's PID is preserved across an +.BR execve (2). +.SS Parent Process ID (PPID) +A process's parent process ID identifies the process that created +this process using +.BR fork (2). +A process can obtain its PPID using +.BR getppid (2). +A PPID is represented using the type +.IR pid_t . + +A process's PPID is preserved across an +.BR execve (2). +.SS Process Group ID and Session ID +Each process has a session ID and a process group ID, +both represented using the type +.IR pid_t . +A process can obtain its session ID using +.BR getsid (2), +and its process group ID using +.BR getpgrp (2). + +A child created by +.BR fork (2) +inherits its parent's session ID and process group ID. +A process's session ID and process group ID are preserved across an +.BR execve (2). + +Sessions and process groups are abstractions devised to support shell +job control. +A process group (sometimes called a "job") is a collection of +processes that share the same process group ID; +the shell creates a new process group for the process(es) used +to execute single command or pipeline (e.g., the two processes +created to execute the command "ls\ |\ wc" are placed in the +same process group). +A process's group membership can be set using +.BR setpgid (2). +The process whose process ID is the same as its process group ID is the +\fIprocess group leader\fP for that group. + +A session is a collection of processes that share the same session ID. +All of the members of a process group also have the same session ID +(i.e., all of the members of a process group always belong to the +same session, so that sessions and process groups form a strict +two-level hierarchy of processes.) +A new session is created when a process calls +.BR setsid (2), +which creates a new session whose session ID is the same +as the PID of the process that called +.BR setsid (2). +The creator of the session is called the \fIsession leader\fP. +.SS User and Group Identifiers +Each process has various associated user and groups IDs. +These IDs are integers, respectively represented using the types +.I uid_t +and +.I gid_t +(defined in +.IR ). + +On Linux, each process has the following user and group identifiers: +.IP * 3 +Real user ID and real group ID. +These IDs determine who owns the process. +A process can obtain its real user (group) ID using +.BR getuid (2) +.RB ( getgid (2)). +.IP * +Effective user ID and effective group ID. +These IDs are used by the kernel to determine the permissions +that the process will have when accessing shared resources such +as message queues, shared memory, and semaphores. +On most Unix systems, these IDs also determine the +permissions when accessing files. +However, Linux uses the file system IDs described below +for this task. +A process can obtain its effective user (group) ID using +.BR geteuid (2) +.RB ( getegid (2)). +.IP * +Saved set-user-ID and saved set-group-ID. +These IDs are used in set-user-ID and set-group-ID programs to save +a copy of the corresponding effective IDs that were set when +the program was executed (see +.BR execve (2)). +A set-user-ID program can assume and drop privileges by +switching its effective user ID back and forth between the values +in its real user ID and saved set-user-ID. +This switching is done via calls to +.BR seteuid (2), +.BR setreuid (2), +or +.BR setresuid (2). +A set-group-ID program performs the analogous tasks using +.BR setegid (2), +.BR setregid (2), +or +.BR setresgid (2). +A process can obtain its saved set-user-ID (set-group-ID) using +.BR getresuid (2) +.RB ( getresgid (2)). +.IP * +File system user ID and file system group ID (Linux-specific). +These IDs, in conjunction with the supplementary group IDs described +below, are used to determine permissions for accessing files; see +.BR path_resolution (7) +for details. +Whenever a process's effective user (group) ID is changed, +the kernel also automatically changes the file system user (group) ID +to the same value. +Consequently, the file system IDs normally have the same values +as the corresponding effective ID, and the semantics for file-permission +checks are thus the same on Linux as on other Unix systems. +The file system IDs can be made to differ from the effective IDs +by calling +.BR setfsuid (2) +and +.BR setfsgid (2). +.IP * +Supplementary group IDs. +This is a set of additional group IDs that are used for permission +checks when accessing files and other shared resources. +On Linux kernels before 2.6.4, +a process can be a member of up to 32 supplementary groups; +since kernel 2.6.4, +a process can be a member of up to 65536 supplementary groups. +The call +.I sysconf(_SC_NGROUPS_MAX) +can be used to determine the number of supplementary groups +of which a process may be a member. +.\" Since kernel 2.6.4, the limit is visible via the read-only file +.\" /proc/sys/kernel/ngroups_max. +.\" As at 2.6.22-rc2, this file is still read-only. +A process can obtain its set of supplementary group IDs using +.BR getgroups (2), +and can modify the set using +.BR setgroups (2). +.PP +A child process created by +.BR fork (2) +inherits copies of its parent's user and groups IDs. +During an +.BR execve (2), +a process's real user and group ID and supplementary +group IDs are preserved; +the effective and saved set IDs may be changed, as described in +.BR execve (2). + +Aside from the purposes noted above, +a process's user IDs are also employed in a number of other contexts: +.IP * 3 +when determining the permissions for sending signals \(em see +.BR kill (2); +.IP * +when determining the permissions for setting +process-scheduling parameters (nice value, real time +scheduling policy and priority, CPU affinity, I/O priority) using +.BR setpriority (2), +.BR sched_setaffinity (2), +.BR sched_setscheduler (2), +.BR sched_setparam (2), +and +.BR ioprio_set (2); +.IP * +when checking resource limits; see +.BR getrlimit (2); +.IP * +when checking the limit on the number of inotify instances +that the process may create; see +.BR inotify (7). +.SH "CONFORMING TO" +Process IDs, parent process IDs, process group IDs, and session IDs +are specified in POSIX.1-2001. +The real, effective, and saved set user and groups IDs, +and the supplementary group IDs, are specified in POSIX.1-2001. +The file system user and group IDs are a Linux extension. +.SH NOTES +The POSIX threads specification requires that +credentials are shared by all of the threads in a process. +However, at the kernel level, Linux maintains separate user and group +credentials for each thread. +The NPTL threading implementation does some work to ensure +that any change to user or group credentials +(e.g., calls to +.BR setuid (2), +.BR setresuid (2), +etc.) +is carried through to all of the POSIX threads in a process. +.SH "SEE ALSO" +.BR bash (1), +.BR csh (1), +.BR ps (1), +.BR access (2), +.BR execve (2), +.BR faccessat (2), +.BR fork (2), +.BR getpgrp (2), +.BR getpid (2), +.BR getppid (2), +.BR getsid (2), +.BR kill (2), +.BR killpg (2), +.BR setegid (2), +.BR seteuid (2), +.BR setfsgid (2), +.BR setfsuid (2), +.BR setgid (2), +.BR setgroups (2), +.BR setresgid (2), +.BR setresuid (2), +.BR setuid (2), +.BR waitpid (2), +.BR euidaccess (3), +.BR initgroups (3), +.BR tcgetpgrp (3), +.BR tcsetpgrp (3), +.BR capabilities (7), +.BR path_resolution (7), +.BR unix (7) diff --git a/original/man7/ddp.7 b/original/man7/ddp.7 new file mode 100644 index 00000000..3d97ef1e --- /dev/null +++ b/original/man7/ddp.7 @@ -0,0 +1,248 @@ +.\" This man page is Copyright (C) 1998 Alan Cox. +.\" 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. +.\" $Id: ddp.7,v 1.3 1999/05/13 11:33:22 freitag Exp $ +.TH DDP 7 2008-11-20 "Linux" "Linux Programmer's Manual" +.SH NAME +ddp \- Linux AppleTalk protocol implementation +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.IB ddp_socket " = socket(AF_APPLETALK, SOCK_DGRAM, 0);" +.br +.IB raw_socket " = socket(AF_APPLETALK, SOCK_RAW, " protocol ");" +.SH DESCRIPTION +Linux implements the Appletalk protocols described in +.IR "Inside Appletalk" . +Only the DDP layer and AARP are present in +the kernel. +They are designed to be used via the +.B netatalk +protocol +libraries. +This page documents the interface for those who wish or need to +use the DDP layer directly. +.PP +The communication between Appletalk and the user program works using a +BSD-compatible socket interface. +For more information on sockets, see +.BR socket (7). +.PP +An AppleTalk socket is created by calling the +.BR socket (2) +function with a +.B AF_APPLETALK +socket family argument. +Valid socket types are +.B SOCK_DGRAM +to open a +.B ddp +socket or +.B SOCK_RAW +to open a +.B raw +socket. +.I protocol +is the Appletalk protocol to be received or sent. +For +.B SOCK_RAW +you must specify +.BR ATPROTO_DDP . +.PP +Raw sockets may be only opened by a process with effective user ID 0 +or when the process has the +.B CAP_NET_RAW +capability. +.SS "Address Format" +An Appletalk socket address is defined as a combination of a network number, +a node number, and a port number. +.PP +.in +4n +.nf +struct at_addr { + unsigned short s_net; + unsigned char s_node; +}; + +struct sockaddr_atalk { + sa_family_t sat_family; /* address family */ + unsigned char sat_port; /* port */ + struct at_addr sat_addr; /* net/node */ +}; +.fi +.in +.PP +.I sat_family +is always set to +.BR AF_APPLETALK . +.I sat_port +contains the port. +The port numbers below 129 are known as +.IR "reserved ports" . +Only processes with the effective user ID 0 or the +.B CAP_NET_BIND_SERVICE +capability may +.BR bind (2) +to these sockets. +.I sat_addr +is the host address. +The +.I net +member of +.I struct at_addr +contains the host network in network byte order. +The value of +.B AT_ANYNET +is a +wildcard and also implies \(lqthis network.\(rq +The +.I node +member of +.I struct at_addr +contains the host node number. +The value of +.B AT_ANYNODE +is a +wildcard and also implies \(lqthis node.\(rq The value of +.B ATADDR_BCAST +is a link +local broadcast address. +.\" FIXME this doesn't make sense [johnl] +.SS "Socket Options" +No protocol-specific socket options are supported. +.SS /proc interfaces +IP supports a set of +.I /proc +interfaces to configure some global AppleTalk parameters. +The parameters can be accessed by reading or writing files in the directory +.IR /proc/sys/net/atalk/ . +.TP +.I aarp-expiry-time +The time interval (in seconds) before an AARP cache entry expires. +.TP +.I aarp-resolve-time +The time interval (in seconds) before an AARP cache entry is resolved. +.TP +.I aarp-retransmit-limit +The number of retransmissions of an AARP query before the node is declared +dead. +.TP +.I aarp-tick-time +The timer rate (in seconds) for the timer driving AARP. +.PP +The default values match the specification and should never need to be +changed. +.SS Ioctls +All ioctls described in +.BR socket (7) +apply to DDP. +.\" FIXME Add a section about multicasting +.SH ERRORS +.\" FIXME document all errors. We should really fix the kernels to +.\" give more uniform error returns (ENOMEM vs ENOBUFS, EPERM vs +.\" EACCES etc.) +.TP +.B EACCES +The user tried to execute an operation without the necessary permissions. +These include sending to a broadcast address without +having the broadcast flag set, +and trying to bind to a reserved port without effective user ID 0 or +.BR CAP_NET_BIND_SERVICE . +.TP +.B EADDRINUSE +Tried to bind to an address already in use. +.TP +.B EADDRNOTAVAIL +A nonexistent interface was requested or the requested source address was +not local. +.TP +.B EAGAIN +Operation on a nonblocking socket would block. +.TP +.B EALREADY +A connection operation on a nonblocking socket is already in progress. +.TP +.B ECONNABORTED +A connection was closed during an +.BR accept (2). +.TP +.B EHOSTUNREACH +No routing table entry matches the destination address. +.TP +.B EINVAL +Invalid argument passed. +.TP +.B EISCONN +.BR connect (2) +was called on an already connected socket. +.TP +.B EMSGSIZE +Datagram is bigger than the DDP MTU. +.TP +.B ENODEV +Network device not available or not capable of sending IP. +.TP +.B ENOENT +.B SIOCGSTAMP +was called on a socket where no packet arrived. +.TP +.BR ENOMEM " and " ENOBUFS +Not enough memory available. +.TP +.B ENOPKG +A kernel subsystem was not configured. +.TP +.BR ENOPROTOOPT " and " EOPNOTSUPP +Invalid socket option passed. +.TP +.B ENOTCONN +The operation is only defined on a connected socket, but the socket wasn't +connected. +.TP +.B EPERM +User doesn't have permission to set high priority, +make a configuration change, +or send signals to the requested process or group, +.TP +.B EPIPE +The connection was unexpectedly closed or shut down by the other end. +.TP +.B ESOCKTNOSUPPORT +The socket was unconfigured, or an unknown socket type was requested. +.SH VERSIONS +Appletalk is supported by Linux 2.0 or higher. +The +.I /proc +interfaces exist since Linux 2.2. +.SH NOTES +Be very careful with the +.B SO_BROADCAST +option \- it is not privileged in Linux. +It is easy to overload the network +with careless sending to broadcast addresses. +.SS Compatibility +The basic AppleTalk socket interface is compatible with +.B netatalk +on BSD-derived systems. +Many BSD systems fail to check +.B SO_BROADCAST +when sending broadcast frames; this can lead to compatibility problems. +.PP +The +raw +socket mode is unique to Linux and exists to support the alternative CAP +package and AppleTalk monitoring tools more easily. +.SH BUGS +There are too many inconsistent error values. +.PP +The ioctls used to configure routing tables, devices, +AARP tables and other devices are not yet described. +.SH "SEE ALSO" +.BR recvmsg (2), +.BR sendmsg (2), +.BR capabilities (7), +.BR socket (7) diff --git a/original/man7/environ.7 b/original/man7/environ.7 new file mode 100644 index 00000000..2ffb12a2 --- /dev/null +++ b/original/man7/environ.7 @@ -0,0 +1,240 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" and Andries Brouwer (aeb@cwi.nl), Fri Feb 14 21:47:50 1997. +.\" +.\" 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 Sun Jul 25 10:45:30 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Jul 21 21:25:26 1996 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Mon Oct 21 17:47:19 1996 by Eric S. Raymond (esr@thyrsus.com) +.\" Modified Wed Aug 27 20:28:58 1997 by Nicolás Lichtmaier (nick@debian.org) +.\" Modified Mon Sep 21 00:00:26 1998 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Wed Jan 24 06:37:24 2001 by Eric S. Raymond (esr@thyrsus.com) +.\" Modified Thu Dec 13 23:53:27 2001 by Martin Schulze +.\" +.TH ENVIRON 7 2009-07-25 "Linux" "Linux Programmer's Manual" +.SH NAME +environ \- user environment +.SH SYNOPSIS +.nf +.BI "extern char **" environ ; +.br +.fi +.SH DESCRIPTION +The variable +.I environ +points to an array of pointers to strings called the "environment". +The last pointer in this array has the value NULL. +(This variable must be declared in the user program, +but is declared in the header file +.I +in case the header files came from libc4 or libc5, and +in case they came from glibc and +.B _GNU_SOURCE +was defined.) +This array of strings is made available to the process by the +.BR exec (3) +call that started the process. + +By convention the strings in +.I environ +have the form "\fIname\fP\fB=\fP\fIvalue\fP". +Common examples are: +.TP +.B USER +The name of the logged-in user (used by some BSD-derived programs). +.TP +.B LOGNAME +The name of the logged-in user (used by some System-V derived programs). +.TP +.B HOME +A user's login directory, set by +.BR login (1) +from the password file +.BR passwd (5). +.TP +.B LANG +The name of a locale to use for locale categories when not overridden +by \fBLC_ALL\fP or more specific environment variables like +\fBLC_COLLATE\fP, \fBLC_CTYPE\fP, \fBLC_MESSAGES\fP, \fBLC_MONETARY\fP, +\fBLC_NUMERIC\fP, \fBLC_TIME\fP, cf. +.BR locale (5). +.TP +.B PATH +The sequence of directory prefixes that +.BR sh (1) +and many other +programs apply in searching for a file known by an incomplete pathname. +The prefixes are separated by \(aq\fB:\fP\(aq. +(Similarly one has \fBCDPATH\fP used by some shells to find the target +of a change directory command, \fBMANPATH\fP used by +.BR man (1) +to +find manual pages, etc.) +.TP +.B PWD +The current working directory. +Set by some shells. +.TP +.B SHELL +The pathname of the user's login shell. +.TP +.B TERM +The terminal type for which output is to be prepared. +.TP +.B PAGER +The user's preferred utility to display text files. +.TP +.BR EDITOR / VISUAL +The user's preferred utility to edit text files. +.\" .TP +.\" .B BROWSER +.\" The user's preferred utility to browse URLs. Sequence of colon-separated +.\" browser commands. See http://www.catb.org/~esr/BROWSER/ . +.PP +Further names may be placed in the environment by the \fIexport\fP +command and "name=value" in +.BR sh (1), +or by the \fIsetenv\fP command if you use +.BR csh (1). +Arguments may also be placed in the +environment at the point of an +.BR exec (3). +A C program can manipulate its environment using the functions +.BR getenv (3), +.BR putenv (3), +.BR setenv (3), +and +.BR unsetenv (3). + +Note that the behavior of many programs and library routines is +influenced by the presence or value of certain environment variables. +A random collection: +.LP +The variables +.BR LANG ", " LANGUAGE ", " NLSPATH ", " LOCPATH ", " +.BR LC_ALL ", " LC_MESSAGES ", " +etc. influence locale handling, cf. +.BR locale (5). +.LP +.B TMPDIR +influences the path prefix of names created by +.BR tmpnam (3) +and other routines, the temporary directory used by +.BR sort (1) +and other programs, etc. +.LP +.BR LD_LIBRARY_PATH ", " LD_PRELOAD +and other LD_* variables influence +the behavior of the dynamic loader/linker. +.LP +.B POSIXLY_CORRECT +makes certain programs and library routines follow +the prescriptions of POSIX. +.LP +The behavior of +.BR malloc (3) +is influenced by +.B MALLOC_* +variables. +.LP +The variable +.B HOSTALIASES +gives the name of a file containing aliases +to be used with +.BR gethostbyname (3). +.LP +.BR TZ " and " TZDIR +give timezone information used by +.BR tzset (3) +and through that by functions like +.BR ctime (3), +.BR localtime (3), +.BR mktime (3), +.BR strftime (3). +See also +.BR tzselect (8). +.LP +.B TERMCAP +gives information on how to address a given terminal +(or gives the name of a file containing such information). +.LP +.BR COLUMNS " and " LINES +tell applications about the window size, possibly overriding the actual size. +.LP +.BR PRINTER " or " LPDEST +may specify the desired printer to use. +See +.BR lpr (1). +.LP +Etc. +.SH BUGS +Clearly there is a security risk here. +Many a system command has been +tricked into mischief by a user who specified unusual values for +.BR IFS " or " LD_LIBRARY_PATH . + +There is also the risk of name space pollution. +Programs like +.I make +and +.I autoconf +allow overriding of default utility names from the +environment with similarly named variables in all caps. +Thus one uses +.B CC +to select the desired C compiler (and similarly +.BR MAKE , +.BR AR , +.BR AS , +.BR FC , +.BR LD , +.BR LEX , +.BR RM , +.BR YACC , +etc.). +However, in some traditional uses such an environment variable +gives options for the program instead of a pathname. +Thus, one has +.BR MORE , +.BR LESS , +and +.BR GZIP . +Such usage is considered mistaken, and to be avoided in new +programs. +The authors of +.I gzip +should consider renaming their option to +.BR GZIP_OPT . +.SH "SEE ALSO" +.BR bash (1), +.BR csh (1), +.BR login (1), +.BR sh (1), +.BR tcsh (1), +.BR execve (2), +.BR clearenv (3), +.BR exec (3), +.BR getenv (3), +.BR putenv (3), +.BR setenv (3), +.BR unsetenv (3), +.BR locale (5) diff --git a/original/man7/epoll.7 b/original/man7/epoll.7 new file mode 100644 index 00000000..7038ff2c --- /dev/null +++ b/original/man7/epoll.7 @@ -0,0 +1,546 @@ +.\" +.\" 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 +.\" +.TH EPOLL 7 2009-02-01 "Linux" "Linux Programmer's Manual" +.SH NAME +epoll \- I/O event notification facility +.SH SYNOPSIS +.B #include +.SH DESCRIPTION +.B epoll +is a variant of +.BR poll (2) +that can be used either as an edge-triggered or a level-triggered +interface and scales well to large numbers of watched file descriptors. +The following system calls are provided to +create and manage an +.B epoll +instance: +.IP * 3 +An +.B epoll +instance created by +.BR epoll_create (2), +which returns a file descriptor referring to the epoll instance. +(The more recent +.BR epoll_create1 (2) +extends the functionality of +.BR epoll_create (2).) +.IP * +Interest in particular file descriptors is then registered via +.BR epoll_ctl (2). +The set of file descriptors currently registered on an +.B epoll +instance is sometimes called an +.I epoll +set. +.IP * +Finally, the actual wait is started by +.BR epoll_wait (2). +.SS Level-Triggered and Edge-Triggered +The +.B epoll +event distribution interface is able to behave both as edge-triggered +(ET) and as level-triggered (LT). +The difference between the two mechanisms +can be described as follows. +Suppose that +this scenario happens: +.IP 1. 3 +The file descriptor that represents the read side of a pipe +.RI ( rfd ) +is registered on the +.B epoll +instance. +.IP 2. +A pipe writer writes 2 kB of data on the write side of the pipe. +.IP 3. +A call to +.BR epoll_wait (2) +is done that will return +.I rfd +as a ready file descriptor. +.IP 4. +The pipe reader reads 1 kB of data from +.IR rfd . +.IP 5. +A call to +.BR epoll_wait (2) +is done. +.PP +If the +.I rfd +file descriptor has been added to the +.B epoll +interface using the +.B EPOLLET +(edge-triggered) +flag, the call to +.BR epoll_wait (2) +done in step +.B 5 +will probably hang despite the available data still present in the file +input buffer; +meanwhile the remote peer might be expecting a response based on the +data it already sent. +The reason for this is that edge-triggered mode only +delivers events when changes occur on the monitored file descriptor. +So, in step +.B 5 +the caller might end up waiting for some data that is already present inside +the input buffer. +In the above example, an event on +.I rfd +will be generated because of the write done in +.B 2 +and the event is consumed in +.BR 3 . +Since the read operation done in +.B 4 +does not consume the whole buffer data, the call to +.BR epoll_wait (2) +done in step +.B 5 +might block indefinitely. + +An application that employs the +.B EPOLLET +flag should use nonblocking file descriptors to avoid having a blocking +read or write starve a task that is handling multiple file descriptors. +The suggested way to use +.B epoll +as an edge-triggered +.RB ( EPOLLET ) +interface is as follows: +.RS +.TP 4 +.B i +with nonblocking file descriptors; and +.TP +.B ii +by waiting for an event only after +.BR read (2) +or +.BR write (2) +return +.BR EAGAIN . +.RE +.PP +By contrast, when used as a level-triggered interface +(the default, when +.B EPOLLET +is not specified), +.B epoll +is simply a faster +.BR poll (2), +and can be used wherever the latter is used since it shares the +same semantics. + +Since even with edge-triggered +.BR epoll , +multiple events can be generated upon receipt of multiple chunks of data, +the caller has the option to specify the +.B EPOLLONESHOT +flag, to tell +.B epoll +to disable the associated file descriptor after the receipt of an event with +.BR epoll_wait (2). +When the +.B EPOLLONESHOT +flag is specified, +it is the caller's responsibility to rearm the file descriptor using +.BR epoll_ctl (2) +with +.BR EPOLL_CTL_MOD . +.SS /proc interfaces +The following interfaces can be used to limit the amount of +kernel memory consumed by epoll: +.\" 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 +.IR /proc/sys/fs/epoll/max_user_watches " (since Linux 2.6.28)" +This specifies a limit on the total number of +file descriptors that a user can register across +all epoll instances on the system. +The limit is per real user ID. +Each registered file descriptor costs roughly 90 bytes on a 32-bit kernel, +and roughly 160 bytes on a 64-bit kernel. +Currently, +.\" 2.6.29 (in 2.6.28, the default was 1/32 of lowmem) +the default value for +.I max_user_watches +is 1/25 (4%) of the available low memory, +divided by the registration cost in bytes. +.SS Example for Suggested Usage +While the usage of +.B epoll +when employed as a level-triggered interface does have the same +semantics as +.BR poll (2), +the edge-triggered usage requires more clarification to avoid stalls +in the application event loop. +In this example, listener is a +nonblocking socket on which +.BR listen (2) +has been called. +The function +.I do_use_fd() +uses the new ready file descriptor until +.B EAGAIN +is returned by either +.BR read (2) +or +.BR write (2). +An event-driven state machine application should, after having received +.BR EAGAIN , +record its current state so that at the next call to +.I do_use_fd() +it will continue to +.BR read (2) +or +.BR write (2) +from where it stopped before. + +.in +4n +.nf +#define MAX_EVENTS 10 +struct epoll_event ev, events[MAX_EVENTS]; +int listen_sock, conn_sock, nfds, epollfd; + +/* Set up listening socket, \(aqlisten_sock\(aq (socket(), + bind(), listen()) */ + +epollfd = epoll_create(10); +if (epollfd == \-1) { + perror("epoll_create"); + exit(EXIT_FAILURE); +} + +ev.events = EPOLLIN; +ev.data.fd = listen_sock; +if (epoll_ctl(epollfd, EPOLL_CTL_ADD, listen_sock, &ev) == \-1) { + perror("epoll_ctl: listen_sock"); + exit(EXIT_FAILURE); +} + +for (;;) { + nfds = epoll_wait(epollfd, events, MAX_EVENTS, \-1); + if (nfds == \-1) { + perror("epoll_pwait"); + exit(EXIT_FAILURE); + } + + for (n = 0; n < nfds; ++n) { + if (events[n].data.fd == listen_sock) { + conn_sock = accept(listen_sock, + (struct sockaddr *) &local, &addrlen); + if (conn_sock == \-1) { + perror("accept"); + exit(EXIT_FAILURE); + } + setnonblocking(conn_sock); + ev.events = EPOLLIN | EPOLLET; + ev.data.fd = conn_sock; + if (epoll_ctl(epollfd, EPOLL_CTL_ADD, conn_sock, + &ev) == \-1) { + perror("epoll_ctl: conn_sock"); + exit(EXIT_FAILURE); + } + } else { + do_use_fd(events[n].data.fd); + } + } +} +.fi +.in + +When used as an edge-triggered interface, for performance reasons, it is +possible to add the file descriptor inside the +.B epoll +interface +.RB ( EPOLL_CTL_ADD ) +once by specifying +.RB ( EPOLLIN | EPOLLOUT ). +This allows you to avoid +continuously switching between +.B EPOLLIN +and +.B EPOLLOUT +calling +.BR epoll_ctl (2) +with +.BR EPOLL_CTL_MOD . +.SS Questions and Answers +.TP 4 +.B Q0 +What is the key used to distinguish the file descriptors registered in an +.B epoll +set? +.TP +.B A0 +The key is the combination of the file descriptor number and +the open file description +(also known as an "open file handle", +the kernel's internal representation of an open file). +.TP +.B Q1 +What happens if you register the same file descriptor on an +.B epoll +instance twice? +.TP +.B A1 +You will probably get +.BR EEXIST . +However, it is possible to add a duplicate +.RB ( dup (2), +.BR dup2 (2), +.BR fcntl (2) +.BR F_DUPFD ) +descriptor to the same +.B epoll +instance. +.\" 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 +.\" cannot add the duplicate file descriptor to the epoll set. (In every +.\" other case that I can think of, descriptors duplicated by fork have +.\" similar semantics to descriptors duplicated by dup() and friends.) On +.\" the other hand, the very fact that the child has a duplicate of the +.\" descriptor means that even if the parent closes its descriptor, then +.\" epoll_wait() in the parent will continue to receive notifications for +.\" that descriptor because of the duplicated descriptor in the child. +.\" +.\" See http://thread.gmane.org/gmane.linux.kernel/596462/ +.\" "epoll design problems with common fork/exec patterns" +.\" +.\" mtk, Feb 2008 +This can be a useful technique for filtering events, +if the duplicate file descriptors are registered with different +.I events +masks. +.TP +.B Q2 +Can two +.B epoll +instances wait for the same file descriptor? +If so, are events reported to both +.B epoll +file descriptors? +.TP +.B A2 +Yes, and events would be reported to both. +However, careful programming may be needed to do this correctly. +.TP +.B Q3 +Is the +.B epoll +file descriptor itself poll/epoll/selectable? +.TP +.B A3 +Yes. +If an +.B epoll +file descriptor has events waiting then it will +indicate as being readable. +.TP +.B Q4 +What happens if one attempts to put an +.B epoll +file descriptor into its own file descriptor set? +.TP +.B A4 +The +.BR epoll_ctl (2) +call will fail +.RB ( EINVAL ). +However, you can add an +.B epoll +file descriptor inside another +.B epoll +file descriptor set. +.TP +.B Q5 +Can I send an +.B epoll +file descriptor over a Unix domain socket to another process? +.TP +.B A5 +Yes, but it does not make sense to do this, since the receiving process +would not have copies of the file descriptors in the +.B epoll +set. +.TP +.B Q6 +Will closing a file descriptor cause it to be removed from all +.B epoll +sets automatically? +.TP +.B A6 +Yes, but be aware of the following point. +A file descriptor is a reference to an open file description (see +.BR open (2)). +Whenever a descriptor is duplicated via +.BR dup (2), +.BR dup2 (2), +.BR fcntl (2) +.BR F_DUPFD , +or +.BR fork (2), +a new file descriptor referring to the same open file description is +created. +An open file description continues to exist until all +file descriptors referring to it have been closed. +A file descriptor is removed from an +.B epoll +set only after all the file descriptors referring to the underlying +open file description have been closed +(or before if the descriptor is explicitly removed using +.BR epoll_ctl () +.BR EPOLL_CTL_DEL ). +This means that even after a file descriptor that is part of an +.B epoll +set has been closed, +events may be reported for that file descriptor if other file +descriptors referring to the same underlying file description remain open. +.TP +.B Q7 +If more than one event occurs between +.BR epoll_wait (2) +calls, are they combined or reported separately? +.TP +.B A7 +They will be combined. +.TP +.B Q8 +Does an operation on a file descriptor affect the +already collected but not yet reported events? +.TP +.B A8 +You can do two operations on an existing file descriptor. +Remove would be meaningless for +this case. +Modify will reread available I/O. +.TP +.B Q9 +Do I need to continuously read/write a file descriptor +until +.B EAGAIN +when using the +.B EPOLLET +flag (edge-triggered behavior) ? +.TP +.B A9 +Receiving an event from +.BR epoll_wait (2) +should suggest to you that such +file descriptor is ready for the requested I/O operation. +You must consider it ready until the next (nonblocking) +read/write yields +.BR EAGAIN . +When and how you will use the file descriptor is entirely up to you. +.sp +For packet/token-oriented files (e.g., datagram socket, +terminal in canonical mode), +the only way to detect the end of the read/write I/O space +is to continue to read/write until +.BR EAGAIN . +.sp +For stream-oriented files (e.g., pipe, FIFO, stream socket), the +condition that the read/write I/O space is exhausted can also be detected by +checking the amount of data read from / written to the target file +descriptor. +For example, if you call +.BR read (2) +by asking to read a certain amount of data and +.BR read (2) +returns a lower number of bytes, you +can be sure of having exhausted the read I/O space for the file +descriptor. +The same is true when writing using +.BR write (2). +(Avoid this latter technique if you cannot guarantee that +the monitored file descriptor always refers to a stream-oriented file.) +.SS Possible Pitfalls and Ways to Avoid Them +.TP +.B o Starvation (edge-triggered) +.PP +If there is a large amount of I/O space, +it is possible that by trying to drain +it the other files will not get processed causing starvation. +(This problem is not specific to +.BR epoll .) +.PP +The solution is to maintain a ready list +and mark the file descriptor as ready +in its associated data structure, thereby allowing the application to +remember which files need to be processed but still round robin amongst +all the ready files. +This also supports ignoring subsequent events you +receive for file descriptors that are already ready. +.TP +.B o If using an event cache... +.PP +If you use an event cache or store all the file descriptors returned from +.BR epoll_wait (2), +then make sure to provide a way to mark +its closure dynamically (i.e., caused by +a previous event's processing). +Suppose you receive 100 events from +.BR epoll_wait (2), +and in event #47 a condition causes event #13 to be closed. +If you remove the structure and +.BR close (2) +the file descriptor for event #13, then your +event cache might still say there are events waiting for that +file descriptor causing confusion. +.PP +One solution for this is to call, during the processing of event 47, +.BR epoll_ctl ( EPOLL_CTL_DEL ) +to delete file descriptor 13 and +.BR close (2), +then mark its associated +data structure as removed and link it to a cleanup list. +If you find another +event for file descriptor 13 in your batch processing, +you will discover the file descriptor had been +previously removed and there will be no confusion. +.SH VERSIONS +The +.B epoll +API was introduced in Linux kernel 2.5.44. +.\" Its interface should be finalized in Linux kernel 2.5.66. +Support was added to glibc in version 2.3.2. +.SH CONFORMING TO +The +.B epoll +API is Linux-specific. +Some other systems provide similar +mechanisms, for example, FreeBSD has +.IR kqueue , +and Solaris has +.IR /dev/poll . +.SH "SEE ALSO" +.BR epoll_create (2), +.BR epoll_create1 (2), +.BR epoll_ctl (2), +.BR epoll_wait (2) diff --git a/original/man7/feature_test_macros.7 b/original/man7/feature_test_macros.7 new file mode 100644 index 00000000..186e48ad --- /dev/null +++ b/original/man7/feature_test_macros.7 @@ -0,0 +1,584 @@ +.\" 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. +.\" +.TH FEATURE_TEST_MACROS 7 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH NAME +feature_test_macros \- feature test macros +.SH SYNOPSIS +.nf +.B #include +.fi +.SH DESCRIPTION +Feature test macros allow the programmer to control the definitions that +are exposed by system header files when a program is compiled. +This can be useful for creating portable applications, +by preventing nonstandard definitions from being exposed. +Other macros can be used to expose nonstandard definitions that +are not exposed by default. +The precise effects of each of the feature test macros described below +can be ascertained by inspecting the +.I +header file. + +In order to be effective, a feature test macro +.IR "must be defined before including any header files" . +This can either be done in the compilation command +.RI ( "cc \-DMACRO=value" ) +or by defining the macro within the source code before +including any headers. +.SS Specification of feature test macro requirements in manual pages +When a function requires that a feature test macro is defined, +the manual page SYNOPSIS typically includes a note of the following form +(this example from the +.BR chmod (2) +manual page): +.RS +.sp +.B #include +.sp +.BI "int chmod(const char *" path ", mode_t " mode ); +.br +.BI "int fchmod(int " fd ", mode_t " mode ); +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR fchmod (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.RE +.PP +The \fB||\fP means that in order to obtain the declaration of +.BR fchmod (2) +from +.IR , +\fIeither\fP of the following macro +definitions must be made before including any header files: +.RS +.nf + +#define _BSD_SOURCE +#define _XOPEN_SOURCE 500 /* or any value > 500 */ +.fi +.RE +.PP +Alternatively, equivalent definitions can be included in the +compilation command: +.RS +.nf + +cc \-D_BSD_SOURCE +cc \-D_XOPEN_SOURCE=500 # Or any value > 500 +.fi +.RE +.PP +Note that, as described below, +.BR "some feature test macros are defined by default" , +so that it may not always be necessary to +explicitly specify the feature test macro(s) shown in the +SYNOPSIS. + +In a few cases, manual pages use a shorthand for expressing the +feature test macro requirements (this example from +.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 +This format is employed in cases where only a single +feature test macro can be used to expose the function +declaration, and that macro is not defined by default. +.SS Feature test macros understood by glibc +The following paragraphs explain how feature test macros are handled +in 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. + +Linux glibc understands the following feature test macros: +.TP +.B __STRICT_ANSI__ +ISO Standard C. +This macro is implicitly defined by +.BR gcc (1) +when invoked with, for example, the +.I -std=c99 +or +.I -ansi +flag. +.TP +.B _POSIX_C_SOURCE +Defining this macro causes header files to expose definitions as follows: +.RS +.IP \(bu 3 +The value 1 exposes definitions conforming to POSIX.1-1990 and +ISO C (1990). +.IP \(bu +The value 2 or greater additionally exposes +definitions for POSIX.2-1992. +.IP \(bu +The value 199309L or greater additionally exposes +definitions for POSIX.1b (real-time extensions). +.\" 199506L functionality is only available since glibc 2.1 +.IP \(bu +The value 199506L or greater additionally exposes +definitions for POSIX.1c (threads). +.IP \(bu +(Since glibc 2.3.3) +The value 200112L or greater exposes definitions corresponding +to the POSIX.1-2001 base specification (excluding the XSI extension). +.IP \(bu +(Since glibc 2.10) +The value 200809L or greater exposes definitions corresponding +to the POSIX.1-2008 base specification (excluding the XSI extension). +.RE +.TP +.B _POSIX_SOURCE +Defining this obsolete macro with any value is equivalent to defining +.B _POSIX_C_SOURCE +with the value 1. +.TP +.B _XOPEN_SOURCE +Defining this macro causes header files to expose definitions as follows: +.RS +.IP \(bu 3 +Defining with any value exposes +definitions conforming to POSIX.1, POSIX.2, and XPG4. +.IP \(bu +The value 500 or greater additionally exposes +definitions for SUSv2 (UNIX 98). +.IP \(bu +(Since glibc 2.2) The value 600 or greater additionally exposes +definitions for SUSv3 (UNIX 03; i.e., the POSIX.1-2001 base specification +plus the XSI extension) and C99 definitions. +.IP \(bu +(Since glibc 2.10) The value 700 or greater additionally exposes +definitions for SUSv4 (i.e., the POSIX.1-2008 base specification +plus the XSI extension). +.RE +.TP +.B _XOPEN_SOURCE_EXTENDED +If this macro is defined, and +.B _XOPEN_SOURCE +is defined, then expose definitions corresponding to the XPG4v2 +(SUSv1) UNIX extensions (UNIX 95). +This macro is also implicitly defined if +.B _XOPEN_SOURCE +is defined with a value of 500 or more. +.TP +.B _ISOC99_SOURCE +Exposes C99 extensions to ISO C (1990). +This macro is recognized since glibc 2.1.3; +earlier glibc 2.1.x versions recognized an equivalent macro named +.B _ISOC9X_SOURCE +(because the C99 standard had not then been finalized). +Although the use of the latter macro is obsolete, glibc continues +to recognize it for backwards compatibility. +.TP +.B _LARGEFILE64_SOURCE +Expose definitions for the alternative API specified by the +LFS (Large File Summit) as a "transitional extension" to the +Single UNIX Specification. +(See http://opengroup.org/platform/lfs.html.) +The alternative API consists of a set of new objects +(i.e., functions and types) whose names are suffixed with "64" +(e.g., +.I off64_t +versus +.IR off_t , +.BR lseek64 () +versus +.BR lseek (), +etc.). +New programs should not employ this interface; instead +.I _FILE_OFFSET_BITS=64 +should be employed. +.TP +.B _FILE_OFFSET_BITS +Defining this macro with the value 64 +automatically converts references to 32-bit functions and data types +related to file I/O and file system operations into references to +their 64-bit counterparts. +This is useful for performing I/O on large files (> 2 Gigabytes) +on 32-bit systems. +(Defining this macro permits correctly written programs to use +large files with only a recompilation being required.) +64-bit systems naturally permit file sizes greater than 2 Gigabytes, +and on those systems this macro has no effect. +.TP +.B _BSD_SOURCE +Defining this macro with any value causes header files to expose +BSD-derived definitions. +Defining this macro also causes BSD definitions to be preferred in +some situations where standards conflict, unless one or more of +.BR _SVID_SOURCE , +.BR _POSIX_SOURCE , +.BR _POSIX_C_SOURCE , +.BR _XOPEN_SOURCE , +.BR _XOPEN_SOURCE_EXTENDED , +or +.B _GNU_SOURCE +is defined, in which case BSD definitions are disfavored. +.TP +.B _SVID_SOURCE +Defining this macro with any value causes header files to expose +System V-derived definitions. +(SVID == System V Interface Definition; see +.BR standards (7).) +.TP +.BR _ATFILE_SOURCE " (since glibc 2.4)" +Defining this macro with any value causes header files to expose +declarations of a range of functions with the suffix "at"; +see +.BR openat (2). +Since glibc 2.10, this macro is also implicitly defined if +.BR _POSIX_C_SOURCE +is defined with a value greater than or equal to 200809L. +.TP +.B _GNU_SOURCE +Defining this macro (with any value) is equivalent to defining +.BR _BSD_SOURCE , +.BR _SVID_SOURCE , +.BR _ATFILE_SOURCE , +.BR _LARGEFILE64_SOURCE , +.BR _ISOC99_SOURCE , +.BR _XOPEN_SOURCE_EXTENDED , +.BR _POSIX_SOURCE , +.B _POSIX_C_SOURCE +with the value 200809L +(200112L in glibc versions before 2.10; +199506L in glibc versions before 2.5; +199309L in glibc versions before 2.1) +and +.B _XOPEN_SOURCE +with the value 700 +(600 in glibc versions before 2.10; +500 in glibc versions before 2.2). +In addition, various GNU-specific extensions are also exposed. +Where standards conflict, BSD definitions are disfavored. +.TP +.B _REENTRANT +Defining this macro exposes definitions of certain reentrant functions. +For multithreaded programs, use +.I "cc\ \-pthread" +instead. +.TP +.B _THREAD_SAFE +Synonym for +.BR _REENTRANT , +provided for compatibility with some other implementations. +.TP +.BR _FORTIFY_SOURCE " (since 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 +Defining this macro causes some lightweight checks to be performed +to detect some buffer overflow errors when employing +various string and memory manipulation functions. +Not all buffer overflows are detected, just some common cases. +In the current implementation checks are added for +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), +and +.BR gets (3). +If +.B _FORTIFY_SOURCE +is set to 1, with compiler optimization level 1 +.RI ( "gcc\ \-O1" ) +and above, checks that shouldn't change the behavior of +conforming programs are performed. +With +.B _FORTIFY_SOURCE +set to 2 some more checking is added, but +some conforming programs might fail. +Some of the checks can be performed at compile time, +and result in compiler warnings; +other checks take place at run time, +and result in a run-time error if the check fails. +Use of this macro requires compiler support, available with +.BR gcc (1) +since version 4.0. +.SS Default definitions, implicit definitions, and combining definitions +.PP +If no feature test macros are explicitly defined, +then the following feature test macros are defined by default: +.BR _BSD_SOURCE , +.BR _SVID_SOURCE , +.BR _POSIX_SOURCE , +and +.BR _POSIX_C_SOURCE =200809L +(200112L in glibc versions before 2.10; +199506L in glibc versions before 2.4; +199309L in glibc versions before 2.1). +.PP +If any of +.BR __STRICT_ANSI__ , +.BR _ISOC99_SOURCE , +.BR _POSIX_SOURCE , +.BR _POSIX_C_SOURCE , +.BR _XOPEN_SOURCE , +.BR _XOPEN_SOURCE_EXTENDED , +.BR _BSD_SOURCE , +or +.B _SVID_SOURCE +is explicitly defined, then +.BR _BSD_SOURCE , +and +.B _SVID_SOURCE +are not defined by default. + +If +.B _POSIX_SOURCE +and +.B _POSIX_C_SOURCE +are not explicitly defined, +and either +.B __STRICT_ANSI__ +is not defined or +.B _XOPEN_SOURCE +is defined with a value of 500 or more, then +.RS 3 +.IP * 3 +.B _POSIX_SOURCE +is defined with the value 1; and +.IP * +.B _POSIX_C_SOURCE +is defined with one of the following values: +.RS 6 +.IP \(bu 3 +2, +if +.B XOPEN_SOURCE +is defined with a value less than 500; +.IP \(bu +199506L, +if +.B XOPEN_SOURCE +is defined with a value greater than or equal to 500 and less than 600; +or +.IP \(bu +(since glibc 2.4) 200112L, +if +.B XOPEN_SOURCE +is defined with a value greater than or equal to 600 and less than 700. +.IP \(bu +(Since glibc 2.10) +200809L, +if +.B XOPEN_SOURCE +is defined with a value greater than or equal to 700. +.IP \(bu +Older versions of glibc do not know about the values +200112L and 200809L for +.BR _POSIX_C_SOURCE , +and the setting of this macro will depend on the glibc version. +.IP \(bu +If +.B _XOPEN_SOURCE +is undefined, then the setting of +.B _POSIX_C_SOURCE +depends on the glibc version: +199506L, in glibc versions before 2.4; +200112L, in glibc 2.4 to 2.9; and +200809L, since glibc 2.10. +.RE +.RE +.PP +Multiple macros can be defined; the results are additive. +.SH CONFORMING TO +POSIX.1 specifies +.BR _POSIX_C_SOURCE , +.BR _POSIX_SOURCE , +and +.BR _XOPEN_SOURCE . +.B _XOPEN_SOURCE_EXTENDED +was specified by XPG4v2 (aka SUSv1). + +.B _FILE_OFFSET_BITS +is not specified by any standard, +but is employed on some other implementations. + +.BR _BSD_SOURCE , +.BR _SVID_SOURCE , +.BR _ATFILE_SOURCE , +.BR _GNU_SOURCE , +.BR _FORTIFY_SOURCE , +.BR _REENTRANT , +and +.B _THREAD_SAFE +are specific to Linux (glibc). +.SH NOTES +.I +is a Linux/glibc-specific header file. +Other systems have an analogous file, but typically with a different name. +This header file is automatically included by other header files as +required: it is not necessary to explicitly include it in order to +employ feature test macros. + +According to which of the above feature test macros are defined, +.I +internally defines various other macros that are checked by +other glibc header files. +These macros have names prefixed by two underscores (e.g., +.BR __USE_MISC ). +Programs should \fInever\fP define these macros directly: +instead, the appropriate feature test macro(s) from the +list above should be employed. +.SH EXAMPLE +The program below can be used to explore how the various +feature test macros are set depending on the glibc version +and what feature test macros are explicitly set. +The following shell session, on a system with glibc 2.10, +shows some examples of what we would see: +.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 +.SH SEE ALSO +.BR libc (7), +.BR standards (7) +.sp +The section "Feature Test Macros" under +.IR "info libc" . +.\" But beware: the info libc document is out of date (Jul 07, mtk) +.sp +.I /usr/include/features.h diff --git a/original/man7/fifo.7 b/original/man7/fifo.7 new file mode 100644 index 00000000..e28d0c22 --- /dev/null +++ b/original/man7/fifo.7 @@ -0,0 +1,70 @@ +.\" This man page is Copyright (C) 1999 Claus Fischer. +.\" 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. +.\" +.\" 990620 - page created - aeb@cwi.nl +.\" +.\" FIXME . Add example programs to this page? +.TH FIFO 7 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH NAME +fifo \- first-in first-out special file, named pipe +.SH DESCRIPTION +A FIFO special file (a named pipe) is similar to a pipe, +except that it is accessed as part of the file system. +It can be opened by multiple processes for reading or +writing. +When processes are exchanging data via the FIFO, +the kernel passes all data internally without writing it +to the file system. +Thus, the FIFO special file has no +contents on the file system; the file system entry merely +serves as a reference point so that processes can access +the pipe using a name in the file system. +.PP +The kernel maintains exactly one pipe object for each +FIFO special file that is opened by at least one process. +The FIFO must be opened on both ends (reading and writing) +before data can be passed. +Normally, opening the FIFO blocks +until the other end is opened also. +.PP +A process can open a FIFO in nonblocking mode. +In this +case, opening for read only will succeed even if no-one has +opened on the write side yet, opening for write only will +fail with +.B ENXIO +(no such device or address) unless the other +end has already been opened. +.PP +Under Linux, opening a FIFO for read and write will succeed +both in blocking and nonblocking mode. +POSIX leaves this +behavior undefined. +This can be used to open a FIFO for +writing while there are no readers available. +A process +that uses both ends of the connection in order to communicate +with itself should be very careful to avoid deadlocks. +.SH NOTES +When a process tries to write to a FIFO that is not opened +for read on the other side, the process is sent a +.B SIGPIPE +signal. + +FIFO special files can be created by +.BR mkfifo (3), +and are indicated by +.IR "ls \-l" +with the file type \(aqp\(aq. +.SH "SEE ALSO" +.BR mkfifo (1), +.BR open (2), +.BR pipe (2), +.BR sigaction (2), +.BR signal (2), +.BR socketpair (2), +.BR mkfifo (3), +.BR pipe (7) diff --git a/original/man7/futex.7 b/original/man7/futex.7 new file mode 100644 index 00000000..ae8a9c55 --- /dev/null +++ b/original/man7/futex.7 @@ -0,0 +1,118 @@ +.\" This page is made available under the MIT license. +.\" +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.TH FUTEX 7 2002-12-31 "Linux" "Linux Programmer's Manual" +.SH NAME +futex \- Fast Userspace Locking +.SH SYNOPSIS +.nf +.B #include +.fi +.SH DESCRIPTION +.PP +The Linux kernel provides futexes ("Fast Userspace muTexes") +as a building block for fast userspace +locking and semaphores. +Futexes are very basic and lend themselves well for building higher level +locking abstractions such as POSIX mutexes. +.PP +This page does not set out to document all design decisions +but restricts itself to issues relevant for +application and library development. +Most programmers will in fact not be using futexes directly but +instead rely on system libraries built on them, +such as the NPTL pthreads implementation. +.PP +A futex is identified by a piece of memory which can be +shared between different processes. +In these different processes, it need not have identical addresses. +In its bare form, a futex has semaphore semantics; +it is a counter that can be incremented and decremented atomically; +processes can wait for the value to become positive. +.PP +Futex operation is entirely userspace for the noncontended case. +The kernel is only involved to arbitrate the contended case. +As any sane design will strive for noncontention, +futexes are also optimized for this situation. +.PP +In its bare form, a futex is an aligned integer which is +only touched by atomic assembler instructions. +Processes can share this integer using +.BR mmap (2), +via shared memory segments or because they share memory space, +in which case the application is commonly called multithreaded. +.SS "Semantics" +.PP +Any futex operation starts in userspace, +but it may necessary to communicate with the kernel using the +.BR futex (2) +system call. +.PP +To "up" a futex, execute the proper assembler instructions that +will cause the host CPU to atomically increment the integer. +Afterwards, check if it has in fact changed from 0 to 1, in which case +there were no waiters and the operation is done. +This is the noncontended case which is fast and should be common. +.PP +In the contended case, the atomic increment changed the counter +from \-1 (or some other negative number). +If this is detected, there are waiters. +Userspace should now set the counter to 1 and instruct the +kernel to wake up any waiters using the +.B FUTEX_WAKE +operation. +.PP +Waiting on a futex, to "down" it, is the reverse operation. +Atomically decrement the counter and check if it changed to 0, +in which case the operation is done and the futex was uncontended. +In all other circumstances, the process should set the counter to \-1 +and request that the kernel wait for another process to up the futex. +This is done using the +.B FUTEX_WAIT +operation. +.PP +The +.BR futex (2) +system call can optionally be passed a timeout specifying how long +the kernel should +wait for the futex to be upped. +In this case, semantics are more complex and the programmer is referred +to +.BR futex (2) +for +more details. +The same holds for asynchronous futex waiting. +.SH "VERSIONS" +.PP +Initial futex support was merged in Linux 2.5.7 +but with different semantics from those described above. +Current semantics are available from Linux 2.5.40 onwards. +.SH "NOTES" +.PP +To reiterate, bare futexes are not intended as an easy to use +abstraction for end-users. +Implementors are expected to be assembly literate and to have read +the sources of the futex userspace library referenced +below. +.PP +This man page illustrates the most common use of the +.BR futex (2) +primitives: it is by no means the only one. +.\" .SH "AUTHORS" +.\" .PP +.\" Futexes were designed and worked on by Hubertus Franke +.\" (IBM Thomas J. Watson Research Center), +.\" Matthew Kirkwood, Ingo Molnar (Red Hat) and +.\" Rusty Russell (IBM Linux Technology Center). +.\" This page written by bert hubert. +.SH "SEE ALSO" +.BR futex (2) +.PP +.IR "Fuss, Futexes and Furwocks: Fast Userlevel Locking in Linux" +(proceedings of the Ottawa Linux Symposium 2002), +futex example library, futex-*.tar.bz2 +. diff --git a/original/man7/glibc.7 b/original/man7/glibc.7 new file mode 100644 index 00000000..0d1ed269 --- /dev/null +++ b/original/man7/glibc.7 @@ -0,0 +1 @@ +.so man7/libc.7 diff --git a/original/man7/glob.7 b/original/man7/glob.7 new file mode 100644 index 00000000..e8a3f43d --- /dev/null +++ b/original/man7/glob.7 @@ -0,0 +1,209 @@ +.\" Copyright (c) 1998 Andries Brouwer +.\" +.\" 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. +.\" +.\" 2003-08-24 fix for / by John Kristoff + joey +.\" +.TH GLOB 7 2003-08-24 "Linux" "Linux Programmer's Manual" +.SH NAME +glob \- Globbing pathnames +.SH DESCRIPTION +Long ago, in Unix V6, there was a program +.I /etc/glob +that would expand wildcard patterns. +Soon afterwards this became a shell built-in. + +These days there is also a library routine +.BR glob (3) +that will perform this function for a user program. + +The rules are as follows (POSIX.2, 3.13). +.SS "Wildcard Matching" +A string is a wildcard pattern if it contains one of the +characters \(aq?\(aq, \(aq*\(aq or \(aq[\(aq. +Globbing is the operation +that expands a wildcard pattern into the list of pathnames +matching the pattern. +Matching is defined by: + +A \(aq?\(aq (not between brackets) matches any single character. + +A \(aq*\(aq (not between brackets) matches any string, +including the empty string. +.PP +.B "Character classes" +.sp +An expression "\fI[...]\fP" where the first character after the +leading \(aq[\(aq is not an \(aq!\(aq matches a single character, +namely any of the characters enclosed by the brackets. +The string enclosed by the brackets cannot be empty; +therefore \(aq]\(aq can be allowed between the brackets, provided +that it is the first character. +(Thus, "\fI[][!]\fP" matches the +three characters \(aq[\(aq, \(aq]\(aq and \(aq!\(aq.) +.PP +.B Ranges +.sp +There is one special convention: +two characters separated by \(aq\-\(aq denote a range. +(Thus, "\fI[A\-Fa\-f0\-9]\fP" +is equivalent to "\fI[ABCDEFabcdef0123456789]\fP".) +One may include \(aq\-\(aq in its literal meaning by making it the +first or last character between the brackets. +(Thus, "\fI[]\-]\fP" matches just the two characters \(aq]\(aq and \(aq\-\(aq, +and "\fI[\-\-0]\fP" matches the +three characters \(aq\-\(aq, \(aq.\(aq, \(aq0\(aq, since \(aq/\(aq +cannot be matched.) +.PP +.B Complementation +.sp +An expression "\fI[!...]\fP" matches a single character, namely +any character that is not matched by the expression obtained +by removing the first \(aq!\(aq from it. +(Thus, "\fI[!]a\-]\fP" matches any +single character except \(aq]\(aq, \(aqa\(aq and \(aq\-\(aq.) + +One can remove the special meaning of \(aq?\(aq, \(aq*\(aq and \(aq[\(aq by +preceding them by a backslash, or, in case this is part of +a shell command line, enclosing them in quotes. +Between brackets these characters stand for themselves. +Thus, "\fI[[?*\e]\fP" matches the +four characters \(aq[\(aq, \(aq?\(aq, \(aq*\(aq and \(aq\e\(aq. +.SS Pathnames +Globbing is applied on each of the components of a pathname +separately. +A \(aq/\(aq in a pathname cannot be matched by a \(aq?\(aq or \(aq*\(aq +wildcard, or by a range like "\fI[.\-0]\fP". +A range cannot contain an +explicit \(aq/\(aq character; this would lead to a syntax error. + +If a filename starts with a \(aq.\(aq, +this character must be matched explicitly. +(Thus, \fIrm\ *\fP will not remove .profile, and \fItar\ c\ *\fP will not +archive all your files; \fItar\ c\ .\fP is better.) +.SS "Empty Lists" +The nice and simple rule given above: "expand a wildcard pattern +into the list of matching pathnames" was the original Unix +definition. +It allowed one to have patterns that expand into +an empty list, as in +.br +.nf + xv \-wait 0 *.gif *.jpg +.fi +where perhaps no *.gif files are present (and this is not +an error). +However, POSIX requires that a wildcard pattern is left +unchanged when it is syntactically incorrect, or the list of +matching pathnames is empty. +With +.I bash +one can force the classical behavior by setting +.IR allow_null_glob_expansion=true . + +(Similar problems occur elsewhere. +E.g., where old scripts have +.br +.nf + rm \`find . \-name "*~"\` +.fi +new scripts require +.br +.nf + rm \-f nosuchfile \`find . \-name "*~"\` +.fi +to avoid error messages from +.I rm +called with an empty argument list.) +.SH NOTES +.SS Regular expressions +Note that wildcard patterns are not regular expressions, +although they are a bit similar. +First of all, they match +filenames, rather than text, and secondly, the conventions +are not the same: for example, in a regular expression \(aq*\(aq means zero or +more copies of the preceding thing. + +Now that regular expressions have bracket expressions where +the negation is indicated by a \(aq^\(aq, POSIX has declared the +effect of a wildcard pattern "\fI[^...]\fP" to be undefined. +.SS Character classes and Internationalization +Of course ranges were originally meant to be ASCII ranges, +so that "\fI[\ \-%]\fP" stands for "\fI[\ !"#$%]\fP" and "\fI[a\-z]\fP" stands +for "any lowercase letter". +Some Unix implementations generalized this so that a range X\-Y +stands for the set of characters with code between the codes for +X and for Y. +However, this requires the user to know the +character coding in use on the local system, and moreover, is +not convenient if the collating sequence for the local alphabet +differs from the ordering of the character codes. +Therefore, POSIX extended the bracket notation greatly, +both for wildcard patterns and for regular expressions. +In the above we saw three types of items that can occur in a bracket +expression: namely (i) the negation, (ii) explicit single characters, +and (iii) ranges. +POSIX specifies ranges in an internationally +more useful way and adds three more types: + +(iii) Ranges X\-Y comprise all characters that fall between X +and Y (inclusive) in the current collating sequence as defined +by the +.B LC_COLLATE +category in the current locale. + +(iv) Named character classes, like +.nf + +[:alnum:] [:alpha:] [:blank:] [:cntrl:] +[:digit:] [:graph:] [:lower:] [:print:] +[:punct:] [:space:] [:upper:] [:xdigit:] + +.fi +so that one can say "\fI[[:lower:]]\fP" instead of "\fI[a\-z]\fP", and have +things work in Denmark, too, where there are three letters past \(aqz\(aq +in the alphabet. +These character classes are defined by the +.B LC_CTYPE +category +in the current locale. + +(v) Collating symbols, like "\fI[.ch.]\fP" or "\fI[.a-acute.]\fP", +where the string between "\fI[.\fP" and "\fI.]\fP" is a collating +element defined for the current locale. +Note that this may +be a multicharacter element. + +(vi) Equivalence class expressions, like "\fI[=a=]\fP", +where the string between "\fI[=\fP" and "\fI=]\fP" is any collating +element from its equivalence class, as defined for the +current locale. +For example, "\fI[[=a=]]\fP" might be equivalent +.\" FIXME . the accented 'a' characters are not rendering properly +.\" mtk May 2007 +to "\fI[aáàäâ]\fP" (warning: Latin-1 here), that is, +to "\fI[a[.a-acute.][.a-grave.][.a-umlaut.][.a-circumflex.]]\fP". +.SH "SEE ALSO" +.BR sh (1), +.BR fnmatch (3), +.BR glob (3), +.BR locale (7), +.BR regex (7) diff --git a/original/man7/hier.7 b/original/man7/hier.7 new file mode 100644 index 00000000..8acfbfeb --- /dev/null +++ b/original/man7/hier.7 @@ -0,0 +1,503 @@ +.\" 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 Sun Jul 25 11:05:58 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sat Feb 10 16:18:03 1996 by Urs Thuermann (urs@isnogud.escape.de) +.\" Modified Mon Jun 16 20:02:00 1997 by Nicolás Lichtmaier +.\" Modified Mon Feb 6 16:41:00 1999 by Nicolás Lichtmaier +.\" Modified Tue Feb 8 16:46:45 2000 by Chris Pepper +.\" Modified Fri Sep 7 20:32:45 2001 by Tammy Fox +.TH HIER 7 2009-03-30 "Linux" "Linux Programmer's Manual" +.SH NAME +hier \- Description of the file system hierarchy +.SH DESCRIPTION +A typical Linux system has, among others, the following directories: +.TP +.I / +This is the root directory. +This is where the whole tree starts. +.TP +.I /bin +This directory contains executable programs which are needed in +single user mode and to bring the system up or repair it. +.TP +.I /boot +Contains static files for the boot loader. +This directory only holds +the files which are needed during the boot process. +The map installer +and configuration files should go to +.I /sbin +and +.IR /etc . +.TP +.I /dev +Special or device files, which refer to physical devices. +See +.BR mknod (1). +.TP +.I /etc +Contains configuration files which are local to the machine. +Some +larger software packages, like X11, can have their own subdirectories +below +.IR /etc . +Site-wide configuration files may be placed here or in +.IR /usr/etc . +Nevertheless, programs should always look for these files in +.I /etc +and you may have links for these files to +.IR /usr/etc . +.TP +.I /etc/opt +Host-specific configuration files for add-on applications installed +in +.IR /opt . +.TP +.I /etc/sgml +This directory contains the configuration files for SGML and XML (optional). +.TP +.I /etc/skel +When a new user account is created, files from this directory are +usually copied into the user's home directory. +.TP +.I /etc/X11 +Configuration files for the X11 window system (optional). +.TP +.I /home +On machines with home directories for users, these are usually beneath +this directory, directly or not. +The structure of this directory +depends on local administration decisions. +.TP +.I /lib +This directory should hold those shared libraries that are necessary +to boot the system and to run the commands in the root file system. +.TP +.I /media +This directory contains mount points for removable media such as CD +and DVD disks or USB sticks. +.TP +.I /mnt +This directory is a mount point for a temporarily mounted file system. +In some distributions, +.I /mnt +contains subdirectories intended to be used as mount points for several +temporary file systems. +.TP +.I /opt +This directory should contain add-on packages that contain static files. +.TP +.I /proc +This is a mount point for the +.I proc +file system, which provides information about running processes and +the kernel. +This pseudo-file system is described in more detail in +.BR proc (5). +.TP +.I /root +This directory is usually the home directory for the root user (optional). +.TP +.I /sbin +Like +.IR /bin , +this directory holds commands needed to boot the system, but which are +usually not executed by normal users. +.TP +.I /srv +This directory contains site-specific data that is served by this system. +.TP +.I /tmp +This directory contains temporary files which may be deleted with no +notice, such as by a regular job or at system boot up. +.TP +.I /usr +This directory is usually mounted from a separate partition. +It should hold only sharable, read-only data, so that it can be mounted +by various machines running Linux. +.TP +.I /usr/X11R6 +The X\-Window system, version 11 release 6 (optional). +.TP +.I /usr/X11R6/bin +Binaries which belong to the X\-Window system; often, there is a +symbolic link from the more traditional +.I /usr/bin/X11 +to here. +.TP +.I /usr/X11R6/lib +Data files associated with the X\-Window system. +.TP +.I /usr/X11R6/lib/X11 +These contain miscellaneous files needed to run X; Often, there is a +symbolic link from +.I /usr/lib/X11 +to this directory. +.TP +.I /usr/X11R6/include/X11 +Contains include files needed for compiling programs using the X11 +window system. +Often, there is a symbolic link from +.I /usr/include/X11 +to this directory. +.TP +.I /usr/bin +This is the primary directory for executable programs. +Most programs +executed by normal users which are not needed for booting or for +repairing the system and which are not installed locally should be +placed in this directory. +.TP +.I /usr/bin/X11 +is the traditional place to look for X11 executables; on Linux, it +usually is a symbolic link to +.IR /usr/X11R6/bin . +.TP +.I /usr/dict +Replaced by +.IR /usr/share/dict . +.TP +.I /usr/doc +Replaced by +.IR /usr/share/doc . +.TP +.I /usr/etc +Site-wide configuration files to be shared between several machines +may be stored in this directory. +However, commands should always +reference those files using the +.I /etc +directory. +Links from files in +.I /etc +should point to the appropriate files in +.IR /usr/etc . +.TP +.I /usr/games +Binaries for games and educational programs (optional). +.TP +.I /usr/include +Include files for the C compiler. +.TP +.I /usr/include/X11 +Include files for the C compiler and the X\-Window system. +This is +usually a symbolic link to +.IR /usr/X11R6/include/X11 . +.TP +.I /usr/include/asm +Include files which declare some assembler functions. +This used to be a +symbolic link to +.IR /usr/src/linux/include/asm . +.TP +.I /usr/include/linux +This contains information which may change from system release to +system release and used to be a symbolic link to +.I /usr/src/linux/include/linux +to get at operating system specific information. + +(Note that one should have include files there that work correctly with +the current libc and in user space. +However, Linux kernel source is not +designed to be used with user programs and does not know anything +about the libc you are using. +It is very likely that things will break +if you let +.I /usr/include/asm +and +.I /usr/include/linux +point at a random kernel tree. +Debian systems don't do this +and use headers from a known good kernel +version, provided in the libc*-dev package.) +.TP +.I /usr/include/g++ +Include files to use with the GNU C++ compiler. +.TP +.I /usr/lib +Object libraries, including dynamic libraries, plus some executables +which usually are not invoked directly. +More complicated programs may +have whole subdirectories there. +.TP +.I /usr/lib/X11 +The usual place for data files associated with X programs, and +configuration files for the X system itself. +On Linux, it usually is +a symbolic link to +.IR /usr/X11R6/lib/X11 . +.TP +.I /usr/lib/gcc-lib +contains executables and include files for the GNU C compiler, +.BR gcc (1). +.TP +.I /usr/lib/groff +Files for the GNU groff document formatting system. +.TP +.I /usr/lib/uucp +Files for +.BR uucp (1). +.TP +.I /usr/local +This is where programs which are local to the site typically go. +.TP +.I /usr/local/bin +Binaries for programs local to the site. +.TP +.I /usr/local/doc +Local documentation. +.TP +.I /usr/local/etc +Configuration files associated with locally installed programs. +.TP +.I /usr/local/games +Binaries for locally installed games. +.TP +.I /usr/local/lib +Files associated with locally installed programs. +.TP +.I /usr/local/include +Header files for the local C compiler. +.TP +.I /usr/local/info +Info pages associated with locally installed programs. +.TP +.I /usr/local/man +Man pages associated with locally installed programs. +.TP +.I /usr/local/sbin +Locally installed programs for system administration. +.TP +.I /usr/local/share +Local application data that can be shared among different architectures +of the same OS. +.TP +.I /usr/local/src +Source code for locally installed software. +.TP +.I /usr/man +Replaced by +.IR /usr/share/man . +.TP +.I /usr/sbin +This directory contains program binaries for system administration +which are not essential for the boot process, for mounting +.IR /usr , +or for system repair. +.TP +.I /usr/share +This directory contains subdirectories with specific application data, that +can be shared among different architectures of the same OS. +Often one finds stuff here that used to live in +.I /usr/doc +or +.I /usr/lib +or +.IR /usr/man . +.TP +.I /usr/share/dict +Contains the word lists used by spell checkers. +.TP +.I /usr/share/doc +Documentation about installed programs. +.TP +.I /usr/share/games +Static data files for games in +.IR /usr/games . +.TP +.I /usr/share/info +Info pages go here. +.TP +.I /usr/share/locale +Locale information goes here. +.TP +.I /usr/share/man +Manual pages go here in subdirectories according to the man page sections. +.TP +.I /usr/share/man//man[1\-9] +These directories contain manual pages for the +specific locale in source code form. +Systems which use a unique language and code set for all manual pages +may omit the substring. +.TP +.I /usr/share/misc +Miscellaneous data that can be shared among different architectures of the +same OS. +.TP +.I /usr/share/nls +The message catalogs for native language support go here. +.TP +.I /usr/share/sgml +Files for SGML and XML. +.TP +.I /usr/share/terminfo +The database for terminfo. +.TP +.I /usr/share/tmac +Troff macros that are not distributed with groff. +.TP +.I /usr/share/zoneinfo +Files for timezone information. +.TP +.I /usr/src +Source files for different parts of the system, included with some packages +for reference purposes. +Don't work here with your own projects, as files +below /usr should be read-only except when installing software. +.TP +.I /usr/src/linux +This was the traditional place for the kernel source. +Some distributions put here the source for the default kernel they ship. +You should probably use another directory when building your own kernel. +.TP +.I /usr/tmp +Obsolete. +This should be a link +to +.IR /var/tmp . +This link is present only for compatibility reasons and shouldn't be used. +.TP +.I /var +This directory contains files which may change in size, such as spool +and log files. +.TP +.I /var/adm +This directory is superseded by +.I /var/log +and should be a symbolic link to +.IR /var/log . +.TP +.I /var/backups +Reserved for historical reasons. +.TP +.I /var/cache +Data cached for programs. +.TP +.IR /var/catman/cat[1\-9] " or " /var/cache/man/cat[1\-9] +These directories contain preformatted manual pages according to their +man page section. +(The use of preformatted manual pages is deprecated.) +.TP +.I /var/cron +Reserved for historical reasons. +.TP +.I /var/lib +Variable state information for programs. +.TP +.I /var/local +Variable data for +.IR /usr/local . +.TP +.I /var/lock +Lock files are placed in this directory. +The naming convention for +device lock files is +.I LCK.. +where +.I +is the device's name in the file system. +The format used is that of HDU UUCP lock files, that is, lock files +contain a PID as a 10-byte ASCII decimal number, followed by a newline +character. +.TP +.I /var/log +Miscellaneous log files. +.TP +.I /var/opt +Variable data for +.IR /opt . +.TP +.I /var/mail +Users' mailboxes. +Replaces +.IR /var/spool/mail . +.TP +.I /var/msgs +Reserved for historical reasons. +.TP +.I /var/preserve +Reserved for historical reasons. +.TP +.I /var/run +Run-time variable files, like files holding process identifiers (PIDs) +and logged user information +.IR (utmp) . +Files in this directory are usually cleared when the system boots. +.TP +.I /var/spool +Spooled (or queued) files for various programs. +.TP +.I /var/spool/at +Spooled jobs for +.BR at (1). +.TP +.I /var/spool/cron +Spooled jobs for +.BR cron (8). +.TP +.I /var/spool/lpd +Spooled files for printing. +.TP +.I /var/spool/mail +Replaced by +.IR /var/mail . +.TP +.I /var/spool/mqueue +Queued outgoing mail. +.TP +.I /var/spool/news +Spool directory for news. +.TP +.I /var/spool/rwho +Spooled files for +.BR rwhod (8). +.TP +.I /var/spool/smail +Spooled files for the +.BR smail (1) +mail delivery program. +.TP +.I /var/spool/uucp +Spooled files for +.BR uucp (1). +.TP +.I /var/tmp +Like +.IR /tmp , +this directory holds temporary files stored for an unspecified duration. +.TP +.I /var/yp +Database files for NIS. +.SH "CONFORMING TO" +The Filesystem Hierarchy Standard, Version 2.2 . +.SH BUGS +This list is not exhaustive; different systems may be configured +differently. +.SH "SEE ALSO" +.BR find (1), +.BR ln (1), +.BR proc (5), +.BR mount (8) + +The Filesystem Hierarchy Standard diff --git a/original/man7/hostname.7 b/original/man7/hostname.7 new file mode 100644 index 00000000..9fc606c4 --- /dev/null +++ b/original/man7/hostname.7 @@ -0,0 +1,94 @@ +.\" 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. +.\" +.TH HOSTNAME 7 2008-06-11 "Linux" "Linux Programmer's Manual" +.SH NAME +hostname \- hostname resolution description +.SH DESCRIPTION +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 subdomain of the Internet would be represented as + + monet.Berkeley.EDU + +(with no trailing dot). + +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 +.BR getaddrinfo (3) +or the obsolete +.BR gethostbyname (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 +.B HOSTALIASES +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 +.BR resolver (5)). +.SH SEE ALSO +.BR gethostbyname (3), +.BR resolver (5), +.BR mailaddr (7), +.BR named (8) +.\" .SH HISTORY +.\" Hostname appeared in +.\" 4.2BSD. diff --git a/original/man7/icmp.7 b/original/man7/icmp.7 new file mode 100644 index 00000000..dc13aad8 --- /dev/null +++ b/original/man7/icmp.7 @@ -0,0 +1,188 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: icmp.7,v 1.6 2000/08/14 08:03:45 ak Exp $ +.TH ICMP 7 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +icmp, IPPROTO_ICMP \- Linux IPv4 ICMP kernel module. +.SH DESCRIPTION +This kernel protocol module implements the Internet Control +Message Protocol defined in RFC\ 792. +It is used to signal error conditions and for diagnosis. +The user doesn't interact directly with this module; +instead it communicates with the other protocols in the kernel +and these pass the ICMP errors to the application layers. +The kernel ICMP module also answers ICMP requests. +.PP +A user protocol may receive ICMP packets for all local sockets by opening +a raw socket with the protocol +.BR IPPROTO_ICMP . +See +.BR raw (7) +for more information. +The types of ICMP packets passed to the socket can be filtered using the +.B ICMP_FILTER +socket option. +ICMP packets are always processed by the kernel too, even +when passed to a user socket. +.LP +Linux limits the rate of ICMP error packets to each destination. +.B ICMP_REDIRECT +and +.B ICMP_DEST_UNREACH +are also limited by the destination route of the incoming packets. +.SS /proc interfaces +ICMP supports a set of +.I /proc +interfaces to configure some global IP parameters. +The parameters can be accessed by reading or writing files in the directory +.IR /proc/sys/net/ipv4/ . +Most of these parameters are rate limitations for specific ICMP types. +Linux 2.2 uses a token bucket filter to limit ICMPs. +.\" FIXME better description needed +The value is the timeout in jiffies until the token bucket filter is +cleared after a burst. +A jiffy is a system dependent unit, usually 10ms on i386 and +about 1ms on alpha and ia64. +.TP +.IR icmp_destunreach_rate " (Linux 2.2 to 2.4.9)" +.\" Precisely: from 2.1.102 +Maximum rate to send ICMP Destination Unreachable packets. +This limits the rate at which packets are sent to any individual +route or destination. +The limit does not affect sending of +.B ICMP_FRAG_NEEDED +packets needed for path MTU discovery. +.TP +.IR icmp_echo_ignore_all " (since Linux 2.2)" +.\" Precisely: 2.1.68 +If this value is nonzero, Linux will ignore all +.B ICMP_ECHO +requests. +.TP +.IR icmp_echo_ignore_broadcasts " (since Linux 2.2)" +.\" Precisely: from 2.1.68 +If this value is nonzero, Linux will ignore all +.B ICMP_ECHO +packets sent to broadcast addresses. +.TP +.IR icmp_echoreply_rate " (Linux 2.2 to 2.4.9)" +.\" Precisely: from 2.1.102 +Maximum rate for sending +.B ICMP_ECHOREPLY +packets in response to +.B ICMP_ECHOREQUEST +packets. +.TP +.IR icmp_errors_use_inbound_ifaddr " (Boolean; default: disabled; since Linux 2.6.12)" +.\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt +If disabled, ICMP error messages are sent with the primary address of +the exiting interface. + +If enabled, the message will be sent with the primary address of +the interface that received the packet that caused the ICMP error. +This is the behavior that many network administrators will expect from +a router. +And it can make debugging complicated network layouts much easier. + +Note that if no primary address exists for the interface selected, +then the primary address of the first non-loopback interface that +has one will be used regardless of this setting. +.TP +.IR icmp_ignore_bogus_error_responses " (Boolean; default: disabled; since Linux 2.2)" +.\" precisely: since 2.1.32 +.\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt +Some routers violate RFC1122 by sending bogus responses to broadcast frames. +Such violations are normally logged via a kernel warning. +If this parameter is enabled, the kernel will not give such warnings, +which will avoid log file clutter. +.TP +.IR icmp_paramprob_rate " (Linux 2.2 to 2.4.9)" +.\" Precisely: from 2.1.102 +Maximum rate for sending +.B ICMP_PARAMETERPROB +packets. +These packets are sent when a packet arrives with an invalid IP header. +.TP +.IR icmp_ratelimit " (integer; default: 1000; since Linux 2.4.10)" +.\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt +Limit the maximum rates for sending ICMP packets whose type matches +.IR icmp_ratemask +(see below) to specific targets. +0 to disable any limiting, +otherwise the minimum space between responses in milliseconds. +.TP +.IR icmp_ratemask " (integer; default: see below; since Linux 2.4.10)" +.\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt +Mask made of ICMP types for which rates are being limited. + +Significant bits: IHGFEDCBA9876543210 +.br +Default mask: 0000001100000011000 (0x1818) + +Bit definitions (see the kernel source file +.IR include/linux/icmp.h ): + +.in +4n +.nf +0 Echo Reply +3 Destination Unreachable * +4 Source Quench * +5 Redirect +8 Echo Request +B Time Exceeded * +C Parameter Problem * +D Timestamp Request +E Timestamp Reply +F Info Request +G Info Reply +H Address Mask Request +I Address Mask Reply +.fi +.in + +The bits marked with an asterisk are rate limited by default +(see the default mask above). +.TP +.IR icmp_timeexceed_rate " (Linux 2.2 to 2.4.9)" +Maximum rate for sending +.B ICMP_TIME_EXCEEDED +packets. +These packets are +sent to prevent loops when a packet has crossed too many hops. +.SH VERSIONS +Support for the +.B ICMP_ADDRESS +request was removed in 2.2. +.PP +Support for +.B ICMP_SOURCE_QUENCH +was removed in Linux 2.2. +.SH NOTES +As many other implementations don't support +.B IPPROTO_ICMP +raw sockets, this feature +should not be relied on in portable programs. +.\" not really true ATM +.\" .PP +.\" Linux ICMP should be compliant to RFC 1122. +.PP +.B ICMP_REDIRECT +packets are not sent when Linux is not acting as a router. +They are also only accepted from the old gateway defined in the +routing table and the redirect routes are expired after some time. +.PP +The 64-bit timestamp returned by +.B ICMP_TIMESTAMP +is in milliseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). +.PP +Linux ICMP internally uses a raw socket to send ICMPs. +This raw socket may appear in +.BR netstat (8) +output with a zero inode. +.SH "SEE ALSO" +.BR ip (7) +.PP +RFC\ 792 for a description of the ICMP protocol. diff --git a/original/man7/inotify.7 b/original/man7/inotify.7 new file mode 100644 index 00000000..1d4ca31b --- /dev/null +++ b/original/man7/inotify.7 @@ -0,0 +1,404 @@ +'\" 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. +.\" +.TH INOTIFY 7 2008-11-18 "Linux" "Linux Programmer's Manual" +.SH NAME +inotify \- monitoring file system events +.SH DESCRIPTION +The +.I inotify +API provides a mechanism for monitoring file system events. +Inotify can be used to monitor individual files, +or to monitor directories. +When a directory is monitored, inotify will return events +for the directory itself, and for files inside the directory. + +The following system calls are used with this API: +.BR inotify_init (2) +(or +.BR inotify_init1 (2)), +.BR inotify_add_watch (2), +.BR inotify_rm_watch (2), +.BR read (2), +and +.BR close (2). + +.BR inotify_init (2) +creates an inotify instance and returns a file descriptor +referring to the inotify instance. +The more recent +.BR inotify_init1 (2) +is like +.BR inotify_init (2), +but provides some extra functionality. + +.BR inotify_add_watch (2) +manipulates the "watch list" associated with an inotify instance. +Each item ("watch") in the watch list specifies the pathname of +a file or directory, +along with some set of events that the kernel should monitor for the +file referred to by that pathname. +.BR inotify_add_watch (2) +either creates a new watch item, or modifies an existing watch. +Each watch has a unique "watch descriptor", an integer +returned by +.BR inotify_add_watch (2) +when the watch is created. + +.BR inotify_rm_watch (2) +removes an item from an inotify watch list. + +When all file descriptors referring to an inotify +instance have been closed, +the underlying object and its resources are +freed for reuse by the kernel; +all associated watches are automatically freed. + +To determine what events have occurred, an application +.BR read (2)s +from the inotify file descriptor. +If no events have so far occurred, then, +assuming a blocking file descriptor, +.BR read (2) +will block until at least one event occurs +(unless interrupted by a signal, +in which case the call fails with the error +.BR EINTR ; +see +.BR signal (7)). + +Each successful +.BR read (2) +returns a buffer containing one or more of the following structures: +.in +4n +.nf + +struct inotify_event { + int wd; /* Watch descriptor */ +.\" 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 + uint32_t mask; /* Mask of events */ + uint32_t cookie; /* Unique cookie associating related + events (for rename(2)) */ + uint32_t len; /* Size of \fIname\fP field */ + char name[]; /* Optional null-terminated name */ +}; +.fi +.in + +.I wd +identifies the watch for which this event occurs. +It is one of the watch descriptors returned by a previous call to +.BR inotify_add_watch (2). + +.I mask +contains bits that describe the event that occurred (see below). + +.I cookie +is a unique integer that connects related events. +Currently this is only used for rename events, and +allows the resulting pair of +.B IN_MOVE_FROM +and +.B IN_MOVE_TO +events to be connected by the application. + +The +.I name +field is only present when an event is returned +for a file inside a watched directory; +it identifies the file pathname relative to the watched directory. +This pathname is null-terminated, +and may include further null bytes to align subsequent reads to a +suitable address boundary. + +The +.I len +field counts all of the bytes in +.IR name , +including the null bytes; +the length of each +.I inotify_event +structure is thus +.IR "sizeof(inotify_event)+len" . + +The behavior when the buffer given to +.BR read (2) +is too small to return information about the next event depends +on the kernel version: in kernels before 2.6.21, +.BR read (2) +returns 0; since kernel 2.6.21, +.BR read (2) +fails with the error +.BR EINVAL . +.SS inotify events +The +.BR inotify_add_watch (2) +.I mask +argument and the +.I mask +field of the +.I inotify_event +structure returned when +.BR read (2)ing +an inotify file descriptor are both bit masks identifying +inotify events. +The following bits can be specified in +.I mask +when calling +.BR inotify_add_watch (2) +and may be returned in the +.I mask +field returned by +.BR read (2): +.RS 4 +.sp +.PD 0 +.TP 18 +.B IN_ACCESS +File was accessed (read) (*). +.TP +.B IN_ATTRIB +Metadata changed, e.g., permissions, timestamps, extended attributes, +link count (since Linux 2.6.25), UID, GID, etc. (*). +.TP +.B IN_CLOSE_WRITE +File opened for writing was closed (*). +.TP +.B IN_CLOSE_NOWRITE +File not opened for writing was closed (*). +.TP +.B IN_CREATE +File/directory created in watched directory (*). +.TP +.B IN_DELETE +File/directory deleted from watched directory (*). +.TP +.B IN_DELETE_SELF +Watched file/directory was itself deleted. +.TP +.B IN_MODIFY +File was modified (*). +.TP +.B IN_MOVE_SELF +Watched file/directory was itself moved. +.TP +.B IN_MOVED_FROM +File moved out of watched directory (*). +.TP +.B IN_MOVED_TO +File moved into watched directory (*). +.TP +.B IN_OPEN +File was opened (*). +.PD +.RE +.PP +When monitoring a directory, +the events marked with an asterisk (*) above can occur for +files in the directory, in which case the +.I name +field in the returned +.I inotify_event +structure identifies the name of the file within the directory. +.PP +The +.B IN_ALL_EVENTS +macro is defined as a bit mask of all of the above events. +This macro can be used as the +.I mask +argument when calling +.BR inotify_add_watch (2). + +Two additional convenience macros are +.BR IN_MOVE , +which equates to +IN_MOVED_FROM|IN_MOVED_TO, +and +.B IN_CLOSE +which equates to +IN_CLOSE_WRITE|IN_CLOSE_NOWRITE. +.PP +The following further bits can be specified in +.I mask +when calling +.BR inotify_add_watch (2): +.RS 4 +.sp +.PD 0 +.TP 18 +.BR IN_DONT_FOLLOW " (since Linux 2.6.15)" +Don't dereference \fIpathname\fP if it is a symbolic link. +.TP +.B IN_MASK_ADD +Add (OR) events to watch mask for this pathname if +it already exists (instead of replacing mask). +.TP +.B IN_ONESHOT +Monitor \fIpathname\fP for one event, then remove from +watch list. +.TP +.BR IN_ONLYDIR " (since Linux 2.6.15)" +Only watch \fIpathname\fP if it is a directory. +.PD +.RE +.PP +The following bits may be set in the +.I mask +field returned by +.BR read (2): +.RS 4 +.sp +.PD 0 +.TP 18 +.B IN_IGNORED +Watch was removed explicitly (\fBinotify_rm_watch\fP(2)) +or automatically (file was deleted, or file system was unmounted). +.TP +.B IN_ISDIR +Subject of this event is a directory. +.TP +.B IN_Q_OVERFLOW +Event queue overflowed (\fIwd\fP is \-1 for this event). +.TP +.B IN_UNMOUNT +File system containing watched object was unmounted. +.PD +.RE +.SS /proc interfaces +The following interfaces can be used to limit the amount of +kernel memory consumed by inotify: +.TP +.I /proc/sys/fs/inotify/max_queued_events +The value in this file is used when an application calls +.BR inotify_init (2) +to set an upper limit on the number of events that can be +queued to the corresponding inotify instance. +Events in excess of this limit are dropped, but an +.B IN_Q_OVERFLOW +event is always generated. +.TP +.I /proc/sys/fs/inotify/max_user_instances +This specifies an upper limit on the number of inotify instances +that can be created per real user ID. +.TP +.I /proc/sys/fs/inotify/max_user_watches +This specifies an upper limit on the number of watches +that can be created per real user ID. +.SH "VERSIONS" +Inotify was merged into the 2.6.13 Linux kernel. +The required library interfaces were added to glibc in version 2.4. +.RB ( IN_DONT_FOLLOW , +.BR IN_MASK_ADD , +and +.B IN_ONLYDIR +were only added in version 2.5.) +.SH "CONFORMING TO" +The inotify API is Linux-specific. +.SH "NOTES" +Inotify file descriptors can be monitored using +.BR select (2), +.BR poll (2), +and +.BR epoll (7). +When an event is available, the file descriptor indicates as readable. + +Since Linux 2.6.25, +signal-driven I/O notification is available for inotify file descriptors; +see the discussion of +.B F_SETFL +(for setting the +.B O_ASYNC +flag), +.BR F_SETOWN , +and +.B F_SETSIG +in +.BR fcntl (2). +The +.I siginfo_t +structure (described in +.BR sigaction (2)) +that is passed to the signal handler has the following fields set: +.IR si_fd +is set to the inotify file descriptor number; +.IR si_signo +is set to the signal number; +.IR si_code +is set to +.BR POLL_IN ; +and +.B POLLIN +is set in +.IR si_band . + +If successive output inotify events produced on the +inotify file descriptor are identical (same +.IR wd , +.IR mask , +.IR cookie , +and +.IR name ) +then they are coalesced into a single event if the +older event has not yet been read (but see BUGS). + +The events returned by reading from an inotify file descriptor +form an ordered queue. +Thus, for example, it is guaranteed that when renaming from +one directory to another, events will be produced in the +correct order on the inotify file descriptor. + +The +.B FIONREAD +.BR ioctl (2) +returns the number of bytes available to read from an +inotify file descriptor. + +Inotify monitoring of directories is not recursive: +to monitor subdirectories under a directory, +additional watches must be created. +.SH "BUGS" +In kernels before 2.6.16, the +.B IN_ONESHOT +.I mask +flag does not work. + +Before kernel 2.6.25, +the kernel code that was intended to coalesce successive identical events +(i.e., the two most recent events could potentially be coalesced +if the older had not yet been read) +instead checked if the most recent event could be coalesced with the +.I oldest +unread event. +.SH "SEE ALSO" +.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/original/man7/intro.7 b/original/man7/intro.7 new file mode 100644 index 00000000..81c5207b --- /dev/null +++ b/original/man7/intro.7 @@ -0,0 +1,41 @@ +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de), Fri Apr 2 11:32:09 MET DST +.\" 1993 +.\" +.\" 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 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) +.TH INTRO 7 2007-10-23 "Linux" "Linux Programmer's Manual" +.SH NAME +intro \- Introduction to overview, conventions, and miscellany section +.SH DESCRIPTION +Section 7 of the manual provides overviews on various topics, and +describes conventions and protocols, +character set standards, the standard file system layout, +and miscellaneous other things. +.SH NOTES +.SS Authors and Copyright Conditions +Look at the header of the manual page source for the author(s) and copyright +conditions. +Note that these can be different from page to page! +.SH "SEE ALSO" +.BR standards (7) diff --git a/original/man7/ip.7 b/original/man7/ip.7 new file mode 100644 index 00000000..34f7e805 --- /dev/null +++ b/original/man7/ip.7 @@ -0,0 +1,1039 @@ +'\" t +.\" Don't change the line above. it tells man that tbl is needed. +.\" This man page is Copyright (C) 1999 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. +.\" $Id: ip.7,v 1.19 2000/12/20 18:10:31 ak Exp $ +.TH IP 7 2009-02-28 "Linux" "Linux Programmer's Manual" +.SH NAME +ip \- Linux IPv4 protocol implementation +.SH SYNOPSIS +.B #include +.br +.\" .B #include -- does not exist anymore +.\" .B #include -- never include +.B #include +.br +.B #include \fR/* superset of previous */ +.sp +.IB tcp_socket " = socket(AF_INET, SOCK_STREAM, 0);" +.br +.IB udp_socket " = socket(AF_INET, SOCK_DGRAM, 0);" +.br +.IB raw_socket " = socket(AF_INET, SOCK_RAW, " protocol ");" +.SH DESCRIPTION +Linux implements the Internet Protocol, version 4, +described in RFC\ 791 and RFC\ 1122. +.B ip +contains a level 2 multicasting implementation conforming to RFC\ 1112. +It also contains an IP router including a packet filter. +.\" FIXME has someone verified that 2.1 is really 1812 compliant? +.PP +The programming interface is BSD-sockets compatible. +For more information on sockets, see +.BR socket (7). +.PP +An IP socket is created by calling the +.BR socket (2) +function as +.BR "socket(AF_INET, socket_type, protocol)" . +Valid socket types are +.B SOCK_STREAM +to open a +.BR tcp (7) +socket, +.B SOCK_DGRAM +to open a +.BR udp (7) +socket, or +.B SOCK_RAW +to open a +.BR raw (7) +socket to access the IP protocol directly. +.I protocol +is the IP protocol in the IP header to be received or sent. +The only valid values for +.I protocol +are 0 and +.B IPPROTO_TCP +for TCP sockets, and 0 and +.B IPPROTO_UDP +for UDP sockets. +For +.B SOCK_RAW +you may specify a valid IANA IP protocol defined in +RFC\ 1700 assigned numbers. +.PP +.\" FIXME ip current does an autobind in listen, but I'm not sure +.\" if that should be documented. +When a process wants to receive new incoming packets or connections, it +should bind a socket to a local interface address using +.BR bind (2). +Only one IP socket may be bound to any given local (address, port) pair. +When +.B INADDR_ANY +is specified in the bind call, the socket will be bound to +.I all +local interfaces. +When +.BR listen (2) +or +.BR connect (2) +are called on an unbound socket, it is automatically bound to a +random free port with the local address set to +.BR INADDR_ANY . + +A TCP local socket address that has been bound is unavailable for +some time after closing, unless the +.B SO_REUSEADDR +flag has been set. +Care should be taken when using this flag as it makes TCP less reliable. +.SS Address Format +An IP socket address is defined as a combination of an IP interface +address and a 16-bit port number. +The basic IP protocol does not supply port numbers, they +are implemented by higher level protocols like +.BR udp (7) +and +.BR tcp (7). +On raw sockets +.I sin_port +is set to the IP protocol. +.PP +.in +4n +.nf +struct sockaddr_in { + sa_family_t sin_family; /* address family: AF_INET */ + in_port_t sin_port; /* port in network byte order */ + struct in_addr sin_addr; /* internet address */ +}; + +/* Internet address. */ +struct in_addr { + uint32_t s_addr; /* address in network byte order */ +}; +.fi +.in +.PP +.I sin_family +is always set to +.BR AF_INET . +This is required; in Linux 2.2 most networking functions return +.B EINVAL +when this setting is missing. +.I sin_port +contains the port in network byte order. +The port numbers below 1024 are called +.IR "privileged ports" +(or sometimes: +.IR "reserved ports" ). +Only privileged processes (i.e., those having the +.B CAP_NET_BIND_SERVICE +capability) may +.BR bind (2) +to these sockets. +Note that the raw IPv4 protocol as such has no concept of a +port, they are only implemented by higher protocols like +.BR tcp (7) +and +.BR udp (7). +.PP +.I sin_addr +is the IP host address. +The +.I s_addr +member of +.I struct in_addr +contains the host interface address in network byte order. +.I in_addr +should be assigned one of the INADDR_* values (e.g., +.BR INADDR_ANY ) +or set using the +.BR inet_aton (3), +.BR inet_addr (3), +.BR inet_makeaddr (3) +library functions or directly with the name resolver (see +.BR gethostbyname (3)). + +IPv4 addresses are divided into unicast, broadcast +and multicast addresses. +Unicast addresses specify a single interface of a host, +broadcast addresses specify all hosts on a network and multicast +addresses address all hosts in a multicast group. +Datagrams to broadcast addresses can be only sent or received when the +.B SO_BROADCAST +socket flag is set. +In the current implementation, connection-oriented sockets are only allowed +to use unicast addresses. +.\" Leave a loophole for XTP @) + +Note that the address and the port are always stored in +network byte order. +In particular, this means that you need to call +.BR htons (3) +on the number that is assigned to a port. +All address/port manipulation +functions in the standard library work in network byte order. + +There are several special addresses: +.B INADDR_LOOPBACK +(127.0.0.1) +always refers to the local host via the loopback device; +.B INADDR_ANY +(0.0.0.0) +means any address for binding; +.B INADDR_BROADCAST +(255.255.255.255) +means any host and has the same effect on bind as +.B INADDR_ANY +for historical reasons. +.SS Socket Options +IP supports some protocol-specific socket options that can be set with +.BR setsockopt (2) +and read with +.BR getsockopt (2). +The socket option level for IP is +.BR IPPROTO_IP . +.\" or SOL_IP on Linux +A boolean integer flag is zero when it is false, otherwise true. +.\" +.\" FIXME Document IP_FREEBIND +.\" Boolean +.\" Since Linux 2.4.0-test10 +.\" +.TP +.BR IP_ADD_MEMBERSHIP " (since Linux 1.2)" +Join a multicast group. +Argument is an +.I ip_mreqn +structure. +.sp +.in +4n +.nf +struct ip_mreqn { + struct in_addr imr_multiaddr; /* IP multicast group + address */ + struct in_addr imr_address; /* IP address of local + interface */ + int imr_ifindex; /* interface index */ +}; +.fi +.in +.sp +.I imr_multiaddr +contains the address of the multicast group the application +wants to join or leave. +It must be a valid multicast address +.\" (i.e., within the 224.0.0.0-239.255.255.255 range) +(or +.BR setsockopt (2) +fails with the error +.BR EINVAL ). +.I imr_address +is the address of the local interface with which the system +should join the multicast group; if it is equal to +.B INADDR_ANY +an appropriate interface is chosen by the system. +.I imr_ifindex +is the interface index of the interface that should join/leave the +.I imr_multiaddr +group, or 0 to indicate any interface. +.IP +The +.I ip_mreqn +is available only since Linux 2.2. +For compatibility, the old +.I ip_mreq +structure (present since Linux 1.2) is still supported. +It differs from +.I ip_mreqn +only by not including the +.I imr_ifindex +field. +Only valid as a +.BR setsockopt (2). +.\" +.TP +.BR IP_DROP_MEMBERSHIP " (since Linux 1.2)" +Leave a multicast group. +Argument is an +.I ip_mreqn +or +.I ip_mreq +structure similar to +.BR IP_ADD_MEMBERSHIP . +.TP +.BR IP_HDRINCL " (since Linux 2.0)" +If enabled, +the user supplies an IP header in front of the user data. +Only valid for +.B SOCK_RAW +sockets. +See +.BR raw (7) +for more information. +When this flag is enabled the values set by +.BR IP_OPTIONS , +.B IP_TTL +and +.B IP_TOS +are ignored. +.\" FIXME Document IP_IPSEC_POLICY +.\" Since Linux 2.5.47 +.\" Needs CAP_NET_ADMIN +.TP +.BR IP_MTU " (since Linux 2.2)" +.\" Precisely: 2.1.124 +Retrieve the current known path MTU of the current socket. +Only valid when the socket has been connected. +Returns an integer. +Only valid as a +.BR getsockopt (2). +.TP +.BR IP_MTU_DISCOVER " (since Linux 2.2)" +.\" Precisely: 2.1.124 +Set or receive the Path MTU Discovery setting for a socket. +When enabled, Linux will perform Path MTU Discovery +as defined in RFC\ 1191 +on this socket. +The don't-fragment flag is set on all outgoing datagrams. +The system-wide default is controlled by the +.I /proc/sys/net/ipv4/ip_no_pmtu_disc +file for +.B SOCK_STREAM +sockets, and disabled on all others. +For +.RB non- SOCK_STREAM +sockets, it is the user's responsibility to packetize the data +in MTU sized chunks and to do the retransmits if necessary. +The kernel will reject packets that are bigger than the known +path MTU if this flag is set (with +.B EMSGSIZE +). +.TS +tab(:); +c l +l l. +Path MTU discovery flags:Meaning +IP_PMTUDISC_WANT:Use per-route settings. +IP_PMTUDISC_DONT:Never do Path MTU Discovery. +IP_PMTUDISC_DO:Always do Path MTU Discovery. +IP_PMTUDISC_PROBE:Set DF but ignore Path MTU. +.TE + +When PMTU discovery is enabled, the kernel automatically keeps track of +the path MTU per destination host. +When it is connected to a specific peer with +.BR connect (2), +the currently known path MTU can be retrieved conveniently using the +.B IP_MTU +socket option (e.g., after a +.B EMSGSIZE +error occurred). +It may change over time. +For connectionless sockets with many destinations, +the new MTU for a given destination can also be accessed using the +error queue (see +.BR IP_RECVERR ). +A new error will be queued for every incoming MTU update. + +While MTU discovery is in progress, initial packets from datagram sockets +may be dropped. +Applications using UDP should be aware of this and not +take it into account for their packet retransmit strategy. + +To bootstrap the path MTU discovery process on unconnected sockets, it +is possible to start with a big datagram size +(up to 64K-headers bytes long) and let it shrink by updates of the path MTU. +.\" FIXME this is an ugly hack + +To get an initial estimate of the +path MTU, connect a datagram socket to the destination address using +.BR connect (2) +and retrieve the MTU by calling +.BR getsockopt (2) +with the +.B IP_MTU +option. + +It is possible to implement RFC 4821 MTU probing with +.B SOCK_DGRAM +or +.B SOCK_RAW +sockets by setting a value of +.BR IP_PMTUDISC_PROBE +(available since Linux 2.6.22). +This is also particularly useful for diagnostic tools such as +.BR tracepath (8) +that wish to deliberately send probe packets larger than +the observed Path MTU. +.TP +.BR IP_MULTICAST_IF " (since Linux 1.2)" +Set the local device for a multicast socket. +Argument is an +.I ip_mreqn +or +.I ip_mreq +structure similar to +.BR IP_ADD_MEMBERSHIP . +.IP +When an invalid socket option is passed, +.B ENOPROTOOPT +is returned. +.TP +.BR IP_MULTICAST_LOOP " (since Linux 1.2)" +Set or read a boolean integer argument that determines whether +sent multicast packets should be looped back to the local sockets. +.TP +.BR IP_MULTICAST_TTL " (since Linux 1.2)" +Set or read the time-to-live value of outgoing multicast packets for this +socket. +It is very important for multicast packets to set the smallest TTL possible. +The default is 1 which means that multicast packets don't leave the local +network unless the user program explicitly requests it. +Argument is an integer. +.TP +.BR IP_OPTIONS " (since Linux 2.0)" +.\" Precisely: 1.3.30 +Set or get the IP options to be sent with every packet from this socket. +The arguments are a pointer to a memory buffer containing the options +and the option length. +The +.BR setsockopt (2) +call sets the IP options associated with a socket. +The maximum option size for IPv4 is 40 bytes. +See RFC\ 791 for the allowed options. +When the initial connection request packet for a +.B SOCK_STREAM +socket contains IP options, the IP options will be set automatically +to the options from the initial packet with routing headers reversed. +Incoming packets are not allowed to change options after the connection +is established. +The processing of all incoming source routing options +is disabled by default and can be enabled by using the +.I accept_source_route +.I /proc +interface. +Other options like timestamps are still handled. +For datagram sockets, IP options can be only set by the local user. +Calling +.BR getsockopt (2) +with +.B IP_OPTIONS +puts the current IP options used for sending into the supplied buffer. +.\" FIXME Document IP_PASSSEC +.\" Boolean +.\" Since Linux 2.6.17 +.\" commit 2c7946a7bf45ae86736ab3b43d0085e43947945c +.\" Author: Catherine Zhang +.TP +.BR IP_PKTINFO " (since Linux 2.2)" +.\" Precisely: 2.1.68 +Pass an +.B IP_PKTINFO +ancillary message that contains a +.I pktinfo +structure that supplies some information about the incoming packet. +This only works for datagram oriented sockets. +The argument is a flag that tells the socket whether the +.B IP_PKTINFO +message should be passed or not. +The message itself can only be sent/retrieved +as control message with a packet using +.BR recvmsg (2) +or +.BR sendmsg (2). +.IP +.in +4n +.nf +struct in_pktinfo { + unsigned int ipi_ifindex; /* Interface index */ + struct in_addr ipi_spec_dst; /* Local address */ + struct in_addr ipi_addr; /* Header Destination + address */ +}; +.fi +.in +.IP +.\" FIXME elaborate on that. +.I ipi_ifindex +is the unique index of the interface the packet was received on. +.I ipi_spec_dst +is the local address of the packet and +.I ipi_addr +is the destination address in the packet header. +If +.B IP_PKTINFO +is passed to +.BR sendmsg (2) +and +.\" This field is grossly misnamed +.I ipi_spec_dst +is not zero, then it is used as the local source address for the routing +table lookup and for setting up IP source route options. +When +.I ipi_ifindex +is not zero, the primary local address of the interface specified by the +index overwrites +.I ipi_spec_dst +for the routing table lookup. +.TP +.BR IP_RECVERR " (since Linux 2.2)" +.\" Precisely: 2.1.15 +Enable extended reliable error message passing. +When enabled on a datagram socket, all +generated errors will be queued in a per-socket error queue. +When the user receives an error from a socket operation, +the errors can be received by calling +.BR recvmsg (2) +with the +.B MSG_ERRQUEUE +flag set. +The +.I sock_extended_err +structure describing the error will be passed in an ancillary message with +the type +.B IP_RECVERR +and the level +.BR IPPROTO_IP . +.\" or SOL_IP on Linux +This is useful for reliable error handling on unconnected sockets. +The received data portion of the error queue contains the error packet. +.IP +The +.B IP_RECVERR +control message contains a +.I sock_extended_err +structure: +.IP +.in +4n +.ne 18 +.nf +#define SO_EE_ORIGIN_NONE 0 +#define SO_EE_ORIGIN_LOCAL 1 +#define SO_EE_ORIGIN_ICMP 2 +#define SO_EE_ORIGIN_ICMP6 3 + +struct sock_extended_err { + uint32_t ee_errno; /* error number */ + uint8_t ee_origin; /* where the error originated */ + uint8_t ee_type; /* type */ + uint8_t ee_code; /* code */ + uint8_t ee_pad; + uint32_t ee_info; /* additional information */ + uint32_t ee_data; /* other data */ + /* More data may follow */ +}; + +struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *); +.fi +.in +.IP +.I ee_errno +contains the +.I errno +number of the queued error. +.I ee_origin +is the origin code of where the error originated. +The other fields are protocol-specific. +The macro +.B SO_EE_OFFENDER +returns a pointer to the address of the network object +where the error originated from given a pointer to the ancillary message. +If this address is not known, the +.I sa_family +member of the +.I sockaddr +contains +.B AF_UNSPEC +and the other fields of the +.I sockaddr +are undefined. +.IP +IP uses the +.I sock_extended_err +structure as follows: +.I ee_origin +is set to +.B SO_EE_ORIGIN_ICMP +for errors received as an ICMP packet, or +.B SO_EE_ORIGIN_LOCAL +for locally generated errors. +Unknown values should be ignored. +.I ee_type +and +.I ee_code +are set from the type and code fields of the ICMP header. +.I ee_info +contains the discovered MTU for +.B EMSGSIZE +errors. +The message also contains the +.I sockaddr_in of the node +caused the error, which can be accessed with the +.B SO_EE_OFFENDER +macro. +The +.I sin_family +field of the SO_EE_OFFENDER address is +.B AF_UNSPEC +when the source was unknown. +When the error originated from the network, all IP options +.RI ( IP_OPTIONS ", " IP_TTL ", " +etc.) enabled on the socket and contained in the +error packet are passed as control messages. +The payload of the packet causing the error is returned as normal payload. +.\" FIXME . Is it a good idea to document that? It is a dubious feature. +.\" On +.\" .B SOCK_STREAM +.\" sockets, +.\" .B IP_RECVERR +.\" has slightly different semantics. Instead of +.\" saving the errors for the next timeout, it passes all incoming +.\" errors immediately to the user. +.\" This might be useful for very short-lived TCP connections which +.\" need fast error handling. Use this option with care: +.\" it makes TCP unreliable +.\" by not allowing it to recover properly from routing +.\" shifts and other normal +.\" conditions and breaks the protocol specification. +Note that TCP has no error queue; +.B MSG_ERRQUEUE +is not permitted on +.B SOCK_STREAM +sockets. +.B IP_RECVERR +is valid for TCP, but all errors are returned by socket function return or +.B SO_ERROR +only. +.IP +For raw sockets, +.B IP_RECVERR +enables passing of all received ICMP errors to the +application, otherwise errors are only reported on connected sockets +.IP +It sets or retrieves an integer boolean flag. +.B IP_RECVERR +defaults to off. +.TP +.BR IP_RECVOPTS " (since Linux 2.2)" +.\" Precisely: 2.1.15 +Pass all incoming IP options to the user in a +.B IP_OPTIONS +control message. +The routing header and other options are already filled in +for the local host. +Not supported for +.B SOCK_STREAM +sockets. +.TP +.BR IP_RECVTOS " (since Linux 2.2)" +.\" Precisely: 2.1.68 +If enabled the +.B IP_TOS +ancillary message is passed with incoming packets. +It contains a byte which specifies the Type of Service/Precedence +field of the packet header. +Expects a boolean integer flag. +.TP +.BR IP_RECVTTL " (since Linux 2.2)" +.\" Precisely: 2.1.68 +When this flag is set, pass a +.B IP_TTL +control message with the time to live +field of the received packet as a byte. +Not supported for +.B SOCK_STREAM +sockets. +.TP +.BR IP_RETOPTS " (since Linux 2.2)" +.\" Precisely: 2.1.15 +Identical to +.BR IP_RECVOPTS , +but returns raw unprocessed options with timestamp and route record +options not filled in for this hop. +.TP +.BR IP_ROUTER_ALERT " (since Linux 2.2)" +.\" Precisely: 2.1.68 +Pass all to-be forwarded packets with the +IP Router Alert option set to this socket. +Only valid for raw sockets. +This is useful, for instance, for user-space RSVP daemons. +The tapped packets are not forwarded by the kernel; it is +the user's responsibility to send them out again. +Socket binding is ignored, +such packets are only filtered by protocol. +Expects an integer flag. +.TP +.BR IP_TOS " (since Linux 1.0)" +Set or receive the Type-Of-Service (TOS) field that is sent +with every IP packet originating from this socket. +It is used to prioritize packets on the network. +TOS is a byte. +There are some standard TOS flags defined: +.B IPTOS_LOWDELAY +to minimize delays for interactive traffic, +.B IPTOS_THROUGHPUT +to optimize throughput, +.B IPTOS_RELIABILITY +to optimize for reliability, +.B IPTOS_MINCOST +should be used for "filler data" where slow transmission doesn't matter. +At most one of these TOS values can be specified. +Other bits are invalid and shall be cleared. +Linux sends +.B IPTOS_LOWDELAY +datagrams first by default, +but the exact behavior depends on the configured queueing discipline. +.\" FIXME elaborate on this +Some high priority levels may require superuser privileges (the +.B CAP_NET_ADMIN +capability). +The priority can also be set in a protocol independent way by the +.RB ( SOL_SOCKET ", " SO_PRIORITY ) +socket option (see +.BR socket (7)). +.\" FIXME Document IP_TRANSPARENT +.\" Needs CAP_NET_ADMIN +.\" Boolean +.\" Since Linux 2.6.27 +.\" commit f5715aea4564f233767ea1d944b2637a5fd7cd2e +.\" Author: KOVACS Krisztian +.TP +.BR IP_TTL " (since Linux 1.0)" +Set or retrieve the current time-to-live field that is used in every packet +sent from this socket. +.\" FIXME Document IP_XFRM_POLICY +.\" Since Linux 2.5.48 +.\" Needs CAP_NET_ADMIN +.SS /proc interfaces +The IP protocol +supports a set of +.I /proc +interfaces to configure some global parameters. +The parameters can be accessed by reading or writing files in the directory +.IR /proc/sys/net/ipv4/ . +.\" FIXME As at 2.6.12, 14 Jun 2005, the following are undocumented: +.\" ip_queue_maxlen +.\" ip_conntrack_max +Interfaces described as +.I Boolean +take an integer value, with a nonzero value ("true") meaning that +the corresponding option is enabled, and a zero value ("false") +meaning that the option is disabled. +.\" +.TP +.IR ip_always_defrag " (Boolean; since Linux 2.2.13)" +[New with kernel 2.2.13; in earlier kernel versions this feature +was controlled at compile time by the +.B CONFIG_IP_ALWAYS_DEFRAG +option; this option is not present in 2.4.x and later] + +When this boolean flag is enabled (not equal 0), incoming fragments +(parts of IP packets +that arose when some host between origin and destination decided +that the packets were too large and cut them into pieces) will be +reassembled (defragmented) before being processed, even if they are +about to be forwarded. + +Only enable if running either a firewall that is the sole link +to your network or a transparent proxy; never ever use it for a +normal router or host. +Otherwise fragmented communication can be disturbed +if the fragments travel over different links. +Defragmentation also has a large memory and CPU time cost. + +This is automagically turned on when masquerading or transparent +proxying are configured. +.\" +.TP +.IR ip_autoconfig " (since Linux 2.2 to 2.6.17)" +.\" Precisely: since 2.1.68 +.\" FIXME document ip_autoconfig +Not documented. +.\" +.TP +.IR ip_default_ttl " (integer; default: 64; since Linux 2.2)" +.\" Precisely: 2.1.15 +Set the default time-to-live value of outgoing packets. +This can be changed per socket with the +.B IP_TTL +option. +.\" +.TP +.IR ip_dynaddr " (Boolean; default: disabled; since Linux 2.0.31)" +Enable dynamic socket address and masquerading entry rewriting on interface +address change. +This is useful for dialup interface with changing IP addresses. +0 means no rewriting, 1 turns it on and 2 enables verbose mode. +.\" +.TP +.IR ip_forward " (Boolean; default: disabled; since Linux 1.2)" +Enable IP forwarding with a boolean flag. +IP forwarding can be also set on a per-interface basis. +.\" +.TP +.IR ip_local_port_range " (since Linux 2.2)" +.\" Precisely: since 2.1.68 +Contains two integers that define the default local port range +allocated to sockets. +Allocation starts with the first number and ends with the second number. +Note that these should not conflict with the ports used by masquerading +(although the case is handled). +Also arbitrary choices may cause problems with some firewall packet +filters that make assumptions about the local ports in use. +First number should be at least greater than 1024, +or better, greater than 4096, to avoid clashes +with well known ports and to minimize firewall problems. +.\" +.TP +.IR ip_no_pmtu_disc " (Boolean; default: disabled; since Linux 2.2)" +.\" Precisely: 2.1.15 +If enabled, don't do Path MTU Discovery for TCP sockets by default. +Path MTU discovery may fail if misconfigured firewalls (that drop +all ICMP packets) or misconfigured interfaces (e.g., a point-to-point +link where the both ends don't agree on the MTU) are on the path. +It is better to fix the broken routers on the path than to turn off +Path MTU Discovery globally, because not doing it incurs a high cost +to the network. +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR ip_nonlocal_bind " (Boolean; default: disabled; since Linux 2.4)" +.\" Precisely: patch-2.4.0-test10 +If set, allows processes to +.BR bind (2) +to nonlocal IP addresses, +which can be quite useful, but may break some applications. +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR ip6frag_time " (integer; default 30)" +Time in seconds to keep an IPv6 fragment in memory. +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR ip6frag_secret_interval " (integer; default 600)" +Regeneration interval (in seconds) of the hash secret (or lifetime +for the hash secret) for IPv6 fragments. +.TP +.IR ipfrag_high_thresh " (integer), " ipfrag_low_thresh " (integer)" +If the amount of queued IP fragments reaches +.IR ipfrag_high_thresh , +the queue is pruned down to +.IR ipfrag_low_thresh . +Contains an integer with the number of bytes. +.TP +.I neigh/* +See +.BR arp (7). +.\" FIXME Document the conf/*/* interfaces +.\" FIXME Document the route/* interfaces +.\" FIXME document them all +.SS Ioctls +All ioctls described in +.BR socket (7) +apply to +.BR ip . +.\" 2006-04-02, mtk +.\" commented out the following because ipchains is obsolete +.\" .PP +.\" The ioctls to configure firewalling are documented in +.\" .BR ipfw (4) +.\" from the +.\" .B ipchains +.\" package. +.PP +Ioctls to configure generic device parameters are described in +.BR netdevice (7). +.\" FIXME Add a discussion of multicasting +.SH ERRORS +.\" FIXME document all errors. +.\" We should really fix the kernels to give more uniform +.\" error returns (ENOMEM vs ENOBUFS, EPERM vs EACCES etc.) +.TP +.B EACCES +The user tried to execute an operation without the necessary permissions. +These include: +sending a packet to a broadcast address without having the +.B SO_BROADCAST +flag set; +sending a packet via a +.I prohibit +route; +modifying firewall settings without superuser privileges (the +.B CAP_NET_ADMIN +capability); +binding to a privileged port without superuser privileges (the +.B CAP_NET_BIND_SERVICE +capability). +.TP +.B EADDRINUSE +Tried to bind to an address already in use. +.TP +.B EADDRNOTAVAIL +A nonexistent interface was requested or the requested source +address was not local. +.TP +.B EAGAIN +Operation on a nonblocking socket would block. +.TP +.B EALREADY +An connection operation on a nonblocking socket is already in progress. +.TP +.B ECONNABORTED +A connection was closed during an +.BR accept (2). +.TP +.B EHOSTUNREACH +No valid routing table entry matches the destination address. +This error can be caused by a ICMP message from a remote router or +for the local routing table. +.TP +.B EINVAL +Invalid argument passed. +For send operations this can be caused by sending to a +.I blackhole +route. +.TP +.B EISCONN +.BR connect (2) +was called on an already connected socket. +.TP +.B EMSGSIZE +Datagram is bigger than an MTU on the path and it cannot be fragmented. +.TP +.BR ENOBUFS ", " ENOMEM +Not enough free memory. +This often means that the memory allocation is limited by the socket +buffer limits, not by the system memory, but this is not 100% consistent. +.TP +.B ENOENT +.B SIOCGSTAMP +was called on a socket where no packet arrived. +.TP +.B ENOPKG +A kernel subsystem was not configured. +.TP +.BR ENOPROTOOPT " and " EOPNOTSUPP +Invalid socket option passed. +.TP +.B ENOTCONN +The operation is only defined on a connected socket, but the socket wasn't +connected. +.TP +.B EPERM +User doesn't have permission to set high priority, change configuration, +or send signals to the requested process or group. +.TP +.B EPIPE +The connection was unexpectedly closed or shut down by the other end. +.TP +.B ESOCKTNOSUPPORT +The socket is not configured or an unknown socket type was requested. +.PP +Other errors may be generated by the overlaying protocols; see +.BR tcp (7), +.BR raw (7), +.BR udp (7) +and +.BR socket (7). +.SH NOTES +.BR IP_MTU , +.BR IP_MTU_DISCOVER , +.BR IP_PKTINFO , +.B IP_RECVERR +and +.B IP_ROUTER_ALERT +are Linux-specific and should not be used in +programs intended to be portable. +.\" IP_PASSSEC is Linux-specific +.\" IP_TRANSPARENT is Linux-specific +.\" IP_FREEBIND is Linux-specific +.\" IP_XFRM_POLICY is Linux-specific +.\" IP_IPSEC_POLICY is a nonstandard extension, also present on some BSDs +Be very careful with the +.B SO_BROADCAST +option \- it is not privileged in Linux. +It is easy to overload the network +with careless broadcasts. +For new application protocols +it is better to use a multicast group instead of broadcasting. +Broadcasting is discouraged. +.PP +Some other BSD sockets implementations provide +.B IP_RCVDSTADDR +and +.B IP_RECVIF +socket options to get the destination address and the interface of +received datagrams. +Linux has the more general +.B IP_PKTINFO +for the same task. +.PP +Some BSD sockets implementations also provide an +.B IP_RECVTTL +option, but an ancillary message with type +.B IP_RECVTTL +is passed with the incoming packet. +This is different from the +.B IP_TTL +option used in Linux. +.PP +Using +.B SOL_IP +socket options level isn't portable, BSD-based stacks use +.B IPPROTO_IP +level. +.SS Compatibility +For compatibility with Linux 2.0, the obsolete +.BI "socket(AF_INET, SOCK_PACKET, " protocol ) +syntax is still supported to open a +.BR packet (7) +socket. +This is deprecated and should be replaced by +.BI "socket(AF_PACKET, SOCK_RAW, " protocol ) +instead. +The main difference is the new +.I sockaddr_ll +address structure for generic link layer information instead of the old +.BR sockaddr_pkt . +.SH BUGS +There are too many inconsistent error values. +.PP +The ioctls to configure IP-specific interface options and ARP tables are +not described. +.PP +Some versions of glibc forget to declare +.IR in_pktinfo . +Workaround currently is to copy it into your program from this man page. +.PP +Receiving the original destination address with +.B MSG_ERRQUEUE +in +.I msg_name +by +.BR recvmsg (2) +does not work in some 2.2 kernels. +.\" .SH AUTHORS +.\" This man page was written by Andi Kleen. +.SH "SEE ALSO" +.BR recvmsg (2), +.BR sendmsg (2), +.BR byteorder (3), +.BR ipfw (4), +.BR capabilities (7), +.BR netlink (7), +.BR raw (7), +.BR socket (7), +.BR tcp (7), +.BR udp (7) +.PP +RFC\ 791 for the original IP specification. +.br +RFC\ 1122 for the IPv4 host requirements. +.br +RFC\ 1812 for the IPv4 router requirements. +.\" FIXME autobind INADDR REUSEADDR diff --git a/original/man7/ipv6.7 b/original/man7/ipv6.7 new file mode 100644 index 00000000..98b2fb02 --- /dev/null +++ b/original/man7/ipv6.7 @@ -0,0 +1,327 @@ +.\" This man page is Copyright (C) 2000 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. +.\" $Id: ipv6.7,v 1.3 2000/12/20 18:10:31 ak Exp $ +.TH IPV6 7 2009-02-28 "Linux" "Linux Programmer's Manual" +.SH NAME +ipv6, AF_INET6 \- Linux IPv6 protocol implementation +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.IB tcp6_socket " = socket(AF_INET6, SOCK_STREAM, 0);" +.br +.IB raw6_socket " = socket(AF_INET6, SOCK_RAW, " protocol ");" +.br +.IB udp6_socket " = socket(AF_INET6, SOCK_DGRAM, " protocol ");" +.SH DESCRIPTION +Linux 2.2 optionally implements the Internet Protocol, version 6. +This man page contains a description of the IPv6 basic API as +implemented by the Linux kernel and glibc 2.1. +The interface +is based on the BSD sockets interface; see +.BR socket (7). +.PP +The IPv6 API aims to be mostly compatible with the +IPv4 API (see +.BR ip (7)). +Only differences are described in this man page. +.PP +To bind an +.B AF_INET6 +socket to any process, the local address should be copied from the +.I in6addr_any +variable which has +.I in6_addr +type. +In static initializations, +.B IN6ADDR_ANY_INIT +may also be used, which expands to a constant expression. +Both of them are in network byte order. +.PP +The IPv6 loopback address (::1) is available in the global +.I in6addr_loopback +variable. +For initializations, +.B IN6ADDR_LOOPBACK_INIT +should be used. +.PP +IPv4 connections can be handled with the v6 API by using the +v4-mapped-on-v6 address type; +thus a program only needs to support this API type to +support both protocols. +This is handled transparently by the address +handling functions in the C library. +.PP +IPv4 and IPv6 share the local port space. +When you get an IPv4 connection +or packet to a IPv6 socket, its source address will be mapped +to v6 and it will be mapped to v6. +.SS "Address Format" +.in +4n +.nf +struct sockaddr_in6 { + sa_family_t sin6_family; /* AF_INET6 */ + in_port_t sin6_port; /* port number */ + uint32_t sin6_flowinfo; /* IPv6 flow information */ + struct in6_addr sin6_addr; /* IPv6 address */ + uint32_t sin6_scope_id; /* Scope ID (new in 2.4) */ +}; + +struct in6_addr { + unsigned char s6_addr[16]; /* IPv6 address */ +}; +.fi +.in +.sp +.I sin6_family +is always set to +.BR AF_INET6 ; +.I sin6_port +is the protocol port (see +.I sin_port +in +.BR ip (7)); +.I sin6_flowinfo +is the IPv6 flow identifier; +.I sin6_addr +is the 128-bit IPv6 address. +.I sin6_scope_id +is an ID depending on the scope of the address. +It is new in Linux 2.4. +Linux only supports it for link scope addresses, in that case +.I sin6_scope_id +contains the interface index (see +.BR netdevice (7)) +.PP +IPv6 supports several address types: unicast to address a single +host, multicast to address a group of hosts, +anycast to address the nearest member of a group of hosts +(not implemented in Linux), IPv4-on-IPv6 to +address a IPv4 host, and other reserved address types. +.PP +The address notation for IPv6 is a group of 16 2-digit hexadecimal +numbers, separated with a \(aq:\(aq. +\&"::" stands for a string of 0 bits. +Special addresses are ::1 for loopback and ::FFFF: +for IPv4-mapped-on-IPv6. +.PP +The port space of IPv6 is shared with IPv4. +.SS "Socket Options" +IPv6 supports some protocol-specific socket options that can be set with +.BR setsockopt (2) +and read with +.BR getsockopt (2). +The socket option level for IPv6 is +.BR IPPROTO_IPV6 . +A boolean integer flag is zero when it is false, otherwise true. +.TP +.B IPV6_ADDRFORM +Turn an +.B AF_INET6 +socket into a socket of a different address family. +Only +.B AF_INET +is currently supported for that. +It is only allowed for IPv6 sockets +that are connected and bound to a v4-mapped-on-v6 address. +The argument is a pointer to an integer containing +.BR AF_INET . +This is useful to pass v4-mapped sockets as file descriptors to +programs that don't know how to deal with the IPv6 API. +.TP +.B IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP +Control membership in multicast groups. +Argument is a pointer to a +.I struct ipv6_mreq +structure. +.\" FIXME IPV6_CHECKSUM is not documented, and probably should be +.\" FIXME IPV6_JOIN_ANYCAST is not documented, and probably should be +.\" FIXME IPV6_LEAVE_ANYCAST is not documented, and probably should be +.\" FIXME IPV6_RECVPKTINFO is not documented, and probably should be +.\" FIXME IPV6_2292PKTINFO is not documented, and probably should be +.\" FIXME there are probably many other IPV6_* socket options that +.\" should be documented +.TP +.B IPV6_MTU +Set the MTU to be used for the socket. +The MTU is limited by the device +MTU or the path mtu when path mtu discovery is enabled. +Argument is a pointer to integer. +.TP +.B IPV6_MTU_DISCOVER +Control path mtu discovery on the socket. +See +.B IP_MTU_DISCOVER +in +.BR ip (7) +for details. +.TP +.B IPV6_MULTICAST_HOPS +Set the multicast hop limit for the socket. +Argument is a pointer to an +integer. +\-1 in the value means use the route default, otherwise it should be +between 0 and 255. +.TP +.B IPV6_MULTICAST_IF +Set the device for outgoing multicast packets on the socket. +This is only allowed +for +.B SOCK_DGRAM +and +.B SOCK_RAW +socket. +The argument is a pointer to an interface index (see +.BR netdevice (7)) +in an integer. +.TP +.B IPV6_MULTICAST_LOOP +Control whether the socket sees multicast packets that it has send itself. +Argument is a pointer to boolean. +.TP +.B IPV6_PKTINFO +Set delivery of the +.B IPV6_PKTINFO +control message on incoming datagrams. +Only allowed for +.B SOCK_DGRAM +or +.B SOCK_RAW +sockets. +Argument is a pointer to a boolean value in an integer. +.TP +.nh +.B IPV6_RTHDR, IPV6_AUTHHDR, IPV6_DSTOPS, IPV6_HOPOPTS, IPV6_FLOWINFO, IPV6_HOPLIMIT +.hy +Set delivery of control messages for incoming datagrams containing +extension headers from the received packet. +.B IPV6_RTHDR +delivers the routing header, +.B IPV6_AUTHHDR +delivers the authentication header, +.B IPV6_DSTOPTS +delivers the destination options, +.B IPV6_HOPOPTS +delivers the hop options, +.B IPV6_FLOWINFO +delivers an integer containing the flow ID, +.B IPV6_HOPLIMIT +delivers an integer containing the hop count of the packet. +The control messages have the same type as the socket option. +All these header options can also be set for outgoing packets +by putting the appropriate control message into the control buffer of +.BR sendmsg (2). +Only allowed for +.B SOCK_DGRAM +or +.B SOCK_RAW +sockets. +Argument is a pointer to a boolean value. +.TP +.B IPV6_RECVERR +Control receiving of asynchronous error options. +See +.B IP_RECVERR +in +.BR ip (7) +for details. +Argument is a pointer to boolean. +.TP +.B IPV6_ROUTER_ALERT +Pass forwarded packets containing a router alert hop-by-hop option to +this socket. +Only allowed for SOCK_RAW sockets. +The tapped packets are not forwarded by the kernel, it is the +user's responsibility to send them out again. +Argument is a pointer to an integer. +A positive integer indicates a router alert option value to intercept. +Packets carrying a router alert option with a value field containing +this integer will be delivered to the socket. +A negative integer disables delivery of packets with router alert options +to this socket. +.TP +.B IPV6_UNICAST_HOPS +Set the unicast hop limit for the socket. +Argument is a pointer to an integer. +\-1 in the value means use the route default, +otherwise it should be between 0 and 255. +.TP +.BR IPV6_V6ONLY " (since Linux 2.4.21 and 2.6)" +.\" See RFC 3493 +If this flag is set to true (nonzero), then the socket is restricted +to sending and receiving IPv6 packets only. +In this case, an IPv4 and an IPv6 application can bind +to a single port at the same time. + +If this flag is set to false (zero), +then the socket can be used to send and receive packets +to and from an IPv6 address or an IPv4-mapped IPv6 address. + +The argument is a pointer to a boolean value in an integer. + +The default value for this flag is defined by the contents of the file +.IR /proc/sys/net/ipv6/bindv6only . +The default value for that file is 0 (false). +.\" FLOWLABEL_MGR, FLOWINFO_SEND +.SH VERSIONS +The older +.I libinet6 +libc5 based IPv6 API implementation for Linux is not described here +and may vary in details. +.PP +Linux 2.4 will break binary compatibility for the +.I sockaddr_in6 +for 64-bit +hosts by changing the alignment of +.I in6_addr +and adding an additional +.I sin6_scope_id +field. +The kernel interfaces stay compatible, but a program including +.I sockaddr_in6 +or +.I in6_addr +into other structures may not be. +This is not +a problem for 32-bit hosts like i386. +.PP +The +.I sin6_flowinfo +field is new in Linux 2.4. +It is transparently passed/read by the kernel +when the passed address length contains it. +Some programs that pass a longer address buffer and then +check the outgoing address length may break. +.SH "NOTES" +The +.I sockaddr_in6 +structure is bigger than the generic +.IR sockaddr . +Programs that assume that all address types can be stored safely in a +.I struct sockaddr +need to be changed to use +.I struct sockaddr_storage +for that instead. +.SH BUGS +The IPv6 extended API as in RFC\ 2292 is currently only partly +implemented; +although the 2.2 kernel has near complete support for receiving options, +the macros for generating IPv6 options are missing in glibc 2.1. +.PP +IPSec support for EH and AH headers is missing. +.PP +Flow label management is not complete and not documented here. +.PP +This man page is not complete. +.SH "SEE ALSO" +.BR cmsg (3), +.BR ip (7) +.PP +RFC\ 2553: IPv6 BASIC API. +Linux tries to be compliant to this. +.PP +RFC\ 2460: IPv6 specification. diff --git a/original/man7/iso-8859-1.7 b/original/man7/iso-8859-1.7 new file mode 100644 index 00000000..1969dfb2 --- /dev/null +++ b/original/man7/iso-8859-1.7 @@ -0,0 +1 @@ +.so man7/iso_8859-1.7 diff --git a/original/man7/iso-8859-10.7 b/original/man7/iso-8859-10.7 new file mode 100644 index 00000000..9b4658f2 --- /dev/null +++ b/original/man7/iso-8859-10.7 @@ -0,0 +1 @@ +.so man7/iso_8859-10.7 diff --git a/original/man7/iso-8859-11.7 b/original/man7/iso-8859-11.7 new file mode 100644 index 00000000..cbd4cfe7 --- /dev/null +++ b/original/man7/iso-8859-11.7 @@ -0,0 +1 @@ +.so man7/iso_8859-11.7 diff --git a/original/man7/iso-8859-13.7 b/original/man7/iso-8859-13.7 new file mode 100644 index 00000000..8ad23352 --- /dev/null +++ b/original/man7/iso-8859-13.7 @@ -0,0 +1 @@ +.so man7/iso_8859-13.7 diff --git a/original/man7/iso-8859-14.7 b/original/man7/iso-8859-14.7 new file mode 100644 index 00000000..4aa555db --- /dev/null +++ b/original/man7/iso-8859-14.7 @@ -0,0 +1 @@ +.so man7/iso_8859-14.7 diff --git a/original/man7/iso-8859-15.7 b/original/man7/iso-8859-15.7 new file mode 100644 index 00000000..a4095d75 --- /dev/null +++ b/original/man7/iso-8859-15.7 @@ -0,0 +1 @@ +.so man7/iso_8859-15.7 diff --git a/original/man7/iso-8859-16.7 b/original/man7/iso-8859-16.7 new file mode 100644 index 00000000..b9c8e918 --- /dev/null +++ b/original/man7/iso-8859-16.7 @@ -0,0 +1 @@ +.so man7/iso_8859-16.7 diff --git a/original/man7/iso-8859-2.7 b/original/man7/iso-8859-2.7 new file mode 100644 index 00000000..da36668d --- /dev/null +++ b/original/man7/iso-8859-2.7 @@ -0,0 +1 @@ +.so man7/iso_8859-2.7 diff --git a/original/man7/iso-8859-3.7 b/original/man7/iso-8859-3.7 new file mode 100644 index 00000000..75e42ce3 --- /dev/null +++ b/original/man7/iso-8859-3.7 @@ -0,0 +1 @@ +.so man7/iso_8859-3.7 diff --git a/original/man7/iso-8859-4.7 b/original/man7/iso-8859-4.7 new file mode 100644 index 00000000..15a829eb --- /dev/null +++ b/original/man7/iso-8859-4.7 @@ -0,0 +1 @@ +.so man7/iso_8859-4.7 diff --git a/original/man7/iso-8859-5.7 b/original/man7/iso-8859-5.7 new file mode 100644 index 00000000..1f20320e --- /dev/null +++ b/original/man7/iso-8859-5.7 @@ -0,0 +1 @@ +.so man7/iso_8859-5.7 diff --git a/original/man7/iso-8859-6.7 b/original/man7/iso-8859-6.7 new file mode 100644 index 00000000..edcafdf6 --- /dev/null +++ b/original/man7/iso-8859-6.7 @@ -0,0 +1 @@ +.so man7/iso_8859-6.7 diff --git a/original/man7/iso-8859-7.7 b/original/man7/iso-8859-7.7 new file mode 100644 index 00000000..951384c9 --- /dev/null +++ b/original/man7/iso-8859-7.7 @@ -0,0 +1 @@ +.so man7/iso_8859-7.7 diff --git a/original/man7/iso-8859-8.7 b/original/man7/iso-8859-8.7 new file mode 100644 index 00000000..07cf2162 --- /dev/null +++ b/original/man7/iso-8859-8.7 @@ -0,0 +1 @@ +.so man7/iso_8859-8.7 diff --git a/original/man7/iso-8859-9.7 b/original/man7/iso-8859-9.7 new file mode 100644 index 00000000..0fcc7d46 --- /dev/null +++ b/original/man7/iso-8859-9.7 @@ -0,0 +1 @@ +.so man7/iso_8859-9.7 diff --git a/original/man7/iso_8859-1.7 b/original/man7/iso_8859-1.7 new file mode 100644 index 00000000..b2180f03 --- /dev/null +++ b/original/man7/iso_8859-1.7 @@ -0,0 +1,176 @@ +'\" t +.\" Copyright 1993-1995 Daniel Quinlan (quinlan@yggdrasil.com) +.\" +.\" 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. +.\" +.\" Slightly rearranged, aeb, 950713 +.\" Updated, dpo, 990531 +.TH ISO_8859-1 7 1999-05-31 "Linux" "Linux Programmer's Manual" +.nh +.SH NAME +iso_8859-1 \- the ISO 8859-1 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +Especially important is +ISO 8859-1, the "Latin Alphabet No. 1", which has become widely +implemented and may already be seen as the de-facto standard ASCII +replacement. +.P +ISO 8859-1 supports the following languages: Afrikaans, Basque, +Catalan, Danish, Dutch, English, Faeroese, Finnish, French, Galician, +German, Icelandic, Irish, Italian, Norwegian, Portuguese, Scottish, +Spanish, and Swedish. +.P +Note that the ISO 8859-1 characters are also the first 256 characters +of ISO 10646 (Unicode). +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-1 Characters" +The following table displays the characters in ISO 8859-1 (Latin-1), +which are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 +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 ª 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 +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 ¼ 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 +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 +.TE +.SH "SEE ALSO" +.BR ascii (7), +.BR iso_8859-15 (7) diff --git a/original/man7/iso_8859-10.7 b/original/man7/iso_8859-10.7 new file mode 100644 index 00000000..8a7e40ac --- /dev/null +++ b/original/man7/iso_8859-10.7 @@ -0,0 +1,166 @@ +'\" t -*- coding: ISO-8859-10 -*- +.\" 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. +.TH ISO_8859-10 7 2009-01-15 "Linux" "Linux Programmer's Manual" +.SH NAME +iso_8859-10 \- the ISO 8859-10 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +ISO 8859-10 encodes the +characters used in Nordic languages. +.\" (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!). +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-10 Characters" +The following table displays the characters in ISO 8859-10, which +are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 ca Ë 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 219 dc Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 220 dd Ý LATIN CAPITAL LETTER Y WITH ACUTE +336 221 de Þ LATIN CAPITAL LETTER THORN (Icelandic) +337 222 df ß LATIN SMALL LETTER SHARP S (German) +340 223 e0 à LATIN SMALL LETTER A WITH MACRON +341 224 e1 á LATIN SMALL LETTER A WITH ACUTE +342 225 e2 â LATIN SMALL LETTER A WITH CIRCUMFLEX +343 226 e3 ã LATIN SMALL LETTER A WITH TILDE +344 227 e4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 228 e5 å LATIN SMALL LETTER A WITH RING ABOVE +346 229 e6 æ LATIN SMALL LETTER AE +347 230 e7 ç LATIN SMALL LETTER I WITH OGONEK +350 231 e8 è LATIN SMALL LETTER C WITH CARON +351 232 e9 é LATIN SMALL LETTER E WITH ACUTE +352 233 ea ê LATIN SMALL LETTER E WITH OGONEK +353 234 eb ë LATIN SMALL LETTER E WITH DIAERESIS +354 235 ec ì LATIN SMALL LETTER E WITH DOT ABOVE +355 236 ed í LATIN SMALL LETTER I WITH ACUTE +356 237 ee î LATIN SMALL LETTER I WITH CIRCUMFLEX +357 238 ef ï LATIN SMALL LETTER I WITH DIAERESIS +360 239 f0 ð LATIN SMALL LETTER ETH (Icelandic) +361 240 f1 ñ LATIN SMALL LETTER N WITH CEDILLA +362 241 f2 ò LATIN SMALL LETTER O WITH MACRON +363 242 f3 ó LATIN SMALL LETTER O WITH ACUTE +364 243 f4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX +365 244 f5 õ LATIN SMALL LETTER O WITH TILDE +366 245 f6 ö LATIN SMALL LETTER O WITH DIAERESIS +367 246 f7 ÷ LATIN SMALL LETTER U WITH TILDE +370 247 f8 ø LATIN SMALL LETTER O WITH STROKE +371 248 f9 ù LATIN SMALL LETTER U WITH OGONEK +372 249 fa ú LATIN SMALL LETTER U WITH ACUTE +373 250 fb û LATIN SMALL LETTER U WITH CIRCUMFLEX +374 251 fc ü LATIN SMALL LETTER U WITH DIAERESIS +375 252 fd ý LATIN SMALL LETTER Y WITH ACUTE +376 253 fe þ LATIN SMALL LETTER THORN (Icelandic) +377 254 ff ÿ LATIN SMALL LETTER KRA (Greenlandic) +.TE +.SH NOTES +ISO 8859-10 is also known as Latin-6. +.SH "SEE ALSO" +.BR ascii (7) diff --git a/original/man7/iso_8859-11.7 b/original/man7/iso_8859-11.7 new file mode 100644 index 00000000..023a3049 --- /dev/null +++ b/original/man7/iso_8859-11.7 @@ -0,0 +1,160 @@ +'\" t -*- coding: ISO-8859-11 -*- +.\" 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. +.\" +.TH ISO_8859-11 7 2009-01-28 "Linux" "Linux Programmer's Manual" +.SH NAME +iso_8859-11 \- the ISO 8859-11 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +ISO 8859-11 encodes the characters used in the Thai language. +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-11 Characters" +The following table displays the characters in ISO 8859-11, which +are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 222 df ß THAI CURRENCY SYMBOL BAHT +340 223 e0 à THAI CHARACTER SARA E +341 224 e1 á THAI CHARACTER SARA AE +342 225 e2 â THAI CHARACTER SARA O +343 226 e3 ã THAI CHARACTER SARA AI MAIMUAN +344 227 e4 ä THAI CHARACTER SARA AI MAIMALAI +345 228 e5 å THAI CHARACTER LAKKHANGYAO +346 229 e6 æ THAI CHARACTER MAIYAMOK +347 230 e7 ç THAI CHARACTER MAITAIKHU +350 231 e8 è THAI CHARACTER MAI EK +351 232 e9 é THAI CHARACTER MAI THO +352 233 ea ê THAI CHARACTER MAI TRI +353 234 eb ë THAI CHARACTER MAI CHATTAWA +354 235 ec ì THAI CHARACTER THANTHAKHAT +355 236 ed í THAI CHARACTER NIKHAHIT +356 237 ee î THAI CHARACTER YAMAKKAN +357 238 ef ï THAI CHARACTER FONGMAN +360 239 f0 ð THAI DIGIT ZERO +361 240 f1 ñ THAI DIGIT ONE +362 241 f2 ò THAI DIGIT TWO +363 242 f3 ó THAI DIGIT THREE +364 243 f4 ô THAI DIGIT FOUR +365 244 f5 õ THAI DIGIT FIVE +366 245 f6 ö THAI DIGIT SIX +367 246 f7 ÷ THAI DIGIT SEVEN +370 247 f8 ø THAI DIGIT EIGHT +371 248 f9 ù THAI DIGIT NINE +372 249 fa ú THAI CHARACTER ANGKHANKHU +373 250 fb û THAI CHARACTER KHOMUT +.TE +.SH NOTES +ISO 8859-11 is the same as TIS (Thai Industrial Standard) 620-2253, +commonly known as TIS-620, except for the character in position a0: +ISO 8859-11 defines this as "nonbreaking space", +while TIS 620 leaves it undefined. +.SH "SEE ALSO" +.BR ascii (7) diff --git a/original/man7/iso_8859-13.7 b/original/man7/iso_8859-13.7 new file mode 100644 index 00000000..d05ee069 --- /dev/null +++ b/original/man7/iso_8859-13.7 @@ -0,0 +1,164 @@ +'\" t -*- coding: ISO-8859-7 -*- +.\" 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. +.TH ISO_8859-13 7 2009-01-15 "Linux" "Linux Programmer's Manual" +.SH NAME +iso_8859-13 \- the ISO 8859-13 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +ISO 8859-13 encodes the characters used in Baltic Rim languages. +.\" In my system with glibc-2.8-20080929 is used for +.\" Lithuanian, Latvian and the Maori language in New Zealand. +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-13 Characters" +The following table displays the characters in ISO 8859-13, which +are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 219 dc Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 220 dd Ý LATIN CAPITAL LETTER Z WITH DOT ABOVE +336 221 de Þ LATIN CAPITAL LETTER Z WITH CARON +337 222 df ß LATIN SMALL LETTER SHARP S +340 223 e0 à LATIN SMALL LETTER A WITH OGONEK +341 224 e1 á LATIN SMALL LETTER I WITH OGONEK +342 225 e2 â LATIN SMALL LETTER A WITH MACRON +343 226 e3 ã LATIN SMALL LETTER C WITH ACUTE +344 227 e4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 228 e5 å LATIN SMALL LETTER A WITH RING ABOVE +346 229 e6 æ LATIN SMALL LETTER E WITH OGONEK +347 230 e7 ç LATIN SMALL LETTER E WITH MACRON +350 231 e8 è LATIN SMALL LETTER C WITH CARON +351 232 e9 é LATIN SMALL LETTER E WITH ACUTE +352 233 ea ê LATIN SMALL LETTER Z WITH ACUTE +353 234 eb ë LATIN SMALL LETTER E WITH DOT ABOVE +354 235 ec ì LATIN SMALL LETTER G WITH CEDILLA +355 236 ed í LATIN SMALL LETTER K WITH CEDILLA +356 237 ee î LATIN SMALL LETTER I WITH MACRON +357 238 ef ï LATIN SMALL LETTER L WITH CEDILLA +360 239 f0 ð LATIN SMALL LETTER S WITH CARON +361 240 f1 ñ LATIN SMALL LETTER N WITH ACUTE +362 241 f2 ò LATIN SMALL LETTER N WITH CEDILLA +363 242 f3 ó LATIN SMALL LETTER O WITH ACUTE +364 243 f4 ô LATIN SMALL LETTER O WITH MACRON +365 244 f5 õ LATIN SMALL LETTER O WITH TILDE +366 245 f6 ö LATIN SMALL LETTER O WITH DIAERESIS +367 246 f7 ÷ DIVISION SIGN +370 247 f8 ø LATIN SMALL LETTER U WITH OGONEK +371 248 f9 ù LATIN SMALL LETTER L WITH STROKE +372 249 fa ú LATIN SMALL LETTER S WITH ACUTE +373 250 fb û LATIN SMALL LETTER U WITH MACRON +374 251 fc ü LATIN SMALL LETTER U WITH DIAERESIS +375 252 fd ý LATIN SMALL LETTER Z WITH DOT ABOVE +376 253 fe þ LATIN SMALL LETTER Z WITH CARON +377 254 ff ÿ RIGHT SINGLE QUOTATION MARK +.TE +.SH NOTES +ISO 8859-13 is also known as Latin-7. +.SH "SEE ALSO" +.BR ascii (7) diff --git a/original/man7/iso_8859-14.7 b/original/man7/iso_8859-14.7 new file mode 100644 index 00000000..9b21876d --- /dev/null +++ b/original/man7/iso_8859-14.7 @@ -0,0 +1,162 @@ +'\" t -*- coding: ISO-8859-14 -*- +.\" 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. +.TH ISO_8859-14 7 2009-01-15 "Linux" "Linux Programmer's Manual" +.SH NAME +iso_8859-14 \- the ISO 8859-14 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +ISO 8859-14 encodes the characters used in Celtic languages. +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-14 Characters" +The following table displays the characters in ISO 8859-14, which +are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 219 dc Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 220 dd Ý LATIN CAPITAL LETTER Y WITH ACUTE +336 221 de Þ LATIN CAPITAL LETTER Y WITH CIRCUMFLEX +337 222 df ß LATIN SMALL LETTER SHARP S +340 223 e0 à LATIN SMALL LETTER A WITH GRAVE +341 224 e1 á LATIN SMALL LETTER A WITH ACUTE +342 225 e2 â LATIN SMALL LETTER A WITH CIRCUMFLEX +343 226 e3 ã LATIN SMALL LETTER A WITH TILDE +344 227 e4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 228 e5 å LATIN SMALL LETTER A WITH RING ABOVE +346 229 e6 æ LATIN SMALL LETTER AE +347 230 e7 ç LATIN SMALL LETTER C WITH CEDILLA +350 231 e8 è LATIN SMALL LETTER E WITH GRAVE +351 232 e9 é LATIN SMALL LETTER E WITH ACUTE +352 233 ea ê LATIN SMALL LETTER E WITH CIRCUMFLEX +353 234 eb ë LATIN SMALL LETTER E WITH DIAERESIS +354 235 ec ì LATIN SMALL LETTER I WITH GRAVE +355 236 ed í LATIN SMALL LETTER I WITH ACUTE +356 237 ee î LATIN SMALL LETTER I WITH CIRCUMFLEX +357 238 ef ï LATIN SMALL LETTER I WITH DIAERESIS +360 239 f0 ð LATIN SMALL LETTER W WITH CIRCUMFLEX +361 240 f1 ñ LATIN SMALL LETTER N WITH TILDE +362 241 f2 ò LATIN SMALL LETTER O WITH GRAVE +363 242 f3 ó LATIN SMALL LETTER O WITH ACUTE +364 243 f4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX +365 244 f5 õ LATIN SMALL LETTER O WITH TILDE +366 245 f6 ö LATIN SMALL LETTER O WITH DIAERESIS +367 246 f7 ÷ LATIN SMALL LETTER T WITH DOT ABOVE +370 247 f8 ø LATIN SMALL LETTER O WITH STROKE +371 248 f9 ù LATIN SMALL LETTER U WITH GRAVE +372 249 fa ú LATIN SMALL LETTER U WITH ACUTE +373 250 fb û LATIN SMALL LETTER U WITH CIRCUMFLEX +374 251 fc ü LATIN SMALL LETTER U WITH DIAERESIS +375 252 fd ý LATIN SMALL LETTER Y WITH ACUTE +376 253 fe þ LATIN SMALL LETTER Y WITH CIRCUMFLEX +377 254 ff ÿ LATIN SMALL LETTER Y WITH DIAERESIS +.TE +.SH NOTES +ISO 8859-14 is also known as Latin-8. +.SH "SEE ALSO" +.BR ascii (7) diff --git a/original/man7/iso_8859-15.7 b/original/man7/iso_8859-15.7 new file mode 100644 index 00000000..3ee5cdbc --- /dev/null +++ b/original/man7/iso_8859-15.7 @@ -0,0 +1,176 @@ +'\" t -*- coding: ISO-8859-15 -*- +.\" Copyright 1993-1995 Daniel Quinlan (quinlan@yggdrasil.com) +.\" Copyright 1999 Dimitri Papadopoulos (dpo@club-internet.fr) +.\" +.\" 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. +.TH ISO_8859-15 7 1999-05-31 "Linux" "Linux Programmer's Manual" +.nh +.SH NAME +iso_8859-15 \- the ISO 8859-15 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +Especially important is +ISO 8859-1, the "Latin Alphabet No. 1", which has become widely +implemented and may already be seen as the de-facto standard ASCII +replacement. +However, it lacks the EURO symbol and does not fully +cover Finnish and French. +ISO 8859-15 is a modification of ISO 8859-1 +that covers these needs. +.P +ISO 8859-15 supports the following languages: Albanian, Basque, Breton, +Catalan, Danish, Dutch, English, Estonian, Faroese, Finnish, French, +Frisian, Galician, German, Greenlandic, Icelandic, Irish Gaelic, +Italian, Latin, Luxemburgish, Norwegian, Portuguese, Rhaeto-Romanic, +Scottish Gaelic, Spanish, and Swedish. +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-15 Characters" +The following table displays the characters in ISO 8859-15 (Latin-9), +which are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 +242 162 A2 ¢ CENT SIGN +243 163 A3 £ POUND SIGN +244 164 A4 ¤ EURO SIGN +245 165 A5 ¥ YEN SIGN +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 +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 ´ 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 +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 +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 +.TE +.SH "SEE ALSO" +.BR ascii (7), +.BR iso_8859-1 (7) diff --git a/original/man7/iso_8859-16.7 b/original/man7/iso_8859-16.7 new file mode 100644 index 00000000..dd92ba11 --- /dev/null +++ b/original/man7/iso_8859-16.7 @@ -0,0 +1,178 @@ +'\" t -*- coding: ISO-8859-16 -*- +.\" 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 +.\" 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. +.\" +.TH ISO_8859-16 7 2003-03-05 "Linux" "Linux Programmer's Manual" +.nh +.SH NAME +iso_8859-16 \- the ISO 8859-16 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +ISO 8859-16, the "Latin +Alphabet No. 10" is used to encode Central and Eastern European Latin +characters and is not implemented yet by any program vendors. +.P +ISO 8859-16 supports the following languages: Albanian, Bosnian, +Croatian, English, Finnish, German, Hungarian, Irish, Polish, +Romanian, Slovenian and Serbian. +.P +Also note that the following Cyrillic-based languages have one-to-one +transliterations to Latin 10: Macedonian and Serbian. +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-16 Characters" +The following table displays the characters in ISO 8859-16 (Latin-10), +which are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 +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 +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 +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 +.TE +.SH "SEE ALSO" +.BR ascii (7), +.BR iso_8859-1 (7), +.BR iso_8859-15 (7), +.BR iso_8859-2 (7) +.P +Additional information: +.I ISO 8859-16 (Latin 10) Resources +(http://bucovina.chem.tue.nl/fonturi/index-en.html). diff --git a/original/man7/iso_8859-2.7 b/original/man7/iso_8859-2.7 new file mode 100644 index 00000000..fd2ee376 --- /dev/null +++ b/original/man7/iso_8859-2.7 @@ -0,0 +1,180 @@ +'\" t -*- coding: ISO-8859-2 -*- +.\" Copyright 1999 Roman Maurer (roman.maurer@hermes.si) +.\" Copyright 1993-1995 Daniel Quinlan (quinlan@yggdrasil.com) +.\" +.\" 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. +.\" +.\" Slightly rearranged, aeb, 950713 +.\" Updated, dpo, 990531 +.TH ISO_8859-2 7 2007-11-25 "Linux" "Linux Programmer's Manual" +.nh +.SH NAME +iso_8859-2 \- the ISO 8859-2 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +ISO 8859-2, the "Latin +Alphabet No. 2" is used to encode Central and Eastern European Latin +characters and is implemented by several program vendors. +.P +ISO 8859-2 supports the following languages: Albanian, Bosnian, +Croatian, Czech, English, Finnish, German, Hungarian, Irish, Polish, +Slovak, Slovenian and Sorbian. +.P +Also note that the following Cyrillic-based languages have one-to-one +transliterations to Latin 2: Macedonian and Serbian. +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-2 Characters" +The following table displays the characters in ISO 8859-2 (Latin-2), +which are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 +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 ­\[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 +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 +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 +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 +.TE +.SH "SEE ALSO" +.BR ascii (7), +.BR iso_8859-1 (7), +.BR iso_8859-16 (7) +.P +Additional information: +.I ISO 8859-2 (Latin 2) Resources +(http://sizif.mf.uni-lj.si/linux/cee/iso8859-2.html). diff --git a/original/man7/iso_8859-3.7 b/original/man7/iso_8859-3.7 new file mode 100644 index 00000000..0ea531af --- /dev/null +++ b/original/man7/iso_8859-3.7 @@ -0,0 +1,158 @@ +'\" t -*- coding: ISO-8859-3 -*- +.\" 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. +.TH ISO_8859-3 7 2009-01-15 "Linux" "Linux Programmer's Manual" +.nh +.SH NAME +iso_8859-3 \- the ISO 8859-3 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +ISO 8859-3 encodes the characters used in Southeast European languages. +.\" (Though in my system with glibc-2.8-20080929 +.\" I found only mt_MT (Malta) using this charset). +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-3 Characters" +The following table displays the characters in ISO 8859-3, which +are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 219 dc Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 220 dd Ý LATIN CAPITAL LETTER U WITH BREVE +336 221 de Þ LATIN CAPITAL LETTER S WITH CIRCUMFLEX +337 222 df ß LATIN SMALL LETTER SHARP S (German) +340 223 e0 à LATIN SMALL LETTER A WITH GRAVE +341 224 e1 á LATIN SMALL LETTER A WITH ACUTE +342 225 e2 â LATIN SMALL LETTER A WITH CIRCUMFLEX +344 227 e4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 228 e5 å LATIN SMALL LETTER C WITH DOT ABOVE +346 229 e6 æ LATIN SMALL LETTER C WITH CIRCUMFLEX +347 230 e7 ç LATIN SMALL LETTER C WITH CEDILLA +350 231 e8 è LATIN SMALL LETTER E WITH GRAVE +351 232 e9 é LATIN SMALL LETTER E WITH ACUTE +352 233 ea ê LATIN SMALL LETTER E WITH CIRCUMFLEX +353 234 eb ë LATIN SMALL LETTER E WITH DIAERESIS +354 235 ec ì LATIN SMALL LETTER I WITH GRAVE +355 236 ed í LATIN SMALL LETTER I WITH ACUTE +356 237 ee î LATIN SMALL LETTER I WITH CIRCUMFLEX +357 238 ef ï LATIN SMALL LETTER I WITH DIAERESIS +361 240 f1 ñ LATIN SMALL LETTER N WITH TILDE +362 241 f2 ò LATIN SMALL LETTER O WITH GRAVE +363 242 f3 ó LATIN SMALL LETTER O WITH ACUTE +364 243 f4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX +365 244 f5 õ LATIN SMALL LETTER G WITH DOT ABOVE +366 245 f6 ö LATIN SMALL LETTER O WITH DIAERESIS +367 246 f7 ÷ DIVISION SIGN +370 247 f8 ø LATIN SMALL LETTER G WITH CIRCUMFLEX +371 248 f9 ù LATIN SMALL LETTER U WITH GRAVE +372 249 fa ú LATIN SMALL LETTER U WITH ACUTE +373 250 fb û LATIN SMALL LETTER U WITH CIRCUMFLEX +374 251 fc ü LATIN SMALL LETTER U WITH DIAERESIS +375 252 fd ý LATIN SMALL LETTER U WITH BREVE +376 253 fe þ LATIN SMALL LETTER S WITH CIRCUMFLEX +377 254 ff ÿ DOT ABOVE (Mandarin Chinese light tone) +.TE +.SH NOTES +ISO 8859-3 is also known as Latin-3. +.SH "SEE ALSO" +.BR ascii (7) diff --git a/original/man7/iso_8859-4.7 b/original/man7/iso_8859-4.7 new file mode 100644 index 00000000..384eff2e --- /dev/null +++ b/original/man7/iso_8859-4.7 @@ -0,0 +1,161 @@ +'\" t -*- coding: ISO-8859-4 -*- +.\" 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. +.TH ISO_8859-4 7 2009-01-24 "Linux" "Linux Programmer's Manual" +.SH NAME +iso_8859-4 \- the ISO 8859-4 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +ISO 8859-4 encodes the characters used in +Scandinavian and Baltic languages (Latin-4). +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-4 Characters" +The following table displays the characters in ISO 8859-4, which +are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 "SEE ALSO" +.BR ascii (7) diff --git a/original/man7/iso_8859-5.7 b/original/man7/iso_8859-5.7 new file mode 100644 index 00000000..0c636693 --- /dev/null +++ b/original/man7/iso_8859-5.7 @@ -0,0 +1,161 @@ +'\" t -*- coding: ISO-8859-5 -*- +.\" 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. +.TH ISO_8859-5 7 2009-01-15 "Linux" "Linux Programmer's Manual" +.SH NAME +iso_8859-5 \- the ISO 8859-5 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +ISO 8859-5 encodes the Cyrillic alphabet as used in Russian and Macedonian. +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-5 Characters" +The following table displays the characters in ISO 8859-5, which +are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 219 dc Ü CYRILLIC SMALL LETTER EM +335 220 dd Ý CYRILLIC SMALL LETTER EN +336 221 de Þ CYRILLIC SMALL LETTER O +337 222 df ß CYRILLIC SMALL LETTER PE +340 223 e0 à CYRILLIC SMALL LETTER ER +341 224 e1 á CYRILLIC SMALL LETTER ES +342 225 e2 â CYRILLIC SMALL LETTER TE +343 226 e3 ã CYRILLIC SMALL LETTER U +344 227 e4 ä CYRILLIC SMALL LETTER EF +345 228 e5 å CYRILLIC SMALL LETTER HA +346 229 e6 æ CYRILLIC SMALL LETTER TSE +347 230 e7 ç CYRILLIC SMALL LETTER CHE +350 231 e8 è CYRILLIC SMALL LETTER SHA +351 232 e9 é CYRILLIC SMALL LETTER SHCHA +352 233 ea ê CYRILLIC SMALL LETTER HARD SIGN +353 234 eb ë CYRILLIC SMALL LETTER YERU +354 235 ec ì CYRILLIC SMALL LETTER SOFT SIGN +355 236 ed í CYRILLIC SMALL LETTER E +356 237 ee î CYRILLIC SMALL LETTER YU +357 238 ef ï CYRILLIC SMALL LETTER YA +360 239 f0 ð NUMERO SIGN +361 240 f1 ñ CYRILLIC SMALL LETTER IO +362 241 f2 ò CYRILLIC SMALL LETTER DJE (Serbocroatian) +363 242 f3 ó CYRILLIC SMALL LETTER GJE +364 243 f4 ô CYRILLIC SMALL LETTER UKRAINIAN IE +365 244 f5 õ CYRILLIC SMALL LETTER DZE +366 245 f6 ö CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +367 246 f7 ÷ CYRILLIC SMALL LETTER YI (Ukrainian) +370 247 f8 ø CYRILLIC SMALL LETTER JE +371 248 f9 ù CYRILLIC SMALL LETTER LJE +372 249 fa ú CYRILLIC SMALL LETTER NJE +373 250 fb ø CYRILLIC SMALL LETTER TSHE (Serbocroatian) +374 251 fc ü CYRILLIC SMALL LETTER KJE +375 252 fd ý SECTION SIGN +376 253 fe þ CYRILLIC SMALL LETTER SHORT U (Byelorussian) +377 254 ff ÿ CYRILLIC SMALL LETTER DZHE +.TE +.SH "SEE ALSO" +.BR ascii (7), +.BR koi8-r (7) diff --git a/original/man7/iso_8859-6.7 b/original/man7/iso_8859-6.7 new file mode 100644 index 00000000..f75beff9 --- /dev/null +++ b/original/man7/iso_8859-6.7 @@ -0,0 +1,118 @@ +'\" t -*- coding: ISO-8859-6 -*- +.\" 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. +.TH ISO_8859-6 7 2009-01-27 "Linux" "Linux Programmer's Manual" +.SH NAME +iso_8859-6 \- the ISO 8859-6 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +ISO 8859-6 encodes the characters used in the Arabic language. +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-6 Characters" +The following table displays the characters in ISO 8859-6, which +are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 223 e0 à ARABIC TATWEEL +341 224 e1 á ARABIC LETTER FEH +342 225 e2 â ARABIC LETTER QAF +343 226 e3 ã ARABIC LETTER KAF +344 227 e4 ä ARABIC LETTER LAM +345 228 e5 å ARABIC LETTER MEEM +346 229 e6 æ ARABIC LETTER NOON +347 230 e7 ç ARABIC LETTER HEH +350 231 e8 è ARABIC LETTER WAW +351 232 e9 é ARABIC LETTER ALEF MAKSURA +352 233 ea ê ARABIC LETTER YEH +353 234 eb ë ARABIC FATHATAN +354 235 ec ì ARABIC DAMMATAN +355 236 ed í ARABIC KASRATAN +356 237 ee î ARABIC FATHA +357 238 ef ï ARABIC DAMMA +360 239 f0 ð ARABIC KASRA +361 240 f1 ñ ARABIC SHADDA +362 241 f2 ò ARABIC SUKUN +.TE +.SH NOTES +ISO 8859-6 lacks the glyphs required for many related languages, +such as Urdu and Persian (Farsi). +.SH "SEE ALSO" +.BR ascii (7) diff --git a/original/man7/iso_8859-7.7 b/original/man7/iso_8859-7.7 new file mode 100644 index 00000000..5c79ef80 --- /dev/null +++ b/original/man7/iso_8859-7.7 @@ -0,0 +1,161 @@ +'\" t -*- coding: ISO-8859-7 -*- +.\" Copyright 1999 Dimitri Papadopoulos (dpo@club-internet.fr) +.\" +.\" 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. +.TH ISO_8859-7 7 2008-10-30 "Linux" "Linux Programmer's Manual" +.nh +.SH NAME +iso_8859-7 \- the ISO 8859-7 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +ISO 8859-7 encodes the +characters used in modern monotonic Greek. +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-7 Characters" +The following table displays the characters in ISO 8859-7, which +are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 +243 163 A3 £ POUND SIGN +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 +254 172 AC ¬ NOT SIGN +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 +301 193 C1 Á GREEK CAPITAL LETTER ALPHA +302 194 C2  GREEK CAPITAL LETTER BETA +303 195 C3 à GREEK CAPITAL LETTER GAMMA +304 196 C4 Ä GREEK CAPITAL LETTER DELTA +305 197 C5 Å GREEK CAPITAL LETTER EPSILON +306 198 C6 Æ GREEK CAPITAL LETTER ZETA +307 199 C7 Ç GREEK CAPITAL LETTER ETA +310 200 C8 È GREEK CAPITAL LETTER THETA +311 201 C9 É GREEK CAPITAL LETTER IOTA +312 202 CA Ê GREEK CAPITAL LETTER KAPPA +313 203 CB Ë GREEK CAPITAL LETTER LAMBDA +314 204 CC Ì GREEK CAPITAL LETTER MU +315 205 CD Í GREEK CAPITAL LETTER NU +316 206 CE Î GREEK CAPITAL LETTER XI +317 207 CF Ï GREEK CAPITAL LETTER OMICRON +320 208 D0 Ð GREEK CAPITAL LETTER PI +321 209 D1 Ñ GREEK CAPITAL LETTER RHO +323 211 D3 Ó GREEK CAPITAL LETTER SIGMA +324 212 D4 Ô GREEK CAPITAL LETTER TAU +325 213 D5 Õ GREEK CAPITAL LETTER UPSILON +326 214 D6 Ö GREEK CAPITAL LETTER PHI +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 +341 225 E1 á GREEK SMALL LETTER ALPHA +342 226 E2 â GREEK SMALL LETTER BETA +343 227 E3 ã GREEK SMALL LETTER GAMMA +344 228 E4 ä GREEK SMALL LETTER DELTA +345 229 E5 å GREEK SMALL LETTER EPSILON +346 230 E6 æ GREEK SMALL LETTER ZETA +347 231 E7 ç GREEK SMALL LETTER ETA +350 232 E8 è GREEK SMALL LETTER THETA +351 233 E9 é GREEK SMALL LETTER IOTA +352 234 EA ê GREEK SMALL LETTER KAPPA +353 235 EB ë GREEK SMALL LETTER LAMBDA +354 236 EC ì GREEK SMALL LETTER MU +355 237 ED í GREEK SMALL LETTER NU +356 238 EE î GREEK SMALL LETTER XI +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 +363 243 F3 ó GREEK SMALL LETTER SIGMA +364 244 F4 ô GREEK SMALL LETTER TAU +365 245 F5 õ GREEK SMALL LETTER UPSILON +366 246 F6 ö GREEK SMALL LETTER PHI +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 +.TE +.SH NOTES +ISO 8859-7 was formerly known as ELOT-928 or ECMA-118:1986. +.SH "SEE ALSO" +.BR ascii (7) diff --git a/original/man7/iso_8859-8.7 b/original/man7/iso_8859-8.7 new file mode 100644 index 00000000..b3284db3 --- /dev/null +++ b/original/man7/iso_8859-8.7 @@ -0,0 +1,132 @@ +'\" t -*- coding: ISO-8859-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 +.\" +.TH ISO_8859-8 7 2009-01-15 "Linux" "Linux Programmer's Manual" +.SH NAME +iso_8859-8 \- the ISO 8859-8 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +ISO 8859-8, or "ISO Hebrew" encodes the +characters used in Modern Hebrew (or Ivrit). +Neither short vowels nor diacritical marks are included, +and Yiddish is not provided for. +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-8 Characters" +The following table displays the characters in ISO 8859-8, which +are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 222 DF ß DOUBLE LOW LINE +340 223 E0 à HEBREW LETTER ALEF +341 224 E1 á HEBREW LETTER BET +342 225 E2 â HEBREW LETTER GIMEL +343 226 E3 ã HEBREW LETTER DALET +344 227 E4 ä HEBREW LETTER HE +345 228 E5 å HEBREW LETTER VAV +346 229 E6 æ HEBREW LETTER ZAYIN +347 230 E7 ç HEBREW LETTER HET +350 231 E8 è HEBREW LETTER TET +351 232 E9 é HEBREW LETTER YOD +352 233 EA ê HEBREW LETTER FINAL KAF +353 234 EB ë HEBREW LETTER KAF +354 235 EC ì HEBREW LETTER LAMED +355 236 ED í HEBREW LETTER FINAL MEM +356 237 EE î HEBREW LETTER MEM +357 238 EF ï HEBREW LETTER FINAL NUN +360 239 F0 ð HEBREW LETTER NUN +361 240 F1 ñ HEBREW LETTER SAMEKH +362 241 F2 ò HEBREW LETTER AYIN +363 242 F3 ó HEBREW LETTER FINAL PE +364 243 F4 ô HEBREW LETTER PE +365 244 F5 õ HEBREW LETTER FINAL TSADI +366 245 F6 ö HEBREW LETTER TSADI +367 246 F7 ÷ HEBREW LETTER QOF +370 247 F8 ø HEBREW LETTER RESH +371 248 F9 ù HEBREW LETTER SHIN +372 249 FA ú HEBREW LETTER TAV +375 252 FD ý LEFT-TO-RIGHT MARK +376 253 FE þ RIGHT-TO-LEFT MARK +.TE +.SH NOTES +ISO 8859-8 was also known as ISO-IR-138. +.SH "SEE ALSO" +.BR ascii (7) diff --git a/original/man7/iso_8859-9.7 b/original/man7/iso_8859-9.7 new file mode 100644 index 00000000..fe39b05d --- /dev/null +++ b/original/man7/iso_8859-9.7 @@ -0,0 +1,162 @@ +'\" t -*- coding: ISO-8859-9 -*- +.\" Copyright 2002 Dimitri Papadopoulos (dpo@club-internet.fr) +.\" +.\" 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. +.TH ISO_8859-9 7 2002-09-24 "Linux" "Linux Programmer's Manual" +.nh +.SH NAME +iso_8859-9 \- the ISO 8859-9 character set encoded in octal, decimal, +and hexadecimal +.SH DESCRIPTION +The ISO 8859 standard includes several 8-bit extensions to the ASCII +character set (also known as ISO 646-IRV). +ISO 8859-9, also known as +the "Latin Alphabet No. 5", encodes the characters used in Turkish. +.SS "ISO 8859 Alphabets" +The full set of ISO 8859 alphabets includes: +.TS +l l. +ISO 8859-1 West European languages (Latin-1) +ISO 8859-2 Central and East European languages (Latin-2) +ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) +ISO 8859-4 Scandinavian/Baltic languages (Latin-4) +ISO 8859-5 Latin/Cyrillic +ISO 8859-6 Latin/Arabic +ISO 8859-7 Latin/Greek +ISO 8859-8 Latin/Hebrew +ISO 8859-9 Latin-1 modification for Turkish (Latin-5) +ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) +ISO 8859-11 Latin/Thai +ISO 8859-13 Baltic Rim languages (Latin-7) +ISO 8859-14 Celtic (Latin-8) +ISO 8859-15 West European languages (Latin-9) +ISO 8859-16 Romanian (Latin-10) +.TE +.SS "ISO 8859-9 Characters" +The following table displays the characters in ISO 8859-9 (Latin-5), +which are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for 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 +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 ª 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 +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 ¼ 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 +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 +.TE +.SH "SEE ALSO" +.BR ascii (7) diff --git a/original/man7/iso_8859_1.7 b/original/man7/iso_8859_1.7 new file mode 100644 index 00000000..1969dfb2 --- /dev/null +++ b/original/man7/iso_8859_1.7 @@ -0,0 +1 @@ +.so man7/iso_8859-1.7 diff --git a/original/man7/iso_8859_10.7 b/original/man7/iso_8859_10.7 new file mode 100644 index 00000000..9b4658f2 --- /dev/null +++ b/original/man7/iso_8859_10.7 @@ -0,0 +1 @@ +.so man7/iso_8859-10.7 diff --git a/original/man7/iso_8859_11.7 b/original/man7/iso_8859_11.7 new file mode 100644 index 00000000..cbd4cfe7 --- /dev/null +++ b/original/man7/iso_8859_11.7 @@ -0,0 +1 @@ +.so man7/iso_8859-11.7 diff --git a/original/man7/iso_8859_13.7 b/original/man7/iso_8859_13.7 new file mode 100644 index 00000000..8ad23352 --- /dev/null +++ b/original/man7/iso_8859_13.7 @@ -0,0 +1 @@ +.so man7/iso_8859-13.7 diff --git a/original/man7/iso_8859_14.7 b/original/man7/iso_8859_14.7 new file mode 100644 index 00000000..4aa555db --- /dev/null +++ b/original/man7/iso_8859_14.7 @@ -0,0 +1 @@ +.so man7/iso_8859-14.7 diff --git a/original/man7/iso_8859_15.7 b/original/man7/iso_8859_15.7 new file mode 100644 index 00000000..a4095d75 --- /dev/null +++ b/original/man7/iso_8859_15.7 @@ -0,0 +1 @@ +.so man7/iso_8859-15.7 diff --git a/original/man7/iso_8859_16.7 b/original/man7/iso_8859_16.7 new file mode 100644 index 00000000..b9c8e918 --- /dev/null +++ b/original/man7/iso_8859_16.7 @@ -0,0 +1 @@ +.so man7/iso_8859-16.7 diff --git a/original/man7/iso_8859_2.7 b/original/man7/iso_8859_2.7 new file mode 100644 index 00000000..da36668d --- /dev/null +++ b/original/man7/iso_8859_2.7 @@ -0,0 +1 @@ +.so man7/iso_8859-2.7 diff --git a/original/man7/iso_8859_3.7 b/original/man7/iso_8859_3.7 new file mode 100644 index 00000000..75e42ce3 --- /dev/null +++ b/original/man7/iso_8859_3.7 @@ -0,0 +1 @@ +.so man7/iso_8859-3.7 diff --git a/original/man7/iso_8859_4.7 b/original/man7/iso_8859_4.7 new file mode 100644 index 00000000..15a829eb --- /dev/null +++ b/original/man7/iso_8859_4.7 @@ -0,0 +1 @@ +.so man7/iso_8859-4.7 diff --git a/original/man7/iso_8859_5.7 b/original/man7/iso_8859_5.7 new file mode 100644 index 00000000..1f20320e --- /dev/null +++ b/original/man7/iso_8859_5.7 @@ -0,0 +1 @@ +.so man7/iso_8859-5.7 diff --git a/original/man7/iso_8859_6.7 b/original/man7/iso_8859_6.7 new file mode 100644 index 00000000..edcafdf6 --- /dev/null +++ b/original/man7/iso_8859_6.7 @@ -0,0 +1 @@ +.so man7/iso_8859-6.7 diff --git a/original/man7/iso_8859_7.7 b/original/man7/iso_8859_7.7 new file mode 100644 index 00000000..951384c9 --- /dev/null +++ b/original/man7/iso_8859_7.7 @@ -0,0 +1 @@ +.so man7/iso_8859-7.7 diff --git a/original/man7/iso_8859_8.7 b/original/man7/iso_8859_8.7 new file mode 100644 index 00000000..07cf2162 --- /dev/null +++ b/original/man7/iso_8859_8.7 @@ -0,0 +1 @@ +.so man7/iso_8859-8.7 diff --git a/original/man7/iso_8859_9.7 b/original/man7/iso_8859_9.7 new file mode 100644 index 00000000..0fcc7d46 --- /dev/null +++ b/original/man7/iso_8859_9.7 @@ -0,0 +1 @@ +.so man7/iso_8859-9.7 diff --git a/original/man7/koi8-r.7 b/original/man7/koi8-r.7 new file mode 100644 index 00000000..ed329d04 --- /dev/null +++ b/original/man7/koi8-r.7 @@ -0,0 +1,194 @@ +'\" t -*- coding: KOI8-R -*- +.\" 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. +.TH KOI8-R 7 2009-02-04 "Linux" "Linux Programmer's Manual" +.nh +.SH NAME +koi8-r \- Russian Net Character Set encoded in octal, decimal, and +hexadecimal +.SH DESCRIPTION +KOI8-R is the character set of choice for encoding Russian texts for +many Unix-like operation systems. +KOI8-R is a successor for KOI-8, a +de-facto standard for Internet Mail, News, WWW and other interactive +services at least all over the ex-SU territory. +.PP +KOI8-R is defined by RFC\ 1489 (Registration of a Cyrillic Character +Set). +.SH NOTES +KOI8-R was designed for mixed Russian/English texts and covers +only Russian Cyrillic characters, so if you're looking for Ukrainian, +Byelorussian, etc. +Cyrillic characters, try ISO-IR-111, or KOI8-U +(Ukrainian Character Set), or KOI8-C (for ancient Russian texts) +instead, which are identical to KOI8-R in the Russian Cyrillic letters +area. +.PP +A more complete set of Cyrillic characters is also defined by the +ISO-8859-5 character set. +.SS "KOI8-R Characters" +The following table displays the characters in KOI8-R, which +are printable and unlisted in the +.BR ascii (7) +manual page. +.TS +l l l c lp-1. +Oct Dec Hex Char Description +_ +200 128 80 € FORMS LIGHT HORIZONTAL +201 129 81  FORMS LIGHT VERTICAL +202 130 82 ‚ FORMS LIGHT DOWN AND RIGHT +203 131 83 ƒ FORMS LIGHT DOWN AND LEFT +204 132 84 „ FORMS LIGHT UP AND RIGHT +205 133 85 … FORMS LIGHT UP AND LEFT +206 134 86 † FORMS LIGHT VERTICAL AND RIGHT +207 135 87 ‡ FORMS LIGHT VERTICAL AND LEFT +210 136 88 ˆ FORMS LIGHT DOWN AND HORIZONTAL +211 137 89 ‰ FORMS LIGHT UP AND HORIZONTAL +212 138 8A Š FORMS 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 SMALL 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 š NON-BREAKING SPACE +233 155 9B › BOTTOM HALF INTEGRAL +234 156 9C œ DEGREE SIGN +235 157 9D  SUPERSCRIPT DIGIT TWO +236 158 9E ž MIDDLE DOT +237 159 9F Ÿ DIVISION SIGN +240 160 A0   FORMS DOUBLE HORIZONTAL +241 161 A1 ¡ FORMS DOUBLE VERTICAL +242 162 A2 ¢ FORMS DOWN SINGLE AND RIGHT DOUBLE +243 163 A3 £ CYRILLIC SMALL LETTER IO +244 164 A4 ¤ FORMS DOWN DOUBLE AND RIGHT SINGLE +245 165 A5 ¥ FORMS DOUBLE DOWN AND RIGHT +246 166 A6 ¦ FORMS DOWN SINGLE AND LEFT DOUBLE +247 167 A7 § FORMS DOWN DOUBLE AND LEFT SINGLE +250 168 A8 ¨ FORMS DOUBLE DOWN AND LEFT +251 169 A9 © FORMS UP SINGLE AND RIGHT DOUBLE +252 170 AA ª FORMS UP DOUBLE AND RIGHT SINGLE +253 171 AB « FORMS DOUBLE UP AND RIGHT +254 172 AC ¬ FORMS UP SINGLE AND LEFT DOUBLE +255 173 AD ­ FORMS UP DOUBLE AND LEFT SINGLE +256 174 AE ® FORMS DOUBLE UP AND LEFT +257 175 AF ¯ FORMS VERTICAL SINGLE AND RIGHT DOUBLE +260 176 B0 ° FORMS VERTICAL DOUBLE AND RIGHT SINGLE +261 177 B1 ± FORMS DOUBLE VERTICAL AND RIGHT +262 178 B2 ² FORMS VERTICAL SINGLE AND LEFT DOUBLE +263 179 B3 ³ CYRILLIC CAPITAL LETTER IO +264 180 B4 ´ FORMS VERTICAL DOUBLE AND LEFT SINGLE +265 181 B5 µ FORMS DOUBLE VERTICAL AND LEFT +266 182 B6 ¶ FORMS DOWN SINGLE AND HORIZONTAL DOUBLE +267 183 B7 · FORMS DOWN DOUBLE AND HORIZONTAL SINGLE +270 184 B8 ¸ FORMS DOUBLE DOWN AND HORIZONTAL +271 185 B9 ¹ FORMS UP SINGLE AND HORIZONTAL DOUBLE +272 186 BA º FORMS UP DOUBLE AND HORIZONTAL SINGLE +273 187 BB » FORMS DOUBLE UP AND HORIZONTAL +274 188 BC ¼ FORMS VERTICAL SINGLE AND HORIZONTAL DOUBLE +275 189 BD ½ FORMS VERTICAL DOUBLE AND HORIZONTAL SINGLE +276 190 BE ¾ FORMS DOUBLE VERTICAL AND HORIZONTAL +277 191 BF ¿ COPYRIGHT SIGN +300 192 C0 À CYRILLIC SMALL LETTER IU +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 GE +310 200 C8 È CYRILLIC SMALL LETTER KHA +311 201 C9 É CYRILLIC SMALL LETTER II +312 202 CA Ê CYRILLIC SMALL LETTER SHORT II +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 IA +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 YERI +332 218 DA Ú CYRILLIC SMALL LETTER ZE +333 219 DB Û CYRILLIC SMALL LETTER SHA +334 220 DC Ü CYRILLIC SMALL LETTER REVERSED 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 IU +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 GE +350 232 E8 è CYRILLIC CAPITAL LETTER KHA +351 233 E9 é CYRILLIC CAPITAL LETTER II +352 234 EA ê CYRILLIC CAPITAL LETTER SHORT II +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 IA +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 YERI +372 250 FA ú CYRILLIC CAPITAL LETTER ZE +373 251 FB û CYRILLIC CAPITAL LETTER SHA +374 252 FC ü CYRILLIC CAPITAL LETTER REVERSED E +375 253 FD ý CYRILLIC CAPITAL LETTER SHCHA +376 254 FE þ CYRILLIC CAPITAL LETTER CHE +377 255 FF ÿ CYRILLIC CAPITAL LETTER HARD SIGN + +.TE +.SH "SEE ALSO" +.BR ascii (7), +.BR iso-8859-7 (7), +.BR koi8-u (7), +RFC\ 1489, +http://koi8.pp.ru/ diff --git a/original/man7/koi8-u.7 b/original/man7/koi8-u.7 new file mode 100644 index 00000000..24ba9828 --- /dev/null +++ b/original/man7/koi8-u.7 @@ -0,0 +1,183 @@ +'\" t -*- coding: KOI8-U -*- +.\" 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. +.\" +.\" 2009-01-15, mtk, Some edits +.\" +.TH KOI8-U 7 2009-01-15 "Linux" "Linux Programmer's Manual" +.nh +.SH NAME +koi8-u \- Ukrainian Net Character Set encoded in octal, decimal, and +hexadecimal +.SH DESCRIPTION +KOI8-U (KOI8 Ukrainian, described in RFC\ 2310) +is the de-facto standard character set for encoding Ukrainian texts. +KOI8-U is compatible with KOI8-R (RFC 1489) +for all Russian letters, and extends KOI8-R with four +Ukrainian letters (in both upper and lower case) +in locations that are compliant with ISO-IR-111. +.SS "KOI8-U Characters" +The following table displays the characters in KOI8-U, which +are printable and unlisted in the +.BR ascii (7) +manual page. +The fourth column will only show the proper glyphs +in an environment configured for koi8-u. +.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 ¤ CYRILLIC SMALL LETTER UKRAINIAN IE +245 165 a5 ¥ BOX DRAWINGS DOUBLE DOWN AND RIGHT +246 166 a6 ¦ CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +247 167 a7 § CYRILLIC SMALL LETTER YI (Ukrainian) +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 ­ CYRILLIC SMALL LETTER GHE WITH UPTURN +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 ´ CYRILLIC CAPITAL LETTER UKRAINIAN IE +265 181 b5 µ BOX DRAWINGS DOUBLE VERTICAL AND LEFT +266 182 b6 ¶ CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I +267 183 b7 · CYRILLIC CAPITAL LETTER YI (Ukrainian) +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 ½ CYRILLIC CAPITAL LETTER GHE WITH UPTURN +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 219 dc Ü CYRILLIC SMALL LETTER E +335 220 dd Ý CYRILLIC SMALL LETTER SHCHA +336 221 de Þ CYRILLIC SMALL LETTER CHE +337 222 df ß CYRILLIC SMALL LETTER HARD SIGN +340 223 e0 à CYRILLIC CAPITAL LETTER YU +341 224 e1 á CYRILLIC CAPITAL LETTER A +342 225 e2 â CYRILLIC CAPITAL LETTER BE +343 226 e3 ã CYRILLIC CAPITAL LETTER TSE +344 227 e4 ä CYRILLIC CAPITAL LETTER DE +345 228 e5 å CYRILLIC CAPITAL LETTER IE +346 229 e6 æ CYRILLIC CAPITAL LETTER EF +347 230 e7 ç CYRILLIC CAPITAL LETTER GHE +350 231 e8 è CYRILLIC CAPITAL LETTER HA +351 232 e9 é CYRILLIC CAPITAL LETTER I +352 233 ea ê CYRILLIC CAPITAL LETTER SHORT I +353 234 eb ë CYRILLIC CAPITAL LETTER KA +354 235 ec ì CYRILLIC CAPITAL LETTER EL +355 236 ed í CYRILLIC CAPITAL LETTER EM +356 237 ee î CYRILLIC CAPITAL LETTER EN +357 238 ef ï CYRILLIC CAPITAL LETTER O +360 239 f0 ð CYRILLIC CAPITAL LETTER PE +361 240 f1 ñ CYRILLIC CAPITAL LETTER YA +362 241 f2 ò CYRILLIC CAPITAL LETTER ER +363 242 f3 ó CYRILLIC CAPITAL LETTER ES +364 243 f4 ô CYRILLIC CAPITAL LETTER TE +365 244 f5 õ CYRILLIC CAPITAL LETTER U +366 245 f6 ö CYRILLIC CAPITAL LETTER ZHE +367 246 f7 ÷ CYRILLIC CAPITAL LETTER VE +370 247 f8 ø CYRILLIC CAPITAL LETTER SOFT SIGN +371 248 f9 ù CYRILLIC CAPITAL LETTER YERU +372 249 fa ú CYRILLIC CAPITAL LETTER ZE +373 250 fb û CYRILLIC CAPITAL LETTER SHA +374 251 fc ü CYRILLIC CAPITAL LETTER E +375 252 fd ý CYRILLIC CAPITAL LETTER SHCHA +376 253 fe þ CYRILLIC CAPITAL LETTER CHE +377 254 ff ÿ CYRILLIC CAPITAL LETTER HARD SIGN +.TE +.SH NOTES +The differences from KOI8-R are in the hex positions +a4, a6, a7, ad, b4, b6, b7, and bd. +.SH "SEE ALSO" +.BR ascii (7), +.BR koi8-r (7) diff --git a/original/man7/latin1.7 b/original/man7/latin1.7 new file mode 100644 index 00000000..1969dfb2 --- /dev/null +++ b/original/man7/latin1.7 @@ -0,0 +1 @@ +.so man7/iso_8859-1.7 diff --git a/original/man7/latin10.7 b/original/man7/latin10.7 new file mode 100644 index 00000000..b9c8e918 --- /dev/null +++ b/original/man7/latin10.7 @@ -0,0 +1 @@ +.so man7/iso_8859-16.7 diff --git a/original/man7/latin2.7 b/original/man7/latin2.7 new file mode 100644 index 00000000..da36668d --- /dev/null +++ b/original/man7/latin2.7 @@ -0,0 +1 @@ +.so man7/iso_8859-2.7 diff --git a/original/man7/latin3.7 b/original/man7/latin3.7 new file mode 100644 index 00000000..75e42ce3 --- /dev/null +++ b/original/man7/latin3.7 @@ -0,0 +1 @@ +.so man7/iso_8859-3.7 diff --git a/original/man7/latin4.7 b/original/man7/latin4.7 new file mode 100644 index 00000000..15a829eb --- /dev/null +++ b/original/man7/latin4.7 @@ -0,0 +1 @@ +.so man7/iso_8859-4.7 diff --git a/original/man7/latin5.7 b/original/man7/latin5.7 new file mode 100644 index 00000000..0fcc7d46 --- /dev/null +++ b/original/man7/latin5.7 @@ -0,0 +1 @@ +.so man7/iso_8859-9.7 diff --git a/original/man7/latin6.7 b/original/man7/latin6.7 new file mode 100644 index 00000000..9b4658f2 --- /dev/null +++ b/original/man7/latin6.7 @@ -0,0 +1 @@ +.so man7/iso_8859-10.7 diff --git a/original/man7/latin7.7 b/original/man7/latin7.7 new file mode 100644 index 00000000..8ad23352 --- /dev/null +++ b/original/man7/latin7.7 @@ -0,0 +1 @@ +.so man7/iso_8859-13.7 diff --git a/original/man7/latin8.7 b/original/man7/latin8.7 new file mode 100644 index 00000000..4aa555db --- /dev/null +++ b/original/man7/latin8.7 @@ -0,0 +1 @@ +.so man7/iso_8859-14.7 diff --git a/original/man7/latin9.7 b/original/man7/latin9.7 new file mode 100644 index 00000000..a4095d75 --- /dev/null +++ b/original/man7/latin9.7 @@ -0,0 +1 @@ +.so man7/iso_8859-15.7 diff --git a/original/man7/libc.7 b/original/man7/libc.7 new file mode 100644 index 00000000..747f8b98 --- /dev/null +++ b/original/man7/libc.7 @@ -0,0 +1,100 @@ +.\" 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. +.\" +.TH LIBC 7 2009-01-13 "Linux" "Linux Programmer's Manual" +.SH NAME +libc \- Overview of standard C libraries on Linux +.SH DESCRIPTION +The term "libc" is commonly used as a shorthand for +the "standard C library", +a library of standard functions that can be used by all C programs +(and sometimes by programs in other languages). +Because of some history (see below), use of the term "libc" +to refer to the standard C library is somewhat ambiguous on Linux. +.SS glibc +By far the most widely used C library on Linux is the GNU C Library +.RI ( http://www.gnu.org/software/libc/ ), +often referred to as +.IR glibc . +This is the C library that is nowadays used in all +major Linux distributions. +It is also the C library whose details are documented +in the relevant pages of the +.I man-pages +project (primarily in Section 3 of the manual). +Documentation of glibc is also available in the glibc manual, +available via the command +.IR "info libc" . +Release 1.0 of glibc was made in September 1992. +(There were earlier 0.x releases.) +The next major release of glibc was 2.0, at the beginning of 1997. + +The pathname +.I /lib/libc.so.6 +(or something similar) is normally a symbolic link that +points to the location of the glibc library, +and executing this pathname will cause glibc to display +various information about the version installed on your system. +.SS Linux libc +In the early to mid 1990s, there was for a while +.IR "Linux libc" , +a fork of glibc 1.x created by Linux developers who felt that glibc +development at the time was not sufficing for the needs of Linux. +Often, this library was referred to (ambiguously) as just "libc". +Linux libc released major versions 2, 3, 4, and 5 +(as well as many minor versions of those releases). +For a while, +Linux libc was the standard C library in many Linux distributions. +However, notwithstanding the original motivations of the Linux libc effort, +by the time glibc 2.0 was released, it was clearly superior to Linux libc, +and all major Linux distributions that had been using Linux libc +soon switched back to glibc. +(Since this switch occurred over a decade ago, +.I man-pages +no longer takes care to document Linux libc details. +Nevertheless, the history is visible in vestiges of information +about Linux libc that remain in some manual pages, +in particular, references to +.IR libc4 +and +.IR libc5 .) +.SS Other C libraries +There are various other less widely used C libraries for Linux. +These libraries are generally smaller than glibc, +both in terms of features and memory footprint, +and often intended for building small binaries, +perhaps targeted at development for embedded Linux systems. +Among such libraries are +.I uClibc +.RI ( http://www.uclibc.org/ ) +and +.I dietlibc +.RI ( http://www.fefe.de/dietlibc/ ). +Details of these libraries are generally not covered by the +.I man-pages +project. +.SH SEE ALSO +.BR syscalls (2), +.BR feature_test_macros (7), +.BR man-pages (7), +.BR standards (7) diff --git a/original/man7/locale.7 b/original/man7/locale.7 new file mode 100644 index 00000000..bb53e205 --- /dev/null +++ b/original/man7/locale.7 @@ -0,0 +1,220 @@ +.\" 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. +.\" +.\" Modified Sat Jul 24 17:28:34 1993 by Rik Faith +.\" Modified Sun Jun 01 17:16:34 1997 by Jochen Hein +.\" +.\" Modified Thu Apr 25 00:43:19 2002 by Bruno Haible +.\" +.TH LOCALE 7 2008-12-05 "Linux" "Linux Programmer's Manual" +.SH NAME +locale \- Description of multilanguage support +.SH SYNOPSIS +.nf +.B #include +.fi +.SH DESCRIPTION +A locale is a set of language and cultural rules. +These cover aspects +such as language for messages, different character sets, lexicographic +conventions, etc. +A program needs to be able to determine its locale +and act accordingly to be portable to different cultures. +.PP +The header +.I +declares data types, functions and macros which are useful in this +task. +.PP +The functions it declares are +.BR setlocale (3) +to set the current locale, and +.BR localeconv (3) +to get information about number formatting. +.PP +There are different categories for local information a program might +need; they are declared as macros. +Using them as the first argument +to the +.BR setlocale (3) +function, it is possible to set one of these to the desired locale: +.TP +.B LC_COLLATE +This is used to change the behavior of the functions +.BR strcoll (3) +and +.BR strxfrm (3), +which are used to compare strings in the local alphabet. +For example, +the German sharp s is sorted as "ss". +.TP +.B LC_CTYPE +This changes the behavior of the character handling and +classification functions, such as +.BR isupper (3) +and +.BR toupper (3), +and the multibyte character functions such as +.BR mblen (3) +or +.BR wctomb (3). +.TP +.B LC_MONETARY +changes the information returned by +.BR localeconv (3) +which describes the way numbers are usually printed, with details such +as decimal point versus decimal comma. +This information is internally +used by the function +.BR strfmon (3). +.TP +.B LC_MESSAGES +changes the language messages are displayed in and what an affirmative or +negative answer looks like. +The GNU C-library contains the +.BR gettext (3), +.BR ngettext (3), +and +.BR rpmatch (3) +functions to ease the use of these information. +The GNU gettext family of +functions also obey the environment variable +.BR LANGUAGE +(containing a colon-separated list of locales) +if the category is set to a valid locale other than +.BR """C""" . +.TP +.B LC_NUMERIC +changes the information used by the +.BR printf (3) +and +.BR scanf (3) +family of functions, when they are advised to use the locale-settings. +This information can also be read with the +.BR localeconv (3) +function. +.TP +.B LC_TIME +changes the behavior of the +.BR strftime (3) +function to display the current time in a locally acceptable form; for +example, most of Europe uses a 24-hour clock versus the +12-hour clock used in the United States. +.TP +.B LC_ALL +All of the above. +.\" FIXME glibc 2.2.2 added new nonstandard locale categories: +.\" LC_ADDRESS, LC_IDENTIFICATION, LC_MEASUREMENT, LC_NAME, +.\" LC_PAPER, LC_TELEPHONE. These need to be documented. +.PP +If the second argument to +.BR setlocale (3) +is empty string, +.BR """""" , +for the default locale, it is determined using the following steps: +.IP 1. +If there is a non-null environment variable +.BR LC_ALL , +the value of +.B LC_ALL +is used. +.IP 2. +If an environment variable with the same name as one of the categories +above exists and is non-null, its value is used for that category. +.IP 3. +If there is a non-null environment variable +.BR LANG , +the value of +.B LANG +is used. +.PP +Values about local numeric formatting is made available in a +.I struct lconv +returned by the +.BR localeconv (3) +function, which has the following declaration: +.in +2n +.nf + +struct lconv { + + /* Numeric (nonmonetary) information */ + + char *decimal_point; /* Radix character */ + char *thousands_sep; /* Separator for digit groups to left + of radix character */ + char *grouping; /* Each element is the number of digits in a + group; elements with higher indices are + further left. An element with value CHAR_MAX + means that no further grouping is done. An + element with value 0 means that the previous + element is used for all groups further left. */ + + /* Remaining fields are for monetary information */ + + char *int_curr_symbol; /* First three chars are a currency symbol + from ISO 4217. Fourth char is the + separator. Fifth char is \(aq\\0\(aq. */ + char *currency_symbol; /* Local currency symbol */ + char *mon_decimal_point; /* Radix character */ + char *mon_thousands_sep; /* Like \fIthousands_sep\fP above */ + char *mon_grouping; /* Like \fIgrouping\fP above */ + char *positive_sign; /* Sign for positive values */ + char *negative_sign; /* Sign for negative values */ + char int_frac_digits; /* International fractional digits */ + char frac_digits; /* Local fractional digits */ + char p_cs_precedes; /* 1 if currency_symbol precedes a + positive value, 0 if succeeds */ + char p_sep_by_space; /* 1 if a space separates currency_symbol + from a positive value */ + char n_cs_precedes; /* 1 if currency_symbol precedes a + negative value, 0 if succeeds */ + char n_sep_by_space; /* 1 if a space separates currency_symbol + from a negative value */ + /* Positive and negative sign positions: + 0 Parentheses surround the quantity and currency_symbol. + 1 The sign string precedes the quantity and currency_symbol. + 2 The sign string succeeds the quantity and currency_symbol. + 3 The sign string immediately precedes the currency_symbol. + 4 The sign string immediately succeeds the currency_symbol. */ + char p_sign_posn; + char n_sign_posn; +}; +.fi +.in +.SH "CONFORMING TO" +POSIX.1-2001. + +The GNU gettext functions are specified in LI18NUX2000. +.SH "SEE ALSO" +.BR locale (1), +.BR localedef (1), +.BR gettext (3), +.BR localeconv (3), +.BR ngettext (3), +.BR nl_langinfo (3), +.BR rpmatch (3), +.BR setlocale (3), +.BR strcoll (3), +.BR strfmon (3), +.BR strftime (3), +.BR strxfrm (3) diff --git a/original/man7/mailaddr.7 b/original/man7/mailaddr.7 new file mode 100644 index 00000000..f8eb8570 --- /dev/null +++ b/original/man7/mailaddr.7 @@ -0,0 +1,125 @@ +.\" +.\" Copyright (c) 1983, 1987 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms are permitted +.\" provided that the above copyright notice and this paragraph are +.\" duplicated in all such forms and that any documentation, +.\" advertising materials, and other materials related to such +.\" distribution and use acknowledge that the software was developed +.\" by the University of California, Berkeley. The name of the +.\" University may not be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" @(#)mailaddr.7 6.5 (Berkeley) 2/14/89 +.\" +.\" Extensively rewritten by Arnt Gulbrandsen . My +.\" changes are placed under the same copyright as the original BSD page. +.\" +.\" Adjusted by Arnt Gulbrandsen in 2004 to +.\" account for changes since 1995. Route-addrs are now even less +.\" common, etc. Some minor wording improvements. Same copyright. +.\" +.TH MAILADDR 7 2004-09-15 "Linux" "Linux User's Manual" +.UC 5 +.SH NAME +mailaddr \- mail addressing description +.SH DESCRIPTION +.nh +This manual page gives a brief introduction to SMTP mail addresses, as +used on the Internet. +These addresses are in the general format +.PP + user@domain +.PP +where a domain is a hierarchical dot-separated list of subdomains. +These examples are valid forms of the same address: +.PP + eric@monet.berkeley.edu +.br + Eric Allman +.br + eric@monet.berkeley.edu (Eric Allman) +.PP +The domain part ("monet.berkeley.edu") is a mail-accepting domain. +It can be a host and in the past it usually was, but it doesn't have to be. +The domain part is not case sensitive. +.PP +The local part ("eric") is often a username, but its meaning is +defined by the local software. +Sometimes it is case sensitive, +although that is unusual. +If you see a local-part that looks like +garbage, it is usually because of a gateway between an internal e-mail +system and the net, here are some examples: +.PP + "surname/admd=telemail/c=us/o=hp/prmd=hp"@some.where +.br + USER%SOMETHING@some.where +.br + machine!machine!name@some.where +.br + I2461572@some.where +.PP +(These are, respectively, an X.400 gateway, a gateway to an arbitrary +internal mail system that lacks proper internet support, an UUCP +gateway, and the last one is just boring username policy.) +.PP +The real-name part ("Eric Allman") can either be placed before +<>, or in () at the end. +(Strictly speaking the two aren't the same, +but the difference is beyond the scope of this page.) +The name may have to be quoted using "", for example, if it contains ".": +.PP + "Eric P. Allman" +.SS Abbreviation. +.PP +Many mail systems let users abbreviate the domain name. +For instance, +users at berkeley.edu may get away with "eric@monet" to send mail to +Eric Allman. +.I "This behavior is deprecated." +Sometimes it works, but you should not depend on it. +.SS Route-addrs. +.PP +In the past, sometimes one had to route a message through +several hosts to get it to its final destination. +Addresses which +show these relays are termed "route-addrs". +These use the syntax: +.PP + <@hosta,@hostb:user@hostc> +.PP +This specifies that the message should be sent to hosta, from there +to hostb, and finally to hostc. +Many hosts disregard route-addrs +and send directly to hostc. +.PP +Route-addrs are very unusual now. +They occur sometimes in old mail +archives. +It is generally possible to ignore all but the "user@hostc" +part of the address to determine the actual address. +.SS Postmaster. +.PP +Every site is required to have a user or user alias designated +"postmaster" to which problems with the mail system may be +addressed. +The "postmaster" address is not case sensitive. +.SH FILES +.I /etc/aliases +.br +.I ~/.forward +.SH "SEE ALSO" +.BR binmail (1), +.BR mail (1), +.BR mconnect (1), +.BR aliases (5), +.BR forward (5), +.BR sendmail (8), +.BR vrfy (8) + +RFC\ 2822 (Internet Message Format) diff --git a/original/man7/man-pages.7 b/original/man7/man-pages.7 new file mode 100644 index 00000000..261e5568 --- /dev/null +++ b/original/man7/man-pages.7 @@ -0,0 +1,551 @@ +.\" (C) Copyright 1992-1999 Rickard E. Faith and David A. Wheeler +.\" (faith@cs.unc.edu and dwheeler@ida.org) +.\" and (C) Copyright 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. +.\" +.\" 2007-05-30 created by mtk, using text from old man.7 plus +.\" rewrites and additional text. +.\" +.TH MAN-PAGES 7 2008-10-28 "Linux" "Linux Programmer's Manual" +.SH NAME +man-pages \- conventions for writing Linux man pages +.SH SYNOPSIS +.B man +.RI [ section ] +.I title +.SH DESCRIPTION +This page describes the conventions that should be employed +when writing man pages for the Linux \fIman-pages\fP project, +which comprises Sections 2, 3, 4, 5, and 7 of the Linux manual pages. +The conventions described on this page may also be useful +for authors writing man pages for other projects. +.SS Sections of the Manual Pages +.PP +The manual Sections are traditionally defined as follows: +.TP 10 +.B 1 Commands (Programs) +Those commands that can be executed by the user from within +a shell. +.TP +.B 2 System calls +Those functions which must be performed by the kernel. +.TP +.B 3 Library calls +Most of the +.I libc +functions. +.TP +.B 4 Special files (devices) +Files found in +.IR /dev . +.TP +.B 5 File formats and conventions +The format for +.I /etc/passwd +and other human-readable files. +.TP +.B 6 Games +.TP +.B 7 Conventions and miscellaneous +Overviews of various topics, conventions and protocols, +character set standards, and miscellaneous other things. +.TP +.B 8 System management commands +Commands like +.BR mount (8), +many of which only root can execute. +.\" .TP +.\" .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. +.SS Macro package +New manual pages should be marked up using the +.B groff an.tmac +package described in +.BR man (7). +This choice is mainly for consistency: the vast majority of +existing Linux manual pages are marked up using these macros. +.SS Conventions for source file layout +Please limit source code line length to no more than about 75 characters +wherever possible. +This helps avoid line-wrapping in some mail clients when patches are +submitted inline. + +New sentences should be started on new lines. +This makes it easier to see the effect of patches, +which often operate at the level of individual sentences. +.SS Title line +The first command in a man page should be a \fBTH\fP command: +.RS +.sp +.B \&.TH +.I "title section date source manual" +.sp +.RE +where: +.RS +.TP 10 +.I title +The title of the man page, written in all caps (e.g., +.IR MAN-PAGES ). +.TP +.I section +The section number in which the man page should be placed (e.g., +.IR 7 ). +.TP +.I date +The date of the last revision \(em remember to change this every time a +change is made to the man page, +since this is the most general way of doing version control. +Dates should be written in the form YYYY-MM-DD. +.TP +.I source +The source of the command, function, or system call. + +For those few \fIman-pages\fP pages in Sections 1 and 8, +probably you just want to write +.IR GNU . + +For system calls, just write +.IR "Linux" . +(An earlier practice was to write the version number +of the kernel from which the manual page was being written/checked. +However, this was never done consistently, and so was +probably worse than including no version number. +Henceforth, avoid including a version number.) + +For library calls that are part of glibc or one of the +other common GNU libraries, just use +.IR "GNU C Library" ", " GNU , +or an empty string. + +For Section 4 pages, use +.IR "Linux" . + +In cases of doubt, just write +.IR Linux ", or " GNU . +.TP +.I manual +The title of the manual (e.g., for Section 2 and 3 pages in +the \fIman-pages\fP package, use +.IR "Linux Programmer's Manual" ). +.RE +.SS Sections within a manual page +The list below shows conventional or suggested sections. +Most manual pages should include at least the +.B highlighted +sections. +Arrange a new manual page so that sections +are placed in the order shown in the list. +.in +0.5i +.nf + +\fBNAME\fP +\fBSYNOPSIS\fP +CONFIGURATION [Normally only in Section 4] +\fBDESCRIPTION\fP +OPTIONS [Normally only in Sections 1, 8] +EXIT STATUS [Normally only in Sections 1, 8] +RETURN VALUE [Normally only in Sections 2, 3] +.\" May 07: Few current man pages have an ERROR HANDLING section,,, +.\" ERROR HANDLING, +ERRORS [Typically only in Sections 2, 3] +.\" 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, +ENVIRONMENT +FILES +VERSIONS [Normally only in Sections 2, 3] +CONFORMING TO +NOTES +BUGS +EXAMPLE +.\" AUTHORS sections are discouraged +.\" AUTHORS [Discouraged] +\fBSEE ALSO\fP + +.fi +.in +.IR "Where a traditional heading would apply" ", " "please use it" ; +this kind of consistency can make the information easier to understand. +If you must, you can create your own +headings if they make things easier to understand (this can +be especially useful for pages in Sections 4 and 5). +However, before doing this, consider whether you could use the +traditional headings, with some subsections (\fI.SS\fP) within +those sections. + +The following list elaborates on the contents of each of +the above sections. +.TP 14 +.B NAME +The name of this manual page. +See +.BR man (7) +for important details of the line(s) that should follow the +\fB.SH NAME\fP command. +.TP +.B SYNOPSIS +briefly describes the command or function's interface. +For commands, this shows the syntax of the command and its arguments +(including options); +boldface is used for as-is text and italics are used to +indicate replaceable arguments. +Brackets ([]) surround optional arguments, vertical bars (|) +separate choices, and ellipses (\&...) can be repeated. +For functions, it shows any required data declarations or +.B #include +directives, followed by the function declaration. + +Where a feature test macro must be defined in order to obtain +the declaration of a function (or a variable) from a header file, +then the SYNOPSIS should indicate this, as described in +.BR feature_test_macros (7). +.\" FIXME . Say something here about compiler options +.TP +.B CONFIGURATION +Configuration details for a device. +This section normally only appears in Section 4 pages. +.TP +.B DESCRIPTION +gives an explanation of what the program, function, or format does. +Discuss how it interacts with files and standard input, and what it +produces on standard output or standard error. +Omit internals and implementation details unless they're critical for +understanding the interface. +Describe the usual case; +for information on command-line options of a program use the +.B OPTIONS +section. +.\" 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). +.TP +.B OPTIONS +describes the command-line options accepted by a +program and how they change its behavior. +This section should only appear for Section 1 and 8 manual pages. +.\" .TP +.\" .B USAGE +.\" describes the grammar of any sublanguage this implements. +.TP +.B EXIT STATUS +lists the possible exit status values of a program and +the conditions that cause these values to be returned. +This section should only appear for Section 1 and 8 manual pages. +.TP +.B RETURN VALUE +For Section 2 and 3 pages, this section gives a +list of the values the library routine will return to the caller +and the conditions that cause these values to be returned. +.TP +.B ERRORS +For Section 2 and 3 manual pages, this is a list of the +values that may be placed in +.I errno +in the event of an error, along with information about the cause +of the errors. +.IR "The error list should be in alphabetical order" . +.TP +.B ENVIRONMENT +lists all environment variables that affect the program or function +and how they affect it. +.TP +.B FILES +lists the files the program or function uses, such as +configuration files, startup files, +and files the program directly operates on. +Give the full pathname of these files, and use the installation +process to modify the directory part to match user preferences. +For many programs, the default installation location is in +.IR /usr/local , +so your base manual page should use +.I /usr/local +as the base. +.\" May 07: Almost no current man pages have a DIAGNOSTICS section; +.\" "RETURN VALUE" or "EXIT STATUS" is preferred. +.\" .TP +.\" .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 +.\".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! +.TP +.B VERSIONS +A brief summary of the Linux kernel or glibc versions where a +system call or library function appeared, +or changed significantly in its operation. +As a general rule, every new interface should +include a VERSIONS section in its manual page. +Unfortunately, +many existing manual pages don't include this information +(since there was no policy to do so when they were written). +Patches to remedy this are welcome, +but, from the perspective of programmers writing new code, +this information probably only matters in the case of kernel +interfaces that have been added in Linux 2.4 or later +(i.e., changes since kernel 2.2), +and library functions that have been added to glibc since version 2.1 +(i.e., changes since glibc 2.0). + +The +.BR syscalls (2) +manual page also provides information about kernel versions +in which various system calls first appeared. +.TP +.B CONFORMING TO +describes any standards or conventions that relate to the function +or command described by the manual page. +For a page in Section 2 or 3, +this section should note the POSIX.1 +version(s) that the call conforms to, +and also whether the call is specified in C99. +(Don't worry too much about other standards like SUS, SUSv2, and XPG, +or the SVr4 and 4.xBSD implementation standards, +unless the call was specified in those standards, +but isn't in the current version of POSIX.1.) +(See +.BR standards (7).) + +If the call is not governed by any standards but commonly +exists on other systems, note them. +If the call is Linux-specific, note this. + +If this section consists of just a list of standards +(which it commonly does), +terminate the list with a period (\(aq.\(aq). +.TP +.B NOTES +provides miscellaneous notes. +For Section 2 and 3 man pages you may find it useful to include +subsections (\fBSS\fP) named \fILinux Notes\fP and \fIGlibc Notes\fP. +.TP +.B BUGS +lists limitations, known defects or inconveniences, +and other questionable activities. +.TP +.B EXAMPLE +provides one or more examples describing how this function, file or +command is used. +For details on writing example programs, +see \fIExample Programs\fP below. +.TP +.B AUTHORS +lists authors of the documentation or program. +\fBUse of an AUTHORS section is strongly discouraged\fP. +Generally, it is better not to clutter every page with a list +of (over time potentially numerous) authors; +if you write or significantly amend a page, +add a copyright notice as a comment in the source file. +If you are the author of a device driver and want to include +an address for reporting bugs, place this under the BUGS section. +.TP +.B SEE ALSO +provides a comma-separated list of related man pages, +ordered by section number and +then alphabetically by name, possibly followed by +other related pages or documents. +Do not terminate this with a period. +.SS Font conventions +.PP +For functions, the arguments are always specified using italics, +.IR "even in the SYNOPSIS section" , +where the rest of the function is specified in bold: +.PP +.BI " int myfunction(int " argc ", char **" argv ); +.PP +Variable names should, like argument names, be specified in italics. +.PP +Filenames (whether pathnames, or references to files in the +.I /usr/include +directory) +are always in italics (e.g., +.IR ), +except in the SYNOPSIS section, where included files are in bold (e.g., +.BR "#include " ). +When referring to a standard include file under +.IR /usr/include , +specify the header file surrounded by angle brackets, +in the usual C way (e.g., +.IR ). +.PP +Special macros, which are usually in upper case, are in bold (e.g., +.BR MAXINT ). +Exception: don't boldface NULL. +.PP +When enumerating a list of error codes, the codes are in bold (this list +usually uses the +.B \&.TP +macro). +.PP +Complete commands should, if long, +be written as in an indented line on their own, for example +.in +4n +.nf + +man 7 man-pages + +.fi +.in +If the command is short, then it can be included inline in the text, +in italic format, for example, +.IR "man 7 man-pages" . +In this case, it may be worth using nonbreaking spaces +("\e\ ") at suitable places in the command. +Command options should be written in italics, e.g., +.IR \-l . +.PP +Expressions, if not written on a separate indented line, should +be specified in italics. +Again, the use of nonbreaking spaces may be appropriate +if the expression is inlined with normal text. +.PP +Any reference to the subject of the current manual page +should be written with the name in bold. +If the subject is a function (i.e., this is a Section 2 or 3 page), +then the name should be followed by a pair of parentheses +in Roman (normal) font. +For example, in the +.BR fcntl (2) +man page, references to the subject of the page would be written as: +.BR fcntl (). +The preferred way to write this in the source file is: +.nf + + .BR fcntl () + +.fi +(Using this format, rather than the use of "\\fB...\\fP()" +makes it easier to write tools that parse man page source files.) +.PP +Any reference to another man page +should be written with the name in bold, +\fIalways\fP followed by the section number, +formatted in Roman (normal) font, without any +separating spaces (e.g., +.BR intro (2)). +The preferred way to write this in the source file is: +.nf + + .BR intro (2) + +.fi +(Including the section number in cross references lets tools like +.BR man2html (1) +create properly hyperlinked pages.) +.SS Spelling +Starting with release 2.59, +.I man-pages +follows American spelling conventions; +please write all new pages and patches according to these conventions. +.SS Example Programs and Shell Sessions +Manual pages can include example programs demonstrating how to +use a system call or library function. +However, note the following: +.TP 3 +* +Example programs should be written in C. +.TP +* +An example program is only necessary and useful if it demonstrates +something beyond what can easily be provided in a textual +description of the interface. +An example program that does nothing +other than call an interface usually serves little purpose. +.TP +* +Example programs should be fairly short (preferably less than 100 lines; +ideally less than 50 lines). +.TP +* +Example programs should do error checking after system calls and +library function calls. +.TP +* +Example programs should be complete, and compile without +warnings when compiled with \fIcc\ \-Wall\fP. +.TP +* +Where possible and appropriate, example programs should allow +experimentation, by varying their behavior based on inputs +(ideally from command-line arguments, or alternatively, via +input read by the program). +.TP +* +Example programs should be laid out according to Kernighan and +Ritchie style, with 4-space indents. +(Avoid the use of TAB characters in source code!) +.PP +For some examples of what example programs should look like, see +.BR wait (2) +and +.BR pipe (2). + +If you include a shell session demonstrating the use of a program +or other system feature, boldface the user input text, +to distinguish it from output produced by the system. +.SS Indentation of structure definitions, shell session logs, etc. +When structure definitions, shell session logs, etc. are included +in running text, indent them by 4 spaces (i.e., a block enclosed by +.I ".in\ +4n" +and +.IR ".in" ). +.SH EXAMPLE +For canonical examples of how man pages in the +.I man-pages +package should look, see +.BR pipe (2) +and +.BR fcntl (2). +.SH SEE ALSO +.BR man (1), +.BR man2html (1), +.BR groff (7), +.BR groff_man (7), +.BR man (7), +.BR mdoc (7) diff --git a/original/man7/man.7 b/original/man7/man.7 new file mode 100644 index 00000000..aa9aec38 --- /dev/null +++ b/original/man7/man.7 @@ -0,0 +1,561 @@ +.\" (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. +.\" +.TH MAN 7 2007-05-30 "Linux" "Linux Programmer's Manual" +.SH NAME +man \- macros to format man pages +.SH SYNOPSIS +.B groff \-Tascii \-man +.I file +\&... +.LP +.B groff \-Tps \-man +.I file +\&... +.LP +.B man +.RI [ section ] +.I title +.SH DESCRIPTION +This manual page explains the +.B "groff an.tmac" +macro package (often called the +.B man +macro package). +This macro package should be used by developers when +writing or porting man pages for Linux. +It is fairly compatible with other +versions of this macro package, so porting man pages should not be a major +problem (exceptions include the NET-2 BSD release, which uses a totally +different macro package called mdoc; see +.BR mdoc (7)). +.PP +Note that NET-2 BSD mdoc man pages can be used with +.B groff +simply by specifying the +.B \-mdoc +option instead of the +.B \-man +option. +Using the +.B \-mandoc +option is, however, recommended, since this will automatically detect which +macro package is in use. +.PP +For conventions that should be employed when writing man pages +for the Linux \fIman-pages\fP package, see +.BR man-pages (7). +.SS Title line +The first command in a man page (after comment lines, +that is, lines that start with \fB.\\"\fP) should be +.RS +.sp +.B \&.TH +.I "title section date source manual" +.sp +.RE +For details of the arguments that should be supplied to the \fBTH\fP +command, see +.BR man-pages (7). +.PP +Note that BSD mdoc-formatted pages begin with the +.B Dd +command, not the +.B TH +command. +.SS Sections +Sections are started with +.B \&.SH +followed by the heading name. +.\" The following doesn't seem to be required (see Debian bug 411303), +.\" If the name contains spaces and appears +.\" on the same line as +.\" .BR \&.SH , +.\" then place the heading in double quotes. + +The only mandatory heading is NAME, which should be the first section and +be followed on the next line by a one line description of the program: +.RS +.sp +\&.SH NAME +.br +.sp +.RE +It is extremely important that this format is followed, and that there is a +backslash before the single dash which follows the command name. +This syntax is used by the +.BR makewhatis (8) +program to create a database of short command descriptions for the +.BR whatis (1) +and +.BR apropos (1) +commands. +.PP +For a list of other sections that might appear in a manual page, see +.BR man-pages (7). +.SS Fonts +The commands to select the type face are: +.TP 4 +.B \&.B +Bold +.TP +.B \&.BI +Bold alternating with italics +(especially useful for function specifications) +.TP +.B \&.BR +Bold alternating with Roman +(especially useful for referring to other +manual pages) +.TP +.B \&.I +Italics +.TP +.B \&.IB +Italics alternating with bold +.TP +.B \&.IR +Italics alternating with Roman +.TP +.B \&.RB +Roman alternating with bold +.TP +.B \&.RI +Roman alternating with italics +.TP +.B \&.SB +Small alternating with bold +.TP +.B \&.SM +Small (useful for acronyms) +.LP +Traditionally, each command can have up to six arguments, but the GNU +implementation removes this limitation (you might still want to limit +yourself to 6 arguments for portability's sake). +Arguments are delimited by spaces. +Double quotes can be used to specify an argument which contains spaces. +All of the arguments will be printed next to each other without +intervening spaces, so that the +.B \&.BR +command can be used to specify a word in bold followed by a mark of +punctuation in Roman. +If no arguments are given, the command is applied to the following line +of text. +.SS "Other Macros and Strings" +.PP +Below are other relevant macros and predefined strings. +Unless noted otherwise, all macros +cause a break (end the current line of text). +Many of these macros set or use the "prevailing indent." +The "prevailing indent" value is set by any macro with the parameter +.I i +below; +macros may omit +.I i +in which case the current prevailing indent will be used. +As a result, successive indented paragraphs can use the same indent without +respecifying the indent value. +A normal (nonindented) paragraph resets the prevailing indent value +to its default value (0.5 inches). +By default a given indent is measured in ens; +try to use ens or ems as units for +indents, since these will automatically adjust to font size changes. +The other key macro definitions are: +.SS "Normal Paragraphs" +.TP 9m +.B \&.LP +Same as +.B \&.PP +(begin a new paragraph). +.TP +.B \&.P +Same as +.B \&.PP +(begin a new paragraph). +.TP +.B \&.PP +Begin a new paragraph and reset prevailing indent. +.SS "Relative Margin Indent" +.TP 9m +.BI \&.RS " i" +Start relative margin indent: moves the left margin +.I i +to the right (if +.I i +is omitted, the prevailing indent value is used). +A new prevailing indent is set to 0.5 inches. +As a result, all following paragraph(s) will be +indented until the corresponding +.BR \&.RE . +.TP +.B \&.RE +End relative margin indent and +restores the previous value of the prevailing indent. +.SS "Indented Paragraph Macros" +.TP 9m +.BI \&.HP " i" +Begin paragraph with a hanging indent +(the first line of the paragraph is at the left margin of +normal paragraphs, and the rest of the paragraph's lines are indented). +.TP +.BI \&.IP " x i" +Indented paragraph with optional hanging tag. +If the tag +.I x +is omitted, the entire following paragraph is indented by +.IR i . +If the tag +.I x +is provided, it is hung at the left margin +before the following indented paragraph +(this is just like +.B \&.TP +except the tag is included with the command instead of being on the +following line). +If the tag is too long, the text after the tag will be moved down to the +next line (text will not be lost or garbled). +For bulleted lists, use this macro with \e(bu (bullet) or \e(em (em dash) +as the tag, and for numbered lists, use the number or letter followed by +a period as the tag; +this simplifies translation to other formats. +.TP +.BI \&.TP " i" +Begin paragraph with hanging tag. +The tag is given on the next line, but +its results are like those of the +.B \&.IP +command. +.SS "Hypertext Link Macros" +(Feature supported with +.B groff +only.) +In order to use hypertext link macros, it is necessary to load the +.B www.tmac +macro package. +Use the request +.B .mso www.tmac +to do this. +.TP 9m +.BI \&.URL " url link trailer" +Inserts a hypertext link to the URI (URL) +.IR url , +with +.I link +as the text of the link. +The +.I trailer +will be printed immediately afterwards. +When generating HTML this should translate into the HTML command +\fB\fIlink\fP\fB\fP\fItrailer\fP. +.\" The following is a kludge to get a paragraph into the listing. +.TP +.B " " +This and other related macros are new, and +many tools won't do anything with them, but +since many tools (including troff) will simply ignore undefined macros +(or at worst insert their text) these are safe to insert. +.\" The following is a kludge to get a paragraph into the listing. +.TP +.B " " +It can be useful to define your own +.B URL +macro in manual pages for the benefit of those viewing it with a roff +viewer other than +.BR groff . +That way, the URL, link text, and trailer text (if any) are still visible. +.\" The following is a kludge to get a paragraph into the listing. +.TP +.B " " +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 +.\" The following is a kludge to get a paragraph into the listing. +.TP +.B " " +In the above, if +.B groff +is being used, the +.B www.tmac +macro package's definition of the URL macro will supersede the locally +defined one. +.PP +A number of other link macros are available. +See +.BR groff_www (7) +for more details. +.SS "Miscellaneous Macros" +.TP 9m +.B \&.DT +Reset tabs to default tab values (every 0.5 inches); +does not cause a break. +.TP +.BI \&.PD " d" +Set inter-paragraph vertical distance to d +(if omitted, d=0.4v); +does not cause a break. +.TP +.BI \&.SS " t" +Subheading +.I t +(like +.BR \&.SH , +but used for a subsection inside a section). +.SS "Predefined Strings" +The +.B man +package has the following predefined strings: +.IP \e*R +Registration Symbol: \*R +.IP \e*S +Change to default font size +.IP \e*(Tm +Trademark Symbol: \*(Tm +.IP \e*(lq +Left angled double quote: \*(lq +.IP \e*(rq +Right angled double quote: \*(rq +.SS "Safe Subset" +Although technically +.B man +is a troff macro package, in reality a large number of other tools +process man page files that don't implement all of troff's abilities. +Thus, it's best to avoid some of troff's more exotic abilities +where possible to permit these other tools to work correctly. +Avoid using the various troff preprocessors +(if you must, go ahead and use +.BR tbl (1), +but try to use the +.B IP +and +.B TP +commands instead for two-column tables). +Avoid using computations; most other tools can't process them. +Use simple commands that are easy to translate to other formats. +The following troff macros are believed to be safe (though in many cases +they will be ignored by translators): +.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 , +.BR tr . +.PP +You may also use many troff escape sequences (those sequences beginning +with \e). +When you need to include the backslash character as normal text, +use \ee. +Other sequences you may use, where x or xx are any characters and N +is any digit, include: +.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 , +and +.BR \ef(xx . +Avoid using the escape sequences for drawing graphics. +.PP +Do not use the optional parameter for +.B bp +(break page). +Use only positive values for +.B sp +(vertical space). +Don't define a macro +.RB ( de ) +with the same name as a macro in this or the +mdoc macro package with a different meaning; it's likely that +such redefinitions will be ignored. +Every positive indent +.RB ( in ) +should be paired with a matching negative indent +(although you should be using the +.B RS +and +.B RE +macros instead). +The condition test +.RB ( if,ie ) +should only have \(aqt\(aq or \(aqn\(aq as the condition. +Only translations +.RB ( tr ) +that can be ignored should be used. +Font changes +.RB ( ft +and the \fB\ef\fP escape sequence) +should only have the values 1, 2, 3, 4, R, I, B, P, or CW +(the ft command may also have no parameters). +.PP +If you use capabilities beyond these, check the +results carefully on several tools. +Once you've confirmed that the additional capability is safe, +let the maintainer of this +document know about the safe command or sequence +that should be added to this list. +.SH FILES +.IR /usr/share/groff/ [*/] tmac/an.tmac +.br +.I /usr/man/whatis +.SH NOTES +.PP +By all means include full URLs (or URIs) in the text itself; +some tools such as +.BR man2html (1) +can automatically turn them into hypertext links. +You can also use the new +.B URL +macro to identify links to related information. +If you include URLs, use the full URL +(e.g., ) to ensure that tools +can automatically find the URLs. +.PP +Tools processing these files should open the file and examine the first +nonwhitespace character. +A period (.) or single quote (') at the beginning +of a line indicates a troff-based file (such as man or mdoc). +A left angle bracket (<) indicates an SGML/XML-based +file (such as HTML or Docbook). +Anything else suggests simple ASCII +text (e.g., a "catman" result). +.PP +Many man pages begin with \fB\'\e"\fP followed by a +space and a list of characters, +indicating how the page is to be preprocessed. +For portability's sake to non-troff translators we recommend +that you avoid using anything other than +.BR tbl (1), +and Linux can detect that automatically. +However, you might want to include this information so your man page +can be handled by other (less capable) systems. +Here are the definitions of the preprocessors invoked by these characters: +.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) +.SH BUGS +.PP +Most of the macros describe formatting (e.g., font type and spacing) instead +of marking semantic content (e.g., this text is a reference to another page), +compared to formats like mdoc and DocBook (even HTML has more semantic +markings). +This situation makes it harder to vary the +.B man +format for different media, +to make the formatting consistent for a given media, and to automatically +insert cross-references. +By sticking to the safe subset described above, it should be easier to +automate transitioning to a different reference page format in the future. +.LP +The Sun macro +.B TX +is not implemented. +.\" .SH AUTHORS +.\" .IP \(em 3m +.\" James Clark (jjc@jclark.com) wrote the implementation of the macro package. +.\" .IP \(em +.\" Rickard E. Faith (faith@cs.unc.edu) wrote the initial version of +.\" this manual page. +.\" .IP \(em +.\" Jens Schweikhardt (schweikh@noc.fdn.de) wrote the Linux Man-Page Mini-HOWTO +.\" (which influenced this manual page). +.\" .IP \(em +.\" David A. Wheeler (dwheeler@ida.org) heavily modified this +.\" manual page, such as adding detailed information on sections and macros. +.SH "SEE ALSO" +.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/original/man7/math_error.7 b/original/man7/math_error.7 new file mode 100644 index 00000000..058910b6 --- /dev/null +++ b/original/man7/math_error.7 @@ -0,0 +1,264 @@ +.\" 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. +.\" +.TH MATH_ERROR 7 2008-08-11 "Linux" "Linux Programmer's Manual" +.SH NAME +math_error \- detecting errors from mathematical functions +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.fi +.SH DESCRIPTION +When an error occurs, +most library functions indicate this fact by returning a special value +(e.g., \-1 or NULL). +Because they typically return a floating-point number, +the mathematical functions declared in +.IR +indicate an error using other mechanisms. +There are two error-reporting mechanisms: +the older one sets +.IR errno ; +the newer one uses the floating-point exception mechanism (the use of +.BR feclearexcept (3) +and +.BR fetestexcept (3), +as outlined below) +described in +.BR fenv (3). + +A portable program that needs to check for an error from a mathematical +function should set +.I errno +to zero, and make the following call +.in +4n +.nf + +feclearexcept(FE_ALL_EXCEPT); + +.fi +.in +before calling a mathematical function. + +Upon return from the mathematical function, if +.I errno +is nonzero, or the following call (see +.BR fenv (3)) +returns nonzero +.in +4n +.nf + +fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | + FE_UNDERFLOW); + +.fi +.in +.\" enum +.\" { +.\" FE_INVALID = 0x01, +.\" __FE_DENORM = 0x02, +.\" FE_DIVBYZERO = 0x04, +.\" FE_OVERFLOW = 0x08, +.\" FE_UNDERFLOW = 0x10, +.\" FE_INEXACT = 0x20 +.\" }; +then an error occurred in the mathematical function. + +The error conditions that can occur for mathematical functions +are described below. +.SS Domain Error +A +.I domain error +occurs when a mathematical function is supplied with an argument whose +value falls outside the domain for which the function +is defined (e.g., giving a negative argument to +.BR log (3)). +When a domain error occurs, +math functions commonly return a NaN +(though some functions return a different value in this case); +.I errno +is set to +.BR EDOM , +and an "invalid" +.RB ( FE_INVALID ) +floating-point exception is raised. +.SS Pole Error +A +.I pole error +occurs when the mathematical result of a function is an exact infinity +(e.g., the logarithm of 0 is negative infinity). +When a pole error occurs, +the function returns the (signed) value +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +depending on whether the function result type is +.IR double , +.IR float , +or +.IR "long double" . +The sign of the result is that which is mathematically correct for +the function. +.I errno +is set to +.BR ERANGE , +and a "divide-by-zero" +.RB ( FE_DIVBYZERO ) +floating-point exception is raised. +.SS Range Error +A +.I range error +occurs when the magnitude of the function result means that it +cannot be represented in the result type of the function. +The return value of the function depends on whether the range error +was an overflow or an underflow. + +A floating result +.I overflows +if the result is finite, +but is too large to represented in the result type. +When an overflow occurs, +the function returns the value +.BR HUGE_VAL , +.BR HUGE_VALF , +or +.BR HUGE_VALL , +depending on whether the function result type is +.IR double , +.IR float , +or +.IR "long double" . +.I errno +is set to +.BR ERANGE , +and an "overflow" +.RB ( FE_OVERFLOW ) +floating-point exception is raised. + +A floating result +.I underflows +if the result is too small to be represented in the result type. +If an underflow occurs, +a mathematical function typically returns 0.0 +(C99 says a function shall return "an implementation-defined value +whose magnitude is no greater than the smallest normalized +positive number in the specified type"). +.I errno +may be set to +.BR ERANGE , +and an "overflow" +.RB ( FE_UNDERFLOW ) +floating-point exception may be raised. + +Some functions deliver a range error if the supplied argument value, +or the correct function result, would be +.IR subnormal . +A subnormal value is one that is nonzero, +but with a magnitude that is so small that +it can't be presented in normalized form +(i.e., with a 1 in the most significant bit of the significand). +The representation of a subnormal number will contain one +or more leading zeros in the significand. +.SH NOTES +The +.I math_errhandling +identifier specified by C99 and POSIX.1-2001 is not supported by glibc. +.\" See CONFORMANCE in the glibc 2.8 (and earlier) source. +This identifier is supposed to indicate which of the two +error-notification mechanisms +.RI ( errno , +exceptions retrievable via +.BR fettestexcept (3)) +is in use. +The standards require that at least one be in use, +but permit both to be available. +The current (version 2.8) situation under glibc is messy. +Most (but not all) functions raise exceptions on errors. +Some also set +.IR errno . +A few functions set +.IR errno , +but don't raise an exception. +A very few functions do neither. +See the individual manual pages for details. + +To avoid the complexities of using +.I errno +and +.BR fetestexcept (3) +for error checking, +it is often advised that one should instead check for bad argument +values before each call. +.\" http://www.securecoding.cert.org/confluence/display/seccode/FLP32-C.+Prevent+or+detect+domain+and+range+errors+in+math+functions +For example, the following code ensures that +.BR log (3)'s +argument is not a NaN and is not zero (a pole error) or +less than zero (a domain error): +.in +4n +.nf + +double x, r; + +if (isnan(x) || islessequal(x, 0)) { + /* Deal with NaN / pole error / domain error */ +} + +r = log(x); + +.fi +.in +The discussion on this page does not apply to the complex +mathematical functions (i.e., those declared by +.IR ), +which in general are not required to return errors by C99 +and POSIX.1-2001. + +The +.BR gcc (1) +.I "-fno-math-errno" +option causes the executable to employ implementations of some +mathematical functions that are faster than the standard +implementations, but do not set +.I errno +on error. +(The +.BR gcc (1) +.I "-ffast-math" +option also enables +.IR "-fno-math-errno" .) +An error can still be tested for using +.BR fetestexcept (3). +.SH SEE ALSO +.BR gcc (1), +.BR errno (3), +.BR fenv (3), +.BR fpclassify (3), +.BR INFINITY (3), +.BR isgreater (3), +.BR matherr (3), +.BR nan (3) +.br +.I "info libc" diff --git a/original/man7/mdoc.7 b/original/man7/mdoc.7 new file mode 100644 index 00000000..6977193d --- /dev/null +++ b/original/man7/mdoc.7 @@ -0,0 +1,438 @@ +.\" Copyright (c) 1991, 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. +.\" +.\" @(#)mdoc.7 8.2 (Berkeley) 12/30/93 +.\" $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. +.\" +.\" +.Dd July 11, 1999 +.Dt MDOC 7 +.Os Linux +.Sh NAME +.Nm mdoc +.Nd quick reference guide for the +.Nm \-mdoc +macro package +.Sh SYNOPSIS +.Nm groff +.Fl m Ns Ar doc +.Ar files ... +.Sh DESCRIPTION +The +.Nm \-mdoc +package is a set of content-based and domain-based macros +used to format the +.Bx +man pages. +The macro names and their meanings are +listed below for quick reference; for +a detailed explanation on using the package, +see the tutorial sampler +.Xr mdoc.samples 7 . +.Pp +Note that this is not the usual macro package for Linux documentation, +although it is used for documentation of several widely used programs; +see +.Xr man 7 . +.Pp +The macros are described in two groups, the first +includes the structural and physical page layout macros. +The second contains the manual and general text domain +macros which differentiate the +.Nm \-mdoc +package from other +.Xr troff +formatting packages. +.Sh PAGE STRUCTURE DOMAIN +.Ss Title Macros +To create a valid manual page, these three macros, in this order, +are required: +.Bl -tag -width "xxxx.Os OPERATINGxSYSTEM [version/release]" -compact +.It Li "\&.Dd " Ar "Month day, year" +Document date. +.It Li "\&.Dt " Ar "DOCUMENT_TITLE [section] [volume]" +Title, in upper case. +.It Li "\&.Os " Ar "OPERATING_SYSTEM [version/release]" +Operating system +.Pq Tn BSD . +.El +.Ss Page Layout Macros +Section headers, paragraph breaks, lists and displays. +.Bl -tag -width flag -compact +.It Li \&.Sh +Section Headers. +Valid headers, in the order of presentation: +.Bl -tag -width "RETURN VALUE" -compact +.It Ar NAME +Name section, should include the +.Ql \&.Nm +or +.Ql \&.Fn +and the +.Ql \&.Nd +macros. +.It Ar SYNOPSIS +Usage. +.It Ar DESCRIPTION +General description, should include +options and parameters. +.It Ar RETURN VALUE +Sections two and three function calls. +.It Ar ENVIRONMENT +Describe environment variables. +.It Ar FILES +Files associated with the subject. +.It Ar EXAMPLES +Examples and suggestions. +.It Ar DIAGNOSTICS +Normally used for section four device interface diagnostics. +.It Ar ERRORS +Sections two and three error and signal +handling. +.It Ar SEE ALSO +Cross references and citations. +.It Ar CONFORMING TO +Conformance to standards if applicable. +.It Ar HISTORY +If a standard is not applicable, the history +of the subject should be given. +.It Ar BUGS +Gotchas and caveats. +.It Ar other +Customized headers may be added at +the authors discretion. +.El +.It Li \&.Ss +Subsection Headers. +.It Li \&.Pp +Paragraph Break. +Vertical space (one line). +.It Li \&.D1 +(D-one) Display-one +Indent and display one text line. +.It Li \&.Dl +(D-ell) Display-one literal. +Indent and display one line of literal text. +.It Li \&.Bd +Begin-display block. +Display options: +.Bl -tag -width "xoffset string " -compact +.It Fl ragged +Unjustified (ragged edges). +.It Fl filled +Justified. +.It Fl literal +Literal text or code. +.It Fl file Ar name +Read in named +.Ar file +and display. +.It Fl offset Ar string +Offset display. +Acceptable +.Ar string +values: +.Bl -tag -width indent-two -compact +.It Ar left +Align block on left (default). +.It Ar center +Approximate center margin. +.It Ar indent +Six constant width spaces (a tab). +.It Ar indent-two +Two tabs. +.It Ar right +Left aligns block 2 inches from +right. +.It Ar xx Ns Cm n +Where +.Ar xx +is a number from +.No \&4 Ns Cm n +to +.No \&9\&9 Ns Cm n . +.It Ar Aa +Where +.Ar Aa +is a callable macro name. +.It Ar string +The width of +.Ar string +is used. +.El +.El +.It Li \&.Ed +End-display (matches \&.Bd). +.It Li \&.Bl +Begin-list. +Create lists or columns. +Options: +.Bl -tag -width flag -compact +.It Ar List-types +.Bl -column xbullet -compact +.It Fl bullet Ta "Bullet Item List" +.It Fl item Ta "Unlabeled List" +.It Fl enum Ta "Enumerated List" +.It Fl tag Ta "Tag Labeled List" +.It Fl diag Ta "Diagnostic List" +.It Fl hang Ta "Hanging Labeled List" +.It Fl ohang Ta "Overhanging Labeled List" +.It Fl inset Ta "Inset or Run-on Labeled List" +.El +.It List-parameters +.Bl -tag -width "xcompact " -compact +.It Fl offset +(All lists.) See +.Ql \&.Bd +begin-display above. +.It Fl width +.Pf ( Fl tag +and +.Fl hang +lists only.) +See +.Ql \&.Bd . +.It Fl compact +(All lists.) +Suppresses blank lines. +.El +.El +.It Li \&.El +End-list. +.It Li \&.It +List item. +.El +.Sh MANUAL AND GENERAL TEXT DOMAIN MACROS +The manual and general text domain macros are special in that +most of them are parsed for callable macros +for example: +.Bl -tag -width ".Op Fl s Ar filex" -offset indent +.It Li "\&.Op Fl s Ar file" +Produces +.Op Fl s Ar file +.El +.Pp +In this example, the option enclosure macro +.Ql \&.Op +is parsed, and calls the callable content macro +.Ql \&Fl +which operates on the argument +.Ql s +and then calls the callable content macro +.Ql \&Ar +which operates on the argument +.Ql file . +Some macros may be callable, but are not parsed and vice versa. +These macros are indicated in the +.Em parsed +and +.Em callable +columns below. +.Pp +Unless stated, manual domain macros share a common syntax: +.Pp +.Dl \&.Va argument [\ .\ ,\ ;\ :\ (\ )\ [\ ]\ argument \...\ ] +.Pp +.Sy Note : +Opening and closing +punctuation characters are only recognized as such if they are presented +one at a time. +The string +.Ql ")," +is not recognized as punctuation and will be output with a leading white +space and in what ever font the calling macro uses. +The +argument list +.Ql "] ) ," +is recognized as three sequential closing punctuation characters +and a leading white space is not output between the characters +and the previous argument (if any). +The special meaning of a punctuation character may be escaped +with the string +.Ql \e& . +For example the following string, +.Bl -tag -width "&.Ar file1\ , file2\ , file3\ )\ ." -offset indent +.It Li "\&.Ar file1\ , file2\ , file3\ )\ ." +Produces +.Ar file1 , file2 , file3 ) . +.El +.ne 1i +.Ss Manual Domain Macros +.Bl -column "Name" "Parsed" Callable" -compact +.It Em Name Parsed Callable Description +.It Li \&Ad Ta Yes Ta Yes Ta "Address. (This macro may be deprecated.)" +.It Li \&An Ta Yes Ta Yes Ta "Author name." +.It Li \&Ar Ta Yes Ta Yes Ta "Command-line argument." +.It Li \&Cd Ta \&No Ta \&No Ta "Configuration declaration (section four only)." +.It Li \&Cm Ta Yes Ta Yes Ta "Command-line argument modifier." +.It Li \&Dv Ta Yes Ta Yes Ta "Defined variable (source code)." +.It Li \&Er Ta Yes Ta Yes Ta "Error number (source code)." +.It Li \&Ev Ta Yes Ta Yes Ta "Environment variable." +.It Li \&Fa Ta Yes Ta Yes Ta "Function argument." +.It Li \&Fd Ta Yes Ta Yes Ta "Function declaration." +.It Li \&Fn Ta Yes Ta Yes Ta "Function call (also .Fo and .Fc)." +.It Li \&Ic Ta Yes Ta Yes Ta "Interactive command." +.It Li \&Li Ta Yes Ta Yes Ta "Literal text." +.It Li \&Nm Ta Yes Ta Yes Ta "Command name." +.It Li \&Op Ta Yes Ta Yes Ta "Option (also .Oo and .Oc)." +.It Li \&Ot Ta Yes Ta Yes Ta "Old style function type (Fortran only)." +.It Li \&Pa Ta Yes Ta Yes Ta "Pathname or filename." +.It Li \&St Ta Yes Ta Yes Ta "Standards (\-p1003.2, \-p1003.1 or \-ansiC)" +.It Li \&Va Ta Yes Ta Yes Ta "Variable name." +.It Li \&Vt Ta Yes Ta Yes Ta "Variable type (Fortran only)." +.It Li \&Xr Ta Yes Ta Yes Ta "Manual Page Cross Reference." +.El +.Ss General Text Domain Macros +.Bl -column "Name" "Parsed" Callable" -compact +.It Em "Name Parsed Callable Description" +.It Li \&%A Ta Yes Ta \&No Ta "Reference author." +.It Li \&%B Ta Yes Ta Yes Ta "Reference book title." +.It Li \&%\&C Ta \&No Ta \&No Ta "Reference place of publishing (city)." +.It Li \&%\&D Ta \&No Ta \&No Ta "Reference date." +.It Li \&%J Ta Yes Ta Yes Ta "Reference journal title." +.It Li \&%N Ta \&No Ta \&No Ta "Reference issue number." +.It Li \&%\&O Ta \&No Ta \&No Ta "Reference optional information." +.It Li \&%P Ta \&No Ta \&No Ta "Reference page number(s)." +.It Li \&%R Ta \&No Ta \&No Ta "Reference report Name." +.It Li \&%T Ta Yes Ta Yes Ta "Reference article title." +.It Li \&%V Ta \&No Ta \&No Ta "Reference volume." +.It Li \&Ac Ta Yes Ta Yes Ta "Angle close quote." +.It Li \&Ao Ta Yes Ta Yes Ta "Angle open quote." +.It Li \&Ap Ta Yes Ta Yes Ta "Apostrophe." +.It Li \&Aq Ta Yes Ta Yes Ta "Angle quote." +.It Li \&At Ta \&No Ta \&No Ta Tn "AT&T UNIX" +.It Li \&Bc Ta Yes Ta Yes Ta "Bracket close quote." +.It Li \&Bf Ta \&No Ta \&No Ta "Begin font mode." +.It Li \&Bo Ta Yes Ta Yes Ta "Bracket open quote." +.It Li \&Bq Ta Yes Ta Yes Ta "Bracket quote." +.It Li \&Bx Ta Yes Ta Yes Ta Bx . +.It Li \&Db Ta \&No Ta \&No Ta "Debug (default is \\*qoff\\*q)" +.It Li \&Dc Ta Yes Ta Yes Ta "Double close quote." +.It Li \&Do Ta Yes Ta Yes Ta "Double open quote." +.It Li \&Dq Ta Yes Ta Yes Ta "Double quote." +.It Li \&Ec Ta Yes Ta Yes Ta "Enclose string close quote." +.It Li \&Ef Ta \&No Ta \&No Ta "End font mode." +.It Li \&Em Ta Yes Ta Yes Ta "Emphasis (traditional English)." +.It Li \&Eo Ta Yes Ta Yes Ta "Enclose string open quote." +.It Li \&Fx Ta \&No Ta \&No Ta Tn "FreeBSD operating system" +.It Li \&No Ta Yes Ta Yes Ta "Normal text (no-op)." +.It Li \&Ns Ta Yes Ta Yes Ta "No space." +.It Li \&Pc Ta Yes Ta Yes Ta "Parenthesis close quote." +.It Li \&Pf Ta Yes Ta \&No Ta "Prefix string." +.It Li \&Po Ta Yes Ta Yes Ta "Parenthesis open quote." +.It Li \&Pq Ta Yes Ta Yes Ta "Parentheses quote." +.It Li \&Qc Ta Yes Ta Yes Ta "Straight Double close quote." +.It Li \&Ql Ta Yes Ta Yes Ta "Quoted literal." +.It Li \&Qo Ta Yes Ta Yes Ta "Straight Double open quote." +.It Li \&Qq Ta Yes Ta Yes Ta "Straight Double quote." +.It Li \&Re Ta \&No Ta \&No Ta "Reference end." +.It Li \&Rs Ta \&No Ta \&No Ta "Reference start." +.It Li \&Rv Ta \&No Ta \&No Ta "Return values (sections two and three only)." +.It Li \&Sc Ta Yes Ta Yes Ta "Single close quote." +.It Li \&So Ta Yes Ta Yes Ta "Single open quote." +.It Li \&Sq Ta Yes Ta Yes Ta "Single quote." +.It Li \&Sm Ta \&No Ta \&No Ta "Space mode (default is \\*qon\\*q)" +.It Li \&Sx Ta Yes Ta Yes Ta "Section Cross Reference." +.It Li \&Sy Ta Yes Ta Yes Ta "Symbolic (traditional English)." +.It Li \&Tn Ta Yes Ta Yes Ta "Trade or type name (small Caps)." +.It Li \&Ux Ta Yes Ta Yes Ta Ux +.It Li \&Xc Ta Yes Ta Yes Ta "Extend argument list close." +.It Li \&Xo Ta Yes Ta Yes Ta "Extend argument list open." +.El +.\" .It Sy \&Hf Ta \&No Ta \&No Ta "Include file with header" +.Pp +Macro names ending in +.Ql q +quote remaining items on the argument list. +Macro names ending in +.Ql o +begin a quote which may span more than one line of input and +are close quoted with the matching macro name ending in +.Ql c . +Enclosure macros may be nested and are limited to +eight arguments. +.Pp +Note: the extended argument list macros +.Pf ( Ql \&.Xo , +.Ql \&.Xc ) +and the function enclosure macros +.Pf ( Ql \&.Fo , +.Ql \&.Fc ) +are irregular. +The extended list macros are used when the number of macro arguments +would exceed the +.Xr troff +limitation of nine arguments. +.Pp +The macros UR (starting a URI/URL hypertext reference), UE (ending one), +and UN (identifying a target for a reference) are also available. +See +.Xr man 7 +for more information on these macros. +.\" 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 . +.Sh FILES +.Bl -tag -width "tmac.doc-ditroff" -compact +.It Pa doc.tmac +Manual and general text domain macros. +.It Pa tmac/doc-common +Common structural macros and definitions. +.It Pa tmac/doc-nroff +Site dependent +.Xr nroff +style file. +.It Pa tmac/doc-ditroff +Site dependent +.Xr troff +style file. +.It Pa tmac/doc-syms +Special defines (such as the standards macro). +.El +.Sh "SEE ALSO" +.Xr groff_mdoc 7 , +.Xr mdoc.samples 7 , +.Xr man 7 , +.Xr man-pages 7 +.Sh COLOPHON +This page is part of release 3.24 of the Linux +.Em man-pages +project. +A description of the project, +and information about reporting bugs, +can be found at +http://www.kernel.org/doc/man-pages/. diff --git a/original/man7/mdoc.samples.7 b/original/man7/mdoc.samples.7 new file mode 100644 index 00000000..e9e9a8e0 --- /dev/null +++ b/original/man7/mdoc.samples.7 @@ -0,0 +1,2953 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)mdoc.samples.7 8.2 (Berkeley) 12/30/93 +.\" $Id: mdoc.samples.7,v 1.17 1998/12/03 03:38:45 jkoshy Exp $ +.\" +.\" This tutorial sampler invokes every macro in the package several +.\" times and is guaranteed to give a worst case performance +.\" for an already extremely slow package. +.\" +.Dd December 30, 1993 +.Os +.Dt MDOC.SAMPLES 7 +.Sh NAME +.Nm mdoc.samples +.Nd tutorial sampler for writing +.Bx +manuals with +.Nm \-mdoc +.Sh SYNOPSIS +.Nm man mdoc.samples +.Sh DESCRIPTION +A tutorial sampler for writing +.Bx +manual pages with the +.Nm \-mdoc +macro package, a +.Em content Ns \-based +and +.Em domain Ns \-based +formatting +package for +.Xr troff 1 . +Its predecessor, the +.Xr \-man 7 +package, +addressed page layout leaving the +manipulation of fonts and other +typesetting details to the individual author. +In +.Nm \-mdoc , +page layout macros +make up the +.Em "page structure domain" +which consists of macros for titles, section headers, displays +and lists. Essentially items which affect the physical position +of text on a formatted page. +In addition to the page structure domain, there are two more domains, +the manual domain and the general text domain. +The general text domain is defined as macros which +perform tasks such as quoting or emphasizing pieces of text. +The manual domain is defined as macros that are a subset of the +day to day informal language used to describe commands, routines +and related +.Bx +files. +Macros in the manual domain handle +command names, command-line arguments and options, function names, +function parameters, pathnames, variables, cross +references to other manual pages, and so on. +These domain +items have value +for both the author and the future user of the manual page. +It is hoped the consistency gained +across the manual set will provide easier +translation to future documentation tools. +.Pp +Throughout the +.Ux +manual pages, a manual entry +is simply referred +to as a man page, regardless of actual length and without +sexist intention. +.Sh GETTING STARTED +Since a tutorial document is normally read when a person +desires to use the material immediately, the assumption has +been made that the user of this document may be impatient. +The material presented in the remained of this document is +outlined as follows: +.Bl -enum -offset indent +.It +.Tn "TROFF IDIOSYNCRASIES" +.Bl -tag -width flag -compact -offset indent +.It "Macro Usage" . +.It "Passing Space Characters in an Argument" . +.It "Trailing Blank Space Characters (a warning)" . +.It "Escaping Special Characters" . +.El +.It +.Tn "THE ANATOMY OF A MAN PAGE" +.Bl -tag -width flag -compact -offset indent +.It "A manual page template" . +.El +.It +.Tn "TITLE MACROS" . +.It +.Tn "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS" . +.Bl -tag -width flag -compact -offset indent +.It "What's in a name..." . +.It "General Syntax" . +.El +.It +.Tn "MANUAL DOMAIN" +.Bl -tag -width flag -compact -offset indent +.It "Addresses" . +.It "Author name" . +.It "Arguments" . +.It "Configuration Declarations (section four only)" . +.It "Command Modifier" . +.It "Defined Variables" . +.It "Errno's (Section two only)" . +.It "Environment Variables" . +.It "Function Argument" . +.It "Function Declaration" . +.It "Flags" . +.It "Functions (library routines)" . +.It "Function Types" . +.\" .It "Header File (including source code)" . +.It "Interactive Commands" . +.It "Names" . +.It "Options" . +.It "Pathnames" . +.It "Variables" . +.It "Cross References" . +.El +.It +.Tn "GENERAL TEXT DOMAIN" +.Bl -tag -width flag -compact -offset indent +.It "AT&T Macro" . +.It "BSD Macro" . +.It "FreeBSD Macro" . +.It "UNIX Macro" . +.It "Enclosure/Quoting Macros" +.Bl -tag -width flag -compact -offset indent +.It "Angle Bracket Quote/Enclosure" . +.It "Bracket Quotes/Enclosure" . +.It "Double Quote macro/Enclosure" . +.It "Parenthesis Quote/Enclosure" . +.It "Single Quotes/Enclosure" . +.It "Prefix Macro" . +.El +.It "No\-Op or Normal Text Macro" . +.It "No Space Macro" . +.It "Section Cross References" . +.It "References and Citations" . +.It "Return Values (sections two and three only)" +.It "Trade Names (Acronyms and Type Names)" . +.It "Extended Arguments" . +.El +.It +.Tn "PAGE STRUCTURE DOMAIN" +.Bl -tag -width flag -compact -offset indent +.It "Section Headers" . +.It "Paragraphs and Line Spacing" . +.It "Keeps" . +.It "Displays" . +.It "Font Modes (Emphasis, Literal, and Symbolic)" . +.It "Lists and Columns" . +.El +.It +.Tn "PREDEFINED STRINGS" +.It +.Tn "DIAGNOSTICS" +.It +.Tn "FORMATTING WITH GROFF, TROFF AND NROFF" +.It +.Tn "BUGS" +.El +.ne 7 +.Sh TROFF IDIOSYNCRASIES +The +.Nm \-mdoc +package attempts to simplify the process of writing a man page. +Theoretically, one should not have to learn the dirty details of +.Xr troff 1 +to use +.Nm \-mdoc ; +however, there are a few +limitations which are unavoidable and best gotten out +of the way. +And, too, be forewarned, this package is +.Em not +fast. +.Ss Macro Usage +As in +.Xr troff 1 , +a macro is called by placing a +.Ql \&\. +(dot character) +at the beginning of +a line followed by the two character name for the macro. +Arguments may follow the macro separated by spaces. +It is the dot character at the beginning of the line which causes +.Xr troff 1 +to interpret the next two characters as a macro name. +To place a +.Ql \&\. +(dot character) +at the beginning of a line in some context other than +a macro invocation, precede the +.Ql \&\. +(dot) with the +.Ql \e& +escape sequence. +The +.Ql \e& +translates literally to a zero width space, and is never displayed in the +output. +.Pp +In general, +.Xr troff 1 +macros accept up to nine arguments, any +extra arguments are ignored. +Most macros in +.Nm \-mdoc +accept nine arguments and, +in limited cases, arguments may be continued or extended +on the +next line (See +.Sx Extensions ) . +A few macros handle quoted arguments (see +.Sx Passing Space Characters in an Argument +below). +.Pp +Most of the +.Nm \-mdoc +general text domain and manual domain macros are special +in that their argument lists are +.Em parsed +for callable macro names. +This means an argument on the argument list which matches +a general text or manual domain macro name and is determined +to be callable will be executed +or called when it is processed. +In this case +the argument, although the name of a macro, +is not preceded by a +.Ql \&\. +(dot). +It is in this manner that many macros are nested; for +example +the option macro, +.Ql \&.Op , +may +.Em call +the flag and argument macros, +.Ql \&Fl +and +.Ql \&Ar , +to specify an optional flag with an argument: +.Bl -tag -width "\&.Op \&Fl s \&Ar bytes" -offset indent +.It Op Fl s Ar bytes +is produced by +.Li \&.Op \&Fl s \&Ar bytes +.El +.Pp +To prevent a two character +string from being interpreted as a macro name, precede +the string with the +escape sequence +.Ql \e& : +.Bl -tag -width "\&.Op \&Fl s \&Ar bytes" -offset indent +.It Op \&Fl s \&Ar bytes +is produced by +.Li \&.Op \e&Fl s \e&Ar bytes +.El +.Pp +Here the strings +.Ql \&Fl +and +.Ql \&Ar +are not interpreted as macros. +Macros whose argument lists are parsed for callable arguments +are referred to +as parsed and macros which may be called from an argument +list are referred to as callable +throughout this document and in the companion quick reference +manual +.Xr mdoc 7 . +This is a technical +.Em faux pas +as almost all of the macros in +.Nm \-mdoc +are parsed, but as it was cumbersome to constantly refer to macros +as being callable and being able to call other macros, +the term parsed has been used. +.Ss Passing Space Characters in an Argument +Sometimes it is desirable to give as one argument a string +containing one or more blank space characters. +This may be necessary +to defeat the nine argument limit or to specify arguments to macros +which expect particular arrangement of items in the argument list. +For example, +the function macro +.Ql \&.Fn +expects the first argument to be the name of a function and any +remaining arguments to be function parameters. +As +.Tn "ANSI C" +stipulates the declaration of function parameters in the +parenthesized parameter list, each parameter is guaranteed +to be at minimum a two word string. +For example, +.Fa int foo . +.Pp +There are two possible ways to pass an argument which contains +an embedded space. +.Em Implementation note : +Unfortunately, the most convenient way +of passing spaces in between quotes by reassigning individual +arguments before parsing was fairly expensive speed wise +and space wise to implement in all the macros for +.Tn AT&T +.Xr troff . +It is not expensive for +.Xr groff +but for the sake of portability, has been limited +to the following macros which need +it the most: +.Pp +.Bl -tag -width 4n -offset indent -compact +.It Li \&Cd +Configuration declaration (section 4 +.Sx SYNOPSIS ) +.It Li \&Bl +Begin list (for the width specifier). +.It Li \&Em +Emphasized text. +.It Li \&Fn +Functions (sections two and four). +.It Li \&It +List items. +.It Li \&Li +Literal text. +.It Li \&Sy +Symbolic text. +.It Li \&%B +Book titles. +.It Li \&%J +Journal names. +.It Li \&%O +Optional notes for a reference. +.It Li \&%R +Report title (in a reference). +.It Li \&%T +Title of article in a book or journal. +.El +.Pp +One way of passing a string +containing blank spaces is to use the hard or unpaddable space character +.Ql \e\ , +that is, a blank space preceded by the escape character +.Ql \e . +This method may be used with any macro but has the side effect +of interfering with the adjustment of text +over the length of a line. +.Xr Troff +sees the hard space as if it were any other printable character and +cannot split the string into blank or newline separated pieces as one +would expect. +The method is useful for strings which are not expected +to overlap a line boundary. +For example: +.Bl -tag -width "fetch(char *str)" -offset indent +.It Fn fetch char\ *str +is created by +.Ql \&.Fn fetch char\e *str +.It Fn fetch "char *str" +can also be created by +.Ql \&.Fn fetch "\\*qchar *str\\*q" +.El +.Pp +If the +.Ql \e +or quotes +were omitted, +.Ql \&.Fn +would see three arguments and +the result would be: +.Pp +.Dl Fn fetch char *str +.Pp +For an example of what happens when the parameter list overlaps +a newline boundary, see the +.Sx BUGS +section. +.Ss Trailing Blank Space Characters +.Xr Troff +can be confused by blank space characters at the end of a line. +It +is a wise preventive measure to globally remove all blank spaces +from character sequences. +Should the need +arise to force a blank character at the end of a line, +it may be forced with an unpaddable space and the +.Ql \e& +escape character. +For example, +.Ql string\e\ \e& . +.Ss Escaping Special Characters +Special characters +like the newline character +.Ql \en , +are handled by replacing the +.Ql \e +with +.Ql \ee +(e.g. +.Ql \een ) +to preserve +the backslash. +.Sh THE ANATOMY OF A MAN PAGE +The body of a man page is easily constructed from a basic +template found in the file +.Pa /usr/share/misc/mdoc.template . +Several example man pages can also be found +in +.Pa /usr/share/examples/mdoc . +.Pp +.Ss A manual page template +.Bd -literal -offset indent +\&.\e" The following requests are required for all man pages. +\&.Dd Month day, year +\&.Os OPERATING_SYSTEM [version/release] +\&.Dt DOCUMENT_TITLE [section number] [volume] +\&.Sh NAME +\&.Nm name +\&.Nd one line description of name +\&.Sh SYNOPSIS +\&.Sh DESCRIPTION +\&.\e" The following requests should be uncommented and +\&.\e" used where appropriate. This next request is +\&.\e" for sections 2 and 3 function return values only. +\&.\e" .Sh RETURN VALUE +\&.\e" This next request is for sections 1, 6, 7 & 8 only +\&.\e" .Sh ENVIRONMENT +\&.\e" .Sh FILES +\&.\e" .Sh EXAMPLES +\&.\e" This next request is for sections 1, 6, 7 & 8 only +\&.\e" (command return values (to shell) and +\&.\e" fprintf/stderr type diagnostics) +\&.\e" .Sh DIAGNOSTICS +\&.\e" The next request is for sections 2 and 3 error +\&.\e" and signal handling only. +\&.\e" .Sh ERRORS +\&.\e" .Sh SEE ALSO +\&.\e" .Sh CONFORMING TO +\&.\e" .Sh HISTORY +\&.\e" .Sh AUTHORS +\&.\e" .Sh BUGS +.Ed +.Pp +The first items in the template are the macros +.Pq Li \&.Dd , \&.Os , \&.Dt ; +the document date, +the operating system the man page or subject source is developed +or modified for, +and the man page title +.Pq Em in upper case +along with the section of the manual the page +belongs in. +These macros identify the page, +and are discussed below in +.Sx TITLE MACROS . +.Pp +The remaining items in the template are section headers +.Pq Li \&.Sh ; +of which +.Sx NAME , +.Sx SYNOPSIS +and +.Sx DESCRIPTION +are mandatory. +The +headers are +discussed in +.Sx PAGE STRUCTURE DOMAIN , +after +presentation of +.Sx MANUAL DOMAIN . +Several content macros are used to demonstrate page layout macros; +reading about content macros before page layout macros is +recommended. +.Sh TITLE MACROS +The title macros are the first portion of the page structure +domain, but are presented first and separate for someone who +wishes to start writing a man page yesterday. +Three header macros designate the document title or manual page title, +the operating system, +and the date of authorship. +These macros are one called once at the very beginning of the document +and are used to construct the headers and footers only. +.Bl -tag -width 6n +.It Li \&.Dt DOCUMENT_TITLE section# [volume] +The document title is the +subject of the man page and must be in +.Tn CAPITALS +due to troff +limitations. +The section number may be 1,\ ...,\ 8, +and if it is specified, +the volume title may be omitted. +A volume title may be arbitrary or one of the following: +.\" .Cl +.\" USD UNIX User's Supplementary Documents +.\" .Cl +.\" PS1 UNIX Programmer's Supplementary Documents +.Pp +.Bl -column SMM -offset indent -compact +.It Li AMD UNIX Ancestral Manual Documents +.It Li SMM UNIX System Manager's Manual +.It Li URM UNIX Reference Manual +.It Li PRM UNIX Programmer's Manual +.El +.Pp +The default volume labeling is +.Li URM +for sections 1, 6, and 7; +.Li SMM +for section 8; +.Li PRM +for sections 2, 3, 4, and 5. +.\" .Cl +.\" MMI UNIX Manual Master Index +.\" .Cl +.\" CON UNIX Contributed Software Manual +.\" .Cl +.\" LOC UNIX Local Manual +.It Li \&.Os operating_system release# +The name of the operating system +should be the common acronym, for example, +.Tn BSD +or +.Tn FreeBSD +or +.Tn ATT . +The release should be the standard release +nomenclature for the system specified, for example, 4.3, 4.3+Tahoe, V.3, +V.4. +Unrecognized arguments are displayed as given in the page footer. +For instance, a typical footer might be: +.Pp +.Dl \&.Os 4.3BSD +.Pp +or +.Dl \&.Os FreeBSD 2.2 +.Pp +or for a locally produced set +.Pp +.Dl \&.Os CS Department +.Pp +The Berkeley default, +.Ql \&.Os +without an argument, has been defined as +.Tn BSD +in the +site-specific file +.Pa /usr/share/tmac/mdoc/doc-common . +It really should default to +.Tn LOCAL . +Note, if the +.Ql \&.Os +macro is not present, the bottom left corner of the page +will be ugly. +.It Li \&.Dd month day, year +The date should be written formally: +.Pp +.ne 5 +.Dl January 25, 1989 +.El +.Sh INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS +.Ss What's in a name... +The manual domain macro names are derived from the day to day +informal language used to describe commands, subroutines and related +files. +Slightly different variations of this language are used to describe +the three different aspects of writing a man page. +First, there is the description of +.Nm \-mdoc +macro request usage. +Second is the description of a +.Ux +command +.Em with +.Nm \-mdoc +macros and third, +the description of a command to a user in the verbal sense; +that is, discussion of a command in the text of a man page. +.Pp +In the first case, +.Xr troff 1 +macros are themselves a type of command; +the general syntax for a troff command is: +.Bd -filled -offset indent +\&.Va argument1 argument2 ... argument9 +.Ed +.Pp +The +.Ql \&.Va +is a macro command or request, and anything following it is an argument to +be processed. +In the second case, +the description of a +.Ux +command using the content macros is a +bit more involved; +a typical +.Sx SYNOPSIS +command line might be displayed as: +.Bd -filled -offset indent +.Nm filter +.Op Fl flag +.Ar infile outfile +.Ed +.Pp +Here, +.Nm filter +is the command name and the +bracketed string +.Fl flag +is a +.Em flag +argument designated as optional by the option brackets. +In +.Nm \-mdoc +terms, +.Ar infile +and +.Ar outfile +are +called +.Em arguments . +The macros which formatted the above example: +.Bd -literal -offset indent +\&.Nm filter +\&.Op \&Fl flag +\&.Ar infile outfile +.Ed +.Pp +In the third case, discussion of commands and command syntax +includes both examples above, but may add more detail. +The +arguments +.Ar infile +and +.Ar outfile +from the example above might be referred to as +.Em operands +or +.Em file arguments . +Some command-line argument lists are quite long: +.Bl -tag -width make -offset indent +.It Nm make +.Op Fl eiknqrstv +.Op Fl D Ar variable +.Op Fl d Ar flags +.Op Fl f Ar makefile +.Bk -words +.Op Fl I Ar directory +.Ek +.Op Fl j Ar max_jobs +.Op Ar variable=value +.Bk -words +.Op Ar target ... +.Ek +.El +.Pp +Here one might talk about the command +.Nm make +and qualify the argument +.Ar makefile , +as an argument to the flag, +.Fl f , +or discuss the optional +file +operand +.Ar target . +In the verbal context, such detail can prevent confusion, +however the +.Nm \-mdoc +package +does not have a macro for an argument +.Em to +a flag. +Instead the +.Ql \&Ar +argument macro is used for an operand or file argument like +.Ar target +as well as an argument to a flag like +.Ar variable . +The make command line was produced from: +.Bd -literal -offset indent +\&.Nm make +\&.Op Fl eiknqrstv +\&.Op Fl D Ar variable +\&.Op Fl d Ar flags +\&.Op Fl f Ar makefile +\&.Op Fl I Ar directory +\&.Op Fl j Ar max_jobs +\&.Op Ar variable=value +\&.Bk -words +\&.Op Ar target ... +\&.Ek +.Ed +.Pp +The +.Ql \&.Bk +and +.Ql \&.Ek +macros are explained in +.Sx Keeps . +.Ss General Syntax +The manual domain and general text domain macros share a similar +syntax with a few minor deviations: +.Ql \&.Ar , +.Ql \&.Fl , +.Ql \&.Nm , +and +.Ql \&.Pa +differ only when called without arguments; +.Ql \&.Fn +and +.Ql \&.Xr +impose an order on their argument lists +and the +.Ql \&.Op +and +.Ql \&.Fn +macros +have nesting limitations. +All content macros +are capable of recognizing and properly handling punctuation, +provided each punctuation character is separated by a leading space. +If a request is given: +.Pp +.Dl \&.Li sptr, ptr), +.Pp +The result is: +.Pp +.Dl Li sptr, ptr), +.Pp +The punctuation is not recognized and all is output in the +literal font. If the punctuation is separated by a leading +white space: +.Pp +.Dl \&.Li "sptr , ptr ) ," +.Pp +The result is: +.Pp +.Dl Li sptr , ptr ) , +.Pp +The punctuation is now recognized and is output in the +default font distinguishing it from the strings in literal font. +.Pp +To remove the special meaning from a punctuation character +escape it with +.Ql \e& . +.Xr Troff +is limited as a macro language, and has difficulty +when presented with a string containing +a member of the mathematical, logical or +quotation set: +.Bd -literal -offset indent-two +\&{+,\-,/,*,\&%,<,>,<=,>=,=,==,&,`,',"} +.Ed +.Pp +The problem is that +.Xr troff +may assume it is supposed to actually perform the operation +or evaluation suggested by the characters. To prevent +the accidental evaluation of these characters, +escape them with +.Ql \e& . +Typical syntax is shown in the first content macro displayed +below, +.Ql \&.Ad . +.Sh MANUAL DOMAIN +.Ss Address Macro +The address macro identifies an address construct +of the form addr1[,addr2[,addr3]]. +.Pp +.Dl Usage: .Ad address ... \*(Pu +.Bl -tag -width ".Ad f1 , f2 , f3 :" -compact -offset 14n +.It Li \&.Ad addr1 +.Ad addr1 +.It Li \&.Ad addr1\ . +.Ad addr1 . +.It Li \&.Ad addr1\ , file2 +.Ad addr1 , file2 +.It Li \&.Ad f1\ , f2\ , f3\ : +.Ad f1 , f2 , f3 : +.It Li \&.Ad addr\ )\ )\ , +.Ad addr ) ) , +.El +.Pp +It is an error to call +.Ql \&.Ad +without arguments. +.Ql \&.Ad +is callable by other macros and is parsed. +.Ss Author Name +The +.Ql \&.An +macro is used to specify the name of the author of the item being +documented, or the name of the author of the actual manual page. +Any remaining arguments after the name information are assumed +to be punctuation. +.Pp +.Dl Usage: .An author_name \*(Pu +.Bl -tag -width ".An Joe Author ) ) ," -compact -offset 14n +.It Li \&.An Joe\ Author +.An Joe Author +.It Li \&.An Joe\ Author\ , +.An Joe\ Author , +.It Li \&.An Joe\ Author\ \&Aq\ nobody@FreeBSD.ORG +.An Joe Author Aq nobody@FreeBSD.ORG +.It Li \&.An Joe\ Author\ )\ )\ , +.An Joe Author ) ) , +.El +.Pp +The +.Ql \&.An +macro is parsed and is callable. +It is an error to call +.Ql \&.An +without +any arguments. +.Ss Argument Macro +The +.Ql \&.Ar +argument macro may be used whenever +a command-line argument is referenced. +.Pp +.Dl Usage: .Ar argument ... \*(Pu +.Bl -tag -width ".Ar file1 file2" -compact -offset 15n +.It Li \&.Ar +.Ar +.It Li \&.Ar file1 +.Ar file1 +.It Li \&.Ar file1\ . +.Ar file1 . +.It Li \&.Ar file1 file2 +.Ar file1 file2 +.It Li \&.Ar f1 f2 f3\ : +.Ar f1 f2 f3 : +.It Li \&.Ar file\ )\ )\ , +.Ar file ) ) , +.El +.Pp +If +.Ql \&.Ar +is called without arguments +.Ql Ar +is assumed. +The +.Ql \&.Ar +macro is parsed and is callable. +.Ss Configuration Declaration (section four only) +The +.Ql \&.Cd +macro is used to demonstrate a +.Xr config 8 +declaration for a device interface in a section four manual. +This macro accepts quoted arguments (double quotes only). +.Pp +.Bl -tag -width "device le0 at scode?" -offset indent +.It Cd "device le0 at scode?" +produced by: +.Ql ".Cd device le0 at scode?" . +.El +.Ss Command Modifier +The command modifier is identical to the +.Ql \&.Fl +(flag) command with the exception +the +.Ql \&.Cm +macro does not assert a dash +in front of every argument. +Traditionally flags are marked by the +preceding dash, some commands or subsets of commands do not use them. +Command modifiers may also be specified in conjunction with interactive +commands such as editor commands. +See +.Sx Flags . +.Ss Defined Variables +A variable which is defined in an include file is specified +by the macro +.Ql \&.Dv . +.Pp +.Dl Usage: .Dv defined_variable ... \*(Pu +.Bl -tag -width ".Dv MAXHOSTNAMELEN" -compact -offset 14n +.It Li ".Dv MAXHOSTNAMELEN" +.Dv MAXHOSTNAMELEN +.It Li ".Dv TIOCGPGRP )" +.Dv TIOCGPGRP ) +.El +.Pp +It is an error to call +.Ql \&.Dv +without arguments. +.Ql \&.Dv +is parsed and is callable. +.Ss Errno's (Section two only) +The +.Ql \&.Er +errno macro specifies the error return value +for section two library routines. +The second example +below shows +.Ql \&.Er +used with the +.Ql \&.Bq +general text domain macro, as it would be used in +a section two manual page. +.Pp +.Dl Usage: .Er ERRNOTYPE ... \*(Pu +.Bl -tag -width ".Bq Er ENOTDIR" -compact -offset 14n +.It Li \&.Er ENOENT +.Er ENOENT +.It Li \&.Er ENOENT\ )\ ; +.Er ENOENT ) ; +.It Li \&.Bq \&Er ENOTDIR +.Bq Er ENOTDIR +.El +.Pp +It is an error to call +.Ql \&.Er +without arguments. +The +.Ql \&.Er +macro is parsed and is callable. +.Ss Environment Variables +The +.Ql \&.Ev +macro specifies an environment variable. +.Pp +.Dl Usage: .Ev argument ... \*(Pu +.Bl -tag -width ".Ev PRINTER ) ) ," -compact -offset 14n +.It Li \&.Ev DISPLAY +.Ev DISPLAY +.It Li \&.Ev PATH\ . +.Ev PATH . +.It Li \&.Ev PRINTER\ )\ )\ , +.Ev PRINTER ) ) , +.El +.Pp +It is an error to call +.Ql \&.Ev +without arguments. +The +.Ql \&.Ev +macro is parsed and is callable. +.Ss Function Argument +The +.Ql \&.Fa +macro is used to refer to function arguments (parameters) +outside of the +.Sx SYNOPSIS +section of the manual or inside +the +.Sx SYNOPSIS +section should a parameter list be too +long for the +.Ql \&.Fn +macro and the enclosure macros +.Ql \&.Fo +and +.Ql \&.Fc +must be used. +.Ql \&.Fa +may also be used to refer to structure members. +.Pp +.Dl Usage: .Fa function_argument ... \*(Pu +.Bl -tag -width ".Fa d_namlen\ )\ )\ ," -compact -offset 14n +.It Li \&.Fa d_namlen\ )\ )\ , +.Fa d_namlen ) ) , +.It Li \&.Fa iov_len +.Fa iov_len +.El +.Pp +It is an error to call +.Ql \&.Fa +without arguments. +.Ql \&.Fa +is parsed and is callable. +.Ss Function Declaration +The +.Ql \&.Fd +macro is used in the +.Sx SYNOPSIS +section with section two or three +functions. +The +.Ql \&.Fd +macro does not call other macros and is not callable by other +macros. +.Pp +.Dl Usage: .Fd include_file (or defined variable) +.Pp +In the +.Sx SYNOPSIS +section a +.Ql \&.Fd +request causes a line break if a function has already been presented +and a break has not occurred. +This leaves a nice vertical space +in between the previous function call and the declaration for the +next function. +.Ss Flags +The +.Ql \&.Fl +macro handles command-line flags. +It prepends +a dash, +.Ql \- , +to the flag. +For interactive command flags, which +are not prepended with a dash, the +.Ql \&.Cm +(command modifier) +macro is identical, but without the dash. +.Pp +.Dl Usage: .Fl argument ... \*(Pu +.Bl -tag -width ".Fl \-s \-t \-v" -compact -offset 14n +.It Li \&.Fl +.Fl +.It Li \&.Fl cfv +.Fl cfv +.It Li \&.Fl cfv\ . +.Fl cfv . +.It Li \&.Fl s v t +.Fl s v t +.It Li \&.Fl -\ , +.Fl - , +.It Li \&.Fl xyz\ )\ , +.Fl xyz ) , +.El +.Pp +The +.Ql \&.Fl +macro without any arguments results +in a dash representing \fIstdin\fP/\fIstdout\fP. +Note that giving +.Ql \&.Fl +a single dash, will result in two dashes. +The +.Ql \&.Fl +macro is parsed and is callable. +.Ss Functions (library routines) +The .Fn macro is modeled on ANSI C conventions. +.Bd -literal +Usage: .Fn [type] function [[type] parameters ... \*(Pu] +.Ed +.Bl -tag -width ".Fn _int align_ _const * char *sptrsxx" -compact +.It Li "\&.Fn getchar" +.Fn getchar +.It Li "\&.Fn strlen ) ," +.Fn strlen ) , +.It Li \&.Fn "\\*qint align\\*q" "\\*qconst * char *sptrs\\*q" , +.Fn "int align" "const * char *sptrs" , +.El +.Pp +It is an error to call +.Ql \&.Fn +without any arguments. +The +.Ql \&.Fn +macro +is parsed and is callable, +note that any call to another macro signals the end of +the +.Ql \&.Fn +call (it will close-parenthesis at that point). +.Pp +For functions that have more than eight parameters (and this +is rare), the +macros +.Ql \&.Fo +(function open) +and +.Ql \&.Fc +(function close) +may be used with +.Ql \&.Fa +(function argument) +to get around the limitation. +For example: +.Bd -literal -offset indent +\&.Fo "int res_mkquery" +\&.Fa "int op" +\&.Fa "char *dname" +\&.Fa "int class" +\&.Fa "int type" +\&.Fa "char *data" +\&.Fa "int datalen" +\&.Fa "struct rrec *newrr" +\&.Fa "char *buf" +\&.Fa "int buflen" +\&.Fc +.Ed +.Pp +Produces: +.Bd -filled -offset indent +.Fo "int res_mkquery" +.Fa "int op" +.Fa "char *dname" +.Fa "int class" +.Fa "int type" +.Fa "char *data" +.Fa "int datalen" +.Fa "struct rrec *newrr" +.Fa "char *buf" +.Fa "int buflen" +.Fc +.Ed +.Pp +The +.Ql \&.Fo +and +.Ql \&.Fc +macros are parsed and are callable. +In the +.Sx SYNOPSIS +section, the function will always begin at +the beginning of line. +If there is more than one function +presented in the +.Sx SYNOPSIS +section and a function type has not been +given, a line break will occur, leaving a nice vertical space +between the current function name and the one prior. +At the moment, +.Ql \&.Fn +does not check its word boundaries +against troff line lengths and may split across a newline +ungracefully. +This will be fixed in the near future. +.Ss Function Type +This macro is intended for the +.Sx SYNOPSIS +section. +It may be used +anywhere else in the man page without problems, but its main purpose +is to present the function type in kernel normal form for the +.Sx SYNOPSIS +of sections two and three +(it causes a line break allowing the function name to appear +on the next line). +.Pp +.Dl Usage: .Ft type ... \*(Pu +.Bl -tag -width "\&.Ft struct stat" -offset 14n -compact +.It Li \&.Ft struct stat +.Ft struct stat +.El +.Pp +The +.Ql \&.Ft +request is not callable by other macros. +.Ss Interactive Commands +The +.Ql \&.Ic +macro designates an interactive or internal command. +.Pp +.Dl Usage: .Ic argument ... \*(Pu +.Bl -tag -width ".Ic setenv , unsetenvxx" -compact -offset 14n +.It Li \&.Ic :wq +.Ic :wq +.It Li \&.Ic do while {...} +.Ic do while {...} +.It Li \&.Ic setenv\ , unsetenv +.Ic setenv , unsetenv +.El +.Pp +It is an error to call +.Ql \&.Ic +without arguments. +The +.Ql \&.Ic +macro is parsed and is callable. +.Ss Name Macro +The +.Ql \&.Nm +macro is used for the document title or subject name. +It has the peculiarity of remembering the first +argument it was called with, which should +always be the subject name of the page. +When called without +arguments, +.Ql \&.Nm +regurgitates this initial name for the sole purpose +of making less work for the author. +Note: +a section two +or three document function name is addressed with the +.Ql \&.Nm +in the +.Sx NAME +section, and with +.Ql \&.Fn +in the +.Sx SYNOPSIS +and remaining sections. +For interactive commands, such as the +.Ql while +command keyword in +.Xr csh 1 , +the +.Ql \&.Ic +macro should be used. +While the +.Ql \&.Ic +is nearly identical +to +.Ql \&.Nm , +it can not recall the first argument it was invoked with. +.Pp +.Dl Usage: .Nm argument ... \*(Pu +.Bl -tag -width ".Nm mdoc.sample" -compact -offset 14n +.It Li \&.Nm mdoc.sample +.Nm mdoc.sample +.It Li \&.Nm \e-mdoc +.Nm \-mdoc . +.It Li \&.Nm foo\ )\ )\ , +.Nm foo ) ) , +.It Li \&.Nm +.Nm +.El +.Pp +The +.Ql \&.Nm +macro is parsed and is callable. +.Ss Options +The +.Ql \&.Op +macro +places option brackets around the any remaining arguments on the command +line, and places any +trailing punctuation outside the brackets. +The macros +.Ql \&.Oc +and +.Ql \&.Oo +may be used across one or more lines. +.Pp +.Dl Usage: .Op options ... \*(Pu +.Bl -tag -width ".Op Fl c Ar objfil Op Ar corfil ," -compact -offset indent +.It Li \&.Op +.Op +.It Li ".Op Fl k" +.Op Fl k +.It Li ".Op Fl k ) ." +.Op Fl k ) . +.It Li ".Op Fl k Ar kookfile" +.Op Fl k Ar kookfile +.It Li ".Op Fl k Ar kookfile ," +.Op Fl k Ar kookfile , +.It Li ".Op Ar objfil Op Ar corfil" +.Op Ar objfil Op Ar corfil +.It Li ".Op Fl c Ar objfil Op Ar corfil ," +.Op Fl c Ar objfil Op Ar corfil , +.It Li \&.Op word1 word2 +.Op word1 word2 +.El +.Pp +The +.Ql \&.Oc +and +.Ql \&.Oo +macros: +.Bd -literal -offset indent +\&.Oo +\&.Op \&Fl k \&Ar kilobytes +\&.Op \&Fl i \&Ar interval +\&.Op \&Fl c \&Ar count +\&.Oc +.Ed +.Pp +Produce: +.Oo +.Op Fl k Ar kilobytes +.Op Fl i Ar interval +.Op Fl c Ar count +.Oc +.Pp +The macros +.Ql \&.Op , +.Ql \&.Oc +and +.Ql \&.Oo +are parsed and are callable. +.Ss Pathnames +The +.Ql \&.Pa +macro formats pathnames or filenames. +.Pp +.Dl Usage: .Pa pathname \*(Pu +.Bl -tag -width ".Pa /tmp/fooXXXXX ) ." -compact -offset 14n +.It Li \&.Pa /usr/share +.Pa /usr/share +.It Li \&.Pa /tmp/fooXXXXX\ )\ . +.Pa /tmp/fooXXXXX ) . +.El +.Pp +The +.Ql \&.Pa +macro is parsed and is callable. +.Ss Variables +Generic variable reference: +.Pp +.Dl Usage: .Va variable ... \*(Pu +.Bl -tag -width ".Va char s ] ) ) ," -compact -offset 14n +.It Li \&.Va count +.Va count +.It Li \&.Va settimer , +.Va settimer , +.It Li \&.Va int\ *prt\ )\ : +.Va int\ *prt ) : +.It Li \&.Va char\ s\ ]\ )\ )\ , +.Va char\ s ] ) ) , +.El +.Pp +It is an error to call +.Ql \&.Va +without any arguments. +The +.Ql \&.Va +macro is parsed and is callable. +.Ss Manual Page Cross References +The +.Ql \&.Xr +macro expects the first argument to be +a manual page name, and the second argument, if it exists, +to be either a section page number or punctuation. +Any +remaining arguments are assumed to be punctuation. +.Pp +.Dl Usage: .Xr man_page [1,...,8] \*(Pu +.Bl -tag -width ".Xr mdoc 7 ) ) ," -compact -offset 14n +.It Li \&.Xr mdoc +.Xr mdoc +.It Li \&.Xr mdoc\ , +.Xr mdoc , +.It Li \&.Xr mdoc 7 +.Xr mdoc 7 +.It Li \&.Xr mdoc 7\ )\ )\ , +.Xr mdoc 7 ) ) , +.El +.Pp +The +.Ql \&.Xr +macro is parsed and is callable. +It is an error to call +.Ql \&.Xr +without +any arguments. +.Sh GENERAL TEXT DOMAIN +.Ss AT&T Macro +.Bd -literal -offset indent -compact +Usage: .At [v6 | v7 | 32v | V.1 | V.4] ... \*(Pu +.Ed +.Bl -tag -width ".At v6 ) ," -compact -offset 14n +.It Li ".At" +.At +.It Li ".At v6 ." +.At v6 . +.El +.Pp +The +.Ql \&.At +macro is +.Em not +parsed and +.Em not +callable +It accepts at most two arguments. +.Ss BSD Macro +.Dl Usage: .Bx [Version/release] ... \*(Pu +.Bl -tag -width ".Bx 4.3 ) ," -compact -offset 14n +.It Li ".Bx" +.Bx +.It Li ".Bx 4.3 ." +.Bx 4.3 . +.El +.Pp +The +.Ql \&.Bx +macro is parsed and is callable. +.Ss FreeBSD Macro +.Bd -literal -offset indent -compact +Usage: .Fx Version.release ... \*(Pu +.Ed +.Bl -tag -width ".Fx 2.2 ) ," -compact -offset 14n +.It Li ".Fx 2.2 ." +.Fx 2.2 . +.El +.Pp +The +.Ql \&.Fx +macro is +.Em not +parsed and +.Em not +callable +It accepts at most two arguments. +.Ss UNIX Macro +.Dl Usage: .Ux ... \*(Pu +.Bl -tag -width ".Ux 4.3 ) ," -compact -offset 14n +.It Li ".Ux" +.Ux +.El +.Pp +The +.Ql \&.Ux +macro is parsed and is callable. +.Ss Enclosure and Quoting Macros +The concept of enclosure is similar to quoting. +The object being to enclose one or more strings between +a pair of characters like quotes or parentheses. +The terms quoting and enclosure are used +interchangeably throughout this document. +Most of the +one line enclosure macros end +in small letter +.Ql q +to give a hint of quoting, but there are a few irregularities. +For each enclosure macro +there is also a pair of open and close macros which end +in small letters +.Ql o +and +.Ql c +respectively. +These can be used across one or more lines of text +and while they have nesting limitations, the one line quote macros +can be used inside +of them. +.Pp +.ne 5 +.Bd -filled -offset indent +.Bl -column "quote " "close " "open " "Enclose Stringx(in XX) " XXstringXX +.Em " Quote Close Open Function Result" +\&.Aq .Ac .Ao Angle Bracket Enclosure +\&.Bq .Bc .Bo Bracket Enclosure [string] +\&.Dq .Dc .Do Double Quote ``string'' + .Ec .Eo Enclose String (in XX) XXstringXX +\&.Pq .Pc .Po Parenthesis Enclosure (string) +\&.Ql Quoted Literal `st' or string +\&.Qq .Qc .Qo Straight Double Quote "string" +\&.Sq .Sc .So Single Quote `string' +.El +.Ed +.Pp +Except for the irregular macros noted below, all +of the quoting macros are parsed and callable. +All handle punctuation properly, as long as it +is presented one character at a time and separated by spaces. +The quoting macros examine opening and closing punctuation +to determine whether it comes before or after the +enclosing string +This makes some nesting possible. +.Bl -tag -width xxx,xxxx +.It Li \&.Ec , \&.Eo +These macros expect the first argument to be the +opening and closing strings respectively. +.It Li \&.Ql +The quoted literal macro behaves differently for +.Xr troff +than +.Xr nroff . +If formatted with +.Xr nroff , +a quoted literal is always quoted. +If formatted with +troff, an item is only quoted if the width +of the item is less than three constant width characters. +This is to make short strings more visible where the font change +to literal (constant width) is less noticeable. +.It Li \&.Pf +The prefix macro is not callable, but it is parsed: +.Bl -tag -width "(namexx" -offset indent +.It Li ".Pf ( Fa name2" +becomes +.Pf ( Fa name2 . +.El +.Pp +The +.Ql \&.Ns +(no space) macro performs the analogous suffix function. +.El +.Pp +.ne 4 +Examples of quoting: +.Bl -tag -width ".Aq Pa ctype.h ) ,xxxxxxxx" -compact -offset indent +.It Li \&.Aq +.Aq +.It Li \&.Aq \&Ar ctype.h\ )\ , +.Aq Ar ctype.h ) , +.It Li \&.Bq +.Bq +.It Li \&.Bq \&Em Greek \&, French \&. +.Bq Em Greek , French . +.It Li \&.Dq +.Dq +.It Li ".Dq string abc ." +.Dq string abc . +.It Li ".Dq \'^[A-Z]\'" +.Dq \'^[A-Z]\' +.It Li "\&.Ql man mdoc" +.Ql man mdoc +.It Li \&.Qq +.Qq +.It Li "\&.Qq string ) ," +.Qq string ) , +.It Li "\&.Qq string Ns )," +.Qq string Ns ), +.It Li \&.Sq +.Sq +.It Li "\&.Sq string +.Sq string +.El +.Pp +For a good example of nested enclosure macros, see the +.Ql \&.Op +option macro. +It was created from the same +underlying enclosure macros as those presented in the list +above. +The +.Ql \&.Xo +and +.Ql \&.Xc +extended argument list macros +were also built from the same underlying routines and are a good +example of +.Nm \-mdoc +macro usage at its worst. +.Ss No\-Op or Normal Text Macro +The macro +.Ql \&.No +is +a hack for words in a macro command line which should +.Em not +be formatted and follows the conventional syntax +for content macros. +.Ss No Space Macro +The +.Ql \&.Ns +macro eliminates unwanted spaces in between macro requests. +It is useful for old style argument lists where there is no space +between the flag and argument: +.Bl -tag -width ".Op Fl I Ns Ar directoryxx" -offset indent +.It Li ".Op Fl I Ns Ar directory" +produces +.Op Fl I Ns Ar directory +.El +.Pp +Note: the +.Ql \&.Ns +macro always invokes the +.Ql \&.No +macro after eliminating the space unless another macro name +follows it. +The macro +.Ql \&.Ns +is parsed and is callable. +.Ss Section Cross References +The +.Ql \&.Sx +macro designates a reference to a section header +within the same document. +It is parsed and is callable. +.Pp +.Bl -tag -width "Li \&.Sx FILES" -offset 14n +.It Li \&.Sx FILES +.Sx FILES +.El +.Ss References and Citations +The following macros make a modest attempt to handle references. +At best, the macros make it convenient to manually drop in a subset of +refer style references. +.Pp +.Bl -tag -width 6n -offset indent -compact +.It Li ".Rs" +Reference Start. +Causes a line break and begins collection +of reference information until the +reference end macro is read. +.It Li ".Re" +Reference End. +The reference is printed. +.It Li ".%A" +Reference author name, one name per invocation. +.It Li ".%B" +Book title. +.It Li ".\&%C" +City/place. +.It Li ".\&%D" +Date. +.It Li ".%J" +Journal name. +.It Li ".%N" +Issue number. +.It Li ".%O" +Optional information. +.It Li ".%P" +Page number. +.It Li ".%R" +Report name. +.It Li ".%T" +Title of article. +.It Li ".%V" +Volume(s). +.El +.Pp +The macros beginning with +.Ql % +are not callable, and are parsed only for the trade name macro which +returns to its caller. +(And not very predictably at the moment either.) +The purpose is to allow trade names +to be pretty printed in +.Xr troff Ns / Ns Xr ditroff +output. +.Ss Return Values +The +.Ql \&.Rv +macro generates text for use in the +.Sx RETURN VALUE +section. +.Pp +.Dl Usage: .Rv [-std function] +.Pp +.Ql \&.Rv -std atexit +will generate the following text: +.Pp +.\" fake chapter 3 to avoid error message from Rv +.ds cH 3 +.Rv -std atexit +.\" and back to 7 again +.ds cH 7 +.Pp +The +.Fl std +option is valid only for manual page sections 2 and 3. +.Ss Trade Names (or Acronyms and Type Names) +The trade name macro is generally a small caps macro for +all upper case words longer than two characters. +.Pp +.Dl Usage: .Tn symbol ... \*(Pu +.Bl -tag -width ".Tn ASCII" -compact -offset 14n +.It Li \&.Tn DEC +.Tn DEC +.It Li \&.Tn ASCII +.Tn ASCII +.El +.Pp +The +.Ql \&.Tn +macro +is parsed and is callable by other macros. +.Ss Extended Arguments +The +.Ql \&.Xo +and +.Ql \&.Xc +macros allow one to extend an argument list +on a macro boundary. +Argument lists cannot +be extended within a macro +which expects all of its arguments on one line such +as +.Ql \&.Op . +.Pp +Here is an example of +.Ql \&.Xo +using the space mode macro to turn spacing off: +.Bd -literal -offset indent +\&.Sm off +\&.It Xo Sy I Ar operation +\&.No \een Ar count No \een +\&.Xc +\&.Sm on +.Ed +.Pp +Produces +.Bd -filled -offset indent +.Bl -tag -width flag -compact +.Sm off +.It Xo Sy I Ar operation +.No \en Ar count No \en +.Xc +.Sm on +.El +.Ed +.Pp +Another one: +.Bd -literal -offset indent +\&.Sm off +\&.It Cm S No \&/ Ar old_pattern Xo +\&.No \&/ Ar new_pattern +\&.No \&/ Op Cm g +\&.Xc +\&.Sm on +.Ed +.Pp +Produces +.Bd -filled -offset indent +.Bl -tag -width flag -compact +.Sm off +.It Cm S No \&/ Ar old_pattern Xo +.No \&/ Ar new_pattern +.No \&/ Op Cm g +.Xc +.Sm on +.El +.Ed +.Pp +Another example of +.Ql \&.Xo +and using enclosure macros: +Test the value of a variable. +.Bd -literal -offset indent +\&.It Xo +\&.Ic .ifndef +\&.Oo \e&! Oc Ns Ar variable +\&.Op Ar operator variable ... +\&.Xc +.Ed +.Pp +Produces +.Bd -filled -offset indent +.Bl -tag -width flag -compact +.It Xo +.Ic .ifndef +.Oo \&! Oc Ns Ar variable +.Op Ar operator variable ... +.Xc +.El +.Ed +.Pp +All of the above examples have used the +.Ql \&.Xo +macro on the argument list of the +.Ql \&.It +(list-item) +macro. +The extend macros are not used very often, and when they are +it is usually to extend the list-item argument list. +Unfortunately, this is also where the extend macros are the +most finicky. +In the first two examples, spacing was turned off; +in the third, spacing was desired in part of the output but +not all of it. +To make these macros work in this situation make sure +the +.Ql \&.Xo +and +.Ql \&.Xc +macros are placed as shown in the third example. +If the +.Ql \&.Xo +macro is not alone on the +.Ql \&.It +argument list, spacing will be unpredictable. +The +.Ql \&.Ns +(no space macro) +must not occur as the first or last macro on a line +in this situation. +Out of 900 manual pages (about 1500 actual pages) +currently released with +.Bx +only fifteen use the +.Ql \&.Xo +macro. +.Sh PAGE STRUCTURE DOMAIN +.Ss Section Headers +The first three +.Ql \&.Sh +section header macros +list below are required in every +man page. +The remaining section headers +are recommended at the discretion of the author +writing the manual page. +The +.Ql \&.Sh +macro can take up to nine arguments. +It is parsed and but is not callable. +.Bl -tag -width ".Sh SYNOPSIS" +.It \&.Sh NAME +The +.Ql \&.Sh NAME +macro is mandatory. +If not specified, +the headers, footers and page layout defaults +will not be set and things will be rather unpleasant. +The +.Sx NAME +section consists of at least three items. +The first is the +.Ql \&.Nm +name macro naming the subject of the man page. +The second is the Name Description macro, +.Ql \&.Nd , +which separates the subject +name from the third item, which is the description. +The +description should be the most terse and lucid possible, +as the space available is small. +.It \&.Sh SYNOPSIS +The +.Sx SYNOPSIS +section describes the typical usage of the +subject of a man page. +The macros required +are either +.Ql ".Nm" , +.Ql ".Cd" , +.Ql ".Fn" , +(and possibly +.Ql ".Fo" , +.Ql ".Fc" , +.Ql ".Fd" , +.Ql ".Ft" +macros). +The function name +macro +.Ql ".Fn" +is required +for manual page sections 2 and 3, the command and general +name macro +.Ql \&.Nm +is required for sections 1, 5, 6, 7, 8. +Section 4 manuals require a +.Ql ".Nm" , +.Ql ".Fd" +or a +.Ql ".Cd" +configuration device usage macro. +Several other macros may be necessary to produce +the synopsis line as shown below: +.Pp +.Bd -filled -offset indent +.Nm cat +.Op Fl benstuv +.Op Fl +.Ar +.Ed +.Pp +The following macros were used: +.Pp +.Dl \&.Nm cat +.Dl \&.Op \&Fl benstuv +.Dl \&.Op \&Fl +.Dl \&.Ar +.Pp +.Sy Note : +The macros +.Ql \&.Op , +.Ql \&.Fl , +and +.Ql \&.Ar +recognize the pipe bar character +.Ql \*(Ba , +so a command line such as: +.Pp +.Dl ".Op Fl a | Fl b" +.Pp +will not go orbital. +.Xr Troff +normally interprets a \*(Ba as a special operator. +See +.Sx PREDEFINED STRINGS +for a usable \*(Ba +character in other situations. +.It \&.Sh DESCRIPTION +In most cases the first text in the +.Sx DESCRIPTION +section +is a brief paragraph on the command, function or file, +followed by a lexical list of options and respective +explanations. +To create such a list, the +.Ql \&.Bl +begin-list, +.Ql \&.It +list-item and +.Ql \&.El +end-list +macros are used (see +.Sx Lists and Columns +below). +.El +.Pp +The following +.Ql \&.Sh +section headers are part of the +preferred manual page layout and must be used appropriately +to maintain consistency. +They are listed in the order +in which they would be used. +.Bl -tag -width SYNOPSIS +.It \&.Sh ENVIRONMENT +The +.Sx ENVIRONMENT +section should reveal any related +environment +variables and clues to their behavior and/or usage. +.It \&.Sh EXAMPLES +There are several ways to create examples. +See +the +.Sx EXAMPLES +section below +for details. +.It \&.Sh FILES +Files which are used or created by the man page subject +should be listed via the +.Ql \&.Pa +macro in the +.Sx FILES +section. +.It \&.Sh SEE ALSO +References to other material on the man page topic and +cross references to other relevant man pages should +be placed in the +.Sx SEE ALSO +section. +Cross references +are specified using the +.Ql \&.Xr +macro. +Cross references in the +.Sx SEE ALSO +section should be sorted by section number, and then +placed in alphabetical order and comma separated. For example: +.Pp +.Xr ls 1 , +.Xr ps 1 , +.Xr group 5 , +.Xr passwd 5 . +.Pp +At this time +.Xr refer 1 +style references are not accommodated. +.It \&.Sh CONFORMING TO +If the command, library function or file adheres to a +specific implementation such as +.St -p1003.2 +or +.St -ansiC +this should be noted here. +If the +command does not adhere to any standard, its history +should be noted in the +.Sx HISTORY +section. +.It \&.Sh HISTORY +Any command which does not adhere to any specific standards +should be outlined historically in this section. +.It \&.Sh AUTHORS +Credits, if need be, should be placed here. +.It \&.Sh DIAGNOSTICS +Diagnostics from a command should be placed in this section. +.It \&.Sh ERRORS +Specific error handling, especially from library functions +(man page sections 2 and 3) should go here. +The +.Ql \&.Er +macro is used to specify an errno. +.It \&.Sh BUGS +Blatant problems with the topic go here... +.El +.Pp +User specified +.Ql \&.Sh +sections may be added, +for example, this section was set with: +.Bd -literal -offset 14n +\&.Sh PAGE STRUCTURE DOMAIN +.Ed +.Ss Paragraphs and Line Spacing. +.Bl -tag -width 6n +.It \&.Pp +The +.Ql \&.Pp +paragraph command may +be used to specify a line space where necessary. +The macro is not necessary after a +.Ql \&.Sh +or +.Ql \&.Ss +macro or before +a +.Ql \&.Bl +macro. +(The +.Ql \&.Bl +macro asserts a vertical distance unless the -compact flag is given). +.El +.\" This worked with version one, need to redo for version three +.\" .Pp +.\" .Ds I +.\" .Cw (ax+bx+c) \ is\ produced\ by\ \& +.\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\& +.\" .Cl Cx \t\t +.\" .Li \&.Cx\ ( +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Va ax +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Sy \+ +.\" .Cx +.\" .Cl Cx \&(\& +.\" .Va ax +.\" .Cx + +.\" .Va by +.\" .Cx + +.\" .Va c ) +.\" .Cx \t +.\" .Em is produced by +.\" .Cx \t +.\" .Li \&.Va by +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Sy \+ +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Va c ) +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Cx +.\" .Cx +.\" .Cw +.\" .De +.\" .Pp +.\" This example shows the same equation in a different format. +.\" The spaces +.\" around the +.\" .Li \&+ +.\" signs were forced with +.\" .Li \e : +.\" .Pp +.\" .Ds I +.\" .Cw (ax\ +\ bx\ +\ c) \ is\ produced\ by\ \& +.\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\& +.\" .Cl Cx \t\t +.\" .Li \&.Cx\ ( +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Va a +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Sy x +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Cx \e\ +\e\ \e& +.\" .Cx +.\" .Cl Cx \&(\& +.\" .Va a +.\" .Sy x +.\" .Cx \ +\ \& +.\" .Va b +.\" .Sy y +.\" .Cx \ +\ \& +.\" .Va c ) +.\" .Cx \t +.\" .Em is produced by +.\" .Cl Cx \t\t +.\" .Li \&.Va b +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Sy y +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Cx \e\ +\e\ \e& +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Va c ) +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Cx +.\" .Cx +.\" .Cw +.\" .De +.\" .Pp +.\" The incantation below was +.\" lifted from the +.\" .Xr adb 1 +.\" manual page: +.\" .Pp +.\" .Ds I +.\" .Cw \&[?/]m_b1_e1_f1[?/]\& is\ produced\ by +.\" .Cl Cx \t\t +.\" .Li \&.Cx Op Sy ?/ +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Nm m +.\" .Cx +.\" .Cl Cx Op Sy ?/ +.\" .Nm m +.\" .Ad \ b1 e1 f1 +.\" .Op Sy ?/ +.\" .Cx \t +.\" .Em is produced by +.\" .Cx \t +.\" .Li \&.Ar \e\ b1 e1 f1 +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Op Sy ?/ +.\" .Cx +.\" .Cl Cx \t\t +.\" .Li \&.Cx +.\" .Cx +.\" .Cw +.\" .De +.\" .Pp +.Ss Keeps +The only keep that is implemented at this time is for words. +The macros are +.Ql \&.Bk +(begin-keep) +and +.Ql \&.Ek +(end-keep). +The only option that +.Ql \&.Bk +accepts is +.Fl words +and is useful for preventing line breaks in the middle of options. +In the example for the make command-line arguments (see +.Sx What's in a name ) , +the keep prevented +.Xr nroff +from placing up the +flag and the argument +on separate lines. +(Actually, the option macro used to prevent this from occurring, +but was dropped when the decision (religious) was made to force +right justified margins in +.Xr troff +as options in general look atrocious when spread across a sparse +line. +More work needs to be done with the keep macros, a +.Fl line +option needs to be added.) +.Ss Examples and Displays +There are five types of displays, a quickie one line indented display +.Ql \&.D1 , +a quickie one line literal display +.Ql \&.Dl , +and a block literal, block filled and block ragged which use +the +.Ql \&.Bd +begin-display +and +.Ql \&.Ed +end-display macros. +.Pp +.Bl -tag -width \&.Dlxx +.It Li \&.D1 +(D-one) Display one line of indented text. +This macro is parsed, but it is not callable. +.Pp +.Dl Fl ldghfstru +.Pp +The above was produced by: +.Li \&.Dl Fl ldghfstru . +.It Li \&.Dl +(D-ell) +Display one line of indented +.Em literal +text. +The +.Ql \&.Dl +example macro has been used throughout this +file. +It allows +the indent (display) of one line of text. +Its default font is set to +constant width (literal) however +it is parsed and will recognized other macros. +It is not callable however. +.Pp +.Dl % ls -ldg /usr/local/bin +.Pp +The above was produced by +.Li \&.Dl % ls -ldg /usr/local/bin . +.It Li \&.Bd +Begin-display. +The +.Ql \&.Bd +display must be ended with the +.Ql \&.Ed +macro. +Displays may be nested within displays and +lists. +.Ql \&.Bd +has the following syntax: +.Pp +.Dl ".Bd display-type [-offset offset_value] [-compact]" +.Pp +The display-type must be one of the following four types and +may have an offset specifier for indentation: +.Ql \&.Bd . +.Pp +.Bl -tag -width "file file_name " -compact +.It Fl ragged +Display a block of text as typed, +right (and left) margin edges are left ragged. +.It Fl filled +Display a filled (formatted) block. +The block of text is formatted (the edges are filled \- +not left unjustified). +.It Fl literal +Display a literal block, useful for source code or +simple tabbed or spaced text. +.It Fl file Ar file_name +The filename following the +.Fl file +flag is read and displayed. +Literal mode is +asserted and tabs are set at 8 constant width character +intervals, however any +.Xr troff/ Ns Nm \-mdoc +commands in file will be processed. +.It Fl offset Ar string +If +.Fl offset +is specified with one of the following strings, the string +is interpreted to indicate the level of indentation for the +forthcoming block of text: +.Pp +.Bl -tag -width "indent-two" -compact +.It Ar left +Align block on the current left margin, +this is the default mode of +.Ql \&.Bd . +.It Ar center +Supposedly center the block. +At this time +unfortunately, the block merely gets +left aligned about an imaginary center margin. +.It Ar indent +Indents by one default indent value or tab. +The default +indent value is also used for the +.Ql \&.D1 +display so one is guaranteed the two types of displays +will line up. +This indent is normally set to 6n or about two +thirds of an inch (six constant width characters). +.It Ar indent-two +Indents two times the default indent value. +.It Ar right +This +.Em left +aligns the block about two inches from +the right side of the page. +This macro needs +work and perhaps may never do the right thing by +.Xr troff . +.El +.El +.It ".Ed" +End-display. +.El +.Ss Font Modes +There are five macros for changing the appearance of the manual page text: +.Bl -tag -width \&.Emxx +.It \&.Em +Text may be stressed or emphasized with the +.Ql \&.Em +macro. +The usual font for emphasis is italic. +.Pp +.Dl Usage: .Em argument ... \*(Pu +.Bl -tag -width ".Em vide infra ) ) ," -compact -offset 14n +.It Li ".Em does not" +.Em does not +.It Li ".Em exceed 1024 ." +.Em exceed 1024 . +.It Li ".Em vide infra ) ) ," +.Em vide infra ) ) , +.El +.Pp +The +.Ql \&.Em +macro is parsed and is callable. +It is an error to call +.Ql \&.Em +without arguments. +.It \&.Li +The +.Ql \&.Li +literal macro may be used for special characters, +variable constants, anything which should be displayed as it +would be typed. +.Pp +.Dl Usage: .Li argument ... \*(Pu +.Bl -tag -width ".Li cntrl-D ) ," -compact -offset 14n +.It Li \&.Li \een +.Li \en +.It Li \&.Li M1 M2 M3\ ; +.Li M1 M2 M3 ; +.It Li \&.Li cntrl-D\ )\ , +.Li cntrl-D ) , +.It Li \&.Li 1024\ ... +.Li 1024 ... +.El +.Pp +The +.Ql \&.Li +macro is parsed and is callable. +.It \&.Sy +The symbolic emphasis macro is generally a boldface macro in +either the symbolic sense or the traditional English usage. +.Pp +.Dl Usage: .Sy symbol ... \*(Pu +.Bl -tag -width ".Sy Important Noticex" -compact -offset 14n +.It Li \&.Sy Important Notice +.Sy Important Notice +.El +.Pp +The +.Ql \&.Sy +macro is parsed and is callable. +Arguments to +.Ql \&.Sy +may be quoted. +.It Li \&.Bf +Begin font mode. +The +.Ql \&.Bf +font mode must be ended with the +.Ql \&.Ef +macro. +Font modes may be nested within other font modes. +.Ql \&.Bf +has the following syntax: +.Pp +.Dl ".Bf font-mode" +.Pp +The font-mode must be one of the following three types: +.Ql \&.Bf . +.Pp +.Bl -tag -width "file file_name " -compact +.It Sy \&Em | Fl emphasis +Same as if the +.Ql \&.Em +macro was used for the entire block of text. +.It Sy \&Li | Fl literal +Same as if the +.Ql \&.Li +macro was used for the entire block of text. +.It Sy \&Sy | Fl symbolic +Same as if the +.Ql \&.Sy +macro was used for the entire block of text. +.El +.It ".Ef" +End font mode. +.El +.Ss Tagged Lists and Columns +There are several types of lists which may be initiated with the +.Ql ".Bl" +begin-list macro. +Items within the list +are specified with the +.Ql ".It" +item macro and +each list must end with the +.Ql ".El" +macro. +Lists may be nested within themselves and within displays. +Columns may be used inside of lists, but lists are unproven +inside of columns. +.Pp +In addition, several list attributes may be specified such as +the width of a tag, the list offset, and compactness +(blank lines between items allowed or disallowed). +Most of this document has been formatted with a tag style list +.Pq Fl tag . +For a change of pace, the list-type used to present the list-types +is an over-hanging list +.Pq Fl ohang . +This type of list is quite popular with +.Tn TeX +users, but might look a bit funny after having read many pages of +tagged lists. +The following list types are accepted by +.Ql ".Bl" : +.Pp +.Bl -ohang -compact +.It Fl bullet +.It Fl item +.It Fl enum +These three are the simplest types of lists. +Once the +.Ql ".Bl" +macro has been given, items in the list are merely +indicated by a line consisting solely of the +.Ql ".It" +macro. +For example, the source text for a simple enumerated list +would look like: +.Bd -literal -offset indent-two +\&.Bl -enum -compact +\&.It +\&Item one goes here. +\&.It +\&And item two here. +\&.It +\&Lastly item three goes here. +\&.El +.Ed +.Pp +The results: +.Pp +.Bl -enum -offset indent-two -compact +.It +Item one goes here. +.It +And item two here. +.It +Lastly item three goes here. +.El +.Pp +A simple bullet list construction: +.Bd -literal -offset indent-two +\&.Bl -bullet -compact +\&.It +\&Bullet one goes here. +\&.It +\&Bullet two here. +\&.El +.Ed +.Pp +Produces: +.Bl -bullet -offset indent-two -compact +.It +Bullet one goes here. +.It +Bullet two here. +.El +.Pp +.It Fl tag +.It Fl diag +.It Fl hang +.It Fl ohang +.It Fl inset +These list-types collect arguments specified with the +.Ql \&.It +macro and create a label which may be +.Em inset +into the forthcoming text, +.Em hanged +from the forthcoming text, +.Em overhanged +from above and not indented or +.Em tagged . +This +list was constructed with the +.Ql Fl ohang +list-type. +The +.Ql \&.It +macro is parsed only for the inset, hang +and tag list-types and is not callable. +Here is an example of inset labels: +.Bl -inset -offset indent +.It Em Tag +The tagged list (also called a tagged paragraph) is the +most common type of list used in the Berkeley manuals. +.It Em Diag +Diag lists create section four diagnostic lists +and are similar to inset lists except callable +macros are ignored. +.It Em Hang +Hanged labels are a matter of taste. +.It Em Ohang +Overhanging labels are nice when space is constrained. +.It Em Inset +Inset labels are useful for controlling blocks of +paragraphs and are valuable for converting +.Nm \-mdoc +manuals to other formats. +.El +.Pp +Here is the source text which produced the above example: +.Bd -literal -offset indent +\&.Bl -inset -offset indent +\&.It Em Tag +\&The tagged list (also called a tagged paragraph) is the +\&most common type of list used in the Berkeley manuals. +\&.It Em Diag +\&Diag lists create section four diagnostic lists +\&and are similar to inset lists except callable +\¯os are ignored. +\&.It Em Hang +\&Hanged labels are a matter of taste. +\&.It Em Ohang +\&Overhanging labels are nice when space is constrained. +\&.It Em Inset +\&Inset labels are useful for controlling blocks of +\¶graphs and are valuable for converting +\&.Nm \-mdoc +\&manuals to other formats. +\&.El +.Ed +.Pp +Here is a hanged list with two items: +.Bl -hang -offset indent +.It Em Hanged +labels appear similar to tagged lists when the +label is smaller than the label width. +.It Em Longer hanged list labels +blend in to the paragraph unlike +tagged paragraph labels. +.El +.Pp +And the unformatted text which created it: +.Bd -literal -offset indent +\&.Bl -hang -offset indent +\&.It Em Hanged +\&labels appear similar to tagged lists when the +\&label is smaller than the label width. +\&.It Em Longer hanged list labels +\&blend in to the paragraph unlike +\&tagged paragraph labels. +\&.El +.Ed +.Pp +The tagged list which follows uses an optional width specifier to control +the width of the tag. +.Pp +.Bl -tag -width "PAGEIN" -compact -offset indent +.It SL +sleep time of the process (seconds blocked) +.It PAGEIN +number of disk +.Tn I/O Ns 's +resulting from references +by the process to pages not loaded in core. +.It UID +numerical user-id of process owner +.It PPID +numerical ID of parent of process process priority +(nonpositive when in noninterruptible wait) +.El +.Pp +The raw text: +.Bd -literal -offset indent +\&.Bl -tag -width "PAGEIN" -compact -offset indent +\&.It SL +\&sleep time of the process (seconds blocked) +\&.It PAGEIN +\&number of disk +\&.Tn I/O Ns 's +\&resulting from references +\&by the process to pages not loaded in core. +\&.It UID +\&numerical user ID of process owner +\&.It PPID +\&numerical ID of parent of process process priority +\&(nonpositive when in noninterruptible wait) +\&.El +.Ed +.Pp +Acceptable width specifiers: +.Bl -tag -width Ar -offset indent +.It Fl width Ar "\&Fl" +sets the width to the default width for a flag. +All callable +macros have a default width value. +The +.Ql \&.Fl , +value is presently +set to ten constant width characters or about five sixth of +an inch. +.It Fl width Ar "24n" +sets the width to 24 constant width characters or about two +inches. +The +.Ql n +is absolutely necessary for the scaling to work correctly. +.It Fl width Ar "ENAMETOOLONG" +sets width to the constant width length of the +string given. +.It Fl width Ar "\\*qint mkfifo\\*q" +again, the width is set to the constant width of the string +given. +.El +.El +.Pp +If a width is not specified for the tag list type, the first +time +.Ql \&.It +is invoked, an attempt is made to determine an appropriate +width. +If the first argument to +.Ql ".It" +is a callable macro, the default width for that macro will be used +as if the macro name had been supplied as the width. +However, +if another item in the list is given with a different callable +macro name, a new and nested list is assumed. +.Sh PREDEFINED STRINGS +The following strings are predefined as may be used by +preceding with the troff string interpreting sequence +.Ql \&\e*(xx +where +.Em xx +is the name of the defined string or as +.Ql \&\e*x +where +.Em x +is the name of the string. +The interpreting sequence may be used any where in the text. +.Pp +.Bl -column "String " "Nroff " "Troff " -offset indent +.It Sy "String Nroff Troff" +.It Li "<=" Ta \&<\&= Ta \*(<= +.It Li ">=" Ta \&>\&= Ta \*(>= +.It Li "Rq" Ta "''" Ta \*(Rq +.It Li "Lq" Ta "``" Ta \*(Lq +.It Li "ua" Ta ^ Ta \*(ua +.It Li "aa" Ta ' Ta \*(aa +.It Li "ga" Ta \` Ta \*(ga +.\" .It Li "sL" Ta ` Ta \*(sL +.\" .It Li "sR" Ta ' Ta \*(sR +.It Li "q" Ta \&" Ta \*q +.It Li "Pi" Ta pi Ta \*(Pi +.It Li "Ne" Ta != Ta \*(Ne +.It Li "Le" Ta <= Ta \*(Le +.It Li "Ge" Ta >= Ta \*(Ge +.It Li "Lt" Ta < Ta \*(Gt +.It Li "Gt" Ta > Ta \*(Lt +.It Li "Pm" Ta +- Ta \*(Pm +.It Li "If" Ta infinity Ta \*(If +.It Li "Na" Ta \fINaN\fP Ta \*(Na +.It Li "Ba" Ta \fR\&|\fP Ta \*(Ba +.El +.Pp +.Sy Note : +The string named +.Ql q +should be written as +.Ql \e*q +since it is only one char. +.Sh DIAGNOSTICS +The debugging facilities for +.Nm \-mdoc +are limited, but can help detect subtle errors such +as the collision of an argument name with an internal +register or macro name. +(A what?) +A register is an arithmetic storage class for +.Xr troff +with a one or two character name. +All registers internal to +.Nm \-mdoc +for +.Xr troff +and +.Xr ditroff +are two characters and +of the form such as +.Ql \&Ar , + as +.Ql \&aR +or + as +.Ql \&C\&1 . +And adding to the muddle, +.Xr troff +has its own internal registers all of which are either +two lower case characters or a dot plus a letter or metacharacter +character. +In one of the introduction examples, it was shown how to +prevent the interpretation of a macro name with the escape sequence +.Ql \e& . +This is sufficient for the internal register names also. +.Pp +.\" Every callable macro name has a corresponding register +.\" of the same name (). +.\" There are also specific registers which have +.\" been used for stacks and arrays and are listed in the +.\" .Sx Appendix . +.\" .Bd -ragged -offset 4n +.\" [A-Z][a-z] registers corresponding to macro names (example ``Ar'') +.\" [a-z][A-Z] registers corresponding to macro names (example ``aR'') +.\" C[0-9] argument types (example C1) +.\" O[0-9] offset stack (displays) +.\" h[0-9] horizontal spacing stack (lists) +.\" o[0-9] offset (stack) (lists) +.\" t[0-9] tag stack (lists) +.\" v[0-9] vertical spacing stack (lists) +.\" w[0-9] width tag/label stack +.\" .Ed +.\" .Pp +If a nonescaped register name is given in the argument list of a request +unpredictable behavior will occur. +In general, any time huge portions +of text do not appear where expected in the output, or small strings +such as list tags disappear, chances are there is a misunderstanding +about an argument type in the argument list. +Your mother never intended for you to remember this evil stuff - so here +is a way to find out whether or not your arguments are valid: The +.Ql \&.Db +(debug) +macro displays the interpretation of the argument list for most +macros. +Macros such as the +.Ql \&.Pp +(paragraph) +macro do not contain debugging information. +All of the callable macros do, +and it is strongly advised whenever in doubt, +turn on the +.Ql \&.Db +macro. +.Pp +.Dl Usage: \&.Db [on | off] +.Pp +An example of a portion of text with +the debug macro placed above and below an +artificially created problem (a flag argument +.Ql \&aC +which should be +.Ql \e&aC +in order to work): +.Bd -literal -offset indent +\&.Db on +\&.Op Fl aC Ar file ) +\&.Db off +.Ed +.Pp +The resulting output: +.Bd -literal -offset indent +DEBUGGING ON +DEBUG(argv) MACRO: `.Op' Line #: 2 + Argc: 1 Argv: `Fl' Length: 2 + Space: `' Class: Executable + Argc: 2 Argv: `aC' Length: 2 + Space: `' Class: Executable + Argc: 3 Argv: `Ar' Length: 2 + Space: `' Class: Executable + Argc: 4 Argv: `file' Length: 4 + Space: ` ' Class: String + Argc: 5 Argv: `)' Length: 1 + Space: ` ' Class: Closing Punctuation or suffix + MACRO REQUEST: .Op Fl aC Ar file ) +DEBUGGING OFF +.Ed +.Pp +The first line of information tells the name of the calling +macro, here +.Ql \&.Op , +and the line number it appears on. +If one or more files are involved +(especially if text from another file is included) the line number +may be bogus. +If there is only one file, it should be accurate. +The second line gives the argument count, the argument +.Pq Ql \&Fl +and its length. +If the length of an argument is two characters, the +argument is tested to see if it is executable (unfortunately, any +register which contains a nonzero value appears executable). +The third line gives the space allotted for a class, and the +class type. +The problem here is the argument aC should not be +executable. +The four types of classes are string, executable, closing +punctuation and opening punctuation. +The last line shows the entire +argument list as it was read. +In this next example, the offending +.Ql \&aC +is escaped: +.Bd -literal -offset indent +\&.Db on +\&.Em An escaped \e&aC +\&.Db off +.Ed +.Bd -literal -offset indent +DEBUGGING ON +DEBUG(fargv) MACRO: `.Em' Line #: 2 + Argc: 1 Argv: `An' Length: 2 + Space: ` ' Class: String + Argc: 2 Argv: `escaped' Length: 7 + Space: ` ' Class: String + Argc: 3 Argv: `aC' Length: 2 + Space: ` ' Class: String + MACRO REQUEST: .Em An escaped &aC +DEBUGGING OFF +.Ed +.Pp +The argument +.Ql \e&aC +shows up with the same length of 2 as the +.Ql \e& +sequence produces a zero width, but a register +named +.Ql \e&aC +was not found and the type classified as string. +.Pp +Other diagnostics consist of usage statements and are self explanatory. +.Sh GROFF, TROFF AND NROFF +The +.Nm \-mdoc +package does not need compatibility mode with +.Xr groff . +.Pp +The package inhibits page breaks, and the headers and footers +which normally occur at those breaks with +.Xr nroff , +to make the manual more efficient for viewing on-line. +At the moment, +.Xr groff +with +.Fl T Ns Ar ascii +does eject the imaginary remainder of the page at end of file. +The inhibiting of the page breaks makes +.Xr nroff Ns 'd +files unsuitable for hardcopy. +There is a register named +.Ql \&cR +which can be set to zero in the site dependent style file +.Pa /usr/src/share/tmac/doc-nroff +to restore the old style behavior. +.Sh FILES +.Bl -tag -width /usr/share/man0/template.doc -compact +.It Pa /usr/share/tmac/doc.tmac +manual macro package +.It Pa /usr/share/misc/mdoc.template +template for writing a man page +.It Pa /usr/share/examples/mdoc/* +several example man pages +.El +.Sh BUGS +Undesirable hyphenation on the dash of a flag +argument is not yet resolved, and causes +occasional mishaps in the +.Sx DESCRIPTION +section. +(line break on the hyphen). +.Pp +Predefined strings are not declared in documentation. +.Pp +Section 3f has not been added to the header routines. +.Pp +.Ql \&.Nm +font should be changed in +.Sx NAME +section. +.Pp +.Ql \&.Fn +needs to have a check to prevent splitting up +if the line length is too short. +Occasionally it +separates the last parenthesis, and sometimes +looks ridiculous if a line is in fill mode. +.Pp +The method used to prevent header and footer page +breaks (other than the initial header and footer) when using +nroff occasionally places an unsightly partially filled line (blank) +at the would be bottom of the page. +.Pp +The list and display macros to not do any keeps +and certainly should be able to. +.\" Note what happens if the parameter list overlaps a newline +.\" boundary. +.\" to make sure a line boundary is crossed: +.\" .Bd -literal +.\" \&.Fn struct\e\ dictionarytable\e\ *dictionarylookup struct\e\ dictionarytable\e\ *tab[] +.\" .Ed +.\" .Pp +.\" produces, nudge nudge, +.\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] , +.\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] , +.\" nudge +.\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] . +.\" .Pp +.\" If double quotes are used, for example: +.\" .Bd -literal +.\" \&.Fn \*qstruct dictionarytable *dictionarylookup\*q \*qchar *h\*q \*qstruct dictionarytable *tab[]\*q +.\" .Ed +.\" .Pp +.\" produces, nudge nudge, +.\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" , +.\" nudge +.\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" , +.\" nudge +.\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" . +.\" .Pp +.\" Not a pretty sight... +.\" In a paragraph, a long parameter containing unpaddable spaces as +.\" in the former example will cause +.\" .Xr troff +.\" to break the line and spread +.\" the remaining words out. +.\" The latter example will adjust nicely to +.\" justified margins, but may break in between an argument and its +.\" declaration. +.\" In +.\" .Xr nroff +.\" the right margin adjustment is normally ragged and the problem is +.\" not as severe. +.Sh SEE ALSO +.Xr man 1 , +.Xr troff 1 , +.Xr groff_mdoc 7 , +.Xr mdoc 7 +.Sh COLOPHON +This page is part of release 3.24 of the Linux +.Em man-pages +project. +A description of the project, +and information about reporting bugs, +can be found at +http://www.kernel.org/doc/man-pages/. diff --git a/original/man7/mq_overview.7 b/original/man7/mq_overview.7 new file mode 100644 index 00000000..3d71efb3 --- /dev/null +++ b/original/man7/mq_overview.7 @@ -0,0 +1,293 @@ +'\" 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. +.\" +.TH MQ_OVERVIEW 7 2009-09-27 "Linux" "Linux Programmer's Manual" +.SH NAME +mq_overview \- Overview of POSIX message queues +.SH DESCRIPTION +POSIX message queues allow processes to exchange data in +the form of messages. +This API is distinct from that provided by System V message queues +.RB ( msgget (2), +.BR msgsnd (2), +.BR msgrcv (2), +etc.), but provides similar functionality. + +Message queues are created and opened using +.BR mq_open (3); +this function returns a +.I message queue descriptor +.RI ( mqd_t ), +which is used to refer to the open message queue in later calls. +Each message queue is identified by a name of the form +.IR /somename ; +that is, a null-terminated string of up to +.BI NAME_MAX +(i.e., 255) characters consisting of an initial slash, +followed by one or more characters, none of which are slashes. +Two processes can operate on the same queue by passing the same name to +.BR mq_open (3). + +Messages are transferred to and from a queue using +.BR mq_send (3) +and +.BR mq_receive (3). +When a process has finished using the queue, it closes it using +.BR mq_close (3), +and when the queue is no longer required, it can be deleted using +.BR mq_unlink (3). +Queue attributes can be retrieved and (in some cases) modified using +.BR mq_getattr (3) +and +.BR mq_setattr (3). +A process can request asynchronous notification +of the arrival of a message on a previously empty queue using +.BR mq_notify (3). + +A message queue descriptor is a reference to an +.I "open message queue description" +(cf. +.BR open (2)). +After a +.BR fork (2), +a child inherits copies of its parent's message queue descriptors, +and these descriptors refer to the same open message queue descriptions +as the corresponding descriptors in the parent. +Corresponding descriptors in the two processes share the flags +.RI ( mq_flags ) +that are associated with the open message queue description. + +Each message has an associated +.IR priority , +and messages are always delivered to the receiving process +highest priority first. +Message priorities range from 0 (low) to +.I sysconf(_SC_MQ_PRIO_MAX)\ -\ 1 +(high). +On Linux, +.I sysconf(_SC_MQ_PRIO_MAX) +returns 32768, but POSIX.1-2001 only requires +an implementation to support priorities in the range 0 to 31; +some implementations only provide this range. +.PP +The remainder of this section describes some specific details +of the Linux implementation of POSIX message queues. +.SS Library interfaces and system calls +In most cases the +.B mq_*() +library interfaces listed above are implemented +on top of underlying system calls of the same name. +Deviations from this scheme are indicated in the following table: +.in +4n +.TS +lB lB +l l. +Library interface System call +mq_close(3) close(2) +mq_getattr(3) mq_getsetattr(2) +mq_notify(3) mq_notify(2) +mq_open(3) mq_open(2) +mq_receive(3) mq_timedreceive(2) +mq_send(3) mq_timedsend(2) +mq_setattr(3) mq_getsetattr(2) +mq_timedreceive(3) mq_timedreceive(2) +mq_timedsend(3) mq_timedsend(2) +mq_unlink(3) mq_unlink(2) +.TE +.in +.SS Versions +POSIX message queues have been supported on Linux since kernel 2.6.6. +Glibc support has been provided since version 2.3.4. +.SS Kernel configuration +Support for POSIX message queues is configurable via the +.B CONFIG_POSIX_MQUEUE +kernel configuration option. +This option is enabled by default. +.SS Persistence +POSIX message queues have kernel persistence: +if not removed by +.BR mq_unlink (3), +a message queue will exist until the system is shut down. +.SS Linking +Programs using the POSIX message queue API must be compiled with +.I cc \-lrt +to link against the real-time library, +.IR librt . +.SS /proc interfaces +The following interfaces can be used to limit the amount of +kernel memory consumed by POSIX message queues: +.TP +.I /proc/sys/fs/mqueue/msg_max +This file can be used to view and change the ceiling value for the +maximum number of messages in a queue. +This value acts as a ceiling on the +.I attr\->mq_maxmsg +argument given to +.BR mq_open (3). +The default value for +.I msg_max +is 10. +The minimum value is 1 (10 in kernels before 2.6.28). +The upper limit is +.BR HARD_MAX : +.IR "(131072\ /\ sizeof(void\ *))" +(32768 on Linux/86). +This limit is ignored for privileged processes +.RB ( CAP_SYS_RESOURCE ), +but the +.BR HARD_MAX +ceiling is nevertheless imposed. +.TP +.I /proc/sys/fs/mqueue/msgsize_max +This file can be used to view and change the ceiling on the +maximum message size. +This value acts as a ceiling on the +.I attr\->mq_msgsize +argument given to +.BR mq_open (3). +The default value for +.I msgsize_max +is 8192 bytes. +The minimum value is 128 (8192 in kernels before 2.6.28). +The upper limit for +.I msgsize_max +is 1,048,576 (in kernels before 2.6.28, the upper limit was +.BR INT_MAX ; +that is, 2,147,483,647 on Linux/86). +This limit is ignored for privileged processes +.RB ( CAP_SYS_RESOURCE ). +.TP +.I /proc/sys/fs/mqueue/queues_max +This file can be used to view and change the system-wide limit on the +number of message queues that can be created. +Only privileged processes +.RB ( CAP_SYS_RESOURCE ) +can create new message queues once this limit has been reached. +The default value for +.I queues_max +is 256; it can be changed to any value in the range 0 to INT_MAX. +.SS Resource limit +The +.B RLIMIT_MSGQUEUE +resource limit, which places a limit on the amount of space +that can be consumed by all of the message queues +belonging to a process's real user ID, is described in +.BR getrlimit (2). +.SS Mounting the message queue file system +On Linux, message queues are created in a virtual file system. +(Other implementations may also provide such a feature, +but the details are likely to differ.) +This file system can be mounted (by the superuser) using the following +commands: +.in +4n +.nf + +.RB "#" " mkdir /dev/mqueue" +.RB "#" " mount \-t mqueue none /dev/mqueue" + +.fi +.in +The sticky bit is automatically enabled on the mount directory. + +After the file system has been mounted, the message queues on the system +can be viewed and manipulated using the commands usually used for files +(e.g., +.BR ls (1) +and +.BR rm (1)). + +The contents of each file in the directory consist of a single line +containing information about the queue: +.in +4n +.nf + +.RB "$" " cat /dev/mqueue/mymq" +QSIZE:129 NOTIFY:2 SIGNO:0 NOTIFY_PID:8260 + +.fi +.in +These fields are as follows: +.TP +.B QSIZE +Number of bytes of data in all messages in the queue. +.TP +.B NOTIFY_PID +If this is nonzero, then the process with this PID has used +.BR mq_notify (3) +to register for asynchronous message notification, +and the remaining fields describe how notification occurs. +.TP +.B NOTIFY +Notification method: +0 is +.BR SIGEV_SIGNAL ; +1 is +.BR SIGEV_NONE ; +and +2 is +.BR SIGEV_THREAD . +.TP +.B SIGNO +Signal number to be used for +.BR SIGEV_SIGNAL . +.SS Polling message queue descriptors +On Linux, a message queue descriptor is actually a file descriptor, +and can be monitored using +.BR select (2), +.BR poll (2), +or +.BR epoll (7). +This is not portable. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +System V message queues +.RB ( msgget (2), +.BR msgsnd (2), +.BR msgrcv (2), +etc.) are an older API for exchanging messages between processes. +POSIX message queues provide a better designed interface than +System V message queues; +on the other hand POSIX message queues are less widely available +(especially on older systems) than System V message queues. + +Linux does not currently (2.6.26) support the use of access control +lists (ACLs) for POSIX message queues. +.SH EXAMPLE +An example of the use of various message queue functions is shown in +.BR mq_notify (3). +.SH "SEE ALSO" +.BR getrlimit (2), +.BR mq_getsetattr (2), +.BR poll (2), +.BR select (2), +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR epoll (7) diff --git a/original/man7/netdevice.7 b/original/man7/netdevice.7 new file mode 100644 index 00000000..d8547225 --- /dev/null +++ b/original/man7/netdevice.7 @@ -0,0 +1,280 @@ +'\" t +.\" Don't change the first line, it tells man that tbl is needed. +.\" This man page is Copyright (C) 1999 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. +.\" $Id: netdevice.7,v 1.10 2000/08/17 10:09:54 ak Exp $ +.\" +.\" Modified, 2004-11-25, mtk, formatting and a few wording fixes +.\" +.TH NETDEVICE 7 2009-01-14 "Linux" "Linux Programmer's Manual" +.SH NAME +netdevice \- Low level access to Linux network devices +.SH SYNOPSIS +.B "#include " +.br +.B "#include " +.SH DESCRIPTION +This man page describes the sockets interface which is used to configure +network devices. + +Linux supports some standard ioctls to configure network devices. +They can be used on any socket's file descriptor regardless of the +family or type. +They pass an +.I ifreq +structure: + +.in +4n +.nf +struct ifreq { + char ifr_name[IFNAMSIZ]; /* Interface name */ + union { + struct sockaddr ifr_addr; + struct sockaddr ifr_dstaddr; + struct sockaddr ifr_broadaddr; + struct sockaddr ifr_netmask; + struct sockaddr ifr_hwaddr; + short ifr_flags; + int ifr_ifindex; + int ifr_metric; + int ifr_mtu; + struct ifmap ifr_map; + char ifr_slave[IFNAMSIZ]; + char ifr_newname[IFNAMSIZ]; + char *ifr_data; + }; +}; + +struct ifconf { + int ifc_len; /* size of buffer */ + union { + char *ifc_buf; /* buffer address */ + struct ifreq *ifc_req; /* array of structures */ + }; +}; +.fi +.in + +Normally, the user specifies which device to affect by setting +.I ifr_name +to the name of the interface. +All other members of the structure may +share memory. +.SS Ioctls +If an ioctl is marked as privileged then using it requires an effective +user ID of 0 or the +.B CAP_NET_ADMIN +capability. +If this is not the case +.B EPERM +will be returned. +.TP +.B SIOCGIFNAME +Given the +.IR ifr_ifindex , +return the name of the interface in +.IR ifr_name . +This is the only ioctl which returns its result in +.IR ifr_name . +.TP +.B SIOCGIFINDEX +Retrieve the interface index of the interface into +.IR ifr_ifindex . +.TP +.BR SIOCGIFFLAGS ", " SIOCSIFFLAGS +Get or set the active flag word of the device. +.I ifr_flags +contains a bit mask of the following values: +.TS +tab(:); +c s +l l. +Device flags +IFF_UP:Interface is running. +IFF_BROADCAST:Valid broadcast address set. +IFF_DEBUG:Internal debugging flag. +IFF_LOOPBACK:Interface is a loopback interface. +IFF_POINTOPOINT:Interface is a point-to-point link. +IFF_RUNNING:Resources allocated. +IFF_NOARP:No arp protocol, L2 destination address not set. +IFF_PROMISC:Interface is in promiscuous mode. +IFF_NOTRAILERS:Avoid use of trailers. +IFF_ALLMULTI:Receive all multicast packets. +IFF_MASTER:Master of a load balancing bundle. +IFF_SLAVE:Slave of a load balancing bundle. +IFF_MULTICAST:Supports multicast +IFF_PORTSEL:Is able to select media type via ifmap. +IFF_AUTOMEDIA:Auto media selection active. +IFF_DYNAMIC:T{ +The addresses are lost when the interface goes down. +T} +IFF_LOWER_UP:Driver signals L1 up (since Linux 2.6.17) +IFF_DORMANT:Driver signals dormant (since Linux 2.6.17) +IFF_ECHO:Echo sent packets (since Linux 2.6.25) + + +.TE +Setting the active flag word is a privileged operation, but any +process may read it. +.TP +.BR SIOCGIFMETRIC ", " SIOCSIFMETRIC +Get or set the metric of the device using +.IR ifr_metric . +This is currently not implemented; it sets +.I ifr_metric +to 0 if you attempt to read it and returns +.B EOPNOTSUPP +if you attempt to set it. +.TP +.BR SIOCGIFMTU ", " SIOCSIFMTU +Get or set the MTU (Maximum Transfer Unit) of a device using +.IR ifr_mtu . +Setting the MTU is a privileged operation. +Setting the MTU to +too small values may cause kernel crashes. +.TP +.BR SIOCGIFHWADDR ", " SIOCSIFHWADDR +Get or set the hardware address of a device using +.IR ifr_hwaddr . +The hardware address is specified in a struct +.IR sockaddr . +.I sa_family +contains the ARPHRD_* device type, +.I sa_data +the L2 hardware address starting from byte 0. +Setting the hardware address is a privileged operation. +.TP +.B SIOCSIFHWBROADCAST +Set the hardware broadcast address of a device from +.IR ifr_hwaddr . +This is a privileged operation. +.TP +.BR SIOCGIFMAP ", " SIOCSIFMAP +Get or set the interface's hardware parameters using +.IR ifr_map . +Setting the parameters is a privileged operation. + +.in +4n +.nf +struct ifmap { + unsigned long mem_start; + unsigned long mem_end; + unsigned short base_addr; + unsigned char irq; + unsigned char dma; + unsigned char port; +}; +.fi +.in + +The interpretation of the ifmap structure depends on the device driver +and the architecture. +.TP +.BR SIOCADDMULTI ", " SIOCDELMULTI +Add an address to or delete an address from the device's link layer +multicast filters using +.IR ifr_hwaddr . +These are privileged operations. +See also +.BR packet (7) +for an alternative. +.TP +.BR SIOCGIFTXQLEN ", " SIOCSIFTXQLEN +Get or set the transmit queue length of a device using +.IR ifr_qlen . +Setting the transmit queue length is a privileged operation. +.TP +.B SIOCSIFNAME +Changes the name of the interface specified in +.I ifr_name +to +.IR ifr_newname . +This is a privileged operation. +It is only allowed when the interface +is not up. +.TP +.B SIOCGIFCONF +Return a list of interface (transport layer) addresses. +This currently +means only addresses of the +.B AF_INET +(IPv4) family for compatibility. +The user passes a +.I ifconf +structure as argument to the ioctl. +It contains a pointer to an array of +.I ifreq +structures in +.I ifc_req +and its length in bytes in +.IR ifc_len . +The kernel fills the ifreqs with all current L3 interface addresses that +are running: +.I ifr_name +contains the interface name (eth0:1 etc.), +.I ifr_addr +the address. +The kernel returns with the actual length in +.IR ifc_len . +If +.I ifc_len +is equal to the original length the buffer probably has overflowed +and you should retry with a bigger buffer to get all addresses. +When no error occurs the ioctl returns 0; +otherwise \-1. +Overflow is not an error. +.\" Slaving isn't supported in 2.2 +.\" . +.\" .TP +.\" .BR SIOCGIFSLAVE ", " SIOCSIFSLAVE +.\" Get or set the slave device using +.\" .IR ifr_slave . +.\" Setting the slave device is a privileged operation. +.\" .PP +.\" FIXME add amateur radio stuff. +.PP +Most protocols support their own ioctls to configure protocol-specific +interface options. +See the protocol man pages for a description. +For configuring IP addresses see +.BR ip (7). +.PP +In addition some devices support private ioctls. +These are not described here. +.SH NOTES +Strictly speaking, +.B SIOCGIFCONF +is IP specific and belongs in +.BR ip (7). +.LP +The names of interfaces with no addresses or that don't have the +.B IFF_RUNNING +flag set can be found via +.IR /proc/net/dev . +.LP +Local IPv6 IP addresses can be found via +.I /proc/net +or via +.BR rtnetlink (7). +.SH BUGS +glibc 2.1 is missing the +.I ifr_newname +macro in +.IR . +Add the following to your program as a workaround: +.sp +.in +4n +.nf +#ifndef ifr_newname +#define ifr_newname ifr_ifru.ifru_slave +#endif +.fi +.in +.SH "SEE ALSO" +.BR proc (5), +.BR capabilities (7), +.BR ip (7), +.BR rtnetlink (7) diff --git a/original/man7/netlink.7 b/original/man7/netlink.7 new file mode 100644 index 00000000..e27b2d81 --- /dev/null +++ b/original/man7/netlink.7 @@ -0,0 +1,460 @@ +'\" t +.\" Don't change the first line, it tells man that tbl is needed. +.\" This man page is Copyright (c) 1998 by Andi Kleen. Subject to the GPL. +.\" Based on the original comments from Alexey Kuznetsov +.\" Modified 2005-12-27 by Hasso Tepper +.\" $Id: netlink.7,v 1.8 2000/06/22 13:23:00 ak Exp $ +.TH NETLINK 7 2008-11-11 "Linux" "Linux Programmer's Manual" +.SH NAME +netlink \- Communication between kernel and userspace (AF_NETLINK) +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include + +.BI "netlink_socket = socket(AF_NETLINK, " socket_type ", " netlink_family ); +.fi +.SH DESCRIPTION +Netlink is used to transfer information between kernel and +userspace processes. +It consists of a standard sockets-based interface for userspace +processes and an internal kernel API for kernel modules. +The internal kernel interface is not documented in this manual page. +There is also an obsolete netlink interface +via netlink character devices; this interface is not documented here +and is only provided for backwards compatibility. + +Netlink is a datagram-oriented service. +Both +.B SOCK_RAW +and +.B SOCK_DGRAM +are valid values for +.IR socket_type . +However, the netlink protocol does not distinguish between datagram +and raw sockets. + +.I netlink_family +selects the kernel module or netlink group to communicate with. +The currently assigned netlink families are: +.TP +.B NETLINK_ROUTE +Receives routing and link updates and may be used to modify the routing +tables (both IPv4 and IPv6), IP addresses, link parameters, +neighbor setups, queueing disciplines, traffic classes and +packet classifiers (see +.BR rtnetlink (7)). +.TP +.B NETLINK_W1 +Messages from 1-wire subsystem. +.TP +.B NETLINK_USERSOCK +Reserved for user-mode socket protocols. +.TP +.B NETLINK_FIREWALL +Transport IPv4 packets from netfilter to userspace. +Used by +.I ip_queue +kernel module. +.TP +.B NETLINK_INET_DIAG +.\" FIXME More details on NETLINK_INET_DIAG needed. +INET socket monitoring. +.TP +.B NETLINK_NFLOG +Netfilter/iptables ULOG. +.TP +.B NETLINK_XFRM +.\" FIXME More details on NETLINK_XFRM needed. +IPsec. +.TP +.B NETLINK_SELINUX +SELinux event notifications. +.TP +.B NETLINK_ISCSI +.\" FIXME More details on NETLINK_ISCSI needed. +Open-iSCSI. +.TP +.B NETLINK_AUDIT +.\" FIXME More details on NETLINK_AUDIT needed. +Auditing. +.TP +.B NETLINK_FIB_LOOKUP +.\" FIXME More details on NETLINK_FIB_LOOKUP needed. +Access to FIB lookup from userspace. +.TP +.B NETLINK_CONNECTOR +Kernel connector. +See +.I Documentation/connector/* +in the kernel source for further information. +.TP +.B NETLINK_NETFILTER +.\" FIXME More details on NETLINK_NETFILTER needed. +Netfilter subsystem. +.TP +.B NETLINK_IP6_FW +Transport IPv6 packets from netfilter to userspace. +Used by +.I ip6_queue +kernel module. +.TP +.B NETLINK_DNRTMSG +DECnet routing messages. +.TP +.B NETLINK_KOBJECT_UEVENT +.\" FIXME More details on NETLINK_KOBJECT_UEVENT needed. +Kernel messages to userspace. +.TP +.B NETLINK_GENERIC +Generic netlink family for simplified netlink usage. +.PP +Netlink messages consist of a byte stream with one or multiple +.I nlmsghdr +headers and associated payload. +The byte stream should only be accessed with the standard +.B NLMSG_* +macros. +See +.BR netlink (3) +for further information. + +In multipart messages (multiple +.I nlmsghdr +headers with associated payload in one byte stream) the first and all +following headers have the +.B NLM_F_MULTI +flag set, except for the last header which has the type +.BR NLMSG_DONE . + +After each +.I nlmsghdr +the payload follows. + +.in +4n +.nf +struct nlmsghdr { + __u32 nlmsg_len; /* Length of message including header. */ + __u16 nlmsg_type; /* Type of message content. */ + __u16 nlmsg_flags; /* Additional flags. */ + __u32 nlmsg_seq; /* Sequence number. */ + __u32 nlmsg_pid; /* PID of the sending process. */ +}; +.fi +.in + +.I nlmsg_type +can be one of the standard message types: +.B NLMSG_NOOP +message is to be ignored, +.B NLMSG_ERROR +message signals an error and the payload contains an +.I nlmsgerr +structure, +.B NLMSG_DONE +message terminates a multipart message. + +.in +4n +.nf +struct nlmsgerr { + int error; /* Negative errno or 0 for acknowledgements */ + struct nlmsghdr msg; /* Message header that caused the error */ +}; +.fi +.in + +A netlink family usually specifies more message types, see the +appropriate manual pages for that, for example, +.BR rtnetlink (7) +for +.BR NETLINK_ROUTE . + +Standard flag bits in +.I nlmsg_flags +.br +--------------------------------- +.TS +tab(:); +lB l. +NLM_F_REQUEST:Must be set on all request messages. +NLM_F_MULTI:T{ +The message is part of a multipart message terminated by +.BR NLMSG_DONE . +T} +NLM_F_ACK:Request for an acknowledgment on success. +NLM_F_ECHO:Echo this request. +.TE + +Additional flag bits for GET requests +.br +------------------------------------- +.TS +tab(:); +lB l. +NLM_F_ROOT:Return the complete table instead of a single entry. +NLM_F_MATCH:T{ +Return all entries matching criteria passed in message content. +Not implemented yet. +T} +.\" FIXME NLM_F_ATOMIC is not used any more? +NLM_F_ATOMIC:Return an atomic snapshot of the table. +NLM_F_DUMP:Convenience macro; equivalent to (NLM_F_ROOT|NLM_F_MATCH). +.TE + +Note that +.B NLM_F_ATOMIC +requires the +.B CAP_NET_ADMIN +capability or an effective UID of 0. + +Additional flag bits for NEW requests +.br +------------------------------------- +.TS +tab(:); +lB l. +NLM_F_REPLACE:Replace existing matching object. +NLM_F_EXCL:Don't replace if the object already exists. +NLM_F_CREATE:Create object if it doesn't already exist. +NLM_F_APPEND:Add to the end of the object list. +.TE + +.I nlmsg_seq +and +.I nlmsg_pid +are used to track messages. +.I nlmsg_pid +shows the origin of the message. +Note that there isn't a 1:1 relationship between +.I nlmsg_pid +and the PID of the process if the message originated from a netlink +socket. +See the +.B ADDRESS FORMATS +section for further information. + +Both +.I nlmsg_seq +and +.I nlmsg_pid +.\" FIXME Explain more about nlmsg_seq and nlmsg_pid. +are opaque to netlink core. + +Netlink is not a reliable protocol. +It tries its best to deliver a message to its destination(s), +but may drop messages when an out-of-memory condition or +other error occurs. +For reliable transfer the sender can request an +acknowledgement from the receiver by setting the +.B NLM_F_ACK +flag. +An acknowledgment is an +.B NLMSG_ERROR +packet with the error field set to 0. +The application must generate acknowledgements for +received messages itself. +The kernel tries to send an +.B NLMSG_ERROR +message for every failed packet. +A user process should follow this convention too. + +However, reliable transmissions from kernel to user are impossible +in any case. +The kernel can't send a netlink message if the socket buffer is full: +the message will be dropped and the kernel and the userspace process will +no longer have the same view of kernel state. +It is up to the application to detect when this happens (via the +.B ENOBUFS +error returned by +.BR recvmsg (2)) +and resynchronize. +.SS Address Formats +The +.I sockaddr_nl +structure describes a netlink client in user space or in the kernel. +A +.I sockaddr_nl +can be either unicast (only sent to one peer) or sent to +netlink multicast groups +.RI ( nl_groups +not equal 0). + +.in +4n +.nf +struct sockaddr_nl { + sa_family_t nl_family; /* AF_NETLINK */ + unsigned short nl_pad; /* Zero. */ + pid_t nl_pid; /* Process ID. */ + __u32 nl_groups; /* Multicast groups mask. */ +}; +.fi +.in + +.I nl_pid +is the unicast address of netlink socket. +It's always 0 if the destination is in the kernel. +For a userspace process, +.I nl_pid +is usually the PID of the process owning the destination socket. +However, +.I nl_pid +identifies a netlink socket, not a process. +If a process owns several netlink +sockets, then +.I nl_pid +can only be equal to the process ID for at most one socket. +There are two ways to assign +.I nl_pid +to a netlink socket. +If the application sets +.I nl_pid +before calling +.BR bind (2), +then it is up to the application to make sure that +.I nl_pid +is unique. +If the application sets it to 0, the kernel takes care of assigning it. +The kernel assigns the process ID to the first netlink socket the process +opens and assigns a unique +.I nl_pid +to every netlink socket that the process subsequently creates. + +.I nl_groups +is a bit mask with every bit representing a netlink group number. +Each netlink family has a set of 32 multicast groups. +When +.BR bind (2) +is called on the socket, the +.I nl_groups +field in the +.I sockaddr_nl +should be set to a bit mask of the groups which it wishes to listen to. +The default value for this field is zero which means that no multicasts +will be received. +A socket may multicast messages to any of the multicast groups by setting +.I nl_groups +to a bit mask of the groups it wishes to send to when it calls +.BR sendmsg (2) +or does a +.BR connect (2). +Only processes with an effective UID of 0 or the +.B CAP_NET_ADMIN +capability may send or listen to a netlink multicast group. +Any replies to a message received for a multicast group should be +sent back to the sending PID and the multicast group. +.SH VERSIONS +The socket interface to netlink is a new feature of Linux 2.2. + +Linux 2.0 supported a more primitive device based netlink interface +(which is still available as a compatibility option). +This obsolete interface is not described here. + +NETLINK_SELINUX appeared in Linux 2.6.4. + +NETLINK_AUDIT appeared in Linux 2.6.6. + +NETLINK_KOBJECT_UEVENT appeared in Linux 2.6.10. + +NETLINK_W1 and NETLINK_FIB_LOOKUP appeared in Linux 2.6.13. + +NETLINK_INET_DIAG, NETLINK_CONNECTOR and NETLINK_NETFILTER appeared in +Linux 2.6.14. + +NETLINK_GENERIC and NETLINK_ISCSI appeared in Linux 2.6.15. +.SH NOTES +It is often better to use netlink via +.I libnetlink +or +.I libnl +than via the low-level kernel interface. +.SH BUGS +This manual page is not complete. +.SH EXAMPLE +The following example creates a +.B NETLINK_ROUTE +netlink socket which will listen to the +.B RTMGRP_LINK +(network interface create/delete/up/down events) and +.B RTMGRP_IPV4_IFADDR +(IPv4 addresses add/delete events) multicast groups. + +.in +4n +.nf +struct sockaddr_nl sa; + +memset(&sa, 0, sizeof(sa)); +sa.nl_family = AF_NETLINK; +sa.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR; + +fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); +bind(fd, (struct sockaddr *) &sa, sizeof(sa)); +.fi +.in + +The next example demonstrates how to send a netlink message to the +kernel (pid 0). +Note that application must take care of message sequence numbers +in order to reliably track acknowledgements. + +.in +4n +.nf +struct nlmsghdr *nh; /* The nlmsghdr with payload to send. */ +struct sockaddr_nl sa; +struct iovec iov = { (void *) nh, nh\->nlmsg_len }; +struct msghdr msg; + +msg = { (void *)&sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; +memset(&sa, 0, sizeof(sa)); +sa.nl_family = AF_NETLINK; +nh\->nlmsg_pid = 0; +nh\->nlmsg_seq = ++sequence_number; +/* Request an ack from kernel by setting NLM_F_ACK. */ +nh\->nlmsg_flags |= NLM_F_ACK; + +sendmsg(fd, &msg, 0); +.fi +.in + +And the last example is about reading netlink message. + +.in +4n +.nf +int len; +char buf[4096]; +struct iovec iov = { buf, sizeof(buf) }; +struct sockaddr_nl sa; +struct msghdr msg; +struct nlmsghdr *nh; + +msg = { (void *)&sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; +len = recvmsg(fd, &msg, 0); + +for (nh = (struct nlmsghdr *) buf; NLMSG_OK (nh, len); + nh = NLMSG_NEXT (nh, len)) { + /* The end of multipart message. */ + if (nh\->nlmsg_type == NLMSG_DONE) + return; + + if (nh\->nlmsg_type == NLMSG_ERROR) + /* Do some error handling. */ + ... + + /* Continue with parsing payload. */ + ... +} +.fi +.in +.SH "SEE ALSO" +.BR cmsg (3), +.BR netlink (3), +.BR capabilities (7), +.BR rtnetlink (7) +.PP +ftp://ftp.inr.ac.ru/ip-routing/iproute2* +for information about libnetlink. + +http://people.suug.ch/~tgr/libnl/ +for information about libnl. + +RFC 3549 "Linux Netlink as an IP Services Protocol" diff --git a/original/man7/numa.7 b/original/man7/numa.7 new file mode 100644 index 00000000..64af9a8b --- /dev/null +++ b/original/man7/numa.7 @@ -0,0 +1,187 @@ +.\" 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. +.\" +.TH NUMA 7 2008-08-15 "Linux" "Linux Programmer's Manual" +.SH NAME +numa \- overview of Non-Uniform Memory Architecture +.SH DESCRIPTION +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: +.BR get_mempolicy (2), +.BR mbind (2), +.BR migrate_pages (2), +.BR move_pages (2), +and +.BR set_mempolicy (2). +However, applications should normally use the interface provided by +.IR libnuma ; +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. + +.I numa_maps +is a read-only file. +When +.I /proc//numa_maps +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 +.I /proc//maps +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 +.I N= +The number of pages allocated on +.IR . +.I +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 +.I file= +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 +.I heap +Memory range is used for the heap. +.TP +.I stack +Memory range is used for the stack. +.TP +.I huge +Huge memory range. +The page counts shown are huge pages and not regular sized pages. +.TP +.I anon= +The number of anonymous page in the range. +.TP +.I dirty= +Number of dirty pages. +.TP +.I mapped= +Total number of mapped pages, if different from +.IR dirty +and +.I anon +pages. +.TP +.I mapmax= +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 +.I swapcache= +Number of pages that have an associated entry on a swap device. +.TP +.I active= +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 +.I writeback= +Number of pages that are currently being written out to disk. +.SH NOTES +The Linux NUMA system calls and +.I /proc +interface are only available +if the kernel was configured and built with the +.BR CONFIG_NUMA +option. +.SS Library Support +Link with \fI\-lnuma\fP +to get the system call definitions. +.I libnuma +and the required +.I +header are available in the +.I numactl +package. + +However, applications should not use these system calls directly. +Instead, the higher level interface provided by the +.BR numa (3) +functions in the +.I numactl +package is recommended. +The +.I numactl +package is available at +.IR ftp://oss.sgi.com/www/projects/libnuma/download/ . +The package is also included in some Linux distributions. +Some distributions include the development library and header +in the separate +.I numactl-devel +package. +.SH "CONFORMING TO" +No standards govern NUMA interfaces. +.SH "SEE ALSO" +.BR get_mempolicy (2), +.BR mbind (2), +.BR move_pages (2), +.BR set_mempolicy (2), +.BR numa (3), +.BR cpuset (7), +.BR numactl (8) diff --git a/original/man7/operator.7 b/original/man7/operator.7 new file mode 100644 index 00000000..3d8c42e6 --- /dev/null +++ b/original/man7/operator.7 @@ -0,0 +1,62 @@ +.\" 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 +.\" +.TH OPERATOR 7 2007-12-08 "Linux" "Linux Programmer's Manual" +.SH NAME +C operator \- C operator precedence and order of evaluation +.SH DESCRIPTION +This manual page lists C operators and their precedence in evaluation. +.nf + +.B "Operator Associativity" +() [] \-> . left to right +! ~ ++ \-\- + \- (type) * & sizeof right to left +* / % left to right ++ \- left to right +<< >> left to right +< <= > >= left to right +== != left to right +& left to right +^ left to right +| left to right +&& left to right +|| left to right +?: right to left += += \-= *= /= %= <<= >>= &= ^= |= right to left +, left to right +.fi +.\" diff --git a/original/man7/packet.7 b/original/man7/packet.7 new file mode 100644 index 00000000..0b6c6690 --- /dev/null +++ b/original/man7/packet.7 @@ -0,0 +1,402 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: packet.7,v 1.13 2000/08/14 08:03:45 ak Exp $ +.TH PACKET 7 2008-08-08 "Linux" "Linux Programmer's Manual" +.SH NAME +packet, AF_PACKET \- packet interface on device level. +.SH SYNOPSIS +.nf +.B #include +.br +.B #include +.br +.B #include /* the L2 protocols */ +.sp +.BI "packet_socket = socket(AF_PACKET, int " socket_type ", int "protocol ); +.fi +.SH DESCRIPTION +Packet sockets are used to receive or send raw packets at the device driver +(OSI Layer 2) level. +They allow the user to implement protocol modules in user space +on top of the physical layer. + +The +.I socket_type +is either +.B SOCK_RAW +for raw packets including the link level header or +.B SOCK_DGRAM +for cooked packets with the link level header removed. +The link level +header information is available in a common format in a +.IR sockaddr_ll . +.I protocol +is the IEEE 802.3 protocol number in network order. +See the +.I +include file for a list of allowed protocols. +When protocol +is set to +.B htons(ETH_P_ALL) +then all protocols are received. +All incoming packets of that protocol type will be passed to the packet +socket before they are passed to the protocols implemented in the kernel. + +Only processes with effective UID 0 or the +.B CAP_NET_RAW +capability may open packet sockets. + +.B SOCK_RAW +packets are passed to and from the device driver without any changes in +the packet data. +When receiving a packet, the address is still parsed and +passed in a standard +.I sockaddr_ll +address structure. +When transmitting a packet, the user supplied buffer +should contain the physical layer header. +That packet is then +queued unmodified to the network driver of the interface defined by the +destination address. +Some device drivers always add other headers. +.B SOCK_RAW +is similar to but not compatible with the obsolete +.B AF_INET/SOCK_PACKET +of Linux 2.0. + +.B SOCK_DGRAM +operates on a slightly higher level. +The physical header is removed before the packet is passed to the user. +Packets sent through a +.B SOCK_DGRAM +packet socket get a suitable physical layer header based on the +information in the +.I sockaddr_ll +destination address before they are queued. + +By default all packets of the specified protocol type +are passed to a packet socket. +To only get packets from a specific interface use +.BR bind (2) +specifying an address in a +.I struct sockaddr_ll +to bind the packet socket to an interface. +Only the +.I sll_protocol +and the +.I sll_ifindex +address fields are used for purposes of binding. + +The +.BR connect (2) +operation is not supported on packet sockets. + +When the +.B MSG_TRUNC +flag is passed to +.BR recvmsg (2), +.BR recv (2), +.BR recvfrom (2) +the real length of the packet on the wire is always returned, +even when it is longer than the buffer. +.SS Address Types +The sockaddr_ll is a device independent physical layer address. + +.in +4n +.nf +struct sockaddr_ll { + unsigned short sll_family; /* Always AF_PACKET */ + unsigned short sll_protocol; /* Physical layer protocol */ + int sll_ifindex; /* Interface number */ + unsigned short sll_hatype; /* Header type */ + unsigned char sll_pkttype; /* Packet type */ + unsigned char sll_halen; /* Length of address */ + unsigned char sll_addr[8]; /* Physical layer address */ +}; +.fi +.in + +.I sll_protocol +is the standard ethernet protocol type in network order as defined +in the +.I +include file. +It defaults to the socket's protocol. +.I sll_ifindex +is the interface index of the interface +(see +.BR netdevice (7)); +0 matches any interface (only permitted for binding). +.I sll_hatype +is a ARP type as defined in the +.I +include file. +.I sll_pkttype +contains the packet type. +Valid types are +.B PACKET_HOST +for a packet addressed to the local host, +.B PACKET_BROADCAST +for a physical layer broadcast packet, +.B PACKET_MULTICAST +for a packet sent to a physical layer multicast address, +.B PACKET_OTHERHOST +for a packet to some other host that has been caught by a device driver +in promiscuous mode, and +.B PACKET_OUTGOING +for a packet originated from the local host that is looped back to a packet +socket. +These types make only sense for receiving. +.I sll_addr +and +.I sll_halen +contain the physical layer (e.g., IEEE 802.3) address and its length. +The exact interpretation depends on the device. + +When you send packets it is enough to specify +.IR sll_family , +.IR sll_addr , +.IR sll_halen , +.IR sll_ifindex . +The other fields should be 0. +.I sll_hatype +and +.I sll_pkttype +are set on received packets for your information. +For bind only +.I sll_protocol +and +.I sll_ifindex +are used. +.SS Socket Options +Packet sockets can be used to configure physical layer multicasting +and promiscuous mode. +It works by calling +.BR setsockopt (2) +on a packet socket for +.B SOL_PACKET +and one of the options +.B PACKET_ADD_MEMBERSHIP +to add a binding or +.B PACKET_DROP_MEMBERSHIP +to drop it. +They both expect a +.B packet_mreq +structure as argument: + +.in +4n +.nf +struct packet_mreq { + int mr_ifindex; /* interface index */ + unsigned short mr_type; /* action */ + unsigned short mr_alen; /* address length */ + unsigned char mr_address[8]; /* physical layer address */ +}; +.fi +.in + +.B mr_ifindex +contains the interface index for the interface whose status +should be changed. +The +.B mr_type +parameter specifies which action to perform. +.B PACKET_MR_PROMISC +enables receiving all packets on a shared medium (often known as +"promiscuous mode"), +.B PACKET_MR_MULTICAST +binds the socket to the physical layer multicast group specified in +.B mr_address +and +.BR mr_alen , +and +.B PACKET_MR_ALLMULTI +sets the socket up to receive all multicast packets arriving at +the interface. + +In addition the traditional ioctls +.BR SIOCSIFFLAGS , +.BR SIOCADDMULTI , +.B SIOCDELMULTI +can be used for the same purpose. +.SS Ioctls +.B SIOCGSTAMP +can be used to receive the timestamp of the last received packet. +Argument is a +.I struct timeval. + +In addition all standard ioctls defined in +.BR netdevice (7) +and +.BR socket (7) +are valid on packet sockets. +.SS Error Handling +Packet sockets do no error handling other than errors occurred +while passing the packet to the device driver. +They don't have the concept of a pending error. +.SH ERRORS +.TP +.B EADDRNOTAVAIL +Unknown multicast group address passed. +.TP +.B EFAULT +User passed invalid memory address. +.TP +.B EINVAL +Invalid argument. +.TP +.B EMSGSIZE +Packet is bigger than interface MTU. +.TP +.B ENETDOWN +Interface is not up. +.TP +.B ENOBUFS +Not enough memory to allocate the packet. +.TP +.B ENODEV +Unknown device name or interface index specified in interface address. +.TP +.B ENOENT +No packet received. +.TP +.B ENOTCONN +No interface address passed. +.TP +.B ENXIO +Interface address contained an invalid interface index. +.TP +.B EPERM +User has insufficient privileges to carry out this operation. + +In addition other errors may be generated by the low-level driver. +.SH VERSIONS +.B AF_PACKET +is a new feature in Linux 2.2. +Earlier Linux versions supported only +.BR SOCK_PACKET . +.PP +The include file +.I +is present since glibc 2.1. +Older systems need: +.sp +.in +4n +.nf +#include +#include +#include /* The L2 protocols */ +.fi +.in +.SH NOTES +For portable programs it is suggested to use +.B AF_PACKET +via +.BR pcap (3); +although this only covers a subset of the +.B AF_PACKET +features. + +The +.B SOCK_DGRAM +packet sockets make no attempt to create or parse the IEEE 802.2 LLC +header for a IEEE 802.3 frame. +When +.B ETH_P_802_3 +is specified as protocol for sending the kernel creates the +802.3 frame and fills out the length field; the user has to supply the LLC +header to get a fully conforming packet. +Incoming 802.3 packets are not multiplexed on the DSAP/SSAP protocol +fields; instead they are supplied to the user as protocol +.B ETH_P_802_2 +with the LLC header prepended. +It is thus not possible to bind to +.BR ETH_P_802_3 ; +bind to +.B ETH_P_802_2 +instead and do the protocol multiplex yourself. +The default for sending is the standard Ethernet DIX +encapsulation with the protocol filled in. + +Packet sockets are not subject to the input or output firewall chains. +.SS Compatibility +In Linux 2.0, the only way to get a packet socket was by calling +.BI "socket(AF_INET, SOCK_PACKET, " protocol )\fR. +This is still supported but strongly deprecated. +The main difference between the two methods is that +.B SOCK_PACKET +uses the old +.I struct sockaddr_pkt +to specify an interface, which doesn't provide physical layer +independence. + +.in +4n +.nf +struct sockaddr_pkt { + unsigned short spkt_family; + unsigned char spkt_device[14]; + unsigned short spkt_protocol; +}; +.fi +.in + +.I spkt_family +contains +the device type, +.I spkt_protocol +is the IEEE 802.3 protocol type as defined in +.I +and +.I spkt_device +is the device name as a null-terminated string, for example, eth0. + +This structure is obsolete and should not be used in new code. +.SH BUGS +glibc 2.1 does not have a define for +.BR SOL_PACKET . +The suggested workaround is to use: +.in +4n +.nf + +#ifndef SOL_PACKET +#define SOL_PACKET 263 +#endif + +.fi +.in +This is fixed in later glibc versions and also does not occur on +libc5 systems. + +The IEEE 802.2/803.3 LLC handling could be considered as a bug. + +Socket filters are not documented. + +The +.B MSG_TRUNC +.BR recvmsg (2) +extension is an ugly hack and should be replaced by a control message. +There is currently no way to get the original destination address of +packets via +.BR SOCK_DGRAM . +.\" .SH CREDITS +.\" This man page was written by Andi Kleen with help from Matthew Wilcox. +.\" AF_PACKET in Linux 2.2 was implemented +.\" by Alexey Kuznetsov, based on code by Alan Cox and others. +.SH "SEE ALSO" +.BR socket (2), +.BR pcap (3), +.BR capabilities (7), +.BR ip (7), +.BR raw (7), +.BR socket (7) + +RFC\ 894 for the standard IP Ethernet encapsulation. + +RFC\ 1700 for the IEEE 802.3 IP encapsulation. + +The +.I +include file for physical layer protocols. diff --git a/original/man7/path_resolution.7 b/original/man7/path_resolution.7 new file mode 100644 index 00000000..7c10c712 --- /dev/null +++ b/original/man7/path_resolution.7 @@ -0,0 +1,233 @@ +.\" Copyright (C) 2003 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. +.\" +.TH PATH_RESOLUTION 7 2009-12-05 "Linux" "Linux Programmer's Manual" +.SH NAME +path_resolution \- how a pathname is resolved to a file +.SH DESCRIPTION +Some Unix/Linux system calls have as parameter one or more filenames. +A filename (or pathname) is resolved as follows. +.SS "Step 1: Start of the resolution process" +If the pathname starts with the \(aq/\(aq character, +the starting lookup directory +is the root directory of the calling process. +(A process inherits its +root directory from its parent. +Usually this will be the root directory +of the file hierarchy. +A process may get a different root directory +by use of the +.BR chroot (2) +system call. +A process may get an entirely private mount namespace in case +it \(em or one of its ancestors \(em was started by an invocation of the +.BR clone (2) +system call that had the +.B CLONE_NEWNS +flag set.) +This handles the \(aq/\(aq part of the pathname. + +If the pathname does not start with the \(aq/\(aq character, the +starting lookup directory of the resolution process is the current working +directory of the process. +(This is also inherited from the parent. +It can be changed by use of the +.BR chdir (2) +system call.) + +Pathnames starting with a \(aq/\(aq character are called absolute pathnames. +Pathnames not starting with a \(aq/\(aq are called relative pathnames. +.SS "Step 2: Walk along the path" +Set the current lookup directory to the starting lookup directory. +Now, for each nonfinal component of the pathname, where a component +is a substring delimited by \(aq/\(aq characters, this component is looked up +in the current lookup directory. + +If the process does not have search permission on +the current lookup directory, +an +.B EACCES +error is returned ("Permission denied"). + +If the component is not found, an +.B ENOENT +error is returned +("No such file or directory"). + +If the component is found, but is neither a directory nor a symbolic link, +an +.B ENOTDIR +error is returned ("Not a directory"). + +If the component is found and is a directory, we set the +current lookup directory to that directory, and go to the +next component. + +If the component is found and is a symbolic link (symlink), we first +resolve this symbolic link (with the current lookup directory +as starting lookup directory). +Upon error, that error is returned. +If the result is not a directory, an +.B ENOTDIR +error is returned. +If the resolution of the symlink is successful and returns a directory, +we set the current lookup directory to that directory, and go to +the next component. +Note that the resolution process here involves recursion. +In order to protect the kernel against stack overflow, and also +to protect against denial of service, there are limits on the +maximum recursion depth, and on the maximum number of symbolic links +followed. +An +.B ELOOP +error is returned when the maximum is +exceeded ("Too many levels of symbolic links"). +.\" +.\" presently: max recursion depth during symlink resolution: 5 +.\" max total number of symbolic links followed: 40 +.\" _POSIX_SYMLOOP_MAX is 8 +.SS "Step 3: Find the final entry" +The lookup of the final component of the pathname goes just like +that of all other components, as described in the previous step, +with two differences: (i) the final component need not be a +directory (at least as far as the path resolution process is concerned \(em +it may have to be a directory, or a nondirectory, because of +the requirements of the specific system call), and (ii) it +is not necessarily an error if the component is not found \(em +maybe we are just creating it. +The details on the treatment +of the final entry are described in the manual pages of the specific +system calls. +.SS ". and .." +By convention, every directory has the entries "." and "..", +which refer to the directory itself and to its parent directory, +respectively. + +The path resolution process will assume that these entries have +their conventional meanings, regardless of whether they are +actually present in the physical file system. + +One cannot walk down past the root: "/.." is the same as "/". +.SS "Mount points" +After a "mount dev path" command, the pathname "path" refers to +the root of the file system hierarchy on the device "dev", and no +longer to whatever it referred to earlier. + +One can walk out of a mounted file system: "path/.." refers to +the parent directory of "path", +outside of the file system hierarchy on "dev". +.SS "Trailing slashes" +If a pathname ends in a \(aq/\(aq, that forces resolution of the preceding +component as in Step 2: it has to exist and resolve to a directory. +Otherwise a trailing \(aq/\(aq is ignored. +(Or, equivalently, a pathname with a trailing \(aq/\(aq is equivalent to +the pathname obtained by appending \(aq.\(aq to it.) +.SS "Final symlink" +If the last component of a pathname is a symbolic link, then it +depends on the system call whether the file referred to will be +the symbolic link or the result of path resolution on its contents. +For example, the system call +.BR lstat (2) +will operate on the symlink, while +.BR stat (2) +operates on the file pointed to by the symlink. +.SS "Length limit" +There is a maximum length for pathnames. +If the pathname (or some +intermediate pathname obtained while resolving symbolic links) +is too long, an +.B ENAMETOOLONG +error is returned ("File name too long"). +.SS "Empty pathname" +In the original Unix, the empty pathname referred to the current directory. +Nowadays POSIX decrees that an empty pathname must not be resolved +successfully. +Linux returns +.B ENOENT +in this case. +.SS "Permissions" +The permission bits of a file consist of three groups of three bits, cf.\& +.BR chmod (1) +and +.BR stat (2). +The first group of three is used when the effective user ID of +the calling process equals the owner ID of the file. +The second group +of three is used when the group ID of the file either equals the +effective group ID of the calling process, or is one of the +supplementary group IDs of the calling process (as set by +.BR setgroups (2)). +When neither holds, the third group is used. + +Of the three bits used, the first bit determines read permission, +the second write permission, and the last execute permission +in case of ordinary files, or search permission in case of directories. + +Linux uses the fsuid instead of the effective user ID in permission checks. +Ordinarily the fsuid will equal the effective user ID, but the fsuid can be +changed by the system call +.BR setfsuid (2). + +(Here "fsuid" stands for something like "file system user ID". +The concept was required for the implementation of a user space +NFS server at a time when processes could send a signal to a process +with the same effective user ID. +It is obsolete now. +Nobody should use +.BR setfsuid (2).) + +Similarly, Linux uses the fsgid ("file system group ID") +instead of the effective group ID. +See +.BR setfsgid (2). +.\" FIXME say something about file system mounted read-only ? +.SS "Bypassing permission checks: superuser and capabilities" +On a traditional Unix system, the superuser +.RI ( root , +user ID 0) is all-powerful, and bypasses all permissions restrictions +when accessing files. +.\" (but for exec at least one x bit must be set) -- AEB +.\" but there is variation across systems on this point: for +.\" example, HP-UX and Tru64 are as described by AEB. However, +.\" on some implementations (e.g., Solaris, FreeBSD), +.\" access(X_OK) by superuser will report success, regardless +.\" of the file's execute permission bits. -- MTK (Oct 05) + +On Linux, superuser privileges are divided into capabilities (see +.BR capabilities (7)). +Two capabilities are relevant for file permissions checks: +\fBCAP_DAC_OVERRIDE\fP and \fBCAP_DAC_READ_SEARCH\fP. +(A process has these capabilities if its fsuid is 0.) + +The \fBCAP_DAC_OVERRIDE\fP capability overrides all permission checking, +but only grants execute permission when at least one +of the file's three execute permission bits is set. + +The \fBCAP_DAC_READ_SEARCH\fP capability grants read and search permission +on directories, and read permission on ordinary files. +.\" FIXME say something about immutable files +.\" FIXME say something about ACLs +.SH "SEE ALSO" +.BR readlink (2), +.BR capabilities (7), +.BR credentials (7), +.BR symlink (7) diff --git a/original/man7/pipe.7 b/original/man7/pipe.7 new file mode 100644 index 00000000..14bc4521 --- /dev/null +++ b/original/man7/pipe.7 @@ -0,0 +1,243 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2005 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. +.\" +.TH PIPE 7 2005-12-08 "Linux" "Linux Programmer's Manual" +.SH NAME +pipe \- overview of pipes and FIFOs +.SH DESCRIPTION +Pipes and FIFOs (also known as named pipes) +provide a unidirectional interprocess communication channel. +A pipe has a +.I read end +and a +.IR "write end" . +Data written to the write end of a pipe can be read +from the read end of the pipe. + +A pipe is created using +.BR pipe (2), +which creates a new pipe and returns two file descriptors, +one referring to the read end of the pipe, +the other referring to the write end. +Pipes can be used to create a communication channel between related +processes; see +.BR pipe (2) +for an example. + +A FIFO (short for First In First Out) has a name within the file +system (created using +.BR mkfifo (3)), +and is opened using +.BR open (2). +Any process may open a FIFO, assuming the file permissions allow it. +The read end is opened using the +.B O_RDONLY +flag; the write end is opened using the +.B O_WRONLY +flag. +See +.BR fifo (7) +for further details. +.IR Note : +although FIFOs have a pathname in the file system, +I/O on FIFOs does not involve operations on the underlying device +(if there is one). +.SS "I/O on Pipes and FIFOs" +The only difference between pipes and FIFOs is the manner in which +they are created and opened. +Once these tasks have been accomplished, +I/O on pipes and FIFOs has exactly the same semantics. + +If a process attempts to read from an empty pipe, then +.BR read (2) +will block until data is available. +If a process attempts to write to a full pipe (see below), then +.BR write (2) +blocks until sufficient data has been read from the pipe +to allow the write to complete. +Nonblocking I/O is possible by using the +.BR fcntl (2) +.B F_SETFL +operation to enable the +.B O_NONBLOCK +open file status flag. + +The communication channel provided by a pipe is a +.IR "byte stream" : +there is no concept of message boundaries. + +If all file descriptors referring to the write end of a pipe +have been closed, then an attempt to +.BR read (2) +from the pipe will see end-of-file +.RB ( read (2) +will return 0). +If all file descriptors referring to the read end of a pipe +have been closed, then a +.BR write (2) +will cause a +.B SIGPIPE +signal to be generated for the calling process. +If the calling process is ignoring this signal, then +.BR write (2) +fails with the error +.BR EPIPE . +An application that uses +.BR pipe (2) +and +.BR fork (2) +should use suitable +.BR close (2) +calls to close unnecessary duplicate file descriptors; +this ensures that end-of-file and +.BR SIGPIPE / EPIPE +are delivered when appropriate. + +It is not possible to apply +.BR lseek (2) +to a pipe. +.SS "Pipe Capacity" +A pipe has a limited capacity. +If the pipe is full, then a +.BR write (2) +will block or fail, depending on whether the +.B O_NONBLOCK +flag is set (see below). +Different implementations have different limits for the pipe capacity. +Applications should not rely on a particular capacity: +an application should be designed so that a reading process consumes data +as soon as it is available, +so that a writing process does not remain blocked. + +In Linux versions before 2.6.11, the capacity of a pipe was the same as +the system page size (e.g., 4096 bytes on i386). +Since Linux 2.6.11, the pipe capacity is 65536 bytes. +.SS PIPE_BUF +POSIX.1-2001 says that +.BR write (2)s +of less than +.B PIPE_BUF +bytes must be atomic: the output data is written to the pipe as a +contiguous sequence. +Writes of more than +.B PIPE_BUF +bytes may be nonatomic: the kernel may interleave the data +with data written by other processes. +POSIX.1-2001 requires +.B PIPE_BUF +to be at least 512 bytes. +(On Linux, +.B PIPE_BUF +is 4096 bytes.) +The precise semantics depend on whether the file descriptor is nonblocking +.RB ( O_NONBLOCK ), +whether there are multiple writers to the pipe, and on +.IR n , +the number of bytes to be written: +.TP +\fBO_NONBLOCK\fP disabled, \fIn\fP <= \fBPIPE_BUF\fP +All +.I n +bytes are written atomically; +.BR write (2) +may block if there is not room for +.I n +bytes to be written immediately +.TP +\fBO_NONBLOCK\fP enabled, \fIn\fP <= \fBPIPE_BUF\fP +If there is room to write +.I n +bytes to the pipe, then +.BR write (2) +succeeds immediately, writing all +.I n +bytes; otherwise +.BR write (2) +fails, with +.I errno +set to +.BR EAGAIN . +.TP +\fBO_NONBLOCK\fP disabled, \fIn\fP > \fBPIPE_BUF\fP +The write is nonatomic: the data given to +.BR write (2) +may be interleaved with +.BR write (2)s +by other process; +the +.BR write (2) +blocks until +.I n +bytes have been written. +.TP +\fBO_NONBLOCK\fP enabled, \fIn\fP > \fBPIPE_BUF\fP +If the pipe is full, then +.BR write (2) +fails, with +.I errno +set to +.BR EAGAIN . +Otherwise, from 1 to +.I n +bytes may be written (i.e., a "partial write" may occur; +the caller should check the return value from +.BR write (2) +to see how many bytes were actually written), +and these bytes may be interleaved with writes by other processes. +.SS "Open File Status Flags" +The only open file status flags that can be meaningfully applied to +a pipe or FIFO are +.B O_NONBLOCK +and +.BR O_ASYNC . + +Setting the +.B O_ASYNC +flag for the read end of a pipe causes a signal +.RB ( SIGIO +by default) to be generated when new input becomes available on the pipe +(see +.BR fcntl (2) +for details). +On Linux, +.B O_ASYNC +is supported for pipes and FIFOs only since kernel 2.6. +.SS "Portability notes" +On some systems (but not Linux), pipes are bidirectional: +data can be transmitted in both directions between the pipe ends. +According to POSIX.1-2001, pipes only need to be unidirectional. +Portable applications should avoid reliance on +bidirectional pipe semantics. +.SH "SEE ALSO" +.BR dup (2), +.BR fcntl (2), +.BR open (2), +.BR pipe (2), +.BR poll (2), +.BR select (2), +.BR socketpair (2), +.BR stat (2), +.BR mkfifo (3), +.BR epoll (7), +.BR fifo (7) diff --git a/original/man7/posixoptions.7 b/original/man7/posixoptions.7 new file mode 100644 index 00000000..5833417d --- /dev/null +++ b/original/man7/posixoptions.7 @@ -0,0 +1,855 @@ +.\" 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. +.\" +.TH POSIXOPTIONS 7 2007-12-21 "" "Linux Programmer's Manual" +.SH NAME +posixoptions \- optional parts of the POSIX standard +.SH DESCRIPTION +The POSIX standard (the information below is from POSIX.1-2001) +describes a set of behaviors and interfaces for a compliant system. +However, many interfaces are optional and there are feature test macros +to test the availability of interfaces at compile time, and functions +.BR sysconf (3), +.BR fpathconf (3), +.BR pathconf (3), +.BR confstr (3) +to do this at run time. +From shell scripts one can use +.BR getconf (1). +For more detail, see +.BR sysconf (3). +.LP +We give the name of the POSIX abbreviation, the option, the name of the +.BR sysconf () +parameter used to inquire about the option, and possibly +a very short description. +Much more precise detail can be found in the POSIX standard itself, +versions of which can nowadays be accessed freely on the web. +.SS "ADV - _POSIX_ADVISORY_INFO - _SC_ADVISORY_INFO" +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" +The header +.I +is present. +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" +This option implies the +.B _POSIX_THREADS +and +.B _POSIX_THREAD_SAFE_FUNCTIONS +options. +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" +.\" Batch environment. +.\" .SS "CD" +.\" C development. +.SS "--- - POSIX_CHOWN_RESTRICTED" +If this option is in effect (as it always is under POSIX.1-2001) +then only root may change the owner of a file, and nonroot can only +set the group of a file to one of the groups it belongs to. +This affects the functions +.IR chown (), +.IR fchown (). +.\" What about lchown() ? +.SS "CS - _POSIX_CLOCK_SELECTION - _SC_CLOCK_SELECTION" +This option implies the +.B _POSIX_TIMERS +option. +The following functions are present: +.br +.nf +.in +4 + +.IR pthread_condattr_getclock (), +.IR pthread_condattr_setclock (), +.IR clock_nanosleep (). +.in -4 + +.fi +If +.B CLOCK_REALTIME +is changed by the function +.IR clock_settime (), +then this affects all timers set for an absolute time. +.SS "CPT - _POSIX_CPUTIME - _SC_CPUTIME" +The clockID CLOCK_PROCESS_CPUTIME_ID is supported. +The initial value of this clock is 0 for each process. +This option implies the +.B _POSIX_TIMERS +option. +The function +.IR clock_getcpuclockid () +is present. +.\" .SS "FD" +.\" Fortran development +.\" .SS "FR" +.\" Fortran runtime +.SS "--- - _POSIX_FILE_LOCKING - _SC_FILE_LOCKING" +This option has been deleted. +Not in final XPG6. +.SS "FSC - _POSIX_FSYNC - _SC_FSYNC " +The function +.IR fsync () +is present. +.SS "IP6 - _POSIX_IPV6 - _SC_IPV6" +Internet Protocol Version 6 is supported. +.SS "--- - _POSIX_JOB_CONTROL - _SC_JOB_CONTROL" +If this option is in effect (as it always is under POSIX.1-2001) +then the system implements POSIX-style job control, +and the following functions are present: +.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" +Shared memory is supported. +The include file +.I +is present. +The following functions are present: +.IR mmap (), +.IR msync (), +.IR munmap (). +.SS "ML - _POSIX_MEMLOCK - _SC_MEMLOCK" +Shared memory can be locked into core. +The functions +.IR mlockall (), +.IR munlockall () +are present. +.SS "MR/MLR - _POSIX_MEMLOCK_RANGE - _SC_MEMLOCK_RANGE" +More precisely, ranges can be locked into core. +The functions +.IR mlock (), +.IR munlock () +are present. +.SS "MPR - _POSIX_MEMORY_PROTECTION - _SC_MEMORY_PROTECTION" +The function +.IR mprotect () +is present. +.SS "MSG - _POSIX_MESSAGE_PASSING - _SC_MESSAGE_PASSING" +The include file +.I +is present. +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" +.B CLOCK_MONOTONIC +is supported. +This option implies the +.B _POSIX_TIMERS +option. +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" +This option has been deleted. +Not in final XPG6. +.\" .SS "MX" +.\" IEC 60559 Floating-Point Option. +.SS "--- - _POSIX_NO_TRUNC" +If this option is in effect (as it always is under POSIX.1-2001) +then pathname components longer than +.B NAME_MAX +are not truncated, +but give an error. +This property may be dependent on the path prefix of the component. +.SS "PIO - _POSIX_PRIORITIZED_IO - _SC_PRIORITIZED_IO" +This option says that one can specify priorities for asynchronous I/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" +The include file +.I +is present. +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 +If also +.B _POSIX_SPAWN +is in effect, then the following functions are present: +.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" +Raw sockets are supported. +Affected functions are +.IR getsockopt (), +.IR setsockopt (). +.SS "--- - _POSIX_READER_WRITER_LOCKS - _SC_READER_WRITER_LOCKS" +This option implies the +.B _POSIX_THREADS +option. +Conversely, +under POSIX.1-2001 the +.B _POSIX_THREADS +option implies this option. +.nf +The following functions are present: +.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" +Realtime signals are supported. +The following functions are present: +.br +.nf +.in +4 + +.IR sigqueue (), +.IR sigtimedwait (), +.IR sigwaitinfo (). +.br +.in -4 +.fi +.SS "--- - _POSIX_REGEXP - _SC_REGEXP" +If this option is in effect (as it always is under POSIX.1-2001) +then POSIX regular expressions are supported +and the following functions are present: +.br +.nf +.in +4 + +.IR regcomp (), +.IR regerror (), +.IR regexec (), +.IR regfree (). +.br +.in -4 +.fi +.SS "--- - _POSIX_SAVED_IDS - _SC_SAVED_IDS" +If this option is in effect (as it always is under POSIX.1-2001) +then a process has a saved set-user-ID and a saved set-group-ID. +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" +.\" Software development +.SS "SEM - _POSIX_SEMAPHORES - _SC_SEMAPHORES" +The include file +.I +is present. +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" +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" +If this option is in effect (as it always is under POSIX.1-2001), +the function +.IR system () +is present. +.SS "SPN - _POSIX_SPAWN - _SC_SPAWN" +This option describes support for process creation in a context where +it is difficult or impossible to use +.IR fork (), +for example, because no MMU is present. +If +.B _POSIX_SPAWN +is in effect, then the include file +.I +and the following functions are present: +.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 +If also +.B _POSIX_PRIORITY_SCHEDULING +is in effect, then +the following functions are present: +.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" +This option implies the +.B _POSIX_THREADS +and +.B _POSIX_THREAD_SAFE_FUNCTIONS +options. +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" +The scheduling policy +.B SCHED_SPORADIC +is supported. +This option implies the +.B _POSIX_PRIORITY_SCHEDULING +option. +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" +Affected functions are +.IR open (), +.IR msync (), +.IR fsync (), +.IR fdatasync (). +.SS "TSA - _POSIX_THREAD_ATTR_STACKADDR - _SC_THREAD_ATTR_STACKADDR" +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" +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" +The clockID CLOCK_THREAD_CPUTIME_ID is supported. +This option implies the +.B _POSIX_TIMERS +option. +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" +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" +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" +If this option is in effect, the different threads inside a process +can run with different priorities and/or different schedulers. +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" +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" +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" +This option implies the +.B _POSIX_THREAD_PRIORITY_SCHEDULING +option. +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" +Basic support for POSIX threads is available. +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" +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" +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" +POSIX tracing is available. +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" +This option implies the +.B _POSIX_TRACE +option. +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" +Tracing children of the traced process is supported. +This option implies the +.B _POSIX_TRACE +option. +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" +This option implies the +.B _POSIX_TRACE +option. +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" +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" +Always present (probably 0). +Value to set a changeable special control +character to indicate that it is disabled. +.SH "XOPEN EXTENSIONS" +.BR _XOPEN_CRYPT , +.BR _XOPEN_LEGACY , +.BR _XOPEN_REALTIME , +.BR _XOPEN_REALTIME_THREADS , +.BR _XOPEN_UNIX . +.\" To be described. +.SH "SEE ALSO" +.BR sysconf (3), +.BR standards (7) diff --git a/original/man7/pthreads.7 b/original/man7/pthreads.7 new file mode 100644 index 00000000..2fa02385 --- /dev/null +++ b/original/man7/pthreads.7 @@ -0,0 +1,907 @@ +'\" t +.\" Copyright (c) 2005 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. +.\" +.TH PTHREADS 7 2008-11-18 "Linux" "Linux Programmer's Manual" +.SH NAME +pthreads \- POSIX threads +.SH DESCRIPTION +POSIX.1 specifies a set of interfaces (functions, header files) for +threaded programming commonly known as POSIX threads, or Pthreads. +A single process can contain multiple threads, +all of which are executing the same program. +These threads share the same global memory (data and heap segments), +but each thread has its own stack (automatic variables). + +POSIX.1 also requires that threads share a range of other attributes +(i.e., these attributes are process-wide rather than per-thread): +.IP \- 3 +process ID +.IP \- 3 +parent process ID +.IP \- 3 +process group ID and session ID +.IP \- 3 +controlling terminal +.IP \- 3 +user and group IDs +.IP \- 3 +open file descriptors +.IP \- 3 +record locks (see +.BR fcntl (2)) +.IP \- 3 +signal dispositions +.IP \- 3 +file mode creation mask +.RB ( umask (2)) +.IP \- 3 +current directory +.RB ( chdir (2)) +and +root directory +.RB ( chroot (2)) +.IP \- 3 +interval timers +.RB ( setitimer (2)) +and POSIX timers +.RB ( timer_create (2)) +.IP \- 3 +nice value +.RB ( setpriority (2)) +.IP \- 3 +resource limits +.RB ( setrlimit (2)) +.IP \- 3 +measurements of the consumption of CPU time +.RB ( times (2)) +and resources +.RB ( getrusage (2)) +.PP +As well as the stack, POSIX.1 specifies that various other +attributes are distinct for each thread, including: +.IP \- 3 +thread ID (the +.I pthread_t +data type) +.IP \- 3 +signal mask +.RB ( pthread_sigmask (3)) +.IP \- 3 +the +.I errno +variable +.IP \- 3 +alternate signal stack +.RB ( sigaltstack (2)) +.IP \- 3 +real-time scheduling policy and priority +.RB ( sched_setscheduler (2) +and +.BR sched_setparam (2)) +.PP +The following Linux-specific features are also per-thread: +.IP \- 3 +capabilities (see +.BR capabilities (7)) +.IP \- 3 +CPU affinity +.RB ( sched_setaffinity (2)) +.SS "Pthreads function return values" +Most pthreads functions return 0 on success, and an error number of failure. +Note that the pthreads functions do not set +.IR errno . +For each of the pthreads functions that can return an error, +POSIX.1-2001 specifies that the function can never fail with the error +.BR EINTR . +.SS Thread IDs +Each of the threads in a process has a unique thread identifier +(stored in the type +.IR pthread_t ). +This identifier is returned to the caller of +.BR pthread_create (3), +and a thread can obtain its own thread identifier using +.BR pthread_self (3). +Thread IDs are only guaranteed to be unique within a process. +A thread ID may be reused after a terminated thread has been joined, +or a detached thread has terminated. +In all pthreads functions that accept a thread ID as an argument, +that ID by definition refers to a thread in +the same process as the caller. +.SS "Thread-safe functions" +A thread-safe function is one that can be safely +(i.e., it will deliver the same results regardless of whether it is) +called from multiple threads at the same time. + +POSIX.1-2001 and POSIX.1-2008 require that all functions specified +in the standard shall be thread-safe, +except for the following functions: +.in +4n +.nf + +asctime() +basename() +catgets() +crypt() +ctermid() if passed a non-NULL argument +ctime() +dbm_clearerr() +dbm_close() +dbm_delete() +dbm_error() +dbm_fetch() +dbm_firstkey() +dbm_nextkey() +dbm_open() +dbm_store() +dirname() +dlerror() +drand48() +ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)] +encrypt() +endgrent() +endpwent() +endutxent() +fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)] +ftw() +gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)] +getc_unlocked() +getchar_unlocked() +getdate() +getenv() +getgrent() +getgrgid() +getgrnam() +gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)] +gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)] +gethostent() +getlogin() +getnetbyaddr() +getnetbyname() +getnetent() +getopt() +getprotobyname() +getprotobynumber() +getprotoent() +getpwent() +getpwnam() +getpwuid() +getservbyname() +getservbyport() +getservent() +getutxent() +getutxid() +getutxline() +gmtime() +hcreate() +hdestroy() +hsearch() +inet_ntoa() +l64a() +lgamma() +lgammaf() +lgammal() +localeconv() +localtime() +lrand48() +mrand48() +nftw() +nl_langinfo() +ptsname() +putc_unlocked() +putchar_unlocked() +putenv() +pututxline() +rand() +readdir() +setenv() +setgrent() +setkey() +setpwent() +setutxent() +strerror() +strsignal() [Added in POSIX.1-2008] +strtok() +system() [Added in POSIX.1-2008] +tmpnam() if passed a non-NULL argument +ttyname() +unsetenv() +wcrtomb() if its final argument is NULL +wcsrtombs() if its final argument is NULL +wcstombs() +wctomb() +.fi +.in +.SS Cancellation Points +POSIX.1 specifies that certain functions must, +and certain other functions may, be cancellation points. +If a thread is cancelable, its cancelability type is deferred, +and a cancellation request is pending for the thread, +then the thread is canceled when it calls a function +that is a cancellation point. + +The following functions are required to be cancellation points by +POSIX.1-2001 and/or POSIX.1-2008: + +.\" FIXME +.\" Document the list of all functions that are cancellation points in glibc +.in +4n +.nf +accept() +aio_suspend() +clock_nanosleep() +close() +connect() +creat() +fcntl() F_SETLKW +fdatasync() +fsync() +getmsg() +getpmsg() +lockf() F_LOCK +mq_receive() +mq_send() +mq_timedreceive() +mq_timedsend() +msgrcv() +msgsnd() +msync() +nanosleep() +open() +openat() [Added in POSIX.1-2008] +pause() +poll() +pread() +pselect() +pthread_cond_timedwait() +pthread_cond_wait() +pthread_join() +pthread_testcancel() +putmsg() +putpmsg() +pwrite() +read() +readv() +recv() +recvfrom() +recvmsg() +select() +sem_timedwait() +sem_wait() +send() +sendmsg() +sendto() +sigpause() [POSIX.1-2001 only (moves to "may" list in POSIX.1-2008)] +sigsuspend() +sigtimedwait() +sigwait() +sigwaitinfo() +sleep() +system() +tcdrain() +usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)] +wait() +waitid() +waitpid() +write() +writev() +.fi +.in + +The following functions may be cancellation points according to +POSIX.1-2001 and/or POSIX.1-2008: + +.in +4n +.nf +access() +asctime() +asctime_r() +catclose() +catgets() +catopen() +chmod() [Added in POSIX.1-2008] +chown() [Added in POSIX.1-2008] +closedir() +closelog() +ctermid() +ctime() +ctime_r() +dbm_close() +dbm_delete() +dbm_fetch() +dbm_nextkey() +dbm_open() +dbm_store() +dlclose() +dlopen() +dprintf() [Added in POSIX.1-2008] +endgrent() +endhostent() +endnetent() +endprotoent() +endpwent() +endservent() +endutxent() +faccessat() [Added in POSIX.1-2008] +fchmod() [Added in POSIX.1-2008] +fchmodat() [Added in POSIX.1-2008] +fchown() [Added in POSIX.1-2008] +fchownat() [Added in POSIX.1-2008] +fclose() +fcntl() (for any value of cmd argument) +fflush() +fgetc() +fgetpos() +fgets() +fgetwc() +fgetws() +fmtmsg() +fopen() +fpathconf() +fprintf() +fputc() +fputs() +fputwc() +fputws() +fread() +freopen() +fscanf() +fseek() +fseeko() +fsetpos() +fstat() +fstatat() [Added in POSIX.1-2008] +ftell() +ftello() +ftw() +futimens() [Added in POSIX.1-2008] +fwprintf() +fwrite() +fwscanf() +getaddrinfo() +getc() +getc_unlocked() +getchar() +getchar_unlocked() +getcwd() +getdate() +getdelim() [Added in POSIX.1-2008] +getgrent() +getgrgid() +getgrgid_r() +getgrnam() +getgrnam_r() +gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)] +gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)] +gethostent() +gethostid() +gethostname() +getline() [Added in POSIX.1-2008] +getlogin() +getlogin_r() +getnameinfo() +getnetbyaddr() +getnetbyname() +getnetent() +getopt() (if opterr is nonzero) +getprotobyname() +getprotobynumber() +getprotoent() +getpwent() +getpwnam() +getpwnam_r() +getpwuid() +getpwuid_r() +gets() +getservbyname() +getservbyport() +getservent() +getutxent() +getutxid() +getutxline() +getwc() +getwchar() +getwd() [SUSv3 only (function removed in POSIX.1-2008)] +glob() +iconv_close() +iconv_open() +ioctl() +link() +linkat() [Added in POSIX.1-2008] +lio_listio() [Added in POSIX.1-2008] +localtime() +localtime_r() +lockf() [Added in POSIX.1-2008] +lseek() +lstat() +mkdir() [Added in POSIX.1-2008] +mkdirat() [Added in POSIX.1-2008] +mkdtemp() [Added in POSIX.1-2008] +mkfifo() [Added in POSIX.1-2008] +mkfifoat() [Added in POSIX.1-2008] +mknod() [Added in POSIX.1-2008] +mknodat() [Added in POSIX.1-2008] +mkstemp() +mktime() +nftw() +opendir() +openlog() +pathconf() +pclose() +perror() +popen() +posix_fadvise() +posix_fallocate() +posix_madvise() +posix_openpt() +posix_spawn() +posix_spawnp() +posix_trace_clear() +posix_trace_close() +posix_trace_create() +posix_trace_create_withlog() +posix_trace_eventtypelist_getnext_id() +posix_trace_eventtypelist_rewind() +posix_trace_flush() +posix_trace_get_attr() +posix_trace_get_filter() +posix_trace_get_status() +posix_trace_getnext_event() +posix_trace_open() +posix_trace_rewind() +posix_trace_set_filter() +posix_trace_shutdown() +posix_trace_timedgetnext_event() +posix_typed_mem_open() +printf() +psiginfo() [Added in POSIX.1-2008] +psignal() [Added in POSIX.1-2008] +pthread_rwlock_rdlock() +pthread_rwlock_timedrdlock() +pthread_rwlock_timedwrlock() +pthread_rwlock_wrlock() +putc() +putc_unlocked() +putchar() +putchar_unlocked() +puts() +pututxline() +putwc() +putwchar() +readdir() +readdir_r() +readlink() [Added in POSIX.1-2008] +readlinkat() [Added in POSIX.1-2008] +remove() +rename() +renameat() [Added in POSIX.1-2008] +rewind() +rewinddir() +scandir() [Added in POSIX.1-2008] +scanf() +seekdir() +semop() +setgrent() +sethostent() +setnetent() +setprotoent() +setpwent() +setservent() +setutxent() +sigpause() [Added in POSIX.1-2008] +stat() +strerror() +strerror_r() +strftime() +symlink() +symlinkat() [Added in POSIX.1-2008] +sync() +syslog() +tmpfile() +tmpnam() +ttyname() +ttyname_r() +tzset() +ungetc() +ungetwc() +unlink() +unlinkat() [Added in POSIX.1-2008] +utime() [Added in POSIX.1-2008] +utimensat() [Added in POSIX.1-2008] +utimes() [Added in POSIX.1-2008] +vdprintf() [Added in POSIX.1-2008] +vfprintf() +vfwprintf() +vprintf() +vwprintf() +wcsftime() +wordexp() +wprintf() +wscanf() +.fi +.in + +An implementation may also mark other functions +not specified in the standard as cancellation points. +In particular, an implementation is likely to mark +any nonstandard function that may block as a cancellation point. +(This includes most functions that can touch files.) +.\" So, scanning "cancellation point" comments in the glibc 2.8 header +.\" files, it looks as though at least the following nonstandard +.\" functions are cancellation points: +.\" endnetgrent +.\" endspent +.\" epoll_pwait +.\" epoll_wait +.\" fcloseall +.\" fdopendir +.\" fflush_unlocked +.\" fgetc_unlocked +.\" fgetgrent +.\" fgetgrent_r +.\" fgetpwent +.\" fgetpwent_r +.\" fgets_unlocked +.\" fgetspent +.\" fgetspent_r +.\" fgetwc_unlocked +.\" fgetws_unlocked +.\" fputc_unlocked +.\" fputs_unlocked +.\" fputwc_unlocked +.\" fputws_unlocked +.\" fread_unlocked +.\" fwrite_unlocked +.\" gai_suspend +.\" getaddrinfo_a +.\" getdate_r +.\" getgrent_r +.\" getgrouplist +.\" gethostbyaddr_r +.\" gethostbyname2 +.\" gethostbyname2_r +.\" gethostbyname_r +.\" gethostent_r +.\" getnetbyaddr_r +.\" getnetbyname_r +.\" getnetent_r +.\" getnetgrent +.\" getnetgrent_r +.\" getprotobyname_r +.\" getprotobynumber_r +.\" getprotoent_r +.\" getpw +.\" getpwent_r +.\" getservbyname_r +.\" getservbyport_r +.\" getservent_r +.\" getspent +.\" getspent_r +.\" getspnam +.\" getspnam_r +.\" getutmp +.\" getutmpx +.\" getw +.\" getwc_unlocked +.\" getwchar_unlocked +.\" initgroups +.\" innetgr +.\" mkostemp +.\" mkostemp64 +.\" mkstemp64 +.\" ppoll +.\" pthread_timedjoin_np +.\" putgrent +.\" putpwent +.\" putspent +.\" putw +.\" putwc_unlocked +.\" putwchar_unlocked +.\" rcmd +.\" rcmd_af +.\" rexec +.\" rexec_af +.\" rresvport +.\" rresvport_af +.\" ruserok +.\" ruserok_af +.\" setnetgrent +.\" setspent +.\" sgetspent +.\" sgetspent_r +.\" updwtmpx +.\" utmpxname +.\" vfscanf +.\" vfwscanf +.\" vscanf +.\" vsyslog +.\" vwscanf +.SS "Compiling on Linux" +On Linux, programs that use the Pthreads API should be compiled using +.IR "cc \-pthread" . +.SS "Linux Implementations of POSIX Threads" +Over time, two threading implementations have been provided by +the GNU C library on Linux: +.TP +.B LinuxThreads +This is the original Pthreads implementation. +Since glibc 2.4, this implementation is no longer supported. +.TP +.BR NPTL " (Native POSIX Threads Library)" +This is the modern Pthreads implementation. +By comparison with LinuxThreads, NPTL provides closer conformance to +the requirements of the POSIX.1 specification and better performance +when creating large numbers of threads. +NPTL is available since glibc 2.3.2, +and requires features that are present in the Linux 2.6 kernel. +.PP +Both of these are so-called 1:1 implementations, meaning that each +thread maps to a kernel scheduling entity. +Both threading implementations employ the Linux +.BR clone (2) +system call. +In NPTL, thread synchronization primitives (mutexes, +thread joining, etc.) are implemented using the Linux +.BR futex (2) +system call. +.SS LinuxThreads +The notable features of this implementation are the following: +.IP \- 3 +In addition to the main (initial) thread, +and the threads that the program creates using +.BR pthread_create (3), +the implementation creates a "manager" thread. +This thread handles thread creation and termination. +(Problems can result if this thread is inadvertently killed.) +.IP \- 3 +Signals are used internally by the implementation. +On Linux 2.2 and later, the first three real-time signals are used +(see also +.BR signal (7)). +On older Linux kernels, +.B SIGUSR1 +and +.B SIGUSR2 +are used. +Applications must avoid the use of whichever set of signals is +employed by the implementation. +.IP \- 3 +Threads do not share process IDs. +(In effect, LinuxThreads threads are implemented as processes which share +more information than usual, but which do not share a common process ID.) +LinuxThreads threads (including the manager thread) +are visible as separate processes using +.BR ps (1). +.PP +The LinuxThreads implementation deviates from the POSIX.1 +specification in a number of ways, including the following: +.IP \- 3 +Calls to +.BR getpid (2) +return a different value in each thread. +.IP \- 3 +Calls to +.BR getppid (2) +in threads other than the main thread return the process ID of the +manager thread; instead +.BR getppid (2) +in these threads should return the same value as +.BR getppid (2) +in the main thread. +.IP \- 3 +When one thread creates a new child process using +.BR fork (2), +any thread should be able to +.BR wait (2) +on the child. +However, the implementation only allows the thread that +created the child to +.BR wait (2) +on it. +.IP \- 3 +When a thread calls +.BR execve (2), +all other threads are terminated (as required by POSIX.1). +However, the resulting process has the same PID as the thread that called +.BR execve (2): +it should have the same PID as the main thread. +.IP \- 3 +Threads do not share user and group IDs. +This can cause complications with set-user-ID programs and +can cause failures in Pthreads functions if an application +changes its credentials using +.BR seteuid (2) +or similar. +.IP \- 3 +Threads do not share a common session ID and process group ID. +.IP \- 3 +Threads do not share record locks created using +.BR fcntl (2). +.IP \- 3 +The information returned by +.BR times (2) +and +.BR getrusage (2) +is per-thread rather than process-wide. +.IP \- 3 +Threads do not share semaphore undo values (see +.BR semop (2)). +.IP \- 3 +Threads do not share interval timers. +.IP \- 3 +Threads do not share a common nice value. +.IP \- 3 +POSIX.1 distinguishes the notions of signals that are directed +to the process as a whole and signals that are directed to individual +threads. +According to POSIX.1, a process-directed signal (sent using +.BR kill (2), +for example) should be handled by a single, +arbitrarily selected thread within the process. +LinuxThreads does not support the notion of process-directed signals: +signals may only be sent to specific threads. +.IP \- 3 +Threads have distinct alternate signal stack settings. +However, a new thread's alternate signal stack settings +are copied from the thread that created it, so that +the threads initially share an alternate signal stack. +(A new thread should start with no alternate signal stack defined. +If two threads handle signals on their shared alternate signal +stack at the same time, unpredictable program failures are +likely to occur.) +.SS NPTL +With NPTL, all of the threads in a process are placed +in the same thread group; +all members of a thread group share the same PID. +NPTL does not employ a manager thread. +NPTL makes internal use of the first two real-time signals +(see also +.BR signal (7)); +these signals cannot be used in applications. + +NPTL still has at least one nonconformance with POSIX.1: +.IP \- 3 +Threads do not share a common nice value. +.\" FIXME . bug report filed for NPTL nice nonconformance +.\" http://bugzilla.kernel.org/show_bug.cgi?id=6258 +.\" Sep 08: there is a patch by Denys Vlasenko to address this +.\" "make setpriority POSIX compliant; introduce PRIO_THREAD extension" +.\" Monitor this to see if it makes it into mainline. +.PP +Some NPTL nonconformances only occur with older kernels: +.IP \- 3 +The information returned by +.BR times (2) +and +.BR getrusage (2) +is per-thread rather than process-wide (fixed in kernel 2.6.9). +.IP \- 3 +Threads do not share resource limits (fixed in kernel 2.6.10). +.IP \- 3 +Threads do not share interval timers (fixed in kernel 2.6.12). +.IP \- 3 +Only the main thread is permitted to start a new session using +.BR setsid (2) +(fixed in kernel 2.6.16). +.IP \- 3 +Only the main thread is permitted to make the process into a +process group leader using +.BR setpgid (2) +(fixed in kernel 2.6.16). +.IP \- 3 +Threads have distinct alternate signal stack settings. +However, a new thread's alternate signal stack settings +are copied from the thread that created it, so that +the threads initially share an alternate signal stack +(fixed in kernel 2.6.16). +.PP +Note the following further points about the NPTL implementation: +.IP \- 3 +If the stack size soft resource limit (see the description of +.B RLIMIT_STACK +in +.BR setrlimit (2)) +is set to a value other than +.IR unlimited , +then this value defines the default stack size for new threads. +To be effective, this limit must be set before the program +is executed, perhaps using the +.I ulimit -s +shell built-in command +.RI ( "limit stacksize" +in the C shell). +.SS "Determining the Threading Implementation" +Since glibc 2.3.2, the +.BR getconf (1) +command can be used to determine +the system's threading implementation, for example: +.nf +.in +4n + +bash$ getconf GNU_LIBPTHREAD_VERSION +NPTL 2.3.4 +.in +.fi +.PP +With older glibc versions, a command such as the following should +be sufficient to determine the default threading implementation: +.nf +.in +4n + +bash$ $( ldd /bin/ls | grep libc.so | awk \(aq{print $3}\(aq ) | \\ + egrep \-i \(aqthreads|nptl\(aq + Native POSIX Threads Library by Ulrich Drepper et al +.in +.fi +.SS "Selecting the Threading Implementation: LD_ASSUME_KERNEL" +On systems with a glibc that supports both LinuxThreads and NPTL +(i.e., glibc 2.3.\fIx\fP), the +.B LD_ASSUME_KERNEL +environment variable can be used to override +the dynamic linker's default choice of threading implementation. +This variable tells the dynamic linker to assume that it is +running on top of a particular kernel version. +By specifying a kernel version that does not +provide the support required by NPTL, we can force the use +of LinuxThreads. +(The most likely reason for doing this is to run a +(broken) application that depends on some nonconformant behavior +in LinuxThreads.) +For example: +.nf +.in +4n + +bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\ + awk \(aq{print $3}\(aq ) | egrep \-i \(aqthreads|ntpl\(aq + linuxthreads-0.10 by Xavier Leroy +.in +.fi +.SH "SEE ALSO" +.BR clone (2), +.BR futex (2), +.BR gettid (2), +.BR proc (5), +.BR futex (7), +.BR signal (7), +.br +and various Pthreads manual pages, for example: +.BR pthread_attr_init (3), +.BR pthread_atfork (3), +.BR pthread_cancel (3), +.BR pthread_cleanup_push (3), +.BR pthread_cond_signal (3), +.BR pthread_cond_wait (3), +.BR pthread_create (3), +.BR pthread_detach (3), +.BR pthread_equal (3), +.BR pthread_exit (3), +.BR pthread_key_create (3), +.BR pthread_kill (3), +.BR pthread_mutex_lock (3), +.BR pthread_mutex_unlock (3), +.BR pthread_once (3), +.BR pthread_setcancelstate (3), +.BR pthread_setcanceltype (3), +.BR pthread_setspecific (3), +.BR pthread_sigmask (3), +and +.BR pthread_testcancel (3) diff --git a/original/man7/pty.7 b/original/man7/pty.7 new file mode 100644 index 00000000..c131cd4e --- /dev/null +++ b/original/man7/pty.7 @@ -0,0 +1,159 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2005 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. +.\" +.TH PTY 7 2005-10-10 "Linux" "Linux Programmer's Manual" +.SH NAME +pty \- pseudo-terminal interfaces +.SH DESCRIPTION +A pseudo-terminal is a pair of virtual character devices that +provide a bidirectional communication channel. +One end of the channel is called the +.IR master ; +the other end is called the +.IR slave . +The slave end of the pseudo-terminal provides an interface +that behaves exactly like a classical terminal. +A process that expects to be connected to a terminal, +can open the slave end of a pseudo-terminal and +then be driven by a program that has opened the master end. +Anything that is written on the master end is provided to the process +on the slave end as though it was input typed on a terminal. +For example, writing the interrupt character (usually control-C) +to the master device would cause an interrupt signal +.RB ( SIGINT ) +to be generated for the foreground process group +that is connected to the slave. +Conversely, anything that is written to the slave end of the +pseudo-terminal can be read by the process that is connected to +the master end. +Pseudo-terminals are used by applications such as network login services +.RB ( ssh "(1), " rlogin "(1), " telnet (1)), +terminal emulators, +.BR script (1), +.BR screen (1), +and +.BR expect (1). + +Historically, two pseudo-terminal APIs have evolved: BSD and System V. +SUSv1 standardized a pseudo-terminal API based on the System V API, +and this API should be employed in all new programs that use +pseudo-terminals. + +Linux provides both BSD-style and (standardized) System V-style +pseudo-terminals. +System V-style terminals are commonly called Unix 98 pseudo-terminals +on Linux systems. +Since kernel 2.6.4, BSD-style pseudo-terminals are considered deprecated +(they can be disabled when configuring the kernel); +Unix 98 pseudo-terminals should be used in new applications. +.SS "Unix 98 pseudo-terminals" +An unused Unix 98 pseudo-terminal master is opened by calling +.BR posix_openpt (3). +(This function opens the master clone device, +.IR /dev/ptmx ; +see +.BR pts (4).) +After performing any program-specific initializations, +changing the ownership and permissions of the slave device using +.BR grantpt (3), +and unlocking the slave using +.BR unlockpt (3)), +the corresponding slave device can be opened by passing +the name returned by +.BR ptsname (3) +in a call to +.BR open (2). + +The Linux kernel imposes a limit on the number of available +Unix 98 pseudo-terminals. +In kernels up to and including 2.6.3, this limit is configured +at kernel compilation time +.RB ( CONFIG_UNIX98_PTYS ), +and the permitted number of pseudo-terminals can be up to 2048, +with a default setting of 256. +Since kernel 2.6.4, the limit is dynamically adjustable via +.IR /proc/sys/kernel/pty/max , +and a corresponding file, +.IR /proc/sys/kernel/pty/nr , +indicates how many pseudo-terminals are currently in use. +For further details on these two files, see +.BR proc (5). +.SS "BSD pseudo-terminals" +BSD-style pseudo-terminals are provided as precreated pairs, with +names of the form +.I /dev/ptyXY +(master) and +.I /dev/ttyXY +(slave), +where X is a letter from the 16-character set [p-za-e], +and Y is a letter from the 16-character set [0-9a-f]. +(The precise range of letters in these two sets varies across Unix +implementations.) +For example, +.I /dev/ptyp1 +and +.I /dev/ttyp1 +constitute a BSD pseudo-terminal pair. +A process finds an unused pseudo-terminal pair by trying to +.BR open (2) +each pseudo-terminal master until an open succeeds. +The corresponding pseudo-terminal slave (substitute "tty" +for "pty" in the name of the master) can then be opened. +.SH "FILES" +.I /dev/ptmx +(Unix 98 master clone device) +.br +.I /dev/pts/* +(Unix 98 slave devices) +.br +.I /dev/pty[p-za-e][0-9a-f] +(BSD master devices) +.br +.I /dev/tty[p-za-e][0-9a-f] +(BSD slave devices) +.SH "NOTES" +A description of the +.B TIOCPKT +.BR ioctl (2), +which controls packet mode operation, can be found in +.BR tty_ioctl (4). + +The BSD +.BR ioctl (2) +operations +.BR TIOCSTOP , +.BR TIOCSTART , +.BR TIOCUCNTL , +and +.BR TIOCREMOTE +have not been implemented under Linux. +.SH "SEE ALSO" +.BR select (2), +.BR setsid (2), +.BR forkpty (3), +.BR openpty (3), +.BR termios (3), +.BR pts (4), +.BR tty (4), +.BR tty_ioctl (4) diff --git a/original/man7/raw.7 b/original/man7/raw.7 new file mode 100644 index 00000000..bead0f28 --- /dev/null +++ b/original/man7/raw.7 @@ -0,0 +1,278 @@ +'\" t +.\" Don't change the first line, it tells man that we need tbl. +.\" This man page is Copyright (C) 1999 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. +.\" $Id: raw.7,v 1.6 1999/06/05 10:32:08 freitag Exp $ +.TH RAW 7 2008-11-20 "Linux" "Linux Programmer's Manual" +.SH NAME +raw, SOCK_RAW \- Linux IPv4 raw sockets +.SH SYNOPSIS +.B #include +.br +.B #include +.br +.BI "raw_socket = socket(AF_INET, SOCK_RAW, int " protocol ); +.SH DESCRIPTION +Raw sockets allow new IPv4 protocols to be implemented in user space. +A raw socket receives or sends the raw datagram not +including link level headers. + +The IPv4 layer generates an IP header when sending a packet unless the +.B IP_HDRINCL +socket option is enabled on the socket. +When it is enabled, the packet must contain an IP header. +For receiving the IP header is always included in the packet. + +Only processes with an effective user ID of 0 or the +.B CAP_NET_RAW +capability are allowed to open raw sockets. + +All packets or errors matching the +.I protocol +number specified +for the raw socket are passed to this socket. +For a list of the allowed protocols see RFC\ 1700 assigned numbers and +.BR getprotobyname (3). + +A protocol of +.B IPPROTO_RAW +implies enabled +.B IP_HDRINCL +and is able to send any IP protocol that is specified in the passed +header. +Receiving of all IP protocols via +.B IPPROTO_RAW +is not possible using raw sockets. +.RS +.TS +tab(:) allbox; +c s +l l. +IP Header fields modified on sending by \fBIP_HDRINCL\fP +IP Checksum:Always filled in. +Source Address:Filled in when zero. +Packet Id:Filled in when zero. +Total Length:Always filled in. +.TE +.RE +.sp +.PP +If +.B IP_HDRINCL +is specified and the IP header has a nonzero destination address then +the destination address of the socket is used to route the packet. +When +.B MSG_DONTROUTE +is specified, the destination address should refer to a local interface, +otherwise a routing table lookup is done anyway but gatewayed routes +are ignored. + +If +.B IP_HDRINCL +isn't set, then IP header options can be set on raw sockets with +.BR setsockopt (2); +see +.BR ip (7) +for more information. + +In Linux 2.2, all IP header fields and options can be set using +IP socket options. +This means raw sockets are usually only needed for new +protocols or protocols with no user interface (like ICMP). + +When a packet is received, it is passed to any raw sockets which have +been bound to its protocol before it is passed to other protocol handlers +(e.g., kernel protocol modules). +.SS Address Format +Raw sockets use the standard +.I sockaddr_in +address structure defined in +.BR ip (7). +The +.I sin_port +field could be used to specify the IP protocol number, +but it is ignored for sending in Linux 2.2 and should be always +set to 0 (see BUGS). +For incoming packets, +.I sin_port +is set to the protocol of the packet. +See the +.I +include file for valid IP protocols. +.SS Socket Options +Raw socket options can be set with +.BR setsockopt (2) +and read with +.BR getsockopt (2) +by passing the +.B IPPROTO_RAW +.\" Or SOL_RAW on Linux +family flag. +.TP +.B ICMP_FILTER +Enable a special filter for raw sockets bound to the +.B IPPROTO_ICMP +protocol. +The value has a bit set for each ICMP message type which +should be filtered out. +The default is to filter no ICMP messages. +.PP +In addition, all +.BR ip (7) +.B IPPROTO_IP +socket options valid for datagram sockets are supported. +.SS Error Handling +Errors originating from the network are only passed to the user when the +socket is connected or the +.B IP_RECVERR +flag is enabled. +For connected sockets, only +.B EMSGSIZE +and +.B EPROTO +are passed for compatibility. +With +.BR IP_RECVERR , +all network errors are saved in the error queue. +.SH ERRORS +.TP +.B EACCES +User tried to send to a broadcast address without having the +broadcast flag set on the socket. +.TP +.B EFAULT +An invalid memory address was supplied. +.TP +.B EINVAL +Invalid argument. +.TP +.B EMSGSIZE +Packet too big. +Either Path MTU Discovery is enabled (the +.B IP_MTU_DISCOVER +socket flag) or the packet size exceeds the maximum allowed IPv4 +packet size of 64KB. +.TP +.B EOPNOTSUPP +Invalid flag has been passed to a socket call (like +.BR MSG_OOB ). +.TP +.B EPERM +The user doesn't have permission to open raw sockets. +Only processes with an effective user ID of 0 or the +.B CAP_NET_RAW +attribute may do that. +.TP +.B EPROTO +An ICMP error has arrived reporting a parameter problem. +.SH VERSIONS +.B IP_RECVERR +and +.B ICMP_FILTER +are new in Linux 2.2. +They are Linux extensions and should not be used in portable programs. + +Linux 2.0 enabled some bug-to-bug compatibility with BSD in the +raw socket code when the +.B SO_BSDCOMPAT +socket option was set \(em since Linux 2.2, +this option no longer has that effect. +.SH NOTES +By default, raw sockets do path MTU (Maximum Transmission Unit) discovery. +This means the kernel +will keep track of the MTU to a specific target IP address and return +.B EMSGSIZE +when a raw packet write exceeds it. +When this happens, the application should decrease the packet size. +Path MTU discovery can be also turned off using the +.B IP_MTU_DISCOVER +socket option or the +.I /proc/sys/net/ipv4/ip_no_pmtu_disc +file, see +.BR ip (7) +for details. +When turned off, raw sockets will fragment outgoing packets +that exceed the interface MTU. +However, disabling it is not recommended +for performance and reliability reasons. + +A raw socket can be bound to a specific local address using the +.BR bind (2) +call. +If it isn't bound, all packets with the specified IP protocol are received. +In addition, a RAW socket can be bound to a specific network device using +.BR SO_BINDTODEVICE ; +see +.BR socket (7). + +An +.B IPPROTO_RAW +socket is send only. +If you really want to receive all IP packets, use a +.BR packet (7) +socket with the +.B ETH_P_IP +protocol. +Note that packet sockets don't reassemble IP fragments, +unlike raw sockets. + +If you want to receive all ICMP packets for a datagram socket, +it is often better to use +.B IP_RECVERR +on that particular socket; see +.BR ip (7). + +Raw sockets may tap all IP protocols in Linux, even +protocols like ICMP or TCP which have a protocol module in the kernel. +In this case, the packets are passed to both the kernel module and the raw +socket(s). +This should not be relied upon in portable programs, many other BSD +socket implementation have limitations here. + +Linux never changes headers passed from the user (except for filling +in some zeroed fields as described for +.BR IP_HDRINCL ). +This differs from many other implementations of raw sockets. + +RAW sockets are generally rather unportable and should be avoided in +programs intended to be portable. + +Sending on raw sockets should take the IP protocol from +.IR sin_port ; +this ability was lost in Linux 2.2. +The workaround is to use +.BR IP_HDRINCL . +.SH BUGS +Transparent proxy extensions are not described. + +When the +.B IP_HDRINCL +option is set, datagrams will not be fragmented and are limited to +the interface MTU. + +Setting the IP protocol for sending in +.I sin_port +got lost in Linux 2.2. +The protocol that the socket was bound to or that +was specified in the initial +.BR socket (2) +call is always used. +.\" .SH AUTHORS +.\" This man page was written by Andi Kleen. +.SH "SEE ALSO" +.BR recvmsg (2), +.BR sendmsg (2), +.BR capabilities (7), +.BR ip (7), +.BR socket (7) + +.B RFC\ 1191 +for path MTU discovery. + +.B RFC\ 791 +and the +.I +include file for the IP protocol. diff --git a/original/man7/regex.7 b/original/man7/regex.7 new file mode 100644 index 00000000..c9355717 --- /dev/null +++ b/original/man7/regex.7 @@ -0,0 +1,288 @@ +.\" From Henry Spencer's regex package (as found in the apache +.\" distribution). The package carries the following copyright: +.\" +.\" Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. +.\" This software is not subject to any license of the American Telephone +.\" and Telegraph Company or of the Regents of the University of California. +.\" +.\" Permission is granted to anyone to use this software for any purpose +.\" on any computer system, and to alter it and redistribute it, subject +.\" to the following restrictions: +.\" +.\" 1. The author is not responsible for the consequences of use of this +.\" software, no matter how awful, even if they arise from flaws in it. +.\" +.\" 2. The origin of this software must not be misrepresented, either by +.\" explicit claim or by omission. Since few users ever read sources, +.\" credits must appear in the documentation. +.\" +.\" 3. Altered versions must be plainly marked as such, and must not be +.\" misrepresented as being the original software. Since few users +.\" ever read sources, credits must appear in the documentation. +.\" +.\" 4. This notice may not be removed or altered. +.\" +.\" In order to comply with `credits must appear in the documentation' +.\" I added an AUTHOR paragraph below - aeb. +.\" +.\" In the default nroff environment there is no dagger \(dg. +.\" +.\" 2005-05-11 Removed discussion of `[[:<:]]' and `[[:>:]]', which +.\" appear not to be in the glibc implementation of regcomp +.\" +.ie t .ds dg \(dg +.el .ds dg (!) +.TH REGEX 7 2009-01-12 "" "Linux Programmer's Manual" +.SH NAME +regex \- POSIX.2 regular expressions +.SH DESCRIPTION +Regular expressions ("RE"s), +as defined in POSIX.2, come in two forms: +modern REs (roughly those of +.IR egrep ; +POSIX.2 calls these "extended" REs) +and obsolete REs (roughly those of +.BR ed (1); +POSIX.2 "basic" REs). +Obsolete REs mostly exist for backward compatibility in some old programs; +they will be discussed at the end. +POSIX.2 leaves some aspects of RE syntax and semantics open; +"\*(dg" marks decisions on these aspects that +may not be fully portable to other POSIX.2 implementations. +.PP +A (modern) RE is one\*(dg or more nonempty\*(dg \fIbranches\fR, +separated by \(aq|\(aq. +It matches anything that matches one of the branches. +.PP +A branch is one\*(dg or more \fIpieces\fR, concatenated. +It matches a match for the first, followed by a match for the second, etc. +.PP +A piece is an \fIatom\fR possibly followed +by a single\*(dg \(aq*\(aq, \(aq+\(aq, \(aq?\(aq, or \fIbound\fR. +An atom followed by \(aq*\(aq +matches a sequence of 0 or more matches of the atom. +An atom followed by \(aq+\(aq +matches a sequence of 1 or more matches of the atom. +An atom followed by \(aq?\(aq +matches a sequence of 0 or 1 matches of the atom. +.PP +A \fIbound\fR is \(aq{\(aq followed by an unsigned decimal integer, +possibly followed by \(aq,\(aq +possibly followed by another unsigned decimal integer, +always followed by \(aq}\(aq. +The integers must lie between 0 and +.B RE_DUP_MAX +(255\*(dg) inclusive, +and if there are two of them, the first may not exceed the second. +An atom followed by a bound containing one integer \fIi\fR +and no comma matches +a sequence of exactly \fIi\fR matches of the atom. +An atom followed by a bound +containing one integer \fIi\fR and a comma matches +a sequence of \fIi\fR or more matches of the atom. +An atom followed by a bound +containing two integers \fIi\fR and \fIj\fR matches +a sequence of \fIi\fR through \fIj\fR (inclusive) matches of the atom. +.PP +An atom is a regular expression enclosed in "\fI()\fP" +(matching a match for the regular expression), +an empty set of "\fI()\fP" (matching the null string)\*(dg, +a \fIbracket expression\fR (see below), \(aq.\(aq +(matching any single character), \(aq^\(aq (matching the null string at the +beginning of a line), \(aq$\(aq (matching the null string at the +end of a line), a \(aq\e\(aq followed by one of the characters +"\fI^.[$()|*+?{\e\fP" +(matching that character taken as an ordinary character), +a \(aq\e\(aq followed by any other character\*(dg +(matching that character taken as an ordinary character, +as if the \(aq\e\(aq had not been present\*(dg), +or a single character with no other significance (matching that character). +A \(aq{\(aq followed by a character other than a digit is an ordinary +character, not the beginning of a bound\*(dg. +It is illegal to end an RE with \(aq\e\(aq. +.PP +A \fIbracket expression\fR is a list of characters enclosed in "\fI[]\fP". +It normally matches any single character from the list (but see below). +If the list begins with \(aq^\(aq, +it matches any single character +(but see below) \fInot\fR from the rest of the list. +If two characters in the list are separated by \(aq\-\(aq, this is shorthand +for the full \fIrange\fR of characters between those two (inclusive) in the +collating sequence, +for example, "\fI[0\-9]\fP" in ASCII matches any decimal digit. +It is illegal\*(dg for two ranges to share an +endpoint, for example, "\fIa-c-e\fP". +Ranges are very collating-sequence-dependent, +and portable programs should avoid relying on them. +.PP +To include a literal \(aq]\(aq in the list, make it the first character +(following a possible \(aq^\(aq). +To include a literal \(aq\-\(aq, make it the first or last character, +or the second endpoint of a range. +To use a literal \(aq\-\(aq as the first endpoint of a range, +enclose it in "\fI[.\fP" and "\fI.]\fP" +to make it a collating element (see below). +With the exception of these and some combinations using \(aq[\(aq (see next +paragraphs), all other special characters, including \(aq\e\(aq, lose their +special significance within a bracket expression. +.PP +Within a bracket expression, a collating element (a character, +a multicharacter sequence that collates as if it were a single character, +or a collating-sequence name for either) +enclosed in "\fI[.\fP" and "\fI.]\fP" stands for the +sequence of characters of that collating element. +The sequence is a single element of the bracket expression's list. +A bracket expression containing a multicharacter collating element +can thus match more than one character, +for example, if the collating sequence includes a "ch" collating element, +then the RE "\fI[[.ch.]]*c\fP" matches the first five characters +of "chchcc". +.PP +Within a bracket expression, a collating element enclosed in "\fI[=\fP" and +"\fI=]\fP" is an equivalence class, standing for the sequences of characters +of all collating elements equivalent to that one, including itself. +(If there are no other equivalent collating elements, +the treatment is as if the enclosing delimiters +were "\fI[.\fP" and "\fI.]\fP".) +For example, if o and \o'o^' are the members of an equivalence class, +then "\fI[[=o=]]\fP", "\fI[[=\o'o^'=]]\fP", +and "\fI[o\o'o^']\fP" are all synonymous. +An equivalence class may not\*(dg be an endpoint +of a range. +.PP +Within a bracket expression, the name of a \fIcharacter class\fR enclosed +in "\fI[:\fP" and "\fI:]\fP" stands for the list +of all characters belonging to that +class. +Standard character class names are: +.PP +.RS +.nf +.ta 3c 6c 9c +alnum digit punct +alpha graph space +blank lower upper +cntrl print xdigit +.fi +.RE +.PP +These stand for the character classes defined in +.BR wctype (3). +A locale may provide others. +A character class may not be used as an endpoint of a range. +.\" As per http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295666 +.\" The following does not seem to apply in the glibc implementation +.\" .PP +.\" There are two special cases\*(dg of bracket expressions: +.\" the bracket expressions "\fI[[:<:]]\fP" and "\fI[[:>:]]\fP" match +.\" the null string at the beginning and end of a word respectively. +.\" A word is defined as a sequence of +.\" word characters +.\" which is neither preceded nor followed by +.\" word characters. +.\" A word character is an +.\" .I alnum +.\" character (as defined by +.\" .BR wctype (3)) +.\" or an underscore. +.\" This is an extension, +.\" compatible with but not specified by POSIX.2, +.\" and should be used with +.\" caution in software intended to be portable to other systems. +.PP +In the event that an RE could match more than one substring of a given +string, +the RE matches the one starting earliest in the string. +If the RE could match more than one substring starting at that point, +it matches the longest. +Subexpressions also match the longest possible substrings, subject to +the constraint that the whole match be as long as possible, +with subexpressions starting earlier in the RE taking priority over +ones starting later. +Note that higher-level subexpressions thus take priority over +their lower-level component subexpressions. +.PP +Match lengths are measured in characters, not collating elements. +A null string is considered longer than no match at all. +For example, +"\fIbb*\fP" matches the three middle characters of "abbbc", +"\fI(wee|week)(knights|nights)\fP" +matches all ten characters of "weeknights", +when "\fI(.*).*\fP" is matched against "abc" the parenthesized subexpression +matches all three characters, and +when "\fI(a*)*\fP" is matched against "bc" +both the whole RE and the parenthesized +subexpression match the null string. +.PP +If case-independent matching is specified, +the effect is much as if all case distinctions had vanished from the +alphabet. +When an alphabetic that exists in multiple cases appears as an +ordinary character outside a bracket expression, it is effectively +transformed into a bracket expression containing both cases, +for example, \(aqx\(aq becomes "\fI[xX]\fP". +When it appears inside a bracket expression, all case counterparts +of it are added to the bracket expression, so that, for example, "\fI[x]\fP" +becomes "\fI[xX]\fP" and "\fI[^x]\fP" becomes "\fI[^xX]\fP". +.PP +No particular limit is imposed on the length of REs\*(dg. +Programs intended to be portable should not employ REs longer +than 256 bytes, +as an implementation can refuse to accept such REs and remain +POSIX-compliant. +.PP +Obsolete ("basic") regular expressions differ in several respects. +\(aq|\(aq, \(aq+\(aq, and \(aq?\(aq are +ordinary characters and there is no equivalent +for their functionality. +The delimiters for bounds are "\fI\e{\fP" and "\fI\e}\fP", +with \(aq{\(aq and \(aq}\(aq by themselves ordinary characters. +The parentheses for nested subexpressions are "\fI\e(\fP" and "\fI\e)\fP", +with \(aq(\(aq and \(aq)\(aq by themselves ordinary characters. +\(aq^\(aq is an ordinary character except at the beginning of the +RE or\*(dg the beginning of a parenthesized subexpression, +\(aq$\(aq is an ordinary character except at the end of the +RE or\*(dg the end of a parenthesized subexpression, +and \(aq*\(aq is an ordinary character if it appears at the beginning of the +RE or the beginning of a parenthesized subexpression +(after a possible leading \(aq^\(aq). +.PP +Finally, there is one new type of atom, a \fIback reference\fR: +\(aq\e\(aq followed by a nonzero decimal digit \fId\fR +matches the same sequence of characters +matched by the \fId\fRth parenthesized subexpression +(numbering subexpressions by the positions of their opening parentheses, +left to right), +so that, for example, "\fI\e([bc]\e)\e1\fP" matches "bb" or "cc" but not "bc". +.SH BUGS +Having two kinds of REs is a botch. +.PP +The current POSIX.2 spec says that \(aq)\(aq is an ordinary character in +the absence of an unmatched \(aq(\(aq; +this was an unintentional result of a wording error, +and change is likely. +Avoid relying on it. +.PP +Back references are a dreadful botch, +posing major problems for efficient implementations. +They are also somewhat vaguely defined +(does +"\fIa\e(\e(b\e)*\e2\e)*d\fP" match "abbbd"?). +Avoid using them. +.PP +POSIX.2's specification of case-independent matching is vague. +The "one case implies all cases" definition given above +is current consensus among implementors as to the right interpretation. +.\" As per http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295666 +.\" The following does not seem to apply in the glibc implementation +.\" .PP +.\" The syntax for word boundaries is incredibly ugly. +.SH AUTHOR +.\" Sigh... The page license means we must have the author's name +.\" in the formatted output. +This page was taken from Henry Spencer's regex package. +.SH "SEE ALSO" +.BR grep (1), +.BR regex (3) +.PP +POSIX.2, section 2.8 (Regular Expression Notation). diff --git a/original/man7/rtld-audit.7 b/original/man7/rtld-audit.7 new file mode 100644 index 00000000..358de00d --- /dev/null +++ b/original/man7/rtld-audit.7 @@ -0,0 +1,604 @@ +.\" 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. +.\" +.\" 2009-01-12, mtk, Created +.\" +.TH RTLD-AUDIT 7 2009-03-30 "Linux" "Linux Programmer's Manual" +.SH NAME +rtld-audit \- auditing API for the dynamic linker +.SH SYNOPSIS +.B #define _GNU_SOURCE + +.B #include +.SH DESCRIPTION +The GNU dynamic linker (run-time linker) +provides an auditing API that allows an application +to be notified when various dynamic linking events occur. +This API is very similar to the auditing interface provided by the +Solaris run-time linker. +The necessary constants and prototypes are defined by including +.IR . + +To use this interface, the programmer creates a shared library +that implements a standard set of function names. +Not all of the functions need to be implemented: in most cases, +if the programmer is not interested in a particular class of auditing event, +then no implementation needs to be provided for the corresponding +auditing function. + +To employ the auditing interface, the environment variable +.BR LD_AUDIT +must be defined to contain a colon-separated list of shared libraries, +each of which can implement (parts of) the auditing API. +When an auditable event occurs, +the corresponding function is invoked in each library, +in the order that the libraries are listed. +.SS la_version() +\& +.nf +.BI "unsigned int la_version(unsigned int " version ); +.fi +.PP +This is the only function that +.I must +be defined by an auditing library: +it performs the initial handshake between the dynamic linker and +the auditing library. +When invoking this function, the dynamic linker passes, in +.IR version , +the highest version of the auditing interface that the linker supports. +If necessary, the auditing library can check that this version +is sufficient for its requirements. + +As its function result, +this function should return the version of the auditing interface +that this auditing library expects to use (returning +.I version +is acceptable). +If the returned value is 0, +or a version that is greater than that supported by the dynamic linker, +then the audit library is ignored. +.SS la_objsearch() +\& +.nf +.BI "char *la_objsearch(const char *" name ", uintptr_t *" cookie , +.BI " unsigned int " flag ); +.fi +.PP +The dynamic linker invokes this function to inform the auditing library +that it is about to search for a shared object. +The +.I name +argument is the filename or pathname that is to be searched for. +.I cookie +identifies the shared object that initiated the search. +.I flag +is set to one of the following values: +.TP 17 +.B LA_SER_ORIG +This is the original name that is being searched for. +Typically, this name comes from an ELF +.B DT_NEEDED +entry, or is the +.I filename +argument given to +.BR dlopen (3). +.TP +.B LA_SER_LIBPATH +.I name +was created using a directory specified in +.BR LD_LIBRARY_PATH . +.TP +.B LA_SER_RUNPATH +.I name +was created using a directory specified in an ELF +.B DT_RPATH +or +.B DT_RUNPATH +list. +.TP +.B LA_SER_CONFIG +.I name +was found via the +.BR ldconfig (8) +cache +.RI ( /etc/ld.so.cache ). +.TP +.B LA_SER_DEFAULT +.I name +was found via a search of one of the default directories. +.TP +.B LA_SER_SECURE +.I name +is specific to a secure object (unused on Linux). +.PP +As its function result, +.BR la_objsearch () +returns the pathname that the dynamic linker should use +for further processing. +If NULL is returned, then this pathname is ignored for further processing. +If this audit library simply intends to monitor search paths, then +.I name +should be returned. +.SS la_activity() +\& +.nf +.BI "void la_activity( uintptr_t *" cookie ", unsigned int "flag ); +.fi +.PP +The dynamic linker calls this function to inform the auditing library +that link-map activity is occurring. +.I cookie +identifies the object at the head of the link map. +When the dynamic linker invokes this function, +.I flag +is set to one of the following values: +.TP 19 +.B LA_ACT_ADD +New objects are being added to the link map. +.TP +.B LA_ACT_DELETE +Objects are being removed from the link map. +.TP +.B LA_ACT_CONSISTENT +Link-map activity has been completed: the map is once again consistent. +.SS la_objopen() +\& +.nf +.BI "unsigned int la_objopen(struct link_map *" map ", Lmid_t " lmid , +.BI " uintptr_t *" cookie ); +.fi +.PP +The dynamic linker calls this function when a new shared object is loaded. +The +.I map +argument is a pointer to a link-map structure that describes the object. +The +.I lmid +field has one of the following values +.TP 17 +.B LM_ID_BASE +Link map is part of the initial namespace. +.TP +.B LM_ID_NEWLM +Link map is part of a new namespace requested via +.BR dlmopen (3). +.PP +.I cookie +is a pointer to an identifier for this object. +The identifier is provided to later calls to functions +in the auditing library in order to identify this object. +This identifier is initialized to point to object's link map, +but the audit library can change the identifier to some other value +that it may prefer to use to identify the object. +.PP +As its return value, +.BR la_objopen () +returns a bit mask created by ORing zero or more of the +following constants, +which allow the auditing library to select the objects to be monitored by +.BR la_symbind* (): +.TP 17 +.B LA_FLG_BINDTO +Audit symbol bindings to this object. +.TP +.B LA_FLG_BINDFROM +Audit symbol bindings from this object. +.PP +A return value of 0 from +.BR la_objopen () +indicates that no symbol bindings should be audited for this object. +.SS la_objclose() +\& +.nf +.BI "unsigned int la_objclose(uintptr_t *" cookie); +.fi +.PP +The dynamic linker invokes this function after any finalization +code for the object has been executed, +before the object is unloaded. +The +.I cookie +argument is the identifier obtained from a previous invocation of +.BR la_objopen (). + +In the current implementation, the value returned by +.BR la_objclose () +is ignored. +.SS la_preinit() +\& +.nf +.BI "void la_preinit(uintptr_t *" cookie ); +.fi +.PP +The dynamic linker invokes this function after all shared objects +have been loaded, before control is passed to the application +(i.e., before calling +.IR main ()). +Note that +.IR main () +may still later dynamically load objects using +.BR dlopen (3). +.SS la_symbind*() +\& +.nf +.BI "uintptr_t la_symbind32(Elf32_Sym *" sym ", unsigned int " ndx , +.BI " uintptr_t *" refcook ", uintptr_t *" defcook , +.BI " unsigned int *" flags ", const char *" symname ); +.BI "uintptr_t la_symbind64(Elf64_Sym *" sym ", unsigned int " ndx , +.BI " uintptr_t *" refcook ", uintptr_t *" defcook , +.BI " unsigned int *" flags ", const char *" symname ); +.fi +.PP +The dynamic linker invokes one of these functions +when a symbol binding occurs between two shared objects +that have been marked for auditing notification by +.BR la_objopen (). +The +.BR la_symbind32 () +function is employed on 32-bit platforms; +the +.BR la_symbind64 () +function is employed on 64-bit platforms. + +The +.I sym +argument is a pointer to a structure +that provides information about the symbol being bound. +The structure definition is shown in +.IR . +Among the fields of this structure, +.I st_value +indicates the address to which the symbol is bound. + +The +.I ndx +argument gives the index of the symbol in the symbol table +of the bound shared object. + +The +.I refcook +argument identifies the shared object that is making the symbol reference; +this is the same identifier that is provided to the +.BR la_objopen () +function that returned +.BR LA_FLG_BINDFROM . +The +.I defcook +argument identifies the shared object that defines the referenced symbol; +this is the same identifier that is provided to the +.BR la_objopen () +function that returned +.BR LA_FLG_BINDTO . + +The +.I symname +argument points a string containing the name of the symbol. + +The +.I flags +argument is a bit mask that both provides information about the symbol +and can be used to modify further auditing of this +PLT (Procedure Linkage Table) entry. +The dynamic linker may supply the following bit values in this argument: +.\" LA_SYMB_STRUCTCALL appears to be unused +.TP 22 +.B LA_SYMB_DLSYM +The binding resulted from a call to +.BR dlsym (3). +.TP +.B LA_SYMB_ALTVALUE +A previous +.BR la_symbind* () +call returned an alternate value for this symbol. +.PP +By default, if the auditing library implements +.BR la_pltenter () +and +.BR la_pltexit () +functions (see below), then these functions are invoked, after +.BR la_symbind (), +for PLT entries, each time the symbol is referenced. +.\" pltenter/pltexit are called for non-dynamically loaded libraries, +.\" but don't seem to be called for dynamically loaded libs? +.\" Is this the same on Solaris? +The following flags can be ORed into +.IR *flags +to change this default behavior: +.TP 22 +.B LA_SYMB_NOPLTENTER +Don't call +.BR la_pltenter () +for this symbol. +.TP 22 +.B LA_SYMB_NOPLTEXIT +Don't call +.BR la_pltexit () +for this symbol. +.PP +The return value of +.BR la_symbind32 () +and +.BR la_symbind64 () +is the address to which control should be passed after the function returns. +If the auditing library is simply monitoring symbol bindings, +then it should return +.IR sym\->st_name . +A different value may be returned if the library wishes to direct control +to an alternate location. +.SS la_pltenter() +The precise name and argument types for this function +depend on the hardware platform. +(The appropriate definition is supplied by +.IR .) +Here is the definition for x86-32: +.nf + +.BI "Elf32_Addr la_i86_gnu_pltenter(Elf32_Sym *" sym ", unsigned int " ndx , +.BI " uintptr_t *" refcook ", uintptr_t *" defcook , +.BI " La_i86_regs *" regs ", unsigned int *" flags , +.BI " const char *" symname ", long int *" framesizep ); +.fi + +This function is invoked just before a PLT entry is called, +between two shared objects that have been marked for binding notification. + +The +.IR sym , +.IR ndx , +.IR refcook , +.IR defcook , +and +.IR symname +are as for +.BR la_symbind* (). + +The +.I regs +argument points to a structure (defined in +.IR ) +containing the values of registers to be used for +the call to this PLT entry. + +The +.I flags +argument points to a bit mask that conveys information about, +and can be used to modify subsequent auditing of, this PLT entry, as for +.BR la_symbind* (). + +.\" FIXME is the following correct? +The +.IR framesizep +argument points to a +.IR "long\ int" +buffer that can be used to explicitly set the frame size +used for the call to this PLT entry. +If different +.BR la_pltenter () +invocations for this symbol return different values, +then the maximum returned value is used. +The +.BR la_pltenter () +function is only called if this buffer is +explicitly set to a suitable value. + +The return value of +.BR la_pltenter () +is as for +.BR la_symbind* (). +.SS la_pltexit() +The precise name and argument types for this function +depend on the hardware platform. +(The appropriate definition is supplied by +.IR .) +Here is the definition for x86-32: +.nf + +.BI "unsigned int la_i86_gnu_pltexit(Elf32_Sym *" sym ", unsigned int " ndx , +.BI " uintptr_t *" refcook ", uintptr_t *" defcook , +.BI " const La_i86_regs *" inregs ", La_i86_retval *" outregs , +.BI " const char *" symname ); +.fi +.PP +This function is called when a PLT entry, +made between two shared objects that have been marked +for binding notification, returns. +The function is called just before control returns to the caller +of the PLT entry. +.PP +The +.IR sym , +.IR ndx , +.IR refcook , +.IR defcook , +and +.IR symname +are as for +.BR la_symbind* (). + +The +.I inregs +argument points to a structure (defined in +.IR ) +containing the values of registers used for the call to this PLT entry. +The +.I outregs +argument points to a structure (defined in +.IR ) +containing return values for the call to this PLT entry. +These values can be modified by the caller, +and the changes will be visible to the caller of the PLT entry. + +In the current GNU implementation, the return value of +.BR la_pltexit() +is ignored. +.\" This differs from Solaris, where an audit library that monitors +.\" symbol binding should return the value of the 'retval' argument +.\" (not provided by GNU, but equivalent to returning outregs->lrv_eax +.\" on (say) x86-32). +.SH "CONFORMING TO" +This API is nonstandard, but very similar to the Solaris API, +described in the Solaris +.IR "Linker and Libraries Guide" , +in the chapter +.IR "Runtime Linker Auditing Interface" . +.SH NOTES +Note the following differences from the Solaris dynamic linker +auditing API: +.IP * 3 +The Solaris +.BR la_objfilter () +interface is not supported by the GNU implementation. +.IP * +The Solaris +.BR la_symbind32 () +and +.BR la_pltexit () +functions do not provide a +.I symname +argument. +.IP * +The Solaris +.BR la_pltexit () +function does not provide +.I inregs +and +.I outregs +arguments (but does provide a +.IR retval +argument with the function return value). +.SH EXAMPLE +.nf +#include +#include + +unsigned int +la_version(unsigned int version) +{ + printf("la_version(): %d\\n", version); + + return version; +} + +char * +la_objsearch(const char *name, uintptr_t *cookie, unsigned int flag) +{ + printf("la_objsearch(): name = %s; cookie = %x", name, cookie); + printf("; flag = %s\\n", + (flag == LA_SER_ORIG) ? "LA_SER_ORIG" : + (flag == LA_SER_LIBPATH) ? "LA_SER_LIBPATH" : + (flag == LA_SER_RUNPATH) ? "LA_SER_RUNPATH" : + (flag == LA_SER_DEFAULT) ? "LA_SER_DEFAULT" : + (flag == LA_SER_CONFIG) ? "LA_SER_CONFIG" : + (flag == LA_SER_SECURE) ? "LA_SER_SECURE" : + "???"); + + return name; +} + +void +la_activity (uintptr_t *cookie, unsigned int flag) +{ + printf("la_activity(): cookie = %x; flag = %s\\n", cookie, + (flag == LA_ACT_CONSISTENT) ? "LA_ACT_CONSISTENT" : + (flag == LA_ACT_ADD) ? "LA_ACT_ADD" : + (flag == LA_ACT_DELETE) ? "LA_ACT_DELETE" : + "???"); +} + +unsigned int +la_objopen(struct link_map *map, Lmid_t lmid, uintptr_t *cookie) +{ + printf("la_objopen(): loading \\"%s\\"; lmid = %s; cookie=%x\\n", + map\->l_name, + (lmid == LM_ID_BASE) ? "LM_ID_BASE" : + (lmid == LM_ID_NEWLM) ? "LM_ID_NEWLM" : + "???", + cookie); + + return LA_FLG_BINDTO | LA_FLG_BINDFROM; +} + +unsigned int +la_objclose (uintptr_t *cookie) +{ + printf("la_objclose(): %x\\n", cookie); + + return 0; +} + +void +la_preinit(uintptr_t *cookie) +{ + printf("la_preinit(): %x\\n", cookie); +} + +uintptr_t +la_symbind32(Elf32_Sym *sym, unsigned int ndx, uintptr_t *refcook, + uintptr_t *defcook, unsigned int *flags, const char *symname) +{ + printf("la_symbind32(): symname = %s; sym\->st_value = %p\\n", + symname, sym\->st_value); + printf(" ndx = %d; flags = 0x%x", ndx, *flags); + printf("; refcook = %x; defcook = %x\\n", refcook, defcook); + + return sym\->st_value; +} + +uintptr_t +la_symbind64(Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook, + uintptr_t *defcook, unsigned int *flags, const char *symname) +{ + printf("la_symbind64(): symname = %s; sym\->st_value = %p\\n", + symname, sym\->st_value); + printf(" ndx = %d; flags = 0x%x", ndx, *flags); + printf("; refcook = %x; defcook = %x\\n", refcook, defcook); + + return sym\->st_value; +} + +Elf32_Addr +la_i86_gnu_pltenter(Elf32_Sym *sym, unsigned int ndx, + uintptr_t *refcook, uintptr_t *defcook, La_i86_regs *regs, + unsigned int *flags, const char *symname, long int *framesizep) +{ + printf("la_i86_gnu_pltenter(): %s (%p)\\n", symname, sym\->st_value); + + return sym\->st_value; +} +.fi +.SH BUGS +In glibc versions up to and include 2.9, +specifying more than one audit library in +.B LD_AUDIT +results in a run-time crash. +This is reportedly fixed in glibc 2.10. +.\" FIXME Specifying multiple audit libraries doesn't work on GNU. +.\" My simple tests on Solaris work okay, but not on Linux -- mtk, Jan 2009 +.\" glibc bug filed: http://sourceware.org/bugzilla/show_bug.cgi?id=9733 +.\" Reportedly, this is fixed on 16 Mar 2009 (i.e., for glibc 2.10) +.SH "SEE ALSO" +.BR ldd (1), +.BR dlopen (3), +.BR ld.so (8), +.BR ldconfig (8) diff --git a/original/man7/rtnetlink.7 b/original/man7/rtnetlink.7 new file mode 100644 index 00000000..d93d3953 --- /dev/null +++ b/original/man7/rtnetlink.7 @@ -0,0 +1,449 @@ +'\" t +.\" Don't remove the line above, it tells man that tbl is needed. +.\" This man page is Copyright (C) 1999 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. +.\" Based on the original comments from Alexey Kuznetsov, written with +.\" help from Matthew Wilcox. +.\" $Id: rtnetlink.7,v 1.8 2000/01/22 01:55:04 freitag Exp $ +.TH RTNETLINK 7 2008-08-08 "Linux" "Linux Programmer's Manual" +.SH NAME +rtnetlink, NETLINK_ROUTE \- Linux IPv4 routing socket +.SH SYNOPSIS +.B #include +.br +.B #include +.br +.B #include +.br +.B #include +.sp +.BI "rtnetlink_socket = socket(AF_NETLINK, int " socket_type ", NETLINK_ROUTE);" +.SH DESCRIPTION +Rtnetlink allows the kernel's routing tables to be read and altered. +It is used within the kernel to communicate between +various subsystems, though this usage is not documented here, and for +communication with user-space programs. +Network routes, ip addresses, link parameters, neighbor setups, queueing +disciplines, traffic classes and packet classifiers may all be controlled +through +.B NETLINK_ROUTE +sockets. +It is based on netlink messages, see +.BR netlink (7) +for more information. +.\" FIXME ? all these macros could be moved to rtnetlink(3) +.SS "Routing Attributes" +Some rtnetlink messages have optional attributes after the initial header: + +.in +4n +.nf +struct rtattr { + unsigned short rta_len; /* Length of option */ + unsigned short rta_type; /* Type of option */ + /* Data follows */ +}; +.fi +.in + +These attributes should be only manipulated using the RTA_* macros +or libnetlink, see +.BR rtnetlink (3). +.SS Messages +Rtnetlink consists of these message types +(in addition to standard netlink messages): +.TP +.BR RTM_NEWLINK ", " RTM_DELLINK ", " RTM_GETLINK +Create, remove or get information about a specific network interface. +These messages contain an +.I ifinfomsg +structure followed by a series of +.I rtattr +structures. + +.nf +struct ifinfomsg { + unsigned char ifi_family; /* AF_UNSPEC */ + unsigned short ifi_type; /* Device type */ + int ifi_index; /* Interface index */ + unsigned int ifi_flags; /* Device flags */ + unsigned int ifi_change; /* change mask */ +}; +.fi + +.\" FIXME ifi_type +.I ifi_flags +contains the device flags, see +.BR netdevice (7); +.I ifi_index +is the unique interface index, +.I ifi_change +is reserved for future use and should be always set to 0xFFFFFFFF. +.TS +tab(:); +c +l l l. +Routing attributes +rta_type:value type:description +_ +IFLA_UNSPEC:-:unspecified. +IFLA_ADDRESS:hardware address:interface L2 address +IFLA_BROADCAST:hardware address:L2 broadcast address. +IFLA_IFNAME:asciiz string:Device name. +IFLA_MTU:unsigned int:MTU of the device. +IFLA_LINK:int:Link type. +IFLA_QDISC:asciiz string:Queueing discipline. +IFLA_STATS:T{ +see below +T}:Interface Statistics. +.TE +.sp +The value type for IFLA_STATS is \fIstruct net_device_stats\fP. +.TP +.BR RTM_NEWADDR ", " RTM_DELADDR ", " RTM_GETADDR +Add, remove or receive information about an IP address associated with +an interface. +In Linux 2.2 an interface can carry multiple IP addresses, +this replaces the alias device concept in 2.0. +In Linux 2.2 these messages +support IPv4 and IPv6 addresses. +They contain an +.I ifaddrmsg +structure, optionally followed by +.I rtaddr +routing attributes. + +.nf +struct ifaddrmsg { + unsigned char ifa_family; /* Address type */ + unsigned char ifa_prefixlen; /* Prefixlength of address */ + unsigned char ifa_flags; /* Address flags */ + unsigned char ifa_scope; /* Address scope */ + int ifa_index; /* Interface index */ +}; +.fi + +.I ifa_family +is the address family type (currently +.B AF_INET +or +.BR AF_INET6 ), +.I ifa_prefixlen +is the length of the address mask of the address if defined for the +family (like for IPv4), +.I ifa_scope +is the address scope, +.I ifa_index +is the interface index of the interface the address is associated with. +.I ifa_flags +is a flag word of +.B IFA_F_SECONDARY +for secondary address (old alias interface), +.B IFA_F_PERMANENT +for a permanent address set by the user and other undocumented flags. +.TS +tab(:); +c +l l l. +Attributes +rta_type:value type:description +_ +IFA_UNSPEC:-:unspecified. +IFA_ADDRESS:raw protocol address:interface address +IFA_LOCAL:raw protocol address:local address +IFA_LABEL:asciiz string:name of the interface +IFA_BROADCAST:raw protocol address:broadcast address. +IFA_ANYCAST:raw protocol address:anycast address +IFA_CACHEINFO:struct ifa_cacheinfo:Address information. +.TE +.\" FIXME struct ifa_cacheinfo +.TP +.BR RTM_NEWROUTE ", " RTM_DELROUTE ", " RTM_GETROUTE +Create, remove or receive information about a network route. +These messages contain an +.I rtmsg +structure with an optional sequence of +.I rtattr +structures following. +For +.B RTM_GETROUTE +setting +.I rtm_dst_len +and +.I rtm_src_len +to 0 means you get all entries for the specified routing table. +For the other fields except +.I rtm_table +and +.I rtm_protocol +0 is the wildcard. + +.nf +struct rtmsg { + unsigned char rtm_family; /* Address family of route */ + unsigned char rtm_dst_len; /* Length of destination */ + unsigned char rtm_src_len; /* Length of source */ + unsigned char rtm_tos; /* TOS filter */ + + unsigned char rtm_table; /* Routing table ID */ + unsigned char rtm_protocol; /* Routing protocol; see below */ + unsigned char rtm_scope; /* See below */ + unsigned char rtm_type; /* See below */ + + unsigned int rtm_flags; +}; +.fi +.TS +tab(:); +l l. +rtm_type:Route type +_ +RTN_UNSPEC:unknown route +RTN_UNICAST:a gateway or direct route +RTN_LOCAL:a local interface route +RTN_BROADCAST:T{ +a local broadcast route (sent as a broadcast) +T} +RTN_ANYCAST:T{ +a local broadcast route (sent as a unicast) +T} +RTN_MULTICAST:a multicast route +RTN_BLACKHOLE:a packet dropping route +RTN_UNREACHABLE:an unreachable destination +RTN_PROHIBIT:a packet rejection route +RTN_THROW:continue routing lookup in another table +RTN_NAT:a network address translation rule +RTN_XRESOLVE:T{ +refer to an external resolver (not implemented) +T} +.TE +.TS +tab(:); +l l. +rtm_protocol:Route origin. +_ +RTPROT_UNSPEC:unknown +RTPROT_REDIRECT:T{ +by an ICMP redirect (currently unused) +T} +RTPROT_KERNEL:by the kernel +RTPROT_BOOT:during boot +RTPROT_STATIC:by the administrator +.TE + +Values larger than +.B RTPROT_STATIC +are not interpreted by the kernel, they are just for user information. +They may be used to tag the source of a routing information or to +distinguish between multiple routing daemons. +See +.I +for the routing daemon identifiers which are already assigned. + +.I rtm_scope +is the distance to the destination: +.TS +tab(:); +l l. +RT_SCOPE_UNIVERSE:global route +RT_SCOPE_SITE:T{ +interior route in the local autonomous system +T} +RT_SCOPE_LINK:route on this link +RT_SCOPE_HOST:route on the local host +RT_SCOPE_NOWHERE:destination doesn't exist +.TE + +The values between +.B RT_SCOPE_UNIVERSE +and +.B RT_SCOPE_SITE +are available to the user. + +The +.I rtm_flags +have the following meanings: +.TS +tab(:); +l l. +RTM_F_NOTIFY:T{ +if the route changes, notify the user via rtnetlink +T} +RTM_F_CLONED:route is cloned from another route +RTM_F_EQUALIZE:a multipath equalizer (not yet implemented) +.TE + +.I rtm_table +specifies the routing table +.TS +tab(:); +l l. +RT_TABLE_UNSPEC:an unspecified routing table +RT_TABLE_DEFAULT:the default table +RT_TABLE_MAIN:the main table +RT_TABLE_LOCAL:the local table +.TE + +The user may assign arbitrary values between +.B RT_TABLE_UNSPEC +and +.BR RT_TABLE_DEFAULT . +.TS +tab(:); +c +l l l. +Attributes +rta_type:value type:description +_ +RTA_UNSPEC:-:ignored. +RTA_DST:protocol address:Route destination address. +RTA_SRC:protocol address:Route source address. +RTA_IIF:int:Input interface index. +RTA_OIF:int:Output interface index. +RTA_GATEWAY:protocol address:The gateway of the route +RTA_PRIORITY:int:Priority of route. +RTA_PREFSRC:: +RTA_METRICS:int:Route metric +RTA_MULTIPATH:: +RTA_PROTOINFO:: +RTA_FLOW:: +RTA_CACHEINFO:: +.TE + +.B Fill these values in! +.TP +.BR RTM_NEWNEIGH ", " RTM_DELNEIGH ", " RTM_GETNEIGH +Add, remove or receive information about a neighbor table +entry (e.g., an ARP entry). +The message contains an +.I ndmsg +structure. + +.nf +struct ndmsg { + unsigned char ndm_family; + int ndm_ifindex; /* Interface index */ + __u16 ndm_state; /* State */ + __u8 ndm_flags; /* Flags */ + __u8 ndm_type; +}; + +struct nda_cacheinfo { + __u32 ndm_confirmed; + __u32 ndm_used; + __u32 ndm_updated; + __u32 ndm_refcnt; +}; +.fi + +.I ndm_state +is a bit mask of the following states: +.TS +tab(:); +l l. +NUD_INCOMPLETE:a currently resolving cache entry +NUD_REACHABLE:a confirmed working cache entry +NUD_STALE:an expired cache entry +NUD_DELAY:an entry waiting for a timer +NUD_PROBE:a cache entry that is currently reprobed +NUD_FAILED:an invalid cache entry +NUD_NOARP:a device with no destination cache +NUD_PERMANENT:a static entry +.TE + +Valid +.I ndm_flags +are: +.TS +tab(:); +l l. +NTF_PROXY:a proxy arp entry +NTF_ROUTER:an IPv6 router +.TE + +.\" FIXME +.\" document the members of the struct better +The +.I rtaddr +struct has the following meanings for the +.I rta_type +field: +.TS +tab(:); +l l. +NDA_UNSPEC:unknown type +NDA_DST:a neighbor cache n/w layer destination address +NDA_LLADDR:a neighbor cache link layer address +NDA_CACHEINFO:cache statistics. +.TE + +If the +.I rta_type +field is +.B NDA_CACHEINFO +then a +.I struct nda_cacheinfo +header follows +.TP +.BR RTM_NEWRULE ", " RTM_DELRULE ", " RTM_GETRULE +Add, delete or retrieve a routing rule. +Carries a +.I struct rtmsg +.TP +.BR RTM_NEWQDISC ", " RTM_DELQDISC ", " RTM_GETQDISC +Add, remove or get a queueing discipline. +The message contains a +.I struct tcmsg +and may be followed by a series of +attributes. + +.nf +struct tcmsg { + unsigned char tcm_family; + int tcm_ifindex; /* interface index */ + __u32 tcm_handle; /* Qdisc handle */ + __u32 tcm_parent; /* Parent qdisc */ + __u32 tcm_info; +}; +.fi +.TS +tab(:); +c +l l l. +Attributes +rta_type:value type:Description +_ +TCA_UNSPEC:-:unspecified +TCA_KIND:asciiz string:Name of queueing discipline +TCA_OPTIONS:byte sequence:Qdisc-specific options follow +TCA_STATS:struct tc_stats:Qdisc statistics. +TCA_XSTATS:qdisc specific:Module-specific statistics. +TCA_RATE:struct tc_estimator:Rate limit. +.TE + +In addition various other qdisc module specific attributes are allowed. +For more information see the appropriate include files. +.TP +.BR RTM_NEWTCLASS ", " RTM_DELTCLASS ", " RTM_GETTCLASS +Add, remove or get a traffic class. +These messages contain a +.I struct tcmsg +as described above. +.TP +.BR RTM_NEWTFILTER ", " RTM_DELTFILTER ", " RTM_GETTFILTER +Add, remove or receive information about a traffic filter. +These messages contain a +.I struct tcmsg +as described above. +.SH VERSIONS +.B rtnetlink +is a new feature of Linux 2.2. +.SH BUGS +This manual page is incomplete. +.SH "SEE ALSO" +.BR cmsg (3), +.BR rtnetlink (3), +.BR ip (7), +.BR netlink (7) diff --git a/original/man7/sem_overview.7 b/original/man7/sem_overview.7 new file mode 100644 index 00000000..ef354fec --- /dev/null +++ b/original/man7/sem_overview.7 @@ -0,0 +1,161 @@ +'\" 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. +.\" +.TH SEM_OVERVIEW 7 2009-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +sem_overview \- Overview of POSIX semaphores +.SH DESCRIPTION +POSIX semaphores allow processes and threads to synchronize their actions. + +A semaphore is an integer whose value is never allowed to fall below zero. +Two operations can be performed on semaphores: +increment the semaphore value by one +.RB ( sem_post (3)); +and decrement the semaphore value by one +.RB ( sem_wait (3)). +If the value of a semaphore is currently zero, then a +.BR sem_wait (3) +operation will block until the value becomes greater than zero. + +POSIX semaphores come in two forms: named semaphores and +unnamed semaphores. +.TP +.B Named semaphores +A named semaphore is identified by a name of the form +.IR /somename ; +that is, a null-terminated string of up to +.BI NAME_MAX \-4 +(i.e., 251) characters consisting of an initial slash, +.\" 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. +followed by one or more characters, none of which are slashes. +.\" glibc allows subdirectory components in the name, in which +.\" case the subdirectory tree must exist under /dev/shm, and +.\" the fist subdirectory component must exist as the name +.\" sem.name, and all of the subdirectory components must allow the +.\" required permissions if a user wants to create a semaphore +.\" object in a subdirectory. +Two processes can operate on the same named semaphore by passing +the same name to +.BR sem_open (3). + +The +.BR sem_open (3) +function creates a new named semaphore or opens an existing +named semaphore. +After the semaphore has been opened, it can be operated on using +.BR sem_post (3) +and +.BR sem_wait (3). +When a process has finished using the semaphore, it can use +.BR sem_close (3) +to close the semaphore. +When all processes have finished using the semaphore, +it can be removed from the system using +.BR sem_unlink (3). +.TP +.B Unnamed semaphores (memory-based semaphores) +An unnamed semaphore does not have a name. +Instead the semaphore is placed in a region of memory that +is shared between multiple threads (a +.IR "thread-shared semaphore" ) +or processes (a +.IR "process-shared semaphore" ). +A thread-shared semaphore is placed in an area of memory shared +between by the threads of a process, for example, a global variable. +A process-shared semaphore must be placed in a shared memory region +(e.g., a System V shared memory segment created using +.BR semget (2), +or a POSIX shared memory object built created using +.BR shm_open (3)). + +Before being used, an unnamed semaphore must be initialized using +.BR sem_init (3). +It can then be operated on using +.BR sem_post (3) +and +.BR sem_wait (3). +When the semaphore is no longer required, +and before the memory in which it is located is deallocated, +the semaphore should be destroyed using +.BR sem_destroy (3). +.PP +The remainder of this section describes some specific details +of the Linux implementation of POSIX semaphores. +.SS Versions +Prior to kernel 2.6, Linux only supported unnamed, +thread-shared semaphores. +On a system with Linux 2.6 and a glibc that provides the NPTL +threading implementation, +a complete implementation of POSIX semaphores is provided. +.SS Persistence +POSIX named semaphores have kernel persistence: +if not removed by +.BR sem_unlink (3), +a semaphore will exist until the system is shut down. +.SS Linking +Programs using the POSIX semaphores API must be compiled with +.I cc \-lrt +to link against the real-time library, +.IR librt . +.SS Accessing named semaphores via the file system +On Linux, named semaphores are created in a virtual file system, +normally mounted under +.IR /dev/shm , +with names of the form +.IR \fBsem.\fPsomename . +(This is the reason that semaphore names are limited to +.BI NAME_MAX \-4 +rather than +.B NAME_MAX +characters.) + +Since Linux 2.6.19, ACLs can be placed on files under this directory, +to control object permissions on a per-user and per-group basis. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +System V semaphores +.RB ( semget (2), +.BR semop (2), +etc.) are an older semaphore API. +POSIX semaphores provide a simpler, and better designed interface than +System V semaphores; +on the other hand POSIX semaphores are less widely available +(especially on older systems) than System V semaphores. +.SH EXAMPLE +An example of the use of various POSIX semaphore functions is shown in +.BR sem_wait (3). +.SH "SEE ALSO" +.BR sem_close (3), +.BR sem_destroy (3), +.BR sem_getvalue (3), +.BR sem_init (3), +.BR sem_open (3), +.BR sem_post (3), +.BR sem_unlink (3), +.BR sem_wait (3), +.BR pthreads (7) diff --git a/original/man7/shm_overview.7 b/original/man7/shm_overview.7 new file mode 100644 index 00000000..cac62d69 --- /dev/null +++ b/original/man7/shm_overview.7 @@ -0,0 +1,126 @@ +'\" t +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" 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. +.\" +.TH SHM_OVERVIEW 7 2008-06-25 "Linux" "Linux Programmer's Manual" +.SH NAME +shm_overview \- Overview of POSIX shared memory +.SH DESCRIPTION +The POSIX shared memory API allows processes to communicate information +by sharing a region of memory. + +The interfaces employed in the API are: +.TP 15 +.BR shm_open (3) +Create and open a new object, or open an existing object. +This is analogous to +.BR open (2). +The call returns a file descriptor for use by the other +interfaces listed below. +.TP +.BR ftruncate (2) +Set the size of the shared memory object. +(A newly created shared memory object has a length of zero.) +.TP +.BR mmap (2) +Map the shared memory object into the virtual address space +of the calling process. +.TP +.BR munmap (2) +Unmap the shared memory object from the virtual address space +of the calling process. +.TP +.BR shm_unlink (3) +Remove a shared memory object name. +.TP +.BR close (2) +Close the file descriptor allocated by +.BR shm_open (3) +when it is no longer needed. +.TP +.BR fstat (2) +Obtain a +.I stat +structure that describes the shared memory object. +Among the information returned by this call are the object's +size +.RI ( st_size ), +permissions +.RI ( st_mode ), +owner +.RI ( st_uid ), +and group +.RI ( st_gid ). +.TP +.BR fchown (2) +To change the ownership of a shared memory object. +.TP +.BR fchmod (2) +To change the permissions of a shared memory object. +.SS Versions +POSIX shared memory is supported since Linux 2.4 and glibc 2.2. +.SS Persistence +POSIX shared memory objects have kernel persistence: +a shared memory object will exist until the system is shut down, +or until all processes have unmapped the object and it has been deleted with +.BR shm_unlink (3) +.SS Linking +Programs using the POSIX shared memory API must be compiled with +.I cc \-lrt +to link against the real-time library, +.IR librt . +.SS Accessing shared memory objects via the file system +On Linux, shared memory objects are created in a +.RI ( tmpfs ) +virtual file system, normally mounted under +.IR /dev/shm . +Since kernel 2.6.19, Linux supports the use of access control lists (ACLs) +to control the permissions of objects in the virtual file system. +.SH "CONFORMING TO" +POSIX.1-2001. +.SH NOTES +Typically, processes must synchronize their access to a shared +memory object, using, for example, POSIX semaphores. + +System V shared memory +.RB ( shmget (2), +.BR shmop (2), +etc.) is an older semaphore API. +POSIX shared memory provides a simpler, and better designed interface; +on the other hand POSIX shared memory is somewhat less widely available +(especially on older systems) than System V shared memory. +.SH "SEE ALSO" +.BR fchmod (2), +.BR fchown (2), +.BR fstat (2), +.BR ftruncate (2), +.BR mmap (2), +.BR mprotect (2), +.BR munmap (2), +.BR shmget (2), +.BR shmop (2), +.BR shm_open (3), +.BR shm_unlink (3), +.BR sem_overview (7) diff --git a/original/man7/signal.7 b/original/man7/signal.7 new file mode 100644 index 00000000..bb38c751 --- /dev/null +++ b/original/man7/signal.7 @@ -0,0 +1,875 @@ +'\" t +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" and Copyright (c) 2002, 2006 by Michael Kerrisk +.\" and 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. +.\" +.\" Modified Sat Jul 24 17:34:08 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Jan 7 01:41:27 1996 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Sun Apr 14 12:02:29 1996 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Sat Nov 13 16:28:23 1999 by Andries Brouwer (aeb@cwi.nl) +.\" Modified 10 Apr 2002, by Michael Kerrisk +.\" Modified 7 Jun 2002, by Michael Kerrisk +.\" Added information on real-time signals +.\" Modified 13 Jun 2002, by Michael Kerrisk +.\" Noted that SIGSTKFLT is in fact unused +.\" 2004-12-03, Modified mtk, added notes on RLIMIT_SIGPENDING +.\" 2006-04-24, mtk, Added text on changing signal dispositions, +.\" signal mask, and pending signals. +.\" 2008-07-04, mtk: +.\" Added section on system call restarting (SA_RESTART) +.\" Added section on stop/cont signals interrupting syscalls. +.\" 2008-10-05, mtk: various additions +.\" +.TH SIGNAL 7 2010-02-03 "Linux" "Linux Programmer's Manual" +.SH NAME +signal \- overview of signals +.SH DESCRIPTION +Linux supports both POSIX reliable signals (hereinafter +"standard signals") and POSIX real-time signals. +.SS "Signal Dispositions" +Each signal has a current +.IR disposition , +which determines how the process behaves when it is delivered +the signal. + +The entries in the "Action" column of the tables below specify +the default disposition for each signal, as follows: +.IP Term +Default action is to terminate the process. +.IP Ign +Default action is to ignore the signal. +.IP Core +Default action is to terminate the process and dump core (see +.BR core (5)). +.IP Stop +Default action is to stop the process. +.IP Cont +Default action is to continue the process if it is currently stopped. +.PP +A process can change the disposition of a signal using +.BR sigaction (2) +or (less portably) +.BR signal (2). +Using these system calls, a process can elect one of the +following behaviors to occur on delivery of the signal: +perform the default action; ignore the signal; +or catch the signal with a +.IR "signal handler" , +a programmer-defined function that is automatically invoked +when the signal is delivered. +(By default, the signal handler is invoked on the +normal process stack. +It is possible to arrange that the signal handler +uses an alternate stack; see +.BR sigaltstack (2) +for a discussion of how to do this and when it might be useful.) + +The signal disposition is a per-process attribute: +in a multithreaded application, the disposition of a +particular signal is the same for all threads. + +A child created via +.BR fork (2) +inherits a copy of its parent's signal dispositions. +During an +.BR execve (2), +the dispositions of handled signals are reset to the default; +the dispositions of ignored signals are left unchanged. +.SS Sending a Signal +The following system calls and library functions allow +the caller to send a signal: +.TP 16 +.BR raise (3) +Sends a signal to the calling thread. +.TP +.BR kill (2) +Sends a signal to a specified process, +to all members of a specified process group, +or to all processes on the system. +.TP +.BR killpg (2) +Sends a signal to all of the members of a specified process group. +.TP +.BR pthread_kill (3) +Sends a signal to a specified POSIX thread in the same process as +the caller. +.TP +.BR tgkill (2) +Sends a signal to a specified thread within a specific process. +(This is the system call used to implement +.BR pthread_kill (3).) +.TP +.BR sigqueue (2) +Sends a real-time signal with accompanying data to a specified process. +.SS Waiting for a Signal to be Caught +The following system calls suspend execution of the calling process +or thread until a signal is caught +(or an unhandled signal terminates the process): +.TP 16 +.BR pause (2) +Suspends execution until any signal is caught. +.TP +.BR sigsuspend (2) +Temporarily changes the signal mask (see below) and suspends +execution until one of the unmasked signals is caught. +.SS Synchronously Accepting a Signal +Rather than asynchronously catching a signal via a signal handler, +it is possible to synchronously accept the signal, that is, +to block execution until the signal is delivered, +at which point the kernel returns information about the +signal to the caller. +There are two general ways to do this: +.IP * 2 +.BR sigwaitinfo (2), +.BR sigtimedwait (2), +and +.BR sigwait (3) +suspend execution until one of the signals in a specified +set is delivered. +Each of these calls returns information about the delivered signal. +.IP * +.BR signalfd (2) +returns a file descriptor that can be used to read information +about signals that are delivered to the caller. +Each +.BR read (2) +from this file descriptor blocks until one of the signals +in the set specified in the +.BR signalfd (2) +call is delivered to the caller. +The buffer returned by +.BR read (2) +contains a structure describing the signal. +.SS "Signal Mask and Pending Signals" +A signal may be +.IR blocked , +which means that it will not be delivered until it is later unblocked. +Between the time when it is generated and when it is delivered +a signal is said to be +.IR pending . + +Each thread in a process has an independent +.IR "signal mask" , +which indicates the set of signals that the thread is currently blocking. +A thread can manipulate its signal mask using +.BR pthread_sigmask (3). +In a traditional single-threaded application, +.BR sigprocmask (2) +can be used to manipulate the signal mask. + +A child created via +.BR fork (2) +inherits a copy of its parent's signal mask; +the signal mask is preserved across +.BR execve (2). + +A signal may be generated (and thus pending) +for a process as a whole (e.g., when sent using +.BR kill (2)) +or for a specific thread (e.g., certain signals, +such as +.B SIGSEGV +and +.BR SIGFPE , +generated as a +consequence of executing a specific machine-language instruction +are thread directed, as are signals targeted at a specific thread using +.BR pthread_kill (3)). +A process-directed signal may be delivered to any one of the +threads that does not currently have the signal blocked. +If more than one of the threads has the signal unblocked, then the +kernel chooses an arbitrary thread to which to deliver the signal. + +A thread can obtain the set of signals that it currently has pending +using +.BR sigpending (2). +This set will consist of the union of the set of pending +process-directed signals and the set of signals pending for +the calling thread. + +A child created via +.BR fork (2) +initially has an empty pending signal set; +the pending signal set is preserved across an +.BR execve (2). +.SS "Standard Signals" +Linux supports the standard signals listed below. +Several signal numbers +are architecture-dependent, as indicated in the "Value" column. +(Where three values are given, the first one is usually valid for +alpha and sparc, +the middle one for ix86, ia64, ppc, s390, arm and sh, +and the last one for mips. +.\" parisc is a law unto itself +A \- denotes that a signal is absent on the corresponding architecture.) + +First the signals described in the original POSIX.1-1990 standard. +.TS +l c c l +____ +lB c c l. +Signal Value Action Comment +SIGHUP \01 Term Hangup detected on controlling terminal + or death of controlling process +SIGINT \02 Term Interrupt from keyboard +SIGQUIT \03 Core Quit from keyboard +SIGILL \04 Core Illegal Instruction +SIGABRT \06 Core Abort signal from \fBabort\fP(3) +SIGFPE \08 Core Floating point exception +SIGKILL \09 Term Kill signal +SIGSEGV 11 Core Invalid memory reference +SIGPIPE 13 Term Broken pipe: write to pipe with no + readers +SIGALRM 14 Term Timer signal from \fBalarm\fP(2) +SIGTERM 15 Term Termination signal +SIGUSR1 30,10,16 Term User-defined signal 1 +SIGUSR2 31,12,17 Term User-defined signal 2 +SIGCHLD 20,17,18 Ign Child stopped or terminated +SIGCONT 19,18,25 Cont Continue if stopped +SIGSTOP 17,19,23 Stop Stop process +SIGTSTP 18,20,24 Stop Stop typed at tty +SIGTTIN 21,21,26 Stop tty input for background process +SIGTTOU 22,22,27 Stop tty output for background process +.TE + +The signals +.B SIGKILL +and +.B SIGSTOP +cannot be caught, blocked, or ignored. + +Next the signals not in the POSIX.1-1990 standard but described in +SUSv2 and POSIX.1-2001. +.TS +l c c l +____ +lB c c l. +Signal Value Action Comment +SIGBUS 10,7,10 Core Bus error (bad memory access) +SIGPOLL Term Pollable event (Sys V). + Synonym for \fBSIGIO\fP +SIGPROF 27,27,29 Term Profiling timer expired +SIGSYS 12,31,12 Core Bad argument to routine (SVr4) +SIGTRAP 5 Core Trace/breakpoint trap +SIGURG 16,23,21 Ign Urgent condition on socket (4.2BSD) +SIGVTALRM 26,26,28 Term Virtual alarm clock (4.2BSD) +SIGXCPU 24,24,30 Core CPU time limit exceeded (4.2BSD) +SIGXFSZ 25,25,31 Core File size limit exceeded (4.2BSD) +.TE + +Up to and including Linux 2.2, the default behavior for +.BR SIGSYS ", " SIGXCPU ", " SIGXFSZ ", " +and (on architectures other than SPARC and MIPS) +.B SIGBUS +was to terminate the process (without a core dump). +(On some other Unix systems the default action for +.BR SIGXCPU " and " SIGXFSZ +is to terminate the process without a core dump.) +Linux 2.4 conforms to the POSIX.1-2001 requirements for these signals, +terminating the process with a core dump. + +Next various other signals. +.TS +l c c l +____ +lB c c l. +Signal Value Action Comment +SIGIOT 6 Core IOT trap. A synonym for \fBSIGABRT\fP +SIGEMT 7,\-,7 Term +SIGSTKFLT \-,16,\- Term Stack fault on coprocessor (unused) +SIGIO 23,29,22 Term I/O now possible (4.2BSD) +SIGCLD \-,\-,18 Ign A synonym for \fBSIGCHLD\fP +SIGPWR 29,30,19 Term Power failure (System V) +SIGINFO 29,\-,\- A synonym for \fBSIGPWR\fP +SIGLOST \-,\-,\- Term File lock lost +SIGWINCH 28,28,20 Ign Window resize signal (4.3BSD, Sun) +SIGUNUSED \-,31,\- Core Synonymous with \fBSIGSYS\fP +.TE + +(Signal 29 is +.B SIGINFO +/ +.B SIGPWR +on an alpha but +.B SIGLOST +on a sparc.) + +.B SIGEMT +is not specified in POSIX.1-2001, but nevertheless appears +on most other Unix systems, +where its default action is typically to terminate +the process with a core dump. + +.B SIGPWR +(which is not specified in POSIX.1-2001) is typically ignored +by default on those other Unix systems where it appears. + +.B SIGIO +(which is not specified in POSIX.1-2001) is ignored by default +on several other Unix systems. + +Where defined, +.B SIGUNUSED +is synonymous with +.\" parisc is the only exception: SIGSYS is 12, SIGUNUSED is 31 +.B SIGSYS +on most architectures. +.SS "Real-time Signals" +Linux supports real-time signals as originally defined in the POSIX.1b +real-time extensions (and now included in POSIX.1-2001). +The range of supported real-time signals is defined by the macros +.B SIGRTMIN +and +.BR SIGRTMAX . +POSIX.1-2001 requires that an implementation support at least +.B _POSIX_RTSIG_MAX +(8) real-time signals. +.PP +The Linux kernel supports a range of 32 different real-time +signals, numbered 33 to 64. +However, the glibc POSIX threads implementation internally uses +two (for NPTL) or three (for LinuxThreads) real-time signals +(see +.BR pthreads (7)), +and adjusts the value of +.B SIGRTMIN +suitably (to 34 or 35). +Because the range of available real-time signals varies according +to the glibc threading implementation (and this variation can occur +at run time according to the available kernel and glibc), +and indeed the range of real-time signals varies across Unix systems, +programs should +.IR "never refer to real-time signals using hard-coded numbers" , +but instead should always refer to real-time signals using the notation +.BR SIGRTMIN +n, +and include suitable (run-time) checks that +.BR SIGRTMIN +n +does not exceed +.BR SIGRTMAX . +.PP +Unlike standard signals, real-time signals have no predefined meanings: +the entire set of real-time signals can be used for application-defined +purposes. +(Note, however, that the LinuxThreads implementation uses the first +three real-time signals.) +.PP +The default action for an unhandled real-time signal is to terminate the +receiving process. +.PP +Real-time signals are distinguished by the following: +.IP 1. 4 +Multiple instances of real-time signals can be queued. +By contrast, if multiple instances of a standard signal are delivered +while that signal is currently blocked, then only one instance is queued. +.IP 2. 4 +If the signal is sent using +.BR sigqueue (2), +an accompanying value (either an integer or a pointer) can be sent +with the signal. +If the receiving process establishes a handler for this signal using the +.B SA_SIGINFO +flag to +.BR sigaction (2) +then it can obtain this data via the +.I si_value +field of the +.I siginfo_t +structure passed as the second argument to the handler. +Furthermore, the +.I si_pid +and +.I si_uid +fields of this structure can be used to obtain the PID +and real user ID of the process sending the signal. +.IP 3. 4 +Real-time signals are delivered in a guaranteed order. +Multiple real-time signals of the same type are delivered in the order +they were sent. +If different real-time signals are sent to a process, they are delivered +starting with the lowest-numbered signal. +(I.e., low-numbered signals have highest priority.) +By contrast, if multiple standard signals are pending for a process, +the order in which they are delivered is unspecified. +.PP +If both standard and real-time signals are pending for a process, +POSIX leaves it unspecified which is delivered first. +Linux, like many other implementations, gives priority +to standard signals in this case. +.PP +According to POSIX, an implementation should permit at least +.B _POSIX_SIGQUEUE_MAX +(32) real-time signals to be queued to +a process. +However, Linux does things differently. +In kernels up to and including 2.6.7, Linux imposes +a system-wide limit on the number of queued real-time signals +for all processes. +This limit can be viewed and (with privilege) changed via the +.I /proc/sys/kernel/rtsig-max +file. +A related file, +.IR /proc/sys/kernel/rtsig-nr , +can be used to find out how many real-time signals are currently queued. +In Linux 2.6.8, these +.I /proc +interfaces were replaced by the +.B RLIMIT_SIGPENDING +resource limit, which specifies a per-user limit for queued +signals; see +.BR setrlimit (2) +for further details. +.SS "Async-signal-safe functions" +.PP +A signal handling routine established by +.BR sigaction (2) +or +.BR signal (2) +must be very careful, since processing elsewhere may be interrupted +at some arbitrary point in the execution of the program. +POSIX has the concept of "safe function". +If a signal interrupts the execution of an unsafe function, and +.I handler +calls an unsafe function, then the behavior of the program is undefined. + +POSIX.1-2004 (also known as POSIX.1-2001 Technical Corrigendum 2) +requires an implementation to guarantee that the following +functions can be safely called inside a signal handler: + +.in +4 +.nf +_Exit() +_exit() +abort() +accept() +access() +aio_error() +aio_return() +aio_suspend() +alarm() +bind() +cfgetispeed() +cfgetospeed() +cfsetispeed() +cfsetospeed() +chdir() +chmod() +chown() +clock_gettime() +close() +connect() +creat() +dup() +dup2() +execle() +execve() +fchmod() +fchown() +fcntl() +fdatasync() +fork() +fpathconf() +fstat() +fsync() +ftruncate() +getegid() +geteuid() +getgid() +getgroups() +getpeername() +getpgrp() +getpid() +getppid() +getsockname() +getsockopt() +getuid() +kill() +link() +listen() +lseek() +lstat() +mkdir() +mkfifo() +open() +pathconf() +pause() +pipe() +poll() +posix_trace_event() +pselect() +raise() +read() +readlink() +recv() +recvfrom() +recvmsg() +rename() +rmdir() +select() +sem_post() +send() +sendmsg() +sendto() +setgid() +setpgid() +setsid() +setsockopt() +setuid() +shutdown() +sigaction() +sigaddset() +sigdelset() +sigemptyset() +sigfillset() +sigismember() +signal() +sigpause() +sigpending() +sigprocmask() +sigqueue() +sigset() +sigsuspend() +sleep() +sockatmark() +socket() +socketpair() +stat() +symlink() +sysconf() +tcdrain() +tcflow() +tcflush() +tcgetattr() +tcgetpgrp() +tcsendbreak() +tcsetattr() +tcsetpgrp() +time() +timer_getoverrun() +timer_gettime() +timer_settime() +times() +umask() +uname() +unlink() +utime() +wait() +waitpid() +write() +.fi +.in +.PP +POSIX.1-2008 removes fpathconf(), pathconf(), and sysconf() +from the above list, and adds the following functions: +.PP +.in +4n +.nf +execl() +execv() +faccessat() +fchmodat() +fchownat() +fexecve() +fstatat() +futimens() +linkat() +mkdirat() +mkfifoat() +mknod() +mknodat() +openat() +readlinkat() +renameat() +symlinkat() +unlinkat() +utimensat() +utimes() +.fi +.in +.SS Interruption of System Calls and Library Functions by Signal Handlers +If a signal handler is invoked while a system call or library +function call is blocked, then either: +.IP * 2 +the call is automatically restarted after the signal handler returns; or +.IP * +the call fails with the error +.BR EINTR . +.PP +Which of these two behaviors occurs depends on the interface and +whether or not the signal handler was established using the +.BR SA_RESTART +flag (see +.BR sigaction (2)). +The details vary across Unix systems; +below, the details for Linux. + +If a blocked call to one of the following interfaces is interrupted +by a signal handler, then the call will be automatically restarted +after the signal handler returns if the +.BR SA_RESTART +flag was used; otherwise the call will fail with the error +.BR EINTR : +.\" The following system calls use ERESTARTSYS, +.\" so that they are restartable +.RS 4 +.IP * 2 +.BR read (2), +.BR readv (2), +.BR write (2), +.BR writev (2), +and +.BR ioctl (2) +calls on "slow" devices. +A "slow" device is one where the I/O call may block for an +indefinite time, for example, a terminal, pipe, or socket. +(A disk is not a slow device according to this definition.) +If an I/O call on a slow device has already transferred some +data by the time it is interrupted by a signal handler, +then the call will return a success status +(normally, the number of bytes transferred). +.IP * +.BR open (2), +if it can block (e.g., when opening a FIFO; see +.BR fifo (7)). +.IP * +.BR wait (2), +.BR wait3 (2), +.BR wait4 (2), +.BR waitid (2), +and +.BR waitpid (2). +.IP * +Socket interfaces: +.\" If a timeout (setsockopt()) is in effect on the socket, then these +.\" system calls switch to using EINTR. Consequently, they and are not +.\" automatically restarted, and they show the stop/cont behavior +.\" described below. (Verified from 2.6.26 source, and by experiment; mtk) +.BR accept (2), +.BR connect (2), +.BR recv (2), +.BR recvfrom (2), +.BR recvmsg (2), +.BR send (2), +.BR sendto (2), +and +.BR sendmsg (2), +unless a timeout has been set on the socket (see below). +.IP * +File locking interfaces: +.BR flock (2) +and +.BR fcntl (2) +.BR F_SETLKW . +.IP * +POSIX message queue interfaces: +.BR mq_receive (3), +.BR mq_timedreceive (3), +.BR mq_send (3), +and +.BR mq_timedsend (3). +.IP * +.BR futex (2) +.B FUTEX_WAIT +(since Linux 2.6.22; beforehand, always failed with +.BR EINTR ). +.IP * +POSIX semaphore interfaces: +.BR sem_wait (3) +and +.BR sem_timedwait (3) +(since Linux 2.6.22; beforehand, always failed with +.BR EINTR ). +.RE +.PP +The following interfaces are never restarted after +being interrupted by a signal handler, +regardless of the use of +.BR SA_RESTART ; +they always fail with the error +.B EINTR +when interrupted by a signal handler: +.\" These are the system calls that give EINTR or ERESTARTNOHAND +.\" on interruption by a signal handler. +.RS 4 +.IP * 2 +Socket interfaces, when a timeout has been set on the socket using +.BR setsockopt (2): +.BR accept (2), +.BR recv (2), +.BR recvfrom (2), +and +.BR recvmsg (2), +if a receive timeout +.RB ( SO_RCVTIMEO ) +has been set; +.BR connect (2), +.BR send (2), +.BR sendto (2), +and +.BR sendmsg (2), +if a send timeout +.RB ( SO_SNDTIMEO ) +has been set. +.IP * +Interfaces used to wait for signals: +.BR pause (2), +.BR sigsuspend (2), +.BR sigtimedwait (2), +and +.BR sigwaitinfo (2). +.IP * +File descriptor multiplexing interfaces: +.BR epoll_wait (2), +.BR epoll_pwait (2), +.BR poll (2), +.BR ppoll (2), +.BR select (2), +and +.BR pselect (2). +.IP * +System V IPC interfaces: +.\" On some other systems, SA_RESTART does restart these system calls +.BR msgrcv (2), +.BR msgsnd (2), +.BR semop (2), +and +.BR semtimedop (2). +.IP * +Sleep interfaces: +.BR clock_nanosleep (2), +.BR nanosleep (2), +and +.BR usleep (3). +.IP * +.BR read (2) +from an +.BR inotify (7) +file descriptor. +.IP * +.BR io_getevents (2). +.RE +.PP +The +.BR sleep (3) +function is also never restarted if interrupted by a handler, +but gives a success return: the number of seconds remaining to sleep. +.SS Interruption of System Calls and Library Functions by Stop Signals +On Linux, even in the absence of signal handlers, +certain blocking interfaces can fail with the error +.BR EINTR +after the process is stopped by one of the stop signals +and then resumed via +.BR SIGCONT . +This behavior is not sanctioned by POSIX.1, and doesn't occur +on other systems. + +The Linux interfaces that display this behavior are: +.RS 4 +.IP * 2 +Socket interfaces, when a timeout has been set on the socket using +.BR setsockopt (2): +.BR accept (2), +.BR recv (2), +.BR recvfrom (2), +and +.BR recvmsg (2), +if a receive timeout +.RB ( SO_RCVTIMEO ) +has been set; +.BR connect (2), +.BR send (2), +.BR sendto (2), +and +.BR sendmsg (2), +if a send timeout +.RB ( SO_SNDTIMEO ) +has been set. +.IP * 2 +.BR epoll_wait (2), +.BR epoll_pwait (2). +.IP * +.BR semop (2), +.BR semtimedop (2). +.IP * +.BR sigtimedwait (2), +.BR sigwaitinfo (2). +.IP * +.BR read (2) +from an +.BR inotify (7) +file descriptor. +.IP * +Linux 2.6.21 and earlier: +.BR futex (2) +.BR FUTEX_WAIT , +.BR sem_timedwait (3), +.BR sem_wait (3). +.IP * +Linux 2.6.8 and earlier: +.BR msgrcv (2), +.BR msgsnd (2). +.IP * +Linux 2.4 and earlier: +.BR nanosleep (2). +.RE +.SH "CONFORMING TO" +POSIX.1, except as noted. +.SH BUGS +.B SIGIO +and +.B SIGLOST +have the same value. +The latter is commented out in the kernel source, but +the build process of some software still thinks that +signal 29 is +.BR SIGLOST . +.SH "SEE ALSO" +.BR kill (1), +.BR getrlimit (2), +.BR kill (2), +.BR killpg (2), +.BR setitimer (2), +.BR setrlimit (2), +.BR sgetmask (2), +.BR sigaction (2), +.BR sigaltstack (2), +.BR signal (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigqueue (2), +.BR sigsuspend (2), +.BR sigwaitinfo (2), +.BR abort (3), +.BR bsd_signal (3), +.BR longjmp (3), +.BR raise (3), +.BR sigset (3), +.BR sigsetops (3), +.BR sigvec (3), +.BR sigwait (3), +.BR strsignal (3), +.BR sysv_signal (3), +.BR core (5), +.BR proc (5), +.BR pthreads (7) diff --git a/original/man7/socket.7 b/original/man7/socket.7 new file mode 100644 index 00000000..f109b89e --- /dev/null +++ b/original/man7/socket.7 @@ -0,0 +1,738 @@ +'\" t +.\" Don't change the first line, it tells man that we need tbl. +.\" This man page is Copyright (C) 1999 Andi Kleen . +.\" and copyright (c) 1999 Matthew Wilcox. +.\" 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. +.\" +.\" 2002-10-30, Michael Kerrisk, +.\" Added description of SO_ACCEPTCONN +.\" 2004-05-20, aeb, added SO_RCVTIMEO/SO_SNDTIMEO text. +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" A few small grammar fixes +.\" FIXME +.\" The following are not yet documented: +.\" SO_PEERNAME +.\" SO_TIMESTAMPNS +.\" SO_MARK +.\" SO_TIMESTAMPING +.\" SO_PROTOCOL (2.6.32) +.\" SO_DOMAIN (2.6.32) +.\" SO_RXQ_OVFL (2.6.33) +.\" +.TH SOCKET 7 2008-12-03 Linux "Linux Programmer's Manual" +.SH NAME +socket \- Linux socket interface +.SH SYNOPSIS +.B #include +.sp +.IB sockfd " = socket(int " socket_family ", int " socket_type ", int " protocol ); +.SH DESCRIPTION +This manual page describes the Linux networking socket layer user +interface. +The BSD compatible sockets +are the uniform interface +between the user process and the network protocol stacks in the kernel. +The protocol modules are grouped into +.I protocol families +like +.BR AF_INET ", " AF_IPX ", " AF_PACKET +and +.I socket types +like +.B SOCK_STREAM +or +.BR SOCK_DGRAM . +See +.BR socket (2) +for more information on families and types. +.SS Socket Layer Functions +These functions are used by the user process to send or receive packets +and to do other socket operations. +For more information see their respective manual pages. + +.BR socket (2) +creates a socket, +.BR connect (2) +connects a socket to a remote socket address, +the +.BR bind (2) +function binds a socket to a local socket address, +.BR listen (2) +tells the socket that new connections shall be accepted, and +.BR accept (2) +is used to get a new socket with a new incoming connection. +.BR socketpair (2) +returns two connected anonymous sockets (only implemented for a few +local families like +.BR AF_UNIX ) +.PP +.BR send (2), +.BR sendto (2), +and +.BR sendmsg (2) +send data over a socket, and +.BR recv (2), +.BR recvfrom (2), +.BR recvmsg (2) +receive data from a socket. +.BR poll (2) +and +.BR select (2) +wait for arriving data or a readiness to send data. +In addition, the standard I/O operations like +.BR write (2), +.BR writev (2), +.BR sendfile (2), +.BR read (2), +and +.BR readv (2) +can be used to read and write data. +.PP +.BR getsockname (2) +returns the local socket address and +.BR getpeername (2) +returns the remote socket address. +.BR getsockopt (2) +and +.BR setsockopt (2) +are used to set or get socket layer or protocol options. +.BR ioctl (2) +can be used to set or read some other options. +.PP +.BR close (2) +is used to close a socket. +.BR shutdown (2) +closes parts of a full-duplex socket connection. +.PP +Seeking, or calling +.BR pread (2) +or +.BR pwrite (2) +with a nonzero position is not supported on sockets. +.PP +It is possible to do nonblocking I/O on sockets by setting the +.B O_NONBLOCK +flag on a socket file descriptor using +.BR fcntl (2). +Then all operations that would block will (usually) +return with +.B EAGAIN +(operation should be retried later); +.BR connect (2) +will return +.B EINPROGRESS +error. +The user can then wait for various events via +.BR poll (2) +or +.BR select (2). +.TS +tab(:) allbox; +c s s +l l l. +I/O events +Event:Poll flag:Occurrence +Read:POLLIN:T{ +New data arrived. +T} +Read:POLLIN:T{ +A connection setup has been completed +(for connection-oriented sockets) +T} +Read:POLLHUP:T{ +A disconnection request has been initiated by the other end. +T} +Read:POLLHUP:T{ +A connection is broken (only for connection-oriented protocols). +When the socket is written +.B SIGPIPE +is also sent. +T} +Write:POLLOUT:T{ +Socket has enough send buffer space for writing new data. +T} +Read/Write:T{ +POLLIN| +.br +POLLOUT +T}:T{ +An outgoing +.BR connect (2) +finished. +T} +Read/Write:POLLERR:An asynchronous error occurred. +Read/Write:POLLHUP:The other end has shut down one direction. +Exception:POLLPRI:T{ +Urgent data arrived. +.B SIGURG +is sent then. +T} +.\" FIXME . The following is not true currently: +.\" It is no I/O event when the connection +.\" is broken from the local end using +.\" .BR shutdown (2) +.\" or +.\" .BR close (2). +.TE + +.PP +An alternative to +.BR poll (2) +and +.BR select (2) +is to let the kernel inform the application about events +via a +.B SIGIO +signal. +For that the +.B O_ASYNC +flag must be set on a socket file descriptor via +.BR fcntl (2) +and a valid signal handler for +.B SIGIO +must be installed via +.BR sigaction (2). +See the +.I Signals +discussion below. +.SS Socket Options +These socket options can be set by using +.BR setsockopt (2) +and read with +.BR getsockopt (2) +with the socket level set to +.B SOL_SOCKET +for all sockets: +.\" SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in +.\" W R Stevens, UNPv1 +.TP +.B SO_ACCEPTCONN +Returns a value indicating whether or not this socket has been marked +to accept connections with +.BR listen (2). +The value 0 indicates that this is not a listening socket, +the value 1 indicates that this is a listening socket. +Can only be read +with +.BR getsockopt (2). +.TP +.B SO_BINDTODEVICE +Bind this socket to a particular device like \(lqeth0\(rq, +as specified in the passed interface name. +If the +name is an empty string or the option length is zero, the socket device +binding is removed. +The passed option is a variable-length null-terminated +interface name string with the maximum size of +.BR IFNAMSIZ . +If a socket is bound to an interface, +only packets received from that particular interface are processed by the +socket. +Note that this only works for some socket types, particularly +.B AF_INET +sockets. +It is not supported for packet sockets (use normal +.BR bind (8) +there). +.TP +.B SO_BROADCAST +Set or get the broadcast flag. +When enabled, datagram sockets +receive packets sent to a broadcast address and they are allowed to send +packets to a broadcast address. +This option has no effect on stream-oriented sockets. +.TP +.B SO_BSDCOMPAT +Enable BSD bug-to-bug compatibility. +This is used by the UDP protocol module in Linux 2.0 and 2.2. +If enabled ICMP errors received for a UDP socket will not be passed +to the user program. +In later kernel versions, support for this option has been phased out: +Linux 2.4 silently ignores it, and Linux 2.6 generates a kernel warning +(printk()) if a program uses this option. +Linux 2.0 also enabled BSD bug-to-bug compatibility +options (random header changing, skipping of the broadcast flag) for raw +sockets with this option, but that was removed in Linux 2.2. +.TP +.B SO_DEBUG +Enable socket debugging. +Only allowed for processes with the +.B CAP_NET_ADMIN +capability or an effective user ID of 0. +.TP +.B SO_ERROR +Get and clear the pending socket error. +Only valid as a +.BR getsockopt (2). +Expects an integer. +.TP +.B SO_DONTROUTE +Don't send via a gateway, only send to directly connected hosts. +The same effect can be achieved by setting the +.B MSG_DONTROUTE +flag on a socket +.BR send (2) +operation. +Expects an integer boolean flag. +.TP +.B SO_KEEPALIVE +Enable sending of keep-alive messages on connection-oriented sockets. +Expects an integer boolean flag. +.TP +.B SO_LINGER +Sets or gets the +.B SO_LINGER +option. +The argument is a +.I linger +structure. +.sp +.in +4n +.nf +struct linger { + int l_onoff; /* linger active */ + int l_linger; /* how many seconds to linger for */ +}; +.fi +.in +.IP +When enabled, a +.BR close (2) +or +.BR shutdown (2) +will not return until all queued messages for the socket have been +successfully sent or the linger timeout has been reached. +Otherwise, +the call returns immediately and the closing is done in the background. +When the socket is closed as part of +.BR exit (2), +it always lingers in the background. +.TP +.B SO_OOBINLINE +If this option is enabled, +out-of-band data is directly placed into the receive data stream. +Otherwise out-of-band data is only passed when the +.B MSG_OOB +flag is set during receiving. +.\" don't document it because it can do too much harm. +.\".B SO_NO_CHECK +.TP +.B SO_PASSCRED +Enable or disable the receiving of the +.B SCM_CREDENTIALS +control message. +For more information see +.BR unix (7). +.\" FIXME Document SO_PASSSEC, added in 2.6.18; there is some info +.\" in the 2.6.18 ChangeLog +.TP +.B SO_PEERCRED +Return the credentials of the foreign process connected to this socket. +This is only possible for connected +.B AF_UNIX +stream sockets and +.B AF_UNIX +stream and datagram socket pairs created using +.BR socketpair (2); +see +.BR unix (7). +The returned credentials are those that were in effect at the time +of the call to +.BR connect (2) +or +.BR socketpair (2). +Argument is a +.I ucred +structure. +Only valid as a +.BR getsockopt (2). +.TP +.B SO_PRIORITY +Set the protocol-defined priority for all packets to be sent on +this socket. +Linux uses this value to order the networking queues: +packets with a higher priority may be processed first depending +on the selected device queueing discipline. +For +.BR ip (7), +this also sets the IP type-of-service (TOS) field for outgoing packets. +Setting a priority outside the range 0 to 6 requires the +.B CAP_NET_ADMIN +capability. +.TP +.B SO_RCVBUF +Sets or gets the maximum socket receive buffer in bytes. +The kernel doubles this value (to allow space for bookkeeping overhead) +when it is set using +.\" Most (all?) other implementations do not do this -- MTK, Dec 05 +.BR setsockopt (2), +and this doubled value is returned by +.BR getsockopt (2). +The default value is set by the +.I /proc/sys/net/core/rmem_default +file, and the maximum allowed value is set by the +.I /proc/sys/net/core/rmem_max +file. +The minimum (doubled) value for this option is 256. +.TP +.BR SO_RCVBUFFORCE " (since Linux 2.6.14)" +Using this socket option, a privileged +.RB ( CAP_NET_ADMIN ) +process can perform the same task as +.BR SO_RCVBUF , +but the +.I rmem_max +limit can be overridden. +.TP +.BR SO_RCVLOWAT " and " SO_SNDLOWAT +Specify the minimum number of bytes in the buffer until the socket layer +will pass the data to the protocol +.RB ( SO_SNDLOWAT ) +or the user on receiving +.RB ( SO_RCVLOWAT ). +These two values are initialized to 1. +.B SO_SNDLOWAT +is not changeable on Linux +.RB ( setsockopt (2) +fails with the error +.BR ENOPROTOOPT ). +.B SO_RCVLOWAT +is changeable +only since Linux 2.4. +The +.BR select (2) +and +.BR poll (2) +system calls currently do not respect the +.B SO_RCVLOWAT +setting on Linux, +and mark a socket readable when even a single byte of data is available. +A subsequent read from the socket will block until +.B SO_RCVLOWAT +bytes are available. +.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2 +.\" Tested on kernel 2.6.14 -- mtk, 30 Nov 05 +.TP +.BR SO_RCVTIMEO " and " SO_SNDTIMEO +.\" Not implemented in 2.0. +.\" Implemented in 2.1.11 for getsockopt: always return a zero struct. +.\" Implemented in 2.3.41 for setsockopt, and actually used. +Specify the receiving or sending timeouts until reporting an error. +The argument is a +.IR "struct timeval" . +If an input or output function blocks for this period of time, and +data has been sent or received, the return value of that function +will be the amount of data transferred; if no data has been transferred +and the timeout has been reached then \-1 is returned with +.I errno +set to +.B EAGAIN +or +.B EWOULDBLOCK +.\" in fact to EAGAIN +just as if the socket was specified to be nonblocking. +If the timeout is set to zero (the default) +then the operation will never timeout. +Timeouts only have effect for system calls that perform socket I/O (e.g., +.BR read (2), +.BR recvmsg (2), +.BR send (2), +.BR sendmsg (2)); +timeouts have no effect for +.BR select (2), +.BR poll (2), +.BR epoll_wait (2), +etc. +.TP +.B SO_REUSEADDR +Indicates that the rules used in validating addresses supplied in a +.BR bind (2) +call should allow reuse of local addresses. +For +.B AF_INET +sockets this +means that a socket may bind, except when there +is an active listening socket bound to the address. +When the listening socket is bound to +.B INADDR_ANY +with a specific port then it is not possible +to bind to this port for any local address. +Argument is an integer boolean flag. +.TP +.B SO_SNDBUF +Sets or gets the maximum socket send buffer in bytes. +The kernel doubles this value (to allow space for bookkeeping overhead) +when it is set using +.\" Most (all?) other implementations do not do this -- MTK, Dec 05 +.BR setsockopt (2), +and this doubled value is returned by +.BR getsockopt (2). +The default value is set by the +.I /proc/sys/net/core/wmem_default +file and the maximum allowed value is set by the +.I /proc/sys/net/core/wmem_max +file. +The minimum (doubled) value for this option is 2048. +.TP +.BR SO_SNDBUFFORCE " (since Linux 2.6.14)" +Using this socket option, a privileged +.RB ( CAP_NET_ADMIN ) +process can perform the same task as +.BR SO_SNDBUF , +but the +.I wmem_max +limit can be overridden. +.TP +.B SO_TIMESTAMP +Enable or disable the receiving of the +.B SO_TIMESTAMP +control message. +The timestamp control message is sent with level +.B SOL_SOCKET +and the +.I cmsg_data +field is a +.I "struct timeval" +indicating the +reception time of the last packet passed to the user in this call. +See +.BR cmsg (3) +for details on control messages. +.TP +.B SO_TYPE +Gets the socket type as an integer (like +.BR SOCK_STREAM ). +Can only be read +with +.BR getsockopt (2). +.SS Signals +When writing onto a connection-oriented socket that has been shut down +(by the local or the remote end) +.B SIGPIPE +is sent to the writing process and +.B EPIPE +is returned. +The signal is not sent when the write call +specified the +.B MSG_NOSIGNAL +flag. +.PP +When requested with the +.B FIOSETOWN +.BR fcntl (2) +or +.B SIOCSPGRP +.BR ioctl (2), +.B SIGIO +is sent when an I/O event occurs. +It is possible to use +.BR poll (2) +or +.BR select (2) +in the signal handler to find out which socket the event occurred on. +An alternative (in Linux 2.2) is to set a real-time signal using the +.B F_SETSIG +.BR fcntl (2); +the handler of the real time signal will be called with +the file descriptor in the +.I si_fd +field of its +.IR siginfo_t . +See +.BR fcntl (2) +for more information. +.PP +Under some circumstances (e.g., multiple processes accessing a +single socket), the condition that caused the +.B SIGIO +may have already disappeared when the process reacts to the signal. +If this happens, the process should wait again because Linux +will resend the signal later. +.\" .SS Ancillary Messages +.SS /proc interfaces +The core socket networking parameters can be accessed +via files in the directory +.IR /proc/sys/net/core/ . +.TP +.I rmem_default +contains the default setting in bytes of the socket receive buffer. +.TP +.I rmem_max +contains the maximum socket receive buffer size in bytes which a user may +set by using the +.B SO_RCVBUF +socket option. +.TP +.I wmem_default +contains the default setting in bytes of the socket send buffer. +.TP +.I wmem_max +contains the maximum socket send buffer size in bytes which a user may +set by using the +.B SO_SNDBUF +socket option. +.TP +.IR message_cost " and " message_burst +configure the token bucket filter used to load limit warning messages +caused by external network events. +.TP +.I netdev_max_backlog +Maximum number of packets in the global input queue. +.TP +.I optmem_max +Maximum length of ancillary data and user control data like the iovecs +per socket. +.\" netdev_fastroute is not documented because it is experimental +.SS Ioctls +These operations can be accessed using +.BR ioctl (2): + +.in +4n +.nf +.IB error " = ioctl(" ip_socket ", " ioctl_type ", " &value_result ");" +.fi +.in +.TP +.B SIOCGSTAMP +Return a +.I struct timeval +with the receive timestamp of the last packet passed to the user. +This is useful for accurate round trip time measurements. +See +.BR setitimer (2) +for a description of +.IR "struct timeval" . +.\" +This ioctl should only be used if the socket option +.B SO_TIMESTAMP +is not set on the socket. +Otherwise, it returns the timestamp of the +last packet that was received while +.B SO_TIMESTAMP +was not set, or it fails if no such packet has been received, +(i.e., +.BR ioctl (2) +returns \-1 with +.I errno +set to +.BR ENOENT ). +.TP +.B SIOCSPGRP +Set the process or process group to send +.B SIGIO +or +.B SIGURG +signals +to when an +asynchronous I/O operation has finished or urgent data is available. +The argument is a pointer to a +.IR pid_t . +If the argument is positive, send the signals to that process. +If the +argument is negative, send the signals to the process group with the ID +of the absolute value of the argument. +The process may only choose itself or its own process group to receive +signals unless it has the +.B CAP_KILL +capability or an effective UID of 0. +.TP +.B FIOASYNC +Change the +.B O_ASYNC +flag to enable or disable asynchronous I/O mode of the socket. +Asynchronous I/O mode means that the +.B SIGIO +signal or the signal set with +.B F_SETSIG +is raised when a new I/O event occurs. +.IP +Argument is an integer boolean flag. +(This operation is synonymous with the use of +.BR fcntl (2) +to set the +.B O_ASYNC +flag.) +.\" +.TP +.B SIOCGPGRP +Get the current process or process group that receives +.B SIGIO +or +.B SIGURG +signals, +or 0 +when none is set. +.PP +Valid +.BR fcntl (2) +operations: +.TP +.B FIOGETOWN +The same as the +.B SIOCGPGRP +.BR ioctl (2). +.TP +.B FIOSETOWN +The same as the +.B SIOCSPGRP +.BR ioctl (2). +.SH VERSIONS +.B SO_BINDTODEVICE +was introduced in Linux 2.0.30. +.B SO_PASSCRED +is new in Linux 2.2. +The +.I /proc +interfaces was introduced in Linux 2.2. +.B SO_RCVTIMEO +and +.B SO_SNDTIMEO +are supported since Linux 2.3.41. +Earlier, timeouts were fixed to +a protocol-specific setting, and could not be read or written. +.SH NOTES +Linux assumes that half of the send/receive buffer is used for internal +kernel structures; thus the values in the corresponding +.I /proc +files are twice what can be observed on the wire. + +Linux will only allow port reuse with the +.B SO_REUSEADDR +option +when this option was set both in the previous program that performed a +.BR bind (2) +to the port and in the program that wants to reuse the port. +This differs from some implementations (e.g., FreeBSD) +where only the later program needs to set the +.B SO_REUSEADDR +option. +Typically this difference is invisible, since, for example, a server +program is designed to always set this option. +.SH BUGS +The +.B CONFIG_FILTER +socket options +.B SO_ATTACH_FILTER +and +.B SO_DETACH_FILTER +.\" FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER +are not documented. +The suggested interface to use them is via the libpcap +library. +.\" .SH AUTHORS +.\" This man page was written by Andi Kleen. +.SH "SEE ALSO" +.BR getsockopt (2), +.BR setsockopt (2), +.BR socket (2), +.BR capabilities (7), +.BR ddp (7), +.BR ip (7), +.BR packet (7), +.BR tcp (7), +.BR udp (7), +.BR unix (7) diff --git a/original/man7/spufs.7 b/original/man7/spufs.7 new file mode 100644 index 00000000..64c4357d --- /dev/null +++ b/original/man7/spufs.7 @@ -0,0 +1,770 @@ +.\" Copyright (c) International Business Machines Corp., 2006 +.\" +.\" 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 +.\" +.\" HISTORY: +.\" 2005-09-28, created by Arnd Bergmann , +.\" Mark Nutter and +.\" Ulrich Weigand +.\" 2006-06-16, revised by Eduardo M. Fleury +.\" 2007-07-10, quite a lot of polishing by mtk +.\" 2007-09-28, updates for newer kernels by Jeremy Kerr +.\" +.TH SPUFS 7 2007-12-20 Linux "Linux Programmer's Manual" +.SH NAME +spufs \- the SPU file system +.SH DESCRIPTION +The SPU file system is used on PowerPC machines that implement the +Cell Broadband Engine Architecture in order to access Synergistic +Processor Units (SPUs). + +The file system provides a name space similar to POSIX shared +memory or message queues. +Users that have write permissions +on the file system can use +.BR spu_create (2) +to establish SPU contexts under the +.B spufs +root directory. + +Every SPU context is represented by a directory containing +a predefined set of files. +These files can be +used for manipulating the state of the logical SPU. +Users can change permissions on the files, but can't +add or remove files. +.SS Mount Options +.TP +.B uid= +Set the user owning the mount point; the default is 0 (root). +.TP +.B gid= +Set the group owning the mount point; the default is 0 (root). +.TP +.B mode= +Set the mode of the top-level directory in +.BR spufs , +as an octal mode string. +The default is 0775. +.SS Files +The files in +.B spufs +mostly follow the standard behavior for regular system calls like +.BR read (2) +or +.BR write (2), +but often support only a subset of the operations +supported on regular file systems. +This list details the supported +operations and the deviations from the standard behavior described +in the respective man pages. + +All files that support the +.BR read (2) +operation also support +.BR readv (2) +and all files that support the +.BR write (2) +operation also support +.BR writev (2). +All files support the +.BR access (2) +and +.BR stat (2) +family of operations, but for the latter call, +the only fields of the returned +.I stat +structure that contain reliable information are +.IR st_mode , +.IR st_nlink , +.IR st_uid , +and +.IR st_gid . + +All files support the +.BR chmod (2)/ fchmod (2) +and +.BR chown (2)/ fchown (2) +operations, but will not be able to grant permissions that contradict +the possible operations (e.g., read access on the +.I wbox +file). + +The current set of files is: +.TP +.I /capabilities +Contains a comma-delimited string representing the capabilities of this +SPU context. +Possible capabilities are: +.RS +.TP +.B sched +This context may be scheduled. +.TP +.B step +This context can be run in single-step mode, for debugging. +.PP +New capabilities flags may be added in the future. +.RE +.TP +.I /mem +the contents of the local storage memory of the SPU. +This can be accessed like a regular shared memory +file and contains both code and data in the address +space of the SPU. +The possible operations on an open +.I mem +file are: +.RS +.TP +.BR read "(2), " pread "(2), " write "(2), " pwrite "(2), " lseek (2) +These operate as usual, with the exception that +.BR lseek (2), +.BR write (2), +and +.BR pwrite (2) +are not supported beyond the end of the file. +The file size +is the size of the local storage of the SPU, +which is normally 256 kilobytes. +.TP +.BR mmap (2) +Mapping +.I mem +into the process address space provides access to the SPU local +storage within the process address space. +Only +.B MAP_SHARED +mappings are allowed. +.RE +.TP +.I /regs +Contains the saved general-purpose registers of the SPU context. +This file contains the 128-bit values of each register, +from register 0 to register 127, in order. +This allows the general-purpose registers to be +inspected for debugging. + +Reading to or writing from this file requires that the context is +scheduled out, so use of this file is not recommended in normal +program operation. + +The +.I regs +file is not present on contexts that have been created with the +.B SPU_CREATE_NOSCHED +flag. +.TP +.I /mbox +The first SPU-to-CPU communication mailbox. +This file is read-only and can be read in units of 4 bytes. +The file can only be used in nonblocking mode \- even +.BR poll (2) +cannot be used to block on this file. +The only possible operation on an open +.I mbox +file is: +.RS +.TP +.BR read (2) +If +.I count +is smaller than four, +.BR read (2) +returns \-1 and sets +.I errno +to +.BR EINVAL . +If there is no data available in the mailbox (i.e., the SPU has not +sent a mailbox message), the return value is set to \-1 and +.I errno +is set to +.BR EAGAIN . +When data +has been read successfully, four bytes are placed in +the data buffer and the value four is returned. +.RE +.TP +.I /ibox +The second SPU-to-CPU communication mailbox. +This file is similar to the first mailbox file, but can be read +in blocking I/O mode, thus calling +.BR read (2) +on an open +.I ibox +file will block until the SPU has written data to its interrupt mailbox +channel (unless the file has been opened with +.BR O_NONBLOCK , +see below). +Also, +.BR poll (2) +and similar system calls can be used to monitor for the presence +of mailbox data. + +The possible operations on an open +.I ibox +file are: +.RS +.TP +.BR read (2) +If +.I count +is smaller than four, +.BR read (2) +returns \-1 and sets +.I errno +to +.BR EINVAL . +If there is no data available in the mailbox and the file +descriptor has been opened with +.BR O_NONBLOCK , +the return value is set to \-1 and +.I errno +is set to +.BR EAGAIN . + +If there is no data available in the mailbox and the file +descriptor has been opened without +.BR O_NONBLOCK , +the call will +block until the SPU writes to its interrupt mailbox channel. +When data has been read successfully, four bytes are placed in +the data buffer and the value four is returned. +.TP +.BR poll (2) +Poll on the +.I ibox +file returns +.I "(POLLIN | POLLRDNORM)" +whenever data is available for reading. +.RE +.TP +.I /wbox +The CPU-to-SPU communication mailbox. +It is write-only and can be written in units of four bytes. +If the mailbox is full, +.BR write (2) +will block, and +.BR poll (2) +can be used to block until the mailbox is available for writing again. +The possible operations on an open +.I wbox +file are: +.RS +.TP +.BR write (2) +If +.I count +is smaller than four, +.BR write (2) +returns \-1 and sets +.I errno +to +.BR EINVAL . +If there is no space available in the mailbox and the file +descriptor has been opened with +.BR O_NONBLOCK , +the return +value is set to \-1 and +.I errno +is set to +.BR EAGAIN . + +If there is no space available in the mailbox and the file +descriptor has been opened without +.BR O_NONBLOCK , +the call will block until the SPU reads from its +PPE (PowerPC Processing Element) +mailbox channel. +When data has been written successfully, +the system call returns four as its function result. +.TP +.BR poll (2) +A poll on the +.I wbox +file returns +.I "(POLLOUT | POLLWRNORM)" +whenever space is available for writing. +.RE +.TP +.IR /mbox_stat ", " /ibox_stat ", " /wbox_stat +These are read-only files that contain the length of the current +queue of each mailbox, i.e., how many words can be read from +.IR mbox " or " ibox +or how many words can be written to +.I wbox +without blocking. +The files can be read only in four-byte units and return +a big-endian binary integer number. +The only possible operation on an open +.I *box_stat +file is: +.RS +.TP +.BR read (2) +If +.I count +is smaller than four, +.BR read (2) +returns \-1 and sets +.I errno +to +.BR EINVAL . +Otherwise, a four-byte value is placed in the data buffer. +This value is the number of elements that can be read from (for +.IR mbox_stat +and +.IR ibox_stat ) +or written to (for +.IR wbox_stat ) +the respective mailbox without blocking or returning an +.BR EAGAIN +error. +.RE +.TP +.IR /npc ", " /decr ", " /decr_status ", " /spu_tag_mask ", " \ +/event_mask ", " /event_status ", " /srr0 ", " /lslr +Internal registers of the SPU. +These files contain an ASCII string +representing the hex value of the specified register. +Reads and writes on these +files (except for +.IR npc , +see below) require that the SPU context be scheduled out, +so frequent access to +these files is not recommended for normal program operation. +.IP +The contents of these files are: +.RS +.TP 16 +.I npc +Next Program Counter \- only valid when the SPU is in a stopped state. +.TP +.I decr +SPU Decrementer +.TP +.I decr_status +Decrementer Status +.TP +.I spu_tag_mask +MFC tag mask for SPU DMA +.TP +.I event_mask +Event mask for SPU interrupts +.TP +.I event_status +Number of SPU events pending (read-only) +.TP +.I srr0 +Interrupt Return address register +.TP +.I lslr +Local Store Limit Register +.RE +.IP +The possible operations on these files are: +.RS +.TP +.BR read (2) +Reads the current register value. +If the register value is larger than the buffer passed to the +.BR read (2) +system call, subsequent reads will continue reading from the same +buffer, until the end of the buffer is reached. + +When a complete string has been read, all subsequent read operations +will return zero bytes and a new file descriptor needs to be opened +to read a new value. +.TP +.BR write (2) +A +.BR write (2) +operation on the file sets the register to the +value given in the string. +The string is parsed from the beginning +until the first nonnumeric character or the end of the buffer. +Subsequent writes to the same file descriptor overwrite the +previous setting. + +Except for the +.I npc +file, these files are not present on contexts that have been created with +the +.B SPU_CREATE_NOSCHED +flag. +.RE +.TP +.IR /fpcr +This file provides access to the Floating Point Status and +Control Register (fcpr) as a binary, four-byte file. +The operations on the +.I fpcr +file are: +.RS +.TP +.BR read (2) +If +.I count +is smaller than four, +.BR read (2) +returns \-1 and sets +.I errno +to +.BR EINVAL . +Otherwise, a four-byte value is placed in the data buffer; +this is the current value of the +.I fpcr +register. +.TP +.BR write (2) +If +.I count +is smaller than four, +.BR write (2) +returns \-1 and sets +.I errno +to +.BR EINVAL . +Otherwise, a four-byte value is copied from the data buffer, +updating the value of the +.I fpcr +register. +.RE +.TP +.IR /signal1 ", " /signal2 +The files provide access to the two signal notification channels +of an SPU. +These are read-write files that operate on four-byte words. +Writing to one of these files triggers an interrupt on the SPU. +The value written to the signal files can +be read from the SPU through a channel read or from +host user space through the file. +After the value has been read by the SPU, it is reset to zero. +The possible operations on an open +.I signal1 +or +.I signal2 +file are: +.RS +.TP +.BR read (2) +If +.I count +is smaller than four, +.BR read (2) +returns \-1 and sets +.I errno +to +.BR EINVAL . +Otherwise, a four-byte value is placed in the data buffer; +this is the current value of the specified signal notification +register. +.TP +.BR write (2) +If +.I count +is smaller than four, +.BR write (2) +returns \-1 and sets +.I errno +to +.BR EINVAL . +Otherwise, a four-byte value is copied from the data buffer, +updating the value of the specified signal notification +register. +The signal notification register will either be replaced with +the input data or will be updated to the bitwise OR operation +of the old value and the input data, depending on the contents +of the +.IR signal1_type +or +.IR signal2_type +files respectively. +.RE +.TP +.IR /signal1_type ", " /signal2_type +These two files change the behavior of the +.IR signal1 +and +.IR signal2 +notification files. +They contain a numeric ASCII string which is read +as either "1" or "0". +In mode 0 (overwrite), the hardware replaces the contents +of the signal channel with the data that is written to it. +In mode 1 (logical OR), the hardware accumulates the bits +that are subsequently written to it. +The possible operations on an open +.I signal1_type +or +.I signal2_type +file are: +.RS +.TP +.BR read (2) +When the count supplied to the +.BR read (2) +call is shorter than the required length for the digit (plus a newline +character), subsequent reads from the same file descriptor will +complete the string. +When a complete string has been read, all subsequent read operations +will return zero bytes and a new file descriptor needs to be opened +to read the value again. +.TP +.BR write (2) +A +.BR write (2) +operation on the file sets the register to the +value given in the string. +The string is parsed from the beginning +until the first nonnumeric character or the end of the buffer. +Subsequent writes to the same file descriptor overwrite the +previous setting. +.RE +.TP +.IR /mbox_info ", " /ibox_info ", " /wbox_info ", " /dma_into ", " /proxydma_info +Read-only files that contain the saved state of the SPU mailboxes and +DMA queues. +This allows the SPU status to be inspected, mainly for debugging. +The +.I mbox_info +and +.I ibox_info +files each contain the four-byte mailbox message that has been written +by the SPU. +If no message has been written to these mailboxes, then +contents of these files is undefined. +The +.IR mbox_stat , +.I ibox_stat +and +.I wbox_stat +files contain the available message count. + +The +.I wbox_info +file contains an array of four-byte mailbox messages, which have been +sent to the SPU. +With current CBEA machines, the array is four items in +length, so up to 4 * 4 = 16 bytes can be read from this file. +If any mailbox queue entry is empty, +then the bytes read at the corresponding location are undefined. + +The +.I dma_info +file contains the contents of the SPU MFC DMA queue, represented as the +following structure: + +.in +4n +.nf +struct spu_dma_info { + uint64_t dma_info_type; + uint64_t dma_info_mask; + uint64_t dma_info_status; + uint64_t dma_info_stall_and_notify; + uint64_t dma_info_atomic_command_status; + struct mfc_cq_sr dma_info_command_data[16]; +}; +.fi +.in + +The last member of this data structure is the actual DMA queue, +containing 16 entries. +The +.I mfc_cq_sr +structure is defined as: + +.in +4n +.nf +struct mfc_cq_sr { + uint64_t mfc_cq_data0_RW; + uint64_t mfc_cq_data1_RW; + uint64_t mfc_cq_data2_RW; + uint64_t mfc_cq_data3_RW; +}; +.fi +.in + +The +.I proxydma_info +file contains similar information, but describes the proxy DMA queue +(i.e., DMAs initiated by entities outside the SPU) instead. +The file is in the following format: + +.in +4n +.nf +struct spu_proxydma_info { + uint64_t proxydma_info_type; + uint64_t proxydma_info_mask; + uint64_t proxydma_info_status; + struct mfc_cq_sr proxydma_info_command_data[8]; +}; +.fi +.in + +Accessing these files requires that the SPU context is scheduled out - +frequent use can be inefficient. +These files should not be used for normal program operation. + +These files are not present on contexts that have been created with the +.B SPU_CREATE_NOSCHED +flag. +.TP +.IR /cntl +This file provides access to the SPU Run Control and SPU status +registers, as an ASCII string. +The following operations are supported: +.RS +.TP +.BR read (2) +Reads from the +.I cntl +file will return an ASCII string with the hex +value of the SPU Status register. +.TP +.BR write (2) +Writes to the +.I cntl +file will set the context's SPU Run Control register. +.RE +.TP +.I /mfc +Provides access to the Memory Flow Controller of the SPU. +Reading from the file returns the contents of the +SPU's MFC Tag Status register, and +writing to the file initiates a DMA from the MFC. +The following operations are supported: +.RS +.TP +.BR write (2) +Writes to this file need to be in the format of a MFC DMA command, +defined as follows: + +.in +4n +.nf +struct mfc_dma_command { + int32_t pad; /* reserved */ + uint32_t lsa; /* local storage address */ + uint64_t ea; /* effective address */ + uint16_t size; /* transfer size */ + uint16_t tag; /* command tag */ + uint16_t class; /* class ID */ + uint16_t cmd; /* command opcode */ +}; +.fi +.in + +Writes are required to be exactly +.I sizeof(struct mfc_dma_command) +bytes in size. +The command will be sent to the SPU's MFC proxy queue, and the +tag stored in the kernel (see below). +.TP +.BR read (2) +Reads the contents of the tag status register. +If the file is opened in blocking mode (i.e., without +.BR O_NONBLOCK ), +then the read will block until a +DMA tag (as performed by a previous write) is complete. +In nonblocking mode, +the MFC tag status register will be returned without waiting. +.TP +.BR poll (2) +Calling +.BR poll (2) +on the +.I mfc +file will block until a new DMA can be +started (by checking for +.BR POLLOUT ) +or until a previously started DMA +(by checking for +.BR POLLIN ) +has been completed. + +.I /mss +Provides access to the MFC MultiSource Synchronization (MSS) facility. +By +.BR mmap (2)-ing +this file, processes can access the MSS area of the SPU. + +The following operations are supported: +.TP +.BR mmap (2) +Mapping +.B mss +into the process address space gives access to the SPU MSS area +within the process address space. +Only +.B MAP_SHARED +mappings are allowed. +.RE +.TP +.I /psmap +Provides access to the whole problem-state mapping of the SPU. +Applications can use this area to interface to the SPU, rather than +writing to individual register files in +.BR spufs . + +The following operations are supported: +.RS +.TP +.BR mmap (2) +Mapping +.B psmap +gives a process a direct map of the SPU problem state area. +Only +.B MAP_SHARED +mappings are supported. +.RE +.TP +.I /phys-id +Read-only file containing the physical SPU number that the SPU context +is running on. +When the context is not running, this file contains the +string "-1". + +The physical SPU number is given by an ASCII hex string. +.TP +.I /object-id +Allows applications to store (or retrieve) a single 64-bit ID into the +context. +This ID is later used by profiling tools to uniquely identify +the context. +.RS +.TP +.BR write (2) +By writing an ASCII hex value into this file, applications can set the +object ID of the SPU context. +Any previous value of the object ID is overwritten. +.TP +.BR read (2) +Reading this file gives an ASCII hex string representing the object ID +for this SPU context. +.RE +.SH EXAMPLE +.TP +.IR /etc/fstab " entry" +none /spu spufs gid=spu 0 0 +.\" .SH AUTHORS +.\" Arnd Bergmann , Mark Nutter , +.\" Ulrich Weigand , Jeremy Kerr +.SH SEE ALSO +.BR close (2), +.BR spu_create (2), +.BR spu_run (2), +.BR capabilities (7), +.I The Cell Broadband Engine Architecture (CBEA) specification diff --git a/original/man7/standards.7 b/original/man7/standards.7 new file mode 100644 index 00000000..73f736cd --- /dev/null +++ b/original/man7/standards.7 @@ -0,0 +1,256 @@ +.\" Copyright (c) 2006, Michael Kerrisk +.\" includes some material by other authors that was formerly +.\" in intro.2. +.\" +.\" 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. +.\" +.TH STANDARDS 7 2009-06-01 "Linux" "Linux Programmer's Manual" +.SH NAME +standards \- C and UNIX Standards +.SH DESCRIPTION +The CONFORMING TO section that appears in many manual pages identifies +various standards to which the documented interface conforms. +The following list briefly describes these standards. +.TP +.B V7 +Version 7, the ancestral UNIX from Bell Labs. +.TP +.B 4.2BSD +This is an implementation standard defined by the 4.2 release +of the +.IR "Berkeley Software Distribution", +released by the University of California at Berkeley. +This was the first Berkeley release that contained a TCP/IP +stack and the sockets API. +4.2BSD was released in 1983. + +Earlier major BSD releases included \fI3BSD\fP (1980), \fI4BSD\fP (1980), +and \fI4.1BSD\fP (1981). +.TP +.B 4.3BSD +The successor to 4.2BSD, released in 1986. +.TP +.B 4.4BSD +The successor to 4.3BSD, released in 1993. +This was the last major Berkeley release. +.TP +.B System V +This is an implementation standard defined by AT&T's milestone 1983 +release of its commercial System V (five) release. +The previous major AT&T release was +.IR "System III" , +released in 1981. +.TP +.B System V release 2 (SVr2) +This was the next System V release, made in 1985. +The SVr2 was formally described in the +.I "System V Interface Definition version 1" +.RI ( "SVID 1" ) +published in 1985. +.TP +.B System V release 3 (SVr3) +This was the successor to SVr2, released in 1986. +This release was formally described in the +.I "System V Interface Definition version 2" +.RI ( "SVID 2" ). +.TP +.B System V release 4 (SVr4) +This was the successor to SVr3, released in 1989. +This version of System V is described in the "Programmer's Reference +Manual: Operating System API (Intel processors)" (Prentice-Hall +1992, ISBN 0-13-951294-2) +This release was formally described in the +.I "System V Interface Definition version 3" +.RI ( "SVID 3" ), +and is considered the definitive System V release. +.TP +.B SVID 4 +System V Interface Definition version 4, issued in 1995. +Available online at http://www.sco.com/developers/devspecs/ . +.TP +.B C89 +This was the first C language standard, ratified by ANSI +(American National Standards Institute) in 1989 +.RI ( X3.159-1989 ). +Sometimes this is known as +.IR "ANSI C" , +but since C99 is also an +ANSI standard, this term is ambiguous. +This standard was also ratified by +ISO (International Standards Organization) in 1990 +.RI ( "ISO/IEC 9899:1990" ), +and is thus occasionally referred to as +.IR "ISO C90" . +.TP +.B C99 +This revision of the C language standard was ratified by ISO in 1999 +.RI ( "ISO/IEC 9899:1999" ). +Available online at +http://www.open-std.org/jtc1/sc22/wg14/www/standards. +.TP +.B POSIX.1-1990 +"Portable Operating System Interface for Computing Environments". +IEEE 1003.1-1990 part 1, ratified by ISO in 1990 +.RI ( "ISO/IEC 9945-1:1990" ). +The term "POSIX" was coined by Richard Stallman. +.TP +.B POSIX.2 +IEEE Std 1003.2-1992, +describing commands and utilities, ratified by ISO in 1993 +.RI ( "ISO/IEC 9945-2:1993" ). +.TP +.BR POSIX.1b " (formerly known as \fIPOSIX.4\fP)" +IEEE Std 1003.1b-1993 +describing real-time facilities +for portable operating systems, ratified by ISO in 1996 +.RI ( "ISO/IEC 9945-1:1996" ). +.TP +.B POSIX.1c +IEEE Std 1003.1c-1995 describing the POSIX threads interfaces. +.TP +.B POSIX.1d +IEEE Std 1003.1c-1999 describing additional real-time extensions. +.TP +.B POSIX.1g +IEEE Std 1003.1g-2000 describing networking APIs (including sockets). +.TP +.B POSIX.1j +IEEE Std 1003.1j-2000 describing advanced real-time extensions. +.TP +.B POSIX.1-1996 +A 1996 revision of POSIX.1 which incorporated POSIX.1b and POSIX.1c. +.TP +.B XPG3 +Released in 1989, this was the first significant release of the +.IR "X/Open Portability Guide" , +produced by the +X/Open Company, a multivendor consortium. +This multivolume guide was based on the POSIX standards. +.TP +.B XPG4 +A revision of the X/Open Portability Guide, released in 1992. +.TP +.B XPG4v2 +A 1994 revision of XPG4. +This is also referred to as +.IR "Spec 1170" , +where 1170 referred to the number of interfaces +defined by this standard. +.TP +.B SUS (SUSv1) +Single UNIX Specification. +This was a repackaging of XPG4v2 and other X/Open standards +(X/Open Curses Issue 4 version 2, +X/Open Networking Service (XNS) Issue 4). +Systems conforming to this standard can be branded +.IR "UNIX 95" . +.TP +.B SUSv2 +Single UNIX Specification version 2. +Sometimes also referred to as +.IR XPG5 . +This standard appeared in 1997. +Systems conforming to this standard can be branded +.IR "UNIX 98" . +See also +http://www.UNIX-systems.org/version2/ .) +.TP +.B POSIX.1-2001, SUSv3 +This was a 2001 revision and consolidation of the +POSIX.1, POSIX.2, and SUS standards into a single document, +conducted under the auspices of the Austin group +(http://www.opengroup.org/austin/ .) +The standard is available online at +http://www.unix-systems.org/version3/ , +and the interfaces that it describes are also available in the Linux +manual pages package under sections 1p and 3p (e.g., "man 3p open"). + +The standard defines two levels of conformance: +.IR "POSIX conformance" , +which is a baseline set of interfaces required of a conforming system; +and +.IR "XSI Conformance", +which additionally mandates a set of interfaces +(the "XSI extension") which are only optional for POSIX conformance. +XSI-conformant systems can be branded +.IR "UNIX 03" . +(XSI conformance constitutes the +.I "Single UNIX Specification version 3" +.RI ( SUSv3 ).) + +The POSIX.1-2001 document is broken into four parts: + +.BR XBD : +Definitions, terms and concepts, header file specifications. + +.BR XSH : +Specifications of functions (i.e., system calls and library +functions in actual implementations). + +.BR XCU : +Specifications of commands and utilities +(i.e., the area formerly described by POSIX.2). + +.BR XRAT : +Informative text on the other parts of the standard. + +POSIX.1-2001 is aligned with C99, so that all of the +library functions standardized in C99 are also +standardized in POSIX.1-2001. + +Two Technical Corrigenda (minor fixes and improvements) +of the original 2001 standard have occurred: +TC1 in 2003 (referred to as +.IR POSIX.1-2003 ), +and TC2 in 2004 (referred to as +.IR POSIX.1-2004 ). +.TP +.B POSIX.1-2008, SUSv4 +Work on the next revision of POSIX.1/SUS was completed and +ratified in 2008. + +The changes in this revision are not as large as those +that occurred for POSIX.1-2001/SUSv3, +but a number of new interfaces are added +and various details of existing specifications are modified. +Many of the interfaces that were optional in +POSIX.1-2001 become mandatory in the 2008 revision of the standard. +A few interfaces that are present in POSIX.1-2001 are marked +as obsolete in POSIX.1-2008, or removed from the standard altogether. + +The revised standard is broken into the same four parts as POSIX.1-2001, +and again there are two levels of conformance: the baseline +.IR "POSIX Conformance" , +and +.IR "XSI Conformance" , +which mandates an additional set of interfaces +beyond those in the base specification. + +In general, where the CONFORMING TO section of a manual page +lists POSIX.1-2001, it can be assumed that the interface also +conforms to POSIX.1-2008, unless otherwise noted. + +Further information can be found on the Austin group web site, +http://www.opengroup.org/austin/ . +.SH "SEE ALSO" +.BR feature_test_macros (7), +.BR libc (7), +.BR posixoptions (7) diff --git a/original/man7/suffixes.7 b/original/man7/suffixes.7 new file mode 100644 index 00000000..592635cc --- /dev/null +++ b/original/man7/suffixes.7 @@ -0,0 +1,281 @@ +'\" 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 Nicolás 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 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 +.\" +.TH SUFFIXES 7 2000-11-16 "Linux" "Linux Programmer's Manual" +.SH NAME +suffixes \- list of file suffixes +.SH DESCRIPTION +It is customary to indicate the contents of a file with the file suffix, +which consists of a period, followed by one or more letters. +Many standard utilities, such as compilers, use this to recognize the type of +file they are dealing with. +The +.BR make (1) +utility is driven by rules based on file suffix. +.PP +Following is a list of suffixes which are likely to be found on a +Linux system. +.PP +.TS +l | l +_ | _ +lI | l . +Suffix File type + ,v files for RCS (Revision Control System) + - backup file + .C C++ source code, equivalent to \fI.cc\fP + .F Fortran source with \fBcpp\fP(1) directives + or file compressed using freeze + .S assembler source with \fBcpp\fP(1) directives + .Y file compressed using yabba + .Z file compressed using \fBcompress\fP(1) + .[0-9]+gf TeX generic font files + .[0-9]+pk TeX packed font files + .[1-9] manual page for the corresponding section + .[1-9][a-z] manual page for section plus subsection + .a static object code library + .ad X application default resource file + .ada Ada source (may be body, spec, or combination) + .adb Ada body source + .ads Ada spec source + .afm PostScript font metrics + .al Perl autoload file + .am \fBautomake\fP(1) input file + .arc \fBarc\fP(1) archive + .arj \fBarj\fP(1) archive + .asc PGP ASCII-armored data + .asm (GNU) assembler source file + .au Audio sound file + .aux LaTeX auxiliary file + .avi (msvideo) movie + .awk AWK language program + .b LILO boot loader image + .bak backup file + .bash \fBbash\fP(1) shell script + .bb basic block list data produced by + gcc \-ftest\-coverage + .bbg basic block graph data produced by + gcc \-ftest\-coverage + .bbl BibTeX output + .bdf X font file + .bib TeX bibliographic database, BibTeX input + .bm bitmap source + .bmp bitmap + .bz2 file compressed using \fBbzip2\fP(1) + .c C source + .cat message catalog files + .cc C++ source + .cf configuration file + .cfg configuration file + .cgi WWW content generating script or program + .cls LaTeX Class definition + .class Java compiled byte-code + .conf configuration file + .config configuration file + .cpp equivalent to \fI.cc\fR + .csh \fBcsh\fP(1) shell script + .cxx equivalent to \fI.cc\fR + .dat data file + .deb Debian software package + .def Modula-2 source for definition modules + .def other definition files + .desc initial part of mail message unpacked with + \fBmunpack\fP(1) + .diff file differences (\fBdiff\fP(1) command output) + .dir dbm data base directory file + .doc documentation file + .dsc Debian Source Control (source package) + .dtx LaTeX package source file + .dvi TeX's device independent output + .el Emacs-Lisp source + .elc compiled Emacs-Lisp source + .eps encapsulated PostScript + .exp Expect source code + .f Fortran source + .f77 Fortran 77 source + .f90 Fortran 90 source + .fas precompiled Common-Lisp + .fi Fortran include files + .fig FIG image file (used by \fBxfig\fP(1)) + .fmt TeX format file + .gif Compuserve Graphics Image File format + .gmo GNU format message catalog + .gsf Ghostscript fonts + .gz file compressed using \fBgzip\fP(1) + .h C or C++ header files + .help help file + .hf equivalent to \fI.help\fP + .hlp equivalent to \fI.help\fP + .htm poor man's \fI.html\fP + .html HTML document used with the World Wide Web + .hqx 7-bit encoded Macintosh file + .i C source after preprocessing + .icon bitmap source + .idx reference or datum-index file for hypertext + or database system + .image bitmap source + .in configuration template, especially for GNU Autoconf + .info files for the Emacs info browser + .info-[0-9]+ split info files + .ins LaTeX package install file for docstrip + .itcl itcl source code; + itcl ([incr Tcl]) is an OO extension of tcl + .java a Java source file + .jpeg Joint Photographic Experts Group format + .jpg poor man's \fI.jpeg\fP + .kmap \fBlyx\fP(1) keymap + .l equivalent to \fI.lex\fP or \fI.lisp\fP + .lex \fBlex\fP(1) or \fBflex\fP(1) files + .lha lharc archive + .lib Common-Lisp library + .lisp Lisp source + .ln files for use with \fBlint\fP(1) + .log log file, in particular produced by TeX + .lsm Linux Software Map entry + .lsp Common-Lisp source + .lzh lharc archive + .m Objective-C source code + .m4 \fBm4\fP(1) source + .mac macro files for various programs + .man manual page (usually source rather than formatted) + .map map files for various programs + .me Nroff source using the me macro package + .mf Metafont (font generator for TeX) source + .mgp MagicPoint file + .mm sources for \fBgroff\fP(1) in mm - format + .mo Message catalog binary file + .mod Modula-2 source for implementation modules + .mov (quicktime) movie + .mp Metapost source + .mp2 MPEG Layer 2 (audio) file + .mp3 MPEG Layer 3 (audio) file + .mpeg movie file + .o object file + .old old or backup file + .orig backup (original) version of a file, from \fBpatch\fP(1) + .out output file, often executable program (a.out) + .p Pascal source + .pag dbm data base data file + .patch file differences for \fBpatch\fP(1) + .pbm portable bitmap format + .pcf X11 font files + .pdf Adobe Portable Data Format + (use Acrobat/\fBacroread\fP or \fBxpdf\fP) + .perl Perl source (see .ph, .pl and .pm) + .pfa PostScript font definition files, ASCII format + .pfb PostScript font definition files, binary format + .pgm portable greymap format + .pgp PGP binary data + .ph Perl header file + .php PHP program file + .php3 PHP3 program file + .pid File to store daemon PID (e.g., crond.pid) + .pl TeX property list file or Perl library file + .pm Perl module + .png Portable Network Graphics file + .po Message catalog source + .pod \fBperldoc\fP(1) file + .ppm portable pixmap format + .pr bitmap source + .ps PostScript file + .py Python source + .pyc compiled python + .qt quicktime movie + .r RATFOR source (obsolete) + .rej patches that \fBpatch\fP(1) couldn't apply + .rpm RedHat software package + .rtf Rich Text Format file + .rules rules for something + .s assembler source + .sa stub libraries for a.out shared libraries + .sc \fBsc\fP(1) spreadsheet commands + .scm Scheme source code + .sed sed source file + .sgml SGML source file + .sh \fBsh\fP(1) scripts + .shar archive created by the \fBshar\fP(1) utility + .so Shared library or dynamically loadable object + .sql SQL source + .sqml SQML schema or query program + .sty LaTeX style files + .sym Modula-2 compiled definition modules + .tar archive created by the \fBtar\fP(1) utility + .tar.Z tar(1) archive compressed with \fBcompress\fP(1) + .tar.bz2 tar(1) archive compressed with \fBbzip2\fP(1) + .tar.gz tar(1) archive compressed with \fBgzip\fP(1) + .taz tar(1) archive compressed with \fBcompress\fP(1) + .tcl tcl source code + .tex TeX or LaTeX source + .texi equivalent to \fI.texinfo\fP + .texinfo Texinfo documentation source + .text text file + .tfm TeX font metric file + .tgz tar archive compressed with \fBgzip\fP(1) + .tif poor man's \fI.tiff\fP + .tiff Tagged Image File Format + .tk tcl/tk script + .tmp temporary file + .tmpl template files + .txt equivalent to \fI.text\fP + .uu equivalent to \fI.uue\fP + .uue binary file encoded with \fBuuencode\fP(1) + .vf TeX virtual font file + .vpl TeX virtual property list file + .w Silvio Levi's CWEB + .wav wave sound file + .web Donald Knuth's WEB + .wml Source file for Web Meta Language + .xbm X11 bitmap source + .xcf GIMP graphic + .xml eXtended Markup Language file + .xpm X11 pixmap source + .xs Perl xsub file produced by h2xs + .xsl XSL stylesheet + .y \fByacc\fP(1) or \fBbison\fP(1) (parser generator) files + .z File compressed using \fBpack\fP(1) (or an old \fBgzip\fP(1)) + .zip \fBzip\fP(1) archive + .zoo \fBzoo\fP(1) archive + ~ Emacs or \fBpatch\fP(1) backup file + rc startup (`run control') file, e.g., \fI.newsrc\fP +.TE +.SH "CONFORMING TO" +General Unix conventions. +.SH BUGS +This list is not exhaustive. +.SH "SEE ALSO" +.BR file (1), +.BR make (1) diff --git a/original/man7/svipc.7 b/original/man7/svipc.7 new file mode 100644 index 00000000..a29a0185 --- /dev/null +++ b/original/man7/svipc.7 @@ -0,0 +1,333 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 There is now duplication of some of the information +.\" below in semctl.2, msgctl.2, and shmctl.2 -- MTK, Nov 04 +.TH SVIPC 7 2009-01-26 "Linux" "Linux Programmer's Manual" +.SH NAME +svipc \- System V interprocess communication mechanisms +.SH SYNOPSIS +.nf +.B #include +.B #include +.B #include +.B #include +.B #include +.fi +.SH DESCRIPTION +This manual page refers to the Linux implementation of the System V +interprocess communication (IPC) mechanisms: +message queues, semaphore sets, and shared memory segments. +In the following, the word +.I resource +means an instantiation of one among such mechanisms. +.SS Resource Access Permissions +For each resource, the system uses a common structure of type +.I "struct ipc_perm" +to store information needed in determining permissions to perform an +IPC operation. +The +.I ipc_perm +structure, defined by the +.I +system header file, includes the following members: +.in +4n +.nf + +struct ipc_perm { + uid_t cuid; /* creator user ID */ + gid_t cgid; /* creator group ID */ + uid_t uid; /* owner user ID */ + gid_t gid; /* owner group ID */ + unsigned short mode; /* r/w permissions */ +}; +.fi +.in +.PP +The +.I mode +member of the +.I ipc_perm +structure defines, with its lower 9 bits, the access permissions to the +resource for a process executing an IPC system call. +The permissions are interpreted as follows: +.sp +.nf + 0400 Read by user. + 0200 Write by user. +.sp .5 + 0040 Read by group. + 0020 Write by group. +.sp .5 + 0004 Read by others. + 0002 Write by others. +.fi +.PP +Bits 0100, 0010, and 0001 (the execute bits) are unused by the system. +Furthermore, +"write" +effectively means +"alter" +for a semaphore set. +.PP +The same system header file also defines the following symbolic +constants: +.TP 14 +.B IPC_CREAT +Create entry if key doesn't exist. +.TP +.B IPC_EXCL +Fail if key exists. +.TP +.B IPC_NOWAIT +Error if request must wait. +.TP +.B IPC_PRIVATE +Private key. +.TP +.B IPC_RMID +Remove resource. +.TP +.B IPC_SET +Set resource options. +.TP +.B IPC_STAT +Get resource options. +.PP +Note that +.B IPC_PRIVATE +is a +.I key_t +type, while all the other symbolic constants are flag fields and can +be OR'ed into an +.I int +type variable. +.SS Message Queues +A message queue is uniquely identified by a positive integer +.RI "(its " msqid ) +and has an associated data structure of type +.IR "struct msqid_ds" , +defined in +.IR , +containing the following members: +.in +4n +.nf + +struct msqid_ds { + struct ipc_perm msg_perm; + msgqnum_t msg_qnum; /* no of messages on queue */ + msglen_t msg_qbytes; /* bytes max on a queue */ + pid_t msg_lspid; /* PID of last msgsnd(2) call */ + pid_t msg_lrpid; /* PID of last msgrcv(2) call */ + time_t msg_stime; /* last msgsnd(2) time */ + time_t msg_rtime; /* last msgrcv(2) time */ + time_t msg_ctime; /* last change time */ +}; +.fi +.in +.TP 11 +.I msg_perm +.I ipc_perm +structure that specifies the access permissions on the message +queue. +.TP +.I msg_qnum +Number of messages currently on the message queue. +.TP +.I msg_qbytes +Maximum number of bytes of message text allowed on the message +queue. +.TP +.I msg_lspid +ID of the process that performed the last +.BR msgsnd (2) +system call. +.TP +.I msg_lrpid +ID of the process that performed the last +.BR msgrcv (2) +system call. +.TP +.I msg_stime +Time of the last +.BR msgsnd (2) +system call. +.TP +.I msg_rtime +Time of the last +.BR msgrcv (2) +system call. +.TP +.I msg_ctime +Time of the last +system call that changed a member of the +.I msqid_ds +structure. +.SS Semaphore Sets +A semaphore set is uniquely identified by a positive integer +.RI "(its " semid ) +and has an associated data structure of type +.IR "struct semid_ds" , +defined in +.IR , +containing the following members: +.in +4n +.nf + +struct semid_ds { + struct ipc_perm sem_perm; + time_t sem_otime; /* last operation time */ + time_t sem_ctime; /* last change time */ + unsigned long sem_nsems; /* count of sems in set */ +}; +.fi +.in +.TP 11 +.I sem_perm +.I ipc_perm +structure that specifies the access permissions on the semaphore +set. +.TP +.I sem_otime +Time of last +.BR semop (2) +system call. +.TP +.I sem_ctime +Time of last +.BR semctl (2) +system call that changed a member of the above structure or of one +semaphore belonging to the set. +.TP +.I sem_nsems +Number of semaphores in the set. +Each semaphore of the set is referenced by a nonnegative integer +ranging from +.B 0 +to +.IR sem_nsems\-1 . +.PP +A semaphore is a data structure of type +.I "struct sem" +containing the following members: +.in +4n +.nf + +struct sem { + int semval; /* semaphore value */ + int sempid; /* PID for last operation */ +.\" unsigned short semncnt; /* nr awaiting semval to increase */ +.\" unsigned short semzcnt; /* nr awaiting semval = 0 */ +}; +.fi +.in +.TP 11 +.I semval +Semaphore value: a nonnegative integer. +.TP +.I sempid +ID of the last process that performed a semaphore operation +on this semaphore. +.\".TP +.\".I semncnt +.\"Number of processes suspended awaiting for +.\".I semval +.\"to increase. +.\".TP +.\".I semznt +.\"Number of processes suspended awaiting for +.\".I semval +.\"to become zero. +.SS Shared Memory Segments +A shared memory segment is uniquely identified by a positive integer +.RI "(its " shmid ) +and has an associated data structure of type +.IR "struct shmid_ds" , +defined in +.IR , +containing the following members: +.in +4n +.nf + +struct shmid_ds { + struct ipc_perm shm_perm; + size_t shm_segsz; /* size of segment */ + pid_t shm_cpid; /* PID of creator */ + pid_t shm_lpid; /* PID, last operation */ + shmatt_t shm_nattch; /* no. of current attaches */ + time_t shm_atime; /* time of last attach */ + time_t shm_dtime; /* time of last detach */ + time_t shm_ctime; /* time of last change */ +}; +.fi +.in +.TP 11 +.I shm_perm +.I ipc_perm +structure that specifies the access permissions on the shared memory +segment. +.TP +.I shm_segsz +Size in bytes of the shared memory segment. +.TP +.I shm_cpid +ID of the process that created the shared memory segment. +.TP +.I shm_lpid +ID of the last process that executed a +.BR shmat (2) +or +.BR shmdt (2) +system call. +.TP +.I shm_nattch +Number of current alive attaches for this shared memory segment. +.TP +.I shm_atime +Time of the last +.BR shmat (2) +system call. +.TP +.I shm_dtime +Time of the last +.BR shmdt (2) +system call. +.TP +.I shm_ctime +Time of the last +.BR shmctl (2) +system call that changed +.IR shmid_ds . +.SH "SEE ALSO" +.BR ipc (2), +.BR msgctl (2), +.BR msgget (2), +.BR msgrcv (2), +.BR msgsnd (2), +.BR semctl (2), +.BR semget (2), +.BR semop (2), +.BR shmat (2), +.BR shmctl (2), +.BR shmdt (2), +.BR shmget (2), +.BR ftok (3) diff --git a/original/man7/symlink.7 b/original/man7/symlink.7 new file mode 100644 index 00000000..2781e506 --- /dev/null +++ b/original/man7/symlink.7 @@ -0,0 +1,487 @@ +.\"- +.\" 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. +.\" +.TH SYMLINK 7 2008-06-18 "Linux" "Linux Programmer's Manual" +.SH NAME +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 +.IR "i-node number" , +where an i-node number is an index into the i-node table, +which contains metadata about all files on a file system. +See +.BR stat (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 +.IR "dangling link" . + +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 +.BR lchown (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 +.BR stat (2)). + +The last access and last modification timestamps +of a symbolic link can be changed using +.BR utimensat (2) +or +.BR lutimes (3). + +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), +.\" Linux does not currently implement an lchmod(2). +and can't be changed. +.\" +.\" 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. +.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 +.I follow +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 +.I slink +which pointed to a file named +.IR afile , +the system call +.I "open(""slink"" ...\&)" +would return a file descriptor referring to the file +.IR afile . + +Various system calls do not follow links, and operate +on the symbolic link itself. +They are: +.BR lchown (2), +.BR lgetxattr (2), +.BR llistxattr (2), +.BR lremovexattr (2), +.BR lsetxattr (2), +.BR lstat (2), +.BR readlink (2), +.BR rename (2), +.BR rmdir (2), +and +.BR unlink (2). +Certain other system calls optionally follow symbolic links. +They are: +.BR faccessat (2), +.\" Maybe one day: .BR fchownat (2) +.BR fchownat (2), +.BR fstatat (2), +.BR linkat (2), +.BR open (2), +.BR openat (2), +and +.BR utimensat (2); +see their manual pages for details. +Because +.BR remove (3) +is an alias for +.BR unlink (2), +that library function also does not follow symbolic links. +When +.BR rmdir (2) +is applied to a symbolic link, it fails with the error +.BR ENOTDIR . +The +.BR link (2) +warrants special discussion. +POSIX.1-2001 specifies that +.BR link (2) +should dereference +.I oldpath +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 +.I slink +which pointed to a file named +.IR afile , +the command +.I "cat slink" +would display the contents of the file +.IR afile . + +It is important to realize that this rule includes commands which may +optionally traverse file trees, e.g., the command +.I "chown file" +is included in this rule, while the command +.IR "chown\ \-R file" , +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 +.I "chown slink" +change the ownership of the file that +.I slink +is, whether it is a symbolic link or not, the +.I \-h +option should be used. +In the above example, +.I "chown root slink" +would change the ownership of the file referred to by +.IR slink , +while +.I "chown\ \-h root slink" +would change the ownership of +.I slink +itself. + +There are some exceptions to this rule: +.IP * 2 +The +.BR mv (1) +and +.BR rm (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 +.BR ls (1) +command is also an exception to this rule. +For compatibility with historic systems (when +.BR ls (1) +is not doing a tree walk, i.e., the +.I \-R +option is not specified), +the +.BR ls (1) +command follows symbolic links named as arguments if the +.I \-H +or +.I \-L +option is specified, +or if the +.IR \-F , +.IR \-d , +or +.I \-l +options are not specified. +(The +.BR ls (1) +command is the only command where the +.I \-H +and +.I \-L +options affect its behavior even though it is not doing a walk of +a file tree.) +.IP * +The +.BR file (1) +command is also an exception to this rule. +The +.BR file (1) +command does not follow symbolic links named as argument by default. +The +.BR file (1) +command does follow symbolic links named as argument if the +.I \-L +option is specified. +.\" +.\"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. +.SS Commands traversing a file tree +The following commands either optionally or always traverse file trees: +.BR chgrp (1), +.BR chmod (1), +.BR chown (1), +.BR cp (1), +.BR du (1), +.BR find (1), +.BR ls (1), +.BR pax (1), +.BR rm (1), +and +.BR tar (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 +.I "rm\ \-r slink directory" +will remove +.IR slink , +as well as any symbolic links encountered in the tree traversal of +.IR directory , +because symbolic links may be removed. +In no case will +.BR rm (1) +affect the file referred to by +.IR slink . + +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 +.I \-H +(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 +.I \-H +flag will be ignored if the +.I \-R +flag is not also specified.) + +For example, the command +.I "chown\ \-HR user slink" +will traverse the file hierarchy rooted in the file pointed to by +.IR slink . +Note, the +.I \-H +is not the same as the previously discussed +.I \-h +flag. +The +.I \-H +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 +.I \-L +(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 +.I \-L +flag will be ignored if the +.I \-R +flag is not also specified.) + +For example, the command +.I "chown\ \-LR user slink" +will change the owner of the file referred to by +.IR slink . +If +.I slink +refers to a directory, +.B chown +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 +.B chown +traverses, they will be treated in the same fashion as +.IR slink . +.IP * +A command can be made to +provide the default behavior by specifying the +.I \-P +(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 +.IR \-H , +.IR \-L , +and +.I \-P +flags are ignored if the +.I \-R +flag is not also specified. +In addition, you may specify the +.IR \-H , +.IR \-L , +and +.I \-P +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 +.BR ls (1) +and +.BR rm (1) +commands have exceptions to these rules: +.IP * 2 +The +.BR rm (1) +command operates on the symbolic link, and not the file it references, +and therefore never follows a symbolic link. +The +.BR rm (1) +command does not support the +.IR \-H , +.IR \-L , +or +.I \-P +options. +.IP * +To maintain compatibility with historic systems, +the +.BR ls (1) +command acts a little differently. +If you do not specify the +.IR \-F , +.IR \-d +or +.I \-l +options, +.BR ls (1) +will follow symbolic links specified on the command line. +If the +.I \-L +flag is specified, +.BR ls (1) +follows all symbolic links, +regardless of their type, +whether specified on the command line or encountered in the tree walk. +.SH SEE ALSO +.BR chgrp (1), +.BR chmod (1), +.BR find (1), +.BR ln (1), +.BR ls (1), +.BR mv (1), +.BR rm (1), +.BR lchown (2), +.BR link (2), +.BR lstat (2), +.BR readlink (2), +.BR rename (2), +.BR symlink (2), +.BR unlink (2), +.BR utimensat (2), +.BR lutimes (3), +.BR path_resolution (7) diff --git a/original/man7/tcp.7 b/original/man7/tcp.7 new file mode 100644 index 00000000..d116c679 --- /dev/null +++ b/original/man7/tcp.7 @@ -0,0 +1,1135 @@ +.\" This man page is Copyright (C) 1999 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. +.\" +.\" 2.4 Updates by Nivedita Singhvi 4/20/02 . +.\" Modified, 2004-11-11, Michael Kerrisk and Andries Brouwer +.\" Updated details of interaction of TCP_CORK and TCP_NODELAY. +.\" +.\" 2008-11-21, mtk, many, many updates. +.\" The descriptions of /proc files and socket options should now +.\" be more or less up to date and complete as at Linux 2.6.27 +.\" (other than the remaining FIXMEs in the page source below). +.\" +.TH TCP 7 2009-09-30 "Linux" "Linux Programmer's Manual" +.SH NAME +tcp \- TCP protocol +.SH SYNOPSIS +.B #include +.br +.B #include +.br +.B #include +.sp +.B tcp_socket = socket(AF_INET, SOCK_STREAM, 0); +.SH DESCRIPTION +This is an implementation of the TCP protocol defined in +RFC\ 793, RFC\ 1122 and RFC\ 2001 with the NewReno and SACK +extensions. +It provides a reliable, stream-oriented, +full-duplex connection between two sockets on top of +.BR ip (7), +for both v4 and v6 versions. +TCP guarantees that the data arrives in order and +retransmits lost packets. +It generates and checks a per-packet checksum to catch +transmission errors. +TCP does not preserve record boundaries. + +A newly created TCP socket has no remote or local address and is not +fully specified. +To create an outgoing TCP connection use +.BR connect (2) +to establish a connection to another TCP socket. +To receive new incoming connections, first +.BR bind (2) +the socket to a local address and port and then call +.BR listen (2) +to put the socket into the listening state. +After that a new socket for each incoming connection can be accepted using +.BR accept (2). +A socket which has had +.BR accept (2) +or +.BR connect (2) +successfully called on it is fully specified and may transmit data. +Data cannot be transmitted on listening or not yet connected sockets. + +Linux supports RFC\ 1323 TCP high performance +extensions. +These include Protection Against Wrapped +Sequence Numbers (PAWS), Window Scaling and Timestamps. +Window scaling allows the use +of large (> 64K) TCP windows in order to support links with high +latency or bandwidth. +To make use of them, the send and receive buffer sizes must be increased. +They can be set globally with the +.I /proc/sys/net/ipv4/tcp_wmem +and +.I /proc/sys/net/ipv4/tcp_rmem +files, or on individual sockets by using the +.B SO_SNDBUF +and +.B SO_RCVBUF +socket options with the +.BR setsockopt (2) +call. + +The maximum sizes for socket buffers declared via the +.B SO_SNDBUF +and +.B SO_RCVBUF +mechanisms are limited by the values in the +.I /proc/sys/net/core/rmem_max +and +.I /proc/sys/net/core/wmem_max +files. +Note that TCP actually allocates twice the size of +the buffer requested in the +.BR setsockopt (2) +call, and so a succeeding +.BR getsockopt (2) +call will not return the same size of buffer as requested in the +.BR setsockopt (2) +call. +TCP uses the extra space for administrative purposes and internal +kernel structures, and the +.I /proc +file values reflect the +larger sizes compared to the actual TCP windows. +On individual connections, the socket buffer size must be set prior to the +.BR listen (2) +or +.BR connect (2) +calls in order to have it take effect. +See +.BR socket (7) +for more information. +.PP +TCP supports urgent data. +Urgent data is used to signal the +receiver that some important message is part of the data +stream and that it should be processed as soon as possible. +To send urgent data specify the +.B MSG_OOB +option to +.BR send (2). +When urgent data is received, the kernel sends a +.B SIGURG +signal to the process or process group that has been set as the +socket "owner" using the +.B SIOCSPGRP +or +.B FIOSETOWN +ioctls (or the POSIX.1-2001-specified +.BR fcntl (2) +.B F_SETOWN +operation). +When the +.B SO_OOBINLINE +socket option is enabled, urgent data is put into the normal +data stream (a program can test for its location using the +.B SIOCATMARK +ioctl described below), +otherwise it can be only received when the +.B MSG_OOB +flag is set for +.BR recv (2) +or +.BR recvmsg (2). + +Linux 2.4 introduced a number of changes for improved +throughput and scaling, as well as enhanced functionality. +Some of these features include support for zero-copy +.BR sendfile (2), +Explicit Congestion Notification, new +management of TIME_WAIT sockets, keep-alive socket options +and support for Duplicate SACK extensions. +.SS Address Formats +TCP is built on top of IP (see +.BR ip (7)). +The address formats defined by +.BR ip (7) +apply to TCP. +TCP only supports point-to-point +communication; broadcasting and multicasting are not +supported. +.SS /proc interfaces +System-wide TCP parameter settings can be accessed by files in the directory +.IR /proc/sys/net/ipv4/ . +In addition, most IP +.I /proc +interfaces also apply to TCP; see +.BR ip (7). +Variables described as +.I Boolean +take an integer value, with a nonzero value ("true") meaning that +the corresponding option is enabled, and a zero value ("false") +meaning that the option is disabled. +.TP +.IR tcp_abc " (Integer; default: 0; since Linux 2.6.15)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +Control the Appropriate Byte Count (ABC), defined in RFC 3465. +ABC is a way of increasing the congestion window +.RI ( cwnd ) +more slowly in response to partial acknowledgments. +Possible values are: +.RS +.IP 0 3 +increase +.I cwnd +once per acknowledgment (no ABC) +.IP 1 +increase +.I cwnd +once per acknowledgment of full sized segment +.IP 2 +allow increase +.I cwnd +by two if acknowledgment is +of two segments to compensate for delayed acknowledgments. +.RE +.TP +.IR tcp_abort_on_overflow " (Boolean; default: disabled; since Linux 2.4)" +.\" Since 2.3.41 +Enable resetting connections if the listening service is too +slow and unable to keep up and accept them. +It means that if overflow occurred due +to a burst, the connection will recover. +Enable this option +.I only +if you are really sure that the listening daemon +cannot be tuned to accept connections faster. +Enabling this option can harm the clients of your server. +.TP +.IR tcp_adv_win_scale " (integer; default: 2; since Linux 2.4)" +.\" Since 2.4.0-test7 +Count buffering overhead as +.IR "bytes/2^tcp_adv_win_scale" , +if +.I tcp_adv_win_scale +is greater than 0; or +.IR "bytes-bytes/2^(\-tcp_adv_win_scale)" , +if +.I tcp_adv_win_scale +is less than or equal to zero. + +The socket receive buffer space is shared between the +application and kernel. +TCP maintains part of the buffer as +the TCP window, this is the size of the receive window +advertised to the other end. +The rest of the space is used +as the "application" buffer, used to isolate the network +from scheduling and application latencies. +The +.I tcp_adv_win_scale +default value of 2 implies that the space +used for the application buffer is one fourth that of the total. +.TP +.IR tcp_allowed_congestion_control " (String; default: see text; since Linux 2.4.20)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +Show/set the congestion control algorithm choices available to unprivileged +processes (see the description of the +.B TCP_CONGESTION +socket option). +The list is a subset of those listed in +.IR tcp_available_congestion_control . +.\" FIXME How are the items in this delimited? Null bytes, spaces, commas? +The default value for this list is "reno" plus the default setting of +.IR tcp_congestion_control . +.TP +.IR tcp_available_congestion_control " (String; read-only; since Linux 2.4.20)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +Show a list of the congestion-control algorithms +that are registered. +.\" FIXME How are the items in this delimited? Null bytes, spaces, commas? +This list is a limiting set for the list in +.IR tcp_allowed_congestion_control . +More congestion-control algorithms may be available as modules, +but not loaded. +.TP +.IR tcp_app_win " (integer; default: 31; since Linux 2.4)" +.\" Since 2.4.0-test7 +This variable defines how many +bytes of the TCP window are reserved for buffering overhead. + +A maximum of (\fIwindow/2^tcp_app_win\fP, mss) bytes in the window +are reserved for the application buffer. +A value of 0 implies that no amount is reserved. +.\" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_base_mss " (Integer; default: 512; since Linux 2.6.17) +The initial value of +.I search_low +to be used by the packetization layer Path MTU discovery (MTU probing). +If MTU probing is enabled, +this is the initial MSS used by the connection. +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_bic " (Boolean; default: disabled; Linux 2.4.27/2.6.6 to 2.6.13)" +Enable BIC TCP congestion control algorithm. +BIC-TCP is a sender-side only change that ensures a linear RTT +fairness under large windows while offering both scalability and +bounded TCP-friendliness. +The protocol combines two schemes +called additive increase and binary search increase. +When the congestion window is large, additive increase with a large +increment ensures linear RTT fairness as well as good scalability. +Under small congestion windows, binary search +increase provides TCP friendliness. +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_bic_low_window " (integer; default: 14; Linux 2.4.27/2.6.6 to 2.6.13)" +Set the threshold window (in packets) where BIC TCP starts to +adjust the congestion window. +Below this threshold BIC TCP behaves the same as the default TCP Reno. +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_bic_fast_convergence " (Boolean; default: enabled; Linux 2.4.27/2.6.6 to 2.6.13)" +Force BIC TCP to more quickly respond to changes in congestion window. +Allows two flows sharing the same connection to converge more rapidly. +.TP +.IR tcp_congestion_control " (String; default: see text; since Linux 2.4.13)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +Set the default congestion-control algorithm to be used for new connections. +The algorithm "reno" is always available, +but additional choices may be available depending on kernel configuration. +The default value for this file is set as part of kernel configuration. +.TP +.IR tcp_dma_copybreak " (integer; default: 4096; since Linux 2.6.24)" +Lower limit, in bytes, of the size of socket reads that will be +offloaded to a DMA copy engine, if one is present in the system +and the kernel was configured with the +.B CONFIG_NET_DMA +option. +.TP +.IR tcp_dsack " (Boolean; default: enabled; since Linux 2.4)" +.\" Since 2.4.0-test7 +Enable RFC\ 2883 TCP Duplicate SACK support. +.TP +.IR tcp_ecn " (Boolean; default: disabled; since Linux 2.4)" +.\" Since 2.4.0-test7 +Enable RFC\ 2884 Explicit Congestion Notification. +When enabled, connectivity to some +destinations could be affected due to older, misbehaving +routers along the path causing connections to be dropped. +.TP +.IR tcp_fack " (Boolean; default: enabled; since Linux 2.2)" +.\" Since 2.1.92 +Enable TCP Forward Acknowledgement support. +.TP +.IR tcp_fin_timeout " (integer; default: 60; since Linux 2.2)" +.\" Since 2.1.53 +This specifies how many seconds to wait for a final FIN packet before the +socket is forcibly closed. +This is strictly a violation of the TCP specification, +but required to prevent denial-of-service attacks. +In Linux 2.2, the default value was 180. +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_frto " (integer; default: 0; since Linux 2.4.21/2.6)" +.\" Since 2.4.21/2.5.43 +Enable F-RTO, an enhanced recovery algorithm for TCP retransmission +timeouts (RTOs). +It is particularly beneficial in wireless environments +where packet loss is typically due to random radio interference +rather than intermediate router congestion. +See RFC 4138 for more details. + +This file can have one of the following values: +.RS +.IP 0 3 +Disabled. +.IP 1 +The basic version F-RTO algorithm is enabled. +.IP 2 +Enable SACK-enhanced F-RTO if flow uses SACK. +The basic version can be used also when +SACK is in use though in that case scenario(s) exists where F-RTO +interacts badly with the packet counting of the SACK-enabled TCP flow. +.RE +.IP +Before Linux 2.6.22, this parameter was a Boolean value, +supporting just values 0 and 1 above. +.TP +.IR tcp_frto_response " (integer; default: 0; since Linux 2.6.22)" +When F-RTO has detected that a TCP retransmission timeout was spurious +(i.e, the timeout would have been avoided had TCP set a +longer retransmission timeout), +TCP has several options concerning what to do next. +Possible values are: +.RS +.IP 0 3 +Rate halving based; a smooth and conservative response, +results in halved congestion window +.RI ( cwnd ) +and slow-start threshold +.RI ( ssthresh ) +after one RTT. +.IP 1 +Very conservative response; not recommended because even +though being valid, it interacts poorly with the rest of Linux TCP; halves +.I cwnd +and +.I ssthresh +immediately. +.IP 2 +Aggressive response; undoes congestion-control measures +that are now known to be unnecessary +(ignoring the possibility of a lost retransmission that would require +TCP to be more cautious); +.I cwnd +and +.I ssthresh +are restored to the values prior to timeout. +.RE +.TP +.IR tcp_keepalive_intvl " (integer; default: 75; since Linux 2.4)" +.\" Since 2.3.18 +The number of seconds between TCP keep-alive probes. +.TP +.IR tcp_keepalive_probes " (integer; default: 9; since Linux 2.2)" +.\" Since 2.1.43 +The maximum number of TCP keep-alive probes to send +before giving up and killing the connection if +no response is obtained from the other end. +.TP +.IR tcp_keepalive_time " (integer; default: 7200; since Linux 2.2)" +.\" Since 2.1.43 +The number of seconds a connection needs to be idle +before TCP begins sending out keep-alive probes. +Keep-alives are only sent when the +.B SO_KEEPALIVE +socket option is enabled. +The default value is 7200 seconds (2 hours). +An idle connection is terminated after +approximately an additional 11 minutes (9 probes an interval +of 75 seconds apart) when keep-alive is enabled. + +Note that underlying connection tracking mechanisms and +application timeouts may be much shorter. +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_low_latency " (Boolean; default: disabled; since Linux 2.4.21/2.6)" +.\" Since 2.4.21/2.5.60 +If enabled, the TCP stack makes decisions that prefer lower +latency as opposed to higher throughput. +It this option is disabled, then higher throughput is preferred. +An example of an application where this default should be +changed would be a Beowulf compute cluster. +.TP +.IR tcp_max_orphans " (integer; default: see below; since Linux 2.4)" +.\" Since 2.3.41 +The maximum number of orphaned (not attached to any user file +handle) TCP sockets allowed in the system. +When this number is exceeded, +the orphaned connection is reset and a warning is printed. +This limit exists only to prevent simple denial-of-service attacks. +Lowering this limit is not recommended. +Network conditions might require you to increase the number of +orphans allowed, but note that each orphan can eat up to ~64K +of unswappable memory. +The default initial value is set equal to the kernel parameter NR_FILE. +This initial default is adjusted depending on the memory in the system. +.TP +.IR tcp_max_syn_backlog " (integer; default: see below; since Linux 2.2)" +.\" Since 2.1.53 +The maximum number of queued connection requests which have +still not received an acknowledgement from the connecting client. +If this number is exceeded, the kernel will begin +dropping requests. +The default value of 256 is increased to +1024 when the memory present in the system is adequate or +greater (>= 128Mb), and reduced to 128 for those systems with +very low memory (<= 32Mb). +It is recommended that if this +needs to be increased above 1024, TCP_SYNQ_HSIZE in +.I include/net/tcp.h +be modified to keep +TCP_SYNQ_HSIZE*16<=tcp_max_syn_backlog, and the kernel be +recompiled. +.TP +.IR tcp_max_tw_buckets " (integer; default: see below; since Linux 2.4)" +.\" Since 2.3.41 +The maximum number of sockets in TIME_WAIT state allowed in +the system. +This limit exists only to prevent simple denial-of-service attacks. +The default value of NR_FILE*2 is adjusted +depending on the memory in the system. +If this number is +exceeded, the socket is closed and a warning is printed. +.TP +.IR tcp_moderate_rcvbuf " (Boolean; default: enabled; since Linux 2.4.17/2.6.7)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +If enabled, TCP performs receive buffer auto-tuning, +attempting to automatically size the buffer (no greater than +.IR tcp_rmem[2] ) +to match the size required by the path for full throughput. +.TP +.IR tcp_mem " (since Linux 2.4) +.\" Since 2.4.0-test7 +This is a vector of 3 integers: [low, pressure, high]. +These bounds, measured in units of the system page size, +are used by TCP to track its memory usage. +The defaults are calculated at boot time from the amount of +available memory. +(TCP can only use +.I "low memory" +for this, which is limited to around 900 megabytes on 32-bit systems. +64-bit systems do not suffer this limitation.) +.RS +.TP 10 +.I low +TCP doesn't regulate its memory allocation when the number +of pages it has allocated globally is below this number. +.TP +.I pressure +When the amount of memory allocated by TCP +exceeds this number of pages, TCP moderates its memory consumption. +This memory pressure state is exited +once the number of pages allocated falls below +the +.I low +mark. +.TP +.I high +The maximum number of pages, globally, that TCP will allocate. +This value overrides any other limits imposed by the kernel. +.RE +.TP +.IR tcp_mtu_probing " (integer; default: 0; since Linux 2.6.17)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +This parameter controls TCP Packetization-Layer Path MTU Discovery. +The following values may be assigned to the file: +.RS +.IP 0 3 +Disabled +.IP 1 +Disabled by default, enabled when an ICMP black hole detected +.IP 2 +Always enabled, use initial MSS of +.IR tcp_base_mss . +.RE +.TP +.IR tcp_no_metrics_save " (Boolean; default: disabled; since Linux 2.6.6)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +By default, TCP saves various connection metrics in the route cache +when the connection closes, so that connections established in the +near future can use these to set initial conditions. +Usually, this increases overall performance, +but it may sometimes cause performance degradation. +If +.I tcp_no_metrics_save +is enabled, TCP will not cache metrics on closing connections. +.TP +.IR tcp_orphan_retries " (integer; default: 8; since Linux 2.4)" +.\" Since 2.3.41 +The maximum number of attempts made to probe the other +end of a connection which has been closed by our end. +.TP +.IR tcp_reordering " (integer; default: 3; since Linux 2.4)" +.\" Since 2.4.0-test7 +The maximum a packet can be reordered in a TCP packet stream +without TCP assuming packet loss and going into slow start. +It is not advisable to change this number. +This is a packet reordering detection metric designed to +minimize unnecessary back off and retransmits provoked by +reordering of packets on a connection. +.TP +.IR tcp_retrans_collapse " (Boolean; default: enabled; since Linux 2.2)" +.\" Since 2.1.96 +Try to send full-sized packets during retransmit. +.TP +.IR tcp_retries1 " (integer; default: 3; since Linux 2.2)" +.\" Since 2.1.43 +The number of times TCP will attempt to retransmit a +packet on an established connection normally, +without the extra effort of getting the network layers involved. +Once we exceed this number of +retransmits, we first have the network layer +update the route if possible before each new retransmit. +The default is the RFC specified minimum of 3. +.TP +.IR tcp_retries2 " (integer; default: 15; since Linux 2.2)" +.\" Since 2.1.43 +The maximum number of times a TCP packet is retransmitted +in established state before giving up. +The default value is 15, which corresponds to a duration of +approximately between 13 to 30 minutes, depending +on the retransmission timeout. +The RFC\ 1122 specified +minimum limit of 100 seconds is typically deemed too short. +.TP +.IR tcp_rfc1337 " (Boolean; default: disabled; since Linux 2.2)" +.\" Since 2.1.90 +Enable TCP behavior conformant with RFC\ 1337. +When disabled, +if a RST is received in TIME_WAIT state, we close +the socket immediately without waiting for the end +of the TIME_WAIT period. +.TP +.IR tcp_rmem " (since Linux 2.4)" +.\" Since 2.4.0-test7 +This is a vector of 3 integers: [min, default, max]. +These parameters are used by TCP to regulate receive buffer sizes. +TCP dynamically adjusts the size of the +receive buffer from the defaults listed below, in the range +of these values, depending on memory available in the system. +.RS +.TP 10 +.I min +minimum size of the receive buffer used by each TCP socket. +The default value is the system page size. +(On Linux 2.4, the default value is 4K, lowered to +.B PAGE_SIZE +bytes in low-memory systems.) +This value +is used to ensure that in memory pressure mode, +allocations below this size will still succeed. +This is not +used to bound the size of the receive buffer declared +using +.B SO_RCVBUF +on a socket. +.TP +.I default +the default size of the receive buffer for a TCP socket. +This value overwrites the initial default buffer size from +the generic global +.I net.core.rmem_default +defined for all protocols. +The default value is 87380 bytes. +(On Linux 2.4, this will be lowered to 43689 in low-memory systems.) +If larger receive buffer sizes are desired, this value should +be increased (to affect all sockets). +To employ large TCP windows, the +.I net.ipv4.tcp_window_scaling +must be enabled (default). +.TP +.I max +the maximum size of the receive buffer used by each TCP socket. +This value does not override the global +.IR net.core.rmem_max . +This is not used to limit the size of the receive buffer declared using +.B SO_RCVBUF +on a socket. +The default value is calculated using the formula + + max(87380, min(4MB, \fItcp_mem\fP[1]*PAGE_SIZE/128)) + +(On Linux 2.4, the default is 87380*2 bytes, +lowered to 87380 in low-memory systems). +.RE +.TP +.IR tcp_sack " (Boolean; default: enabled; since Linux 2.2)" +.\" Since 2.1.36 +Enable RFC\ 2018 TCP Selective Acknowledgements. +.TP +.IR tcp_slow_start_after_idle " (Boolean; default: enabled; since Linux 2.6.18)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +If enabled, provide RFC 2861 behavior and time out the congestion +window after an idle period. +An idle period is defined as the current RTO (retransmission timeout). +If disabled, the congestion window will not +be timed out after an idle period. +.TP +.IR tcp_stdurg " (Boolean; default: disabled; since Linux 2.2)" +.\" Since 2.1.44 +If this option is enabled, then use the RFC\ 1122 interpretation +of the TCP urgent-pointer field. +.\" RFC 793 was ambiguous in its specification of the meaning of the +.\" urgent pointer. RFC 1122 (and RFC 961) fixed on a particular +.\" resolution of this ambiguity (unfortunately the "wrong" one). +According to this interpretation, the urgent pointer points +to the last byte of urgent data. +If this option is disabled, then use the BSD-compatible interpretation of +the urgent pointer: +the urgent pointer points to the first byte after the urgent data. +Enabling this option may lead to interoperability problems. +.TP +.IR tcp_syn_retries " (integer; default: 5; since Linux 2.2)" +.\" Since 2.1.38 +The maximum number of times initial SYNs for an active TCP +connection attempt will be retransmitted. +This value should not be higher than 255. +The default value is 5, which corresponds to approximately 180 seconds. +.TP +.IR tcp_synack_retries " (integer; default: 5; since Linux 2.2)" +.\" Since 2.1.38 +The maximum number of times a SYN/ACK segment +for a passive TCP connection will be retransmitted. +This number should not be higher than 255. +.TP +.IR tcp_syncookies " (Boolean; since Linux 2.2)" +.\" Since 2.1.43 +Enable TCP syncookies. +The kernel must be compiled with +.BR CONFIG_SYN_COOKIES . +Send out syncookies when the syn backlog queue of a socket overflows. +The syncookies feature attempts to protect a +socket from a SYN flood attack. +This should be used as a last resort, if at all. +This is a violation of the TCP protocol, +and conflicts with other areas of TCP such as TCP extensions. +It can cause problems for clients and relays. +It is not recommended as a tuning mechanism for heavily +loaded servers to help with overloaded or misconfigured conditions. +For recommended alternatives see +.IR tcp_max_syn_backlog , +.IR tcp_synack_retries , +and +.IR tcp_abort_on_overflow . +.TP +.IR tcp_timestamps " (Boolean; default: enabled; since Linux 2.2)" +.\" Since 2.1.36 +Enable RFC\ 1323 TCP timestamps. +.TP +.IR tcp_tso_win_divisor " (integer; default: 3; since Linux 2.6.9)" +This parameter controls what percentage of the congestion window +can be consumed by a single TCP Segmentation Offload (TSO) frame. +The setting of this parameter is a tradeoff between burstiness and +building larger TSO frames. +.TP +.IR tcp_tw_recycle " (Boolean; default: disabled; since Linux 2.4)" +.\" Since 2.3.15 +Enable fast recycling of TIME_WAIT sockets. +Enabling this option is not +recommended since this causes problems when working +with NAT (Network Address Translation). +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_tw_reuse " (Boolean; default: disabled; since Linux 2.4.19/2.6)" +.\" Since 2.4.19/2.5.43 +Allow to reuse TIME_WAIT sockets for new connections when it is +safe from protocol viewpoint. +It should not be changed without advice/request of technical experts. +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_vegas_cong_avoid " (Boolean; default: disabled; Linux 2.2 to 2.6.13)" +.\" Since 2.1.8; removed in 2.6.13 +Enable TCP Vegas congestion avoidance algorithm. +TCP Vegas is a sender-side only change to TCP that anticipates +the onset of congestion by estimating the bandwidth. +TCP Vegas adjusts the sending rate by modifying the congestion window. +TCP Vegas should provide less packet loss, but it is +not as aggressive as TCP Reno. +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_westwood " (Boolean; default: disabled; Linux 2.4.26/2.6.3 to 2.6.13)" +Enable TCP Westwood+ congestion control algorithm. +TCP Westwood+ is a sender-side only modification of the TCP Reno +protocol stack that optimizes the performance of TCP congestion control. +It is based on end-to-end bandwidth estimation to set +congestion window and slow start threshold after a congestion episode. +Using this estimation, TCP Westwood+ adaptively sets a +slow start threshold and a congestion window which takes into +account the bandwidth used at the time congestion is experienced. +TCP Westwood+ significantly increases fairness with respect to +TCP Reno in wired networks and throughput over wireless links. +.TP +.IR tcp_window_scaling " (Boolean; default: enabled; since Linux 2.2)" +.\" Since 2.1.36 +Enable RFC\ 1323 TCP window scaling. +This feature allows the use of a large window +(> 64K) on a TCP connection, should the other end support it. +Normally, the 16 bit window length field in the TCP header +limits the window size to less than 64K bytes. +If larger windows are desired, applications can increase the size of +their socket buffers and the window scaling option will be employed. +If +.I tcp_window_scaling +is disabled, TCP will not negotiate the use of window +scaling with the other end during connection setup. +.TP +.IR tcp_wmem " (since Linux 2.4)" +.\" Since 2.4.0-test7 +This is a vector of 3 integers: [min, default, max]. +These parameters are used by TCP to regulate send buffer sizes. +TCP dynamically adjusts the size of the send buffer from the +default values listed below, in the range of these values, +depending on memory available. +.RS +.TP 10 +.I min +Minimum size of the send buffer used by each TCP socket. +The default value is the system page size. +(On Linux 2.4, the default value is 4K bytes.) +This value is used to ensure that in memory pressure mode, +allocations below this size will still succeed. +This is not used to bound the size of the send buffer declared using +.B SO_SNDBUF +on a socket. +.TP +.I default +The default size of the send buffer for a TCP socket. +This value overwrites the initial default buffer size from +the generic global +.I /proc/sys/net/core/wmem_default +defined for all protocols. +The default value is 16K bytes. +.\" True in Linux 2.4 and 2.6 +If larger send buffer sizes are desired, this value +should be increased (to affect all sockets). +To employ large TCP windows, the +.I /proc/sys/net/ipv4/tcp_window_scaling +must be set to a nonzero value (default). +.TP +.I max +The maximum size of the send buffer used by each TCP socket. +This value does not override the value in +.IR /proc/sys/net/core/wmem_max . +This is not used to limit the size of the send buffer declared using +.B SO_SNDBUF +on a socket. +The default value is calculated using the formula + + max(65536, min(4MB, \fItcp_mem\fP[1]*PAGE_SIZE/128)) + +(On Linux 2.4, the default value is 128K bytes, +lowered 64K depending on low-memory systems.) +.RE +.TP +.IR tcp_workaround_signed_windows " (Boolean; default: disabled; since Linux 2.6.26)" +If enabled, assume that no receipt of a window-scaling option means that the +remote TCP is broken and treats the window as a signed quantity. +If disabled, assume that the remote TCP is not broken even if we do +not receive a window scaling option from it. +.SS Socket Options +To set or get a TCP socket option, call +.BR getsockopt (2) +to read or +.BR setsockopt (2) +to write the option with the option level argument set to +.BR IPPROTO_TCP . +.\" or SOL_TCP on Linux +In addition, +most +.B IPPROTO_IP +socket options are valid on TCP sockets. +For more information see +.BR ip (7). +.\" FIXME Document TCP_CONGESTION (new in 2.6.13) +.TP +.BR TCP_CORK " (since Linux 2.2)" +.\" precisely: since 2.1.127 +If set, don't send out partial frames. +All queued partial frames are sent when the option is cleared again. +This is useful for prepending headers before calling +.BR sendfile (2), +or for throughput optimization. +As currently implemented, there is a 200 millisecond ceiling on the time +for which output is corked by +.BR TCP_CORK . +If this ceiling is reached, then queued data is automatically transmitted. +This option can be combined with +.B TCP_NODELAY +only since Linux 2.5.71. +This option should not be used in code intended to be portable. +.TP +.BR TCP_DEFER_ACCEPT " (since Linux 2.4)" +.\" Precisely: since 2.3.38 +Allow a listener to be awakened only when data arrives on the socket. +Takes an integer value (seconds), this can +bound the maximum number of attempts TCP will make to +complete the connection. +This option should not be used in code intended to be portable. +.TP +.BR TCP_INFO " (since Linux 2.4)" +Used to collect information about this socket. +The kernel returns a \fIstruct tcp_info\fP as defined in the file +.IR /usr/include/linux/tcp.h . +This option should not be used in code intended to be portable. +.TP +.BR TCP_KEEPCNT " (since Linux 2.4)" +.\" Precisely: since 2.3.18 +The maximum number of keepalive probes TCP should send +before dropping the connection. +This option should not be +used in code intended to be portable. +.TP +.BR TCP_KEEPIDLE " (since Linux 2.4)" +.\" Precisely: since 2.3.18 +The time (in seconds) the connection needs to remain idle +before TCP starts sending keepalive probes, if the socket +option +.B SO_KEEPALIVE +has been set on this socket. +This option should not be used in code intended to be portable. +.TP +.BR TCP_KEEPINTVL " (since Linux 2.4)" +.\" Precisely: since 2.3.18 +The time (in seconds) between individual keepalive probes. +This option should not be used in code intended to be portable. +.TP +.BR TCP_LINGER2 " (since Linux 2.4)" +.\" Precisely: since 2.3.41 +The lifetime of orphaned FIN_WAIT2 state sockets. +This option can be used to override the system-wide setting in the file +.I /proc/sys/net/ipv4/tcp_fin_timeout +for this socket. +This is not to be confused with the +.BR socket (7) +level option +.BR SO_LINGER . +This option should not be used in code intended to be portable. +.TP +.B TCP_MAXSEG +.\" Present in Linux 1.0 +The maximum segment size for outgoing TCP packets. +If this option is set before connection establishment, it also +changes the MSS value announced to the other end in the initial packet. +Values greater than the (eventual) interface MTU have no effect. +TCP will also impose +its minimum and maximum bounds over the value provided. +.\" FIXME +.\" Document TCP_MD5SIG, added in Linux 2.6.20, +.\" Needs CONFIG_TCP_MD5SIG +.\" From net/inet/Kconfig +.\" bool "TCP: MD5 Signature Option support (RFC2385) (EXPERIMENTAL)" +.\" RFC2385 specifies a method of giving MD5 protection to TCP sessions. +.\" Its main (only?) use is to protect BGP sessions between core routers +.\" on the Internet. +.\" +.\" There is a TCP_MD5SIG option documented in FreeBSD's tcp(4), +.\" but probably many details are different on Linux +.\" Authors were yoshfuji@linux-ipv6.org and Dave Muller +.\" http://thread.gmane.org/gmane.linux.network/47490 +.\" http://www.daemon-systems.org/man/tcp.4.html +.\" http://article.gmane.org/gmane.os.netbsd.devel.network/3767/match=tcp_md5sig+freebsd +.TP +.B TCP_NODELAY +.\" Present in Linux 1.0 +If set, disable the Nagle algorithm. +This means that segments +are always sent as soon as possible, even if there is only a +small amount of data. +When not set, data is buffered until there +is a sufficient amount to send out, thereby avoiding the +frequent sending of small packets, which results in poor +utilization of the network. +This option is overridden by +.BR TCP_CORK ; +however, setting this option forces an explicit flush of +pending output, even if +.B TCP_CORK +is currently set. +.TP +.BR TCP_QUICKACK " (since Linux 2.4.4)" +Enable quickack mode if set or disable quickack +mode if cleared. +In quickack mode, acks are sent +immediately, rather than delayed if needed in accordance +to normal TCP operation. +This flag is not permanent, +it only enables a switch to or from quickack mode. +Subsequent operation of the TCP protocol will +once again enter/leave quickack mode depending on +internal protocol processing and factors such as +delayed ack timeouts occurring and data transfer. +This option should not be used in code intended to be +portable. +.TP +.BR TCP_SYNCNT " (since Linux 2.4)" +.\" Precisely: since 2.3.18 +Set the number of SYN retransmits that TCP should send before +aborting the attempt to connect. +It cannot exceed 255. +This option should not be used in code intended to be portable. +.TP +.BR TCP_WINDOW_CLAMP " (since Linux 2.4)" +.\" Precisely: since 2.3.41 +Bound the size of the advertised window to this value. +The kernel imposes a minimum size of SOCK_MIN_RCVBUF/2. +This option should not be used in code intended to be +portable. +.SS Sockets API +TCP provides limited support for out-of-band data, +in the form of (a single byte of) urgent data. +In Linux this means if the other end sends newer out-of-band +data the older urgent data is inserted as normal data into +the stream (even when +.B SO_OOBINLINE +is not set). +This differs from BSD-based stacks. +.PP +Linux uses the BSD compatible interpretation of the urgent +pointer field by default. +This violates RFC\ 1122, but is +required for interoperability with other stacks. +It can be changed via +.IR /proc/sys/net/ipv4/tcp_stdurg . + +It is possible to peek at out-of-band data using the +.IR recv (2) +.B MSG_PEEK +flag. + +Since version 2.4, Linux supports the use of +.B MSG_TRUNC +in the +.I flags +argument of +.BR recv (2) +(and +.BR recvmsg (2)). +This flag causes the received bytes of data to be discarded, +rather than passed back in a caller-supplied buffer. +Since Linux 2.4.4, +.BR MSG_PEEK +also has this effect when used in conjunction with +.BR MSG_OOB +to receive out-of-band data. +.SS Ioctls +These following +.BR ioctl (2) +calls return information in +.IR value . +The correct syntax is: +.PP +.RS +.nf +.BI int " value"; +.IB error " = ioctl(" tcp_socket ", " ioctl_type ", &" value ");" +.fi +.RE +.PP +.I ioctl_type +is one of the following: +.TP +.B SIOCINQ +Returns the amount of queued unread data in the receive buffer. +The socket must not be in LISTEN state, otherwise an error +.RB ( EINVAL ) +is returned. +.TP +.B SIOCATMARK +Returns true (i.e., +.I value +is nonzero) if the inbound data stream is at the urgent mark. + +If the +.B SO_OOBINLINE +socket option is set, and +.B SIOCATMARK +returns true, then the +next read from the socket will return the urgent data. +If the +.B SO_OOBINLINE +socket option is not set, and +.B SIOCATMARK +returns true, then the +next read from the socket will return the bytes following +the urgent data (to actually read the urgent data requires the +.B recv(MSG_OOB) +flag). + +Note that a read never reads across the urgent mark. +If an application is informed of the presence of urgent data via +.BR select (2) +(using the +.I exceptfds +argument) or through delivery of a +.B SIGURG +signal, +then it can advance up to the mark using a loop which repeatedly tests +.B SIOCATMARK +and performs a read (requesting any number of bytes) as long as +.B SIOCATMARK +returns false. +.TP +.B SIOCOUTQ +Returns the amount of unsent data in the socket send queue. +The socket must not be in LISTEN state, otherwise an error +.RB ( EINVAL ) +is returned. +.SS Error Handling +When a network error occurs, TCP tries to resend the packet. +If it doesn't succeed after some time, either +.B ETIMEDOUT +or the last received error on this connection is reported. +.PP +Some applications require a quicker error notification. +This can be enabled with the +.B IPPROTO_IP +level +.B IP_RECVERR +socket option. +When this option is enabled, all incoming +errors are immediately passed to the user program. +Use this option with care \(em it makes TCP less tolerant to routing +changes and other normal network conditions. +.SH ERRORS +.TP +.B EAFNOTSUPPORT +Passed socket address type in +.I sin_family +was not +.BR AF_INET . +.TP +.B EPIPE +The other end closed the socket unexpectedly or a read is +executed on a shut down socket. +.TP +.B ETIMEDOUT +The other end didn't acknowledge retransmitted data after some time. +.PP +Any errors defined for +.BR ip (7) +or the generic socket layer may also be returned for TCP. +.SH VERSIONS +Support for Explicit Congestion Notification, zero-copy +.BR sendfile (2), +reordering support and some SACK extensions +(DSACK) were introduced in 2.4. +Support for forward acknowledgement (FACK), TIME_WAIT recycling, +and per-connection keepalive socket options were introduced in 2.3. +.SH BUGS +Not all errors are documented. +.br +IPv6 is not described. +.\" Only a single Linux kernel version is described +.\" Info for 2.2 was lost. Should be added again, +.\" or put into a separate page. +.\" .SH AUTHORS +.\" This man page was originally written by Andi Kleen. +.\" It was updated for 2.4 by Nivedita Singhvi with input from +.\" Alexey Kuznetsov's Documentation/networking/ip-sysctl.txt +.\" document. +.SH "SEE ALSO" +.BR accept (2), +.BR bind (2), +.BR connect (2), +.BR getsockopt (2), +.BR listen (2), +.BR recvmsg (2), +.BR sendfile (2), +.BR sendmsg (2), +.BR socket (2), +.BR ip (7), +.BR socket (7) +.sp +RFC\ 793 for the TCP specification. +.br +RFC\ 1122 for the TCP requirements and a description of the Nagle algorithm. +.br +RFC\ 1323 for TCP timestamp and window scaling options. +.br +RFC\ 1644 for a description of TIME_WAIT assassination hazards. +.br +RFC\ 3168 for a description of Explicit Congestion Notification. +.br +RFC\ 2581 for TCP congestion control algorithms. +.br +RFC\ 2018 and RFC\ 2883 for SACK and extensions to SACK. diff --git a/original/man7/termio.7 b/original/man7/termio.7 new file mode 100644 index 00000000..d6c20c0c --- /dev/null +++ b/original/man7/termio.7 @@ -0,0 +1,59 @@ +.\" Copyright (c) 2006 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. +.\" +.\" 28 Dec 2006 - Initial Creation +.\" +.TH TERMIO 7 2006-12-28 "Linux" "Linux Programmer's Manual" +.SH NAME +termio \- the System V terminal driver interface +.SH DESCRIPTION +.B termio +is the name of the old System V terminal driver interface. +This interface defined a +.I termio +structure used to store terminal settings, and a range of +.BR ioctl (2) +operations to get and set terminal attributes. + +The +.B termio +interface is now obsolete: POSIX.1-1990 standardized a modified +version of this interface, under the name +.BR termios . +The POSIX.1 data structure differs slightly from the +System V version, and POSIX.1 defined a suite of functions +to replace the various +.BR ioctl (2) +operations that existed in System V. +(This was done because +.BR ioctl (2) +was unstandardized, and its variadic third argument +does not allow argument type checking.) + +If you're looking for page called "termio", then you can probably +find most of the information that you seek in either +.BR termios (3) +or +.BR tty_ioctl (4). +.SH "SEE ALSO" +.BR termios (3), +.BR tty_ioctl (4) diff --git a/original/man7/time.7 b/original/man7/time.7 new file mode 100644 index 00000000..e93b5e03 --- /dev/null +++ b/original/man7/time.7 @@ -0,0 +1,203 @@ +.\" Copyright (c) 2006 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. +.\" +.\" 2008-06-24, mtk: added some details about where jiffies come into +.\" play; added section on high-resolution timers. +.\" +.TH TIME 7 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH NAME +time \- overview of time and timers +.SH DESCRIPTION +.SS "Real time and process time" +.I "Real time" +is defined as time measured from some fixed point, +either from a standard point in the past +(see the description of the Epoch and calendar time below), +or from some point (e.g., the start) in the life of a process +.RI ( "elapsed time" ). + +.I "Process time" +is defined as the amount of CPU time used by a process. +This is sometimes divided into +.I user +and +.I system +components. +User CPU time is the time spent executing code in user mode. +System CPU time is the time spent by the kernel executing +in system mode on behalf of the process (e.g., executing system calls). +The +.BR time (1) +command can be used to determine the amount of CPU time consumed +during the execution of a program. +A program can determine the amount of CPU time it has consumed using +.BR times (2), +.BR getrusage (2), +or +.BR clock (3). +.SS "The Hardware Clock" +Most computers have a (battery-powered) hardware clock which the kernel +reads at boot time in order to initialize the software clock. +For further details, see +.BR rtc (4) +and +.BR hwclock (8). +.SS "The Software Clock, HZ, and Jiffies" +The accuracy of various system calls that set timeouts, +(e.g., +.BR select (2), +.BR sigtimedwait (2)) +.\" semtimedop(), mq_timedwait(), io_getevents(), poll() are the same +.\" futexes and thus sem_timedwait() seem to use high-res timers. +and measure CPU time (e.g., +.BR getrusage (2)) +is limited by the resolution of the +.IR "software clock" , +a clock maintained by the kernel which measures time in +.IR jiffies . +The size of a jiffy is determined by the value of the kernel constant +.IR HZ . + +The value of +.I HZ +varies across kernel versions and hardware platforms. +On i386 the situation is as follows: +on kernels up to and including 2.4.x, HZ was 100, +giving a jiffy value of 0.01 seconds; +starting with 2.6.0, HZ was raised to 1000, giving a jiffy of +0.001 seconds. +Since kernel 2.6.13, the HZ value is a kernel +configuration parameter and can be 100, 250 (the default) or 1000, +yielding a jiffies value of, respectively, 0.01, 0.004, or 0.001 seconds. +Since kernel 2.6.20, a further frequency is available: +300, a number that divides evenly for the common video +frame rates (PAL, 25 HZ; NTSC, 30 HZ). + +The +.BR times (2) +system call is a special case. +It reports times with a granularity defined by the kernel constant +.IR USER_HZ . +Userspace applications can determine the value of this constant using +.IR sysconf(_SC_CLK_TCK) . +.\" glibc gets this info with a little help from the ELF loader; +.\" see glibc elf/dl-support.c and kernel fs/binfmt_elf.c. +.\" +.SS "High-Resolution Timers" +Before Linux 2.6.21, the accuracy of timer and sleep system calls +(see below) was also limited by the size of the jiffy. + +Since Linux 2.6.21, Linux supports high-resolution timers (HRTs), +optionally configurable via +.BR CONFIG_HIGH_RES_TIMERS . +On a system that supports HRTs, the accuracy of sleep and timer +system calls is no longer constrained by the jiffy, +but instead can be as accurate as the hardware allows +(microsecond accuracy is typical of modern hardware). +You can determine whether high-resolution timers are supported by +checking the resolution returned by a call to +.BR clock_getres (2) +or looking at the "resolution" entries in +.IR /proc/timer_list . + +HRTs are not supported on all hardware architectures. +(Support is provided on x86, arm, and powerpc, among others.) +.SS "The Epoch" +Unix systems represent time in seconds since the +.IR Epoch , +1970-01-01 00:00:00 +0000 (UTC). + +A program can determine the +.I "calendar time" +using +.BR gettimeofday (2), +which returns time (in seconds and microseconds) that have +elapsed since the Epoch; +.BR time (2) +provides similar information, but only with accuracy to the +nearest second. +The system time can be changed using +.BR settimeofday (2). +.SS "Broken-down time" +Certain library functions use a structure of +type +.I tm +to represent +.IR "broken-down time" , +which stores time value separated out into distinct components +(year, month, day, hour, minute, second, etc.). +This structure is described in +.BR ctime (3), +which also describes functions that convert between calendar time and +broken-down time. +Functions for converting between broken-down time and printable +string representations of the time are described in +.BR ctime (3), +.BR strftime (3), +and +.BR strptime (3). +.SS "Sleeping and Setting Timers" +Various system calls and functions allow a program to sleep +(suspend execution) for a specified period of time; see +.BR nanosleep (2), +.BR clock_nanosleep (2), +and +.BR sleep (3). + +Various system calls allow a process to set a timer that expires +at some point in the future, and optionally at repeated intervals; +see +.BR alarm (2), +.BR getitimer (2), +.BR timerfd_create (2), +and +.BR timer_create (2). +.SH "SEE ALSO" +.BR date (1), +.BR time (1), +.BR adjtimex (2), +.BR alarm (2), +.BR clock_gettime (2), +.BR clock_nanosleep (2), +.BR getitimer (2), +.BR getrlimit (2), +.BR getrusage (2), +.BR gettimeofday (2), +.BR nanosleep (2), +.BR stat (2), +.BR time (2), +.BR timer_create (2), +.BR timerfd_create (2), +.BR times (2), +.BR utime (2), +.BR adjtime (3), +.BR clock (3), +.BR clock_getcpuclockid (3), +.BR ctime (3), +.BR pthread_getcpuclockid (3), +.BR sleep (3), +.BR strftime (3), +.BR strptime (3), +.BR timeradd (3), +.BR usleep (3), +.BR rtc (4), +.BR hwclock (8) diff --git a/original/man7/tis-620.7 b/original/man7/tis-620.7 new file mode 100644 index 00000000..cbd4cfe7 --- /dev/null +++ b/original/man7/tis-620.7 @@ -0,0 +1 @@ +.so man7/iso_8859-11.7 diff --git a/original/man7/udp.7 b/original/man7/udp.7 new file mode 100644 index 00000000..53a91db1 --- /dev/null +++ b/original/man7/udp.7 @@ -0,0 +1,243 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: udp.7,v 1.7 2000/01/22 01:55:05 freitag Exp $ +.\" +.TH UDP 7 2009-09-30 "Linux" "Linux Programmer's Manual" +.SH NAME +udp \- User Datagram Protocol for IPv4 +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.B udp_socket = socket(AF_INET, SOCK_DGRAM, 0); +.SH DESCRIPTION +This is an implementation of the User Datagram Protocol +described in RFC\ 768. +It implements a connectionless, unreliable datagram packet service. +Packets may be reordered or duplicated before they arrive. +UDP generates and checks checksums to catch transmission errors. + +When a UDP socket is created, +its local and remote addresses are unspecified. +Datagrams can be sent immediately using +.BR sendto (2) +or +.BR sendmsg (2) +with a valid destination address as an argument. +When +.BR connect (2) +is called on the socket, the default destination address is set and +datagrams can now be sent using +.BR send (2) +or +.BR write (2) +without specifying a destination address. +It is still possible to send to other destinations by passing an +address to +.BR sendto (2) +or +.BR sendmsg (2). +In order to receive packets, the socket can be bound to a local +address first by using +.BR bind (2). +Otherwise the socket layer will automatically assign +a free local port out of the range defined by +.I /proc/sys/net/ipv4/ip_local_port_range +and bind the socket to +.BR INADDR_ANY . + +All receive operations return only one packet. +When the packet is smaller than the passed buffer, only that much +data is returned; when it is bigger, the packet is truncated and the +.B MSG_TRUNC +flag is set. +.B MSG_WAITALL +is not supported. + +IP options may be sent or received using the socket options described in +.BR ip (7). +They are only processed by the kernel when the appropriate +.I /proc +parameter +is enabled (but still passed to the user even when it is turned off). +See +.BR ip (7). + +When the +.B MSG_DONTROUTE +flag is set on sending, the destination address must refer to a local +interface address and the packet is only sent to that interface. + +By default, Linux UDP does path MTU (Maximum Transmission Unit) discovery. +This means the kernel +will keep track of the MTU to a specific target IP address and return +.B EMSGSIZE +when a UDP packet write exceeds it. +When this happens, the application should decrease the packet size. +Path MTU discovery can be also turned off using the +.B IP_MTU_DISCOVER +socket option or the +.I /proc/sys/net/ipv4/ip_no_pmtu_disc +file; see +.BR ip (7) +for details. +When turned off, UDP will fragment outgoing UDP packets +that exceed the interface MTU. +However, disabling it is not recommended +for performance and reliability reasons. +.SS "Address Format" +UDP uses the IPv4 +.I sockaddr_in +address format described in +.BR ip (7). +.SS "Error Handling" +All fatal errors will be passed to the user as an error return even +when the socket is not connected. +This includes asynchronous errors +received from the network. +You may get an error for an earlier packet +that was sent on the same socket. +This behavior differs from many other BSD socket implementations +which don't pass any errors unless the socket is connected. +Linux's behavior is mandated by +.BR RFC\ 1122 . + +For compatibility with legacy code, in Linux 2.0 and 2.2 +it was possible to set the +.B SO_BSDCOMPAT +.B SOL_SOCKET +option to receive remote errors only when the socket has been +connected (except for +.B EPROTO +and +.BR EMSGSIZE ). +Locally generated errors are always passed. +Support for this socket option was removed in later kernels; see +.BR socket (7) +for further information. + +When the +.B IP_RECVERR +option is enabled, all errors are stored in the socket error queue, +and can be received by +.BR recvmsg (2) +with the +.B MSG_ERRQUEUE +flag set. +.SS /proc interfaces +System-wide UDP parameter settings can be accessed by files in the directory +.IR /proc/sys/net/ipv4/ . +.TP +.IR udp_mem " (since Linux 2.6.25)" +This is a vector of three integers governing the number +of pages allowed for queueing by all UDP sockets. +.RS +.TP 10 +.I min +Below this number of pages, UDP is not bothered about its +memory appetite. +When the amount of memory allocated by UDP exceeds +this number, UDP starts to moderate memory usage. +.TP +.I pressure +This value was introduced to follow the format of +.IR tcp_mem +(see +.BR tcp (7)). +.TP +.I max +Number of pages allowed for queueing by all UDP sockets. +.RE +.IP +Defaults values for these three items are +calculated at boot time from the amount of available memory. +.TP +.IR udp_rmem_min " (integer; default value: PAGE_SIZE; since Linux 2.6.25)" +Minimal size, in bytes, of receive buffers used by UDP sockets in moderation. +Each UDP socket is able to use the size for receiving data, +even if total pages of UDP sockets exceed +.I udp_mem +pressure. +.TP +.IR udp_wmem_min " (integer; default value: PAGE_SIZE; since Linux 2.6.25)" +Minimal size, in bytes, of send buffer used by UDP sockets in moderation. +Each UDP socket is able to use the size for sending data, +even if total pages of UDP sockets exceed +.I udp_mem +pressure. +.SS "Socket Options" +To set or get a UDP socket option, call +.BR getsockopt (2) +to read or +.BR setsockopt (2) +to write the option with the option level argument set to +.BR IPPROTO_UDP . +.TP +.BR UDP_CORK " (since Linux 2.5.44)" +If this option is enabled, then all data output on this socket +is accumulated into a single datagram that is transmitted when +the option is disabled. +This option should not be used in code intended to be +portable. +.\" FIXME document UDP_ENCAP (new in kernel 2.5.67) +.\" From include/linux/udp.h: +.\" /* UDP encapsulation types */ +.\" #define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */ +.\" #define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ +.\" #define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */ +.SS Ioctls +These ioctls can be accessed using +.BR ioctl (2). +The correct syntax is: +.PP +.RS +.nf +.BI int " value"; +.IB error " = ioctl(" udp_socket ", " ioctl_type ", &" value ");" +.fi +.RE +.TP +.BR FIONREAD " (" SIOCINQ ) +Gets a pointer to an integer as argument. +Returns the size of the next pending datagram in the integer in bytes, +or 0 when no datagram is pending. +.TP +.BR TIOCOUTQ " (" SIOCOUTQ ) +Returns the number of data bytes in the local send queue. +Only supported with Linux 2.4 and above. +.PP +In addition all ioctls documented in +.BR ip (7) +and +.BR socket (7) +are supported. +.SH ERRORS +All errors documented for +.BR socket (7) +or +.BR ip (7) +may be returned by a send or receive on a UDP socket. +.TP +.B ECONNREFUSED +No receiver was associated with the destination address. +This might be caused by a previous packet sent over the socket. +.SH VERSIONS +.B IP_RECVERR +is a new feature in Linux 2.2. +.\" .SH CREDITS +.\" This man page was written by Andi Kleen. +.SH "SEE ALSO" +.BR ip (7), +.BR raw (7), +.BR socket (7), +.BR udplite (7) + +RFC\ 768 for the User Datagram Protocol. +.br +RFC\ 1122 for the host requirements. +.br +RFC\ 1191 for a description of path MTU discovery. diff --git a/original/man7/udplite.7 b/original/man7/udplite.7 new file mode 100644 index 00000000..3ceb31c9 --- /dev/null +++ b/original/man7/udplite.7 @@ -0,0 +1,152 @@ +.\" Copyright (c) 2008 by Gerrit Renker +.\" +.\" 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. +.\" +.\" $Id: udplite.7,v 1.12 2008/07/23 15:22:22 gerrit Exp gerrit $ +.\" +.TH UDPLITE 7 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH NAME +udplite \- Lightweight User Datagram Protocol +.SH SYNOPSIS +.B #include +.br +.\" FIXME . see #defines under `BUGS', +.\" when glibc supports this, add +.\" #include +.sp +.B sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDPLITE); +.SH DESCRIPTION +This is an implementation of the Lightweight User Datagram Protocol +(UDP-Lite), as described in RFC\ 3828. + +UDP-Lite is an extension of UDP (RFC\ 768) to support variable-length +checksums. +This has advantages for some types of multimedia transport that +may be able to make use of slightly damaged datagrams, +rather than having them discarded by lower-layer protocols. + +The variable-length checksum coverage is set via a +.BR setsockopt (2) +option. +If this option is not set, the only difference to UDP is +in using a different IP protocol identifier (IANA number 136). + +The UDP-Lite implementation is a full extension of +.BR udp (7), +i.e., it shares the same API and API behaviour, and in addition +offers two socket options to control the checksum coverage. +.SS "Address Format" +UDP-Litev4 uses the +.I sockaddr_in +address format described in +.BR ip (7). +UDP-Litev6 uses the +.I sockaddr_in6 +address format described in +.BR ipv6 (7). +.SS "Socket Options" +To set or get a UDP-Lite socket option, call +.BR getsockopt (2) +to read or +.BR setsockopt (2) +to write the option with the option level argument set to +.BR IPPROTO_UDPLITE . +In addition, all +.B IPPROTO_UDP +socket options are valid on a UDP-Lite socket. +See +.BR udp (7) +for more information. + +The following two options are specific to UDP-Lite. +.TP +.BR UDPLITE_SEND_CSCOV +This option sets the sender checksum coverage and takes an +.I int +as argument, with a checksum coverage value in the range 0..2^16-1. + +A value of 0 means that the entire datagram is always covered. +Values from 1-7 are illegal (RFC\ 3828, 3.1) and are rounded up to +the minimum coverage of 8. + +With regard to IPv6 jumbograms (RFC\ 2675), the UDP-Litev6 checksum +coverage is limited to the first 2^16-1 octets, as per RFC\ 3828, 3.5. +Higher values are therefore silently truncated to 2^16-1. +If in doubt, the current coverage value can always be queried using +.BR getsockopt (2). +.TP +.BR UDPLITE_RECV_CSCOV +This is the receiver-side analogue and uses the same argument format +and value range as +.BR UDPLITE_SEND_CSCOV . +This option is not required to enable traffic with partial checksum +coverage. +Its function is that of a traffic filter: when enabled, it +instructs the kernel to drop all packets which have a coverage +.I less +than the specified coverage value. + +When the value of +.B UDPLITE_RECV_CSCOV +exceeds the actual packet coverage, incoming packets are silently dropped, +but may generate a warning message in the system log. +.\" SO_NO_CHECK exists and is supported by UDPv4, but is +.\" commented out in socket(7), hence also commented out here +.\".PP +.\"Since UDP-Lite mandates checksums, checksumming can not be disabled +.\"via the +.\".B SO_NO_CHECK +.\"option from +.\".BR socket (7). +.SH ERRORS +All errors documented for +.BR udp (7) +may be returned. +UDP-Lite does not add further errors. +.SH BUGS +.\" FIXME . remove this section once glibc supports UDP-Lite +Where glibc support is missing, the following definitions are needed: +.in +4n +.nf + +#define IPPROTO_UDPLITE 136 +.\" The following two are defined in the kernel in linux/net/udplite.h +#define UDPLITE_SEND_CSCOV 10 +#define UDPLITE_RECV_CSCOV 11 +.fi +.in +.SH FILES +.I /proc/net/snmp +\- basic UDP-Litev4 statistics counters. +.br +.I /proc/net/snmp6 +\- basic UDP-Litev6 statistics counters. +.SH VERSIONS +UDP-Litev4/v6 first appeared in Linux 2.6.20. +.SH "SEE ALSO" +.BR udp (7), +.BR ip (7), +.BR ipv6 (7), +.BR socket (7) + +RFC\ 3828 for the Lightweight User Datagram Protocol (UDP-Lite) +.br +.I Documentation/networking/udplite.txt diff --git a/original/man7/unicode.7 b/original/man7/unicode.7 new file mode 100644 index 00000000..deb540f1 --- /dev/null +++ b/original/man7/unicode.7 @@ -0,0 +1,309 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) Markus Kuhn, 1995, 2001 +.\" +.\" 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. +.\" +.\" 1995-11-26 Markus Kuhn +.\" First version written +.\" 2001-05-11 Markus Kuhn +.\" Update +.\" +.TH UNICODE 7 2001-05-11 "GNU" "Linux Programmer's Manual" +.SH NAME +Unicode \- the Universal Character Set +.SH DESCRIPTION +The international standard +.B ISO 10646 +defines the +.BR "Universal Character Set (UCS)" . +UCS contains all characters of all other character set standards. +It also guarantees +.BR "round-trip compatibility" , +i.e., conversion tables can be built such that no information is lost +when a string is converted from any other encoding to UCS and back. + +UCS contains the characters required to represent practically all +known languages. +This includes not only the Latin, Greek, Cyrillic, +Hebrew, Arabic, Armenian, and Georgian scripts, but also Chinese, +Japanese and Korean Han ideographs as well as scripts such as +Hiragana, Katakana, Hangul, Devanagari, Bengali, Gurmukhi, Gujarati, +Oriya, Tamil, Telugu, Kannada, Malayalam, Thai, Lao, Khmer, Bopomofo, +Tibetan, Runic, Ethiopic, Canadian Syllabics, Cherokee, Mongolian, +Ogham, Myanmar, Sinhala, Thaana, Yi, and others. +For scripts not yet +covered, research on how to best encode them for computer usage is +still going on and they will be added eventually. +This might +eventually include not only Hieroglyphs and various historic +Indo-European languages, but even some selected artistic scripts such +as Tengwar, Cirth, and Klingon. +UCS also covers a large number of +graphical, typographical, mathematical and scientific symbols, +including those provided by TeX, Postscript, APL, MS-DOS, MS-Windows, +Macintosh, OCR fonts, as well as many word processing and publishing +systems, and more are being added. + +The UCS standard (ISO 10646) describes a +.I "31-bit character set architecture" +consisting of 128 24-bit +.IR groups , +each divided into 256 16-bit +.I planes +made up of 256 8-bit +.I rows +with 256 +.I column +positions, one for each character. +Part 1 of the standard +.RB ( "ISO 10646-1" ) +defines the first 65534 code positions (0x0000 to 0xfffd), which form +the +.IR "Basic Multilingual Plane (BMP)" , +that is plane 0 in group 0. +Part 2 of the standard +.RB ( "ISO 10646-2" ) +adds characters to group 0 outside the BMP in several +.I "supplementary planes" +in the range 0x10000 to 0x10ffff. +There are no plans to add characters +beyond 0x10ffff to the standard, therefore of the entire code space, +only a small fraction of group 0 will ever be actually used in the +foreseeable future. +The BMP contains all characters found in the +commonly used other character sets. +The supplemental planes added by +ISO 10646-2 cover only more exotic characters for special scientific, +dictionary printing, publishing industry, higher-level protocol and +enthusiast needs. +.PP +The representation of each UCS character as a 2-byte word is referred +to as the +.B UCS-2 +form (only for BMP characters), whereas +.B UCS-4 +is the representation of each character by a 4-byte word. +In addition, there exist two encoding forms +.B UTF-8 +for backwards compatibility with ASCII processing software and +.B UTF-16 +for the backwards compatible handling of non-BMP characters up to +0x10ffff by UCS-2 software. +.PP +The UCS characters 0x0000 to 0x007f are identical to those of the +classic +.B US-ASCII +character set and the characters in the range 0x0000 to 0x00ff +are identical to those in +.BR "ISO 8859-1 Latin-1" . +.SS "Combining Characters" +Some code points in +.B UCS +have been assigned to +.IR "combining characters" . +These are similar to the nonspacing accent keys on a typewriter. +A combining character just adds an accent to the previous character. +The most important accented characters have codes of their own in UCS, +however, the combining character mechanism allows us to add accents +and other diacritical marks to any character. +The combining characters +always follow the character which they modify. +For example, the German +character Umlaut-A ("Latin capital letter A with diaeresis") can +either be represented by the precomposed UCS code 0x00c4, or +alternatively as the combination of a normal "Latin capital letter A" +followed by a "combining diaeresis": 0x0041 0x0308. +.PP +Combining characters are essential for instance for encoding the Thai +script or for mathematical typesetting and users of the International +Phonetic Alphabet. +.SS "Implementation Levels" +As not all systems are expected to support advanced mechanisms like +combining characters, ISO 10646-1 specifies the following three +.I implementation levels +of UCS: +.TP 0.9i +Level 1 +Combining characters and +.B Hangul Jamo +(a variant encoding of the Korean script, where a Hangul syllable +glyph is coded as a triplet or pair of vovel/consonant codes) are not +supported. +.TP +Level 2 +In addition to level 1, combining characters are now allowed for some +languages where they are essential (e.g., Thai, Lao, Hebrew, +Arabic, Devanagari, Malayalam, etc.). +.TP +Level 3 +All +.B UCS +characters are supported. +.PP +The +.B Unicode 3.0 Standard +published by the +.B Unicode Consortium +contains exactly the +.B UCS Basic Multilingual Plane +at implementation level 3, as described in ISO 10646-1:2000. +.B Unicode 3.1 +added the supplemental planes of ISO 10646-2. +The Unicode standard and +technical reports published by the Unicode Consortium provide much +additional information on the semantics and recommended usages of +various characters. +They provide guidelines and algorithms for +editing, sorting, comparing, normalizing, converting and displaying +Unicode strings. +.SS "Unicode Under Linux" +Under GNU/Linux, the C type +.I wchar_t +is a signed 32-bit integer type. +Its values are always interpreted +by the C library as +.B UCS +code values (in all locales), a convention that is signaled by the GNU +C library to applications by defining the constant +.B __STDC_ISO_10646__ +as specified in the ISO C99 standard. + +UCS/Unicode can be used just like ASCII in input/output streams, +terminal communication, plaintext files, filenames, and environment +variables in the ASCII compatible +.B UTF-8 +multibyte encoding. +To signal the use of UTF-8 as the character +encoding to all applications, a suitable +.I locale +has to be selected via environment variables (e.g., +"LANG=en_GB.UTF-8"). +.PP +The +.B nl_langinfo(CODESET) +function returns the name of the selected encoding. +Library functions such as +.BR wctomb (3) +and +.BR mbsrtowcs (3) +can be used to transform the internal +.I wchar_t +characters and strings into the system character encoding and back +and +.BR wcwidth (3) +tells, how many positions (0\(en2) the cursor is advanced by the +output of a character. +.PP +Under Linux, in general only the BMP at implementation level 1 should +be used at the moment. +Up to two combining characters per base +character for certain scripts (in particular Thai) are also supported +by some UTF-8 terminal emulators and ISO 10646 fonts (level 2), but in +general precomposed characters should be preferred where available +(Unicode calls this +.BR "Normalization Form C" ). +.SS "Private Area" +In the +.BR BMP , +the range 0xe000 to 0xf8ff will never be assigned to any characters by +the standard and is reserved for private usage. +For the Linux +community, this private area has been subdivided further into the +range 0xe000 to 0xefff which can be used individually by any end-user +and the Linux zone in the range 0xf000 to 0xf8ff where extensions are +coordinated among all Linux users. +The registry of the characters +assigned to the Linux zone is currently maintained by H. Peter Anvin +. +.SS Literature +.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. + +This is the official specification of +.BR UCS . +Available as a PDF file on CD-ROM from http://www.iso.ch/. +.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. + +A good reference book about the C programming language. +The fourth +edition covers the 1994 Amendment 1 to the ISO C90 standard, which +adds a large number of new C library functions for handling wide and +multibyte character encodings, but it does not yet cover ISO C99, +which improved wide and multibyte character support even further. +.TP +* +Unicode Technical Reports. +.RS +http://www.unicode.org/unicode/reports/ +.RE +.TP +* +Markus Kuhn: UTF-8 and Unicode FAQ for Unix/Linux. +.RS +http://www.cl.cam.ac.uk/~mgk25/unicode.html + +Provides subscription information for the +.I linux-utf8 +mailing list, which is the best place to look for advice on using +Unicode under Linux. +.RE +.TP +* +Bruno Haible: Unicode HOWTO. +.RS +ftp://ftp.ilog.fr/pub/Users/haible/utf8/Unicode-HOWTO.html +.RE +.SH BUGS +When this man page was last revised, the GNU C Library support for +.B UTF-8 +locales was mature and XFree86 support was in an advanced state, but +work on making applications (most notably editors) suitable for use in +.B UTF-8 +locales was still fully in progress. +Current general +.B UCS +support under Linux usually provides for CJK double-width characters +and sometimes even simple overstriking combining characters, but +usually does not include support for scripts with right-to-left +writing direction or ligature substitution requirements such as +Hebrew, Arabic, or the Indic scripts. +These scripts are currently only +supported in certain GUI applications (HTML viewers, word processors) +with sophisticated text rendering engines. +.\" .SH AUTHOR +.\" Markus Kuhn +.SH "SEE ALSO" +.BR setlocale (3), +.BR charsets (7), +.BR utf-8 (7) diff --git a/original/man7/units.7 b/original/man7/units.7 new file mode 100644 index 00000000..87e7fb6f --- /dev/null +++ b/original/man7/units.7 @@ -0,0 +1,127 @@ +'\" t +.\" 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. +.\" +.TH UNITS 7 2001-12-22 "Linux" "Linux Programmer's Manual" +.SH NAME +units, kilo, kibi, mega, mebi, giga, gibi \- decimal and binary prefixes +.SH DESCRIPTION +.SS Decimal prefixes +The SI system of units uses prefixes that indicate powers of ten. +A kilometer is 1000 meter, and a megawatt is 1000000 watt. +Below the standard prefixes. +.RS +.TS +l l l. +Prefix Name Value +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 +M mega 10^ 6 = 1000000 +G giga 10^ 9 = 1000000000 +T tera 10^12 = 1000000000000 +P peta 10^15 = 1000000000000000 +E exa 10^18 = 1000000000000000000 +Z zetta 10^21 = 1000000000000000000000 +Y yotta 10^24 = 1000000000000000000000000 +.TE +.RE + +The symbol for micro is the Greek letter mu, often written u +in an ASCII context where this Greek letter is not available. +See also +.sp +.RS +http://physics.nist.gov/cuu/Units/prefixes.html +.RE +.SS Binary prefixes +The binary prefixes resemble the decimal ones, +but have an additional \(aqi\(aq +(and "Ki" starts with a capital \(aqK\(aq). +The names are formed by taking the +first syllable of the names of the decimal prefix with roughly the same +size, followed by "bi" for "binary". +.RS +.TS +l l l. +Prefix Name Value +Ki kibi 2^10 = 1024 +Mi mebi 2^20 = 1048576 +Gi gibi 2^30 = 1073741824 +Ti tebi 2^40 = 1099511627776 +Pi pebi 2^50 = 1125899906842624 +Ei exbi 2^60 = 1152921504606846976 +.TE +.RE + +See also +.sp +.RS +http://physics.nist.gov/cuu/Units/binary.html +.RE +.SS Discussion +Before these binary prefixes were introduced, it was fairly +common to use k=1000 and K=1024, just like b=bit, B=byte. +Unfortunately, the M is capital already, and cannot be +capitalized to indicate binary-ness. + +At first that didn't matter too much, since memory modules +and disks came in sizes that were powers of two, so everyone +knew that in such contexts "kilobyte" and "megabyte" meant +1024 and 1048576 bytes, respectively. +What originally was a +sloppy use of the prefixes "kilo" and "mega" started to become +regarded as the "real true meaning" when computers were involved. +But then disk technology changed, and disk sizes became arbitrary numbers. +After a period of uncertainty all disk manufacturers settled on the +standard, namely k=1000, M=1000k, G=1000M. + +The situation was messy: in the 14k4 modems, k=1000; in the 1.44MB +.\" also common: 14.4k modem +diskettes, M=1024000; etc. +In 1998 the IEC approved the standard +that defines the binary prefixes given above, enabling people +to be precise and unambiguous. + +Thus, today, MB = 1000000B and MiB = 1048576B. + +In the free software world programs are slowly +being changed to conform. +When the Linux kernel boots and says + +.RS +.nf +hda: 120064896 sectors (61473 MB) w/2048KiB Cache +.fi +.RE + +the MB are megabytes and the KiB are kibibytes. diff --git a/original/man7/unix.7 b/original/man7/unix.7 new file mode 100644 index 00000000..ad48c2e0 --- /dev/null +++ b/original/man7/unix.7 @@ -0,0 +1,375 @@ +.\" This man page is Copyright (C) 1999 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. +.\" +.\" Modified, 2003-12-02, Michael Kerrisk, +.\" Modified, 2003-09-23, Adam Langley +.\" Modified, 2004-05-27, Michael Kerrisk, +.\" Added SOCK_SEQPACKET +.\" 2008-05-27, mtk, Provide a clear description of the three types of +.\" address that can appear in the sockaddr_un structure: pathname, +.\" unnamed, and abstract. +.\" +.TH UNIX 7 2008-12-01 "Linux" "Linux Programmer's Manual" +.SH NAME +unix, AF_UNIX, AF_LOCAL \- Sockets for local +interprocess communication +.SH SYNOPSIS +.B #include +.br +.B #include + +.IB unix_socket " = socket(AF_UNIX, type, 0);" +.br +.IB error " = socketpair(AF_UNIX, type, 0, int *" sv ");" +.SH DESCRIPTION +The +.B AF_UNIX +(also known as +.BR AF_LOCAL ) +socket family is used to communicate between processes on the same machine +efficiently. +Traditionally, Unix sockets can be either unnamed, +or bound to a file system pathname (marked as being of type socket). +Linux also supports an abstract namespace which is independent of the +file system. + +Valid types are: +.BR SOCK_STREAM , +for a stream-oriented socket and +.BR SOCK_DGRAM , +for a datagram-oriented socket that preserves message boundaries +(as on most Unix implementations, Unix domain datagram +sockets are always reliable and don't reorder datagrams); +and (since Linux 2.6.4) +.BR SOCK_SEQPACKET , +for a connection-oriented socket that preserves message boundaries +and delivers messages in the order that they were sent. + +Unix sockets support passing file descriptors or process credentials +to other processes using ancillary data. +.SS Address Format +A Unix domain socket address is represented in the following structure: +.in +4n +.nf + +#define UNIX_PATH_MAX 108 + +struct sockaddr_un { + sa_family_t sun_family; /* AF_UNIX */ + char sun_path[UNIX_PATH_MAX]; /* pathname */ +}; +.fi +.in +.PP +.I sun_family +always contains +.BR AF_UNIX . + +Three types of address are distinguished in this structure: +.IP * 3 +.IR pathname : +a Unix domain socket can be bound to a null-terminated file +system pathname using +.BR bind (2). +When the address of the socket is returned by +.BR getsockname (2), +.BR getpeername (2), +and +.BR accept (2), +its length is +.IR "sizeof(sa_family_t) + strlen(sun_path) + 1" , +and +.I sun_path +contains the null-terminated pathname. +.IP * +.IR unnamed : +A stream socket that has not been bound to a pathname using +.BR bind (2) +has no name. +Likewise, the two sockets created by +.BR socketpair (2) +are unnamed. +When the address of an unnamed socket is returned by +.BR getsockname (2), +.BR getpeername (2), +and +.BR accept (2), +its length is +.IR "sizeof(sa_family_t)" , +and +.I sun_path +should not be inspected. +.\" There is quite some variation across implementations: FreeBSD +.\" says the length is 16 bytes, HP-UX 11 says it's zero bytes. +.IP * +.IR abstract : +an abstract socket address is distinguished by the fact that +.IR sun_path[0] +is a null byte ('\\0'). +All of the remaining bytes in +.I sun_path +define the "name" of the socket. +(Null bytes in the name have no special significance.) +The name has no connection with file system pathnames. +The socket's address in this namespace is given by the rest of the +bytes in +.IR sun_path . +When the address of an abstract socket is returned by +.BR getsockname (2), +.BR getpeername (2), +and +.BR accept (2), +its length is +.IR "sizeof(struct sockaddr_un)" , +and +.I sun_path +contains the abstract name. +The abstract socket namespace is a nonportable Linux extension. +.SS Socket Options +For historical reasons these socket options are specified with a +.B SOL_SOCKET +type even though they are +.B AF_UNIX +specific. +They can be set with +.BR setsockopt (2) +and read with +.BR getsockopt (2) +by specifying +.B SOL_SOCKET +as the socket family. +.TP +.B SO_PASSCRED +Enables the receiving of the credentials of the sending process +ancillary message. +When this option is set and the socket is not yet connected +a unique name in the abstract namespace will be generated automatically. +Expects an integer boolean flag. +.SS Sockets API +The following paragraphs describe domain-specific details and +unsupported features of the sockets API for Unix domain sockets on Linux. + +Unix domain sockets do not support the transmission of +out-of-band data (the +.B MSG_OOB +flag for +.BR send (2) +and +.BR recv (2)). + +The +.BR send (2) +.B MSG_MORE +flag is not supported by Unix domain sockets. + +The use of +.B MSG_TRUNC +in the +.I flags +argument of +.BR recv (2) +is not supported by Unix domain sockets. + +The +.B SO_SNDBUF +socket option does have an effect for Unix domain sockets, but the +.B SO_RCVBUF +option does not. +For datagram sockets, the +.B SO_SNDBUF +value imposes an upper limit on the size of outgoing datagrams. +This limit is calculated as the doubled (see +.BR socket (7)) +option value less 32 bytes used for overhead. +.SS Ancillary Messages +Ancillary data is sent and received using +.BR sendmsg (2) +and +.BR recvmsg (2). +For historical reasons the ancillary message types listed below +are specified with a +.B SOL_SOCKET +type even though they are +.B AF_UNIX +specific. +To send them set the +.I cmsg_level +field of the struct +.I cmsghdr +to +.B SOL_SOCKET +and the +.I cmsg_type +field to the type. +For more information see +.BR cmsg (3). +.TP +.B SCM_RIGHTS +Send or receive a set of open file descriptors from another process. +The data portion contains an integer array of the file descriptors. +The passed file descriptors behave as though they have been created with +.BR dup (2). +.TP +.B SCM_CREDENTIALS +Send or receive Unix credentials. +This can be used for authentication. +The credentials are passed as a +.I struct ucred +ancillary message. +Thus structure is defined in +.I +as follows: + +.in +4n +.nf +struct ucred { + pid_t pid; /* process ID of the sending process */ + uid_t uid; /* user ID of the sending process */ + gid_t gid; /* group ID of the sending process */ +}; +.fi +.in + +Since glibc 2.8, the +.B _GNU_SOURCE +feature test macro must be defined in order to obtain the definition +of this structure. + +The credentials which the sender specifies are checked by the kernel. +A process with effective user ID 0 is allowed to specify values that do +not match its own. +The sender must specify its own process ID (unless it has the capability +.BR CAP_SYS_ADMIN ), +its user ID, effective user ID, or saved set-user-ID (unless it has +.BR CAP_SETUID ), +and its group ID, effective group ID, or saved set-group-ID +(unless it has +.BR CAP_SETGID ). +To receive a +.I struct ucred +message the +.B SO_PASSCRED +option must be enabled on the socket. +.SH ERRORS +.TP +.B EADDRINUSE +Selected local address is already taken or file system socket +object already exists. +.TP +.B ECONNREFUSED +.BR connect (2) +called with a socket object that isn't listening. +This can happen when +the remote socket does not exist or the filename is not a socket. +.TP +.B ECONNRESET +Remote socket was unexpectedly closed. +.TP +.B EFAULT +User memory address was not valid. +.TP +.B EINVAL +Invalid argument passed. +A common cause is the missing setting of AF_UNIX +in the +.I sun_type +field of passed addresses or the socket being in an +invalid state for the applied operation. +.TP +.B EISCONN +.BR connect (2) +called on an already connected socket or a target address was +specified on a connected socket. +.TP +.B ENOMEM +Out of memory. +.TP +.B ENOTCONN +Socket operation needs a target address, but the socket is not connected. +.TP +.B EOPNOTSUPP +Stream operation called on non-stream oriented socket or tried to +use the out-of-band data option. +.TP +.B EPERM +The sender passed invalid credentials in the +.IR "struct ucred" . +.TP +.B EPIPE +Remote socket was closed on a stream socket. +If enabled, a +.B SIGPIPE +is sent as well. +This can be avoided by passing the +.B MSG_NOSIGNAL +flag to +.BR sendmsg (2) +or +.BR recvmsg (2). +.TP +.B EPROTONOSUPPORT +Passed protocol is not AF_UNIX. +.TP +.B EPROTOTYPE +Remote socket does not match the local socket type +.RB ( SOCK_DGRAM +vs. +.BR SOCK_STREAM ) +.TP +.B ESOCKTNOSUPPORT +Unknown socket type. +.PP +Other errors can be generated by the generic socket layer or +by the file system while generating a file system socket object. +See the appropriate manual pages for more information. +.SH VERSIONS +.B SCM_CREDENTIALS +and the abstract namespace were introduced with Linux 2.2 and should not +be used in portable programs. +(Some BSD-derived systems also support credential passing, +but the implementation details differ.) +.SH NOTES +In the Linux implementation, sockets which are visible in the +file system honor the permissions of the directory they are in. +Their owner, group and their permissions can be changed. +Creation of a new socket will fail if the process does not have write and +search (execute) permission on the directory the socket is created in. +Connecting to the socket object requires read/write permission. +This behavior differs from many BSD-derived systems which +ignore permissions for Unix sockets. +Portable programs should not rely on +this feature for security. + +Binding to a socket with a filename creates a socket +in the file system that must be deleted by the caller when it is no +longer needed (using +.BR unlink (2)). +The usual Unix close-behind semantics apply; the socket can be unlinked +at any time and will be finally removed from the file system when the last +reference to it is closed. + +To pass file descriptors or credentials over a +.BR SOCK_STREAM , +you need +to send or receive at least one byte of nonancillary data in the same +.BR sendmsg (2) +or +.BR recvmsg (2) +call. + +Unix domain stream sockets do not support the notion of out-of-band data. +.SH EXAMPLE +See +.BR bind (2). +.SH "SEE ALSO" +.BR recvmsg (2), +.BR sendmsg (2), +.BR socket (2), +.BR socketpair (2), +.BR cmsg (3), +.BR capabilities (7), +.BR credentials (7), +.BR socket (7) diff --git a/original/man7/uri.7 b/original/man7/uri.7 new file mode 100644 index 00000000..6711b6be --- /dev/null +++ b/original/man7/uri.7 @@ -0,0 +1,706 @@ +'\" +.\" (C) Copyright 1999-2000 David A. Wheeler (dwheeler@dwheeler.com) +.\" +.\" 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. +.\" +.\" Fragments of this document are directly derived from IETF standards. +.\" For those fragments which are directly derived from such standards, +.\" the following notice applies, which is the standard copyright and +.\" rights announcement of The Internet Society: +.\" +.\" Copyright (C) The Internet Society (1998). All Rights Reserved. +.\" This document and translations of it may be copied and furnished to +.\" others, and derivative works that comment on or otherwise explain it +.\" or assist in its implementation may be prepared, copied, published +.\" and distributed, in whole or in part, without restriction of any +.\" kind, provided that the above copyright notice and this paragraph are +.\" included on all such copies and derivative works. However, this +.\" document itself may not be modified in any way, such as by removing +.\" the copyright notice or references to the Internet Society or other +.\" Internet organizations, except as needed for the purpose of +.\" developing Internet standards in which case the procedures for +.\" copyrights defined in the Internet Standards process must be +.\" followed, or as required to translate it into languages other than English. +.\" +.\" Modified Fri Jul 25 23:00:00 1999 by David A. Wheeler (dwheeler@dwheeler.com) +.\" Modified Fri Aug 21 23:00:00 1999 by David A. Wheeler (dwheeler@dwheeler.com) +.\" Modified Tue Mar 14 2000 by David A. Wheeler (dwheeler@dwheeler.com) +.\" +.TH URI 7 2000-03-14 "Linux" "Linux Programmer's Manual" +.SH NAME +uri, url, urn \- uniform resource identifier (URI), including a URL or URN +.SH SYNOPSIS +.nf +.HP 0.2i +URI = [ absoluteURI | relativeURI ] [ "#" fragment ] +.HP +absoluteURI = scheme ":" ( hierarchical_part | opaque_part ) +.HP +relativeURI = ( net_path | absolute_path | relative_path ) [ "?" query ] +.HP +scheme = "http" | "ftp" | "gopher" | "mailto" | "news" | "telnet" | + "file" | "man" | "info" | "whatis" | "ldap" | "wais" | \&... +.HP +hierarchical_part = ( net_path | absolute_path ) [ "?" query ] +.HP +net_path = "//" authority [ absolute_path ] +.HP +absolute_path = "/" path_segments +.HP +relative_path = relative_segment [ absolute_path ] +.fi +.SH DESCRIPTION +.PP +A Uniform Resource Identifier (URI) is a short string of characters +identifying an abstract or physical resource (for example, a web page). +A Uniform Resource Locator (URL) is a URI +that identifies a resource through its primary access +mechanism (e.g., its network "location"), rather than +by name or some other attribute of that resource. +A Uniform Resource Name (URN) is a URI +that must remain globally unique and persistent even when +the resource ceases to exist or becomes unavailable. +.PP +URIs are the standard way to name hypertext link destinations +for tools such as web browsers. +The string "http://www.kernelnotes.org" is a URL (and thus it +is also a URI). +Many people use the term URL loosely as a synonym for URI +(though technically URLs are a subset of URIs). +.PP +URIs can be absolute or relative. +An absolute identifier refers to a resource independent of +context, while a relative +identifier refers to a resource by describing the difference +from the current context. +Within a relative path reference, the complete path segments "." and +".." have special meanings: "the current hierarchy level" and "the +level above this hierarchy level", respectively, just like they do in +Unix-like systems. +A path segment which contains a colon +character can't be used as the first segment of a relative URI path +(e.g., "this:that"), because it would be mistaken for a scheme name; +precede such segments with ./ (e.g., "./this:that"). +Note that descendants of MS-DOS (e.g., Microsoft Windows) replace +devicename colons with the vertical bar ("|") in URIs, so "C:" becomes "C|". +.PP +A fragment identifier, if included, refers to a particular named portion +(fragment) of a resource; text after a \(aq#\(aq identifies the fragment. +A URI beginning with \(aq#\(aq refers to that fragment in the current resource. +.SS Usage +There are many different URI schemes, each with specific +additional rules and meanings, but they are intentionally made to be +as similar as possible. +For example, many URL schemes +permit the authority to be the following format, called here an +.I ip_server +(square brackets show what's optional): +.HP +.IR "ip_server = " [ user " [ : " password " ] @ ] " host " [ : " port ] +.PP +This format allows you to optionally insert a username, +a user plus password, and/or a port number. +The +.I host +is the name of the host computer, either its name as determined by DNS +or an IP address (numbers separated by periods). +Thus the URI + +logs into a web server on host xyz.com +as fred (using fredpassword) using port 8080. +Avoid including a password in a URI if possible because of the many +security risks of having a password written down. +If the URL supplies a username but no password, and the remote +server requests a password, the program interpreting the URL +should request one from the user. +.PP +Here are some of the most common schemes in use on Unix-like systems +that are understood by many tools. +Note that many tools using URIs also have internal schemes or specialized +schemes; see those tools' documentation for information on those schemes. +.PP +.B "http \- Web (HTTP) server" +.PP +.RI http:// ip_server / path +.br +.RI http:// ip_server / path ? query +.PP +This is a URL accessing a web (HTTP) server. +The default port is 80. +If the path refers to a directory, the web server will choose what +to return; usually if there is a file named "index.html" or "index.htm" +its content is returned, otherwise, a list of the files in the current +directory (with appropriate links) is generated and returned. +An example is . +.PP +A query can be given in the archaic "isindex" format, consisting of a +word or phrase and not including an equal sign (=). +A query can also be in the longer "GET" format, which has one or more +query entries of the form +.IR key = value +separated by the ampersand character (&). +Note that +.I key +can be repeated more than once, though it's up to the web server +and its application programs to determine if there's any meaning to that. +There is an unfortunate interaction with HTML/XML/SGML and +the GET query format; when such URIs with more than one key +are embedded in SGML/XML documents (including HTML), the ampersand +(&) has to be rewritten as &. +Note that not all queries use this format; larger forms +may be too long to store as a URI, so they use a different +interaction mechanism (called POST) which does +not include the data in the URI. +See the Common Gateway Interface specification at + for more information. +.PP +.B "ftp \- File Transfer Protocol (FTP)" +.PP +.RI ftp:// ip_server / path +.PP +This is a URL accessing a file through the file transfer protocol (FTP). +The default port (for control) is 21. +If no username is included, the username "anonymous" is supplied, and +in that case many clients provide as the password the requestor's +Internet email address. +An example is +. +.PP +.B "gopher \- Gopher server" +.PP +.RI gopher:// ip_server / "gophertype selector" +.br +.RI gopher:// ip_server / "gophertype selector" %09 search +.br +.RI gopher:// ip_server / "gophertype selector" %09 search %09 gopher+_string +.br +.PP +The default gopher port is 70. +.I gophertype +is a single-character field to denote the +Gopher type of the resource to +which the URL refers. +The entire path may also be empty, in +which case the delimiting "/" is also optional and the gophertype +defaults to "1". +.PP +.I selector +is the Gopher selector string. +In the Gopher protocol, +Gopher selector strings are a sequence of octets which may contain +any octets except 09 hexadecimal (US-ASCII HT or tab), 0A hexadecimal +(US-ASCII character LF), and 0D (US-ASCII character CR). +.PP +.B "mailto \- Email address" +.PP +.RI mailto: email-address +.PP +This is an email address, usually of the form +.IR name @ hostname . +See +.BR mailaddr (7) +for more information on the correct format of an email address. +Note that any % character must be rewritten as %25. +An example is . +.PP +.B "news \- Newsgroup or News message" +.PP +.RI news: newsgroup-name +.br +.RI news: message-id +.PP +A +.I newsgroup-name +is a period-delimited hierarchical name, such as +"comp.infosystems.www.misc". +If is "*" (as in ), it is used to refer +to "all available news groups". +An example is . +.PP +A +.I message-id +corresponds to the Message-ID of +.UR http://www.ietf.org/rfc/rfc1036.txt +IETF RFC\ 1036, +.UE +without the enclosing "<" +and ">"; it takes the form +.IR unique @ full_domain_name . +A message identifier may be distinguished from a news group name by the +presence of the "@" character. +.PP +.B "telnet \- Telnet login" +.PP +.RI telnet:// ip_server / +.PP +The Telnet URL scheme is used to designate interactive text services that +may be accessed by the Telnet protocol. +The final "/" character may be omitted. +The default port is 23. +An example is . +.PP +.B "file \- Normal file" +.PP +.RI file:// ip_server / path_segments +.br +.RI file: path_segments +.PP +This represents a file or directory accessible locally. +As a special case, +.I host +can be the string "localhost" or the empty +string; this is interpreted as "the machine from which the URL is +being interpreted". +If the path is to a directory, the viewer should display the +directory's contents with links to each containee; +not all viewers currently do this. +KDE supports generated files through the URL . +If the given file isn't found, browser writers may want to try to expand +the filename via filename globbing +(see +.BR glob (7) +and +.BR glob (3)). +.PP +The second format (e.g., ) +is a correct format for referring to +a local file. +However, older standards did not permit this format, +and some programs don't recognize this as a URI. +A more portable syntax is to use an empty string as the server name, +for example, +; this form does the same thing +and is easily recognized by pattern matchers and older programs as a URI. +Note that if you really mean to say "start from the current location," don't +specify the scheme at all; use a relative address like <../test.txt>, +which has the side-effect of being scheme-independent. +An example of this scheme is . +.PP +.B "man \- Man page documentation" +.PP +.RI man: command-name +.br +.RI man: command-name ( section ) +.PP +This refers to local online manual (man) reference pages. +The command name can optionally be followed by a +parenthesis and section number; see +.BR man (7) +for more information on the meaning of the section numbers. +This URI scheme is unique to Unix-like systems (such as Linux) +and is not currently registered by the IETF. +An example is . +.PP +.B "info \- Info page documentation" +.PP +.RI info: virtual-filename +.br +.RI info: virtual-filename # nodename +.br +.RI info:( virtual-filename ) +.br +.RI info:( virtual-filename ) nodename +.PP +This scheme refers to online info reference pages (generated from +texinfo files), +a documentation format used by programs such as the GNU tools. +This URI scheme is unique to Unix-like systems (such as Linux) +and is not currently registered by the IETF. +As of this writing, GNOME and KDE differ in their URI syntax +and do not accept the other's syntax. +The first two formats are the GNOME format; in nodenames all spaces +are written as underscores. +The second two formats are the KDE format; +spaces in nodenames must be written as spaces, even though this +is forbidden by the URI standards. +It's hoped that in the future most tools will understand all of these +formats and will always accept underscores for spaces in nodenames. +In both GNOME and KDE, if the form without the nodename is used the +nodename is assumed to be "Top". +Examples of the GNOME format are and . +Examples of the KDE format are and . +.PP +.B "whatis \- Documentation search" +.PP +.RI whatis: string +.PP +This scheme searches the database of short (one-line) descriptions of +commands and returns a list of descriptions containing that string. +Only complete word matches are returned. +See +.BR whatis (1). +This URI scheme is unique to Unix-like systems (such as Linux) +and is not currently registered by the IETF. +.PP +.B "ghelp \- GNOME help documentation" +.PP +.RI ghelp: name-of-application +.PP +This loads GNOME help for the given application. +Note that not much documentation currently exists in this format. +.PP +.B "ldap \- Lightweight Directory Access Protocol" +.PP +.RI ldap:// hostport +.br +.RI ldap:// hostport / +.br +.RI ldap:// hostport / dn +.br +.RI ldap:// hostport / dn ? attributes +.br +.RI ldap:// hostport / dn ? attributes ? scope +.br +.RI ldap:// hostport / dn ? attributes ? scope ? filter +.br +.RI ldap:// hostport / dn ? attributes ? scope ? filter ? extensions +.PP +This scheme supports queries to the +Lightweight Directory Access Protocol (LDAP), a protocol for querying +a set of servers for hierarchically organized information +(such as people and computing resources). +More information on the LDAP URL scheme is available in +.UR http://www.ietf.org/rfc/rfc2255.txt +RFC\ 2255. +.UE +The components of this URL are: +.IP hostport 12 +the LDAP server to query, written as a hostname optionally followed by +a colon and the port number. +The default LDAP port is TCP port 389. +If empty, the client determines which the LDAP server to use. +.IP dn +the LDAP Distinguished Name, which identifies +the base object of the LDAP search (see +.UR http://www.ietf.org/rfc/rfc2253.txt +RFC\ 2253 +.UE +section 3). +.IP attributes +a comma-separated list of attributes to be returned; +see RFC\ 2251 section 4.1.5. +If omitted, all attributes should be returned. +.IP scope +specifies the scope of the search, which can be one of +"base" (for a base object search), "one" (for a one-level search), +or "sub" (for a subtree search). +If scope is omitted, "base" is assumed. +.IP filter +specifies the search filter (subset of entries +to return). +If omitted, all entries should be returned. +See +.UR http://www.ietf.org/rfc/rfc2254.txt +RFC\ 2254 +.UE +section 4. +.IP extensions +a comma-separated list of type=value +pairs, where the =value portion may be omitted for options not +requiring it. +An extension prefixed with a \(aq!\(aq is critical +(must be supported to be valid), otherwise it is noncritical (optional). +.PP +LDAP queries are easiest to explain by example. +Here's a query that asks ldap.itd.umich.edu for information about +the University of Michigan in the U.S.: +.PP +.nf +ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US +.fi +.PP +To just get its postal address attribute, request: +.PP +.nf +ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US?postalAddress +.fi +.PP +To ask a host.com at port 6666 for information about the person +with common name (cn) "Babs Jensen" at University of Michigan, request: +.PP +.nf +ldap://host.com:6666/o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen) +.fi +.PP +.B "wais \- Wide Area Information Servers" +.PP +.RI wais:// hostport / database +.br +.RI wais:// hostport / database ? search +.br +.RI wais:// hostport / database / wtype / wpath +.PP +This scheme designates a WAIS database, search, or document +(see +.UR http://www.ietf.org/rfc/rfc1625.txt +IETF RFC\ 1625 +.UE +for more information on WAIS). +Hostport is the hostname, optionally followed by a colon and port number +(the default port number is 210). +.PP +The first form designates a WAIS database for searching. +The second form designates a particular search of the WAIS database +.IR database . +The third form designates a particular document within a WAIS +database to be retrieved. +.I wtype +is the WAIS designation of the type of the object and +.I wpath +is the WAIS document-id. +.PP +.B "other schemes" +.PP +There are many other URI schemes. +Most tools that accept URIs support a set of internal URIs +(e.g., Mozilla has the about: scheme for internal information, +and the GNOME help browser has the toc: scheme for various starting +locations). +There are many schemes that have been defined but are not as widely +used at the current time +(e.g., prospero). +The nntp: scheme is deprecated in favor of the news: scheme. +URNs are to be supported by the urn: scheme, with a hierarchical name space +(e.g., urn:ietf:... would identify IETF documents); at this time +URNs are not widely implemented. +Not all tools support all schemes. +.SS "Character Encoding" +.PP +URIs use a limited number of characters so that they can be +typed in and used in a variety of situations. +.PP +The following characters are reserved, that is, they may appear in a +URI but their use is limited to their reserved purpose +(conflicting data must be escaped before forming the URI): +.IP + ; / ? : @ & = + $ , +.PP +Unreserved characters may be included in a URI. +Unreserved characters +include upper and lower case English letters, +decimal digits, and the following +limited set of punctuation marks and symbols: +.IP + \- _ . ! ~ * ' ( ) +.PP +All other characters must be escaped. +An escaped octet is encoded as a character triplet, consisting of the +percent character "%" followed by the two hexadecimal digits +representing the octet code (you can use upper or lower case letters +for the hexadecimal digits). +For example, a blank space must be escaped +as "%20", a tab character as "%09", and the "&" as "%26". +Because the percent "%" character always has the reserved purpose of +being the escape indicator, it must be escaped as "%25". +It is common practice to escape space characters as the plus symbol (+) +in query text; this practice isn't uniformly defined +in the relevant RFCs (which recommend %20 instead) but any tool accepting +URIs with query text should be prepared for them. +A URI is always shown in its "escaped" form. +.PP +Unreserved characters can be escaped without changing the semantics +of the URI, but this should not be done unless the URI is being used +in a context that does not allow the unescaped character to appear. +For example, "%7e" is sometimes used instead of "~" in an HTTP URL +path, but the two are equivalent for an HTTP URL. +.PP +For URIs which must handle characters outside the US ASCII character set, +the HTML 4.01 specification (section B.2) and +IETF RFC\ 2718 (section 2.2.5) recommend the following approach: +.IP 1. 4 +translate the character sequences into UTF-8 (IETF RFC\ 2279) \(em see +.BR utf-8 (7) +\(em and then +.IP 2. +use the URI escaping mechanism, that is, +use the %HH encoding for unsafe octets. +.SS "Writing a URI" +When written, URIs should be placed inside double quotes +(e.g., "http://www.kernelnotes.org"), +enclosed in angle brackets (e.g., ), +or placed on a line by themselves. +A warning for those who use double-quotes: +.B never +move extraneous punctuation (such as the period ending a sentence or the +comma in a list) +inside a URI, since this will change the value of the URI. +Instead, use angle brackets instead, or +switch to a quoting system that never includes extraneous characters +inside quotation marks. +This latter system, called the 'new' or 'logical' quoting system by +"Hart's Rules" and the "Oxford Dictionary for Writers and Editors", +is preferred practice in Great Britain and hackers worldwide +(see the +Jargon File's section on Hacker Writing Style, +.IR http://www.fwi.uva.nl/~mes/jargon/h/HackerWritingStyle.html , +for more information). +Older documents suggested inserting the prefix "URL:" +just before the URI, but this form has never caught on. +.PP +The URI syntax was designed to be unambiguous. +However, as URIs have become commonplace, traditional media +(television, radio, newspapers, billboards, etc.) have increasingly +used abbreviated URI references consisting of +only the authority and path portions of the identified resource +(e.g., ). +Such references are primarily +intended for human interpretation rather than machine, with the +assumption that context-based heuristics are sufficient to complete +the URI (e.g., hostnames beginning with "www" are likely to have +a URI prefix of "http://" and hostnames beginning with "ftp" likely +to have a prefix of "ftp://"). +Many client implementations heuristically resolve these references. +Such heuristics may +change over time, particularly when new schemes are introduced. +Since an abbreviated URI has the same syntax as a relative URL path, +abbreviated URI references cannot be used where relative URIs are +permitted, and can only be used when there is no defined base +(such as in dialog boxes). +Don't use abbreviated URIs as hypertext links inside a document; +use the standard format as described here. +.SH "CONFORMING TO" +.PP +.I http://www.ietf.org/rfc/rfc2396.txt +(IETF RFC\ 2396), +.I http://www.w3.org/TR/REC-html40 +(HTML 4.0). +.SH NOTES +Any tool accepting URIs (e.g., a web browser) on a Linux system should +be able to handle (directly or indirectly) all of the +schemes described here, including the man: and info: schemes. +Handling them by invoking some other program is +fine and in fact encouraged. +.PP +Technically the fragment isn't part of the URI. +.PP +For information on how to embed URIs (including URLs) in a data format, +see documentation on that format. +HTML uses the format +.I text +. +Texinfo files use the format @uref{\fIuri\fP}. +Man and mdoc have the recently added UR macro, or just include the +URI in the text (viewers should be able to detect :// as part of a URI). +.PP +The GNOME and KDE desktop environments currently vary in the URIs +they accept, in particular in their respective help browsers. +To list man pages, GNOME uses while KDE uses , and +to list info pages, GNOME uses while KDE uses +(the author of this man page prefers the KDE approach here, though a more +regular format would be even better). +In general, KDE uses as a prefix to a set of generated +files. +KDE prefers documentation in HTML, accessed via the +. +GNOME prefers the ghelp scheme to store and find documentation. +Neither browser handles file: references to directories at the time +of this writing, making it difficult to refer to an entire directory with +a browsable URI. +As noted above, these environments differ in how they handle the +info: scheme, probably the most important variation. +It is expected that GNOME and KDE +will converge to common URI formats, and a future +version of this man page will describe the converged result. +Efforts to aid this convergence are encouraged. +.SS Security +.PP +A URI does not in itself pose a security threat. +There is no general guarantee that a URL, which at one time +located a given resource, will continue to do so. +Nor is there any +guarantee that a URL will not locate a different resource at some +later point in time; such a guarantee can only be +obtained from the person(s) controlling that namespace and the +resource in question. +.PP +It is sometimes possible to construct a URL such that an attempt to +perform a seemingly harmless operation, such as the +retrieval of an entity associated with the resource, will in fact +cause a possibly damaging remote operation to occur. +The unsafe URL +is typically constructed by specifying a port number other than that +reserved for the network protocol in question. +The client unwittingly contacts a site that is in fact +running a different protocol. +The content of the URL contains instructions that, when +interpreted according to this other protocol, cause an unexpected +operation. +An example has been the use of a gopher URL to cause an +unintended or impersonating message to be sent via a SMTP server. +.PP +Caution should be used when using any URL that specifies a port +number other than the default for the protocol, especially when it is +a number within the reserved space. +.PP +Care should be taken when a URI contains escaped delimiters for a +given protocol (for example, CR and LF characters for telnet +protocols) that these are not unescaped before transmission. +This might violate the protocol, but avoids the potential for such +characters to be used to simulate an extra operation or parameter in +that protocol, which might lead to an unexpected and possibly harmful +remote operation to be performed. +.PP +It is clearly unwise to use a URI that contains a password which is +intended to be secret. +In particular, the use of a password within +the "userinfo" component of a URI is strongly recommended against except +in those rare cases where the "password" parameter is intended to be public. +.SH BUGS +.PP +Documentation may be placed in a variety of locations, so there +currently isn't a good URI scheme for general online documentation +in arbitrary formats. +References of the form + don't work because different distributions and +local installation requirements may place the files in different +directories +(it may be in /usr/doc, or /usr/local/doc, or /usr/share, +or somewhere else). +Also, the directory ZZZ usually changes when a version changes +(though filename globbing could partially overcome this). +Finally, using the file: scheme doesn't easily support people +who dynamically load documentation from the Internet (instead of +loading the files onto a local file system). +A future URI scheme may be added (e.g., "userdoc:") to permit +programs to include cross-references to more detailed documentation +without having to know the exact location of that documentation. +Alternatively, a future version of the file-system specification may +specify file locations sufficiently so that the file: scheme will +be able to locate documentation. +.PP +Many programs and file formats don't include a way to incorporate +or implement links using URIs. +.PP +Many programs can't handle all of these different URI formats; there +should be a standard mechanism to load an arbitrary URI that automatically +detects the users' environment (e.g., text or graphics, +desktop environment, local user preferences, and currently executing +tools) and invokes the right tool for any URI. +.\" .SH AUTHOR +.\" David A. Wheeler (dwheeler@dwheeler.com) wrote this man page. +.SH "SEE ALSO" +.BR lynx (1), +.BR man2html (1), +.BR mailaddr (7), +.BR utf-8 (7), +.UR http://www.ietf.org/rfc/rfc2255.txt +IETF RFC\ 2255 +.UE diff --git a/original/man7/url.7 b/original/man7/url.7 new file mode 100644 index 00000000..079fb5e7 --- /dev/null +++ b/original/man7/url.7 @@ -0,0 +1 @@ +.so man7/uri.7 diff --git a/original/man7/urn.7 b/original/man7/urn.7 new file mode 100644 index 00000000..079fb5e7 --- /dev/null +++ b/original/man7/urn.7 @@ -0,0 +1 @@ +.so man7/uri.7 diff --git a/original/man7/utf-8.7 b/original/man7/utf-8.7 new file mode 100644 index 00000000..2e06d97b --- /dev/null +++ b/original/man7/utf-8.7 @@ -0,0 +1,298 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) Markus Kuhn, 1996, 2001 +.\" +.\" 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. +.\" +.\" 1995-11-26 Markus Kuhn +.\" First version written +.\" 2001-05-11 Markus Kuhn +.\" Update +.\" +.TH UTF-8 7 2001-05-11 "GNU" "Linux Programmer's Manual" +.SH NAME +UTF-8 \- an ASCII compatible multibyte Unicode encoding +.SH DESCRIPTION +The +.B Unicode 3.0 +character set occupies a 16-bit code space. +The most obvious +Unicode encoding (known as +.BR UCS-2 ) +consists of a sequence of 16-bit words. +Such strings can contain as +parts of many 16-bit characters bytes +like \(aq\\0\(aq or \(aq/\(aq which have a +special meaning in filenames and other C library function arguments. +In addition, the majority of Unix tools expects ASCII files and can't +read 16-bit words as characters without major modifications. +For these reasons, +.B UCS-2 +is not a suitable external encoding of +.B Unicode +in filenames, text files, environment variables, etc. +The +.BR "ISO 10646 Universal Character Set (UCS)" , +a superset of Unicode, occupies even a 31-bit code space and the obvious +.B UCS-4 +encoding for it (a sequence of 32-bit words) has the same problems. + +The +.B UTF-8 +encoding of +.B Unicode +and +.B UCS +does not have these problems and is the common way in which +.B Unicode +is used on Unix-style operating systems. +.SS Properties +The +.B UTF-8 +encoding has the following nice properties: +.TP 0.2i +* +.B UCS +characters 0x00000000 to 0x0000007f (the classic +.B US-ASCII +characters) are encoded simply as bytes 0x00 to 0x7f (ASCII +compatibility). +This means that files and strings which contain only +7-bit ASCII characters have the same encoding under both +.B ASCII +and +.BR UTF-8 . +.TP +* +All +.B UCS +characters greater than 0x7f are encoded as a multibyte sequence +consisting only of bytes in the range 0x80 to 0xfd, so no ASCII +byte can appear as part of another character and there are no +problems with, for example, \(aq\\0\(aq or \(aq/\(aq. +.TP +* +The lexicographic sorting order of +.B UCS-4 +strings is preserved. +.TP +* +All possible 2^31 UCS codes can be encoded using +.BR UTF-8 . +.TP +* +The bytes 0xfe and 0xff are never used in the +.B UTF-8 +encoding. +.TP +* +The first byte of a multibyte sequence which represents a single non-ASCII +.B UCS +character is always in the range 0xc0 to 0xfd and indicates how long +this multibyte sequence is. +All further bytes in a multibyte sequence +are in the range 0x80 to 0xbf. +This allows easy resynchronization and +makes the encoding stateless and robust against missing bytes. +.TP +* +.B UTF-8 +encoded +.B UCS +characters may be up to six bytes long, however the +.B Unicode +standard specifies no characters above 0x10ffff, so Unicode characters +can only be up to four bytes long in +.BR UTF-8 . +.SS Encoding +The following byte sequences are used to represent a character. +The sequence to be used depends on the UCS code number of the character: +.TP 0.4i +0x00000000 \- 0x0000007F: +.RI 0 xxxxxxx +.TP +0x00000080 \- 0x000007FF: +.RI 110 xxxxx +.RI 10 xxxxxx +.TP +0x00000800 \- 0x0000FFFF: +.RI 1110 xxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.TP +0x00010000 \- 0x001FFFFF: +.RI 11110 xxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.TP +0x00200000 \- 0x03FFFFFF: +.RI 111110 xx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.TP +0x04000000 \- 0x7FFFFFFF: +.RI 1111110 x +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.PP +The +.I xxx +bit positions are filled with the bits of the character code number in +binary representation. +Only the shortest possible multibyte sequence +which can represent the code number of the character can be used. +.PP +The +.B UCS +code values 0xd800\(en0xdfff (UTF-16 surrogates) as well as 0xfffe and +0xffff (UCS noncharacters) should not appear in conforming +.B UTF-8 +streams. +.SS Example +The +.B Unicode +character 0xa9 = 1010 1001 (the copyright sign) is encoded +in UTF-8 as +.PP +.RS +11000010 10101001 = 0xc2 0xa9 +.RE +.PP +and character 0x2260 = 0010 0010 0110 0000 (the "not equal" symbol) is +encoded as: +.PP +.RS +11100010 10001001 10100000 = 0xe2 0x89 0xa0 +.RE +.SS "Application Notes" +Users have to select a +.B UTF-8 +locale, for example with +.PP +.RS +export LANG=en_GB.UTF-8 +.RE +.PP +in order to activate the +.B UTF-8 +support in applications. +.PP +Application software that has to be aware of the used character +encoding should always set the locale with for example +.PP +.RS +setlocale(LC_CTYPE, "") +.RE +.PP +and programmers can then test the expression +.PP +.RS +strcmp(nl_langinfo(CODESET), "UTF-8") == 0 +.RE +.PP +to determine whether a +.B UTF-8 +locale has been selected and whether +therefore all plaintext standard input and output, terminal +communication, plaintext file content, filenames and environment +variables are encoded in +.BR UTF-8 . +.PP +Programmers accustomed to single-byte encodings such as +.B US-ASCII +or +.B ISO 8859 +have to be aware that two assumptions made so far are no longer valid +in +.B UTF-8 +locales. +Firstly, a single byte does not necessarily correspond any +more to a single character. +Secondly, since modern terminal emulators +in +.B UTF-8 +mode also support Chinese, Japanese, and Korean +.B double-width characters +as well as nonspacing +.BR "combining characters" , +outputting a single character does not necessarily advance the cursor +by one position as it did in +.BR ASCII . +Library functions such as +.BR mbsrtowcs (3) +and +.BR wcswidth (3) +should be used today to count characters and cursor positions. +.PP +The official ESC sequence to switch from an +.B ISO 2022 +encoding scheme (as used for instance by VT100 terminals) to +.B UTF-8 +is ESC % G +("\\x1b%G"). +The corresponding return sequence from +.B UTF-8 +to ISO 2022 is ESC % @ ("\\x1b%@"). +Other ISO 2022 sequences (such as +for switching the G0 and G1 sets) are not applicable in UTF-8 mode. +.PP +It can be hoped that in the foreseeable future, +.B UTF-8 +will replace +.B ASCII +and +.B ISO 8859 +at all levels as the common character encoding on POSIX systems, +leading to a significantly richer environment for handling plain text. +.SS Security +The +.BR Unicode " and " UCS +standards require that producers of +.B UTF-8 +shall use the shortest form possible, for example, producing a two-byte +sequence with first byte 0xc0 is nonconforming. +.B Unicode 3.1 +has added the requirement that conforming programs must not accept +non-shortest forms in their input. +This is for security reasons: if +user input is checked for possible security violations, a program +might check only for the +.B ASCII +version of "/../" or ";" or NUL and overlook that there are many +.RB non- ASCII +ways to represent these things in a non-shortest +.B UTF-8 +encoding. +.SS Standards +ISO/IEC 10646-1:2000, Unicode 3.1, RFC\ 2279, Plan 9. +.\" .SH AUTHOR +.\" Markus Kuhn +.SH "SEE ALSO" +.BR nl_langinfo (3), +.BR setlocale (3), +.BR charsets (7), +.BR unicode (7) diff --git a/original/man7/utf8.7 b/original/man7/utf8.7 new file mode 100644 index 00000000..52a90084 --- /dev/null +++ b/original/man7/utf8.7 @@ -0,0 +1 @@ +.so man7/utf-8.7 diff --git a/original/man7/x25.7 b/original/man7/x25.7 new file mode 100644 index 00000000..a0ad7788 --- /dev/null +++ b/original/man7/x25.7 @@ -0,0 +1,122 @@ +.\" This man page is Copyright (C) 1998 Heiner Eisen. +.\" 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. +.\" $Id: x25.7,v 1.4 1999/05/18 10:35:12 freitag Exp $ +.TH X25 7 2008-08-08 "Linux" "Linux Programmer's Manual" +.SH NAME +x25, AF_X25 \- ITU-T X.25 / ISO-8208 protocol interface. +.SH SYNOPSIS +.B #include +.br +.B #include +.sp +.B x25_socket = socket(AF_X25, SOCK_SEQPACKET, 0); +.SH DESCRIPTION +X25 sockets provide an interface to the X.25 packet layer protocol. +This allows applications to +communicate over a public X.25 data network as standardized by +International Telecommunication Union's recommendation X.25 +(X.25 DTE-DCE mode). +X25 sockets can also be used for communication +without an intermediate X.25 network (X.25 DTE-DTE mode) as described +in ISO-8208. +.PP +Message boundaries are preserved \(em a +.BR read (2) +from a socket will +retrieve the same chunk of data as output with the corresponding +.BR write (2) +to the peer socket. +When necessary, the kernel takes care +of segmenting and reassembling long messages by means of +the X.25 M-bit. +There is no hard-coded upper limit for the +message size. +However, reassembling of a long message might fail if +there is a temporary lack of system resources or when other constraints +(such as socket memory or buffer size limits) become effective. +If that +occurs, the X.25 connection will be reset. +.SS Socket Addresses +The +.B AF_X25 +socket address family uses the +.I struct sockaddr_x25 +for representing network addresses as defined in ITU-T +recommendation X.121. +.PP +.in +4n +.nf +struct sockaddr_x25 { + sa_family_t sx25_family; /* must be AF_X25 */ + x25_address sx25_addr; /* X.121 Address */ +}; +.fi +.in +.PP +.I sx25_addr +contains a char array +.I x25_addr[] +to be interpreted as a null-terminated string. +.I sx25_addr.x25_addr[] +consists of up to 15 (not counting the terminating 0) ASCII +characters forming the X.121 address. +Only the decimal digit characters from \(aq0\(aq to \(aq9\(aq are allowed. +.SS Socket Options +The following X.25-specific socket options can be set by using +.BR setsockopt (2) +and read with +.BR getsockopt (2) +with the +.I level +argument set to +.BR SOL_X25 . +.TP +.B X25_QBITINCL +Controls whether the X.25 Q-bit (Qualified Data Bit) is accessible by the +user. +It expects an integer argument. +If set to 0 (default), +the Q-bit is never set for outgoing packets and the Q-bit of incoming +packets is ignored. +If set to 1, an additional first byte is prepended +to each message read from or written to the socket. +For data read from +the socket, a 0 first byte indicates that the Q-bits of the corresponding +incoming data packets were not set. +A first byte with value 1 indicates +that the Q-bit of the corresponding incoming data packets was set. +If the first byte of the data written to the socket is 1 the Q-bit of the +corresponding outgoing data packets will be set. +If the first byte is 0 +the Q-bit will not be set. +.SH VERSIONS +The AF_X25 protocol family is a new feature of Linux 2.2. +.SH BUGS +Plenty, as the X.25 PLP implementation is +.BR CONFIG_EXPERIMENTAL . +.PP +This man page is incomplete. +.PP +There is no dedicated application programmer's header file yet; +you need to include the kernel header file +.IR . +.B CONFIG_EXPERIMENTAL +might also imply that future versions of the +interface are not binary compatible. +.PP +X.25 N-Reset events are not propagated to the user process yet. +Thus, +if a reset occurred, data might be lost without notice. +.SH "SEE ALSO" +.BR socket (2), +.BR socket (7) +.PP +Jonathan Simon Naylor: +\(lqThe Re-Analysis and Re-Implementation of X.25.\(rq +The URL is +.RS +.I ftp://ftp.pspt.fi/pub/ham/linux/ax25/x25doc.tgz +.RE diff --git a/original/man8/intro.8 b/original/man8/intro.8 new file mode 100644 index 00000000..ea61d39c --- /dev/null +++ b/original/man8/intro.8 @@ -0,0 +1,47 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" and Copyright (C) 2007 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 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 +.\" +.TH INTRO 8 2007-10-23 "Linux" "Linux Programmer's Manual" +.SH NAME +intro \- Introduction to administration and privileged commands +.SH DESCRIPTION +Section 8 of the manual describes commands +which either can be or are only used by the superuser, +like system-administration commands, daemons, +and hardware-related commands. + +As with the commands in described section 1, the commands described +in this section terminate with an exit status that indicates +whether the command succeeded or failed. +See +.BR intro (1) +for more information. +.SH NOTES +.SS Authors and Copyright Conditions +Look at the header of the manual page source for the author(s) and copyright +conditions. +Note that these can be different from page to page! diff --git a/original/man8/ld-linux.8 b/original/man8/ld-linux.8 new file mode 100644 index 00000000..c5756202 --- /dev/null +++ b/original/man8/ld-linux.8 @@ -0,0 +1 @@ +.so man8/ld.so.8 diff --git a/original/man8/ld-linux.so.8 b/original/man8/ld-linux.so.8 new file mode 100644 index 00000000..c5756202 --- /dev/null +++ b/original/man8/ld-linux.so.8 @@ -0,0 +1 @@ +.so man8/ld.so.8 diff --git a/original/man8/ld.so.8 b/original/man8/ld.so.8 new file mode 100644 index 00000000..84278d06 --- /dev/null +++ b/original/man8/ld.so.8 @@ -0,0 +1,379 @@ +.\" This is in the public domain +.TH LD.SO 8 2009-01-12 "GNU" "Linux Programmer's Manual" +.SH NAME +ld.so, ld-linux.so* \- dynamic linker/loader +.SH SYNOPSIS +The dynamic linker can be run either indirectly by running some +dynamically linked program or library (in which case no command-line options +to the dynamic linker can be passed and, in the ELF case, the dynamic linker +which is stored in the +.B .interp +section of the program is executed) or directly by running: +.P +.I /lib/ld-linux.so.* +[OPTIONS] [PROGRAM [ARGUMENTS]] +.SH DESCRIPTION +The programs +.B ld.so +and +.B ld-linux.so* +find and load the shared libraries needed by a program, prepare +the program to run, and then run it. +.LP +Linux binaries require dynamic linking (linking at run time) +unless the +.B \-static +option was given to +.BR ld (1) +during compilation. +.LP +The program +.B ld.so +handles a.out binaries, a format used long ago; +.B ld-linux.so* +handles ELF (\fI/lib/ld-linux.so.1\fP for libc5, \fI/lib/ld-linux.so.2\fP +for glibc2), which everybody has been using for years now. +Otherwise both have the same behavior, and use the same +support files and programs +.BR ldd (1), +.BR ldconfig (8) +and +.IR /etc/ld.so.conf . +.LP +The shared libraries needed by the program are searched for +in the following order: +.IP o 3 +(ELF only) Using the directories specified in the +DT_RPATH dynamic section attribute +of the binary if present and DT_RUNPATH attribute does not exist. +Use of DT_RPATH is deprecated. +.IP o +Using the environment variable +.BR LD_LIBRARY_PATH . +Except if the executable is a set-user-ID/set-group-ID binary, +in which case it is ignored. +.IP o +(ELF only) Using the directories specified in the +DT_RUNPATH dynamic section attribute +of the binary if present. +.IP o +From the cache file +.I /etc/ld.so.cache +which contains a compiled list of candidate libraries previously found +in the augmented library path. +If, however, the binary was linked with the +.B \-z nodeflib +linker option, libraries in the default library paths are skipped. +.IP o +In the default path +.IR /lib , +and then +.IR /usr/lib . +If the binary was linked with the +.B \-z nodeflib +linker option, this step is skipped. +.SS $ORIGIN and rpath +.PP +.B ld.so +understands the string +.I $ORIGIN +(or equivalently +.IR ${ORIGIN} ) +in an rpath specification (DT_RPATH or DT_RUNPATH) to mean +the directory containing the application executable. +Thus, an application located in +.I somedir/app +could be compiled with +.I gcc -Wl,-rpath,\(aq$ORIGIN/../lib\(aq +so that it finds an associated shared library in +.I somedir/lib +no matter where +.I somedir +is located in the directory hierarchy. +This facilitates the creation of "turn-key" applications that +do not need to be installed into special directories, +but can instead be unpacked into any directory +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!! +.SH OPTIONS +.TP +.B \-\-list +List all dependencies and how they are resolved. +.TP +.B \-\-verify +Verify that program is dynamically linked and this dynamic linker can handle +it. +.TP +.B \-\-library\-path PATH +Override +.B LD_LIBRARY_PATH +environment variable setting (see below). +.TP +.B \-\-inhibit\-rpath LIST +Ignore RPATH and RUNPATH information in object names in LIST. +This option is ignored if +.B ld.so +is set-user-ID or set-group-ID. +.SH ENVIRONMENT +There are four important environment variables. +.TP +.B LD_BIND_NOW +(libc5; glibc since 2.1.1) +If set to a nonempty string, +causes the dynamic linker to resolve all symbols +at program startup instead of deferring function call resolution to the point +when they are first referenced. +This is useful when using a debugger. +.TP +.B LD_LIBRARY_PATH +A colon-separated list of directories in which to search for +ELF libraries at execution-time. +Similar to the +.B PATH +environment variable. +.TP +.B LD_PRELOAD +A whitespace-separated list of additional, user-specified, ELF shared +libraries to be loaded before all others. +This can be used to selectively override functions in other shared libraries. +For set-user-ID/set-group-ID ELF binaries, +only libraries in the standard search +directories that are also set-user-ID will be loaded. +.TP +.B LD_TRACE_LOADED_OBJECTS +(ELF only) +If set to a nonempty string, causes the program to list its dynamic library +dependencies, as if run by +.BR ldd (1), +instead of running normally. +.LP +Then there are lots of more or less obscure variables, +many obsolete or only for internal use. +.TP +.B LD_AOUT_LIBRARY_PATH +(libc5) +Version of +.B LD_LIBRARY_PATH +for a.out binaries only. +Old versions of ld\-linux.so.1 also supported +.BR LD_ELF_LIBRARY_PATH . +.TP +.B LD_AOUT_PRELOAD +(libc5) +Version of +.B LD_PRELOAD +for a.out binaries only. +Old versions of ld\-linux.so.1 also supported +.BR LD_ELF_PRELOAD . +.TP +.B LD_AUDIT +(glibc since 2.4) +A colon-separated list of user-specified, ELF shared objects +to be loaded before all others in a separate linker namespace +(i.e., one that does not intrude upon the normal symbol bindings that +would occur in the process). +These libraries can be used to audit the operation of the dynamic linker. +.B LD_AUDIT +is ignored for set-user-ID/set-group-ID binaries. + +The dynamic linker will notify the audit +libraries at so-called auditing checkpoints\(emfor example, +loading a new library, resolving a symbol, +or calling a symbol from another shared object\(emby +calling an appropriate function within the audit library. +For details, see +.BR rtld-audit (7). +The auditing interface is largely compatible with that provided on Solaris, +as described in its +.IR "Linker and Libraries Guide" , +in the chapter +.IR "Runtime Linker Auditing Interface" . +.TP +.B LD_BIND_NOT +(glibc since 2.1.95) +Do not update the GOT (global offset table) and PLT (procedure linkage table) +after resolving a symbol. +.TP +.B LD_DEBUG +(glibc since 2.1) +Output verbose debugging information about the dynamic linker. +If set to +.B all +prints all debugging information it has, if set to +.B help +prints a help message about which categories can be specified in this +environment variable. +Since glibc 2.3.4, +.B LD_DEBUG +is ignored for set-user-ID/set-group-ID binaries. +.TP +.B LD_DEBUG_OUTPUT +(glibc since 2.1) +File where +.B LD_DEBUG +output should be fed into, default is standard output. +.B LD_DEBUG_OUTPUT +is ignored for set-user-ID/set-group-ID binaries. +.TP +.B LD_DYNAMIC_WEAK +(glibc since 2.1.91) +Allow weak symbols to be overridden (reverting to old glibc behavior). +For security reasons, since glibc 2.3.4, +.B LD_DYNAMIC_WEAK +is ignored for set-user-ID/set-group-ID binaries. +.TP +.B LD_HWCAP_MASK +(glibc since 2.1) +Mask for hardware capabilities. +.TP +.B LD_KEEPDIR +(a.out only)(libc5) +Don't ignore the directory in the names of a.out libraries to be loaded. +Use of this option is strongly discouraged. +.TP +.B LD_NOWARN +(a.out only)(libc5) +Suppress warnings about a.out libraries with incompatible minor +version numbers. +.TP +.B LD_ORIGIN_PATH +(glibc since 2.1) +Path where the binary is found (for non-set-user-ID programs). +For security reasons, since glibc 2.4, +.B LD_ORIGIN_PATH +is ignored for set-user-ID/set-group-ID binaries. +.\" 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 +(glibc since 2.4) +Set to 0 to disable pointer guarding. +Any other value enables pointer guarding, which is also the default. +Pointer guarding is a security mechanism whereby some pointers to code +stored in writable program memory (return addresses saved by +.BR setjmp (3) +or function pointers used by various glibc internals) are mangled +semi-randomly to make it more difficult for an attacker to hijack +the pointers for use in the event of a buffer overrun or +stack-smashing attack. +.TP +.B LD_PROFILE +(glibc since 2.1) +Shared object to be profiled, +specified either as a pathname or a soname. +Profiling output is written to the file whose name is: +"\fI$LD_PROFILE_OUTPUT\fP/\fI$LD_PROFILE\fP.profile". +.TP +.B LD_PROFILE_OUTPUT +(glibc since 2.1) +Directory where +.B LD_PROFILE +output should be written. +If this variable is not defined, or is defined as an empty string, +then the default is +.IR /var/tmp . +.B LD_PROFILE_OUTPUT +is ignored for set-user-ID and set-group-ID programs, +which always use +.IR /var/profile . +.TP +.B LD_SHOW_AUXV +(glibc since 2.1) +Show auxiliary array passed up from the kernel. +For security reasons, since glibc 2.3.5, +.B LD_SHOW_AUXV +is ignored for set-user-ID/set-group-ID binaries. +.\" 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 +By default (i.e., if this variable is not defined) +executables and prelinked +shared objects will honor base addresses of their dependent libraries +and (nonprelinked) position-independent executables (PIEs) +and other shared objects will not honor them. +If +.B LD_USE_LOAD_BIAS +is defined wit the value, both executables and PIEs +will honor the base addresses. +If +.B LD_USE_LOAD_BIAS +is defined with the value 0, +neither executables nor PIEs will honor the base addresses. +This variable is ignored by set-user-ID and set-group-ID programs. +.TP +.B LD_VERBOSE +(glibc since 2.1) +If set to a nonempty string, +output symbol versioning information about the +program if querying information about the program (i.e., either +.B LD_TRACE_LOADED_OBJECTS +has been set, or +.B \-\-list +or +.B \-\-verify +options have been given to the dynamic linker). +.TP +.B LD_WARN +(ELF only)(glibc since 2.1.3) +If set to a nonempty string, warn about unresolved symbols. +.TP +.B LDD_ARGV0 +(libc5) +.IR argv [0] +to be used by +.BR ldd (1) +when none is present. +.SH FILES +.PD 0 +.TP +.I /lib/ld.so +a.out dynamic linker/loader +.TP +.IR /lib/ld\-linux.so. { 1 , 2 } +ELF dynamic linker/loader +.TP +.I /etc/ld.so.cache +File containing a compiled list of directories in which to search for +libraries and an ordered list of candidate libraries. +.TP +.I /etc/ld.so.preload +File containing a whitespace separated list of ELF shared libraries to +be loaded before the program. +.TP +.B lib*.so* +shared libraries +.PD +.SH NOTES +The +.B ld.so +functionality is available for executables compiled using libc version +4.4.3 or greater. +ELF functionality is available since Linux 1.1.52 and libc5. +.SH SEE ALSO +.BR ldd (1), +.BR rtld-audit (7), +.BR ldconfig (8) +.\" .SH AUTHORS +.\" ld.so: David Engel, Eric Youngdale, Peter MacDonald, Hongjiu Lu, Linus +.\" Torvalds, Lars Wirzenius and Mitch D'Souza +.\" ld-linux.so: Roland McGrath, Ulrich Drepper and others. +.\" +.\" In the above, (libc5) stands for David Engel's ld.so/ld-linux.so. diff --git a/original/man8/ldconfig.8 b/original/man8/ldconfig.8 new file mode 100644 index 00000000..b7731294 --- /dev/null +++ b/original/man8/ldconfig.8 @@ -0,0 +1,177 @@ +.\" -*- nroff -*- +.\" Copyright 1999 SuSE GmbH Nuernberg, Germany +.\" Author: Thorsten Kukuk +.\" +.\" 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; see the file COPYING. If not, +.\" write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +.\" Boston, MA 02111-1307, USA. +.\" +.\" Modified, 6 May 2002, Michael Kerrisk, +.\" Change listed order of /usr/lib and /lib +.TH LDCONFIG 8 2009-04-15 "GNU" "Linux Programmer's Manual" +.SH NAME +/sbin/ldconfig \- configure dynamic linker run-time bindings +.SH SYNOPSIS +.B /sbin/ldconfig +[ +.B \-nNvXV +] +[ +.BR \-f\ conf +] +[ +.BR \-C\ cache +] +[ +.BR \-r\ root +] +.IR directory \ ... +.PD 0 +.PP +.PD +.B /sbin/ldconfig +.B \-l +[ +.B \-v +] +.IR library \ ... +.PD 0 +.PP +.PD +.B /sbin/ldconfig +.B \-p +.SH DESCRIPTION +.B ldconfig +creates the necessary links and cache to the most recent shared +libraries found in the directories specified on the command line, +in the file +.IR /etc/ld.so.conf , +and in the trusted directories +.RI ( /lib +and +.IR /usr/lib ). +The cache is used by the run-time linker, +.I ld.so +or +.IR ld-linux.so . +.B ldconfig +checks the header and filenames of the libraries it encounters when +determining which versions should have their links updated. +.PP +.B ldconfig +will attempt to deduce the type of ELF libs (i.e., libc5 or libc6/glibc) +based on what C libs, if any, the library was linked against. +.\" 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). +.PP +Some existing libs do not contain enough information to allow the deduction of +their type. +Therefore, the +.I /etc/ld.so.conf +file format allows the specification of an expected type. +This is +.I only +used for those ELF libs which we can not work out. +The format +is "dirname=TYPE", where TYPE can be libc4, libc5, or libc6. +(This syntax also works on the command line.) +Spaces are +.I not +allowed. +Also see the +.B \-p +option. +.B ldconfig +should normally be run by the superuser as it may require write +permission on some root owned directories and files. +.SH OPTIONS +.TP +.B \-v +Verbose mode. +Print current version number, the name of each directory as it +is scanned, and any links that are created. +Overrides quiet mode. +.TP +.B \-n +Only process directories specified on the command line. +Don't process the trusted directories +.RI ( /lib +and +.IR /usr/lib ) +nor those specified in +.IR /etc/ld.so.conf . +Implies +.BR \-N . +.TP +.B \-N +Don't rebuild the cache. +Unless +.B \-X +is also specified, links are still updated. +.TP +.B \-X +Don't update links. +Unless +.B \-N +is also specified, the cache is still rebuilt. +.TP +.B \-f conf +Use +.B conf +instead of +.IR /etc/ld.so.conf . +.TP +.B \-C cache +Use +.B cache +instead of +.IR /etc/ld.so.cache . +.TP +.B \-r root +Change to and use +.I root +as the root directory. +.TP +.B \-l +Library mode. +Manually link individual libraries. +Intended for use by experts only. +.TP +.B \-p +Print the lists of directories and candidate libraries stored in +the current cache. +.SH FILES +.PD 0 +.TP 20 +.I /lib/ld.so +run-time linker/loader +.TP 20 +.I /etc/ld.so.conf +File containing a list of colon, space, tab, newline, or comma-separated +directories in which to search for libraries. +.TP 20 +.I /etc/ld.so.cache +File containing an ordered list of libraries found in the directories +specified in +.IR /etc/ld.so.conf , +as well as those found in +.I /lib +and +.IR /usr/lib . +.PD +.SH SEE ALSO +.BR ldd (1), +.BR ld.so (8) diff --git a/original/man8/nscd.8 b/original/man8/nscd.8 new file mode 100644 index 00000000..4fa9fc2f --- /dev/null +++ b/original/man8/nscd.8 @@ -0,0 +1,90 @@ +.\" -*- nroff -*- +.\" Copyright 1999 SuSE GmbH Nuernberg, Germany +.\" Author: Thorsten Kukuk +.\" +.\" 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; see the file COPYING. If not, +.\" write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +.\" Boston, MA 02111-1307, USA. +.\" +.\" 2008-12-05 Petr Baudis +.\" Rewrite the NOTES section to reflect modern reality +.\" +.TH NSCD 8 2008-12-05 "GNU" "Linux Programmer's Manual" +.SH NAME +/usr/sbin/nscd \- name service cache daemon +.SH DESCRIPTION +Nscd is a daemon that provides a cache for the most common name service +requests. +The default configuration file, +.IR /etc/nscd.conf , +determines the behavior of the cache daemon. +See +.BR nscd.conf (5). + +Nscd provides caching for accesses of the +.BR passwd (5), +.BR group (5), +and +.BR hosts (5) +databases through standard libc interfaces, such as +.BR getpwnam (3), +.BR getpwuid (3), +.BR getgrnam (3), +.BR getgrgid (3), +.BR gethostbyname (3), +and others. + +There are two caches for each database: +a positive one for items found, and a negative one +for items not found. +Each cache has a separate TTL (time-to-live) +period for its data. +Note that the shadow file is specifically not cached. +.BR getspnam (3) +calls remain uncached as a result. +.SH OPTIONS +.TP +.B "\-\-help" +will give you a list with all options and what they do. +.SH NOTES +The daemon will try to watch for changes in configuration files +appropriate for each database (e.g. +.I /etc/passwd +for the +.I passwd +database or +.I /etc/hosts +and +.I /etc/resolv.conf +for the +.I hosts +database), and flush the cache when these are changed. +However, this will happen only after a short delay (unless the +.BR inotify (7) +mechanism is available and glibc 2.9 or later is available), +and this auto-detection does not cover configuration files +required by nonstandard NSS modules, if any are specified in +.IR /etc/nsswitch.conf . +In that case, you need to run the following command +after changing the configuration file of the database so that +.B nscd +invalidates its cache: + + $ \fBnscd -i\fP \fI\fP +.SH "SEE ALSO" +.BR nscd.conf (5), +.BR nsswitch.conf (5) +.\" .SH AUTHOR +.\" .B nscd +.\" was written by Thorsten Kukuk and Ulrich Drepper. diff --git a/original/man8/sync.8 b/original/man8/sync.8 new file mode 100644 index 00000000..584bcf2c --- /dev/null +++ b/original/man8/sync.8 @@ -0,0 +1,84 @@ +.\" Reboot/halt and Linux information extracted from Rick Faith's original +.\" sync(8) manpage, dating back to the Linux 0.99 days. The Linux-specific +.\" information is attributed to Linus Torvalds +.\" Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" May be distributed under the GNU General Public License +.TH SYNC 8 1998-11-01 "GNU" "Linux Programmer's Manual" +.SH NAME +sync \- synchronize data on disk with memory +.SH SYNOPSIS +.B "sync [\-\-help] [\-\-version]" +.SH DESCRIPTION +.B sync +writes any data buffered in memory out to disk. +This can include (but is not limited to) modified superblocks, +modified inodes, and delayed reads and writes. +This must be implemented by the kernel; +The +.B sync +program does nothing but exercise the +.BR sync (2) +system call. +.PP +The kernel keeps data in memory to avoid doing (relatively slow) disk +reads and writes. +This improves performance, but if the computer +crashes, data may be lost or the file system corrupted as a result. +.B sync +ensures that everything in memory is written to disk. +.PP +.B sync +should be called before the processor is halted in an unusual manner +(e.g., before causing a kernel panic when debugging new kernel code). +In general, the processor should be halted using the +.BR shutdown (8) +or +.BR reboot (8) +or +.BR halt (8) +commands, which will attempt to put the system in a quiescent state +before calling +.BR sync (2). +(Various implementations of these commands exist; consult your +documentation; on some systems one should not call +.BR reboot (8) +and +.BR halt (8) +directly.) +.SH "OPTIONS" +.TP +.B "\-\-help" +Print a usage message on standard output and exit successfully. +.TP +.B "\-\-version" +Print version information on standard output, then exit successfully. +.TP +.B "\-\-" +Terminate option list. +.SH ENVIRONMENT +The variables \fBLANG\fP, \fBLC_ALL\fP, \fBLC_CTYPE\fP, +and \fBLC_MESSAGES\fP have the usual meaning. +.SH "CONFORMING TO" +POSIX.2. +.SH NOTES +On Linux, +.B sync +is only guaranteed to schedule the dirty blocks for writing; it can +actually take a short time before all the blocks are finally written. +The +.BR reboot (8) +and +.BR halt (8) +commands take this into account by sleeping for a few seconds after +calling +.BR sync (2). +.PP +This page describes +.B sync +as found in the file\%utils-4.0 package; +other versions may differ slightly. +.SH "SEE ALSO" +.BR sync (2), +.BR halt (8), +.BR reboot (8), +.BR update (8) diff --git a/original/man8/tzselect.8 b/original/man8/tzselect.8 new file mode 100644 index 00000000..e8f2a88c --- /dev/null +++ b/original/man8/tzselect.8 @@ -0,0 +1,48 @@ +.\" This page is in the public domain +.\" +.TH TZSELECT 8 2007-05-18 "" "Linux System Administration" +.SH NAME +tzselect \- select a timezone +.SH SYNOPSIS +.B tzselect +.SH DESCRIPTION +The +.B tzselect +program asks the user for information about the current location, +and outputs the resulting timezone description to standard output. +The output is suitable as a value for the +.B TZ +environment variable. +.PP +All interaction with the user is done via standard input and standard error. +.SH "EXIT STATUS" +The exit status is zero if a timezone was successfully obtained +from the user, nonzero otherwise. +.SH ENVIRONMENT +.TP +\fBAWK\fP +Name of a Posix-compliant +.I awk +program (default: +.BR awk ). +.TP +\fBTZDIR\fP +Name of the directory containing timezone data files (default: +.IR /usr/share/zoneinfo ). +.\" or perhaps /usr/local/etc/zoneinfo in some older systems. +.SH FILES +.TP +\fBTZDIR\fP\fI/iso3166.tab\fP +Table of ISO 3166 2-letter country codes and country names. +.TP +\fBTZDIR\fP\fI/zone.tab\fP +Table of country codes, latitude and longitude, TZ values, and +descriptive comments. +.TP +\fBTZDIR\fP\fI/\fP\fITZ\fP +Time zone data file for timezone \fITZ\fP. +.SH "SEE ALSO" +.BR tzfile (5), +.BR zdump (8), +.BR zic (8) +.\" @(#)tzselect.8 1.3 diff --git a/original/man8/zdump.8 b/original/man8/zdump.8 new file mode 100644 index 00000000..d9e9d7e9 --- /dev/null +++ b/original/man8/zdump.8 @@ -0,0 +1,42 @@ +.\" This page is in the public domain +.\" +.TH ZDUMP 8 2007-05-18 "" "Linux System Administration" +.SH NAME +zdump \- timezone dumper +.SH SYNOPSIS +.B zdump +[ +.B \-v +] [ +.B \-c +cutoffyear ] [ zonename ... ] +.SH DESCRIPTION +.I Zdump +prints the current time in each +.I zonename +named on the command line. +.PP +These options are available: +.TP +.B \-v +For each +.I zonename +on the command line, +print the time at the lowest possible time value, +the time one day after the lowest possible time value, +the times both one second before and exactly at +each detected time discontinuity, +the time at one day less than the highest possible time value, +and the time at the highest possible time value. +Each line ends with +.B isdst=1 +if the given time is Daylight Saving Time or +.B isdst=0 +otherwise. +.TP +.BI "\-c " cutoffyear +Cut off the verbose output near the start of the given year. +.SH "SEE ALSO" +.BR tzfile (5), +.BR zic (8) +.\" @(#)zdump.8 7.3 diff --git a/original/man8/zic.8 b/original/man8/zic.8 new file mode 100644 index 00000000..df800cbf --- /dev/null +++ b/original/man8/zic.8 @@ -0,0 +1,417 @@ +.\" This page is in the public domain +.\" +.TH ZIC 8 2010-02-25 "" "Linux System Administration" +.SH NAME +zic \- timezone compiler +.SH SYNOPSIS +.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 +\&... ] +.SH DESCRIPTION +.if t .ds lq `` +.if t .ds rq '' +.if n .ds lq \&"\" +.if n .ds rq \&"\" +.de q +\\$3\*(lq\\$1\*(rq\\$2 +.. +.I Zic +reads text from the file(s) named on the command line +and creates the time conversion information files specified in this input. +If a +.I filename +is +.BR \- , +the standard input is read. +.PP +These options are available: +.TP +.BI "\-d " directory +Create time conversion information files in the named directory rather than +in the standard directory named below. +.TP +.BI "\-l " timezone +Use the given timezone as local time. +.I Zic +will act as if the input contained a link line of the form +.sp +.ti +.5i +Link \fItimezone\fP localtime +.TP +.BI "\-p " timezone +Use the given timezone's rules when handling POSIX-format +timezone environment variables. +.I Zic +will act as if the input contained a link line of the form +.sp +.ti +.5i +Link \fItimezone\fP posixrules +.TP +.BI "\-L " leapsecondfilename +Read leap second information from the file with the given name. +If this option is not used, +no leap second information appears in output files. +.TP +.B \-v +Complain if a year that appears in a data file is outside the range +of years representable by +.BR time (2) +values. +.TP +.B \-s +Limit time values stored in output files to values that are the same +whether they're taken to be signed or unsigned. +You can use this option to generate SVVS-compatible files. +.TP +.BI "\-y " command +Use the given +.I command +rather than +.B yearistype +when checking year types (see below). +.PP +Input lines are made up of fields. +Fields are separated from one another by any number of white space characters. +Leading and trailing white space on input lines is ignored. +An unquoted sharp character (#) in the input introduces a comment which extends +to the end of the line the sharp character appears on. +White space characters and sharp characters may be enclosed in double quotes +(") if they're to be used as part of a field. +Any line that is blank (after comment stripping) is ignored. +Nonblank lines are expected to be of one of three types: +rule lines, zone lines, and link lines. +.PP +A rule line has the form +.nf +.ti +.5i +.ta \w'Rule\0\0'u +\w'NAME\0\0'u +\w'FROM\0\0'u +\w'1973\0\0'u +\w'TYPE\0\0'u +\w'Apr\0\0'u +\w'lastSun\0\0'u +\w'2:00\0\0'u +\w'SAVE\0\0'u +.sp +Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +.sp +For example: +.ti +.5i +.sp +Rule US 1967 1973 \- Apr lastSun 2:00 1:00 D +.sp +.fi +The fields that make up a rule line are: +.TP "\w'LETTER/S'u" +.B NAME +Gives the (arbitrary) name of the set of rules this rule is part of. +.TP +.B FROM +Gives the first year in which the rule applies. +Any integer year can be supplied; the Gregorian calendar is assumed. +The word +.I minimum +(or an abbreviation) means the minimum year representable as an integer. +The word +.I maximum +(or an abbreviation) means the maximum year representable as an integer. +Rules can describe times that are not representable as time values, +with the unrepresentable times ignored; this allows rules to be portable +among hosts with differing time value types. +.TP +.B TO +Gives the final year in which the rule applies. +In addition to +.I minimum +and +.I maximum +(as above), +the word +.I only +(or an abbreviation) +may be used to repeat the value of the +.B FROM +field. +.TP +.B TYPE +Gives the type of year in which the rule applies. +If +.B TYPE +is +.B \- +then the rule applies in all years between +.B FROM +and +.B TO +inclusive. +If +.B TYPE +is something else, then +.I zic +executes the command +.ti +.5i +\fByearistype\fP \fIyear\fP \fItype\fP +.br +to check the type of a year: +an exit status of zero is taken to mean that the year is of the given type; +an exit status of one is taken to mean that the year is not of the given type. +.TP +.B IN +Names the month in which the rule takes effect. +Month names may be abbreviated. +.TP +.B ON +Gives the day on which the rule takes effect. +Recognized forms include: +.nf +.in +.5i +.sp +.ta \w'Sun<=25\0\0'u +5 the fifth of the month +lastSun the last Sunday in the month +lastMon the last Monday in the month +Sun>=8 first Sunday on or after the eighth +Sun<=25 last Sunday on or before the 25th +.fi +.in -.5i +.sp +Names of days of the week may be abbreviated or spelled out in full. +Note that there must be no spaces within the +.B ON +field. +.TP +.B AT +Gives the time of day at which the rule takes effect. +Recognized forms include: +.nf +.in +.5i +.sp +.ta \w'1:28:13\0\0'u +2 time in hours +2:00 time in hours and minutes +15:00 24-hour format time (for times after noon) +1:28:14 time in hours, minutes, and seconds +\- equivalent to 0 +.fi +.in -.5i +.sp +where hour 0 is midnight at the start of the day, +and hour 24 is midnight at the end of the day. +Any of these forms may be followed by the letter +.I w +if the given time is local +.q "wall clock" +time, +.I s +if the given time is local +.q standard +time, or +.I u +(or +.I g +or +.IR z ) +if the given time is universal time; +in the absence of an indicator, +wall clock time is assumed. +.TP +.B SAVE +Gives the amount of time to be added to local standard time when the rule is in +effect. +This field has the same format as the +.B AT +field +(although, of course, the +.I w +and +.I s +suffixes are not used). +.TP +.B LETTER/S +Gives the +.q "variable part" +(for example, the +.q S +or +.q D +in +.q EST +or +.q EDT ) +of timezone abbreviations to be used when this rule is in effect. +If this field is +.BR \- , +the variable part is null. +.PP +A zone line has the form +.sp +.nf +.ti +.5i +.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 +For example: +.sp +.ti +.5i +Zone Australia/Adelaide 9:30 Aus CST 1971 Oct 31 2:00 +.sp +.fi +The fields that make up a zone line are: +.TP "\w'UTCOFF'u" +.B NAME +The name of the timezone. +This is the name used in creating the time conversion information file for the +zone. +.TP +.B UTCOFF +The amount of time to add to UTC to get standard time in this zone. +This field has the same format as the +.B AT +and +.B SAVE +fields of rule lines; +begin the field with a minus sign if time must be subtracted from UTC. +.TP +.B RULES/SAVE +The name of the rule(s) that apply in the timezone or, +alternately, an amount of time to add to local standard time. +If this field is +.B \- +then standard time always applies in the timezone. +.TP +.B FORMAT +The format for timezone abbreviations in this timezone. +The pair of characters +.B %s +is used to show where the +.q "variable part" +of the timezone abbreviation goes. +Alternately, +a slash (/) +separates standard and daylight abbreviations. +.TP +.B UNTIL +The time at which the UTC offset or the rule(s) change for a location. +It is specified as a year, a month, a day, and a time of day. +If this is specified, +the timezone information is generated from the given UTC offset +and rule change until the time specified. +The month, day, and time of day have the same format as the IN, ON, and AT +columns of a rule; trailing columns can be omitted, and default to the +earliest possible value for the missing columns. +.IP +The next line must be a +.q continuation +line; this has the same form as a zone line except that the +string +.q Zone +and the name are omitted, as the continuation line will +place information starting at the time specified as the +.B UNTIL +field in the previous line in the file used by the previous line. +Continuation lines may contain an +.B UNTIL +field, just as zone lines do, indicating that the next line is a further +continuation. +.PP +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 +.sp +For example: +.sp +.ti +.5i +Link Europe/Istanbul Asia/Istanbul +.sp +.fi +The +.B LINK-FROM +field should appear as the +.B NAME +field in some zone line; +the +.B LINK-TO +field is used as an alternate name for that zone. +.PP +Except for continuation lines, +lines may appear in any order in the input. +.PP +Lines in the file that describes leap seconds have the following form: +.nf +.ti +.5i +.ta \w'Leap\0\0'u +\w'YEAR\0\0'u +\w'MONTH\0\0'u +\w'DAY\0\0'u +\w'HH:MM:SS\0\0'u +\w'CORR\0\0'u +.sp +Leap YEAR MONTH DAY HH:MM:SS CORR R/S +.sp +For example: +.ti +.5i +.sp +Leap 1974 Dec 31 23:59:60 + S +.sp +.fi +The +.BR YEAR , +.BR MONTH , +.BR DAY , +and +.B HH:MM:SS +fields tell when the leap second happened. +The +.B CORR +field +should be +.q + +if a second was added +or +.q - +if a second was skipped. +.\" 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. +.\" See Terry J Quinn, The BIPM and the accurate measure of time, +.\" Proc IEEE 79, 7 (July 1991), 894-905. +.\" or +.\" .q ++ +.\" if two seconds were added +.\" or +.\" .q -- +.\" if two seconds were skipped. +The +.B R/S +field +should be (an abbreviation of) +.q Stationary +if the leap second time given by the other fields should be interpreted as UTC +or +(an abbreviation of) +.q Rolling +if the leap second time given by the other fields should be interpreted as +local wall clock time. +.SH FILES +/usr/local/etc/zoneinfo standard directory used for created files +.SH NOTES +For areas with more than two types of local time, +you may need to use local standard time in the +.B AT +field of the earliest transition time's rule to ensure that +the earliest transition time recorded in the compiled file is correct. +.SH "SEE ALSO" +.BR tzfile (5), +.BR zdump (8) +.\" @(#)zic.8 7.19 diff --git a/release/man1/intro.1 b/release/man1/intro.1 new file mode 100644 index 00000000..cde6aba4 --- /dev/null +++ b/release/man1/intro.1 @@ -0,0 +1,294 @@ +.\" Copyright (c) 2002 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. +.\" +.\" 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 ÌÚ +.\" +.TH INTRO 1 2007-11-15 "Linux" "Linux User's Manual" +.SH ̾Á° +intro \- ¥æ¡¼¥¶¡¼¥³¥Þ¥ó¥É¤Î¾Ò²ð +.SH ÀâÌÀ +¥Þ¥Ë¥å¥¢¥ë¤Î 1 ¾Ï¤Ï¡¢¥æ¡¼¥¶¡¼¥³¥Þ¥ó¥É¤ä¥Ä¡¼¥ë¤ÎÀâÌÀ¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤ë¡£ +Î㤨¤Ð¡¢¥Õ¥¡¥¤¥ëÁàºî¥Ä¡¼¥ë¡¢¥·¥§¥ë¡¢¥³¥ó¥Ñ¥¤¥é¡¢¥¦¥§¥Ö¥Ö¥é¥¦¥¶¡¢ +¥Õ¥¡¥¤¥ë¤ä¥¤¥á¡¼¥¸¤Î¥Ó¥å¡¼¥¢¤ä¥¨¥Ç¥£¥¿¡¢¤Ê¤É¤Ç¤¢¤ë¡£ + +¤¹¤Ù¤Æ¤Î¥³¥Þ¥ó¥É¤Ï½ªÎ»»þ¤Ë¥¹¥Æ¡¼¥¿¥¹ÃͤòÊÖ¤¹¡£ +¤³¤ÎÃͤò¸¡ºº¤¹¤ë¤³¤È¤Ç (Î㤨¤Ð¡¢¤Û¤È¤ó¤É¤Î¥·¥§¥ë¤Ç¤ÏÊÑ¿ô +.I $? +¤ËºÇ¸å¤Ë¼Â¹Ô¤·¤¿¥³¥Þ¥ó¥É¤Î¥¹¥Æ¡¼¥¿¥¹¤¬ÊÝ»ý¤µ¤ì¤ë)¡¢ +¤½¤Î¥³¥Þ¥ó¥É¤¬À®¸ù¤·¤Æ´°Î»¤·¤¿¤«¤É¤¦¤«¤òÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +ÅÁÅýŪ¤Ë¡¢½ªÎ»¥¹¥Æ¡¼¥¿¥¹ 0 ¤ÏÀ®¸ù¤ò¼¨¤¹¤Î¤Ë»È¤ï¤ì¡¢Èó 0 ¤ÎÃÍ¤Ï +¤½¤Î¥³¥Þ¥ó¥É¤¬À®¸ù¤·¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤¹ +(½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Î¾ÜºÙ¤Ï +.BR wait (2) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë)¡£ +Èó 0 ¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ï 1 ¤«¤é 255 ¤ÎÈϰϤÎÃͤò¤È¤ë¤³¤È¤¬¤Ç¤­¡¢ +¤¤¤¯¤Ä¤«¤Î¥³¥Þ¥ó¥É¤Ç¤Ï¥³¥Þ¥ó¥É¤¬¼ºÇÔ¤·¤¿Íýͳ¤ò¼¨¤¹¤¿¤á¤Ë +Ê£¿ô¤ÎÈó 0 ¤Î¥¹¥Æ¡¼¥¿¥¹Ãͤ¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +.SH È÷¹Í +Linux ¤Ï Unix ¤Î°ì¼ï¤Ç¤¢¤ê¡¢Â绨ÇĤˤ¤¤¨¤Ð¡¢ +Unix ¾å¤Î¥æ¡¼¥¶¥³¥Þ¥ó¥É¤Ï¤¹¤Ù¤Æ Linux ¾å¤Ç¤âÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë +(FreeBSD ¤ä¾¤Î¤Î¿¤¯¤Î Unix É÷¤Î¥·¥¹¥Æ¥à¤Ç¤âƱÍͤǤ¢¤ë)¡£ +.LP +Linux ¤Ë¤Ï GUI (¥°¥é¥Õ¥£¥«¥ë¡¦¥æ¡¼¥¶¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹) ¤¬ÍÑ°Õ¤µ¤ì¤Æ¤ª¤ê¡¢ +²¿¤«¤ò¥Ý¥¤¥ó¥È¤·¤¿¤ê¡¢¥¯¥ê¥Ã¥¯¤·¤¿¤ê¡¢¥É¥é¥Ã¥°¤·¤¿¤ê¤Ç¤­¡¢¤¦¤Þ¤¯¤¤¤±¤Ð +ºÇ½é¤Ë¤¿¤¯¤µ¤ó¤Îʸ½ñ¤òÆɤޤʤ¯¤Æ¤âÌÜŪ¤Îºî¶È¤¬¤Ç¤­¤Æ¤·¤Þ¤¦¤³¤È¤â¤¢¤ë¡£ +ÅÁÅýŪ¤Ê Unix ´Ä¶­¤Ï CLI (¥³¥Þ¥ó¥É¡¦¥é¥¤¥ó¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹) ¤Ç¤¢¤ê¡¢ +¥³¥Þ¥ó¥É¤òÂǤÁ¹þ¤ó¤Ç¡¢¥³¥ó¥Ô¥å¡¼¥¿¤Ë²¿¤ò¤¹¤Ù¤­¤«¶µ¤¨¤Æ¤ä¤ë¡£ +CLI ¤Ï GUI ¤è¤ê¤â®¤¯¶¯ÎϤÀ¤¬¡¢¤É¤Î¥³¥Þ¥ó¥É¤¬²¿¤ò¤¹¤ë¤Î¤«ÃΤäƤ¤¤ëɬÍ× +¤¬¤¢¤ë¡£CLI ¤ò»È¤¤»Ï¤á¤ë¤¿¤á¤ËɬÍ׺Ǿ®¸Â¤Î¥³¥Þ¥ó¥É¤ò°Ê²¼¤Ë½Ò¤Ù¤ë¡£ +.SS ¥í¥°¥¤¥ó +ºî¶È¤ò³«»Ï¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¤Þ¤¹ºÇ½é¤Ë¥í¥°¥¤¥ó¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤À¤í¤¦¡£ +¤¹¤Ê¤ï¤Á¡¢¥æ¡¼¥¶Ì¾¤È¥Ñ¥¹¥ï¡¼¥É¤òÆþÎϤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¾Ü¤·¤¯¤Ï +.BR login (1) +¤ò»²¾È¤Î¤³¤È¡£ +.I login +¥×¥í¥°¥é¥à¤Ï (¥³¥Þ¥ó¥É¡¦¥¤¥ó¥¿¡¼¥×¥ê¥¿¤Ç¤¢¤ë) +.I "¥·¥§¥ë (shell)" +¤òµ¯Æ°¤¹¤ë¡£¥°¥é¥Õ¥£¥«¥ë¡¦¥í¥°¥¤¥ó¤Î¾ì¹ç¤Ï¡¢¥á¥Ë¥å¡¼¤ä¥¢¥¤¥³¥ó¤¬¤¢¤ë +¥¹¥¯¥ê¡¼¥ó¤¬É½¼¨¤µ¤ì¡¢¥Þ¥¦¥¹¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¥¦¥£¥ó¥É¥¦¤¬³«¤¤¤Æ +¥·¥§¥ë¤¬µ¯Æ°¤µ¤ì¤ë¤³¤È¤À¤í¤¦¡£¾Ü¤·¤¯¤Ï +.BR xterm (1) +¤ò»²¾È¤Î¤³¤È¡£ +.SS ¥·¥§¥ë +¥³¥Þ¥ó¥É¤Ï¡¢¥³¥Þ¥ó¥É¡¦¥¤¥ó¥¿¡¼¥×¥ê¥¿¤Ç¤¢¤ë +.I ¥·¥§¥ë +¤ËÂФ·¤ÆÆþÎϤ¹¤ë¡£ +.I ¥·¥§¥ë +¤Ï¡¢ÁȤ߹þ¤ß¥³¥Þ¥ó¥É¤Ç¤Ï¤Ê¤¯ÉáÄÌ¤Î¥×¥í¥°¥é¥à¤Ç¤¢¤ê¡¢¹¥¤ß¤Î¤â¤Î¤ËÊѹ¹¤¹¤ë +¤³¤È¤¬¤Ç¤­¤ë¡£³Æ¿Í¤Ë¤Ï¤½¤ì¤¾¤ì¹¥¤ß¤Î¥·¥§¥ë¤¬¤¢¤ë¡£É¸½à¤Î¥·¥§¥ë¤Ï +.I sh +¤È¸Æ¤Ð¤ì¤ë¡£ +.BR ash (1), +.BR bash (1), +.BR csh (1), +.BR zsh (1), +.BR chsh (1) +¤ò»²¾È¤Î¤³¤È¡£ +.LP +¥»¥Ã¥·¥ç¥ó¤ÎÎã¤ò°Ê²¼¤Ë¼¨¤¹¡£ + +.RS +.nf +.BI "knuth login: " aeb +.BI "Password: " ******** +.BI "% " date +Tue Aug 6 23:50:44 CEST 2002 +.BI "% " cal + August 2002 +Su Mo Tu We Th Fr Sa + 1 2 3 + 4 5 6 7 8 9 10 +11 12 13 14 15 16 17 +18 19 20 21 22 23 24 +25 26 27 28 29 30 31 + +.BI "% " ls +bin tel +.BI "% " "ls \-l" +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" +maja 0501\-1136285 +peter 0136\-7399214 +.BI "% " "cp tel tel2" +.BI "% " "ls \-l" +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" +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" +maja 0501\-1136285 +.BI "% " +.fi +.RE + +¤³¤³¤Ç Control-D ¤òÂǤĤȥ»¥Ã¥·¥ç¥ó¤¬½ªÎ»¤¹¤ë¡£ +¤³¤³¤Ç¡¢ +.B "% " +¤Ï¥³¥Þ¥ó¥É¡¦¥×¥í¥ó¥×¥È¤Ç¤¢¤ë¡£¥³¥Þ¥ó¥É¡¦¥×¥í¥ó¥×¥È¤Ï¥·¥§¥ëÆÈÆäΤä¤êÊý¤Ç¡¢ +¥·¥§¥ë¤¬¼¡¤Î¥³¥Þ¥ó¥É¤ò¼õ¤±ÉÕ¤±¤é¤ì¤ë¾õÂ֤ˤʤäƤ¤¤ë¤³¤È¤ò¼¨¤·¤Æ¤¤¤ë¡£ +¥×¥í¥ó¥×¥È¤Ï¡¢½ÀÆð¤Ë¥«¥¹¥¿¥Þ¥¤¥º +¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢¥æ¡¼¥¶Ì¾¡¢¥Þ¥·¥ó̾¡¢¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¡¢»þ¹ï¤Ê¤É¤ò +¥×¥í¥ó¥×¥È¤Ë´Þ¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +PS1="What next, master? " ¤ÈÀßÄꤹ¤ë¤È¡¢ +¥×¥í¥ó¥×¥È¤Ï¤½¤Î¤è¤¦¤ËÊѹ¹¤µ¤ì¤ë¤À¤í¤¦¡£ +.LP +Îã¤Ë¤¢¤ë¤è¤¦¤Ë¡¢ +.I date +¤È¤¤¤¦ÆüÉդȻþ¹ï¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤ä¡¢ +.I cal +¤È¤¤¤¦¥«¥ì¥ó¥À¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤â¤¢¤ë¡£ +.LP +.I ls +¥³¥Þ¥ó¥É¤Ï¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍƤò¥ê¥¹¥Èɽ¼¨¤¹¤ë¡¢¤Ä¤Þ¤ê +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Ë¤É¤ó¤Ê¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¤«¤ò¶µ¤¨¤Æ¤¯¤ì¤ë¡£ +.I \-l +¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Æ¼Â¹Ô¤¹¤ë¤È¡¢¾ÜºÙɽ¼¨¤¬¹Ô¤ï¤ì¡¢ +¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¡¢¥µ¥¤¥º¡¢ÆüÉդʤɤ¬É½¼¨¤µ¤ì¤ë¡£ +¾å¤ÎÎã¤Ç¤Ï¡¢"tel" ¥Õ¥¡¥¤¥ë¤Ï¡¢¥µ¥¤¥º¤¬ 37 ¥Ð¥¤¥È¤Ç¡¢½êÍ­¼Ô¤Ï aeb ¤Ç¡¢ +½êÍ­¼Ô¤ÏÆɤ߽ñ¤­¤¬¤Ç¤­¡¢Â¾¤Î¿Í¤ÏÆɤ߽Ф·¤À¤±¤¬¤Ç¤­¤ë¤³¤È¤¬Ê¬¤«¤ë¡£ +¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤È¸¢¸Â (permission) ¤Ï¡¢¤½¤ì¤¾¤ì +.I chown +¥³¥Þ¥ó¥É¤È +.I chmod +¥³¥Þ¥ó¥É¤ÇÊѹ¹¤Ç¤­¤ë¡£ +.LP +.I cat +¥³¥Þ¥ó¥É¤Ï¥Õ¥¡¥¤¥ë¤ÎÆâÍƤòɽ¼¨¤¹¤ë¡£ +(¥³¥Þ¥ó¥É̾¤Ï "concatenate and print" (Ï¢·ë¤·¤Æ°õ»ú¤¹¤ë) ¤ËͳÍ褷¤Æ¤¤¤ë¡£ +°ú¿ô¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍƤ¬Ï¢·ë¤µ¤ì¡¢¡Öɸ½à½ÐÎÏ¡× +¤ËÁ÷¤é¤ì¤ë¡£¾å¤ÎÎã¤Ç¤Ï¡¢É¸½à½ÐÎϤÏüËö¤Î¥¹¥¯¥ê¡¼¥ó¤Ç¤¢¤ë¡£) +.LP +.I cp +¥³¥Þ¥ó¥É¤Ï¥Õ¥¡¥¤¥ë¤Î¥³¥Ô¡¼¤ò¹Ô¤¦ (¤½¤Î̾Á°¤Ï "copy" ¤ËͳÍ褹¤ë)¡£ +°ìÊý¡¢ +.I mv +¥³¥Þ¥ó¥É¤Ïñ½ã¤Ë¥Õ¥¡¥¤¥ë̾¤ÎÊѹ¹¤ò¹Ô¤¦ +(¤½¤Î̾Á°¤Ï "move" ¤ËͳÍ褹¤ë)¡£ +.LP +.I diff +¥³¥Þ¥ó¥É¤Ï 2 ¤Ä¤Î¥Õ¥¡¥¤¥ë¤Î°ã¤¤¤òɽ¼¨¤¹¤ë¡£ +¾å¤ÎÎã¤Ç¤Ï¡¢Æó¤Ä¤Î¥Õ¥¡¥¤¥ë¤Ë°ã¤¤¤¬¤Ê¤¤¤Î¤Ç¡¢²¿¤â½ÐÎϤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.LP +.I rm +¥³¥Þ¥ó¥É¤Ï¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¡£¥Õ¥¡¥¤¥ë¤Ï¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤Î¤Ç +Ãí°Õ¤·¤Æ»ÈÍѤ¹¤ë¤³¤È! ¥´¥ßÈ¢¤ËÁêÅö¤¹¤ë¤â¤Î¤Ï¤Ê¤¯¡¢ +ºï½ü¤Ï¤½¤Î¥Õ¥¡¥¤¥ë¤¬´°Á´¤Ë¼º¤ï¤ì¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.LP +.I grep +¥³¥Þ¥ó¥É¤Ï¡¢»ØÄꤵ¤ì¤¿Ê¸»úÎó¤ò°ì¤Ä°Ê¾å¤Î¥Õ¥¡¥¤¥ë¤«¤éõ¤¹ +(¥³¥Þ¥ó¥É̾¤Ï "g/re/p" ¤ËͳÍ褷¤Æ¤¤¤ë)¡£ +¾å¤ÎÎã¤Ç¤Ï¡¢Maja ¤ÎÅÅÏÃÈֹ椬¸«¤Ä¤«¤Ã¤Æ¤¤¤ë¡£ +.SS ¥Ñ¥¹Ì¾¤È¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê +¥Õ¥¡¥¤¥ë¤Ï¥Õ¥¡¥¤¥ë³¬ÁؤȤ¤¤¦Â礭¤ÊÌÚ¤ÎÃæ¤Ë¤¢¤ë¡£¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï +.I "¥Ñ¥¹Ì¾ (pathname)" +¤¬¤¢¤ê¡¢¥Ñ¥¹Ì¾¤Ï (/ ¤È¸Æ¤Ð¤ì¤ë) Ìڤꬤ«¤é¤Î·ÐÏ©¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£ +¾å¤ÎÎã¤Ç¤Ï¡¢´°Á´¤Ê¥Ñ¥¹Ì¾¤Ï /home/aeb/tel ¤Î¤è¤¦¤Ë¤Ê¤ë¡£ +¤¤¤Ä¤â´°Á´¤Ê¥Ñ¥¹Ì¾¤ò»È¤¦¤Î¤ÏÉÔÊؤʤΤǡ¢¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë +¥Õ¥¡¥¤¥ë̾¤Ï¡¢¥Õ¥¡¥¤¥ë̾¤ÎºÇ¸å¤ÎÉôʬ¤À¤±¤Ë¾Êά¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤¬ "/home/aeb" ¤Î»þ¤Ï¡¢ "/home/aeb/tel" +¤ò "tel" ¤Ë¾Êά¤·¤Æ½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +.I pwd +¥³¥Þ¥ó¥É¤Ï¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤òɽ¼¨¤¹¤ë¡£ +.LP +.I cd +¥³¥Þ¥ó¥É¤Ï¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë¡£ +"cd /"¡¢"pwd"¡¢"cd"¡¢"pwd" ¤È½ç¤Ë¼Â¹Ô¤·¤Æ¤ß¤ë¤È¤è¤¤¡£ +.SS ¥Ç¥£¥ì¥¯¥È¥ê +.I mkdir +¥³¥Þ¥ó¥É¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ò¿·µ¬¤ËºîÀ®¤¹¤ë¡£ +.LP +.I rmdir +¥³¥Þ¥ó¥É¤Ï¶õ¤Ç¤¢¤ì¤Ð¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¡¢ +¶õ¤Ç¤Ê¤±¤ì¤Ð¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£ +.LP +.I find +¥³¥Þ¥ó¥É¤Ï¡¢»ØÄꤵ¤ì¤¿Ì¾Á°¤ä¤½¤Î¾¤Î°À­¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤òõ¤¹ +(½ñ¼°¤Ï¤«¤Ê¤êÊѤï¤Ã¤Æ¤¤¤ë)¡£Î㤨¤Ð¡¢"find . \-name tel" ¤ò¼Â¹Ô¤¹¤ë¤È¡¢ +"tel" ¤È¤¤¤¦Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤Î¸¡º÷¤ò¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤«¤é³«»Ï¤¹¤ë¡£ +(¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ï "." ¤Çɽ¤¹)¡£"find / \-name tel" ¤È¤·¤Æ¤â +Ʊ¤¸¤³¤È¤ò¹Ô¤¦¤¬¡¢¸¡º÷¤ÏÌڤκ¬ (/) ¤«¤é³«»Ï¤µ¤ì¤ë¡£ +¿ô GB ¤Î¥Ç¥£¥¹¥¯¤ËÂФ·¤Æ¸¡º÷¤ò¤«¤±¤ë¤È»þ´Ö¤¬¤«¤«¤ë¤Î¤Ç¡¢ +¤½¤Î¤è¤¦¤Ê¤È¤­¤Ï +.BR locate (1) +¤ò»È¤Ã¤¿Êý¤¬¤¤¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.SS ¥Ç¥£¥¹¥¯¤È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.I mount +¥³¥Þ¥ó¥É¤Ï¡¢(¥Õ¥í¥Ã¥Ô¡¼¤ä CDROM ¤Ê¤É¤Î) ¥Ç¥£¥¹¥¯¾å¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +Â礭¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à³¬ÁؤËÀܳ¤¹¤ë¡£µÕ¤Ë +.I umount +¥³¥Þ¥ó¥É¤ÏÀÚ¤êÎ¥¤·¤ò¹Ô¤¦¡£ +.I df +¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤È¡¢¥Ç¥£¥¹¥¯¤Î̤»ÈÍÑÎ̤¬¤É¤ÎÄøÅÙ¤«¤òɽ¼¨¤¹¤ë¡£ +.SS ¥×¥í¥»¥¹ +Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢Â¿¤¯¤Î¥æ¡¼¥¶¥×¥í¥»¥¹¤È¥·¥¹¥Æ¥à¥×¥í¥»¥¹¤¬Æ±»þ¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ +ÂÐÏÃŪ¤Ë¼Â¹Ô¤Ç¤­¤ë¥×¥í¥»¥¹¤Ï +.I foreground +¤Ç¼Â¹Ô¤µ¤ì¤Æ¤ª¤ê¡¢¤½¤¦¤Ç¤Ê¤¤¤â¤Î¤Ï +.I background +¤Ç¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¡£ +¥³¥Þ¥ó¥É +.I ps +¤Ë¤è¤ê¡¢¤É¤Î¥×¥í¥»¥¹¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¤«¤ä¥×¥í¥»¥¹¤¬»ý¤Ã¤Æ¤¤¤ëÈÖ¹æ +(¥×¥í¥»¥¹ÈÖ¹æ) ¤òɽ¼¨¤Ç¤­¤ë¡£ +¥³¥Þ¥ó¥É +.I kill +¤ò»È¤¦¤³¤È¤Ç¡¢¥×¥í¥»¥¹¤ò¼è¤ê½ü¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ +¥ª¥×¥·¥ç¥ó¤Ê¤·¤Ç¼Â¹Ô¤µ¤ì¤ë¤È¡¢¡Ö¤¤¤Ê¤¯¤Ê¤Ã¤Æ²¼¤µ¤¤¡×¤È¤¤¤¦¤ä¤µ¤·¤¤Í×µá +¤ò¹Ô¤¦¡£"kill \-9" ¤Ë³¤±¤Æ¥×¥í¥»¥¹ÈÖ¹æ¤ò»ØÄꤹ¤ë¤È¡¢»ØÄꤷ¤¿¥×¥í¥»¥¹¤ò +ľ¤Á¤Ëºï½ü¤¹¤ë¡£ +foreground ¥×¥í¥»¥¹¤Ï¿¤¯¤Î¾ì¹ç Control-C ¤ò¥¿¥¤¥×¤¹¤ë¤³¤È¤Ç +»¦¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.SS ¾ðÊó¤Îõ¤·Êý +Èó¾ï¤Ë¤¿¤¯¤µ¤ó¤Î¥³¥Þ¥ó¥É¤¬¤¢¤ê¡¢ +¤½¤ì¤¾¤ì¤Î¥³¥Þ¥ó¥É¤Ë¤Ï¤¿¤¯¤µ¤ó¤Î¥ª¥×¥·¥ç¥ó¤¬¤¢¤ë¡£ +ÅÁÅýŪ¤Ë¤Ï¡¢¥³¥Þ¥ó¥É¤ÎÀâÌÀ¤Ï (¤³¤Î¥É¥­¥å¥á¥ó¥È¤â¤½¤¦¤À¤¬) +.I "man ¥Ú¡¼¥¸" +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£Î㤨¤Ð "man kill" ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤È¡¢"kill" ¥³¥Þ¥ó¥É¤Î +»È¤¤Êý¤Ë´Ø¤¹¤ëÀâÌÀ¤¬É½¼¨¤µ¤ì¤ë¡£(ƱÍÍ¤Ë "man man" ¤Ï "man" ¥³¥Þ¥ó¥É¤Ë +¤Ä¤¤¤Æ¤ÎÀâÌÀ¤òɽ¼¨¤¹¤ë¡£) +.I man +¥×¥í¥°¥é¥à¤Ï¥Æ¥­¥¹¥È¤ò +.I pager +¤ËÅϤ·¤Æɽ¼¨¤ò¹Ô¤¦¡£ +.I pager +¤È¤·¤Æ +.I less +¤¬»È¤ï¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ +¼¡¤Î¥Ú¡¼¥¸¤Ë¿Ê¤à¤Ë¤Ï¥¹¥Ú¡¼¥¹¡¦¥­¡¼¤ò¡¢½ªÎ»¤¹¤ë¤Ë¤Ï q ¤ò²¡¤¹¡£ +.LP +¥É¥­¥å¥á¥ó¥È¤Ç¤Ï¡¢Â¾¤Î man ¥Ú¡¼¥¸¤Ø¤Î»²¾È¤Ï +.BR man (1) +¤Î¤è¤¦¤Ë̾Á°¤È¥»¥¯¥·¥ç¥óÈÖ¹æ¤Ç¼¨¤¹¤Î¤¬°ìÈÌŪ¤Ç¤¢¤ë¡£ +man ¥Ú¡¼¥¸¤Ï´Ê·é¤Ë½ñ¤«¤ì¤Æ¤ª¤ê¡¢¾ÜºÙ¤ò˺¤ì¤¿¤È¤­¤ËÁÇÁ᤯¾ðÊó¤ò¸«¤Ä¤±¤ë +¤³¤È¤¬¤Ç¤­¤ë¡£Îã¤äÀâÌÀ¤È¤È¤â¤ËÆþÌç¸þ¤±¤Îµ­ºÜ¤â¤¢¤ë¤Î¤Ç¡¢½é¤á¤Æ¤Î¿Í¤Ë¤È¤Ã¤Æ¤â +Ìò¤ËΩ¤Ä¤â¤Î¤Ç¤¢¤ë¡£ +.LP +¿¤¯¤Î GNU/FSF ¥½¥Õ¥È¥¦¥§¥¢¤Ë¤Ï info ¥Õ¥¡¥¤¥ë¤¬ÉÕ°¤·¤Æ¤¤¤ë¡£ +"info info" ¤È¥¿¥¤¥×¤¹¤ë¤È¡¢"info" ¥×¥í¥°¥é¥à¤Î»È¤¤Êý¤Î¾Ò²ð¤¬É½¼¨¤µ¤ì¤ë¡£ +.LP +Æý¸µ­»ö¤Ë¤Ä¤¤¤Æ¤Ï HOWTO ¤Ç°·¤ï¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ +.I /usr/share/doc/howto/en +¤ò¸«¤ë¤È¤¤¤¤¤À¤í¤¦¡£ +HTML ¥Õ¥¡¥¤¥ë¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï¥Ö¥é¥¦¥¶¤ò»È¤Ã¤Æɽ¼¨¤¹¤ì¤Ð¤è¤¤¡£ +.\" +.\" Actual examples? Separate section for each of cat, cp, ...? +.\" gzip, bzip2, tar, rpm +.SH ´ØÏ¢¹àÌÜ +.BR standards (7) diff --git a/release/man1/ldd.1 b/release/man1/ldd.1 new file mode 100644 index 00000000..9638b5e2 --- /dev/null +++ b/release/man1/ldd.1 @@ -0,0 +1,83 @@ +.\" Copyright 1995-2000 David Engel (david@ods.com) +.\" Copyright 1995 Rickard E. Faith (faith@cs.unc.edu) +.\" Copyright 2000 Ben Collins (bcollins@debian.org) +.\" Redone for GLibc 2.2 +.\" Copyright 2000 Jakub Jelinek (jakub@redhat.com) +.\" Corrected. +.\" 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 +.\" +.TH LDD 1 2000-10-30 "" "Linux Programmer's Manual" +.SH ̾Á° +ldd \- ¶¦Í­¥é¥¤¥Ö¥é¥ê¤Ø¤Î°Í¸´Ø·¸¤òɽ¼¨¤¹¤ë +.SH ½ñ¼° +.BR ldd " [OPTION]... FILE..." +.SH ÀâÌÀ +.B ldd +¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç»ØÄꤷ¤¿¥×¥í¥°¥é¥à¤ä¶¦Í­¥é¥¤¥Ö¥é¥ê¤Ë¤Ä¤¤¤Æ¡¢ +¤½¤ì¤¾¤ì¤ÇɬÍפȤµ¤ì¤ë¶¦Í­¥é¥¤¥Ö¥é¥ê¤òɽ¼¨¤¹¤ë¡£ +.SH ¥ª¥×¥·¥ç¥ó +.TP +.B \-\-version +.B ldd +¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òɽ¼¨¤¹¤ë¡£ +.TP +.B \-v\ \-\-verbose +¥·¥ó¥Ü¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤Ê¤É¤ò´Þ¤á¤¿Á´¤Æ¤Î¾ðÊó¤òɽ¼¨¤¹¤ë¡£ +.TP +.B \-u\ \-\-unused +»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤Ä¾Àܤΰ͸´Ø·¸¤òɽ¼¨¤¹¤ë +(glibc 2.3.4 °Ê¹ß)¡£ +.TP +.B \-d\ \-\-data\-relocs +¥ê¥í¥±¡¼¥·¥ç¥ó¤ò¼Â¹Ô¤·¡¢Â­¤ê¤Ê¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ä¤¤¤Æ¥ì¥Ý¡¼¥È¤¹¤ë (ELF ¤Î¤ß)¡£ +.TP +.B \-r\ \-\-function\-relocs +­¤ê¤Ê¤¤¥ª¥Ö¥¸¥§¥¯¥È¤ä´Ø¿ô¤Ë¤Ä¤¤¤Æ¥ì¥Ý¡¼¥È¤¹¤ë (ELF ¤Î¤ß)¡£ +.TP +.B \-\-help +»ÈÍÑË¡¤òɽ¼¨¤¹¤ë¡£ +.SH Ãí°Õ +ɸ½àŪ¤Ê¥Ð¡¼¥¸¥ç¥ó¤Î +.B ldd +¤Ï glibc2 ¤ËÉÕ°¤·¤Æ¤¤¤ë¡£ +libc5 ¤Ë¤Ï¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î¤â¤Î¤¬ÉÕ°¤·¤Æ¤ª¤ê¡¢ +¤³¤ì¤¬Æþ¤Ã¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â¤Þ¤À¸ºß¤¹¤ë¡£ +libc5 ¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¥í¥ó¥°¥ª¥×¥·¥ç¥ó¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +°ìÊý¡¢glibc2 ¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï +.B \-V +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤ª¤é¤º¡¢¤³¤ì¤ÈƱ¤¸°ÕÌ£¤Î +.B \-\-version +¤·¤«¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.LP +libc5 ¥Ð¡¼¥¸¥ç¥ó¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +¥³¥Þ¥ó¥É¥é¥¤¥ó¤ÇÍ¿¤¨¤é¤ì¤¿¥é¥¤¥Ö¥é¥ê̾¤Ë +\(aq/\(aq ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥é¥¤¥Ö¥é¥ê̾¤ò¤½¤Î¤Þ¤ÞÍѤ¤¤ë¡£ +\(aq/\(aq ¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢É¸½àŪ¤Ê¥Ñ¥¹¤«¤é¥é¥¤¥Ö¥é¥ê¤ò¸¡º÷¤¹¤ë¡£ +¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¶¦Í­¥é¥¤¥Ö¥é¥ê¤ËÂФ·¤Æ¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢ +̾Á°¤Ë¥×¥ì¥Õ¥£¥Ã¥¯¥¹ "./" ¤òÉÕ¤±¤ë¤³¤È¡£ +.SH ¥Ð¥° +.B ldd +¤Ï a.out ¶¦Í­¥é¥¤¥Ö¥é¥ê¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¡£ +.PP +.B ldd +¤ÏÈó¾ï¤Ë¸Å¤¤ a.out ¥×¥í¥°¥é¥à +.RB ( ldd +¤Î¥µ¥Ý¡¼¥È¤¬¥³¥ó¥Ñ¥¤¥é¤ËÄɲ䵤ì¤ë°ÊÁ°¤Ë¥Ó¥ë¥É¤µ¤ì¤¿¤è¤¦¤Ê¥×¥í¥°¥é¥à) +¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¡£ +¤³¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤ËÂФ·¤Æ +.B ldd +¤òÍѤ¤¤ë¤È¡¢¥×¥í¥°¥é¥à¤Ï \fIargc\fP = 0 ¤Ç¼Â¹Ô¤µ¤ì¤ë¡£·ë²Ì¤ÏͽÁÛÉÔ²Äǽ¤Ç¤¢¤ë¡£ +.\" .SH Ãø¼Ô +.\" David Engel. +.\" Roland McGrath and Ulrich Drepper. +.SH ´ØÏ¢¹àÌÜ +.BR ld.so (8), +.BR ldconfig (8) diff --git a/release/man1/time.1 b/release/man1/time.1 new file mode 100644 index 00000000..3c8ba6be --- /dev/null +++ b/release/man1/time.1 @@ -0,0 +1,311 @@ +.\" Copyright Andries Brouwer, 2000 +.\" +.\" This page is distributed under GPL. +.\" 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" +.SH ̾Á° +time \- ¥³¥Þ¥ó¥É¤Î»þ´Ö·×¬¤ä¥ê¥½¡¼¥¹»ÈÍÑÎ̤òɽ¼¨¤¹¤ë +.SH ½ñ¼° +.BI "time [" options "] " command " [" arguments... "] " +.SH ÀâÌÀ +.B time +¥³¥Þ¥ó¥É¤Ï¡¢»ØÄꤵ¤ì¤¿¥×¥í¥°¥é¥à +.I command +¤òÅϤµ¤ì¤¿°ú¤­¿ô¤Ç¼Â¹Ô¤¹¤ë¡£ +.I command +¤¬½ªÎ»¤¹¤ë¤È¡¢ +.B time +¤Ï¤³¤Î¥×¥í¥°¥é¥à¤Î¼Â¹Ô»þ´Ö¤ÎÅý·×¾ðÊó¤Ë¤Ä¤¤¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤ò +ɸ½à¥¨¥é¡¼½ÐÎϤ˽ÐÎϤ¹¤ë¡£ +ɽ¼¨¤µ¤ì¤ëÅý·×¾ðÊó¤Ï°Ê²¼¤Î»°¤Ä¤«¤é¹½À®¤µ¤ì¤ë: +(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 +¤ÎÃͤιç·×)¡£ + +.RB ( bash (1) +¤Ê¤É¤Î) ¤¤¤¯¤Ä¤«¤Î¥·¥§¥ë¤Ë¤Ï¡¢¤³¤³¤ÇÀâÌÀ¤¹¤ë¥³¥Þ¥ó¥É¤è¤ê¤â +µ¡Ç½¤¬¾¯¤Ê¤¤¡¢ÁȤ߹þ¤ß¤Î +.B time +¥³¥Þ¥ó¥É¤¬Â¸ºß¤¹¤ë¡£ +ÁȤ߹þ¤ß¤Ç¤Ï¤Ê¤¤¼ÂºÝ¤Î¥³¥Þ¥ó¥É¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.RI ( /usr/bin/time +¤Î¤è¤¦¤Ê) ¥³¥Þ¥ó¥É¤Î¥Ñ¥¹Ì¾¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ¥ª¥×¥·¥ç¥ó +.TP +.B \-p +POSIX ¥í¥±¡¼¥ë¤Î¾ì¹ç¡¢ÅÁÅýŪ¤Ê¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤¢¤ë +.in +5 +"real %f\enuser %f\ensys %f\en" +.in -5 +¤¬»ÈÍѤµ¤ì¤ë (³Æ¿ô»ú¤ÏÉÃñ°Ì)¡£ +%f ¤Î½ÐÎϤǤξ®¿ôÅÀ°Ê²¼¤Î·å¿ô¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +¥¯¥í¥Ã¥¯¡¦¥Æ¥£¥Ã¥¯ (clock tick) ¤ÎÀºÅÙ¤òɽ¤¹¤Î¤Ë½½Ê¬¤Ê·å¿ô¤È¤Ê¤ê¡¢ +¾¯¤Ê¤¯¤È¤â°ì·å¤Ï¸ºß¤¹¤ë¡£ +.SH ½ªÎ»¥¹¥Æ¡¼¥¿¥¹ +.I command +¤¬µ¯Æ°¤µ¤ì¤¿¾ì¹ç¤Ï¡¢ +.I command +¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤¬½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤È¤Ê¤ë¡£ +.I command +¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ï 127 ¤Ç¡¢ +.I command +¤¬¸«¤Ä¤«¤Ã¤¿¤¬µ¯Æ°¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï 126 ¤È¤Ê¤ë¡£ +¤³¤ì°Ê³°¤Ç²¿¤«¥¨¥é¡¼¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï¡¢½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ï +0 °Ê³°¤ÎÁ°µ­°Ê³°¤ÎÃÍ (1-125) ¤Î²¿¤«¤Ë¤Ê¤ë¡£ +.SH ´Ä¶­ÊÑ¿ô +´Ä¶­ÊÑ¿ô +.BR LANG , +.BR LC_ALL , +.BR LC_CTYPE , +.BR LC_MESSAGES , +.BR LC_NUMERIC , +.BR NLSPATH , +.B PATH +¤¬»ÈÍѤµ¤ì¤ë¡£ +.B PATH +¤Ï +.I command +¤òõ¤¹¤Î¤Ë»È¤ï¤ì¤ë¡£¤½¤ì°Ê³°¤Ï½ÐÎÏʸ»ú¤ä½ñ¼°¤Ë»ÈÍѤµ¤ì¤ë¡£ +.SH GNU ¥Ð¡¼¥¸¥ç¥ó +°Ê²¼¤Ï GNU 1.7 ¥Ð¡¼¥¸¥ç¥ó¤Î +.BR time +¤ÎÀâÌÀ¤Ç¤¢¤ë¡£¥³¥Þ¥ó¥É̾¤È¤Ï΢ʢ¤Ë¡¢GNU ¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï +Í­±×¤Ê¾ðÊ󤬤¿¤¯¤µ¤ó½ÐÎϤµ¤ì¤ë¡£»ÈÍÑ»þ´Ö¤À¤±¤Ç¤Ê¤¯¡¢ +(¼èÆÀ¤Ç¤­¤ë¾ì¹ç¤Ë¤Ï) ¥á¥â¥ê¤ä I/O¡¢IPC ¸Æ¤Ó½Ð¤·¤Ê¤É¤Î¾¤Î¥ê¥½¡¼¥¹ +¤Ë´Ø¤¹¤ë¾ðÊó¤â½ÐÎϤµ¤ì¤ë¡£ +½ÐÎϤϥե©¡¼¥Þ¥Ã¥Èʸ»úÎó¤ò»È¤Ã¤ÆÀ°·Á¤µ¤ì¡¢ +¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Ï \-f ¥ª¥×¥·¥ç¥ó¤«´Ä¶­ÊÑ¿ô +.B TIME +¤Ç»ØÄê¤Ç¤­¤ë¡£ +.LP +¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Ï°Ê²¼¤ÎÄ̤ꡣ +.br +.in +3 +%Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k +.br +%Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps +.br +.in -3 +.LP +\-p ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢(¾¤È¸ß´¹À­¤Î¤¢¤ë) ½ÐÎÏ +¥Õ¥©¡¼¥Þ¥Ã¥È¤¬»ÈÍѤµ¤ì¤ë¡£ +.br +.in +3 +real %e +.br +user %U +.br +sys %S +.br +.in -3 +.SS "¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó" +¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¤è¤¯¤¢¤ë printf ·Á¼°¤Ç²ò¼á¤µ¤ì¤ë¡£ +Ä̾ï¤Îʸ»ú¤Ï¤½¤Î¤Þ¤Þ¥³¥Ô¡¼¤µ¤ì¡¢ +¥¿¥Ö¡¢²þ¹Ô (newline)¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Ï¤½¤ì¤¾¤ì \et, \en, \e\e ¤Ç +¥¨¥¹¥±¡¼¥×¤µ¤ì¤ë¡£ +¥Ñ¡¼¥»¥ó¥Èµ­¹æ¤Ï %% ¤Çɽ¸½¤µ¤ì¡¢¤½¤ì°Ê³°¤Î % ¤ÏÊÑ´¹¤ò¼¨¤¹¡£ +ËöÈø¤Ë¤Ïɬ¤º²þ¹Ôʸ»ú (newline) ¤¬Äɲ䵤ì¤ë¡£ +ÊÑ´¹¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.BR tcsh (1) +¤Ç»ÈÍѤµ¤ì¤ëÊÑ´¹¤ÏÁ´¤Æ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +.B "Time" +.TP +.B %E +·Ð²á¤·¤¿¼Â»þ´Ö ([hours:]minutes:seconds ¤Î·Á¼°)¡£ +.TP +.B %e +(tcsh ¤Ë¤Ï¤Ê¤¤) ·Ð²á¤·¤¿¼Â»þ´Ö (ÉÃñ°Ì)¡£ +.TP +.B %S +¤½¤Î¥×¥í¥»¥¹¤¬¥«¡¼¥Í¥ë¥â¡¼¥É¤Ç¾ÃÈñ¤·¤¿ CPU »þ´Ö¤Î¹ç·× (ÉÃñ°Ì)¡£ +.TP +.B %U +¤½¤Î¥×¥í¥»¥¹¤¬¥æ¡¼¥¶¥â¡¼¥É¤Ç¾ÃÈñ¤·¤¿ CPU »þ´Ö¤Î¹ç·× (ÉÃñ°Ì)¡£ +.TP +.B %P +¤³¤Î¥¸¥ç¥Ö¤¬³ÍÆÀ¤·¤¿ CPU ¤Î³ä¤ê¹ç¤¤ (¥Ñ¡¼¥»¥ó¥Æ¡¼¥¸)¡£ +(%U + %S) / %E ¤Ç·×»»¤µ¤ì¤ë¡£ +.LP +.B "Memory" +.TP +.B %M +¥×¥í¥»¥¹À¸Â¸Ãæ¤Î¤½¤Î¥×¥í¥»¥¹¤Î resident set size ¤ÎºÇÂçÃÍ¡£ +¥­¥í¥Ð¥¤¥Èñ°Ì¡£ +.TP +.B %t +(tcsh ¤Ë¤Ï¤Ê¤¤) +¤½¤Î¥×¥í¥»¥¹¤Î resident set size ¤ÎÊ¿¶ÑÃÍ¡£ +¥­¥í¥Ð¥¤¥Èñ°Ì¡£ +.TP +.B %K +¤½¤Î¥×¥í¥»¥¹¤Î¥á¥â¥ê»ÈÍÑÎ̤ιç·× (¥Ç¡¼¥¿+¥¹¥¿¥Ã¥¯+¥Æ¥­¥¹¥È) ¤ÎÊ¿¶ÑÃÍ¡£ +¥­¥í¥Ð¥¤¥Èñ°Ì¡£ +.TP +.B %D +¤½¤Î¥×¥í¥»¥¹¤ÎÈó¶¦Í­¥Ç¡¼¥¿Îΰè¤ÎÊ¿¶Ñ¥µ¥¤¥º¡£ +¥­¥í¥Ð¥¤¥Èñ°Ì¡£ +.TP +.B %p +(tcsh ¤Ë¤Ï¤Ê¤¤) +¤½¤Î¥×¥í¥»¥¹¤ÎÈó¶¦Í­¥¹¥¿¥Ã¥¯¶õ´Ö¤ÎÊ¿¶Ñ¥µ¥¤¥º¡£ +¥­¥í¥Ð¥¤¥Èñ°Ì¡£ +.TP +.B %X +¤½¤Î¥×¥í¥»¥¹¤Î¶¦Í­¥Æ¥­¥¹¥È¶õ´Ö¤ÎÊ¿¶Ñ¥µ¥¤¥º¡£ +¥­¥í¥Ð¥¤¥Èñ°Ì¡£ +.TP +.B %Z +(tcsh ¤Ë¤Ï¤Ê¤¤) ¥·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì)¡£ +¤³¤ÎÃͤϥ·¥¹¥Æ¥àËè¤Ë·è¤Þ¤ëÄê¿ô¤À¤¬¡¢¥·¥¹¥Æ¥à¤Ë¤è¤ê°Û¤Ê¤ë¡£ +.TP +.B %F +¥×¥í¥»¥¹¤ÎÆ°ºîÃæ¤ËȯÀ¸¤·¤¿¥á¥¸¥ã¡¼¥Ú¡¼¥¸¥Õ¥©¥ë¥È¤Î²ó¿ô¡£ +¤³¤ì¤Ï¡¢¥Ç¥£¥¹¥¯¤«¤é¥Ú¡¼¥¸¤òÆɤ߹þ¤àɬÍפ¬¤¢¤Ã¤¿¥Ú¡¼¥¸¥Õ¥©¥ë¥È¤Ë +´Ø¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.B %R +¥Þ¥¤¥Ê¡¼¥Ú¡¼¥¸¥Õ¥©¡¼¥ë¥È¡¢¤Ä¤Þ¤ê²óÉü²Äǽ¤Ê¥Ú¡¼¥¸¥Õ¥©¥ë¥È¤Î²ó¿ô¡£ +¤³¤ì¤Ï¡¢¤½¤Î¥Ú¡¼¥¸¤ÏÍ­¸ú¤Ç¤Ê¤¤¤¬¡¢¤Þ¤À¾¤Î²¾ÁÛ¥Ú¡¼¥¸¤ËÃ¥¤ï¤ì¤Æ +¤¤¤Ê¤«¤Ã¤¿¥Ú¡¼¥¸¤ËÂФ¹¤ë¥Ú¡¼¥¸¥Õ¥©¥ë¥È¤Ë´Ø¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.B %W +¤½¤Î¥×¥í¥»¥¹¤¬¼çµ­²±¤«¤é¥¹¥ï¥Ã¥×¥¢¥¦¥È¤µ¤ì¤¿²ó¿ô¡£ +.TP +.B %c +¤½¤Î¥×¥í¥»¥¹¤¬ (¥¿¥¤¥à¥¹¥é¥¤¥¹¤Î·Ð²á¤Ë¤è¤ê) ¶¯À©Åª¤Ë¥³¥ó¥Æ¥­¥¹¥È¥¹¥¤¥Ã¥Á +¤µ¤ì¤¿²ó¿ô¡£ +.TP +.B %w +wait ¤Î²ó¿ô¡¢¤Ä¤Þ¤ê¤½¤Î¥×¥í¥°¥é¥à¤¬¼«È¯Åª¤Ë¥³¥ó¥Æ¥­¥¹¥È¥¹¥¤¥Ã¥Á¤µ¤ì¤¿²ó¿ô¡£ +Î㤨¤Ð¡¢I/O Áàºî¤Î´°Î»¤òÂԤäƤ¤¤ë´Ö¤Ê¤É¤¬³ºÅö¤¹¤ë¡£ +.LP +.B "I/O" +.TP +.B %I +¤½¤Î¥×¥í¥»¥¹¤Ë¤è¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤é¤ÎÆþÎϤβó¿ô¡£ +.TP +.B %O +¤½¤Î¥×¥í¥»¥¹¤Ë¤è¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î½ÐÎϤβó¿ô¡£ +.TP +.B %r +¤½¤Î¥×¥í¥»¥¹¤¬¼õ¿®¤·¤¿¥½¥±¥Ã¥È¥á¥Ã¥»¡¼¥¸¿ô¡£ +.TP +.B %s +¤½¤Î¥×¥í¥»¥¹¤¬Á÷¿®¤·¤¿¥½¥±¥Ã¥È¥á¥Ã¥»¡¼¥¸¿ô¡£ +.TP +.B %k +¤½¤Î¥×¥í¥»¥¹¤ËÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¿ô¡£ +.TP +.B %C +(tcsh ¤Ë¤Ï¤Ê¤¤) time ¤ÎÂоݤȤʤä¿¥³¥Þ¥ó¥É̾¤È¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¡£ +.TP +.B %x +(tcsh ¤Ë¤Ï¤Ê¤¤) ¥³¥Þ¥ó¥É¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¡£ +.SS "GNU ¥ª¥×¥·¥ç¥ó" +.TP +.BI "\-f " FORMAT ", \-\-format=" FORMAT +½ÐÎÏ¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë¡£ +´Ä¶­ÊÑ¿ô +.B TIME +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥©¡¼¥Þ¥Ã¥È¤è¤ê¤âÍ¥À褵¤ì¤ë¡£ +.TP +.B "\-p, \-\-portability" +¾¤Î time ¤È¸ß´¹À­¤Î¤¢¤ë½ÐÎÏ¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ÈÍѤ¹¤ë¡£ +.TP +.BI "\-o " FILE ", \-\-output=" FILE +·ë²Ì¤ò \fIstderr\fP ¤ËÁ÷¤é¤º¡¢»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à¡£ +¥Õ¥¡¥¤¥ë¤Ï¾å½ñ¤­¤µ¤ì¤ë¡£ +.TP +.B "\-a, \-\-append" +(\-o ¤È°ì½ï¤Ë»ÈÍѤ¹¤ë¡£) +¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤­¤»¤º¤Ë¡¢·ë²Ì¤ò¥Õ¥¡¥¤¥ëËöÈø¤ËÄɲ乤롣 +.TP +.B "\-v, \-\-verbose" +Èó¾ï¤Ë¾Ü¤·¤¤½ÐÎϤǡ¢Æþ¼ê¤Ç¤­¤ëÁ´¤Æ¤Î¾ðÊó¤ò½ÐÎϤ¹¤ë¡£ +.SS "GNU ɸ½à¥ª¥×¥·¥ç¥ó" +.TP +.B "\-\-help" +»ÈÍÑÊýË¡¤Ë´Ø¤¹¤ë¥á¥Ã¥»¡¼¥¸¤òɸ½à½ÐÎϤËɽ¼¨¤·¡¢Àµ¾ï½ªÎ»¤¹¤ë¡£ +.TP +.B "\-V, \-\-version" +¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɸ½à½ÐÎϤËɽ¼¨¤·¡¢Àµ¾ï½ªÎ»¤¹¤ë¡£ +.TP +.B "\-\-" +¥ª¥×¥·¥ç¥ó¥ê¥¹¥È¤ÎËöÈø¤ò¼¨¤¹¡£ +.SH ¥Ð¥° +Á´¤Æ¤Î¥ê¥½¡¼¥¹¤¬ Unix ¤ÎÁ´¤Æ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç·×¬¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢ +¤¤¤¯¤Ä¤«¤ÎÃͤ¬ 0 ¤ÈÊó¹ð¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¸½ºß¤Î½ÐÎϹàÌܤΤۤȤó¤É¤Ï 4.2BSD ¤ä 4.3BSD ¤Ç¼èÆÀ²Äǽ¤Ê¥Ç¡¼¥¿¤Ë +´ð¤Å¤¤¤ÆÁªÂò¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +GNU time ¥Ð¡¼¥¸¥ç¥ó 1.7 ¤Ï¤Þ¤À¥í¡¼¥«¥é¥¤¥º¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢POSIX ¤ÎÍ×·ï¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£ +.LP +.B TIME +¤È¤¤¤¦´Ä¶­ÊÑ¿ô¤Ï̾Á°¤ÎÁªÂò¤¬¤Þ¤º¤¤¡£ +.BR autoconf (1) +¤ä +.BR make (1) +¤Î¤è¤¦¤Ê¥·¥¹¥Æ¥à¤Ç¤Ï¡¢»ÈÍѤ¹¤ë¥³¥Þ¥ó¥É¤ò¾å½ñ¤­¤¹¤ë¤Î¤Ë¤½¤Î¥³¥Þ¥ó¥É¤Î +̾Á°¤Î´Ä¶­ÊÑ¿ô¤ò»È¤¦¤Î¤¬ÄÁ¤·¤¯¤Ê¤¤¡£ +MORE ¤ä TIME ¤Î¤è¤¦¤Ê̾Á°¤ò (¥×¥í¥°¥é¥à¤Î¥Ñ¥¹Ì¾¤Î»ØÄê¤Ç¤Ï¤Ê¤¯) +¥×¥í¥°¥é¥à¤Ø¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤Î¤Ë»È¤¦¤È¡¢ +ÌÌÅݤʤ³¤È¤ò°ú¤­µ¯¤³¤¹²ÄǽÀ­¤¬¹â¤¤¡£ +.LP +\-o ¤¬Äɵ­¤Ç¤Ï¤Ê¤¯¾å½ñ¤­¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ï»ÄÇ°¤Ê¤³¤È¤À +(¤Ä¤Þ¤ê \-a ¥ª¥×¥·¥ç¥ó¤¬¥Ç¥Õ¥©¥ë¥È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Ù¤­¤À¤í¤¦¤È¤¤¤¦¤³¤È¤À)¡£ +.LP +GNU +.B time +¤ËÂФ¹¤ëÄó°Æ¤ä¥Ð¥°¥ì¥Ý¡¼¥È¤Ï +.br +.I bug\-utils@prep.ai.mit.edu +.br +¤Þ¤Ç¥á¡¼¥ë¤òÁ÷¤Ã¤Æ¤Û¤·¤¤¡£ +¤½¤Î¾ì¹ç¤Ë¤Ï +.B time +¤ä OS¡¢»ÈÍѤ·¤Æ¤¤¤ë C ¥³¥ó¥Ñ¥¤¥é¤Î +¥Ð¡¼¥¸¥ç¥ó¤òµ­ºÜ¤·¤Æ¤Û¤·¤¤¡£ +.B time +¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï°Ê²¼¤Î¥³¥Þ¥ó¥É¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +.br +.I time \-\-version +.br +.\" .SH AUTHORS +.\" .TP +.\" .IP "David Keppel" +.\" Original version +.\" .IP "David MacKenzie" +.\" POSIXization, autoconfiscation, GNU getoptization, +.\" documentation, other bug fixes and improvements. +.\" .IP "Arne Henrik Juul" +.\" Helped with portability +.\" .IP "Francois Pinard" +.\" Helped with portability +.SH ´ØÏ¢¹àÌÜ +.BR tcsh (1), +.BR times (2), +.BR wait3 (2) diff --git a/release/man2/_exit.2 b/release/man2/_exit.2 new file mode 100644 index 00000000..77cdc5b9 --- /dev/null +++ b/release/man2/_exit.2 @@ -0,0 +1,141 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 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 ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\" +.TH _EXIT 2 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +_exit, _Exit \- ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "void _exit(int " status ); +.sp +.B #include +.sp +.BI "void _Exit(int " status ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR _Exit (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; ¤Þ¤¿¤Ï +.I cc\ -std=c99 +.SH ÀâÌÀ +.BR _exit () +¤Ï¡¢¤½¤ì¤ò¸Æ¤ó¤À¥×¥í¥»¥¹¤ò¡Öľ¤Á¤Ë¡×½ªÎ»¤µ¤»¤ë¡£ +¤½¤ÎºÝ¡¢¤³¤Î¥×¥í¥»¥¹¤¬½êÍ­¤·¤Æ¤¤¤ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ (descriptor) ¤Ç¡¢ +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤ÏÁ´¤Æ¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +¤Þ¤¿¡¢¤³¤Î¥×¥í¥»¥¹¤¬½êÍ­¤¹¤ë»Ò¥×¥í¥»¥¹¤ÏÁ´¤Æ¡¢¥×¥í¥»¥¹ÈÖ¹æ 1¡¢ +¤Ä¤Þ¤ê +.I init +¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ·Ñ¾µ¤µ¤ì¡¢¤³¤Î¥×¥í¥»¥¹¤Î¿Æ¥×¥í¥»¥¹¤ËÂФ·¤Æ +.B SIGCHLD +¥·¥°¥Ê¥ë¤¬Á÷½Ð¤µ¤ì¤ë¡£ +.LP +.I status +¤ÎÃͤϡ¢¤³¤Î¥×¥í¥»¥¹¤Î½ªÎ»¾õÂ֤Ȥ·¤Æ¤½¤Î¿Æ¥×¥í¥»¥¹¤ËÂФ·¤ÆÊÖ¤µ¤ì¡¢ +.BR wait (2) +·Ï´Ø¿ô¤òÍøÍѤ¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +´Ø¿ô +.BR _Exit () +¤Ï +.BR _exit () +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÃͤòÊÖ¤µ¤Ê¤¤¡£ +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD. +´Ø¿ô +.BR _Exit () +¤Ï C99 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.SH Ãí°Õ +exit ¤ÎÌò³ä¡¦½ªÎ»¾õÂ֤μõÅϤ·¡¦ +¥¾¥ó¥Ó¥×¥í¥»¥¹¡¦¥·¥°¥Ê¥ëÁ÷½Ð¤Ê¤É¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤Ï¡¢ +.BR exit (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.LP +´Ø¿ô +.BR _exit () +¤Ï +.BR exit (3) +¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ANSI C ¤Î +.BR atexit (3) +¤ä +.BR on_exit (3) +¤Ë¤è¤Ã¤ÆÅÐÏ¿¤µ¤ì¤¿¤¤¤«¤Ê¤ë´Ø¿ô¤â¸Æ¤Ó½Ð¤µ¤Ê¤¤¡£ +ɸ½à I/O ¥Ð¥Ã¥Õ¥¡¤Î¥Õ¥é¥Ã¥·¥å¤ä¡¢ +.BR tmpfile (3) +¤ÇºîÀ®¤µ¤ì¤¿¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤Îºï½ü¤ò¹Ô¤¦¤«¤É¤¦¤«¤Ï¡¢¼ÂÁõ¤Ë°Í¸¤¹¤ë¡£ +°ìÊý¤Ç¡¢ +.BR _exit () +¤Ï¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¤¿¤á¡¢ +̤·èÄê¤Ë¤Ê¤Ã¤Æ¤¤¤ë½ÐÎϤ¬¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë¤Î¤òÂԤĤΤËÉÔ³ÎÄê¤ÊÃ٤줬ȯÀ¸¤¹¤ë¡£ +¤³¤ÎÃÙ¤ì¤òȯÀ¸¤µ¤»¤¿¤¯¤Ê¤±¤ì¤Ð¡¢ +.BR _exit () +¤ÎÁ°¤Ë +.BR tcflush (3) +¤Î¤è¤¦¤Ê´Ø¿ô¤ò¸Æ¤Ó½Ð¤»¤Ð¤è¤¤¡£ +.BR _exit () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¤È¤­¤Ë¡¢ +̤·èÄê¤Ë¤Ê¤Ã¤Æ¤¤¤ëÁ´¤Æ¤Î I/O ¤¬¥­¥ã¥ó¥»¥ë¤µ¤ì¤ë¤Î¤«¡¢ +¤Þ¤¿¤É¤Î I/O ¤¬¥­¥ã¥ó¥»¥ë¤µ¤ì¤ë¤Î¤«¤Ï¼ÂÁõ¤Ë°Í¸¤¹¤ë¡£ + +¥Ð¡¼¥¸¥ç¥ó 2.3 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢ +.BR _exit () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤ÏƱ¤¸Ì¾Á°¤Î¥«¡¼¥Í¥ë¡¦¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤·¤Æ¤¤¤¿¡£ +glibc 2.3 °Ê¹ß¤Ç¤Ï¡¢¥×¥í¥»¥¹Æâ¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤ò½ªÎ»¤¹¤ë¤¿¤á¤Ë¡¢ +¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï +.BR exit_group (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) diff --git a/release/man2/_syscall.2 b/release/man2/_syscall.2 new file mode 100644 index 00000000..15837d7a --- /dev/null +++ b/release/man2/_syscall.2 @@ -0,0 +1,167 @@ +.\" +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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. +.\" +.\" Tue Jul 6 12:42:46 MDT 1993 +.\" Added "Calling Directly" and supporting paragraphs +.\" +.\" Modified Sat Jul 24 15:19:12 1993 by Rik Faith +.\" +.\" Modified 21 Aug 1994 by Michael Chastain : +.\" Added explanation of arg stacking when 6 or more args. +.\" +.\" Modified 10 June 1995 by Andries Brouwer +.\" +.\" 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" +.SH ̾Á° +_syscall \- ¥é¥¤¥Ö¥é¥ê¤Î¥µ¥Ý¡¼¥È¤Ê¤·¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤¹¤ë (ÀΤÎÊýË¡) +.SH ½ñ¼° +.B #include + +A _syscall macro + +desired system call +.SH ÀâÌÀ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë´Ø¤·¤Æ¤½¤Î¥×¥í¥È¥¿¥¤¥×¤òÃΤ뤳¤È¤¬½ÅÍפǤ¢¤ë¡£ +°ú¤­¿ô¤Î¸Ä¿ô¡¢¤½¤ì¤é¤Î·¿¡¢ÊÖ¤êÃͤη¿¤òÃΤëɬÍפ¬¤¢¤ë¡£ +¼ÂºÝ¤Î»ÈÍѤˤ¢¤¿¤Ã¤Æ¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¥·¥¹¥Æ¥à¤Ë¸Æ¤Ó½Ð¤·¤ä¤¹¤¯¤¹¤ë¤¿¤á¤Ë¡¢ +7 ¸Ä¤Î¥Þ¥¯¥í¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï°Ê²¼¤Î·Á¤Ç¤¢¤ë¡£ +.sp +.RS +.RI _syscall X ( type , name , type1 , arg1 , type2 , arg2 ,...) +.RE +.PP +¤³¤³¤Ç +.IP +\fIX\fP ¤Ï 0¡Á6 ¤Ç¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¼è¤ë°ú¤­¿ô¤Î¸Ä¿ô¤Ç¤¢¤ë¡£ +.IP +\fItype\fP ¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÊÖ¤êÃͤη¿¤Ç¤¢¤ë¡£ +.IP +\fIname\fP ¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î̾Á°¤Ç¤¢¤ë¡£ +.IP +\fItypeN\fP ¤Ï N ÈÖÌܤΰú¤­¿ô¤Î·¿¤Ç¤¢¤ë¡£ +.IP +\fIargN\fP ¤Ï N ÈÖÌܤΰú¤­¿ô¤Î̾Á°¤Ç¤¢¤ë¡£ +.PP +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï¡¢»ØÄꤷ¤¿°ú¤­¿ô¤ò»ý¤Ä \fIname\fP ¤È¤¤¤¦Ì¾Á°¤Î´Ø¿ô¤òÀ¸À®¤¹¤ë¡£ +°ìÅÙ¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎÃæ¤Ç _syscall() ¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ¤ª¤¯¤È¡¢ +¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò \fIname\fP ¤È¤¤¤¦Ì¾Á°¤Ç¸Æ¤Ö¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +.I /usr/include/linux/unistd.h +.SH ½àµò +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢¤½¤Î»ÈÍѤÏÈó¿ä¾©¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¥«¡¼¥Í¥ë 2.6.18 ¤¢¤¿¤ê¤«¤é¡¢_syscall ¥Þ¥¯¥í·²¤Ï¥æ¡¼¥¶¶õ´Ö¤ËÂФ·¤ÆÄ󶡤µ¤ì¤ë +¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤«¤éºï½ü¤µ¤ì¤¿¡£Âå¤ï¤ê¤Ë +.BR syscall (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +(¤¤¤¯¤Ä¤«¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¡¢ÆÃ¤Ë ia64¡¢¤Ç¤Ï¡¢¤³¤ì¤Þ¤Ç _syscall ¥Þ¥¯¥í¤¬ +Ä󶡤µ¤ì¤¿¤³¤È¤Ï¤Ê¤¤¡£¤³¤Î¤è¤¦¤Ê¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢¾ï¤Ë +.BR syscall (2) +¤¬É¬ÍפǤ¢¤Ã¤¿¡£) + +_syscall() ¥Þ¥¯¥í¤Ï¥×¥í¥È¥¿¥¤¥×¤ò¡ÖÀ¸À®¤·¤Ê¤¤¡×¡£ +¥æ¡¼¥¶¤Ï¥×¥í¥È¥¿¥¤¥×¤ò¼«Ê¬¤Ç½ñ¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +¤È¤ê¤ï¤± C++ ¥æ¡¼¥¶¤Î¾ì¹ç¤Ï¤½¤¦¤Ç¤¢¤í¤¦¡£ + +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢Àµ¤Î¥¨¥é¡¼¥³¡¼¥É¤Î¤ß¡¢¤Þ¤¿¤ÏÉé¤Î¥¨¥é¡¼¥³¡¼¥É¤Î¤ß¤òÊÖ¤¹¤è¤¦¤Ë +Äê¤á¤é¤ì¤Æ¤¤¤ëÌõ¤Ç¤Ï¤Ê¤¤¡£¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤É¤Î¤è¤¦¤Ê¥¨¥é¡¼¥³¡¼¥É¤òÊÖ¤¹¤«¤ò +³Îǧ¤¹¤ë¤Ë¤Ï¡¢¤½¤Î¥½¡¼¥¹¥³¡¼¥É¤òÆɤàɬÍפ¬¤¢¤ë¡£¤¿¤¤¤Æ¤¤¤Î¾ì¹ç¤Ï¡¢É¸½à¤Î¥¨¥é¡¼ +¥³¡¼¥É¤òÉé¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë (Î㤨¤Ð \-\fBEPERM\fP)¡£ +_syscall() ¥Þ¥¯¥í¤Ï¡¢¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÊÖ¤êÃÍ \fIr\fP ¤¬Éé¤Ç¤Ê¤¤¾ì¹ç¡¢¤½¤ÎÃÍ +¤ò¤½¤Î¤Þ¤ÞÊÖ¤¹¡£°ìÊý¡¢\fIr\fP ¤¬Éé¤Î¾ì¹ç¤Ë¤Ï¡¢ÊÑ¿ô +.I errno +¤Ë \-\fIr\fP ¤òÀßÄꤷ¡¢\-1 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤Ï +.BR errno (3) +¤ò»²¾È¡£ + +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÄêµÁ¤¹¤ëºÝ¡¢°ú¤­¿ô¤Î·¿¤ÏÃÍÅϤ· (by-value) ¤«¡¢ +(¹½Â¤ÂΤΤ褦¤Ë½¸¹çŪ¤Ê¥Ç¡¼¥¿¤Î¾ì¹ç¤Ï) ¥Ý¥¤¥ó¥¿ÅϤ· (by-pointer) +¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" The preferred way to invoke system calls that glibc does not know +.\" about yet is via +.\" .BR syscall (2). +.\" However, this mechanism can only be used if using a libc +.\" (such as glibc) that supports +.\" .BR syscall (2), +.\" and if the +.\" .I +.\" header file contains the required SYS_foo definition. +.\" Otherwise, the use of a _syscall macro is required. +.\" +.SH Îã +.nf +#include +#include +#include +#include /* for _syscallX macros/related stuff */ +#include /* for struct sysinfo */ + +_syscall1(int, sysinfo, struct sysinfo *, info); + +/* Note: nroff ¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤«¤éľÀÜ¥³¥Ô¡¼¤¹¤ëºÝ¤Ë¤Ï¡¢ +printf ʸÆâ¤Î;ʬ¤Ê¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤ò˺¤ì¤º¤Ëºï½ü¤¹¤ë¤è¤¦¤Ë¡£ */ + +int +main(void) +{ + struct sysinfo s_info; + 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", + s_info.uptime, s_info.loads[0], + s_info.loads[1], s_info.loads[2], + s_info.totalram, s_info.freeram, + s_info.sharedram, s_info.bufferram, + s_info.totalswap, s_info.freeswap, + s_info.procs); + exit(EXIT_SUCCESS); +} +.fi +.SS "Sample Output" +.nf +code error = 0 +uptime = 502034s +Load: 1 min 13376 / 5 min 5504 / 15 min 1152 +RAM: total 15343616 / free 827392 / shared 8237056 +Memory in buffers = 5066752 +Swap: total 27881472 / free 24698880 +Number of processes = 40 +.fi +.SH ´ØÏ¢¹àÌÜ +.BR intro (2), +.BR syscall (2), +.BR errno (3) diff --git a/release/man2/accept.2 b/release/man2/accept.2 new file mode 100644 index 00000000..832591a7 --- /dev/null +++ b/release/man2/accept.2 @@ -0,0 +1,415 @@ +.\" Copyright (c) 1983, 1990, 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. +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-10-21 by Eric S. Raymond +.\" Modified 1998-2000 by Andi Kleen to match Linux 2.2 reality +.\" Modified 2002-04-23 by Roger Luethi +.\" 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 ÀܳµñÈÝ +.\" +.TH ACCEPT 2 2009-02-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +accept \- ¥½¥±¥Ã¥È¤Ø¤ÎÀܳ¤ò¼õ¤±¤ë +.SH ½ñ¼° +.nf +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.B #include + +.BI "int accept(int " sockfd ", struct sockaddr *" addr ", socklen_t *" addrlen ); + +.B #define _GNU_SOURCE +.B #include + +.BI "int accept4(int " sockfd ", struct sockaddr *" addr , +.BI " socklen_t *" addrlen ", int " flags ); +.fi +.SH ÀâÌÀ +.BR accept () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢Àܳ»Ø¸þ¤Î¥½¥±¥Ã¥È·¿ +.RB ( SOCK_STREAM ", " SOCK_SEQPACKET ) +¤ÇÍѤ¤¤é¤ì¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢ÀܳÂÔ¤Á¥½¥±¥Ã¥È +.I socket +°¸¤Æ¤ÎÊÝα¾õÂÖ¤ÎÀܳÍ׵᤬Æþ¤Ã¤Æ¤¤¤ë¥­¥å¡¼¤«¤é +ÀèƬ¤ÎÀܳÍ×µá¤ò¼è¤ê½Ð¤·¡¢ÀܳºÑ¤ß¥½¥±¥Ã¥È¤ò¿·µ¬¤ËÀ¸À®¤·¡¢ +¤½¤Î¥½¥±¥Ã¥È¤ò»²¾È¤¹¤ë¿·¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¿·µ¬¤ËÀ¸À®¤µ¤ì¤¿¥½¥±¥Ã¥È¤Ï¡¢ÀܳÂÔ¤Á (listen) ¾õÂ֤ǤϤʤ¤¡£ +¤â¤È¤â¤È¤Î¥½¥±¥Ã¥È +.I sockfd +¤Ï¤³¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡£ +.PP +°ú¤­¿ô +.I sockfd +¤Ï¡¢ +.BR socket (2) +¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¡¢ +.BR bind (2) +¤Ë¤è¤Ã¤Æ¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¡¢ +.BR listen (2) +¤ò·Ð¤ÆÀܳ¤òÂԤäƤ¤¤ë¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£ + +.I addr +°ú¤­¿ô¤Ï +.I sockaddr +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤³¤Î¹½Â¤ÂΤˤÏÀܳÁê¼ê¤Î¥½¥±¥Ã¥È¤Î¥¢¥É¥ì¥¹¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.I addr +°ú¤­¿ô¤ÇÊÖ¤µ¤ì¤ë¥¢¥É¥ì¥¹¤ÎÀµ³Î¤Ê¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢ +¥½¥±¥Ã¥È¤Î¥¢¥É¥ì¥¹¼ïÊ̤ˤè¤Ã¤ÆÊѤï¤ë +.RB ( socket (2) +¤ª¤è¤Ó¤½¤ì¤¾¤ì¤Î¥×¥í¥È¥³¥ë¤Î man ¥Ú¡¼¥¸¤ò»²¾È)¡£ +.I addr +¤¬ NULL ¤Î¾ì¹ç¡¢ +.I addr +¤Ë¤Ï²¿¤âÆþ¤é¤Ê¤¤¡£¤³¤Î¾ì¹ç¡¢ +.I addrlen +¤Ï»ÈÍѤµ¤ì¤º¡¢¤³¤Î°ú¤­¿ô¤Ï NULL ¤Ë¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ + +.I addrlen +°ú¤­¿ô¤ÏÆþ½ÐÎÏξÍѤΰú¤­¿ô¤Ç¤¢¤ë¡£¸Æ¤Ó½Ð¤·»þ¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤¬ +.I addr +¤¬»Ø¤¹¹½Â¤ÂΤΥµ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤Ç½é´ü²½¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Ê֤äƤ¯¤ë»þ¤Ë¤Ï¡¢ÀܳÁê¼ê¤Î¥¢¥É¥ì¥¹¤Î¼ÂºÝ¤ÎÂ礭¤µ¤¬³ÊǼ¤µ¤ì¤ë¡£ + +ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ²á¤®¤ë¾ì¹ç¤Ë¤Ï¡¢ÊÖ¤µ¤ì¤ë¥¢¥É¥ì¥¹¤ÎËöÈø¤Ï +ÀÚ¤êµÍ¤á¤é¤ì¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I addrlen +¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·»þ¤ËÅϤµ¤ì¤¿Ãͤè¤ê¤âÂ礭¤ÊÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +.PP +¥­¥å¡¼¤ËÊÝα¤È¤Ê¤Ã¤Æ¤¤¤ëÀܳÍ׵᤬¤Ê¤¯¡¢ +¤«¤Ä¥½¥±¥Ã¥È¤¬ÈóÄä»ß¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¤È¤­¤Ï¡¢ +.BR accept () +¤ÏÀܳ¤¬È¯À¸¤¹¤ë¤Þ¤Ç¸Æ¤Ó½Ð¤·¸µ¤òÄä»ß (block) ¤¹¤ë¡£ +¥½¥±¥Ã¥È¤¬ÈóÄä»ß¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¡¢ +ÂÔ¤Á¾õÂÖ¤ÎÀܳÍ׵᤬¥­¥å¡¼¤Ë̵¤¤¤È¤­¤Ï¡¢ +.BR accept () +¤Ï¥¨¥é¡¼ +.B EAGAIN +¤« +.B EWOULDBLOCK +¤Ç¼ºÇÔ¤¹¤ë¡£ +.PP +¥½¥±¥Ã¥È¤Ø¤ÎÀܳÅþÃå¤òÃΤë¤Ë¤Ï¡¢ +.BR select (2) +¤Þ¤¿¤Ï +.BR poll (2) +¤òÍѤ¤¤ì¤Ð¤è¤¤¡£ +¿·¤·¤¤ÀܳÍ׵᤬Íè¤ë¤È¥½¥±¥Ã¥È¤ÏÆɤ߹þ¤ß²Äǽ¤Ë¤Ê¤ë¤Î¤Ç¡¢ +¤½¤¦¤·¤¿¤é +.BR accept () +¤ò¸Æ¤ó¤Ç¤½¤ÎÀܳ¤ËÂФ¹¤ë¥½¥±¥Ã¥È¤ò¼èÆÀ¤¹¤ì¤Ð¤è¤¤¡£ +¤¢¤ë¤¤¤Ï¥½¥±¥Ã¥È¤ËÀßÄê¤ò¹Ô¤¤¡¢²¿¤é¤«¤Î¥¢¥¯¥·¥ç¥ó¤¬¤¢¤Ã¤¿¤È¤­¤Ë +.B SIGIO +¤òÇÛÁ÷ (deliver) ¤µ¤»¤ë¤è¤¦¤Ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£¾ÜºÙ¤Ï +.BR socket (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +ÌÀ¼¨Åª¤ÊÀܳ³Îǧ (confirmation) ¤òɬÍפȤ¹¤ë¤è¤¦¤Ê¥×¥í¥È¥³¥ë +(DECNet ¤Ê¤É) ¤Ç¤Ï¡¢ +.BR accept () +¤Ïñ¤Ë¼¡¤ÎÀܳÍ×µá¤ò¥­¥å¡¼¤«¤é¼è¤ê½Ð¤¹¤À¤±¤Ç¤¢¤ê¡¢ +Àܳ³Îǧ¤Ï¹Ô¤ï¤Ê¤¤¤³¤È¤ËÃí°Õ¤»¤è¡£Àܳ³Îǧ¤Ï¡¢ +¿·¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ë +Ä̾ï¤ÎÆɤ߼è¤ê/½ñ¤­¹þ¤ß¤Ë¤è¤Ã¤Æ¤Ê¤µ¤ì¡¢ÀܳµñÈÝ (rejection) +¤Ï¿·¤·¤¤¥½¥±¥Ã¥È¤ò¥¯¥í¡¼¥º¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤Ê¤µ¤ì¤ë¡£ +¸½ºß¤Î¤È¤³¤í¡¢ +Linux ¾å¤Ç¤³¤ì¤é¤Î¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤ò»ý¤Ä¤Î¤Ï DECNet ¤À¤±¤Ç¤¢¤ë¡£ + +.I flags +¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR accept4 () +¤Ï +.BR accept () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.I flags +¤Ë°Ê²¼¤ÎÃͤò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýÏ (OR) ¤Ç»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +°Û¤Ê¤ëÆ°ºî¤ò¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 16 +.B SOCK_NONBLOCK +¿·¤·¤¯À¸À®¤µ¤ì¤ë¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò (open file description) ¤Î +.B O_NONBLOCK +¥Õ¥¡¥¤¥ë¥¹¥Æ¡¼¥¿¥¹¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤³¤È¤Ç¡¢ +.B O_NONBLOCK +¤ò¥»¥Ã¥È¤¹¤ë¤¿¤á¤Ë +.BR fcntl (2) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.TP +.B SOCK_CLOEXEC +¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +close-on-exec +.RB ( FD_CLOEXEC ) +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬Ìò¤ËΩ¤ÄÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR open (2) +¤Î +.B O_CLOEXEC +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +¼õ¤±ÉÕ¤±¤¿¥½¥±¥Ã¥È¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ëÈóÉé¤ÎÀ°¿ôÃͤòÊÖ¤¹¡£ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SS ¥¨¥é¡¼½èÍý +Linux ¤Î +.BR accept () +(¤È +.BR accept4 ()) +¤Ï¡¢¿·¤·¤¤¥½¥±¥Ã¥È¤Ë¤ª¤±¤ë¡¢È¯À¸ºÑ¤ß¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥é¡¼¤ò +.BR accept () +¤«¤é¤Î¥¨¥é¡¼¥³¡¼¥É¤È¤·¤ÆÅϤ¹¡£ +¤³¤Î¿¶Éñ¤¤¤Ï BSD ¥½¥±¥Ã¥È¤Î¼ÂÁõ¤È¤Ï°Û¤Ê¤ë¡£ +¿®ÍêÀ­¤Î¹â¤¤Æ°ºî¤ò¹Ô¤¦¤¿¤á¤Ë¤Ï¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥×¥í¥È¥³¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥é¡¼¤Î¸¡ÃΤò +.BR accept () +¤Î¤¢¤È¤Ë¹Ô¤¤¡¢¤½¤ì¤é¤Î¥¨¥é¡¼¤ò +.B EAGAIN +¤ÈƱ¤¸¤è¤¦¤Ë°·¤¤¡¢ºÆ»î¹Ô (retry) ¤ò¹Ô¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +TCP/IP ¤Ç¤Ï¡¢°Ê²¼¤Î¥¨¥é¡¼¤¬³ºÅö¤¹¤ë: +.BR ENETDOWN , +.BR EPROTO , +.BR ENOPROTOOPT , +.BR EHOSTDOWN , +.BR ENONET , +.BR EHOSTUNREACH , +.BR EOPNOTSUPP , +.B ENETUNREACH +.SH ¥¨¥é¡¼ +.TP +.BR EAGAIN " ¤Þ¤¿¤Ï " EWOULDBLOCK +.\" Actually EAGAIN on Linux +¥½¥±¥Ã¥È¤¬ÈóÄä»ß¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¡¢ +¤«¤Ä¼õÉÕ¤±ÂоݤÎÀܳ¤¬Â¸ºß¤·¤Ê¤¤¡£ +POSIX.1-2001 ¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¤É¤Á¤é¤Î¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤âǧ¤á¤Æ¤ª¤ê¡¢ +¤³¤ì¤é 2 ¤Ä¤ÎÄê¿ô¤¬Æ±¤¸Ãͤò»ý¤Ä¤³¤È¤âµá¤á¤Æ¤¤¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢Î¾Êý¤Î²ÄǽÀ­¤ò +³Îǧ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B EBADF +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¡£ +.TP +.B ECONNABORTED +Àܳ¤¬Ãæ»ß¤µ¤ì¤¿¡£ +.TP +.B EFAULT +.I addr +°ú¤­¿ô¤¬¥æ¡¼¥¶¥¢¥É¥ì¥¹¶õ´Ö¤Î½ñ¤­¹þ¤ß²ÄǽÎΰè¤Ë¤Ê¤¤¡£ +.TP +.B EINTR +Í­¸ú¤ÊÀܳ¤¬ÅþÃ夹¤ëÁ°¤ËÊ᪤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÃæÃǤµ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +¥½¥±¥Ã¥È¤¬ÀܳÂÔ¤Á¾õÂ֤ǤϤʤ¤¡£¤â¤·¤¯¤Ï¡¢ +.I addrlen +¤¬ÉÔÀµ¤Ç¤¢¤ë (Î㤨¤Ð¡¢Éé¤Î¾ì¹ç¤Ê¤É)¡£ +.TP +.B EINVAL +.RB ( accept4 ()) +.I flags +¤ËÉÔÀµ¤ÊÃͤ¬»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EMFILE +1¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¿ô¤Î¾å¸Â¤Ë㤷¤¿¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥àÁ´ÂΤξå¸Â¤Ë㤷¤¿¡£ +.TP +.BR ENOBUFS ", " ENOMEM +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +¿¤¯¤Î¾ì¹ç¤Ï¡¢¥·¥¹¥Æ¥à¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¤ï¤±¤Ç¤Ï¤Ê¤¯¡¢ +¥½¥±¥Ã¥È¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤Ë¤è¤ë¥á¥â¥ê³ä¤êÅö¤Æ¤ÎÀ©¸Â¤Ç¤¢¤ë¡£ +.TP +.B ENOTSOCK +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¥½¥±¥Ã¥È¤Ç¤Ï¤Ê¤¯¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.TP +.B EOPNOTSUPP +»²¾È¤·¤Æ¤¤¤ë¥½¥±¥Ã¥È¤Î·¿¤¬ +.B SOCK_STREAM +¤Ç¤Ê¤¤¡£ +.TP +.B EPROTO +¥×¥í¥È¥³¥ë¡¦¥¨¥é¡¼¡£ +.PP +¾åµ­¤Ë²Ã¤¨¤Æ¡¢Linux ¤Î +.BR accept () +¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë: +.TP +.B EPERM +¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Î¥ë¡¼¥ë¤Ë¤è¤êÀܳ¤¬¶Ø»ß¤µ¤ì¤¿¡£ +.PP +¤³¤Î¾¤Ë¡¢¿·¤·¤¤¥½¥±¥Ã¥È¤ËÂФ¹¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +¤³¤ì¤é¤Ï¤½¤ì¤¾¤ì¤Î¥×¥í¥È¥³¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤¤¤í¤¤¤í¤Ê Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +°Ê²¼¤Ë¼¨¤¹¤è¤¦¤Ê¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤â¤¢¤ë¡£ +.BR ENOSR , +.BR ESOCKTNOSUPPORT , +.BR EPROTONOSUPPORT , +.BR ETIMEDOUT . +.B ERESTARTSYS +¤¬¥È¥ì¡¼¥¹¤ÎºÇÃæ¤Ë¸½¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR accept4 () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6.28 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.10 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +.BR accept (): +POSIX.1-2001, +SVr4, 4.4BSD, +.RB ( accept () +¤Ï 4.2BSD ¤Ç½é¤á¤Æ¼ÂÁõ¤µ¤ì¤¿). +.\" BSD ¤Î man ¥Ú¡¼¥¸¤Ë¤Ï¡¢ 5 ¤Ä¤Î¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤¦¤ë¤È½ñ¤«¤ì¤Æ¤¤¤ë +.\" (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT)¡£ +.\" POSIX.1-2001 ¤Ç¤Ï¡¢ +.\" EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE, +.\" ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK +.\" ¤¬¥¨¥é¡¼¤È¤·¤Æµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.\" ¤µ¤é¤Ë¡¢SUSv2 ¤Ë¤Ï EFAULT, ENOSR ¤âµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ + +.BR accept4 () +¤ÏÈóɸ½à¤Î Linux ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.LP +Linux ¤Ç¤Ï¡¢ +.BR accept () +¤¬ÊÖ¤¹¿·¤·¤¤¥½¥±¥Ã¥È¤Ï listen ¤ò¹Ô¤Ã¤Æ¤¤¤ë¥½¥±¥Ã¥È¤Î +¥Õ¥¡¥¤¥ë¾õÂ֥ե饰 +.RB ( O_NONBLOCK +¤ä +.B O_ASYNC +¤Ê¤É) ¤ò·Ñ¾µ¡Ö¤·¤Ê¤¤¡×¡£ +¤³¤ÎÆ°ºî¤Ïɸ½àŪ¤Ê BSD ¥½¥±¥Ã¥È¤Î¼ÂÁõ¤È¤Ï°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" ¤¤¤¯¤Ä¤«¼Â¸³¤·¤¿¤È¤³¤í¤Ç¤Ï Tru64 5.1 ¤È HP-UX 11 ¤â +.\" ¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤ò·Ñ¾µ¤·¤Ê¤¤¤è¤¦¤Ç¤¢¤ë¡£ -- MTK Jun 05 +°Ü¿¢À­¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤¬·Ñ¾µ¤µ¤ì¤ë¤«¤É¤¦¤«¤Ï +Á°Äó¤Ë¤»¤º¡¢¾ï¤Ë +.BR accept () +¤¬ÊÖ¤·¤¿¥½¥±¥Ã¥È¤ËÂФ·¤ÆÁ´¤Æ¤ÎɬÍפʥե饰¤òÌÀ¼¨Åª¤ËÀßÄꤹ¤ë¤è¤¦¤Ë +¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.SH Ãí°Õ +POSIX.1-2001 ¤Ç¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ïɬ¿Ü¤È¤µ¤ì¤Æ¤ª¤é¤º¡¢ +Linux ¤Ç¤Ï¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÏɬÍפǤϤʤ¤¡£ +¤·¤«¤·¡¢Îò»ËŪ¤Ë¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¼ÂÁõ (BSD ·Ï) ¤Ç¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬ +ɬÍפǤ¢¤ê¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò +¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬¸­ÌÀ¤Ç¤¢¤í¤¦¡£ + +.B SIGIO +¤¬ÆϤ±¤é¤ì¤¿¸å¤ä¡¢ +.BR select (2) +¤Þ¤¿¤Ï +.BR poll (2) +¤¬Æɤ߹þ¤ß²Äǽ¥¤¥Ù¥ó¥È¤òÊÖ¤·¤¿¸å¤Ë¡¢ +ɬ¤º¤·¤âÂÔµ¡Ãæ¤ÎÀܳ¤¬¤¢¤ë¤È¤Ï¸Â¤é¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¤½¤ÎÀܳ¤Ï¡¢ +.BR accept () +¤¬¸Æ¤Ð¤ì¤ëÁ°¤Ë¡¢ÈóƱ´üŪ¤Ê¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥é¡¼¤ä +¾¤Î¥¹¥ì¥Ã¥É¤«¤é¸Æ¤Ð¤ì¤¿ (Ê̤Î) accept ¤Ë¤è¤Ã¤Æ +ºï½ü¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +¤³¤Î¾ì¹ç¡¢¤½¤Î +.BR accept () +¸Æ¤Ó½Ð¤·¤ÏÄä»ß (block) ¤·¡¢¼¡¤ÎÀܳ¤ÎÅþÃå¤òÂÔ¤Á¤Ä¤Å¤±¤ë¡£ +.BR accept () +¤ËÄä»ß¤ò¹Ô¤ï¤»¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¡¢°ú¤­¿ô¤ËÅϤ¹¥½¥±¥Ã¥È +.I sockfd +¤Ë +.B O_NONBLOCK +¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë +.RB ( socket (7) +¤ò¸«¤è)¡£ +.SS socklen_t ·¿ +.BR accept () +¤ÎÂè 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 +¡Ö¤Þ¤È¤â¤Ê¥é¥¤¥Ö¥é¥ê¤òºî¤ê¤¿¤±¤ì¤Ð¡¢ "socklen_t" +¤Î¥µ¥¤¥º¤Ï int ¤ÈƱ¤¸¤Ë¤·¤Ê¤­¤ã¤Ê¤é¤Ê¤¤¡£ +¤µ¤â¤Ê¤¤¤È BSD ¥½¥±¥Ã¥ÈÁؤòÇ˲õ¤¹¤ë¤³¤È¤Ë¤Ê¤Ã¤Á¤ã¤¦¡£ +POSIX ¤ÏºÇ½é¤³¤¤¤Ä¤ò size_t ¤Ë¤·¤¿¤ó¤Ç¡¢ +¤Ü¤¯¤ÏÈà¤é¤Ëʸ¶ç¤ò¤¬¤Ê¤ê¤¿¤Æ¤¿ +(¿ʬ¤½¤¦¤¤¤¦¿Í¤Ï¾¤Ë¤â¤¤¤¿¤È»×¤¦¡£Â¿¤¯¤Ï¤Ê¤«¤Ã¤¿¤è¤¦¤À¤±¤É)¡£ +¤³¤¤¤Ä¤ò size_t ¤Ë¤¹¤ë¤Î¤Ï´°Á´¤Ë¤¤¤«¤ì¤Æ¤ë¡£ +Î㤨¤Ð 64 ¥Ó¥Ã¥È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢ +size_t ¤¬ "int" ¤ÈƱ¤¸¥µ¥¤¥º¤À¤Ê¤ó¤Æ¤³¤È¤Ï¤Û¤È¤ó¤É¤Ê¤¤¤«¤é¤Í¡£ +¤³¤Î¥µ¥¤¥º¤Ï "int" ¤È Ʊ¤¸¤Ç¤Ê¤­¤ã¡Ø¥À¥á¡Ù¤Ê¤ó¤À¡£ +BSD ¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ã¤Æ¤¤¤¦¤Î¤Ï¤½¤¦¤¤¤¦¤â¤Î¤Ê¤ó¤À¤«¤é¡£ +¤Þ¤¢¤È¤â¤«¤¯ POSIX ¤Î¿Í¤¿¤Á¤â¡¢ +"socklen_t" ¤òºî¤ë¤È¤¤¤¦²ò·èºö¤ò¤Ê¤ó¤È¤«¤Ò¤Í¤ê½Ð¤·¤¿¡£ +¤½¤â¤½¤âºÇ½é¤«¤éÊü¤Ã¤Æ¤ª¤±¤ÐÎɤ«¤Ã¤¿¤ó¤À¤¬¡¢ +¤¤¤¸¤Ã¤Á¤ã¤Ã¤¿°Ê¾å¡¢ +̾Á°ÉÕ¤­¤Î·¿¤ò»ý¤¿¤»¤Ê¤­¤ã¤Ê¤é¤Ê¤¤¡¢¤È»×¤Ã¤¿¤ß¤¿¤¤¤À¤Í¡£ +¤Ê¤ó¤Ç¤«¤Ï¤ï¤«¤ó¤Ê¤¤¤±¤É +(¤­¤Ã¤ÈºÇ½é¤Ë¤ä¤Ã¤Á¤Þ¤Ã¤¿Çϼ¯¤Ê´Ö°ã¤¤¤Ç´é¤ò¤Ä¤Ö¤·¤¿¤¯¤Ê¤«¤Ã¤¿¤«¤é¡¢ +¤³¤Ã¤½¤ê̾Á°¤òÉÕ¤±Âؤ¨¤Æ¼«Ê¬¤¿¤Á¤ÎÂ缺ÇÔ¤ò¤´¤Þ¤«¤½¤¦¤È¤·¤¿¤ó¤À¤í¤¦)¡£¡× +.SH Îã +.BR bind (2) +»²¾È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR bind (2), +.BR connect (2), +.BR listen (2), +.BR select (2), +.BR socket (2), +.BR socket (7) diff --git a/release/man2/access.2 b/release/man2/access.2 new file mode 100644 index 00000000..59b80ac5 --- /dev/null +++ b/release/man2/access.2 @@ -0,0 +1,276 @@ +.\" 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" +.SH ̾Á° +access \- ¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¼Â¥æ¡¼¥¶¡¼¤Ç¤Î¥¢¥¯¥»¥¹¸¢¤ò¥Á¥§¥Ã¥¯¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int access(const char *" pathname ", int " mode ); +.fi +.SH ÀâÌÀ +.BR access () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¥Õ¥¡¥¤¥ë +.I pathname +¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +.I pathname +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î¾ì¹ç¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ÏŸ³«¤µ¤ì¤ë¡£ + +.\" F_OK is defined as 0 on every system that I know of. +.I mode +¤Ï¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¥¢¥¯¥»¥¹¸¢¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¡¢¤½¤ÎÃÍ¤Ï +.BR F_OK ¡¢ +.\" »ä¤¬ÃΤäƤ¤¤ë¤¹¤Ù¤Æ¤Î¥·¥¹¥Æ¥à¤Ç F_OK ¤Ï 0 ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤â¤·¤¯¤Ï +.BR R_OK ", " W_OK ", " X_OK +¤Î 1¸Ä°Ê¾å¤Î¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýϤ«¤é¹½À®¤µ¤ì¤ë¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +.B F_OK +¤Ï¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¤«¤É¤¦¤«¤Î¤ß¤ò¸¡ºº¤¹¤ë¡£ +.BR R_OK ", " W_OK ", " X_OK +¤Ï¡¢¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¡¢¤½¤ì¤¾¤ìÆɤ߹þ¤ß¡¢½ñ¤­¹þ¤ß¡¢¼Â¹Ô¤Îµö²Ä¤¬¤¢¤ë¤« +¤ò¸¡ºº¤¹¤ë¡£ + +¥Á¥§¥Ã¥¯¤Ï¡¢¼ÂºÝ¤ËÁàºî¤¬¹Ô¤ï¤ì¤ëºÝ¤Ë»ÈÍѤµ¤ì¤ë¼Â¸ú (effective) ID ¤Ç¤Ê¤¯¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +.I "¼Â (real)" +UID ¤È +.I "¼Â (real)" +GID ¤ò»È¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢set-user-ID ¥×¥í¥°¥é¥à¤Ç¡¢¥×¥í¥°¥é¥à¤òµ¯Æ°¤¹¤ë¥æ¡¼¥¶¤Î¸¢¸Â¤ò +´Êñ¤Ë·èÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬Æø¢¥×¥í¥»¥¹ (¤Ä¤Þ¤ê¡¢¥×¥í¥»¥¹¤Î¼Â UID ¤¬ 0) ¤Î¾ì¹ç¡¢ +Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë +.B X_OK +¤Î¥Á¥§¥Ã¥¯¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¡¢¥°¥ë¡¼¥×¡¢Â¾¿Í¤Î¤¤¤º¤ì¤«¤Î +¼Â¹Ôµö²Ä¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ì¤ÐÀ®¸ù¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç(Á´¤Æ¤ÎÍ׵ᤵ¤ì¤¿µö²Ä¤¬ÆÀ¤é¤ì¤¿¤é)¡¢¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç (¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î +.I mode +¤ÇÍ׵ᤵ¤ì¤¿µö²Ä¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¤ä¡¢Â¾¤Î¥¨¥é¡¼¤¬µ¯¤­¤¿¾ì¹ç)¡¢ +\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR access () +¤Ï°Ê²¼¤Î¾ì¹ç¤Ë¼ºÇÔ¤¹¤ë¡£ +.TP +.B EACCES +Í׵ᤵ¤ì¤¿¥¢¥¯¥»¥¹¤Ï +¤½¤Î¥Õ¥¡¥¤¥ë¼«¿È¤ËµñÈݤµ¤ì¤¿¤« +.I pathname +¤Ø»ê¤ë¤Þ¤Ç¥Ç¥£¥ì¥¯¥È¥ê¤Î¤¤¤º¤ì¤«¤ËÂФ¹¤ë¸¡º÷µö²Ä +(search permission) ¤¬ÆÀ¤é¤ì¤Ê¤«¤Ã¤¿¡£ +.RB ( path_resolution (7) +¤â»²¾È¤Î¤³¤È) +.TP +.B ELOOP +.I pathname +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.I pathname +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +.I pathname +¤ò¹½À®¤¹¤ë¥Ñ¥¹¤Î¤¤¤º¤ì¤«¤¬¡¢Â¸ºß¤·¤Ê¤¤¤«¡¢ +»²¾ÈÀè¤Î¤Ê¤¤ (dangling) ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.TP +.B ENOTDIR +.I pathname +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EROFS +Æɤ߹þ¤ßÀìÍÑ (read-only) ¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ËÂФ·¤Æ½ñ¤­¹þ¤ßµö²Ä¤ò +Í׵ᤷ¤¿¡£ +.PP +.BR access () +¤Ï°Ê²¼¤ÎÍýͳ¤Ë¤è¤ê¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +.B EFAULT +.I pathname +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I mode +¤ËÉÔÀµ¤ÊÃͤ¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B EIO +I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ETXTBSY +¼Â¹ÔÃæ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ½ñ¤­¹þ¤ß¤òÍ׵ᤷ¤¿¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +.PP +.BR ·Ù¹ð : +¤¢¤ë¥æ¡¼¥¶¤¬¡¢Î㤨¤Ð +.BR open (2) +¤Ë¤è¤ë¥¢¥¯¥»¥¹¤¬²Äǽ¤«¤É¤¦¤«¤ò¡¢(¼ÂºÝ¤Ë¹Ô¤¦Á°¤Ë) +.BR access () +¤ò»È¤Ã¤Æ¥Á¥§¥Ã¥¯¤¹¤ë¤Î¤Ï¡¢¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤Î¸¶°ø¤Ë¤Ê¤ë¡£ +¤Ê¤¼¤Ê¤é¥Á¥§¥Ã¥¯¤ò¤·¤Æ¤«¤é +¼ÂºÝ¤Ë¥Õ¥¡¥¤¥ë¤Î¥ª¡¼¥×¥óÁàºî¤ò¤¹¤ë´Ö¤Îû¤¤´Ö³Ö¤ò°­ÍѤǤ­¤ë¤«¤é¤Ç¤¢¤ë¡£ +.BR ¤³¤ÎÍýͳ¤¬¤¢¤ë¤Î¤Ç¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Î¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.I mode +¤Ç»ØÄꤵ¤ì¤¿¥¢¥¯¥»¥¹¼ïÊ̤Τ¤¤º¤ì¤«°ì¤Ä¤Ç¤âµñÈݤµ¤ì¤ë¤È¡¢ +¤¿¤È¤¨ +.I mode +¤Ç»ØÄꤵ¤ì¤¿Â¾¤Î¥¢¥¯¥»¥¹¼ïÊ̤¬µö²Ä¤µ¤ì¤¿¤È¤·¤Æ¤â¡¢ +.BR access () +¤Ï¥¨¥é¡¼¤òÊÖ¤¹¡£ +.PP +POSIX.1-2001 ¤Ç¤Ï¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬Å¬ÀÚ¤ÊÆø¢¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç +(¤Ä¤Þ¤ê¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Î¾ì¹ç)¡¢ +¤¿¤È¤¨¥Õ¥¡¥¤¥ë¤Î¼Â¹Ôµö²Ä¥Ó¥Ã¥È¤¬Á´¤¯¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤â +.B X_OK +¤Î¥Á¥§¥Ã¥¯¤È¤·¤ÆÀ®¸ù¤òÊÖ¤¹¼ÂÁõ¤¬Ç§¤á¤é¤ì¤Æ¤¤¤ë¡£ +.\" HPU-UX 11 ¤È Tru64 5.1 ¤Ï¤³¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +Linux ¤Ï¤³¤Î¤è¤¦¤Ë¤Ï¤Ê¤Ã¤Æ¤¤¤Ê¤¤¡£ +.PP +.I pathname +¤Î¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤ò¹½À®¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÎÁ´¤Æ¤ËÂФ·¤Æ +¸¡º÷¥¢¥¯¥»¥¹ (¤¹¤Ê¤ï¤Á¡¢¼Â¹Ô¥¢¥¯¥»¥¹) ¤¬µö²Ä¤µ¤ì¤¿¾ì¹ç¤Ë¤Î¤ß¡¢ +¥Õ¥¡¥¤¥ë¤Ï¥¢¥¯¥»¥¹²Äǽ¤È¤Ê¤ë¡£ +¤¤¤º¤ì¤«¤Î¥Ç¥£¥ì¥¯¥È¥ê¤¬¥¢¥¯¥»¥¹ÉԲĤξì¹ç¡¢ +¥Õ¥¡¥¤¥ë¼«¿È¤Î¥¢¥¯¥»¥¹µö²Ä¤Ë´Ø¤ï¤é¤º¡¢ +.BR access () +¤Ï¼ºÇÔ¤¹¤ë¡£ +.PP +¥¢¥¯¥»¥¹¡¦¥Ó¥Ã¥È¤Î¤ß¤¬¥Á¥§¥Ã¥¯¤µ¤ì¡¢¥Õ¥¡¥¤¥ë¤Î¼ïÎà¤äÆâÍƤϥÁ¥§¥Ã¥¯¤µ¤ì¤Ê¤¤¡£ +½¾¤Ã¤Æ¡¢¥Ç¥£¥ì¥¯¥È¥ê¤¬½ñ¤­¹þ¤ß²Äǽ¤È¤Ê¤Ã¤¿¾ì¹ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ë +¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¤³¤È¤¬²Äǽ¤Ê¤³¤È¤ò°ÕÌ£¤¹¤ë¤Î¤Ç¤¢¤ê¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ë +¥Õ¥¡¥¤¥ë¤È¤·¤Æ½ñ¤­¹þ¤à¤³¤È¤¬¤Ç¤­¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +ƱÍÍ¤Ë DOS ¤Î¥Õ¥¡¥¤¥ë¤Ï¡Ö¼Â¹Ô²Äǽ¡×¤ÈȽÃǤµ¤ì¤ë¤¬¡¢ +.BR execve (2) +¥³¡¼¥ë¤Ï¼ºÇÔ¤¹¤ë¤À¤í¤¦¡£ +.PP +.BR access () +¤Ï¡¢ UID ¥Þ¥Ã¥Ô¥ó¥°¤ò»ÈÍѤ·¤¿ NFS ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤ÏÀµ¾ï¤Ë +µ¡Ç½¤·¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¤Ð UID ¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ï¥µ¡¼¥Ð¡¼¤Ç +¹Ô¤Ê¤ï¤ì¡¢¸¢Íø¤Î¥Á¥§¥Ã¥¯¤ò¤¹¤ë¥¯¥é¥¤¥¢¥ó¥È¤Ë¤Ï¸«¤¨¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +¥Ð¡¼¥¸¥ç¥ó 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 ·Ï¤Î¥«¡¼¥Í¥ë¤ÈƱÍͤÎÆ°ºî¤ò¤¹¤ë¡£ + +2.6.20 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +.BR mount (2) +¤¹¤ëºÝ¤Ë»ØÄꤵ¤ì¤¿ +.B MS_NOEXEC +¥Õ¥é¥°¤Î¸ú²Ì¤ò¡¢ +.BR access () +¤Ï̵»ë¤·¤Æ¤¤¤¿¡£ +¥«¡¼¥Í¥ë 2.6.20 °Ê¹ß¤Ç¤Ï¡¢ +.BR access () +¤Ï¤³¤Î¥Õ¥é¥°¤ò¹Íθ¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.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/release/man2/acct.2 b/release/man2/acct.2 new file mode 100644 index 00000000..41c1f8e0 --- /dev/null +++ b/release/man2/acct.2 @@ -0,0 +1,160 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 1993-07-22 by Rik Faith +.\" Modified 1993-08-10 by Alan Cox +.\" Modified 1998-11-04 by Tigran Aivazian +.\" Modified 2004-05-27, 2004-06-17, 2004-06-23 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-22, HANATAKA Shinya +.\" Modified 1998-11-30, HANATAKA Shinya +.\" Updated and Modified 2001-06-02, Yuichi SATO +.\" Updated and Modified 2001-10-15, Yuichi SATO +.\" Updated and Modified 2004-12-28, Yuichi SATO +.\" Updated 2008-08-04, Akihiro MOTOKI +.\" +.\"WORD: account ¥¢¥«¥¦¥ó¥È +.\"WORD: process ¥×¥í¥»¥¹ +.\" +.TH ACCT 2 2008-06-16 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +acct \- ¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥È¤Î¥ª¥ó¤È¥ª¥Õ¤òÀڤ괹¤¨¤ë +.SH ½ñ¼° +.ad l +.nf +.B #include +.sp +.BI "int acct(const char *" filename ); +.fi +.ad b +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR acct (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.SH ÀâÌÀ +.BR acct () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥È¤ÎÍ­¸ú¡¦Ìµ¸ú¤òÀÚ¤êÂؤ¨¤ë¡£ +´û¸¤Î¥Õ¥¡¥¤¥ë¤Î̾Á°¤ò°ú¤­¿ô¤Ë»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¤é¡¢ +¥¢¥«¥¦¥ó¥È (account) ¤¬Í­¸ú¤Ë¤Ê¤ê¡¢ +½ªÎ»¤·¤¿¥×¥í¥»¥¹¤Îµ­Ï¿¤¬ \fIfilename\fP ¤ËÄɵ­¤µ¤ì¤ë¡£ +NULL ¤ò°ú¤­¿ô¤È¤·¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¤é¥¢¥«¥¦¥ó¥È¤ò¥ª¥Õ¤Ë¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤¯¡¢½ñ¤­¹þ¤ß¤¬µñÈݤµ¤ì¤¿¡£ +.TP +.B EACCES +»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤¯¡¢½ñ¤­¹þ¤ß¤¬µñÈݤµ¤ì¤¿¡£ +¤Þ¤¿¤Ï +.I filename +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Î²¿¤ì¤«¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸¡º÷µö²Ä¤¬¤Ê¤¯µñÈݤµ¤ì¤¿ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +¤Þ¤¿¤Ï +.I filename +¤¬Ä̾ï (regular) ¤Î¥Õ¥¡¥¤¥ë¤Ç¤Ê¤¤¡£ +.TP +.B EFAULT +¥¢¥¯¥»¥¹¤Ç¤­¤ë¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò +.I filename +¤¬»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EIO +.I filename +¤Ø¤Î½ñ¤­¹þ¤ß¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EISDIR +.I filename +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¡£ +.TP +.B ELOOP +.I filename +¤Î¼ÂÂΤˤ¿¤É¤êÃ夯¤Þ¤Ç¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¿ô¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.I filename +¤¬Ä¹¤¹¤®¤ë¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥àÀ©¸Â¤Ë㤷¤¿¡£ +.TP +.B ENOENT +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B ENOSYS +¥«¡¼¥Í¥ë¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤¿»þ¤Ë BSD ¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥È¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¡£ +¤³¤Îµ¡Ç½¤Ï¥«¡¼¥Í¥ë¤Î¥³¥ó¥Õ¥£¥°¤Î +.B CONFIG_BSD_PROCESS_ACCT +¥Ñ¥é¥á¡¼¥¿¤Ë¤è¤Ã¤ÆÀ©¸æ¤µ¤ì¤ë¡£ +.TP +.B ENOTDIR +.I filename +¤ÎÃæ¤Ç¥Ç¥£¥ì¥¯¥È¥ê¤·¤Æ°·¤ï¤ì¤Æ¤¤¤ëÍ×ÁǤ¬¡¢ +¼ÂºÝ¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ë¤Ï¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥È¤òÍ­¸ú¤Ë¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÆø¢¤¬¤Ê¤¤¡£ +Linux ¤Ç¤Ï +.B CAP_SYS_PACCT +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬É¬ÍפǤ¢¤ë¡£ +.TP +.B EROFS +Æɤ߹þ¤ß¤À¤±¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤ò +.I filename +¤¬»²¾È¤·¤Æ¤¤¤ë¡£ +.TP +.B EUSERS +»ÈÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¹½Â¤ÂΤ¬¤Ê¤¤¤«¡¢¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.SH ½àµò +SVr4, 4.3BSD (POSIX ¤Ç¤Ï¤Ê¤¤)¡£ +.\" SVr4 ¤Ë¤Ï EBUSY ¥¨¥é¡¼¤¬µ­½Ò¤µ¤ì¤Æ¤¤¤ë¤¬¡¢EISDIR, ENOSYS ¤Ï¤Ê¤¤¡£ +.\" AIX ¤È HPUX ¤Ë¤Ï¡¢EBUSY ¤Ë¤Ä¤¤¤Æ¡Ö¤¹¤Ç¤Ë¥¢¥«¥¦¥ó¥È¤¬Í­¸ú¤Ë¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +.\" ¤µ¤é¤ËÍ­¸ú¤Ë¤·¤è¤¦¤È¤·¤¿¡×¤È¤¤¤¦µ­½Ò¤¬¤¢¤ë¡£ +.\" ¤³¤ì¤Ï Solaris ¤Ë¤ª¤±¤ë¡Ö¸½ºß¡¢¥¢¥«¥¦¥ó¥È¤Ë»È¤ï¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤È +.\" Ʊ¤¸¥Õ¥¡¥¤¥ë¤Ç¥¢¥«¥¦¥ó¥È¤òÍ­¸ú¤Ë¤·¤è¤¦¤È¤·¤¿¡×¤È¤¤¤¦µ­½Ò¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¥·¥¹¥Æ¥à¤¬¥¯¥é¥Ã¥·¥å¤·¤¿»þ¤Ë¼Â¹ÔÃæ¤À¤Ã¤¿¥×¥í¥°¥é¥à¤Î¥¢¥«¥¦¥ó¥È¤ÏÀ¸À®¤µ¤ì¤Ê¤¤¡£ +Æäˡ¢½ªÎ»¤·¤Ê¤¤¥×¥í¥°¥é¥à¤¬¥¢¥«¥¦¥ó¥È¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ + +¥¢¥«¥¦¥ó¥ÈÍÑ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¥ì¥³¡¼¥É¤Î¹½Â¤ÂΤˤĤ¤¤Æ¤Ï +.BR acct (5) +¤ËÀâÌÀ¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR acct (5) diff --git a/release/man2/adjtimex.2 b/release/man2/adjtimex.2 new file mode 100644 index 00000000..794b1923 --- /dev/null +++ b/release/man2/adjtimex.2 @@ -0,0 +1,170 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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 1997-01-31 by Eric S. Raymond +.\" 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 ¥á¥â¥ê +.\" +.TH ADJTIMEX 2 2004-05-27 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +adjtimex \- ¥«¡¼¥Í¥ë¤Î»þ·×¤òÄ´À°¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int adjtimex(struct timex *" "buf" ); +.SH ÀâÌÀ +Linux ¤Ï David L. Mill ¤Î»þ·×Ä´Àᥢ¥ë¥´¥ê¥º¥à¤ò»ÈÍѤ·¤Æ¤¤¤ë +(RFC\ 1305 ¤ò»²¾È)¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR adjtimex () +¤Ï¤³¤Î¥¢¥ë¥´¥ê¥º¥à¤ÎÄ´Àá¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤òÆɤ߼è¤Ã¤¿¤ê¡¢ÀßÄꤷ¤¿¤ê¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï +.I timex +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡¼¤ò¼õ¤±¼è¤ê¡¢¤½¤ÎÃͤǥ«¡¼¥Í¥ë¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ò¹¹¿·¤·¤Æ¡¢ +Ʊ¤¸¹½Â¤ÂΤ˸½ºß¤Î¥«¡¼¥Í¥ë¤ÎÃͤòÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤ë: +.PP +.in +4n +.nf +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 tolerance; /* clock frequency tolerance (ppm) + (read-only) */ + struct timeval time; /* current time (read-only) */ + long tick; /* usecs between clock ticks */ +}; +.fi +.in +.PP +.I modes +¥Õ¥£¡¼¥ë¥É¤Ï (ɬÍפ˱þ¤¸¤Æ) ¤É¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤òÀßÄꤹ¤ë¤«·èÄꤹ¤ë¡£ +¤½¤ì¤Ï°Ê²¼¤Î¥Ó¥Ã¥ÈÃͤΠ0 ¸Ä°Ê¾å¤Î +.RI "¥Ó¥Ã¥È " OR +¤«¤é¤Ê¤ë: +.PP +.in +4n +.nf +#define ADJ_OFFSET 0x0001 /* time offset */ +#define ADJ_FREQUENCY 0x0002 /* frequency offset */ +#define ADJ_MAXERROR 0x0004 /* maximum time error */ +#define ADJ_ESTERROR 0x0008 /* estimated time error */ +#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() */ +.fi +.in +.PP +Ä̾ï¤Î¥æ¡¼¥¶¡¼¤Ï +.I mode +¤ÎÃÍ¤Ï 0 ¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Î¤ß¤¬Á´¤Æ¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤òÀßÄê¤Ç¤­¤ë¡£ +.br +.ne 12v +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR adjtimex () +¤Ï +¥¯¥í¥Ã¥¯¤Î¾õÂÖ¤òÊÖ¤¹: +.PP +.in +4n +.nf +#define TIME_OK 0 /* clock synchronized */ +#define TIME_INS 1 /* insert leap second */ +#define TIME_DEL 2 /* delete leap second */ +#define TIME_OOP 3 /* leap second in progress */ +#define TIME_BAD 4 /* clock not synchronized */ +.fi +.in +.PP +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï +.BR adjtimex () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I buf +¤¬½ñ¤­¹þ¤ß²Äǽ¤Ê¥á¥â¥ê¤ò»Ø¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EINVAL +.I buf.offset +¤Ø \-131071 ¡Á +131071 ¤ÎÈϰϰʳ°¤ÎÃͤòÀßÄꤷ¤è¤¦¤È¤·¤¿¤«¡¢ +.I buf.status +¤Ë¾åµ­°Ê³°¤ÎÃͤòÀßÄꤷ¤è¤¦¤È¤·¤¿¤«¡¢ +.I buf.tick +¤Ë +.RB 900000/ HZ +¡Á +.RB 1100000/ HZ +¤ÎÈϰϰʳ°¤ÎÃͤòÀßÄꤷ¤è¤¦¤È¤·¤¿¡£ +¤³¤³¤Ç +.B HZ +¤Ï¥·¥¹¥Æ¥à¤Î¥¿¥¤¥Þ¡¼³ä¤ê¹þ¤ß¤Î¼þ´ü¤Ç¤¢¤ë¡£ +.TP +.B EPERM +.I buf.mode +¤¬ 0 ¤Ç¤Ê¤¯¡¢¤«¤Ä¸Æ¤Ó½Ð¤·¸µ¤¬½½Ê¬¤ÊÆø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +Linux ¤Ç¤Ï +.B CAP_SYS_TIME +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.SH ½àµò +.BR adjtimex () +¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢ +°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤òÄ´À°¤¹¤ëÊýË¡¤Ç¡¢ +°Ü¿¢À­¤¬¤¢¤ë¤¬¼«Í³ÅÙ¤ÏÎô¤ëÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï +.BR adjtime (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR settimeofday (2), +.BR adjtime (3), +.BR capabilities (7), +.BR time (7) diff --git a/release/man2/alarm.2 b/release/man2/alarm.2 new file mode 100644 index 00000000..b254a500 --- /dev/null +++ b/release/man2/alarm.2 @@ -0,0 +1,99 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 Wed Jul 21 19:42:57 1993, Rik Faith +.\" Modified Sun Jul 21 21:25:26 1996, 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 ¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +.\" +.TH ALARM 2 2008-06-12 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +alarm \- ¥·¥°¥Ê¥ëÇÛÁ÷¤Î¤¿¤á¤Î¥¢¥é¡¼¥à¡¦¥¯¥í¥Ã¥¯¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "unsigned int alarm(unsigned int " seconds ); +.fi +.SH ÀâÌÀ +.BR alarm () +¤Ï +.B SIGALRM +¥·¥°¥Ê¥ë¤ò +.I seconds +Éøå¤Ë¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ËÇÛÁ÷¤¹¤ë¤è¤¦¤Ë¼êÇÛ¤¹¤ë¡£ + +.I seconds +¤¬¥¼¥í¤Ê¤é¤Ð¡¢¿·¤¿¤Ê +.BR alarm () +¤Ï¼êÇÛ¤µ¤ì¤Ê¤¤¡£ + +º£¤Þ¤Ç¤ËÀßÄꤵ¤ì¤Æ¤¤¤¿ +.BR alarm () +¤ÏÃæÃǤµ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR alarm () +¤Ï°ÊÁ°¤ËͽÄꤵ¤ì¤Æ¤¤¤¿¥¢¥é¡¼¥à¤ÎÇÛÁ÷¤Þ¤Ç¤Î»Ä¤ê»þ´Ö¤òÊÖ¤¹¡£°ÊÁ°¤Ë +¥¢¥é¡¼¥à¤¬Í½Äꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¥¼¥í¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD. +.SH Ãí°Õ +.BR alarm () +¤È +.BR setitimer (2) +¤ÏƱ¤¸¥¿¥¤¥Þ¡¼¤ò¶¦Í­¤·¤Æ¤¤¤ë; ÊÒÊý¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ï¤â¤¦°ìÊý¤Î +»ÈÍѤ˱ƶÁ¤òÍ¿¤¨¤ë¡£ +.PP +.BR sleep (3) +¤Ï +.B SIGALRM +¤òÍøÍѤ·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.BR alarm () +¤È +.BR sleep (3) +¤òº®¤¼¤Æ»ÈÍѤ·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°(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) diff --git a/release/man2/alloc_hugepages.2 b/release/man2/alloc_hugepages.2 new file mode 100644 index 00000000..110fb99b --- /dev/null +++ b/release/man2/alloc_hugepages.2 @@ -0,0 +1,164 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 2003 Andries E. 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. +.\" +.\" +.\" 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 +.\" +.\"WORD: huge page ¥Ò¥å¡¼¥¸¥Ú¡¼¥¸ +.\" +.TH ALLOC_HUGEPAGES 2 2007-05-31 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +alloc_hugepages, free_hugepages \- Â礭¤Ê¥µ¥¤¥º¤Î¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤È²òÊü¤ò¹Ô¤¦ +.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); +.sp +.BI "int free_hugepages(void *" addr ); +.\" asmlinkage int sys_free_hugepages(unsigned long addr); +.fi +.SH ÀâÌÀ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR alloc_hugepages () +¤È +.BR free_hugepages () +¤Ï Linux 2.5.36 ¤ÇƳÆþ¤µ¤ì¡¢2.5.54 ¤ÇºÆ¤Óºï½ü¤µ¤ì¤¿¡£ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï i386 ¤È ia64 ¤Î¤ß¤Ç +(¤«¤Ä +.B CONFIG_HUGETLB_PAGE +¤ò»ØÄꤷ¤Æ¥Ó¥ë¥É¤µ¤ì¤¿¾ì¹ç¤Ë) ¸ºß¤¹¤ë¡£ +Linux 2.4.20 ¤Ç¤Ï syscall Èֹ椬¸ºß¤¹¤ë¤¬¡¢ +¸Æ¤Ó½Ð¤¹¤È¥¨¥é¡¼ +.B ENOSYS +¤Ç¼ºÇÔ¤¹¤ë¡£ +.LP +i386 ¤Ç¤Ï¡¢¥á¥â¥ê´ÉÍý¥Ï¡¼¥É¥¦¥§¥¢¤ÏÄ̾ï¤Î¥Ú¡¼¥¸ (4 KiB) ¤È +Â礭¤Ê¥µ¥¤¥º¤Î¥Ú¡¼¥¸ (°Ê²¼¡¢¥Ò¥å¡¼¥¸¥Ú¡¼¥¸; 2MiB ¤Þ¤¿¤Ï 4 MiB) ¤ò +°·¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +ƱÍͤˡ¢ia64 ¤â¤¤¤¯¤Ä¤«¤Î¥µ¥¤¥º¤Î¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¤ò¥×¥í¥»¥¹¤Î¥á¥â¥ê¤Ë¥Þ¥Ã¥×¤·¤¿¤ê¡¢ +ºÆ¤Ó²òÊü¤·¤¿¤ê¤¹¤ë¡£ +¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¤Ï¥á¥â¥êÆâ¤Ë¥í¥Ã¥¯¤µ¤ì¡¢¥¹¥ï¥Ã¥×¤µ¤ì¤Ê¤¤¡£ +.LP +.I key +°ú¤­¿ô¤Ï¼±Ê̻ҤǤ¢¤ë¡£ +0 ¤Î¾ì¹ç¡¢¥Ú¡¼¥¸¤ÏÈó¸ø³«¤Ë¤Ê¤ê¡¢»Ò¥×¥í¥»¥¹¤Ë·Ñ¾µ¤µ¤ì¤Ê¤¤¡£ +Àµ¤Î¾ì¹ç¡¢¥Ú¡¼¥¸¤ÏƱ¤¸ +.I key +¤ò»È¤¦Â¾¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È¶¦Í­¤µ¤ì¡¢»Ò¥×¥í¥»¥¹¤Ë·Ñ¾µ¤µ¤ì¤ë¡£ +.LP +.BR free_hugepages () +¤Î +.I addr +°ú¤­¿ô¤Ï¡¢¤É¤Î¥Ú¡¼¥¸¤ò²òÊü¤¹¤ë¤«¤ò»ØÄꤹ¤ë: +.I addr +¤Ï +.BR alloc_hugepages () +¤Î¸Æ¤Ó½Ð¤·¤ÎÊÖ¤êÃͤǤ¢¤ë +(Á´¤Æ¤Î¥æ¡¼¥¶¤¬¥á¥â¥ê¤ò²òÊü¤·¤¿¤È¤­¤Ë¡¢ +¤½¤Î¥á¥â¥ê¤Ï½é¤á¤Æ¼ÂºÝ¤Ë²òÊü¤µ¤ì¤ë)¡£ +.BR alloc_hugepages () +¤Î +.I addr +°ú¤­¿ô¤Ï¥Ò¥ó¥È¤Ç¤¢¤ê¡¢¥«¡¼¥Í¥ë¤Ï¤½¤ì¤Ë½¾¤¦¤«¤â¤·¤ì¤Ê¤¤¤·¡¢ +½¾¤ï¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +¥¢¥É¥ì¥¹¤ÏÀµ¤·¤¯ÇÛÃÖ¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.LP +.I len +°ú¤­¿ô¤ÏÍ׵ᤵ¤ì¤¿¥»¥°¥á¥ó¥È¤ÎŤµ¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¤Î¥µ¥¤¥º¤ÎÇÜ¿ô¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.LP +.I prot +°ú¤­¿ô¤Ï¥»¥°¥á¥ó¥È¤Î¥á¥â¥êÊݸî¤ò»ØÄꤹ¤ë¡£ +¤³¤ì¤Ï +.BR PROT_READ , +.BR PROT_WRITE , +.B PROT_EXEC +¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ +.LP +.I key +¤¬Àµ¤Ç¤Ê¤¤¸Â¤ê¡¢ +.I flag +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.I key +¤¬Àµ¤Ç¡¢¤«¤Ä +.I flag +¤¬ +.B IPC_CREAT +¤Ç¤¢¤ê¡¢¤«¤Ä»ØÄꤵ¤ì¤¿ +.I key +¤Ç (¥»¥°¥á¥ó¥È¤¬) ²¿¤â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +¿·¤·¤¤¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¥»¥°¥á¥ó¥È¤¬ºîÀ®¤µ¤ì¤ë¡£ +.I flag +¤¬ÀßÄꤵ¤ì¤Æ¤ª¤é¤º¡¢¤«¤Ä»ØÄꤵ¤ì¤¿ +.I key +¤Î¥»¥°¥á¥ó¥È¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +.B ENOENT +¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR alloc_hugepages () +¤Ï³ä¤êÅö¤Æ¤é¤ì¤¿²¾ÁÛ¥¢¥É¥ì¥¹¤òÊÖ¤·¡¢ +.BR free_hugepages () +¤Ï 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOSYS +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /proc/sys/vm/nr_hugepages +ÀßÄꤵ¤ì¤¿ hugetlb ¥Ú¡¼¥¸¤Î¿ô¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÆɤ߽ñ¤­¤Ç¤­¤ë¡£ +.TP +.I /proc/meminfo +ÀßÄꤵ¤ì¤¿ hugetlb ¥Ú¡¼¥¸¤Î¿ô¤È¡¢ +3 ¤Ä¤ÎÊÑ¿ô HugePages_Total, HugePages_Free, Hugepagesize ¤Î +¥µ¥¤¥º¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÄ󶡤¹¤ë¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Intel ¥×¥í¥»¥Ã¥µ¾å¤Î Linux ¤Ë¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢ +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç»È¤¦¤Ù¤­¤Ç¤Ê¤¤¡£ +.SH Ãí°Õ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£ +¤³¤ì¤é¤Ï Linux 2.5.36 ¤«¤é 2.5.54 ¤Ë¤Î¤ß¸ºß¤¹¤ë¡£ +Âå¤ï¤ê¤Ëº£¤Ï hugetlbfs ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +(CPU ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç) ¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¤ò»ý¤Ä¥á¥â¥ê¤Ï¡¢ +.BR mmap (2) +¤ò»È¤Ã¤Æ¤³¤Î²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥Õ¥¡¥¤¥ë¤ò¥Þ¥Ã¥×¤¹¤ë¤³¤È¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +.LP +¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¤ÎºÇÂç¿ô¤Ï¡¢ +.B hugepages= +µ¯Æ°¥Ñ¥é¥á¡¼¥¿¤ò»È¤Ã¤Æ»ØÄê¤Ç¤­¤ë¡£ +.\" ("Processor type and features" °Ê²¼¤Î) CONFIG_HUGETLB_PAGE +.\" ("Filesystems" °Ê²¼¤Î).CONFIG_HUGETLBFS ¤¬É¬ÍפǤ¢¤ë¡£ +.\" mount -t hugetlbfs hugetlbfs /huge +.\" SHM_HUGETLB diff --git a/release/man2/arch_prctl.2 b/release/man2/arch_prctl.2 new file mode 100644 index 00000000..981d35fd --- /dev/null +++ b/release/man2/arch_prctl.2 @@ -0,0 +1,152 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2003 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. +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated 2004-06-08, Yuichi SATO +.\" Updated 2005-11-19, Akihiro MOTOKI +.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 +.\" +.TH ARCH_PRCTL 2 2007-12-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +arch_prctl \- ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¸ÇÍ­¤Î¥¹¥ì¥Ã¥É¾õÂÖ¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "int arch_prctl(int " code ", unsigned long *" addr ); +.fi +.SH ÀâÌÀ +.BR arch_prctl () +´Ø¿ô¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã¸ÇÍ­¤Î¥×¥í¥»¥¹¾õÂÖ¤Þ¤¿¤Ï¥¹¥ì¥Ã¥É¾õÂÖ¤òÀßÄꤹ¤ë¡£ +.I code +¤ÏÉûµ¡Ç½¤òÁªÂò¤·¡¢°ú¤­¿ô +.I addr +¤òÉûµ¡Ç½¤ËÅϤ¹¡£ +.I addr +¤Ï¡¢"set" Áàºî¤Ç¤Ï +.I "unsigned long" +¤È¤·¤Æ¡¢"get" Áàºî¤Ç¤Ï +.I "unsigned long *" +¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +.LP +x86-64 ¤ÎÉûµ¡Ç½¤Ï°Ê²¼¤ÎÄ̤ê: +.TP +.B ARCH_SET_FS +.I FS +¥ì¥¸¥¹¥¿¤Î 64 ¥Ó¥Ã¥È¥Ù¡¼¥¹¤ò +.I addr +¤ËÀßÄꤹ¤ë¡£ +.TP +.B ARCH_GET_FS +¸½ºß¤Î¥¹¥ì¥Ã¥É¤Î +.I FS +¥ì¥¸¥¹¥¿¤Î 64 ¥Ó¥Ã¥È¥Ù¡¼¥¹Ãͤò¡¢ +.I addr +¤¬»Ø¤¹ +.I unsigned long +¤ÎÎΰè¤Ë³ÊǼ¤¹¤ë¡£ +.TP +.B ARCH_SET_GS +.I GS +¥ì¥¸¥¹¥¿¤Î 64 ¥Ó¥Ã¥È¥Ù¡¼¥¹¤ò +.I addr +¤ËÀßÄꤹ¤ë¡£ +.TP +.B ARCH_GET_GS +¸½ºß¤Î¥¹¥ì¥Ã¥É¤Î +.I GS +¥ì¥¸¥¹¥¿¤Î 64 ¥Ó¥Ã¥È¥Ù¡¼¥¹Ãͤò¡¢ +.I addr +¤¬»Ø¤¹ +.I unsigned long +¤ÎÎΰè¤Ë³ÊǼ¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR arch_prctl () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I addr +¤¬¥¢¥ó¥Þ¥Ã¥×¤µ¤ì¤¿¥¢¥É¥ì¥¹¤ò»Ø¤·¤Æ¤¤¤ë¤«¡¢¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Ë¤¢¤ë¡£ +.TP +.B EINVAL +.I code +¤¬Í­¸ú¤Ê¥µ¥Ö¥³¥Þ¥ó¥É¤Ç¤Ê¤¤¡£ +.TP +.B EPERM +.I addr +¤¬¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Ë¤¢¤ë¡£ +.\" .SH Ãø¼Ô +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï Andi Kleen ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ +.SH ½àµò +.BR arch_prctl () +¤Ï Linux/x86-64 ³ÈÄ¥¤Ç¤¢¤ê¡¢°Ü¿¢À­¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»È¤¦¤Ù¤­¤Ç¤Ê¤¤¡£ +.SH Ãí°Õ +.BR arch_prctl () +¤Ï¸½ºß¤Î¤È¤³¤í Linux/x86-64 ¾å¤Î 64 ¥Ó¥Ã¥È¥×¥í¥°¥é¥à¤Ç¤Î¤ß¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ + +¿·¤·¤¤ 32 ¥Ó¥Ã¥È¥»¥°¥á¥ó¥È¥»¥ì¥¯¥¿¤¬¥í¡¼¥É¤µ¤ì¤¿¾ì¹ç¡¢ +64 ¥Ó¥Ã¥È¥Ù¡¼¥¹¤ÏÊѹ¹¤µ¤ì¤ë¡£ + +.B ARCH_SET_GS +¤¬Ìµ¸ú¤Ë¤µ¤ì¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤â¤¢¤ë¡£ + +64 ¥Ó¥Ã¥È¥»¥°¥á¥ó¥È¥Ù¡¼¥¹¤Î¥³¥ó¥Æ¥­¥¹¥È¥¹¥¤¥Ã¥Á¤Ï¡¢¤ä¤ä¹â²Á¤Ç¤¢¤ë¡£ +LDT ¤ò +.BR modify_ldt (2) +¤ÇÀßÄꤷ¤Æ¥»¥°¥á¥ó¥È¥»¥ì¥¯¥¿¤ò»È¤¦¤«¡¢ +(¥«¡¼¥Í¥ë 2.5 °Ê¹ß¤Î) +.BR set_thread_area (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤³¤È¤Ë¤è¤ê¡¢ +32 ¥Ó¥Ã¥È¥Ù¡¼¥¹¤òÀßÄꤹ¤ë¤È¤¤¤¦¹â®¤ÊÂåÂؼêÃʤ⤢¤ë¡£ +4GB ¤è¤êÂ礭¤Ê¥Ù¡¼¥¹¤òÀßÄꤷ¤¿¤¤¾ì¹ç¤Ë¤Î¤ß¡¢ +.BR arch_prctl () +¤¬É¬ÍפǤ¢¤ë¡£ +¥¢¥É¥ì¥¹¶õ´Ö¤ÎºÇ½é¤Î 2GB ¤Ë¤¢¤ë¥á¥â¥ê¤Ï¡¢ +.BR mmap (2) +¤Ë +.B MAP_32BIT +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¥Ð¡¼¥¸¥ç¥ó 2.7 »þÅÀ¤Ç¤Ï¡¢glibc ¤Ë¤Ï +.BR arch_prctl () +¤Î¥×¥í¥È¥¿¥¤¥×¤¬¤Ê¤¤¡£ +º£¤Î¤È¤³¤í¥æ¡¼¥¶¤Ï¼«Ê¬¼«¿È¤ÇÀë¸À¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤ì¤Ï¾­Íè¤Î glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç½¤Àµ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + +.I FS +¤Ï¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤Ç´û¤Ë»È¤ï¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mmap (2), +.BR modify_ldt (2), +.BR prctl (2), +.BR set_thread_area (2) +.sp +AMD X86-64 Programmer's manual diff --git a/release/man2/bdflush.2 b/release/man2/bdflush.2 new file mode 100644 index 00000000..58f29e05 --- /dev/null +++ b/release/man2/bdflush.2 @@ -0,0 +1,121 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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 1997-01-31 by Eric S. Raymond +.\" Modified 2004-06-17 by Michael Kerrisk +.\" +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Feb 22 20:03:58 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Thu Feb 3 03:15:15 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: buffer-dirty-flush ¥Ð¥Ã¥Õ¥¡¡¼¡¦¥À¡¼¥Æ¥£¡¼¡¦¥Õ¥é¥Ã¥·¥å +.\"WORD: daemon ¥Ç¡¼¥â¥ó +.\"WORD: flush ¥Õ¥é¥Ã¥·¥å +.\"WORD: tune Ä´À° +.\"WORD: long word ¥í¥ó¥°¡¦¥ï¡¼¥É +.\"WORD: parameter ¥Ñ¥é¥á¡¼¥¿¡¼ +.\"WORD: source file ¥½¡¼¥¹¡¦¥Õ¥¡¥¤¥ë +.\" +.TH BDFLUSH 2 2004-06-17 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +bdflush \- ¥Ð¥Ã¥Õ¥¡¡¼¡¦¥À¡¼¥Æ¥£¡¼¡¦¥Õ¥é¥Ã¥·¥å¡¦¥Ç¡¼¥â¥ó¤òµ¯Æ°¡¢¥Õ¥é¥Ã¥·¥å¡¢Ä´À°¤¹¤ë +.SH ½ñ¼° +.nf +.B #include + +.BI "int bdflush(int " func ", long *" address ); +.BI "int bdflush(int " func ", long " data ); +.fi +.SH ÀâÌÀ +.BR bdflush () +¤Ï¥Ð¥Ã¥Õ¥¡¡¼¡¦¥À¡¼¥Æ¥£¡¼¡¦¥Õ¥é¥Ã¥·¥å (buffer-dirty-flush)¡¦ +¥Ç¡¼¥â¥ó (daemon) ¤òµ¯Æ°¡¢¥Õ¥é¥Ã¥·¥å (flush)¡¢Ä´À° (tune) ¤¹¤ë¡£ +.RB ( CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ä) Æø¢¥×¥í¥»¥¹¤Î¤ß¤¬ +.BR bdflush () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.I func +¤¬É餫 0 ¤Ç¥Ç¡¼¥â¥ó¤¬µ¯Æ°¤µ¤ì¤Æ¤¤¤Ê¤ì¤Ð¡¢ +.BR bdflush () +¤Ï¥Ç¡¼¥â¥ó¤Î¥³¡¼¥É¤ØÆþ¤ê¡¢Ìá¤Ã¤Æ¤³¤Ê¤¤¡£ +.PP +.I func +¤¬ 1 ¤Ê¤é¤Ð¡¢ +±ø¤ì¤¿ (dirty) ¥Ð¥Ã¥Õ¥¡¡¼¤¬¥Ç¥£¥¹¥¯¤Ø¤È½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.PP +.I func +¤¬ 2 °Ê¾å¤Ç¶ö¿ô (ºÇ¾®¥Ó¥Ã¥È¤¬ 0) ¤Ê¤é¤Ð¡¢ +.I address +¤Ë¥í¥ó¥°¡¦¥ï¡¼¥É¤Ç¥¢¥É¥ì¥¹¤ò»ØÄꤷ¡¢¤½¤Î¥¢¥É¥ì¥¹¤Ë +.RI "(" "func" "\-2)/2" +¤Ç»ØÄꤵ¤ì¤¿Ä´Àá¥Ñ¥é¥á¡¼¥¿¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.I func +¤¬ 3 °Ê¾å¤Ç´ñ¿ô (ºÇ¾®¥Ó¥Ã¥È¤¬ 1) ¤Ê¤é¤Ð¡¢ +.I data +¤ò¥í¥ó¥°¡¦¥ï¡¼¥É¤Ç»ØÄꤷ¡¢¤½¤ÎÃͤò +.RI "(" "func" "\-3)/2" +¤Ç»ØÄꤵ¤ì¤¿Ä´Àá¥Ñ¥é¥á¡¼¥¿¡¼¤ËÀßÄꤹ¤ë¡£ +.PP +¥Ñ¥é¥á¡¼¥¿¡¼¤Î½¸¹ç¤ä¤½¤ÎÃÍ¡¢Í­¸ú¤ÊÈϰϤϥ«¡¼¥Í¥ë¤Î¥½¡¼¥¹¡¦¥Õ¥¡¥¤¥ë¤Î +.I fs/buffer.c +¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +.I func +¤¬É餫 0 ¤Ç¡¢¥Ç¥â¡¼¥ó¤Îµ¯Æ°¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ï +.BR bdflush () +¤ÏÊ֤äƤ³¤Ê¤¤¡£ +¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤Ë¤½¤Î¥¨¥é¡¼¤¬»Ø¼¨¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBUSY +¾¤Î¥×¥í¥»¥¹¤¬´û¤Ë¥Ç¡¼¥â¥ó¡¦¥³¡¼¥É¤ËÆþ¤Ã¤Æ¤¤¤ë¤Î¤Ë¡¢Æþ¤í¤¦¤È»î¤ß¤¿¡£ +.TP +.B EFAULT +.I address +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +ÉÔÀµ¤Ê¥Ñ¥é¥á¡¼¥¿¡¼¤ÎÆɤ߽ñ¤­¤ò»î¤ß¤¿¤«¡¢¥Ñ¥é¥á¡¼¥¿¡¼¤ØÉÔÀµ¤ÊÃͤò +½ñ¤­¹þ¤â¤¦¤È¤·¤¿¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤Ë +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¤¡£ +.SH ½àµò +.BR bdflush () +¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fsync (2), +.BR sync (2), +.BR sync (8), +.BR update (8) diff --git a/release/man2/bind.2 b/release/man2/bind.2 new file mode 100644 index 00000000..6419a105 --- /dev/null +++ b/release/man2/bind.2 @@ -0,0 +1,343 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from /usr/include/sys/socket.h, which does not have +.\" any authorship information in it. It is probably available under the GPL. +.\" +.\" 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. +.\" +.\" +.\" Other portions are from the 6.9 (Berkeley) 3/10/91 man page: +.\" +.\" Copyright (c) 1983 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. +.\" +.\" Modified Mon Oct 21 23:05:29 EDT 1996 by Eric S. Raymond +.\" Modified 1998 by Andi Kleen +.\" $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" +.SH ̾Á° +bind \- ¥½¥±¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë +.SH ½ñ¼° +.nf +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.B #include +.sp +.BI "int bind(int " sockfd ", const struct sockaddr *" addr , +.BI " socklen_t " addrlen ); +.fi +.SH ÀâÌÀ +.BR socket (2) +¤Ç¥½¥±¥Ã¥È¤¬ºîÀ®¤µ¤ì¤¿¤È¤­¡¢¤½¤Î¥½¥±¥Ã¥È¤Ï̾Á°¶õ´Ö (¥¢¥É¥ì¥¹¡¦¥Õ¥¡¥ß¥ê¡¼) ¤Ë +¸ºß¤¹¤ë¤¬¡¢¥¢¥É¥ì¥¹¤Ï³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +.BR bind () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I sockfd +¤Ç»²¾È¤µ¤ì¤ë¥½¥±¥Ã¥È¤Ë +.I addr +¤Ç»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤ò³ä¤êÅö¤Æ¤ë¡£ +.I addrlen +¤Ë¤Ï +.I addr +¤¬»Ø¤¹¥¢¥É¥ì¥¹¹½Â¤ÂΤΥµ¥¤¥º¤ò¥Ð¥¤¥Èñ°Ì¤Ç»ØÄꤹ¤ë¡£ +ÅÁÅýŪ¤Ë¤³¤ÎÁàºî¤Ï +¡Ö¥½¥±¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë¡× +¤È¸Æ¤Ð¤ì¤ë¡£ +.PP +.B SOCK_STREAM +¥½¥±¥Ã¥È¤¬Àܳ¤ò¼õ¤±ÉÕ¤±¤é¤ì¤ë¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï +.RB ( accept (2) +¤ò»²¾È)¡¢Ä̾綠¤ÎÁ°¤Ë +.BR bind () +¤ò»ÈÍѤ·¤Æ¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤ò³ä¤êÅö¤Æ¤ëɬÍפ¬¤¢¤ë¡£ + +̾Á°ÉÕ¤±¤Î¥ë¡¼¥ë¤Ï¥¢¥É¥ì¥¹¡¦¥Õ¥¡¥ß¥ê¡¼¤´¤È¤Ë°Û¤Ê¤Ã¤Æ¤¤¤ë¡£¾ÜºÙ¤Ê¾ðÊó¤Ï +Âè 7 ¾Ï¤Î³Æ¥Þ¥Ë¥å¥¢¥ë¤ò»²¾È¤¹¤ë¤³¤È¡£ +.B AF_INET +¤Ï +.BR ip (7) +¤ò¡¢ +.B AF_INET6 +¤Ï +.BR ipv6 (7) +¤ò¡¢ +.B AF_UNIX +¤Ï +.BR unix (7) +¤ò¡¢ +.B AF_APPLETALK +¤Ï +.BR ddp (7) +¤ò¡¢ +.B AF_PACKET +¤Ï +.BR packet (7) +¤ò¡¢ +.B AF_X25 +¤Ï +.BR x25 (7) +¤ò¡¢ +.B AF_NETLINK +¤Ï +.BR netlink (7) +¤ò»²¾È¡£ + +.I addr +°ú¤­¿ô¤Ë¼ÂºÝ¤Ë¤É¤Î¤è¤¦¤Ê¹½Â¤ÂΤ¬ÅϤµ¤ì¤ë¤«¤Ï¡¢ +¥¢¥É¥ì¥¹¡¦¥Õ¥¡¥ß¥ê¡¼¤Ë°Í¸¤¹¤ë¡£ +.I sockaddr +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤Ê´¶¤¸¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +struct sockaddr { + sa_family_t sa_family; + char sa_data[14]; +} + +.fi +.in +¤³¤Î¹½Â¤ÂΤϡ¢ +.I addr +¤ËÅϤµ¤ì¤ë¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò¥­¥ã¥¹¥È¤·¡¢ +¥³¥ó¥Ñ¥¤¥é¤Î·Ù¹ð¥á¥Ã¥»¡¼¥¸¤òÍÞ¤¨¤ë¤¿¤á¤À¤±¤Ë¸ºß¤¹¤ë¡£ +²¼µ­¤Î¡ÖÎã¡×¤ò»²¾È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.\" e.g., privileged port in AF_INET domain +¤½¤Î¥¢¥É¥ì¥¹¤ÏÊݸ¤ì¤Æ¤¤¤Æ¡¢¤«¤Ä¥æ¡¼¥¶¤¬¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EADDRINUSE +»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤¬´û¤Ë»ÈÍÑÃæ¤Ç¤¢¤ë¡£ +.TP +.B EBADF +.I sockfd +¤¬ÉÔÀµ¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +¥½¥±¥Ã¥È¤¬¤¹¤Ç¤Ë¥¢¥É¥ì¥¹¤Ë·ë¤Ó¤Ä¤± (bind) ¤é¤ì¤Æ¤¤¤ë¡£ +.\" ¤³¤ì¤Ï¾­ÍèÊѹ¹¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\" ¾Ü¤·¤¯¤Ï +.\" .I linux/unix/sock.c +.\" ¤ò»²¾È¤¹¤ë¤³¤È¡£ +.B ENOTSOCK +.I sockfd +¤¬¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¡¢¥½¥±¥Ã¥È¤ËÂФ¹¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤Ï Unix¥É¥á¥¤¥ó +.RB ( AF_UNIX ) +¤Î¥½¥±¥Ã¥ÈÆÃÍ­¤Ç¤¢¤ë: +.TP +.B EACCES +¥Ñ¥¹Ì¾¤Î¹½À®Í×ÁǤ˸¡º÷µö²Ä (search permission) ¤¬¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EADDRNOTAVAIL +¸ºß¤·¤Ê¤¤¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬Í׵ᤵ¤ì¤¿¤«¡¢Í׵ᤵ¤ì¤¿¥¢¥É¥ì¥¹¤¬ +¥í¡¼¥«¥ë¤Ç¤Ï¤Ê¤«¤Ã¤¿¡£ +.TP +.B EFAULT +.I addr +¤¬¥æ¡¼¥¶¤Î¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I addrlen +¤¬ÉÔÀµ¤Ç¤¢¤ë¤«¡¢¥½¥±¥Ã¥È¤¬ +.B AF_UNIX +¥Õ¥¡¥ß¥ê¡¼¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ELOOP +.I addr +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.I addr +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤Ë¡¢ÍøÍѲÄǽ¤Ê¥á¥â¥ê¡¼¤¬½½Ê¬¤Ë¤Ê¤¤¡£ +.TP +.B ENOTDIR +¥Ñ¥¹Ì¾¤Î¹½À®Í×ÁǤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EROFS +¥½¥±¥Ã¥È inode ¤¬Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ë¤¢¤ë¡£ +.SH ½àµò +SVr4, 4.4BSD, POSIX.1-2001 +.RB ( bind () +¤Ï 4.2BSD ¤ÇºÇ½é¤Ë¸½¤ï¤ì¤¿)¡£ +.\" SVr4 ¤Ë¤Ï¾¤Ë¡¢°ìÈ̤Υ¨¥é¡¼¾õÂÖ +.\" .B ENOSR +.\" µÚ¤Ó Unix ¥É¥á¥¤¥ó¤Î¥¨¥é¡¼¾õÂÖ +.\" .BR EIO , +.\" .B EISDIR +.\" ¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.SH Ãí°Õ +POSIX.1-2001 ¤Ç¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ïɬ¿Ü¤È¤µ¤ì¤Æ¤ª¤é¤º¡¢ +Linux ¤Ç¤Ï¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÏɬÍפǤϤʤ¤¡£ +¤·¤«¤·¡¢Îò»ËŪ¤Ë¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¼ÂÁõ (BSD ·Ï) ¤Ç¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬ +ɬÍפǤ¢¤ê¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò +¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬¸­ÌÀ¤Ç¤¢¤í¤¦¡£ + +.BR bind () +¤Î»°ÈÖÌܤΰú¤­¿ô¤Ï (4.x BSD ¤ä libc4, libc5 ¤ÈƱÍͤË) ¼ÂºÝ¤Ë¤Ï +.I int +¤Ç¤¢¤ë¡£glibc ¤Ç¤â»È¤ï¤ì¤Æ¤¤¤ë¸½ºß¤Î +.I socklen_t +¤Ë´Ø¤·¤Æ¡¢POSIX ¤Ë¤Ï¾¯¤·º®Í𤬤¢¤ë¡£ +¾Ü¤·¤¯¤Ï +.BR accept (2) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥Ð¥° +Æ©²áŪ¥×¥í¥­¥· (transparent proxy) ¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æµ­½Ò¤·¤Æ¤¤¤Ê¤¤¡£ +.\" FIXME What *are* transparent proxy options? +.SH Îã +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¡¦¥É¥á¥¤¥ó¡¦¥½¥±¥Ã¥È¤Ç¤Î +.BR bind () +¤ÎÍøÍÑÎ㤬 +.BR getaddrinfo (3) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ + +°Ê²¼¤ÎÎã¤Ï¡¢Unix ¥É¥á¥¤¥ó +.RB ( AF_UNIX ) +¤Ç¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¤ò bind ¤¹¤ëÊýË¡¤ò¼¨¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.\" listen.7 refers to this example. +.\" accept.7 refers to this example. +.\" unix.7 refers to this example. + +.nf +#include +#include +#include +#include +#include + +#define MY_SOCK_PATH "/somepath" +#define LISTEN_BACKLOG 50 + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int +main(int argc, char *argv[]) +{ + int sfd, cfd; + struct sockaddr_un my_addr, peer_addr; + socklen_t peer_addr_size; + + sfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (sfd == \-1) + handle_error("socket"); + + memset(&my_addr, 0, sizeof(struct sockaddr_un)); + /* Clear structure */ + my_addr.sun_family = AF_UNIX; + strncpy(my_addr.sun_path, MY_SOCK_PATH, + sizeof(my_addr.sun_path) \- 1); + + if (bind(sfd, (struct sockaddr *) &my_addr, + sizeof(struct sockaddr_un)) == \-1) + handle_error("bind"); + + if (listen(sfd, LISTEN_BACKLOG) == \-1) + handle_error("listen"); + + /* Now we can accept incoming connections one + at a time using accept(2) */ + + peer_addr_size = sizeof(struct sockaddr_un); + cfd = accept(sfd, (struct sockaddr *) &peer_addr, + &peer_addr_size) + if (cfd == \-1) + handle_error("accept"); + + /* Code to deal with incoming connection(s)... */ + + /* When no longer required, the socket pathname, MY_SOCK_PATH + should be deleted using unlink(2) or remove(3) */ +} +.fi +.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) diff --git a/release/man2/brk.2 b/release/man2/brk.2 new file mode 100644 index 00000000..54e733bb --- /dev/null +++ b/release/man2/brk.2 @@ -0,0 +1,176 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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 2008-06-18 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +brk, sbrk \- ¥Ç¡¼¥¿¡¦¥»¥°¥á¥ó¥È¤Î¥µ¥¤¥º¤ÎÊѹ¹¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int brk(void *" addr ); +.sp +.BI "void *sbrk(intptr_t " increment ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR brk (), +.BR sbrk (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.ad b +.SH ÀâÌÀ +.BR brk () +¤È +.BR sbrk () +¤Ï +.I "¥×¥í¥°¥é¥à¡¦¥Ö¥ì¡¼¥¯ (program break)" +¤Î¾ì½ê¤òÊѹ¹¤¹¤ë¡£ +¥×¥í¥°¥é¥à¡¦¥Ö¥ì¡¼¥¯¤Ï¥×¥í¥»¥¹¤Î¥Ç¡¼¥¿¡¦¥»¥°¥á¥ó¥È (data segment) ¤Î +ËöÈø¤ò¼¨¤¹ (¥×¥í¥°¥é¥à¡¦¥Ö¥ì¡¼¥¯¤Ï¡¢½é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤ +¥Ç¡¼¥¿¡¦¥»¥°¥á¥ó¥È¤ÎËöÈø¤Îľ¸å¤Î¾ì½ê¤È¤Ê¤ë)¡£ +¥×¥í¥°¥é¥à¡¦¥Ö¥ì¡¼¥¯¤òÁý¤ä¤¹¤È¤¤¤¦¤³¤È¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Ø¤Î +¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤ë¸ú²Ì¤¬¤¢¤ê¡¢ +¥×¥í¥°¥é¥à¡¦¥Ö¥ì¡¼¥¯¤ò¸º¤é¤¹¤È¤¤¤¦¤³¤È¤Ï¡¢¥á¥â¥ê¤ò²òÊü¤¹¤ë +¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ + +.BR brk () +¤Ï¡¢¥Ç¡¼¥¿¡¦¥»¥°¥á¥ó¥È¤ÎËöÈø¤ò +.I addr +¤Ç»ØÄꤷ¤¿ÃͤËÀßÄꤹ¤ë¡£ +ÀßÄ꤬¹Ô¤ï¤ì¤ë¤Î¤Ï¡¢»ØÄꤷ¤¿Ãͤ¬Í­¸ú¤Ç¡¢ +¥·¥¹¥Æ¥à¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤¢¤ê¡¢ +¥×¥í¥»¥¹¤Î¥Ç¡¼¥¿¥µ¥¤¥º¤ÎºÇÂçÃͤòĶ¤¨¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤¢¤ë +.RB ( setrlimit (2) +¤ò»²¾È)¡£ + +.BR sbrk () +¤Ï¡¢¥×¥í¥°¥é¥à¤Î¥Ç¡¼¥¿¶õ´Ö¤ò +.I increment +¥Ð¥¤¥È¤À¤±Áý¤ä¤¹¡£ +.I increment +¤ò 0 ¤Ë¤·¤Æ +.BR sbrk () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢¥×¥í¥°¥é¥à¤Î¸½ºß¤Î¥Ö¥ì¡¼¥¯ (break) ¾ì½ê¤òÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR brk () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B ENOMEM +¤òÀßÄꤹ¤ë +(¤¿¤À¤·¡ÖLINUX ¤Ç¤ÎÃí°Õ¡×¤ò»²¾È¤¹¤ë¤³¤È)¡£ + +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR sbrk () +¤ÏÊѹ¹Á°¤Î¥×¥í¥°¥é¥à¡¦¥Ö¥ì¡¼¥¯¤òÊÖ¤¹ +(¥×¥í¥°¥é¥à¡¦¥Ö¥ì¡¼¥¯¤¬Áý¤ä¤µ¤ì¤¿¾ì¹ç¡¢¤³¤ÎÃÍ¤Ï +¿·¤·¤¯³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ÎÀèƬ¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤È¤Ê¤ë)¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I "(void\ *)\ \-1" +¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B ENOMEM +¤òÀßÄꤹ¤ë¡£ +.SH ½àµò +4.3BSD, SUSv1. +SUSv2 ¤Ç¤Ï¡Ö²áµî¤Î̾»Ä (LEGACY)¡×¤È°ÌÃÖÉÕ¤±¤é¤ì¤Æ¤ª¤ê¡¢ +POSIX.1-2001 ¤Çºï½ü¤µ¤ì¤¿¡£ +.\" .BR brk () +.\" ¤È +.\" .BR sbrk () +.\" ¤Ï C µ¬³Ê (C Standard) ¤Ë¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" ¤Þ¤¿ POSIX.1 µ¬³Ê¤«¤é¤Ï°Õ¿ÞŪ¤Ë½ü³°¤µ¤ì¤Æ¤¤¤ë (ÃÊÍî B.1.1.1.3, B.8.3.3 »²¾È)¡£ +.SH Ãí°Õ +.BR brk () +¤ä +.BR sbrk () +¤ò»ÈÍѤ¹¤ë¤Î¤ÏÈò¤±¤ë¤³¤È¡£ +.BR malloc (3) +¥á¥â¥ê³ä¤êÅö¤Æ¥Ñ¥Ã¥±¡¼¥¸¤ÎÊý¤¬¡¢°Ü¿¢À­¤¬¹â¤¯¡¢ +»È¤¤¤ä¤¹¤¤¥á¥â¥ê³ä¤êÅö¤ÆÊýË¡¤òÄ󶡤·¤Æ¤¤¤ë¡£ + +¤¤¤í¤¤¤í¤Ê¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¡¢ +.BR sbrk () +¤Î°ú¤­¿ô¤ËÍÍ¡¹¤Ê·¿¤¬»È¤ï¤ì¤Æ¤¤¤ë¡£ +°ìÈÌŪ¤Ê¤Î¤Ï \fIint\fP, \fIssize_t\fP, \fIptrdiff_t\fP, \fIintptr_t\fP ¤Ç¤¢¤ë¡£ +.\" \fIint\fP (¤¿¤È¤¨¤Ð 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). +.\" ¤È¤¤¤¦¤Î¤¬Ê¬¤«¤ë¤À¤í¤¦¡£ +.SS Linux ¤Ç¤ÎÃí°Õ +¾å¤ÇÀâÌÀ¤·¤¿ +.BR brk () +¤ÎÊÖ¤êÃͤˤĤ¤¤Æ¤ÎÆ°ºî¤Ï¡¢ +Linux ¤Î +.BR brk () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¥é¥Ã¥×¤¹¤ë glibc ¤Î´Ø¿ô¤Ë¤è¤ë¤â¤Î¤Ç¤¢¤ë¡£ +(¤½¤Î¾¤Î¿¤¯¤Î¼ÂÁõ¤Ç¤â¡¢ +.BR brk () +¤ÎÊÖ¤êÃͤϤ³¤ì¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +¤³¤ÎÊÖ¤êÃÍ¤Ï SUSv2 ¤Ç¤âµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£) +¤·¤«¤·¡¢¼ÂºÝ¤Î Linux ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¡¢ +¥×¥í¥°¥é¥à¤Î¿·¤·¤¤¥Ö¥ì¡¼¥¯¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¸½ºß¤Î¥Ö¥ì¡¼¥¯¤òÊÖ¤¹¡£ +glibc ¥é¥Ã¥Ñ¡¼´Ø¿ô¤ÏƱÍͤÎƯ¤­¤ò¤· +(¤¹¤Ê¤ï¤Á¡¢¿·¤·¤¤¥Ö¥ì¡¼¥¯¤¬ +.I addr +¤è¤ê¾®¤µ¤¤¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·)¡¢ +¾å¤ÇÀâÌÀ¤·¤¿ 0 ¤È \-1 ¤È¤¤¤¦ÊÖ¤êÃͤòÊÖ¤¹¡£ + +Linux ¤Ç¤Ï +.BR sbrk () +¤Ï +.BR brk () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢ +°ÊÁ°¤Î¥Ö¥ì¡¼¥¯¤ÎÃͤòÊÖ¤¹¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤ËÆâÉô¤ÇÄ´À°¤¬¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR execve (2), +.BR getrlimit (2), +.BR end (3), +.BR malloc (3) diff --git a/release/man2/cacheflush.2 b/release/man2/cacheflush.2 new file mode 100644 index 00000000..9d9724f3 --- /dev/null +++ b/release/man2/cacheflush.2 @@ -0,0 +1,97 @@ +.\" Written by Ralf Baechle (ralf@waldorf-gmbh.de), +.\" Copyright (c) 1994, 1995 Waldorf GMBH +.\" +.\" 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 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 ¥Õ¥é¥Ã¥·¥å +.\" +.TH CACHEFLUSH 2 2007-05-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +cacheflush \- Ì¿Îᥭ¥ã¥Ã¥·¥å¤ä¥Ç¡¼¥¿¥­¥ã¥Ã¥·¥å¤ÎÆâÍƤò¥Õ¥é¥Ã¥·¥å¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int cacheflush(char *" addr ", int "nbytes ", int "cache ); +.fi +.SH ÀâÌÀ +.BR cacheflush () +¤Ï +.I addr +¤«¤é +.I (addr+nbytes-1) +¤ÎÈϰϤΥ桼¥¶¥¢¥É¥ì¥¹¤ËÂбþ¤¹¤ë +»ØÄꤵ¤ì¤¿¥­¥ã¥Ã¥·¥å¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.I cache +¤Ë¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë: +.TP +.B ICACHE +Ì¿Îá (instruction) ¥­¥ã¥Ã¥·¥å¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.TP +.B DCACHE +Êѹ¹¤¬¤¢¤Ã¤¿¥­¥ã¥Ã¥·¥å¥é¥¤¥ó¤ò¥á¥â¥ê¤Ë½ñ¤­Ìᤷ¡¢Ìµ¸ú¤Ë¤¹¤ë¡£ +.TP +.B BCACHE +.B (ICACHE|DCACHE) +¤ÈƱ¤¸¡£ +.SH ÊÖ¤êÃÍ +.BR cacheflush () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤ò¡¢¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï +.I errno +¤Ë¥¨¥é¡¼¤¬»Ø¼¨¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I addr +¤«¤é +.I (addr+nbytes-1) +¤ÎÈϰϤΥ¢¥É¥ì¥¹¤ÎÁ´¤Æ¤Þ¤¿¤Ï°ìÉô¤¬ +¥¢¥¯¥»¥¹²Äǽ¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINVAL +.I cache +¥Ñ¥é¥á¡¼¥¿¤¬ +.BR ICACHE , +.BR DCACHE , +.B BCACHE +¤Î¤É¤ì¤Ç¤â¤Ê¤¤¡£ +.SH ½àµò +¤³¤Î 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. +°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\" Irix 6.5 appears to have a cacheflush() syscall -- mtk +.SH ¥Ð¥° +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢°ú¤­¿ô +.I addr +¤È +.I nbytes +¤Ï̵»ë¤µ¤ì¤ë¡£¤½¤Î¤¿¤á¡¢ +¾ï¤ËÁ´¤Æ¤Î¥­¥ã¥Ã¥·¥å¤¬¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë¡£ diff --git a/release/man2/capget.2 b/release/man2/capget.2 new file mode 100644 index 00000000..116cc0a9 --- /dev/null +++ b/release/man2/capget.2 @@ -0,0 +1,251 @@ +.\" written by Andrew Morgan +.\" may be distributed as per GPL +.\" Modified by David A. Wheeler +.\" Modified 2004-05-27, mtk +.\" Modified 2004-06-21, aeb +.\" Modified 2008-04-28, morgan of kernel.org +.\" Update in line with addition of file capabilities and +.\" 64-bit capability sets in kernel 2.6.2[45]. +.\" Modified 2009-01-26, andi kleen +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1999-12-26, HANATAKA Shinya +.\" Updated & Modified 2005-02-03, Yuichi SATO +.\" Updated & Modified 2006-01-31, Akihiro MOTOKI +.\" Updated & Modified 2006-07-23, Akihiro MOTOKI, LDP v2.36 +.\" Updated & Modified 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2009-02-24, Akihiro MOTOKI, LDP v3.19 +.\" +.\"WORD: capability ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\"WORD: effective capability ¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\"WORD: inheritable capabilit ·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\"WORD: permitted capabily µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\" +.TH CAPGET 2 2009-01-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +capget, capset \- ¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÀßÄê/¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #undef _POSIX_SOURCE +.br +.B #include +.sp +.BI "int capget(cap_user_header_t " hdrp ", cap_user_data_t " datap ); +.sp +.BI "int capset(cap_user_header_t " hdrp ", const cap_user_data_t " datap ); +.SH ÀâÌÀ +Linux 2.2 ¤Ç¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼ (root) ¤Î¸¢¸Â¤Ï¡¢¸ÄÊ̤Υ±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +(capabilities) ¤Ø¤Èʬ³ä¤µ¤ì¡¢¤½¤Î½¸¹ç¤È¤·¤Æɽ¸½¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +³Æ¥¹¥ì¥Ã¥É¤Ï¡Ö¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (effective capability) ¤Î½¸¹ç¡×¤ò»ý¤Á¡¢ +¤½¤ì¤Ë¤è¤Ã¤Æ¸½ºß¤É¤ÎÁàºî¤¬¼Â¹Ô²Äǽ¤«¤ò¼±Ê̤Ǥ­¤ë¡£ +¤Þ¤¿¡¢³Æ¥¹¥ì¥Ã¥É¤Ï¡¢ +¡Ö·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (inheritable capability) ¤Î½¸¹ç¡×¤È +¡Öµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (permitted capability) ¤Î½¸¹ç¡×¤ò»ý¤Ä¡£ +¡Ö·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î½¸¹ç¡×¤Ï +.BR execve (2) +¤òÄ̤¸¤ÆÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î½¸¹ç¤Ç¤¢¤ê¡¢ +¡Öµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (permitted capability) ¤Î½¸¹ç¡×¤Ï +¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ä·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤È¤·¤ÆÍ­¸ú¤Ë¤Ç¤­¤ë +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òµ¬Äꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.PP +¤³¤ÎÆó¤Ä¤Î´Ø¿ô¤Ï¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¼èÆÀ¤·¤¿¤êÀßÄꤷ¤¿¤ê¤¹¤ë¤¿¤á¤Î +À¸¤Î¥«¡¼¥Í¥ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ë¤È¤¤¤¦¤À¤±¤Ç¤Ê¤¯¡¢ +¥«¡¼¥Í¥ë API ¤ÏÊѹ¹¤µ¤ì¤ë¤«¤â¤·¤ì¤º¡¢¤³¤ì¤é¤Î +´Ø¿ô¤Î»ÈÍÑË¡ (ÆÃ¤Ë +.I cap_user_*_t +·¿¤È¤¤¤¦½ñ¼°) ¤Ï¥«¡¼¥Í¥ë¤Î¥ê¥Ó¥¸¥ç¥óËè¤Ë³ÈÄ¥¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¤¬¡¢ +°ÊÁ°¤Î¥×¥í¥°¥é¥à¤Ï¤½¤Î¤Þ¤ÞÆ°ºî¤¹¤ë¡£ +.sp +°Ü¿¢À­¤Î¤¢¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï +.BR cap_set_proc (3) +¤È +.BR cap_get_proc (3) +¤Ç¤¢¤ë¡£ +²Äǽ¤Ê¤é¤Ð¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤ì¤é¤Î´Ø¿ô¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë Linux ³ÈÄ¥¤ò»ÈÍѤ·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢¤è¤ê´Êñ¤Ë +»È¤¨¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë +.BR capsetp (3) +¤È +.BR capgetp (3) +¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SS ¸½ºß¤Î¾ÜºÙ +¸½ºß¤Î¥«¡¼¥Í¥ë¤Î¾ÜºÙ¤Ë¤Ä¤¤¤ÆÃí°Õ¤ò½Ò¤Ù¤Æ¤ª¤¯¡£ +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.sp +.nf +.in +4n +#define _LINUX_CAPABILITY_VERSION_1 0x19980330 +#define _LINUX_CAPABILITY_U32S_1 1 + +#define _LINUX_CAPABILITY_VERSION_2 0x20071026 +#define _LINUX_CAPABILITY_U32S_2 2 + +typedef struct __user_cap_header_struct { + __u32 version; + int pid; +} *cap_user_header_t; + +typedef struct __user_cap_data_struct { + __u32 effective; + __u32 permitted; + __u32 inheritable; +} *cap_user_data_t; +.fi +.in -4n +.sp +.I effective, permitted, inheritable +¤Ï¡¢ +.BR capability (7) +¤ÇÄêµÁ¤µ¤ì¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +.I CAP_* +¤Ï¥Ó¥Ã¥ÈÈÖ¹æ¤òɽ¤¹¥¤¥ó¥Ç¥Ã¥¯¥¹ÃͤǤ¢¤ê¡¢ +¥Ó¥Ã¥È¥Õ¥£¡¼¥ë¥É¤Ë OR ¤ò¹Ô¤¦Á°¤Ë +.I CAP_* +¤ÎÃͤÎʬ¤À¤±¥Ó¥Ã¥È¥·¥Õ¥È¤ò¹Ô¤¦É¬Íפ¬¤¢¤ë¡£ +typedef ¤ÎÊý¤Ï¥Ý¥¤¥ó¥¿¤Ê¤Î¤Ç¡¢ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹¹½Â¤ÂΤòÄêµÁ¤¹¤ë¤Ë¤Ï¡¢ +.I struct __user_cap_header_struct +¤È +.I struct __user_cap_data_struct +¤È¤¤¤¦Ì¾Á°¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +¥«¡¼¥Í¥ë 2.6.25 ¤è¤êÁ°¤Ç¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó +.B _LINUX_CAPABILITY_VERSION_1 +¤Î 32 ¥Ó¥Ã¥È¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¿ä¾©¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.6.25 °Ê¹ß¤Ç¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó +.B _LINUX_CAPABILITY_VERSION_2 +¤Î 64 ¥Ó¥Ã¥È¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¿ä¾©¤Ç¤¢¤ë¡£ +64 ¥Ó¥Ã¥È¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ç¤Ï +.IR datap [0] +¤È +.IR datap [1] +¤¬»ÈÍѤµ¤ì¤ë¤Î¤ËÂФ·¡¢ +32 ¥Ó¥Ã¥È¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ç¤Ï +.IR datap [0] +¤À¤±¤¬»ÈÍѤµ¤ì¤ë¡£ +.sp +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎµóÆ°¤Ë±Æ¶Á¤¬¤¢¤ë¤â¤¦°ì¤Ä¤ÎÊѹ¹ÅÀ¤Ï¡¢ +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (file capabilities) ¤Î¥«¡¼¥Í¥ë¤Ë¤è¤ë¥µ¥Ý¡¼¥È +(VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥µ¥Ý¡¼¥È) ¤Ç¤¢¤ë¡£ +VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥µ¥Ý¡¼¥È¤Ï¸½ºß¤Î¤È¤³¤í¥³¥ó¥Ñ¥¤¥ë»þ¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë +(¥«¡¼¥Í¥ë 2.6.24 ¤ÇÄɲ䵤줿)¡£ +.sp +.BR capget () +¤Ç¤Ï¡¢ +.I hdrp->pid +¤Î¥Õ¥£¡¼¥ë¥ÉÃͤ˥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÃΤꤿ¤¤¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤ò +»ØÄꤹ¤ë¤³¤È¤Ç¡¢Ç¤°Õ¤Î¥×¥í¥»¥¹¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SS VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç +VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥µ¥Ý¡¼¥È¤Ç¤Ï¡¢Æø¢¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò +Äɲ乤뤿¤á¤Î¥Õ¥¡¥¤¥ë°À­¥á¥½¥Ã¥É¤¬ºîÀ®¤µ¤ì¤¿¡£ +¤³¤ÎÆø¢¥â¥Ç¥ë¤ÎƳÆþ¤Ë¤è¤ê¡¢¤¢¤ë¥×¥í¥»¥¹¤Ë¤è¤êÊÌ¤Î¥×¥í¥»¥¹¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +¤òÈóƱ´ü¤ËÀßÄꤹ¤ëµ¡Ç½¤Î¥«¡¼¥Í¥ë¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤ÏÇѻߤµ¤ì¤ë¡£ +¤Ä¤Þ¤ê¡¢VFS ¥µ¥Ý¡¼¥È¤Ç¤Ï¡¢ +.BR capset () +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë +.I hdrp->pid +¤ÎÃͤȤ·¤Æµö¤µ¤ì¤ë¤Î¤Ï 0 ¤È +.BR getpid (2) +¤¬ÊÖ¤¹ÃͤÀ¤±¤È¤Ê¤ë (¤É¤Á¤é¤ÎÃͤǤâÅù²Á¤Ç¤¢¤ë)¡£ +.SS VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç +¥«¡¼¥Í¥ë¤¬ VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.I hdrp +¤Î +.I pid +¥Õ¥£¡¼¥ë¥É¤¬ 0 °Ê³°¤Ç¤¢¤ì¤Ð¡¢ +.BR capset () +¤ÎÁàºîÂÐ¾Ý¤Ï +.I pid +¤Ç»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ë¤Ê¤ë¡£ +.I pid +¤¬ 0 ¤Î¾ì¹ç¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬ÁàºîÂоݤȤʤ롣 +.I pid +¤¬¥·¥ó¥°¥ë¥¹¥ì¥Ã¥É¡¦¥×¥í¥»¥¹¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.I pid +¤Ï°ÊÁ°¤«¤é»È¤ï¤ì¤Æ¤¤¤ë¥×¥í¥»¥¹ID ¤ò»È¤Ã¤Æ»ØÄê¤Ç¤­¤ë¡£ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¡¦¥×¥í¥»¥¹Æâ¤Î¤¢¤ë¥¹¥ì¥Ã¥É¤òÂоݤˤ¹¤ë¾ì¹ç¤Ï¡¢ +.BR gettid (2) +¤¬ÊÖ¤¹¥¹¥ì¥Ã¥ÉID ¤òÍѤ¤¤Æ»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ +¤Þ¤¿¡¢ +.BR capset () +¤Ç¤Ï \-1 ¤ä \-1 ¤è¤ê¾®¤µ¤ÊÃͤò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +\-1 ¤Ï¸Æ¤Ó½Ð¤·¸µ¤È +.BR init (8) +¤ò½ü¤¯Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤òÂоݤȤ·¤ÆÊѹ¹¤ò¹Ô¤¦¤³¤È¤ò¡¢ +\-1 ¤è¤ê¾®¤µ¤ÊÃÍ¤Ï ID ¤¬ \-\fIpid\fP ¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð +¤òÂоݤȤ·¤ÆÊѹ¹¤ò¹Ô¤¦¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ + +¤³¤Î¥Ç¡¼¥¿¤Î¾ÜºÙ¤Ï +.BR capabilities (7) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ + +.I hdrp +¤Î¥Õ¥£¡¼¥ë¥É +.I version +¤Ë¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤Ãͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤·¡¢ +.I version +¤Ë¥«¡¼¥Í¥ë¿ä¾©¤Î +.B _LINUX_CAPABILITY_VERSION_? +¤òÀßÄꤹ¤ë¡£ +¤³¤Î¤è¤¦¤Ë¤·¤Æ¡¢¸½ºß¤Î¿ä¾©¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥ê¥Ó¥¸¥ç¥ó¤¬²¿¤«¤ò +Ä´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +ÉÔÀµ¤Ê¥á¥â¥ê¥¢¥É¥ì¥¹¡£ +.I hdrp +¤Ï NULL ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.I datap +¤Ë NULL ¤ò»ØÄꤷ¤Æ¤è¤¤¤Î¤Ï¡¢¥æ¡¼¥¶¤¬¥«¡¼¥Í¥ë¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë +¿ä¾©¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¡¼¥¸¥ç¥ó¤òȽÄꤷ¤è¤¦¤È¤·¤Æ¤¤¤ë¤È¤­¤À¤±¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +°ú¤­¿ô¤Î¤É¤ì¤«¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.TP +.B EPERM +¡Öµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¡×¤Ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÄɲ䷤褦¤È¤·¤Æ¤¤¤ë¤«¡¢ +¤â¤·¤¯¤Ï¡Öµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¡×¤Ë´Þ¤Þ¤ì¤Ê¤¤¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò +¡Ö¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¡×¤ä¡Ö·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¡×¤Ë +¥»¥Ã¥È¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤¬¼«Ê¬°Ê³°¤Î¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò +.BR capset () +¤ò»È¤Ã¤Æ½¤Àµ¤·¤è¤¦¤È¤·¤¿¤¬¡¢½½Ê¬¤ÊÆø¢¤¬¤Ê¤«¤Ã¤¿¡£ +VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¤³¤ÎÁàºî¤¬µö²Ä¤µ¤ì¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£ +VFS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +(¥Ð¡¼¥¸¥ç¥ó 2.6.11 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¡¢ +¤³¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤¥¹¥ì¥Ã¥É¤¬ +.I pid +¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤Ç¤Ê¤¤ÃÍ (¤Ä¤Þ¤ê¡¢0 ¤ÎÂå¤ï¤ê¤Ë +.BR getpid (2) +¤¬ÊÖ¤¹ÃÍ) ¤ò»ØÄꤷ¤Æ¼«Ê¬¼«¿È¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¤â¡¢ +¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¤¤¤¦¥Ð¥°¤¬¤¢¤Ã¤¿¡£) +.TP +.B ESRCH +¤½¤Î¤è¤¦¤Ê¥¹¥ì¥Ã¥É¤¬Â¸ºß¤·¤Ê¤¤¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.SH È÷¹Í +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÀßÄꤷ¤¿¤ê¼èÆÀ¤·¤¿¤ê¤¹¤ëµ¡Ç½¤Î¤¿¤á¤Î°Ü¿¢À­¤¢¤ë +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï +.I libcap +¥é¥¤¥Ö¥é¥ê¤Ë¤è¤Ã¤ÆÄ󶡤µ¤ì¤ë¡£ +¤³¤Î¥é¥¤¥Ö¥é¥ê¤Ï°Ê²¼¤«¤éÆþ¼ê¤Ç¤­¤ë: +.br +http://www.kernel.org/pub/linux/libs/security/linux-privs +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR gettid (2), +.BR capabilities (7) diff --git a/release/man2/chdir.2 b/release/man2/chdir.2 new file mode 100644 index 00000000..113d91d4 --- /dev/null +++ b/release/man2/chdir.2 @@ -0,0 +1,142 @@ +.\" 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-21 by Rik Faith +.\" Modified 1995-04-15 by Michael Chastain : +.\" Added 'fchdir'. Fixed bugs in error section. +.\" Modified 1996-10-21 by Eric S. Raymond +.\" 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 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +chdir, fchdir \- ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÎÊѹ¹ +.SH ½ñ¼° +.B #include +.sp +.BI "int chdir(const char *" path ); +.br +.BI "int fchdir(int " fd ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR fchdir (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.BR chdir () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê (current working directory) ¤ò¡¢ +.I path +¤Ë»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤¹¤ë¡£ +.PP +.BR fchdir () +¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤È¤·¤Æ +»ØÄꤵ¤ì¤ë°Ê³°¤Ï¡¢ +.BR chdir () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢0 ¤òÊÖ¤¹¡£¼ºÇÔ¤¹¤ë¤È¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¾¤Î¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë»ö¤¬¤¢¤ë¡£ +.BR chdir () +¤Ç°ìÈÌŪ¤Ê¥¨¥é¡¼¤ò°Ê²¼¤Ëµó¤²¤ë: +.TP +.B EACCES +.I path +¤Î¹½À®Í×ÁǤΤ¤¤º¤ì¤«¤Ë¸¡º÷µö²Ä (search permission) ¤¬¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EFAULT +³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö³°¤ò +.I path +¤¬»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EIO +I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ELOOP +.I path +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.I path +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I path +¤Î¹½À®Í×ÁǤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.PP +.BR fchdir () +¤Ç°ìÈÌŪ¤Ê¥¨¥é¡¼¤ò°Ê²¼¤Ëµó¤²¤ë: +.TP +.B EACCES +.I fd +¤ò¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤Æ¥ª¡¼¥×¥ó¤¹¤ë¤¿¤á¤Î¸¡º÷µö²Ä¤¬¤Ê¤¤¡£ +.TP +.B EBADF +.I fd +¤¬Å¬Àڤʥե¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ê¤¤¡£ +.SH ½àµò +SVr4, 4.4BSD, POSIX.1-2001. +.SH Ãí°Õ +¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢ÁêÂХѥ¹Ì¾ (\(aq/\(aq) ¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Ê¤¤¥Ñ¥¹Ì¾) ¤ò +²ò¼á¤¹¤ëºÝ¤Î³«»ÏÅÀ¤Ç¤¢¤ë¡£ + +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Î¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò +·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¡¢¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ + +.BR fchdir () +¤Î¥×¥í¥È¥¿¥¤¥×¤¬Í­¸ú¤Ë¤Ê¤ë¤Î¤Ï¡¢ +.B _BSD_SOURCE +¤òÄêµÁ¤·¤¿¾ì¹ç¤«¡¢ +.B _XOPEN_SOURCE +¤òÃÍ 500 ¤ÇÄêµÁ¤·¤¿¾ì¹ç¤Î¤ß¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR chroot (2), +.BR getcwd (3), +.BR path_resolution (7) diff --git a/release/man2/chmod.2 b/release/man2/chmod.2 new file mode 100644 index 00000000..156c97ca --- /dev/null +++ b/release/man2/chmod.2 @@ -0,0 +1,238 @@ +.\" 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-21 by Rik Faith +.\" Modified 1997-01-12 by Michael Haardt +.\" : 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 2008-05-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +chmod, fchmod \- ¥Õ¥¡¥¤¥ë¤Î¥â¡¼¥É¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int chmod(const char *" path ", mode_t " mode ); +.br +.BI "int fchmod(int " fd ", mode_t " mode ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR fchmod (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹µö²Ä (permission) ¤òÊѹ¹¤¹¤ë¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë´Ö¤Î°ã¤¤¤Ï¡¢¥Õ¥¡¥¤¥ë¤Î»ØÄê¤Î»ÅÊý¤À¤±¤Ç¤¢¤ë¡£ +.IP * 2 +.BR chmod () +¤Ï¡¢ +.I path +¤Ç»ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤Îµö²Ä¤òÊѹ¹¤¹¤ë¡£ +.I path +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î¾ì¹ç¤Ï¡¢¥ê¥ó¥¯¤ÎŸ³«¤¬¹Ô¤ï¤ì¤ë¡£ +.IP * +.BR fchmod () +¤Ï¡¢¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Îµö²Ä¤òÊѹ¹¤¹¤ë¡£ +.PP +¿·¤·¤¤¥Õ¥¡¥¤¥ëµö²Ä¤Ï +.I mode +¤Ç»ØÄꤵ¤ì¤ë¡£ +.I mode +¤Ï¡¢°Ê²¼¤Ë¼¨¤¹ÃͤΠ0 ¸Ä°Ê¾å¤Î OR (ÏÀÍýÏÂ) ¤ò¤È¤Ã¤ÆºîÀ®¤µ¤ì¤ë +¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +.TP 18 +.BR S_ISUID " (04000)" +set-user-ID +.RB ( execve (2) +»þ¤Ë¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤Ë¥»¥Ã¥È¤µ¤ì¤ë) +.TP +.BR S_ISGID " (02000)" +set-group-ID +(°Ê²¼¤Î¾ì¹ç¤Ë +.RB ( execve (2) +¼Â¹Ô»þ¤Ë¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡¢ +¶¯À©¥í¥Ã¥¯ (mandatory locking) ¤ò¹Ô¤¦ +.RB ( fcntl (2) +¤ÎÀâÌÀ¤ò»²¾È)¡¢ +¿·¤·¤¤¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×¤È¤·¤Æ¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤ÈƱ¤¸¤â¤Î¤ò»È¤¦ +.RB ( chown (2) +¤È +.BR ( mkdir (2) +¤ÎÀâÌÀ¤ò»²¾È) +.TP +.BR S_ISVTX " (01000)" +¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È (sticky bit) (ºï½üÀ©¸Â¥Õ¥é¥°¡¢ +.BR unlink (2) +¤ÎÀâÌÀ¤ò»²¾È) +.TP +.BR S_IRUSR " (00400)" +½êÍ­¼Ô¤Ë¤è¤ëÆɤ߼è¤ê +.TP +.BR S_IWUSR " (00200)" +½êÍ­¼Ô¤Ë¤è¤ë½ñ¤­¹þ¤ß +.TP +.BR S_IXUSR " (00100)" +½êÍ­¼Ô¤Ë¤è¤ë¼Â¹Ô (execute) / ¸¡º÷ (search) +(¡Ö¸¡º÷¡×¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤ÆŬÍѤµ¤ì¤ë¤â¤Î¤Ç¡¢ +¤½¤Î¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥¨¥ó¥È¥ê¡¼¤Ø¥¢¥¯¥»¥¹¤Ç¤­¤ë¤«¤ò°ÕÌ£¤¹¤ë) +.TP +.BR S_IRGRP " (00040)" +¥°¥ë¡¼¥×¤Ë¤è¤ëÆɤ߼è¤ê +.TP +.BR S_IWGRP " (00020)" +¥°¥ë¡¼¥×¤Ë¤è¤ë½ñ¤­¹þ¤ß +.TP +.BR S_IXGRP " (00010)" +¥°¥ë¡¼¥×¤Ë¤è¤ë¼Â¹Ô / ¸¡º÷ +.TP +.BR S_IROTH " (00004)" +¾¿Í (others) ¤Ë¤è¤ëÆɤ߼è¤ê +.TP +.BR S_IWOTH " (00002)" +¾¿Í¤Ë¤è¤ë½ñ¤­¹þ¤ß +.TP +.BR S_IXOTH " (00001)" +¾¿Í¤Ë¤è¤ë¼Â¹Ô / ¸¡º÷ +.PP +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú (effective) UID ¤¬¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤È°ìÃפ¹¤ë¤«¡¢ +¤½¤Î¥×¥í¥»¥¹¤¬Æø¢¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(Linux ¤Ç¤Ï +.B CAP_FOWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ + +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¯ (Linux ¤Ç¤Ï +.B CAP_FSETID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¯)¡¢¤«¤Ä¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥× ID ¤¬ +¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤Þ¤¿¤ÏÊä½õŪ¤Ê¥°¥ë¡¼¥× ID ¤Ë¥Þ¥Ã¥Á¤·¤Ê¤¤¾ì¹ç¡¢ +.B S_ISGID +¥Ó¥Ã¥È¤Ï¥ª¥Õ¤Ë¤µ¤ì¤ë¤¬¡¢¤³¤ì¤Ë¤è¤Ã¤Æ¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ + +°ÂÁ´¤Î¤¿¤á¤Î½èÃ֤Ȥ·¤Æ¡¢ +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ß¤ò¹Ô¤¦»þ¤Ë +¥»¥Ã¥È¡¦¥æ¡¼¥¶¡¼ ID ¤È¥»¥Ã¥È¡¦¥°¥ë¡¼¥× ID ¥Ó¥Ã¥È¤È¼Â¹Ô¥Ó¥Ã¥È¤¬ +¥ª¥Õ¤Ë¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +(Linux ¤Ç¤Ï¡¢½ñ¤­¹þ¤ß¥×¥í¥»¥¹¤¬ +.B CAP_FSETID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¡¢¤³¤ì¤¬µ¯¤³¤ë¡£) +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ÎÃæ¤Ë¤Ï¡¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤À¤±¤¬ +ÆÃÊ̤ΰÕÌ£¤ò»ý¤Ä¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È¤òÀßÄê¤Ç¤­¤ë¤â¤Î¤¬¤¢¤ë¡£ +¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È¤È¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ¹¤ë +¥»¥Ã¥È¡¦¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×)¡¦ID ¥Ó¥Ã¥È¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR stat (2) +¤ò¸«¤è¡£ + +NFS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ç¤Ï¡¢¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤òÀ©¸Â¤¹¤ë¤È¡¢ +´û¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¤¹¤°¤Ë±Æ¶Á¤¬µÚ¤Ö¡£ +¤³¤ì¤Ï¥¢¥¯¥»¥¹À©¸æ¤¬¥µ¡¼¥Ð¡¼¾å¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¤¬¡¢ +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Ï¥¯¥é¥¤¥¢¥ó¥È¦¤Ç´ÉÍý¤µ¤ì¤Æ¤¤¤ë¤¿¤á¤Ç¤¢¤ë¡£ +¥¯¥é¥¤¥¢¥ó¥È¦¤Ç¥Õ¥¡¥¤¥ë°À­¤Î¥­¥ã¥Ã¥·¥å¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ÎÀ©¸Â¤ò´Ë¤¯¤¹¤ë¤È¡¢ +¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤Ë¾ðÊó¤¬ÅÁ¤ï¤ë¤Î¤¬ÃÙ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢0 ¤òÊÖ¤¹¡£¼ºÇÔ¤¹¤ë¤È¡¢\-1¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¾¤Î¥¨¥é¡¼¤òÊÖ¤¹¾ì¹ç¤¬¤¢¤ë¡£ +.BR chmod () +¤Ç°ìÈÌŪ¤Ê¥¨¥é¡¼¤ò°Ê²¼¤Ëµó¤²¤ë¡£ +.TP +.B EACCES +¥Ñ¥¹Ì¾¤Î¹½À®Í×ÁǤ˸¡º÷µö²Ä¤¬¤Ê¤¤ +.RB ( path_resolution (7) +¤â¸«¤è)¡£ +.TP +.B EFAULT +.I path +¤¬³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EIO +I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ELOOP +.I path +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.I path +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +¥Ñ¥¹Ì¾¤Î¹½À®Í×ÁǤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EPERM +¼Â¸ú UID ¤¬¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤È°ìÃפ»¤º¡¢¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¤ +(Linux ¤Ç¤Ï +.B CAP_FOWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤)¡£ +.TP +.B EROFS +¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤ßÀìÍÑ (read only) ¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¾å¤Ë¤¢¤ë¡£ +.PP +.BR fchmod () +¤Ç°ìÈÌŪ¤Ê¥¨¥é¡¼¤òµó¤²¤ë: +.TP +.B EBADF +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.I fd +¤¬Í­¸ú¤Ç¤Ê¤¤¡£ +.TP +.B EIO +¾åµ­¤ò»²¾È¡£ +.TP +.B EPERM +¾åµ­¤ò»²¾È¡£ +.TP +.B EROFS +¾åµ­¤ò»²¾È¡£ +.SH ½àµò +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) diff --git a/release/man2/chown.2 b/release/man2/chown.2 new file mode 100644 index 00000000..32acf7a2 --- /dev/null +++ b/release/man2/chown.2 @@ -0,0 +1,329 @@ +.\" 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 2008-06-16 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +chown, fchown, lchown \- ¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤òÊѹ¹¤¹¤ë +.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 +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR fchown (), +.BR lchown (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô (owner) ¤È¥°¥ë¡¼¥×¤òÊѹ¹¤¹¤ë¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë´Ö¤Î°ã¤¤¤Ï¡¢¥Õ¥¡¥¤¥ë¤Î»ØÄê¤Î»ÅÊý¤À¤±¤Ç¤¢¤ë¡£ +.IP * 2 +.BR chown () +¤Ï +.I path +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î½êÍ­¸¢¤òÊѹ¹¤¹¤ë¡£ +.I path +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î¾ì¹ç¤Ï¡¢¥ê¥ó¥¯¤ÎŸ³«¤¬¹Ô¤ï¤ì¤ë¡£ +.IP * +.BR fchown () +¤Ï¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î½êÍ­¸¢¤òÊѹ¹¤¹¤ë¡£ +.IP * +.BR lchown () +¤Ï +.BR chown () +¤ÈƱ¤¸¤À¤¬¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤òŸ³«¤·¤Ê¤¤ÅÀ¤¬°Û¤Ê¤ë¡£ +.PP +Æø¢¤ò»ý¤Ä¥×¥í¥»¥¹ (Linux ¤Ç¤Ï +.B CAP_CHOWN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ä¥×¥í¥»¥¹) ¤À¤±¤¬ +¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤òÊѹ¹¤Ç¤­¤ë¡£ +¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤Ï¡¢¤½¤Î½êÍ­¼Ô¤¬Â°¤·¤Æ¤¤¤ë¥°¥ë¡¼¥×¤Î¤¤¤º¤ì¤«¤Ë +¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Æø¢ (Linux ¤Ç¤Ï +.BR CAP_CHOWN ) +¤ò»ý¤Ä¥×¥í¥»¥¹¤Ï¡¢Ç¤°Õ¤Î¥°¥ë¡¼¥×¤ËÊѹ¹¤Ç¤­¤ë¡£ + +.I owner +¤Þ¤¿¤Ï +.I group +¤Ë \-1 ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¤½¤ì¤é¤Î ID ¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ + +ÈóÆø¢¥æ¡¼¥¶¡¼¤Ë¤è¤ê¼Â¹Ô¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤Þ¤¿¤Ï¥°¥ë¡¼¥×¤¬ +Êѹ¹¤µ¤ì¤¿¾ì¹ç¤Ï +.B S_ISUID +¤È +.B ISGID +¥â¡¼¥É¥Ó¥Ã¥È¤Ï¥¯¥ê¥¢¤µ¤ì¤ë¡£ +POSIX ¤Ï¤³¤ÎÆ°ºî¤ä¥ë¡¼¥È¤¬ +.BR chown () +¤ò¹Ô¤Ê¤Ã¤¿¾ì¹ç¤Ë¤Ä¤¤¤Æ¤ÏÆä˻ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +Linux ¤Ë¤ª¤±¤ëÆ°ºî¤Ï¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë°Í¸¤¹¤ë¡£ +.\" Linux 2.0 ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ç¤ÎÆ°ºî¤Ï +.\" ¾¤Î¥æ¡¼¥¶¡¼¤Î¾ì¹ç¤ÈƱ¤¸¤Ç¤¢¤Ã¤¿¡£ +.\" 2.2 ¤Ç¤Ï¡¢2.2.12 ¤Þ¤Ç¤Ï¡¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Î¾ì¹ç¤Ë¤Ï +.\" ¤³¤ì¤é¤Î¥Ó¥Ã¥È¤Ï¥¯¥ê¥¢¤µ¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£ +.\" 2.2.13 °Ê¹ß¤Ç¤Ï¡¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ç¤ÎÆ°ºî¤Ï +.\" ºÆ¤Ó¾¤Î¥æ¡¼¥¶¡¼¤Î¾ì¹ç¤ÈƱ¤¸¤Ë¤Ê¤Ã¤¿¡£ +È󥰥롼¥×¼Â¹Ô¥Õ¥¡¥¤¥ë +.RB ( S_IXGRP +¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë) ¤Î¾ì¹ç¤Ë¤Ï +.B S_ISGID +¥Ó¥Ã¥È¤Ï¶¯À©¥í¥Ã¥¯ (mandatory locking) ¤ò°ÕÌ£¤·¤Æ¤¤¤ë¡£ +¤½¤·¤Æ¤½¤ì¤Ï +.BR chown () +¤Ç¤Ï¥¯¥ê¥¢¤Ç¤­¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢0 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¾¤Î¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë»ö¤¬¤¢¤ë¡£ +.B chmod +¤Ç°ìÈÌŪ¤Ê¥¨¥é¡¼¤ò°Ê²¼¤Ëµó¤²¤ë¡£ +.TP +.B EACCES +.I path +¤Î¹½À®Í×ÁǤ˸¡º÷µö²Ä (search permission) ¤¬¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È)¡£ +.TP +.B EFAULT +.I path +¤¬³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B ELOOP +.I path +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.I path +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I path +¤Î¹½À®Í×ÁǤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ë½êÍ­¼Ô¤Þ¤¿¤Ï¥°¥ë¡¼¥× (¤â¤·¤¯¤Ï¤½¤ÎξÊý) ¤òÊѹ¹¤¹¤ë¤¿¤á¤Ë +Í׵ᤵ¤ì¤ëµö²Ä (¾åµ­¤ò»²¾È) ¤¬¤Ê¤¤¡£ +.TP +.B EROFS +»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤ßÀìÍÑ (read-only) ¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¾å¤Ë¤¢¤ë¡£ +.PP +.BR fchown () +¤Ç°ìÈÌŪ¤Ê¥¨¥é¡¼¤ò°Ê²¼¤Ëµó¤²¤ë: +.TP +.B EBADF +¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤¬Í­¸ú¤Ç¤Ê¤¤¡£ +.TP +.B EIO +i ¥Î¡¼¥É (inode) ¤òÊѹ¹¤¹¤ëºÝ¤ËÄã¥ì¥Ù¥ë I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ENOENT +¾åµ­¤ò»²¾È¡£ +.TP +.B EPERM +¾åµ­¤ò»²¾È¡£ +.TP +.B EROFS +¾åµ­¤ò»²¾È¡£ +.SH ½àµò +4.4BSD, SVr4, POSIX.1-2001. + +4.4BSD ÈǤǤϥ¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Î¤ß¤¬»ÈÍѤǤ­¤ë +(¤Ä¤Þ¤ê¡¢ÉáÄ̤Υ桼¥¶¡¼¤Ï¥Õ¥¡¥¤¥ë¤ò¼êÊü¤¹¤³¤È¤Ï¤Ç¤­¤Ê¤¤)¡£ +.\" chown(): +.\" SVr4 ¤Ë¤Ï EINVAL, EINTR, ENOLINK, EMULTIHOP ¤òÊÖ¤¹¤Èµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +.\" ENOMEM ¤Ï¤Ê¤¤¡£ +.\" POSIX.1 ¤Ë¤Ï ENOMEM, ELOOP ¤Ë¤Ä¤¤¤Æµ­ºÜ¤Ï¤Ê¤¤¡£ +.\" fchown(): +.\" SVr4 ¤Ë¤Ï¾¤Ë EINVAL, EIO, EINTR, ENOLINK ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Îµ­ºÜ¤¬¤¢¤ë¡£ +.SH Ãí°Õ +.RB ( open (2) +¤ä +.BR mkdir (2) +¤Ê¤É¤Ë¤è¤ê) ¿·¤·¤¤¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤ë¤È¤­¡¢ +¤½¤Î½êÍ­¼Ô¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥æ¡¼¥¶ ID ¤È +Ʊ¤¸¤ËÀßÄꤵ¤ì¤ë¡£ +¤½¤Î¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×¤Ï¤¤¤¯¤Ä¤«¤ÎÍ×°ø¤Ë¤è¤ê·èÄꤵ¤ì¤ë¡£ +¤½¤ÎÍ×°ø¤È¤·¤Æ¤Ï¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¼ïÎà¡¢¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È»þ¤Ë +»ÈÍѤµ¤ì¤¿¥ª¥×¥·¥ç¥ó¡¢¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ç set-group-ID µö²Ä¥Ó¥Ã¥È¤¬ +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤É¤¦¤«¡¢¤¬¤¢¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ +.BR mount (8) +¥ª¥×¥·¥ç¥ó¤Î +.I "\-o\ grpid" +.RI ( "\-o\ bsdgroups" +¤âƱµÁ¸ì) ¤È +.I "\-o\ nogrpid" +.RI ( "\-o sysvgroups" +¤âƱµÁ¸ì) ¤ËÂбþ¤·¤Æ¤¤¤ë¾ì¹ç¡¢¥ë¡¼¥ë¤Ï°Ê²¼¤ÎÄ̤ê¤È¤Ê¤ë¡£ +.IP * 2 +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ +.I "\-o\ grpid" +ÉÕ¤­¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¿·¤·¤¤¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×¤Ï +¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î¥°¥ë¡¼¥×¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ +.IP * +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ +.I "\-o\ nogrpid" +ÉÕ¤­¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤ª¤ê¡¢¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï set-group-ID ¥Ó¥Ã¥È¤¬ +̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢¿·¤·¤¤¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×¤Ï +¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à GID ¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ +.IP * +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ +.I "\-o\ nogrpid" +ÉÕ¤­¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤ª¤ê¡¢¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï set-group-ID ¥Ó¥Ã¥È¤¬ +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢¿·¤·¤¤¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×¤Ï +¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î¥°¥ë¡¼¥×¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ +.PP +Linux 2.6.25 ¤Ç¤Ï¡¢¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó +.I "\-o\ grpid" +¤È +.I "\-o\ nogrpid" +¤ËÂбþ¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï +ext2, ext3, ext4, XFS ¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I "\-o\ nogrpid" +¤Ë´Ø¤¹¤ë¥ë¡¼¥ë¤¬Å¬ÍѤµ¤ì¤ë¡£ +.PP +.BR chown () +Êý¼°¤Ï UID ¥Þ¥Ã¥Ô¥ó¥°¤ò»ÈÍѤ·¤¿ +NFS ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ò¿¯³²¤¹¤ë¡£ +¤µ¤é¤Ë¥Õ¥¡¥¤¥ë¤ÎÆâÍƤ˥¢¥¯¥»¥¹¤¹¤ëÁ´¤Æ¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¿¯³²¤¹¤ë¡£ +¤³¤ì¤Ï +.BR chown () +¤¬´û¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë +¥¢¥¯¥»¥¹¤ò¤¿¤À¤Á¤Ë¼è¤ê¾Ã¤¹¤³¤È¤Ë¤è¤ë¡£ +¥¯¥é¥¤¥¢¥ó¥È¦¤Î¥­¥ã¥Ã¥·¥å¤Ë¤è¤ê½êÍ­¸¢¤¬Êѹ¹¤µ¤ì¤Æ +¥æ¡¼¥¶¡¼¤Î¥¢¥¯¥»¥¹¤¬µö¤·¤¿»þÅÀ¤È¡¢¼ÂºÝ¤Ë¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤Ç¥æ¡¼¥¶¡¼¤Ë¤è¤Ã¤Æ +¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë»þÅÀ¤È¤Î´Ö¤Ë»þ´Öº¹¤¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + +Linux ¤Î 2.1.81 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó (ÆÃ¤Ë 2.1.46 °ÊÁ°) ¤Ç¤Ï¡¢ +.BR chown () +¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤òÄÉÀפ·¤Ê¤¤¡£ +Linux 2.1.81 °Ê¹ß¤Ç¤Ï +.BR chown () +¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤òÄÉÀפ·¡¢¿·¤¿¤Ê¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë +.BR lchown () +¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤òÄÉÀפ·¤Ê¤¤¡£ +Linux 2.1.86 °Ê¹ß¤Ç¤Ï¤³¤Î¿·¤·¤¤¥³¡¼¥ë (¸Å¤¤ +.BR chown () +¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¹Ô¤Ê¤¦) ¤ÏƱ¤¸¥·¥¹¥Æ¥à¥³¡¼¥ëÈÖ¹æ¤ò»ý¤Á +.BR chown () +¤Ï¿·¤·¤¯Æ³Æþ¤µ¤ì¤¿ÈÖ¹æ¤ò»ý¤Ä¡£ +.SH Îã +.PP +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +Æó¤ÄÌܤΥ³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤ò¡¢ +°ì¤ÄÌܤΥ³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿ÃͤËÊѹ¹¤¹¤ë¡£ +¿·¤·¤¤½êÍ­¼Ô¤Ï¡¢¿ô»ú¤Î¥æ¡¼¥¶ 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); + } /* if */ + + exit(EXIT_SUCCESS); +} /* main */ +.fi +.SH ´ØÏ¢¹àÌÜ +.BR chmod (2), +.BR fchownat (2), +.BR flock (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/release/man2/chroot.2 b/release/man2/chroot.2 new file mode 100644 index 00000000..da80c93e --- /dev/null +++ b/release/man2/chroot.2 @@ -0,0 +1,144 @@ +.\" 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-21 by Rik Faith +.\" Modified 1994-08-21 by Michael Chastain +.\" Modified 1996-06-13 by aeb +.\" Modified 1996-11-06 by Eric S. Raymond +.\" 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 2008-06-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +chroot \- ¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int chroot(const char *" path ); +.SH ÀâÌÀ +.BR chroot () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ò +.I path +¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤¹¤ë¡£ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤¬ \fI/\fP ¤«¤é»Ï¤Þ¤ë¥Ñ¥¹Ì¾¤È¤·¤Æ»È¤ï¤ì¤ë¡£ +¤³¤Î¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÁ´¤Æ¤Î»Ò¥×¥í¥»¥¹¤Ë¼õ¤±·Ñ¤¬¤ì¤ë¡£ +.PP +Æø¢¥×¥í¥»¥¹ (Linux ¤Ç¤Ï¡¢ +.B CAP_SYS_CHROOT +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Î¤ß¤¬ +.BR chroot () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +¤³¤Î¥³¡¼¥ë¤Ï¥Ñ¥¹Ì¾²ò·è¤Î²áÄø¤Ç¹½À®Í×ÁǤòÊѹ¹¤¹¤ë¤Î¤ß¤Ç¡¢ +¤½¤Î¾¤Ë¤Ï²¿¤â¹Ô¤ï¤Ê¤¤¡£ +.PP +¤³¤Î¥³¡¼¥ë¤Ï¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê +(working directory) ¤òÊѹ¹¤·¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢¤³¤Î¥³¡¼¥ë¤Î¸å¤Ë \(aq\fI.\fP\(aq ¤¬ \(aq\fI/\fP\(aq ¤ò +º¬¤È¤¹¤ë¥Ä¥ê¡¼¤Î³°¤Ë¤Ê¤ë¾ì¹ç¤¬¤¢¤ë¡£ +Æäˡ¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¤³¤È¤Ç +"chroot jail" ¤«¤éƨ¤²½Ð¤»¤Æ¤·¤Þ¤¦¡£ +.nf + + mkdir foo; chroot foo; cd .. +.fi + +¤³¤Î¥³¡¼¥ë¤Ï¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¤Î¤Ç¡¢ +¤³¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï chroot ¥Ä¥ê¡¼¤Î³°¤Ë¤¢¤ë +¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¾¤Î¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë»ö¤¬¤¢¤ë¡£ +°ìÈÌŪ¤Ê¥¨¥é¡¼¤ò°Ê²¼¤Ëµó¤²¤ë: +.TP +.B EACCES +¥Ñ¥¹Ì¾¤ÎÅÓÃæ¤Î¤É¤³¤«¤Ë¸¡º÷µö²Ä (search permission) ¤¬¤Ê¤¤¡£ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È¡£) +.\" ¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Î¹½À®Í×ÁǤˤ⸡º÷µö²Ä¤¬É¬ÍפǤ¢¤ë¡£ +.\" ¤ª¤½¤é¤¯¡¢¤½¤ì¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤³¤È¤òÊݾڤ¹¤ë¤¿¤á¤Ê¤Î¤«? +.TP +.B EFAULT +.I path +¤¬³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EIO +I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ELOOP +.I path +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.I path +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I path +¤ÎÆâÍƤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·Â¦¤Ë½½Ê¬¤ÊÆø¢¤¬¤Ê¤¤¡£ +.SH ½àµò +SVr4, 4.4BSD, SUSv2 (⤷¡¢SUSv2 ¤Ç¤Ï²áµî¤Î̾»Ä¤È¤µ¤ì¤Æ¤¤¤ë)¡£ +¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +.\" SVr4 ¤Ë¤Ï¾¤Ë EINTR, ENOLINK, EMULTIHOP ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.\" X/OPEN ¤Ë¤Ï EIO, ENOMEM, EFAULT ¥¨¥é¡¼¾õÂ֤ε­½Ò¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤Î¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤Î¾ì¹ç¤â¡¢¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ + +FreeBSD ¤Ë¤Ï¤è¤ê¶¯ÎÏ¤Ê +.BR jail () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤¢¤ë¡£ +.\" FIXME . eventually say something about containers, +.\" virtual servers, etc.? +.SH ´ØÏ¢¹àÌÜ +.BR chdir (2), +.BR path_resolution (7) diff --git a/release/man2/clock_getres.2 b/release/man2/clock_getres.2 new file mode 100644 index 00000000..c12268a5 --- /dev/null +++ b/release/man2/clock_getres.2 @@ -0,0 +1,244 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 2003 Nick Clifford (zaf@nrc.co.nz), Jan 25, 2003 +.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl), Aug 24, 2003 +.\" +.\" 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. +.\" +.\" 2003-08-23 Martin Schulze improvements +.\" 2003-08-24 aeb, large parts rewritten +.\" 2004-08-06 Christoph Lameter , SMP note +.\" +.\" 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" +.SH ̾Á° +clock_getres, clock_gettime, clock_settime \- ¥¯¥í¥Ã¥¯¤È»þ´Ö¤Î´Ø¿ô +.SH ½ñ¼° +.B #include +.sp +.BI "int clock_getres(clockid_t " clk_id ", struct timespec *" res ); + +.BI "int clock_gettime(clockid_t " clk_id ", struct timespec *" tp ); + +.BI "int clock_settime(clockid_t " clk_id ", const struct timespec *" tp ); +.sp +\fI\-lrt\fP ¤È¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR clock_getres (), +.BR clock_gettime (), +.BR clock_settime (): +_POSIX_C_SOURCE\ >=\ 199309L +.ad b +.SH ÀâÌÀ +´Ø¿ô +.BR clock_getres () +¤Ï +»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯ +.I clk_id +¤Îʬ²òǽ (ÀºÅÙ) ¤òõ¤·½Ð¤¹¡£ +.I res +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢¤½¤Îʬ²òǽ¤ò +.I res +¤Ç»Ø¤µ¤ì¤ë \fIstruct timespec\fP ¤Ë³ÊǼ¤¹¤ë¡£ +¥¯¥í¥Ã¥¯¤Îʬ²òǽ¤Ï¼ÂÁõ¤Ë°Í¸¤·¡¢ +ÆÃÄê¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤ÆÀßÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.BR clock_settime () +¤Î°ú¤­¿ô +.I tp +¤Ç»Ø¤µ¤ì¤ë»þ´Ö¤ÎÃͤ¬ +.I res +¤ÎÇÜ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I res +¤ÎÇÜ¿ô¤ËÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.PP +´Ø¿ô +.BR clock_gettime () +¤È +.BR clock_settime () +¤Ï¡¢»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯ +.I clk_id +¤Î»þ´Ö¤ò¼èÆÀ¤Þ¤¿¤ÏÀßÄꤹ¤ë¡£ +.PP +.I res +¤È +.I tp +°ú¤­¿ô¤Ï +.I timespec +¹½Â¤ÂΤǤ¢¤ê¡¢ +.I +¤Ç°Ê²¼¤Î¤è¤¦¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.fi +.in +.PP +.I clk_id +°ú¤­¿ô¤ÏÆÃÄê¤Î¥¯¥í¥Ã¥¯¤Î¼±Ê̻ҤǤ¢¤ê¡¢¤½¤Î¥¯¥í¥Ã¥¯¤ÇÆ°ºî¤¹¤ë¡£ +¥¯¥í¥Ã¥¯¤Ï¥·¥¹¥Æ¥àÁ´ÂΤËŬÍѤ¹¤ë¤³¤È¤â¤Ç¤­¡¢ +¤½¤Î¾ì¹ç¤ÏÁ´¤Æ¤Î¥×¥í¥»¥¹¤«¤é¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤Þ¤¿ 1 ¤Ä¤Î¥×¥í¥»¥¹Æâ¤Ç¤Î¤ß»þ´Ö¤ò·×¬¤¹¤ë¾ì¹ç¤Ï¡¢ +¥×¥í¥»¥¹Ëè¤ËŬÍѤ¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.LP +Á´¤Æ¤Î¼ÂÁõ¤Ë¤ª¤¤¤Æ¥·¥¹¥Æ¥àÁ´ÂΤΥꥢ¥ë¥¿¥¤¥à¥¯¥í¥Ã¥¯¤¬¥µ¥Ý¡¼¥È¤µ¤ì¡¢ +.B CLOCK_REALTIME +¤Ç¼±Ê̤µ¤ì¤ë¡£ +»þ´Ö¤Ïµª¸µ (the Epoch) ¤«¤é¤ÎÉäȥʥÎÉäÇɽ¤µ¤ì¤ë¡£ +»þ´Ö¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¡¢ÁêÂÐŪ¤Ê»þ´Ö´Ö³Ö¤Î¥¿¥¤¥Þ¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¤¬¡¢ +ÀäÂÐŪ¤Ê»þÅÀ¤Î¥¿¥¤¥Þ¤Ï±Æ¶Á¤ò¼õ¤±¤ë¡£ +.LP +¤µ¤é¤Ë¤¤¤¯¤Ä¤«¤Î¥¯¥í¥Ã¥¯¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +Âбþ¤¹¤ë»þ´Ö¤ÎÃͤò²ò¼á¤¹¤ëÊýË¡¤È¥¿¥¤¥Þ¤Ø¤Î±Æ¶Á¤Ï¡¢Äê¤á¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +.LP +glibc ¤È Linux ¥«¡¼¥Í¥ë¤ÎºÇ¿·¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ +°Ê²¼¤Î¤è¤¦¤Ê½½Ê¬¤Ê¥¯¥í¥Ã¥¯¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B CLOCK_REALTIME +¥·¥¹¥Æ¥àÁ´ÂΤΥꥢ¥ë¥¿¥¤¥à¥¯¥í¥Ã¥¯¡£ +¤³¤Î¥¯¥í¥Ã¥¯¤òÀßÄꤹ¤ë¤Ë¤ÏŬÀÚ¤ÊÆø¢¤¬É¬ÍפǤ¢¤ë¡£ +.TP +.B CLOCK_MONOTONIC +¤¤¤¯¤Ä¤«¤Î³«»ÏÅÀ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤¿¤á¡¢ +¥¯¥í¥Ã¥¯¤¬¥â¥Î¥È¥Ë¥Ã¥¯¥¿¥¤¥à¤òÀßÄꤷ¤¿¤êɽ¸½¤·¤¿¤ê¤Ç¤­¤Ê¤¤¡£ +.TP +.BR CLOCK_MONOTONIC_RAW " (Linux 2.6.28 °Ê¹ß; Linux ÆÃÍ­)" +.\" Added in commit 2d42244ae71d6c7b0884b5664cf2eda30fb2ae68, John Stultz +.B CLOCK_MONOTONIC +¤ÈƱÍͤÀ¤¬¡¢NTP ¤Ë¤è¤ëÄ´À°¤Î±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡¢¥Ï¡¼¥É¥¦¥§¥¢¤Ë¤è¤ë +À¸¤Î»þ¹ï¤Ø¤Î¥¢¥¯¥»¥¹¤¬¤Ç¤­¤ë¡£ +.TP +.B CLOCK_PROCESS_CPUTIME_ID +CPU ¤Ë¤è¤ë¹âʬ²òǽ¤Î¥×¥í¥»¥¹Ëè¤Î¥¿¥¤¥Þ¡£ +.TP +.B CLOCK_THREAD_CPUTIME_ID +¥¹¥ì¥Ã¥É¸ÇÍ­¤Î CPU ¥¿¥¤¥à¥¯¥í¥Ã¥¯¡£ +.SH ÊÖ¤êÃÍ +.BR clock_gettime (), +.BR clock_settime (), +.BR clock_getres () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤·¤¿¾ì¹ç¤Ë \-1 ¤òÊÖ¤¹ +(¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë)¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I tp +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤¿¡£ +.TP +.B EINVAL +.\" 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 +»Ø¼¨¤µ¤ì¤¿¥¯¥í¥Ã¥¯¤òÀßÄꤹ¤ë¸¢¸Â¤¬ +.BR clock_settime () +¤Ë¤Ê¤¤¡£ +.SH ½àµò +SUSv2, POSIX.1-2001. +.SH ²ÄÍÑÀ­ +¤³¤ì¤é¤Î´Ø¿ô¤¬ÍøÍѲÄǽ¤Ê POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢\fI\fP ¤Ë¤ª¤¤¤Æ¥·¥ó¥Ü¥ë +.B _POSIX_TIMERS +¤¬ 0 ¤è¤êÂ礭¤¤ÃͤËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¥·¥ó¥Ü¥ë +.BR _POSIX_MONOTONIC_CLOCK , +.BR _POSIX_CPUTIME , +.B _POSIX_THREAD_CPUTIME +¤Ï +.BR CLOCK_MONOTONIC , +.BR CLOCK_PROCESS_CPUTIME_ID , +.B CLOCK_THREAD_CPUTIME_ID +¤¬ÍøÍѲÄǽ¤Ê¤³¤È¤ò¼¨¤¹¡£ +.RB ( sysconf (3) +¤â»²¾È¤¹¤ë¤³¤È¡£) +.SH Ãí°Õ +.SS "SMP ¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ¤ÎÃí°Õ" +.B CLOCK_PROCESS_CPUTIME_ID +¤È +.B CLOCK_THREAD_CPUTIME_ID +¥¯¥í¥Ã¥¯¤Ï¡¢CPU ¤«¤é¤Î¥¿¥¤¥Þ +(i386 ¾å¤Î TSC¡¢Itanium ¾å¤Î AR.ITC) ¤òÍѤ¤¤Æ¼Â¸½¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥ì¥¸¥¹¥¿¤Ï CPU ´Ö¤Ç°Û¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ê¡¢ +¥×¥í¥»¥¹¤¬Â¾¤Î CPU ¤Ë°ÜÆ°¤µ¤»¤é¤ì¤¿¾ì¹ç¡¢ +·ë²Ì¤È¤·¤Æ¤³¤ì¤é¤Î¥¯¥í¥Ã¥¯¤¬\fBµ¶¤Î·ë²Ì\fR +(bogus results) ¤òÊÖ¤¹¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +SMP ¥·¥¹¥Æ¥à¤Î³Æ CPU ¤¬ÊÌ¡¹¤Î¥¯¥í¥Ã¥¯¸»¤ò»ý¤Ä¾ì¹ç¡¢ +¥¿¥¤¥Þ¥ì¥¸¥¹¥¿´Ö¤ÎÁê¸ß´Ø·¸¤ò´ÉÍý¤¹¤ëÊýË¡¤Ï¤Ê¤¤¡£ +¤³¤ì¤Ï³Æ CPU ¤¬Èù̯¤Ë°Û¤Ê¤ë¼þÇÈ¿ô¤ÇÆ°ºî¤¹¤ë¤¿¤á¤Ç¤¢¤ë¡£ +¤³¤ì¤¬¿¿¼Â¤Î¾ì¹ç (ÌõÃð: ³Æ CPU ¤¬ÊÌ¡¹¤Î¥¯¥í¥Ã¥¯¸»¤ò»ý¤Ä¾ì¹ç)¡¢ +.I clock_getcpuclockid(0) +¤Ï +.B ENOENT +¤òÊÖ¤·¤Æ¡¢¤½¤Î¾õ¶·¤òɽ¤¹¡£ +2 ¤Ä¤Î¥¯¥í¥Ã¥¯¤Ï¡¢¥×¥í¥»¥¹¤¬ÆÃÄê¤Î CPU ¾å¤Ëα¤Þ¤Ã¤Æ¤¤¤ë¤³¤È¤¬ +ÊݾڤǤ­¤ë¾ì¹ç¤Ë¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +.PP +SMP ¥·¥¹¥Æ¥à¤Î³Æ¥×¥í¥»¥Ã¥µ¤ÏÁ´¤¯Æ±¤¸»þ¹ï¤Ëµ¯Æ°¤¹¤ëÌõ¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢ +³Æ¥¿¥¤¥Þ¥ì¥¸¥¹¥¿¤ÏÄ̾ï¤Ï¤¢¤ë¥ª¥Õ¥»¥Ã¥È¤ÇÆ°ºî¤·¤Æ¤¤¤ë¡£ +¥ª¥Õ¥»¥Ã¥È¤ò¥Ö¡¼¥È»þ¤ËÀ©¸Â¤¹¤ë¥³¡¼¥É¤¬´Þ¤Þ¤ì¤ë¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤â¤¢¤ë¡£ +¤·¤«¤·¡¢¤³¤Î¥³¡¼¥É¤¬¥ª¥Õ¥»¥Ã¥È¤òÀµ³Î¤ËÄ´À°¤¹¤ë¤³¤È¤ÏÊݾڤǤ­¤Ê¤¤¡£ +glibc ¤Ï (Linux ¥«¡¼¥Í¥ë¤È¤Ï°Û¤Ê¤ê) ¥ª¥Õ¥»¥Ã¥È¤ò°·¤¦¤¿¤á¤Î¥³¡¼¥É¤òÄ󶡤·¤Ê¤¤¡£ +Ä̾ï¤Ï¤³¤ì¤é¤Î¥ª¥Õ¥»¥Ã¥È¤¬¾®¤µ¤¤¤Î¤Ç¡¢Â¿¤¯¤Î¾ì¹ç¤Ç¤½¤Î±Æ¶Á¤Ï̵»ë¤Ç¤­¤ë¡£ +.SH ¥Ð¥° +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 +.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) diff --git a/release/man2/clock_nanosleep.2 b/release/man2/clock_nanosleep.2 new file mode 100644 index 00000000..efd50afe --- /dev/null +++ b/release/man2/clock_nanosleep.2 @@ -0,0 +1,245 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 +.\" +.TH CLOCK_NANOSLEEP 2 2008-07-09 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +clock_nanosleep \- »ØÄꤷ¤¿¥¯¥í¥Ã¥¯¤Ç¤Î¹âÀºÅ٤ʼ¹ÔÄä»ß (sleep) +.SH ½ñ¼° +.B #include +.nf +.sp +.BI "int clock_nanosleep(clockid_t " clock_id ", int " flags , +.BI " const struct timespec *" request , +.BI " struct timespec *" remain ); +.fi +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR clock_nanosleep (): +_XOPEN_SOURCE\ >=\ 600 +.SH ÀâÌÀ +.BR clock_nanosleep () +¤ò»È¤¦¤È¡¢ +.BR nanosleep (2) +ƱÍÍ¡¢¥Ê¥ÎÉäÎÀºÅ٤ǻØÄꤵ¤ì¤¿´ü´Ö¤À¤±¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤ò +Ää»ß¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR nanosleep (2) +¤È°ã¤¦¤Î¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¤¬Ää»ß´ü´Ö¤ò¤É¤Î¥¯¥í¥Ã¥¯¤ËÂФ·¤Æ·×¬¤¹¤ë¤Î¤«¤òÁªÂò +¤Ç¤­¤ëÅÀ¤È¡¢Ää»ß´ü´Ö¤òÀäÂÐÃͤǤâÁêÂÐÃͤǤâ»ØÄê¤Ç¤­¤ëÅÀ¤Ç¤¢¤ë¡£ + +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ·¤¿¤ê¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÊÖ¤·¤¿¤ê¤¹¤ë»þ´Ö¤ÎÃÍ¤Ï +.I timespec +¹½Â¤ÂΤò»È¤Ã¤Æ»ØÄꤵ¤ì¤ë¡£¤³¤Î¹½Â¤ÂΤÎÄêµÁ¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.sp +.in +4n +.nf +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds [0 .. 999999999] */ +}; +.fi +.in + +.I clock_id +°ú¤­¿ô¤Ç¡¢Ää»ß´ü´Ö¤ò¤É¤Î¥¯¥í¥Ã¥¯¤ËÂФ·¤Æ·×¬¤¹¤ë¤«¤ò»ØÄꤹ¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ë¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤ò»ØÄê¤Ç¤­¤ë¡£ +.TP 17 +.BR CLOCK_REALTIME +¥·¥¹¥Æ¥àÁ´ÂΤǻȤï¤ì¤ë¼Â»þ´Ö¥¯¥í¥Ã¥¯¡£ +¤³¤Î¥¯¥í¥Ã¥¯¤ÏÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +.TP +.BR CLOCK_MONOTONIC +²áµî¤Î¤¢¤ë»þÅÀ¤«¤é¤Î»þ´Ö¤ò·×¬¤¹¤ë¡¢Ã±Ä´Áý²Ã¤Î¥¯¥í¥Ã¥¯¡£ +µ¯ÅÀ¤È¤Ê¤ë»þÅÀ¤Ï¥·¥¹¥Æ¥àµ¯Æ°¸å¤Ë¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +¤³¤Î¥¯¥í¥Ã¥¯¤ÏÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.\" Linux ¤Ç¤Ï¡¢¤³¤Î¥¯¥í¥Ã¥¯¤Ïµ¯Æ°¤«¤é¤Î»þ´Ö¤ò·×¬¤¹¤ë¡£ +.TP +.BR CLOCK_PROCESS_CPUTIME_ID +¤½¤Î¥×¥í¥»¥¹¤ÎÁ´¥¹¥ì¥Ã¥É¤Ç¾ÃÈñ¤µ¤ì¤ë CPU »þ´Ö¤ò·×¬¤¹¤ë¥×¥í¥»¥¹Ã±°Ì¤Î +¥¯¥í¥Ã¥¯¡£¤³¤Î¥¯¥í¥Ã¥¯¤ÏÀßÄê²Äǽ¤Ç¤¢¤ë¡£ +.\" There is some trickery between glibc and the kernel +.\" to deal with the CLOCK_PROCESS_CPUTIME_ID case. +.PP +¤³¤ì¤é¤Î¥¯¥í¥Ã¥¯¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR clock_getres (2) +¤ò»²¾È¡£ + +.I flags +¤¬ 0 ¤Î¾ì¹ç¡¢ +.I request +¤Ë»ØÄꤵ¤ì¤¿ÃÍ¤Ï +.I clock_id +¤Ç»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯¤Î¸½ºß¤ÎÃͤ«¤é¤ÎÁêÂÐŪ¤Ê´ü´Ö¤È²ò¼á¤µ¤ì¤ë¡£ + +.I flags +¤¬ +.B TIMER_ABSTIME +¤Î¾ì¹ç¡¢ +.I request +¤Ï»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯¤Ç·×¬¤µ¤ì¤ëÀäÂлþ¹ï¤È²ò¼á¤µ¤ì¤ë¡£ +.I request +¤¬»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯¤Î¸½ºß¤ÎÃͰʲ¼¤Î¾ì¹ç¡¢ +.BR clock_nanosleep () +¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤ÎÄä»ß¤ò¹Ô¤ï¤º¡¢¤¹¤°¤ËÊ֤롣 + +.BR clock_nanosleep () +¤Ï¡¢¾¯¤Ê¤¯¤È¤â +.I request +¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¤¬·Ð²á¤¹¤ë¤Þ¤Ç¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤òÄä»ß¤¹¤ë¡£ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¤ê¡¢¤½¤Î¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë¤è¤¦¤Ê +¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤¿¤ê¤·¤¿¾ì¹ç¤Ë¤â¡¢¥¹¥ì¥Ã¥É¤Î¼Â¹ÔÄä»ß¤Ï½ªÎ»¤¹¤ë¡£ + +¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢ +.BR clock_nanosleep () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B EINTR +¤òÀßÄꤹ¤ë¡£¤½¤ì¤Ë²Ã¤¨¤Æ¡¢ +.I remain +¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä +.I flags +¤¬ +.B TIMER_ABSTIME +¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +.I remain +¤Ë»Ä¤ê¤ÎÄä»ß»þ´Ö¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤ÎÃͤò»È¤Ã¤Æ +.BR clock_nanosleep () +¤òºÆÅٸƤӽФ¹¤³¤È¤Ç¡¢(ÁêÂÐŪ¤Ê´ü´Ö¤Î) Ää»ß¤ò´°Î»¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ÊÖ¤êÃÍ +Í׵ᤵ¤ì¤¿´ü´Ö¤ÎÄä»ß¤ËÀ®¸ù¤¹¤ë¤È¡¢ +.BR clock_nanosleep () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ç³ä¤ê¹þ¤Þ¤ì¤¿¤ê¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤ê¤·¤¿¾ì¹ç¡¢ +Àµ¤Î¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I request +¤ä +.I remain +¤Ë̵¸ú¤Ê¥¢¥É¥ì¥¹¤¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B EINTR +Ää»ß¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.TP +.B EINVAL +.I tv_nsec +¥Õ¥£¡¼¥ë¥É¤ÎÃͤ¬ 0 ¤«¤é 999999999 ¤ÎÈϰϤǤʤ¤¤«¡¢ +.I tv_sec +¤ÎÃͤ¬Éé¤Ç¤¢¤Ã¤¿¡£ +.TP +.B EINVAL +.I clock_id +¤¬Ìµ¸ú¤Ç¤¢¤Ã¤¿ +.RB ( CLOCK_THREAD_CPUTIME_ID +¤¬ +.I clock_id +¤È¤·¤ÆÍ­¸ú¤ÊÃͤǤϤʤ¤)¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR clock_nanosleep () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +glibc ¤Ç¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.I request +¤Ç»ØÄꤵ¤ì¤¿Ää»ß´ü´Ö¤¬¡¢»þ´Ö¤Î·×¬¤Ë»ÈÍѤµ¤ì¤ë¥¯¥í¥Ã¥¯ +.RB ( time (7) +»²¾È) ¤ÎÀºÅÙ¤ÎÇÜ¿ô¤Á¤ç¤¦¤É¤Ç¤Ê¤¤¾ì¹ç¡¢Ää»ß´ü´Ö¤Ï°ìÈֶᤤ¼¡¤ÎÇÜ¿ô¤Ë +ÀÚ¤ê¾å¤²¤é¤ì¤ë¡£¤µ¤é¤Ë¡¢Ää»ß¤¬´°Î»¤·¤¿¸å¤Ë¡¢CPU ¤¬¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤ò +¤â¤¦°ìÅټ¹ԤǤ­¤ë¤è¤¦¤Ë¤Ê¤ë¤Þ¤Ç¤Ë¤Ï¡¢Ãٱ䤬Æþ¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ + +ÀäÂÐÃÍ»ØÄê¤Î¥¿¥¤¥Þ¤ò»È¤¦¤Î¤Ï¡¢ +.BR nanosleep (2) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ëÎà¤Î¥¿¥¤¥Þ¤Î¤º¤ì¤ÎÌäÂê¤òËɻߤ¹¤ë¤Î¤ËÌòΩ¤Ä +(¤³¤Î¼ï¤ÎÌäÂê¤Ï¡¢¥·¥°¥Ê¥ë¤Ë³ä¤ê¹þ¤Þ¤ì¤¿ºÝ¤ËÁêÂлØÄê¤ÎÄä»ß¤ò +·«¤êÊÖ¤·ºÆ³«¤·¤è¤¦¤È¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¤«¤¨¤Ã¤Æ°­²½¤¹¤ë)¡£ +¤³¤ì¤é¤ÎÌäÂê¤ò²óÈò¤·¤ÆÁêÂлØÄê¤ÎÄä»ß¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢ +´õ˾¤¹¤ë¥¯¥í¥Ã¥¯¤Ç +.BR clock_gettime (2) +¤ò¸Æ¤Ó½Ð¤·¡¢¤½¤ÎÊÖ¤êÃͤλþ¹ïÃͤ˴õ˾¤¹¤ë´ü´Ö¤ò²Ã»»¤·¤Æ¤«¤é¡¢ +.B TIMER_ABSTIME +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ +.BR clock_nanosleep () +¤ò¸Æ¤Ó½Ð¤¹¡£ + +.BR sigaction (2) +¤Ç +.BR SA_RESTART +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤«¤Ë´Ø¤ï¤é¤º¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¸å¤Ë +.BR clock_nanosleep () +¤¬ºÆ³«¤µ¤ì¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£ + +.I flags +¤¬ +.B TIMER_ABSTIME +¤Î¾ì¹ç¡¢ +.I remain +°ú¤­¿ô¤Ï»ÈÍѤµ¤ì¤º¡¢ÉÔÍפǤ¢¤ë +(ÀäÂÐÃͤǤÎÄä»ß¤Ç¤Ï¡¢Æ±¤¸ +.I request +°ú¤­¿ô¤ò»È¤Ã¤ÆºÆÅٸƤӽФ¹¤³¤È¤¬¤Ç¤­¤ë)¡£ + +POSIX.1 ¤Îµ¬Äê¤Ç¤Ï¡¢ +.BR clock_nanosleep () +¤Ï¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤ä¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡¢¤È¤µ¤ì¤Æ¤¤¤ë¡£ + +POSIX.1 ¤Îµ¬Äê¤Ç¤Ï¡¢ +.BR clock_settime (2) +¤Ç +.B CLOCK_REALTIME +¥¯¥í¥Ã¥¯¤ÎÃͤòÊѹ¹¤·¤¿¸å¤Ï¡¢ÀäÂÐÃÍ»ØÄê¤Î +.BR clock_nanosleep () +¤ÇÄä»ß¤·¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¤òµ¯Æ°¤µ¤»¤ë»þ¹ï¤ÎȽÄê¤Ï¡¢ +¿·¤·¤¤¥¯¥í¥Ã¥¯Ãͤò»È¤Ã¤Æ¹Ô¤ï¤ì¤ë¡¢¤È¤µ¤ì¤Æ¤¤¤ë¡£ +¿·¤·¤¤¥¯¥í¥Ã¥¯Ãͤˤª¤¤¤ÆÄä»ß´ü´Ö¤Î½ªÎ»»þ¹ï¤¬²áµî¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +.BR clock_nanosleep () +¤Ï¤¹¤°¤ËÊ֤뤳¤È¤Ë¤Ê¤ë¡£ + +POSIX.1 ¤Îµ¬Äê¤Ç¤Ï¡¢ +.BR clock_settime (2) +¤Ç +.B CLOCK_REALTIME +¥¯¥í¥Ã¥¯¤ÎÃͤòÊѹ¹¤·¤Æ¤â¡¢ÁêÂÐÃÍ»ØÄê¤Î +.BR clock_nanosleep () +¤ÇÄä»ß¤·¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¤Ë¤Ï±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡¢¤È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR clock_getres (2), +.BR nanosleep (2), +.BR timer_create (2), +.BR sleep (3), +.BR usleep (3), +.BR time (7) diff --git a/release/man2/clone.2 b/release/man2/clone.2 new file mode 100644 index 00000000..e53f8eae --- /dev/null +++ b/release/man2/clone.2 @@ -0,0 +1,1018 @@ +.\" 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 2009-07-18 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +clone, __clone2 \- »Ò¥×¥í¥»¥¹¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.\" 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 +.SH ÀâÌÀ +.BR clone () +¤Ï +.BR fork (2) +¤ÈƱ¤¸¤è¤¦¤ÊÊýË¡¤Ç¿·¤·¤¤¥×¥í¥»¥¹¤òºîÀ®¤¹¤ë¡£ +.BR clone () +¤Ë¤Ï¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤½¤Î²¼Áؤˤ¢¤¿¤ë +.BR clone () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¡£°Ê²¼¤ÎÀâÌÀ¤Ç¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÊý¤ò +.B sys_clone +¤Èɽ¤¹¤³¤È¤È¤¹¤ë¡£ +.B sys_clone +¤Ë´Ø¤¹¤ëÀâÌÀ¤Ï¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤ÎºÇ¸å¤ÎÊý¤Ë¤¢¤ë¡£ + +.BR fork (2) +¤È¤Ï°Û¤Ê¤ê¡¢¤³¤ì¤é¤Î¥³¡¼¥ë¤Ç¤Ï¡¢»Ò¥×¥í¥»¥¹ (child process) +¤È¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È¤¬¡¢¥á¥â¥ê¶õ´Ö¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥Æ¡¼¥Ö¥ë¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤Î¥Æ¡¼¥Ö¥ë¤Ê¤É¤Î +¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Î°ìÉô¤ò¶¦Í­¤Ç¤­¤ë¡£ +(¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤ª¤±¤ë¡Ö¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¡×¤Ï¡¢Ä̾ï¤Ï +¡Ö¿Æ¥×¥í¥»¥¹¡×¤È°ìÃפ¹¤ë¡£Ã¢¤·¡¢¸å½Ò¤Î +.B CLONE_PARENT +¤Î¹à¤â»²¾È¤Î¤³¤È) + +.BR clone () +¤Î¼çÍפʻÈÍÑË¡¤Ï¥¹¥ì¥Ã¥É (threads) ¤ò¼ÂÁõ¤¹¤ë¤³¤È¤Ç¤¢¤ë: +°ì¤Ä¤Î¥×¥í¥°¥é¥à¤ÎÃæ¤ÎÊ£¿ô¤Î¥¹¥ì¥Ã¥É¤Ï¶¦Í­¤µ¤ì¤¿¥á¥â¥ê¶õ´Ö¤Ç +Ʊ»þ¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ + +.BR clone () +¤Ç»Ò¥×¥í¥»¥¹¤¬ºîÀ®¤µ¤ì¤¿»þ¤Ë¡¢ºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï´Ø¿ô +.IR fn ( arg ) +¤ò¼Â¹Ô¤¹¤ë¡£ +(¤³¤ÎÅÀ¤¬ +.BR fork (2) +¤È¤Ï°Û¤Ê¤ë¡£ +.BR fork (2) +¤Î¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï +.BR fork (2) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì½ê¤«¤é¼Â¹Ô¤ò³¤±¤ë¡£) +.I fn +°ú¤­¿ô¤Ï¡¢»Ò¥×¥í¥»¥¹¤¬¼Â¹Ô¤ò»Ï¤á¤ë»þ¤Ë»Ò¥×¥í¥»¥¹¤¬¸Æ¤Ó½Ð¤¹ +´Ø¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I arg +°ú¤­¿ô¤Ï¤½¤Î¤Þ¤Þ +.I fn +´Ø¿ô¤Ø¤ÈÅϤµ¤ì¤ë¡£ + +.IR fn ( arg ) +´Ø¿ô¤¬½ªÎ»¤¹¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤Ï½ªÎ»¤¹¤ë¡£ +.I fn +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤¿À°¿ô¤¬»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥³¡¼¥É¤È¤Ê¤ë¡£ +»Ò¥×¥í¥»¥¹¤Ï¡¢ +.BR exit (2) +¤ò¸Æ¤ó¤ÇÌÀ¼¨Åª¤Ë½ªÎ»¤¹¤ë¤³¤È¤â¤¢¤ë¤·¡¢Ã×̿Ū¤Ê¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤¿ +¾ì¹ç¤Ë½ªÎ»¤¹¤ë¤³¤È¤â¤¢¤ë¡£ + +.I child_stack +°ú¤­¿ô¤Ï¡¢»Ò¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¥¹¥¿¥Ã¥¯¤Î°ÌÃÖ¤ò»ØÄꤹ¤ë¡£ +»Ò¥×¥í¥»¥¹¤È¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ï¥á¥â¥ê¤ò¶¦Í­¤¹¤ë¤³¤È¤¬¤¢¤ë¤¿¤á¡¢ +»Ò¥×¥í¥»¥¹¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸¥¹¥¿¥Ã¥¯¤Ç¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +¤³¤Î¤¿¤á¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ï»Ò¥×¥í¥»¥¹¤Î¥¹¥¿¥Ã¥¯¤Î¤¿¤á¤Î¥á¥â¥ê¶õ´Ö¤ò +ÍÑ°Õ¤·¤Æ¡¢¤³¤Î¶õ´Ö¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò +.BR clone () +¤ØÅϤµ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +(HP PA ¥×¥í¥»¥Ã¥µ°Ê³°¤Î) Linux ¤¬Æ°ºî¤¹¤ëÁ´¤Æ¤Î¥×¥í¥»¥Ã¥µ¤Ç¤Ï¡¢ +¥¹¥¿¥Ã¥¯¤Ï²¼Êý (¥¢¥É¥ì¥¹¤¬¾®¤µ¤¤Êý¸þ) ¤Ø¤È¿­¤Ó¤ë¡£¤³¤Î¤¿¤á¡¢ÉáÄÌ¤Ï +.I child_stack +¤Ï»Ò¥×¥í¥»¥¹¤Î¥¹¥¿¥Ã¥¯¤Î¤¿¤á¤ËÍÑ°Õ¤·¤¿¥á¥â¥ê¶õ´Ö¤Î°ìÈÖÂ礭¤¤ +¥¢¥É¥ì¥¹¤ò»Ø¤¹¤è¤¦¤Ë¤¹¤ë¡£ + +.I flags +¤Î²¼°Ì 1 ¥Ð¥¤¥È¤Ï»Ò¥×¥í¥»¥¹¤¬»à¤ó¤À¾ì¹ç¤Ë¿Æ¥×¥í¥»¥¹¤Ø¤ÈÁ÷¤é¤ì¤ë +.I "½ªÎ»¥·¥°¥Ê¥ë (termination signal)" +¤ÎÈÖ¹æ¤ò»ØÄꤹ¤ë¡£¤³¤Î¥·¥°¥Ê¥ë¤È¤·¤Æ +.B SIGCHLD +°Ê³°¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¿Æ¥×¥í¥»¥¹¤Ï¡¢ +.BR wait (2) +¤Ç»Ò¥×¥í¥»¥¹¤òÂԤĺݤˡ¢¥ª¥×¥·¥ç¥ó¤È¤·¤Æ +.B __WALL +¤Þ¤¿¤Ï +.B __WCLONE +¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤É¤Î¥·¥°¥Ê¥ë¤â»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿»þ¤Ë¿Æ¥×¥í¥»¥¹ +¤Ë¥·¥°¥Ê¥ë¤ÏÁ÷¤é¤ì¤Ê¤¤¡£ + +.I flags +¤Ë¤Ï¡¢°Ê²¼¤ÎÄê¿ô¤Î¤¦¤Á 0¸Ä°Ê¾å¤ò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýÏ (bitwise-or) +¤ò¤È¤Ã¤¿¤â¤Î¤ò»ØÄê¤Ç¤­¤ë¡£¤³¤ì¤é¤ÎÄê¿ô¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È +»Ò¥×¥í¥»¥¹¤Î´Ö¤Ç²¿¤ò¶¦Í­¤¹¤ë¤«¤ò»ØÄꤹ¤ë: +.TP +.BR CLONE_CHILD_CLEARTID " (Linux 2.5.49 °Ê¹ß)" +»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¤È¤­¤Ë»Ò¥×¥í¥»¥¹¤Î¥á¥â¥êÆâ¤Î +.I ctid +¤¬»Ø¤¹¾ì½ê¤Ë¤¢¤ë»Ò¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥É ID ¤ò¾Ãµî¤·¡¢ +¤½¤Î¥¢¥É¥ì¥¹¤Ç futex ¤ò wake (µ¯¾²) ¤µ¤»¤ë¡£ +¤³¤Î¥¢¥É¥ì¥¹¤Ï +.BR set_tid_address (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÇÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Îµ¡Ç½¤Ï¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤Ç»ÈÍѤµ¤ì¤ë¡£ +.TP +.BR CLONE_CHILD_SETTID " (Linux 2.5.49 °Ê¹ß)" +»Ò¥×¥í¥»¥¹¤Î¥á¥â¥êÆâ¤Î +.I ctid +¤¬»Ø¤¹¾ì½ê¤Ë»Ò¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥É ID ¤ò³ÊǼ¤¹¤ë¡£ +.TP +.B CLONE_FILES +.B CLONE_FILES +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î +¥Æ¡¼¥Ö¥ë¤ò¶¦Í­¤¹¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤È¤½¤Î»Ò¥×¥í¥»¥¹¤Î°ìÊý¤¬ºîÀ®¤·¤¿ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤â¤¦°ìÊý¤Ë¤ª¤¤¤Æ¤âÍ­¸ú¤Ç¤¢¤ë¡£ +Ʊ¤¸¤è¤¦¤Ë¡¢°ìÊý¤Î¥×¥í¥»¥¹¤¬¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊĤ¸¤¿¤ê¡¢ +.RB ( fcntl (2) +.B F_SETFD +Áàºî¤ò»È¤Ã¤Æ) ¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë´ØÏ¢¤¹¤ë¥Õ¥é¥°¤òÊѹ¹¤·¤¿¤ê¤¹¤ë¤È¡¢ +¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤â±Æ¶Á¤¹¤ë¡£ + +.B CLONE_FILES +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï¡¢ +.BR clone () +¤¬¼Â¹Ô¤µ¤ì¤¿»þÅÀ¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ëÁ´¤Æ¤Î +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë +(»Ò¥×¥í¥»¥¹¤ÎÊ£À½¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢ +Âбþ¤¹¤ë¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤È +Ʊ¤¸¥Õ¥¡¥¤¥ëµ­½Ò +.RB ( open (2) +»²¾È) ¤ò»²¾È¤¹¤ë)¡£ +¤³¤ì°Ê¹ß¤Ë¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Î°ìÊý¤¬ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÁàºî (¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î +¥ª¡¼¥×¥ó¡¦¥¯¥í¡¼¥º¤ä¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Õ¥é¥°¤ÎÊѹ¹) +¤ò¹Ô¤Ã¤Æ¤â¡¢¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤Ï±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡£ +.TP +.B CLONE_FS +.B CLONE_FS +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤¬Æ±¤¸¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +¾ðÊó¤ò¶¦Í­¤¹¤ë¡£¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¾ðÊó¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¥ë¡¼¥È (root)¡¢ +¥«¥ì¥ó¥È¡¦¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê (current working directory) +¤ä umask ¤Ê¤É¤Ç¤¢¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ä»Ò¥×¥í¥»¥¹¤Î¤É¤Á¤é¤«°ìÊý¤Ë¤è¤Ã¤Æ +.BR chroot (2), +.BR chdir (2), +.BR umask (2) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤È¡¢¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤â±Æ¶Á¤¬µÚ¤Ö¡£ + +.B CLONE_FS +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï¡¢ +.BR clone () +¤¬¼Â¹Ô¤µ¤ì¤¿»þÅÀ¤Ç¤Î¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¾ðÊó¤Î¥³¥Ô¡¼¤ò +»ÈÍѤ¹¤ë¡£ +¤³¤ì°Ê¹ß¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Î°ìÊý¤¬ +.BR chroot (2), +.BR chdir (2), +.BR umask (2) +¤ò¸Æ¤Ó½Ð¤·¤Æ¤â¡¢¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤Ï±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡£ +.TP +.BR CLONE_IO " (Linux 2.6.25 °Ê¹ß)" +.B CLONE_IO +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¿·¤·¤¤¥×¥í¥»¥¹¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È +I/O ¥³¥ó¥Æ¥­¥¹¥È¤ò¶¦Í­¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +.RB ( fork (2) +¤Î¾ì¹ç¤ÈƱÍÍ) ¿·¤·¤¤¥×¥í¥»¥¹¤Ï¼«Ê¬ÀìÍѤΠI/O ¥³¥ó¥Æ¥­¥¹¥È¤ò»ý¤Ä¡£ + +.\" The following based on text from Jens Axboe +I/O ¥³¥ó¥Æ¥­¥¹¥È¤Ï¡¢¥Ç¥£¥¹¥¯¥¹¥±¥¸¥å¡¼¥ë¤Î I/O ¥¹¥³¡¼¥×¤Ç¤¢¤ë +(¸À¤¤´¹¤¨¤ë¤È¡¢I/O ¥³¥ó¥Æ¥­¥¹¥È¤Ï I/O ¥¹¥±¥¸¥å¡¼¥é¤¬¥×¥í¥»¥¹ I/O ¤Î +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ò¥â¥Ç¥ë²½¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë)¡£ +Ê£¿ô¤Î¥×¥í¥»¥¹¤¬Æ±¤¸ I/O ¥³¥ó¥Æ¥­¥¹¥È¤ò¶¦Í­¤¹¤ë¾ì¹ç¡¢ +¤³¤ì¤é¤Î¥×¥í¥»¥¹¤Ï I/O ¥¹¥±¥¸¥å¡¼¥é¤«¤é¤Ï°ì¤Ä¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +·ë²Ì¤È¤·¤Æ¡¢¤³¤ì¤é¤Î¥×¥í¥»¥¹¤Ï¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹¤Î»þ´Ö¤ò¶¦Í­¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤¤¤¯¤Ä¤«¤Î I/O ¥¹¥±¥¸¥å¡¼¥é¤Ç¤Ï¡¢ +.\" ͽ¬¥¹¥±¥¸¥å¡¼¥é¤È CFQ ¥¹¥±¥¸¥å¡¼¥é +Æó¤Ä¤Î¥×¥í¥»¥¹¤¬ I/O ¥³¥ó¥Æ¥­¥¹¥È¤ò¶¦Í­¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +¤³¤ì¤é¤Î¥×¥í¥»¥¹¤Ï¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹¤ò¸ò¸ß¤Ë¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +Ʊ¤¸¥×¥í¥»¥¹¤ÎÊ£¿ô¤Î¥¹¥ì¥Ã¥É¤¬ I/O ¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¾ì¹ç +(Î㤨¤Ð +.BR aio_read (3))¡¢ +.B CLONE_IO +¤òÍøÍѤ¹¤ë¤³¤È¤Ç I/O À­Ç½¤òÎɤ¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\" CFQ ¤È AS ¤Î¾ì¹ç + +¥«¡¼¥Í¥ë¤ÎÀßÄ꤬ +.B CONFIG_BLOCK +¥ª¥×¥·¥ç¥óÉÕ¤­¤Ç¤Ê¤¤¾ì¹ç¡¢ +¤³¤Î¥Õ¥é¥°¤Ï²¿¤Î°ÕÌ£¤â»ý¤¿¤Ê¤¤¡£ +.TP +.BR CLONE_NEWIPC " (Linux 2.6.19 °Ê¹ß)" +.B CLONE_NEWIPC +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¿·¤·¤¤ IPC ̾Á°¶õ´Ö (namespace) ¤Ç¥×¥í¥»¥¹¤òºîÀ®¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.RB ( fork (2) +¤Î¾ì¹ç¤ÈƱÍÍ) ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸ IPC ̾Á°¶õ´Ö¤Ç¥×¥í¥»¥¹¤¬ +ºîÀ®¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢¥³¥ó¥Æ¥Ê¤Î¼ÂÁõ¤Ç¤Î»ÈÍѤò°Õ¿Þ¤·¤ÆÍÑ°Õ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +IPC ̾Á°¶õ´Ö¤Ï¡¢System V IPC ¥ª¥Ö¥¸¥§¥¯¥ÈÍѤμ±ÊÌ»Ò (identifiers) ¤Î +½¸¹ç¤Ç¹½À®¤µ¤ì¤ë +(System V IPC ¥ª¥Ö¥¸¥§¥¯¥È¤Ï +.BR msgctl (2), +.BR semctl (2), +.BR shmctl (2) +¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤ë)¡£ +¤¢¤ë IPC ̾Á°¶õ´Ö¤ËºîÀ®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢ +¤½¤Î̾Á°¶õ´Ö¤Î¥á¥ó¥Ð¡¼¤Ç¤¢¤ë¾¤Î¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤«¤é¤â¸«¤¨¤ë¤¬¡¢ +°ã¤¦ IPC ̾Á°¶õ´Ö¤Î¥×¥í¥»¥¹¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ + +IPC ̾Á°¶õ´Ö¤¬ÇË´þ¤µ¤ì¤ë»þ +(¤¹¤Ê¤ï¤Á¡¢¤½¤Î̾Á°¶õ´Ö¤Î¥á¥ó¥Ð¡¼¤ÎºÇ¸å¤Î¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë»þ)¡¢ +¤½¤Î̾Á°¶õ´Ö¤ÎÁ´¤Æ¤Î IPC ¥ª¥Ö¥¸¥§¥¯¥È¤Ï¼«Æ°Åª¤ËÇË´þ¤µ¤ì¤ë¡£ + +¤³¤Î¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó +.B CONFIG_SYSVIPC +¤È +.B CONFIG_IPC_NS +¤òÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¡¢ +¥×¥í¥»¥¹¤¬Æø¢ +.RB ( CAP_SYS_ADMIN ) +¤ò»ý¤Ã¤Æ¤¤¤ë¤³¤È¤¬É¬ÍפǤ¢¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï +.B CLONE_SYSVSEM +¤ÈÁȤ߹ç¤ï¤»¤Æ»È¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.BR CLONE_NEWNET " (Linux 2.6.24 °Ê¹ß)" +(¤³¤Î¥Õ¥é¥°¤Î¼ÂÁõ¤Ï¤Þ¤À´°Î»¤·¤Æ¤¤¤Ê¤¤¤¬¡¢ +¤ª¤½¤é¤¯ Linux 2.6.28 ¤¢¤¿¤ê¤Þ¤Ç¤Ë¤Ï¤Û¤Ü´°À®¤¹¤ë¤³¤È¤À¤í¤¦¡£) + +.B CLONE_NEWNET +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¿·¤·¤¤¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö (network namaspace) +¤Ç¥×¥í¥»¥¹¤òºîÀ®¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.RB ( fork (2) +¤Î¾ì¹ç¤ÈƱÍÍ) ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö¤Ç¥×¥í¥»¥¹¤¬ +ºîÀ®¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢¥³¥ó¥Æ¥Ê¤Î¼ÂÁõ¤Ç¤Î»ÈÍѤò°Õ¿Þ¤·¤ÆÍÑ°Õ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö¤Ï¡¢Ê¬Î¥¤µ¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥¹¥¿¥Ã¥¯¤òÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë +(¥Í¥Ã¥È¥ï¡¼¥¯¥¹¥¿¥Ã¥¯¤È¤Ï¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¥¤¥ó¥¿¥Õ¥§¡¼¥¹¡¢IPv4 ¤ä IPv6 ¥×¥í¥È¥³¥ë¥¹¥¿¥Ã¥¯¡¢ +.IR /proc/net ¡¢ +.I /sys/class/net +¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¡¢¥½¥±¥Ã¥È¤Ê¤É¤Ç¤¢¤ë)¡£ +ʪÍý¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤¬½ê°¤Ç¤­¤ë¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö¤Ï°ì¤Ä¤À¤±¤Ç¤¢¤ë¡£ +²¾Áۥͥåȥ¥¯¥Ç¥Ð¥¤¥¹ ("veth") ¤Î¥Ú¥¢¤Ë¤è¤ê +¥Ñ¥¤¥×É÷¤ÎÃê¾Ý²½ (abstraction) ¤¬¼Â¸½¤µ¤ì¤Æ¤ª¤ê¡¢ +¤³¤ì¤ò»È¤¦¤³¤È¤Ç¡¢¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö´Ö¤Î¥È¥ó¥Í¥ë¤òºîÀ®¤·¤¿¤ê¡¢ +Ê̤Î̾Á°¶õ´Ö¤ÎʪÍý¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤Ø¤Î¥Ö¥ê¥Ã¥¸¤òºîÀ®¤·¤¿¤ê +¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö¤¬²òÊü¤µ¤ì¤ë»þ +(¤¹¤Ê¤ï¤Á¡¢¤½¤Î̾Á°¶õ´Ö¤ÎºÇ¸å¤Î¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë»þ)¡¢ +ʪÍý¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤Ï½é´ü¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö +(initial network namespace) ¤ËÌᤵ¤ì¤ë +(¿Æ¥×¥í¥»¥¹¤Î¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö¤ËÌᤵ¤ì¤ëÌõ¤Ç¤Ï¤Ê¤¤)¡£ + +¤³¤Î¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó +.B CONFIG_NET_NS +¤òÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¡¢ +¥×¥í¥»¥¹¤¬Æø¢ +.RB ( CAP_SYS_ADMIN ) +¤ò»ý¤Ã¤Æ¤¤¤ë¤³¤È¤¬É¬ÍפǤ¢¤ë¡£ +.TP +.BR CLONE_NEWNS " (Linux 2.4.19 °Ê¹ß)" +»Ò¥×¥í¥»¥¹¤ò¿·¤·¤¤¥Þ¥¦¥ó¥È̾Á°¶õ´Ö (mount namespace) ¤Ç³«»Ï¤¹¤ë¡£ + +³Æ¥×¥í¥»¥¹¤Ï¤¢¤ë°ì¤Ä¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´ÖÃæ¤Ë¸ºß¤¹¤ë¡£¥×¥í¥»¥¹¤Î +.I "̾Á°¶õ´Ö (namespace)" +¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤«¤é¸«¤¨¤ë¥Õ¥¡¥¤¥ë³¬Áؤòɽ¤¹¥Ç¡¼¥¿ (mount ¤Î½¸¹ç) ¤Ç¤¢¤ë¡£ +.B CLONE_NEWNS +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤º¤Ë +.BR fork (2) +¤« +.BR clone () +¤¬¸Æ¤Ð¤ì¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤ÈƱ¤¸¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤ËºîÀ®¤µ¤ì¤ë¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR mount (2)¡¢ +.BR umount (2) +¤¬¸Æ¤Ð¤ì¤ë¤È¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤¬Êѹ¹¤µ¤ì¡¢¤³¤Î·ë²Ì +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸Ì¾Á°¶õ´Ö¤Ë¤¤¤ë¥×¥í¥»¥¹¤Ï¤¹¤Ù¤Æ±Æ¶Á¤ò¼õ¤±¤ë¤¬¡¢ +°Û¤Ê¤ë¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤Ë¤¤¤ë¥×¥í¥»¥¹¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡£ + +.B CLONE_NEWNS +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ +.BR clone () +¤¬¸Æ¤Ð¤ì¤ë¤È¡¢clone ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿·¤·¤¤¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤Ç +³«»Ï¤µ¤ì¤ë¡£¿·¤·¤¤Ì¾Á°¶õ´Ö¤Ï¿Æ¥×¥í¥»¥¹¤Î̾Á°¶õ´Ö¤Î¥³¥Ô¡¼¤Ç½é´ü²½¤µ¤ì¤ë¡£ + +Æø¢¥×¥í¥»¥¹ (\fBCAP_SYS_ADMIN\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Î¤ß¤¬ +.B CLONE_NEWNS +¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°ì¤Ä¤Î +.BR clone () +¸Æ¤Ó½Ð¤·¤Ç¡¢ +.B CLONE_NEWNS +¤È +.B CLONE_FS +¤ÎξÊý¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.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 +.B CLONE_NEWPID +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¿·¤·¤¤ PID ̾Á°¶õ´Ö¤Ç¥×¥í¥»¥¹¤òºîÀ®¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.RB ( fork (2) +¤Î¾ì¹ç¤ÈƱÍÍ) ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸ PID ̾Á°¶õ´Ö¤Ç +¥×¥í¥»¥¹¤¬ºîÀ®¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢¥³¥ó¥Æ¥Ê¤Î¼ÂÁõ¤Ç¤Î»ÈÍѤò°Õ¿Þ¤·¤ÆÍÑ°Õ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +PID ̾Á°¶õ´Ö¤Ï¡¢PID ¤Ë´Ø¤·¤ÆʬΥ¤µ¤ì¤¿´Ä¶­¤òÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¿·¤·¤¤Ì¾Á°¶õ´Ö¤Ë¤ª¤±¤ë PID ¤Ï 1 ¤«¤é»Ï¤Þ¤ê +(¤³¤ì¤Ï¥¹¥¿¥ó¥É¥¢¥í¥ó¤Î¥·¥¹¥Æ¥à¤È»÷¤¿¤è¤¦¤Ê´¶¤¸)¡¢ +.BR fork (2), +.BR vfork (2), +.BR clone (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¤½¤Î̾Á°¶õ´Ö¤Ç°ì°Õ¤Ê PID ¤ò»ý¤Ã¤¿¥×¥í¥»¥¹¤¬ºîÀ®¤µ¤ì¤ë¡£ + +¿·¤·¤¤Ì¾Á°¶õ´Ö¤ÇºîÀ®¤µ¤ì¤ëºÇ½é¤Î¥×¥í¥»¥¹ +(¤Ä¤Þ¤ê¡¢ +.B CLONE_NEWPID +¥Õ¥é¥°¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥×¥í¥»¥¹) ¤Î PID ¤Ï 1 ¤Ç¤¢¤ê¡¢ +¤³¤Î¥×¥í¥»¥¹¤Ï¤½¤Î̾Á°¶õ´Ö¤Ë¤ª¤±¤ë "init" ¥×¥í¥»¥¹¤È¤Ê¤ë¡£ +¤³¤Î̾Á°¶õ´Ö¤Ë¤ª¤¤¤Æ¸É»ù (orphaned) ¤È¤Ê¤Ã¤¿»Ò¥×¥í¥»¥¹¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR init (8) +¤Ç¤Ï¤Ê¤¯¤³¤Î¥×¥í¥»¥¹¤¬¿Æ¥×¥í¥»¥¹¤È¤Ê¤ë¡£ +ÀΤʤ¬¤é¤Î +.B init +¥×¥í¥»¥¹¤È¤Ï°ã¤¤¡¢PID ̾Á°¶õ´Ö¤Î "init" ¥×¥í¥»¥¹¤Ï½ªÎ» (terminated) ¤¹¤ë +¤³¤È¤¬¤Ç¤­¡¢¤½¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤Î̾Á°¶õ´Ö¤ÎÁ´¤Æ¤Î¥×¥í¥»¥¹¤¬½ªÎ»¤µ¤ì¤ë¡£ + +PID ̾Á°¶õ´Ö´Ö¤Ë¤Ï³¬Áع½Â¤¤¬·ÁÀ®¤µ¤ì¤ë¡£ +¿·¤·¤¤ PID ̾Á°¶õ´Ö¤¬ºîÀ®¤µ¤ì¤ë¤È¡¢¤½¤Î̾Á°¶õ´Ö¤Î¥×¥í¥»¥¹¤Ï¡¢ +¿·¤·¤¤Ì¾Á°¶õ´Ö¤òºîÀ®¤·¤¿¥×¥í¥»¥¹¤Î PID ̾Á°¶õ´Ö¤Ç¸«¤¨¤ë¡£ +ƱÍͤˡ¢¿Æ¤Î PID ̾Á°¶õ´Ö¼«ÂΤ¬Ê̤ΠPID ̾Á°¶õ´Ö¤Î»Ò¶¡¤Î¾ì¹ç¤Ë¤Ï¡¢ +»Ò¶¡¤Î PID ̾Á°¶õ´Ö¤È¿Æ¤Î PID ̾Á°¶õ´Ö¤Î¥×¥í¥»¥¹¤Ï¤É¤ì¤â +¿Æ¤Î¿Æ¤Î PID ̾Á°¶õ´Ö¤Ç¤â¸«¤¨¤ë¤³¤È¤Ë¤Ê¤ë¡£ +È¿ÂФˡ¢¡Ö»Ò¶¡¡×¤Î PID ̾Á°¶õ´Ö¤Î¥×¥í¥»¥¹¤Ë¤Ï¡¢ +¿Æ¤Î̾Á°¶õ´Ö¤Î¥×¥í¥»¥¹¤Ï¸«¤¨¤Ê¤¤¡£ +̾Á°¶õ´Ö¤Ë³¬Áع½Â¤¤¬Â¸ºß¤¹¤ë¤È¤¤¤¦¤³¤È¤Ï¡¢¸Ä¡¹¤Î¥×¥í¥»¥¹¤Ï +Ê£¿ô¤Î PID ¤ò»ý¤Ä¤È¤¤¤¦¤³¤È¤ò°ÕÌ£¤·¤Æ¤¤¤ë¡£ +¤½¤Î¥×¥í¥»¥¹¤¬¸«¤¨¤ë̾Á°¶õ´Ö°ì¤Ä¤Ë¤Ä¤­ PID ¤¬°ì¤Ä¤¢¤ê¡¢ +¤½¤ì¤¾¤ì¤Î PID ¤ÏÂбþ¤¹¤ë̾Á°¶õ´Ö¤Ë¤ª¤¤¤Æ°ì°Õ¤Ç¤¢¤ë¡£ +.RB ( getpid (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¾ï¤Ë¤½¤Î¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Æ¤¤¤ë̾Á°¶õ´Ö¤Ë¤ª¤±¤ë +PID ¤¬ÊÖ¤µ¤ì¤ë¡£) + +¿·¤·¤¤Ì¾Á°¶õ´Ö¤ÎºîÀ®¸å¤Ë¤Ï¡¢ +»Ò¥×¥í¥»¥¹¤Ë¤ª¤¤¤Æ¡¢ +.BR ps (1) +¤È¤¤¤Ã¤¿¥Ä¡¼¥ë¤¬Àµ¤·¤¯Æ°ºî¤¹¤ë¤è¤¦¤Ë¡¢ +¼«¿È¤Î root ¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤·¡¢ +.I /proc +¤Ë¿·¤·¤¤ procfs ¥¤¥ó¥¹¥¿¥ó¥¹¤ò¥Þ¥¦¥ó¥È¤¹¤ë¤Î¤¬¤è¤¤¤À¤í¤¦¡£ +.\" mount -t proc proc /proc +.RB ( flags +¤Ë +.B CLONE_NEWNS +¤â»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¡¢root ¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ëɬÍפϤʤ¯¡¢ +¤¤¤­¤Ê¤ê¿·¤·¤¤ procfs ¥¤¥ó¥¹¥¿¥ó¥¹¤ò +.I /proc +¤Ë¥Þ¥¦¥ó¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£) + +¤³¤Î¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó +.B CONFIG_PID_NS +¤òÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¡¢ +¥×¥í¥»¥¹¤¬Æø¢ +.RB ( CAP_SYS_ADMIN ) +¤ò»ý¤Ã¤Æ¤¤¤ë¤³¤È¤¬É¬ÍפǤ¢¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï +.B CLONE_THREAD +¤ÈÁȤ߹ç¤ï¤»¤Æ»È¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.BR CLONE_NEWUTS " (Linux 2.6.19 °Ê¹ß)" +.B CLONE_NEWUTS +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¿·¤·¤¤ UTS ̾Á°¶õ´Ö¤Ç¥×¥í¥»¥¹¤òºîÀ®¤¹¤ë¡£ +¿·¤·¤¤ UTS ̾Á°¶õ´Ö¤Î¼±Ê̻Ҥνé´üÃͤϡ¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î +UTS ̾Á°¶õ´Ö¤Î¼±Ê̻ҤòÊ£À½¤·¤¿¤â¤Î¤È¤Ê¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.RB ( fork (2) +¤Î¾ì¹ç¤ÈƱÍÍ) ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸ UTS ̾Á°¶õ´Ö¤Ç +¥×¥í¥»¥¹¤¬ºîÀ®¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢¥³¥ó¥Æ¥Ê¤Î¼ÂÁõ¤Ç¤Î»ÈÍѤò°Õ¿Þ¤·¤ÆÍÑ°Õ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +UTS ̾Á°¶õ´Ö¤Ï¡¢ +.BR uname (2) +¤¬ÊÖ¤¹¼±Ê̻Ҥν¸¹ç¤Ç¤¢¤ë¡£ +¼±Ê̻ҤȤ·¤Æ¤Ï¥É¥á¥¤¥ó̾¤È¥Û¥¹¥È̾¤¬¤¢¤ê¡¢ +¤½¤ì¤¾¤ì +.BR setdomainname (2), +.BR sethostname (2) +¤Ç½¤Àµ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤¢¤ë UTS ̾Á°¶õ´Ö¤Ë¤ª¤±¤ë¼±Ê̻ҤÎÊѹ¹¤ÏƱ¤¸Ì¾Á°¶õ´Ö¤Î¾¤Î¤¹¤Ù¤Æ¤Î +¥×¥í¥»¥¹¤Ë¸«¤¨¤ë¤¬¡¢Ê̤ΠUTS ̾Á°¶õ´Ö¤Î¥×¥í¥»¥¹¤Ë¤Ï¸«¤¨¤Ê¤¤¡£ + +¤³¤Î¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó +.B CONFIG_UTS_NS +¤òÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¡¢ +¥×¥í¥»¥¹¤¬Æø¢ +.RB ( CAP_SYS_ADMIN ) +¤ò»ý¤Ã¤Æ¤¤¤ë¤³¤È¤¬É¬ÍפǤ¢¤ë¡£ +.TP +.BR CLONE_PARENT " (Linux 2.3.12 °Ê¹ß)" +.B CLONE_PARENT +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¿·¤·¤¤»Ò¶¡¤Î +.RB ( getppid (2) +¤ÇÊÖ¤µ¤ì¤ë) ¿Æ¥×¥í¥»¥¹¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¿Æ¥×¥í¥»¥¹¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ + +.B CLONE_PARENT +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.RB ( fork (2) +¤ÈƱÍͤË) ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¤½¤Î»Ò¶¡¤Î¿Æ¤Ë¤Ê¤ë¡£ + +»Ò¶¡¤¬½ªÎ»¤·¤¿»þ¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¤Î¤Ï +.BR getppid (2) +¤¬ÊÖ¤¹¿Æ¥×¥í¥»¥¹¤Ç¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£¤³¤Î¤¿¤á +.B CLONE_PARENT +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ç¤Ï¤Ê¤¯¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î +¿Æ¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +.TP +.BR CLONE_PARENT_SETTID " (Linux 2.5.49 °Ê¹ß)" +¿Æ¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Î¥á¥â¥êÆâ¤Î +.I ptid +¤¬»Ø¤¹Îΰè¤Ë»Ò¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥É ID ¤ò³ÊǼ¤¹¤ë¡£ +(Linux 2.5.32-2.5.48 ¤Ç¤Ï¡¢ +Ʊ¤¸¤³¤È¤ò¤¹¤ë +.B CLONE_SETTID +¤È¤¤¤¦¥Õ¥é¥°¤¬Â¸ºß¤·¤¿¡£) +.TP +.BR CLONE_PID " (ÇÑ»ßͽÄê)" +.B CLONE_PID +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸¥×¥í¥»¥¹ ID +¤ÇºîÀ®¤µ¤ì¤ë¡£¤³¤ì¤Ï¥·¥¹¥Æ¥à¤ò¥Ï¥Ã¥­¥ó¥°¤¹¤ë¤Î¤Ë¤ÏÊØÍø¤À¤¬¡¢ +¤½¤ì°Ê³°¤Ë¤Ï¤¢¤Þ¤ê»È¤ï¤ì¤Ê¤¤¡£ Linux 2.3.21 °Ê¹ß¤Ç¤Ï¡¢ +¥·¥¹¥Æ¥à¤Î¥Ö¡¼¥È¥×¥í¥»¥¹ (PID 0) ¤À¤±¤¬¤³¤Î¥Õ¥é¥°¤ò»ØÄê¤Ç¤­¤ë¡£ +Linux 2.5.16 ¤Çºï½ü¤µ¤ì¤¿¡£ +.TP +.B CLONE_PTRACE +.B CLONE_PTRACE +¤¬»ØÄꤵ¤ì¡¢¤«¤Ä¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬ÄÉÀ× (trace) ¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤â +ƱÍͤËÄÉÀפµ¤ì¤ë¡£ +.RB ( ptrace (2) +¤ò»²¾È¤Î¤³¤È) +.TP +.BR CLONE_SETTLS " (Linux 2.5.32 °Ê¹ß)" +.I newtls +°ú¤­¿ô¤Ï¡¢¿·¤·¤¤ TLS (Thread Local Storage) ¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.RB ( set_thread_area (2) +¤ò»²¾È¤Î¤³¤È) +.TP +.B CLONE_SIGHAND +.B CLONE_SIGHAND +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤ÏƱ¤¸¥·¥°¥Ê¥ë¡¦¥Ï¥ó +¥É¥é¤Î¥Æ¡¼¥Ö¥ë¤ò¶¦Í­¤¹¤ë¡£¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Þ¤¿¤Ï»Ò¥×¥í¥»¥¹¤Î¤É¤Á¤é¤«¤¬ +.BR sigaction (2) +¤ò¸Æ¤Ó½Ð¤·¤Æ¥·¥°¥Ê¥ë¤ËÂбþ¤¹¤ëÆ°ºî¤òÊѹ¹¤·¤¿¾ì¹ç¡¢ +¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ëÆ°ºî¤âÊѹ¹¤µ¤ì¤ë¡£ +⤷¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Ï¡¢ +¥×¥í¥»¥¹Ëè¤Ë¡¢¥·¥°¥Ê¥ë¡¦¥Þ¥¹¥¯ (signal mask) ¤È½èÍýÂÔ¤Á¥·¥°¥Ê¥ë¤Î½¸¹ç +¤ò»ý¤Ã¤Æ¤¤¤ë¡£¤³¤Î¤¿¤á¡¢¤¢¤ë¥×¥í¥»¥¹¤Ï¡¢ +.BR sigprocmask (2) +¤ò»ÈÍѤ·¤Æ¡¢¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë±Æ¶Á¤òÍ¿¤¨¤º¤Ë +¥·¥°¥Ê¥ë¤ò¶Ø»ß (block) ¤·¤¿¤êµö²Ä (unblock) ¤·¤¿¤ê¤Ç¤­¤ë¡£ + +.B CLONE_SIGHAND +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï +.BR clone () +¤¬¼Â¹Ô¤µ¤ì¤¿»þÅÀ¤Ç¤Î¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤Î +¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£¤³¤ì°Ê¹ß¤Ï¡¢°ìÊý¤Î¥×¥í¥»¥¹¤¬ +.BR sigaction (2) +¤ò¸Æ¤Ó½Ð¤·¤Æ¤â¡¢¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤Ï±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡£ + +Linux 2.6.0-test6 °Ê¹ß¤Ç¤Ï¡¢ +.B CLONE_SIGHAND +¤ò»ØÄꤹ¤ë¾ì¹ç¡¢ +.B CLONE_VM +¤â +.I flags +¤Ë´Þ¤á¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BR CLONE_STOPPED " (Linux 2.6.0-test2 °Ê¹ß)" +.B CLONE_STOPPED +¤¬ÀßÄꤵ¤ì¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤ÏºÇ½é +.RB ( SIGSTOP +¥·¥°¥Ê¥ë¤òÁ÷¤é¤ì¤¿¤«¤Î¤è¤¦¤Ë) Ää»ß¤·¤¿¾õÂ֤Ȥʤ롣 +»Ò¥×¥í¥»¥¹¤òºÆ³«¤µ¤»¤ë¤Ë¤Ï +.B SIGCONT +¥·¥°¥Ê¥ë¤òÁ÷¿®¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.I "Linux 2.6.25 °Ê¹ß¡¢¤³¤Î¥Õ¥é¥°¤ÏÈó¿ä¾©¤Ç¤¢¤ë¡£" +¤³¤Î¥Õ¥é¥°¤ò»È¤¤¤¿¤¤¤È»×¤¦¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¤À¤í¤¦¤·¡¢ +³Î¼Â¤Ë»È¤ï¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¶á¤¤¤¦¤Á¤Ë¤Ê¤¯¤Ê¤ë¤³¤È¤À¤í¤¦¡£ +.\" glibc 2.8 removed this defn from bits/sched.h +.TP +.BR CLONE_SYSVSEM " (Linux 2.5.10 °Ê¹ß)" +.B CLONE_SYSVSEM +¤¬¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤È¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï°ì¤Ä¤Î +System V ¥»¥Þ¥Õ¥©¤Î¥¢¥ó¥É¥¥Ãͥꥹ¥È +.RB ( semop (2) +»²¾È) ¤ò¶¦Í­¤¹¤ë¡£¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +»Ò¥×¥í¥»¥¹¤ÏÆȼ«¤Î¥¢¥ó¥É¥¥¥ê¥¹¥È¤ò»ý¤Ä (¥ê¥¹¥È¤Î½é´üÃͤ϶õ¤Ç¤¢¤ë)¡£ +.TP +.BR CLONE_THREAD " (Linux 2.4.0-test8°Ê¹ß)" +.B CLONE_THREAD +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë +ÃÖ¤«¤ì¤ë¡£ +.B CLONE_THREAD +¤Ë¤Ä¤¤¤Æ¤Î°Ê¹ß¤ÎµÄÏÀ¤òÆɤߤ䤹¤¯¤¹¤ë¤¿¤á¡¢ +¡Ö¥¹¥ì¥Ã¥É¡×¤È¤¤¤¦ÍѸì¤Ï¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤ÎÃæ¤Î¥×¥í¥»¥¹¤ò +»²¾È¤¹¤ë¤Î¤Ë»È¤¦¤³¤È¤È¤¹¤ë¡£ + +¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ï¡¢ ¥¹¥ì¥Ã¥É½¸¹ç¤Ç°ì¤Ä¤Î PID ¤ò¶¦Í­¤¹¤ë¤È¤¤¤¦ POSIX +¥¹¥ì¥Ã¥É¤Î³µÇ°¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤¿¤á¤Ë Linux 2.4 ¤Ë²Ã¤¨¤é¤ì¤¿µ¡Ç½¤Ç¤¢¤Ã¤¿¡£ +ÆâÉôŪ¤Ë¤Ï¡¢¤³¤Î¶¦Í­ PID ¤Ï¤¤¤ï¤æ¤ë¤½¤Î¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Î +¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¼±ÊÌ»Ò (TGID) ¤Ç¤¢¤ë¡£ +Linux 2.4 °Ê¹ß¤Ç¤Ï¡¢ +.BR getpid (2) +¤Î¸Æ¤Ó½Ð¤·¤Ç¤Ï¤½¤Î¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥× ID ¤òÊÖ¤¹¡£ + +¤¢¤ë¥°¥ë¡¼¥×¤Ë°¤¹¤ë¥¹¥ì¥Ã¥É¤Ï (¥·¥¹¥Æ¥àÁ´ÂΤÇ) °ì°Õ¤Ê¥¹¥ì¥Ã¥É ID (TID) +¤Ç¶èÊ̤Ǥ­¤ë¡£¿·¤·¤¤¥¹¥ì¥Ã¥É¤Î TID ¤Ï +.BR clone () +¤Î¸Æ¤Ó½Ð¤·¸µ¤Ø´Ø¿ô¤Î·ë²Ì¤È¤·¤ÆÊÖ¤µ¤ì¡¢ +¥¹¥ì¥Ã¥É¤Ï¼«Ê¬¼«¿È¤Î TID ¤ò +.BR gettid (2) +¤Ç¼èÆÀ¤Ç¤­¤ë¡£ + +.B CLONE_THREAD +¤ò»ØÄꤻ¤º¤Ë +.BR clone () +¤Î¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤ë¤È¡¢ +À¸À®¤µ¤ì¤¿¥¹¥ì¥Ã¥É¤Ï¤½¤Î¥¹¥ì¥Ã¥É¤Î TID ¤ÈƱ¤¸ÃͤΠTGID ¤ò»ý¤Ä +¿·¤·¤¤¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤ËÃÖ¤«¤ì¤ë¡£¤³¤Î¥¹¥ì¥Ã¥É¤Ï +¿·¤·¤¤¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Î¡Ö¥ê¡¼¥À¡¼¡×¤Ç¤¢¤ë¡£ + +.B CLONE_THREAD +¤ò»ØÄꤷ¤ÆºîÀ®¤µ¤ì¤¿¿·¤·¤¤¥¹¥ì¥Ã¥É¤Ï¡¢ +.RB ( CLONE_PARENT +¤Î¾ì¹ç¤ÈƱÍͤË) +.BR clone () +¤ò¸Æ¤Ó½Ð¤·¸µ¤ÈƱ¤¸¿Æ¥×¥í¥»¥¹¤ò»ý¤Ä¡£ +¤½¤Î¤¿¤á¡¢ +.BR getppid (2) +¤ò¸Æ¤Ö¤È¡¢°ì¤Ä¤Î¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë°¤¹¥¹¥ì¥Ã¥É¤ÏÁ´¤ÆƱ¤¸ÃͤòÊÖ¤¹¡£ +.B CLONE_THREAD +¤Çºî¤é¤ì¤¿¥¹¥ì¥Ã¥É¤¬½ªÎ»¤·¤¿ºÝ¤Ë¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¤ò +.BR clone (2) +¤ò»È¤Ã¤ÆÀ¸À®¤·¤¿¥¹¥ì¥Ã¥É¤Ë¤Ï +.B SIGCHLD +(¤â¤·¤¯¤Ï¾¤Î½ªÎ»¥·¥°¥Ê¥ë) ¤ÏÁ÷¿®¤µ¤ì¤Ê¤¤¡£ +¤Þ¤¿¡¢ +.BR wait (2) +¤ò»È¤Ã¤Æ½ªÎ»¤·¤¿¥¹¥ì¥Ã¥É¤Î¾õÂÖ¤ò¼èÆÀ¤¹¤ë¤³¤È¤â¤Ç¤­¤Ê¤¤ +(¤½¤Î¤è¤¦¤Ê¥¹¥ì¥Ã¥É¤Ï +.I detached +(ʬΥ¤µ¤ì¤¿) ¤È¤¤¤ï¤ì¤ë)¡£ + +¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë°¤¹Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤¬½ªÎ»¤·¤¿¸å¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Î¿Æ¥×¥í¥»¥¹¤Ë +.B SIGCHLD +(¤â¤·¤¯¤Ï¾¤Î½ªÎ»¥·¥°¥Ê¥ë) ¤¬Á÷¤é¤ì¤ë¡£ + +¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë°¤¹¤¤¤º¤ì¤«¤Î¥¹¥ì¥Ã¥É¤¬ +.BR execve (2) +¤ò¼Â¹Ô¤¹¤ë¤È¡¢¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼°Ê³°¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤Ï +½ªÎ»¤µ¤ì¡¢¿·¤·¤¤¥×¥í¥»¥¹¤¬¤½¤Î¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼¤Î²¼¤Ç +¼Â¹Ô¤µ¤ì¤ë¡£ + +¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë°¤¹¥¹¥ì¥Ã¥É¤Î°ì¤Ä¤¬ +.BR fork (2) +¤ò»È¤Ã¤Æ»Ò¥×¥í¥»¥¹¤òºîÀ®¤·¤¿¾ì¹ç¡¢ +¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Î¤É¤Î¥¹¥ì¥Ã¥É¤Ç¤¢¤Ã¤Æ¤â +¤½¤Î»Ò¶¡¤ò +.BR wait (2) +¤Ç¤­¤ë¡£ + +Linux 2.5.35 °Ê¹ß¤Ç¤Ï¡¢ +.B CLONE_THREAD +¤ò»ØÄꤹ¤ë¾ì¹ç¡¢ +.I flags +¤Ë +.B CLONE_SIGHAND +¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.BR kill (2) +¤ò»È¤Ã¤Æ¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×Á´ÂÎ (¤Ä¤Þ¤ê TGID) ¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤â¤Ç¤­¤ì¤Ð¡¢ +.BR tgkill (2) +¤ò»È¤Ã¤ÆÆÃÄê¤Î¥¹¥ì¥Ã¥É (¤Ä¤Þ¤ê TID) ¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤â¤Ç¤­¤ë¡£ + +¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤È½èÍý¤Ï¥×¥í¥»¥¹Á´ÂΤ˱ƶÁ¤¹¤ë: +¥Ï¥ó¥É¥é¤òÀßÄꤷ¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤¬¤¢¤ë¥¹¥ì¥Ã¥É¤ËÇÛÁ÷¤µ¤ì¤ë¤È¡¢ +¤½¤Î¥·¥°¥Ê¥ë¤Ï¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¡¼¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ +(½ªÎ»¤·¤¿¤ê¡¢Ää»ß¤·¤¿¤ê¡¢Æ°ºî¤ò·Ñ³¤·¤¿¤ê¡¢Ìµ»ë¤µ¤ì¤¿¤ê¤¹¤ë)¡£ + +³Æ¡¹¤Î¥¹¥ì¥Ã¥É¤ÏÆȼ«¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò»ý¤Ã¤Æ¤ª¤ê¡¢ +.BR sigprocmask (2) +¤ÇÀßÄê¤Ç¤­¤ë¡£ +¤À¤¬¡¢½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Ë¤Ï¡¢ +.BR kill (2) +¤ÇÁ÷¿®¤µ¤ì¤ë¥×¥í¥»¥¹Á´ÂΤËÂФ¹¤ë¤â¤Î (¤Ä¤Þ¤ê¡¢¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Î +¤É¤Î¥á¥ó¥Ð¡¼¤Ë¤âÇÛÁ÷¤Ç¤­¤ë¤â¤Î) ¤È¡¢ +.BR tgkill (2) +¤ÇÁ÷¿®¤µ¤ì¤ë¸Ä¡¹¤Î¥¹¥ì¥Ã¥É¤ËÂФ¹¤ë¤â¤Î¤¬¤¢¤ê¤¨¤ë¡£ +.BR sigpending (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¥×¥í¥»¥¹Á´ÂΤËÂФ¹¤ë½èÍýÂÔ¤Á¥·¥°¥Ê¥ë¤È¸Æ¤Ó½Ð¤·¸µ¤Î +¥¹¥ì¥Ã¥É¤ËÂФ¹¤ë½èÍýÂÔ¤Á¥·¥°¥Ê¥ë¤ò·ë¹ç¤·¤¿¥·¥°¥Ê¥ë½¸¹ç¤¬ÊÖ¤µ¤ì¤ë¡£ + +.BR kill (2) +¤ò»È¤Ã¤Æ¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤¿¾ì¹ç¤Ç¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤¬¤½¤Î¥·¥°¥Ê¥ë¤ËÂФ¹¤ë¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬ +ÅÐÏ¿¤µ¤ì¤Æ¤¤¤¿¤È¤­¤Ë¤Ï¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤Ï¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Î +¥á¥ó¥Ð¡¼¤Î¤¦¤Á¡¢¤¿¤À°ì¤Ä¤Î¥¹¥ì¥Ã¥É¤Ç¤À¤±µ¯Æ°¤µ¤ì¤ë¡£¥Ï¥ó¥É¥é¤¬ +µ¯Æ°¤µ¤ì¤ë¥¹¥ì¥Ã¥É¤Ï¡¢¤½¤Î¥·¥°¥Ê¥ë¤ò¶Ø»ß (block) ¤·¤Æ¤¤¤Ê¤¤ +¥á¥ó¥Ð¡¼¤ÎÃ椫¤é°ì¤Ä¤À¤±¤¬¾¡¼ê¤Ë (arbitrarily) Áª¤Ð¤ì¤ë¡£ +¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë°¤¹Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤¬ +.BR sigwaitinfo (2) +¤ò»È¤Ã¤ÆƱ¤¸¥·¥°¥Ê¥ë¤òÂԤäƤ¤¤ë¾ì¹ç¡¢ +¤³¤ì¤é¤Î¥¹¥ì¥Ã¥É¤ÎÃ椫¤é°ì¤Ä¤ò¥«¡¼¥Í¥ë¤¬¾¡¼ê¤ËÁªÂò¤·¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¤¬ +.B kill (2) +¤ò»È¤Ã¤ÆÁ÷¿®¤µ¤ì¤¿¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¡£ +.TP +.BR CLONE_UNTRACED " (Linux 2.5.46 °Ê¹ß)" +.B CLONE_UNTRACED +¤¬»ØÄꤵ¤ì¤ë¤È¡¢ trace ¤ò¹Ô¤Ã¤Æ¤¤¤ë¥×¥í¥»¥¹¤Ï +¤³¤Î»Ò¥×¥í¥»¥¹¤Ë +.B CLONE_PTRACE +¤òŬÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.B CLONE_VFORK +.B CLONE_VFORK +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +.RB ( vfork (2) +¤ÈƱÍͤË) »Ò¥×¥í¥»¥¹¤¬ +.BR execve (2) +¤Þ¤¿¤Ï +.BR _exit (2) +¤Ë¤è¤Ã¤Æ²¾ÁÛ¥á¥â¥ê¤ò²òÊü¤¹¤ë¤Þ¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤ÏÄä»ß¤µ¤ì¤ë¡£ + +.B CLONE_VFORK +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.BR clone () +¸Æ¤Ó½Ð¤·¸å¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Î +ξÊý¤¬¥¹¥±¥¸¥å¡¼¥ëÂоݤȤʤꡢ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤ì¤é¤Î¥×¥í¥»¥¹¤Î +¼Â¹Ô½ç½ø¤Ë°Í¸¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B CLONE_VM +.B CLONE_VM +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤ÏƱ¤¸¥á¥â¥ê¶õ´Ö¤Ç +¼Â¹Ô¤µ¤ì¤ë¡£Æäˡ¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ä»Ò¥×¥í¥»¥¹¤Î°ìÊý¤¬¥á¥â¥ê¤Ë +½ñ¤­¹þ¤ó¤ÀÆâÍƤϤ⤦°ìÊý¤Î¥×¥í¥»¥¹¤«¤é¤â¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤µ¤é¤Ë¡¢ +»Ò¥×¥í¥»¥¹¤ä¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î°ìÊý¤¬ +.BR mmap (2) +¤ä +.BR munmap (2) +¤ò»È¤Ã¤Æ¥á¥â¥ê¤ò¥Þ¥Ã¥×¤·¤¿¤ê¥¢¥ó¥Þ¥Ã¥×¤·¤¿¾ì¹ç¡¢ +¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤â±Æ¶Á¤¬µÚ¤Ö¡£ + +.B CLONE_VM +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï +.BR clone () +¤¬¼Â¹Ô¤µ¤ì¤¿»þÅÀ¤Ç¤Î¡¢¿Æ¥×¥í¥»¥¹¤Î¥á¥â¥ê¶õ´Ö¤ò¥³¥Ô¡¼¤·¤¿ +Ê̤Υá¥â¥ê¶õ´Ö¤Ç¼Â¹Ô¤µ¤ì¤ë¡£ +°ìÊý¤Î¥×¥í¥»¥¹¤¬¹Ô¤Ã¤¿¥á¥â¥ê¤Ø¤Î½ñ¤­¹þ¤ß¤ä +¥Õ¥¡¥¤¥ë¤Î¥Þ¥Ã¥×/¥¢¥ó¥Þ¥Ã¥×¤Ï¡¢ +.BR fork (2) +¤Î¾ì¹ç¤ÈƱÍÍ¡¢¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤Ï±Æ¶Á¤·¤Ê¤¤¡£ +.SS "sys_clone" +.B sys_clone +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤è¤ê +.BR fork (2) +¤Ë¶á¤¤¤«¤¿¤Á¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢»Ò¥×¥í¥»¥¹¤Î¼Â¹Ô¤¬¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤¿¾ì½ê¤«¤é +³¤±¤é¤ì¤ë¡£ +¤½¤Î¤¿¤á¡¢ +.B sys_clone +¤¬É¬ÍפȤ¹¤ë°ú¤­¿ô¤Ï +.I flags +¤È +.I child_stack +¤À¤±¤Ç¤¢¤ê¡¢¤½¤ì¤é¤Ï +.BR clone () +¤ÈƱ¤¸°ÕÌ£¤ò»ý¤Ä +(¤³¤ì¤é¤Î°ú¤­¿ô¤Î½çÈÖ¤Ï +.BR clone () +¤È¤Ï°Û¤Ê¤ë¤³¤È¤ËÃí°Õ¤»¤è)¡£ + +.B sys_clone +¤Î¤â¤¦°ì¤Ä¤Î°ã¤¤¤Ï¡¢ +.I child_stack +°ú¤­¿ô¤¬¥¼¥í¤Ç¤âÎɤ¤¤³¤È¤Ç¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢¤É¤Á¤é¤«¤Î¥×¥í¥»¥¹¤¬ +¥¹¥¿¥Ã¥¯¤òÊѹ¹¤·¤¿»þ¤Ë¡¢½ñ¤­¹þ¤ß»þ¥³¥Ô¡¼ (copy-on-write) Êý¼°¤Ë¤è¤ê +»Ò¥×¥í¥»¥¹¤¬¥¹¥¿¥Ã¥¯¡¦¥Ú¡¼¥¸¤ÎÆÈΩ¤·¤¿¥³¥Ô¡¼¤òÆÀ¤é¤ì¤ë¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ +¤³¤Î¾ì¹ç¡¢Àµ¾ï¤ËÆ°ºî¤µ¤»¤ë¤¿¤á¤Ë¤Ï¡¢ +.B CLONE_VM +¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +Linux 2.4 °ÊÁ°¤Ç¤Ï¡¢ +.BR clone () +¤Ï°ú¤­¿ô +.IR ptid , +.IR tls , +.IR ctid +¤ò¼è¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.\" gettid(2) ¤Ï current->pid ¤òÊÖ¤¹ +.\" getpid(2) ¤Ï current->tgid ¤òÊÖ¤¹ +À®¸ù¤·¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¼Â¹Ô¥¹¥ì¥Ã¥É¤Ë¤Ï»Ò¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥ÉID ¤¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ ¸Æ¤Ó½Ð¤·¸µ¤Î¥³¥ó¥Æ¥­¥¹¥È¤Ë¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢»Ò¥×¥í¥»¥¹¤Ï +ºîÀ®¤µ¤ì¤º¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +¤¹¤Ç¤Ë¼Â¹ÔÃæ¤Î¥×¥í¥»¥¹¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B EINVAL +.B CLONE_SIGHAND +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¤¬¡¢ +.B CLONE_VM +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +(Linux 2.6.0-test6 °Ê¹ß) +.TP +.B EINVAL +.B CLONE_THREAD +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¤¬¡¢ +.B CLONE_SIGHAND +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +(Linux 2.5.35 °Ê¹ß) +.\" .TP +.\" .B EINVAL +.\" .B CLONE_DETACHED +.\" ¤È +.\" .B CLONE_THREAD +.\" ¤Î¤¤¤º¤ì¤«°ìÊý¤À¤±¤¬»ØÄꤵ¤ì¤¿¡£ +.\" (Linux 2.6.0-test6 °Ê¹ß) +.TP +.B EINVAL +.B CLONE_FS +¤È +.B CLONE_NEWNS +¤ÎξÊý¤¬ +.I flags +¤Ë»ØÄꤵ¤ì¤¿¡£ +.TP +.B EINVAL +.B CLONE_NEWIPC +¤È +.B CLONE_SYSVSEM +¤ÎξÊý¤¬ +.I flags +¤Ë»ØÄꤵ¤ì¤¿¡£ +.TP +.B EINVAL +.B CLONE_NEWPID +¤È +.B CLONE_THREAD +¤ÎξÊý¤¬ +.I flags +¤Ë»ØÄꤵ¤ì¤¿¡£ +.TP +.B EINVAL +.I child_stack +¤Ë¥¼¥í¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë +.BR clone () +¤¬ÊÖ¤¹¡£ +.TP +.B EINVAL +.I flags +¤Ë +.B CLONE_NEWIPC +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó +.B CONFIG_SYSVIPC +¤È +.B CONFIG_IPC_NS +¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINVAL +.I flags +¤Ë +.B CLONE_NEWNET +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó +.B CONFIG_NET_NS +¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINVAL +.I flags +¤Ë +.B CLONE_NEWPID +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó +.B CONFIG_PID_NS +¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINVAL +.I flags +¤Ë +.B CLONE_NEWUTS +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó +.B CONFIG_UTS +¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +»Ò¥×¥í¥»¥¹¤Î¤¿¤á¤Ë³ÎÊݤ¹¤Ù¤­¥¿¥¹¥¯¹½Â¤ÂΤ䡢¸Æ¤Ó½Ð¤·¸µ¤Î¥³¥ó¥Æ¥­¥¹¥È¤Î +°ìÉô¤ò¥³¥Ô¡¼¤¹¤ë¤Î¤ËɬÍפʥá¥â¥ê¤ò½½Ê¬¤Ë³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.B EPERM +ÈóÆø¢¥×¥í¥»¥¹ (\fBCAP_SYS_ADMIN\fP ¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹) ¤¬ +.BR CLONE_NEWIPC , +.BR CLONE_NEWNET , +.BR CLONE_NEWNS , +.BR CLONE_NEWPID , +.BR CLONE_NEWUTS +¤ò»ØÄꤷ¤¿¡£ +.TP +.B EPERM +PID ¤¬ 0 °Ê³°¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ +.B CLONE_PID +¤¬»ØÄꤵ¤ì¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +libc5 ¤Ë¤Ï +.BR clone () +¤Ï¤Ê¤¤¡£glibc2 ¤Ç¤Ï +.BR clone () +¤¬Ä󶡤µ¤ì¤Æ¤ª¤ê¡¢¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ëµ­ºÜ¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.SH ½àµò +.BR clone () +¤È +.B sys_clone +¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­ +¤Ç¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +¥«¡¼¥Í¥ë 2.4.x ·ÏÎó¤Ç¤Ï¡¢°ìÈÌŪ¤Ë¤Ï +.B CLONE_THREAD +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¤â¿·¤·¤¤¥¹¥ì¥Ã¥É¤Î¿Æ¤ò +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¿Æ¤ÈƱ¤¸¤Ë¤Ï¤·¤Ê¤¤¡£ +¤·¤«¤·¡¢¥Ð¡¼¥¸¥ç¥ó 2.4.7¡Á2.4.18 ¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +(¥«¡¼¥Í¥ë 2.6 ¤ÈƱ¤¸¤è¤¦¤Ë) CLONE_THREAD ¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢ +°ÅÌۤΤ¦¤Á¤Ë CLONE_PARENT ¥Õ¥é¥°¤ò»ØÄꤷ¤¿¤³¤È¤Ë¤Ê¤ë¡£ + +.B CLONE_DETACHED +¤È¤¤¤¦¥Õ¥é¥°¤¬¡¢2.5.32 ¤ÇƳÆþ¤µ¤ì¤Æ°ÊÍ褷¤Ð¤é¤¯¤Î´Ö¸ºß¤·¤¿¡£ +¤³¤Î¥Õ¥é¥°¤Ï¿Æ¥×¥í¥»¥¹¤¬»Ò¥×¥í¥»¥¹½ªÎ»¤Î¥·¥°¥Ê¥ë¤òɬÍפȤ·¤Ê¤¤¤³¤È¤ò +ɽ¤¹¤â¤Î¤Ç¤¢¤ë¡£ +2.6.2 ¤Ç¡¢ CLONE_DETATCHED ¤ò CLONE_THREAD ¤È°ì½ï¤Ë»ØÄꤹ¤ëɬÍפϤʤ¯¤Ê¤Ã¤¿¡£ +¤³¤Î¥Õ¥é¥°¤Ï¤Þ¤ÀÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢²¿¤Î¸ú²Ì¤â¤Ê¤¤¡£ + +i386 ¾å¤Ç¤Ï¡¢ +.BR clone () +¤Ï vsyscall ·Ðͳ¤Ç¤Ï¤Ê¤¯¡¢Ä¾ÀÜ +.I "int $0x80" +·Ðͳ¤Ç¸Æ¤Ó½Ð¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +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 +.BR __clone2 () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.BR clone () +¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¤¬¡¢°Ê²¼¤ÎÅÀ¤¬°Û¤Ê¤ë: +.I child_stack_base +¤Ï»Ò¥×¥í¥»¥¹¤Î¥¹¥¿¥Ã¥¯¥¨¥ê¥¢¤ÎºÇ¾®¤Î¥¢¥É¥ì¥¹¤ò»Ø¤·¡¢ +.I stack_size +¤Ï +.I child_stack_base +¤¬»Ø¤·¼¨¤¹¥¹¥¿¥Ã¥¯¥¨¥ê¥¢¤ÎÂ礭¤µ¤ò¼¨¤¹¡£ +.SH ¥Ð¥° +NPTL ¥¹¥ì¥Ã¥É¡¦¥é¥¤¥Ö¥é¥ê¤ò´Þ¤ó¤Ç¤¤¤ë GNU C ¥é¥¤¥Ö¥é¥ê¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó +¤Ë¤Ï¡¢ +.BR getpid (2) +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬´Þ¤Þ¤ì¤Æ¤ª¤ê¡¢¤³¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï PID ¤ò¥­¥ã¥Ã¥·¥å¤¹¤ë¡£ +¤³¤Î¥­¥ã¥Ã¥·¥å½èÍý¤¬Àµ¤·¤¯Æ°ºî¤¹¤ë¤¿¤á¤Ë¤Ï glibc ¤Î +.BR clone (2) +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ç¤Î½õ¤±¤¬É¬ÍפÀ¤¬¡¢¸½¾õ¤Î¼ÂÁõ¤Ç¤Ï¡¢ +¤¢¤ë¾õ¶·²¼¤Ë¤ª¤¤¤Æ¥­¥ã¥Ã¥·¥å¤¬ºÇ¿·¤È¤Ê¤é¤Ê¤¤²ÄǽÀ­¤¬¤¢¤ë¡£ +Æäˡ¢ +.BR clone () +¤Î¸Æ¤Ó½Ð¤·Ä¾¸å¤Ë¥·¥°¥Ê¥ë¤¬»Ò¥×¥í¥»¥¹¤ËÇÛÁ÷¤µ¤ì¤¿¾ì¹ç¤Ë¡¢ +¤½¤Î¥·¥°¥Ê¥ë¤ËÂФ¹¤ë¥Ï¥ó¥É¥éÆâ¤Ç +.BR getpid () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¤½¤ì¤Þ¤Ç¤Ë clone ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬»Ò¥×¥í¥»¥¹¤Î PID ¥­¥ã¥Ã¥·¥å¤ò +¹¹¿·¤¹¤ëµ¡²ñ¤¬ÆÀ¤é¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹ ("¿Æ¥×¥í¥»¥¹") ¤Î PID ¤¬ +ÊÖ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +(¤³¤ÎµÄÏÀ¤Ç¤Ï¡¢»Ò¥×¥í¥»¥¹¤¬ +.B CLONE_THREAD +¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿¾ì¹ç¤Î¤³¤È¤Ï̵»ë¤·¤Æ¤¤¤ë¡£ +»Ò¥×¥í¥»¥¹¤¬ +.B CLONE_THREAD +¤òºî¤Ã¤ÆºîÀ®¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +¸Æ¤Ó½Ð¤·¸µ¤È»Ò¥×¥í¥»¥¹¤ÏƱ¤¸¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë°¤¹¤Î¤Ç¡¢ +.BR getpid () +¤Ï»Ò¥×¥í¥»¥¹¤È +.BR clone () +¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ÇƱ¤¸ÃͤòÊÖ¤¹¤Î¤¬¡ÖÀµ¤·¤¤¡×¡£ +¥­¥ã¥Ã¥·¥å¤¬ºÇ¿·¤È¤Ê¤é¤Ê¤¤ÌäÂê (stale-cache problem) ¤Ï¡¢ +.I flags +¤Ë +.B CLONE_VM +¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤âȯÀ¸¤·¤Ê¤¤¡£) +ËÜÅö¤ÎÃͤòÆÀ¤ë¤¿¤á¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ê¥³¡¼¥É¤ò»È¤¦É¬Íפ¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.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 +.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/release/man2/close.2 b/release/man2/close.2 new file mode 100644 index 00000000..aa5c7144 --- /dev/null +++ b/release/man2/close.2 @@ -0,0 +1,151 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 Wed Jul 21 22:40:25 1993 by Rik Faith +.\" Modified Sat Feb 18 15:27:48 1995 by Michael Haardt +.\" Modified Sun Apr 14 11:40:50 1996 by Andries Brouwer : +.\" 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 +.\" 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 ¥¯¥©¡¼¥¿ +.\" +.TH CLOSE 2 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +close \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int close(int " fd ); +.fi +.SH ÀâÌÀ +.BR close () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +¤½¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤É¤Î¥Õ¥¡¥¤¥ë¤â»²¾È¤·¤Æ¤¤¤Ê¤¤¾õÂ֤ˤʤꡢ +ºÆÍøÍѤ¬²Äǽ¤Ë¤Ê¤ë¡£ +¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë +¤«¤±¤é¤ì¤¿¥ì¥³¡¼¥É¡¦¥í¥Ã¥¯ +.RB ( fcntl (2) +»²¾È) ¤Î¤¦¤Á¡¢¤½¤Î¥×¥í¥»¥¹¤¬ÊÝÍ­¤·¤Æ¤¤¤ë¤â¤Î¤Ï¡¢ +(¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥í¥Ã¥¯¼èÆÀ¤ËÍøÍѤµ¤ì¤¿¤« +¤É¤¦¤«¤Ë¤è¤é¤º) ¤¹¤Ù¤Æºï½ü¤µ¤ì¤ë¡£ +.PP +.I fd +¤¬¡¢Âбþ¤¹¤ë¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò (open file description) +.RB ( open (2) +»²¾È) ¤ò»²¾È¤¹¤ëºÇ¸å¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤À¤Ã¤¿¾ì¹ç¡¢ +¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¤Ë´ØÏ¢¤¹¤ë¥ê¥½¡¼¥¹¤¬²òÊü¤µ¤ì¤ë¡£ +¤½¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¡¢ +.B unlink +¤ò»ÈÍѤ·¤Æºï½ü (remove) ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëºÇ¸å¤Î»²¾È¤À¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤Ïºï½ü (delete) ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR close () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¤Æ¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINTR +.BR close () +¥³¡¼¥ë¤¬¥·¥°¥Ê¥ë¤Ë¤è¤êÃæÃÇ (interrupt) ¤µ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EIO +I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\" SVr4, SVID, POSIX, X/OPEN, 4.3BSD ¤Ë½àµò¤¹¤ë¡£ +.\" SVr4 ¤Ë¤Ï¾¤Ë ENOLINK ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.SH Ãí°Õ +.BR close () +¤ÎÊÖ¤êÃͤΥÁ¥§¥Ã¥¯¤Ï¤è¤¯¾Êά¤µ¤ì¤ë¤¬¡¢ +¤³¤ì¤Ï¿¼¹ï¤Ê¥×¥í¥°¥é¥ß¥ó¥°¥¨¥é¡¼¤Ç¤¢¤ë¡£ +Á°¤Î +.BR write (2) +½èÍý¤Ë´Ø¤¹¤ë¥¨¥é¡¼¤¬ºÇ¸å¤Î +.BR close () +¤Î¤È¤­¤Ë¤Ê¤Ã¤Æ½é¤á¤ÆÄÌÃΤµ¤ì¤ë¾ì¹ç¤¬¤¢¤ê¤¦¤ë¡£ +¥Õ¥¡¥¤¥ë¥¯¥í¡¼¥º¤ÎºÝ¤ËÊÖ¤êÃͤò¥Á¥§¥Ã¥¯¤·¤Ê¤¤¤È¡¢ +µ¤ÉÕ¤«¤Ê¤¤¤¦¤Á¤Ë¥Ç¡¼¥¿¤ò¼º¤Ã¤Æ¤·¤Þ¤¦¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤ì¤ÏÆÃ¤Ë NFS ¤ä¥Ç¥£¥¹¥¯¡¦¥¯¥©¡¼¥¿¤ò»ÈÍѤ·¤¿¾ì¹ç¤Ë¸«¤é¤ì¤ë¡£ +.PP +¥¯¥í¡¼¥º¤ËÀ®¸ù¤·¤Æ¤â¡¢¥Ç¡¼¥¿¤¬¥Ç¥£¥¹¥¯¤ËÊݸ¤µ¤ì¤¿¤«¤É¤¦¤«¤Ï +Êݾڤµ¤ì¤Ê¤¤ (¥«¡¼¥Í¥ë¤¬½ñ¤­¤³¤ß¤òÃٱ䤵¤»¤ë¤³¤È¤¬¤¢¤ë¤¿¤á¤Ç¤¢¤ë)¡£ +¥¹¥È¥ê¡¼¥à¤¬¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¤­¤Ë¥Ð¥Ã¥Õ¥¡¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¤«¤É¤¦¤«¤Ï¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +¥Ç¡¼¥¿¤¬ÊªÍýŪ¤ËÊݸ¤µ¤ì¤ë¤³¤È¤òÊݾڤ¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR fsync (2) +¤ò»ÈÍѤ¹¤ë¤³¤È +.RB ( fsync (3) +¤ò¹Ô¤Ã¤¿»þÅÀ¤Ç¡¢¥Ç¡¼¥¿¤ÎÊݸ¤Ï¥Ç¥£¥¹¥¯¤Î¥Ï¡¼¥É¥¦¥§¥¢¤Ë°Í¸¤¹¤ë +ÌäÂê¤È¤Ê¤ë)¡£ +.PP +Ʊ¤¸¥×¥í¥»¥¹Æâ¤Î¾¤Î¥¹¥ì¥Ã¥É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬»ÈÍѤ·¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ë´Ö¤Ë¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë¤Î¤Ï¡¢¤ª¤½¤é¤¯¸­ÌÀ¤Ç¤Ï¤Ê¤¤¤À¤í¤¦¡£ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏºÆÍøÍѤµ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç¡¢ +¤¢¤¤¤Þ¤¤¤Ê¶¥¹ç¾ò·ï¤È¤Ê¤ë¤³¤È¤¬¤¢¤ê¡¢°Õ¿Þ¤·¤Ê¤¤ÉûºîÍѤθ¶°ø¤È¤Ê¤ê¤¦¤ë¡£ +.\" Date: Tue, 4 Sep 2007 13:57:35 +0200 +.\" From: Fredrik Noring +.\" One such race involves signals and ERESTARTSYS. If a file descriptor +.\" in use by a system call is closed and then reused by e.g. an +.\" independent open() in some unrelated thread, before the original system +.\" 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. +.SH ´ØÏ¢¹àÌÜ +.BR fcntl (2), +.BR fsync (2), +.BR open (2), +.BR shutdown (2), +.BR unlink (2), +.BR fclose (3) diff --git a/release/man2/connect.2 b/release/man2/connect.2 new file mode 100644 index 00000000..25ff77bb --- /dev/null +++ b/release/man2/connect.2 @@ -0,0 +1,284 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from /usr/include/sys/socket.h, which does not have +.\" any authorship information in it. It is probably available under the GPL. +.\" +.\" 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. +.\" +.\" +.\" Other portions are from the 6.9 (Berkeley) 3/10/91 man page: +.\" +.\" Copyright (c) 1983 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. +.\" +.\" Modified 1997-01-31 by Eric S. Raymond +.\" 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" +.SH ̾Á° +connect \- ¥½¥±¥Ã¥È¤ÎÀܳ¤ò¹Ô¤¦ +.SH ½ñ¼° +.nf +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.br +.B #include +.sp +.BI "int connect(int " sockfd ", const struct sockaddr *" addr , +.BI " socklen_t " addrlen ); +.fi +.SH ÀâÌÀ +.BR connect () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I sockfd +¤¬»²¾È¤·¤Æ¤¤¤ë¥½¥±¥Ã¥È¤ò +.I addr +¤Ç»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤ËÀܳ¤¹¤ë¡£ +.I addrlen +°ú¤­¿ô¤Ï +.I addr +¤ÎÂ礭¤µ¤ò¼¨¤¹¡£ +.I addr +¤Î¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¥½¥±¥Ã¥È +.I sockfd +¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤è¤ê°Û¤Ê¤ë¡£ +¤µ¤é¤Ê¤ë¾ÜºÙ¤Ï +.BR socket (2) +¤ò»²¾È¤Î¤³¤È¡£ + +¥½¥±¥Ã¥È +.I sockfd +¤¬ +.B SOCK_DGRAM +·¿¤Ç¤¢¤ì¤Ð¡¢ +.I addr +¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥Ç¡¼¥¿¥°¥é¥à¤ÎÁ÷¿®Àè¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ê¡¢ +¥Ç¡¼¥¿¥°¥é¥à¤ò¼õ¿®¤¹¤ëÍ£°ì¤Î¥¢¥É¥ì¥¹¤ò¼¨¤¹¤Ë²á¤®¤Ê¤¤¡£ +¥½¥±¥Ã¥È¤¬ +.B SOCK_STREAM +·¿¤â¤·¤¯¤Ï +.B SOCK_SEQPACKET +·¿¤Ç¤¢¤ì¤Ð¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I addr +¤Ç»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿¥½¥±¥Ã¥È¤ËÂФ¹¤ëÀܳ¤Î +ºîÀ®¤ò»î¤ß¤ë¡£ +.PP +°ìÈÌŪ¤Ë¡¢Àܳ»Ø¸þ (connection-oriented) ¥×¥í¥È¥³¥ë¤Ç¤Ï°ìÅÙ¤À¤± +.BR connect () +¤¬À®¸ù¤¹¤ë¡£ +ÈóÀܳ (connectionless) ¥×¥í¥È¥³¥ë¤Ç¤ÏÂбþ¤òÊѹ¹¤¹¤ë¤¿¤á¤Ë²¿ÅÙ¤â +.BR connect () +¤ò»ÈÍѤǤ­¤ë¡£ +ÈóÀܳ¥½¥±¥Ã¥È¤Ï +.I sockaddr +¤Î +.I sa_family +¥á¥ó¥Ð¤Ë +.B AF_UNSPEC +¤òÀßÄꤹ¤ë¤³¤È¤Ç¡¢Àܳ¥¢¥É¥ì¥¹¤ÎÂбþ¤ò²ò¾Ã¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.RB ( AF_UNSPEC +¤Ï¥«¡¼¥Í¥ë 2.2 °Ê¹ß¤Î Linux ¤Ç¥µ¥Ý¡¼¥È)¡£ +.SH ÊÖ¤êÃÍ +Àܳ¤Þ¤¿¤ÏÂбþ¤Å¤±¤ËÀ®¸ù¤¹¤ë¤È¥¼¥í¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +°Ê²¼¤Ï°ìÈÌŪ¤Ê¥½¥±¥Ã¥È¤Ë¤Ä¤¤¤Æ¤Î¥¨¥é¡¼¤Ç¤¢¤ë¡£Â¾¤Ë¥É¥á¥¤¥óÆÃÍ­¤Î¥¨¥é¡¼ +¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EACCES +Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤Ï¥Ñ¥¹Ì¾¤Ç¼±Ê̤µ¤ì¤ë¡£ +¥½¥±¥Ã¥È¡¦¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤«¤Ã¤¿¤«¡¢¥Ñ¥¹Ì¾¤Ø +Åþ㤹¤ë¤Þ¤Ç¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤¤¤º¤ì¤«¤ËÂФ¹¤ë¸¡º÷µö²Ä¤¬¤Ê¤«¤Ã¤¿¡£ +.RB ( path_resolution (7) +¤â»²¾È¤Î¤³¤È) +.TP +.BR EACCES ", " EPERM +¥½¥±¥Ã¥È¤Î¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¡¦¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¤Î¤Ë +¥æ¡¼¥¶¤¬¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤ØÀܳ¤ò»î¤ß¤¿¡£¤Þ¤¿¤Ï¡¢¥í¡¼¥«¥ë¤Î¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Î +µ¬Â§¤Ë¤è¤êÀܳ¤ÎÍ׵᤬¼ºÇÔ¤·¤¿¡£ +.TP +.B EADDRINUSE +¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤¬´û¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EAFNOSUPPORT +ÅϤµ¤ì¤¿¥¢¥É¥ì¥¹¤Î +.I sa_family +¥Õ¥£¡¼¥ë¥É¤¬Àµ¤·¤¤¥¢¥É¥ì¥¹¡¦¥Õ¥¡¥ß¥ê¡¼¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EAGAIN +»ÈÍѲÄǽ¤Ê¥í¡¼¥«¥ë¤Î¥Ý¡¼¥È¤¬¤Ê¤¤¤«¡¢ +¥ë¡¼¥Æ¥£¥ó¥°¥­¥ã¥Ã¥·¥å¤Ë½½Ê¬¤Ê¥¨¥ó¥È¥ê¤¬¤Ê¤¤¡£ +.B AF_INET +¤Î¾ì¹ç¤Ë¡¢¥í¡¼¥«¥ë¥Ý¡¼¥È¤Î¿ô¤òÁý¤ä¤¹ÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR ip (7) +¤Î +.I /proc/sys/net/ipv4/ip_local_port_range +¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B EALREADY +¥½¥±¥Ã¥È¤¬ÈóÄä»ß (nonblocking) ¤ËÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢ +Á°¤ÎÀܳ¤¬´°Î»¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EBADF +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤¬¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¥Æ¡¼¥Ö¥ë¤Î +Í­¸ú¤Ê¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ECONNREFUSED +¥ê¥â¡¼¥È¥¢¥É¥ì¥¹¤ÇÀܳ¤òÂԤäƤ¤¤ë¥×¥í¥°¥é¥à¤¬¤Ê¤¤¡£ +.TP +.B EFAULT +¥½¥±¥Ã¥È¹½Â¤ÂΤΥ¢¥É¥ì¥¹¤¬¥æ¡¼¥¶¡¼¤Î¥¢¥É¥ì¥¹¶õ´Ö³°¤Ë¤¢¤ë¡£ +.TP +.B EINPROGRESS +¥½¥±¥Ã¥È¤¬ÈóÄä»ß (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 +Ê᪤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ë¤è¤ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÃæÃǤµ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.\" TCP ¤Î¾ì¹ç¤Ï¡¢Àܳ½èÍý¤ÏÈóƱ´ü¤Ë¤Ê¤ë¤¬´°Î»¤¹¤ë¤À¤í¤¦¡£ +.\" http://lkml.org/lkml/2005/7/12/254 ¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B EISCONN +¥½¥±¥Ã¥È¤Ï´û¤ËÀܳ (connect) ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ENETUNREACH +Åþã¤Ç¤­¤Ê¤¤¥Í¥Ã¥È¥ï¡¼¥¯¤Ç¤¢¤ë¡£ +.TP +.B ENOTSOCK +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤¬¥½¥±¥Ã¥È¤È´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ETIMEDOUT +Àܳ¤ò»î¤ß¤Æ¤¤¤ëÅÓÃæ¤Ç»þ´ÖÀÚ¤ì (timeout) ¤Ë¤Ê¤Ã¤¿¡£¥µ¡¼¥Ð¡¼¤¬º®»¨¤·¤Æ¤¤¤Æ +¿·¤¿¤ÊÀܳ¤ò¼õ¤±Æþ¤ì¤é¤ì¤Ê¤¤¤Î¤«¤â¤·¤ì¤Ê¤¤¡£ +IP ¥½¥±¥Ã¥È¤Ç¤Ï¡¢ syncookie ¤¬¥µ¡¼¥Ð¡¼¤ÇÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¥¿¥¤¥à¥¢¥¦¥È¤¬Èó¾ï¤ËŤ¯¤Ê¤ë¾ì¹ç¤¬¤¢¤ë¤Î¤ÇÃí°Õ¤¹¤ë¤³¤È¡£ +.SH ½àµò +SVr4, 4.4BSD, +.RB ( connect () +´Ø¿ô¤Ï 4.2BSD ¤ÇºÇ½é¤ËÅо줷¤¿), POSIX.1-2001. +.\" SVr4 ¤Ç¤Ï¡¢°ìÈÌŪ¤Ê¥¨¥é¡¼¡¦¥³¡¼¥É¤È¤·¤Æ +.\" .BR EADDRNOTAVAIL , +.\" .BR EINVAL , +.\" .BR EAFNOSUPPORT , +.\" .BR EALREADY , +.\" .BR EINTR , +.\" .BR EPROTOTYPE , +.\" .B ENOSR +.\" ¤¬Äɲ䵤ì¤Æ¤¤¤ë¡£ +.\" ¤Þ¤¿¡¢Ëܥޥ˥奢¥ë¤Ë¤Ïµ­ºÜ¤·¤Æ¤¤¤Ê¤¤ÄɲäΥ¨¥é¡¼¾ò·ï¤¬Â¿¤¯µ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +POSIX.1-2001 ¤Ç¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ïɬ¿Ü¤È¤µ¤ì¤Æ¤ª¤é¤º¡¢ +Linux ¤Ç¤Ï¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÏɬÍפǤϤʤ¤¡£ +¤·¤«¤·¡¢Îò»ËŪ¤Ë¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¼ÂÁõ (BSD ·Ï) ¤Ç¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬ +ɬÍפǤ¢¤ê¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò +¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬¸­ÌÀ¤Ç¤¢¤í¤¦¡£ + +.BR connect () +¤Î»°ÈÖÌܤΰú¤­¿ô¤Ï 4.x BSD ¤ä libc4, libc5 ¤ÈƱÍÍ¤Ë¼ÂºÝ¤Ë¤Ï +.I int +¤Ç¤¢¤ë¡£ +POSIX ¤Ç¤Ïäþ;¶ÊÀÞ¤ò·Ð¤Æ¸½ºß¤Î +.I socklen_t +¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +glibc ¤Ç¤â +.I socklen_t +¤ò»È¤Ã¤Æ¤¤¤ë¡£ +.BR accept (2) +¤â»²¾È¤Î¤³¤È¡£ +.SH Îã +.BR connect () +¤ÎÍøÍÑÎ㤬 +.BR getaddrinfo (3) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR accept (2), +.BR bind (2), +.BR getsockname (2), +.BR listen (2), +.BR socket (2), +.BR path_resolution (7) diff --git a/release/man2/create_module.2 b/release/man2/create_module.2 new file mode 100644 index 00000000..230cfb10 --- /dev/null +++ b/release/man2/create_module.2 @@ -0,0 +1,64 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-29, Akihiro MOTOKI +.\" +.TH CREATE_MODULE 2 2007-06-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +create_module \- ¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Î¥¨¥ó¥È¥ê¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "caddr_t create_module(const char *" name ", size_t " size ); +.fi +.SH ÀâÌÀ +.BR create_module () +¤Ï¡¢¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Î¥¨¥ó¥È¥ê¤òºîÀ®¤·¡¢¤½¤Î¥â¥¸¥å¡¼¥ë¤ÎÊÝ»ý¤ËɬÍ×¤Ê +¥«¡¼¥Í¥ë¥á¥â¥ê¤òͽÌ󤷤褦¤È¤¹¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¥â¥¸¥å¡¼¥ë¤¬ÇÛÃÖ¤µ¤ì¤ë¥«¡¼¥Í¥ë¶õ´Ö¤Î¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EEXIST +¤½¤Î̾Á°¤Î¥â¥¸¥å¡¼¥ë¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¡£ +.TP +.B EFAULT +.I name +¤¬¥×¥í¥°¥é¥à¤¬¥¢¥¯¥»¥¹¤Ç¤­¤ë¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤Ë¤¢¤ë¡£ +.TP +.B EINVAL +Í׵ᤷ¤¿¥µ¥¤¥º¤¬¾®¤µ¤¹¤®¤Æ¡¢¥â¥¸¥å¡¼¥ë¤Î¥Ø¥Ã¥À¾ðÊ󤹤é³ÊǼ¤Ç¤­¤Ê¤¤¡£ +.TP +.B ENOMEM +¥â¥¸¥å¡¼¥ë¤ò³ÊǼ¤¹¤ë¤Î¤ËɬÍפÊÂ礭¤µ¤ÎϢ³¤·¤¿¥á¥â¥ê¥Ö¥í¥Ã¥¯¤ò +¥«¡¼¥Í¥ë¤¬³ÎÊݤǤ­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOSYS +.BR create_module () +¤¬¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢ +.RB ( CAP_SYS_MODULE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¤Î¤Ï¥«¡¼¥Í¥ë 2.4 ¤Þ¤Ç¤Î Linux ¤À¤±¤Ç¤¢¤ë¡£ +Linux 2.6 ¤Ç¤Ïºï½ü¤µ¤ì¤¿¡£ +.\" Removed in Linux 2.5.48 +.SH ½àµò +.BR create_module () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR delete_module (2), +.BR init_module (2), +.BR query_module (2) diff --git a/release/man2/delete_module.2 b/release/man2/delete_module.2 new file mode 100644 index 00000000..e6a12900 --- /dev/null +++ b/release/man2/delete_module.2 @@ -0,0 +1,57 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-29, Akihiro MOTOKI +.\" +.TH DELETE_MODULE 2 2006-02-09 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +delete_module \- ¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Î¥¨¥ó¥È¥ê¤òºï½ü¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int delete_module(const char *" name ); +.fi +.SH ÀâÌÀ +.BR delete_module () +¤Ï¡¢Ì¤»ÈÍÑ¤Î¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Î¥¨¥ó¥È¥ê¤òºï½ü¤·¤è¤¦¤È¤¹¤ë¡£ +.I name +¤¬ NULL ¤Î¾ì¹ç¡¢Ì¤»ÈÍѤΥ⥸¥å¡¼¥ë¤Î¤¦¤Á¡Ö¼«Æ°ºï½ü (auto-clean)¡× +¥Þ¡¼¥¯¤¬¤Ä¤¤¤¿¤â¤Î¤òÁ´¤Æºï½ü¤¹¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBUSY +¤½¤Î¥â¥¸¥å¡¼¥ë¤Ï»ÈÍÑÃæ¤Ç¤¢¤ë¡£ +.TP +.B EFAULT +.I name +¤¬¥×¥í¥°¥é¥à¤¬¥¢¥¯¥»¥¹¤Ç¤­¤ë¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤Ë¤¢¤ë¡£ +.TP +.B EINVAL +.I name +¤¬¶õʸ»úÎó¤Ç¤¢¤ë¡£ +.TP +.B ENOENT +¤½¤Î̾Á°¤Î¥â¥¸¥å¡¼¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢ +.RB ( CAP_SYS_MODULE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +.BR delete_module () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR create_module (2), +.BR init_module (2), +.BR query_module (2) diff --git a/release/man2/dup.2 b/release/man2/dup.2 new file mode 100644 index 00000000..554ec9c9 --- /dev/null +++ b/release/man2/dup.2 @@ -0,0 +1,228 @@ +.\" 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) 2005, 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 1993-07-21, Rik Faith +.\" Modified 1994-08-21, Michael Chastain : +.\" Fixed typoes. +.\" Modified 1997-01-31, Eric S. Raymond +.\" Modified 2002-09-28, aeb +.\" 2009-01-12, mtk, reordered text in DESCRIPTION and added some +.\" 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 2008-10-09 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +dup, dup2, dup3 \- ¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊ£À½¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int dup(int " oldfd ); +.BI "int dup2(int " oldfd ", int " newfd ); +.sp +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int dup3(int " oldfd ", int " newfd ", int " flags ); +.fi +.SH ÀâÌÀ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I oldfd +¤ÎÊ£À½¤òºî¤ë¡£ + +.BR dup () +¤ÏºÇ¤â¾®¤µ¤¤ÈÖ¹æ¤Î̤»ÈÍѤΥǥ£¥¹¥¯¥ê¥×¥¿¤ò +¿·¤·¤¤¥Ç¥£¥¹¥¯¥ê¥×¥¿¤È¤·¤Æ»ÈÍѤ¹¤ë¡£ + +.BR dup2 () +¤Ï +.I newfd +¤ò +.I oldfd +¤ÎÊ£À½¤È¤·¤ÆºîÀ®¤¹¤ë¡£ +ɬÍפǤ¢¤ì¤ÐºÇ½é¤Ë +.I newfd +¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +°Ê²¼¤ÎÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.IP * 3 +.I oldfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¾ì¹ç¡¢¤½¤Î¸Æ¤Ó½Ð¤·¤Ï¼ºÇÔ¤·¡¢ +.I newfd +¤Ï¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.IP * +.I oldfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¡¢ +.I newfd +¤¬ +.I oldfd +¤ÈƱ¤¸Ãͤξì¹ç¡¢ +.BR dup2 () +¤Ï²¿¤â¤»¤º¡¢ +.I newfd +¤òÊÖ¤¹¡£ +.PP +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¤¤¤º¤ì¤«¤¬À®¸ù¤òÊÖ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +¸Å¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤È¿·¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +¸ß¤¤¤Ë²Ä´¹¤Ê¤â¤Î¤È¤·¤Æ»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +2¤Ä¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏƱ¤¸¥Õ¥¡¥¤¥ëµ­½Ò (description) +.RB ( open (2) +»²¾È) ¤ò»²¾È¤·¤Æ¤ª¤ê¡¢¤·¤¿¤¬¤Ã¤Æ¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ä¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤¬ +¶¦Í­¤µ¤ì¤ë¡£Î㤨¤Ð¡¢°ìÊý¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +.BR lseek (2) +¤ò»È¤Ã¤Æ¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤òÊѹ¹¤·¤¿¾ì¹ç¡¢¤â¤¦°ìÊý¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î +¥ª¥Õ¥»¥Ã¥È¤âÊѲ½¤¹¤ë¡£ + +2¤Ä¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Õ¥é¥° (close-on-exec flag) +¤ò¶¦Í­¤·¤Ê¤¤¡£Ê£À½¤µ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î +close-on-exec flag +.RB ( fcntl (2) +»²¾È) ¤Ï off ¤È¤Ê¤ë¡£ + +.BR dup3 () +¤Ï +.BR dup2 () +¤ÈƱ¤¸¤À¤¬¡¢°Ê²¼¤ÎÅÀ¤¬°Û¤Ê¤ë¡£ +.IP * 3 +¸Æ¤Ó½Ð¤·¸µ¤¬¡¢¿·¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +close-on-exec ¥Õ¥é¥°¤ò¶¯À©Åª¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤ò¹Ô¤¦¤Ë¤Ï¡¢ +.I flags +¤Ë +.B O_CLOEXEC +¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬Ìò¤ËΩ¤ÄÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR open (2) +¤Î +.B O_CLOEXEC +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.IP * +.\" FIXME . To confirm with Al Viro that this was intended, and its rationale +.I oldfd +¤¬ +.I newfd +¤ÈƱ¤¸¾ì¹ç¡¢ +.BR dup3 () +¤Ï +.B EINVAL +¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¿·¤·¤¤¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I oldfd +¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¤«¡¢ +.I newfd +¤¬¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤È¤·¤Æµö¤µ¤ì¤ëÈϰϤ«¤é³°¤ì¤Æ¤¤¤ë¡£ +.TP +.B EBUSY +(Linux ¤Î¤ß) +.BR open (2) +¤ä +.BR dup () +¤È¤Î¶¥¹ç¾õÂ֤ξì¹ç¤Ë¡¢ +.BR dup2 () +¤ä +.BR dup3 () +¤Ï¤³¤Î¥¨¥é¡¼¤òÊÖ¤¹¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.B EINTR +.BR dup2 () +¤ä +.BR dup3 () +¤Î¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.RB ( dup3 ()) +.I flags +¤Ë̵¸ú¤ÊÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.\" FIXME . To confirm with Al Viro that this was intended, and its rationale +¤â¤·¤¯¤Ï¡¢ +.I oldfd +¤¬ +.I newfd +¤ÈƱ¤¸¤Ç¤¢¤Ã¤¿¡£ +.TP +.B EMFILE +¥×¥í¥»¥¹¤¬¤¹¤Ç¤Ë¥ª¡¼¥×¥ó¤Ç¤­¤ëºÇÂç¿ô¤Þ¤Ç¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿ +¤ò³«¤¤¤Æ¤¤¤Æ¡¢¤µ¤é¤Ë¿·¤·¤¤¤â¤Î¤ò³«¤³¤¦¤È¤·¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR dup3 () +¤Ï¥Ð¡¼¥¸¥ç¥ó 2.6.27 ¤Ç Linux ¤ËÄɲ䵤줿¡£ +glibc ¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.9 °Ê¹ß¤ÇÍøÍѤǤ­¤ë¡£ +.SH ½àµò +.BR dup (), +.BR dup2 (): +SVr4, 4.3BSD, POSIX.1-2001. + +.BR dup3 () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\" SVr4 ¤Ë¤Ï¾¤Ë EINTR, ENOLINK ¥¨¥é¡¼¾õÂ֤ε­½Ò¤¬¤¢¤ë¡£ +.\" POSIX.1 ¤Ë¤Ï¾¤Ë EINTR ¤¬¤¢¤ë¡£ +.\" EBUSY ¤¬ÊÖ¤µ¤ì¤ë¤Î¤Ï Linux Æȼ«¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.I newfd +¤¬ÈϰϤòĶ¤¨¤¿»þ¤ËÊÖ¤µ¤ì¤ë¥¨¥é¡¼¤Ï¡¢ +.BR dup2 () +¤È +.BR fcntl( "..., " F_DUPFD ", ..." ) +¤Ç¤Ï°Û¤Ã¤Æ¤¤¤ë¡£ +.BR dup2 () +¤¬ +.B F_DUPFD +¤ÈƱ¤¸¤è¤¦¤Ë +.B EINVAL +¤òÊÖ¤¹¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ + +.I newfd +¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +.BR close (2) +¤·¤¿»þ¤ËÊó¹ð¤µ¤ì¤ë¤Ï¤º¤Î¥¨¥é¡¼¤¬¼º¤ï¤ì¤Æ¤·¤Þ¤¦¡£ +.BR dup2 () +¤ä +.BR dup3 () +¤ò»È¤¦Á°¤ËÀ褺 +.I newfd +¤ò¥¯¥í¡¼¥º¤¹¤ë¤è¤¦¤Ë¤·¤¿Êý¤¬¤¤¤¤¤À¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR fcntl (2), +.BR open (2) diff --git a/release/man2/epoll_create.2 b/release/man2/epoll_create.2 new file mode 100644 index 00000000..5c20ab43 --- /dev/null +++ b/release/man2/epoll_create.2 @@ -0,0 +1,138 @@ +.\" +.\" 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" +.SH ̾Á° +epoll_create, epoll_create1 \- epoll ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥ª¡¼¥×¥ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int epoll_create(int " size ); +.BI "int epoll_create1(int " flags ); +.fi +.SH ÀâÌÀ +.BR epoll_create () +¤Ï¡¢ +.I size +¸Ä¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÝ»ý¤Ç¤­¤ëÂ礭¤µ¤Î¥¤¥Ù¥ó¥È¥Ð¥Ã¥­¥ó¥° +¥¹¥È¥¢¤Î³ä¤êÅö¤Æ¤ò¥«¡¼¥Í¥ë¤ËÂФ·¤ÆÍ׵᤹¤ë¤³¤È¤Ë¤è¤ê¡¢ +epoll ¡Ö¥¤¥ó¥¹¥¿¥ó¥¹¡×¤òºîÀ®¤¹¤ë¡£ +.I size +¤Ï¥Ð¥Ã¥­¥ó¥°¥¹¥È¥¢¤ÎºÇÂ祵¥¤¥º¤Ç¤Ï¤Ê¤¯¡¢ +ÆâÉô¹½Â¤¤ÎÂ礭¤µ¤ò¤É¤Î°Ì¤Ë¤¹¤ë¤«¤ò¥«¡¼¥Í¥ë¤ËÃΤ餻¤ë¥Ò¥ó¥È¤Ç¤·¤«¤Ê¤¤¡£ +(¸½ºß¤Ï +.I size +¤Ï̵»ë¤µ¤ì¤ë¡£²¼µ­¤Î¡ÖÃí°Õ¡×¤ò»²¾È¡£) + +.BR epoll_create () +¤Ï¡¢¿·¤·¤¤ epoll ¥¤¥ó¥¹¥¿¥ó¥¹¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤½¤Î¸å¤Î +.B epoll +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¸Æ¤Ó½Ð¤·¤Ë»È¤ï¤ì¤ë¡£ +¤â¤¦É¬ÍפǤʤ¯¤Ê¤Ã¤¿¾ì¹ç¤Ï¡¢ +.BR epoll_create () +¤ÇÊÖ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.BR close (2) +¤ò»È¤Ã¤Æ¥¯¥í¡¼¥º¤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +¤¢¤ë epoll ¥¤¥ó¥¹¥¿¥ó¥¹¤ò»²¾È¤¹¤ëÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¡¢ +¥«¡¼¥Í¥ë¤Ï¤½¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÇ˲õ¤·¤Æ¡¢Âбþ¤¹¤ë¥ê¥½¡¼¥¹¤ò²òÊü¤·¡¢ +ºÆ»ÈÍѤǤ­¤ë¤è¤¦¤Ë¤¹¤ë¡£ + +.BR epoll_create1 () +¤Ï¡¢ +.I flags +¤¬ 0 ¤Î¾ì¹ç¡¢¸½ºß¤Ç¤Ï»È¤ï¤ì¤Æ¤¤¤Ê¤¤ +.I size +°ú¤­¿ô¤¬¤Ê¤¯¤Ê¤Ã¤Æ¤¤¤ëÅÀ¤ò½ü¤±¤Ð +.BR epoll_create () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.I flags +¤Ë°Ê²¼¤ÎÃͤò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýÏ (OR) ¤Ç»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +°Û¤Ê¤ëÆ°ºî¤ò¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B EPOLL_CLOEXEC +¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +close-on-exec +.RB ( FD_CLOEXEC ) +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬Ìò¤ËΩ¤ÄÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR open (2) +¤Î +.B O_CLOEXEC +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +ÈóÉé¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I size +¤¬Àµ¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.RB ( epoll_create1 ()) +.I flags +¤Ë̵¸ú¤ÊÃͤ¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B EMFILE +.I /proc/sys/fs/epoll/max_user_instances +¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤Æ¤¤¤ë¡¢epoll ¥¤¥ó¥¹¥¿¥ó¥¹¤Î¥æ¡¼¥¶¡¼Ã±°Ì¤ÎÀ©¸Â¤Ë㤷¤¿¡£ +¹¹¤Ê¤ë¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR epoll (7) +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥àÀ©¸Â¤Ë㤷¤¿¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +.BR epoll_create () +¤Ï Linux Æȼ«¤Ç¤¢¤ê¡¢¥«¡¼¥Í¥ë 2.5.44 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.\" ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï Linux ¥«¡¼¥Í¥ë 2.5.66 ¤Ç³ÎÄꤵ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +Linux 2.6.8 °Ê¹ß¤Ç¤Ï¡¢ +.I size +°ú¤­¿ô¤Ï»ÈÍѤµ¤ì¤Ê¤¤ +(¥«¡¼¥Í¥ë¤Ï¡¢Æ°Åª¤ËɬÍפʥǡ¼¥¿¹½Â¤¤ÎÂ礭¤µ¤ò·èÄꤷ¡¢ +ºÇ½é¤Î¥Ò¥ó¥È¤òɬÍפ·¤Ê¤¤)¡£ +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR epoll_ctl (2), +.BR epoll_wait (2), +.BR epoll (7) diff --git a/release/man2/epoll_ctl.2 b/release/man2/epoll_ctl.2 new file mode 100644 index 00000000..fedda31e --- /dev/null +++ b/release/man2/epoll_ctl.2 @@ -0,0 +1,268 @@ +.\" +.\" 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 +.\" +.\" 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 2009-01-17 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +epoll_ctl \- epoll ¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÁàºî¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int epoll_ctl(int " epfd ", int " op ", int " fd \ +", struct epoll_event *" event ); +.SH ÀâÌÀ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I epfd +¤¬»²¾È¤¹¤ë epoll ¥¤¥ó¥¹¥¿¥ó¥¹¤ËÂФ¹¤ëÁàºî¤ò¹Ô¤¦¡£ +ÂоݤΥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤ËÂФ·¤Æ¡¢Áàºî +.I op +¤Î¼Â¹Ô¤¬Í׵ᤵ¤ì¤ë¡£ + +.I op +°ú¤­¿ô¤Ë»ØÄê¤Ç¤­¤ëÍ­¸ú¤ÊÃͤϰʲ¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.TP +.B EPOLL_CTL_ADD +ÂоݤΥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤ò¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I epfd +¤¬»²¾È¤¹¤ë +.B epoll +¥¤¥ó¥¹¥¿¥ó¥¹¤ËÅÐÏ¿¤·¡¢¥¤¥Ù¥ó¥È +.I event +¤ò +.I fd +¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿ÆâÉô¥Õ¥¡¥¤¥ë¤Ë´ØÏ¢ÉÕ¤±¤ë¡£ +.TP +.B EPOLL_CTL_MOD +¥¤¥Ù¥ó¥È +.I event +¤òÂоݤΥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë´ØÏ¢ÉÕ¤±¤ë¤è¤¦¤ËÊѹ¹¤¹¤ë¡£ +.TP +.B EPOLL_CTL_DEL +ÂоݤΥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤ò +.I epfd +¤¬»²¾È¤¹¤ë +.B epoll +¥¤¥ó¥¹¥¿¥ó¥¹¤«¤éºï½ü¤¹¤ë¡£ +.I event +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¤Î¤Ç¡¢NULL ¤Ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë +(⤷¡¢²¼µ­¤Î¡Ö¥Ð¥°¡×¤ò»²¾È)¡£ +.PP +.I event +°ú¤­¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë¥ê¥ó¥¯¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤òɽ¤¹¡£ +.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; + +struct epoll_event { + __uint32_t events; /* epoll ¥¤¥Ù¥ó¥È */ + epoll_data_t data; /* ¥æ¡¼¥¶¥Ç¡¼¥¿ÊÑ¿ô */ +}; +.fi +.in + +.I events +¥á¥ó¥Ð¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê»ÈÍѲÄǽ¤Ê¥¤¥Ù¥ó¥È¥¿¥¤¥×¤ò»È¤Ã¤Æ¹½À®¤µ¤ì¤¿ +¥Ó¥Ã¥È¥»¥Ã¥È¤Ç¤¢¤ë¡£ +.TP +.B EPOLLIN +´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¡¢ +.BR read (2) +Áàºî¤¬²Äǽ¤Ç¤¢¤ë¡£ +.TP +.B EPOLLOUT +´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¡¢ +.BR write (2) +Áàºî¤¬²Äǽ¤Ç¤¢¤ë¡£ +.TP +.BR EPOLLRDHUP" (Linux 2.6.17 °Ê¹ß)" +¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¤Î¾ü¤¬¡¢¥³¥Í¥¯¥·¥ç¥ó¤Î close ¡¢ +¤Þ¤¿¤Ï¥³¥Í¥¯¥·¥ç¥ó¤Î½ñ¤­¹þ¤ß¦¤Î shutdown ¤ò¹Ô¤Ã¤¿¡£ +(¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤È¡¢¥¨¥Ã¥¸¥È¥ê¥¬¤Î´Æ»ë¤ò¹Ô¤¦¾ì¹ç¤Ë¡¢ +ÄÌ¿®¤Î¤â¤¦°ìü¤¬ÊĤ¸¤é¤ì¤¿¤³¤È¤ò¸¡ÃΤ¹¤ë¥³¡¼¥É¤ò +Èó¾ï¤Ë´Ê·é¤Ë½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£) +.TP +.B EPOLLPRI +.BR read (2) +Áàºî¤¬²Äǽ¤Ê¶ÛµÞ (urgent) ¥Ç¡¼¥¿¤¬¤¢¤ë¡£ +.TP +.B EPOLLERR +´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¥¨¥é¡¼¾ò·ï¤¬µ¯¤³¤Ã¤¿¡£ +.BR epoll_wait (2) +¤Ï¾ï¤Ë¤³¤Î¥¤¥Ù¥ó¥È¤òÂԤĤΤǡ¢ +.I events +¤ËÀßÄꤹ¤ëɬÍפϤʤ¤¡£ +.TP +.B EPOLLHUP +´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¥Ï¥ó¥°¥¢¥Ã¥×¤¬µ¯¤³¤Ã¤¿¡£ +.BR epoll_wait (2) +¤Ï¾ï¤Ë¤³¤Î¥¤¥Ù¥ó¥È¤òÂԤĤΤǡ¢ +.I events +¤ËÀßÄꤹ¤ëɬÍפϤʤ¤¡£ +.TP +.B EPOLLET +´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë +¥¨¥Ã¥¸¥È¥ê¥¬Æ°ºî (Edge Triggered behavior) ¤òÀßÄꤹ¤ë¡£ +.B epoll +¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¡¢¥ì¥Ù¥ë¥È¥ê¥¬ (Level Triggered) ¤Ç¤¢¤ë¡£ +¥¨¥Ã¥¸¥È¥ê¥¬¤È¥ì¥Ù¥ë¥È¥ê¥¬¤Ë¤è¤ë¥¤¥Ù¥ó¥ÈʬÇÛµ¡¹½ +(event distribution architectures) ¤Ë¤Ä¤¤¤Æ¤Î¾ÜºÙ¤Ê¾ðÊó¤Ï¡¢ +.BR epoll (7) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.BR EPOLLONESHOT " (Linux 2.6.2 °Ê¹ß)" +´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë +°ì·âÆ°ºî (One-Shot behavior) ¤òÀßÄꤹ¤ë¡£ +¤³¤ì¤Ï¥¤¥Ù¥ó¥È¤¬ +.BR epoll_wait (2) +¤Ë¤è¤Ã¤Æ°ú¤­½Ð¤µ¤ì¤¿¸å¡¢ +´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÆâÉôŪ¤ËÇË´þ¤µ¤ì¡¢ +.B epoll +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë¤è¤Ã¤Æ¥¤¥Ù¥ó¥È¤¬Êó¹ð¤µ¤ì¤Ê¤¯¤Ê¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¿·¤·¤¤¥¤¥Ù¥ó¥È¥Þ¥¹¥¯¤Ç¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òºÆÅÙÍ­¸ú¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.BR epoll_ctl () +¤Ë +.B EPOLL_CTL_MOD +¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I op +°ú¤­¿ô¤Ë»ØÄê¤Ç¤­¤ëÍ­¸ú¤ÊÃͤϡ¢°Ê²¼¤ÎÄ̤ê: +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR epoll_ctl () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.BR epoll_ctl () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I epfd +¤« +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EEXIST +.I op +¤¬ +.B EPOLL_CTL_ADD +¤Ç¤¢¤ê¡¢¤«¤ÄÍ¿¤¨¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤¬¤³¤Î epoll ¥¤¥ó¥¹¥¿¥ó¥¹¤Ë´û¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I epfd +¤¬ +.B epoll +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +¤Þ¤¿¤Ï +.I fd +¤¬ +.I epfd +¤ÈƱ°ì¤Ç¤¢¤ë¡£ +¤Þ¤¿¤ÏÍ׵ᤵ¤ì¤¿Áàºî +.I op +¤¬¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOENT +.I op +¤¬ +.B EPOLL_CTL_MOD +¤Þ¤¿¤Ï +.B EPOLL_CTL_DEL +¤Ç¡¢¤«¤Ä +.I fd +¤¬¤³¤Î epoll ¥¤¥ó¥¹¥¿¥ó¥¹¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOMEM +Í׵ᤵ¤ì¤¿ +.I op +À©¸æÁàºî¤ò°·¤¦¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOSPC +epoll ¥¤¥ó¥¹¥¿¥ó¥¹¤Ë¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÅÐÏ¿ +.RB ( EPOLL_CTL_ADD ) +¤·¤è¤¦¤È¤·¤¿ºÝ¤Ë¡¢ +.I /proc/sys/fs/epoll/max_user_watches +¤Ç·è¤Þ¤ë¾å¸Â¤Ë㤷¤¿¡£ +¾ÜºÙ¤Ï +.BR epoll (7) +¤ò»²¾È¡£ +.TP +.B EPERM +Âоݥե¡¥¤¥ë +.I fd +¤¬ +.B epoll +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +.BR epoll_ctl () +¤Ï Linux Æȼ«¤Ç¤¢¤ê¡¢¥«¡¼¥Í¥ë 2.5.44 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.\" ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï Linux ¥«¡¼¥Í¥ë 2.5.66 ¤Ç³ÎÄꤵ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.SH È÷¹Í +.B epoll +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¡¢ +.BR poll (2) +¤ËÂбþ¤·¤Æ¤¤¤ëÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +Linux 2.6.9 ¤è¤êÁ°¤Ç¤Ï¡¢ +.B EPOLL_CTL_DEL +Áàºî¤ÎºÝ¡¢°ú¤­¿ô +.I event +¤Ë (¤¿¤È¤¨Ìµ»ë¤µ¤ì¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â) NULL ¤Ç¤Ê¤¤¥Ý¥¤¥ó¥¿¤òÅϤ¹É¬Íפ¬¤¢¤Ã¤¿¡£ +¥«¡¼¥Í¥ë 2.6.9 °Ê¹ß¤Ç¤Ï¡¢ +.B EPOLL_CTL_DEL +¤ò»È¤¦ºÝ¤Ë +.I event +¤Ë NULL ¤ò»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +2.6.9 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ø¤Î°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +.I event +¤Ë NULL ¤Ç¤Ê¤¤¥Ý¥¤¥ó¥¿¤ò»ØÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR epoll_create (2), +.BR epoll_wait (2), +.BR poll (2), +.BR epoll (7) diff --git a/release/man2/epoll_wait.2 b/release/man2/epoll_wait.2 new file mode 100644 index 00000000..a4c138b0 --- /dev/null +++ b/release/man2/epoll_wait.2 @@ -0,0 +1,195 @@ +.\" +.\" 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" +.SH ̾Á° +epoll_wait, epoll_pwait \- epoll ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î I/O ¥¤¥Ù¥ó¥È¤òÂÔ¤Ä +.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 +.SH ÀâÌÀ +.BR epoll_wait () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I epfd +¤Ç»²¾È¤µ¤ì¤ë +.B epoll +¥¤¥ó¥¹¥¿¥ó¥¹¤ËÂФ¹¤ë¥¤¥Ù¥ó¥È¤òÂԤġ£ +.I events +¤¬»Ø¤¹¥á¥â¥êÎΰè¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¤¬ÍøÍѲÄǽ¤Ê¥¤¥Ù¥ó¥È¤¬³ÊǼ¤µ¤ì¤ë¡£ +ºÇÂç +.I maxevents +¸Ä¤Î¥¤¥Ù¥ó¥È¤¬ +.BR epoll_wait () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë¡£ +.I maxevents +°ú¤­¿ô¤Ï 0 ¤è¤êÂ礭¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +ºÇÂç¤Ç +.I timeout +¥ß¥êÉô֥¤¥Ù¥ó¥È¤òÂԤġ£ +.I timeout +¤ò \-1 ¤Ë»ØÄꤹ¤ë¤È¡¢ +.BR epoll_wait () +¤Ï̵¸Â¤ËÂԤġ£ +¤Þ¤¿ +.I timeout +¤ò 0 ¤Ë»ØÄꤹ¤ë¤È¡¢ +.BR epoll_wait () +¤Ï¥¤¥Ù¥ó¥È¤¬ÍøÍѲÄǽ¤Ç¤Ê¤¯¤Æ¤â¡¢¤¹¤°¤ËÊÖ¤ë (ÊÖ¤êÃÍ¤Ï 0 ¤Ç¤¢¤ë)¡£ + +.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; + +struct epoll_event { + uint32_t events; /* epoll ¥¤¥Ù¥ó¥È */ + epoll_data_t data; /* ¥æ¡¼¥¶¥Ç¡¼¥¿ÊÑ¿ô */ +}; +.fi +.in + +ÊÖ¤µ¤ì¤ë¹½Â¤ÂΤΠ+.I data +¥á¥ó¥Ð¤Ë¤Ï¡¢¥æ¡¼¥¶¤¬ +.BR epoll_ctl (2) +.RB ( EPOLL_CTL_ADD ", " EPOLL_CTL_MOD ) +¤Ç»ØÄꤷ¤¿¥Ç¡¼¥¿¤¬³ÊǼ¤µ¤ì¤ë¡£ +°ìÊý¡¢ +.I events +¥á¥ó¥Ð¤Ë¤ÏÊÖ¤µ¤ì¤¿ÍøÍѲÄǽ¤Ê¥¤¥Ù¥ó¥È¤Î¥Ó¥Ã¥È¥Õ¥£¡¼¥ë¥É¤¬³ÊǼ¤µ¤ì¤ë¡£ +.SS epoll_pwait() +.BR epoll_wait () +¤È +.BR epoll_pwait () +¤Î´Ø·¸¤Ï¡¢ +.BR select (2) +¤È +.BR pselect (2) +¤Î´Ø·¸¤ÈƱÍͤǤ¢¤ë¡£ +.BR pselect (2) +ƱÍÍ¡¢ +.BR epoll_pwait () +¤ò»È¤¦¤È¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬½àÈ÷¤Ç¤­¤¿¾õÂ֤ˤʤ뤫¡¢ +¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤ë¤Þ¤Ç¡¢°ÂÁ´¤ËÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£ + +°Ê²¼¤Î +.BR epoll_pwait () +¤Î¸Æ¤Ó½Ð¤·¤Ï¡¢ +.nf + + ready = epoll_pwait(epfd, &events, maxevents, timeout, &sigmask); + +.fi +¼¡¤Î¸Æ¤Ó½Ð¤·¤ò +.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 +.I sigmask +°ú¤­¿ô¤Ë¤Ï NULL ¤ò»ØÄꤷ¤Æ¤â¤è¤¤¡£ +¤½¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR epoll_pwait () +¤Ï +.BR epoll_wait () +¤ÈÅù²Á¤È¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR epoll_wait () +¤ÏÍ׵ᤵ¤ì¤¿ I/O ¤ËÂФ·¤Æ½àÈ÷¤¬¤Ç¤­¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô¤òÊÖ¤¹¡£ +¤Þ¤¿Í׵ᤵ¤ì¤¿ +.I timeout +¥ß¥êÉäδ֤˥ե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬½àÈ÷¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¡¢0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.BR epoll_wait () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I epfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EFAULT +.I events +¤Ç»Ø¤µ¤ì¤ë¥á¥â¥êÎΰè¤Ë½ñ¤­¹þ¤ß¸¢¸Â¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¡£ +.TP +.B EINTR +Í׵ᤵ¤ì¤¿¤É¤Î¥¤¥Ù¥ó¥È¤âȯÀ¸¤»¤º¡¢¤«¤Ä +.I timeout +¤Î´ü¸Â¤¬ÀÚ¤ì¤ëÁ°¤Ë¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.I epfd +¤¬ +.B epoll +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +¤Þ¤¿¤Ï +.I maxevents +¤¬ 0 °Ê²¼¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR epoll_pwait () +¤Ï¥«¡¼¥Í¥ë 2.6.19 ¤Ç Linux ¤ËÄɲ䵤줿¡£ + +.BR epoll_pwait () +¤Î glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï glibc 2.6 °Ê¹ß¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +.BR epoll_wait () +¤Ï Linux Æȼ«¤Ç¤¢¤ê¡¢¥«¡¼¥Í¥ë 2.5.44 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.\" ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï Linux ¥«¡¼¥Í¥ë 2.5.66 ¤Ç³ÎÄꤵ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR epoll_create (2), +.BR epoll_ctl (2), +.BR epoll (7) diff --git a/release/man2/eventfd.2 b/release/man2/eventfd.2 new file mode 100644 index 00000000..d7a3d233 --- /dev/null +++ b/release/man2/eventfd.2 @@ -0,0 +1,406 @@ +.\" Copyright (C) 2008 Michael Kerrisk +.\" starting from a version by 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 +.\" +.\" 2008-10-10, mtk: describe eventfd2(), and EFD_NONBLOCK and EFD_CLOEXEC +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-04-08, Akihiro MOTOKI +.\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.13 +.\" +.TH EVENTFD 2 2009-01-26 Linux "Linux Programmer's Manual" +.SH ̾Á° +eventfd \- ¥¤¥Ù¥ó¥ÈÄÌÃÎÍѤΥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int eventfd(unsigned int " initval ", int " flags ); +.SH ÀâÌÀ +.BR eventfd () +¤Ï "eventfd ¥ª¥Ö¥¸¥§¥¯¥È" ¤òÀ¸À®¤¹¤ë¡£ +eventfd ¥ª¥Ö¥¸¥§¥¯¥È¤Ï¥æ¡¼¥¶¶õ´Ö¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¥¤¥Ù¥ó¥ÈÂÔ¤Á¼õ¤±/ÄÌÃÎÍѤΠ+»ÅÁȤߤȤ·¤Æ»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£¤Þ¤¿¡¢¥«¡¼¥Í¥ë¤¬¥æ¡¼¥¶¶õ´Ö¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë +¥¤¥Ù¥ó¥È¤òÄÌÃΤ¹¤ë¤¿¤á¤Ë¤â»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ï¡¢unsigned ¤Î 64 ¥Ó¥Ã¥ÈÀ°¿ô +.RI ( uint64_t ) +·¿¤Î¥«¥¦¥ó¥¿¤¬´Þ¤Þ¤ì¤Æ¤ª¤ê¡¢¤³¤Î¥«¥¦¥ó¥¿¤Ï¥«¡¼¥Í¥ë¤Ë¤è¤ê´ÉÍý¤µ¤ì¤ë¡£ +¤³¤Î¥«¥¦¥ó¥¿¤Ï +.I initval +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿Ãͤǽé´ü²½¤µ¤ì¤ë¡£ + +Linux 2.6.27 °Ê¹ß¤Ç¤Ï¡¢ +°Ê²¼¤ÎÃͤΤ¤¤¯¤Ä¤«¤ò¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýÏ (OR) ¤Ç»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +.BR eventfd () +¤Î¿¶Éñ¤¤¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 14 +.B EFD_NONBLOCK +¿·¤·¤¯À¸À®¤µ¤ì¤ë¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò (open file description) ¤Î +.B O_NONBLOCK +¥Õ¥¡¥¤¥ë¥¹¥Æ¡¼¥¿¥¹¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤³¤È¤Ç¡¢ +.B O_NONBLOCK +¤ò¥»¥Ã¥È¤¹¤ë¤¿¤á¤Ë +.BR fcntl (2) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.TP +.B EFD_CLOEXEC +¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +close-on-exec +.RB ( FD_CLOEXEC ) +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬Ìò¤ËΩ¤ÄÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR open (2) +¤Î +.B O_CLOEXEC +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.PP +¥Ð¡¼¥¸¥ç¥ó 2.6.26 °ÊÁ°¤Î Linux ¤Ç¤Ï¡¢ +.I flags +°ú¤­¿ô¤Ï̤»ÈÍѤǤ¢¤ê¡¢0 ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.BR eventfd () +¤Ï eventfd ¥ª¥Ö¥¸¥§¥¯¥È¤ò»²¾È¤¹¤ë¤Î¤Ë»ÈÍѤǤ­¤ë¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +¤òÊÖ¤¹¡£ÊÖ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ¤Ï°Ê²¼¤ÎÁàºî¤ò¼Â¹Ô¤Ç¤­¤ë¡£ +.TP +.BR read (2) +eventfd ¥«¥¦¥ó¥¿¤¬ 0 °Ê³°¤ÎÃͤξì¹ç¡¢ +.BR read (2) +¤Ï¥«¥¦¥ó¥¿Ãͤò³ÊǼ¤·¤¿ 8 ¥Ð¥¤¥È¤ÎÃͤòÊÖ¤·¡¢ +¥«¥¦¥ó¥¿ÃÍ¤Ï 0 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë +(ÊÖ¤êÃͤϥۥ¹¥È¡¦¥Ð¥¤¥È¥ª¡¼¥À¡¢¤Ä¤Þ¤ê +¥Û¥¹¥È¥Þ¥·¥ó¤ÇÀ°¿ôɽ¸½¤ËËÜÍè»ÈÍѤµ¤ì¤ë¥Ð¥¤¥È¥ª¡¼¥À¤Ç³ÊǼ¤µ¤ì¤ë)¡£ +.IP +.BR read (2) +¤Î»þÅÀ¤Ç¥«¥¦¥ó¥¿¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR read (2) +¤Ï¥«¥¦¥ó¥¿¤¬ 0 °Ê³°¤Ë¤Ê¤ë¤Þ¤ÇÄä»ß (block) ¤¹¤ë¡¢ +¤â¤·¤¯¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÈóÄä»ß (nonblocking) +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¡£ +.IP +ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤¬ 8 ¥Ð¥¤¥È̤Ëþ¤Î¾ì¹ç¡¢ +.BR read (2) +¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.BR write (2) +.BR write (2) +¤Ï¡¢°ú¤­¿ô¤Î¥Ð¥Ã¥Õ¥¡¤ÇÅϤµ¤ì¤¿ 8 ¥Ð¥¤¥È¤ÎÀ°¿ôÃͤò¥«¥¦¥ó¥¿¤Ë²Ã»»¤¹¤ë¡£ +¥«¥¦¥ó¥¿¤Ë³ÊǼ²Äǽ¤ÊºÇÂçÃÍ¤Ï unsigned ¤Î 64 ¥Ó¥Ã¥ÈÀ°¿ô¤ÎºÇÂçÃͤ«¤é +1 ¤ò°ú¤¤¤¿ÃÍ (¤¹¤Ê¤ï¤Á 0xfffffffffffffffe) ¤Ç¤¢¤ë¡£ +²Ã»»¤ò¹Ô¤¦¤È¥«¥¦¥ó¥¿Ãͤ¬ºÇÂçÃͤòĶ²á¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +.BR read (2) +¤¬¼Â¹Ô¤µ¤ì¤ë¤Þ¤Ç¡¢ +.BR write (2) +¤ÏÄä»ß (block) ¤¹¤ë¡¢ +¤â¤·¤¯¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÈóÄä»ß (nonblocking) +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¡£ +.IP +ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤¬ 8 ¥Ð¥¤¥È̤Ëþ¤Î¾ì¹ç¡¢¤â¤·¤¯¤Ï +ÃÍ 0xffffffffffffffff ¤ò½ñ¤­¹þ¤â¤¦¤È¤·¤¿¾ì¹ç¡¢ +.BR write (2) +¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.BR poll "(2), " select "(2) (¤ÈƱÍͤÎÁàºî)" +ÊÖ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢ +.BR poll (2) +.RB ( epoll (7) +¤âƱ¤¸) ¤ä +.BR select (2) +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤ª¤ê¡¢°Ê²¼¤Î¤è¤¦¤ÊÆ°ºî¤ò¤¹¤ë¡£ +.RS +.IP * 3 +¥«¥¦¥ó¥¿¤¬ 0 ¤è¤êÂ礭¤¤Ãͤξì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÆɤ߽Ф·²Äǽ¤È¤Ê¤ë +.RB ( select (2) +¤Î +.I readfds +°ú¤­¿ô¤ä +.BR poll (2) +¤Î +.B POLLIN +¥Õ¥é¥°)¡£ +.IP * +¾¯¤Ê¤¯¤È¤âÃÍ "1" ¤ò¡¢Ää»ß (block) ¤òȼ¤ï¤º¤Ë½ñ¤­¹þ¤á¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï½ñ¤­¹þ¤ß²Äǽ¤È¤Ê¤ë +.RB ( select (2) +¤Î +.I writefds +°ú¤­¿ô¤ä +.BR poll (2) +¤Î +.B POLLOUT +¥Õ¥é¥°)¡£ +.IP * +¥«¥¦¥ó¥¿ÃͤΥª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¡¢ +.BR select (2) +¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÆɤ߽Ф·²Äǽ¤È½ñ¤­¹þ¤ß²Äǽ¤ÎξÊý¤òÄÌÃΤ·¡¢ +.BR poll (2) +¤Ï +.B POLLERR +¥¤¥Ù¥ó¥È¤òÊÖ¤¹¡£ +¾å½Ò¤ÎÄ̤ꡢ +.BR write (2) +¤Ç¥«¥¦¥ó¥¿¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢ KAIO ¥µ¥Ö¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ 2^64 ²ó¤Î eventfd "signal posts" ¤¬ +¼Â¹Ô¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬µ¯¤³¤êÆÀ¤ë +(ÍýÏÀŪ¤Ë¤Ï¤¢¤êÆÀ¤ë¤¬¡¢¼ÂÍÑŪ¤Ë¤Ï¤¢¤êÆÀ¤Ê¤¤)¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¡¢ +.BR read (2) +¤Ï +.I uint64_t +¤ÎºÇÂçÃÍ (¤¹¤Ê¤ï¤Á 0xffffffffffffffff) ¤òÊÖ¤¹¡£ +.RE +.IP +eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤³¤ì°Ê³°¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +¿½Å API ¤Ç¤¢¤ë +.BR pselect (2), +.BR ppoll (2), +.BR epoll (7) +¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.TP +.BR close (2) +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¤½¤ì°Ê¹ß¤ÏɬÍפʤ¯¤Ê¤Ã¤¿ºÝ¤Ë¤Ï¡¢¥¯¥í¡¼¥º¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Ʊ¤¸ eventfd ¥ª¥Ö¥¸¥§¥¯¥È¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Á´¤Æ +¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¡¢¤½¤Î¥ª¥Ö¥¸¥§¥¯¥ÈÍѤλñ¸»¤¬¥«¡¼¥Í¥ë¤Ë¤è¤ê²òÊü¤µ¤ì¤ë¡£ +.PP +.BR fork (2) +¤ÇÀ¸À®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢ +.BR eventfd () +¤ÇÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +Ê£À½¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏƱ¤¸ eventfd ¥ª¥Ö¥¸¥§¥¯¥È¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç +.BR eventfd () +¤ÇÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÊÝ»ý¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR eventfd () +¤Ï¿·µ¬¤Î eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I flags +¤¬Ìµ¸ú¡£ +Linux 2.6.26 °ÊÁ°¤Ç¤Ï¡¢ +.I flags +¤¬ 0 °Ê³°¤ÎÃÍ¡£ +.TP +.B EMFILE +¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô¤¬¥×¥í¥»¥¹¤¢¤¿¤ê¤Î¾å¸Â¤Ë +㤷¤Æ¤¤¤¿¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ëÁí¿ô¤¬¥·¥¹¥Æ¥àÁ´ÂΤξå¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENODEV +.\" Note from Davide: +.\" The ENODEV error is basically never going to happen if +.\" the kernel boots correctly. That error happen only if during +.\" the kernel initialization, some error occur in the anonymous +.\" inode source initialization. +(¥«¡¼¥Í¥ëÆâ¤Î) ̵̾ inode ¥Ç¥Ð¥¤¥¹¤ò¥Þ¥¦¥ó¥È¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +¿·¤·¤¤ eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR eventfd () +¤Ï¥«¡¼¥Í¥ë 2.6.22 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +Àµ¤·¤¯Æ°ºî¤¹¤ë glibc ¦¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.8 °Ê¹ß¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\" eventfd() is in glibc 2.7, but reportedly does not build +.BR eventfd2 () +¥·¥¹¥Æ¥à¥³¡¼¥ë (¡ÖÃí°Õ¡×»²¾È) ¤Ï +¥«¡¼¥Í¥ë 2.6.27 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +¥Ð¡¼¥¸¥ç¥ó 2.9 °Ê¹ß¤Ç¤Ï¡¢glibc ¤Î +.BR eventfd () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥«¡¼¥Í¥ë¤¬Âбþ¤·¤Æ¤¤¤ì¤Ð +.BR eventfd2 () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍøÍѤ¹¤ë¡£ +.SH ½àµò +.BR eventfd () +¤È +.BR eventfd2 () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢¥Ñ¥¤¥×¤ò¥¤¥Ù¥ó¥È¤òÄÌÃΤ¹¤ë¤¿¤á¤À¤±¤Ë»ÈÍѤ·¤Æ¤¤¤ë +Á´¤Æ¤Î¾ìÌ̤ˤª¤¤¤Æ¡¢¥Ñ¥¤¥×¤ÎÂå¤ï¤ê¤Ë eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»È¤¦Êý¤¬¡¢¥Ñ¥¤¥×¤ò»È¤¦¾ì¹ç¤ËÈæ¤Ù¤Æ +¥«¡¼¥Í¥ë¤Ç¤Î¥ª¡¼¥Ð¥Ø¥Ã¥É¤ÏÈæ¤Ù¤ë¤È¤º¤Ã¤È¾®¤µ¤¯¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤â +°ì¤Ä¤·¤«É¬ÍפȤ·¤Ê¤¤ (¥Ñ¥¤¥×¤Î¾ì¹ç¤ÏÆó¤ÄɬÍפǤ¢¤ë)¡£ + +¥«¡¼¥Í¥ëÆâ¤Ç»ÈÍѤ¹¤ë¤È¡¢eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +¥«¡¼¥Í¥ë¶õ´Ö¤È¥æ¡¼¥¶¶õ´Ö¤Î¥Ö¥ê¥Ã¥¸µ¡Ç½¤òÄ󶡤¹¤ë¤³¤È¤¬¤Ç¤­¡¢ +Î㤨¤Ð KAIO (kernel AIO) +.\" ¤ä eventually syslets/threadlets +¤Î¤è¤¦¤Êµ¡Ç½¤¬¡¢¤¢¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë²¿¤é¤«¤ÎÁàºî¤¬´°Î»¤·¤¿¤³¤È¤ò +ÄÌÃΤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î½ÅÍפÊÅÀ¤Ï¡¢ +eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.BR select (2), +.BR poll (2), +.BR epoll (7) +¤ò»È¤Ã¤Æ¾¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÈÁ´¤¯Æ±Íͤ˴ƻë¤Ç¤­¤ëÅÀ¤Ç¤¢¤ë¡£ +¤³¤Î¤³¤È¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡Ö½¾Íè¤Î (traditional)¡× ¥Õ¥¡¥¤¥ë¤Î¾õÂÖÊѲ½¤È +eventfd ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¥µ¥Ý¡¼¥È¤¹¤ë¾¤Î¥«¡¼¥Í¥ëµ¡¹½¤Î¾õÂÖÊѲ½¤òƱ»þ¤Ë´Æ»ë +¤Ç¤­¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë +.RB ( eventfd () +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬¤Ê¤¤»þ¤Ë¤Ï¡¢¤³¤ì¤é¤Î¥«¡¼¥Í¥ëµ¡¹½¤Ï +.BR select (2), +.BR poll (2), +.BR epoll (7) +·Ðͳ¤Ç¿½Å¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤«¤Ã¤¿)¡£ +.SS ²¼Áؤˤ¢¤ë Linux ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë +²¼Áؤˤ¢¤ë Linux ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÆó¼ïÎढ¤ê¡¢ +.BR eventfd () +¤È¡¢¤â¤Ã¤È¿·¤·¤¤ +.BR eventfd2 () +¤Ç¤¢¤ë¡£ +.BR eventfd () +¤Ï +.I flags +°ú¤­¿ô¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¡£ +.BR eventfd2 () +¤Ç¤Ï¾åµ­¤ÎÃͤΠ+.I flags +¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢ +.BR eventfd2 () +¤¬ÍøÍѲÄǽ¤Ç¤¢¤ì¤Ð¡¢¤³¤ì¤ò»ÈÍѤ¹¤ë¡£ +.SS glibc ¤ÎÄɲõ¡Ç½ +GNU C ¥é¥¤¥Ö¥é¥ê¤Ï¡¢eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÆɤ߽Ф·¤È½ñ¤­¹þ¤ß¤Ë +¤ò´Ø¤¹¤ë¾ÜºÙ¤Î¤¤¤¯¤Ä¤«Ãê¾Ý²½¤¹¤ë¤¿¤á¤Ë¡¢°ì¤Ä¤Î·¿¤È¡¢Æó¤Ä¤Î´Ø¿ô¤òÄÉ²Ã¤Ç +ÄêµÁ¤·¤Æ¤¤¤ë¡£ +.in +4n +.nf + +typedef uint64_t eventfd_t; + +int eventfd_read(int fd, eventfd_t *value); +int eventfd_write(int fd, eventfd_t value); +.fi +.in + +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ëÆɤ߽Ф·¤È +½ñ¤­¹þ¤ß¤ÎÁàºî¤ò¼Â¹Ô¤·¡¢Àµ¤·¤¤¥Ð¥¤¥È¿ô¤¬Å¾Á÷¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï +0 ¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.SH Îã +.PP +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤·¡¢ +¤½¤Î¸å fork ¤ò¼Â¹Ô¤·¤Æ»Ò¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¡£ +¿Æ¥×¥í¥»¥¹¤¬¾¯¤·¤Î´Ö sleep ¤¹¤ë´Ö¤Ë¡¢»Ò¥×¥í¥»¥¹¤Ï +¥×¥í¥°¥é¥à¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿À°¿ô(Îó)¤ò¤½¤ì¤¾¤ì +eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë½ñ¤­¹þ¤à¡£ +¿Æ¥×¥í¥»¥¹¤Ï sleep ¤ò´°Î»¤¹¤ë¤È eventfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é +Æɤ߽Ф·¤ò¹Ô¤¦¡£ + +°Ê²¼¤Ë¼¨¤¹¥·¥§¥ë¥»¥Ã¥·¥ç¥ó¤Ë¤³¤Î¥×¥í¥°¥é¥à¤Î»È¤¤Êý¤ò¼¨¤¹¡£ +.in +4n +.nf + +.RB "$" " ./a.out 1 2 4 7 14" +Child writing 1 to efd +Child writing 2 to efd +Child writing 4 to efd +Child writing 7 to efd +Child writing 14 to efd +Child completed write loop +Parent about to read +Parent read 28 (0x1c) from efd +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include +#include /* Definition of uint64_t */ + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int +main(int argc, char *argv[]) +{ + int efd, j; + uint64_t u; + ssize_t s; + + if (argc < 2) { + fprintf(stderr, "Usage: %s ...\\n", argv[0]); + exit(EXIT_FAILURE); + } + + efd = eventfd(0, 0); + if (efd == \-1) + handle_error("eventfd"); + + switch (fork()) { + case 0: + for (j = 1; j < argc; j++) { + printf("Child writing %s to efd\\n", argv[j]); + u = strtoull(argv[j], NULL, 0); + /* strtoull() allows various bases */ + s = write(efd, &u, sizeof(uint64_t)); + if (s != sizeof(uint64_t)) + handle_error("write"); + } + printf("Child completed write loop\\n"); + + exit(EXIT_SUCCESS); + + default: + sleep(2); + + printf("Parent about to read\\n"); + s = read(efd, &u, sizeof(uint64_t)); + if (s != sizeof(uint64_t)) + handle_error("read"); + printf("Parent read %llu (0x%llx) from efd\\n", + (unsigned long long) u, (unsigned long long) u); + exit(EXIT_SUCCESS); + + case \-1: + handle_error("fork"); + } +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR futex (2), +.BR pipe (2), +.BR poll (2), +.BR read (2), +.BR select (2), +.BR signalfd (2), +.BR timerfd_create (2), +.BR write (2), +.BR epoll (7), +.BR sem_overview (7) diff --git a/release/man2/execve.2 b/release/man2/execve.2 new file mode 100644 index 00000000..d7b3aef7 --- /dev/null +++ b/release/man2/execve.2 @@ -0,0 +1,655 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 +.\" 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. +.\" +.\" Modified by Michael Haardt +.\" Modified 1993-07-21 by Rik Faith +.\" Modified 1994-08-21 by Michael Chastain : +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 1999-11-12 by Urs Thuermann +.\" Modified 2004-06-23 by Michael Kerrisk +.\" 2006-09-04 Michael Kerrisk +.\" Added list of process attributes that are not preserved on exec(). +.\" 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" +.SH ̾Á° +execve \- ¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int execve(const char *" filename ", char *const " argv "[], " +.br +.BI " char *const " envp []); +.SH ÀâÌÀ +.BR execve () +¤Ï¡¢\fIfilename\fP ¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¡£ +\fIfilename\fP ¤Ï¡¢¥Ð¥¤¥Ê¥ê¼Â¹Ô·Á¼°¤«¡¢ +°Ê²¼¤Î·Á¼°¤Î¹Ô¤Ç»Ï¤Þ¤ë¥¹¥¯¥ê¥×¥È¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.in +4n +.nf +\fB#!\fP \fIinterpreter \fP[optional-arg] +.fi +.in + +¸å¼Ô¤Î¾ÜºÙ¤Ï¡¢¸å¤í¤Î¡Ö¥¤¥ó¥¿¥×¥ê¥¿¡¦¥¹¥¯¥ê¥×¥È¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ + +\fIargv\fP ¤Ï¿·¤·¤¤¥×¥í¥°¥é¥à¤ËÅϤµ¤ì¤ë°ú¤­¿ôʸ»úÎó¤ÎÇÛÎó¤Ç¤¢¤ë¡£ +\fIenvp\fP ¤Ïʸ»úÎó¤ÎÇÛÎó¤Ç¤¢¤ê¡¢ÅÁÅýŪ¤Ë \fBkey=value\fP ¤Î·Á¼°¤ò +¤·¤Æ¤ª¤ê¡¢¿·¤·¤¤¥×¥í¥°¥é¥à¤Î´Ä¶­ÊÑ¿ô¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +\fIargv\fP ¤È \fIenvp\fP ¤Ï¤¤¤º¤ì¤â¤Î NULL ¥Ý¥¤¥ó¥¿¤Ç½ª¤ï¤Ã¤Æ¤¤¤ë +ɬÍפ¬¤¢¤ë¡£°ú¤­¿ôÇÛÎó¤È´Ä¶­ÊÑ¿ô¤Ï¡¢¸Æ¤Ó½Ð¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Î main ´Ø¿ô¤ò +°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥¢¥¯¥»¥¹²Äǽ¤Ë¤Ê¤ë¡£ + +.in +4n +.nf +int main(int argc, char *argv[], char *envp[]) +.fi +.in + +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR execve () +¤ÏÊÖ¤é¤Ê¤¤¡£ +¤½¤·¤Æ¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î text, data, bss, ¥¹¥¿¥Ã¥¯¤Ï¡¢ +Æɤ߹þ¤Þ¤ì¤¿¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ¾å½ñ¤­¤µ¤ì¤ë¡£ + +¸µ¤Î¥×¥í¥°¥é¥à¤¬ ptrace ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR execve () +¤¬À®¸ù¤·¤¿¸å¤Ë +¤½¤Î¥×¥í¥°¥é¥à¤Ë \fBSIGTRAP\fP ¤¬Á÷¤é¤ì¤ë¡£ + +.I filename +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥°¥é¥à¥Õ¥¡¥¤¥ë¤Ë set-user-ID ¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢ +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ +.I nosuid +.RB ( mount (2) +¤Î +.B MS_NOSUID +¥Õ¥é¥°) ¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤ª¤é¤º¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬ ptrace ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥æ¡¼¥¶ ID ¤Ï +¥×¥í¥°¥é¥à¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô (owner) ¤ËÊѹ¹¤µ¤ì¤ë¡£ +ƱÍͤˡ¢¥×¥í¥°¥é¥à¥Õ¥¡¥¤¥ë¤Ë set-group-ID ¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ÎÍ­¸ú¥°¥ë¡¼¥× ID ¤Ï +¥×¥í¥°¥é¥à¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×¤ËÊѹ¹¤µ¤ì¤ë¡£ + +¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤ÏÊݸ (saved) set-user-ID ¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ +ƱÍͤˡ¢¼Â¸ú¥°¥ë¡¼¥× ID ¤ÏÊݸ set-group-ID ¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ +¤³¤Î¥³¥Ô¡¼¤Ï¡¢set-user-ID / set-group-ID µö²Ä¥Ó¥Ã¥È¤Ë¤è¤êȯÀ¸¤¹¤ë +¼Â¸ú ID ¤ÎÊѹ¹¸å¤Ë¹Ô¤ï¤ì¤ë¡£ + +¼Â¹Ô¥Õ¥¡¥¤¥ë¤¬Æ°Åª¥ê¥ó¥¯¤µ¤ì¤¿ a.out ¼Â¹Ô·Á¼°¤Ç¡¢¶¦Í­¥é¥¤¥Ö¥é¥ê¤Î +¥¹¥¿¥Ö¤ò´Þ¤à¤â¤Î¤À¤Ã¤¿¾ì¹ç¡¢¼Â¹Ô¤Î³«»Ï»þ¤Ë Linux ¤Î +¥À¥¤¥Ê¥ß¥Ã¥¯¡¦¥ê¥ó¥« +.BR ld.so (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 ¤¬»ÈÍѤµ¤ì¤ë¡£ + +°Ê²¼¤Ë¼¨¤¹°Ê³°¤Î¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹Â°À­¤Ï +.BR execve () +¤ÎÁ°¸å¤ÇÊÝ»ý¤µ¤ì¤ë¡£ +.IP * +Ê᪤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡ (disposition) ¤Ï +¥Ç¥Õ¥©¥ë¥ÈÆ°ºî¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë +.RB ( signal (7))¡£ +.IP * +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Ï¤É¤ì¤âÊÝ»ý¤µ¤ì¤Ê¤¤ +.RB ( sigaltstack (2))¡£ +.IP * +¥á¥â¥ê¥Þ¥Ã¥Ô¥ó¥°¤ÏÊÝ»ý¤µ¤ì¤Ê¤¤ +.RB ( mmap (2))¡£ +.IP * +Éղ䵤줿 (attached) System V ¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤ÏʬΥ¤µ¤ì¤ë +.RB ( shmat (2))¡£ +.IP * +POSIX ¶¦Í­¥á¥â¥êÎΰè¤Ï¥Þ¥Ã¥Ô¥ó¥°¤ò²ò½ü¤µ¤ì¤ë +.RB ( shm_open (3))¡£ +.IP * +¥ª¡¼¥×¥ó¤µ¤ì¤¿ POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¥¯¥í¡¼¥º¤µ¤ì¤ë +.RB ( mq_overview (7))¡£ +.IP * +¥ª¡¼¥×¥ó¤µ¤ì¤¿ POSIX ̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤Ï¤¤¤º¤ì¤â¥¯¥í¡¼¥º¤µ¤ì¤ë +.RB ( sem_overview (7))¡£ +.IP * +POSIX ¥¿¥¤¥Þ¤ÏÊÝ»ý¤µ¤ì¤Ê¤¤ +.RB ( timer_create (2))¡£ +.IP * +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤Ï¤¤¤º¤ì¤â¥¯¥í¡¼¥º¤µ¤ì¤ë +.RB ( opendir (3))¡£ +.IP * +¥á¥â¥ê¥í¥Ã¥¯¤ÏÊÝ»ý¤µ¤ì¤Ê¤¤ +.RB ( mlock (2), +.BR mlockall (2))¡£ +.IP * +½ªÎ» (exit) ¥Ï¥ó¥É¥é¤ÏÊÝ»ý¤µ¤ì¤Ê¤¤ +.RB ( atexit (3), +.BR on_exit (3))¡£ +.IP * +ÉâÆ°¾®¿ôÅÀ´ØÏ¢¤Î´Ä¶­¤Ï¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë +.RB ( fenv (3) +»²¾È)¡£ +.PP +¾åµ­¤Î¥ê¥¹¥È¤Î¥×¥í¥»¥¹Â°À­¤Ï¤¤¤º¤ì¤â POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +°Ê²¼¤Ë¼¨¤¹ Linux ¸ÇÍ­¤Î¥×¥í¥»¥¹Â°À­¤â +.BR execve () +¤ÎÁ°¸å¤ÇÊÝ»ý¤µ¤ì¤Ê¤¤¡£ +.IP * 3 +set-user-ID ¤« set-group-ID ¤µ¤ì¤¿¥×¥í¥°¥é¥à¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR prctl (2) +¤Î +.B PR_SET_DUMPABLE +¥Õ¥é¥°¤Ï¥¯¥ê¥¢¤µ¤ì¤ë¡£¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¤³¤Î¥Õ¥é¥°¤Ï¥»¥Ã¥È¤µ¤ì¤ë¡£ +.IP * +.BR prctl (2) +¤Î +.B PR_SET_KEEPCAPS +¥Õ¥é¥°¤Ï¥¯¥ê¥¢¤µ¤ì¤ë¡£ +.IP * +¥×¥í¥»¥¹Ì¾¤Ï¿·¤·¤¤¼Â¹Ô¥Õ¥¡¥¤¥ë¤Î̾Á°¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +¥×¥í¥»¥¹Ì¾¤Ï +.BR prctl (2) +¤Î +.B PR_SET_NAME +¤ÇÀßÄê¤Ç¤­¡¢ +.I "ps\ \-o comm" +¤Çɽ¼¨¤Ç¤­¤ë¡£ +.IP * +½ªÎ»¥·¥°¥Ê¥ë (termination signal) ¤Ï +.B SIGCHLD +¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë +.RB ( clone (2) +»²¾È)¡£ +.PP +°Ê²¼¤ÎÅÀ¤Ë¤Ä¤¤¤Æ¤âÃí°Õ¤¹¤ë¤³¤È: +.IP * 3 +¸Æ¤Ó½Ð¤·¸µ¥¹¥ì¥Ã¥É°Ê³°¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤Ï +.BR execve () +Ãæ¤ËÇË´þ¤µ¤ì¤ë¡£ +mutex¡¢¾ò·ïÊÑ¿ô¡¢¤½¤Î¾¤Î pthread ¥ª¥Ö¥¸¥§¥¯¥È¤ÏÊÝ»ý¤µ¤ì¤Ê¤¤¡£ +.IP * +\fIsetlocale(LC_ALL, "C")\fP ÁêÅö¤Î½èÍý¤¬¥×¥í¥°¥é¥à³«»Ï»þ¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ +.IP * +POSIX.1-2001 ¤Ï¡¢Æ°ºî¤¬Ìµ»ë¤«¥Ç¥Õ¥©¥ë¥È¤ËÀßÄꤵ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥·¥°¥Ê¥ë +¤Î½èÍýÊýË¡¤ÏÊѹ¹¤»¤º¤½¤Î¤Þ¤Þ¤Ë¤¹¤ë¡¢¤Èµ¬Äꤷ¤Æ¤¤¤ë¡£ +⤷¡¢POSIX.1-2001 ¤Ë¤Ï°ì¤ÄÎã³°¤¬¤¢¤ê¡¢ +.B SIGCHLD +¤¬Ìµ»ë¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¤½¤Î½èÍýÊýË¡¤òÊѹ¹¤»¤º¤Ë¤½¤Î¤Þ¤Þ¤Ë¤¹¤ë¤«¡¢¥Ç¥Õ¥©¥ë¥ÈÆ°ºî¤Ë¥ê¥»¥Ã¥È¤¹¤ë¤«¤Ï +¼ÂÁõ°Í¸¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +Linux ¤Ç¤ÏÁ°¼Ô (Êѹ¹¤·¤Ê¤¤) ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.IP * +´°Î»¤·¤Æ¤¤¤Ê¤¤ÈóƱ´ü I/O Áàºî¤Ï¥­¥ã¥ó¥»¥ë¤µ¤ì¤ë +.RB ( aio_read (3), +.BR aio_write (3))¡£ +.IP * +.BR execve (2) +»þ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î°·¤¤¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR capabilities (7) +¤ò»²¾È¡£ +.IP * +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.BR execve () +¤ò¹Ô¤Ã¤¿¸å¤Ç¤â¥ª¡¼¥×¥ó¤µ¤ì¤¿¤Þ¤Þ¤Ç¤¢¤ë¡£ +close-on-exec ¤Î°õ¤¬ÉÕ¤¤¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.BR fcntl (2) +¤Î +.B FD_CLOEXEC +¤ÎÀâÌÀ¤ò»²¾È¡£ +(¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¡¢¤³¤Î¥×¥í¥»¥¹¤¬ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ³ÍÆÀ¤·¤Æ¤¤¤¿ +¥ì¥³¡¼¥É¤Î¥í¥Ã¥¯¤¬Á´¤Æ²òÊü¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£) +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 +.SS ¥¤¥ó¥¿¥×¥ê¥¿¡¦¥¹¥¯¥ê¥×¥È +¥¤¥ó¥¿¥×¥ê¥¿¡¦¥¹¥¯¥ê¥×¥È¤È¤Ï¡¢¼Â¹Ôµö²Ä¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¡¢ +ºÇ½é¤Î¹Ô¤¬°Ê²¼¤Î·Á¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Î¤³¤È¤Ç¤¢¤ë¡£ + +.in +4n +.nf +\fB#!\fP \fIinterpreter \fP[optional-arg] +.fi +.in + +.I interpreter +¤ÏÍ­¸ú¤Ê¼Â¹Ô¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤½¤ì¼«¿È¤¬¥¹¥¯¥ê¥×¥È¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.BR execve () +¤Î +.I filename +°ú¤­¿ô¤¬¥¤¥ó¥¿¥×¥ê¥¿¥¹¥¯¥ê¥×¥È¤ò»ØÄꤷ¤Æ¤¤¤ë¾ì¹ç¡¢ +.I interpreter +¤Ï°Ê²¼¤Î°ú¤­¿ô¤Çµ¯Æ°¤µ¤ì¤ë¡£ + +.in +4n +.nf +\fIinterpreter\fP [optional-arg] \fIfilename\fP arg... +.fi +.in + +.I arg... +¤Ï +.BR execve () +¤Î +.I argv +°ú¤­¿ô¤¬»Ø¤¹¥ï¡¼¥ÉÎó¤Ç¤¢¤ë¡£ + +°Ü¿¢À­¤ò»ý¤¿¤¹¤Ë¤Ï¡¢ +.I optional-arg +¤Ï¶õ¤« 1¥ï¡¼¥É¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë +(¤Ä¤Þ¤ê¡¢¥Û¥ï¥¤¥È¡¦¥¹¥Ú¡¼¥¹¤ò´Þ¤á¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤)¡£ +²¼µ­¤Î¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¡£ +.SS "°ú¤­¿ô¤È´Ä¶­ÊÑ¿ô¤Î¹ç·×¥µ¥¤¥º¤Î¾å¸Â" +¤Û¤È¤ó¤É¤Î Unix ¤Î¼ÂÁõ¤Ï¡¢¿·¤·¤¤¥×¥í¥°¥é¥à¤ËÅϤ¹¤³¤È¤¬¤Ç¤­¤ë +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô +.RI ( argv ) +¤È´Ä¶­ÊÑ¿ô +.RI ( envp ) +¤Îʸ»úÎ󷲤ιç·×¥µ¥¤¥º¤Ë²¿¤é¤«¤Î¾å¸Â¤òÀߤ±¤Æ¤¤¤ë¡£ +POSIX.1 ¤Ï¡¢ +.B ARG_MAX +Äê¿ô¤ò»È¤Ã¤Æ¤³¤Î¾å¸Â¤ò·è¤á¤ë¼ÂÁõ¤òǧ¤á¤Æ¤¤¤ë +.RB ( ARG_MAX +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤ë¤«¡¢¼Â¹Ô»þ¤Ë +.I "sysconf(_SC_ARG_MAX)" +¤Î¸Æ¤Ó½Ð¤·¤ÇÆþ¼ê¤Ç¤­¤ë¤«¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë)¡£ + +¥«¡¼¥Í¥ë 2.6.23 ¤è¤êÁ°¤Î Linux ¤Ç¤Ï¡¢´Ä¶­ÊÑ¿ô¤È°ú¤­¿ô¤Îʸ»úÎ󷲤ò +³ÊǼ¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¥á¥â¥ê¤Ï 32 ¥Ú¡¼¥¸¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤¿ +(32 ¥Ú¡¼¥¸¤È¤¤¤¦¤Î¤Ï¥«¡¼¥Í¥ëÄê¿ô +.B MAX_ARG_PAGES +¤ÇÄêµÁ¤µ¤ì¤ë)¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +¥Ú¡¼¥¸¥µ¥¤¥º¤¬ 4 kB ¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢ +ºÇÂ祵¥¤¥º¤Ï 128 kB ¤È¤¤¤¦¤³¤È¤Ë¤Ê¤ë¡£ + +¥«¡¼¥Í¥ë 2.6.23 °Ê¹ß¤Ç¤Ï¡¢¤Û¤È¤ó¤É¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤¤¤Æ¡¢ +.BR execve () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿»þÅÀ¤ÇŬÍѤµ¤ì¤Æ¤¤¤ë¥ê¥½¡¼¥¹¤Î¥½¥Õ¥È¾å¸Â +.B RLIMIT_STACK +¤Ë´ð¤Å¤¤¤¿¥µ¥¤¥º¾å¸Â¤¬»È¤ï¤ì¤ë +(¥á¥â¥ê´ÉÍý¥æ¥Ë¥Ã¥È (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. +¤³¤ì¤é¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢¹ç·×¥µ¥¤¥º¤Ïµö²Ä¤µ¤ì¤¿¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤Î +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). +Linux 2.6.25 °Ê¹ß¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤Ï¤³¤Î¥µ¥¤¥º¾å¸Â¤Ë 32 ¥Ú¡¼¥¸¤Î²¼¸Â¤ò +Àߤ±¤Æ¤¤¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢ +.B RLIMIT_STACK +¤¬Èó¾ï¤Ë¾®¤µ¤¯ÀßÄꤵ¤ì¤¿¾ì¹ç¤Ç¤â¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¾¯¤Ê¤¯¤È¤â +Linux 2.6.23 °ÊÁ°¤ÇÄ󶡤µ¤ì¤Æ¤¤¤¿¤Î¤ÈƱ¤¸Â礭¤µ¤Î°ú¤­¿ô¤È´Ä¶­ÊÑ¿ô¤Î¶õ´Ö +¤ÈƱ¤¸¤À¤±¤Ï³ÎÊݤǤ­¤ë¤³¤È¤¬Êݾڤµ¤ì¤Æ¤¤¤ë +(¤³¤ÎºÇÄã¸Â¤ÎÊÝ¾Ú¤Ï Linux 2.6.23 ¤È 2.6.24 ¤Ç¤ÏÄ󶡤µ¤ì¤Æ¤¤¤Ê¤¤)¡£ +¤Þ¤¿¡¢³Æʸ»úÎó¤Î¾å¸Â¤Ï 32 ¥Ú¡¼¥¸ (¥«¡¼¥Í¥ëÄê¿ô +.BR MAX_ARG_STRLEN ) +¤Ç¡¢Ê¸»úÎó¿ô¤ÎºÇÂçÃÍ¤Ï 0x7FFFFFFF ¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È +.BR execve () +¤ÏÊÖ¤é¤Ê¤¤¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B E2BIG +´Ä¶­ÊÑ¿ô +.RI ( envp ) +¤È°ú¤­¿ô¥ê¥¹¥È +.RI ( argv ) +¤Î¹ç·×¥Ð¥¤¥È¿ô¤¬Â礭²á¤®¤ë¡£ +.TP +.B EACCES +.I filename +¤ä¥¹¥¯¥ê¥×¥È¥¤¥ó¥¿¥×¥ê¥¿Ì¾¤Î¹½À®Í×ÁǤ˸¡º÷µö²Ä (search permission) +¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EACCES +¥Õ¥¡¥¤¥ë¤â¤·¤¯¤Ï¥¹¥¯¥ê¥×¥È¤Î¥¤¥ó¥¿¥×¥ê¥¿¤¬Ä̾ï¥Õ¥¡¥¤¥ë (regular file) +¤Ç¤Ê¤¤¡£ +.TP +.B EACCES +¥Õ¥¡¥¤¥ë¤ä¥¹¥¯¥ê¥×¥È¤ä ELF ¥¤¥ó¥¿¥×¥ê¥¿¤Ë +¼Â¹Ôµö²Ä (execute permission) ¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EACCES +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬ +.I noexec +¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EFAULT +.I filename +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +ELF ¼Â¹Ô·Á¼°¤ÇÊ£¿ô¤Î PT_INTERP ¥»¥°¥á¥ó¥È¤¬Â¸ºß¤¹¤ë¡£ +(¤¹¤Ê¤ï¤ÁÊ£¿ô¤Î¥¤¥ó¥¿¥×¥ê¥¿¤ò»ØÄꤷ¤¿¡£) +.TP +.B EIO +I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EISDIR +ELF ¥¤¥ó¥¿¥×¥ê¥¿¤¬¥Ç¥£¥ì¥¯¥È¥ê¤À¤Ã¤¿¡£ +.TP +.B ELIBBAD +ELF ¥¤¥ó¥¿¥×¥ê¥¿¤¬Íý²ò¤Ç¤­¤ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤Ê¤«¤Ã¤¿¡£ +.TP +.B ELOOP +.I filename +¤ä¥¹¥¯¥ê¥×¥È¤ä ELF ¤Î¥¤¥ó¥¿¥×¥ê¥¿¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿ +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B EMFILE +¤½¤Î¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¾å¸Â¤Þ¤Ç´û¤Ë¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¡£ +.TP +.B ENAMETOOLONG +.I filename +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENFILE +¤½¤Î¥·¥¹¥Æ¥à¤Ç¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤ÎÀ©¸Â¤Ë㤷¤¿¡£ +.TP +.B ENOENT +¥Õ¥¡¥¤¥ë +.I filename +¤«¥¹¥¯¥ê¥×¥È¤ä ELF ¤Î¥¤¥ó¥¿¥×¥ê¥¿¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOEXEC +¼Â¹Ô¥Õ¥¡¥¤¥ë¤¬Íý²ò¤Ç¤­¤Ê¤¤·Á¼°¤Ç¤¢¤ë¤«¡¢°ã¤¦¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¤â¤Î¤«¡¢ +¤½¤Î¾¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¡¦¥¨¥é¡¼¤Ë¤è¤ê¼Â¹Ô¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I filename +¤ä¥¹¥¯¥ê¥×¥È¤ä ELF ¤Î¥¤¥ó¥¿¥×¥ê¥¿¤Î¹½À®Í×ÁǤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EPERM +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬ +.I nosuid +¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¡¢¥æ¡¼¥¶¤¬¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Ç¤Ê¤¯¡¢ +¥Õ¥¡¥¤¥ë¤Ë set-user-ID ¤¢¤ë¤¤¤Ï set-group-ID ¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EPERM +¥×¥í¥»¥¹¤¬¥È¥ì¡¼¥¹¤µ¤ì¡¢¥æ¡¼¥¶¤¬¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Ç¤Ê¤¯¡¢ +¥Õ¥¡¥¤¥ë¤Ë set-user-ID ¤¢¤ë¤¤¤Ï set-group-ID ¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ETXTBSY +¼Â¹Ô¥Õ¥¡¥¤¥ë¤ò½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤¬¤¢¤ë¡£ +.SH ½àµò +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 ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +set-user-id ¥×¥í¥»¥¹¤È set-group-ID ¥×¥í¥»¥¹¤Ï +.BR ptrace (2) +¤Ç¤­¤Ê¤¤¡£ + +Linux ¤Ï¥¹¥¯¥ê¥×¥È¤Î set-user-ID ¤È set-group-ID ¥Ó¥Ã¥È¤ò̵»ë¤¹¤ë¡£ + +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +.I nosuid +¤Ç¥Þ¥¦¥ó¥È¤·¤¿¾ì¹ç¤Ë set-user-ID/set-group-ID ¤Î¼Â¹Ô¥Õ¥¡¥¤¥ë¤ò +¤É¤ÎÍͤ˰·¤¦¤«¤Ï¡¢Linux ¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë: +¤¢¤ë¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢¤¹¤Ç¤ËɬÍפʸ¢¸Â¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤ò½ü¤¤¤Æ¡¢ +¤½¤Î¼Â¹Ô¤òµñÈݤ¹¤ë (¤½¤·¤Æ +.B EPERM +¤òÊÖ¤¹)¡£Ê̤Τ¢¤ë¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï +set-user-ID/set-group-ID ¥Ó¥Ã¥È¤Î¤ß¤ò̵»ë¤· +.BR exec () +¤ÏÀ®¸ù¤¹¤ë¡£ + +#! ¼Â¹Ô·Á¼°¤Î¥·¥§¥ë¡¦¥¹¥¯¥ê¥×¥È¤Î 1¹ÔÌܤ˵ö¤µ¤ì¤Æ¤¤¤ëʸ»ú¿ô¤Ï¡¢ +ºÇÂç 127 ʸ»ú¤Ç¤¢¤ë¡£ + +¥¤¥ó¥¿¥×¥ê¥¿¡¦¥¹¥¯¥ê¥×¥È¤Î +.I optional-arg +°ú¤­¿ô¤Î²ò¼áÊýË¡¤Ï¼ÂÁõ¤Ë¤è¤ê°Û¤Ê¤ë¡£ +Linux ¤Ç¤Ï¡¢¥¤¥ó¥¿¥×¥ê¥¿Ì¾ +.I interpreter +¤Ë³¤¯Ê¸»úÎóÁ´ÂΤ¬¥¤¥ó¥¿¥×¥ê¥¿¤Ë 1¸Ä¤Î°ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +¤·¤«¤·¡¢Æ°ºî¤¬°Û¤Ê¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +¤¢¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.\" Î㤨¤Ð¡¢Solaris 8 +.I optional-arg +¤Î¤¦¤ÁºÇ½é¤Î¥Û¥ï¥¤¥È¡¦¥¹¥Ú¡¼¥¹¤Þ¤Ç¤¬ +°ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +¤Þ¤¿¡¢Ê̤Υ·¥¹¥Æ¥à¤Ç¤Ï +.\" Î㤨¤Ð¡¢6.0 ¤è¤êÁ°¤Î FreeBSD (FreeBSD 6.0 °Ê¹ß¤Ï°ã¤¦) +¥¤¥ó¥¿¥×¥ê¥¿¡¦¥¹¥¯¥ê¥×¥È¤ÏÊ£¿ô¤Î°ú¤­¿ô¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¡¢ +.I optional-arg +Æâ¤Î¥Û¥ï¥¤¥È¡¦¥¹¥Ú¡¼¥¹¤¬°ú¤­¿ô¤Î¶èÀÚ¤ê¤È¤Ê¤ë¡£ + +Linux ¤Ç¤Ï¡¢ +.I argv +¤Ë NULL ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤³¤ì¤Ï¡¢¤³¤Î°ú¤­¿ô¤Ë NULL ¥Ý¥¤¥ó¥¿ +1¸Ä¤À¤±¤ò´Þ¤à¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò»ØÄꤷ¤¿¤Î¤ÈƱ¤¸¸ú²Ì¤ò»ý¤Ä¡£ +.BR ¡Ö¤³¤Î´Ö°ã¤Ã¤¿µ¡Ç½¤òÍøÍѤ·¤Ê¤¤¤³¤È¡× ¡£ +¤³¤ì¤ÏÈóɸ½à¤Ç¡¢°Ü¿¢À­¤â¤Ê¤¤¡£ +¾¤Î¤Û¤È¤ó¤É¤Î Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤ì¤ò¹Ô¤¦¤È¥¨¥é¡¼ +.RB ( EFAULT ) +¤Ë¤Ê¤ë¡£ +.\" 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). +.\" + +POSIX.1-2001 ¤Ï¡¢ +.BR sysconf (3) +¤¬ÊÖ¤¹ÃÍ¤Ï¥×¥í¥»¥¹¤ÎÀ¸Â¸Ãæ¤ÏÊѲ½¤·¤Ê¤¤¤Ù¤­¤À¤È¤·¤Æ¤¤¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢Linux 2.6.23 °Ê¹ß¤Ç¤Ï¡¢¥ê¥½¡¼¥¹¾å¸Â +.B RLIMIT_STACK +¤¬ÊѲ½¤·¤¿¾ì¹ç¡¢ +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤È´Ä¶­ÊÑ¿ô¤òÊÝ»ý¤¹¤ë¤¿¤á¤Î¶õ´Ö¤ËÂФ¹¤ë¾å¸Â¤¬ +ÊѲ½¤·¤¿¤³¤È¤òÈ¿±Ç¤·¤Æ¡¢ +.B _SC_ARG_MAX +¤¬ÊÖ¤¹ÃͤâÊѲ½¤¹¤ë¡£ +.\" +.\" .SH ¥Ð¥° +.\" Linux ÈǤÎÃæ¤Ë¤Ï¡¢ELF ¥¤¥ó¥¿¥×¥ê¥¿¤Ë¤ª¤±¤ë +.\" ¸¢¸Â¤Î¥Á¥§¥Ã¥¯¤Ë¼ºÇÔ¤¹¤ë¤â¤Î¤¬¤¢¤ë¡£ +.\" ¤³¤ì¤Ï¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤Ç¤¢¤ë¡£ +.\" ¤Ê¤¼¤Ê¤é¡¢¥æ¡¼¥¶¤ËǤ°Õ¤Î¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤òµö²Ä¤·¤¿¤ê¡¢ +.\" Æɤ߹þ¤ß¤Î¤¿¤á¤Ë¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤ò´¬¤­Ìᤷ¤òµö²Ä¤·¤¿¤ê¤¹¤ë¡£ +.\" Linux ÈǤÎÃæ¤Ë¤Ï +.\" .BR execve () +.\" ¤Ë¾¤Î¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤¬ +.\" ¸ºß¤¹¤ë¤â¤Î¤â¤¢¤ê¡¢¹ªÌ¯¤ËºÙ¹©¤µ¤ì¤¿ ELF ¥Ð¥¤¥Ê¥ê¤Ë¤è¤Ã¤Æ +.\" ¥µ¡¼¥Ó¥¹µñÈÝ (denial of service) ¤ËÍøÍѤµ¤ì¤Æ¤·¤Þ¤¦¡£ +.\" 2.0.34 ¤Þ¤¿ 2.2.15 ¤Ë¤Ï¡¢ÃΤé¤ì¤Æ¤¤¤ëÌäÂê¤Ï¤Ê¤¤¡£ +.SS Îò»Ë +Unix V6 ¤Ç¤Ï +.BR exec () +¥³¡¼¥ë¤Î°ú¤­¿ô¥ê¥¹¥È¤Ï 0 ¤Ç½ªÃ¼¤µ¤ì¡¢ +.I main +¤Î°ú¤­¿ô¥ê¥¹¥È¤Ï \-1 ¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤¿¡£ +¤½¤Î¤¿¤á¡¢ +.I main +¤Î°ú¤­¿ô¥ê¥¹¥È¤Ï¡¢¤½¤Î¸å¤Î +.BR exec () +¥³¡¼¥ë¤Ë¤ÏľÀÜ»ÈÍѤǤ­¤Ê¤«¤Ã¤¿¡£ +Unix V7 °Ê¹ß¤Ç¤Ï¡¢¤È¤â¤Ë NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.SH Îã +¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢°Ê²¼¤ÎÆó¤ÄÌÜ¤Î¥×¥í¥°¥é¥à¤«¤é¼Â¹Ô¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¥³¥Þ¥ó¥É¥é¥¤¥ó¤ò 1¹Ô¤Ë 1¸Ä¤º¤Äɽ¼¨¤¹¤ë¤À¤±¤Î¥×¥í¥°¥é¥à¤Ç¤¢¤ë¡£ + +.in +4n +.nf +/* myecho.c */ + +#include +#include + +int +main(int argc, char *argv[]) +{ + int j; + + for (j = 0; j < argc; j++) + printf("argv[%d]: %s\\n", j, argv[j]); + + exit(EXIT_SUCCESS); +} +.fi +.in + +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ç»ØÄꤷ¤¿Ì¾Á°¤Î¥×¥í¥°¥é¥à¤ò +¼Â¹Ô¤¹¤ë¤Î¤Ë»È¤¦¡£ +.in +4n +.nf + +/* execve.c */ + +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + char *newargv[] = { NULL, "hello", "world", NULL }; + char *newenviron[] = { NULL }; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + newargv[0] = argv[1]; + + execve(argv[1], newargv, newenviron); + perror("execve"); /* execve() only returns on error */ + exit(EXIT_FAILURE); +} +.fi +.in + +Æó¤ÄÌÜ¤Î¥×¥í¥°¥é¥à¤ò»È¤Ã¤Æ°ì¤ÄÌÜ¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï +°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¡£ + +.in +4n +.nf +.RB "$" " cc myecho.c \-o myecho" +.RB "$" " cc execve.c \-o execve" +.RB "$" " ./execve ./myecho" +argv[0]: ./myecho +argv[1]: hello +argv[2]: world +.fi +.in + +¤µ¤é¤Ë¡¢¤³¤ì¤é¤Î¥×¥í¥°¥é¥à¤ò»È¤Ã¤Æ¡¢¥¹¥¯¥ê¥×¥È¡¦¥¤¥ó¥¿¥×¥ê¥¿¤ÎÎã¤ò¼¨¤¹¡£ +¤³¤Î¤¿¤á¤Ë¡¢¡Ö¥¤¥ó¥¿¥×¥ê¥¿¡×¤È¤·¤ÆÀè¤Û¤ÉºîÀ®¤·¤¿¥×¥í¥°¥é¥à +.I myecho +¤ò»È¤¦¥¹¥¯¥ê¥×¥È¤òºîÀ®¤¹¤ë¡£ + +.in +4n +.nf +.RB "$" " cat > script.sh" +.B #! ./myecho script-arg +.B ^D +.RB "$" " chmod +x script.sh" +.fi +.in + +ºîÀ®¤·¤Æ¤ª¤¤¤¿¥×¥í¥°¥é¥à¤ò»È¤Ã¤Æ¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤¹¤ë¡£ + +.in +4n +.nf +.RB "$" " ./execve ./script.sh" +argv[0]: ./myecho +argv[1]: script-arg +argv[2]: ./script.sh +argv[3]: hello +argv[4]: world +.fi +.in +.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) diff --git a/release/man2/exit_group.2 b/release/man2/exit_group.2 new file mode 100644 index 00000000..3e36cf25 --- /dev/null +++ b/release/man2/exit_group.2 @@ -0,0 +1,55 @@ +.\" Copyright (C) 2004 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. +.\" +.\" 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" +.SH ̾Á° +exit_group \- ¥×¥í¥»¥¹Ãæ¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤ò exit ¤µ¤»¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void exit_group(int " status ); +.fi +.SH ÀâÌÀ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢´ðËÜŪ¤Ë +.BR exit (2) +¤ÈÅù¤·¤¤¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤À¤±¤Ç¤Ê¤¯¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Ë +¤¢¤ëÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤ò½ªÎ»¤µ¤»¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÃͤòÊÖ¤µ¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î¥³¡¼¥ë¤Ï¡¢Linux 2.5.35 °Ê¹ß¤Ë¸ºß¤¹¤ë¡£ +.SH Ãí°Õ +glibc 2.3 °Ê¹ß¤Ç¤Ï¡¢ +.BR exit (2) +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿ºÝ¤Ë¡¢ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬µ¯Æ°¤µ¤ì¤ë¡£ +.SH ½àµò +¤³¤Î¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR exit (2) diff --git a/release/man2/faccessat.2 b/release/man2/faccessat.2 new file mode 100644 index 00000000..9d9847fb --- /dev/null +++ b/release/man2/faccessat.2 @@ -0,0 +1,159 @@ +.\" 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" +.SH ̾Á° +faccessat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë +¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¤ò¥Á¥§¥Ã¥¯¤¹¤ë +.SH ½ñ¼° +.nf +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int faccessat(int " dirfd ", const char *" pathname ", int " \ +mode ", int " flags ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR faccessat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +.BR faccessat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.BR access (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I dirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( access (2) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î +ÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I pathname +¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä +.I dirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I pathname +¤Ï +.RB ( access (2) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.I flags +¤Ï°Ê²¼¤ÎÃͤò 0 ¸Ä°Ê¾å OR ¤·¤Æºî¤é¤ì¤ë¡£ +.TP +.B AT_EACCESS +¼Â¸ú (effective) ¥æ¡¼¥¶ ID ¤È¼Â¸ú¥°¥ë¡¼¥× ID ¤ò»È¤Ã¤Æ¡¢ +¥¢¥¯¥»¥¹¸¢¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR faccessat () +¤Ï +.RB ( access (2) +¤ÈƱÍͤË) ¼Â ID ¤ò»È¤¦¡£ +.TP +.B AT_SYMLINK_NOFOLLOW +.I pathname +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ï¡¢¤½¤ì¤òé¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥ê¥ó¥¯¼«¿È¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç (Á´¤Æ¤ÎÍ׵ᤵ¤ì¤¿µö²Ä¤¬ÆÀ¤é¤ì¤¿¤é)¡¢ +.BR faccessat () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR access (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR faccessat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR faccessat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I dirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.I flags +¤ËÉÔÀµ¤Ê¥Õ¥é¥°Ãͤ¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B ENOTDIR +.I pathname +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I dirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR faccessat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2008. +.SH Ãí°Õ +.BR faccessat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SS glibc ¤Ë¤Ä¤¤¤Æ¤ÎÃí°Õ +.B AT_EACCESS +¤È +.B AT_SYMLINK_NOFOLLOW +¥Õ¥é¥°¤Ï¡¢ +.BR faccessat () +¤Î glibc ¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ç¼ÂºÝ¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥é¥°¤Î¤¤¤º¤ì¤«¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¥¢¥¯¥»¥¹¸¢¤ò·èÄꤹ¤ë¤¿¤á¤Ë +.BR fstatat (2) +¤ò»È¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR access (2), +.BR openat (2), +.BR eauidaccess (3), +.BR credentials (7), +.BR path_resolution (7), +.BR symlink (7) diff --git a/release/man2/fallocate.2 b/release/man2/fallocate.2 new file mode 100644 index 00000000..a8f67dc7 --- /dev/null +++ b/release/man2/fallocate.2 @@ -0,0 +1,144 @@ +.\" 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 2009-03-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +fallocate \- ¥Õ¥¡¥¤¥ë¶õ´Ö¤ÎÁàºî +.SH ½ñ¼° +.nf +#define _GNU_SOURCE +.B #include + +.BI "int fallocate(int " fd ", int " mode ", off_t " offset \ +", off_t " len ");" +.fi +.SH ÀâÌÀ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢°Ü¿¢À­¤Î¤Ê¤¤¡¢Linux ¸ÇÍ­¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£ +°Ü¿¢À­¤¬É¬Íפʾì¹ç¤Ï¡¢¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¥Ç¥£¥¹¥¯¶õ´Ö¤ò³Î¼Â¤Ë³ÎÊݤ¹¤ë¤¿¤á¤Ë¡¢ +POSIX.1 ¤Çµ¬Äꤵ¤ì¤¿ÊýË¡¤Ç¤¢¤ë +.BR posix_fallocate (3) +¤ò»È¤¦¤³¤È¡£ + +.BR fallocate () +¤ò»È¤¦¤È¡¢ +.I fd +¤¬»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥Ç¥£¥¹¥¯¶õ´Ö¤òľÀÜÁàºî¤Ç¤­¤ë¡£ +ÁàºîÂоݤϡ¢ +.I offset +¤«¤é»Ï¤Þ¤ëŤµ +.I len +¥Ð¥¤¥È¤ÎÎΰè¤Ç¤¢¤ë¡£ + +.I mode +°ú¤­¿ô¤Ï¡¢»ØÄꤵ¤ì¤¿Îΰè¤ËÂФ·¤Æ¼Â¹Ô¤¹¤ëÁàºî¤ò»ØÄꤹ¤ë¡£ +¸½ºß¤Î¤È¤³¤í¡¢ +.I mode +¤Ë»ØÄê¤Ç¤­¤ë¥Õ¥é¥°¤Ï°Ê²¼¤Î°ì¤Ä¤À¤±¤Ç¤¢¤ë¡£ +.TP +.B FALLOC_FL_KEEP_SIZE +¤³¤Î¥Õ¥é¥°¤Ï¡¢ +.I offset +¤È +.I len +¤Ç»ØÄꤵ¤ì¤¿Îΰè¤Î¥Ç¥£¥¹¥¯¶õ´Ö¤ò³ä¤êÅö¤Æ¡¢¤½¤Î¶õ´Ö¤ò 0 ¤Ç½é´ü²½¤¹¤ë¡£ +¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤È¡¢¤½¤ì¤Ë³¤¤¤Æ¤³¤ÎÎΰè¤Ø¤Î½ñ¤­¹þ¤ß¤¬¹Ô¤ï¤ì¤ë¤¬¡¢ +¥Ç¥£¥¹¥¯¶õ´Ö¤ÎÉÔ­¤Ë¤è¤ë½ñ¤­¹þ¤ß¼ºÇÔ¤¬È¯À¸¤·¤Ê¤¤¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ëËöÈø¤è¤ê¸å¤í¤ÎÎΰè¤Ë¤Ä¤¤¤Æ 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 +.B FALLOC_FL_KEEP_SIZE +¥Õ¥é¥°¤¬ +.I mode +¤Ë»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï +.B FALLOC_FL_KEEP_SIZE +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤È¤Û¤È¤ó¤ÉƱ¤¸¤È¤Ê¤ë¡£ +Í£°ì¤Î°ã¤¤¤Ï¡¢ +.I "offset + len" +¤¬¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤è¤ê¤âÂ礭¤«¤Ã¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤È +¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤¬Êѹ¹¤µ¤ì¤ëÅÀ¤Ç¤¢¤ë¡£ +¤³¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô +.BR posix_fallocate (3) +¤ÎÆ°ºî¤ÈÈó¾ï¤Ë»÷¤Æ¤¤¤ë¡£¤³¤ì¤Ï +.BR posix_fallocate (3) +¤òºÇŬ¤Ë¼ÂÁõ¤¹¤ë¼êÃʤòÄ󶡤¹¤ë¤³¤È¤òÌÜŪ¤È¤·¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +.PP +³ä¤êÅö¤Æ¤Ï¥Ö¥í¥Ã¥¯¥µ¥¤¥ºÃ±°Ì¤Ç¹Ô¤ï¤ì¤ë¤¿¤á¡¢ +.BR fallocate () +¤Ï»ØÄꤵ¤ì¤¿¤è¤ê¤âÂ礭¤ÊÎΰè¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR fallocate () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¤«¡¢ +½ñ¤­¹þ¤ßÍѤȤ·¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFBIG +.I offset + len +¤¬¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ÎºÇÂçÃͤè¤ê¤âÂ礭¤¤¡£ +.TP +.B EINTR +¼Â¹ÔÃæ¤Ë¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤¿¡£ +.TP +.B EINVAL +.I offset +¤¬ 0 ̤Ëþ¤Ç¤¢¤ë¤«¡¢ +.I len +¤¬ 0 °Ê²¼¤Ç¤¢¤ë¡£ +.TP +.B EIO +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤ÎÆɤ߽ñ¤­Ãæ¤ËÆþ½ÐÎÏ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ENODEV +.I fd +¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤«¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤ +.RI ( fd +¤¬¥Ñ¥¤¥×¤ä FIFO ¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢Ê̤Υ¨¥é¡¼¤¬È¯À¸¤¹¤ë)¡£ +.TP +.B ENOSPC +.I fd +¤¬»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Ç¥Ð¥¤¥¹¤Ë½½Ê¬¤Ê¶õ¤­Îΰ褬¤Ê¤¤¡£ +.TP +.B ENOSYS +.I fd +¤¬»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ +»ØÄꤵ¤ì¤¿Áàºî¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EOPNOTSUPP +.I fd +¤¬»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ +.I mode +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR fallocate () +¤Ï¥«¡¼¥Í¥ë 2.6.23 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +glibc ¤Ç¤ÎÂбþ¤Ï¥Ð¡¼¥¸¥ç¥ó 3.10 °Ê¹ß¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +.BR fallocate () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ftruncate (2), +.BR posix_fadvise (3), +.BR posix_fallocate (3) diff --git a/release/man2/fchmodat.2 b/release/man2/fchmodat.2 new file mode 100644 index 00000000..df53f6ab --- /dev/null +++ b/release/man2/fchmodat.2 @@ -0,0 +1,142 @@ +.\" 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" +.SH ̾Á° +fchmodat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int fchmodat(int " dirfd ", const char *" pathname ", mode_t " \ +mode ", int " flags ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR fchmodat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +.BR fchmodat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.BR chmod (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I dirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( chmod (2) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î +ÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I pathname +¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä +.I dirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I pathname +¤Ï +.RB ( chmod (2) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.I flags +¤Ï 0 ¤Þ¤¿¤Ï°Ê²¼¤Î¥Õ¥é¥°¤Ç¤¢¤ë¡£ +.TP +.B AT_SYMLINK_NOFOLLOW +.I pathname +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ï¡¢¤½¤ì¤òé¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥ê¥ó¥¯¼«¿È¤ËÂФ·¤Æ (¥¢¥¯¥»¥¹¸¢¤ÎÊѹ¹¤Î) Áàºî¤ò¹Ô¤¦¡£ +¤³¤Î¥Õ¥é¥°¤Ï¸½ºß¤Î¤È¤³¤í¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR fchmodat () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR chmod (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR fchmodat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR fchmodat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I dirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.I flags +¤ËÉÔÀµ¤Ê¥Õ¥é¥°Ãͤ¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B ENOTDIR +.I pathname +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I dirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.TP +.B ENOTSUP +.I flags +¤Ë¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ÃÍ +.B AT_SYMLINK_NOFOLLOW +¤¬ +»ØÄꤵ¤ì¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR fchmodat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2008. +.SH Ãí°Õ +.BR fchmodat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR chmod (2), +.BR openat (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/release/man2/fchownat.2 b/release/man2/fchownat.2 new file mode 100644 index 00000000..7fcbedc6 --- /dev/null +++ b/release/man2/fchownat.2 @@ -0,0 +1,141 @@ +.\" 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 FCHOWNAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +fchownat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int fchownat(int " dirfd ", const char *" pathname , +.BI " uid_t " owner ", gid_t " group ", int " flags ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR fchownat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +.BR fchownat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.BR chown (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I dirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( chown (2) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î +ÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I pathname +¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä +.I dirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I pathname +¤Ï +.RB ( chown (2) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.I flags +¤Ï 0 ¤Þ¤¿¤Ï°Ê²¼¤Î¥Õ¥é¥°¤Ç¤¢¤ë¡£ +.TP +.B AT_SYMLINK_NOFOLLOW +.I pathname +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ï¡¢¤½¤ì¤òé¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +.BR lchown (2) +¤ÈƱÍͤ˥ê¥ó¥¯¼«¿È¤ËÂФ·¤Æ (½êÍ­¼Ô¤ÎÊѹ¹¤Î) Áàºî¤ò¹Ô¤¦ +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR fchownat () +¤Ï +.BR chown (2) +¤ÈƱÍͤ˥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òé¤ë)¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR fchownat () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR chown (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR fchownat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR fchownat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I dirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.I flags +¤ËÉÔÀµ¤Ê¥Õ¥é¥°Ãͤ¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B ENOTDIR +.I pathname +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I dirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR fchownat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2008. +Solaris ¤Ë¤Ï¡¢¤³¤ì¤ÈƱ¤¸¤è¤¦¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¡£ +.SH Ãí°Õ +.BR fchownat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR chown (2), +.BR openat (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/release/man2/fcntl.2 b/release/man2/fcntl.2 new file mode 100644 index 00000000..fe483d84 --- /dev/null +++ b/release/man2/fcntl.2 @@ -0,0 +1,1251 @@ +'\" 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" +.SH ̾Á° +fcntl \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÁàºî¤ò¹Ô¤¦ +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "int fcntl(int " fd ", int " cmd ", ... /* " arg " */ );" +.fi +.SH ÀâÌÀ +.BR fcntl () +¤Ï¡¢¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë´Ø¤·¤Æ²¼µ­¤ÎÁàºî¤ò¹Ô¤¦¡£Áàºî¤Ï +.I cmd +¤Ë¤è¤Ã¤Æ·è¤Þ¤ë: + +.BR fcntl () +¤Ï¥ª¥×¥·¥ç¥ó¤È¤·¤ÆÂè»°°ú¤­¿ô¤ò¤È¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Âè»°°ú¤­¿ô¤¬É¬Íפ«¤É¤¦¤«¤Ï +.I cmd +¤Ë¤è¤ê·è¤Þ¤ë¡£ +ɬÍפʰú¤­¿ô¤Î·¿¤Ï +.I cmd +̾¤Î¸å¤í¤Î³ç¸ÌÆâ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë +(¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢É¬Íפʷ¿¤Ï +.I long +¤Ç¤¢¤ê¡¢¤³¤Î°ú¤­¿ô¤òɽ¤¹¤Î¤Ë +.I arg +¤È¤¤¤¦Ì¾Á°¤ò»È¤Ã¤Æ¤¤¤ë)¡£ +°ú¤­¿ô¤¬É¬Íפʤ¤¾ì¹ç¤Ë¤Ï +.I void +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ +.SS "¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÊ£À½" +.TP +.BR F_DUPFD " (\fIlong\fP)" +ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¦¤Á¡¢ +.I arg +°Ê¾å¤ÇºÇ¾®¤Î¤â¤Î¤òõ¤·¡¢ +.I fd +¤Î¥³¥Ô¡¼¤È¤¹¤ë¡£¤³¤ì¤ÏÊ̤ηÁ¤Î +.BR dup2 (2) +¤Ç¤¢¤ë¡£ +.BR dup2 (2) +¤Ç¤Ï»ØÄꤵ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬»È¤ï¤ì¤ëÅÀ¤¬°ã¤¦¡£ +.IP +À®¸ù¤¹¤ë¤È¡¢¿·¤·¤¤¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +.IP +¾ÜºÙ¤Ï +.BR dup (2) +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.BR F_DUPFD_CLOEXEC " (\fIlong\fP; Linux 2.6.24 °Ê¹ß)" +.B F_DUPFD +¤ÈƱÍͤÀ¤¬¡¢¤½¤ì¤Ë²Ã¤¨¤ÆÊ£À½¤µ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +close-on-exec ¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢¥×¥í¥°¥é¥à¤Ï +.B FD_CLOEXEC +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤¿¤á¤Ë +.BR fcntl () +¤Î +.B F_SETFD +Áàºî¤òÄɲäǹԤ¦É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬¤Ê¤¼Í­ÍѤ«¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR open (2) +¤Î +.B O_CLOEXEC +¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.SS "¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Õ¥é¥°" +°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò»È¤Ã¤Æ¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë´ØÏ¢¤¹¤ë¥Õ¥é¥° +¤òÁàºî¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¸½ºß¤Î¤È¤³¤í¡¢ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Õ¥é¥°¤Ï°ì¤Ä¤À¤±¤Ç¤¢¤ë: +.B FD_CLOEXEC +(close-on-exec ¥Õ¥é¥°)¡£ +.B FD_CLOEXEC +¥Ó¥Ã¥È¤¬ 0 ¤Ê¤é¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.BR execve (2) +¤ò¹Ô¤Ã¤Æ¤â¥ª¡¼¥×¥ó¤µ¤ì¤¿¤Þ¤Þ¤À¤¬¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.TP +.BR F_GETFD " (\fIvoid\fP)" +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Õ¥é¥°¤òÆɤ߽Ф¹¡£ +.I arg +¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.BR F_SETFD " (\fIlong\fP)" +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Õ¥é¥°¤Ë +.I arg +¤Ç»ØÄꤷ¤¿ÃͤòÀßÄꤹ¤ë¡£ +.SS "¥Õ¥¡¥¤¥ë¾õÂ֥ե饰" +¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò (open file description) ¤Ë¤Ï¡¢ +¥Õ¥¡¥¤¥ëµ­½ÒËè¤ËÀßÄꤵ¤ì¤ë¾õÂ֥ե饰¤¬¤¤¤¯¤Ä¤«¤¢¤ë¡£¤³¤ì¤é¤Î¥Õ¥é¥°¤Ï +.BR open (2) +.\" ¤ä +.\" .BR creat (2) +¤Ë¤è¤Ã¤Æ½é´ü²½¤µ¤ì¡¢ +.BR fcntl (2) +¤Ë¤è¤êÊѹ¹¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£¤³¤ì¤é¤Ï¡¢ +.RB ( dup (2), +.BR fcntl (F_DUPFD), +.BR fork (2) +¤Ê¤É¤Ç) Ê£À½¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿Æ±»Î¤Ï +Ʊ¤¸¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¤ò»²¾È¤¹¤ë¡£ +¤½¤Î¤¿¤á¡¢ +Ʊ¤¸¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤¬¶¦Í­¤µ¤ì¤ë¡£ + +¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤È¤½¤Î°ÕÌ£¤Ï +.BR open (2) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.BR F_GETFL " (\fIvoid\fP)" +¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤òÆɤ߽Ф¹¡£ +.I arg +¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.BR F_SETFL " (\fIlong\fP)" +¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤Ë +.I arg +¤Ç»ØÄꤵ¤ì¤¿ÃͤòÀßÄꤹ¤ë¡£ +.I arg +¤Î¤¦¤Á¡¢¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¥â¡¼¥É +.RB ( O_RDONLY ", " O_WRONLY ", " O_RDWR ) +¤È¥Õ¥¡¥¤¥ëºîÀ®¥Õ¥é¥° (¤¹¤Ê¤ï¤Á +.BR O_CREAT ", " O_EXCL ", " O_NOCTTY ", " O_TRUNC ) +¤Ë´Ø¤¹¤ë¥Ó¥Ã¥È¤Ï̵»ë¤µ¤ì¤ë¡£ +Linux ¤Ç¤Ï¡¢¤³¤Î¥³¥Þ¥ó¥É¤ÇÊѹ¹¤Ç¤­¤ë¤Î¤Ï +.BR O_APPEND , +.BR O_ASYNC , +.BR O_DIRECT , +.BR O_NOATIME , +.B O_NONBLOCK +¥Õ¥é¥°¤À¤±¤Ç¤¢¤ë¡£ +.\" FIXME . POSIX.1-2001 ¤Ë¤è¤ë¤È¡¢ O_SYNC ¤â fcntl(2) ¤ÇÊѹ¹¤Ç¤­¤ë¤Ù¤­¤À¤¬¡¢ +.\" ¸½ºß¤Î¤È¤³¤í Linux ¤Ç¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" http://bugzilla.kernel.org/show_bug.cgi?id=5994 »²¾È +.SS "¥¢¥É¥Ð¥¤¥¶¥ê¡¦¥í¥Ã¥¯" +.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 +¤³¤Î¹½Â¤ÂΤΠ+.IR l_whence ", " l_start ", " l_len +¥Õ¥£¡¼¥ë¥É¤Ç¡¢¥í¥Ã¥¯¤ò¹Ô¤¤¤¿¤¤¥Ð¥¤¥ÈÈϰϤò»ØÄꤹ¤ë¡£ +¥Õ¥¡¥¤¥ë¤ÎËöÈø¤è¤ê¸å¤í¤Î¥Ð¥¤¥È¤ò¥í¥Ã¥¯¤¹¤ë¤³¤È¤Ï¤Ç¤­¤ë¤¬¡¢ +¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤è¤êÁ°¤Î¥Ð¥¤¥È¤ò¥í¥Ã¥¯¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ + +.I l_start +¤Ï¥í¥Ã¥¯¤ò¹Ô¤¦Îΰè¤Î³«»Ï¥ª¥Õ¥»¥Ã¥È¤Ç¤¢¤ë¡£ +¤½¤Î°ÕÌ£¤Ï +.I l_whence +¤Ë¤è¤ê°Û¤Ê¤ë: +.I l_whence +¤¬ +.B SEEK_SET +¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¡¢ +.I l_whence +¤¬ +.B SEEK_CUR +¤Î¾ì¹ç¤Ï¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¡¢ +.I l_whence +¤¬ +.B SEEK_END +¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë¤ÎËöÈø¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤È²ò¼á¤µ¤ì¤ë¡£ +¸å¤í¤Î£²¤Ä¤Î¾ì¹ç¤Ë¤Ï¡¢ +¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤è¤êÁ°¤Ë¤Ê¤é¤Ê¤¤ÈϰϤǡ¢ +.I l_start +¤ËÉé¤ÎÃͤò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.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 +¤Ç»ØÄꤵ¤ì¤ë°ÌÃÖ¤«¤é¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Þ¤Ç¤ÎÁ´¤Æ¤Î¥Ð¥¤¥È¤ò¥í¥Ã¥¯¤¹¤ë +(¥Õ¥¡¥¤¥ë¤¬¤É¤ó¤Ê¤ËÂ礭¤¯¤Ê¤Ã¤¿¤È¤·¤Æ¤â¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Þ¤Ç¥í¥Ã¥¯¤¹¤ë)¡£ + +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 ¤Ç +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ + +.I l_type +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥Õ¥¡¥¤¥ë¤ËÂФ·¤ÆÆɤ߽Ф·¥í¥Ã¥¯ +.RB ( F_RDLCK ) +¤È½ñ¤­¹þ¤ß¥í¥Ã¥¯ +.RB ( F_WRLCK ) +¤Î¤É¤Á¤é¤ò +ÀßÄꤹ¤ë¤«¤ò»ØÄꤹ¤ë¡£ +¥Õ¥¡¥¤¥ë¤Î¤¢¤ëÎΰè¤ËÂФ·¤Æ¡¢Æɤ߽Ф·¥í¥Ã¥¯ (¶¦Í­¥í¥Ã¥¯) ¤òÊÝ»ý¤Ç¤­¤ë +¥×¥í¥»¥¹¿ô¤ËÀ©¸Â¤Ï¤Ê¤¤¤¬¡¢½ñ¤­¹þ¤ß¥í¥Ã¥¯ (ÇÓ¾¥í¥Ã¥¯) ¤òÊÝ»ý¤Ç¤­¤ë +¤Î¤Ï°ì¤Ä¤Î¥×¥í¥»¥¹¤À¤±¤Ç¤¢¤ë¡£ÇÓ¾¥í¥Ã¥¯¤òÀßÄꤹ¤ë¤È¡¢(¶¦Í­¥í¥Ã¥¯¤« +ÇÓ¾¥í¥Ã¥¯¤Ë¤«¤«¤ï¤é¤º) ¾¤Î¥í¥Ã¥¯¤Ï²¿¤âÀßÄê¤Ç¤­¤Ê¤¤¡£ +°ì¤Ä¤Î¥×¥í¥»¥¹¤Ï¡¢¥Õ¥¡¥¤¥ë¤Î¤¢¤ëÎΰè¤ËÂФ·¤Æ°ì¼ïÎà¤Î¥í¥Ã¥¯¤·¤«ÊÝ»ý¤Ç¤­¤Ê¤¤¡£ +¿·µ¬¤Î¥í¥Ã¥¯¤¬¥í¥Ã¥¯¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ëÎΰè¤ËÂФ·¤ÆŬÍѤµ¤ì¤ë¤È¡¢´û¸¤Î¥í¥Ã¥¯ +¤Ï¿·µ¬¤Î¥í¥Ã¥¯¤Î¼ïÊ̤ËÊÑ´¹¤µ¤ì¤ë +(¿·µ¬¤Î¥í¥Ã¥¯¤Ç»ØÄꤵ¤ì¤¿¥Ð¥¤¥ÈÈϰϤ¬´û¸¥í¥Ã¥¯¤ÎÈϰϤȰìÃפ¹¤ë¾ì¹ç°Ê³°¤Ç¤Ï¡¢ +ÊÑ´¹¤Î²áÄø¤Ç´û¸¤Î¥í¥Ã¥¯¤Îʬ³ä¡¢½Ì¾®¡¢·ë¹ç¤¬¹Ô¤ï¤ì¤ë¤³¤È¤¬¤¢¤ë)¡£ +.TP +.BR F_SETLK " (\fIstruct flock *\fP)" +.RI ( l_type +¤¬ +.B F_RDLCK +¤« +.B F_WRLCK +¤Î¾ì¹ç¤Ï) ¥í¥Ã¥¯¤Î³ÍÆÀ¤ò¡¢ +.RB ( F_UNLCK +¤Î¾ì¹ç¤Ï) ¥í¥Ã¥¯¤Î²òÊü¤ò¡¢ +.I flock +¹½Â¤ÂΤΥե£¡¼¥ë¥É +.IR l_whence ", " l_start ", " l_len +¤Ç»ØÄꤵ¤ì¤¿ÈϰϤΥХ¤¥È¤ËÂФ·¤Æ¹Ô¤¦¡£ +»ØÄꤵ¤ì¤¿¥í¥Ã¥¯¤¬Â¾¤Î¥×¥í¥»¥¹¤¬ÀßÄꤷ¤Æ¤¤¤ë¥í¥Ã¥¯¤È¾×Æͤ¹¤ë¾ì¹ç¤Ï¡¢ +\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B EACCES +¤« +.B EAGAIN +¤òÀßÄꤹ¤ë¡£ +.TP +.BR F_SETLKW " (\fIstruct flock *\fP)" +.B F_SETLK +¤ÈƱÍͤÀ¤¬¡¢¤³¤Á¤é¤Ç¤Ï¤½¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¾×Æͤ¹¤ë¥í¥Ã¥¯¤¬ +ŬÍѤµ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¡¢¤½¤Î¥í¥Ã¥¯¤¬²òÊü¤µ¤ì¤ë¤Î¤òÂÔ¤ÄÅÀ¤¬°Û¤Ê¤ë¡£ +ÂԤäƤ¤¤ë´Ö¤Ë¥·¥°¥Ê¥ë¤ò¼õ¤±¤¿¾ì¹ç¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÃæÃǤµ¤ì¡¢ +(¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬Ìá¤Ã¤¿Ä¾¸å¤Ë) ÊÖ¤êÃÍ \-1 ¤òÊÖ¤¹ (¤Þ¤¿ +.I errno +¤Ë +.B EINTR +¤¬ÀßÄꤵ¤ì¤ë; +.BR signal (7) +»²¾È)¡£ +.TP +.BR F_GETLK " (\fIstruct flock *\fP)" +¤³¤Î¥³¡¼¥ë¤Î¸Æ¤Ó½Ð¤·»þ¤Ë¤Ï¡¢ +.I lock +¤Ë¤Ï¤½¤Î¥Õ¥¡¥¤¥ë¤ËŬÍѤ·¤è¤¦¤È¤¹¤ë¥í¥Ã¥¯¤Ë´Ø¤¹¤ë¾ðÊó¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +¥í¥Ã¥¯¤òŬÍѤǤ­¤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR fcntl () +¤Ï¼ÂºÝ¤Ë¤Ï¥í¥Ã¥¯¤ò¹Ô¤ï¤º¡¢¹½Â¤ÂÎ +.I lock +¤Î +.I l_type +¥Õ¥£¡¼¥ë¥É¤Ë +.B F_UNLCK +¤òÀßÄꤷ¡¢Â¾¤Î¥Õ¥£¡¼¥ë¥É¤ÏÊѹ¹¤»¤º¤Ë¡¢Éüµ¢¤¹¤ë¡£ +°ã¤¦¼ïÊ̤Υí¥Ã¥¯¤¬ (°ì¤Ä¤â¤·¤¯¤ÏÊ£¿ô) ŬÍѤµ¤ì¤Æ¤¤¤Æ +¥í¥Ã¥¯¤òŬÍѤǤ­¤Ê¤¤¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï¡¢ +.BR fcntl () +¤Ï¡¢¸¶°ø¤È¤Ê¤Ã¤¿¥í¥Ã¥¯¤Î°ì¤Ä¤Ë¤Ä¤¤¤Æ¤Î¾ÜºÙ¾ðÊó¤ò¹½Â¤ÂÎ +.I lock +¤Î¥Õ¥£¡¼¥ë¥É +.IR l_type ", " l_whence ", " l_start ", " l_len +¤Ë³ÊǼ¤·¡¢¤Þ¤¿ +.I l_pid +¤Ë¥í¥Ã¥¯¤òÊÝ»ý¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î PID ¤òÀßÄꤷ¤Æ¡¢Éüµ¢¤¹¤ë¡£ +.P +Æɤ߽Ф·¥í¥Ã¥¯¤òŬÍѤ¹¤ë¤Ë¤Ï¡¢ +.I fd +¤ÏÆɤ߽Ф·ÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +½ñ¤­¹þ¤ß¥í¥Ã¥¯¤òŬÍѤ¹¤ë¤Ë¤Ï¡¢ +.I fd +¤Ï½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Æɤ߽ñ¤­Î¾Êý¤Î¥í¥Ã¥¯¤òŬÍѤ¹¤ë¤Ë¤Ï¡¢Æɤ߽ñ¤­Î¾ÍÑ¤Ç +¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.P +¥ì¥³¡¼¥É¤Î¥í¥Ã¥¯¤Ï¡¢ +.B F_UNLCK +¤Ë¤è¤êÌÀ¼¨Åª¤Ëºï½ü¤µ¤ì¤ë¤À¤±¤Ç¤Ê¤¯¡¢ +¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¤È¤­¤ä¡¢¥í¥Ã¥¯¤¬Å¬ÍѤµ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¤¤º¤ì¤«¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿¾ì¹ç¤Ë¤â²òÊü¤µ¤ì¤ë¡£ +¤³¤Î¥í¥Ã¥¯¤Î²òÊü¤Ï¼«Æ°Åª¤Ë¹Ô¤ï¤ì¤ë¡£ +.\" .RB ( open "(2), " dup "(2), " dup2 "(2), " fcntl () +.\" ¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤ÆƱ¤¸¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.\" ¾¤Ë¤â¤Ç¤­¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤) +¤³¤ÎÆ°ºî¤Ï¤Þ¤º¤¤: ¤¢¤ë¥×¥í¥»¥¹¤¬ +.I /etc/passwd +¤ä +.I /etc/mtab +¤È¤¤¤Ã¤¿¥Õ¥¡¥¤¥ë¤Ë¥í¥Ã¥¯¤òŬÍѤ·¤Æ¤¤¤ë¤È¤­¤Ë¡¢ +¤¢¤ë¥é¥¤¥Ö¥é¥ê´Ø¿ô¤¬²¿¤«¤ÎÍýͳ¤ÇƱ¤¸¥Õ¥¡¥¤¥ë¤ò open, read, close +¤¹¤ë¤È¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î¥í¥Ã¥¯¤¬¼º¤ï¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.P +¥ì¥³¡¼¥É¤Î¥í¥Ã¥¯¤Ï +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ë¤Ï·Ñ¾µ¤µ¤ì¤Ê¤¤¤¬¡¢ +.BR execve (2) +¤ÎÁ°¸å¤Ç¤ÏÊݸ¤µ¤ì¤ë¡£ +.P +.BR stdio (3) +¤Ç¤Ï¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤¬¹Ô¤ï¤ì¤ë¤Î¤Ç¡¢ +stdio ´ØÏ¢¤Î´Ø¿ô¤Ç¤Ï¥ì¥³¡¼¥É¤Î¥í¥Ã¥¯¤Î»ÈÍѤϲóÈò¤µ¤ì¤ë; +Âå¤ï¤ê¤Ë +.BR read (2) +¤ä +.BR write (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.SS "¶¯À©¥í¥Ã¥¯ (mandatory locking)" +¾å½Ò¤Î¥í¥Ã¥¯¤Ë¤Ï¥¢¥É¥Ð¥¤¥¶¥ê¡¦¥í¥Ã¥¯ (advisory lock) ¤È¶¯À©¥í¥Ã¥¯ (mandatory +lock) ¤ÎÆó¼ïÎब¤¢¤ë¤¬¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥¢¥É¥Ð¥¤¥¶¥ê¡¦¥í¥Ã¥¯¤È¤Ê¤ë¡£ + +¥¢¥É¥Ð¥¤¥¶¥ê¡¦¥í¥Ã¥¯¤Ë¶¯À©ÎϤϤʤ¯¡¢¶¨Ä´¤·¤ÆÆ°ºî¤¹¤ë¥×¥í¥»¥¹´Ö¤Ç¤Î¤ß +Í­¸ú¤Ç¤¢¤ë¡£ + +¶¯À©¥í¥Ã¥¯¤ÏÁ´¤Æ¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ¸ú²Ì¤¬¤¢¤ë¡£ +¤¢¤ë¥×¥í¥»¥¹¤¬¸ß´¹À­¤Î¤Ê¤¤¶¯À©¥í¥Ã¥¯¤¬Å¬ÍѤµ¤ì¤¿¥Õ¥¡¥¤¥ëÎΰè¤ËÂФ·¤Æ +.RB ( read (2) +¤ä +.BR write (2) +¤Ë¤è¤ê) ¸ß´¹À­¤Î¤Ê¤¤¥¢¥¯¥»¥¹¤ò¼Â¹Ô¤·¤è¤¦¤È¤·¤¿¾ì¹ç¡¢ +¥¢¥¯¥»¥¹¤Î·ë²Ì¤Ï +¤½¤Î¥Õ¥¡¥¤¥ë¤Î¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤«¤Ë¤è¤ê·è¤Þ¤ë¡£ +.B O_NONBLOCK +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¤È¤­¤Ï¡¢¥í¥Ã¥¯¤¬ºï½ü¤µ¤ì¤ë¤«¡¢ +¥í¥Ã¥¯¤¬¥¢¥¯¥»¥¹¤È¸ß´¹À­¤Î¤¢¤ë¥â¡¼¥É¤ËÊÑ´¹¤µ¤ì¤ë¤Þ¤Ç¡¢ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÄä»ß (block) ¤µ¤ì¤ë¡£ +.B O_NONBLOCK +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¤­¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¡£ + +¶¯À©¥í¥Ã¥¯¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥í¥Ã¥¯ÂоݤΥե¡¥¤¥ë¤¬´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +¤È¡¢¥í¥Ã¥¯ÂоݤΥե¡¥¤¥ë¼«¿È¤ÎξÊý¤Ë¤Ä¤¤¤Æ¡¢¶¯À©¥í¥Ã¥¯¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤±¤ì +¤Ð¤Ê¤é¤Ê¤¤¡£¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ¶¯À©¥í¥Ã¥¯¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢ +.BR mount (8) +¤Ë "\-o mand" ¥ª¥×¥·¥ç¥ó¤òÅϤ¹¤«¡¢ +.BR mount (2) +¤Ë +.B MS_MANDLOCK +¥Õ¥é¥°¤ò»ØÄꤹ¤ë¡£¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¶¯À©¥í¥Ã¥¯¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×¼Â¹Ôµö²Ä (group execute permission) ¤ò̵¸ú¤È¤·¡¢ +¤«¤Ä set-group-ID µö²Ä¥Ó¥Ã¥È¤òÍ­¸ú¤Ë¤¹¤ë +.RB ( chmod (1) +¤È +.BR chmod (2) +¤ò»²¾È)¡£ + +Linux ¤Î¶¯À©¥í¥Ã¥¯¤Î¼ÂÁõ¤Ï¿®ÍêÀ­¤Ë·ç¤±¤ë¤â¤Î¤Ç¤¢¤ë¡£ +²¼µ­¤Î¡Ö¥Ð¥°¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ +.SS "¥·¥°¥Ê¥ë¤Î´ÉÍý" +.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)" +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Î¥¤¥Ù¥ó¥È¤ËÂФ¹¤ë¥·¥°¥Ê¥ë +.B SIGIO +¤ª¤è¤Ó +.B SIGURG +¤ò¼õ¤±¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ID ¤«¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ò +(´Ø¿ô¤Î·ë²Ì¤È¤·¤Æ) ÊÖ¤¹¡£ +¥×¥í¥»¥¹ID ¤ÏÀµ¤ÎÃͤȤ·¤ÆÊÖ¤µ¤ì¤ë¡£ +¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤ÏÉé¤ÎÃͤȤ·¤ÆÊÖ¤µ¤ì¤ë (²¼µ­¤Î¥Ð¥°¤Î¾Ï¤ò»²¾È)¡£ +.I arg +¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.BR F_SETOWN " (\fIlong\fP)" +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Î¥¤¥Ù¥ó¥ÈȯÀ¸¤òÃΤ餻¤ë¥·¥°¥Ê¥ë +.B SIGIO +¤ä +.B SIGURG +¤ò¼õ¤±¤ë¥×¥í¥»¥¹¤Î +¥×¥í¥»¥¹ ID ¤Þ¤¿¤Ï¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤ò +.I arg +¤Ç»ØÄꤵ¤ì¤¿ ID ¤ËÀßÄꤹ¤ë¡£ +¥×¥í¥»¥¹ID ¤ÏÀµ¤ÎÃͤȤ·¤Æ»ØÄꤷ¡¢ +¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤ÏÉé¤ÎÃͤȤ·¤Æ»ØÄꤹ¤ë¡£ +¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï½êÍ­¼Ô¤È¤·¤Æ¼«Ê¬¼«¿È¤ò»ØÄꤹ¤ë +(¤Ä¤Þ¤ê +.I arg +¤Ë +.BR getpid (2) +¤ò»ØÄꤹ¤ë)¡£ + +.\" glibc.info ¤è¤ê: +.BR fcntl () +¤Î +.B F_SETFL +¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤Æ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë +.B O_ASYNC +¾õÂ֥ե饰¤òÀßÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ø¤Î +Æþ½ÐÎϤ¬²Äǽ¤Ë¤Ê¤ëÅÙ¤Ë +.B SIGIO +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +.B F_SETSIG +¤Ï +.B SIGIO +°Ê³°¤ÎÊ̤Υ·¥°¥Ê¥ë¤ÎÇÛÁ÷¤ò¼õ¤±¤é¤ì¤ë¤è¤¦¤Ë +¤¹¤ë¤Î¤Ë¤â»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +µö²Ä (permission) ¤Î¥Á¥§¥Ã¥¯¤Ç¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥·¥°¥Ê¥ë¤ÏÌۤäƼΤƤé¤ì¤ë¡£ + +.B F_SETOWN +¤Ë¤è¤ê»ØÄꤵ¤ì¤¿½êÍ­¼Ô¤Î¥×¥í¥»¥¹ (¤Þ¤¿¤Ï¥×¥í¥»¥¹¥°¥ë¡¼¥×) ¤Ë +¥·¥°¥Ê¥ë¤òÁ÷¤ëºÝ¤Ë¤Ï¡¢ +.BR kill (2) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¤Î¤ÈƱ¤¸µö²Ä¤Î¥Á¥§¥Ã¥¯¤¬¹Ô¤ï¤ì¤ë¡£ +¤³¤Î¤È¤­¡¢¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ë¥×¥í¥»¥¹¤Ï +.B F_SETOWN +¤ò»È¤Ã¤¿¥×¥í¥»¥¹¤Ç¤¢¤ë +(⤷¡¢²¼µ­¤Î¡Ö¥Ð¥°¡×¤Î¾Ï¤ò»²¾È¤Î¤³¤È)¡£ + +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥½¥±¥Ã¥È¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.B F_SETOWN +¤ò»ÈÍѤ·¤Æ¡¢¥½¥±¥Ã¥È¤ËÂÓ°è³° (out-of-band) ¥Ç¡¼¥¿¤¬ÆϤ¤¤¿»þ¤Ë +.B SIGURG +¥·¥°¥Ê¥ë¤òÇÛÁ÷¤¹¤ëÁê¼ê¤òÁªÂò¤¹¤ë¤³¤È¤â¤Ç¤­¤ë +.RB ( SIGURG +¤¬Á÷¤é¤ì¤¿¾ì¹ç¤Ë¤Ï +.BR select (2) +¤¬¥½¥±¥Ã¥È¤¬¡ÖÆÃÊ̤ʾõÂ֡פˤ¢¤ë¤ÈÊó¹ð¤¹¤ë¤³¤È¤À¤í¤¦)¡£ +.\" °Ê²¼¤Îµ­½Ò¤Ï¥´¥ß¤À¤í¤¦¡£ +.\" ¥«¡¼¥Í¥ë¥½¡¼¥¹¤ò¸«¤ë¤È¤³¤Îµ­½Ò¤Ï´Ö°ã¤Ã¤Æ¤¤¤ë¤è¤¦¤À¤·¡¢ +.\" ¥×¥í¥°¥é¥à¤ò½ñ¤¤¤Æ¤ß¤¿¤È¤³¤í¡¢Ã¼Ëö¤Î¥Õ¥©¥¢¥°¥é¥ó¥É¡¦¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ç +.\" ¤Ê¤¯¤Æ¤â¡¢Ã¼Ëö¤¬À¸À®¤·¤¿ SIGIO ¥·¥°¥Ê¥ë¤ò¼õ¤±¤È¤ë¡£ +.\" -- MTK, 8 Apr 05 +.\" +.\" ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Ã¼Ëö¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +.\" SIGIO ¥·¥°¥Ê¥ë¤Ï¤½¤ÎüËö¤Î¥Õ¥©¥¢¥°¥é¥ó¥É¡¦¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ø¤ÈÁ÷¤é¤ì¤ë¡£ + +¥Ð¡¼¥¸¥ç¥ó 2.6.11 °ÊÁ°¤Î 2.6.x ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢°Ê²¼¤Ë¼¨¤¹Æ°ºî¤Ç¤¢¤Ã¤¿¡£ +.RS +.IP +¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê (Î㤨¤Ð 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 ¤È²ò¼á¤µ¤ì¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢ +.B F_SETSIG +¤ò»È¤¦¾ì¹ç¤Ë¤Ï¡¢¤­¤Á¤ó¤È·ë²Ì¤ò¼õ¤±¼è¤ë¤Ë¤Ï¡¢ +.B F_SETOWN +¤ËÅϤ¹Ãͤò +.BR getpid (2) +¤Ç¤Ï¤Ê¤¯ +.BR gettid (2) +¤ÎÊÖ¤êÃͤˤ¹¤ëɬÍפ¬¤¢¤ë¤À¤í¤¦¡£ +(¸½¾õ¤Î Linux ¥¹¥ì¥Ã¥É¼ÂÁõ¤Ç¤Ï¡¢¥á¥¤¥ó¡¦¥¹¥ì¥Ã¥É¤Î¥¹¥ì¥Ã¥ÉID ¤Ï +¤½¤Î¥¹¥ì¥Ã¥É¤Î¥×¥í¥»¥¹ID ¤ÈƱ¤¸¤Ç¤¢¤ë¡£¤Ä¤Þ¤ê¡¢ +¥·¥°¥Ê¥ë¡¦¥¹¥ì¥Ã¥É¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¾ì¹ç +.BR gettid (2) +¤È +.BR getpid (2) +¤ÏÁ´¤¯Æ±¤¸¤è¤¦¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£) +¤¿¤À¤·¡¢Ãí°Õ¤¹¤Ù¤­ÅÀ¤È¤·¤Æ¡¢¤³¤ÎÃÊÍî¤Ç½Ò¤Ù¤¿¤³¤È¤Ï¡¢ +¥½¥±¥Ã¥È¤ÎÂÓ°è³°¥Ç¡¼¥¿¤¬ÆϤ¤¤¿¤È¤­¤ËÀ¸À®¤µ¤ì¤ë +.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 +¾åµ­¤ÎÆ°ºî¤Ï¡¢Linux 2.6.12 ¤Ç¿Þ¤é¤º¤âºï½ü¤µ¤ì¡¢ +¸µ¤ËÌᤵ¤ì¤Ê¤¤Í½Äê¤Ç¤¢¤ë¡£ +Linux 2.6.32 °Ê¹ß¤Ç¡¢ÆÃÄê¤Î¥¹¥ì¥Ã¥É°¸¤Ë¥·¥°¥Ê¥ë +.B SIGIO +¤È +.B SIGURG +¤òÁ÷¤ë¤Ë¤Ï +.B F_SETOWN_EX +¤ò»È¤¦¤³¤È¡£ +.TP +.BR F_GETOWN_EX " (struct f_owner_ex *) (Linux 2.6.32 °Ê¹ß)" +ľÁ°¤Î +.B F_SETOWN_EX +Áàºî¤ÇÄêµÁ¤µ¤ì¤¿¸½ºß¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î½êÍ­¼ÔÀßÄê +¤òÊÖ¤¹¡£¾ðÊó¤Ï +.I arg +¤¬»Ø¤¹¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£¹½Â¤ÂΤϰʲ¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.nf +.in +4n + +struct f_owner_ex { + int type; + pid_t pid; +}; + +.in +.fi +.I type +¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +.B F_OWNER_TID , +.B F_OWNER_PID , +.B F_OWNER_PGRP +¤Î¤¤¤º¤ì¤«°ì¤Ä¤ÎÃͤȤʤ롣 +.I pid +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥¹¥ì¥Ã¥É ID¡¢¥×¥í¥»¥¹ ID¡¢¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤ò +ɽ¤¹Àµ¤ÎÀ°¿ô¤Ç¤¢¤ë¡£¾ÜºÙ¤Ï +.B F_SETOWN_EX +¤ò»²¾È¡£ +.TP +.BR F_SETOWN_EX " (struct f_owner_ex *) (Linux 2.6.32 °Ê¹ß)" +¤³¤ÎÁàºî¤Ï +.B F_SETOWN +¤ÈƱÍͤνèÍý¤ò¹Ô¤¦¡£ +¤³¤ÎÁàºî¤ò»È¤¦¤È¡¢I/O ¤¬ÍøÍѲÄǽ¤Ë¤Ê¤Ã¤¿¤³¤È¤ò¼¨¤¹¥·¥°¥Ê¥ë¤ò¡¢ +ÆÃÄê¤Î¥¹¥ì¥Ã¥É¡¢¥×¥í¥»¥¹¡¢¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ËÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë +¤è¤¦¤Ë¤Ê¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï¡¢ +.I arg +·Ðͳ¤Ç¥·¥°¥Ê¥ë¤ÎÇÛÁ÷Àè¤ò»ØÄꤹ¤ë¡£ +.I arg +¤Ï +.I f_owner_ex +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I type +¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤ÎÃͤò¼è¤ê¡¢ +¤³¤ÎÃͤˤè¤ê +.I pid +¤¬¤É¤Î¤è¤¦¤Ë²ò¼á¤µ¤ì¤ë¤«¤¬µ¬Äꤵ¤ì¤ë¡£ +.RS +.TP +.BR F_OWNER_TID +¥¹¥ì¥Ã¥É ID ¤¬ +.I pid +¤Ç»ØÄꤵ¤ì¤¿ÃͤΥ¹¥ì¥Ã¥É¤Ë¤½¤Î¥·¥°¥Ê¥ë¤òÁ÷¤ë +(¥¹¥ì¥Ã¥É ID ¤Ï +.BR clone (2) +¤ä +.BR gettid (2) +¤Î¸Æ¤Ó½Ð¤·¤ÇÊÖ¤µ¤ì¤ëÃͤǤ¢¤ë)¡£ +.TP +.BR F_OWNER_PID +ID ¤¬ +.I pid +¤Ç»ØÄꤵ¤ì¤¿ÃÍ¤Î¥×¥í¥»¥¹¤Ë¤½¤Î¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.TP +.BR F_OWNER_PGRP +ID ¤¬ +.I pid +¤Ç»ØÄꤵ¤ì¤¿ÃÍ¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë¤½¤Î¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.RB ( F_SETOWN +¤È°Û¤Ê¤ê¡¢¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤Ë¤ÏÀµ¤ÎÃͤò»ØÄꤹ¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£) +.RE +.TP +.BR F_GETSIG " (\fIvoid\fP)" +ÆþÎϤä½ÐÎϤ¬²Äǽ¤Ë¤Ê¤Ã¤¿¾ì¹ç¤ËÁ÷¤ë¥·¥°¥Ê¥ë¤ò +(´Ø¿ô¤Î·ë²Ì¤È¤·¤Æ) ÊÖ¤¹¡£ +ÃÍ¥¼¥í¤Ï +.B SIGIO +¤òÁ÷¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.RB ( SIGIO +¤ò´Þ¤à) ¾¤ÎÃͤϤ¤¤º¤ì¤â¡¢ +.B SIGIO +¤ÎÂå¤ï¤ê¤ËÁ÷¤ë¥·¥°¥Ê¥ëÈÖ¹æ¤òɽ¤¹¡£ +¸å¼Ô¤Î¾ì¹ç¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò +.B SA_SIGINFO +¥Õ¥é¥°ÉÕ¤­¤ÇÀßÄꤹ¤ì¤Ð¡¢¥Ï¥ó¥É¥é¤ÇÄɲäξðÊó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.I arg +¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.BR F_SETSIG " (\fIlong\fP)" +ÆþÎϤä½ÐÎϤ¬²Äǽ¤Ë¤Ê¤Ã¤¿¾ì¹ç¤ËÁ÷¤ë¥·¥°¥Ê¥ë¤ò +.I arg +¤Ë»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +ÃÍ¥¼¥í¤Ï +.B SIGIO +¤òÁ÷¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.RB ( SIGIO +¤ò´Þ¤à) ¾¤ÎÃͤϤ¤¤º¤ì¤â¡¢ +.B SIGIO +¤ÎÂå¤ï¤ê¤ËÁ÷¤ë¥·¥°¥Ê¥ëÈÖ¹æ¤òɽ¤¹¡£ +¸å¼Ô¤Î¾ì¹ç¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò +.B SA_SIGINFO +¥Õ¥é¥°ÉÕ¤­¤ÇÀßÄꤹ¤ì¤Ð¡¢ +¥Ï¥ó¥É¥é¤ÇÄɲäξðÊó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\" +.\" The following was true only up until 2.6.11: +.\" +.\" ¤Þ¤¿¡¢ +.\" .B F_SETSIG +.\" ¤Ë 0 °Ê³°¤ÎÃͤòÅϤ¹¤È¡¢¥·¥°¥Ê¥ë¤Î¼õ¿®¼Ô¤ò¥×¥í¥»¥¹Á´ÂΤ«¤é +.\" ¥×¥í¥»¥¹Æâ¤ÎÆÃÄê¤Î¥¹¥ì¥Ã¥É¤ËÊѹ¹¤µ¤ì¤ë¡£¾ÜºÙ¤Ï +.\" .B F_SETOWN +.\" ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ + +.B F_SETSIG +¤Ë¥¼¥í°Ê³°¤ÎÃͤòÀßÄꤷ¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë +.B SA_SIGINFO +¥Õ¥é¥°¤òÀßÄꤹ¤ë¤È¡¢ +.RB ( sigaction (2) +¤ò»²¾È) I/O ¥¤¥Ù¥ó¥È¤Ë´Ø¤¹¤ëÄɲäξðÊó¤¬ +.I siginfo_t +¹½Â¤ÂΤǥ·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ØÅϤµ¤ì¤ë¡£ +.I si_code +¥Õ¥£¡¼¥ë¥É¤¬¼¨¤¹¥·¥°¥Ê¥ë¤Î¸¶°ø¤¬ +.B SI_SIGIO +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I si_fd +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥¤¥Ù¥ó¥È¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¤É¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÍøÍѲÄǽ¤«¤ò¼¨¤¹¾ðÊó¤Ï +¤Ê¤¤¤Î¤Ç¡¢¤É¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç I/O ¤¬²Äǽ¤«¤òȽÃǤ¹¤ë¤¿¤á¤Ë¤Ï +Ä̾ï¤Îµ¡¹½ +.RB ( select (2), +.BR poll (2), +.B O_NONBLOCK +¤òÀßÄꤷ¤¿ +.BR read (2) +¤Ê¤É) ¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë (Ãͤ¬ +.B SIGRTMIN +°Ê¾å) ¤òÁªÂò¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +Ʊ¤¸¥·¥°¥Ê¥ëÈÖ¹æ¤ò»ý¤ÄÊ£¿ô¤Î I/O ¥¤¥Ù¥ó¥È¤¬¥­¥å¡¼¤ËÆþ¤ë¤³¤È¤¬¤¢¤ë +(¥­¥å¡¼¤ËÆþ¤ì¤ë¤«¤É¤¦¤«¤ÏÍøÍѲÄǽ¤Ê¥á¥â¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë)¡£ +¾åµ­¤ÈƱÍÍ¡¢ +.B SA_SIGINFO +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¤¿¤á¤ÎÄɲäξðÊó¤¬ÆÀ¤é¤ì¤ë¡£ + +.\" 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 +¤³¤ì¤é¤Îµ¡¹½¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç¤Ç +.BR select (2) +¤ä +.BR poll (2) +¤ò»ÈÍѤ»¤º¤Ë´°Á´¤ÊÈóƱ´ü I/O ¤ò¼ÂÁõ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.BR O_ASYNC , +.BR F_GETOWN , +.B F_SETOWN +¤Î»ÈÍÑ¤Ï BSD ¤È Linux ¤ËÆÃÍ­¤Ç¤¢¤ë¡£ +.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) ¤Î°ìÉô¤È¤·¤Æ +¤³¤ì¤é¤âÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SS "¥ê¡¼¥¹ (leases)" +(Linix 2.4 °Ê¹ß¤ÇÍøÍѲÄǽ) +.B F_SETLEASE +¤Ï¡¢ +.I fd +¤¬»²¾È¤¹¤ë¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¤ËÂФ·¤Æ¿·¤·¤¤¥ê¡¼¥¹¤òÀßÄꤹ¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +.B F_GETLEASE +¤Ï¡¢ +.I fd +¤¬»²¾È¤¹¤ë¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¤ËÂФ·¤ÆÀßÄꤵ¤ì¤Æ¤¤¤ë +¸½ºß¤Î¥ê¡¼¥¹¤ò¼èÆÀ¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¤Î¥ê¡¼¥¹¤Ë¤è¤ê¡¢ +¤¢¤ë¥×¥í¥»¥¹ ("lease breaker") ¤¬¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬»²¾È +¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +.BR open (2) +¤ä +.BR truncate (2) +¤ò¹Ô¤ª¤¦¤È¤·¤¿ºÝ¤Ë¡¢¥ê¡¼¥¹¤òÊÝ»ý¤·¤Æ¤¤¤ë¥×¥í¥»¥¹ ("lease holder") ¤Ø +(¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤Ë¤è¤ë) ÄÌÃΤ¬¹Ô¤ï¤ì¤ë¤È¤¤¤¦µ¡¹½¤¬Ä󶡤µ¤ì¤ë¡£ +.TP +.BR F_SETLEASE " (\fIlong\fP)" +.I arg +¤ÎÆâÍƤ˴𤤤ƥե¡¥¤¥ë¤Î¥ê¡¼¥¹¤ÎÀßÄê¡¢ºï½ü¤ò¹Ô¤¦¡£À°¿ô +.I arg +¤Ë¤Ï°Ê²¼¤ÎÃͤ¬»ØÄê¤Ç¤­¤ë: + +.RS +.TP +.B F_RDLCK +Æɤ߽Ф·¥ê¡¼¥¹¤ò¼èÆÀ¤¹¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤¬½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¤¬ÀÚ¤êµÍ¤á¤é¤ì¤¿¾ì¹ç¤Ë¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÄÌÃΤ¬¹Ô¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.\" °Ê²¼¤ÎÆâÍƤϥ«¡¼¥Í¥ë 2.6.10 ¤Ç¼ÂÁõ¤µ¤ì¤¿¡£ +.\" ¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï man-pages-2.09 ¤Î Changelog ¤ò»²¾È¡£ +Æɤ߽Ф·¥ê¡¼¥¹¤òÀßÄê¤Ç¤­¤ë¤Î¤Ï¡¢Æɤ߽Ф·ÀìÍѤǥª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ¤Î¤ß¤Ç¤¢¤ë¡£ +.TP +.B F_WRLCK +½ñ¤­¹þ¤ß¥ê¡¼¥¹¤ò¼èÆÀ¤¹¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢ +(Æɤ߽Ф·ÍѤ«½ñ¤­¹þ¤ßÍѤˤ«¤«¤ï¤é¤º) ¤½¤Î¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¤ê¡¢ +¥Õ¥¡¥¤¥ë¤¬ÀÚ¤êµÍ¤á¤é¤ì¤¿¾ì¹ç¤Ë¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÄÌÃΤ¬¹Ô¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +½ñ¤­¹þ¤ß¥ê¡¼¥¹¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +¾¤Ë¤Ê¤¤¾ì¹ç¤Ë¤Î¤ßÀßÄê¤Ç¤­¤ë¡£ +.TP +.B F_UNLCK +¤½¤Î¥Õ¥¡¥¤¥ë¤«¤é¥ê¡¼¥¹¤òºï½ü¤¹¤ë¡£ +.RE +.P +¥ê¡¼¥¹¤Ï¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¤ËÂФ·¤Æ´ØÏ¢ÉÕ¤±¤é¤ì¤ë +.RB ( open (2) +»²¾È)¡£ +¤Ä¤Þ¤ê¡¢ +.RB ( fork (2) +¤ä +.BR dup (2) +¤Ê¤É¤Ë¤è¤êºîÀ®¤µ¤ì¤¿) ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÊ£À½¤ÏƱ¤¸¥ê¡¼¥¹¤ò»²¾È¤·¡¢ +Ê£À½¤â´Þ¤á¤¿¤É¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»È¤Ã¤Æ¤â¤³¤Î¥ê¡¼¥¹¤òÊѹ¹¤·¤¿¤ê +²òÊü¤·¤¿¤ê¤Ç¤­¤ë¡£ +¤Þ¤¿¡¢¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¤¤º¤ì¤«¤ËÂФ·¤Æ +.B F_UNLCK +Áàºî¤¬ÌÀ¼¨Åª¤Ë¼Â¹Ô¤µ¤ì¤¿¾ì¹ç¤ä¡¢¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +ÊĤ¸¤é¤ì¤¿¾ì¹ç¤Ë¤â¡¢¥ê¡¼¥¹¤Ï²òÊü¤µ¤ì¤ë¡£ +.P +¥ê¡¼¥¹¤Î¼èÆÀ¤ÏÄ̾ï¤Î¥Õ¥¡¥¤¥ë (regular file) ¤ËÂФ·¤Æ¤Î¤ß²Äǽ¤Ç¤¢¤ë¡£ +ÈóÆø¢¥×¥í¥»¥¹¤¬¥ê¡¼¥¹¤ò¼èÆÀ¤Ç¤­¤ë¤Î¤Ï¡¢UID (½êÍ­¼Ô) ¤¬¥×¥í¥»¥¹¤Î +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤È°ìÃפ¹¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¤À¤±¤Ç¤¢¤ë¡£ +.B CAP_LEASE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹¤ÏǤ°Õ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¥ê¡¼¥¹¤ò¼èÆÀ¤Ç¤­¤ë¡£ +.TP +.BR F_GETLEASE " (\fIvoid\fP)" +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤ËÂФ·¤ÆÀßÄꤵ¤ì¤Æ¤¤¤ë¥ê¡¼¥¹¤Î¼ïÊ̤ò¼èÆÀ¤¹¤ë¡£ +.BR F_RDLCK ", " F_WRLCK ", " F_UNLCK +¤Î¤¤¤º¤ì¤«¤¬ÊÖ¤µ¤ì¤ë¡£ +.BR F_RDLCK ", " F_WRLCK +¤Ï¤½¤ì¤¾¤ì¡¢Æɤ߽Ф·¥ê¡¼¥¹¡¢½ñ¤­¹þ¤ß¥ê¡¼¥¹¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤³¤È¤ò¼¨¤·¡¢ +.B F_UNLCK +¤Ï¥ê¡¼¥¹¤¬²¿¤âÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£ +.I arg +¤Ï̵»ë¤µ¤ì¤ë¡£ +.PP +¤¢¤ë¥×¥í¥»¥¹ ("lease folder") ¤¬ +.B F_SETLEASE +¤ÇÀßÄꤵ¤ì¤¿¥ê¡¼¥¹¤ÈÌ·½â¤¹¤ë¤è¤¦¤Ê +.BR open (2) +¤ä +.BR truncate (2) +¤ò¼Â¹Ô¤·¤¿¾ì¹ç¡¢ +¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤ÆÄä»ß¤µ¤ì¡¢ +¥«¡¼¥Í¥ë¤Ï lease holder ¤Ë¥·¥°¥Ê¥ë (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +.BR SIGIO ) +¤òÁ÷¤Ã¤ÆÄÌÃΤò¹Ô¤¦¡£ +lease holder ¤Ï¤³¤Î¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤¿¤È¤­¤Ë¤Ï¤­¤Á¤ó¤ÈÂбþ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¶ñÂÎŪ¤Ë¤Ï¡¢ÊÌ¤Î¥×¥í¥»¥¹¤¬¤½¤Î¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î½àÈ÷¤È¤·¤Æ +ɬÍפʸåÊÒÉÕ¤± (Î㤨¤Ð¡¢¥­¥ã¥Ã¥·¥å¤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Î¥Õ¥é¥Ã¥·¥å) ¤ò +¤¹¤Ù¤Æ¹Ô¤Ã¤Æ¤«¤é¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Î¥ê¡¼¥¹¤Îºï½ü¤Þ¤¿¤Ï³Ê²¼¤²¤ò¹Ô¤¦¡£ +¥ê¡¼¥¹¤òºï½ü¤ò¤¹¤ë¤Ë¤Ï¡¢ +.I arg +¤Ë +.B F_UNLCK +¤ò»ØÄꤷ¤Æ +.B F_SETLEASE +¤ò¼Â¹Ô¤¹¤ë¡£ +lease holder ¤¬¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤ß¥ê¡¼¥¹¤òÊÝ»ý¤·¤Æ¤¤¤Æ¡¢ +lease breaker ¤¬Æɤ߽Ф·ÍѤˤ½¤Î¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +lease holder ¤¬ÊÝ»ý¤·¤Æ¤¤¤ë¥ê¡¼¥¹¤òÆɤ߽Ф·¥ê¡¼¥¹¤Ë³Ê²¼¤²¤¹¤ì¤Ð +½½Ê¬¤Ç¤¢¤ë¡£¤³¤ì¤ò¤¹¤ë¤Ë¤Ï¡¢ +.I arg +¤Ë +.B F_RDLCK +¤ò»ØÄꤷ¤Æ +.B F_SETLEASE +¤ò¼Â¹Ô¤¹¤ë¡£ + +lease holder ¤¬ +.I /proc/sys/fs/lease-break-time +¤Ç»ØÄꤵ¤ì¤¿Éÿô°ÊÆâ¤Ë¥ê¡¼¥¹¤Î³Ê²¼¤²¤«ºï½ü¤ò¹Ô¤¨¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +¥«¡¼¥Í¥ë¤Ï¶¯À©Åª¤Ë¤½¤Î lease holder ¤Î¥ê¡¼¥¹¤òºï½ü¤â¤·¤¯¤Ï³Ê²¼¤²¤ò¹Ô¤¦¡£ + +°ìÅ٥꡼¥¹¤Îºï½ü¤«³Ê²¼¤²¤¬¼«È¯Åª¤â¤·¤¯¤Ï¶¯À©Åª¤Ë¹Ô¤ï¤ì¤ë¤È¡¢ +lease breaker ¤¬¤Þ¤À¥·¥¹¥Æ¥à¥³¡¼¥ë¤òºÆ³«¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +¥«¡¼¥Í¥ë¤¬ lease breaker ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î³¹Ô¤òµö²Ä¤¹¤ë¡£ + +lease breaker ¤¬¼Â¹Ô¤·¤¿ +.BR open (2) +¤ä +.BR truncate (2) +¤¬Ää»ßÃæ¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤êÃæÃǤµ¤ì¤¿¾ì¹ç¡¢ +¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.B EINTR +¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¤¬¡¢¾å¤Ç½Ò¤Ù¤¿Â¾¤Î½èÍý¤Ï +¤½¤Î¤Þ¤Þ¹Ô¤ï¤ì¤ë¡£ +.BR open (2) +¤ä +.BR truncate (2) +¤¬Ää»ßÃæ¤Ë lease breaker ¤¬¥·¥°¥Ê¥ë¤Ë¤è¤ê kill ¤µ¤ì¤¿¾ì¹ç¡¢ +¾å¤Ç½Ò¤Ù¤¿Â¾¤Î½èÍý¤Ï¤½¤Î¤Þ¤Þ¹Ô¤ï¤ì¤ë¡£ +lease breaker ¤¬ +.BR open (2) +¤ò¸Æ¤ÖºÝ¤Ë +.B O_NONBLOCK +¥Õ¥é¥°¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.B EWOULDBLOCK +¥¨¥é¡¼¤Çľ¤Á¤Ë¼ºÇÔ¤¹¤ë¤¬¡¢¾å¤Ç½Ò¤Ù¤¿Â¾¤Î½èÍý¤Ï¤½¤Î¤Þ¤Þ¹Ô¤ï¤ì¤ë¡£ + +lease holder ¤Ø¤ÎÄÌÃΤ˻Ȥï¤ì¤ë¥Ç¥Õ¥©¥ë¥È¤Î¥·¥°¥Ê¥ë¤Ï +.B SIGIO +¤À¤¬¡¢ +.BR fcntl () +¤Î +.B F_SETSIG +¥³¥Þ¥ó¥É¤ÇÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.B F_SETSIG +¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì +.RB ( SIGIO +¤ò»ØÄꤵ¤ì¤¿¾ì¹ç¤â´Þ¤à)¡¢ +.B SA_SIGINFO +¥Õ¥é¥°ÉÕ¤­¤Ç¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¥Ï¥ó¥É¥é¤ÎÂèÆó°ú¤­¿ô¤È¤·¤Æ +.I siginfo_t +¹½Â¤ÂΤ¬ÅϤµ¤ì¡¢¤³¤Î°ú¤­¿ô¤Î +.I si_fd +¥Õ¥£¡¼¥ë¥É¤Ë¤ÏÊÌ¤Î¥×¥í¥»¥¹¤¬¥¢¥¯¥»¥¹¤·¤¿¥ê¡¼¥¹ÀßÄêºÑ¤ß¥Õ¥¡¥¤¥ë¤Î +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Æþ¤Ã¤Æ¤¤¤ë +(¤³¤Îµ¡Ç½¤ÏÊ£¿ô¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¥ê¡¼¥¹¤òÀßÄꤹ¤ë¾ì¹ç¤ËÍ­ÍѤǤ¢¤ë)¡£ +.SS "¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤ÎÊѹ¹¤ÎÄÌÃÎ (dnotify)" +.TP +.BR F_NOTIFY " (\fIlong\fP)" +(Linux 2.4 °Ê¹ß) +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¡¢¤½¤ÎÃæ¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤ËÊѹ¹¤¬¤¢¤Ã¤¿¾ì¹ç¤Ë +ÄÌÃΤò¹Ô¤¦¡£¤É¤Î¥¤¥Ù¥ó¥È¤òÄÌÃΤ¹¤ë¤«¤Ï +.I arg +¤Ç»ØÄꤹ¤ë¡£ +.I arg +¤Ï¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¡¢°Ê²¼¤Î¥Ó¥Ã¥È¤Î 0¸Ä°Ê¾å¤ÎÏÀÍýϤò¤È¤Ã¤¿¤â¤Î¤ò»ØÄꤹ¤ë¡£ +.RS +.sp +.PD 0 +.TP 12 +.B DN_ACCESS +¥Õ¥¡¥¤¥ë¤Ø¤Î¥¢¥¯¥»¥¹¤¬¤¢¤Ã¤¿ (read, pread, readv) +.TP +.B DN_MODIFY +¥Õ¥¡¥¤¥ë¤ÎÆâÍƤ¬Êѹ¹¤µ¤ì¤¿ (write, pwrite, writev, truncate, ftruncate). +.TP +.B DN_CREATE +¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤¿ (open, creat, mknod, mkdir, link, symlink, rename). +.TP +.B DN_DELETE +¥Õ¥¡¥¤¥ë¤¬ºï½ü (unlink) ¤µ¤ì¤¿ (unlink, Ê̤Υǥ£¥ì¥¯¥È¥ê¤Ø¤Î rename, rmdir) +.TP +.B DN_RENAME +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Ç¤Î¥Õ¥¡¥¤¥ë̾¤ÎÊѹ¹¤¬¤¢¤Ã¤¿ (rename) +.TP +.B DN_ATTRIB +¥Õ¥¡¥¤¥ë°À­¤¬Êѹ¹¤µ¤ì¤¿ (chown, chmod, utime[s]) +.PD +.RE +.IP +(¾åµ­¤ÎÄêµÁ¤òÍøÍѤ¹¤ë¤Ë¤Ï +.B _GNU_SOURCE +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£) + +¥Ç¥£¥ì¥¯¥È¥ê¤ÎÊѹ¹ÄÌÃΤÏÄ̾ï¡Ö°ì²ó¸Â¤ê (one-shot)¡×¤Ç¤¢¤ê¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¦¤Ç¤½¤Î¸å¤µ¤é¤ËÄÌÃΤò¼õ¿®¤·¤¿¤¤¾ì¹ç¤Ï +ºÆÅÐÏ¿¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I arg +¤Ë +.B DN_MULTISHOT +¤¬´Þ¤Þ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¡¢ +Êѹ¹ÄÌÃΤÏÌÀ¼¨Åª¤Ë²ò½ü¤µ¤ì¤ë¤Þ¤ÇÍ­¸ú¾õÂÖ¤¬·Ñ³¤¹¤ë¡£ + +.\" °Ê²¼¤Ï API ¤ÎÀ߷פ¬¤Þ¤º¤¤¤È»×¤¦¤Î¤À¤¬... +.B F_NOTIFY +Í×µá¤ÏÀÑ»»¤µ¤ì¤Æ¤¤¤¯¡£¤Ä¤Þ¤ê¡¢ +.I arg +¤Ç»ØÄꤵ¤ì¤¿¥¤¥Ù¥ó¥È¤¬¤¹¤Ç¤Ë¥â¥Ë¥¿¤µ¤ì¤Æ¤¤¤ë +¥¤¥Ù¥ó¥È½¸¹ç¤Ë²Ã»»¤µ¤ì¤ë·Á¤Ë¤Ê¤ë¡£ +¤¹¤Ù¤Æ¤Î¥¤¥Ù¥ó¥È¤ÎÄÌÃΤò̵¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢ +.I arg +¤Ë 0 ¤ò»ØÄꤷ¤Æ +.B F_NOTIFY +¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢¤ë¡£ + +ÄÌÃΤϥ·¥°¥Ê¥ë¤ÎÇÛÁ÷¤Ç¹Ô¤ï¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î¥·¥°¥Ê¥ë¤Ï +.B SIGIO +¤À¤¬¡¢ +.BR fcntl () +¤Î +.B F_SETSIG +¥³¥Þ¥ó¥É¤ÇÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¸å¼Ô¤Î¾ì¹ç¤Ë¤Ï¡¢ +.RB ( SA_SIGINFO +¥Õ¥é¥°ÉÕ¤­¤Ç¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï) +¥Ï¥ó¥É¥é¤ÎÂèÆó°ú¤­¿ô¤È¤·¤Æ +.I siginfo_t +¹½Â¤ÂΤ¬ÅϤµ¤ì¡¢¤³¤Î¹½Â¤ÂΤΠ+.I si_fd +¥Õ¥£¡¼¥ë¥É¤Ë¤ÏÄÌÃΤιԤï¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Æþ¤Ã¤Æ¤¤¤ë +(¤³¤Îµ¡Ç½¤ÏÊ£¿ô¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤ÆÄÌÃΤòÀßÄꤹ¤ë¾ì¹ç¤ËÍ­ÍѤǤ¢¤ë)¡£ + +ÆÃ¤Ë +.B DN_MULTISHOT +¤ò»È¤¦¾ì¹ç¤Ï¡¢ÄÌÃΤˤϥꥢ¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +¤½¤ì¤Ï¡¢¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ò»È¤¦¤³¤È¤Ç¡¢Ê£¿ô¤ÎÄÌÃΤò¥­¥å¡¼¤ËÆþ¤ì¤ë +¤³¤È¤¬¤Ç¤­¤ë¤«¤é¤Ç¤¢¤ë¡£ + +.B Ãí°Õ: +¿·¤·¤¯¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò½ñ¤¯ºÝ¤Ë¤Ï¡¢(¥«¡¼¥Í¥ë 2.6.13 °Ê¹ß¤ÇÍøÍѲÄǽ¤È¤Ê¤Ã¤¿) +.I inotify +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.I inotify +¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¤¥Ù¥ó¥È¤ÎÄÌÃΤò¼èÆÀ¤¹¤ë¤¿¤á¤Î +¤º¤Ã¤ÈÍ¥¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +.BR inotify (7) +¤ò»²¾È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤ÎÊÖ¤êÃͤÏÁàºî¤Î¼ïÎà¤Ë¤è¤ê°ã¤¦: +.TP 0.9i +.B F_DUPFD +¿·¤·¤¤¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.TP +.B F_GETFD +¥Õ¥é¥°¤ÎÃͤòÊÖ¤¹¡£ +.TP +.B F_GETFL +¥Õ¥é¥°¤ÎÃͤòÊÖ¤¹¡£ +.TP +.B F_GETLEASE +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤ÆÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¥ê¡¼¥¹¤Î¼ïÊ̤òÊÖ¤¹¡£ +.TP +.B F_GETOWN +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î½êÍ­¼Ô¤òÊÖ¤¹¡£ +.TP +.B F_GETSIG +Æɤ߹þ¤ß¤ä½ñ¤­½Ð¤·¤¬²Äǽ¤Ë¤Ê¤Ã¤¿»þ¤ËÁ÷¤é¤ì¤ë¥·¥°¥Ê¥ë¤ÎÃÍ¡¢¤â¤·¤¯¤Ï +ÅÁÅýŪ¤Ê +.B SIGIO +Æ°ºî¤Î¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.TP +¾¤ÎÁ´¤Æ¤Î¥³¥Þ¥ó¥É¤Ï 0 ¤òÊÖ¤¹¡£ +.PP +¥¨¥é¡¼¤Î»þ¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.BR EACCES " ¤« " EAGAIN +¾¤Î¥×¥í¥»¥¹¤¬ÊÝ»ý¤·¤Æ¤¤¤ë¥í¥Ã¥¯¤Ë¤è¤Ã¤ÆÁàºî¤¬¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EAGAIN +¤½¤Î¥Õ¥¡¥¤¥ë¤Ï¾¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ¥á¥â¥ê¡¦¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢ +Áàºî¤¬¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EBADF +.I fd +¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +¤¢¤ë¤¤¤Ï¥³¥Þ¥ó¥É¤¬ +.B F_SETLK +¤Þ¤¿¤Ï +.B F_SETLKW +¤À¤Ã¤¿¤¬¡¢ÂоݤΥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥ª¡¼¥×¥ó¥â¡¼¥É¤¬ +ɬÍפȤʤë¥í¥Ã¥¯¤Î·¿¤Ë¥Þ¥Ã¥Á¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EDEADLK +»ØÄꤵ¤ì¤¿ +.B F_SETLKW +¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Ë¤Ï¥Ç¥Ã¥É¥í¥Ã¥¯¤Ë¤Ê¤ë¤³¤È¤¬¸¡½Ð¤µ¤ì¤¿¡£ +.TP +.B EFAULT +.I lock +¤¬ÍøÍѲÄǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤Ë¤¢¤ë¡£ +.TP +.B EINTR +.B F_SETLKW +¥³¥Þ¥ó¥É¤¬¥·¥°¥Ê¥ë¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿ +.RB ( signal (7) +»²¾È)¡£ +.BR F_GETLK " ¤È " F_SETLK +¤Î¾ì¹ç¡¢¥í¥Ã¥¯¤ò³Îǧ¤·¤¿¤ê¼èÆÀ¤·¤¿¤ê¤¹¤ëÁ°¤Ë¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¡£ +¤³¤ì¤Ï¤¿¤¤¤Æ¤¤¥ê¥â¡¼¥È¤Î¥Õ¥¡¥¤¥ë¤ò¥í¥Ã¥¯¤¹¤ë¾ì¹ç +(Î㤨¤Ð NFS ¾å¤Ç¥í¥Ã¥¯¤¹¤ë¾ì¹ç) ¤Ëµ¯¤³¤ë¡£ +¤·¤«¤·¥í¡¼¥«¥ë¤Ç¤âµ¯¤³¤ë¾ì¹ç¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.BR F_DUPFD ¤Ç¡¢ +.I arg +¤¬É餫¡¢¤â¤·¤¯¤Ïµö¤µ¤ì¤ëºÇÂçÃͤè¤ê¤âÂ礭¤¤¡£ +.B F_SETSIG +¤Î¾ì¹ç¡¢ +.I arg +¤¬ÍøÍѲÄǽ¤Ê¥·¥°¥Ê¥ëÈÖ¹æ¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EMFILE +.BR F_DUPFD ¤Ç¡¢ +¥×¥í¥»¥¹¤¬¤¹¤Ç¤ËºÇÂç¿ô¤Þ¤Ç¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¡£ +.TP +.B ENOLCK +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥í¥Ã¥¯¤Î¿ô¤¬Â¿²á¤®¤Æ¡¢¥í¥Ã¥¯¡¦¥Æ¡¼¥Ö¥ë¤¬¤¤¤Ã¤Ñ¤¤¤Ç¤¢¤ë¡£ +¤Þ¤¿¤Ï remote locking protocol (Î㤨¤Ð NFS ¾å¤Î¥í¥Ã¥¯) ¤¬¼ºÇÔ¤·¤¿¡£ +.TP +.B EPERM +ÄɲÃÀìÍÑ°À­¤¬ÀßÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î +.B O_APPEND +¥Õ¥é¥°¤ò¥¯¥ê¥¢¤·¤è¤¦¤È»î¤ß¤¿¡£ +.SH ½àµò +SVr4, 4.3BSD, 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 +¤À¤±¤Ç¤¢¤ë¡£ + +.B F_DUPFD_CLOEXEC +¤Ï POSIX.1-2008 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +.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 +.\" SVr4 ¤Ë¤Ï¾¤Ë EFAULT, EINTR, EIO, ENOLINK, EOVERFLOW ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Î +.\" µ­½Ò¤¬¤¢¤ë¡£ +.SH Ãí°Õ +¥¨¥é¡¼¤ÎºÝ¤ÎÊÖ¤êÃͤ¬ +.BR dup2 (2) +¤È +.B F_DUPFD +¤Ç¤Ï°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ + +¥«¡¼¥Í¥ë 2.0 °Ê¹ß¤Ç¤Ï¡¢ +.BR flock (2) +¤È +.BR fcntl () +¤¬ÀßÄꤹ¤ë¥í¥Ã¥¯¼ïÊ̤δ֤ËÁê¸ßºîÍѤϤʤ¤¡£ + +¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢ +.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 +¤À¤±¤Ï¤¢¤Þ¤êÌò¤Ë¤¿¤¿¤Ê¤¤¤À¤í¤¦¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +¤¤¤¯¤Ä¤«¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã (ÆÃ¤Ë i386) ¤Ë¤ª¤±¤ë Linux ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î´·½¬ +¤Î¤¿¤á°Ê²¼¤ÎÀ©¸Â¤¬Â¸ºß¤¹¤ë¡£ +.B F_GETOWN +¤¬ÊÖ¤¹ (Éé¤Î) ¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤¬ \-1 ¤«¤é \-4095 ¤ÎÈϰϤËÆþ¤Ã¤¿¾ì¹ç¡¢ +glibc ¤Ï¤³¤ÎÊÖ¤êÃͤò¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤È +´Ö°ã¤Ã¤Æ²ò¼á¤·¤Æ¤·¤Þ¤¦¡£¤Ä¤Þ¤ê¡¢ +.BR fcntl () +¤ÎÊÖ¤êÃÍ¤Ï \-1 ¤È¤Ê¤ê¡¢ +.I errno +¤Ë¤Ï (Àµ¤Î) ¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤¬ÀßÄꤵ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +Linux ¸ÇÍ­¤Î +.B F_SETOWN_EX +¤È +.B F_GETOWN_EX +¤Ç¤Ï¤³¤ÎÌäÂê¤ò²óÈò¤Ç¤­¤ë¡£ +.\" mtk, Dec 04: alpha ¤È ia64 ¤Ç¤Ï¡¢¾¯¤·¥Æ¥¹¥È¤·¤Æ¤ß¤¿¸Â¤ê¡¢ +.\" ¡Ö¤É¤ó¤Ê¡×Éé¤Î PGID ¤Ç¤â F_GETOWN ¤Ç¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤È´Ö°ã¤Ã¤Æ +.\" ²ò¼á¤µ¤ì¤Æ¤·¤Þ¤¦¤è¤¦¤À¡£Â¾¤Î¤¤¤¯¤Ä¤«¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢ +.\" i386 ¤ÈƱÍͤÎÈϰϤΥÁ¥§¥Ã¥¯¤¬¹Ô¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£ + +Linux 2.4 °ÊÁ°¤Ç¤Ï¡¢ÈóÆø¢¥×¥í¥»¥¹¤¬ +.B F_SETOWN +¤ò»È¤Ã¤Æ¡¢¥½¥±¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î½êÍ­¼Ô¤Ë +¸Æ¤Ó½Ð¤·¸µ°Ê³°¤Î¥×¥í¥»¥¹ (¤ä¥×¥í¥»¥¹¥°¥ë¡¼¥×) ¤ò»ØÄꤹ¤ë¤È +ȯÀ¸¤¹¤ë¥Ð¥°¤¬¤¢¤ë¡£¤³¤Î¾ì¹ç¡¢ +¸Æ¤Ó½Ð¤·¸µ¤¬½êÍ­¼Ô¤È¤·¤Æ»ØÄꤷ¤¿¥×¥í¥»¥¹ (¤ä¥×¥í¥»¥¹¥°¥ë¡¼¥×) ¤Ë +¥·¥°¥Ê¥ë¤òÁ÷¤ëµö²Ä¤ò»ý¤Ã¤Æ¤¤¤¿¤È¤·¤Æ¤â¡¢ +.BR fcntl () +¤¬ \-1 ¤òÊÖ¤· +.I errno +¤Ë +.B EPERM +¤òÀßÄꤹ¤ë¤³¤È¤¬¤¢¤ë¡£ +¤³¤Î¥¨¥é¡¼¤¬Ê֤俤ˤ⤫¤«¤ï¤é¤º¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î½êÍ­¼Ô +¤ÏÀßÄꤵ¤ì¡¢¥·¥°¥Ê¥ë¤Ï¤½¤Î½êÍ­¼Ô¤ËÁ÷¤é¤ì¤ë¡£ + +¤³¤ì¤Þ¤Ç¤Î Linux ¤ÎÁ´¤Æ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤ª¤±¤ë¶¯À©¥í¥Ã¥¯¤Î¼ÂÁõ¤Ï¡¢ +¶¥¹ç¾ò·ï²¼¤Ç¶¯À©¥í¥Ã¥¯¤¬ÉÔ´°Á´¤Ë¤Ê¤ë¤è¤¦¤Ê¾ì¹ç¤¬¤¢¤ë¡£ +.\" http://marc.info/?l=linux-kernel&m=119013491707153&w=2 +¥í¥Ã¥¯¤È½Å¤Ê¤Ã¤Æ¼Â¹Ô¤µ¤ì¤¿ +.BR write (2) +¤Î¸Æ¤Ó½Ð¤·¤Ï¶¯À©¥í¥Ã¥¯¤¬³ÍÆÀ¤µ¤ì¤¿¸å¤Ë¤â¥Ç¡¼¥¿¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥í¥Ã¥¯¤È½Å¤Ê¤Ã¤Æ¼Â¹Ô¤µ¤ì¤¿ +.BR read (2) +¤Î¸Æ¤Ó½Ð¤·¤Ï¶¯À©¥í¥Ã¥¯¤¬³ÍÆÀ¤µ¤ì¤¿¸å¤Ë¤Ê¤Ã¤Æ¹Ô¤ï¤ì¤¿¥Ç¡¼¥¿¤ÎÊѹ¹¤ò +¸¡½Ð¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +ƱÍͤζ¥¹ç¾ò·ï¤¬¶¯À©¥í¥Ã¥¯¤È +.BR mmap (2) +¤Î´Ö¤Ë¤â¸ºß¤¹¤ë¡£¤½¤ì¤æ¤¨¡¢¶¯À©¥í¥Ã¥¯¤ËÍê¤ë¤Î¤Ï¤ªÁ¦¤á¤Ç¤­¤Ê¤¤¡£ +.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 +¥«¡¼¥Í¥ë¥½¡¼¥¹¤Î +.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/release/man2/flock.2 b/release/man2/flock.2 new file mode 100644 index 00000000..e3624b84 --- /dev/null +++ b/release/man2/flock.2 @@ -0,0 +1,221 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) and +.\" and Copyright 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 Fri Jan 31 16:26:07 1997 by Eric S. Raymond +.\" Modified Fri Dec 11 17:57:27 1998 by Jamie Lokier +.\" Modified 24 Apr 2002 by Michael Kerrisk +.\" Substantial rewrites and additions +.\" 2005-05-10 mtk, noted that lock conversions are not atomic. +.\" +.\" 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 +.\" +.TH FLOCK 2 2009-07-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +flock \- ¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥¢¥É¥Ð¥¤¥¶¥ê¡¦¥í¥Ã¥¯¤ÎŬÍÑ¡¢²ò½ü¤ò¹Ô¤¦ +.SH ½ñ¼° +.B #include +.sp +.BI "int flock(int " fd ", int " operation ); +.SH ÀâÌÀ +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¥¢¥É¥Ð¥¤¥¶¥ê¡¦¥í¥Ã¥¯ (advisory lock) ¤ÎŬÍÑ +¤ä²ò½ü¤ò¹Ô¤¦¡£ +¥Õ¥¡¥¤¥ë¤Ï +.I fd +¤Ç»ØÄꤹ¤ë¡£°ú¤­¿ô +.I operation +¤Ë¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄꤹ¤ë: +.RS 4 +.TP 9 +.B LOCK_SH +¶¦Í­¥í¥Ã¥¯¤òŬÍѤ¹¤ë¡£ »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¡¢ +°ì¤Ä°Ê¾å¤Î¥×¥í¥»¥¹¤¬Æ±»þ¤Ë¶¦Í­¥í¥Ã¥¯¤òÊÝ»ý¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B LOCK_EX +ÇÓ¾¥í¥Ã¥¯¤òŬÍѤ¹¤ë¡£ »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¡¢ +¤¿¤À°ì¤Ä¤Î¥×¥í¥»¥¹¤À¤±¤¬Æ±»þ¤ËÇÓ¾¥í¥Ã¥¯¤òÊÝ»ý¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B LOCK_UN +¤³¤Î¥×¥í¥»¥¹¤¬ÊÝ»ý¤·¤Æ¤¤¤ë´û¸¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë¡£ +.RE +.PP +.BR flock () +¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤­¤Ë¡¢»ØÄꤷ¤¿¥í¥Ã¥¯¼ïÊ̤Ȱۤʤë¥í¥Ã¥¯¤¬ÊÌ¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ +ÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +.BR flock () +¤ÏÄä»ß (block) ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +ÈóÄä»ß (nonblocking) ¥¿¥¤¥×¤ÎÍ×µá¤ò¹Ô¤¦¤¿¤á¤Ë¤Ï¡¢ +¾åµ­¤ÎÁàºî (operation) ¤Ë +.B LOCK_NB +¤òÏÀÍýϤηÁ¤Ç»ØÄꤹ¤ë¡£ + +°ì¤Ä¤Î¥Õ¥¡¥¤¥ë¤Ë¶¦Í­¥í¥Ã¥¯¤ÈÇÓ¾¥í¥Ã¥¯¤òƱ»þ¤ËÀßÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ + +.BR flock () +¤Ë¤è¤Ã¤Æºî¤é¤ì¤ë¥í¥Ã¥¯¤Ï¡¢ +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥Æ¡¼¥Ö¥ë¡¦¥¨¥ó¥È¥ê¤È´ØÏ¢ÉÕ¤±¤é¤ì¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÊ£À½ +.RB ( fork (2) +¤ä +.BR dup (2) +¤Ê¤É¤Ë¤è¤êºîÀ®¤µ¤ì¤ë) ¤ÏƱ¤¸¥í¥Ã¥¯¤ò»²¾È¤·¡¢ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤É¤ì¤ò»È¤Ã¤Æ¤â +¤³¤Î¥í¥Ã¥¯¤òÊѹ¹¤·¤¿¤ê²òÊü¤·¤¿¤ê¤Ç¤­¤ë¡£ +¤Þ¤¿¡¢¥í¥Ã¥¯¤Î²òÊü¤Ï¡¢ +¾åµ­¤ÎÊ£¿ô¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¤¤º¤ì¤«¤ËÂФ·¤Æ +ÌÀ¼¨Åª¤Ë +.B LOCK_UN +Áàºî¤ò»Ø¼¨¤·¤¿¾ì¹ç¤«¡¢¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¤¹¤Ù¤Æ +ÊĤ¸¤é¤ì¤¿¾ì¹ç¤Ë¹Ô¤ï¤ì¤ë¡£ + +¤¢¤ë¥×¥í¥»¥¹¤¬ +.BR open (2) +(¤â¤·¤¯¤ÏƱÍͤÎÊýË¡) ¤ò»È¤Ã¤ÆƱ¤¸¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +Ê£¿ô¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¼èÆÀ¤·¤¿¾ì¹ç¡¢ +.BR flock () +¤Ï¤³¤ì¤éÊ£¿ô¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò³Æ¡¹ÆÈΩ¤Î¤â¤Î¤È¤·¤Æ°·¤¦¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î°ì¤Ä¤ò»È¤Ã¤Æ¥Õ¥¡¥¤¥ë¤ò¥í¥Ã¥¯¤·¤è¤¦¤È +¤·¤¿ºÝ¡¢¤½¤Î¥í¥Ã¥¯Í×µá¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¤½¤Î¥Õ¥¡¥¤¥ë¤ÎÊ̤Π+¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤Ç¤¹¤Ç¤ËÀßÄꤷ¤Æ¤¤¤ë¥í¥Ã¥¯¤Ë¤è¤Ã¤ÆµñÈݤµ¤ì¤ë¾ì¹ç¤¬¤¢¤ë¡£ + +°ì¤Ä¤Î¥×¥í¥»¥¹¤Ï¡¢°ì¤Ä¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ (¶¦Í­¥í¥Ã¥¯¤ÈÇÓ¾¥í¥Ã¥¯¤Î¤¦¤Á) +¤¤¤º¤ì¤«°ì¼ïÎà¤Î¥í¥Ã¥¯¤·¤«ÀßÄê¤Ç¤­¤Ê¤¤¡£ +´û¤Ë¥í¥Ã¥¯¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +.BR flock () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢´û¸¤Î¥í¥Ã¥¯¤ò¿·¤·¤¤¥í¥Ã¥¯¥â¡¼¥É¤ËÊѹ¹¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£ + +.BR flock () +¤Ë¤è¤êºîÀ®¤µ¤ì¤¿¥í¥Ã¥¯¤Ï +.BR execve (2) +¤ÎÁ°¸å¤ÇÊݸ¤µ¤ì¤ë¡£ + +¶¦Í­¥í¥Ã¥¯¤âÇÓ¾¥í¥Ã¥¯¤â¡¢¥Õ¥¡¥¤¥ë¤¬¤É¤Î¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤¿¤«¤Ë +´Ø·¸¤Ê¤¯Å¬ÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤Î¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINTR +¥í¥Ã¥¯¤Î³ÍÆÀ¤òÂԤäƤ¤¤ë´Ö¤Ë¡¢¥Ï¥ó¥É¥é¤Ë¤è¤êÊ᪤µ¤ì¤¿¥·¥°¥Ê¥ë¤ò +¼õ¿®¤·¡¢ +.BR flock () +¤¬ÃæÃǤµ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.I oepration +¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.TP +.B ENOLCK +¥í¥Ã¥¯¡¦¥ì¥³¡¼¥É¤ò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ­¤·¤Æ¤¤¤ë¡£ +.TP +.B EWOULDBLOCK +»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤ª¤ê¡¢ +.B LOCK_NB +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +4.4BSD +.RB ( flock () +¥³¡¼¥ë¤Ï 4.2BSD ¤ÇºÇ½é¤ËÅо줷¤¿)¡£ +.BR fcntl (2) +¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ê¤É¤ò´Þ¤á¤ë¤È¡¢ +.BR flock () +¤Îµ¡Ç½¤Ï¤Û¤È¤ó¤É¤Î Unix ¥·¥¹¥Æ¥à¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.BR flock () +¤Ï NFS ¾å¤Î¥Õ¥¡¥¤¥ë¤Î¥í¥Ã¥¯¤ò¤·¤Ê¤¤¡£Âå¤ï¤ê¤Ë +.BR fcntl (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£¤³¤ì¤Ë¤è¤ê¡¢½½Ê¬¤Ë¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Linux ¤È¡¢¥í¥Ã¥¯µ¡Ç½¤ò +¥µ¥Ý¡¼¥È¤·¤¿ NFS ¥µ¡¼¥Ð¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë¤è¤ê¡¢NFS ¾å¤Ç¥í¥Ã¥¯¤¬¤Ç¤­¤ë¡£ +.PP +kernel 2.0 °Ê¹ß¤Ç¤Ï¡¢ +.BR flock () +¤Ï¡¢GNU C ¥é¥¤¥Ö¥é¥ê¤Ç¤Î +.BR fcntl (2) +¤ò¸Æ¤Ó½Ð¤·¤Æ¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ç¤Ï¤Ê¤¯¡¢ +¤½¤ì¼«ÂΤ¬¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ë¤è¤êÀµ¿¿ÀµÌäΠBSD ¤Ç¤ÎÆ°ºî¤¬Ã£À®¤µ¤ì¤ë: +.BR flock () +¤È +.BR fcntl (2) +¤ÇŬÍѤµ¤ì¤ë¥í¥Ã¥¯¤Î¼ïÊ̤ˤÏÁê¸ßºîÍѤ¬¤Ê¤¯¤Ê¤ê¡¢ +.BR flock () +¤¬¥Ç¥Ã¥É¥í¥Ã¥¯¤ò¸¡½Ð¤·¤Ê¤¯¤Ê¤ë¡£ +.PP +.BR flock () +¥¢¥É¥Ð¥¤¥¶¥ê¡¦¥í¥Ã¥¯¤À¤±¤òŬÍѤ¹¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢¥Õ¥¡¥¤¥ë¤ËŬÀڤʥ¢¥¯¥»¥¹¸¢¤ò +ÉÕÍ¿¤·¤Æ¤¤¤ì¤Ð¡¢¥×¥í¥»¥¹¤Ï +.BR flock () +¤Î»ÈÍѤË̵»ë¤·¤Æ¡¢¥Õ¥¡¥¤¥ë¤Ø¤ÎÆþ½ÐÎϤò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.BR flock () +¤È +.BR fcntl (2) +¤Ï fork ¤µ¤ì¤¿¥×¥í¥»¥¹¤È +.BR dup (2) +¤Ç°ã¤Ã¤¿Æ°ºî¤ò¤¹¤ë¡£ +.BR flock () +¤ò +.BR fcntl (2) +¤ò»È¤Ã¤Æ¼ÂÁõ¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR flock () +¤ÎÆ°ºî¤Ï¤³¤Î¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤È¤Ï°ã¤¦¤À¤í¤¦¡£ +.PP +¥í¥Ã¥¯¤ÎÊÑ´¹ (¶¦Í­¥í¥Ã¥¯¤«¤éÇÓ¾¥í¥Ã¥¯¤Ø¡¢¤â¤·¤¯¤Ï¤½¤ÎÈ¿ÂÐ) ¤¬¥¢¥È¥ß¥Ã¥¯¤Ë +¹Ô¤ï¤ì¤ë¤³¤È¤ÏÊݾڤµ¤ì¤Æ¤¤¤Ê¤¤: ´û¸¤Î¥í¥Ã¥¯¤¬¤Þ¤ººï½ü¤µ¤ì¡¢¤½¤ì¤«¤é¿·¤·¤¤ +¥í¥Ã¥¯¤¬ÀßÄꤵ¤ì¤ë¡£¤³¤Î 2¤Ä¤Î¥¹¥Æ¥Ã¥×¤Î´Ö¤Ë¡¢Â¾¤Î¥×¥í¥»¥¹¤«¤é¤Î½èÍýÂÔ¤Á¤Î +¥í¥Ã¥¯Í׵᤬ǧ¤á¤é¤ì¤ë¤«¤â¤·¤ì¤º¡¢·ë²Ì¤È¤·¤ÆÊÑ´¹¤ÏÄä»ß (block) ¤·¤¿¤ê¡¢ +.RB ( LOCK_NB +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï) ¼ºÇÔ¤·¤¿¤ê¤¹¤ë¡£ +(¤³¤ì¤Ï¸µ¡¹¤Î BSD ¤ÎÆ°ºî¤Ç¤¢¤ê¡¢Â¿¤¯¤Î¾¤Î¼ÂÁõ¤Ç¤âµ¯¤³¤ë¡£) +.\" ¥«¡¼¥Í¥ë 2.5.21 ¤Ç¾¯¤·Æ°ºî¤¬Êѹ¹¤µ¤ì¤¿: ¥í¥Ã¥¯ÊÑ´¹¤ÎºÇÃæ¤Ï +.\" ¤½¤Î¥í¥Ã¥¯¤ò¹Ô¤ª¤¦¤È¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤¬ºÇ¹âÍ¥Àè¤È¤Ê¤ë -- mtk +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR dup (2), +.BR execve (2), +.BR fcntl (2), +.BR fork (2), +.BR open (2), +.BR lockf (3) + +¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.I Documentation/filesystem/locks.txt +(°ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï +.IR Documentation/locks.txt ) +¤â»²¾È¤Î¤³¤È¡£ diff --git a/release/man2/fork.2 b/release/man2/fork.2 new file mode 100644 index 00000000..8259e411 --- /dev/null +++ b/release/man2/fork.2 @@ -0,0 +1,250 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2006 Michael Kerrisk +.\" A few fragments remain from an earlier (1992) page by +.\" Drew Eckhardt (drew@cs.colorado.edu), +.\" +.\" 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 Sat Jul 24 13:22:07 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 21 Aug 1994 by Michael Chastain (mec@shell.portal.com): +.\" Referenced 'clone(2)'. +.\" Modified 1995-06-10, 1996-04-18, 1999-11-01, 2000-12-24 +.\" by Andries Brouwer (aeb@cwi.nl) +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" 2006-09-04, Michael Kerrisk +.\" 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" +.SH ̾Á° +fork \- »Ò¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.B pid_t fork(void); +.SH ÀâÌÀ +.BR fork () +¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤òÊ£À½¤·¤Æ¿·¤·¤¤¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¡£ +\fIchild\fP ¤Ç»²¾È¤µ¤ì¤ë¿·¤·¤¤¥×¥í¥»¥¹¤Ï¡¢°Ê²¼¤ÎÅÀ¤ò½ü¤­¡¢ +\fIparent\fP ¤Ç»²¾È¤µ¤ì¤ë¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î´°Á´¤ÊÊ£À½¤Ç¤¢¤ë: +.IP * 3 +»Ò¥×¥í¥»¥¹¤ÏÆȼ«¤Î¥×¥í¥»¥¹ ID ¤ò»ý¤Á¡¢ +¤³¤Î PID ¤Ï´û¸¤Î¤É¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× +.RB ( setpgid (2)) +¤Î ID ¤È¤â°ìÃפ·¤Ê¤¤¡£ +.IP * +»Ò¥×¥í¥»¥¹¤Î¿Æ¥×¥í¥»¥¹ ID ¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.IP * +»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥á¥â¥ê¥í¥Ã¥¯ +.RB ( mlock (2), +.BR mlockall (2)) +¤ò°ú¤­·Ñ¤¬¤Ê¤¤¡£ +.IP * +¥×¥í¥»¥¹¤Î»ñ¸»ÍøÍÑÎÌ +.RB ( getrusage (2)) +¤È CPU ¥¿¥¤¥à¥«¥¦¥ó¥¿ +.RB ( times (2)) +¤¬¡¢»Ò¥×¥í¥»¥¹¤Ç¤Ï 0 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +.IP * +»Ò¥×¥í¥»¥¹¤Î½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Î½¸¹ç +.RB ( sigpending (2)) +¤Ï¡¢½é´ü¾õÂ֤Ǥ϶õ¤Ë¤Ê¤ë¡£ +.IP * +»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤«¤é¥»¥Þ¥Õ¥©Ä´À° +.RB ( semop (2)) +¤ò°ú¤­·Ñ¤¬¤Ê¤¤¡£ +.IP * +»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤«¤é¥ì¥³¡¼¥É¥í¥Ã¥¯ +.RB ( fcntl (2)) +¤ò°ú¤­·Ñ¤¬¤Ê¤¤¡£ +.IP * +»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤«¤é¥¿¥¤¥Þ¡¼ +.RB ( setitimer (2), +.BR alarm (2), +.BR timer_create (2)) +¤ò°ú¤­·Ñ¤¬¤Ê¤¤¡£ +.IP * +»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤«¤é¼ç¤À¤Ã¤¿ÈóƱ´ü I/O Áàºî¤ò°ú¤­·Ñ¤¬¤Ê¤¤ +.RB ( aio_read (3), +.BR aio_write (3) +»²¾È)¡£ +¤Þ¤¿¡¢¿Æ¥×¥í¥»¥¹¤«¤éÈóƱ´ü I/O ¥³¥ó¥Æ¥­¥¹¥È¤ò°ú¤­·Ñ¤¬¤Ê¤¤ +.RB ( io_setup (2) +»²¾È)¡£ +.PP +¾åµ­¤Î¥ê¥¹¥È¤Ë¤¢¤ë¥×¥í¥»¥¹Â°À­¤Ï¡¢POSIX.1-2001 ¤ÇÁ´¤Æ»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ +¿Æ¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Ï¡¢°Ê²¼¤Î Linux ¸ÇÍ­¤Î¥×¥í¥»¥¹Â°À­¤â°Û¤Ê¤ë: +.IP * 3 +»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤«¤é¥Ç¥£¥ì¥¯¥È¥êÊѹ¹ÄÌÃÎ (dnotify) +.RB ( fcntl (2) +¤Ë¤ª¤±¤ë +.B F_NOTIFY +¤ÎÀâÌÀ¤ò»²¾È) ¤ò°ú¤­·Ñ¤¬¤Ê¤¤¡£ +.IP * +.BR prctl (2) +¤Î +.B PR_SET_PDEATHSIG +¤ÎÀßÄ꤬¥ê¥»¥Ã¥È¤µ¤ì¡¢»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¤È¤­¤Ë +¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤Ê¤¤¡£ +.IP * +.BR madvise (2) +¤Î +.B MADV_DONTFORK +¥Õ¥é¥°¤Ç¥Þ¡¼¥¯¤µ¤ì¤¿¥á¥â¥ê¥Þ¥Ã¥Ô¥ó¥°¤Ï¡¢ +.BR fork () +¤Ë¤è¤Ã¤Æ°ú¤­·Ñ¤¬¤ì¤Ê¤¤¡£ +.IP * +»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥·¥°¥Ê¥ë¤Ï¾ï¤Ë +.B SIGCHLD +¤Ç¤¢¤ë +.RB ( clone (2) +¤ò»²¾È)¡£ +.PP +¤µ¤é¤Ë°Ê²¼¤ÎÅÀ¤Ë¤Ä¤¤¤ÆÃí°Õ¤¹¤ë¤³¤È: +.IP * 3 +»Ò¥×¥í¥»¥¹¤Ï¥·¥ó¥°¥ë¥¹¥ì¥Ã¥É¤ÇÀ¸À®¤µ¤ì¤ë¡£¤Ä¤Þ¤ê¡¢ +.BR fork () +¤ò¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤È¤Ê¤ë¡£ +¿Æ¥×¥í¥»¥¹¤Î²¾ÁÛ¥¢¥É¥ì¥¹¶õ´ÖÁ´ÂΤ¬»Ò¥×¥í¥»¥¹¤ËÊ£À½¤µ¤ì¤ë¡£ +¤³¤ì¤Ë¤Ï¥ß¥å¡¼¥Æ¥Ã¥¯¥¹ (mutex) ¤Î¾õÂÖ¡¦¾ò·ïÊÑ¿ô¡¦ +pthread ¥ª¥Ö¥¸¥§¥¯¥È¤¬´Þ¤Þ¤ì¤ë¡£ +¤³¤ì¤¬°ú¤­µ¯¤³¤¹ÌäÂê¤ò°·¤¦¤Ë¤Ï¡¢ +.BR pthread_atfork (3) +¤ò»È¤¦¤ÈÎɤ¤¤À¤í¤¦¡£ +.IP * +»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤¬»ý¤Ä +¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î½¸¹ç¤Î¥³¥Ô¡¼¤ò°ú¤­·Ñ¤°¡£ +»Ò¥×¥í¥»¥¹¤Î³Æ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂбþ¤¹¤ë +Ʊ¤¸¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò (file description) ¤ò»²¾È¤¹¤ë +.RB ( open (2) +¤ò»²¾È)¡£ +¤³¤ì¤Ï 2 ¤Ä¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¡¢¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¡¦ +¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¡¢¥·¥°¥Ê¥ë¶îÆ° (signal-driven) I/O °À­ +.RB ( fcntl (2) +¤Ë¤ª¤±¤ë +.BR F_SETOWN , +.B F_SETSIG +¤ÎÀâÌÀ¤ò»²¾È) ¤ò¶¦Í­¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.IP * +»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤¬»ý¤Ä¥ª¡¼¥×¥ó¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.RB ( mq_overview (7) +¤ò»²¾È) ¤Î½¸¹ç¤Î¥³¥Ô¡¼¤ò°ú¤­·Ñ¤°¡£ +»Ò¥×¥í¥»¥¹¤Î³Æ¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂбþ¤¹¤ë +Ʊ¤¸¥ª¡¼¥×¥ó¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»²¾È¤¹¤ë¡£ +¤³¤ì¤Ï 2 ¤Ä¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Æ±¤¸¥Õ¥é¥° +.RI ( mq_flags ) +¤ò¶¦Í­¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.IP * +»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Î¥ª¡¼¥×¥óºÑ¤ß¤Î¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤Î½¸¹ç +.RB ( opendir (3) +»²¾È) ¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢¿Æ¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹´Ö¤ÎÂбþ¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à +¤Ï¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ (positioning) ¤ò¶¦Í­¤·¤Æ¤â¤è¤¤¤È¤µ¤ì¤Æ¤¤¤ë¡£ +Linux/glibc ¤Ç¤Ï¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤Î°ÌÃ֤ζ¦Í­¤Ï¹Ô¤ï¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢¿Æ¥×¥í¥»¥¹¤Ë¤Ï»Ò¥×¥í¥»¥¹¤Î PID ¤¬ÊÖ¤µ¤ì¡¢ +»Ò¥×¥í¥»¥¹¤Ë¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢¿Æ¥×¥í¥»¥¹¤Ë \-1 ¤¬ÊÖ¤µ¤ì¡¢»Ò¥×¥í¥»¥¹¤ÏÀ¸À®¤µ¤ì¤º¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +¿Æ¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¡¦¥Æ¡¼¥Ö¥ë¤Î¥³¥Ô¡¼¤È +»Ò¥×¥í¥»¥¹¤Î¥¿¥¹¥¯¹½Â¤¤ËÀ¸À®¤ËɬÍפʥá¥â¥ê¤ò +.BR fork () +¤¬³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EAGAIN +¸Æ¤Ó½Ð¤·¸µ¤Î +.B RLIMIT_NPROC +»ñ¸»¤ÎÀ©¸Â (resource limit) ¤Ë㤷¤¿¤¿¤á¤Ë¡¢¿·¤·¤¤¥×¥í¥»¥¹¤òÀ¸À®¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +¤³¤ÎÀ©¸Â¤òĶ¤¨¤ë¤Ë¤Ï¡¢¥×¥í¥»¥¹¤Ï +.B CAP_SYS_ADMIN +¤Þ¤¿¤Ï +.B CAP_SYS_RESOURCE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.B ENOMEM +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¤¿¤á¤Ë¡¢ +.BR fork () +¤ÏɬÍפʥ«¡¼¥Í¥ë¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +Linux ¤Ç¤Ï¡¢ +.BR fork () +¤ò ½ñ¤­¹þ¤ß»þ¥³¥Ô¡¼ (copy-on-write)¡¦¥Ú¡¼¥¸¤òÍѤ¤¤Æ¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢fork ¤ò¹Ô¤¦¤³¤È¤ÎÍ£°ì¤Î¥Ç¥á¥ê¥Ã¥È¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¡¦¥Æ¡¼¥Ö¥ë¤òÊ£À½¤È +»Ò¥×¥í¥»¥¹¼«¿È¤Î¥¿¥¹¥¯¹½Â¤¤ÎºîÀ®¤Î¤¿¤á¤Î»þ´Ö¤È¥á¥â¥ê¤¬É¬Íפʤ³¤È¤Ç¤¢¤ë¡£ + +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) ¤¬Àµ¤·¤¤ÃͤòÊÖ¤¹¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë²¿¤é¤«¤Î½èÍý¤ò¹Ô¤¦¡£ + +.SH Îã +.BR pipe (2) +¤ª¤è¤Ó +.BR wait (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) diff --git a/release/man2/fstatat.2 b/release/man2/fstatat.2 new file mode 100644 index 00000000..90cb4379 --- /dev/null +++ b/release/man2/fstatat.2 @@ -0,0 +1,142 @@ +.\" 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" +.SH ̾Á° +fstatat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë¥Õ¥¡¥¤¥ë¤Î¾õÂÖ¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int fstatat(int " dirfd ", const char *" pathname ", struct stat *" \ +buf , +.BI " int " flags ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR fstatat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +.BR fstatat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.BR stat (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I dirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( stat (2) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î +ÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I pathname +¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä +.I dirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I pathname +¤Ï +.RB ( stat (2) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.I flags +¤Ï 0 ¤Þ¤¿¤Ï°Ê²¼¤Î¥Õ¥é¥°¤Ç¤¢¤ë¡£ +.TP +.B AT_SYMLINK_NOFOLLOW +.I pathname +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ï¡¢¤½¤ì¤òé¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +.BR lstat (2) +¤ÈƱÍͤ˥ê¥ó¥¯¼«¿È¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÊÖ¤¹ +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR fstatat () +¤Ï +.BR stat (2) +¤ÈƱÍͤ˥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òé¤ë)¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR fstatat () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR stat (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR fstatat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR fstatat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I dirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.I flags +¤ËÉÔÀµ¤Ê¥Õ¥é¥°Ãͤ¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B ENOTDIR +.I pathname +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I dirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR fstatat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2008. +Solaris ¤Ë¤Ï¡¢¤³¤ì¤ÈƱ¤¸¤è¤¦¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¡£ +.SH Ãí°Õ +.BR fstatat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR openat (2), +.BR stat (2), +.BR path_resolution (7), +.BR symlink (7), diff --git a/release/man2/fsync.2 b/release/man2/fsync.2 new file mode 100644 index 00000000..1bcad4ad --- /dev/null +++ b/release/man2/fsync.2 @@ -0,0 +1,202 @@ +.\" 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" +.SH ̾Á° +fsync \- ¥á¥â¥ê¾å¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤ÎÆâÍƤò¥¹¥È¥ì¡¼¥¸¥Ç¥Ð¥¤¥¹¾å¤Î¤â¤Î¤ÈƱ´ü¤µ¤»¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int fsync(int " fd ); +.sp +.BI "int fdatasync(int " fd ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR fsync (): +_BSD_SOURCE || _XOPEN_SOURCE +.br + || /* glibc 2.8 °Ê¹ß¤Ç¤Ï: */ _POSIX_C_SOURCE\ >=\ 200112L +.\" _POSIX_C_SOURCE\ >=\ 200112L ¤Ï glibc 2.8 °Ê¹ß¤Î¤ß +.br +.BR fdatasync (): +_POSIX_C_SOURCE\ >=\ 199309L || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.BR fsync () +¤Ï¡¢¥Õ¥¡¥¤¥ëµ­½Ò»Ò +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ÎÆâÉô¤Ç»ý¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿ +(¤Ä¤Þ¤ê¥Ð¥Ã¥Õ¥¡¥­¥ã¥Ã¥·¥å¥Ú¡¼¥¸) ¤Î¤¦¤Á½¤Àµ¤µ¤ì¤¿¥Ç¡¼¥¿¤ò¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤¬Â°¤¹¤ë¥Ç¥£¥¹¥¯¥Ç¥Ð¥¤¥¹ (¤Þ¤¿¤Ï¤½¤Î¾¤Î±Ê³¥¹¥È¥ì¡¼¥¸¥Ç¥Ð¥¤¥¹) +¤ËžÁ÷ (¡Ö¥Õ¥é¥Ã¥·¥å¡×) ¤¹¤ë¡£ +¤³¤Î¸Æ¤Ó½Ð¤·¤ÏžÁ÷¤¬½ª¤ï¤Ã¤¿¤È¥Ç¥Ð¥¤¥¹¤¬Êó¹ð¤¹¤ë¤Þ¤Ç¥Ö¥í¥Ã¥¯¤¹¤ë¡£ +¤Þ¤¿¥Õ¥¡¥¤¥ë¤Ë·ë¤Ó¤Ä¤¤¤¿¥á¥¿¥Ç¡¼¥¿¾ðÊó +.RB ( stat (2) +»²¾È) ¤â¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ + +.BR fsync () +¤Î¸Æ¤Ó½Ð¤·¤Ï¡¢¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥¨¥ó¥È¥ê¤¬¥Ç¥£¥¹¥¯¤Ø +½ñ¤­¹þ¤Þ¤ì¤¿¤³¤È¤òÊݾڤ¹¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +Êݾڤ¹¤ë¤¿¤á¤Ë¤ÏÌÀ¼¨Åª¤Ë¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤ËÂФ·¤Æ¤â +.BR fsync () +¤¹¤ëɬÍפ¬¤¢¤ë¡£ + +.BR fdatasync () +¤Ï +.BR fsync () +¤ÈƱÍͤǤ¢¤ë¤¬¡¢¥á¥¿¥Ç¡¼¥¿¤Î°·¤¤¤¬°Û¤Ê¤ë¡£ +.BR fdatasync () +¤Ï¡¢¤½¤ì°Ê¹ß¤Î¥Ç¡¼¥¿Æɤ߹þ¤ß¤òÀµ¤·¤¯°·¤¦¤¿¤á¤Ë¤½¤Î¥á¥¿¥Ç¡¼¥¿¤¬É¬Í×¤Ë +¤Ê¤é¤Ê¤¤¸Â¤ê¡¢Êѹ¹¤µ¤ì¤¿¥á¥¿¥Ç¡¼¥¿¤ò¥Õ¥é¥Ã¥·¥å¤·¤Ê¤¤¡£ +Î㤨¤Ð¡¢ +st_atime ¤ä st_mtime +(¤½¤ì¤¾¤ìºÇ½ª¥¢¥¯¥»¥¹»þ¹ï¡¢ºÇ½ª½¤Àµ»þ¹ï; +.BR stat (2) +»²¾È) ¤ÎÊѹ¹¤Ï¥Õ¥é¥Ã¥·¥å¤òɬÍפȤ·¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¤³¤ì¤é¤Ï¤½¤ì°Ê¹ß¤Î¥Ç¡¼¥¿Æɤ߹þ¤ß¤òÀµ¤·¤¯°·¤¦¤¿¤á¤Ë +ɬÍפǤϤʤ¤¤«¤é¤Ç¤¢¤ë¡£ +°ìÊý¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥º +.RB ( ftruncate (2) +¤Ç¤Ï +.IR st_size ) +¤ÎÊѹ¹¤Ï¥á¥¿¥Ç¡¼¥¿¤Î¥Õ¥é¥Ã¥·¥å¤¬É¬ÍפǤ¢¤ë¡£ +.BR fdatasync () +¤ÎÁÀ¤¤¤Ï¡¢Á´¤Æ¤Î¥á¥¿¥Ç¡¼¥¿¤ò¥Ç¥£¥¹¥¯¤ÈƱ´ü¤¹¤ëɬÍפΤʤ¤ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÂФ·¤Æ¡¢¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹¤ò¸º¤é¤¹¤³¤È¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Ç¤Ê¤¤¡£ +.TP +.B EIO +Ʊ´üÁàºî¤Î´Ö¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.BR EROFS ", " EINVAL +.I fd +¤¬Æ±´üÁàºî¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤Ê¤¤Æüì¤Ê¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.SH ½àµò +4.3BSD, POSIX.1-2001. +.SH ²ÄÍÑÀ­ +.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. +.SH Ãí°Õ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤ä¥í¥°¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢ +Èó¾ï¤Ë¾®¤µ¤Ê¥Ç¡¼¥¿¤ÎÃÇÊҤνñ¤­¹þ¤ß¤ò¹Ô¤¤¡¢¤½¤Î¸å¤¹¤°¤Ë +.BR fsync () +¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢½ñ¤­¹þ¤ó¤À¥Ç¡¼¥¿¤¬¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤ËʪÍýŪ¤Ë +³Î¼Â¤Ë³ÊǼ¤µ¤ì¤ë¤è¤¦¤Ë¤¹¤ë¤³¤È¤¬Â¿¤¤¡£ +»ÄÇ°¤Ê¤¬¤é¡¢ +.BR fsync () +¤Ï¾ï¤Ë 2¤Ä¤Î½ñ¤­¹þ¤ßÁàºî¤ò³«»Ï¤¹¤ë¡£ +°ì¤Ä¤Ï¿·¤·¤¯½ñ¤­¹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤ËÂФ¹¤ë¤â¤Î¤Ç¤¢¤ê¡¢ +¤â¤¦°ì¤Ä¤Ï inode ¤Ë³ÊǼ¤µ¤ì¤ë½¤Àµ»þ¹ï (modification time) ¤ò +¹¹¿·¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +½¤Àµ»þ¹ï¤Î¹¹¿·¤¬ÉÔ²Äʬ¤ÊÁàºî (¥È¥é¥ó¥¶¥¯¥·¥ç¥ó) ¤Î°ìÉô¤Ç¤Ï¤Ê¤¤¾ì¹ç¡¢ +.BR fdatasync () +¤ò»È¤¦¤³¤È¤Ç¡¢ÉÔɬÍ×¤Ê inode ¤Î¥Ç¥£¥¹¥¯½ñ¤­¹þ¤ßÁàºî¤òÈò¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¥Ç¡¼¥¿¤¬ÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤Î½ñ¤­¹þ¤ß¥­¥ã¥Ã¥·¥å¤¬Í­¸ú¤Ë +¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR fsync () +/ +.BR fdatasync () +¤«¤éÌá¤Ã¤Æ¤­¤¿¤È¤·¤Æ¤â¡¢¤½¤Î¥Ç¡¼¥¿¤Ï¼ÂºÝ¤Ë¤Ï±Ê³Ū¤Êµ­²±ÇÞÂÎ¤Ë +³ÊǼ¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.\" IDE ¥Ç¥£¥¹¥¯¤Î¥­¥ã¥Ã¥·¥å¤ò̵¸ú¤Ë¤¹¤ëÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï +.\" .BR hdparm (8) +.\" ¤ò»²¾È¤Î¤³¤È¡£ +.LP +ext2 ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬ +.I sync +¥ª¥×¥·¥ç¥ó¤Ä¤­¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR fsync () +¤Ç¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤â°ÅÌۤΤ¦¤Á¤ËƱ´ü¤¹¤ë¡£ +.LP +2.4 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤ÏµðÂç¤Ê¥Õ¥¡¥¤¥ë¤Ë +.BR fsync () +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¸úΨ¤¬°­¤¤¾ì¹ç¤¬¤¢¤ë¡£ +Ê̤ÎÊýË¡¤È¤·¤Æ +.BR open (2) +¤ÎºÝ¤Ë +.B O_SYNC +¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¤Î¤¬Îɤ¤¤«¤â¤·¤ì¤Ê¤¤¡£ + +Linux 2.2 °ÊÁ°¤Ç¤Ï¡¢ +.BR fdatasync () +¤Ï +.BR fsync () +¤ÈÅù²Á¤Ç¤¢¤ê¡¢À­Ç½Ì̤ǤΥá¥ê¥Ã¥È¤Ï¤Ê¤¤¡£ +.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/release/man2/futex.2 b/release/man2/futex.2 new file mode 100644 index 00000000..adb2760f --- /dev/null +++ b/release/man2/futex.2 @@ -0,0 +1,282 @@ +.\" Page by b.hubert - may be freely modified and distributed +.\" +.\" Niki A. Rahimi (LTC Security Development, narahimi@us.ibm.com) +.\" added ERRORS section. +.\" +.\" Modified 2004-06-17 mtk +.\" Modified 2004-10-07 aeb, added FUTEX_REQUEUE, FUTEX_CMP_REQUEUE +.\" +.\" FIXME +.\" 2.6.14 adds FUTEX_WAKE_OP +.\" 2.6.18 adds (Ingo Molnar) priority inheritance support: +.\" FUTEX_LOCK_PI, FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI. These need +.\" to be documented in the manual page. Probably there is sufficient +.\" material in the kernel source file Documentation/pi-futex.txt. +.\" 2.6.25 adds FUTEX_WAKE_BITSET, FUTEX_WAIT_BITSET +.\" +.\" Japanese Version Copyright(C) 2003 Suzuki Takashi +.\" all rights reserved. +.\" Translated Fri Oct 24 10:37:10 JST 2003 +.\" by Suzuki Takashi. +.\" Updated & Modified Sat Feb 5 14:28:53 JST 2005 +.\" by Yuichi SATO , LDP v2.01 +.\" Updated & Modified Wed Jan 3 04:51:22 JST 2007 by Yuichi SATO, LDP v2.43 +.\" +.\"WORD: integer int ·¿ÊÑ¿ô +.\"WORD: sleep µ¯¾²ÂÔ¤Á¤¹¤ë +.\"WORD: wake µ¯¾²¤¹¤ë +.\"WORD: wake up µ¯¾²¤¹¤ë +.\" +.TH FUTEX 2 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +futex \- ¹â®¥æ¡¼¥¶¶õ´Ö¥í¥Ã¥¯µ¡¹½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë +.SH ½ñ¼° +.nf +.sp +.B "#include " +.B "#include " +.sp +.BI "int futex(int *" uaddr ", int " op ", int " val \ +", const struct timespec *" timeout , +.br +.BI " int *" uaddr2 ", int " val3 ); +.\" int *? void *? u32 *? +.fi +.SH ÀâÌÀ +.PP +.BR futex () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +»ØÄꤷ¤¿¥¢¥É¥ì¥¹¤ÎÃͤ¬Êѹ¹¤µ¤ì¤ë¤Î¤ò¥×¥í¥°¥é¥à¤¬ÂԤļêÃʤä +ÆÃÄê¤Î¥¢¥É¥ì¥¹¤ËÂФ·¤ÆÂÔµ¡Ãæ¤Î¥×¥í¥»¥¹¤ò wake (µ¯¾²) ¤µ¤»¤ë¼êÃʤòÄ󶡤¹¤ë +(¥×¥í¥»¥¹¤¬°Û¤Ê¤ì¤ÐƱ¤¸¥á¥â¥ê¤ËÂФ¹¤ë¥¢¥É¥ì¥¹¤âƱ¤¸¤Ç¤Ï¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¤¬¡¢ +¥«¡¼¥Í¥ë¤Ï°Û¤Ê¤ë°ÌÃ֤˥ޥåפµ¤ì¤¿Æ±¤¸¥á¥â¥ê¤ò +.BR futex () +¤Ç»È¤¨¤ë¤è¤¦ÆâÉô¤Ç¥Þ¥Ã¥×¤¹¤ë)¡£ +ŵ·¿Åª¤Ë¤Ï¡¢futex ¤Ï +.BR futex (7) +¤Ëµ­¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¡¢ +¶¦Í­¥á¥â¥êÃæ¤Î¥í¥Ã¥¯¤¬¶¥¹ç¤¹¤ë¾ì¹ç¤Î½èÍý¤ò¼ÂÁõ¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +.BR futex (7) +¤ÎÁàºî¤¬¥æ¡¼¥¶¶õ´Ö¤Ç¶¥¹ç¤Ê¤¯´°Î»¤·¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +¥«¡¼¥Í¥ë¤ËÃçºÛ¤µ¤»¤ë¤¿¤á¤Ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤ÖɬÍפ¬¤¢¤ë¡£ +ÃçºÛ¤È¤¤¤¦¤Î¤Ï¡¢¸Æ¤Ó½Ð¤·¥×¥í¥»¥¹¤ò sleep (µ¯¾²ÂÔ¤Á) ¤µ¤»¤¿¤ê¡¢È¿ÂÐ¤Ë +ÂÔ¤Á¥×¥í¥»¥¹¤ò wake ¤µ¤»¤¿¤ê¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¥×¥í¥»¥¹¤Ï +.BR futex (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤ËÃé¼Â¤Ç¤¢¤ë¤³¤È¤¬Í׵ᤵ¤ì¤ë¡£ +¤³¤Î¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤Ë¤Ï°Ü¿¢ÉÔ²Äǽ¤Ê¥¢¥»¥ó¥Ö¥êÌ¿Îá¤ò½ñ¤¯¤³¤È¤¬´Þ¤Þ¤ì¤ë¡£ +¤³¤Î¤³¤È¤Ï¸À¤¤´¹¤¨¤ë¤È futex ¤Î¥æ¡¼¥¶¤Î¤Û¤È¤ó¤É¤Ï¼ÂºÝ¤Ï¥é¥¤¥Ö¥é¥ê¤Îºî¼Ô¤Ç¤¢¤ê¡¢ +°ìÈÌ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î³«È¯¼Ô¤Ç¤Ï¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.PP +.I uaddr +°ú¤­¿ô¤Ï¡¢¥«¥¦¥ó¥¿¤ò³ÊǼ¤¹¤ë¡¢ +¥¢¥é¥¤¥ó¥á¥ó¥È¤Î·¤Ã¤¿ int ·¿ÊÑ¿ô¤ò»Ø¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +¼Â¹Ô¤¹¤ëÁàºî¤Ï +.I op +°ú¤­¿ô¤ò²ð¤·¤Æ¡¢ÃÍ +.I val +¤È¤È¤â¤ËÅϤµ¤ì¤ë¡£ +.PP +¸½ºß¤Î¤È¤³¤í 5 ¤Ä¤ÎÁàºî¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.TP +.B FUTEX_WAIT +¤³¤ÎÁàºî¤Ï futex ¥¢¥É¥ì¥¹ +.I uaddr +¤Ë»ØÄꤵ¤ì¤¿ÃÍ +.I val +¤¬¤Þ¤À³ÊǼ¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤òÉÔ²ÄʬÁàºî¤Ç¸¡¾Ú¤·¡¢ +sleep ¾õÂÖ¤Ç +¤³¤Î futex ¥¢¥É¥ì¥¹¤ËÂФ·¤Æ +.B FUTEX_WAKE +¤¬¼Â¹Ô¤µ¤ì¤ë¤Î¤òÂԤġ£ +.I timeout +°ú¤­¿ô¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢¤½¤ÎÆâÍÆ¤Ï +ÂÔ¤Á»þ´Ö¤ÎºÇÂçÃͤòɽ¤¹¡£NULL ¤Î¾ì¹ç¤Ï̵¸ÂÂç¤òɽ¤¹¡£ +°ú¤­¿ô +.I uaddr2 +¤È +.I val3 +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.BR futex (7) +¤Ë¾È¤é¤·¹ç¤ï¤»¤ë¤È¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤Ï +¥«¥¦¥ó¥È¤Î¥Ç¥¯¥ê¥á¥ó¥È¤ÇÉé¤ÎÃÍ (¶¥¹ç¤òɽ¤¹) ¤Ë¤Ê¤Ã¤¿¾ì¹ç¤Ë¼Â¹Ô¤µ¤ì¡¢ +ÊÌ¤Î¥×¥í¥»¥¹¤¬¤½¤Î futex ¤ò²òÊü¤· +.B FUTEX_WAKE +¤ÎÁàºî¤ò¼Â¹Ô¤¹¤ë¤Þ¤Ç sleep ¤¹¤ë¡£ +.TP +.B FUTEX_WAKE +¤³¤ÎÁàºî¤Ç¤Ï»ØÄꤷ¤¿ futex ¥¢¥É¥ì¥¹¤ËÂФ·¤ÆÂÔ¤Á¾õÂ֤Π+(¤¹¤Ê¤ï¤Á +.B FUTEX_WAIT +Ãæ¤Î) ºÇÂç \fIval\fP ¸Ä¤Î¥×¥í¥»¥¹¤ò wake ¤µ¤»¤ë¡£ +°ú¤­¿ô +.IR timeout , +.IR uaddr2 , +.I val3 +¤Ï̵»ë¤µ¤ì¤ë¡£ + +\fBfutex\fR(4) ¤Ë¾È¤é¤·¹ç¤ï¤»¤ë¤È¡¢ +¤³¤ÎÁàºî¤Ï +¥«¥¦¥ó¥È¤Î¥¤¥ó¥¯¥ê¥á¥ó¥È¤ÇÂÔ¤Á¥×¥í¥»¥¹¤¬¤¢¤ë¤ÈȽÌÀ¤·¡¢ +futex Ãͤ¬ 1 ¤ËÀßÄꤵ¤ì¤¿ (ÍøÍѲÄǽ¤Ç¤¢¤ë¤³¤È¤òɽ¤¹) ¾ì¹ç¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ +.TP +.BR FUTEX_FD " (Linux 2.6.25 °ÊÁ°)" +ÈóƱ´ü¤Î wake ¤ËÂбþ¤¹¤ë¤¿¤á¡¢¤³¤ÎÁàºî¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò futex ¤Ë +´ØÏ¢¤Å¤±¤ë¡£ +.\" .BR poll (2) +.\" ¤ËŬ¤·¤Æ¤¤¤ë¡£ +ÊÌ¤Î¥×¥í¥»¥¹¤¬ +.B FUTEX_WAKE +¤ò¼Â¹Ô¤¹¤ë¤È¡¢¥×¥í¥»¥¹¤Ï +.I val +¤ÇÅϤµ¤ì¤¿¥·¥°¥Ê¥ëÈÖ¹æ¤Î¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¡£ +¸Æ¤Ó½Ð¤·¥×¥í¥»¥¹¤Ï»ÈÍѸ塢ÊÖ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +¥¯¥í¡¼¥º¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +°ú¤­¿ô +.IR timeout , +.IR uaddr2 , +.I val3 +¤Ï̵»ë¤µ¤ì¤ë¡£ + +¶¥¹ç¾õÂÖ¤òËɻߤ¹¤ë¤¿¤á¡¢¸Æ¤Ó½Ð¤·¥×¥í¥»¥¹¤Ï +.B FUTEX_FD +¤¬Ê֤俤¢¤È +futex ¤¬ up ¤µ¤ì¤¿¤«¤É¤¦¤«¤ò³Îǧ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\" FIXME . Check that this flag does eventually get removed. +.B FUTEX_FD +¤Ï¤â¤È¤â¤È¶¥¹ç¤¬µ¯¤­¤ä¤¹¤«¤Ã¤¿¤¿¤á¡¢ +Linux 2.6.26 °Ê¹ß¤Çºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.BR FUTEX_REQUEUE " (Linux 2.5.70 °Ê¹ß)" +¤³¤ÎÁàºî¤Ï¡¢ +.B FUTEX_WAKE +¤¬»È¤ï¤ì¤Æ¤¤¤Æ¡¢¤«¤Ä wake ¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥×¥í¥»¥¹¤¬ +¾¤Î futex ¤ò¼èÆÀ¤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ë¡¢ +¡Ö½Ã¤Î·²¤ì¤Î˽Áö (thundering herd)¡×¸ú²Ì¤òÈò¤±¤ë¤¿¤á¤ËƳÆþ¤µ¤ì¤¿¡£ +¤³¤Î¸Æ¤Ó½Ð¤·¤Ï +.I val +¸Ä¤Î¥×¥í¥»¥¹¤ò wake ¤·¡¢¥¢¥É¥ì¥¹ +.I uaddr2 +¤Ç futex ¤òÂԤäƤ¤¤ë¾¤ÎÁ´¤Æ¤Î¥×¥í¥»¥¹¤òºÆÅÙ¥­¥å¡¼¤Ë¤¤¤ì¤ë¡£ +°ú¤­¿ô +.I timeout +¤È +.I val3 +¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.BR FUTEX_CMP_REQUEUE " (Linux 2.6.7 °Ê¹ß)" +¸Î°Õ¤Ë +.B FUTEX_REQUEUE +¤ò»È¤¦¾ì¹ç¤Ë¶¥¹ç¤¬µ¯¤³¤ë¤¿¤á¡¢ +.B FUTEX_CMP_REQUEUE +¤¬Æ³Æþ¤µ¤ì¤¿¡£¤³¤ì¤Ï +.B FUTEX_REQUEUE +¤È»÷¤Æ¤¤¤ë¤¬¡¢¾ì½ê +.I uaddr +¤ËÃÍ +.I val3 +¤¬¤Þ¤ÀÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¤«¤òºÇ½é¤Ë¥Á¥§¥Ã¥¯¤¹¤ë¡£ +ÊÝ»ý¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢Áàºî¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¡£°ú¤­¿ô +.I timeout +¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.PP +¤É¤ÎÁàºî¤¬¼Â¹Ô¤µ¤ì¤¿¤«¤Ë¤è¤Ã¤Æ¡¢ +À®¸ù»þ¤ÎÊÖ¤êÃͤΰÕÌ£¤¬ÊѤï¤ë¡£ +.TP +.B FUTEX_WAIT +¥×¥í¥»¥¹¤¬ +.B FUTEX_WAKE +¤Î¸Æ¤Ó½Ð¤·¤Ç wake ¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¥¿¥¤¥à¥¢¥¦¥È¤Î¾ì¹ç¡¢Áàºî¤Ï¥¨¥é¡¼ +.B ETIMEOUT +¤Ç¼ºÇÔ¤¹¤ë¡£ +futex ¤¬»ØÄꤵ¤ì¤¿ÃͤÈÅù¤·¤¯¤Ê¤¤¾ì¹ç¡¢ +¥¨¥é¡¼ +.B EWOULDBLOCK +¤Ç¼ºÇÔ¤¹¤ë¡£ +¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¤« +.RB ( signal (7) +»²¾È) ¾¤Îµ¶¤Î wake ¤¬¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.B FUTEX_WAKE +wake ¤·¤¿¥×¥í¥»¥¹¤Î¿ô¤òÊÖ¤¹¡£ +.TP +.B FUTEX_FD +futex ¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¿·¤¿¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.TP +.B FUTEX_REQUEUE +wake ¤·¤¿¥×¥í¥»¥¹¤Î¿ô¤òÊÖ¤¹¡£ +.TP +.B FUTEX_CMP_REQUEUE +wake ¤·¤¿¥×¥í¥»¥¹¤Î¿ô¤òÊÖ¤¹¡£ +.PP +¥¨¥é¡¼¤Î¾ì¹ç¡¢Á´¤Æ¤ÎÁàºî¤Ç \-1 ¤¬Ê֤ꡢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤò¼¨¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +futex ¥á¥â¥ê¤ËÆɤ߹þ¤ß¥¢¥¯¥»¥¹¸¢¤¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B EAGAIN +.B FUTEX_CMP_REQUEUE +¤Çͽ´ü¤·¤Ê¤¤ futex Ãͤ¬¸«¤Ä¤«¤Ã¤¿ +(¤³¤ì¤Ï¶¥¹ç¤ò¼¨¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î¾ì¹ç¤Ï°ÂÁ´¤Ê +.B FUTEX_WAKE +¤ò»È¤¦¤³¤È)¡£ +.TP +.B EFAULT +¥æ¡¼¥¶¶õ´Ö¤«¤é +.I timeout +¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ëºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EINVAL +Áàºî¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£¤Þ¤¿¤Ï¥Ú¡¼¥¸¡¦¥¢¥é¥¤¥ó¥á¥ó¥È¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥à¤ÎÀ©¸Â¤Ë㤷¤¿¡£ +.TP +.B ENOSYS +.I op +¤Ë̵¸ú¤ÊÁàºî¤¬»ØÄꤵ¤ì¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.PP +ºÇ½é¤Î futex Âбþ¤Ï Linux 2.5.7 ¤ÇÁȤ߹þ¤Þ¤ì¤¿¤¬¡¢ +¾åµ­¤Î¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤È¤Ï°Û¤Ê¤ë¡£ +¤³¤³¤Ç¼¨¤µ¤ì¤Æ¤¤¤ë¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤ò»ý¤Ä +4 ¤Ä¤Î°ú¤­¿ô¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢Linux 2.5.40 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +Linux 2.5.70 ¤Ç¤Ï 1 ¤Ä¤Î°ú¤­¿ô¤¬Äɲ䵤줿¡£ +Linux 2.6.7 ¤Ç¤Ï 6 ÈÖÌܤΰú¤­¿ô¤¬Äɲ䵤줿¡£ +¤³¤ì¤Ï±ø¤¯¡¢s390 ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¾å¤ÎÆÃÊ̤Τâ¤Î¤Ç¤¢¤ë¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.PP +·«¤êÊÖ¤¹¤¬¡¢Íç¤Î futex ¤Ï¥¨¥ó¥É¥æ¡¼¥¶¤¬Íưפ˻Ȥ¦¤³¤È¤Î¤Ç¤­¤ë³µÇ°¤È¤·¤Æ +°Õ¿Þ¤µ¤ì¤¿¤â¤Î¤Ç¤Ï¤Ê¤¤ +(glibc ¤Ë¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¤Ê¤¤)¡£ +¼ÂÁõ¼Ô¤Ï¡¢¥¢¥»¥ó¥Ö¥ê¸À¸ì¤Ë´·¤ì¤Æ¤ª¤ê¡¢°Ê²¼¤Ëµó¤²¤ë futex ¥æ¡¼¥¶¶õ´Ö¥é¥¤¥Ö¥é¥ê¤Î +¥½¡¼¥¹¤òÆɤ߽ª¤¨¤Æ¤¤¤ë¤³¤È¤¬Í׵ᤵ¤ì¤ë¡£ +.\" .SH Ãø¼Ô +.\" .PP +.\" futex ¤Ï Hubertus Franke (IBM Thomas J. Watson Research Center), +.\" Matthew Kirkwood, Ingo Molnar (Red Hat), +.\" Rusty Russell (IBM Linux Technology Center) ¤¬À߷פ·¡¢ºîÀ®¤·¤¿¡£ +.\" ¤³¤Î¥Ú¡¼¥¸¤Ï bert hubert ¤¬µ­¤·¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR futex (7) +.PP +\fIFuss, Futexes and Furwocks: Fast Userlevel Locking in Linux\fP +(proceedings of the Ottawa Linux Symposium 2002), +futex ¤Î»ÈÍÑÎã¥é¥¤¥Ö¥é¥ê, futex-*.tar.bz2 +. diff --git a/release/man2/futimesat.2 b/release/man2/futimesat.2 new file mode 100644 index 00000000..594a2f60 --- /dev/null +++ b/release/man2/futimesat.2 @@ -0,0 +1,137 @@ +.\" 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-09-30 by Yuichi SATO , LDP v2.39 +.\" +.TH FUTIMESAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +futimesat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë¥Õ¥¡¥¤¥ë¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.sp +.BI "int futimesat(int " dirfd ", const char *" pathname , +.BI " const struct timeval " times [2]); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR futimesat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£ +Âå¤ï¤ê¤Ë +.BR utimensat (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ + +.BR futimesat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.BR utimes (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹Ì¾¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I dirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( utimes (2) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I pathname +¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä +.I dirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I pathname +¤Ï +.RB ( utimes (2) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR futimesat () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR utimes (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR futimesat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR futimesat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I dirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I pathname +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I dirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR futimesat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ïɸ½àŪ¤Ç¤Ï¤Ê¤¤¡£ +POSIX.1 ¤ÇÄó°Æ¤µ¤ì¤Æ¤¤¤¿»ÅÍͤËͳÍ褷¤Æ¼ÂÁõ¤µ¤ì¤¿¤¬¡¢ +¤½¤Î»ÅÍÍ¤Ï +.BR utimensat (2) +¤ÇÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ + +Solaris ¤Ë¤Ï¡¢¤³¤ì¤ÈƱ¤¸¤è¤¦¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¡£ +.SH Ãí°Õ +.SS GLIBC ¤Ë¤Ä¤¤¤Æ¤ÎÃí°Õ +.I pathname +¤¬ NULL ¤Î¾ì¹ç¡¢glibc ¤Î +.BR futimesat () +¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï +.I dirfd +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î»þ¹ï¤ò¹¹¿·¤¹¤ë¡£ +.\" The Solaris futimesat() also has this strangeness. +.SH ´ØÏ¢¹àÌÜ +.BR stat (2), +.BR utimensat (2), +.BR utimes (2), +.BR futimes (3), +.BR path_resolution (7) diff --git a/release/man2/get_kernel_syms.2 b/release/man2/get_kernel_syms.2 new file mode 100644 index 00000000..10eb8cd5 --- /dev/null +++ b/release/man2/get_kernel_syms.2 @@ -0,0 +1,84 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-31, Akihiro MOTOKI +.\" +.TH GET_KERNEL_SYMS 2 2007-06-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +get_kernel_syms \- ¸ø³«¤µ¤ì¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤ä¥â¥¸¥å¡¼¥ë¤Î¥·¥ó¥Ü¥ë¤Î¼èÆÀ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int get_kernel_syms(struct kernel_sym *" table ); +.fi +.SH ÀâÌÀ +.BR get_kernel_syms () +¤Ï¡¢ +.I table +¤¬ NULL ¤Î¾ì¹ç¡¢ +Ì䤤¹ç¤ï¤»¤Ç¤­¤ë¥·¥ó¥Ü¥ë¤Î¿ô¤òÊÖ¤¹¡£ +NULL °Ê³°¤Î¾ì¹ç¡¢°Ê²¼¤Î¹½Â¤ÂΤÎÎó (table) ¤ËÃͤòÆþ¤ì¤ÆÊÖ¤¹¡£ +.PP +.in +4n +.nf +struct kernel_sym { + unsigned long value; + char name[60]; +}; +.fi +.in +.PP +¥·¥ó¥Ü¥ë¤ÎÃæ¤Ë¤Ï¡¢ +.BI # module-name +¤È¤¤¤¦·Á¼°¤Î¡¢¥«¡¼¥Í¥ë¤¬¶õ¤Î̾Á°¤ò»ý¤Ã¤Æ¤¤¤ë¥Þ¥¸¥Ã¥¯¥·¥ó¥Ü¥ë +(magic symbol) ¤¬»¶ºß¤·¤Æ¤¤¤ë¡£¤³¤Î·Á¼°¤Î¥·¥ó¥Ü¥ë¤ËÂбþ¤¹¤ëÃÍ¤Ï +¥â¥¸¥å¡¼¥ë¤¬¥í¡¼¥É¤µ¤ì¤¿¥¢¥É¥ì¥¹¤È¤Ê¤ë¡£ +.PP +¸Ä¡¹¤Î¥â¥¸¥å¡¼¥ë¤«¤é¸ø³« (export) ¤µ¤ì¤¿¥·¥ó¥Ü¥ë¤Ï¡¢¥Þ¥¸¥Ã¥¯¥â¥¸¥å¡¼¥ë¥¿¥° +¤Î¸å¤í¤ËÃÖ¤«¤ì¤ë¡£¤Þ¤¿¡¢¥â¥¸¥å¡¼¥ë¤Ï¥í¡¼¥É¤µ¤ì¤¿½çÈ֤Ȥϵսç¤ÇÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.I table +¤Ë¥³¥Ô¡¼¤µ¤ì¤¿¥·¥ó¥Ü¥ë¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +ÊÖ¤ë²ÄǽÀ­¤¬¤¢¤ë¥¨¥é¡¼¤Ï°ì¤Ä¤À¤±¤Ç¤¢¤ë¡£ +.TP +.B ENOSYS +.BR get_kernel_syms () +¤¬¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¤Î¤Ï¥«¡¼¥Í¥ë 2.4 ¤Þ¤Ç¤Î Linux ¤À¤±¤Ç¤¢¤ë¡£ +Linux 2.6 ¤Ç¤Ïºï½ü¤µ¤ì¤¿¡£ +.\" Removed in Linux 2.5.48 +.SH ½àµò +.BR get_kernel_syms () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +.I table +ÍѤ˳ÎÊݤ·¤¿¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤òÅÁ¤¨¤ëÊýË¡¤¬¤Ê¤¤¡£ +¥×¥í¥°¥é¥à¤¬¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤ÎÂ礭¤µ¤òÌ䤤¹ç¤ï¤»¤¿¸å¤Ë¡¢¥«¡¼¥Í¥ë¤Ë +¥·¥ó¥Ü¥ë¤¬Äɲ䵤ì¤ë¤È¡¢¥á¥â¥ê¤ÎÆâÍƤ¬Ç˲õ¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.PP +¸ø³«¤µ¤ì¤ë¥·¥ó¥Ü¥ë̾¤ÎŤµ¤¬ 59 ʸ»ú¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +¤³¤ì¤é¤ÎÀ©¸Â¤¬¤¢¤ë¤Î¤Ç¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤è¤ê¤Ï +.BR query_module (2) +¤ò»È¤¦¤Î¤¬Ë¾¤Þ¤·¤¤ +(¸½ºß¤Ç¤Ï +.BR query_module (2) +¼«¿È¤â¤½¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¤è¤¦¤Ë +¾¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò»È¤¦¤Î¤¬Ë¾¤Þ¤·¤¤¤È¤µ¤ì¤Æ¤¤¤ë)¡£ +.SH ´ØÏ¢¹àÌÜ +.BR create_module (2), +.BR delete_module (2), +.BR init_module (2), +.BR query_module (2) diff --git a/release/man2/get_mempolicy.2 b/release/man2/get_mempolicy.2 new file mode 100644 index 00000000..644f7d67 --- /dev/null +++ b/release/man2/get_mempolicy.2 @@ -0,0 +1,258 @@ +.\" Copyright 2003,2004 Andi Kleen, SuSE Labs. +.\" and Copyright 2007 Lee Schermerhorn, Hewlett Packard +.\" +.\" 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. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\" 2006-02-03, mtk, substantial wording changes and other improvements +.\" 2007-08-27, Lee Schermerhorn +.\" more precise specification of behavior. +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2006-08-14, Akihiro MOTOKI , LDP v2.39 +.\" Updated 2008-02-13, Akihiro MOTOKI, LDP v2.77 +.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-08-21, Akihiro MOTOKI, LDP v3.07 +.\" Updated 2008-11-19, Akihiro MOTOKI, LDP v3.13 +.\" +.TH GET_MEMPOLICY 2 2008-08-15 Linux "Linux Programmer's Manual" +.SH ̾Á° +get_mempolicy \- ¥×¥í¥»¥¹¤Î NUMA ¥á¥â¥ê¤Î¥Ý¥ê¥·¡¼¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int get_mempolicy(int *" mode ", unsigned long *" nodemask , +.BI " unsigned long " maxnode ", unsigned long " addr , +.BI " unsigned long " flags ); +.sp +\fI\-lnuma\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.SH ÀâÌÀ +.BR get_mempolicy () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤â¤·¤¯¤Ï»ØÄꤵ¤ì¤¿¥á¥â¥ê¥¢¥É¥ì¥¹¤Î +NUMA ¥Ý¥ê¥·¡¼¤ò +.I flags +¤ÎÀßÄê¤Ë½¾¤Ã¤Æ¼èÆÀ¤¹¤ë¡£ + +NUMA (ÈóÂоΥá¥â¥ê¥¢¥¯¥»¥¹) ¥Þ¥·¥ó¤Ç¤Ï¡¢CPU ¤Ë¤è¤ê +¥á¥â¥ê¥³¥ó¥È¥í¡¼¥é¤¬°Û¤Ê¤ê¡¢µ÷Î¥¤â°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï¡¢¤É¤Î¥Î¡¼¥É¤«¤é¥á¥â¥ê¤ò¤½¤Î¥×¥í¥»¥¹¤Ë +³ä¤êÅö¤Æ¤ë¤«¤òÄê¤á¤ë¤â¤Î¤Ç¤¢¤ë¡£ + +.I flags +¤Ë 0 ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.RB ( set_mempolicy (2) +¤ÇÀßÄꤵ¤ì¤¿) +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÖ¤¹¡£ +ÊÖ¤µ¤ì¤¿¥Ý¥ê¥·¡¼ +.RI [ mode +¤È +.IR nodemask ] +¤ò +.BR set_mempolicy (2) +¤ËÅϤ¹¤³¤È¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥Ý¥ê¥·¡¼¤ò +.BR get_mempolicy () +¤ò¸Æ¤Ó½Ð¤·¤¿»þÅÀ¤Î¾õÂÖ¤ËÌ᤹¤³¤È¤¬¤Ç¤­¤ë¡£ + +.I flags +¤Ë +.B MPOL_F_MEMS_ALLOWED +(Linux 2.6.24 °Ê¹ß¤ÇÍøÍѲÄǽ) ¤ò»ØÄꤹ¤ë¤È¡¢ +.I mode +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¡¢ +¤½¤Î¥×¥í¥»¥¹¤¬¤½¤Î¸å¤Î +.BR mbind (2) +¤ä +.BR set_mempolicy (2) +¤Ç +.RI [ "¥â¡¼¥É¥Õ¥é¥°" +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë ] »ØÄê¤Ç¤­¤ë¥Î¡¼¥É (¥á¥â¥ê) ¤Î½¸¹ç¤¬ +.I nodemask +¤ËÊÖ¤µ¤ì¤ë¡£ +.B MPOL_F_MEMS_ALLOWED +¤ò¡¢ +.B MPOL_F_ADDR +¤ä +.B MPOL_F_NODE +¤ÈƱ»þ¤Ë»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ + +.I flags +¤Ë +.B MPOL_F_ADDR +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.I addr +¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥ê¥¢¥É¥ì¥¹¤ËŬÍѤµ¤ì¤Æ¤¤¤ë¥Ý¥ê¥·¡¼¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÖ¤¹¡£ +.BR mbind (2) +¤ä +.BR numa (3) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥Ø¥ë¥Ñ¡¼´Ø¿ô¤ò»È¤Ã¤Æ¡¢ +.I addr +¤ò´Þ¤à¥á¥â¥êÎΰè¤ËÂФ¹¤ë¥Ý¥ê¥·¡¼¤¬ÀßÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¡¢ +ÊÖ¤µ¤ì¤ë¥Ý¥ê¥·¡¼¤Ï¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤È°ã¤¦¤³¤È¤¬¤¢¤ë¡£ + +.I mode +°ú¤­¿ô¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.BR get_mempolicy () +¤ÏÍ׵ᤵ¤ì¤¿ NUMA ¥Ý¥ê¥·¡¼¤Î¥â¡¼¥É¤ÈÄɲäΠ+.I "¥â¡¼¥É¥Õ¥é¥°" +¤ò +.I mode +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤¹¤ë¡£ +.I nodemask +¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢¤½¤Î¥Ý¥ê¥·¡¼¤ËÂбþ¤¹¤ë¥Î¡¼¥É¥Þ¥¹¥¯¤ò +¤³¤Î°ú¤­¿ô¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤¹¤ë¡£ +.I maxnode +¤Ë¤Ï +.I nodemask +¤Ë³ÊǼ¤Ç¤­¤ë¥Î¡¼¥É ID ¤Î¿ô¡¢¤Ä¤Þ¤êºÇÂç¥Î¡¼¥É ID ¤Ë 1 ¤ò­¤·¤¿Ãͤò»ØÄꤹ¤ë¡£ +.I maxnode +¤Ç»ØÄꤵ¤ì¤¿ÃͤϾï¤Ë +.I sizeof(unsigned long) +¤ÎÇÜ¿ô¤ËÀÚ¤ê¾å¤²¤é¤ì¤ë¡£ + +.I flags +¤Ç +.B MPOL_F_NODE +¤È +.B MPOL_F_ADDR +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.BR get_mempolicy () +¤Ï¥¢¥É¥ì¥¹ +.I addr +¤¬³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤Î¥Î¡¼¥É ID ¤ò +.I mode +¤¬»Ø¤¹¾ì½ê¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤Ë¤É¤Î¥Ú¡¼¥¸¤â¤Þ¤À³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.BR get_mempolicy () +¤Ï¡¢¤¢¤¿¤«¤â¤½¤Î¥×¥í¥»¥¹¤¬¤½¤Î¥¢¥É¥ì¥¹¤ËÂФ·¤ÆÆɤ߹þ¤ß¥¢¥¯¥»¥¹¤ò +¼Â¹Ô¤·¤¿¤«¤Î¤è¤¦¤Ë¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤ò¹Ô¤¤¡¢¥Ú¡¼¥¸¤¬³ä¤êÅö¤Æ¤é¤ì¤¿ +¥Î¡¼¥É¤Î ID ¤òÊÖ¤¹¡£ + +.I flags +¤Ç +.B MPOL_F_NODE +¤Ï»ØÄꤵ¤ì¤¿¤¬¡¢ +.B MPOL_F_ADDR +¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¡¢¤«¤Ä +¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î¥Ý¥ê¥·¡¼¤¬ +.B MPOL_INTERLEAVE +¤Î¾ì¹ç¡¢ +.BR get_mempolicy () +¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ³ä¤êÅö¤Æ¤é¤ì¤¿¥«¡¼¥Í¥ë¤ÎÆâÉô¥Ú¡¼¥¸¤Ç +¼¡¤Ë¥¤¥ó¥¿¡¼¥ê¡¼¥ÖÍѤ˻ÈÍѤµ¤ì¤ë¥Î¡¼¥É¤Î¥Î¡¼¥É ID ¤ò¡¢ +NULL ¤Ç¤Ê¤¤ +.I mode +°ú¤­¿ô¤¬»Ø¤¹¾ì½ê¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +.\" Note: code returns next interleave node via 'mode' argument -Lee Schermerhorn +Æɤ߹þ¤ß¥¢¥¯¥»¥¹ÍѤȤ·¤Æ +.B MAP_PRIVATE +¥Õ¥é¥°ÉÕ¤­¤Ç +.BR mmap (2) +¤·¤¿¥×¥í¥»¥¹¥á¥â¥êÎΰè¤ä¡¢ +Ǥ°Õ¤Î¥¢¥¯¥»¥¹ÍѤȤ·¤Æ +.B MAP_SHARED +¥Õ¥é¥°ÉÕ¤­¤Ç +.BR mmap (2) +¤·¤¿¥á¥â¥êÎΰè¤Î¡¢¥á¥â¥ê¥Þ¥Ã¥×¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥Ú¡¼¥¸¤â +¾åµ­¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ³ä¤êÅö¤Æ¤é¤ì¤¿¥Ú¡¼¥¸¤Ë´Þ¤Þ¤ì¤ë¡£ + +¾¤Î¥Õ¥é¥°¤ÏͽÌ󤵤ì¤Æ¤¤¤ë¡£ + +ÀßÄê²Äǽ¤Ê¥Ý¥ê¥·¡¼¤Î³µÍפˤĤ¤¤Æ¤Ï +.BR set_mempolicy (2) +¤ò»²¾È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR get_mempolicy () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"motoki: Part of all of the memory ¤Ï Part or all .. ¤Î´Ö°ã¤¤¡© +.I nodemask +¤È +.I maxnode +¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥êÎΰè¤Î°ìÉô¤Þ¤¿¤ÏÁ´Éô¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I maxnode +¤Ç»ØÄꤵ¤ì¤¿Ãͤ¬¥·¥¹¥Æ¥à¤¬¥µ¥Ý¡¼¥È¤¹¤ë¥Î¡¼¥É ID ¤Î¿ô¤è¤ê¤â¾¯¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I flags +¤Ë +.B MPOL_F_NODE +¤Ç¤â +.B MPOL_F_ADDR +¤Ç¤â¤Ê¤¤Ãͤ¬»ØÄꤵ¤ì¤¿¡£ +¤Þ¤¿¤Ï¡¢ +.I flags +¤Ë +.B MPOL_F_ADDR +¤¬»ØÄꤵ¤ì¤Æ¤ª¤ê¡¢ +.I addr +¤¬ NULL ¤Ç¤¢¤ë¡£ +¤Þ¤¿¤Ï¡¢ +.I flags +¤Ë +.B MPOL_F_ADDR +¤¬¤µ¤ì¤Æ¤ª¤é¤º¡¢ +.I addr +¤¬ NULL ¤Ç¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I flags +¤Ë +.B MPOL_F_NODE +¤¬»ØÄꤵ¤ì¤Æ¤ª¤ê¡¢ +.B MPOL_F_ADDR +¤¬»ØÄꤵ¤ì¤Æ¤ª¤é¤º¡¢ +¥×¥í¥»¥¹¤Î¸½ºß¤Î¥Ý¥ê¥·¡¼¤¬ +.B MPOL_INTERLEAVE +¤Ç¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I flags +¤Ë +.B MPOL_F_MEMS_ALLOWED +¤¬»ØÄꤵ¤ì¤Æ¤ª¤ê¡¢¤µ¤é¤Ë +.B MPOL_F_ADDR +¤« +.B MPOL_F_NODE +¤Î¤¤¤º¤ì¤«¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ +(¾¤Ë¤â +.B EINVAL +¤È¤Ê¤ë¾ì¹ç¤¬¤¢¤ë¡£) +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR get_mempolicy () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ð¡¼¥¸¥ç¥ó 2.6.7 ¤Ç Linux ¥«¡¼¥Í¥ë¤ËÄɲ䵤줿¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¥é¥¤¥Ö¥é¥ê¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR numa (7) +¤ò»²¾È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getcpu (2), +.BR mbind (2), +.BR mmap (2), +.BR set_mempolicy (2), +.BR numa (3), +.BR numa (7), +.BR numactl (8) diff --git a/release/man2/get_thread_area.2 b/release/man2/get_thread_area.2 new file mode 100644 index 00000000..9155f396 --- /dev/null +++ b/release/man2/get_thread_area.2 @@ -0,0 +1,61 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" 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 +.\" +.\"WORD: Thread Local Storage ¥¹¥ì¥Ã¥É¶É½êµ­²± +.\" +.TH GET_THREAD_AREA 2 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +get_thread_area \- ¥¹¥ì¥Ã¥É¶É½êµ­²± (TLS) Îΰè¤ò¼è¤ê½Ð¤¹ +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int get_thread_area(struct user_desc *" u_info ); +.SH ÀâÌÀ +.BR get_thread_area () +¤Ï¡¢¥«¥ì¥ó¥È¡¦¥¹¥ì¥Ã¥É¤Î¥¹¥ì¥Ã¥É¶É½êµ­²± +(Thread Local Storage; TLS) ÇÛÎó¤ÎÃæ¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +¥¨¥ó¥È¥ê¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¡¢¥æ¡¼¥¶¤«¤é°ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¤ë +\fIu_info\->entry_number\fP ¤ÎÃͤËÂбþ¤·¤Æ¤¤¤ë¡£ +Ãͤ¬ÈÏ°ÏÆâ¤Ë¤¢¤ë¾ì¹ç¡¢ +.BR get_thread_info () +¤ÏÂбþ¤¹¤ë TLS ¥¨¥ó¥È¥ê¤ò +\fIu_info\fP ¤Ç»Ø¤µ¤ì¤¿Îΰè¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR get_thread_area () +¤Ï 0 ¤òÊÖ¤¹¡£ +¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢ \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +\fIu_info\fP ¤¬ÉÔÀµ¤Ê¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +\fIu_info\->entry_number\fP ¤¬Èϰϳ°¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR get_thread_area () +¤Ï Linux 2.5.32 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +.BR get_thread_area () +¤Ï Linux Æȼ«¤Î´Ø¿ô¤Ç¤¢¤ê¡¢ +°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¸Æ¤Ó½Ð¤¹¤Ë¤Ï +.BR syscall (2) +¤ò»È¤¦¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR modify_ldt (2), +.BR set_thread_area (2) diff --git a/release/man2/getcontext.2 b/release/man2/getcontext.2 new file mode 100644 index 00000000..40036021 --- /dev/null +++ b/release/man2/getcontext.2 @@ -0,0 +1,176 @@ +.\" Copyright (C) 2001 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. +.\" +.\" 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" +.SH ̾Á° +getcontext, setcontext \- ¥æ¡¼¥¶¥³¥ó¥Æ¥­¥¹¥È¤ò¼èÆÀ/ÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int getcontext(ucontext_t *" ucp ); +.br +.BI "int setcontext(const ucontext_t *" ucp ); +.SH ÀâÌÀ +System V Ū¤Ê´Ä¶­¤Ç¤Ï¡¢ +\fImcontext_t\fP ¤ª¤è¤Ó \fIucontext_t\fP ¤È¤¤¤¦ 2 ¤Ä¤Î·¿¤È¡¢ +.BR getcontext (), +.BR setcontext (), +.BR makecontext (3), +.BR swapcontext (3) +¤È¤¤¤¦ 4 ¤Ä¤Î´Ø¿ô¤¬ +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢¤¢¤ë¥×¥í¥»¥¹ÆâÉô¤ÇÀ©¸æ²¼¤Ë¤¢¤ëÊ£¿ô¤Î¥¹¥ì¥Ã¥É´Ö¤Ç¡¢ +¥æ¡¼¥¶¥ì¥Ù¥ë¤Î¥³¥ó¥Æ¥­¥¹¥ÈÀÚÂؤ¨¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.LP +\fImcontext_t\fP ·¿¤Ï¥Þ¥·¥ó°Í¸¤Ç¡¢³°Éô¤«¤é¤Ï±£Ê䵤ì¤Æ¤¤¤ë¡£ +\fIucontext_t\fP ·¿¤Ï¹½Â¤ÂΤǡ¢¾¯¤Ê¤¯¤È¤â°Ê²¼¤Î 4 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤ò»ý¤Ä¡£ +.in +4 +.nf + +typedef struct ucontext { + struct ucontext *uc_link; + sigset_t uc_sigmask; + stack_t uc_stack; + mcontext_t uc_mcontext; + ... +} ucontext_t; + +.fi +.in +\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 ¤ÏÊݸ¤µ¤ì¤Æ¤¤¤ë¥³¥ó¥Æ¥­¥¹¥È¤Î +¥Þ¥·¥óÆÃÍ­¤Îɽ¸½·Á¼°¤Ç¤¢¤ê¡¢ +¤³¤³¤Ë¤Ï¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¥Þ¥·¥ó¥ì¥¸¥¹¥¿¤¬³ÊǼ¤µ¤ì¤ë¡£ +.LP +.BR getcontext () +´Ø¿ô¤Ï¡¢ +¥Ý¥¤¥ó¥¿ \fIucp\fP ¤¬»Ø¤¹¹½Â¤ÂΤò¡¢ +¸½ºß¥¢¥¯¥Æ¥£¥Ö¤Ê¥³¥ó¥Æ¥­¥¹¥È¤Ë½é´ü²½¤¹¤ë¡£ +.LP +.BR setcontext () +´Ø¿ô¤Ï¡¢¥Ý¥¤¥ó¥¿ +\fIucp\fP ¤¬»Ø¤¹¥æ¡¼¥¶¥³¥ó¥Æ¥­¥¹¥È¤ò¥ê¥¹¥È¥¢¤¹¤ë¡£ +¸Æ¤Ó½Ð¤·¤ËÀ®¸ù¤¹¤ë¤ÈÊÖ¤é¤Ê¤¤¡£ +¤³¤Î¥³¥ó¥Æ¥­¥¹¥È¤Ï¡¢°ÊÁ°¤Ë +.BR getcontext () +¤Þ¤¿¤Ï +.BR makecontext (3) +¤ÇÆÀ¤é¤ì¤¿¤â¤Î¤«¡¢ +¤¢¤ë¤¤¤Ï¥·¥°¥Ê¥ë¤ÎÂè»°°ú¿ô¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿¤â¤Î¤Ë¤Ê¤ë¡£ +.LP +¥³¥ó¥Æ¥­¥¹¥È¤¬ +.BR getcontext () +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤Æ¤¤¤¿¤â¤Î¤Î¾ì¹ç¤Ï¡¢ +¥×¥í¥°¥é¥à¤Ï¤³¤Î¸Æ¤Ó½Ð¤·¤«¤éÊ֤ä¿Ä¾¸å¤«¤é¤Î¤è¤¦¤Ë¼Â¹Ô¤ò·Ñ³¤¹¤ë¡£ +.LP +¥³¥ó¥Æ¥­¥¹¥È¤¬ +.BR makecontext (3) +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤Æ¤¤¤¿¤â¤Î¤Î¾ì¹ç¤Ï¡¢ +¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤Ï¤½¤Î +.BR makecontext (3) +¸Æ¤Ó½Ð¤·¤ÎÂèÆó°ú¿ô¤Ç»ØÄꤵ¤ì¤¿´Ø¿ô \fIfunc\fP +¤ò¸Æ¤Ó½Ð¤¹¤«¤¿¤Á¤Ç·Ñ³¤¹¤ë¡£ +\fIfunc\fP ¤«¤éÊÖ¤ë¤È¡¢ +.BR makecontext (3) +¸Æ¤Ó½Ð¤·¤ÎÂè°ì°ú¿ô¤Ç»ØÄꤵ¤ì¤Æ¤¤¤¿ +\fIucp\fP ¹½Â¤ÂΤΠ\fIuc_link\fP ¥á¥ó¥Ð¤Ç·Ñ³¤¹¤ë¡£ +¤³¤Î¥á¥ó¥Ð¤¬ NULL ¤À¤Ã¤¿¾ì¹ç¤Ï¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ï½ªÎ»¤¹¤ë¡£ +.LP +¥³¥ó¥Æ¥­¥¹¥È¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤Æ¤¤¤¿¤â¤Î¤Î¾ì¹ç¤Ï¡¢ +¸Å¤¤É¸½à¤Ë¤è¤ì¤Ð +¡Ö¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤Ï¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿Ì¿Îá¤Î¼¡¤ÎÌ¿Îᤫ¤é·Ñ³¤µ¤ì¤ë¡×¡£ +¤·¤«¤·¤³¤Îʸ¤Ï SUSv2 ¤Çºï½ü¤µ¤ì¤¿¤Î¤Ç¡¢ +¸½ºß¤ÎȽÃǤϡַë²Ì¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡×¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR getcontext () +¤Ï 0 ¤òÊÖ¤·¡¢ +.BR setcontext () +¤ÏÊÖ¤é¤Ê¤¤¡£ +¼ºÇÔ¤¹¤ë¤È¡¢Î¾¼Ô¤È¤â \-1 ¤òÊÖ¤·¡¢\fIerrno\fP ¤ò¥¨¥é¡¼¤Ë±þ¤¸¤ÆÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +SUSv2, POSIX.1-2001. +POSIX.1-2008 ¤Ç¤Ï¡¢°Ü¿¢À­¤ÎÌäÂ꤫¤é +.BR getcontext () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤¿¡£ +Âå¤ï¤ê¤Ë¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò POSIX ¥¹¥ì¥Ã¥É¤ò»È¤Ã¤Æ½ñ¤­Ä¾¤¹¤³¤È¤¬ +¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +¤³¤Î¥á¥«¥Ë¥º¥à¤ÎºÇ¸Å¤Î¼ÂÁõ¤Ï¡¢ +.BR setjmp (3)/ longjmp (3) +µ¡¹½¤Ç¤¢¤Ã¤¿¡£ +¤³¤ì¤é¤Ë¤Ï¥·¥°¥Ê¥ë¥³¥ó¥Æ¥­¥¹¥È¤Î¼è¤ê°·¤¤¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤Ç¡¢ +¼¡¤ÎÃʳ¬¤Ç¤Ï +.BR sigsetjmp (3)/ siglongjmp (3) +¤Î¥Ú¥¢¤¬¸½¤ï¤ì¤¿¡£ +¸½ºß¤Îµ¡¹½¤Ç¤Ï¤º¤Ã¤ÈºÙ¤«¤ÊÀ©¸æ¤¬¤Ç¤­¤ë¡£ +°ìÊý +.BR getcontext () +¤«¤éÊ֤俤Ȥ­¡¢ +¤³¤ì¤¬ºÇ½é¤Î¸Æ¤Ó½Ð¤·¤Ç¤¢¤Ã¤¿¤«¡¢ +¤½¤ì¤È¤â +.BR setcontext () +¸Æ¤Ó½Ð¤·¤«¤é¤Î¤â¤Î¤Ç¤¢¤ë¤«¤ò +¶èÊ̤¹¤ëÍưפÊÊýË¡¤¬¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£ +¥æ¡¼¥¶¤Ï¡Ö¤·¤ª¤ê¡×µ¡¹½¤ò¼«Ê¬¤Çºî¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥ì¥¸¥¹¥¿ÊÑ¿ô¤Ï (¥ì¥¸¥¹¥¿¤Ï¥ê¥¹¥È¥¢¤µ¤ì¤Æ¤·¤Þ¤¦¤Î¤Ç) ¤³¤ì¤ò¤ä¤Ã¤Æ¤¯¤ì¤Ê¤¤¡£ +.LP +¥·¥°¥Ê¥ë¤¬È¯À¸¤¹¤ë¤È¡¢ +¸½ºß¤Î¥æ¡¼¥¶¥³¥ó¥Æ¥­¥¹¥È¤ÏÊݸ¤µ¤ì¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥éÍѤΥ³¥ó¥Æ¥­¥¹¥È¤¬¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤ë¡£ +º£¸å¤Ï¥Ï¥ó¥É¥é¤Ë +.BR longjmp (3) +¤ò»È¤ï¤»¤Ê¤¤¤³¤È: +¤³¤Î´Ø¿ô¤Î¥³¥ó¥Æ¥­¥¹¥È²¼¤Ç¤ÎÆ°ºî¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë +.BR siglongjmp (3) +¤« +.BR setcontext () +¤ò»È¤¦¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sigaction (2), +.BR sigaltstack (2), +.BR sigprocmask (2), +.BR longjmp (3), +.BR makecontext (3), +.BR sigsetjmp (3) diff --git a/release/man2/getdents.2 b/release/man2/getdents.2 new file mode 100644 index 00000000..a051fc6b --- /dev/null +++ b/release/man2/getdents.2 @@ -0,0 +1,283 @@ +.\" 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" +.SH ̾Á° +getdents \- ¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.BI "int getdents(unsigned int " fd ", struct linux_dirent *" dirp , +.BI " unsigned int " count ); +.fi +.SH ÀâÌÀ +¤³¤ì¤Ï¤¢¤Ê¤¿¤Î´Ø¿´¤ò°ú¤¯¤è¤¦¤Ê´Ø¿ô¤Ç¤Ï¤Ê¤¤¡£ +POSIX ½àµò¤Î C ¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤Ä¤¤¤Æ¤Ï +.BR readdir (3) +¤ò¸«¤ë¤³¤È¡£ +¤³¤Î¥Ú¡¼¥¸¤Ï¡¢¥«¡¼¥Í¥ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀ¸¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤Ä¤¤¤Æ +µ­ºÜ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.PP +.BR getdents () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ëµ­½Ò»Ò +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é +.I linux_dirent +¹½Â¤ÂΤò¤¤¤¯¤Ä¤«Æɤ߽Ф·¡¢ +.I dirp +¤¬»Ø¤·¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤¹¤ë¡£ +.I count +°ú¤­¿ô¤Ï¤½¤Î¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò¼¨¤¹¡£ +.PP +.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 +.I d_ino +¤Ï inode ÈÖ¹æ¤Ç¤¢¤ë¡£ +.I d_off +¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ÎÀèƬ¤«¤é¼¡¤Î +.I linux_dirent +¤ÎÀèƬ¤Þ¤Ç¤Îµ÷Î¥¤Ç¤¢¤ë¡£ +.I d_reclen +¤Ï¤³¤Î +.I linux_dirent +Á´ÂΤΥµ¥¤¥º¤Ç¤¢¤ë¡£ +.I d_name +¤Ï¥Ì¥ë(null)ʸ»ú¤Ç½ª¤ï¤ë¥Õ¥¡¥¤¥ë̾¤Ç¤¢¤ë¡£ + +.I d_type +¤Ï¡¢¹½Â¤ÂΤκǸå¤Î¥Ð¥¤¥È¤Ç¤¢¤ê¡¢¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤ò¼¨¤¹¡£ +.I d_type +¤Ï°Ê²¼¤ÎÃͤΰì¤Ä¤ò¼è¤ë +.RI ( +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +.TP 12 +.B DT_BLK +¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£ +.TP +.B DT_CHR +¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£ +.TP +.B DT_DIR +¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¡£ +.TP +.B DT_FIFO +̾Á°¤Ä¤­¥Ñ¥¤¥× (FIFO) ¤Ç¤¢¤ë¡£ +.TP +.B DT_LNK +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¡£ +.TP +.B DT_REG +Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.TP +.B DT_SOCK +Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£ +.TP +.B DT_UNKNOWN +¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤ÏÉÔÌÀ¤Ç¤¢¤ë¡£ +.PP +.I d_type +¥Õ¥£¡¼¥ë¥É¤Ï Linux 2.6.4 ¤«¤é¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï +.I linux_dirent +¹½Â¤ÂΤΤ¦¤Á¡¢°ÊÁ°¤Ï¥¼¥í¤ÇËä¤á¤é¤ì¤Æ¤¤¤¿¶õ´Ö¤ËÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¡£ +½¾¤Ã¤Æ¡¢2.6.3 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤¹¤ë¤È +¾ï¤ËÃÍ 0 +.RB ( DT_UNKNOWN ) +¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +¸½ºß¤Î¤È¤³¤í¡¢ +.\" ¥«¡¼¥Í¥ë 2.6.27 +.\" Ʊ¤¸ÀâÌÀʸ¤¬ readdir.2 ¤Ë¤â¤¢¤ë¡£ +.I d_type +¤Ç¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤òÊÖ¤¹µ¡Ç½¤¬´°Á´¤Ë¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢ +¤¤¤¯¤Ä¤«¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¤Î¤ß¤Ç¤¢¤ë +(Btrfs, ext2, ext3, ext4 ¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë)¡£ +¤É¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤â¡¢ +.B DT_UNKNOWN +¤¬ÊÖ¤µ¤ì¤¿ºÝ¤ËŬÀڤ˽èÍý¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¡¢Æɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë¡£ +¥Ç¥£¥ì¥¯¥È¥ê¤Î½ª¤ï¤ê¤Ê¤é¤Ð 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +¥Õ¥¡¥¤¥ëµ­½Ò»Ò +.I fd +¤Ï̵¸ú¤Ç¤¢¤ë¡£ +.TP +.B EFAULT +°ú¤­¿ô¤¬¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +·ë²ÌÍѤΥХåե¡¡¼¤¬¾®¤µ¤¹¤®¤ë¡£ +.TP +.B ENOENT +¤½¤Î¤è¤¦¤Ê¥Ç¥£¥ì¥¯¥È¥ê¤Ï¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOTDIR +¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +SVr4. +.\" SVr4 ¤Ç¤Ï¡¢Â¾¤Ë ENOLINK, EIO ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤âµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢ +.BR syscall (2) +¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£ +.I linux_dirent +¹½Â¤ÂΤϼ«Ê¬¤ÇÄêµÁ¤¹¤ëɬÍפ¬¤¢¤ë¡£ + +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.BR readdir (2) +¤òÃÖ¤­´¹¤¨¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.SH Îã +²¼µ­¤Î¥×¥í¥°¥é¥à¤Ï +.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 +.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 +.SH ´ØÏ¢¹àÌÜ +.BR readdir (2), +.BR readdir (3) diff --git a/release/man2/getdomainname.2 b/release/man2/getdomainname.2 new file mode 100644 index 00000000..f017a21f --- /dev/null +++ b/release/man2/getdomainname.2 @@ -0,0 +1,137 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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-08-25 by Nicolas 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" +.SH ̾Á° +getdomainname, setdomainname \- ¥É¥á¥¤¥ó̾¤Î¼èÆÀ¡¦ÀßÄê¤ò¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int getdomainname(char *" name ", size_t " len ); +.br +.BI "int setdomainname(const char *" name ", size_t " len ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR getdomainname (), +.BR setdomainname (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¥Û¥¹¥È¥·¥¹¥Æ¥à¤Î¥É¥á¥¤¥ó̾¤ò¼èÆÀ¡¦Êѹ¹¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ + +.BR setdomainname () +¤Ï¡¢¥É¥á¥¤¥ó̾¤ò¡¢Ê¸»úÇÛÎó +.I name +¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +°ú¤­¿ô +.I len +¤Ë¤Ï¡¢ +.I name +¤Î¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë +(¤½¤Î¤¿¤á¡¢ +.I name +¤Ç¤Ïʸ»úÎó½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ÏɬÍפʤ¤)¡£ + +.BR getdomainname () +¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿¥É¥á¥¤¥ó̾¤ò¡¢ +.I len +¥Ð¥¤¥È¤ÎŤµ¤Îʸ»úÇÛÎó +.I name +¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +NULL ½ªÃ¼¤µ¤ì¤¿¥É¥á¥¤¥ó̾¤¬ \fIlen\fP ¥Ð¥¤¥È¤è¤êŤ¤¾ì¹ç¡¢ +.BR getdomainname () +¤Ï¡¢(glibc ¤Ç¤Ï) »Ï¤á¤Î \fIlen\fP ¥Ð¥¤¥È¤òÊÖ¤·¡¢(libc ¤Ç¤Ï) ¥¨¥é¡¼¤È¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç 0 ¤¬Ê֤롣¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤¬Ê֤ꡢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR setdomainname () +¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EFAULT +.I name +¤¬¥æ¡¼¥¶¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤¿¡£ +.TP +.B EINVAL +.I len +¤¬Éé¤Ç¤¢¤ë¤«¡¢Ä¹¤¹¤®¤ë¡£ +.TP +.B EPERM +.BR setdomainname () +¤Ë¤ª¤¤¤Æ¡¢¸Æ¤Ó½Ð¤·¤¿¿Í¤ËÆø¢¤¬¤Ê¤¤ +(Linux ¤Ç¤Ï +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¤Ê¤¤)¡£ +.PP +.BR getdomainname () +¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EINVAL +libc ¤Ç¤Î +.BR getdomainname () +¤Ë¤ª¤¤¤Æ¡¢ +.I name +¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤«¡¢ +.I len +¥Ð¥¤¥È¤è¤êŤ¤¡£ +.SH ½àµò +POSIX ¤Ç¤Ï¡¢¤³¤ì¤é´Ø¿ô¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" ¤·¤«¤·¡¢¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤Ë¤¢¤ë... +.SH Ãí°Õ +Linux 1.0 °Ê¹ß¤Ç¤Ï¡¢¥É¥á¥¤¥ó̾¤ÎŤµ¤Î¾å¸Â¤Ï +½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ò´Þ¤á¤Æ 64 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +¤â¤Ã¤È¸Å¤¤¥«¡¼¥Í¥ë¤Ç¤Ï 8 ¥Ð¥¤¥È¤Ç¤¢¤Ã¤¿¡£ + +(x86 ¤ò´Þ¤à) Linux ¤Î¤Û¤È¤ó¤É¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢ +.BR getdomainname () +¤È¤¤¤¦¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¸ºß¤·¤Ê¤¤¡£ +¤½¤ÎÂå¤ï¤ê¡¢glibc ¤Ç +.BR getdomainname () +¤¬¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢¤³¤Î´Ø¿ô¤Ï +.BR uname (2) +¤Î¸Æ¤Ó½Ð¤·¤ÇÊÖ¤µ¤ì¤¿ +.I domainname +¥Õ¥£¡¼¥ë¥É¤Î¥³¥Ô¡¼¤òÊÖ¤¹¡£ +.SH ´ØÏ¢¹àÌÜ +.BR gethostname (2), +.BR sethostname (2), +.BR uname (2) diff --git a/release/man2/getdtablesize.2 b/release/man2/getdtablesize.2 new file mode 100644 index 00000000..5e44d8aa --- /dev/null +++ b/release/man2/getdtablesize.2 @@ -0,0 +1,89 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 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 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getdtablesize \- ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Æ¡¼¥Ö¥ë¤Î¥µ¥¤¥º¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.B int getdtablesize(void); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR getdtablesize (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.BR getdtablesize () +¤Ï 1 ¤Ä¤Î¥×¥í¥»¥¹¤Î¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤ÎºÇÂçÃͤòÊÖ¤¹¡£ +ÊÖ¤êÃͤϥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¼è¤êÆÀ¤ëºÇÂçÃͤè¤ê 1 Â礭¤¤ÃͤǤ¢¤ë¡£ +.SH ÊÖ¤êÃÍ +¥×¥í¥»¥¹Ëè¤Ë¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¸½ºß¤ÎÀ©¸ÂÃÍ¡£ +.SH ¥¨¥é¡¼ +Linux ¤Ç¤Ï¡¢ +.BR getdtablesize () +¤Ï +.BR getrlimit (2) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤¬¤¢¤ë¡£ +²¼µ­¤Î¡ÖÃí°Õ¡×¤ò»²¾È¤Î¤³¤È¡£ +.SH ½àµò +SVr4, 4.4BSD +.RB ( getdtablesize () +´Ø¿ô¤Ï 4.2BSD ¤ÇºÇ½é¤Ë¸½¤ï¤ì¤¿)¡£ +¤³¤ì¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢ +°Ü¿¢À­¤Î¤¢¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤Î¸Æ¤Ó½Ð¤·¤ÎÂå¤ï¤ê¤Ë +.I sysconf(_SC_OPEN_MAX) +¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR getdtablesize () +¤Ï libc ¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£glibc ÈÇ¤Ï +.BR getrlimit (2) +¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢¸½ºß¤Î +.B RLIMIT_NOFILE +¤òÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ï +.B OPEN_MAX +¤òÊÖ¤¹¡£ +libc4 ¤È libc5 ¤Ç¤Ï +.B OPEN_MAX +(Linux 0.98.4 °Ê¹ß¤Ç¤Ï 256 ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë) +¤òÊÖ¤¹¡£ +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR dup (2), +.BR getrlimit (2), +.BR open (2) diff --git a/release/man2/getgid.2 b/release/man2/getgid.2 new file mode 100644 index 00000000..f71f37a3 --- /dev/null +++ b/release/man2/getgid.2 @@ -0,0 +1,55 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated Thu Jun 26 20:27:59 JST 1997 +.\" by SUTO, Mitsuaki +.\" +.TH GETGID 2 1993-07-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getgid, getegid \- ¥°¥ë¡¼¥× ID ¤òÆÀ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.B gid_t getgid(void); +.br +.B gid_t getegid(void); +.SH ÀâÌÀ +.BR getgid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¥°¥ë¡¼¥× ID ¤òÊÖ¤¹¡£ + +.BR getegid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.SH ½àµò +POSIX.1-2001, 4.3BSD. +.SH ´ØÏ¢¹àÌÜ +.BR getresgid (2), +.BR setgid (2), +.BR setregid (2), +.BR credentials (7) diff --git a/release/man2/getgroups.2 b/release/man2/getgroups.2 new file mode 100644 index 00000000..8dfd97b2 --- /dev/null +++ b/release/man2/getgroups.2 @@ -0,0 +1,176 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 Thu Oct 31 12:04:29 1996 by Eric S. Raymond +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" 2008-05-03, mtk, expanded and rewrote parts of DESCRIPTION and RETURN +.\" VALUE, made style of page more consistent with man-pages style. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-22, HANATAKA Shinya +.\" Updated 2001-02-10, Yuichi SATO +.\" Updated & Modified 2004-12-30, Yuichi SATO +.\" Updated 2008-08-04, Akihiro MOTOKI , LDP v3.05 +.\" +.\"WORD: group ¥°¥ë¡¼¥× +.\"WORD: access ¥¢¥¯¥»¥¹ +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: super user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\"WORD: supplementary group Êä½õ¥°¥ë¡¼¥× +.\" +.TH GETGROUPS 2 2008-06-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getgroups, setgroups \- Êä½õ¥°¥ë¡¼¥× ID ¤Î¥ê¥¹¥È¤ò¼èÆÀ/ÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int getgroups(int " size ", gid_t " list []); +.sp +.B #include +.sp +.BI "int setgroups(size_t " size ", const gid_t *" list ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR setgroups (): +_BSD_SOURCE +.SH ÀâÌÀ +.PP +.BR getgroups () +¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ÎÊä½õ¥°¥ë¡¼¥× (supplementary group) ID ¤ò +.I list +¤ËÊÖ¤¹¡£ +.I size +°ú¤­¿ô¤Ë¤Ï¡¢ +.I list +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤Ç¤­¤ëÍ×ÁǤκÇÂç¿ô¤òÀßÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬ +.I size +¸Ä¤è¤ê¿¤¯¤ÎÊä½õ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¤Î¾ì¹ç¤Ë¤Ï¡¢¥¨¥é¡¼¤È¤Ê¤ë¡£ +¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤¬¡¢ +ÊÖ¤µ¤ì¤ë¥ê¥¹¥È¤Ë´Þ¤Þ¤ì¤ë¤«¤É¤¦¤«¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤ +(¤·¤¿¤¬¤Ã¤Æ¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï +.BR getegid (2) +¤ò¸Æ¤Ó½Ð¤·¡¢¤½¤Î·ë²Ì¤ÎÃͤòÄɲᦺï½ü¤¹¤Ù¤­¤Ç¤¢¤ë)¡£ + +.I size +¤¬ 0 ¤Ê¤é¤Ð¡¢ +.I list +¤Ï½¤Àµ¤µ¤ì¤Ê¤¤¤¬¡¢¤½¤Î¥×¥í¥»¥¹¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤Î¹ç·×¿ô¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤ì¤ò»È¤¦¤³¤È¤Ç¡¢¤½¤ì°Ê¹ß¤Î +.BR getgroups () +¤Î¸Æ¤Ó½Ð¤·¤ÇɬÍפȤʤëưŪ³ä¤êÅö¤Æ¥Ð¥Ã¥Õ¥¡ +.I list +¤Î¥µ¥¤¥º¤ò¡¢¸Æ¤Ó½Ð¤·¸µ¤¬·èÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.BR setgroups () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë¡£ +ŬÀÚ¤ÊÆø¢ (Linux ¤Ç¤Ï +.B CAP_SETGID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability)) ¤¬É¬ÍפǤ¢¤ë¡£ +.I size +°ú¤­¿ô¤Ë¤Ï¡¢ +.I list +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤¿Êä½õ¥°¥ë¡¼¥× ID ¤Î¿ô¤ò»ØÄꤹ¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR getgroups () +¤Ï¡¢À®¸ù¤¹¤ë¤ÈÊä½õ¥°¥ë¡¼¥× ID ¤Î¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ + +.BR setgroups () +¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I list +¤¬ÉÔÀµ¤Ê¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.PP +.BR getgroups () +¤Ï¡¢¾åµ­¤Ë²Ã¤¨¤Æ°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.I size +¤¬Êä½õ¥°¥ë¡¼¥× ID ¤Î¿ô¤è¤ê¾®¤µ¤¤¤¬ 0 ¤Ç¤Ê¤¤¡£ +.PP +.BR setgroups () +¤Ï¡¢¾åµ­¤Ë²Ã¤¨¤Æ°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.I size +¤¬ +.B NGROUPS_MAX +¤è¤êÂ礭¤¤ +.RB ( NGROUPS_MAX +¤Ï Linux 2.6.4 ¤è¤êÁ°¤Ç¤Ï 32¡¢Linux 2.6.4 °Ê¹ß¤Ç¤Ï 65536)¡£ +.TP +.B ENOMEM +¥á¥â¥êÉÔ­¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬½½Ê¬¤ÊÆø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +SVr4, 4.3BSD. +.BR getgroups () +´Ø¿ô¤Ï POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR setgroups () +¤ÏÆø¢¤òɬÍפȤ¹¤ë¤¿¤á¡¢POSIX.1-2001 ¤Ë½¾¤Ã¤Æ¤¤¤Ê¤¤¡£ +.SH Ãí°Õ +¥×¥í¥»¥¹¤Ï¡¢¼Â¸ú¥°¥ë¡¼¥× ID ¤Ë²Ã¤¨¡¢ºÇÂç +.B NGROUPS_MAX +¤Þ¤Ç¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +Êä½õ¥°¥ë¡¼¥× ID ¤Î½¸¹ç¤Ï¿Æ¥×¥í¥»¥¹¤«¤é·Ñ¾µ¤µ¤ì¡¢ +.BR execve (2) +¤ÎÁ°¸å¤ÇÊÝ»ý¤µ¤ì¤ë¡£ + +Êä½õ¥°¥ë¡¼¥× ID ¤ÎºÇÂç¿ô¤Ï +.BR sysconf (3) +¤ò»È¤Ã¤Æ°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë: +.nf + + long ngroups_max; + ngroups_max = sysconf(_SC_NGROUPS_MAX); + +.fi +.BR getgroups () +¤ÎÊÖ¤êÃͤκÇÂçÃͤϡ¢¤³¤ÎÃͤè¤ê 1 Â礭¤¤Ãͤè¤êÂ礭¤¯¤Ê¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getgid (2), +.BR setgid (2), +.BR getgrouplist (3), +.BR initgroups (3), +.BR capabilities (7), +.BR credentials (7) diff --git a/release/man2/gethostname.2 b/release/man2/gethostname.2 new file mode 100644 index 00000000..73703dcd --- /dev/null +++ b/release/man2/gethostname.2 @@ -0,0 +1,195 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 +.\" 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 1995-07-22 by Michael Chastain : +.\" 'gethostname' is real system call on Linux/Alpha. +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2000-06-04, 2001-12-15 by aeb +.\" 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 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +gethostname, sethostname \- ¥Û¥¹¥È̾¤Î¼èÆÀ¡¦ÀßÄê¤ò¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int gethostname(char *" name ", size_t " len ); +.br +.BI "int sethostname(const char *" name ", size_t " len ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR gethostname (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR sethostname (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¸½ºß¤Î¥×¥í¥»¥Ã¥µ¤Î¥Û¥¹¥È̾¤ò¼èÆÀ¡¦Êѹ¹¤¹¤ë¤¿¤á¤Ë +»ÈÍѤµ¤ì¤ë¡£ + +.BR sethostname () +¤Ï¡¢¥Û¥¹¥È̾¤ò¡¢Ê¸»úÇÛÎó +.I name +¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +°ú¤­¿ô +.I len +¤Ë¤Ï¡¢ +.I name +¤Î¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë +(¤½¤Î¤¿¤á¡¢ +.I name +¤Ç¤Ïʸ»úÎó½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ÏɬÍפʤ¤)¡£ + +.BR gethostname () +¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿¥Û¥¹¥È̾¤ò¡¢ +.I len +¥Ð¥¤¥È¤ÎŤµ¤Îʸ»úÇÛÎó +.I name +¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +NULL ½ªÃ¼¤µ¤ì¤¿¥Û¥¹¥È̾¤¬³ÊǼÀè¤Î¥Ð¥Ã¥Õ¥¡¤è¤ê¤âŤ¤¾ì¹ç¤Ï¡¢ +¥Û¥¹¥È̾¤ÏÀÚ¤êµÍ¤á¤é¤ì¡¢¥¨¥é¡¼¤ÏÊÖ¤µ¤ì¤Ê¤¤ (²¼µ­¤Î¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È)¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢·ë²Ì¤ÎÀÚ¤êµÍ¤á¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¡¢ +ÊÖ¤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ï +µ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç 0 ¤¬Ê֤롣¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤¬Ê֤ꡢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I name +¤¬ÉÔÀµ¤Ê¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +.I len +¤¬Éé¤Ç¤¢¤ë¡£ +.\" gethostbyname() ¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ç¤Ï¡¢'len' ¤Ï unsigned ·¿¤Ê¤Î¤Ç +.\" ¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.\" ¤½¤ÎÃæ¤Ç¸Æ¤Ð¤ì¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤ÏȯÀ¸¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +.BR sethostname () +¤Ë¤ª¤¤¤Æ +.I len +¤¬µöÍƤµ¤ì¤¿ºÇÂ祵¥¤¥º¤ò±Û¤¨¤Æ¤¤¤ë¡£ +.TP +.B ENAMETOOLONG +.RB "(glibc " gethostname () +¤Ç) +.I len +¤¬¼ÂºÝ¤Î¥Û¥¹¥È̾¤ÎŤµ¤è¤ê¤â¾®¤µ¤¤ +(glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤è¤êÁ°¤Ç¤Ï¡¢¤³¤Î¾õ¶·¤Ç +.B EINVAL +¤¬»ÈÍѤµ¤ì¤ë)¡£ +.TP +.B EPERM +.BR sethostname () +¤Ë¤ª¤¤¤Æ¡¢¸Æ¤Ó½Ð¤·¤¿¿Í¤¬ +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +SVr4, 4.4BSD (¤³¤ì¤é¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï 4.2BSD ¤Ç½é¤á¤ÆÅо줷¤¿)¡£ +POSIX.1-2001 ¤Ç¤Ï +.BR gethostname () +¤Ë¤Ä¤¤¤Æ¤Ïµ¬Äꤷ¤Æ¤¤¤ë¤¬¡¢ +.BR sethostname () +¤Ïµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£ +.SH Ãí°Õ +SUSv2 ¤Ç¤Ï¡Ö¥Û¥¹¥È̾¤¬ 255 ¥Ð¥¤¥È¤ËÀ©¸Â¤µ¤ì¤ë¡×¤³¤È¤òÊݾڤ·¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï¡Ö¥Û¥¹¥È̾ (½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤Ï´Þ¤Þ¤Ê¤¤) ¤¬ +.B HOST_NAME_MAX +¥Ð¥¤¥È¤ËÀ©¸Â¤µ¤ì¤ë¡×¤³¤È¤òÊݾڤ·¤Æ¤¤¤ë¡£ +Linux ¤Ç¤Ï¡¢ +.B HOST_NAME_MAX +¤Ï 64 ¤ËÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +Linux 1.0 °Ê¹ß¤Ç¤Ï¤³¤ì¤¬¾å¸Â¤È¤Ê¤Ã¤Æ¤­¤¿ +(¤â¤Ã¤È¸Å¤¤¥«¡¼¥Í¥ë¤Ç¤Ï 8 ¥Ð¥¤¥È¤Î¾å¸Â¤¬Å¬ÍѤµ¤ì¤Æ¤¤¤¿)¡£ +.SS "glibc ¤Ç¤ÎÃí°Õ" +GNU C ¥é¥¤¥Ö¥é¥ê¤Ï¡¢ +.BR gethostname () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍøÍѤ·¤Æ¤¤¤Ê¤¤¡£¤½¤ÎÂå¤ï¤ê¡¢ +.BR gethostname () +¤ò¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤·¤Æ¤ª¤ê¡¢ +¤³¤Î´Ø¿ô¤Ï +.BR uname (2) +¤ò¸Æ¤Ó½Ð¤·¡¢ +.BR uname (2) +¤¬ÊÖ¤·¤¿ +.I nodename +¥Õ¥£¡¼¥ë¥É (¤ÎºÇÂç +.I len +¥Ð¥¤¥È) ¤ò +.I name +¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +¥³¥Ô¡¼¤ò¹Ô¤Ã¤¿ºÝ¤Ë¡¢¤³¤Î´Ø¿ô¤Ï +.I nodename +¤ÎŤµ¤¬ +.I len +°Ê¾å¤«¤Î³Îǧ¤ò¹Ô¤¤¡¢ +.I len +°Ê¾å¤Î¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B ENAMETOOLONG +¤òÀßÄꤹ¤ë¡£ +¤³¤Î¾ì¹ç¡¢ÊÖ¤µ¤ì¤¿ +.I name +¤Ë¤Ï½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ + +¥Ð¡¼¥¸¥ç¥ó 2.2 ¤è¤êÁ°¤Î glibc +.\" ¾¯¤Ê¤¯¤È¤â glibc 2.0 ¤È 2.1¡£¤½¤ì¤è¤ê¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Ï̤³Îǧ +¤Ç¤Ï¡¢ +.I nodename +¤ÎŤµ¤¬ +.I len +°Ê¾å¤Î¾ì¹ç¤Î°·¤¤¤¬°Û¤Ê¤ë; +.I len +°Ê¾å¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I name +¤Ë¤Ï²¿¤â¥³¥Ô¡¼¤»¤º¡¢´Ø¿ô¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B ENAMETOOLONG +¤òÀßÄꤹ¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getdomainname (2), +.BR setdomainname (2), +.BR uname (2) diff --git a/release/man2/getitimer.2 b/release/man2/getitimer.2 new file mode 100644 index 00000000..5c3b07d2 --- /dev/null +++ b/release/man2/getitimer.2 @@ -0,0 +1,230 @@ +.\" Copyright 7/93 by Darren Senn +.\" Based on a similar page Copyright 1992 by Rick Faith +.\" May be freely distributed +.\" Modified Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond +.\" 2005-04-06 mtk, Matthias Lang +.\" Noted MAX_SEC_IN_JIFFIES ceiling +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-22, HANATAKA Shinya +.\" Updated 2005-04-23, Kentaro Shirakata +.\" Updated 2005-09-11, Kentaro Shirakata +.\" Updated 2006-07-23, Kentaro Shirakata +.\" Updated 2007-10-14, Akihiro MOTOKI +.\" Updated 2009-04-13, Akihiro MOTOKI, LDP v3.20 +.\" +.\" WORD: timer ¥¿¥¤¥Þ¡¼ +.\" WORD: jiffies jiffy +.\" +.TH GETITIMER 2 2009-03-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getitimer, setitimer \- ¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¡¼¤ÎÃͤò¼èÆÀ¤Þ¤¿¤ÏÀßÄꤹ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getitimer(int " which ", struct itimerval *" curr_value ); +.br +.BI "int setitimer(int " which ", const struct itimerval *" new_value , +.BI " struct itimerval *" old_value ); +.fi +.SH ÀâÌÀ +¥·¥¹¥Æ¥à¤Ï 1 ¸Ä¤Î¥×¥í¥»¥¹¤Ë¤Ä¤­ 3 ¸Ä¤Î¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¡¼¤òÄ󶡤¹¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥¿¥¤¥Þ¡¼¤ÏÊÌ¡¹¤Î»þ´ÖÎΰè¤Ç¸º¾¯¤¹¤ë¡£ +¤É¤Î¥¿¥¤¥Þ¡¼¤âËþλ¤¹¤ë¤È¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¡¢ +¥¿¥¤¥Þ¡¼¤Ï (ÀßÄê¤Ë¤è¤Ã¤Æ¤Ï) ºÆ¤Ó³«»Ï¤µ¤ì¤ë¡£ +.TP 1.5i +.B ITIMER_REAL +¼Â»þ´Ö (real time) ¤Ç¸º¾¯¤·¡¢Ëþλ¤¹¤ë¤È +.B SIGALRM +¤¬Á÷¤é¤ì¤ë¡£ +.TP +.B ITIMER_VIRTUAL +¥×¥í¥»¥¹¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë´Ö¤Î¤ß¸º¾¯¤·¡¢Ëþλ¤¹¤ë¤È +.B SIGVTALRM +¤¬Á÷¤é¤ì¤ë¡£ +.TP +.B ITIMER_PROF +¥×¥í¥»¥¹¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤Æ¡¢ +¤«¤Ä¥·¥¹¥Æ¥à¤¬¤½¤Î¥×¥í¥»¥¹¤Î¤¿¤á¤Ë½èÍý¤ò¹Ô¤Ê¤Ã¤Æ¤¤¤ë´Ö¤Ë¸º¾¯¤¹¤ë¡£ +¿¤¯¤Î¾ì¹ç¡¢¤³¤Î¥¿¥¤¥Þ¡¼¤Ï +.B ITIMER_VIRTUAL +¤ÈÁȤ߹ç¤ï¤µ¤ì¤Æ¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¥«¡¼¥Í¥ë¶õ´Ö¤È¥æ¡¼¥¶¡¼¶õ´Ö¤Ç +¤É¤ì¤À¤±¤Î»þ´Ö¤ò²á¤´¤·¤¿¤«¤ò¥×¥í¥Õ¥¡¥¤¥ë¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +Ëþλ¤¹¤ë¤È +.B SIGPROF +¤¬Á÷¤é¤ì¤ë¡£ +.LP +¥¿¥¤¥Þ¡¼¤ÎÃͤϰʲ¼¤Î¹½Â¤ÂΤˤè¤Ã¤ÆÄêµÁ¤µ¤ì¤ë: +.PD 0 +.in +4n +.nf + +struct itimerval { + struct timeval it_interval; /* next value */ + struct timeval it_value; /* current value */ +}; + +struct timeval { + long tv_sec; /* seconds */ + long tv_usec; /* microseconds */ +}; +.fi +.in +.PD +.LP +.BR getitimer () +´Ø¿ô¤Ï¡¢ +.I which +¤Ç»ØÄꤵ¤ì¤¿¥¿¥¤¥Þ¡¼ +.RB ( ITIMER_REAL , +.BR ITIMER_VIRTUAL , +.B ITIMER_PROF +¤Î¤É¤ì¤«) ¤Î¸½ºß¤ÎÀßÄê¤ò¡¢ +.I curr_value +¤Ç»ØÄꤵ¤ì¤¿¹½Â¤ÂΤ˳ÊǼ¤¹¤ë¡£ +.I it_value +Í×ÁǤˤϥ¿¥¤¥Þ¡¼¤Î»Ä¤ê»þ´Ö¤¬ÀßÄꤵ¤ì¤ë¡£¥¿¥¤¥Þ¡¼¤¬¥ª¥Õ¤Î¾ì¹ç¤Ï +¥¼¥í¤¬ÀßÄꤵ¤ì¤ë¡£Æ±ÍÍ¤Ë +.I it_interval +¤Ë¤Ï½é´üÃͤ¬ÀßÄꤵ¤ì¤ë¡£ + +.BR setitimer () +´Ø¿ô¤Ï»ØÄꤵ¤ì¤¿¥¿¥¤¥Þ¡¼¤Ë +.I new_value +¤ÎÃͤòÀßÄꤹ¤ë¡£ +.I old_value +¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢¥¿¥¤¥Þ¡¼¤Î¸Å¤¤Ãͤ¬ +.I old_value +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.LP +¥¿¥¤¥Þ¡¼¤Ï +.I it_value +¤«¤é¥¼¥í¤Ø¸þ¤±¤Æ¸º¤Ã¤Æ¤¤¤­¡¢¥·¥°¥Ê¥ë¤òÀ¸À®¤·¡¢ +.I it_interval +¤Ë½é´ü²½¤µ¤ì¤ë¡£ +¥¿¥¤¥Þ¡¼¤¬¥¼¥í¤ËÀßÄꤵ¤ì¤¿¾ì¹ç +.RI ( it_value +¤¬¥¼¥í¤«¡¢¥¿¥¤¥Þ¡¼¤¬Ëþλ¤·¤¿»þ¤Ë +.I it_interval +¤¬¥¼¥í¤Î¾ì¹ç) ¤ÏÄä»ß¤¹¤ë¡£ +.LP +¥¿¥¤¥Þ¡¼¤Î´ü´Ö¤Ï +.I tv_sec +¤È +.I tv_usec +¤ÎξÊý¤Ë¤è¤ê·èÄꤵ¤ì¤ë¡£ +.LP +Í׵ᤷ¤¿»þ´Ö¤¬¤¯¤ëÁ°¤Ë¥¿¥¤¥Þ¡¼¤¬Ëþλ¤¹¤ë¤³¤È¤Ï¤Ê¤¤¤¬¡¢ +µÕ¤Ë¤¢¤ë (û¤¤) »þ´Ö¤À¤±Ëþ뤬ÃÙ¤ì¤ë¤³¤È¤Ï¤¢¤ë¡£ +¤É¤ì¤À¤±ÃÙ¤ì¤ë¤«¤Ï¥·¥¹¥Æ¥à¤Î»þ´Öʬ²òǽ¤È¥·¥¹¥Æ¥à¤ÎÉé²Ù¤Ë°Í¸¤¹¤ë +.RB ( time (7) +»²¾È; ⤷¡¢¥Ð¥°¤Î¹à¤â»²¾È¤Î¤³¤È)¡£ +¥¿¥¤¥Þ¡¼¤¬Ëþλ¤¹¤ë¤È¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¡¢¥¿¥¤¥Þ¡¼¤Ï½é´ü²½¤µ¤ì¤ë¡£ +¥×¥í¥»¥¹¤¬¥¢¥¯¥Æ¥£¥Ö¤Ê»þ +.RB ( ITIMER_VIRTUAL +¤Î¾ì¹ç¤Ë¤Ï¾ï¤Ë¤½¤¦¤Ç¤¢¤ë) ¤Ë¥¿¥¤¥Þ¡¼¤¬Ëþλ¤·¤¿¾ì¹ç¡¢À¸À®¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ï +¤¹¤°¤ËÇÛÁ÷¤µ¤ì¤ë¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¥·¥¹¥Æ¥à¤ÎÉé²Ù¤Ë¤è¤ê¾¯¤·¤Î»þ´Ö¤À¤± +ÃÙ¤ì¤ÆÇÛÁ÷¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤¬Ê֤롣¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬Ê֤ꡢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.IR new_value , +.IR old_value , +.I curr_value +¤¬Í­¸ú¤Ê¥Ý¥¤¥ó¥¿¡¼¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.I which +¤¬ +.BR ITIMER_REAL , +.BR ITIMER_VIRTUAL , +.B ITIMER_PROF +¤Î¤É¤ì¤Ç¤â¤Ê¤¤¡£ +¤Þ¤¿¤Ï (Linux 2.6.22 °Ê¹ß¤Ç) +.I new_value +¤Ç»ØÄꤵ¤ì¤¿¹½Â¤ÂΤΠ+.I tv_usec +¥Õ¥£¡¼¥ë¥É¤Î°ì¤Ä¤¬ 0 °Ê¾å 999999 °Ê²¼¤ÎÈϰϤËÆþ¤é¤Ê¤¤ÃͤǤ¢¤ë¡£ +.SH ½àµò +POSIX.1-2001, SVr4, 4.4BSD (¤³¤Î¥³¡¼¥ë¤Ï 4.2BSD ¤Ç»Ï¤á¤Æ¸½¤ï¤ì¤¿). +POSIX.1-2008 ¤Ç¤Ï¡¢ +.BR getitimer () +¤È +.BR setitimer () +¤ÏÇÑ»ßͽÄê¤È¤µ¤ì¤Æ¤ª¤ê¡¢ +Âå¤ï¤ê¤Ë POSIX ¥¿¥¤¥Þ¡¼ API +.RB ( timer_gettime (2), +.BR timer_settime (2) +¤Ê¤É) ¤ò»È¤¦¤³¤È¤¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤Î¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¡¼¤ò·Ñ¾µ¤·¤Ê¤¤¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¤Ï¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¡¼¤ÏÊݸ¤µ¤ì¤ë¡£ + +POSIX.1 ¤Ç¤Ï¡¢ +.BR setitimer () +¤È¡¢ +.BR alarm (2), +.BR sleep (3), +.BR usleep (3) +¤È¤¤¤¦ 3 ¤Ä¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤È¤ÎÁê¸ß¤Î±Æ¶Á¤Ë¤Ä¤¤¤Æ¤Ïµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Ð¥° +¥·¥°¥Ê¥ë¤ÎÀ¸À®¤ÈÇÛÁ÷¤ÏÊ̸ĤΤâ¤Î¤Ç¤¢¤ê¡¢ +Á°½Ò¤Î¥·¥°¥Ê¥ë¤Î¤½¤ì¤¾¤ì¤Ë¤Ä¤¤¤Æ°ì¤Ä¤À¤±¤¬¥×¥í¥»¥¹¤Î¤¿¤á¤Ë +ÂÔµ¡¤¹¤ë¡£ +Èó¾ï¤Ë½Å¤¤Éé²Ù¤Î²¼¤Ç¤Ï¡¢ +.B ITIMER_REAL +¥¿¥¤¥Þ¡¼¤Ç¤Ï¡¢»þ´ÖÀÚ¤ì¤Ë¤è¤êÀ¸À®¤µ¤ì¤¿°ì¤ÄÁ°¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ëÁ°¤Ë¡¢ +¼¡¤Î»þ´ÖÀڤ줬µ¯¤³¤ë¾ì¹ç¤¬¤¢¤ë¡£ +¤½¤Î¤è¤¦¤Ê¾ì¹ç¡¢ 2 ¸Ä¤á¤Î¥¤¥Ù¥ó¥È¤ËÂФ¹¤ë¥·¥°¥Ê¥ë¤Ï¼º¤ï¤ì¤Æ¤·¤Þ¤¦¡£ + +¥Ð¡¼¥¸¥ç¥ó 2.6.16 ¤è¤êÁ°¤Î Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¥¿¥¤¥Þ¡¼¤ÎÃÍ¤Ï jiffy ¤Çɽ¸½¤µ¤ì¤ë¡£ +Í׵᤬ jiffy ɽ¸½¤Ç +.RI ( include/linux/jiffies.h +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë) +.B MAX_SEC_IN_JIFFIES +¤ò±Û¤¨¤ëÃͤò¥¿¥¤¥Þ¡¼¤ËÀßÄꤷ¤è¤¦¤È¤¹¤ë¤â¤Î¤Î¾ì¹ç¡¢ +¥¿¥¤¥Þ¡¼¤Ï°ÅÌۤˤ³¤Î¾å¸ÂÃͤËÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +Linux/i386 ¤Î¾ì¹ç (Linux 2.6.13 °Ê¹ß¤Ç¤Ï jiffy ¤Ï 0.004 ÉÃ) ¤Î¾ì¹ç¡¢ +¤³¤ì¤Ï¥¿¥¤¥Þ¡¼¤Î¾å¸ÂÃͤ¬¤ª¤è¤½ 99.42 Æü¤Ë¤Ê¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +Linux 2.6.16 °Ê¹ß¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤Ï»þ´Ö¤Ë´Ø¤¹¤ëÆâÉôɽ¸½¤È¤·¤Æ +°Û¤Ê¤ëɽ¸½¤ò»È¤¦¤è¤¦¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢¤³¤Î¾å¸Â¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£ + +(i386 ¤ò´Þ¤à) ¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +¥Ð¡¼¥¸¥ç¥ó 2.6.12 °ÊÁ°¤Î Linux ¥«¡¼¥Í¥ë¤Ï +¤¢¤ë¼ï¤Î¾õ¶·¤Ç¤Ï 1 jiffy Á᤯¥¿¥¤¥Þ¡¼¤¬½ªÎ»¤·¤Æ¤·¤Þ¤¦¤È¤¤¤¦¥Ð¥°¤¬¤¢¤Ã¤¿¡£ +¤³¤Î¥Ð¥°¤Ï¥«¡¼¥Í¥ë 2.6.12 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ +.\" 4 Jul 2005: It looks like this bug may remain in 2.4.x. +.\" http://lkml.org/lkml/2005/7/1/165 + +POSIX.1-2001 ¤Ç¤Ï +.BR setitimer () +¤Ï +.I tv_usec +¤ÎÃͤ¬ 0 ¤«¤é 999999 ¤ÎÈϰϳ°¤Ç¤¢¤ë¾ì¹ç¤Ë¤Ï¼ºÇÔ¤¹¤ë¤Ù¤­¤À¤È¤·¤Æ¤¤¤ë¡£ +¤·¤«¤·¡¢2.6.21 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Î Linux ¤Ç¤Ï¥¨¥é¡¼¤Ë¤Ê¤é¤º¡¢ +Âбþ¤¹¤ëÉÿô¤Îʬ¤À¤±¤½¤Î¥¿¥¤¥Þ¡¼¤ÎÉäÎÃͤ¬°ÅÌÛ¤ËÄ´À°¤µ¤ì¤ë¡£ +¥«¡¼¥Í¥ë 2.6.22 °Ê¹ß¤Ç¤Ï¡¢¤³¤Îɸ½àÈó½àµò¤ÎÆ°ºî¤Ï½¤Àµ¤µ¤ì¡¢ +.I tv_usec +¤ÎÃͤ¬ÉÔŬÀڤʾì¹ç¤Ë¤Ï +.B EINVAL +¥¨¥é¡¼¤È¤Ê¤ë¡£ +.\" Bugzilla report 25 Apr 2006: +.\" http://bugzilla.kernel.org/show_bug.cgi?id=6443 +.\" "setitimer() should reject noncanonical arguments" +.SH ´ØÏ¢¹àÌÜ +.BR gettimeofday (2), +.BR sigaction (2), +.BR signal (2), +.BR timer_create (2), +.BR timerfd_create (2), +.BR time (7) diff --git a/release/man2/getpagesize.2 b/release/man2/getpagesize.2 new file mode 100644 index 00000000..b15e1d73 --- /dev/null +++ b/release/man2/getpagesize.2 @@ -0,0 +1,112 @@ +.\" 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 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getpagesize \- ¥á¥â¥ê¤Î¥Ú¡¼¥¸¡¦¥µ¥¤¥º¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.B int getpagesize(void); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR getpagesize (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.BR getpagesize () +´Ø¿ô¤Ï¥Ú¡¼¥¸¤ÎÂ礭¤µ¤ò¥Ð¥¤¥È¿ô¤ÇÊÖ¤¹¡£¤³¤³¤Ç¤Î¡Ö¥Ú¡¼¥¸¡×¤Ï +.BR mmap (2) +¤ÎÀâÌÀ¤ÎÃæ¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¤â¤Î¤Ç¡¢ +.BR mmap () +¤Ï¤³¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤Îñ°Ì¤Ç¥Õ¥¡¥¤¥ë¤ò¥Þ¥Ã¥×¤¹¤ë¡£ + +.BR mmap (2) +¤¬»ÈÍѤ¹¤ë¥Ú¡¼¥¸¥µ¥¤¥º¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ + +.in +4n +.nf +#include +long sz = sysconf(_SC_PAGESIZE); +.fi +.in + +(¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤Ç¤Ï +.B _SC_PAGESIZE +¤ÎƱµÁ¸ì¤È¤·¤Æ +.B _SC_PAGE_SIZE +¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë)¡¢¤â¤·¤¯¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë: + +.in +4n +.nf +#include +int sz = getpagesize(); +.fi +.in +.\" .SH Îò»Ë +.\" ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï 4.2BSD ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +SVr4, 4.4BSD, SUSv2. +SUSv2 ¤Ç¤Ï +.BR getpagesize () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡Ö²áµî¤Î°äʪ (LEGACY)¡×¤È¤µ¤ì¤Æ¤ª¤ê¡¢ +POSIX.1-2001 ¤«¤é¤Ï³°¤µ¤ì¤Æ¤¤¤ë¡£ +HP-UX ¤Ë¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¸ºß¤·¤Ê¤¤¡£ +°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÂå¤ï¤ê¤Ë +.I sysconf(_SC_PAGESIZE) +¤òÍøÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR getpagesize () +¤¬ Linux ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤·¤Æ¸ºß¤¹¤ë¤«¤É¤¦¤«¤Ï¡¢¤½¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë +°Í¸¤·¤Æ¤¤¤ë¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤·¤Æ¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢¥«¡¼¥Í¥ë¥·¥ó¥Ü¥ë¤Î +.B PAGE_SIZE +¤òÊÖ¤¹¡£ +.B PAGE_SIZE +¤ÎÃͤϡ¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤È¥Þ¥·¥ó¥â¥Ç¥ë¤Ë°Í¸¤¹¤ë¡£ +°ìÈ̤ˡ¢¥Ð¥¤¥Ê¥ê¤Ï¡¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤´¤È¤Ë1¤Ä¤Î¥Ð¥¤¥Ê¥êÇÛÉۤǺѤޤ»¤ë¤¿¤á¤Ë¡¢ +¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤Ï°Í¸¤·¤Æ¤¤¤ë¤¬¥Þ¥·¥ó¥â¥Ç¥ë¤Ë¤Ï°Í¸¤·¤Æ¤¤¤Ê¤¤¡£ +¤Ä¤Þ¤ê¡¢¥æ¡¼¥¶¥×¥í¥°¥é¥à¤Ï¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤«¤é +.B PAGE_SIZE +¤ò¸«¤Ä¤±¤Æ»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¾¯¤Ê¤¯¤È¤â¡¢¥Þ¥·¥ó¥â¥Ç¥ë¤Ë¤Ä¤¤¤Æ¤â°Í¸À­¤¬Â¸ºß¤¹¤ë (sun4 ¤Î¤è¤¦¤Ê) +¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤¤¤Æ¤ÏËÜʪ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ÈÍѤ¹¤ëɬÍפ¬¤¢¤ë¡£ +¾°¡¢ libc4, libc5, glibc 2.0 ¤Ç¤Ï¡¢ +.BR getpagesize () +¤¬¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò»ÈÍѤ»¤º¡¢¸ÇÄê¤ÎÃͤòÊÖ¤¹¤¿¤á¤Ë¡¢¤³¤ÎÊýË¡¤Ï +¼ºÇÔ¤¹¤ë¡£glibc 2.1 ¤Ç¤ÏÂç¾æÉפǤ¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mmap (2), +.BR sysconf (3) diff --git a/release/man2/getpeername.2 b/release/man2/getpeername.2 new file mode 100644 index 00000000..81184e60 --- /dev/null +++ b/release/man2/getpeername.2 @@ -0,0 +1,135 @@ +.\" 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. +.\" +.\" @(#)getpeername.2 6.5 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 16:37:50 1993 by Rik Faith +.\" Modified Thu Jul 30 14:37:50 1993 by Martin Schulze +.\" Modified Sun Mar 28 21:26:46 1999 by Andries Brouwer +.\" Modified 17 Jul 2002, Michael Kerrisk +.\" Added 'socket' to NAME, so that "man -k socket" will show this page. +.\" +.\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Apr 3 14:53:19 JST 1999 +.\" by HANATAKA Shinya +.\" Updated Tue Nov 26 JST 2002 by Kentaro Shirakata +.\" +.\"WORD: connect Àܳ +.\"WORD: peer Áê¼ê +.\"WORD: socket ¥½¥±¥Ã¥È +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡ +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: argument °ú¤­¿ô +.\" +.TH GETPEERNAME 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getpeername \- Àܳ¤·¤Æ¤¤¤ëÁê¼ê¥½¥±¥Ã¥È¤Î̾Á°¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int getpeername(int " sockfd ", struct sockaddr *" addr \ +", socklen_t *" addrlen ); +.SH ÀâÌÀ +.BR getpeername () +¤Ï¡¢¥½¥±¥Ã¥È(socket) +.I sockfd +¤ËÀܳ¤·¤Æ¤¤¤ëÁê¼ê¤Î¥¢¥É¥ì¥¹¤ò¡¢ +.I addr +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.I addrlen +°ú¤­¿ô¤Ï¡¢ +.I addr +¤¬»Ø¤·¤Æ¤¤¤ëÎΰè¤Î¥µ¥¤¥º¤Ë½é´ü²½¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +´Ø¿ô¤¬ÊÖ¤ë»þ¤Ë¤Ï¡¢ +.I addrlen +¤Ë¤Ï¼ÂºÝ¤ËÊÖ¤µ¤ì¤¿Ì¾Á°¤Î¥µ¥¤¥º¤¬ (¥Ð¥¤¥Èñ°Ì¤Ç) ³ÊǼ¤µ¤ì¤ë¡£ +Ä󶡤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ¤¹¤®¤¿¾ì¹ç¤Ë¤Ï¡¢Ì¾Á°¤ÏÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ + +ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ²á¤®¤¿¾ì¹ç¤Ï¡¢ÊÖ¤µ¤ì¤ë¥¢¥É¥ì¥¹¤ÎËöÈø¤¬ÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I addrlen +¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·»þ¤Ë»ØÄꤵ¤ì¤¿Ãͤè¤ê¤âÂ礭¤ÊÃͤ¬³ÊǼ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +°ú¤­¿ô +.I sockfd +¤¬Í­¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EFAULT +.I addr +°ú¤­¿ô¤Î»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤¬Í­¸ú¤Ê¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î +°ìÉô¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.I addrlen +¤¬ÉÔÀµ¤Ç¤¢¤ë (Î㤨¤Ð¡¢Éé¤Ç¾ì¹ç¤Ê¤É)¡£ +.TP +.B ENOBUFS +¤³¤ÎÁàºî¤ò¹Ô¤Ê¤¦¤Î¤Ë½½Ê¬¤Ê»ñ¸»¤¬¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOTCONN +¥½¥±¥Ã¥È¤¬Àܳ¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTSOCK +°ú¤­¿ô +.I sockfd +¤¬¥½¥±¥Ã¥È¤Ç¤Ê¤¯¤Æ¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.SH ½àµò +SVr4, 4.4BSD +.RB ( getpeername () +´Ø¿ô¤Ï 4.2BSD ¤ÇÅо줷¤¿), POSIX.1-2001. +.SH Ãí°Õ +.BR getpeername () +¤Î»°ÈÖÌܤΰú¤­¿ô¤Ï¼ÂºÝ¤Ë¤Ï +.I `int *' +¤Ç¤¢¤ë (4.x BSD, libc4, libc5 ¤Ç¤Ï +¤³¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë)¡£ +POSIX ¤Ç¤Ïäþ;¶ÊÀÞ¤ò·Ð¤Æ¸½ºß¤Î +.I socklen_t +¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +glibc ¤Ç¤â +.I socklen_t +¤ò»È¤Ã¤Æ¤¤¤ë¡£ +.BR accept (2) +¤â»²¾È¤Î¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR accept (2), +.BR bind (2), +.BR getsockname (2), +.BR ip (7), +.BR socket (7), +.BR unix (7) diff --git a/release/man2/getpid.2 b/release/man2/getpid.2 new file mode 100644 index 00000000..46427ddc --- /dev/null +++ b/release/man2/getpid.2 @@ -0,0 +1,114 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" 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 SUTO, Mitsuaki +.\" and Copyright(c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jun 26 20:33:01 JST 1997 +.\" by SUTO, Mitsuaki +.\" Updated 2008-10-03, Akihiro MOTOKI, LDP v3.10 +.\" +.TH GETPID 2 2008-09-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getpid, getppid \- ¥×¥í¥»¥¹ ID ¤òÆÀ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.B pid_t getpid(void); +.br +.B pid_t getppid(void); +.SH ÀâÌÀ +.BR getpid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤òÊÖ¤¹¡£(¥Æ¥ó¥Ý¥é¥êÍѤΥե¡¥¤¥ë̾¤È¤·¤Æ +¾¤È½Å¤Ê¤é¤Ê¤¤Ì¾Á°¤òÀ¸À®¤¹¤ë¥ë¡¼¥Á¥ó¤Ç¤·¤Ð¤·¤Ð»ÈÍѤµ¤ì¤ë¡£) + +.BR getppid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¿Æ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.SH ½àµò +POSIX.1-2001, 4.3BSD, SVr4. +.SH Ãí°Õ +glibc ¥Ð¡¼¥¸¥ç¥ó 2.3.4 °Ê¹ß¤Ç¤Ï¡¢ +glibc ¤Î +.BR getpid () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï PID ¤ò¥­¥ã¥Ã¥·¥å¤¹¤ë¡£ +¤³¤ì¤Ï¡¢¥×¥í¥»¥¹¤¬·«¤êÊÖ¤· +.BR getpid () +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤Ë¤½¤ÎÅÔÅÙ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ö¤Î¤òÈò¤±¤ë¤¿¤á¤Ç¤¢¤ë¡£ +Ä̾ï¤Ï¡¢¤³¤Î¥­¥ã¥Ã¥·¥å½èÍý¤¬¸«¤¨¤ë¤³¤È¤Ï¤Ê¤¤¤¬¡¢ +¥­¥ã¥Ã¥·¥å½èÍý¤¬Àµ¤·¤¯Æ¯¤¯¤¿¤á¤Ë¤Ï +.BR fork (2), +.BR vfork (2), +.BR clone (2) +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ç¤Î¥µ¥Ý¡¼¥È¤¬É¬ÍפǤ¢¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë¡¢ +glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤ò·Ðͳ¤»¤º¤Ë +.BR syscall (2) +¤ò»È¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢»Ò¥×¥í¥»¥¹¤Ç +.BR getpid () +¤ò¸Æ¤Ó½Ð¤¹¤È´Ö°ã¤Ã¤¿Ãͤ¬Ê֤뤳¤È¤À¤í¤¦ +(Àµ³Î¤Ë¤¤¤¦¤È¡¢¿Æ¥×¥í¥»¥¹¤Î PID ¤¬ÊÖ¤µ¤ì¤ë)¡£ +.\" The following program demonstrates this "feature": +.\" +.\" #define _GNU_SOURCE +.\" #include +.\" #include +.\" #include +.\" #include +.\" #include +.\" +.\" int +.\" main(int argc, char *argv[]) +.\" { +.\" /* The following statement fills the getpid() cache */ +.\" +.\" printf("parent PID = %ld\n", (long) getpid()); +.\" +.\" if (syscall(SYS_fork) == 0) { +.\" if (getpid() != syscall(SYS_getpid)) +.\" printf("child getpid() mismatch: getpid()=%ld; " +.\" "syscall(SYS_getpid)=%ld\n", +.\" (long) getpid(), (long) syscall(SYS_getpid)); +.\" exit(EXIT_SUCCESS); +.\" } +.\" wait(NULL); +.\"} +.BR clone (2) +¤ò glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô·Ðͳ¤Çµ¯Æ°¤·¤¿ºÝ¤Ë¤â +.BR getpid () +¤¬´Ö°ã¤Ã¤¿ÃͤòÊÖ¤¹¾ì¹ç¤¬¤¢¤ê¡¢¤³¤ì¤Ë´Ø¤¹¤ëµÄÏÀ¤Ï +.BR clone (2) +¤â»²¾È¤·¤Æ¤Û¤·¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR fork (2), +.BR kill (2), +.BR exec (3), +.BR mkstemp (3), +.BR tempnam (3), +.BR tmpfile (3), +.BR tmpnam (3), +.BR credentials (7) diff --git a/release/man2/getpriority.2 b/release/man2/getpriority.2 new file mode 100644 index 00000000..df3bd35d --- /dev/null +++ b/release/man2/getpriority.2 @@ -0,0 +1,239 @@ +.\" Copyright (c) 1980, 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. +.\" +.\" @(#)getpriority.2 6.9 (Berkeley) 3/10/91 +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-07-01 by Andries Brouwer +.\" Modified 1996-11-06 by Eric S. Raymond +.\" Modified 2001-10-21 by Michael Kerrisk +.\" Corrected statement under EPERM to clarify privileges required +.\" Modified 2002-06-21 by Michael Kerrisk +.\" Clarified meaning of 0 value for 'who' argument +.\" Modified 2004-05-27 by Michael Kerrisk +.\" +.\" FIXME Oct 2008: Denys Vlasenko is working on a PRIO_THREAD feature that +.\" is likely to get included in mainline; this will need to be documented. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-22, HANATAKA Shinya +.\" Modified 2001-08-17, HANATAKA Shinya +.\" Modified 2001-10-18, Akihiro MOTOKI +.\" Updated 2001-12-13, Kentaro Shirakata +.\" Updated 2002-10-16, Kentaro Shirakata +.\" Updated 2005-02-24, Akihiro MOTOKI +.\" Updated 2005-10-07, Akihiro MOTOKI +.\" Updated 2008-08-04, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: scheduling ¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +.\"WORD: piority Í¥ÀèÅÙ +.\"WORD: call ¥³¡¼¥ë +.\"WORD: user-ID UID +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: user ¥æ¡¼¥¶¡¼ +.\"WORD: super user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\"WORD: effective user-ID ¼Â¸úUID +.\"WORD: real user-ID ¼ÂUID +.\" +.TH GETPRIORITY 2 2008-05-29 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getpriority, setpriority \- ¥×¥í¥°¥é¥à¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ÎÍ¥ÀèÅÙ¤ò¼èÆÀ/ÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int getpriority(int " which ", int " who ); +.br +.BI "int setpriority(int " which ", int " who ", int " prio ); +.SH ÀâÌÀ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR getpriority () +¤ä +.BR setpriority () +¤Ï¡¢ +.I which +¤È +.I who +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¡¢¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¢¥æ¡¼¥¶¡¼¤Î +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Í¥ÀèÅÙ (scheduling priority) ¤Î +¼èÆÀ¤äÀßÄê¤ò¤½¤ì¤¾¤ì¹Ô¤¦¡£ + +.I which +¤ÎÃÍ¤Ï +.BR PRIO_PROCESS , +.BR PRIO_PGRP , +.BR PRIO_USER , +¤Î¤É¤ì¤«°ì¤Ä¤Ç¡¢ +.I who +¤Ï +.I which +¤Ë±þ¤¸¤Æ²ò¼á¤µ¤ì¤ë +.RB ( PRIO_PROCESS +¤À¤È¥×¥í¥»¥¹¼±Ê̻ҡ¢ +.B PRIO_PGRP +¤À¤È¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¼±Ê̻ҡ¢ +.B PRIO_USER +¤À¤È UID (¥æ¡¼¥¶ID) ¤È²ò¼á¤µ¤ì¤ë)¡£ +.I who +¤¬¥¼¥í¤Ê¤é¤Ð¡¢(¤½¤ì¤¾¤ì)¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼ÂUID ¤ò°ÕÌ£¤¹¤ë¡£ +.I prio +¤Ï \-20 ¤«¤é 19 ¤ÎÈϰϤÎÃÍ¤Ç (⤷°Ê²¼¤ÎÃí°Õ¤Î¹à¤ò»²¾È¤Î¤³¤È)¡¢ +¥Ç¥Õ¥©¥ë¥È¤ÎÍ¥ÀèÅÙ¤Ï 0 ¤Ç¤¢¤ë; +¾®¤µ¤Ê¿ô»ú¤Û¤É¡¢Í­Íø¤Ê¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤È¤Ê¤ë¡£ + +.BR getpriority () +¥³¡¼¥ë¤Ï»ØÄꤷ¤¿¥×¥í¥»¥¹¤ÎÃæ¤ÎºÇ¤â¹â¤¤Í¥ÀèÅÙ (¿ôÃÍŪ¤Ë¤ÏºÇ¾®¤ÎÃÍ) ¤òÊÖ¤¹¡£ +.BR setpriority () +¥³¡¼¥ë¤Ï»ØÄꤷ¤¿¥×¥í¥»¥¹Á´¤Æ¤ÎÍ¥ÀèÅÙ¤ò»ØÄꤷ¤¿ÃͤËÀßÄꤹ¤ë¡£ +Í¥ÀèÅÙ¤òº£¤è¤ê¾®¤µ¤¤ÃͤËÀßÄê¤Ç¤­¤ë¤Î¤Ï¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤À¤±¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR getpriority () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤â \-1 ¤ÎÃͤòÊÖ¤¹²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¡¢ +¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë³°ÉôÊÑ¿ô¤Î +.I errno +¤ò¥¯¥ê¥¢¤·¡¢¸Æ¤Ó½Ð¤·¤Î¸å¤ËÊÖ¤êÃͤΠ\-1 ¤¬ÀµÅö¤ÊÃͤ« +¥¨¥é¡¼¤«¤òȽÊ̤¹¤ëɬÍפ¬¤¢¤ë¡£ +.BR setpriority () +¥³¡¼¥ë¤Ï¥¨¥é¡¼¤¬¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤¬¤¢¤ì¤Ð \-1 ¤òÊÖ¤¹¡£ + +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I which +¤¬ +.BR PRIO_PROCESS , +.BR PRIO_PGRP , +.B PRIO_USER +¤Î¤¤¤º¤ì¤Ç¤â¤Ê¤¤¡£ +.TP +.B ESRCH +.I which +¤È +.I who +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +.PP +¾åµ­¤Î¤â¤Î¤Ë²Ã¤¨¤Æ +.BR setpriority () +¤Ç¤Ï°Ê²¼¤Î¥¨¥é¡¼¤¬¤¢¤ë: +.TP +.B EACCES +¸Æ¤Ó½Ð¤·¸µ¤¬¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤ò²¼¤²¤è¤¦¤È¤·¤¿¤¬¡¢É¬ÍפÊÆø¢¤ò +»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿ (Linux ¤Î¾ì¹ç¡¢ +.B CAP_SYS_NICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤«¤Ã¤¿)¡£ +Linux 2.6.12 °Ê¹ß¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤¬¡¢¤¢¤ë¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤ò¡¢ +Êѹ¹ÂÐ¾Ý¤Î¥×¥í¥»¥¹¤Î¥ê¥½¡¼¥¹ +.B RLIMIT_NICE +¤Î¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤ÎÈϰϳ°¤ËÀßÄꤷ¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¤Î¤ß¡¢ +¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¡£¾ÜºÙ¤Ï +.BR getrlimit (2) +¤ò»²¾È¡£ +.TP +.B EPERM +¥×¥í¥»¥¹¤Ï¸«¤Ä¤«¤Ã¤¿¤¬¡¢¤½¤Î¥×¥í¥»¥¹¤Î¼Â¸ú (effective) UID ¤¬ +¸Æ¤Ó½Ð¤·¸µ¤Î¼Â¸úUID ¤Ë¤â¼Â (real) UID ¤Ë¤â°ìÃפ»¤º¡¢ +¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢¤â»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿ (Linux ¤Î¾ì¹ç¡¢ +.B CAP_SYS_NICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤«¤Ã¤¿)¡£ +°Ê²¼¤Î¡ÖÃí°Õ¡×¤â»²¾È¤Î¤³¤È¡£ +.SH ½àµò +SVr4, 4.4BSD (¤³¤ì¤é¤Î´Ø¿ô¤Ï 4.2BSD ¤ÇºÇ½é¤ËÅо줷¤¿), +POSIX.1-2001. +.SH Ãí°Õ +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤Î nice Ãͤò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç nice ÃͤÏÊݸ¤µ¤ì¤ë¡£ + +ÁêÂÐŪ¤Ê nice Ãͤΰ㤤¤¬¥×¥í¥»¥¹´Ö¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ë¤É¤ÎÄøÅٱƶÁ¤òÍ¿¤¨¤ë¤« +¤Ï¡¢Unix ¥·¥¹¥Æ¥à´Ö¤Ç°Û¤Ê¤ê¡¢Linux ¤Ç¤Ï¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê°Û¤Ê¤ë¡£ +Linux ¤Ï¡¢¥«¡¼¥Í¥ë 2.6.23 °Ê¹ß¤Ç¡¢nice ÃͤÎÁêÂÐŪ¤Ê°ã¤¤¤¬¡¢Èó¾ï¤Ë¶¯¤¤±Æ¶Á¤ò +Í¿¤¨¤ë¥¢¥ë¥´¥ê¥º¥à¤òºÎÍѤ·¤¿¡£¤³¤Î¥¢¥ë¥´¥ê¥º¥à¤Ç¤Ï¡¢ +¾¤ËÍ¥ÀèÅ٤ι⤤¤â¤Î¤¬¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë»þ¤Ë¤Ï¡¢ +Èó¾ï¤ËÄ㤤 nice ÃÍ (+19) ¤Ç¤Ï¥×¥í¥»¥¹¤ËËÜÅö¤Ë¤Û¤È¤ó¤É CPU ¤¬³ä¤êÅö¤Æ¤é¤ì¤Ê¤¤¡£ +¤Þ¤¿¡¢¹â¤¤ nice ÃÍ (\-20) ¤Ç¤Ï CPU ¤òɬÍפȤ¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó (Î㤨¤Ð +¥ª¡¼¥Ç¥£¥ª¡¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó) ¤Ë CPU ¤Î¤Û¤È¤ó¤É¤¬³ä¤êÅö¤Æ¤é¤ì¤ë¡£ + +.B EPERM +¤¬È¯À¸¤¹¤ë¾ò·ï¤Î¾ÜºÙ¤Ï¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¡£ +¾åµ­¤ÎÀâÌÀ¤Ï POSIX.1-2001 ¤Î¤â¤Î¤Ç¤¢¤ê¡¢Á´¤Æ¤Î System V É÷¥·¥¹¥Æ¥à¤Ï +¤³¤ì¤Ë½¾¤Ã¤Æ¤¤¤ë¤è¤¦¤Ç¤¢¤ë¡£ +2.6.12 ¤è¤êÁ°¤Î Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¼Â UID ¤Þ¤¿¤Ï +¼Â¸ú UID ¤¬¥×¥í¥»¥¹ \fIwho\fP ¤Î (¼Â¸ú UID ¤Ç¤Ê¤¯) +¼Â UID ¤Ë°ìÃפ¹¤ëɬÍפ¬¤¢¤ë¡£ +Linux 2.6.12 °Ê¹ß¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¼Â¹Ô UID ¤¬¥×¥í¥»¥¹ \fIwho\fP +¤Î¼Â UID ¤«¼Â¸ú UID ¤Î¤¤¤º¤ì¤«¤È°ìÃפ¹¤ëɬÍפ¬¤¢¤ë¡£ +Á´¤Æ¤Î BSD É÷¥·¥¹¥Æ¥à (SunOS 4.1.3, Ultrix 4.2, +4.3BSD, FreeBSD 4.3, OpenBSD-2.5Åù) ¤Ï¡¢ +Linux 2.6.12 °Ê¹ß¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¡£ +.LP +¼ÂºÝ¤ÎÍ¥ÀèÅÙ¤ÎÃͤÎÈϰϤϥ«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +1.3.36 ¤è¤êÁ°¤Î Linux ¤Ç¤Ï¡¢Í¥ÀèÅÙ¤ÎÈϰϤÏÉé¤Î̵¸ÂÂç ¡Á 15 ¤Ç¤¢¤ë¡£ +1.3.43 °Ê¹ß¤Î Linux ¤Ç¤Ï¡¢Í¥ÀèÅÙ¤ÎÈÏ°Ï¤Ï \-20 ¡Á 19 ¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ëÆâÉô¤Ç¤Ï¡¢nice ÃÍ¤Ï¼ÂºÝ¤Ë¤Ï 40 ¡Á 1 ¤ÎÈϰϤò»È¤Ã¤Æ +ɽ¸½¤µ¤ì¤Æ¤ª¤ê (Éé¤ÎÃͤϥ¨¥é¡¼¥³¡¼¥É¤È¤Ê¤ë¤¿¤á)¡¢¤³¤Á¤é¤ÎÃͤ¬ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR setpriority () +¤È +.BR getpriority () +¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +glibc ¤Î¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ë¤ª¤¤¤Æ¡¢nice ÃͤΠ+¥æ¡¼¥¶Îΰè (user-land) ¤È¥«¡¼¥Í¥ëɽ¸½¤Î´Ö¤ÎÊÑ´¹¤¬¹Ô¤ï¤ì¤ë¡£ +ÊÑ´¹¼°¤Ï°Ê²¼¤ÎÄ̤ê: +.I "unice\ =\ 20\ \-\ knice" +.LP +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢nice ÃͤÎÈÏ°Ï¤Ï \20 ¡Á 20 ¤Ç¤¢¤ë¡£ +.LP +¸½ºß¤Ç¤Ï +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëɬÍפϤʤ¤¤¬¡¢¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ì¤Ð°Ü¿¢À­¤ò¹â¤á¤ë¤³¤È¤¬¤Ç¤­¤ë +(¼ÂºÝ¤Ë¤Ï +.I +¤Ç +.I rusage +¹½Â¤ÂΤ¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¤½¤Î¥Õ¥£¡¼¥ë¥É¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë +.I struct timeval +·¿¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +.SH ´ØÏ¢¹àÌÜ +.BR nice (1), +.BR fork (2), +.BR capabilities (7), +.BR renice (8) +.sp +(Linux 2.6.23 °Ê¹ß¤Î) ¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¥Ä¥ê¡¼Æâ¤Î +.I Documentation/scheduler/sched-nice-design.txt diff --git a/release/man2/getresuid.2 b/release/man2/getresuid.2 new file mode 100644 index 00000000..33048969 --- /dev/null +++ b/release/man2/getresuid.2 @@ -0,0 +1,89 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl) +.\" 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. +.\" +.\" Modified, 2003-05-26, Michael Kerrisk, +.\" +.\" 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 Sat Aug 30 14:47:25 JST 1997 +.\" by HANATAKA Shinya +.\" Updated Sun Oct 12 JST 2003 by Kentaro Shirakata +.\" +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: real user ID ¼Â¥æ¡¼¥¶¡¼ID +.\"WORD: saved user ID Êݸ¥æ¡¼¥¶¡¼ID +.\"WORD: effective group ID ¼Â¸ú¥°¥ë¡¼¥×ID +.\"WORD: real group ID ¼Â¥°¥ë¡¼¥×ID +.\"WORD: saved group ID Êݸ¥°¥ë¡¼¥×ID +.\" +.TH GETRESUID 2 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getresuid, getresgid \- ¼Â¡¢¼Â¸ú¡¢Êݸ¡¢¥æ¡¼¥¶¡¼ ID / ¥°¥ë¡¼¥× ID ¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int getresuid(uid_t *" ruid ", uid_t *" euid ", uid_t *" suid ); +.br +.BI "int getresgid(gid_t *" rgid ", gid_t *" egid ", gid_t *" sgid ); +.SH ÀâÌÀ +.BR getresuid () +¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â (real) UID¡¢¼Â¸ú (effective) UID¡¢ +Êݸ (saved) set-user-ID +.RB ( getresgid +¤Î¾ì¹ç¤Ï¥°¥ë¡¼¥× ID) ¤ò¡¢ +¤½¤ì¤¾¤ì°ú¤­¿ô +.IR ruid , +.IR euid , +.I suid +¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.BR getresgid () +¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥°¥ë¡¼¥× ID ¤Ë¤Ä¤¤¤ÆƱÍͤνèÍý¤ò¹Ô¤¦¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +»ØÄꤷ¤¿°ú¤­¿ô¤Î¤É¤ì¤«¤¬¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥°¥é¥à¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Î +¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.1.44 ¤«¤é Linux ¤ËÅо줷¤¿¡£ + +¥×¥í¥È¥¿¥¤¥×Àë¸À¤Ï 2.3.2 °Ê¹ß¤Î glibc ¤Ç¤Ï +.B _GNU_SOURCE +¤òÄêµÁ¤·¤Æ¤¤¤ë¤ÈÆÀ¤é¤ì¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥³¡¼¥ë¤ÏÈóɸ½à¤Ç¤¢¤ë¡£ +HP-UX ¤ä BSD ·Ï¤Î¤¤¤¯¤Ä¤«¤Ë¤â¸ºß¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getuid (2), +.BR setresuid (2), +.BR setreuid (2), +.BR setuid (2), +.BR credentials (7), +.BR feature_test_macros (7) diff --git a/release/man2/getrlimit.2 b/release/man2/getrlimit.2 new file mode 100644 index 00000000..ed270a63 --- /dev/null +++ b/release/man2/getrlimit.2 @@ -0,0 +1,527 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt, March 28, 1992 +.\" and Copyright (c) 2002, 2004, 2005, 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-23 by Rik Faith +.\" Modified 1996-01-13 by Arnt Gulbrandsen +.\" Modified 1996-01-22 by aeb, following a remark by +.\" Tigran Aivazian +.\" Modified 1996-04-14 by aeb, following a remark by +.\" Robert Bihlmeyer +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 2001-05-04 by aeb, following a remark by +.\" Havard Lygre +.\" Modified 2001-04-17 by Michael Kerrisk +.\" Modified 2002-06-13 by Michael Kerrisk +.\" Added note on nonstandard behavior when SIGCHLD is ignored. +.\" Modified 2002-07-09 by Michael Kerrisk +.\" Enhanced descriptions of 'resource' values for [gs]etrlimit() +.\" Modified 2003-11-28 by aeb, added RLIMIT_CORE +.\" Modified 2004-03-26 by aeb, added RLIMIT_AS +.\" Modified 2004-06-16 by Michael Kerrisk +.\" Added notes on CAP_SYS_RESOURCE +.\" +.\" 2004-11-16 -- mtk: the getrlimit.2 page, which formally included +.\" coverage of getrusage(2), has been split, so that the latter +.\" is now covered in its own getrusage.2. +.\" +.\" Modified 2004-11-16, mtk: A few other minor changes +.\" Modified 2004-11-23, mtk +.\" Added notes on RLIMIT_MEMLOCK, RLIMIT_NPROC, and RLIMIT_RSS +.\" to "CONFORMING TO" +.\" Modified 2004-11-25, mtk +.\" Rewrote discussion on RLIMIT_MEMLOCK to incorporate kernel +.\" 2.6.9 changes. +.\" Added note on RLIMIT_CPU error in older kernels +.\" 2004-11-03, mtk, Added RLIMIT_SIGPENDING +.\" 2005-07-13, mtk, documented RLIMIT_MSGQUEUE limit. +.\" 2005-07-28, mtk, Added descriptions of RLIMIT_NICE and RLIMIT_RTPRIO +.\" 2008-05-07, mtk / Peter Zijlstra, Added description of RLIMIT_RTTIME +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-22, HANATAKA Shinya +.\" Updated and Modified 2001-06-02, Yuichi SATO +.\" Updated and Modified 2001-08-18, Yuichi SATO +.\" Updated and Modified 2002-08-25, Yuichi SATO +.\" Updated and Modified 2004-01-17, Yuichi SATO +.\" Updated and Modified 2004-12-30, Yuichi SATO +.\" Updated and Modified 2005-09-10, Yuichi SATO +.\" Updated and Modified 2005-10-11, Akihiro MOTOKI +.\" Updated and Modified 2005-10-27, Akihiro MOTOKI +.\" Updated and Modified 2006-04-15, Akihiro MOTOKI, Catch up to LDP v2.29 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-10-13, Akihiro MOTOKI, LDP v3.11 +.\" +.\"WORD: resource »ñ¸» +.\"WORD: limit À©¸Â +.\" +.TH GETRLIMIT 2 2008-10-06 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getrlimit, setrlimit \- »ñ¸»¤ÎÀ©¸Â¤ò¼èÆÀ/ÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int getrlimit(int " resource ", struct rlimit *" rlim ); +.br +.BI "int setrlimit(int " resource ", const struct rlimit *" rlim ); +.SH ÀâÌÀ +.BR getrlimit () +¤È +.BR setrlimit () +¤Ï¤½¤ì¤¾¤ì»ñ¸» (resource) ¤ÎÀ©¸Â (limit) ¤ÎÀßÄê¤È¼èÆÀ¤ò¹Ô¤¦¡£ +³Æ¥ê¥½¡¼¥¹¤Ë¤Ï¡¢¤½¤ì¤ËÂбþ¤¹¤ë¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤È¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤¬¤¢¤ë¡£ +¥ê¥ß¥Ã¥È¤Ï +.RB ( getrlimit () +¤È +.BR setrlimit () +¤Î +.I rlim +°ú¤­¿ô¤Ç¤¢¤ë) +.I rlimit +¹½Â¤ÂΤÇÄêµÁ¤µ¤ì¤ë: +.PP +.in +4n +.nf +struct rlimit { + rlim_t rlim_cur; /* ¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È */ + rlim_t rlim_max; /* ¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È + (rlim_cur ¤è¤ê¾®¤µ¤¯¤Ê¤¤) */ +}; + +.fi +.in +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Ï¡¢¥«¡¼¥Í¥ë¤¬Âбþ¤¹¤ë¥ê¥½¡¼¥¹¤ËÂФ·¤Æ²Ý¤¹À©¸ÂÃͤǤ¢¤ë¡£ +¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤Ï¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Î¾å¸Â¤È¤·¤ÆƯ¤¯¡£ +Æø¢¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹¤Ï¡¢¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤ÎÃͤò +0 ¤«¤é¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ÎÈϰϤËÀßÄꤹ¤ë¤³¤È¤È¡¢ +¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ò²¼¤²¤ë¤³¤È¤Î¤ß¤¬¤Ç¤­¤ë +(°ìÅÙ²¼¤²¤¿¥Ï¡¼¥É¥ê¥ß¥Ã¥È¤Ï¾å¤²¤é¤ì¤Ê¤¤)¡£ +Æø¢¥×¥í¥»¥¹ (Linux ¤Ç¤Ï +.B CAP_SYS_RESOURCE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Ï +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤È¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ò¼«Í³¤ËÊѹ¹¤Ç¤­¤ë¡£ +.PP +ÃÍ +.B RLIM_INFINITY +¤Ï¥ê¥½¡¼¥¹¤ËÀ©¸Â¤¬¤Ê¤¤¤³¤È¤òɽ¤¹ +(¤³¤ÎÃÍ¤Ï +.BR getrlimit () +¤¬ÊÖ¤¹¹½Â¤ÂÎ¤È +.BR setrlimit () +¤ËÅϤ¹¹½Â¤ÂΤÎξÊý¤Ç»ÈÍѤµ¤ì¤ë)¡£ +.PP +.I resource +¤Ï¼¡¤Î¤¤¤º¤ì¤« 1 ¤Ä¤Ç¤¢¤ë¡£ +.TP +.B RLIMIT_AS +¥×¥í¥»¥¹¤Î²¾ÁÛ¥á¥â¥ê (¥¢¥É¥ì¥¹¶õ´Ö) ¤ÎºÇÂ祵¥¤¥º (¥Ð¥¤¥Èñ°Ì)¡£ +.\" 2.0.27 / 2.1.12 °Ê¹ß¡£ +¤³¤ÎÀ©¸Â¤Ï +.BR brk (2), +.BR mmap (2), +.BR mremap (2) +¤Î¸Æ¤Ó½Ð¤·¤Ë±Æ¶Á¤·¡¢¤³¤ÎÀ©¸Â¤òĶ¤¨¤¿¾ì¹ç¤Ï +¥¨¥é¡¼ +.B ENOMEM +¤Ç¼ºÇÔ¤¹¤ë¡£ +¤Þ¤¿¼«Æ°Åª¤Ê¥¹¥¿¥Ã¥¯³ÈÄ¥¤Ë¤â¼ºÇÔ¤¹¤ë +(¤µ¤é¤Ë +.BR sigaltstack (2) +¤ò»È¤Ã¤¿ÂåÂØ¥¹¥¿¥Ã¥¯¤òÍøÍѲÄǽ¤Ë¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +.B SIGSEGV +¤òÀ¸À®¤·¤Æ¤½¤Î¥×¥í¥»¥¹¤ò kill ¤¹¤ë)¡£ +¤³¤ÎÃÍ¤Ï \fIlong\fP ·¿¤Ê¤Î¤Ç¡¢32 ¥Ó¥Ã¥È¤Î \fIlong\fP ·¿¤ò»ý¤Ä¥Þ¥·¥ó¤Ç¤Ï¡¢ +¤³¤ÎÀ©¸Â¤ÏºÇÂç¤Ç 2 GiB ¤Ë¤Ê¤ë¤«¡¢¤³¤Î»ñ¸»¤¬ÌµÀ©¸Â¤Ë¤Ê¤ë¡£ +.TP +.B RLIMIT_CORE +.I core +¥Õ¥¡¥¤¥ë¤ÎºÇÂ祵¥¤¥º¡£ +0 ¤Î¾ì¹ç¡¢core ¥Õ¥¡¥¤¥ë¤ÏÀ¸À®¤µ¤ì¤Ê¤¤¡£ +0 °Ê³°¤Î¾ì¹ç¡¢¤³¤Î¥µ¥¤¥º¤è¤êÂ礭¤¤¥À¥ó¥×¤ÏÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.TP +.B RLIMIT_CPU +CPU »þ´Ö¤Î¾å¸Â (Éÿô)¡£ +¥×¥í¥»¥¹¤¬¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Ë㤷¤¿¾ì¹ç¤Ë¡¢ +.B SIGXCPU +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +¤³¤Î¥·¥°¥Ê¥ë¤ËÂФ¹¤ë¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¡¢¥×¥í¥»¥¹¤Î½ªÎ»¤Ç¤¢¤ë¡£ +¤¿¤À¤·¥·¥°¥Ê¥ë¤ò¥­¥ã¥Ã¥Á¤·¤Æ¡¢¥Ï¥ó¥É¥é¤¬¥á¥¤¥ó¥×¥í¥°¥é¥à¤Ë +À©¸æ¤òÊÖ¤¹¤³¤È¤â¤Ç¤­¤ë¡£ +¥×¥í¥»¥¹¤¬ CPU »þ´Ö¤ò»È¤¤Â³¤±¤¿¾ì¹ç¤Ï¡¢ +¥Ï¡¼¥É¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤Þ¤Ç 1 ÉÃËè¤Ë¥×¥í¥»¥¹¤Ë +.B SIGXCPU +¤òÁ÷¤ê¡¢ +¥Ï¡¼¥É¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤È +.B SIGKILL +¤òÁ÷¤ë¡£ +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤òĶ²á¤·¤¿¤È¤­¤ÎÆ°ºî¤Ï¡¢ +Linux 2.2 ¤«¤é 2.6 ¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤òĶ¤¨¤Æ CPU »þ´Ö¤ò»È¤¤Â³¤±¤ë¥×¥í¥»¥¹¤Î +°·¤¤Êý¤Ë¤Ä¤¤¤Æ¤Î¼ÂÁõ¤ÏÊѲ½¤·¤Æ¤­¤Æ¤¤¤ë¡£ +¤³¤Î¥·¥°¥Ê¥ë¤ò¥­¥ã¥Ã¥Á¤¹¤ëɬÍפΤ¢¤ë +°Ü¿¢À­¤ò¹Í¤¨¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +ºÇ½é¤Ë +.B SIGXCPU +¤ò¼õ¤±¼è¤Ã¤¿»þÅÀ¤ÇÀµ¤·¤¯½ªÎ»¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B RLIMIT_DATA +¥×¥í¥»¥¹¤Î¥Ç¡¼¥¿¥»¥°¥á¥ó¥È +(½é´ü²½¤µ¤ì¤¿¥Ç¡¼¥¿¡¦½é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ç¡¼¥¿¡¦¥Ò¡¼¥×) ¤ÎºÇÂçÃÍ¡£ +¤³¤Î¥ê¥ß¥Ã¥È¤Ï +.BR brk (2) +¤È +.BR sbrk (2) +¤Î¸Æ¤Ó½Ð¤·¤Ë±Æ¶Á¤¹¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤³¤Î¥ê¥½¡¼¥¹¤Î¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤È¡¢ +¥¨¥é¡¼ +.B ENOMEM +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.B RLIMIT_FSIZE +¥×¥í¥»¥¹¤¬ºîÀ®¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ÎºÇÂçÃÍ¡£ +¤³¤Î¥µ¥¤¥º¤òĶ¤¨¤Æ¥Õ¥¡¥¤¥ë¤ò³ÈÄ¥¤¹¤ë¤È¡¢ +.B SIGXFSZ +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î¥·¥°¥Ê¥ë¤Ï¥×¥í¥»¥¹¤ò½ªÎ»¤¹¤ë¡£ +¥×¥í¥»¥¹¤ò¥­¥ã¥Ã¥Á¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¤¬¡¢ +´ØÏ¢¤¹¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë +.RB ( write (2), +.BR truncate (2) +¤Ê¤É) ¤Ï¥¨¥é¡¼ +.B EFBIG +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.BR RLIMIT_LOCKS " (½é´ü¤Î Linux 2.4 ¤Î¤ß)" +.\" Àµ³Î¤Ë¤Ï Linux 2.4.0-test9 ¤Î¤ß¡£2.4.25 / 2.5.65 ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤³¤Î¥×¥í¥»¥¹¤¬¼Â¹Ô¤Ç¤­¤ë +.BR flock (2) +¥í¥Ã¥¯¿ô¤È +.BR fcntl (2) +¥ê¡¼¥¹¿ô¤Î¹ç·×ÃͤòÀ©¸Â¤¹¤ë¡£ +.TP +.B RLIMIT_MEMLOCK +RAM Æâ¤Ë¥í¥Ã¥¯¤Ç¤­¤ë¥á¥â¥ê¤ÎºÇÂç¥Ð¥¤¥È¿ô¡£ +¼ÂºÝ¤Ë¤Ï¡¢¤³¤ÎÀ©¸Â¤Ï¥·¥¹¥Æ¥à¥Ú¡¼¥¸¥µ¥¤¥º¤ÎºÇ¤â¶á¤¤ÇÜ¿ô¤Ë +ÀÚ¤ê¼Î¤Æ¤Æ´Ý¤á¤é¤ì¤ë¡£ +¤³¤ÎÀ©¸Â¤Ï +.BR mlock (2), +.BR mlockall (2), +.BR mmap (2) +¤Î +.B MAP_LOCKED +Áàºî¤Ë±Æ¶Á¤¹¤ë¡£ +Linux 2.6.9 °Ê¹ß¤Ç¤Ï +.BR shmctl (2) +.B SHM_LOCK +Áàºî¤Ë¤â±Æ¶Á¤¹¤ë¡£ +¤³¤ÎÁàºî¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â (real) ¥æ¡¼¥¶¡¼ ID ¤Ë¥í¥Ã¥¯¤µ¤ì¤ë +¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È +.RB ( shmget (2) +¤ò»²¾È) ¤Î¹ç·×¥Ð¥¤¥È¿ô¤ÎºÇÂçÃͤòÀßÄꤹ¤ë¡£ +.BR shmctl (2) +.B SHM_LOCK +¤Ë¤è¤ë¥í¥Ã¥¯¤Ï¡¢ +.BR mlock (2), +.BR mlockall (2), +.BR mmap (2) +¤Î +.B MAP_LOCKED +¤Ë¤è¤Ã¤Æ³ÎΩ¤µ¤ì¤ë¥×¥í¥»¥¹Ëè¤Î¥á¥â¥ê¥í¥Ã¥¯¤È¤Ïʬ¤±¤Æ¿ô¤¨¤ë¡£ +1 ¤Ä¤Î¥×¥í¥»¥¹¤Ï¤³¤ÎÀ©¸Â¤Þ¤Ç¤Î¥Ð¥¤¥È¤ò¥í¥Ã¥¯¤Ç¤­¤ë¡£ +¤³¤ÎÀ©¸Â¤Ë¤Ï 2 ¤Ä¤Î¼ïÎब¤¢¤ë¡£ +2.6.9 ¤è¤êÁ°¤Î Linux ¥«¡¼¥Í¥ë ¤Ç¤Ï¡¢ +¤³¤ÎÀ©¸Â¤ÏÆø¢¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤µ¤ì¤ë¥á¥â¥ê¤Î¹ç·×¤òÀ©¸æ¤·¤Æ¤¤¤¿¡£ +Linux 2.6.9 °Ê¹ß¤Ç¤Ï¡¢Æø¢¥×¥í¥»¥¹¤¬¥í¥Ã¥¯¤¹¤ë¥á¥â¥ê¤Î¹ç·×¤ËÀ©¸Â¤Ï¤Ê¤¯¡¢ +Âå¤ï¤ê¤Ë¤³¤ÎÀ©¸Â¤ÏÈóÆø¢¥×¥í¥»¥¹¤¬¥í¥Ã¥¯¤¹¤ë¥á¥â¥ê¤Î¹ç·×¤Ë +ŬÍѤµ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +.TP +.BR RLIMIT_MSGQUEUE " (Linux 2.6.8 °Ê¹ß)" +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤ËÂФ·¤Æ¡¢ +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¤¿¤á¤Ë³ÎÊݤǤ­¤ë¥Ð¥¤¥È¿ô¤ÎÀ©¸Â¤ò»ØÄꤹ¤ë¡£ +¤³¤ÎÀ©¸Â¤Ï +.BR mq_open (3) +¤ËÂФ·¤ÆŬÍѤµ¤ì¤ë¡£ +¥æ¡¼¥¶¤¬ºîÀ®¤·¤¿³Æ¡¹¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¥Ð¥¤¥È¿ô¤Ï +°Ê²¼¤Î¼°¤Ë¤è¤ê·×»»¤µ¤ì¡¢(¤½¤Î¥­¥å¡¼¤¬ºï½ü¤µ¤ì¤ë¤Þ¤Ç¤Î´Ö) +¤³¤ÎÀ©¸Â¤Î·×»»Âоݤ˴ޤá¤é¤ì¤ë¡£ +.nf + + bytes = attr.mq_maxmsg * sizeof(struct msg_msg *) + + attr.mq_maxmsg * attr.mq_msgsize + +.fi +¤³¤³¤Ç +.I attr +¤Ï +.I mq_attr +¹½Â¤ÂΤǤ¢¤ê¡¢ +.BR mq_open (3) +¤ÎÂè 4 °ú¤­¿ô¤È¤·¤Æ»ØÄꤵ¤ì¤ë¡£ + +.I "sizeof(struct msg_msg *)" +(Linux/i386 ¤Ç¤Ï 4 ¥Ð¥¤¥È) ¤ò´Þ¤àºÇ½é¤Î²Ã¿ô¤Ï¡¢ +¥æ¡¼¥¶¡¼¤¬Ä¹¤µ 0 ¤Î¥á¥Ã¥»¡¼¥¸¤ò̵À©¸Â¤Ëºî¤ì¤Ê¤¤¤³¤ÈÊݾڤ·¤Æ¤¤¤ë +(¤³¤Î¤è¤¦¤Ê¥á¥Ã¥»¡¼¥¸¤Ç¤¢¤Ã¤Æ¤â¡¢ +µ­Ï¿¤Î¤¿¤á¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤Ç¥·¥¹¥Æ¥à¥á¥â¥ê¤ò¾ÃÈñ¤¹¤ë)¡£ +.TP +.BR RLIMIT_NICE " (Linux 2.6.12 °Ê¹ß, ²¼µ­¤Î¡Ö¥Ð¥°¡×¤ÎÀá¤â»²¾È)" +.BR setpriority (2) +¤ä +.BR nice (2) +¤ò»È¤Ã¤Æ°ú¤­¾å¤²¤é¤ì¤ë¥×¥í¥»¥¹¤Î nice Ãͤξå¸Â¤ò»ØÄꤹ¤ë¡£ +nice Ãͤμºݤξå¸Â¤Ï +.I "20\ \-\ rlim_cur" +¤Ç·×»»¤µ¤ì¤ë +(¤³¤Î¤è¤¦¤ÊÊѤʾõ¶·¤Ï¡¢¥ê¥½¡¼¥¹À©¸ÂÃͤȤ·¤ÆÉé¤Î¿ô¤ò»ØÄê¤Ç¤­¤Ê¤¤¤¿¤á +ȯÀ¸¤¹¤ë¡£Ä̾Éé¤ÎÃͤÏÆÃÊ̤ʰÕÌ£¤ò»ý¤Ã¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢Ä̾ï¤Ï +.B RLIM_INFINITY +¤ÎÃÍ¤Ï \-1 ¤Ç¤¢¤ë)¡£ +.TP +.B RLIMIT_NOFILE +¤³¤Î¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¿ô¤ÎºÇÂçÃͤè¤ê +1 Â礭¤¤Ãͤò»ØÄꤹ¤ë¡£ +.RB ( open (2), +.BR pipe (2), +.BR dup (2) +¤Ê¤É¤Ë¤è¤ê) ¤³¤Î¾å¸Â¤òĶ¤¨¤è¤¦¤È¤·¤¿¾ì¹ç¡¢¥¨¥é¡¼ +.B EMFILE +¤¬È¯À¸¤¹¤ë +(Îò»ËŪ¤Ë¡¢BSD ¤Ç¤Ï¤³¤Î¾å¸Â¤Ï +.B RLIMIT_OFILE +¤È¤¤¤¦Ì¾Á°¤È¤Ê¤Ã¤Æ¤¤¤ë)¡£ +.TP +.B RLIMIT_NPROC +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤ÇºîÀ®¤Ç¤­¤ëºÇÂç¥×¥í¥»¥¹¿ô +(¤è¤êÀµ³Î¤Ë¤Ï Linux ¤Ç¤Ï¥¹¥ì¥Ã¥É¿ô)¡£ +¤³¤Î¾å¸Â¤Ë㤹¤ë¤È¡¢ +.BR fork (2) +¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.B RLIMIT_RSS +¥×¥í¥»¥¹¤Î resident set (RAM ¾å¤Ë¸ºß¤¹¤ë²¾ÁÛ¥Ú¡¼¥¸¤Î¿ô) ¤Î +¾å¸Â¤ò (¥Ú¡¼¥¸¿ô¤Ç) »ØÄꤹ¤ë¡£ +¤³¤ÎÀ©¸Â¤Ï 2.4.30 ¤è¤êÁ°¤Ç¤·¤«±Æ¶Á¤¬¤Ê¤¯¡¢ +.BR madvise (2) +¤Ë +.B MADV_WILLNEED +¤ò»ØÄꤷ¤¿´Ø¿ô¥³¡¼¥ë¤Ë¤·¤«±Æ¶Á¤·¤Ê¤¤¡£ +.\" ¥«¡¼¥Í¥ë 2.6.12 ¤Î»þÅÀ¤Ç¤Ï¡¢ +.\" ¤³¤ÎÀ©¸Â¤Ï¥«¡¼¥Í¥ë 2.6 ¤Ç¤Ï¤Þ¤À²¿¤â¹Ô¤ï¤Ê¤¤¡£ +.\" ¤·¤«¤·¡¢²¿¤ò¤µ¤»¤ë¤«¤Ë¤Ä¤¤¤Æ¤Ï LKML ¤Ç»þ¡¹ÏÃÂê¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" -- MTK, Jul 05 +.TP +.BR RLIMIT_RTPRIO " (Linux 2.6.12 °Ê¹ß, ¥Ð¥°¤ÎÀá¤â»²¾È)" +.BR sched_setscheduler (2) +¤ä +.BR sched_setparam (2) +¤ò»È¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥ê¥¢¥ë¥¿¥¤¥àÍ¥ÀèÅ٤ξå¸Â¤ò»ØÄꤹ¤ë¡£ +.TP +.BR RLIMIT_RTTIME " (Linux 2.6.25 °Ê¹ß)" +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤ë¥×¥í¥»¥¹¤¬ +¥Ö¥í¥Ã¥­¥ó¥°·¿¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤µ¤º¤Ë¾ÃÈñ¤¹¤ë¤³¤È¤Î¤Ç¤­¤ë +CPU »þ´Ö¤Î¹ç·×¤Ë¤Ä¤¤¤Æ¤Î¾å¸Â¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¾å¸Â¤ÎÌÜŪ¤Î¤¿¤á¡¢¥×¥í¥»¥¹¤¬¥Ö¥í¥Ã¥­¥ó¥°·¿¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò +¸Æ¤Ó½Ð¤¹Å٤ˡ¢¾ÃÈñ¤µ¤ì¤¿ CPU »þ´Ö¤Î¥«¥¦¥ó¥È¤Ï 0 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +¥×¥í¥»¥¹¤¬ CPU ¤ò»È¤¤Â³¤±¤è¤¦¤È¤·¤¿¤¬Â¾¤Î¥×¥í¥»¥¹¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿ +(preempted) ¾ì¹ç¤ä¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥¿¥¤¥à¥¹¥é¥¤¥¹¤¬Ëþλ¤·¤¿¾ì¹ç¡¢ +¤½¤Î¥×¥í¥»¥¹¤¬ +.BR sched_yield (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤Ï¡¢CPU »þ´Ö¤Î¥«¥¦¥ó¥È¤Ï¥ê¥»¥Ã¥È¤µ¤ì¤Ê¤¤¡£ + +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Ë +.B SIGXCPU +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£¤½¤Î¥×¥í¥»¥¹¤¬¤³¤Î¥·¥°¥Ê¥ë¤òÊ᪤¹¤ë¤« +̵»ë¤·¤Æ¡¢CPU »þ´Ö¤ò¾ÃÈñ¤·Â³¤±¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤Þ¤Ç 1 ÉÃ¤Ë 1 ²ó +.B SIGXCPU +¤¬À¸À®¤µ¤ì³¤±¤ë¤³¤È¤Ë¤Ê¤ë¡£ +¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤Ë㤷¤¿»þÅÀ¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤Ë¤Ï +.B SIGKILL +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ + +¤³¤Î¾å¸Â¤ò°Õ¿ÞŪ¤Ë»ÈÍѤ¹¤ë¤Î¤Ï¡¢Ë½Áö¤·¤¿¥ê¥¢¥ë¥¿¥¤¥à¡¦¥×¥í¥»¥¹¤ò +Ää»ß¤·¤Æ¡¢¥·¥¹¥Æ¥à¤¬Æ°¤«¤Ê¤¯¤Ê¤ë¤Î¤òÈò¤±¤ë¾ì¹ç¤Ç¤¢¤ë¡£ +.TP +.BR RLIMIT_SIGPENDING " (Linux 2.6.8 °Ê¹ß)" +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤ËÂФ·¤Æ +¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¥·¥°¥Ê¥ë¤Î¿ô¤ÎÀ©¸Â¤ò»ØÄꤹ¤ë¡£ +¤³¤ÎÀ©¸Â¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤¿¤á¡¢ +ɸ½à¥·¥°¥Ê¥ë¤È¥ê¥¢¥ë¥¿¥¤¥à¡¦¥·¥°¥Ê¥ë¤ÎξÊý¤¬¥«¥¦¥ó¥È¤µ¤ì¤ë¡£ +¤·¤«¤·¡¢¤³¤ÎÀ©¸Â¤Ï +.BR sigqueue (2) +¤ËÂФ·¤Æ¤·¤«¶¯À©¤µ¤ì¤º¡¢ +.BR kill (2) +»È¤¦¤³¤È¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ¤Þ¤À¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤Æ¤¤¤Ê¤¤ +¥·¥°¥Ê¥ë¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ò¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\" ¤³¤ì¤Ï¥«¡¼¥Í¥ë 2.6.7 °ÊÁ°¤Ë¸ºß¤¹¤ë¥·¥¹¥Æ¥àÁ´ÂΤÎÀ©¸Â +.\" /proc/sys/kernel/rtsig-max ¤òÃÖ¤­´¹¤¨¤ë¡£MTK Dec 04 +.TP +.B RLIMIT_STACK +¥×¥í¥»¥¹¡¦¥¹¥¿¥Ã¥¯¤ÎºÇÂ祵¥¤¥º¤ò¥Ð¥¤¥Èñ°Ì¤Ç»ØÄꤹ¤ë¡£ +¤³¤Î¾å¸Â¤Ë㤹¤ë¤È¡¢ +.B SIGSEGV +¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤ë¡£ +¤³¤Î¥·¥°¥Ê¥ë¤ò°·¤¦¤¿¤á¤Ë¤Ï¡¢ +¥×¥í¥»¥¹¤ÏÂå¤ê¤Î¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯ +.RB ( sigaltstack (2)) +¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +Linux 2.6.23 °Ê¹ß¤Ç¤Ï¡¢¤³¤ÎÀ©¸Â¤Ï¥×¥í¥»¥¹¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤È´Ä¶­ÊÑ¿ô +¤Ë»ÈÍѤµ¤ì¤ë¶õ´Ö¤Î¹ç·×¥µ¥¤¥º¤Î¾å¸Â¤Î·èÄê¤Ë¤â»ÈÍѤµ¤ì¤ë¡£¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR execve (2) +¤ò»²¾È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I rlim +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I resource +¤¬Í­¸ú¤Ç¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.BR setrlimit () +¤Ç¡¢ +.I rlim\->rlim_cur +¤¬ +.I rlim\->rlim_max +¤è¤ê¤âÂ礭¤«¤Ã¤¿¡£ +.TP +.B EPERM +Æø¢¤Î¤Ê¤¤¥×¥í¥»¥¹¤¬ +.BR setrlimit () +¤ò»ÈÍѤ·¤Æ +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Þ¤¿¤Ï¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ò +¸½ºß¤Î¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤è¤êÂ礭¤¯¤·¤è¤¦¤È»î¤ß¤¿¡£ +¤³¤ì¤ò¹Ô¤¦¤¿¤á¤Ë¤Ï +.B CAP_SYS_RESOURCE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +¤Þ¤¿¤ÏÆø¢¤Î¤Ê¤¤¥×¥í¥»¥¹¤¬ +.BR setrlimit () +¤ò»ÈÍѤ·¤Æ +¥½¥Õ¥È¤Þ¤¿¤Ï¥Ï¡¼¥É +.B RLIMIT_NOFILE +¥ê¥ß¥Ã¥È¤ò¸½ºß¤Î¥«¡¼¥Í¥ë¤ÎºÇÂçÃÍ +.RB ( NR_OPEN ) +°Ê¾å¤ËÁý²Ã¤µ¤»¤è¤¦¤È¤·¤¿¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.B RLIMIT_MEMLOCK +¤È +.B RLIMIT_NPROC +¤Ï BSD ¤«¤éÇÉÀ¸¤·¡¢POSIX.1-2001 ¤Ë¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤ì¤é¤Ï BSD ·Ï¤È Linux ¤Ë¸ºß¤¹¤ë¤¬¡¢Â¾¤Î¼ÂÁõ¤Ï¾¯¤Ê¤¤¡£ +.R RLIMIT_RSS +¤Ï BSD ¤«¤éÇÉÀ¸¤·¡¢POSIX.1-2001 ¤Ë¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤½¤ì¤Ë¤â´Ø¤ï¤é¤ºÂ¿¤¯¤Î¼ÂÁõ¤Ç¸ºß¤¹¤ë¡£ +.BR RLIMIT_MSGQUEUE , +.BR RLIMIT_NICE , +.BR RLIMIT_RTPRIO , +.BR RLIMIT_RTTIME , +.B RLIMIT_SIGPENDING +¤Ï Linux ¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿ºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤Î¥ê¥½¡¼¥¹À©¸Â¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¥ê¥½¡¼¥¹À©¸Â¤ÏÊݸ¤µ¤ì¤ë¡£ + +¥·¥§¥ë¤Î¥ê¥½¡¼¥¹À©¸Â¤Ï¡¢¥·¥§¥ë¤ÎÁȤ߹þ¤ß¥³¥Þ¥ó¥É¤Ç¤¢¤ë +.I ulimit +.RB ( csh (1) +¤Ç¤Ï +.I limit ) +¤ò»È¤Ã¤ÆÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥·¥§¥ë¤Î¥ê¥½¡¼¥¹À©¸Â¤Ï¡¢¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¥·¥§¥ë¤¬À¸À®¤¹¤ë¥×¥í¥»¥¹ +¤Ë°ú¤­·Ñ¤¬¤ì¤ë¡£ +.SH ¥Ð¥° +°ÊÁ°¤Î Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥×¥í¥»¥¹¤¬¥½¥Õ¥È¤Þ¤¿¤Ï¥Ï¡¼¥É +.B RLIMIT_CPU +¥ê¥ß¥Ã¥È¤Ë㤷¤¿¾ì¹ç¤ËÁ÷¤é¤ì¤ë +.B SIGXCPU +¤È +.B SIGKILL +¥·¥°¥Ê¥ë¤¬¡¢ËÜÍèÁ÷¤é¤ì¤ë¤Ù¤­»þÅÀ¤Î 1 (CPU) Éøå¤ËÁ÷¤é¤ì¤Æ¤·¤Þ¤¦¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ë 2.6.8 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ + +2.6.17 ¤è¤êÁ°¤Î 2.6.x ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.B RLIMIT_CPU +¥ê¥ß¥Ã¥È¤¬ 0 ¤Î¾ì¹ç¡¢ +.RB ( RLIM_INFINITY +¤ÈƱ¤¸¤è¤¦¤Ë) ¡ÖÀ©¸Â¤Ê¤·¡×¤È´Ö°ã¤Ã¤Æ²ò¼á¤µ¤ì¤Æ¤¤¤¿¡£ +Linux 2.6.17 °Ê¹ß¤Ç¤Ï¡¢¥ê¥ß¥Ã¥È¤ò 0 ¤ËÀßÄꤷ¤¿¾ì¹ç¤Ë¤â +¸ú²Ì¤ò»ý¤Ä¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¬¡¢¼ÂºÝ¤Ë¤Ï¥ê¥ß¥Ã¥È¤ÎÃÍ¤Ï 1 ÉäȤʤ롣 +.\" see http://marc.theaimsgroup.com/?l=linux-kernel&m=114008066530167&w=2 + +¥«¡¼¥Í¥ë 2.6.12 ¤Ë¤Ï¡¢ +.B RLIMIT_RTPRIO +¤¬Æ°ºî¤·¤Ê¤¤¤È¤¤¤¦¥Ð¥°¤¬¤¢¤ë¡£¤³¤ÎÌäÂê¤Ï¥«¡¼¥Í¥ë 2.6.13 ¤Ç½¤Àµ¤µ¤ì¤Æ¤¤¤ë¡£ + +¥«¡¼¥Í¥ë 2.6.12 ¤Ç¤Ï¡¢ +.BR getpriority (2) +¤È +.B RLIMIT_NICE +¤¬ÊÖ¤¹Í¥ÀèÅÙ¤ÎÈϰϤ¬°ì¤Ä¤º¤ì¤Æ¤¤¤¿¡£¤³¤Î¤¿¤á¡¢nice Ãͤμºݤξå¸Â¤¬ +.I "19\ \-\ rlim_cur" +¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¤È¤¤¤¦±Æ¶Á¤¬¤¢¤Ã¤¿¡£¤³¤ì¤Ï¥«¡¼¥Í¥ë 2.6.13 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ +.\" »²¹Í: http://marc.theaimsgroup.com/?l=linux-kernel&m=112256338703880&w=2 + +2.4.22 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.I rlim\->rlim_cur +¤¬ +.I rlim\->rlim_max +¤è¤êÂ礭¤«¤Ã¤¿¾ì¹ç¡¢ +.BR setrlimit () +¤Ç¤Î +.B EINVAL +¥¨¥é¡¼¤ò¸¡½Ð¤Ç¤­¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR dup (2), +.BR fcntl (2), +.BR fork (2), +.BR getrusage (2), +.BR mlock (2), +.BR mmap (2), +.BR open (2), +.BR quotactl (2), +.BR sbrk (2), +.BR shmctl (2), +.BR sigqueue (2), +.BR malloc (3), +.BR ulimit (3), +.BR core (5), +.BR capabilities (7), +.BR signal (7) diff --git a/release/man2/getrusage.2 b/release/man2/getrusage.2 new file mode 100644 index 00000000..1fe387dc --- /dev/null +++ b/release/man2/getrusage.2 @@ -0,0 +1,189 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt, March 28, 1992 +.\" 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. +.\" +.\" 2004-11-16 -- mtk: the getrlimit.2 page, which formerly included +.\" coverage of getrusage(2), has been split, so that the latter is +.\" now covered in its own getrusage.2. For older details of change +.\" history, etc., see getrlimit.2 +.\" +.\" Modified 2004-11-16, mtk, Noted that the nonconformance +.\" when SIGCHLD is being ignored is fixed in 2.6.9. +.\" 2008-02-22, Sripathi Kodi : Document RUSAGE_THREAD +.\" 2008-05-25, mtk, clarify RUSAGE_CHILDREN + other clean-ups. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-22, HANATAKA Shinya +.\" Updated and Modified 2001-06-02, Yuichi SATO +.\" Updated and Modified 2001-08-18, Yuichi SATO +.\" Updated and Modified 2002-08-25, Yuichi SATO +.\" Updated and Modified 2004-01-17, Yuichi SATO +.\" Updated and Modified 2004-12-30, Yuichi SATO +.\" Updated and Modified 2005-09-06, Akihiro MOTOKI +.\" Updated 2008-11-10, Akihiro MOTOKI, LDP v3.11 +.\" +.TH GETRUSAGE 2 2009-08-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getrusage \- »ñ¸»¤Î»ÈÍÑÎ̤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int getrusage(int " who ", struct rusage *" usage ); +.SH ÀâÌÀ +.PP +.BR getrusage () +¤Ï +.I who +¤Î»ñ¸» (resource) ¤Î»ÈÍÑÎ̤òÊÖ¤¹¡£ +.I who +¤Ë¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄê¤Ç¤­¤ë¡£ +.TP +.B RUSAGE_SELF +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î»ñ¸»»ÈÍÑÎÌ¡¢ +¤½¤Î¥×¥í¥»¥¹Æâ¤ÎÁ´¥¹¥ì¥Ã¥É¤¬»ÈÍѤ·¤Æ¤¤¤ë»ñ¸»¤Î¹ç·×¤òÊÖ¤¹¡£ + +Á°¼Ô¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥ê¥½¡¼¥¹»ÈÍÑÎ̤òÍ׵ᤷ¡¢ +¸å¼Ô¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î»Ò¶¡¤Î¤¦¤Á +½ªÎ»¤·¤ÆÂÔ¤Á¾õÂ֤ˤ¢¤ë¥×¥í¥»¥¹¤Î»ÈÍÑÎ̤òÍ׵᤹¤ë¡£ +.TP +.B RUSAGE_CHILDREN +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î¤¦¤Á¡¢ +½ªÎ»¤·¤ÆÂÔ¤Á¾õÂ֤ˤ¢¤ëÁ´¥×¥í¥»¥¹¤¬»ÈÍѤ·¤Æ¤¤¤ë»ñ¸»»ÈÍÑÎ̤ÎÅý·×¤òÊÖ¤¹¡£ +¤³¤ì¤é¤ÎÅý·×¾ðÊó¤Ë¤Ï¡¢Â¹¥×¥í¥»¥¹¤ä¤½¤Î»Ò¹¤Î¥×¥í¥»¥¹¤Î¤¦¤Á¡¢ +ºï½üÂÔ¤Á¤Î¤â¤Î¤¬»ÈÍѤ·¤Æ¤¤¤ë»ñ¸»¤â´Þ¤Þ¤ì¤ë¡£ +.TP +.BR RUSAGE_THREAD " (Linux 2.6.26 °Ê¹ß)" +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Ë´Ø¤¹¤ë»ñ¸»»ÈÍÑÎ̤ÎÅý·×¤òÊÖ¤¹¡£ +.PP +»ñ¸»»ÈÍÑÎÌ¤Ï +.I usage +¤¬»Ø¤¹¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ +¹½Â¤ÂΤϰʲ¼¤Î·Á¼°¤Ç¤¢¤ë¡£ +.PP +.in +4n +.nf +struct rusage { + struct timeval ru_utime; /* »ÈÍѤµ¤ì¤¿¥æ¡¼¥¶¡¼»þ´Ö */ + struct timeval ru_stime; /* »ÈÍѤµ¤ì¤¿¥·¥¹¥Æ¥à»þ´Ö */ + long ru_maxrss; /* RAM ¾å¤Ë¸ºß¤¹¤ë²¾ÁÛ¥Ú¡¼¥¸¤Î¥µ¥¤¥º + (resident set size) ¤ÎºÇÂçÃÍ */ + long ru_ixrss; /* ¶¦Í­¥á¥â¥ê¤Î¹ç·×¥µ¥¤¥º */ + long ru_idrss; /* Èó¶¦Í­¥Ç¡¼¥¿¤Î¹ç·×¥µ¥¤¥º */ + long ru_isrss; /* Èó¶¦Í­¥¹¥¿¥Ã¥¯¤Î¹ç·×¥µ¥¤¥º */ + long ru_minflt; /* ÍøÍѤµ¤ì¤¿¥Ú¡¼¥¸ */ + long ru_majflt; /* ¥Ú¡¼¥¸¥Õ¥©¡¼¥ë¥È */ + long ru_nswap; /* ¥¹¥ï¥Ã¥× */ + long ru_inblock; /* ¥Ö¥í¥Ã¥¯ÆþÎÏÁàºî */ + long ru_oublock; /* ¥Ö¥í¥Ã¥¯½ÐÎÏÁàºî */ + long ru_msgsnd; /* Á÷¿®¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸ */ + long ru_msgrcv; /* ¼õ¿®¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸ */ + long ru_nsignals; /* ¼õ¿®¤µ¤ì¤¿¥·¥°¥Ê¥ë */ + long ru_nvcsw; /* °Õ¿Þ¤·¤¿¥³¥ó¥Æ¥­¥¹¥ÈÀÚ¤êÂؤ¨ */ + long ru_nivcsw; /* °Õ¿Þ¤·¤Ê¤¤¥³¥ó¥Æ¥­¥¹¥ÈÀÚ¤êÂؤ¨ */ +}; +.fi +.in +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I usage +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I who +¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD. +POSIX.1-2001 ¤Ï +.BR getrusage () +¤òµ¬Äꤷ¤Æ¤¤¤ë¤¬¡¢µ¬Äꤷ¤Æ¤¤¤ë¥Õ¥£¡¼¥ë¥É¤Ï +.I ru_utime +¤È +.I ru_stime +¤À¤±¤Ç¤¢¤ë¡£ + +.B RUSAGE_THREAD +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR execve (2) +¤ÎÁ°¸å¤Ç¥ê¥½¡¼¥¹»ÈÍÑÎ̤λØɸ¤ÏÊÝ»ý¤µ¤ì¤ë¡£ + +º£Æü¤Ç¤Ï +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëɬÍפϤʤ¤¤¬¡¢ +¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ¤ª¤±¤Ð°Ü¿¢À­¤¬Áý¤¹¡£ +(¼ÂºÝ +.I struct timeval +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£) +.PP +2.6.9 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.B SIGCHLD +¤Î½èÍý¤¬ +.B SIG_IGN +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢ +»Ò¥×¥í¥»¥¹¤Î¥ê¥½¡¼¥¹»ÈÍÑÎ̤¬ +.B RUSAGE_CHILDREN +¤ÇÊÖ¤µ¤ì¤ëÃͤ˼«Æ°Åª¤Ë´Þ¤á¤é¤ì¤ë¡£ +¤·¤«¤· POSIX.1-2001 ¤Ç¤Ï¡¢¤³¤ì¤òÌÀ³Î¤Ë¶Ø»ß¤·¤Æ¤¤¤ë¡£ +¤³¤Î½àµò¤·¤Æ¤¤¤Ê¤«¤Ã¤¿ÅÀ¤Ï¡¢Linux 2.6.9 °Ê¹ß¤Ç²þÀµ¤µ¤ì¤¿¡£ +.\" XSH ¤Î getrusage() ¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\" ƱÍͤε­½Ò¤Ï SUSv2 ¤Ë¤â¤¢¤ë¡£ +.LP +¤³¤Î¥Ú¡¼¥¸¤ÎºÇ½é¤Ç¼¨¤·¤¿¹½Â¤ÂΤÎÄêµÁ¤Ï 4.3BSD Reno ¤Î¤â¤Î¤òºÎÍѤ·¤¿¡£ +Linux ¤Ç¤ÏÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤¬°ÕÌ£¤ò»ý¤Ä¤È¤¤¤¦¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +Linux 2.4 ¤Ç¤Ï¡¢¥Õ¥£¡¼¥ë¥É +.IR ru_utime , +.IR ru_stime , +.IR ru_minflt , +.I ru_majflt +¤Î¤ß¤¬¥á¥ó¥Æ¥Ê¥ó¥¹¤µ¤ì¤Æ¤¤¤ë¡£ +Linux 2.6 °Ê¹ß¤Ç¤Ï +.IR ru_nvcsw , +.I ru_nivcsw +¤â¥á¥ó¥Æ¥Ê¥ó¥¹¤µ¤ì¤Æ¤¤¤ë¡£ +Linux 2.6.22 °Ê¹ß¤Ç¤Ï +.IR ru_inblock , +.I ru_oublock +¤â¥á¥ó¥Æ¥Ê¥ó¥¹¤µ¤ì¤Æ¤¤¤ë¡£ + +.BR proc (5) +¤Ë¤¢¤ë +.I /proc/PID/stat +¤ÎÀâÌÀ¤â»²¾È¤Î¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR clock_gettime (2), +.BR getrlimit (2), +.BR times (2), +.BR wait (2), +.BR wait4 (2), +.BR clock (3) diff --git a/release/man2/getsid.2 b/release/man2/getsid.2 new file mode 100644 index 00000000..aaec8860 --- /dev/null +++ b/release/man2/getsid.2 @@ -0,0 +1,89 @@ +.\" Copyright (C) 1996 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. +.\" +.\" Modified Thu Oct 31 14:18:40 1996 by Eric S. Raymond +.\" Modified 2001-12-17, aeb +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Thu Dec 11 23:36:57 JST 1997 +.\" by HANATAKA Shinya +.\" Updated Thu Jan 17 JST 2001 by Kentaro Shirakata +.\" +.\"WORD: session ¥»¥Ã¥·¥ç¥ó +.\"WORD: process ¥×¥í¥»¥¹ +.\" +.TH GETSID 2 2008-12-05 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getsid \- ¥»¥Ã¥·¥ç¥ó ID ¤ò¼èÆÀ¤¹¤ë¡£ +.SH ½ñ¼° +.B #include +.sp +.BI "pid_t getsid(pid_t" " pid" ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR getsid (): +_XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.I getsid(0) +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤òÊÖ¤¹¡£ +.I getsid(p) +¤Ï¥×¥í¥»¥¹ ID +.I p +¤ò»ý¤Ä¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤òÊÖ¤¹ +(¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤Ï ¥»¥Ã¥·¥ç¥ó¥ê¡¼¥À¡¼¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤Ç¤¢¤ë)¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¥»¥Ã¥·¥ç¥ó ID ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\fI(pid_t) \-1\fP ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EPERM +¥×¥í¥»¥¹ ID +.I p +¤Î¥×¥í¥»¥¹¤Ï¸ºß¤¹¤ë¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸¥»¥Ã¥·¥ç¥ó¤Ç¤Ï¤Ê¤¯¡¢ +¤µ¤é¤Ë¼ÂÁõ¤¬¤³¤Î¾õÂÖ¤ò¥¨¥é¡¼¤ÈȽÃǤ·¤¿¾ì¹ç¡£ +.TP +.B ESRCH +¥×¥í¥»¥¹ ID ¤¬ +.I p +¤Î¥×¥í¥»¥¹¤¬¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¥Ð¡¼¥¸¥ç¥ó 2.0 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\" Linux has this system call since Linux 1.3.44. +.\" There is libc support since libc 5.2.19. +.SH ½àµò +SVr4, POSIX.1-2001 +.SH Ãí°Õ +Linux ¤Ï +.B EPERM +¤òÊÖ¤µ¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getpgid (2), +.BR setsid (2), +.BR credentials (7) diff --git a/release/man2/getsockname.2 b/release/man2/getsockname.2 new file mode 100644 index 00000000..f6031f6e --- /dev/null +++ b/release/man2/getsockname.2 @@ -0,0 +1,122 @@ +.\" 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. +.\" +.\" @(#)getsockname.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 16:30:29 1993 by Rik Faith +.\" 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" +.SH ̾Á° +getsockname \- ¥½¥±¥Ã¥È¤Î̾Á°¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getsockname(int " sockfd ", struct sockaddr *" addr \ +", socklen_t *" addrlen ); +.fi +.SH ÀâÌÀ +.BR getsockname () +¤Ï¡¢¥½¥±¥Ã¥È +.I sockfd +¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤¤¤ë¸½ºß¤Î¥¢¥É¥ì¥¹¤ò¡¢ +.I addr +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.I addrlen +°ú¤­¿ô¤Ï¡¢ +.I addr +¤¬»Ø¤·¤Æ¤¤¤ëÎΰè¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤Ë½é´ü²½¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +´Ø¿ô¤¬ÊÖ¤ë»þ¤Ë¤Ï¡¢ +.I addrlen +¤Ë¤Ï¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Î¼ÂºÝ¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤¬³ÊǼ¤µ¤ì¤ë¡£ + +ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ²á¤®¤¿¾ì¹ç¤Ï¡¢ÊÖ¤µ¤ì¤ë¥¢¥É¥ì¥¹¤ÎËöÈø¤¬ÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I addrlen +¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·»þ¤Ë»ØÄꤵ¤ì¤¿Ãͤè¤ê¤âÂ礭¤ÊÃͤ¬³ÊǼ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +°ú¤­¿ô +.I sockfd +¤¬Í­¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿ (descriptor) ¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EFAULT +°ú¤­¿ô +.I addr +¤Î»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤¬¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ÎÍ­¸ú¤ÊÉôʬ¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINVAL +.I addrlen +¤¬ÉÔÀµ¤Ç¤¢¤ë (Î㤨¤Ð¡¢Éé¤Ç¾ì¹ç¤Ê¤É)¡£ +.TP +.B ENOBUFS +½èÍý¤ò¤¹¤ë¤À¤±¤Î½½Ê¬¤Ê¥ê¥½¡¼¥¹¤¬¥·¥¹¥Æ¥à¤Ë̵¤¤¡£ +.TP +.B ENOTSOCK +°ú¤­¿ô +.I sockfd +¤¬¥½¥±¥Ã¥È¤Ç¤Ï¤Ê¤¯¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.SH ½àµò +SVr4, 4.4BSD +.RB ( getsockname () +´Ø¿ô¤Ï 4.2BSD ¤ÇÄɲ䵤줿), POSIX.1-2001. +.\" SVr4 ¤Ë¤Ï¾¤Ë ENOMEM ¤È ENOSR ¤Î¥¨¥é¡¼¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.SH Ãí°Õ +.BR getsockname () +¤Î»°ÈÖÌܤΰú¤­¿ô¤Ï (4.x BSD ¤ä libc4, libc5 ¤ÈƱÍͤË) ¼ÂºÝ¤Ë¤Ï \fIint *\fP +¤Ç¤¢¤ë¡£ glibc ¤Ç¤â»È¤ï¤ì¤Æ¤¤¤ë¸½ºß¤Î \fIsocklen_t\fP ¤Ë´Ø¤·¤Æ¡¢ +POSIX ¤Ë¤Ï¾¯¤·º®Í𤬤¢¤ë¡£ +¾Ü¤·¤¯¤Ï +.BR accept (2) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR bind (2), +.BR socket (2), +.BR getifaddrs (3), +.BR ip (7), +.BR socket (7), +.BR unix (7) diff --git a/release/man2/getsockopt.2 b/release/man2/getsockopt.2 new file mode 100644 index 00000000..dbb9903f --- /dev/null +++ b/release/man2/getsockopt.2 @@ -0,0 +1,212 @@ +.\" 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. +.\" +.\" $Id: getsockopt.2,v 1.1 1999/05/24 14:57:04 freitag Exp $ +.\" +.\" Modified Sat Jul 24 16:19:32 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon Apr 22 02:29:06 1996 by Martin Schulze (joey@infodrom.north.de) +.\" Modified Tue Aug 27 10:52:51 1996 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Thu Jan 23 13:29:34 1997 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Sun Mar 28 21:26:46 1999 by Andries Brouwer (aeb@cwi.nl) +.\" 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" +.SH ̾Á° +getsockopt, setsockopt \- ¥½¥±¥Ã¥È¤Î¥ª¥×¥·¥ç¥ó¤ÎÀßÄê¤È¼èÆÀ¤ò¹Ô¤Ê¤¦ +.SH ½ñ¼° +.nf +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.br +.B #include +.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 ); +.fi +.SH ÀâÌÀ +.BR getsockopt () +¤È +.BR setsockopt () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I socket +¤Ç»²¾È¤µ¤ì¤ë¥½¥±¥Ã¥È¤Ë´ØÏ¢¤¹¤ë¥ª¥×¥·¥ç¥ó¤ÎÁàºî¤ò¹Ô¤¦¡£ +¥ª¥×¥·¥ç¥ó¤ÏÊ£¿ô¤Î¥×¥í¥È¥³¥ëÁØ(level)¤Ë¸ºß¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¤¬¡¢ +¤³¤ì¤é¤Ï¾ï¤ËºÇ¾å°Ì¤Î¥½¥±¥Ã¥ÈÁؤؤÈÀßÄꤵ¤ì¤ë¡£ + +¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤òÁàºî¤¹¤ëºÝ¤Ë¤Ï¡¢¥ª¥×¥·¥ç¥ó¤ÎÁØ (level) ¤È +¥ª¥×¥·¥ç¥ó¤Î̾Á°¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥½¥±¥Ã¥È API Áؤǥª¥×¥·¥ç¥ó¤òÁàºî¤¹¤ë°Ù¤Ë¤Ï¡¢ +.I level +¤ò +.B SOL_SOCKET +¤Ë»ØÄꤹ¤ë¡£ +¾¤ÎÁ´¤Æ¤ÎÁؤǥª¥×¥·¥ç¥ó¤òÁàºî¤¹¤ë°Ù¤Ë¤Ï¡¢Í¿¤¨¤é¤ì¤¿¥ª¥×¥·¥ç¥ó¤Î +À©¸æ¼çÂΤȤʤë¥×¥í¥È¥³¥ë¤Î¥×¥í¥È¥³¥ëÈÖ¹æ¤ò»ØÄꤹ¤ë¡£Î㤨¤Ð¡¢ +¥ª¥×¥·¥ç¥ó¤¬ +.B TCP +¥×¥í¥È¥³¥ë¤Ç²ò¼á¤µ¤ì¤ë¤Ù¤­¤³¤È¤ò»Ø¼¨¤¹¤ë¤Ë¤Ï¡¢ +.I level +¤Ë +.B TCP +¤Î¥×¥í¥È¥³¥ëÈÖ¹æ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BR getprotoent (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ + +.I optval +¤È +.I optlen +°ú¤­¿ô¤Ï +.BR setsockopt () +¤Î¥ª¥×¥·¥ç¥ó¤ÎÃͤ˥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +.BR getsockopt () +¤Ç¤ÏÍ׵ᤷ¤¿¥ª¥×¥·¥ç¥ó¤ÎÃͤòÊÖ¤¹¤¿¤á¤Î¥Ð¥Ã¥Õ¥¡¡¼¤ò»ØÄꤹ¤ë¡£ +.BR getsockopt () +¤Ç¤Ï +.I optlen +¤ÏÃͤȷë²ÌξÍѤΰú¤­¿ô¤Ç¡¢ºÇ½é¤Ë +.I optval +¤Î»Ø¤·¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡¡¼¤Î¥µ¥¤¥º¤òÍ¿¤¨¡¢¼ÂºÝ¤ËÊÖ¤µ¤ì¤ëÃͤΥµ¥¤¥º¤Ë +½ñ¤­´¹¤¨¤é¤ì¤ë¡£¤â¤·¥ª¥×¥·¥ç¥óÃͤòÍ¿¤¨¤º¡¢ÊÖ¤µ¤ì¤â¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï +.I optval +¤Ï NULL ¤Ç¤âÎɤ¤¡£ + +.I optname +¤ª¤è¤Ó»ØÄꤵ¤ì¤¿¥ª¥×¥·¥ç¥ó¤Ï²ò¼á¤µ¤ì¤º¤Ë¡¢Å¬Àڤʥץí¥È¥³¥ë¡¦¥â¥¸¥å¡¼¥ë¤Ë +ÅϤµ¤ì¤Æ²ò¼á¤µ¤ì¤ë¡£¥¤¥ó¥¯¥ë¡¼¥É¡¦¥Õ¥¡¥¤¥ë +.I +¤Ë¤Ï¸å½Ò¤Î¥½¥±¥Ã¥ÈÁؤΥª¥×¥·¥ç¥ó¤ÎÄêµÁ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¾¤Î¥×¥í¥È¥³¥ëÁؤǤÏ̾Á°¤ä·Á¼°¤Ï°Û¤Ê¤ë¡£ +¥Þ¥Ë¥å¥¢¥ë¤Î¥»¥¯¥·¥ç¥ó 4 ¤ÎŬÀڤʥ¨¥ó¥È¥ê¤ò»²¾È¤¹¤ë¤³¤È¡£ + +¤Û¤È¤ó¤É¤Î¥½¥±¥Ã¥ÈÁؤΥª¥×¥·¥ç¥ó¤Ï +.I optval +¤Ë +.I int +°ú¤­¿ô¤òÍøÍѤ¹¤ë¡£ +.BR setsockopt () +¤Ç¡¢ÆóÃÍ(boolean)¥ª¥×¥·¥ç¥ó¤òÍ­¸ú(enable)¤Ë¤¹¤ë¤Ë¤Ï¥¼¥í°Ê³°¤ò»ØÄꤷ¡¢ +̵¸ú(disable)¤Ë¤¹¤ë¤Ë¤Ï¥¼¥í¤ò»ØÄꤹ¤ë¡£ +.PP +ÍøÍѲÄǽ¤Ê¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ÎÀâÌÀ¤Ë´Ø¤·¤Æ¤Ï¡¢ +.BR socket (7) +¤ÈŬÀڤʥץí¥È¥³¥ë¤Î man ¥Ú¡¼¥¸¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£¥¨¥é¡¼»þ¤Ë¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP 10 +.B EBADF +°ú¤­¿ô +.I sockfd +¤¬Í­¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EFAULT +.I optval +¤Ç»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤¬¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ÎÍ­¸ú¤ÊÉôʬ¤Ç¤Ï¤Ê¤¤¡£ +.BR getsockopt () +¤Î¾ì¹ç¡¢ +.I optlen +¤¬¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ÎÍ­¸ú¤ÊÉôʬ¤Ç¤Ê¤¤¾ì¹ç¤Ë¤â¤³¤Î¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.B EINVAL +.BR setsockopt () +¤Ç +.I option +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.I optval +¤Ë̵¸ú¤ÊÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤â¡¢¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë +(Î㤨¤Ð¡¢ +.BR ip (7) +¤ËÀâÌÀ¤¬¤¢¤ë +.B IP_ADD_MEMBERSHIP +¥ª¥×¥·¥ç¥ó¤Ê¤É)¡£ +.TP +.B ENOPROTOOPT +»ØÄꤵ¤ì¤¿ÁØ(level)¤Ë¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOTSOCK +°ú¤­¿ô +.I sockfd +¤Ï¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¡¢¥½¥±¥Ã¥È¤Ç¤Ê¤¤¡£ +.SH ½àµò +SVr4, 4.4BSD (¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï 4.2BSD ¤ÇºÇ½é¤Ë¸½¤ì¤¿), +POSIX.1-2001. +.\" SVr4 ¤Ë¤Ï¾¤Ë ENOMEM ¤È ENOSR ¥¨¥é¡¼¡¦¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤âµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.\" ¤·¤«¤·¡¢ +.\" .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO +.\" ¥ª¥×¥·¥ç¥ó¤Ë´Ø¤¹¤ëµ­½Ò¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +POSIX.1-2001 ¤Ç¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ïɬ¿Ü¤È¤µ¤ì¤Æ¤ª¤é¤º¡¢ +Linux ¤Ç¤Ï¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÏɬÍפǤϤʤ¤¡£ +¤·¤«¤·¡¢Îò»ËŪ¤Ë¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¼ÂÁõ (BSD ·Ï) ¤Ç¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬ +ɬÍפǤ¢¤ê¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò +¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬¸­ÌÀ¤Ç¤¢¤í¤¦¡£ + +.BR getsockopt () +¤È +.BR setsockopt () +¤Î +.I optlen +°ú¤­¿ô¤Ï¼ÂºÝ¤Ï +.I int [*] +¤Ç¤¢¤ë (¤½¤·¤Æ 4.x BSD ¤È libc4 ¤È libc5 ¤Ï¤½¤¦¤Ê¤Ã¤Æ¤¤¤ë)¡£ +POSIX ¤Ç¤Ïäþ;¶ÊÀÞ¤ò·Ð¤Æ¸½ºß¤Î +.I socklen_t +¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +glibc ¤Ç¤â +.I socklen_t +¤ò»È¤Ã¤Æ¤¤¤ë¡£ +.BR accept (2) +¤â»²¾È¤Î¤³¤È¡£ +.SH ¥Ð¥° +¥½¥±¥Ã¥È¤Î¥ª¥×¥·¥ç¥ó¤Î¤¤¤¯¤Ä¤«¤Ï¥·¥¹¥Æ¥à¤Î¤è¤êÄ㤤ÁØ¤Ç +½èÍý¤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ioctl (2), +.BR socket (2), +.BR getprotoent (3), +.BR protocols (5), +.BR socket (7), +.BR tcp (7), +.BR unix (7) diff --git a/release/man2/gettid.2 b/release/man2/gettid.2 new file mode 100644 index 00000000..6657f667 --- /dev/null +++ b/release/man2/gettid.2 @@ -0,0 +1,79 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 2003 Abhijit Menon-Sen +.\" 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. +.\" +.\" 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" +.SH ̾Á° +gettid \- ¥¹¥ì¥Ã¥ÉID ¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.B pid_t gettid(void); +.fi +.SH ÀâÌÀ +.BR gettid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É ID (TID) ¤òÊÖ¤¹¡£ +¥·¥ó¥°¥ë¥¹¥ì¥Ã¥É¤Î¥×¥í¥»¥¹¤Ç¤Ï¡¢¥¹¥ì¥Ã¥É ID ¤Ï +.RB ( getpid (2) +¤¬ÊÖ¤¹¥×¥í¥»¥¹ ID (PID) ¤ÈÅù¤·¤¤¡£ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Î¥×¥í¥»¥¹¤Ç¤Ï¡¢Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤ÏƱ¤¸ PID ¤ò»ý¤Ä¤¬¡¢ +¤½¤ì¤¾¤ì¤Î¥¹¥ì¥Ã¥É¤Ï°ì°Õ¤Ê TID ¤ò»ý¤Ä¡£ +¤µ¤é¤Ê¤ë¾ÜºÙ¤Ï¡¢ +.BR clone (2) +¤Î +.BR CLONE_THREAD +¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤Î¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥ÉID ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤³¤Î¥³¡¼¥ë¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR gettid () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¥«¡¼¥Í¥ë 2.4.11 ¤Î Linux ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +.BR gettid () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢ +°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£ +.\" See http://sourceware.org/bugzilla/show_bug.cgi?id=6399 +.\" "gettid() should have a wrapper" + +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÊÖ¤¹¥¹¥ì¥Ã¥É ID ¤Ï +POSIX ¥¹¥ì¥Ã¥É ID +.RB ( pthread_self (3) +¤¬ÊÖ¤¹Û£Ëæ¤ÊÃÍ) ¤ÈƱ¤¸¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR fork (2), +.BR getpid (2) diff --git a/release/man2/gettimeofday.2 b/release/man2/gettimeofday.2 new file mode 100644 index 00000000..ab8d5c1b --- /dev/null +++ b/release/man2/gettimeofday.2 @@ -0,0 +1,255 @@ +.\" 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" +.SH ̾Á° +gettimeofday, settimeofday \- »þ¹ï¤ò¼èÆÀ/ÀßÄꤹ¤ë +.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 +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR settimeofday (): +_BSD_SOURCE +.SH ÀâÌÀ +´Ø¿ô +.BR gettimeofday () +¤È +.BR settimeofday () +¤Ï»þ¹ï¤È¥¿¥¤¥à¥¾¡¼¥ó¤ò¼èÆÀ¤Þ¤¿¤ÏÀßÄꤹ¤ë¡£ +.I tv +°ú¤­¿ô¤Ï +.I struct timeval +¤Ç¤¢¤ë +.RI ( +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë): +.sp +.in +4n +.nf +struct timeval { + time_t tv_sec; /* Éà */ + suseconds_t tv_usec; /* ¥Þ¥¤¥¯¥íÉà */ +}; +.fi +.in +.sp +¤³¤ì¤Ë¤è¤êµª¸µ (the Epoch: +.BR time (2) +¤ò»²¾È) ¤«¤é¤ÎÉäȥޥ¤¥¯¥íÉ䬼èÆÀ¤Ç¤­¤ë¡£ +.I tz +°ú¤­¿ô¤Ï +.I "struct timezone" +¤Ç¤¢¤ë: +.sp +.in +4n +.nf +struct timezone { + int tz_minuteswest; /* ¥°¥ê¥Ë¥Ã¥¸É¸½à»þ¤È¤Îº¹ (À¾Êý¤Ëʬñ°Ì) */ + int tz_dsttime; /* ²Æ»þ´ÖÄ´À°¤Î·¿ */ +}; +.fi +.in +.PP +.I tv +¤ä +.I tz +¤¬ NULL ¤Î¾ì¹ç¡¢Âбþ¤¹¤ë¹½Â¤ÂΤÎÀßÄê/¼èÆÀ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +.\" The following is covered under EPERM below: +.\" .PP +.\" Only the superuser may use +.\" .BR settimeofday (). +.PP +.I timezone +¹½Â¤ÂΤò»È¤¦¤Î¤Ï»þÂåÃÙ¤ì (obsolete) ¤Ç¤¢¤ë: +.I tz +°ú¤­¿ô¤ÏÄ̾ï¤Ï NULL ¤Ë»ØÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.I tz_dsttime +¥Õ¥£¡¼¥ë¥É¤Ï Linux ¤Ç¤Ï°ìÀڻȤï¤ì¤Æ¤³¤Ê¤«¤Ã¤¿; +libc ¤ä glibc ¤Ç¤â¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤³¤Ê¤«¤Ã¤¿¤·¡¢ +¤³¤ì¤«¤é¤â¥µ¥Ý¡¼¥È¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹Ãæ¤ÎÀë¸À°Ê³°¤Ç¡¢¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬Â¸ºß¤¹¤ë¤Î¤ÏÁ´¤Æ¥Ð¥°¤Ç¤¢¤ë¡£ +¤è¤Ã¤Æ¤³¤ì°Ê¹ß¤Îµ­½Ò¤Ï¡¢½ã¿è¤ËÎò»ËŪ¶½Ì£¤Ë´ð¤Å¤¤¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +.I tz_dsttime +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï (°Ê²¼¤ÇÍ¿¤¨¤é¤ì¤ë¤è¤¦¤Ê) ¥·¥ó¥Ü¥ëÄê¿ô¤¬³ÊǼ¤µ¤ì¤ë¡£ +¤³¤ì¤Ï°ìǯ¤Î¤¦¤Á¤Ç¤¤¤Ä²Æ»þ´Ö (Daylight Savings Time) ¤ò¼Â»Ü¤¹¤ë¤«¤ò¼¨¤·¤Æ¤¤¤ë +(Ãí°Õ: ¤½¤ÎÃͤÏǯ´Ö¤òÄ̤·¤¿Äê¿ô¤Ç¤¢¤ë: +²Æ»þ´Ö¤¬¼Â»ÜÃæ¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¤ï¤±¤Ç¤Ï¤Ê¤¯¡¢ +¥¢¥ë¥´¥ê¥º¥à¤òÁªÂò¤·¤Æ¤¤¤ë¤À¤±¤Ç¤¢¤ë)¡£ +²Æ»þ´Ö¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.in +4n +.nf + +\fBDST_NONE\fP /* ²Æ»þ´Ö¤òºÎÍѤ·¤Æ¤¤¤Ê¤¤ */ +.br +\fBDST_USA\fP /* ¥¢¥á¥ê¥«¹ç½°¹ñ¼°²Æ»þ´Ö */ +.br +\fBDST_AUST\fP /* ¥ª¡¼¥¹¥È¥é¥ê¥¢¼°²Æ»þ´Ö */ +.br +\fBDST_WET\fP /* À¾¥è¡¼¥í¥Ã¥Ñ¼°²Æ»þ´Ö */ +.br +\fBDST_MET\fP /* Ãæ±û¥è¡¼¥í¥Ã¥Ñ¼°²Æ»þ´Ö */ +.br +\fBDST_EET\fP /* Åì¥è¡¼¥í¥Ã¥Ñ¼°²Æ»þ´Ö */ +.br +\fBDST_CAN\fP /* ¥«¥Ê¥À */ +.br +\fBDST_GB\fP /* ¥°¥ì¡¼¥È¥Ö¥ê¥Æ¥ó¤ª¤è¤Ó¥¢¥¤¥ë¥é¥ó¥É */ +.br +\fBDST_RUM\fP /* ¥ë¡¼¥Þ¥Ë¥¢ */ +.br +\fBDST_TUR\fP /* ¥È¥ë¥³ */ +.br +\fBDST_AUSTALT\fP /* 1986ǯ¤Ë°Ü¹Ô¤µ¤ì¤¿¥ª¡¼¥¹¥È¥é¥ê¥¢¼° */ +.fi +.in +.PP +ÅöÁ³¤Î¤³¤È¤Ê¤¬¤é¡¢²Æ»þ´Ö¤¬¤É¤Î´ü´Ö¤Ë¼Â»Ü¤µ¤ì¤ë¤«¤ò +¹ñ¤´¤È¤Î´Êñ¤Ê¥¢¥ë¥´¥ê¥º¥à¤ÇƳ¤¯¤³¤È¤¬¤Ç¤­¤Ê¤¤¤³¤È¤¬È½ÌÀ¤·¤¿¡£ +¼ÂºÝ¡¢²Æ»þ´Ö¤Î´ü´Ö¤Ïͽ¬ÉÔ²Äǽ¤ÊÀ¯¼£Åª·èÄê¤Ç·è¤Þ¤ë¡£ +¤½¤Î¤¿¤á¤³¤ÎÊýË¡¤Ç¥¿¥¤¥à¡¦¥¾¡¼¥ó¤òɽ¤¹¤³¤È¤ÏÃÇÇ°¤µ¤ì¤¿¡£ +Linux ¤Ë¤ª¤¤¤Æ +.BR settimeofday () +¤ò¸Æ¤Ó½Ð¤¹¤È¤­¤Ï¡¢ +.I tz_dsttime +¥Õ¥£¡¼¥ë¥É¤ò 0 ¤Ë¤¹¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +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 +.I timeval +¹½Â¤ÂΤòÁàºî¤¹¤ë¤¿¤á¤Î¥Þ¥¯¥í¤ÎÀâÌÀ¤Ï +.BR timeradd (3) +¤Ë¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR gettimeofday () +¤È +.BR settimeofday () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹ +(¤³¤Î¾ì¹ç¤Ï +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë)¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I tv +¤« +.I tz +¤Î¤É¤Á¤é¤«¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +¥¿¥¤¥à¥¾¡¼¥ó (¤Þ¤¿¤Ï¾¤Î²¿¤«) ¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë +.BR settimeofday () +¤ò¸Æ¤Ó½Ð¤¹¤¿¤á¤Î½½Ê¬¤ÊÆø¢¤¬¤Ê¤¤¡£ +Linux ¤Ç¤Ï +.B CAP_SYS_TIME +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬É¬ÍפǤ¢¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD ¤Ë½àµò¤¹¤ë¡£ +POSIX.1-2001 ¤Ï +.BR gettimeofday () +¤Ë¤Ä¤¤¤Æ¤Ïµ­½Ò¤·¤Æ¤¤¤ë¤¬¡¢ +.BR settimeofday () +¤Ë¤Ä¤¤¤Æ¤Ïµ­½Ò¤·¤Æ¤¤¤Ê¤¤¡£ +POSIX.1-2008 ¤Ç¤Ï +.BR gettimeofday () +¤ÏÇÑ»ßͽÄê¤È¤µ¤ì¤Æ¤ª¤ê¡¢ +Âå¤ï¤ê¤Ë +.BR clock_gettime (2) +¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.LP +ÀÎ¤Ï +.I struct timeval +¤Î¥Õ¥£¡¼¥ë¥É¤Ï +.I long +·¿¤Ç¤¢¤Ã¤¿¡£ +.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/release/man2/getuid.2 b/release/man2/getuid.2 new file mode 100644 index 00000000..0fa80830 --- /dev/null +++ b/release/man2/getuid.2 @@ -0,0 +1,71 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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. +.\" +.\" Historical remark, aeb, 2004-06-05 +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated Thu Jun 26 20:37:44 JST 1997 +.\" by SUTO, Mitsuaki +.\" Updated & Modified Sat Feb 5 19:49:39 JST 2005 +.\" by Yuichi SATO +.\" +.TH GETUID 2 1993-07-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getuid, geteuid \- ¥æ¡¼¥¶¡¼ ID ¤òÆÀ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.B uid_t getuid(void); +.br +.B uid_t geteuid(void); +.SH ÀâÌÀ +.BR getuid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤òÊÖ¤¹¡£ + +.BR geteuid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.SH ½àµò +POSIX.1-2001, 4.3BSD. +.SH Ãí°Õ +.SS Îò»Ë +Unix V6 ¤Ç¤Ï +.BR getuid () +¥³¡¼¥ë¤Ï +.I "(euid << 8) + uid" +¤òÊÖ¤·¤Æ¤¤¤¿¡£ +Unix V7 ¤Ç¤Ï +.BR getuid () +¤È +.BR geteuid () +¤È¤¤¤¦ÊÌ¡¹¤Î¥³¡¼¥ë¤¬Æ³Æþ¤µ¤ì¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getresuid (2), +.BR setreuid (2), +.BR setuid (2), +.BR credentials (7) diff --git a/release/man2/getxattr.2 b/release/man2/getxattr.2 new file mode 100644 index 00000000..b4f0062e --- /dev/null +++ b/release/man2/getxattr.2 @@ -0,0 +1,165 @@ +.\" +.\" Extended attributes system calls manual pages +.\" +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" 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) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 02:47:19 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: extended attributes ³Èĥ°À­ +.\"WORD: namespace ̾Á°¶õ´Ö +.\" +.TH GETXATTR 2 2001-12-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getxattr, lgetxattr, fgetxattr \- ³Èĥ°À­¤ÎÃͤò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.fam C +.nf +.B #include +.B #include +.sp +.BI "ssize_t getxattr(const char\ *" path ", const char\ *" name , +.BI " void\ *" value ", size_t " size ); +.BI "ssize_t lgetxattr(const char\ *" path ", const char\ *" name , +.BI " void\ *" value ", size_t " size ); +.BI "ssize_t fgetxattr(int " fd ", const char\ *" name , +.BI " void\ *" value ", size_t " size ); +.fi +.fam T +.SH ÀâÌÀ +³Èĥ°À­¤Ï¡¢inode (¥Õ¥¡¥¤¥ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯Åù) ¤Ë +´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +.IR name :\c +.I value +¤ÎÂФǤ¢¤ë¡£ +¤³¤ì¤é¤Ï¡¢¥·¥¹¥Æ¥à¾å¤Î¤¹¤Ù¤Æ¤Î inode ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ä̾ï¤Î°À­ +.RB ( stat (2) +¤¬ÊÖ¤¹¥Ç¡¼¥¿) ¤ò³ÈÄ¥¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +³Èĥ°À­¤Î¥³¥ó¥»¥×¥È¤Ï +.BR attr (5) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +.BR getxattr () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î»ØÄꤵ¤ì¤¿ +.I path +¤ËÂбþ¤¹¤ë¡¢Ì¾Á° +.I name +¤Î³Èĥ°À­¤Î +.I value +(ÃÍ) ¤ò¼èÆÀ¤¹¤ë¡£ +°À­ +.I value +¤ÎŤµ¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.BR lgetxattr () +¤Ï +.BR getxattr () +¤ÈƱ¤¸¤À¤¬¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¡¢¥ê¥ó¥¯¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë +¤Ç¤Ï¤Ê¤¯¡¢¥ê¥ó¥¯¤½¤Î¤â¤Î¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +.PP +.BR fgetxattr () +¤Ï +.BR getxattr () +¤ÈƱ¤¸¤À¤¬¡¢ +.I path +¤ÎÂå¤ï¤ê¤Ë +.I fd +¤Ç»²¾È¤µ¤ì¤¿¥ª¡¼¥×¥óºÑ¤ß¥Õ¥¡¥¤¥ë¤Î¾ðÊó¤À¤±¤ò¼èÆÀ¤¹¤ëÅÀ¤¬°Û¤Ê¤ë +.RI ( fd +¤Ï +.BR open (2) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë)¡£ +.PP +³Èĥ°À­¤Î̾Á° +.I name +¤ÏÉáÄ̤ΠNULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +̾Á°¤Ë¤Ï¡¢Ì¾Á°¶õ´Ö¤òɽ¤¹ÀÜƬ¼­ (prefix) ¤¬´Þ¤Þ¤ì¤ë; +¸Ä¡¹¤Î inode ¤ËÂФ·¤Æ¡¢¸ß¤¤¤ËÆÈΩ¤Ê̾Á°¶õ´Ö¤¬Ê£¿ô¤¢¤Ã¤Æ¤â¤è¤¤¡£ +³Èĥ°À­¤ÎÃͤϡ¢¤¢¤ë°ìÄê¤ÎŤµ¤ÎǤ°Õ¤Î¥Æ¥­¥¹¥È¡¦¥Ç¡¼¥¿¤Þ¤¿¤Ï +¥Ð¥¤¥Ê¥ê¡¦¥Ç¡¼¥¿¤Î½¸¹ç¤Ç¤¢¤ë¡£ +.PP +.I size +¤Ë 0 ¤ò»ØÄꤷ¤Æ¶õ¤Î¥Ð¥Ã¥Õ¥¡¤ò¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹¤³¤È¤¬¤Ç¤­¡¢ +¤³¤Î¾ì¹ç¤Ë¤Ï»ØÄꤵ¤ì¤¿Ì¾Á°¤Î³Èĥ°À­¤Î¸½ºß¤Î¥µ¥¤¥º¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤ÎÊýË¡¤Ï¡¢³Èĥ°À­¤ÎÃͤòÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Î¥Ð¥Ã¥Õ¥¡¡¦¥µ¥¤¥º¤ò +¸«ÀѤâ¤ë¤Î¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡¢ +.PP +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¡¢½é´ü¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Î¿ä¬¤ò¤·¤¿¤ê¡¢ +Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ¤¹¤®¤¿¤³¤È¤òÊÖ¤êÃͤÇÃΤ餻¤ë¤³¤È¤Ç¥Ð¥Ã¥Õ¥¡¤òÂ礭¤¯ +¤·¤¿¤ê¤Ç¤­¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢³Èĥ°À­¤ÎÃͤÎŤµ¤òɽ¤¹Àµ¤Î¿ô¤¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +»ØÄꤵ¤ì¤¿Ì¾Á°¤Î°À­¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢¤Þ¤¿¤Ï¥×¥í¥»¥¹¤¬¤½¤Î°À­¤Ë¥¢¥¯¥»¥¹ +¤¹¤ë¸¢¸Â¤¬¤Ê¤¤¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOATTR +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.I value +¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ +.I size +¤¬·ë²Ì¤òÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I errno +¤Ë +.B ERANGE +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +³Èĥ°À­¤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¤â¤·¤¯¤Ï̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOTSUP +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.BR stat (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀâÌÀ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ï +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤âŬÍѤµ¤ì¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.4 °Ê¹ß¤Î Linux ¤ÇÍøÍѤǤ­¤ë¡£ +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3 °Ê¹ß¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\" .SH Ãø¼Ô +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" ¤È SGI XFS ³«È¯¥Á¡¼¥à, +.\" .RI < linux-xfs@oss.sgi.com >¡£ +.\" ¥Ð¥°¥ì¥Ý¡¼¥È¤ä¥³¥á¥ó¥È¤Ï¾åµ­¤Î¥¢¥É¥ì¥¹¤Þ¤ÇÁ÷¤Ã¤Æ²¼¤µ¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getfattr (1), +.BR setfattr (1), +.BR listxattr (2), +.BR open (2), +.BR removexattr (2), +.BR setxattr (2), +.BR stat (2), +.BR attr (5), +.BR symlink (7) diff --git a/release/man2/idle.2 b/release/man2/idle.2 new file mode 100644 index 00000000..d1895bb0 --- /dev/null +++ b/release/man2/idle.2 @@ -0,0 +1,78 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from linux/mm/swap.c: +.\" Copyright (C) 1991, 1992 Linus Torvalds +.\" +.\" 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 : +.\" Added text about calling restriction (new in kernel 1.1.20 I believe). +.\" 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 +.\" +.\"WORD: Linux-specific Linux ÆÃÍ­ +.\"WORK: portable °Ü¿¢ +.\" +.TH IDLE 2 1994-08-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +idle \- ID 0 ¤Î¥×¥í¥»¥¹¤ò¥¢¥¤¥É¥ë¾õÂ֤ˤ¹¤ë +.SH ½ñ¼° +.B #include +.sp +.B int idle(void); +.SH ÀâÌÀ +.BR idle () +¤Ï¥Ö¡¼¥È¥¹¥È¥é¥Ã¥×»þ¤Ë»ÈÍѤµ¤ì¤ë¡¢ÆâÉô¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£ +¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¤ò¥¹¥ï¥Ã¥×²Äǽ¤ËÀßÄꤷ¡¢Í¥ÀèÅÙ¤ò²¼¤²¡¢¥á¥¤¥ó¤Î¥¹¥±¥¸¥å¡¼ +¥ë½èÍý¤Î¤¿¤á¤Î¥ë¡¼¥×¤Ø°Ü¹Ô¤¹¤ë¡£ +½¾¤Ã¤Æ +.BR idle () +¤Ï return ¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.PP +ID 0 ¤Î¥×¥í¥»¥¹¤Î¤ß¤¬ +.BR idle () +¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¾¤Î¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤Ï¤¿¤È¤¨¤½¤ì¤¬¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤¿¤È¤·¤Æ +¤â +.B EPERM +¤ò¼õ¤±¼è¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR idle () +ID 0 ¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ¤Ï return ¤·¤Ê¤¤¡£¤½¤ì°Ê³°¤Î¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤Ë¤Ï +¾ï¤Ë \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EPERM +¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤Ë¤Ï¾ï¤Ë¤³¤ÎÃͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +2.3.13 °Ê¹ß¡¢¤â¤Ï¤ä¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¸ºß¤·¤Ê¤¤¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï Linux ÆÃÍ­¤Î´Ø¿ô¤Ç¤¢¤ê¡¢°Ü¿¢À­¤ò»ý¤¿¤»¤¿¤¤¥×¥í¥°¥é¥à¤Ë¤Ï»È +ÍѤ¹¤Ù¤­¤Ç¤Ê¤¤¡£ diff --git a/release/man2/init_module.2 b/release/man2/init_module.2 new file mode 100644 index 00000000..d7c3b691 --- /dev/null +++ b/release/man2/init_module.2 @@ -0,0 +1,102 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-29, Akihiro MOTOKI +.\" +.TH INIT_MODULE 2 2006-02-09 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +init_module \- ¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Î¥¨¥ó¥È¥ê¤ò½é´ü²½¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int init_module(const char *" name ", struct module *" image ); +.fi +.SH ÀâÌÀ +.BR init_module () +¤ÏºÆÇÛÃÖ¤µ¤ì¤¿¥â¥¸¥å¡¼¥ë¥¤¥á¡¼¥¸¤ò¥«¡¼¥Í¥ë¶õ´Ö¤Ë¥í¡¼¥É¤·¡¢ +¤½¤Î¥â¥¸¥å¡¼¥ë¤Î +.I init +´Ø¿ô¤ò¼Â¹Ô¤¹¤ë¡£ +.PP +¥â¥¸¥å¡¼¥ë¥¤¥á¡¼¥¸¤ÏÀèƬÉôʬ¤Ë module ¹½Â¤ÂΤ¬¤¢¤ê¡¢¤½¤Î¸å¤í¤Ë +ŬÀڤʥ³¡¼¥É¤È¥Ç¡¼¥¿¤¬Â³¤¯¡£ +¤³¤Î module ¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.PP +.in +4n +.nf +struct module { + unsigned long size_of_struct; + struct module *next; + const char *name; + unsigned long size; + long usecount; + unsigned long flags; + unsigned int nsyms; + unsigned int ndeps; + struct module_symbol *syms; + struct module_ref *deps; + struct module_ref *refs; + int (*init)(void); + void (*cleanup)(void); + const struct exception_table_entry *ex_table_start; + const struct exception_table_entry *ex_table_end; +#ifdef __alpha__ + unsigned long gp; +#endif +}; +.fi +.in +.PP +.I next +¤È +.I refs +°Ê³°¤ÎÁ´¤Æ¤Î¥Ý¥¤¥ó¥¿Í×ÁǤϥ⥸¥å¡¼¥ëËÜÂÎÆâÉô¤ò»Ø¤·¡¢ +¥«¡¼¥Í¥ë¶õ´Ö¤Ç¤ÎŬÀÚ¤ÊÃͤǽé´ü²½¤µ¤ì¤ë (¤Ä¤Þ¤ê¡¢¥â¥¸¥å¡¼¥ë¤Î»Ä¤ê¤Î +Éôʬ¤ÇºÆÇÛÃÖ¤µ¤ì¤ë) ¤³¤È¤¬´üÂÔ¤µ¤ì¤ë¡£ +.PP +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBUSY +¥â¥¸¥å¡¼¥ë¤Î½é´ü²½¥ë¡¼¥Á¥ó¤¬¼ºÇÔ¤·¤¿¡£ +.TP +.B EFAULT +.I name +¤ä +.I image +¤¬¥×¥í¥°¥é¥à¤¬¥¢¥¯¥»¥¹¤Ç¤­¤ë¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤Ë¤¢¤ë¡£ +.TP +.B EINVAL +°ìÉô¤Î +.I image +¥¹¥í¥Ã¥È¤Ë¤ª¤«¤·¤ÊÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¡£¤Þ¤¿¤Ï +.I image\->name +¤¬¸µ¤Î¥â¥¸¥å¡¼¥ë̾¤È°ìÃפ·¤Æ¤¤¤Ê¤¤¡£¤Þ¤¿¤Ï¡¢°ìÉô¤Î +.I image\->deps +¥¨¥ó¥È¥ê¤¬¥í¡¼¥É¤µ¤ì¤¿¥â¥¸¥å¡¼¥ë¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢Â¾¤ËƱÍͤÎÌ·½â¤¬µ¯¤³¤Ã¤Æ¤¤¤ë¡£ +.TP +.B ENOENT +¤½¤Î̾Á°¤Î¥â¥¸¥å¡¼¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢ +.RB ( CAP_SYS_MODULE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +.BR init_module () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR create_module (2), +.BR delete_module (2), +.BR query_module (2) diff --git a/release/man2/inotify_add_watch.2 b/release/man2/inotify_add_watch.2 new file mode 100644 index 00000000..0080effe --- /dev/null +++ b/release/man2/inotify_add_watch.2 @@ -0,0 +1,120 @@ +.\" man2/inotify_add_watch.2 - inotify_add_watch man page +.\" +.\" Copyright (C) 2005 Robert Love +.\" and Copyright, 2006 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. +.\" +.\" 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" +.SH ̾Á° +inotify_add_watch \- ½é´ü²½ºÑ¤ß inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤Ë´Æ»ëÂоݤòÄɲ乤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int inotify_add_watch(int " fd ", const char *" pathname ", uint32_t " mask ); +.SH ÀâÌÀ +.BR inotify_add_watch () +¤Ï¡¢ +.I pathname +¤Ç»ØÄꤵ¤ì¤¿°ÌÃ֤ˤ¢¤ë¥Õ¥¡¥¤¥ë¤ò´Æ»ë¤¹¤ë´Æ»ë¥¢¥¤¥Æ¥à (watch) ¤Î¿·µ¬Äɲᢠ+¤Þ¤¿¤Ï´û¸¤Î´Æ»ë¥¢¥¤¥Æ¥à¤ÎÊѹ¹¤ò¹Ô¤¦¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï¡¢´Æ»ëÂоݤΥե¡¥¤¥ë¤ËÂФ¹¤ëÆɤ߽Ф·µö²Ä¤ò +»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I fd +°ú¤­¿ô¤Ï¡¢Êѹ¹¤ò¹Ô¤¦´Æ»ëÂоݥꥹ¥È (watch list) ¤ò»ý¤Ä inotify +¥¤¥ó¥¹¥¿¥ó¥¹¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.I pathname +¤Î¤É¤Î¥¤¥Ù¥ó¥È¤ò´Æ»ë¤¹¤ë¤«¤Ï¡¢°ú¤­¿ô¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯ +.I mask +¤Ç»ØÄꤹ¤ë¡£ +.I mask +¤ËÀßÄê¤Ç¤­¤ë¥Ó¥Ã¥È¤ÎÀâÌÀ¤Ë¤Ä¤¤¤Æ¤Ï +.BR inotify (7) +¤ò»²¾È¤Î¤³¤È¡£ + +.BR inotify_add_watch () +¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤È¡¢Êѹ¹ÂоݤΠinotify ¥¤¥ó¥¹¥¿¥ó¥¹¤Ç +.I pathname +¤ËÂбþÉÕ¤±¤é¤ì¤ë°ì°Õ¤Ê´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿ (watch descriptor) ¤òÊÖ¤¹¡£ +.I pathname +¤¬¤½¤Î inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤ËÄɲ䵤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿¤¬¿·µ¬¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +.I pathname +¤¬¤¹¤Ç¤Ë´Æ»ëÂоݤˤʤäƤ¤¤ì¤Ð¡¢´û¸¤Î´Æ»ë¥¢¥¤¥Æ¥à¤ËÂФ¹¤ë +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ + +¤³¤ì°Ê¹ß¤Ë inotify ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é +.BR read (2) +¤ò¹Ô¤¦¤È¡¢´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤ì¤é¤Î +.BR read () +¤ò¹Ô¤¦¤È¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¤¥Ù¥ó¥È¤ò¼¨¤¹ +.I inotify_event +¹½Â¤ÂΤ¬Æɤ߽Фµ¤ì¤ë +.RB ( inotify (7) +»²¾È)¡£¤³¤Î¹½Â¤ÂÎÆâ¤Î´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿¤Ë¤è¤ê¡¢ +¤É¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤½¤Î¥¤¥Ù¥ó¥È¤¬È¯À¸¤·¤¿¤«¤òÆÃÄê¤Ç¤­¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR inotify_add_watch () +¤ÏÈóÉé¤Î´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëÆɤ߽Ф·¥¢¥¯¥»¥¹¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EBADF +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Í­¸ú¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EFAULT +.I pathname +¤¬»Ø¤¹¥¢¥É¥ì¥¹¤¬¥×¥í¥»¥¹¤¬¥¢¥¯¥»¥¹¤Ç¤­¤ë¥¢¥É¥ì¥¹¶õ´Ö³°¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +»ØÄꤵ¤ì¤¿¥¤¥Ù¥ó¥È¥Þ¥¹¥¯¤ËÍ­¸ú¤Ê¥¤¥Ù¥ó¥È¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤â¤·¤¯¤Ï +.I fd +¤¬ inotify ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¥á¥â¥ê¤¬½½Ê¬¤Ë¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOSPC +inotify ´Æ»ëÂоݤÎÁí¿ô¤¬¥æ¡¼¥¶¤¬ÄɲäǤ­¤ë¾å¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +¤â¤·¤¯¤Ï¡¢É¬Íפʻñ¸»¤Î³ä¤êÅö¤Æ¤Ë¥«¡¼¥Í¥ë¤¬¼ºÇÔ¤·¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +inotify ¤Ï Linux ¥«¡¼¥Í¥ë 2.6.13 ¤ËÁȤ߹þ¤Þ¤ì¤¿¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR inotify_init (2), +.BR inotify_rm_watch (2), +.BR inotify (7) diff --git a/release/man2/inotify_init.2 b/release/man2/inotify_init.2 new file mode 100644 index 00000000..39309611 --- /dev/null +++ b/release/man2/inotify_init.2 @@ -0,0 +1,110 @@ +.\" man2/inotify_init.2 - inotify_init man page +.\" +.\" Copyright (C) 2005 Robert Love +.\" +.\" 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. +.\" +.\" 2005-07-19 Robert Love - initial version +.\" 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" +.SH ̾Á° +inotify_init, inotify_init1 \- inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤ò½é´ü²½¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.B "int inotify_init(void);" +.BI "int inotify_init1(int " flags ); +.fi +.SH ÀâÌÀ +.BR inotify_init () +¤Ï¡¢¿·µ¬¤Î inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤ò½é´ü²½¤·¡¢ºîÀ®¤µ¤ì¤¿ inotify ¥¤¥Ù¥ó¥È¥­¥å¡¼ +¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ + +.BR inotify_init1 () +¤Ï¡¢ +.I flags +¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR inotify_init () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.I flags +¤Ë°Ê²¼¤ÎÃͤò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýÏ (OR) ¤Ç»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +°Û¤Ê¤ëÆ°ºî¤ò¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 12 +.B IN_NONBLOCK +¿·¤·¤¯À¸À®¤µ¤ì¤ë¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò (open file description) ¤Î +BR O_NONBLOCK +¥Õ¥¡¥¤¥ë¥¹¥Æ¡¼¥¿¥¹¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤³¤È¤Ç¡¢ +.B O_NONBLOCK +¤ò¥»¥Ã¥È¤¹¤ë¤¿¤á¤Ë +.BR fcntl (2) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.TP +.B IN_CLOEXEC +¿·¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤ËÂФ·¤Æ +close-on-exec +.RB ( FD_CLOEXEC ) +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬Ìò¤ËΩ¤ÄÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR open (2) +¤Î +.B O_CLOEXEC +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.RB ( inotify_init1 ()) +̵¸ú¤ÊÃͤ¬ +.I flags +¤Ë»ØÄꤵ¤ì¤¿¡£ +.TP +.B EMFILE +inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤ÎÁí¿ô¤¬¥æ¡¼¥¶Ã±°Ì¤Î¾å¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENFILE +inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥à¤Î¾å¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¥á¥â¥ê¤¬½½Ê¬¤Ë¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR inotify_init () +¤Ï Linux 2.6.13 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.BR inotify_init1 () +¤Ï Linux 2.6.27 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR inotify_add_watch (2), +.BR inotify_rm_watch (2), +.BR inotify (7) diff --git a/release/man2/inotify_rm_watch.2 b/release/man2/inotify_rm_watch.2 new file mode 100644 index 00000000..932a42d9 --- /dev/null +++ b/release/man2/inotify_rm_watch.2 @@ -0,0 +1,87 @@ +.\" man2/inotify_rm_watch.2 - inotify_rm_watch man page +.\" +.\" Copyright (C) 2005 Robert Love +.\" +.\" 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. +.\" +.\" 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 ´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿ +.\" +.TH INOTIFY_RM_WATCH 2 2006-02-07 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +inotify_rm_watch \- inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤«¤é´û¸¤Î´Æ»ë¥¢¥¤¥Æ¥à¤òºï½ü¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int inotify_rm_watch(int " fd ", uint32_t " wd ); +.\" FIXME . The type of the second argument should probably be "int". +.\" 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 +.SH ÀâÌÀ +.BR inotify_rm_watch () +¤Ï¡¢´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿ (watch descriptor) +.I wd +¤ËÂбþ¤¹¤ë´Æ»ë¥¢¥¤¥Æ¥à¤ò¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤ËÂбþ¤¹¤ë inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤«¤éºï½ü¤¹¤ë¡£ + +´Æ»ëÂоݤòºï½ü¤¹¤ë¤È¡¢ +¤³¤Î´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +.B IN_IGNORED +¥¤¥Ù¥ó¥È¤¬À¸À®¤µ¤ì¤ë +.RB ( inotify (7) +»²¾È)¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR inotify_rm_watch () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINVAL +´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿ +.I wd +¤¬Í­¸ú¤Ç¤Ê¤¤¡£¤â¤·¤¯¤Ï¡¢ +.I fd +¤¬ inotify ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +inotify ¤Ï Linux ¥«¡¼¥Í¥ë 2.6.13 ¤ËÁȤ߹þ¤Þ¤ì¤¿¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR inotify_add_watch (2), +.BR inotify_init (2), +.BR inotify (7) diff --git a/release/man2/intro.2 b/release/man2/intro.2 new file mode 100644 index 00000000..68e8719f --- /dev/null +++ b/release/man2/intro.2 @@ -0,0 +1,90 @@ +.\" 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. +.\" +.\" 2007-10-23 mtk: moved the _syscallN specific material to the +.\" 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-02-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +intro \- ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀâÌÀ +.SH ÀâÌÀ +¥Þ¥Ë¥å¥¢¥ë¤Î 2 ¾Ï¤Ç¤Ï Linux ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤ë¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¥«¡¼¥Í¥ë¤Ø¤Î¥¨¥ó¥È¥ê¥Ý¥¤¥ó¥È¤Ç¤¢¤ë¡£ +Ä̾ï¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏľÀܵ¯Æ°¤µ¤ì¤ëÌõ¤Ç¤Ï¤Ê¤¯¡¢ +¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤ÏÂбþ¤¹¤ë C ¥é¥¤¥Ö¥é¥ê¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬¤¢¤ê¡¢ +¤½¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹¤Î¤ËɬÍפʽèÍý¤ò¼Â¹Ô¤¹¤ë¡£ +¤½¤Î¤¿¤á¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹¤Î¤ÏÄ̾ï¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¤Î¤È +Ʊ¤¸¤è¤¦¤Ë¸«¤¨¤ë¡£ + +Linux ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥ê¥¹¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR syscalls (2) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÉé¤Î¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹ +(¶ñÂÎŪ¤Ë¤Ï +.BR errno (3) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ëÄê¿ô¤Î¤¤¤º¤ì¤«¤òÉé¤Ë¤·¤¿ÃͤòÊÖ¤¹)¡£ +C ¥é¥¤¥Ö¥é¥ê¤Î¥é¥Ã¥Ñ¡¼¤Ï¸Æ¤Ó½Ð¤·¸µ¤«¤é¤³¤¦¤·¤¿¾ÜºÙ¤ò±£Ê䷤Ƥ¤¤ë¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Éé¤ÎÃͤòÊÖ¤·¤¿¾ì¹ç¡¢¥é¥Ã¥Ñ¡¼¤ÏÀäÂÐÃͤò +.I errno +ÊÑ¿ô¤Ë¥³¥Ô¡¼¤·¡¢¥é¥Ã¥Ñ¡¼¤ÎÊÖ¤êÃͤȤ·¤Æ \-1 ¤òÊÖ¤¹¡£ + +À®¸ù»þ¤Ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÊÖ¤¹Ãͤϥ·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤è¤ê°Û¤Ê¤ë¡£ +¿¤¯¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÀ®¸ù»þ¤Ë 0 ¤òÊÖ¤¹¤¬¡¢ +À®¸ù»þ¤Ë 0 °Ê³°¤ÎÃͤòÊÖ¤¹¥·¥¹¥Æ¥à¥³¡¼¥ë¤â¤¢¤ë¡£ +¾ÜºÙ¤Ï¸Ä¡¹¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ + +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¡Ö½ñ¼°¡×¤ÎÀá¤Ëµ¬Äꤵ¤ì¤¿¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤«¤é´Ø¿ô¤ÎÄêµÁ¤ò +ÆÀ¤ë¤¿¤á¤Ë¡¢¥×¥í¥°¥é¥Þ¤¬µ¡Ç½¸¡ºº¥Þ¥¯¥í¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¾ì¹ç¤¬¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï¡¢É¬Íפʥޥ¯¥í¤¬¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤Î¤µ¤é¤Ê¤ë¾ðÊó¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR feature_test_macros (7) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ½àµò +¤³¤Î¾Ï¤Î´Ø¿ô¤¬½àµò¤¹¤ë Unix ¥·¥¹¥Æ¥à¤äɸ½à¤ò¼¨¤¹¤Î¤Ë¤¤¤¯¤Ä¤«¤Îñ¸ì¤äά¹æ¤¬ +»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +.BR standards (7) +¤ò»²¾È¤Î¤³¤È¡£ +.SH Ãí°Õ +.SS "ľÀܸƤӽФ¹" +¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢Ä¾ÀÜ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹É¬ÍפϤʤ¤¤¬¡¢ +¾ì¹ç¤Ë¤è¤Ã¤Æ¤Ïɸ½à C ¥é¥¤¥Ö¥é¥ê¤ËŬÀڤʴؿô¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤â¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ï¡¢¥×¥í¥°¥é¥Þ¤Ï +.BR syscall (2) +¤ò»È¤Ã¤Æ¡¢¼«Ê¬¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +²áµî¤Ë¤Ï¡¢ +.BR _syscall (2) +¥Þ¥¯¥í¤Î°ì¤Ä¤ò»È¤Ã¤Æ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¸Æ¤Ó½Ð¤¹¤³¤È¤â¤Ç¤­¤¿¡£ +.SS "Ãø¼Ô¤ÈÃøºî¸¢" +Ãø¼Ô¤ÈÃøºî¸¢ (copyright) ¤Ë´Ø¤·¤Æ¤Ï³Æ¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸¤Î¥½¡¼¥¹¤Î¥Ø¥Ã¥À¤ò +¸«¤ë¤³¤È¡£¤³¤ì¤é¤Ï¥Ú¡¼¥¸¤´¤È¤Ë°Û¤Ã¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR _syscall (2), +.BR syscall (2), +.BR errno (3), +.BR feature_test_macros (7), +.BR standards (7) diff --git a/release/man2/io_cancel.2 b/release/man2/io_cancel.2 new file mode 100644 index 00000000..29cd98b6 --- /dev/null +++ b/release/man2/io_cancel.2 @@ -0,0 +1,107 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" 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 +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .IP "\\$1" \\$2 +.\" .. +.TH IO_CANCEL 2 2008-06-18 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +io_cancel \- ̤½èÍý¤ÎÈóƱ´ü I/O Áàºî¤Î¼è¤ê¾Ã¤· +.SH ½ñ¼° +.nf +.\" .ad l +.\" .hy 0 +.\" +.B #include +.\"#include +.sp +.\" .HP 16 +.BI "int io_cancel(aio_context_t " ctx_id ", struct iocb *" iocb , +.BI " struct io_event *" result ); +.\" .ad +.\" .hy +.sp +\fI\-laio\fP ¤È¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.SH ÀâÌÀ +.PP +.BR io_cancel () +¤Ï¡¢²áµî¤Ë +.BR io_submit (2) +¤ò»È¤Ã¤ÆÅÐÏ¿¤µ¤ì¤¿ÈóƱ´ü I/O (AIO) Áàºî¤Î¼è¤ê¾Ã¤·¤ò¹Ô¤ª¤¦¤È¤¹¤ë¡£ +\fIctx_id\fP ¤Ï¡¢¼è¤ê¾Ã¤·¤ò¹Ô¤¦Áàºî¤Î AIO ¥³¥ó¥Æ¥­¥¹¥È¤Î ID ¤Ç¤¢¤ë¡£ +»ØÄꤷ¤¿ AIO ¥³¥ó¥Æ¥­¥¹¥È¤¬¸«¤Ä¤«¤ë¤È¡¢ +ÂоݤΥ¤¥Ù¥ó¥È¤Î¼è¤ê¾Ã¤·¤¬¹Ô¤ï¤ì¡¢¤½¤Î¸å \fIresult\fP ¤Ç»Ø¤µ¤ì¤¿¥á¥â¥ê¤Ë +¥³¥Ô¡¼¤µ¤ì¤ë (¤³¤Î¤È¤­¡¢´°Î»¥­¥å¡¼¤Ø¤Î°ÜÆ°¤Ï¹Ô¤ï¤ì¤Ê¤¤)¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR io_cancel () +¤Ï 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ»þ¤ÎÊÖ¤êÃͤˤĤ¤¤Æ¤Ï¡¢¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +»ØÄꤵ¤ì¤¿ \fIiocb\fP ¤Î¼è¤ê¾Ã¤·¤¬¹Ô¤ï¤ì¤Ê¤«¤Ã¤¿¡£ +.TP +.B EFAULT +¥Ç¡¼¥¿¹½Â¤¤ÎÃæ¤Ë̵¸ú¤Ê¥Ç¡¼¥¿¤ò»Ø¤·¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ë¡£ +.TP +.B EINVAL +\fIctx_id\fP ¤Ç»ØÄꤵ¤ì¤¿ AIO ¥³¥ó¥Æ¥­¥¹¥È¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.TP +.B ENOSYS +.BR io_cancel () +¤Ï¤³¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.PP +ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï 2002ǯ8·î¤Ë Linux 2.5 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +.PP +.BR io_cancel () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ëÍѤΥé¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ + +.I libaio +¤Ç +.BR io_cancel () +ÍѤËÄ󶡤µ¤ì¤Æ¤¤¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥¨¥é¡¼¤ÎÄÌÃΤ¬Ä̾ï¤Î C ¥é¥¤¥Ö¥é¥ê¤Î +´·½¬¤Ë¤·¤¿¤¬¤Ã¤Æ¤ª¤é¤º¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤ÏÉé¤Î¥¨¥é¡¼ÈÖ¹æ +(¥¨¥é¡¼¤ÎÀá¤ËÎóµó¤µ¤ì¤Æ¤¤¤ëÃͤΰì¤Ä¤òÉé¤Ë¤·¤¿¤â¤Î) ¤¬ÊÖ¤êÃͤȤʤ롣 +.BR syscall (2) +·Ðͳ¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤¹¤ë¤È¡¢ÊÖ¤êÃͤÏÄ̾ï¤Î¥¨¥é¡¼ÄÌÃΤδ·½¬¤Ë +¤·¤¿¤¬¤Ã¤Æ¤â¤Î¤È¤Ê¤ê¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï \-1 ¤¬Ê֤ꡢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ (Àµ¤Î) Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR io_destroy (2), +.BR io_getevents (2), +.BR io_setup (2), +.BR io_submit (2) +.\" .SH Ãí +.\" .PP +.\" ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Benjamin LaHaise ¤¬½ñ¤¤¤¿¡£ +.\" .SH Ãø¼Ô +.\" Kent Yoder. diff --git a/release/man2/io_destroy.2 b/release/man2/io_destroy.2 new file mode 100644 index 00000000..39969ff4 --- /dev/null +++ b/release/man2/io_destroy.2 @@ -0,0 +1,98 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" 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 +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .IP "\\$1" \\$2 +.\" .. +.TH IO_DESTROY 2 2008-06-18 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +io_destroy \- ÈóƱ´ü I/O ¥³¥ó¥Æ¥­¥¹¥È¤Î¾Ãµî +.SH ½ñ¼° +.nf +.\" .ad l +.\" .hy 0 +.B #include +.\" #include +.sp +.\" .HP 17 +.BI "int io_destroy(aio_context_t " ctx ); +.\" .ad +.\" .hy +.sp +\fI\-laio\fP ¤È¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.SH ÀâÌÀ +.PP +.BR io_destroy () +¤Ï¡¢I/O ¥³¥ó¥Æ¥­¥¹¥È¤Î¥ê¥¹¥È¤«¤é»ØÄꤵ¤ì¤¿ÈóƱ´ü I/O +¥³¥ó¥Æ¥­¥¹¥È¤òºï½ü¤·¤¿¸å¡¢¤½¤Î¥³¥ó¥Æ¥­¥¹¥È¤ò¾Ãµî¤¹¤ë¡£ +.BR io_destroy () +¤Ï¡¢\fIctx\fP ¾å¤Ë̤½èÍý¤ÎÈóƱ´ü I/O Ì¿ÎáµÚ¤Ó +´°Î»¥­¥å¡¼¤Î¥Ö¥í¥Ã¥¯¤Î¼è¤ê¾Ã¤·¤â¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR io_destroy () +¤Ï 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ»þ¤ÎÊÖ¤êÃͤˤĤ¤¤Æ¤Ï¡¢¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"motoki: ʬ¤«¤ê¤Ë¤¯¤¤¤Î¤Ç¡¢io_cancel.2 ¤«¤éήÍÑ¡£¤ª¤½¤é¤¯Æ±¤¸°ÕÌ£¡£ +¥Ç¡¼¥¿¹½Â¤¤ÎÃæ¤Ë̵¸ú¤Ê¥Ç¡¼¥¿¤ò»Ø¤·¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ë¡£ +.TP +.B EINVAL +\fIctx\fP ¤Ç»ØÄꤵ¤ì¤¿ AIO ¥³¥ó¥Æ¥­¥¹¥È¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.TP +.B ENOSYS +.BR io_destroy () +¤Ï¤³¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.PP +ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï 2002ǯ8·î¤Ë Linux 2.5 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +.PP +.BR io_destroy () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ëÍѤΥé¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ + +.I libaio +¤Ç +.BR io_destroy () +ÍѤËÄ󶡤µ¤ì¤Æ¤¤¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥¨¥é¡¼¤ÎÄÌÃΤ¬Ä̾ï¤Î C ¥é¥¤¥Ö¥é¥ê¤Î +´·½¬¤Ë¤·¤¿¤¬¤Ã¤Æ¤ª¤é¤º¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤ÏÉé¤Î¥¨¥é¡¼ÈÖ¹æ +(¥¨¥é¡¼¤ÎÀá¤ËÎóµó¤µ¤ì¤Æ¤¤¤ëÃͤΰì¤Ä¤òÉé¤Ë¤·¤¿¤â¤Î) ¤¬ÊÖ¤êÃͤȤʤ롣 +.BR syscall (2) +·Ðͳ¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤¹¤ë¤È¡¢ÊÖ¤êÃͤÏÄ̾ï¤Î¥¨¥é¡¼ÄÌÃΤδ·½¬¤Ë +¤·¤¿¤¬¤Ã¤Æ¤â¤Î¤È¤Ê¤ê¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï \-1 ¤¬Ê֤ꡢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ (Àµ¤Î) Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR io_cancel (2), +.BR io_getevents (2), +.BR io_setup (2), +.BR io_submit (2) +.\" .SH Ãí +.\" .PP +.\" ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Benjamin LaHaise ¤¬½ñ¤¤¤¿¡£ +.\" .SH Ãø¼Ô +.\" Kent Yoder. diff --git a/release/man2/io_getevents.2 b/release/man2/io_getevents.2 new file mode 100644 index 00000000..d69dc90a --- /dev/null +++ b/release/man2/io_getevents.2 @@ -0,0 +1,118 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" 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 +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .IP "\\$1" \\$2 +.\" .. +.TH IO_GETEVENTS 2 2008-07-04 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +io_getevents \- ´°Î»¥­¥å¡¼¤«¤éÈóƱ´ü I/O ¥¤¥Ù¥ó¥È¤òÆɤ߽Ф¹ +.SH ½ñ¼° +.nf +.\" .ad l +.\" .hy 0 +.B #include +.B #include +.\" #include +.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 +.sp +\fI\-laio\fP ¤È¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.SH ÀâÌÀ +.PP +.BR io_getevents () +¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fImin_nr\fP ¤Î¡¢ºÇÂç \fInr\fP ¸Ä¤Î +¥¤¥Ù¥ó¥È¤ò¡¢ \fIctx_id\fP ¤Ç»ØÄꤵ¤ì¤¿ AIO (ÈóƱ´ü I/O) ¥³¥ó¥Æ¥­¥¹¥È¤Î +´°Î»¥­¥å¡¼¤«¤éÆɤ߽Ф½¤¦¤È¤¹¤ë¡£ +\fItimeout\fP ¤Ï¥¤¥Ù¥ó¥ÈÆɤ߽Ф·¤ÎÂÔ¤Á»þ´Ö¤Î¹ç·×¤ò»ØÄꤹ¤ë¡£ +¥¿¥¤¥à¥¢¥¦¥È¤Ë NULL ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¾¯¤Ê¤¯¤È¤â \fImin_nr\fP ¸Ä¤Î¥¤¥Ù¥ó¥È¤¬ +Æɤ߽Фµ¤ì¤ë¤Þ¤ÇÂԤĤ³¤È¤ò°ÕÌ£¤¹¤ë¡£ +Ãí°ÕÅÀ¤ò°Ê²¼¤Ë¤¢¤²¤ë: +\fItimeout\fP ¤ÏÁêÂÐŪ¤Ê»ØÄê¤Ç¤¢¤ë¡£ +NULL ¤Ç¤Ê¤¤¾ì¹ç¹¹¿·¤µ¤ì¤ë¤³¤È¤â¤¢¤ê¤¨¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¤ÎÆ°ºî¤ÏÄä»ß¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR io_getevents () +¤ÏÆɤ߽Ф·¤¿¥¤¥Ù¥ó¥È¿ô¤òÊÖ¤¹¡£ +¥¤¥Ù¥ó¥È¤¬°ì¤Ä¤âÆɤ߽Фµ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¡¢ +\fItimeout\fP »þ´Ö¤¬·Ð²á¤·¤¿¾ì¹ç¤Ï \fImin_nr\fP ̤Ëþ¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ»þ¤ÎÊÖ¤êÃͤˤĤ¤¤Æ¤Ï¡¢¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +\fIevents\fP ¤Þ¤¿¤Ï \fItimeout\fP ¤¬Ìµ¸ú¤Ê¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +\fIctx_id\fP ¤¬Ìµ¸ú¤Ç¤¢¤ë¡£¤â¤·¤¯¤Ï¡¢\fImin_nr\fP ¤Þ¤¿¤Ï \fInr\fP ¤¬ +Èϰϳ°¤ÎÃͤǤ¢¤ë¡£ +.TP +.B EINTR +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B ENOSYS +.BR io_getevents () +¤¬¤³¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.PP +ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï 2002ǯ8·î¤Ë Linux 2.5 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +.PP +.BR io_getevents () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç +»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ëÍѤΥé¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ + +.I libaio +¤Ç +.BR io_getevents () +ÍѤËÄ󶡤µ¤ì¤Æ¤¤¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥¨¥é¡¼¤ÎÄÌÃΤ¬Ä̾ï¤Î C ¥é¥¤¥Ö¥é¥ê¤Î +´·½¬¤Ë¤·¤¿¤¬¤Ã¤Æ¤ª¤é¤º¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤ÏÉé¤Î¥¨¥é¡¼ÈÖ¹æ +(¥¨¥é¡¼¤ÎÀá¤ËÎóµó¤µ¤ì¤Æ¤¤¤ëÃͤΰì¤Ä¤òÉé¤Ë¤·¤¿¤â¤Î) ¤¬ÊÖ¤êÃͤȤʤ롣 +.BR syscall (2) +·Ðͳ¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤¹¤ë¤È¡¢ÊÖ¤êÃͤÏÄ̾ï¤Î¥¨¥é¡¼ÄÌÃΤδ·½¬¤Ë +¤·¤¿¤¬¤Ã¤Æ¤â¤Î¤È¤Ê¤ê¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï \-1 ¤¬Ê֤ꡢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ (Àµ¤Î) Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.PP +.BR io_cancel (2), +.BR io_destroy (2), +.BR io_setup (2), +.BR io_submit (2), +.BR time (7) +.\" .SH Ãí +.\" .PP +.\" ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Benjamin LaHaise ¤¬½ñ¤¤¤¿¡£ +.\" .SH Ãø¼Ô +.\" Kent Yoder. diff --git a/release/man2/io_setup.2 b/release/man2/io_setup.2 new file mode 100644 index 00000000..9c2c741b --- /dev/null +++ b/release/man2/io_setup.2 @@ -0,0 +1,109 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" 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 +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .IP "\\$1" \\$2 +.\" .. +.TH IO_SETUP 2 2003-06-18 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +io_setup \- ÈóƱ´ü I/O ¥³¥ó¥Æ¥­¥¹¥È¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.\" .ad l +.\" .hy 0 +.B #include +.\" #include +.sp +.\" .HP 15 +.BI "int io_setup(unsigned " nr_events ", aio_context_t *" ctxp ); +.\" .ad +.\" .hy +.sp +\fI\-laio\fP ¤È¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.SH ÀâÌÀ +.PP +.BR io_setup () +¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fInr_events\fP ¸Ä¤Î¥¤¥Ù¥ó¥È¤ò¼õ¿®²Äǽ¤Ê +ÈóƱ´ü I/O (AIO) ¥³¥ó¥Æ¥­¥¹¥È¤ÎºîÀ®¤ò¹Ô¤¦¡£ +\fIctxp\fP ¤Ï¡¢¤¹¤Ç¤Ë¸ºß¤¹¤ë AIO ¥³¥ó¥Æ¥­¥¹¥È¤ò»Ø¤·¤Æ¤¤¤Æ¤Ï¤Ê¤é¤º¡¢ +.BR io_setup () +¤Î¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë 0 ¤Ë½é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +AIO ¥³¥ó¥Æ¥­¥¹¥È¤ÎºîÀ®¤ËÀ®¸ù¤¹¤ë¤È¡¢\fI*ctxp\fP ¤ËºîÀ®¤µ¤ì¤¿ +AIO ¥³¥ó¥Æ¥­¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR io_setup () +¤Ï 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ»þ¤ÎÊÖ¤êÃͤˤĤ¤¤Æ¤Ï¡¢¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +»ØÄꤵ¤ì¤¿ \fInr_events\fP ¤¬¥æ¡¼¥¶¤¬»ÈÍѤǤ­¤ë¥¤¥Ù¥ó¥È¿ô¤Î¾å¸Â¤ò±Û¤¨¤Æ¤¤¤ë¡£ +.TP +.B EFAULT +\fIctxp\fP ¤Ë̵¸ú¤Ê¥Ý¥¤¥ó¥¿¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +\fIctxp\fP ¤¬½é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢»ØÄꤵ¤ì¤¿ \fInr_events\fP ¤¬ +ÆâÉô¤ÎÀ©¸ÂÃͤò±Û¤¨¤Æ¤¤¤ë¡£¤Þ¤¿¡¢ \fInr_events\fP ¤Ï 0 ¤è¤êÂ礭¤¤ÃÍ¤Ë +ÀßÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +ɬÍפʥ«¡¼¥Í¥ë¡¦¥ê¥½¡¼¥¹¤òÆÀ¤é¤ì¤Ê¤¤¡£ +.TP +.B ENOSYS +.BR io_setup () +¤¬¤³¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.PP +ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï 2002ǯ8·î¤Ë Linux 2.5 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +.PP +.BR io_setup () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç +»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ëÍѤΥé¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ + +.I libaio +¤Ç +.BR io_setup () +ÍѤËÄ󶡤µ¤ì¤Æ¤¤¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥¨¥é¡¼¤ÎÄÌÃΤ¬Ä̾ï¤Î C ¥é¥¤¥Ö¥é¥ê¤Î +´·½¬¤Ë¤·¤¿¤¬¤Ã¤Æ¤ª¤é¤º¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤ÏÉé¤Î¥¨¥é¡¼ÈÖ¹æ +(¥¨¥é¡¼¤ÎÀá¤ËÎóµó¤µ¤ì¤Æ¤¤¤ëÃͤΰì¤Ä¤òÉé¤Ë¤·¤¿¤â¤Î) ¤¬ÊÖ¤êÃͤȤʤ롣 +.BR syscall (2) +·Ðͳ¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤¹¤ë¤È¡¢ÊÖ¤êÃͤÏÄ̾ï¤Î¥¨¥é¡¼ÄÌÃΤδ·½¬¤Ë +¤·¤¿¤¬¤Ã¤Æ¤â¤Î¤È¤Ê¤ê¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï \-1 ¤¬Ê֤ꡢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ (Àµ¤Î) Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.PP +.BR io_cancel (2), +.BR io_destroy (2), +.BR io_getevents (2), +.BR io_submit (2) +.\" .SH Ãí +.\" .PP +.\" ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Benjamin LaHaise ¤¬½ñ¤¤¤¿¡£ +.\" .SH Ãø¼Ô +.\" Kent Yoder. diff --git a/release/man2/io_submit.2 b/release/man2/io_submit.2 new file mode 100644 index 00000000..cf9dbef3 --- /dev/null +++ b/release/man2/io_submit.2 @@ -0,0 +1,109 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" 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 +.\" .PP +.\" .. +.\" .de Sp \" Vertical space (when we can't use .PP) +.\" .if t .sp .5v +.\" .if n .sp +.\" .. +.\" .de Ip \" List item +.\" .br +.\" .ie \\n(.$>=3 .ne \\$3 +.\" .el .ne 3 +.\" .IP "\\$1" \\$2 +.\" .. +.TH IO_SUBMIT 2 2008-06-18 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +io_submit \- ÈóƱ´ü I/O ¥Ö¥í¥Ã¥¯¤ò½èÍýÂÔ¤Á¥­¥å¡¼¤ËÅÐÏ¿¤¹¤ë +.SH ½ñ¼° +.nf +.\" .ad l +.\" .hy 0 +.B #include +.\" #include +.sp +.\" .HP 16 +.BI "int io_submit(aio_context_t " ctx_id ", long " nr \ +", struct iocb **" iocbpp ); +.\" .ad +.\" .hy +.sp +\fI\-laio\fP ¤È¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.SH ÀâÌÀ +.PP +.BR io_submit () +¤Ï¡¢AIO ¥³¥ó¥Æ¥­¥¹¥È \fIctx_id\fP ¤Ë \fInr\fP ¸Ä¤Î I/O +¥ê¥¯¥¨¥¹¥È¤ò½èÍýÂÔ¤Á¤È¤·¤Æ¥­¥å¡¼¤ËÄɲ乤롣 +\fIiocbpp\fP ¤Ï¡¢AIO ¥³¥ó¥Æ¥­¥¹¥È \fIctx_id\fP ¤ËÅÐÏ¿¤µ¤ì¤ë \fInr\fP ¸Ä¤Î +AIO À©¸æ¥Ö¥í¥Ã¥¯¤ÎÇÛÎó¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR io_submit () +¤ÏÅÐÏ¿¤·¤¿ \fIiocb\fP ¤Î¸Ä¿ô¤òÊÖ¤¹ +(\fInr\fP ¤¬ 0 ¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹)¡£ +¼ºÇÔ»þ¤ÎÊÖ¤êÃͤˤĤ¤¤Æ¤Ï¡¢¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +²¿¸Ä¤«¤Î \fIiocb\fP ¤ò¥­¥å¡¼¤ËÆþ¤ì¤ë¤Î¤ËɬÍפʥ꥽¡¼¥¹¤¬ÆÀ¤é¤ì¤Ê¤¤¡£ +.TP +.B EBADF +ÀèƬ¤Î \fIiocb\fP ¤Ë»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.TP +.B EFAULT +¥Ç¡¼¥¿¹½Â¤¤ÎÃæ¤Ë̵¸ú¤Ê¥Ç¡¼¥¿¤ò»Ø¤·¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ë¡£ +.TP +.B EINVAL +\fIctx_id\fP ¤Ç»ØÄꤵ¤ì¤¿ \fIaio_context\fP ¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +\fInr\fP ¤¬ 0 ̤Ëþ¤Ç¤¢¤ë¡£ +*iocbpp[0] ¤Î \fIiocb\fP ¤¬Å¬Àڤ˽é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +»ØÄꤵ¤ì¤¿Áàºî¤¬¤½¤Î \fIiocb\fP Ãæ¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +̵¸ú¤Ç¤¢¤ë¡£ +.TP +.B ENOSYS +.BR io_submit () +¤Ï¤³¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.PP +ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï 2002ǯ8·î¤Ë Linux 2.5 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +.PP +.BR io_submit () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç +»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ëÍѤΥé¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ + +.I libaio +¤Ç +.BR io_submit () +ÍѤËÄ󶡤µ¤ì¤Æ¤¤¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥¨¥é¡¼¤ÎÄÌÃΤ¬Ä̾ï¤Î C ¥é¥¤¥Ö¥é¥ê¤Î +´·½¬¤Ë¤·¤¿¤¬¤Ã¤Æ¤ª¤é¤º¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤ÏÉé¤Î¥¨¥é¡¼ÈÖ¹æ +(¥¨¥é¡¼¤ÎÀá¤ËÎóµó¤µ¤ì¤Æ¤¤¤ëÃͤΰì¤Ä¤òÉé¤Ë¤·¤¿¤â¤Î) ¤¬ÊÖ¤êÃͤȤʤ롣 +.BR syscall (2) +·Ðͳ¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤¹¤ë¤È¡¢ÊÖ¤êÃͤÏÄ̾ï¤Î¥¨¥é¡¼ÄÌÃΤδ·½¬¤Ë +¤·¤¿¤¬¤Ã¤Æ¤â¤Î¤È¤Ê¤ê¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï \-1 ¤¬Ê֤ꡢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ (Àµ¤Î) Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR io_cancel (2), +.BR io_destroy (2), +.BR io_getevents (2), +.BR io_setup (2) +.\" .SH Ãí +.\" .PP +.\" ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Benjamin LaHaise ¤¬½ñ¤¤¤¿¡£ +.\" .SH Ãø¼Ô +.\" Kent Yoder. diff --git a/release/man2/ioctl.2 b/release/man2/ioctl.2 new file mode 100644 index 00000000..b8ceb553 --- /dev/null +++ b/release/man2/ioctl.2 @@ -0,0 +1,163 @@ +.\" Copyright (c) 1980, 1991 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. +.\" +.\" @(#)ioctl.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified 1993-07-23 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" 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 +.\" +.\"WORD: device ¥Ç¥Ð¥¤¥¹ +.\"WORD: control À©¸æ¤¹¤ë +.\"WORD: special ¥¹¥Ú¥·¥ã¥ë +.\"WORD: character ¥­¥ã¥é¥¯¥¿ +.\"WORD: parameter ¥Ñ¥é¥á¡¼¥¿ +.\"WORD: operate Áàºî +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: request ¥ê¥¯¥¨¥¹¥È +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: argument °ú¤­¿ô +.\"WORD: encode ¥¨¥ó¥³¡¼¥É +.\" +.TH IOCTL 2 2000-09-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ioctl \- ¥Ç¥Ð¥¤¥¹ (device) ¤òÀ©¸æ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int ioctl(int " d ", int " request ", ...);" +.SH ÀâÌÀ +.BR ioctl () +´Ø¿ô¤Ï¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤ò¹½À®¤¹¤ë¥Ç¥Ð¥¤¥¹¤Î¥Ñ¥é¥á¡¼¥¿¤ò +Áàºî¤¹¤ë¡£Æäˡ¢¥­¥ã¥é¥¯¥¿·¿¤Î¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë(Î㤨¤ÐüËö(terminal)) +¤Î¿¤¯¤ÎÁàºî²Äǽ¤ÊÆÃÀ­¤ò +.BR ioctl () +¥ê¥¯¥¨¥¹¥È¤Ë¤è¤Ã¤ÆÀ©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£°ú¤­¿ô +.I d +¤Ï¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +2ÈÖÌܤΰú¤­¿ô¤Ï¡¢¥Ç¥Ð¥¤¥¹°Í¸¤Î¥ê¥¯¥¨¥¹¥È¡¦¥³¡¼¥É¤Ç¤¢¤ë¡£ +3ÈÖÌܤΰú¤­¿ô¤Ï¡¢¥á¥â¥ê¤Ø¤Î·¿¤ò»ØÄꤷ¤Ê¤¤¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤³¤Î°ú¤­¿ô¤ÏÅÁÅýŪ¤Ë(C ¤Ç +.B "void *" +¤¬Í­¸ú¤Ë¤Ê¤ëÁ°¤«¤é) +.BI "char *" argp +¤Èɽµ­¤µ¤ì¤Æ¤¤¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Îʸ¾Ï¤Ç¤â¤½¤Î¤è¤¦¤Ë̾ÉÕ¤±¤ë¤³¤È¤È¤¹¤ë¡£ +.PP +.BR ioctl () +.I request +¤Ë¤Ï¡¢°Ê²¼¤Î¾ðÊó¤ò¥Ð¥¤¥È¿ô¤Ç¥¨¥ó¥³¡¼¥É¤¹¤ë: +(1)°ú¤­¿ô¤¬ +.I ÆþÎÏ +¥Ñ¥é¥á¡¼¥¿¤« +.I ½ÐÎÏ +¥Ñ¥é¥á¡¼¥¿¤Î¤É¤Á¤é¤«¤Ç¤¢¤ë¤«¡¢ +(2) +.I argp +¤ÎÂ礭¤µ¡£ +.BR ioctl () +.I request +¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Þ¥¯¥í(macro)¤ÈÄêµÁ¤Ï +.I +¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR ioctl () +requests use the return value as an output parameter +¤¿¤¤¤Æ¤¤¤Î¾ì¹ç¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£ +¤¤¤¯¤Ä¤«¤Î +.BR ioctl () +Í×µá¤Ç¤Ï½ÐÎϥѥé¥á¡¼¥¿¤È¤·¤ÆÊÖ¤êÃͤò»ÈÍѤ·¤Æ¤¤¤¿¤ê¡¢ +À®¸ù¤·¤¿¾ì¹ç¤ËÈó 0 ¤ÎÃͤòÊÖ¤·¤¿¤ê¤¹¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP 0.7i +.B EBADF +.I d +¤¬Í­¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EFAULT +.I argp +¤¬¥¢¥¯¥»¥¹ÉÔ²Äǽ¤Ê¥á¥â¥ê¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I request +¤Þ¤¿¤Ï +.I argp +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B ENOTTY +.I d +¤¬¥­¥ã¥é¥¯¥¿·¿¤Î¥¹¥Ú¥·¥ã¥ë¡¦¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTTY +»ØÄꤵ¤ì¤¿¥ê¥¯¥¨¥¹¥È¤Ï¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I d +¤¬»²¾È¤¹¤ë¼ïÎà¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤ÏŬÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.SH ½àµò +¤É¤ì¤«°ì¤Ä¤Îɸ½à¤ËÂбþ¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.BR ioctl () +¤Î°ú¤­¿ô¡¢ÊÖ¤êÃÍ¡¢²ò¼á¤Ï¡¢½èÍýÂоݤΥǥХ¤¥¹¡¦¥É¥é¥¤¥Ð¤´¤È¤Ë +°Û¤Ê¤ë(¤³¤Î´Ø¿ô¤Ï Unix ¤Î ¥¹¥È¥ê¡¼¥à I/O ¥â¥Ç¥ë ¤Ë +ÌÀ¤é¤«¤ËŬ¹ç¤·¤Ê¤¤ÍÍ¡¹¤ÊÁàºî¤Ë»ÈÍѤµ¤ì¤ë)¡£ +¤è¤¯ÃΤé¤ì¤Æ¤¤¤ë +.BR ioctl () +¤Î¥ê¥¹¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR ioctl_list (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.BR ioctl () +´Ø¿ô¥³¡¼¥ë¤Ï Version 7 AT&T Unix ¤ÇÅо줷¤¿¡£ +.SH Ãí°Õ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Ë¤Ï¡¢¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +ɬÍפǤ¢¤ë¡£¤·¤Ð¤·¤Ð +.BR open (2) +¥³¡¼¥ë¤Ï˾¤ó¤Ç¤¤¤Ê¤¤ÉûºîÍѤòȼ¤¦¤³¤È¤¬¤¢¤ë¤¬¡¢Linux ¤Ç¤Ï +.BR open (2) +¤Ë +.B O_NONBLOCK +¥Õ¥é¥°¤ò¤Ä¤±¤ë¤³¤È¤Ç¤³¤ÎÉûºîÍѤòÈò¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR execve (2), +.BR fcntl (2), +.BR ioctl_list (2), +.BR open (2), +.\" .BR mt (4), +.BR sd (4), +.BR tty (4) diff --git a/release/man2/ioctl_list.2 b/release/man2/ioctl_list.2 new file mode 100644 index 00000000..1dc23895 --- /dev/null +++ b/release/man2/ioctl_list.2 @@ -0,0 +1,876 @@ +.\" Ioctl List 1.3.27 +.\" Sun 17 Sep 1995 +.\" Michael Elizabeth Chastain +.\" +.\" +.\" // Copyright +.\" +.\" Ioctl List 1.3.27 is copyright 1995 by Michael Elizabeth Chastain. +.\" It is licensed under the Gnu Public License, Version 2. +.\" +.\" +.\" +.\" // Change Log +.\" +.\" 1.3.27 421 ioctls. +.\" Type information for non-pointer args. +.\" SIOCDEVPRIVATE, SIOCPROTOPRIVATE ioctls. +.\" Descriptions of extended arguments. +.\" +.\" 1.2.9 365 ioctls. +.\" First public version. +.\" +.\" +.\" 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 +.\" +.TH IOCTL_LIST 2 2007-12-29 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ioctl_list \- Linux/i386 ¥«¡¼¥Í¥ë¤Î ioctl ¤Î¥ê¥¹¥È +.SH ÀâÌÀ +¤³¤Îʸ¾Ï¤Ï ioctl ¥ê¥¹¥È 1.3.27¡¢¤Ä¤Þ¤ê Linux/i386 ¥«¡¼¥Í¥ë 1.3.27 ¤Ë +¤ª¤±¤ë ioctl ¥³¡¼¥ë¤Î°ìÍ÷¤Ç¤¹¡£¤³¤Î¥ê¥¹¥È¤Ï +.I +¤Ë¤¢¤ë 421 ¤Î ioctl ¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£Á´¤Æ¤Î ioctl ¤ËÂФ·¤Æ¡¢¿ôÃÍ¡¢Ì¾¾Î¡¢ +°ú¤­¿ô¤Î·¿¤òÎóµó¤·¤Æ¤¢¤ê¤Þ¤¹¡£ +.PP +°ú¤­¿ô·¿ +.I const struct foo * +¤Ï¡¢¤½¤Î°ú¤­¿ô¤¬¥«¡¼¥Í¥ë¤Ø¤ÎÆþÎϤǤ¢¤ë»ö¤ò°ÕÌ£¤·¤Þ¤¹¡£¤Þ¤¿¡¢ +.I struct foo * +¤Ï¡¢¤½¤Î°ú¤­¿ô¤¬¥«¡¼¥Í¥ë¤«¤é¤Î½ÐÎϤǤ¢¤ë»ö¤ò°ÕÌ£¤·¤Þ¤¹¡£ +¥«¡¼¥Í¥ë¤¬¤½¤Î°ú¤­¿ô¤òÆþÎϤȽÐÎϤÎξÊý¤Ë»ÈÍѤ¹¤ë¾ì¹ç¤Ï¡¢ +\fI//\ I-O\fP ¥Þ¡¼¥¯¤òÉÕ¤±¤Æ¤¢¤ê¤Þ¤¹¡£ +.PP +¤¤¤¯¤Ä¤«¤Î ioctl ¤ÏÊ£¿ô¤Î¹½Â¤ÂΤΰú¤­¿ô¤òɬÍפȤ·¤¿¤ê¡¢ÃͤòÊÖ¤·¤¿¤ê +¤·¤Þ¤¹¡£¤³¤ì¤é¤Ë¤Ï \fI//\ MORE\fP ¥Þ¡¼¥¯¤òÉÕ¤±¤Æ¡¢ +¤µ¤é¤ËʬΥ¤·¤¿¥»¥¯¥·¥ç¥ó¤ÇÀâÌÀ¤·¤Æ¤¢¤ê¤Þ¤¹¡£ +.PP +¤³¤Î¥ê¥¹¥È¤ÏÉÔ´°Á´¤Ç¤¹¡£ +.SS "ioctl ¤Î¹½Â¤" +.\" 2 ¤Ä¤Î¥»¥¯¥·¥ç¥ó¤òÄɲà - aeb +ioctl ¥³¥Þ¥ó¥É¤ÎÃÍ¤Ï 32 ¥Ó¥Ã¥È¤ÎÄê¿ô¤Ç¤¹¡£ +¸¶Â§¤È¤·¤Æ¡¢¤³¤ì¤é¤ÎÄê¿ô¤ÏÁ´¤¯Ç¤°Õ¤Î¤â¤Î¤Ç¤¹¤¬¡¢ +À߷׼Ԥϲ¿¤é¤«¤Î¹½Â¤¤ò¤³¤ì¤é¤ÎÄê¿ô¤ËÁȤ߹þ¤â¤¦¤È¤·¤Æ¤¤¤Þ¤¹¡£ +.LP +ÀΤΠ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 ¥É¥é¥¤¥Ð¤òɽ¤·¤Þ¤¹¡£ +.LP +¸å¤Î»þÂå (0.98p5) ¤Ë¤Ê¤ë¤È¡¢ +¤è¤ê¿¤¯¤Î¾ðÊ󤬿ôÃͤËÁȤ߹þ¤Þ¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£ +1 ¤Ä¤Î¿ôÃͤϡ¢Æɤ߽ñ¤­¤ÎÊý¸þ¤òɽ¤¹ 2 ¥Ó¥Ã¥È +(00: Æɤ߽ñ¤­¤Ê¤·, 01: ½ñ¤­¹þ¤ß, 10: Æɤ߹þ¤ß, 11: Æɤ߹þ¤ß/½ñ¤­¹þ¤ß)¡¢ +(°ú¤­¿ô¤Î¥µ¥¤¥º¤òɽ¤¹) 14 ¥Ó¥Ã¥È¡¢ +(¶¦Ä̤ÎÌÜŪ¤Þ¤¿¤Ï¶¦Ä̤Υɥ饤¥Ð¤Ç ioctl ¤ò¥°¥ë¡¼¥×¤Ë¤¹¤ë¤¿¤á¤Î) +8 ¥Ó¥Ã¥È¤Î¥¿¥¤¥×¡¢8 ¥Ó¥Ã¥È¤Î¥·¥ê¥¢¥ëÈֹ椫¤é¹½À®¤µ¤ì¤Þ¤¹¡£ +.LP +¤³¤Î¹½Â¤¤òµ­½Ò¤¹¤ë¥Þ¥¯¥í¤Ï \fI\fP ¤Ë¤¢¤ê¡¢ +.B _IO(type,nr) +¤È +.B "{_IOR,_IOW,_IOWR}(type,nr,size)" +¤Ç¤¹¡£ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï +.I sizeof(size) +¤ò»È¤¦¤Î¤Ç¡¢ +¤³¤³¤Ç size ¤È¤¤¤¦Ì¾Á°¤Ë¤·¤Æ¤¤¤ë¤Î¤Ï´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹: +¤³¤Î 3 ¤ÄÌܤΰú¤­¿ô¤Ï¥Ç¡¼¥¿¥¿¥¤¥×¤Ç¤¹¡£ +.LP +size ¥Ó¥Ã¥È¤ÏÁ´¤¯Åö¤Æ¤Ë¤Ê¤é¤Ê¤¤ÅÀ¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤: +¿¤¯¤Î¾ì¹ç¡¢´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹¡£ +¤³¤ì¤Ï +.I sizeof(sizeof(struct)) +¤ò»È¤Ã¤¿¥Ð¥°¤ò´Þ¤ó¤À¥Þ¥¯¥í¤ä¡¢²áµî¤«¤é¼õ¤±·Ñ¤¤¤ÀÃͤ¬¸¶°ø¤Ç¤¹¡£ +.LP +¤·¤¿¤¬¤Ã¤Æ¡¢¿·¤·¤¤¹½Â¤¤ÏÉÔÅÔ¹ç¤ÊÅÀ¤·¤«¤Ê¤¤¤è¤¦¤Ë»×¤ï¤ì¤Þ¤¹: +¤³¤Î¹½Â¤¤Ï¥Á¥§¥Ã¥¯¤Î¼ê½õ¤±¤Ë¤Ï¤Ê¤é¤º¡¢ +ÍÍ¡¹¤Ê¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤è¤Ã¤ÆÃͤòÊѲ½¤µ¤»¤Æ¤·¤Þ¤¤¤Þ¤¹¡£ +.SH ÊÖ¤êÃÍ +¤­¤Á¤ó¤È¤·¤¿ ioctl ¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤·¡¢ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¤Þ¤¹¡£ +¤Þ¤¿½ÐÎÏÃͤϰú¤­¿ô¤Ë³ÊǼ¤·¤Þ¤¹¡£ +¤·¤«¤·¼ÂºÝ¤Ï¡¢¤«¤Ê¤ê¿¤¯¤Î ioctl ¤¬½ÐÎÏÃͤòÊÖ¤·¤Þ¤¹¡£ +¤³¤ì¤Ïº£¤Î¤È¤³¤í°Ê²¼¤Ç¤Ï¼¨¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ + +// Main table. + +// +.TS +l l l. +0x00008901 FIOSETOWN const int * +0x00008902 SIOCSPGRP const int * +0x00008903 FIOGETOWN int * +0x00008904 SIOCGPGRP int * +0x00008905 SIOCATMAR int * +0x00008906 SIOCGSTAMP timeval * +.TE + +// +.TS +l l l l. +0x00005401 TCGETS struct termios * +0x00005402 TCSETS const struct termios * +0x00005403 TCSETSW const struct termios * +0x00005404 TCSETSF const struct termios * +0x00005405 TCGETA struct termio * +0x00005406 TCSETA const struct termio * +0x00005407 TCSETAW const struct termio * +0x00005408 TCSETAF const struct termio * +0x00005409 TCSBRK int +0x0000540A TCXONC int +0x0000540B TCFLSH int +0x0000540C TIOCEXCL void +0x0000540D TIOCNXCL void +0x0000540E TIOCSCTTY int +0x0000540F TIOCGPGRP pid_t * +0x00005410 TIOCSPGRP const pid_t * +0x00005411 TIOCOUTQ int * +0x00005412 TIOCSTI const char * +0x00005413 TIOCGWINSZ struct winsize * +0x00005414 TIOCSWINSZ const struct winsize * +0x00005415 TIOCMGET int * +0x00005416 TIOCMBIS const int * +0x00005417 TIOCMBIC const int * +0x00005418 TIOCMSET const int * +0x00005419 TIOCGSOFTCAR int * +0x0000541A TIOCSSOFTCAR const int * +0x0000541B FIONREAD int * +0x0000541B TIOCINQ int * +0x0000541C TIOCLINUX const char * // MORE +0x0000541D TIOCCONS void +0x0000541E TIOCGSERIAL struct serial_struct * +0x0000541F TIOCSSERIAL const struct serial_struct * +0x00005420 TIOCPKT const int * +0x00005421 FIONBIO const int * +0x00005422 TIOCNOTTY void +0x00005423 TIOCSETD const int * +0x00005424 TIOCGETD int * +0x00005425 TCSBRKP int +0x00005426 TIOCTTYGSTRUCT struct tty_struct * +0x00005450 FIONCLEX void +0x00005451 FIOCLEX void +0x00005452 FIOASYNC const int * +0x00005453 TIOCSERCONFIG void +0x00005454 TIOCSERGWILD int * +0x00005455 TIOCSERSWILD const int * +0x00005456 TIOCGLCKTRMIOS struct termios * +0x00005457 TIOCSLCKTRMIOS const struct termios * +0x00005458 TIOCSERGSTRUCT struct async_struct * +0x00005459 TIOCSERGETLSR int * +0x0000545A TIOCSERGETMULTI struct serial_multiport_struct * +0x0000545B TIOCSERSETMULTI const struct serial_multiport_struct * +.TE + +// +.TS +l l l l. +0x000089E0 SIOCAX25GETUID const struct sockaddr_ax25 * +0x000089E1 SIOCAX25ADDUID const struct sockaddr_ax25 * +0x000089E2 SIOCAX25DELUID const struct sockaddr_ax25 * +0x000089E3 SIOCAX25NOUID const int * +0x000089E4 SIOCAX25DIGCTL const int * +0x000089E5 SIOCAX25GETPARMS struct ax25_parms_struct * // I-O +0x000089E6 SIOCAX25SETPARMS const struct ax25_parms_struct * +.TE + +// +.TS +l l l l. +0x00007314 STL_BINTR void +0x00007315 STL_BSTART void +0x00007316 STL_BSTOP void +0x00007317 STL_BRESET void +.TE + +// +.TS +l l l l. +0x00005301 CDROMPAUSE void +0x00005302 CDROMRESUME void +0x00005303 CDROMPLAYMSF const struct cdrom_msf * +0x00005304 CDROMPLAYTRKIND const struct cdrom_ti * +0x00005305 CDROMREADTOCHDR struct cdrom_tochdr * +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 +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 +0x00005311 CDROM_GET_UPC struct { char [8]; } * +0x00005312 CDROMRESET void +0x00005313 CDROMVOLREAD struct cdrom_volctrl * +0x00005314 CDROMREADRAW const struct cdrom_msf * // MORE +0x00005315 CDROMREADCOOKED const struct cdrom_msf * // MORE +0x00005316 CDROMSEEK const struct cdrom_msf * +.TE + +// +.TS +l l l l. +0x00002000 CM206CTL_GET_STAT int +0x00002001 CM206CTL_GET_LAST_STAT int +.TE + +// +.TS +l l l l. +0x00435901 CYGETMON struct cyclades_monitor * +0x00435902 CYGETTHRESH int * +0x00435903 CYSETTHRESH int +0x00435904 CYGETDEFTHRESH int * +0x00435905 CYSETDEFTHRESH int +0x00435906 CYGETTIMEOUT int * +0x00435907 CYSETTIMEOUT int +0x00435908 CYGETDEFTIMEOUT int * +0x00435909 CYSETDEFTIMEOUT int +.TE + +// +.TS +l l l l. +0x80046601 EXT2_IOC_GETFLAGS int * +0x40046602 EXT2_IOC_SETFLAGS const int * +0x80047601 EXT2_IOC_GETVERSION int * +0x40047602 EXT2_IOC_SETVERSION const int * +.TE + +// +.TS +l l l l. +0x00000000 FDCLRPRM void +0x00000001 FDSETPRM const struct floppy_struct * +0x00000002 FDDEFPRM const struct floppy_struct * +0x00000003 FDGETPRM struct floppy_struct * +0x00000004 FDMSGON void +0x00000005 FDMSGOFF void +0x00000006 FDFMTBEG void +0x00000007 FDFMTTRK const struct format_descr * +0x00000008 FDFMTEND void +0x0000000A FDSETEMSGTRESH int +0x0000000B FDFLUSH void +0x0000000C FDSETMAXERRS const struct floppy_max_errors * +0x0000000E FDGETMAXERRS struct floppy_max_errors * +0x00000010 FDGETDRVTYP struct { char [16]; } * +0x00000014 FDSETDRVPRM const struct floppy_drive_params * +0x00000015 FDGETDRVPRM struct floppy_drive_params * +0x00000016 FDGETDRVSTAT struct floppy_drive_struct * +0x00000017 FDPOLLDRVSTAT struct floppy_drive_struct * +0x00000018 FDRESET int +0x00000019 FDGETFDCSTAT struct floppy_fdc_state * +0x0000001B FDWERRORCLR void +0x0000001C FDWERRORGET struct floppy_write_errors * +0x0000001E FDRAWCMD struct floppy_raw_cmd * // MORE // I-O +0x00000028 FDTWADDLE void +.TE + +// +.TS +l l l l. +0x0000125D BLKROSET const int * +0x0000125E BLKROGET int * +0x0000125F BLKRRPART void +0x00001260 BLKGETSIZE unsigned long * +0x00001261 BLKFLSBUF void +0x00001262 BLKRASET int +0x00001263 BLKRAGET int * +0x00000001 FIBMAP int * // I-O +0x00000002 FIGETBSZ int * +.TE + +// +.TS +l l l l. +0x00000301 HDIO_GETGEO struct hd_geometry * +0x00000302 HDIO_GET_UNMASKINTR int * +0x00000304 HDIO_GET_MULTCOUNT int * +0x00000307 HDIO_GET_IDENTITY struct hd_driveid * +0x00000308 HDIO_GET_KEEPSETTINGS int * +0x00000309 HDIO_GET_CHIPSET int * +0x0000030A HDIO_GET_NOWERR int * +0x0000030B HDIO_GET_DMA int * +0x0000031F HDIO_DRIVE_CMD int * // I-O +0x00000321 HDIO_SET_MULTCOUNT int +0x00000322 HDIO_SET_UNMASKINTR int +0x00000323 HDIO_SET_KEEPSETTINGS int +0x00000324 HDIO_SET_CHIPSET int +0x00000325 HDIO_SET_NOWERR int +0x00000326 HDIO_SET_DMA int +.TE + +// +.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 +.TE + +// +.TS +l l l l. +0x000089F0 SIOCDEVPLIP struct ifreq * // I-O +.TE + +// +.TS +l l l l. +0x00005490 PPPIOCGFLAGS int * +0x00005491 PPPIOCSFLAGS const int * +0x00005492 PPPIOCGASYNCMAP int * +0x00005493 PPPIOCSASYNCMAP const int * +0x00005494 PPPIOCGUNIT int * +0x00005495 PPPIOCSINPSIG const int * +0x00005497 PPPIOCSDEBUG const int * +0x00005498 PPPIOCGDEBUG int * +0x00005499 PPPIOCGSTAT struct ppp_stats * +0x0000549A PPPIOCGTIME struct ppp_ddinfo * +0x0000549B PPPIOCGXASYNCMAP struct { int [8]; } * +0x0000549C PPPIOCSXASYNCMAP const struct { int [8]; } * +0x0000549D PPPIOCSMRU const int * +0x0000549E PPPIOCRASYNCMAP const int * +0x0000549F PPPIOCSMAXCID const int * +.TE + +// +.TS +l l l l. +0x000089E0 SIOCAIPXITFCRT const char * +0x000089E1 SIOCAIPXPRISLT const char * +0x000089E2 SIOCIPXCFGDATA struct ipx_config_data * +.TE + +// +.TS +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 +0x00004B6C PIO_FONTX const struct console_font_desc * //MORE +0x00004B70 GIO_CMAP struct { char [48]; } * +0x00004B71 PIO_CMAP const struct { char [48]; } +0x00004B2F KIOCSOUND int +0x00004B30 KDMKTONE int +0x00004B31 KDGETLED char * +0x00004B32 KDSETLED int +0x00004B33 KDGKBTYPE char * +0x00004B34 KDADDIO int // MORE +0x00004B35 KDDELIO int // MORE +0x00004B36 KDENABIO void // MORE +0x00004B37 KDDISABIO void // MORE +0x00004B3A KDSETMODE int +0x00004B3B KDGETMODE int * +0x00004B3C KDMAPDISP void // MORE +0x00004B3D KDUNMAPDISP void // MORE +0x00004B40 GIO_SCRNMAP struct { char [E_TABSZ]; } * +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 +0x00004B67 PIO_UNIMAP const struct unimapdesc * // MORE +0x00004B68 PIO_UNIMAPCLR const struct unimapinit * +0x00004B44 KDGKBMODE int * +0x00004B45 KDSKBMODE int +0x00004B62 KDGKBMETA int * +0x00004B63 KDSKBMETA int +0x00004B64 KDGKBLED int * +0x00004B65 KDSKBLED int +0x00004B46 KDGKBENT struct kbentry * // I-O +0x00004B47 KDSKBENT const struct kbentry * +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 +0x00004B4D KDSETKEYCODE const struct kbkeycode * +0x00004B4E KDSIGACCEPT int +.TE + +// +.TS +l l l l. +0x00000601 LPCHAR int +0x00000602 LPTIME int +0x00000604 LPABORT int +0x00000605 LPSETIRQ int +0x00000606 LPGETIRQ int * +0x00000608 LPWAIT int +0x00000609 LPCAREFUL int +0x0000060A LPABORTOPEN int +0x0000060B LPGETSTATUS int * +0x0000060C LPRESET void +0x0000060D LPGETSTATS struct lp_stats * +.TE + +// +.TS +l l l l. +0x000089E0 SIOCGETVIFCNT struct sioc_vif_req * // I-O +0x000089E1 SIOCGETSGCNT struct sioc_sg_req * // I-O +.TE + +// +.TS +l l l l. +0x40086D01 MTIOCTOP const struct mtop * +0x801C6D02 MTIOCGET struct mtget * +0x80046D03 MTIOCPOS struct mtpos * +0x80206D04 MTIOCGETCONFIG struct mtconfiginfo * +0x40206D05 MTIOCSETCONFIG const struct mtconfiginfo * +.TE + +// +.TS +l l l l. +0x000089E0 SIOCNRGETPARMS struct nr_parms_struct * // I-O +0x000089E1 SIOCNRSETPARMS const struct nr_parms_struct * +0x000089E2 SIOCNRDECOBS void +0x000089E3 SIOCNRRTCTL const int * +.TE + +// +.TS +l l l l. +0x00009000 DDIOCSDBG const int * +0x00005382 CDROMAUDIOBUFSIZ int +.TE + +// +.TS +l l l l. +0x00005470 TIOCSCCINI void +0x00005471 TIOCCHANINI const struct scc_modem * +0x00005472 TIOCGKISS struct ioctl_command * // I-O +0x00005473 TIOCSKISS const struct ioctl_command * +0x00005474 TIOCSCCSTAT struct scc_stat * +.TE + +// +.TS +l l l l. +0x00005382 SCSI_IOCTL_GET_IDLUN struct { int [2]; } * +0x00005383 SCSI_IOCTL_TAGGED_ENABLE void +0x00005384 SCSI_IOCTL_TAGGED_DISABLE void +0x00005385 SCSI_IOCTL_PROBE_HOST const int * // MORE +.TE + +// +.TS +l l l l. +0x80027501 SMB_IOC_GETMOUNTUID uid_t * +.TE + +// +.TS +l l l l. +0x0000890B SIOCADDRT const struct rtentry * // MORE +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 +0x00008914 SIOCSIFFLAGS const struct ifreq * +0x00008915 SIOCGIFADDR struct ifreq * // I-O +0x00008916 SIOCSIFADDR const struct ifreq * +0x00008917 SIOCGIFDSTADDR struct ifreq * // I-O +0x00008918 SIOCSIFDSTADDR const struct ifreq * +0x00008919 SIOCGIFBRDADDR struct ifreq * // I-O +0x0000891A SIOCSIFBRDADDR const struct ifreq * +0x0000891B SIOCGIFNETMASK struct ifreq * // I-O +0x0000891C SIOCSIFNETMASK const struct ifreq * +0x0000891D SIOCGIFMETRIC struct ifreq * // I-O +0x0000891E SIOCSIFMETRIC const struct ifreq * +0x0000891F SIOCGIFMEM struct ifreq * // I-O +0x00008920 SIOCSIFMEM const struct ifreq * +0x00008921 SIOCGIFMTU struct ifreq * // I-O +0x00008922 SIOCSIFMTU const struct ifreq * +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 +0x00008929 SIOCGIFSLAVE void +0x00008930 SIOCSIFSLAVE void +0x00008931 SIOCADDMULTI const struct ifreq * +0x00008932 SIOCDELMULTI const struct ifreq * +0x00008940 SIOCADDRTOLD void +0x00008941 SIOCDELRTOLD void +0x00008950 SIOCDARP const struct arpreq * +0x00008951 SIOCGARP struct arpreq * // I-O +0x00008952 SIOCSARP const struct arpreq * +0x00008960 SIOCDRARP const struct arpreq * +0x00008961 SIOCGRARP struct arpreq * // I-O +0x00008962 SIOCSRARP const struct arpreq * +0x00008970 SIOCGIFMAP struct ifreq * // I-O +0x00008971 SIOCSIFMAP const struct ifreq * +.TE + +// +.TS +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 +0x80045104 SNDCTL_SEQ_GETOUTCOUNT int * +0x80045105 SNDCTL_SEQ_GETINCOUNT int * +0x40045106 SNDCTL_SEQ_PERCMODE void +0x40285107 SNDCTL_FM_LOAD_INSTR const struct sbi_instrument * +0x40045108 SNDCTL_SEQ_TESTMIDI const int * +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 +0x4004510D SNDCTL_SEQ_THRESHOLD const int * +0xC004510E SNDCTL_SYNTH_MEMAVL int * // I-O +0x4004510F SNDCTL_FM_4OP_ENABLE const int * +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 +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 +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 +0xC0046D01 SNDCTL_MIDI_MPUMODE const int * +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 +0x00005008 SNDCTL_DSP_POST void +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 +0x800C500C SNDCTL_DSP_GETOSPACE struct audio_buf_info * +0x800C500D SNDCTL_DSP_GETISPACE struct audio_buf_info * +0x0000500E SNDCTL_DSP_NONBLOCK void +0x80045002 SOUND_PCM_READ_RATE int * +0x80045006 SOUND_PCM_READ_CHANNELS int * +0x80045005 SOUND_PCM_READ_BITS int * +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 +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 +0x4FA44308 SNDCTL_COPR_SENDMSG const struct copr_msg * +0x8FA44309 SNDCTL_COPR_RCVMSG struct copr_msg * +0x80044D00 SOUND_MIXER_READ_VOLUME int * +0x80044D01 SOUND_MIXER_READ_BASS int * +0x80044D02 SOUND_MIXER_READ_TREBLE int * +0x80044D03 SOUND_MIXER_READ_SYNTH int * +0x80044D04 SOUND_MIXER_READ_PCM int * +0x80044D05 SOUND_MIXER_READ_SPEAKER int * +0x80044D06 SOUND_MIXER_READ_LINE int * +0x80044D07 SOUND_MIXER_READ_MIC int * +0x80044D08 SOUND_MIXER_READ_CD int * +0x80044D09 SOUND_MIXER_READ_IMIX int * +0x80044D0A SOUND_MIXER_READ_ALTPCM int * +0x80044D0B SOUND_MIXER_READ_RECLEV int * +0x80044D0C SOUND_MIXER_READ_IGAIN int * +0x80044D0D SOUND_MIXER_READ_OGAIN int * +0x80044D0E SOUND_MIXER_READ_LINE1 int * +0x80044D0F SOUND_MIXER_READ_LINE2 int * +0x80044D10 SOUND_MIXER_READ_LINE3 int * +0x80044D1C SOUND_MIXER_READ_MUTE int * +0x80044D1D SOUND_MIXER_READ_ENHANCE int * +0x80044D1E SOUND_MIXER_READ_LOUD int * +0x80044DFF SOUND_MIXER_READ_RECSRC int * +0x80044DFE SOUND_MIXER_READ_DEVMASK int * +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 +.TE + +// +.TS +l l l l. +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 +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 +0x000004D9 UMSDOS_GETVERSION struct umsdos_ioctl * +0x000004DA UMSDOS_INIT_EMD void +0x000004DB UMSDOS_DOS_SETUP const struct umsdos_ioctl * +0x000004DC UMSDOS_RENAME_DOS const struct umsdos_ioctl * +.TE + +// +.TS +l l l l. +0x00005600 VT_OPENQRY int * +0x00005601 VT_GETMODE struct vt_mode * +0x00005602 VT_SETMODE const struct vt_mode * +0x00005603 VT_GETSTATE struct vt_stat * +0x00005604 VT_SENDSIG void +0x00005605 VT_RELDISP int +0x00005606 VT_ACTIVATE int +0x00005607 VT_WAITACTIVE int +0x00005608 VT_DISALLOCATE int +0x00005609 VT_RESIZE const struct vt_sizes * +0x0000560A VT_RESIZEX const struct vt_consize * +.TE + +// More arguments. +¤¤¤¯¤Ä¤«¤Î ioctl ¤ÏÄɲäΥݥ¤¥ó¥¿¤ò´Þ¤à¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò»ÈÍѤ·¤Þ¤¹¡£ +¤³¤³¤Ç¤³¤ì¤é¤ò¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤ËÀâÌÀ¤·¤Þ¤¹¡£ + +.B CDROMREADAUDIO +¤ÏÆþÎϥݥ¤¥ó¥¿ +.I "const struct cdrom_read_audio *" +¤ò»ÈÍѤ·¤Þ¤¹¡£ +.I buf +¥Õ¥£¡¼¥ë¥É¤ÏÂ礭¤µ +.IR "nframes * CD_FRAMESIZE_RAW" +¤Î½ÐÎϥХåե¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¹¡£ + +.BR CDROMREADCOOKED , +.BR CDROMREADMODE1 , +.BR CDROMREADMODE2 , +.B CDROMREADRAW +¤ÏÆþÎϥݥ¤¥ó¥¿ +.I const struct cdrom_msf * +¤ò»ÈÍѤ·¤Þ¤¹¡£¤³¤ì¤é¤ÏƱ¤¸¥Ý¥¤¥ó¥¿¤ò +.I char [] +¤Ø¤Î½ÐÎϥݥ¤¥ó¥¿¤È¤·¤Æ»ÈÍѤ·¤Þ¤¹¡£ +Ťµ¤ÏÍ×µá¤Ë¤è¤Ã¤ÆÊѲ½¤·¤Þ¤¹¡£ +.B CDROMREADMODE1 +¤Ë¤Ï¡¢Â¿¤¯¤Î¥Ç¥Ð¥¤¥¹¤¬ +CD_FRAMESIZE ¤ò»ÈÍѤ·¤Þ¤¹¤¬¡¢¸÷³Øµ­²±ÁõÃÖ (¸÷¥Ç¥£¥¹¥¯) ¤Î¥É¥é¥¤¥Ð¤Ï +OPT_BLOCKSIZE ¤ò»ÈÍѤ·¤Þ¤¹ (¤É¤Á¤é¤âƱ¤¸ÃÍ¤Ç 2048 ¤Ç¤¹)¡£ +.nf + + CDROMREADCOOKED char [CD_FRAMESIZE] + CDROMREADMODE1 char [CD_FRAMESIZE or OPT_BLOCKSIZE] + CDROMREADMODE2 char [CD_FRAMESIZE_RAW0] + CDROMREADRAW char [CD_FRAMESIZE_RAW] + +.fi +.BR EQL_ENSLAVE , +.BR EQL_EMANCIPATE , +.BR EQL_GETSLAVECFG , +.BR EQL_SETSLAVECFG , +.BR EQL_GETMASTERCFG , +.B EQL_SETMASTERCFG +¤Ï +.I struct ifreq * +¤ò»ÈÍѤ·¤Þ¤¹¡£ +.I ifr_data +¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤Ë¼¨¤¹Ê̤ι½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¹: +.nf + + EQL_ENSLAVE const struct slaving_request * + EQL_EMANCIPATE const struct slaving_request * + 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 +.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 +¤Î½ÐÎϥХåե¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ë¤Ê¤ê¤Þ¤¹¡£ + +.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 +¤ÎÆþÎϥХåե¡¤Ç¤¹¡£ + +.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 +¤ÎÆþÎϥХåե¡¤Ç¤¹¡£ + +KDADDIO, KDDELIO, KDDISABIO, KDENABIO ¤Ï I/O ¥Ý¡¼¥È¤Ø¤Î¥¢¥¯¥»¥¹¤ò +²Äǽ/ÉÔ²Äǽ¤Ë¤·¤Þ¤¹¡£¤³¤ì¤é¤ÏËܼÁŪ¤Ë¡¢'ioperm' ¤Ø¤ÎÊ̤Π+¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¹¡£ + +.BR KDMAPDISP , +.B KDUNMAPDISP +¤Ï¥á¥â¥ê¡¦¥Þ¥Ã¥Ô¥ó¥°¤ä I/O ¥Ý¡¼¥È¤Ø¤Î¥¢¥¯¥»¥¹¤ò²Äǽ/ÉÔ²Äǽ¤Ë¤·¤Þ¤¹¡£ +¤³¤ì¤é¤Ï¥«¡¼¥Í¥ë¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ + +.B SCSI_IOCTL_PROBE_HOST +¤ÏÆþÎϥݥ¤¥ó¥¿ +.I const int * +¤òÂ礭¤µ¤È¤·¤Æ»ÈÍѤ·¤Þ¤¹¡£¤³¤ì¤ÏƱ¤¸Â礭¤µ¤Î +.I char [] +¥Ð¥Ã¥Õ¥¡ ¤Ø¤Î½ÐÎϥݥ¤¥ó¥¿¤È¤·¤Æ¤â»ÈÍѤ·¤Þ¤¹¡£ + +.BR SIOCADDRT , +.B SIOCDELRT +¤Ï·¿¤¬°Ê²¼¤Î¥×¥í¥È¥³¥ë¤Ë°Í¸¤¹¤ëÆþÎϥݥ¤¥ó¥¿¤ò»ÈÍѤ·¤Þ¤¹: +.nf + + Most protocols const struct rtentry * + AX.25 const struct ax25_route * + NET/ROM const struct nr_route_struct * + +.fi +.B SIOCGIFCONF +¤Ï +.I struct ifconf * +¤ò»ÈÍѤ·¤Þ¤¹¡£¤³¤Î +.I ifc_buf +¥Õ¥£¡¼¥ë¥É¤ÏŤµ +.I ifc_len +¥Ð¥¤¥È¤Î¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¹¡£ +¤³¤ì¤Ë¥«¡¼¥Í¥ë¤¬ +.I struct ifreq [] +·¿¤Î¥ê¥¹¥È¤Ø½ñ¤­¹þ¤ß¤Þ¤¹¡£ + +.B SIOCSIFHWADDR +¤Ï·¿¤¬°Ê²¼¤Î¥×¥í¥È¥³¥ë¤Ë°Í¸¤¹¤ëÆþÎϥݥ¤¥ó¥¿¤ò»ÈÍѤ·¤Þ¤¹: +.nf + + Most protocols const struct ifreq * + AX.25 const char [AX25_ADDR_LEN] + +.fi +.B TIOCLINUX +¤Ï +.I const char * +¤ò»ÈÍѤ·¤Þ¤¹¡£¤³¤Î¥Ý¥¤¥ó¥¿¤ò¤¤¤¯¤Ä¤«¤Î +ÆÈΩ¤·¤¿¥µ¥Ö¥¯¥é¥¹¤ò¼±Ê̤¹¤ë°Ù¤Ë»ÈÍѤ·¤Þ¤¹¡£°Ê²¼¤Î¥Æ¡¼¥Ö¥ë¤ÎÃæ¤Ç¡¢ +.I N + foo +¤Ï N ¥Ð¥¤¥È¤ÎµÍ¤á¤â¤Î¤Î¸å¤Ë¤¢¤ë +.I foo +¤ò°ÕÌ£¤·¤Þ¤¹¡£ +.I struct selection +¤Ï°ÅÌÛŪ¤Ë +.I drivers/char/selection.c +¤ÎÃæ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +.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 * + +.fi +// Duplicate ioctls + +¤³¤Î¥ê¥¹¥È¤Ï +.B SIOCDEVPRIVATE +¤«¤é +.B SIOCPROTOPRIVATE +¤ÎÈϰϤΠioctl ¤ò´Þ¤ó¤Ç¤¤¤Þ¤»¤ó¡£ +.TS +l l l. +0x00000001 FDSETPRM FIBMAP +0x00000002 FDDEFPRM FIGETBSZ +0x00005382 CDROMAUDIOBUFSIZ SCSI_IOCTL_GET_IDLUN +0x00005402 SNDCTL_TMR_START TCSETS +0x00005403 SNDCTL_TMR_STOP TCSETSW +0x00005404 SNDCTL_TMR_CONTINUE TCSETSF +.TE +.SH ´ØÏ¢¹àÌÜ +.BR ioctl (2) diff --git a/release/man2/ioperm.2 b/release/man2/ioperm.2 new file mode 100644 index 00000000..e91461a0 --- /dev/null +++ b/release/man2/ioperm.2 @@ -0,0 +1,120 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de) +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 15:12:05 1993 by Rik Faith +.\" Modified Tue Aug 1 16:27 1995 by Jochen Karrer +.\" +.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" Modified Mon Feb 15 17:28:41 CET 1999 by Andries E. Brouwer +.\" 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" +.SH ̾Á° +ioperm \- ¥Ý¡¼¥È¤ÎÆþ½ÐÎϵö²Ä¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +/* for libc5 */ +.br +.B #include +/* for glibc */ +.sp +.BI "int ioperm(unsigned long " from ", unsigned long " num ", int " turn_on ); +.SH ÀâÌÀ +.BR ioperm () +¤Ï¡¢°ú¤­¿ô \fIfrom\fP ¤Î I/O ¥Ý¡¼¥È¥¢¥É¥ì¥¹¤«¤é +\fInum\fP ¥Ð¥¤¥Èʬ¤ÎÎΰè¤ËÂФ¹¤ë¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥¢¥¯¥»¥¹µö²Ä¥Ó¥Ã¥È¤ò¡¢\fIturn_on\fP ¤ËÀßÄꤹ¤ë¡£ +\fIturn_on\fP ¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ÏÆø¢ +.RB ( CAP_SYS_RAWIO ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.\" 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. +¤³¤ÎÊýË¡¤ÇÀßÄê¤Ç¤­¤ë¤Î¤Ï 0x3ff ÈÖÃϤޤǤΠI/O¥Ý¡¼¥È¤Ë¸Â¤é¤ì¤ë¡£ +¤³¤ì¤è¤ê¤âÂ礭¤Ê¥¢¥É¥ì¥¹¤Î¥Ý¡¼¥È¤ËÂФ·¤Æ¤Ï +.BR iopl (2) +´Ø¿ô¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +¥¢¥¯¥»¥¹¸¢¤Ï +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ë¤Ï·Ñ¾µ¤µ¤ì¤Ê¤¤¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¥¢¥¯¥»¥¹¸¢¤ÏÊݸ¤µ¤ì¤ë¡£¤³¤Îµ¡Ç½¤Ï +ÈóÆø¢¥×¥í¥°¥é¥à¤Ë¥Ý¡¼¥È¤Ø¤Î¥¢¥¯¥»¥¹¸¢¤ò +Í¿¤¨¤ë¤Î¤Ë»ÈÍѤǤ­¤ë¡£ + +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤Û¤È¤ó¤É i386 ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¤¿¤á¤À¤±¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤½¤Î¾¤Î¿¤¯¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¸ºß¤·¤Ê¤¤¤«¡¢¾ï¤Ë¥¨¥é¡¼¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ë \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I from +¤Þ¤¿¤Ï +.I num +¤ÎÃͤ¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EIO +(PowerPC ¤Ç) ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOMEM +.\" Could not allocate I/O bitmap. +¥á¥â¥êÉÔ­¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë½½Ê¬¤Ê¸¢¸Â¤¬¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +.BR ioperm () +¤Ï Linux ÆÃÍ­¤Î´Ø¿ô¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç +»ÈÍѤ·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.SH Ãí°Õ +libc5 ¤Ç¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤·¤Æ°·¤¤ +.I +¤Ë¥×¥í¥È¥¿¥¤¥×¤¬Â¸ºß¤·¤Æ¤¤¤ë¡£ +glibc1 ¤Ë¤Ï¥×¥í¥È¥¿¥¤¥×¤Ï¸ºß¤·¤Ê¤¤¡£ +glibc2 ¤Ï +.I +¤È +.I +¤ÎξÊý¤Ë¥×¥í¥È¥¿¥¤¥×¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +¸å¼Ô¤Ï i386 ¤Î¤ß¤ÇÍøÍѲÄǽ¤Ê¤Î¤Ç¡¢»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iopl (2), +.BR capabilities (7) diff --git a/release/man2/iopl.2 b/release/man2/iopl.2 new file mode 100644 index 00000000..98dc440c --- /dev/null +++ b/release/man2/iopl.2 @@ -0,0 +1,109 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from linux/kernel/ioport.c (no copyright notice). +.\" +.\" 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 Tue Aug 1 16:47 1995 by Jochen Karrer +.\" +.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" Modified Fri Nov 27 14:50:36 CET 1998 by Andries Brouwer +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" Japanese Version Copyright (c) 1997 HORIMOTO Masafumi +.\" all rights reserved. +.\" Translated 1997-09-29, HORIMOTO Masafumi +.\" Modified 1999-04-03, HANATAKA Shinya +.\" Updated 2003-10-12, Kentaro Shirakata +.\" Updated 2005-02-24, Akihiro MOTOKI +.\" +.TH IOPL 2 2004-05-27 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +iopl \- I/O Æø¢¥ì¥Ù¥ë¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int iopl(int " level ); +.SH ÀâÌÀ +.BR iopl () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î I/O Æø¢¥ì¥Ù¥ë¤ò +.I level +¤Ç»ØÄꤷ¤¿ÃͤËÊѹ¹¤¹¤ë¡£ + +¤³¤Î´Ø¿ô¤Ï 8514 ¸ß´¹¤Î X ¥µ¡¼¥Ð¤ò Linux ¤ÇÆ°ºî¤µ¤»¤ë¤¿¤á¤ËɬÍפǤ¢¤ë¡£ +¤Ê¤¼¤Ê¤é¤³¤Î X ¥µ¡¼¥Ð¤Ï 65536 ¸Ä¤Î I/O ¥Ý¡¼¥ÈÁ´¤Æ¤Ø¤Î¥¢¥¯¥»¥¹¤òÍ׵᤹¤ë¤Î¤Ç +.BR ioperm (2) +´Ø¿ô¤Ç¤ÏÉÔ½½Ê¬¤À¤«¤é¤Ç¤¢¤ë¡£ + +¤è¤ê¹â¤¤ I/O Æø¢¥ì¥Ù¥ë¤Ç¤ÎÆ°ºî¤ò¤µ¤»¤ë¤³¤È¤Ë¤è¤Ã¤Æ +I/O ¥Ý¡¼¥È¥¢¥¯¥»¥¹¤ÎÀ©¸Â¤ò²ò½ü¤¹¤ë¤³¤È¤Ë²Ã¤¨¤Æ¡¢¥×¥í¥»¥¹¤¬³ä¤ê¹þ¤ß¤ò +̵¸ú¤Ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£¤³¤Îµ¡Ç½¤Ï»þ¤È¤·¤Æ¥·¥¹¥Æ¥à¤ÎÇ˲õ¤ò +¤â¤¿¤é¤¹¤Î¤Ç´«¤á¤é¤ì¤Ê¤¤¡£ + +.BR fork (2) +¤ä +.BR exec (2) +¤ò¹Ô¤Ã¤¿¾ì¹ç¡¢Æø¢¤Ï·Ñ¾µ¤µ¤ì¤ë¡£ + +Ä̾ï¤Î¥×¥í¥»¥¹¤Î I/O Æø¢¥ì¥Ù¥ë¤Ï 0 ¤Ç¤¢¤ë¡£ + +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤Û¤È¤ó¤É i386 ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¤¿¤á¤À¤±¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤½¤Î¾¤Î¿¤¯¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¸ºß¤·¤Ê¤¤¤«¡¢¾ï¤Ë¥¨¥é¡¼¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +°ú¤­¿ô +.I level +¤¬ 3 ¤è¤êÂ礭¤¤¡£ +.TP +.B ENOSYS +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë +.BR iopl () +¤ò¸Æ¤Ó½Ð¤¹¤Î¤Ë½½Ê¬¤Ê¸¢¸Â¤¬¤Ê¤«¤Ã¤¿¡£ +.BR iopl () +¤ò¸Æ¤Ó½Ð¤¹¤Ë¤Ï +.B CAP_SYS_RAWIO +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.SH ½àµò +.BR iopl () +¤Ï Linux ÆÃÍ­¤Î´Ø¿ô¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç +»ÈÍѤ·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.SH Ãí°Õ +libc5 ¤Ç¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤·¤Æ°·¤¤ +.I +¤Ë¥×¥í¥È¥¿¥¤¥×¤¬Â¸ºß¤·¤Æ¤¤¤ë¡£ +glibc1 ¤Ë¤Ï¥×¥í¥È¥¿¥¤¥×¤Ï¸ºß¤·¤Æ¤¤¤Ê¤¤¡£ +glibc2 ¤Ï +.I +¤È +.I +¤ÎξÊý¤Ë¥×¥í¥È¥¿¥¤¥×¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +¸å¼Ô¤Ï i386 ¤Î¤ß¤ÇÍøÍѲÄǽ¤Ê¤Î¤Ç¡¢»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ioperm (2), +.BR capabilities (7) diff --git a/release/man2/ioprio_set.2 b/release/man2/ioprio_set.2 new file mode 100644 index 00000000..924b6d1f --- /dev/null +++ b/release/man2/ioprio_set.2 @@ -0,0 +1,309 @@ +.\" This is _*_ nroff _*_ source. Emacs, gimme all those colors :) +.\" +.\" Copyright (c) International Business Machines orp., 2006 +.\" +.\" 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 +.\" +.\" HISTORY: +.\" 2006-04-27, created by Eduardo M. Fleury +.\" with various additions by Michael Kerrisk +.\" +.\" 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 +.\" +.TH IOPRIO_SET 2 2008-07-09 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ioprio_get, ioprio_set \- I/O ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ÈÍ¥ÀèÅÙ¤ÎÀßÄê/¼èÆÀ +.SH ½ñ¼° +.nf +.BI "int ioprio_get(int " which ", int " who ); +.BI "int ioprio_set(int " which ", int " who ", int " ioprio ); +.fi +.SH ÀâÌÀ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR ioprio_get () +/ +.BR ioprio_set () +¤Ï¡¢(1¤Ä°Ê¾å¤Î) ¥×¥í¥»¥¹¤Î I/O ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤È +Í¥ÀèÅ٤μèÆÀ/ÀßÄê¤ò¹Ô¤¦¡£ + +.I which +¤È +.I who +°ú¤­¿ô¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÁàºîÂоݤȤʤë¥×¥í¥»¥¹¤ò»Ø¼¨¤¹¤ë¡£ +.I which +°ú¤­¿ô¤Ï¡¢ +.I who +¤ò¤É¤Î¤è¤¦¤Ë²ò¼á¤¹¤ë¤«¤ò·è¤á¤ë¤â¤Î¤Ç¡¢°Ê²¼¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄꤹ¤ë¡£ +.TP +.B IOPRIO_WHO_PROCESS +.I who +¤Ï¥×¥í¥»¥¹ID ¤Ç¤¢¤ê¡¢»ØÄꤵ¤ì¤¿ 1 ¥×¥í¥»¥¹¤¬ÂоݤȤʤ롣 +.TP +.B IOPRIO_WHO_PGRP +.I who +¤Ï¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤Ç¤¢¤ê¡¢¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¤¬ÂоݤȤʤ롣 +.TP +.B IOPRIO_WHO_USER +.I who +¤Ï¥æ¡¼¥¶ID ¤Ç¤¢¤ê¡¢¼Â UID ¤Ë°ìÃפ¹¤ëÁ´¥×¥í¥»¥¹¤¬ÂоݤȤʤ롣 +.PP +.BR ioprio_get () +¤Î¸Æ¤Ó½Ð¤·»þ¤Ë +.I which +¤Ë +.B IOPRIO_WHO_PGRP +¤« +.B IOPRIO_WHO_USER +¤¬»ØÄꤵ¤ì¡¢ +.I who +¤Ë°ìÃפ¹¤ë¥×¥í¥»¥¹¤¬Ê£¿ô¤¢¤Ã¤¿¾ì¹ç¡¢ +°ìÃפ¹¤ë¥×¥í¥»¥¹Á´ÂΤÎÃæ¤ÇºÇ¤â¹â¤¤Í¥ÀèÅÙ¤¬ÊÖ¤µ¤ì¤ë¡£ +Í¥ÀèÅÙ¤¬¹â¤¤¤È¤Ï¡¢¤è¤ê¹â¤¤Í¥ÀèÅÙ¥¯¥é¥¹¤Ë°¤·¤Æ¤¤¤ë +.RB ( IOPRIO_CLASS_RT +¤¬ºÇ¤â¹â¤¤Í¥ÀèÅÙ¥¯¥é¥¹¤Ç¡¢ +.B IOPRIO_CLASS_IDLE +¤¬ºÇ¤âÄ㤤)¡¢¤â¤·¤¯¤Ï +Ʊ¤¸Í¥ÀèÅÙ¥¯¥é¥¹¤Ë°¤·¤Æ¤¤¤ë¤¬Í¥ÀèÅÙ¥ì¥Ù¥ë¤¬¹â¤¤ +(Í¥ÀèÅÙÈֹ椬¾®¤µ¤¤Êý¤¬Í¥ÀèÅÙ¥ì¥Ù¥ë¤¬¹â¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë)¡¢ +¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ + +.BR ioprio_set () +¤ËÅϤ¹ +.I ioprio +°ú¤­¿ô¤Ï¡¢ÂоݤȤʤë¥×¥í¥»¥¹¤Ë³ä¤êÅö¤Æ¤ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤È +Í¥ÀèÅÙ¤ÎξÊý¤ò»ØÄꤹ¤ë¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +.I ioprio +¤ÎÃͤòÁȤßΩ¤Æ¤¿¤ê²ò¼á¤¹¤ë¤Î¤Ë¡¢°Ê²¼¤Î¥Þ¥¯¥í¤¬ÍøÍѤǤ­¤ë¡£ +.TP +.BI IOPRIO_PRIO_VALUE( class ", " data ) +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹ +.I class +¤ÈÍ¥ÀèÅÙ +.RI ( data ) +¤òÍ¿¤¨¤ë¤È¡¢¤³¤Î¥Þ¥¯¥í¤Ï 2¤Ä¤ÎÃͤòÁȤ߹ç¤ï¤»¤Æ¡¢ +.I ioprio +ÃͤòÀ¸À®¤·¡¢¥Þ¥¯¥í¤Î·ë²Ì¤È¤·¤ÆÊÖ¤¹¡£ +.TP +.BI IOPRIO_PRIO_CLASS( mask ) +.I mask +.RI ( ioprio +ÃÍ) ¤òÍ¿¤¨¤ë¤È¡¢¤³¤Î¥Þ¥¯¥í¤Ï I/O ¥¯¥é¥¹Í×ÁÇ¡¢¤Ä¤Þ¤ê +.BR IOPRIO_CLASS_RT , +.BR IOPRIO_CLASS_BE , +.B IOPRIO_CLASS_IDLE +¤Î¤¤¤º¤ì¤«°ì¤Ä¤ÎÃͤòÊÖ¤¹¡£ +.TP +.BI IOPRIO_PRIO_DATA( mask ) +.I mask +.RI ( ioprio +ÃÍ) ¤òÍ¿¤¨¤ë¤È¡¢¤³¤Î¥Þ¥¯¥í¤ÏÍ¥ÀèÅÙ +.RI ( data ) +Í×ÁǤòÊÖ¤¹¡£ +.PP +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ÈÍ¥ÀèÅ٤˴ؤ¹¤ë¾Ü¤·¤¤¾ðÊó¤Ï¡¢ +¡ÖÈ÷¹Í¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ + +I/O Í¥ÀèÅÙ¤ÏÆɤ߽Ф·¤ÈƱ´ü½ñ¤­¹þ¤ß +.RB ( O_DIRECT , +.BR O_SYNC ) +¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +I/O Í¥ÀèÅÙ¤ÏÈóƱ´ü½ñ¤­¹þ¤ß¤Ë¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢ +ÈóƱ´ü½ñ¤­¹þ¤ß¤Ï¥á¥â¥ê½ñ¤­´¹¤¨¤ò¹Ô¤¦¥×¥í¥°¥é¥à¤ÎÆ°ºî (context) ¤È¤Ï +´Ø·¸¤Ê¤¯È¯¹Ô¤µ¤ì¡¢¤½¤Î¤¿¤á¥×¥í¥°¥é¥àñ°Ì¤ÎÍ¥ÀèÅÙ¤ÏŬÍѤµ¤ì¤Ê¤¤¤«¤é +¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR ioprio_get () +¤Ï¡¢ +.I which +¤È +.I who +¤Ç»ØÄꤵ¤ì¤¿´ð½à¤Ë¹çÃפ·¤¿Á´¥×¥í¥»¥¹¤ÇºÇ¤â¹â¤¤ I/O Í¥ÀèÅÙ¤ò»ý¤Ä¥×¥í¥»¥¹¤Î +.I ioprio +ÃͤòÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.PP +À®¸ù¤¹¤ë¤È¡¢ +.BR ioprio_set () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I which +¤« +.I ioprio +¤ÎÃͤ¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.I ioprio +ÍѤ˻ØÄê²Äǽ¤Ê¥¹¥±¥¸¥å¡¼¥é¥¯¥é¥¹¤ÈÍ¥ÀèÅÙ¥ì¥Ù¥ë¤Ë¤Ä¤¤¤Æ¤Ï +¡ÖÈ÷¹Í¡×¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¡¢»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Ë +.I ioprio +¤ò³ä¤êÅö¤Æ¤ë¤Î¤ËɬÍפʸ¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.BR ioprio_set () +¤ËɬÍפʸ¢¸Â¤Ë¤Ä¤¤¤Æ¤Î¾Ü¤·¤¤¾ðÊó¤Ï¡ÖÈ÷¹Í¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B ESRCH +.I which +¤È +.I who +¤Ç»ØÄꤵ¤ì¤¿´ð½à¤Ë¹çÃפ¹¤ë¥×¥í¥»¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.6.13 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.SH È÷¹Í +glibc ¤Ï¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£ + +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢I/O Í¥ÀèÅÙ¤ËÂбþ¤·¤¿ I/O ¥¹¥±¥¸¥å¡¼¥é¤È +ÁȤ߹ç¤ï¤»¤Æ»ÈÍѤµ¤ì¤¿¾ì¹ç¤Ë¤Î¤ß¸ú²Ì¤ò»ý¤Ä¡£ +¥«¡¼¥Í¥ë 2.6.17 ¤Ç¤Ï¡¢¤³¤Î¾ò·ï¤òËþ¤¿¤¹¥¹¥±¥¸¥å¡¼¥é¤Ï +Completely Fair Queuing (CFQ) I/O ¥¹¥±¥¸¥å¡¼¥é¤À¤±¤Ç¤¢¤ë¡£ +.SS I/O ¥¹¥±¥¸¥å¡¼¥é¤ÎÁªÂò +I/O ¥¹¥±¥¸¥å¡¼¥é¤ÎÁªÂò¤Ï¥Ç¥Ð¥¤¥¹Ã±°Ì¤Ë¹Ô¤ï¤ì¡¢¤½¤ÎÁªÂò¤Ï +¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë +.I /sys/block//queue/scheduler +·Ðͳ¤Ç¹Ô¤ï¤ì¤ë¡£ + +¸½ºß¤Î I/O ¥¹¥±¥¸¥å¡¼¥é¤Ï +.I /sys +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à·Ðͳ¤Ç»²¾È¤Ç¤­¤ë¡£Î㤨¤Ð¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤È¡¢ +¸½ºß¥«¡¼¥Í¥ë¤Ç¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥¹¥±¥¸¥å¡¼¥é¤ÎÁ´¥ê¥¹¥È¤¬É½¼¨¤µ¤ì¤ë¡£ +.sp +.RS +.nf +.RB "$" " cat /sys/block/hda/queue/scheduler" +noop anticipatory deadline [cfq] +.fi +.RE +.sp +³ç¸Ì¤Ç°Ï¤Þ¤ì¤¿¥¹¥±¥¸¥å¡¼¥é¤¬¤½¤Î¥Ç¥Ð¥¤¥¹ (¾å¤ÎÎã¤Ç¤Ï +.IR hda ) +¤Ë¤Ä¤¤¤Æ¼ÂºÝ¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¥¹¥±¥¸¥å¡¼¥é¤Ç¤¢¤ë¡£ +Ê̤Υ¹¥±¥¸¥å¡¼¥é¤òÀßÄꤹ¤ë¤Ë¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¿·¤·¤¤¥¹¥±¥¸¥å¡¼¥é̾¤ò +½ñ¤­¹þ¤á¤Ð¤è¤¤¡£Î㤨¤Ð¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤È¡¢¥Ç¥Ð¥¤¥¹ +.I hda +¤Î¥¹¥±¥¸¥å¡¼¥é¤È¤·¤Æ +.I cfq +¤¬ÀßÄꤵ¤ì¤ë¡£ +.sp +.RS +.nf +.RB "$" " su" +Password: +.RB "#" " echo cfq > /sys/block/hda/queue/scheduler" +.fi +.RE +.SS "Completely Fair Queuing (CFQ) I/O ¥¹¥±¥¸¥å¡¼¥é" +¥Ð¡¼¥¸¥ç¥ó 3 (ÊÌ̾ CFQ Time Sliced) °Ê¹ß¡¢ +CPU ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ÈƱÍͤΠI/O nice ¥ì¥Ù¥ë¤¬ CFQ ¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î nice ¥ì¥Ù¥ë¤Ï 3¤Ä¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ËʬÎà¤Ç¤­¡¢ +³Æ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤Ë¤Ä¤­ 1¤Ä°Ê¾å¤ÎÍ¥ÀèÅÙ¥ì¥Ù¥ë¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.BR IOPRIO_CLASS_RT " (1)" +¤³¤ì¤Ï¥ê¥¢¥ë¥¿¥¤¥à I/O ¥¯¥é¥¹¤Ç¤¢¤ë¡£ +¤³¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤Ë¤Ï¾¤Î¥¯¥é¥¹¤è¤ê¤â¹â¤¤Í¥ÀèÅÙ¤¬Í¿¤¨¤é¤ì¤ë¡£ +¤³¤Î¥¯¥é¥¹¤Î¥×¥í¥»¥¹¤Ë¤Ï¡¢¾ï¤Ë¥Ç¥£¥¹¥¯¤Ø¤Î¥¢¥¯¥»¥¹¤¬Í¥À褷¤Æ +³ä¤êÅö¤Æ¤é¤ì¤ë¡£¤½¤Î¤¿¤á¡¢¤³¤Î I/O ¥¯¥é¥¹¤ò»È¤¦ºÝ¤Ë¤Ï¡¢ +¤¿¤Ã¤¿°ì¤Ä¤Î ¥ê¥¢¥ë¥¿¥¤¥à I/O ¥¯¥é¥¹¤Î¥×¥í¥»¥¹¤Ë¤è¤ê +¥·¥¹¥Æ¥àÁ´ÂΤΥǥ£¥¹¥¯¥¢¥¯¥»¥¹¤¬¤Ç¤­¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤³¤È¤¬¤¢¤ë +¤È¤¤¤¦ÅÀ¤Ë¡¢Ãí°Õ¤òʧ¤¦É¬Íפ¬¤¢¤ë¡£ +¤³¤Î¥¯¥é¥¹¤Ë¤Ï¡¢8 Ãʳ¬¤Î class data (Í¥ÀèÅÙ¥ì¥Ù¥ë) ¤¬¤¢¤ë¡£ +¤³¤ÎÃͤϡ¢¤½¤Î¥×¥í¥»¥¹¤¬ 1²ó¤Î¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹¤Ë¤É¤ì¤À¤±¤Î +»þ´Ö¤¬É¬Íפ«¤òÀµ³Î¤Ë·è¤á¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +ºÇ¹â¤Î¥ê¥¢¥ë¥¿¥¤¥àÍ¥ÀèÅÙ¥ì¥Ù¥ë¤Ï 0 ¤Ç¡¢ºÇÄã¤Ï 7 ¤Ç¤¢¤ë¡£ +¾­ÍèŪ¤Ë¤Ï¡¢Í¥ÀèÅÙ¥ì¥Ù¥ë¤Ï¡¢´õ˾¤¹¤ë¥Ç¡¼¥¿¥ì¡¼¥È¤òÅϤ¹¤Ê¤É¡¢ +¤è¤êľÀÜŪ¤ËÀ­Ç½¾ò·ï¤òÈ¿±Ç¤Ç¤­¤ë¤è¤¦¤ËÊѹ¹¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.BR IOPRIO_CLASS_BE " (2)" +¤³¤ì¤Ï ¥Ù¥¹¥È¥¨¥Õ¥©¡¼¥È¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤Ç¤¢¤ë¡£ +¤³¤Î¥¯¥é¥¹¤Ï¡¢ÆÃÄê¤Î I/O Í¥ÀèÅÙ¤òÀßÄꤷ¤Æ¤¤¤Ê¤¤¥×¥í¥»¥¹¤Î +¥Ç¥Õ¥©¥ë¥ÈÃͤǤ¢¤ë¡£ +class data (Í¥ÀèÅÙ¥ì¥Ù¥ë) ¤Ë¤è¤ê¡¢¤½¤Î¥×¥í¥»¥¹¤¬¤É¤ÎÄøÅ٤Π+I/O ÂÓ°è¤òÆÀ¤é¤ì¤ë¤«¤¬·èÄꤵ¤ì¤ë¡£ +¥Ù¥¹¥È¥¨¥Õ¥©¡¼¥È¡¦Í¥ÀèÅÙ¥ì¥Ù¥ë¤Ï¡¢CPU ¤Î nice ÃÍ +.RB ( getpriority (2) +»²¾È) ¤ÈƱÍͤΤâ¤Î¤Ç¤¢¤ë¡£ +Í¥ÀèÅÙ¥ì¥Ù¥ë¤Ï¡¢¥Ù¥¹¥È¥¨¥Õ¥©¡¼¥È¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ÎÃæ¤Ç +¾¤Î¥×¥í¥»¥¹¤È¤ÎÁêÂÐŪ¤ÊÍ¥ÀèÅÙ¤ò·èÄꤹ¤ë¡£ +Í¥ÀèÅÙ¥ì¥Ù¥ë¤ÎÃͤÎÈÏ°Ï¤Ï 0 (ºÇ¹â) ¤«¤é 7 (ºÇÄã) ¤Ç¤¢¤ë¡£ +.TP +.BR IOPRIO_CLASS_IDLE " (3)" +¤³¤ì¤Ï idle ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤Ç¤¢¤ë¡£ +¤³¤Î¥ì¥Ù¥ë¤ÇÆ°ºî¤¹¤ë¥×¥í¥»¥¹¤Ï¾¤Ë¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹¤ò¤·¤è¤¦¤È¤¹¤ë +¥×¥í¥»¥¹¤¬¤Ê¤¤¾ì¹ç¤Ë¤Î¤ß I/O »þ´Ö¤ò¼èÆÀ¤¹¤ë¡£ +idle ¥¯¥é¥¹¤Ë¤Ï class data (Í¥ÀèÅÙ) ¤ÏÍÑ°Õ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¥×¥í¥»¥¹¤Ë¤³¤ÎÍ¥ÀèÅÙ¤ò³ä¤êÅö¤Æ¤ëºÝ¤Ë¤ÏÃí°Õ¤¬É¬ÍפǤ¢¤ë¡£ +¤Ê¤¼¤Ê¤é¡¢Í¥ÀèÅ٤ι⤤¥×¥í¥»¥¹¤¬¾ï¤Ë¥Ç¥£¥¹¥¯¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï +¥Ç¥£¥¹¥¯¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¯¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ë¤«¤é¤À¡£ +.PP +CFQ I/O ¥¹¥±¥¸¥å¡¼¥é¤Î¹¹¤Ê¤ë¾ðÊó¤È¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ¤Ï +.I Documentation/block/ioprio.txt +¤ò»²¾È¤Î¤³¤È¡£ +.SS "I/O Í¥ÀèÅÙ¤ÎÀßÄê¤ËɬÍפʵö²Ä" +¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤òÊѹ¹¤¹¤ëµö²Ä¤¬ÆÀ¤é¤ì¤ë¤«¤É¤¦¤«¤Ï +°Ê²¼¤Î 2¤Ä¤Î¾ò·ï¤Ë´ð¤¤¤Æ·èÄꤵ¤ì¤ë¡£ +.TP +.B "¥×¥í¥»¥¹¤Î½êÍ­¸¢" +ÈóÆø¢¥×¥í¥»¥¹¤Ï¡¢¥×¥í¥»¥¹¤Î¼Â UID ¤¬¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â UID ¤â¤·¤¯¤Ï +¼Â¸ú UID ¤È°ìÃפ¹¤ë¥×¥í¥»¥¹¤Î I/O Í¥ÀèÅ٤ΤߤòÀßÄê¤Ç¤­¤ë¡£ +.B CAP_SYS_NICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹¤Ï¡¢¤É¤Î¥×¥í¥»¥¹¤ÎÍ¥ÀèÅ٤ǤâÊѹ¹¤Ç¤­¤ë¡£ +.TP +.B "¤É¤ÎÍ¥ÀèÅÙ¤ËÀßÄꤷ¤è¤¦¤È¤·¤Æ¤¤¤ë¤«" +Èó¾ï¤Ë¹â¤¤Í¥ÀèÅÙ +.RB ( IOPRIO_CLASS_RT ) +¤òÀßÄꤷ¤è¤¦¤È¤¹¤ë¾ì¹ç¡¢ +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +¥«¡¼¥Í¥ë 2.6.24 °ÊÁ°¤Ç¤Ï¡¢Èó¾ï¤ËÄ㤤ͥÀèÅÙ +.RB ( IOPRIO_CLASS_IDLE ) +¤òÀßÄꤹ¤ë¤¿¤á¤Ë¤â +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤Ã¤¿¤¬¡¢ +Linux 2.6.25 °Ê¹ß¤Ç¤Ï¤â¤Ï¤äɬÍפʤ¯¤Ê¤Ã¤¿¡£ +.PP +.BR ioprio_set () +¤Ï¤³¤ÎξÊý¤Î¥ë¡¼¥ë¤Ë½¾¤¤¡¢¾ò·ï¤òËþ¤¿¤µ¤Ê¤¤¾ì¹ç¡¢¥¨¥é¡¼ +.B EPERM +¤Ç¼ºÇÔ¤¹¤ë¡£ +.SH ¥Ð¥° +.\" 6 May 07: Bug report raised: +.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=4464 +.\" Ulriich Drepper replied that he wasn't going to add these +.\" to glibc. +glibc ¤Ï¡¢¤³¤Î¥Ú¡¼¥¸¤Ëµ­ºÜ¤µ¤ì¤¿´Ø¿ô¥×¥í¥È¥¿¥¤¥×¤ä¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë +ŬÀڤʥإåÀ¥Õ¥¡¥¤¥ë¤ò¤Þ¤ÀÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +ɬÍפÊÄêµÁ¤Ë¤Ä¤¤¤Æ¤Ï +.I linux/ioprio.h +¤ò¸«¤ì¤Ð¤è¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getpriority (2), +.BR open (2), +.BR capabilities (7) +.sp +¥«¡¼¥Í¥ë¡¦¥½¡¼¥¹Æâ¤Î Documentation/block/ioprio.txt diff --git a/release/man2/ipc.2 b/release/man2/ipc.2 new file mode 100644 index 00000000..90fa8933 --- /dev/null +++ b/release/man2/ipc.2 @@ -0,0 +1,87 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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 Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sun Feb 23 16:13:46 JST 1997 +.\" by HANATAKA Shinya +.\" Updated 2007-09-04, Akihiro MOTOKI , LDP v2.64 +.\" +.\"WORD: IPC IPC +.\"WORD: message ¥á¥Ã¥»¡¼¥¸ +.\"WORD: semaphore ¥»¥Þ¥Õ¥©¡¼ +.\"WORD: shared memory ¶¦Í­¥á¥â¥ê +.\"WORD: entry point ¥¨¥ó¥È¥ê¡¦¥Ý¥¤¥ó¥È +.\"WORD: argument °ú¤­¿ô +.\"WORD: hacker ¥Ï¥Ã¥«¡¼ +.\"WORD: standart library ɸ½à¥é¥¤¥Ö¥é¥ê +.\"WORD: implement ¼ÂÁõ +.\" +.TH IPC 2 2007-06-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ipc \- System V IPC ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë +.SH ½ñ¼° +.nf +.BI "int ipc(unsigned int " call ", int " first ", int " second \ +", int " third , +.BI " void *" ptr ", long " fifth ); +.fi +.SH ÀâÌÀ +.BR ipc () +¤Ï ¥á¥Ã¥»¡¼¥¸¡¢¥»¥Þ¥Õ¥©¡¼¡¢¶¦Í­¥á¥â¥ê¤Ë´Ø¤¹¤ë System V IPC ¥³¡¼¥ë¤Î +¶¦Ä̤Υ«¡¼¥Í¥ë¤Ø¤Î¥¨¥ó¥È¥ê¡¦¥Ý¥¤¥ó¥È¤Ç¤¢¤ë¡£ +.I call +¤Ï¤É¤Î IPC ´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¤«¤ò·è¤á¡¨ +¾¤Î°ú¤­¿ô¤ÏŬÀڤʥ³¡¼¥ë¤Ø¤ÈÅϤµ¤ì¤ë¡£ +.PP +¥æ¡¼¥¶¡¼¡¦¥×¥í¥°¥é¥à¤ÏÄ̾ï¤Î̾Á°¤ÇŬÀڤʴؿô¤ò¸Æ¤Ó½Ð¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +ɸ½à¥é¥¤¥Ö¥é¥ê¤Î¼ÂÁõ¼Ô¤ä¥«¡¼¥Í¥ë¡¦¥Ï¥Ã¥«¡¼¤Î¤ß¤¬ +.BR ipc () +¤Ë¤Ä¤¤¤ÆÃΤëɬÍפ¬¤¢¤ë¡£ +.SH ½àµò +.BR ipc () +¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢ °Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.SH Ãí°Õ +ia64 ¤Ê¤É¤Î¤¤¤¯¤Ä¤«¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR ipc () +¤¬Â¸ºß¤·¤Ê¤¤¡£¼ÂºÝ¤Ë¤Ï¡¢¤½¤ÎÂå¤ï¤ê¤Ë +.BR msgctl (2), +.BR semctl (2), +.BR shmctl (2) +¤Ê¤É¤¬ÆÈΩ¤·¤¿¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR msgctl (2), +.BR msgget (2), +.BR msgrcv (2), +.BR msgsnd (2), +.BR semctl (2), +.BR semget (2), +.BR semop (2), +.BR shmat (2), +.BR shmctl (2), +.BR shmdt (2), +.BR shmget (2) diff --git a/release/man2/kill.2 b/release/man2/kill.2 new file mode 100644 index 00000000..c8a6d3dd --- /dev/null +++ b/release/man2/kill.2 @@ -0,0 +1,196 @@ +.\" 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 by Thomas Koenig +.\" Modified 1993-07-23 by Rik Faith +.\" Modified 1993-07-25 by Rik Faith +.\" Modified 1995-11-01 by Michael Haardt +.\" +.\" Modified 1996-04-14 by Andries Brouwer +.\" [added some polishing contributed by Mike Battersby ] +.\" Modified 1996-07-21 by Andries Brouwer +.\" Modified 1997-01-17 by Andries Brouwer +.\" Modified 2001-12-18 by Andries Brouwer +.\" Modified 2002-07-24 by Michael Kerrisk +.\" Added note on historical rules enforced when an unprivileged process +.\" sends a signal. +.\" Modified 2004-06-16 by Michael Kerrisk +.\" Added note on CAP_KILL +.\" Modified 2004-06-24 by aeb +.\" Modified, 2004-11-30, after idea from emmanuel.colbus@ensimag.imag.fr +.\" +.\" 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 +.\" Updated 2001-12-27, Kentaro Shirakata +.\" Updated 2002-01-03, Kentaro Shirakata +.\" Updated 2002-09-27, Kentaro Shirakata +.\" Updated 2005-02-27, Akihiro MOTOKI +.\" Updated 2005-12-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.16 +.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: process group ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× +.\"WORD: permission µö²Ä +.\"WORD: privileges Æø¢ +.\"WORD: set-user-id ¥»¥Ã¥È¥æ¡¼¥¶¡¼ID +.\"WORD: signal handler ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¡¼ +.\" +.TH KILL 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +kill \- ¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "int kill(pid_t " pid ", int " sig ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR kill (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î +.BR kill () +¤Ï¡¢Ç¤°Õ¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤â¤·¤¯¤Ï¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤ò +Á÷¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£ +.PP +\fIpid\fP ¤ËÀµ¤ÎÃͤò»ØÄꤷ¤¿¾ì¹ç¡¢¥·¥°¥Ê¥ë \fIsig\fP ¤¬ +\fIpid\fP ¤Ç»ØÄꤵ¤ì¤¿ ID ¤ò»ý¤Ä¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤ë¡£ +.PP +\fIpid\fP ¤Ë 0 ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Ë°¤¹¤ë¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤Ë +\fIsig\fP ¤Ç»ØÄꤷ¤¿¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +.PP +\fIpid\fP ¤Ë \-1 ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ \fIsig\fP ¤Ç»ØÄꤷ¤¿¥·¥°¥Ê¥ë¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÁ÷¤ëµö²Ä¤ò»ý¤ÄÁ´¤Æ¤Î¥×¥í¥»¥¹¤Ë +Á÷¤é¤ì¤ë¡£Ã¢¤·¡¢¥×¥í¥»¥¹ÈÖ¹æ 1 (\fIinit\fP) ¤Ø¤Ï¥·¥°¥Ê¥ë¤ÏÁ÷¤é¤ì¤Ê¤¤¡£ +°Ê²¼¤Î´ØÏ¢Éôʬ¤â»²¾È¤Î¤³¤È¡£ +.PP +\fIpid\fP ¤Ë \-1 ¤è¤ê¾®¤µ¤ÊÃͤò»ØÄꤷ¤¿¾ì¹ç¡¢ +ID ¤¬ \fI\-pid\fP ¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Ë°¤¹¤ë¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤Ë +\fIsig\fP ¤Ç»ØÄꤷ¤¿¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +.PP +\fIsig\fP ¤Ë 0 ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¥·¥°¥Ê¥ë¤ÏÁ÷¤é¤ì¤Ê¤¤¤¬¡¢ +¥¨¥é¡¼¤Î¥Á¥§¥Ã¥¯¤Ï¹Ô¤ï¤ì¤ë¡£¤³¤ì¤ò»È¤Ã¤Æ¡¢¥×¥í¥»¥¹ ID ¤ä +¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤Î¸ºß³Îǧ¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ + +¤¢¤ë¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÁ÷¤ëµö²Ä¤ò»ý¤Ä¤Ë¤Ï¡¢ +¤½¤Î¥×¥í¥»¥¹¤¬Æø¢ (Linux ¤Ç¤Ï +.B CAP_KILL +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤Ä¥×¥í¥»¥¹¤Ç¤¢¤ë¤«¡¢¥·¥°¥Ê¥ë¤òÁ÷¤ë¦¤Î¥×¥í¥»¥¹¤Î +¼ÂUID ¤«¼Â¸úUID ¤¬¼õ¤±¤ë¦¤Î¥×¥í¥»¥¹¤Î¼Â set-UID ¤« +Êݸ (saved) set-UID ¤¬°ìÃפ·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B SIGCONT +¤Î¾ì¹ç¤Ï¡¢¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ë¥×¥í¥»¥¹¤È¼õ¿®¤¹¤ë¥×¥í¥»¥¹¤¬ +Ʊ¤¸¥»¥Ã¥·¥ç¥ó¤Ë½ê°¤·¤Æ¤¤¤ì¤Ð½½Ê¬¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç (¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¥·¥°¥Ê¥ë¤¬Á÷¿®¤µ¤ì¤¿¾ì¹ç)¡¢ +0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +̵¸ú¤Ê¥·¥°¥Ê¥ë¤ò»ØÄꤷ¤¿¡£ +.TP +.B EPERM +¥×¥í¥»¥¹¤¬¡¢¼õ¿®¤¹¤ë¥×¥í¥»¥¹¤Î¤¤¤º¤ì¤ËÂФ·¤Æ¤â +¥·¥°¥Ê¥ë¤òÁ÷¤ëµö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ESRCH +»ØÄꤷ¤¿¥×¥í¥»¥¹¤Þ¤¿¤Ï¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¡£ +¥¾¥ó¥Ó¥×¥í¥»¥¹¤Ï¸ºß¤¹¤ë¥×¥í¥»¥¹¤È¤·¤Æ¤ß¤Ê¤µ¤ì¤ë¡£ +¥¾¥ó¥Ó¥×¥í¥»¥¹¤È¤Ï¤¹¤Ç¤Ë½èÍý¤Ï½ªÎ»¤·¤Æ¤¤¤ë¤¬¡¢¿Æ¥×¥í¥»¥¹¤Ë¤è¤ë +.BR wait () +½èÍý¤¬¹Ô¤ï¤ì¤Æ¤¤¤Ê¤¤¥×¥í¥»¥¹¤Î¤³¤È¤Ç¤¢¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +¥×¥í¥»¥¹ÈÖ¹æ 1 ¤Î +.I init +¥×¥í¥»¥¹¤ËÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¥·¥°¥Ê¥ë¤Ï¡¢ +.I init +¤¬ÌÀ¼¨Åª¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤷ¤¿¥·¥°¥Ê¥ë¤À¤±¤Ç¤¢¤ë¡£ +¤³¤¦¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ï¡¢¸í¤Ã¤Æ¥·¥¹¥Æ¥à¤ò¥À¥¦¥ó¤µ¤»¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.LP +POSIX.1-2001 ¤Ç¤Ï¡¢ \fIkill(\-1,sig)\fP ¤¬ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤¬½ÐÍè¤ë¥×¥í¥»¥¹Á´¤Æ¤Ë +\fIsig\fP ¤òÁ÷¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +⤷¡¢¥·¥¹¥Æ¥à¼ÂÁõ»þ¤ËÄê¤á¤é¤ì¤¿¥·¥¹¥Æ¥à¥×¥í¥»¥¹¤Ï +¥·¥°¥Ê¥ë¤ÎÁ÷¿®Âоݤ«¤é½ü³°¤µ¤ì¤ë¡£ +Linux ¤Ç¤Ï¡¢¥×¥í¥»¥¹¤¬¼«Ê¬¼«¿È¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¬¡¢ +Linux ¤Î \fIkill(\-1,sig)\fP ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë¤Ï¥·¥°¥Ê¥ë¤òÁ÷¤é¤Ê¤¤¡£ +.LP +POSIX.1-2001 ¤Ç¤Ï°Ê²¼¤ÎÆ°ºî¤Ë¤Ê¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +¼«Ê¬¼«¿È¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¤È¡¢¥·¥°¥Ê¥ë¤òÁ÷¤Ã¤¿¥¹¥ì¥Ã¥É¤¬¤½¤Î¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯ +¤·¤Æ¤ª¤é¤º¡¢Â¾¤Î¤É¤Î¥¹¥ì¥Ã¥É¤â¤½¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±¤ë¾õÂ֤ˤâ¤Ê¤¯ +.BR sigwait (3) +¤Ç¤½¤Î¥·¥°¥Ê¥ë¤òÂԤäƤ⤤¤Ê¤¤¾ì¹ç¡¢ +.BR kill () +¤¬ÊÖ¤ëÁ°¤Ë¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤ +¥·¥°¥Ê¥ë¤¬¥·¥°¥Ê¥ë¤òÁ÷¤Ã¤¿¥¹¥ì¥Ã¥É¤ËÇÛÁ÷¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SS "Linux ¤Ç¤ÎÃí°Õ" +Linux ¤Ç¤Ï¡¢Æø¢¤Î¤Ê¤¤¥×¥í¥»¥¹¤¬Â¾¤Î¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ë¤¿¤á¤Ë +ɬÍפʸ¢¸Â¤Ë¤Ä¤¤¤Æ¤Î¥ë¡¼¥ë¤¬¡¢¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê°ã¤Ã¤Æ¤¤¤ë¡£ +.\" 0.* ¥«¡¼¥Í¥ë¤ÎÏäϳ䰦¤·¡¢Â¿¾¯Êѹ¹¤·¤¿¡£- MTK, 24 Jul 02 +¥«¡¼¥Í¥ë 1.0 ¤«¤é 1.2.2 ¤Ç¤Ï¡¢Á÷¿®Â¦¤Î¼Â¸ú¥æ¡¼¥¶¡¼ID ¤¬¼õ¿®Â¦¤Î +¼Â¸ú¥æ¡¼¥¶¡¼ ID¤È°ìÃפ¹¤ì¤Ð¥·¥°¥Ê¥ë¤òÁ÷¿®¤Ç¤­¤¿¡£ +¥«¡¼¥Í¥ë 1.2.3 ¤«¤é 1.3.77¤Ç¤Ï¡¢Á÷¿®Â¦¤Î¼Â¸ú¥æ¡¼¥¶¡¼ID ¤¬¼õ¿®Â¦¤Î +¼Â¥æ¡¼¥¶¡¼ID ¤«¼Â¸ú¥æ¡¼¥¶¡¼ID ¤Î¤¤¤º¤ì¤«¤È°ìÃפ¹¤ì¤Ð¥·¥°¥Ê¥ë¤òÁ÷¿®¤Ç¤­¤¿¡£ +¸½ºß¤Î¥ë¡¼¥ë¤Ï¡¢POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤ª¤ê¡¢¥«¡¼¥Í¥ë 1.3.78 °Ê¹ß¤Ç +ŬÍѤµ¤ì¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +¥Ð¡¼¥¸¥ç¥ó 2.6.7 °ÊÁ°¤Î 2.6 ·Ï¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¡¢ +¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤Ã¤¿¤È¤­¤Ë¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î (Á´¥á¥ó¥Ð¡¼¤Ç¤Ï¤Ê¤¯) °ìÉô¤Î¥á¥ó¥Ð¡¼ +¤ËÂФ·¤Æ¤Î¤ß¥·¥°¥Ê¥ë¤òÁ÷¤ëµö²Ä¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +.BR kill () +¤¬¥¨¥é¡¼ +.B EPERM +¤Ç¼ºÇÔ¤¹¤ë¤È¤¤¤¦¥Ð¥°¤¬¤¢¤ë¡£ +¤³¤Î¥¨¥é¡¼¤¬ÊÖ¤ë¤Ë¤â¤«¤«¤ï¤é¤º¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï¸Æ¤Ó½Ð¤·¸µ¤¬ +¥·¥°¥Ê¥ë¤òÁ÷¤ëµö²Ä¤ò»ý¤ÄÁ´¤Æ¤Î¥×¥í¥»¥¹¤ØÁ÷¤é¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR _exit (2), +.BR killpg (2), +.BR signal (2), +.BR sigqueue (2), +.BR tkill (2), +.BR exit (3), +.BR credentials (7), +.BR capabilities (7), +.BR signal (7) diff --git a/release/man2/killpg.2 b/release/man2/killpg.2 new file mode 100644 index 00000000..d50cebe9 --- /dev/null +++ b/release/man2/killpg.2 @@ -0,0 +1,148 @@ +.\" Copyright (c) 1980, 1991 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. +.\" +.\" @(#)killpg.2 6.5 (Berkeley) 3/10/91 +.\" +.\" Modified Fri Jul 23 21:55:01 1993 by Rik Faith +.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" Modified 2004-06-16 by Michael Kerrisk +.\" Added notes on CAP_KILL +.\" Modified 2004-06-21 by aeb +.\" +.\" Japanese Version Copyright (c) 1997 Kazuyuki Tanisako +.\" all rights reserved. +.\" Translated Sat May 17 14:10:42 JST 1997 +.\" by Kazuyuki Tanisako +.\" Updated & Modified Sat Feb 5 21:24:32 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: process group ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: super-user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\" +.TH KILLPG 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +killpg \- ¥·¥°¥Ê¥ë¤ò¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÁ÷¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int killpg(int " pgrp ", int " sig ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR killpg (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.BR killpg () +¤Ï +.I sig +¤Ç»ØÄꤷ¤¿¥·¥°¥Ê¥ë¤ò +.I pgrp +¤Ç»ØÄꤷ¤¿¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÁ÷¤ë¡£ +¥·¥°¥Ê¥ë¤ÎÄêµÁ¤Î°ìÍ÷¤Ï +.BR signal (7) +¤ò»²¾È¤Î¤³¤È¡£ + +°ú¤­¿ô +.I pgrp +¤Ë 0 ¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï +.BR killpg () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬Â°¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÂФ·¤Æ¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +(POSIX ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë: +.I pgrp +¤¬ 1 °Ê²¼¤Ç¤¢¤ë¾ì¹ç¡¢Æ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£) + +¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ëµö²Ä¤ò»ý¤Ä¤¿¤á¤Ë¤Ï¡¢ +¥×¥í¥»¥¹¤¬Æø¢ (Linux ¤Ç¤Ï +.B CAP_KILL +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability)) ¤ò»ý¤Ä¤«¡¢ +Á÷¿®¸µ¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤Þ¤¿¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ +Á÷¿®Àè¥×¥í¥»¥¹¤Î¼Â set-user-ID ¤Þ¤¿¤ÏÊݸ set-user-ID ¤È +Åù¤·¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B SIGCONT +¤Î¾ì¹ç¡¢Á÷¿®¥×¥í¥»¥¹¤È¼õ¿®¥×¥í¥»¥¹¤¬ +Ʊ¤¸¥»¥Ã¥·¥ç¥ó¤Ë°¤·¤Æ¤¤¤ì¤Ð½½Ê¬¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +Àµ¾ï½ªÎ»¤¹¤ë¤È 0 ¤¬ÊÖ¤êÃͤȤʤ롣°Û¾ï½ªÎ»¤Î¾ì¹ç \-1 ¤¬ÊÖ¤êÃͤȤʤê +.I errno +¤Ë¸¶°ø¥³¡¼¥É¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I sig +¤Ç»ØÄꤵ¤ì¤¿ÃͤÏ̵¸ú¤Ê¥·¥°¥Ê¥ëÈÖ¹æ¤Ç¤¢¤ë¡£ +.TP +.B EPERM +¥×¥í¥»¥¹¤Ë²¿¤ì¤«¤ÎÁ÷¿®Àè¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ëµö²Ä¤¬¤Ê¤¤¡£ +.TP +.B ESRCH +.I pgrp +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Ë°¤¹¤ë¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¡£ +.TP +.B ESRCH +¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤È¤·¤Æ 0 ¤¬»ØÄꤵ¤ì¤¿¤¬¡¢Á÷¿®¥×¥í¥»¥¹¤Ï +¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +SVr4, 4.4BSD +.RB ( killpg () +¤Ï 4BSD ¤Ç½é¤á¤ÆÄɲ䵤줿), POSIX.1-2001¡£ +.SH Ãí°Õ +BSD ·Ï¥·¥¹¥Æ¥à¤È System V ·Ï¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +µö²Ä¤Î¥Á¥§¥Ã¥¯¤ËÍÍ¡¹¤Ê°ã¤¤¤¬¤¢¤ë¡£ +.BR kill (2) +¤Ë¤Ä¤¤¤Æ¤Î POSIX ¤Î¸¶Íý (rationale) ¤ò»²¾È¤¹¤ë¤³¤È¡£ +POSIX ¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤°ã¤¤¤È¤·¤Æ¤Ï¡¢ÊÖ¤êÃÍ +.B EPERM +¤¬¤¢¤ë¡£ +BSD ¤Ç¤Ï¡ÖÁ÷¿®Àè¥×¥í¥»¥¹¤Îµö²Ä¤Î¥Á¥§¥Ã¥¯¤¬ 1 ¤Ä¤Ç¤â¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢ +¥·¥°¥Ê¥ë¤¬Á÷¿®¤µ¤ì¤º¡¢ +.B EPERM +¤¬ÊÖ¤µ¤ì¤ë¡×¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +POSIX ¤Ç¤Ï¡ÖÁ÷¿®Àè¥×¥í¥»¥¹¤Îµö²Ä¤Î¥Á¥§¥Ã¥¯¤¬Á´¤Æ¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Î¤ß¡¢ +.B EPERM +¤¬ÊÖ¤µ¤ì¤ë¡×¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ + +Linux ¤Ç¤Ï¡¢ +.BR killpg () +¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢ +.I "kill(-pgrp,\ sig)" +¤Î¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getpgrp (2), +.BR kill (2), +.BR signal (2), +.BR credentials (7), +.BR capabilities (7) diff --git a/release/man2/link.2 b/release/man2/link.2 new file mode 100644 index 00000000..3b160e0c --- /dev/null +++ b/release/man2/link.2 @@ -0,0 +1,209 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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-23 by Rik Faith +.\" Modified 1994-08-21 by Michael Haardt +.\" Modified 2004-06-23 by Michael Kerrisk +.\" Modified 2005-04-04, as per suggestion by Michael Hardt for rename.2 +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Thu Dec 11 23:47:55 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Tue Feb 8 06:36:08 JST 2005 +.\" by Yuichi SATO +.\" Updated & Modified Fri Apr 22 02:05:00 JST 2005 by Yuichi SATO +.\" Updated 2008-09-07, Akihiro MOTOKI , LDP v3.08 +.\" +.\"WORD: link ¥ê¥ó¥¯ +.\"WORD: hard link ¥Ï¡¼¥É¡¦¥ê¥ó¥¯ +.\"WORD: overwrite ¾å½ñ¤­ +.\"WORD: permission µö²Ä(permission) +.\"WORD: ownership ½êÍ­¼Ô(ownership) +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: effective uid ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: dangling symbolic link ²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: directory entry ¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê +.\" +.TH LINK 2 2008-08-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +link \- ¥Õ¥¡¥¤¥ë¤Î¿·¤·¤¤Ì¾Á°¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int link(const char *" oldpath ", const char *" newpath ); +.SH ÀâÌÀ +.BR link () +¤Ï¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¤Ø¤Î¿·¤·¤¤¥ê¥ó¥¯ (link) +(¥Ï¡¼¥É¡¦¥ê¥ó¥¯ (hard link) ¤È¤â¤¤¤¦) ¤òºîÀ®¤¹¤ë¡£ + +.I newpath +¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¾å½ñ¤­¤Ï\fI¤µ¤ì¤Ê¤¤\fR¡£ + +¤³¤Î¿·¤·¤¤Ì¾Á°¤ÏÁ´¤Æ¤ÎÁàºî¤Ë¤ª¤¤¤Æ¸Å¤¤Ì¾Á°¤È´°Á´¤ËƱ¤¸¤è¤¦¤Ë»ÈÍѤµ¤ì¤ë; +ξÊý¤Î̾Á°¤ÏƱ¤¸¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤ª¤ê +(¤½¤ì¤ÇƱ¤¸µö²Ä (permission) ¤ä½êÍ­¼Ô (ownership) ¤È¤Ê¤ë¤Î¤Ç)¡¢ +¤É¤Á¤é¤Î̾Á°¤¬ËÜÍè¤Î¤â¤Î¤Ç¤¢¤ë¤«È½Ê̤Ǥ­¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.I newpath +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î½ñ¤­¹þ¤ß¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +.I oldpath +¤Þ¤¿¤Ï +.I newpath +¤Ø¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä¤¬¤Ê¤¤ +.RB ( path_resolution (7) +¤ò»²¾È)¡£ +.TP +.B EEXIST +.I newpath +¤¬´û¤Ë¸ºß¤¹¤ë¡£ +.TP +.B EFAULT +.IR oldpath " ¤Þ¤¿¤Ï " newpath " +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EIO +I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ELOOP +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B EMLINK +.I oldpath +¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ï +´û¤ËºÇÂç¿ô¤Þ¤Ç¤Î¥ê¥ó¥¯¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +.TP +.B ENAMETOOLONG +.IR oldpath " ¤Þ¤¿¤Ï " newpath " +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢ +²õ¤ì¤¿(dangling)¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOSPC +¤½¤Î¥Õ¥¡¥¤¥ë¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥Ð¥¤¥¹¤Ë¿·¤·¤¤¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤ò +ºîÀ®¤¹¤ë¤¿¤á¤Î¶õ¤­¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¡¢¼ÂºÝ¤Ë¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EPERM +.I oldpath +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¡£ +.TP +.B EPERM +.IR oldpath " ¤È " newpath +¤ò´Þ¤ó¤Ç¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬¥Ï¡¼¥É¡¦¥ê¥ó¥¯¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EROFS +¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +.TP +.B EXDEV +.IR oldpath " ¤È " newpath +¤¬Æ±¤¸¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£ +(Linux ¤Ï 1 ¤Ä¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤òÊ£¿ô¤Î¥Þ¥¦¥ó¥È°ÌÃÖ¤Ë +¥Þ¥¦¥ó¥È¤¹¤ë¤³¤È¤òµö²Ä¤·¤Æ¤¤¤ë¡£ +¤·¤«¤· +.BR link () +¤Ï¡¢¤¿¤È¤¨Æ±¤¸¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤¢¤Ã¤Æ¤â¡¢ +ÊÌ¡¹¤Î¥Þ¥¦¥ó¥È°ÌÃÖ¤ò¸Ù¤¤¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¡£) +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001 (⤷¡ÖÃí°Õ¡×¤ò»²¾È)¡£ +.\" SVr4 ¤Ï¾¤Ë ENOLINK, EMULTIHOP ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤âµ­½Ò¤·¤Æ¤¤¤ë¡£ +.\" POSIX.1 ¤Ë¤Ï ELOOP ¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£ +.\" X/OPEN ¤Ë¤Ï EFAULT, ENOMEM, EIO ¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +.BR link () +¤Ç¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤òĶ¤¨¤Æ¥Ï¡¼¥É¡¦¥ê¥ó¥¯¤òºîÀ®¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ï +.BR symlink (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ + +POSIX.1-2001 ¤Ç¤Ï¡¢ +.I oldpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¡¢ +.BR link () +¤Ï +.I oldpath +¤Î»²¾È¤ò²ò·è¤¹¤Ù¤­¤Ç¤¢¤ë¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +¤·¤«¤·¡¢¥«¡¼¥Í¥ë 2.0 °Ê¹ß¤Î +.\" Àµ³Î¤Ë¤Ï¥«¡¼¥Í¥ë 1.3.56 °Ê¹ß +Linux ¤Ç¤Ï¤½¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¡£ +.I oldpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¡¢ +.I newpath +¤ÏƱ¤¸¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¥Õ¥¡¥¤¥ë¤Ø¤Î (¥Ï¡¼¥É) ¥ê¥ó¥¯¤È¤·¤ÆºîÀ®¤µ¤ì¤ë +(¤Ä¤Þ¤ê +.I newpath +¤Ï +.I oldpath +¤¬»²¾È¤·¤Æ¤¤¤¿Æ±¤¸¥Õ¥¡¥¤¥ë¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤Ê¤ë)¡£ +¾¤Î¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤Ç¤â Linux ¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ +.\" Î㤨¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤Î Solaris ¤Î¥³¥ó¥Ñ¥¤¥ë´Ä¶­¤Ç¤Ï +.\" Linux ¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£¤½¤·¤Æ Austin ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Î +.\" 2005 ǯ 3 ·î¤Î¥¹¥ì¥Ã¥É¤ËÅê¹Æ¤·¤¿¿Í¤¿¤Á¤Ï¡¢ +.\" ¤½¤Î¾¤Î¤¤¤¯¤Ä¤«¤Î (System V) ¼ÂÁõ¤Ç¤âƱ¤¸¤Ç¤¢¤Ã¤¿/¤¢¤ë¡¢ +.\" ¤ÈÊó¹ð¤·¤Æ¤¤¤ë -- MTK, Apr 05 +POSIX.1-2008 ¤Ç¤Ï +.BR link () +¤Î»ÅÍͤ¬Êѹ¹¤µ¤ì¡¢ +.I oldpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î»²¾È¤ò +²ò·è¤¹¤ë¤«¤É¤¦¤«¤Ï¼ÂÁõ°Í¸¤È¤Ê¤Ã¤¿¡£ +¥ê¥ó¥¯ºîÀ®»þ¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î°·¤¤¤Ë¤Ä¤¤¤Æ¤Î¾ÜºÙ¤ÊÀ©¸æ¤Ë +´Ø¤·¤Æ¤Ï +.BR linkat (2) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥Ð¥° +NFS ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤Ï¡¢NFS ¥µ¡¼¥Ð¡¼¤¬¥ê¥ó¥¯¤òºîÀ®¤·¤¿¸å¤Ë¡¢ +¤½¤ì¤òÅÁ¤¨¤ëÁ°¤Ë»à¤ó¤À¾ì¹ç¤Ë¤ÏÊÖ¤êÃͤ¬ÉÔÀµ¤Ê¾ì¹ç¤¬¤¢¤ë¡£ +¥ê¥ó¥¯¤¬ºîÀ®¤Ç¤­¤¿¤«¤É¤¦¤«¸«¤Ä¤±¤ë¤¿¤á¤Ë¤Ï +.BR stat (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ln (1), +.BR linkat (2), +.BR open (2), +.BR rename (2), +.BR stat (2), +.BR symlink (2), +.BR unlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/release/man2/linkat.2 b/release/man2/linkat.2 new file mode 100644 index 00000000..a8a1ced7 --- /dev/null +++ b/release/man2/linkat.2 @@ -0,0 +1,160 @@ +.\" 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-09-30 by Yuichi SATO , LDP v2.39 +.\" +.TH LINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +linkat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤˥ե¡¥¤¥ë¥ê¥ó¥¯¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int linkat(int " olddirfd ", const char *" oldpath , +.BI " int " newdirfd ", const char *" newpath ", int " flags ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR linkat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +.BR linkat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.BR link (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I oldpath +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹Ì¾¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I olddirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( link (2) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I oldpath +¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä +.I olddirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I oldpath +¤Ï +.RB ( link (2) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I oldpath +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I olddirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.I newpath +¤Î²ò¼á¤Ï +.I oldpath +¤ÈƱÍͤǤ¢¤ë¤¬¡¢ +ÁêÂХѥ¹Ì¾¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I newdirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.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 ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤«¤Ã¤¿¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR linkat () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR link (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR linkat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR linkat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I olddirfd +¤Þ¤¿¤Ï +.I newdirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I oldpath +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I olddirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +¤Þ¤¿¤Ï +.I newpath +¤È +.I newdirfd +¤Ë¤Ä¤¤¤Æ¡¢Æ±ÍͤΤ³¤È¤¬µ¯¤­¤Æ¤¤¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR linkat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2008. +.SH Ãí°Õ +.BR linkat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR link (2), +.BR openat (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/release/man2/listen.2 b/release/man2/listen.2 new file mode 100644 index 00000000..fb130a9c --- /dev/null +++ b/release/man2/listen.2 @@ -0,0 +1,183 @@ +.\" Copyright (c) 1983, 1991 The Regents of the University of California. +.\" and Copyright (C) 2007, Michael Kerrisk +.\" 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. +.\" +.\" $Id: listen.2,v 1.4 2001/05/19 02:09:20 hanataka Exp $ +.\" +.\" Modified Fri Jul 23 22:07:54 1993 by Rik Faith +.\" Modified 950727 by aeb, following a suggestion by Urs Thuermann +.\" +.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" 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" +.SH ̾Á° +listen \- ¥½¥±¥Ã¥È(socket)¾å¤ÎÀܳ¤òÂÔ¤Ä +.SH ½ñ¼° +.nf +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.br +.B #include +.sp +.BI "int listen(int " sockfd ", int " backlog ); +.fi +.SH ÀâÌÀ +.BR listen () +¤Ï +.I sockfd +¤¬»²¾È¤¹¤ë¥½¥±¥Ã¥È¤òÀܳÂÔ¤Á¥½¥±¥Ã¥È (passive socket) ¤È¤·¤Æ°õ¤ò¤Ä¤±¤ë¡£ +ÀܳÂÔ¤Á¥½¥±¥Ã¥È¤È¤Ï¡¢ +.BR accept (2) +¤ò»È¤Ã¤ÆÅþÃ夷¤¿ÀܳÍ×µá¤ò¼õ¤±ÉÕ¤±¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£ + +.I sockfd +°ú¤­¿ô¤Ï¡¢ +.B SOCK_STREAM +·¿¤« +.B SOCK_SEQPACKET +·¿¤Î¥½¥±¥Ã¥È¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ + +.I backlog +°ú¤­¿ô¤Ï¡¢ +.I sockfd +¤Ë¤Ä¤¤¤Æ¤ÎÊÝαÃæ¤ÎÀܳ¤Î¥­¥å¡¼¤ÎºÇÂçŤò»ØÄꤹ¤ë¡£ +¥­¥å¡¼¤¬¤¤¤Ã¤Ñ¤¤¤Î¾õÂÖ¤ÇÀܳÍ׵᤬ÅþÃ夹¤ë¤È¡¢¥¯¥é¥¤¥¢¥ó¥È¤Ï +.B ECONNREFUSED +¤È¤¤¤¦¥¨¥é¡¼¤ò¼õ¤±¼è¤ë¡£²¼°ÌÁؤΥץí¥È¥³¥ë¤¬ºÆÁ÷¿®¤ò¥µ¥Ý¡¼¥È +¤·¤Æ¤¤¤ì¤Ð¡¢Í×µá¤Ï̵»ë¤µ¤ì¡¢¤³¤ì°Ê¹ß¤ÎÀܳÍ×µá¤ÎºÆÁ÷¿®¤¬À®¸ù¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù»þ¤Ë¤Ï0¤òÊÖ¤¹¡£¥¨¥é¡¼»þ¤Ë¤Ï \-1¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EADDRINUSE +Ê̤Υ½¥±¥Ã¥È¤¬´û¤ËƱ¤¸¥Ý¡¼¥È¤ò listen ¤·¤Æ¤¤¤ë¡£ +.TP +.B EBADF +°ú¤­¿ô +.I sockfd +¤ÏÍ­¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ENOTSOCK +°ú¤­¿ô +.I sockfd +¤Ï¥½¥±¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EOPNOTSUPP +¥½¥±¥Ã¥È¤Ï +.BR listen () +¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë·¿¤Ç¤Ï¤Ê¤¤¡£ +.SH ½àµò +4.4BSD, POSIX.1-2001. +.BR listen () +´Ø¿ô¤Ï 4.2BSD¤Ç½é¤á¤Æ¼ÂÁõ¤µ¤ì¤¿¡£ +.SH Ãí°Õ +Àܳ¤ò¼õ¤±ÉÕ¤±¤ë¤Ë¤Ï¡¢°Ê²¼¤Î½èÍý¤¬¼Â¹Ô¤µ¤ì¤ë¡£ +.RS 4 +.IP 1. 4 +.BR socket (2) +¤Ç¥½¥±¥Ã¥È¤òºîÀ®¤¹¤ë¡£ +.IP 2. +.BR bind (2) +¤ò»È¤Ã¤Æ¥½¥±¥Ã¥È¤Ë¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤ò³ä¤êÅö¤Æ¤Æ¡¢ +¾¤Î¥½¥±¥Ã¥È¤¬¤³¤Î¥½¥±¥Ã¥È¤Ë +.BR connect (2) +¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +.IP 3. +.BR listen () +¤ò»È¤Ã¤Æ¡¢ÀܳÍ×µá¤ò¼õ¤±ÉÕ¤±¤ë°Õ»Ö¤ÈÀܳÍ×µá¤òÆþ¤ì¤ë¥­¥å¡¼Ä¹¤ò»ØÄꤹ¤ë¡£ +.IP 4. +.BR accept (2) +¤ò»È¤Ã¤ÆÀܳ¤ò¼õ¤±ÉÕ¤±¤ë¡£ +.RE +.PP +POSIX.1-2001 ¤Ç¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ïɬ¿Ü¤È¤µ¤ì¤Æ¤ª¤é¤º¡¢ +Linux ¤Ç¤Ï¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÏɬÍפǤϤʤ¤¡£ +¤·¤«¤·¡¢Îò»ËŪ¤Ë¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¼ÂÁõ (BSD ·Ï) ¤Ç¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬ +ɬÍפǤ¢¤ê¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò +¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬¸­ÌÀ¤Ç¤¢¤í¤¦¡£ + +TCP ¥½¥±¥Ã¥È¤Ç¤Î +.I backlog +°ú¤­¿ô¤Î¿¶¤ëÉñ¤¤¤Ï Linux 2.2 ¤ÇÊѹ¹¤µ¤ì¤¿¡£ +¸½ºß¤Ç¤Ï¤³¤Î°ú¤­¿ô¤Ï¡¢ +¼õ¤±ÉÕ¤±¤é¤ì¤ë¤Î¤òÂԤäƤ¤¤ë¡¢ +.I ´°Á´¤Ë +³ÎΩ¤µ¤ì¤¿¥½¥±¥Ã¥È¤Î¥­¥å¡¼¤ÎŤµ¤ò»ØÄꤹ¤ë¡£ +°ÊÁ°¤ÏÉÔ´°Á´¤ÊÀܳÍ×µá¤Î¿ô¤Ç¤¢¤Ã¤¿¤¬¡¢¤³¤ì¤òÃÖ¤­´¹¤¨¤¿¡£ +ÉÔ´°Á´¤Ê¥½¥±¥Ã¥È¤Î¥­¥å¡¼¤ÎºÇÂçĹ¤Ï +.I /proc/sys/net/ipv4/tcp_max_syn_backlog +¤òÍѤ¤¤ÆÀßÄê¤Ç¤­¤ë¡£ +syncookie ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +ÏÀÍýŪ¤ÊºÇÂçĹ¤Ï¸ºß¤»¤º¡¢¤³¤ÎÀßÄê¤Ï̵»ë¤µ¤ì¤ë¡£ + +.I backlog +°ú¤­¿ô¤¬ +.I /proc/sys/net/core/somaxconn +¤ÎÃͤè¤ê¤âÂ礭¤±¤ì¤Ð¡¢ +.I backlog +¤ÎÃͤϰÅÌۤΤ¦¤Á¤Ë¤³¤ÎÃͤËÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 128 ¤Ç¤¢¤ë¡£ +¥Ð¡¼¥¸¥ç¥ó 2.4.5 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Î¾å¸ÂÃÍ¤Ï +¥³¡¼¥ÉËä¤á¹þ¤ß¤Î¸ÇÄêÃÍ +.B SOMAXCONN +¤Ç¤¢¤ê¡¢¤½¤ÎÃÍ¤Ï 128 ¤Ç¤¢¤Ã¤¿¡£ +.\" °Ê²¼¤Ï¡¢º£¤Ç¤Ï¸Å¤¤¾ðÊó¤Ç¤¢¤ë¡£(MTK, Jun 05) +.\" BSD (¤È¡¢¤¤¤¯¤Ä¤«¤Î BSD ¤«¤éÇÉÀ¸¤·¤¿¥·¥¹¥Æ¥à)¤Ç¤Ï backlog ¤ò 5 ¤Ë +.\" À©¸Â¤·¤Æ¤¤¤ë¤Î¤Ç¡¢°Ü¿¢À­¤ò¹Íθ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï +.\" ¤³¤ÎÃÍ (SOMAXCONN) ¤ËÍê¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.SH Îã +.BR bind (2) +»²¾È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR accept (2), +.BR bind (2), +.BR connect (2), +.BR socket (2), +.BR socket (7) diff --git a/release/man2/listxattr.2 b/release/man2/listxattr.2 new file mode 100644 index 00000000..2dbf556a --- /dev/null +++ b/release/man2/listxattr.2 @@ -0,0 +1,176 @@ +.\" +.\" Extended attributes system calls manual pages +.\" +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" 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) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 04:17:12 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: extended attributes ³Èĥ°À­ +.\"WORD: namespace ̾Á°¶õ´Ö +.\" +.TH LISTXATTR 2 2001-12-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +listxattr, llistxattr, flistxattr \- ³Èĥ°À­¤Î̾Á°¥ê¥¹¥È¤òÆÀ¤ë +.SH ½ñ¼° +.fam C +.nf +.B #include +.B #include +.sp +.BI "ssize_t listxattr(const char\ *" path ", char\ *" list \ +", size_t " size ); +.BI "ssize_t llistxattr(const char\ *" path ", char\ *" list \ +", size_t " size ); +.BI "ssize_t flistxattr(int " fd ", char\ *" list ", size_t " size ); +.fi +.fam T +.SH ÀâÌÀ +³Èĥ°À­¤Ï¡¢inode (¥Õ¥¡¥¤¥ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯Åù) ¤Ë +´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +.IR name :\c +.I value +¤ÎÂФǤ¢¤ë¡£ +¤³¤ì¤é¤Ï¡¢¥·¥¹¥Æ¥à¾å¤Î¤¹¤Ù¤Æ¤Î inode ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ä̾ï¤Î°À­ +.RB ( stat (2) +¤¬ÊÖ¤¹¥Ç¡¼¥¿) ¤ò³ÈÄ¥¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +³Èĥ°À­¤Î¥³¥ó¥»¥×¥È¤Ï +.BR attr (5) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +.BR listxattr () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î»ØÄꤵ¤ì¤¿ +.I path +¤ËÂбþ¤¹¤ë³Èĥ°À­¤Î̾Á°¥ê¥¹¥È¤ò¼èÆÀ¤¹¤ë¡£ +¥ê¥¹¥È¤Ï̾Á°¤Î½¸¹ç¤Ç¡¢ NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤¬Ï¢Â³¤·¤Æʤó¤Ç¤¤¤ë¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤Î¤Ê¤¤³Èĥ°À­¤Î̾Á°¤Ï¡¢ +¥ê¥¹¥È¤Ë´Þ¤Þ¤ì¤Ê¤¤¡£³Èĥ°À­¤Î̾Á°¤Î +.I list +¤ÎŤµ¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.BR llistxattr () +¤Ï +.BR listxattr () +¤ÈƱ¤¸¤À¤¬¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¡¢¥ê¥ó¥¯¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë +¤Ç¤Ï¤Ê¤¯¡¢¥ê¥ó¥¯¤½¤Î¤â¤Î¤Î³Èĥ°À­¤Î̾Á°¥ê¥¹¥È¤ò¼èÆÀ¤¹¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +.PP +.BR flistxattr () +¤Ï +.BR listxattr () +¤ÈƱ¤¸¤À¤¬¡¢ +.I path +¤ÎÂå¤ï¤ê¤Ë +.I fd +¤Ç»²¾È¤µ¤ì¤¿¥ª¡¼¥×¥óºÑ¤ß¥Õ¥¡¥¤¥ë¤Î¾ðÊó¤À¤±¤ò¼èÆÀ¤¹¤ëÅÀ¤¬°Û¤Ê¤ë +.RI ( filedes +¤Ï +.BR open (2) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë)¡£ +.PP +¸Ä¡¹¤Î³Èĥ°À­¤Î +.I name +¤ÏÉáÄ̤ΠNULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +̾Á°¤Ë¤Ï¡¢Ì¾Á°¶õ´Ö¤òɽ¤¹ÀÜƬ¼­ (prefix) ¤¬´Þ¤Þ¤ì¤ë; +¸Ä¡¹¤Î inode ¤ËÂФ·¤Æ¡¢¸ß¤¤¤ËÆÈΩ¤Ê̾Á°¶õ´Ö¤¬Ê£¿ô¤¢¤Ã¤Æ¤â¤è¤¤¡£ +.PP +.I size +¤Ë 0 ¤ò»ØÄꤷ¤Æ¶õ¤Î¥Ð¥Ã¥Õ¥¡¤ò¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹¤³¤È¤¬¤Ç¤­¡¢ +¤³¤Î¾ì¹ç¤Ë¤Ï³Èĥ°À­¤Î̾Á°¥ê¥¹¥È¤Î¸½ºß¤Î¥µ¥¤¥º¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤ÎÊýË¡¤Ï̾Á°¥ê¥¹¥È¤òÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Î¥Ð¥Ã¥Õ¥¡¡¦¥µ¥¤¥º¤ò +¸«ÀѤâ¤ë¤Î¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡¢ +.SS Îã +ÊÖ¤µ¤ì¤ë̾Á°¤Î +.I list +¤Ï¡¢ NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤ÎÇÛÎó (°À­Ì¾¤Ï NULL ¥Ð¥¤¥È (\(aq\\0\(aq) +¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤ë) ¤Ç¡¢³ÆÍ×ÁǤÏÀ°Î󤵤ì¤Æ¤¤¤ëÌõ¤Ç¤Ï¤Ê¤¤¡£ +°Ê²¼¤ËÎã¤ò¼¨¤¹: +.fam C +.RS +.nf + +user.name1\\0system.name1\\0user.name2\\0 +.fi +.RE +.fam T +.P +³Èĥ°À­¤ò»È¤Ã¤Æ POSIX ACL ¤ò¼ÂÁõ¤·¤Æ¤¤¤ë ext2¡¢ext3¡¢XFS ¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë +¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ÊÖ¤µ¤ì¤ë +.I list +¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¤³¤È¤À¤í¤¦: +.fam C +.RS +.nf + +system.posix_acl_access\\0system.posix_acl_default\\0 +.fi +.RE +.fam T +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢³Èĥ°À­¤Î̾Á°¥ê¥¹¥È¤ÎŤµ¤òɽ¤¹Àµ¤Î¿ô¤¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.I list +¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ +.I size +¤¬·ë²Ì¤òÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I errno +¤Ë +.B ERANGE +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +³Èĥ°À­¤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¤â¤·¤¯¤Ï̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOTSUP +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.BR stat (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀâÌÀ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ï +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤âŬÍѤµ¤ì¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.4 °Ê¹ß¤Î Linux ¤ÇÍøÍѤǤ­¤ë¡£ +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3 °Ê¹ß¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\" .SH Ãø¼Ô +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" ¤È the SGI XFS development team, +.\" .RI < linux-xfs@oss.sgi.com >¡£ +.\" ¥Ð¥°¥ì¥Ý¡¼¥È¤ä¥³¥á¥ó¥È¤Ï¾åµ­¤Î¥¢¥É¥ì¥¹¤Þ¤ÇÁ÷¤Ã¤Æ²¼¤µ¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getfattr (1), +.BR setfattr (1), +.BR getxattr (2), +.BR open (2), +.BR removexattr (2), +.BR setxattr (2), +.BR stat (2), +.BR attr (5), +.BR symlink (7) diff --git a/release/man2/llseek.2 b/release/man2/llseek.2 new file mode 100644 index 00000000..91110bbd --- /dev/null +++ b/release/man2/llseek.2 @@ -0,0 +1,100 @@ +.\" 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 10 June 1995 by Andries Brouwer +.\" Modified Thu Oct 31 15:16:23 1996 by Eric S. Raymond +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sun Feb 23 16:22:27 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Sat Jun 2 18:27:49 JST 2001 +.\" by Yuichi SATO +.\" Updated & Modified Sat Sep 6 17:05:03 JST 2003 +.\" by Yuichi SATO +.\" Updated & Modified Fri Dec 31 00:50:01 JST 2004 by Yuichi SATO +.\" +.\"WORD: offset ¥ª¥Õ¥»¥Ã¥È +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\"WORD: argument °ú¤­¿ô +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: support ¥µ¥Ý¡¼¥È +.\" +.TH LLSEEK 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +_llseek \- ¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¥ª¥Õ¥»¥Ã¥È¤Î°ÌÃÖ¤òÊѤ¨¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "int _llseek(unsigned int " fd ", unsigned long " offset_high , +.BI " unsigned long " offset_low ", loff_t *" result , +.BI " unsigned int " whence ); +.fi +.SH ÀâÌÀ +.BR _llseek () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ (descriptor) +.I fd +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥ª¥Õ¥»¥Ã¥È¤Î°ÌÃÖ¤ò¡¢ÁêÂÐŪ¤Ë +.I (offset_high<<32) | offset_low +¥Ð¥¤¥È¤À¤±Êѹ¹¤¹¤ë¡£ +´ð½à¤È¤Ê¤ë°ÌÃÖ¤òɽ¤¹ +.I whence +¤Ë¤Ï +.BR SEEK_SET , +.BR SEEK_CUR , +.B SEEK_END +¤Î¤¤¤º¤ì¤«¤ò»ØÄꤷ¡¢¤½¤ì¤¾¤ì +¥Õ¥¡¥¤¥ë¤ÎÀèƬ¡¢¥Õ¥¡¥¤¥ë¤Î¸½ºß°ÌÃÖ¡¢ +¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤òɽ¤¹¡£ +·ë²Ì¤Î¥Õ¥¡¥¤¥ë°ÌÃÖ¤ò +.I result +°ú¤­¿ô¤ËÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¡¢ +.BR _llseek () +¤Ï 0 ¤òÊÖ¤¹¡£ +¤½¤¦¤Ç¤Ê¤ì¤Ð \-1 ¤È¤¤¤¦Ãͤ¬Ê֤ꡢ¥¨¥é¡¼¤ò¼¨¤¹ +.I errno +¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ê¤¤¡£ +.TP +.B EFAULT +·ë²Ì¤ò¥æ¡¼¥¶¶õ´Ö¤Ë¥³¥Ô¡¼¤¹¤ë¤È¤­¤ËÌäÂ꤬¤¢¤Ã¤¿¡£ +.TP +.B EINVAL +.I whence +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR lseek (2), +.BR lseek64 (3) diff --git a/release/man2/lookup_dcookie.2 b/release/man2/lookup_dcookie.2 new file mode 100644 index 00000000..9db58320 --- /dev/null +++ b/release/man2/lookup_dcookie.2 @@ -0,0 +1,99 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2003 John Levon +.\" +.\" 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 2004-06-17 Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated, 2003-06-04, Akihiro MOTOKI +.\" Updated, 2003-09-30, Akihiro MOTOKI +.\" Updated, 2005-02-10, Akihiro MOTOKI +.\" +.\"WORD: opaque identifier ÆâÉô¼±ÊÌ»Ò +.\"WORD: Linux specific Linux Æȼ« +.\"WORD: capability ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\" +.TH LOOKUP_DCOOKIE 2 2004-06-17 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +lookup_dcookie \- ¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤Î¥Ñ¥¹Ì¾¤òÊÖ¤¹ +.SH ½ñ¼° +.BI "int lookup_dcookie(u64 " cookie ", char *" buffer ", size_t " len ); +.SH ÀâÌÀ +.I cookie +ÃͤǻØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤Î¥Õ¥ë¥Ñ¥¹Ì¾¤ò¸¡º÷¤¹¤ë¡£ +cookie ¤Ï¡¢¸Ä¡¹¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤ò¶èÊ̤¹¤ëÆâÉô¼±ÊÌ»Ò (opaque +identifier) ¤Ç¤¢¤ë¡£°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤Î +¥Õ¥ë¥Ñ¥¹Ì¾¤¬³ÊǼ¤µ¤ì¤ë¡£ + +.BR lookup_dcookie () +¤¬Àµ¾ï¤ËÃͤòÊÖ¤¹¤¿¤á¤Ë¤Ï¡¢¥«¡¼¥Í¥ë¤¬¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤Ø¤Î cookie »²¾È¤ò +ÊÝ»ý¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR lookup_dcookie () +¤Ï¥Ð¥Ã¥Õ¥¡¤Ë¥³¥Ô¡¼¤·¤¿¥Ñ¥¹Ê¸»úÎó¤ÎŤµ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +¥Ð¥Ã¥Õ¥¡¤¬Í­¸ú¤Ç¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINVAL +¸¡º÷¤¬¹Ô¤ï¤ì¤¿»þ¡¢cookie ¤È¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤Î¥Þ¥Ã¥Ô¥ó¥°¤¬¥«¡¼¥Í¥ë¤Ë +ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤«¡¢¤Þ¤¿¤Ï cookie ¤¬Í­¸ú¤Ê¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤ò +»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENAMETOOLONG +̾Á°¤¬¥Ð¥Ã¥Õ¥¡¤ËÆþ¤êÀÚ¤é¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤¬¡¢¥Ñ¥¹Ì¾¤òÊÝ»ý¤¹¤ë°ì»þ¥Ð¥Ã¥Õ¥¡ÍѤΥá¥â¥ê¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬ +¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPERM +¥×¥í¥»¥¹¤¬ cookie Ãͤò¸¡º÷¤¹¤ë¤Î¤ËɬÍפʥ±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.B CAP_SYS_ADMIN +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ERANGE +¥Ð¥Ã¥Õ¥¡¤¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤Î¥Ñ¥¹Ì¾¤ò¼ýÍƤ¹¤ë¤Î¤Ë +½½Ê¬¤ÊÂ礭¤µ¤Ç¤Ï¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +Linux 2.5.43 °Ê¹ß¤ÇÍøÍѤǤ­¤ë¡£ +¥¨¥é¡¼ +.B ENAMETOOLONG +¤òÊÖ¤¹»ÅÍÍ¤Ï 2.5.70 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +.BR lookup_dcookie () +¤Ï Linux Æȼ«¤Î´Ø¿ô¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR lookup_dcookie () +¤ÏÆüì¤ÊÍÑÅӤ˻Ȥï¤ì¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢¸½ºß¤Î¤È¤³¤í oprofile profiler ¤Ç +»È¤ï¤ì¤Æ¤¤¤ë¤À¤±¤Ç¤¢¤ë¡£ + +»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤¬ºï½ü¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢ÊÖ¤µ¤ì¤ë¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Ë +" (deleted)" +¤È¤¤¤¦Ê¸»úÎó¤¬Éղ䵤ì¤ë¤³¤È¤¬¤¢¤ë¡£ diff --git a/release/man2/lseek.2 b/release/man2/lseek.2 new file mode 100644 index 00000000..846fb2c1 --- /dev/null +++ b/release/man2/lseek.2 @@ -0,0 +1,174 @@ +.\" Copyright (c) 1980, 1991 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. +.\" +.\" @(#)lseek.2 6.5 (Berkeley) 3/10/91 +.\" +.\" Modified Fri Jul 23 22:17:00 1993 by Rik Faith +.\" Modified 10 June 1995 by Andries Brouwer +.\" Modified Thu Oct 31 15:18:33 1996 by Eric S. Raymond +.\" Modified Sat Jan 17 13:00:32 MET 1998 by Michael Haardt +.\" +.\" Modified Mon Sep 24 16:18:02 CEST 2001 by Michael Haardt +.\" +.\" Japanese Version Copyright (c) 1997-1998 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Modified 1998-05-11, HANATAKA Shinya +.\" Updated 2001-12-14, Kentaro Shirakata +.\" Updated 2003-09-08, Kentaro Shirakata +.\" Updated 2005-02-24, Akihiro MOTOKI +.\" Updated 2006-03-05, Akihiro MOTOKI, catch up to LDP v2.25 +.\" +.\"WORD: end-of-file ¥Õ¥¡¥¤¥ë¤Î½ªÃ¼(end-of-file) +.\" +.TH LSEEK 2 2001-09-24 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +lseek \- ¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¥ª¥Õ¥»¥Ã¥È¤Î°ÌÃÖ¤òÊѤ¨¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "off_t lseek(int " fd ", off_t " offset ", int " whence ); +.SH ÀâÌÀ +.BR lseek () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ (descriptor) +.I fd +¤ËÂбþ¤¹¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥ª¥Õ¥»¥Ã¥È¤ò¡¢ +.IR whence +¤Ë´ð¤Å¤­ +.I offset +°ú¤­¿ô¤Î°ÌÃ֤ذʲ¼¤Î¤è¤¦¤ËÊѹ¹¤¹¤ë: +.TP +.B SEEK_SET +¥ª¥Õ¥»¥Ã¥È¤Ï +.I offset +¥Ð¥¤¥È¤ËÀßÄꤵ¤ì¤ë¡£ +.TP +.B SEEK_CUR +¥ª¥Õ¥»¥Ã¥È¤Ï¸½ºß°ÌÃÖ¤Ë +.I offset +¥Ð¥¤¥È¤ò­¤·¤¿°ÌÃ֤ˤʤ롣 +.TP +.B SEEK_END +¥ª¥Õ¥»¥Ã¥È¤Ï¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤Ë +.I offset +¥Ð¥¤¥È¤ò­¤·¤¿°ÌÃ֤ˤʤ롣 +.PP +.BR lseek () +´Ø¿ô¤Ï¡¢¥ª¥Õ¥»¥Ã¥È¤ò¥Õ¥¡¥¤¥ë¤ÎËöÈø¤ò±Û¤¨¤¿°ÌÃÖ¤ËÀßÄê¤Ç¤­¤ë +(⤷¡¢¤³¤ì¤Ë¤è¤ê¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤¬ÊѤï¤é¤Ê¤¤)¡£ +¤â¤·¥Ç¡¼¥¿¤¬¤³¤Î¥ª¥Õ¥»¥Ã¥È°ÌÃְʹߤ˽ñ¤­¹þ¤Þ¤ì¤¿¾ì¹ç¡¢ +´Ö¤Î¶õ·ä¤ÎÉôʬ ("·ê (hole)") ¤ÎÆɤ߽Ф·¤¬¤¢¤ë¤È¡¢ +¼ÂºÝ¤Ë¤½¤³¤Ë¥Ç¡¼¥¿¤ò½ñ¤­¹þ¤Þ¤ì¤ë¤Þ¤Ç¤Ï +NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤ÎÎó¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR lseek () +¤Ï·ë²Ì¤Î¥Õ¥¡¥¤¥ë°ÌÃÖ¤ò¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤«¤é¤Î¥Ð¥¤¥È¿ô¤ÇÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ÃͤȤ·¤Æ \fI(off_t)\ \-1\fP ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤¬»Ø¼¨¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.I whence +¤¬ +.BR SEEK_SET , +.BR SEEK_CUR , +.B SEEK_END +¤Î¤É¤ì¤Ç¤â¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢seek ¤Î·ë²Ì¡¢¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤¬Éé¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¤«¡¢ +seek ²Äǽ¤Ê¥Ç¥Ð¥¤¥¹¤ÎËöÈø¤ò±Û¤¨¤Æ¤·¤Þ¤¦¡£ +.\" ¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹¤ä¥ê¥â¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ·¤Æ +.\" Éé¤Î¥ª¥Õ¥»¥Ã¥È¤¬µö¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.B EOVERFLOW +.\" ¤³¤Î¾ì¹ç HP-UX 11 ¤Ï EINVAL ¤òÊÖ¤¹ (°ìÊý¡¢POSIX.1 ¤Ï EOVERFLOW ¤òÊÖ¤¹) +·ë²Ì¤Î¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤ò +.I off_t +·¿¤Çɽ¸½¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.B ESPIPE +.I fd +¤¬¥Ñ¥¤¥×¡¢¥½¥±¥Ã¥È¡¢FIFO ¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +¤³¤Îʸ¾Ï¤Ç»ÈÍѤ·¤¿ +.I whence +¤Ï±Ñ¸ì¤È¤·¤ÆÀµ¤·¤¯¤Ê¤¤¤¬¡¢ +Îò»ËŪÍýͳ¤Ë¤è¤ê¤½¤Î¤Þ¤Þ»È¤ï¤ì¤Æ¤¤¤ë¡£ + +¤¤¤¯¤Ä¤«¤Î¥Ç¥Ð¥¤¥¹¤Ç¤Ï seek ¤¬¤Ç¤­¤Ê¤¤¡£ +POSIX ¤Ï¤É¤Î¥Ç¥Ð¥¤¥¹¤¬ +.BR lseek () +¤ËÂбþ¤¹¤Ù¤­¤«¤Ïµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£ + +Linux ¤Ç¤Ï¡¢ tty ¥Ç¥Ð¥¤¥¹¤Ë +.BR lseek () +¤ò»ÈÍѤ¹¤ë¤È +\fBESPIPE\fP ¤òÊÖ¤¹¡£ +.\" ¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¤Î¿ô¤òÊÖ¤·¡¢ +.\" SEEK_SET ¤òÍѤ¤¤Æ¥«¥¦¥ó¥¿¤òÀßÄꤹ¤ë¡£ (½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¤Î¡£) + +¸Å¤¤¥³¡¼¥É¤òÊÑ´¹¤¹¤ë»þ¤Ï \fIwhence\fP ¤ÎÃͤò°Ê²¼¤Î¥Þ¥¯¥í¤ËÃÖ¤­´¹¤¨¤ë¤³¤È: +.TS +c c +l l. +old new +0 SEEK_SET +1 SEEK_CUR +2 SEEK_END +L_SET SEEK_SET +L_INCR SEEK_CUR +L_XTND SEEK_END +.TE +.PP +ÊÖ¤êÃͤη¿¤Ï¡¢SVr1-3 ¤Ç¤Ï \fIoff_t\fP ¤Ç¤Ï¤Ê¤¯ \fIlong\fP ¤Ç¤¢¤ê¡¢ +BSD ¤Ç¤Ï \fIint\fP ¤Ç¤¢¤ë¡£ +.PP +.BR dup (2) +¤ä +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¸½ºß¤Î¥Õ¥¡¥¤¥ë°ÌÃ֥ݥ¤¥ó¥¿ +(current file position pointer) ¤ò¶¦Í­¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ +¤³¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¤Ç°ÜÆ°¤ò¹Ô¤¦¤È¶¥¹ç¾õÂÖ¤ò°ú¤­µ¯¤³¤¹²ÄǽÀ­¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR dup (2), +.BR fork (2), +.BR open (2), +.BR fseek (3), +.BR lseek64 (3), +.BR posix_fallocate (3) diff --git a/release/man2/madvise.2 b/release/man2/madvise.2 new file mode 100644 index 00000000..eb12d21f --- /dev/null +++ b/release/man2/madvise.2 @@ -0,0 +1,239 @@ +.\" 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" +.SH ̾Á° +madvise \- ¥á¥â¥êÍøÍѤ˴ؤ¹¤ë¥¢¥É¥Ð¥¤¥¹¤òÍ¿¤¨¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int madvise(void *" addr ", size_t " length ", int " advice ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR madvise (): +_BSD_SOURCE +.SH ÀâÌÀ +.BR madvise () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¥¢¥É¥ì¥¹ +.I addr +¤«¤é¤Ï¤¸¤Þ¤ë +.I length +¥Ð¥¤¥È¤Î¥á¥â¥ê¥Ö¥í¥Ã¥¯¤Î¥Ú¡¼¥¸¥ó¥°Æþ½ÐÎϤò¤É¤¦°·¤¨¤ÐÎɤ¤¤«¡¢ +¥«¡¼¥Í¥ë¤Ë¥¢¥É¥Ð¥¤¥¹¤¹¤ë¡£ +¤³¤ì¤òÍѤ¤¤ë¤È¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é¥«¡¼¥Í¥ë¤Ë¡¢ +¥Þ¥Ã¥×¤µ¤ì¤¿¥á¥â¥ê¤ä¶¦Í­¥á¥â¥ê¤ò¤É¤Î¤è¤¦¤Ë°·¤Ã¤Æ¤Û¤·¤¤¤«ÅÁ¤¨¤ë¤³¤È¤¬¤Ç¤­¡¢ +¥«¡¼¥Í¥ë¤Ï¤½¤ì¤Ë±þ¤¸¤ÆÀèÆɤߤ䥭¥ã¥Ã¥·¥å¤Ê¤É¤ÎŬÀڤʼêË¡¤òÁªÂò¤Ç¤­¤ë¡£ +¤³¤Î¥³¡¼¥ë¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÆ°ºî¤½¤Î¤â¤Î¤Ë¤Ï±Æ¶Á¤·¤Ê¤¤ +.RB ( MADV_DONTNEED +¤Î¾ì¹ç¤ÏÊÌ) ¤¬¡¢ +À­Ç½¤Ë¤Ï±Æ¶Á¤·¤¦¤ë¡£ +¤Ê¤ª¤³¤Î¥¢¥É¥Ð¥¤¥¹¤ò¼õ¤±Æþ¤ì¤ë¤«¤É¤¦¤«¤Ï¥«¡¼¥Í¥ë¤ËǤ¤µ¤ì¤ë¡£ +.LP +¥¢¥É¥Ð¥¤¥¹¤Ï°ú¤­¿ô +.I advice +¤Ë¤è¤Ã¤ÆÍ¿¤¨¤ë¡£°Ê²¼¤Î¤¤¤º¤ì¤«¤ò»ØÄê¤Ç¤­¤ë¡£ +.TP +.B MADV_NORMAL +ÆÃÊ̤ʰ·¤¤¤Ï¹Ô¤ï¤Ê¤¤¡£¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤Ç¤¢¤ë¡£ +.TP +.B MADV_RANDOM +¥Ú¡¼¥¸»²¾È¤Ï¥é¥ó¥À¥à¤Ê½ç½ø¤Ç¹Ô¤ï¤ì¤½¤¦¤À¡£ +(¤·¤¿¤¬¤Ã¤Æ¡¢ÀèÆɤߤϤ¢¤Þ¤ê¸ú²Ì¤¬¤Ê¤µ¤½¤¦¤À¡£) +.TP +.B MADV_SEQUENTIAL +¥Ú¡¼¥¸»²¾È¤Ï¥·¡¼¥±¥ó¥·¥ã¥ë¤Ê½ç½ø¤Ç¹Ô¤ï¤ì¤½¤¦¤À¡£ +(¤·¤¿¤¬¤Ã¤ÆÍ¿¤¨¤¿ÈϰϤΥڡ¼¥¸¤ÏÀѶËŪ¤ËÀèÆɤߤ·¤Æ¤ª¤¯¤ÈÎɤ¤¤À¤í¤¦¡£ +¤Þ¤¿¥¢¥¯¥»¥¹¤¬½ª¤ï¤Ã¤¿¤é®¤ä¤«¤Ë²òÊü¤·¤ÆÎɤ¤¡£) +.TP +.B MADV_WILLNEED +¶á¤¤¾­Íè¤Ë¥¢¥¯¥»¥¹¤µ¤ì¤½¤¦¤À¡£ +(¤·¤¿¤¬¤Ã¤Æ¤³¤ì¤é¤Î¥Ú¡¼¥¸¤òº£¤Î¤¦¤Á¤ËÀèÆɤߤ·¤Æ¤ª¤¯¤È¤¤¤¤¤À¤í¤¦¡£) +.TP +.B MADV_DONTNEED +¤·¤Ð¤é¤¯¥¢¥¯¥»¥¹¤Ï¤Ê¤µ¤½¤¦¤À¡£ +(¸½»þÅÀ¤Ç¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÏÍ¿¤¨¤¿ÈϰϤνèÍý¤ò½ª¤¨¤Æ¤¤¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¥«¡¼¥Í¥ë¤Ï¤³¤ì¤Ë´ØÏ¢¤¹¤ë¥ê¥½¡¼¥¹¤ò²òÊü¤·¤ÆÎɤ¤¡£) +¤³¤ì°Ê¹ß¤³¤ÎÈϰϤΥڡ¼¥¸¤Ø¤Î¥¢¥¯¥»¥¹¤¬¤¢¤ë¤È¡¢ +À®¸ù¤Ï¤¹¤ë¤¬¡¢¥á¥â¥ê¤ÎÆâÍƤò¥Þ¥Ã¥×¸µ¤Î¥Õ¥¡¥¤¥ë¤«¤é¥í¡¼¥É¤·Ä¾¤¹¤³¤È¤Ë¤Ê¤ë +.RB ( mmap (2) +¤ò¸«¤è) ¤«¡¢ +¤Þ¤¿¤Ï¸µ¥Õ¥¡¥¤¥ë¤¬¤Ê¤¤¥Þ¥Ã¥×¥Ú¡¼¥¸¤Ç¤Ï +¥¢¥¯¥»¥¹¤¬¤¢¤Ã¤¿¤È¤­¤Ë 0 Ëä¤á¤¬¹Ô¤ï¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.TP +.BR MADV_REMOVE " (Linux 2.6.16 °Ê¹ß)" +»ØÄꤵ¤ì¤¿ÈϰϤΥڡ¼¥¸¤È´ØÏ¢¤¹¤ë¥Ð¥Ã¥­¥ó¥°¥¹¥È¥¢¤ò²òÊü¤¹¤ë¡£ +¸½ºß¤Î¤È¤³¤í¡¢ +.\" 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 +.BR MADV_DONTFORK " (Linux 2.6.16 °Ê¹ß)" +.\" See http://lwn.net/Articles/171941/ +.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 +.BR MADV_DOFORK " (Linux 2.6.16 °Ê¹ß)" +.B MADV_DONTFORK +¤Î±Æ¶Á¤ò¼è¤ê¾Ã¤·¡¢¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤ËÌ᤹¡£ +¤Ä¤Þ¤ê¡¢ +.BR fork (2) +¤ÎÁ°¸å¤Ç¥Þ¥Ã¥Ô¥ó¥°¤Ï·Ñ¾µ¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR madvise () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤ë¤È \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ÊÃͤËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +²¿¤é¤«¤Î¥«¡¼¥Í¥ë¥ê¥½¡¼¥¹¤¬°ì»þŪ¤ËÍøÍѤǤ­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EBADF +»ØÄꤷ¤¿¥Þ¥Ã¥×¤Ï¸ºß¤¹¤ë¤¬¡¢¥Õ¥¡¥¤¥ë¤Ç¤Ï¤Ê¤¤¤È¤³¤í¤ò¥Þ¥Ã¥×¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.\" .I len +.\" is zero, +.I len +¤ÎÃͤ¬Éé¡¢ +.I addr +¤¬¥Ú¡¼¥¸¶­³¦¤Ç¤Ê¤¤¡¢ +.I advice +¤¬Àµ¤·¤¤ÃͤǤʤ¤¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¥í¥Ã¥¯¤µ¤ì¤¿¥Ú¡¼¥¸¤ä¶¦Í­¥Ú¡¼¥¸¤ò +.RB ( MADV_DONTNEED +¤Ç) ²òÊü¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¡¢¤Ê¤É¡£ +.TP +.B EIO +.RB ( MADV_WILLNEED +¤Î¾ì¹ç) ¤³¤ÎÈϰϤΥڡ¼¥¸¥ó¥°¤ò¹Ô¤¦¤È¡¢ +¥×¥í¥»¥¹¤Î RSS (resident set size) ¤ÎºÇÂçÃͤò±Û¤¨¤Æ¤·¤Þ¤¦¡£ +.\"nakano RSS ¤ÏÌõ¸ì¤¬¤¢¤ê¤Þ¤·¤¿¤Ã¤±? +.TP +.B ENOMEM +.RB ( MADV_WILLNEED +¤Î¾ì¹ç) ¥á¥â¥ê¤¬Â­¤ê¤º¡¢¥Ú¡¼¥¸¥ó¥°¤Ë¼ºÇÔ¤·¤¿¡£ +.TP +.B ENOMEM +»ØÄꤷ¤¿ÈϰϤΥ¢¥É¥ì¥¹¤¬¡¢¸½ºß¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤¢¤ë¤¤¤Ï¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ÎÆâÉô¤Ë¤Ê¤¤¡£ +.SH ½àµò +POSIX.1b. +POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR posix_madvise (3) +.\" FIXME . Write a posix_fadvise(3) page. +¤ò +.B POSIX_MADV_NORMAL +¤Ê¤É¤ÎÄê¿ô¤È¤È¤â¤Ëµ­½Ò¤·¤Æ¤¤¤¿ +(¤½¤ì¤¾¤ì¤Î¿¶¤ëÉñ¤¤¤Ï¤³¤³¤Ç½Ò¤Ù¤¿¤â¤Î¤Ë¶á¤¤)¡£ +¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹¤ËÂФ·¤Æ¤â +.BR posix_fadvise (2) +¤È¤¤¤¦Îà»÷¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ + +.BR MADV_REMOVE , +.BR MADV_DONTFORK , +.B MADV_DOFORK +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.SS "Linux ¤Ç¤ÎÃí°Õ" +¸½ºß¤Î Linux ¤Î¼ÂÁõ (2.4.0) ¤Ç¤Ï¡¢ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¥¢¥É¥Ð¥¤¥¹¤È¤¤¤¦¤è¤ê¤ÏÌ¿Îá¤È¸«¤Æ¤¤¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¤³¤Î¥¢¥É¥Ð¥¤¥¹¤ËÂФ·¤ÆÄ̾ï¹Ô¤ï¤ì¤ëÆ°ºî¤¬ÉÔ²Äǽ¤Ê¾ì¹ç¤Ï¡¢ +¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤¬¤¢¤ë (¾åµ­¤Î ¥¨¥é¡¼ ¤Îµ­½Ò¤ò»²¾È)¡£ +¤³¤Î¿¶Éñ¤¤¤Ïɸ½à¤È¤Ï°Û¤Ê¤ë¡£ +.LP +Linux ¤Î¼ÂÁõ¤Ç¤Ï +.I addr +¤Î¥¢¥É¥ì¥¹¤Ï¥Ú¡¼¥¸¶­³¦¤ÎÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤Þ¤¿ +.I length +¤Ï 0 ¤Ç¤¢¤Ã¤Æ¤â¹½¤ï¤Ê¤¤¡£ +¤Þ¤¿ Linux ÈǤΠ+.BR madvise () +¤Ç¤Ï¡¢»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹ÈϰϤ˥ޥåפµ¤ì¤Æ¤¤¤Ê¤¤Éôʬ¤¬¤¢¤ë¤È¡¢ +¤³¤ì¤é¤ò̵»ë¤·¤Æ»Ä¤ê¤ÎÉôʬ¤Ë¥¢¥É¥Ð¥¤¥¹¤òŬÍѤ¹¤ë +(¤·¤«¤·¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ·¤Æ¤Ï¤Á¤ã¤ó¤È +.B ENOMEM +¤òÊÖ¤¹)¡£ +.\" .SH Îò»Ë +.\" .BR madvise () +.\" ´Ø¿ô¤Ï 4.4BSD ¤ÇºÇ½é¤ËÅо줷¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getrlimit (2), +.BR mincore (2), +.BR mmap (2), +.BR mprotect (2), +.BR msync (2), +.BR munmap (2) diff --git a/release/man2/mbind.2 b/release/man2/mbind.2 new file mode 100644 index 00000000..e065940d --- /dev/null +++ b/release/man2/mbind.2 @@ -0,0 +1,448 @@ +.\" Copyright 2003,2004 Andi Kleen, SuSE Labs. +.\" and Copyright 2007 Lee Schermerhorn, Hewlett Packard +.\" +.\" 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. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\" 2006-02-03, mtk, substantial wording changes and other improvements +.\" 2007-08-27, Lee Schermerhorn +.\" more precise specification of behavior. +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2006-07-25, Akihiro MOTOKI , LDP v2.36 +.\" Updated 2008-08-21, Akihiro MOTOKI, LDP v3.07 +.\" Updated 2008-09-19, Akihiro MOTOKI, LDP v3.08 +.\" +.TH MBIND 2 2008-08-15 Linux "Linux Programmer's Manual" +.SH ̾Á° +mbind \- ¥á¥â¥êÎΰè¤ËÂФ·¤Æ¥á¥â¥ê¥Ý¥ê¥·¡¼¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int mbind(void *" addr ", unsigned long " len ", int " mode , +.BI " unsigned long *" nodemask ", unsigned long " maxnode , +.BI " unsigned " flags ); +.sp +\fI\-lnuma\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.SH ÀâÌÀ +.BR mbind () +¤Ï¡¢ +.I addr +¤«¤é»Ï¤Þ¤ëŤµ +.I len +¥Ð¥¤¥È¤ÎÈϰϤΥá¥â¥ê¤Ë NUMA ¥á¥â¥ê¥Ý¥ê¥·¡¼¤òÀßÄꤹ¤ë¡£ +NUMA ¥Ý¥ê¥·¡¼¤Ï¥Ý¥ê¥·¡¼¥â¡¼¥É¤È 0 ¸Ä°Ê¾å¤Î¥Î¡¼¥É¤«¤é¹½À®¤µ¤ì¤ë¡£ +¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï¤É¤Î¥Î¡¼¥É¤«¤é¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤ë¤«¤ò·èÄꤹ¤ë¡£ + +.I addr +¤È +.I len +¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥êÈϰϤˡ¢ +¥á¥â¥ê¤Î¡Ö̵̾¡×Îΰè \(em +.B MAP_ANONYMOUS +ÉÕ¤­¤Î +.BR mmap (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥á¥â¥êÎΰè \(em ¤ä +.B MAP_PRIVATE +ÉÕ¤­¤Î +.BR mmap (2) +¤ò»È¤Ã¤Æ¥Þ¥Ã¥×¤µ¤ì¤¿¥á¥â¥ê¥Þ¥Ã¥×¡¦¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¥Ú¡¼¥¸¤¬»ØÄꤵ¤ì¤¿¥Ý¥ê¥·¡¼¤Ë´ð¤Å¤¤¤Æ³ä¤êÅö¤Æ¤é¤ì¤ë¤Î¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó +¤¬¤½¤Î¥Ú¡¼¥¸¤Ø¤Î½ñ¤­¹þ¤ß (¥Ç¡¼¥¿¤Î³ÊǼ) ¤ò¹Ô¤Ã¤¿»þ¤À¤±¤Ç¤¢¤ë¡£ +̵̾Îΰè¤Î¾ì¹ç¡¢ºÇ½é¤ÎÆɤ߽Ф·¥¢¥¯¥»¥¹¤ÎºÝ¤Ë¤Ï +¥«¡¼¥Í¥ëÆâ¤ÎÁ´¥Ç¡¼¥¿¤¬ 0 ¤Ç¤¢¤ë¶¦Í­¥Ú¡¼¥¸¤¬»ÈÍѤµ¤ì¤ë¡£ +.B MAP_PRIVATE +¤Ç¥Þ¥Ã¥×¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¢ºÇ½é¤ÎÆɤ߽Ф·¥¢¥¯¥»¥¹¤¬¤¢¤ë¤È¡¢ +¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬È¯À¸¤¹¤ë¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼ +¤Ë¤·¤¿¤¬¤Ã¤Æ¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£ +¥Ú¡¼¥¸³ä¤êÅö¤Æ¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¥×¥í¥»¥¹¤Ï¡¢ +.BR mbind () +¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ÈƱ¤¸¤È¤Ï¸Â¤é¤Ê¤¤¡£ + +»ØÄꤵ¤ì¤¿¥á¥â¥êÈÏ°ÏÆâ¤Ë¤¢¤ë +.B MAP_SHARED +¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ç¤Ï»ØÄꤵ¤ì¤¿¥Ý¥ê¥·¡¼¤Ï̵»ë¤µ¤ì¡¢ +¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬È¯À¸¤¹¤ë¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ë +¤·¤¿¤¬¤Ã¤Æ¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +·«¤êÊÖ¤·¤Ë¤Ê¤ë¤¬¡¢¥Ú¡¼¥¸³ä¤êÅö¤Æ¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¥×¥í¥»¥¹¤Ï¡¢ +.BR mbind () +¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ÈƱ¤¸¤È¤Ï¸Â¤é¤Ê¤¤¡£ + +»ØÄꤵ¤ì¤¿¥á¥â¥êÈϰϤˡ¢ +.BR shmget (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿¤ê¡¢ +.BR shmat (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤ÆÉղà (attach) ¤µ¤ì¤¿¤ê¤·¤¿¶¦Í­¥á¥â¥êÎΰ褬 +´Þ¤Þ¤ì¤ë¾ì¹ç¡¢ÌµÌ¾¥á¥â¥êÎΰè¤ä¶¦Í­¥á¥â¥êÎΰè¤ËÂФ¹¤ë¥Ú¡¼¥¸³ä¤êÅö¤Æ¤Ï¡¢ +¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤Ø¥Ý¥ê¥·¡¼¤ÎÀßÄê¤ò¹Ô¤Ã¤¿¥×¥í¥»¥¹¤¬¥Ú¡¼¥¸³ä¤êÅö¤Æ +¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¤«¤Ë´Ø¤ï¤é¤º¡¢»ØÄꤵ¤ì¤¿¥Ý¥ê¥·¡¼¤Ë¤·¤¿¤¬¤Ã¤Æ³ä¤êÅö¤Æ +¤¬¹Ô¤ï¤ì¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¶¦Í­¥á¥â¥êÎΰ褬 +.B SHM_HUGETLB +¥Õ¥é¥°¤ò»ØÄꤷ¤ÆºîÀ®¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢¥Ò¥å¡¼¥¸¥Ú¡¼¥¸ (huge page) ¤Î³ä¤êÅö¤Æ¤¬ +»ØÄꤵ¤ì¤¿¥Ý¥ê¥·¡¼¤Ë¤·¤¿¤¬¤Ã¤Æ¹Ô¤ï¤ì¤ë¤Î¤Ï¡¢¤½¤ÎÎΰè¤ËÂФ·¤Æ +.BR mbind () +¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬¥Ú¡¼¥¸³ä¤êÅö¤Æ¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¾ì¹ç¤Î¤ß¤Ç¤¢¤ë¡£ + +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR mbind () +¤Ï¿·µ¬¤Î¥á¥â¥ê³ä¤êÅö¤Æ¤ËÂФ·¤Æ¤Î¤ß¸ú²Ì¤ò»ý¤Ä¡£ +¥Ý¥ê¥·¡¼¤¬ÀßÄꤵ¤ì¤ëÁ°¤Ë¤¹¤Ç¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ëÈÏ°ÏÆâ¤Î¥Ú¡¼¥¸¤ËÂФ·¤Æ¤Ï¡¢ +¥Ý¥ê¥·¡¼¤Ï±Æ¶Á¤·¤Ê¤¤¡£ +¤³¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ë¥Õ¥é¥° +.B MPOL_MF_MOVE +¤ä +.B MPOL_MF_MOVE_ALL +¤Ë¤è¤ê¾å½ñ¤­¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ + +.I mode +°ú¤­¿ô¤Ë¤Ï¡¢ +.BR MPOL_DEFAULT , +.BR MPOL_BIND , +.BR MPOL_INTERLEAVE , +.B MPOL_PREFERRED +¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B MPOL_DEFAULT +°Ê³°¤Î¥Ý¥ê¥·¡¼¥â¡¼¥É¤Î¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï +.I nodemask +°ú¤­¿ô¤Ç¤½¤Î¥Ý¥ê¥·¡¼¥â¡¼¥É¤òŬÍѤ¹¤ë¥Î¡¼¥É¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ + +.I mode +°ú¤­¿ô¤Ë¤Ï¡¢ÄÉ²Ã¤Ç +.I "¥â¡¼¥É¥Õ¥é¥°" +¤ò´Þ¤á¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë +.I "¥â¡¼¥É¥Õ¥é¥°" +¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.TP +.BR MPOL_F_STATIC_NODES " (Linux-2.6.26 °Ê¹ß)" +¶õ¤Ç¤Ê¤¤ +.I nodemask +¤Ï¡¢ÊªÍý¥Î¡¼¥É ID ¤Ç¤¢¤ë¡£ +Linux ¤Ç¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬°Û¤Ê¤ë CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È (cpuset context) +¤Ë°ÜÆ°¤·¤¿¾ì¹ç¤Ç¤â¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç +µö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É½¸¹ç¤¬ÊѲ½¤·¤¿¾ì¹ç¤Ç¤â¡¢ +.I nodemask +¤ò¥Þ¥Ã¥Ô¥ó¥°¤·Ä¾¤¹¤³¤È¤Ï¤Ê¤¤¡£ +.TP +.BR MPOL_F_RELATIVE_NODES " (Linux-2.6.26 °Ê¹ß)" +¶õ¤Ç¤Ê¤¤ +.I nodemask +¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¤Çµö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É ID ½¸¹ç +¤Ë¤ª¤±¤ëÁêÂÐŪ¤Ê¥Î¡¼¥É ID ¤Ç¤¢¤ë¡£ +.PP +.I nodemask +¤Ï¡¢ºÇÂç¤Ç +.I maxnode +¥Ó¥Ã¥È¤«¤é¹½À®¤µ¤ì¤ë¥Î¡¼¥É¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤ò»Ø¤¹¡£ +¥Ó¥Ã¥È¥Þ¥¹¥¯¤ÎÂ礭¤µ¤Ï¡¢Ä¾¶á¤Î +.I sizeof(unsigned long) +¤ÎÇÜ¿ô¤ËÀÚ¤ê¾å¤²¤é¤ì¤ë¤¬¡¢¥«¡¼¥Í¥ë¤¬»ÈÍѤ¹¤ë¤Î¤Ï +.I maxnode +¸Ä¤Þ¤Ç¤Î¥Ó¥Ã¥È¤À¤±¤Ç¤¢¤ë¡£ +NULL ÃͤΠ+.I nodemask +¤â¤·¤¯¤ÏÃͤ¬ 0 ¤Î +.I maxnode +¤Ï¥Î¡¼¥É¤Î¶õ½¸¹ç¤òɽ¤¹¡£ +.I maxnode +¤ÎÃͤ¬ 0 ¤Î¾ì¹ç¡¢ +.I nodemask +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.I nodemask +¤¬É¬¿Ü¤Î¾ìÌ̤Ǥϡ¢ +.I nodemask +¤Ë¡¢¥ª¥ó¥é¥¤¥ó¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç +µö²Ä¤µ¤ì¤Æ¤ª¤ê +.RB ( MPOL_F_STATIC_NODES +¥â¡¼¥É¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢¥á¥â¥ê¤¬¤¢¤ë¥Î¡¼¥É¤¬ +¾¯¤Ê¤¯¤È¤â°ì¤ÄÆþ¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +¥â¡¼¥É +.B MPOL_DEFAULT +¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¤Ê¤¤¥×¥í¥»¥¹¤Î¥á¥â¥ê¥Ý¥ê¥·¡¼¤òºï½ü¤·¡¢ +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤ËÌ᤹¤³¤È¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.BR mbind () +·Ðͳ¤Ç¡¢¤¢¤ë¥á¥â¥êÎΰè¤ËÂФ·¤Æ +.B MPOL_DEFAULT +¤¬Å¬ÍѤµ¤ì¤¿¾ì¹ç¡¢¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤ò»ÈÍѤ¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ï¡¢ +.BR set_mempolicy (2) +¤ÇÊѹ¹¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¥×¥í¥»¥¹¤Î¥Ý¥ê¥·¡¼¤Î¥â¡¼¥É¤â +.B MPOL_DEFAULT +¤Î¾ì¹ç¡¢¥·¥¹¥Æ¥àÁ´ÂΤΥǥե©¥ë¥È¥Ý¥ê¥·¡¼¤¬»ÈÍѤµ¤ì¤ë¡£ +¥·¥¹¥Æ¥àÁ´ÂΤΥǥե©¥ë¥È¥Ý¥ê¥·¡¼¤Ç¤Ï¡¢³ä¤êÅö¤Æ¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿ +CPU ¤Î¥Î¡¼¥É¤«¤é¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤ò¹Ô¤¦¡£ +.B MPOL_DEFAULT +¤Ç¤Ï¡¢°ú¤­¿ô +.I nodemask +¤È +.I maxnode +¤Ë¥Î¡¼¥É¤Î¶õ½¸¹ç¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.B MPOL_BIND +¤Ï¸·¤·¤¤¥Ý¥ê¥·¡¼¤Ç¡¢¥á¥â¥ê³ä¤êÅö¤Æ¤Ï +.I nodemask +¤Ë»ØÄꤵ¤ì¤¿¥Î¡¼¥É¤Ë¸ÂÄꤵ¤ì¤ë¡£ +¾¤Î¥Î¡¼¥É¤Ø¤Î³ä¤êÅö¤Æ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +.I nodemask +¤Ë 2 ¸Ä°Ê¾å¤Î¥Î¡¼¥É¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ï +¥Î¡¼¥É ID ¤¬¿ô»ú¤È¤·¤ÆºÇ¾®¤Î¥Î¡¼¥É¤«¤é³«»Ï¤µ¤ì¡¢ +¤½¤Î¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç¤½¤Î¥Î¡¼¥É¤«¤é +¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£¤½¤Î¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤Ã¤¿¤é¡¢ +.\"motoki: the next highest ¤Ï the next lowest ¤Î´Ö°ã¤¤¡© +¼¡¤Ë¾®¤µ¤Ê¥Î¡¼¥É ID ¤ò»ý¤Ä¥Î¡¼¥É¤«¤é¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£ +¤³¤ì¤ò¡¢ +.I nodemask +¤Ç»ØÄꤵ¤ì¤¿Á´¤Æ¤Î¥Î¡¼¥É¤Ç¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç·«¤êÊÖ¤¹¡£ +.I nodemask +¤Ç»ØÄꤵ¤ì¤¿°Ê³°¤Î¥Î¡¼¥É¤«¤é¤Ï¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ + +.B MPOL_INTERLEAVE +¤Ï¡¢¥á¥â¥ê³ä¤êÅö¤Æ¤¬ +.I nodemask +¤Ë»ØÄꤵ¤ì¤¿¥Î¡¼¥É´Ö¤Ç¸ò¸ß¤Ë¹Ô¤ï¤ì¤ë¤³¤È¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥Ý¥ê¥·¡¼¤Ç¤Ï¡¢Ê£¿ô¤Î¥Î¡¼¥É¤Ë¥Ú¡¼¥¸¤ò¹­¤²¤ÆÇÛÃÖ¤·¡¢¤³¤ì¤é¤Î¥Ú¡¼¥¸¤Ø¤Î +¥á¥â¥ê¥¢¥¯¥»¥¹¤òʬ»¶¤¹¤ë¤³¤È¤Ç¡¢ÃÙ±ä¤Ç¤Ï¤Ê¤¯¡¢ÂÓ°è¤òºÇŬ²½¤¹¤ë¡£ +¸ú²Ì¤òÆÀ¤ë¤Ë¤Ï¡¢¥á¥â¥êÎΰè¤ò¤¢¤ëÄøÅÙÂ礭¤¯¤¹¤Ù¤­¤Ç¤¢¤ê¡¢ +¥á¥â¥ê¥¢¥¯¥»¥¹¤Î¥Ñ¥¿¡¼¥ó¤¬¤«¤Ê¤ê¶Ñ°ì¤Ê¾ì¹ç¤Ç¤â +¾¯¤Ê¤¯¤È¤â 1MB °Ê¾å¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤Î¥â¡¼¥É¤Ç¤â¡¢°ì¤Ä¤Î¥Ú¡¼¥¸¤Ø¤Î¥¢¥¯¥»¥¹¤Ë´Ø¤·¤Æ¤Ï +°ì¤Ä¤Î¥Î¡¼¥É¤Î¥á¥â¥êÂӰ褬¾å¸Â¤È¤Ê¤ë¤³¤È¤ÏÊѤï¤ê¤Ê¤¤¡£ + +.B MPOL_PREFERRED +¤Ï¡¢³ä¤êÅö¤Æ»þ¤ËÍ¥À褵¤ì¤ë¥Î¡¼¥É¤òÀßÄꤹ¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¤Þ¤ºÍ¥Àè¥Î¡¼¥É¤Ë¥Ú¡¼¥¸³ä¤êÅö¤Æ¤ò¹Ô¤ª¤¦¤È¤·¡¢ +Í¥Àè¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¾¯¤Ê¤¤¾ì¹ç¤Ë¾¤Î¥Î¡¼¥É¤Ë³ä¤êÅö¤Æ¤ò¹Ô¤¦¡£ +.I nodemask +¤ËÊ£¿ô¤Î¥Î¡¼¥É ID ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +.I nodemask +Æâ¤ÎºÇ½é¤Î¥Î¡¼¥É¤¬Í¥Àè¥Î¡¼¥É¤È¤·¤ÆÁªÂò¤µ¤ì¤ë¡£ +°ú¤­¿ô +.IR nodemask , +.I maxnode +¤Ç¶õ½¸¹ç¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢³ä¤êÅö¤Æ¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿ CPU ¤Î¥Î¡¼¥É¤Ë +¥á¥â¥ê³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£ +.BR mbind (2) +¤Ç¡¢¤¢¤ë¥á¥â¥êÎΰè¤ËÂФ·¤Æ¡Ö¥í¡¼¥«¥ë¤«¤é¤Î³ä¤êÅö¤Æ (local allocation)¡×¤ò +»ØÄꤹ¤ëÊýË¡¤Ï¤³¤ì¤·¤«¤Ê¤¤¡£ + +.I flags +¤Ë +.B MPOL_MF_STRICT +¤¬ +»ØÄꤵ¤ì¡¢ +.I policy +¤¬ +.B MPOL_DEFAULT +¤Ç¤Ê¤¤¾ì¹ç¡¢ +»ØÄꤵ¤ì¤¿¥Ý¥ê¥·¡¼¤Ë½¾¤Ã¤Æ¤¤¤Ê¤¤¥á¥â¥êÎΰè¤Ë¥Ú¡¼¥¸¤¬Â¸ºß¤¹¤ë¤È¡¢ +.BR mbind () +¤Ï¥¨¥é¡¼ +.B EIO +¤Ç¼ºÇÔ¤¹¤ë¡£ +.\" According to the kernel code, the following is not true +.\" --Lee Schermerhorn +.\" .\"O In 2.6.16 or later the kernel will also try to move pages +.\" .\"O to the requested node with this flag. +.\" 2.6.16 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Î¥Õ¥é¥°¤ÇÍ׵ᤵ¤ì¤¿¥Î¡¼¥É¤Ë +.\" ¥Ú¡¼¥¸¤ò°ÜÆ°¤·¤è¤¦¤È¤¹¤ë¡£ + +.I flags +¤Ë +.B MPOL_MF_MOVE +¤¬»ØÄꤵ¤ì¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï¤½¤Î¥á¥â¥êÎΰèÆâ¤Î´û¸¤ÎÁ´¤Æ¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤·¡¢ +»ØÄꤵ¤ì¤¿¥Ý¥ê¥·¡¼¤Ë½¾¤¦¤è¤¦¤Ë¤·¤è¤¦¤È¤¹¤ë¡£ +¾¤Î¥×¥í¥»¥¹¤È¶¦Í­¤µ¤ì¤Æ¤¤¤ë¥Ú¡¼¥¸¤Ï°ÜÆ°¤µ¤ì¤Ê¤¤¡£ +.B MPOL_MF_STRICT +¤â»ØÄꤵ¤ì¤¿¾ì¹ç¡¢°ÜÆ°¤Ç¤­¤Ê¤«¤Ã¤¿¥Ú¡¼¥¸¤¬¤¢¤ë¤È¡¢ +.BR mbind () +¤Ï¥¨¥é¡¼ +.B EIO +¤Ç¼ºÇÔ¤¹¤ë¡£ + +.I flags +¤Ë +.B MPOL_MF_MOVE_ALL +¤¬»ØÄꤵ¤ì¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï¤½¤Î¥á¥â¥êÎΰèÆâ¤Î´û¸¤ÎÁ´¤Æ¤Î¥Ú¡¼¥¸¤ò¡¢ +¾¤Î¥×¥í¥»¥¹¤¬¥Ú¡¼¥¸¤ò»ÈÍѤ·¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ë´Ø¤ï¤é¤º°ÜÆ°¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÏÆø¢ +.RB ( CAP_SYS_NICE ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B MPOL_MF_STRICT +¤â»ØÄꤵ¤ì¤¿¾ì¹ç¡¢°ÜÆ°¤Ç¤­¤Ê¤«¤Ã¤¿¥Ú¡¼¥¸¤¬¤¢¤ë¤È¡¢ +.BR mbind () +¤Ï¥¨¥é¡¼ +.B EIO +¤Ç¼ºÇÔ¤¹¤ë¡£ +.\" --------------------------------------------------------------- +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR mbind () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.\" --------------------------------------------------------------- +.SH ¥¨¥é¡¼ +.\" I think I got all of the error returns. --Lee Schermerhorn +.TP +.B EFAULT +.I nodemask +¤È +.I maxnode +¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥êÎΰè¤Î°ìÉô¤Þ¤¿¤ÏÁ´Éô¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +¤â¤·¤¯¤Ï»ØÄꤵ¤ì¤¿¥á¥â¥êÎΰè¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Ê¤¤Éôʬ (unmapped hole) +¤¬¤¢¤Ã¤¿¡¢ +.TP +.B EINVAL +.I flags +¤ä +.I mode +¤ËÉÔÀµ¤ÊÃͤ¬»ØÄꤵ¤ì¤¿¡£ +.I addr + len +¤¬ +.I addr +¤è¤ê¾®¤µ¤¤¡£ +.I addr +¤¬¥·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¤Ï +.I mode +¤¬ +.B MPOL_DEFAULT +¤Ç +.I nodemask +¤Ë¶õ¤Ç¤Ê¤¤½¸¹ç¤¬»ØÄꤵ¤ì¤¿¡£ +.I mode +¤¬ +.B MPOL_BIND +¤« +.B MPOL_INTERLEAVE +¤Ç +.I nodemask +¤¬¶õ¤Ç¤¢¤Ã¤¿¡£ +.I maxnode +¤¬¥«¡¼¥Í¥ë¤ËŬÍѤµ¤ì¤¿¾å¸Â¤òĶ¤¨¤Æ¤¤¤ë¡£ +.\" As at 2.6.23, this limit is "a page worth of bits", e.g., +.\" 8 * 4096 bits, assuming a 4kB page size. +.I nodemask +¤Ë¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëºÇÂç¥Î¡¼¥É ID ¤è¤êÂ礭¤¤¥Î¡¼¥É¤¬»ØÄꤵ¤ì¤¿¡£ +.I nodemask +¤Ë¡¢¥ª¥ó¥é¥¤¥ó¤Ç¡¢¤«¤Ä¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç +µö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤¬°ì¤Ä¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +¥á¥â¥ê¤ò´Þ¤à¥Î¡¼¥É¤¬°ì¤Ä¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.I mode +°ú¤­¿ô¤Ë +.B MPOL_F_STATIC_NODES +¤È +.B MPOL_F_RELATIVE_NODES +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B EIO +.B MPOL_MF_STRICT +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¤³¤Î¥Ý¥ê¥·¡¼¤Ë½¾¤Ã¤Æ¤¤¤Ê¤¤¥Î¡¼¥É¤Ë +¤¹¤Ç¤Ë¥Ú¡¼¥¸¤¬Â¸ºß¤·¤Æ¤¤¤¿¡£ +¤â¤·¤¯¤Ï +.B MPOL_MF_MOVE +¤« +.B MPOL_MF_MOVE_ALL +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¥«¡¼¥Í¥ë¤¬»ØÄꤵ¤ì¤¿ÎΰèÆâ¤Î´û¸¤ÎÁ´¤Æ¤Î¥Ú¡¼¥¸¤ò +°ÜÆ°¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +ÍøÍѲÄǽ¤Ê¥«¡¼¥Í¥ë¥á¥â¥ê¤¬½½Ê¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPERM +.I flags +°ú¤­¿ô¤Ë +.B MPOL_MF_MOVE_ALL +¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¤¬ +.B CAP_SYS_NICE +Æø¢¤ò»ý¤¿¤Ê¤¤¡£ +.\" --------------------------------------------------------------- +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR mbind () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ð¡¼¥¸¥ç¥ó 2.6.7 ¤Ç Linux ¥«¡¼¥Í¥ë¤ËÄɲ䵤줿¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¥é¥¤¥Ö¥é¥ê¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR numa (7) +¤ò»²¾È¡£ + +NUMA ¥Ý¥ê¥·¡¼¤Ï¡¢ +.B MAP_SHARED +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¥Þ¥Ã¥×¤µ¤ì¤¿¥á¥â¥ê¥Þ¥Ã¥×¡¦¥Õ¥¡¥¤¥ë¤ÎÎΰè¤Ç¤Ï +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.B MPOL_DEFAULT +¥â¡¼¥É¤Ï¡¢ +.BR mbind () +¤È +.BR set_mempolicy (2) +¤Ç°Û¤Ê¤ë¸ú²Ì¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR set_mempolicy (2) +¤Ç +.B MPOL_DEFAULT +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥Ý¥ê¥·¡¼¤Ï¥·¥¹¥Æ¥à¤Î +¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¡¢¤¹¤Ê¤ï¤Á¥í¡¼¥«¥ë¤«¤é¤Î³ä¤êÅö¤Æ¡¢¤ËÌá¤ë¡£ +.BR mbind () +¤ò»È¤Ã¤Æ¥á¥â¥ê¤Î¤¢¤ëÎΰè¤Ë +.B MPOL_DEFAULT +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¤½¤ÎÈϰϤËÂФ·¤Æ¤½¤ì°Ê¹ß¤Ë¹Ô¤ï¤ì¤ë¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ç¤Ï¡¢ +.BR set_mempolicy (2) +¤ÇÀßÄꤷ¤¿¤Î¤ÈƱ¤¸¤è¤¦¤Ë¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥Ý¥ê¥·¡¼¤¬Å¬ÍѤµ¤ì¤ë¡£ +.\"0motoki: possibly nondefault policy ¤Ï default policy ¤Î´Ö°ã¤¤¡© +¤³¤ì¤Ë¤è¤ê¡¢ÆÃÄê¤Î¥á¥â¥êÎΰè¤Ë¤Ä¤¤¤Æ¤À¤±ÌÀ¼¨Åª¤Ê¥Ý¥ê¥·¡¼¤òºï½ü¤·¡¢ +¥Ç¥Õ¥©¥ë¥È¤Î¥Ý¥ê¥·¡¼¤Ë¡ÖÌ᤹¡×¤³¤È¤¬¤Ç¤­¤ë¡£ +¤¢¤ë¥á¥â¥êÎΰè¤ËÂФ·¤Æ¡Ö¥í¡¼¥«¥ë¤«¤é¤Î³ä¤êÅö¤Æ¡×¤òÌÀ¼¨Åª¤ËÀßÄꤹ¤ë¤Ë¤Ï¡¢ +.I mode +¤Ë +.B MPOL_PREFERRED +¤ò»ØÄꤷ¡¢ +.I nodemask +¤Ë¶õ½¸¹ç¤Î¥Î¡¼¥É¤ò»ØÄꤹ¤ì¤Ð¤è¤¤¡£ +¤³¤ÎÊýË¡¤Ï +.BR set_mempolicy (2) +¤Ç¤âÄÌÍѤ¹¤ë¡£ + +2.6.16 ¤Ç¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¡¦¥Ý¥ê¥·¡¼¤Ø¤ÎÂбþ¤¬Äɲ䵤줿¡£ +¥¤¥ó¥¿¡¼¥ê¡¼¥Ö¡¦¥Ý¥ê¥·¡¼¤¬¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ç¸ú²Ì¤ò»ý¤Ä¤Ë¤Ï¡¢ +¥Ý¥ê¥·¡¼¤¬Å¬ÍѤµ¤ì¤ë¥á¥â¥ê¤¬¿ô½½¥á¥¬¥Ð¥¤¥È°Ê¾å¤Ç¤¢¤ëɬÍפ¬¤¢¤ë¡£ + +.B MPOL_MF_STRICT +¤Ï¥Ò¥å¡¼¥¸¥Ú¡¼¥¸¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ç¤Ï̵»ë¤µ¤ì¤ë¡£ + +.B MPOL_MF_MOVE +¤È +.B MPOL_MF_MOVE_ALL +¤Ï Linux 2.6.16 °Ê¹ß¤Ç¤Î¤ßÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR get_mempolicy (2), +.BR getcpu (2), +.BR mmap (2), +.BR set_mempolicy (2), +.BR shmat (2), +.BR shmget (2), +.BR numa (3), +.BR cpuset (7), +.BR numa (7), +.BR numactl (8) diff --git a/release/man2/mincore.2 b/release/man2/mincore.2 new file mode 100644 index 00000000..c0cf4a7f --- /dev/null +++ b/release/man2/mincore.2 @@ -0,0 +1,179 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2001 Bert Hubert +.\" 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. +.\" +.\" Created Sun Jun 3 17:23:32 2001 by bert hubert +.\" Slightly adapted, following comments by Hugh Dickins, aeb, 2001-06-04. +.\" Modified, 20 May 2003, Michael Kerrisk +.\" Modified, 30 Apr 2004, Michael Kerrisk +.\" 2005-04-05 mtk, Fixed error descriptions +.\" 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 ºÇ²¼°Ì¥Ó¥Ã¥È +.\" +.TH MINCORE 2 2008-04-22 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mincore \- ¥Ú¡¼¥¸¤¬¥á¥â¥êÆâ¤Ë¤¢¤ë¤«¤É¤¦¤«¤òȽÄꤹ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int mincore(void *" addr ", size_t " length ", unsigned char *" vec ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR mincore (): +_BSD_SOURCE || _SVID_SOURCE +.SH ÀâÌÀ +.BR mincore () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î²¾ÁÛ¥á¥â¥ê¤Î¥Ú¡¼¥¸¤¬¥³¥¢ (RAM) Æâ¤Ë¸ºß¤·¡¢ +¥Ú¡¼¥¸»²¾È»þ¤Ë¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹ (¥Ú¡¼¥¸¡¦¥Õ¥©¡¼¥ë¥È) ¤òµ¯¤³¤µ¤Ê¤¤¤« +¤É¤¦¤«¤ò¼¨¤¹¥Ù¥¯¥È¥ë¤òÊÖ¤¹¡£¥«¡¼¥Í¥ë¤Ï¡¢¥¢¥É¥ì¥¹ +.I addr +¤«¤é»Ï¤Þ¤ë +.I length +¥Ð¥¤¥È¤ÎÈϰϤΥڡ¼¥¸¤Ë´Ø¤¹¤ë¸ºß¾ðÊó¤òÊÖ¤¹¡£ + +.I addr +°ú¤­¿ô¤Ï¥·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I length +°ú¤­¿ô¤Ï¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤¢¤ëɬÍפϤʤ¤¤¬¡¢ +¥Ú¡¼¥¸Á´ÂΤ˴ؤ¹¤ë¸ºß¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¤Î¤Ç¡¢»ö¼Â¾å +.I length +¤Ï¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤ËÀÚ¤ê¾å¤²¤é¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +¥Ú¡¼¥¸¥µ¥¤¥º +.RB ( PAGE_SIZE ) +¤Ï +.I sysconf(_SC_PAGESIZE) +¤ò»È¤Ã¤ÆÆþ¼ê¤Ç¤­¤ë¡£ + +.I vec +°ú¤­¿ô¤Ï¡¢¾¯¤Ê¤¯¤È¤â +.I "(length+PAGE_SIZE\-1) / PAGE_SIZE" +¥Ð¥¤¥È¤¬³ÊǼ¤Ç¤­¤ëÇÛÎó¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î¸Æ¤Ó½Ð¤·¤¬ÊÖ¤ë¤È¤­¡¢ +³Æ¥Ð¥¤¥È¤ÎºÇ²¼°Ì¥Ó¥Ã¥È¤Ï¡¢Âбþ¤¹¤ë¥Ú¡¼¥¸¤¬¥á¥â¥êÆâ¤Ë¤½¤Î¤È¤­Â¸ºß¤¹¤ì¤Ð +¥»¥Ã¥È¤µ¤ì¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï¥¯¥ê¥¢¤µ¤ì¤ë +(³Æ¥Ð¥¤¥È¤Î¤½¤Î¾¤Î¥Ó¥Ã¥È¤Ï̤ÄêµÁ¤Ç¤¢¤ê¡¢¤³¤ì¤é¤Î¥Ó¥Ã¥È¤Ï¾­Íè¤Î»ÈÍÑ¤Ë +¤½¤Ê¤¨¤ÆͽÌ󤵤ì¤Æ¤¤¤ë)¡£ +¤â¤Á¤í¤ó¡¢ +.I vec +¤ÇÊÖ¤µ¤ì¤¿¾ðÊó¤Ï¥¹¥Ê¥Ã¥×¥·¥ç¥Ã¥È¤Ç¤·¤«¤Ê¤¤¡£ +¥á¥â¥êÆâ¤Ë¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ú¡¼¥¸¤Ï¡¢Ç¤°Õ¤Î»þÅÀ¤Ç¥á¥â¥êÆâ¤Ë +Æþ¤Ã¤¿¤ê½Ð¤¿¤ê¤Ç¤­¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤¬ÊÖ¤ë¤È¤­¤Ë¤Ï +.I vec +¤ÎÆâÍƤϤ¹¤Ç¤Ë¸Å¤¯¤Ê¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR mincore () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¤Æ¡¢ +.I errno +¤òŬÀÚ¤ÊÃͤËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.B EAGAIN +¥«¡¼¥Í¥ë¤¬°ì»þŪ¤Ë¥ê¥½¡¼¥¹¤ò»È¤¤²Ì¤¿¤·¤Æ¤¤¤ë¡£ +.TP +.B EFAULT +.I vec +¤¬Ìµ¸ú¤Ê¥¢¥É¥ì¥¹¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I addr +¤¬¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ê¤¤¡£ +.TP +.B ENOMEM +.I length +¤¬ +.RI ( TASK_SIZE " \- " addr ) +¤è¤êÂ礭¤¤¡£ +.RI ( length +¤ËÉé¤ÎÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +¤½¤ÎÃͤ¬Â礭¤ÊÉä¹æ¤Ê¤·À°¿ô¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¤¿¤á¤Ëµ¯¤³¤ë¤³¤È¤¬¤¢¤ë¡£) +Linux 2.6.11 °ÊÁ°¤Ç¤Ï¡¢¤³¤Î¾ò·ï¤Î¾ì¹ç¤Ï¥¨¥é¡¼ +.B EINVAL +¤¬ÊÖ¤µ¤ì¤Æ¤¤¤¿¡£ +.TP +.B ENOMEM +.I addr +¤«¤é +.I addr ++ +.I length +¤Î´Ö¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Ê¤¤¥á¥â¥ê¤¬¤¢¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +Linux 2.3.99pre1 ¤È glibc 2.2 ¤«¤éÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +.BR mincore () +¤Ï POSIX.1-2001 ¤Ëµ­½Ò¤µ¤ì¤Æ¤ª¤é¤º¡¢ +Á´¤Æ¤Î Unix ¼ÂÁõ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.\" It is on at least NetBSD, FreeBSD, OpenBSD, Solaris 8, +.\" AIX 5.1, SunOS 4.1 +.\" .SH Îò»Ë +.\" .BR mincore () +.\" ´Ø¿ô¤Ï 4.4BSD ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ¥Ð¥° +¥«¡¼¥Í¥ë 2.6.21 ¤è¤êÁ°¤Ï¡¢ +.BR mincore () +¤Ï¡¢ +.B MAP_PRIVATE +¥Þ¥Ã¥Ô¥ó¥°¤äÈóÀþ·Á¥Þ¥Ã¥Ô¥ó¥° +.RB ( remap_file_pages (2) +¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤ë) ¤Ë¤Ä¤¤¤ÆÀµ¤·¤¤¾ðÊó¤òÊÖ¤µ¤Ê¤«¤Ã¤¿¡£ +.\" Linux ¤Ç¤Ï (2.6.5 ¤Î¸½ºß¤Ë»ê¤ë¤Þ¤Ç)¡¢ +.\" .B mincore +.\" ¤Ï MAP_PRIVATE ¥Þ¥Ã¥Ô¥ó¥°¤Ë¤Ä¤¤¤Æ¤ÎÀµ¤·¤¤¾ðÊó¤òÊÖ¤µ¤Ê¤¤¡£ +.\" MAP_PRIVATE ¥Õ¥¡¥¤¥ë¥Þ¥Ã¥Ô¥ó¥°¤Ë¤Ä¤¤¤Æ¡¢ +.\" .B mincore +.\" ¤Ï½ñ¤­¹þ¤ß»þ¥³¥Ô¡¼ (copy on write) ¤µ¤ì¤Æ¤¤¤Æ +.\" ½¤Àµ¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¥×¥é¥¤¥Ù¡¼¥È¥Ú¡¼¥¸¤òÊÖ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢ +.\" ¥Õ¥¡¥¤¥ë¥Ú¡¼¥¸¤¬Â¸ºß¤¹¤ë¤«Èݤ«¤òÊÖ¤¹¡£ +.\" .I /dev/zero +.\" ¤Î MAP_PRIVATE ¥Þ¥Ã¥Ô¥ó¥°¤Ë¤Ä¤¤¤Æ¡¢ +.\" .B mincore +.\" ¤Ï¾ï¤Ë¥Ú¡¼¥¸¤¬Â¸ºß¤·¤Ê¤¤¤È¤¤¤¦Åú¤¨¤òÊÖ¤¹¡£ +.\" MAP_PRIVATE, MAP_ANONYMOUS ¥Þ¥Ã¥Ô¥ó¥°¤Ë¤Ä¤¤¤Æ¡¢ +.\" .B mincore +.\" ¤Ï¾ï¤Ë +.\" .B ENOMEM +.\" ¤Ç¼ºÇÔ¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mlock (2), +.BR mmap (2) diff --git a/release/man2/mkdir.2 b/release/man2/mkdir.2 new file mode 100644 index 00000000..8672e9d5 --- /dev/null +++ b/release/man2/mkdir.2 @@ -0,0 +1,155 @@ +.\" 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" +.SH ̾Á° +mkdir \- ¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.\" .B #include +.sp +.BI "int mkdir(const char *" pathname ", mode_t " mode ); +.fi +.SH ÀâÌÀ +.BR mkdir () +¤Ï +.I pathname +¤Ç¼¨¤µ¤ì¤ë̾Á°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¡£ + +.I mode +°ú¤­¿ô¤Ï¡¢ºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Îµö²Ä°À­¤ò·èÄꤹ¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£ +¤³¤ÎÃͤˡ¢Ä̾ïÄ̤ê¥×¥í¥»¥¹¤Î +.I umask +¤Ë¤è¤ë½¤Àµ¤¬²Ã¤¨¤é¤ì¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢ºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Îµö²Ä°À­¤Ï +.RI ( mode " & ~" umask " & 0777)" +¤È¤Ê¤ë¡£ +ºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¤½¤Î¾¤Î¥â¡¼¥É¥Ó¥Ã¥È¤Ï¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ë +°Í¸¤¹¤ë¡£Linux ¤Î¾ì¹ç¤Ï¡¢°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ + +¿·¤·¤¯ºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î½êÍ­¼Ô¤Ï¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤ËÀßÄꤵ¤ì¤ë¡£ +¿·¤¿¤ËºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬´Þ¤Þ¤ì¤ë¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ë +set group ID ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ BSD ¤Î +¥°¥ë¡¼¥×¥»¥Þ¥ó¥Æ¥£¥¯¥¹ +.RI ( "mount -o bsdgroups" +¤¢¤ë¤¤¤Ï¡¢Æ±¤¸°ÕÌ£¤Î +.IR "mount -o grpid" ) +¤Ë½¾¤Ã¤Æ¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¿·¤¿¤ËºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¥°¥ë¡¼¥×½êÍ­¸¢¤Ï¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î +¤â¤Î¤¬·Ñ¾µ¤µ¤ì¤ë (¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤ÈƱ¤¸¤Ë¤Ê¤ë)¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¥°¥ë¡¼¥×½êÍ­¸¢¤Ï¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤È¤Ê¤ë¡£ + +¤â¤·¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ë set group ID ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð¿·¤·¤¯ºîÀ®¤µ¤ì¤ë +¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤â set group ID ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR mkdir () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç 0 ¤ò¡¢¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤òÊÖ¤¹ (¤Þ¤¿¡¢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤˤ·¤¿¤¬¤Ã¤ÆŬÀÚ¤ËÀßÄꤵ¤ì¤ë)¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¥×¥í¥»¥¹¤¬¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤¤¡¢¤â¤·¤¯¤Ï +.I pathname +Ãæ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä°À­¤¬Ìµ¤¤ +.RB ( path_resolution (7) +¤â»²¾È)¡£ +.TP +.B EEXIST +.I pathname +¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤ë(¤¿¤À¤·¤½¤ì¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤È¤Ï¸Â¤é¤Ê¤¤)¡£ +.I pathname +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤â +(¤½¤Î»ØÄêÀ褬¸ºß¤¹¤ë¤«¤É¤¦¤«¤Ë´Ø¤é¤º)¥¨¥é¡¼¤Ë¤Ê¤ë¡£ +.TP +.B EFAULT +.I pathname +¤¬¤½¤Î¥×¥í¥»¥¹¤Î¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B ELOOP +¥Ñ¥¹Ì¾ +.I pathname +¤ò²ò·è¤¹¤ë¤È¤­¤Ë¡¢²ò·è¤¹¤Ù¤­¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Â¿¤¹¤®¤¿¡£ +.TP +.B ENAMETOOLONG +.I pathname +¤¬Ä¹¤¹¤®¤ë¡£ +.TP +.B ENOENT +.I pathname +¤Î¹½À®Í×ÁǤΥǥ£¥ì¥¯¥È¥ê¤Î¤¤¤º¤ì¤«¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢ +¤Þ¤¿¤Ï¥ê¥ó¥¯À褬¸ºß¤·¤Ê¤¤¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤Ë¡¢ÍøÍѤǤ­¤ë¥á¥â¥ê¤¬ÉÔ­¤·¤Æ¤¤¤ë¡£ +.TP +.B ENOSPC +.I pathname +¤ò´Þ¤à¥Ç¥Ð¥¤¥¹¤Ë¿·¤¿¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë¶õ¤­¤¬Ìµ¤¤¡£ +.TP +.B ENOSPC +.\"?? ENOSPC ¤¬¥À¥Ö¤Ã¤Æ¤¤¤ë¤±¤É... +¤â¤·¤¯¤Ï¥æ¡¼¥¶¡¼¤Î¥Ç¥£¥¹¥¯ quota ¤¬»È¤¤ÀÚ¤é¤ì¤Æ¤¤¤ë¤¿¤á¡¢ +¿·¤¿¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I pathname +Ãæ¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EPERM +.I pathname +¤ò´Þ¤à¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ÎºîÀ®¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EROFS +.I pathname +¤¬Æɤ߽Ф·ÀìÍÑ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.SH ½àµò +SVr4, BSD, POSIX.1-2001. +.\" SVr4 ¤Ë¤Ï¤µ¤é¤Ë¥¨¥é¡¼¥³¡¼¥É EIO, EMULTIHOP ¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.SH Ãí°Õ +Linux ¤Ç¤Ï¡¢µö²Ä¥Ó¥Ã¥È°Ê³°¤Ç°ÕÌ£¤ò»ý¤Ä¤Î¤Ï¡¢ +.B S_ISVTX +¥â¡¼¥É¥Ó¥Ã¥È¤À¤±¤Ç¤¢¤ë¡£ +¤Ä¤Þ¤ê¡¢Linux ¤Ç¤ÏºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ï¼ÂºÝ¤Ë¤Ï +.RI ( mode " & ~" umask " & 01777)" +¤Î¥â¡¼¥É¤ò»ý¤Ä¤³¤È¤Ë¤Ê¤ë¡£ +.BR stat (2) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +NFS ¤ò¼Â¸½¤·¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¤Ë¤Ï¿¤¯¤ÎÉÔÈ÷¤¬Â¸ºß¤·¡¢ +¤½¤ì¤éÃæ¤Ë¤Ï +.BR mkdir () +¤Ë±Æ¶Á¤òÍ¿¤¨¤ë¤â¤Î¤â¤¢¤ë¡£ +.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/release/man2/mkdirat.2 b/release/man2/mkdirat.2 new file mode 100644 index 00000000..9e99d41f --- /dev/null +++ b/release/man2/mkdirat.2 @@ -0,0 +1,120 @@ +.\" 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-09-30 by Yuichi SATO , LDP v2.39 +.\" +.TH MKDIRAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mkdirat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤˥ǥ£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int mkdirat(int " dirfd ", const char *" pathname ", mode_t " mode ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR mkdirat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +.BR mkdirat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.BR mkdir (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹Ì¾¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I dirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( mkdir (2) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I pathname +¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä +.I dirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I pathname +¤Ï +.RB ( mkdir (2) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR mkdirat () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR mkdir (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR mkdirat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR mkdirat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I dirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I pathname +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I dirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR mkdirat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2008. +.SH Ãí°Õ +.BR mkdirat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ÀâÌÀ +.BR mkdir (2), +.BR openat (2), +.BR path_resolution (7) diff --git a/release/man2/mknod.2 b/release/man2/mknod.2 new file mode 100644 index 00000000..ae0f8a19 --- /dev/null +++ b/release/man2/mknod.2 @@ -0,0 +1,239 @@ +.\" 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. +.\" +.\" Modified 1996-08-18 by urs +.\" Modified 2003-04-23 by Michael Kerrisk +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated 1997-06-26, SUTO, Mitsuaki +.\" Updated & Modified 1999-03-01, NAKANO Takeo +.\" Updated & Modified 2001-06-04, Yuichi SATO +.\" Updated & Modified 2003-07-26, Yuichi SATO +.\" Updated & Modified 2004-12-31, Yuichi SATO +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" +.\"WORD: node ¥Î¡¼¥É +.\"WORD: permission µö²Ä°À­ +.\"WORD: resolve (¥Ñ¥¹Ì¾¤ò) ²ò·è¤¹¤ë +.\" +.TH MKNOD 2 2008-12-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mknod \- Æüì¥Õ¥¡¥¤¥ë¤äÄ̾ï¤Î¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.B #include +.sp +.BI "int mknod(const char *" pathname ", mode_t " mode ", dev_t " dev ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR mknod (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR mknod () +¤Ï +.I pathname +¤È¤¤¤¦Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥Î¡¼¥É +(¥Õ¥¡¥¤¥ë¡¢¥Ç¥Ð¥¤¥¹¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¡¢Ì¾Á°ÉÕ¤­¥Ñ¥¤¥×) ¤ò¡¢ +°À­ +.I mode +¤È +.I dev +¤Î»ØÄê¤Ë¤·¤¿¤¬¤Ã¤ÆºîÀ®¤¹¤ë¡£ + +.I mode +°ú¤­¿ô¤Ë¤Ï¡¢ºîÀ®¤¹¤ë¥Î¡¼¥É¤Îµö²Ä°À­ (permission) ¤È¥¿¥¤¥×¤ò»ØÄꤹ¤ë¡£ +.I mode +¤Î»ØÄê¤Ï°Ê²¼¤Ë¤¢¤²¤ë¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤Î¤¦¤Á¤Î 1 ¤Ä¤È¡¢ +µö²Ä°À­¤ÎÁȹ礻 (¥Ó¥Ã¥È¤´¤È¤Î OR ¤ò»ÈÍÑ) ¤Ç¹Ô¤¦¡£ + +µö²Ä°À­¤ÏÄ̾ïÄ̤ꡢ¥×¥í¥»¥¹¤Î +.I umask +¤Ë¤è¤Ã¤Æ½¤Àµ¤µ¤ì¡¢ºîÀ®¤µ¤ì¤¿¥Î¡¼¥É¤Îµö²Ä°À­¤Ï +.I "(mode & ~umask)" +¤È¤Ê¤ë¡£ + +¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤Ë¤Ï +.BR S_IFREG , +.BR S_IFCHR , +.BR S_IFBLK , +.BR S_IFIFO , +.B S_IFSOCK +.\" (S_IFSOCK ¤Ï Linux 1.2.4 ¤«¤é¸ºß¤¹¤ë) +¤Î¤¤¤º¤ì¤«¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤½¤ì¤¾¤ì½ç¤Ë¡¢Ä̾ï¤Î¥Õ¥¡¥¤¥ë (¶õ¤Î¥Õ¥¡¥¤¥ë¤È¤·¤ÆºîÀ®¤µ¤ì¤ë)¡¦ +¥­¥ã¥é¥¯¥¿¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¡¦¥Ö¥í¥Ã¥¯¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¡¦ +FIFO (̾Á°ÉÕ¤­¥Ñ¥¤¥×)¡¦Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤Ç¤¢¤ë +(¥Õ¥¡¥¤¥ë¥¿¥¤¥× 0 ¤Ï +.B S_IFREG +¤ÈƱ¤¸¤Ç¤¢¤ë)¡£ + +¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤¬ +.B S_IFCHR +¤Þ¤¿¤Ï +.B S_IFBLK +¤Î¤È¤­¡¢ +.I dev +¤Ë¤ÏºîÀ®¤¹¤ë¥Ç¥Ð¥¤¥¹¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Î¥á¥¸¥ã¡¼ÈÖ¹æ¤È +¥Þ¥¤¥Ê¡¼ÈÖ¹æ¤ò»ØÄꤹ¤ë +.RB ( makedev (3) +¤Ï +.I dev +¤Î¤³¤ì¤é¤ÎÈÖ¹æ¤òºîÀ®¤¹¤ëºÝ¤ËÌòΩ¤Ä¤À¤í¤¦)¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï +.I dev +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.I pathname +¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢¤Þ¤¿¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¡¢ +¤³¤Î¸Æ¤Ó½Ð¤·¤Ï +.B EEXIST +¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¡£ + +¿·¤·¤¯ºîÀ®¤µ¤ì¤¿¥Î¡¼¥É¤Î½êÍ­¼Ô¤Ï¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +¿·¤¿¤Ëºî¤é¤ì¤¿¥Î¡¼¥É¤òÊÝ»ý¤¹¤ë +¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î set-group-ID ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¤ê¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ BSD ¤Î¥°¥ë¡¼¥×¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤Ë¤·¤¿¤¬¤Ã¤Æ +¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¿·¤·¤¤¥Î¡¼¥É¤Î¥°¥ë¡¼¥×½êÍ­¸¢¤Ï¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î +¥°¥ë¡¼¥×½êÍ­¸¢¤ò·Ñ¾µ¤¹¤ë (¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤ÈƱ¤¸¤Ë¤Ê¤ë)¡£ +¤Þ¤¿¡¢¤½¤¦¤Ç¤Ê¤«¤Ã¤¿¾ì¹ç¤Î½êÍ­¥°¥ë¡¼¥×¤Ï¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤È¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR mknod () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç 0 ¤ò¡¢¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤òÊÖ¤¹ +(¼ºÇÔ¤·¤¿¾ì¹ç +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤˤ·¤¿¤¬¤Ã¤Æ¥»¥Ã¥È¤µ¤ì¤ë)¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¥×¥í¥»¥¹¤¬¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤¤¡£ +¤â¤·¤¯¤Ï¥Ñ¥¹Ì¾ +.I pathname +Ãæ¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä°À­¤¬Ìµ¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EEXIST +.I pathname +¤¬´û¤Ë¸ºß¤¹¤ë¡£ +¤³¤ì¤Ë¤Ï +.I pathname +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¤â´Þ¤Þ¤ì¤ë +(¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬²õ¤ì¤Æ¤¤¤ë¤« (dangling) ¤É¤¦¤«¤Ï´Ø·¸¤Ê¤¤)¡£ +.TP +.B EFAULT +.I pathname +¤¬¤½¤Î¥×¥í¥»¥¹¤Î¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I mode +¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥Ð¥¤¥¹¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¡¦FIFO¡¦¥½¥±¥Ã¥È°Ê³°¤ò +ºîÀ®¤¹¤ë¤è¤¦¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ELOOP +¥Ñ¥¹Ì¾ +.I pathname +¤ò²ò·è¤¹¤ë¤È¤­¤Ë¡¢´Þ¤Þ¤ì¤Æ¤¤¤ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Â¿¤¹¤®¤¿¡£ +.TP +.B ENAMETOOLONG +.I pathname +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +.I pathname +Ãæ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢ +¤Þ¤¿¤Ï¥ê¥ó¥¯Àè¤Î̵¤¤¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +½½Ê¬¤Ê¥«¡¼¥Í¥ë¥á¥â¥ê¤¬Ìµ¤¤¡£ +.TP +.B ENOSPC +.I pathname +¤Î¤¢¤ë¥Ç¥Ð¥¤¥¹¤Ë¿·¤¿¤Ë¥Î¡¼¥É¤òºîÀ®¤¹¤ë¶õ¤­¤¬Ìµ¤¤¡£ +.TP +.B ENOTDIR +.I pathname +Ãæ¤Î¥Ç¥£¥ì¥¯¥È¥êÍ×ÁǤ¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EPERM +.I mode +¤ÏÄ̾ï¤Î¥Õ¥¡¥¤¥ë¡¦FIFO (̾Á°ÉÕ¤­¥Ñ¥¤¥×)¡¦Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È°Ê³°¤ò +ºîÀ®¤¹¤ë¤è¤¦¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¼Â¹Ô¼Ô¤¬Æø¢ +(Linux ¤Ç¤Ï +.B CAP_MKNOD +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability)) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.\" Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤ÈÄ̾ï¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ mknod() ¤ò¹Ô¤¦¤È¡¢ +.\" Linux 2.2 °ÊÁ°¤Ç¤Ï EPERM ¤òÊÖ¤¹¤À¤±¤Ç¤¢¤ë¡£ +.\" Linux 2.4 °Ê¹ß¤Ç¤ÏÆø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¯¤Æ¤â¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤ò +.\" ºîÀ®¤¹¤ë¤Î¤Ë mknod() ¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤Þ¤¿¤Ï +.I pathname +¤òÊÝ»ý¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¡¢»ØÄꤵ¤ì¤¿¥Î¡¼¥É·Á¼°¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EROFS +.I pathname +¤¬Æɤ߽Ф·ÀìÍÑ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.SH ½àµò +SVr4, 4.4BSD, POSIX.1-2001 (²¼µ­¤â»²¾È). +.\" Linux ¤Î¼ÂÁõ¤Ï SVr4 ¤Î¼ÂÁõ¤È°Û¤Ê¤ê¡¢¥Ñ¥¤¥×¤ÎºîÀ®¤Ë¤Ï root ¸¢¸Â¤¬ÉÔÍפǤ¢¤ë¡£ +.\" ¤Þ¤¿ EMULTIHOP ¤È ENOLINK ¤È EINTR ¤Î¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH Ãí°Õ +POSIX.1-2001 ¤Ç¤Ï¼¡¤Î¤è¤¦¤Ë½ñ¤¤¤Æ¤¤¤ë¡§ +.RB ¡Ö mknod () +¤ÎÍ£°ì¤Î°Ü¿¢À­¤Î¤¢¤ë»ÈÍÑË¡¤Ï¡¢FIFO ¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +.I mode +¤¬ +.B S_IFIFO +¤Ç¤Ï¤Ê¤¤¾ì¹ç¡¢¤Þ¤¿¤Ï +.I dev +¤¬ 0 ¤Ç¤Ï¤Ê¤¤¾ì¹ç¡¢ +.BR mknod () +¤ÎµóÆ°¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£¡× +¤·¤«¤·¤Ê¤¬¤é¡¢¸½ºß¤Ç¤Ï¤³¤ÎÌÜŪ¤Î¤¿¤á¤Ë +.BR mknod () +¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£¤³¤ÎÌÜŪ¤Î¤¿¤á¤ËÆÃÊ̤ËÄêµÁ¤µ¤ì¤¿´Ø¿ô¤Ç¤¢¤ë +.BR mkfifo () +¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +Linux ¤Ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë¤¿¤á¤Ë +¤³¤Î¸Æ¤Ó½Ð¤·¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¥Ç¥£¥ì¥¯¥È¥ê¤Ï +.BR mkdir (2) +¤ÇºîÀ®¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\" Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤Ï socket(2) ¤È bind(2) ¤ÇºîÀ®¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +NFS ¤ò¼Â¸½¤·¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¤Ë¤Ï¿¤¯¤ÎÉÔÈ÷¤¬Â¸ºß¤·¡¢ +¤½¤ì¤é¤Î¤¤¤¯¤Ä¤«¤Ï +.BR mknod () +¤Ë±Æ¶Á¤òÍ¿¤¨¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR chmod (2), +.BR chown (2), +.BR fcntl (2), +.BR mkdir (2), +.BR mknodat (2), +.BR mount (2), +.BR socket (2), +.BR stat (2), +.BR umask (2), +.BR unlink (2), +.BR makedev (3), +.BR mkfifo (3), +.BR path_resolution (7) diff --git a/release/man2/mknodat.2 b/release/man2/mknodat.2 new file mode 100644 index 00000000..8f0cc7f2 --- /dev/null +++ b/release/man2/mknodat.2 @@ -0,0 +1,122 @@ +.\" 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-09-30 by Yuichi SATO , LDP v2.39 +.\" +.TH MKNODAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mknodat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˡ¢ +Æüì¥Õ¥¡¥¤¥ë¤äÄ̾ï¤Î¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int mknodat(int " dirfd ", const char *" pathname ", mode_t " mode \ +", dev_t " dev ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR mknodat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +.BR mknodat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.BR mknod (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹Ì¾¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I dirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( mknod (2) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I pathname +¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä +.I dirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I pathname +¤Ï +.RB ( mknod (2) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR mknodat () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR mknod (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR mknodat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR mknodat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I dirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I pathname +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I dirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR mknodat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2008. +.SH Ãí°Õ +.BR mknodat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mknod (2), +.BR openat (2), +.BR path_resolution (7) diff --git a/release/man2/mlock.2 b/release/man2/mlock.2 new file mode 100644 index 00000000..d8ba21df --- /dev/null +++ b/release/man2/mlock.2 @@ -0,0 +1,328 @@ +.\" 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" +.SH ̾Á° +mlock \- ¥á¥â¥ê¤Î¥í¥Ã¥¯¤È¥í¥Ã¥¯²ò½ü¤ò¹Ô¤¦ +.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 +.SH ÀâÌÀ +.BR mlock () +¤È +.BR mlockall () +¤Ï¤½¤ì¤¾¤ì¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î²¾ÁÛ¥¢¥É¥ì¥¹¶õ´Ö¤Î°ìÉô¤Þ¤¿¤ÏÁ´Éô¤ò +RAM ¾å¤Ë¥í¥Ã¥¯¤·¡¢¥á¥â¥ê¤¬¥¹¥ï¥Ã¥×¥¨¥ê¥¢¤Ë¥Ú¡¼¥¸¥ó¥°¤µ¤ì¤ë¤Î¤òËɤ°¡£ +.BR munlock () +¤È +.BR munlockall () +¤ÏµÕ¤ÎÁàºî¤Ç¡¢¤½¤ì¤¾¤ì¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î²¾ÁÛ¥¢¥É¥ì¥¹¶õ´Ö¤Î°ìÉô¤Þ¤¿¤ÏÁ´Éô¤ò +¥í¥Ã¥¯²ò½ü¤¹¤ë¡£¤Ä¤Þ¤ê¡¢»ØÄꤵ¤ì¤¿²¾ÁÛ¥¢¥É¥ì¥¹ÈϰϤΥڡ¼¥¸¤Ï +¥«¡¼¥Í¥ë¥á¥â¥ê¥Þ¥Í¡¼¥¸¥ã¡¼¤«¤éÍ׵ᤵ¤ì¤ì¤Ð¥¹¥ï¥Ã¥×¥¢¥¦¥È¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¥á¥â¥ê¤Î¥í¥Ã¥¯¤È¥í¥Ã¥¯²ò½ü¤Ï¥Ú¡¼¥¸Ã±°Ì¤Ç¹Ô¤ï¤ì¤ë¡£ +.SS "mlock() ¤È munlock()" +.BR mlock () +¤Ï +.I addr +¤«¤é»Ï¤Þ¤ëŤµ +.I len +¥Ð¥¤¥È¤Î¥¢¥É¥ì¥¹ÈϰϤΥڡ¼¥¸¤ò¥í¥Ã¥¯¤¹¤ë¡£ +¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹ÈϰϤò´Þ¤àÁ´¤Æ¤Î¥Ú¡¼¥¸¤Ï +RAM ¤Ë»Ä¤ê³¤±¤ë¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ +¤³¤ì¤é¤Î¥Ú¡¼¥¸¤Ï¸å¤Ç¥í¥Ã¥¯²ò½ü¤µ¤ì¤ë¤Þ¤Ç RAM ¤Ë»Ä¤ê³¤±¤ë¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ + +.BR munlock () +¤Ï¡¢ +.I addr +¤«¤é»Ï¤Þ¤ëŤµ +.I len +¥Ð¥¤¥È¤Î¥¢¥É¥ì¥¹ÈϰϤΥڡ¼¥¸¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë¡£ +¤³¤Î¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ã¤¿¸å¤Ï¡¢¥«¡¼¥Í¥ë¤¬¡¢»ØÄꤵ¤ì¤¿¥á¥â¥êÈϰϤò´Þ¤à +Á´¤Æ¤Î¥Ú¡¼¥¸¤ò³°Éô¤Î¥¹¥ï¥Ã¥×¶õ´Ö¤Ë°ÜÆ°¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.SS "mlockall() ¤È munlockall()" +.BR mlockall () +¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥Ú¡¼¥¸¤ò +¥í¥Ã¥¯¤¹¤ë¡£¤³¤ì¤Ë¤Ï¥³¡¼¥É¡¢¥Ç¡¼¥¿¡¢¥¹¥¿¥Ã¥¯¤Î +³Æ¥»¥°¥á¥ó¥È¡¢¶¦Í­¥é¥¤¥Ö¥é¥ê¡¢¥«¡¼¥Í¥ë¤Î¥æ¡¼¥¶¡¼¶õ´Ö¥Ç¡¼¥¿¡¢ +¶¦Í­¥á¥â¥ê¡¢¥á¥â¥ê¡¦¥Þ¥Ã¥×¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤ë¡£ +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬À®¸ù¤·¤¿¾ì¹ç¤Ë¤ÏÁ´¤Æ¤Î¥Þ¥Ã¥×¤µ¤ì¤¿¥Ú¡¼¥¸¤Ï RAM ¤Ë +»Ä¤ë¤³¤È¤òÊݾڤµ¤ì¤ë¡£ +¤³¤ì¤é¤Î¥Ú¡¼¥¸¤Ï¸å¤Ç¥í¥Ã¥¯²ò½ü¤µ¤ì¤ë¤Þ¤Ç RAM ¤Ë»Ä¤ê³¤±¤ë¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ + +.I flags +°ú¿ô¤Ï°Ê²¼¤ÎÆâÍƤΰì¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î¥Ó¥Ã¥È OR ¤«¤é¹½À®¤µ¤ì¤ë: +.TP 1.2i +.B MCL_CURRENT +¸½ºß¡¢¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥Ú¡¼¥¸¤ò¥í¥Ã¥¯¤¹¤ë¡£ +.TP +.B MCL_FUTURE +¾­Íè¡¢¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥×¤µ¤ì¤ëÁ´¤Æ¤Î¥Ú¡¼¥¸¤ò¥í¥Ã¥¯¤¹¤ë¡£ +Î㤨¤Ð¡¢¥Ò¡¼¥× (heap) ¤ä¥¹¥¿¥Ã¥¯¤ÎÀ®Ä¹¤Ë¤è¤ê¿·¤·¤¯É¬Íפˤʤä¿¥Ú¡¼¥¸¤À¤±¤Ç +¤Ê¤¯¡¢¿·¤·¤¯¥á¥â¥ê¥Þ¥Ã¥×¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ä¶¦Í­¥á¥â¥êÎΰè¤â¥í¥Ã¥¯¤µ¤ì¤ë¡£ +.PP +.B MCL_FUTURE +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢°Ê¸å¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë (Î㤨¤Ð¡¢ +.BR mmap (2), +.BR sbrk (2), +.BR malloc (3)) +¤Ï¡¢¥í¥Ã¥¯¤¹¤ë¥Ð¥¤¥È¿ô¤¬µö²Ä¤µ¤ì¤¿ºÇÂçÃÍ (²¼µ­»²¾È) ¤òĶ¤¨¤¿¾ì¹ç¤Ë +¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +ƱÍͤˡ¢¥¹¥¿¥Ã¥¯¤ÎÀ®Ä¹¤â¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤½¤Î¾ì¹ç¡¢¥«¡¼¥Í¥ë¤Ï¥¹¥¿¥Ã¥¯¤Î³ÈÄ¥¤òµñÈݤ·¡¢ +.B SIGSEGV +¤ò¥×¥í¥»¥¹¤ËÁ÷¤ë¡£ + +.BR munlockall () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤Æ¤¤¤ë +Á´¤Æ¤Î¥Ú¡¼¥¸¤ò¥í¥Ã¥¯²ò½ü¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¡¢¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤ª¤±¤ë¥í¥Ã¥¯¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +(Linux 2.6.9 °Ê¹ß) ¸Æ¤Ó½Ð¤·¸µ¤ÏÈó¥¼¥í¤Î +¥½¥Õ¥È»ñ¸»À©¸Â +.B RLIMIT_MEMLOCK +¤ò»ý¤Ä¤¬¡¢À©¸Â¤¬µö²Ä¤·¤Æ¤¤¤ë°Ê¾å¤Î¥á¥â¥ê¤ò¥í¥Ã¥¯¤·¤è¤¦¤È¤·¤¿¡£ +¤³¤ÎÀ©¸Â¤Ï¡¢¥×¥í¥»¥¹¤¬Æø¢ +.RB ( CAP_IPC_LOCK ) +¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤ÏŬÍѤµ¤ì¤Ê¤¤¡£ +.TP +.B ENOMEM +(Linux 2.4 °ÊÁ°) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬ RAM ¤ÎȾʬ°Ê¾å¤ò¥í¥Ã¥¯¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B EPERM +(Linux 2.6.9 °Ê¹ß) ¸Æ¤Ó½Ð¤·¸µ¤ÏÆø¢ +.RB ( CAP_IPC_LOCK ) +¤ò»ý¤¿¤º¡¢¥½¥Õ¥È»ñ¸»À©¸Â +.B RLIMIT_MEMLOCK +¤¬ 0 ¤Ç¤¢¤ë¡£ +.TP +.B EPERM +(Linux 2.6.8 °ÊÁ°) +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬ +.BR munlockall () +¤ò¸Æ¤Ó½Ð¤¹¤Î¤ËɬÍפÊÆø¢¤ò½êÍ­¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +Linux ¤Ç¤Ï¡¢ +.B CAP_IPC_LOCK +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.\"SVr4 ¤Î¥É¥­¥å¥á¥ó¥È¤Ë¤Ï¡¢¤³¤ì°Ê³°¤Ë¥¨¥é¡¼¥³¡¼¥É EAGAIN ¤Îµ­ºÜ¤¬¤¢¤ë¡£ +.LP +.BR mlock () +¤È +.BR munlock () +ÍѤȤ·¤Æ: +.TP +.B EAGAIN +»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹ÈϰϤΰìÉô¤Þ¤¿¤ÏÁ´¤Æ¤ò¥í¥Ã¥¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINVAL +.I len +¤¬Éé¤Î¿ô¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +(Linux ¤Ç¤Ï¤³¤Î°ÕÌ£¤Ç»È¤ï¤ì¤Ê¤¤) +.I addr +¤¬¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ENOMEM +»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹ÈϰϤ¬¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥×¤µ¤ì¤¿¥Ú¡¼¥¸¤È +°ìÃפ·¤Ê¤¤¡£ +.LP +.BR mlockall () +ÍѤȤ·¤Æ: +.TP +.B EINVAL +̤ÃΤΠ\fIflags\fP ¤¬»ØÄꤵ¤ì¤¿¡£ +.LP +.BR munlockall () +ÍѤȤ·¤Æ: +.TP +.B EPERM +(Linux 2.6.8 °ÊÁ°) ¸Æ¤Ó½Ð¤·¸µ¤¬¸¢¸Â +.RB ( CAP_IPC_LOCK ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001, SVr4. +.SH ²ÄÍÑÀ­ +.BR mlock () +¤È +.BR munlock () +¤¬»ÈÍѲÄǽ¤Ê POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï +.B _POSIX_MEMLOCK_RANGE +¤¬ \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤Þ¤¿¡¢¥Ú¡¼¥¸¤¢¤¿¤ê¤Î¥Ð¥¤¥È¿ô¤Ï¡¢ +\fI\fP ¤ÇÄêµÁ¤µ¤ì¤ëÄê¿ô +.B PAGESIZE +¤«¤é (ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç)¡¢¤â¤·¤¯¤Ï +.I sysconf(_SC_PAGESIZE) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç·èÄê¤Ç¤­¤ë¡£ + +.BR mlockall () +¤È +.BR munlockall () +¤¬ÍøÍѲÄǽ¤Ê POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.B _POSIX_MEMLOCK +¤Ï \fI\fP ¤Ç 0 ¤è¤êÂ礭¤¤ÃͤËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +.RB ( sysconf (3) +¤â»²¾È¤Î¤³¤È)¡£ +.\" POSIX.1-2001: ¤³¤ÎÊÑ¿ô¤Ï -1 ¤« 0 ¤« 200112l ¤Î¤¤¤º¤ì¤«¤Ë +.\" ÄêµÁ¤¹¤Ù¤­¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" -1: ÍøÍѤǤ­¤Ê¤¤¡¢0: sysconf() ¤ËÌ䤤¹ç¤ï¤»¤ë +.\" glibc ¤Ç¤Ï 1 ¤ËÄêµÁ¤·¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +¥á¥â¥ê¤Î¥í¥Ã¥¯¤ÎÍÑÅӤȤ·¤Æ¤Ï¼ç¤ËÆó¤Ä¤¢¤ë: ¥ê¥¢¥ë¥¿¥¤¥à +¥¢¥ë¥´¥ê¥º¥à¤È¹â¤¤¥»¥­¥å¥ê¥Æ¥£¤ÎɬÍפʥǡ¼¥¿½èÍý¤Ç¤¢¤ë¡£¥ê¥¢¥ë¥¿¥¤¥à¤Î +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï·èÄêŪ¤Ê¥¿¥¤¥ß¥ó¥°¤ä¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤òɬÍפȤ¹¤ë¤¬¡¢ +¥Ú¡¼¥¸¥ó¥°¤Ïͽ´ü¤·¤Ê¤¤¥×¥í¥°¥é¥à¤Î¼Â¹ÔÃÙ±ä¤ò¤â¤¿¤é¤¹¼çÍפÊÍ×°ø¤È¤Ê¤ë¡£ +¥ê¥¢¥ë¥¿¥¤¥à¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤¿¤¤¤Æ¤¤¤Ï +.BR sched_setscheduler (2) +¤Ç¥ê¥¢¥ë¥¿¥¤¥à¥¹¥±¥¸¥å¡¼¥é¤ËÊѹ¹¤µ¤ì¤ë¡£ +°Å¹æ¤ä¥»¥­¥å¥ê¥Æ¥£¤Î¥½¥Õ¥È¥¦¥§¥¢¤Ï¤·¤Ð¤·¤Ð¥Ñ¥¹¥ï¡¼¥É¤äÈëÌ©¸°¤Î¥Ç¡¼¥¿¤Î +¤è¤¦¤Ê½ÅÍפʥХ¤¥ÈÎó¤ò°·¤¦¡£¥Ú¡¼¥¸¥ó¥°¤Î·ë²Ì¡¢¤³¤ì¤é¤ÎÈëÌ©¤¬ +¥¹¥ï¥Ã¥×ÍѤθÇÄêÇÞÂΤËžÁ÷¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£¤½¤·¤Æ¡¢¥»¥­¥å¥ê¥Æ¥£¡¦ +¥½¥Õ¥È¥¦¥§¥¢¤¬ RAM ¾å¤ÎÈëÌ©¤òºï½ü¤·¤Æ½ªÎ»¤·¤¿¤º¤Ã¤È¸å¤Ë¤Ê¤Ã¤Æ¤â¡¢ +¤³¤Î¥¹¥ï¥Ã¥×¤µ¤ì¤¿¥Ç¡¼¥¿¤Ë¤ÏŨ¤¬¥¢¥¯¥»¥¹¤Ç¤­¤ë²ÄǽÀ­¤¬¤¢¤ë +(¤·¤«¤·¡¢¥é¥Ã¥×¥È¥Ã¥×¤È¤¤¤¯¤Ä¤«¤Î¥Ç¥¹¥¯¥È¥Ã¥×¥³¥ó¥Ô¥å¡¼¥¿¤Î +¥µ¥¹¥Ú¥ó¥É¥â¡¼¥É¤Ï¥·¥¹¥Æ¥à¤Î RAM ¤ÎÆâÍƤò¥á¥â¥ê¤Î¥í¥Ã¥¯¤Ë´Ø¤ï¤é¤º +¥Ç¥£¥¹¥¯¤ËÊݸ¤¹¤ë¤³¤È¤ËÃí°Õ)¡£ + +¥ê¥¢¥ë¥¿¥¤¥à¥×¥í¥»¥¹¤¬ +.BR mlockall () +¤ò»È¤Ã¤Æ¥Ú¡¼¥¸¥Õ¥©¡¼¥ë¥È¤Ë¤è¤ëÃÙ±ä¤òËɤ´¤¦¤È¤¹¤ë¾ì¹ç¡¢ +´Ø¿ô¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ¥Ú¡¼¥¸¥Õ¥©¡¼¥ë¥È¤¬È¯À¸¤·¤Ê¤¤¤è¤¦¤Ë¡¢ +»þ´ÖÀ©¸Â¤Î¸·¤·¤¤Éôʬ (time-critical section) ¤ËÆþ¤ëÁ°¤Ë +½½Ê¬¤ÊÎ̤Υí¥Ã¥¯¤µ¤ì¤¿¥¹¥¿¥Ã¥¯¤ò³ÎÊݤ·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +¤³¤ì¤ò¼Â¸½¤¹¤ë¤Ë¤Ï¡¢½½Ê¬¤ÊÂ礭¤µ¤Î¼«Æ°ÊÑ¿ô (¤ÎÇÛÎó) ¤ò³ÎÊݤ·¡¢ +¤³¤ì¤é¤Î¥¹¥¿¥Ã¥¯ÍѤΥڡ¼¥¸¤¬¥á¥â¥ê¾å¤Ë³ÎÊݤµ¤ì¤ë¤è¤¦¤Ë¤³¤ÎÇÛÎó¤Ë +½ñ¤­¹þ¤ß¤ò¹Ô¤¦´Ø¿ô¤òÍÑ°Õ¤·¡¢¤³¤ì¤ò¸Æ¤Ó½Ð¤»¤Ð¤è¤¤¡£¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢ +½½Ê¬¤ÊÎ̤Υڡ¼¥¸¤¬¥¹¥¿¥Ã¥¯¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¡¢RAM ¤Ë¥í¥Ã¥¯¤µ¤ì¤ë¡£ +¥À¥ß¡¼¤Î½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤³¤È¤Ë¤è¤Ã¤Æ¡¢ +»þ´ÖÀ©¸Â¤Î¸·¤·¤¤Éôʬ (critical section) Æâ¤Ç¤Ï½ñ¤­¹þ¤ß»þ¥³¥Ô¡¼¤Ë¤è¤ë +¥Ú¡¼¥¸¥Õ¥©¡¼¥ë¥È¤µ¤¨¤âȯÀ¸¤·¤Ê¤¤¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ + +¥á¥â¥ê¥í¥Ã¥¯¤Ï +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ë¤Ï·Ñ¾µ¤µ¤ì¤º¡¢ +.BR execve (2) +¤¬¸Æ¤Ð¤ì¤¿¤ê¡¢¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¾ì¹ç¤Ï +¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë (¥í¥Ã¥¯²ò½ü¤µ¤ì¤ë)¡£ + +¤¢¤ë¥¢¥É¥ì¥¹ÈϰϤËÂФ¹¤ë¥á¥â¥ê¥í¥Ã¥¯¤Ï¡¢¤½¤Î¥¢¥É¥ì¥¹ÈϰϤ¬ +.BR munmap (2) +¤Ë¤è¤Ã¤Æ¥¢¥ó¥Þ¥Ã¥×¤µ¤ì¤¿¾ì¹ç¤Ïºï½ü¤µ¤ì¤ë¡£ + +¥á¥â¥ê¤Î¥í¥Ã¥¯¤ÏÎßÀѤ·¤Ê¤¤¡£ +¤¹¤Ê¤ï¤ÁÊ£¿ô²ó +.BR mlock () +¤ä +.BR mlockall () +¤ò¸Æ¤Ó½Ð¤·¤Æ¥í¥Ã¥¯¤µ¤ì¤¿¥Ú¡¼¥¸¤Ç¤â¡¢ +Âбþ¤¹¤ëÈϰϤËÂФ·¤Æ +.BR munlock () +¤ò 1 ²ó¸Æ¤Ó½Ð¤·¤¿¤ê +.BR munlockall () +¤ò¸Æ¤Ó½Ð¤·¤¿¤ê¤¹¤ë¤À¤±¤Ç¥í¥Ã¥¯²ò½ü¤µ¤ì¤ë¡£ +Ê£¿ô¤Î¾ì½ê¤äÊ£¿ô¤Î¥×¥í¥»¥¹¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ë¥Ú¡¼¥¸¤Ï¡¢¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¾ì½ê¡¢ +°ì¤Ä¤Î¥×¥í¥»¥¹¤Ç¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¸Â¤ê¤Ï RAM ¤Ë»Ä¤ê³¤±¤ë¡£ +.SS Linux ¤Ç¤ÎÃí°Õ +Linux ¤Ç¤Ï¡¢ +.BR mlock () +¤È +.BR munlock () +¤Ï¼«Æ°Åª¤Ë +.I addr +¤òü¿ôÀÚ¤ê¼Î¤Æ¤Ë¤è¤ê°ìÈֶᤤ¥Ú¡¼¥¸¶­³¦¤Ø¤È´Ý¤á¤ë¡£ +¤·¤«¤· POSIX.1-2001 ¤Ï +.I addr +¤¬¥Ú¡¼¥¸¶­³¦¤Ë¹ç¤Ã¤Æ¤¤¤ë¤³¤È¤òÍ׵᤹¤ë¼ÂÁõ¤âµö¤·¤Æ¤¤¤ë¡£ +¤½¤Î¤¿¤á°Ü¿¢À­¤ò°Õ¿Þ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤­¤Á¤ó¤È¶­³¦¤Ë¹ç¤ï¤»¤¿Êý¤¬Îɤ¤¡£ +.SS À©¸Â¤È¸¢¸Â +Linux 2.6.8 °ÊÁ°¤Ç¤Ï¡¢¥á¥â¥ê¤ò¥í¥Ã¥¯¤¹¤ë¤¿¤á¤Ë¤ÏÆø¢ +.RB ( CAP_IPC_LOCK ) +¤¬É¬Íפǡ¢ +¥½¥Õ¥È»ñ¸»À©¸Â +.B RLIMIT_MEMLOCK +¤Ï¥×¥í¥»¥¹¤¬¤É¤ì¤À¤±¤Î¥á¥â¥ê¤ò¥í¥Ã¥¯¤Ç¤­¤ë¤«¤ÎÀ©¸Â¤òÄêµÁ¤¹¤ë¡£ + +Linux 2.6.9 °Ê¹ß¤Ç¤Ï¡¢Æø¢¤ò»ý¤Ä¥×¥í¥»¥¹¤¬¥í¥Ã¥¯¤Ç¤­¤ë¥á¥â¥êÎ̤Ï̵À©¸Â¤È¤Ê¤ê¡¢ +Âå¤ï¤ê¤Ë¥½¥Õ¥È»ñ¸»À©¸Â +.B RLIMIT_MEMLOCK +¤ÏÆø¢¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹¤¬¥í¥Ã¥¯¤Ç¤­¤ë¥á¥â¥êÎ̤ÎÀ©¸Â¤òÄêµÁ¤¹¤ë¡£ +.SH ¥Ð¥° +2.4.17 ¤Þ¤Ç¤Î 2.4 ¥·¥ê¡¼¥º¤Î Linux ¥«¡¼¥Í¥ë¤Ë¤Ï¡¢ +.BR mlockall () +.B MCL_FUTURE +¥Õ¥é¥°¤¬ +.BR fork (2) +¤Ç·Ñ¾µ¤µ¤ì¤ë¤È¸À¤¦¥Ð¥°¤¬¤¢¤ë¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ë 2.4.18 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ + +¥«¡¼¥Í¥ë 2.6.9 °Ê¹ß¤Ç¤Ï¡¢Æø¢¤ò»ý¤Ã¤¿¥×¥í¥»¥¹¤¬ +.I mlockall(MCL_FUTURE) +¤ò¸Æ¤Ó½Ð¤·¤¿¸å¤Ç¡¢Æø¢¤ò¤Ê¤¯¤·¤¿¾ì¹ç (Î㤨¤Ð¡¢ +¼Â¸ú UID ¤ò 0 °Ê³°¤ÎÃͤËÊѹ¹¤¹¤ë¤Ê¤É¤Ë¤è¤ê¡¢ +.B CAP_IPC_LOCK +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¼º¤Ã¤¿¾ì¹ç)¡¢¥ê¥½¡¼¥¹¾å¸Â +.B RLIMIT_MEMLOCK +¤Ë㤹¤ë¤È¡¢¤½¤ì°Ê¹ß¤Î¥á¥â¥ê³ä¤êÅö¤Æ (Î㤨¤Ð +.BR mmap (2), +.BR brk (2)) +¤Ï¼ºÇÔ¤¹¤ë¡£ +.\" LKML ¤Î°Ê²¼¤Î¥¹¥ì¥Ã¥É¤ò»²¾È: +.\" http://marc.theaimsgroup.com/?l=linux-kernel&m=113801392825023&w=2 +.\" "Rationale for RLIMIT_MEMLOCK" +.\" 23 Jan 2006 +.SH ´ØÏ¢¹àÌÜ +.BR mmap (2), +.BR setrlimit (2), +.BR shmctl (2), +.BR sysconf (3), +.BR capabilities (7) diff --git a/release/man2/mmap.2 b/release/man2/mmap.2 new file mode 100644 index 00000000..ebe7b87f --- /dev/null +++ b/release/man2/mmap.2 @@ -0,0 +1,687 @@ +.\" 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" +.SH ̾Á° +mmap, munmap \- ¥Õ¥¡¥¤¥ë¤ä¥Ç¥Ð¥¤¥¹¤ò¥á¥â¥ê¤Ë¥Þ¥Ã¥×/¥¢¥ó¥Þ¥Ã¥×¤¹¤ë +.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 +.SH ÀâÌÀ +.BR mmap () +¤Ï¡¢¿·¤·¤¤¥Þ¥Ã¥Ô¥ó¥°¤ò¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î²¾ÁÛ¥¢¥É¥ì¥¹¶õ´Ö¤ËºîÀ®¤¹¤ë¡£ +¿·¤·¤¤¥Þ¥Ã¥Ô¥ó¥°¤Î³«»Ï¥¢¥É¥ì¥¹¤Ï +.I addr +¤Ç»ØÄꤵ¤ì¤ë¡£¥Þ¥Ã¥Ô¥ó¥°¤ÎŤµ¤Ï +.I length +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤ë¡£ + +.I addr +¤¬ NULL ¤Î¾ì¹ç¡¢¥«¡¼¥Í¥ë¤¬¥Þ¥Ã¥Ô¥ó¥°¤òºîÀ®¤¹¤ë¥¢¥É¥ì¥¹¤òÁªÂò¤¹¤ë¡£ +¤³¤ÎÊýË¡¤ÏºÇ¤â°Ü¿¢À­¤Î¤¢¤ë¿·¤·¤¤¥Þ¥Ã¥Ô¥ó¥°¤ÎºîÀ®ÊýË¡¤Ç¤¢¤ë¡£ +.I addr +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢¥«¡¼¥Í¥ë¤Ï¥Þ¥Ã¥Ô¥ó¥°¤ò¤É¤³¤ËÇÛÃÖ¤¹¤ë¤«¤Î¥Ò¥ó¥È¤È¤·¤Æ +.I addr +¤ò»ÈÍѤ¹¤ë¡£Linux ¤Ç¤Ï¡¢¥Þ¥Ã¥Ô¥ó¥°¤Ï¤¹¤°¶á¤¯¤Î¥Ú¡¼¥¸¶­³¦¤ËºîÀ®¤µ¤ì¤ë¡£ +.\" Linux 2.6.24 ¤è¤êÁ°¤Ç¤Ï¡¢¥¢¥É¥ì¥¹¤Ï (¥¢¥É¥ì¥¹¤¬Â礭¤¯¤Ê¤ëÊý¸þ¤Ç) +.\" ¤¹¤°¼¡¤Î¥Ú¡¼¥¸¶­³¦¤ËÀÚ¤ê¾å¤²¤é¤ì¤Æ¤¤¤¿¡£ +.\" Linux 2.6.24 °Ê¹ß¤Ç¤Ï¡¢Àڤ겼¤²¤é¤ì¤ë! +¿·¤·¤¤¥Þ¥Ã¥Ô¥ó¥°¤Î¥¢¥É¥ì¥¹¤Ï¡¢¸Æ¤Ó½Ð¤·¤ÎÊÖ¤êÃͤȤ·¤ÆÊÖ¤µ¤ì¤ë¡£ + +¥Õ¥¡¥¤¥ë¥Þ¥Ã¥Ô¥ó¥°¤ÎÆâÍƤϡ¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë (¤â¤·¤¯¤Ï¾¤Î¥ª¥Ö¥¸¥§¥¯¥È) ¤Î¥ª¥Õ¥»¥Ã¥È +.I offset +¤«¤é³«»Ï¤µ¤ì¤ë +.I length +¥Ð¥¤¥È¤Î¥Ç¡¼¥¿¤Ç½é´ü²½¤µ¤ì¤ë +(¥Õ¥¡¥¤¥ë¥Þ¥Ã¥Ô¥ó¥°¤Ï̵̾¥Þ¥Ã¥Ô¥ó¥°¤ÎÈ¿Âиì¤Ç¤¢¤ë¡£ +.B MAP_ANONYMOUS +¤ò»²¾È)¡£ +.I offset +¤Ï +.I sysconf(_SC_PAGE_SIZE) +¤¬ÊÖ¤¹¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.LP +°ú¤­¿ô +.I prot +¤Ë¤Ï¡¢¥Þ¥Ã¥Ô¥ó¥°¤Î¥á¥â¥êÊݸî¤ò¤É¤Î¤è¤¦¤Ë¹Ô¤Ê¤¦¤«¤ò»ØÄꤹ¤ë +(¥Õ¥¡¥¤¥ë¤Î¥ª¡¼¥×¥ó¥â¡¼¥É¤ÈÌ·½â¤·¤Æ¤Ï¤¤¤±¤Ê¤¤)¡£ +.I prot +¤Ë¤Ï¡¢ +.B PROT_NONE +¤«¡¢°Ê²¼¤Î¥Õ¥é¥°¤ò¤Ò¤È¤Ä°Ê¾å¥Ó¥Ã¥ÈËè¤ÎÏÀÍýÏ (OR) ¤ò¤È¤Ã¤¿¤â¤Î¤ò +»ØÄê¤Ç¤­¤ë¡£ +.TP 1.1i +.B PROT_EXEC +¥Ú¡¼¥¸¤Ï¼Â¹Ô²Äǽ¤Ç¤¢¤ë¡£ +.TP +.B PROT_READ +¥Ú¡¼¥¸¤ÏÆɤ߹þ¤ß²Äǽ¤Ç¤¢¤ë¡£ +.TP +.B PROT_WRITE +¥Ú¡¼¥¸¤Ë½ñ¤­¹þ¤ß²Äǽ¤Ç¤¢¤ë¡£ +.TP +.B PROT_NONE +¥Ú¡¼¥¸¤Ë¤Ï¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¡£ +.LP +.I flags +°ú¤­¿ô¤Ë¤è¤ê¡¢¥Þ¥Ã¥Ô¥ó¥°¤ËÂФ¹¤ë¹¹¿·¤¬Æ±¤¸Îΰè¤ò¥Þ¥Ã¥Ô¥ó¥°¤·¤Æ¤¤¤ë +¾¤Î¥×¥í¥»¥¹¤Ë¸«¤¨¤ë¤«¡¢¹¹¿·¤¬¥Þ¥Ã¥Ô¥ó¥°¸µ¤Î¥Õ¥¡¥¤¥ë¤òÄ̤¸¤Æ +ÅÁ¤¨¤é¤ì¤ë¤«¡¢¤¬·èÄꤵ¤ì¤ë¡£¤³¤ÎÆ°ºî¤Ï¡¢°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤À¤± +(Ê£¿ô¤Ï»ØÄê¤Ç¤­¤Ê¤¤) ¤ò +.I flags +¤Ë´Þ¤á¤ë¤³¤È¤Ç»ØÄꤹ¤ë¡£ +.TP 1.1i +.B MAP_SHARED +¤³¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¶¦Í­¤¹¤ë¡£ +¥Þ¥Ã¥Ô¥ó¥°¤ËÂФ¹¤ë¹¹¿·¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò¥Þ¥Ã¥Ô¥ó¥°¤·¤Æ¤¤¤ë¾¤Î¥×¥í¥»¥¹ +¤«¤é¸«¤¨¤ë¡£¹¹¿·¤Ï¥Þ¥Ã¥Ô¥ó¥°¸µ¤Î¥Õ¥¡¥¤¥ë¤òÄ̤¸¤ÆÅÁ¤¨¤é¤ì¤ë¡£ +¤¿¤À¤·¡¢¥Õ¥¡¥¤¥ë¤Î¼ÂºÝ¤Î¹¹¿·¤Ï +.BR msync (2) +¤Þ¤¿¤Ï +.BR munmap () +¤¬¸Æ¤Ð¤ì¤ë¤Þ¤Ç¹Ô¤ï¤ì¤Ê¤¤¤³¤È¤â¤¢¤ë¡£ +.TP +.B MAP_PRIVATE +¥×¥é¥¤¥Ù¡¼¥È¤Ê copy-on-write (½ñ¤­¹þ¤ß»þ¥³¥Ô¡¼) ¥Þ¥Ã¥×¤òÀ¸À®¤¹¤ë¡£ +¥Þ¥Ã¥Ô¥ó¥°¤ËÂФ¹¤ë¹¹¿·¤ÏƱ¤¸¥Õ¥¡¥¤¥ë¤ò¥Þ¥Ã¥Ô¥ó¥°¤·¤Æ¤¤¤ë¾¤Î¥×¥í¥»¥¹ +¤Ë¤Ï¸«¤¨¤º¡¢¹¹¿·¤¬¥Þ¥Ã¥Ô¥ó¥°¸µ¤Î¥Õ¥¡¥¤¥ë¤òÄ̤¸¤ÆÅÁ¤¨¤é¤ì¤ë¤³¤È¤â¤Ê¤¤¡£ +.BR mmap () +¤Î¸Æ¤Ó½Ð¤·¸å¤Ë¥Þ¥Ã¥Ô¥ó¥°¸µ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¹Ô¤ï¤ì¤¿Êѹ¹¤¬¡¢ +¥Þ¥Ã¥×Îΰè¤ËÈ¿±Ç¤µ¤ì¤ë¤«¤É¤¦¤«¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.LP +¾åµ­¤ÎÆó¤Ä¤Î¥Õ¥é¥°¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +¤µ¤é¤Ë¡¢°Ê²¼¤ÎÃͤΤ¦¤Á 0 ¸Ä°Ê¾å¤ò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýÏ (OR) ¤Ç +.I flags +¤Ë»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR MAP_32BIT " (Linux 2.4.20, 2.6 °Ê¹ß)" +¥Þ¥Ã¥Ô¥ó¥°¤ò¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ÎÀèƬ 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 +.B MAP_ANONYMOUS +¤ÎƱµÁ¸ì¡£Èó¿ä¾©¡£ +.TP +.B MAP_ANONYMOUS +¥Þ¥Ã¥Ô¥ó¥°¤Ï¤É¤Î¥Õ¥¡¥¤¥ë¤È¤â´ØÏ¢ÉÕ¤±¤µ¤ì¤Ê¤¤¡£ +¥Þ¥Ã¥Ô¥ó¥°¤ÎÆâÍÆ¤Ï 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 +¤³¤Î¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë +.\" 1.1.36 ¤ÇƳÆþ¤µ¤ì¡¢1.3.24 ¤Çºï½ü¤µ¤ì¤¿¡£ +(¤º¤Ã¤ÈÁ°¤Ï¡¢¥Þ¥Ã¥×¸µ¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ß¤ò¹Ô¤ª¤¦¤È¤¹¤ë¤È¡¢¥¨¥é¡¼ +.B ETXTBUSY +¤Ç¼ºÇÔ¤¹¤ë¤è¤¦¤Ë¥·¥°¥Ê¥ë¤¬ÀßÄꤵ¤ì¤Æ¤¤¤¿¤¬¡¢¤³¤ì¤Ï denial-of-service +(¥µ¡¼¥Ó¥¹µñÈÝ) ¹¶·â¤Î¸¶°ø¤È¤Ê¤Ã¤¿)¡£ +.TP +.B MAP_EXECUTABLE +¤³¤Î¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë¡£ +.\" 1.1.38 ¤ÇƳÆþ¤µ¤ì¡¢1.3.24 ¤Çºï½ü¤µ¤ì¤¿¡£ +.\" proc_follow_link ¤Ç¥Æ¥¹¥È¤µ¤ì¤ë¥Õ¥é¥°¤Ç¤¢¤ë¡£(¤º¤Ã¤ÈÁ°¤Ï¡¢ +.\" ¥Þ¥Ã¥×¸µ¤Î¥Õ¥¡¥¤¥ë¤¬¼Â¹Ô²Äǽ¤Ç¤¢¤ë¤³¤È¤òÃΤ餻¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£ +.\" ¤·¤«¤·¡¢¤½¤Î¾ðÊó¤Ï¼ÂºÝ¤Ë¤Ï¤É¤³¤Ç¤â»È¤ï¤ì¤Ê¤«¤Ã¤¿¡£) +.\" Linus ¤Ï MAP_EXECUTABLE ¤Ë´ØÏ¢¤·¤Æ DoS ¤ÎÏäò¤·¤¿¤¬¡¢ +.\" MAP_DENYWRITE ¤Î¤³¤È¤ò¹Í¤¨¤Æ¤¤¤¿¤Î¤«¤Ê¡© +.TP +.B MAP_FILE +¸ß´¹À­¤Î¤¿¤á¤Î¥Õ¥é¥°¡£Ìµ»ë¤µ¤ì¤ë¡£ +.\" On some systems, this was required as the opposite of +.\" MAP_ANONYMOUS -- mtk, 1 May 2007 +.TP +.B MAP_FIXED +.I addr +¤ò¥¢¥É¥ì¥¹¤Î¥Ò¥ó¥È¤È¤·¤Æ»ÈÍѤ¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +.I addr +¤Ç»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤ò¤½¤Î¤Þ¤Þ»ÈÍѤ·¤Æ¥Þ¥Ã¥Ô¥ó¥°¤òÇÛÃÖ¤¹¤ë¡£ +.I addr +¤Ï¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I addr +¤È +.I len +¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥êÎΰ褬´û¸¤Î¥Þ¥Ã¥Ô¥ó¥°¤Î¥Ú¡¼¥¸¤È½Å¤Ê¤ë¾ì¹ç¡¢ +´û¸¤Î¥Þ¥Ã¥Ô¥ó¥°¤Î½Å¤Ê¤Ã¤¿Éôʬ¤Ï¼Î¤Æ¤é¤ì¤ë¡£ +¤â¤·»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤¬»ÈÍѤǤ­¤Ê¤¤¾ì¹ç¡¢ +.BR mmap () +¤Ï¼ºÇÔ¤¹¤ë¡£ +¥Þ¥Ã¥Ô¥ó¥°¤ËÂФ·¤Æ¸ÇÄꥢ¥É¥ì¥¹¤òÍ׵᤹¤ë¤Î¤Ï°Ü¿¢À­¤ÎÌ̤ÇÎô¤ë¤Î¤Ç¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï»ÈÍѤ·¤Ê¤¤¤³¤È¤ò¿ä¾©¤¹¤ë¡£ +.TP +.B MAP_GROWSDOWN +¥¹¥¿¥Ã¥¯ÍѤ˻ÈÍѤµ¤ì¤ë¡£¥Þ¥Ã¥Ô¥ó¥°¤ò¥á¥â¥êÆâ¤ÇµÕ¸þ¤­¤Ë¹Ô¤¦¤³¤È¤ò +¥«¡¼¥Í¥ë²¾ÁÛ¥á¥â¥ê¥·¥¹¥Æ¥à¤Ë»Ø¼¨¤¹¤ë¡£ +(ÌõÃí¡§¥Þ¥Ã¥Ô¥ó¥°¤ÏÄ̾ï¤Ï¥á¥â¥ê¡¦¥¢¥É¥ì¥¹¤¬Áý²Ã¤¹¤ë¸þ¤­¤Ë¹Ô¤¦¤¬¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤ÈµÕ¸þ¤­¤Ë¥Þ¥Ã¥Ô¥ó¥°¤ò¹Ô¤¦) +.TP +.BR MAP_HUGETLB " (Linux 2.6.32 °Ê¹ß)" +"huge page" ¤ò»È¤Ã¤Æ¥Þ¥Ã¥Ô¥ó¥°¤ò³ä¤êÅö¤Æ¤ë¡£ +¾Ü¤·¤¤¾ðÊó¤Ï¡¢¥«¡¼¥Í¥ë¡¦¥½¡¼¥¹¤Î +.I Documentation/vm/hugetlbpage.txt +¤ò»²¾È¡£ +.TP +.BR MAP_LOCKED " (Linux 2.5.37 °Ê¹ß)" +¥Þ¥Ã¥×¤µ¤ì¤¿Îΰè¤Î¥Ú¡¼¥¸¤ò +.BR mlock (2) +¤ÎÊýË¡¤Ç¥á¥â¥êÆâ¤Ë¥í¥Ã¥¯¤¹¤ë¡£ +¤½¤ì°ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Î¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë¡£ +.\" ¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤¿¥Ú¡¼¥¸¤Ï¥¹¥ï¥Ã¥×¥¢¥¦¥È +.\" ¤µ¤ì¤Ê¤¤¡£ +.TP +.BR MAP_NONBLOCK " (Linux 2.5.46 °Ê¹ß)" +.B MAP_POPULATE +¤ÈÁȤ߹ç¤ï¤»¤¿¾ì¹ç¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +read-ahead (Á°¤â¤Ã¤ÆÆɤ߹þ¤à¤³¤È) ¤ò¼Â¹Ô¤·¤Ê¤¤¡£ +ñ¤Ë¡¢¤¹¤Ç¤Ë RAM ¾å¤Ë¸ºß¤¹¤ë¥Ú¡¼¥¸¤ËÂФ·¤Æ +¥Ú¡¼¥¸¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¤òºîÀ®¤¹¤ë¤À¤±¤Ç¤¢¤ë¡£ +Linux 2.6.23 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¥Õ¥é¥°¤Ï +.B MAP_POPULATE +¤Ë²¿¤Î±Æ¶Á¤âÍ¿¤¨¤Ê¤¤¡£ +¤¤¤Ä¤« +.B MAP_POPULATE +¤È +.B MAP_NONBLOCK +¤òÁȤ߹ç¤ï¤»¤¿¾ì¹ç¤ÎÆ°ºî¤Ï¼ÂÁõ¤·Ä¾¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.B MAP_NORESERVE +¤³¤Î¥Þ¥Ã¥Ô¥ó¥°¤ËÂФ¹¤ë¥¹¥ï¥Ã¥×¶õ´Ö¤ÎͽÌó¤ò¹Ô¤ï¤Ê¤¤¡£ +¥¹¥ï¥Ã¥×¶õ´Ö¤òͽÌó¤·¤¿¾ì¹ç¤Ï¡¢¤³¤Î¥Þ¥Ã¥Ô¥ó¥°¤ÎÊѹ¹¤¬É¬¤º²Äǽ¤Ê¤³¤È¤¬ +Êݾڤµ¤ì¤ë¡£Í½Ìó¤ò¹Ô¤ï¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ÊªÍý¥á¥â¥ê¤Ë¶õ¤­¤¬¤Ê¤¤¤È +½ñ¤­¹þ¤ß»þ¤Ë +.B SIGSEGV +¥¨¥é¡¼¤ò¼õ¤±¼è¤ë¤³¤È¤¬¤¢¤ë¡£ +.BR proc (5) +¤Î +.I /proc/sys/vm/overcommit_memory +¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤â»²¾È¡£ +¥Ð¡¼¥¸¥ç¥ó 2.6 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Î¥Õ¥é¥°¤Ï½ñ¤­¹þ¤ß²Äǽ¤Ê +¥×¥é¥¤¥Ù¡¼¥È¡¦¥Þ¥Ã¥Ô¥ó¥°¤Ë¤Ä¤¤¤Æ¤Î¤ß¸ú²Ì¤¬¤¢¤Ã¤¿¡£ +.TP +.BR MAP_POPULATE " (Linux 2.5.46 °Ê¹ß)" +¥Þ¥Ã¥Ô¥ó¥°ÍѤΥڡ¼¥¸¥Æ¡¼¥Ö¥ë¤òÇÛÃÖ (populate) ¤¹¤ë +¥Õ¥¡¥¤¥ë¥Þ¥Ã¥Ô¥ó¥°¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤ì¤Ë¤è¤ê¥Õ¥¡¥¤¥ë¤¬ÀèÆÉ¤ß (read-ahead) +¤¬¹Ô¤ï¤ì¤ë¡£¤³¤Î°Ê¸å¤Ï¡¢¥Þ¥Ã¥Ô¥ó¥°¤ËÂФ¹¤ë¥¢¥¯¥»¥¹¤¬¥Ú¡¼¥¸¥Õ¥©¡¼¥ë¥È¤Ç +¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¤³¤È¤¬¤Ê¤¯¤Ê¤ë¡£ +.BR MAP_POPULATE +¤Ï Linux 2.6.23 °Ê¹ß¤Ç¥×¥é¥¤¥Ù¡¼¥È¡¦¥Þ¥Ã¥Ô¥ó¥°¤Ë¤Ä¤¤¤Æ¤Î¤ß +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +¾åµ­¤Î¥Õ¥é¥°¤ÎÃæ¤Ç¤Ï¡¢ +.B MAP_FIXED +¤À¤±¤¬ POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤Ç +.B MAP_ANONYMOUS +(¤Þ¤¿¤Ï¤½¤ÎƱµÁ¸ì¤Ç¤¢¤ë +.BR MAP_ANON ) +¤â¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.BR MAP_STACK " (Linux 2.6.27 °Ê¹ß)" +¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤Î¥¹¥¿¥Ã¥¯¤ËŬ¤·¤¿¥¢¥É¥ì¥¹¤Ë¥Þ¥Ã¥Ô¥ó¥°¤ò³ä¤êÅö¤Æ¤ë¡£ +¸½ºß¤Î¤È¤³¤í¡¢¤³¤Î¥Õ¥é¥°¤Ï²¿¤â¤·¤Ê¤¤¤¬¡¢ +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 +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¾åµ­°Ê³°¤Ë¥Õ¥é¥°¤È¤·¤Æ +.BR MAP_AUTOGROW , +.BR MAP_AUTORESRV , +.BR MAP_COPY , +.B MAP_LOCAL +¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.LP +.BR mmap () +¤Ë¤è¤Ã¤Æ¥Þ¥Ã¥×¤µ¤ì¤¿¥á¥â¥ê¤Î°À­¤Ï +.BR fork (2) +¤ÎºÝ¤Ë·Ñ¾µ¤µ¤ì¤ë¡£ +.LP +¥Õ¥¡¥¤¥ë¤Ï¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÀ°¿ôÇܤÎÎΰè¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¡£¥µ¥¤¥º¤¬¥Ú¡¼¥¸¥µ¥¤¥º¤Î +À°¿ôÇܤǤʤ¤¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¢¥Þ¥Ã¥×»þ¤Ë»Ä¤ê¤ÎÎΰè¤Ï 0 ¤ÇËä¤á¤é¤ì¡¢¤³¤ÎÎΰè¤Ø +½ñ¤­¤³¤ß¤ò¹Ô¤Ã¤Æ¤â¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£¥Þ¥Ã¥Ô¥ó¥°¤ò¹Ô¤Ã¤¿¸µ +¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤òÊѹ¹¤·¤¿¾ì¹ç¡¢¸µ¥Õ¥¡¥¤¥ë¤ÎÄɲ䵤줿¤êºï½ü¤µ¤ì¤¿Îΰè¤ËÂбþ +¤¹¤ë¥Þ¥Ã¥×¤µ¤ì¤¿¥Ú¡¼¥¸¤ËÂФ·¤Æ¤É¤Î¤è¤¦¤Ê±Æ¶Á¤¬¤¢¤ë¤«¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SS munmap() +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR munmap () +¤Ï»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹ÈϰϤΥޥåפò¾Ãµî¤·¡¢ +¤³¤ì°Ê¹ß¤Î¤½¤ÎÈÏ°ÏÆâ¤Ø¤Î¥á¥â¥ê»²¾È¤ÏÉÔÀµ¤È¤Ê¤ë¡£ +¤³¤ÎÎΰè¤Ï¡¢¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¤È¤­¤Ë¤â¼«Æ°Åª¤Ë¥¢¥ó¥Þ¥Ã¥×¤µ¤ì¤ë¡£ +°ìÊý¡¢¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤ò¥¯¥í¡¼¥º¤·¤Æ¤â¡¢¤³¤ÎÎΰè¤Ï¥¢¥ó¥Þ¥Ã¥×¤µ¤ì¤Ê¤¤¡£ +.LP +.I addr +¥¢¥É¥ì¥¹¤Ï¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÀ°¿ôÇܤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£»ØÄꤵ¤ì¤¿ÈϰϤΰìÉôʬ¤ò +´Þ¤àÁ´¤Æ¤Î¥Ú¡¼¥¸¤Ï¥¢¥ó¥Þ¥Ã¥×¤µ¤ì¡¢¤³¤ì°Ê¹ß¤Ë¤³¤ì¤é¤Î¥Ú¡¼¥¸¤Ø¤Î»²¾È¤¬¤¢¤ë¤È +.B SIGSEGV +¤¬È¯À¸¤¹¤ë¡£ +»ØÄꤷ¤¿ÈÏ°ÏÆâ¤Ë¥Þ¥Ã¥×¤µ¤ì¤¿¥Ú¡¼¥¸¤¬°ì¤Ä¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤â +¥¨¥é¡¼¤Ë¤Ê¤é¤Ê¤¤¡£ +.SS ¥Õ¥¡¥¤¥ë¤È´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Þ¥Ã¥Ô¥ó¥°¤ËÂФ¹¤ë¥¿¥¤¥à¥¹¥¿¥ó¥×¤Î¹¹¿· +¥Õ¥¡¥¤¥ë¤È´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Þ¥Ã¥Ô¥ó¥°¤Î¾ì¹ç¡¢¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î +.I st_atime +¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +.BR mmap () +¤µ¤ì¤Æ¤«¤é¥¢¥ó¥Þ¥Ã¥× (unmap) ¤µ¤ì¤ë¤Þ¤Ç¤Î´Ö¤Ë¹¹¿·¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +¤½¤ì¤Þ¤Ç¤Ë¹¹¿·¤¬¹Ô¤ï¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¥Þ¥Ã¥×¤µ¤ì¤¿¥Ú¡¼¥¸¤Ø¤ÎºÇ½é¤Î»²¾È¤¬¤¢¤Ã¤¿ +ºÝ¤Ë¹¹¿·¤µ¤ì¤ë¡£ +.LP +.B PROT_WRITE +¤È +.B MAP_SHARED +¤ÎξÊý¤ò»ØÄꤷ¤Æ¥Þ¥Ã¥×¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¢½ñ¤­¹þ¤ß¤¬¤¢¤ë¤È¡¢ +.I st_ctime +¤È +.I st_mtime +¤Îξ¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥Þ¥Ã¥×¤µ¤ì¤¿Îΰè¤Ø¤Î½ñ¤­¹þ¤ß¤è¤ê¸å¤Ç¡¢ +.B MS_SYNC +¤Þ¤¿¤Ï +.B MS_ASYNC +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ +.BR msync (2) +¤¬¸Æ¤Ð¤ì¤ëÁ°¤Þ¤Ç¤Ë¹¹¿·¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR mmap () +¤ÏÀ®¸ù¤¹¤ë¤È¥Þ¥Ã¥×¤µ¤ì¤¿Îΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤ÈÃÍ +.B MAP_FAILED +(¤Ä¤Þ¤ê +.IR "(void\ *)\ \-1" ) +¤òÊÖ¤·¡¢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤˤ·¤¿¤¬¤Ã¤Æ¥»¥Ã¥È¤µ¤ì¤ë¡£ +.BR munmap () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤¹¤ë¤È \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬¥»¥Ã¥È¤µ¤ì¤ë (¿¤¯¤Î¾ì¹ç +.B EINVAL +¤Ë¤Ê¤ë¤À¤í¤¦)¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +°Ê²¼¤Î¤¤¤º¤ì¤«¤Î¾ì¹ç¡£ +¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Î»²¾ÈÀ褬Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤Ï¤Ê¤¤ (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 +¥Õ¥¡¥¤¥ë¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¡£¤Þ¤¿¤Ï¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¥á¥â¥ê¤¬Â¿¤¹¤®¤ë +.RB ( setrlimit (2) +¤ò»²¾È)¡£ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ëµ­½Ò»Ò (file descriptor) ¤Ç¤Ï¤Ê¤¤ +(¤«¤Ä +.B MAP_ANONYMOUS +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤)¡£ +.TP +.B EINVAL +.I addr +¤« +.I length +¤« +.I offset +¤¬Å¬ÀڤǤʤ¤ +(Î㤨¤Ð¡¢Â礭¤¹¤®¤ë¤È¤«¡¢¥Ú¡¼¥¸¶­³¦¤Ë¥¢¥é¥¤¥ó¥á¥ó¥È¤µ¤ì¤Æ¤¤¤Ê¤¤)¡£ +.TP +.B EINVAL +(Linux 2.6.12 °Ê¹ß) +.I length +¤¬ 0 ¤Ç¤¢¤Ã¤¿¡£ +.TP +.B EINVAL +.I flags +¤Ë +.B MAP_PRIVATE +¤È +.B MAP_SHARED +¤Î¤É¤Á¤é¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡¢¤â¤·¤¯¤Ï +¤½¤ÎξÊý¤¬´Þ¤Þ¤ì¤Æ¤¤¤¿¡£ +.TP +.B ENFILE +.\" ¤³¤ì¤Ï¶¦Í­Æ¿Ì¾ (anonymous) ¥»¥°¥á¥ó¥È¤Î¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.\" [2.6.7] shmem_zero_setup()-->shmem_file_setup()-->get_empty_filp() +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥à¤ÎÀ©¸Â¤Ë㤷¤¿¡£ +.\" .TP +.\" .B ENOEXEC +.\" ¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤ßÍѤ˥ޥåפǤ­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENODEV +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥á¥â¥ê¥Þ¥Ã¥Ô¥ó¥°¤ò¥µ¥Ý¡¼¥È +¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOMEM +¥á¥â¥ê¤Ë¶õ¤­¤¬¤Ê¤¤¡¢¤Þ¤¿¤Ï½èÍýÃæ¤Î¥×¥í¥»¥¹¤Î¥Þ¥Ã¥Ô¥ó¥°¿ô¤¬ºÇÂç¿ô¤òĶ²á¤·¤¿¡£ +.TP +.B EPERM +.I prot +°ú¤­¿ô¤Ï +.B PROT_EXEC +¤ò¹Ô¤¦¤è¤¦¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¤¬¡¢ +no-exec ¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤Ë +¥Þ¥Ã¥×Îΰ褬Âбþ¤·¤Æ¤¤¤ë¡£ +.\" (2.4.25 / 2.6.0 °Ê¹ß) +.TP +.B ETXTBSY +.B MAP_DENYWRITE +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤¬ +.I fd +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ï½ñ¤­¹þ¤ßÍѤ˳«¤«¤ì¤Æ¤¤¤ë¡£ +.LP +¥Þ¥Ã¥×Îΰè¤òÍøÍѤ¹¤ëºÝ¤Ë¡¢°Ê²¼¤Î¥·¥°¥Ê¥ë¤¬È¯À¸¤¹¤ë¤³¤È¤¬¤¢¤ë: +.TP +.B SIGSEGV +Æɤ߹þ¤ßÀìÍÑ¤Ç mmap ¤µ¤ì¤¿Îΰè¤Ø½ñ¤­¹þ¤ß¤ò¹Ô¤ª¤¦¤È¤·¤¿¡£ +.TP +.B SIGBUS +¥Ð¥Ã¥Õ¥¡¤Î¤¦¤Á¡¢¥Õ¥¡¥¤¥ë¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤Ê¤¤Éôʬ +(Î㤨¤Ð¥Õ¥¡¥¤¥ëËöÈø¤ò±Û¤¨¤¿Éôʬ¤Ê¤É¡£¤³¤ì¤Ë¤Ï +¾¤Î¥×¥í¥»¥¹¤¬¥Õ¥¡¥¤¥ë¤òÀÚ¤êµÍ¤á¤¿¾ì¹ç¤Ê¤É¤â´Þ¤Þ¤ì¤ë) +¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤¿¡£ +.SH ½àµò +SVr4, 4.4BSD, POSIX.1-2001. +.\" SVr4 ¤Ë¤Ï¤µ¤é¤Ë ENXIO ¤È ENODEV ¤Î¥¨¥é¡¼¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.\" SUSv2 ¤Ë¤Ï¤µ¤é¤Ë EMFILE ¤È EOVERFLOW ¤Î¥¨¥é¡¼¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.SH ²ÄÍÑÀ­ +.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 ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +¥«¡¼¥Í¥ë 2.4 °Ê¹ß¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.BR mmap2 (2) +¤Ë¼è¤Ã¤ÆÂå¤ï¤é¤ì¤¿¡£ +¸½ºß¤Ç¤Ï¡¢ +.\" ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ë¤è¤ê°Û¤Ê¤ë¤¬¡¢ glibc 2.1/2.2 ¤¢¤¿¤ê¤«¤é¡£ +glibc ¤Î +.BR mmap () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï +.I offset +¤òŬÀÚ¤ËÄ´À°¤·¤Æ¤«¤é +.BR mmap2 (2) +¤òµ¯Æ°¤¹¤ë¡£ + +(i386 ¤Ê¤É¤Î) ¤¤¤¯¤Ä¤«¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢ +.B PROT_WRITE +¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢°ÅÌۤΤ¦¤Á¤Ë +.B PROT_READ +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.B PROT_READ +¤ò¥»¥Ã¥È¤·¤¿ºÝ¤Ë°ÅÌۤΤ¦¤Á¤Ë +.B PROT_EXEC +¤¬¥»¥Ã¥È¤µ¤ì¤ë¤«¤É¤¦¤«¤Ï¡¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã°Í¸¤Ç¤¢¤ë¡£ +°Ü¿¢À­¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +¿·µ¬¤Ë¥Þ¥Ã¥×¤·¤¿Îΰè¤Ç¥³¡¼¥É¤ò¼Â¹Ô¤·¤¿¤¤¾ì¹ç¤Ï¡¢¾ï¤Ë +.B PROT_EXEC +¤ò¥»¥Ã¥È¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +¥Þ¥Ã¥Ô¥ó¥°¤òºîÀ®¤¹¤ë°Ü¿¢À­¤Î¤¢¤ëÊýË¡¤Ï¡¢ +.I addr +¤Ë 0 (NULL) ¤ò»ØÄꤷ¡¢ +.I flags +¤«¤é +.B MAP_FIXED +¤ò³°¤¹¤³¤È¤Ç¤¢¤ë¡£ +¤³¤Î¾ì¹ç¡¢¥·¥¹¥Æ¥à¤¬¥Þ¥Ã¥Ô¥ó¥°ÍѤΥ¢¥É¥ì¥¹¤ÎÁªÂò¤ò¹Ô¤¦¡£ +¥¢¥É¥ì¥¹¤Ï´û¸¤Î¥Þ¥Ã¥Ô¥ó¥°¤È¾×Æͤ·¤Ê¤¤¤è¤¦¤Ë¡¢ +¤«¤Ä 0 ¤Ë¤Ê¤é¤Ê¤¤¤è¤¦¤ËÁªÂò¤µ¤ì¤ë¡£ +.B MAP_FIXED +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¡¢¤«¤Ä +.I addr +¤¬ 0 (NULL) +¤Î¾ì¹ç¤Ë¤Ï¡¢¥Þ¥Ã¥×¤µ¤ì¤ë¥¢¥É¥ì¥¹¤¬ 0 (NULL) ¤Ë¤Ê¤ë¡£ +.SH ¥Ð¥° +Linux ¤Ë¤ª¤¤¤Æ¤Ï¡¢¾åµ­¤Î +.B MAP_NORESERVE +¤Ç½Ò¤Ù¤é¤ì¤Æ¤¤¤ë¤è¤¦¤ÊÊݾڤϤʤ¤¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥·¥¹¥Æ¥à¤¬¥á¥â¥ê¤ò»È¤¤Àڤ俾ì¹ç¤Ë¤Ï¡¢ +¤É¤Î¥×¥í¥»¥¹¤¬¤¤¤Ä¶¯À©½ªÎ»¤µ¤ì¤ë¤«Ê¬¤«¤é¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ + +2.6.7 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.I prot +¤Ë +.B PROT_NONE +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Î¤ß¡¢ +.B MAP_POPULATE +¥Õ¥é¥°¤¬¸úÎϤò»ý¤Ä¡£ + +SUSv3 ¤Ç¤Ï¡¢ +.I length +¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR mmap () +¤Ï¼ºÇÔ¤¹¤ë¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£¤·¤«¤·¤Ê¤¬¤é¡¢2.6.12 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¤³¤Î¾ì¹ç¤Ë +.BR mmap () +¤ÏÀ®¸ù¤·¤Æ¤¤¤¿ (¥Þ¥Ã¥Ô¥ó¥°¤ÏºîÀ®¤µ¤ì¤º¡¢ +.I addr +¤¬ÊÖ¤µ¤ì¤Æ¤¤¤¿)¡£ +¥«¡¼¥Í¥ë 2.6.12 °Ê¹ß¤Ç¤Ï¡¢ +.BR mmap () +¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.SH Îã +.\" FIXME . Add an example here that uses an anonymous shared region for +.\" IPC between parent and child. +.PP +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢°ìÈÖÌܤΥ³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿ +¥Õ¥¡¥¤¥ë¤Î°ìÉô¤òɸ½à½ÐÎϤËɽ¼¨¤¹¤ë¡£ +ɽ¼¨¤¹¤ëÈϰϤϡ¢ÆóÈÖÌÜ¡¢»°ÈÖÌܤΥ³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ÇÅϤµ¤ì¤ë +¥ª¥Õ¥»¥Ã¥È¤ÈŤµ¤Ç»ØÄꤵ¤ì¤ë¡£ +¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ÎɬÍפʥڡ¼¥¸¤Î¥á¥â¥ê¡¦ +¥Þ¥Ã¥Ô¥ó¥°¤òºîÀ®¤·¡¢ +.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. +.\" +.\" »ä¤Î¸å¤Ë¤Ä¤¤¤Æ¸À¤Ã¤Æ¤ß¤Æ: ¥×¥é¥¤¥Ù¡¼¥È¤ÊÆɤ߹þ¤ßÀìÍÑ¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ï +.\" ¶¦Í­¤µ¤ì¤¿Æɤ߹þ¤ßÀìÍÑ¤Î¥Þ¥Ã¥Ô¥ó¥°¤È 100% Åù¤·¤¤¡£ +.\" ¡Ö¤â¤·¡×¤â¡Ö¤·¤«¤·¡×¤â¡Ö¤¿¤Ö¤ó¡×¤â¤Ê¤¤¡£-- Linus diff --git a/release/man2/mmap2.2 b/release/man2/mmap2.2 new file mode 100644 index 00000000..d46f507d --- /dev/null +++ b/release/man2/mmap2.2 @@ -0,0 +1,106 @@ +.\" 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" +.SH ̾Á° +mmap2 \- ¥Õ¥¡¥¤¥ë¤ä¥Ç¥Ð¥¤¥¹¤ò¥á¥â¥ê¤Ë¥Þ¥Ã¥×¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *mmap2(void *" addr ", size_t " length ", int " prot , +.BI " int " flags ", int " fd ", off_t " pgoffset ); +.fi +.SH ÀâÌÀ +.BR mmap2 () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.BR mmap (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ +¤¿¤À¤·ºÇ¸å¤Î°ú¤­¿ô¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤Î¥ª¥Õ¥»¥Ã¥È¤ò +.RB ( mmap (2) +¤¬¹Ô¤Ã¤Æ¤¤¤ë¡¢¥Ð¥¤¥Èñ°Ì¤Ç¤Ï¤Ê¤¯) +4096 ¥Ð¥¤¥È¤òñ°Ì¤È¤·¤Æ»ØÄꤹ¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢32 ¥Ó¥Ã¥È¤Î +.I off_t +¤ò»È¤¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç (2^44 ¥Ð¥¤¥È¤Þ¤Ç¤Î) +Â礭¤Ê¥Õ¥¡¥¤¥ë¤ò¥Þ¥Ã¥×¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR mmap2 () +¤Ï¥Þ¥Ã¥×¤µ¤ì¤¿Îΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +¥æ¡¼¥¶¶õ´Ö¤«¤é¥Ç¡¼¥¿¤ò¼èÆÀ¤¹¤ë¤È¤­¤ËÌäÂ꤬¤¢¤Ã¤¿¡£ +.TP +.B EINVAL +(¥Ú¡¼¥¸¥µ¥¤¥º¤¬ 4096 ¥Ð¥¤¥È¤Ç¤Ê¤¤¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ë¤ª¤¤¤Æ) +.I offset * 4096 +¤¬¥·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ï¤Ê¤¤¡£ +.PP +.BR mmap2 () +¤Ï +.BR mmap (2) +¤ÈƱ¤¸¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR mmap2 () +¤Ï¡¢Linux 2.3.31 °Ê¹ß¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¸½ºß¤Ç¤Ï¡¢glibc ¤Î +.BR mmap () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢ +.BR mmap (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤Ï¤Ê¤¯¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë +.RB ( mmap2 (2)) +¤òµ¯Æ°¤¹¤ë¡£ + +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 +.SH ´ØÏ¢¹àÌÜ +.BR getpagesize (2), +.BR mmap (2), +.BR mremap (2), +.BR msync (2), +.BR shm_open (3) diff --git a/release/man2/modify_ldt.2 b/release/man2/modify_ldt.2 new file mode 100644 index 00000000..b2a081cc --- /dev/null +++ b/release/man2/modify_ldt.2 @@ -0,0 +1,147 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@duracef.shout.net), 22 July 1995. +.\" +.\" 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 & Modified 2005-02-24, Yuichi SATO +.\" Updated 2007-06-18, Akihiro MOTOKI , LDP v2.57 +.\" +.\"WORD: ldt ldt +.\"WORD: local descriptor table ¥í¡¼¥«¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Æ¡¼¥Ö¥ë +.\"WORD: processer ¥×¥í¥»¥Ã¥µ +.\"WORD: entry ¥¨¥ó¥È¥ê +.\" +.TH MODIFY_LDT 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +modify_ldt \- ldt ¤òÀßÄê¤Þ¤¿¤Ï¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int modify_ldt(int " "func" ", void *" "ptr" ", unsigned long " "bytecount" ); +.fi +.SH ÀâÌÀ +.BR modify_ldt () +¤Ï¥×¥í¥»¥¹¤Î¥í¡¼¥«¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Æ¡¼¥Ö¥ë (local descriptor table; ldt) +¤òÆɤ߽ñ¤­¤¹¤ë¡£ +ldt ¤Ï i386 ¥×¥í¥»¥Ã¥µ¤Ç»ÈÍѤµ¤ì¤ë¥×¥í¥»¥¹¤´¤È¤Î¥á¥â¥ê´ÉÍý¥Æ¡¼¥Ö¥ë¤Ç¤¢¤ë¡£ +¤³¤Î¥Æ¡¼¥Ö¥ë¤Ë´Ø¤·¤Æ¤Î¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï Intel 386 processor handbook ¤ò +»²¾È¤¹¤ë¤³¤È¡£ +.PP +.I func +¤¬ 0 ¤Ê¤é¤Ð¡¢ +.BR modify_ldt () +¤Ï ldt ¤ò +.I ptr +¤¬»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤ËÆɤ߹þ¤à¡£ +Æɤ߹þ¤à¥Ð¥¤¥È¿ô¤Ï¼ÂºÝ¤Î ldt ¤Î¥µ¥¤¥º¤« +.I bytecount +¤è¤ê¾®¤µ¤¤Êý¤Ç¤¢¤ë¡£ +.PP +.I func +¤¬ 1 ¤Ê¤é¤Ð¡¢ +.BR modify_ldt () +¤Ï ldt ¥¨¥ó¥È¥ê¤Î°ì¤Ä¤òÊѹ¹¤¹¤ë¡£ +.I ptr +¤Ï +.I user_desc +¹½Â¤ÂΤò»Ø¤·¡¢ +.I bytecount +¤Ï¤³¤Î¹½Â¤ÂΤÎÂ礭¤µ¤ËÅù¤·¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" +.\" FIXME ? say something about func == 2 ans func == 0x11? +.\" In Linux 2.4, func == 2 returned "the default ldt" +.\" In Linux 2.6, func == 2 is a nop, returning a zeroed out structure. +.\" Linux 2.4 and 2.6 implement an operation for func == 0x11 + +.I user_desc +¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +struct user_desc { + unsigned int entry_number; + unsigned long base_addr; + unsigned int limit; + unsigned int seg_32bit:1; + unsigned int contents:2; + unsigned int read_exec_only:1; + unsigned int limit_in_pages:1; + unsigned int seg_not_present:1; + unsigned int useable:1; +}; +.fi +.in +.PP +Linux 2.4 °ÊÁ°¤Ç¤Ï¡¢¤³¤Î¹½Â¤ÂÎ¤Ï +.I modify_ldt_ldt_s +¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤Ã¤¿¡£ +.\" .PP +.\" ldt ¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.\" ¾¤Î¥×¥í¥»¥¹¤ä¥«¡¼¥Í¥ë¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ò´Þ¤à¤è¤¦¤Ë ldt ¤òÊѹ¹¤·¤è¤¦¤¹¤ë¤È¡¢ +.\" ¥×¥í¥»¥¹¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Î¥á¥â¥ê¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤¿¤È¤­¤Ë¡¢ +.\" ¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó°ãÈ¿ (segmentation violation) ¤Ë¤Ê¤ë¡£ +.\" ¥á¥â¥êÊݸî¤Ï¥Ú¡¼¥¸¥ó¥°¥ì¥¤¥ä¤Ç¼Â»Ü¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¡¢ +.BR modify_ldt () +¤Ï (Æɤ߹þ¤ß¤Î¾ì¹ç¤Ï) ¼ÂºÝ¤ËÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¡¢ +¤Þ¤¿¤Ï (½ñ¤­¹þ¤ß¤Î¾ì¹ç¤Ï) 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï +.BR modify_ldt () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I ptr +¤¬¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I ptr +¤¬ 0 ¤Ç¤¢¤ë¡¢ +¤Þ¤¿¤Ï +.I func +¤¬ 1 ¤Ç +.I bytecount +¤¬ +.I modify_ldt_ldt_s +¹½Â¤ÂΤΥµ¥¤¥º¤ÈÅù¤·¤¯¤Ê¤¤¤«¡¢ +.I func +¤¬ 1 ¤Ç¿·¤·¤¤ ldt ¥¨¥ó¥È¥ê¤¬Ìµ¸ú¤ÊÃͤǤ¢¤ë¡£ +.TP +.B ENOSYS +.I func +¤¬ 0 ¤Ç¤â 1 ¤Ç¤â¤Ê¤¤¡£ +.SH ½àµò +¤³¤Î¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR vm86 (2) diff --git a/release/man2/mount.2 b/release/man2/mount.2 new file mode 100644 index 00000000..0b4fefb6 --- /dev/null +++ b/release/man2/mount.2 @@ -0,0 +1,491 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1993 Rickard E. Faith +.\" and Copyright (C) 1994 Andries E. Brouwer +.\" and Copyright (C) 2002, 2005 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 1996-11-04 by Eric S. Raymond +.\" Modified 2001-10-13 by Michael Kerrisk +.\" Added note on historical behavior of MS_NOSUID +.\" Modified 2002-05-16 by Michael Kerrisk +.\" Extensive changes and additions +.\" Modified 2002-05-27 by aeb +.\" Modified 2002-06-11 by Michael Kerrisk +.\" Enhanced descriptions of MS_MOVE, MS_BIND, and MS_REMOUNT +.\" Modified 2004-06-17 by Michael Kerrisk +.\" 2005-05-18, mtk, Added MNT_EXPIRE, plus a few other tidy-ups. +.\" 2008-10-06, mtk: move umount*() material into separate umount.2 page. +.\" 2008-10-06, mtk: Add discussion of namespaces. +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated 1997-06-26,SUTO, Mitsuaki +.\" Updated 2001-05-20, Kentaro Shirakata +.\" Updated 2001-06-25, Kentaro Shirakata +.\" Updated 2001-10-15, Kentaro Shirakata +.\" Updated 2002-01-01, Kentaro Shirakata +.\" Updated 2002-11-24, Kentaro Shirakata +.\" Updated 2003-01-27, Kentaro Shirakata +.\" Updated 2005-02-28, Akihiro MOTOKI +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2006-07-23, Akihiro MOTOKI, LDP v2.36 +.\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-11-10, Akihiro MOTOKI, LDP v3.11 +.\" Updated 2010-04-23, Akihiro MOTOKI, LDP v3.24 +.\" +.\"WORD: lazy umount Ãٱ䥢¥ó¥Þ¥¦¥ó¥È +.\"WORD: Linux-specific Linux ÆÃÍ­ +.\" +.\" motoki 2005-02-28: +.\" - subtree ¤ò¤É¤¦Ìõ¤¹¤«¡£ÉôʬÌÚ¡¢Éôʬ¥Ä¥ê¡¼¡¢¥µ¥Ö¥Ä¥ê¡¼¡£¡£¡£²¿¤«¤Ê¤¤¤«¡£ +.\" +.TH MOUNT 2 2009-06-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mount \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥Þ¥¦¥ó¥È/¥¢¥ó¥Þ¥¦¥ó¥È¤¹¤ë +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int mount(const char *" source ", const char *" target , +.BI " const char *" filesystemtype ", unsigned long " mountflags , +.BI " const void *" data ); +.fi +.SH ÀâÌÀ +.BR mount () +¤Ï +.I source +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à (¥Ç¥Ð¥¤¥¹Ì¾¤Ç¤¢¤ë¤³¤È¤¬Â¿¤¤¤¬¡¢ +¥Ç¥£¥ì¥¯¥È¥ê̾¤ä¥À¥ß¡¼¤Î¾ì¹ç¤â¤¢¤ë) ¤ò +.I target +¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë·ë¤Ó¤Ä¤±¤ë¡£ + +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¤ò¹Ô¤¦¤Ë¤Ï¡¢ +ŬÀڤʸ¢¸Â (Linux ¤Ç¤Ï +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤¬É¬ÍפǤ¢¤ë¡£ + +Linux 2.4 °Ê¹ß¡¢¤Ò¤È¤Ä¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÊ£¿ô¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë +·ë¤Ó¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¡¢Æ±¤¸¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ËÊ£¿ô¤Î¥Þ¥¦¥ó¥È¤ò¥¹¥¿¥Ã¥¯ +¤µ¤»¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.\" Multiple mounts on same mount point: since 2.3.99pre7. + +°ú¤­¿ô +.I filesystemtype +¤È¤·¤Æ¥«¡¼¥Í¥ë¤¬Âбþ¤·¤Æ¤¤¤ëÃͤϡ¢ +.I /proc/filesystems +¤Ç»²¾È¤Ç¤­¤ë (Î㤨¤Ð "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", +"msdos", "proc", "nfs", "iso9660" Åù)¡£ +ŬÀڤʥ⥸¥å¡¼¥ë¤¬Æɤ߹þ¤Þ¤ì¤ë¤È¡¢¤µ¤é¤ËÊ̤ÎÃͤ¬ÍøÍѲÄǽ¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + +°ú¤­¿ô +.I mountflags +¤Ï¡¢ÀèƬ 16 ¥Ó¥Ã¥È¤Ï¥Þ¥¸¥Ã¥¯¥Ê¥ó¥Ð¡¼ 0xC0ED (\fBMS_MGC_VAL\fP) ¤Ç¡¢ +»Ä¤ê¤Î 16 ¥Ó¥Ã¥È¤¬¥Þ¥¦¥ó¥È¥Õ¥é¥°¤Ç¤¢¤ë¡£ +¥Þ¥¸¥Ã¥¯¥Ê¥ó¥Ð¡¼¤Ï¡¢¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó 2.4 ¤è¤êÁ°¤Ç¤Ïɬ¿Ü¤Ç¤¢¤Ã¤¿¤¬¡¢ +¸½ºß¤ÏɬÍפʤ¯¡¢»ØÄꤵ¤ì¤Æ¤â̵»ë¤µ¤ì¤ë¡£ +¥Þ¥¦¥ó¥È¥Õ¥é¥°¤Ï libc4 ¤È libc5 ¤Ç¤Ï \fI\fP ¡¢ +glibc2 ¤Ç¤Ï \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.\" FIXME 2.6.15 added flags for "shared subtree" functionality: +.\" MS_UNBINDABLE, MS_PRIVATE, MS_SHARED, MS_SLAVE +.\" These need to be documented on this page. +.\" See: +.\" Documentation/filesystems/sharedsubtree.txt +.\" +.\" http://lwn.net/Articles/159077/ +.\" +.\" http://myweb.sudhaa.com:2022/~ram/sharedsubtree/paper/sharedsubtree.1.pdf +.\" Shared-Subtree Concept, Implementation, and Applications in Linux +.\" Al Viro viro@ftp.linux.org.uk +.\" Ram Pai linuxram@us.ibm.com +.\" +.\" http://foss.in/2005/slides/sharedsubtree1.pdf +.\" Shared Subtree Concept and Implementation in the Linux Kernel +.\" Ram Pai +.\" +.\" 2.6.25 Added MS_I_VERSION, which needs to be documented. +.\" +.TP +.BR MS_BIND " (Linux 2.4 °Ê¹ß)" +.\" Àµ³Î¤Ë¤Ï 2.4.0-test9 °Ê¹ß +¥Ð¥¤¥ó¥É¥Þ¥¦¥ó¥È¤ò¹Ô¤¦¡£¤³¤ì¤Ï¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤ÎÉôʬÌÚ¤ò +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâÉô¤ÎÊ̤ξì½ê¤Ç¸«¤¨¤ë¤è¤¦¤Ë¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¥Ð¥¤¥ó¥É¥Þ¥¦¥ó¥È¤ò»È¤¦¤È¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¤Þ¤¿¤¤¤Ç +.BR chroot (2) +jail ¤ò¹½À®¤¹¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤ë¡£ +°ú¤­¿ô +.I filesystemtype +¤È +.I data +¤Ï̵»ë¤µ¤ì¤ë¡£ +Linux 2.6.26 ¤è¤êÁ°¤Ç¤Ï +.I mountflags +¤â̵»ë¤µ¤ì¤Æ¤¤¤¿ +.\" with the exception of the "hidden" MS_REC mountflags bit +(¥Ð¥¤¥ó¥É¥Þ¥¦¥ó¥È¤Ç¤Ï¡¢¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤È¤Ê¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È +Ʊ¤¸¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó¤¬»ÈÍѤµ¤ì¤ë)¡£ +Linux 2.6.26 °Ê¹ß¤Ç¤Ï¡¢¥Ð¥¤¥ó¥É¥Þ¥¦¥ó¥È¤ò¹Ô¤¦ºÝ¤Ë +.B MS_RDONLY +¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤Ê¤¤¡£ +.TP +.BR MS_DIRSYNC " (Linux 2.5.19 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î¥Ç¥£¥ì¥¯¥È¥êÊѹ¹¤òƱ´üŪ¤Ë¹Ô¤¦¡£ +(¤³¤ÎÆÃÀ­¤Ï¸Ä¡¹¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¢¤Þ¤¿¤Ï +.BR chattr (1) +¤ò»È¤Ã¤¿ÉôʬÌÚËè¤ËÀßÄê¤Ç¤­¤ë¡£) +.TP +.B MS_MANDLOCK +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¶¯À©¥í¥Ã¥¯¤òǧ¤á¤ë¡£ +(¶¯À©¥í¥Ã¥¯¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢ +.BR fcntl (2) +¤Ç½Ò¤Ù¤é¤ì¤Æ¤¤¤ëÊýË¡¤Ç¥Õ¥¡¥¤¥ëñ°Ì¤Çµö²Ä¤ò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤) +.\" FIXME Say more about MS_MOVE +.TP +.B MS_MOVE +ÉôʬÌÚ¤ò°ÜÆ°¤¹¤ë¡£ +.I source +¤Ë¤Ï¤¹¤Ç¤Ë¸ºß¤¹¤ë¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò»ØÄꤷ¡¢ +.I target +¤Ë¤Ï¿·¤·¤¤¾ì½ê¤ò»ØÄꤹ¤ë¡£ +°ÜÆ°¤Ï¥¢¥È¥ß¥Ã¥¯¤Ç¤¢¤ë¡£ +Áàºî¤Î¼Â¹ÔÃæ¡¢Éôʬ¥Ä¥ê¡¼¤¬¥¢¥ó¥Þ¥¦¥ó¥È¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.IR filesystemtype ", " mountflags ", " data +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.B MS_NOATIME +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î (Á´¤Æ¤Î¼ïÎà¤Î) ¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹»þ¹ï¤ò¹¹¿·¤·¤Ê¤¤¡£ +.TP +.B MS_NODEV +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ç¥Ð¥¤¥¹ (¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë) ¤Ø¤Î¥¢¥¯¥»¥¹¤òµö²Ä¤·¤Ê¤¤¡£ +.TP +.B MS_NODIRATIME +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¥¢¥¯¥»¥¹»þ¹ï¤ò¹¹¿·¤·¤Ê¤¤¡£ +¤³¤Î¥Õ¥é¥°¤Ï +.B MS_NOATIME +¤ÇÄ󶡤µ¤ì¤ëµ¡Ç½¤Î¥µ¥Ö¥»¥Ã¥È¤òÄ󶡤¹¤ë¡£¤Ä¤Þ¤ê¡¢ +.B MS_NOATIME +¤Ç¤Ï +.B MS_NODIRATIME +¤¬°ÅÌۤΤ¦¤ÁÀßÄꤵ¤ì¤ë¡£ +.TP +.B MS_NOEXEC +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤¢¤ë¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤òµö²Ä¤·¤Ê¤¤¡£ +.\" (Possibly useful for a file system that contains non-Linux executables. +.\" Often used as a security feature, e.g., to make sure that restricted +.\" users cannot execute files uploaded using ftp or so.) +.TP +.B MS_NOSUID +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤È¤­¤Ë¡¢ +set-user-ID ¥Ó¥Ã¥È¤È set-group-ID ¥Ó¥Ã¥È¤ò̵»ë¤¹¤ë¡£ +.\" (This is a security feature to prevent users executing set-UID and +.\" set-GID programs from removable disk devices.) +.TP +.B MS_RDONLY +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÆɤ߹þ¤ßÀìÍѤǥޥ¦¥ó¥È¤¹¤ë¡£ +.\" +.\" FIXME Document MS_REC, available since 2.4.11. +.\" This flag has meaning in conjunction with MS_BIND and +.\" also with the shared subtree flags. +.TP +.BR MS_RELATIME " (Linux 2.6.20 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤¬¥¢¥¯¥»¥¹¤µ¤ì¤¿ºÝ¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤ÎºÇ½ª¥¢¥¯¥»¥¹»þ¹ï (atime) ¤Î¸½ºßÃͤ¬ +ºÇ½ª½¤Àµ»þ¹ï (mtime) ¤äºÇ½ª¾õÂÖÊѹ¹»þ¹ï (ctime) ¤È +Åù¤·¤¤¤«¾®¤µ¤¤¾ì¹ç¤Ë¤Î¤ß¡¢atime ¤ò¹¹¿·¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.BR mutt (1) +¤Î¤è¤¦¤Ë¡¢ºÇ¸å¤ÎÆâÍƽ¤Àµ°Ê¹ß¤Ë¥Õ¥¡¥¤¥ë¤¬¤¤¤ÄÆɤ߽Фµ¤ì¤¿¤«¤òÃΤë +ɬÍפ¬¤¢¤ë¥×¥í¥°¥é¥à¤ÇÍ­ÍѤǤ¢¤ë¡£ +Linux 2.6.30 °Ê¹ß¤Ç¤Ï¡¢ +.B MS_NOATIME +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¤³¤Î¥Õ¥é¥°¤ÎÆ°ºî¤¬ +¥«¡¼¥Í¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÆ°ºî¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢ +Linux 2.6.30 ¤è¤êÁ°¤ÎÆ°ºî¤ò¤µ¤»¤ë¤¿¤á¤Ë¤Ï +.B MS_STRICTATIME +¥Õ¥é¥°¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤ì¤Ë²Ã¤¨¤Æ¡¢Linux 2.6.30 °Ê¹ß¤Ç¤Ï¡¢ +¥Õ¥¡¥¤¥ë¤ÎºÇ½ª¥¢¥¯¥»¥¹»þ¹ï¤¬ 1 Æü°Ê¾åÁ°¤Î¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¤ÎºÇ½ª¥¢¥¯¥»¥¹»þ¹ï¤Ï¾ï¤Ë¹¹¿·¤µ¤ì¤ë¡£ +.\" Matthew Garrett notes in the patch that added this behavior +.\" that this lets utilities such as tmpreaper (which deletes +.\" files based on last acces time) work correctly. +.TP +.B MS_REMOUNT +¤¹¤Ç¤Ë¸ºß¤¹¤ë¥Þ¥¦¥ó¥È¤òºÆ¥Þ¥¦¥ó¥È¤¹¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¤¹¤Ç¤Ë¸ºß¤¹¤ë¥Þ¥¦¥ó¥È¤Î +.I mountflags +¤È +.I data +¤ò¡¢°ìÅÙ¥¢¥ó¥Þ¥¦¥ó¥È¤·¤Æ¤«¤éºÆ¥Þ¥¦¥ó¥È¤¹¤ë¤È¤¤¤¦ºî¶È¤ò¤»¤º¤Ë +Êѹ¹¤Ç¤­¤ë¡£ +.I source +¤È +.I target +¤ÏºÇ½é¤Î +.BR mount () +¸Æ¤Ó½Ð¤·¤ÈƱ¤¸Ãͤò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ +.I filesystemtype +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.I mountflags +¤Î¤¦¤Á +.BR MS_RDONLY , +.BR MS_SYNCHRONOUS , +.B MS_MANDLOCK +¤ÏÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.6.16 ¤è¤êÁ°¤Ç¤Ï¡¢ +.BR MS_NOATIME , +.B MS_NODIRATIME +¤âÊѹ¹²Äǽ¤Ç¤¢¤Ã¤¿¡£ +¥«¡¼¥Í¥ë 2.4.10 ¤è¤êÁ°¤Ç¤Ï¡¢¾åµ­¤Ë²Ã¤¨¤Æ¡¢ +.BR MS_NOSUID , +.BR MS_NODEV , +.B MS_NOEXEC +¤âÊѹ¹²Äǽ¤Ç¤¢¤Ã¤¿¡£ +.TP +.BR MS_SILENT " (Linux 2.6.17 °Ê¹ß)" +¥«¡¼¥Í¥ë¤Î¥í¥°Æâ¤Î¤¢¤ë¼ï¤Î +.RI ( printk ()) +·Ù¹ð¥á¥Ã¥»¡¼¥¸¤Îɽ¼¨¤òÍÞÀ©¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢Ì¾Á°¤¬ÉÔŬÀÚ¤ÇÇѻߤµ¤ì¤¿ +.B MS_VERBOSE +¥Õ¥é¥° (Linux 2.4.12 °Ê¹ß¤ÇÍøÍѲÄǽ) ¤òÃÖ¤­´¹¤¨¤ë¤â¤Î¤Ç¡¢Æ±¤¸°ÕÌ£¤ò»ý¤Ä¡£ +.TP +.BR MS_STRICTATIME " (Linux 2.6.30 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥¢¥¯¥»¥¹¤µ¤ì¤¿ºÝ¤ËºÇ½ª¥¢¥¯¥»¥¹»þ¹ï (atime) +¤ò¾ï¤Ë¹¹¿·¤¹¤ë (Linux 2.6.30 ¤è¤êÁ°¤Ç¤Ï¡¢¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî +¤Ç¤¢¤Ã¤¿)¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +.B MS_NOATIME +¤È +.B MS_RELATIME +¤Îξ¥Õ¥é¥°¤òÀßÄꤷ¤¿ºÝ¤Î±Æ¶Á¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B MS_SYNCHRONOUS +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ·¤ÆƱ´üŪ¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦¡£ +(¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÁ´¤Æ¤Î¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¡¢ +.BR open (2) +¤Î¥Õ¥é¥°¤Ë +.B O_SYNC +¤ò»ØÄꤷ¤¿¤è¤¦¤ÊÆ°ºî¤È¤Ê¤ë) +.PP +Linux 2.4 °Ê¹ß¤Ç¤Ï¡¢ +.BR MS_NODEV ", " MS_NOEXEC ", " MS_NOSUID +¤Ï¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥Èñ°Ì¤Ç»ØÄê¤Ç¤­¤ë¡£ +¥«¡¼¥Í¥ë 2.6.16 °Ê¹ß¤Ç¤Ï¡¢ +.B MS_NOATIME +¤È +.B MS_NODIRATIME +¤â¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥Èñ°Ì¤Ç»ØÄê¤Ç¤­¤ë¡£ +¤Þ¤¿¡¢ +.B MS_RELATIME +¥Õ¥é¥°¤â¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥Èñ°Ì¤ÇÀßÄê¤Ç¤­¤ë¡£ +.PP +°ú¤­¿ô +.I data +¤¬¤É¤Î¤è¤¦¤Ë²ò¼á¤µ¤ì¤ë¤«¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +¤¿¤¤¤Æ¤¤¤Ï¡¢»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ê¥ª¥×¥·¥ç¥ó¤¬ +¥³¥ó¥Þ¶èÀÚ¤ê¤Çʤ٤é¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +³Æ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ·¤Æ»ØÄê²Äǽ¤Ê¥ª¥×¥·¥ç¥ó¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR mount (8) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç 0 ¤¬Ê֤롣¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤¬Ê֤ꡢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +°Ê²¼¤Ë¼¨¤¹¥¨¥é¡¼¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¿¥¤¥×¤Ë¤Ï¸ÇÍ­¤Î¥¨¥é¡¼¤¬Â¸ºß¤¹¤ë¾ì¹ç¤¬¤¢¤ê¡¢ +Æȼ«¤ÎÆ°ºî¤ò¤¹¤ë¤³¤È¤â¤¢¤ë¡£¾Ü¤·¤¯¤Ï¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¤ò¸«¤ÆÍߤ·¤¤¡£ +.TP +.B EACCES +¥Ñ¥¹¤Ë´Þ¤Þ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸¡º÷ (¼Â¹Ô) µö²Ä¤¬¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È)¡£ +¤Þ¤¿¤Ï¡¢ +.B MS_RONLY +¥Õ¥é¥°¤ò»ØÄꤻ¤º¤ËÆɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +¥Þ¥¦¥ó¥È¤·¤è¤¦¤È¤·¤¿¡£ +¤Þ¤¿¤Ï¡¢¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ +.I source +¤¬ +.B MS_NODEV +¥ª¥×¥·¥ç¥ó¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ë¤¢¤ë¡£ +.\" mtk: Probably: write permission is required for MS_BIND, with +.\" the error EPERM if not present; CAP_DAC_OVERRIDE is required. +.TP +.B EBUSY +.I source +¤Ï´û¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤Þ¤¿¤Ï¡¢½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¡¢ +Æɤ߹þ¤ßÀìÍѤǺƥޥ¦¥ó¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I target +¤¬»ÈÍÑÃæ (busy) ¤Î¤¿¤á¡¢ +.I target +¤Ë¥Þ¥¦¥ó¥È¤Ç¤­¤Ê¤¤¡£ +.I target +¤¬»ÈÍÑÃæ¤ÎÎã¤È¤·¤Æ¤Ï¡¢¤¢¤ë¥¿¥¹¥¯¤¬Æ°ºî¤·¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê (working +directory) ¤Ç¤¢¤ë¤È¤«¡¢Ê̤ΥǥХ¤¥¹¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤¢¤ë¤È¤«¡¢ +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¡¢¤Ê¤É¤¬¤¢¤ë¡£ +.TP +.B EFAULT +¾ì½ê¤ò¼¨¤¹°ú¤­¿ô¤Î¤Ò¤È¤Ä¤¬¥æ¡¼¥¶¡¼¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I source +¤ËÉÔÀµ¤Ê¥¹¡¼¥Ñ¡¼¥Ö¥í¥Ã¥¯¤¬¤¢¤ë¡£ +¤Þ¤¿¤Ï¡¢ +.I source +¤¬ +.I target +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤Î¤Ë¡¢ºÆ¥Þ¥¦¥ó¥È +.RB ( MS_REMOUNT ) +¤¬Í׵ᤵ¤ì¤¿¡£ +¤Þ¤¿¤Ï¡¢ +.I source +¤¬¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤Ï¤Ê¤¤¤«¡¢\(aq/\(aq ¤Ê¤Î¤Ë¡¢°ÜÆ° +.RB ( MS_MOVE ) +¤¬Í׵ᤵ¤ì¤¿¡£ +.TP +.B ELOOP +¥Ñ¥¹Ì¾¤Î²ò·èÃæ¤ËÅо줷¤¿¥ê¥ó¥¯¤¬Â¿¤¹¤®¤¿¡£ +¤Þ¤¿¤Ï¡¢ +.I target +¤¬ +.I source +¤Î»Ò¹¤Ê¤Î¤Ë°ÜÆ°¤¬Í׵ᤵ¤ì¤¿¡£ +.TP +.B EMFILE +.\" motoki: ¤É¤¦Ìõ¤¹¤Î¤¬¤¤¤¤¤À¤í¤¦¤«¡© +(¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤¬É¬ÍפǤʤ¤¾ì¹ç) +¥À¥ß¡¼¥Ç¥Ð¥¤¥¹¤Î¥Æ¡¼¥Ö¥ë¤¬°ìÇդˤʤä¿¡£ +.TP +.B ENAMETOOLONG +¥Ñ¥¹Ì¾¤ÎŤµ¤¬ +.B MAXPATHLEN +¤ò±Û¤¨¤¿¡£ +.TP +.B ENODEV +.I filesystemtype +¤¬¥«¡¼¥Í¥ëÃæ¤ÇÄêµÁ (config) ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOENT +¥Ñ¥¹Ì¾¤¬¶õ¤Ç¤¢¤ë¡£¤â¤·¤¯¤Ï»ØÄꤵ¤ì¤¿¥Ñ¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë̾¤ä¥Ç¡¼¥¿¤ò¥³¥Ô¡¼¤¹¤ë¤¿¤á¤Î¶õ¤­¥Ú¡¼¥¸¤ò³ÎÊݤǤ­¤Ê¤¤¡£ +.TP +.B ENOTBLK +(¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤¬É¬ÍפÀ¤¬) +.I source +¤¬¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I target +¤«¡¢ +.I source +¤Î¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ENXIO +¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ +.I source +¤Î¥á¥¸¥ã¡¼Èֹ椬Èϰϳ°¤Ç¤¢¤ë¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤ËɬÍפʸ¢¸Â¤¬¤Ê¤¤¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï Linux ¸ÇÍ­¤Î´Ø¿ô¤Ç¤¢¤ê¡¢°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +»ÈÍѤ¹¤Ù¤­¤Ç¤Ê¤¤¡£ +¸µ¤Î +.B MS_SYNC +¥Õ¥é¥°¤Ï¡¢Ê̤Π+.B MS_SYNC +¤¬ \fI\fP ¤ËÄɲ䵤줿¤Î¤Ç +1.1.69 ¤«¤é +.B MS_SYNCHRONOUS +¤Ë̾Á°¤¬ÊѤï¤Ã¤¿¡£ +.LP +Linux 2.4 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ +.B MS_NOSUID +¥ª¥×¥·¥ç¥óÉÕ¤­¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î +set-UID ¤ä set-GID ¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤è¤¦¤È¤¹¤ë¤È¡¢ +.B EPERM +¥¨¥é¡¼¤È¤Ê¤Ã¤¿¡£ +Linux 2.4 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ï set-UID ¥Ó¥Ã¥È¤ä set-GID ¥Ó¥Ã¥È¤¬ +̵»ë¤µ¤ì¤ë¤À¤±¤Ç¤¢¤ë¡£ +.\" ¤³¤ÎÊѹ¹¤Ï patch-2.4.0-prerelease ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.SS ¥×¥í¥»¥¹Ã±°Ì¤Î̾Á°¶õ´Ö +¥«¡¼¥Í¥ë 2.4.19 °Ê¹ß¤Î Linux ¤Ç¤Ï¡¢¥×¥í¥»¥¹Ã±°Ì¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö +(mount namespace) ¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤È¤Ï¡¢ +¤¢¤ë¥×¥í¥»¥¹¤Ë¸«¤¨¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¤Î½¸¹ç¤Ç¤¢¤ë¡£ +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Î̾Á°¶õ´Ö¤ÏÊ£¿ô¤Î¥×¥í¥»¥¹¤Ç¶¦Í­¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢ +ÉáÄ̤϶¦Í­¤µ¤ì¤Æ¤¤¤ë¡£ +°ì¤Ä¤Î¥×¥í¥»¥¹¤Ë¤è¤ë̾Á°¶õ´Ö¤ÎÊѹ¹ (¤¹¤Ê¤ï¤Á¡¢¥Þ¥¦¥ó¥È¤ä¥¢¥ó¥Þ¥¦¥ó¥È) ¤Ï +Ʊ¤¸Ì¾Á°¶õ´Ö¤ò¶¦Í­¤¹¤ë¾¤ÎÁ´¤Æ¤Î¥×¥í¥»¥¹¤Ë¤â¸«¤¨¤ë¡£ +(2.4.19 ¤è¤êÁ°¤Î Linux ¤Ï¡¢°ì¤Ä¤Î̾Á°¶õ´Ö¤¬¥·¥¹¥Æ¥à¾å¤ÎÁ´¥×¥í¥»¥¹¤Ç +¶¦Í­¤µ¤ì¤ë¾õ¶·¤È¤ß¤Ê¤¹¤³¤È¤¬¤Ç¤­¤ë¡£) + +.BR fork (2) +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤ò¶¦Í­¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤ÏÊÝ»ý¤µ¤ì¤ë¡£ + +¥×¥í¥»¥¹¤Ï¼«Ê¬ÍÑ (private) ¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +¼«Ê¬ÍѤÎ̾Á°¶õ´Ö¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¤Î¤Ï¡¢ +¤½¤Î¥×¥í¥»¥¹¤¬ +.BR clone () +.B CLONE_NEWNS +¥Õ¥é¥°¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿¾ì¹ç¤È¡¢ +¤½¤Î¥×¥í¥»¥¹¤¬ +.B CLONE_NEWNS +¥Õ¥é¥°ÉÕ¤­¤Ç +.BR unshare (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤Ç¤¢¤ë¡£ +Á°¼Ô¤Î¾ì¹ç¡¢ºîÀ®¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¿·¤·¤¤Ì¾Á°¶õ´Ö¤Ï +.BR clone () +¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î̾Á°¶õ´Ö¤Î¡Ö¥³¥Ô¡¼¡×¤Ç½é´ü²½¤µ¤ì¤ë¡£ +¸å¼Ô¤Î¾ì¹ç¡¢ +.BR unshare (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤¬¡¢ +¤½¤ì¤Þ¤Ç¤Ï¾¤Î¥×¥í¥»¥¹¤È¶¦Í­¤·¤Æ¤¤¤¿Ì¾Á°¶õ´Ö¤Î¼«Ê¬ÍѤΥ³¥Ô¡¼¤È¤Ê¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¤³¤ì°Ê¸å¤Ë¹Ô¤¦¥Þ¥¦¥ó¥È/¥¢¥ó¥Þ¥¦¥ó¥È¤Ï +¾¤Î¥×¥í¥»¥¹¤«¤é¸«¤¨¤Ê¤¯¤Ê¤ë +(¤¿¤À¤·¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬ +.BR unshare (2) +¤Î¸Æ¤Ó½Ð¤·°Ê¹ß¤ËºîÀ®¤·¤¿»Ò¥×¥í¥»¥¹¤Ë¤Ï¸«¤¨¤ë)¡£ +¤Þ¤¿¡¢¤½¤ÎµÕ¤Î¡¢Â¾¤Î¥×¥í¥»¥¹¤¬¹Ô¤Ã¤¿¥Þ¥¦¥ó¥È/¥¢¥ó¥Þ¥¦¥ó¥È¤â¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë¤Ï +¸«¤¨¤Ê¤¯¤Ê¤ë¡£ + +Linux Æȼ«¤Î¥Õ¥¡¥¤¥ë +.I /proc/PID/mounts +¤Ç¤Ï¡¢»ØÄꤵ¤ì¤¿ ID ¤ò»ý¤Ä¥×¥í¥»¥¹¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤Ë¤ª¤±¤ë +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Î¥ê¥¹¥È¤¬¸ø³«¤µ¤ì¤Æ¤¤¤ë¡£¾ÜºÙ¤Ï +.BR proc (5) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR umount (2), +.BR path_resolution (7), +.BR mount (8), +.BR umount (8) diff --git a/release/man2/move_pages.2 b/release/man2/move_pages.2 new file mode 100644 index 00000000..8b2a1dac --- /dev/null +++ b/release/man2/move_pages.2 @@ -0,0 +1,230 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" 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. +.\" +.\" FIXME Should programs normally be using this API directly, or should +.\" they rather be using interfaces in the numactl package? +.\" (e.g., compare with recommendation in mbind(2)). +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-10-26, Akihiro MOTOKI +.\" +.TH MOVE_PAGES 2 2008-10-06 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +move_pages \- ¤¢¤ë¥×¥í¥»¥¹¤Î¸Ä¡¹¤Î¥Ú¡¼¥¸¤òÊ̤ΥΡ¼¥É¤Ë°ÜÆ°¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long move_pages(int " pid ", unsigned long count, void **" pages , +.BI " const int *" nodes ", int *" status ", int " flags ); +.fi +.SH ÀâÌÀ +.BR move_pages () +¤Ï¡¢¥×¥í¥»¥¹ +.I pid +¤Î»ØÄꤵ¤ì¤¿¥Ú¡¼¥¸ +.I pages +¤ò +.I nodes +¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥ê¥Î¡¼¥É¤Ë°ÜÆ°¤¹¤ë¡£ +°ÜÆ°¤Î·ë²Ì¤Ï +.I status +¤ËÈ¿±Ç¤µ¤ì¤ë¡£ +.I flags +¤Ç¤Ï°ÜÆ°¤µ¤ì¤ë¥Ú¡¼¥¸¤Ë´Ø¤¹¤ëÀ©Ìó¤ò»ØÄꤹ¤ë¡£ + +.I pid +¤Ï¡¢°ÜÆ°¤µ¤ì¤ë¥Ú¡¼¥¸¤¬Â°¤¹¤ë¥×¥í¥»¥¹¤Î ID ¤Ç¤¢¤ë¡£ +ÊÌ¤Î¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢ +.RB ( CAP_SYS_NICE ) +¤ò»ý¤Ã¤Æ¤¤¤ë¤«¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID ¤«¼Â¸ú¥æ¡¼¥¶ ID ¤¬ +¥Ú¡¼¥¸°ÜÆ°ÂÐ¾Ý¤Î¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID ¤«Êݸ set-user-ID ¤Î¤É¤Á¤é¤«¤È +°ìÃפ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I pid +¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR move_pages () +¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤¹¤ë¡£ + +.I count +¤Ï°ÜÆ°¤¹¤ë¥Ú¡¼¥¸¿ô¤Ç¤¢¤ë¡£ +.I count +¤Ë¤è¤ê +.IR pages , +.IR nodes , +.I status +¤Î 3 ¤Ä¤ÎÇÛÎó¤ÎÂ礭¤µ¤¬ÄêµÁ¤µ¤ì¤ë¡£ + +.I pages +¤Ï¡¢°ÜÆ°¤¹¤Ù¤­¥Ú¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Ç¤¢¤ê¡¢ +³Æ¥Ý¥¤¥ó¥¿¤Ï¥Ú¡¼¥¸¶­³¦¤Ë·¤¨¤¿Ãͤò»ØÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.\" FIXME what if they are not aligned? +.I pid +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Ç¸«¤¨¤ë¥¢¥É¥ì¥¹¤ò»ØÄꤹ¤ë¡£ + +.I nodes +¤Ï¡¢³Æ¥Ú¡¼¥¸¤Î´õ˾¤Î°ÜÆ°¾ì½ê¤ò¼¨¤¹À°¿ôÃͤÎÇÛÎó¤Ç¤¢¤ê¡¢ +ÇÛÎó¤Î³ÆÍ×ÁǤϥΡ¼¥ÉÈÖ¹æ¤Ç¤¢¤ë¡£ +.I nodes +¤Ë¤Ï NULL ¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¡¢¤³¤Î¾ì¹ç¤Ë¤Ï +.BR move_pages () +¤Ï¤É¤Î¥Ú¡¼¥¸¤â°ÜÆ°¤·¤Ê¤¤¤¬¡¢³Æ¥Ú¡¼¥¸¤¬¸½ºßÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤òÇÛÎó +.I status +¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£¤É¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤¹¤ëɬÍפ¬¤¢¤ë¤«¤òȽÃǤ¹¤ë¤¿¤á¤Ë¡¢ +³Æ¥Ú¡¼¥¸¤Î¾õÂ֤μèÆÀ¤¬É¬Íפʾì¹ç¤â¤¢¤ë¡£ + +.I status +¤Ï¡¢³Æ¥Ú¡¼¥¸¤Î¾õÂÖ¤òɽ¤¹À°¿ôÃͤÎÇÛÎó¤Ç¤¢¤ë¡£ +¤³¤ÎÇÛÎó¤ËÍ­¸ú¤ÊÃͤ¬³ÊǼ¤µ¤ì¤ë¤Î¤Ï¡¢ +.BR move_pages () +¤¬¥¨¥é¡¼¤òÊÖ¤µ¤Ê¤«¤Ã¤¿¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ + +.I flags +¤Ë¤Ï¡¢¤É¤Î¼ïÎà¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤¹¤ë¤«¤ò»ØÄꤹ¤ë¡£ +.B MPOL_MF_MOVE +¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬ÇÓ¾Ū¤Ë»ÈÍѤ·¤Æ¤¤¤ë¥Ú¡¼¥¸¤À¤±¤ò°ÜÆ°¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.B MPOL_MF_MOVE_ALL +¤Ï¡¢Ê£¿ô¤Î¥×¥í¥»¥¹´Ö¤Ç¶¦Í­¤µ¤ì¤Æ¤¤¤ë¥Ú¡¼¥¸¤â°ÜÆ°¤Ç¤­¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.B MPOL_MF_MOVE_ALL +¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬Æø¢ +.RB ( CAP_SYS_NICE ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH status ÇÛÎó¤Ë³ÊǼ¤µ¤ì¤ë¥Ú¡¼¥¸¾õÂÖ +.I status +ÇÛÎó¤Î³ÆÍ×ÁǤȤ·¤Æ¡¢°Ê²¼¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.B 0..MAX_NUMNODES +¤½¤Î¥Ú¡¼¥¸¤¬ÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤ò¼¨¤¹¡£ +.TP +.B -EACCES +¤½¤Î¥Ú¡¼¥¸¤ÏÊ£¿ô¤Î¥×¥í¥»¥¹¤Ë¤è¤ê¥Þ¥Ã¥×¤µ¤ì¤Æ¤ª¤ê¡¢ +.B MPOL_MF_MOVE_ALL +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Î¤ß°ÜÆ°¤Ç¤­¤ë¡£ +.TP +.B -EBUSY +¤½¤Î¥Ú¡¼¥¸¤¬¸½ºß¥Ó¥¸¡¼¤Ç¤¢¤ê¡¢°ÜÆ°¤Ç¤­¤Ê¤¤¡£¸å¤Ç¤â¤¦°ìÅٻ¤³¤È¡£ +¤³¤Î¾õ¶·¤Ï¡¢¥Ú¡¼¥¸¤¬ I/O ¤Î¼Â¹ÔÃæ¤Ç¤¢¤Ã¤¿¤ê¡¢¥«¡¼¥Í¥ë¤Î¾¤Î¥µ¥Ö¥·¥¹¥Æ¥à +¤¬¤½¤Î¥Ú¡¼¥¸¤Ø¤Î»²¾È¤òÊÝ»ý¤·¤Æ¤¤¤ë¾ì¹ç¤ËȯÀ¸¤¹¤ë¡£ +.TP +.B -EFAULT +¤½¤Î¥Ú¡¼¥¸¤¬ zero page ¤Ç¤¢¤ë¤«¡¢¤½¤Î¥á¥â¥êÎΰè¤Ï¤½¤Î¥×¥í¥»¥¹¤Ë¤è¤ê +¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B -EIO +¥Ú¡¼¥¸¤ò½ñ¤­Ì᤹ (write back) ¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +¥Ú¡¼¥¸¤¬ dirty ¤Ç¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ dirty ¤Ê¥Ú¡¼¥¸¤ò°ÜÆ°¤Ç¤­¤ë¤è¤¦¤Ê +°ÜÆ°µ¡Ç½¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¤¿¤á¡¢¤½¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤¹¤ë¤¿¤á¤Ë¤Ï¥Ú¡¼¥¸¤ò +½ñ¤­Ìᤵ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B -EINVAL +dirty ¤Ê¥Ú¡¼¥¸¤ò°ÜÆ°¤Ç¤­¤Ê¤¤¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ dirty ¤Ê¥Ú¡¼¥¸¤ò°ÜÆ°¤¹¤ë¤¿¤á¤Îµ¡Ç½¤òÄ󶡤·¤Æ¤ª¤é¤º¡¢ +¥Ú¡¼¥¸¤ò½ñ¤­Ì᤹ǽÎϤâ¤Ê¤¤¡£ +.TP +.B -ENOENT +¥Ú¡¼¥¸¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B -ENOMEM +°ÜÆ°Àè¤Î¥Î¡¼¥É¤Ç¥á¥â¥ê¤ò³ÎÊݤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR move_pages () +¤Ï 0 ¤òÊÖ¤¹¡£ +.\" FIXME Is the following quite true: does the wrapper in numactl +.\" do the right thing? +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B E2BIG +°ÜÆ°¤¹¤Ù¤­¥Ú¡¼¥¸¤¬Â¿²á¤®¤ë¡£ +.TP +.B EACCES +.\" FIXME Clarify "current cpuset". Is that the cpuset of the caller +.\" or the target? +°ÜÆ°Àè¤Î¥Î¡¼¥É¤Î¤¤¤º¤ì¤«¤¬¸½ºß¤Î CPU ½¸¹ç¤Ç¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +¥Ñ¥é¥á¡¼¥¿ÇÛÎó¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINVAL +.I flags +¤Ë +.B MPOL_MF_MOVE +¤Ç¤â +.B MPOL_MF_MOVE_ALL +¤Ç¤â¤Ê¤¤Ãͤ¬»ØÄꤵ¤ì¤¿¤«¡¢¥«¡¼¥Í¥ë¥¹¥ì¥Ã¥É¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤µ¤»¤è¤¦¤È¤·¤¿¡£ +.TP +.B ENODEV +°ÜÆ°Àè¤Î¥Î¡¼¥É¤Î¤¤¤º¤ì¤«¤¬¥ª¥ó¥é¥¤¥ó¤Ç¤Ê¤¤¡£ +.TP +.B ENOENT +°ÜÆ°¤¬É¬Íפʥڡ¼¥¸¤¬Á´¤¯¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +»ØÄꤵ¤ì¤¿Á´¤Æ¤Î¥Ú¡¼¥¸¤¬¡¢¤¹¤Ç¤Ë°ÜÆ°Àè¤Î¥Î¡¼¥É¤Ë¸ºß¤¹¤ë¤«¡¢Â¸ºß¤·¤Ê¤¤¤«¡¢ +̵¸ú¤Ê¥¢¥É¥ì¥¹¤Ç¤¢¤Ã¤¿¤«¡¢Ê£¿ô¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Æ°ÜÆ°¤Ç¤­ +¤Ê¤«¤Ã¤¿¤«¡¢¤Î¤¤¤º¤ì¤«¤Ç¤¢¤Ã¤¿¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤Ï +.B MPOL_MF_MOVE_ALL +¤ò»ØÄꤷ¤¿¤¬¡¢½½Ê¬¤ÊÆø¢ +.RB ( CAP_SYS_NICE ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤¬Â¾¤Î¥æ¡¼¥¶¤Ë°¤¹¤ë¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¤ò°ÜÆ°¤·¤è¤¦¤È¤·¤¿¤¬¡¢ +¤½¤ì¤ò¹Ô¤¨¤ë¤À¤±¤ÎÆø¢ +.RB ( CAP_SYS_NICE ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B ESRCH +¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR move_pages () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.6.18 ¤Ç½é¤á¤Æ Linux ¤ËÅо줷¤¿¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¥é¥¤¥Ö¥é¥ê¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR numa (7) +¤ò»²¾È¡£ + +.\" FIXME Clarify "current cpuset". Is that the cpuset of the caller +.\" or the target? +¸½ºß¤Î CPU ½¸¹ç¤Çµö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤Î½¸¹ç¤ò¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢¥Õ¥é¥° +.B MPOL_F_MEMS_ALLOWED +¤ò»ØÄꤷ¤Æ +.BR get_mempolicy (2) +¤ò»ÈÍѤ¹¤ì¤Ð¤è¤¤¡£ +¼èÆÀ¤·¤¿¾ðÊó¤Ï¡¢CPU ½¸¹ç¤Î¼êÆ°¤Þ¤¿¤Ï¼«Æ°¤Ç¤ÎºÆ¹½À®¤Ë¤è¤ê +¤¤¤Ä²¿»þÊѲ½¤·¤Æ¤·¤Þ¤¦¤«Ê¬¤«¤é¤Ê¤¤¡£ + +¤³¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤È¡¢¥Ú¡¼¥¸¤Î°ÌÃÖ (¥Î¡¼¥É) ¤¬ +»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤ËÂФ·¤ÆÀßÄꤵ¤ì¤¿¥á¥â¥ê¥Ý¥ê¥·¡¼ +.RB ( mbind (2) +»²¾È) ¤ä»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤ËÂФ·¤ÆÀßÄꤵ¤ì¤¿¥á¥â¥ê¥Ý¥ê¥·¡¼ +.RB ( set_mempolicy (2) +»²¾È) ¤Ë°ãÈ¿¤·¤Æ¤·¤Þ¤¦²ÄǽÀ­¤¬¤¢¤ë¡£ +¤Ä¤Þ¤ê¡¢¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï +.BR move_pages () +¤Ç»È¤ï¤ì¤ë°ÜÆ°Àè¥Î¡¼¥É¤òÀ©¸Â¤·¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR get_mempolicy (2), +.BR mbind (2), +.BR set_mempolicy (2), +.BR numa (3), +.BR numa_maps (5), +.BR cpuset (7), +.BR numa (7), +.BR migratepages (8), +.BR numa_stat (8) diff --git a/release/man2/mprotect.2 b/release/man2/mprotect.2 new file mode 100644 index 00000000..c192936b --- /dev/null +++ b/release/man2/mprotect.2 @@ -0,0 +1,236 @@ +.\" -*- nroff -*- +.\" Copyright (C) 2007 Michael Kerrisk +.\" and Copyright (C) 1995 Michael Shields . +.\" +.\" 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 author of this work. +.\" +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 1997-05-31 by Andries Brouwer +.\" Modified 2003-08-24 by Andries Brouwer +.\" Modified 2004-08-16 by Andi Kleen +.\" 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 Æɤ߼è¤êÀìÍÑ +.\" +.TH MPROTECT 2 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mprotect \- ¥á¥â¥êÎΰè¤ÎÊݸî¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int mprotect(const void *" addr ", size_t " len ", int " prot ); +.fi +.SH ÀâÌÀ +.BR mprotect () +¤Ï¡¢¶è´Ö [\fIaddr\fP,\ \fIaddr\fP+\fIlen\fP\-1] ¤Î¥¢¥É¥ì¥¹ÈϰϤò´Þ¤à +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥á¥â¥ê¥Ú¡¼¥¸¤Î¥¢¥¯¥»¥¹Êݸî¤òÊѹ¹¤¹¤ë¡£ +.I addr +¤Ï¥Ú¡¼¥¸¶­³¦¤Ë°ìÃפ·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¥¢¥¯¥»¥¹Êݸî¤Ë°ãÈ¿¤¹¤ë¤è¤¦¤Ê¥á¥â¥ê¥¢¥¯¥»¥¹¤ò +¹Ô¤ª¤¦¤È¤¹¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï¥·¥°¥Ê¥ë +.B SIGSEGV +¤ò¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤ÆÀ¸À®¤¹¤ë¡£ +.PP +.I prot +¤Ë¤Ï¡¢ +.B PROT_NONE +¤«¡¢°Ê²¼¤Î¥ê¥¹¥È¤Î +.B PROT_NONE +°Ê³°¤ÎÃͤò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýÏ (bitwize-or) ¤Ç»ØÄꤹ¤ë: +.TP 1.1i +.B PROT_NONE +¤½¤Î¥á¥â¥ê¤Ë¤ÏÁ´¤¯¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¡£ +.TP +.B PROT_READ +¤½¤Î¥á¥â¥ê¤òÆɤ߼è¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B PROT_WRITE +¤½¤Î¥á¥â¥ê¤òÊѹ¹¤Ç¤­¤ë¡£ +.TP +.B PROT_EXEC +¤½¤Î¥á¥â¥ê¤Ï¼Â¹Ô²Äǽ¤Ç¤¢¤ë¡£ +.\" FIXME +.\" Document PROT_GROWSUP and PROT_GROWSDOWN +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR mprotect () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬Ê֤ꡢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +»ØÄꤵ¤ì¤¿¥¢¥¯¥»¥¹¤ò¥á¥â¥ê¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +¤³¤ì¤Ï¡¢Î㤨¤Ð +¥Õ¥¡¥¤¥ë¤òÆɤ߼è¤êÀìÍÑ¤Ç +.BR mmap (2) +¤·¤Æ¤ª¤ê¡¢¤½¤ÎÎΰè¤ËÂФ·¤Æ +.BR mprotect () +¤ò¸Æ¤Ó½Ð¤·¤Æ +.B PROT_WRITE +¤ËÀßÄꤷ¤è¤¦¤È¤·¤¿¾ì¹ç¤ËȯÀ¸¤¹¤ë¡£ +.TP +.B EINVAL +\fIaddr\fP ¤¬Í­¸ú¤Ê¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¤¤«¡¢ +¥·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ê¤¤¡£ +.\" Or: both PROT_GROWSUP and PROT_GROWSDOWN were specified in 'prot'. +.TP +.B ENOMEM +¥«¡¼¥Í¥ëÆâÉô¤Î¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +.RI [ addr , +.IR addr + len ] +¤È¤¤¤¦ÈϰϤΥ¢¥É¥ì¥¹¤¬¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤È¤·¤ÆÉÔÀµ¤Ç¤¢¤ë¤«¡¢ +¤½¤ÎÈϰϤΥ¢¥É¥ì¥¹¤¬¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Ê¤¤ 1 ¤Ä°Ê¾å¤Î¥Ú¡¼¥¸¤ò»Ø¤·¤Æ¤¤¤ë +(¥«¡¼¥Í¥ë 2.4.19 ¤è¤êÁ°¤Ç¤Ï¡¢¤³¤Î¾õ¶·¤Ç¥¨¥é¡¼ +.B EFAULT +¤¬´Ö°ã¤Ã¤ÆÀ¸À®¤µ¤ì¤Æ¤¤¤¿)¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.\" SVr4 ¤Ç¤Ï¾¤Ë¥¨¥é¡¼¥³¡¼¥É EAGAIN ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" SVr4 ¤Î¥¨¥é¡¼¾ò·ï¤Ï Linux ¤Î¤â¤Î¤Ë¤­¤Á¤ó¤ÈÂбþ¤·¤Ê¤¤¡£ +POSIX ¤Ç¤Ï¡¢ +.BR mmap (2) +·Ðͳ¤Ç³ÍÆÀ¤·¤Æ¤¤¤Ê¤¤¥á¥â¥êÎΰè¤ËÂФ·¤Æ +.BR mprotect () +¤ò¹Ô¤Ã¤¿¾ì¹ç¤Î +.BR mprotect () +¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¤È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +Linux ¤Ç¤Ï¡¢(¥«¡¼¥Í¥ë vsyscall Îΰè°Ê³°¤Î) +Ǥ°Õ¤Î¥×¥í¥»¥¹¥¢¥É¥ì¥¹¶õ´Ö¤ËÂФ·¤Æ +.BR mprotect () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¡¢¾ï¤Ëµö¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤ÏÆä˴û¸¤Î¥³¡¼¥É¥Þ¥Ã¥Ô¥ó¥°¤ò½ñ¤­¹þ¤ß²Äǽ¤Ë¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ + +.B PROT_EXEC +¤¬ +.B PROT_READ +¤È°Û¤Ê¤ë±Æ¶Á¤ò»ý¤Ä¤«Èݤ«¤Ï¡¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤È¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë°Í¸¤¹¤ë¡£ +(i386 ¤Ê¤É¤Î) ¤¤¤¯¤Ä¤«¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢ +.B PROT_WRITE +¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢°ÅÌۤΤ¦¤Á¤Ë +.B PROT_READ +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ + +POSIX.1-2001 ¤Ç¤Ï¡¢ +.I prot +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥¢¥¯¥»¥¹¤òµö²Ä¤¹¤ë¼ÂÁõ¤òǧ¤á¤Æ¤¤¤ë¡£ +¤¿¤À¤·¡¢ºÇÄã¸Â¡¢ +.B PROT_WRITE +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ß½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¬µö²Ä¤µ¤ì¡¢ +.B PROT_NONE +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¥¢¥¯¥»¥¹¤Ïµö²Ä¤µ¤ì¤Ê¤¤ÅÀ¤À¤±¤Ï +Ëþ¤¿¤¹É¬Íפ¬¤¢¤ë¡£ +.SH Îã +.\" sigaction.2 refers to this example +.PP +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥á¥â¥ê¥Ú¡¼¥¸¤ò 4¤Ä³ÎÊݤ·¡¢¤½¤Î¤¦¤Á 3ÈÖÌܤΥڡ¼¥¸¤ò +Æɤ߹þ¤ßÀìÍѤËÀßÄꤹ¤ë¡£¤½¤Î¸å¤Ç¡¢³ÎÊݤ·¤¿Îΰè¤Î¥¢¥É¥ì¥¹¤Î¾®¤µ¤¤Êý¤«¤é +Â礭¤ÊÊý¤Ë¸þ¤«¤Ã¤Æ½çÈ֤˥Х¤¥ÈÃͤòÊѹ¹¤¹¤ë¥ë¡¼¥×¤ò¼Â¹Ô¤¹¤ë¡£ + +¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Î°ìÎã¤ò°Ê²¼¤Ë¼¨¤¹¡£ + +.in +4n +.nf +.RB "$" " ./a.out" +Start of region: 0x804c000 +Got SIGSEGV at address: 0x804e000 +.fi +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.in +.nf +#include +#include +#include +#include +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +char *buffer; + +static void +handler(int sig, siginfo_t *si, void *unused) +{ + printf("Got SIGSEGV at address: 0x%lx\\n", + (long) si\->si_addr); + exit(EXIT_FAILURE); +} + +int +main(void) +{ + char *p; + int pagesize; + struct sigaction sa; + + sa.sa_flags = SA_SIGINFO; + sigemptyset(&sa.sa_mask); + sa.sa_sigaction = handler; + if (sigaction(SIGSEGV, &sa, NULL) == \-1) + handle_error("sigaction"); + + pagesize = sysconf(_SC_PAGE_SIZE); + if (pagesize == \-1) + handle_error("sysconf"); + + /* Allocate a buffer aligned on a page boundary; + initial protection is PROT_READ | PROT_WRITE */ + + buffer = memalign(pagesize, 4 * pagesize); + if (buffer == NULL) + handle_error("memalign"); + + printf("Start of region: 0x%lx\\n", (long) buffer); + + if (mprotect(buffer + pagesize * 2, pagesize, + PROT_NONE) == \-1) + handle_error("mprotect"); + + for (p = buffer ; ; ) + *(p++) = \(aqa\(aq; + + printf("Loop completed\\n"); /* Should never happen */ + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR mmap (2), +.BR sysconf (3) diff --git a/release/man2/mq_getsetattr.2 b/release/man2/mq_getsetattr.2 new file mode 100644 index 00000000..50f63d19 --- /dev/null +++ b/release/man2/mq_getsetattr.2 @@ -0,0 +1,60 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-16, Akihiro MOTOKI +.\" +.TH MQ_GETSETATTR 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mq_getsetattr \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î°À­¤òÀßÄê/¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "mqd_t mq_getsetattr(mqd_t " mqdes ", struct mq_attr *" newattr "," +.BI " struct mq_attr *" oldattr ); +.fi +.SH ÀâÌÀ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ÈÍѤ·¤Ê¤¤¤³¤È¡£ + +.BR mq_getattr (3) +¤È +.BR mq_setattr (3) +¤Î¼ÂÁõ¤Ë»ÈÍѤµ¤ì¤ëÄã¥ì¥Ù¥ë¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤É¤Î¤è¤¦¤ËÆ°ºî¤¹¤ë¤«¤Ï +.BR mq_setattr (3) +¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.SH ½àµò +¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÏÈóɸ½à¤Ç¤¢¤ë¡£»ÈÍѤòÈò¤±¤ë¤³¤È¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£ +(¼Â¤Î¤È¤³¤í¡¢C ¥é¥¤¥Ö¥é¥ê¤ò½ñ¤¤¤Æ¤¤¤ë¤Î¤Ç¤Ê¤¤¸Â¤ê¡¢ +·è¤·¤Æ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤µ¤Ê¤¤¤³¤È!) +.SH ´ØÏ¢¹àÌÜ +.BR mq_getattr (3), +.BR mq_overview (7) diff --git a/release/man2/mremap.2 b/release/man2/mremap.2 new file mode 100644 index 00000000..9d23a0d4 --- /dev/null +++ b/release/man2/mremap.2 @@ -0,0 +1,226 @@ +.\" 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 2005-09-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mremap \- ²¾ÁÛ¥á¥â¥ê¡¦¥¢¥É¥ì¥¹¤òºÆ¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "void *mremap(void *" old_address ", size_t " old_size , +.BI " size_t " new_size ", int " flags ); +.fi +.SH ÀâÌÀ +.BR mremap () +¤Ï´û¸¤Î¥á¥â¥ê¡¦¥Þ¥Ã¥Ô¥ó¥°¤Î³ÈÄ¥ (¤Þ¤¿¤Ï½Ì¾®) ¤ò¹Ô¤¦¡£ +Ʊ»þ¤Ë°ÜÆ°¤µ¤ì¤ë¤³¤È¤â¤¢¤ë +(\fIflags\fP °ú¤­¿ô¤ÈÍøÍѲÄǽ¤Ê²¾ÁÛ¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤è¤Ã¤Æ·è¤Þ¤ë)¡£ + +\fIold_address\fP ¤Ï³ÈÄ¥ (¤Þ¤¿¤Ï½Ì¾®) ¤·¤è¤¦¤È¤¹¤ë²¾ÁÛ¥á¥â¥ê¡¦¥Ö¥í¥Ã¥¯ +¤Î¸µ¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£\fIold_address\fP ¤Ï¥Ú¡¼¥¸¶­³¦¤Ë¹ç¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð +¤Ê¤é¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£\fIold_size\fP ¤Ï¸µ¤Î²¾ÁÛ¥á¥â¥ê¡¦¥Ö¥í¥Ã¥¯¤Î +¥µ¥¤¥º¤Ç¤¢¤ë¡£ +\fInew_size\fP ¤ÏÍ׵᤹¤ëÊѹ¹¸å¤Î²¾ÁÛ¥á¥â¥ê¡¦¥Ö¥í¥Ã¥¯¤Î¥µ¥¤¥º¤Ç¤¢¤ë¡£ + +Linux ¤Ç¤Ï¥á¥â¥ê¤Ï¥Ú¡¼¥¸¤Ëʬ³ä¤µ¤ì¤ë¡£¥æ¡¼¥¶¡¼¡¦¥×¥í¥»¥¹¤Ï (°ì¤Ä¤Þ¤¿¤Ï) +Ê£¿ô¤Î¥ê¥Ë¥¢¤Ê²¾ÁÛ¥á¥â¥ê¥»¥°¥á¥ó¥È¤ò»ý¤Ä¡£ +¤½¤ì¤¾¤ì¤Î²¾ÁÛ¥á¥â¥ê¥»¥°¥á¥ó¥È¤Ï°ì¤Ä°Ê¾å¤Î¼Â¥á¥â¥ê¡¦¥Ú¡¼¥¸ +¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤Æ¤¤¤ë (¥Þ¥Ã¥Ô¥ó¥°¾ðÊó¤Ï¥Ú¡¼¥¸¡¦¥Æ¡¼¥Ö¥ë¤Ç´ÉÍý¤µ¤ì¤ë)¡£ +²¾ÁÛ¥á¥â¥ê¥»¥°¥á¥ó¥È¤Ë¤Ï¥»¥°¥á¥ó¥ÈËè¤ÎÊݸî (¥¢¥¯¥»¥¹¸¢) ¤¬ÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢ +¥á¥â¥ê¤¬ÉÔÀµ¤Ë¥¢¥¯¥»¥¹¤µ¤ì¤¿¾ì¹ç (Î㤨¤ÐÆɤ߹þ¤ßÀìÍѤΥ»¥°¥á¥ó¥È¤Ë +½ñ¤­¹þ¤ó¤À¾ì¹ç)¡¢¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó¿¯³² (segmentation violation) ¤ò +°ú¤­µ¯¤³¤¹¡£¤Þ¤¿¡¢¥»¥°¥á¥ó¥È³°¤Î²¾ÁÛ¥á¥â¥ê¤Ë¥¢¥¯¥»¥¹¤·¤¿¾ì¹ç¤Ë¤â +¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó¿¯³²¤¬È¯À¸¤¹¤ë¡£ + +.BR mremap () +¤Ï Linux ¤Î¥Ú¡¼¥¸¡¦¥Æ¡¼¥Ö¥ëÊý¼°¤ò»ÈÍѤ¹¤ë¡£ +.BR mremap () +¤Ï²¾ÁÛ¥¢¥É¥ì¥¹¤È¥á¥â¥ê¡¦¥Ú¡¼¥¸¤Î¥Þ¥Ã¥Ô¥ó¥°¤òÊѹ¹¤¹¤ë¡£¤³¤ì¤ÏÈó¾ï¤Ë¸úΨŪ¤Ê +.BR realloc (3) +¤ò¼ÂÁõ¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ + +\fIflags\fP ¥Ó¥Ã¥È¥Þ¥¹¥¯°ú¿ô¤Ï 0 ¤Þ¤¿¤Ï°Ê²¼¤Î¥Õ¥é¥°¤ò´Þ¤à: +.TP +.B MREMAP_MAYMOVE +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¸½ºß¤Î°ÌÃ֤˥ޥåԥ󥰤ò³ÈÄ¥¤¹¤ë¤¿¤á¤Î +½½Ê¬¤Ê¶õ¤­¤¬¤Ê¤±¤ì¤Ð +.BR mremap () +¤Ï¼ºÇÔ¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤ë¤È¡¢¥«¡¼¥Í¥ë¤ÏɬÍפ¬¤¢¤ì¤Ð¥Þ¥Ã¥Ô¥ó¥°¤ò +¿·¤·¤¤²¾ÁÛ¥¢¥É¥ì¥¹¤ËºÆÇÛÃÖ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +¥Þ¥Ã¥Ô¥ó¥°¤¬ºÆÇÛÃÖ¤µ¤ì¤ë¤È¡¢¸Å¤¤¥Þ¥Ã¥Ô¥ó¥°°ÌÃ֤ؤÎÀäÂХݥ¤¥ó¥¿¤Ï +̵¸ú¤Ë¤Ê¤ë (¥Þ¥Ã¥Ô¥ó¥°¤Î³«»Ï¥¢¥É¥ì¥¹¤«¤é¤ÎÁêÂÐ¥ª¥Õ¥»¥Ã¥È¤ÏÍ­¸ú¤Î¤Þ¤Þ¤Ç¤¢¤ë)¡£ +.TP +.BR MREMAP_FIXED " (Linux 2.3.31 °Ê¹ß)" +¤³¤Î¥Õ¥é¥°¤Ï +.BR mmap (2) +¤Î +.B MAP_FIXED +¥Õ¥é¥°¤È»÷¤¿¤è¤¦¤ÊÌÜŪ¤ÇÍѤ¤¤é¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤ë¤È¡¢ +.BR mremap () +¤Ï 5 ÈÖÌܤΰú¤­¿ô +.I "void *new_address" +¤ò¼õ¤±¼è¤ê¡¢¤³¤Î°ú¿ô¤Ï¥Þ¥Ã¥Ô¥ó¥°¤¬°ÜÆ°¤µ¤ì¤ë¤Ù¤­¥¢¥É¥ì¥¹¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥¢¥É¥ì¥¹¤Ï¥Ú¡¼¥¸¶­³¦¤Ë¹ç¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I new_address +¤È +.I new_size +¤Ç»ØÄꤵ¤ì¤ë¥¢¥É¥ì¥¹ÈϰϤ˲áµî¤Î¥Þ¥Ã¥Ô¥ó¥°¤¬¤¢¤Ã¤¿¾ì¹ç¡¢ +¤½¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ï¥¢¥ó¥Þ¥Ã¥×¤µ¤ì¤ë (unmapped)¡£ +.B MREMAP_FIXED +¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï¡¢ +.B MREMAP_MAYMOVE +¤â»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.I old_address +¤È +.I old_size +¤Ç»ØÄꤵ¤ì¤ë¥á¥â¥ê¥»¥°¥á¥ó¥È¤¬ +.RB ( mlock (2) +¤äƱÍͤΤâ¤Î¤Ç) ¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥»¥°¥á¥ó¥È¤Î¥µ¥¤¥º¤¬ÊѤï¤Ã¤¿¤ê +ºÆÇÛÃÖ¤µ¤ì¤¿¤ê¤·¤¿»þ¤Ë¥í¥Ã¥¯¤â°Ý»ý¤µ¤ì¤ë¡£ +¤½¤Î·ë²Ì¡¢¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤µ¤ì¤ë¥á¥â¥ê¤ÎÎ̤ÏÊѲ½¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï +.BR mremap () +¤Ï¿·¤·¤¤²¾ÁÛ¥á¥â¥êÎΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï +.B MAP_FAILED +(¤¹¤Ê¤ï¤Á \fI(void\ *)\ \-1\fP) ¤¬ÊÖ¤µ¤ì¡¢ +\fIerrno\fP ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +¸Æ¤Ó½Ð¤·¸µ¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¥á¥â¥ê¥»¥°¥á¥ó¥È¤ò³ÈÄ¥¤·¤è¤¦¤È¤·¤¿¤¬¡¢ +.B RLIMIT_MEMLOCK +¥ê¥½¡¼¥¹À©¸Â¤ò±Û¤¨¤º¤Ë¤³¤ì¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.B EFAULT +¡Ö¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó°ãÈ¿(segmentation fault)¡× +\fIold_address\fP ¤«¤é \fIold_address\fP+\fIold_size\fP ¤Î +ÈϰϤΥ¢¥É¥ì¥¹¤Î¤É¤ì¤«¤¬¤³¤Î¥×¥í¥»¥¹¤Ë¤ª¤¤¤ÆÉÔÀµ¤Ê²¾ÁÛ¥á¥â¥ê¡¦¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +¤¿¤È¤¨Í׵ᤷ¤¿¥¢¥É¥ì¥¹¶õ´ÖÁ´ÂΤò´Þ¤à¤è¤¦¤Ê¥Þ¥Ã¥Ô¥ó¥°¤¬¤¢¤Ã¤¿¤È¤·¤Æ¤â¡¢ +¤½¤ì¤é¤Î¥Þ¥Ã¥Ô¥ó¥°¤¬°Û¤Ê¤Ã¤¿·¿¤Ê¤é¤Ð +.B EFAULT +¤ò¼õ¤±¼è¤ë¤À¤í¤¦¡£ +.TP +.B EINVAL +ÉÔÀµ¤Ê°ú¤­¿ô¤¬Í¿¤¨¤é¤ì¤¿¡£ +²ÄǽÀ­¤Î¤¢¤ë¸¶°ø¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +¤¿¤¤¤Æ¤¤¤Ï \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 +¸½ºß¤Î²¾ÁÛ¥¢¥É¥ì¥¹¤Ç¤Ï¥á¥â¥êÎΰ褬³ÈÄ¥¤Ç¤­¤º¡¢ +.B MREMAP_MAYMOVE +¥Õ¥é¥°¤¬ \fIflags\fP ¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¤Ï½½Ê¬¤Ê (²¾ÁÛ) ¥á¥â¥ê¤¬Â¸ºß¤·¤Ê¤¤¡£ +.SH ½àµò +¤³¤Î¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç +»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\" 4.2BSD ¤Ë¤Ï (¼ÂºÝ¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤¿¤ï¤±¤Ç¤Ï¤Ê¤¤¤¬) +.\" Á´¤¯°Û¤Ã¤¿Êý¼° (semantics) ¤Ë¤è¤ë +.\" .BR mremap (2) +.\" ¥³¡¼¥ë¤¬¤¢¤Ã¤¿¡£ +.\" FIXME perhaps remove above statement about 4.2BSD. +.SH Ãí°Õ +¥Ð¡¼¥¸¥ç¥ó 2.4 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢ +.B MREMAP_FIXED +¤ÎÄêµÁ¤Ï¸ø³«¤µ¤ì¤Æ¤ª¤é¤º¡¢ +.BR mremap () +¤Î¥×¥í¥È¥¿¥¤¥×¤Ï +.I new_address +°ú¤­¿ô¤ò¼è¤é¤Ê¤«¤Ã¤¿¡£ +.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), +.BR feature_test_macros (7) +.P +¥Ú¡¼¥¸Ê¬³ä¤µ¤ì¤¿¥á¥â¥ê¤Ë¤Ä¤¤¤Æ¤â¤Ã¤È¾Ü¤·¤¯ÃΤꤿ¤¤¤Ê¤é¤Ð +¤¢¤Ê¤¿¤Î¹¥¤ß¤Î 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/release/man2/msgctl.2 b/release/man2/msgctl.2 new file mode 100644 index 00000000..d5a2782d --- /dev/null +++ b/release/man2/msgctl.2 @@ -0,0 +1,353 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" and Copyright 2004, 2005 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 Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond +.\" Modified Sun Feb 18 01:59:29 2001 by Andries E. Brouwer +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on CAP_IPC_OWNER requirement +.\" Modified, 17 Jun 2004, Michael Kerrisk +.\" Added notes on CAP_SYS_ADMIN requirement for IPC_SET and IPC_RMID +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added msqid_ds and ipc_perm structure definitions +.\" 2005-08-02, mtk: Added IPC_INFO, MSG_INFO, MSG_STAT descriptions +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Updated & Modified 2001-06-04, Yuichi SATO +.\" Updated & Modified 2002-07-06, Yuichi SATO +.\" Updated & Modified 2004-12-31, Yuichi SATO +.\" Updated & Modified 2005-10-10, Akihiro MOTOKI +.\" +.\"WORD: message ¥á¥Ã¥»¡¼¥¸ +.\"WORD: queue ¥­¥å¡¼ +.\"WORD: member ¥á¥ó¥Ð¡¼ +.\"WORD: structure ¹½Â¤ÂÎ +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶ ID +.\"WORD: creator ºîÀ®¼Ô +.\"WORD: owner ½êÍ­¼Ô +.\"WORD: feature test macro µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\" +.TH MSGCTL 2 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +msgctl \- ¥á¥Ã¥»¡¼¥¸À©¸æÁàºî +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include + +.BI "int msgctl(int " msqid ", int " cmd ", struct msqid_ds *" buf ); +.fi +.SH ÀâÌÀ +.BR msgctl () +¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¼±ÊÌ»Ò +.I msqid +¤Ç»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼ (message queue) ¤ËÂФ·¤Æ +.I cmd +¤Ç»ØÄꤵ¤ì¤¿À©¸æÁàºî¤ò¹Ô¤Ê¤¦¡£ +.PP +.I msqid_ds +¥Ç¡¼¥¿¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.nf +.in +4n + +struct msqid_ds { + struct ipc_perm msg_perm; /* ½êÍ­¸¢¤Èµö²Ä */ + time_t msg_stime; /* ºÇ¸å¤Î msgsnd(2) ¤Î»þ¹ï */ + time_t msg_rtime; /* ºÇ¸å¤Î msgrcv(2) ¤Î»þ¹ï */ + time_t msg_ctime; /* ºÇ¸å¤ËÊѹ¹¤¬¹Ô¤ï¤ì¤¿»þ¹ï */ + unsigned long __msg_cbytes; /* ¥­¥å¡¼¤Ë¤¢¤ë¸½ºß¤Î¥Ð¥¤¥È¿ô + (Èóɸ½à) */ + msgqnum_t msg_qnum; /* ¥­¥å¡¼¤Ë¤¢¤ë¸½ºßÆþ¤Ã¤Æ¤¤¤ë + ¥á¥Ã¥»¡¼¥¸¤Î¿ô */ + msglen_t msg_qbytes; /* ¥­¥å¡¼¤Ëµö²Ä¤µ¤ì¤Æ¤¤¤ë + ºÇÂç¥Ð¥¤¥È¿ô */ + pid_t msg_lspid; /* ºÇ¸å¤Î msgsnd(2) ¤Î PID */ + pid_t msg_lrpid; /* ºÇ¸å¤Î msgrcv(2) ¤Î PID */ +}; +.in +.fi +.PP +.I ipc_perm +¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +(¶¯Ä´¤µ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Ï +.B IPC_SET +¤ò»È¤Ã¤ÆÀßÄê²Äǽ¤Ç¤¢¤ë): +.PP +.nf +.in +4n +struct ipc_perm { + key_t __key; /* msgget(2) ¤ËÍ¿¤¨¤ë¥­¡¼ */ + uid_t \fBuid\fP; /* ½êÍ­¼Ô¤Î¼Â¸ú UID */ + gid_t \fBgid\fP; /* ½êÍ­¼Ô¤Î¼Â¸ú GID */ + uid_t cuid; /* ºîÀ®¼Ô¤Î¼Â¸ú UID */ + gid_t cgid; /* ºîÀ®¼Ô¤Î¼Â¸ú GID */ + unsigned short \fBmode\fP; /* µö²Ä */ + unsigned short __seq; /* ¥·¡¼¥±¥ó¥¹ÈÖ¹æ */ +}; +.in +.fi +.PP +.I cmd +¤È¤·¤ÆÍ­¸ú¤ÊÃͤÏ: +.TP +.B IPC_STAT +.I msqid +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¡¦¥Ç¡¼¥¿¹½Â¤ÂΤ«¤é¡¢¥Ý¥¤¥ó¥¿ +.I buf +¤¬»Ø¤·¼¨¤¹ +.I msqid_ds +¹½Â¤ÂΤ˾ðÊó¤ò¥³¥Ô¡¼¤¹¤ë¡£ +¸Æ¤Ó½Ð¤·Â¦¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÂФ¹¤ëÆɤ߹þ¤ßµö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B IPC_SET +¥Ý¥¤¥ó¥¿ +.I buf +¤¬»Ø¤·¼¨¤¹ +.I msqid_ds +¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤ÎÃͤò¡¢¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿ +¥«¡¼¥Í¥ë¡¦¥Ç¡¼¥¿¹½Â¤ÂΤ˽ñ¤­¹þ¤ß¡¢ +.I msg_ctime +¥á¥ó¥Ð¡¼¤â¹¹¿·¤¹¤ë¡£ +¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Î¤¦¤Á¡¢¹¹¿·¤µ¤ì¤ë¤â¤Î¤ò°Ê²¼¤Ë¼¨¤¹: +.IR msg_qbytes , +.IR msg_perm.uid , +.IR msg_perm.gid , +.I msg_perm.mode +(¤Î²¼°Ì 9 ¥Ó¥Ã¥È)¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬¡¢¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î½êÍ­¼Ô +.RI ( msg_perm.uid ) +¤Þ¤¿¤ÏºîÀ®¼Ô +.RI ( msg_perm.cuid ) +¤È°ìÃפ¹¤ë¤«¡¢¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I msg_qbytes +¤ò¥·¥¹¥Æ¥à¡¦¥Ñ¥é¥á¡¼¥¿¤Î +.B MSGMNB +¤òĶ¤¨¤ÆÀßÄꤹ¤ë¤Ë¤Ï¡¢Å¬ÀÚ¤ÊÆø¢ (Linux ¤Ç¤Ï +.B CAP_IPC_RESOURCE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability)) ¤¬É¬ÍפǤ¢¤ë¡£ +.TP +.B IPC_RMID +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ò¤¿¤À¤Á¤Ëºï½ü¤¹¤ë¡£ +Ʊ»þ¤Ë¤½¤Î¹½Â¤ÂΤÎÆɤ߽ñ¤­¤ÎÂÔ¤Á¾õÂ֤ˤ¢¤Ã¤¿¥×¥í¥»¥¹¤ËÄÌÃΤ¹¤ë +(¥¨¥é¡¼¤¬Ê֤ꡢ +.I errno +¤¬ +.B EIDRM +¤ËÀßÄꤵ¤ì¤ë)¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬Å¬ÀÚ¤ÊÆø¢¤ò»ý¤Ã¤Æ¤¤¤ë¤«¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ÎºîÀ®¼Ô¤« +½êÍ­¼Ô¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BR IPC_INFO " (Linux ¸ÇÍ­)" +¥·¥¹¥Æ¥àÁ´ÂΤǤΥá¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ÎÀ©¸Â¤È¥Ñ¥é¥á¡¼¥¿¤Ë´Ø¤¹¤ë¾ðÊó¤ò¡¢ +.I buf +¤¬»Ø¤¹¹½Â¤ÂΤËÆþ¤ì¤ÆÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï +.I msginfo +·¿¤Ç¤¢¤ë (¤½¤Î¤¿¤á¥­¥ã¥¹¥È¤¬É¬ÍפǤ¢¤ë)¡£ +.I msginfo +¤Ï +.B _GNU_SOURCE +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.nf +.in +4n + +struct msginfo { + int msgpool; /* ¥á¥Ã¥»¡¼¥¸¡¦¥Ç¡¼¥¿¤ÎÊÝ»ý¤Ë»ÈÍѤµ¤ì¤ë + ¥Ð¥Ã¥Õ¥¡¡¦¥×¡¼¥ë¤ÎÂ礭¤µ (1024 ¥Ð¥¤¥Èñ°Ì); + ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + int msgmap; /* ¥á¥Ã¥»¡¼¥¸¡¦¥Þ¥Ã¥×¤ÎºÇÂ票¥ó¥È¥ê¿ô; + ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + int msgmax; /* °ì¤Ä¤Î¥á¥Ã¥»¡¼¥¸¤Ë½ñ¤­¹þ¤ß²Äǽ¤Ê + ºÇÂç¥Ð¥¤¥È¿ô */ + int msgmnb; /* °ì¤Ä¤Î¥­¥å¡¼¤Ë½ñ¤­¹þ¤ß²Äǽ¤ÊºÇÂç¥Ð¥¤¥È¿ô; + (msgget(2) ¤Ç¤Î) ¥­¥å¡¼ºîÀ®Ãæ¤Î msg_qbytes + ¤Î½é´ü²½¤Ë»ÈÍѤµ¤ì¤ë */ + int msgmni; /* ¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¿ô¤ÎºÇÂçÃÍ */ + int msgssz; /* ¥á¥Ã¥»¡¼¥¸¡¦¥»¥°¥á¥ó¥È¤Î¥µ¥¤¥º; + ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + int msgtql; /* ¥·¥¹¥Æ¥à¾å¤ÎÁ´¥­¥å¡¼¤ÎºÇÂç¥á¥Ã¥»¡¼¥¸¿ô; + ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + unsigned short int msgseg; + /* ºÇÂ祻¥°¥á¥ó¥È¿ô; ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ +}; + +.in +.fi +ÀßÄê +.I msgmni , +.I msgmax , +.I msgmnb +¤Ï +.I /proc +¤Ë¤¢¤ëƱ¤¸Ì¾Á°¤Î¥Õ¥¡¥¤¥ë·Ðͳ¤ÇÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +¾Ü¤·¤¯¤Ï +.BR proc (5) +¤ò»²¾È¡£ +.TP +.BR MSG_INFO " (Linux ¸ÇÍ­)" +.B IPC_INFO +¤Î¤È¤­¤ÈƱ¤¸¾ðÊó¤ò³ÊǼ¤·¤¿ +.I msginfo +¹½Â¤ÂΤòÊÖ¤¹¡£ +⤷¡¢°Ê²¼¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬ +¾ÃÈñ¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à»ñ¸»¤Ë´Ø¤¹¤ë¾ðÊ󤬳ÊǼ¤µ¤ì¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +.I msgpool +¥Õ¥£¡¼¥ë¥É¤Ï¸½ºß¥·¥¹¥Æ¥à¾å¤Ë¸ºß¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¿ô¤òÊÖ¤¹¡£ +.I msgmap +¥Õ¥£¡¼¥ë¥É¤Ï¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸Áí¿ô¤òÊÖ¤¹¡£ +.I msgtql +¥Õ¥£¡¼¥ë¥É¤Ï¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ëÁ´¥á¥Ã¥»¡¼¥¸¤Î +Áí¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +.TP +.BR MSG_STAT " (Linux ¸ÇÍ­)" +.B IPC_STAT +¤ÈƱ¤¸¤¯ +.I msqid_ds +¹½Â¤ÂΤòÊÖ¤¹¡£ +⤷¡¢ +.I msqid +°ú¤­¿ô¤Ï¡¢¥­¥å¡¼¼±Ê̻ҤǤϤʤ¯¡¢¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼ +¤Ë´Ø¤¹¤ë¾ðÊó¤ò´ÉÍý¤¹¤ë¥«¡¼¥Í¥ë¤ÎÆâÉôÇÛÎó¤Ø¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR IPC_STAT , +.BR IPC_SET , +.B IPC_RMID +¤Ï 0 ¤òÊÖ¤¹¡£ +.B IPC_INFO +¤È +.B MSG_INFO +Áàºî¤Ï¡¢À®¸ù¤¹¤ë¤È¡¢Á´¤Æ¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ë´Ø¤¹¤ë¾ðÊó¤ò +´ÉÍý¤·¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤ÎÆâÉôÇÛÎó¤Î»ÈÍÑÃ楨¥ó¥È¥ê¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î +¤¦¤ÁºÇÂçÃͤòÊÖ¤¹ +(¤³¤Î¾ðÊó¤Ï¡¢¥·¥¹¥Æ¥à¤ÎÁ´¤Æ¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ë´Ø¤¹¤ë¾ðÊó¤ò +¼èÆÀ¤¹¤ë¤¿¤á¤Ë¡¢ +.B MSG_STAT +Áàºî¤ò·«¤êÊÖ¤·¼Â¹Ô¤¹¤ëºÝ¤Ë»ÈÍѤǤ­¤ë)¡£ +.B MSG_STAT +Áàºî¤Ï¡¢À®¸ù¤¹¤ë¤È¡¢ +.I msqid +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¼±Ê̻ҤòÊÖ¤¹¡£ + +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ï°Ê²¼¤ÎÃͤÎÃæ¤Î¤É¤ì¤«°ì¤Ä¤ËÀßÄꤵ¤ì¤ë: +.TP +.B EACCES +°ú¤­¿ô +.I cmd +¤¬ +.B IPC_STAT +¤Þ¤¿¤Ï +.B MSG_STAT +¤ËÅù¤·¤¤¤¬¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼ +.I msqid +¤ËÂФ¹¤ëÆɤ߹þ¤ßµö²Ä¤ò»ý¤Ã¤Æ¤ª¤é¤º¡¢¤«¤Ä +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +°ú¤­¿ô +.I cmd +¤¬ +.B IPC_SET +¤« +.B IPC_STAT +¤Ç¡¢¥Ý¥¤¥ó¥¿ +.I buf +¤Ç»Ø¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤¬¥¢¥¯¥»¥¹²Äǽ¤Ç¤Ê¤¤¡£ +.TP +.B EIDRM +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬ºï½ü¤µ¤ì¤¿¡£ +.TP +.B EINVAL +.I cmd +¤Þ¤¿¤Ï +.I msqid +¤ËÉÔÀµ¤ÊÃͤ¬ÀßÄꤵ¤ì¤¿¡£ +¤â¤·¤¯¤Ï¡¢ +.B MSG_STAT +Áàºî¤Î¾ì¹ç¤Ë¡¢ +.I msqid +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹Ãͤ¬¸½ºß̤»ÈÍѤÎÇÛÎó¤Î¥¹¥í¥Ã¥È¤ò»²¾È¤¤¤Æ¤¤¤¿¡£ +.TP +.B EPERM +°ú¤­¿ô +.I cmd +¤¬ +.B IPC_SET +¤« +.B IPC_RMID +¤Ç¤¢¤ë¤¬¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î +.RI ( msg_perm.cuid +¤È¤·¤Æ¸«¤Ä¤«¤ë) ºîÀ®¼Ô +¤È +.RI ( msg_perm.uid +¤È¤·¤Æ¸«¤Ä¤«¤ë) ½êÍ­¼Ô¤Î¤¤¤º¤ì¤Ç¤â¤Ê¤¯¡¢ +¤«¤Ä¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ËÆø¢ (Linux ¤Ç¤Ï +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤¬¤Ê¤¤¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.\" SVID ¤Ë¤Ï EIDRM ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +.BR IPC_INFO , +.BR MSG_STAT , +.B MSG_INFO +Áàºî¤Ï¡¢ +.BR ipcs (8) +¥×¥í¥°¥é¥à¤Ç³ä¤êÅö¤ÆºÑ¤Î»ñ¸»¤Ë´Ø¤¹¤ë¾ðÊó¤òÄ󶡤¹¤ë¤¿¤á¤Ë +»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£¾­Íè¡¢¤³¤ì¤é¤ÎÁàºî¤ÏÊѹ¹¤µ¤ì¤¿¤ê¡¢ +/proc ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë°ÜÆ°¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + + +\fIstruct msqid_ds\fP Æâ¤Î¿¤¯¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +Linux 2.2 ¤Ç¤Ï +.I short +¤À¤Ã¤¿¤¬¡¢Linux 2.4 ¤Ç¤Ï +.I long +¤Ë¤Ê¤Ã¤¿¡£ +¤³¤ÎÍøÅÀ¤òÀ¸¤«¤¹¤Ë¤Ï¡¢glibc-2.1.91 °Ê¹ß¤Î´Ä¶­²¼¤Ç +ºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ì¤Ð½½Ê¬¤Ç¤¢¤ë¡£ +(¥«¡¼¥Í¥ë¤Ï¿·¤·¤¤·Á¼°¤Î¸Æ¤Ó½Ð¤·¤È¸Å¤¤·Á¼°¤Î¸Æ¤Ó½Ð¤·¤ò +.I cmd +Æâ¤Î +.B IPC_64 +¥Õ¥é¥°¤Ç¶èÊ̤¹¤ë¡£) +.SH ´ØÏ¢¹àÌÜ +.BR msgget (2), +.BR msgrcv (2), +.BR msgsnd (2), +.BR capabilities (7), +.BR mq_overview (7), +.BR svipc (7) diff --git a/release/man2/msgget.2 b/release/man2/msgget.2 new file mode 100644 index 00000000..1db557b4 --- /dev/null +++ b/release/man2/msgget.2 @@ -0,0 +1,248 @@ +.\" Copyright 1993 Giorgio Ciucci +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provflags 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. +.\" +.\" Added correction due to Nick Duffek , aeb, 960426 +.\" Modified Wed Nov 6 04:00:31 1996 by Eric S. Raymond +.\" Modified, 8 Jan 2003, Michael Kerrisk, +.\" Removed EIDRM from errors - that can't happen... +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added notes on /proc files +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Modified 2003-07-03, Akihiro MOTOKI +.\" Updated 2005-03-04, Akihiro MOTOKI +.\" +.\"WORD: message ¥á¥Ã¥»¡¼¥¸ +.\"WORD: queue ¥­¥å¡¼ +.\"WORD: identifier ¼±ÊÌ»Ò +.\"WORD: argument °ú¤­¿ô +.\"WORD: owner ½êÍ­¼Ô +.\"WORD: group ¥°¥ë¡¼¥× +.\"WORD: other ¾¿Í +.\"WORD: initialize ½é´ü²½ +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: effective group ID ¼Â¸ú¥°¥ë¡¼¥×ID +.\"WORD: current time ¸½ºß»þ¹ï +.\"WORD: destruction ÇË´þ +.\"WORD: policy Êý¿Ë +.\" +.TH MSGGET 2 2004-05-27 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +msgget \- ¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¼±Ê̻Ҥò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include + +.BI "int msgget(key_t " key ", int " msgflg ); +.fi +.SH ÀâÌÀ +.BR msgget () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I key +°ú¤­¿ô¤ÎÃͤËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¼±Ê̻ҤòÊÖ¤¹¡£ +.I key +¤ÎÃͤ¬ +.B IPC_PRIVATE +¤Î¾ì¹ç¡¢¤Þ¤¿¤Ï +.I key +¤¬ +.B IPC_PRIVATE +¤Ç¤Ê¤¯¤Æ¤â¡¢ +.I key +¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬Â¸ºß¤»¤º¡¢ +.I msgflg +¤Ë +.B IPC_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬ºîÀ®¤µ¤ì¤ë¡£ +.PP +.I msgflg +¤Ë +.B IPC_CREAT +¤È +.B IPC_EXCL +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.I key +¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬´û¤Ë¸ºß¤¹¤ë¤È¡¢ +.BR msgget () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EEXIST +¤¬ÀßÄꤵ¤ì¤ë¡£ +(¤³¤ì¤Ï +.BR open (2) +¤Ë +.B O_CREAT | O_EXCL +¤ò»ØÄꤷ¤¿¾ì¹ç¤ÎÆ°ºî¤ÈƱ¤¸¤Ç¤¢¤ë) +.PP +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ÎºîÀ®»þ¤Ë¡¢ +.I msgflg +°ú¤­¿ô¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤Ï¡¢ +¤½¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥¢¥¯¥»¥¹µö²Ä¤ÎÄêµÁ¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +¤³¤ì¤é¤Îµö²Ä¥Ó¥Ã¥È¤Ï +.BR open (2) +¤Î°ú¤­¿ô +.I mode +¤ÈƱ¤¸·Á¼°¤ÇƱ¤¸°ÕÌ£¤Ç¤¢¤ë¡£ +¤ä +.BR creat (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Î¥¢¥¯¥»¥¹µö²Ä¥Ñ¥é¥á¡¼¥¿¤ÈƱ¤¸·Á¼°¤Ç¡¢Æ±¤¸°ÕÌ£¤ò»ý¤Ä¡£ +(⤷¡¢¼Â¹Ô (execute) µö²Ä¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£) +.PP +¿·µ¬¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤òºîÀ®¤¹¤ëºÝ¡¢ +.BR msgget () +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥Ç¡¼¥¿¹½Â¤ÂÎ +.I msqid_ds +¤ò°Ê²¼¤Î¤è¤¦¤Ë½é´ü²½¤¹¤ë +.RI ( msqid_ds +¤Ë¤Ä¤¤¤Æ¤Ï +.BR msgctl (2) +¤ò»²¾È): +.IP +.I msg_perm.cuid +¤È +.I msg_perm.uid +¤Ë¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ID ¤òÀßÄꤹ¤ë¡£ +.IP +.I msg_perm.cgid +¤È +.I msg_perm.gid +¤Ë¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥°¥ë¡¼¥×ID ¤òÀßÄꤹ¤ë¡£ +.IP +.I msg_perm.mode +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤Ï +.I msgflg +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤òÀßÄꤹ¤ë¡£ +.IP +.IR msg_qnum , +.IR msg_lspid , +.IR msg_lrpid , +.IR msg_stime , +.I msg_rtime +¤Ë 0 ¤òÀßÄꤵ¤ì¤ë¡£ +.IP +.I msg_ctime +¤Ë¸½ºß¤Î»þ¹ï¤òÀßÄꤹ¤ë¡£ +.IP +.I msg_qbytes +¤Ë¡¢¥·¥¹¥Æ¥à¤Ç·è¤á¤é¤ì¤¿¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ÎºÇÂ祵¥¤¥º +.B MSGMNB +¤òÀßÄꤹ¤ë¡£ +.PP +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ï¡¢¥¢¥¯¥»¥¹µö²Ä¤Î¸¡ºº¤È¡¢ +ÇË´þ (destruction) ¥Þ¡¼¥¯¤¬¤Ê¤¤¤«¤Î³Îǧ¤¬¹Ô¤ï¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ÊÖ¤êÃͤϥá¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¼±ÊÌ»Ò (ÈóÉé¤ÎÀ°¿ô) ¤È¤Ê¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤Ë¤½¤Î¥¨¥é¡¼¤¬¼¨¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ë°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤¬ÀßÄꤵ¤ì¤ë: +.TP +.B EACCES +.I key +¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ï¸ºß¤¹¤ë¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï¤½¤Î¥­¥å¡¼¤ËÂФ¹¤ë¥¢¥¯¥»¥¹µö²Ä¤¬¤Ê¤¯¡¢ +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EEXIST +.I key +¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬Â¸ºß¤·¡¢ +.I msgflg +¤Ë +.B IPC_CREAT +¤È +.B IPC_EXCL +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¡£ +.TP +.B ENOENT +.I key +¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬Â¸ºß¤»¤º¡¢ +.I msgflg +¤Ë +.B IPC_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤òºîÀ®¤·¤è¤¦¤È¤·¤¿¤¬¡¢¿·¤·¤¤¥Ç¡¼¥¿¹½Â¤ÂΤòºîÀ® +¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOSPC +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤òºîÀ®¤·¤è¤¦¤È¤·¤¿¤¬¡¢ºîÀ®¤¹¤ë¤È +¥·¥¹¥Æ¥àÁ´ÂΤΥá¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¿ô¤ÎºÇÂçÃÍ +.RB ( MSGMNI ) +¤òĶ¤¨¤Æ¤·¤Þ¤¦¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.SH Ãí°Õ +.B IPC_PRIVATE +¤Ï¥Õ¥é¥°¤Ç¤Ï¤Ê¤¯¡¢ +.I key_t +·¿¤Ç¤¢¤ë¡£ +¤³¤ÎÆÃÊ̤ÊÃͤ¬ +.I key +¤È¤·¤Æ»ÈÍѤµ¤ì¤¿¾ì¹ç¡¢ +.BR msgget () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I msgflg +¤Î²¼°Ì 9 ¥Ó¥Ã¥È°Ê³°¤ÎÁ´¤Æ¤ò̵»ë¤·¤Æ +(À®¸ù¤·¤¿¾ì¹ç¤Ï) ¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤òºîÀ®¤¹¤ë¡£ +.PP +.BR msgget () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î»ñ¸»¤Î +¥·¥¹¥Æ¥à¤È¤·¤Æ¤ÎÀ©¸Â¤ò°Ê²¼¤Ë¼¨¤¹: +.TP +.B MSGMNI +¥·¥¹¥Æ¥àÁ´ÂΤΥá¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¿ô¤ÎºÇÂçÃÍ: Êý¿Ë°Í¸ +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/msgmni +·Ðͳ¤Ç»²¾È¤·¤¿¤ê¡¢Êѹ¹¤·¤¿¤ê¤Ç¤­¤ë)¡£ +.SS Linux ¤Ç¤ÎÃí°Õ +Linux 2.3.20 ¤Þ¤Ç¤Ï¡¢ºï½ü¤¬Í½Äꤵ¤ì¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÂФ·¤Æ +.BR msgget () +¤ò¹Ô¤¦¤È +.B EIDRM +¤¬¥¨¥é¡¼¤È¤·¤ÆÊÖ¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£ +.SH ¥Ð¥° +.B IPC_PRIVATE +¤È¤¤¤¦Ì¾Á°¤òÁª¤ó¤À¤Î¤Ï¤ª¤½¤é¤¯¼ºÇԤǤ¢¤í¤¦¡£ +.B IPC_NEW +¤ÎÊý¤¬¤è¤êÌÀ³Î¤Ë¤½¤Îµ¡Ç½¤òɽ¤·¤Æ¤¤¤ë¤À¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR msgctl (2), +.BR msgrcv (2), +.BR msgsnd (2), +.BR ftok (3), +.BR capabilities (7), +.BR mq_overview (7), +.BR svipc (7) diff --git a/release/man2/msgop.2 b/release/man2/msgop.2 new file mode 100644 index 00000000..087d0b29 --- /dev/null +++ b/release/man2/msgop.2 @@ -0,0 +1,446 @@ +.\" Copyright 1993 Giorgio Ciucci +.\" +.\" 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 Tue Oct 22 16:40:11 1996 by Eric S. Raymond +.\" Modified Mon Jul 10 21:09:59 2000 by aeb +.\" Modified 1 Jun 2002, Michael Kerrisk +.\" Language clean-ups. +.\" Enhanced and corrected information on msg_qbytes, MSGMNB and MSGMAX +.\" Added note on restart behavior of msgsnd() and msgrcv() +.\" Formatting clean-ups (argument and field names marked as .I +.\" instead of .B) +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added notes on /proc files +.\" FIXME . Add example programs to this page. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Modified 2000-09-23, HANATAKA Shinya +.\" Updated 2002-11-26, Kentaro Shirakata +.\" Updated 2005-03-04, Akihiro MOTOKI +.\" Updated 2006-03-05, Akihiro MOTOKI, LDP v2.25 +.\" Updated 2008-08-09, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: message ¥á¥Ã¥»¡¼¥¸ +.\"WORD: operation Áàºî +.\"WORD: queue ¥­¥å¡¼ +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: catch Êá³Í(catch) +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: suspend Ää»ß(suspend) +.\"WORD: sleep Ää»ß(sleep) +.\"WORD: block Ää»ß(block) +.\"WORD: process-ID ¥×¥í¥»¥¹ID +.\"WORD: type ·¿ +.\"WORD: policy Êý¿Ë +.\"WORD: super-user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\"WORD: current time ¸½ºß»þ¹ï +.\"WORD: implement ¼ÂÁõ +.\" +.TH MSGOP 2 2008-04-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +msgrcv, msgsnd \- ¥á¥Ã¥»¡¼¥¸Áàºî +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int msgsnd(int " msqid ", const void *" msgp ", size_t " msgsz \ +", int " msgflg ); +.sp +.BI "ssize_t msgrcv(int " msqid ", void *" msgp ", size_t " msgsz \ +", long " msgtyp , +.BI " int " msgflg ); +.fi +.SH ÀâÌÀ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR msgsnd () +¤È +.BR msgrcv () +¤Ï¤½¤ì¤¾¤ì¡¢¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ø¤Î¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®¤È¡¢ +¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®¤Ë»ÈÍѤµ¤ì¤ë¡£¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï¡¢ +¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤¹¤ë¤¿¤á¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÂФ¹¤ë½ñ¤­¹þ¤ßµö²Ä¤ò¡¢ +¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë¤¿¤á¤Ë¤ÏÆɤ߽Ф·µö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï°Ê²¼¤Ë¼¨¤¹¹½Â¤ÂΤòÍÑ°Õ¤·¡¢¤³¤Î¹½Â¤ÂΤؤΠ+¥Ý¥¤¥ó¥¿¤ò +.msgp +°ú¤­¿ô¤È¤·¤ÆÅϤ¹¡£ +.in +4n +.nf + +struct msgbuf { + long mtype; /* message type, must be > 0 */ + char mtext[1]; /* message data */ +}; +.fi +.in +.PP +.I mtext +¥Õ¥£¡¼¥ë¥É¤ÏÇÛÎó (¤Þ¤¿¤Ï¾¤Î¹½Â¤ÂÎ) ¤Ç¡¢¤½¤ÎÂ礭¤µ¤Ï +ÈóÉé¤ÎÀ°¿ô¤Ç¤¢¤ë +.I msgsz +¤Ç»ØÄꤵ¤ì¤ë¡£ +Ťµ 0 ¤Î¥á¥Ã¥»¡¼¥¸ (¤Ä¤Þ¤ê +.I mtext +¥Õ¥£¡¼¥ë¥É¤¬¤Ê¤¤¥á¥Ã¥»¡¼¥¸) ¤âǧ¤á¤é¤ì¤Æ¤¤¤ë¡£ +.B mtype +¥Õ¥£¡¼¥ë¥É¤Ï¸·Ì©¤ËÀµ¤ÎÀ°¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ÎÃͤϡ¢¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë¥×¥í¥»¥¹¤Ç¥á¥Ã¥»¡¼¥¸¤òÁªÂò¤¹¤ë¤¿¤á¤Ë +»ÈÍѤµ¤ì¤ë (²¼µ­¤Î +.BR msgrcv () +¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È)¡£ +.SS msgsnd() +.BR msgsnd () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I msgp +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤Î¥³¥Ô¡¼¤ò +.I msqid +¤Ç»ØÄꤵ¤ì¤¿¼±Ê̻Ҥò»ý¤Ä¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ØÄɲ乤롣 +.PP +¥­¥å¡¼¤Ë½½Ê¬¤Ê¶õ¤­ÍÆÎ̤¬¤¢¤ë¾ì¹ç¡¢ +.BR msgsnd () +¤Ïľ¤Á¤ËÀ®¸ù¤¹¤ë¡£ +(¥­¥å¡¼¤ÎÍÆÎ̤ϡ¢¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥Ç¡¼¥¿¹½Â¤ÂΤΠ+.I msg_bytes +¥Õ¥£¡¼¥ë¥É¤ÇÄêµÁ¤µ¤ì¤ë¡£ +¥­¥å¡¼ºîÀ®»þ¤Ë¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï +.B MSGMNB +¤Ë½é´ü²½¤µ¤ì¤ë¤¬¡¢¤³¤ÎÀ©¸Â¤Ï +.BR msgctl (2) +¤ò»È¤Ã¤ÆÊѹ¹¤Ç¤­¤ë¡£) +¥­¥å¡¼¤Ë½½Ê¬¤Ê¶õ¤­ÍÆÎ̤¬¤Ê¤¤¾ì¹ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +.BR msgsnd () +¤Ï¶õ¤­ÍÆÎ̤¬¤Ç¤­¤ë¤Þ¤ÇÄä»ß (block) ¤¹¤ë¡£ +.I msgflg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¡£ + +Ää»ß¤·¤Æ¤¤¤ë +.BR msgsnd () +¤Ï°Ê²¼¤Î¾ì¹ç¤Ë¤â¼ºÇÔ¤¹¤ë¡£ +.IP * 2 +¥­¥å¡¼¤¬ºï½ü¤µ¤ì¤¿¡£ +¤³¤Î¾ì¹ç¡¢ +.I errno +¤Ï +.B EIDRM +¤ËÀßÄꤵ¤ì¤ë¡£ +.IP * +¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤¿¡£ +¤³¤Î¾ì¹ç¡¢ +.I errno +¤Ï +.BR EINTR +¤ËÀßÄꤵ¤ì¤ë¡£ +.BR signal (7) +»²¾È¡£ +.RB ( msgsnd () +¤Ï¡¢¤¿¤È¤¨¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÀßÄê»þ¤Ë +.B SA_RESTART +¤ò»ØÄꤷ¤Æ¤¤¤¿¤È¤·¤Æ¤â¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¸å¤Ç +¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£) +.PP +Àµ¾ï¤Ë½ªÎ»¤·¤¿¾ì¹ç¡¢¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤Ë +¹¹¿·¤µ¤ì¤ë: +.IP +.I msg_lspid +¤Ë¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP +.I msg_qnum +¤Ï 1 Áý²Ã¤¹¤ë¡£ +.IP +.I msg_stime +¤Ë¤Ï¸½ºß»þ¹ï¤¬ÀßÄꤵ¤ì¤ë¡£ +.SS msgrcv() +.BR msgrcv () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I msqid +¤Ç»ØÄꤵ¤ì¤¿¥­¥å¡¼¤«¤é¥á¥Ã¥»¡¼¥¸¤òºï½ü¤·¡¢ +.I msgp +¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë¤½¤Î¥á¥Ã¥»¡¼¥¸¤ò³ÊǼ¤¹¤ë¡£ +.PP +.I msgsz +°ú¤­¿ô¤Ë¤Ï +.I msgp +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿¹½Â¤ÂΤΠ+.I mtext +¥á¥ó¥Ð¡¼¤ÎºÇÂç¤Î¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥­¥¹¥È¤ÎŤµ¤¬ +.I msgsz +¤è¤êÂ礭¤¤¾ì¹ç¤ÎÆ°ºî¤Ï¡¢ +.I msgflg +¤Ë +.B MSG_NOERROR +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ç·è¤Þ¤ë¡£ +.B MSG_NOERROR +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥­¥¹¥È¤ÏÀÚ¤êµÍ¤á¤é¤ì¤ë +(ÀÚ¤ê¼Î¤Æ¤é¤ì¤¿Éôʬ¤Ï¼º¤ï¤ì¤ë)¡£ +.B MSG_NOERROR +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¥á¥Ã¥»¡¼¥¸¤Ï¥­¥å¡¼¤«¤éºï½ü¤µ¤ì¤º¡¢ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï \-1 ¤òÊÖ¤·¤Æ¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B E2BIG +¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +.I msgtyp +°ú¤­¿ô¤Ë¤ÏÍ׵᤹¤ë¥á¥Ã¥»¡¼¥¸¤Î·¿¤ò»ØÄꤹ¤ë¡£ +·¿¤Ï°Ê²¼¤Î¤è¤¦¤Ë»ØÄꤹ¤ë: +.IP * 2 +.I msgtyp +¤¬ 0 ¤Ê¤é¤Ð¡¢¥­¥å¡¼¤ÎºÇ½é¤Ë¤¢¤ë¥á¥Ã¥»¡¼¥¸¤¬Æɤ߹þ¤Þ¤ì¤ë¡£ +.IP * +.I msgtyp +¤¬ 0 ¤è¤êÂ礭¤¤¾ì¹ç¡¢ +.I msgflg +¤Ë +.B MSG_EXCEPT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +.I msgtyp +·¿¤Î¥­¥å¡¼¤ÎºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤¬Æɤ߹þ¤Þ¤ì¤ë¡£ +.B MSG_EXCEPT +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +.I msgtyp +·¿°Ê³°¤Î¥­¥å¡¼¤ÎºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤¬Æɤ߹þ¤Þ¤ì¤ë¡£ +.IP * +.I msgtyp +¤¬ 0 ¤è¤ê¾®¤µ¤±¤ì¤Ð¡¢ +.I msgtyp +¤ÎÀäÂÐÃͰʲ¼¤ÇºÇ¤â¾®¤µ¤¤·¿¤ò»ý¤Ä¥­¥å¡¼¤ÎºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤¬Æɤ߹þ¤Þ¤ì¤ë¡£ +.PP +.I msgflg +°ú¤­¿ô¤Ë¤Ï¡¢°Ê²¼¤Î¥Õ¥é¥°¤òǤ°Õ¤Î¿ô¤À¤± (0¸Ä¤â²Ä)¡¢¤³¤ì¤é¤Î OR ¤Ç»ØÄꤹ¤ë: +.TP +.B IPC_NOWAIT +¥­¥å¡¼¤ËÍ׵ᤵ¤ì¤¿·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ïľ¤Á¤ËÊ֤롣 +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë¤Ï +.B ENOMSG +¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +.B MSG_EXCEPT +0 ¤è¤êÂ礭¤Ê +.I msgtyp +¤È°ì½ï¤Ë»ÈÍѤ·¤Æ¡¢ +.I msgtyp +°Ê³°¤Î¥­¥å¡¼¤ÎºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤òÆɤ߹þ¤à¡£ +.TP +.B MSG_NOERROR +.I msgsz +¥Ð¥¤¥È¤è¤ê¤âŤ«¤Ã¤¿¾ì¹ç¤Ï¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥­¥¹¥È¤òÀÚ¤êµÍ¤á¤ë¡£ +.PP +Í׵ᤵ¤ì¤¿·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬Â¸ºß¤»¤º¡¢ +.I msgflg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï +°Ê²¼¤Î¤¤¤º¤ì¤«¤Î¾õ¶·¤Ë¤Ê¤ë¤Þ¤ÇÄä»ß (block) ¤µ¤ì¤ë: +.IP * 2 +Í׵ᤷ¤Æ¤¤¤ë·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬¥­¥å¡¼¤ØÆþ¤ì¤é¤ì¤¿¡£ +.IP * +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬¥·¥¹¥Æ¥à¤«¤éºï½ü¤µ¤ì¤¿¡£ +¤³¤Î¾ì¹ç¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EIDRM +¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP * +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿¡£ +¤³¤Î¾ì¹ç¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EINTR +¤¬ÀßÄꤵ¤ì¤ë¡£ +.RB ( msgrcv () +¤Ï¡¢¤¿¤È¤¨¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÀßÄê»þ¤Ë +.B SA_RESTART +¤ò»ØÄꤷ¤Æ¤¤¤¿¤È¤·¤Æ¤â¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¸å¤Ç +¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£) +.PP +¼Â¹Ô¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤Ë +¹¹¿·¤µ¤ì¤ë: +.IP +.I msg_lrpid +¤Ë¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP +.I msg_qnum +¤Ï 1 ¸º»»¤µ¤ì¤ë¡£ +.IP +.I msg_rtime +¤Ë¤Ï¸½ºß¤Î»þ¹ï¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢¤É¤Á¤é¤Î´Ø¿ô¤â \-1 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤ò +.I errno +¤Ëɽ¼¨¤¹¤ë¡£À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR msgsnd () +¤Ï 0 ¤òÊÖ¤·¡¢ +.BR msgrcv () +¤Ï +.I mtext +ÇÛÎó¤Ë¼ÂºÝ¤Ë¥³¥Ô¡¼¤·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.BR msgsnd () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.B errno +¤Ë°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤¬ÀßÄꤵ¤ì¤ë: +.TP +.B EACCES +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÂФ¹¤ë½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤¯¡¢ +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â¤Ê¤¤¡£ +.TP +.B EAGAIN +.I msg_qbytes +¤¬¥­¥å¡¼¤ÎÀ©¸Â¤òĶ¤¨¤Æ¤¤¤¿¤¿¤á¡¢¥á¥Ã¥»¡¼¥¸¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤º¡¢¤«¤Ä +.I msgflg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¡£ +.TP +.B EFAULT +.I msgp +¤¬»Ø¤·¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤¬¥¢¥¯¥»¥¹²Äǽ¤Ç¤Ê¤¤¡£ +.TP +.B EIDRM +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬ºï½ü¤µ¤ì¤¿¡£ +.TP +.B EINTR +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬Í׵ᤷ¤¿¾ò·ï¤òËþ¤¿¤¹¤Þ¤ÇÄä»ß¤·¤Æ¤¤¤ë»þ¤Ë¡¢ +¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿¡£ +.TP +.B EINVAL +.I msqid +¤¬ÉÔŬÀÚ¤ÊÃͤǤ¢¤ë¤«¡¢ +.I mtype +¤¬Àµ¤ÎÃͤǤʤ¤¤«¡¢ +.I msgsz +¤¬ÉÔŬÀÚ¤ÊÃÍ (0 °Ê²¼¤«¡¢¥·¥¹¥Æ¥à¤Ç·è¤Þ¤ëÃÍ +.B MSGMAX +¤è¤ê¤âÂ礭¤¤ÃÍ) ¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +.I msgp +¤¬»Ø¤¹¥á¥Ã¥»¡¼¥¸¤Î¥³¥Ô¡¼¤òºîÀ®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£ +.PP +.BR msgrcv () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï +.I errno +¤Ë°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤¬ÀßÄꤵ¤ì¤ë: +.TP +.B E2BIG +¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥­¥¹¥È¤ÎŤµ¤¬ +.I msgsz +¤è¤ê¤âÂ礭¤¯¡¢ +.I msgflg +¤Ë +.B MSG_NOERROR +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B EACCES +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÂФ¹¤ëÆɤ߹þ¤ßµö²Ä¤¬¤Ê¤¯¡¢ +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â¤Ê¤¤¡£ +.TP +.B EAGAIN +¥­¥å¡¼¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬¤Ê¤¯¡¢ +.I msgflg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B EFAULT +.I msgp +¤¬»Ø¤·¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤¬¥¢¥¯¥»¥¹²Äǽ¤Ç¤Ê¤¤¡£ +.TP +.B EIDRM +¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë¤¿¤á¤Ë¥×¥í¥»¥¹¤¬Ää»ß¤·¤Æ¤¤¤ë´Ö¤Ë¡¢ +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤¬ºï½ü¤µ¤ì¤¿¡£ +.TP +.B EINTR +¥á¥Ã¥»¡¼¥¸¤ò¼õ¤±¤ë¤¿¤á¤Ë¥×¥í¥»¥¹¤¬Ää»ß¤·¤Æ¤¤¤ë´Ö¤Ë¡¢ +¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.I msgqid +¤¬ÉÔÀµ¤«¡¢ +.I msgsz +¤¬ 0 ¤è¤ê¾®¤µ¤¤¡£ +.TP +.B ENOMSG +.I msgflg +¤Ë +.B IPC_NOWAIT +¤¬ÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢ +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÍ׵ᤵ¤ì¤¿·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.SH Ãí°Õ +.I msgp +°ú¤­¿ô¤Ï¡¢ libc4, libc5, glibc 2.0, glibc 2.1 ¤Ç¤Ï +\fIstruct msgbuf *\fP ¤ÈÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£glibc 2.2 °Ê¹ß¤Ç¤Ï¡¢ +SUSv2 ¤È SUSv3 ¤ÎÍ×µáÄ̤ꡢ\fIvoid *\fP ¤ÈÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£ + +°Ê²¼¤Ï +.B msgsnd +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë±Æ¶Á¤¹¤ë¥·¥¹¥Æ¥àÀ©¸Â¤Ç¤¢¤ë: +.TP +.B MSGMAX +¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥­¥¹¥È¤ÎºÇÂ祵¥¤¥º: 8192 ¥Ð¥¤¥È +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/msgmax +·Ðͳ¤ÇÆɤ߽Ф·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë)¡£ +.TP +.B MSGMNB +¥Ð¥¤¥Èñ°Ì¤Ç¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥Ç¥Õ¥©¥ë¥È¤ÎºÇÂ祵¥¤¥º : 16384 ¥Ð¥¤¥È¡£ +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/msgmnb +·Ðͳ¤ÇÆɤ߽Ф·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë)¡£ +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤Ï +.BR msgctl (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Î¥µ¥¤¥º¤ò +.B MSGMNB +¤è¤ê¤âÂ礭¤¤ÃͤËÁý¤ä¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢¥·¥¹¥Æ¥àÁ´ÂΤΥá¥Ã¥»¡¼¥¸¡¦¥Ø¥Ã¥À¡¼¤ÎºÇÂç¿ô +.RB ( MSGTQL ) +¤È¡¢¥·¥¹¥Æ¥àÁ´ÂΤΥá¥Ã¥»¡¼¥¸¡¦¥×¡¼¥ë¤ÎºÇÂç¥Ð¥¤¥È¿ô +.RB ( MSGPOOL ) +¤Ë´Ø¤·¤Æ¼ÂÁõ°Í¸¤ÎÀ©¸Â¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR msgctl (2), +.BR msgget (2), +.BR capabilities (7), +.BR mq_overview (7), +.BR svipc (7) diff --git a/release/man2/msync.2 b/release/man2/msync.2 new file mode 100644 index 00000000..babccd4e --- /dev/null +++ b/release/man2/msync.2 @@ -0,0 +1,129 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1996 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. +.\" +.\" 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 ¥á¥â¥ê¾å¤Î +.\" +.TH MSYNC 2 2008-04-22 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +msync \- ¥Õ¥¡¥¤¥ë¤ò¥Þ¥Ã¥×¤·¤¿¥á¥â¥ê¤ÈƱ´ü¤µ¤»¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int msync(void *" addr ", size_t " length ", int " flags ); +.SH ÀâÌÀ +.BR msync () +¤Ï +.BR mmap (2) +¤ò»È¤Ã¤Æ¥á¥â¥ê¤Ë¥Þ¥Ã¥×¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¡¢ +¥á¥â¥ê¾å¤Î¥³¥Ô¡¼¤Ë¤Ê¤µ¤ì¤¿Êѹ¹¤ò¥Ç¥£¥¹¥¯¤ËÈ¿±Ç¤µ¤»¤ë¡£ +¤³¤Î´Ø¿ô¤ò»ÈÍѤ·¤Ê¤¤¤È¡¢ +.BR munmap (2) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤Þ¤ÇÊѹ¹¤¬½ñ¤­Ìᤵ¤ì¤ëÊݾڤϤʤ¤¡£ +¤è¤êÀµ³Î¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤Î¤¦¤Á +.I addr +¤«¤é»Ï¤Þ¤êŤµ +.I length +¤Î¥á¥â¥êÎΰè¤ËÂбþ¤¹¤ëÉôʬ¤¬¹¹¿·¤µ¤ì¤ë¡£ + +.I flags +°ú¿ô¤Ë¤Ï¥Ó¥Ã¥È +.BR MS_ASYNC , +.BR MS_SYNC , +.B MS_INVALIDATE +¤òÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¤¬¡¢ +.B MS_ASYNC +¤È +.B MS_SYNC +¤òƱ»þ¤Ë»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.B MS_ASYNC +¤Ï¹¹¿·¤òͽÄê¤ËÁȤ߹þ¤à¤³¤È¤òɽ¤·¡¢¸Æ¤Ó½Ð¤·¤Ïľ¤Á¤ËÊ֤롣 +.B MS_SYNC +¤Ï¹¹¿·¤òÍ׵ᤷ¡¢¹¹¿·¤¬´°Î»¤¹¤ë¤Þ¤ÇÂԤġ£ +.B MS_INVALIDATE +¤Ï(¤¿¤Ã¤¿º£½ñ¤­¹þ¤ó¤À¿·¤·¤¤Ãͤǥޥåԥ󥰤ò¹¹¿·¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë) +Ʊ¤¸¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¾¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤òÍ׵᤹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ 0 ¤¬Ê֤롣¥¨¥é¡¼¤Î¾ì¹ç¡¢ \-1 ¤¬Ê֤ꡢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBUSY +I flags +¤Ë +.B MS_INVALIDATE +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹ÈϰϤ˥í¥Ã¥¯¤¬Â¸ºß¤¹¤ë¡£ +.TP +.B EINVAL +.I addr +¤¬ PAGESIZE ¤ÎÇÜ¿ô¤Ç¤Ê¤¤¡£¤Þ¤¿¤Ï¡¢ +.I flags +¤Ë +.BR MS_ASYNC ¡¢ MS_INVALIDATE ¡¢ MS_SYNC +°Ê³°¤Î¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤¿¡£ +¤Þ¤¿¤Ï¡¢ +.I flags +¤Ë +.B MS_SYNC +¤È +.B MS_ASYNC +¤ÎξÊý¤¬ÀßÄꤵ¤ì¤¿¡£ +.TP +.B ENOMEM +»ØÄꤵ¤ì¤¿¥á¥â¥ê (¤Þ¤¿¤Ï¤½¤Î°ìÉô) ¤¬¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. + +¤³¤Î´Ø¿ô¤Ï Linux 1.3.21 ¤ÇƳÆþ¤µ¤ì¤¿¤¬¡¢ +.B ENOMEM +¤Ç¤Ï¤Ê¤¯ +.B EFAULT +¤¬»È¤ï¤ì¤Æ¤¤¤¿¡£ +¤³¤ì¤Ï Linux 2.4.19 ¤Ç POSIX ¤Ë¤ª¤±¤ëÃÍ +.B ENOMEM +¤ËÊѹ¹¤µ¤ì¤¿¡£ +.SH ²ÄÍÑÀ­ +.BR msync () +¤¬»ÈÍѲÄǽ¤Ê POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï +.B _POSIX_MAPPED_FILES +¤È +.B _POSIX_SYNCHRONIZED_IO +¤ÎξÊý¤¬ \fI\fP ¤Ç 0 ¤è¤êÂ礭¤¤ÃͤËÄêµÁ¤µ¤ì¤ë¡£ +.RB ( sysconf (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ ) +.\" POSIX.1-2001: ¤³¤ì¤é¤ÎÃÍ¤Ï -1 ¤Þ¤¿¤Ï 0 ¤Þ¤¿¤Ï 200112L ¤ÈÄêµÁ¤µ¤ì¤ë¡£ +.\" -1 ¤Ï»ÈÍÑÉÔ²Äǽ¡¢ 0 ¤Ï sysconf() ¤ËÌ䤤¹ç¤ï¤»¤ë +.\" glibc ¤Ç¤Ï 1 ¤ÈÄêµÁ¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mmap (2) +.br +B.O. Gallmeister, POSIX.4, O'Reilly, pp. 128-129 and 389-391. diff --git a/release/man2/nanosleep.2 b/release/man2/nanosleep.2 new file mode 100644 index 00000000..2d22e109 --- /dev/null +++ b/release/man2/nanosleep.2 @@ -0,0 +1,238 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) Markus Kuhn, 1996 +.\" and Copyright (C) Linux Foundation, 2008, written by 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-10 Markus Kuhn +.\" First version written +.\" Modified, 2004-10-24, aeb +.\" 2008-06-24, mtk +.\" Minor rewrites of some parts. +.\" 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 +.\" +.\"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" +.SH ̾Á° +nanosleep \- ¹âÀºÅ٤ʥ¹¥ê¡¼¥× +.SH ½ñ¼° +.B #include +.sp +.BI "int nanosleep(const struct timespec *" req ", struct timespec *" rem ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR nanosleep (): +_POSIX_C_SOURCE\ >=\ 199309L +.SH ÀâÌÀ +.BR nanosleep () +¤Ï¡¢¾¯¤Ê¤¯¤È¤â +.I *req +¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¤Î´Ö¡¢¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤òÃٱ䤵¤»¤ë¡£ +.BR nanosleep () +¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤ò¡¢ +¾¯¤Ê¤¯¤È¤â +.I *req +¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¤Î´Ö¡¢¤â¤·¤¯¤Ï¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Ç¥Ï¥ó¥É¥é¤Îµ¯Æ°¤Î +¤­¤Ã¤«¤±¤È¤Ê¤ë¥·¥°¥Ê¥ë¡¢¤Þ¤¿¤Ï¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤¬ +¹Ô¤ï¤ì¤ë¤Þ¤Ç°ì»þÄä»ß¤¹¤ë¡£ + +¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢ +.BR nanosleep +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B EINTR +¤òÀßÄꤷ¡¢ +.I rem +¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð +»Ä¤ê¤Î»þ´Ö¤ò +.I rem +¤¬»Ø¤¹¹½Â¤ÂΤ˳ÊǼ¤¹¤ë¡£ +.I *rem +¤ÎÃͤò»È¤¦¤È¡¢ +.BR nanosleep () +¤ò¤â¤¦°ìÅٸƤӽФ·¤Æ¡¢»ØÄꤷ¤¿»þ´Ö¤ÎÄä»ß¤ò +´°Î»¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë (⤷¡¢¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È)¡£ + +¥Ê¥ÎÉùï¤ß¤Î»þ´Ö´Ö³Ö¤ò»ØÄꤹ¤ë¤Î¤Ë +.I timespec +¹½Â¤ÂΤ¬»ÈÍѤµ¤ì¤ë¡£¤³¤Î¹½Â¤ÂΤϼ¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf + time_t tv_sec; /* Éà */ + long tv_nsec; /* ¥Ê¥ÎÉà */ +}; +.fi +.in +.PP +¥Ê¥ÎÉäΥե£¡¼¥ë¥É¤ÎÃÍ¤Ï 0 ¤«¤é 999999999 ¤ÎÈϰϤˤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.BR sleep (3) +¤ä +.BR usleep (3) +¤ËÈæ¤Ù¤ë¤È +.BR nanosleep () +¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤ÊÍøÅÀ¤¬¤¢¤ë: +Ää»ß´ü´Ö¤Î»ØÄê¤Ë´Ø¤·¤Æ¹â¤¤»þ´Öʬ²òǽ¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£ +¥·¥°¥Ê¥ë¤È¸ß¤¤¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¤³¤È¤¬¤Ê¤¤¤È +POSIX.1 ¤ÇÌÀ¼¨Åª¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿ºÝ¤Ë¡¢Ää»ß¤òºÆ³«¤¹¤ë¤Î¤¬ +¤è¤ê´Êñ¤Ë¤Ç¤­¤ë¡£ +.SH ÊÖ¤êÃÍ +Í׵ᤵ¤ì¤¿´ü´Ö¤ÎÄä»ß¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ +.BR nanosleep () +¤Ï 0 ¤òÊÖ¤¹¡£¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¤ê¡¢ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼ÆâÍƤò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +¥æ¡¼¥¶¶õ´Ö¤«¤é¤Î¾ðÊó¤Î¥³¥Ô¡¼¤ÇÌäÂ꤬¤¢¤Ã¤¿¡£ +.TP +.B EINTR +¤½¤Î¥¹¥ì¥Ã¥É¤ËÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ë¤è¤êÄä»ß¤¬ÃæÃǤµ¤ì¤¿¡£ +¥¹¥ì¥Ã¥É¤¬´Êñ¤Ë +.BR nanosleep () +¤òºÆ¤Ó¸Æ¤Ó½Ð¤·¤ÆÄä»ß¤ò³¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¡¢ +»Ä¤ê¤ÎÄä»ß»þ´Ö¤¬ \fI*rem\fP ¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.TP +.B EINVAL +.I tv_nsec +¥Õ¥£¡¼¥ë¥É¤ÎÃͤ¬ 0 ¤«¤é 999999999 ¤Þ¤Ç¤ÎÈϰϤˤʤ«¤Ã¤¿¤«¡¢ +.I tv_sec +¤¬Éé¤Ç¤¢¤Ã¤¿¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.I req +¤Ç»ØÄꤵ¤ì¤¿´ü´Ö¤¬¡¢ÆâÉô¤Ç»ÈÍѤµ¤ì¤ë¥¯¥í¥Ã¥¯¤ÎγÅÙ¤ÎÇÜ¿ô¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤ +¾ì¹ç¡¢´ü´Ö¤Ï°ìÈֶᤤÇÜ¿ô¤ËÀÚ¤ê¾å¤²¤é¤ì¤ë¡£ +¤Þ¤¿¡¢Ää»ß¤¬´°Î»¤·¤¿¸å¡¢CPU ¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤òºÆ¤Ó¼Â¹Ô¤Ç¤­¤ë¤è¤¦¤Ë +¤Ê¤ë¤Þ¤Ç¤Ë¤ÏÃٱ䤬Æþ¤ë¡£ + +¥·¥°¥Ê¥ë¤Ë¤è¤ë³ä¤ê¹þ¤ß¸å¤Ë·«¤êÊÖ¤·ºÆ³«¤µ¤ì¤¿¾ì¹ç¡¢ +.BR nanosleep () +¤ÎÄä»ß¤¬ÁêÂÐŪ¤Ê´ü´Ö¤Ç¤¢¤ë¤³¤È¤ÏÌäÂê¤È¤Ê¤ë¤³¤È¤¬¤¢¤ë¡£ +¤³¤ì¤Ï¡¢¸Æ¤Ó½Ð¤·¤Î³ä¤ê¹þ¤ß¤«¤éºÆ³«¤Þ¤Ç¤Î´Ö¤Î»þ´Ö¤¬¸¶°ø¤Ç +Ää»ß¤¬ºÇ½ªÅª¤Ë´°Î»¤·¤¿ºÝ¤Ë»þ´Ö¤Ë¤º¤ì¤¬È¯À¸¤¹¤ë¤«¤é¤Ç¤¢¤ë¡£ +¤³¤ÎÌäÂê¤Ï¡¢ÀäÂлþ¹ï¤¬»ØÄê¤Ç¤­¤ë +.BR clock_nanosleep (2) +¤ò»È¤¦¤³¤È¤Ç²óÈò¤Ç¤­¤ë¡£ + +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 +¤³¤Î¤³¤È¤Ï¤ª¤½¤é¤¯ÌäÂê¤Ë¤Ê¤é¤Ê¤¤¤À¤í¤¦¡£ +¤Ê¤¼¤Ê¤é¡¢POSIX.1 ¤Î +.BR clock_settime () +¤Î»ÅÍͤˤϡ¢ +.B CLOCK_REALTIME +¤ÎÉÔϢ³¤ÊÊѲ½¤Ï +.BR nanosleep () +¤Ë±Æ¶Á¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡¢¤È½ñ¤«¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +.RS +.PP +.BR clock_settime () +·Ðͳ¤Ç +.B CLOCK_REALTIME +¥¯¥í¥Ã¥¯¤ÎÃͤòÀßÄꤷ¤Æ¤â¡¢ +.BR nanosleep () +´Ø¿ô¤Ê¤É¤Î +.B CLOCK_REALTIME +¤Ë´ð¤Å¤¯¥µ¡¼¥Ó¥¹¤Ë¤è¤êÁêÂÐŪ¤Ê´ü´Ö¤À¤±¼Â¹Ô¤òÄä»ß¤¹¤ë¥¹¥ì¥Ã¥É¤Ë¤Ï±Æ¶Á¤Ï¤Ê¤¤¡£ +·ë²Ì¤È¤·¤Æ¡¢¥¯¥í¥Ã¥¯Ãͤ¬¹¹¿·Á°¤«¸å¤«¤Ë´Ø¤ï¤é¤º¡¢Í׵ᤵ¤ì¤¿ÁêÂÐŪ¤Ê»þ´Ö¤¬ +·Ð²á¤¹¤ë¤ÈËþλ¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.RE +.SS °ÊÁ°¤ÎÆ°ºî +(Î㤨¤Ð¡¢»þ´Ö¤¬½ÅÍפʰÕÌ£¤ò»ý¤Ä¥Ï¡¼¥É¥¦¥§¥¢¤òÀ©¸æ¤¹¤ë¾ì¹ç¤Ê¤É) +¤è¤êÀµ³Î¤ÊÄä»ß¤òɬÍפȤ¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÂбþ¤¹¤ë¤¿¤á¤Ë¡¢ +.BR nanosleep () +¤Ï¡¢¥Þ¥¤¥¯¥íÉÃÀºÅ٤Υӥ¸¡¼¡¦¥¦¥§¥¤¥È¤òÍøÍѤ¹¤ë¤³¤È¤Ç¡¢ +2\ ms °Ê²¼¤ÎÄä»ß¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤¿¡£ +⤷¡¢¤³¤Îµ¡Ç½¤òÍøÍѤ¹¤ë¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤¬ +.B SCHED_FIFO +¤ä +.B SCHED_RR +¤È¤¤¤Ã¤¿¥ê¥¢¥ë¥¿¥¤¥à¡¦¥Ý¥ê¥·¡¼¤Î¸µ¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤ë +ɬÍפ¬¤¢¤Ã¤¿¡£ +¤³¤ÎÆÃÊ̤ʳÈÄ¥¤Ï¥«¡¼¥Í¥ë 2.5.39 ¤Çºï½ü¤µ¤ì¤¿¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +¸½ºß¤Î 2.4 ·ÏÎó¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¤³¤Îµ¡Ç½¤¬Â¸ºß¤¹¤ë¤¬¡¢ +2.6·ÏÎó¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¤Ê¤¤¡£ +.SH ¥Ð¥° +Linux 2.4 ¤Ç¤Ï¡¢ +.BR nanosleep () +¤¬ +.RB ( SIGTSTP +¤Ê¤É¤Î) ¥·¥°¥Ê¥ë¤Ë¤è¤êÄä»ß¤µ¤ì¤¿¾ì¹ç¡¢ +.BR nanosleep () +¤Î¸Æ¤Ó½Ð¤·¤Ï +.B SIGCONT +¥·¥°¥Ê¥ë¤Ë¤è¤ë¥¹¥ì¥Ã¥É¤ÎºÆ³«¸å¤Ë +.B EINTR +¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤³¤Î¸å¤ÇºÆ¥¹¥¿¡¼¥È¤µ¤ì¤¿¾ì¹ç¡¢ +¥¹¥ì¥Ã¥É¤¬Ää»ß¾õÂ֤ˤ¢¤ë´Ö¤Ë·Ð²á¤·¤¿»þ´Ö¤Ï +Ää»ß´ü´Ö¤È¤·¤Æ¥«¥¦¥ó¥È¡Ö¤µ¤ì¤Ê¤¤¡×¡£ +.SH ´ØÏ¢¹àÌÜ +.BR clock_nanosleep (2), +.BR sched_setscheduler (2), +.BR sleep (3), +.BR timer_create (2), +.BR usleep (3), +.BR time (7) diff --git a/release/man2/nfsservctl.2 b/release/man2/nfsservctl.2 new file mode 100644 index 00000000..c9d6ee14 --- /dev/null +++ b/release/man2/nfsservctl.2 @@ -0,0 +1,59 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Original text is in the public domain. +.\" +.\" FIXME The description of nfsservctl() on this page +.\" is woefully thin. +.\" +.\" Japanese Version is copyrighted. but can freely distribute. +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Aug 30 14:47:25 JST 1997 +.\" by HANATAKA Shinya +.\" +.TH NFSSERVCTL 2 1997-07-16 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +nfsservctl \- ¥«¡¼¥Í¥ë nfs ¥Ç¡¼¥â¥ó¤Î¤¿¤á¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long nfsservctl(int " cmd ", struct nfsctl_arg *" argp , +.BI " union nfsctl_res *" resp ); +.fi +.SH ÀâÌÀ +.nf +/* + * nfsctl() ¤Ë¤è¤Ã¤ÆÍý²ò¤µ¤ì¤ë¥³¥Þ¥ó¥É + */ +#define NFSCTL_SVC 0 /* ¥µ¡¼¥Ð¡¼¥×¥í¥»¥¹ */ +#define NFSCTL_ADDCLIENT 1 /* NFS ¥¯¥é¥¤¥¢¥ó¥È¤òÄɲà */ +#define NFSCTL_DELCLIENT 2 /* NFS ¥¯¥é¥¤¥¢¥ó¥É¤òºï½ü */ +#define NFSCTL_EXPORT 3 /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¨¥¯¥¹¥Ý¡¼¥È */ +#define NFSCTL_UNEXPORT 4 /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¢¥ó¥¨¥¯¥¹¥Ý¡¼¥È */ +#define NFSCTL_UGIDUPDATE 5 /* UID/GID ¥Þ¥Ã¥×¤Î¹¹¿· */ +#define NFSCTL_GETFH 6 /* (mountd ¤Ç»ÈÍѤµ¤ì¤ë) fh ¤Î¼èÆÀ */ + +struct nfsctl_arg { + int ca_version; /* safeguard */ + union { + struct nfsctl_svc u_svc; + struct nfsctl_client u_client; + struct nfsctl_export u_export; + struct nfsctl_uidmap u_umap; + struct nfsctl_fhparm u_getfh; + unsigned int u_debug; + } u; +} + +union nfsctl_res { + struct knfs_fh cr_getfh; + unsigned int cr_debug; +}; +.fi +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ½àµò +¤³¤Î¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ë¡£ diff --git a/release/man2/nice.2 b/release/man2/nice.2 new file mode 100644 index 00000000..0cd219eb --- /dev/null +++ b/release/man2/nice.2 @@ -0,0 +1,126 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt , 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 1996-11-04 by Eric S. Raymond +.\" 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" +.SH ̾Á° +nice \- ¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int nice(int " inc ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR nice (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.SH ÀâÌÀ +.BR nice () +¤Ï +.I inc +¤ÎÃͤò +.B nice +¤ò¸Æ¤ó¤À¥×¥í¥»¥¹¤Î nice Ãͤ˲䨤ë +(nice Ãͤ¬Â礭¤¤¿ôÃͤۤÉÄ㤤ͥÀèÅÙ¤òɽ¤¹)¡£ +Éé¤Î¿ô¤ò»ØÄꤹ¤ë¡¢¤Ä¤Þ¤ê¡¢°ÊÁ°¤è¤ê¤âÍ¥ÀèÅÙ¤ò¾å¤²¤ë¤È¤¤¤¦»ØÄ꤬¤Ç¤­¤ë¤Î¤Ï +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤À¤±¤Ç¤¢¤ë¡£ +nice ÃͤÎÈϰϤˤĤ¤¤Æ¤Ï +.BR getpriority (2) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢¿·¤·¤¤ nice Ãͤ¬ÊÖ¤ë (⤷¡¢²¼µ­¤Î¡ÖÃí°Õ¡×¤ò»²¾È)¡£ +¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤¬Ê֤ꡢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EPERM +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼°Ê³°¤¬ +.I inc +¤ËÉé¤Î¿ôÃͤò»ØÄꤷ¤ÆÍ¥ÀèÅÙ¤ò¾å¤²¤è¤¦¤È¤·¤¿¡£ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬ +.I inc +¤ËÉé¤Î¿ôÃͤò»ØÄꤷ¤ÆÍ¥ÀèÅÙ¤ò¾å¤²¤è¤¦¤È¤·¤¿¤¬¡¢ +½½Ê¬¤Ê¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +Linux ¤Ç¤Ï +.B CAP_SYS_NICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.RB ( setrlimit (2) +¤Î¥ê¥½¡¼¥¹¾å¸Â +.B RLIMIT_NICE +¤Ë´Ø¤¹¤ëµÄÏÀ¤â»²¾È¤Î¤³¤È)¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +¤·¤«¤·¡¢Linux ¤È (2.2.4¤è¤ê¸Å¤¤) (g)libc ¤Ç¤ÏÊÖ¤êÃͤÏɸ½à¤È°Û¤Ê¤ë¡£ +¾ÜºÙ¤Ï°Ê²¼¤ò»²¾È¤Î¤³¤È¡£ +SVr4 ¤Ë¤Ï¾¤Ë +.B EINVAL +¥¨¥é¡¼¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.SH Ãí°Õ +SUSv2 ¤È POSIX 1003.1-2003 ¤Ç¤Ï¡¢ +.BR nice () +¤Ï¿·¤·¤¤ nice ÃͤòÊÖ¤¹¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +°ìÊý¡¢Linux ¥·¥¹¥Æ¥à¥³¡¼¥ë¤È (2.2.4 ¤è¤ê¸Å¤¤) (g)libc ¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï +À®¸ù»þ¤Ë 0 ¤òÊÖ¤¹¡£¿·¤·¤¤ nice ÃÍ¤Ï +.BR getpriority (2) +¤ò»È¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£ + +glibc 2.2.4 °Ê¹ß¤Ç¤Ï¡¢ +.BR nice () +¤Ï +.BR getpriority (2) +¤ò¸Æ¤Ó½Ð¤¹¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢ +¸Æ¤Ó½Ð¤·¸µ¤ËÊÖ¤¹¿·¤·¤¤ nice Ãͤò +.BR getpriority (2) +¤ò¸Æ¤Ó½Ð¤·¤Æ¼èÆÀ¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤³¤Î¼ÂÁõ¤Ç¤Ï¡¢Àµ¾ï¤ÊÆ°ºî¤Ç¤â \-1 ¤¬ÊÖ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +³Î¼Â¤Ë¥¨¥é¡¼¤ò¸¡½Ð¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë +.I errno +¤Ë 0 ¤òÀßÄꤷ¡¢ +.BR nice () +¤¬ \-1 ¤òÊÖ¤·¤¿¤È¤­¤Ë errno ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤ÈÎɤ¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR nice (1), +.BR fork (2), +.BR getpriority (2), +.BR setpriority (2), +.BR capabilities (7), +.BR renice (8) diff --git a/release/man2/open.2 b/release/man2/open.2 new file mode 100644 index 00000000..36438c9f --- /dev/null +++ b/release/man2/open.2 @@ -0,0 +1,920 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" 2008 Greg Banks +.\" +.\" 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 by Rik Faith +.\" Modified 1994-08-21 by Michael Haardt +.\" Modified 1996-04-13 by Andries Brouwer +.\" Modified 1996-05-13 by Thomas Koenig +.\" Modified 1996-12-20 by Michael Haardt +.\" Modified 1999-02-19 by Andries Brouwer +.\" Modified 1998-11-28 by Joseph S. Myers +.\" Modified 1999-06-03 by Michael Haardt +.\" Modified 2002-05-07 by Michael Kerrisk +.\" Modified 2004-06-23 by Michael Kerrisk +.\" 2004-12-08, mtk, reordered flags list alphabetically +.\" 2004-12-08, Martin Pool (& mtk), added O_NOATIME +.\" 2007-09-18, mtk, Added description of O_CLOEXEC + other minor edits +.\" 2008-01-03, mtk, with input from Trond Myklebust +.\" and Timo Sirainen +.\" Rewrite description of O_EXCL. +.\" 2008-01-11, Greg Banks : add more detail +.\" on O_DIRECT. +.\" 2008-02-26, Michael Haardt: Reorganized text for O_CREAT and mode +.\" +.\" FIXME . Apr 08: The next POSIX revision has O_EXEC, O_SEARCH, and +.\" O_TTYINIT. Eventually these may need to be documented. --mtk +.\" FIXME Linux 2.6.33 has O_DSYNC, and a hiddden __O_SYNC. +.\" +.\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1999-08-14, HANATAKA Shinya +.\" Updated 2001-05-25, Yuichi SATO +.\" Updated & Modified 2002-01-02, Yuichi SATO +.\" Updated & Modified 2002-07-07, Yuichi SATO +.\" Updated & Modified 2002-09-19, Yuichi SATO +.\" Updated & Modified 2003-07-30, Yuichi SATO +.\" Updated & Modified 2003-11-27, Yuichi SATO +.\" Updated & Modified 2005-01-01, Yuichi SATO +.\" Updated & Modified 2005-09-14, Akihiro MOTOKI +.\" Updated & Modified 2005-10-14, Akihiro MOTOKI +.\" Updated & Modified 2006-01-18, Akihiro MOTOKI +.\" Updated & Modified 2006-04-15, Akihiro MOTOKI, LDP v2.29 +.\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" Updated 2007-10-12, Akihiro MOTOKI, LDP v2.66 +.\" Updated 2008-02-12, Akihiro MOTOKI, LDP v2.77 +.\" Updated 2008-04-04, Akihiro MOTOKI, LDP v2.79 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2010-04-23, Akihiro MOTOKI, LDP v3.24 +.\" +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: file description ¥Õ¥¡¥¤¥ëµ­½Ò +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: create ºîÀ® +.\"WORD: file offset ¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È +.\"WORD: controling terminal À©¸æüËö +.\"WORD: non-blocking I/O ÈóÄä»ß I/O +.\"WORD: synchronous I/O Ʊ´ü I/O +.\"WORD: permission µö²Ä +.\"WORD: user ¥æ¡¼¥¶¡¼ +.\"WORD: owner ½êÍ­¼Ô +.\"WORD: group ¥°¥ë¡¼¥× +.\"WORD: other ¾¿Í +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: dangling symbolic link ²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: file creation flag ¥Õ¥¡¥¤¥ëºîÀ®¥Õ¥é¥° +.\"WORD: file status flag ¥Õ¥¡¥¤¥ë¾õÂ֥ե饰 +.\" +.TH OPEN 2 2009-09-20 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +open, creat \- ¥Õ¥¡¥¤¥ë¤ä¥Ç¥Ð¥¤¥¹¤Î¥ª¡¼¥×¥ó¡¢ºîÀ®¤ò¹Ô¤¦ +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int open(const char *" pathname ", int " flags ); +.BI "int open(const char *" pathname ", int " flags ", mode_t " mode ); + +.BI "int creat(const char *" pathname ", mode_t " mode ); +.fi +.SH ÀâÌÀ +¥Õ¥¡¥¤¥ë¤Î +.I pathname +¤òÍ¿¤¨¤ë¤È¡¢ +.BR open () +¤Ï¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤³¤Î¸å¤Ë³¤¯¥·¥¹¥Æ¥à¥³¡¼¥ë +.RB ( read "(2), " write "(2), " lseek "(2), " fcntl "(2) ¤Ê¤É)" +¤Ç»ÈÍѤµ¤ì¤ë¾®¤µ¤ÊÈóÉé¤ÎÀ°¿ô¤Ç¤¢¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬À®¸ù¤·¤¿¾ì¹ç¤ËÊÖ¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +¤½¤Î¥×¥í¥»¥¹¤¬¤½¤Î»þÅÀ¤Ç¥ª¡¼¥×¥ó¤·¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î +¤¦¤ÁºÇ¾®¤Î¿ô»ú¤Î¤â¤Î¤È¤Ê¤ë¡£ +.PP +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¿·¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.BR execve (2) +¤ò¼Â¹Ô¤·¤¿¸å¤â¥ª¡¼¥×¥ó¤µ¤ì¤¿¤Þ¤Þ¤È¤Ê¤ë (¤Ä¤Þ¤ê¡¢ +.BR fcntl (2) +¤ËÀâÌÀ¤¬¤¢¤ë +.B FD_CLOEXEC +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Õ¥é¥°¤ÏºÇ½é¤Ï̵¸ú¤Ç¤¢¤ë; +¸å½Ò¤Î Linux ¸ÇÍ­¤Î¥Õ¥é¥° +.B O_CLOEXEC +¤ò»È¤¦¤È¤³¤Î¥Ç¥Õ¥©¥ë¥È¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë)¡£ +¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È (file offset) ¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤ËÀßÄꤵ¤ì¤ë +.RB ( lseek (2) +»²¾È)¡£ +.PP +.BR open () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¡Ö¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¡× +.I "(open file description)" +¤¬ºîÀ®¤µ¤ì¤ë¡£¥Õ¥¡¥¤¥ëµ­½Ò¤È¤Ï¡¢¥·¥¹¥Æ¥àÁ´ÂΤΠ+¥ª¡¼¥×¥óÃæ¤Î¥Õ¥¡¥¤¥ë¤Î¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¤Ç¤¢¤ë¡£ +¤³¤Î¥¨¥ó¥È¥ê¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤È¥Õ¥¡¥¤¥ë¾õÂ֥ե饰 +.RB ( fcntl (2) +.B F_SETFL +Áàºî¤Ë¤è¤êÊѹ¹²Äǽ) ¤¬ÊÝ»ý¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¤³¤ì¤é¤Î¥¨¥ó¥È¥ê¤Î°ì¤Ä¤Ø¤Î»²¾È¤Ç¤¢¤ë¡£ +¤³¤Î¸å¤Ç +.I pathname +¤¬ºï½ü¤µ¤ì¤¿¤ê¡¢Â¾¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¤è¤¦¤ËÊѹ¹¤µ¤ì¤¿¤ê¤·¤Æ¤â¡¢ +¤³¤Î»²¾È¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡£ +¿·¤·¤¤¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¤ÏºÇ½é¤Ï¾¤Î¤É¤Î¥×¥í¥»¥¹¤È¤â +¶¦Í­¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +.BR fork (2) +¤Ç¶¦Í­¤¬µ¯¤³¤ë¾ì¹ç¤¬¤¢¤ë¡£ +.PP +°ú¤­¿ô +.I flags +¤Ë¤Ï¡¢¥¢¥¯¥»¥¹¥â¡¼¥É +.BR O_RDONLY ", " O_WRONLY ", " O_RDWR +¤Î¤É¤ì¤«¤Ò¤È¤Ä¤¬Æþ¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤é¤Ï¤½¤ì¤¾¤ìÆɤ߹þ¤ßÀìÍÑ¡¢½ñ¤­¹þ¤ßÀìÍÑ¡¢Æɤ߽ñ¤­ÍÑ¤Ë +¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤òÍ׵᤹¤ë¤â¤Î¤Ç¤¢¤ë¡£ + +¤µ¤é¤Ë¡¢ +.I flags +¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ëºîÀ®¥Õ¥é¥° (file creation flag) ¤È¥Õ¥¡¥¤¥ë¾õÂ֥ե饰 +(file status flag) ¤ò 0 ¸Ä°Ê¾å¡Ö¥Ó¥Ã¥Èñ°Ì¤Î OR (bitwise-or)¡×¤Ç +»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.I ¥Õ¥¡¥¤¥ëºîÀ®¥Õ¥é¥° +¤Ï +.BR O_CREAT ", " O_EXCL ", " O_NOCTTY ", " O_TRUNC +¤Ç¤¢¤ë¡£ +.I ¥Õ¥¡¥¤¥ë¾õÂ֥ե饰 +¤Ï°Ê²¼¤Î¥ê¥¹¥È¤Î¤¦¤Á¾åµ­°Ê³°¤Î»Ä¤ê¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.\" FIXME . Actually is it true that the "file status flags" are all of the +.\" remaining flags listed below? SUSv4 divides the flags into: +.\" * Access mode +.\" * File creation +.\" * File status +.\" * Other (O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW) +.\" though it's not clear what the difference between "other" and +.\" "File creation" flags is. (I've raised an Aardvark to see if this +.\" can be clarified in SUSv4; 10 Oct 2008.) +Æó¼ïÎà¤Î¥Õ¥é¥°¤Î°ã¤¤¤Ï¡¢¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤ÎÊý¤Ï +.BR fcntl (2) +¤ò»È¤Ã¤Æ¤½¤ÎÆâÍƤò¼èÆÀ¤·¤¿¤ê (¾ì¹ç¤Ë¤è¤Ã¤Æ¤Ï) Êѹ¹¤·¤¿¤ê¤Ç¤­¤ëÅÀ¤Ë¤¢¤ë¡£ +¥Õ¥¡¥¤¥ëºîÀ®¥Õ¥é¥°¤È¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤ÎÁ´¥ê¥¹¥È¤ò°Ê²¼¤Ë¼¨¤¹: +.TP +.B O_APPEND +¥Õ¥¡¥¤¥ë¤òÄɲà (append) ¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤¹¤ë¡£ +Ëè²ó¤Î +.BR write (2) +¤ÎÁ°¤Ë +.BR lseek (2) +¤ò¹Ô¤Ã¤¿¤«¤Î¤è¤¦¤Ë¡¢¥Õ¥¡¥¤¥ë¡¦¥Ý¥¤¥ó¥¿¡¼¤ò¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë°ÜÆ°¤¹¤ë¡£ +.\" For more background, see +.\" http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453946 +.\" http://nfs.sourceforge.net/ +NFS ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¡¢ +.B O_APPEND +¤ò»ÈÍѤ¹¤ë¤È¡¢Ê£¿ô¤Î¥×¥í¥»¥¹¤¬¤Ò¤È¤Ä¤Î¥Õ¥¡¥¤¥ë¤ËƱ»þ¤Ë¥Ç¡¼¥¿¤òÄɲä·¤¿¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤·¤Þ¤¦¤³¤È¤¬¤¢¤ë¡£ +¤³¤ì¤Ï NFS ¤¬Äɲå⡼¥É¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤¿¤á¡¢ +¥¯¥é¥¤¥¢¥ó¥È¤Î¥«¡¼¥Í¥ë (kernel) ¤¬¤½¤ì¤ò¥·¥ß¥å¥ì¡¼¥È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Î¤À¤¬¡¢ +¶¥¹ç¾õÂÖ¤òÈò¤±¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.TP +.B O_ASYNC +¥·¥°¥Ê¥ë¶îÆ° I/O (signal-driven I/O) ¤òÍ­¸ú¤Ë¤¹¤ë: +¤³¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ø¤Î +ÆþÎϤޤ¿¤Ï½ÐÎϤ¬²Äǽ¤Ë¤Ê¤Ã¤¿¾ì¹ç¤Ë¡¢¥·¥°¥Ê¥ë¤òÀ¸À®¤¹¤ë +(¥Ç¥Õ¥©¥ë¥È¤Ï +.B SIGIO +¤Ç¤¢¤ë¤¬¡¢ +.BR fcntl (2) +¤Ë¤è¤Ã¤ÆÊѹ¹²Äǽ¤Ç¤¢¤ë)¡£ +¤³¤Îµ¡Ç½¤¬»ÈÍѲÄǽ¤Ê¤Î¤ÏüËö¡¢µ¿»÷üËö¡¢¥½¥±¥Ã¥È¤Î¤ß¤Ç¤¢¤ê¡¢ +(Linux 2.6 °Ê¹ß¤Ç¤Ï) ¥Ñ¥¤¥×¤È FIFO ¤ËÂФ·¤Æ¤â»ÈÍѤǤ­¤ë¡£ +¤µ¤é¤Ë¾Ü¤·¤¤ÀâÌÀ¤Ï +.BR fcntl (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.BR O_CLOEXEC " (Linux 2.6.23 °Ê¹ß)" +¿·¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ close-on-exec ¥Õ¥é¥°¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢¥×¥í¥°¥é¥à¤Ï +.B FD_CLOEXEC +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤¿¤á¤Î +.BR fcntl (2) +.B F_SETFD +Áàºî¤òÊÌÅӸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +¤Þ¤¿¡¢¤¢¤ë¼ï¤Î¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Î¥×¥í¥°¥é¥à¤Ï¤³¤Î¥Õ¥é¥°¤Î»ÈÍÑ¤Ï +ÉԲķç¤Ç¤¢¤ë¡£¤Ê¤¼¤Ê¤é¡¢¸ÄÊÌ¤Ë +.B FD_CLOEXEC +¥Õ¥é¥°¤òÀßÄꤹ¤ë +.BR fcntl (2) +.B F_SETFD +Áàºî¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤·¤Æ¤â¡¢¤¢¤ë¥¹¥ì¥Ã¥É¤¬¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +¥ª¡¼¥×¥ó¤¹¤ë¤Î¤ÈƱ»þ¤ËÊ̤Υ¹¥ì¥Ã¥É¤¬ +.BR fork (2) +¤È +.BR execve (2) +¤ò¼Â¹Ô¤¹¤ë¤È¤¤¤¦¶¥¹ç¾ò·ï¤òÈò¤±¤ë¤Î¤Ë¤Ï½½Ê¬¤Ç¤Ï¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.\" This flag fixes only one form of the race condition; +.\" The race can also occur with, for example, descriptors +.\" returned by accept(), pipe(), etc. +.TP +.B O_CREAT +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤ÏºîÀ® (create) ¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô (¥æ¡¼¥¶¡¼ ID) ¤Ï¡¢¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ËÀßÄꤵ¤ì¤ë¡£ +¥°¥ë¡¼¥×½êÍ­¸¢ (¥°¥ë¡¼¥× ID) ¤Ï¡¢¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID +¤Þ¤¿¤Ï¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î¥°¥ë¡¼¥× ID ¤ËÀßÄꤵ¤ì¤ë +(¤³¤ì¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¿¥¤¥×¡¢¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó¡¢ +¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î¥â¡¼¥É¤Ë°Í¸¤¹¤ë¡£ +.BR mount (8) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó +.I bsdgroups +¤È +.I sysvgroups +¤ò»²¾È)¡£ +.\" 2.6.25 »þÅÀ¤Ç¤Ï¡¢bsdgroups ¤Ï ext2, ext3, ext4, XFS ¤Ç¥µ¥Ý¡¼¥È +.\" ¤µ¤ì¤Æ¤¤¤ë (2.6.14 °Ê¹ß)¡£ +.RS +.PP +.I mode +¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¾ì¹ç¤Ë»ÈÍѤ¹¤ë¥¢¥¯¥»¥¹µö²Ä (permission) ¤ò»ØÄꤹ¤ë¡£ +.I flags +¤Ë +.B O_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.I mode +¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B O_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.I mode +¤Ï̵»ë¤µ¤ì¤ë¡£ +Í­¸ú¤Ê¥¢¥¯¥»¥¹µö²Ä¤Ï¡¢ÉáÃʤÈƱ¤¸¤è¤¦¤Ë¥×¥í¥»¥¹¤Î +.I umask +¤Ë¤è¤Ã¤Æ½¤Àµ¤µ¤ì¡¢ºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Îµö²Ä¤Ï +.I "(mode\ &\ ~umask)" +¤È¤Ê¤ë¡£ +¤³¤Î¥â¡¼¥É¤Ï¡¢¿·¤·¤¯ºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¤½¤ì°Ê¹ß¤Î¥¢¥¯¥»¥¹ +¤Ë¤Î¤ßŬÍѤµ¤ì¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +Æɤ߼è¤êÀìÍѤΥե¡¥¤¥ë¤òºîÀ®¤¹¤ë +.BR open () +¥³¡¼¥ë¤Ç¤¢¤Ã¤Æ¤â¡¢ +Æɤ߽ñ¤­²Äǽ¤Ê¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¤³¤È¤¬¤¢¤ê¤¦¤ë¡£ +.PP +.I mode +¤Î¤¿¤á¤Ë°Ê²¼¤Î¥·¥ó¥Ü¥ëÄê¿ô¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë : +.TP 9 +.B S_IRWXU +00700 ¥æ¡¼¥¶¡¼ (¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô) ¤ËÆɤ߹þ¤ß¡¢½ñ¤­¹þ¤ß¡¢ +¼Â¹Ô¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IRUSR +00400 ¥æ¡¼¥¶¡¼¤ËÆɤ߹þ¤ß¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IWUSR +00200 ¥æ¡¼¥¶¡¼¤Ë½ñ¤­¹þ¤ß¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IXUSR +00100 ¥æ¡¼¥¶¡¼¤Ë¼Â¹Ô¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IRWXG +00070 ¥°¥ë¡¼¥×¤ËÆɤ߹þ¤ß¡¢½ñ¤­¹þ¤ß¡¢¼Â¹Ô¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IRGRP +00040 ¥°¥ë¡¼¥×¤ËÆɤ߹þ¤ß¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IWGRP +00020 ¥°¥ë¡¼¥×¤Ë½ñ¤­¹þ¤ß¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IXGRP +00010 ¥°¥ë¡¼¥×¤Ë¼Â¹Ô¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IRWXO +00007 ¾¿Í (others) ¤ËÆɤ߹þ¤ß¡¢½ñ¤­¹þ¤ß¡¢¼Â¹Ô¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IROTH +00004 ¾¿Í¤ËÆɤ߹þ¤ß¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IWOTH +00002 ¾¿Í¤Ë½ñ¤­¹þ¤ß¤Îµö²Ä¤¬¤¢¤ë¡£ +.TP +.B S_IXOTH +00001 ¾¿Í¤Ë¼Â¹Ô¤Îµö²Ä¤¬¤¢¤ë¡£ +.RE +.TP +.BR O_DIRECT " (Linux 2.4.10 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë I/O ¤Î¥­¥ã¥Ã¥·¥å¤Î¸ú²Ì¤òºÇ¾®²½¤·¤è¤¦¤È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤È¡¢°ìÈÌŪ¤ËÀ­Ç½¤¬Äã²¼¤¹¤ë¡£ +¤·¤«¤·¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬Æȼ«¤Ë¥­¥ã¥Ã¥·¥ó¥°¤ò¹Ô¤Ã¤Æ¤¤¤ë¤è¤¦¤Ê +ÆÃÊ̤ʾì¹ç¤Ë¤ÏÌò¤ËΩ¤Ä¡£ +¥Õ¥¡¥¤¥ë¤Î I/O ¤Ï¥æ¡¼¥¶¡¼¶õ´Ö¥Ð¥Ã¥Õ¥¡¤ËÂФ·¤ÆľÀܹԤï¤ì¤ë¡£ +.B O_DIRECT +¥Õ¥é¥°¼«¿È¤Ï¥Ç¡¼¥¿¤òƱ´ü¤ÇžÁ÷¤·¤è¤¦¤È¤Ï¤¹¤ë¤¬¡¢ +.B O_SYNC +¤Î¤è¤¦¤Ë¥Ç¡¼¥¿¤ÈɬÍפʥ᥿¥Ç¡¼¥¿¤ÎžÁ÷¤¬Êݾڤµ¤ì¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +Ʊ´ü I/O ¤òÊݾڤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.B O_DIRECT +¤Ë²Ã¤¨¤Æ +.B O_SYNC +¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¡ÖÃí°Õ¡×¤ÎÀá (²¼µ­) ¤ÎµÄÏÀ¤â»²¾È¡£ +.sp +¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë»÷Ä̤ä¿°ÕÌ£¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ +.BR raw (8) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë (⤷¡¢¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÏÈó¿ä¾©¤Ç¤¢¤ë)¡£ +.TP +.B O_DIRECTORY +\fIpathname\fP ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð¥ª¡¼¥×¥ó¤Ï¼ºÇÔ¤¹¤ë¡£ +.\" °Ê²¼¤Îµ­»ö¤È¤½¤Î¥ê¥×¥é¥¤¤ò»²¾È¤Î¤³¤È¡£ +.\" http://marc.theaimsgroup.com/?t=112748702800001&r=1&w=2 +.\" [PATCH] open: O_DIRECTORY and O_CREAT together should fail +.\" O_DIRECTORY | O_CREAT ¤ò»ØÄꤹ¤ë¤È O_DIRECTORY ¤¬Ìµ»ë¤µ¤ì¤Æ¤·¤Þ¤¦¡£ +¤³¤Î¥Õ¥é¥°¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢ +.BR opendir (3) +¤¬ FIFO ¤ä¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ¥³¡¼¥ë¤µ¤ì¤¿¾ì¹ç¤Î +¥µ¡¼¥Ó¥¹ÉÔǽ (denial-of-service) ¹¶·â¤òÈò¤±¤ë¤¿¤á¤Ë +¥«¡¼¥Í¥ë 2.1.126 ¤ÇÄɲ䵤줿¡£ +¤·¤«¤·¤³¤ì¤Ï +.BR opendir (3) +¤Î¼ÂÁõ°Ê³°¤Ç¤Ï»ÈÍѤ¹¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B O_EXCL +¤³¤Î¸Æ¤Ó½Ð¤·¤Ç¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤ë¤³¤È¤òÊݾڤ¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬ +.B O_CREAT +¤È°ì½ï¤Ë»ØÄꤵ¤ì¡¢ +.I pathname +¤Î¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤·¤¿¾ì¹ç¡¢ +.BR open () +¤Ï¼ºÇÔ¤¹¤ë¡£ +.B O_CREAT +¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Î +.B O_EXCL +¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ + +¤³¤ì¤éÆó¤Ä¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿ºÝ¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ïé¤é¤ì¤Ê¤¤¡£ +.\" POSIX.1-2001 ¤Ç¤ÏÌÀ¼¨Åª¤Ë¤³¤ÎÆ°ºî¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +.I pathname +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¡¢ +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬¤É¤³¤ò»Ø¤·¤Æ¤¤¤ë¤«¤Ë´Ø¤ï¤é¤º +.BR open () +¤Ï¼ºÇÔ¤¹¤ë¡£ + +.B O_EXCL +¤Ï¡¢Linux 2.6 °Ê¹ß¤Ç NFSv3 °Ê¹ß¤ò»È¤Ã¤Æ¤¤¤ë NFS ¤Ç¤Î¤ß¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +NFS ¤Î +.B O_EXCL +¥µ¥Ý¡¼¥È¤¬Ä󶡤µ¤ì¤Æ¤¤¤Ê¤¤´Ä¶­¤Ç¤Ï¡¢¤³¤Î¥Õ¥é¥°¤ËÍê¤Ã¤Æ +¥í¥Ã¥¯½èÍý¤ò¼Â¹Ô¤¹¤ë¥×¥í¥°¥é¥à¤Ï¶¥¹ç¾õÂÖ (race condition) ¤Ë½Ð²ñ¤¦ +²ÄǽÀ­¤¬¤¢¤ë¡£ +¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤ÆÉÔ²Äʬ (atomic) ¤Ê¥Õ¥¡¥¤¥ë¥í¥Ã¥¯¤ò¼Â¸½¤·¡¢ +NFS ¤¬ +.B O_EXCL +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«¤Ë°Í¸¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¡¢ +°Ü¿¢À­¤Î¤¢¤ëÊýË¡¤Ï¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ë¾¤È̾Á°¤Î½Å¤Ê¤é¤Ê¤¤ +¥Õ¥¡¥¤¥ë (Î㤨¤Ð¥Û¥¹¥È̾¤È PID ¤òÁȤ߹ç¤ï¤»¤¿Ì¾Á°) ¤òºîÀ®¤·¡¢ +.BR link (2) +¤ò»ÈÍѤ·¤Æ¤½¤Î¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯¤òºîÀ®¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +.BR link (2) +¥³¡¼¥ë¤ÎÊÖ¤êÃͤ¬ 0 ¤Ê¤é¤Ð¥í¥Ã¥¯¤ËÀ®¸ù¤·¤Æ¤¤¤ë¡£ +¤¢¤ë¤¤¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ë +.BR stat (2) +¤ò»ÈÍѤ·¤Æ¥ê¥ó¥¯¿ô (link count) ¤¬ 2 ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +¤½¤¦¤Ê¤Ã¤Æ¤¤¤ì¤Ð¡¢Æ±¤¸¤¯¥í¥Ã¥¯¤ËÀ®¸ù¤·¤Æ¤¤¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.TP +.B O_LARGEFILE +(LFS) +.I off_t +¤Ç¤Ï¥µ¥¤¥º¤òɽ¤»¤Ê¤¤ (¤À¤À¤· +.I off64_t +¤Ç¤Ï¥µ¥¤¥º¤òɽ¤»¤ë) ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó²Äǽ¤Ë¤¹¤ë¡£ +¤³¤ÎÄêµÁ¤òÍ­¸ú¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.B _LARGEFILE64_SOURCE +¥Þ¥¯¥í¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +32¥Ó¥Ã¥È¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤ÆÂ礭¤Ê¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ëÊýË¡¤òÆÀ¤¿¤¤¾ì¹ç¡¢ +.RB ( O_LARGEFILE +¤ò»È¤¦¤è¤ê¤â) +.B _FILE_OFFSET_BITS +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤ò¥»¥Ã¥È¤¹¤ëÊý¤¬Ë¾¤Þ¤·¤¤ÊýË¡¤Ç¤¢¤ë +.RB ( feature_test_macros (7) +¤ò»²¾È)¡£ +.TP +.BR O_NOATIME " (Linux 2.6.8 °Ê¹ß)" +¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +.BR read (2) +¤¬¼Â¹Ô¤µ¤ì¤¿¤È¤­¤Ë¡¢ºÇ½ª¥¢¥¯¥»¥¹»þ¹ï (inode ¤Î st_atime) ¤ò¹¹¿·¤·¤Ê¤¤¡£ +¤³¤Î¥Õ¥é¥°¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹ºîÀ®¤ä¥Ð¥Ã¥¯¥¢¥Ã¥×¥×¥í¥°¥é¥à¤Ç»È¤¦¤³¤È¤ò°Õ¿Þ¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤ò»È¤¦¤È¥Ç¥£¥¹¥¯¤ËÂФ¹¤ëÁàºî¤òÂçÉý¤Ë¸º¤é¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ÏÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ·¤ÆÍ­¸ú¤Ç¤¢¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¤½¤Î°ìÎ㤬 NFS ¤Ç¤¢¤ê¡¢¥µ¡¼¥Ð¤¬¥¢¥¯¥»¥¹»þ¹ï¤ò´ÉÍý¤·¤Æ¤¤¤ë¡£ +.\" The O_NOATIME flag also affects the treatment of st_atime +.\" by mmap() and readdir(2), MTK, Dec 04. +.TP +.B O_NOCTTY +.I pathname +¤¬Ã¼Ëö (terminal) ¥Ç¥Ð¥¤¥¹ +\(em +.BR tty (4) +»²¾È +\(em +¤ò»Ø¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢¤¿¤È¤¨¤½¤Î¥×¥í¥»¥¹¤¬À©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢ +¥ª¡¼¥×¥ó¤·¤¿¥Õ¥¡¥¤¥ë¤ÏÀ©¸æüËö¤Ë¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.B O_NOFOLLOW +\fIpathname\fP ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤À¤Ã¤¿¾ì¹ç¡¢¥ª¡¼¥×¥ó¤Ï¼ºÇÔ¤¹¤ë¡£ +¤³¤ì¤Ï FreeBSD ¤Î³ÈÄ¥¤Ç¡¢Linux ¤Ë¤Ï 2.1.126 ¤è¤êÄɲ䵤줿¡£ +pathname ¤ÎÁ°¤Î¥³¥ó¥Ý¡¼¥Í¥ó¥È (earlier component; +ÌõÃð: ºÇ¸å¤Î¥Ç¥£¥ì¥¯¥È¥ê¥»¥Ñ¥ì¡¼¥¿¤è¤êÁ°¤ÎÉôʬ) ¤¬ +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ì¤¬»Ø¤¹À褬»²¾È¤µ¤ì¤ë¡£ +.\" glibc 2.0.100 °Ê¹ß¤Î¥Ø¥Ã¥À¡¼¤Ë¤Ï¤³¤Î¥Õ¥é¥°¤ÎÄêµÁ¤¬¤¢¤ë¡£ +.\" \fI2.1.126 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç»ÈÍѤ·¤¿¾ì¹ç¤Ë¤Ï̵»ë¤µ¤ì¤ë¡£\fP +.TP +.BR O_NONBLOCK " ¤Þ¤¿¤Ï " O_NDELAY +²Äǽ¤Ê¤é¤Ð¡¢¥Õ¥¡¥¤¥ë¤ÏÈóÄä»ß (nonblocking) ¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.BR open () +¤â¡¢ÊÖ¤·¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ë°Ê¸å¤Î¤¹¤Ù¤Æ¤ÎÁàºî¤â +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤òÂÔ¤¿¤»¤ë¤³¤È¤Ï¤Ê¤¤¡£ +FIFO (¥Í¡¼¥à¥É¡¦¥Ñ¥¤¥×) ¤ò°·¤¦¾ì¹ç¤Ë¤Ï +.BR fifo (7) +¤â»²¾È¤¹¤ë¤³¤È¡£ +¶¯À©¥Õ¥¡¥¤¥ë¥í¥Ã¥¯ (mandatory file lock) ¤ä¥Õ¥¡¥¤¥ë¥ê¡¼¥¹ (file lease) +¤ÈÁȤ߹ç¤ï¤»¤¿¾ì¹ç¤Î¡¢ +.B O_NONBLOCK +¤Î¸ú²Ì¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤Ï¡¢ +.BR fcntl (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.B O_SYNC +¥Õ¥¡¥¤¥ë¤ÏƱ´ü (synchronous) I/O ¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.BR open () +¤¬ÊÖ¤·¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +.BR write (2) +¤ò¹Ô¤¦¤È¡¢É¬¤º¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ò¥Ö¥í¥Ã¥¯¤·¡¢ +³ºÅö¥Ï¡¼¥É¥¦¥§¥¢¤ËʪÍýŪ¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¤Þ¤ÇÊÖ¤é¤Ê¤¤¡£ +.I °Ê²¼¤Î¡ÖÃí°Õ¡×¤Î¾Ï¤â»²¾È¡£ +.TP +.B O_TRUNC +¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤·¡¢Ä̾ï¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¡¢ +½ñ¤­¹þ¤ß²Ä¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë +(¤Ä¤Þ¤ê¡¢ +.BR O_RDWR "¤Þ¤¿¤Ï" O_WRONLY +¤Î) ¾ì¹ç¡¢Ä¹¤µ 0 ¤ËÀÚ¤êµÍ¤á (truncate) ¤é¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬ FIFO ¤Þ¤¿¤ÏüËö¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¢ +.B O_TRUNC +¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.B O_TRUNC +¤Î¸ú²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.PP +¤³¤ì¤é¤ÎÁªÂò¥Õ¥é¥°¤Î¤¤¤¯¤Ä¤«¤Ï¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤¿¸å¤Ç¤â +.BR fcntl (2) +¤ò»ÈÍѤ·¤ÆÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.BR creat () +¤Ï +.I flags +¤Ë +.B O_CREAT|O_WRONLY|O_TRUNC +¤ò»ØÄꤷ¤Æ +.BR open () +¤ò¹Ô¤¦¤Î¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR open () +¤È +.BR creat () +¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹ +(¤½¤Î¾ì¹ç¤Ï +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë)¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëÍ׵ᤵ¤ì¤¿¥¢¥¯¥»¥¹¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +.I pathname +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Î²¿¤ì¤«¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸¡º÷µö²Ä¤¬¤Ê¤«¤Ã¤¿¡£ +¤Þ¤¿¤Ï¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤»¤º¡¢¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤«¤Ã¤¿¡£ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È¡£) +.TP +.B EEXIST +.I pathname +¤Ï´û¤Ë¸ºß¤·¡¢ +.BR O_CREAT " ¤È " O_EXCL +¤¬»ÈÍѤµ¤ì¤¿¡£ +.TP +.B EFAULT +.I pathname +¤Î»Ø¤¹Îΰ褬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤Ê¤¤¡£ +.TP +.B EFBIG +.B EOVERFLOW +»²¾È¡£ +.TP +.B EINTR +ÃÙ¤¤¥Ç¥Ð¥¤¥¹ +(Î㤨¤Ð FIFO¡¢ +.BR fifo (7) +»²¾È) ¤Î¥ª¡¼¥×¥ó¤¬´°Î»¤¹¤ë¤Î¤òÂԤäÆÄä»ß¤·¤Æ¤¤¤ë´Ö¤Ë +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EISDIR +.I pathname +¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤ª¤ê¡¢½ñ¤­¹þ¤ßÍ׵᤬´Þ¤Þ¤ì¤Æ¤¤¤¿ +(¤Ä¤Þ¤ê +.B O_WRONLY +¤Þ¤¿¤Ï +.B O_RDWR +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë)¡£ +.TP +.B ELOOP +.I pathname +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +¤Þ¤¿¤Ï \fBO_NOFOLLOW\fP ¤¬»ØÄꤵ¤ì¤Æ¤ª¤ê¡¢ +.I pathname +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤À¤Ã¤¿¡£ +.TP +.B EMFILE +¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤¬¤¹¤Ç¤ËºÇÂç¿ô¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENAMETOOLONG +.I pathname +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤Î¹ç·×¿ô¤¬¥·¥¹¥Æ¥àÀ©¸Â¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENODEV +.I pathname +¤¬¥Ç¥Ð¥¤¥¹¡¦¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤ª¤ê¡¢Âбþ¤¹¤ë¥Ç¥Ð¥¤¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +(¤³¤ì¤Ï Linux ¥«¡¼¥Í¥ë¤Î¥Ð¥°¤Ç¤¢¤ê¡¢¤³¤Î¾ì¹ç¤Ë¤Ï +.B ENXIO +¤¬ÊÖ¤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë) +.TP +.B ENOENT +.B O_CREAT +¤¬ÀßÄꤵ¤ì¤Æ¤ª¤é¤º¡¢¤«¤Ä»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I pathname +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬Â¸ºß¤·¤Ê¤¤¤«²õ¤ì¤¿ (dangling) ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤ËÍøÍѤǤ­¤ë¥á¥â¥ê¤¬ÉÔ­¤·¤Æ¤¤¤ë +.TP +.B ENOSPC +.I pathname +¤òºîÀ®¤¹¤ëɬÍפ¬¤¢¤ë¤¬¡¢ +.I pathname +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥Ð¥¤¥¹¤Ë¿·¤·¤¤¥Õ¥¡¥¤¥ë¤Î¤¿¤á¤Î¶õ¤­ÍÆÎ̤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I pathname +¤Ë´Þ¤Þ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Î¤É¤ì¤«¤¬¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +¤Þ¤¿¤Ï \fBO_DIRECTORY\fP ¤¬»ØÄꤵ¤ì¤Æ¤ª¤ê¡¢ +.I pathname +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B ENXIO +.BR O_NONBLOCK " | " O_WRONLY +¤¬ÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¬ FIFO ¤Ç +¤½¤Î¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢¥Õ¥¡¥¤¥ë¤¬¥Ç¥Ð¥¤¥¹¡¦¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤Ç +Âбþ¤¹¤ë¥Ç¥Ð¥¤¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B EOVERFLOW +.I pathname +¤¬»²¾È¤·¤Æ¤¤¤ë¤Î¤¬¡¢Â礭²á¤®¤Æ¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +Ä̾¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤Ï¡¢32 ¥Ó¥Ã¥È¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¾å¤Ç +.I -D_FILE_OFFSET_BITS=64 +¤ò»ØÄꤻ¤º¤Ë¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤¬ +.I (2<31)-1 +¥Ó¥Ã¥È¤òĶ¤¨¤ë¥Õ¥¡¥¤¥ë¤ò³«¤³¤¦¤È¤·¤¿¾ì¹ç¤Ç¤¢¤ë¡£ +¾åµ­¤Î +.B O_LARGEFILE +¤â»²¾È¡£ +¤³¤ì¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ç¤¢¤ë¡£ +2.6.24 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢Linux ¤Ï¤³¤Î¾ì¹ç¤Ë¥¨¥é¡¼ +.B EFBIG +¤òÊÖ¤·¤Æ¤¤¤¿¡£ +.\" See http://bugzilla.kernel.org/show_bug.cgi?id=7253 +.\" "Open of a large file on 32-bit fails with EFBIG, should be EOVERFLOW" +.\" Reported 2006-10-03 +.TP +.B EPERM +.B O_NOATIME +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ +.\" ¸·Ì©¤Ë¸À¤¨¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID...(MTK) +¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤È°ìÃפ»¤º¡¢¤«¤Ä¸Æ¤Ó½Ð¤·¸µ¤ËÆø¢ +.RB ( CAP_FOWNER ) +¤¬¤Ê¤¤¡£ +.TP +.B EROFS +.I pathname +¤¬Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤ª¤ê¡¢ +½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¬Í׵ᤵ¤ì¤¿¡£ +.TP +.B ETXTBSY +.I pathname +¤¬¸½ºß¼Â¹ÔÃæ¤Î¼Â¹Ô¥¤¥á¡¼¥¸¤ò»²¾È¤·¤Æ¤ª¤ê¡¢½ñ¤­¹þ¤ß¤¬Í׵ᤵ¤ì¤¿¡£ +.TP +.B EWOULDBLOCK +.B O_NONBLOCK +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ë¤ÏÌ·½â¤¹¤ë¥ê¡¼¥¹¤¬ÀßÄꤵ¤ì¤Æ¤¤¤¿ +.RB ( fcntl (2) +»²¾È)¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +¥Õ¥é¥° +.BR O_DIRECTORY , +.BR O_NOATIME , +.B O_NOFOLLOW +¤Ï Linux ÆÃÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢ +¤³¤ì¤é¤Î¥Õ¥é¥°¤ÎÄêµÁ¤òÆÀ¤ë¤¿¤á¤Ë¤Ï¡¢ +.B _GNU_SOURCE +¤òÄêµÁ¤¹¤ëɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + +.BR O_CLOEXEC +¥Õ¥é¥°¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +POSIX.1-2008 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +.B O_DIRECT +¤Ï POSIX ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.B O_DIRECT +¤ÎÄêµÁ¤òÆÀ¤ë¤Ë¤Ï +.B _GNU_SOURCE +¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH Ãí°Õ +Linux ¤Ç¤Ï¡¢ +.B O_NONBLOCK +¥Õ¥é¥°¤Ï¡¢ +open ¤ò¼Â¹Ô¤·¤¿¤¤¤¬ read ¤Þ¤¿¤Ï write ¤ò¼Â¹Ô¤¹¤ë°Õ¿Þ¤Ï +ɬ¤º¤·¤â¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¤³¤ì¤Ï +.BR ioctl (2) +¤Î¤¿¤á¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë¡¢ +¥Ç¥Ð¥¤¥¹¤ò¥ª¡¼¥×¥ó¤¹¤ë¤È¤­¤Ë¤è¤¯ÍѤ¤¤é¤ì¤ë¡£ + +¡Ö¥¢¥¯¥»¥¹¥â¡¼¥É¡×¤ÎÃÍ +.BR O_RDONLY ", " O_WRONLY ", " O_RDWR +¤Ï¡¢ +.I flags +¤Ë»ØÄê¤Ç¤­¤ë¾¤ÎÃͤȰ㤤¡¢¸Ä¡¹¤Î¥Ó¥Ã¥È¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¤³¤ì¤é¤ÎÃÍ¤Ï +.I flags +¤Î²¼°Ì 2 ¥Ó¥Ã¥È¤òÄêµÁ¤¹¤ë¡£ +.BR O_RDONLY ", " O_WRONLY ", " O_RDWR +¤Ï¤½¤ì¤¾¤ì 0, 1, 2 ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¸À¤¤´¹¤¨¤ë¤È¡¢ +.B "O_RDONLY | O_WRONLY" +¤ÎÁȤ߹ç¤ï¤»¤ÏÏÀÍýŪ¤Ë´Ö°ã¤¤¤Ç¤¢¤ê¡¢³Î¤«¤Ë +.B O_RDWR +¤ÈƱ¤¸°ÕÌ£¤Ç¤Ï¤Ê¤¤¡£ +Linux ¤Ç¤Ï¡¢ÆÃÊ̤ʡ¢Èóɸ½à¤Ê¥¢¥¯¥»¥¹¥â¡¼¥É¤È¤·¤Æ 3 (¥Ð¥¤¥Ê¥ê¤Ç¤Ï 11) ¤¬ +ͽÌ󤵤ì¤Æ¤ª¤ê +.I flags +¤Ë»ØÄê¤Ç¤­¤ë¡£ +¤³¤Î¥¢¥¯¥»¥¹¥â¡¼¥É¤ò»ØÄꤹ¤ë¤È¡¢¥Õ¥¡¥¤¥ë¤ÎÆɤ߽Ф·/½ñ¤­¹þ¤ßµö²Ä¤ò¥Á¥§¥Ã¥¯¤·¡¢ +Æɤ߽Ф·¤Ë¤â½ñ¤­¹þ¤ß¤Ë¤â»ÈÍѤǤ­¤Ê¤¤¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¤³¤ÎÈóɸ½à¤Î¥¢¥¯¥»¥¹¥â¡¼¥É¤Ï¤¤¤¯¤Ä¤«¤Î Linux ¥É¥é¥¤¥Ð¤Ç»ÈÍѤµ¤ì¤Æ¤ª¤ê¡¢ +¥Ç¥Ð¥¤¥¹¸ÇÍ­¤Î +.BR ioctl (2) +Áàºî¤Ë¤Î¤ß»ÈÍѤµ¤ì¤ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¤¿¤á¤Ë»È¤ï¤ì¤Æ¤¤¤ë¡£ +.\" See for example util-linux's disk-utils/setfdprm.c +.\" For some background on access mode 3, see +.\" http://thread.gmane.org/gmane.linux.kernel/653123 +.\" "[RFC] correct flags to f_mode conversion in __dentry_open" +.\" LKML, 12 Mar 2008 +.LP +.B O_RDONLY | O_TRUNC +¤Î±Æ¶Á¤Ï̤ÄêµÁ¤Ç¤¢¤ê¡¢¤½¤ÎÆ°ºî¤Ï¼ÂÁõ¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¥Õ¥¡¥¤¥ë¤Ï¼ÂºÝ¤ËÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.\" Linux 2.0, 2.5: truncate +.\" Solaris 5.7, 5.8: truncate +.\" Irix 6.5: truncate +.\" Tru64 5.1B: truncate +.\" HP-UX 11.22: truncate +.\" FreeBSD 4.7: truncate +.PP +NFS ¤ò¼Â¸½¤·¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¤Ë¤Ï¿¤¯¤ÎÉÔÈ÷¤¬¤¢¤ê¡¢ÆÃ¤Ë +.BR O_SYNC " ¤È " O_NDELAY +¤Ë±Æ¶Á¤¹¤ë¡£ + +POSIX ¤Ç¤Ï¡¢3 ¼ïÎà¤ÎƱ´ü I/O ¤¬Ä󶡤µ¤ì¤Æ¤ª¤ê¡¢ +.BR O_SYNC , +.BR O_DSYNC , +.BR O_RSYNC +¥Õ¥é¥°¤¬¤³¤ì¤ËÂбþ¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +º£¤Î¤È¤³¤í (¥«¡¼¥Í¥ë 2.6.31)¡¢ +Linux ¤Ç¤Ï +.B O_SYNC +¤À¤±¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +glibc ¤Ï +.B O_DSYNC +¤È +.B O_RSYNC +¤Ë +.B O_SYNC +¤ÈƱ¤¸¿ôÃͤò³ä¤êÅö¤Æ¤Æ¤¤¤ë¡£ +¤Û¤È¤ó¤É¤Î Linux ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢¼ÂºÝ¤Ë¤Ï POSIX ¤Î +.B O_SYNC +¤ÎÆ°ºî¤Ç¤Ï¤Ê¤¯ +.B O_DSYNC +¤ÎÆ°ºî¤À¤±¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +POSIX ¤Î +.B O_SYNC +¤Ç¤Ï¡¢ +.BR open () +¤¬¥æ¡¼¥¶¶õ´Ö¤ËÊÖ¤ëºÝ¤Ë¡¢½ñ¤­¹þ¤ß¤Ë´Ø¤¹¤ëÁ´¤Æ¤Î¥á¥¿¥Ç¡¼¥¿¤Î +¹¹¿·¤¬¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +°ìÊý¡¢ +.B O_DSYNC +¤Ç¤Ï¡¢ +.BR open () +¤¬ÊÖ¤ë¤Þ¤Ç¤Ë¡¢¼ÂºÝ¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¡¼¥¿¤È¤½¤Î¥Ç¡¼¥¿¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë +ɬÍפʥ᥿¥Ç¡¼¥¿¤À¤±¤¬¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤ì¤Ð¤è¤¤¡£ + +.BR open () +¤Ï¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤¬¡¢ +.BR creat () +¤Ç¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤òºîÀ®¤Ç¤­¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +Âå¤ï¤ê¤Ë +.BR mknod (2) +¤ò»ÈÍѤ¹¤ë¡£ +.LP +UID ¥Þ¥Ã¥Ô¥ó¥°¤ò»ÈÍѤ·¤Æ¤¤¤ë NFS ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR open () +¤¬¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤·¤¿¾ì¹ç¤Ç¤â +.BR read (2) +¤¬ \fBEACCES\fP ¤ÇµñÈݤµ¤ì¤ë¾ì¹ç¤¬¤¢¤ë¡£ +¤³¤ì¤Ï¥¯¥é¥¤¥¢¥ó¥È¤¬¥¢¥¯¥»¥¹µö²Ä¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤Ã¤Æ +.BR open () +¤ò¼Â¹Ô¤¹¤ë¤¬¡¢Æɤ߹þ¤ß¤ä½ñ¤­¹þ¤ß¤ÎºÝ¤Ë¤Ï +¥µ¡¼¥Ð¡¼¤Ç UID ¥Þ¥Ã¥Ô¥ó¥°¤¬¹Ô¤ï¤ì¤ë¤¿¤á¤Ç¤¢¤ë¡£ + +¥Õ¥¡¥¤¥ë¤¬¿·¤·¤¯ºîÀ®¤µ¤ì¤ë¤È¡¢ +¥Õ¥¡¥¤¥ë¤Î +.IR st_atime , +.IR st_ctime , +.I st_mtime +¥Õ¥£¡¼¥ë¥É +(¤½¤ì¤¾¤ìºÇ½ª¥¢¥¯¥»¥¹»þ¹ï¡¢ºÇ½ª¾õÂÖÊѹ¹»þ¹ï¡¢ºÇ½ª½¤Àµ»þ¹ï¤Ç¤¢¤ë¡£ +.BR stat (2) +»²¾È) ¤¬¸½ºß»þ¹ï¤ËÀßÄꤵ¤ì¤ë¡£ +¤µ¤é¤Ë¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î +.I st_ctime +¤È +.I st_mtime +¤â¸½ºß»þ¹ï¤ËÀßÄꤵ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ç¡¢O_TRUNC ¥Õ¥é¥°¤Ç¥Õ¥¡¥¤¥ë¤¬½¤Àµ¤µ¤ì¤¿¤È¤­¤Ï¡¢ +¥Õ¥¡¥¤¥ë¤Î +.I st_ctime +¤È +.I st_mtime +¥Õ¥£¡¼¥ë¥É¤¬¸½ºß»þ¹ï¤ËÀßÄꤵ¤ì¤ë¡£ +.SS O_DIRECT +.LP +.B O_DIRECT +¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢¥æ¡¼¥¶¶õ´Ö¥Ð¥Ã¥Õ¥¡¤ÎŤµ¤ä¥¢¥É¥ì¥¹¡¢ +I/O ¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Ë´Ø¤·¤Æ¥¢¥é¥¤¥ó¥á¥ó¥È¤ÎÀ©¸Â¤¬²Ý¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +Linux ¤Ç¤Ï¡¢¥¢¥é¥¤¥ó¥á¥ó¥È¤ÎÀ©¸Â¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ä¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë +¤è¤Ã¤Æ°Û¤Ê¤ê¡¢Á´¤¯À©¸Â¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤â¤¢¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¸½ºß¤Î¤È¤³¤í¡¢»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ä¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ·¤Æ +¤³¤¦¤·¤¿À©¸Â¤¬¤¢¤ë¤«¤ò¸«¤Ä¤±¤ë¤¿¤á¤Î¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¸þ¤±¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÈó°Í¸¤Î¤â¤Î¤Ï¸ºß¤·¤Ê¤¤¡£ +¤¤¤¯¤Ä¤«¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢À©¸Â¤ò³Îǧ¤¹¤ë¤¿¤á¤ÎÆȼ«¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬ +Ä󶡤µ¤ì¤Æ¤¤¤ë¡£Î㤨¤Ð¡¢ +.BR xfsctl (3) +¤Î +.B XFS_IOC_DIOINFO +Ì¿Îá¤Ç¤¢¤ë¡£ +.LP +Linux 2.4 ¤Ç¤Ï¡¢Å¾Á÷¥µ¥¤¥º¡¢ +¥æ¡¼¥¶¡¼¥Ð¥Ã¥Õ¥¡¤Î¥¢¥é¥¤¥ó¥á¥ó¥È¡¢¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Ï¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÏÀÍý¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Linux 2.6 ¤Ç¤Ï¡¢512 ¥Ð¥¤¥È¤´¤È¤Î¶­³¦¤ËÇÛÃÖ¤µ¤ì¤Æ¤¤¤ì¤Ð½¼Ê¬¤Ç¤¢¤ë¡£ +.LP +.B O_DIRECT +¥Õ¥é¥°¤Ï SGI IRIX ¤ÇƳÆþ¤µ¤ì¤¿¡£SGI IRIX ¤Ë¤â Linux 2.4 ¤ÈƱÍͤΠ+(¥æ¡¼¥¶¡¼¥Ð¥Ã¥Õ¥¡¤Î) ¥¢¥é¥¤¥ó¥á¥ó¥È¤ÎÀ©¸Â¤¬¤¢¤ë¡£ +¤Þ¤¿¡¢IRIX ¤Ë¤ÏŬÀÚ¤ÊÇÛÃ֤ȥµ¥¤¥º¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Î +.BR fcntl (2) +¥³¡¼¥ë¤¬¤¢¤ë¡£ +FreeBSD 4.x ¤âƱ¤¸Ì¾Á°¤Î¥Õ¥é¥°¤òƳÆþ¤·¤¿¤¬¡¢¥¢¥é¥¤¥ó¥á¥ó¥È¤ÎÀ©¸Â¤Ï¤Ê¤¤¡£ +.LP +.B O_DIRECT +¤¬ Linux ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤¿¤Î¤Ï¡¢¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó 2.4.10 ¤Ç¤¢¤ë¡£ +¸Å¤¤ Linux ¥«¡¼¥Í¥ë¤Ï¡¢¤³¤Î¥Õ¥é¥°¤òñ¤Ë̵»ë¤¹¤ë¡£ +.B O_DIRECT +¥Õ¥é¥°¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤â¤¢¤ê¡¢¤½¤Î¾ì¹ç¤Ï¡¢ +.B O_DIRECT +¤ò»ÈÍѤ¹¤ë¤È +.BR open () +¤Ï +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.LP +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¡¢ +ÆäËƱ¤¸¥Õ¥¡¥¤¥ë¤Î½ÅÊ£¤¹¤ë¥Ð¥¤¥ÈÎΰè¤ËÂФ·¤Æ¡¢ +.B O_DIRECT +¤ÈÄ̾ï¤Î I/O ¤òº®¤¼¤Æ»È¤¦¤Î¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¤³¤Î¤è¤¦¤Ê¾õ¶·¤Ë¤ª¤¤¤Æ°ì´ÓÀ­¤ÎÌäÂê¤òÀµ¤·¤¯ +°·¤¦¤³¤È¤¬¤Ç¤­¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢Á´ÂΤΠI/O ¥¹¥ë¡¼¥×¥Ã¥È¤Ï +¤É¤Á¤é¤«°ìÊý¤ò»ÈÍѤ¹¤ë¤È¤­¤ÈÈæ¤Ù¤ÆÄ㮤ˤʤë¤Ç¤¢¤í¤¦¡£ +ƱÍͤˡ¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +.BR mmap (2) +¤ÈľÀÜ I/O +.RB ( O_DIRECT ) +¤òº®¤¼¤Æ»È¤¦¤Î¤âÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.LP +NFS ¤Ç +.B O_DIRECT +¤ò»È¤Ã¤¿¾ì¹ç¤ÎÆ°ºî¤Ï¥í¡¼¥«¥ë¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¾ì¹ç¤È°ã¤¦¡£ +¸Å¤¤¥«¡¼¥Í¥ë¤ä¡¢¤¢¤ë¼ï¤ÎÀßÄê¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥«¡¼¥Í¥ë¤Ï¡¢ +.B O_DIRECT +¤È NFS ¤ÎÁȤ߹ç¤ï¤»¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +NFS ¥×¥í¥È¥³¥ë¼«ÂΤϥµ¡¼¥Ð¤Ë¥Õ¥é¥°¤òÅϤ¹µ¡Ç½¤Ï»ý¤Ã¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢ +.B O_DIRECT +I/O ¤Ï¥¯¥é¥¤¥¢¥ó¥È¾å¤Î¥Ú¡¼¥¸¥­¥ã¥Ã¥·¥å¤ò¥Ð¥¤¥Ñ¥¹¤¹¤ë¤À¤±¤Ë¤Ê¤ê¡¢ +¥µ¡¼¥Ð¤Ï I/O ¤ò¥­¥ã¥Ã¥·¥å¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¥¯¥é¥¤¥¢¥ó¥È¤Ï¡¢ +.B O_DIRECT +¤ÎƱ´üµ¡¹½¤òÊÝ»ý¤¹¤ë¤¿¤á¡¢¥µ¡¼¥Ð¤ËÂФ·¤Æ I/O ¤òƱ´ü¤·¤Æ¹Ô¤¦¤è¤¦¤Ë°ÍÍꤹ¤ë¡£ +¥µ¡¼¥Ð¤Ë¤è¤Ã¤Æ¤Ï¡¢¤³¤¦¤·¤¿¾õ¶·²¼¡¢ÆÃ¤Ë I/O ¥µ¥¤¥º¤¬¾®¤µ¤¤¾ì¹ç¤Ë +À­Ç½¤¬Â礭¤¯Îô²½¤¹¤ë¡£ +¤Þ¤¿¡¢¥µ¡¼¥Ð¤Ë¤è¤Ã¤Æ¤Ï¡¢I/O ¤¬°ÂÄꤷ¤¿¥¹¥È¥ì¡¼¥¸¤Ë¤Þ¤Ç¹Ô¤ï¤ì¤¿¤È¡¢ +¥¯¥é¥¤¥¢¥ó¥È¤ËÂФ·¤Æ±³¤ò¤Ä¤¯¤â¤Î¤â¤¢¤ë¡£ +¤³¤ì¤Ï¡¢¥µ¡¼¥Ð¤ÎÅŸ»¸Î¾ã¤¬µ¯¤³¤Ã¤¿ºÝ¤Ë¥Ç¡¼¥¿¤Î´°Á´À­¤¬Êݤ¿¤ì¤Ê¤¤ +´í¸±¤Ï¾¯¤·¤¢¤ë¤¬¡¢À­Ç½Ì̤ǤÎÉÔÍø¤Ê¾ò·ï¤ò²óÈò¤¹¤ë¤¿¤á¤Ë¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +Linux ¤Î NFS ¥¯¥é¥¤¥¢¥ó¥È¤Ç¤Ï +.B O_DIRECT +I/O +¤Ç¤Î¥¢¥é¥¤¥ó¥á¥ó¥È¤ÎÀ©¸Â¤Ï¤Ê¤¤¡£ +.PP +¤Þ¤È¤á¤ë¤È¡¢ +.B O_DIRECT +¤Ï¡¢Ãí°Õ¤·¤Æ»È¤¦¤Ù¤­¤Ç¤¢¤ë¤¬¡¢¶¯ÎϤʥġ¼¥ë¤È¤Ê¤ë²ÄǽÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï +.B O_DIRECT +¤ò¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëÀ­Ç½¸þ¾å¤Î¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤È +¹Í¤¨¤Æ¤ª¤¯¤Î¤¬¤è¤¤¤Ç¤¢¤í¤¦¡£ +.PP +.RS +¡ÖO_DIRECT ¤Ç¤¤¤Ä¤âº¤¤ë¤Î¤Ï¡¢¥¤¥ó¥¿¥Õ¥§¡¼¥¹Á´Éô¤¬ËÜÅö¤Ë¤ªÇϼ¯¤ÊÅÀ¤À¡£ +¤¿¤Ö¤ó´í¤Ê¤¤¥Þ¥¤¥ó¥É¥³¥ó¥È¥í¡¼¥ëºÞ¤Ç +Ƭ¤¬¤ª¤«¤·¤¯¤Ê¤Ã¤¿¥µ¥ë¤¬À߷פ·¤¿¤ó¤¸¤ã¤Ê¤¤¤«¤Ê¡× \(em Linus +.RE +.SH ¥Ð¥° +¸½ºß¤Î¤È¤³¤í¡¢ +.BR open () +¤Î¸Æ¤Ó½Ð¤·»þ¤Ë +.B O_ASYNC +¤ò»ØÄꤷ¤Æ¥·¥°¥Ê¥ë¶îÆ° I/O ¤òÍ­¸ú¤Ë¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¤³¤Î¥Õ¥é¥°¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï +.BR fcntl (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.\" FIXME . Check bugzilla report on open(O_ASYNC) +.\" See http://bugzilla.kernel.org/show_bug.cgi?id=5993 +.SH ´ØÏ¢¹àÌÜ +.BR chmod (2), +.BR chown (2), +.BR close (2), +.BR dup (2), +.BR fcntl (2), +.BR link (2), +.BR lseek (2), +.BR mknod (2), +.BR mmap (2), +.BR mount (2), +.BR openat (2), +.BR read (2), +.BR socket (2), +.BR stat (2), +.BR umask (2), +.BR unlink (2), +.BR write (2), +.BR fopen (3), +.BR feature_test_macros (7), +.BR fifo (7), +.BR path_resolution (7), +.BR symlink (7) diff --git a/release/man2/openat.2 b/release/man2/openat.2 new file mode 100644 index 00000000..ee0915ae --- /dev/null +++ b/release/man2/openat.2 @@ -0,0 +1,173 @@ +.\" 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-09-27 by Yuichi SATO , LDP v2.39 +.\" +.TH OPENAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +openat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int openat(int " dirfd ", const char *" pathname ", int " flags ); +.BI "int openat(int " dirfd ", const char *" pathname ", int " flags \ +", mode_t " mode ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR openat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +.BR openat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.BR open (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I dirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( open (2) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î +ÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I pathname +¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä +.I dirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I pathname +¤Ï +.RB ( open (2) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR openat () +¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR open (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR openat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR openat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I dirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I pathname +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I dirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR openat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2008. +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 +.\" to refer to the notion of "at a relative location". +.\" +.\" See the following for a discussion of the inconsistent +.\" naming of the *at() functions: +.\" http://www.opengroup.org/austin/mailarchives/ag/msg09103.html +.\" Subject: RE: The naming of at()s is a difficult matter +.\" From: Don Cragun +.\" Date: Tue, 14 Feb 2006 14:56:50 -0800 (PST) +.\" +.SH Ãí°Õ +.BR openat () +¤ä "at" ¤¬¸å¤í¤ËÉÕ¤¤¤¿¤½¤Î¾¤ÎƱÍͤΥ·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +2 ¤Ä¤ÎÍýͳ¤Ë¤è¤êÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ + +1 ¤ÄÌܤÎÍýͳ¤Ï¡¢ +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë·²¤ò +.BR open (2) +¤Ç¥ª¡¼¥×¥ó¤¹¤ë¤È¤­¤Ëµ¯¤³¤ë²ÄǽÀ­¤¬¤¢¤ë¶¥¹ç¾õÂÖ (race condition) ¤ò¡¢ +.BR openat () +¤Ë¤è¤Ã¤Æ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬²óÈò¤Ç¤­¤ë¤¿¤á¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¶¥¹ç¾õÂ֤ϡ¢ +.BR open (2) +¤Ë»ØÄꤵ¤ì¤¿¥Ñ¥¹¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Î +(/ ¤Ç¶èÀÚ¤é¤ì¤¿) ¤¤¤¯¤Ä¤«¤Î¹½À®Í×ÁÇ (¤ò¥ª¡¼¥×¥ó¤¹¤ë½èÍý) ¤¬¡¢ +.BR open (2) +¤òÊÂÎó¤Ë¸Æ¤Ó½Ð¤¹½èÍý¤ËÊÑ´¹¤µ¤ì¤¿¾ì¹ç¤Ëµ¯¤³¤ë¡£ +¤³¤Î¤è¤¦¤Ê¶¥¹ç¤Ï¡¢Âоݥǥ£¥ì¥¯¥È¥ê¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥ª¡¼¥×¥ó¤·¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +.BR openat () +¤Î +.I dirfd +°ú¤­¿ô¤Ë»ØÄꤹ¤ë¤³¤È¤Ç²óÈò¤Ç¤­¤ë¡£ + +2 ¤ÄÌܤÎÍýͳ¤Ï¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ (·²) ¤ò»È¤¦¤³¤È¤Ç¡¢ +.BR openat () +¤¬¥¹¥ì¥Ã¥ÉËè¤Î¤¤¤ï¤æ¤ë¡Ö¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¡×¤ò¼ÂÁõ¤Ç¤­¤ë¤¿¤á¤Ç¤¢¤ë¡£ +(¤³¤Îµ¡Ç½¤Ï +.IR /proc/self/fd/ dirfd +¤ò»È¤Ã¤¿Î¢µ»¤Ç¤â¼Â¸½¤Ç¤­¤ë¤¬¡¢¤¢¤Þ¤ê¸úΨŪ¤Ç¤Ï¤Ê¤¤)¡£ +.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) diff --git a/release/man2/outb.2 b/release/man2/outb.2 new file mode 100644 index 00000000..bb10d055 --- /dev/null +++ b/release/man2/outb.2 @@ -0,0 +1,79 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Paul Gortmaker +.\" (gpg109@rsphy1.anu.edu.au) +.\" Wed Nov 29 10:58:54 EST 1995 +.\" +.\" 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) 1996 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Wed Dec 4 15:19:14 JST 1996 +.\" by HANATAKA Shinya +.\" Updated Fri Dec 14 JST 2001 by Kentaro Shirakata +.\" Updated Sun May 23 JST 2004 by Kentaro Shirakata +.\" Updated Thu Mar 24 JST 2005 by Kentaro Shirakata +.\" Updated Thu Oct 9 JST 2005 by Kentaro Shirakata +.\" +.\"WORD: inline macro ¥¤¥ó¥é¥¤¥ó¡¦¥Þ¥¯¥í +.\"WORD: unresolved reference ²ò·è¤Ç¤­¤Ê¤¤»²¾È +.\"WORD: segmentation fault ¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó°ãÈ¿ +.\" +.TH OUTB 2 1995-11-29 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +outb, outw, outl, outsb, outsw, outsl, +inb, inw, inl, insb, insw, insl, +outb_p, outw_p, outl_p, inb_p, inw_p, inl_p \- ¥Ý¡¼¥ÈÆþ½ÐÎÏ +.SH ÀâÌÀ +¤³¤Î°ìÏ¢¤Î´Ø¿ô¤Ï¥Ý¡¼¥È¤ËÂФ¹¤ëÄã¥ì¥Ù¥ë¤ÎÆþ½ÐÎϤ˻ÈÍѤ¹¤ë¡£ +out* ´Ø¿ô¤Ï¥Ý¡¼¥È½ÐÎÏ¡¢in* ´Ø¿ô¤Ï¥Ý¡¼¥ÈÆþÎϤò¹Ô¤¦¡£ +¸ìÈø¤Ë b ¤¬¤Ä¤¤¤Æ¤¤¤ë´Ø¿ô¤Ï¥Ð¥¤¥Èñ°Ì¡¢w ¤¬¤Ä¤¤¤Æ¤¤¤ë´Ø¿ô¤Ï¥ï¡¼¥Éñ°Ì¤Ç¤¢¤ë¡£ +_p ¤¬¤Ä¤¤¤Æ¤¤¤ë´Ø¿ô¤Ï I/O ¤¬½ªÎ»¤¹¤ë¤Þ¤ÇÂԤġ£ +.LP +¤³¤ì¤é¤Î´Ø¿ô¤Ï¤â¤È¤â¤È¥«¡¼¥Í¥ëÆâÉô¤Ç¤Î»ÈÍѤòÁÛÄꤷ¤ÆÀ߷פµ¤ì¤Æ¤¤¤ë¤¬¡¢ +¥æ¡¼¥¶¡¼¶õ´Ö¤«¤é¤Ç¤â»ÈÍѤǤ­¤ë¡£ +.\" ÄɲäξðÊó¤Ï +.\" .BR outb (9) +.\" ¤Ë¤¢¤ë¡£ + +\fB\-O\fP ¤ä \fB\-O2\fP ¤Ê¤É¤ò»ØÄꤷ¤Æ¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤³¤È¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¤¥ó¥é¥¤¥ó¡¦¥Þ¥¯¥í¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +ºÇŬ²½¤ò¹Ô¤ï¤Ê¤¤¤È´Ø¿ô¤ÎŸ³«¤¬¹Ô¤ï¤ì¤º¡¢ +¥ê¥ó¥¯¤Î»þ¤Ë¡Ö²ò·è¤Ç¤­¤Ê¤¤»²¾È(unresolved reference)¡×¤¬È¯À¸¤¹¤ë¡£ + +¥æ¡¼¥¶¡¼¶õ´Ö¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ I/O ¥Ý¡¼¥È¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤ò +¥«¡¼¥Í¥ë¤Ë¶µ¤¨¤ë¤¿¤á¤Ë +.BR ioperm (2) +¤â¤·¤¯¤Ï +.BR iopl (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£¤³¤ì¤ò˺¤ì¤ë¤È¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó°ãÈ¿ +(segmentation fault) ¤ò¼õ¤±¤È¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.SH ½àµò +.BR outb () +¤È¤½¤ÎÃç´Ö¤Ï¥Ï¡¼¥É¥¦¥§¥¢ÆÃÍ­¤Ç¤¢¤ë¡£ +.I value +°ú¿ô¤¬ºÇ½é¤ËÅϤµ¤ì¡¢ +.I port +°ú¿ô¤¬ÆóÈÖÌܤËÅϤµ¤ì¤ë¡£ +¤³¤Î½ç½ø¤Ï¤Û¤È¤ó¤É¤Î DOS ¤Ç¤Î¼ÂÁõ¤È¤ÏµÕ¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ioperm (2), +.BR iopl (2) diff --git a/release/man2/pause.2 b/release/man2/pause.2 new file mode 100644 index 00000000..588e10dc --- /dev/null +++ b/release/man2/pause.2 @@ -0,0 +1,68 @@ +.\" 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 Sat Jul 24 14:48:00 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995 by Mike Battersby (mib@deakin.edu.au) +.\" Modified 2000 by aeb, following Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated Thu Jun 26 21:08:30 JST 1997 +.\" by SUTO, Mitsuaki +.\" +.TH PAUSE 2 2008-10-06 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +pause \- ¥·¥°¥Ê¥ë¤òÂÔ¤Ä +.SH µ­½Ò +.B #include +.sp +.B int pause(void); +.SH ÀâÌÀ +.BR pause () +¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹ (¤Þ¤¿¤Ï¥¹¥ì¥Ã¥É) ¤ò¡¢ +¤½¤Î¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤¿¤ê¡¢¥·¥°¥Ê¥ëÊ᪴ؿô¤¬µ¯Æ°¤µ¤ì¤ë¤è¤¦¤Ê +¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¡¢¥¹¥ê¡¼¥×¤µ¤»¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR pause () +¤¬ÊÖ¤ë¤Î¤Ï¡¢¥·¥°¥Ê¥ë¤ò¼õ¤±¼è¤ê¥·¥°¥Ê¥ëÊá³Í´Ø¿ô¤«¤éÊ֤俾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +¤³¤Î¾ì¹ç¤Ï +.BR pause () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.\" .B ERESTARTNOHAND +.B EINTR +¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINTR +¥·¥°¥Ê¥ë¤ò¼õ¤±¼è¤ê¡¢¥·¥°¥Ê¥ëÊá³Í´Ø¿ô¤«¤éµ¢¤Ã¤Æ¤­¤¿¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR select (2), +.BR signal (2), +.BR sigsuspend (2) diff --git a/release/man2/pciconfig_read.2 b/release/man2/pciconfig_read.2 new file mode 100644 index 00000000..452b2deb --- /dev/null +++ b/release/man2/pciconfig_read.2 @@ -0,0 +1,119 @@ +.\" Contributed by Niki A. Rahimi, LTC Security Development +.\" narahimi@us.ibm.com +.\" May be freely distributed. +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Sat Jun 19 17:51:11 JST 2004 +.\" by Yuichi SATO +.\" +.TH PCICONFIG_READ 2 2003-07-14 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +pciconfig_read, pciconfig_write, pciconfig_iobase \- pci ¥Ç¥Ð¥¤¥¹¾ðÊó¤ò°·¤¦ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int pciconfig_read(unsigned long " bus ", unsigned long " dfn , +.BI " unsigned long " off ", unsigned long " len ", void *" buf ); +.BI "int pciconfig_write(unsigned long " bus ", unsigned long " dfn , +.BI " unsigned long " off ", unsigned long " len ", void *" buf ); +.BI "int pciconfig_iobase(long " which ", unsigned long " bus , +.BI " unsigned long " devfn ); +.fi +.SH ÀâÌÀ +.PP +PCI ¥Ç¥Ð¥¤¥¹¤È¤Î¤ä¤ê¼è¤ê (interaction) ¤Ï +¥«¡¼¥Í¥ë PCI ¥ì¥¤¥ä¤Ç¤¹¤Ç¤Ë½èÍý¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢ +Ä̾ï¤Ï¤³¤é¤é¤Î´Ø¿ô¤ò¥æ¡¼¥¶¶õ´Ö¤«¤é¥¢¥¯¥»¥¹¤¹¤ëɬÍפϤʤ¤¡£ +.TP +.BR pciconfig_read () +¥Ç¥Ð¥¤¥¹ +.I dev +¤Î¥ª¥Õ¥»¥Ã¥È +.I off +¤ÎÃͤò +.I buf +¤ËÆɤ߹þ¤à¡£ +.TP +.BR pciconfig_write () +¥Ç¥Ð¥¤¥¹ +.I dev +¤Î¥ª¥Õ¥»¥Ã¥È +.I off +¤Ë +.I buf +¤ÎÃͤò½ñ¤­¹þ¤à¡£ +.TP +.BR pciconfig_iobase () +bus/devfn ¥Ú¥¢¤ò¤³¤Î´Ø¿ô¤ËÅϤ·¡¢ +¥á¥â¥ê¥ª¥Õ¥»¥Ã¥È (prep ¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤Ï¡¢¤³¤ÎÃÍ¤Ï 0xc0000000 ¤Ç¤¢¤ë) ¤È +PIO ¥µ¥¤¥¯¥ë¤Î IO ¥Ù¡¼¥¹¤ÎʪÍý¥¢¥É¥ì¥¹¤ò¼èÆÀ¤¹¤ë¡£ +¤Þ¤¿¡¢¤â¤·¤¢¤ë¤Ê¤é¤Ð ISA hole ¤ÎʪÍý¥¢¥É¥ì¥¹¤ò¼èÆÀ¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.TP +.BR pciconfig_read () +À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.TP +.BR pciconfig_write () +À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.TP +.BR pciconfig_iobase () +.I which +¤ÎÃͤ˴ð¤Å¤¤¤Æ¡¢ÊªÍý¥á¥â¥êÆâ¤ÎÍÍ¡¹¤Ê I/O Îΰè¤Î°ÌÃÖ¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£ +.I which +¤ÎÃͤϡ¢ +.BR IOBASE_BRIDGE_NUMBER , +.BR IOBASE_MEMORY , +.BR IOBASE_IO , +.BR IOBASE_ISA_IO , +.B IOBASE_ISA_MEM +¤Ç¤¢¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I len +¤ÎÃͤ¬Ìµ¸ú¤Ç¤¢¤ë¡£ +¤³¤Î¥¨¥é¡¼¤Ï +.BR pciconfig_iobase () +¤Ë¤ÏŬÍѤµ¤ì¤Ê¤¤¡£ +.TP +.B EIO +I/O ¥¨¥é¡¼¡£ +.TP +.B ENODEV +.BR pciconfig_iobase () +¤Î¾ì¹ç¡¢¤Ç¥Û¡¼¥¹ (hose) ¤ÎÃͤ¬ NULL ¤Ç¤¢¤ë¡£ +¾¤Î¸Æ¤Ó½Ð¤·¤Î¾ì¹ç¡¢¥¹¥í¥Ã¥È (slot) ¤¬¸«¤Ä¤«¤é¤Ê¤¤¡£ +.TP +.B ENOSYS +¤³¤Î¥·¥¹¥Æ¥à¤Ï¤³¤ì¤é¤Î¸Æ¤Ó½Ð¤·¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¡£ +.RB ( CONFIG_PCI +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤)¡£ +.TP +.B EOPNOTSUPP +¤³¤ÎÊÖ¤êÃÍ¤Ï +.BR pciconfig_iobase () +¤Ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +¤³¤Î¥¨¥é¡¼¤Ï +.I which +¤ÎÃͤ¬Ìµ¸ú¤Ç¤¢¤ë¤È¤­¤ËÊÖ¤µ¤ì¤ë¡£ +.TP +.B EPERM +¥æ¡¼¥¶¤¬ +.B CAP_SYS_ADMIN +¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +¤³¤Î¥¨¥é¡¼¤Ï +.BR pciconfig_iobase () +¤Ë¤ÏŬÍѤµ¤ì¤Ê¤¤¡£ +.SH ½àµò +¤³¤ì¤é¤Î¸Æ¤Ó½Ð¤·¤Ï Linux ÆÃÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢ +Linux 2.0.26/2.1.11 ¤«¤é»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR capabilities (7) diff --git a/release/man2/personality.2 b/release/man2/personality.2 new file mode 100644 index 00000000..3ce747bd --- /dev/null +++ b/release/man2/personality.2 @@ -0,0 +1,79 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created Sat Aug 21 1995 Thomas K. Dyas +.\" +.\" typo corrected, aeb, 950825 +.\" added layout change from joey, 960722 +.\" changed prototype, documented 0xffffffff, aeb, 030101 +.\" Modified 2004-11-03 patch from Martin Schulze +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Updated 2003-04-24, Kentaro Shirakata +.\" Updated 2007-05-04, Akihiro MOTOKI +.\" +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: execution domain ¼Â¹Ô¥É¥á¥¤¥ó +.\"WORD: personality ¥Ñ¡¼¥½¥Ê¥ê¥Æ¥£ +.\"WORD: binary ¥Ð¥¤¥Ê¥ê +.\"WORD: operating system ¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¡¦¥·¥¹¥Æ¥à +.\" +.TH PERSONALITY 2 2003-01-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +personality \- ¥×¥í¥»¥¹¤ò¼Â¹Ô¤¹¤ë¥É¥á¥¤¥ó¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int personality(unsigned long " persona ); +.SH ÀâÌÀ +Linux ¤Ï¡¢¥×¥í¥»¥¹Ëè¤Î°Û¤Ê¤ë¼Â¹Ô¥É¥á¥¤¥ó¡¢¤¹¤Ê¤ï¤Á +¥Ñ¡¼¥½¥Ê¥ê¥Æ¥£ (personality) ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¼Â¹Ô¥É¥á¥¤¥ó¤Ï Linux ¤Ë¥·¥°¥Ê¥ëÈÖ¹æ¤Ë¤É¤Î¥·¥°¥Ê¥ë¤ò³ä¤êÉÕ¤±¤ë¤«¤ò +¶µ¤¨¤¿¤ê¤¹¤ë¡£¤Þ¤¿¡¢¼Â¹Ô¥É¥á¥¤¥ó¡¦¥·¥¹¥Æ¥à¤Ë¤è¤ê¡¢ +Linux ¤Ï¾¤Î Unix É÷¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¡¦¥·¥¹¥Æ¥à¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ +¥Ð¥¤¥Ê¥ê¤ËÂФ¹¤ë¸ÂÄêŪ¤Ê¥µ¥Ý¡¼¥È¤òÄ󶡤·¤Æ¤¤¤ë¡£ + +.B personality () +´Ø¿ô¤Ï¡¢ +.I persona +¤¬ 0xffffffff ¤Î¾ì¹ç¤Ï¸½ºß¤Î +.B ¥Ñ¡¼¥½¥Ê¥ê¥Æ¥£ +¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.I persona +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¼Â¹Ô¥É¥á¥¤¥ó¤ò¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¿·¤·¤¤¼Â¹Ô¥É¥á¥¤¥ó¤È¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢°ÊÁ°¤Î +.I persona +¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +¥«¡¼¥Í¥ë¤¬¥Ñ¡¼¥½¥Ê¥ê¥Æ¥£¤òÊѹ¹¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +.BR personality () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ diff --git a/release/man2/pipe.2 b/release/man2/pipe.2 new file mode 100644 index 00000000..e74cbc26 --- /dev/null +++ b/release/man2/pipe.2 @@ -0,0 +1,208 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2005, 2008, Michael Kerrisk +.\" (A few fragments remain from an earlier (1992) version by +.\" Drew Eckhardt .) +.\" +.\" 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-23 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 2004-06-17 by Michael Kerrisk +.\" Modified 2005, mtk: added an example program +.\" Modified 2008-01-09, mtk: rewrote DESCRIPTION; minor additions +.\" to EXAMPLE text. +.\" 2008-10-10, mtk: add description of pipe2() +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated Thu Jun 26 21:09:51 JST 1997 +.\" by SUTO, Mitsuaki +.\" Updated & Modified Thu Feb 10 00:47:11 JST 2005 +.\" by Yuichi SATO +.\" Updated & Modified Sat Dec 17 08:10:16 JST 2005 by Yuichi SATO +.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 +.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" +.TH PIPE 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +pipe, pipe2 \- ¥Ñ¥¤¥×¤òÀ¸À®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int pipe(int " pipefd "[2]);" +.sp +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int pipe2(int " pipefd "[2], int " flags ); +.fi +.SH ÀâÌÀ +.BR pipe (2) +¤Ï¥Ñ¥¤¥×¤òÀ¸À®¤¹¤ë¡£ +¥Ñ¥¤¥×¤Ï¡¢¥×¥í¥»¥¹´ÖÄÌ¿®¤Ë»ÈÍѤǤ­¤ëñÊý¸þ¤Î¥Ç¡¼¥¿¥Á¥ã¥Í¥ë¤Ç¤¢¤ë¡£ +ÇÛÎó +.I pipefd +¤Ï¡¢¥Ñ¥¤¥×¤Îξü¤ò»²¾È¤¹¤ëÆó¤Ä¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +ÊÖ¤¹¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +.I pipefd[0] +¤¬¥Ñ¥¤¥×¤ÎÆɤ߽Ф·Â¦¡¢ +.I pipefd[1] +¤¬¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤Ç¤¢¤ë¡£ +¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤Ï¡¢ +¥Ñ¥¤¥×¤ÎÆɤ߽Ф·Â¦¤«¤éÆɤ߽Фµ¤ì¤ë¤Þ¤Ç¥«¡¼¥Í¥ë¤Ç¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤ë¡£ +¤µ¤é¤Ê¤ë¾ÜºÙ¤Ï +.BR pipe (7) +¤ò»²¾È¤Î¤³¤È¡£ + +.BR pipe2 () +¤Ï +.I flags +¤¬ 0 ¤Î¾ì¹ç¤Ë¤Ï +.BR pipe () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.I flags +¤Ë°Ê²¼¤ÎÃͤò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýÏ (OR) ¤Ç»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +°Û¤Ê¤ëÆ°ºî¤ò¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 12 +.B O_NONBLOCK +¿·¤·¤¯À¸À®¤µ¤ì¤ëÆó¤Ä¤Î¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò (open file description) ¤Î +.B O_NONBLOCK +¥Õ¥¡¥¤¥ë¥¹¥Æ¡¼¥¿¥¹¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤³¤È¤Ç¡¢ +.B O_NONBLOCK +¤ò¥»¥Ã¥È¤¹¤ë¤¿¤á¤Ë +.BR fcntl (2) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.TP +.B O_CLOEXEC +¿·¤·¤¯À¸À®¤µ¤ì¤ëÆó¤Ä¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î +close-on-exec +.RB ( FD_CLOEXEC ) +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬Ìò¤ËΩ¤ÄÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR open (2) +¤Î +.B O_CLOEXEC +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç 0 ¤¬Ê֤롣¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤¬Ê֤ꡢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I pipefd +¤¬Ìµ¸ú¤ÊÃͤǤ¢¤ë¡£ +.TP +.B EINVAL +.RB ( pipe2 ()) +.I flags +¤Ë̵¸ú¤ÊÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.TP +.B EMFILE +¤³¤Î¥×¥í¥»¥¹¤Ç»È¤ï¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥à¤ÎÀ©¸Â¤Ë㤷¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR pipe2 () +¤Ï¥Ð¡¼¥¸¥ç¥ó 2.6.27 ¤Ç Linux ¤ËÄɲ䵤줿¡£ +glibc ¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.9 °Ê¹ß¤ÇÍøÍѤǤ­¤ë¡£ +.SH ½àµò +.BR pipe (): +POSIX.1-2001. + +.BR pipe2 () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Îã +.\" fork.2 ¤Ï¤³¤ÎÎã¤Î¥×¥í¥°¥é¥à¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¥Ñ¥¤¥×¤òÀ¸À®¤·¡¢¤½¤Î¸å +.BR fork (2) +¤Ç»Ò¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¡£ +»Ò¥×¥í¥»¥¹¤ÏƱ¤¸¥Ñ¥¤¥×¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Î¥³¥Ô¡¼¤ò +·Ñ¾µ¤¹¤ë¡£ +.BR fork (2) +¤Î¸å¡¢³Æ¥×¥í¥»¥¹¤Ï¥Ñ¥¤¥× +.RB ( pipe (7) +¤ò»²¾È) ¤ËɬÍפ¬¤Ê¤¯¤Ê¤Ã¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +¿Æ¥×¥í¥»¥¹¤Ï¥×¥í¥°¥é¥à¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ë´Þ¤Þ¤ì¤ë +ʸ»úÎó¤ò¥Ñ¥¤¥×¤Ø½ñ¤­¹þ¤ß¡¢ +»Ò¥×¥í¥»¥¹¤Ï¤³¤Îʸ»úÎó¤ò¥Ñ¥¤¥×¤«¤é 1 ¥Ð¥¤¥È¤º¤ÄÆɤ߹þ¤ó¤Çɸ½à½ÐÎϤ˥¨¥³¡¼¤¹¤ë¡£ +.nf + +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int pipefd[2]; + pid_t cpid; + char buf; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + if (pipe(pipefd) == \-1) { + perror("pipe"); + exit(EXIT_FAILURE); + } + + cpid = fork(); + if (cpid == \-1) { + perror("fork"); + exit(EXIT_FAILURE); + } + + if (cpid == 0) { /* »Ò¥×¥í¥»¥¹¤¬¥Ñ¥¤¥×¤«¤éÆɤ߹þ¤à */ + close(pipefd[1]); /* »ÈÍѤ·¤Ê¤¤ write ¦¤Ï¥¯¥í¡¼¥º¤¹¤ë */ + + while (read(pipefd[0], &buf, 1) > 0) + write(STDOUT_FILENO, &buf, 1); + + write(STDOUT_FILENO, "\\n", 1); + close(pipefd[0]); + _exit(EXIT_SUCCESS); + + } else { /* ¿Æ¥×¥í¥»¥¹¤Ï argv[1] ¤ò¥Ñ¥¤¥×¤Ø½ñ¤­¹þ¤à */ + close(pipefd[0]); /* »ÈÍѤ·¤Ê¤¤ read ¦¤Ï¥¯¥í¡¼¥º¤¹¤ë */ + write(pipefd[1], argv[1], strlen(argv[1])); + close(pipefd[1]); /* Æɤ߹þ¤ß¦¤¬ EOF ¤Ë½Ð²ñ¤¦ */ + wait(NULL); /* »Ò¥×¥í¥»¥¹¤òÂÔ¤Ä */ + exit(EXIT_SUCCESS); + } +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR fork (2), +.BR read (2), +.BR socketpair (2), +.BR write (2), +.BR popen (3), +.BR pipe (7) diff --git a/release/man2/pivot_root.2 b/release/man2/pivot_root.2 new file mode 100644 index 00000000..f4c39ef1 --- /dev/null +++ b/release/man2/pivot_root.2 @@ -0,0 +1,173 @@ +.\" Copyright (C) 2000 by Werner Almesberger +.\" May be distributed under GPL +.\" +.\" Written 2000-02-23 by Werner Almesberger +.\" Modified 2004-06-17 Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 2000 NAKANO Takeo all rights reserved. +.\" Translated Wed Jun 14 2000 by NAKANO Takeo +.\" +.TH PIVOT_ROOT 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +pivot_root \- root ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.BI "int pivot_root(const char *" new_root ", const char *" put_old ); +.SH ÀâÌÀ +.BR pivot_root () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î root ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +.I put_old +¥Ç¥£¥ì¥¯¥È¥ê¤Ë°ÜÆ°¤·¡¢ +.I new_root +¤ò¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¿·¤·¤¤ root ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤¹¤ë¡£ +.\" +.\" .B CAP_SYS_ADMIN +.\" ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ + +.BR pivot_root () +¤Îŵ·¿Åª¤ÊÍøÍÑË¡¤Ï¡¢¥·¥¹¥Æ¥à¤Îµ¯Æ°Ãæ¤Ë¥·¥¹¥Æ¥à¤¬°ì»þŪ¤Ê +root ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à (Î㤨¤Ð +.BR initrd ) +¤ò¥Þ¥¦¥ó¥È¤·¡¢¤³¤ì¤Ë³¤¤¤ÆËÜÅö¤Î root ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥Þ¥¦¥ó¥È¤·¡¢ +¸å¼Ô¤òɬÍפÊÁ´¤Æ¤Î¥×¥í¥»¥¹¡¦¥¹¥ì¥Ã¥É¤Î +¥«¥ì¥ó¥È root ¤ËÊѹ¹¤¹¤ë¤è¤¦¤Ê¾ì¹ç¤Ç¤¢¤ë¡£ + +¸Å¤¤ root ¥Ç¥£¥ì¥¯¥È¥ê¤ò»È¤Ã¤Æ¤¤¤¿Á´¤Æ¤Î¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤Î +¥«¥ì¥ó¥È root ¤È¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ò¡¢ +.BR pivot_root () +¤¬Êѹ¹¤¹¤ë¤«¤É¤¦¤«¤Ï¤ï¤«¤é¤Ê¤¤¡£ +.BR pivot_root () +¤Î¸Æ¤Ó¤À¤·¥×¥í¥»¥¹¤Ï¡¢¸Å¤¤ root ¤ä¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ò»È¤Ã¤Æ¤¤¤¿ +¥×¥í¥»¥¹¤¬¡¢¤¤¤º¤ì¤Î¾ì¹ç¤Ç¤âÀµ¤·¤¯Æ°ºî¤¹¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤ò´Êñ¤Ë¹Ô¤¦¤Ë¤Ï¡¢¤½¤ì¤é¤Î¥×¥í¥»¥¹¤Î root ¤È +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ò +.BR pivot_root () +¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë +.I new_root +¤ËÊѹ¹¤·¤Æ¤ª¤¯¤³¤È¤Ç¤¢¤ë¡£ + +¾åµ­¤ÎÃÊÍî¤Ï¡¢¾­Íè +.BR pivot_root () +¤¬Êѹ¹¤µ¤ì¤ë¤«¤âÃΤì¤Ê¤¤¤³¤È¤ò´Õ¤ß¤Æ¡¢¤ï¤¶¤ÈÛ£Ëæ¤Ë½ñ¤¤¤Æ¤¢¤ë¡£ +ËÜ¥Ú¡¼¥¸¤òµ­½Ò¤·¤Æ¤¤¤ë»þÅÀ¤Ç¤Ï¡¢ +.BR pivot_root () +¤Ï¸Å¤¤ root ¥Ç¥£¥ì¥¯¥È¥ê¤òÍѤ¤¤Æ¤¤¤ëÁ´¤Æ¤Î¥×¥í¥»¥¹¡¦¥¹¥ì¥Ã¥É¤Î root ¤È +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ò +.I new_root +¤ËÊѹ¹¤¹¤ë¡£¤³¤ì¤Ï¥«¡¼¥Í¥ë¤Î¥¹¥ì¥Ã¥É¤¬¸Å¤¤ root ¥Ç¥£¥ì¥¯¥È¥ê¤ò +busy ¾õÂ֤ˤ·¤Ê¤¤¤¿¤á¤ËɬÍפǤ¢¤ë¡£¤³¤ì¤é¤Î¥¹¥ì¥Ã¥É¤¬ +¸Å¤¤¥Ç¥£¥ì¥¯¥È¥ê¤ò root ¤ä¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤Æ¤¤¤ë¤È¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°ìÀÚ¥¢¥¯¥»¥¹¤·¤Ê¤¤¾ì¹ç¤Ç¤â +¸Å¤¤ root ¤¬ busy ¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¤«¤é¤Ç¤¢¤ë¡£ +.\"nakano: ¤Á¤È¾éĹ... +¾­Íè¤Ï¡¢¥«¡¼¥Í¥ë¥¹¥ì¥Ã¥É¤¬¤¢¤é¤æ¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î¥¢¥¯¥»¥¹¤ò +ÌÀ¼¨Åª¤ËÊü´þ¤¹¤ë¥á¥«¥Ë¥º¥à¤¬¤Ç¤­¡¢¤³¤Î¤Ç¤·¤ã¤Ð¤ê¤Êµ¡Ç½¤Ï +.BR pivot_root () +¤«¤éºï½ü¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + +¤³¤ì¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë¤Ä¤¤¤Æ¤âÅö¤Æ¤Ï¤Þ¤ë¤³¤È¤ËÃí°Õ¡£ +.BR pivot_root () +¤¬¥«¥ì¥ó¥È¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤Ë±Æ¶Á¤¹¤ë¤«¤É¤¦¤«¤Ï +ʬ¤«¤é¤Ê¤¤¡£¤·¤¿¤¬¤Ã¤Æ +.BR pivot_root () +¤Îľ¸å¤Ë +.B chdir("/") +¤ò¸Æ¤Ó½Ð¤¹¤È¤è¤¤¡£ + +.IR new_root " ¤ª¤è¤Ó " put_old +¤Ë¤Ï°Ê²¼¤ÎÀ©¸Â¤¬¤¢¤ë: +.IP \- 3 +¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP \- 3 +.IR new_root " ¤È " put_old +¤Ï¸½ºß¤Î root ¤ÈƱ¤¸¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.IP \- 3 +.IR put_old " ¤Ï " new_root +°Ê²¼¤Ë¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤¹¤Ê¤ï¤Á +.I put_old +¤òº¹¤¹Ê¸»úÎó¤Ë 1 ¸Ä°Ê¾å¤Î +.I ../ +¤òÉÕ¤±¤ë¤³¤È¤Ë¤è¤Ã¤Æ +.I new_root +¤ÈƱ¤¸¥Ç¥£¥ì¥¯¥È¥ê¤¬ÆÀ¤é¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP \- 3 +¾¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ +.I put_old +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +ÍøÍÑÎã¤Ë¤Ä¤¤¤Æ¤Ï +.BR pivot_root (8) +¤ò»²¾È¤Î¤³¤È¡£ + +¸½ºß¤Î root ¤¬¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤Ï¤Ê¤¤ +.RB ( chroot (2) +¤ä +.BR pivot_root () +¤Î¸å¤Ê¤É¡£°Ê²¼¤â»²¾È) ¾ì¹ç¡¢ +¸Å¤¤ root ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¯¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤¬ +.I put_old +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ + +.I new_root +¤Ï¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤Ê¤¯¤Æ¤â¤è¤¤¡£ +¤³¤Î¾ì¹ç +.I /proc/mounts +¤Ï¡¢ +.I new_root +¤ò root +.RI ( / ) +¤È¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤òɽ¼¨¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤¬µ¯¤ë¤È \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ÊÃͤËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR pivot_root () +¤Ï +.BR stat (2) +¤ÎÊÖ¤¹¤¢¤é¤æ¤ë¥¨¥é¡¼¤ò +.RI ( errno +¤Ë) ÊÖ¤¹²ÄǽÀ­¤¬¤¢¤ë¡£¤µ¤é¤Ë°Ê²¼¤òÊÖ¤¹¤³¤È¤¬¤¢¤ë: +.TP +.B EBUSY +.IR new_root " ¤Þ¤¿¤Ï " put_old +¤¬¡¢¸½ºß¤Î root ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ë¤¢¤ë¤«¡¢´û¤Ë +.I put_old +¤Ë¤Ê¤ó¤é¤«¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.IR put_old " ¤¬ " new_root +¤Î²¼Áؤˤʤ¤¡£ +.TP +.B ENOTDIR +.IR new_root " ¤Þ¤¿¤Ï " put_old +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬ +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR pivot_root () +¤Ï Linux 2.3.41 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.SH ½àµò +.BR pivot_root () +¤Ï Linux ¤Ë¸ÇÍ­¤Î¤â¤Î¤Ê¤Î¤Ç¡¢°Ü¿¢À­¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£ +.SH ¥Ð¥° +.BR pivot_root () +¤Ï¥·¥¹¥Æ¥à¤Î¾¤Î¥×¥í¥»¥¹Á´¤Æ¤Î root ¤È +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤È¤òÊѹ¹¤·¤Ê¤¯¤Æ¤â¤è¤¤¤Ï¤º¤Ç¤¢¤ë¡£ + +.BR pivot_root () +¤Î»È¤¤Êý¤¬¤â¤¦¤Á¤ç¤Ã¤ÈÛ£Ëæ¤Ë¤Ê¤ë¤È¡¢ +¤¢¤Ã¤È¤¤¤¦´Ö¤Ë¤ï¤±¤Î¤ï¤«¤é¤Ê¤¤¾õÂ֤ˤʤäƤ·¤Þ¤¦¤À¤í¤¦ +.SH ´ØÏ¢¹àÌÜ +.BR chdir (2), +.BR chroot (2), +.BR stat (2), +.BR initrd (4), +.BR pivot_root (8) diff --git a/release/man2/poll.2 b/release/man2/poll.2 new file mode 100644 index 00000000..163eb010 --- /dev/null +++ b/release/man2/poll.2 @@ -0,0 +1,336 @@ +.\" 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 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +poll, ppoll \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤ª¤±¤ë¥¤¥Ù¥ó¥È¤òÂÔ¤Ä +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int poll(struct pollfd *" fds ", nfds_t " nfds ", int " timeout ); +.sp +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int ppoll(struct pollfd *" fds ", nfds_t " nfds ", " +.BI " const struct timespec *" timeout ", const sigset_t *" sigmask ); +.fi +.SH ÀâÌÀ +.BR poll () +¤Ï +.BR select (2) +¤ÈƱÍͤλŻö¤ò¹Ô¤¦¡¢¤Ä¤Þ¤ê¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Î¤¤¤º¤ì¤«°ì¤Ä¤¬ +I/O ¤ò¼Â¹Ô²Äǽ¤Ê¾õÂ֤ˤʤë¤Î¤òÂԤġ£ + +´Æ»ë¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Ï¡¢ +.I fds +°ú¤­¿ô¤Ç»ØÄꤹ¤ë¡£ +.I fds +¤Ï¡¢°Ê²¼¤Î·¿¤Î¹½Â¤ÂΤÎÇÛÎó¤Ç¤¢¤ë¡£ +.in +4n +.nf + +struct pollfd { + int fd; /* file descriptor */ + short events; /* requested events */ + short revents; /* returned events */ +}; +.in +.fi +.PP +.I nfds +¤Ë¤Ï¡¢ +.I fds +ÇÛÎó¤ÎÍ×ÁÇ¿ô¤ò»ØÄꤹ¤ë¡£ + +¹½Â¤ÂΤΠ+.I fd +¤Ë¤Ï¥ª¡¼¥×¥ó¤·¤¿¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÆþ¤ì¤ë¡£ + +¹½Â¤ÂΤΠ+.I events +Í×ÁǤÏÆþÎϥѥé¥á¡¼¥¿¤Ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¶½Ì£¤ò»ý¤Ã¤Æ¤¤¤ë¥¤¥Ù¥ó¥È¤Î +¥Ó¥Ã¥È¥Þ¥¹¥¯¤ò»ØÄꤹ¤ë¡£ + +.I revents +Í×ÁǤϽÐÎϥѥé¥á¡¼¥¿¤Ç¡¢¼ÂºÝ¤Ëµ¯¤³¤Ã¤¿¥¤¥Ù¥ó¥È¤¬¥«¡¼¥Í¥ë¤Ë¤è¤êÀßÄꤵ¤ì¤ë¡£ +.I revents +¤ÇÊÖ¤µ¤ì¤ë¥Ó¥Ã¥ÈÎó¤Ë¤Ï¡¢ +.I events +¤Ç»ØÄꤷ¤¿¤â¤Î¤Î¤É¤ì¤«¡¢¤â¤·¤¯¤Ï +.BR POLLERR , +.BR POLLHUP , +.B POLLNVAL +¤Î¤¦¤Á¤Î°ì¤Ä¤¬´Þ¤Þ¤ì¤ë +.RB ( POLLERR , +.BR POLLHUP , +.B POLLNVAL +¤Î 3¤Ä¤Î¥Ó¥Ã¥È¤Ï +.I events +¤Ë»ØÄꤷ¤Æ¤â°ÕÌ£¤¬¤Ê¤¯¡¢Âбþ¤·¤¿¾õÂÖ¤¬¿¿¤Î¾ì¹ç¤Ë +.I revents +¤ËÀßÄꤵ¤ì¤ë)¡£ + +¤É¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤âÍ׵ᤷ¤¿¥¤¥Ù¥ó¥È¤¬È¯À¸¤·¤Æ¤ª¤é¤º¡¢ +¥¨¥é¡¼¤âµ¯¤³¤é¤Ê¤¤¾ì¹ç¡¢ +.BR poll () +¤Ï¥¤¥Ù¥ó¥È¤Î¤¦¤Á¤¤¤º¤ì¤«°ì¤Ä¤¬È¯À¸¤¹¤ë¤Þ¤ÇÄä»ß (block) ¤¹¤ë¡£ + +.I timeout +°ú¤­¿ô¤Ï +.BR poll () +¤¬Ää»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤òÀßÄꤹ¤ë¤â¤Î¤Ç¡¢¥ß¥êÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.I timeout +¤ËÉé¤ÎÃͤò»ØÄꤹ¤ë¤È¡¢¥¿¥¤¥à¥¢¥¦¥È»þ´Ö¤¬Ìµ¸Â¤È¤Ê¤ë¡£ + +.I events +¤Ë»ØÄꤷ¤¿¤ê¡¢ +.I revents +¤ÇÊÖ¤µ¤ì¤ë¥Ó¥Ã¥È¤Ï \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.RS +.TP +.B POLLIN +Æɤ߽Ф·²Äǽ¤Ê¥Ç¡¼¥¿¤¬¤¢¤ë¡£ +.TP +.B POLLPRI +Æɤ߽Ф·²Äǽ¤Ê¶ÛµÞ¥Ç¡¼¥¿ (urgent data) ¤¬¤¢¤ë +(Î㤨¤Ð¡¢TCP ¥½¥±¥Ã¥È¤ÎÂÓ°è³° (out-of-band data) ¥Ç¡¼¥¿¤ò¼õ¿®¤·¤¿¾ì¹ç¤ä¡¢ +¥Ñ¥±¥Ã¥È¥â¡¼¥É¤Îµ¼»÷üËö¤Î¥Þ¥¹¥¿¤¬¥¹¥ì¡¼¥Ö¦¤ÎÊѲ½¤ò¸«¤Ä¤±¤¿¤È¤­)¡£ +.TP +.B POLLOUT +½ñ¤­¹þ¤ß¤¬Ää»ß (block) ¤·¤Ê¤¤¾õÂ֤Ǥ¢¤ë¡£ +.TP +.BR POLLRDHUP " (Linux 2.6.17 °Ê¹ß)" +¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¤Î¾ü¤¬¡¢¥³¥Í¥¯¥·¥ç¥ó¤ò close ¤·¤¿¤«¡¢ +¥³¥Í¥¯¥·¥ç¥ó¤Î½ñ¤­¹þ¤ß¦¤ò shutdown ¤·¤¿¡£ +¤³¤ÎÄêµÁ¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢ +.B _GNU_SOURCE +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B POLLERR +¥¨¥é¡¼¾õÂÖ (½ÐÎϤξì¹ç¤Î¤ß)¡£ +.TP +.B POLLHUP +¥Ï¥ó¥°¥¢¥Ã¥×¤·¤¿ (½ÐÎϤξì¹ç¤Î¤ß)¡£ +.TP +.B POLLNVAL +ÉÔÀµ¤ÊÍ×µá: +.I fd +¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤ (½ÐÎϤξì¹ç¤Î¤ß)¡£ +.RE +.PP +.B _XOPEN_SOURCE +¤òÄêµÁ¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤¿¾ì¹ç¤Ë¤Ï¡¢°Ê²¼¤ÎÄêµÁ¤â¹Ô¤ï¤ì¤ë¡£ +¤¿¤À¤·¡¢¾åµ­¤Î¥ê¥¹¥È¤Ë¤¢¤ë¥Ó¥Ã¥È°Ê¾å¤Î¾ðÊó¤¬ÆÀ¤é¤ì¤ëÌõ¤Ç¤Ï¤Ê¤¤¡£ +.RS +.TP +.B POLLRDNORM +.B POLLIN +¤ÈƱ¤¸¡£ +.TP +.B POLLRDBAND +Í¥ÀèÂÓ°è¥Ç¡¼¥¿ (priority band data) ¤¬Æɤ߽Ф·²Äǽ¤Ç¤¢¤ë +(ÉáÄÌ¤Ï Linux ¤Ç¤Ï»ÈÍѤµ¤ì¤Ê¤¤)¡£ +.\" POLLRDBAND is used in the DECnet protocol. +.TP +.B POLLWRNORM +.B POLLOUT +¤ÈƱ¤¸¡£ +.TP +.B POLLWRBAND +Í¥ÀèÂÓ°è¥Ç¡¼¥¿ (priority data) ¤¬½ñ¤­¹þ¤ß²Äǽ¤Ç¤¢¤ë¡£ +.RE +.PP +Linux ¤Ç¤Ï +.B POLLMSG +¤âÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SS ppoll() +.BR poll () +¤È +.BR ppoll () +¤Î´Ø·¸¤Ï +.BR select (2) +¤È +.BR pselect (2) +¤Î´Ø·¸¤ÈƱ¤¸¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë: +.BR pselect (2) +¤ÈƱÍͤˡ¢ +.BR ppoll () +¤ò»È¤¦¤È¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¾õÂÖÊѲ½ +¤â¤·¤¯¤Ï¥·¥°¥Ê¥ë¤ÎÊ᪤ò°ÂÁ´¤ËÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.I timeout +°ú¤­¿ô¤Î°ã¤¤¤ò½ü¤¯¤È¡¢°Ê²¼¤Î +.BR ppoll () +¤Î¸Æ¤Ó½Ð¤·¤Ï¡¢ +.nf + + ready = ppoll(&fds, nfds, timeout, &sigmask); + +.fi +¼¡¤Î¥³¡¼¥ë¤ò +.I atomic +¤Ë¼Â¹Ô¤¹¤ë¤Î¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.nf + + sigset_t origmask; + + sigprocmask(SIG_SETMASK, &sigmask, &origmask); + ready = poll(&fds, nfds, timeout); + sigprocmask(SIG_SETMASK, &origmask, NULL); +.fi +.PP +¤Ê¤¼ +.BR ppoll () +¤¬É¬ÍפʤΤ«¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀ¤Ï +.BR pselect (2) +¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ + +.I sigmask +°ú¤­¿ô¤Ë NULL ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÎÁàºî¤Ï¹Ô¤ï¤ì¤Ê¤¤ +(¤·¤¿¤¬¤Ã¤Æ¡¢ +.BR ppoll () +¤Î +.BR poll () +¤È¤Î°ã¤¤¤Ï +.I timeout +°ú¤­¿ô¤ÎÀºÅÙ¤À¤±¤È¤Ê¤ë)¡£ + +.I timeout +°ú¤­¿ô¤Ï +.BR ppoll () +¤¬Ää»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ë¤Ï°Ê²¼¤Î·¿¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò»ØÄꤹ¤ë¡£ +.in +4n +.nf + +struct timespec { + long tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.fi +.in + +.I timeout +¤Ë NULL ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.B ppoll +¤Ï̵¸Â¤ËÄä»ß¤¹¤ë¤³¤È¤¬¤¢¤êÆÀ¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤ÏÀµ¤Î¿ô¤òÊÖ¤¹¡£¤³¤Î¿ô¤Ï 0 °Ê³°¤Î +.I revents +Í×ÁǤò»ý¤Ä¹½Â¤ÂΤοô¤Ç¤¢¤ë (Ê̤θÀ¤¤Êý¤ò¤¹¤ë¤È¡¢¤³¤ì¤é¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿ +¤Ë¤Ï¥¤¥Ù¥ó¥È¤«¥¨¥é¡¼Êó¹ð¤¬¤¢¤ë)¡£ +ÃÍ 0 ¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥È¤È¤Ê¤ê¡¢¤É¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤â¥¤¥Ù¥ó¥È¤¬ +ȯÀ¸¤·¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +°ú¤­¿ô¤È¤·¤Æ»ØÄꤷ¤¿ÇÛÎ󤬡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë +´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EINTR +Í׵ᤵ¤ì¤¿¥¤¥Ù¥ó¥È¤Î¤É¤ì¤«¤¬µ¯¤³¤ëÁ°¤Ë¥·¥°¥Ê¥ë¤¬È¯À¸¤·¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.I nfds +¤ÎÃͤ¬ +.B RLIMIT_NOFILE +¤òĶ¤¨¤¿¡£ +.TP +.B ENOMEM +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Æ¡¼¥Ö¥ë¤ò³ÎÊݤ¹¤ë¤¿¤á¤Î¥á¥â¥ê¤¬¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR poll () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.1.23 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.BR poll () +¥é¥¤¥Ö¥é¥ê¡¦¥³¡¼¥ë¤Ï libc 5.4.28 ¤«¤éƳÆþ¤µ¤ì¤¿ +(¤³¤ì¤Ï¥«¡¼¥Í¥ë¤¬ +.BR poll () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë +.BR select (2) +¤ò»ÈÍѤ·¤Æ¥¨¥ß¥å¥ì¡¼¥È¤ò¹Ô¤¦)¡£ + +.BR ppoll () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï ¥«¡¼¥Í¥ë 2.6.16 ¤Ç Linux ¤ËÄɲ䵤줿¡£ +.BR ppoll () +¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤Ï glibc 2.4 ¤ËÄɲ䵤줿¡£ +.SH ½àµò +.BR poll () +¤Ï POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR ppoll () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.\" NetBSD 3.0 ¤Ë¤Ï pollts() ¤¬¤¢¤ë¡£ +.\" pollts() ¤Ï Linux ppoll () ¤ÈƱ¤¸¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤Ç¤Ï¡¢ÃÍ \-1 ¤ò»ý¤Ã¤¿Èóɸ½à¤ÎÄê¿ô +.B INFTIM +¤¬ÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +.I timeout +¤Î»ØÄê¤Ë»ÈÍѤǤ­¤ë¡£ +¤³¤ÎÄê¿ô¤Ï glibc ¤Ç¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SS "Linux ¤Ç¤ÎÃí°Õ" +Linux ¤Î +.BR ppoll () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I timeout +°ú¤­¿ô¤òÊѹ¹¤¹¤ë¡£ +¤·¤«¤·¡¢glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ timeout °ú¤­¿ô +¤È¤·¤Æ¥í¡¼¥«¥ëÊÑ¿ô¤ò»È¤¦¤³¤È¤Ç¤³¤ÎÆ°ºî¤ò±£Ê䷤Ƥ¤¤ë¡£ +¤³¤Î¤¿¤á¡¢glibc ¤Î +.BR ppoll () +´Ø¿ô¤Ï +.I timeout +°ú¤­¿ô¤òÊѹ¹¤·¤Ê¤¤¡£ +.SH ¥Ð¥° +.BR select (2) +¤Î¡Ö¥Ð¥°¡×¤ÎÀá¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡¢¸í¤Ã¤¿½àÈ÷´°Î»ÄÌÃÎ (spurious readiness +notifications) ¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤ò»²¾È¤Î¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR select (2), +.BR select_tut (2), +.BR feature_test_macros (7), +.BR time (7) diff --git a/release/man2/posix_fadvise.2 b/release/man2/posix_fadvise.2 new file mode 100644 index 00000000..635e9afc --- /dev/null +++ b/release/man2/posix_fadvise.2 @@ -0,0 +1,157 @@ +.\" 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" +.SH ̾Á° +posix_fadvise \- ¥Õ¥¡¥¤¥ë¥Ç¡¼¥¿¤Î¥¢¥¯¥»¥¹¥Ñ¥¿¡¼¥ó¤ò¤¢¤é¤«¤¸¤áÀë¸À¤¹¤ë +.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 +.SH ÀâÌÀ +¥×¥í¥°¥é¥à¤Ï¡¢¾­ÍèÆÃÄê¤Î¥Ñ¥¿¡¼¥ó¤Ç¥Õ¥¡¥¤¥ë¥Ç¡¼¥¿¤Ë +¥¢¥¯¥»¥¹¤¹¤ë°Õ»×¤òÅÁ¤¨¤ë¤¿¤á¤Ë +.BR posix_fadvise () +¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¥«¡¼¥Í¥ë¤¬Å¬ÀڤʺÇŬ²½¤ò¼Â¹Ô¤¹¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤ë¡£ + +\fIadvice\fP ¤Ï \fIfd\fP ¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Î +\fIoffset\fP ¤«¤é»Ï¤Þ¤ë \fIlen\fP ¥Ð¥¤¥È¤ÎÈÏ°ÏÆâ +(\fIlen\fP ¤¬ 0 ¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë¤Î½ª¤ê¤Þ¤Ç) ¤Î +(ɬ¤º¤·¤â¸ºß¤·¤Ê¤¤) Îΰè¤ËŬÍѤµ¤ì¤ë¡£ +¥¢¥É¥Ð¥¤¥¹¤ÏµÁ̳¤Å¤±¤Ç¤Ï¤Ê¤¤¡£ +¥¢¥É¥Ð¥¤¥¹¤Ïñ¤Ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¤¿¤á¤Ë²ÄǽÀ­¤ò¹½À®¤¹¤ë¤À¤±¤Ç¤¢¤ë¡£ + +\fIadvice\fP ¤Ëµö¤µ¤ì¤ëÃͤˤϡ¢°Ê²¼¤Î¤â¤Î¤¬´Þ¤Þ¤ì¤ë: +.TP +.B POSIX_FADV_NORMAL +»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿¤Î¥¢¥¯¥»¥¹¥Ñ¥¿¡¼¥ó¤ò»Ø¼¨¤¹¤ë¥¢¥É¥Ð¥¤¥¹¤ò +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬²¿¤â»ý¤Ã¤Æ¤¤¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¥¢¥É¥Ð¥¤¥¹¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢ +¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤Ç²¾Äꤵ¤ì¤ë¡£ +.TP +.B POSIX_FADV_SEQUENTIAL +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿¤¬¥·¡¼¥±¥ó¥·¥ã¥ë¤Ë +(Â礭¤Ê¥ª¥Õ¥»¥Ã¥È¤ÎÁ°¤Ë¾®¤µ¤Ê¥ª¥Õ¥»¥Ã¥È¤Î¥Ç¡¼¥¿¤òÆɤà¤è¤¦¤Ë) +¥¢¥¯¥»¥¹¤µ¤ì¤ë¤³¤È¤ò´üÂÔ¤¹¤ë¡£ +.TP +.B POSIX_FADV_RANDOM +»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿¤¬¥é¥ó¥À¥à¤Ê½çÈ֤ǥ¢¥¯¥»¥¹¤µ¤ì¤ë¡£ +.TP +.B POSIX_FADV_NOREUSE +»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿¤Ï 1 ÅÙ¤·¤«¥¢¥¯¥»¥¹¤µ¤ì¤Ê¤¤¡£ +.TP +.B POSIX_FADV_WILLNEED +»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿¤Ï¶á¤¤¾­Í襢¥¯¥»¥¹¤µ¤ì¤ë¡£ +.TP +.B POSIX_FADV_DONTNEED +»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿¤Ï¶á¤¤¾­Í襢¥¯¥»¥¹¤µ¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¨¥é¡¼Èֹ椬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +\fIfd\fP °ú¤­¿ô¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +̵¸ú¤ÊÃͤ¬ \fIadvice\fP ¤Ë»ØÄꤵ¤ì¤¿¡£ +.TP +.B ESPIPE +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥Ñ¥¤¥×¤Þ¤¿¤Ï FIFO ¤ò»²¾È¤·¤Æ¤¤¤ë +(¤³¤Î¾ì¹ç¡¢Linux ¤Ï¼ÂºÝ¤Ë¤Ï +.B EINVAL +¤òÊÖ¤¹)¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR posix_fadvise () +¤Ï¥«¡¼¥Í¥ë 2.5.60 ¤ÇÅо줷¤¿¡£ +.\" ¼ÂºÝ¤Ë¤Ï fadvise64() ¤È¤·¤ÆÅо줷¤¿¡£-- MTK +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.2 °Ê¹ß¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.I len +°ú¤­¿ô¤Î·¿¤¬ POSIX.1-2003 TC1 ¤Ë¤ª¤¤¤Æ +.I size_t +¤«¤é +.I off_t +¤ËÊѹ¹¤µ¤ì¤¿ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH Ãí°Õ +Linux ¤Ç¤Ï¡¢\fBPOSIX_FADV_NORMAL\fP ¤Ï¥Ð¥Ã¥­¥ó¥°¥Ç¥Ð¥¤¥¹¤Î +¥Ç¥Õ¥©¥ë¥È¥µ¥¤¥º¤ËÀèÆÉ¤ß (readahead) ¥¦¥¤¥ó¥É¥¦¤òÀßÄꤹ¤ë¡£ +\fBPOSIX_FADV_SEQUENTIAL\fP ¤Ï¤³¤Î¥µ¥¤¥º¤ò 2 Çܤ·¡¢ +\fBPOSIX_FADV_RANDOM\fP ¤ÏÀèÆɤߤòÁ´¤¯Ìµ¸ú¤Ë¤¹¤ë¡£ +¤³¤ì¤é¤ÎÊѹ¹¤Ï¥Õ¥¡¥¤¥ëÁ´ÂΤ˱ƶÁ¤·¡¢»ØÄꤵ¤ì¤¿Îΰè¤Î¤ß¤Ë±Æ¶Á¤¹¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤ +(¤·¤«¤·Æ±¤¸¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¾¤Î¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤)¡£ + +\fBPOSIX_FADV_WILLNEED\fP ¤Ï¡¢ +¥Ú¡¼¥¸¥­¥ã¥Ã¥·¥å¤Ë»ØÄêÎΰè¤Î¥Ö¥í¥Ã¥¯¤µ¤ì¤Ê¤¤Æɤ߹þ¤ß¤ò³«»Ï¤¹¤ë¡£ +Æɤ߹þ¤Þ¤ì¤ë¥Ç¡¼¥¿¤ÎÁíÎ̤ϡ¢ +²¾ÁÛ¥á¥â¥ê¤ÎÉé²Ù¤Ë°Í¤Ã¤Æ¥«¡¼¥Í¥ë¤¬¸º¤é¤¹¤«¤â¤·¤ì¤Ê¤¤ +(¿ô¥á¥¬¥Ð¥¤¥È¤Ç¤¢¤ì¤ÐÄ̾ï¤ÏÁ´¤¯½½Ê¬¤Ç¤¢¤ê¡¢ +¤½¤ì¤è¤ê¿¤¯¤Æ¤â¤á¤Ã¤¿¤ËÌò¤ËΩ¤¿¤Ê¤¤)¡£ + +2.6.18 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢\fBPOSIX_FADV_NOREUSE\fP ¤Ï +\fBPOSIX_FADV_WILLNEED\fP ¤ÈƱ¤¸°ÕÌ£¤Ç¤¢¤Ã¤¿¡£ +¤³¤ì¤Ï¿ʬ¥Ð¥°¤Ç¤¢¤Ã¤¿¡£ +¥«¡¼¥Í¥ë 2.6.18 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¥Õ¥é¥°¤Ï²¿¤â¹Ô¤ï¤Ê¤¤¡£ + +\fBPOSIX_FADV_DONTNEED\fP ¤Ï»ØÄꤵ¤ì¤¿Îΰè¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +¥­¥ã¥Ã¥·¥å¥Ú¡¼¥¸¤ò²òÊü¤·¤è¤¦¤È¤¹¤ë¡£ +Î㤨¤Ð¡¢¤³¤ì¤ÏÂ礭¤Ê¥Õ¥¡¥¤¥ë¤ò¥¹¥È¥ê¡¼¥ß¥ó¥°¤¹¤ë¤È¤­¤ËÌòΩ¤Ä¡£ +¥×¥í¥°¥é¥à¤Ï¡¢»ÈÍѺѤߤΥ­¥ã¥Ã¥·¥å¤µ¤ì¤¿¥Ç¡¼¥¿¤ò²òÊü¤¹¤ë¤è¤¦¤Ë¡¢ +Äê´üŪ¤Ë¥«¡¼¥Í¥ë¤ËÍ׵᤹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤½¤¦¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢¤µ¤é¤ËÍ­¸ú¤Ê¥­¥ã¥Ã¥·¥å¤µ¤ì¤¿¥Ú¡¼¥¸¤¬¡¢ +Âå¤ï¤ê¤ËÇË´þ¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ + +¤Þ¤À½ñ¤­½Ð¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ú¡¼¥¸¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¤Î¤Ç¡¢ +¤½¤Î¥Ú¡¼¥¸¤Î²òÊü¤¬Êݾڤµ¤ì¤ë¤³¤È¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬Ë¾¤ó¤Ç¤¤¤ë¤Ê¤é¡¢ +ºÇ½é¤Ë +.BR fsync (2) +¤Þ¤¿¤Ï +.BR fdatasync (2) +¤ò¸Æ¤Ö¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +2.6.6 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.I len +¤Ë 0 ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +¡Ö¥Õ¥¡¥¤¥ë¤Î½ª¤ê¤Þ¤Ç¤ÎÁ´¤Æ¤Î¥Ð¥¤¥È¡×¤È¤¤¤¦°ÕÌ£¤Ç¤Ï¤Ê¤¯¡¢ +ʸ»úÄ̤ê¡Ö0 ¥Ð¥¤¥È¡×¤È¤·¤Æ²ò¼á¤µ¤ì¤Æ¤¤¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR readahead (2), +.BR posix_fallocate (3), +.BR posix_madvise (3), +.\" FIXME . Write a posix_fadvise(3) page. +.BR feature_test_macros (7) diff --git a/release/man2/prctl.2 b/release/man2/prctl.2 new file mode 100644 index 00000000..48557fda --- /dev/null +++ b/release/man2/prctl.2 @@ -0,0 +1,449 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1998 Andries Brouwer (aeb@cwi.nl) +.\" and Copyright (C) 2002 Michael Kerrisk +.\" and Copyright Guillem Jover +.\" +.\" 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 Thu Nov 11 04:19:42 MET 1999, aeb: added PR_GET_PDEATHSIG +.\" Modified 27 Jun 02, Michael Kerrisk +.\" Added PR_SET_DUMPABLE, PR_GET_DUMPABLE, +.\" PR_SET_KEEPCAPS, PR_GET_KEEPCAPS +.\" Modified 2006-08-30 Guillem Jover +.\" Updated Linux versions where the options where introduced. +.\" Added PR_SET_TIMING, PR_GET_TIMING, PR_SET_NAME, PR_GET_NAME, +.\" PR_SET_UNALIGN, PR_GET_UNALIGN, PR_SET_FPEMU, PR_GET_FPEMU, +.\" PR_SET_FPEXC, PR_GET_FPEXC +.\" 2008-04-29 Serge Hallyn, Document PR_CAPBSET_READ and PR_CAPBSET_DROP +.\" 2008-06-13 Erik Bosman, +.\" Document PR_GET_TSC and PR_SET_TSC. +.\" 2008-06-15 mtk, Document PR_SET_SECCOMP, PR_GET_SECCOMP +.\" +.\" Japanese Version Copyright (c) 1998-1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1999-04-03, HANATAKA Shinya +.\" Updated 2002-12-20, Kentaro Shirakata +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2005-10-07, Akihiro MOTOKI +.\" Updated 2007-01-08, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2007-10-12, Akihiro MOTOKI, LDP v2.66 +.\" Updated 2008-08-12, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: capability ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\"WORD: keep capabilities ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ÊÝ»ý +.\" +.TH PRCTL 2 2008-07-16 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +prctl \- ¥×¥í¥»¥¹¤ÎÁàºî¤ò¹Ô¤Ê¤¦ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int prctl(int " option ", unsigned long " arg2 ", unsigned long " arg3 , +.BI " unsigned long " arg4 ", unsigned long " arg5 ); +.fi +.SH ÀâÌÀ +.BR prctl () +¤ÎÆ°ºî¤ÏºÇ½é¤Î°ú¤­¿ô¤Ë¤è¤Ã¤Æ·èÄꤵ¤ì¤ë (¤³¤ÎÃÍ¤Ï +\fI\fP ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +»Ä¤ê¤Î°ú¤­¿ô¤ÏºÇ½é¤Î°ú¤­¿ô¤Ë¤è¤Ã¤ÆÊѲ½¤¹¤ë¡£ +°ìÈÖÌܤΰú¤­¿ô¤È¤·¤Æ°Ê²¼¤Î¤â¤Î¤ò»ØÄê¤Ç¤­¤ë: +.TP +.BR PR_CAPBSET_READ " (Linux 2.6.25 °Ê¹ß)" +¤Ç»ØÄꤵ¤ì¤¿¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +¥Ð¥¤¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È (capability bounding set) ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +(´Ø¿ô¤ÎÊÖ¤êÃͤȤ·¤Æ) 1 ¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç 0 ¤òÊÖ¤¹ +(¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£Äê¿ô¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï¡¢ +.BR execve (2) +¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¡¢¥Õ¥¡¥¤¥ë¤Îµö²Ä (permitted) ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÎÃæ¤Ç +¤½¤Î¥×¥í¥»¥¹¤¬³ÍÆÀ¤Ç¤­¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»Ø¼¨¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ + +.I arg2 +¤Ë»ØÄꤵ¤ì¤¿¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Í­¸ú¤Ç¤Ê¤¤¾ì¹ç¡¢ +¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.BR PR_CAPBSET_DROP " (Linux 2.6.25 °Ê¹ß)" +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.B CAP_SETPCAP +¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é +.I arg2 +¤Ç»ØÄꤵ¤ì¤¿¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò³°¤¹¡£ +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î»Ò¥×¥í¥»¥¹¤ÏÊѹ¹¸å¤Î¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤ò +·Ñ¾µ¤¹¤ë¡£ + +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬ +.B CAP_SETPCAP +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼ +.B EPERM +¤Ç¼ºÇÔ¤¹¤ë¡£ +.I arg2 +¤Ë»ØÄꤵ¤ì¤¿¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Í­¸ú¤Ç¤Ê¤¤¾ì¹ç¡¢ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥«¡¼¥Í¥ë¤ÇÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç +(¤³¤Î¾ì¹ç¤Ë¤Ï¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤)¡¢ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.BR PR_SET_DUMPABLE " (Linux 2.3.20 °Ê¹ß)" +(Linux 2.3.20 °Ê¹ß) +¥Ç¥Õ¥©¥ë¥È¤Î¿¶¤ëÉñ¤¤¤Ç¤Ï¥³¥¢¥À¥ó¥×¤ò°ú¤­µ¯¤³¤¹¤è¤¦¤Ê¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤¿¤È¤­¤Ë¡¢ +¥³¥¢¥À¥ó¥×¤¹¤ë¤«¤É¤¦¤«¤ò·èÄꤹ¤ë¥Õ¥é¥°¤òÀßÄꤹ¤ë +(Ä̾盧¤Î¥Õ¥é¥°¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +set-user-ID ¤¢¤ë¤¤¤Ï set-group-ID ¥×¥í¥°¥é¥à¤¬¼Â¹Ô¤µ¤ì¤¿¤ê¡¢ +¤µ¤Þ¤¶¤Þ¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤è¤Ã¤Æ¥×¥í¥»¥¹¤Î UID ¤ä GID ¤¬Áàºî¤µ¤ì¤¿¤È¤­¤Ë +¥¯¥ê¥¢¤µ¤ì¤ë)¡£ +2.6.12 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.I arg2 +¤Ï 0 (¥×¥í¥»¥¹¤Ï¥À¥ó¥×ÉÔ²Ä) ¤¢¤ë¤¤¤Ï 1 (¥×¥í¥»¥¹¤Ï¥À¥ó¥×²Äǽ) ¤Î +¤É¤Á¤é¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +2.6.13 ¤«¤é 2.6.17 ¤Þ¤Ç¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ÃÍ 2 ¤âǧ¤á¤é¤ì¤Æ¤¤¤¿¡£ +¤³¤ÎÃͤò»ØÄꤹ¤ë¤È¡¢Ä̾ï¤Ï¥À¥ó¥×¤µ¤ì¤Ê¤¤¥Ð¥¤¥Ê¥ê¤¬ root ¤À¤±¤¬ +Æɤ߹þ¤ß²Äǽ¤Ê·Á¤Ç¥À¥ó¥×¤µ¤ì¤¿¡£ +¥»¥­¥å¥ê¥Æ¥£¾å¤ÎÍýͳ¤«¤é¡¢¤³¤Îµ¡Ç½¤Ïºï½ü¤µ¤ì¤¿ +.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=115270289030630&w=2 +.\" Subject: Fix prctl privilege escalation (CVE-2006-2451) +.\" From: Marcel Holtmann +.\" Date: 2006-07-12 11:12:00 +.RB ( proc (5) +¤Î +.I /proc/sys/fs/suid_dumpable +¤ÎÀâÌÀ¤â»²¾È)¡£ +.TP +.BR PR_GET_DUMPABLE " (Linux 2.3.20 °Ê¹ß)" +(Linux 2.3.20 °Ê¹ß) +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤ª¤±¤ë¥À¥ó¥×²Äǽ¥Õ¥é¥°¤Î +¸½ºß¤Î¾õÂÖ¤ò (´Ø¿ô¤ÎÊÖ¤êÃͤȤ·¤Æ) ÊÖ¤¹¡£ +.\" [Í×½¤Àµ] Linux 2.6.13 °Ê¹ß¤Ç¤Ï¡¢¥À¥ó¥×²Äǽ¥Õ¥é¥°¤ÏÃÍ 2 ¤ò¤È¤ë¤³¤È¤¬ +.\" ¤Ç¤­¤ë¤¬¡¢2.6.13 ¤Ç¤Ï PR_GET_DUMPABLE ¤Ï¥À¥ó¥×²Äǽ¥Õ¥é¥°¤¬ 0 °Ê³°¤Î +.\" Ãͤξì¹ç 1 ¤òÊÖ¤¹¤À¤±¤Ç¤¢¤ë¡£¤³¤ì¤Ï 2.6.14 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ +.TP +.BR PR_SET_ENDIAN " (Linux 2.6.18 °Ê¹ß¡¢PowerPC ¤Î¤ß)" +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥¨¥ó¥Ç¥£¥¢¥óÀßÄê (endian-ness) ¤ò +\fIarg2\fP ¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ëÃÍ¤Ï +.\" ¤½¤ì¤¾¤ì 0, 1, 2 +.BR PR_ENDIAN_BIG , +.BR PR_ENDIAN_LITTLE , +.B PR_ENDIAN_PPC_LITTLE +(PowerPC µ¼»÷¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó) +¤Î¤¤¤º¤ì¤«°ì¤Ä¤Ç¤¢¤ë¡£ +.TP +.BR PR_GET_ENDIAN " (Linux 2.6.18 °Ê¹ß¡¢PowerPC ¤Î¤ß)" +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥¨¥ó¥Ç¥£¥¢¥óÀßÄê (endian-ness) ¤ò +.I "(int\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.TP +.BR PR_SET_FPEMU " (Linux 2.4.18 °Ê¹ß, 2.5.9, ia64 ¤Î¤ß)" +ÉâÆ°¾®¿ôÅÀ¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó (floating-point emulation) À©¸æ¥Ó¥Ã¥È¤ò +\fIarg2\fP ¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ëÃÍ¤Ï \fBPR_FPEMU_NOPRINT\fP (ÉâÆ°¾®¿ôÅÀÌ¿Îᥢ¥¯¥»¥¹¤òÌÛ¤Ã¤Æ +¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë) ¤« \fBPR_FPEMU_SIGFPE\fP (ÉâÆ°¾®¿ôÅÀÌ¿Îá¤ò¥¨¥ß¥å¥ì¡¼¥È¤»¤º¡¢ +Âå¤ï¤ê¤Ë +.B SIGFPE +¤òÁ÷¤ë) ¤Ç¤¢¤ë¡£ +.TP +.BR PR_GET_FPEMU " (Linux 2.4.18 °Ê¹ß, 2.5.9, ia64 ¤Î¤ß)" +ÉâÆ°¾®¿ôÅÀ¥¨¥ß¥å¥ì¡¼¥·¥ç¥óÀ©¸æ¥Ó¥Ã¥È¤ÎÃͤò +.I "(int\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.TP +.BR PR_SET_FPEXC " (Linux 2.4.21 ¤ª¤è¤Ó 2.5.32 °Ê¹ß¡¢PowerPC ¤Î¤ß)" +ÉâÆ°¾®¿ôÅÀÎã³°¥â¡¼¥É (floating-point exception mode) ¤ò +\fIarg2\fP ¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ë¤Î¤Ï°Ê²¼¤ÎÃͤǤ¢¤ë: +\fBPR_FP_EXC_SW_ENABLE\fP (FPEXC ¤ÇÉâÆ°¾®¿ôÅÀÎã³°¤òÍ­¸ú¤Ë¤¹¤ë)¡¢ +\fBPR_FP_EXC_DIV\fP (0 ½ü»»)¡¢ +\fBPR_FP_EXC_OVF\fP (¥ª¡¼¥Ð¡¼¥Õ¥í¡¼)¡¢ +\fBPR_FP_EXC_UND\fP (¥¢¥ó¥À¡¼¥Õ¥í¡¼)¡¢ +\fBPR_FP_EXC_RES\fP (ÉÔÀµ³Î¤Ê·ë²Ì (inexact result))¡¢ +\fBPR_FP_EXC_INV\fP (ÉÔÀµ¤ÊÌ¿Îá (invalid operation))¡¢ +\fBPR_FP_EXC_DISABLED\fP (ÉâÆ°¾®¿ôÅÀÎã³°¤ò̵¸ú¤Ë¤¹¤ë)¡¢ +\fBPR_FP_EXC_NONRECOV\fP (async nonrecoverable exception mode)¡¢ +\fBPR_FP_EXC_ASYNC\fP (async recoverable exception mode)¡¢ +\fBPR_FP_EXC_PRECISE\fP (precise exception mode)¡£ +.TP +.BR PR_GET_FPEXC "(Linux 2.4.21 ¤ª¤è¤Ó 2.5.32 °Ê¹ß¡¢PowerPC ¤Î¤ß)" +ÉâÆ°¾®¿ôÅÀÎã³°¥â¡¼¥É¤ÎÃͤò +.I "(int\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.TP +.BR PR_SET_KEEPCAPS " (Linux 2.2.18 °Ê¹ß)" +¥¹¥ì¥Ã¥É¤Î¡Ö¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ÊÝ»ý¡×¥Õ¥é¥°¤òÀßÄꤹ¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢¥¹¥ì¥Ã¥É¤Î¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤Î¤¦¤Á¾¯¤Ê¤¯¤È¤â +°ì¤Ä¤¬ 0 ¤Ç¤¢¤Ã¤¿¾õÂÖ¤«¤é¡¢¤³¤ì¤éÁ´¤Æ¤¬ 0 °Ê³°¤ËÊѹ¹¤µ¤ì¤¿¤È¤­¡¢ +¥¹¥ì¥Ã¥É¤Î¼Â¸ú/µö²Ä¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£½¸¹ç¤¬¥¯¥ê¥¢¤µ¤ì¤ë¤«¤É¤¦¤«¤ò·èÄꤹ¤ë +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£½¸¹ç¤Ï¥¯¥ê¥¢¤µ¤ì¤ë)¡£ +.I arg2 +¤Ï 0 (¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥¯¥ê¥¢¤¹¤ë) ¤¢¤ë¤¤¤Ï 1 (¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÊÝ»ý¤¹¤ë) ¤Î +¤É¤Á¤é¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BR execve (2) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤È¡¢¤³¤ÎÃÍ¤Ï 0 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +.TP +.BR PR_GET_KEEPCAPS " (Linux 2.2.18 °Ê¹ß)" +¸Æ¤Ó½Ð¤·¸µ¥¹¥ì¥Ã¥É¤Ë¤ª¤±¤ë¡Ö¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ÊÝ»ý¡×¥Õ¥é¥°¤Î +¸½ºß¤Î¾õÂÖ¤ò (´Ø¿ô¤ÎÊÖ¤êÃͤȤ·¤Æ) ÊÖ¤¹¡£ +.TP +.BR PR_SET_NAME " (Linux 2.6.9 °Ê¹ß)" +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹Ì¾¤ò +.I "(char\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤µ¤ì¤¿Ãͤò»È¤Ã¤ÆÀßÄꤹ¤ë¡£ +̾Á°¤ÏºÇÂç¤Ç 16 ¥Ð¥¤¥È¤Ç¤¢¤ê¡¢ +.\" TASK_COMM_LEN in include/linux/sched.h +¤½¤ì¤è¤ê¾¯¤Ê¤¤¥Ð¥¤¥È¿ô¤Î¾ì¹ç¤Ï NULL ¤Ç½ªÃ¼¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.BR PR_GET_NAME " (Linux 2.6.11 °Ê¹ß)" +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹Ì¾¤ò +.I "(char\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +¥Ð¥Ã¥Õ¥¡¤ÏºÇÂç¤Ç 16 ¥Ð¥¤¥È¤ò³ÊǼ¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +ÊÖ¤µ¤ì¤ëʸ»úÎó¤Ï¡¢Ä¹¤µ¤¬ 16 ¥Ð¥¤¥È¤è¤êû¤¤¾ì¹ç¤Ï NULL ½ªÃ¼¤µ¤ì¤ë¡£ +.TP +.BR PR_SET_PDEATHSIG " (Linux 2.1.57 °Ê¹ß)" +¿Æ¥×¥í¥»¥¹»àË´¥·¥°¥Ê¥ë (parent process death signal) ¤ò \fIarg2\fP ¤ËÀßÄꤹ¤ë +(ÀßÄê¤Ç¤­¤ë¥·¥°¥Ê¥ëÃͤÎÈÏ°Ï¤Ï 1..maxsig ¤Ç¤¢¤ê¡¢0 ¤ÏÄÌÃΤβò½ü¤Ç¤¢¤ë)¡£ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¿Æ¥×¥í¥»¥¹¤¬»à¤ó¤ÀºÝ¤Ë¡¢¤³¤³¤ÇÀßÄꤷ¤¿Ãͤ¬ +¥·¥°¥Ê¥ë¤È¤·¤ÆÄÌÃΤµ¤ì¤ë¡£¤³¤ÎÃÍ¤Ï +.BR fork (2) +¤Î»Ò¥×¥í¥»¥¹¤Ç¤Ï²ò½ü¤µ¤ì¤ë¡£ +.TP +.BR PR_GET_PDEATHSIG " (Linux 2.3.15 °Ê¹ß)" +¿Æ¥×¥í¥»¥¹»àË´¥·¥°¥Ê¥ë¤Î¸½ºß¤ÎÃͤò +.I "(int\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.TP +.BR PR_SET_SECCOMP " (Linux 2.6.23 °Ê¹ß)" +.\" See http://thread.gmane.org/gmane.linux.kernel/542632 +.\" [PATCH 0 of 2] seccomp updates +.\" andrea@cpushare.com +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î secure computing ¥â¡¼¥É¤òÀßÄꤹ¤ë¡£ +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.I arg2 +¤Ï 1 ¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +secure computing ¥â¡¼¥É¤ò 1 ¤ËÀßÄꤹ¤ë¤È¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¤¬¸Æ¤Ó½Ð¤·¤òµö²Ä¤µ¤ì¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.BR read (2), +.BR write (2), +.BR _exit (2), +.BR sigreturn (2) +¤À¤±¤Ë¤Ê¤ë¡£ +¤½¤ì°Ê³°¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¥·¥°¥Ê¥ë +.B SIGKILL +¤¬ÇÛÁ÷¤µ¤ì¤ë¡£ +¥Ñ¥¤¥×¤ä¥½¥±¥Ã¥È¤«¤éÆɤ߹þ¤ó¤À¡¢¿®Íê¤Ç¤­¤Ê¤¤¥Ð¥¤¥È¥³¡¼¥É¤ò¼Â¹Ô¤¹¤ë +ɬÍפ¬¤¢¤ëÂçÎ̤α黻¤ò¹Ô¤¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤ª¤¤¤Æ¡¢ +secure computing ¥â¡¼¥É¤ÏÌòΩ¤Ä¡£ +¤³¤ÎÁàºî¤ÏÍøÍѤǤ­¤ë¤Î¤Ï¡¢¥«¡¼¥Í¥ë¤¬ CONFIG_SECCOMP ¤òÍ­¸ú¤Ë¤·¤Æ +ºîÀ®¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +.TP +.BR PR_GET_SECCOMP " (Linux 2.6.23 °Ê¹ß)" +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î secure computing ¥â¡¼¥É¤òÊÖ¤¹¡£ +¸½ºß¤Î¼ÂÁõ (¥â¡¼¥É¤Ï 1 ¸ÇÄê) ¤Ï¤¢¤Þ¤êÌò¤ËΩ¤¿¤Ê¤¤¤¬¡¢ +¾­Í辤Υ⡼¥É¤¬¼ÂÁõ¤µ¤ì¤ë¤ÈÌòΩ¤Ä¤è¤¦¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬ secure computing ¥â¡¼¥É¤Ç¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +¤³¤ÎÁàºî¤Ï 0 ¤òÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬ secure computing ¥â¡¼¥É¤Î¾ì¹ç¡¢ +.BR prctl () +¤ò¸Æ¤Ó½Ð¤¹¤È¥·¥°¥Ê¥ë +.B SIGKILL +¤¬¤½¤Î¥×¥í¥»¥¹¤ËÁ÷¿®¤µ¤ì¤ë¡£ +¤³¤ÎÁàºî¤¬ÍøÍѤǤ­¤ë¤Î¤Ï¡¢¥«¡¼¥Í¥ë¤¬ CONFIG_SECCOMP ¤òÍ­¸ú¤Ë¤·¤Æ +ºîÀ®¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +.TP +.BR PR_SET_SECUREBITS " (Linux 2.6.26 °Ê¹ß)" +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î "securebits" ¥Õ¥é¥°¤ò +.I arg2 +¤ÇÅϤµ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +.BR capabilities (7) +»²¾È¡£ +.TP +.BR PR_GET_SECUREBITS " (Linux 2.6.26 °Ê¹ß)" +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î "securebits" ¥Õ¥é¥°¤ò +(´Ø¿ô¤ÎÊÖ¤êÃͤȤ·¤Æ) ÊÖ¤¹¡£ +.BR capabilities (7) +»²¾È¡£ +.TP +.BR PR_SET_TIMING " (Linux 2.6.0-test4 °Ê¹ß)" +(Ä̾ï¤Î¡¢ÅÁÅýŪ¤Ë»È¤ï¤ì¤Æ¤­¤¿) Åý·×Ū¤Ê¥×¥í¥»¥¹¥¿¥¤¥ß¥ó¥°¤ò»ÈÍѤ¹¤ë¤«¡¢ +Àµ³Î¤Ê¥¿¥¤¥à¥¹¥¿¥ó¥×¤Ë´ð¤Å¤¯¥×¥í¥»¥¹¥¿¥¤¥ß¥ó¥°¤ò»ÈÍѤ¹¤ë¤«¤òÀßÄꤹ¤ë¡£ +\fIarg2\fP ¤Ë»ØÄê¤Ç¤­¤ëÃÍ¤Ï +.B PR_TIMING_STATISTICAL +.\" 0 +¤« +.B PR_TIMING_TIMESTAMP +.\" 1 +¤Ç¤¢¤ë¡£ +.B PR_TIMING_TIMESTAMP +¤Ï¸½ºß¤Î¤È¤³¤í¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤ +(¤³¤Î¥â¡¼¥É¤ËÀßÄꤷ¤è¤¦¤È¤¹¤ë¤È¥¨¥é¡¼ +.B EINVAL +¤¬µ¯¤³¤ë¤³¤È¤À¤í¤¦)¡£ +.\" 2.6.26-rc8 ¤Ç¤Ï PR_TIMING_TIMESTAMP ¤Ï²¿¤â¤·¤Ê¤¤¡£ +.\" ¥Ñ¥Ã¥Á¤ÎÍúÎò¤ò¸«¤¿¤¬¡¢²áµî¤Ë¤â²¿¤«¤ò¤·¤¿¤³¤È¤â¤Ê¤¤¡£ +.TP +.BR PR_GET_TIMING " (Linux 2.6.0-test4 °Ê¹ß)" +¸½ºß»ÈÍÑÃæ¤Î¥×¥í¥»¥¹¥¿¥¤¥ß¥ó¥°¤ò·è¤á¤ëÊýË¡¤òÊÖ¤¹¡£ +.TP +.BR PR_SET_TSC " (Linux 2.6.26 °Ê¹ß, x86 ¤Î¤ß)" +¤½¤Î¥×¥í¥»¥¹¤¬¥¿¥¤¥à¥¹¥¿¥ó¥×¡¦¥«¥¦¥ó¥¿¤òÆɤ߽Ф»¤ë¤«¤ò·èÄꤹ¤ë +¥Õ¥é¥°¤Î¾õÂÖ¤òÀßÄꤹ¤ë¡£ +Æɤ߽Ф·¤òµö²Ä¤¹¤ë¾ì¹ç¤Ï +.I arg2 +¤Ë +.B PR_TSC_ENABLE +¤ò¡¢¤½¤Î¥×¥í¥»¥¹¤¬¥¿¥¤¥à¥¹¥¿¥ó¥×¡¦¥«¥¦¥ó¥¿¤òÆɤ߽Ф½¤¦¤È¤·¤¿ºÝ¤Ë +.B SIGSEGV +¤òȯÀ¸¤µ¤»¤ë¾ì¹ç¤Ë¤Ï +.B PR_TSC_SIGSEGV +¤òÅϤ¹¡£ +.TP +.BR PR_GET_TSC " (Linux 2.6.26 °Ê¹ß, x86 ¤Î¤ß)" +¤½¤Î¥×¥í¥»¥¹¤¬¥¿¥¤¥à¥¹¥¿¥ó¥×¡¦¥«¥¦¥ó¥¿¤òÆɤ߽Ф»¤ë¤«¤ò·èÄꤹ¤ë +¥Õ¥é¥°¤Î¾õÂÖ¤ò +.I "(int\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.TP +.B PR_SET_UNALIGN +(ia64 ¤Ç¤Ï Linux 2.3.48 °Ê¹ß; +parisc ¤Ç¤Ï Linux 2.6.15 °Ê¹ß; +PowerPC ¤Ç¤Ï Linux 2.6.18 °Ê¹ß; +Alpha ¤Ç¤Ï¡¡Linux 2.6.22 °Ê¹ß; +¤³¤ì¤é¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¤ß) +unaligned ¥¢¥¯¥»¥¹À©¸æ¥Ó¥Ã¥È¤ò \fIarg2\fP ¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ëÃÍ¤Ï \fBPR_UNALIGN_NOPRINT\fP (unaligned ¤Ê¥æ¡¼¥¶¥¢¥¯¥»¥¹¤òÌÛ¤Ã¤Æ +½¤Àµ¤¹¤ë) ¤« \fBPR_UNALIGN_SIGBUS\fP (unaligned ¤Ê¥æ¡¼¥¶¥¢¥¯¥»¥¹¤¬¤¢¤Ã¤¿¾ì¹ç +.B SIGBUS +¤òÀ¸À®¤¹¤ë) ¤Ç¤¢¤ë¡£ +.TP +.B PR_GET_UNALIGN +(¥Ð¡¼¥¸¥ç¥ó¤È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¾ðÊó¤Ï +.B PR_SET_UNALIGN +»²¾È) +unaligned ¥¢¥¯¥»¥¹À©¸æ¥Ó¥Ã¥È¤ÎÃͤò +.I "(int\ *) arg2" +¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR PR_GET_DUMPABLE , +.BR PR_GET_KEEPCAPS , +.BR PR_CAPBSET_READ , +.BR PR_GET_TIMING , +.BR PR_GET_SECUREBITS , +.BR PR_GET_SECCOMP +¤Ï¾å½Ò¤ÎÉé¤Ç¤Ê¤¤ÃͤòÊÖ¤¹ +.RB ( PR_GET_SECCOMP +¤ÏÊÖ¤é¤Ê¤¤¾ì¹ç¤â¤¢¤ë)¡£ +.I option +¤¬Â¾¤ÎÃͤξì¹ç¤ÏÀ®¸ù»þ¤Ë 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I arg2 +¤¬ÉÔÀµ¤Ê¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +.I option +¤ÎÃͤ¬Íý²ò¤Ç¤­¤Ê¤¤¡£ +.TP +.B EINVAL +.I arg2 +¤¬»ØÄꤵ¤ì¤¿ +.I option +¤ÇÍ­¸ú¤ÊÃͤǤϤʤ¤¡£ +.TP +.B EINVAL +.I option +¤¬ +.BR PR_SET_SECCOMP +¤« +.BR PR_GET_SECCOMP +¤À¤¬¡¢¥«¡¼¥Í¥ë¤¬ +.B CONFIG_SECCOMP +¤òÍ­¸ú¤Ë¤·¤ÆºîÀ®¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPERM +.I option +¤¬ +.B PR_SET_SECUREBITS +¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤¬¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.B CAP_SETPCAP +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢"locked" ¥Õ¥é¥°¤ò²ò½ü¤·¤è¤¦¤È¤·¤¿¡£ +¤Þ¤¿¤Ï¡¢locked ¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¤è¤¦¤È¤·¤¿ +.RB ( capabilities (7) +»²¾È)¡£ +.TP +.B EPERM +.I option +¤¬ +.B PR_SET_KEEPCAPS +¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥Õ¥é¥° +.B SECURE_KEEP_CAPS_LOCKED +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë +.RB ( capabilities (7) +»²¾È)¡£ +.TP +.B EPERM +.I option +¤¬ +.B PR_CAPBSET_DROP +¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤¬¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.B CAP_SETPCAP +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.\" The following can't actually happen, because prctl() in +.\" seccomp mode will cause SIGKILL. +.\" .TP +.\" .B EPERM +.\" .I option +.\" is +.\" .BR PR_SET_SECCOMP , +.\" and secure computing mode is already 1. +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR prctl () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.1.57 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.\" ¥é¥¤¥Ö¥é¥ê¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï glibc 2.0.6 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +¤³¤Î¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ë¡£ +IRIX ¤Ë¤Ï +.BR prctl () +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬¤¢¤ë¤¬ (MIPS ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤¤¤Æ +irix_prctl ¤È¤·¤Æ Linux 2.1.44 ¤ÇƱÍͤËƳÆþ¤µ¤ì¤¿)¡¢ +¤½¤Î¥×¥í¥È¥¿¥¤¥×¤Ï +.sp +.BI "ptrdiff_t prctl(int " option ", int " arg2 ", int " arg3 ); +.sp +¤Ç¤¢¤ë¡£¥æ¡¼¥¶¡¼Åö¤ê¤Î¥×¥í¥»¥¹ºÇÂç¿ô¤ò¼èÆÀ¤¹¤ë¥ª¥×¥·¥ç¥ó¡¢ +¥×¥í¥»¥¹¤Î»ÈÍѤǤ­¤ëºÇÂç¥×¥í¥Ã¥µ¡¼¿ô¤ò¼èÆÀ¤¹¤ë¥ª¥×¥·¥ç¥ó¡¢ +¸½ºßÆÃÄê¤Î¥×¥í¥»¥¹¤¬Ää»ß(block)¤µ¤»¤é¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«Ä´¤Ù¤ë¥ª¥×¥·¥ç¥ó¡¢ +¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤ÎºÇÂçÃͤμèÆÀ¤äÀßÄê¤ò¹Ô¤Ê¤¦¥ª¥×¥·¥ç¥ó¤Ê¤É¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR signal (2), +.BR core (5) diff --git a/release/man2/pread.2 b/release/man2/pread.2 new file mode 100644 index 00000000..9f88a5ed --- /dev/null +++ b/release/man2/pread.2 @@ -0,0 +1,114 @@ +.\" 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 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +pread, pwrite \- »ØÄꤷ¤¿¥ª¥Õ¥»¥Ã¥È¤Ç¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÆɤ߽ñ¤­¤¹¤ë +.SH ½ñ¼° +.B #define _XOPEN_SOURCE 500 +.sp +.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 ); +.SH ÀâÌÀ +.BR pread () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Î (¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤«¤é¤Î) ¥ª¥Õ¥»¥Ã¥È +.I offset +¤«¤éºÇÂç +.I count +¥Ð¥¤¥È¤ò¥Ð¥Ã¥Õ¥¡ +.I buf +¤ØÆɤ߹þ¤à¡£¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤ÏÊѲ½¤·¤Ê¤¤¡£ +.PP +.BR pwrite () +¤Ï¡¢¥Ð¥Ã¥Õ¥¡ +.I buf +¤«¤éºÇÂç +.I count +¥Ð¥¤¥È¤ò¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Î¥ª¥Õ¥»¥Ã¥È +.I offset +¤Ë½ñ¤­¹þ¤à¡£¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤ÏÊѲ½¤·¤Ê¤¤¡£ +.PP +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ï¥·¡¼¥¯ (seek) ²Äǽ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢Æɤ߽ñ¤­¤ò¹Ô¤Ã¤¿¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë (¥¼¥í¤Ï¡¢ +.BR pwrite () +¤Î¾ì¹ç¤Ë¤Ï²¿¤â½ñ¤«¤ì¤Ê¤«¤Ã¤¿¤³¤È¤ò°ÕÌ£¤·¡¢ +.BR pread () +¤Î¾ì¹ç¤Ë¤Ï¥Õ¥¡¥¤¥ë +¤ÎËöÈø¤Ë㤷¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë)¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¤½¤Î¥¨¥é¡¼¤ò¼¨¤¹¤è¤¦¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR pread () +¤Ç¤Ï¡¢ +.BR read (2) +¤ª¤è¤Ó +.BR lseek (2) +¤Çµ¬Äꤵ¤ì¤¿Á´¤Æ¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ê¡¢ +.I error +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.BR pwrite () +¤Ç¤Ï¡¢ +.BR write (2) +¤ª¤è¤Ó +.BR lseek (2) +¤Çµ¬Äꤵ¤ì¤¿Á´¤Æ¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ê¡¢ +.I error +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR pread () +¤È +.BR pwrite () +¤Ï Linux ¤Ë¥Ð¡¼¥¸¥ç¥ó 2.1.60 ¤ÇÄɲ䵤줿¡£ +i386 ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥¨¥ó¥È¥ê¤Ï 2.1.69 ¤ÇÄɲ䵤줿¡£ +(¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ý¤¿¤Ê¤¤¸Å¤¤¥«¡¼¥Í¥ë¤Ç¤Î +.BR lseek (2) +¤ò»È¤Ã¤¿¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤ò´Þ¤á¤ë¤È) +C ¥é¥¤¥Ö¥é¥ê¤Ë¤ª¤±¤ë¥µ¥Ý¡¼¥È¤Ï glibc 2.1 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR lseek (2), +.BR read (2), +.BR write (2), +.BR feature_test_macros (7) diff --git a/release/man2/ptrace.2 b/release/man2/ptrace.2 new file mode 100644 index 00000000..ca1d7f1a --- /dev/null +++ b/release/man2/ptrace.2 @@ -0,0 +1,564 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" changes Copyright 1999 Mike Coleman (mkc@acm.org) +.\" -- major revision to fully document ptrace semantics per recent Linux +.\" kernel (2.2.10) and glibc (2.1.2) +.\" Sun Nov 7 03:18:35 CST 1999 +.\" +.\" 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 Fri Jul 23 23:47:18 1993 by Rik Faith +.\" Modified Fri Jan 31 16:46:30 1997 by Eric S. Raymond +.\" Modified Thu Oct 7 17:28:49 1999 by Andries Brouwer +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" 2006-03-24, Chuck Ebbert <76306.1226@compuserve.com> +.\" Added PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, +.\" PTRACE_SETSIGINFO, PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP +.\" (Thanks to Blaisorblade, Daniel Jacobowitz and others who helped.) +.\" +.\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1999-11-20, HANATAKA Shinya +.\" Updated 2003-10-11, Kentaro Shirakata +.\" Updated 2006-07-23, Akihiro MOTOKI , LDP v2.28 +.\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2009-04-13, Akihiro MOTOKI, LDP v3.20 +.\" +.\"WORD: child process »Ò¥×¥í¥»¥¹ +.\"WORD: parent process ¿Æ¥×¥í¥»¥¹ +.\"WORD: core image ¥á¥â¥ê¡¦¥¤¥á¡¼¥¸ +.\"WORD: break point ¥Ö¥ì¡¼¥¯¡¦¥Ý¥¤¥ó¥È +.\"WORD: single step ¥·¥ó¥°¥ë¡¦¥¹¥Æ¥Ã¥×¼Â¹Ô +.\"WORD: trap flag ¥È¥é¥Ã¥×¡¦¥Õ¥é¥° +.\"WORD: attach Àܳ +.\"WORD: detach ʬΥ +.\"WORD: process ID ¥×¥í¥»¥¹ID +.\" +.TH PTRACE 2 2009-03-30 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ptrace \- ¥×¥í¥»¥¹¤Î¥È¥ì¡¼¥¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long ptrace(enum __ptrace_request " request ", pid_t " pid ", " +.BI " void *" addr ", void *" data ); +.fi +.SH ÀâÌÀ +.BR ptrace () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¿Æ¥×¥í¥»¥¹¤¬¡¢ÊÌ¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤Î´Æ»ë/À©¸æ¤ò +¹Ô¤Ã¤¿¤ê¡¢¥³¥¢¥¤¥á¡¼¥¸ (core image) ¤ä¥ì¥¸¥¹¥¿¤ÎÄ´ºº/Êѹ¹¤ò +¹Ô¤Ã¤¿¤ê¤¹¤ë¼êÃʤòÄ󶡤¹¤ë¡£ +.BR ptrace () +¤Ï¡¢¼ç¤Ë¥Ö¥ì¡¼¥¯¥Ý¥¤¥ó¥È¤Ë¤è¤ë¥Ç¥Ð¥Ã¥°¤ä¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥È¥ì¡¼¥¹¤ò +¼ÂÁõ¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +.LP +¥È¥ì¡¼¥¹¤ò³«»Ï¤¹¤ë¤Ë¤Ï¡¢¤Þ¤º¿Æ¥×¥í¥»¥¹¤Ç +.BR fork (2) +¤ò¸Æ¤Ó½Ð¤¹¡£À¸À®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ç +.B PTRACE_TRACEME +¤ò¹Ô¤¤¡¢Â³¤¤¤Æ (ŵ·¿Åª¤Ë¤Ï) +.BR exec (3) +¤ò¹Ô¤Ê¤¦¡£ +Ê̤ÎÊýË¡¤È¤·¤Æ¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤¬´û¸¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ +.B PTRACE_ATTACH +¤ò»ÈÍѤ·¡¢¥È¥ì¡¼¥¹¤ò³«»Ï¤¹¤ë¡£ +.LP +¥È¥ì¡¼¥¹¤Î¼Â¹ÔÃæ¡¢»Ò¥×¥í¥»¥¹¤Ï¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤¿¤Ó¤Ë¡¢ +¤¿¤È¤¨¤½¤Î¥·¥°¥Ê¥ë¤¬Ìµ»ë¤¹¤Ù¤­¤â¤Î¤Ç¤¢¤Ã¤Æ¤âÄä»ß¤¹¤ë +.RB ( SIGKILL +¤ÏÎã³°¤Ç¡¢Ä̾ï¤É¤ª¤ê¤Î¸ú²Ì¤ò¤â¤¿¤é¤¹)¡£ +¿Æ¥×¥í¥»¥¹¤Ë¤Ï¼¡¤Î +.BR wait (2) +¤ÇÄÌÃΤµ¤ì¡¢Ää»ß¤·¤Æ¤¤¤ë´Ö¤Ë»Ò¥×¥í¥»¥¹¤òÄ´¤Ù¤¿¤ê½¤Àµ¤·¤¿¤ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤½¤·¤Æ¿Æ¥×¥í¥»¥¹¤Ï»Ò¥×¥í¥»¥¹¤Î¼Â¹Ô¤òºÆ³«¤µ¤»¤ë¤¬¡¢ÇÛÁ÷¤µ¤ì¤¿ +¥·¥°¥Ê¥ë¤ò̵»ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë (¤¢¤ë¤¤¤ÏÂå¤ï¤ê¤ËÊ̤Υ·¥°¥Ê¥ë¤ò +ÇÛÁ÷¤¹¤ë¤³¤È¤â¤Ç¤­¤ë) ¡£ +.LP +¿Æ¥×¥í¥»¥¹¤¬¥È¥ì¡¼¥¹¤ò½ªÎ»¤¹¤ëºÝ¤Ë¤Ï¡¢ +.B PTRACE_KILL +¤ò»ÈÍѤ·¤Æ»Ò¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë¤³¤È¤â¤Ç¤­¤ë¤·¡¢ +.B PTRACE_DETACH +¤òÍѤ¤¤ÆÄ̾ï¤Î¥È¥ì¡¼¥¹¤Ê¤·¤Î¥â¡¼¥É¤Ë¤·¤Æ¡¢ +¼Â¹Ô¤ò·Ñ³¤µ¤»¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.LP +\fIrequest\fP ¤ÎÃͤ¬¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÆ°ºî¤ò·èÄꤹ¤ë: +.TP +.B PTRACE_TRACEME +¤³¤Î¥×¥í¥»¥¹¤¬¿Æ¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ¥È¥ì¡¼¥¹¤µ¤ì¤ë¤³¤È¤òɽ¤¹¡£ +¤³¤Î¥×¥í¥»¥¹¤Ë +.RB ( SIGKILL +°Ê³°¤Î) ¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤È¡¢ +¥×¥í¥»¥¹¤ÏÄä»ß¤·¡¢¿Æ¥×¥í¥»¥¹¤Ë +.BR wait (2) +¤òÄ̤¸¤ÆÄÌÃΤµ¤ì¤ë¡£ +¤Þ¤¿¡¢¤³¤ì°Ê¹ß¤Ï¤³¤Î¥×¥í¥»¥¹¤¬ +.BR execve (2) +¤ò¸Æ¤Ó½Ð¤¹ÅÙ¤Ë +.B SIGTRAP +¤¬Á÷¿®¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤³¤ì¤Ë¤è¤Ã¤Æ¡¢¿Æ¥×¥í¥»¥¹¤Ï +¿·¤·¤¤¥×¥í¥°¥é¥à¤¬¼Â¹Ô¤ò³«»Ï¤¹¤ëÁ°¤ËÀ©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¿Æ¥×¥í¥»¥¹¤¬¼«¥×¥í¥»¥¹¤ò¥È¥ì¡¼¥¹¤¹¤ë¤Ä¤â¤ê¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +¤ª¤½¤é¤¯¤³¤Î¥×¥í¥»¥¹¤ÏËÜÍ×µá¤ò¹Ô¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¤À¤í¤¦¡£ +(\fIpid\fP, \fIaddr\fP, \fIdata\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.LP +¾åµ­¤ÎÍ×µá¤Ï»Ò¥×¥í¥»¥¹¤À¤±¤¬¹Ô¤Ê¤¦¤â¤Î¤Ç¤¢¤ë¡£ +»Ä¤ê¤Ï¿Æ¥×¥í¥»¥¹¤À¤±¤¬¹Ô¤Ê¤¦¤â¤Î¤Ç¤¢¤ë¡£ +°Ê²¼¤ÎÍ×µá¤Ç¤Ï¡¢\fIpid\fP ¤ÇÁàºî¤ÎÂоݤȤʤë +»Ò¥×¥í¥»¥¹¤ò»ØÄꤹ¤ë¡£ +.B PTRACE_KILL +¤ò½ü¤­¡¢Í×µá¤ò¹Ô¤Ê¤¦¤¿¤á¤Ë¤Ï +»Ò¥×¥í¥»¥¹¤ÏÄä»ß¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BR PTRACE_PEEKTEXT ", " PTRACE_PEEKDATA +»Ò¥×¥í¥»¥¹¤Î¥á¥â¥ê¤Î +.I addr +¤Î°ÌÃÖ¤«¤é 1 ¥ï¡¼¥É¤òÆɤ߽Ф¹¡£Æɤ߽Ф·¤¿¥ï¡¼¥É¤Ï +.BR ptrace () +¤ÎÊÖ¤êÃͤȤ·¤ÆÊÖ¤µ¤ì¤ë¡£ Linux ¤Ç¤Ï¥Æ¥­¥¹¥È (text) ¤È¥Ç¡¼¥¿ (data) ¤Ç +Ʊ¤¸¥¢¥É¥ì¥¹¶õ´Ö¤ò»ÈÍѤ¹¤ë¤¿¤á¡¢¤³¤Î 2 ¤Ä¤ÎÍ×µá¤Ï¸½ºß¤Î¤È¤³¤í +Ʊ¤¸¤â¤Î¤Ç¤¢¤ë¡£ (°ú¤­¿ô \fIdata\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.B PTRACE_PEEKUSER +.\" PTRACE_PEEKUSR in kernel source, but glibc uses PTRACE_PEEKUSER, +.\" and that is the name that seems common on other systems. +»Ò¥×¥í¥»¥¹¤Î USER Îΰè¤Î¥ª¥Õ¥»¥Ã¥È +.I addr +¤Î°ÌÃÖ¤«¤é 1 ¥ï¡¼¥É¤òÆɤ߹þ¤à¡£USER Îΰè¤Ë¤Ï¤½¤Î¥×¥í¥»¥¹¤Î +¥ì¥¸¥¹¥¿ (registers) ¤Ê¤É¤Î¾ðÊó¤¬ÊÝ»ý¤µ¤ì¤Æ¤¤¤ë +(\fI\fP ¤ò»²¾È)¡£Æɤ߹þ¤ó¤À¥ï¡¼¥É¤Ï +.BR ptrace () +¥³¡¼¥ë¤Î·ë²Ì¤È¤·¤ÆÊÖ¤µ¤ì¤ë¡£ +¤¿¤¤¤Æ¤¤¤Ï¥ª¥Õ¥»¥Ã¥È¤Ï¥ï¡¼¥É¶­³¦¤Ë¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤¬¡¢ +¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤è¤Ã¤Æ¤Ï¤½¤ÎɬÍפϤʤ¤¡£ +¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¡£ +(\fIdata\fP ¤Ï̵»ë¤µ¤ì¤ë¡£ ) +.TP +.BR PTRACE_POKETEXT ", " PTRACE_POKEDATA +¥ï¡¼¥É +.I data +¤ò»Ò¥×¥í¥»¥¹¤Î¥á¥â¥ê¤Î +.I addr +¤Î°ÌÃ֤إ³¥Ô¡¼¤¹¤ë¡£¾å¤ÈƱÍͤˡ¢¸½ºß¤Î¤È¤³¤íÆó¤Ä¤Î +Í×µá¤ÏƱ¤¸¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.B PTRACE_POKEUSER +.\" PTRACE_POKEUSR in kernel source, but glibc uses PTRACE_POKEUSER, +.\" and that is the name that seems common on other systems. +¥ï¡¼¥É +.I data +¤ò»Ò¥×¥í¥»¥¹¤Î USER Îΰè¤Î¥ª¥Õ¥»¥Ã¥È +.I addr +¤Î°ÌÃ֤˥³¥Ô¡¼¤¹¤ë¡£ +¾å¤ÈƱÍͤˡ¢Ä̾¥ª¥Õ¥»¥Ã¥È¤Ï¥ï¡¼¥É¶­³¦¤Ë¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥«¡¼¥Í¥ë¤Î´°Á´À­ (integrity) ¤ò°Ý»ý¤¹¤ë¤¿¤á¡¢ +Êѹ¹ÆâÍƤˤè¤Ã¤Æ¤Ï USER Îΰè¤ÎÊѹ¹¤Ï¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.BR PTRACE_GETREGS ", " PTRACE_GETFPREGS +¤½¤ì¤¾¤ì¡¢»Ò¥×¥í¥»¥¹¤ÎÈÆÍѥ쥸¥¹¥¿¡¢ÉâÆ°¾®¿ôÅÀ¥ì¥¸¥¹¥¿¤ò¿Æ¥×¥í¥»¥¹¤Î +\fIdata\fP ¤Î°ÌÃ֤˥³¥Ô¡¼¤¹¤ë¡£¤³¤Î data ¤Î½ñ¼°¤Ë´Ø¤·¤Æ¤Ï +\fI\fP ¤ò»²¾È¤¹¤ë¤³¤È¡£(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.BR PTRACE_GETSIGINFO " (Linux 2.3.99-pre6 °Ê¹ß)" +Ää»ß¤Î¸¶°ø¤È¤Ê¤Ã¤¿¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ +\fIsiginfo_t\fP ¹½Â¤ÂÎ +.RB ( sigaction (2) +»²¾È) ¤ò»Ò¥×¥í¥»¥¹¤«¤é¿Æ¥×¥í¥»¥¹¤Î \fIdata\fP ¤Î°ÌÃ֤˥³¥Ô¡¼¤¹¤ë¡£ +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.BR PTRACE_SETREGS ", " PTRACE_SETFPREGS +¤½¤ì¤¾¤ì¡¢»Ò¥×¥í¥»¥¹¤ÎÈÆÍѥ쥸¥¹¥¿¡¢ÉâÆ°¾®¿ôÅÀ¥ì¥¸¥¹¥¿¤Ë +¿Æ¥×¥í¥»¥¹¤Î \fIdate\fP ¤Î°ÌÃÖ¤«¤é¥³¥Ô¡¼¤¹¤ë¡£ +.B PTRACE_POKEUSER +¤ÈƱÍͤˡ¢ÈÆÍѥ쥸¥¹¥¿¤Ë¤è¤Ã¤Æ¤Ï +Êѹ¹¤¬¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤¬¤¢¤ë¡£ (\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.BR PTRACE_SETSIGINFO " (Linux 2.3.99-pre6 °Ê¹ß)" +¥·¥°¥Ê¥ë¾ðÊó¤òÀßÄꤹ¤ë¡£ +\fIsiginfo_t\fP ¹½Â¤ÂΤò¿Æ¥×¥í¥»¥¹¤Î¥Ç¡¼¥¿ \fIdata\fP ¤Î°ÌÃÖ¤«¤é +»Ò¥×¥í¥»¥¹¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +¤³¤Î½èÍý¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¤Î¤Ï¡¢»Ò¥×¥í¥»¥¹¤ËÄ̾ï¤ÏÇÛÁ÷¤µ¤ì¤ë¤Ï¤º¤Ç +¥È¥ì¡¼¥µ¤ËÊ᪤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ë¤Ä¤¤¤Æ¤À¤±¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤ÎÄ̾ï¤Î¥·¥°¥Ê¥ë¤È +.BR ptrace () +¼«¿È¤¬È¯À¸¤¹¤ë¥·¥°¥Ê¥ë¤ò¸«Ê¬¤±¤ë¤Î¤ÏÆñ¤·¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.BR PTRACE_SETOPTIONS " (Linux 2.4.6 °Ê¹ß; ¥Ð¥°¤Î¾Ï¤Ë¤¢¤ë·Ù¹ð¤â»²¾È)" +¿Æ¥×¥í¥»¥¹¤Î \fIdata\fP ¤Ë´ð¤Å¤¤¤Æ ptrace ¤Î¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë)¡£ +\fIdata\fP ¤Ï¥ª¥×¥·¥ç¥ó¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤È¤·¤Æ²ò¼á¤µ¤ì¡¢ +¥ª¥×¥·¥ç¥ó¤Ë¤Ï°Ê²¼¤Î¥Õ¥é¥°¤ò»ØÄê¤Ç¤­¤ë: +.RS +.TP +.BR PTRACE_O_TRACESYSGOOD " (Linux 2.4.6 °Ê¹ß)" +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥È¥é¥Ã¥×¤¬ÇÛÁ÷¤µ¤ì¤¿¤È¤­¤Ë¡¢¥·¥°¥Ê¥ëÈÖ¹æ¤Î¥Ó¥Ã¥È 7 +¤òÀßÄꤹ¤ë (¤¹¤Ê¤ï¤Á¡¢\fI(SIGTRAP | 0x80)\fP ¤òÇÛÁ÷¤¹¤ë)¡£ +¤³¤ì¤Ë¤è¤ê¡¢¥È¥ì¡¼¥µ¤¬Ä̾ï¤Î¥È¥é¥Ã¥×¤È¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤è¤ë¥È¥é¥Ã¥×¤ò +¶èÊ̤·¤ä¤¹¤¯¤Ê¤ë¡£ +.RB ( PTRACE_O_TRACESYSGOOD +¤Ï¤É¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤âÆ°ºî¤·¤Ê¤¤²ÄǽÀ­¤¬¤¢¤ë¡£) +.TP +.BR PTRACE_O_TRACEFORK " (Linux 2.5.46 °Ê¹ß)" +¼¡¤Î +.BR fork (2) +¸Æ¤Ó½Ð¤·»þ¤Ë \fISIGTRAP | PTRACE_EVENT_FORK\ <<\ 8\fP ¤Ç +»Ò¥×¥í¥»¥¹¤ÎÆ°ºî¤òÄä»ß¤µ¤»¡¢ +¿·¤¿¤Ë fork ¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¥È¥ì¡¼¥¹¤ò¼«Æ°Åª¤Ë³«»Ï¤·¡¢ +.B SIGSTOP +¤Ç¤½¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò³«»Ï¤¹¤ë¡£ +¿·¤·¤¤¥×¥í¥»¥¹¤Î PID ¤Ï +.B PTRACE_GETEVENTMSG +¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +.TP +.BR PTRACE_O_TRACEVFORK " (Linux 2.5.46 °Ê¹ß)" +¼¡¤Î +.BR vfork (2) +¸Æ¤Ó½Ð¤·»þ¤Ë \fISIGTRAP | PTRACE_EVENT_VFORK\ <<\ 8\fP ¤Ç +»Ò¥×¥í¥»¥¹¤ÎÆ°ºî¤òÄä»ß¤µ¤»¡¢ +¿·¤¿¤Ë vfork ¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¥È¥ì¡¼¥¹¤ò¼«Æ°Åª¤Ë³«»Ï¤·¡¢ +.B SIGSTOP +¤Ç¤½¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò³«»Ï¤¹¤ë¡£ +¿·¤·¤¤¥×¥í¥»¥¹¤Î PID ¤Ï +.B PTRACE_GETEVENTMSG +¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +.TP +.BR PTRACE_O_TRACECLONE " (Linux 2.5.46 °Ê¹ß)" +¼¡¤Î +.BR clone (2) +¸Æ¤Ó½Ð¤·»þ¤Ë \fISIGTRAP | PTRACE_EVENT_CLONE\ << \8\fP ¤Ç +»Ò¥×¥í¥»¥¹¤ÎÆ°ºî¤òÄä»ß¤µ¤»¡¢ +¿·¤¿¤Ë clone ¤ÇºîÀ®¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¥È¥ì¡¼¥¹¤ò¼«Æ°Åª¤Ë³«»Ï¤·¡¢ +.B SIGSTOP +¤Ç¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò³«»Ï¤¹¤ë¡£ +¿·¤·¤¤¥×¥í¥»¥¹¤Î PID ¤Ï +.B PTRACE_GETEVENTMSG +¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÇÁ´¤Æ¤Î +.BR clone (2) +¥³¡¼¥ë¤òÊá¤Þ¤¨¤é¤ì¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +»Ò¥×¥í¥»¥¹¤¬ +.B CLONE_VFORK +¥Õ¥é¥°ÉÕ¤­¤Ç +.BR clone (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¡¢ +.B PTRACE_O_TRACEVFORK +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ì¤ÐÂå¤ï¤ê¤Ë +.B PTRACE_EVENT_VFORK +¤¬ÇÛÁ÷¤µ¤ì¤ë¡£ +¤Þ¤¿¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¥·¥°¥Ê¥ë¤ò +.B SIGCHLD +¤ËÀßÄꤷ¤Æ +.BR clone (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤Ï¡¢ +.B PTRACE_O_TRACEFORK +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð +.B PTRACE_EVENT_FORK +¤¬ÇÛÁ÷¤µ¤ì¤ë¡£ +.TP +.BR PTRACE_O_TRACEEXEC " (Linux 2.5.46 °Ê¹ß)" +¼¡¤Î +.BR execve (2) +¸Æ¤Ó½Ð¤·»þ¤Ë +\fISIGTRAP | PTRACE_EVENT_EXEC\ <<\ 8\fP +¤Ç»Ò¥×¥í¥»¥¹¤ÎÆ°ºî¤òÄä»ß¤µ¤»¤ë¡£ +.TP +.BR PTRACE_O_TRACEVFORKDONE " (Linux 2.5.60 °Ê¹ß)" +¼¡¤Î +.BR vfork (2) +¸Æ¤Ó½Ð¤·»þ¤Ë +\fISIGTRAP | PTRACE_EVENT_VFORK_DONE\ <<\ 8\fP +¤Ç»Ò¥×¥í¥»¥¹¤ÎÆ°ºî¤òÄä»ß¤µ¤»¤ë¡£ +.TP +.BR PTRACE_O_TRACEEXIT " (Linux 2.5.60 °Ê¹ß)" +½ªÎ» (exit) »þ¤Ë \fISIGTRAP | PTRACE_EVENT_EXIT\ <<\ 8\fP +¤Ç»Ò¥×¥í¥»¥¹¤ÎÆ°ºî¤òÄä»ß¤µ¤»¤ë¡£»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ï +.B PTRACE_GETEVENTMSG +¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +¤³¤ÎÄä»ß¤Ï¥ì¥¸¥¹¥¿¤¬¤Þ¤À»²¾È²Äǽ¤Ç¤¢¤ë¥×¥í¥»¥¹½ªÎ»½èÍý¤Î½é´ü¤Ë¹Ô¤ï¤ì¡¢ +¥È¥ì¡¼¥µ¤Ï¤É¤³¤Ç½ªÎ»¤¬È¯À¸¤·¤¿¤«¤òÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +Ä̾ï¤Î½ªÎ»ÄÌÃÎ (exit notification) ¤Ï¥×¥í¥»¥¹¤Î½ªÎ»½èÍý¤¬´°Î»¤·¤¿¸å¤Ë +¹Ô¤ï¤ì¤ë¡£¥³¥ó¥Æ¥­¥¹¥È¤ò»²¾È¤¹¤ë¤³¤È¤Ï¤Ç¤­¤ë¤Ë¤â´Ø¤ï¤é¤º¡¢ +¥È¥ì¡¼¥µ¤Ï¤³¤Î»þÅÀ¤«¤é½ªÎ»¤ò»ß¤á¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.RE +.TP +.BR PTRACE_GETEVENTMSG " (Linux 2.5.46 °Ê¹ß)" +ȯÀ¸¤·¤¿¤Ð¤«¤ê¤Î ptrace ¥¤¥Ù¥ó¥È¤Ë´Ø¤¹¤ë¥á¥Ã¥»¡¼¥¸¤ò +.RI ( "unsigned long" +·¿¤Ç) ¼èÆÀ¤¹¤ë¡£ +¼èÆÀ¤·¤¿¥á¥Ã¥»¡¼¥¸¤Ï¿Æ¥×¥í¥»¥¹¤Î \fIdata\fP ¤Î°ÌÃ֤˳ÊǼ¤µ¤ì¤ë¡£ +ÆÀ¤é¤ì¤ëÆâÍƤϡ¢ +.B PTRACE_EVENT_EXIT +¤Î¾ì¹ç¤Ï»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ç¤¢¤ê¡¢ +.BR PTRACE_EVENT_FORK , +.BR PTRACE_EVENT_VFORK , +.B PTRACE_EVENT_CLONE +¤Î¾ì¹ç¤Ï¿·¤·¤¤¥×¥í¥»¥¹¤Î PID ¤Ç¤¢¤ë¡£ +Linux 2.6.18 °Ê¹ß¤Ç¤Ï¡¢¿·¤·¤¤¥×¥í¥»¥¹¤Î PID ¤Ï +.B PTRACE_EVENT_VFORK_DONE +¤ÇÆþ¼ê¤Ç¤­¤ë¡£ +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.B PTRACE_CONT +Ää»ß¤·¤¿»Ò¥×¥í¥»¥¹¤Î¼Â¹Ô¤òºÆ³«¤µ¤»¤ë¡£ +\fIdata\fP ¤¬¥¼¥í¤Ç¤Ê¤¯¡¢ +.B SIGSTOP +¤Ç¤â¤Ê¤±¤ì¤Ð¡¢ +»Ò¥×¥í¥»¥¹¤ËÇÛÁ÷¤µ¤ì¤ë¥·¥°¥Ê¥ë¤È²ò¼á¤µ¤ì¤ë¡£ +¥¼¥í¤ä +.B SIGSTOP +¤Î¾ì¹ç¤Ï¥·¥°¥Ê¥ë¤ÏÇÛÁ÷¤µ¤ì¤Ê¤¤¡£ +¤³¤ì¤ò»È¤¦¤È¡¢Î㤨¤Ð¡¢¿Æ¥×¥í¥»¥¹¤Ï +»Ò¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤¿¥·¥°¥Ê¥ë¤ò¼ÂºÝ¤ËÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¤ò +À©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.BR PTRACE_SYSCALL ", " PTRACE_SINGLESTEP +.B PTRACE_CONT +¤ÈƱÍͤËÄä»ß¤·¤¿»Ò¥×¥í¥»¥¹¤òºÆ³«¤¹¤ë¡£¤¿¤À¤·¡¢ +.B PTRACE_SYSCALL +¤Î¾ì¹ç¤Ï»Ò¥×¥í¥»¥¹¤¬ +¼¡¤Ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÆþ¤ë¤«¥·¥¹¥Æ¥à¥³¡¼¥ë¤«¤éÈ´¤±¤ë¤«¤¹¤ë»þ¤Ë¡¢ +.B PTRACE_SINGLESTEP +¤Î¾ì¹ç¤Ï 1 Ì¿Îá (instruction) ¼Â¹Ô¤·¤¿¸å¤ËÄä»ß¤µ¤»¤ë +(Ä̾ï¤É¤ª¤ê¡¢»Ò¥×¥í¥»¥¹¤Ï¥·¥°¥Ê¥ë¤ò¼õ¤±¼è¤Ã¤¿¾ì¹ç¤Ë¤âÄä»ß¤¹¤ë)¡£ +¿Æ¥×¥í¥»¥¹¤«¤é¸«¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤Ï +.B SIGTRAP +¤ò¼õ¿®¤·¤ÆÄä»ß¤·¤¿¤è¤¦¤Ë¸«¤¨¤ë¡£¤½¤Î¤¿¤á¡¢Î㤨¤Ð +.B PTRACE_SYSCALL +¤ò»È¤¦¤È¡¢1²óÌܤÎÄä»ß¤Ç°ú¤­¿ô¤òÄ´¤Ù¤Æ +.B PTRACE_SYSCALL +¤ò¼Â¹Ô¤·¡¢ 2²óÌܤÎÄä»ß¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÊÖ¤êÃͤòÄ´¤Ù¤ë¡¢ +¤È¤¤¤¦¤è¤¦¤Ê¤³¤È¤¬¤Ç¤­¤ë¡£ +°ú¤­¿ô +.I data +¤Ï +.B PTRACE_CONT +¤Î¾ì¹ç¤ÈƱ¤¸Íͤ˲ò¼á¤µ¤ì¤ë¡£ +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.BR PTRACE_SYSEMU ", " PTRACE_SYSEMU_SINGLESTEP " (Linux 2.6.14 °Ê¹ß)" +.B PTRACE_SYSEMU +¤Ï¡¢¼Â¹Ô¤òºÆ³«¤·¡¢¼¡¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÆþ¤ë»þ¤ËÄä»ß¤µ¤»¤ë¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼Â¹Ô¤µ¤ì¤Ê¤¤¡£ +.B PTRACE_SYSEMU_SINGLESTEP +¤âƱÍͤÀ¤¬¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï +1 Ì¿Îá (singlestep) ¤À¤±¼Â¹Ô¤·¤¿»þÅÀ¤Ç¤âÄä»ß¤µ¤»¤ë¡£ +¤³¤Î¥³¡¼¥ë¤Ï User Mode Linux ¤Î¤è¤¦¤Ë»Ò¥×¥í¥»¥¹¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÁ´¤Æ +¥¨¥ß¥å¥ì¡¼¥È¤·¤è¤¦¤È¤¹¤ë¥×¥í¥°¥é¥à¤Ç»ÈÍѤµ¤ì¤ë¡£ +°ú¤­¿ô +.I data +¤Ï +.B PTRACE_CONT +¤Î¾ì¹ç¤ÈƱ¤¸Íͤ˲ò¼á¤µ¤ì¤ë¡£ +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£ +Á´¤Æ¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£) +.TP +.B PTRACE_KILL +»Ò¥×¥í¥»¥¹¤Ë +.B SIGKILL +¤òÁ÷¤ê½ªÎ»¤µ¤»¤ë¡£(\fIaddr\fP ¤È \fIdata\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.B PTRACE_ATTACH +.I pid +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤ËÀܳ (attach) ¤·¡¢¤½¤ì¤ò¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î +»Ò¥×¥í¥»¥¹¤È¤·¤Æ¥È¥ì¡¼¥¹¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£»Ò¥×¥í¥»¥¹¤Ï +.B PTRACE_TRACEME +¤·¤¿¤«¤Î¤è¤¦¤Ë¿¶Éñ¤¦¡£¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ï¤½¤Î¤Û¤È¤ó¤É¤ÎÌÜŪ¤Ë¤ª¤¤¤Æ¡¢ +¤½¤Î»Ò¥×¥í¥»¥¹¤Î¼ÂºÝ¤Î¿Æ¤Ë¤Ê¤ë (Î㤨¤Ð¡¢»Ò¥×¥í¥»¥¹¤Î¥¤¥Ù¥ó¥È¤Î +ÄÌÃΤò¼õ¤±¤È¤Ã¤¿¤ê¡¢ +.BR ps (1) +¤Ç¿Æ¤È¤·¤Æɽ¼¨¤µ¤ì¤¿¤ê¤¹¤ë)¡£¤·¤«¤·¡¢»Ò¥×¥í¥»¥¹¤Ç +.BR getppid (2) +¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Ë¤Ï¸µ¤Î¿Æ¥×¥í¥»¥¹¤Î PID ¤¬ÊÖ¤µ¤ì¤ë¡£ +»Ò¥×¥í¥»¥¹¤Ë¤Ï +.B SIGSTOP +¤¬Á÷¤é¤ì¤ë¤¬¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤¬´°Î»¤¹¤ë¤Þ¤Ç¤Ë +ɬ¤º¤·¤âÄä»ß¤¹¤ë¤È¤Ï¸Â¤é¤Ê¤¤¡£»Ò¥×¥í¥»¥¹¤ÎÄä»ß¤òÂÔ¤Ä¤Ë¤Ï +.BR wait (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£(\fIaddr\fP ¤È \fIdata\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.TP +.B PTRACE_DETACH +.B PTRACE_CONT +¤ÈƱÍͤËÄä»ß¤·¤¿»Ò¥×¥í¥»¥¹¤òºÆ³«¤¹¤ë¡£¤¿¤À¤· +¤Þ¤º¤½¤Î¥×¥í¥»¥¹¤«¤é¤ÎʬΥ (detach) ¤ò¹Ô¤¤¡¢ +.B PTRACE_ATTACH +¤Ç¤Î¿Æ¤ÎÀڤ괹¤¨¤Ë¤è¤ë¸ú²Ì¤È +.B PTRACE_TRACEME +¤Î¸ú²Ì¤ò¼è¤ê¾Ã¤¹¡£°Õ¿Þ¤·¤¿¤â¤Î¤Ç¤Ï¤Ê¤¤¤À¤í¤¦¤¬¡¢ +Linux ¤Ç¤Ï¡¢¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤ë»Ò¥×¥í¥»¥¹¤Ï¤É¤Î¤è¤¦¤ÊÊýË¡¤Ç¥È¥ì¡¼¥¹¤ò +³«»Ï¤µ¤ì¤¿¤È¤·¤Æ¤â¡¢¤³¤ÎÊýË¡¤ÇʬΥ (detach) ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +(\fIaddr\fP ¤Ï̵»ë¤µ¤ì¤ë¡£) +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.B PTRACE_PEEK* +¤Î¾ì¹ç¤ÏÍ׵ᤷ¤¿¥Ç¡¼¥¿¤òÊÖ¤·¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.B PTRACE_PEEK* +¤¬À®¸ù¤·¤ÆÊÖ¤¹Ãͤ⡡\-1 ¤Ë¤Ê¤ë¤³¤È¤¬¤¢¤ë¤¿¤á¡¢ +¤½¤Î¤è¤¦¤ÊÍ×µá¤Î¾ì¹ç¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï +.I errno +¤òÄ´¤Ù¡¢¥¨¥é¡¼¤«È¯À¸¤·¤¿¤Î¤«¤É¤¦¤«¤òȽÃǤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBUSY +(i386 ¤Î¤ß) ¥Ç¥Ð¥Ã¥°¥ì¥¸¥¹¥¿¤Î³ÎÊݤޤ¿¤Ï²òÊü¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EFAULT +¿Æ¥×¥í¥»¥¹¤Þ¤¿¤Ï»Ò¥×¥í¥»¥¹¤Î¥á¥â¥ê¤ÎÉÔÀµ¤ÊÎΰè¤ËÆɤ߽ñ¤­¤·¤è¤¦¤È¤·¤¿¡£ +¤ª¤½¤é¤¯¤½¤ÎÎΰ褬¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +¤½¤ÎÎΰè¤Ø¤Î¥¢¥¯¥»¥¹¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¤Ç¤¢¤ë¡£ +ÉÔ±¿¤Ê¤³¤È¤Ë¡¢Linux ¤Ç¤Ï¤³¤Î¤è¤¦¤Ê¥¨¥é¡¼¤Î¾ì¹ç¡¢Â¿¤«¤ì¾¯¤Ê¤«¤ì +×ó°ÕŪ¤Ë +.B EIO +¤òÊÖ¤·¤¿¤ê +.B EFAULT +¤òÊÖ¤·¤¿¤ê¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +.B EINVAL +ÉÔÀµ¤Ê¥ª¥×¥·¥ç¥ó¤òÀßÄꤷ¤è¤¦¤È¤·¤¿¡£ +.TP +.B EIO +\fIrequest\fP ¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +¤Þ¤¿¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Þ¤¿¤Ï»Ò¥×¥í¥»¥¹¤Î¥á¥â¥ê¤Î +ÉÔÀµ¤ÊÎΰè¤ËÆɤ߽ñ¤­¤·¤è¤¦¤È¤·¤¿¡£ +¤Þ¤¿¤Ï¡¢¥ï¡¼¥É¶­³¦°ãÈ¿¤¬¤¢¤Ã¤¿¡£ +¤Þ¤¿¤Ï¡¢¼Â¹ÔºÆ³«¤ÎÍ×µá¤ÇÉÔÀµ¤Ê¥·¥°¥Ê¥ë¤ò»ØÄꤷ¤¿¡£ +.TP +.B EPERM +»ØÄꤷ¤¿¥×¥í¥»¥¹¤ò¥È¥ì¡¼¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£¤³¤ì¤Ï¿Æ¥×¥í¥»¥¹¤¬ +ɬÍפʸ¢¸Â (ɬÍפʥ±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï +.BR CAP_SYS_PTRACE ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¤³¤È¤¬¸¶°ø¤Î¾ì¹ç¤¬¤¢¤ë¡£ +ʬ¤«¤ê¤ä¤¹¤¤Íýͳ¤òµó¤²¤ë¤Ê¤é¡¢ +ÈóÆø¢¥×¥í¥»¥¹¤Ï¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¥×¥í¥»¥¹¤ò¥È¥ì¡¼¥¹¤Ç¤­¤Ê¤¤¤·¡¢ +set-user-ID/set-group-ID ¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Ï¥È¥ì¡¼¥¹¤Ç¤­¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢¥×¥í¥»¥¹¤Ï¤¹¤Ç¤Ë¥È¥ì¡¼¥¹Ãæ¤Ç¤¢¤ë¡¢ +¤Þ¤¿¤Ï +.BR init (8) +¥×¥í¥»¥¹ (PID ¤¬ 1) ¤Ç¤¢¤ë¡£ +.TP +.B ESRCH +»ØÄꤷ¤¿¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢»ØÄꤷ¤¿¥×¥í¥»¥¹¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬ +¸½ºß¥È¥ì¡¼¥¹Ãæ¤Î»Ò¥×¥í¥»¥¹¤Ç¤Ï¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢»ØÄꤷ¤¿¥×¥í¥»¥¹¤¬Ää»ß¤·¤Æ¤¤¤Ê¤¤ (Ää»ß¤·¤Æ¤¤¤ë¤³¤È¤¬É¬ÍפÊÍ×µá¤Î¾ì¹ç)¡£ +.SH ½àµò +SVr4, 4.3BSD. +.SH Ãí°Õ +.BR ptrace () +¤Î°ú¤­¿ô¤Ï¾å¤Î¤è¤¦¤Ê¥×¥í¥È¥¿¥¤¥×¤Ë´ð¤Å¤¤¤Æ²ò¼á¤µ¤ì¤ë¤¬¡¢ +glibc ¤Ç¤Ï¡¢¸½ºß¤Î¤È¤³¤í +.BR ptrace () +¤Ï \fIrequest\fP °ú¤­¿ô¤À¤±¤¬¸ÇÄê¤Î²ÄÊÑĹ°ú¤­¿ô´Ø¿ô¤È¤·¤Æ +Àë¸À¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤ÏɬÍפʤ±¤ì¤Ð»Ä¤ê¤Î°ú¤­¿ô¤Ï¾Êά²Äǽ¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¤¬¡¢ +¤½¤ì¤Ï +.BR gcc (1) +¤ÎÌÀʸ²½¤µ¤ì¤Æ¤¤¤Ê¤¤Æ°ºî¤òÍøÍѤ·¤Æ¤¤¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.LP +.BR init (8) +¤¹¤Ê¤ï¤Á PID ¤¬ 1 ¤Î¥×¥í¥»¥¹¤Ï¥È¥ì¡¼¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.LP +¥á¥â¥ê¤ä USER Îΰè¤ÎÆâÍƤäÇÛÃÖ¤Ï OS ¤´¤È¡¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤´¤È¤Ë +Èó¾ï¤Ë°Í¸¤¹¤ë¡£ +¥ª¥Õ¥»¥Ã¥È¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ÊÖ¤µ¤ì¤ë¥Ç¡¼¥¿¤Ï +.I "struct user" +¤ÎÄêµÁ¤È´°Á´¤Ë°ìÃפ·¤Ê¤¤¤³¤È¤â¤¢¤ê¤¨¤ë¡£ +.\" http://lkml.org/lkml/2008/5/8/375 »²¾È¡£ +.LP +¡Ö¥ï¡¼¥É (word) ¡×¤ÎÂ礭¤µ¤Ï OS ¤Ë¤è¤Ã¤Æ·è¤Þ¤ë¡£ +(Î㤨¤Ð¡¢32 ¥Ó¥Ã¥È¤Î Linux ¤Ç¤Ï 32 ¥Ó¥Ã¥È¤Ç¤¢¤ë¡¢¤Ê¤É¡£) +.LP +¥È¥ì¡¼¥¹¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥È¥ì¡¼¥¹¤µ¤ì¤ë¥×¥í¥»¥¹¤ÎÆ°ºî¤Ëº³ºÙ¤Ê°ã¤¤¤¬ +µ¯¤³¤ë¤³¤È¤¬¤¢¤ë¡£Î㤨¤Ð¡¢¥×¥í¥»¥¹¤¬ +.B PTRACE_ATTACH +¤Ë¤è¤Ã¤ÆÀܳ¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬Ää»ß¤·¤¿»þ¤Ç¤âËÜÍè¤Î¿Æ¤Ï +.BR wait (2) +¤ò»È¤Ã¤ÆÄÌÃΤò¼õ¤±¤ë¤³¤È¤¬¤Ç¤­¤º¡¢¿·¤·¤¤¿Æ¤¬¸úΨ¤è¤¯ +¤³¤ÎÄÌÃΤò¿¿»÷¤ëÊýË¡¤â¤Ê¤¤¡£ +.LP +¿Æ¥×¥í¥»¥¹¤¬ +.B PTRACE_EVENT_* +¤¬¥»¥Ã¥È¤µ¤ì¤¿¥¤¥Ù¥ó¥È¤ò¼õ¿®¤·¤¿¾ì¹ç¡¢ +»Ò¥×¥í¥»¥¹¤ÏÄ̾ïÄ̤ê¤Î¥·¥°¥Ê¥ëÇÛÁ÷¤¬¹Ô¤ï¤ì¤ë¾õÂ֤ˤʤ¤¡£ +¤Ä¤Þ¤ê¡¢¿Æ¥×¥í¥»¥¹¤¬¡¢ +¥·¥°¥Ê¥ë¤Ë¤è¤ê +.BR ptrace (PTRACE_CONT) +¤ò¹Ô¤Ã¤¿¤ê¡¢ +.BR ptrace (PTRACE_KILL) +¤ò¹Ô¤Ã¤¿¤ê¤Ç¤­¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +¤³¤é¤é¤Î¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®¸å¤Ï¡¢»Ò¥×¥í¥»¥¹¤ò½ªÎ» (kill) ¤¹¤ë¤Î¤Ë¡¢ +¥·¥°¥Ê¥ë +.B SIGKILL +¤ò»ØÄꤷ¤Æ +.BR kill (2) +¤ò¹Ô¤¦ÊýË¡¤òÂå¤ï¤ê¤Ë»ÈÍѤǤ­¤ë¡£ +.LP +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï¸½ºß¤Î Linux ¤Ë¤ª¤±¤ë +.BR ptrace () +¥³¡¼¥ë¤ÎÆ°ºî¤Ë¤Ä¤¤¤Æµ­½Ò¤·¤Æ¤¤¤ë¡£Â¾¤Î Unix ¤Ç¤Ï +¤½¤ÎÆ°ºî¤ÏÃø¤·¤¯°Û¤Ê¤ë¡£ +¤¤¤«¤Ê¤ë¾ì¹ç¤â +.BR ptrace () +¤ò»È¤¦¤È OS ¤ä¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ËÈó¾ï¤Ë°Í¸¤·¤¿¤â¤Î¤Ë¤Ê¤ë¡£ +.LP +SunOS ¤Î¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸¤Ë¤Ï +.BR ptrace () +¤Ï¡ÖÆÈÆäÇÉԲIJò¡×¤Èµ­½Ò¤µ¤ì¤Æ¤ª¤ê¡¢¤Þ¤µ¤·¤¯¤½¤¦¤Ç¤¢¤ë¡£ +Solaris 2 ¤Ç¤Ï proc ¥Ù¡¼¥¹¤Î +¥Ç¥Ð¥Ã¥°¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤È¤·¤Æ +.BR ptrace () +¤Î¾å°Ì¸ß´¹´Ø¿ô¤¬¼ÂÁõ¤µ¤ì¡¢¤è¤ê¶¯ÎϤǰì´ÓÀ­¤Î¤¢¤ë¤â¤Î¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +¥«¡¼¥Í¥ë 2.6 ¤Î¥Ø¥Ã¥À¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥Û¥¹¥È¤Ç¤Ï¡¢ +.B PTRACE_SETOPTIONS +¤Ï¥«¡¼¥Í¥ë 2.4 ¤Î¥Ø¥Ã¥À¤È¤Ï°Û¤Ê¤ëÃͤÇÀë¸À¤µ¤ì¤ë¡£ +¤³¤Î¤¿¤á¡¢¥«¡¼¥Í¥ë 2.6 ¤Î¥Ø¥Ã¥À¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï +¥«¡¼¥Í¥ë 2.4 ¤Ç¤ÏÀµ¤·¤¯Æ°ºî¤·¤Ê¤¤¡£ +¤³¤ÎÌäÂê¤Ï¡¢ +.B PTRACE_SETOPTIONS +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤¿ºÝ¤Ï¡¢ +.B PTRACE_SETOPTIONS +¤ò +.B PTRACE_OLDSETOPTIONS +¤ËÄêµÁ¤·Ä¾¤¹¤³¤È¤ÇÂнè¤Ç¤­¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR gdb (1), +.BR strace (1), +.BR execve (2), +.BR fork (2), +.BR signal (2), +.BR wait (2), +.BR exec (3), +.BR capabilities (7) diff --git a/release/man2/query_module.2 b/release/man2/query_module.2 new file mode 100644 index 00000000..fc535986 --- /dev/null +++ b/release/man2/query_module.2 @@ -0,0 +1,180 @@ +.\" Copyright (C) 1996 Free Software Foundation, Inc. +.\" This file is distributed according to the GNU General Public License. +.\" See the file COPYING in the top level source directory for details. +.\" +.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some +.\" reformatting and rewordings by mtk +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-29, Akihiro MOTOKI +.\" +.TH QUERY_MODULE 2 2007-06-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +query_module \- ¥â¥¸¥å¡¼¥ë¤Ë´ØÏ¢¤¹¤ë³Æ¼ï¤Î¾ðÊó¤ò¥«¡¼¥Í¥ë¤ËÌ䤤¹ç¤ï¤»¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int query_module(const char *" name ", int " which ", void *" buf , +.BI " size_t " bufsize ", size_t *" ret ); +.fi +.SH ÀâÌÀ +.BR query_module () +¤Ï¡¢¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤ò¥«¡¼¥Í¥ë¤ËÌ䤤¹ç¤ï¤»¤ë¡£ +¾ðÊó¤Ï +.I buf +¤¬»Ø¤·¼¨¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï +.I buf +¤Î¥µ¥¤¥º¤ò +.I bufsize +¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ÆÀ¤é¤ì¤ë¾ðÊó¤ÎÀµ³Î¤Ê°ÕÌ£¤È¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢ +.I which +¤Ç¤É¤ÎÁàºî¤ò»ØÄꤹ¤ë¤«¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +¸½ºß¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥â¥¸¥å¡¼¥ë¤òÆÃÄꤹ¤ë¤¿¤á¤Ë +.I name +¤òɬÍפȤ¹¤ëÁàºî¤¬¤¢¤ì¤Ð¡¢ +¥«¡¼¥Í¥ë¸ÇÍ­¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹ NULL ¤ò»ØÄê¤Ç¤­¤ëÁàºî¤â¤¢¤ë¡£ + +.I which +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.TP +.B 0 +¥«¡¼¥Í¥ë¤¬ +.BR query_module () +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç¡¢À®¸ù¤òÊÖ¤¹¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÍøÍѲÄǽ¤«¤òÄ´¤Ù¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.TP +.B QM_MODULES +¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥â¥¸¥å¡¼¥ë¤Î̾Á°¤òÊÖ¤¹¡£ +¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎ󤬽ç¤ËÆþ¤ë¡£ +ÊÖ¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡ +.I ret +¤Ë¤Ï¥â¥¸¥å¡¼¥ë¤Î¿ô¤¬ÀßÄꤵ¤ì¤ë¡£ +.\" ret is set on ENOSPC +.TP +.B QM_DEPS +»ØÄꤵ¤ì¤¿¥â¥¸¥å¡¼¥ë¤¬»ÈÍѤ·¤Æ¤¤¤ëÁ´¥â¥¸¥å¡¼¥ë¤Î̾Á°¤òÊÖ¤¹¡£ +¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎ󤬽ç¤ËÆþ¤ë¡£ +ÊÖ¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡ +.I ret +¤Ë¤Ï¥â¥¸¥å¡¼¥ë¤Î¿ô¤¬ÀßÄꤵ¤ì¤ë¡£ +.\" ret is set on ENOSPC +.TP +.B QM_REFS +»ØÄꤵ¤ì¤¿¥â¥¸¥å¡¼¥ë¤ò»ÈÍѤ·¤Æ¤¤¤ëÁ´¥â¥¸¥å¡¼¥ë¤Î̾Á°¤òÊÖ¤¹¡£ +¤³¤ì¤Ï +.B QM_DEPS +¤ÈµÕ¤Îµ¡Ç½¤Ç¤¢¤ë¡£ +¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎ󤬽ç¤ËÆþ¤ë¡£ +ÊÖ¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡ +.I ret +¤Ë¤Ï¥â¥¸¥å¡¼¥ë¤Î¿ô¤¬ÀßÄꤵ¤ì¤ë¡£ +.\" ret is set on ENOSPC +.TP +.B QM_SYMBOLS +¥«¡¼¥Í¥ë¤Þ¤¿¤Ï»ØÄꤵ¤ì¤¿¥â¥¸¥å¡¼¥ë¤¬¥¨¥¯¥¹¥Ý¡¼¥È¤·¤Æ¤¤¤ë¥·¥ó¥Ü¥ë¤È +ÃͤòÊÖ¤¹¡£ +¥Ð¥Ã¥Õ¥¡¤Î¥Ç¡¼¥¿¤Ï¡¢ +°Ê²¼¤Î¹½Â¤ÂΤÎÇÛÎó¤Ë NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤¬Â³¤¯·Á¤È¤Ê¤ë¡£ +.\" ret is set on ENOSPC +.in +4n +.nf + +struct module_symbol { + unsigned long value; + unsigned long name; +}; +.fi +.in +.IP +.I name +¤ÎÃͤϡ¢ +.I buf +¤ÎÀèƬ¤«¤é¤Îʸ»úÎó¤Þ¤Ç¤Î¥ª¥Õ¥»¥Ã¥Èʸ»ú¿ô¤Ç¤¢¤ë¡£ +.I ret +¤Ë¤Ï¥·¥ó¥Ü¥ë¤Î¿ô¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +.B QM_INFO +»ØÄꤵ¤ì¤¿¥â¥¸¥å¡¼¥ë¤Ë´Ø¤¹¤ëÍÍ¡¹¤Ê¾ðÊó¤òÊÖ¤¹¡£ +½ÐÎϥХåե¡¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï°Ê²¼¤Î·Á¼°¤È¤Ê¤ë: +.in +4n +.nf + +struct module_info { + unsigned long address; + unsigned long size; + unsigned long flags; +}; +.fi +.in +.IP +.I address +¤Ï¤½¤Î¥â¥¸¥å¡¼¥ë¤¬ÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¥«¡¼¥Í¥ë¶õ´Ö¾å¤Î¥¢¥É¥ì¥¹¡¢ +.I size +¤Ï¤½¤Î¥â¥¸¥å¡¼¥ë¤Î¥Ð¥¤¥Èñ°Ì¤Î¥µ¥¤¥º¡¢ +.I flags +¤Ï +.BR MOD_RUNNING , +.B MOD_AUTOCLEAN +Åù¤Î¥Þ¥¹¥¯¤Ç¤¢¤ê¡¢¤½¤Î¥â¥¸¥å¡¼¥ë¤Î¸½ºß¤Î¾õÂÖ¤ò¼¨¤¹ +(¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë +.I include/linux/module.h +¤ò»²¾È)¡£ +.I ret +¤Ë¤Ï +.I module_info +¹½Â¤ÂΤΥµ¥¤¥º¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤Î¾ì¹ç 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.IR name , +.IR buf , +.I ret +¤Î¾¯¤Ê¤¯¤È¤â°ì¤Ä¤¬¡¢¥×¥í¥°¥é¥à¤¬¥¢¥¯¥»¥¹¤Ç¤­¤ë +¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤Ç¤¢¤Ã¤¿¡£ +.TP +.B EINVAL +.I which +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£¤¢¤ë¤¤¤Ï +.I name +¤¬ NULL ¤À¤¬ (NULL ¤Ï "¥«¡¼¥Í¥ë" ¤ò¼¨¤¹)¡¢ +.I which +¤Ç»ØÄꤵ¤ì¤¿ÃͤȤÎÁȤ߹ç¤ï¤»¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" Not permitted with QM_DEPS, QM_REFS, or QM_INFO. +.TP +.B ENOENT +.I name +¤È¤¤¤¦Ì¾Á°¤Î¥â¥¸¥å¡¼¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOSPC +Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤¬¾®¤µ¤¹¤®¤ë¡£ +.I ret +¤Ë¤ÏºÇ¾®¸ÂɬÍפʥХåե¡¤Î¥µ¥¤¥º¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +.B ENOSYS +.BR query_module () +¤Ï¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +.BR query_module () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¤Î¤Ï¥«¡¼¥Í¥ë 2.4 ¤Þ¤Ç¤Î Linux ¤À¤±¤Ç¤¢¤ë¡£ +Linux 2.6 ¤Ç¤Ïºï½ü¤µ¤ì¤¿¡£ +.\" Removed in Linux 2.5.48 +.BR query_module () +¤ÇÆÀ¤é¤ì¤¿¾ðÊó¤Î¤¤¤¯¤Ä¤«¤Ï¡¢ +.IR /proc/modules , +.IR /proc/kallsyms , +.I /sys/modules +¤«¤é¼èÆÀ¤Ç¤­¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR create_module (2), +.BR delete_module (2), +.BR get_kernel_syms (2), +.BR init_module (2) diff --git a/release/man2/quotactl.2 b/release/man2/quotactl.2 new file mode 100644 index 00000000..4ea6b3ff --- /dev/null +++ b/release/man2/quotactl.2 @@ -0,0 +1,243 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1996 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. +.\" +.\" FIXME There is much that is missing and/or out of date in this page. +.\" (There is a quotactl.2 page in the quotactl package that seems to +.\" have more info than this page.) +.\" As things stand the page more or less documents Linux 2.2 reality: +.\" +.\" Linux 2.2 has: +.\" +.\" Q_GETQUOTA +.\" Q_GETSTATS +.\" Q_QUOTAOFF +.\" Q_QUOTAON +.\" Q_RSQUASH (not currently documented) +.\" Q_SETQLIM +.\" Q_SETQUOTA +.\" Q_SETUSE +.\" Q_SYNC +.\" +.\" Linux 2.4 has: +.\" +.\" Q_COMP_QUOTAOFF +.\" Q_COMP_QUOTAON +.\" Q_COMP_SYNC +.\" Q_GETFMT +.\" Q_GETINFO +.\" Q_GETQUOTA +.\" Q_QUOTAOFF +.\" Q_QUOTAON +.\" Q_SETINFO +.\" Q_SETQUOTA +.\" Q_SYNC +.\" Q_V1_GETQUOTA Q_V1_GETSTATS Q_V1_RSQUASH Q_V1_SETQLIM +.\" Q_V1_SETQUOTA Q_V1_SETUSE +.\" Q_V2_GETINFO Q_V2_GETQUOTA Q_V2_SETFLAGS Q_V2_SETGRACE +.\" Q_V2_SETINFO Q_V2_SETQUOTA Q_V2_SETUSE +.\" Q_XGETQSTAT Q_XGETQUOTA Q_XQUOTAOFF Q_XQUOTAON Q_XQUOTARM +.\" Q_XSETQLIM +.\" +.\" Linux 2.6.16 has: +.\" +.\" Q_GETFMT +.\" Q_GETINFO +.\" Q_GETQUOTA +.\" Q_QUOTAOFF +.\" Q_QUOTAON +.\" Q_SETINFO +.\" Q_SETQUOTA +.\" Q_SYNC +.\" Q_XGETQSTAT +.\" Q_XGETQUOTA +.\" Q_XQUOTAOFF +.\" Q_XQUOTAON +.\" Q_XQUOTARM +.\" Q_XQUOTASYNC +.\" Q_XSETQLIM +.\" +.\" Japanese Version Copyright (c) 1997 Kazuyoshi Furutaka +.\" all rights reserved. +.\" Translated Sun Dec 21 21:58:06 JST 1997 +.\" by Kazuyoshi Furutaka +.\" Modified Wed Dec 24 22:17:00 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Thu Feb 24 02:50:48 JST 2005 +.\" by Yuichi SATO +.\" +.TH QUOTACTL 2 2007-06-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +quotactl \- ¥Ç¥£¥¹¥¯ quota ¤òÁàºî¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "int quotactl(int " cmd ", const char *" special ", int " id \ +", caddr_t " addr ); +.fi +.SH ÀâÌÀ +quota ¥·¥¹¥Æ¥à¤Ï¡¢³Æ¡¹¤Î¥æ¡¼¥¶µÚ¤Ó/¤Þ¤¿¤Ï¥°¥ë¡¼¥×¤ËÂФ·¤Æ¡¢ +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥ÈµÚ¤Ó¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤òÄê¤á¤ë¡£¤³¤ì¤Ï¤¢¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç +»ÈÍѤ¹¤ë»ö¤¬½ÐÍè¤ë¥Ç¥£¥¹¥¯ÍÆÎ̤òÀ©¸Â¤¹¤ë¡£ +¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ÏĶ²á¤¹¤ë¤³¤È¤Ï½ÐÍè¤Ê¤¤¡£ +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤ÏĶ²á¤¹¤ë»ö¤¬½ÐÍè¤ë¤¬¡¢·Ù¹ð¤¬È¯¤»¤é¤ì¤ë¡£ +¹¹¤Ë¡¢(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï) °ì½µ´Ö°Ê¾å¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤òĶ²á¤·¤¿¤Þ¤Þ¤Ë +¤·¤Æ¤ª¤¯»ö¤Ï¤Ç¤­¤Ê¤¤: °ì½µ´Ö·Ð²á¤·¤¿¸å¤Ï¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤òĶ²á¤·¤¿¤È +¤ß¤Ê¤µ¤ì¤ë¡£ + +.BR quotactl () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤³¤ì¤é¤Î quota ¤ËÂФ¹¤ëÁàºî¤ò¹Ô¤Ê¤¦¡£ +ºÇ½é¤Î°ú¤­¿ô¤Ï +.BI QCMD( subcmd , type ) +¤È¤¤¤¦·Á¼°¤Ç¤¢¤ë¡£ +.I type +¤Ë¤Ï¡¢¥æ¡¼¥¶¡¼ quota ¤Ë¤Ä¤¤¤Æ¤Ï +.B USRQUOTA +¤ò¡¢¥°¥ë¡¼¥× quota ¤Ë¤Ä¤¤¤Æ¤Ï +.B GRPQUOTA +¤ò»ØÄꤹ¤ë¡£ +.I subcmd +¤Ï°Ê²¼¤ÇÀâÌÀ¤¹¤ë¡£ + +ÆóÈÖÌܤΰú¤­¿ô +.I special +¤Ï quota ¤òŬÍѤ¹¤ë¥Ç¥Ð¥¤¥¹¤Î¥Ö¥í¥Ã¥¯¡¦¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +¤½¤Î¥Ç¥Ð¥¤¥¹¤Ï¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +»°ÈÖÌܤΰú¤­¿ô +.I id +¤Ë¤Ï¡¢(ɬÍפʾì¹ç¤Ë) quota ¤òŬÍѤ¹¤ë¥æ¡¼¥¶¡¼¤â¤·¤¯¤Ï¥°¥ë¡¼¥×¤Î ID ¤ò»ØÄꤹ¤ë¡£ + +»ÍÈÖÌܤΰú¤­¿ô +.I addr +¤Ë¤Ï¡¢¥³¥Þ¥ó¥É¤´¤È¤Ë°Û¤Ã¤¿¥Ç¡¼¥¿¹½Â¤ÂΤΥ¢¥É¥ì¥¹¤ò»ØÄꤹ¤ë¡£ + +.I subcmd +¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë +.TP 1.1i +.B Q_QUOTAON +quota ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.I addr +°ú¤­¿ô¤Ë¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î quota ¤¬µ­Ï¿¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Î +¥Ñ¥¹Ì¾¤ò»ØÄꤹ¤ë¡£ +.TP +.B Q_QUOTAOFF +quota ¤ò̵¸ú¤Ë¤¹¤ë¡£ +.TP +.B Q_GETQUOTA +¥Ç¥£¥¹¥¯»ÈÍÑÎ̤ÎÀ©¸ÂÃͤȸ½ºß¤Î»ÈÍÑÎ̤òÆÀ¤ë¡£ +.I addr +°ú¤­¿ô¤Ï +.RI ( +¤ÇÄêµÁ¤µ¤ì¤¿) dqblk ¹½Â¤ÂΤò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.TP +.B Q_SETQUOTA +À©¸ÂÃͤȸ½ºß¤Î»ÈÍÑÎ̤òÀßÄꤹ¤ë: +.I addr +¤ÏƱ¾å¡£ +.TP +.B Q_SETQLIM +À©¸ÂÃͤòÀßÄꤹ¤ë; +.I addr +¤ÏƱ¾å¡£ +.TP +.B Q_SETUSE +»ÈÍÑÎ̤òÀßÄꤹ¤ë¡£ +.TP +.B Q_SYNC +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î quota ¥Õ¥¡¥¤¥ë¤ò¥Ç¥£¥¹¥¯¤ÈƱ´ü¤µ¤»¤ë¡£ +.TP +.B Q_GETSTATS +¼ý½¸¤µ¤ì¤¿Åý·×¤ò¼èÆÀ¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR quotactl () +¤Ï¡¢À®¸ù»þ¤Ë¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼»þ¤Ï¡¢\-1 ¤òÊÖ¤¹¤È¤È¤â¤Ë¡¢ +.I errno +¤¬Å¬ÀÚ¤ÊÃͤËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP 0.9i +.B EACCES +quota ¥Õ¥¡¥¤¥ë¤¬ÉáÄ̤Υե¡¥¤¥ë¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EBUSY +.B Q_QUOTAON +¤ÎÍ׵᤬¤Ê¤µ¤ì¤¿¤¬¡¢quota(s) ¤Ï´û¤ËÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.TP +.B EFAULT +.I addr +¤ÎÃͤ˸í¤ê¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.I type +¤¬´ûÃΤΠquota ¤Î·Á¼°¤Ç¤Ï¤Ê¤¤¡£¤â¤·¤¯¤Ï¡¢ +.I special +¥Ç¥Ð¥¤¥¹¤¬¸«ÉÕ¤«¤é¤Ê¤«¤Ã¤¿¡£ +.TP +.B EIO +quota ¥Õ¥¡¥¤¥ë¤Ø¤ÎÆɤ߽ñ¤­¤¬½ÐÍè¤Ê¤¤¡£ +.TP +.B EMFILE +¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤¹¤®¤Æ¤¤¤ë: quota ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó½ÐÍè¤Ê¤¤¡£ +.TP +.B ENODEV +.I special +¤¬¥Þ¥¦¥ó¥È¡¦¥Æ¡¼¥Ö¥ëÆâ¤Ë¸«Åö¤¿¤é¤Ê¤¤¡£ +.TP +.B ENOPKG +quota ¤ò»ÈÍѲĤˤ·¤Æ¥«¡¼¥Í¥ë¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTBLK +.I special +¤¬¥Ö¥í¥Ã¥¯¡¦¥¹¥Ú¥·¥ã¥ë¡¦¥Ç¥Ð¥¤¥¹¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EPERM +¥×¥í¥»¥¹¤¬ (¤½¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î) root ¤Î¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¤«¤Ä¥×¥í¥»¥¹¼«¿È¤Î¤â¤Î¤È¤Ï°Û¤Ê¤ë +.I id +¤ËÂФ·¤Æ +.B Q_GETQUOTA +Í×µá¤ò¹Ô¤Ê¤Ã¤¿¡£ +¤â¤·¤¯¤Ï¡¢ +.BR Q_GETSTATS , +.B Q_SYNC +°Ê³°¤ÎÍ׵᤬¤Ê¤µ¤ì¤¿¡£ +.TP +.B ESRCH +quota ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ËÂФ·¤Æ +.BR Q_GETQUOTA , +.BR Q_SETQUOTA , +.BR Q_SETUSE , +.B Q_SETQLIM +¤Î¤¤¤º¤ì¤«¤ÎÍ׵᤬¤Ê¤µ¤ì¤¿¡£ +.SH ½àµò +BSD. +.SH ´ØÏ¢¹àÌÜ +.BR quota (1), +.BR getrlimit (2), +.BR setrlimit (2), +.BR ulimit (3), +.BR quotacheck (8), +.BR quotaon (8) diff --git a/release/man2/read.2 b/release/man2/read.2 new file mode 100644 index 00000000..f364b2be --- /dev/null +++ b/release/man2/read.2 @@ -0,0 +1,209 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 Sat Jul 24 00:06:00 1993 by Rik Faith +.\" Modified Wed Jan 17 16:02:32 1996 by Michael Haardt +.\" +.\" Modified Thu Apr 11 19:26:35 1996 by Andries Brouwer +.\" Modified Sun Jul 21 18:59:33 1996 by Andries Brouwer +.\" Modified Fri Jan 31 16:47:33 1997 by Eric S. Raymond +.\" Modified Sat Jul 12 20:45:39 1997 by Michael Haardt +.\" +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Modified 1997-09-28, HANATAKA Shinya +.\" Updated & Modified 2005-02-24, Yuichi SATO +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2005-10-14, Akihiro MOTOKI +.\" Updated 2008-02-10, Akihiro MOTOKI, LDP v2.77 +.\" Updated 2009-04-13, Akihiro MOTOKI, LDP v3.20 +.\" +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡¡¼ +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: process group ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× +.\"WORD: backgraound ¥Ð¥Ã¥¯¥°¥é¥ó¥É +.\"WORD: orphan ¸ÉΩ +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: object ¥ª¥Ö¥¸¥§¥¯¥È +.\" +.TH READ 2 2009-02-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +read \- ¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤«¤éÆɤ߹þ¤à +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "ssize_t read(int " fd ", void *" buf ", size_t " count ); +.fi +.SH ÀâÌÀ +.BR read () +¤Ï¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ (file descriptor) +.I fd +¤«¤éºÇÂç +.I count +¥Ð¥¤¥È¤ò +.I buf +¤Ç»Ï¤Þ¤ë¥Ð¥Ã¥Õ¥¡¡¼¤ØÆɤ߹þ¤â¤¦¤È¤¹¤ë¡£ +.PP +.I count +¤¬ 0 ¤Ê¤é¤Ð¡¢ +.BR read () +¤Ï 0 ¤òÊÖ¤·¡¢Â¾¤Ë²¿¤âµ¯¤­¤Ê¤¤¡£ +.I count +¤¬ +.B SSIZE_MAX +¤è¤êÂ礭¤±¤ì¤Ð¡¢·ë²Ì¤ÏÆÃÄê¤Ç¤­¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢Æɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÊÖ¤¹ (0 ¤Ï¥Õ¥¡¥¤¥ë¤Î½ª¤ê¤ò°ÕÌ£¤¹¤ë)¡£ +¥Õ¥¡¥¤¥ë°ÌÃ֤Ϥ³¤Î¿ô¤À¤±¿Ê¤á¤é¤ì¤ë¡£ +¤³¤Î¿ô¤¬Í׵ᤷ¤¿¿ô¤è¤ê¾®¤µ¤«¤Ã¤¿¤È¤·¤Æ¤â¥¨¥é¡¼¤Ç¤Ï¤Ê¤¤; +Î㤨¤Ðº£¤¹¤°¤Ë¤Ï¼ÂºÝ¤Ë¤½¤ì¤À¤±¤Î¿ô¤·¤«¤Ê¤¤¾ì¹ç (¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë¶á¤¤¤Î¤«¤â +¤·¤ì¤Ê¤¤¤·¡¢¥Ñ¥¤¥× (pipe) ¤äüËö (terminal) ¤«¤éÆɤ߹þ¤ó¤Ç¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤) ¤ä +.BR read () +¤¬¥·¥°¥Ê¥ë (signal) ¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¤Ë¤³¤ì¤Ïµ¯¤³¤ê¤¨¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£¤³¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë°ÌÃÖ¤¬Êѹ¹¤µ¤ì¤ë¤«¤É¤¦¤«¤Ï +ÉÔÄê¤Ç¤¢¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.I fd +¤¬¥½¥±¥Ã¥È°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤Æ¡¢ +ÈóÄä»ß (nonblocking) ¥â¡¼¥É +.RB ( O_NONBLOCK ) +¤ËÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢Æɤ߹þ¤ß¤ò¹Ô¤¦¤ÈÄä»ß¤¹¤ë¾õ¶·¤Ë¤¢¤ë¡£ +.TP +.BR EAGAIN " ¤Þ¤¿¤Ï " EWOULDBLOCK +.\" Actually EAGAIN on Linux +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.I fd +¤¬¥½¥±¥Ã¥È¤ò»²¾È¤·¤Æ¤¤¤Æ¡¢ÈóÄä»ß (nonblocking) ¥â¡¼¥É +.RB ( O_NONBLOCK ) +¤ËÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢Æɤ߹þ¤ß¤ò¹Ô¤¦¤ÈÄä»ß¤¹¤ë¾õ¶·¤Ë¤¢¤ë¡£ +POSIX.1-2001 ¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¤É¤Á¤é¤Î¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤âǧ¤á¤Æ¤ª¤ê¡¢ +¤³¤ì¤é 2 ¤Ä¤ÎÄê¿ô¤¬Æ±¤¸Ãͤò»ý¤Ä¤³¤È¤âµá¤á¤Æ¤¤¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢Î¾Êý¤Î²ÄǽÀ­¤ò +³Îǧ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ê¤¤¤«¡¢Æɤ߹þ¤ß¤Î¤¿¤á¤Ë +¥ª¡¼¥×¥ó (open) ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +.I buf +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Ë¤¢¤ë¡£ +.TP +.B EINTR +²¿¤Î¥Ç¡¼¥¿¤âÆɤ߹þ¤Þ¤Ê¤¤¤¦¤Á¤Ë¥·¥°¥Ê¥ë¤Ë³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.I fd +¤ÏÆɤ߹þ¤ß¤ËŬ¤·¤Æ¤¤¤Ê¤¤¥ª¥Ö¥¸¥§¥¯¥È¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +¤â¤·¤¯¤Ï¡¢¥Õ¥¡¥¤¥ë¤¬ +.B O_DIRECT +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +.I buf +¤Ë»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¡¢ +.I count +¤Ë»ØÄꤵ¤ì¤¿ÃÍ¡¢ +¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Î¤¤¤º¤ì¤«¤Î +¥¢¥é¥¤¥ó¥á¥ó¥È¤¬ÉÔŬÀڤǤ¢¤ë¡£ +.TP +.B EINVAL +.I fd +¤¬ +.BR timerfd_create (2) +¤Î¸Æ¤Ó½Ð¤·¤ÇºîÀ®¤µ¤ì¤¿¤¬¡¢ +.BR read () +¤Ë´Ö°ã¤Ã¤¿¥µ¥¤¥º¤Î¥Ð¥Ã¥Õ¥¡¤¬ÅϤµ¤ì¤¿¡£ +¤µ¤é¤Ê¤ë¾ðÊó¤Ï +.BR timerfd_create (2) +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B EIO +I/O ¥¨¥é¡¼¡£¤³¤ì¤ÏÎ㤨¤Ð¥×¥í¥»¥¹¤¬¥Ð¥Ã¥¯¥°¥é¥ó¥É¡¦¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Ç¡¢ +¤½¤ì¤òÀ©¸æ¤·¤Æ¤¤¤ë tty ¤«¤éÆɤ߹þ¤â¤¦¤È¤·¡¢ +.B SIGTTIN +¤¬Ìµ»ë (ignore) ¤Þ¤¿¤Ï¶Ø»ß (blocking) ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤ä¡¢ +¤½¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤¬¸ÉΩ (orphan) ¤·¤Æ¤¤¤ë¾ì¹ç¤Ëµ¯¤³¤ë¡£ +¤Þ¤¿¥Ç¥£¥¹¥¯¤ä¥Æ¡¼¥×¤òÆɤó¤Ç¤¤¤ë»þ¤ËÄã¥ì¥Ù¥ë I/O ¥¨¥é¡¼ +¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤âµ¯¤³¤ë¡£ +.TP +.B EISDIR +.I fd +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.PP +.I fd +¤¬Àܳ¤·¤Æ¤¤¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤è¤Ã¤Æ¤Ï¾¤Î¥¨¥é¡¼¤âµ¯¤³¤ê¤¨¤ë¡£ +POSIX ¤Ç¤Ï¡¢ +¤¤¤¯¤é¤«¤Î¥Ç¡¼¥¿¤òÆɤó¤À¸å¤Ë³ä¤ê¹þ¤ß¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.BR read () +¤Ï +.RI ( errno +¤Ë +.B EINTR +¤òÀßÄꤷ¤Æ) \-1 ¤òÊÖ¤·¤Æ¤â¤è¤¤¤·¡¢ +´û¤ËÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÊÖ¤·¤Æ¤â¤è¤¤¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +NFS ¤Ë¤ª¤¤¤Æ¡£¾¯Î̤Υǡ¼¥¿¤òÆɤ߹þ¤à¾ì¹ç¡¢ºÇ½é¤Î»þ¤Î¤ß¤Ë¥¿¥¤¥à +¥¹¥¿¥ó¥×¤¬¹¹¿·¤µ¤ì¡¢Â³¤¯¥³¡¼¥ë¤Ç¤Ï¹¹¿·¤µ¤ì¤Ê¤¤¤À¤í¤¦¡£ +¤³¤ì¤Ï¥¯¥é¥¤¥¢¥ó¥È¦¤Ç°À­¤Î¥­¥ã¥Ã¥·¥ó¥°¤ò¹Ô¤Ê¤¦¤¿¤á¤Ç¤¢¤ë¡£ +¤Ê¤¼¤Ê¤é¤Ð¡¢¤â¤·Á´¤Æ¤Î NFS ¥¯¥é¥¤¥¢¥ó¥È¤¬ st_atime (ºÇ½ª¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹»þ¹ï) +¤Î¹¹¿·¤ò¥µ¡¼¥Ð¡¼¤ËÁ÷¤é¤º¡¢¥¯¥é¥¤¥¢¥ó¥È¦¤Ç¥­¥ã¥Ã¥·¥å¤òÆɤळ¤È¤ËËþ­¤·¤Æ +¤¤¤ì¤Ð¡¢¥µ¡¼¥Ð¡¼Â¦¤Ç¤Î read ¤ÏȯÀ¸¤·¤Ê¤¤¤Î¤Ç st_atime ¤Î¹¹¿·¤Ï¹Ô¤Ê¤ï¤ì¤«¤é¤À¡£ +Unix ¤ÎÊý¼°¤Ç¤Ï¡¢¥¯¥é¥¤¥¢¥ó¥È¦¤Î°À­¤Î¥­¥ã¥Ã¥·¥ó¥°¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤Ç¡¢ +¤³¤ì¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤·¤«¤·¤Û¤È¤ó¤É¤Î¾õ¶·¤Ç¤Ï¤³¤ì¤Ï³¤¯¥µ¡¼¥Ð¡¼¤Î +Éé²Ù¤òÁý²Ã¤µ¤»¡¢¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ÎÄã²¼¤ò¤â¤¿¤é¤¹¡£ +.PP +¿¤¯¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ä¥Ç¥£¥¹¥¯¤Ï +.B O_NONBLOCK +¤Î¼ÂÁõ¤Ï¤·¤Ê¤¯¤Æ¤âºÑ¤à¤¯¤é¤¤¤Ë½½Ê¬¤Ë¹â®¤Ç¤¢¤ë¤È¹Í¤¨¤é¤ì¤Æ¤¤¤ë¡£ +¤½¤ì¤Ç¤½¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥¹¥¯¤Ë¤Ï +.B O_NONBLOCK +¤ÏÍøÍѤǤ­¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR fcntl (2), +.BR ioctl (2), +.BR lseek (2), +.BR open (2), +.BR pread (2), +.BR readdir (2), +.BR readlink (2), +.BR readv (2), +.BR select (2), +.BR write (2), +.BR fread (3) diff --git a/release/man2/readahead.2 b/release/man2/readahead.2 new file mode 100644 index 00000000..a757b6d0 --- /dev/null +++ b/release/man2/readahead.2 @@ -0,0 +1,99 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 2004, 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. +.\" +.\" 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 ¥Õ¥¡¥¤¥ëµ­½Ò»Ò +.\" +.TH READAHEAD 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +readahead \- Á°¤â¤Ã¤Æ¥Õ¥¡¥¤¥ë¤ò¥Ú¡¼¥¸¡¦¥­¥ã¥Ã¥·¥å¤ËÆɤ߹þ¤à +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "ssize_t readahead(int " fd ", off64_t " offset ", size_t " count ); +.fi +.SH ÀâÌÀ +.BR readahead () +¤Ï¡¢¤³¤Î¸å¤ÎƱ¤¸¥Õ¥¡¥¤¥ë¤«¤é¤Î¥Ç¡¼¥¿Æɤ߹þ¤ß»þ¤Ë¥Ç¥£¥¹¥¯ I/O ¤Ç +Æ°ºî¤¬Ää»ß (block) ¤·¤Ê¤¤¤è¤¦¤Ë¡¢Á°¤â¤Ã¤Æ¥Õ¥¡¥¤¥ë¤ÎÆâÍƤò +¥Ú¡¼¥¸¡¦¥­¥ã¥Ã¥·¥å¤ËÆɤ߹þ¤à¡£ +.I fd +°ú¤­¿ô¤ÏÆɤ߹þ¤ß¤ò¹Ô¤¦¥Õ¥¡¥¤¥ë¤ò¼±Ê̤¹¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.I offset +°ú¤­¿ô¤Ï¥Ç¡¼¥¿¤ÎÆɤ߹þ¤ß³«»Ï°ÌÃÖ¤ò»ØÄꤷ¡¢ +.I count +¤ÏÆɤ߹þ¤à¥Ç¡¼¥¿¤Î¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£ +¥Ç¥£¥¹¥¯ I/O ¤Ï¥Ú¡¼¥¸Ã±°Ì¤Ç¼Â¹Ô¤µ¤ì¤ë¤Î¤Ç¡¢ +¼ÂºÝ¤Ë¤Ï +.I offset +¤Ï¥Ú¡¼¥¸¶­³¦¤ËÀڤ겼¤²¤é¤ì¡¢Æɤ߹þ¤ß¥Ð¥¤¥È¿ô¤Ï +.I "(offset+count)" +¤è¤ê¾®¤µ¤¯¤Ê¤¤¼¡¤Î¥Ú¡¼¥¸¶­³¦¤Þ¤ÇÀÚ¤ê¾å¤²¤é¤ì¤ë¡£ +.BR readahead () +¤Ï¥Õ¥¡¥¤¥ë¤ÎËöÈø¤ò±Û¤¨¤¿ÈϰϤޤÇÆɤ߽Ф·¤ò¹Ô¤¦¤³¤È¤Ï¤Ê¤¤¡£¤Þ¤¿¡¢ +.BR readahead () +¤Ï»ØÄꤷ¤¿¥Ç¡¼¥¿¤ÎÆɤ߹þ¤ß¤¬½ª¤ï¤ë¤Þ¤ÇÄä»ß (block) ¤¹¤ë¡£ +.I fd +¤Ç»²¾È¤µ¤ì¤¿¥ª¡¼¥×¥óºÑ¤Î¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Î¸½ºßÃÍ¤Ï +Êѹ¹¤µ¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR readahead () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤Î¸¶°ø¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡¢¤Þ¤¿¤Ï +Æɤ߹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EINVAL +.I fd +¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬¡¢ +.BR readahead () +¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Ê¤¤¥¿¥¤¥×¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR readahead () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.4.13 ¤ÇÅо줷¤¿¡£ +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.3 °Ê¹ß¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +.BR readahead () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +»ÈÍѤòÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR lseek (2), +.BR madvise (2), +.BR mmap (2), +.BR posix_fadvise (2), +.BR read (2) diff --git a/release/man2/readdir.2 b/release/man2/readdir.2 new file mode 100644 index 00000000..f0e831ad --- /dev/null +++ b/release/man2/readdir.2 @@ -0,0 +1,135 @@ +.\" 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 : +.\" 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 ¥Ì¥ëʸ»ú +.\" +.TH READDIR 2 2008-10-02 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +readdir \- ¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à +.SH ½ñ¼° +.nf +.sp +.BI "int readdir(unsigned int " fd ", struct old_linux_dirent *" dirp "," +.BI " unsigned int " count ); +.fi +.SH ÀâÌÀ +¤³¤ì¤Ï¤¢¤Ê¤¿¤Î¶½Ì£¤ò¤â¤Ã¤Æ¤¤¤ë´Ø¿ô¤Ç¤Ï¤Ê¤¤¡£ +POSIX ½àµò¤Î C ¥é¥¤¥Ö¥é¥ê¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤Ä¤¤¤Æ¤Ï +.BR readdir (3) +¤ò¸«¤ë¤³¤È¡£ +¤³¤Î¥Ú¡¼¥¸¤ÏÍç¤Î¥«¡¼¥Í¥ë¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤Ä¤¤¤Æ +µ­½Ò¤·¤Æ¤¤¤ë¤¬¡¢¤³¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï +.BR getdents (2) +¤Ë¤è¤Ã¤Æ¼è¤Ã¤ÆÂå¤ï¤é¤ì¤¿¡£ +.PP +.BR readdir () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤¬»²¾È¤·¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é +.I old_linux_dirent +¹½Â¤ÂΤòÆɤ߹þ¤ß¡¢ +.I dirp +¤Ç»Ø¤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤¹¤ë¡£ +.I count +°ú¤­¿ô¤Ï(¤Û¤È¤ó¤É¤Î +.I old_linux_dirent +¹½Â¤ÂΤÎÆɤ߹þ¤ß¤Ë¤ª¤¤¤Æ)̵»ë¤µ¤ì¤ë +.PP +.I old_linux_dirent +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤ë: +.PP +.in +4n +.nf +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) */ +} +.fi +.in +.PP +.I d_ino +¤Ï inode ÈÖ¹æ¤Ç¤¢¤ë¡£ +.I d_off +¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ÎºÇ½é¤«¤é¤³¤Î +.I old_linux_dirent +¤Þ¤Çµ÷Î¥¤Ç¤¢¤ë¡£ +.I d_reclen +¤Ï +.I d_name +¤ÎÂ礭¤µ¤Ç¡¢ +¥Ì¥ëʸ»ú¤Î½ªÃ¼¤ò´Þ¤ó¤Ç¤¤¤Ê¤¤¡£ +.I d_name +¤Ï¥Ì¥ëʸ»ú¤Ç½ª¤ë¥Õ¥¡¥¤¥ë̾¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¡¢1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥Ç¥£¥ì¥¯¥È¥ê¤ÎºÇ¸å¤Ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.I fd +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EFAULT +°ú¤­¿ô¤Î¥Ý¥¤¥ó¥¿¡¼¤¬¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¶õ´Ö¤Î +³°Éô¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +·ë²ÌÍѤΥХåե¡¡¼¤¬¾®¤µ²á¤®¤ë¡£ +.TP +.B ENOENT +¤½¤Î¤è¤¦¤Ê¥Ç¥£¥ì¥¯¥È¥ê¤Ï¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOTDIR +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£ +.I old_linux_dirent +¹½Â¤ÂΤò¼«Ê¬¼«¿È¤ÇÄêµÁ¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getdents (2), +.BR readdir (3) diff --git a/release/man2/readlink.2 b/release/man2/readlink.2 new file mode 100644 index 00000000..cf7acb85 --- /dev/null +++ b/release/man2/readlink.2 @@ -0,0 +1,156 @@ +.\" 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. +.\" +.\" @(#)readlink.2 6.8 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 00:10:21 1993 by Rik Faith +.\" Modified Tue Jul 9 23:55:17 1996 by aeb +.\" Modified Fri Jan 24 00:26:00 1997 by aeb +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-12-12, HANATAKA Shinya +.\" Updated 2005-02-10, Yuichi SATO +.\" Updated 2006-07-19, Akihiro MOTOKI , LDP v2.36 +.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡¡¼ +.\"WORD: NUL ¥Ì¥ëʸ»ú +.\"WORD: global variable ¥°¥í¡¼¥Ð¥ëÊÑ¿ô +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\" +.TH READLINK 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +readlink \- ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ÎÃͤòÆɤà +.SH ½ñ¼° +.B #include +.sp +.BI "ssize_t readlink(const char *" path ", char *" buf ", size_t " bufsiz ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR readlink (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _POSIX_C_SOURCE\ >=\ 200112L +.ad b +.SH ÀâÌÀ +.BR readlink () +¤Ï +.I path +¤ÇÍ¿¤¨¤é¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ÎÆâÍƤò +.I buf +¥Ð¥Ã¥Õ¥¡¡¼¤Ø³ÊǼ¤¹¤ë¡¢ +.I buf +¤Î¥µ¥¤¥º¤Ï +.I bufsiz +¤Ç¤¢¤ë¡£ +.BR readlink () +¤Ï NULL ¥Ð¥¤¥È¤ò +.I buf +¤ËÄɲ䷤ʤ¤¡£ +¤½¤ÎÆâÍÆÁ´¤Æ¤ò³ÊǼ¤¹¤ë¤Î¤Ë¥Ð¥Ã¥Õ¥¡¡¼¤¬¾®¤µ²á¤®¤ë¾ì¹ç¤Ï¡¢ +.RI ( bufsiz +¥Ð¥¤¥È¤ÎŤµ¤Ë) ÆâÍƤòÀÚ¤êµÍ¤á¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR readlink () +¤Ï +.I buf +¤Ë³ÊǼ¤µ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¥Ñ¥¹¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Ë¸¡º÷µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EFAULT +.I buf +¤¬¥×¥í¥»¥¹¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I bufsiz +¤¬Àµ¤Ç¤Ê¤¤¡£ +.\" At the glibc level, bufsiz is unsigned, so this error can only occur +.\" if bufsiz==0. However, the in the kernel syscall, bufsiz is signed, +.\" and this error can also occur if bufsiz < 0. +.\" See: http://thread.gmane.org/gmane.linux.man/380 +.\" Subject: [patch 0/3] [RFC] kernel/glibc mismatch of "readlink" syscall? +.TP +.B EINVAL +»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤Ê¤¤¡£ +.TP +.B EIO +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ÎÆɤ߹þ¤ßÃæ¤Ë I/O ¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B ELOOP +¥Ñ¥¹Ì¾¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENAMETOOLONG +¥Ñ¥¹Ì¾¤«¥Ñ¥¹Ì¾¤Î°ìÉôʬ¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +¤½¤Î̾Á°¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +¥Ñ¥¹¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.SH ½àµò +4.4BSD +.RB ( readlink () +´Ø¿ô¥³¡¼¥ë¤Ï 4.2BSD ¤Ç¸½¤ï¤ì¤¿), POSIX.1-2001. +.SH Ãí°Õ +¥Ð¡¼¥¸¥ç¥ó 2.4 °ÊÁ°¤Î glibc (¥Ð¡¼¥¸¥ç¥ó 2.4 ¤ò´Þ¤à) ¤Ç¤Ï¡¢ +.BR readlink () +¤ÎÊÖ¤êÃͤη¿¤Ï +.I int +¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤¿¡£¸½ºß¤Ç¤Ï¡¢ÊÖ¤êÃͤη¿¤Ï +.I ssize_t +¤Ç¤¢¤ë (ÊÖ¤êÃÍ +.I ssize_t +¤Ï POSIX.1-2001 ¤Ç (¿·¤¿¤Ë) ɬ¿Ü¤È¤Ê¤Ã¤¿)¡£ +.SH ´ØÏ¢¹àÌÜ +.BR lstat (2), +.BR readlinkat (2), +.BR stat (2), +.BR symlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/release/man2/readlinkat.2 b/release/man2/readlinkat.2 new file mode 100644 index 00000000..a17b952a --- /dev/null +++ b/release/man2/readlinkat.2 @@ -0,0 +1,124 @@ +.\" 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-09-27 by Yuichi SATO , LDP v2.39 +.\" +.TH READLINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +readlinkat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ÎÃͤòÆɤà +.SH ½ñ¼° +.nf +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int readlinkat(int " dirfd ", const char *" pathname , +.BI " char *" buf ", size_t " bufsiz ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR readlinkat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +.BR readlinkat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.BR readlink (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I dirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( readlink (2) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I pathname +¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä +.I dirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I pathname +¤Ï +.RB ( readlink (2) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR readlinkat () +¤Ï +.I buf +¤Ë³ÊǼ¤µ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR readlink (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR readlinkat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR readlinkat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I dirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I pathname +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I dirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR readlinkat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2008. +.SH Ãí°Õ +.BR readlinkat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR openat (2), +.BR readlink (2), +.BR path_resolution (7) diff --git a/release/man2/readv.2 b/release/man2/readv.2 new file mode 100644 index 00000000..4d899eb9 --- /dev/null +++ b/release/man2/readv.2 @@ -0,0 +1,237 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2007 Michael Kerrisk +.\" and 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 18:34:44 1993 by Rik Faith (faith@cs.unc.edu) +.\" Merged readv.[23], 2002-10-17, aeb +.\" 2007-04-30 mtk, A fairly major rewrite to fix errors and +.\" add more details. +.\" +.\" 1996-04-12 Tom Bjorkholm +.\" First version written +.\" Modified Tue Oct 22 17:41:07 1996 by Eric S. Raymond +.\" +.\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Updated 1999-04-03, HANATAKA Shinya +.\" Updated 2003-01-14, Akihiro MOTOKI +.\" Updated 2005-10-07, Akihiro MOTOKI +.\" Updated 2007-06-01, Akihiro MOTOKI, LDP v2.50 +.\" +.\"WORD: vector ¥Ù¥¯¥¿ (vector) +.\"WORD: file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡ +.\" +.TH READV 2 2002-10-17 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +readv, writev \- Ê£¿ô¤Î¥Ð¥Ã¥Õ¥¡¤Ø¤ÎÆɤ߽ñ¤­¤ò¹Ô¤Ê¤¦ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "ssize_t readv(int " fd ", const struct iovec *" iov ", int " iovcnt ); +.sp +.BI "ssize_t writev(int " fd ", const struct iovec *" iov ", int " iovcnt ); +.fi +.SH ÀâÌÀ +.BR readv () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤«¤é¡¢ +.I iovcnt +¸Ä¤Î¥Ð¥Ã¥Õ¥¡Ê¬¤Î¥Ç¡¼¥¿¤òÆɤ߹þ¤ß¡¢ +.I iov +¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤¹¤ë +("scatter input";¡Ö¤Ð¤é¤Þ¤­ÆþÎÏ¡×)¡£ +.PP +.BR writev () +´Ø¿ô¤Ï¡¢ +.I iov +¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤«¤éºÇÂç +.I iovcnt +¸Ä¤Î¥Ð¥Ã¥Õ¥¡Ê¬¤Î¥Ç¡¼¥¿¤ò¼è¤ê½Ð¤·¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à +("gather output";¡Ö¤«¤­½¸¤á½ÐÎÏ¡×)¡£ +.PP +¥Ý¥¤¥ó¥¿ +.I iov +¤Ï +.I iovec +¹½Â¤ÂΤÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I iovec +¹½Â¤ÂÎ¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.PP +.br +.in +4n +.nf +struct iovec { + void *iov_base; /* Starting address */ + size_t iov_len; /* Number of bytes to transfer */ +}; +.fi +.in +.PP +.BR readv () +´Ø¿ô¤Ï¡¢Ê£¿ô¤Î¥Ð¥Ã¥Õ¥¡¤Ë¥Ç¡¼¥¿¤òÆɤ߹þ¤àÅÀ¤ò½ü¤¤¤Æ +.BR read (2) +¤ÈÁ´¤¯Æ±ÍͤÎÆ°ºî¤ò¹Ô¤¦¡£ +.PP +.BR writev () +´Ø¿ô¤Ï¡¢Ê£¿ô¤Î¥Ð¥Ã¥Õ¥¡¤Î¥Ç¡¼¥¿¤ò½ñ¤­½Ð¤¹ÅÀ°Ê³°¤Ï +.BR write (2) +¤ÈÁ´¤¯Æ±ÍͤÎÆ°ºî¤ò¹Ô¤¦¡£ +.PP +¥Ð¥Ã¥Õ¥¡¤ÏÇÛÎó¤Î½ç½ø¤Ç½èÍý¤µ¤ì¤ë¡£¤³¤ì¤Ï¡¢ +.BR readv () +¤¬ +.IR iov [0] +¤¬´°Á´¤Ë°ìÇդˤʤë¤Þ¤Ç¥Ç¡¼¥¿¤òµÍ¤á¤Æ¤«¤é¡¢ +.IR iov [0] +¤Ê¤É¤Ë¿Ê¤à¤³¤È¤ò°ÕÌ£¤¹¤ë +(¥Ç¡¼¥¿¤¬½½Ê¬¤Ê¤¤¾ì¹ç¤Ï¡¢ +.I iov +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Î¤¤¤º¤ì¤â°ìÇդˤʤé¤Ê¤¤)¡£ +ƱÍͤˡ¢ +.BR writev () +¤Ï +.IR iov [0] +¤ÎÆâÍƤòÁ´Éô½ñ¤­½Ð¤·¤Æ¤«¤é +.IR iov [1] +¤Ê¤É¤Ë¿Ê¤à¡£ +.PP +.BR readv () +¤È +.BR writev () +¤Ë¤è¤ë¥Ç¡¼¥¿Å¾Á÷¤Ï atomic ¤Ë¹Ô¤ï¤ì¤ë¡£¤Ä¤Þ¤ê¡¢ +.BR writev () +¤Ë¤è¤ë¥Ç¡¼¥¿½ñ¤­¹þ¤ß¤Ï°ì¤Ä¤Î¥Ö¥í¥Ã¥¯¤È¤·¤Æ¹Ô¤ï¤ì¡¢Â¾¤Î¥×¥í¥»¥¹¤Î +write ¤Ë¤è¤ë½ñ¤­¹þ¤ß¤Èº®¤¶¤ê¹ç¤¦¤³¤È¤Ï¤Ê¤¤ +(Îã³°¤Ë´Ø¤·¤Æ¤Ï +.BR pipe (7) +¤ò»²¾È¤Î¤³¤È)¡£Æ±Íͤˡ¢ +.BR readv () +¤Ï¥Õ¥¡¥¤¥ë¤«¤éϢ³¤¹¤ë¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤¬Æɤ߽Ф¹¤³¤È¤¬Êݾڤµ¤ì¡¢ +Ʊ¤¸¥Õ¥¡¥¤¥ëµ­½Ò (file description; +.BR open (2) +»²¾È) ¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»ý¤Ä¾¤Î¥¹¥ì¥Ã¥É¤ä¥×¥í¥»¥¹¤¬ +¼Â¹Ô¤·¤¿ read Áàºî¤Î±Æ¶Á¤ò¼õ¤±¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR readv () +´Ø¿ô¤ÏÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÊÖ¤·¡¢ +.BR writev () +´Ø¿ô¤Ï½ñ¤­¹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢\fIerrno\fP ¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.BR read (2) +¤ä +.BR write (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤µ¤é¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.TP +.B EINVAL +.I iov_len +¤Î¹ç·×¤¬ +.I ssize_t +¤ÎÈϰϤò¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤·¤¿¡£¤â¤·¤¯¤Ï¡¢ +¥Ù¥¯¥¿¿ô \fIiovcnt\fP ¤¬ 0 ¤è¤ê¾®¤µ¤¤¤«µö²Ä¤µ¤ì¤¿ºÇÂçÃͤè¤ê¤âÂ礭¤«¤Ã¤¿¡£ +.SH ½àµò +4.4BSD +.RB ( readv () +¤È +.BR writev () +´Ø¿ô¤Ï 4.2BSD ¤ÇºÇ½é¤Ë¸½¤ï¤ì¤¿)¡¢POSIX.1-2001¡£ +Linux libc5 ¤Ç¤Ï \fIiovcnt\fP °ú¤­¿ô¤Î·¿¤È¤·¤Æ \fIsize_t\fP ¤ò¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤ÎÊÖ¤êÃͤȤ·¤Æ \fIint\fP ¤ò»ÈÍѤ·¤Æ¤¤¤¿¡£ +.\" readv/writev ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 1.3.40 °ÊÁ°¤Ï¥Ð¥°¤À¤é¤±¤Ç¤¢¤Ã¤¿ +.\" (¤È release.libc ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë)¡£ +.SH Ãí°Õ +.SS "Linux ¤Ç¤ÎÃí°Õ" +POSIX.1-2001 ¤Ç¤Ï¡¢ +.I iov +¤ÇÅϤ¹¤³¤È¤¬¤Ç¤­¤ëÍ×ÁÇ¿ô¤Ë¾å¸Â¤òÀߤ±¤ë¼ÂÁõ¤¬Ç§¤á¤é¤ì¤Æ¤¤¤ë¡£ +¼ÂÁõ¤Ï¡¢ +.I +¤Î +.B IOV_MAX +¤òÄêµÁ¤¹¤ë¤³¤È¤ä¡¢¼Â¹Ô»þ¤Ë +.I sysconf(_SC_IOV_MAX) +¤ÎÊÖ¤êÃÍ·Ðͳ¤Ç¡¢¤³¤Î¾å¸Â¤ò¹­¹ð¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Linux ¤Ç¤Ï¡¢¤³¤Î»ÅÁȤߤˤè¤ê¹­¹ð¤µ¤ì¤ë¾å¸Â¤Ï 1024 ¤Ç¤¢¤ê¡¢ +¤³¤ÎÃͤϥ«¡¼¥Í¥ë¤Ç¤Î¾å¸Â¤½¤Î¤â¤Î¤Ç¤¢¤ë¡£ +°ìÊý¤Ç¡¢glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¤½¤Î´Ø¿ô¤ÎÆâÉô¤Ç¸Æ¤Ð¤ì¤ë¥«¡¼¥Í¥ë¡¦ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤³¤Î¾å¸Â¤òĶ²á¤·¤Æ¼ºÇÔ¤·¤¿¤³¤È¤ò¸¡½Ð¤¹¤ë¤È¡¢ +ÄɲäÎÆ°ºî¤ò¤¹¤ë¡£ +.BR readv () +¤Î¾ì¹ç¡¢¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï +.I iov +¤Ç»ØÄꤵ¤ì¤¿Á´¤Æ¤ÎÍ×ÁǤò³ÊǼ¤Ç¤­¤ëÂ礭¤µ¤Î°ì»þ¥Ð¥Ã¥Õ¥¡¤ò³ä¤êÅö¤Æ¡¢ +.BR read (2) +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë¤½¤Î¥Ð¥Ã¥Õ¥¡¤òÅϤ·¡¢ +¤½¤Î¥Ð¥Ã¥Õ¥¡¤Î¥Ç¡¼¥¿¤ò +.I iov +¤Î³ÆÍ×ÁǤΠ+.I iov_base +¥Õ¥£¡¼¥ë¥É¤¬»ØÄꤹ¤ë¾ì½ê¤Ë¥³¥Ô¡¼¤·¤Æ¤«¤é¡¢ +¤½¤Î¥Ð¥Ã¥Õ¥¡¤ò²òÊü¤¹¤ë¡£ +.BR writev () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤â¡¢Æ±¤¸¤è¤¦¤Ë°ì»þ¥Ð¥Ã¥Õ¥¡¤ò»È¤Ã¤Æ +.BR write (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ +.SH ¥Ð¥° +.BR readv () +¤ä +.BR writev () +¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ëÁàºî¤ò¹Ô¤¦´Ø¿ô¤È¡¢ +ɸ½àÆþ½ÐÎϥ饤¥Ö¥é¥ê¤Î´Ø¿ô¤ò¤´¤Á¤ã¤Þ¤¼¤Ë¤·¤Æ¸Æ¤Ö¤Î¤Ï¤ªÁ¦¤á¤·¤Ê¤¤¡£ +¤É¤ó¤Ê·ë²Ì¤Ë¤Ê¤ë¤«¤ÏÄêµÁ¤µ¤ì¤Æ¤ª¤é¤º¡¢ +¤ª¤½¤é¤¯Íߤ·¤¤·ë²Ì¤ÏÆÀ¤é¤ì¤Ê¤¤¤À¤í¤¦¡£ +.SH Îã +°Ê²¼¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ï +.BR writev () +¤Î»ÈÍÑÊýË¡¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£ + +.in +4n +.nf +char *str0 = "hello "; +char *str1 = "world\\n"; +struct iovec iov[2]; +ssize_t nwritten; + +iov[0].iov_base = str0; +iov[0].iov_len = strlen(str0); +iov[1].iov_base = str1; +iov[1].iov_len = strlen(str1); + +nwritten = writev(STDOUT_FILENO, iov, 2); +.fi +.in +.SH ´ØÏ¢¹àÌÜ +.BR read (2), +.BR write (2) diff --git a/release/man2/reboot.2 b/release/man2/reboot.2 new file mode 100644 index 00000000..f7640174 --- /dev/null +++ b/release/man2/reboot.2 @@ -0,0 +1,191 @@ +.\" Copyright (c) 1998 Andries Brouwer (aeb@cwi.nl), 24 September 1998 +.\" +.\" 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, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" Japanese Version Copyright (c) 1997 Ueyama Rui +.\" all rights reserved. +.\" Translated Mon Sep 29 23:21:04 JST 1997 +.\" by Ueyama Rui +.\" Updated & Modified Mon Mar 1 1999 +.\" by NAKANO Takeo +.\" Updated Sat Oct 11 JST 2003 by Kentaro Shirakata +.\" +.\"WORD halt Ää»ß +.\"WORD stop Ää»ß +.\"WORD reboot ºÆµ¯Æ° +.\" +.TH REBOOT 2 2008-02-11 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +reboot \- ºÆµ¯Æ°¤¹¤ë¡£¤Þ¤¿¤Ï Ctrl-Alt-Del¤òÍ­¸ú¡¦Ìµ¸ú¤Ë¤¹¤ë +.SH ½ñ¼° +/* libc4 ¤È libc5 ¤Ç¤Î¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤È¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏƱ¤¸¤Ç¤¢¤ë¡£ + ¤Þ¤¿¥«¡¼¥Í¥ë 2.1.30 °Ê¹ß¤Ç¤Ï¡¢Äê¿ô¤È¤·¤Æ¥·¥ó¥Ü¥ê¥Ã¥¯¤Ê̾Á° + LINUX_REBOOT_* ¤¬ÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢¸Æ¤Ó½Ð¤·¤ÎÂè 4 °ú¿ô¤È¤·¤Æ + »ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£*/ +.sp +.B #include +.br +.B #include +.sp +.BI "int reboot(int " magic ", int " magic2 ", int " cmd ", void *" arg ); +.sp +/* glibc ¤Ç¤Ï¡¢´ØÏ¢¤¹¤ëÄê¿ô¤Ë RB_* ¤È¤¤¤¦¥·¥ó¥Ü¥ê¥Ã¥¯¤Ê̾Á°¤¬ÉÕ¤± + ¤é¤ì¤Æ¤¤¤ë¡£¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î°ú¿ô¤Ï 1 ¤Ä¤Ç¡¢3 °ú¿ô¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î + ¥é¥Ã¥Ñ (wrapper) ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ */ +.sp +.B #include +.br +.B #include +.sp +.BI "int reboot(int " cmd ); +.SH ÀâÌÀ +.BR reboot () +¤Ï¥·¥¹¥Æ¥à¤òºÆµ¯Æ°¤¹¤ë¡£¤Þ¤¿¤ÏºÆµ¯Æ°¤Î¥­¡¼¥¹¥È¥í¡¼¥¯¤Ç¤¢¤ë +Ctrl-Alt-Delete (CAD) ¤òÍ­¸ú/̵¸ú¤Ë¤¹¤ë¡£ +¤³¤Î¥­¡¼¥¹¥È¥í¡¼¥¯¤Ï +.BR loadkeys (1) +¤Ë¤è¤Ã¤ÆÊѹ¹¤Ç¤­¤ë¡£ +.PP +.I magic +¤¬ +.B LINUX_REBOOT_MAGIC1 +(ÃÍ¤Ï 0xfee1dead) ¤Ç¤¢¤ê¡¢¤«¤Ä +.I magic2 +¤¬ +.B LINUX_REBOOT_MAGIC2 +(672274793) ¤Ç¤Ê¤±¤ì¤Ð¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ºÇÔ¤·¡¢ +.B EINVAL +¤¬ÊÖ¤µ¤ì¤ë¡£ +¤·¤«¤· 2.1.17 ¤«¤é¤Ï +.B LINUX_REBOOT_MAGIC2A +(85072278) ¤¬¡¢ +¤Þ¤¿ 2.1.97 ¤«¤é¤Ï +.B LINUX_REBOOT_MAGIC2B +(369367448) ¤¬¡¢ +2.5.71 ¤«¤é¤Ï +.B LINUX_REBOOT_MAGIC2C +(537993216) ¤¬ +.I magic2 +¤ÎÃͤȤ·¤Æ»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿ (¤³¤ì¤é¤ÎÄê¿ô¤Î 16 ¿Ê¤Ç¤Î +ɽµ­¤Ë¤Ï¤Á¤ç¤Ã¤È¤·¤¿°ÕÌ£¤¬¤¢¤ë)¡£ +.I cmd +°ú¿ô¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë¡£ +.TP +.B LINUX_REBOOT_CMD_RESTART +(RB_AUTOBOOT, 0x1234567) +"Restarting system." ¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¡¢ +¥Ç¥Õ¥©¥ë¥È¤ÎºÆµ¯Æ°½èÍý¤¬¤¿¤À¤Á¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ +Àè¤Ë +.BR sync (2) +¤ò¹Ô¤Ê¤ï¤Ê¤¤¤È¡¢¥Ç¡¼¥¿¤¬¼º¤ï¤ì¤ë¡£ +.TP +.B LINUX_REBOOT_CMD_HALT +(RB_HALT_SYSTEM, 0xcdef0123; 1.1.76 °Ê¹ß) +"System halted." ¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¡¢¥·¥¹¥Æ¥à¤ÏÄä»ß (halt) ¤¹¤ë¡£ +À©¸æ¤Ï ROM ¥â¥Ë¥¿¤Ë°Ü¤ë (ROM ¥â¥Ë¥¿¤¬¤¢¤ë¾ì¹ç)¡£ +Àè¤Ë +.BR sync (2) +¤ò¹Ô¤Ê¤ï¤Ê¤¤¤È¡¢¥Ç¡¼¥¿¤¬¼º¤ï¤ì¤ë¡£ +.TP +.B LINUX_REBOOT_CMD_POWER_OFF +(0x4321fedc; 2.1.30 °Ê¹ß) +"Power down" ¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¡¢¥·¥¹¥Æ¥à¤ÏÄä»ß (stop) ¤¹¤ë¡£ +²Äǽ¤Ê¾ì¹ç¤Ï¥·¥¹¥Æ¥à¤ÎÅŸ»¤¬Íî¤È¤µ¤ì¤ë¡£ +Àè¤Ë +.BR sync (2) +¤ò¹Ô¤Ê¤ï¤Ê¤¤¤È¡¢¥Ç¡¼¥¿¤¬¼º¤ï¤ì¤ë¡£ +.TP +.B LINUX_REBOOT_CMD_RESTART2 +(0xa1b2c3d4; 2.1.30 °Ê¹ß) +"Restarting system with command \(aq%s\(aq" ¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¡¢ +¤¿¤À¤Á¤Ë ( +.I arg +¤Ë»ØÄꤵ¤ì¤¿¥³¥Þ¥ó¥É¤òÍѤ¤¤Æ) ºÆµ¯Æ° (restart) ¤¬¹Ô¤ï¤ì¤ë¡£ +Àè¤Ë +.BR sync (2) +¤ò¹Ô¤Ê¤ï¤Ê¤¤¤È¡¢¥Ç¡¼¥¿¤¬¼º¤ï¤ì¤ë¡£ +.TP +.B LINUX_REBOOT_CMD_CAD_ON +(RB_ENABLE_CAD, 0x89abcdef) +CAD ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤ì°Ê¹ß¤Ë CAD ¥­¡¼¥¹¥È¥í¡¼¥¯¤¬ÆþÎϤµ¤ì¤ë¤È¡¢ +¤¿¤À¤Á¤Ë +.B LINUX_REBOOT_CMD_RESTART +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Æ°ºî¤¬¹Ô¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.TP +.B LINUX_REBOOT_CMD_CAD_OFF +(RB_DISABLE_CAD, 0) +CAD ¤ò̵¸ú¤Ë¤¹¤ë¡£ +¤³¤ì°Ê¹ß¤Ë CAD ¥­¡¼¥¹¥È¥í¡¼¥¯¤¬ÆþÎϤµ¤ì¤ë¤È¡¢ +.B SIGINT +¥·¥°¥Ê¥ë¤¬ init (¥×¥í¥»¥¹ 1) ¤ËÁ÷¤é¤ì¤ë¡£ +¤³¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±¤ë¤È¡¢¤ª¤½¤é¤¯ init ¥×¥í¥»¥¹¤Ï +Á°¤â¤Ã¤ÆÄê¤á¤é¤ì¤¿Æ°ºî¤ò¹Ô¤¦¤³¤È¤Ë¤Ê¤ë (¿ʬ¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤Î kill, +sync, ºÆµ¯Æ°)¡£ +.LP +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤À¤±¤¬ +.BR reboot () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +¾å½Ò¤Î¥¢¥¯¥·¥ç¥ó¤Î¼ÂºÝ¤Î¸ú²Ì¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë°Í¸¤¹¤ë¡£ +i386 ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢¸½ºß¤Î¤È¤³¤í (2.1.122) Éղðú¿ô¤Ï +²¿¤â¹Ô¤ï¤Ê¤¤¤¬¡¢ºÆµ¯Æ°¤Î¥¿¥¤¥×¤ò¥«¡¼¥Í¥ë¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¿ô +("reboot=...") ¤Ë¤è¤Ã¤ÆÄê¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤Ï warm ¤Þ¤¿¤Ï cold ¤È¡¢ hard ¤Þ¤¿¤Ï BIOS ·Ðͳ¤ÎºÆµ¯Æ°¤ò +ÀßÄê¤Ç¤­¤ë¡£ +.SH ÊÖ¤êÃÍ +.I cmd +¤¬¥·¥¹¥Æ¥à¤ÎÄä»ß¤äºÆµ¯Æ°¤òɽ¤¹Ãͤξì¹ç¡¢¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤È +.BR reboot () +¤ÏÊÖ¤é¤Ê¤¤¡£ +.I cmd +¤¬Â¾¤ÎÃͤξì¹ç¤Ë¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤¬Ê֤롣 +.I cmd +¤ÎÃͤ˴ؤï¤é¤º¡¢¼ºÇԤξì¹ç¤Ë¤Ï \-1 ¤¬Ê֤ꡢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.B LINUX_REBOOT_CMD_RESTART2 +¤Î»þ¤Ë¥æ¡¼¥¶¡¼¥¹¥Ú¡¼¥¹¤Î¥Ç¡¼¥¿¤Î¼èÆÀ¤ËÌäÂ꤬¤¢¤Ã¤¿¡£ +.TP +.B EINVAL +magic ¤Î¿ô»ú¤« \fIcmd\fP ¤¬´Ö°ã¤Ã¤Æ¤¤¤ë¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë +.BR reboot () +¤ò¸Æ¤Ó½Ð¤¹¤Î¤Ë½½Ê¬¤Ê¸¢¸Â¤¬¤Ê¤«¤Ã¤¿¡£ +.B CAP_SYS_BOOT +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.SH ½àµò +.BR reboot () +¤Ï Linux ¤ËÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤ÏÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sync (2), +.BR bootparam (7), +.BR ctrlaltdel (8), +.BR halt (8), +.BR reboot (8), +.BR capabilities (7) diff --git a/release/man2/recv.2 b/release/man2/recv.2 new file mode 100644 index 00000000..9282c187 --- /dev/null +++ b/release/man2/recv.2 @@ -0,0 +1,525 @@ +.\" Copyright (c) 1983, 1990, 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. +.\" +.\" $Id: recv.2,v 1.8 2001/08/15 18:00:48 hanataka 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 ÉÔÀµ¤Ê +.\" +.TH RECV 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +recv, recvfrom, recvmsg \- ¥½¥±¥Ã¥È¤«¤é¥á¥Ã¥»¡¼¥¸¤ò¼õ¤±¼è¤ë +.SH ½ñ¼° +.\" .B #include +.\" .br +.nf +.B #include +.br +.B #include +.sp +.BI "ssize_t recv(int " sockfd ", void *" buf ", size_t " len ", int " flags ); +.sp +.BI "ssize_t recvfrom(int " sockfd ", void *" buf ", size_t " len ", int " flags , +.BI " struct sockaddr *" src_addr ", socklen_t *" addrlen ); +.sp +.BI "ssize_t recvmsg(int " sockfd ", struct msghdr *" msg ", int " flags ); +.fi +.SH ÀâÌÀ +.BR recvfrom () +¤È +.BR recvmsg () +¥³¡¼¥ë¤Ï¡¢¥½¥±¥Ã¥È¤«¤é¥á¥Ã¥»¡¼¥¸¤ò¼õ¤±¼è¤ë¤Î¤Ë»ÈÍѤ¹¤ë¡£ +¤Þ¤¿¥½¥±¥Ã¥È¤Î¥Ç¡¼¥¿¼õ¿®¤Ë¤â»È¤¦¤³¤È¤¬¤Ç¤­¡¢ +¤³¤Î¤È¤­¥½¥±¥Ã¥È¤ÏÀܳ»Ø¸þ (connection-oriened) ¤Ç¤¢¤Ã¤Æ¤â¤Ê¤¯¤Æ¤â¤è¤¤¡£ +.PP +.I src_addr +¤¬ NULL °Ê³°¤Ç¡¢²¼ÁؤΥץí¥È¥³¥ë¤«¤éÁ÷¿®¸µ¥¢¥É¥ì¥¹¤¬Ê¬¤«¤ë¾ì¹ç¡¢ +.I src_addr +¤Ë¤Ï¤³¤ÎÁ÷¿®¸µ¥¢¥É¥ì¥¹¤¬Æþ¤ì¤é¤ì¤ë¡£ +.I src_addr +¤¬ NULL ¤Î¾ì¹ç¡¢ +.I src_addr +¤Ë¤Ï²¿¤âÆþ¤é¤Ê¤¤¡£¤³¤Î¾ì¹ç¡¢ +.I addrlen +¤Ï»ÈÍѤµ¤ì¤º¡¢¤³¤Î°ú¤­¿ô¤Ï NULL ¤Ë¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.\" (Unix ¥É¥á¥¤¥ó¤È¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥É¥á¥¤¥ó¤Î¤É¤Á¤é¤Î¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤Ç¤â +.\" .I src_addr +.\" ¤ËÁ÷¿®¸µ¥¢¥É¥ì¥¹¤¬Æþ¤ì¤é¤ì¤ë¡£¤Þ¤¿¡¢Unix ¥É¥á¥¤¥ó¤Î¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¤Ç¤â +.\" ƱÍͤÀ¤¬¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥É¥á¥¤¥ó¤Î¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¤Ç¤Ï +.\" .I src_addr +.\" ¤Ë¥¢¥É¥ì¥¹¤¬Æþ¤ì¤é¤ì¤Ê¤¤¡£) +.\" [¾åµ­¤Î AF_UNIX ¤È AF_INET ¥½¥±¥Ã¥È¤Ë´Ø¤¹¤ëÃíµ­¤Ï¥«¡¼¥Í¥ë 2.4.18 ¤Ç¤Î +.\" Æ°ºî¤ÈƱ¤¸¤Ç¤¢¤ë¡£ (MTK, 22 Jul 02)] +°ú¤­¿ô +.I addrlen +¤ÏÆþ½ÐÎÏξÍѤΰú¤­¿ô¤Ç¤¢¤ë¡£¸Æ¤Ó½Ð¤·»þ¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤¬ +.I src_addr +¤Ë³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤Ç½é´ü²½¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +Ê֤äƤ¯¤ë»þ¤Ë¤Ï¡¢Á÷¿®¸µ¥¢¥É¥ì¥¹¤Î¼ÂºÝ¤ÎÂ礭¤µ¤ËÊѹ¹¤µ¤ì¤ë¡£ +ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ²á¤®¤ë¾ì¹ç¤Ë¤Ï¡¢ÊÖ¤µ¤ì¤ë¥¢¥É¥ì¥¹¤ÎËöÈø¤Ï +ÀÚ¤êµÍ¤á¤é¤ì¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I addrlen +¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·»þ¤ËÅϤµ¤ì¤¿Ãͤè¤ê¤âÂ礭¤ÊÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.BR recv () +¥³¡¼¥ë¤ÏÄ̾ï +.I ÀܳºÑ¤ß¤Î (connected) +¥½¥±¥Ã¥È +.RB ( connect (2) +¤ò»²¾È) ¤Ë¤Ä¤¤¤Æ¤Î¤ß»ÈÍѤµ¤ì¡¢ +.I src_addr +°ú¤­¿ô¤Ë NULL ¤ò»ØÄꤷ¤¿ +.BR recvfrom () +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.PP +¤³¤ì¤é¤Î»°¤Ä¤Î¥ë¡¼¥Á¥ó¤Ï¤¤¤º¤ì¤â¡¢À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤ÎŤµ¤òÊÖ¤¹¡£ +¥á¥Ã¥»¡¼¥¸¤¬Ä¹²á¤®¤Æ»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ËÆþ¤êÀÚ¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤·¤¿¥½¥±¥Ã¥È¤Î¼ïÎà¤Ë¤è¤Ã¤Æ¤Ï;ʬ¤Î¥Ð¥¤¥È¤¬¼Î¤Æ¤é¤ì¤ë +¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +¥½¥±¥Ã¥È¤Ë¼õ¤±¼è¤ë¥á¥Ã¥»¡¼¥¸¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +¼õ¿®ÍѤΥ³¡¼¥ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬ÅþÃ夹¤ë¤Þ¤ÇÂԤġ£ +¤¿¤À¤·¡¢¥½¥±¥Ã¥È¤¬ÈóÄä»ß (nonblocking) +¤ËÀßÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç +.RB ( fcntl (2) +¤ò»²¾È) ¤Ï \-1 ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô +.I errno +¤Ë +.B EAGAIN +¤« +.B EWOULDBLOCK +¤òÀßÄꤹ¤ë¡£ +¤³¤ì¤é¤Î¼õ¿®ÍѤΥ³¡¼¥ë¤Ï¡¢¼õ¿®¤·¤¿¥Ç¡¼¥¿¤Î¥µ¥¤¥º¤¬Í׵ᤷ¤¿¥µ¥¤¥º¤Ë +㤹¤ë¤Þ¤ÇÂԤĤΤǤϤʤ¯¡¢²¿¤é¤«¤Î¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ë¤ÈÉüµ¢¤¹¤ë +(¼õ¿®¤µ¤ì¤ë¥Ç¡¼¥¿¤ÎºÇÂ祵¥¤¥º¤ÏÍ׵ᤷ¤¿¥µ¥¤¥º¤Ç¤¢¤ë)¡£ +.PP +.BR select (2) +¤ä +.BR poll (2) +¥³¡¼¥ë¤ò»È¤Ã¤Æ¡¢¼¡¤Î¥Ç¡¼¥¿¤¬¤¤¤ÄÆϤ¯¤«¤òȽÃǤǤ­¤ë¡£ +.PP +.BR recv () +¥³¡¼¥ë¤Î +.I flags +°ú¤­¿ô¤Ë¤Ï¡¢°Ê²¼¤ÎÃͤò 1¤Ä°Ê¾å¡¢¥Ó¥Ã¥Èñ°Ì¤Î +.I OR (ÏÀÍýÏÂ) +¤ò¼è¤Ã¤¿¤â¤Î¤ò»ØÄꤹ¤ë: +.TP +.BR MSG_CMSG_CLOEXEC " (" recvmsg "() ¤Î¤ß; Linux 2.6.23)" +.RB ( unix (7) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë) +.B SCM_RIGHTS +Áàºî¤ò»È¤Ã¤Æ Unix ¥É¥á¥¤¥ó¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤Ç¼õ¿®¤·¤¿ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤Ä¤¤¤Æ close-on-exec ¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢ +.BR open (2) +¤Î +.B O_CLOEXEC +¥Õ¥é¥°¤ÈƱ¤¸Íýͳ¤ÇÍ­ÍѤǤ¢¤ë¡£ +.TP +.BR MSG_DONTWAIT " (Linux 2.2 °Ê¹ß)" +ÈóÄä»ß (nonblocking) Áàºî¤òÍ­¸ú¤Ë¤¹¤ë¡£ +Áàºî¤¬Ää»ß¤¹¤ë¤è¤¦¤Ê¾ì¹ç¤Ë¥¨¥é¡¼ +.B EAGAIN +¤« +.B EWOULDBLOCK +¤Ç¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤¹¤ë +.RB ( fcntl (2) +¤Î +.B F_SETFL +¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤âÍ­¸ú¤Ë¤Ç¤­¤ë)¡£ +.TP +.BR MSG_ERRQUEUE " (Linux 2.2 °Ê¹ß)" +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢ +¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤¿¥¨¥é¡¼¤ò¥½¥±¥Ã¥È¤Î¥¨¥é¡¼¥­¥å¡¼¤«¤é¼è¤ê¤À¤»¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤³¤Î¥¨¥é¡¼¤ÏÊä½õ¥á¥Ã¥»¡¼¥¸¤ËÁȤ߹þ¤Þ¤ì¤ÆÅϤµ¤ì¡¢ +¤³¤ÎÊä½õ¥á¥Ã¥»¡¼¥¸¤Î¼ïÊ̤ϥץí¥È¥³¥ë¤Ë°Í¸¤¹¤ë +(IPv4 ¤Î¾ì¹ç¤Ï +.BR IP_RECVERR )¡£ +¥æ¡¼¥¶¤Ï½½Ê¬¤Ê¥µ¥¤¥º¤Î¥Ð¥Ã¥Õ¥¡¤òÍÑ°Õ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Êä½õ¥á¥Ã¥»¡¼¥¸¤Ë´Ø¤¹¤ë¤è¤ê¾ÜºÙ¤Ê¾ðÊó¤Ï +.BR cmsg (3) +¤ª¤è¤Ó +.BR ip (7) +¤ò»²¾È¤Î¤³¤È¡£ +¥¨¥é¡¼¤Î¸¶°ø¤È¤Ê¤Ã¤¿¥ª¥ê¥¸¥Ê¥ë¥Ñ¥±¥Ã¥È¤Î¥Ú¥¤¥í¡¼¥É¤Ï¡¢ +.I msg_iovec +·Ðͳ¤ÇÄ̾ï¤Î¥Ç¡¼¥¿¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +¥¨¥é¡¼¤òµ¯¤³¤·¤¿¥Ç¡¼¥¿¥°¥é¥à¤Î¥ª¥ê¥¸¥Ê¥ë¤Î°¸À襢¥É¥ì¥¹¤Ï¡¢ +.I msg_name +·Ðͳ¤Ç»²¾È¤Ç¤­¤ë¡£ +.IP +¥í¡¼¥«¥ë¤Ê¥¨¥é¡¼¤Î¾ì¹ç¤Ï¥¢¥É¥ì¥¹¤ÏÅϤµ¤ì¤Ê¤¤ +(¤³¤ì¤Ï +.I cmsghdr +¤Î +.I cmsg_len +¥á¥ó¥Ð¡¼¤Ç¥Á¥§¥Ã¥¯¤Ç¤­¤ë)¡£ +¼õ¿®¥¨¥é¡¼¤Î¾ì¹ç¤Ï +.B MSG_ERRQUIE +¤¬ +.I msghdr +¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤¬ÅϤµ¤ì¤¿¸å¤Ë¤Ï¡¢¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¼¡¤Î¥¨¥é¡¼¤Ë´ð¤¤¤Æ¡¢ +½èÍýÂÔ¤Á¤Î¥½¥±¥Ã¥È¡¦¥¨¥é¡¼¤¬ºÆÀ¸À®¤µ¤ì¡¢¼¡¤Î¥½¥±¥Ã¥ÈÁàºî¤ÎºÝ¤ËÅϤµ¤ì¤ë¡£ + +.IP +¤³¤Î¥¨¥é¡¼¤Ï +.I sock_extended_err +¹½Â¤ÂΤÇÄ󶡤µ¤ì¤ë: +.in +4n +.nf + +#define SO_EE_ORIGIN_NONE 0 +#define SO_EE_ORIGIN_LOCAL 1 +#define SO_EE_ORIGIN_ICMP 2 +#define SO_EE_ORIGIN_ICMP6 3 + +struct sock_extended_err +{ + uint32_t ee_errno; /* error number */ + uint8_t ee_origin; /* where the error originated */ + uint8_t ee_type; /* type */ + uint8_t ee_code; /* code */ + uint8_t ee_pad; /* padding */ + uint32_t ee_info; /* additional information */ + uint32_t ee_data; /* other data */ + /* More data may follow */ +}; + +struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *); +.fi +.in +.IP +.I ee_errno +¤Ë¤Ï¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤¿¥¨¥é¡¼¤Î +.I errno +¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.I ee_origin +¤Ë¤Ï¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì½ê¤Î¥ª¥ê¥¸¥ó¡¦¥³¡¼¥É (origin code) ¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +¾¤Î¥Õ¥£¡¼¥ë¥É¤Ï¥×¥í¥È¥³¥ë°Í¸¤Ç¤¢¤ë¡£ +.B SO_EE_OFFENDER +¥Þ¥¯¥í¤Ï¡¢¤³¤ÎÊä½õŪ¤Ê¥á¥Ã¥»¡¼¥¸¤ò°ú¤­¿ô¤Ë¼è¤Ã¤Æ¡¢ +¥¨¥é¡¼¤ÎȯÀ¸¤·¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥É¥ì¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¢¥É¥ì¥¹¤¬ÉÔÌÀ¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I sockaddr +¤Î +.I sa_family +¥á¥ó¥Ð¡¼¤¬ +.B AF_UNSPEC +¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.I sockaddr +¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤ÏÉÔÄê¤Ç¤¢¤ë¡£ +¥¨¥é¡¼¤ÎȯÀ¸¤·¤¿¥Ñ¥±¥Ã¥È¤Î¥Ú¥¤¥í¡¼¥É¤ÏÄ̾ï¤Î¥Ç¡¼¥¿¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +.IP +¥í¡¼¥«¥ë¤Ç¤Î¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï¥¢¥É¥ì¥¹¤ÏÅϤµ¤ì¤Ê¤¤ (¤³¤ì¤Ï +.I cmsghdr +¤Î +.I cmsg_len +¥á¥ó¥Ð¡¼¤Ç¥Á¥§¥Ã¥¯¤Ç¤­¤ë)¡£ +¥¨¥é¡¼¤ò¼õ¤±¼è¤Ã¤¿¾ì¹ç¡¢ +.B MSG_ERRQUEUE +¤¬ +.I msghdr +¤ËÀßÄꤵ¤ì¤ë¡£ +¥¨¥é¡¼¤¬ÅϤµ¤ì¤¿¸å¤Ë¤Ï¡¢ +½èÍýÂÔ¤Á¤Ë¤Ê¤Ã¤Æ¤¤¤¿¥½¥±¥Ã¥È¡¦¥¨¥é¡¼¤¬¡¢¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë +¼¡¤Î¥¨¥é¡¼¤Ë´ð¤Å¤¤¤ÆºÆÀ¸À®¤µ¤ì¡¢¼¡¤Î¥½¥±¥Ã¥ÈÁàºî¤ÎºÝ¤ËÅϤµ¤ì¤ë¡£ +.TP +.B MSG_OOB +¤³¤Î¥Õ¥é¥°¤Ï¡¢Ä̾ï¤Î¥Ç¡¼¥¿¡¦¥¹¥È¥ê¡¼¥à¤Ç¤Ï¼õ¿®¤Ç¤­¤Ê¤¤ +ÂÓ°è³° (out-of-band) ¥Ç¡¼¥¿¤Î¼õ¿®¤òÍ׵᤹¤ë¡£ +¥×¥í¥È¥³¥ë¤Ë¤è¤Ã¤Æ¤Ï¡¢ +Ä̾ï¤Î¥Ç¡¼¥¿¡¦¥­¥å¡¼¤ÎÀèƬ¤Ë®ã¥Ç¡¼¥¿¤òÃÖ¤¯¤â¤Î¤¬¤¢¤ë¤¬¡¢ +¤½¤Î¤è¤¦¤Ê¥×¥í¥È¥³¥ë¤Ç¤Ï¤³¤Î¥Õ¥é¥°¤Ï»ÈÍѤǤ­¤Ê¤¤¡£ +.TP +.B MSG_PEEK +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢ +¼õ¿®¥­¥å¡¼¤ÎºÇ½é¤Î¥Ç¡¼¥¿¤òÊÖ¤¹¤È¤­¡¢¥­¥å¡¼¤«¤é¥Ç¡¼¥¿¤òºï½ü¤·¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Î¸å¤Ç¤â¤¦°ìÅÙ¼õ¿®¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹¤È¡¢Æ±¤¸¥Ç¡¼¥¿¤¬Ê֤뤳¤È¤Ë¤Ê¤ë¡£ +.TP +.BR MSG_TRUNC " (Linux 2.2 °Ê¹ß)" +raw ¥½¥±¥Ã¥È +.RB ( AF_PACKET )¡¢ +Internet datagram ¥½¥±¥Ã¥È (Linux 2.4.27/2.6.8 °Ê¹ß)¡¢ +netlink (Linux 2.6.22 °Ê¹ß) ¥½¥±¥Ã¥È¤Î¾ì¹ç¡¢ +¥Ñ¥±¥Ã¥È¤ä¥Ç¡¼¥¿¥°¥é¥à¤ÎŤµ¤¬ÅϤ·¤¿¥Ð¥Ã¥Õ¥¡¤è¤ê¤âŤ«¤Ã¤¿¾ì¹ç¤Ë¤â¡¢ +¥Ñ¥±¥Ã¥È¤ä¥Ç¡¼¥¿¥°¥é¥à¤Î¼ÂºÝ¤ÎŤµ¤òÊÖ¤¹¡£ +Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È +.RB ( unix (7)) +¥½¥±¥Ã¥È¤Ë¤Ä¤¤¤Æ¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +Internet ¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¤Ç¤ÎÍøÍѤˤĤ¤¤Æ¤Ï +.BR tcp (7) +¤ò»²¾È¡£ +.TP +.BR MSG_WAITALL " (Linux 2.2 °Ê¹ß)" +¤³¤Î¥Õ¥é¥°¤Ï¡¢Í׵ᤷ¤¿Î̤¤¤Ã¤Ñ¤¤¤Î¥Ç¡¼¥¿¤¬ÅþÃ夹¤ë¤Þ¤Ç¡¢ +Áàºî¤òÄä»ß (block) ¤¹¤ë¤è¤¦Í׵᤹¤ë¡£ +⤷¡¢¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤¿¤ê¡¢¥¨¥é¡¼¤äÀÚÃÇ (disconnect) ¤¬È¯À¸¤·¤¿¤ê¡¢ +¼¡¤Ë¼õ¿®¤µ¤ì¤ë¥Ç¡¼¥¿¤¬°Û¤Ê¤ë·¿¤À¤Ã¤¿¤ê¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +Í׵ᤷ¤¿Î̤è¤ê¥Ç¡¼¥¿¤¬¾¯¤Ê¤¯¤Æ¤âÊ֤뤳¤È¤¬¤¢¤ë¡£ +.PP +.BR recvmsg () +¥³¡¼¥ë¤Ï¡¢Ä¾ÀÜÅϤ¹°ú¤­¿ô¤Î¿ô¤ò¸º¤é¤¹¤¿¤á¤Ë +.I msghdr +¹½Â¤ÂΤò»ÈÍѤ¹¤ë¡£¤³¤Î¹½Â¤ÂÎ¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +struct iovec { /* Scatter/gather array items */ + void *iov_base; /* Starting address */ + size_t iov_len; /* Number of bytes to transfer */ +}; + +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 */ + socklen_t msg_controllen; /* ancillary data buffer len */ + int msg_flags; /* flags on received message */ +}; +.fi +.in +.PP +.I msg_name +¤È +.I msg_namelen +¤Ï¡¢¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤ËÁ÷¿®¸µ¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤹ¤ë¡£ +̾Á°¤¬É¬Íפʤ¤¾ì¹ç¤Ë¤Ï +.I msg_name +¤Ë NULL ¥Ý¥¤¥ó¥¿¤ò»ØÄꤹ¤ë¡£ +.I msg_iov +¤È +.I msg_iovlen +¥Õ¥£¡¼¥ë¥É¤Ï +.BR readv (2) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Êʬ²ò/·ë¹çÍѤΥ٥¯¥È¥ë (scatter-gather locations) +¤ò»ØÄꤹ¤ë¡£ +.I msg_control +¥Õ¥£¡¼¥ë¥É¤Ï +.I msg_controllen +¤ÎŤµ¤ò»ý¤Á¡¢Â¾¤Î¥×¥í¥È¥³¥ëÀ©¸æ¥á¥Ã¥»¡¼¥¸¤ä +¼ï¡¹¤ÎÊä½õ¥Ç¡¼¥¿¤Î¤¿¤á¤Î¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.BR recvmsg () +¤ò¸Æ¤ÖºÝ¤Ë¤Ï¡¢ +.I msg_controllen +¤Ë +.I msg_control +¤Î¥Ð¥Ã¥Õ¥¡¤ÎŤµ¤òÆþ¤ì¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +¥³¡¼¥ë¤¬À®¸ù¤·¤ÆÊ֤俾ì¹ç¡¢À©¸æ¥á¥Ã¥»¡¼¥¸Îó¤ÎŤµ¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.PP +¥á¥Ã¥»¡¼¥¸¤Î·Á¼°¤Ï°Ê²¼¤ÎÄ̤ê: +.in +4n +.nf + +struct cmsghdr { + socklen_t cmsg_len; /* data byte count, including hdr */ + int cmsg_level; /* originating protocol */ + int cmsg_type; /* protocol-specific type */ +/* followed by + unsigned char cmsg_data[]; */ +}; +.fi +.in +.PP +Êä½õ¥Ç¡¼¥¿¤Ï¡¢ +.BR cmsg (3) +¤ËÄêµÁ¤µ¤ì¤¿¥Þ¥¯¥í·Ðͳ¤Ç¤Î¤ß¥¢¥¯¥»¥¹¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +Îã¤ò¤¢¤²¤ë¤È¡¢ Linux ¤Ï¤³¤ÎÊä½õ¥Ç¡¼¥¿¤Î¥á¥«¥Ë¥º¥à¤ò¡¢ +Unix ¥½¥±¥Ã¥È¾å¤Ç¤Î³ÈÄ¥¥¨¥é¡¼¤ä IP ¥ª¥×¥·¥ç¥ó¡¢ +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¼õ¤±ÅϤ·¤ËÍøÍѤ·¤Æ¤¤¤ë¡£ +.PP +msghdr ¤Î +.I msg_flags +¥Õ¥£¡¼¥ë¥É¤Ï +.BR recvmsg () +¤«¤é¤Î¥ê¥¿¡¼¥ó»þ¤ËÀßÄꤵ¤ì¤ë¡£¤³¤³¤Ë¤Ï¤¤¤¯¤Ä¤«¤Î¥Õ¥é¥°¤¬Æþ¤ë¡£ +.TP +.B MSG_EOR +¤³¤ì¤Ï¥ì¥³¡¼¥É¤Î½ª¤ê (end-of-record) ¤ò¼¨¤·¡¢ +ÊÖ¤µ¤ì¤¿¥Ç¡¼¥¿¤¬´°Á´¤Ê¥ì¥³¡¼¥É¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹ (°ìÈÌŪ¤Ë¤Ï +.B SOCK_SEQPACKET +·¿¤Î¥½¥±¥Ã¥È¤Ç»ÈÍѤµ¤ì¤ë)¡£ +.TP +.B MSG_TRUNC +¥Ç¡¼¥¿¥°¥é¥à¤¬Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤è¤êÂ礭¤«¤Ã¤¿¤¿¤á¤Ë¡¢ +¥Ç¡¼¥¿¥°¥é¥à¤Î¤Ï¤ß½Ð¤·¤¿Éôʬ¤¬¼Î¤Æ¤é¤ì¤¿¤³¤È¤ò¼¨¤¹¡£ +.TP +.B MSG_CTRUNC +Êä½õ¥Ç¡¼¥¿¤Î¤¿¤á¤Î¥Ð¥Ã¥Õ¥¡¤¬ÉÔ­¤·¤¿¤¿¤á¤Ë¡¢ +À©¸æ¥Ç¡¼¥¿¤Î°ìÉô¤¬¼Î¤Æ¤é¤ì¤¿¤³¤È¤ò¼¨¤¹¡£ +.TP +.B MSG_OOB +®ã¥Ç¡¼¥¿¤äÂÓ°è³°¥Ç¡¼¥¿¤ò¼õ¿®¤·¤¿¤³¤È¤ò¼¨¤¹¡£ +.TP +.B MSG_ERRQUEUE +¥Ç¡¼¥¿¤Ï¼õ¿®¤·¤Ê¤«¤Ã¤¿¤¬ +¥½¥±¥Ã¥È¤Î¥¨¥é¡¼¡¦¥­¥å¡¼¤«¤é³ÈÄ¥¥¨¥é¡¼¤ò¼õ¿®¤·¤¿¤³¤È¤ò¼¨¤¹¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î¥³¡¼¥ë¤Ï¼õ¿®¤·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +ÀܳÀ褬Àµ¤·¤¯¥·¥ã¥Ã¥È¥À¥¦¥ó¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Ï¡¢ÊÖ¤êÃÍ¤Ï 0 ¤È¤Ê¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Ï¥½¥±¥Ã¥ÈÁؤÇȯÀ¸¤¹¤ë°ìÈÌŪ¤Ê¥¨¥é¡¼¤Ç¤¢¤ë¡£ +¾¤Î¥¨¥é¡¼¤¬²¼ÁؤΥץí¥È¥³¥ë¡¦¥â¥¸¥å¡¼¥ë¤ÇÀ¸À®¤µ¤ì¡¢ +ÊÖ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤½¤ì¤é¤Î¥Þ¥Ë¥å¥¢¥ë¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.BR EAGAIN " ¤Þ¤¿¤Ï " EWOULDBLOCK +.\" Actually EAGAIN on Linux +¥½¥±¥Ã¥È¤¬ÈóÄä»ß (nonblocking) ¤ËÀßÄꤵ¤ì¤Æ¤¤¤Æ +¼õ¿®Áàºî¤¬Ää»ß¤¹¤ë¤è¤¦¤Ê¾õ¶·¤Ë¤Ê¤Ã¤¿¤«¡¢ +¼õ¿®¤Ë»þ´ÖÀÚ¤ì (timeout) ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ +¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ëÁ°¤Ë»þ´ÖÀÚ¤ì¤Ë¤Ê¤Ã¤¿¡£ +POSIX.1-2001 ¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¤É¤Á¤é¤Î¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤âǧ¤á¤Æ¤ª¤ê¡¢ +¤³¤ì¤é 2 ¤Ä¤ÎÄê¿ô¤¬Æ±¤¸Ãͤò»ý¤Ä¤³¤È¤âµá¤á¤Æ¤¤¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢Î¾Êý¤Î²ÄǽÀ­¤ò +³Îǧ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B EBADF +°ú¤­¿ô +.I sockfd +¤¬ÉÔÀµ¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.TP +.B ECONNREFUSED +¥ê¥â¡¼¥È¤Î¥Û¥¹¥È¤Ç¥Í¥Ã¥È¥ï¡¼¥¯Àܳ¤¬µñÈݤµ¤ì¤¿ +(¤è¤¯¤¢¤ëÍýͳ¤È¤·¤Æ¤Ï¡¢Í׵ᤷ¤¿¥µ¡¼¥Ó¥¹¤¬µ¯Æ°¤µ¤ì¤Æ¤¤¤Ê¤¤¤Ê¤É¤¬¤¢¤ë)¡£ +.TP +.B EFAULT +¼õ¿®¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINTR +¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ëÁ°¤Ë¡¢¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +ÉÔÀµ¤Ê°ú¤­¿ô¤¬ÅϤµ¤ì¤¿¡£ +.\" e.g., msg_namelen < 0 for recvmsg() or addrlen < 0 for recvfrom() +.TP +.B ENOMEM +.BR recvmsg () +¤Î¤¿¤á¤Î¥á¥â¥ê¤¬³ÎÊݤǤ­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOTCONN +¥½¥±¥Ã¥È¤ËÀܳ»Ø¸þ¥×¥í¥È¥³¥ë¤¬³ä¤êÅö¤Æ¤é¤ì¤Æ¤ª¤ê¡¢ +¤Þ¤ÀÀܳ¤µ¤ì¤Æ¤¤¤Ê¤¤ +.RB ( connect (2) +¤È +.BR accept (2) +¤ò»²¾È¤Î¤³¤È)¡£ +.TP +.B ENOTSOCK +°ú¤­¿ô +.I sockfd +¤¬¥½¥±¥Ã¥È¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +4.4BSD (¤³¤ì¤é¤Î´Ø¿ô¤Ï 4.2BSD ¤Ç¸½¤ï¤ì¤¿), POSIX.1-2001¡£ +.LP +POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR MSG_OOB , +.BR MSG_PEEK , +.B MSG_WAITALL +¥Õ¥é¥°¤À¤±¤¬µ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +¾åµ­¤Î¥×¥í¥È¥¿¥¤¥×¤Ï 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) +¤â»²¾È¤¹¤ë¤³¤È¡£ + +POSIX.1-2001 ¤Ç¤Ï¡¢¹½Â¤ÂÎ +.I msghdr +¤Î¥Õ¥£¡¼¥ë¥É +.I msg_controllen +¤Ï +.I socklen_t +·¿¤Ç¤¢¤ë¤Ù¤­¤À¤È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +¸½ºß¤Î glibc (glibc 2.4) ¤Ç¤Ï +.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. +.SH Îã +.BR recvfrom () +¤ÎÍøÍÑÎ㤬 +.BR getaddrinfo (3) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fcntl (2), +.BR getsockopt (2), +.BR read (2), +.BR select (2), +.BR shutdown (2), +.BR socket (2), +.BR cmsg (3), +.BR sockatmark (3), +.BR socket (7) diff --git a/release/man2/remap_file_pages.2 b/release/man2/remap_file_pages.2 new file mode 100644 index 00000000..a3806b72 --- /dev/null +++ b/release/man2/remap_file_pages.2 @@ -0,0 +1,155 @@ +.\" Copyright (C) 2003, Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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. +.\" +.\" 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" +.SH ̾Á° +remap_file_pages \- ÈóÀþ·Á¥Õ¥¡¥¤¥ë¥Þ¥Ã¥Ô¥ó¥°¤òºîÀ®¤¹¤ë¡£ +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int remap_file_pages(void *" addr ", size_t " size ", int " prot , +.BI " ssize_t " pgoff ", int " flags ); +.fi +.SH ÀâÌÀ +.BR remap_file_pages () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÈóÀþ·Á¤Ê¥Þ¥Ã¥Ô¥ó¥°¡¢ +¤Ä¤Þ¤ê¥Õ¥¡¥¤¥ë¤Î¥Ú¡¼¥¸¤¬¥á¥â¥ê¾å¤ÇϢ³¤·¤Ê¤¤½çÈ֤ǥޥåפµ¤ì¤ë +¥Þ¥Ã¥Ô¥ó¥°¤òºîÀ®¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.BR remap_file_pages () +¤ò»È¤¦Êý¤¬ +.BR mmap (2) +¤ò·«¤êÊÖ¤·¤Æ»È¤¦¤è¤êÍ¥¤ì¤Æ¤¤¤ëÅÀ¤Ï¡¢ +Á°¼Ô¤ÎÊýË¡¤Ç¤Ï¥«¡¼¥Í¥ë¤¬ VMA (Virtual Memory Area, ²¾ÁÛ¥á¥â¥êÎΰè) +¥Ç¡¼¥¿¹½Â¤ÂΤòÄɲäǺîÀ®¤¹¤ëɬÍפ¬¤Ê¤¤¤³¤È¤Ç¤¢¤ë¡£ + +ÈóÀþ·Á¥Þ¥Ã¥Ô¥ó¥°¤òºîÀ®¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +°Ê²¼¤Î¤è¤¦¤Ê¥¹¥Æ¥Ã¥×¤ò¼Â¹Ô¤¹¤ë: +.TP 3 +1. +.BR mmap (2) +¤ò»È¤¤¡¢¥Þ¥Ã¥Ô¥ó¥°¤òºîÀ®¤¹¤ë (¤³¤Î¥Þ¥Ã¥Ô¥ó¥°¤ÏºÇ½é¤ÏÀþ·Á¤Ç¤¢¤ë)¡£ +¤³¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ï +.B MAP_SHARED +¥Õ¥é¥°¤ò»ØÄꤷ¤ÆºîÀ®¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +2. +.BR remap_file_pages () +¤ò 1 ²ó°Ê¾å¸Æ¤Ó½Ð¤·¤Æ¡¢ +¥Þ¥Ã¥Ô¥ó¥°¤Î¥Ú¡¼¥¸¤È¥Õ¥¡¥¤¥ë¤Î¥Ú¡¼¥¸¤ÎÂбþ´Ø·¸¤òºÆ¹½À®¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤ÎƱ¤¸¥Ú¡¼¥¸¤ò¥Þ¥Ã¥Ô¥ó¥°Îΰè¤ÎÊ£¿ô¤Î¾ì½ê¤Ë +¥Þ¥Ã¥×¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¡£ +.LP +.I pgoff +¤È +.I size +°ú¤­¿ô¤Ï¡¢¥Þ¥Ã¥Ô¥ó¥°Æâ¤ÇºÆÇÛÃÖ¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ÎÎΰè¤ò»ØÄꤹ¤ë¡£ +.I pgoff +¤Ï¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Ç¤¢¤ê¡¢Ã±°Ì¤Ï¥·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤Ç¤¢¤ë¡£ +.I size +¤ÏÎΰè¤ÎŤµ¤Ç¤¢¤ê¡¢Ã±°Ì¤Ï¥Ð¥¤¥È¤Ç¤¢¤ë¡£ + +.I addr +°ú¤­¿ô¤Ï 2 ¤Ä¤ÎÌÜŪ¤Ç»È¤ï¤ì¤ë¡£ +Âè 1 ¤ÎÌÜŪ¤Ï¡¢¤³¤Î°ú¤­¿ô¤Ë¤è¤Ã¤ÆºÆÊÔÀ®¤·¤¿¤¤¥Ú¡¼¥¸¤Î +¥Þ¥Ã¥Ô¥ó¥°¤ò¼±Ê̤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +¤è¤Ã¤Æ +.I addr +¤Ï +.BR mmap (2) +¤Î¸Æ¤Ó½Ð¤·¤Ç²áµî¤Ë¥Þ¥Ã¥×¤µ¤ì¤¿ÎΰèÆâ¤Î¥¢¥É¥ì¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Âè 2 ¤ÎÌÜŪ¤Ï¡¢ +.I pgoff +¤È +.I size +¤Ç¼±Ê̤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ú¡¼¥¸¤¬ÃÖ¤«¤ì¤ëͽÄê¤Î¥¢¥É¥ì¥¹¤ò¡¢ +.I addr +¤Ë¤è¤Ã¤Æ»ØÄꤹ¤ë¤³¤È¤Ç¤¢¤ë¡£ + +.I addr +¤È +.I size +¤Ë»ØÄꤹ¤ëÃͤϡ¢¥·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤È¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥«¡¼¥Í¥ë¤Ï¡ÖξÊý¡×¤ÎÃͤò +ºÇ¤â¶á¤¤¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ø¡ÖÀڤ겼¤²¤ë¡×¡£ +.\" ¤³¤Î´Ý¤á½èÍý¤ÏÉ÷ÊѤï¤ê¤Ç¡¢munmap()/mprotect() ¤ä mlock() ¤Î +.\" ƱÍͤΰú¤­¿ô¤Î½èÍýÊýË¡¤È¤âÌ·½â¤¹¤ë¡£ +.\" MTK, 14 Sep 2005 + +.I prot +°ú¤­¿ô¤Ï 0 ¤Ë»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.I flags +°ú¤­¿ô¤Ï +.BR mmap (2) +¤Î¤â¤Î¤ÈƱ¤¸°ÕÌ£¤Ç¤¢¤ë¤¬¡¢ +.B MAP_NONBLOCK +°Ê³°¤ÎÁ´¤Æ¤Î¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR remap_file_pages () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I addr +¤¬ +.B MAP_SHARED +¥Õ¥é¥°¤ò»ØÄꤷ¤ÆºîÀ®¤µ¤ì¤¿Í­¸ú¤Ê¥Þ¥Ã¥Ô¥ó¥°¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EINVAL +.IR addr , +.IR size , +.IR prot , +.I pgoff +¤Î¤¤¤º¤ì¤«¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.\" ¤Þ¤¿¤Ï vma->vm_ops->populate() ¤«¤é¤Î¾¤Î¥¨¥é¡¼¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR remap_file_pages () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.5.46 ¤ÇÅо줷¤¿¡£ +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.3.3 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +.BR remap_file_pages () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getpagesize (2), +.BR mmap (2), +.BR mmap2 (2), +.BR mprotect (2), +.BR mremap (2), +.BR msync (2), +.BR feature_test_macros (7) diff --git a/release/man2/removexattr.2 b/release/man2/removexattr.2 new file mode 100644 index 00000000..c8c75e55 --- /dev/null +++ b/release/man2/removexattr.2 @@ -0,0 +1,134 @@ +.\" +.\" Extended attributes system calls manual pages +.\" +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" 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) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 04:43:40 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: extended attributes ³Èĥ°À­ +.\"WORD: namespace ̾Á°¶õ´Ö +.\" +.TH REMOVEXATTR 2 2001-12-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +removexattr, lremovexattr, fremovexattr \- ³Èĥ°À­¤òºï½ü¤¹¤ë +.SH ½ñ¼° +.fam C +.nf +.B #include +.B #include +.sp +.BI "int removexattr(const char\ *" path ", const char\ *" name ); +.BI "int lremovexattr(const char\ *" path ", const char\ *" name ); +.BI "int fremovexattr(int " fd ", const char\ *" name ); +.fi +.fam T +.SH ÀâÌÀ +³Èĥ°À­¤Ï¡¢inode (¥Õ¥¡¥¤¥ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯Åù) ¤Ë +´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +.IR name :\c +.I value +¤ÎÂФǤ¢¤ë¡£ +¤³¤ì¤é¤Ï¡¢¥·¥¹¥Æ¥à¾å¤Î¤¹¤Ù¤Æ¤Î inode ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ä̾ï¤Î°À­ +.RB ( stat (2) +¤¬ÊÖ¤¹¥Ç¡¼¥¿) ¤ò³ÈÄ¥¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +³Èĥ°À­¤Î¥³¥ó¥»¥×¥È¤Ï +.BR attr (5) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +.BR removexattr () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î»ØÄꤵ¤ì¤¿ +.I path +¤ËÂбþ¤¹¤ë¡¢Ì¾Á° +.I name +¤Î³Èĥ°À­¤òºï½ü¤¹¤ë¡£ +.PP +.BR lremovexattr () +¤Ï +.BR removexattr () +¤ÈƱ¤¸¤À¤¬¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¡¢¥ê¥ó¥¯¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë +¤Ç¤Ï¤Ê¤¯¡¢¥ê¥ó¥¯¤½¤Î¤â¤Î¤Î¾ðÊó¤òºï½ü¤¹¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +.PP +.BR fremovexattr () +¤Ï +.BR removexattr () +¤ÈƱ¤¸¤À¤¬¡¢ +.I path +¤ÎÂå¤ï¤ê¤Ë +.I fd +¤Ç»²¾È¤µ¤ì¤¿¥ª¡¼¥×¥óºÑ¤ß¥Õ¥¡¥¤¥ë¤«¤é³Èĥ°À­¤òºï½ü¤¹¤ë¤À¤±¤Ç¤¢¤ëÅÀ¤¬°Û¤Ê¤ë +.RI ( fd +¤Ï +.BR open (2) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë)¡£ +.PP +³Èĥ°À­¤Î̾Á°¤Ï¡¢ÉáÄ̤ΠNULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +.I name +¤Ë¤Ï¡¢Ì¾Á°¶õ´Ö¤òɽ¤¹ÀÜƬ¼­ (prefix) ¤¬´Þ¤Þ¤ì¤ë¡£ +¸Ä¡¹¤Î inode ¤ËÂФ·¡¢¸ß¤¤¤ËÆÈΩ¤Ê̾Á°¶õ´Ö¤¬Ê£¿ô¤¢¤Ã¤Æ¤â¤è¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +»ØÄꤵ¤ì¤¿Ì¾Á°¤Î°À­¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOATTR +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +³Èĥ°À­¤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¤â¤·¤¯¤Ï̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOTSUP +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.BR stat (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀâÌÀ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ï +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤âŬÍѤµ¤ì¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.4 °Ê¹ß¤Î Linux ¤ÇÍøÍѤǤ­¤ë¡£ +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3 °Ê¹ß¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\" .SH Ãø¼Ô +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" ¤È SGI XFS ³«È¯¥Á¡¼¥à, +.\" .RI < linux-xfs@oss.sgi.com >¡£ +.\" ¥Ð¥°¥ì¥Ý¡¼¥È¤ä¥³¥á¥ó¥È¤Ï¾åµ­¤Î¥¢¥É¥ì¥¹¤Þ¤ÇÁ÷¤Ã¤Æ²¼¤µ¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getfattr (1), +.BR setfattr (1), +.BR getxattr (2), +.BR listxattr (2), +.BR open (2), +.BR setxattr (2), +.BR stat (2), +.BR attr (5), +.BR symlink (7) diff --git a/release/man2/rename.2 b/release/man2/rename.2 new file mode 100644 index 00000000..be0a5219 --- /dev/null +++ b/release/man2/rename.2 @@ -0,0 +1,268 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt; +.\" 1993,1995 Ian Jackson. +.\" +.\" 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 Sat Jul 24 00:35:52 1993 by Rik Faith +.\" Modified Thu Jun 4 12:21:13 1998 by Andries Brouwer +.\" Modified Thu Mar 3 09:49:35 2005 by Michael Haardt +.\" 2007-03-25, mtk, added various text to DESCRIPTION. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Fri Dec 12 00:15:52 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Thu Feb 10 07:23:59 JST 2005 +.\" by Yuichi SATO +.\" Updated & Modified Fri Apr 22 03:21:04 JST 2005 by Yuichi SATO +.\" Updated 2007-05-04, Akihiro MOTOKI , LDP v2.44 +.\" Updated 2009-04-24, Akihiro MOTOKI , LDP v3.20 +.\" +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: hard link ¥Ï¡¼¥É¡¦¥ê¥ó¥¯ +.\"WORD: overwrite ¾å½ñ¤­(overwrite) +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: crash ¥¯¥é¥Ã¥·¥å +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: working directory ¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: root directory ¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: effective uid ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: sticky bit ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È +.\"WORD: memory ¥á¥â¥ê +.\"WORD: read-only Æɤ߹þ¤ßÀìÍÑ +.\"WORD: uid ¥æ¡¼¥¶¡¼ID +.\"WORD: dangling symbolic link ²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: server ¥µ¡¼¥Ð¡¼ +.\" +.TH RENAME 2 2009-03-30 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +rename \- ¥Õ¥¡¥¤¥ë¤Î̾Á°¤ä°ÌÃÖ¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int rename(const char *" oldpath ", const char *" newpath ); +.SH ÀâÌÀ +.BR rename () +¤Ï¥Õ¥¡¥¤¥ë¤Î̾Á°¤òÊѹ¹¤·¡¢É¬Íפʤé¤Ð¥Ç¥£¥ì¥¯¥È¥ê´Ö¤Î°ÜÆ°¤ò¹Ô¤Ê¤¦¡£ +¤½¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë +.RB ( link (2) +¤ò»ÈÍѤ·¤Æºî¤é¤ì¤¿) ¾¤Î¥Ï¡¼¥É¥ê¥ó¥¯ (hard link) ¤Ë¤Ï±Æ¶Á¤Ï¤Ê¤¤¡£ +¥ª¡¼¥×¥óºÑ¤Î +.I oldpath +¤ËÂФ¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤â±Æ¶Á¤Ï¤Ê¤¤¡£ + +.I newpath +¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢¤½¤ì¤ÏÉÔ²ÄʬÁàºî¤Ç (atomically) ÃÖ¤­´¹¤¨¤é¤ì¤ë +(¤¿¤À¤·¡¢¤¤¤¯¤Ä¤«¤Î¾ò·ï¤¬¤¢¤ë; °Ê²¼¤Î¡Ö¥¨¥é¡¼¡×¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È)¡£ +¤½¤Î¤¿¤á¡¢ +.I newpath +¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¾¤Î¥×¥í¥»¥¹¤¬¥Õ¥¡¥¤¥ë¤ò¸«¼º¤¦¤³¤È¤Ï¤Ê¤¤ +(ÌõÃð: ¾ï¤Ë¥¢¥¯¥»¥¹²Äǽ¤Ç¤¢¤ë)¡£ + +.I oldpath +¤È +.I newpath +¤¬¤É¤Á¤é¤â´û¸¤Î¥Ï¡¼¥É¥ê¥ó¥¯¤Ç¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR rename () +¤Ï²¿¤â¹Ô¤ï¤º¡¢¥¹¥Æ¡¼¥¿¥¹¤È¤·¤ÆÀ®¸ù¤òÊÖ¤¹¡£ + +.I newpath +¤¬Â¸ºß¤·¡¢²¿¤é¤«¤ÎÍýͳ¤ÇÁàºî¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.BR rename () +¤Ï +.I newpath +¤Î¼ÂÂΤò¸µ¤Î¤Þ¤Þ»Ä¤¹¤³¤È¤òÊݾڤ¹¤ë¡£ + +.I oldpath +¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤Î¾ì¹ç¡¢ +.I newpath +¤Ï¸ºß¤·¤Ê¤¤¤«¡¢¶õ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +°ìÊý¤Ç¡¢¾å½ñ¤­¤ò¹Ô¤Ê¤¦¾ì¹ç¤Ï¡¢rename ¤¬¹Ô¤Ê¤ï¤ì¤ë¥Õ¥¡¥¤¥ë¤ò +.I oldpath +¤È +.I newpath +¤ÎξÊý¤Ç»²¾È¤Ç¤­¤ë½Ö´Ö¤¬¤ª¤½¤é¤¯Â¸ºß¤¹¤ë¡£ + +.I oldpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ (symbolic link) ¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¥ê¥ó¥¯¤Î̾Á°¤¬Êѹ¹¤µ¤ì¤ë¡£ +¤Þ¤¿¡¢ +.I newpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥ê¥ó¥¯¤¬¾å½ñ¤­¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä¤¬¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I oldpath +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç +.RI ( .. +¥¨¥ó¥È¥ê¤ò¹¹¿·¤¹¤ë¤Î¤ËɬÍפÊ) ½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È)¡£ +.TP +.B EBUSY +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¡¢²¿¤é¤«¤Î¥×¥í¥»¥¹¤¬»ÈÍÑÃæ +(¿ʬ¡¢¥«¥ì¥ó¥È¡¦¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê¤«¡¢¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤«¡¢ +Æɤ߹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤«¤Ç¤í¤¦) +¤â¤·¤¯¤Ï¡¢¥·¥¹¥Æ¥à¤¬»ÈÍÑÃæ (Î㤨¤Ð¥Þ¥¦¥ó¥È¡¦¥Ý¥¤¥ó¥È¤Ç¤¢¤ë) +¤Ç¤¢¤ê¡¢¥·¥¹¥Æ¥à¤¬¤³¤ì¤ò¥¨¥é¡¼¤Ç¤¢¤ë¤ÈȽÃǤ·¤¿¤¿¤á¤Ë rename ¤¬¼ºÇÔ¤·¤¿¡£ +(¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë +.B EBUSY +¤òÊÖ¤¹¤³¤È¤Ïµ¬³Ê¤Ç¤ÏÍ׵ᤵ¤ì¤Æ¤¤¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¡¢rename ¤ò¤È¤Ë¤«¤¯¼Â¹Ô¤·¤Æ¤ß¤ë¤Î¤Ï²¿¤ÎÌäÂê¤â¤Ê¤¤¡£ +¤¿¤À¤·¡¢¤½¤Î¤è¤¦¤Ê¾õ¶·¤Ç¡¢¥·¥¹¥Æ¥à¤¬Â¾¤ËÊÖ¤¹¥¨¥é¡¼¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï +.B EBUSY +¤òÊÖ¤¹¤³¤È¤¬µö¤µ¤ì¤Æ¤¤¤ë¡£) +.TP +.B EFAULT +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.IR newpath " ¤¬ " oldpath +¤Î¥Ñ¥¹Éôʬ¤ò´Þ¤ó¤Ç¤¤¤ë¡£¥Ç¥£¥ì¥¯¥È¥ê¤ò¼«Ê¬¼«¿È¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë +Êѹ¹¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤¬¤Û¤È¤ó¤É¤Ç¤¢¤ë¡£ +.TP +.B EISDIR +.I newpath +¤Ï¸ºß¤·¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤¬¡¢ +.I oldpath +¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B ELOOP +.IR oldpath " ¤Þ¤¿¤Ï " newpath +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B EMLINK +.I oldpath +¤Ï´û¤ËºÇÂç¿ô¤Þ¤Ç¤Î¥ê¥ó¥¯¤ò»ý¤Ã¤Æ¤¤¤ë¤«¡¢¤½¤ì¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç +.I newpath +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤¬ºÇÂç¿ô¤Þ¤Ç¤Î¥ê¥ó¥¯¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +.TP +.B ENAMETOOLONG +.IR oldpath " ¤Þ¤¿¤Ï " newpath " ¤¬Ä¹²á¤®¤ë¡£" +.TP +.B ENOENT +.I oldpath +¤È¤¤¤¦Ì¾Á°¤Î¥ê¥ó¥¯¤¬Â¸ºß¤·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I newpath +¤È¤¤¤¦¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I oldpath +¤« +.I newpath +¤¬¶õ¤Îʸ»úÎó¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOSPC +¥Õ¥¡¥¤¥ë¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥Ð¥¤¥¹¤Ë¿·¤·¤¤¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤ò +ºîÀ®¤¹¤ë¤¿¤á¤Î¶õ¤­¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.IR oldpath " ¤« " newpath +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬ +¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +¤Þ¤¿¤Ï +.I oldpath +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¡¢ +.I newpath +¤¬Â¸ºß¤·¤Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B ENOTEMPTY " ¤Þ¤¿¤Ï " EEXIST +.I newpath +¤¬¶õ¤Ç¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¡£¤¹¤Ê¤ï¤Á "." ¤È ".." °Ê³°¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +.TP +.BR EPERM " ¤Þ¤¿¤Ï " EACCES +.I oldpath +¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È (sticky bit) +.RB ( S_ISVTX ) +¤¬ÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢ +¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ +ºï½ü¤·¤è¤¦¤È¤¹¤ë¥Õ¥¡¥¤¥ë¤Î¥æ¡¼¥¶¡¼ ID ¤È +¤½¤Î¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È¥ê¤Î¥æ¡¼¥¶¡¼ ID ¤Î¤¤¤º¤ì¤È¤â°ìÃפ»¤º¡¢¤«¤Ä +¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¤ (Linux ¤Ç¤Ï +.B CAP_FOWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¤Ê¤¤)¡£ +¤Þ¤¿¤Ï¡¢ +.I newpath +¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¤Ç¡¢¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢ +¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ +ÃÖ¤­´¹¤¨¤è¤¦¤È¤¹¤ë¥Õ¥¡¥¤¥ë¤Î¥æ¡¼¥¶¡¼ ID ¤È +¤½¤Î¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È¥ê¤Î¥æ¡¼¥¶¡¼ ID ¤Î¤¤¤º¤ì¤È¤â°ìÃפ»¤º¡¢¤«¤Ä +¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¤ (Linux ¤Ç¤Ï +.B CAP_FOWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¤)¡£ +¤Þ¤¿¤Ï +.IR oldpath " ¤È " newpath +¤¬Â¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬¡¢Í׵ᤵ¤ì¤¿¼ïÎà¤Î̾Á°¤ÎÊѹ¹¤ò +¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EROFS +¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤ßÀìÍÑ (read-only) ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¤¢¤ë¡£ +.TP +.B EXDEV +.IR oldpath " ¤È " newpath +¤¬Æ±¤¸¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£ +(Linux ¤Ï 1 ¤Ä¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤òÊ£¿ô¤Î¥Þ¥¦¥ó¥È°ÌÃÖ¤Ë +¥Þ¥¦¥ó¥È¤¹¤ë¤³¤È¤òµö²Ä¤·¤Æ¤¤¤ë¡£ +¤·¤«¤· +.BR rename () +¤Ï¡¢¤¿¤È¤¨Æ±¤¸¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤¢¤Ã¤Æ¤â¡¢ +ÊÌ¡¹¤Î¥Þ¥¦¥ó¥È°ÌÃÖ¤ò¸Ù¤¤¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¡£) +.SH ½àµò +4.3BSD, C89, C99, POSIX.1-2001. +.SH ¥Ð¥° +NFS ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤Ï¡¢Áàºî¤¬¼ºÇÔ¤·¤¿¤«¤é¤È¤¤¤Ã¤Æ¡¢ +¥Õ¥¡¥¤¥ë¤Î̾Á°¤¬Êѹ¹¤Ç¤­¤Ê¤«¤Ã¤¿¤È·è¤á¤Æ¤«¤«¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¥µ¡¼¥Ð¤¬ rename Áàºî¤ò½ª¤¨¤Æ¤«¤é¥¯¥é¥Ã¥·¥å¤·¤¿¾ì¹ç¡¢ +¥µ¡¼¥Ð¤¬ºÆ¤ÓΩ¤Á¾å¤¬¤Ã¤¿¤È¤­¤Ë¡¢ +ºÆÁ÷¿®¤µ¤ì¤¿ RPC ¤¬½èÍý¤µ¤ì¤ë¤¬¡¢¤³¤ì¤Ï¼ºÇԤȤʤ롣 +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤ÎÌäÂê¤òÀµ¤·¤¯¼è¤ê°·¤¦¤³¤È¤¬´üÂÔ¤µ¤ì¤Æ¤¤¤ë¡£ +ƱÍͤÎÌäÂê¤Ë¤Ä¤¤¤Æ +.BR link (2) +¤Ë¤â½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mv (1), +.BR chmod (2), +.BR link (2), +.BR renameat (2), +.BR symlink (2), +.BR unlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/release/man2/renameat.2 b/release/man2/renameat.2 new file mode 100644 index 00000000..c8e47e3e --- /dev/null +++ b/release/man2/renameat.2 @@ -0,0 +1,136 @@ +.\" 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-09-05 by Yuichi SATO , LDP v2.39 +.\" +.TH RENAMEAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +renameat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë¥Õ¥¡¥¤¥ë¤Î̾Á°¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int renameat(int " olddirfd ", const char *" oldpath , +.BI " int " newdirfd ", const char *" newpath ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR renameat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +.BR renameat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.BR rename (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I oldpath +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I olddirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( rename (2) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î +ÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I oldpath +¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä +.I olddirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I oldpath +¤Ï +.RB ( rename (2) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I oldpath +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I olddirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.I newpath +¤Î²ò¼á¤Ï +.I oldpath +¤ÈƱÍͤǤ¢¤ë¤¬¡¢ +ÁêÂХѥ¹Ì¾¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I newdirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR renameat () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR rename (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR renameat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR renameat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I olddirfd +¤Þ¤¿¤Ï +.I newdirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I oldpath +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I olddirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +¤Þ¤¿¤Ï +.I newpath +¤È +.I newdirfd +¤Ë¤Ä¤¤¤Æ¡¢Æ±ÍͤΤ³¤È¤¬µ¯¤­¤Æ¤¤¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR renameat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2008. +.SH Ãí°Õ +.BR renameat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR openat (2), +.BR rename (2), +.BR path_resolution (7) diff --git a/release/man2/rmdir.2 b/release/man2/rmdir.2 new file mode 100644 index 00000000..7635182f --- /dev/null +++ b/release/man2/rmdir.2 @@ -0,0 +1,163 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 1997-01-31 by Eric S. Raymond +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-12-12, HANATAKA Shinya +.\" Updated 2003-10-11, Kentaro Shirakata +.\" Updated 2005-02-24, Akihiro MOTOKI +.\" Updated 2006-07-23, Akihiro MOTOKI, LDP v2.36 +.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: sticky bit ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È +.\"WORD: dangling symbolic link ²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: working directory ¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: root directory ¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: effective uid ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: sticky bit ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È +.\"WORD: read-only Æɤ߹þ¤ßÀìÍÑ +.\"WORD: uid ¥æ¡¼¥¶¡¼ID +.\"WORD: entry ¥¨¥ó¥È¥ê +.\"WORD: memory ¥á¥â¥ê +.\" +.TH RMDIR 2 2008-05-08 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +rmdir \- ¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int rmdir(const char *" pathname ); +.SH ÀâÌÀ +.BR rmdir () +¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤¹¤ë¡£ºï½ü¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ï¶õ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.I pathname +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¬ +¥×¥í¥»¥¹¤Î¼Â¸ú (effective) UID ¤ËÂФ·¤Æµö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +.I pathname +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¤É¤ì¤«¤Ë¸¡º÷ (¼Â¹Ô) µö²Ä¤¬¤Ê¤¤¤«¡¢ +.I pathname +¤Ë»ê¤ë¤Þ¤Ç¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤¤¤º¤ì¤«¤ËÂФ¹¤ë¸¡º÷µö²Ä¤¬¤Ê¤«¤Ã¤¿¡£ +.RB ( path_resolution (7) +¤â»²¾È¤Î¤³¤È) +.TP +.B EBUSY +.I pathname +¤¬¥·¥¹¥Æ¥à¤äÊÌ¤Î¥×¥í¥»¥¹¤Ë¤è¤ê»ÈÍÑÃæ¤Çºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +Linux ¤Ç¤Ï¡¢ +.I pathname +¤¬¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤È¤·¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤ë¤«¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.TP +.B EFAULT +.I pathname +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I pathname +¤ÎºÇ¸å¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬ +.I . +¤Ç¤¢¤ë¡£ +.TP +.B ELOOP +.I pathname +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.I pathname +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +.I pathname +¤ÎÃæ¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢²õ¤ì¤¿ (dangling) +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ (symbolic link) ¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +½½Ê¬¤Ê¥«¡¼¥Í¥ë¤Î¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I pathname +¤« +.I pathname +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¡¢¼ÂºÝ¤Ë¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B ENOTEMPTY +¥Ç¥£¥ì¥¯¥È¥ê +.I pathname +¤Ë +.IR . " ¤È " .. +°Ê³°¤Î¥¨¥ó¥È¥ê¤¬¤¢¤ë¡£¤Þ¤¿¤Ï¡¢ +.I pathname +¤ò¹½À®¤¹¤ëºÇ¸å¤ÎÍ×ÁǤ¬ +.I .. +¤Ç¤¢¤ë¡£ +POSIX.1-2001 ¤Ï¡¢¤³¤Î¾õ¶·¤Ç +.B EEXIST +¤òÊÖ¤¹¤³¤È¤òǧ¤á¤Æ¤¤¤ë¡£ +.TP +.B EPERM +.I pathname +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È(sticky-bit) +.RB ( S_ISVTX ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¡¢¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ID ¤¬ºï½ü¤·¤è¤¦¤È¤¹¤ë¥Õ¥¡¥¤¥ë¤Î +¥æ¡¼¥¶ID ¤È¤½¤Î¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È¥ê¤Î¥æ¡¼¥¶¡¼ID ¤Î¤É¤Á¤é¤È¤â°Û¤Ê¤ê¡¢ +¥×¥í¥»¥¹¤â¸¢¸Â (Linux ¤Ç¤Ï +.B CAP_FOWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤¬¤Ê¤¤¡£ +.TP +.B EPERM +.I pathname +¤ò´Þ¤ó¤Ç¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î +ºï½ü¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EROFS +.I pathname +¤¬Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¾å¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH ¥Ð¥° +NFS ¥×¥í¥È¥³¥ë¤ËÀøºß¤·¤Æ¤¤¤ë·ç´Ù¤Ë¤è¤Ã¤Æ¡¢¤Þ¤À»ÈÍÑÃæ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤¬ +ÆÍÁ³¾ÃÌǤ¹¤ë¸½¾Ý¤¬°ú¤­µ¯¤³¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR rm (1), +.BR rmdir (1), +.BR chdir (2), +.BR chmod (2), +.BR mkdir (2), +.BR rename (2), +.BR unlink (2), +.BR unlinkat (2) diff --git a/release/man2/sched_get_priority_max.2 b/release/man2/sched_get_priority_max.2 new file mode 100644 index 00000000..7a3e3e45 --- /dev/null +++ b/release/man2/sched_get_priority_max.2 @@ -0,0 +1,123 @@ +.\" 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 2006-04-14, Akihiro MOTOKI , LDP v2.29 +.\" +.\"WORD: static ÀÅŪ +.\"WORD: priority ¥×¥é¥¤¥ª¥ê¥Æ¥£ +.\"WORD: scheduling ¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +.\"WORD: algorithm ¥¢¥ë¥´¥ê¥º¥à +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: portable °Ü¿¢À­¤Î¤¢¤ë +.\"WORD: policy Êý¿Ë +.\" +.TH SCHED_GET_PRIORITY_MAX 2 2006-03-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sched_get_priority_max, sched_get_priority_min \- ÀÅŪ¥×¥é¥¤¥ª¥ê¥Æ¥£¤ÎÈϰϤò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int sched_get_priority_max(int " policy ); +.sp +.BI "int sched_get_priority_min(int " policy ); +.SH ÀâÌÀ +.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) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ + +¿ôÃÍŪ¤ËÂ礭¤Ê¥×¥é¥¤¥ª¥ê¥Æ¥£Ãͤò»ý¤Ä¥×¥í¥»¥¹¤Ï¾®¤µ¤Ê +¥×¥é¥¤¥ª¥ê¥Æ¥£Ãͤò»ý¤Ä¥×¥í¥»¥¹¤è¤êÁ°¤Ë¥¹¥±¥¸¥å¡¼¥ë¤µ¤ì¤ë¡£ +¤³¤Î¤¿¤á +.BR sched_get_priority_max () +¤¬ÊÖ¤¹ÃÍ¤Ï +.BR sched_get_priority_min () +¤¬ÊÖ¤¹Ãͤè¤ê¤âÂ礭¤¤¡£ + +Linux ¤Ç¤Ï \fBSCHED_FIFO\fP ¤È \fBSCHED_RR\fP ¤Ç¤Ï 1 ¤«¤é 99 ¤ÎÈϰϤΠ+ÀÅŪ¥×¥é¥¤¥ª¥ê¥Æ¥£¡¼¤ò»ý¤Á¡¢\fBSCHED_OTHER\fP ¤È \fBSCHED_BATCH\fP ¤Ç¤Ï +¥×¥é¥¤¥ª¥ê¥Æ¥£¤È¤·¤Æ 0 ¤ò»ý¤Ä¡£ +¤½¤ì¤¾¤ì¤ÎÊý¿Ë¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥×¥é¥¤¥ª¥ê¥Æ¥£¤ÎÈÏ°Ï¤Ï +Êѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ + +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥×¥é¥¤¥ª¥ê¥Æ¥£¤ÎÈϰϤϾ¤Î POSIX ¥·¥¹¥Æ¥à¤È +°Û¤Ê¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£¤½¤ì¤Ç¡¢°Ü¿¢À­(portable)¤Î¤¢¤ë +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï²¾ÁÛŪ¤ÊÈϰϤòÍѤ¤ +.BR sched_get_priority_max () +¤È +.BR sched_get_priority_min () +¤ÇÍ¿¤¨¤é¤ì¤¿´Ö³Ö¤Ë¥Þ¥Ã¥×¤·¤Æ»ÈÍѤ¹¤ë¤³¤È¤Ï¤¤¤¤¹Í¤¨¤Ç¤¢¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï \fBSCHED_FIFO\fP ¤È \fBSCHED_RR\fP ¤Ë¤ª¤±¤ë +ºÇÂçÃͤȺǾ®Ãͤδֳ֤ò¾¯¤Ê¤¯¤È¤â 32 ¤Ë¤¹¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ + +POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï +.BR sched_get_priority_max () +¤È +.BR sched_get_priority_min () +¤Ï \fI\fP ¤Ë +.B _POSIX_PRIORITY_SCHEDULING +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ß»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï +.BR sched_get_priority_max () +¤È +.BR sched_get_priority_min () +¤Ï»ØÄꤵ¤ì¤¿¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤Î¥×¥é¥¤¥ª¥ê¥Æ¥£¤ÎºÇÂçÃÍ/ºÇ¾®ÃͤòÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +°ú¤­¿ô \fIpolicy\fP ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤È°ìÃפ·¤Ê¤¤¡£ +.SH ½àµò +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), +.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/release/man2/sched_rr_get_interval.2 b/release/man2/sched_rr_get_interval.2 new file mode 100644 index 00000000..526f2454 --- /dev/null +++ b/release/man2/sched_rr_get_interval.2 @@ -0,0 +1,136 @@ +.\" 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" +.SH ̾Á° +sched_rr_get_interval \- »ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Î SCHED_RR ´Ö³Ö¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int sched_rr_get_interval(pid_t " pid ", struct timespec *" tp ); +.SH ÀâÌÀ +.BR sched_rr_get_interval () +¤Ï \fItp\fP ¤Ç»ØÄꤵ¤ì¤¿ \fItimespec\fP ¹½Â¤ÂÎ¤Ë +\fIpid\fP ¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Î¥é¥¦¥ó¥É¡¦¥í¥Ó¥ó»þ´ÖÎÌ +(round robin time quantum) ¤ò½ñ¤­¹þ¤à¡£ + +\fItimespec\fP ¹½Â¤ÂΤϰʲ¼¤ÎÄ̤ê¤Ç¤¢¤ë: + +.in +4n +.nf +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.fi +.in + +\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. +.\" +.\" ¥é¥¦¥ó¥É¡¦¥í¥Ó¥ó»þ´ÖÎÌ¤Ï Linux 1.3.81 ¤Ç¤ÏÊѹ¹¤Ç¤­¤Ê¤¤¡£ +.\" +.BR sched_rr_get_interval () +¤Î»ÈÍѲÄǽ¤Ê POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï +.I +¤Ç +.B _POSIX_PRIORITY_SCHEDULING +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï +.BR sched_rr_get_interval () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +¾ðÊó¤ò¥æ¡¼¥¶¶õ´Ö¤Ë¥³¥Ô¡¼¤¹¤ë»þ¤ËÌäÂ꤬µ¯¤­¤¿¡£ +.TP +.B EINVAL +PID ¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B ENOSYS +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤ (¤«¤Ê¤ê¸Å¤¤¥«¡¼¥Í¥ë¤Ë¤ª¤¤¤Æ¤Î¤ß)¡£ +.TP +.B ESRCH +\fIpid\fP ¤Î ID ¤ò»ý¤Ä¥×¥í¥»¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +POSIX.1-2001. +.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. +POSIX ¤Ç¤Ï¥é¥¦¥ó¥É¡¦¥í¥Ó¥ó»þ´ÖÎ̤ÎÂ礭¤µ¤òÀ©¸æ¤¹¤ë»ÅÁȤߤ¬µ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤·¤«¤·¡¢Linux ¤Ç¤Ï¤³¤ì¤òÊѹ¹¤¹¤ëÊýË¡¤¬Ä󶡤µ¤ì¤Æ¤ª¤ê (¤³¤ÎÊýË¡¤Ë°Ü¿¢À­¤Ï¤Ê¤¤)¡¢ +¥×¥í¥»¥¹¤Î nice ÃͤòÄ´À°¤¹¤ë¤³¤È¤Ç»þ´ÖÎ̤òÀ©¸æ¤Ç¤­¤ë +.RB ( setpriority (2) +»²¾È)¡£ +Éé¤Î nice ÃÍ (¤¹¤Ê¤ï¤Á¡¢¹â¤¤ nice ÃÍ) ¤ò³ä¤êÅö¤Æ¤ë¤È»þ´ÖÎ̤ÏŤ¯¤Ê¤ê¡¢ +Àµ¤Î nice ÃÍ (¤¹¤Ê¤ï¤Á¡¢Ä㤤 nice ÃÍ) ¤ò³ä¤êÅö¤Æ¤ë¤È»þ´ÖÎ̤Ïû¤¯¤Ê¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î»þ´ÖÎÌ¤Ï 0.1 ÉäǤ¢¤ë¡£ +nice ÃͤÎÊѹ¹¤¬»þ´ÖÎ̤ˤɤÎÄøÅٱƶÁ¤òÍ¿¤¨¤ë¤«¤Ï +¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê¿¾¯°Û¤Ê¤ë¡£ +.\" .SH ¥Ð¥° +.\" Linux 1.3.81 ¤Î»þÅÀ¤Ç¤Ï +.\" .BR sched_rr_get_interval () +.\" ¤Ï ENOSYS ¥¨¥é¡¼¤òÊÖ¤¹¡£ +.\" ¤³¤ì¤Ï SCHED_RR ¤Ï¤Þ¤À´°Á´¤Ë¤Ï¼ÂÁõ¤µ¤ì¤Æ¤ª¤é¤º¡¢ +.\" ŬÀڤ˥ƥ¹¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.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/release/man2/sched_setaffinity.2 b/release/man2/sched_setaffinity.2 new file mode 100644 index 00000000..1802c056 --- /dev/null +++ b/release/man2/sched_setaffinity.2 @@ -0,0 +1,266 @@ +.\" man2/sched_setaffinity.2 - sched_setaffinity and sched_getaffinity man page +.\" +.\" Copyright (C) 2002 Robert Love +.\" and Copyright (C) 2006 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. +.\" +.\" 2002-11-19 Robert Love - initial version +.\" 2004-04-20 mtk - fixed description of return value +.\" 2004-04-22 aeb - added glibc prototype history +.\" 2005-05-03 mtk - noted that sched_setaffinity may cause thread +.\" migration and that CPU affinity is a per-thread attribute. +.\" 2006-02-03 mtk -- Major rewrite +.\" 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 ¸¢¸Â +.\" +.TH SCHED_SETAFFINITY 2 2008-11-14 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sched_setaffinity, sched_getaffinity \- \ +¥×¥í¥»¥¹¤Î CPU affinity ¥Þ¥¹¥¯¤òÀßÄꡦ¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int sched_setaffinity(pid_t " pid ", size_t " cpusetsize , +.BI " cpu_set_t *" mask ); +.sp +.BI "int sched_getaffinity(pid_t " pid ", size_t " cpusetsize , +.BI " cpu_set_t *" mask ); +.fi +.SH ÀâÌÀ +¥×¥í¥»¥¹¤Î CPU affinity (¿ÆÏÂÅÙ) ¥Þ¥¹¥¯¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬ +¼Â¹Ô¤òµö²Ä¤µ¤ì¤Æ¤¤¤ë CPU ¤Î½¸¹ç¤ò·èÄꤹ¤ë¡£ +¥Þ¥ë¥Á¥×¥í¥»¥Ã¥µ¡¦¥·¥¹¥Æ¥à¤Ç¤Ï¡¢CPU affinity ¥Þ¥¹¥¯¤òÀßÄꤹ¤ë¤³¤È¤Ç +À­Ç½¾å¤Î¥á¥ê¥Ã¥È¤òÆÀ¤é¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +Î㤨¤Ð¡¢ÆÃÄê¤Î¥×¥í¥»¥¹¤ò°ì¤Ä¤Î CPU ¤Ë³ç¤êÉÕ¤± +(¤¹¤Ê¤ï¤Á¡¢¤½¤Î¥×¥í¥»¥¹¤Î affinity ¥Þ¥¹¥¯¤ò°ì¤Ä¤Î CPU ¤ËÀßÄꤷ)¡¢ +¾¤ÎÁ´¤Æ¤Î¥×¥í¥»¥¹¤Î affinity ¥Þ¥¹¥¯¤«¤é¤½¤Î CPU ¤ò½ü³°¤¹¤ë¤³¤È¤Ç¡¢ +³Î¼Â¤Ë¤½¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô®ÅÙ¤òºÇÂç¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤Þ¤¿¡¢¤¢¤ë¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò°ì¤Ä¤Î CPU ¤Ë¸ÂÄꤹ¤ë¤³¤È¤Ç¡¢ +°ì¤Ä¤Î CPU ¤Ç¤Î¼Â¹Ô¤òÄä»ß¤·¤Æ¤«¤éÊ̤ΠCPU ¤Ç¼Â¹Ô¤òºÆ³«¤¹¤ë¤È¤­¤ËȯÀ¸¤¹¤ë +¥­¥ã¥Ã¥·¥å̵¸ú²½ (cache invalidation) ¤Ë¤è¤ëÀ­Ç½Ì̤ÎÎô²½¤òÈò¤±¤ë¤³¤È¤â¤Ç¤­¤ë¡£ + +CPU affinity ¥Þ¥¹¥¯¤Ï¡ÖCPU ¤Î½¸¹ç¡×¤òɽ¤¹ +.I cpu_set_t +¹½Â¤ÂΤÇɽ¸½¤µ¤ì¡¢ +.I cpu_set_t +¤Ø¤Î¥Ý¥¤¥ó¥¿ +.I mask +¤Ç»ØÄꤵ¤ì¤ë¡£ +CPU ½¸¹ç¤òÁàºî¤¹¤ë¤¿¤á¤Î¥Þ¥¯¥í·²¤Ë¤Ä¤¤¤Æ¤Ï +.BR CPU_SET (3) +¤Çµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ + +.BR sched_setaffinity () +¤Ï¡¢¥×¥í¥»¥¹ID ¤¬ +.I pid +¤Î¥×¥í¥»¥¹¤Î CPU affinity ¥Þ¥¹¥¯¤ò +.I mask +¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +.I pid +¤¬ 0 ¤Î¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬»È¤ï¤ì¤ë¡£ +.I cpusetsize +°ú¤­¿ô¤Ë¤Ï +.I mask +¤¬»Ø¤¹¥Ç¡¼¥¿¤ÎŤµ (¥Ð¥¤¥Èñ°Ì) ¤Ç¤¢¤ë¡£ +Ä̾ï¤Ï¡¢¤³¤Î°ú¤­¿ô¤Ë¤Ï +.I "sizeof(cpu_set_t)" +¤ò»ØÄꤹ¤ì¤Ð¤è¤¤¡£ + +.I pid +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤¬ +.I mask +¤Ç»ØÄꤵ¤ì¤¿ CPU ¤Î¤¤¤º¤ì¤«¤Ç¸½ºß¼Â¹Ô¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¤½¤Î¥×¥í¥»¥¹¤Ï +.I mask +¤Ç»ØÄꤵ¤ì¤¿ CPU ¤Î¤¤¤º¤ì¤«¤Ë°ÜÆ°¤µ¤ì¤ë¡£ + +.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 ¥Þ¥¹¥¯¤ò½ñ¤­¹þ¤à¡£ +.I pid +¤¬ 0 ¤Î¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Þ¥¹¥¯¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR sched_setaffinity () +¤È +.BR sched_getaffinity () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +»ØÄꤵ¤ì¤¿¥á¥â¥êÈÖÃϤ¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +¥·¥¹¥Æ¥à¾å¤Ë¸½ºß¼ÂºÝ¤Ë¸ºß¤·¡¢¤«¤Ä +"cpuset" µ¡¹½¤¬²Ý¤¹À©¸Â¤Ë¤ª¤¤¤Æ¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æµö²Ä¤µ¤ì¤Æ¤¤¤ë +¥×¥í¥»¥Ã¥µ¤¬¡¢ +affinity ¥Ó¥Ã¥È¥Þ¥¹¥¯ +.I mask +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£ +"cpuset" µ¡¹½¤Ë¤Ä¤¤¤Æ¤Ï +.BR cpuset (7) +¤ò»²¾È¡£ +.TP +.B EINVAL +.RB ( sched_getaffinity () +¤È¡¢¥«¡¼¥Í¥ë 2.6.9 °ÊÁ°¤Î +.BR sched_setaffinity ()) +.I cpusetsize +¤¬¥«¡¼¥Í¥ë¤Ç»È¤ï¤ì¤Æ¤¤¤ë affinity ¥Þ¥¹¥¯¤Î¥µ¥¤¥º¤è¤ê¾®¤µ¤¤¡£ +.TP +.B EPERM +.RB ( sched_setaffinity ()) +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËŬÀÚ¤ÊÆø¢¤¬¤Ê¤«¤Ã¤¿¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï¡¢¼Â¸ú¥æ¡¼¥¶ ID ¤¬ +.I pid +¤Ç¼±Ê̤µ¤ì¤ë¥×¥í¥»¥¹¤Î¥æ¡¼¥¶ ID ¤Þ¤¿¤Ï¼Â¸ú¥æ¡¼¥¶ ID ¤ÈƱ¤¸¤Ç¤¢¤ë¤«¡¢ +.B CAP_SYS_NICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B ESRCH +¥×¥í¥»¥¹ ID \fIpid\fP ¤Î¥×¥í¥»¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +CPU affinity ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux kernel 2.5.8 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï glibc 2.3 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +ºÇ½é¤Ï¡¢glibc ¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë¤Ï +.I "unsigned int" +·¿¤Î +.I cpusetsize +°ú¤­¿ô¤¬Æþ¤Ã¤Æ¤¤¤¿¡£ +glibc 2.3.3 ¤Ç¤Ï +.I cpusetsize +°ú¤­¿ô¤¬ºï½ü¤µ¤ì¤¿¤¬¡¢glibc 2.3.4 ¤Ç +.I size_t +·¿¤ÇÉü³è¤·¤¿¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR sched_setaffinity () +¤ò¸Æ¤Ó½Ð¤·¤¿¸å¤Ï¡¢¥×¥í¥»¥¹¤¬¼ÂºÝ¤Ë¼Â¹Ô¤µ¤ì¤ë CPU ¤Î½¸¹ç¤Ï¡¢ +.I mask +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿½¸¹ç¤È¡¢¥·¥¹¥Æ¥à¾å¤Ë¼ÂºÝ¤Ë¸ºß¤¹¤ë CPU ¤Î½¸¹ç¤Î +¶¦Ä̽¸¹ç (AND) ¤È¤Ê¤ë¡£ +"cpuset" µ¡¹½¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¥×¥í¥»¥¹¤¬Æ°ºî¤¹¤ë CPU ½¸¹ç +¤ËÂФ·¤Æ¥·¥¹¥Æ¥à¤Ï¤µ¤é¤ËÀ©¸Â¤ò²Ã¤¨¤ë¤«¤â¤·¤ì¤Ê¤¤ +("cpuset" µ¡¹½¤Ë¤Ä¤¤¤Æ¤Ï +.BR cpuset (7) +¤ò»²¾È)¡£ +¥×¥í¥»¥¹¤¬Æ°ºî¤¹¤ë¼ÂºÝ¤Î CPU ½¸¹ç¤ËÂФ¹¤ëÀ©¸Â¤Ï¥«¡¼¥Í¥ë¤Ë¤è¤ê +°ÅÌۤΤ¦¤Á¤ËŬÍѤµ¤ì¤ë¡£ + +.BR sched_setscheduler (2) +¤Ë¤Ï Linux ¤Ë¤ª¤±¤ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°µ¡¹½¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀ¤¬¤¢¤ë¡£ +.PP +¼ÂºÝ¤Ë¤Ï affinity ¥Þ¥¹¥¯¤Ï¥¹¥ì¥Ã¥Éñ°Ì¤Î°À­¤Ç¡¢¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Î +³Æ¥¹¥ì¥Ã¥Éñ°Ì¤ËÆÈΩ¤·¤ÆÄ´À°¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR gettid (2) +¥³¡¼¥ë¤«¤é¤ÎÊÖ¤êÃͤò¤³¤Î¥³¡¼¥ë¤Î +.I pid +°ú¤­¿ô¤È¤·¤ÆÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.I pid +¤Ë 0 ¤ò»ØÄꤹ¤ë¤È¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤Î°À­¤¬ÀßÄꤵ¤ì¡¢ +.BR getpid (2) +¥³¡¼¥ë¤«¤é¤ÎÊÖ¤êÃͤò +.I pid +¤Ë»ØÄꤹ¤ë¤È¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Î¥á¥¤¥ó¥¹¥ì¥Ã¥É¤Î°À­¤¬ÀßÄꤵ¤ì¤ë +(POSIX ¥¹¥ì¥Ã¥É API ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR sched_setaffinity () +¤ÎÂå¤ï¤ê¤Ë +.BR pthread_setaffinity_np (3) +¤ò»ÈÍѤ¹¤ë¤³¤È)¡£ + +.BR fork (2) +·Ðͳ¤ÇÀ¸À®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î CPU affinity ¥Þ¥¹¥¯¤ò·Ñ¾µ¤¹¤ë¡£ +affinity ¥Þ¥¹¥¯¤Ï +.BR execve (2) +¤ÎÁ°¸å¤ÇÊݸ¤µ¤ì¤ë¡£ + +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï CPU affinity ¥³¡¼¥ë¤Î glibc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò +ÀâÌÀ¤·¤Æ¤¤¤ë¡£¼ÂºÝ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¾¯¤·°ã¤Ã¤Æ¤ª¤ê¡¢ +¼ÂºÝ¤Î¼ÂÁõ¤Ç¤Ï CPU ½¸¹ç¤Ï´Êñ¤Ê¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¤È¤¤¤¦¼Â¾õ¤òÈ¿±Ç¤·¡¢ +.I mask +¤Î·¿¤¬ +.IR "unsigned long *" +¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +À®¸ù»þ¤Ë¤Ï¡¢À¸¤Î +.BR sched_getaffinity () +¥·¥¹¥Æ¥à¥³¡¼¥ë¼«¿È¤Ï +.I cpumask_t +¥Ç¡¼¥¿·¿¤Î (¥Ð¥¤¥Èñ°Ì¤Î) Â礭¤µ¤òÊÖ¤¹¡£ +.I cpumask_t +¤Ï¥«¡¼¥Í¥ëÆâÉô¤Ç 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 pthread_setaffinity_np (3), +.BR CPU_SET (3), +.BR sched_getcpu (3), +.BR capabilities (7), +.BR cpuset (7) diff --git a/release/man2/sched_setparam.2 b/release/man2/sched_setparam.2 new file mode 100644 index 00000000..006fe244 --- /dev/null +++ b/release/man2/sched_setparam.2 @@ -0,0 +1,139 @@ +.\" 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 +.\" 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 +.\" +.TH SCHED_SETPARAM 2 2006-03-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sched_setparam, sched_getparam \- ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ñ¥é¥á¡¼¥¿¤ÎÀßÄê¤È¼èÆÀ¤ò¹Ô¤Ê¤¦ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sched_setparam(pid_t " pid ", const struct sched_param *" param ); +.sp +.BI "int sched_getparam(pid_t " pid ", struct sched_param *" param ); +.sp +.nf +.ta 4n +\fBstruct sched_param { + ... + int \fIsched_priority\fB; + ... +}; +.fi +.SH ÀâÌÀ +.BR sched_setparam () +¤Ï \fIpid\fP ¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë (scheduling policy) ¤Ë +´ØÏ¢¤¹¤ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë¡£ +\fIpid\fP ¤¬ 0 ¤Ê¤é¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Ñ¥é¥á¡¼¥¿¤¬ÀßÄꤵ¤ì¤ë¡£ +°ú¤­¿ô \fIparam\fP ¤Î²ò¼á¤Ï¡¢ +.I pid +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +Linux ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤ÎÀâÌÀ¤Ï +.BR sched_setscheduler (2) +¤ò»²¾È¤Î¤³¤È¡£ + +.BR sched_getparam () +¤Ï \fIpid\fP ¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ñ¥é¥á¡¼¥¿¤ò¼èÆÀ¤¹¤ë¡£ +\fIpid\fP ¤¬ 0 ¤Ê¤é¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Ñ¥é¥á¡¼¥¿¤ò¼èÆÀ¤¹¤ë¡£ + +.BR sched_setparam () +¤Ï¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤Ë¤ª¤±¤ë \fIparam\fP ¤ÎÂÅÅöÀ­¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +\fIparam\->sched_priority\fP ¤ÎÃÍ¤Ï +.BR sched_get_priority_min (2) +¤È +.BR sched_get_priority_max (2) +¤ÎÈϰϤËÆþ¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ÎÍ¥ÀèÅÙ¤ÈÊý¿Ë¤Ë´ØÏ¢¤¹¤ëÆø¢¤È¥ê¥½¡¼¥¹À©¸Â¤Î +µÄÏÀ¤Ë´Ø¤·¤Æ¤Ï +.BR sched_setscheduler (2) +¤ò»²¾È¤Î¤³¤È¡£ + +.BR sched_setparam () +¤È +.BR sched_getparam () +¤¬»ÈÍѤǤ­¤ë POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I +¤Ë +.B _POSIX_PRIORITY_SCHEDULING +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï +.BR sched_setparam () +¤È +.BR sched_getparam () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +°ú¤­¿ô \fIparam\fP ¤¬¸½ºß¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤Ë¤ª¤¤¤Æ¤Ï +̵°ÕÌ£¤Ç¤¢¤ë¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬Å¬ÀÚ¤ÊÆø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤ +(Linux ¤Ç¤Ï¡¢ +.B CAP_SYS_NICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤)¡£ +.TP +.B ESRCH +\fIpid\fP ¤ò ID ¤Ë»ý¤Ä¥×¥í¥»¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +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) +.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/release/man2/sched_setscheduler.2 b/release/man2/sched_setscheduler.2 new file mode 100644 index 00000000..dd27ca83 --- /dev/null +++ b/release/man2/sched_setscheduler.2 @@ -0,0 +1,490 @@ +.\" 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" +.SH ̾Á° +sched_setscheduler, sched_getscheduler \- +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤È¥Ñ¥é¥á¡¼¥¿¤òÀßÄê/¼èÆÀ¤¹¤ë +.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 +.SH ÀâÌÀ +.BR sched_setscheduler () +¤Ï \fIpid\fP ¤Ç»ØÄꤵ¤ì¤¿ ID ¤ò»ý¤Ä¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤ä +¤½¤ì¤Ë´ØÏ¢¤¹¤ë¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë¡£\fIpid\fP ¤¬ 0 ¤Î¾ì¹ç¤Ï +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤È¥Ñ¥é¥á¡¼¥¿¤¬ÀßÄꤵ¤ì¤ë¡£ +°ú¤­¿ô \fIparam\fP ¤Î²ò¼á¤ÏÁªÂò¤µ¤ì¤¿¥Ý¥ê¥·¡¼¤Ë¤è¤ë¡£ +¸½ºß¤Î¤È¤³¤í¡¢Linux ¤Ç¤Ï +°Ê²¼¤Ë¼¨¤¹¡ÖÄ̾ï¡×(¥ê¥¢¥ë¥¿¥¤¥à¤Ç¤Ê¤¤) ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.TP 14 +.BR SCHED_OTHER +ɸ½à¤Î¡¢¥é¥¦¥ó¥É¥í¥Ó¥ó¤Ë¤è¤ë»þʬ³ä·¿¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¡£ +.\" 2.6 ¥«¡¼¥Í¥ë¥½¡¼¥¹¤Ç¤Ï¡¢SCHED_OTHER ¤Ï¼ÂºÝ¤Ë¤Ï +.\" SCHED_NORMAL ¤È¸Æ¤Ð¤ì¤Æ¤¤¤ë¡£ +.TP +.BR SCHED_BATCH +¡Ö¥Ð¥Ã¥Á¡×·Á¼°¤Ç¤Î¥×¥í¥»¥¹¤Î¼Â¹ÔÍÑ¡£ +.TP +.BR SCHED_IDLE +¡ÖÈó¾ï¤Ë¡×Ä㤤ͥÀèÅÙ¤ÇÆ°ºî¤¹¤ë¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¡¦¥¸¥ç¥ÖÍÑ¡£ +.PP +¤É¤Î¼Â¹Ô²Äǽ¥×¥í¥»¥¹¤òÁªÂò¤¹¤ë¤«¤Ë¤Ä¤¤¤Æ¡¢¤è¤êÀµ³Î¤ÊÀ©¸æ¤òɬÍפȤ¹¤ë +»þ´Ö¤ÎÀ©Ì󤬸·¤·¤¤ÆÃÊ̤ʥ¢¥×¥ê¥±¡¼¥·¥ç¥óÍѤȤ·¤Æ¡¢ +°Ê²¼¤Î¡Ö¥ê¥¢¥ë¥¿¥¤¥à¡×¥Ý¥ê¥·¡¼¤â¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.TP 14 +.BR SCHED_FIFO +¥Õ¥¡¡¼¥¹¥È¥¤¥ó¡¢¥Õ¥¡¡¼¥¹¥È¥¢¥¦¥È·¿¤Î¥Ý¥ê¥·¡¼¡£ +.TP +.BR SCHED_RR +¥é¥¦¥ó¥É¥í¥Ó¥ó·¿¤Î¥Ý¥ê¥·¡¼¡£ +.PP +¤³¤ì¤é¤Î¥Ý¥ê¥·¡¼¤Î¤½¤ì¤¾¤ì¤ÎÆ°ºî¤Ë¤Ä¤¤¤Æ¤Ï°Ê²¼¤ÇÀâÌÀ¤¹¤ë¡£ + +.BR sched_getscheduler () +¤Ï \fIpid\fP ¤Ç¼±Ê̤µ¤ì¤ë¥×¥í¥»¥¹¤Ë¸½ºßŬÍѤµ¤ì¤Æ¤¤¤ë +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤ò¿Ò¤Í¤ë¡£\fIpid\fP ¤¬ 0 ¤Ê¤é¤Ð¡¢¸Æ¤Ó½Ð¤·¤¿ +¥×¥í¥»¥¹¼«¿È¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.\" +.SS ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼ (scheduling policy) +¥¹¥±¥¸¥å¡¼¥é (scheduler) ¤È¤Ï¥«¡¼¥Í¥ë¤Î¹½À®Í×ÁǤǡ¢ +¼¡¤Ë CPU ¤Ç¼Â¹Ô¤µ¤ì¤ë¼Â¹Ô²Äǽ¤Ê¥×¥í¥»¥¹¤ò·èÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£ +³Æ¡¹¤Î¥×¥í¥»¥¹¤Ë¤Ï¡¢¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤È +¡ÖÀÅŪ¡×¤Ê¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Í¥ÀèÅÙ \fIsched_priority\fP ¤¬ÂбþÉÕ¤±¤é¤ì¡¢ +¤³¤ì¤é¤ÎÀßÄê¤Ï +.BR sched_setscheduler () +¤ÇÊѹ¹¤Ç¤­¤ë¡£ +¥¹¥±¥¸¥å¡¼¥é¤Ï¡¢¥·¥¹¥Æ¥à¾å¤ÎÁ´¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤È +ÀÅŪͥÀèÅ٤˴ؤ¹¤ëÃμ±¤Ë´ð¤Å¤¤¤Æ·èÄê¤ò¹Ô¤¦¡£ + +Ä̾ï¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼ +(\fBSCHED_OTHER\fP, \fBSCHED_IDLE\fP, \fBSCHED_BATCH\fP) +¤Î²¼¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤ë¥×¥í¥»¥¹¤Ç¤Ï¡¢ +\fIsched_priority\fP ¤Ï¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Î·èÄê¤Ë»ÈÍѤµ¤ì¤Ê¤¤ +(\fIsched_priority\fP ¤Ë¤Ï 0 ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ + +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼ (\fBSCHED_FIFO\fP, \fBSCHED_RR\fP) +¤Î²¼¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤ë¥×¥í¥»¥¹¤Ï¡¢ +\fIsched_priority\fP ¤ÎÃÍ¤Ï 1 (ºÇÄã) ¤«¤é 99 (ºÇ¹â) ¤ÎÈϰϤȤʤë +(¿ô»ú¤«¤éʬ¤«¤ë¤è¤¦¤Ë¡¢¥ê¥¢¥ë¥¿¥¤¥à¡¦¥×¥í¥»¥¹¤Ï¾ï¤ËÄ̾ï¤Î¥×¥í¥»¥¹¤è¤ê¤â +¹â¤¤Í¥ÀèÅÙ¤ò»ý¤Ä)¡£ +¤³¤³¤ÇÃí°Õ¤¹¤Ù¤­¤Ê¤Î¤Ï¡¢POSIX.1-2001 ¤¬Í׵ᤷ¤Æ¤¤¤ë¤Î¤Ï¡¢ +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥Ý¥ê¥·¡¼¤Î¼ÂÁõ¤Ë¤ª¤¤¤ÆºÇÄã 32 ¼ïÎà¤Î°Û¤Ê¤ëÍ¥ÀèÅÙ¥ì¥Ù¥ë¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤ë¤³¤È¤À¤±¤Ç¤¢¤ê¡¢¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¤³¤ÎºÇÄã¸Â¤Î¿ô¤Î +Í¥ÀèÅÙ¤·¤«Ä󶡤µ¤ì¤Æ¤¤¤Ê¤¤¡¢¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +.BR sched_get_priority_min (2) +¤È +.BR sched_get_priority_max (2) +¤ò»È¤Ã¤Æ¡¢¤¢¤ë¥Ý¥ê¥·¡¼¤¬¥µ¥Ý¡¼¥È¤¹¤ëÍ¥ÀèÅÙ¤ÎÈϰϤòÄ´¤Ù¤ë¤Ù¤­¤Ç¤¢¤ë¡£ + +³µÇ°¤È¤·¤Æ¤Ï¡¢ +¥¹¥±¥¸¥å¡¼¥é¤Ï¤½¤Î \fIsched_priority\fP ¤ÎÃͤ½¤ì¤¾¤ì¤ËÂФ·¤Æ +¼Â¹Ô²Äǽ¤Ê¥×¥í¥»¥¹¤Î¥ê¥¹¥È¤ò´ÉÍý¤·¤Æ¤¤¤ë¡£ +¤É¤Î¥×¥í¥»¥¹¤ò¼¡¤Ë¼Â¹Ô¤¹¤ë¤«¤ò·èÄꤹ¤ë¤¿¤á¤Ë¡¢ +¥¹¥±¥¸¥å¡¼¥é¤ÏÀÅŪͥÀèÅ٤κǤâ¹â¤¤¶õ¤Ç¤Ê¤¤¥ê¥¹¥È¤òõ¤·¤Æ¡¢ +¤½¤Î¥ê¥¹¥È¤ÎÀèƬ¤Î¥×¥í¥»¥¹¤òÁªÂò¤¹¤ë¡£ + +³Æ¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤Ï¡¢ +¤½¤Î¥×¥í¥»¥¹¤¬Æ±¤¸ÀÅŪͥÀèÅÙ¤ò»ý¤Ä¥×¥í¥»¥¹¤Î¥ê¥¹¥È¤ÎÃæ¤Î¤É¤³¤ËÁÞÆþ¤µ¤ì¡¢ +¤³¤Î¥ê¥¹¥È¤ÎÃæ¤ò¤É¤Î¤è¤¦¤Ë°ÜÆ°¤¹¤ë¤«¤ò·èÄꤹ¤ë¡£ + +Á´¤Æ¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ï¥×¥ê¥¨¥ó¥×¥Æ¥£¥Ö (preemptive) ¤Ç¤¢¤ë: +¤è¤ê¹â¤¤Í¥ÀèÅÙ¤Î¥×¥í¥»¥¹¤¬¼Â¹Ô²Äǽ¤Ë¤Ê¤ë¤È¡¢¸½ºß¼Â¹ÔÃæ¤Î¥×¥í¥»¥¹¤Ï¼Â¹Ô¸¢¤ò +¼è¤ê¾å¤²¤é¤ì (preempted)¡¢¤½¤Î¥×¥í¥»¥¹¤ÎÀÅŪͥÀèÅÙ¥ì¥Ù¥ë¤ÎÂÔ¤Á¥ê¥¹¥È¤Ë +Ìᤵ¤ì¤ë¡£¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤ÏƱ¤¸ÀÅŪͥÀèÅÙ¤ò»ý¤Ä¼Â¹Ô²Äǽ¤Ê +¥×¥í¥»¥¹¤Î¥ê¥¹¥È¤ÎÃæ¤Ç½çÈ֤Τߤò·èÄꤹ¤ë¡£ +.SS SCHED_FIFO: ¥Õ¥¡¡¼¥¹¥È¥¤¥ó¡¦¥Õ¥¡¡¼¥¹¥È¥¢¥¦¥È¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +\fBSCHED_FIFO\fP ¤Ï 0 ¤è¤êÂ礭¤ÊÀÅŪͥÀèÅ٤ǤΤ߻ÈÍѤǤ­¤ë¡£¤³¤Î¥Ý¥ê¥·¡¼¤Ç¤Ï¡¢ +\fBSCHED_FIFO\fP ¥×¥í¥»¥¹¤¬¼Â¹Ô²Äǽ¤Ë¤Ê¤Ã¤¿¾ì¹ç¡¢ +¤½¤Î¥Ý¥ê¥·¡¼¤¬ \fBSCHED_OTHER\fP¡¢ \fBSCHED_BATCH\fP¡¢ \fBSCHED_IDLE\fP ¤Î +¸½ºß¼Â¹ÔÃæ¤Î¥×¥í¥»¥¹¤Ïľ¤Á¤Ë¼Â¹Ô¸¢¤ò¼è¤ê¾å¤²¤é¤ì¤ë¡£ +\fBSCHED_FIFO\fP ¤Ï»þʬ³ä¤Î¤Ê¤¤Ã±½ã¤Ê¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥¢¥ë¥´¥ê¥º¥à¤Ç¤¢¤ë¡£ +\fBSCHED_FIFO\fP ¥Ý¥ê¥·¡¼¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤ë¥×¥í¥»¥¹¤Ë¤Ï°Ê²¼¤Î +¥ë¡¼¥ë¤¬Å¬ÍѤµ¤ì¤ë: +.IP * 3 +¤è¤ê¹â¤¤Í¥ÀèÅ٤ξ¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ¼è¤Ã¤ÆÂå¤ï¤é¤ì¤¿ +\fBSCHED_FIFO\fP ¥×¥í¥»¥¹¤Ï¤½¤ÎÍ¥ÀèÅ٤Υꥹ¥È¤ÎÀèƬ¤Ëα¤Þ¤ê³¤±¡¢ +¤è¤ê¹â¤¤Í¥ÀèÅÙ¤Î¥×¥í¥»¥¹Á´¤Æ¤¬Ää»ß (block) ¤·¤¿¾ì¹ç¤Ë¼Â¹Ô¤òºÆ³«¤¹¤ë¡£ +.IP * +\fBSCHED_FIFO\fP ¥×¥í¥»¥¹¤¬¼Â¹Ô²Äǽ¤Ë¤Ê¤Ã¤¿»þ¡¢¤½¤ÎÍ¥ÀèÅ٤Υꥹ¥È¤ÎºÇ¸å +¤ËÁÞÆþ¤µ¤ì¤ë¡£ +.IP * +.BR sched_setscheduler () +¤ä +.BR sched_setparam (2) +¤Ï +\fIpid\fP ¤Ç»ØÄꤵ¤ì¤¿ \fBSCHED_FIFO\fP (¤Þ¤¿¤Ï \fBSCHED_RR\fP) ¥×¥í¥»¥¹¤¬ +¼Â¹Ô²Äǽ¤Ê¾ì¹ç¡¢¥ê¥¹¥È¤ÎºÇ½é¤ËÃÖ¤¯¡£ +·ë²Ì¤È¤·¤Æ¡¢¤â¤·Í¥ÀèÅÙ¤¬Æ±¤¸¤À¤Ã¤¿¾ì¹ç¡¢ +¸½ºß¼Â¹ÔÃæ¤Î¥×¥í¥»¥¹¤ËÀè¤ó¤¸¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +(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 * +.BR sched_yield (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¥ê¥¹¥È¤ÎºÇ¸å¤ËÃÖ¤«¤ì¤ë¡£ +.PP +¤½¤Î¾¤Î¥¤¥Ù¥ó¥È¤Ë¤è¤Ã¤Æ \fBSCHED_FIFO\fP ¥Ý¥ê¥·¡¼¤Ç +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤ë¥×¥í¥»¥¹¤¬Æ±¤¸Í¥ÀèÅ٤μ¹ԲÄǽ¤Ê +¥×¥í¥»¥¹¤ÎÂÔ¤Á¥ê¥¹¥È¤ÎÃæ¤ò°ÜÆ°¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ + +\fBSCHED_FIFO\fP ¥×¥í¥»¥¹¤Ï I/O Í×µá¤Ë¤è¤Ã¤ÆÄä»ß¤¹¤ë¤«¡¢ +¤è¤ê¹â¤¤Í¥ÀèÅÙ¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤ÆÃÖ¤­¤«¤¨¤é¤ì¤ë¤«¡¢ +.BR sched_yield (2) +¤ò¸Æ¤Ó½Ð¤¹¤Þ¤Ç¼Â¹Ô¤ò³¤±¤ë¡£ +.SS SCHED_RR: ¥é¥¦¥ó¥É¡¦¥í¥Ó¥ó (round robin) ¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +\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 +.\" +.SS SCHED_OTHER: Linux ¤Î¥Ç¥Õ¥©¥ë¥È¤Î»þʬ³ä¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +\fBSCHED_OTHER\fP ¤ÏÀÅŪͥÀèÅÙ 0 ¤Ç¤Î¤ß»ÈÍѤǤ­¤ë¡£ +\fBSCHED_OTHER\fP ¤Ï Linux ɸ½à¤Î»þʬ³ä¥¹¥±¥¸¥å¡¼¥é¤Ç¡¢ +ÆÃÊ̤ʥꥢ¥ë¥¿¥¤¥àµ¡¹½¤òɬÍפȤ·¤Æ¤¤¤Ê¤¤Á´¤Æ¤Î¥×¥í¥»¥¹¤Ç»ÈÍѤµ¤ì¤ë¡£ +¼Â¹Ô¤¹¤ë¥×¥í¥»¥¹¤Ï¡¢ÀÅŪͥÀèÅÙ 0 ¤Î¥ê¥¹¥È¤«¤é¡¢¤³¤Î¥ê¥¹¥È¤ÎÃæ¤À¤±¤Ç +·èÄꤵ¤ì¤ë¡ÖưŪ¤Ê¡×Í¥ÀèÅÙ (dynamic priority) ¤Ë´ð¤¤¤Æ·èÄꤵ¤ì¤ë¡£ +ưŪ¤ÊÍ¥ÀèÅÙ¤Ï +.RB ( nice (2) +¤ä +.BR setpriority (2) +¤Ë¤è¤êÀßÄꤵ¤ì¤ë) nice Ãͤ˴ð¤Å¤¤¤Æ·èÄꤵ¤ì¤ë¤â¤Î¤Ç¡¢ +ñ°Ì»þ´ÖËè¤Ë¡¢¥×¥í¥»¥¹¤¬¼Â¹Ô²Äǽ¤À¤¬¡¢¥¹¥±¥¸¥å¡¼¥é¤Ë¤è¤ê¼Â¹Ô¤¬µñÈݤµ¤ì¤¿ +¾ì¹ç¤Ë¥¤¥ó¥¯¥ê¥á¥ó¥È¤µ¤ì¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢Á´¤Æ¤Î \fBSCHED_OTHER\fP ¥×¥í¥»¥¹¤Ç¤Î¸øÊ¿À­¤¬Êݾڤµ¤ì¤ë¡£ +.\" +.SS SCHED_BATCH: ¥Ð¥Ã¥Á¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +(Linux 2.6.16 °Ê¹ß) +\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. +¤³¤Î¥Ý¥ê¥·¡¼¤Ï¡¢ÈóÂÐÏÃŪ¤Ê½èÍý¤À¤¬¤½¤Î nice Ãͤò²¼¤²¤¿¤¯¤Ê¤¤½èÍý¤ä¡¢ +(½èÍý¤Î¥¿¥¹¥¯´Ö¤Ç) ;·×¤Ê¥¿¥¹¥¯¤ÎÃÖ¤­´¹¤¨¤Î¸¶°ø¤È¤¢¤ëÂÐÏÃŪ¤Ê½èÍý¤Ê¤·¤Ç +³ÎÄêŪ¤Ê (deterministic) ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤òŬÍѤ·¤¿¤¤½èÍý¤Ë +ÂФ·¤ÆÍ­¸ú¤Ç¤¢¤ë¡£ +.\" +.SS SCHED_IDLE: Èó¾ï¤ËÍ¥ÀèÅÙ¤ÎÄ㤤¥¸¥ç¥Ö¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +(Linux 2.6.23 °Ê¹ß) +\fBSCHED_IDLE\fP ¤ÏÀÅŪͥÀèÅÙ 0 ¤Ç¤Î¤ß»ÈÍѤǤ­¤ë¡£ +¤³¤Î¥Ý¥ê¥·¡¼¤Ç¤Ï¥×¥í¥»¥¹¤Î nice Ãͤϥ¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ë±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡£ + +Èó¾ï¤ËÄ㤤ͥÀèÅ٤ǤΥ¸¥ç¥Ö¤Î¼Â¹Ô¤òÌÜŪ¤È¤·¤¿¤â¤Î¤Ç¤¢¤ë +(Èó¾ï¤ËÄ㤤ͥÀèÅ٤Ȥϡ¢¥Ý¥ê¥·¡¼ +.B SCHED_OTHER +¤« +.B SCHED_BATCH +¤Ç¤Î nice ÃÍ +19 ¤è¤ê¤µ¤é¤ËÄ㤤ͥÀèÅ٤Ǥ¢¤ë)¡£ +.\" +.SS Æø¢¤È¥ê¥½¡¼¥¹À©¸Â +2.6.12 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +Æø¢¥×¥í¥»¥¹ +.RB ( CAP_SYS_NICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤À¤±¤¬ 0 °Ê³°¤ÎÀÅŪͥÀèÅÙ¤òÀßÄꤹ¤ë +(¤¹¤Ê¤ï¤Á¡¢¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤òÀßÄꤹ¤ë) ¤³¤È¤¬¤Ç¤­¤ë¡£ +ÈóÆø¢¥×¥í¥»¥¹¤¬¤Ç¤­¤ëÊѹ¹¤Ï +.B SCHED_OTHER +¥Ý¥ê¥·¡¼¤òÀßÄꤹ¤ë¤³¤È¤À¤±¤Ç¤¢¤ê¡¢¤µ¤é¤Ë¤³¤ÎÊѹ¹¤ò¹Ô¤¨¤ë¤Î¤Ï +.BR sched_setscheduler () +¤Î¸Æ¤Ó½Ð¤·¸µ¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬¥Ý¥ê¥·¡¼¤ÎÊѹ¹ÂÐ¾Ý¥×¥í¥»¥¹ +.RI ( pid +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹) ¤Î¼Â¥æ¡¼¥¶ ID ¤«¼Â¸ú¥æ¡¼¥¶ ID ¤È +°ìÃפ¹¤ë¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ + +Linux 2.6.12 °Ê¹ß¤Ç¤Ï¡¢¥ê¥½¡¼¥¹À©¸Â +.B RLIMIT_RTPRIO +¤¬ÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤¬ +.B SCHED_RR +¤È +.B SCHED_FIFO +¤Î¾ì¹ç¤Î¡¢ÈóÆø¢¥×¥í¥»¥¹¤ÎÀÅŪͥÀèÅ٤ξå¸Â¤òÄê¤á¤Æ¤¤¤ë¡£ +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤ÈÍ¥ÀèÅÙ¤òÊѹ¹¤¹¤ëºÝ¤Î¥ë¡¼¥ë¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.IP * 2 +ÈóÆø¢¥×¥í¥»¥¹¤Ë 0 °Ê³°¤Î +.B RLIMIT_RTPRIO +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +ÈóÆø¢¥×¥í¥»¥¹¤Ï¤½¤Î¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤ÈÍ¥ÀèÅÙ¤ò +Êѹ¹¤Ç¤­¤ë¤¬¡¢Í¥ÀèÅÙ¤ò¸½ºß¤Î¼«¿È¤ÎÍ¥ÀèÅÙ¤È +.B RLIMIT_RTPRIO +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤ÎÂ礭¤¤Êý¤è¤ê¤â¹â¤¤ÃͤËÀßÄê¤Ç¤­¤Ê¤¤¤È¤¤¤¦À©¸Â¤¬²Ý¤µ¤ì¤ë¡£ +.IP * +.B RLIMIT_RTPRIO +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤¬ 0 ¤Î¾ì¹ç¡¢Í¥ÀèÅÙ¤ò²¼¤²¤ë¤«¡¢ +¥ê¥¢¥ë¥¿¥¤¥à¤Ç¤Ê¤¤¥Ý¥ê¥·¡¼¤ØÀÚ¤êÂؤ¨¤ë¤«¤ÎÊѹ¹¤À¤±¤¬µö²Ä¤µ¤ì¤ë¡£ +.IP * +¤¢¤ëÈóÆø¢¥×¥í¥»¥¹¤¬ÊÌ¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ¤³¤ì¤é¤ÎÊѹ¹¤ò¹Ô¤¦ºÝ¤Ë¤â¡¢ +Ʊ¤¸¥ë¡¼¥ë¤¬Å¬ÍѤµ¤ì¤ë¡£Êѹ¹¤ò¹Ô¤¨¤ë¤Î¤Ï¡¢Êѹ¹¤ò¹Ô¤ª¤¦¤È¤¹¤ë¥×¥í¥»¥¹ +¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬Êѹ¹ÂÐ¾Ý¤Î¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID ¤«¼Â¸ú¥æ¡¼¥¶ ID ¤È +°ìÃפ·¤Æ¤¤¤ë¾ì¹ç¤Ë¸Â¤é¤ì¤ë¡£ +.IP * +.B SCHED_IDLE +¤Ë¤ÏÆÃÊ̤ʥ롼¥ë¤¬Å¬ÍѤµ¤ì¡¢ +¤³¤Î¥Ý¥ê¥·¡¼¤Î²¼¤ÇÆ°ºî¤¹¤ëÈóÆø¢¥×¥í¥»¥¹¤Ï¡¢¥ê¥½¡¼¥¹À©¸Â +.B RLIMIT_RTPRIO +¤ÎÃͤˤ«¤«¤ï¤é¤º¼«¿È¤Î¥Ý¥ê¥·¡¼¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.PP +Æø¢¥×¥í¥»¥¹ +.RB ( CAP_SYS_NICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Î¾ì¹ç¡¢ +.B RLIMIT_RTPRIO +¤ÎÀ©¸Â¤Ï̵»ë¤µ¤ì¤ë; +¸Å¤¤¥«¡¼¥Í¥ë¤ÈƱ¤¸¤è¤¦¤Ë¡¢¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤ÈÍ¥ÀèÅÙ¤ËÂФ· +Ǥ°Õ¤ÎÊѹ¹¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.B RLIMIT_RTPRIO +¤Ë´Ø¤¹¤ë¤â¤Ã¤È¾Ü¤·¤¤¾ðÊó¤Ï +.BR getrlimit (2) +¤ò»²¾È¤Î¤³¤È¡£ +.SS ±þÅú»þ´Ö (response time) +I/O ÂÔ¤Á¤ÇÄä»ß¤·¤¿¤è¤ê¹â¤¤Í¥ÀèÅÙ¤Î¥×¥í¥»¥¹¤ÏºÆ¤Ó¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤ë +Á°¤Ë¤¤¤¯¤é¤«¤Î±þÅú»þ´Ö¤¬¤«¤«¤ë¡£¥Ç¥Ð¥¤¥¹¡¦¥É¥é¥¤¥Ð¡¼¤ò½ñ¤¯¾ì¹ç¤Ë¤Ï +.\" .BR request_irq (9) +.\" ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë +"slow interrupt" ³ä¤ê¹þ¤ß¥Ï¥ó¥É¥é¡¼¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç +¤³¤Î±þÅú»þ´Ö¤ò·àŪ¤Ë¸º¾¯¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SS ¤½¤Î¾ +»Ò¥×¥í¥»¥¹¤Ï +.BR fork (2) +¤ÎºÝ¤Ë¿Æ¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤È¥Ñ¥é¥á¡¼¥¿¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¡¢¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤È¥Ñ¥é¥á¡¼¥¿¤ÏÊÝ»ý¤µ¤ì¤ë¡£ + +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥×¥í¥»¥¹¤ÏÂçÄñ¡¢¥Ú¡¼¥¸¥ó¥°¤ÎÂÔ¤Á»þ´Ö¤òÈò¤±¤ë¤¿¤á¤Ë +.BR mlock (2) +¤ä +.BR mlockall (2) +¤ò»È¤Ã¤Æ¥á¥â¥ê¡¦¥í¥Ã¥¯¤ò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +\fBSCHED_FIFO\fP ¤ä \fBSCHED_RR\fP ¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤ë +¥×¥í¥»¥¹¤¬Ää»ß¤»¤º¤Ë̵¸Â¥ë¡¼¥×¤Ë´Ù¤ë¤È¡¢ +¾¤ÎÁ´¤Æ¤Î¤è¤êÄ㤤ͥÀèÅÙ¤Î¥×¥í¥»¥¹¤ò±Êµ×¤ËÄä»ß (block) ¤µ¤»¤Æ¤·¤Þ¤¦¤Î¤Ç¡¢ +¥½¥Õ¥È¥¦¥§¥¢³«È¯¼Ô¤Ï¥³¥ó¥½¡¼¥ë¤Î¥·¥§¥ë¤ÎÀÅŪͥÀèÅÙ¤ò¥Æ¥¹¥È¤¹¤ë +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤è¤ê¤â¾ï¤Ë¹â¤¯ÊݤĤ٤­¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë¤è¤Ã¤Æ´üÂÔÄ̤ê¤ËÄä»ß¤·¤¿¤ê½ªÎ»¤·¤¿¤ê¤·¤Ê¤¤¥ê¥¢¥ë¥¿¥¤¥à¡¦ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¶ÛµÞ½ªÎ»¤µ¤»¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤ë¡£ +.BR getrlimit (2) +¤Î¥ê¥½¡¼¥¹À©¸Â +.B RLIMIT_RTTIME +¤ÎÀâÌÀ¤â»²¾È¤Î¤³¤È¡£ + +POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï \fI\fP ¤Ë +.B _POSIX_PRIORITY_SCHEDULING +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ß +.BR sched_setscheduler () +¤È +.BR sched_getscheduler () +¤¬»ÈÍѤǤ­¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR sched_setscheduler () +¤Ï 0 ¤òÊÖ¤¹¡£ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR sched_getscheduler () +¤Ï¸½ºß¤Î¤½¤Î¥×¥í¥»¥¹¤Î¥Ý¥ê¥·¡¼ (ÈóÉé¤ÎÀ°¿ô) ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼ \fIpolicy\fP ¤¬´Ö°ã¤Ã¤Æ¤¤¤ë¤«¡¢ +\fIparam\fP ¤¬¤½¤Î¥Ý¥ê¥·¡¼¤Ç¤Ï°ÕÌ£¤ò¤Ê¤µ¤Ê¤¤¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬Å¬ÀÚ¤ÊÆø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ESRCH +ID¤¬ \fIpid\fP ¤Î¥×¥í¥»¥¹¤¬¸«¤Ä¤«¤é¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001 (⤷¡¢²¼µ­¤Î¥Ð¥°¤ÎÀá¤â»²¾È)¡£ +\fBSCHED_BATCH\fP ¤È \fBSCHED_IDLE\fP ¥Ý¥ê¥·¡¼¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +POSIX.1 ¤Ï¡¢ÈóÆø¢¥×¥í¥»¥¹¤¬ +.BR sched_setscheduler () +¤ò¸Æ¤Ó½Ð¤¹¤¿¤á¤ËɬÍפʸ¢¸Â¤Î¾ÜºÙ¤òµ¬Äꤷ¤Æ¤ª¤é¤º¡¢ +¾ÜºÙ¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤ê°Û¤Ê¤ë¡£ +Î㤨¤Ð¡¢Solaris 7 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID ¤Þ¤¿¤Ï¼Â¸ú¥æ¡¼¥¶ ID ¤¬ +ÀßÄêÂÐ¾Ý¤Î¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID ¤«Êݸ (save) set-user-ID ¤È +°ìÃפ·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡¢¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.PP +¤â¤È¤â¤È¤Ï¡¢É¸½à¤Î Linux ¤Ï°ìÈÌÌÜŪ¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤È¤·¤Æ +À߷פµ¤ì¤Æ¤ª¤ê¡¢¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¤äÂÐÏÃŪ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¡¢ +¥ê¥¢¥ë¥¿¥¤¥àÀ­¤ÎÍ׵᤬¸·¤·¤¯¤Ê¤¤¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó +(ÉáÄ̤ϥ¿¥¤¥ß¥ó¥°¤Î±þÅú´ü¸Â (deadline) ¤òËþ¤¿¤¹É¬Íפ¬¤¢¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó) +¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤¿¡£ +Linux ¥«¡¼¥Í¥ë 2.6 ¤Ç¤Ï¡¢ +¥«¡¼¥Í¥ë¤Î¥×¥ê¥¨¥ó¥×¥·¥ç¥ó (¥¿¥¹¥¯¤ÎÃÖ¤­´¹¤¨) ¤¬²Äǽ¤Ç¤¢¤ê¡¢ +¿·¤¿¤ËƳÆþ¤µ¤ì¤¿ O(1) ¥¹¥±¥¸¥å¡¼¥é¤Ë¤è¤ê¡¢ +¥¢¥¯¥Æ¥£¥Ö¤Ê¥¿¥¹¥¯¤Î¿ô¤Ë´Ø¤ï¤é¤º¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ËɬÍפʻþ´Ö¤Ï +¸ÇÄê¤Ç³ÎÄêŪ (deterministic) ¤Ç¤¢¤ë¤³¤È¤¬Êݾڤµ¤ì¤Æ¤¤¤ë¡£ +¤½¤ì¤Ë¤â´Ø¤ï¤é¤º¡¢¥«¡¼¥Í¥ë 2.6.17 ¤Þ¤Ç¤Ï +¿¿¤Î¥ê¥¢¥ë¥¿¥¤¥à¡¦¥³¥ó¥Ô¥å¡¼¥Æ¥£¥ó¥°¤Ï¼Â¸½¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.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. +¥«¡¼¥Í¥ë 2.6.18 ¤«¤é¸½ºß¤Þ¤Ç¡¢ +Linux ¤Ï½ù¡¹¤Ë¥ê¥¢¥ë¥¿¥¤¥àµ¡Ç½¤òÈ÷¤¨¤Ä¤Ä¤¢¤ë¤¬¡¢ +¤³¤ì¤é¤Îµ¡Ç½¤Î¤Û¤È¤ó¤É¤Ï¡¢ +Ingo Molnar, Thomas Gleixner, Steven Rostedt ¤é¤Ë¤è¤Ã¤Æ³«È¯¤µ¤ì¤¿¡¢ +°ÊÁ°¤Î +.I realtime-preempt +¥Ñ¥Ã¥Á¤«¤é¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥Ñ¥Ã¥Á¤¬ËÜή¤Î¥«¡¼¥Í¥ë¤Ë´°Á´¤Ë¥Þ¡¼¥¸¤µ¤ì¤ë¤Þ¤Ç¤Ï +(¥Þ¡¼¥¸¤Î´°Î»¤Ï¥«¡¼¥Í¥ë 2.6.30 ¤¢¤¿¤ê¤ÎͽÄê)¡¢ +ºÇ¹â¤Î¥ê¥¢¥ë¥¿¥¤¥àÀ­Ç½¤òãÀ®¤¹¤ë¤Ë¤Ï realtime-preempt ¥Ñ¥Ã¥Á¤ò +ÁȤ߹þ¤Þ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤é¤Î¥Ñ¥Ã¥Á¤Ï +.in +4n +.nf + +patch-\fIkernelversion\fP-rt\fIpatchversion\fP +.fi +.in +¤È¤¤¤¦Ì¾Á°¤Ç¡¢ +.I http://www.kernel.org/pub/linux/kernel/projects/rt/ +¤«¤é¥À¥¦¥ó¥í¡¼¥É¤Ç¤­¤ë¡£ + +¤³¤Î¥Ñ¥Ã¥Á¤¬Å¬ÍѤµ¤ì¤º¡¢¤«¤Ä¥Ñ¥Ã¥Á¤ÎÆâÍƤÎËÜή¤Î¥«¡¼¥Í¥ë¤Ø¤Î¥Þ¡¼¥¸¤¬ +´°Î»¤¹¤ë¤Þ¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤ÎÀßÄê¤Ç¤Ï +.BR CONFIG_PREEMPT_NONE , +.BR CONFIG_PREEMPT_VOLUNTARY , +.B CONFIG_PREEMPT_DESKTOP +¤Î 3¤Ä¤Î¥×¥ê¥¨¥ó¥×¥·¥ç¥ó¡¦¥¯¥é¥¹ (preemption class) ¤À¤±¤¬Ä󶡤µ¤ì¤ë¡£ +¤³¤ì¤é¤Î¥¯¥é¥¹¤Ç¤Ï¡¢ºÇ°­¤Î¾ì¹ç¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Ãٱ䤬¤½¤ì¤¾¤ì +Á´¤¯¸º¤é¤Ê¤¤¡¢¤¤¤¯¤é¤«¸º¤ë¡¢¤«¤Ê¤ê¸º¤ë¡£ + +¥Ñ¥Ã¥Á¤¬Å¬ÍѤµ¤ì¤¿¾ì¹ç¡¢¤Þ¤¿¤Ï¥Ñ¥Ã¥Á¤ÎÆâÍƤÎËÜή¤Î¥«¡¼¥Í¥ë¤Ø¤Î¥Þ¡¼¥¸¤¬ +´°Î»¤·¤¿¸å¤Ç¤Ï¡¢¾åµ­¤Ë²Ã¤¨¤ÆÀßÄê¹àÌܤȤ·¤Æ +.B CONFIG_PREEMPT_RT +¤¬ÍøÍѲÄǽ¤Ë¤Ê¤ë¡£¤³¤Î¹àÌܤòÁªÂò¤¹¤ë¤È¡¢ +Linux ¤ÏÄ̾ï¤Î¥ê¥¢¥ë¥¿¥¤¥à¡¦¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤ËÊѿȤ¹¤ë¡£ +¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR sched_setscheduler () +¤ÇÁªÂò¤Ç¤­¤ë FIFO ¤È RR ¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤Ï¡¢ +¿¿¤Î¥ê¥¢¥ë¥¿¥¤¥àÍ¥ÀèÅÙ¤ò»ý¤Ä¥×¥í¥»¥¹¤òºÇ°­¤Î¾ì¹ç¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Ãٱ䤬 +ºÇ¾®¤È¤Ê¤ë´Ä¶­¤ÇÆ°ºî¤µ¤»¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.SH ¥Ð¥° +POSIX ¤Ç¤Ï¡¢À®¸ù»þ¤Ë +.BR sched_setscheduler () +¤ÏľÁ°¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼¤òÊÖ¤¹¤Ù¤­¤È¤µ¤ì¤Æ¤¤¤ë¡£ +Linux ¤Î +.BR sched_setscheduler () +¤Ï¤³¤ÎÍ×µá»ÅÍͤ˽àµò¤·¤Æ¤ª¤é¤º¡¢ +À®¸ù»þ¤Ë¤Ï¾ï¤Ë 0 ¤òÊÖ¤¹¡£ +.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 +¥«¡¼¥Í¥ë¡¦¥½¡¼¥¹Æâ¤Î¥Õ¥¡¥¤¥ë +.I Documentation/scheduler/sched-rt-group.txt +(¥«¡¼¥Í¥ë 2.6.25 °Ê¹ß) diff --git a/release/man2/sched_yield.2 b/release/man2/sched_yield.2 new file mode 100644 index 00000000..813646a9 --- /dev/null +++ b/release/man2/sched_yield.2 @@ -0,0 +1,98 @@ +.\" 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 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 ¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +.\" +.TH SCHED_YIELD 2 2008-10-18 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sched_yield \- ¥×¥í¥»¥Ã¥µ¡¼¤ò¶õ¤±ÅϤ¹(yield) +.SH ½ñ¼° +.B #include +.sp +.B int sched_yield(void); +.SH ÀâÌÀ +.BR sched_yield () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬ CPU ¤Î»ÈÍѸ¢¤ò¼êÊü¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +¤½¤Î¥¹¥ì¥Ã¥É¤Ï¡¢¤½¤Î¥¹¥ì¥Ã¥É¤ÎÀÅŪ¥×¥é¥¤¥ª¥ê¥Æ¥£¤Î¥­¥å¡¼¤ÎËöÈø¤Ë +°ÜÆ°¤·¡¢¿·¤·¤¤¥¹¥ì¥Ã¥É¤¬Áö¤ê»Ï¤á¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï +.BR sched_yield () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +Linux ¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.BR sched_yield () +¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.BR sched_yield () +¤ò¸Æ¤Ó½Ð¤·¤¿»þÅÀ¤ÇºÇÂçÍ¥ÀèÅ٤Υꥹ¥È¤ÎÃæ¤Ë¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤·¤« +¸ºß¤·¤Ê¤±¤ì¤Ð¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ï¸Æ¤Ó½Ð¤·¸å¤âÁö¤ê³¤±¤ë¤³¤È¤Ë¤Ê¤ë¡£ + +POSIX ¥·¥¹¥Æ¥à¤Ç +.BR sched_yield () +¤Ï \fI\fP ¤Ë +.B _POSIX_PRIORITY_SCHEDULING +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ß»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ + +.BR sched_yield () +¤òÀïάŪ¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢(¶ËÅÙ¤Ë) ¶¥¹ç¤¹¤ë¥ê¥½¡¼¥¹ (mutex ¤Ê¤É) +¤ò¸Æ¤Ó½Ð¤·¸µ¤¬²òÊü¤·¤¿ºÝ¤Ë¾¤Î¥¹¥ì¥Ã¥É¤ä¥×¥í¥»¥¹¤Ë¼Â¹Ôµ¡²ñ¤òÍ¿¤¨¤ë¤³¤È¤Ç¡¢ +À­Ç½¤ò¾å¤²¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR sched_yield () +¤òɬÍפâ¤Ê¤¤¤Î¤Ë¸Æ¤Ó½Ð¤·¤¿¤ê¡¢ÉÔŬÀڤʾìÌÌ (Î㤨¤Ð¡¢Â¾¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +ÂоݤȤʤ륹¥ì¥Ã¥É¤¬É¬ÍפȤ¹¤ë¥ê¥½¡¼¥¹¤ò¸Æ¤Ó½Ð¤·¸µ¤¬ÊÝ»ý¤·¤¿¤Þ¤Þ¤Î¾õÂÖ) +¤Ç¸Æ¤Ó½Ð¤·¤¿¤ê¤¹¤ë¤Î¤ÏÈò¤±¤ë¤³¤È¡£¤Ê¤¼¤Ê¤é¡¢ +.BR sched_yield () +¤Î¸Æ¤Ó½Ð¤·¤è¤êÉÔɬÍפʥ³¥ó¥Æ¥­¥¹¥È¥¹¥¤¥Ã¥Á¤¬µ¯¤³¤ê¡¢¥·¥¹¥Æ¥àÀ­Ç½¤¬ +Îô²½¤¹¤ë·ë²Ì¤Ë¤Ê¤ë¤«¤é¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +Linux ¤Î¥¹¥±¡¼¥¸¥å¥ê¥ó¥°(scheduling)¤Ë¤Ä¤¤¤Æ¤Ï +.BR sched_setscheduler (2) +¤ò»²¾È¤»¤è¡£ +.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/release/man2/select.2 b/release/man2/select.2 new file mode 100644 index 00000000..b3d814f4 --- /dev/null +++ b/release/man2/select.2 @@ -0,0 +1,560 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is copyright (C) 1992 Drew Eckhardt, +.\" copyright (C) 1995 Michael Shields. +.\" +.\" 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-05-18 by Jim Van Zandt +.\" Sun Feb 11 14:07:00 MET 1996 Martin Schulze +.\" * layout slightly modified +.\" +.\" Modified Mon Oct 21 23:05:29 EDT 1996 by Eric S. Raymond +.\" Modified Thu Feb 24 01:41:09 CET 2000 by aeb +.\" Modified Thu Feb 9 22:32:09 CET 2001 by bert hubert , aeb +.\" Modified Mon Nov 11 14:35:00 PST 2002 by Ben Woodard +.\" 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 °Ü¿¢À­¤Î¤¢¤ë +.\" +.TH SELECT 2 2008-12-05 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \- ¿½Å²½¤µ¤ì¤¿ I/O ¤ÎƱ´ü¤ò¤È¤ë +.SH ½ñ¼° +.nf +/* POSIX.1-2001 ¤Ë½¾¤¦¾ì¹ç */ +.br +.B #include +.sp +/* °ÊÁ°¤Îµ¬³Ê¤Ë½¾¤¦¾ì¹ç */ +.br +.B #include +.br +.B #include +.br +.B #include +.sp +.BI "int select(int " nfds ", fd_set *" readfds ", fd_set *" writefds , +.BI " fd_set *" exceptfds ", struct timeval *" timeout ); +.sp +.BI "void FD_CLR(int " fd ", fd_set *" set ); +.br +.BI "int FD_ISSET(int " fd ", fd_set *" set ); +.br +.BI "void FD_SET(int " fd ", fd_set *" set ); +.br +.BI "void FD_ZERO(fd_set *" set ); +.sp +.B #include +.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 ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR pselect (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.SH ÀâÌÀ +.BR select () +¤ä +.BR pselect () +¤ò»È¤¦¤È¡¢¥×¥í¥°¥é¥à¤ÇÊ£¿ô¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò´Æ»ë¤·¡¢ +°ì¤Ä°Ê¾å¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¤¢¤ë¼ï¤Î I/O Áàºî¤Î +¡Öready (½àÈ÷¤¬¤Ç¤­¤¿)¡×¾õÂÖ (Î㤨¤Ð¡¢Æɤ߹þ¤ß²Äǽ¤Ë¤Ê¤Ã¤¿¾õÂÖ) +¤Ë¤Ê¤ë¤Þ¤ÇÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ ready (½àÈ÷¤¬¤Ç¤­¤¿) ¤È¤Ï¡¢ +Âбþ¤¹¤ë I/O Áàºî (Î㤨¤Ð +.BR read (2) +¤Ê¤É) ¤¬Ää»ß (block) ¤Ê¤·¤Ë¼Â¹Ô²Äǽ¤Ê¾õÂ֤ˤ¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.PP +.BR select () +¤È +.BR pselect () +¤ÎÆ°ºî¤ÏƱ¤¸¤Ç¤¢¤ë¤¬¡¢°Ê²¼¤Î 3 ÅÀ¤¬°Û¤Ê¤ë: +.TP +(i) +.BR select () +¤Ç¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥È»þ´Ö¤Î»ØÄê¤Ë¹½Â¤ÂÎ +.I struct timeval +(Éᦥޥ¤¥¯¥íÉÃñ°Ì) ¤òÍѤ¤¤ë¡£ +°ìÊý¡¢ +.BR pselect () +´Ø¿ô¤Ç¤Ï¡¢¹½Â¤ÂÎ +.I struct timespec +(ÉᦥʥÎÉÃñ°Ì) ¤òÍѤ¤¤ë¡£ +.TP +(ii) +.BR select () +¤Ï»Ä¤ê»þ´Ö¤ò¼¨¤¹ +.I timeout +°ú¤­¿ô¤ò¹¹¿·¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +.BR pselect () +¤Ï¤³¤Î°ú¤­¿ô¤òÊѹ¹¤·¤Ê¤¤¡£ +.TP +(iii) +.BR select () +¤Ï +.I sigmask +°ú¤­¿ô¤ò»ý¤¿¤Ê¤¤¡£¤½¤ÎÆ°ºî¤Ï +.I sigmask +¤Ë NULL ¤ò»ØÄꤷ¤¿¾ì¹ç¤Î +.BR pselect () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.PP +3 ¤Ä¤ÎÆÈΩ¤·¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Î´Æ»ë¤ò¹Ô¤¦¡£ +.I readfds +¤ËÆþ¤ì¤é¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤Ä¤¤¤Æ¤Ï¡¢Æɤ߹þ¤ß¤¬²Äǽ¤«¤É¤¦¤«¤ò +´Æ»ë¤¹¤ë (¤è¤êÀµ³Î¤Ë¤¤¤¦¤È¡¢Ää»ß (block) ¤Ê¤·¤ÇÆɤळ¤È¤¬¤Ç¤­¤ë¤«¤ò +Ä´¤Ù¤ë¡£¥Õ¥¡¥¤¥ë¤Î½ªÃ¼ (end-of-file) ¤Î¾ì¹ç¤â¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÆɤ߹þ¤ß²Äǽ¤È¤·¤Æ°·¤ï¤ì¤ë)¡£ +.I writefds +¤ËÆþ¤ì¤é¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤Ä¤¤¤Æ¤Ï¡¢Ää»ß¤»¤º¤Ë½ñ¤­¹þ¤ß¤¬ +²Äǽ¤«¤É¤¦¤«¤ò´Æ»ë¤¹¤ë¡£ +.I exceptfds +¤Ë¤¢¤ë¤â¤Î¤Ë¤Ä¤¤¤Æ¤Ï¡¢Îã³°¤Î´Æ»ë¤ò¹Ô¤Ê¤¦¡£¥·¥¹¥Æ¥à¥³¡¼¥ë½ªÎ»»þ¤Ë¡¢ +¤É¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¾õÂÖ¤¬¼ÂºÝ¤ËÊѲ½¤·¤¿¤«¼¨¤¹¤¿¤á¤Ë¡¢ +½¸¹ç¤ÎÆâÍƤ¬Êѹ¹¤µ¤ì¤ë¡£ +¤¢¤ë¼ïÊ̤Υ¤¥Ù¥ó¥È¤ò´Æ»ë¤·¤¿¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬°ì¤Ä¤â¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +Âбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Ë NULL ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +½¸¹ç¤òÁàºî¤¹¤ë¤¿¤á¤Ë 4 ¤Ä¤Î¥Þ¥¯¥í¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£ +.BR FD_ZERO () +¤Ï½¸¹ç¤ò¾Ãµî¤¹¤ë¡£ +.BR FD_SET () +¤È +.BR FD_CLR () +¤Ï¤½¤ì¤¾¤ì»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î½¸¹ç¤Ø¤ÎÄɲᢺï½ü¤ò¹Ô¤¦¡£ +.BR FD_ISSET () +¤Ï½¸¹ç¤Ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¤¢¤ë¤«¤É¤¦¤«Ä´¤Ù¤ë; +¤³¤Î¥Þ¥¯¥í¤Ï +.BR select () +¤¬½ªÎ»¤·¤¿¸å¤Ë»È¤¦¤ÈÊØÍø¤Ç¤¢¤ë¡£ +.PP +.I nfds +¤Ï 3 ¤Ä¤Î½¸¹ç¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎºÇÂçÃÍ¤Ë 1 ¤ò­¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.PP +.I timeout +¤Ï +.BR select () +¤¬Éüµ¢¤¹¤ë¤Þ¤Ç¤Î·Ð²á»þ´Ö¤Î¾å¸Â¤Ç¤¢¤ë¡£ +.I timeval +¹½Â¤ÂΤÎξÊý¤Î¥Õ¥£¡¼¥ë¥É¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR select () +¤Ï¤¹¤°¤ËÉüµ¢¤¹¤ë +(¤³¤Îµ¡Ç½¤Ï¥Ý¡¼¥ê¥ó¥° (polling) ¤ò¹Ô¤¦¤Î¤ËÊØÍø¤Ç¤¢¤ë)¡£ +.I timeout +¤Ë NULL (¥¿¥¤¥à¥¢¥¦¥È¤Ê¤·) +¤¬»ØÄꤵ¤ì¤ë¤È¡¢ +.BR select () +¤Ï̵´ü¸Â¤ËÄä»ß (block) ¤¹¤ë¡£ +.PP +.I sigmask +¤Ï¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯ +.RB ( sigprocmask (2) +¤ò»²¾È) ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I sigmask +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.BR pselect () +¤Ï +.I sigmask +¤¬»Ø¤·¤Æ¤¤¤ë¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ç¸½ºß¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÃÖ¤­´¹¤¨¤Æ¤«¤é¡¢ +"select" ´Ø¿ô¤ò¼Â¹Ô¤·¡¢ +½ªÎ»¸å¤Ë¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò¸µ¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ËÌ᤹¡£ +.PP +.I timeout +°ú¤­¿ô¤ÎÀºÅ٤ΰ㤤¤ò½ü¤¯¤È¡¢°Ê²¼¤Î +.BR pselect () +¤Î¸Æ¤Ó½Ð¤·¤Ï¡¢ +.nf + + ready = pselect(nfds, &readfds, &writefds, &exceptfds, + timeout, &sigmask); + +.fi +¼¡¤Î¥³¡¼¥ë¤ò +.I atomic +¤Ë¼Â¹Ô¤¹¤ë¤Î¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.nf + + sigset_t origmask; + + sigprocmask(SIG_SETMASK, &sigmask, &origmask); + ready = select(nfds, &readfds, &writefds, &exceptfds, timeout); + sigprocmask(SIG_SETMASK, &origmask, NULL); +.fi +.PP +.BR pselect () +¤¬É¬ÍפˤʤëÍýͳ¤Ï¡¢¥·¥°¥Ê¥ë¤ä¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¾õÂÖÊѲ½¤ò +ÂÔ¤Á¤¿¤¤¤È¤­¤Ë¤Ï¡¢¶¥¹ç¾õÂÖ¤òÈò¤±¤ë¤¿¤á¤Ë atomic ¤Ê¥Æ¥¹¥È¤¬É¬Íפˤʤë +¤«¤é¤Ç¤¢¤ë¡£ +(¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬Âç°è¥Õ¥é¥°¤òÀßÄꤷ¤ÆÌá¤ë¾ì¹ç¤ò¹Í¤¨¤Æ¤ß¤è¤¦¡£ +¤³¤ÎÂç°è¥Õ¥é¥°¤Î¥Æ¥¹¥È¤Ë³¤±¤Æ +.BR select () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢ +¥·¥°¥Ê¥ë¤¬¥Æ¥¹¥È¤Îľ¸å¤«¤Ä¸Æ¤Ó½Ð¤·¤ÎľÁ°¤ËÆϤ¤¤¿»þ¤Ë¤Ï +.BR select () +¤Ï±Êµ×¤Ë¥Ï¥ó¥°¤·¤Æ¤·¤Þ¤¦¤«¤â¤·¤ì¤Ê¤¤¡£ +°ìÊý¡¢ +.BR pselect () +¤ò»È¤¦¤È¡¢¤Þ¤º¥·¥°¥Ê¥ë¤ò¶Ø»ß (block) ¤·¤Æ¡¢Æþ¤Ã¤Æ¤¯¤ë¥·¥°¥Ê¥ë¤òÁàºî¤·¡¢ +˾¤ß¤Î +.I sigmask +¤Ç +.BR pselect () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢Á°µ­¤Î¶¥¹ç¤òÈò¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£) +.SS ¥¿¥¤¥à¥¢¥¦¥È +¤³¤ì¤é¤Î´Ø¿ô¤Ç»ÈÍѤµ¤ì¤ë»þ´Ö´ØÏ¢¤Î¹½Â¤ÂΤϡ¢ +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct timeval { + long tv_sec; /* Éà */ + long tv_usec; /* ¥Þ¥¤¥¯¥íÉà */ +}; +.fi +.in + +.in +4n +.nf +struct timespec { + long tv_sec; /* Éà */ + long tv_nsec; /* ¥Ê¥ÎÉà */ +}; +.fi +.in + +(POSIX.1-2001 ¤Ç¤ÎÄêµÁ¤Ë¤Ä¤¤¤Æ¤Ï²¼µ­¤Î¡ÖÃí°Õ¡×¤ò»²¾È) +.PP +ÉÃñ°Ì°Ê²¼¤ÎÀºÅ٤ǥ¹¥ê¡¼¥×¤ò¼Â¸½¤¹¤ë +°Ü¿¢À­¤Î¹â¤¤ÊýË¡¤È¤·¤Æ¡¢ +3 ¤Ä¤Î½¸¹çÁ´¤Æ¤ò¶õ¡¢ +.I nfds +¤ò 0 ¡¢ +.I timeout +¤ò NULL ¤Ç¤Ê¤¤ÃͤËÀßÄꤷ¤Æ +.BR select () +¤ò¸Æ¤Ó½Ð¤¹¤È¤¤¤¦ÊýË¡¤ò»È¤Ã¤Æ¤¤¤ë¥³¡¼¥É¤â¤¢¤ë¡£ +.PP +Linux ¤Ç¤Ï¡¢ +.BR select () +¤Ï +.I timeout +¤òÊѹ¹¤·¡¢»Ä¤ê¤ÎÄä»ß»þ´Ö¤òÈ¿±Ç¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¬¡¢ +¾¤Î¤Û¤È¤ó¤É¤Î¼ÂÁõ¤Ç¤Ï¤³¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤ +(POSIX.1-2001 ¤Ï¤É¤Á¤é¤ÎÆ°ºî¤âǧ¤á¤Æ¤¤¤ë)¡£ +¤³¤Î¤¿¤á¡¢ +.I timeout +¤ò»²¾È¤·¤Æ¤¤¤ë Linux ¤Î¥³¡¼¥É¤ò¾¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¡¦¥·¥¹¥Æ¥à¤Ø +°Ü¿¢¤¹¤ë¾ì¹ç¡¢ÌäÂ꤬µ¯¤³¤ë¡£ +¤Þ¤¿¡¢¥ë¡¼¥×¤ÎÃæ¤Ç \fItimeval\fP ¹½Â¤ÂΤò½é´ü²½¤»¤º¤Ë¤½¤Î¤Þ¤ÞºÆÍøÍѤ·¤Æ +.BR select () +¤òÊ£¿ô²ó¹Ô¤Ê¤Ã¤Æ¤¤¤ë¥³¡¼¥É¤ò Linux ¤Ø°Ü¿¢¤¹¤ë¾ì¹ç¤Ë¤â¡¢ÌäÂ꤬µ¯¤³¤ë¡£ +.BR select () +¤«¤éÉüµ¢¤·¤¿¸å¤Ï +.I timeout +¤Ï̤ÄêµÁ¤Ç¤¢¤ë¤È¹Í¤¨¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.\" .PP +.\" ¡ÖBSD ¤Ç¤Ï¥¿¥¤¥à¥¢¥¦¥È¤¬µ¯¤³¤Ã¤Æ¤â¡¢ +.\" ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¥Ó¥Ã¥È¤ÏÊѤï¤é¤Ê¤¤¡×¤Èʹ¤¤¤¿¤³¤È¤¬¤¢¤ë¡£ +.\" ¡ÖLinux ¤Ï SUSv2 ¤Ë½¾¤Ã¤Æ¤ª¤ê¡¢ +.\" ¥¿¥¤¥à¥¢¥¦¥È¤ÎºÝ¤Ë¤Ï¥Ó¥Ã¥È¥Þ¥¹¥¯¤ò 0 ¤Ë¤¹¤ë¡×¤È¤¤¤¦¤Î¤Ï³Î¤«¤Ë»ö¼Â¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR select () +¤È +.BR pselect () +¤Ï¹¹¿·¤µ¤ì¤¿ 3 ¤Ä¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô (¤Ä¤Þ¤ê¡¢ +.IR readfds , +.IR writefds , +.I exceptfds +Ãæ¤Î 1 ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥Ó¥Ã¥È¤ÎÁí¿ô) ¤òÊÖ¤¹¡£ +²¿¤âµ¯¤³¤é¤º¤Ë»þ´ÖÀÚ¤ì¤Ë¤Ê¤Ã¤¿¾ì¹ç¡¢ +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô¤Ï 0 ¤Ë¤Ê¤ë¤³¤È¤â¤¢¤ë¡£ +¥¨¥é¡¼¤Ê¤é¤Ð \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬ÀßÄꤵ¤ì¤ë; ½¸¹ç¤È +.I timeout +¤Ï̤ÄêµÁ¤È¤Ê¤ë¤Î¤Ç¡¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¸å¤Ï¤½¤ì¤é¤ÎÆâÍƤò¿®Íꤷ¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +¤¤¤º¤ì¤«¤Î½¸¹ç¤Ë̵¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬»ØÄꤵ¤ì¤¿ +(¤ª¤½¤é¤¯¤Ï¡¢¤¹¤Ç¤Ë¥¯¥í¡¼¥º¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¡¢ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬»ØÄꤵ¤ì¤¿)¡£ +.TP +.B EINTR +¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤¿¡£ +.TP +.B EINVAL +.I n +¤¬Éé¡¢¤Þ¤¿¤Ï +.I timeout +¤ËÆþ¤Ã¤Æ¤¤¤ëÃͤ¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +ÆâÉô¥Æ¡¼¥Ö¥ë¤Ë¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR pselect () +¤Ï¥«¡¼¥Í¥ë 2.6.16 ¤Ç Linux ¤ËÄɲ䵤줿¡£ +¤½¤ì°ÊÁ°¤Ï¡¢ +.BR pselect () +¤Ï glibc ¤Ç¥¨¥ß¥å¥ì¡¼¥È¤µ¤ì¤Æ¤¤¤¿ (¡Ö¥Ð¥°¡×¤Î¾Ï¤ò»²¾È)¡£ +.SH ½àµò +.BR select () +¤Ï POSIX.1-2001 ¤È 4.4BSD +.RB ( select () +¤Ï 4.2BSD ¤ÇºÇ½é¤ËÅо줷¤¿) ¤Ë½àµò¤¹¤ë¡£ +BSD ¥½¥±¥Ã¥ÈÁؤΥ¯¥í¡¼¥ó¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ëÈó BSD ¥·¥¹¥Æ¥à +(System V ·Ï¤â´Þ¤à) ¤È¤Î´Ö¤Ç¤À¤¤¤¿¤¤°Ü¿¢À­¤¬¤¢¤ë¡£¤·¤«¤· System V ·Ï¤Ç¤Ï +¤¿¤¤¤¬¤¤ timeout ÊÑ¿ô¤ò exit ¤ÎÁ°¤Ë¥»¥Ã¥È¤¹¤ë¤¬¡¢ +BSD ·Ï¤Ç¤Ï¤½¤¦¤Ç¤Ê¤¤¤Î¤ÇÃí°Õ¤¹¤ë¤³¤È¡£ +.PP +.BR pselect () +¤Ï POSIX.1g ¤È POSIX.1-2001 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.I fd_set +¤Ï¸ÇÄꥵ¥¤¥º¤Î¥Ð¥Ã¥Õ¥¡¤Ç¤¢¤ë¡£ +Éé¤ä +.B FD_SETSIZE +°Ê¾å¤ÎÃͤò»ý¤Ä +.I fd +¤ËÂФ·¤Æ +.BR FD_CLR () +¤ä +.BR FD_SET () +¤ò¼Â¹Ô¤·¤¿¾ì¹ç¡¢ +¤É¤Î¤è¤¦¤ÊÆ°ºî¤ò¤¹¤ë¤«¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¡¢ POSIX ¤Ç¤Ï +.I fd +¤ÏÍ­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +·¿Àë¸À¤Ë´Ø¤·¤Æ¤Ï¡¢ÀΤʤ¬¤é¤Î¾õ¶·¤Ç¤Ï +.I timeval +¹½Â¤ÂΤΠ2 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤Ï +(¾åµ­¤Î¤è¤¦¤Ë) ξÊý¤È¤â +.I long +·¿¤Ç¤¢¤ê¡¢¹½Â¤ÂÎ¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Î²¼¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct timeval { + time_t tv_sec; /* Éà */ + suseconds_t tv_usec; /* ¥Þ¥¤¥¯¥íÉà */ +}; +.fi +.in + +¤³¤Î¹½Â¤ÂÎ¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢¥Ç¡¼¥¿·¿ +.I time_t +¤È +.I suseconds_t +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +¥×¥í¥È¥¿¥¤¥×¤Ë´Ø¤·¤Æ¤Ï¡¢ÀΤʤ¬¤é¤Î¾õ¶·¤Ç +.BR select () +¤ò»È¤¤¤¿¤¤¾ì¹ç¤Ï¡¢ +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ì¤Ð¤è¤¤¡£ +POSIX.1-2001 ¤Î´Ä¶­¤Ç +.BR select () +¤È +.BR pselect () +¤ò»È¤¤¤¿¤¤¾ì¹ç¤Ï¡¢ +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ì¤Ð¤è¤¤¡£ + +¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.I +¤Ï libc4 ¤È libc5 ¤Ë¤Ï¤Ê¤¯¡¢glibc 2.0 °Ê¹ß¤Ë¸ºß¤¹¤ë¡£ +°­¤¤¤³¤È¤Ë glibc 2.0 °ÊÁ°¤Ç¤Ï +.BR pselect () +¤Î¥×¥í¥È¥¿¥¤¥×¤¬´Ö°ã¤Ã¤Æ¤¤¤ë¡£ +glibc 2.1 ¤«¤é 2.2.1 ¤Ç¤Ï +.B _GNU_SOURCE +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +.BR pselect () +¤¬Ä󶡤µ¤ì¤ë¡£ +glibc 2.2.2 °Ê¹ß¤Ç¤Ï¡¢ +.BR pselect () +¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢¡Ö½ñ¼°¡×¤Ëµ­ºÜ¤µ¤ì¤¿Í×·ï¤òËþ¤¿¤¹É¬Íפ¬¤¢¤ë¡£ +.SS "Linux ¤Ç¤ÎÃí°Õ" +Linux ¤Î +.BR pselect () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I timeout +°ú¤­¿ô¤òÊѹ¹¤¹¤ë¡£ +¤·¤«¤·¡¢ glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ timeout °ú¤­¿ô +¤È¤·¤Æ¥í¡¼¥«¥ëÊÑ¿ô¤ò»È¤¦¤³¤È¤Ç¤³¤ÎÆ°ºî¤ò±£Ê䷤Ƥ¤¤ë¡£ +¤³¤Î¤¿¤á¡¢glibc ¤Î +.BR pselect () +´Ø¿ô¤Ï timeout °ú¤­¿ô¤òÊѹ¹¤·¤Ê¤¤¡£ +¤³¤ì¤¬ POSIX.1-2001 ¤¬Í׵ᤷ¤Æ¤¤¤ëÆ°ºî¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +glibc 2.0 ¤Ç¤Ï¡¢ +.I sigmask +°ú¤­¿ô¤ò¼è¤é¤Ê¤¤¥Ð¡¼¥¸¥ç¥ó¤Î +.BR pselect () +¤¬Ä󶡤µ¤ì¤Æ¤¤¤¿¡£ + +¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤Ç¤Ï¡¢ +.BR pselect () +¤Ï +.BR sigprocmask (2) +¤È +.BR select () +¤ò»È¤Ã¤Æ¥¨¥ß¥å¥ì¡¼¥È¤µ¤ì¤Æ¤¤¤¿¡£ +¤³¤Î¼ÂÁõ¤Ë¤Ï¤­¤ï¤É¤¤¶¥¹ç¾ò·ï¤Ë¤ª¤¤¤ÆÀȼåÀ­¤¬»Ä¤Ã¤Æ¤¤¤ë¡£ +¤³¤Î¶¥¹ç¾ò·ï¤Ë¤ª¤±¤ëÌäÂê¤òËɻߤ¹¤ë¤¿¤á¤Ë +.BR pselect () +¤ÏÀ߷פµ¤ì¤¿¤Î¤Ç¤¢¤ë¡£ +.BR pselect () +¤¬¤Ê¤¤¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¡¢ +¥·¥°¥Ê¥ë¤ÎÊ᪤ò¿®ÍêÀ­¤¬¤¢¤ê (°Ü¿¢À­¤â¹â¤¤) ÊýË¡¤Ç¹Ô¤¦¤Ë¤Ï¡¢ +¼«¸Ê¥Ñ¥¤¥× (self-pipe) ¤È¤¤¤¦µ»¤ò»È¤¦¤È¤è¤¤ (¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ï¥Ñ¥¤¥×¤Ø +1 ¥Ð¥¤¥È¤Î¥Ç¡¼¥¿¤ò½ñ¤­¹þ¤ß¡¢Æ±¤¸¥Ñ¥¤¥×¤Î¤â¤¦°ìü¤ò¥á¥¤¥ó¥×¥í¥°¥é¥à¤Î +.BR select () +¤Ç´Æ»ë¤¹¤ë¤È¤¤¤¦ÊýË¡¤Ç¤¢¤ë)¡£ + +Linux ¤Ç¤Ï¡¢ +.BR select () +¤¬¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç "Æɤ߹þ¤ß¤Î½àÈ÷¤¬¤Ç¤­¤¿" ¤ÈÊó¹ð¤·¤¿¾ì¹ç¤Ç¤â¡¢ +¤³¤Î¸å¤Ç read ¤ò¹Ô¤¦¤ÈÄä»ß (block) ¤¹¤ë¤³¤È¤¬¤¢¤ë¡£¤³¤Î¤è¤¦¤Ê¾õ¶·¤Ï¡¢ +Î㤨¤Ð¡¢¥Ç¡¼¥¿¤¬ÅþÃ夷¤¿¤¬¡¢¸¡ºº¤Ç¥Á¥§¥Ã¥¯¥µ¥à°Û¾ï¤¬¸«¤Ä¤«¤êÇÑ´þ¤µ¤ì¤¿»þ +¤Ê¤É¤Ëµ¯¤³¤ê¤¨¤ë¡£Â¾¤Ë¤â¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬½àÈ÷¤Ç¤­¤¿¤È´Ö°ã¤Ã¤Æ +Êó¹ð¤µ¤ì¤ë¾õ¶·¤¬µ¯¤³¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\" Stevens ¤¬µó¤²¤¿¤Î¤Ï¡¢select ¤¬À®¸ù¤·¤ÆÉüµ¢¤·¤Æ¤«¤é accept ¤¬ +.\" ¸Æ¤Ð¤ì¤ë¤Þ¤Ç¤Î´Ö¤Ë¡¢¥¯¥é¥¤¥¢¥ó¥È¤«¤é RST ¤¬Á÷¤é¤ì¤ë¤È¡¢ +.\" accept ¤¬Ää»ß¤¹¤ë¾ì¹ç¤Ç¤¢¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢Ää»ß¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï +.B O_NONBLOCK +¤ò»È¤¦¤È¤è¤ê°ÂÁ´¤Ç¤¢¤í¤¦¡£ +.\" ¿ʬ¡¢¤³¤Î¤è¤¦¤Ê¾õ¶·¤Ç¤Ï¥«¡¼¥Í¥ë¤Ï EIO ¤òÊÖ¤·¤Æ¤·¤Þ¤¦? + +Linux ¤Ç¤Ï¡¢ +.BR select () +¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç (¤Ä¤Þ¤ê +.B EINTR +¥¨¥é¡¼¤¬ÊÖ¤ë¾ì¹ç)¡¢ +.I timeout +¤âÊѹ¹¤¹¤ë¡£ +¤³¤ì¤Ï POSIX.1-2001 ¤Ç¤Ïǧ¤á¤é¤ì¤Æ¤¤¤Ê¤¤µóÆ°¤Ç¤¢¤ë¡£ +Linux ¤Î +.BR pselect () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤âƱ¤¸µóÆ°¤ò¤¹¤ë¤¬¡¢ +glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬¤³¤ÎµóÆ°¤ò±£Ê䷤Ƥ¤¤ë¡£ +¶ñÂÎŪ¤Ë¤Ï¡¢glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤ÎÆâÉô¤Ç¡¢ +.I timeout +¤ò¥í¡¼¥«¥ëÊÑ¿ô¤Ë¥³¥Ô¡¼¤·¡¢ +¤³¤Î¥í¡¼¥«¥ëÊÑ¿ô¤ò¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ·¤Æ¤¤¤ë¡£ +.SH Îã +.nf +#include +#include +#include +#include +#include + +int +main(void) +{ + fd_set rfds; + struct timeval tv; + int retval; + + /* stdin (fd 0) ¤ò´Æ»ë¤·¡¢ÆþÎϤ¬¤¢¤Ã¤¿¾ì¹ç¤Ëɽ¼¨¤¹¤ë¡£*/ + FD_ZERO(&rfds); + FD_SET(0, &rfds); + + /* 5 Éôִƻ뤹¤ë¡£*/ + tv.tv_sec = 5; + tv.tv_usec = 0; + + retval = select(1, &rfds, NULL, NULL, &tv); + /* ¤³¤Î»þÅÀ¤Ç¤Î tv ¤ÎÃͤò¿®Íꤷ¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£*/ + + if (retval == \-1) + perror("select()"); + else if (retval) + printf("º£¡¢¥Ç¡¼¥¿¤¬¼èÆÀ¤Ç¤­¤Þ¤·¤¿¡£\\n"); + /* FD_ISSET(0, &rfds) ¤¬ true ¤Ë¤Ê¤ë¡£*/ + else + printf("5 ÉðÊÆâ¤Ë¥Ç¡¼¥¿¤¬ÆþÎϤµ¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£\\n"); + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +¹Í»¡¤È»ÈÍÑÎã¤Î½ñ¤«¤ì¤¿¥Á¥å¡¼¥È¥ê¥¢¥ë¤È¤·¤Æ¡¢ +.BR select_tut (2) +¤¬¤¢¤ë¡£ +.LP +´Ø·¸¤¬¤¢¤ê¤½¤¦¤Ê¤â¤Î¤òµó¤²¤Æ¤ª¤¯: +.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) diff --git a/release/man2/select_tut.2 b/release/man2/select_tut.2 new file mode 100644 index 00000000..9239d0d7 --- /dev/null +++ b/release/man2/select_tut.2 @@ -0,0 +1,840 @@ +.\" This manpage is copyright (C) 2001 Paul Sheer. +.\" +.\" 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. +.\" +.\" very minor changes, aeb +.\" +.\" Modified 5 June 2002, Michael Kerrisk +.\" 2006-05-13, mtk, removed much material that is redundant with select.2 +.\" 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 Îã³°¾õÂÖ +.\" +.TH SELECT_TUT 2 2009-01-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \- Ʊ´ü I/O ¤Î¿½Å²½ +.SH ½ñ¼° +.nf +/* POSIX.1-2001 ¤Ë½¾¤¦¾ì¹ç */ +.br +.B #include +.sp +/* °ÊÁ°¤Îµ¬³Ê¤Ë½¾¤¦¾ì¹ç */ +.br +.B #include +.br +.B #include +.br +.B #include +.sp +.BI "int select(int " nfds ", fd_set *" readfds ", fd_set *" writefds , +.BI " fd_set *" exceptfds ", struct timeval *" utimeout ); +.sp +.BI "void FD_CLR(int " fd ", fd_set *" set ); +.br +.BI "int FD_ISSET(int " fd ", fd_set *" set ); +.br +.BI "void FD_SET(int " fd ", fd_set *" set ); +.br +.BI "void FD_ZERO(fd_set *" set ); +.sp +.B #include +.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 ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR pselect (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.SH ÀâÌÀ +.BR select () +(¤ä +.BR pselect ()) +¤ò»È¤¦¤È¡¢¸úΨŪ¤ËÊ£¿ô¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò´Æ»ë¤·¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¤¤º¤ì¤«¤¬ +¡Öready (½àÈ÷¤¬¤Ç¤­¤¿)¡×¾õÂÖ¡¢¤Ä¤Þ¤ê I/O (Æþ½ÐÎÏ) ¤¬²Äǽ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤«¤ä¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¤¤º¤ì¤«¤¬ +¡ÖÎã³°¾õÂÖ (exceptional condition)¡×¤¬È¯À¸¤·¤¿¤«¡¢¤òÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¤³¤Î´Ø¿ô¤Î¼çÍפʰú¤­¿ô¤Ï¡¢3¼ïÎà¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¡Ö½¸¹ç¡× +\fIreadfds\fP, \fIwritefds\fP, \fIexceptfds\fP ¤Ç¤¢¤ë¡£ +³Æ¡¹¤Î½¸¹ç¤Ï +.B fd_set +¤È¤·¤ÆÀë¸À¤µ¤ì¡¢¤½¤ÎÆâÍÆ¤Ï +.BR FD_CLR (), +.BR FD_ISSET (), +.BR FD_SET (), +.BR FD_ZERO () +¤È¤¤¤Ã¤¿¥Þ¥¯¥í¤Ë¤è¤Ã¤ÆÁàºî¤Ç¤­¤ë¡£ +¿·¤·¤¯Àë¸À¤µ¤ì¤¿½¸¹ç¤Ï¡¢¤Þ¤ººÇ½é¤Ë +.BR FD_ZERO () +¤ò»È¤Ã¤Æ¥¯¥ê¥¢¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.BR select () +¤Ï¤³¤ì¤é¤Î½¸¹ç¤ÎÆâÍƤò¡¢°Ê¹ß¤Ë½Ò¤Ù¤ëµ¬Â§¤Ë½¾¤Ã¤Æ½¤Àµ¤¹¤ë¡£ +.BR select () +¤ò¸Æ¤ó¤À¸å¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¤Þ¤À½¸¹ç¤Ë¸ºß¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ï¡¢ +.BR FD_ISSET () +¥Þ¥¯¥í¤Ë¤è¤Ã¤ÆÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR FD_ISSET () +¤Ï»ØÄꤵ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬½¸¹ç¤Ë¸ºß¤·¤Æ¤¤¤ì¤Ð 0 °Ê³°¤ÎÃͤòÊÖ¤·¡¢ +¸ºß¤·¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.BR FD_CLR () +¤Ï½¸¹ç¤«¤é¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Îºï½ü¤ò¹Ô¤¦¡£ +.SS °ú¤­¿ô +.TP +\fIreadfds\fP +¤³¤Î½¸¹ç¤Ë´Þ¤Þ¤ì¤ë¤¤¤º¤ì¤«¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¡¢ +¥Ç¡¼¥¿¤ÎÆɤ߹þ¤ß¤¬²Äǽ¤Ë¤Ê¤Ã¤¿¤«¤É¤¦¤«¤ò´Æ»ë¤¹¤ë¡£ +.BR select () +¤«¤éÌá¤ë»þ¤Ë¡¢\fIreadfds\fP ¤Î¤¦¤Á¡¢ +ľ¤Á¤ËÆɤ߹þ¤ß²Äǽ¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿°Ê³°¤Ï +½¸¹ç¤«¤éºï½ü¤µ¤ì¤ë¡£ +.TP +\fIwritefds\fP +¤³¤Î½¸¹ç¤Ë´Þ¤Þ¤ì¤ë¤¤¤º¤ì¤«¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¡¢ +¥Ç¡¼¥¿¤ò½ñ¤­¹þ¤à¥¹¥Ú¡¼¥¹¤¬¤¢¤ë¤«¤É¤¦¤«¤ò´Æ»ë¤¹¤ë¡£ +.BR select () +¤«¤éÌá¤ë»þ¤Ë¡¢\fIwritefds\fP ¤Î¤¦¤Á¡¢ +ľ¤Á¤Ë½ñ¤­¹þ¤ß²Äǽ¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿°Ê³°¤Ï +½¸¹ç¤«¤éºï½ü¤µ¤ì¤ë¡£ +.TP +\fIexceptfds\fP +¤³¤Î½¸¹ç¤Ë´Þ¤Þ¤ì¤ë¤¤¤º¤ì¤«¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¡¢ +¡ÖÎã³°¾õÂÖ (exceptional condition)¡×¤¬È¯À¸¤·¤¿¤«¤É¤¦¤«¤ò´Æ»ë¤¹¤ë¡£ +¼ÂºÝ¤ÎÆ°ºî¤Ç¤Ï¡¢ÉáÄ̤˵¯¤³¤êÆÀ¤ëÎã³°¾õÂ֤ϰì¤Ä¤À¤±¤Ç¤¢¤ê¡¢ +¤½¤ì¤Ï TCP ¥½¥±¥Ã¥È¤Ç \fIÂÓ°è³° (out-of-band; OOB)\fP ¥Ç¡¼¥¿¤¬ +Æɤ߹þ¤ß²Äǽ¤Ê¾ì¹ç¤Ç¤¢¤ë¡£ +OOB ¥Ç¡¼¥¿¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR recv (2), +.BR send (2), +.BR tcp (7) +¤ò»²¾È¤Î¤³¤È¡£ +(¤³¤ì°Ê³°¤Ç¤Ï¡¢¤Þ¤ì¤Ê¤³¤È¤À¤¬¡¢ +¥Ñ¥±¥Ã¥È¥â¡¼¥É¤Îµ¼»÷üËö (pseudo-terminals) ¤Ç +.BR select () +¤¬Îã³°¾õÂÖ¤ò¼¨¤¹¤³¤È¤¬¤¢¤ë¡£) +.BR select () +¤¬ÊÖ¤ë»þ¤Ë¡¢\fIexceptfds\fP ¤Î¤¦¤Á¡¢ +Îã³°¾õÂÖ¤¬È¯À¸¤·¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿°Ê³°¤Ï½¸¹ç¤«¤éºï½ü¤µ¤ì¤ë¡£ +.TP +\fInfds\fP +Á´¤Æ¤Î½¸¹ç¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¦¤Á¡¢ +Ãͤ¬ºÇÂç¤Î¤â¤Î¤Ë 1 ¤ò­¤·¤¿À°¿ô¤Ç¤¢¤ë¡£ +¤¹¤Ê¤ï¤Á¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò³Æ½¸¹ç¤Ë²Ã¤¨¤ëºî¶È¤ÎÅÓÃæ¤Ç¡¢ +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¸«¤ÆºÇÂçÃͤòµá¤á¡¢ +¤½¤ì¤Ë 1 ¤ò²Ã¤¨¤Æ \fInfds\fP ¤È¤·¤ÆÅϤµ¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡¢¤È¤¤¤¦¤³¤È¤À¡£ +.TP +\fIutimeout\fP +(²¿¤âµ¯¤³¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë) +.BR select () +¤¬Ìá¤ëÁ°¤ËÂԤĺÇÂç»þ´Ö¤Ç¤¢¤ë¡£ +¤³¤ÎÃÍ¤Ë NULL ¤òÅϤ¹¤È¡¢ +.BR select () +¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¤¤º¤ì¤«¤¬ ready (½àÈ÷¤¬¤Ç¤­¤¿) ¾õÂÖ¤Ë +¤Ê¤ë¤Þ¤ÇÂÔ¤Á³¤±¤Æ¤º¤Ã¤ÈÄä»ß¤¹¤ë¡£ +\fIutimeout\fP ¤Ï 0 Éäˤ¹¤ë¤³¤È¤â¤Ç¤­¡¢ +¤³¤Î¾ì¹ç +.BR select () +¤Ïľ¤Á¤ËÊ֤ꡢ¸Æ¤Ó½Ð¤·»þÅÀ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¾õÂÖ¤Ë +´Ø¤¹¤ë¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£ +¹½Â¤ÂÎ \fIstruct timeval\fP ¤Ï¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.IP +.in +4n +.nf +struct timeval { + time_t tv_sec; /* seconds */ + long tv_usec; /* microseconds */ +}; +.fi +.in +.TP +\fIntimeout\fP +.BR pselect () +¤Î¤³¤Î°ú¤­¿ô¤Ï +.I utimeout +¤ÈƱ¤¸°ÕÌ£¤ò»ý¤Ä¤¬¡¢ +.I "struct timespec" +¤Ï¼¡¤Ë¼¨¤¹¤è¤¦¤Ë¥Ê¥ÎÉäÎÀºÅÙ¤ò»ý¤Ä¡£ +.in +4n +.nf +struct timespec { + long tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +.fi +.in +.TP +\fIsigmask\fP +¤³¤Î°ú¤­¿ô¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¤¬ +.BR pselect () +ÆâÉô¤ÇÄä»ß¤·¤Æ¤¤¤ë´Ö¤Ë¡¢¥«¡¼¥Í¥ë¤¬ÄÌÃΤòµö²Ä¤¹¤Ù¤­¥·¥°¥Ê¥ë½¸¹ç +(¤¹¤Ê¤ï¤Á¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤«¤éºï½ü¤¹¤Ù¤­¥·¥°¥Ê¥ë½¸¹ç) +¤òÊÝ»ý¤¹¤ë +.RB ( sigaddset (3) +¤È +.BR sigprocmask (2) +¤ò»²¾È)¡£ +¤³¤Î°ú¤­¿ô¤Ï NULL ¤Ë¤¹¤ë¤³¤È¤â¤Ç¤­¡¢¤½¤Î¾ì¹ç¤Ï¤³¤Î´Ø¿ô¤Ø +Æþ¤ë¤È¤­¡¦½Ð¤ë¤È¤­¤Ë¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊѹ¹¤·¤Ê¤¤¡£ +¤³¤Î¾ì¹ç¡¢ +.BR pselect () +¤Ï +.BR select () +¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤È¤Ê¤ë¡£ +.SS ¥·¥°¥Ê¥ë¤È¥Ç¡¼¥¿¥¤¥Ù¥ó¥È¤òÁȤ߹ç¤ï¤»¤ë +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ I/O ²Äǽ¤Ê¾õÂ֤ˤʤë¤Î¤ÈƱ»þ¤Ë +¥·¥°¥Ê¥ë¤âÂÔ¤Á¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +.BR pselect () +¤¬ÊØÍø¤Ç¤¢¤ë¡£ +¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¥×¥í¥°¥é¥à¤Ï¡¢Ä̾ï¤Ï¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò¥°¥í¡¼¥Ð¥ë¤Ê¥Õ¥é¥°¤òΩ¤Æ¤ë¤¿¤á¤À¤±¤Ë»È¤¦¡£ +¤³¤Î¥°¥í¡¼¥Ð¥ë¤Ê¥Õ¥é¥°¤Ï¡¢ +¤½¤Î¥¤¥Ù¥ó¥È¤ò¥×¥í¥°¥é¥à¤Î¥á¥¤¥ó¥ë¡¼¥×¤Ç +½èÍý¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£ +¥·¥°¥Ê¥ë¤ò¼õ¤±¤ë¤È +.BR select () +(¤ä +.BR pselect ()) +¤Ï +\fIerrno\fP ¤Ë \fBEINTR\fP ¤ò¥»¥Ã¥È¤·¤ÆÌá¤ë¤³¤È¤Ë¤Ê¤ë¡£ +¥·¥°¥Ê¥ë¤¬¥×¥í¥°¥é¥à¤Î¥á¥¤¥ó¥ë¡¼¥×¤Ç½èÍý¤µ¤ì¤ë¤¿¤á¤Ë¤Ï¤³¤ÎÆ°ºî¤¬ÉԲķç¤Ç¡¢ +¤³¤ì¤¬¤Ê¤¤¤È +.BR select () +¤Ï±Ê±ó¤ËÄä»ß¤·Â³¤±¤ë¤³¤È¤Ë¤Ê¤ë¡£ +¤µ¤Æ¡¢¥á¥¤¥ó¥ë¡¼¥×¤Î¤É¤³¤«¤Ë¤³¤Î¥°¥í¡¼¥Ð¥ë¥Õ¥é¥°¤ò¥Á¥§¥Ã¥¯¤¹¤ë +¾ò·ïʸ¤¬¤¢¤ë¤È¤·¤è¤¦¡£¤³¤³¤Ç¾¯¤·¹Í¤¨¤Æ¤ß¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£ +¡Ö¥·¥°¥Ê¥ë¤¬¾ò·ïʸ¤Î¸å¡¢¤·¤«¤· +.BR select () +¥³¡¼¥ë¤ÎÁ°¤ËÅþÃ夷¤¿¤é +¤É¤¦¤Ê¤ë¤Î¤«¡©¡× +Åú¤¨¤Ï¡Ö¤½¤Î +.BR select () +¤Ï¡¢¤¿¤È¤¨²ò·èÂÔ¤Á¤Î¥¤¥Ù¥ó¥È¤¬¤¢¤Ã¤¿¤È¤·¤Æ¤â¡¢ +±Ê±ó¤ËÄä»ß¤¹¤ë¡×¤Ç¤¢¤ë¡£ +¤³¤Î¶¥¹ç¾õÂÖ¤Ï +.BR pselect () +¥³¡¼¥ë¤Ë¤è¤Ã¤Æ²ò·è¤Ç¤­¤ë¡£ +¤³¤Î¥³¡¼¥ë¤ò»È¤¦¤È¡¢ +.BR pselect () +¤Ç¼õ¿®¤·¤¿¤¤¥·¥°¥Ê¥ë¤Î½¸¹ç¤À¤±¤ò¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Î㤨¤Ð¡¢ÌäÂê¤È¤Ê¤Ã¤Æ¤¤¤ë¥¤¥Ù¥ó¥È¤¬»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤Î¾ì¹ç¤ò¹Í¤¨¤è¤¦¡£ +¥á¥¤¥ó¥ë¡¼¥×¤¬»Ï¤Þ¤ëÁ°¤Ë¡¢ +.B SIGCHLD +¤ò +.BR sigprocmask (2) +¤Ç¥Ö¥í¥Ã¥¯¤¹¤ë¡£ +.BR pselect () +¥³¡¼¥ë¤Ç¤Ï +.B SIGCHLD +¤ò¡¢¤â¤È¤â¤È¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò»È¤Ã¤ÆÍ­¸ú¤Ë¤¹¤ë¤Î¤À¡£ +¤³¤Î¥×¥í¥°¥é¥à¤Ï¼¡¤Î¤è¤¦¤Ë¤Ê¤ë¡£ +.PP +.nf +static volatile sig_atomic_t got_SIGCHLD = 0; + +static void +child_sig_handler(int sig) +{ + got_SIGCHLD = 1; +} + +int +main(int argc, char *argv[]) +{ + sigset_t sigmask, empty_mask; + struct sigaction sa; + fd_set readfds, writefds, exceptfds; + int r; + + sigemptyset(&sigmask); + sigaddset(&sigmask, SIGCHLD); + if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == \-1) { + perror("sigprocmask"); + exit(EXIT_FAILURE); + } + + sa.sa_flags = 0; + sa.sa_handler = child_sig_handler; + sigemptyset(&sa.sa_mask); + if (sigaction(SIGCHLD, &sa, NULL) == \-1) { + perror("sigaction"); + exit(EXIT_FAILURE); + } + + sigemptyset(&empty_mask); + + for (;;) { /* main loop */ + /* Initialize readfds, writefds, and exceptfds + before the pselect() call. (Code omitted.) */ + + r = pselect(nfds, &readfds, &writefds, &exceptfds, + NULL, &empty_mask); + if (r == \-1 && errno != EINTR) { + /* Handle error */ + } + + if (got_SIGCHLD) { + got_SIGCHLD = 0; + + /* Handle signalled event here; e.g., wait() for all + terminated children. (Code omitted.) */ + } + + /* main body of program */ + } +} +.fi +.SS ¼ÂÎã +¼ÂºÝ¤Î¤È¤³¤í +.BR select () +¤ÎÂç»ö¤ÊÅÀ¤Ï²¿¤Ê¤Î¤«¡© +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¹¥¤­¤Ê¤È¤­¤ËÆɤ߽ñ¤­¤Ç¤­¤ë¤ó¤¸¤ã¤Ê¤¤¤Î¡© +.BR select () +¤Î½ÅÍפʤȤ³¤í¤Ï¡¢Ê£¿ô¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òƱ»þ¤Ë´Æ»ë¤Ç¤­¡¢ +¤Ê¤ó¤ÎÆ°¤­¤â¤Ê¤±¤ì¤Ð¥×¥í¥»¥¹¤òŬÀڤ˥¹¥ê¡¼¥×¾õÂ֤˰ܹԤ¹¤ë¤È¤³¤í¤Ë¤¢¤ë¤Î¤À¡£ +Unix ¥×¥í¥°¥é¥Þ¤Ï¡¢ +Ê£¿ô¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÆþ½ÐÎϤòƱ»þ¤Ë°·¤ï¤Í¤Ð¤Ê¤é¤º¡¢ +¤·¤«¤â¥Ç¡¼¥¿¤Îή¤ì¤Ï´Ö·çŪ¤Ç¤¢¤ë¡¢¤È¤¤¤¦¾õ¶·¤Ë¤è¤¯½Ð²ñ¤¦¡£ +ñ¤Ë +.BR read (2) +¤ä +.BR write (2) +¥³¡¼¥ë¤Î¥·¡¼¥±¥ó¥¹¤òºî¤ë¤À¤±¤Ç¤Ï¡¢¤½¤ì¤é¤Î¥³¡¼¥ë¤Î¤É¤ì¤«¤¬ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î¥Ç¡¼¥¿¤òÂԤäƥ֥í¥Ã¥¯¤·¤Æ¤ª¤ê¡¢ +Ê̤Υե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤Ï I/O ¤¬²Äǽ¤Ê¤Î¤Ë»È¤¨¤Ê¤¤¡¢ +¤È¤¤¤¦¤³¤È¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¤À¤í¤¦¡£ +.BR select () +¤ò»È¤¦¤È¤³¤Î¾õ¶·¤Ë¸ú²ÌŪ¤ËÂнè¤Ç¤­¤ë¡£ +.SS SELECT ¤ÎÙÝ +.BR select () +¤ò»È¤ª¤¦¤È¤·¤¿Â¿¤¯¤Î¿Í¤Ï¡¢Íý²ò¤·¤Ë¤¯¤¤µóÆ°¤Ë½Ð¤¯¤ï¤·¡¢·ë²ÌŪ¤Ë +¤Ç¤­¤¿¤â¤Î¤Ï°Ü¿¢À­¤¬¤Ê¤¤¤«¡¢¤è¤¯¤Æ¤â¥®¥ê¥®¥ê¤Î¤â¤Î¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¡£ +Î㤨¤Ð¡¢¾åµ­¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +½¸¹ç¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÈóÄä»ß (nonblocking) ¥â¡¼¥É +¤Ë¤·¤Ê¤¯¤Æ¤â¡¢¤É¤³¤Ë¤â¥Ö¥í¥Ã¥¯¤¬À¸¤¸¤Ê¤¤¤è¤¦Ãí°Õ¤·¤Æ½ñ¤«¤ì¤Æ¤¤¤ë¡£ +Èù̯¤Ê´Ö°ã¤¤¤Ë¤è¤Ã¤Æ¡¢ +.BR select () +¤ò»È¤¦ÍøÅÀ¤Ï´Êñ¤Ë¼º¤ï¤ì¤Æ¤·¤Þ¤¦¡£ +¤½¤³¤Ç¡¢ +.BR select () +¥³¡¼¥ë¤ò»È¤¦¤È¤­¤ËÃí°Õ¤¹¤Ù¤­½ÅÍ×»ö¹à¤òÎóµó¤·¤Æ¤ª¤¯¤³¤È¤Ë¤¹¤ë¡£ +.TP 4 +1. +.BR select () +¤ò»È¤¦¤È¤­¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥È¤ÏÀßÄꤹ¤Ù¤­¤Ç¤Ê¤¤¡£ +½èÍý¤¹¤ë¥Ç¡¼¥¿¤¬Ìµ¤¤¤È¤­¤Ë¤Ï¡¢ +¤¢¤Ê¤¿¤Î¥×¥í¥°¥é¥à¤Ë¤Ï²¿¤â¤¹¤ë¤³¤È¤Ï̵¤¤¤Ï¤º¤Ç¤¢¤ë¡£ +¥¿¥¤¥à¥¢¥¦¥È¤Ë°Í¸¤·¤¿¥³¡¼¥É¤ÏÄ̾ï°Ü¿¢À­¤¬¤Ê¤¯¡¢ +¥Ç¥Ð¥Ã¥°¤âÆñ¤·¤¯¤Ê¤ë¡£ +.TP +2. +¾å½Ò¤·¤¿¤è¤¦¤Ë¡¢ +¸úΨŪ¤Ê¥×¥í¥°¥é¥à¤ò½ñ¤¯¤Ë¤Ï +.I nfds +¤ÎÃͤòŬÀڤ˷׻»¤·¤ÆÍ¿¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +3. +.BR select () +¥³¡¼¥ë¤Î½ªÎ»¸å¤Ë·ë²Ì¤ò¥Á¥§¥Ã¥¯¤·¤Æ¡¢ +ŬÀÚ¤ËÂбþ¤¹¤ë¤Ä¤â¤ê¤Î¤Ê¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢ +¤É¤Î½¸¹ç¤Ë¤â²Ã¤¨¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¼¡¤Î¥ë¡¼¥ë¤â»²¾È¡£ +.TP +4. +.BR select () +¤«¤éÊ֤俸å¤Ë¤Ï¡¢Á´¤Æ¤Î½¸¹ç¤ÎÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤Ä¤¤¤Æ +Æɤ߽ñ¤­²Äǽ¤Ê¾õÂ֤ˤʤäƤ¤¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +5. +.BR read (2), +.BR recv (2), +.BR write (2), +.BR send (2) +¤È¤¤¤Ã¤¿´Ø¿ô¤Ï¡¢¤³¤Á¤é¤¬Í׵ᤷ¤¿Á´¥Ç¡¼¥¿¤òÆɤ߽ñ¤­¤¹¤ëɬÍפÏ\fI¤Ê¤¤\fP¡£ +¤â¤·Á´¥Ç¡¼¥¿¤òÆɤ߽ñ¤­¤¹¤ë¤Ê¤é¡¢¤½¤ì¤Ï¥È¥é¥Õ¥£¥Ã¥¯¤ÎÉé²Ù¤¬¾®¤µ¤¯¡¢ +¥¹¥È¥ê¡¼¥à¤¬Â®¤¤¾ì¹ç¤À¤í¤¦¡£¤³¤Î¾ò·ï¤Ï¾ï¤ËËþ¤¿¤µ¤ì¤ë¤È¤Ï¸Â¤é¤Ê¤¤¡£ +¤³¤ì¤é¤Î´Ø¿ô¤¬´èÄ¥¤Ã¤Æ¤â 1 ¥Ð¥¤¥È¤·¤«Á÷¼õ¿®¤Ç¤­¤Ê¤¤¤è¤¦¤Ê¾ì¹ç¤â +¹Íθ¤ËÆþ¤ì¤Æ¤ä¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +6. +½èÍý¤¹¤ë¥Ç¡¼¥¿Î̤¬¾®¤µ¤¤¤³¤È¤¬¤Ï¤Ã¤­¤ê¤È¤ï¤«¤Ã¤Æ¤¤¤ë¾ì¹ç¤ò½ü¤¤¤Æ¡¢ +°ìÅÙ¤Ë 1 ¥Ð¥¤¥È¤º¤ÄÆɤ߽ñ¤­¤¹¤ë¤è¤¦¤Ê¤³¤È¤Ï¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¥Ð¥Ã¥Õ¥¡¤Îµö¤¹¤«¤®¤ê¤Î¥Ç¡¼¥¿¤ò¤Þ¤È¤á¤ÆÆɤ߽ñ¤­¤·¤Ê¤¤¤È¡¢ +Èó¾ï¤Ë¸úΨ¤¬°­¤¤¡£²¼µ­¤ÎÎã¤Ç¤Ï¥Ð¥Ã¥Õ¥¡¤Ï 1024 ¥Ð¥¤¥È¤Ë¤·¤Æ¤¤¤ë¤¬¡¢ +¤³¤Î¥µ¥¤¥º¤òÂ礭¤¯¤¹¤ë¤Î¤Ï´Êñ¤À¤í¤¦¡£ +.TP +7. +.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 +¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¤À¤í¤¦¡£ +.\" ¤½¤ì¤Ç¤â¤Ê¤ª¡¢´°Á´¤ò´ü¤¹¤ë¤Ê¤é¤Ð¡¢ +.\" ¤³¤ì¤é¤Î¥¨¥é¡¼¤ò¹Íθ¤ËÆþ¤ì¤ëɬÍפ¬¤¢¤ë¡£ +.TP +8. +·è¤·¤Æ¡¢°ú¤­¿ô¤ËŤµ 0 ¤Î¥Ð¥Ã¥Õ¥¡¤ò»ØÄꤷ¤Æ +.BR read (2), +.BR recv (2), +.BR write (2), +.BR send (2) +¤ò¸Æ¤Ó½Ð¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +9. +.BR read (2), +.BR recv (2), +.BR write (2), +.BR send (2) +¤¬ +\fB7.\fP ¤Ë¼¨¤·¤¿°Ê³°¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤·¤¿¾ì¹ç¤ä¡¢ +ÆþÎϷϤδؿô¤Î°ì¤Ä¤¬¥Õ¥¡¥¤¥ëËöÈø¤òɽ¤¹ 0 ¤òÊÖ¤·¤¿¾ì¹ç¤Ï¡¢ +¤½¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¤â¤¦°ìÅÙ select ¤ËÅϤ·¤Æ¤Ï\fI¤Ê¤é¤Ê¤¤\fP¡£ +²¼µ­¤ÎÎã¤Ç¤Ï¡¢¤½¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¤¿¤À¤Á¤Ë¥¯¥í¡¼¥º¤·¡¢ +¤½¤³¤Ë¤Ï \-1 ¤ò¥»¥Ã¥È¤·¤Æ¡¢ +¤½¤ì¤¬½¸¹ç¤Ë´Þ¤Þ¤ì³¤±¤ë¤Î¤òµö¤µ¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¤¤ë¡£ +.TP +10. +¥¿¥¤¥à¥¢¥¦¥È¤ÎÃÍ¤Ï +.BR select () +¤ò¸Æ¤Ö¤¿¤Ó¤Ë½é´ü²½¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +OS ¤Ë¤è¤Ã¤Æ¤Ï timeout ¹½Â¤ÂΤ¬Êѹ¹¤µ¤ì¤ë¾ì¹ç¤¬¤¢¤ë¤«¤é¤Ç¤¢¤ë¡£ +⤷¡¢ +.BR pselect () +¤Ï¼«Ê¬¤Î timeout ¹½Â¤ÂΤòÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.TP +11. +.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 +.\" ʹ¤¤¤¿¤È¤³¤í¤Ç¤Ï¡¢Windows ¤Î¥½¥±¥Ã¥ÈÁØ¤Ï +.\" OOB ¥Ç¡¼¥¿¤òÀµ¤·¤¯½èÍý¤·¤Ê¤¤¤é¤·¤¤¡£ +.\" ¤Þ¤¿¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Á´¤¯¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤è¤¦¤Ê +.\" .BR select () +.\" ¥³¡¼¥ë¤âÀµ¤·¤¯½èÍý¤·¤Ê¤¤¤é¤·¤¤¡£ +.\" ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò°ìÀÚÀßÄꤷ¤Ê¤¤¤Ç timeout ¤ò»È¤¦¤ä¤êÊý¤Ï¡¢ +.\" 1 Éðʲ¼¤ÎÀºÅÙ¤Ç¥×¥í¥»¥¹¤ò¥¹¥ê¡¼¥×¤µ¤»¤ë¤Ë¤ÏÊØÍø¤ÊÊýË¡¤Ê¤Î¤À¤¬ +.\" (³¤­¤ò¸«¤è)¡£ +.SS usleep ¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó +.BR usleep (3) +´Ø¿ô¤ò»ý¤¿¤Ê¤¤¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +Í­¸Â¤Î¥¿¥¤¥à¥¢¥¦¥È¤ò»ØÄꤷ¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÁ´¤¯¥»¥Ã¥È¤»¤º¤Ë +.BR select () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢¤³¤ì¤òÂåÍѤǤ­¤ë¡£ +°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¡£ +.PP +.nf + struct timeval tv; + tv.tv_sec = 0; + tv.tv_usec = 200000; /* 0.2 seconds */ + select(0, NULL, NULL, NULL, &tv); +.fi +.PP +⤷¡¢¤³¤ì¤¬Æ°¤¯¤ÈÊݾڤµ¤ì¤Æ¤¤¤ë¤Î¤Ï Unix ¥·¥¹¥Æ¥à¤Ë¸Â¤é¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR select () +¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Ë»Ä¤Ã¤Æ¤¤¤ë +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÁí¿ô¤òÊÖ¤¹¡£ + +.BR select () +¤¬¥¿¥¤¥à¥¢¥¦¥È¤¹¤ë¤È¡¢ÊÖ¤êÃÍ¤Ï 0 ¤Ë¤Ê¤ë¡£ +¤½¤Î»þ¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Ï¤¹¤Ù¤Æ¶õ¤Ç¤¢¤ë +(¤·¤«¤·¤½¤¦¤Ê¤é¤Ê¤¤¥·¥¹¥Æ¥à¤â¤¢¤ë)¡£ + +ÊÖ¤êÃͤ¬ \-1 ¤Î¾ì¹ç¤Ï¥¨¥é¡¼¤ò°ÕÌ£¤·¡¢ +.I errno +¤¬Å¬Àڤ˥»¥Ã¥È¤µ¤ì¤ë¡£¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +ÊÖ¤µ¤ì¤¿½¸¹ç¤ÎÆâÍƤ乽¤ÂÎ \fIstruct timeout\fP ¤ÎÆâÍÆ¤Ï +̤ÄêµÁ¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¤·¤«¤· +.BR pselect () +¤Ï·è¤·¤Æ +.I ntimeout +¤òÊѹ¹¤·¤Ê¤¤¡£ +.SH Ãí°Õ +°ìÈÌŪ¤Ë¸À¤Ã¤Æ¡¢¥½¥±¥Ã¥È¤ò¥µ¥Ý¡¼¥È¤¹¤ëÁ´¤Æ¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ï +.BR select () +¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.BR select () +¤ò»È¤¦¤È¡¢¥×¥í¥°¥é¥Þ¤¬¥¹¥ì¥Ã¥É¡¢¥Õ¥©¡¼¥¯¡¢IPC¡¢¥·¥°¥Ê¥ë¡¢¥á¥â¥ê¶¦Í­¡¢ +Åù¡¹¤ò»È¤Ã¤Æ¤â¤Ã¤ÈÊ£»¨¤ÊÊýË¡¤Ç²ò·è¤·¤è¤¦¤È¤¹¤ë¿¤¯¤ÎÌäÂ꤬¡¢ +°Ü¿¢À­¤¬¤¢¤ê¤«¤Ä¸úΨŪ¤ÊÊýË¡¤Ç²ò·è¤Ç¤­¤ë¡£ +.PP +.BR poll (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.BR select () +¤ÈƱ¤¸µ¡Ç½¤ò»ý¤Ã¤Æ¤ª¤ê¡¢ +¤Þ¤Ð¤é¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤ò´Æ»ë¤¹¤ë¾ì¹ç¤Ë +¤¤¤¯¤é¤«¸úΨ¤¬¤è¤¤¡£ +¸½ºß¤Ç¤Ï¹­¤¯ÍøÍѲÄǽ¤Ç¤¢¤ë¤¬¡¢°ÊÁ°¤Ï +.BR select () +¤è¤ê°Ü¿¢À­¤ÎÌ̤ÇÎô¤Ã¤Æ¤¤¤¿¡£ +.PP +Linux Æȼ«¤Î +.BR epoll (7) +API ¤Ï¡¢Â¿¿ô¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò´Æ»ë¤¹¤ë¾ì¹ç¤Ë +.BR select (2) +¤ä +.BR poll (2) +¤è¤ê¤â¸úΨŪ¤Ê¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤·¤Æ¤¤¤ë¡£ +.SH Îã +.BR select () +¤ÎËÜÅö¤ËÊØÍø¤ÊÅÀ¤ò¼¨¤¹¡¢¤è¤¤Îã¤ò¾Ò²ð¤¹¤ë¡£ +°Ê²¼¤Î¥ê¥¹¥È¤Ï¡¢¤¢¤ë TCP ¥Ý¡¼¥È¤«¤éÊ̤Υݡ¼¥È¤ØžÁ÷¤ò¹Ô¤¦ +TCP ¥Õ¥©¥ï¡¼¥É¥×¥í¥°¥é¥à¤Ç¤¢¤ë¡£ +.PP +.nf +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int forward_port; + +#undef max +#define max(x,y) ((x) > (y) ? (x) : (y)) + +static int +listen_socket(int listen_port) +{ + struct sockaddr_in a; + int s; + int yes; + + if ((s = socket(AF_INET, SOCK_STREAM, 0)) == \-1) { + perror("socket"); + return \-1; + } + yes = 1; + if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, + (char *) &yes, sizeof(yes)) == \-1) { + perror("setsockopt"); + close(s); + return \-1; + } + memset(&a, 0, sizeof(a)); + a.sin_port = htons(listen_port); + a.sin_family = AF_INET; + if (bind(s, (struct sockaddr *) &a, sizeof(a)) == \-1) { + perror("bind"); + close(s); + return \-1; + } + printf("accepting connections on port %d\\n", listen_port); + listen(s, 10); + return s; +} + +static int +connect_socket(int connect_port, char *address) +{ + struct sockaddr_in a; + int s; + + if ((s = socket(AF_INET, SOCK_STREAM, 0)) == \-1) { + perror("socket"); + close(s); + return \-1; + } + + memset(&a, 0, sizeof(a)); + a.sin_port = htons(connect_port); + a.sin_family = AF_INET; + + if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) { + perror("bad IP address format"); + close(s); + return \-1; + } + + if (connect(s, (struct sockaddr *) &a, sizeof(a)) == \-1) { + perror("connect()"); + shutdown(s, SHUT_RDWR); + close(s); + return \-1; + } + return s; +} + +#define SHUT_FD1 do { \\ + if (fd1 >= 0) { \\ + shutdown(fd1, SHUT_RDWR); \\ + close(fd1); \\ + fd1 = \-1; \\ + } \\ + } while (0) + +#define SHUT_FD2 do { \\ + if (fd2 >= 0) { \\ + shutdown(fd2, SHUT_RDWR); \\ + close(fd2); \\ + fd2 = \-1; \\ + } \\ + } while (0) + +#define BUF_SIZE 1024 + +int +main(int argc, char *argv[]) +{ + int h; + int fd1 = \-1, fd2 = \-1; + char buf1[BUF_SIZE], buf2[BUF_SIZE]; + int buf1_avail, buf1_written; + int buf2_avail, buf2_written; + + if (argc != 4) { + fprintf(stderr, "Usage\\n\\tfwd " + " \\n"); + exit(EXIT_FAILURE); + } + + signal(SIGPIPE, SIG_IGN); + + forward_port = atoi(argv[2]); + + h = listen_socket(atoi(argv[1])); + if (h == \-1) + exit(EXIT_FAILURE); + + for (;;) { + int r, nfds = 0; + fd_set rd, wr, er; + + FD_ZERO(&rd); + FD_ZERO(&wr); + FD_ZERO(&er); + FD_SET(h, &rd); + nfds = max(nfds, h); + if (fd1 > 0 && buf1_avail < BUF_SIZE) { + FD_SET(fd1, &rd); + nfds = max(nfds, fd1); + } + if (fd2 > 0 && buf2_avail < BUF_SIZE) { + FD_SET(fd2, &rd); + nfds = max(nfds, fd2); + } + if (fd1 > 0 && buf2_avail \- buf2_written > 0) { + FD_SET(fd1, &wr); + nfds = max(nfds, fd1); + } + if (fd2 > 0 && buf1_avail \- buf1_written > 0) { + FD_SET(fd2, &wr); + nfds = max(nfds, fd2); + } + if (fd1 > 0) { + FD_SET(fd1, &er); + nfds = max(nfds, fd1); + } + if (fd2 > 0) { + FD_SET(fd2, &er); + nfds = max(nfds, fd2); + } + + r = select(nfds + 1, &rd, &wr, &er, NULL); + + if (r == \-1 && errno == EINTR) + continue; + + if (r == \-1) { + perror("select()"); + exit(EXIT_FAILURE); + } + + if (FD_ISSET(h, &rd)) { + unsigned int l; + struct sockaddr_in client_address; + + memset(&client_address, 0, l = sizeof(client_address)); + r = accept(h, (struct sockaddr *) &client_address, &l); + if (r == \-1) { + perror("accept()"); + } else { + SHUT_FD1; + SHUT_FD2; + buf1_avail = buf1_written = 0; + buf2_avail = buf2_written = 0; + fd1 = r; + fd2 = connect_socket(forward_port, argv[3]); + if (fd2 == \-1) + SHUT_FD1; + else + printf("connect from %s\\n", + inet_ntoa(client_address.sin_addr)); + } + } + + /* NB: read oob data before normal reads */ + + if (fd1 > 0) + if (FD_ISSET(fd1, &er)) { + char c; + + r = recv(fd1, &c, 1, MSG_OOB); + if (r < 1) + SHUT_FD1; + else + send(fd2, &c, 1, MSG_OOB); + } + if (fd2 > 0) + if (FD_ISSET(fd2, &er)) { + char c; + + r = recv(fd2, &c, 1, MSG_OOB); + if (r < 1) + SHUT_FD1; + else + send(fd1, &c, 1, MSG_OOB); + } + if (fd1 > 0) + if (FD_ISSET(fd1, &rd)) { + r = read(fd1, buf1 + buf1_avail, + BUF_SIZE \- buf1_avail); + if (r < 1) + SHUT_FD1; + else + buf1_avail += r; + } + if (fd2 > 0) + if (FD_ISSET(fd2, &rd)) { + r = read(fd2, buf2 + buf2_avail, + BUF_SIZE \- buf2_avail); + if (r < 1) + SHUT_FD2; + else + buf2_avail += r; + } + if (fd1 > 0) + if (FD_ISSET(fd1, &wr)) { + r = write(fd1, buf2 + buf2_written, + buf2_avail \- buf2_written); + if (r < 1) + SHUT_FD1; + else + buf2_written += r; + } + if (fd2 > 0) + if (FD_ISSET(fd2, &wr)) { + r = write(fd2, buf1 + buf1_written, + buf1_avail \- buf1_written); + if (r < 1) + SHUT_FD2; + else + buf1_written += r; + } + + /* check if write data has caught read data */ + + if (buf1_written == buf1_avail) + buf1_written = buf1_avail = 0; + if (buf2_written == buf2_avail) + buf2_written = buf2_avail = 0; + + /* one side has closed the connection, keep + writing to the other side until empty */ + + if (fd1 < 0 && buf1_avail \- buf1_written == 0) + SHUT_FD2; + if (fd2 < 0 && buf2_avail \- buf2_written == 0) + SHUT_FD1; + } + exit(EXIT_SUCCESS); +} +.fi +.PP +¾åµ­¤Î¥×¥í¥°¥é¥à¤Ï¡¢¤Û¤È¤ó¤É¤Î¼ïÎà¤Î TCP Àܳ¤ò¥Õ¥©¥ï¡¼¥É¤¹¤ë¡£ +.B telnet +¥µ¡¼¥Ð¤Ë¤è¤Ã¤ÆÃæ·Ñ¤µ¤ì¤ë OOB ¥·¥°¥Ê¥ë¥Ç¡¼¥¿¤â°·¤¨¤ë¡£ +¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥Ç¡¼¥¿¥Õ¥í¡¼¤òÁÐÊý¸þ¤ËƱ»þ¤ËÁ÷¤ë¤È¤¤¤¦¡¢ +¤ä¤ä¤³¤·¤¤ÌäÂê¤â½èÍý¤Ç¤­¤ë¡£ +.BR fork (2) +¥³¡¼¥ë¤ò»È¤Ã¤Æ¡¢³Æ¥¹¥È¥ê¡¼¥à¤´¤È¤ËÀìÍѤΥ¹¥ì¥Ã¥É¤òÍѤ¤¤ë¤Û¤¦¤¬¸úΨŪ¤À¡¢ +¤È¤¤¤¦¿Í¤â¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£¤·¤«¤·¡¢¤³¤ì¤Ï¹Í¤¨¤Æ¤¤¤ë¤è¤ê¤º¤Ã¤È¤ä¤ä¤³¤·¤¤¡£ +¤¢¤ë¤¤¤Ï¡¢ +.BR fcntl (2) +¤ò»È¤Ã¤ÆÈó¥Ö¥í¥Ã¥¯ I/O ¤ò¥»¥Ã¥È¤¹¤ì¤ÐÎɤ¤¡¢¤È¤¤¤¦¥¢¥¤¥Ç¥¢¤â¤¢¤ë¤À¤í¤¦¡£ +¤³¤ì¤Ë¤â¼ÂºÝ¤Ë¤ÏÌäÂ꤬¤¢¤ê¡¢¥¿¥¤¥à¥¢¥¦¥È¤¬Èó¸úΨŪ¤Ëµ¯¤³¤Ã¤Æ¤·¤Þ¤¦¡£ + +¤³¤Î¥×¥í¥°¥é¥à¤Ï°ìÅ٤ˤҤȤİʾå¤ÎƱ»þÀܳ¤ò°·¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¤¬¡¢ +¤½¤ÎÍͤ˳ÈÄ¥¤¹¤ë¤Î¤Ï´Êñ¤Ç¡¢¥Ð¥Ã¥Õ¥¡¤Î¥ê¥ó¥¯¥ê¥¹¥È¤ò +(Àܳ¤´¤È¤Ë¤Ò¤È¤Ä¤º¤Ä) »È¤¨¤Ð¤è¤¤¡£ +¸½»þÅÀ¤Î¤â¤Î¤Ç¤Ï¡¢¿·¤·¤¤Àܳ¤¬¤¯¤ë¤È¸Å¤¤Àܳ¤ÏÍî¤Á¤Æ¤·¤Þ¤¦¡£ +.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) +.\" .SH AUTHORS +.\" This man page was written by Paul Sheer. diff --git a/release/man2/semctl.2 b/release/man2/semctl.2 new file mode 100644 index 00000000..56e2d1b1 --- /dev/null +++ b/release/man2/semctl.2 @@ -0,0 +1,523 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" and Copyright 2004, 2005 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 Tue Oct 22 17:53:56 1996 by Eric S. Raymond +.\" Modified Fri Jun 19 10:59:15 1998 by Andries Brouwer +.\" Modified Sun Feb 18 01:59:29 2001 by Andries Brouwer +.\" Modified 20 Dec 2001, Michael Kerrisk +.\" Modified 21 Dec 2001, aeb +.\" Modified 27 May 2004, Michael Kerrisk +.\" Added notes on CAP_IPC_OWNER requirement +.\" Modified 17 Jun 2004, Michael Kerrisk +.\" Added notes on CAP_SYS_ADMIN requirement for IPC_SET and IPC_RMID +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Rewrote semun text +.\" Added semid_ds and ipc_perm structure definitions +.\" 2005-08-02, mtk: Added IPC_INFO, SEM_INFO, SEM_STAT descriptions. +.\" +.\" Japanese Version Copyright (c) 1997,1998 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Modified 1998-09-10, HANATAKA Shinya +.\" Updated & Modified 2001-06-03, Yuichi SATO +.\" Updated & Modified 2002-01-02, Yuichi SATO +.\" Updated & Modified 2005-01-03, Yuichi SATO +.\" Updated & Modified 2005-10-10, Akihiro MOTOKI +.\" +.\"WORD: semaphore ¥»¥Þ¥Õ¥© +.\"WORD: semaphore set ¥»¥Þ¥Õ¥©½¸¹ç +.\"WORD: union ¶¦ÍÑÂÎ +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡ +.\"WORD: member ¥á¥ó¥Ð¡¼ +.\"WORD: superuser ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶ +.\"WORD: effective uid ¼Â¸ú¥æ¡¼¥¶ ID +.\"WORD: creator ºîÀ®¼Ô +.\"WORD: owner ½êÍ­¼Ô +.\"WORD: entry ¥¨¥ó¥È¥ê +.\"WORD: undo ¥¢¥ó¥É¥¥ +.\"WORD: implement ¼ÂÁõ +.\"WORD: feature test macro µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\" +.TH SEMCTL 2 2009-09-27 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +semctl \- ¥»¥Þ¥Õ¥©¤ÎÀ©¸æÁàºî¤ò¹Ô¤Ê¤¦ +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int semctl(int " semid ", int " semnum ", int " cmd ", ...);" +.fi +.SH ÀâÌÀ +.BR semctl () +¤Ï¡¢ +.I semid +¤Ç»ØÄꤵ¤ì¤¿¥»¥Þ¥Õ¥©½¸¹ç (semaphore set) +¤Þ¤¿¤Ï¥»¥Þ¥Õ¥©½¸¹ç¤Î +.I semnun +ÈÖÌܤΥ»¥Þ¥Õ¥©¤ËÂФ·¤Æ¡¢ +.I cmd +¤Ç»ØÄꤵ¤ì¤¿À©¸æÁàºî¤ò¹Ô¤Ê¤¦ +(½¸¹çÆâ¤Î¥»¥Þ¥Õ¥©¤ÎÈÖ¹æ¤Ï 0 ¤«¤é»Ï¤Þ¤ë)¡£ +.PP +¤³¤Î´Ø¿ô¤Ï¡¢ +.I cmd +¤ÎÃͤ˰͸¤·¤Æ¡¢3 ¸Ä¤Þ¤¿¤Ï 4 ¸Ä¤Î°ú¤­¿ô¤ò»ý¤Ä¡£ +°ú¤­¿ô¤¬ 4 ¸Ä¤Î¾ì¹ç¡¢Âè 4 °ú¤­¿ô¤Î·¿¤Ï +.I "union semun" +¤Ç¤¢¤ë¡£ +\fI¸Æ¤Ó½Ð¤·¸µ¥×¥í¥°¥é¥à\fP¤Ï¡¢ +¤³¤Î¶¦ÍÑÂÎ (union) ¤ò°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.nf +.in +4n +union semun { + int val; /* SETVAL ¤ÎÃÍ */ + struct semid_ds *buf; /* IPC_STAT, IPC_SET ÍѤΥХåե¡ */ + unsigned short *array; /* GETALL, SETALL ÍѤÎÇÛÎó */ + struct seminfo *__buf; /* IPC_INFO ÍѤΥХåե¡ + (Linux ¸ÇÍ­) */ +}; +.in +.fi +.PP +.I semid_ds +¥Ç¡¼¥¿¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.nf +.in +4n + +struct semid_ds { + struct ipc_perm sem_perm; /* ½êÍ­¸¢¤Èµö²Ä */ + time_t sem_otime; /* ºÇ¸å¤Î semop ¤Î»þ¹ï */ + time_t sem_ctime; /* ºÇ¸å¤ËÊѹ¹¤¬¹Ô¤ï¤ì¤¿»þ¹ï */ + unsigned short sem_nsems; /* ½¸¹çÆâ¤Î¥»¥Þ¥Õ¥©¤Î¿ô */ +}; +.fi +.PP +.in +.fi +.PP +.I ipc_perm +¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +(¶¯Ä´¤µ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Ï +.B IPC_SET +¤ò»È¤Ã¤ÆÀßÄê²Äǽ¤Ç¤¢¤ë): +.PP +.nf +.in +4n +struct ipc_perm { + key_t __key; /* semget(2) ¤ËÍ¿¤¨¤é¤ì¤ë¥­¡¼ */ + uid_t \fBuid\fP; /* ½êÍ­¼Ô (owner) ¤Î¼Â¸ú UID */ + gid_t \fBgid\fP; /* ½êÍ­¼Ô¤Î¼Â¸ú GID */ + uid_t cuid; /* ºîÀ®¼Ô (creator) ¤Î¼Â¸ú UID */ + gid_t cgid; /* ºîÀ®¼Ô¤Î¼Â¸ú GID */ + unsigned short \fBmode\fP; /* µö²Ä */ + unsigned short __seq; /* ¥·¡¼¥±¥ó¥¹ÈÖ¹æ */ +}; +.in +.fi +.PP +.I cmd +¤È¤·¤ÆÍ­¸ú¤ÊÃÍ¤Ï +.TP 10 +.B IPC_STAT +.I semid +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥«¡¼¥Í¥ë¥Ç¡¼¥¿¹½Â¤ÂΤξðÊó¤ò +.I arg.buf +¤Ç»Ø¤µ¤ì¤¿ +.I semid_ds +¹½Â¤ÂΤإ³¥Ô¡¼¤¹¤ë¡£ +.I semnum +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÂФ¹¤ë +Æɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B IPC_SET +.I arg.buf +¤Ç»ØÄꤵ¤ì¤¿ +.I semid_ds +¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Î¤¤¤¯¤Ä¤«¤ÎÃͤò¡¢ +¤³¤Î¥»¥Þ¥Õ¥©¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥«¡¼¥Í¥ë¥Ç¡¼¥¿¹½Â¤ÂΤ˽ñ¤­¹þ¤ß¡¢ +.I sem_ctime +¥á¥ó¥Ð¡¼¤ÎÃͤ⹹¿·¤¹¤ë¡£ +¹½Â¤ÂΤΰʲ¼¤Î¥á¥ó¥Ð¡¼¤¬¹¹¿·¤µ¤ì¤ë: +.IR sem_perm.uid , +.IR sem_perm.gid , +.I sem_perm.mode +(¤ÎºÇ²¼°Ì 9 ¥Ó¥Ã¥È)¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤¬½êÍ­¼Ô +.RI ( sem_perm.uid ) +¤Þ¤¿¤ÏºîÀ®¼Ô +.RI ( sem_perm.cuid ) +¤È°ìÃפ¹¤ë¤«¡¢¸Æ¤Ó½Ð¤·¤¿¿Í¤¬Æø¢¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I semnum +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.B IPC_RMID +¥»¥Þ¥Õ¥©½¸¹ç¤ò¤¿¤À¤Á¤Ëºï½ü¤·¡¢¤½¤Î½¸¹ç¾å¤Î +.BR semop (2) +¥³¡¼¥ë¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥×¥í¥»¥¹¤òÌܳФᤵ¤»¤ë +(¥¨¥é¡¼Ãͤ¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë +.B EIDRM +¤¬ÀßÄꤵ¤ì¤ë)¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬ +¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ÎºîÀ®¼Ô¤Þ¤¿¤Ï½êÍ­¼Ô¤È°ìÃפ¹¤ë¤«¡¢ +¸Æ¤Ó½Ð¤·¤¿¿Í¤¬Æø¢¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I semnum +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.BR IPC_INFO " (Linux ¸ÇÍ­)" +¥·¥¹¥Æ¥àÁ´ÂΤǤΥ»¥Þ¥Õ¥©¤ÎÀ©¸Â¤È¥Ñ¥é¥á¡¼¥¿¤Ë´Ø¤¹¤ë¾ðÊó¤ò¡¢ +.I arg.__buf +¤¬»Ø¤¹¹½Â¤ÂΤËÆþ¤ì¤ÆÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï +.I seminfo +·¿¤Ç¤¢¤ë¡£ +.I seminfo +¤Ï +.B _GNU_SOURCE +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.nf +.in +4n + +struct seminfo { + int semmap; /* ¥»¥Þ¥Õ¥©¡¦¥Þ¥Ã¥×¤ÎºÇÂ票¥ó¥È¥ê¿ô; + ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + int semmni; /* ¥»¥Þ¥Õ¥©½¸¹ç¤ÎºÇÂç¿ô */ + int semmns; /* Á´¥»¥Þ¥Õ¥©½¸¹çÃæ¤Î¥»¥Þ¥Õ¥©¤Î + ºÇÂç¿ô */ + int semmnu; /* ¥¢¥ó¥É¥¥¹½Â¤ÂΤΥ·¥¹¥Æ¥àÁ´ÂΤǤΠ+ ºÇÂç¿ô; ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + int semmsl; /* °ì¤Ä¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ÎºÇÂ祻¥Þ¥Õ¥©¿ô */ + int semopm; /* semop(2) ¤ËÅϤ¹Áàºî¤ÎºÇÂç¿ô */ + int semume; /* ¥×¥í¥»¥¹¤¢¤¿¤ê¤Î¥¢¥ó¥É¥¥¡¦¥¨¥ó¥È¥ê + ¤ÎºÇÂç¿ô; ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + int semusz; /* ¹½Â¤ÂÎ sem_undo ¤Î¥µ¥¤¥º */ + int semvmx; /* ¥»¥Þ¥Õ¥©¤ÎºÇÂçÃÍ */ + int semaem; /* ¥»¥Þ¥Õ¥©¤ÎÄ´À° (semaphore adjustment; + SEM_UNDO) ¤Î¤¿¤á¤Ëµ­Ï¿¤µ¤ì¤ëºÇÂçÃÍ */ +}; + +.in +.fi +ÀßÄê +.IR semmsl , +.IR semmns , +.IR semopm , +.I semmni +¤Ï +.I /proc/sys/kernel/sem +·Ðͳ¤ÇÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +¾Ü¤·¤¯¤Ï +.BR proc (5) +¤ò»²¾È¡£ +.TP +.BR SEM_INFO " (Linux ¸ÇÍ­)" +.B IPC_INFO +¤Î¤È¤­¤ÈƱ¤¸¾ðÊó¤ò³ÊǼ¤·¤¿ +.I seminfo +¹½Â¤ÂΤòÊÖ¤¹¡£ +⤷¡¢°Ê²¼¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥»¥Þ¥Õ¥©¤¬¾ÃÈñ¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à»ñ¸»¤Ë +´Ø¤¹¤ë¾ðÊ󤬳ÊǼ¤µ¤ì¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +.I semusz +¥Õ¥£¡¼¥ë¥É¤Ï¸½ºß¥·¥¹¥Æ¥à¾å¤Ë¸ºß¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤Î¿ô¤òÊÖ¤¹¡£ +.I semaem +¥Õ¥£¡¼¥ë¥É¤Ï¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Ë´Þ¤Þ¤ì¤ë +¥»¥Þ¥Õ¥©¤ÎÁí¿ô¤òÊÖ¤¹¡£ +.TP +.BR SEM_STAT " (Linux ¸ÇÍ­)" +.B IPC_STAT +¤ÈƱ¤¸¤¯ +.I semid_ds +¹½Â¤ÂΤòÊÖ¤¹¡£ +⤷¡¢ +.I semid +°ú¤­¿ô¤Ï¡¢¥»¥Þ¥Õ¥©¼±Ê̻ҤǤϤʤ¯¡¢¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¥»¥Þ¥Õ¥©½¸¹ç +¤Ë´Ø¤¹¤ë¾ðÊó¤ò´ÉÍý¤¹¤ë¥«¡¼¥Í¥ë¤ÎÆâÉôÇÛÎó¤Ø¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤¢¤ë¡£ +.TP +.B GETALL +½¸¹ç¤ÎÁ´¤Æ¤Î¥»¥Þ¥Õ¥©¤Î +.B semval +¤ÎÃÍ (¸½ºß¤ÎÃÍ) ¤ò +.I arg.array +¤ËÊÖ¤¹¡£ +.I semnum +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÆɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B GETNCNT +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B semncnt +¤ÎÃͤòÊÖ¤¹ (½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B semval +¤ÎÁý²Ã¤òÂԤäƤ¤¤ë¥×¥í¥»¥¹¤Î¿ô¤òÊÖ¤¹)¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÆɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B GETPID +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B sempid +¤ÎÃÍ (½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤ËºÇ¸å¤Ë +.BR semop (2) +¥³¡¼¥ë¤ò¼Â¹Ô¤·¤¿¥×¥í¥»¥¹¤Î PID) ¤òÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÆɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B GETVAL +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B semval +¤ÎÃͤòÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÆɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B GETZCNT +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B semzcnt +¤ÎÃͤòÊÖ¤¹ (½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B semval +¤ÎÃͤ¬ 0 ¤Ë¤Ê¤ë¤Î¤òÂԤäƤ¤¤ë¥×¥í¥»¥¹¤Î¿ô¤òÊÖ¤¹)¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÆɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B SETALL +½¸¹ç¤ÎÁ´¤Æ¤Î¥»¥Þ¥Õ¥©¤Î +.B semval +¤Ë +.I arg.array +¤Ç»ØÄꤵ¤ì¤¿ÃͤòÀßÄꤹ¤ë¡£ +¤½¤Î½¸¹ç¤Ë´ØÏ¢¤¹¤ë +.I semid_ds +¹½Â¤ÂΤΠ+.I sem_ctime +¥á¥ó¥Ð¡¼¤ÎÃͤ⹹¿·¤¹¤ë¡£ +Á´¤Æ¤Î¥×¥í¥»¥¹¤Î¥»¥Þ¥Õ¥©¤ÎÊѹ¹¤Ë¤Ä¤¤¤Æ¤Î¥¢¥ó¥É¥¥¡¦¥¨¥ó¥È¥ê +.RB ( semop (2) +¤ò»²¾È) ¤Ï¾Ãµî (clear) ¤µ¤ì¤ë¡£ +¥»¥Þ¥Õ¥©¤ÎÃͤÎÊѹ¹¤Ë¤è¤ê¡¢Â¾¤Î¥×¥í¥»¥¹Æâ¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë +.BR semop (2) +¥³¡¼¥ë¤Î³¹Ô¤¬µö²Ä¤µ¤ì¤ë¤È¡¢¤½¤ì¤é¤Î¥×¥í¥»¥¹¤Ïµ¯¤³¤µ¤ì¤ë (wake up)¡£ +.I semnum +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Ë +Êѹ¹ (½ñ¤­¹þ¤ß) µö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B SETVAL +½¸¹ç¤Î +.I semnum +ÈÖÌܤΥ»¥Þ¥Õ¥©¤Î +.B semval +¤Ë +.I arg.val +¤ÎÃͤòÀßÄꤹ¤ë¡£¤½¤Î½¸¹ç¤Ë´ØÏ¢¤¹¤ë +.I semid_ds +¹½Â¤ÂΤΠ+.I sem_ctime +¥á¥ó¥Ð¡¼¤ÎÃͤ⹹¿·¤¹¤ë¡£ +Á´¤Æ¤Î¥×¥í¥»¥¹¤Î¥»¥Þ¥Õ¥©¤ÎÊѹ¹¤Ë¤Ä¤¤¤Æ¤Î¥¢¥ó¥É¥¥¡¦¥¨¥ó¥È¥ê¤Ï¾Ãµî¤µ¤ì¤ë¡£ +¥»¥Þ¥Õ¥©¤ÎÃͤÎÊѹ¹¤Ë¤è¤ê¡¢Â¾¤Î¥×¥í¥»¥¹Æâ¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë +.BR semop (2) +¥³¡¼¥ë¤Î³¹Ô¤¬µö²Ä¤µ¤ì¤ë¤È¡¢¤½¤ì¤é¤Î¥×¥í¥»¥¹¤Ïµ¯¤³¤µ¤ì¤ë (wake up)¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Ë +Êѹ¹ (½ñ¤­¹þ¤ß) µö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.BR semctl () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¤½¤Î¥¨¥é¡¼¤ò¼¨¤¹¡£ + +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I cmd +¤Ë¤è¤Ã¤Æ°Ê²¼¤ÎÉé¤Ç¤Ê¤¤ÃͤòÊÖ¤¹: +.TP 12 +.B GETNCNT +.B semncnt +¤ÎÃÍ +.TP +.B GETPID +.B sempid +¤ÎÃÍ +.TP +.B GETVAL +.B semval +¤ÎÃÍ +.TP +.B GETZCNT +.B semzcnt +¤ÎÃÍ +.TP +.B IPC_INFO +Á´¤Æ¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Ë´Ø¤¹¤ë¾ðÊó¤ò´ÉÍý¤·¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤ÎÆâÉôÇÛÎó¤Î»ÈÍÑÃæ +¥¨¥ó¥È¥ê¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎºÇÂçÃÍ +(¤³¤Î¾ðÊó¤Ï¡¢¥·¥¹¥Æ¥à¤ÎÁ´¤Æ¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Ë´Ø¤¹¤ë¾ðÊó¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë +.B SEM_STAT +Áàºî¤ò·«¤êÊÖ¤·¼Â¹Ô¤¹¤ëºÝ¤Ë»ÈÍѤǤ­¤ë) +.TP +.B SEM_INFO +.B IPC_INFO +¤ÈƱ¤¸ +.TP +.B SEM_STAT +.I semid +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¥»¥Þ¥Õ¥©½¸¹ç¤Î¼±ÊÌ»Ò +.LP +.I cmd +¤ÎÃͤ¬¤½¤ì°Ê³°¤Î¾ì¹ç¡¢À®¸ù¤¹¤ë¤È 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï +.I errno +¤Ë¤Ï°Ê²¼¤ÎÃͤΤɤ줫¤¬ÀßÄꤵ¤ì¤ë: +.TP +.B EACCES +.I cmd +°ú¤­¿ô¤¬ +.BR GETALL , +.BR GETPID , +.BR GETVAL , +.BR GETNCNT , +.BR GETZCNT , +.BR IPC_STAT , +.BR SEM_STAT , +.BR SETALL , +.B SETVAL +¤Î¤¦¤Á¤Î²¿¤ì¤«¤ÎÃͤò»ý¤Á¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬¥»¥Þ¥Õ¥©¤ËÂФ·¤ÆɬÍפȤµ¤ì¤ëµö²Ä¤È +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +.I arg.buf +¤Þ¤¿¤Ï +.I arg.array +¤Ç»Ø¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.B EIDRM +¥»¥Þ¥Õ¥©½¸¹ç¤¬ºï½ü¤µ¤ì¤¿¡£ +.TP +.B EINVAL +.I cmd +¤Þ¤¿¤Ï +.I semid +¤Ë̵¸ú¤ÊÃͤ¬»ØÄꤵ¤ì¤¿¡£ +¤â¤·¤¯¤Ï¡¢ +.B SEM_STAT +Áàºî¤Î¾ì¹ç¤Ë¡¢ +.I semid +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹Ãͤ¬¸½ºß̤»ÈÍѤÎÇÛÎó¤Î¥¹¥í¥Ã¥È¤ò»²¾È¤¤¤Æ¤¤¤¿¡£ +.TP +.B EPERM +.I cmd +°ú¤­¿ô¤Ë +.B IPC_SET +¤Þ¤¿¤Ï +.B IPC_RMID +¤¬»ØÄꤵ¤ì¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬¥»¥Þ¥Õ¥©¤Î +.RI ( sem_perm.cuid +¤Ç¸«¤Ä¤«¤ë) ºîÀ®¼Ô¤Þ¤¿¤Ï +.RI ( sem_perm.uid +¤Ç¸«¤Ä¤«¤ë) ½êÍ­¼Ô¤Ç¤â¤Ê¤¯¡¢ +¥×¥í¥»¥¹¤¬ +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤¡£ +.TP +.B ERANGE +.I cmd +°ú¤­¿ô¤Ë +.B SETALL +¤Þ¤¿¤Ï +.B SETVAL +¤¬»ØÄꤵ¤ì¡¢(½¸¹ç¤Î¥»¥Þ¥Õ¥©¤Î¤É¤ì¤«¤Î) +.B semval +¤ËÀßÄꤵ¤ì¤ëÃͤ¬ 0 ¤è¤ê¾®¤µ¤¤¤«¡¢¼ÂÁõ¤ÎÀ©¸Â +.B SEMVMX +¤è¤ê¤âÂ礭¤¤¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.\" SVr4 ¤Ë¤Ï¡¢Â¾¤Ë EINVAL, EOVERFLOW ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.SH Ãí°Õ +.BR IPC_INFO , +.BR SEM_STAT , +.B SEM_INFO +Áàºî¤Ï +.BR ipcs (8) +¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ³äÅö¤é¤ì¤¿»ñ¸»¤Ë¤Ä¤¤¤Æ¾ðÊó¤òÄ󶡤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +¾­ÍèŪ¤Ë¤Ï¤³¤ì¤é¤ÏÊѹ¹¤µ¤ì¤ë¤«¡¢ +/proc ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë°ÜÆ°¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +\fI¹½Â¤ÂÎ semid_ds\fP Æâ¤Î¿¤¯¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +Linux 2.2 ¤Ç¤Ï +.I short +·¿¤À¤Ã¤¿¤¬¡¢Linux 2.4 ¤Ç¤Ï +.I long +·¿¤Ë¤Ê¤Ã¤¿¡£ +¤³¤ÎÍøÅÀ¤òÀ¸¤«¤¹¤Ë¤Ï¡¢glibc-2.1.91 °Ê¹ß¤Î´Ä¶­²¼¤Ç +ºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ì¤Ð½½Ê¬¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¿·¤·¤¤·Á¼°¤Î¸Æ¤Ó½Ð¤·¤È¸Å¤¤·Á¼°¤Î¸Æ¤Ó½Ð¤·¤ò +.I cmd +Æâ¤Î +.B IPC_64 +¥Õ¥é¥°¤Ç¶èÊ̤¹¤ë¡£ +.PP +½é´ü¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢ +.I semun +¶¦ÍÑÂÎ¤Ï \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤¿¤¬¡¢ +POSIX.1-2001 ¤Ç¤Ï¸Æ¤Ó½Ð¤·Â¦¤¬¤³¤Î¶¦ÍÑÂΤòÄêµÁ¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤Î¶¦ÍÑÂΤ¬ÄêµÁ¤µ¤ì¤Æ\fI¤¤¤Ê¤¤\fP glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ +¥Þ¥¯¥í +.B _SEM_SEMUN_UNDEFINED +¤¬ \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +°Ê²¼¤Ï +.BR semctl () +¥³¡¼¥ë¤Ë±Æ¶Á¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤Î¥·¥¹¥Æ¥àÀ©¸Â: +.TP +.B SEMVMX +.B semval +¤ÎºÇÂçÃÍ : ¼ÂÁõ°Í¸ (32767)¡£ +.LP +°Ü¿¢À­¤ò¹â¤á¤ë¤¿¤á¤Î°ìÈÖÎɤ¤ÊýË¡¤Ï¡¢¾ï¤Ë 4 ¸Ä¤Î°ú¤­¿ô¤Ç +.BR semctl () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ipc (2), +.BR semget (2), +.BR semop (2), +.BR capabilities (7), +.BR sem_overview (7), +.BR svipc (7) diff --git a/release/man2/semget.2 b/release/man2/semget.2 new file mode 100644 index 00000000..536ba52f --- /dev/null +++ b/release/man2/semget.2 @@ -0,0 +1,310 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 Tue Oct 22 17:54:56 1996 by Eric S. Raymond +.\" Modified 1 Jan 2002, Martin Schulze +.\" Modified 4 Jan 2002, Michael Kerrisk +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added notes on /proc files +.\" Rewrote BUGS note about semget()'s failure to initialize +.\" semaphore values +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Updated 2003-04-08, Kentaro Shirakata +.\" Updated 2005-03-01, Akihiro MOTOKI +.\" Updated 2006-07-20, Akihiro MOTOKI, LDP v2.36 +.\" +.\"WORD: semaphore ¥»¥Þ¥Õ¥© +.\"WORD: identifier ¼±ÊÌ»Ò +.\"WORD: owner ½êÍ­¼Ô +.\"WORD: group ¥°¥ë¡¼¥× +.\"WORD: other ¾¿Í +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ ID +.\"WORD: effective group ID ¼Â¸ú¥°¥ë¡¼¥× ID +.\"WORD: calling process ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹ +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: policy Êý¿Ë +.\"WORD: structure ¹½Â¤ÂÎ +.\"WORD: initialize ½é´ü²½ +.\"WORD: system call ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë +.\" +.TH SEMGET 2 2004-05-27 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +semget \- ¥»¥Þ¥Õ¥©½¸¹ç¤Î¼±Ê̻Ҥò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.fi +.sp +.BI "int semget(key_t " key , +.BI "int " nsems , +.BI "int " semflg ); +.SH ÀâÌÀ +.BR semget () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢°ú¤­¿ô +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç (semaphore set) ¤Î +¼±ÊÌ»Ò (identifier) ¤òÊÖ¤¹¡£ +.I key +¤ÎÃͤ¬ +.B IPC_PRIVATE +¤Î¾ì¹ç¡¢¤â¤·¤¯¤Ï +.I semflg +¤Ë +.B IPC_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +.I nsems +¸Ä¤Î¥»¥Þ¥Õ¥©¤«¤é¤Ê¤ë¿·¤·¤¤½¸¹ç¤¬ºîÀ®¤µ¤ì¤ë¡£ +.PP +.I semflg +¤Ë +.B IPC_CREAT +¤È +.B IPC_EXCL +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤¬´û¤Ë¸ºß¤¹¤ë¤È¡¢ +.BR semget () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EEXIST +¤¬ÀßÄꤵ¤ì¤ë +(¤³¤ì¤Ï +.BR open (2) +¤Ë +.B O_CREAT | O_EXCL +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤ÎÆ°ºî¤ÈƱ¤¸¤Ç¤¢¤ë)¡£ +.PP +¥»¥Þ¥Õ¥©½¸¹çºîÀ®»þ¤Ë¡¢°ú¤­¿ô +.I semflg +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤Ï¡¢¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Î (½êÍ­¼Ô (owner)¡¢¥°¥ë¡¼¥× (group)¡¢ +¾¿Í (others) ¤ËÂФ¹¤ë) ¥¢¥¯¥»¥¹µö²Ä¤ÎÄêµÁ¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +¤³¤ì¤é¤Î¥Ó¥Ã¥È¤Ï +.BR open (2) +¤Î°ú¤­¿ô +.I mode +¤ÈƱ¤¸·Á¼°¤ÇƱ¤¸°ÕÌ£¤Ç¤¢¤ë +(⤷¡¢¼Â¹Ô (execute) µö²Ä¤Ï¥»¥Þ¥Õ¥©¤Ç¤Ï°ÕÌ£¤ò»ý¤¿¤º¡¢ +½ñ¤­¹þ¤ß (write) µö²Ä¤Ï¥»¥Þ¥Õ¥©ÃͤÎÊѹ¹ (alter) µö²Ä¤È¤·¤Æµ¡Ç½¤¹¤ë)¡£ +.PP +¿·¤·¤¯ºîÀ®¤µ¤ì¤¿¥»¥Þ¥Õ¥©½¸¹ç¤Î³Æ¥»¥Þ¥Õ¥©¤ÎÃͤÏÉÔÄê¤Ç¤¢¤ë +(¤³¤ÎÅÀ¤Ï POSIX.1-2001 ¤ËÌÀµ­¤µ¤ì¤Æ¤¤¤ë)¡£ +Linux ¤Ï¾¤Î¿¤¯¤Î¼ÂÁõ¤ÈƱÍͤ˥»¥Þ¥Õ¥©Ãͤò 0 ¤Ë½é´ü²½¤¹¤ë¤¬¡¢ +°Ü¿¢À­¤ò¹Íθ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤ÎÆ°ºî¤òÁ°Äó¤Ë¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÏÌÀ¼¨Åª¤Ë¥»¥Þ¥Õ¥©¤ò´õ˾¤ÎÃͤǽé´ü²½¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\" In truth, every one of the many implementations that I've tested sets +.\" the values to zero, but I suppose there is/was some obscure +.\" implementation out there that does not. +.PP +¿·µ¬¤Î¥»¥Þ¥Õ¥©½¸¹ç¤òºîÀ®¤¹¤ëºÝ¡¢ +.BR semget () +¤Ï¥»¥Þ¥Õ¥©½¸¹ç¤Î¾ðÊó¤òÊÝ»ý¤¹¤ë¥Ç¡¼¥¿¹½Â¤ÂÎ +.I semid_ds +¤ò¼¡¤Î¤è¤¦¤Ë½é´ü²½¤¹¤ë +.RI ( semid_ds +¤Ë¤Ä¤¤¤Æ¤Ï +.BR semctl (2) +¤ò»²¾È): +.IP +.I sem_perm.cuid +¤È +.I sem_perm.uid +¤Ë¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥æ¡¼¥¶ ID ¤òÀßÄꤹ¤ë¡£ +.IP +.I sem_perm.cgid +¤È +.I sem_perm.gid +¤Ë¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë¡£ +.IP +.I sem_perm.mode +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤Ë +.I semflg +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤òÀßÄꤹ¤ë¡£ +.IP +.I sem_nsems +¤Ë +.I nsems +¤ÎÃͤòÀßÄꤹ¤ë¡£ +.IP +.I sem_otime +¤Ë 0 ¤òÀßÄꤹ¤ë¡£ +.IP +.I sem_ctime +¤Ë¸½ºß¤Î»þ¹ï¤òÀßÄꤹ¤ë¡£ +.PP +¥»¥Þ¥Õ¥©½¸¹ç¤ÎºîÀ®¤ò¹Ô¤ï¤Ê¤¤¾ì¹ç¤Ï¡¢°ú¤­¿ô +.I nsems +¤Ë (don't care ¤ò°ÕÌ£¤¹¤ë) 0 ¤ò»ØÄꤷ¤Æ¤â¤è¤¤¡£ +¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢ +.I nsems +¤Ï 0 ¤è¤êÂ礭¤¤ÃͤǤʤ±¤ì¤Ð¤Ê¤é¤º¡¢¥»¥Þ¥Õ¥©½¸¹ç¤¢¤¿¤ê¤Î¥»¥Þ¥Õ¥©¤ÎºÇÂç¿ô +.RB ( SEMMSL ) +°Ê²¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +¥»¥Þ¥Õ¥©½¸¹ç¤¬´û¤Ë¸ºß¤·¤¿¾ì¹ç¤Ï¡¢¥¢¥¯¥»¥¹µö²Ä¤Î¸¡ºº¤¬¹Ô¤ï¤ì¤ë¡£ +.\" Ç˲õ (destruction) ¥Þ¡¼¥¯¤¬¤Ê¤¤¤«¥Á¥§¥Ã¥¯¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢¥»¥Þ¥Õ¥©½¸¹ç¤Î¼±ÊÌ»Ò (ÈóÉé¤ÎÀ°¿ô) ¤¬ÊÖ¤êÃͤȤʤ롣 +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ë¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤¬ÀßÄꤵ¤ì¤ë: +.TP +.B EACCES +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤Ï¸ºß¤¹¤ë¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ï¤½¤Î½¸¹ç¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä¤¬¤Ê¤¯¡¢ +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EEXIST +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤¬Â¸ºß¤·¡¢ +.I semflg +¤Ë¤Ï +.B IPC_CREAT +¤È +.B IPC_EXCL +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¡£ +.\" .TP +.\" .B EIDRM +.\" ¥»¥Þ¥Õ¥©½¸¹ç¤Ëºï½ü (delete) ¥Þ¡¼¥¯¤¬¤Ä¤±¤é¤ì¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I nsems +¤¬ 0 ¤è¤ê¾®¤µ¤¤¤«¡¢¥»¥Þ¥Õ¥©½¸¹ç¤¢¤¿¤ê¤Î¥»¥Þ¥Õ¥©¤ÎºÇÂç¿ô +.RB ( SEMMSL ) +¤è¤êÂ礭¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤¬´û¤Ë¸ºß¤·¡¢ +.I nsems +¤¬¤½¤Î½¸¹ç¤Î¥»¥Þ¥Õ¥©¿ô¤è¤ê¤âÂ礭¤¤¡£ +.TP +.B ENOENT +.I key +¤ËÂбþ¤¹¤ë¥»¥Þ¥Õ¥©½¸¹ç¤¬Â¸ºß¤»¤º¡¢ +.I semflg +¤Ë +.B IPC_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤â¤¤¤Ê¤¤¡£ +.TP +.B ENOMEM +¥»¥Þ¥Õ¥©½¸¹ç¤òºîÀ®¤·¤è¤¦¤È¤·¤¿¤¬¡¢¿·¤·¤¤¥Ç¡¼¥¿¹½Â¤ÂΤò +ºîÀ®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOSPC +¥»¥Þ¥Õ¥©½¸¹ç¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¤È¡¢¥·¥¹¥Æ¥à¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Î +ºÇÂç¿ô +.RB ( SEMMNI ) +¤«¡¢¥·¥¹¥Æ¥àÁ´ÂΤΥ»¥Þ¥Õ¥©¤ÎºÇÂç¿ô +.RB ( SEMMNS ) +¤Î¤¤¤º¤ì¤«¤òĶ¤¨¤Æ¤·¤Þ¤¦¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.\" SVr4 ¤Ë¤Ï¡¢ÄÉ²Ã¤Ç EFBIG, E2BIG, EAGAIN, ERANGE, EFAULT +.\" ¤Î¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.SH Ãí°Õ +.B IPC_PRIVATE +¤Ï¥Õ¥é¥°¡¦¥Õ¥£¡¼¥ë¥É¤Ë»ØÄꤹ¤ë¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +.I key_t +·¿¤Ç¤¢¤ë¡£ +¤³¤ÎÆÃÊ̤ÊÃͤ¬ +.I key +¤Ë»ØÄꤵ¤ì¤ë¤È¡¢ +.BR semget () +.I semflg +¤Î²¼°Ì 9 ¥Ó¥Ã¥È°Ê³°¤ÏÁ´¤Æ̵»ë¤·¡¢ +(À®¸ù¤·¤¿¾ì¹ç¤Ï) ¿·¤·¤¤¥»¥Þ¥Õ¥©½¸¹ç¤òºîÀ®¤¹¤ë¡£ +.PP +¥»¥Þ¥Õ¥©½¸¹ç¤Î¥ê¥½¡¼¥¹¤Ë´Ø¤¹¤ëÀ©¸Â¤Î¤¦¤Á¡¢ +.BR semget () +¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¤â¤Î¤ò°Ê²¼¤Ëµó¤²¤ë: +.TP +.B SEMMNI +¥·¥¹¥Æ¥àÁ´ÂΤΥ»¥Þ¥Õ¥©½¸¹ç¤ÎºÇÂç¿ô: Êý¿Ë°Í¸ +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/sem +¤ÎÂè4¥Õ¥£¡¼¥ë¥É¤ËÂбþ¤·¡¢Æɤ߽Ф·¤âÊѹ¹¤â¤Ç¤­¤ë)¡£ +.\" ¤³¤Î /proc ¥Õ¥¡¥¤¥ë¤Ï Linux 2.2 °ÊÁ°¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤ -- MTK +.TP +.B SEMMSL +semid ¤¢¤¿¤ê¤Î¥»¥Þ¥Õ¥©¤ÎºÇÂç¿ô: ¼ÂÁõ°Í¸ +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/sem +¤ÎÂè1¥Õ¥£¡¼¥ë¥É¤ËÂбþ¤·¡¢Æɤ߽Ф·¤âÊѹ¹¤â¤Ç¤­¤ë)¡£ +.TP +.B SEMMNS +¥·¥¹¥Æ¥àÁ´ÂΤΥ»¥Þ¥Õ¥©¤ÎºÇÂç¿ô: Êý¿Ë°Í¸ +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/sem +¤ÎÂè2¥Õ¥£¡¼¥ë¥É¤ËÂбþ¤·¡¢Æɤ߽Ф·¤âÊѹ¹¤â¤Ç¤­¤ë)¡£ +.B SEMMSL * SEMMNI +¤è¤êÂ礭¤ÊÃͤϰÕÌ£¤ò»ý¤¿¤Ê¤¤¡£ +.SH ¥Ð¥° +.B IPC_PRIVATE +¤È¤¤¤¦Ì¾Á°¤òÁª¤ó¤À¤Î¤Ï¤ª¤½¤é¤¯¼ºÇԤǤ¢¤í¤¦¡£ +.B IPC_NEW +¤ÎÊý¤¬¤è¤êÌÀ³Î¤Ë¤½¤Îµ¡Ç½¤òɽ¤·¤Æ¤¤¤ë¤À¤í¤¦¡£ +.LP +¥»¥Þ¥Õ¥©½¸¹çÆâ¤Î¥»¥Þ¥Õ¥©¤Ï +.BR semget () +¤Ç¤Ï½é´ü²½¤µ¤ì¤Ê¤¤¡£ +.\" ¼ÂºÝ¤Ï Linux ¤Ç¤Ï¥»¥Þ¥Õ¥©¤Ï 0 ¤Ë½é´ü²½¤µ¤ì¤ë¤¬¡¢ +.\" POSIX.1-2001 ¤Ç¤Ï¤³¤¦¤Ê¤ë¤³¤È¤òµ¬Äꤷ¤Æ¤¤¤ëÌõ¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢ +.\" °Ü¿¢¤ò¹Íθ¤¹¤ë¤È¤­¤Ë¤Ï¤³¤ì¤òÁ°Äó¤Ë¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +¤³¤Î¥»¥Þ¥Õ¥©¤ò½é´ü²½¤¹¤ë¤Ë¤Ï¡¢¥»¥Þ¥Õ¥©½¸¹ç¤ËÂФ·¤Æ +.BR semctl (2) +¤ò»È¤Ã¤Æ +.B SETVAL +¤« +.B SETALL +Áàºî¤ò¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ë¡£ +(Ê£¿ô²Õ½ê¤«¤é¥»¥Þ¥Õ¥©½¸¹ç¤ÎÁàºî¤¬¹Ô¤ï¤ì¤ë¾ìÌ̤Ǥϡ¢ +郎ºÇ½é¤Ë½¸¹ç¤ò½é´ü²½¤¹¤ì¤Ð¤è¤¤¤«Ê¬¤«¤é¤Ê¤¤¡£ +¤³¤Î¾õ¶·¤òÈò¤±¤ë¤Ë¤Ï¡¢ +.BR semctl (2) +¤Î +.B IPC_STAT +Áàºî¤Ç¼èÆÀ¤Ç¤­¤ë¥»¥Þ¥Õ¥©¤Î¥Ç¡¼¥¿¹½Â¤ÂΤΠ+.I sem_otime +¤¬ 0 °Ê³°¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ì¤Ð¤è¤¤¡£) +.SH ´ØÏ¢¹àÌÜ +.BR semctl (2), +.BR semop (2), +.BR ftok (3), +.BR capabilities (7), +.BR sem_overview (7), +.BR svipc (7) diff --git a/release/man2/semop.2 b/release/man2/semop.2 new file mode 100644 index 00000000..068ceb5e --- /dev/null +++ b/release/man2/semop.2 @@ -0,0 +1,550 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 1996-10-22, Eric S. Raymond +.\" Modified 2002-01-08, Michael Kerrisk +.\" Modified 2003-04-28, Ernie Petrides +.\" Modified 2004-05-27, Michael Kerrisk +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Added notes on /proc files +.\" 2005-04-08, mtk, Noted kernel version numbers for semtimedop() +.\" 2007-07-09, mtk, Added an EXAMPLE code segment. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-02-23, HANATAKA Shinya +.\" Updated 2003-02-09, Kentaro Shirakata +.\" Updated 2003-09-12, Kentaro Shirakata +.\" Updated 2005-03-01, Akihiro MOTOKI +.\" Updated 2005-04-17, Akihiro MOTOKI +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" +.\"WORD: semaphore ¥»¥Þ¥Õ¥© +.\"WORD: member ¥á¥ó¥Ð¡¼ +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: system call ¥·¥¹¥Æ¥à¥³¡¼¥ë +.\"WORD: undo ¥¢¥ó¥É¥¥ +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: catch Êá³Í(catch) +.\"WORD: process-ID ¥×¥í¥»¥¹ID +.\"WORD: policy Êý¿Ë +.\"WORD: implement ¼ÂÁõ +.\"WORD: queue ¥­¥å¡¼ +.\"WORD: free ²òÊü(free). +.\"WORD: memory ¥á¥â¥ê +.\"WORD: anonymous structure ̵̾¹½Â¤ÂÎ +.\"WORD: time limit À©¸Â»þ´Ö +\" +.TH SEMOP 2 2008-10-04 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +semop, semtimedop \- ¥»¥Þ¥Õ¥©¤ÎÁàºî +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int semop(int " semid ", struct sembuf *" sops ", unsigned " nsops ); +.sp +.BI "int semtimedop(int " semid ", struct sembuf *" sops ", unsigned " nsops , +.BI " struct timespec *" timeout ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR semtimedop (): +_GNU_SOURCE +.SH ÀâÌÀ +¥»¥Þ¥Õ¥©½¸¹ç (semaphore set) ¤Î¥á¥ó¥Ð¡¼¤Î³Æ¥»¥Þ¥Õ¥©¤Ï +°Ê²¼¤Î´ØÏ¢¾ðÊó¤ò»ý¤Ã¤Æ¤¤¤ë: +.sp +.in +4n +.nf +unsigned short semval; /* ¥»¥Þ¥Õ¥©ÃÍ */ +unsigned short semzcnt; /* ¥¼¥í¤òÂÔ¤Ä¥×¥í¥»¥¹¿ô */ +unsigned short semncnt; /* Áý²Ã¤òÂÔ¤Ä¥×¥í¥»¥¹¿ô */ +pid_t sempid; /* ºÇ¸å¤ËÁàºî¤ò¹Ô¤Ê¤Ã¤¿¥×¥í¥»¥¹ */ +.sp +.in -4n +.fi +.BR semop () +¤Ï +.I semid +¤Ç»ØÄꤵ¤ì¤¿¥»¥Þ¥Õ¥©½¸¹ç¤ÎÁªÂò¤µ¤ì¤¿¥»¥Þ¥Õ¥©¤ËÂФ·¤ÆÁàºî¤ò¹Ô¤¦¡£ +.I sops +¤Ï +.I nsops +¸Ä¤ÎÍ×ÁǤÎÇÛÎó¤ò»Ø¤·¡¢ÇÛÎó¤Î³ÆÍ×ÁǤϸġ¹¤Î¥»¥Þ¥Õ¥©¤Ë +ÂФ¹¤ëÁàºî¤ò¼¨¤¹¡£¤½¤Î·¿¤Ï +.I struct sembuf +¤Ç¡¢¼¡¤Î¥á¥ó¥Ð¤ò»ý¤Ä: +.sp +.in +4n +.nf +unsigned short sem_num; /* ¥»¥Þ¥Õ¥©ÈÖ¹æ */ +short sem_op; /* ¥»¥Þ¥Õ¥©Áàºî */ +short sem_flg; /* Áàºî¥Õ¥é¥° */ +.sp +.in -4n +.fi +.I sem_flg +¤Ë¤Ï +.B IPC_NOWAIT +¤È +.B SEM_UNDO +¤¬ÀßÄê¤Ç¤­¤ë¡£ +.B SEM_UNDO +¤¬»ØÄꤵ¤ì¤¿Áàºî¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿»þ¤Ë¼«Æ°Åª¤Ë¼è¤ê¾Ã¤µ¤ì¤ë¡£ +.PP +.I sops +¤Ë´Þ¤Þ¤ì¤ëÁàºî¤Î½¸¹ç¤Ï¡¢ +.I "ÇÛÎó¤Î½ç½ø" +¤Ç¡¢ +.I ¥¢¥È¥ß¥Ã¥¯¤Ë +¼Â¹Ô¤µ¤ì¤ë¡£ +¤¹¤Ê¤ï¤Á¡¢Á´¤Æ¤ÎÁàºî¤¬´°Á´¤Ë¼Â¹Ô¤µ¤ì¤ë¤«¡¢Á´¤¯¼Â¹Ô¤µ¤ì¤Ê¤¤¤«¤Î +¤É¤Á¤é¤«¤È¤Ê¤ë¡£ + +Á´¤Æ¤ÎÁàºî¤¬Ä¾¤Á¤Ë¼Â¹Ô¤Ç¤­¤Ê¤¤¾ì¹ç¤Î¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¿¶¤ëÉñ¤¤¤Ï +¸Ä¡¹¤ÎÁàºî¤Î +.I sem_flg +¥Õ¥£¡¼¥ë¥É¤Ë +.B IPC_NOWAIT +¤¬Â¸ºß¤¹¤ë¤«¤Ë¤è¤Ã¤Æ·è¤Þ¤ê¡¢¸å½Ò¤Î¤è¤¦¤Ë¤Ê¤ë¡£ + +¤½¤ì¤¾¤ì¤ÎÁàºî¤Ï¥»¥Þ¥Õ¥©½¸¹ç¤Î +.IR sem_num ÈÖÌÜ +¤Î¥»¥Þ¥Õ¥©¤ËÂФ·¤Æ¼Â¹Ô¤µ¤ì¤ë¡£¥»¥Þ¥Õ¥©½¸¹ç¤ÎºÇ½é¤Î¥»¥Þ¥Õ¥©¤Ë¤Ï +ÈÖ¹æ 0 ¤¬¿¶¤é¤ì¤ë¡£ +¤½¤·¤ÆÁàºî¤Ï»°¼ïÎढ¤ê¡¢ +.I sem_op +¤ÎÃͤǶèÊ̤µ¤ì¤ë¡£ +.PP +.I sem_op +¤¬Àµ¤ÎÀ°¿ô¤Î¾ì¹ç¡¢Áàºî¤È¤·¤Æ¤½¤ÎÃͤò¥»¥Þ¥Õ¥©¤ÎÃÍ +.RI ( semval ) +¤Ë²Ã¤¨¤ë¡£¤µ¤é¤Ë¤³¤ÎÁàºî¤Ë +.B SEM_UNDO +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥·¥¹¥Æ¥à¤Ï¤³¤Î¥»¥Þ¥Õ¥©¤Î ¥×¥í¥»¥¹¡¦¥¢¥ó¥É¥¥¿ô +.RI ( semadj ) +¤ò¹¹¿·¤¹¤ë¡£ +¤³¤ÎÁàºî¤Ïɬ¤º¼Â¹Ô¤Ç¤­¡¢¥×¥í¥»¥¹¤ÎÄä»ß¤Ïµ¯¤³¤é¤Ê¤¤¡£ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ÏÂоݤΥ»¥Þ¥Õ¥©½¸¹ç¤òÊѹ¹¤¹¤ëµö²Ä¤¬¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.I sem_op +¤¬ 0 ¤Î¾ì¹ç¡¢¡Ö¥¼¥í¤Þ¤ÇÂԤġ×Áàºî¤Ç¤¢¤ë¡£¤³¤Î¾ì¹ç¡¢¥×¥í¥»¥¹¤Ï +¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤ËÂФ¹¤ëÆɤ߹þ¤ßµö²Ä¤¬¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I semval +¤¬ 0 ¤Ê¤é¤Ð¡¢Áàºî¤Ïľ¤Á¤Ë¹Ô¤ï¤ì¤ë¡£ +.I semval +¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I sem_flg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢ +.BR semop () +¤Ï¼ºÇÔ¤·¡¢ +.B errno +¤Ë +.B EAGAIN +¤¬ÀßÄꤵ¤ì¤ë (¤³¤Î¤È¤­ +.I sops +¤ËÂФ¹¤ëÁàºî¤ÏÁ´¤¯¼Â¹Ô¤µ¤ì¤Ê¤¤)¡£ +.I sem_flg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.I semzcnt +(¥»¥Þ¥Õ¥©Ãͤ¬ 0 ¤Ë¤Ê¤ë¤Î¤òÂԤäƤ¤¤ë¥×¥í¥»¥¹¤Î¿ô) ¤ò 1 Áý²Ã¤µ¤»¤Æ¡¢ +°Ê²¼¤Î¤¤¤º¤ì¤«¤¬µ¯¤³¤ë¤Þ¤Ç¥×¥í¥»¥¹¤òÄä»ß (sleep) ¤¹¤ë¡£ +.IP \(bu 3 +.I semval +¤¬ 0 ¤Ë¤Ê¤Ã¤¿: ¤³¤Î¤È¤­ +.I semval +¤ÎÃÍ¤Ï 1 ¸º»»¤µ¤ì¤ë¡£ +.IP \(bu +¥»¥Þ¥Õ¥©½¸¹ç¤¬ºï½ü¤µ¤ì¤¿: ¤³¤Î¤È¤­ +.BR semop () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EIDRM +¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP \(bu +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿: ¤³¤Î¤È¤­ +.I semzcnt +¤ÎÃÍ¤Ï 1 ¸º»»¤µ¤ì¡¢ +.BR semop () +¤Ï¼ºÇÔ¤· +.I errno +¤Ë +.B EINTR +¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP \(bu +.\" motoki: semop () ¤Ï semtimedop () ¤Î´Ö°ã¤¤¡© +.BR semtimedop () +¤Î +.I timeout +¤Ç»ØÄꤵ¤ì¤¿À©¸Â»þ´Ö¤¬·Ð²á¤·¤¿: ¤³¤Î¤È¤­ +.BR semtimedop () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +.I sem_op +¤¬ 0 ̤Ëþ¤Î¾ì¹ç¡¢¥×¥í¥»¥¹¤Ë¤Ï¤½¤Î¥»¥Þ¥Õ¥©½¸¹ç¤òÊѹ¹¤¹¤ëµö²Ä¤¬¤Ê¤±¤ì¤Ð +¤Ê¤é¤Ê¤¤¡£ +.I semval +¤¬ +.I sem_op +¤ÎÀäÂÐÃͰʾå¤Î¾ì¹ç¤Ï¡¢Áàºî¤Ïľ¤Á¤Ë¼Â¹Ô¤µ¤ì¤ë: +.I semval +¤«¤é +.I sem_op +¤ÎÀäÂÐÃͤ¬¸º»»¤µ¤ì¤ë¡£ +¤µ¤é¤Ë¡¢¤³¤ÎÁàºî¤Ë +.B SEM_UNDO +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤³¤Î¥»¥Þ¥Õ¥©¤Î¥×¥í¥»¥¹¡¦¥¢¥ó¥É¥¥¿ô +.RI ( semadj ) +¤ò¹¹¿·¤¹¤ë¡£ +.I semval +¤¬ +.I sem_op +¤ÎÀäÂÐÃͤè¤ê¾®¤µ¤¯¡¢ +.I sem_flg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +.BR semop () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤¬ÀßÄꤵ¤ì¤ë (¤³¤Î¤È¤­ +.I sops +¤ÎÁàºî¤ÏÁ´¤¯¼Â¹Ô¤µ¤ì¤Ê¤¤)¡£ +.B IPC_WAIT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +.I semncnt +(¤³¤Î¥»¥Þ¥Õ¥©¤ÎÃͤ¬Áý²Ã¤¹¤ë¤Î¤òÂԤäƤ¤¤ë¥×¥í¥»¥¹¿ô¤Î¥«¥¦¥ó¥¿) +¤ò 1 Áý²Ã¤µ¤»¤Æ¡¢°Ê²¼¤Î¤¤¤º¤ì¤«¤¬µ¯¤³¤ë¤Þ¤Ç¥×¥í¥»¥¹¤òÄä»ß (sleep) ¤¹¤ë¡£ +.IP \(bu 3 +.I semval +¤¬ +.I sem_op +¤ÎÀäÂÐÃͰʾå¤Ë¤Ê¤Ã¤¿: ¤³¤Î¤È¤­ +.I semncnt +¤¬ 1 ¸º»»¤µ¤ì¡¢ +.I semval +¤«¤é +.I sem_op +¤ÎÀäÂÐÃͤ¬°ú¤«¤ì¤ë¡£ +¤³¤ÎÁàºî¤Ë +.B SEM_UNDO +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¤³¤Î¥»¥Þ¥Õ¥©¤Î¥×¥í¥»¥¹¡¦¥¢¥ó¥É¥¥¿ô +.RI ( semadj ) +¤â¹¹¿·¤¹¤ë¡£ +.IP \(bu +¥»¥Þ¥Õ¥©½¸¹ç¤¬¥·¥¹¥Æ¥à¤«¤éºï½ü¤µ¤ì¤¿: ¤³¤Î¤È¤­ +.BR semop () +¤Ï¼ºÇÔ¤· +.I errno +¤Ë +.B EIDRM +¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP \(bu +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿: ¤³¤Î¤È¤­ +.I semncnt +¤¬ 1 ¸º»»¤µ¤ì¡¢ +.BR semop () +¤Ï¼ºÇÔ¤· +.I errno +¤Ë +.B EINTR +¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP \(bu +.\" motoki: the system call ¤Ï semtimedop () ¤Î¤³¤È¡© +.BR semtimedop () +¤Î +.I timeout +¤Ç»ØÄꤵ¤ì¤¿À©¸Â»þ´Ö¤¬·Ð²á¤·¤¿: ¤³¤Î¤È¤­ +.BR semtimedop () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +Áàºî¤¬À®¸ù¤·¤¿¾ì¹ç¡¢ +.I sops +¤¬»Ø¤¹ÇÛÎó¤Ë¤è¤Ã¤ÆÁàºîÂоݤȤʤ俳ƥ»¥Þ¥Õ¥©¤Î +.I sempid +¥á¥ó¥Ð¡¼¤Ë¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤¬ÀßÄꤵ¤ì¤ë¡£ +¤µ¤é¤Ë +.I sem_otime +.\" ¤È +.\" .I sem_ctime +¤Ë¸½ºß»þ¹ï¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +.BR semtimedop () +´Ø¿ô¤Î¿¶¤ëÉñ¤¤¤Ï +.BR semop () +¤ÈÁ´¤¯Æ±¤¸¤À¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬Ää»ß¤¹¤ë¾ì¹ç¡¢Ää»ß´ü´Ö¤Î¾å¸Â¤¬ +.I timeout +°ú¤­¿ô¤Î»Ø¤¹ +.I timespec +¹½Â¤ÂΤǻØÄꤵ¤ì¤¿»þ´Ö¤È¤Ê¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +»ØÄꤷ¤¿À©¸Â»þ´Ö¤Ë㤷¤¿¾ì¹ç¤Ï¡¢ +.BR semtimedop () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤¬ÀßÄꤵ¤ì¤ë +(¤³¤Î¤È¤­ +.I sops +¤ÎÁàºî¤Ï¼Â¹Ô¤µ¤ì¤Ê¤¤)¡£ +.I timeout +°ú¤­¿ô¤¬ NULL ¤Î¾ì¹ç¡¢ +.BR semtimedop () +´Ø¿ô¤Î¿¶¤ëÉñ¤¤¤Ï +.BR semop () +´Ø¿ô¤ÈÁ´¤¯Æ±¤¸¤Ë¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR semop () +¤È +.BR semtimedop () +¤Ï 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð \-1 ¤òÊÖ¤·¡¢ +¥¨¥é¡¼¤ò¼¨¤¹ +.I errno +¤òÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ë°Ê²¼¤Î¤É¤ì¤«¤¬ÀßÄꤵ¤ì¤ë: +.TP +.B E2BIG +.I nsops +°ú¤­¿ô¤¬ +.B SEMOPM +¤è¤êÂ礭¤¤¡£ +.B SEMOPM +¤Ï°ì²ó¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Çµö¤µ¤ì¤ëÁàºî¤ÎºÇÂç¸Ä¿ô¤Ç¤¢¤ë¡£ +.TP +.B EACCES +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤Ï»ØÄꤵ¤ì¤¿¥»¥Þ¥Õ¥©Áàºî¤ò¹Ô¤¦¤Î¤Ë +ɬÍפʥ¢¥¯¥»¥¹µö²Ä¤¬¤Ê¤¯¡¢ +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â¤Ê¤¤¡£ +.TP +.B EAGAIN +Áàºî¤òľ¤Á¤Ë½èÍý¤¹¤ë¤³¤È¤¬¤Ç¤­¤º¡¢¤«¤Ä +.I sem_flg +¤Ë +.B IPC_NOWAIT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤« +.I timeout +¤Ç»ØÄꤵ¤ì¤¿À©¸Â»þ´Ö¤¬·Ð²á¤·¤¿¡£ +.TP +.B EFAULT +°ú¤­¿ô +.I sops +¤« +.I timeout +¤¬»Ø¤·¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¡£ +.TP +.B EFBIG +¤¢¤ëÁàºî¤Ç¡¢ +.I sem_num +¤ÎÃͤ¬ 0 ̤Ëþ¤«¡¢½¸¹çÆâ¤Î¥»¥Þ¥Õ¥©¤Î¿ô°Ê¾å¤Ç¤¢¤ë¡£ +.TP +.B EIDRM +¥»¥Þ¥Õ¥©½¸¹ç¤¬ºï½ü¤µ¤ì¤¿¡£ +.TP +.B EINTR +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÇÄä»ß¤·¤Æ¤¤¤ë»þ¤Ë¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿¡£ +.BR single (7) +»²¾È¡£ +.TP +.B EINVAL +¥»¥Þ¥Õ¥©½¸¹ç¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢ +.I semid +¤¬ 0 ̤Ëþ¤Ç¤¢¤ë¤«¡¢ +.I nsops +¤¬Àµ¤Î¿ô¤Ç¤Ê¤¤¡£ +.TP +.B ENOMEM +¤¢¤ëÁàºî¤Ç +.I sem_flg +¤Ë +.B SEM_UNDO +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¥·¥¹¥Æ¥à¤Ë¥¢¥ó¥É¥¥¹½Â¤ÂΤ˳ä¤êÅö¤Æ¤ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ERANGE +¤¢¤ëÁàºî¤Ç +.I sem_op+semval +¤¬ +.B SEMVMX +¤è¤êÂ礭¤¤¡£ +.B SEMVMX +¤Ï +.I semval +¤ÎºÇÂçÃͤǡ¢¤½¤ÎÃͤϼÂÁõ°Í¸¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR semtimedop () +¤Ï Linux 2.5.52 ¤Ç½é¤á¤ÆÅо줷¡¢ +¤½¤ì¤«¤é¥«¡¼¥Í¥ë 2.4.22 ¤Ë¤â°Ü¿¢¤µ¤ì¤¿¡£ +.BR semtimedop () +¤Î glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3.3 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.\" SVr4 ¤Ë¤Ï¡¢ÄÉ²Ã¤Ç EINVAL, EFBIG, ENOSPC ¤Î¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Î +.\" µ­½Ò¤¬¤¢¤ë¡£ +.SH Ãí°Õ +¤¢¤ë¥×¥í¥»¥¹¤Î +.I sem_undo +¹½Â¤ÂÎ¤Ï +.BR fork (2) +¤ÇÀ¸À®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ë¤Ï·Ñ¾µ¤µ¤ì¤Ê¤¤¤¬¡¢ +.BR execve (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¾ì¹ç¤Ï·Ñ¾µ¤µ¤ì¤ë¡£ +.PP +.BR semop () +¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤ÆÃæÃǤµ¤ì¤¿¸å¤Ë¡¢ +·è¤·¤Æ¼«Æ°Åª¤ËºÆ³«¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +¤¿¤È¤¨¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÀßÄê»þ¤Ë +.B SA_RESTART +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Æ¤âºÆ³«¤¹¤ë¤³¤È¤Ï¤Ê¤¤ +.PP +.I semadj +¤Ï¥×¥í¥»¥¹¤´¤È¤ÎÀ°¿ô¤Ç¡¢ +.B SEM_UNDO +¥Õ¥é¥°¤òÀßÄꤷ¤Æ¼Â¹Ô¤µ¤ì¤¿Á´¤Æ¤Î¥»¥Þ¥Õ¥©Áàºî¤Î(Éé¿ô¤Î)¥«¥¦¥ó¥¿¤Ç¤¢¤ë¡£ +.BR semctl (2) +¤Ë +.B SETVAL +¤Þ¤¿¤Ï +.B SETALL +¤ò»ØÄꤷ¡¢¥»¥Þ¥Õ¥©¤ÎÃͤ¬ +ľÀÜÀßÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢Á´¤Æ¤Î¥×¥í¥»¥¹¤Ë¤ª¤¤¤ÆÂбþ¤¹¤ë +.I semadj +¤ÎÃͤ¬¥¯¥ê¥¢¤µ¤ì¤ë¡£ +.PP +¤¢¤ë¥»¥Þ¥Õ¥©¤Î \fIsemval\fP, \fIsempid\fP, \fIsemzcnt\fP, \fIsemnct\fP +¤ÎÃͤϤ¤¤º¤ì¤â¡¢Å¬ÀÚ¤ÊÁàºî¤ò»ØÄꤷ¤Æ +.BR semctl (2) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +.PP +¥»¥Þ¥Õ¥©½¸¹ç¤Î¥ê¥½¡¼¥¹¤Ë´Ø¤¹¤ëÀ©¸Â¤Î¤¦¤Á¡¢ +.BR semop () +¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¤â¤Î¤ò°Ê²¼¤Ëµó¤²¤ë: +.TP +.B SEMOPM +°ì²ó¤Î +.BR semop () +¤Çµö¤µ¤ì¤ëÁàºî¤ÎºÇÂç¿ô (32)¡£ +(Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃÍ¤Ï +.I /proc/sys/kernel/sem +¤ÎÂè3¥Õ¥£¡¼¥ë¥É¤ËÂбþ¤·¡¢Æɤ߽Ф·¤âÊѹ¹¤â¤Ç¤­¤ë)¡£ +.\" ¤³¤Î /proc ¥Õ¥¡¥¤¥ë¤Ï Linux 2.2 °ÊÁ°¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤ -- MTK +.TP +.B SEMVMX +.I semval +¤¬¼è¤êÆÀ¤ëºÇÂçÃÍ: ¼ÂÁõ°Í¸ (32767)¡£ +.PP +°Ê²¼¤ÎÃͤ˴ؤ·¤Æ¤Ï¼ÂÁõ°Í¸¤ÎÀ©¸Â¤Ï¤Ê¤¤¡£ +½ªÎ»»þ¤ÎÄ´À° (adjust on exit) ¤ÎºÇÂçÃÍ +.RB ( SEMAEM )¡¢ +¥·¥¹¥Æ¥àÁ´ÂΤΥ¢¥ó¥É¥¥¹½Â¤ÂΤκÇÂç¿ô +.RB ( SEMMNU )¡¢ +¥×¥í¥»¥¹¤¢¤¿¤ê¤Î¥¢¥ó¥É¥¥¹½Â¤ÂΤκÇÂç¿ô¡£ +.SH ¥Ð¥° +¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ëºÝ¡¢¥×¥í¥»¥¹¤ËÂбþ¤¹¤ë +.I semadj +¤Î½¸¹ç¤ò»È¤Ã¤Æ¡¢ +.B SEM_UNDO +¥Õ¥é¥°ÉÕ¤­¤Ç¼Â¹Ô¤µ¤ì¤¿Á´¤Æ¤Î¥»¥Þ¥Õ¥©Áàºî¤Î±Æ¶Á¤ò¼è¤ê¾Ã¤¹¡£ +¤³¤ì¤Ë¤è¤ê¤¢¤ëÌäÂ꤬ȯÀ¸¤¹¤ë: ¤³¤ì¤é¤Î¥»¥Þ¥Õ¥©¤ÎÄ´À°¤ò¹Ô¤Ã¤Æ¤¤¤ë¤È¡¢ +Ãæ¤Ë¤Ï¥»¥Þ¥Õ¥©¤ÎÃͤ¬ 0 ̤Ëþ¤ÎÃͤˤ·¤è¤¦¤È¤¹¤ë¾ì¹ç¤¬½Ð¤Æ¤¯¤ë¡£ +¤³¤Î¤è¤¦¤Ê¾ì¹ç¡¢¤É¤Î¤è¤¦¤Ë¼ÂÁõ¤¹¤ë¤Ù¤­¤«? +¤Ò¤È¤Ä¤Î¹Í¤¨¤é¤ì¤ë¼êË¡¤Ï¡¢Á´¤Æ¤Î¥»¥Þ¥Õ¥©Ä´À°¤¬¼Â¹Ô¤µ¤ì¤ë¤Þ¤Ç +Ää»ß¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£¤·¤«¤·¡¢¤³¤ÎÊýË¡¤Ç¤Ï¥×¥í¥»¥¹¤Î½ªÎ»¤¬ +Ĺ»þ´Ö¤Ë¤ï¤¿¤Ã¤ÆÄä»ß¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¤Î¤Ç˾¤Þ¤·¤¯¤Ê¤¤¡£ +¤·¤«¤â¤É¤ì¤¯¤é¤¤Ä¹»þ´Ö¤Ë¤Ê¤ë¤«¤Ïʬ¤«¤é¤Ê¤¤¡£ +Ê̤ÎÁªÂò»è¤È¤·¤Æ¡¢¤³¤Î¤è¤¦¤Ê¥»¥Þ¥Õ¥©Ä´À°¤ò´°Á´¤Ë̵»ë¤·¤Æ¤·¤Þ¤¦ÊýË¡¤¬¤¢¤ë +(¤³¤ì¤Ï¥»¥Þ¥Õ¥©Áàºî¤È¤·¤Æ +.B IPC_NOWAIT +¤¬»ØÄꤹ¤ë¤Î¤È¾¯¤·»÷¤Æ¤¤¤ë)¡£ +Linux ¤ÏÂè»°¤Î¼êË¡¤òºÎÍѤ·¤Æ¤¤¤ë: ¥»¥Þ¥Õ¥©¤ÎÃͤò½ÐÍè¤ë¤À¤± (¤Ä¤Þ¤ê +0 ¤Þ¤Ç) ¸º¾¯¤µ¤»¤Æ¡¢¥×¥í¥»¥¹¤Î½ªÎ»¤òľ¤Á¤Ë³¹Ô¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤ë¡£ + +¥«¡¼¥Í¥ë 2.6.x (x <= 10) ¤Ë¤Ï¡¢¤¢¤ë¾õ¶·¤Ë¤ª¤¤¤Æ¥»¥Þ¥Õ¥©Ãͤ¬ 0 ¤Ë¤Ê¤ë¤Î¤ò +ÂԤäƤ¤¤ë¥×¥í¥»¥¹¤¬¡¢¥»¥Þ¥Õ¥©Ãͤ¬¼ÂºÝ¤Ë 0 ¤Ë¤Ê¤Ã¤¿¤È¤­¤Ëµ¯¾² (wake up) +¤µ¤ì¤Ê¤¤¡¢¤È¤¤¤¦¥Ð¥°¤¬¤¢¤ë¡£¤³¤Î¥Ð¥°¤Ï¥«¡¼¥Í¥ë 2.6.11 ¤Ç½¤Àµ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" ¥Ð¥°¥ì¥Ý¡¼¥È: +.\" http://marc.theaimsgroup.com/?l=linux-kernel&m=110260821123863&w=2 +.\" ½¤Àµ: +.\" http://marc.theaimsgroup.com/?l=linux-kernel&m=110261701025794&w=2 +.SH Îã +°Ê²¼¤ÎÉôʬŪ¤Ê¥³¡¼¥É¤Ï¡¢ +¥»¥Þ¥Õ¥© 0 ¤ÎÃͤ¬ 0 ¤Ë¤Ê¤ë¤Î¤òÂԤäƤ«¤é¡¢ +¥»¥Þ¥Õ¥©¤ÎÃͤò 1 ²Ã»»¤¹¤ë½èÍý¤ò¡¢ +.BR semop () +¤ò»È¤Ã¤Æ¥¢¥È¥ß¥Ã¥¯ (atomically) ¤Ë¹Ô¤¦¡£ +.nf + + struct sembuf sops[2]; + int semid; + + /* Code to set \fIsemid\fP omitted */ + + sops[0].sem_num = 0; /* Operate on semaphore 0 */ + sops[0].sem_op = 0; /* Wait for value to equal 0 */ + sops[0].sem_flg = 0; + + sops[1].sem_num = 0; /* Operate on semaphore 0 */ + sops[1].sem_op = 1; /* Increment value by one */ + sops[1].sem_flg = 0; + + if (semop(semid, sops, 2) == \-1) { + perror("semop"); + exit(EXIT_FAILURE); + } +.fi +.SH ´ØÏ¢¹àÌÜ +.BR semctl (2), +.BR semget (2), +.BR sigaction (2), +.BR capabilities (7), +.BR sem_overview (7), +.BR svipc (7), +.BR time (7) diff --git a/release/man2/send.2 b/release/man2/send.2 new file mode 100644 index 00000000..7dd6b015 --- /dev/null +++ b/release/man2/send.2 @@ -0,0 +1,447 @@ +.\" 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. +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified Oct 1998 by Andi Kleen +.\" 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 íÕíÔ +.\" +.TH SEND 2 2009-02-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +send, sendto, sendmsg \- ¥½¥±¥Ã¥È¤Ø¥á¥Ã¥»¡¼¥¸¤òÁ÷¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "ssize_t send(int " sockfd ", const void *" buf ", size_t " len \ +", int " flags ); + +.BI "ssize_t sendto(int " sockfd ", const void *" buf ", size_t " len \ +", int " flags , +.BI " const struct sockaddr *" dest_addr ", socklen_t " addrlen ); + +.BI "ssize_t sendmsg(int " sockfd ", const struct msghdr *" msg \ +", int " flags ); +.fi +.SH ÀâÌÀ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR send (), +.BR sendto (), +.BR sendmsg () +¤Ï¡¢¤â¤¦°ìÊý¤Î¥½¥±¥Ã¥È¤Ø¥á¥Ã¥»¡¼¥¸¤òžÁ÷¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +.PP +.BR send () +¤Ï¡¢¥½¥±¥Ã¥È¤¬ +.I "Àܳ¤µ¤ì¤¿ (connected)" +¾õÂ֤ˤ¢¤ë¾ì¹ç¤Ë¤Î¤ß»ÈÍѤǤ­¤ë +(¤Ä¤Þ¤ê¡¢¤É¤ÎÁê¼ê¤ËÁ÷¿®¤¹¤ë¤«¤Ï´ûÃΤǤ¢¤ë)¡£ +.BR send () +¤È +.BR write (2) +¤Î°ã¤¤¤Ï¡¢°ú¤­¿ô¤Ë +.I flags +¤¬¤¢¤ë¤«¤É¤¦¤«¤À¤±¤Ç¤¢¤ë¡£ +°ú¤­¿ô +.I flags +¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR send () +¤Ï +.BR write (2) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +¤Þ¤¿¡¢ + + send(sockfd, buf, len, flags); + +¤Ï + + sendto(sockfd, buf, len, flags, NULL, 0); + +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.PP +°ú¤­¿ô +.I sockfd +¤Ï¡¢¥Ç¡¼¥¿¤òÁ÷¿®¤¹¤ë¥Ñ¥±¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.PP +.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 +¤Ç»ØÄꤵ¤ì¤ë¡£ +.BR sendmsg () +¤Ç¤Ï¡¢ÀܳÀè¤Î¥¢¥É¥ì¥¹¤Ï +.I msg.msg_name +¤ÇÍ¿¤¨¤é¤ì¡¢¤½¤Î¥µ¥¤¥º¤Ï +.I msg.msg_namelen +¤Ç»ØÄꤵ¤ì¤ë¡£ +.PP +.BR send () +¤È +.BR sendto () +¤Ç¤Ï¡¢¥á¥Ã¥»¡¼¥¸¤Ï +.I buf +¤Ë³ÊǼ¤µ¤ì¤Æ¤ª¤ê¡¢¤½¤ÎŤµ¤Ï +.I len +¤Ç¤¢¤ë¤È²ò¼á¤µ¤ì¤ë¡£ +.BR sendmsg () +¤Ç¤Ï¡¢¥á¥Ã¥»¡¼¥¸¤Ï +ÇÛÎó +.I msg.msg_iov +¤Î³ÆÍ×ÁǤ¬»Ø¤¹°ÌÃ֤˳ÊǼ¤µ¤ì¤Æ¤¤¤ë¡£ +.BR sendmsg () +¤Ç¤Ï¡¢Êä½õ¥Ç¡¼¥¿ (À©¸æ¾ðÊó¤È¤â¸Æ¤Ð¤ì¤ë) ¤òÁ÷¿®¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.PP +¥á¥Ã¥»¡¼¥¸Ä¹¤¬Ä¹²á¤®¤ë¤¿¤á¤Ë¡¢¤½¤Î¥½¥±¥Ã¥È¤¬»ÈÍѤ¹¤ë¥×¥í¥È¥³¥ë¤Ç¤Ï¡¢ +¥á¥Ã¥»¡¼¥¸¤ò¥½¥±¥Ã¥È¤ËÅϤµ¤ì¤¿¤Þ¤Þ¤Î·Á¤ÇÁ÷¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¾ì¹ç¡¢ +.B EMSGSIZE +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¡¢¤½¤Î¥á¥Ã¥»¡¼¥¸¤ÏžÁ÷¤µ¤ì¤Ê¤¤¡£ +.PP +.BR send () +¤Ç¤Ï¡¢ÇÛÁ÷¤Î¼ºÇÔ¤ÎÄÌÃΤÏÌÀ¼¨Åª¤Ë¹Ô¤ï¤ì¤ë¡£ +¥í¡¼¥«¥ë¦¤Ç¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï¡¢ÊÖ¤êÃÍ \-1 ¤È¤·¤ÆÄÌÃΤµ¤ì¤ë¡£ +.PP +¥á¥Ã¥»¡¼¥¸¤¬¥½¥±¥Ã¥È¤ÎÁ÷¿®¥Ð¥Ã¥Õ¥¡¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¾ì¹ç¡¢ +.BR send () +¤ÏÄ̾ï¤ÏÄä»ß (block) ¤¹¤ë (¥½¥±¥Ã¥È¤¬ÈóÄä»ß (nonblocking) I/O ¥â¡¼¥É +¤Ç¤Ê¤¤¾ì¹ç)¡£ÈóÄä»ß¥â¡¼¥É¤Î¾ì¹ç¤Ë¤Ï¥¨¥é¡¼ +.B EAGAIN +¤« +.B EWOULDBLOCK +¤Ç¼ºÇÔ¤¹¤ë¡£ +¤¤¤Ä¥Ç¡¼¥¿¤ò¤µ¤é¤ËÁ÷¿®¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¤«¤òÃΤ뤿¤á¤Ë¡¢ +.BR select (2) +¥³¡¼¥ë¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.I flags +°ú¤­¿ô¤Ï¡¢°Ê²¼¤Î¥Õ¥é¥°¤Î (0 ¸Ä°Ê¾å¤Î) ¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýϤò +¤È¤Ã¤¿¤â¤Î¤ò»ØÄꤹ¤ë¡£ +.\" FIXME ? MSG_PROXY ¤Ë¤Ä¤¤¤Æµ­ºÜ¤¹¤ë¤³¤È +.\" (MSG_PROXY ¤Ï 2.3.15 ¤Ç¤Ê¤¯¤Ê¤Ã¤¿) +.TP +.BR MSG_CONFIRM " (Linux 2.3.15 °Ê¹ß)" +žÁ÷½èÍý¤Ë¿ÊŸ¤¬¤¢¤Ã¤¿¡¢¤Ä¤Þ¤êÁê¼ê¦¤«¤éÀ®¸ù¤Î±þÅú¤ò¼õ¤±¤¿¤³¤È¤ò¥ê¥ó¥¯ÁØ¤Ë +ÃΤ餻¤ë¡£¥ê¥ó¥¯Áؤ¬¤³¤ÎÄÌÃΤò¼õ¤±¼è¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢Ä̾ï¤É¤ª¤ê +(¥æ¥Ë¥­¥ã¥¹¥È ARP ¤ò»È¤¦¤Ê¤É¤ÎÊýË¡¤Ç) ¶á˵ (neighbor) ¤ÎºÆ¸¡º÷¤ò¹Ô¤¦¡£ +.B SOCK_DGRAM +¤È +.B SOCK_RAW +¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Î¤ßÍ­¸ú¤Ç¡¢¸½ºß¤Î¤È¤³¤í IPv4 ¤È IPv6 ¤Î¤ß¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¾Ü¤·¤¯¤Ï +.BR arp (7) +»²¾È¤Î¤³¤È¡£ +.TP +.B MSG_DONTROUTE +¥Ñ¥±¥Ã¥È¤òÁ÷¤ê½Ð¤¹¤Î¤Ë¥²¡¼¥È¥¦¥§¥¤¤ò»ÈÍѤ»¤º¡¢ +ľÀÜÀܳ¤µ¤ì¤Æ¤¤¤ë¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î¥Û¥¹¥È¤À¤±¤ËÁ÷¤ë¡£ +Ä̾¤³¤Î¥Õ¥é¥°¤Ï¿ÇÃÇ (diagnostic) ¤ä¥ë¡¼¥Æ¥£¥ó¥°¡¦¥×¥í¥°¥é¥à¤Ë +¤è¤Ã¤Æ¤Î¤ß»ÈÍѤµ¤ì¤ë¡£¤³¤Î¥Õ¥é¥°¤Ï¡¢·ÐÏ©À©¸æ¤¬¹Ô¤ï¤ì¤ë¥×¥í¥È¥³¥ë¥Õ¥¡¥ß¥ê¡¼ +¤ËÂФ·¤Æ¤Î¤ßÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£¥Ñ¥±¥Ã¥È¥½¥±¥Ã¥È¤Ë¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B MSG_DONTWAIT +ÈóÄä»ß (nonblocking) Áàºî¤òÍ­¸ú¤Ë¤¹¤ë¡£Áàºî¤¬Ää»ß¤µ¤ì¤ë¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï +.B EAGAIN +¤« +.B EWOULDBLOCK +¤òÊÖ¤¹¤è¤¦¤Ë¤¹¤ë +.RB ( fcntl (2) +¤Î +.B F_SETFL +¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤âÍ­¸ú¤Ë¤Ç¤­¤ë)¡£ +.TP +.BR MSG_EOR " (Linux 2.2 °Ê¹ß)" +¥ì¥³¡¼¥É¤Î½ªÎ»¤ò»Ø¼¨¤¹¤ë +.RB ( SOCK_SEQPACKET +¤Î¤è¤¦¤Ë¤³¤Î³µÇ°¤ËÂбþ¤·¤Æ¤¤¤ë¥½¥±¥Ã¥È¼ïÊ̤ΤȤ­¤ËÍ­¸ú)¡£ +.TP +.BR MSG_MORE " (Linux 2.4.4 °Ê¹ß)" +¸Æ¤Ó½Ð¤·¸µ¤Ë¤µ¤é¤ËÁ÷¤ë¥Ç¡¼¥¿¤¬¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î¥Õ¥é¥°¤Ï TCP ¥½¥±¥Ã¥È¤È¤È¤â¤Ë»ÈÍѤµ¤ì¡¢ +.B TCP_CORK +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ÈƱ¤¸¸ú²Ì¤¬ÆÀ¤é¤ì¤ë +.RB ( tcp (7) +¤ò»²¾È)¡£ +.B TCP_CORK +¤È¤Î°ã¤¤¤Ï¡¢¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤È¸Æ¤Ó½Ð¤·Ã±°Ì¤Ç +¤³¤Îµ¡Ç½¤òÍ­¸ú¤Ë¤Ç¤­¤ëÅÀ¤Ç¤¢¤ë¡£ + +Linux 2.6 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¥Õ¥é¥°¤Ï UDP ¥½¥±¥Ã¥È¤Ç¤â¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤ª¤ê¡¢ +¤³¤Î¥Õ¥é¥°ÉÕ¤­¤ÇÁ÷¿®¤µ¤ì¤¿Á´¤Æ¤Î¥Ç¡¼¥¿¤ò°ì¤Ä¤Î¥Ç¡¼¥¿¥°¥é¥à¤Ë¤Þ¤È¤á¤Æ +Á÷¿®¤¹¤ë¤³¤È¤ò¡¢¥«¡¼¥Í¥ë¤ËÃΤ餻¤ë¡£¤Þ¤È¤á¤é¤ì¤¿¥Ç¡¼¥¿¥°¥é¥à¤Ï¡¢ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤻ¤º¤Ë¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¼Â¹Ô¤µ¤ì¤¿ºÝ¤Ë½é¤á¤ÆÁ÷¿®¤µ¤ì¤ë +.RB ( udp (7) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.B UDP_CORK +¤â»²¾È)¡£ +.TP +.BR MSG_NOSIGNAL " (Linux 2.2 °Ê¹ß)" +¥¹¥È¥ê¡¼¥à»Ø¸þ¤Î¥½¥±¥Ã¥È¤ÇÁê¼ê¦¤¬Àܳ¤òÀÚÃǤ·¤¿»þ¤Ë¡¢¥¨¥é¡¼¤È¤·¤Æ +.B SIGPIPE +¤òÁ÷¿®¤·¤Ê¤¤¤è¤¦¤ËÍ׵᤹¤ë¡£¤³¤Î¾ì¹ç¤Ç¤â +.B EPIPE +¤ÏÊÖ¤µ¤ì¤ë¡£ +.TP +.B MSG_OOB +.I "ÂÓ°è³° (out-of-band)" +¥Ç¡¼¥¿¤ò¥µ¥Ý¡¼¥È¤¹¤ë¥½¥±¥Ã¥È (Î㤨¤Ð +.BR SOCK_STREAM ) +¤Ç +.I ÂÓ°è³° +¥Ç¡¼¥¿¤òÁ÷¤ë¡£²¼°Ì¥×¥í¥È¥³¥ë¤â +.I ÂÓ°è³° +¥Ç¡¼¥¿¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +.PP +.I msghdr +¹½Â¤ÂΤÎÆâÍƤϰʲ¼¤ÎÄ̤ꡣ +³Æ¥Õ¥£¡¼¥ë¥É¤ÎÀµ³Î¤Êµ­½Ò¤Ë¤Ä¤¤¤Æ¤Ï +.BR recv (2) +¤È°Ê²¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£ +.in +4n +.nf + +struct msghdr { + void *msg_name; /* ÄɲäΥ¢¥É¥ì¥¹ */ + socklen_t msg_namelen; /* ¥¢¥É¥ì¥¹¤Î¥µ¥¤¥º */ + struct iovec *msg_iov; /* scatter/gather ÇÛÎó */ + size_t msg_iovlen; /* msg_iov ¤ÎÍ×ÁÇ¿ô */ + void *msg_control; /* Êä½õ¥Ç¡¼¥¿(¸å½Ò) */ + socklen_t msg_controllen; /* Êä½õ¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡Ä¹ */ + int msg_flags; /* ¼õ¿®¥á¥Ã¥»¡¼¥¸¤Î¥Õ¥é¥° */ +}; +.fi +.in +.PP +.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. +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÁ÷¿®¤µ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄê¤Ë¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Ï¥½¥±¥Ã¥ÈÁؤÇȯÀ¸¤¹¤ë°ìÈÌŪ¤Ê¥¨¥é¡¼¤Ç¤¢¤ë¡£¤³¤ì°Ê³°¤Ë¡¢²¼ÁؤΠ+¥×¥í¥È¥³¥ë¡¦¥â¥¸¥å¡¼¥ë¤ÇÀ¸À®¤µ¤ì¤¿¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤ì¤é¤Ë¤Ä¤¤¤Æ¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥Þ¥Ë¥å¥¢¥ë¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.B EACCES +(Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤Ï¥Ñ¥¹Ì¾¤Ç¼±Ê̤µ¤ì¤ë¡£) +¥½¥±¥Ã¥È¡¦¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤«¤Ã¤¿¤«¡¢¥Ñ¥¹Ì¾¤Ø +Åþ㤹¤ë¤Þ¤Ç¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤¤¤º¤ì¤«¤ËÂФ¹¤ë¸¡º÷µö²Ä¤¬¤Ê¤«¤Ã¤¿¡£ +.RB ( path_resolution (7) +¤â»²¾È¤Î¤³¤È) +.TP +.BR EAGAIN " ¤Þ¤¿¤Ï " EWOULDBLOCK +.\" Actually EAGAIN on Linux +¥½¥±¥Ã¥È¤¬ÈóÄä»ß¤ËÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢ +Í׵ᤵ¤ì¤¿Áàºî¤¬Ää»ß¤·¤¿¡£ +POSIX.1-2001 ¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¤É¤Á¤é¤Î¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤âǧ¤á¤Æ¤ª¤ê¡¢ +¤³¤ì¤é 2 ¤Ä¤ÎÄê¿ô¤¬Æ±¤¸Ãͤò»ý¤Ä¤³¤È¤âµá¤á¤Æ¤¤¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢Î¾Êý¤Î²ÄǽÀ­¤ò +³Îǧ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B EBADF +̵¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B ECONNRESET +Àܳ¤¬ÀܳÁê¼ê¤Ë¤è¤ê¥ê¥»¥Ã¥È¤µ¤ì¤¿¡£ +.TP +.B EDESTADDRREQ +¥½¥±¥Ã¥È¤¬Àܳ·¿ (connection-mode) ¤Ç¤Ï¤Ê¤¯¡¢ +¤«¤ÄÁ÷¿®Àè¤Î¥¢¥É¥ì¥¹¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +¥æ¡¼¥¶¡¼¶õ´Ö¤È¤·¤ÆÉÔÀµ¤Ê¥¢¥É¥ì¥¹¤¬¥Ñ¥é¥á¡¼¥¿¡¼¤È¤·¤Æ»ØÄꤵ¤ì¤¿¡£ +.TP +.B EINTR +¥Ç¡¼¥¿¤¬Á÷¿®¤µ¤ì¤ëÁ°¤Ë¡¢¥·¥°¥Ê¥ë¤¬È¯À¸¤·¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +ÉÔÀµ¤Ê°ú¤­¿ô¤¬ÅϤµ¤ì¤¿¡£ +.TP +.B EISCONN +Àܳ·¿¥½¥±¥Ã¥È¤ÎÀܳ¤¬¤¹¤Ç¤Ë³ÎΩ¤·¤Æ¤¤¤¿¤¬¡¢¼õ¿®¼Ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¡£ +(¸½ºß¤Î¤È¤³¤í¡¢¤³¤Î¾õ¶·¤Ç¤Ï¡¢¤³¤Î¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¤«¡¢ +¼õ¿®¼Ô¤Î»ØÄ̵꤬»ë¤µ¤ì¤ë¤«¡¢¤Î¤¤¤º¤ì¤«¤È¤Ê¤ë) +.TP +.B EMSGSIZE +¤½¤Î¥½¥±¥Ã¥È¼ïÊÌ +.\" (Î㤨¤Ð SOCK_DGRAM) +¤Ç¤Ï¥½¥±¥Ã¥È¤ËÅϤµ¤ì¤¿¤Þ¤Þ¤Î·Á¤Ç¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤¹¤ëɬÍפ¬¤¢¤ë¤¬¡¢ +¥á¥Ã¥»¡¼¥¸¤¬Â礭²á¤®¤ë¤¿¤áÁ÷¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.B ENOBUFS +¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î½ÐÎÏ¥­¥å¡¼¤¬°ìÇդǤ¢¤ë¡£ +°ìÈÌŪ¤Ë¤Ï¡¢°ì»þŪ¤ÊíÕíÔ (congestion) ¤Î¤¿¤á¤Ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ +Á÷¿®¤ò»ß¤á¤Æ¤¤¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +(Ä̾Linux ¤Ç¤Ï¤³¤Î¤è¤¦¤Ê¤³¤È¤Ïµ¯¤³¤é¤Ê¤¤¡£¥Ç¥Ð¥¤¥¹¤Î¥­¥å¡¼¤¬ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤·¤¿¾ì¹ç¤Ë¤Ï¥Ñ¥±¥Ã¥È¤ÏÌۤäƼΤƤé¤ì¤ë) +.TP +.B ENOMEM +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B ENOTCONN +¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤ª¤é¤º¡¢ÀܳÀè¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTSOCK +°ú¤­¿ô +.I sockfd +¤¬¥½¥±¥Ã¥È¤Ç¤Ê¤¤¡£ +.TP +.B EOPNOTSUPP +°ú¤­¿ô +.I flags +¤Î¤¤¤¯¤Ä¤«¤Î¥Ó¥Ã¥È¤¬¡¢¤½¤Î¥½¥±¥Ã¥È¼ïÊ̤ǤÏÉÔŬÀڤʤâ¤Î¤Ç¤¢¤ë¡£ +.TP +.B EPIPE +Àܳ»Ø¸þ¤Î¥½¥±¥Ã¥È¤Ç¥í¡¼¥«¥ë¦¤¬ÊĤ¸¤é¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¾ì¹ç¡¢ +.B MSG_NOSIGNAL +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¥×¥í¥»¥¹¤Ë¤Ï +.B SIGPIPE +¤âƱ»þ¤ËÁ÷¤é¤ì¤ë¡£ +.SH ½àµò +4.4BSD, SVr4, POSIX.1-2001. +(¤³¤ì¤é¤Î´Ø¿ô¥³¡¼¥ë¤Ï 4.2BSD ¤ÇºÇ½é¤ËÅо줷¤¿)¡£ + +POSIX.1-2001 ¤Ë¤Ï¡¢ +.B MSG_OOB +¤È +.B MSG_EOR +¥Õ¥é¥°¤À¤±¤¬µ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.B MSG_CONFIRM +¥Õ¥é¥°¤Ï Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¾åµ­¤Î¥×¥í¥È¥¿¥¤¥×¤Ï 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) +¤â»²¾È¤¹¤ë¤³¤È¡£ + +POSIX.1-2001 ¤Ç¤Ï¡¢¹½Â¤ÂÎ +.I msghdr +¤Î¥Õ¥£¡¼¥ë¥É +.I msg_controllen +¤Ï +.I socklen_t +·¿¤Ç¤¢¤ë¤Ù¤­¤À¤È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +¸½ºß¤Î glibc (glibc 2.4) ¤Ç¤Ï +.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. +.SH ¥Ð¥° +Linux ¤Ï +.B ENOTCONN +¤òÊÖ¤¹¾õ¶·¤Ç +.B EPIPE +¤òÊÖ¤¹¤³¤È¤¬¤¢¤ë¡£ +.SH Îã +.BR sendto () +¤ÎÍøÍÑÎ㤬 +.BR getaddrinfo (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) diff --git a/release/man2/sendfile.2 b/release/man2/sendfile.2 new file mode 100644 index 00000000..efb17cc4 --- /dev/null +++ b/release/man2/sendfile.2 @@ -0,0 +1,190 @@ +.\" This man page is Copyright (C) 1998 Pawel Krawczyk. +.\" 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. +.\" $Id: sendfile.2,v 1.5 1999/05/18 11:54:11 freitag Exp $ +.\" 2000-11-19 bert hubert : in_fd cannot be socket +.\" +.\" 2004-12-17, mtk +.\" updated description of in_fd and out_fd for 2.6 +.\" Various wording and formatting changes +.\" +.\" 2005-03-31 Martin Pool mmap() improvements +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1999-06-26, HANATAKA Shinya +.\" Updated 2001-02-16, Kentaro Shirakata +.\" Updated 2003-09-08, Kentaro Shirakata +.\" Updated 2005-03-14, Akihiro MOTOKI +.\" Updated 2005-04-17, Akihiro MOTOKI +.\" Updated 2010-04-18, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: socket ¥½¥±¥Ã¥È +.\"WORD: lock ¥í¥Ã¥¯ +.\" +.TH SENDFILE 2 2010-02-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sendfile \- ¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿´Ö¤Ç¥Ç¡¼¥¿¤òžÁ÷¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \ + offset ", size_t" " count" ); +.\" °Ê²¼¤Ï¡¢¤¢¤Þ¤ê¤Ë¤â±ø¤¤¡£ glibc ¥Ð¡¼¥¸¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Î¥³¥á¥ó¥È¤Ï +.\" ¡Ö¥Ø¥Ã¥À¡×¤Ç¤Ï¤Ê¤¯¡¢¡ÖÃí°Õ¡×¤Ë½ñ¤¤¤Æ¤ª¤¯¡£ +.\" +.\" .B #include +.\" .br +.\" .B #if (__GLIBC__==2 && __GLIBC_MINOR__>=1) || __GLIBC__>2 +.\" .br +.\" .B #include +.\" .br +.\" #else +.\" .br +.\" .B #include +.\" .br +.\" .B /* No system prototype before glibc 2.1. */ +.\" .br +.\" .BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \ +.\" offset ", size_t" " count" ) +.\" .br +.\" .B #endif +.\" +.SH ÀâÌÀ +.BR sendfile () +¤Ï¡¢¤¢¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÊ̤Π+¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ø¤Î¥Ç¡¼¥¿¤Î¥³¥Ô¡¼¤ò¹Ô¤¦¡£ +¤³¤Î¥³¥Ô¡¼¤Ï¥«¡¼¥Í¥ëÆâ¤Ç¹Ô¤ï¤ì¤ë¤Î¤Ç¡¢ +.BR sendfile () +¤Ï¡¢ +.BR read (2) +¤È +.BR write (2) +¤òÁȤ߹ç¤ï¤»¤ë¤è¤ê¤â¸úΨ¤¬¤è¤¤¡£ +.BR read (2) +¤ä +.BR write (2) +¤Ç¤Ï¥æ¡¼¥¶¶õ´Ö¤È¤Î´Ö¤Ç¥Ç¡¼¥¿¤ÎžÁ÷¤¬É¬ÍפȤʤ뤫¤é¤Ç¤¢¤ë¡£ + +.I in_fd +¤ÏÆɤ߹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¢ +.I out_fd +¤Ï½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.I offset +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I offset +¤Ï +.BR sendfile () +¤¬ +.I in_fd +¤Î¤É¤³¤«¤é¥Ç¡¼¥¿¤òÆɤ߻Ϥá¤ë¤«¤ò¼¨¤¹¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤òÊÝ»ý¤¹¤ëÊÑ¿ô¤Ø¤Î +¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.BR sendfile () +¤ÏÉüµ¢¤¹¤ë»þ¡¢¤³¤ÎÊÑ¿ô¤ËºÇ¸å¤ËÆɤ߹þ¤ó¤À¥Ð¥¤¥È¤Î +¼¡¤Î¥Ð¥¤¥È¤Î¥ª¥Õ¥»¥Ã¥È¤ò½ñ¤­¹þ¤à¡£ +.I offset +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.BR sendfile () +¤Ï +.I in_fd +¤Î¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤Î¸½ºßÃͤòÊѹ¹¤·¤Ê¤¤¡£ +NULL ¤Î¾ì¹ç¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤Î¸½ºßÃͤò +.I in_fd +¤«¤éÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÈ¿±Ç¤·¤¿°ÌÃÖ¤ËÄ´À°¤¹¤ë¡£ + +.I offset +¤¬ NULL ¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¤Ï +.I in_fd +¤Î¸½ºß¤Î¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤«¤éÆɤ߽Фµ¤ì¡¢ +¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤Ï¤³¤Î¸Æ¤Ó½Ð¤·¤Ç¹¹¿·¤µ¤ì¤ë¡£ + +.I count +¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿´Ö¤Ç¥³¥Ô¡¼¤¹¤ë¥Ð¥¤¥È¿ô¤Ç¤¢¤ë¡£ + +º£¤Î¤È¤³¤í (Linux 2.6.9 ¤Ç¤Ï)¡¢ +.I in_fd +¤Ï +.BR mmap (2) +É÷¤ÎÁàºî¤¬¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(¥½¥±¥Ã¥È¤ò»Ø¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤)¡£¤Þ¤¿¡¢ +.I out_fd +¤Ï¥½¥±¥Ã¥È¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.BR sendfile () +¤¬ +.B EINVAL +¤ä +.B ENOSYS +¤Ç¼ºÇÔ¤¹¤ë¤è¤¦¤Ê¾ì¹ç¤Ï¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï +.BR read (2)/ write (2) +¤ËÌ᤹¤³¤È¤ò¹Í¤¨¤Æ¤â¤è¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +žÁ÷¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ +.I out_fd +¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.B O_NONBLOCK +¤òÍѤ¤¤ÆÈó¥Ö¥í¥Ã¥¯ I/O ¤¬ÁªÂò¤µ¤ì¤¿¤¬¡¢½ñ¤­¹þ¤ß¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¡£ +.TP +.B EBADF +ÆþÎÏ¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +½ÐÎÏ¥Õ¥¡¥¤¥ë¤¬½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +¥¢¥É¥ì¥¹¤¬¤ª¤«¤·¤¤¡£ +.TP +.B EINVAL +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Í­¸ú¤Ç¤Ê¤¤¤«¡¢¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¡£¤â¤·¤¯¤Ï +.BR mmap (2) +É÷¤ÎÁàºî¤¬ +.I in_fd +¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +.TP +.B EIO +.I in_fd +¤«¤éÆɤ߹þ¤ó¤Ç¤¤¤ë¤¦¤Á¤Ëͽ´ü¤·¤Ê¤¤¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B ENOMEM +.I in_fd +¤«¤éÆɤ߹þ¤à¤¿¤á¤Î½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.B sendfile +¤Ï Linux 2.2 ¤Î¿·¤·¤¤µ¡Ç½¤Ç¤¢¤ë¡£ +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤Ï glibc 2.1 ¤«¤é¸ºß¤·¤Æ¤¤¤ë¡£ +.SH ½àµò +POSIX.1-2001 ¤ä¾¤Îɸ½à¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ + +¾¤Î Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢°Û¤Ê¤Ã¤¿Êý¼°¤ä¥×¥í¥È¥¿¥¤¥×¤Ç +.BR sendfile () +¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£°Ü¿¢À­¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +.BR sendfile () +¤ò»È¤Ã¤Æ TCP ¥½¥±¥Ã¥È¤Ë¥Õ¥¡¥¤¥ë¤òÁ÷¤í¤¦¤È¤·¤Æ¤¤¤Æ¡¢ +¥Õ¥¡¥¤¥ë¤ÎÆâÍƤÎÁ°¤Ë¥Ø¥Ã¥À¡¦¥Ç¡¼¥¿¤òÉÕ¤±²Ã¤¨¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ï¡¢ +¥Ñ¥±¥Ã¥È¿ô¤òºÇ¾®¤Ë¤·¤ÆÀ­Ç½¤ò¾å¤²¤ë¤¿¤á¤Ë +.BR tcp (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë +.B TCP_CORK +¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¤¤¤¤¤À¤í¤¦¡£ + +Linux 2.4 ¤È¤½¤ì°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ +.I out_fd +¤ÏÄ̾ï¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤Ç¤­¡¢ +.BR sendfile () +¤Ï¤½¤Î¥Õ¥¡¥¤¥ë¤Î¥ª¥Õ¥»¥Ã¥È¤Î¸½ºßÃͤòÊѹ¹¤·¤Æ¤¤¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mmap (2), +.BR open (2), +.BR socket (2), +.BR splice (2) diff --git a/release/man2/set_mempolicy.2 b/release/man2/set_mempolicy.2 new file mode 100644 index 00000000..8e298dd7 --- /dev/null +++ b/release/man2/set_mempolicy.2 @@ -0,0 +1,301 @@ +.\" Copyright 2003,2004 Andi Kleen, SuSE Labs. +.\" and Copyright 2007 Lee Schermerhorn, Hewlett Packard +.\" +.\" 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. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\" 2006-02-03, mtk, substantial wording changes and other improvements +.\" 2007-08-27, Lee Schermerhorn +.\" more precise specification of behavior. +.\" +.\" Translated 2006-08-14, Akihiro MOTOKI , LDP v2.39 +.\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2008-02-13, Akihiro MOTOKI, LDP v2.77 +.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-08-21, Akihiro MOTOKI, LDP v3.07 +.\" Updated 2008-09-02, Akihiro MOTOKI, LDP v3.08 +.\" Updated 2008-11-19, Akihiro MOTOKI, LDP v3.13 +.\" +.\"WORD: anonymous memory ̵̾¥á¥â¥ê +.\" +.TH SET_MEMPOLICY 2 2008-08-15 Linux "Linux Programmer's Manual" +.SH ̾Á° +set_mempolicy \- ¥×¥í¥»¥¹¤È¤½¤Î»Ò¥×¥í¥»¥¹¤Î NUMA ¥á¥â¥ê¤Î +¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int set_mempolicy(int " mode ", unsigned long *" nodemask , +.BI " unsigned long " maxnode ); +.sp +\fI\-lnuma\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.SH ÀâÌÀ +.BR set_mempolicy () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î NUMA ¥Ý¥ê¥·¡¼¤ò +.I policy +¤ËÀßÄꤹ¤ë¡£ +NUMA ¥Ý¥ê¥·¡¼¤Ï¥Ý¥ê¥·¡¼¥â¡¼¥É¤È 0 ¸Ä°Ê¾å¤Î¥Î¡¼¥É¤«¤é¹½À®¤µ¤ì¡¢ +ÀßÄêÆâÍƤϰú¤­¿ô +.IR mode , +.IR nodemask , +.I maxnode +¤Ë¤è¤ê»ØÄꤵ¤ì¤ë¡£ + +NUMA (ÈóÂоΥá¥â¥ê¥¢¥¯¥»¥¹) ¥Þ¥·¥ó¤Ç¤Ï¡¢CPU ¤Ë¤è¤ê +¥á¥â¥ê¥³¥ó¥È¥í¡¼¥é¤¬°Û¤Ê¤ê¡¢µ÷Î¥¤â°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï¡¢¤É¤Î¥Î¡¼¥É¤«¤é¥á¥â¥ê¤ò¤½¤Î¥×¥í¥»¥¹¤Ë +³ä¤êÅö¤Æ¤é¤ì¤ë¤«¤òÄê¤á¤ë¤â¤Î¤Ç¤¢¤ë¡£ + +.BR set_mempolicy () +¤Ï¡¢¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤òÄê¤á¤ë¡£ +¥×¥í¥»¥¹¤Î¥Ý¥ê¥·¡¼¤Ï¡¢ +.BR mbind (2) +¤ÇÀßÄꤵ¤ì¤ëÆÃÄê¤Î¥Ý¥ê¥·¡¼¤Ë¤è¤êÀ©¸æ¤µ¤ì¤ë¥á¥â¥êÎΰè°Ê³°¤Î +¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤ª¤±¤ë¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤ËŬÍѤµ¤ì¤ë¡£ +¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ï¡¢ +.B MAP_PRIVATE +¥Õ¥é¥°¤ò»ØÄꤷ¤¿ +.BR mmap (2) +¤ò»È¤Ã¤Æ¥Þ¥Ã¥×¤µ¤ì¤¿¥á¥â¥ê¥Þ¥Ã¥×¡¦¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëÆɤ߽Ф·ÀìÍÑ +(¥í¡¼¥É¤µ¤ì¤ë¤À¤±) ¤Î¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ë¤âŬÍѤµ¤ì¤ë¡£ +¤Þ¤¿¡¢ +.B MAP_SHARED +¥Õ¥é¥°¤ò»ØÄꤷ¤¿ +.BR mmap (2) +¤ò»È¤Ã¤Æ¥Þ¥Ã¥×¤µ¤ì¤¿¥á¥â¥ê¥Þ¥Ã¥×¡¦¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ë¤â +ŬÍѤµ¤ì¤ë (¤³¤Î¾ì¹ç¤Ï¥Ú¡¼¥¸¤Î¥¢¥¯¥»¥¹¼ïÊ̤˴ؤï¤é¤ºÅ¬ÍѤµ¤ì¤ë) ¡£ +ÀßÄꤷ¤¿¥Ý¥ê¥·¡¼¤Ï¡¢¥×¥í¥»¥¹¤Ë¿·µ¬¤Î¥Ú¡¼¥¸¤¬³ä¤êÅö¤Æ¤é¤ì¤ë¤È¤­¤Ë¤Î¤ß +ŬÍѤµ¤ì¤ë¡£ÌµÌ¾¥á¥â¥ê (anonymous memory) ¤Î¾ì¹ç¡¢¿·µ¬¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ï +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬½é¤á¤Æ¥Ú¡¼¥¸¤Ë¥¢¥¯¥»¥¹¤·¤¿ºÝ¤Ë¹Ô¤ï¤ì¤ë¡£ + +.I mode +°ú¤­¿ô¤Ë¤Ï +.BR MPOL_DEFAULT , +.BR MPOL_BIND , +.BR MPOL_INTERLEAVE , +.B MPOL_PREFERRED +¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄꤷ¤Æ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B MPOL_DEFAULT +°Ê³°¤Î¥Ý¥ê¥·¡¼¤Î¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï +.I nodemask +°ú¤­¿ô¤Ç°ì¤Ä°Ê¾å¤Î¥Î¡¼¥É¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ + +.I mode +°ú¤­¿ô¤Ë¤Ï¡¢ÄÉ²Ã¤Ç +.I "¥â¡¼¥É¥Õ¥é¥°" +¤ò´Þ¤á¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë +.I "¥â¡¼¥É¥Õ¥é¥°" +¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.TP +.BR MPOL_F_STATIC_NODES " (Linux 2.6.26 °Ê¹ß)" +¶õ¤Ç¤Ê¤¤ +.I nodemask +¤Ï¡¢ÊªÍý¥Î¡¼¥É ID ¤Ç¤¢¤ë¡£ +Linux ¤Ç¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬°Û¤Ê¤ë CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È (cpuset context) +¤Ë°ÜÆ°¤·¤¿¾ì¹ç¤Ç¤â¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç +µö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É½¸¹ç¤¬ÊѲ½¤·¤¿¾ì¹ç¤Ç¤â¡¢ +.I nodemask +¤ò¥Þ¥Ã¥Ô¥ó¥°¤·Ä¾¤¹¤³¤È¤Ï¤Ê¤¤¡£ +.TP +.BR MPOL_F_RELATIVE_NODES " (Linux 2.6.26 °Ê¹ß)" +¶õ¤Ç¤Ê¤¤ +.I nodemask +¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¤Çµö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É ID ½¸¹ç +¤Ë¤ª¤±¤ëÁêÂÐŪ¤Ê¥Î¡¼¥É ID ¤Ç¤¢¤ë¡£ +.PP +.I nodemask +¤Ï¡¢ºÇÂç¤Ç +.I maxnode +¥Ó¥Ã¥È¤«¤é¹½À®¤µ¤ì¤ë¥Î¡¼¥É ID ¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤ò»Ø¤¹¡£ +¥Ó¥Ã¥È¥Þ¥¹¥¯¤ÎÂ礭¤µ¤Ï¡¢Ä¾¶á¤Î +.I sizeof(unsigned long) +¤ÎÇÜ¿ô¤ËÀÚ¤ê¾å¤²¤é¤ì¤ë¤¬¡¢¥«¡¼¥Í¥ë¤¬»ÈÍѤ¹¤ë¤Î¤Ï +.I maxnode +¸Ä¤Þ¤Ç¤Î¥Ó¥Ã¥È¤À¤±¤Ç¤¢¤ë¡£ +NULL ÃͤΠ+.I nodemask +¤â¤·¤¯¤ÏÃͤ¬ 0 ¤Î +.I maxnode +¤Ï¥Î¡¼¥É¤Î¶õ½¸¹ç¤òɽ¤¹¡£ +.I maxnode +¤ÎÃͤ¬ 0 ¤Î¾ì¹ç¡¢ +.I nodemask +°ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ + +.I nodemask +¤¬É¬¿Ü¤Î¾ìÌ̤Ǥϡ¢ +.I nodemask +¤Ë¡¢¥ª¥ó¥é¥¤¥ó¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç +µö²Ä¤µ¤ì¤Æ¤ª¤ê +.RB ( MPOL_F_STATIC_NODES +¥â¡¼¥É¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢¥á¥â¥ê¤¬¤¢¤ë¥Î¡¼¥É¤¬ +¾¯¤Ê¤¯¤È¤â°ì¤ÄÆþ¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I mode +¤Ë +.B MPOL_F_STATIC_NODES +¤¬¥»¥Ã¥È¤µ¤ì¡¢ +.I nodemask +¤¬É¬¿Ü¤Î¾ìÌ̤ǡ¢ +.I nodemask +¤Ë¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Çµö²Ä¤µ¤ì¤¿¥Î¡¼¥É¤¬ +°ì¤Ä¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥á¥â¥ê¤Î¥Ý¥ê¥·¡¼¤È¤·¤Æ¥Ç¥Õ¥©¥ë¥È¤Î +¡Ö¥í¡¼¥«¥ë¤«¤é³ä¤êÅö¤Æ (local allocation)¡×¤¬Å¬ÍѤµ¤ì¤ë¡£ +¤½¤Î¥×¥í¥»¥¹¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤¬ +.I nodemask +¤Ç»ØÄꤵ¤ì¤¿¥Î¡¼¥É¤ò¾¯¤Ê¤¯¤È¤â°ì¤Ä´Þ¤à¤è¤¦¤Ë¤Ê¤ë¤Þ¤Ç¤Ï¡¢ +·ë²ÌŪ¤Ë»ØÄꤵ¤ì¤¿Æ°ºî¤¬¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ + +.B MPOL_DEFAULT +¥â¡¼¥É¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¤Ê¤¤¥×¥í¥»¥¹¤Î¥á¥â¥ê¥Ý¥ê¥·¡¼¤òºï½ü¤¹¤ë¤³¤È¤ò +»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï¥·¥¹¥Æ¥à¤Î +¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ë¡ÖÌá¤ë¡×¤³¤È¤Ë¤Ê¤ë¡£ +¥·¥¹¥Æ¥à¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ï¡Ö¥í¡¼¥«¥ë¤«¤é¤Î³ä¤êÅö¤Æ (local allocation)¡×¡¢ +¤Ä¤Þ¤ê¥á¥â¥ê³ä¤êÅö¤Æ¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿ CPU ¤Î¥Î¡¼¥É¤Î¥á¥â¥ê¤¬³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +.I nodemask +¤Ë¤Ï NULL ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¡Ö¼«¥Î¡¼¥É (local node)¡×¤Ë¶õ¤­¥á¥â¥ê¤¬Á´¤¯¤Ê¤¤¾ì¹ç¡¢¥·¥¹¥Æ¥à¤Ï +¡Ö¶á¤¯¤Î (near by) ¥Î¡¼¥É¡×¤«¤é¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤è¤¦¤È»î¤ß¤ë¡£ + +.B MPOL_BIND +¥â¡¼¥É¤Ï¸·Ì©¤Ê¥Ý¥ê¥·¡¼¤Ç¡¢¥á¥â¥ê³ä¤êÅö¤Æ¤Ï +.I nodemask +¤Ë»ØÄꤵ¤ì¤¿¥Î¡¼¥É¤Ë¸ÂÄꤵ¤ì¤ë¡£ +.I nodemask +¤Ë 2 ¸Ä°Ê¾å¤Î¥Î¡¼¥É¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ï +¥Î¡¼¥É ID ¤¬¿ô»ú¤È¤·¤ÆºÇ¾®¤Î¥Î¡¼¥É¤«¤é³«»Ï¤µ¤ì¡¢ +¤½¤Î¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç¤½¤Î¥Î¡¼¥É¤«¤é +¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£¤½¤Î¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤Ã¤¿¤é¡¢ +.\"motoki: the next highest ¤Ï the next lowest ¤Î´Ö°ã¤¤¡© +¼¡¤Ë¾®¤µ¤Ê¥Î¡¼¥É ID ¤ò»ý¤Ä¥Î¡¼¥É¤«¤é¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£ +¤³¤ì¤ò¡¢ +.I nodemask +¤Ç»ØÄꤵ¤ì¤¿Á´¤Æ¤Î¥Î¡¼¥É¤Ç¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç·«¤êÊÖ¤¹¡£ +.I nodemask +¤Ç»ØÄꤵ¤ì¤¿°Ê³°¤Î¥Î¡¼¥É¤«¤é¤Ï¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ + +.B MPOL_INTERLEAVE +¤Ç¤Ï¡¢¥Ú¡¼¥¸³ä¤êÅö¤Æ¤ò +.I nodemask +¤Ë»ØÄꤵ¤ì¤¿¥Î¡¼¥É¤Î´Ö¤Ç¥Î¡¼¥É ID ¤Î¿ô»ú½ç¤Ç¸ò¸ß¤Ë¹Ô¤¦¡£ +¤³¤Î¥Ý¥ê¥·¡¼¤Ç¤Ï¡¢Ê£¿ô¤Î¥Î¡¼¥É¤Ë¥Ú¡¼¥¸¤ò¹­¤²¤ÆÇÛÃÖ¤·¡¢¤³¤ì¤é¤Î¥Ú¡¼¥¸¤Ø¤Î¥á¥â¥ê +¥¢¥¯¥»¥¹¤òʬ»¶¤¹¤ë¤³¤È¤Ç¡¢ÃÙ±ä¤Ç¤Ï¤Ê¤¯¡¢ÂÓ°è¤òºÇŬ²½¤¹¤ë¡£ +¤¿¤À¤·¡¢°ì¤Ä¤Î¥Ú¡¼¥¸¤Ø¤Î¥¢¥¯¥»¥¹¤Ë´Ø¤·¤Æ¤Ï°ÍÁ³¤È¤·¤Æ°ì¤Ä¤Î¥Î¡¼¥É¤Î¥á¥â¥êÂÓ°è +¤¬¾å¸Â¤È¤Ê¤ë¡£ +.\" NOTE: the following sentence doesn't make sense in the context +.\" of set_mempolicy() -- no memory area specified. +.\" To be effective the memory area should be fairly large, +.\" at least 1MB or bigger. + +.B MPOL_PREFERRED +¤Ï¡¢³ä¤êÅö¤Æ»þ¤ËÍ¥À褵¤ì¤ë¥Î¡¼¥É (preferred node) ¤òÀßÄꤹ¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¤Þ¤ºÍ¥Àè¥Î¡¼¥É¤«¤é¥Ú¡¼¥¸³ä¤êÅö¤Æ¤ò¹Ô¤ª¤¦¤È¤·¡¢ +Í¥Àè¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¾¯¤Ê¤¤¾ì¹ç¤Ë¡Ö¶á¤¯¤Î (near by)¡×¥Î¡¼¥É¤«¤é +³ä¤êÅö¤Æ¤ò¹Ô¤¦¡£ +.I nodemask +¤ËÊ£¿ô¤Î¥Î¡¼¥É ID ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +.I nodemask +Æâ¤ÎºÇ½é¤Î¥Î¡¼¥É¤¬Í¥Àè¥Î¡¼¥É¤È¤·¤ÆÁªÂò¤µ¤ì¤ë¡£ +°ú¤­¿ô +.IR nodemask , +.I maxnode +¤Ç¶õ½¸¹ç¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢¥Ý¥ê¥·¡¼¤Ï (¾å½Ò¤Î¥·¥¹¥Æ¥à¤Î +¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤ÈƱÍͤË) ¡Ö¥í¡¼¥«¥ë¤«¤é¤Î³ä¤êÅö¤Æ¡×¤È¤Ê¤ë¡£ + +¥×¥í¥»¥¹¤Î¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï +.BR execve (2) +¤ÎÁ°¸å¤ÇÊÝ»ý¤µ¤ì¡¢ +.BR fork (2) +¤ä +.BR clone (2) +¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ë·Ñ¾µ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR set_mempolicy () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.\"motoki: Part of all of the memory ¤Ï Part or all .. ¤Î´Ö°ã¤¤¡© +.I nodemask +¤È +.I maxnode +¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥êÎΰè¤Î°ìÉô¤Þ¤¿¤ÏÁ´Éô¤¬¡¢ +¸Æ¤Ó½Ð¤·¸µ¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I mode +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.I mode +¤¬ +.B MPOL_DEFAULT +¤Ç¡¢ +.I nodemask +¤¬¶õ¤Ç¤Ï¤Ê¤¤¡£ +.I mode +¤¬ +.B MPOL_BIND +¤« +.B MPOL_INTERLEAVE +¤Ç¡¢ +.I nodemask +¤¬¶õ¤Ç¤¢¤ë¡£ +.I maxnode +¤Ç¼ÂºÝ¤Ë°ÕÌ£¤¬¤¢¤ë¥Ó¥Ã¥È¿ô¤è¤ê¿¤¯¤Î¥Ó¥Ã¥È¿ô¤¬»ØÄꤵ¤ì¤¿¡£ +.I nodemask +¤Ë¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëºÇÂç¥Î¡¼¥É ID ¤è¤êÂ礭¤¤¥Î¡¼¥É¤¬»ØÄꤵ¤ì¤¿¡£ +.I nodemask +¤Ë¡¢¥ª¥ó¥é¥¤¥ó¤Ç¡¢¤«¤Ä¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç +µö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤¬°ì¤Ä¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +¥á¥â¥ê¤ò´Þ¤à¥Î¡¼¥É¤¬°ì¤Ä¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.I mode +°ú¤­¿ô¤Ë +.B MPOL_F_STATIC_NODES +¤È +.B MPOL_F_RELATIVE_NODES +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B ENOMEM +ÍøÍѲÄǽ¤Ê¥«¡¼¥Í¥ë¥á¥â¥ê¤¬½½Ê¬¤Ç¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR set_mempolicy () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ð¡¼¥¸¥ç¥ó 2.6.7 ¤Ç Linux ¥«¡¼¥Í¥ë¤ËÄɲ䵤줿¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¥Ú¡¼¥¸¤¬¥¹¥ï¥Ã¥×¡¦¥¢¥¦¥È¤µ¤ì¤ë¾ì¹ç¤Ë¤Ï¡¢ +¥×¥í¥»¥¹¥Ý¥ê¥·¡¼¤ÎÀßÄê¤Ï¿ä¾©¤µ¤ì¤Ê¤¤¡£ +¥¹¥ï¥Ã¥×¡¦¥¢¥¦¥È¤µ¤ì¤¿¥Ú¡¼¥¸¤¬¥Ú¡¼¥¸¡¦¥¤¥ó¤¹¤ëºÝ¤Ë¤â¡¢ +¥Ú¡¼¥¸³ä¤êÅö¤Æ»þ¤ËŬÍѤµ¤ì¤ë¥×¥í¥»¥¹¥Ý¥ê¥·¡¼¤ä¥á¥â¥êÎΰè¥Ý¥ê¥·¡¼¤¬ +»ÈÍѤµ¤ì¤ë¡£ + +¥é¥¤¥Ö¥é¥ê¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR numa (7) +¤ò»²¾È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR get_mempolicy (2), +.BR getcpu (2), +.BR mbind (2), +.BR mmap (2), +.BR numa (3), +.BR cpuset (7), +.BR numa (7), +.BR numactl (8) diff --git a/release/man2/set_thread_area.2 b/release/man2/set_thread_area.2 new file mode 100644 index 00000000..932b6e82 --- /dev/null +++ b/release/man2/set_thread_area.2 @@ -0,0 +1,70 @@ +.\" Copyright (C) 2003 Free Software Foundation, Inc. +.\" 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 +.\" +.TH SET_THREAD_AREA 2 2008-11-27 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +set_thread_area \- ¥¹¥ì¥Ã¥É¶É½êµ­²± (TLS) Îΰè¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int set_thread_area(struct user_desc *" u_info ); +.SH ÀâÌÀ +.PP +.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 +.I entry_number +¤È¤·¤Æ \-1 ¤¬ÅϤµ¤ì¤¿¾ì¹ç¡¢ +.BR set_thread_area () +¤Ï̤»ÈÍÑ (free) ¤Î TLS ¥¨¥ó¥È¥ê¤ò»ÈÍѤ¹¤ë¡£ +̤»ÈÍѤΠTLS ¥¨¥ó¥È¥ê¤¬¤¢¤Ã¤¿¾ì¹ç¡¢¤É¤Î¥¨¥ó¥È¥ê¤¬Êѹ¹¤µ¤ì¤¿¤«¤¬Ê¬¤«¤ë +¤è¤¦¤Ë½ªÎ»»þ¤Ë +.I u_info\->entry_number +¤ÎÃͤ¬Êѹ¹¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR set_thread_area () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I u_info\->entry_number +¤¬Èϰϳ°¤Ç¤¢¤ë¡£ +.TP +.B EFAULT +.I u_info +¤¬ÉÔÀµ¤Ê¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.TP +.B ESRCH +̤»ÈÍѤΠTLS ¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR set_thread_area () +¤Ï Linux 2.5.29 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +.BR set_thread_area () +¤Ï Linux Æȼ«¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤Ë¤Ï +.BR syscall (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR get_thread_area (2) diff --git a/release/man2/set_tid_address.2 b/release/man2/set_tid_address.2 new file mode 100644 index 00000000..0e2c7f07 --- /dev/null +++ b/release/man2/set_tid_address.2 @@ -0,0 +1,104 @@ +.\" Copyright (C) 2004 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. +.\" +.\" Japanese Version Copyright (c) 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated Wed Jan 26 07:21:01 JST 2005 +.\" by Yuichi SATO +.\" +.TH SET_TID_ADDRESS 2 2004-09-10 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +set_tid_address \- ¥¹¥ì¥Ã¥É ID ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long set_tid_address(int *" tidptr ); +.fi +.SH ÀâÌÀ +¥«¡¼¥Í¥ë¤Ï³Æ¥×¥í¥»¥¹¤Ë¤Ä¤¤¤Æ +.I set_child_tid +¤È +.I clear_child_tid +¤È¤¤¤¦ 2 ¤Ä¤ÎÃͤòÊÝ»ý¤¹¤ë¡£ +¤³¤ì¤é¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï NULL ¤Ç¤¢¤ë¡£ +.SS set_child_tid +¥×¥í¥»¥¹¤¬ +.B CLONE_CHILD_SETTID +¥Õ¥é¥°¤ò»ØÄꤷ¤¿ +.BR clone (2) +¤Ë¤è¤Ã¤Æ³«»Ï¤µ¤ì¤¿¾ì¹ç¡¢ +.I set_child_tid +¤Ï +.I child_tidptr +¤ËÀßÄꤵ¤ì¤ë¡£ +¤³¤ì¤Ï +.BR clone (2) +¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î 5 ÈÖÌܤΰú¤­¿ô¤Ç¤¢¤ë¡£ +.LP +.I set_child_tid +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢°ìÈֺǽé¤Ë¿·¤·¤¤¥×¥í¥»¥¹¤¬¹Ô¤¦¤³¤È¤Ï¡¢ +¤³¤Î¥¢¥É¥ì¥¹¤Ë¼«¿È¤Î PID ¤ò½ñ¤­¹þ¤à¤³¤È¤Ç¤¢¤ë¡£ +.SS clear_child_tid +¥×¥í¥»¥¹¤¬ +.B CLONE_CHILD_CLEARTID +¥Õ¥é¥°¤ò»ØÄꤷ¤¿ +.BR clone (2) +¤Ë¤è¤Ã¤Æ³«»Ï¤µ¤ì¤¿¾ì¹ç¡¢ +.I clear_child_tid +¤Ï +.I child_tidptr +¤ËÀßÄꤵ¤ì¤ë¡£ +¤³¤ì¤Ï +.BR clone (2) +¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î 5 ÈÖÌܤΰú¤­¿ô¤Ç¤¢¤ë¡£ +.LP +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR set_tid_address () +¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +.I clear_child_tid +¤ÎÃͤò +.I tidptr +¤ËÀßÄꤹ¤ë¡£ +.LP +.I clear_child_tid +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È¤­¤Ë¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤È¡¢ +¤½¤Î¥×¥í¥»¥¹¤Ï¾¤Î¥×¥í¥»¥¹¤Þ¤¿¤Ï¥¹¥ì¥Ã¥É¤È¥á¥â¥ê¤ò¶¦Í­¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ +¤³¤Î¥¢¥É¥ì¥¹¤Ë 0 ¤¬½ñ¤­¹þ¤Þ¤ì¡¢ +.I futex(child_tidptr, FUTEX_WAKE, 1, NULL, NULL, 0); +¤Î¸Æ¤Ó½Ð¤·¤¬¼Â¹Ô¤µ¤ì¤ë +(¤Ä¤Þ¤ê¡¢¤³¤Î futex ¤ÇÂԤäƤ¤¤ë 1 ¤Ä¤Î¥×¥í¥»¥¹¤òµ¯¤³¤¹ (wake))¡£ +¥¨¥é¡¼¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR set_tid_address () +¤Ï¾ï¤Ë¸½ºß¤Î¥×¥í¥»¥¹¤Î PID ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.BR set_tid_address () +¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î¸Æ¤Ó½Ð¤·¤Ï Linux 2.5.48 °Ê¹ß¤Ç¸ºß¤¹¤ë¡£ +¤³¤³¤Ç½ñ¤«¤ì¤¿¾ÜºÙ¤Ï Linux 2.5.49 °Ê¹ß¤ÇÍ­¸ú¤Ç¤¢¤ë¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR futex (2) diff --git a/release/man2/seteuid.2 b/release/man2/seteuid.2 new file mode 100644 index 00000000..0abbd7ef --- /dev/null +++ b/release/man2/seteuid.2 @@ -0,0 +1,138 @@ +.\" Copyright (C) 2001 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. +.\" +.\" [should really be seteuid.3] +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" Japanese Version Copyright (c) 2001, 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated 2001-06-04, Yuichi SATO +.\" Updated & Modified 2005-01-04, Yuichi SATO +.\" Updated 2010-04-23, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ ID +.\"WORD: real user ID ¼Â¥æ¡¼¥¶¡¼ ID +.\"WORD: saved user ID Êݸ¥æ¡¼¥¶¡¼ ID +.\"WORD: +.\" +.TH SETEUID 2 2009-10-17 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +seteuid, setegid \- ¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ä ¼Â¸ú¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int seteuid(uid_t " euid ); +.br +.BI "int setegid(gid_t " egid ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR seteuid (), +.BR setegid (): +_BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH ÀâÌÀ +.BR seteuid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤òÀßÄꤹ¤ë¡£ +ÈóÆø¢¥æ¡¼¥¶¡¼¤Î¥×¥í¥»¥¹¤Î¾ì¹ç¡¢¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ËÀßÄê¤Ç¤­¤ë¤Î¤Ï¡¢ +¼Â¥æ¡¼¥¶¡¼ ID¡¦¼Â¸ú¥æ¡¼¥¶¡¼ ID¡¦Êݸ set-user-ID ¤Î¤¤¤º¤ì¤«¤À¤±¤Ç¤¢¤ë¡£ + +.BR setegid () +¤Ï¡Ö¥æ¡¼¥¶¡¼¡×¤Ç¤Ï¤Ê¤¯¡Ö¥°¥ë¡¼¥×¡×¤ËÂФ·¤ÆÁ´¤¯Æ±¤¸¤³¤È¤ò¹Ô¤¦¡£ +.\" When +.\" .I euid +.\" equals \-1, nothing is changed. +.\" (This is an artifact of the implementation in glibc of seteuid() +.\" using setresuid(2).) +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ + +.SH ¥¨¥é¡¼ +.\" .TP +.\" .B EINVAL +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¯¡¢ +.I euid +.RI ( egid ) +¤¬¼Â¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID¡¢¤Þ¤¿¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID¡¢ +Êݸ set-user-ID (Êݸ set-group-ID) ¤Î¤¤¤º¤ì¤Ç¤â¤Ç¤Ï¤Ê¤¤ +(Linux ¤Ë¤ª¤¤¤Æ¤Ï¡¢ +.BR seteuid () +¤Ç¤Ï +.B CAP_SETUID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¡¢ +.BR setegid () +¤Ç¤Ï +.B CAP_SETGID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¤¾ì¹ç¤Ë¡¢Æø¢¤¬¤Ê¤¤¤ÈȽÃǤµ¤ì¤ë)¡£ +.SH ½àµò +4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤òÊݸ set-user-ID (Êݸ set-group-ID) ¤Ë +ÀßÄê¤Ç¤­¤ë¤Î¤Ï¡¢Linux 1.1.37 (1.1.38) °Ê¹ß¤Ç¤¢¤ë¡£ +Á´¤Æ¤Î¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ +.B _POSIX_SAVED_IDS +¤ò¥Á¥§¥Ã¥¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.LP +libc4, libc5, glibc 2.0 ¤Ç¤Ï¡¢ +.BI seteuid( euid ) +¤Ï +.BI setreuid(\-1, " euid" ) +¤ÈÅù²Á¤Ç¤¢¤ê¡¢Êݸ set-user-ID ¤òÊѹ¹¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +glibc 2.1 ¤Ç¤Ï¡¢ +.BI setresuid(\-1, " euid" ", \-1)" +¤ÈÅù²Á¤Ç¤¢¤ê¡¢Êݸ set-user-ID Êѹ¹¤·¤Ê¤¤¡£ +ƱÍͤΤ³¤È¤¬ +.BR setegid () +¤Ë¤â¸À¤¨¤ë¡£ + +POSIX.1 ¤Ç¤Ï¡¢ +.BR seteuid () +.RB ( setegid ()) +¤Ç¡¢ +.I euid +.RI ( egid ) +¤È¤·¤Æ¸½ºß¤Î¼Â¸ú¥æ¡¼¥¶ (¥°¥ë¡¼¥×) ID ¤ÈƱ¤¸Ãͤò»ØÄê²Äǽ¤Ç¤¢¤ë +ɬÍפϤʤ¤¤È¤µ¤ì¤Æ¤ª¤ê¡¢¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤Ç¤Ï +.I euid +.RI ( egid ) +¤È¤·¤Æ¸½ºß¤Î¼Â¸ú¥æ¡¼¥¶ (¥°¥ë¡¼¥×) ID ¤ÈƱ¤¸Ãͤò +»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR geteuid (2), +.BR setresuid (2), +.BR setreuid (2), +.BR setuid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/release/man2/setfsgid.2 b/release/man2/setfsgid.2 new file mode 100644 index 00000000..c2d8af87 --- /dev/null +++ b/release/man2/setfsgid.2 @@ -0,0 +1,118 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created 1995-08-06 Thomas K. Dyas +.\" Modified 2000-07-01 aeb +.\" Modified 2002-07-23 aeb +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Mar 1 00:54:23 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Mon Sep 23 21:21:54 JST 2000 +.\" by HANATAKA Shinya +.\" Modified 2002-09-24 by Akihiro MOTOKI +.\" Modified 2005-02-24, Akihiro MOTOKI +.\" +.\"WORD: identity ID +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: effective group ID ¼Â¸ú¥°¥ë¡¼¥×ID +.\"WORD: real group ID ¼Â¥°¥ë¡¼¥×ID +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: security hole ¥»¥­¥å¥ê¥Æ¥£¡¦¥Û¡¼¥ë +.\"WORD: saved set-group-ID Êݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID +.\" +.TH SETFSGID 2 2008-12-05 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +setfsgid \- ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¥Á¥§¥Ã¥¯¤ËÍѤ¤¤é¤ì¤ë¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +/* glibc ¤Ç¤Ï */ +.sp +.BI "int setfsgid(uid_t " fsgid ); +.SH ÀâÌÀ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR setfsgid () +¤Ï Linux ¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ËÂФ¹¤ë +Á´¤Æ¤Î¥¢¥¯¥»¥¹¤Î¥Á¥§¥Ã¥¯¤Ë»ÈÍѤ¹¤ë¥°¥ë¡¼¥× ID¤òÀßÄꤹ¤ë¡£Ä̾ï¤Ï +.I fsgid +¤ÎÃͤϼ¸ú (effective) ¥°¥ë¡¼¥×ID ¤ÈƱ¤¸¤Ë¤Ê¤ë¡£¼ÂºÝ¡¢ +¼Â¸ú¥°¥ë¡¼¥× ID ¤¬Êѹ¹¤µ¤ì¤ëÅÙ¤Ë +.I fsgid +¤â¤Þ¤¿¿·¤·¤¤¼Â¸ú¥°¥ë¡¼¥×ID ¤ÎÃͤËÊѹ¹¤µ¤ì¤ë¡£ + +Ä̾ +.BR setfsuid () +¤ä +.BR setfsgid () +¤¬ÌÀ¼¨Åª¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¤Î¤Ï¡¢Linux NFS ¥µ¡¼¥Ð¡¼ ¤Î¤è¤¦¤Ë¡¢ +¥Õ¥¡¥¤¥ë¡¦¥¢¥¯¥»¥¹¤ËÍѤ¤¤ë¥æ¡¼¥¶ID / ¥°¥ë¡¼¥×ID ¤òÊѹ¹¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤¬¡¢ +Âбþ¤¹¤ë¼Â(real)/¼Â¸ú(effective) ¥æ¡¼¥¶ID / ¥°¥ë¡¼¥×ID ¤ÏÊѹ¹¤·¤¿¤¯¤Ê¤¤¤è¤¦¤Ê +¥×¥í¥°¥é¥à¤Ë¸Â¤é¤ì¤ë¡£ +NFS ¥µ¡¼¥Ð¡¼¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¡¢Ä̾ï¤Î¥æ¡¼¥¶ID ¤òÊѹ¹¤¹¤ë¤È¡¢ +¥×¥í¥»¥¹¤ò˾¤Þ¤Ê¤¤¥·¥°¥Ê¥ë¤Ë¤µ¤é¤¹²ÄǽÀ­¤¬¤¢¤ê¡¢ +¥»¥­¥å¥ê¥Æ¥£¡¦¥Û¡¼¥ë¤Ë¤Ê¤ë¡£(²¼µ­»²¾È) + +.BR setfsgid () +¤Ï¡¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤«¡¢ +.I fsgid +¤¬¼Â¥°¥ë¡¼¥×ID¡¢¼Â¸ú¥°¥ë¡¼¥×ID¡¢ +Êݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID (saved set-group-ID)¡¢¸½ºß¤Î +.I fsgid +¤ÎÃͤΤ¤¤º¤ì¤«¤Ë°ìÃפ¹¤ë¾ì¹ç¤Ë¤Î¤ßÀ®¸ù¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.I fsgid +¤Î°ÊÁ°¤ÎÃͤòÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï +.I fsgid +¤Î¸½ºß¤ÎÃͤòÊÖ¤¹¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ð¡¼¥¸¥ç¥ó 1.2 °Ê¹ß¤Î Linux ¤Ë¸ºß¤¹¤ë¡£ +.\" This system call is present since Linux 1.1.44 +.\" and in libc since libc 4.7.6. +.SH ½àµò +.BR setfsgid () +¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤¬°ú¤­¿ô¤¬¥°¥ë¡¼¥×ID ¤È¤·¤ÆÉÔÀµ¤À¤ÈȽÃǤ·¤¿¾ì¹ç¤Ï¡¢ +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤ï¤º \fIerrno\fP ¤Ë +.B EINVAL +¤òÀßÄꤷ¤Æ \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.LP +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Æ³Æþ¤µ¤ì¤¿Åö»þ¡¢¥×¥í¥»¥¹¤Ï +Ʊ¤¸¼Â¸ú¥æ¡¼¥¶ID¤Î¥×¥í¥»¥¹¤Ø¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤¿¡£ +º£Æü¤Ç¤Ï¡¢¥·¥°¥Ê¥ëÁ÷¿®¸¢¸Â¤Î°·¤¤¤Ï¤«¤Ê¤ê°ã¤¦¤â¤Î¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +¤¤¤«¤Ê¤ë¼ïÎà¤Î¥¨¥é¡¼¡¦¥á¥Ã¥»¡¼¥¸¤âÊÖ¤µ¤Ê¤¤¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï (¸Æ¤Ó½Ð¤·¸µ¤Ë¤Ï +.B CAP_SETGID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤«¤Ã¤¿¤Î¤À¤«¤é) ºÇÄã¤Ç¤â +.B EPERM +¤¯¤é¤¤¤ÏÊÖ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR setfsuid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/release/man2/setfsuid.2 b/release/man2/setfsuid.2 new file mode 100644 index 00000000..697dfa2b --- /dev/null +++ b/release/man2/setfsuid.2 @@ -0,0 +1,117 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created 1995-08-06 Thomas K. Dyas +.\" Modified 2000-07-01 aeb +.\" Modified 2002-07-23 aeb +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Mar 1 00:55:10 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Mon Sep 23 21:15:17 JST 2000 +.\" by HANATAKA Shinya +.\" Modified 2002-09-24 by Akihiro MOTOKI +.\" Modified 2005-02-24, Akihiro MOTOKI +.\" +.\"WORD: identity ID +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶ID +.\"WORD: real user ID ¼Â¥æ¡¼¥¶ID +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: security hole ¥»¥­¥å¥ê¥Æ¥£¡¦¥Û¡¼¥ë +.\"WORD: saved set-user-ID Êݸ¥»¥Ã¥È¥æ¡¼¥¶ID +.\" +.TH SETFSUID 2 2008-12-05 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +setfsuid \- ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¥Á¥§¥Ã¥¯¤ËÍѤ¤¤é¤ì¤ë¥æ¡¼¥¶ ID ¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +/* glibc ¤Ç¤Ï */ +.sp +.BI "int setfsuid(uid_t " fsuid ); +.SH ÀâÌÀ +.BR setfsuid () +¤Ï Linux ¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ËÂФ¹¤ë +Á´¤Æ¤Î¥¢¥¯¥»¥¹¤Î¥Á¥§¥Ã¥¯¤Ë»ÈÍѤ¹¤ë¥æ¡¼¥¶ID ¤òÀßÄꤹ¤ë¡£Ä̾ï¤Ï +.I fsuid +¤ÎÃͤϼ¸ú (effective) ¥æ¡¼¥¶ID ¤ÈƱ¤¸¤Ë¤Ê¤ë¡£¼ÂºÝ¡¢ +¼Â¸ú¥æ¡¼¥¶ID ¤¬Êѹ¹¤µ¤ì¤ëÅÙ¤Ë +.I fsuid +¤â¤Þ¤¿¿·¤·¤¤¼Â¸ú¥æ¡¼¥¶ID ¤ÎÃͤËÊѹ¹¤µ¤ì¤ë¡£ + +Ä̾ +.BR setfsuid () +¤ä +.BR setfsgid () +¤¬ÌÀ¼¨Åª¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¤Î¤Ï¡¢Linux NFS ¥µ¡¼¥Ð¡¼ ¤Î¤è¤¦¤Ë¡¢ +¥Õ¥¡¥¤¥ë¡¦¥¢¥¯¥»¥¹¤ËÍѤ¤¤ë¥æ¡¼¥¶ID / ¥°¥ë¡¼¥×ID ¤òÊѹ¹¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤¬¡¢ +Âбþ¤¹¤ë¼Â(real)/¼Â¸ú(effective) ¥æ¡¼¥¶ID / ¥°¥ë¡¼¥×ID ¤ÏÊѹ¹¤·¤¿¤¯¤Ê¤¤¤è¤¦¤Ê +¥×¥í¥°¥é¥à¤Ë¸Â¤é¤ì¤ë¡£ +NFS ¥µ¡¼¥Ð¡¼¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¡¢Ä̾ï¤Î¥æ¡¼¥¶ID ¤òÊѹ¹¤¹¤ë¤È¡¢ +¥×¥í¥»¥¹¤ò˾¤Þ¤Ê¤¤¥·¥°¥Ê¥ë¤Ë¤µ¤é¤¹²ÄǽÀ­¤¬¤¢¤ê¡¢ +¥»¥­¥å¥ê¥Æ¥£¡¦¥Û¡¼¥ë¤Ë¤Ê¤ë¡£(²¼µ­»²¾È) + +.BR setfsuid () +¤Ï¡¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤«¡¢ +.I fsuid +¤¬¼Â¥æ¡¼¥¶ID¡¢¼Â¸ú¥æ¡¼¥¶ID¡¢ +Êݸ¥»¥Ã¥È¥æ¡¼¥¶ID (saved set-user-ID)¡¢¸½ºß¤Î +.I fsuid +¤ÎÃͤΤ¤¤º¤ì¤«¤Ë°ìÃפ¹¤ë¾ì¹ç¤Ë¤Î¤ßÀ®¸ù¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.I fsuid +¤Î°ÊÁ°¤ÎÃͤòÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï +.I fsuid +¤Î¸½ºß¤ÎÃͤòÊÖ¤¹¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ð¡¼¥¸¥ç¥ó 1.2 °Ê¹ß¤Î Linux ¤Ë¸ºß¤¹¤ë¡£ +.\" This system call is present since Linux 1.1.44 +.\" and in libc since libc 4.7.6. +.SH ½àµò +.BR setfsuid () +¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤¬°ú¤­¿ô¤¬¥æ¡¼¥¶ID ¤È¤·¤ÆÉÔÀµ¤À¤ÈȽÃǤ·¤¿¾ì¹ç¤Ï¡¢ +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤ï¤º \fIerrno\fP ¤Ë +.B EINVAL +¤òÀßÄꤷ¤Æ \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.LP +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Æ³Æþ¤µ¤ì¤¿Åö»þ¡¢¥×¥í¥»¥¹¤Ï +Ʊ¤¸¼Â¸ú¥æ¡¼¥¶ID¤Î¥×¥í¥»¥¹¤Ø¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤¿¡£ +º£Æü¤Ç¤Ï¡¢¥·¥°¥Ê¥ëÁ÷¿®¸¢¸Â¤Î°·¤¤¤Ï¤«¤Ê¤ê°ã¤¦¤â¤Î¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +¤¤¤«¤Ê¤ë¼ïÎà¤Î¥¨¥é¡¼¡¦¥á¥Ã¥»¡¼¥¸¤â¸Æ¤Ó½Ð¤·¸µ¤ËÊÖ¤µ¤Ê¤¤¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï (¸Æ¤Ó½Ð¤·¸µ¤Ë¤Ï +.B CAP_SETUID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤«¤Ã¤¿¤Î¤À¤«¤é) ºÇÄã¤Ç¤â +.B EPERM +¤¯¤é¤¤¤ÏÊÖ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR setfsgid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/release/man2/setgid.2 b/release/man2/setgid.2 new file mode 100644 index 00000000..5e7398cd --- /dev/null +++ b/release/man2/setgid.2 @@ -0,0 +1,81 @@ +.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.) +.\" +.\" 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. +.\" +.\" Fri Jul 29th 12:56:44 BST 1994 Wilf. +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2002-03-09 by aeb +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Mar 1 16:31:56 JST 1997 +.\" by HANATAKA Shinya +.\" Updated Fri Feb 7 JST 2003 by Kentaro Shirakata +.\" +.\"WORD: identity ¼±ÊÌ +.\"WORD: effective group ID ¼Â¸ú¥°¥ë¡¼¥×ID +.\"WORD: real group ID ¼Â¥°¥ë¡¼¥×ID +.\"WORD: saved set-group-ID Êݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID +.\"WORD: implement ¼ÂÁõ +.\"WORD: superuser ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\" +.TH SETGID 2 2009-10-17 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +setgid \- ¥°¥ë¡¼¥×¼±ÊÌ(identity)¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int setgid(gid_t " gid ); +.SH ÀâÌÀ +.BR setgid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥°¥ë¡¼¥×ID ¤òÀßÄꤹ¤ë¡£ +¤â¤·¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤Ï¡¢ +¼Â (real) ¥°¥ë¡¼¥×ID ¤ÈÊݸ (saved) set-group-ID ¤âÀßÄꤵ¤ì¤ë¡£ + +Linux ¤Ë¤ª¤¤¤Æ¡¢ +.BR setgid () +¤Ï +.B _POSIX_SAVED_IDS +¤ò¤â¤Ã¤¿ POSIX ÈǤΤ褦¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï set-user-ID-root ¤Ç¤Ê¤¤ set-group-ID ¥×¥í¥°¥é¥à¤Ë¤½¤Î¥°¥ë¡¼¥×¤Î +Æø¢¤ÎÁ´¤ÆÍî¤È¤·¡¢Æø¢¤ÎɬÍפʤ¤»Å»ö¤ò¤·¡¢ËÜÍè¤Î¼Â¸ú¥°¥ë¡¼¥×ID ¤Ë +°ÂÁ´¤ÊÊýË¡¤ÇºÆ¤ÓÌ᤹¤³¤È¤òµö¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë¸¢¸Â¤¬¤Ê¤¯ (\fBCAP_SETGID\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¯)¡¢¤«¤Ä +.I gid +¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¥°¥ë¡¼¥×ID ¤ÈÊݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID +¤Î¤É¤Á¤é¤È¤â°ìÃפ·¤Ê¤¤¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR getgid (2), +.BR setegid (2), +.BR setregid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/release/man2/setpgid.2 b/release/man2/setpgid.2 new file mode 100644 index 00000000..0a6b3b33 --- /dev/null +++ b/release/man2/setpgid.2 @@ -0,0 +1,325 @@ +.\" Copyright (c) 1983, 1991 Regents of the University of California. +.\" and Copyright (C) 2007, Michael Kerrisk +.\" 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. +.\" +.\" @(#)getpgrp.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1995-04-15 by Michael Chastain : +.\" Added 'getpgid'. +.\" Modified 1996-07-21 by Andries Brouwer +.\" Modified 1996-11-06 by Eric S. Raymond +.\" Modified 1999-09-02 by Michael Haardt +.\" Modified 2002-01-18 by Michael Kerrisk +.\" Modified 2003-01-20 by Andries Brouwer +.\" 2007-07-25, mtk, fairly substantial rewrites and rearrangements +.\" of text. +.\" +.\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sun Nov 21 18:54:10 JST 1999 +.\" by HANATAKA Shinya +.\" Updated Fri Feb 7 JST 2003 by Kentaro Shirakata +.\" Updated Sun Feb 23 JST 2003 by Kentaro Shirakata +.\" Updated 2007-09-25, Akihiro MOTOKI , LDP v2.64 +.\" Updated 2010-04-23, Akihiro MOTOKI, LDP v3.24 +.\" +.\"WORD: process group ¥×¥í¥»¥¹¥°¥ë¡¼¥× +.\"WORD: process group ID ¥×¥í¥»¥¹¥°¥ë¡¼¥× ID +.\"WORD: terminal üËö +.\"WORD: foreground ¥Õ¥©¥¢¥°¥é¥ó¥É +.\"WORD: block ÃæÃÇ(block) +.\"WORD: job control ¥¸¥ç¥Ö¡¦¥³¥ó¥È¥í¡¼¥ë +.\" +.TH SETPGID 2 2009-09-20 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +setpgid, getpgid, setpgrp, getpgrp \- ¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÀßÄê/¼èÆÀ¤ò¹Ô¤¦ +.SH ½ñ¼° +.B #include +.sp +.BI "int setpgid(pid_t " pid ", pid_t " pgid ); +.br +.BI "pid_t getpgid(pid_t " pid ); +.sp +.BR "pid_t getpgrp(void);" " /* POSIX.1 version */" +.br +.BI "pid_t getpgrp(pid_t " pid ");\ \ \ \ \ \ \ \ \ " +/* BSD version */ +.sp +.BR "int setpgrp(void);" " /* System V version */" +.br +.BI "int setpgrp(pid_t " pid ", pid_t " pgid ); +/* BSD version */ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR getpgid (): +_XOPEN_SOURCE\ >=\ 500 +.br +.BR setpgrp () +(POSIX.1): _SVID_SOURCE || _XOPEN_SOURCE >= 500 +.sp +.BR setpgrp "()\ (BSD)," +.BR getpgrp "()\ (BSD):" +_BSD_SOURCE && !\ (_POSIX_SOURCE || _POSIX_C_SOURCE || +_XOPEN_SOURCE || _XOPEN_SOURCE_EXTENDED || _GNU_SOURCE || _SVID_SOURCE) +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¹¤Ù¤Æ¤¬ Linux ¤ÇÍøÍѲÄǽ¤Ç¡¢ +¤³¤ì¤é¤ò»È¤Ã¤Æ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID (PGID) ¤Î +¼èÆÀ¤äÀßÄ꤬¤Ç¤­¤ë¡£ +¿ä¾©¤Î¡¢POSIX.1 ¤Çµ¬Äꤵ¤ì¤¿ÊýË¡¤Ç¤Ï¡¢ +.BR getpgrp (void) +¤Ç¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î PGID ¤ò¼èÆÀ¤·¡¢ +.BR setpgid () +¤ÇÀßÄꤹ¤ë¡£ + +.BR setpgid () +¤Ï +.I pid +¤Ç»ØÄꤷ¤¿¥×¥í¥»¥¹¤Î PGID ¤Ë +.I pgid +¤òÀßÄꤹ¤ë¡£ +.I pid +¤¬¥¼¥í¤Ê¤é¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤¬ pid ¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +.I pgid +¤¬¥¼¥í¤Ê¤é¤Ð¡¢ +.I pid +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Î PGID ¤¬¤½¤Î¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤È +Ʊ¤¸¤ËÀßÄꤵ¤ì¤ë¡£ +.BR setpgid () +¤ò¥×¥í¥»¥¹¤ò¤¢¤ë¥×¥í¥»¥¹¥°¥ë¡¼¥×¤«¤éÊ̤Υ°¥ë¡¼¥×¤Ø +°ÜÆ°¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¾ì¹ç¤Ï (°ìÉô¤Î¥·¥§¥ë¤Ï¥Ñ¥¤¥×¥é¥¤¥ó¤òÀ¸À® +¤¹¤ë»þ¤Ë¤³¤ì¤ò¹Ô¤¦)¡¢Î¾Êý¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÏƱ¤¸¥»¥Ã¥·¥ç¥ó¤Î +°ìÉô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.RB ( setsid (2) +¤È +.BR credentials (7) +»²¾È)¡£¤³¤Î¾ì¹ç¤Ï \fIpgid\fP ¤Ï»²²Ã¤¹¤Ù¤­´û¸¤Î +¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ò»ØÄꤷ¡¢¤½¤Î¥»¥Ã¥·¥ç¥ó ID ¤Ï»²²Ã¤¹¤ë¥×¥í¥»¥¹¤Î +¥»¥Ã¥·¥ç¥ó ID ¤Ë°ìÃפ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +POSIX.1 ¥Ð¡¼¥¸¥ç¥ó¤Î +.BR getpgrp () +¤Ï°ú¤­¿ô¤ò°ì¤Ä¤â¤È¤é¤º¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î PGID ¤òÊÖ¤¹¡£ + +.BR getpgid () +¤Ï +.I pid +¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Î PGID ¤òÊÖ¤¹¡£ +.I pid +¤¬¥¼¥í¤Ê¤é¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤¬ pid ¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +(¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹°Ê³°¤Î¥×¥í¥»¥¹¤Î PGID ¤Î¼èÆÀ¤¬É¬Íפˤʤ뤳¤È¤Ï +¤á¤Ã¤¿¤Ë¤Ê¤¯¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î PGID ¤ò¼èÆÀ¤¹¤ë¤Ë¤Ï +POSIX.1 ¥Ð¡¼¥¸¥ç¥ó¤Î +.BR getpgrp () +¤ò»È¤¦¤Î¤¬Ë¾¤Þ¤·¤¤¡£) + +System V ¥Ð¡¼¥¸¥ç¥ó¤Î +.BR setpgrp () +¤Ï°ú¤­¿ô¤ò°ì¤Ä¤â¤È¤é¤º¡¢ +.I "setpgid(0,\ 0)" +¤ÈÅù²Á¤Ç¤¢¤ë¡£ + +BSD »ÅÍͤΠ+.BR setpgrp () +¤Ï +.I pid +¤È +.I pgid +¤ò°ú¤­¿ô¤Ë¤È¤ê¡¢ +.I "setpgid(pid, pgid)" +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.\" The true BSD setpgrp() system call differs in allowing the PGID +.\" to be set to arbitrary values, rather than being restricted to +.\" PGIDs in the same session. + +BSD »ÅÍͤΠ+.BR getpgrp () +¤Ï +.I pid +¤À¤±¤ò°ú¤­¿ô¤Ë¤È¤ê¡¢ +.I "getpgid(pid)" +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR setpgid () +¤È +.BR setpgrp () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç¡¢¥¼¥í¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ + +POSIX.1 ¥Ð¡¼¥¸¥ç¥ó¤Î +.BR getpgrp () +¤Ï¾ï¤Ë¸Æ¤Ó½Ð¤·¥×¥í¥»¥¹¤Î PGID ¤òÊÖ¤¹¡£ + +.BR getpgid () +¤È BSD »ÅÍͤΠ+.BR getpgrp () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç¥×¥í¥»¥¹¥°¥ë¡¼¥×¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿¤¬¡¢ +¤¹¤Ç¤Ë¤½¤Î»Ò¥×¥í¥»¥¹¤Ï +.BR execve (2) +¤ò¼Â¹Ô¤·¤Æ¤¤¤¿¡£ +.RB ( setpgid (), +.BR setpgrp ()) +.TP +.B EINVAL +.I pgid +¤¬ 0 ¤è¤ê¾®¤µ¤¤¡£ +.RB ( setpgid (), +.BR setpgrp ()) +.TP +.B EPERM +¥×¥í¥»¥¹¤ò°Û¤Ê¤ë¥»¥Ã¥·¥ç¥ó¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë°ÜÆ°¤µ¤»¤è¤¦¤È¤·¤¿¡£ +¤Þ¤¿¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤òÊѹ¹¤·¤è¤¦¤È +¤·¤¿¤¬¡¢¤½¤Î»Ò¥×¥í¥»¥¹¤ÏÊ̤Υ»¥Ã¥·¥ç¥ó¤À¤Ã¤¿¡£ +¤Þ¤¿¤Ï¥»¥Ã¥·¥ç¥ó¥ê¡¼¥À¡¼¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿¡£ +.RB ( setpgid (), +.BR setpgrp ()) +.TP +.B ESRCH +.BR getpgid () +¤Î¾ì¹ç: +.I pid +¤¬¤É¤Î¥×¥í¥»¥¹¤Ë¤â°ìÃפ·¤Ê¤¤¡£ +.BR setpgid () +¤Î¾ì¹ç: +.I pid +¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ç¤Ï¤Ê¤¯¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Ç¤â¤Ê¤¤¡£ +.SH ½àµò +.BR setpgid () +¤È¡¢°ú¤­¿ô¤Ê¤·¥Ð¡¼¥¸¥ç¥ó¤Î +.BR getpgrp () +¤Ï POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ + +POSIX.1-2001 ¤Ï¡¢ +.BR getpgid () +¤È¡¢°ú¤­¿ô¤Ê¤·¥Ð¡¼¥¸¥ç¥ó¤Î +.BR setpgrp () +¤âµ¬Äꤷ¤Æ¤¤¤ë¡£ +POSIX.1-2008 ¤Ï¡¢¤³¤Î +.BR setpgrp () +¤Î»ÅÍͤòÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ + +°ú¤­¿ô 1 ¸Ä¥Ð¡¼¥¸¥ç¥ó¤Î +.BR getpgrp () +¤È°ú¤­¿ô 2 ¸Ä¥Ð¡¼¥¸¥ç¥ó¤Î +.BR setpgrp () +¤Ï 4.2BSD ¤ËͳÍ褷¡¢ +POSIX.1 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH Ãí°Õ +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Î PGID +¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç PGID ¤ÏÊݸ¤µ¤ì¤ë¡£ + +³Æ¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ï¥»¥Ã¥·¥ç¥ó¤Î¥á¥ó¥Ð¡¼¤Ç¤¢¤ê¡¢³Æ¥×¥í¥»¥¹¤Ï +¤½¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤¬½ê°¤·¤Æ¤¤¤ë¥»¥Ã¥·¥ç¥ó¤Î¥á¥ó¥Ð¡¼¤Ç¤¢¤ë¡£ + +¥»¥Ã¥·¥ç¥ó¤ÏÀ©¸æüËö (controlling terminal) ¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +¤¤¤Ä¤Ç¤â¡¢¥»¥Ã¥·¥ç¥ó¤Ë½ê°¤¹¤ë¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î°ì¤Ä (¤À¤±) ¤¬ +üËö¤Î¥Õ¥©¥¢¥°¥é¥ó¥É¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë¤Ê¤ë¤³¤È¤¬¤Ç¤­¡¢ +»Ä¤ê¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ï¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤Ë¤Ê¤ë¡£ +üËö¤«¤é¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤¿¾ì¹ç (Î㤨¤Ð¡¢ÃæÃÇ¥­¡¼¤òᤤ¤Æ +.B SIGINT +¤¬À¸À®¤µ¤ì¤ë¤Ê¤É)¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× +¤ËÁ÷¤é¤ì¤ë +(¥·¥°¥Ê¥ë¤òÀ¸À®¤¹¤ëʸ»ú¤ÎÀâÌÀ¤Ï +.BR termios (3) +¤ò»²¾È)¡£ +¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤À¤±¤¬Ã¼Ëö¤«¤é¤Î +.BR read (2) +¤¬¤Ç¤­¤ë¡£ +¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤¬Ã¼Ëö¤«¤é¤Î +.BR read (2) +¤ò¹Ô¤ª¤¦¤È¤·¤¿¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë¤Ï¥·¥°¥Ê¥ë +.B SIGTSTP +¤¬Á÷¤é¤ì¡¢¤½¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ï°ì»þÄä»ß (suspend) ¤¹¤ë¡£ +´Ø¿ô +.BR tcgetpgrp (3) +¤È +.BR tcsetpgrp (3) +¤ò»È¤¦¤È¡¢À©¸æüËö¤Î¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ò +¼èÆÀ/ÀßÄê¤Ç¤­¤ë¡£ + +.BR setpgid () +¤È +.BR getpgrp () +¤Ï¡¢ +.BR bash (1) +¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¡¢¥·¥§¥ë¤Î¥¸¥ç¥ÖÀ©¸æ (job control) ¤Î¼ÂÁõ¤Î¤¿¤á¤Î +¥×¥í¥»¥¹¥°¥ë¡¼¥×¤òºîÀ®¤¹¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£ + +¥»¥Ã¥·¥ç¥ó¤¬À©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤Æ¡¢¤½¤ÎüËö¤ËÂФ·¤Æ +.B CLOCAL +¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤ª¤é¤º¡¢Ã¼Ëö¤Î¥Ï¥ó¥°¥¢¥Ã¥×¤¬µ¯¤­¤¿¾ì¹ç¡¢ +¥»¥Ã¥·¥ç¥ó¡¦¥ê¡¼¥À¡¼¤Ë +.B SIGHUP +¤¬Á÷¤é¤ì¤ë¡£ +¥»¥Ã¥·¥ç¥ó¡¦¥ê¡¼¥À¡¼¤¬½ªÎ»¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÀ©¸æüËö¤Î +¥Õ¥©¥¢¥°¥é¥ó¥É¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë½ê°¤¹¤ë³Æ¥×¥í¥»¥¹¤Ë¤â +.B SIGHUP +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ + +¥×¥í¥»¥¹¤Î½ªÎ»¤Ë¤è¤Ã¤Æ¥×¥í¥»¥¹¥°¥ë¡¼¥×¤¬¸É»ù (orphaned) ¤Ë¤Ê¤Ã¤¿ºÝ¤Ë¡¢ +¤½¤Î¿·¤¿¤Ë¸É»ù¤Ë¤Ê¤Ã¤¿¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ËÄä»ß¤·¤Æ¤¤¤ë¥á¥ó¥Ð¡¼¤¬¤¤¤ì¤Ð¡¢ +¤½¤Î¸É»ù¤Ë¤Ê¤Ã¤¿¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë°¤¹Á´¤Æ¤Î¥×¥í¥»¥¹¤Ë +.B SIGHUP +¥·¥°¥Ê¥ë¤Ë³¤±¤Æ +.B SIGCONT +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +.\" exit.3 refers to the following text: +¸É»ù¤Ë¤Ê¤Ã¤¿ (orphaned) ¥×¥í¥»¥¹¥°¥ë¡¼¥×¤È¤Ï¡¢ +¤½¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¤Æ¤Î¥á¥ó¥Ð¡¼¤Ë¤Ä¤¤¤Æ¡¢¥á¥ó¥Ð¡¼¤Î¿Æ¥×¥í¥»¥¹¤¬¡¢ +¿Æ¥×¥í¥»¥¹¼«¿È¤â¤½¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤«¡¢ +Ê̤Υ»¥Ã¥·¥ç¥ó¤Ë°¤¹¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¤è¤¦¤Ê¡¢ +¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î¤³¤È¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getuid (2), +.BR setsid (2), +.BR tcgetpgrp (3), +.BR tcsetpgrp (3), +.BR termios (3), +.BR credentials (7) diff --git a/release/man2/setresuid.2 b/release/man2/setresuid.2 new file mode 100644 index 00000000..0c5c2174 --- /dev/null +++ b/release/man2/setresuid.2 @@ -0,0 +1,114 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1997 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. +.\" +.\" Modified, 2003-05-26, Michael Kerrisk, +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-08-30, HANATAKA Shinya +.\" Updated & Modified 2004-05-22, Yuichi SATO +.\" Updated & Modified 2005-01-04, Yuichi SATO +.\" Updated & Modified 2005-09-03, Akihiro MOTOKI +.\" Updated & Modified 2005-11-04, Akihiro MOTOKI +.\" +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: real user ID ¼Â¥æ¡¼¥¶¡¼ID +.\"WORD: saved set-user-ID Êݸ¥»¥Ã¥È¥æ¡¼¥¶¡¼ID +.\"WORD: effective group ID ¼Â¸ú¥°¥ë¡¼¥×ID +.\"WORD: real group ID ¼Â¥°¥ë¡¼¥×ID +.\"WORD: saved group ID Êݸ¥°¥ë¡¼¥×ID +.\" +.TH SETRESUID 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +setresuid, setresgid \- ¥æ¡¼¥¶¤ä¥°¥ë¡¼¥×¤Î ¼Â¡¢¼Â¸ú¡¢Êݸ ID ¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int setresuid(uid_t " ruid ", uid_t " euid ", uid_t " suid ); +.br +.BI "int setresgid(gid_t " rgid ", gid_t " egid ", gid_t " sgid ); +.SH ÀâÌÀ +.BR setresuid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â (real) ¥æ¡¼¥¶¡¼ID¡¢¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ID¡¢ +Êݸ set-user-ID ¤òÀßÄꤹ¤ë¡£ + +ÈóÆø¢¥æ¡¼¥¶¡¼¤Î¥×¥í¥»¥¹¤Ï¡¢¤½¤Î¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤ò¡¢ +¸½ºß¤Î¼Â UID¡¢¸½ºß¤Î¼Â¸ú UID¡¢¸½ºß¤ÎÊݸ set-user-ID +¤Î¤É¤ì¤«¤ËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë: + +Æø¢¥×¥í¥»¥¹ (Linux ¤Ç¤Ï \fBCAP_SETUID\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ä +¥×¥í¥»¥¹) ¤Ï¡¢¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤òǤ°Õ¤ÎÃͤËÀßÄê¤Ç¤­¤ë¡£ + +°ú¤­¿ô¤Î¤É¤ì¤«¤¬ \-1 ¤Î¾ì¹ç¤Ï¤½¤ÎÃͤÏÊѹ¹¤µ¤ì¤º¤Ë»Ä¤µ¤ì¤ë¡£ + +¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤Ë¤É¤ó¤ÊÊѹ¹¤¬¹Ô¤ï¤ì¤¿¤«¤Ë´Ø¤ï¤é¤º¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤Ï¾ï¤Ë¼Â¸ú UID (²Äǽ¤Ç¤¢¤ì¤ÐÊѹ¹¸å¤Î¿·¤·¤¤¼Â¸ú UID) +¤ÈƱ¤¸ÃͤËÀßÄꤵ¤ì¤ë¡£ + +Á´¤¯Æ±¤¸¤è¤¦¤Ë¡¢ +.BR setresgid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â GID¡¢¼Â¸ú GID¡¢Êݸ set-group-ID ¤òÀßÄꤹ¤ë +(¤µ¤é¤Ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à GID ¤ò¼Â¸ú GID ¤ÈƱ¤¸Ãͤ˽¤Àµ¤¹¤ë)¡£ +ÈóÆø¢¥×¥í¥»¥¹¤ÏƱÍͤÎÀ©¸Â¤ò¼õ¤±¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.I uid +¤¬¸½ºß¤Î¥æ¡¼¥¶¡¼ ID ¤È°ã¤¦Ãͤǡ¢ +¤³¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ê ¥æ¡¼¥¶¡¼ ID ¤¬ +¥ê¥½¡¼¥¹¾å¸Â +.B RLIMIT_NPROC +¤òĶ¤¨¤Æ¤·¤Þ¤¦¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬Æø¢¤ò»ý¤¿¤Ê¤¤¤Î¤Ë +(\fBCAP_SETUID\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤¤Î¤Ë)¡¢ +ID ¤òµö¤µ¤ì¤Æ¤¤¤Ê¤¤ÃͤËÊѹ¹¤·¤è¤¦¤È¤·¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +Linux ¤Ç¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1.44 ¤è¤êÍøÍѲÄǽ¤Ë¤Ê¤Ã¤¿¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥³¡¼¥ë¤ÏÈóɸ½à¤Ç¤¢¤ë¡£ +HP-UX ¤ä BSD ·Ï¤Î¤¤¤¯¤Ä¤«¤Ë¤â¸ºß¤¹¤ë¡£ +.SH Ãí°Õ +HP-UX ¤ä FreeBSD ¤Ç¤Ï +.I +¤Ë¥×¥í¥È¥¿¥¤¥×¤¬Â¸ºß¤¹¤ë¡£ +Linux ¤Ç¤Ï¡¢glibc 2.3.2 °Ê¹ß¤Ç +¥×¥í¥È¥¿¥¤¥×¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getresuid (2), +.BR getuid (2), +.BR setfsgid (2), +.BR setfsuid (2), +.BR setreuid (2), +.BR setuid (2), +.BR capabilities (7), +.BR credentials (7), +.BR feature_test_macros (7) diff --git a/release/man2/setreuid.2 b/release/man2/setreuid.2 new file mode 100644 index 00000000..071da6cb --- /dev/null +++ b/release/man2/setreuid.2 @@ -0,0 +1,155 @@ +.\" 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. +.\" +.\" @(#)setregid.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 09:08:49 1993 by Rik Faith +.\" Portions extracted from linux/kernel/sys.c: +.\" Copyright (C) 1991, 1992 Linus Torvalds +.\" May be distributed under the GNU General Public License +.\" Changes: 1994-07-29 by Wilf +.\" 1994-08-02 by Wilf due to change in kernel. +.\" 2004-07-04 by aeb +.\" 2004-05-27 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Fri Dec 12 00:18:45 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Mon Jun 4 19:11:44 JST 2001 +.\" by Yuichi SATO +.\" Updated & Modified Wed Jan 5 00:37:49 JST 2005 +.\" by Yuichi SATO +.\" Updated 2010-04-23, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: real user ID ¼Â¥æ¡¼¥¶¡¼ID +.\"WORD: saved user ID Êݸ¥æ¡¼¥¶¡¼ID +.\"WORD: super-user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\" +.TH SETREUID 2 2009-10-17 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +setreuid, setregid \- ¼Â (real) ¤È¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int setreuid(uid_t " ruid ", uid_t " euid ); +.br +.BI "int setregid(gid_t " rgid ", gid_t " egid ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR setreuid (), +.BR setregid (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.BR setreuid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â (real) ¥æ¡¼¥¶¡¼ ID ¤È +¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ ID ¤òÀßÄꤹ¤ë¡£ + +¼Â¥æ¡¼¥¶¡¼ ID ¤ä¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤Ë \-1 ¤òÍ¿¤¨¤¿¾ì¹ç¡¢ +¥·¥¹¥Æ¥à¤Ï¤½¤Î ID ¤òÊѹ¹¤·¤Ê¤¤¡£ + +ÈóÆø¢¥×¥í¥»¥¹¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ò¼Â¥æ¡¼¥¶¡¼ ID ¤Þ¤¿¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤Þ¤¿¤Ï +Êݸ set-user-ID ¤Ë¤·¤«ÀßÄê¤Ç¤­¤Ê¤¤¡£ + +ÈóÆø¢¥æ¡¼¥¶¡¼¤Ï¡¢¼Â¥æ¡¼¥¶¡¼ ID ¤ò¼Â¥æ¡¼¥¶¡¼ ID ¤Þ¤¿¤Ï +¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤Ë¤·¤«ÀßÄê¤Ç¤­¤Ê¤¤¡£ + +¼Â¥æ¡¼¥¶¡¼ID ¤¬ÀßÄꤵ¤ì¤¿¤ê¡¢¼Â¸ú¥æ¡¼¥¶¡¼ID ¤¬Á°¤Î¼Â¥æ¡¼¥¶¡¼ID ¤È +°Û¤Ã¤¿ÃͤËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢Êݸ set-user-ID ¤Ë¤Ï¿·¤·¤¤¼Â¸ú¥æ¡¼¥¶¡¼ID +¤ÎÃͤ¬ÀßÄꤵ¤ì¤ë¡£ + +¤³¤ì¤ÈÁ´¤¯Æ±Íͤˡ¢ +.BR setregid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¥°¥ë¡¼¥× ID ¤È¼Â¸ú¥°¥ë¡¼¥× ID ¤òÀßÄꤷ¡¢ +¾åµ­¤ÎÀâÌÀ¤Ç¡Ö¥æ¡¼¥¶¡¼¡×¤ò¡Ö¥°¥ë¡¼¥×¡×¤ËÆɤßÂؤ¨¤¿¤³¤È¤¬À®¤êΩ¤Ä¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¯ +(Linux ¤Ç¤Ï +.BR setreuid () +¤Î¾ì¹ç¤Ë +.B CAP_SETUID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¤Ê¤¯¡¢ +.BR setregid () +¤Î¾ì¹ç¤Ë +.B CAP_SETGID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¤)¡¢ +°Ê²¼¤Î¤¤¤º¤ì¤Ç¤â¤Ê¤¤Êѹ¹¤¬»ØÄꤵ¤ì¤¿: +(i) ¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤È¼Â¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤òÆþ¤ì´¹¤¨¤ë¡£ +(ii) ÊÒÊý¤ÎÃͤò¾Êý¤ËÀßÄꤹ¤ë¡£ +(iii) ¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤ËÊݸ set-user-ID (Êݸ set-group-ID) +¤ÎÃͤòÀßÄꤹ¤ë¡£ +.SH ½àµò +POSIX.1-2001, 4.3BSD +.RB ( setreuid () +¤È +.BR setregid () +´Ø¿ô¥³¡¼¥ë¤Ï 4.2BSD ¤ÇÅо줷¤¿)¡£ +.SH Ãí°Õ +¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤òÊݸ¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤Ë +ÀßÄꤹ¤ë¤³¤È¤¬¡¢Linux 1.1.37 (1.1.38) ¤«¤é²Äǽ¤Ë¤Ê¤Ã¤¿¡£ + +POSIX.1 ¤Ç¤Ï¡¢ÈóÆø¢¥×¥í¥»¥¹¤ËÂФ·¤Æ Linux ¾å¤Çǧ¤á¤é¤ì¤Æ¤¤¤ë ID ¤ÎÊѹ¹¤Î +Á´¥Ñ¥¿¡¼¥ó¤òµ¬Äꤷ¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.BR setreuid () +¤Ç¤Ï¡¢¼Â¸ú¥æ¡¼¥¶ ID ¤ò¼Â¥æ¡¼¥¶ ID ¤â¤·¤¯¤ÏÊݸ set-user-ID ¤È +Ʊ¤¸Ãͤˤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤¬¡¢ +ÈóÆø¢¥×¥í¥»¥¹¤¬¼Â¥æ¡¼¥¶ ID ¤ò¼Â¥æ¡¼¥¶ ID¡¢¼Â¸ú¥æ¡¼¥¶ ID¡¢ +Êݸ set-user-ID ¤Î¤É¤ÎÃͤˤâÀßÄê¤Ç¤­¤ë¤«¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.BR setregid () +¤Ç¤Ï¡¢¼Â¥°¥ë¡¼¥× ID ¤òÊݸ set-group-ID ¤ÈƱ¤¸ÃͤËÊѹ¹¤Ç¤­¡¢ +¼Â¸ú¥°¥ë¡¼¥× ID ¤ò¼Â¥°¥ë¡¼¥× ID ¤äÊݸ set-group-ID ¤ÈƱ¤¸ÃͤËÊѹ¹¤Ç¤­¤ë¡£ +¤É¤Î¤è¤¦¤Ê ID ¤ÎÊѹ¹¤¬Ç§¤á¤é¤ì¤Æ¤¤¤ë¤«¤ÎÀµ³Î¤Ê¾ÜºÙ¤Ï +¼ÂÁõ¤´¤È¤Ë°Û¤Ê¤ë¡£ + +POSIX.1 ¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Êݸ set-user-ID ¤ä +Êݸ set-group-ID ¤ËÍ¿¤¨¤ë±Æ¶Á¤Ë¤Ä¤¤¤Æ¤Ïµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getgid (2), +.BR getuid (2), +.BR seteuid (2), +.BR setgid (2), +.BR setresuid (2), +.BR setuid (2), +.BR capabilities (7) diff --git a/release/man2/setsid.2 b/release/man2/setsid.2 new file mode 100644 index 00000000..ec319d2b --- /dev/null +++ b/release/man2/setsid.2 @@ -0,0 +1,99 @@ +.\" Copyright Michael Haardt (michael@cantor.informatik.rwth-aachen.de) +.\" Sat Aug 27 20:43:50 MET DST 1994 +.\" +.\" 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 Sun Sep 11 19:19:05 1994 +.\" Modified Mon Mar 25 10:19:00 1996 (merged a few +.\" tiny changes from a man page by Charles Livingston). +.\" Modified Sun Jul 21 14:45:46 1996 +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Mar 1 16:46:43 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Mon May 5 19:43:49 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Thu Feb 10 22:45:24 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: session ¥»¥Ã¥·¥ç¥ó +.\"WORD: process group ID ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×ID +.\"WORD: process group leader ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼ +.\" +.TH SETSID 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +setsid \- ¥»¥Ã¥·¥ç¥ó (session) ¤òºîÀ®¤·¡¢¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.ad l +.B #include +.sp +.B pid_t setsid(void); +.br +.ad b +.SH ÀâÌÀ +.BR setsid () +¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼ +(process group leader) ¤Ç¤Ê¤±¤ì¤Ð¡¢¿·¤·¤¤¥»¥Ã¥·¥ç¥ó¤òºîÀ®¤¹¤ë¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¿·¤·¤¤¥»¥Ã¥·¥ç¥ó¤Î¥ê¡¼¥À¡¼¡¢¿·¤·¤¤¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Î +¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼¤È¤Ê¤ê¡¢tty ¤ÎÀ©¸æ¤ò»ý¤¿¤Ê¤¤¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× ID ¤È¥»¥Ã¥·¥ç¥ó ID ¤Ë¤Ï¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î PID ¤¬ÀßÄꤵ¤ì¤ë¡£¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¤³¤Î +¿·¤·¤¤¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¢¤³¤Î¿·¤·¤¤¥»¥Ã¥·¥ç¥ó¤ÎÍ£°ì¤Î¥×¥í¥»¥¹¤È¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î (¿·¤·¤¤) ¥»¥Ã¥·¥ç¥ó ID ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢ +.I "(pid_t)\ \-1" +¤¬ÊÖ¤µ¤ì¡¢ +.I error +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EPERM +¤¤¤º¤ì¤«¤Î¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× ID ¤¬¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î PID ¤ÈÅù¤·¤¤¡£ +¤³¤ì¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬´û¤Ë¥×¥í¥»¥¹¡¦¥ê¡¼¥À¡¼¤Î¾ì¹ç¤Ë¤Ï +.BR setsid () +¤Ï¼ºÇÔ¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.SH Ãí°Õ +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¥»¥Ã¥·¥ç¥ó ID ¤ÏÊݸ¤µ¤ì¤ë¡£ + +¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼¤È¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× ID ¤¬ +¤½¤Î PID ¤ËÅù¤·¤¤¥×¥í¥»¥¹¤Ç¤¢¤ë¡£ +.BR setsid () +¤ò³Î¼Â¤ËÀ®¸ù¤µ¤»¤ë¤¿¤á¤Ë¤Ï¡¢ +.BR fork (2) +¤·¤Æ +.BR exit (2) +¤·¡¢»Ò¥×¥í¥»¥¹¤Ç +.BR setsid () +¤ò¹Ô¤Ê¤¨¤ÐÎɤ¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getsid (2), +.BR setpgid (2), +.BR setpgrp (2), +.BR tcgetsid (3), +.BR credentials (7) diff --git a/release/man2/setuid.2 b/release/man2/setuid.2 new file mode 100644 index 00000000..8c90da5d --- /dev/null +++ b/release/man2/setuid.2 @@ -0,0 +1,133 @@ +.\" Copyright (C), 1994, Graeme W. Wilford (Wilf). +.\" +.\" 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. +.\" +.\" Fri Jul 29th 12:56:44 BST 1994 Wilf. +.\" Changes inspired by patch from Richard Kettlewell +.\" , aeb 970616. +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sat Mar 1 16:32:11 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Sun Sep 28 20:26:49 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Sat May 22 18:21:45 JST 2004 +.\" by Yuichi SATO +.\" Updated & Modified Wed Jan 5 00:51:28 JST 2005 by Yuichi SATO +.\" Updated 2010-04-10, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: identity ¼±ÊÌ +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: real user ID ¼Â¥æ¡¼¥¶¡¼ID +.\"WORD: saved user ID Êݸ¥æ¡¼¥¶¡¼ID +.\"WORD: implement ¼ÂÁõ +.\"WORD: root ¥ë¡¼¥È +.\"WORD: super-user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼ +.\" +.TH SETUID 2 2010-02-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +setuid \- ¥æ¡¼¥¶¡¼¼±ÊÌ (identity) ¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int setuid(uid_t " uid ); +.SH ÀâÌÀ +.BR setuid () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ ID ¤òÀßÄꤹ¤ë¡£ +¤â¤·¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤¬ root ¤Ê¤é¤Ð¡¢ +¼Â (real) UID ¤ÈÊݸ (saved) set-user-ID ¤âÀßÄꤵ¤ì¤ë¡£ +.PP +Linux ¤Ç¤Ï¡¢ +.BR setuid () +¤Ï +.B _POSIX_SAVED_IDS +¤ò¤â¤Ã¤¿ POSIX ÈǤΤ褦¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï (¥ë¡¼¥È°Ê³°¤Î) set-user-ID ¥×¥í¥°¥é¥à¤Ë¤½¤Î¥æ¡¼¥¶¡¼¤ÎÆø¢¤ò +Á´¤ÆÍ¿¤¨¡¢Æø¢¤ÎɬÍפʤ¤»Å»ö¤ò¤·¡¢ËÜÍè¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤Ë +°ÂÁ´¤ÊÊýË¡¤ÇºÆ¤ÓÌ᤹¤³¤È¤òµö¤¹¡£ +.PP +¥æ¡¼¥¶¡¼¤¬ root ¤Þ¤¿¤Ï¥×¥í¥°¥é¥à¤¬ root ¤Ë set-user-ID ¤µ¤ì¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢ +ÆÃÊ̤ÎÃí°Õ¤¬Ê§¤ï¤ì¤ë¡£ +.BR setuid () +´Ø¿ô¤Ï¸Æ¤Ó½Ð¤·¼Ô¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ò¥Á¥§¥Ã¥¯¤·¡¢ +¤½¤ì¤¬¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ê¤é¤Ð¡¢ +¥×¥í¥»¥¹¤Ë´ØÏ¢¤¹¤ëÁ´¤Æ¤Î¥æ¡¼¥¶¡¼ ID ¤Ë +.I uid +¤òÀßÄꤹ¤ë¡£ +¤³¤ì¤¬¹Ô¤Ê¤ï¤ì¤¿¸å¤Ë¤Ï¥×¥í¥°¥é¥à¤¬ºÆ¤Ó¥ë¡¼¥È¤ÎÆø¢¤òÆÀ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.PP +¤·¤¿¤¬¤Ã¤Æ¡¢set-user-ID-root ¥×¥í¥°¥é¥à¤Ç¡¢°ì»þŪ¤Ë¥ë¡¼¥ÈÆø¢¤ò²ò½ü¤·¡¢ +ÈóÆø¢¥æ¡¼¥¶¤Ç¤¢¤ë¤«¤Î¤è¤¦¤Ë¿¶Éñ¤¤¡¢¸å¤Ç¥ë¡¼¥È¸¢¸Â¤ò¤â¤¦°ìÅÙÆÀ¤è¤¦¤È +¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR setuid () +¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£¤½¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR seteuid (2) +¤ò»È¤¦É¬Íפ¬¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.I uid +¤¬¸½ºß¤Î¥æ¡¼¥¶¡¼ ID ¤È¥Þ¥Ã¥Á¤»¤º¡¢¤³¤Î +.I uid +¤Ë¤è¤Ã¤Æ¥×¥í¥»¥¹¤¬¥ê¥½¡¼¥¹¾å¸Â +.B RLIMIT_NPROC +¤òĶ¤¨¤¿¡£ +.TP +.B EPERM +¥æ¡¼¥¶¡¼¤¬Æø¢¤ò»ý¤¿¤º +(Linux ¤Ç¤Ï +.B CAP_SETUID +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤¿¤º)¡¢ +.I uid +¤¬¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â UID ¤Þ¤¿¤ÏÊݸ set-user-ID ¤È°ìÃפ·¤Ê¤¤¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +4.4BSD ¤Î¥³¡¼¥ë¤È¤Ï´°Á´¤Ê¸ß´¹À­¤Ï¤Ê¤¤¡¢ +BSD ¤Î¥³¡¼¥ë¤Ï¼Â (real)¡¢Êݸ (saved)¡¢¼Â¸ú (effective) ID ¤ÎÁ´¤Æ¤òÀßÄꤹ¤ë¡£ +.\" SVr4 ¤Ë¤Ï¾¤Ë EINVAL ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.SH Ãí°Õ +.SS Linux ¤Ç¤ÎÃí°Õ +Linux ¤Ï¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¡¦¥æ¡¼¥¶¡¼ ID ¤Î³µÇ°¤ò»ý¤Ä¡£ +Ä̾¤³¤ì¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ËÅù¤·¤¤¡£ +.BR setuid () +¥³¡¼¥ë¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¡¦¥æ¡¼¥¶¡¼ ID ¤âÀßÄꤹ¤ë¡£ +.BR setfsuid (2) +¤â»²¾È¤¹¤ë¤³¤È¡£ +.PP +.I uid +¤¬ÀΤμ¸ú uid ¤È°Û¤Ã¤Æ¤¤¤¿¾ì¹ç¡¢¥×¥í¥»¥¹¤Ï¥³¥¢¡¦¥À¥ó¥×¤¹¤ë¤³¤È¤ò +¶Ø»ß¤µ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getuid (2), +.BR seteuid (2), +.BR setfsuid (2), +.BR setreuid (2), +.BR capabilities (7), +.BR credentials (7) diff --git a/release/man2/setup.2 b/release/man2/setup.2 new file mode 100644 index 00000000..4c8f271a --- /dev/null +++ b/release/man2/setup.2 @@ -0,0 +1,91 @@ +.\" 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 Sun Jul 25 10:14:13 1993 by Rik Faith +.\" Modified 15 April 1995 by Michael Chastain +.\" Update calling parameters to Linux 1.2.4 values. +.\" Modified 10 June 1995 by Andries Brouwer +.\" Modified 3 May 1996 by Martin Schulze +.\" 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 ¥æ¡¼¥¶¡¼¥×¥í¥»¥¹ +.\" +.TH SETUP 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +setup \- ¥Ç¥Ð¥¤¥¹¤È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î½é´ü²½¤ò¹Ô¤¤¡¢ +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¤ò¹Ô¤¦ +.SH ½ñ¼° +.B #include +.sp +.B int setup(void); +.SH ÀâÌÀ +.BR setup () +¤Ï +.I linux/init/main.c +¤ÎÃæ¤Ç°ìÅÙ¤À¤±¸Æ¤Ð¤ì¤ë¡£ +¥«¡¼¥Í¥ëÆâÉô¤Î¥Ç¥Ð¥¤¥¹¤È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î½é´ü²½´Ø¿ô¤ò¸Æ¤Ó¡¢ +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¤ò¹Ô¤¦¡£ +.PP +¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤«¤é¤Ï +.BR setup () +¤ò¸Æ¤Ó¤À¤¹¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤«¤é¤Î¥¢¥¯¥»¥¹¤Ï¡¢¤¿¤È¤¨¤½¤Î¥×¥í¥»¥¹¤¬ +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Æ¤â +.B EPERM +¤ò¼õ¤±¼è¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR setup () +¤Ï¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤ËÂФ·¤Æ¾ï¤Ë \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EPERM +¥æ¡¼¥¶¥×¥í¥»¥¹¤ËÂФ·¤Æ¤Ï¡¢¾ï¤Ë¤³¤Î¥¨¥é¡¼¤È¤Ê¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +Linux 2.1.121 °Ê¹ß¤Ç¤Ï¡¢¤â¤Ï¤ä¤³¤Î´Ø¿ô¤Ï¸ºß¤·¤Ê¤¤¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï Linux ¤ËÆÃÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +ÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£¤½¤ì¤É¤³¤í¤«¡¢¤¢¤é¤æ¤ë¥×¥í¥°¥é¥à¤ÇÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +¸Æ¤Ó½Ð¤·¼ê³¤­¤ÏÊѲ½¤·¤Æ¤­¤¿¡£ +¤¢¤ë»þ¤Ï +.I setup () +¤Ï°ì¤Ä¤Î°ú¿ô +.I "void *BIOS" +¤ò¼è¤Ã¤Æ¤ª¤ê¡¢¤Þ¤¿¤¢¤ë»þ¤Ë¤Ï +.IR "int magic" +¤ò°ì¤Ä¤Î°ú¿ô¤È¤·¤Æ¼è¤Ã¤Æ¤¤¤¿¡£ diff --git a/release/man2/setxattr.2 b/release/man2/setxattr.2 new file mode 100644 index 00000000..9e862ef7 --- /dev/null +++ b/release/man2/setxattr.2 @@ -0,0 +1,175 @@ +.\" +.\" Extended attributes system calls manual pages +.\" +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" 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) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 04:43:40 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: extended attributes ³Èĥ°À­ +.\"WORD: namespace ̾Á°¶õ´Ö +.\" +.TH SETXATTR 2 2001-12-31 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +setxattr, lsetxattr, fsetxattr \- ³Èĥ°À­¤ÎÃͤòÀßÄꤹ¤ë +.SH ½ñ¼° +.fam C +.nf +.B #include +.B #include +.sp +.BI "int setxattr(const char\ *" path ", const char\ *" name , +.BI " const void\ *" value ", size_t " size ", int " flags ); +.BI "int lsetxattr(const char\ *" path ", const char\ *" name , +.BI " const void\ *" value ", size_t " size ", int " flags ); +.BI "int fsetxattr(int " fd ", const char\ *" name , +.BI " const void\ *" value ", size_t " size ", int " flags ); +.fi +.fam T +.SH ÀâÌÀ +³Èĥ°À­¤Ï¡¢inode (¥Õ¥¡¥¤¥ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯Åù) ¤Ë +´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +.IR name :\c +.I value +¤ÎÂФǤ¢¤ë¡£ +¤³¤ì¤é¤Ï¡¢¥·¥¹¥Æ¥à¾å¤Î¤¹¤Ù¤Æ¤Î inode ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ä̾ï¤Î°À­ +.RB ( stat (2) +¤¬ÊÖ¤¹¥Ç¡¼¥¿) ¤ò³ÈÄ¥¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +³Èĥ°À­¤Î¥³¥ó¥»¥×¥È¤Ï +.BR attr (5) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +.BR setxattr () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î»ØÄꤵ¤ì¤¿ +.I path +¤ËÂбþ¤¹¤ë¡¢Ì¾Á° +.I name +¤Î³Èĥ°À­¤ÎÃÍ +.I value +¤òÀßÄꤹ¤ë¡£ +.I value +¤Î +.I size +¤Ïɬ¤º»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.BR lsetxattr () +¤Ï +.BR setxattr () +¤ÈƱ¤¸¤À¤¬¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¡¢¥ê¥ó¥¯¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë +¤Ç¤Ï¤Ê¤¯¡¢¥ê¥ó¥¯¤½¤Î¤â¤Î¤Î³Èĥ°À­¤òÀßÄꤹ¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +.PP +.BR fsetxattr () +¤Ï +.BR setxattr () +¤ÈƱ¤¸¤À¤¬¡¢ +.I path +¤ÎÂå¤ï¤ê¤Ë +.I fd +¤Ç»²¾È¤µ¤ì¤¿¥ª¡¼¥×¥óºÑ¤ß¥Õ¥¡¥¤¥ë¤Î¾ðÊó¤À¤±¤òÀßÄꤹ¤ëÅÀ¤¬°Û¤Ê¤ë +.RI ( filedes +¤Ï +.BR open (2) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë)¡£ +.PP +³Èĥ°À­¤Î̾Á° +¤ÏÉáÄ̤ΠNULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +.I name +¤Ë¤Ï¡¢Ì¾Á°¶õ´Ö¤òɽ¤¹ÀÜƬ¼­ (prefix) ¤¬´Þ¤Þ¤ì¤ë¡£ +¸Ä¡¹¤Î inode ¤ËÂФ·¤Æ¡¢¸ß¤¤¤ËÆÈΩ¤Ê̾Á°¶õ´Ö¤¬Ê£¿ô¤¢¤Ã¤Æ¤â¤è¤¤¡£ +³Èĥ°À­¤ÎÃÍ +.I value +¤Ï¡¢¤¢¤ë°ìÄê¤ÎŤµ¤ÎǤ°Õ¤Î¥Æ¥­¥¹¥È¡¦¥Ç¡¼¥¿¤Þ¤¿¤Ï +¥Ð¥¤¥Ê¥ê¡¦¥Ç¡¼¥¿¤Î½¸¹ç¤Ç¤¢¤ë¡£ +.PP +Áàºî¤Î°ÕÌ£¤òÌÀ³Î¤Ë¤¹¤ë¤¿¤á¤Ë +.I flags +°ú¤­¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.B XATTR_CREATE +¤Ï°À­¤ÎºîÀ®¤À¤±¤ò¹Ô¤¦¤³¤È¤ò»ØÄꤹ¤ë¡£ +»ØÄꤵ¤ì¤¿Ì¾Á°¤Î°À­¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ï¼ºÇÔ¤¹¤ë¡£ +.B XATTR_REPLACE +¤Ï°À­¤ÎÃÖ´¹¤À¤±¤ò¹Ô¤¦¤³¤È¤ò»ØÄꤹ¤ë¡£ +»ØÄꤵ¤ì¤¿Ì¾Á°¤Î°À­¤¬¤Þ¤À¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¼ºÇÔ¤¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï (¥Õ¥é¥°¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç)¡¢³Èĥ°À­¤ÏɬÍפʾì¹ç¤ÏºîÀ®¤µ¤ì¡¢ +°À­¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ï°À­ÃͤÎÃÖ´¹¤ò¹Ô¤¦¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.B XATTR_CREATE +¤¬»ØÄꤵ¤ì¡¢¤«¤Ä°À­¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢ +.I errno +¤Ë +.B EEXIST +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.B XATTR_REPLACE +¤¬»ØÄꤵ¤ì¡¢Â°À­¤¬¤Þ¤À¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOATTR +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +³Èĥ°À­¤òµ­²±¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥¹¥Ú¡¼¥¹¤¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOSPC +¤Þ¤¿¤Ï +.B EDQUOT +(quota ¤Ë¤è¤ëÀ©¸Â¤¬¸¶°ø¤Î¾ì¹ç) ¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +³Èĥ°À­¤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¤â¤·¤¯¤Ï̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +.I errno +¤Ë +.B ENOTSUP +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.BR stat (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀâÌÀ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ï +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤âŬÍѤµ¤ì¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.4 °Ê¹ß¤Î Linux ¤ÇÍøÍѤǤ­¤ë¡£ +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3 °Ê¹ß¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£ +.\" .SH Ãø¼Ô +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" ¤È SGI XFS ³«È¯¥Á¡¼¥à, +.\" .RI < linux-xfs@oss.sgi.com >¡£ +.\" ¥Ð¥°¥ì¥Ý¡¼¥È¤ä¥³¥á¥ó¥È¤Ï¾åµ­¤Î¥¢¥É¥ì¥¹¤Þ¤ÇÁ÷¤Ã¤Æ²¼¤µ¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getfattr (1), +.BR setfattr (1), +.BR getxattr (2), +.BR listxattr (2), +.BR open (2), +.BR removexattr (2), +.BR stat (2), +.BR attr (5), +.BR symlink (7) diff --git a/release/man2/sgetmask.2 b/release/man2/sgetmask.2 new file mode 100644 index 00000000..a267a090 --- /dev/null +++ b/release/man2/sgetmask.2 @@ -0,0 +1,82 @@ +'\" t +.\" Copyright (c) 2007 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. +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-10-16, Akihiro MOTOKI , LDP v2.66 +.\" +.TH SGETMASK 2 2007-07-05 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sgetmask, ssetmask \- ¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÎÁàºî (ÇÑ»ßͽÄê) +.SH ½ñ¼° +.B "long sgetmask(void);" +.sp +.BI "long ssetmask(long " newmask ); +.SH ÀâÌÀ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ê¡¢ +¡Ö»ÈÍѤ·¤Ê¤¤¤³¤È¡×¡£ +Âå¤ï¤ê¤Ë +.BR sigprocmask (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ + +.BR sgetmask () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ + +.BR ssetmask () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò +.I newmask +¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤷ¡¢Êѹ¹Á°¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ + +¤³¤ì¤éÆó¤Ä¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬°·¤¦¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï¡¢ +ñ½ã¤Ê¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë (¤³¤ÎÅÀ¤¬ +.BR sigprocmask (2) +¤Ç»ÈÍѤµ¤ì¤ë +.I sigset_t +¤È°Û¤Ê¤ë)¡£ +¤³¤ì¤é¤Î¥Þ¥¹¥¯¤òºîÀ®¤·¤¿¤ê¸¡ºº¤¹¤ë¤Ë¤Ï +.BR sigmask (3) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR sgetmask () +¤Ï¾ï¤ËÀ®¸ù¤·¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +.BR ssetmask () +¤Ï¾ï¤ËÀ®¸ù¤·¡¢Ä¾Á°¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ + +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +31 ¤è¤êÂ礭¤¤¥·¥°¥Ê¥ëÈÖ¹æ (¤Ä¤Þ¤ê¡¢¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë) ¤ò°·¤¨¤Ê¤¤¡£ + +.B SIGSTOP +¤ä +.B SIGKILL +¤ò¥Ö¥í¥Ã¥¯¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sigprocmask (2), +.BR signal (7) diff --git a/release/man2/shmctl.2 b/release/man2/shmctl.2 new file mode 100644 index 00000000..d2f583b2 --- /dev/null +++ b/release/man2/shmctl.2 @@ -0,0 +1,433 @@ +.\" Copyright (c) 1993 Luigi P. Bai (lpb@softint.com) July 28, 1993 +.\" and Copyright 1993 Giorgio Ciucci +.\" and Copyright 2004, 2005 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-28, Rik Faith +.\" Modified 1993-11-28, Giorgio Ciucci +.\" Modified 1997-01-31, Eric S. Raymond +.\" Modified 2001-02-18, Andries Brouwer +.\" Modified 2002-01-05, 2004-05-27, 2004-06-17, +.\" Michael Kerrisk +.\" Modified 2004-10-11, aeb +.\" Modified, Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Updated shmid_ds structure definitions +.\" Added information on SHM_DEST and SHM_LOCKED flags +.\" Noted that CAP_IPC_LOCK is not required for SHM_UNLOCK +.\" since kernel 2.6.9 +.\" Modified, 2004-11-25, mtk, notes on 2.6.9 RLIMIT_MEMLOCK changes +.\" 2005-04-25, mtk -- noted aberrant Linux behavior w.r.t. new +.\" 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 µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\" +.TH SHMCTL 2 2008-08-07 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +shmctl \- ¶¦Í­¥á¥â¥ê (shared memory) ¤òÀ©¸æ¤¹¤ë +.SH ½ñ¼° +.ad l +.B #include +.br +.B #include +.sp +.BI "int shmctl(int " shmid ", int " cmd ", struct shmid_ds *" buf ); +.ad b +.SH ÀâÌÀ +.BR shmctl () +¤Ï¡¢¼±Ê̻Ҥ¬ +.I shmid +¤Î¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ËÂФ·¤Æ +.I cmd +¤Ç»Ø¼¨¤·¤¿À©¸æÌ¿Îá¤ò¼Â¹Ô¤¹¤ë¡£ +.PP +.I buf +°ú¤­¿ô¤Ï¡¢ \fIshmid_ds\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +.PP +.in +4n +.nf +struct shmid_ds { + struct ipc_perm shm_perm; /* ½êÍ­¸¢¤Èµö²Ä */ + size_t shm_segsz; /* ¥»¥°¥á¥ó¥È¤Î¥µ¥¤¥º (¥Ð¥¤¥È) */ + time_t shm_atime; /* ºÇ¸å¤ÎÉղà (attach) ¤Î»þ¹ï */ + time_t shm_dtime; /* ºÇ¸å¤ÎʬΥ (detach) ¤Î»þ¹ï */ + time_t shm_ctime; /* ºÇ¸å¤ËÊѹ¹¤¬¹Ô¤ï¤ì¤¿»þ¹ï */ + pid_t shm_cpid; /* ºîÀ®¼Ô (creator) ¤Î PID */ + pid_t shm_lpid; /* ºÇ¸å¤Î shmat(2)/shmdt(2) ¤Î PID */ + shmatt_t shm_nattch; /* ¸½ºßÉղ䵤ì¤Æ¤¤¤ë¿ô */ + ... +}; +.fi +.in +.PP +.I ipc_perm +¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +(¶¯Ä´¤µ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Ï +.B IPC_SET +¤ò»È¤Ã¤ÆÀßÄê²Äǽ¤Ç¤¢¤ë): +.PP +.in +4n +.nf +struct ipc_perm { + key_t __key; /* shmget(2) ¤ËÍ¿¤¨¤é¤ì¤ë¥­¡¼ */ + uid_t \fBuid\fP; /* ½êÍ­¼Ô¤Î¼Â¸ú UID */ + gid_t \fBgid\fP; /* ½êÍ­¼Ô¤Î¼Â¸ú GID */ + uid_t cuid; /* ºîÀ®¼Ô¤Î¼Â¸ú UID */ + gid_t cgid; /* ºîÀ®¼Ô¤Î¼Â¸ú GID */ + unsigned short \fBmode\fP; /* \fBµö²Ä\fP + SHM_DEST ¤È + SHM_LOCKED ¥Õ¥é¥° */ + unsigned short __seq; /* ¥·¡¼¥±¥ó¥¹ÈÖ¹æ */ +}; +.fi +.in +.PP +.I cmd +¤È¤·¤ÆÍ­¸ú¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.br +.TP 10 +.B IPC_STAT +.I shmid +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥«¡¼¥Í¥ë¥Ç¡¼¥¿¹½Â¤ÂΤξðÊó¤ò +\fIbuf\fP ¤Ç»Ø¤µ¤ì¤¿ +.I shmid_ds +¹½Â¤ÂΤ˥³¥Ô¡¼¤¹¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ËÂФ¹¤ë +Æɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B IPC_SET +.I buf +¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ë +.I shmid_ds +¹½Â¤ÂΤΤ¤¤¯¤Ä¤«¤Î¥á¥ó¥Ð¡¼¤ÎÃͤò¡¢ +¤³¤Î¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥«¡¼¥Í¥ë¥Ç¡¼¥¿¹½Â¤ÂΤ˽ñ¤­¹þ¤ß¡¢ +.I shm_ctime +¥á¥ó¥Ð¡¼¤â¹¹¿·¤¹¤ë¡£ +°Ê²¼¤Î¥Õ¥£¡¼¥ë¥É¤ÏÊѹ¹¤Ç¤­¤ë¡£ +\fIshm_perm.uid\fP, \fIshm_perm.gid\fP, +\fIshm_perm.mode\fP (¤ÎºÇ²¼°Ì 9 ¥Ó¥Ã¥È)¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤¬½êÍ­¼Ô +.RI ( shm_perm.uid ) +¤Þ¤¿¤ÏºîÀ®¼Ô +.RI ( shm_perm.cuid ) +¤È°ìÃפ¹¤ë¤«¡¢¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B IPC_RMID +¥»¥°¥á¥ó¥È¤ËÇË´þºÑ¤ß¤Î¥Þ¡¼¥¯¤òÉÕ¤±¤ë¡£ +¥»¥°¥á¥ó¥È¤Ï¡¢¼ÂºÝ¤Ë¤ÏºÇ¸å¥×¥í¥»¥¹¤¬¥»¥°¥á¥ó¥È¤òʬΥ¤·¤¿ (´ØÏ¢¤¹¤ë +.I shmid_ds +¹½Â¤ÂΤΠ+.I shm_nattch +¥á¥ó¥Ð¡¼¤¬ 0 ¤Ë¤Ê¤Ã¤¿) ¸å¤Ç¤Î¤ßÇË´þ¤µ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï½êÍ­¼Ô¤«ºîÀ®¼Ô¤Ç¤¢¤ë¤«¡¢Æø¢¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥»¥°¥á¥ó¥È¤ËÇË´þ¤Î¥Þ¡¼¥¯¤¬ÉÕ¤±¤é¤ì¤ë¤È¡¢ +´ØÏ¢¤¹¤ë¥Ç¡¼¥¿¹½Â¤ÂΤˤª¤¤¤Æ +.I shm_perm.mode +¥Õ¥£¡¼¥ë¥É¤Î (ɸ½à¤Ç¤Ï¤Ê¤¤) +.B SHM_DEST +¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¥Ç¡¼¥¿¹½Â¤ÂÎ¤Ï +.B IPC_STAT +¤Ç¼èÆÀ¤µ¤ì¤ë¡£ +.PP +¸Æ¤Ó½Ð¤·¸µ¤ÏºÇ½ªÅª¤Ë¤Ï¥»¥°¥á¥ó¥È¤ò˺¤ì¤º¤ËÇË´þ\fI¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤\fP¡£ +¤½¤¦¤Ç¤Ê¤ì¤Ð¡¢¥Õ¥©¡¼¥ë¥È (fault) ¤µ¤ì¤¿¥Ú¡¼¥¸¤Ï +¥á¥â¥ê¤«¥¹¥ï¥Ã¥× (swap) ¤Ë»Ä¤ê³¤±¤ë¡£ +.TP 10 +.BR IPC_INFO " (Linux ¸ÇÍ­)" +¥·¥¹¥Æ¥àÁ´ÂΤǤζ¦Í­¥á¥â¥ê¤ÎÀ©¸Â¤È¥Ñ¥é¥á¡¼¥¿¤Ë´Ø¤¹¤ë¾ðÊó¤ò¡¢ +.I buf +¤¬»Ø¤¹¹½Â¤ÂΤËÆþ¤ì¤ÆÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï +.I shminfo +·¿¤Ç¤¢¤ë (¤½¤Î¤¿¤á¥­¥ã¥¹¥È¤¬É¬ÍפǤ¢¤ë)¡£ +.I shminfo +¤Ï +.B _GNU_SOURCE +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.nf +.in +4n + +struct shminfo { + unsigned long shmmax; /* ºÇÂ祻¥°¥á¥ó¥È¥µ¥¤¥º */ + unsigned long shmmin; /* ºÇ¾®¥»¥°¥á¥ó¥È¥µ¥¤¥º¡£ + ¾ï¤Ë 1 */ + unsigned long shmmni; /* ºÇÂ祻¥°¥á¥ó¥È¿ô */ + unsigned long shmseg; /* ¥×¥í¥»¥¹¤¬ÉղäǤ­¤ë + ¥»¥°¥á¥ó¥È¤ÎºÇÂç¿ô¡£ + ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */ + unsigned long shmall; /* ¶¦Í­¥á¥â¥ê¤ÎºÇÂç¥Ú¡¼¥¸¿ô¡£ + ¥·¥¹¥Æ¥àÁ´ÂΤǤÎÃÍ */ +}; + +.in +.fi +ÀßÄê +.IR shmmni , +.IR shmmax , +.I shmall +¤Ï +.I /proc +¤Ë¤¢¤ëƱ¤¸Ì¾Á°¤Î¥Õ¥¡¥¤¥ë·Ðͳ¤ÇÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +¾Ü¤·¤¯¤Ï +.BR proc (5) +¤ò»²¾È¡£ +.TP +.BR SHM_INFO " (Linux ¸ÇÍ­)" +¶¦Í­¥á¥â¥ê¤¬¾ÃÈñ¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à»ñ¸»¤Ë´Ø¤¹¤ë¾ðÊó¤ò +³ÊǼ¤·¤¿ +.I shm_info +¹½Â¤ÂΤòÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂΤϡ¢ +.B _GNU_SOURCE +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.nf +.in +4n + +struct shm_info { + int used_ids; /* ¸½ºß¸ºß¤¹¤ë¥»¥°¥á¥ó¥È¿ô */ + unsigned long shm_tot; /* ¶¦Í­¥á¥â¥ê¤Î¥Ú¡¼¥¸Áí¿ô */ + unsigned long shm_rss; /* ¥á¥â¥ê¾å¤Ë¤¢¤ë (¥¹¥ï¥Ã¥×¤µ¤ì¤Æ + ¤¤¤Ê¤¤) ¶¦Í­¥á¥â¥ê¥Ú¡¼¥¸¿ô */ + unsigned long shm_swp; /* ¥¹¥ï¥Ã¥×¤µ¤ì¤Æ¤¤¤ë¶¦Í­¥á¥â¥ê + ¥Ú¡¼¥¸¿ô */ + unsigned long swap_attempts; + /* Linux 2.4 °Ê¹ß¤Ç¤Ï̤»ÈÍÑ */ + unsigned long swap_successes; + /* Linux 2.4 °Ê¹ß¤Ç¤Ï̤»ÈÍÑ */ +}; +.in +.fi +.TP +.BR SHM_STAT " (Linux ¸ÇÍ­)" +.B IPC_STAT +¤ÈƱ¤¸¤¯ +.I shmid_ds +¹½Â¤ÂΤòÊÖ¤¹¡£ +⤷¡¢ +.I shmid +°ú¤­¿ô¤Ï¡¢¥»¥°¥á¥ó¥È¼±Ê̻ҤǤϤʤ¯¡¢¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¶¦Í­¥á¥â¥ê +¥»¥°¥á¥ó¥È¤Ë´Ø¤¹¤ë¾ðÊó¤ò´ÉÍý¤¹¤ë¥«¡¼¥Í¥ë¤ÎÆâÉôÇÛÎó¤Ø¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹ +¤Ç¤¢¤ë¡£ +.PP +¸Æ¤Ó½Ð¤·¸µ¤Ï¡¢\fIcmd\fP ¤Ë°Ê²¼¤ÎÃͤò»ØÄꤹ¤ë¤³¤È¤Ç¡¢¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤¬ +¥¹¥ï¥Ã¥×¤µ¤ì¤ë¤³¤È¤òËɻߤ·¤¿¤ê¡¢µö²Ä¤·¤¿¤ê¤Ç¤­¤ë: +.br +.TP 10 +.BR SHM_LOCK " (Linux ¸ÇÍ­)" +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ò¥¹¥ï¥Ã¥×¤¹¤ë¤³¤È¤òËɻߤ¹¤ë¡£ +¥í¥Ã¥¯¤¬Í­¸ú¤Ë¤Ê¤Ã¤¿¸å¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï¡¢ +¸ºß¤¹¤ë¤³¤È¤¬Í׵ᤵ¤ì¤¿Á´¤Æ¤Î¥Ú¡¼¥¸¤ò¥Õ¥©¡¼¥ë¥È¤µ¤»¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥»¥°¥á¥ó¥È¤¬¥í¥Ã¥¯¤µ¤ì¤ë¤È¡¢ +´ØÏ¢¤¹¤ë¥Ç¡¼¥¿¹½Â¤ÂΤˤª¤¤¤Æ +.I shm_perm.mode +¥Õ¥£¡¼¥ë¥É¤Î (ɸ½àŪ¤Ç¤Ï¤Ê¤¤) +.B SHM_LOCKED +¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¥Ç¡¼¥¿¹½Â¤ÂÎ¤Ï +.B IPC_STAT +¤Ç¼èÆÀ¤µ¤ì¤ë¡£ +.TP +.BR SHM_UNLOCK " (Linux ¸ÇÍ­)" +¥»¥°¥á¥ó¥È¤Î¥í¥Ã¥¯¤ò²ò½ü¤·¡¢¥¹¥ï¥Ã¥×¡¦¥¢¥¦¥È¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£ +.PP +2.6.10 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢Æø¢¥×¥í¥»¥¹¤À¤±¤¬ +.B SHM_LOCK +¤È +.B SHM_UNLOCK +¤òÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤¿¡£ +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 +.SH ÊÖ¤êÃÍ +.B IPC_INFO +¤È +.B SHM_INFO +Áàºî¤Ï¡¢À®¸ù¤¹¤ë¤È¡¢Á´¤Æ¤Î¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤Ë´Ø¤¹¤ë¾ðÊó¤ò +´ÉÍý¤·¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤ÎÆâÉôÇÛÎó¤Î»ÈÍÑÃ楨¥ó¥È¥ê¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î +¤¦¤ÁºÇÂçÃͤòÊÖ¤¹ +(¤³¤Î¾ðÊó¤Ï¡¢¥·¥¹¥Æ¥à¤ÎÁ´¤Æ¤Î¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤Ë´Ø¤¹¤ë¾ðÊó¤ò +¼èÆÀ¤¹¤ë¤¿¤á¤Ë¡¢ +.B SHM_STAT +Áàºî¤ò·«¤êÊÖ¤·¼Â¹Ô¤¹¤ëºÝ¤Ë»ÈÍѤǤ­¤ë)¡£ +.B SHM_STAT +Áàºî¤Ï¡¢À®¸ù¤¹¤ë¤È¡¢ +.I shmid +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤Î¼±Ê̻ҤòÊÖ¤¹¡£ +¾¤ÎÁàºî¤Ï¡¢À®¸ù¤Î¾ì¹ç 0 ¤òÊÖ¤¹¡£ + +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES + +\fBIPC_STAT\fP ¤Þ¤¿¤Ï \fBSHM_STAT\fP ¤¬Í׵ᤵ¤ì¡¢ +\fIshm_perm.mode\fP ¤¬ +.I shmid +¤Ø¤ÎÆɤ߹þ¤ß¥¢¥¯¥»¥¹¤òµö¤·¤Æ¤ª¤é¤º¡¢ +¤«¤Ä¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬ +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +.I cmd +°ú¤­¿ô¤Ë +.B IPC_SET +¤« +.B IPC_STAT +¤¬»ØÄꤵ¤ì¤¿¤¬ +.I buf +¤Ç»Ø¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¡£ +.TP +.B EIDRM +\fIshmid\fP ¤¬ºï½ü (remove) ¤µ¤ì¤¿¼±ÊÌ»Ò (identifier) ¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +\fIshmid\fP ¤¬Í­¸ú¤Ê¼±Ê̻ҤǤʤ¤¤«¡¢ +\fIcmd\fP ¤¬Í­¸ú¤Ê¥³¥Þ¥ó¥É¤Ç¤Ê¤¤¡£ +¤â¤·¤¯¤Ï¡¢ +.B SHM_STAT +Áàºî¤Î¾ì¹ç¤Ë¡¢ +.I shmid +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹Ãͤ¬¸½ºß̤»ÈÍѤÎÇÛÎó¤Î¥¹¥í¥Ã¥È¤ò»²¾È¤·¤Æ¤¤¤¿¡£ +.TP +.B ENOMEM +(2.6.9 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ë¤ª¤¤¤Æ) +.B SHM_LOCK +¤¬»ØÄꤵ¤ì¡¢ +¥í¥Ã¥¯¤µ¤ì¤ëͽÄê¤Î¥»¥°¥á¥ó¥È¤Î¥µ¥¤¥º +(¥í¥Ã¥¯¤µ¤ì¤ë¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Î¹ç·×¥Ð¥¤¥È¿ô) ¤¬¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤Ë¤Ä¤¤¤Æ¤ÎÀ©¸Â¤òĶ¤¨¤¿¡£ +¤³¤ÎÀ©¸Â¤Ï +.B RLIMIT_MEMLOCK +¥½¥Õ¥È»ñ¸»À©¸Â¤ÇÄêµÁ¤µ¤ì¤ë +.RB ( setrlimit (2) +¤ò»²¾È)¡£ +.TP +.B EOVERFLOW +\fBIPC_STAT\fP ¤¬»î¤ß¤é¤ì¡¢GID ¤ä UID ¤ÎÃͤ¬ +.I buf +¤Ç»Ø¼¨¤µ¤ì¤ë¹½Â¤ÂΤ˳ÊǼ¤¹¤ë¤Ë¤ÏÂ礭²á¤®¤ë¡£ +.TP +.B EPERM +\fBIPC_SET\fP ¤« \fBIPC_RMID\fP ¤¬»î¤ß¤é¤ì¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ºîÀ®¼Ô +.RI ( shm_perm.cuid ) +¤Ç¤â½êÍ­¼Ô +.RI ( shm_perm.uid ) +¤Ç¤â¤Ê¤¯¡¢¥×¥í¥»¥¹¤¬Æø¢¤ò»ý¤¿¤Ê¤¤ (Linux ¤Ç¤Ï +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤)¡£ + +¤Þ¤¿¤Ï (2.6.9 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç) +.B SHM_LOCK +¤Þ¤¿¤Ï +.B SHM_UNLOCK +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤¬¡¢¥×¥í¥»¥¹¤¬Æø¢¤ò»ý¤¿¤Ê¤¤ +(Linux ¤Ç¤Ï +.B CAP_IPC_LOCK +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤)¡£ +(Linux 2.6.9 °Ê¹ß¤Ç¤Ï¡¢ +.B RLIMIT_MEMLOCK +¤¬ 0 ¤Ç¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢¤ò»ý¤¿¤Ê¤¤¾ì¹ç¤Ë¤â¡¢¤³¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë¡£) +.SH ½àµò +SVr4, POSIX.1-2001. +.\" SVr4 ¤Ë¤Ï¾¤Ë EINVAL, ENOENT, ENOSPC, ENOMEM, +.\" EEXIST ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.\" SVr4 ¤ª¤è¤Ó SVID ¤Ë¤Ï EIDRM ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +.BR IPC_INFO , +.BR SHM_STAT , +.B SHM_INFO +Áàºî¤Ï¡¢ +.BR ipcs (8) +¥×¥í¥°¥é¥à¤Ç³ä¤êÅö¤ÆºÑ¤Î»ñ¸»¤Ë´Ø¤¹¤ë¾ðÊó¤òÄ󶡤¹¤ë¤¿¤á¤Ë +»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£¾­Íè¡¢¤³¤ì¤é¤ÎÁàºî¤ÏÊѹ¹¤µ¤ì¤¿¤ê¡¢ +/proc ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë°ÜÆ°¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + +Linux ¤Ç¤Ï¡¢ +.I shmctl(IPC_RMID) +¤ò»È¤Ã¤Æ¤¹¤Ç¤Ëºï½ü¥Þ¡¼¥¯¤¬¤Ä¤±¤é¤ì¤Æ¤¤¤ë¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ò +¤¢¤ë¥×¥í¥»¥¹¤¬Éղà (attach) +.RB ( shmat (2)) +¤¹¤ë¤³¤È¤òµö²Ä¤·¤Æ¤¤¤ë¡£ +¤³¤Îµ¡Ç½¤Ï¾¤Î Unix ¤Î¼ÂÁõ¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +°Ü¿¢À­¤ò¹Íθ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤ì¤Ë°Í¸¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +\fI¹½Â¤ÂÎ shmid_ds\fP Æâ¤Î¿¤¯¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +Linux 2.2 ¤Ç¤Ï +.I short +·¿¤À¤Ã¤¿¤¬¡¢Linux 2.4 ¤Ç¤Ï +.I long +·¿¤Ë¤Ê¤Ã¤¿¡£ +¤³¤ÎÍøÅÀ¤òÀ¸¤«¤¹¤Ë¤Ï¡¢glibc-2.1.91 °Ê¹ß¤Î´Ä¶­²¼¤Ç +ºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ì¤Ð½½Ê¬¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¿·¤·¤¤·Á¼°¤Î¸Æ¤Ó½Ð¤·¤È¸Å¤¤·Á¼°¤Î¸Æ¤Ó½Ð¤·¤ò +.I cmd +Æâ¤Î +.B IPC_64 +¥Õ¥é¥°¤Ç¶èÊ̤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mlock (2), +.BR setrlimit (2), +.BR shmget (2), +.BR shmop (2), +.BR capabilities (7), +.BR shm_overview (7), +.BR svipc (7) diff --git a/release/man2/shmget.2 b/release/man2/shmget.2 new file mode 100644 index 00000000..138e02b0 --- /dev/null +++ b/release/man2/shmget.2 @@ -0,0 +1,326 @@ +.\" Copyright (c) 1993 Luigi P. Bai (lpb@softint.com) July 28, 1993 +.\" +.\" 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 Wed Jul 28 10:57:35 1993, Rik Faith +.\" Modified Sun Nov 28 16:43:30 1993, Rik Faith +.\" with material from Giorgio Ciucci +.\" Portions Copyright 1993 Giorgio Ciucci +.\" Modified Tue Oct 22 22:03:17 1996 by Eric S. Raymond +.\" Modified, 8 Jan 2003, Michael Kerrisk, +.\" Removed EIDRM from errors - that can't happen... +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" 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 ¼ÂÁõ +.\" +.TH SHMGET 2 2006-05-02 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +shmget \- ¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ò³ä¤êÅö¤Æ¤ë +.SH ½ñ¼° +.ad l +.B #include +.br +.B #include +.sp +.BI "int shmget(key_t " key ", size_t " size ", int " shmflg ); +.ad b +.SH ÀâÌÀ +.BR shmget () +¤Ï +.I key +°ú¤­¿ô¤ËÂбþ¤¹¤ë¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Î¼±Ê̻ҤòÊÖ¤¹¡£ +.I key +¤ÎÃͤ¬ +.B IPC_PRIVATE +¤Î¾ì¹ç¡¢¤â¤·¤¯¤Ï +.I key +¤ËÂбþ¤¹¤ë¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤¬Â¸ºß¤»¤º¡¢ +.I shmflg +¤Ë +.B IPC_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢ +¿·¤·¤¤¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤òºîÀ®¤¹¤ë¡£ +ºîÀ®¤µ¤ì¤ë¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Ï¡¢ +.I size +°ú¤­¿ô¤ÎÃͤò +.B PAGE_SIZE +¤ÎÇÜ¿ô¤Ø¤ÈÀÚ¤ê¾å¤²¤¿ (round up) Â礭¤µ¤È¤Ê¤ë¡£ +.PP +.I shmflg +¤Ë +.B IPC_CREAT +¤È +.B IPC_EXCL +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.I key +¤ËÂбþ¤¹¤ë¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤¬´û¤Ë¸ºß¤¹¤ë¤È¡¢ +.BR shmget () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EEXIST +¤¬ÀßÄꤵ¤ì¤ë (¤³¤ì¤Ï +.BR open (2) +¤Ë +.B O_CREAT | O_EXCL +¤ò»ØÄꤷ¤¿¾ì¹ç¤ÎÆ°ºî¤ÈƱ¤¸¤Ç¤¢¤ë)¡£ +.PP +.I shmflg +¤Ï°Ê²¼¤ÎÆâÍƤ«¤é¹½À®¤µ¤ì¤ë: +.TP 12 +.B IPC_CREAT +¿·¤·¤¤¥»¥°¥á¥ó¥È¤òºîÀ®¤¹¤ë¡£¤³¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.BR shmget () +¤Ï \fIkey\fP ¤ËÂбþ¤¹¤ë¥»¥°¥á¥ó¥È¤òõ¤·¡¢ +¥æ¡¼¥¶¤¬¤½¤Î¥»¥°¥á¥ó¥È¤Ë¥¢¥¯¥»¥¹¤¹¤ëµö²Ä¤¬¤¢¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +.TP +.B IPC_EXCL +\fBIPC_CREAT\fP ¤È¶¦¤Ë»ÈÍѤ·¡¢¥»¥°¥á¥ó¥È¤¬´û¤Ë¸ºß¤·¤¿¾ì¹ç¤Ë¤Ï +¼ºÇÔ¤¹¤ë¤³¤È¤òÊݾڤ¹¤ë¡£ +.TP +.I mode_flags +(²¼°Ì 9 ¥Ó¥Ã¥È) +½êÍ­¼Ô¡¢¥°¥ë¡¼¥×¡¢Â¾¿Í (world) ¤Ø¤Îµö²Ä¤ò»ØÄꤹ¤ë¡£ +¤³¤ì¤é¤Î¥Ó¥Ã¥È¤Ï +.BR open (2) +¤Î +.I mode +°ú¤­¿ô¤ÈƱ¤¸·Á¼°¤ÇƱ¤¸°ÕÌ£¤ò»ý¤Ä¡£ +º£¤Î¤È¤³¤í¡¢¥·¥¹¥Æ¥à¤Ï¼Â¹Ô (execute) µö²Ä¤ò»²¾È¤·¤Ê¤¤¡£ +.TP +.BR SHM_HUGETLB " (Linux 2.6 °Ê¹ß)" +"¥Ò¥å¡¼¥¸¥Ú¡¼¥¸ (huge page)" ¤ò»È¤¦¥»¥°¥á¥ó¥È¤ò³ä¤êÅö¤Æ¤ë¡£ +¾ÜºÙ¤Ê¾ðÊó¤Ï¡¢¥«¡¼¥Í¥ë¡¦¥½¡¼¥¹¤Î¥Õ¥¡¥¤¥ë +.I Documentation/vm/hugetlbpage.txt +¤ò»²¾È¡£ +.TP +.BR SHM_NORESERVE " (Linux 2.6.15 °Ê¹ß)" +¤³¤Î¥Õ¥é¥°¤Ï¡¢ +.BR mmap (2) +¤Î +.B MAP_NORESERVE +¥Õ¥é¥°¤ÈƱ¤¸Ìò³ä¤ò²Ì¤¿¤¹¡£ +¤³¤Î¥»¥°¥á¥ó¥È¤ËÂФ¹¤ë¥¹¥ï¥Ã¥×¶õ´Ö¤ÎͽÌó¤ò¹Ô¤ï¤Ê¤¤¡£ +¥¹¥ï¥Ã¥×¶õ´Ö¤òͽÌó¤·¤¿¾ì¹ç¤Ï¡¢¤½¤Î¥»¥°¥á¥ó¥È¤ÎÊѹ¹¤¬É¬¤ºÀ®¸ù¤¹¤ë¤³¤È¤¬ +Êݾڤµ¤ì¤ë¡£¥¹¥ï¥Ã¥×¶õ´Ö¤ÎͽÌó¤ò¹Ô¤ï¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ÊªÍý¥á¥â¥ê¤Ë¶õ¤­¤¬ +¤Ê¤¤¤È½ñ¤­¹þ¤ß»þ¤Ë +.B SIGSEGV +¤ò¼õ¤±¼è¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.BR proc (5) +¤Ë¤¢¤ë +.I /proc/sys/vm/overcommit_memory +¥Õ¥¡¥¤¥ë¤Ë´Ø¤¹¤ëµÄÏÀ¤â»²¾È¤Î¤³¤È¡£ +.\" As at 2.6.17-rc2, this flag has no effect if SHM_HUGETLB was also +.\" specified. +.PP +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤¬¿·¤¿¤ËºîÀ®¤µ¤ì¤ëºÝ¡¢ +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ÎÆâÍÆ¤Ï 0 ¤Ç½é´ü²½¤µ¤ì¡¢ +´ØÏ¢¾ðÊó¤òÊÝ»ý¤¹¤ë¥Ç¡¼¥¿¹½Â¤ÂÎ +.I shmid_ds +¤Ï°Ê²¼¤Î¤è¤¦¤Ë½é´ü²½¤µ¤ì¤ë¡£ +.IP +.I shm_perm.cuid +¤È +.I shm_perm.uid +¤Ë¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ID ¤òÀßÄꤹ¤ë¡£ +.IP +.I shm_perm.cgid +¤È +.I shm_perm.gid +¤Ë¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥×ID ¤òÀßÄꤹ¤ë¡£ +.IP +.I shm_perm.mode +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤Ë +.I shmflg +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤òÀßÄꤹ¤ë¡£ +.IP +.I shm_segsz +¤Ë +.I size +¤ÎÃͤòÀßÄꤹ¤ë¡£ +.IP +.IR shm_lpid , +.IR shm_nattch , +.IR shm_atime , +.I shm_dtime +¤Ë 0 ¤òÀßÄꤹ¤ë¡£ +.IP +.I shm_ctime +¤Ë¸½ºß¤Î»þ¹ï¤òÀßÄꤹ¤ë¡£ +.PP +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢¥¢¥¯¥»¥¹µö²Ä¤Î¸¡ºº¤È¡¢ +Ç˲õ (destruction) ¥Þ¡¼¥¯¤¬¤Ä¤±¤é¤ì¤Æ¤¤¤Ê¤¤¤«¤Î¥Á¥§¥Ã¥¯¤¬¹Ô¤ï¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢Í­¸ú¤Ê¥»¥°¥á¥ó¥È¼±ÊÌ»Ò +.I shmid +¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢ \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï +.I errno +¤¬°Ê²¼¤Î¤É¤ì¤«¤ËÀßÄꤵ¤ì¤ë: +.TP +.B EACCES +¥æ¡¼¥¶¡¼¤Ï¤½¤Î¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä¤ò»ý¤¿¤º¡¢ +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EEXIST +.B IPC_CREAT | IPC_EXCL +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¤¬¡¢¤½¤Î¥»¥°¥á¥ó¥È¤¬´û¤Ë¸ºß¤¹¤ë¡£ +.TP +.B EINVAL +¿·¤·¤¤¥»¥°¥á¥ó¥È¤òºîÀ®¤·¤è¤¦¤È¤·¤¿ºÝ¤Ë +\fIsize\fP < \fBSHMMIN\fP ¤Þ¤¿¤Ï \fIsize\fP > \fBSHMMAX\fP ¤Ç¤¢¤Ã¤¿¡£ +¤â¤·¤¯¤Ï¡¢»ØÄꤵ¤ì¤¿¥­¡¼¤ËÂбþ¤¹¤ë¥»¥°¥á¥ó¥È¤¬´û¤Ë¸ºß¤·¤Æ¡¢¿·¤·¤¤ +¥»¥°¥á¥ó¥È¤òºîÀ®¤·¤è¤¦¤È¤Ï¤·¤Ê¤«¤Ã¤¿¤¬¡¢\fIsize\fP ¤¬Â¸ºß¤¹¤ë¥»¥°¥á¥ó¥È¤Î +¥µ¥¤¥º¤è¤ê¤âÂ礭¤«¤Ã¤¿¡£ +.TP +.B ENFILE +.\" [2.6.7] shmem_zero_setup()-->shmem_file_setup()-->get_empty_filp() +¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¾å¸Â¤Ë㤷¤¿¡£ +.TP +.B ENOENT +»ØÄꤵ¤ì¤¿ \fIkey\fP ¤ËÂбþ¤¹¤ë¥»¥°¥á¥ó¥È¤¬Â¸ºß¤»¤º¡¢ +.B IPC_CREAT +¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +¥»¥°¥á¥ó¥È¤Î´ÉÍý¾ðÊó (overhead) ¤Ë³ä¤êÅö¤Æ¤ë¥á¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOSPC +.\" motoki 2005-03-02 -- SHMMNI ¤Î°ÕÌ£¤ò¹Íθ¤·¤Æ°ÕÌõ +¥·¥¹¥Æ¥àÁ´ÂΤζ¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¿ô¤ÎÀ©¸Â +.RB ( SHMMNI ) +¤Ë㤷¤¿¡¢¤Þ¤¿¤ÏÍ׵ᤵ¤ì¤¿ +.I size +¤Î¥»¥°¥á¥ó¥È¤Î³ä¤êÅö¤Æ¤¬ +¥·¥¹¥Æ¥àÁ´ÂΤζ¦Í­¥á¥â¥ê¥µ¥¤¥º¤ÎÀ©¸Â +.RB ( SHMALL ) +¤òĶ²á¤·¤¿¡£ +.TP +.B EPERM +.B SHM_HUGETLB +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¤Ë¤Ï¸¢¸Â¤¬¤Ê¤«¤Ã¤¿ +.RB ( CAP_IPC_LOCK +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿)¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.\" SVr4 ¤Ë¤ÏÄÉ²Ã¤Ç EEXIST ¥¨¥é¡¼¾õÂ֤ε­½Ò¤¬¤¢¤ë¡£ + +.B SHM_HUGETLB +¤Ï Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢°Ü¿¢À­¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +.B IPC_PRIVATE +¤Ï¥Õ¥é¥°¤Ç¤Ï¤Ê¤¯ +.I key_t +·¿¤Ç¤¢¤ë¡£ +¤³¤ÎÆÃÊ̤ÊÃͤ¬ +.I key +¤Ë»ÈÍѤµ¤ì¤¿¾ì¹ç¤Ï¡¢ +.BR shmget () +¤Ï +.I shmflg +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤ò½ü¤¤¤¿Á´¤Æ¤ò̵»ë¤·¡¢ +(À®¸ù¤¹¤ì¤Ð) ¿·¤·¤¤¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤òºîÀ®¤¹¤ë¡£ +.PP +.BR shmget () +¥³¡¼¥ë¤Ë±Æ¶Á¤¹¤ë¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È»ñ¸»¤ÎÀ©¸Â¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.TP +.B SHMALL +¥·¥¹¥Æ¥àÁ´ÂΤζ¦Í­¥á¥â¥ê¡¦¥Ú¡¼¥¸¤ÎºÇÂç¿ô +(Linux ¤Ç¤Ï¡¢¤³¤Î¾å¸ÂÃÍ¤Ï +.I /proc/sys/kernel/shmall +·Ðͳ¤Ç»²¾È¤·¤¿¤ê¡¢Êѹ¹¤·¤¿¤ê¤Ç¤­¤ë)¡£ +.TP +.B SHMMAX +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Î¥Ð¥¤¥Èñ°Ì¤ÎÂ礭¤µ¤Î¾å¸Â: Êý¿Ë°Í¸ +(Linux ¤Ç¤Ï¡¢¤³¤Î¾å¸ÂÃÍ¤Ï +.I /proc/sys/kernel/shmmax +·Ðͳ¤Ç»²¾È¤·¤¿¤ê¡¢Êѹ¹¤·¤¿¤ê¤Ç¤­¤ë)¡£ +.TP +.B SHMMIN +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Î¥Ð¥¤¥Èñ°Ì¤ÎÂ礭¤µ¤Î²¼¸Â: ¼ÂÁõ°Í¸ +(¸½ºß¤Ï 1 ¥Ð¥¤¥È¤À¤¬¡¢¼Â¼ÁŪ¤ÊºÇ¾®¥µ¥¤¥º¤Ï +.B PAGE_SIZE +¤Ç¤¢¤ë)¡£ +.TP +.B SHMMNI +¥·¥¹¥Æ¥àÁ´ÂΤζ¦Í­¥á¥â¥ê¡¼¤Î¿ô¤Î¾å¸Â: ¼ÂÁõ°Í¸ +(¸½ºß¤Ï 4096¡£Linux 2.3.99 ¤è¤êÁ°¤Ç¤Ï 128¡£ +Linux ¤Ç¤Ï¡¢¤³¤Î¾å¸ÂÃÍ¤Ï +.I /proc/sys/kernel/shmmni +·Ðͳ¤Ç»²¾È¤·¤¿¤ê¡¢Êѹ¹¤·¤¿¤ê¤Ç¤­¤ë)¡£ +.\" 2.4.x ¤È 2.6.8 ¤Î´Ö¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¡¢SHMMNI ¤è¤ê°ì¤Ä¤Î¿¤¯¤Î +.\" ¥»¥°¥á¥ó¥È¤òºîÀ®¤Ç¤­¤ë¤È¤¤¤¦¥Ð¥°¤¬¤¢¤Ã¤¿¡£ +.\" ¤³¤Î /proc ¥Õ¥¡¥¤¥ë¤Ï Linux 2.2 °ÊÁ°¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤ -- MTK +.PP +¥×¥í¥»¥¹Åö¤ê¤Î¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Î¸Ä¿ô¤ÎºÇÂçÃÍ +.RB ( SHMSEG ) +¤Ë´Ø¤¹¤ë¼ÂÁõ¾å¤ÎÀ©¸Â¤Ï¤Ê¤¤¡£ +.SS Linux ¤Ç¤ÎÃí°Õ +¥Ð¡¼¥¸¥ç¥ó 2.3.30 ¤Þ¤Ç¤Ï¡¢Linux ¤Ï +ºï½ü¤¬Í½Äꤵ¤ì¤Æ¤¤¤ë¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ËÂФ·¤Æ +.BR shmget () +¤¬¹Ô¤ï¤ì¤ë¤È +.B EIDRM +¤òÊÖ¤·¤Æ¤¤¤¿¡£ +.SH ¥Ð¥° +.B IPC_PRIVATE +¤È¤¤¤¦Ì¾Á°¤òÁª¤ó¤À¤Î¤Ï¤ª¤½¤é¤¯¼ºÇԤǤ¢¤í¤¦¡£ +.B IPC_NEW +¤ÎÊý¤¬¤è¤êÌÀ³Î¤Ë¤½¤Îµ¡Ç½¤òɽ¤·¤Æ¤¤¤ë¤À¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR shmat (2), +.BR shmctl (2), +.BR shmdt (2), +.BR ftok (3), +.BR capabilities (7), +.BR shm_overview (7), +.BR svipc (7) diff --git a/release/man2/shmop.2 b/release/man2/shmop.2 new file mode 100644 index 00000000..84a73d6e --- /dev/null +++ b/release/man2/shmop.2 @@ -0,0 +1,311 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 Nov 28 17:06:19 1993, Rik Faith +.\" with material from Luigi P. Bai +.\" Portions Copyright 1993 Luigi P. Bai +.\" Modified Tue Oct 22 22:04:23 1996 by Eric S. Raymond +.\" Modified, 5 Jan 2002, Michael Kerrisk +.\" Modified, 19 Sep 2002, Michael Kerrisk +.\" Added SHM_REMAP flag description +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" Modified, 11 Nov 2004, Michael Kerrisk +.\" Language and formatting clean-ups +.\" Changed wording and placement of sentence regarding attachment +.\" of segments marked for destruction +.\" +.\" 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 +.\" +.\"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" +.SH ̾Á° +shmat, shmdt \- ¶¦Í­¥á¥â¥ê (shared memory) ¤ÎÁàºî +.SH ½ñ¼° +.nf +.B #include +.B #include + +.BI "void *shmat(int " shmid ", const void *" shmaddr ", int " shmflg ); + +.BI "int shmdt(const void *" shmaddr ); +.fi +.SH ÀâÌÀ +.BR shmat () +¤Ï +.I shmid +¤Ç»ØÄꤵ¤ì¤¿¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È (shared memory segment) ¤ò +¥³¡¼¥ë¤·¤¿¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ËÉղà (attach) ¤¹¤ë¡£ +Éղ乤륢¥É¥ì¥¹¤Ï +.I shmaddr +¤Ë°Ê²¼¤Î¤É¤ì¤«¤Î·Á¼°¤Ç»ØÄꤹ¤ë: +.LP +.I shmaddr +¤¬ NULL ¤Ê¤é¤Ð¡¢¥·¥¹¥Æ¥à¤Ï¥»¥°¥á¥ó¥È¤òÉղ乤뤿¤á¤Î +ŬÀÚ¤Ê (»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤) ¥¢¥É¥ì¥¹¤òÁªÂò¤¹¤ë¡£ +.LP +.I shmaddr +¤¬ NULL ¤Ç¤Ê¤¯ +.B SHM_RND +¤¬ +.I shmflg +¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.I shmaddr +¤ò +.B SHMLBA +¤ÎÇÜ¿ô¤Ø¤ÈÀÚ¤ê¼Î¤Æ¤¿ (rounding down) ¤Î¤ÈÅù¤·¤¤¥¢¥É¥ì¥¹¤ØÉղ乤롣 +¤½¤Î¾¤Î¾ì¹ç¤Ï +.I shmaddr +¤ÏÉղäò¹Ô¤Ê¤¦¥¢¥É¥ì¥¹¤Ç¡¢¥Ú¡¼¥¸¶­³¦¤ò»Ø¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +.PP +.B SHM_RDONLY +¤¬ +.I shmflg +¤Ë»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ï¡¢ +¥»¥°¥á¥ó¥È¤ÏÆɤ߹þ¤ßÀìÍѤËÉղ䵤졢¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥°¥á¥ó¥È¤Ø¤Î +Æɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¤½¤Î¥»¥°¥á¥ó¥È¤ÏÆɤ߹þ¤ß¤È½ñ¤­¹þ¤ß¤Î¤¿¤á¤ËÉղ䵤졢 +¥×¥í¥»¥¹¤Ï¤½¤Î¥»¥°¥á¥ó¥È¤ËÆɤ߹þ¤ß¤È½ñ¤­¹þ¤ß¤Îµö²Ä¤ò»ý¤ÄɬÍפ¬¤¢¤ë¡£ +½ñ¤­¹þ¤ßÀìÍѤζ¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤È¤¤¤¦³µÇ°¤Ï¸ºß¤·¤Ê¤¤¡£ +.PP +(Linux ÆÃÍ­¤Î) +.B SHM_REMAP +¥Õ¥é¥°¤¬ +.I shmflg +¤Ë»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +¥»¥°¥á¥ó¥È¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò´û¸¤Î¥Þ¥Ã¥Ô¥ó¥°¤ËÃÖ¤­´¹¤¨¤ë¡£ +¥Þ¥Ã¥Ô¥ó¥°¤ÎÈϰϤϡ¢ +.I shmaddr +¤«¤é»Ï¤Þ¤ê¥»¥°¥á¥ó¥È¤Î¥µ¥¤¥ºÊ¬¤À¤±¤¢¤ë +(Ä̾ï +.B EINVAL +¥¨¥é¡¼¤Ï¡¢¤³¤Î¥¢¥É¥ì¥¹ÈϰϤ˥ޥåԥ󥰤¬´û¤Ë¸ºß¤¹¤ë¤¿¤á¤Ëµ¯¤ë)¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¾ì¹ç¤Ï¡¢ +.I shmaddr +¤¬ NULL ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î +.BR brk (2) +¤ÎÃͤÏÉղäˤè¤Ã¤ÆÊѲ½¤·¤Ê¤¤¡£ +¤½¤Î¥»¥°¥á¥ó¥È¤Ï¥×¥í¥»¥¹¤¬½ªÎ» (exit) ¤·¤¿¤é¼«Æ°Åª¤ËʬΥ (detach) ¤µ¤ì¤ë¡£ +Ʊ¤¸¥»¥°¥á¥ó¥È¤ò¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¡¢Æɤ߹þ¤ßÀìÍѤª¤è¤ÓÆɤ߽ñ¤­Î¾ÍÑ +¤È¤·¤ÆÉղäǤ­¡¢¤Þ¤¿Ê£¿ô²óÉղ乤뤳¤È¤â¤Ç¤­¤ë¡£ +.PP +À®¸ù¤·¤¿ +.BR shmat () +¥³¡¼¥ë¤Ï¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Ë´ØÏ¢¤¹¤ë +.I shmid_ds +¹½Â¤ÂÎ +.RB ( shmctl (2) +¤ò»²¾È) ¤Î¥á¥ó¥Ð¡¼¤ò°Ê²¼¤Î¤è¤¦¤Ë¹¹¿·¤¹¤ë: +.IP +.I shm_atime +¤Ë¤Ï¸½ºß¤Î»þ¹ï¤òÀßÄꤹ¤ë¡£ +.IP +.I shm_lpid +¤Ë¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤òÀßÄꤹ¤ë¡£ +.IP +.I shm_nattch +¤ò 1 Áý²Ã¤µ¤»¤ë¡£ +.PP +.BR shmdt () +¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤«¤é +.I shmaddr +¤Ç»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤ËÇÛÃÖ¤µ¤ì¤¿¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤òʬΥ (detach) ¤¹¤ë¡£ +ʬΥ¤¹¤ë¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Ï¡¢¸½ºß +.I shmaddr +¤ËÉղ䵤ì¤Æ¤¤¤ë¤â¤Î¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I shmaddr +¤Ï¡¢¤½¤ì¤òÉղä·¤¿»þ¤Ë +.BR shmat () +¤¬ÊÖ¤·¤¿ÃͤËÅù¤·¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +À®¸ù¤·¤¿ +.BR shmdt () +¥³¡¼¥ë¤Ï¤½¤Î¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Ë´ØÏ¢¤¹¤ë +.I shmid_ds +¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤ò°Ê²¼¤Î¤è¤¦¤Ë¹¹¿·¤¹¤ë: +.IP +.I shm_dtime +¤Ë¤Ï¸½ºß¤Î»þ¹ï¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP +.I shm_lpid +¤Ë¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤¬ÀßÄꤵ¤ì¤ë¡£ +.IP +.I shm_nattch +¤ò 1 ¸º¾¯¤µ¤»¤ë¡£ +¤â¤· 0 ¤Ë¤Ê¤ê¡¢ºï½ü¥Þ¡¼¥¯¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï +¤½¤Î¥»¥°¥á¥ó¥È¤Ïºï½ü¤µ¤ì¤ë¡£ +.PP +.BR fork (2) +¤·¤¿¸å¡¢»Ò¥×¥í¥»¥¹¤ÏÉղ䵤줿¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ò·Ñ¾µ¤¹¤ë¡£ + +.BR exec (2) +¤·¤¿¸å¡¢Á´¤Æ¤ÎÉղ䵤줿¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Ï¥×¥í¥»¥¹¤«¤éʬΥ¤µ¤ì¤ë¡£ + +.BR exit (2) +¤Ë¤ª¤¤¤Æ¡¢Á´¤Æ¤ÎÉղ䵤줿¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Ï¥×¥í¥»¥¹¤«¤éʬΥ¤µ¤ì¤ë¡£ +.PP +.SH ÊÖ¤êÃÍ +.BR shmat () +¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¡¢ +Éղ䵤줿¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Î¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.I (void\ *)\ \-1 +¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤Î¸¶°ø¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ + +.BR shmdt () +¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤Î¸¶°ø¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.BR shmat () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ë°Ê²¼¤ÎÃͤΤɤ줫¤òÀßÄꤷ¤ÆÊÖ¤¹: +.TP +.B EACCES +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ËÍ׵ᤵ¤ì¤¿¼ïÎà¤ÎÉղäËɬÍפʵö²Ä¤¬¤Ê¤¯¡¢ +.B CAP_IPC_OWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¤Ê¤¤¡£ +.TP +.B EINVAL +.I shmid +¤ÎÃͤ¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.I shmaddr +¤ÎÃͤ¬¶­³¦°ãÈ¿ (unaligned) (¤Ä¤Þ¤ê¡¢¥Ú¡¼¥¸¶­³¦¤Ë¹ç¤Ã¤Æ¤ª¤é¤º¡¢ +\fBSHM_RND\fP ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Þ¤¿¤Ï +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.I shmaddr +¤Ø¤Î¥»¥°¥á¥ó¥È¤ÎÉղä˼ºÇÔ¤·¤¿¡£ +¤Þ¤¿¤Ï +.B SHM_REMAP +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤¬¡¢ +.I shmaddr +¤¬ NULL ¤Ç¤¢¤Ã¤¿¡£ +.TP +.B ENOMEM +¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ (descriptor) ¤ä¥Ú¡¼¥¸¡¦¥Æ¡¼¥Ö¥ë¤Î¤¿¤á¤Î¥á¥â¥ê¤ò +³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.PP +.BR shmdt () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.B EINVAL +¤Ï°Ê²¼¤Î¤è¤¦¤Ë¥»¥Ã¥È¤µ¤ì¤ë: +.TP +.B EINVAL +.I shmaddr +¤ËÉղ䵤줿¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤¬Â¸ºß¤·¤Ê¤¤¡£ +¤â¤·¤¯¤Ï¡¢ +.\" ¤³¤Á¤é¤Ï 2.6.17-rc1 °Ê¹ß¤Î¾ì¹ç¤À¤±¡£ +.I shmaddr +¤¬¥Ú¡¼¥¸¶­³¦¤Ë¹ç¤Ã¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.\" SVr4 ¤Ë¤Ï¾¤Ë EMFILE ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ + +SVID 3 ¤Ç (¤¿¤Ö¤ó¤½¤ì¤è¤êÁ°¤À¤È»×¤¦¤¬) +\fIshmaddr\fP °ú¤­¿ô¤Î·¿¤Ï +.I "char *" +¤«¤é +.I "const void *" +¤Ë¡¢\fIshmat\fP() ¤ÎÊÖ¤êÃͤη¿¤Ï +.I "char *" +¤«¤é +.I "void *" +¤ËÊѹ¹¤µ¤ì¤¿ +(Linux ¤Ç¤Ï libc4 ¤È libc5 ¤Î¥×¥í¥È¥¿¥¤¥×¤Ï +.I "char *" +¤Ç¤¢¤ê¡¢glibc2 ¤Î¥×¥í¥È¥¿¥¤¥×¤Ï +.I "void *" +¤Ç¤¢¤ë)¡£ +.SH Ãí°Õ +¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤òÉղ乤ë¾ì¹ç¤Î°Ü¿¢À­¤Î¹â¤¤ÊýË¡¤È¤·¤Æ¤Ï¡¢ +.I shmaddr +¤ò NULL ¤Ë¤·¤Æ +.BR shmat () +¤ò»ÈÍѤ¹¤ë¤Î¤¬¤è¤¤¡£ +¤³¤Î¤è¤¦¤ÊÊýË¡¤ÇÉղ䵤ì¤ë¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤Ï¡¢ +¥×¥í¥»¥¹¤¬°Û¤Ê¤ì¤ÐÊ̤Υ¢¥É¥ì¥¹¤ËÉղ䵤ì¤ë¡¢¤È¤¤¤¦ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤è¤Ã¤Æ¶¦Í­¥á¥â¥êÆâ¤Ç´ÉÍý¤µ¤ì¤ë¥Ý¥¤¥ó¥¿¤Ï¡¢ +ÀäÂÐ¥¢¥É¥ì¥¹¤Ç¤Ï¤Ê¤¯¡¢ +(°ìÈÌŪ¤Ë¤Ï¥»¥°¥á¥ó¥È¤Î³«»Ï¥¢¥É¥ì¥¹¤«¤é¤Î) +ÁêÂÐ¥¢¥É¥ì¥¹¤ÇºîÀ®¤¹¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +Linux ¤Ç¤Ï¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤Ë´û¤Ëºï½ü¥Þ¡¼¥¯¤¬ÉÕ¤±¤é¤ì¤Æ¤¤¤Æ¤â¡¢ +¤½¤Î¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤òÉղ乤뤳¤È¤¬¤Ç¤­¤ë¡£ +¤·¤«¤· POSIX.1-2001 ¤Ç¤Ï¤³¤Î¤è¤¦¤ÊÆ°ºî¤ò»ØÄꤷ¤Æ¤ª¤é¤º¡¢ +¾¤Î¿¤¯¤Î¼ÂÁõ¤â¤³¤ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.LP +°Ê²¼¤Î¥·¥¹¥Æ¥à¡¦¥Ñ¥é¥á¡¼¥¿¡¼¤Ï¡¢ +.BR shmat () +¤Ë±Æ¶Á¤¹¤ë: +.TP +.\" FIXME A good explanation of the rationale for the existence +.\" of SHMLBA would be useful here +.B SHMLBA +¥»¥°¥á¥ó¥È¤Î¶­³¦¥¢¥É¥ì¥¹¤ÎºÇ¾®ÇÜ¿ô¡£¥Ú¡¼¥¸¶­³¦¤Ë¹ç¤Ã¤Æ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï +.B SHMLBA +¤ÎÃÍ¤Ï +.B PAGE_SIZE +¤Ç¤¢¤ë¡£ +.\" FIXME That last sentence isn't true for all Linux +.\" architectures (i.e., SHMLBA != PAGE_SIZE for some architectures) +.\" -- MTK, Nov 04 +.PP +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢¥×¥í¥»¥¹¤´¤È¤Î +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ÎºÇÂç¿ô +.RB ( SHMSEG ) +¤Ë´Ø¤¹¤ë¼ÂÁõ°Í¸¤ÎÀ©¸Â¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR brk (2), +.BR mmap (2), +.BR shmctl (2), +.BR shmget (2), +.BR capabilities (7), +.BR shm_overview (7), +.BR svipc (7) diff --git a/release/man2/shutdown.2 b/release/man2/shutdown.2 new file mode 100644 index 00000000..2f9d3aad --- /dev/null +++ b/release/man2/shutdown.2 @@ -0,0 +1,103 @@ +.\" 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. +.\" +.\" $Id: shutdown.2,v 1.2 2000/01/13 20:14:06 argrath Exp $ +.\" +.\" Modified Sat Jul 24 09:57:55 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Tue Oct 22 22:04:51 1996 by Eric S. Raymond +.\" Modified 1998 by Andi Kleen +.\" +.\" Japanese Version Copyright (c) 1996 Takeshi Hakamata +.\" all rights reserved. +.\" Translated into Japanese Fri Jul 5 14:02:15 1996 +.\" by Takeshi Hakamata (a93sj077@j.dendai.ac.jp) +.\" Modified Wed Nov 5 22:16:28 JST 1997 +.\" by HANATAKA Shinya (hanataka@abyss.rim.or.jp) +.\" Updated Mon Jan 13 01:03:18 JST 2000 by Kentaro Shirakata +.\" Updated Mon Oct 15 03:22:24 JST 2001 by Kentaro Shirakata +.\" +.TH SHUTDOWN 2 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +shutdown \- Á´Æó½ÅÀܳ¤Î°ìÉô¤òÊĤ¸¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int shutdown(int " sockfd ", int " how ); +.SH ÀâÌÀ +.BR shutdown () +¤Ï¡¢ +.I sockfd +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¤Ë¤è¤ëÁ´Æó½ÅÀܳ (full-duplex connection) +¤Î°ìÉô¤Þ¤¿¤ÏÁ´¤Æ¤òÊĤ¸¤ë¡£ +.I how +¤¬ +.B SHUT_RD +¤Ê¤é¤Ð¡¢¤½¤ì°Ê¹ß¤Î¼õ¿®¤ò¶Ø»ß¤¹¤ë¡£ +.I how +¤¬ +.B SHUT_WR +¤Ê¤é¤Ð¡¢¤½¤ì°Ê¹ß¤ÎÁ÷¿®¤ò¶Ø»ß¤¹¤ë¡£ +.I how +¤¬ +.B SHUT_RDWR +¤Ê¤é¤Ð¡¢¤½¤ì°Ê¹ß¤ÎÁ÷¼õ¿®¤ò¶Ø»ß¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I sockfd +¤¬Í­¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ê¤¤¡£ +.TP +.B ENOTCONN +»ØÄꤵ¤ì¤¿¥½¥±¥Ã¥È¤ÏÀܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTSOCK +.I sockfd +¤¬¥½¥±¥Ã¥È¤Ç¤Ê¤¯¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2001, 4.4BSD +.RB ( shutdown () +´Ø¿ô¥³¡¼¥ë¤Ï 4.2BSD ¤Ç½é¤á¤ÆÅо줷¤¿)¡£ +.SH Ãí°Õ +.BR SHUT_RD , +.BR SHUT_WR , +.B SHUT_RDWR +¤Î³ÆÄê¿ô (¤½¤ì¤¾¤ì 0, 1, 2 ¤ÎÃͤò»ý¤Ä) ¤Ï +glibc-2.1.91 °Ê¹ß¡¢ +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR connect (2), +.BR socket (2), +.BR socket (7) diff --git a/release/man2/sigaction.2 b/release/man2/sigaction.2 new file mode 100644 index 00000000..bd64daf9 --- /dev/null +++ b/release/man2/sigaction.2 @@ -0,0 +1,726 @@ +'\" t +.\" Copyright (c) 1994,1995 Mike Battersby +.\" and Copyright 2004, 2005 Michael Kerrisk +.\" based on work by faith@cs.unc.edu +.\" +.\" 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, aeb, 960424 +.\" Modified Fri Jan 31 17:31:20 1997 by Eric S. Raymond +.\" Modified Thu Nov 26 02:12:45 1998 by aeb - add SIGCHLD stuff. +.\" Modified Sat May 8 17:40:19 1999 by Matthew Wilcox +.\" add POSIX.1b signals +.\" Modified Sat Dec 29 01:44:52 2001 by Evan Jones +.\" SA_ONSTACK +.\" Modified 2004-11-11 by Michael Kerrisk +.\" Added mention of SIGCONT under SA_NOCLDSTOP +.\" Added SA_NOCLDWAIT +.\" Modified 2004-11-17 by Michael Kerrisk +.\" Updated discussion for POSIX.1-2001 and SIGCHLD and sa_flags. +.\" Formatting fixes +.\" 2004-12-09, mtk, added SI_TKILL + other minor changes +.\" 2005-09-15, mtk, split sigpending(), sigprocmask(), sigsuspend() +.\" out of this page into separate pages. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya all rights reserved. +.\" Translated 1997-03-03, HANATAKA Shinya +.\" Modified 2000-10-02, HANATAKA Shinya +.\" Modified 2001-10-18, Akihiro MOTOKI +.\" Updated 2005-03-15, Akihiro MOTOKI +.\" Updated 2005-10-05, Akihiro MOTOKI +.\" Updated 2007-09-08, Akihiro MOTOKI, LDP v2.64 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24 +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: process ¥×¥í¥»¥¹ +.\"WORD: signal handler ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é +.\"WORD: pointer ¥Ý¥¤¥ó¥¿¡¼ +.\"WORD: mask ¥Þ¥¹¥¯ +.\"WORD: block ¶Ø»ß(block) +.\"WORD: suspend Ää»ß(suspend) +.\"WORD: stop Ää»ß(stop) +.\"WORD: catch Êá³Í(catch) +.\"WORD: architecture ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¡¼ +.\"WORD: compatible ¸ß´¹À­ +.\"WORD: pottable °Ü¿¢À­ +.\" +.TH SIGACTION 2 2009-07-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sigaction \- ¥·¥°¥Ê¥ë¤ÎÆ°ºî¤Î³Îǧ¤ÈÊѹ¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sigaction(int " signum ", const struct sigaction *" act , +.BI " struct sigaction *" oldact ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR sigaction (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +.BR sigaction () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ÆÃÄê¤Î¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤¿ºÝ¤Î +¥×¥í¥»¥¹¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë +(¥·¥°¥Ê¥ë¤Î³µÍפˤĤ¤¤Æ¤Ï +.BR signal (7) +¤ò»²¾È)¡£ +.PP +.I signum +¤Ë¤Ï¡¢ +.B SIGKILL +¤È +.B SIGSTOP +°Ê³°¤ÎÍ­¸ú¤Ê¥·¥°¥Ê¥ë¤ò¤É¤ì¤Ç¤â»ØÄê¤Ç¤­¤ë¡£ +.PP +.I act +¤¬ NULL °Ê³°¤Ç¤¢¤ì¤Ð¡¢¥·¥°¥Ê¥ë +.I signum +¤Î¿·¤·¤¤Æ°ºî (action) ¤È¤·¤Æ +.I act +¤¬ÀßÄꤵ¤ì¤ë¡£ +.I oldact +¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢º£¤Þ¤Ç¤ÎÆ°ºî¤¬ +.I oldact +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.PP +.I sigaction +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤Ê´¶¤¸¤ËÄêµÁ¤µ¤ì¤ë¡£ +.sp +.in +4n +.nf +struct sigaction { + void (*sa_handler)(int); + void (*sa_sigaction)(int, siginfo_t *, void *); + sigset_t sa_mask; + int sa_flags; + void (*sa_restorer)(void); +}; +.fi +.in +.PP +¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤è¤Ã¤Æ¤Ï¶¦ÍÑÂÎ (union) ¤¬ÍѤ¤¤é¤ì¤Æ¤ª¤ê¡¢¤½¤Î¾ì¹ç¤Ë¤Ï +.I sa_handler +¤È +.I sa_sigaction +¤ÎξÊý¤òƱ»þ¤Ë³ä¤êÅö¤Æ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.PP +.I sa_restorer +Í×ÁǤÏÇÑ»ßͽÄê¤Ç¤¢¤ê»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +POSIX ¤Ë¤Ï +.I sa_restorer +Í×ÁǤ˴ؤ¹¤ëµ¬Äê¤Ï¤Ê¤¤¡£ +.PP +.I sa_handler +¤Ï +.I signum +¤ËÂбþ¤¹¤ëÆ°ºî¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤ò¹Ô¤¦ +.BR SIG_DFL ¡¢ +¤½¤Î¥·¥°¥Ê¥ë¤ò̵»ë¤¹¤ë +.BR SIG_IGN ¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬ÀßÄê¤Ç¤­¤ë¡£ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Î°ú¤­¿ô¤Ï°ì¤Ä¤Ç¤¢¤ê¡¢¥·¥°¥Ê¥ëÈֹ椬°ú¤­¿ô¤È¤·¤Æ +ÅϤµ¤ì¤ë¡£ +.PP +.I sa_flags +¤Ë +.B SA_SIGINFO +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.RI ( sa_handler +¤Ç¤Ï¤Ê¤¯) +.I sa_sigaction +¤Ë¤è¤ê +.I signum +¤ËÂбþ¤¹¤ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥ë´Ø¿ô¤¬»ØÄꤵ¤ì¤ë¡£ +»ØÄꤵ¤ì¤ë´Ø¿ô¤Ï¡¢ºÇ½é¤Î°ú¤­¿ô¤È¤·¤Æ¥·¥°¥Ê¥ëÈÖ¹æ¤ò¡¢ +ÆóÈÖÌܤΰú¤­¿ô¤È¤·¤Æ +.I siginfo_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò¡¢»°ÈÖÌܤΰú¤­¿ô¤È¤·¤Æ (\fIvoid\ *\fP ¤Ë¥­¥ã¥¹¥È¤·¤¿) +.I ucontext_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò¼õ¤±¤È¤ë¡£ +.PP +.I sa_mask +¤Ï¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¼Â¹ÔÃæ¤Ë¶Ø»ß (block) ¤¹¤Ù¤­¥·¥°¥Ê¥ë¤Î¥Þ¥¹¥¯¤ò»ØÄꤹ¤ë +(¥Ï¥ó¥É¥é¼Â¹ÔÃæ¤Î¥·¥°¥Ê¥ë¤Î¶Ø»ß¤Ï¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤¿¥¹¥ì¥Ã¥É +¤Î¥·¥°¥Ê¥ë¤Î¥Þ¥¹¥¯¤ËÄɲ乤뤳¤È¤Ç¹Ô¤ï¤ì¤ë)¡£ +¤µ¤é¤Ë¡¢ +.B SA_NODEFER +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ï¥ó¥É¥é¤òµ¯Æ°¤¹¤ë¤­¤Ã¤«¤±¤È¤Ê¤ë +¥·¥°¥Ê¥ë¤Ë¤â +.I sa_mask +¤¬Å¬ÍѤµ¤ì¤ë¡£ +.PP +.I sa_flags +¤Ï¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¤¿¤á¤Î¥Õ¥é¥°¤Î½¸¹ç¤ò»ØÄꤹ¤ë¡£ +.I sa_flags +¤Ë¤Ï¡¢°Ê²¼¤Ë¼¨¤¹¥Õ¥é¥°¤Î (0 ¸Ä°Ê¾å¤Î) ÏÀÍýϤò¤È¤Ã¤¿¤â¤Î¤ò»ØÄꤹ¤ë¡£ +.RS 4 +.TP +.B SA_NOCLDSTOP +.I signum +¤¬ +.B SIGCHLD +¤Î¾ì¹ç¡¢ +»Ò¥×¥í¥»¥¹¤¬Ää»ß¤·¤¿¤ê +(»Ò¥×¥í¥»¥¹¤¬ +.BR SIGSTOP ", " SIGTSTP ", " SIGTTIN ", " SIGTTOU +¤ò¼õ¤±¤¿¤È¤­) ºÆ³«¤·¤¿¤ê (»Ò¥×¥í¥»¥¹¤¬ +.B SIGCONT +¤ò¼õ¤±¤¿¤È¤­) ¤·¤¿¤È¤­¤Ë +.B SIGCHLD +¤ÎÄÌÃΤò¼õ¤±¤Ê¤¤¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢ +.B SIGCHLD +¤ËÂФ·¤Æ¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +.TP +.BR SA_NOCLDWAIT " (Linux 2.6 °Ê¹ß)" +(Linux 2.6 °Ê¹ß) +.\" Àµ³Î¤Ë¤Ï Linux 2.5.60 °Ê¹ß -- MTK +.I signum +¤¬ +.B SIGCHLD +¤Î¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¤È¤­¤Ë +»Ò¥×¥í¥»¥¹¤ò¥¾¥ó¥Ó¥×¥í¥»¥¹¤ËÊѲ½¤µ¤»¤Ê¤¤ +.RB ( waitpid (2) +¤â»²¾È)¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢ +.B SIGCHLD +¤ËÂФ·¤Æ¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¡¢¤â¤·¤¯¤Ï¤½¤Î¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤ò +.B SIG_DFL +¤ËÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ + +.BR SIGCHLD +¤ËÂФ·¤Æ¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë +.B SA_NOCLDWAIT +¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¤¿¾ì¹ç¡¢ +»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿ºÝ¤Ë +.B SIGCHLD +¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤ë¤«¤É¤¦¤«¤Ï¡¢ +POSIX.1 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +Linux ¤Ç¤Ï¡¢¤³¤Î¾õ¶·¤Ç +.B SIGCHLD +¥·¥°¥Ê¥ë¤ÏÀ¸À®¤µ¤ì¤ë¡£ +¤¤¤¯¤Ä¤«¤Î¾¤Î¼ÂÁõ¤Ç¤ÏÀ¸À®¤µ¤ì¤Ê¤¤¡£ +.TP +.B SA_NODEFER +¤½¤ì¼«¿È¤Î¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¡¼¤ÎÆâÉô¤Ë¤¤¤ë»þ¤Ç¤â +¤½¤Î¥·¥°¥Ê¥ë¤ò¥Þ¥¹¥¯¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +.B SA_NOMASK +¤Ï¤³¤Î¥Õ¥é¥°¤ÈƱ¤¸°ÕÌ£¤À¤¬¡¢Çѻߤµ¤ì¤Æ¤ª¤ê¡¢Èóɸ½à¤Ç¤¢¤ë¡£ +.TP +.B SA_ONSTACK +.BR sigaltstack (2) +¤ÇÄ󶡤µ¤ì¤ëÊ̤Υ·¥°¥Ê¥ë¡¦¥¹¥¿¥Ã¥¯¤Ç¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò¸Æ¤Ó½Ð¤¹¡£ +Ê̤Υ·¥°¥Ê¥ë¡¦¥¹¥¿¥Ã¥¯¤¬ÍøÍѲÄǽ¤Ç¤Ê¤±¤ì¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥¹¥¿¥Ã¥¯¤¬ +»ÈÍѤµ¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +.TP +.BR SA_RESETHAND +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬¸Æ¤Ð¤ì¤ëÅ٤ˡ¢¥·¥°¥Ê¥ë¤ÎÆ°ºî¤ò¥Ç¥Õ¥©¥ë¥È¤ËÌ᤹¡£ +¤³¤Î¥Õ¥é¥°¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +.B SA_ONESHOT +¤Ï¤³¤Î¥Õ¥é¥°¤ÈƱ¤¸°ÕÌ£¤À¤¬¡¢Çѻߤµ¤ì¤Æ¤ª¤ê¡¢Èóɸ½à¤Ç¤¢¤ë¡£ +.TP +.B SA_RESTART +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¥·¥°¥Ê¥ë¤ÎÄÌÃΤÎÁ°¸å¤ÇºÆ³«¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Æ¡¢ +BSD ¥·¥°¥Ê¥ëÊý¼° (semantics) ¤È¸ß´¹À­¤Î¤¢¤ëÆ°ºî¤òÄ󶡤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +.BR signal (7) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎºÆ³«¤Ë´Ø¤¹¤ëµÄÏÀ¤ò»²¾È¤Î¤³¤È¡£ +.TP +.BR SA_SIGINFO " (Linux 2.2 °Ê¹ß)" +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ï°ì¤Ä¤Ç¤Ï¤Ê¤¯¡¢»°¤Ä¤Î°ú¤­¿ô¤ò»ý¤Ä¡£¤³¤Î¾ì¹ç¤Ï +.I sa_handler +¤Î¤«¤ï¤ê¤Ë +.I sa_sigaction +¤òÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +¤³¤Î¥Õ¥é¥°¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Ë¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +.\" .RI ( sa_sigaction +.\" ¥Õ¥£¡¼¥ë¥É¤Ï Linux 2.1.86 ¤ÇÄɲ䵤줿)¡£ +.RE +.PP +.I sa_sigaction +¤Î¥Ñ¥é¥á¡¼¥¿ +.I siginfo_t +¤Ï°Ê²¼¤ÎÍ×ÁǤò»ý¤Ä¹½Â¤ÂΤǤ¢¤ë: +.sp +.in +4n +.nf +siginfo_t { + int si_signo; /* Signal number */ + int si_errno; /* An errno value */ + int si_code; /* Signal code */ + int si_trapno; /* Trap number that caused + hardware-generated signal + (unused on most architectures) */ +.\" FIXME +.\" si_trapno seems to be only used on SPARC and Alpha; +.\" this page could use a little more detail on its purpose there. + pid_t si_pid; /* Sending process ID */ + uid_t si_uid; /* Real user ID of sending process */ + int si_status; /* Exit value or signal */ + clock_t si_utime; /* User time consumed */ + clock_t si_stime; /* System time consumed */ + sigval_t si_value; /* Signal value */ + int si_int; /* POSIX.1b signal */ + void *si_ptr; /* POSIX.1b signal */ + int si_overrun; /* Timer overrun count; POSIX.1b timers */ + int si_timerid; /* Timer ID; POSIX.1b timers */ +.\" In the kernel: si_tid + void *si_addr; /* Memory location which caused fault */ + int si_band; /* Band event */ + int si_fd; /* File descriptor */ +} +.fi +.in + +.IR si_signo ", " si_errno ", " si_code +¤ÏÁ´¤Æ¤Î¥·¥°¥Ê¥ë¤ËÂФ·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë +.RI ( si_errno +¤Ï Linux ¤Ç¤Ï°ìÈÌŪ¤Ë¤Ï»ÈÍѤµ¤ì¤Ê¤¤)¡£ +¹½Â¤ÂΤλĤê¤ÎÉôʬ¤Ï¡¢¶¦ÍÑÂÎ (union) ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤½¤Î¾ì¹ç¤Ï³ºÅö¤¹¤ë¥·¥°¥Ê¥ë¤Ë¤ª¤¤¤Æ°ÕÌ£¤Î¤¢¤ë¥Õ¥£¡¼¥ë¥É¤Î¤ß¤òÆɤ߹þ¤à +¤³¤È¤¬¤Ç¤­¤ë¡£ +.IP * 2 +POSIX.1b ¥·¥°¥Ê¥ë¤È +.B SIGCHLD +¤Ï +.IR si_pid " ¤È " si_uid +¤òÀßÄꤹ¤ë¡£ +.IP * +POSIX.1b ¥¿¥¤¥Þ (Linux 2.6 °Ê¹ß) ¤Ï +.I si_overrun +¤È +.I si_timerid +¤òÀßÄꤹ¤ë¡£ +.I si_timerid +¥Õ¥£¡¼¥ë¥É¤Ï¥«¡¼¥Í¥ë¤¬¥¿¥¤¥Þ¤òÆÃÄꤹ¤ë¤Î¤Ë»ÈÍѤ¹¤ëÆâÉô ID ¤Ç¤¢¤ê¡¢ +.BR timer_create (2) +¤¬ÊÖ¤¹¥¿¥¤¥Þ ID ¤ÈƱ¤¸¤Ç¤Ï¤Ê¤¤¡£ +.IP * +.B SIGCHLD +¤Ï +.IR si_status ", " si_utime ", " si_stime +¤òÀßÄꤹ¤ë¡£ +.RB ( getrusage (2) +¤ä +.BR time (2) +¤È°Û¤Ê¤ê) ¥Õ¥£¡¼¥ë¥É +.I si_utime +¤È +.I si_stime +¤Ë¤Ï wait ÂÔ¤Á¤Î»Ò¥×¥í¥»¥¹¤Ë¤è¤ê»ÈÍѤµ¤ì¤¿»þ´Ö¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +2.6 ¤è¤êÁ°¤È 2.6.27 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ë³ÊǼ¤µ¤ì¤ë CPU »þ´Ö¤Îñ°Ì¤Ï +.I sysconf(_SC_CLK_TCK) +¤Ç¤¢¤ë¡£ +2.6.27 ¤è¤êÁ°¤Î 2.6 ·Ï¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥Ð¥°¤¬¤¢¤ê¡¢ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Î CPU »þ´Ö¤Îñ°Ì¤¬ +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Õ¥£¥°¤Ç»ØÄꤵ¤ì¤ë) ¥·¥¹¥Æ¥à¤Î jiffy ¤Ç¤¢¤Ã¤¿ +.RB ( time (7) +»²¾È)¡£ +.\" FIXME . +.\" When si_utime and si_stime where originally implemented, the +.\" measurement unit was HZ, which was the same as clock ticks +.\" (sysconf(_SC_CLK_TCK)). In 2.6, HZ became configurable, and +.\" was *still* used as the unit to return the info these fields, +.\" with the result that the field values depended on the the +.\" configured HZ. Of course, the should have been measured in +.\" USER_HZ instead, so that sysconf(_SC_CLK_TCK) could be used to +.\" convert to seconds. I have a queued patch to fix this: +.\" http://thread.gmane.org/gmane.linux.kernel/698061/ . +.\" This patch made it into 2.6.27. +.\" But note that these fields still don't return the times of +.\" waited-for children (as is done by getrusage() and times() +.\" and wait4()). Solaris 8 does include child times. +.IP * +.IR si_int " ¤È " si_ptr +¤Ï POSIX.1b ¥·¥°¥Ê¥ë¤ÎÁ÷¿®¼Ô¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤ë¡£ +¾ÜºÙ¤Ï +.BR sigqueue (2) +¤ò»²¾È¤Î¤³¤È¡£ +.IP * +.BR SIGILL , +.BR SIGFPE , +.BR SIGSEGV , +.B SIGBUS +¤Ï +.I si_addr +¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¥¢¥É¥ì¥¹¤òÀßÄꤹ¤ë¡£ +SIGPOLL ¤Ï +.IR si_band " ¤È " si_fd +¤òÀßÄꤹ¤ë¡£ +.PP +.I si_code +¤Ï¡¢¤½¤Î¥·¥°¥Ê¥ë¤¬Á÷¿®¤µ¤ì¤¿Íýͳ¤ò¼¨¤¹ÃͤǤ¢¤ë (¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤Ï¤Ê¤¤)¡£ +°Ê²¼¤Î¥ê¥¹¥È¤Ë¡¢¤É¤Î¥·¥°¥Ê¥ë¤Î¾ì¹ç¤Ç¤â +.I si_code +¤ËÆþ¤ê¤¦¤ëÃͤò¡¢¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤¿Íýͳ¤È¤È¤â¤Ëµ­ºÜ¤¹¤ë¡£ +.RS 4 +.TP 15 +.B SI_USER +.BR kill (2) +¤Þ¤¿¤Ï +.BR raise (3) +.TP +.B SI_KERNEL +¥«¡¼¥Í¥ë¤Ë¤è¤êÁ÷¿®¤µ¤ì¤¿ +.TP +.B SI_QUEUE +.BR sigqueue (2) +.TP +.B SI_TIMER +POSIX ¥¿¥¤¥Þ¤¬Ëþλ¤·¤¿ +.TP +.B SI_MESGQ +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¾õÂÖ¤¬ÊѲ½¤·¤¿ (Linux 2.6.6 °Ê¹ß)¡£ +.BR mq_notify (3) »²¾È¡£ +.TP +.B SI_ASYNCIO +ÈóƱ´ü IO (AIO) ¤¬´°Î»¤·¤¿ +.TP +.B SI_SIGIO +¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤¿ SIGIO +.TP +.B SI_TKILL +.BR tkill (2) +¤Þ¤¿¤Ï +.BR tgkill (2) +(Linux 2.4.19 °Ê¹ß) +.\" SI_DETHREAD is defined in 2.6.9 sources, but isn't implemented +.\" It appears to have been an idea that was tried during 2.5.6 +.\" through to 2.5.24 and then was backed out. +.RE +.PP +.B SIGILL +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B ILL_ILLOPC +ÉÔÀµ¤ÊÌ¿Îᥳ¡¼¥É (opcode) +.TP +.B ILL_ILLOPN +ÉÔÀµ¤Ê¥ª¥Ú¥é¥ó¥É +.TP +.B ILL_ILLADR +ÉÔÀµ¤Ê¥¢¥É¥ì¥Ã¥·¥ó¥°¥â¡¼¥É +.TP +.B ILL_ILLTRP +ÉÔÀµ¤Ê¥È¥é¥Ã¥× +.TP +.B ILL_PRVOPC +Æø¢¤¬É¬ÍפÊÌ¿Îᥳ¡¼¥É (opcode) +.TP +.B ILL_PRVREG +Æø¢¤¬É¬Íפʥ쥸¥¹¥¿ +.TP +.B ILL_COPROC +¥³¥×¥í¥»¥Ã¥µ¤Î¥¨¥é¡¼ +.TP +.B ILL_BADSTK +ÆâÉô¥¹¥¿¥Ã¥¯¥¨¥é¡¼ +.RE +.PP +.B SIGFPE +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B FPE_INTDIV +À°¿ô¤Î 0 ¤Ë¤è¤ë½ü»» +.TP +.B FPE_INTOVF +À°¿ô¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.TP +.B FPE_FLTDIV +ÉâÆ°¾®¿ôÅÀ¤Î 0 ¤Ë¤è¤ë½ü»» +.TP +.B FPE_FLTOVF +ÉâÆ°¾®¿ôÅÀ¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.TP +.B FPE_FLTUND +ÉâÆ°¾®¿ôÅÀ¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.TP +.B FPE_FLTRES +ÉâÆ°¾®¿ôÅÀ¤ÎÉÔÀµ³Î¤Ê±é»»·ë²Ì (inexact result) +.TP +.B FPE_FLTINV +ÉâÆ°¾®¿ôÅÀ¤ÎÉÔÀµ¤ÊÁàºî +.TP +.B FPE_FLTSUB +Èϰϳ°¤Îź»ú (subscript) +.RE +.PP +.B SIGSEGV +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B SEGV_MAPERR +¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤Æ¤¤¤Ê¤¤¥¢¥É¥ì¥¹ +.TP +.B SEGV_ACCERR +¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ¹¤ë¥¢¥¯¥»¥¹µö²Ä¤¬¤Ê¤¤ +.RE +.PP +.B SIGBUS +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B BUS_ADRALN +ÉÔÀµ¤Ê¥¢¥É¥ì¥¹¡¦¥¢¥é¥¤¥á¥ó¥È (alignment) +.TP +.B BUS_ADRERR +¸ºß¤·¤Ê¤¤ÊªÍý¥¢¥É¥ì¥¹ +.TP +.B BUS_OBJERR +¥ª¥Ö¥¸¥§¥¯¥È¸ÇÍ­¤Î¥Ï¡¼¥É¥¦¥§¥¢¥¨¥é¡¼ +.RE +.PP +.B SIGTRAP +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B TRAP_BRKPT +¥×¥í¥»¥¹¤Î¥Ö¥ì¡¼¥¯¥Ý¥¤¥ó¥È +.TP +.B TRAP_TRACE +¥×¥í¥»¥¹¤Î¥È¥ì¡¼¥¹¡¦¥È¥é¥Ã¥× +.RE +.PP +.B SIGCHLD +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B CLD_EXITED +»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿ (exited) +.TP +.B CLD_KILLED +»Ò¥×¥í¥»¥¹¤¬ kill ¤µ¤ì¤¿ +.TP +.B CLD_DUMPED +»Ò¥×¥í¥»¥¹¤¬°Û¾ï½ªÎ»¤·¤¿ +.TP +.B CLD_TRAPPED +¥È¥ì¡¼¥¹ÂÐ¾Ý¤Î»Ò¥×¥í¥»¥¹¤¬¥È¥é¥Ã¥×¤ò¾å¤²¤¿ +.TP +.B CLD_STOPPED +»Ò¥×¥í¥»¥¹¤¬Ää»ß (stop) ¤·¤¿ +.TP +.B CLD_CONTINUED +Ää»ß¤·¤Æ¤¤¤¿»Ò¥×¥í¥»¥¹¤¬ºÆ³«¤·¤¿ (Linux 2.6.9 °Ê¹ß) +.RE +.PP +.B SIGPOLL +¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢ +.I si_code +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë: +.RS 4 +.TP 15 +.B POLL_IN +ÆþÎϥǡ¼¥¿¤¬ÍøÍѲÄǽ +.TP +.B POLL_OUT +½ÐÎϥХåե¡¤¬ÍøÍѲÄǽ +.TP +.B POLL_MSG +ÆþÎÏ¥á¥Ã¥»¡¼¥¸¤¬ÍøÍѲÄǽ +.TP +.B POLL_ERR +I/O ¥¨¥é¡¼ +.TP +.B POLL_PRI +¹âÍ¥Àè¤ÎÆþÎϤ¬ÍøÍѲÄǽ +.TP +.B POLL_HUP +¥Ç¥Ð¥¤¥¹¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤ +.RE +.SH ÊÖ¤êÃÍ +.BR sigaction () +¤ÏÀ®¸ù¤¹¤ì¤Ð 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤Ê¤é¤Ð \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.IR act " ¤« " oldact +¤¬»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤¬Àµ¤·¤¤¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤Ê¤¤¡£ +.TP +.B EINVAL +̵¸ú¤Ê¥·¥°¥Ê¥ë¤¬»ØÄꤵ¤ì¤¿¡£Êä­ (catch) ¤·¤¿¤ê̵»ë¤·¤¿¤ê¤Ç¤­¤Ê¤¤ +¥·¥°¥Ê¥ë¤Ç¤¢¤ë +.BR SIGKILL " ¤ä " SIGSTOP +¤ËÂФ¹¤ëÆ°ºî¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¤âȯÀ¸¤¹¤ë¡£ +.SH ½àµò +POSIX.1-2001, SVr4. +.\" SVr4 ¤Ë¤Ï EINTR ¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +.BR fork (2) +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Î +¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¡¢¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤µ¤ì¡¢ +̵»ë¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤ÏÊѹ¹¤µ¤ì¤º¤½¤Î¤Þ¤Þ¤È¤Ê¤ë¡£ + +POSIX ¤Ç¤Ï¡¢ +.BR kill (2) +¤ä +.BR raise (3) +´Ø¿ô¤ÇÀ¸À®¤Ç¤­¤Ê¤¤¥·¥°¥Ê¥ë +.BR SIGFPE , +.BR SIGILL , +.B SIGSEGV +¤ò̵»ë (ignore) ¤·¤¿¾ì¹ç¡¢¤½¤Î¸å¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +¥¼¥í¤Ë¤è¤ëÀ°¿ô³ä¤ê»»¤Î·ë²Ì¤Ï̤ÄêµÁ¤È¤Ê¤ë¡£ +¥¢¡¼¥­¥Æ¥¯¥Á¥ã¡¼¤Ë¤è¤Ã¤Æ¤Ï¡¢¤³¤Î¤È¤­ +.B SIGFPE +¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤ë¡£ +(ƱÍͤËÉé¤ÎºÇÂçÀ°¿ô¤ò \-1 ¤Ç³ä¤ë¤È +.B SIGFPE +¤¬À¸À®¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤) +¤³¤Î¥·¥°¥Ê¥ë¤ò̵»ë¤¹¤ë¤È̵¸Â¥ë¡¼¥×¤Ë´Ù¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +POSIX.1-1990 ¤Ç¤Ï +.B SIGCHLD +¤Ë +.B SIG_IGN +¤òÀßÄꤹ¤ë¤³¤È¤òǧ¤á¤Æ¤¤¤Ê¤¤¡£ +POSIX.1-2001 ¤Ç¤Ïǧ¤á¤é¤ì¤Æ¤ª¤ê¡¢ +.B SIGCHLD +¤ò̵»ë¤¹¤ë¤³¤È¤Ç¥¾¥ó¥Ó¥×¥í¥»¥¹¤ÎÀ¸À®¤òËɻߤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.RB ( wait (2) +¤ò»²¾È)¡£ +¤µ¤é¤Ë¡¢BSD ¤È SystemV ¤Ç¤Ï +.B SIGCHLD +¤ò̵»ë¤·¤¿ºÝ¤ÎÆ°ºî¤¬°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤½¤Î¤¿¤á¡¢´°Á´¤Ë°Ü¿¢À­¤¬¤¢¤ëÊýË¡¤Ç¡¢½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤¬¥¾¥ó¥Ó¤Ë¤Ê¤é¤Ê¤¤¤³¤È +¤òÊݾڤ¹¤ë¤Ë¤Ï¡¢ +.B SIGCHLD +¥·¥°¥Ê¥ë¤òÊä­¤·¡¢ +.BR wait (2) +¤Ê¤É¤ò¼Â¹Ô¤¹¤ë¤·¤«¤Ê¤¤¡£ +.PP +POSIX.1-1990 ¤Î»ÅÍÍ¤Ç¤Ï +.B SA_NOCLDSTOP +¤Î¤ß¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï +.BR SA_NOCLDWAIT , +.BR SA_RESETHAND , +.BR SA_NODEFER , +.B SA_SIGINFO +¤¬Äɲ䵤줿¡£ +Unix ¤Î¸Å¤¤¼ÂÁõ¤ÇÆ°¤«¤¹¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¡¢ +¾¤Î +.I sa_flags +¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¤È°Ü¿¢À­¤¬²¼¤¬¤ë¡£ +.PP +.B SA_RESETHAND +¥Õ¥é¥°¤Ï SVr4 ¤ÎƱ¤¸Ì¾Á°¤Î¥Õ¥é¥°¤È¸ß´¹À­¤¬¤¢¤ë¡£ +.PP +.B SA_NODEFER +¥Õ¥é¥°¤Ï 1.3.9 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤ÏƱ¤¸Ì¾Á°¤Î SVr4 ¤Î¥Õ¥é¥°¤È¸ß´¹À­¤¬¤¢¤ë¡£ +¤¾¤ì°ÊÁ°¤Î Linux ¥«¡¼¥Í¥ë¤Î¼ÂÁõ¤Ç¤Ï¡¢¤³¤Î¥Õ¥é¥°¤òÀßÄꤷ¤Æ¤¤¤ë¥·¥°¥Ê¥ë +¤À¤±¤Ç¤Ê¤¯¡¢¤É¤Î¥·¥°¥Ê¥ë¤Ç¤â¼õ¤±¤ë¤³¤È¤òµö¤·¤Æ¤¤¤¿ (¼ÂºÝ¤Ë¤Ï +.I sa_mask +¤ÎÀßÄê¤Ë¤è¤ê̵¸ú¤Ë¤Ç¤­¤ë)¡£ +.PP +.BR sigaction () +¤ÎÆóÈÖÌܤΰú¤­¿ô¤Ë NULL ¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤¹¤È¡¢¸½ºß¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò³Îǧ¤¹¤ë +¤³¤È¤¬¤Ç¤­¤ë¡£¤Þ¤¿¡¢ÆóÈÖÌܤȻ°ÈÖÌܤΰú¤­¿ô¤ò NULL ¤Ë¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢ +»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤¬¸½ºß¤Î¥Þ¥·¥ó¤Ç»È¤¨¤ë¤«¤É¤¦¤«¥Á¥§¥Ã¥¯¤Ç¤­¤ë¡£ +.PP +.B SIGKILL +¤ä +.B SIGSTOP +¤ò +.RI ( sa_mask +¤Ë»ØÄꤷ¤Æ) ¶Ø»ß¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¶Ø»ß¤·¤è¤¦¤È¤·¤Æ¤âÌۤäÆ̵»ë¤µ¤ì¤ë¡£ +.PP +¥·¥°¥Ê¥ë½¸¹ç¤ÎÁàºî¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï +.BR sigsetops (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥éÆ⤫¤é°ÂÁ´¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡¢ +async-signal-safe functions (ÈóƱ´ü¥·¥ó¥°¥ë¤Ç°ÂÁ´¤Ê´Ø¿ô) ¤Î +¥ê¥¹¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR signal (7) +¤ò»²¾È¡£ +.SS Èó¸ø¼° +.B SA_SIGINFO +¤¬Æ³Æþ¤µ¤ì¤ëÁ°¤Ï¡¢ +.I "struct sigcontext" +·¿¤ÎÆóÈÖÌܤΰú¤­¿ô¤È°ì½ï¤Ë +.I sa_handler +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¡¢ +¤¤¤¯¤Ä¤«¤ÎÄɲäξðÊó¤òÆþ¼ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤¿¡£ +¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¥«¡¼¥Í¥ë¥½¡¼¥¹¤Î´ØÏ¢Éôʬ¤ò¸«¤Æ¤Û¤·¤¤¡£ +¸½ºß¤Ï¤³¤Î»ÈÍÑË¡¤ÏÇѻߤµ¤ì¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +2.6.13 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.I sa_flags +¤Ë +.B SA_NODEFER +¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ +¥Ï¥ó¥É¥é¤¬¼Â¹ÔÃæ¤ËÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¼«¿È¤¬¥Þ¥¹¥¯¤µ¤ì¤Ê¤¯¤Ê¤ë¤À¤±¤Ç¤Ê¤¯¡¢ +.I sa_mask +¤Ë»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤â¥Þ¥¹¥¯¤µ¤ì¤Ê¤¯¤Ê¤ë¡£ +¤³¤Î¥Ð¥°¤Ï¡¢¥«¡¼¥Í¥ë 2.6.14 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ +.SH Îã +.BR mprotect (2) +»²¾È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (1), +.BR kill (2), +.BR killpg (2), +.BR pause (2), +.BR sigaltstack (2), +.BR signal (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigqueue (2), +.BR sigsuspend (2), +.BR wait (2), +.BR raise (3), +.BR siginterrupt (3), +.BR sigsetops (3), +.BR sigvec (3), +.BR core (5), +.BR signal (7) diff --git a/release/man2/sigaltstack.2 b/release/man2/sigaltstack.2 new file mode 100644 index 00000000..2d1b2bba --- /dev/null +++ b/release/man2/sigaltstack.2 @@ -0,0 +1,242 @@ +'\" t +.\" Copyright (c) 2001, Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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. +.\" +.\" aeb, various minor fixes +.\" +.\" Japanese Version Copyright (c) 2001 Yuichi SATO +.\" all rights reserved. +.\" Translated 2001-11-04, Yuichi SATO +.\" Updated 2001-12-09, Yuichi SATO +.\" Updated 2005-11-04, Akihiro MOTOKI +.\" Updated 2006-01-04, Akihiro MOTOKI, Catch up to LDP 2.20 +.\" +.\"WORD: alternate signal stack ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯ +.\"WORD: establish (¥¹¥¿¥Ã¥¯¤Î) ³ÎΩ +.\" +.TH SIGALTSTACK 2 2008-10-04 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sigaltstack \- ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Î¥³¥ó¥Æ¥­¥¹¥È¤òÀßÄꡦ¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int sigaltstack(const stack_t *" ss ", stack_t *" oss ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR sigaltstack (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.\" .br +.\" .BR sigstack (): +.\" _BSD_SOURCE || _XOPEN_SOURCE >= 500 +.SH ÀâÌÀ +.BR sigaltstack () +¤ò»È¤¦¤È¡¢ +¥×¥í¥»¥¹¤Ï¿·¤·¤¤ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤òÄêµÁ¤·¤¿¤ê¡¢ +´û¸¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Î¾õÂÖ¤ò¼èÆÀ¤Ç¤­¤ë¡£ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤òÍ׵᤹¤ë¤è¤¦¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¤È +.RB ( sigaction (2) +»²¾È)¡¢¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¤½¤Î¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤¬»È¤ï¤ì¤ë¡£ + +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò»È¤¦ºÝ¤Î°ìÈÌŪ¤Ê¼ê½ç¤Ï¡¢°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.TP 3 +1. +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Ç»È¤¦¥á¥â¥êÎΰè¤ò³ÎÊݤ¹¤ë¡£ +.TP +2. +.BR sigaltstack () +¤ò»È¤Ã¤Æ¡¢ +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Î¸ºß¤È¾ì½ê¤ò¥·¥¹¥Æ¥à¤ËÃΤ餻¤ë¡£ +.TP +3. +.BR sigaction (2) +¤ò»È¤Ã¤Æ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò³ÎΩ¤¹¤ëºÝ¡¢ +\fBSA_ONSTACK\fP ¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¢ +¤½¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¼Â¹Ô¤¹¤ë¤³¤È¤ò +¥·¥¹¥Æ¥à¤ËÃΤ餻¤ë¡£ +.P +\fIss\fP °ú¤­¿ô¤Ï¡¢¿·¤·¤¤¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò»ØÄꤹ¤ë¤¿¤á¤Ë»È¤¦¡£ +¤Þ¤¿ \fIoss\fP °ú¤­¿ô¤Ï¡¢¸½ºß³ÎΩ¤µ¤ì¤Æ¤¤¤ë +¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë»È¤¦¡£ +¤³¤ÎÁàºî¤Î¤¦¤Á 1 ¤Ä¤À¤±¤ò¼Â¹Ô¤µ¤»¤ë¤Ë¤Ï¡¢ +»ÈÍѤ·¤Ê¤¤°ú¤­¿ô¤ò NULL ¤Ë»ØÄꤹ¤ì¤Ð¤è¤¤¡£ +°ú¤­¿ô¤È¤Ê¤ë¹½Â¤ÂΤϡ¢°Ê²¼¤Î¤è¤¦¤Ê·¿¤Ç¤¢¤ë: +.sp +.in +4n +.nf +typedef struct { + void *ss_sp; /* ¥¹¥¿¥Ã¥¯¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹ */ + int ss_flags; /* ¥Õ¥é¥° */ + size_t ss_size; /* ¥¹¥¿¥Ã¥¯¤Î¥Ð¥¤¥È¿ô */ +} stack_t; +.fi +.in + +¿·µ¬¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò³ÎΩ¤¹¤ë¤Ë¤Ï¡¢ +\fIss.ss_flags\fP ¤ò 0 ¤ËÀßÄꤷ¡¢ +\fIss.ss_sp\fP ¤È \fIss.ss_size\fP ¤Ë +¥¹¥¿¥Ã¥¯¤Î³«»Ï¥¢¥É¥ì¥¹¤È¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤ò»ØÄꤹ¤ë¡£ +Äê¿ô \fBSIGSTKSZ\fP ¤Ï¡¢ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤¬Ä̾ïɬÍפ¹¤ë +¥µ¥¤¥º¤è¤ê¤â½¼Ê¬Â礭¤¯ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤Þ¤¿Äê¿ô \fBMINSIGSTKSZ\fP ¤Ï¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¼Â¹Ô¤ËɬÍפʺǾ®¥µ¥¤¥º¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +ÂåÂØ¥¹¥¿¥Ã¥¯¤Ç¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥«¡¼¥Í¥ë¤Ë¤è¤ê¼«Æ°Åª¤Ë¡¢\fIss.ss_sp\fP ¤Ç»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¤Ï +Æ°ºî¤·¤Æ¤¤¤ë¥Ï¡¼¥É¥¦¥§¥¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ËŬ¤·¤¿¥¢¥É¥ì¥¹¶­³¦¤Ë +Ä´À°¤µ¤ì¤ë¡£ + +´û¸¤Î¥¹¥¿¥Ã¥¯¤ò̵¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢ +\fIss.ss_flags\fP ¤ò \fBSS_DISABLE\fP ¤Ë»ØÄꤹ¤ë¡£ +¤³¤Î¾ì¹ç¡¢\fIss\fP ¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤Ï̵»ë¤µ¤ì¤ë¡£ + +\fIoss\fP ¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢ +\fIoss\fP ¤ËÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Î¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤ì¤Ï (¼Â¼ÁŪ¤Ë) +.BR sigaltstack () +¤Î¸Æ¤Ó½Ð¤·¤è¤êÀè¤Ë¹Ô¤ï¤ì¤ë¡£ +\fIoss.ss_sp\fP ¤È \fIoss.ss_size\fP ¥Õ¥£¡¼¥ë¥É¤Ë +¥¹¥¿¥Ã¥¯¤Î³«»Ï¥¢¥É¥ì¥¹¤È¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤¬ÊÖ¤µ¤ì¤ë¡£ +\fIoss.ss_flags\fP ¤Ë¤Ï°Ê²¼¤Î¤É¤Á¤é¤«¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë: +.TP +.B SS_ONSTACK +¥×¥í¥»¥¹¤¬ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë +(¥×¥í¥»¥¹¤¬´û¤Ë¤½¤Î¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¤½¤ì¤ÈƱ¤¸¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Ë¤ÏÊѹ¹¤Ç¤­¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È)¡£ +.TP +.B SS_DISABLE +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤¬¸½ºß̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR sigaltstack () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¤Æ¡¢ +¥¨¥é¡¼¤ò¼¨¤¹ÃÍ¤Ë \fIerrno\fP ¤òÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +\fIss\fP ¤Þ¤¿¤Ï \fIoss\fP ¤Î¤É¤Á¤é¤¬¡¢NULL °Ê³°¤Ç¡¢ +¤«¤Ä¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +\fIss\fP ¤¬ NULL °Ê³°¤Ç¡¢\fIss_flags\fP ¥Õ¥£¡¼¥ë¥É¤¬ +.B SS_DISABLE +°Ê³°¤Î 0 ¤Ç¤Ê¤¤ÃͤˤʤäƤ¤¤ë¡£ +.TP +.B ENOMEM +¿·¤·¤¤ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯ (\fIss.ss_size\fP) ¤Ë»ØÄꤷ¤¿¥µ¥¤¥º¤¬ +\fBMINSTKSZ\fP ¤è¤ê¾®¤µ¤¤¡£ +.TP +.B EPERM +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤¬Í­¸ú¤Ç¤¢¤ë¤È¤­¤ËÊѹ¹¤ò¹Ô¤ª¤¦¤È¤·¤¿ +(¤Ä¤Þ¤ê¡¢¥×¥í¥»¥¹¤¬´û¤Ë¸½ºß¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¼Â¹Ô¤µ¤ì¤Æ¤¤¤¿)¡£ +.SH ½àµò +SUSv2, SVr4, POSIX.1-2001. +.SH Ãí°Õ +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò»ÈÍѤ¹¤ëºÇ¤â¤è¤¯¤¢¤ë¾ìÌ̤ϡ¢ +.B SIGSEGV +¥·¥°¥Ê¥ë¤ò°·¤¦¤È¤­¤Ç¤¢¤ë¡£ +.B SIGSEGV +¤Ï¥×¥í¥»¥¹¤ÎÄ̾ï¤Î¥¹¥¿¥Ã¥¯¤¬ÍøÍѤǤ­¤ë¶õ´Ö¤¬»È¤¤²Ì¤¿¤µ¤ì¤¿ºÝ¤Ë +À¸À®¤µ¤ì¤ë¥·¥°¥Ê¥ë¤Ç¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ +.B SIGSEGV +ÍѤΥ·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò¥×¥í¥»¥¹¤Î¥¹¥¿¥Ã¥¯¾å¤Ç¤Ïµ¯Æ°¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢¤³¤Î¥·¥°¥Ê¥ë¤ò°·¤ª¤¦¤È¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢ +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.P +¥×¥í¥»¥¹¤¬É¸½à¤Î¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò»È¤¤²Ì¤¿¤¹¤³¤È¤¬Í½ÁÛ¤µ¤ì¤ë¾ì¹ç¤Ï¡¢ +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò³ÎΩ¤¹¤ë¤ÈÊØÍø¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢¥¹¥¿¥Ã¥¯¤¬ºÇ¾å°Ì¥¢¥É¥ì¥¹¤«¤é +²¼°Ì¥¢¥É¥ì¥¹Êý¸þ¤ËÈó¾ï¤Ë¤¿¤¯¤µ¤óÀѤޤì¤Æ¤·¤Þ¤¦¤³¤È¤Ç¡¢ +ºÇ²¼°Ì¥¢¥É¥ì¥¹¤«¤é¾å°Ì¥¢¥É¥ì¥¹Êý¸þ¤ËÀѤޤì¤ë¥Ò¡¼¥×¤È¤Ö¤Ä¤«¤Ã¤Æ¤·¤Þ¤¦¾ì¹ç¤ä¡¢ +\fBsetrlimit(RLIMIT_STACK, &rlim)\fP ¤Î¸Æ¤Ó½Ð¤·¤Ç³ÎΩ¤µ¤ì¤¿ +À©¸Â¤Ë㤷¤Æ¤·¤Þ¤Ã¤¿¾ì¹ç¤Ë¡¢¤³¤ÎÍͤʻö¤¬µ¯¤³¤ë¡£ +ɸ½à¤Î¥¹¥¿¥Ã¥¯¤ò»È¤¤²Ì¤¿¤·¤Æ¤·¤Þ¤¦¤È¡¢ +¥«¡¼¥Í¥ë¤Ï¥×¥í¥»¥¹¤Ë \fBSIGSEGV\fP ¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +¤³¤Î¤è¤¦¤Ê¾õ¶·¤Ç¤Ï¡¢ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¤·¤«¥·¥°¥Ê¥ë¤ò¥­¥ã¥Ã¥Á¤Ç¤­¤Ê¤¤¡£ +.P +Linux ¤¬¥µ¥Ý¡¼¥È¤¹¤ë¿¤¯¤Î¥Ï¡¼¥É¥¦¥§¥¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢ +¥¹¥¿¥Ã¥¯¤Ï²¼°Ì¥¢¥É¥ì¥¹Êý¸þ¤ËÀѤޤì¤ë¡£ +.BR sigaltstack () +¤Ï¥¹¥¿¥Ã¥¯¤¬ÀѤޤì¤ëÊý¸þ¤ò¼«Æ°Åª¤Ë·èÄꤹ¤ë¡£ +.P +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤«¤é¸Æ¤Ð¤ì¤ë´Ø¿ô¤â¡¢ÂåÂØ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò»È¤¦ +(¥×¥í¥»¥¹¤¬ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¾¤Î¥·¥°¥Ê¥ë¤Ç¸Æ¤Ó½Ð¤µ¤ì¤ë¥Ï¥ó¥É¥é¤â¤³¤ÎÂåÂØ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò»È¤¦)¡£ +ɸ½à¤Î¥¹¥¿¥Ã¥¯¤È¤Ï°Û¤Ê¤ê¡¢ +¥·¥¹¥Æ¥à¤ÏÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò¼«Æ°Åª¤Ë³ÈÄ¥¤·¤Ê¤¤¡£ +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯ÍѤ˳ÎÊݤ·¤¿¥µ¥¤¥º¤ò±Û¤¨¤¿¾ì¹ç¡¢ +·ë²Ì¤ÏͽÁۤǤ­¤Ê¤¤¡£ +.P +.BR execve (2) +¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤È¡¢ +´û¸¤ÎÁ´¤Æ¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤¬ºï½ü¤µ¤ì¤ë¡£ +.BR fork () +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤Î +ÀßÄê¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.P +.BR sigaltstack () +¤Ï°ÊÁ°¤Î +.BR sigstack () +¤òÃÖ¤­´¹¤¨¤ë¤â¤Î¤Ç¤¢¤ë¡£ +²áµî¥×¥í¥°¥é¥à¤È¤Î¸ß´¹À­¤Î¤¿¤á¡¢glibc ¤Ç¤Ï +.BR sigstack () +¤âÄ󶡤·¤Æ¤¤¤ë¡£ +¿·¤·¤¤¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÏÁ´¤Æ +.BR sigaltstack () +¤ò»È¤Ã¤Æ½ñ¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.SS Îò»Ë +4.2BSD ¤Ë¤Ï +.BR sigstack () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤¢¤Ã¤¿¡£ +¤³¤Î´Ø¿ô¤Ï¾¯¤·°Û¤Ê¤Ã¤¿¹½Â¤ÂΤò»È¤Ã¤Æ¤ª¤ê¡¢ +¸Æ¤Ó½Ð¤·¤¿Â¦¤¬¥¹¥¿¥Ã¥¯¤ÎÀѤޤì¤ëÊý¸þ¤òÃΤäƤ¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤È¤¤¤¦ +Â礭¤Ê·çÅÀ¤¬¤¢¤Ã¤¿¡£ +.SH Îã +°Ê²¼¤Î¥³¡¼¥É¤Ç +.BR sigaltstack () +¤Î»ÈÍÑË¡¤Î°ìÉô¤ò¼¨¤¹: + +.in +4n +.nf +stack_t ss; + +ss.ss_sp = malloc(SIGSTKSZ); +if (ss.ss_sp == NULL) + /* ¥Ï¥ó¥É¥ë¥¨¥é¡¼ */; +ss.ss_size = SIGSTKSZ; +ss.ss_flags = 0; +if (sigaltstack(&ss, NULL) == \-1) + /* ¥Ï¥ó¥É¥ë¥¨¥é¡¼ */; +.fi +.in +.SH ´ØÏ¢¹àÌÜ +.BR execve (2), +.BR setrlimit (2), +.BR sigaction (2), +.BR siglongjmp (3), +.BR sigsetjmp (3), +.BR signal (7) diff --git a/release/man2/sigblock.2 b/release/man2/sigblock.2 new file mode 100644 index 00000000..8bea5bc2 --- /dev/null +++ b/release/man2/sigblock.2 @@ -0,0 +1,116 @@ +.\" 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. +.\" +.\" @(#)sigblock.2 6.7 (Berkeley) 3/10/91 +.\" +.\" Modified Sat Jul 24 10:09:15 1993 by Rik Faith +.\" Modified Fri Aug 11 1995 by Stephen Lee +.\" Modified 1995 by Mike Battersby +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Mon Mar 3 23:27:30 JST 1997 +.\" by HANATAKA Shinya +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: mask ¥Þ¥¹¥¯ +.\"WORD: obsolete ÇÑ»ß +.\"WORD: block ¶Ø»ß(block) +.\"WORD: prototype ·¿Àë¸À +.\" +.TH SIGBLOCK 2 1995-08-31 "Linux 1.3" "Linux Programmer's Manual" +.SH ̾Á° +sigblock, siggetmask, sigsetmask, sigmask \- ¥·¥°¥Ê¥ë¤Î¥Þ¥¹¥¯¤òÁàºî¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int sigblock(int " mask ); +.sp +.B int siggetmask(void); +.sp +.BI "int sigsetmask(int " mask ); +.sp +.BI "int sigmask(int " signum ); +.SH ÀâÌÀ +¤³¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï +.BR sigprocmask (2) +¤Ë¤è¤Ã¤ÆÇÑ»ß (obsolete) ¤µ¤ì¤¿¡£ + +.BR sigblock () +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï +.I mask +¤Ç»ØÄꤷ¤¿¥·¥°¥Ê¥ë¤ò¸½ºßÇÛÁ÷¤¬¶Ø»ß (block) ¤µ¤ì¤Æ¤¤¤ë +¥·¥°¥Ê¥ë¤Î½¸¹ç¤ËÄɲ乤롣 +.PP +.BR sigsetmask () +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½¸¹ç¤ò +.IR mask +¤Ç»ØÄꤵ¤ì¤¿¿·¤·¤¤½¸¹ç¤Ë´°Á´¤ËÃÖ¤­´¹¤¨¤ë¡£ +¥·¥°¥Ê¥ë¤Ï +.I mask +¤ÎÂбþ¤¹¤ë¥Ó¥Ã¥È¤¬ 1 ¤Î¾ì¹ç¤Ë¶Ø»ß¤µ¤ì¤ë¡£ +.PP +¸½ºß¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½¸¹ç¤Ï +.BR siggetmask () +¤ò»ÈÍѤ·¤ÆÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.BR sigmask () +¥Þ¥¯¥í¤ÏÍ¿¤¨¤é¤ì¤¿ +.I signum +¤Î¥Þ¥¹¥¯¤òÁȤßΩ¤Æ¤ë¤¿¤á¤ËÄ󶡤µ¤ì¤ë¡£ + +.SH ÊÖ¤êÃÍ +.BR siggetmask () +¸½ºß¤Î¥Þ¥¹¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î½¸¹ç¤òÊÖ¤¹¡£ + +.BR sigsetmask () +¤È +.BR sigblock () +¤Ïº£¤Þ¤Ç¤Î¥Þ¥¹¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î½¸¹ç¤òÊÖ¤¹¡£ +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤Î·¿Àë¸À(prototype)¤ÏÁ´¤Æ¤Î¥·¥¹¥Æ¥à¡¦¥Ø¥Ã¥À¤¬ +¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤ëÁ°¤Ë +.B _BSD_SOURCE +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ßÍ¿¤¨¤é¤ì¤ë¡£ +.PP +.B SIGKILL +¤ä +.B SIGSTOP +¤ò¶Ø»ß¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +\- ¤³¤ÎÀ©¸Â¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤Æ̵¸À¤Î¤¦¤Á¤ËŬÍѤµ¤ì¤ë¡£ + +.SH ½àµò +4.4BSD. ¤³¤ì¤é¤Î´Ø¿ô¤Ï 4.3BSD ¤ÇÅо줷¡¢ÇÑ»ßͽÄê¤Ç¤¢¤ë¡£ +¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï POSIX ¥·¥°¥Ê¥ë¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigprocmask (2), +.BR signal (7) diff --git a/release/man2/signal.2 b/release/man2/signal.2 new file mode 100644 index 00000000..4225734e --- /dev/null +++ b/release/man2/signal.2 @@ -0,0 +1,317 @@ +.\" Copyright (c) 2000 Andries Brouwer +.\" and Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" and Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" based on work by Rik Faith +.\" and Mike Battersby . +.\" +.\" 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 2004-11-19, mtk: +.\" added pointer to sigaction.2 for details of ignoring SIGCHLD +.\" 2007-06-03, mtk: strengthened portability warning, and rewrote +.\" various sections. +.\" 2008-07-11, mtk: rewrote and expanded portability discussion. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-03-03, HANATAKA Shinya +.\" Modified 2000-09-24, HANATAKA Shinya +.\" Updated & Modified 2002-01-14, Yuichi SATO +.\" Updated & Modified 2004-01-17, Yuichi SATO +.\" Updated & Modified 2005-01-07, Yuichi SATO +.\" Updated 2007-06-01, Akihiro MOTOKI , LDP v2.50 +.\" Updated 2007-06-13, Akihiro MOTOKI, LDP v2.55 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: signal handler ¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é +.\"WORD: library ¥é¥¤¥Ö¥é¥ê +.\"WORD: semantics Êý¼° +.\"WORD: prototype ·¿Àë¸À +.\"WORD: architecture ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¡¼ +.\"WORD: endless loop ̵¸Â¥ë¡¼¥× +.\"WORD: feature test macro µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\"WORD: disposition ½èÍýÊýË¡ +.\" +.TH SIGNAL 2 2008-07-11 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +signal \- ANSI C ¥·¥°¥Ê¥ëÁàºî +.SH ½ñ¼° +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "sighandler_t signal(int " signum ", sighandler_t " sighandler ); +.SH ÀâÌÀ +.BR signal () +¤ÎÆ°ºî¤Ï Unix ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê°Û¤Ê¤ë¡£ +¤Þ¤¿¡¢Îò»ËŪ¤Ë¸«¤Æ Linux ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ¤â°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +\fB¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î»ÈÍѤÏÈò¤±¡¢\fP +Âå¤ï¤ê¤Ë +.BR sigaction (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +²¼µ­¤Î¡Ö°Ü¿¢À­¡×¤ò»²¾È¡£ + +.BR signal () +¤Ï¥·¥°¥Ê¥ë +.I signum +¤Î½èÍýÊýË¡¤ò +.I handler +¤ËÀßÄꤹ¤ë¡£ +.I handler +¤Ë¤Ï¡¢ +.BR SIG_IGN "¡¢" +.BR SIG_DFL "¡¢" +¥×¥í¥°¥é¥Þ¤¬ÄêµÁ¤·¤¿´Ø¿ô (¡Ö¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¡×) ¤Î¥¢¥É¥ì¥¹¤Î +¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ + +¥·¥°¥Ê¥ë +.I signum +¤¬¥×¥í¥»¥¹¤ËÇÛÁ÷¤µ¤ì¤ë¤È¡¢°Ê²¼¤Î¤¤¤º¤ì¤«¤¬È¯À¸¤¹¤ë¡£ +.TP 3 +* +½èÍýÊýË¡¤¬ +.B SIG_IGN +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +* +½èÍýÊýË¡¤¬ +.B SIG_DFL +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥·¥°¥Ê¥ë¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿ +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤¬¹Ô¤ï¤ì¤ë +.RB ( signal (7) +»²¾È)¡£ +.TP +* +½èÍýÊýË¡¤È¤·¤Æ´Ø¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¤Þ¤ººÇ½é¤Ë½èÍýÊýË¡¤¬ +.B SIG_DFL +¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¤«¤½¤Î¥·¥°¥Ê¥ë¤Î¥Ö¥í¥Ã¥¯¤¬¼Â¹Ô¤µ¤ì¤¿¸å¡¢ +.I signum +¤ò°ú¤­¿ô¤È¤·¤Æ +.I handler +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤ëºÝ¤Ë¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¾ì¹ç¡¢ +¥Ï¥ó¥É¥é¤¬ÊÖ¤ëºÝ¤Ë¤½¤Î¥·¥°¥Ê¥ë¤Î¥Ö¥í¥Ã¥¯¤¬²ò½ü¤µ¤ì¤ë¡£ +.PP +¥·¥°¥Ê¥ë +.B SIGKILL +¤È +.B SIGSTOP +¤ÏÊ᪤Ǥ­¤º¡¢Ìµ»ë¤¹¤ë¤³¤È¤â¤Ç¤­¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR signal () +¤Ï¡¢º£¤Þ¤Ç¤Î¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤ÎÃͤòÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï +.B SIG_ERR +¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I signum +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.SH ½àµò +C89, C99, POSIX.1-2001. +.SH Ãí°Õ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥»¥¹¤Ë¤ª¤±¤ë +.BR signal () +¤Î·ë²Ì¤Ï¡¢»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +POSIX ¤Ë¤è¤ë¤È¡¢ +.BR kill (2) +¤ä +.BR raise (3) +¤ÇÀ¸À®¤Ç¤­¤Ê¤¤ +.BR SIGFPE , +.BR SIGILL , +.B SIGSEGV +¥·¥°¥Ê¥ë¤ò̵»ë¤·¤¿¸å¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +0 ¤Ë¤è¤ëÀ°¿ô³ä¤ê»»¤Î·ë²Ì¤Ï̤ÄêµÁ¤È¤Ê¤ë¡£ +¤¢¤ë¼ï¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢¤³¤ì¤Ï +.B SIGFPE +¥·¥°¥Ê¥ë¤òÀ¸À®¤¹¤ë¡£ +(ƱÍͤËÉé¤ÎºÇÂçÀ°¿ô¤ò \-1 ¤Ç³ä¤ë¤È +.B SIGFPE +¤¬À¸À®¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£) +¤³¤Î¥·¥°¥Ê¥ë¤ò̵»ë¤¹¤ë¤È̵¸Â¥ë¡¼¥×¤Ë´Ù¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +.B SIGCHLD +¤ÎÆ°ºî¤È¤·¤Æ +.B SIG_IGN +¤òÀßÄꤷ¤¿¾ì¹ç¤Î¾ÜºÙ¤ÊÆ°ºî¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR sigaction (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥éÆ⤫¤é°ÂÁ´¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡¢ +async-signal-safe functions (ÈóƱ´ü¥·¥ó¥°¥ë¤Ç°ÂÁ´¤Ê´Ø¿ô) ¤Î +¥ê¥¹¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR signal (7) +¤ò»²¾È¡£ +.PP +.I sighandler_t +¤Î»ÈÍÑ¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +³Æ¼ï¥Ð¡¼¥¸¥ç¥ó¤Î libc ¤Ç¤³¤Î·¿¤ÏÄêµÁºÑ¤ß¤Ç¤¢¤ë; +libc4 ¤È libc5 ¤Ç¤Ï +.I SignalHandler +¤òÄêµÁ¤·¤Æ¤¤¤ë¡£ +glibc ¤Ç¤Ï +.I sig_t +¤òÄêµÁ¤·¤Æ¤ª¤ê¡¢ +.B _GNU_SOURCE +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï +.I sighandler_t +¤âÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¤è¤¦¤Ê·¿¤ò»ÈÍѤ·¤Ê¤¤¤È¡¢ +.BR signal () +¤ÎÀë¸À¤ÏÆɤߤˤ¯¤¤¤â¤Î¤È¤Ê¤ë¡£ +.in +4n +.nf + +.BI "void ( *" signal "(int " signum ", void (*" handler ")(int)) ) (int);" +.fi +.in +.SS °Ü¿¢À­ +°Ü¿¢À­¤Î¤¢¤ë +.BR signal () +¤Î»È¤¤Êý¤Ï¡¢¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤ò +.BR SIG_DFL +¤« +.BR SIG_IGN +¤ËÀßÄꤹ¤ëÊýË¡¤À¤±¤Ç¤¢¤ë¡£ +¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ë¤Î¤Ë +.BR signal () +¤ò»È¤Ã¤¿¤È¤­¤ÎÆ°ºî¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤ê°Û¤Ê¤ë +(POSIX.1 ¤ÏÌÀ¼¨Åª¤Ë¤³¤Î°ã¤¤¤òǧ¤á¤Æ¤¤¤ë)¡£ +.B "°Ü¿¢À­¤¬É¬ÍפʤȤ­¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ÈÍѤ·¤Ê¤¤¤³¤È¡£" + +POSIX.1 ¤Ï¡¢ +.BR sigaction (2) +¤òµ¬Äꤹ¤ë¤³¤È¤Ç°Ü¿¢À­¤Ë´Ø¤¹¤ëº®Íð¤ò²ò·è¤·¤¿¡£ +.BR sigaction (2) +¤Ï¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤ëºÝ¤ÎµóÆ°¤òÌÀ¼¨Åª¤ËÀ©¸æ¤Ç¤­¤ë¡£ +.BR signal () +¤ÎÂå¤ï¤ê¤Ë¤³¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤ò»È¤¦¤³¤È¡£ + +¥ª¥ê¥¸¥Ê¥ë¤Î Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR signal () +¤ò»È¤Ã¤ÆÀßÄꤵ¤ì¤¿¥Ï¥ó¥É¥é¤¬¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤Ë¤è¤êµ¯Æ°¤µ¤ì¤ë¤È¡¢ +¤½¤Î¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï +.B SIG_DFL +¤Ë¥ê¥»¥Ã¥È¤µ¤ì¡¢¥·¥¹¥Æ¥à¤ÏƱ¤¸¥·¥°¥Ê¥ë¤¬¤µ¤é¤ËÀ¸À®¤µ¤ì¤Æ¤â +¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤ò¥Ö¥í¥Ã¥¯¤·¤Ê¤«¤Ã¤¿¡£ +System V ¤Ç¤â¡¢ +.BR signal () +¤ËÂФ·¤Æ¤³¤ì¤é¤ÎµóÆ°¤òµ¬Äꤷ¤Æ¤¤¤ë¡£ +¤³¤¦¤·¤¿µóÆ°¤Ï¤Þ¤º¤¯¡¢¥Ï¥ó¥É¥é¤¬¥Ï¥ó¥É¥é¼«¿È¤òºÆÀßÄꤹ¤ëµ¡²ñ¤¬ +Íè¤ë¤è¤êÁ°¤Ë¡¢Æ±¤¸¥·¥°¥Ê¥ë¤¬¤Þ¤¿ÇÛÁ÷¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤µ¤é¤Ë¡¢Æ±¤¸¥·¥°¥Ê¥ë¤¬Î©¤Æ³¤±¤ËÇÛÁ÷¤µ¤ì¤ë¤È¡¢Æ±¤¸¥·¥°¥Ê¥ë¤¬ +¥Ï¥ó¥É¥é¤ò·«¤êÊÖ¤·µ¯Æ°¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ + +BSD ¤Ç¤Ï¡¢¥·¥°¥Ê¥ë½èÍý¤ÎµóÆ°¤òÊѹ¹¤¹¤ë¤³¤È¤Ç¡¢¤³¤Î¾õ¶·¤ò²þÁ±¤·¤¿ +(¤·¤«¤·¡¢»ÄÇ°¤Ê¤³¤È¤Ë¡¢ +.BR signal () +¤ò»È¤Ã¤Æ¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤ËµóÆ°¤¬ÌۤäÆÊѹ¹¤µ¤ì¤ë)¡£ +BSD ¤Ç¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤¿ºÝ¡¢ +¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï¥ê¥»¥Ã¥È¤µ¤ì¤º¡¢ +¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¡¢Æ±¤¸¥·¥°¥Ê¥ë¤Î¤µ¤é¤Ê¤ëÀ¸À®¤ÏÇÛÁ÷¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¡£ + +Linux ¤Ç¤Î¾õ¶·¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.IP * 2 +¥«¡¼¥Í¥ë¤Î +.BR signal () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï System V Êý¼°¤òÄ󶡤·¤Æ¤¤¤ë¡£ +.IP * +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢glibc 2 °Ê¹ß¤Ç¤Ï¡¢ +.BR signal () +¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¥«¡¼¥Í¥ë¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤·¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë¡¢¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï BSD Êý¼°¤ò¼¨¤¹¥Õ¥é¥°¤ò»È¤Ã¤Æ +.BR sigaction (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ +µ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _BSD_SOURCE +¤òÄêµÁ¤·¤Æ¤¤¤ì¤Ð¡¢¤³¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤È¤Ê¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.B _BSD_SOURCE +¤¬ÄêµÁ¤µ¤ì¤ë¡£ +.B _BSD_SOURCE +¤Ï +.B _GNU_SOURCE +¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï°ÅÌۤΤ¦¤Á¤ËÄêµÁ¤µ¤ì¡¢ +¤â¤Á¤í¤óÌÀ¼¨Åª¤ËÄêµÁ¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.sp +glibc 2 °Ê¹ß¤Ç¤Ï¡¢µ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _BSD_SOURCE +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +.BR signal () +¤Ï System V Êý¼°¤È¤Ê¤ë¡£ +.RB ( gcc (1) +¤¬É¸½à»ØÄê¥â¡¼¥É +.RI ( -std=xxx " or " -ansi ) +¤Çµ¯Æ°¤µ¤ì¤¿¾ì¹ç¡¢¤â¤·¤¯¤Ï +.BR _POSIX_SOURCE , +.BR _XOPEN_SOURCE , +.B _SVID_SOURCE +¤È¤¤¤Ã¤¿Â¾¤ÎÍÍ¡¹¤Êµ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤Î +.B _BSD_SOURCE +¤Î°ÅÌÛ¤ÎÄêµÁ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +.BR feature_test_macros (7) +¤ò»²¾È¤Î¤³¤È¡£) +.\" +.\" System V semantics are also provided if one uses the separate +.\" .BR sysv_signal (3) +.\" function. +.IP * +Linux ¤Î libc4 ¤È libc5 ¤Î +.BR signal () +´Ø¿ô¤Ï System V Êý¼°¤Ç¤¢¤ë¡£ +libc5 ¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ +.I +¤Î¤«¤ï¤ê¤Ë +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤È¡¢ +.BR signal () +¤Ï +.BR __bsd_signal () +¤ËºÆÄêµÁ¤µ¤ì¡¢ +.BR signal () +¤Ï BSD Êý¼°¤È¤Ê¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (1), +.BR alarm (2), +.BR kill (2), +.BR killpg (2), +.BR pause (2), +.BR sigaction (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigqueue (2), +.BR sigsuspend (2), +.BR bsd_signal (3), +.BR raise (3), +.BR siginterrupt (3), +.BR sigsetops (3), +.BR sigvec (3), +.BR sysv_signal (3), +.BR feature_test_macros (7), +.BR signal (7) diff --git a/release/man2/signalfd.2 b/release/man2/signalfd.2 new file mode 100644 index 00000000..a74d04af --- /dev/null +++ b/release/man2/signalfd.2 @@ -0,0 +1,453 @@ +.\" Copyright (C) 2008 Michael Kerrisk +.\" starting from a version by 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 +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-04-06, Akihiro MOTOKI , LDP v2.79 +.\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.13 +.\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.18 +.\" +.TH SIGNALFD 2 2009-01-13 Linux "Linux Programmer's Manual" +.SH ̾Á° +signalfd \- ¥·¥°¥Ê¥ë¼õ¤±ÉÕ¤±ÍѤΥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int signalfd(int " fd ", const sigset_t *" mask ", int " flags ); +.SH ÀâÌÀ +.BR signalfd () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ°¸¤Æ¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±ÉÕ¤±¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¥Õ¥¡¥¤¥ë +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤¹¤ë¡£ +¤³¤ÎÊýË¡¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ä +.BR sigwaitinfo (2) +¤òÍѤ¤¤ëÊýË¡¤ÎÂå¤ï¤ê¤È¤Ê¤ë¤â¤Î¤Ç¤¢¤ê¡¢¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +.BR select (2), +.BR poll (2), +.BR epoll (7) +¤Ç´Æ»ë¤Ç¤­¤ë¤È¤¤¤¦ÍøÅÀ¤¬¤¢¤ë¡£ + +.I mask +°ú¤­¿ô¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤¬¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤Ç¼õ¤±ÉÕ¤±¤¿¤¤ +¥·¥°¥Ê¥ë½¸¹ç¤ò»ØÄꤹ¤ë¡£¤³¤Î°ú¤­¿ô¤Ç»ØÄꤹ¤ë¥·¥°¥Ê¥ë½¸¹ç¤ÎÆâÍƤϡ¢ +.BR sigsetops (3) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥Þ¥¯¥í¤ò»È¤Ã¤Æ½é´ü²½¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Ä̾¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤Ç¼õ¿®¤¹¤ë¥·¥°¥Ê¥ë½¸¹ç¤Ï¡¢ +¤½¤Î¥·¥°¥Ê¥ë¤¬¥Ç¥Õ¥©¥ë¥È¤ÎÇÛÁ÷ÊýË¡¤Ë´ð¤¤¤Æ½èÍý¤µ¤ì¤ë¤Î¤òËɤ°¤¿¤á¤Ë¡¢ +.BR sigprocmask (2) +¤ò»È¤Ã¤Æ¥Ö¥í¥Ã¥¯¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +¥·¥°¥Ê¥ë +.B SIGKILL +¤È +.B SIGSTOP +¤ò signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤Ç¼õ¿®¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤¬ +.I mask +¤Ç»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤ÏÌۤäÆ̵»ë¤µ¤ì¤ë¡£ + +.I fd +°ú¤­¿ô¤¬ \-1 ¤Î¾ì¹ç¡¢ +.BR signalfd () +¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤·¡¢ +.I mask +¤Ç»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤ò¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë´ØÏ¢ÉÕ¤±¤ë¡£ +.I fd +°ú¤­¿ô¤¬ \-1 °Ê³°¤Î¾ì¹ç¡¢ +.I fd +¤Ë¤ÏÍ­¸ú¤Ê´û¸¤Î signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤½¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë½¸¹ç¤Ï +.I mask +¤ò»È¤Ã¤ÆÃÖ¤­´¹¤¨¤é¤ì¤ë¡£ + +Linux 2.6.27 °Ê¹ß¤Ç¤Ï¡¢ +°Ê²¼¤ÎÃͤΤ¤¤¯¤Ä¤«¤ò¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýÏ (OR) ¤Ç»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +.BR signalfd () +¤Î¿¶Éñ¤¤¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 14 +.B SFD_NONBLOCK +¿·¤·¤¯À¸À®¤µ¤ì¤ë¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò (open file description) ¤Î +.B O_NONBLOCK +¥Õ¥¡¥¤¥ë¥¹¥Æ¡¼¥¿¥¹¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤³¤È¤Ç¡¢ +.B O_NONBLOCK +¤ò¥»¥Ã¥È¤¹¤ë¤¿¤á¤Ë +.BR fcntl (2) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.TP +.B SFD_CLOEXEC +¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +close-on-exec +.RB ( FD_CLOEXEC ) +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬Ìò¤ËΩ¤ÄÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR open (2) +¤Î +.B O_CLOEXEC +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.PP +¥Ð¡¼¥¸¥ç¥ó 2.6.26 °ÊÁ°¤Î Linux ¤Ç¤Ï¡¢ +.I flags +°ú¤­¿ô¤Ï̤»ÈÍѤǤ¢¤ê¡¢0 ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.BR signalfd () +¤¬ÊÖ¤¹¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï°Ê²¼¤ÎÁàºî¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.TP +.BR read (2) +.I mask +¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î¤¦¤Á°ì¤Ä°Ê¾å¤¬¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ +½èÍýÂÔ¤Á (pending) ¤Ç¤¢¤ì¤Ð¡¢¤½¤ì¤é¤Î¥·¥°¥Ê¥ë¤Î¾ðÊó¤¬ +.BR read (2) +¤ËÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ò»È¤Ã¤Æ¡¢ +.I signalfd_siginfo +¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ +.BR read (2) +¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ²Äǽ¤ÊÈϰϤǤǤ­¤ë¤À¤±Â¿¤¯¤Î½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Ë +¤Ä¤¤¤Æ¤Î¾ðÊó¤òÊÖ¤¹¡£ +¥Ð¥Ã¥Õ¥¡¤ÏºÇÄã¤Ç¤â +.I "sizeof(struct signalfd_siginfo)" +¥Ð¥¤¥È¤ÎÂ礭¤µ¤¬¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BR read (2) +¤ÎÊÖ¤êÃͤÏÆɤ߽Фµ¤ì¤¿¥È¡¼¥¿¥ë¤Î¥Ð¥¤¥È¿ô¤Ç¤¢¤ë¡£ +.IP +.BR read (2) +¤¬¹Ô¤ï¤ì¤¿·ë²Ì¡¢¥·¥°¥Ê¥ë¤Ï¾ÃÈñ¤µ¤ì¡¢ +¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤Ï¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ¤Ï½èÍýÂÔ¤Á¤Ç¤Ï¤Ê¤¯¤Ê¤ë +(¤Ä¤Þ¤ê¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÇÊ᪤µ¤ì¤ë¤³¤È¤â¤Ê¤¯¡¢ +.BR sigwaitinfo (2) +¤ò»È¤Ã¤Æ¼õ¤±¼è¤ë¤³¤È¤â¤Ç¤­¤Ê¤¯¤Ê¤ë)¡£ +.IP +.I mask +¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤¬¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ°ì¤Ä¤â½èÍýÂÔ¤Á¤Ç¤Ê¤±¤ì¤Ð¡¢ +.BR read (2) +¤Ï¡¢ +.I mask +¤Ç»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤Î¤¦¤Á¤¤¤º¤ì¤«°ì¤Ä¤¬¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤ÆȯÀ¸¤¹¤ë¤Þ¤Ç +Ää»ß (block) ¤¹¤ë¡¢¤â¤·¤¯¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÈóÄä»ß (nonblocking) +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.BR poll "(2), " select "(2) (¤ÈƱÍͤÎÁàºî)" +.I mask +¤Ë»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤Î¤¦¤Á°ì¤Ä°Ê¾å¤¬¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ½èÍýÂÔ¤Á¤Ç¤¢¤ì¤Ð¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÆɤ߽Ф·²Äǽ¤È¤Ê¤ë +.RB ( select (2) +¤Î +.I readfds +°ú¤­¿ô¤ä +.BR poll (2) +¤Î +.B POLLIN +¥Õ¥é¥°)¡£ +.IP +signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤³¤ì°Ê³°¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +¿½Å API ¤Ç¤¢¤ë +.BR pselect (2), +.BR ppoll (2), +.BR epoll (7) +¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.TP +.BR close (2) +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¤½¤ì°Ê¹ß¤ÏɬÍפʤ¯¤Ê¤Ã¤¿ºÝ¤Ë¤Ï¡¢¥¯¥í¡¼¥º¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Ʊ¤¸ signalfd ¥ª¥Ö¥¸¥§¥¯¥È¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Á´¤Æ +¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¡¢¤½¤Î¥ª¥Ö¥¸¥§¥¯¥ÈÍѤλñ¸»¤¬¥«¡¼¥Í¥ë¤Ë¤è¤ê²òÊü¤µ¤ì¤ë¡£ +.SS signalfd_siginfo ¹½Â¤ÂÎ +signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î +.BR read (2) +¤ÇÊÖ¤µ¤ì¤ë +.I signalfd_siginfo +¹½Â¤ÂΤΥե©¡¼¥Þ¥Ã¥È¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.in +4n +.nf + +struct signalfd_siginfo { +struct signalfd_siginfo { + uint32_t ssi_signo; /* ¥·¥°¥Ê¥ëÈÖ¹æ */ + int32_t ssi_errno; /* ¥¨¥é¡¼ÈÖ¹æ (̤»ÈÍÑ) */ + int32_t ssi_code; /* ¥·¥°¥Ê¥ë¥³¡¼¥É */ + uint32_t ssi_pid; /* Á÷¿®¸µ¤Î PID */ + uint32_t ssi_uid; /* Á÷¿®¸µ¤Î¼Â UID */ + int32_t ssi_fd; /* ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ (SIGIO) */ + uint32_t ssi_tid; /* ¥«¡¼¥Í¥ë¥¿¥¤¥Þ ID (POSIX ¥¿¥¤¥Þ) + uint32_t ssi_band; /* Band ¥¤¥Ù¥ó¥È (SIGIO) */ + uint32_t ssi_overrun; /* POSIX ¥¿¥¤¥Þ¤Î¥ª¡¼¥Ð¡¼¥é¥ó²ó¿ô */ + uint32_t ssi_trapno; /* ¥·¥°¥Ê¥ë¤Î¸¶°ø¤È¤Ê¤Ã¤¿¥È¥é¥Ã¥×ÈÖ¹æ */ +.\" ¤Û¤È¤ó¤É¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç ssi_trapno ¤Ï̤»ÈÍÑ + int32_t ssi_status; /* ½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤«¥·¥°¥Ê¥ë (SIGCHLD) */ + int32_t ssi_int; /* sigqueue(2) ¤«¤éÁ÷¤é¤ì¤¿À°¿ô */ + uint64_t ssi_ptr; /* sigqueue(2) ¤«¤éÁ÷¤é¤ì¤¿¥Ý¥¤¥ó¥¿ */ + uint64_t ssi_utime; /* ¾ÃÈñ¤·¤¿¥æ¡¼¥¶ CPU »þ´Ö (SIGCHLD) */ + uint64_t ssi_stime; /* ¾ÃÈñ¤·¤¿¥·¥¹¥Æ¥à CPU »þ´Ö (SIGCHLD) */ + uint64_t ssi_addr; /* ¥·¥°¥Ê¥ë¤òÀ¸À®¤·¤¿¥¢¥É¥ì¥¹ + (¥Ï¡¼¥É¥¦¥§¥¢¤¬À¸À®¤·¤¿¥·¥°¥Ê¥ë¤Î¾ì¹ç) */ + uint8_t pad[\fIX\fP]; /* pad ¤ÎÂ礭¤µ¤Ï 128 ¥Ð¥¤¥È + (¾­Íè¤Î¥Õ¥£¡¼¥ë¥ÉÄɲÃÍѤξì½ê¤Î³ÎÊÝ) */ +}; + +.fi +.in +.I signalfd_siginfo +¹½Â¤ÂΤγƥե£¡¼¥ë¥É¤Ï¡¢ +.I siginfo_t +¹½Â¤ÂΤÎƱ¤¸¤è¤¦¤Ê̾Á°¤Î¥Õ¥£¡¼¥ë¥É¤ÈƱÍͤǤ¢¤ë¡£ +.I siginfo_t +¹½Â¤ÂΤˤĤ¤¤Æ¤Ï +.BR sigaction (2) +¤ËÀâÌÀ¤¬¤¢¤ë¡£ +ÊÖ¤µ¤ì¤¿ +.I signalfd_siginfo +¹½Â¤ÂΤÎÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤¬¤¢¤ë¥·¥°¥Ê¥ë¤ËÂФ·¤ÆÍ­¸ú¤Ê¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¤É¤Î¥Õ¥£¡¼¥ë¥É¤¬Í­¸ú¤«¤Ï¡¢ +.I ssi_code +¥Õ¥£¡¼¥ë¥É¤ÇÊÖ¤µ¤ì¤ëÃͤ«¤éȽÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï +.I siginfo_t +¤Î +.I si_code +¥Õ¥£¡¼¥ë¥É¤ÈƱÍͤǤ¢¤ë¡£¾ÜºÙ¤Ï +.BR sigaction (2) +¤ò»²¾È¡£ +.SS fork(2) ¤Ç¤Î°·¤¤ +.BR fork (2) +¤¬¹Ô¤ï¤ì¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤Ï signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥³¥Ô¡¼¤ò +·Ñ¾µ¤¹¤ë¡£ +»Ò¥×¥í¥»¥¹¤Ç¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é +.BR read (2) +¤ò¹Ô¤¦¤È¡¢»Ò¥×¥í¥»¥¹¤ËÂФ¹¤ë¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë +¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£ +.SS execve(2) ¤Ç¤Î°·¤¤ +¾¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÈÁ´¤¯Æ±Íͤˡ¢ +signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤â +.BR execve (2) +¤ÎÁ°¸å¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤¿¤Þ¤Þ¤È¤Ê¤ë¡£Ã¢¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë +close-on-exec ¤Î¥Þ¡¼¥¯ +.RB ( fcntl (2) +»²¾È) ¤¬ÉÕ¤¤¤Æ¤¤¤ë¾ì¹ç¤Ï¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.BR execve (2) +¤ÎÁ°¤ËÆɤ߽Ф·²Äǽ¤È¤Ê¤Ã¤Æ¤¤¤¿Á´¤Æ¤Î¥·¥°¥Ê¥ë¤Ï¿·¤·¤¯µ¯Æ°¤µ¤ì¤¿¥×¥í¥°¥é¥à +¤Ç¤â°ú¤­Â³¤­Æɤ߽Ф·²Äǽ¤Ç¤¢¤ë +(¤³¤ì¤ÏÅÁÅýŪ¤Ê¥·¥°¥Ê¥ë¤Î°·¤¤¤ÈƱ¤¸¤Ç¤¢¤ê¡¢ +½èÍýÂÔ¤Á¤Î¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ï +.BR execve (2) +¤ÎÁ°¸å¤Ç½èÍýÂÔ¤Á¤Î¤Þ¤Þ¤È¤Ê¤ë)¡£ +.SS ¥¹¥ì¥Ã¥É¤Ç¤Î°·¤¤ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥°¥é¥à¤Ë¤ª¤±¤ë signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î°·¤¤¤Ï +¥·¥°¥Ê¥ë¤Îɸ½àŪ¤Ê°·¤¤¤ÈÁ´¤¯Æ±¤¸¤Ç¤¢¤ë¡£ +¸À¤¤´¹¤¨¤ë¤È¡¢¤¢¤ë¥¹¥ì¥Ã¥É¤¬ signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é +Æɤ߽Ф·¤ò¹Ô¤¦¤È¡¢¤½¤Î¥¹¥ì¥Ã¥É¼«¿È°¸¤Æ¤Î¥·¥°¥Ê¥ë¤È¥×¥í¥»¥¹ (¤¹¤Ê¤ï¤Á +¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×Á´ÂÎ) °¸¤Æ¤Î¥·¥°¥Ê¥ë¤¬Æɤ߽Фµ¤ì¤ë¡£ +(¥¹¥ì¥Ã¥É¤ÏƱ¤¸¥×¥í¥»¥¹¤Î¾¤Î¥¹¥ì¥Ã¥É°¸¤Æ¤Î¥·¥°¥Ê¥ë¤òÆɤ߽Ф¹¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£) +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR signalfd () +¤Ï signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +ÊÖ¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢ +.IR fd +¤¬ \-1 ¤Î¾ì¹ç¤Ï¿·µ¬¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ê¡¢ +.I fd +¤¬Í­¸ú¤Ê signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤À¤Ã¤¿¾ì¹ç¤Ï +.I fd +¼«¿È¤Ç¤¢¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.I fd +¤¬Í­¸ú¤Ê signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.\" or, the +.\" .I sizemask +.\" argument is not equal to +.\" .IR sizeof(sigset_t) ; +.TP +.B EINVAL +.I flags +¤¬Ìµ¸ú¡£ +Linux 2.6.26 °ÊÁ°¤Ç¤Ï¡¢ +.I flags +¤¬ 0 °Ê³°¤ÎÃÍ¡£ +.TP +.B EMFILE +¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô¤¬¥×¥í¥»¥¹¤¢¤¿¤ê¤Î¾å¸Â¤Ë +㤷¤Æ¤¤¤¿¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ëÁí¿ô¤¬¥·¥¹¥Æ¥àÁ´ÂΤξå¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENODEV +(¥«¡¼¥Í¥ëÆâ¤Î) ̵̾ inode ¥Ç¥Ð¥¤¥¹¤ò¥Þ¥¦¥ó¥È¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +¿·¤·¤¤ signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR signalfd () +¤Ï¥«¡¼¥Í¥ë 2.6.22 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +Àµ¤·¤¯Æ°ºî¤¹¤ë glibc ¦¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.8 °Ê¹ß¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.\" signalfd() is in glibc 2.7, but reportedly does not build +.BR signalfd4 () +¥·¥¹¥Æ¥à¥³¡¼¥ë (¡ÖÃí°Õ¡×»²¾È) ¤Ï +¥«¡¼¥Í¥ë 2.6.27 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +.BR signalfd () +¤È +.BR signalfd4 () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¼ÂºÝ¤Î Linux ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤Ï +.I "size_t sizemask" +¤È¤¤¤¦°ú¤­¿ô¤¬ÄɲäÇɬÍפǤ¢¤ë¡£¤³¤Î°ú¤­¿ô¤Ç +.I mask +¤Î¥µ¥¤¥º¤ò»ØÄꤹ¤ë¡£ +glibc ¤Î +.BR signalfd () +¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ë¤Ï¤³¤Î°ú¤­¿ô¤Ï´Þ¤Þ¤ì¤º¡¢ +¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬É¬ÍפÊÃͤò·×»»¤·¤ÆÆâÉô¤Ç¸Æ¤Ó½Ð¤¹¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÄ󶡤¹¤ë¡£ + +°ì¤Ä¤Î¥×¥í¥»¥¹¤ÏÊ£¿ô¤Î signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ¸À®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢°Û¤Ê¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç°Û¤Ê¤ë¥·¥°¥Ê¥ë¤ò¼õ¤±¼è¤ë¤³¤È¤¬ +¤Ç¤­¤ë (¤³¤Îµ¡Ç½¤Ï +.BR select (2), +.BR poll (2), +.BR epoll (7) +¤ò»È¤Ã¤Æ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò´Æ»ë¤¹¤ë¾ì¹ç¤ËÍ­ÍѤ«¤â¤·¤ì¤Ê¤¤¡£ +°Û¤Ê¤ë¥·¥°¥Ê¥ë¤¬ÅþÃ夹¤ë¤È¡¢°Û¤Ê¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÍøÍѲÄǽ¤Ë +¤Ê¤ë¤«¤é¤À)¡£ +°ì¤Ä¤Î¥·¥°¥Ê¥ë¤¬Æó¤Ä°Ê¾å¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î +.I mask +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤Î¥·¥°¥Ê¥ë¤ÎȯÀ¸¤Ï¤½¤Î¥·¥°¥Ê¥ë¤ò +.I mask +¤Ë´Þ¤à¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¦¤Á¤¤¤º¤ì¤«°ì¤Ä¤«¤éÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ²¼Áؤˤ¢¤ë Linux ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë +²¼Áؤˤ¢¤ë Linux ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÆó¼ïÎढ¤ê¡¢ +.BR signalfd () +¤È¡¢¤â¤Ã¤È¿·¤·¤¤ +.BR signalfd4 () +¤Ç¤¢¤ë¡£ +.BR signalfd () +¤Ï +.I flags +°ú¤­¿ô¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¡£ +.BR signalfd4 () +¤Ç¤Ï¾åµ­¤ÎÃͤΠ+.I flags +¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +glibc 2.9 °Ê¹ß¤Ç¤Ï¡¢ +.BR signalfd () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢ +.BR signalfd4 () +¤¬ÍøÍѲÄǽ¤Ç¤¢¤ì¤Ð¡¢¤³¤ì¤ò»ÈÍѤ¹¤ë¡£ +.SH ¥Ð¥° +¥«¡¼¥Í¥ë 2.6.25 ¤è¤êÁ°¤Ç¤Ï¡¢ +.BR sigqueue (2) +¤Ë¤è¤êÁ÷¿®¤µ¤ì¤¿¥·¥°¥Ê¥ë¤È°ì½ï¤ËÅϤµ¤ì¤ë¥Ç¡¼¥¿¤Ç¤Ï¡¢¥Õ¥£¡¼¥ë¥É +.I ssi_ptr +¤È +.I ssi_int +¤ÏÀßÄꤵ¤ì¤Ê¤¤¡£ +.\" The fix also was put into 2.6.24.5 +.SH Îã +²¼µ­¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥·¥°¥Ê¥ë +.B SIGINT +¤È +.B SIGQUIT +¤ò signalfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤Ç¼õ¿®¤¹¤ë¡£ +¥·¥°¥Ê¥ë +.B SIGQUIT +¼õ¿®¸å¤Ë¥×¥í¥°¥é¥à¤Ï½ªÎ»¤¹¤ë¡£ +°Ê²¼¤Ë¼¨¤¹¥·¥§¥ë¥»¥Ã¥·¥ç¥ó¤Ë¤³¤Î¥×¥í¥°¥é¥à¤Î»È¤¤Êý¤ò¼¨¤¹¡£ +.in +4n +.nf + +.RB "$" " ./signalfd_demo" +.BR "^C" " # Control\-C generates SIGINT" +Got SIGINT +.B ^C +Got SIGINT +\fB^\\\fP # Control\-\\ generates SIGQUIT +Got SIGQUIT +$ +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int +main(int argc, char *argv[]) +{ + sigset_t mask; + int sfd; + struct signalfd_siginfo fdsi; + ssize_t s; + + sigemptyset(&mask); + sigaddset(&mask, SIGINT); + sigaddset(&mask, SIGQUIT); + + /* Block signals so that they aren\(aqt handled + according to their default dispositions */ + + if (sigprocmask(SIG_BLOCK, &mask, NULL) == \-1) + handle_error("sigprocmask"); + + sfd = signalfd(\-1, &mask, 0); + if (sfd == \-1) + handle_error("signalfd"); + + for (;;) { + s = read(sfd, &fdsi, sizeof(struct signalfd_siginfo)); + if (s != sizeof(struct signalfd_siginfo)) + handle_error("read"); + + if (fdsi.ssi_signo == SIGINT) { + printf("Got SIGINT\\n"); + } else if (fdsi.ssi_signo == SIGQUIT) { + printf("Got SIGQUIT\\n"); + exit(EXIT_SUCCESS); + } else { + printf("Read unexpected signal\\n"); + } + } +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR eventfd (2), +.BR poll (2), +.BR read (2), +.BR select (2), +.BR sigaction (2), +.BR sigprocmask (2), +.BR sigwaitinfo (2), +.BR timerfd_create (2), +.BR sigsetops (3), +.BR sigwait (3), +.BR epoll (7), +.BR signal (7) diff --git a/release/man2/sigpause.2 b/release/man2/sigpause.2 new file mode 100644 index 00000000..cc7215b3 --- /dev/null +++ b/release/man2/sigpause.2 @@ -0,0 +1,97 @@ +.\" Copyright (C) 2004 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. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Mon Mar 3 23:33:12 JST 1997 +.\" by HANATAKA Shinya +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: interrupt ³ä¤ê¹þ¤ß +.\"WORD: mask ¥Þ¥¹¥¯ +.\"WORD: block ¥Ö¥í¥Ã¥¯¤¹¤ë +.\" +.TH SIGPAUSE 2 2004-05-10 "Linux 2.6" "Linux Programmer's Manual" +.SH ̾Á° +sigpause \- ¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤ò¥¢¥È¥ß¥Ã¥¯¤Ë²òÊü (release) ¤·¤Æ³ä¤ê¹þ¤ß (interrupt) ¤òÂÔ¤Ä +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sigpause(int " sigmask "); /* BSD */" +.sp +.BI "int sigpause(int " sig "); /* Unix95 */" +.fi +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤ò»È¤ï¤Ê¤¤¤³¤È¡£ +Âå¤ï¤ê¤Ë +.BR sigsuspend (2) +¤ò»È¤¦¤³¤È¡£ +.LP +´Ø¿ô +.BR sigpause () +¤Ï¥·¥°¥Ê¥ë¤òÂԤĤ褦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯ (¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î¥»¥Ã¥È) ¤òÊѹ¹¤·¡¢ +¥·¥°¥Ê¥ë¤¬ÅþÃ夹¤ë¤Î¤òÂԤġ£ +¥·¥°¥Ê¥ë¤¬ÅþÃ夹¤ë¤È¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï¸µ¤ËÌᤵ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR sigpause () +¤¬Ê֤俾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤Æ¤ª¤ê¡¢ +ÊÖ¤êÃÍ¤Ï \-1 ¤Ç¡¢ +.I errno +¤Ï +.B EINTR +¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ÍúÎò +¤³¤Î´Ø¿ô¤Î¸ÅŵŪ¤Ê BSD ÈÇ¤Ï 4.2BSD ¤ÇÅо줷¤¿¡£ +¤³¤Î´Ø¿ô¤Ï¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò +.I sigmask +¤ËÀßÄꤹ¤ë¡£ +¥·¥°¥Ê¥ë¤Î¿ô¤¬ 32 °Ê¾å¤ËÁý²Ã¤·¤¿¤È¤­¤Ë¡¢ +BSD ÈǤϸߴ¹À­¤Î¤Ê¤¤ Unix95 ÈǤËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +Unix95 ÈǤϡ¢»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë +.I sig +¤ò¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤«¤éºï½ü¤¹¤ë¤À¤±¤Ç¤¢¤ë¡£ +.\" __xpg_sigpause: Unix 95, spec 1170, SVID, SVR4, XPG +Ʊ¤¸Ì¾Á°¤Ç¸ß´¹À­¤Î¤Ê¤¤ 2 ¤Ä¤Î´Ø¿ô¤¬¤¢¤ë¤È¤¤¤¦ÉÔ¹¬¤Ê»öÂ֤ϡ¢ +.BR \%sigsuspend (2) +´Ø¿ô¤Ë¤è¤Ã¤Æ²ò¾Ã¤µ¤ì¤¿¡£ +¤³¤Î´Ø¿ô¤Ï (int ¤ÎÂå¤ï¤ê¤Ë) +.B "sigset_t *" +°ú¤­¿ô¤ò¤È¤ë¡£ +.LP +Linux ¤Ç¤Ï¡¢¤³¤Î¥ë¡¼¥Á¥ó¤Ï Sparc (sparc64) ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Î¤ß +¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +libc4 ¤È libc5 ¤Ë¤Ï BSD ÈǤ·¤«¤Ê¤¤¡£ +glibc ¤Ç¤Ï _XOPEN_SOURCE ¤¬ÄêµÁ¤µ¤ì¤Ê¤¤¸Â¤ê¡¢BSD ÈǤò»È¤¦¡£ +.\" .SH Ãí°Õ +.\" BSD ÈǤǤϡ¢ +.\" .RI ¡Ö sigmask +.\" ¤ò 0 ¤Ë¤·¤Æ¡¢¤É¤Î¥·¥°¥Ê¥ë¤â¥Ö¥í¥Ã¥¯¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡× +.\" ¤È¤¤¤¦¤Î¤¬¤è¤¯»È¤ï¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigaction (2), +.BR sigblock (2), +.BR sigprocmask (2), +.BR sigsuspend (2), +.BR sigvec (2) diff --git a/release/man2/sigpending.2 b/release/man2/sigpending.2 new file mode 100644 index 00000000..6435caee --- /dev/null +++ b/release/man2/sigpending.2 @@ -0,0 +1,96 @@ +.\" Copyright (c) 2005 Michael Kerrisk +.\" based on earlier work by faith@cs.unc.edu and +.\" Mike Battersby +.\" +.\" 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-09-15, mtk, Created new page by splitting off from sigaction.2 +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-10-03, Akihiro MOTOKI +.\" Updated 2005-12-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.16 +.\" +.\"WORD: pending ½èÍýÂÔ¤Á¤Î +.\" +.TH SIGPENDING 2 2008-10-04 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sigpending \- ½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Î¸¡ºº +.SH ½ñ¼° +.B #include +.sp +.BI "int sigpending(sigset_t *" set ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR sigpending (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +.PP +.BR sigpending () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤Ø¤ÎÇÛÁ÷¤òÂԤäƤ¤¤ë (pending) ¥·¥°¥Ê¥ë½¸¹ç +(¤¹¤Ê¤ï¤Á¡¢¶Ø»ßÃæ¤ËȯÀ¸¤·¤¿¥·¥°¥Ê¥ë) ¤òÊÖ¤¹¡£ +½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Î¥Þ¥¹¥¯¤¬ +.I set +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR sigpending () +¤ÏÀ®¸ù¤¹¤ì¤Ð 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤Ê¤é¤Ð \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I set +¤¬»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤¬¡¢¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ÎÍ­¸ú¤ÊÉôʬ¤Ç¤Ï¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +¥·¥°¥Ê¥ë½¸¹ç¤ÎÁàºî¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï +.BR sigsetops (3) +¤ò»²¾È¤Î¤³¤È¡£ + +¤¢¤ë¥¹¥ì¥Ã¥É¤ËÂФ¹¤ë½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Î½¸¹ç¤Ï¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¼«ÂΤؤνèÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤È¡¢¥×¥í¥»¥¹Á´ÂΤؤνèÍýÂÔ¤Á¤Î +¥·¥°¥Ê¥ë½¸¹ç¤ò¤¢¤ï¤»¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.BR signal (7) +»²¾È¡£ + +.BR fork (2) +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Î½èÍýÂÔ¤Á¥·¥°¥Ê¥ë½¸¹ç¤ÏºÇ½é¤Ï¶õ¤Ç¤¢¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¡¢½èÍýÂÔ¤Á¥·¥°¥Ê¥ë½¸¹ç¤ÏÊÝ»ý¤µ¤ì¤ë¡£ +.SH ¥Ð¥° +¥Ð¡¼¥¸¥ç¥ó 2.2.1 °ÊÁ°¤Î glibc ¤Ç¤Ï¡¢ +.BR sigpending () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ë¡¢½èÍýÂÔ¤Á¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤¬ +Àµ¤·¤¯ÊÖ¤µ¤ì¤Ê¤¤¤È¤¤¤¦¥Ð¥°¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigaction (2), +.BR signal (2), +.BR sigprocmask (2), +.BR sigsuspend (2), +.BR sigsetops (3), +.BR signal (7) diff --git a/release/man2/sigprocmask.2 b/release/man2/sigprocmask.2 new file mode 100644 index 00000000..31714f3a --- /dev/null +++ b/release/man2/sigprocmask.2 @@ -0,0 +1,147 @@ +.\" Copyright (c) 2005 Michael Kerrisk +.\" based on earlier work by faith@cs.unc.edu and +.\" Mike Battersby +.\" +.\" 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-09-15, mtk, Created new page by splitting off from sigaction.2 +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-10-03, Akihiro MOTOKI +.\" +.TH SIGPROCMASK 2 2008-10-17 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sigprocmask \- ¶Ø»ß¤¹¤ë¥·¥°¥Ê¥ë¤Î³Îǧ¤ÈÊѹ¹ +.SH ½ñ¼° +.B #include +.sp +.BI "int sigprocmask(int " how ", const sigset_t *" set , +.BI "sigset_t *" oldset ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR sigprocmask (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +.BR sigprocmask () +¤ò»È¤¦¤È¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Î¼èÆÀ/Êѹ¹¤¬¤Ç¤­¤ë¡£ +¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤ËÂФ·¤Æ¸½ºßÇÛÁ÷¤¬¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î +½¸¹ç¤Î¤³¤È¤Ç¤¢¤ë (¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR signal (7) +¤â»²¾È¤Î¤³¤È)¡£ + +¤³¤Î¥³¡¼¥ë¤ÎÆ°ºî¤Ï +.I how +¤ÎÃͤˤè¤Ã¤Æ·è¤Þ¤ë: +.TP +.B SIG_BLOCK +¶Ø»ß¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î½¸¹ç¤Ï¸½ºß¤ÎÃÍ¤È +.I set +°ú¤­¿ô¤ò·ë¹ç¤·¤¿¤â¤Î¤È¤Ê¤ë¡£ +.TP +.B SIG_UNBLOCK +¸½ºß¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½¸¹ç¤«¤é +.I set +¤Ë¤¢¤ë¥·¥°¥Ê¥ë¤ò¼è¤ê½ü¤¯¡£¶Ø»ß¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤ò¼è¤ê½ü¤³¤¦¤È +¤¹¤ë¤³¤È¤âǧ¤á¤é¤ì¤Æ¤¤¤ë¡£ +.TP +.B SIG_SETMASK +¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½¸¹ç¤Ë +.I set +°ú¤­¿ô¤òÀßÄꤹ¤ë¡£ +.PP +.I oldset +¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Îº£¤Þ¤Ç¤ÎÃͤò +.I oldset +¤Ë³ÊǼ¤¹¤ë¡£ + +.I set +¤¬ NULL ¤Ç¤¢¤ì¤Ð¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÏÊѹ¹¤µ¤ì¤Ê¤¤ (¤¹¤Ê¤ï¤Á¡¢ +.I how +¤Ï̵»ë¤µ¤ì¤ë)¡£ +.I set +¤ÎÃͤˤ«¤«¤ï¤é¤º¡¢¸½ºß¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÎÃÍ¤Ï +.I oldset +¤ËÆþ¤ì¤ÆÊÖ¤µ¤ì¤ë (⤷¡¢ +.I oldset +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç)¡£ + +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Î¥×¥í¥»¥¹¤Ç +.BR sigprocmask () +¤ò»ÈÍѤ·¤¿¾ì¹ç¤ÎÆ°ºî¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.BR pthread_sigmask (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR sigprocmask () +¤ÏÀ®¸ù¤¹¤ì¤Ð 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤Ê¤é¤Ð \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.B EINVAL +.I how +¤Ë»ØÄꤵ¤ì¤¿Ãͤ¬Í­¸ú¤Ç¤Ï¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.B SIGKILL +¤ä +.B SIGSTOP +¤ò¶Ø»ß¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¶Ø»ß¤·¤è¤¦¤È¤·¤Æ¤âÌۤäÆ̵»ë¤µ¤ì¤ë¡£ + +¥×¥í¥»¥¹Æâ¤Î³Æ¥¹¥ì¥Ã¥É¤Ï¤½¤ì¤¾¤ìÀìÍѤΥ·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò»ý¤Ä¡£ + +.BR fork (2) +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÏÊÝ»ý¤µ¤ì¤ë¡£ + +¥·¥°¥Ê¥ë +.BR SIGBUS , +.BR SIGFPE , +.BR SIGILL , +.B SIGSEGV +¤¬¶Ø»ß¤µ¤ì¤Æ¤¤¤ë´Ö¤ËÀ¸À®¤µ¤ì¤¿¾ì¹ç¤Ç¡¢ +¤½¤Î¥·¥°¥Ê¥ë¤¬ +.BR kill (2), +.BR sigqueue (2), +.BR raise (3) +¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤Ê¤¤¤È¤­¤Ë¤Ï¡¢ +¤½¤Î¸å¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.PP +¥·¥°¥Ê¥ë½¸¹ç¤ÎÁàºî¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï +.BR sigsetops (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR pause (2), +.BR sigaction (2), +.BR signal (2), +.BR sigpending (2), +.BR sigqueue (2), +.BR sigsuspend (2), +.BR pthread_sigmask (3), +.BR sigsetops (3), +.BR signal (7) diff --git a/release/man2/sigqueue.2 b/release/man2/sigqueue.2 new file mode 100644 index 00000000..b38ae646 --- /dev/null +++ b/release/man2/sigqueue.2 @@ -0,0 +1,168 @@ +.\" 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. +.\" +.\" added note on self-signaling, aeb, 2002-06-07 +.\" added note on CAP_KILL, mtk, 2004-06-16 +.\" +.\" Japanese Version Copyright (c) 2002, 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated 2002-08-06, Yuichi SATO +.\" Updated & Modified 2005-01-08, Yuichi SATO +.\" Updated 2007-09-08, Akihiro MOTOKI , LDP v2.64 +.\" +.TH SIGQUEUE 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sigqueue, rt_sigqueueinfo \- ¥·¥°¥Ê¥ë¤È¥Ç¡¼¥¿¤ò¥×¥í¥»¥¹¤ËÁ÷¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int sigqueue(pid_t " pid ", int " sig ", const union sigval " value ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR sigqueue (): +_POSIX_C_SOURCE\ >=\ 199309L +.SH ÀâÌÀ +.BR sigqueue () +¤Ï +.I sig +¤Ç»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤ò¡¢PID ¤¬ +.I pid +¤Ç¤¢¤ë¥×¥í¥»¥¹¤ËÁ÷¤ë¡£ +¥·¥°¥Ê¥ë¤òÁ÷¤ë¤Î¤ËɬÍפʸ¢¸Â¤Ï +.BR kill (2) +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.BR kill (2) +¤ÈƱÍͤˡ¢¥Ì¥ë¡¦¥·¥°¥Ê¥ë (0) ¤ò»È¤Ã¤Æ +»ØÄꤷ¤¿ PID ¤Î¥×¥í¥»¥¹¤¬Â¸ºß¤¹¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.I value +°ú¤­¿ô¤Ï¥·¥°¥Ê¥ë¤È°ì½ï¤ËÁ÷¤ë¥Ç¡¼¥¿¤ÎÉÕ°¥¢¥¤¥Æ¥à¤ò»ØÄꤹ¤ë¡£ +.I value +¤Ï (À°¿ô¤Þ¤¿¤Ï¥Ý¥¤¥ó¥¿¤ÎÃͤǤ¢¤ê) °Ê²¼¤Î¤è¤¦¤Ê·¿¤Ç¤¢¤ë¡£ +.sp +.in +4n +.nf +union sigval { + int sival_int; + void *sival_ptr; +}; +.fi +.in + +¼õ¼èÀè¤Î¥×¥í¥»¥¹¤Ë¡¢¤³¤Î¥·¥°¥Ê¥ë¤ËÂФ¹¤ë¥Ï¥ó¥É¥é¤ò +.RB ( sigaction (2) +¤Ë +.B SA_SIGINFO +¤ò»ØÄꤷ¤Æ) ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤ª¤¯¤È¡¢ +¤½¤Î¥Ï¥ó¥É¥é¤ÎÂè 2 °ú¤­¿ô¤ËÅϤµ¤ì¤ë +.I siginfo_t +¹½Â¤ÂΤΠ+.I si_value +¥Õ¥£¡¼¥ë¥É¤Ë¤è¤Ã¤Æ¡¢¤³¤Î¥Ç¡¼¥¿¤ò¼èÆÀ¤Ç¤­¤ë¡£ +¤µ¤é¤Ë¡¢¤³¤Î¹½Â¤ÂΤΠ+.I si_code +¥Õ¥£¡¼¥ë¥É¤Ï +.B SI_QUEUE +¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR sigqueue () +¤Ï 0 ¤òÊÖ¤¹¡£ +¤³¤ì¤Ï¼õ¤±¼è¤ê¦¥×¥í¥»¥¹¤ÎÂÔ¤Á¹ÔÎó¤Ë +¥·¥°¥Ê¥ë¤¬Àµ¤·¤¯Æþ¤ì¤é¤ì¤¿¤³¤È¤ò¼¨¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¥¨¥é¡¼¤òɽ¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +ÂÔ¤Á¹ÔÎó¤ËÆþ¤ì¤é¤ì¤ë¥·¥°¥Ê¥ë¤ÎºÇÂç¿ô¤Ë㤷¤¿ +(¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR signal (7) +¤ò»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EINVAL +.I sig +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EPERM +¤³¤Î¥×¥í¥»¥¹¤Ë¤Ï¡¢¼õ¤±¼è¤ê¦¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¸¢¸Â¤¬¤Ê¤¤¡£ +ɬÍפʸ¢¸Â¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR kill (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.B ESRCH +.I pid +¤Ë¥Þ¥Ã¥Á¤¹¤ë PID ¤Î¥×¥í¥»¥¹¤¬¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.2 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ë¤³¤Î´Ø¿ô¤¬¥·¥°¥Ê¥ë¤òÁ÷¤Ã¤¿¤È¤­¤Ë¡¢ +¥·¥°¥Ê¥ë¤¬¸Æ¤Ó½Ð¤·Â¦¥¹¥ì¥Ã¥É¤Ë¥Ö¥í¥Ã¥¯¤µ¤ì¤º¡¢ +¤«¤Ä (¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Ê¤«¤Ã¤¿¡¢¤Þ¤¿¤Ï +.BR sigwait (3) +¤ò»ÈÍѤ¹¤ë¤Î¤òÂԤäƤ¤¤ë¤³¤È¤Ë¤è¤ê) +¤³¤Î¥·¥°¥Ê¥ë¤ò°·¤¦¥¹¥ì¥Ã¥É¤¬²¿¤â¤Ê¤¤¾ì¹ç¤Ï¡¢ +¤³¤Î´Ø¿ô¤¬¥ê¥¿¡¼¥ó¤¹¤ëÁ°¤Ë¡¢¾¯¤Ê¤¯¤È¤â +¤½¤Î¥¹¥ì¥Ã¥É¤ËÂФ·¤Æ¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +Linux ¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤µ¤ì¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î̾Á°¤Ï¼ÂºÝ¤Ë¤Ï +.BR rt_sigqueueinfo () +¤Ç¤¢¤ë¡£ +.BR rt_sigqueueinfo () +¤Ç¤Ï 3 ÈÖÌܤΰú¤­¿ô¤Ë°ã¤¤¤¬¤¢¤ê¡¢ +.I siginfo_t +¹½Â¤ÂΤǤ¢¤ë¡£ +.I siginfo_t +¹½Â¤ÂΤϡ¢¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ËÅϤµ¤ì¤¿¤ê¡¢ +¥·¥°¥Ê¥ë¼õ¿®¥×¥í¥»¥¹¤Î +.BR sigtimedwait (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤«¤éÊÖ¤µ¤ì¤¿¤ê¤¹¤ë¡£ +glibc ¤Î +.BR sigqueue () +¥é¥Ã¥Ñ¡¼´Ø¿ôÆâÉô¤Ç¤Ï¡¢ +¤³¤Î°ú¤­¿ô +.I info +¤Ï°Ê²¼¤Î¤è¤¦¤Ë½é´ü²½¤µ¤ì¤ë¡£ +.in +4n +.nf + +info.si_signo = sig; /* argument supplied to sigqueue() */ +info.si_code = SI_QUEUE; +info.si_pid = getpid(); /* Process ID of sender */ +info.si_uid = getuid(); /* Real UID of sender */ +info.si_value = val; /* argument supplied to sigqueue() */ +.fi +.in +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigaction (2), +.BR signal (2), +.BR sigwait (3), +.BR signal (7) diff --git a/release/man2/sigreturn.2 b/release/man2/sigreturn.2 new file mode 100644 index 00000000..18cded74 --- /dev/null +++ b/release/man2/sigreturn.2 @@ -0,0 +1,83 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created Sat Aug 21 1995 Thomas K. Dyas +.\" Modified Tue Oct 22 22:09:03 1996 by Eric S. Raymond +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-03-03, HANATAKA Shinya +.\" Updated 2005-09-04, Akihiro MOTOKI +.\" Updated 2008-08-07, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: signal handler ¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é +.\"WORD: stack frame ¥¹¥¿¥Ã¥¯¡¦¥Õ¥ì¡¼¥à +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: interrupt ³ä¤ê¹þ¤ß +.\"WORD: architecture ¥¢¡¼¥­¥Æ¥¯¥Á¥ã +.\" +.TH SIGRETURN 2 2008-06-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sigreturn \- ¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤«¤éÊ֤ꡢ¥¹¥¿¥Ã¥¯¤òÁݽü¤¹¤ë +.SH ½ñ¼° +.BI "int sigreturn(unsigned long " __unused ); +.SH ÀâÌÀ +Linux ¥«¡¼¥Í¥ë¤Ï¡¢ +¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥éÍѤ˥¹¥¿¥Ã¥¯¡¦¥Õ¥ì¡¼¥à¤òºîÀ®¤¹¤ëºÝ¡¢ +.BR sigreturn () +¤ò¥¹¥¿¥Ã¥¯¡¦¥Õ¥ì¡¼¥à¤ËÁÞÆþ¤·¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬ÊÖ¤ë¤È¤­¤Ë +.BR sigreturn () +¤¬¸Æ¤Ð¤ì¤ë¤è¤¦¤Ë¤¹¤ë¡£ + +.BR sigreturn () +¤Ï¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤òµ¯Æ°¤¹¤ë¤¿¤á¤Ë¹Ô¤Ã¤¿¤³¤È¤ÎÁ´¤Æ \(em +¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÎÊѹ¹¡¢¥¹¥¿¥Ã¥¯¤ÎÀÚ¤êÂؤ¨ +.RB ( sigaltstack (2) +»²¾È) \(em ¤Î¼è¤ê¾Ã¤·¤ò¹Ô¤¦¡£ +¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÎÉü¸µ¡¢¥¹¥¿¥Ã¥¯¤ÎÀÚ¤êÂؤ¨¡¢ +¥×¥í¥»¥¹¤Î¥³¥ó¥Æ¥­¥¹¥È (¥ì¥¸¥¹¥¿¡¢¥×¥í¥»¥Ã¥µ¡¦¥Õ¥é¥°) ¤ÎÉü¸µ¤ò¹Ô¤¤¡¢ +¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì½ê¤«¤é¤½¤Î¤Þ¤Þ¼Â¹Ô¤ò +ºÆ³«¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR sigreturn () +¤¬Ê֤뤳¤È¤Ï¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +/usr/src/linux/arch/i386/kernel/signal.c +.br +/usr/src/linux/arch/alpha/kernel/entry.S +.SH ½àµò +.BR sigreturn () +¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.SH Ãí°Õ +.BR sigreturn () +¥³¡¼¥ë¤Ï¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤ò¼ÂÁõ¤¹¤ë¤¿¤á¤Ë¥«¡¼¥Í¥ë¤Ë¤è¤ê»ÈÍѤµ¤ì¤ë¡£ +¤³¤ì¤òľÀܸƤӽФ·¤Æ¤Ï +.B ·è¤·¤Æ +¤¤¤±¤Ê¤¤¡£¤µ¤é¤Ë +.I __unused +°ú¤­¿ô¤¬¤É¤Î¤è¤¦¤Ë»È¤ï¤ì¤ë¤«¤Ï¤½¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë°Í¸¤·¤ÆÊѲ½¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigaltstack (2), +.BR signal (2), +.BR signal (7) diff --git a/release/man2/sigsuspend.2 b/release/man2/sigsuspend.2 new file mode 100644 index 00000000..3fb41dbe --- /dev/null +++ b/release/man2/sigsuspend.2 @@ -0,0 +1,118 @@ +.\" Copyright (c) 2005 Michael Kerrisk +.\" based on earlier work by faith@cs.unc.edu and +.\" Mike Battersby +.\" +.\" 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-09-15, mtk, Created new page by splitting off from sigaction.2 +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-10-03, Akihiro MOTOKI +.\" +.TH SIGSUSPEND 2 2008-08-29 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sigsuspend \- ¥·¥°¥Ê¥ë¤òÂÔ¤Ä +.SH ½ñ¼° +.B #include +.sp +.BI "int sigsuspend(const sigset_t *" mask ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR sigsuspend (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +.BR sigsuspend () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò +.I mask +¤Ç»ØÄꤵ¤ì¤¿¥Þ¥¹¥¯¤Ë°ì»þŪ¤ËÃÖ¤­´¹¤¨¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Îµ¯Æ°¤â¤·¤¯¤Ï¥×¥í¥»¥¹¤Î½ªÎ»¤¬¥¢¥¯¥·¥ç¥ó¤È¤·¤Æ +ÀßÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤òÄä»ß¤¹¤ë¡£ + +¥·¥°¥Ê¥ë¤¬¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë¤â¤Î¤Î¾ì¹ç¡¢ +.BR sigsuspend () +¤ÏÊÖ¤é¤Ê¤¤¡£¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤¿¾ì¹ç¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î½èÍý¤¬½ª¤ï¤Ã¤¿¸å¤Ë +.BR sigsuspend () +¤ÏÊ֤ꡢ¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï +.BR sigsuspend () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ëÁ°¤Î¾õÂÖ¤ËÉü¸µ¤µ¤ì¤ë¡£ + +.B SIGKILL +¤È +.B SIGSTOP +¤ò¶Ø»ß (block) ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤; +¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤ò +.I mask +¤Ë»ØÄꤷ¤Æ¤â¡¢¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR sigsuspend () +¤Ï¾ï¤Ë \-1 ¤òÊÖ¤·¡¢Ä̾ï¤Ï +.B EINTR +¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I mask +¤¬»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤¬¡¢¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ÎÍ­¸ú¤ÊÉôʬ¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINTR +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥·¥°¥Ê¥ë¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.PP +.BR sigsuspend () +¤Ï¡¢Ä̾¥¯¥ê¥Æ¥£¥«¥ë¡¦¥³¡¼¥É¡¦¥»¥¯¥·¥ç¥ó (critical code section) ¤Î +¼Â¹ÔÃæ¤Ë¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤Î¤òËɻߤ¹¤ë¤¿¤á¤Ë¡¢ +.BR sigprocmask (2) +¤ÈÁȤ߹ç¤ï¤»¤Æ»ÈÍѤµ¤ì¤ë¡£ +¤Þ¤ººÇ½é¤Ë¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï +.BR sigprocmask (2) +¤ò»È¤Ã¤Æ¥·¥°¥Ê¥ë¤ò¶Ø»ß¤¹¤ë¡£ +¥¯¥ê¥Æ¥£¥«¥ë¡¦¥³¡¼¥É¤¬´°Î»¤¹¤ë¤È¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï +.BR sigprocmask (2) +¤¬ +.RI ( oldset +°ú¤­¿ô¤Ç) ÊÖ¤¹¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò»ØÄꤷ¤Æ +.BR sigsuspend () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢¥¯¥ê¥Æ¥£¥«¥ë¡¦¥³¡¼¥É¼Â¹ÔÃæ¤ËȯÀ¸¤·¤¿ +¥·¥°¥Ê¥ë¤òÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£ +.PP +¥·¥°¥Ê¥ë½¸¹ç¤ÎÁàºî¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï +.BR sigsetops (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR pause (2), +.BR sigaction (2), +.BR signal (2), +.BR sigprocmask (2), +.BR sigwaitinfo (2), +.BR sigsetops (3), +.BR sigwait (3), +.BR signal (7) diff --git a/release/man2/sigvec.2 b/release/man2/sigvec.2 new file mode 100644 index 00000000..aa9f985d --- /dev/null +++ b/release/man2/sigvec.2 @@ -0,0 +1,61 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 Tue Oct 22 22:09:26 1996 by Eric S. Raymond +.\" FIXME -- Error conditions need to be documented +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Mon Mar 3 23:37:35 JST 1997 +.\" by HANATAKA Shinya +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: obsolete ÇÑ»ß +.\" +.TH SIGVEC 2 1995-08-31 "Linux 1.3" "Linux Programmer's Manual" +.SH ̾Á° +sigvec \- BSD ¥½¥Õ¥È¥¦¥§¥¢¡¦¥·¥°¥Ê¥ë´Ä¶­ +.SH ½ñ¼° +.B #include +.sp +.BI "int sigvec(int " sig ", struct sigvec *" vec ", struct sigvec *" ovec ); +.SH ÀâÌÀ +¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï +.BR sigaction (2) +¤Ë¤è¤Ã¤ÆÇÑ»ß(obsolete)¤µ¤ì¤¿¡£ +.PP +Linux ¤Ç¤Ï +.BR sigvec () +¤Ï +.BR sigaction () +¤Ë #define ¤µ¤ì¤Æ¤ª¤ê¡¢ +Ä󶡤µ¤ì¤ë¤â¤Î¤Ï BSD +.BR sigvec () +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤È¤ÏÎɤ¯¤Æ¤â +¤ª¤ª¤¶¤Ã¤Ñ¤Ê¶á»÷¤Ë¤¹¤®¤Ê¤¤¡£ +.SH ½àµò +BSD, SVr4 +.SH ´ØÏ¢¹àÌÜ +.BR sigaction (2), +.BR signal (2) diff --git a/release/man2/sigwaitinfo.2 b/release/man2/sigwaitinfo.2 new file mode 100644 index 00000000..567ac971 --- /dev/null +++ b/release/man2/sigwaitinfo.2 @@ -0,0 +1,197 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2003 Yuichi SATO +.\" all rights reserved. +.\" Translated 2003-02-16, Yuichi SATO +.\" Updated 2006-07-21, Akihiro MOTOKI , LDP v2.36 +.\" Updated 2008-08-07, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: pending ÂÔµ¡Ãæ¤Ç¤¢¤ë +.\" +.TH SIGWAITINFO 2 2008-10-04 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sigwaitinfo, sigtimedwait \- ¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤¿¥·¥°¥Ê¥ë¤òƱ´ü¤·¤ÆÂÔ¤Ä +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sigwaitinfo(const sigset_t *" set ", siginfo_t *" info ");" +.sp +.BI "int sigtimedwait(const sigset_t *" set ", siginfo_t *" info ", " +.BI " const struct timespec *" timeout ");" +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR sigwaitinfo (), +.BR sigtimedwait (): +_POSIX_C_SOURCE\ >=\ 199309L +.SH ÀâÌÀ +.BR sigwaitinfo () +¤Ï +.I set +¤Î¤¦¤Á¤Î¤É¤ì¤«¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¡¢ +¸Æ¤Ó½Ð¤·¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤ò°ì»þÄä»ß¤¹¤ë +(¸Æ¤Ó½Ð¤·¥¹¥ì¥Ã¥É¤ËÂФ·¤Æ +.I set +¤Î¤¦¤Á¤Î¤É¤ì¤«¤Î¥·¥°¥Ê¥ë¤¬´û¤ËÂÔµ¡Ãæ (pending) ¤Ç¤¢¤ë¾ì¹ç¡¢ +.BR sigwaitinfo () +¤Ï¤½¤Î¥·¥°¥Ê¥ë¤Î¾ðÊó¤òÊÖ¤·¤Æ¤¹¤°¤ËÌá¤ë)¡£ +.PP +.BR sigwaitinfo () +¤ÏÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¤òÂÔµ¡Ãæ¤Î¥·¥°¥Ê¥ë¤Î½¸¹ç¤«¤éºï½ü¤·¡¢ +´Ø¿ô¤Î·ë²Ì¤È¤·¤Æ¥·¥°¥Ê¥ëÈÖ¹æ¤òÊÖ¤¹¡£ +.I info +°ú¤­¿ô¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î¾ðÊó¤¬Æþ¤Ã¤¿ +.I siginfo_t +·¿ +.RB ( sigaction (2) +¤ò»²¾È) ¤Î¹½Â¤ÂΤòÊÖ¤¹¡£ +.PP +.BR sigwaitinfo () +¤ÇÊÖ¤µ¤ì¤ë¥·¥°¥Ê¥ë¤Ï¡¢Ä̾ï¤Î½çÈÖ¤ÇÇÛÁ÷¤µ¤ì¤ë¡£ +¾ÜºÙ¤Ï +.BR signal (7) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +.BR sigtimedwait () +¤Ï¡¢ +.BR sigwaitinfo () +¤È¼¡¤ÎÅÀ¤ò½ü¤¤¤ÆÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ë¤Ï¤â¤¦ 1 ¤Ä¤Î°ú¤­¿ô +.I timeout +¤¬¤¢¤ê¡¢¥¹¥ì¥Ã¥É¤¬°ì»þÄä»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤òÄê¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î°ú¤­¿ô¤Î·¿¤Ï°Ê²¼¤Î¤È¤ª¤ê¤Ç¤¢¤ë: +.sp +.in +4n +.nf +struct timespec { + long tv_sec; /* Éà */ + long tv_nsec; /* ¥Ê¥ÎÉà */ +} +.fi +.in +.sp +¤³¤Î¹½Â¤ÂΤΠ2 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤¬¤È¤â¤Ë 0 ¤Î¾ì¹ç¡¢¥Ý¡¼¥ê¥ó¥°¤¬¹Ô¤ï¤ì¤ë: +.BR sigtimedwait () +¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¥×¥í¥»¥¹¤ËÂФ·¤Æ +ÂÔµ¡¤·¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î¾ðÊó¤òÊÖ¤·¤ÆÌá¤ë¤«¡¢ +.I set +¤Î¤¦¤Á¤Î¤É¤Î¥·¥°¥Ê¥ë¤âÂÔµ¡¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¥¨¥é¡¼¤òÊÖ¤·¤ÆÌá¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR sigwaitinfo () +¤È +.BR sigtimedwait () +¤Ï¥·¥°¥Ê¥ëÈÖ¹æ (¤¹¤Ê¤ï¤Á 0 ¤è¤êÂ礭¤¤¿ô) ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢2 ¤Ä¤Î´Ø¿ô¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ï¥¨¥é¡¼¤òɽ¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.I set +¤Î¤¦¤Á¤Î¤É¤Î¥·¥°¥Ê¥ë¤â +.BR sigtimedwait () +¤Ë»ØÄꤵ¤ì¤¿ +.I timeout +¤Î´ü´ÖÆâ¤ËÇÛÁ÷¤µ¤ì¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINTR +¥·¥°¥Ê¥ëÂÔ¤Á¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤ÆÃæÃÇ (interrupt) ¤µ¤ì¤¿ +(¤³¤Î¥Ï¥ó¥É¥é¤Ï +.I set +¤Ë¤¢¤ë¥·¥°¥Ê¥ë°Ê³°¤Î¤â¤Î¤Ç¤¢¤ë)¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.I timeout +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +Ä̾ï¤Î»ÈÍÑË¡¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¥×¥í¥»¥¹¤Ï¤³¤ì¤é¤Î´Ø¿ô¤è¤êÀè¤Ë +.BR sigprocmask (2) +¤Î¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤ê +.I set +¤Ë´Þ¤Þ¤ì¤ë¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤· +(¤½¤Î¤¿¤á¤Ë¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤¬¤³¤Î¸å¤Ë³¤¯ +.BR sigwaitinfo () +¤ä +.BR sigtimedwait () +¤Î¸Æ¤Ó½Ð¤·¤Î´Ö¤ËÇÛÁ÷¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥Ç¥Õ¥©¥ë¥È¤ÎÇÛÃ֤ϹԤï¤ì¤º)¡¢ +¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤ËÂФ¹¤ë¥Ï¥ó¥É¥é¤ÏÀßÄꤷ¤Ê¤¤¡£ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +.BR sigwaitinfo () +¤ä +.BR sigtimedwait () +¤ò¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É°Ê³°¤Î¥¹¥ì¥Ã¥É¤Ë¤½¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¡¢ +Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤Ç³ºÅö¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É¤ËÂФ¹¤ë½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Î½¸¹ç¤Ï¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¼«Âΰ¸¤Æ¤Î½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤È¡¢¥×¥í¥»¥¹Á´Âΰ¸¤Æ¤Î +½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤ò¤¢¤ï¤»¤¿¤â¤Î¤Ç¤¢¤ë +.RB ( signal (7) +»²¾È)¡£ + +°ì¤Ä¤Î¥×¥í¥»¥¹Æâ¤ÎÊ£¿ô¤Î¥¹¥ì¥Ã¥É¤¬ +.BR sigwaitinfo () +¤ä +.BR sigtimedwait () +¤ÇƱ¤¸¥·¥°¥Ê¥ë¤òÂԤäÆÄä»ß¤·¤¿¾ì¹ç¡¢ +¥×¥í¥»¥¹Á´Âΰ¸¤Æ¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤È¡¢Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤Î¤¦¤Á°ì¤Ä¤À¤±¤¬ +¼ÂºÝ¤Ë¤½¤Î¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£ +¤É¤Î¥¹¥ì¥Ã¥É¤¬¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¤«¤Ï·è¤Þ¤Ã¤Æ¤¤¤Ê¤¤¡£ + +POSIX ¤Ç¤Ï +.BR sigtimedwait () +¤Î°ú¤­¿ô +.I timeout +¤ÎÃͤò NULL ¤Ë¤·¤¿¾ì¹ç¤Î°ÕÌ£¤ò̤ÄêµÁ¤È¤·¤Æ¤¤¤ë¡£ +.BR sigwaitinfo () +¤ò¸Æ¤Ó½Ð¤·¤¿¤Î¤ÈƱ¤¸°ÕÌ£¤È¤·¤Æ¤â¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +¼ÂºÝ Linux ¤Ç¤Ï¤³¤Î¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +Linux ¤Ç¤Ï¡¢ +.BR sigwaitinfo () +¤Ï +.BR sigtimedwait () +¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤¿¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigaction (2), +.BR signal (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigqueue (2), +.BR sigsetops (3), +.BR sigwait (3), +.BR signal (7), +.BR time (7) diff --git a/release/man2/socket.2 b/release/man2/socket.2 new file mode 100644 index 00000000..0aa89b0f --- /dev/null +++ b/release/man2/socket.2 @@ -0,0 +1,444 @@ +'\" t +.\" 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. +.\" +.\" $Id: socket.2,v 1.4 1999/05/13 11:33:42 freitag Exp $ +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 1998, 1999 by Andi Kleen +.\" 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 ÈóƱ´ü +.\" +.TH SOCKET 2 2009-01-19 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +socket \- ÄÌ¿®¤Î¤¿¤á¤ÎüÅÀ(endpoint)¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.br +.B #include +.sp +.BI "int socket(int " domain ", int " type ", int " protocol ); +.SH ÀâÌÀ +.BR socket () +¤ÏÄÌ¿®¤Î¤¿¤á¤ÎüÅÀ(endpoint)¤òºîÀ®¤·¡¢¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼(descriptor)¤òÊÖ¤¹¡£ +.PP +.I domain +°ú¿ô¤ÏÄÌ¿®¤ò¹Ô¤Ê¤¦¥É¥á¥¤¥ó¤ò»ØÄꤹ¤ë; ¤³¤ì¤Ï¤É¤Î +¥×¥í¥È¥³¥ë¡¦¥Õ¥¡¥ß¥ê(protocol family)¤òÄÌ¿®¤Ë»ÈÍѤ¹¤ë¤«¤ò»ØÄꤹ¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥ß¥ê¤Ï +.I +¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¸½ºß¡¢Íý²ò¤Ç¤­¤ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï°Ê²¼¤ÎÄ̤ꡣ +.TS +tab(:); +l l l. +̾Á°:ÌÜŪ:¥Þ¥Ë¥å¥¢¥ë +T{ +.BR AF_UNIX ", " AF_LOCAL +T}:T{ +¥í¡¼¥«¥ëÄÌ¿® +T}:T{ +.BR unix (7) +T} +T{ +.B AF_INET +T}:IPv4 ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¡¦¥×¥í¥È¥³¥ë:T{ +.BR ip (7) +T} +T{ +.B AF_INET6 +T}:IPv6 ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¡¦¥×¥í¥È¥³¥ë:T{ +.BR ipv6 (7) +T} +T{ +.B AF_IPX +T}:IPX \- Novell ¥×¥í¥È¥³¥ë: +T{ +.B AF_NETLINK +T}:T{ +¥«¡¼¥Í¥ë¡¦¥æ¡¼¥¶¡¦¥Ç¥Ð¥¤¥¹ +T}:T{ +.BR netlink (7) +T} +T{ +.B AF_X25 +T}:ITU-T X.25 / ISO-8208 ¥×¥í¥È¥³¥ë:T{ +.BR x25 (7) +T} +T{ +.B AF_AX25 +T}:T{ +¥¢¥Þ¥Á¥å¥¢ÌµÀþ AX.25 ¥×¥í¥È¥³¥ë +T}: +T{ +.B AF_ATMPVC +T}:À¸¤Î ATM PVC ¤Ë¥¢¥¯¥»¥¹¤¹¤ë: +T{ +.B AF_APPLETALK +T}:¥¢¥Ã¥×¥ë¥È¡¼¥¯:T{ +.BR ddp (7) +T} +T{ +.B AF_PACKET +T}:T{ +Äã¥ì¥Ù¥ë¤Î¥Ñ¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +T}:T{ +.BR packet (7) +T} +.TE +.PP +¥½¥±¥Ã¥È¤Ï +.I type +¤Ç»ØÄꤵ¤ì¤ë·¿¤ò»ý¤Á¡¢¤½¤ì¤ÏÄÌ¿®Êý¼°(semantics)¤ò»ØÄꤹ¤ë¡£ +ÄêµÁ¤µ¤ì¤Æ¤¤¤ë·¿¤Ï¸½ºß°Ê²¼¤ÎÄ̤ꡣ +.TP 16 +.B SOCK_STREAM +½ç½øÀ­¤È¿®ÍêÀ­¤¬¤¢¤ê¡¢ÁÐÊý¸þ¤Î¡¢Àܳ¤µ¤ì¤¿ +¥Ð¥¤¥È¡¦¥¹¥È¥ê¡¼¥à(byte stream)¤òÄ󶡤¹¤ë¡£ +ÂÓ°è³°(out-of-band)¥Ç¡¼¥¿Å¾Á÷¥á¥«¥Ë¥º¥à¤â¥µ¥Ý¡¼¥È¤µ¤ì¤ë¡£ +.TP +.B SOCK_DGRAM +¥Ç¡¼¥¿¥°¥é¥à(Àܳ¡¢¿®ÍêÀ­Ìµ¤·¡¢¸ÇÄêºÇÂçĹ¥á¥Ã¥»¡¼¥¸) +¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +.TP +.B SOCK_SEQPACKET +¸ÇÄêºÇÂçĹ¤Î¥Ç¡¼¥¿¥°¥é¥àžÁ÷¥Ñ¥¹¤Ë´ð¤Å¤¤¤¿½ç½øÀ­¡¢¿®ÍêÀ­¤Î¤¢¤ë +ÁÐÊý¸þ¤ÎÀܳ¤Ë´ð¤Å¤¤¤¿ÄÌ¿®¤òÄ󶡤¹¤ë¡£¼õ¤±¼è¤ê¦¤Ç¤Ï¤½¤ì¤¾¤ì¤ÎÆþÎÏ +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ç¥Ñ¥±¥Ã¥ÈÁ´ÂΤòÆɤ߼è¤ë¤³¤È¤¬Í׵ᤵ¤ì¤ë¡£ +.TP +.B SOCK_RAW +À¸¤Î¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥×¥í¥È¥³¥ë¤Ø¤Î¥¢¥¯¥»¥¹¤òÄ󶡤¹¤ë¡£ +.TP +.B SOCK_RDM +¿®ÍêÀ­¤Ï¤¢¤ë¤¬¡¢½ç½ø¤ÏÊݾڤ·¤Ê¤¤¥Ç¡¼¥¿¥°¥é¥àÁؤòÄ󶡤¹¤ë¡£ +.TP +.B SOCK_PACKET +Çѻߤµ¤ì¤Æ¤ª¤ê¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.BR packet (7) +¤ò»²¾È¤¹¤ë¤³¤È +.PP +¤¢¤ë¼ï¤Î¥½¥±¥Ã¥È·¿¤¬Á´¤Æ¤Î¥×¥í¥È¥³¥ë¡¦¥Õ¥¡¥ß¥ê¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +Î㤨¤Ð +.B SOCK_SEQPACKET +¤Ï +.B AF_INET +¤Ë¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +Linux 2.6.27 °Ê¹ß¤Ç¤Ï¡¢ +.I type +°ú¿ô¤ÏÆó¤ÄÌܤÎÌÜŪ¤Ë¤â»ÈÍѤµ¤ì¤ë¡£ +¥½¥±¥Ã¥È¤Î·¿¤ò»ØÄꤹ¤ë¤Î¤Ë²Ã¤¨¤Æ¡¢ +°Ê²¼¤ÎÃͤΤ¤¤¯¤Ä¤«¤ò¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýÏ (OR) ¤Ç»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +.BR socket () +¤Î¿¶Éñ¤¤¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 16 +.B SOCK_NONBLOCK +¿·¤·¤¯À¸À®¤µ¤ì¤ë¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò (open file description) ¤Î +.B O_NONBLOCK +¥Õ¥¡¥¤¥ë¥¹¥Æ¡¼¥¿¥¹¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤³¤È¤Ç¡¢ +.B O_NONBLOCK +¤ò¥»¥Ã¥È¤¹¤ë¤¿¤á¤Ë +.BR fcntl (2) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.TP +.B SOCK_CLOEXEC +¿·¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤ËÂФ·¤Æ +close-on-exec +.RB ( FD_CLOEXEC ) +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬Ìò¤ËΩ¤ÄÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR open (2) +¤Î +.B O_CLOEXEC +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.PP +.I protocol +¤Ï¥½¥±¥Ã¥È¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¸ÇÍ­¤Î¥×¥í¥È¥³¥ë¤ò»ØÄꤹ¤ë¡£Ä̾綠¤ì¤¾¤ì¤Î +¥½¥±¥Ã¥È¤Ï¡¢Í¿¤¨¤é¤ì¤¿¥×¥í¥È¥³¥ë¡¦¥Õ¥¡¥ß¥ê¤Î¼ïÎऴ¤È¤Ë°ì¤Ä¤Î¥×¥í¥È¥³¥ë¤Î¤ß¤ò +¥µ¥Ý¡¼¥È¤¹¤ë¡£ +¤½¤Î¾ì¹ç¤Ï +.I protocol +¤Ë 0 ¤ò»ØÄê¤Ç¤­¤ë¡£ +¤·¤«¤·¡¢Â¿¤¯¤Î¥×¥í¥È¥³¥ë¤¬Â¸ºß¤·¤Æ¤â¤«¤Þ¤ï¤Ê¤¤¡£ +¤³¤Î¾ì¹ç¤Ë¤Ï¤³¤ÎÊýË¡¤Ë¤è¤ê¸ÇÍ­¤Î¥×¥í¥È¥³¥ë¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ +»ÈÍѤµ¤ì¤ë¥×¥í¥È¥³¥ëÈÖ¹æ¤ÏÄÌ¿®¤Î¹Ô¤Ê¤ï¤ì¤ë\*(lqÄÌ¿®¥É¥á¥¤¥ó\*(rq¤Ë +¸ÇÍ­¤Ç¤¢¤ë; +.BR protocols (5) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +¥×¥í¥È¥³¥ë̾¤ò¤É¤¦¤ä¤Ã¤Æ¥×¥í¥È¥³¥ëÈÖ¹æ¤ËÂбþ¤µ¤»¤ë¤«¤Ë¤Ä¤¤¤Æ¤Ï +.BR getprotoent (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +.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) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.B SOCK_STREAM +¤ò¼ÂÁõ¤·¤¿ÄÌ¿®¥×¥í¥È¥³¥ë¤Ï¥Ç¡¼¥¿¤Ë»¼º¤ä½ÅÊ£¤¬¤Ê¤¤¤³¤È¤òÊݾڤ¹¤ë¡£ +¤â¤·Áê¼ê¤Î¥×¥í¥È¥³¥ë¤¬¥Ð¥Ã¥Õ¥¡¡¼¶õ´Ö¤ò»ý¤Ä +¥Ç¡¼¥¿¤ÎÃÇÊÒ¤òŬÅö¤Ê»þ´Ö¤Î¤¦¤Á¤ËžÁ÷¤Ç¤­¤Ê¤±¤ì¤Ð¡¢ +Àܳ¤ÏÃǤ¿¤ì¤¿¤È¤ß¤Ê¤¹¡£¤½¤Î¥½¥±¥Ã¥È +.B SO_KEEPALIVE +¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢¥×¥í¥È¥³¥ëÆȼ«¤ÎÊýË¡¤ÇÀܳ¤ÎÁê¼ê¦¤¬¤Þ¤À +Í­¸ú¤Ç¤¢¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +¤â¤·¥×¥í¥»¥¹¤¬¡¢²õ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ç¥Ç¡¼¥¿¤òÁ÷¼õ¿®¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¤Ï +.B SIGPIPE +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë; ¤³¤ì¤ÏÄ̾ï¤Î¤½¤Î¥·¥°¥Ê¥ë¤ò°·¤Ã¤Æ¤¤¤Ê¤¤¥×¥í¥»¥¹¤ò +½ªÎ»¤µ¤»¤ë¡£ +.B SOCK_SEQPACKET +¥½¥±¥Ã¥È¤Ï +.B SOCK_STREAM +¥½¥±¥Ã¥È¤ÈƱ¤¸¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò»ÈÍѤ¹¤ë¡£ +Í£°ì¤Î°ã¤¤¤Ï +.BR read (2) +¥³¡¼¥ë¤¬Í׵ᤵ¤ì¤¿Î̤Υǡ¼¥¿¤Î¤ß¤òÊÖ¤·¡¢ÅþÃ夷¤¿¥Ñ¥±¥Ã¥È¤Î»Ä¤ê¤ÎÉôʬ¤ò +¼Î¤Æ¤Æ¤·¤Þ¤¦¤³¤È¤Ç¤¢¤ë¡£Æ±ÍͤËÆþ¤Ã¤Æ¤¯¤ë¥Ç¡¼¥¿¥°¥é¥à¤ÎÁ´¤Æ¤Î¥á¥Ã¥»¡¼¥¸¶­³¦¤Ï +Êݸ¤µ¤ì¤ë¡£ +.PP +.B SOCK_DGRAM +¤È +.B SOCK_RAW +¥½¥±¥Ã¥È¤Ï +.BR sendto (2) +¥³¡¼¥ë¤Ç»ØÄꤵ¤ì¤¿Áê¼ê¤Ø¥Ç¡¼¥¿¥°¥é¥à¤òÁ÷¤ë¤³¤È¤¬µö¤µ¤ì¤Æ¤¤¤ë¡£ +¥Ç¡¼¥¿¥°¥é¥à¤Ï°ìÈÌ¤Ë +.BR recvfrom (2) +¤Ç¼õ¤±¤È¤ê¡¢ +¤³¤Î¥³¡¼¥ë¤Ï¼¡¤Î¥Ç¡¼¥¿¥°¥é¥à¤òÁ÷¿®¼Ô¤Î¥¢¥É¥ì¥¹¤È°ì½ï¤ËÊÖ¤¹¡£ +.PP +.B SOCK_PACKET +¤Ï¸Å¤¤¥½¥±¥Ã¥È·¿¤Ç¡¢À¸(raw)¤Î¥Ñ¥±¥Ã¥È¤ò¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤«¤é +ľÀܼõ¿®¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +º£¤ÏÂå¤ï¤ê¤Ë +.BR packet (7) +¤òÍѤ¤¤ë¤³¤È¡£ +.PP +.BR fcntl (2) +¤Î +.B F_SETOWN +Áàºî¤ò»È¤Ã¤Æ¡¢¥·¥°¥Ê¥ë +.B SIGURG +¤ä +.B SIGPIPE +¤ò¼õ¤±¤È¤ë¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ò»ØÄê¤Ç¤­¤ë¡£ +.B SIGURG +¥·¥°¥Ê¥ë¤ÏÂÓ°è³°¥Ç¡¼¥¿¤¬ÅþÃ夷¤¿»þ¤Ë¡¢ +.B SIGPIPE +¥·¥°¥Ê¥ë¤Ï +.B SOCK_STREAM +Àܳ¤¬Í½´ü¤»¤ºÀÚÃǤµ¤ì¤¿»þ¤ËÁ÷¤é¤ì¤ë¡£ +¤Þ¤¿¡¢ +.B F_SETOWN +Áàºî¤Ï¡¢I/O ¤ä I/O ¥¤¥Ù¥ó¥È¤ÎÈóƱ´ü (asynchronous) ÄÌÃΤò +.B SIGIO +¤ò·Ðͳ¤Ç¼õ¤±¼è¤ë¥×¥í¥»¥¹¤ä¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤òÀßÄꤹ¤ë¤Î¤Ë¤â»ÈÍѤǤ­¤ë¡£ +.B F_SETOWN +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï +.B FIOSETOWN +¤Þ¤¿¤Ï +.B SIOCSPGRP +¤Î°ú¿ô¤Ç +.BR ioctl (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.PP +¥Í¥Ã¥È¥ï¡¼¥¯¤¬¥×¥í¥È¥³¥ë¡¦¥â¥¸¥å¡¼¥ë¤Ë¥¨¥é¡¼¾õÂÖ¤òÅÁ¤¨¤¿¾ì¹ç +(Î㤨¤Ð¡¢IP ¤Î ICMP ¥á¥Ã¥»¡¼¥¸¤ò»ÈÍѤ·¤Æ)¤Ë¤Ï¡¢¥½¥±¥Ã¥È¤Î +¥Ú¥ó¥Ç¥£¥ó¥°¡¦¥¨¥é¡¼¡¦¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤ë¡£¼¡¤Ë¤³¤Î¥½¥±¥Ã¥È¤òÁàºî¤·¤¿ +»þ¤Ë¥Ú¥ó¥Ç¥£¥ó¥°¤µ¤ì¤Æ¤¤¤¿¥¨¥é¡¼¡¦¥³¡¼¥É¤¬ÊÖ¤µ¤ì¤ë¡£¥×¥í¥È¥³¥ë¤Ë¤è¤Ã¤Æ¤Ï +¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Î¤è¤ê¾Ü¤·¤¤¾ðÊó¤ò¼õ¤±¼è¤ë¤¿¤á¤Ë¥½¥±¥Ã¥È¤´¤È¤Î¥¨¥é¡¼¡¦¥­¥å¡¼¤ò +¼õ¤±¼è¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¡£ +.BR ip (7) +¤Î +.B IP_RECVERR +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +¥½¥±¥Ã¥È¤ÎÁàºî¤Ï¥½¥±¥Ã¥È¡¦¥ì¥Ù¥ë +.I options +¤Ë¤è¤Ã¤ÆÀ©¸æ¤µ¤ì¤ë¡£ +¤³¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤Ï +.I +¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.BR setsockopt (2) +¤È +.BR getsockopt (2) +´Ø¿ô¤Ï¤½¤ì¤¾¤ì¥ª¥×¥·¥ç¥ó¤ÎÀßÄê¤È¼èÆÀ¤ò¹Ô¤Ê¤¦¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢¿·¤·¤¤¥½¥±¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +»ØÄꤵ¤ì¤¿¥¿¥¤¥×¤Þ¤¿¤Ï¥×¥í¥È¥³¥ë¤Î¥½¥±¥Ã¥È¤òºîÀ®¤¹¤ëµö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EAFNOSUPPORT +»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EINVAL +ÃΤé¤Ê¤¤¥×¥í¥È¥³¥ë¡¢¤Þ¤¿¤ÏÍøÍѤǤ­¤Ê¤¤¥×¥í¥È¥³¥ë¡¦¥Õ¥¡¥ß¥ê¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +.\" Since Linux 2.6.27 +.I type +¤Ë̵¸ú¤Ê¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EMFILE +¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥Æ¡¼¥Ö¥ë¤¬°î¤ì¤Æ¤¤¤ë¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥à¾å¸Â¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.BR ENOBUFS " ¤Þ¤¿¤Ï " ENOMEM +½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£½½Ê¬¤Ê»ñ¸»¤¬²òÊü¤µ¤ì¤ë¤Þ¤Ç¤Ï¥½¥±¥Ã¥È¤ò +ºîÀ®¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.B EPROTONOSUPPORT +¤³¤Î¥É¥á¥¤¥ó¤Ç¤Ï»ØÄꤵ¤ì¤¿¥×¥í¥È¥³¥ë¤Þ¤¿¤Ï¥×¥í¥È¥³¥ë¡¦¥¿¥¤¥×¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +²¼°Ì¤Î¥×¥í¥È¥³¥ë¡¦¥â¥¸¥å¡¼¥ë¤«¤é¾¤Î¥¨¥é¡¼¤¬À¸À®¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ½àµò +4.4BSD, POSIX.1-2001. + +¥Õ¥é¥° +.BR SOCK_NONBLOCK , +.B SOCK_CLOEXEC +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ + +.BR socket () +¤Ï 4.2BSD ¤ÇÅо줷¤¿¡£°ìÈ̤ˡ¢(System V ¤ÎÊѼï¤ò´Þ¤á¤Æ) +BSD ¤Î¥½¥±¥Ã¥ÈÁؤθߴ¹À­¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë BSD °Ê³°¤Î¥·¥¹¥Æ¥à¤Ø¤Î¡¢ +¤Þ¤¿¤Ï¡¢BSD °Ê³°¤Î¥·¥¹¥Æ¥à¤«¤é¤Î°Ü¿¢¤¬¤Ç¤­¤ë¡£ +.SH Ãí°Õ +POSIX.1-2001 ¤Ç¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ïɬ¿Ü¤È¤µ¤ì¤Æ¤ª¤é¤º¡¢ +Linux ¤Ç¤Ï¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÏɬÍפǤϤʤ¤¡£ +¤·¤«¤·¡¢Îò»ËŪ¤Ë¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¼ÂÁõ (BSD ·Ï) ¤Ç¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬ +ɬÍפǤ¢¤ê¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò +¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬¸­ÌÀ¤Ç¤¢¤í¤¦¡£ + +4.x BSD ¤Ë¤ª¤¤¤ÆÄê¿ô¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢¥×¥í¥È¥³¥ë¡¦¥Õ¥¡¥ß¥ê¡¼¤Ë¤Ï +.BR PF_UNIX , +.B PF_INET +Åù¤ò»ÈÍѤ·¤Æ¤¤¤ë¡£°ìÊý¤Ç¥¢¥É¥ì¥¹¡¦¥Õ¥¡¥ß¥ê¡¼¤Ë¤Ï +.B AF_UNIX +Åù¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£¤·¤«¤·¤Ê¤¬¤é BSD ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ç¤Ï +¡Ö°ìÈ̤˥ץí¥È¥³¥ë¡¦¥Õ¥¡¥ß¥ê¡¼¤Ï¥¢¥É¥ì¥¹¡¦¥Õ¥¡¥ß¥ê¡¼¤ÈƱ¤¸¤â¤Î¤Ç¤¢¤ë¡£¡× +¤ÈÊݾڤ·¤Æ¤¤¤ë¡£¤½¤ì¤Ç¤½¤ì°Ê³°¤Îµ¬³Ê¤Ç¤ÏÁ´¤Æ¤Î¾ì½ê¤Ç AF_* ¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +.SH Îã +.BR socket () +¤ÎÍøÍÑÎ㤬 +.BR getaddrinfo (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) +.PP +\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\(rq +¤Ï +.I UNIX Programmer's Supplementary Documents Volume 1 +¤È¤·¤ÆºÆÈǤµ¤ì¤¿¡£ +.PP +\(lqBSD Interprocess Communication Tutorial\(rq +¤Ï +.I UNIX Programmer's Supplementary Documents Volume 1 +¤È¤·¤ÆºÆÈǤµ¤ì¤¿¡£ diff --git a/release/man2/socketcall.2 b/release/man2/socketcall.2 new file mode 100644 index 00000000..83f0dbfa --- /dev/null +++ b/release/man2/socketcall.2 @@ -0,0 +1,84 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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 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 +.\" +.\"WORD: socket ¥½¥±¥Ã¥È +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: entry ¥¨¥ó¥È¥ê +.\"WORD: hacker ¥Ï¥Ã¥«¡¼ +.\"WORD: library ¥é¥¤¥Ö¥é¥ê +.\" +.TH SOCKETCALL 2 2007-06-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +socketcall \- ¥½¥±¥Ã¥È¡¦¥·¥¹¥Æ¥à¥³¡¼¥ë +.SH ½ñ¼° +.BI "int socketcall(int " call ", unsigned long *" args ); +.SH ÀâÌÀ +.BR socketcall () +¤Ï¥½¥±¥Ã¥È¡¦¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¤¿¤á¤Î¶¦Ä̤Υ«¡¼¥Í¥ë¡¦¥¨¥ó¥È¥ê¡¦ +¥Ý¥¤¥ó¥È(kernel entry point)¤Ç¤¢¤ë¡£ +.I call +¤Ï¤É¤Î¥½¥±¥Ã¥È´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¤«¤ò»ØÄꤹ¤ë¡£ +.I args +¤ÏŬÀڤʥ³¡¼¥ë¤ËÅϤ¹¤¿¤á¤Î¼ÂºÝ¤Î°ú¤­¿ô¤ò´Þ¤ó¤Ç¤¤¤ë¥Ö¥í¥Ã¥¯¤ò»Ø¤¹¡£ +.PP +¥æ¡¼¥¶¡¼¡¦¥×¥í¥°¥é¥à¤ÏÄ̾ï¤Î̾Á°¤ò»ÈÍѤ·¤ÆŬÀڤʴؿô¤ò¸Æ¤Ó½Ð¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +ɸ½à¥é¥¤¥Ö¥é¥ê¤Î¼ÂÁõ¼Ô¤ä¥«¡¼¥Í¥ë¡¦¥Ï¥Ã¥«¡¼¤Î¤ß¤¬ +.BR socketcall () +¤Ë¤Ä¤¤¤ÆÃΤëɬÍפ¬¤¢¤ë¡£ +.SH ½àµò +¤³¤Î¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç +»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.SH Ãí°Õ +ia64 ¤Ê¤É¤Î¤¤¤¯¤Ä¤«¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR socketcall () +¤¬Â¸ºß¤·¤Ê¤¤¡£¼ÂºÝ¤Ë¤Ï¡¢¤½¤ÎÂå¤ï¤ê¤Ë +.BR socket (2), +.BR accept (2), +.BR bind (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) diff --git a/release/man2/socketpair.2 b/release/man2/socketpair.2 new file mode 100644 index 00000000..dcdc2e13 --- /dev/null +++ b/release/man2/socketpair.2 @@ -0,0 +1,145 @@ +.\" 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. +.\" +.\" @(#)socketpair.2 6.4 (Berkeley) 3/10/91 +.\" +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1996-10-22 by Eric S. Raymond +.\" Modified 2002-07-22 by Michael Kerrisk +.\" 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 ¼ÂÁõ +.\" +.TH SOCKETPAIR 2 2008-10-11 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +socketpair \- Àܳ¤µ¤ì¤¿¥½¥±¥Ã¥È¤Î¥Ú¥¢¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.BR "#include " " /* ¡ÖÃí°Õ¡×»²¾È */" +.br +.B #include +.sp +.BI "int socketpair(int " domain ", int " type ", int " protocol \ +", int " sv [2]); +.SH ÀâÌÀ +.BR socketpair () +¤Ï¡¢»ØÄꤵ¤ì¤¿¥É¥á¥¤¥ó +.I domain +¤Ë»ØÄꤵ¤ì¤¿¼ïÎà +.I type +¤Ç̾Á°¤Î¤Ê¤¤¥½¥±¥Ã¥È¤ÎÀܳ¤µ¤ì¤¿¥Ú¥¢¤òºîÀ®¤¹¤ë¡£ +.I protocol +¤¬»ØÄꤵ¤ì¤ë¤È¡¢¤³¤Î¥×¥í¥È¥³¥ë¤òÍѤ¤¤ë¡£ +¤³¤ì¤é¤Î°ú¤­¿ô¤Î¾ÜºÙ¤Ï +.BR socket (2) +¤ò»²¾È¤Î¤³¤È¡£ + +¿·¤·¤¤¥½¥±¥Ã¥È¤Î»²¾È¤Ë»ÈÍѤ¹¤ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ (descriptor) ¤¬ +.IR sv [0] +¤È +.IR sv [1] +¤ËÊÖ¤µ¤ì¤ë¡£ +Æó¤Ä¤Î¥½¥±¥Ã¥È¤ÏÁ´¤¯Æ±¤¸¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAFNOSUPPORT +¤³¤Î¥Þ¥·¥ó¤Ç¤Ï»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¡¦¥Õ¥¡¥ß¥ê¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +¥¢¥É¥ì¥¹ +.I sv +¤¬¤³¤Î¥×¥í¥»¥¹¤Ç»È¤¨¤ë¥¢¥É¥ì¥¹¶õ´Ö¤ò»ØÄꤷ¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EMFILE +¤³¤Î¥×¥í¥»¥¹¤¬»ÈÍѤ·¤Æ¤¤¤ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥àÁ´ÂΤξå¸Â¤Ë㤷¤¿¡£ +.TP +.B EOPNOTSUPP +»ØÄꤵ¤ì¤¿¥×¥í¥È¥³¥ë¤Ç¤Ï¥½¥±¥Ã¥È¤Î¥Ú¥¢¤ÎºîÀ®¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EPROTONOSUPPORT +¤³¤Î¥Þ¥·¥ó¤Ç¤Ï»ØÄꤵ¤ì¤¿¥×¥í¥È¥³¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +4.4BSD, POSIX.1-2001. +.BR socketpair () +´Ø¿ô¥³¡¼¥ë¤Ï 4.2BSD ¤Ç¸½¤ï¤ì¤¿¡£°ìÈÌ¤Ë (System V ¤ÎÊѼï¤ò´Þ¤á¤Æ) +BSD ¤Î¥½¥±¥Ã¥ÈÁؤΥ¯¥í¡¼¥ó¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡¢BSD °Ê³°¤Î¥·¥¹¥Æ¥à¤È¡¢ +¸ß¤¤¤Ë°Ü¿¢À­¤¬¤¢¤ë¡£ +.SH Ãí°Õ +Linux ¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥É¥á¥¤¥ó¤Ï +.B AF_UNIX +(¤Þ¤¿¤ÏƱµÁ¸ì¤Ç¤¢¤ë +.BR AF_LOCAL ) +¤À¤±¤Ç¤¢¤ë¡£ +(¤Û¤È¤ó¤É¤Î¼ÂÁõ¤ÇƱ¤¸À©¸Â¤¬¤¢¤ë) + +Linux 2.6.27 °Ê¹ß¤Ç¤Ï¡¢ +.BR socketpair () +¤Ï¡¢¥Õ¥é¥° +.B SOCK_NONBLOCK +¤È +.B SOCK_CLOEXEC +¤ËÂбþ¤·¤Æ¤¤¤ë¡£¥Õ¥é¥°¤ÎÀâÌÀ¤Ï +.BR socket (2) +¤ò»²¾È¤Î¤³¤È¡£ + +POSIX.1-2001 ¤Ç¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ïɬ¿Ü¤È¤µ¤ì¤Æ¤ª¤é¤º¡¢ +Linux ¤Ç¤Ï¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÏɬÍפǤϤʤ¤¡£ +¤·¤«¤·¡¢Îò»ËŪ¤Ë¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¼ÂÁõ (BSD ·Ï) ¤Ç¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬ +ɬÍפǤ¢¤ê¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò +¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬¸­ÌÀ¤Ç¤¢¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR pipe (2), +.BR read (2), +.BR socket (2), +.BR write (2), +.BR socket (7), +.BR unix (7) diff --git a/release/man2/splice.2 b/release/man2/splice.2 new file mode 100644 index 00000000..c6137add --- /dev/null +++ b/release/man2/splice.2 @@ -0,0 +1,232 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 2006 Jens Axboe +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-02-04, Akihiro MOTOKI +.\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.13 +.\" +.TH SPLICE 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +splice \- ¥Ñ¥¤¥×¤È¤Î´Ö¤Ç¥Ç¡¼¥¿¤ò·Ñ¤®¹ç¤ï¤»¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "ssize_t splice(int " fd_in ", loff_t *" off_in ", int " fd_out , +.BI " loff_t *" off_out ", size_t " len \ +", unsigned int " flags ); +.fi +.\" Return type was long before glibc 2.7 +.SH ÀâÌÀ +.BR splice () +¤Ï¡¢¥«¡¼¥Í¥ë¥¢¥É¥ì¥¹¶õ´Ö¤È¥æ¡¼¥¶¥¢¥É¥ì¥¹¶õ´Ö¤È¤Î´Ö¤Î¥³¥Ô¡¼¤òȼ¤ï¤º¤Ë¡¢ +2 ¤Ä¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿´Ö¤Ç¥Ç¡¼¥¿¤Î°ÜÆ°¤ò¹Ô¤¦¡£ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd_in +¤«¤é¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd_out +¤ØºÇÂç +.I len +¥Ð¥¤¥È¤òžÁ÷¤¹¤ë¡£ +2 ¤Ä¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¦¤Á°ì¤Ä¤Ï +¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.I fd_in +¤¬¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.I off_in +¤Ï NULL ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I fd_in +¤¬¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤ª¤é¤º¡¢ +.I off_in +¤¬ NULL ¤Î¾ì¹ç¡¢ +.I fd_in +¤Î¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤«¤é»Ï¤Þ¤ë¥Ð¥¤¥È¤òÆɤ߽Ф¹¡£ +¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ÏŬÀÚ¤ËÄ´À°¤µ¤ì¤ë¡£ +.I fd_in +¤¬¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤ª¤é¤º¡¢ +.I off_in +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I off_in +¤Ï +.I fd_in +¤«¤é¤Î¥Ç¡¼¥¿Æɤ߽Ф·¤ò³«»Ï¤¹¤ëÀèƬ¥ª¥Õ¥»¥Ã¥È¤ò³ÊǼ¤·¤¿¥Ð¥Ã¥Õ¥¡ +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤Î¾ì¹ç¡¢ +.I fd_in +¤Î¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.I fd_out +¤È +.I off_out +¤Ë´Ø¤·¤Æ¤âƱÍͤǤ¢¤ë¡£ +.PP +.I flags +°ú¤­¿ô¤Ë¤Ï¡¢°Ê²¼¤ÎÃͤΠ0 ¸Ä°Ê¾å¤Î¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýϤò +¤È¤Ã¤¿¤â¤Î¤ò»ØÄꤹ¤ë: +.TP 1.9i +.B SPLICE_F_MOVE +¥Ú¡¼¥¸¤Î¥³¥Ô¡¼¤Ç¤Ê¤¯°ÜÆ°¤ò»î¤ß¤ë¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ë¤ËÂФ¹¤ë¥Ò¥ó¥È¤Ç¤·¤«¤Ê¤¤¡£ +¤Ä¤Þ¤ê¡¢¥«¡¼¥Í¥ë¤¬¥Ñ¥¤¥×¤«¤é¥Ú¡¼¥¸¤ò°ÜÆ°¤Ç¤­¤Ê¤¤¾ì¹ç¤ä¡¢ +¥Ñ¥¤¥×¥Ð¥Ã¥Õ¥¡¤¬¥Ú¡¼¥¸Á´Éô¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢ +¥Ú¡¼¥¸¤Î¥³¥Ô¡¼¤¬¹Ô¤ï¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ÎºÇ½é¤Î¼ÂÁõ¤Ë¤Ï¥Ð¥°¤¬¤¢¤Ã¤¿¡£¤½¤Î¤¿¤á¡¢ +Linux 2.6.21 °Ê¹ß¤Ç¤Ï¤³¤Î¥Õ¥é¥°¤ÎÁàºî¤Ï¤Ç¤­¤Ê¤¤¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë +(¤¿¤À¤·¡¢ +.BR splice () +¥³¡¼¥ë¤Ç¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤Ïº£¤âǧ¤á¤é¤ì¤Æ¤¤¤ë)¡£ +¾­Íè¡¢Àµ¤·¤¤¼ÂÁõ¤¬¹Ô¤ï¤ì¤ë¤³¤È¤À¤í¤¦¡£ +.TP +.B SPLICE_F_NONBLOCK +Æþ½ÐÎÏ»þ¤ËÄä»ß (block) ¤·¤Ê¤¤¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢ +splice ¤Ë¤è¤ë¥Ñ¥¤¥×Áàºî¤òÈóÄä»ß¥â¡¼¥É (nonblocking) ¤Ç +¹Ô¤ª¤¦¤È¤¹¤ë¤¬¡¢¤½¤Î¾ì¹ç¤Ç¤â +.BR splice () +¤ÏÄä»ß¤¹¤ë¤³¤È¤â¤¢¤ë¡£¤Ê¤¼¤Ê¤é¡¢¥Ç¡¼¥¿¤Î¤ä¤ê¼è¤ê¤ò¹Ô¤¦ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.RB ( O_NONBLOCK +¥Õ¥é¥°¤ò¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç) Ää»ß¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¤«¤é¤Ç¤¢¤ë¡£ +.TP +.B SPLICE_F_MORE +¤³¤Î¸å¤Î splice ¤Ç¤µ¤é¤ËžÁ÷¤µ¤ì¤ë¥Ç¡¼¥¿¤¬¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î¥Õ¥é¥°¤Ï +.I fd_out +¤¬¥½¥±¥Ã¥È¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤ËÍ­ÍѤʥҥó¥È¤È¤Ê¤ë +.RB ( send (2) +¤Î +.B MSG_MORE +¤ä +.BR tcp (7) +¤Î +.B TCP_CORK +¤ÎÀâÌÀ¤â»²¾È)¡£ +.TP +.B SPLICE_F_GIFT +.BR splice () +¤Ç¤Ï»ÈÍѤ·¤Ê¤¤¡£ +.BR vmsplice (2) +»²¾È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤Æ´°Î»¤¹¤ë¤È¡¢ +.BR splice () +¤Ï¥Ñ¥¤¥×¤«¤é½Ð¤·Æþ¤ì¤·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +ÊÖ¤êÃÍ 0 ¤Ï¥Ç¡¼¥¿¤ÎžÁ÷¤¬¹Ô¤ï¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î¾ì¹ç¡¢½èÍý¤òÄä»ß (block) ¤·¤Æ¤â̵°ÕÌ£¤Ç¤¢¤ë¡£ +¤Ê¤¼¤Ê¤é¡¢ +.I fd_in +¤¬»²¾È¤¹¤ë¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¼Ô¤¬¤¤¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.PP +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR splice () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î°ìÊý¤Þ¤¿¤ÏξÊý¤¬Í­¸ú¤Ç¤Ï¤Ê¤¤¡¢ +¤â¤·¤¯¤ÏŬÀÚ¤Ê read-write ¥â¡¼¥É¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINVAL +ÂоݤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ splice ¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤¡¢ +¤Þ¤¿¤ÏÂоݤΥե¡¥¤¥ë¤¬Äɵ­¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¡¢ +.\" Äɵ­¥â¡¼¥É¤Ç¤Î¥¨¥é¡¼¤Ï 2.6.27 °Ê¹ß¤ÇȯÀ¸¤¹¤ë¡£ +.\" ¤½¤ì¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤ÏÄɵ­¥â¡¼¥É¤Ç¤Î splice() ¤ÏÀµ¤·¤¯Æ°ºî¤·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤É¤Á¤é¤â¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡¢ +¤Þ¤¿¤Ï seek ¤Ç¤­¤Ê¤¤¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ¥ª¥Õ¥»¥Ã¥È¤¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B ENOMEM +¥á¥â¥êÉÔ­¡£ +.TP +.B ESPIPE +.I off_in +¤« +.I off_out +¤Î¤¤¤º¤ì¤«¤¬ NULL ¤Ç¤Ï¤Ê¤¤¤¬¡¢Âбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR splice () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6.17 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +3 ¤Ä¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë +.RB ( splice (), +.BR vmsplice (2), +.BR tee (2)) +¤ò»È¤¦¤È¡¢¥æ¡¼¥¶¶õ´Ö¥×¥í¥°¥é¥à¤ÏǤ°Õ¤Î¥«¡¼¥Í¥ë¥Ð¥Ã¥Õ¥¡¤ËÂФ¹¤ë +´°Á´¤ÊÀ©¸æ¤¬¤Ç¤­¤ë¡£¥«¡¼¥Í¥ë¥Ð¥Ã¥Õ¥¡¤Ï¡¢¥Ñ¥¤¥×¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¤Î¤È +Ʊ¼ï¤Î¥Ð¥Ã¥Õ¥¡¤ò»È¤Ã¤Æ¥«¡¼¥Í¥ëÆâ¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +Âç¤Þ¤«¤Ë¤¤¤¦¤È¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï°Ê²¼¤Î»Å»ö¤ò¹Ô¤¦: +.TP 1.2i +.BR splice () +¥Ð¥Ã¥Õ¥¡¤«¤éǤ°Õ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ä¡¢¤½¤ÎµÕÊý¸þ¡¢ +¤â¤·¤¯¤Ï¤¢¤ë¥Ð¥Ã¥Õ¥¡¤«¤éÊ̤ΥХåե¡¤Ø¤Î¡¢¥Ç¡¼¥¿°ÜÆ°¤ò¹Ô¤¦¡£ +.TP +.BR tee (2) +¤¢¤ë¥Ð¥Ã¥Õ¥¡¤«¤éÊ̤ΥХåե¡¤Ø¤Î¥Ç¡¼¥¿¡Ö¥³¥Ô¡¼¡×¤ò¹Ô¤¦¡£ +.TP +.BR vmsplice (2) +¥æ¡¼¥¶¶õ´Ö¤«¤é¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ç¡¼¥¿¡Ö¥³¥Ô¡¼¡×¤ò¹Ô¤¦¡£ +.PP +¤³¤³¤Ç¤Ï¥³¥Ô¡¼¤ÎÏäò¤·¤Æ¤¤¤ë¤¬¡¢¼ÂºÝ¤Î¥³¥Ô¡¼¤Ï°ìÈÌŪ¤Ë²óÈò¤µ¤ì¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¡¢¥Ñ¥¤¥×¡¦¥Ð¥Ã¥Õ¥¡¤ò¥«¡¼¥Í¥ë¥á¥â¥ê¤Î¥Ú¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿½¸¹ç¤È¤·¤Æ +¼ÂÁõ¤·¡¢¥Ú¡¼¥¸¤Ø¤Î»²¾È²ó¿ô¤ò´ÉÍý¤¹¤ë¤³¤È¤Ç¡¢¤³¤ì¤ò¼Â¸½¤·¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¡¢ÂоݤȤʤë¥Ú¡¼¥¸¤ò»²¾È¤¹¤ë (½ÐÎϥХåե¡ÍѤÎ) ¥Ý¥¤¥ó¥¿¤ò +¿·µ¬¤ËºîÀ®¤¹¤ë¤³¤È¤Ç¥Ð¥Ã¥Õ¥¡Æâ¤Î¥Ú¡¼¥¸¤Î¡Ö¥³¥Ô¡¼¡×¤òºîÀ®¤·¡¢ +¤½¤Î¥Ú¡¼¥¸¤Î»²¾È²ó¿ô¤òÁý¤ä¤¹¡£¤Ä¤Þ¤ê¡¢¥Ý¥¤¥ó¥¿¤À¤±¤¬¥³¥Ô¡¼¤µ¤ì¡¢ +¥Ð¥Ã¥Õ¥¡¤Î¥Ú¡¼¥¸¤Ï¥³¥Ô¡¼¤µ¤ì¤Ê¤¤¡£ +.\" +.\" Linus: Now, imagine using the above in a media server, for example. +.\" Let's say that a year or two has passed, so that the video drivers +.\" have been updated to be able to do the splice thing, and what can +.\" you do? You can: +.\" +.\" - splice from the (mpeg or whatever - let's just assume that the video +.\" input is either digital or does the encoding on its own - like they +.\" pretty much all do) video input into a pipe (remember: no copies - the +.\" video input will just DMA directly into memory, and splice will just +.\" set up the pages in the pipe buffer) +.\" - tee that pipe to split it up +.\" - splice one end to a file (ie "save the compressed stream to disk") +.\" - splice the other end to a real-time video decoder window for your +.\" real-time viewing pleasure. +.\" +.\" Linus: Now, the advantage of splice()/tee() is that you can +.\" do zero-copy movement of data, and unlike sendfile() you can +.\" do it on _arbitrary_ data (and, as shown by "tee()", it's more +.\" than just sending the data to somebody else: you can duplicate +.\" the data and choose to forward it to two or more different +.\" users - for things like logging etc.). +.\" +.SH Îã +.BR tee (2) +»²¾È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sendfile (2), +.BR tee (2), +.BR vmsplice (2), +.BR feature_test_macros (7) diff --git a/release/man2/spu_create.2 b/release/man2/spu_create.2 new file mode 100644 index 00000000..20ef73ab --- /dev/null +++ b/release/man2/spu_create.2 @@ -0,0 +1,167 @@ +.\" This is _*_ nroff _*_ source. Emacs, gimme all those colors :) +.\" +.\" Copyright (c) International Business Machines Corp., 2006 +.\" +.\" 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 +.\" +.\" HISTORY: +.\" 2005-09-28, created by Arnd Bergmann +.\" 2006-06-16, revised by Eduardo M. Fleury +.\" 2007-07-10, some polishing by mtk +.\" +.TH SPU_CREATE 2 2007-07-10 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +spu_create \- ¿·¤·¤¤ SPU ¥³¥ó¥Æ¥­¥¹¥È¤òÀ¸À®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include + +.BI "int spu_create(const char *" pathname ", int " flags ", mode_t " mode ");" +.fi +.SH ÀâÌÀ +.BR spu_create () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢Cell Broadband Engine ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò¼ÂÁõ¤·¤¿ +PowerPC ¥Þ¥·¥ó¤Ë¤ª¤¤¤Æ¡¢Synergistic Processor Unit (SPU) ¤Ë¥¢¥¯¥»¥¹¤¹¤ë +¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢SPU ¤ËÂФ¹¤ë¿·¤·¤¤ÏÀÍý¥³¥ó¥Æ¥­¥¹¥È¤ò +.I pathname +¤ËÀ¸À®¤·¡¢¤½¤Î¥³¥ó¥Æ¥­¥¹¥È¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.I pathname +¤Ï SPU ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à (SPUFS) ¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥ÈÆâ¤Î +¸ºß¤·¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BR spu_create () +¤¬À®¸ù¤¹¤ë¤È¡¢ +.I pathname +¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤¬À¸À®¤µ¤ì¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë +.BR spufs (7) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë·²¤¬ÇÛÃÖ¤µ¤ì¤ë¡£ + +ÊÖ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥é¤Ï¡¢ +.BR spu_run (2) +¤ËÅϤ¹¤«¡¢¥¯¥í¡¼¥º¤¹¤ë¤«¤·¤«¤Ç¤­¤Ê¤¤¡£ +¾¤ÎÁàºî¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +ÏÀÍý SPU ¥³¥ó¥Æ¥­¥¹¥È¤¬ÇË´þ¤µ¤ì¤ë¤Î¤Ï¡¢ +¥³¥ó¥Æ¥­¥¹¥È¼«¿È¤Ø¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥¯¥í¡¼¥º¤µ¤ì¡¢ +¤½¤ÎÃæ¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Á´¤Æ¥¯¥í¡¼¥º¤µ¤ì¤¿¤È¤­¤Ç¤¢¤ë¡£ +SPU ¥³¥ó¥Æ¥­¥¹¥È¤¬ÇË´þ¤µ¤ì¤ë¤È¡¢SPUFS Æâ¤Î¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ÎÁ´¤Æ¤Î¥¨¥ó¥È¥ê +¤¬ºï½ü¤µ¤ì¤ë¡£ + +°ú¤­¿ô +.I flags +¤Ë¤Ï¥¼¥í¤«°Ê²¼¤ÎÄê¿ô¤ò»ØÄê¤Ç¤­¤ë¡£ +.TP +.B SPU_RAWIO +SPU ¤Î¥Ï¡¼¥É¥¦¥§¥¢¥ì¥¸¥¹¥¿¤Î¤¤¤¯¤Ä¤«¤ò¥æ¡¼¥¶¶õ´Ö¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¤³¤È¤ò +µö²Ä¤¹¤ë¡£¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤Ë¤Ï +.B CAP_SYS_RAWIO +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.PP +SPUFS Æâ¤Ë¿·¤·¤¯À¸À®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤È¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹µö²Ä¤Ï¡¢ +.I mode +°ú¤­¿ô¤«¤é¤½¤Î¥×¥í¥»¥¹¤Î +.BR umask (2) +¤ò°ú¤¤¤¿ÃͤËÀßÄꤵ¤ì¤ë¡£ +³Æ¥Õ¥¡¥¤¥ë¤Î¼ÂºÝ¤Î¥¢¥¯¥»¥¹µö²Ä¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬Æɤ߽Ф·¥¢¥¯¥»¥¹¤ä +½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«¤â¹Íθ¤·¤Æ·è¤Þ¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR spu_create (2) +¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë°Ê²¼¤Î¥ê¥¹¥È¤Ëµ­ºÜ¤Î¥¨¥é¡¼¥³¡¼¥É¤Î¤¤¤º¤ì¤«¤òÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¸½ºß¤Î¥æ¡¼¥¶¤¬ SPUFS ¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EEXIST +»ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤Î SPU ¥³¥ó¥Æ¥­¥¹¥È¤¬¤¹¤Ç¤ËÀ¸À®¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EFAULT +.I pathname +¤¬¸½ºß¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ÇÍ­¸ú¤Êʸ»úÎó¥Ý¥¤¥ó¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINVAL +.I pathname +¤¬ SPUFS ¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥¿Æâ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ELOOP +.I pathname +¤ò²ò·è¤¹¤ë¤Þ¤Ç¤Ëé¤Ã¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Â¿²á¤®¤¿¡£ +.TP +.B EMFILE +¤½¤Î¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¾å¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENAMETOOLONG +.I pathname +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENFILE +¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¾å¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENOENT +.I pathname +¤Î°ìÉô¤¬²ò·è¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤¬É¬Íפʥ꥽¡¼¥¹¤ÎÁ´¤Æ¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOSPC +¿·¤·¤¤¥³¥ó¥Æ¥­¥¹¥È¤òÀ¸À®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê SPU ¥ê¥½¡¼¥¹¤¬¤Ê¤«¤Ã¤¿¡¢ +¤Þ¤¿¤Ï SPU ¥³¥ó¥Æ¥­¥¹¥È¿ô¤¬¤½¤Î¥æ¡¼¥¶¤ÎÆÃÄê¤Î¾å¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENOSYS +µ¡Ç½¤¬Æ°ºîÃæ¤Î¥·¥¹¥Æ¥à¤ÇÄ󶡤µ¤ì¤Æ¤¤¤Ê¤¤¡£Íýͳ¤Ï¡¢ +¥Ï¡¼¥É¥¦¥§¥¢¤Ç SPU ¤¬Ä󶡤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +spufs ¥â¥¸¥å¡¼¥ë¤¬¥í¡¼¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢¤Î¤É¤Á¤é¤«¤Ç¤¢¤ë¡£ +.TP +.B ENOTDIR +.I pathname +¤Î°ìÉô¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +.I pathname +¤Ï SPUFS ¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ÎÇÛ²¼¤Î¾ì½ê¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +´·Îã¤Ç¤Ï¡¢SPUFS ¤Ï +.I /spu +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR spu_create (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.6.16 ¤Ç Linux ¤ËÄɲ䵤줿¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢ +ppc64 ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Î¤ß¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤¿¥×¥í¥°¥é¥à¤Ï°Ü¿¢À­¤¬¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤¦¤³¤È¡£¤¿¤À¤·¡¢ +.BR spu_create () +¤Ï ¤è¤êÃê¾ÝÅ٤ι⤤ SPU ¤Ø¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¼ÂÁõ¤¹¤ë¥é¥¤¥Ö¥é¥ê¤«¤é +ÍøÍѤµ¤ì¤ë¤³¤È¤ò°Õ¿Þ¤·¤¿¤â¤Î¤Ç¤¢¤ê¡¢Ä̾ï¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é +»ÈÍѤϰտޤµ¤ì¤Æ¤¤¤Ê¤¤¡£¿ä¾©¤Î¥é¥¤¥Ö¥é¥ê¤Ë¤Ä¤¤¤Æ¤Ï +.I http://www.bsc.es/projects/deepcomputing/linuxoncell/ +¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥Ð¥° +¼ÂºÝ¤Î¥³¡¼¥É¤Ç¤Ï¤³¤³¤Ç½Ò¤Ù¤¿Á´¤Æ¤Îµ¡Ç½¤¬´°Á´¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.\" .SH AUTHOR +.\" Arnd Bergmann +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR spu_run (2), +.BR capabilities (7), +.BR spufs (7) diff --git a/release/man2/spu_run.2 b/release/man2/spu_run.2 new file mode 100644 index 00000000..938d26f3 --- /dev/null +++ b/release/man2/spu_run.2 @@ -0,0 +1,259 @@ +.\" Copyright (c) International Business Machines Corp., 2006 +.\" +.\" 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 +.\" +.\" HISTORY: +.\" 2005-09-28, created by Arnd Bergmann +.\" 2006-06-16, revised by Eduardo M. Fleury +.\" 2007-07-10, some polishing by mtk +.\" 2007-09-28, updates for newer kernels, added example +.\" by Jeremy Kerr +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-10-19, Akihiro MOTOKI +.\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.04 +.\" +.TH SPU_RUN 2 2007-11-25 Linux "Linux Programmer's Manual" +.SH ̾Á° +spu_run \- SPU ¥³¥ó¥Æ¥­¥¹¥È¤ò¼Â¹Ô¤¹¤ë +.SH ½ñ¼° +.nf +.B #include + +.BI "int spu_run(int " fd ", unsigned int *" npc \ +", unsigned int *" event ");" +.fi +.SH ÀâÌÀ +.BR spu_run () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢Cell Broadband Engine ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò¼ÂÁõ¤·¤¿ +PowerPC ¥Þ¥·¥ó¤Ç Synergistic Processor Units (SPU) ¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Ë +»ÈÍѤµ¤ì¤ë¡£ +.I fd +°ú¤­¿ô¤Ï¡¢ +.BR spu_create (2) +¤¬ÊÖ¤¹¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¡¢ +ÆÃÄê¤Î SPU ¥³¥ó¥Æ¥­¥¹¥È¤ò»²¾È¤¹¤ë¡£ +¤½¤Î¥³¥ó¥Æ¥­¥¹¥È¤¬ÊªÍý SPU ¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¤È¡¢ +.I npc +¤ÇÅϤµ¤ì¤¿Ì¿Îá¥Ý¥¤¥ó¥¿ (instruction pointer) ¤«¤é¼Â¹Ô¤¬³«»Ï¤µ¤ì¤ë¡£ + +SPU ¥³¡¼¥É¤Î¼Â¹Ô¤ÏƱ´üŪ (synchronously) ¤Ë¹Ô¤ï¤ì¤ë¡¢¤Ä¤Þ¤ê +SPU ¤¬¼Â¹ÔÃæ¤Ï +.BR spu_run () +¤ÏÄä»ß (block) ¤¹¤ë¡£ +SPU ¥³¡¼¥É¤Î¼Â¹Ô¤ò¥á¥¤¥ó CPU ¤ä¾¤Î SPU ¤ÈʹԤ·¤Æ¹Ô¤¦É¬Íפ¬¤¢¤ë¾ì¹ç¤Ï¡¢ +ºÇ½é¤Ë¡¢¤½¤Î SPU ¥³¡¼¥É¤ò¼Â¹Ô¤¹¤ë¿·¤·¤¤¥¹¥ì¥Ã¥É¤ò¡¢(Î㤨¤Ð +.BR pthread_create (3) +¤Ê¤É¤ò»È¤Ã¤Æ) À¸À®¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.BR spu_run () +¤¬ÊÖ¤ë¤È¤­¤Ë¤Ï¡¢SPU ¤Î¥×¥í¥°¥é¥à¥«¥¦¥ó¥¿¤Î¸½ºßÃͤ¬ +.I npc +¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢Ï¢Â³¤¹¤ë +.BR spu_run () +¤Î¸Æ¤Ó½Ð¤·¤ÇƱ¤¸ +.I npc +¥Ý¥¤¥ó¥¿¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ + +.I event +°ú¤­¿ô¤Ë¤Ï¡¢³ÈÄ¥¥¹¥Æ¡¼¥¿¥¹¥³¡¼¥ÉÍѤΥХåե¡¤ò»ØÄꤹ¤ë¡£ +.B SPU_CREATE_EVENTS_ENABLED +¥Õ¥é¥°ÉÕ¤­¤Ç SPU ¥³¥ó¥Æ¥­¥¹¥È¤¬ºîÀ®¤µ¤ì¤ë¤È¡¢ +.BR spu_run () +¤¬ÊÖ¤ëÁ°¤Ë Linux ¥«¡¼¥Í¥ë¤Ë¤è¤ê¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ë +³ÈÄ¥¥¹¥Æ¡¼¥¿¥¹¥³¡¼¥É¤¬³ÊǼ¤µ¤ì¤ë¡£ + +¥¹¥Æ¡¼¥¿¥¹¥³¡¼¥É¤Ë¤Ï°Ê²¼¤ÎÄê¿ô¤¬°ì¤Ä°Ê¾åÆþ¤ë¡£ +.TP +.B SPE_EVENT_DMA_ALIGNMENT +DMA (direct memory access) ¤Î¥¢¥é¥¤¥á¥ó¥È¡¦¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B SPE_EVENT_INVALID_DMA +̵¸ú¤Ê MFC (Memory Flow Controller) DMA ¥³¥Þ¥ó¥É¤ò¹Ô¤ª¤¦¤È¤·¤¿¡£ +.TP +.B SPE_EVENT_SPE_DATA_STORAGE +DMA ¥¹¥È¥ì¡¼¥¸¡¦¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B SPE_EVENT_SPE_ERROR +ÉÔÀµ¤ÊÌ¿Î᤬¼Â¹Ô¤µ¤ì¤¿¡£ +.PP +NULL ¤Ï +.I event +°ú¤­¿ô¤È¤·¤ÆÍ­¸ú¤ÊÃͤǤ¢¤ë¡£ +¤³¤Î¾ì¹ç¡¢¥¤¥Ù¥ó¥È¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÊó¹ð¤µ¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR spu_run () +¤Ï +.I spu_status +¥ì¥¸¥¹¥¿¤ÎÃͤòÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò²¼µ­¤Î¥¨¥é¡¼¥³¡¼¥É¤Î¤¤¤º¤ì¤«¤ËÀßÄꤹ¤ë¡£ + +.I spu_status +¥ì¥¸¥¹¥¿¤ÎÃͤϡ¢¥¹¥Æ¡¼¥¿¥¹¥³¡¼¥É¤È SPU ¤Î +.B stop-and-signal +Ì¿Î᤬ÊÖ¤¹ 14 ¥Ó¥Ã¥È¤Î¥³¡¼¥É¤Î +¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¹½À®¤µ¤ì¤ë¡£ +¸å¼Ô¤Î 14 ¥Ó¥Ã¥È¤Î¥³¡¼¥É¤Ï¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +¥¹¥Æ¡¼¥¿¥¹¥³¡¼¥É¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ï²¼µ­¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.TP +.B 0x02 +SPU ¤¬ +.B stop-and-signal +Ì¿Îá¤ÇÄä»ß¤·¤¿¡£ +.TP +.B 0x04 +SPU ¤¬ +.B "halt (Ää»ß)" +Ì¿Îá¤Ç»ß¤Þ¤Ã¤¿¡£ +.TP +.B 0x08 +SPU ¤Ï¥Á¥ã¥ó¥Í¥ë¤Î¥¦¥§¥¤¥ÈÃæ¤Ç¤¢¤ë¡£ +.TP +.B 0x10 +SPU ¤Ï¥·¥ó¥°¥ë¥¹¥Æ¥Ã¥×¥â¡¼¥É¤Ç¤¢¤Ã¤¿¡£ +.TP +.B 0x20 +SPU ¤¬ÉÔÀµ¤ÊÌ¿Îá¤ò¼Â¹Ô¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B 0x40 +SPU ¤¬ÉÔÀµ¤Ê¥Á¥ã¥ó¥Í¥ë¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B 0x3fff0000 +¤³¤ÎÃͤΥޥ¹¥¯¤òŬÍѤ·¤ÆÆÀ¤é¤ì¤¿¥Ó¥Ã¥ÈÃͤˤϡ¢ +stop-and-signal Ì¿Îᤫ¤éÊÖ¤µ¤ì¤¿¥³¡¼¥É¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥Ó¥Ã¥È¤Ï 0x02 ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +.PP +.BR spu_run () +¤¬¥¨¥é¡¼¤òÊÖ¤µ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢²¼°Ì 8 ¥Ó¥Ã¥È¤Î¤¦¤Á 1 ¤Ä°Ê¾å¤Ï +¾ï¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EFAULT +.I npc +¤¬Í­¸ú¤Ê¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¤¡£¤Þ¤¿¤Ï +.I event +¤¬ NULL °Ê³°¤Ç¡¢¤·¤«¤â̵¸ú¤Ê¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.TP +.B EINTR +.BR spu_run () +¤Î¼Â¹ÔÃæ¤Ë¥·¥°¥Ê¥ë¤¬È¯À¸¤·¤¿¡£ +.BR signal (7) +»²¾È¡£ +ɬÍפǤ¢¤ì¤Ð¡¢ +.I npc +¤ÎÃͤϿ·¤·¤¤¥×¥í¥°¥é¥à¥«¥¦¥ó¥¿¤ÎÃͤ˹¹¿·¤µ¤ì¤ë¡£ +.TP +.B EINVAL +.I fd +¤¬ +.BR spu_create (2) +¤¬ÊÖ¤·¤¿Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B ENOMEM +Memory Flow Controller (MFC) DMA ¤Ë¤è¤êȯÀ¸¤·¤¿¥Ú¡¼¥¸¥Õ¥©¡¼¥ë¥È¤ò +½èÍý¤¹¤ë¤Î¤ËɬÍפʥá¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOSYS +µ¡Ç½¤¬Æ°ºîÃæ¤Î¥·¥¹¥Æ¥à¤ÇÄ󶡤µ¤ì¤Æ¤¤¤Ê¤¤¡£Íýͳ¤Ï¡¢ +¥Ï¡¼¥É¥¦¥§¥¢¤Ç SPU ¤¬Ä󶡤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +spufs ¥â¥¸¥å¡¼¥ë¤¬¥í¡¼¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢¤Î¤É¤Á¤é¤«¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR spu_run () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.6.16 ¤Ç Linux ¤ËÄɲ䵤줿¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢ +PowerPC ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Î¤ß¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤¿¥×¥í¥°¥é¥à¤Ï°Ü¿¢À­¤¬¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤¦¤³¤È¡£¤¿¤À¤·¡¢ +.BR spu_run () +¤Ï ¤è¤êÃê¾ÝÅ٤ι⤤ SPU ¤Ø¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¼ÂÁõ¤¹¤ë¥é¥¤¥Ö¥é¥ê¤«¤é +ÍøÍѤµ¤ì¤ë¤³¤È¤ò°Õ¿Þ¤·¤¿¤â¤Î¤Ç¤¢¤ê¡¢Ä̾ï¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é +»ÈÍѤϰտޤµ¤ì¤Æ¤¤¤Ê¤¤¡£¿ä¾©¤Î¥é¥¤¥Ö¥é¥ê¤Ë¤Ä¤¤¤Æ¤Ï +.I http://www.bsc.es/projects/deepcomputing/linuxoncell/ +¤ò»²¾È¤Î¤³¤È¡£ +.SH Îã +°Ê²¼¤Ï¡¢´Êñ¤Ê 1 Ì¿Îá¤Î SPU ¥×¥í¥°¥é¥à¤ò +.BR spu_run () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¼Â¹Ô¤µ¤»¤ëÎã¤Ç¤¢¤ë¡£ + +.nf +#include +#include +#include +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int main(void) +{ + int context, fd, spu_status; + uint32_t instruction, npc; + + context = spu_create("/spu/example\-context", 0, 0755); + if (context == -1) + handle_error("spu_create"); + + /* write a \(aqstop 0x1234\(aq instruction to the SPU\(aqs + * local store memory + */ + instruction = 0x00001234; + + fd = open("/spu/example\-context/mem", O_RDWR); + if (fd == -1) + handle_error("open"); + write(fd, &instruction, sizeof(instruction)); + + /* set npc to the starting instruction address of the + * SPU program. Since we wrote the instruction at the + * start of the mem file, the entry point will be 0x0 + */ + npc = 0; + + spu_status = spu_run(context, &npc, NULL); + if (spu_status == -1) + handle_error("open"); + + /* we should see a status code of 0x1234002: + * 0x00000002 (spu was stopped due to stop\-and\-signal) + * | 0x12340000 (the stop\-and\-signal code) + */ + printf("SPU Status: 0x%08x\\n", spu_status); + + exit(EXIT_SUCCESS); +} +.fi +.\" .SH AUTHORS +.\" Arnd Bergmann , Jeremy Kerr +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR spu_create (2), +.BR capabilities (7), +.BR spufs (7) diff --git a/release/man2/stat.2 b/release/man2/stat.2 new file mode 100644 index 00000000..e88a7723 --- /dev/null +++ b/release/man2/stat.2 @@ -0,0 +1,643 @@ +'\" t +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 +.\" Parts Copyright (c) 1995 Nicolai Langfeldt (janl@ifi.uio.no), 1/1/95 +.\" 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 by Michael Haardt +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1995-05-18 by Todd Larason +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 1995-01-09 by Richard Kettlewell +.\" Modified 1998-05-13 by Michael Haardt +.\" Modified 1999-07-06 by aeb & Albert Cahalan +.\" Modified 2000-01-07 by aeb +.\" Modified 2004-06-23 by Michael Kerrisk +.\" 2007-06-08 mtk: Added example program +.\" 2007-07-05 mtk: Added details on underlying system call interfaces +.\" +.\" Japanese Version Copyright (c) 1998-1999 HANATAKA Shinya +.\" and Copyright (c) 2005-2008 Akihiro MOTOKI +.\" +.\" Translated 1998-06-21, HANATAKA Shinya +.\" Modified 1999-04-16, HANATAKA Shinya +.\" Updated 2000-01-03, Kentaro Shirakata +.\" Updated 2000-10-06, Kentaro Shirakata +.\" Updated 2001-04-09, Kentaro Shirakata +.\" Updated 2001-06-25, Kentaro Shirakata +.\" Updated 2005-02-28, Akihiro MOTOKI +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2005-11-19, Akihiro MOTOKI, catch up to LDP v2.14 +.\" Updated 2006-07-21, Akihiro MOTOKI, LDP v2.36 +.\" Updated 2007-06-13, Akihiro MOTOKI, LDP v2.55 +.\" Updated 2008-09-19, Akihiro MOTOKI, LDP v3.08 +.\" +.\"WORD: status ¾õÂÖ +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: implement ¼ÂÁõ +.\"WORD: owner ½êÍ­¼Ô +.\"WORD: group ¥°¥ë¡¼¥× +.\"WORD: user ¥æ¡¼¥¶¡¼ +.\"WORD: other ¾¿Í +.\"WORD: hard link count ¥Ï¡¼¥É¡¦¥ê¥ó¥¯¿ô +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: socket ¥½¥±¥Ã¥È +.\"WORD: device ¥Ç¥Ð¥¤¥¹ +.\"WORD: sticky bit ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È +.\"WORD: mandatory locking ¶¯À©¥í¥Ã¥¯ +.\" +.TH STAT 2 2009-09-30 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +stat, fstat, lstat \- ¥Õ¥¡¥¤¥ë¤Î¾õÂÖ¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.br +.B #include +.sp +.BI "int stat(const char *" path ", struct stat *" buf ); +.br +.BI "int fstat(int " fd ", struct stat *" buf ); +.br +.BI "int lstat(const char *" path ", struct stat *" buf ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR lstat (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÊÖ¤¹¡£ +¥Õ¥¡¥¤¥ë¤½¤Î¤â¤Î¤ËÂФ¹¤ë¥¢¥¯¥»¥¹µö²Ä¤ÏɬÍפȤ·¤Ê¤¤¤¬¡¢ +\(em +.BR stat () +¤È +.BR lstat () +¤Î¾ì¹ç¤Ë¤Ï +\(em +¤½¤Î¥Õ¥¡¥¤¥ë¤Ø»ê¤ë +.I path +¤ò¹½À®¤¹¤ëÁ´¤Æ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ¹¤ë¼Â¹Ô (¸¡º÷) µö²Ä¤¬É¬ÍפǤ¢¤ë¡£ +.PP +.BR stat () +¤Ï +.I path +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¾õÂÖ¤ò¼èÆÀ¤·¤Æ +.I buf +¤Ø³ÊǼ¤¹¤ë¡£ + +.BR lstat () +¤Ï +.BR stat () +¤ÈƱ¤¸¤Ç¤¢¤ë¤¬¡¢ +.I path +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¡¢¥ê¥ó¥¯¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Ç¤Ï¤Ê¤¯¡¢ +¥ê¥ó¥¯¼«¿È¤Î¾õÂÖ¤ò¼èÆÀ¤¹¤ëÅÀ¤¬°Û¤Ê¤ë¡£ + +.BR fstat () +¤Ï +.BR stat () +¤ÈƱ¤¸¤À¤¬¡¢ +¾õÂÖ¤ò¼èÆÀ¤¹¤ë¥Õ¥¡¥¤¥ë¤ò¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ç»ØÄꤹ¤ë¡£ +.PP +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤¤¤º¤ì¤â¡¢·ë²Ì¤ò +.I stat +¹½Â¤ÂΤËÆþ¤ì¤ÆÊÖ¤¹¡£ +.I stat +¹½Â¤ÂΤˤϰʲ¼¤Î¥Õ¥£¡¼¥ë¥É¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë: +.PP +.in +4n +.nf +struct stat { + dev_t st_dev; /* ¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¥Ç¥Ð¥¤¥¹¤Î ID */ + ino_t st_ino; /* inode ÈÖ¹æ */ + mode_t st_mode; /* ¥¢¥¯¥»¥¹Êݸî */ + nlink_t st_nlink; /* ¥Ï¡¼¥É¥ê¥ó¥¯¤Î¿ô */ + uid_t st_uid; /* ½êÍ­¼Ô¤Î¥æ¡¼¥¶ ID */ + gid_t st_gid; /* ½êÍ­¼Ô¤Î¥°¥ë¡¼¥× ID */ + dev_t st_rdev; /* ¥Ç¥Ð¥¤¥¹ ID (Æüì¥Õ¥¡¥¤¥ë¤Î¾ì¹ç) */ + off_t st_size; /* Á´ÂΤΥµ¥¤¥º (¥Ð¥¤¥Èñ°Ì) */ + blksize_t st_blksize; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à I/O ¤Ç¤Î + ¥Ö¥í¥Ã¥¯¥µ¥¤¥º */ + blkcnt_t st_blocks; /* ³ä¤êÅö¤Æ¤é¤ì¤¿ 512B ¤Î¥Ö¥í¥Ã¥¯¿ô */ + time_t st_atime; /* ºÇ½ª¥¢¥¯¥»¥¹»þ¹ï */ + time_t st_mtime; /* ºÇ½ª½¤Àµ»þ¹ï */ + time_t st_ctime; /* ºÇ½ª¾õÂÖÊѹ¹»þ¹ï */ +}; +.fi +.in +.PP +.I st_dev +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¥Ç¥Ð¥¤¥¹¤ò¼¨¤¹ +(¥Þ¥¯¥í +.BR major (3), +.BR minor (3) +¤Ï¡¢¤³¤Î¥Õ¥£¡¼¥ë¥É¤Î¥Ç¥Ð¥¤¥¹ ID ¤òʬ²ò¤¹¤ë¤Î¤ËÌòΩ¤Ä¤À¤í¤¦)¡£ + +.I st_rdev +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë (inode) ¤¬É½¤¹¥Ç¥Ð¥¤¥¹¤ò¼¨¤¹¡£ + +.I st_size +¥Õ¥£¡¼¥ë¥É¤Ï¡¢(Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤«¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ë) +¥Õ¥¡¥¤¥ë¤ÎÂ礭¤µ¤ò¥Ð¥¤¥Èñ°Ì¤Ç¼¨¤¹¡£ +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ÎÂ礭¤µ¤Ï¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë +¥Ñ¥¹Ì¾¤ÎŤµ (ºÇ¸å¤Î NULL ¥Ð¥¤¥È¤Ï´Þ¤Þ¤Ê¤¤) ¤Ç¤¢¤ë¡£ + +.I st_blocks +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥Õ¥¡¥¤¥ë¤ÎÂ礭¤µ¤ò 512 ¥Ð¥¤¥È¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥ºÃ±°Ì¤Ç¼¨¤¹ +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥Õ¥¡¥¤¥ë¤Ë³ä¤êÅö¤Æ¤µ¤ì¤¿¥Ö¥í¥Ã¥¯¿ô¤ò 512 ¥Ð¥¤¥Èñ°Ì¤Ç¼¨¤¹¡£ +(¥Õ¥¡¥¤¥ë¤Ë·ê¤¬¤¢¤ë¤è¤¦¤Ê¾ì¹ç¡¢¤³¤ÎÃÍ¤Ï +.IR st_size /512 +¤è¤ê¾®¤µ¤¯¤Ê¤ë¤³¤È¤â¤¢¤ë)¡£ + +.I st_blksize +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¸úΨŪ¤Ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à I/O ¤¬¤Ç¤­¤ë¡Ö¹¥¤Þ¤·¤¤¡× +¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ò¼¨¤¹ (¤â¤Ã¤È¾®¤µ¤¤Ã±°Ì¤Ç¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤È¡¢ +Æɤ߽Ф·--½¤Àµ--ºÆ½ñ¤­¹þ¤ß¤È¤¤¤Ã¤¿Èó¸úΨ¤ÊÆ°ºî¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¤«¤â¤·¤ì¤Ê¤¤)¡£ +.PP +Á´¤Æ¤Î Linux ¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬Á´¤Æ¤Î»þ´Ö¥Õ¥£¡¼¥ë¥É¤ò +¼ÂÁõ¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤Î¥¢¥¯¥»¥¹¤¬ +.I st_atime +¥Õ¥£¡¼¥ë¥É¤ò¹¹¿·¤·¤Ê¤¤¤è¤¦¤Ê¤«¤¿¤Á¤Ç¥Þ¥¦¥ó¥È¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.RB ( mount (8) +¤Î +.IR noatime , +.IR nodiratime , +.I relatime +¤ä +.BR mount (2) +¤Î´ØÏ¢¤¹¤ë¾ðÊó¤ò»²¾È)¡£ +¤Þ¤¿¡¢¥Õ¥¡¥¤¥ë¤¬ +.B O_NOATIME +ÉÕ¤­¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï +.I st_atime +¤Ï¹¹¿·¤µ¤ì¤Ê¤¤¡£ +.BR open (2) +»²¾È¡£ + +.I st_atime +¥Õ¥£¡¼¥ë¥É¤Ï¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÊѹ¹¤µ¤ì¤ë +(Î㤨¤Ð¡¢ +.BR execve (2), +.BR mknod (2), +.BR pipe (2), +.BR utime (2) +¤ò»ÈÍѤ·¤¿¾ì¹ç¤ä +.BR read (2) +¤Ç 1 ¥Ð¥¤¥È°Ê¾åÆɤ߹þ¤ó¤À¾ì¹ç¤Ê¤É)¡£ +.BR mmap (2) +¤Ê¤É¤Î¾¤Î¥ë¡¼¥Á¥ó¤Ç¤Ï¡¢ +.I st_atime +¤Ï¹¹¿·¤µ¤ì¤ë¤³¤È¤â¤¢¤ì¤Ð¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤â¤¢¤ë¡£ + +.I st_mtime +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥Õ¥¡¥¤¥ë¤¬½¤Àµ¤µ¤ì¤¿¾ì¹ç¤ËÊѹ¹¤µ¤ì¤ë +(Î㤨¤Ð¡¢ +.BR mknod (2), +.BR truncate (2), +.BR utime (2) +¤ò»ÈÍѤ·¤¿¾ì¹ç¤ä +.BR write (2) +¤Ç 1 ¥Ð¥¤¥È°Ê¾å½ñ¤­¹þ¤ß¤ò¤·¤¿¾ì¹ç¤Ê¤É)¡£ +¤µ¤é¤Ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Î +.I st_mtime +¤Ï¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç +¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤¿¤êºï½ü¤µ¤ì¤¿¤ê¤¹¤ë¤ÈÊѹ¹¤µ¤ì¤ë¡£ +.I st_mtime +¥Õ¥£¡¼¥ë¥É¤Ï +½êÍ­¼Ô¤ä¥°¥ë¡¼¥×¤ä¥Ï¡¼¥É¡¦¥ê¥ó¥¯¿ô¤ä¥â¡¼¥É¤ÎÊѹ¹¤Ç¤ÏÊѹ¹ +.I ¤µ¤ì¤Ê¤¤¡£ + +.I st_ctime +¥Õ¥£¡¼¥ë¥É¤Ï½ñ¤­¹þ¤ß¤ä inode ¾ðÊó +(½êÍ­¼Ô¡¢¥°¥ë¡¼¥×¡¢¥ê¥ó¥¯¿ô¡¢¥â¡¼¥É¤Ê¤É) ¤Î +ÀßÄê¤Ë¤è¤Ã¤ÆÊѹ¹¤µ¤ì¤ë¡£ +.PP +°Ê²¼¤Î POSIX ¥Þ¥¯¥í¤Ï¡¢ +.I st_mode +¥Õ¥£¡¼¥ë¥É +¤Ç»ÈÍѤµ¤ì¤ë¥Õ¥¡¥¤¥ë¼ïÊ̤ΥÁ¥§¥Ã¥¯¤Î¤¿¤á¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë : +.RS 4 +.TP 1.2i +.BR S_ISREG (m) +Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤«? +.TP +.BR S_ISDIR (m) +¥Ç¥£¥ì¥¯¥È¥ê¤«? +.TP +.BR S_ISCHR (m) +¥­¥ã¥é¥¯¥¿¡¼¡¦¥Ç¥Ð¥¤¥¹¤«? +.TP +.BR S_ISBLK (m) +¥Ö¥í¥Ã¥¯¡¦¥Ç¥Ð¥¤¥¹¤«? +.TP +.BR S_ISFIFO (m) +FIFO (̾Á°ÉÕ¤­¥Ñ¥¤¥×) ¤«? +.TP +.BR S_ISLNK (m) +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤«? (POSIX.1-1996 ¤Ë¤Ï¤Ê¤¤) +.TP +.BR S_ISSOCK (m) +¥½¥±¥Ã¥È¤«? (POSIX.1-1996 ¤Ë¤Ï¤Ê¤¤) +.RE +.PP +°Ê²¼¤Î¥Õ¥é¥°¤¬ +.I st_mode +¥Õ¥£¡¼¥ë¥ÉÍѤËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.TS +lB l l. +S_IFMT 0170000 ¥Õ¥¡¥¤¥ë¼ïÊ̤ò¼¨¤¹¥Ó¥Ã¥ÈÎΰè¤òɽ¤¹¥Ó¥Ã¥È¥Þ¥¹¥¯ +S_IFSOCK 0140000 ¥½¥±¥Ã¥È +S_IFLNK 0120000 ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +S_IFREG 0100000 Ä̾ï¤Î¥Õ¥¡¥¤¥ë +S_IFBLK 0060000 ¥Ö¥í¥Ã¥¯¡¦¥Ç¥Ð¥¤¥¹ +S_IFDIR 0040000 ¥Ç¥£¥ì¥¯¥È¥ê +S_IFCHR 0020000 ¥­¥ã¥é¥¯¥¿¡¼¡¦¥Ç¥Ð¥¤¥¹ +S_IFIFO 0010000 FIFO +S_ISUID 0004000 set-user-ID bit +S_ISGID 0002000 set-group-ID bit (²¼µ­»²¾È) +S_ISVTX 0001000 ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È (²¼µ­»²¾È) +S_IRWXU 00700 ¥Õ¥¡¥¤¥ë½êÍ­¼Ô¤Î¥¢¥¯¥»¥¹µö²ÄÍѤΥӥåȥޥ¹¥¯ +S_IRUSR 00400 ½êÍ­¼Ô¤ÎÆɤ߹þ¤ßµö²Ä +S_IWUSR 00200 ½êÍ­¼Ô¤Î½ñ¤­¹þ¤ßµö²Ä +S_IXUSR 00100 ½êÍ­¼Ô¤Î¼Â¹Ôµö²Ä +S_IRWXG 00070 ¥°¥ë¡¼¥×¤Î¥¢¥¯¥»¥¹µö²ÄÍѤΥӥåȥޥ¹¥¯ +S_IRGRP 00040 ¥°¥ë¡¼¥×¤ÎÆɤ߹þ¤ßµö²Ä +S_IWGRP 00020 ¥°¥ë¡¼¥×¤Î½ñ¤­¹þ¤ßµö²Ä +S_IXGRP 00010 ¥°¥ë¡¼¥×¤Î¼Â¹Ôµö²Ä +S_IRWXO 00007 ¾¿Í (others) ¤Î¥¢¥¯¥»¥¹µö²ÄÍѤΥӥåȥޥ¹¥¯ +S_IROTH 00004 ¾¿Í¤ÎÆɤ߹þ¤ßµö²Ä +S_IWOTH 00002 ¾¿Í¤Î½ñ¤­¹þ¤ßµö²Ä +S_IXOTH 00001 ¾¿Í¤Î¼Â¹Ôµö²Ä +.TE +.in +.P +set-group-ID bit +.RB ( S_ISGID ) +¤Ë¤Ï¤¤¤¯¤Ä¤«¤ÎÆüì¤Ê»ÈÍÑË¡¤¬¤¢¤ë: +¥Ç¥£¥ì¥¯¥È¥ê¤ËÀßÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤¬ BSD Êý¼°¤Ç»ÈÍѤµ¤ì¤ë +¤³¤È¤ò¼¨¤¹¡£¤Ä¤Þ¤ê¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×ID ¤Ï +ºîÀ®¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥°¥ë¡¼¥×ID ¤Ç¤Ï¤Ê¤¯¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Î +¥°¥ë¡¼¥×ID ¤ò·Ñ¾µ¤¹¤ë¡£¤Þ¤¿¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤â +.B S_ISGID +¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤ë¡£¥°¥ë¡¼¥×¼Â¹Ô¥Ó¥Ã¥È +.RB ( S_IXGRP ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +set-group-ID ¥Ó¥Ã¥È¤Ï¥Õ¥¡¥¤¥ë/¥ì¥³¡¼¥É¤Î +¶¯À©Åª¤Ê (mandatory) ¥í¥Ã¥¯¤òɽ¤¹¡£ +.P +¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¥Ó¥Ã¥È (S_ISVTX) ¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Õ¥¡¥¤¥ë¤Î̾Á°¤òÊѹ¹¤·¤¿¤ê¡¢ºï½ü¤·¤¿¤ê¤Ç¤­¤ë¤Î¤Ï¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤«¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î½êÍ­¼Ô¤«¡¢Æø¢¥×¥í¥»¥¹ +¤À¤±¤È¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.I path +¤¬½ê°¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤È¤½¤Î¾å°Ì¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤¤¤º¤ì¤«¤Ë +ÂФ¹¤ë¸¡º÷µö²Ä¤¬¤Ê¤«¤Ã¤¿ +.RB ( path_resolution (7) +¤â»²¾È¤Î¤³¤È)¡£ +.TP +.B EBADF +.I fd +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EFAULT +¥¢¥É¥ì¥¹¤¬´Ö°ã¤Ã¤Æ¤¤¤ë¡£ +.TP +.B ELOOP +¥Ñ¥¹¤òé¤ëºÝ¤Ë²ò·è¤¹¤Ù¤­¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤¿¡£ +.TP +.B ENAMETOOLONG +¥Õ¥¡¥¤¥ë̾¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +.I path +¤Î¹½À®Í×ÁǤ¬Â¸ºß¤·¤Ê¤¤¤«¡¢ +.I path +¤¬¶õʸ»úÎó¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤Î¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I path +¤ÎÁ°È¾Éôʬ (prefix) ¤Î¹½À®Í×ÁǤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EOVERFLOW +.RB ( stat ()) +.I path +¤¬¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ò +.I off_t +·¿¤Çɽ¸½¤Ç¤­¤Ê¤¤¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +¤³¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë¤Î¤Ï¡¢32 ¥Ó¥Ã¥È¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¾å¤Ç +.I -D_FILE_OFFSET_BITS=64 +¤ò»ØÄꤻ¤º¤Ë¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤¬ +.I (2<31)-1 +¥Ó¥Ã¥È¤òĶ¤¨¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +.BR stat () +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤Ç¤¢¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï SVr4, 4.3BSD, POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR stat () +¤È +.BR fstat () +¥³¡¼¥ë¤Ï SVr4, SVID, POSIX, X/OPEN, 4.3BSD ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR lstat () +¥³¡¼¥ë¤Ï 4.3BSD ¤È SVr4 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.\" SVr4 ¤Ë¤Ï¾¤Ë +.\" .BR fstat () +.\" ¤Î¥¨¥é¡¼¤È¤·¤Æ EINTR, ENOLINK, EOVERFLOW ¤¬µ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" SVr4 ¤Ë¤Ï¾¤Ë +.\" .BR stat () +.\" ¤È +.\" .BR lstat () +.\" ¤Î¥¨¥é¡¼¤È¤·¤Æ EINTR, EMULTIHOP, ENOLINK, EOVERFLOW ¤¬µ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ + +.I st_blocks +¤È +.I st_blksize +¥Õ¥£¡¼¥ë¥É¤Î»ÈÍѤϤ¢¤Þ¤ê°Ü¿¢À­¤¬¤Ê¤¤¡£ +(¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï BSD ¤Ë¤è¤Ã¤ÆƳÆþ¤µ¤ì¤¿¡£ +¥·¥¹¥Æ¥à¤´¤È¤Ë²ò¼á¤¬°Û¤Ê¤Ã¤Æ¤ª¤ê¡¢ +NFS ¥Þ¥¦¥ó¥È¤Î¾ì¹ç¤Ë¤ÏƱ¤¸¥·¥¹¥Æ¥à¤Ç¤â°Û¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ë) +.LP +POSIX ¤Ë¤Ï +.BR S_IFMT , +.BR S_IFSOCK , +.BR S_IFLNK , +.BR S_IFREG , +.BR S_IFBLK , +.BR S_IFDIR , +.BR S_IFCHR , +.BR S_IFIFO , +.B S_ISVTX +¥Ó¥Ã¥È¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£¤«¤ï¤ê¤Ë +.BR S_ISDIR () +¤Î¤è¤¦¤Ê¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤è¤¦¤ËÍ׵ᤷ¤Æ¤¤¤ë¡£ +¥Þ¥¯¥í +.BR S_ISLNK () +¤È +.BR S_ISSOCK () +¤Ï POSIX.1-1996 ¤Ë¤Ï¤Ê¤¤¤¬¡¢ +POSIX.1-2001 ¤Ë¤ÏξÊý¤È¤â¸ºß¤¹¤ë¡£ +Á°¼Ô¤Ï SVID 4 ¤Ë¡¢¸å¼Ô¤Ï SUSv2 ¤ËͳÍ褷¤Æ¤¤¤ë¡£ +.LP +Unix V7 (¤È¤½¤Î¸å¤Î¥·¥¹¥Æ¥à) ¤Ï +.BR S_IREAD , +.BR S_IWRITE , +.B S_IEXEC +¤ò»ý¤Ã¤Æ¤ª¤ê¡¢ +POSIX ¤Ï¤½¤ÎƱµÁ¸ì¤È¤·¤Æ +.BR S_IRUSR , +.BR S_IWUSR , +.B S_IXUSR +¤òµ¬Äꤷ¤Æ¤¤¤ë¡£ +.SS ¾¤Î¥·¥¹¥Æ¥à +³Æ¼ï¥·¥¹¥Æ¥à¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤¿(¤¤¤ë)ÃÍ: +.TS +l l l l l. +16¿Ê ̾Á° ls 8¿Ê¿ô ÀâÌÀ +f000 S_IFMT 170000 ¥Õ¥¡¥¤¥ë¼ïÊÌ¥Õ¥£¡¼¥ë¥É¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯ +0000 000000 SCO ¤Ç¤Ï »ÈÍÑÉÔǽ inode; + BSD ¤Ç¤Ï̤ÃΤΥե¡¥¤¥ë¼ïÊÌ; + SVID-v2 ¤È XPG2 ¤Ç¤Ï 0 ¤È 0100000 ¤Î + ξÊý¤¬ÉáÄ̤Υե¡¥¤¥ë +1000 S_IFIFO p| 010000 FIFO (̾Á°ÉÕ¤­¥Ñ¥¤¥×) +2000 S_IFCHR c 020000 ¥­¥ã¥é¥¯¥¿Æüì¥Õ¥¡¥¤¥ë (V7) +3000 S_IFMPC 030000 ¿½Å²½¤µ¤ì¤¿¥­¥ã¥é¥¯¥¿Æüì¥Õ¥¡¥¤¥ë (V7) +4000 S_IFDIR d/ 040000 ¥Ç¥£¥ì¥¯¥È¥ê (V7) +5000 S_IFNAM 050000 XENIX Æó¤Ä¤ÎÉû·¿¤ò»ý¤Ä̾Á°ÉÕ¤­¤Î + Æüì¥Õ¥¡¥¤¥ë + Éû·¿¤Ï \fIst_rdev\fP ¤ÎÃÍ 1,2 ¤Ç¶èÊ̤µ¤ì¤ë: +0001 S_INSEM s 000001 XENIX IFNAM¤Î¥»¥Þ¥Õ¥©¡¼Éû·¿ +0002 S_INSHD m 000002 XENIX IFNAM¤Î¶¦Í­¥Ç¡¼¥¿Éû·¿ +6000 S_IFBLK b 060000 ¥Ö¥í¥Ã¥¯Æüì¥Õ¥¡¥¤¥ë (V7) +7000 S_IFMPB 070000 ¿½Å²½¤µ¤ì¤¿¥Ö¥í¥Ã¥¯Æüì¥Õ¥¡¥¤¥ë (V7) +8000 S_IFREG - 100000 Ä̾ï¥Õ¥¡¥¤¥ë (V7) +9000 S_IFCMP 110000 VxFS °µ½Ì¥Õ¥¡¥¤¥ë +9000 S_IFNWK n 110000 ¥Í¥Ã¥È¥ï¡¼¥¯Æüì¥Õ¥¡¥¤¥ë (HP-UX) +a000 S_IFLNK l@ 120000 ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ (BSD) +b000 S_IFSHAD 130000 Solaris ACL ¤Î¤¿¤á¤Î±£¤µ¤ì¤¿ inode + (¥æ¡¼¥¶¶õ´Ö¤«¤é¤Ï¸«¤¨¤Ê¤¤) +c000 S_IFSOCK s= 140000 ¥½¥±¥Ã¥È (BSD; VxFS ¤Î "S_IFSOC") +d000 S_IFDOOR D> 150000 Solaris ¥É¥¢¡¦¥Õ¥¡¥¤¥ë +e000 S_IFWHT w% 160000 BSD ¶õÇò¥Õ¥¡¥¤¥ë (inode ¤ò»ÈÍѤ·¤Ê¤¤) +0200 S_ISVTX 001000 `¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È':»ÈÍѸå¤â + ¥¹¥ï¥Ã¥×¤Ë»Ä¤¹ (V7) + ͽÌó (SVID-v2) + ¥Ç¥£¥ì¥¯¥È¥ê°Ê³°: ¥Õ¥¡¥¤¥ë¤ò¥­¥ã¥Ã¥·¥å + ¤·¤Ê¤¤ (SunOS) + ¥Ç¥£¥ì¥¯¥È¥ê: ºï½üÀ©¸Â¥Õ¥é¥° (SVID-v4.2) +0400 S_ISGID 002000 ¼Â¹Ô»þ¤Î set-group-ID (V7) + ¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ¤Ï GID ¤ÎÅÁã¤Ë + BSD Êý¼°¤ò»ÈÍѤ¹¤ë +0400 S_ENFMT 002000 System V ¥Õ¥¡¥¤¥ë¡¦¥í¥Ã¥¯¤ò¶¯À©¤¹¤ë + (S_ISGID ¤È¶¦Í­) +0800 S_ISUID 004000 ¼Â¹Ô»þ¤Î set-user-ID (V7) +0800 S_CDF 004000 ¥Ç¥£¥ì¥¯¥È¥ê¤¬¾õ¶·°Í¸¥Õ¥¡¥¤¥ë (HP-UX) +.TE + +¥¹¥Æ¥£¥Ã¥­¡¼ ¥³¥Þ¥ó¥É¤Ï Version 32V AT&T UNIX ¤ÇÅо줷¤¿¡£ +.SH Ãí°Õ +¥«¡¼¥Í¥ë 2.5.48 °Ê¹ß¤Ç¤Ï¡¢ +.I stat +¹½Â¤ÂÎ¤Ï 3¤Ä¤Î¥Õ¥¡¥¤¥ë¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×´ØÏ¢¤Î¥Õ¥£¡¼¥ë¥É¤Ç +¥Ê¥ÎÉÃñ°Ì¤ÎÀºÅÙ¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +glibc ¤Ç¤Ï¡¢³Æ¥Õ¥£¡¼¥ë¥É¤Î¥Ê¥ÎÉäξðÊó¤ò +.I st_atim.tv_nsec +¤ä +.I st_atimensec +¤È¤¤¤Ã¤¿·Á¤Ç»²¾È¤Ç¤­¤ë¡£ +µ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï +.I st_atim.tv_nsec +¤Î·Á¼°¤Ç¡¢¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï +.I st_atimensec +¤Î·Á¼°¤È¤Ê¤ë¡£ +Éäè¤êºÙ¤«¤¤¥¿¥¤¥à¥¹¥¿¥ó¥×¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +¤³¤ì¤é¤Î¥Ê¥ÎÉäΥե£¡¼¥ë¥É¤Ï 0 ¤ËÀßÄꤵ¤ì¤ë¡£ +.\" As at kernel 2.6.25, XFS and JFS support nanosecond timestamps, +.\" but ext2, ext3, and Reiserfs do not. +.\" FIXME . SUSv4 specifies nanosecond timestamps. + +Linux ¤Ç¤Ï¡¢ +.BR lstat () +¤Ï°ìÈ̤ˤϼ«Æ°¥Þ¥¦¥ó¥ÈÆ°ºî (automounter action) ¤Î¤­¤Ã¤«¤±¤È¤Ê¤é¤Ê¤¤¤¬¡¢ +.BR stat () +¤Ï¤­¤Ã¤«¤±¤È¤Ê¤ë¡£ + +.I /proc +¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤Î¤Û¤È¤ó¤É¤Ç¤Ï¡¢ +.BR stat () +¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¡¢ +.I st_size +¥Õ¥£¡¼¥ë¥É¤Ë¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤¬ÊÖ¤µ¤ì¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë +.I st_size +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SS Çظå¤Î¥«¡¼¥Í¥ë¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +»þ´Ö¤Î·Ð²á¤È¤È¤â¤Ë¡¢ +.I stat +¹½Â¤ÂΤΥµ¥¤¥º¤¬Â礭¤¯¤Ê¤ê¡¢¤³¤Î±Æ¶Á¤Ç +.BR stat () +¤Ë¤Ï 3¤Ä¤Î¥Ð¡¼¥¸¥ç¥ó¤¬Â¸ºß¤¹¤ë: +.IR sys_stat () +(¥¹¥í¥Ã¥È¤Ï +.IR __NR_oldstat )¡¢ +.IR sys_newstat () +(¥¹¥í¥Ã¥È¤Ï +.IR __NR_stat )¡¢ +.IR sys_stat64 () +(¥«¡¼¥Í¥ë 2.4 ¤ÇƳÆþ; ¥¹¥í¥Ã¥È¤Ï +.IR __NR_stat64 ). +glibc ¤Î +.BR stat () +¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¤³¤ì¤é¤Î¾ÜºÙ¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é±£Ê䷤Ƥ¯¤ì¤ë¡£ +¶ñÂÎŪ¤Ë¤Ï¡¢¥«¡¼¥Í¥ë¤¬Ä󶡤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¤¦¤ÁºÇ¿·¤Î¥Ð¡¼¥¸¥ç¥ó¤ò +µ¯Æ°¤·¡¢¸Å¤¤¥Ð¥¤¥Ê¥ê¤Î¾ì¹ç¤Ë¤ÏɬÍפ˱þ¤¸¤ÆÊÖ¤µ¤ì¤¿¾ðÊó¤òºÆ¹½À® (repack) ¤¹¤ë¡£ +.BR fstat () +¤È +.BR lstat () +¤Ë¤Ä¤¤¤Æ¤âƱÍͤǤ¢¤ë¡£ +.\" +.\" A note from Andries Brouwer, July 2007 +.\" +.\" > Is the story not rather more complicated for some calls like +.\" > stat(2)? +.\" +.\" Yes and no, mostly no. See /usr/include/sys/stat.h . +.\" +.\" The idea is here not so much that syscalls change, but that +.\" the definitions of struct stat and of the types dev_t and mode_t change. +.\" This means that libc (even if it does not call the kernel +.\" but only calls some internal function) must know what the +.\" format of dev_t or of struct stat is. +.\" The communication between the application and libc goes via +.\" the include file that defines a _STAT_VER and +.\" _MKNOD_VER describing the layout of the data that user space +.\" uses. Each (almost each) occurrence of stat() is replaced by +.\" an occurrence of xstat() where the first parameter of xstat() +.\" is this version number _STAT_VER. +.\" +.\" Now, also the definitions used by the kernel change. +.\" But glibc copes with this in the standard way, and the +.\" struct stat as returned by the kernel is repacked into +.\" the struct stat as expected by the application. +.\" Thus, _STAT_VER and this setup cater for the application-libc +.\" interface, rather than the libc-kernel interface. +.\" +.\" (Note that the details depend on gcc being used as c compiler.) +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï +.BR stat () +¤ò¸Æ¤Ó½Ð¤·¡¢Ê֤äƤ­¤¿ +.I stat +¹½Â¤ÂΤΥե£¡¼¥ë¥É¤Î¤¤¤¯¤Ä¤«¤òɽ¼¨¤¹¤ë¡£ +.nf + +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct stat sb; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + if (stat(argv[1], &sb) == \-1) { + perror("stat"); + exit(EXIT_FAILURE); + } + + printf("File type: "); + + switch (sb.st_mode & S_IFMT) { + case S_IFBLK: printf("block device\\n"); break; + case S_IFCHR: printf("character device\\n"); break; + case S_IFDIR: printf("directory\\n"); break; + case S_IFIFO: printf("FIFO/pipe\\n"); break; + case S_IFLNK: printf("symlink\\n"); break; + case S_IFREG: printf("regular file\\n"); break; + case S_IFSOCK: printf("socket\\n"); break; + default: printf("unknown?\\n"); break; + } + + printf("I\-node number: %ld\\n", (long) sb.st_ino); + + printf("Mode: %lo (octal)\\n", + (unsigned long) sb.st_mode); + + printf("Link count: %ld\\n", (long) sb.st_nlink); + printf("Ownership: UID=%ld GID=%ld\\n", + (long) sb.st_uid, (long) sb.st_gid); + + printf("Preferred I/O block size: %ld bytes\\n", + (long) sb.st_blksize); + printf("File size: %lld bytes\\n", + (long long) sb.st_size); + printf("Blocks allocated: %lld\\n", + (long long) sb.st_blocks); + + printf("Last status change: %s", ctime(&sb.st_ctime)); + printf("Last file access: %s", ctime(&sb.st_atime)); + printf("Last file modification: %s", ctime(&sb.st_mtime)); + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR access (2), +.BR chmod (2), +.BR chown (2), +.BR fstatat (2), +.BR readlink (2), +.BR utime (2), +.BR capabilities (7), +.BR symlink (7) diff --git a/release/man2/statfs.2 b/release/man2/statfs.2 new file mode 100644 index 00000000..8c87c855 --- /dev/null +++ b/release/man2/statfs.2 @@ -0,0 +1,283 @@ +.\" Copyright (C) 2003 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. +.\" +.\" Modified 2003-08-17 by Walter Harms +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Fri Dec 12 00:25:54 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Sat Jun 2 20:25:46 JST 2001 +.\" by Yuichi SATO +.\" Updated & Modified Sat Jan 18 16:48:08 JST 2003 +.\" by Yuichi SATO +.\" Updated & Modified Sun Sep 7 00:52:44 JST 2003 by Yuichi SATO +.\" Updated & Modified Sun Jan 9 22:35:28 JST 2005 by Yuichi SATO +.\" Updated 2006-07-21, Akihiro MOTOKI , LDP v2.36 +.\" +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: mount ¥Þ¥¦¥ó¥È +.\"WORD: pointer ¥Ý¥¤¥ó¥¿¡¼ +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: open ¥ª¡¼¥×¥ó +.\" +.TH STATFS 2 2004-06-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +statfs, fstatfs \- ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ÎÅý·×¤òÆÀ¤ë +.SH ½ñ¼° +.BR "#include " "/* ¤Þ¤¿¤Ï */" +.sp +.BI "int statfs(const char *" path ", struct statfs *" buf ); +.br +.BI "int fstatfs(int " fd ", struct statfs *" buf ); +.SH ½ñ¼° +´Ø¿ô +.BR statfs () +¤Ï¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÊÖ¤¹¡£ +.I path +¤Ï¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤Ç¤¢¤ë¡£ +.I buf +¤Ï +.I statfs +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡¼¤Ç¡¢¤ª¤è¤½°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: + +.in +4n +.nf +struct statfs { + long f_type; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î·¿ (²¼µ­»²¾È) */ + long f_bsize; /* ºÇŬ¤Ê¥Ö¥í¥Ã¥¯¥µ¥¤¥º */ + long f_blocks; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÁí¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¿ô */ + long f_bfree; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¶õ¤­¥Ö¥í¥Ã¥¯¿ô */ + long f_bavail; /* ÈóÆø¢¥æ¡¼¥¶¤¬»ÈÍѲÄǽ¤Ê¶õ¤­¥Ö¥í¥Ã¥¯¿ô */ + long f_files; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÁí¥Õ¥¡¥¤¥ë¥Î¡¼¥É¿ô */ + long f_ffree; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¶õ¤­¥Õ¥¡¥¤¥ë¥Î¡¼¥É¿ô */ + fsid_t f_fsid; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î ID */ + long f_namelen; /* ¥Õ¥¡¥¤¥ë̾¤ÎºÇÂçĹ */ +}; + +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î·¿: + + ADFS_SUPER_MAGIC 0xadf5 + AFFS_SUPER_MAGIC 0xADFF + BEFS_SUPER_MAGIC 0x42465331 + BFS_MAGIC 0x1BADFACE + CIFS_MAGIC_NUMBER 0xFF534D42 + CODA_SUPER_MAGIC 0x73757245 + COH_SUPER_MAGIC 0x012FF7B7 + CRAMFS_MAGIC 0x28cd3d45 + DEVFS_SUPER_MAGIC 0x1373 + EFS_SUPER_MAGIC 0x00414A53 + EXT_SUPER_MAGIC 0x137D + EXT2_OLD_SUPER_MAGIC 0xEF51 + EXT2_SUPER_MAGIC 0xEF53 + EXT3_SUPER_MAGIC 0xEF53 + HFS_SUPER_MAGIC 0x4244 + HPFS_SUPER_MAGIC 0xF995E849 + HUGETLBFS_MAGIC 0x958458f6 + ISOFS_SUPER_MAGIC 0x9660 + JFFS2_SUPER_MAGIC 0x72b6 + JFS_SUPER_MAGIC 0x3153464a + MINIX_SUPER_MAGIC 0x137F /* ¥ª¥ê¥¸¥Ê¥ë¤Î minix */ + MINIX_SUPER_MAGIC2 0x138F /* 30 ʸ»ú¥Õ¥¡¥¤¥ë̾¤Î minix */ + MINIX2_SUPER_MAGIC 0x2468 /* minix V2 */ + MINIX2_SUPER_MAGIC2 0x2478 /* minix V2, 30 ʸ»ú¥Õ¥¡¥¤¥ë̾ */ + MSDOS_SUPER_MAGIC 0x4d44 + NCP_SUPER_MAGIC 0x564c + NFS_SUPER_MAGIC 0x6969 + NTFS_SB_MAGIC 0x5346544e + OPENPROM_SUPER_MAGIC 0x9fa1 + PROC_SUPER_MAGIC 0x9fa0 + QNX4_SUPER_MAGIC 0x002f + REISERFS_SUPER_MAGIC 0x52654973 + ROMFS_MAGIC 0x7275 + SMB_SUPER_MAGIC 0x517B + SYSV2_SUPER_MAGIC 0x012FF7B6 + SYSV4_SUPER_MAGIC 0x012FF7B5 + TMPFS_MAGIC 0x01021994 + UDF_SUPER_MAGIC 0x15013346 + UFS_MAGIC 0x00011954 + USBDEVICE_SUPER_MAGIC 0x9fa2 + VXFS_SUPER_MAGIC 0xa501FCF5 + XENIX_SUPER_MAGIC 0x012FF7B4 + XFS_SUPER_MAGIC 0x58465342 + _XIAFS_SUPER_MAGIC 0x012FD16D +.fi +.in +.PP +.I f_fsid +¤Ë¤É¤ó¤ÊÃͤ¬Æþ¤ë¤Ù¤­¤Ê¤Î¤«¤Ïï¤âÃΤé¤Ê¤¤ (⤷¡¢²¼µ­¤ò»²¾È)¡£ +.PP +¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ̤ÄêµÁ¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï 0 ¤¬ +ÀßÄꤵ¤ì¤ë¡£ +.BR fstatfs () +¤Ï¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.I fd +¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡¢Æ±¤¸¾ðÊó¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ì¤Ð 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.RB ( statfs () +¤Î¾ì¹ç) +.I path +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Ë¸¡º÷µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EBADF +.RB ( fstatfs () +¤Î¾ì¹ç) +.I fd +¤ÏÍ­¸ú¤Ê¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EFAULT +.I buf +¤Þ¤¿¤Ï +.I path +¤¬ÉÔÀµ¤Ê¥¢¥É¥ì¥¹¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINTR +¤³¤Î¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¤ÇÃæÃǤµ¤ì¤¿¡£ +.TP +.B EIO +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ÎÆɤ߹þ¤ß¤Î´Ö¤Ë I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ELOOP +.RB ( statfs () +¤Î¾ì¹ç) +.I path +¤ò²ò·è¤¹¤ë¤Î¤Ëé¤ë¤Ù¤­¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.RB ( statfs () +¤Î¾ì¹ç) +.I path +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +.RB ( statfs () +¤Î¾ì¹ç) +.I path +¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOSYS +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬¤³¤Î¸Æ¤Ó½Ð¤·¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTDIR +.RB ( statfs () +¤Î¾ì¹ç) +.I path +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EOVERFLOW +Ãͤ¬Â礭²á¤®¤ë¤¿¤á¡¢ÊÖ¤êÃͤι½Â¤ÂΤÇɽ¸½¤Ç¤­¤Ê¤¤¡£ +.SH ½àµò +Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +Linux ¤Î +.BR statfs () +¤Ï 4.4BSD ¤Î¤â¤Î¤Ë±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£ +(¤·¤«¤·Æ±¤¸¹½Â¤ÂΤò»ÈÍѤ·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤) +.SH Ãí°Õ +¤³¤Î¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤¿¤á¡¢ +¥«¡¼¥Í¥ë¤Ë¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR statfs (), +.BR fstatfs (), +.BR statfs64 (), +.BR fstatfs64 () +¤¬¤¢¤ë¡£ + +\fI\fP ¤·¤«»ý¤¿¤Ê¤¤¥·¥¹¥Æ¥à¤â¤¢¤ê¡¢ +\fI\fP ¤â»ý¤Ã¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +Á°¼Ô¤Ï¸å¼Ô¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤Ç¡¢ +Á°¼Ô¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤¬Îɤ¤¤È¹Í¤¨¤é¤ì¤ë¡£ + +LSB ¤Ç¤Ï¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë +.BR statfs (), +.BR fstatfs () +¤òÈó¿ä¾©¤È¤·¤Æ¡¢Âå¤ï¤ê¤Ë +.BR statvfs (2), +.BR fstatvfs (2) +¤ò»È¤¦¤è¤¦¤Ë»Ø¼¨¤·¤Æ¤¤¤ë¡£ +.SS f_fsid ¥Õ¥£¡¼¥ë¥É +Solaris, Irix, POSIX ¤Ë¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR statvfs (2) +¤¬¤¢¤ê¡¢ +.I "struct statvfs" +¤òÊÖ¤¹ +.RI ( +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +¤³¤Î¹½Â¤ÂΤˤϡ¢ +.I "unsigned long" +.I f_fsid +¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +Linux, SunOS, HP-UX, 4.4BSD ¤Ë¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR statfs () +¤¬¤¢¤ê¡¢ +.I "struct statfs" +¤òÊÖ¤¹ +.RI ( +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +¤³¤Î¹½Â¤ÂÎ¤Ë¤Ï +.I fsid_t +.IR f_fsid , +¤¬´Þ¤Þ¤ì¤Æ¤ª¤ê¡¢ +.I fsid_t +¤Ï +.I "struct { int val[2]; }" +¤ÈÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +FreeBSD ¤Ç¤âƱ¤¸¤Ç¤¢¤ë¤¬¡¢¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ò»È¤¦¡£ + +.I f_fsid +¤Ï¤¢¤ë¥é¥ó¥À¥à¤ÊÃͤò»ý¤Á¡¢ +.RI ( f_fsid , ino ) +¤È¤¤¤¦ 1 ÁȤÎÃͤǥե¡¥¤¥ë¤ò°ì°Õ¤Ë·èÄê¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡¢ +¤È¤¤¤¦¤Î¤¬´ðËÜŪ¤Ê¹Í¤¨Êý¤Ç¤¢¤ë¡£ +¤¤¤¯¤Ä¤«¤Î OS ¤Ç¤Ï¡¢¥Ç¥Ð¥¤¥¹ÈÖ¹æ (¤ÎÊѼï) ¤ò»È¤Ã¤¿¤ê¡¢ +¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤È¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¥¿¥¤¥×¤òÁȤ߹ç¤ï¤»¤Æ»È¤Ã¤¿¤ê¤·¤Æ¤¤¤ë¡£ +OS ¤ÎÃæ¤Ë¤Ï +.I f_fsid +¥Õ¥£¡¼¥ë¥É¤Î¼èÆÀ¤ò¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Ë¸ÂÄꤷ¤Æ¤¤¤ë¤â¤Î¤â¤¢¤ë +(ÈóÆø¢¥æ¡¼¥¶¤¬¼èÆÀ¤¹¤ë¤È 0 ¤È¤Ê¤ë)¡£ +NFS ¤Ç¥¨¥¯¥¹¥Ý¡¼¥È¤µ¤ì¤ë¾ì¹ç¡¢ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤Ç»È¤ï¤ì¤Æ¤ª¤ê¡¢ +¤³¤ÎÃͤòÄ󶡤¹¤ë¤È¥»¥­¥å¥ê¥Æ¥£¾å¤ÎÌäÂ꤬¤¢¤ë¡£ +.LP +¤¤¤¯¤Ä¤«¤Î OS ¤Ç¤Ï¡¢ +.I fsid +¤ò +.BR sysfs () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÂè 2 °ú¤­¿ô¤È¤·¤Æ»ÈÍѤǤ­¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR stat (2), +.BR statvfs (2), +.BR path_resolution (7) diff --git a/release/man2/statvfs.2 b/release/man2/statvfs.2 new file mode 100644 index 00000000..d8e5133e --- /dev/null +++ b/release/man2/statvfs.2 @@ -0,0 +1,194 @@ +.\" Copyright (C) 2003 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. +.\" +.\" The pathconf note is from Walter Harms +.\" This is not a system call on Linux +.\" +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jun 29 23:36:41 JST 2004 +.\" by Yuichi SATO +.\" Updated & Modified Sun Jan 9 22:50:29 JST 2005 by Yuichi SATO +.\" +.TH STATVFS 2 2003-08-22 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +statvfs, fstatvfs \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÅý·×¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int statvfs(const char *" path ", struct statvfs *" buf ); +.br +.BI "int fstatvfs(int " fd ", struct statvfs *" buf ); +.SH ÀâÌÀ +´Ø¿ô +.BR statvfs () +¤Ï¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÊÖ¤¹¡£ +.I path +¤Ï¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÃæ¤ÎǤ°Õ¤Î¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤Ç¤¢¤ë¡£ +.I buf +¤Ï¡¢¤À¤¤¤¿¤¤°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +.I statvfs +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë: + +.in +4n +.nf +struct statvfs { + unsigned long f_bsize; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º */ + unsigned long f_frsize; /* ¥Õ¥é¥°¥á¥ó¥È¥µ¥¤¥º */ + fsblkcnt_t f_blocks; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥µ¥¤¥º (f_frsize ñ°Ì) */ + fsblkcnt_t f_bfree; /* ²òÊü¤µ¤ì¤Æ¤¤¤ë¥Ö¥í¥Ã¥¯¿ô */ + fsblkcnt_t f_bafvail; /* ÈóÆø¢¥æ¡¼¥¶ÍѤ˲òÊü¤µ¤ì¤Æ¤¤¤ë¥Ö¥í¥Ã¥¯¿ô */ + fsfilcnt_t f_files; /* inode ¿ô */ + fsfilcnt_t f_ffree; /* ²òÊü¤µ¤ì¤Æ¤¤¤ë inode ¤Î¿ô */ + fsfilcnt_t f_favail; /* ÈóÆø¢¥æ¡¼¥¶ÍѤ˲òÊü¤µ¤ì¤Æ¤¤¤ë inode ¤Î¿ô */ + unsigned long f_fsid; /* ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID */ + unsigned long f_flag; /* ¥Þ¥¦¥ó¥È¥Õ¥é¥° */ + unsigned long f_namemax; /* ¥Õ¥¡¥¤¥ë̾¤ÎŤµ¤ÎºÇÂçÃÍ */ +}; +.fi +.in + +¤³¤³¤Ç¡¢·¿ +.I fsblkcnt_t +¤È +.I fsfilcnt_t +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤«¤Ä¤Æ¡¢¤³¤ì¤é¤Ï¶¦¤Ë +.I "unsigned long" +¤Ç¤¢¤Ã¤¿¡£ + +¥Õ¥£¡¼¥ë¥É +.I f_flag +¤Ï (¥Þ¥¦¥ó¥È¥Õ¥é¥°¤Î) ¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë +(¥Þ¥¦¥ó¥È¥Õ¥é¥°¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR mount (8) +¤ò»²¾È¤¹¤ë¤³¤È)¡£ +POSIX ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Ó¥Ã¥È¤Ï°Ê²¼¤ÎÄ̤ê: +.TP +.B ST_RDONLY +Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¡£ +.TP +.B ST_NOSUID +.BR exec (3) +¤Ë̵»ë¤µ¤ì¤ë set-user-id/set-group-ID ¥Ó¥Ã¥È¡£ +.LP +ÊÖ¤µ¤ì¤¿¹½Â¤ÂΤÎÁ´¤Æ¤Î¥á¥ó¥Ð¤¬Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç +°ÕÌ£¤Î¤¢¤ëÃͤǤ¢¤ë¤«Èݤ«¤Ï¡¢»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.BR fstatvfs () +¤Ï¡¢¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡¢Æ±¤¸¾ðÊó¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.RB ( statvfs () +¤Î¾ì¹ç) +.I path +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Ë¸¡º÷µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EBADF +.RB ( fstatvfs () +¤Î¾ì¹ç) +.I fd +¤¬Í­¸ú¤Ê¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EFAULT +.I buf +¤Þ¤¿¤Ï +.I path +¤¬Ìµ¸ú¤Ê¥¢¥É¥ì¥¹¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINTR +¤³¤Î¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤ÆÃæÃǤµ¤ì¤¿¡£ +.TP +.B EIO +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤éÆɤ߽Ф·¤Æ¤¤¤ë´Ö¤Ë I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ELOOP +.RB ( statvfs () +¤Î¾ì¹ç) +.I path +¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.RB ( statvfs () +¤Î¾ì¹ç) +.I path +¤¬Ä¹¤¹¤®¤ë¡£ +.TP +.B ENOENT +.RB ( statvfs () +¤Î¾ì¹ç) +.I path +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +½½Ê¬¤Ê¥«¡¼¥Í¥ë¥á¥â¥ê¤¬»ÈÍѤǤ­¤Ê¤¤¡£ +.TP +.B ENOSYS +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¤³¤Î¸Æ¤Ó½Ð¤·¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTDIR +.RB ( statvfs () +¤Î¾ì¹ç) +.I path +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EOVERFLOW +¤¤¤¯¤Ä¤«¤ÎÃͤϡ¢ÊÖ¤µ¤ì¤ë¹½Â¤ÂΤÇɽ¸½¤¹¤ë¤Ë¤ÏÂ礭¤¹¤®¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +Linux ¥«¡¼¥Í¥ë¤Ë¤Ï¡¢¤³¤Î¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤¿¤á¤Ë¡¢ +.BR statfs (2), +.BR fstatfs (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤¢¤ë¡£ + +¸½ºß¤Î glibc ¤Î¼ÂÁõ¤Ë¤ª¤¤¤Æ¡¢ +.sp +.nf + pathconf(path, _PC_REC_XFER_ALIGN); + pathconf(path, _PC_ALLOC_SIZE_MIN); + pathconf(path, _PC_REC_MIN_XFER_SIZE); +.fi +.sp +¤Ï¡¢¤½¤ì¤¾¤ì +.I "statvfs(path,buf)" +¤ÎÊÖ¤êÃͤΠ+.IR f_frsize , +.IR f_frsize , +.I f_bsize +¥Õ¥£¡¼¥ë¥É¤ò»È¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR statfs (2) diff --git a/release/man2/stime.2 b/release/man2/stime.2 new file mode 100644 index 00000000..c0a6fd34 --- /dev/null +++ b/release/man2/stime.2 @@ -0,0 +1,85 @@ +.\" 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 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 ¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼ +.\" +.TH STIME 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +stime \- »þ´Ö¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int stime(time_t *" t ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR stime (): +_SVID_SOURCE +.SH ÀâÌÀ +.BR stime () +¤Ï¥·¥¹¥Æ¥à¤Î»þ¹ï¤ÈÆüÉÕ¤òÀßÄꤹ¤ë¡£ +\fIt\fP ¤¬»Ø¤¹»þ¹ï¤Ï¡¢»þ¹ïµª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) +¤«¤é¤ÎÉÿô¤Ç»ØÄꤹ¤ë¡£ +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤Î¤ß¤¬ +.BR stime () +¤ò¼Â¹Ô¤Ç¤­¤ë¡£ + +(ÌõÃí: Àµ³Î¤Ë¤Ï¥°¥ê¥Ë¥Ã¥¸Ê¿¶Ñ»þ(GMT)¤Ç¤Ï¤Ê¤¯¶¨ÄêÀ¤³¦»þ(UTC)¤¬»ÈÍѤµ¤ì¤ë) +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +¥æ¡¼¥¶¡¼¶õ´Ö¤«¤é¾ðÊó¤òÆÀ¤ë¤È¤­¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬½½Ê¬¤Ê¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +Linux ¤Ç¤Ï +.B CAP_SYS_TIME +¸¢¸Â¤¬É¬ÍפǤ¢¤ë¡£ +.SH ½àµò +SVr4. +.SH ´ØÏ¢¹àÌÜ +.BR date (1), +.BR settimeofday (2), +.BR capabilities (7) diff --git a/release/man2/swapon.2 b/release/man2/swapon.2 new file mode 100644 index 00000000..fff7602f --- /dev/null +++ b/release/man2/swapon.2 @@ -0,0 +1,192 @@ +.\" 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 2007-06-22 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +swapon, swapoff \- ¥Õ¥¡¥¤¥ë/¥Ç¥Ð¥¤¥¹¤Ø¤Î¥¹¥ï¥Ã¥×¤ò³«»Ï/Ää»ß¤¹¤ë +.SH ½ñ¼° +.B #include +.br +.B #include /* PAGE_SIZE ¤ò¸«¤Ä¤±¤ë¤¿¤á */ +.br +.B #include +.sp +.BI "int swapon(const char *" path ", int " swapflags ); +.br +.BI "int swapoff(const char *" path ); +.SH ÀâÌÀ +.BR swapon () +¤Ï +.I path +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ä¥Ö¥í¥Ã¥¯¡¦¥Ç¥Ð¥¤¥¹¤Ë¥¹¥ï¥Ã¥×Îΰè¤òÀßÄꤹ¤ë¡£ +.BR swapoff () +¤Ï +.I path +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ä¥Ö¥í¥Ã¥¯¡¦¥Ç¥Ð¥¤¥¹¤Ø¤Î¥¹¥ï¥Ã¥×¤òÄä»ß¤¹¤ë¡£ +.PP +.BR swapon () +¤Ï +.I swapflags +°ú¤­¿ô¤ò¼è¤ë¡£ +.I swapflags +¤Ë +.B SWAP_FLAG_PREFER +¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢¿·¤·¤¤¥¹¥ï¥Ã¥×Îΰè¤Ï¥Ç¥Õ¥©¥ë¥È¤è¤ê¤â¹â¤¤ +Í¥ÀèÅÙ¤ò»ý¤Ä¡£ +Í¥ÀèÅÙ¤Ï +.I swapflags +¤Ë°Ê²¼¤Î¤è¤¦¤Ë¥³¡¼¥É²½¤µ¤ì¤Æ¤¤¤ë¡£ +.br +.sp +.I " (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK" +.br +.PP +¤³¤ì¤é¤Î´Ø¿ô¤ÏÆø¢¥×¥í¥»¥¹ +.RB ( CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Î¤ß¤¬»ÈÍѤǤ­¤ë¡£ +.SS Í¥ÀèÅÙ +¤½¤ì¤¾¤ì¤Î¥¹¥ï¥Ã¥×Îΰè¤Ï¹â (high) ¤ÈÄã (low) ¤Î¤É¤Á¤é¤«¤ÎÍ¥ÀèÅÙ¤ò»ý¤Ä¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÍ¥ÀèÅÙ¤ÏÄã¤Ç¤¢¤ë¡£ +Ä㤤ͥÀèÅÙ¤ÎÎΰè¤Ë¤ª¤¤¤Æ¡¢¿·¤·¤¤Îΰè¤Ï¸Å¤¤Îΰè¤è¤ê¤µ¤é¤ËÄ㤤 +Í¥ÀèÅÙ¤ò»ý¤Ä¡£ +.PP +.I swapflags +¤¬ÀßÄꤵ¤ì¤¿¤â¤Î¤ÏÁ´¤Æ¹â¤¤Í¥ÀèÅ٤Ȥʤꡢ¥Ç¥Õ¥©¥ë¥È¤è¤ê¤â¹â¤¤Í¥ÀèÅÙ¤ò»ý¤Ä¡£ +»ÈÍѼԤϤ½¤ì¤é¤ËÉé¤Ç¤Ê¤¤Ãͤ¬»ØÄê¤Ç¤­¤ë¡£ +Â礭¤Ê¿ô»ú¤Ï¹â¤¤Í¥ÀèÅÙ¤ò°ÕÌ£¤¹¤ë¡£ +.PP +¹â¤¤Í¥ÀèÅÙ¤ÎÎΰ褫¤é½ç¤Ë¥¹¥ï¥Ã¥×¡¦¥Ú¡¼¥¸¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +¤è¤êÄ㤤ͥÀèÅÙ¤ÎÎΰè¤ò»ÈÍѤ¹¤ëÁ°¤Ë¤è¤ê¹â¤¤Í¥ÀèÅ٤Π+Îΰè¤ò»È¤¤Àڤ롣¤â¤·Æó¤Ä°Ê¾å¤ÎÎΰ褬Ʊ¤¸Í¥ÀèÅÙ¤ò»ý¤Á¡¢ +»È¤¨¤ëÃæ¤Ç°ìÈֹ⤤ͥÀèÅ٤Ǥ¢¤ì¤Ð¡¢¤½¤ì¤é¤Î¥Ú¡¼¥¸¤Ï´Ö¤Ç +¥é¥¦¥ó¥É¡¦¥í¥Ó¥óÊý¼°¤ÇÇÛʬ¤µ¤ì¤ë¡£ +.PP +Linux 1.3.6 ¤Ë¤ª¤¤¤Æ¡¢¥«¡¼¥Í¥ë¤ÏÄ̾ï¤Ï¤³¤ì¤é¤Îµ¬Â§¤Ë½¾¤Ã¤Æ¤¤¤ë¡£ +¤·¤«¤·Îã³°¤â¸ºß¤·¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBUSY +.RB ( swapon () +¤Ë¤ª¤¤¤Æ) »ØÄꤵ¤ì¤¿ +.I path +¤¬´û¤Ë¥¹¥ï¥Ã¥×Îΰè¤È¤·¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +¥Õ¥¡¥¤¥ë +.I path +¤Ï¸ºß¤¹¤ë¤¬¡¢Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤â¥Ö¥í¥Ã¥¯¡¦¥Ç¥Ð¥¤¥¹¤â»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¤Ï +.BR swapon () +¤Ë¤ª¤¤¤Æ¡¢»ØÄꤵ¤ì¤¿ path ¤Î¥Õ¥¡¥¤¥ë¤¬Í­¸ú¤Ê¥¹¥ï¥Ã¥×¤Î½ð̾ (signature) ¤ò +´Þ¤ó¤Ç¤¤¤Ê¤¤¤«¡¢tmpfs ¤Î¤è¤¦¤Ê¥¤¥ó¥á¥â¥ê (in-memory) ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +¾å¤Ë¤¢¤ë¡£ +¤Þ¤¿¤Ï +.BR swapoff () +¤Ë¤ª¤¤¤Æ¡¢ +.I path +¤¬¸½ºß¤Î¤È¤³¤í¥¹¥ï¥Ã¥×Îΰè¤Ç¤Ê¤¤¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥à¤ÎÀ©¸Â¤Ë㤷¤¿¡£ +.TP +.B ENOENT +¥Õ¥¡¥¤¥ë +.I path +¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +¥¹¥ï¥Ã¥×¤ò³«»Ï¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¡¼¤¬¥·¥¹¥Æ¥à¤Ë¤Ê¤¤¡£ +.TP +.B EPERM +»ÈÍѼԤ¬ +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +¤â¤·¤¯¤Ï¡¢ºÇÂç¿ô¤Î¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤¬¤¹¤Ç¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë +(²¼µ­¤Î¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È)¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +ÆóÈÖÌܤΠ+.I swapflags +°ú¤­¿ô¤Ï Linux 1.3.2 ¤«¤éƳÆþ¤µ¤ì¤¿¡£ +.SH Ãí°Õ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ä¥Ñ¥¹¤Ï +.BR mkswap (8) +¤Ë¤è¤Ã¤Æ½àÈ÷¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +»ÈÍѤǤ­¤ë¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤Î¿ô¤Ë¤Ï¾å¸Â¤¬¤¢¤ê¡¢¤½¤Î¾å¸Â¤Ï +¥«¡¼¥Í¥ëÄê¿ô +.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) +¤Î¥Ú¡¼¥¸¡¦¥Þ¥¤¥°¥ì¡¼¥·¥ç¥óµ¡Ç½ÍѤ˥¹¥ï¥Ã¥×¡¦¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¡¼¤¬ +Æó¤ÄͽÌ󤵤ì¤ë)¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mkswap (8), +.BR swapoff (8), +.BR swapon (8) diff --git a/release/man2/symlink.2 b/release/man2/symlink.2 new file mode 100644 index 00000000..d61e791a --- /dev/null +++ b/release/man2/symlink.2 @@ -0,0 +1,181 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Michael Haardt, Ian Jackson. +.\" +.\" 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 1996-04-26 by Nick Duffek +.\" Modified 1996-11-06 by Eric S. Raymond +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Fri Dec 12 00:32:12 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modifed Sat Feb 12 11:20:18 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: soft link ¥½¥Õ¥È¡¦¥ê¥ó¥¯ +.\"WORD: hard link ¥Ï¡¼¥É¡¦¥ê¥ó¥¯ +.\"WORD: dangling link ²õ¤ì¤¿¥ê¥ó¥¯ +.\"WORD: sticky bit ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È +.\"WORD: ownership ½êÍ­¸¢ +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: effective uid ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: entry ¥¨¥ó¥È¥ê +.\" +.TH SYMLINK 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +symlink \- ¥Õ¥¡¥¤¥ë¤Ë¿·¤·¤¤Ì¾Á°¤òÉÕ¤±¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int symlink(const char *" oldpath ", const char *" newpath ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR symlink (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _POSIX_C_SOURCE\ >=\ 200112L +.ad b +.SH ÀâÌÀ +.BR symlink () +¤Ï +.I oldpath +¤È¤¤¤¦Ê¸»úÎó¤ò¥Õ¥¡¥¤¥ë¤ÎÆâÍƤȤ·¤Æ»ý¤Ä +.I newpath +¤È¤¤¤¦¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ (symbolic link) ¤òºîÀ®¤¹¤ë¡£ + +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ï¼Â¹Ô»þ¤Ë²ò¼á¤µ¤ì¡¢ +¥ê¥ó¥¯¤ÎÆâÍƤǥѥ¹¤òÃÖ¤­´¹¤¨¤Æ¡¢¤½¤Î¥Ñ¥¹¤òé¤ë¤³¤È¤Ç¡¢ +¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤ËÅþ㤹¤ë¡£ + +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ï¥Ñ¥¹¤ÎÉôʬ¤Ë +.I .. +¤ò´Þ¤à¤«¤â¤·¤ì¤Ê¤¤¡£¤³¤ì¤Ï (¤â¤·¥ê¥ó¥¯¤ÎºÇ½é¤Ë»ÈÍѤµ¤ì¤¿¾ì¹ç¤Ï) ¥ê¥ó¥¯¤Î +¸ºß¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬»²¾È¤µ¤ì¤ë¡£ + +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ï (¥½¥Õ¥È¡¦¥ê¥ó¥¯ (soft link) ¤È¤â¸Æ¤Ð¤ì) +¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¤·¡¢ +¸ºß¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤; +¸å¼Ô¤Î¾ì¹ç¤Ï²õ¤ì¤¿¥ê¥ó¥¯ (dangling link) ¤È¤â¸Æ¤Ð¤ì¤ë¡£ + +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Îµö²Ä (permission) ¤Ï̵°ÕÌ£¤Ç¤¢¤ë; +¥ê¥ó¥¯¤òÄÉÀפ¹¤ë¾ì¹ç¤Ë¤Ï½êÍ­¸¢ (ownership) ¤Ï̵»ë¤µ¤ì¤ë¡£ +¤¿¤À¤·¡¢¥ê¥ó¥¯¤Îºï½ü¤ä̾Á°¤ÎÊѹ¹¤¬Í׵ᤵ¤ì¡¢¤«¤Ä¥ê¥ó¥¯¤¬Â¸ºß¤¹¤ë +¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È (sticky bit) +.RB ( S_ISVTX ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢½êÍ­¸¢¤Î¥Á¥§¥Ã¥¯¤¬¹Ô¤ï¤ì¤ë¡£ + +.I newpath +¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¾å½ñ¤­¤Ï\fB¤µ¤ì¤Ê¤¤\fR¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.I newpath +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î½ñ¤­¹þ¤ß¤¬µñÈݤµ¤ì¤¿¤«¡¢ +.I newpath +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EEXIST +.I newpath +¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤ë¡£ +.TP +.B EFAULT +.IR oldpath " ¤ä " newpath " ¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£" +.TP +.B EIO +I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ELOOP +.I newpath +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.IR oldpath " ¤Þ¤¿¤Ï " newpath " ¤¬Ä¹²á¤®¤ë¡£" +.TP +.B ENOENT +.I newpath +¤Ë´Þ¤Þ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢²õ¤ì¤¿¥ê¥ó¥¯¤Ç¤¢¤ë¤«¡¢ +.I oldpath +¤¬¶õʸ»úÎó¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +½½Ê¬¤Ê¥«¡¼¥Í¥ë (kernel) ¤Î¥á¥â¥ê¡¼¤¬¤Ê¤¤¡£ +.TP +.B ENOSPC +¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¥Ð¥¤¥¹¤Ë¿·¤·¤¤¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê +(directory entry) ¤òºîÀ®¤¹¤ë¤À¤±¤Î½½Ê¬¤ÊÍÆÎ̤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I newpath +¤Ë´Þ¤Þ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¡¢¼ÂºÝ¤Ë¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EPERM +.I newpath +¤ò´Þ¤ó¤Ç¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à (file system) ¤¬ +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ÎºîÀ®¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EROFS +.I newpath +¤¬Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Æ¤¤¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\" SVr4 ¤Ë¤Ï¾¤Ë EDQUOT, ENOSYS ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ +.\" .BR open (2) +.\" ¤ò¸«¤Æ¡¢Æ±¤¸Ì¾Á°¤Î½ÅÊ£¤È NFS ¤Ë¤Ä¤¤¤Æ»²¾È¤¹¤ë¤³¤È¡£ +.SH Ãí°Õ +.I oldpath +¤Ë¤Ä¤¤¤Æ¤Î¥Á¥§¥Ã¥¯¤Ï¹Ô¤Ê¤ï¤ì¤Ê¤¤¡£ + +symlink ¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤ë̾Á°¤òºï½ü¤¹¤ë¤È (¤½¤ì¤¬Â¾¤Ë¥Ï¡¼¥É¡¦¥ê¥ó¥¯ +(hard link) ¤ò»ý¤¿¤Ê¤±¤ì¤Ð) ¼ÂºÝ¤Ë¥Õ¥¡¥¤¥ë¤¬ºï½ü¤µ¤ì¤ë¡£ +¤³¤ÎÆ°ºî¤¬Ë¾¤ó¤À¤â¤Î¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢ +.BR link (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ln (1), +.BR lchown (2), +.BR link (2), +.BR lstat (2), +.BR open (2), +.BR readlink (2), +.BR rename (2), +.BR symlinkat (2), +.BR unlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/release/man2/symlinkat.2 b/release/man2/symlinkat.2 new file mode 100644 index 00000000..037875d6 --- /dev/null +++ b/release/man2/symlinkat.2 @@ -0,0 +1,122 @@ +.\" 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-08-29 by Yuichi SATO , LDP v2.39 +.\" +.TH SYMLINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +symlinkat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤˥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int symlinkat(const char *" oldpath ", int " newdirfd \ +", const char *" newpath ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR symlinkat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +.BR symlinkat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.BR symlink (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I newpath +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I newdirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( symlink (2) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I newpath +¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä +.I newdirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I newpath +¤Ï +.RB ( symlink (2) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I newpath +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I newdirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR symlinkat () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR symlink (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR symlinkat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR symlinkat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I newdirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I newpath +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I newdirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR symlinkat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2008. +.SH Ãí°Õ +.BR symlinkat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR openat (2), +.BR symlink (2), +.BR path_resolution (7), +.BR symlink (7) diff --git a/release/man2/sync.2 b/release/man2/sync.2 new file mode 100644 index 00000000..7e451783 --- /dev/null +++ b/release/man2/sync.2 @@ -0,0 +1,90 @@ +.\" 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 Sat Jul 24 12:02:47 1993 by Rik Faith +.\" Modified 15 Apr 1995 by Michael Chastain : +.\" Added reference to `bdflush(2)'. +.\" Modified 960414 by Andries Brouwer : +.\" Added the fact that since 1.3.20 sync actually waits. +.\" Modified Tue Oct 22 22:27:07 1996 by Eric S. Raymond +.\" Modified 2001-10-10 by aeb, following Michael Kerrisk. +.\" +.\" Japanese Version Copyright (c) 1997 Daisuke Sato +.\" all rights reserved. +.\" Translated Sat Apr 19 15:22:53 JST 1997 +.\" by Daisuke Sato +.\" Modified Sun Mar 21 17:23:38 JST 1999 +.\" by HANATAKA Shinya +.\" Updated Tue Oct 16 JST 2001 by Kentaro Shirakata +.\" Updated Mon Sep 8 JST 2003 by Kentaro Shirakata +.\" +.\"WORD: buffer cache ¥Ð¥Ã¥Õ¥¡¡¦¥­¥ã¥Ã¥·¥å +.\"WORD: buffers ¥Ð¥Ã¥Õ¥¡ +.\"WORD: data integrity ¥Ç¡¼¥¿¤Î´°Á´À­ +.\" +.TH SYNC 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sync \- ¥Ð¥Ã¥Õ¥¡¥­¥ã¥Ã¥·¥å¤ò¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤à +.SH ½ñ¼° +.B #include +.sp +.B void sync(void); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR sync (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.BR sync () +¤Ï¤Þ¤º inode ¤ò¥Ð¥Ã¥Õ¥¡¤Ø½ñ¤­¹þ¤ß¡¢ +¤½¤ì¤«¤é¥Ð¥Ã¥Õ¥¡(buffer)¤ò¥Ç¥£¥¹¥¯¤Ø½ñ¤­¹þ¤à¡£ +.SH ¥¨¥é¡¼ +¤³¤Î´Ø¿ô¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +¤µ¤Þ¤¶¤Þ¤Êɸ½àµ¬³Ê¤Ç¤Îµ¬Äê¤Ë¤·¤¿¤¬¤Ã¤Æ¡¢ +glibc 2.2.2 ¤«¤é Linux ¤Ç¤Î¥×¥í¥È¥¿¥¤¥×¤Ï¾å½Ò¤Î¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +libc4, libc5 ¤È¡¢2.2.1 ¤Þ¤Ç¤Î glibc ¤Ç¤Ï "int sync(void)" ¤Ç¡¢ +.BR sync () +¤Ï¾ï¤Ë 0 ¤òÊÖ¤·¤Æ¤¤¤¿¡£ +.SH ¥Ð¥° +ɸ½àµ¬³Ê (Î㤨¤Ð POSIX.1-2001) ¤Ë¤è¤ë¤È¡¢ +.BR sync () +¤Ï½ñ¤­¹þ¤à¤³¤È¤òͽÄê¤Ë +ÁȤ߹þ¤à¤Î¤ß¤Ç¼ÂºÝ¤Ë½ñ¤­¹þ¤ß¤¬½ªÎ»¤¹¤ëÁ°¤ËÌá¤Ã¤Æ¤â¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +°ìÊý¤Ç Linux ¤Ï¥Ð¡¼¥¸¥ç¥ó 1.3.20 ¤«¤é¤Ï½ñ¤­¹þ¤ß¤¬½ªÎ»¤¹¤ë¤Þ¤ÇÂԤġ£ +(ºÇ¶á¤Î¥Ç¥£¥¹¥¯¤ÏÂ礭¤Ê¥­¥ã¥Ã¥·¥å¤ò»ý¤Ã¤Æ¤¤¤ë¤¿¤á¡¢ + ¤³¤ì¤Ï¥Ç¡¼¥¿¤Î´°Á´À­ (data integrity) ¤Þ¤Ç¤ÏÊݾڤ·¤Æ¤¤¤Ê¤¤¡£) +.SH ´ØÏ¢¹àÌÜ +.BR bdflush (2), +.BR fdatasync (2), +.BR fsync (2), +.BR sync (8), +.BR update (8) diff --git a/release/man2/sync_file_range.2 b/release/man2/sync_file_range.2 new file mode 100644 index 00000000..7190a082 --- /dev/null +++ b/release/man2/sync_file_range.2 @@ -0,0 +1,190 @@ +.\" 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" +.SH ̾Á° +sync_file_range \- ¥Õ¥¡¥¤¥ë¥»¥°¥á¥ó¥È¤ò¥Ç¥£¥¹¥¯¤ÈƱ´ü¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "int sync_file_range(int " fd ", off64_t " offset ", off64_t " nbytes , +.BI " unsigned int " flags ); +.fi +.SH ÀâÌÀ +.BR sync_file_range () +¤ò»È¤¦¤È¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥Ç¥£¥¹¥¯¤È¤ÎƱ´ü¤Ë´Ø¤·¤Æ¡¢ +¤­¤áºÙ¤«¤ÊÀ©¸æ¤¬²Äǽ¤È¤Ê¤ë¡£ + +.I offset +¤Ï¡¢Æ±´ü¤ò¹Ô¤¦¥Õ¥¡¥¤¥ë¤ÎÎΰè¤Î³«»Ï¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +.I nbytes +¤Ë¤ÏƱ´ü¤ò¹Ô¤¦Îΰè¤ÎŤµ¤ò¥Ð¥¤¥Èñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.I nbytes +¤¬ 0 ¤Î¾ì¹ç¤Ï¡¢ +.I offset +¤«¤é¥Õ¥¡¥¤¥ëËöÈø¤Þ¤Ç¤ÎÁ´¥Ð¥¤¥È¤òƱ´ü¤¹¤ë¡£ +Ʊ´ü¤Ï¥·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤Îñ°Ì¤Ç¹Ô¤ï¤ì¤ë¡£ +.I offset +¤Ï¥Ú¡¼¥¸¶­³¦¤Ë¤¢¤ï¤»¤ÆÀڤ겼¤²¤é¤ì¡¢ +.I (offset+nbytes-1) +¤Ï¥Ú¡¼¥¸¶­³¦¤Ë¤¢¤ï¤»¤ÆÀÚ¤ê¾å¤²¤é¤ì¤ë¡£ + +¥Ó¥Ã¥È¥Þ¥¹¥¯°ú¤­¿ô +.I flags +¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë: +.TP +.B SYNC_FILE_RANGE_WAIT_BEFORE +²¿¤é¤«¤Î½ñ¤­¹þ¤ß¤ò¹Ô¤¦Á°¤Ë¡¢»ØÄꤵ¤ì¤¿Îΰè¤Î¥Ú¡¼¥¸¤Ç +½ñ¤­½Ð¤·¤ò¹Ô¤¦¤è¤¦¤Ë¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ë¤¹¤Ç¤ËÍ׵᤬ȯ¹Ô¤µ¤ì¤Æ¤¤¤ë +¥Ú¡¼¥¸¤Î½ñ¤­½Ð¤·¤¬Á´¤Æ´°Î»¤¹¤ë¤Î¤òÂԤġ£ +.TP +.B SYNC_FILE_RANGE_WRITE +»ØÄꤵ¤ì¤¿Îΰè¤Î¥Ú¡¼¥¸¤Ç¡¢½ñ¤­½Ð¤·Í׵᤬ȯ¹Ô¤µ¤ì¤Æ¤¤¤Ê¤¤ +Á´¤Æ¤Î dirty (¥­¥ã¥Ã¥·¥å¤À¤±¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤ë) ¥Ú¡¼¥¸¤Î +½ñ¤­½Ð¤·¤ò³«»Ï¤¹¤ë¡£ +¥ê¥¯¥¨¥¹¥È¥­¥å¡¼¤ÎÂ礭¤µ¤è¤ê¿¤¯½ñ¤­¹þ¤â¤¦¤È¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +¤³¤Î½èÍý¤ÏÄä»ß (block) ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.TP +.B SYNC_FILE_RANGE_WAIT_AFTER +²¿¤é¤«¤Î½ñ¤­¹þ¤ß¸å¤Ë¡¢»ØÄꤵ¤ì¤¿Îΰè¤ÎÁ´¤Æ¤Î¥Ú¡¼¥¸¤Î +½ñ¤­½Ð¤·¤¬¹Ô¤ï¤ì¤ë¤Î¤òÂԤġ£ +.PP +.I flags +¤Ë 0 ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢²¿¤â¤·¤Ê¤¤¤³¤È¤òɽ¤¹¡£ +.SS ·Ù¹ð +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÈó¾ï¤Ë´í¸±¤Ç¤¢¤ê¡¢ +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¤³¤ì¤é¤ÎÁàºî¤Ç¤Ï¤É¤ì¤â¥Õ¥¡¥¤¥ë¤Î¥á¥¿¥Ç¡¼¥¿¤Î½ñ¤­½Ð¤·¤ò¹Ô¤ï¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤è¤êºîÀ®ºÑ¤ß¤Î¥Ç¥£¥¹¥¯¥Ö¥í¥Ã¥¯¤Î +¾å½ñ¤­¤Î¼Â¹Ô¤¬³Î¼Â¤Ë¹Ô¤ï¤ì¤Ê¤¤¸Â¤ê¡¢¥¯¥é¥Ã¥·¥å¤Î¸å¤Ç¤â¥Ç¡¼¥¿¤¬ +ÍøÍѤǤ­¤ëÊݾڤϤʤ¤¡£ +½ñ¤­¹þ¤ß¤¬¾å½ñ¤­¤À¤±¤Ç¤¢¤ë¤«¤òÃΤ뤿¤á¤Î¥æ¡¼¥¶¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¸ºß¤·¤Ê¤¤¡£ +.RI ( btrfs +¤Ê¤É¤Î) copy-on-write Æ°ºî¤ò»È¤Ã¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +´û¸¤Î³ä¤êÅö¤ÆºÑ¤ß¤Î¥Ö¥í¥Ã¥¯¤ËÂФ¹¤ë¾å½ñ¤­¼«ÂΤ¬¤Ç¤­¤Ê¤¤¡£ +Á°¤â¤Ã¤Æ³ä¤êÅö¤Æ¤é¤ì¤¿Îΰè¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦¾ì¹ç¡¢ +¿¤¯¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï block allocator ¤Ø¤Î½ñ¤­¹þ¤ß¤âɬÍפȤʤ뤬¡¢ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï block allocator ¤Î¥Ç¥£¥¹¥¯¤Ø¤ÎƱ´ü¤ò¹Ô¤ï¤Ê¤¤¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ç¥£¥¹¥¯½ñ¤­¹þ¤ß¥­¥ã¥Ã¥·¥å¤Î¥Õ¥é¥Ã¥·¥å¤ò +¹Ô¤ï¤Ê¤¤¤Î¤Ç¡¢´øȯÀ­¤Î¥Ç¥£¥¹¥¯½ñ¤­¹þ¤ß¥­¥ã¥Ã¥·¥å¤ò»È¤Ã¤¿¥·¥¹¥Æ¥à¤Ç¤Ï +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤Ï¥Ç¡¼¥¿¤Î°ì´ÓÀ­¤ò³ÎÊݤǤ­¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£ +.SS ¾ÜºÙ +.B SYNC_FILE_RANGE_WAIT_BEFORE +¤È +.B SYNC_FILE_RANGE_WAIT_AFTER +¤Ï I/O ¥¨¥é¡¼¤ä +.B ENOSPC +¾õÂÖ¤ò¸¡½Ð¤·¡¢¸Æ¤Ó½Ð¤·¸µ¤Ë¤³¤ì¤é¤Î¾ðÊó¤òÊÖ¤¹¡£ + +.I flags +¤ÎÌò¤ËΩ¤Ä¥Ó¥Ã¥È¤ÎÁȤ߹ç¤ï¤»¤ò°Ê²¼¤Ë¼¨¤¹: +.TP +.B SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE +»ØÄꤵ¤ì¤¿ÈÏ°ÏÆâ¤Î¥Ú¡¼¥¸¤Ç¡¢ +.BR sync_file_range () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿ºÝ¤Ë dirty ¤Ç¤¢¤Ã¤¿Á´¤Æ¤Î¥Ú¡¼¥¸¤¬¡¢ +³Î¼Â¤Ë½ñ¤­½Ð¤·ÂоݤȤʤë¤è¤¦¤Ë¤¹¤ë¡£ +¤³¤ì¤Ï¡¢start-write-for-data-integrity Áàºî +(¥Ç¡¼¥¿´°Á´À­³ÎÊݤΤ¿¤á¤Î½ñ¤­¹þ¤ß³«»Ï¤ÎÁàºî) ¤Ç¤¢¤ë¡£ +.TP +.B SYNC_FILE_RANGE_WRITE +»ØÄꤵ¤ì¤¿ÈÏ°ÏÆâ¤Î¥Ú¡¼¥¸¤Ç¡¢¸½ºß½ñ¤­½Ð¤·Ãæ¤Ç¤Ê¤¤Á´¤Æ¤Î dirty ¥Ú¡¼¥¸¤Î +½ñ¤­½Ð¤·¤ò³«»Ï¤¹¤ë¡£¤³¤ì¤ÏÈóƱ´ü¤Î¥Ç¥£¥¹¥¯¤Ø¤Î¥Õ¥é¥Ã¥·¥å (flush-to-disk) +Áàºî¤Ç¤¢¤ë¡£¥Ç¡¼¥¿´°Á´À­³ÎÊݤ¬É¬ÍפÊÁàºî¤È¤·¤Æ¤ÏŬÀڤǤϤʤ¤¡£ +.TP +.BR SYNC_FILE_RANGE_WAIT_BEFORE " (or " SYNC_FILE_RANGE_WAIT_AFTER ) +»ØÄꤵ¤ì¤¿ÈÏ°ÏÆâ¤ÎÁ´¤Æ¤Î¥Ú¡¼¥¸¤Î½ñ¤­½Ð¤·¤Î´°Î»¤òÂԤġ£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢Á°¤Ë¹Ô¤ï¤ì¤¿Áàºî +.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 +¤³¤ì¤Ï write-for-data-integrity Áàºî +(¥Ç¡¼¥¿´°Á´À­³ÎÊݤΤ¿¤á¤Î½ñ¤­¹þ¤ß) ¤Ç¤¢¤ê¡¢»ØÄꤵ¤ì¤¿ÈÏ°ÏÆâ¤Î¡¢ +.BR sync_file_range () +¤¬¸Æ¤Ð¤ì¤¿»þÅÀ¤Ç dirty ¤ÊÁ´¤Æ¤Î¥Ú¡¼¥¸¤¬ +¥Ç¥£¥¹¥¯¤Ë³ÊǼ¤µ¤ì¤ë¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤Î¾ì¹ç¡¢ +.BR sync_file_range () +¤Ï 0 ¤òÊÖ¤¹¡£¼ºÇԤξì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I error +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINVAL +.I flags +¤ËÉÔÀµ¤Ê¥Ó¥Ã¥È¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¡£¤Þ¤¿¤Ï +.I offset +¤« +.I nbytes +¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EIO +I/O ¥¨¥é¡¼¡£ +.TP +.B ENOMEM +¥á¥â¥êÉÔ­¤Ç¤¢¤ë¡£ +.TP +.B ENOSPC +¥Ç¥£¥¹¥¯ÎΰèÉÔ­¤Ç¤¢¤ë¡£ +.TP +.B ESPIPE +.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 ¥Ð¡¼¥¸¥ç¥ó +.BR sync_file_range () +¤Ï¥«¡¼¥Í¥ë 2.6.17 ¤Ç Linux ¤ËÅо줷¤¿¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ê¡¢ +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤòÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fdatasync (2), +.BR fsync (2), +.BR msync (2), +.BR sync (2), +.BR feature_test_macros (7) diff --git a/release/man2/syscall.2 b/release/man2/syscall.2 new file mode 100644 index 00000000..a63ed0f5 --- /dev/null +++ b/release/man2/syscall.2 @@ -0,0 +1,90 @@ +.\" Copyright (c) 1980, 1991, 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. +.\" +.\" @(#)syscall.2 8.1 (Berkeley) 6/16/93 +.\" +.\" +.\" 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" +.SH ̾Á° +syscall \- ´ÖÀÜ¥·¥¹¥Æ¥à¥³¡¼¥ë +.SH ½ñ¼° +.nf +.BR "#define _GNU_SOURCE " " /* or _BSD_SOURCE or _SVID_SOURCE */" +.B #include +.BR "#include " "/* For SYS_xxx definitions */" + +.BI "int syscall(int " number ", ...);" +.fi +.SH ÀâÌÀ +.BR syscall () +¤Ï +.I number +¤Ç»ØÄꤵ¤ì¤¿¥¢¥»¥ó¥Ö¥ê¸À¸ì¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¡¢ +»ØÄꤵ¤ì¤¿°ú¤­¿ô¤ò¤Ä¤±¤Æ¼Â¹Ô¤¹¤ë¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥·¥ó¥Ü¥ëÄê¿ô¤Ï¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.I +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +ÊÖ¤êÃͤϸƤӽФµ¤ì¤¿¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤è¤Ã¤ÆÄêµÁ¤µ¤ì¤ë¡£ +°ìÈ̤ˡ¢ÊÖ¤êÃÍ 0 ¤ÏÀ®¸ù¤òɽ¤¹¡£ +\-1 ¤Ï¥¨¥é¡¼¤òɽ¤·¡¢¥¨¥é¡¼¥³¡¼¥É¤Ï +.I errno +¤ËÆþ¤ì¤é¤ì¤ë¡£ +.SH Ãí°Õ +.BR syscall () +¤Ï 4BSD ¤ÇºÇ½é¤ËÅо줷¤¿¡£ +.SH Îã +.nf +#define _GNU_SOURCE +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + pid_t tid; + + tid = syscall(SYS_gettid); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR _syscall (2), +.BR intro (2), +.BR syscalls (2) diff --git a/release/man2/syscalls.2 b/release/man2/syscalls.2 new file mode 100644 index 00000000..0253e624 --- /dev/null +++ b/release/man2/syscalls.2 @@ -0,0 +1,801 @@ +.\" 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 2009-05-06 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +syscalls \- Linux ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë +.SH ½ñ¼° +Linux ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¡£ +.SH ÀâÌÀ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È Linux ¥«¡¼¥Í¥ë¤È¤Î´Ö¤Î +´ðËÜŪ¤Ê¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +.SS ¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¥é¥¤¥Ö¥é¥ê¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï°ìÈ̤ˤÏľÀܵ¯Æ°¤µ¤ì¤º¡¢ +glibc (¤ä¾¤Î²¿¤é¤«¤Î¥é¥¤¥Ö¥é¥ê) ·Ðͳ¤Çµ¯Æ°¤µ¤ì¤ë¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎľÀܵ¯Æ°¤Ë¤Ä¤¤¤Æ¤Ï¡¢¾ÜºÙ¤Ï +.BR intro (2) +¤ò»²¾È¤Î¤³¤È¡£ +¤¤¤Ä¤â¤È¤¤¤¦Ìõ¤Ç¤Ï¤Ê¤¤¤¬¡¢ÉáÄ̤ϡ¢¥é¥Ã¥Ñ¡¼´Ø¿ô¤Î̾Á°¤Ï¤½¤Î´Ø¿ô¤¬µ¯Æ°¤¹¤ë +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î̾Á°¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢glibc ¤Ë¤Ï +.BR truncate () +¤È¤¤¤¦´Ø¿ô¤¬¤¢¤ê¡¢¤³¤Î´Ø¿ô¤Ï "truncate" ¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤¹¤ë¡£ + +¤¿¤¤¤Æ¤¤¤Î¾ì¹ç¡¢glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¤«¤Ê¤ê´Êñ¤Ê¤â¤Î¤Ç¡¢ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤¹¤ëÁ°¤Ë°ú¤­¿ô¤òŬÀڤʥ쥸¥¹¥¿¤Ë¥³¥Ô¡¼¤·¡¢ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Ê֤俸å¤Ï +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë°Ê³°¤Ï¡¢¤Û¤È¤ó¤É½èÍý¤ò¹Ô¤ï¤Ê¤¤ +(¤³¤ì¤é¤Ï¡¢¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬Ä󶡤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤¹¤ë¤Î¤Ë»ÈÍѤ¹¤ë +.BR syscall (2) +¤Ë¤è¤ê¼Â¹Ô¤µ¤ì¤ë½èÍý¤ÈƱ¤¸¤Ç¤¢¤ë)¡£ +[Ãí°Õ] ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ºÇÔ¤ò¼¨¤¹¤Î¤ËÉé¤Î¥¨¥é¡¼ÈÖ¹æ¤ò¸Æ¤Ó½Ð¤·¸µ¤ËÊÖ¤¹¡£ +¼ºÇÔ¤¬µ¯¤³¤Ã¤¿ºÝ¤Ë¤Ï¡¢¥é¥Ã¥Ñ¡¼´Ø¿ô¤ÏÊÖ¤µ¤ì¤¿¥¨¥é¡¼ÈÖ¹æ¤òȿž¤·¤Æ +(Àµ¤ÎÃͤËÊÑ´¹¤·)¡¢¤½¤ì¤ò +.I errno +¤Ë¥³¥Ô¡¼¤·¡¢¥é¥Ã¥Ñ¡¼´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¸µ¤Ë \-1 ¤òÊÖ¤¹¡£ + +¤·¤«¤·¤Ê¤¬¤é¡¢»þ¤Ë¤Ï¡¢¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤¹¤ëÁ°¤Ë +²¿¤é¤«¤ÎÄɲäνèÍý¤ò¹Ô¤¦¾ì¹ç¤¬¤¢¤ë¡£ +Î㤨¤Ð¡¢¸½ºß¡¢ +Æó¤Ä¤Î´ØÏ¢¤¹¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR truncate (2) +¤È +.BR truncate64 (2) +¤¬¤¢¤ê¡¢glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô +.BR truncate () +¤Ï¡¢¥«¡¼¥Í¥ë¤¬¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¤¦¤Á¤É¤Á¤é¤òÄ󶡤·¤Æ¤¤¤ë¤«¤ò¥Á¥§¥Ã¥¯¤·¡¢ +¤É¤Á¤é¤òºÎÍѤ¹¤ë¤«¤ò·èÄꤹ¤ë¡£ +.SS ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥ê¥¹¥È +°Ê²¼¤Ï¡¢¤Û¤È¤ó¤É¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ë¶¦Ä̤¹¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥ê¥¹¥È¤Ç¤¢¤ë¡£ +¤³¤Î¥ê¥¹¥È¤Ç¡¢ +.I Kernel +¤ÎÎó¤Ï¡¢Linux 2.2 °Ê¹ß¤ÇÅо줷¤¿¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ +Åо줷¤¿¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤ò¼¨¤¹¡£ +°Ê²¼¤Ë¾ÜºÙ¤ÊÀâÌÀ¤òµ­¤¹¡£ +.IP * 3 +¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤¬¤Ê¤¤¾ì¹ç¡¢¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +¥«¡¼¥Í¥ë 1.0 ¤â¤·¤¯¤Ï¤½¤ì°ÊÁ°¤ËÅо줷¤¿¡£ +.IP * +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë "1.2" ¤È½ñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤ª¤½¤é¤¯¥Ð¡¼¥¸¥ç¥ó 1.1.x ¤Î¥«¡¼¥Í¥ë¤ÇÅо줷¡¢ +°ÂÄêÈǤΥ«¡¼¥Í¥ë¤Ç¤Ï 1.2 ¤Ç½é¤á¤ÆÅо줷¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +(¥Ð¡¼¥¸¥ç¥ó 1.2 ¤Î¥«¡¼¥Í¥ë¤Ï¡¢¥«¡¼¥Í¥ë 1.0.6 ¤«¤éʬ´ô¤·¡¢ +¥Ð¡¼¥¸¥ç¥ó 1.1.x ¤ÎÉÔ°ÂÄêÈǤΥ«¡¼¥Í¥ë·ÏÎó¤È¤·¤Æ³«È¯¤µ¤ì¤¿¡£) +.IP * +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë "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 * +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë "2.2" ¤È½ñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤ª¤½¤é¤¯¥Ð¡¼¥¸¥ç¥ó 2.1.x ¤Î¥«¡¼¥Í¥ë¤ÇÅо줷¡¢ +°ÂÄêÈǤΥ«¡¼¥Í¥ë¤Ç¤Ï 2.2.0 ¤Ç½é¤á¤ÆÅо줷¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +(¥Ð¡¼¥¸¥ç¥ó 2.2 ¤Î¥«¡¼¥Í¥ë¤Ï¡¢¥«¡¼¥Í¥ë 2.0.21 ¤«¤éʬ´ô¤·¡¢ +¥Ð¡¼¥¸¥ç¥ó 2.1.x ¤ÎÉÔ°ÂÄêÈǤΥ«¡¼¥Í¥ë·ÏÎó¤È¤·¤Æ³«È¯¤µ¤ì¤¿¡£) +.IP * +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë "2.4" ¤È½ñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤ª¤½¤é¤¯¥Ð¡¼¥¸¥ç¥ó 2.3.x ¤Î¥«¡¼¥Í¥ë¤ÇÅо줷¡¢ +°ÂÄêÈǤΥ«¡¼¥Í¥ë¤Ç¤Ï 2.4.0 ¤Ç½é¤á¤ÆÅо줷¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +(¥Ð¡¼¥¸¥ç¥ó 2.4 ¤Î¥«¡¼¥Í¥ë¤Ï¡¢¥«¡¼¥Í¥ë 2.2.8 ¤«¤éʬ´ô¤·¡¢ +¥Ð¡¼¥¸¥ç¥ó 2.3.x ¤ÎÉÔ°ÂÄêÈǤΥ«¡¼¥Í¥ë·ÏÎó¤È¤·¤Æ³«È¯¤µ¤ì¤¿¡£) +.IP * +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë "2.6" ¤È½ñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤ª¤½¤é¤¯¥Ð¡¼¥¸¥ç¥ó 2.5.x ¤Î¥«¡¼¥Í¥ë¤ÇÅо줷¡¢ +°ÂÄêÈǤΥ«¡¼¥Í¥ë¤Ç¤Ï 2.6.0 ¤Ç½é¤á¤ÆÅо줷¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +(¥Ð¡¼¥¸¥ç¥ó 2.6 ¤Î¥«¡¼¥Í¥ë¤Ï¡¢¥«¡¼¥Í¥ë 2.4.15 ¤«¤éʬ´ô¤·¡¢ +¥Ð¡¼¥¸¥ç¥ó 2.5.x ¤ÎÉÔ°ÂÄêÈǤΥ«¡¼¥Í¥ë·ÏÎó¤È¤·¤Æ³«È¯¤µ¤ì¤¿¡£) +.IP * +¥«¡¼¥Í¥ë 2.6.0 ¤«¤é³«È¯¥â¥Ç¥ë¤ÏÊѹ¹¤µ¤ì¡¢ +¿·¤·¤¤¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¸Ä¡¹¤Î 2.6.x ¤Î¥ê¥ê¡¼¥¹¤Ç¤âÅо줹¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +¤³¤Î¾ì¹ç¡¢¥ê¥¹¥È¤Ç¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Åо줷¤¿ +¸·Ì©¤Ê¥Ð¡¼¥¸¥ç¥óÈֹ椬µ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.IP * +Á°¤Î°ÂÄêÈÇ¥«¡¼¥Í¥ë·ÏÎ󤫤éʬ´ô¤·¤¿¸å¤Ë°ÂÄêÈÇ¥«¡¼¥Í¥ë·ÏÎó¤Ë¥·¥¹¥Æ¥à¥³¡¼¥ë +¤¬Äɲ䵤줿¾ì¹ç¡¢°ÊÁ°¤Î°ÂÄêÈÇ¥«¡¼¥Í¥ë·ÏÎó¤Ë¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ +°Ü¿¢ (backport) ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +Î㤨¤Ð¡¢2.6.x ¤ÇÅо줷¤¿¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¤¤¤¯¤Ä¤«¤Ï¡¢ +2.4.15 °Ê¹ß¤Î 2.4.x ¥ê¥ê¡¼¥¹¤Ë¤â backport ¤µ¤ì¤¿¡£ +¤³¤Î¾ì¹ç¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Åо줷¤¿¥Ð¡¼¥¸¥ç¥ó¤È¤·¤Æ¡¢ +ξÊý¤Î°ÂÄêÈÇ·ÏÎó¤Î¥Ð¡¼¥¸¥ç¥ó¤¬µ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +¥«¡¼¥Í¥ë 2.6.28 ¤ÇÍøÍѲÄǽ¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥ê¥¹¥È¤ò°Ê²¼¤Ë¼¨¤¹ +(¤½¤ì°ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤À¤±ÍøÍѲÄǽ¤Ê¤â¤Î¤â¾¯¿ô¤À¤¬´Þ¤Þ¤ì¤ë): +.\" +.\" 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.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 +\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 +\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) +\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 +\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 +\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 +.\" \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.6 +\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 +i386 ¤ò´Þ¤à¿¤¯¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤Ï¡¢¥½¥±¥Ã¥È´ØÏ¢¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +(glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤ò²ð¤·¤Æ¤À¤¬) ¤¹¤Ù¤Æ +.BR socketcall (2) +·Ðͳ¤Ë¿½Å¤µ¤ì¤Æ¤¤¤ë¡£ +ƱÍͤˡ¢System V IPC ´ØÏ¢¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.BR ipc (2) +·Ðͳ¤Ë¿½Å¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +°Ê²¼¤ÎÅÀ¤Ëα°Õ¤¹¤ë¤³¤È: +.IP * 3 +°Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +¥·¥¹¥Æ¥à¥³¡¼¥ë¡¦¥Æ¡¼¥Ö¥ë¤Ë¥¹¥í¥Ã¥È¤¬Í½Ì󤵤ì¤Æ¤¤¤ë¤¬¡¢ +ɸ½à¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤: +.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 +.BR vserver (2) \" __NR_vserver is 273 on Linux 2.6.22/i386 +.RB ( unimplemented (2) +¤â»²¾È)¡£ +¤·¤«¤·¡¢ +.BR ftime (3), +.BR profil (3), +.BR ulimit (3) +¤Ï¥é¥¤¥Ö¥é¥ê¡¦¥ë¡¼¥Á¥ó¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.BR phys (2) +ÍѤξì½ê¤Ï 2.1.116 °Ê¹ß¤Ç¤Ï +.BR umount (2) +ÍѤ˻ÈÍѤµ¤ì¤Æ¤¤¤ë; +¾­Íè¤Ë¤ª¤¤¤Æ¤â +.BR phys (2) +¤Ï¼ÂÁõ¤µ¤ì¤Ê¤¤¡£ +.IP * +.BR getpmsg (2) +¤È +.BR putpmsg (2) +¤Ï¡¢¥¹¥È¥ê¡¼¥àÂбþ¤Î¥Ñ¥Ã¥Á¤¬Åö¤Æ¤é¤ì¤¿¥«¡¼¥Í¥ëÍѤΤâ¤Î¤Ç¡¢ +ɸ½à¤Î¥«¡¼¥Í¥ë¤Ë¸ºß¤¹¤ë¤³¤È¤Ïº£¸å¤â¤Ê¤¤¡£ +.\" The security call is for future use. +.PP +¤¿¤¤¤Æ¤¤¤Ï¡¢ +.I /usr/include/asm/unistd.h +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÈÖ¹æ __NR_xxx ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥³¡¼¥É¤Ï¡¢ +¥«¡¼¥Í¥ë¡¦¥½¡¼¥¹¤Î +.IR sys_xxx () +¤È¤¤¤¦¥ë¡¼¥Á¥ó¤Ë½ñ¤«¤ì¤Æ¤¤¤ë +(i386 ¤Ë¤ª¤±¤ë¼Â¹Ô¥Æ¡¼¥Ö¥ë¤Ï +.I /usr/src/linux/arch/i386/kernel/entry.S +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë)¡£ +¤·¤«¤·¤³¤ì¤Ë¤Ï¿¤¯¤ÎÎã³°¤¬¤¢¤ë¡£¸Å¤¤¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¿·ÈǤËÃÖ¤­´¹¤¨¤é¤ì¤Æ +¤­¤¿¤¬¡¢¤³¤ÎÃÖ¤­´¹¤¨¤Ï¤¢¤Þ¤êÂηÏΩ¤Æ¤Æ¹Ô¤ï¤ì¤ÆÍè¤Ê¤«¤Ã¤¿¤«¤é¤Ç¤¢¤ë¡£ +parisc, sparc, sparc64, alpha ¤È¤¤¤Ã¤¿¥×¥í¥×¥ê¥¨¥¿¥ê OS ¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó +µ¡Ç½¤¬¤¢¤ë¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤Ï¡¢Â¿¤¯¤ÎÄɲå·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤¢¤ë¡£ +mips64 ¤Ë¤Ï¡¢32 ¥Ó¥Ã¥È¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥Õ¥ë¥»¥Ã¥È¤â´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ + +»þ´Ö¤Î·Ð²á¤È¤È¤â¤Ë¡¢¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤Ï¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î +Êѹ¹¤¬É¬ÍפˤʤäƤ­¤¿¡£ +¤³¤¦¤·¤¿Êѹ¹¤ÎÍýͳ¤Î°ì¤Ä¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤµ¤ì¤ë¹½Â¤ÂΤ䥹¥«¥é¡¼ÃÍ +¤Î¥µ¥¤¥º¤òÁý¤ä¤¹É¬Íפ¬¤¢¤ë¤³¤È¤À¤Ã¤¿¡£ +¤³¤ì¤é¤ÎÊѹ¹¤Î·ë²Ì¡¢¸½ºß¤Ç¤Ï¡¢Æ±ÍͤνèÍý¤ò¼Â¹Ô¤¹¤ë¤¬ +°ú¤­¿ô¤Î¥µ¥¤¥º¤Ê¤É¤Î¾ÜºÙ¤Ï°Û¤Ê¤ë¡¢°ìÏ¢¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë·²¤¬ +¤¤¤¯¤Ä¤«Â¸ºß¤¹¤ë +(Î㤨¤Ð¡¢ +.BR truncate (2) +¤È +.BR truncate64 (2))¡£ +(¤¹¤Ç¤Ë½Ò¤Ù¤¿¤è¤¦¤Ë¡¢ +°ìÈ̤ˤϥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¤³¤Î¤³¤È¤ò°Õ¼±¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬¡¢Å¬Àڤʥ·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤·¡¢¸Å¤¤¥Ð¥¤¥Ê¥ê¤Ë +ÂФ·¤Æ ABI ¥ì¥Ù¥ë¤Ç¤Î¸ß´¹À­¤òÊÝ»ý¤¹¤ë¤³¤È¤òÊݾڤ¹¤ë½èÍý¤ò¹Ô¤Ã¤Æ¤¤¤ë¡£) +Ê£¿ô¤Î¥Ð¡¼¥¸¥ç¥ó¤¬Â¸ºß¤¹¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÎã¤ò°Ê²¼¤Ëµó¤²¤ë¡£ +.IP * 3 +¤³¤ì¤Þ¤Ç¤Ë¡¢ +.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 +.BR lstat (2) +¤È +.BR fstat (2) +¤Ë¤Ä¤¤¤Æ¤âƱÍͤǤ¢¤ë¡£ +.IP * +¤Þ¤¿¡¢ +.IR __NR_oldolduname , +.IR __NR_olduname , +.I __NR_uname +¤È¤¤¤¦ÄêµÁ¤Ï¡¢¤½¤ì¤¾¤ì +.IR sys_olduname (), +.IR sys_uname (), +.IR sys_newuname () +¤È¤¤¤¦¥ë¡¼¥Á¥ó¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.IP * +Linux 2.0 ¤Ç¤Ï¡¢ +.BR vm86 (2) +¤Î¿·¥Ð¡¼¥¸¥ç¥ó¤¬Åо줷¤¿¡£¥«¡¼¥Í¥ë¥ë¡¼¥Á¥ó¤Î +¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¡¢¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Ï¤½¤ì¤¾¤ì +.IR sys_vm86old (), +.IR sys_vm86 () +¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤ë¡£ +.IP * +Linux 2.4 ¤Ç¤Ï¡¢ +.BR getrlimit (2) +¤Î¿·¥Ð¡¼¥¸¥ç¥ó¤¬Åо줷¤¿¡£¥«¡¼¥Í¥ë¥ë¡¼¥Á¥ó¤Î +¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¡¢¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Ï¤½¤ì¤¾¤ì +.IR sys_old_getrlimit () +(¥¹¥í¥Ã¥È¤Ï +.IR __NR_getrlimit ), +.IR sys_getrlimit () +(¥¹¥í¥Ã¥È¤Ï +.IR __NR_ugetrlimit ) +¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤ë¡£ +.IP * +Linux 2.4 ¤Ç¡¢¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥× ID ¤Î¥µ¥¤¥º¤¬ +16 ¥Ó¥Ã¥È¤«¤é 32 ¥Ó¥Ã¥È¤ËÁý¤¨¤¿¡£ +.\" 64 bit off_t changes: ftruncate64, *stat64, +.\" fcntl64 (because of the flock structure), getdents64, *statfs64 +¤³¤ÎÊѹ¹¤ËÂбþ¤¹¤ë¤¿¤á¡¢¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Äɲ䵤줿 +.RB ( chown32 (2), +.BR getuid32 (2), +.BR getgroups32 (2), +.BR setresuid32 (2) +¤Ê¤É)¡£ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¡¢ËöÈø¤Î "32" ¤¬ÉÕ¤«¤Ê¤¤Æ±Ì¾¤Î +¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤ËÂå¤ï¤Ã¤Æ»È¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +.IP * +Linux 2.4 ¤Ç¤Ï¡¢32 ¥Ó¥Ã¥È¡¦¥¢¡¼¥­¥Æ¥¯¥Á¥ã¾å¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ +Â礭¤Ê¥Õ¥¡¥¤¥ë (¤Ä¤Þ¤ê¡¢32 ¥Ó¥Ã¥È¤Ç¤Ïɽ¸½¤Ç¤­¤Ê¤¤¥µ¥¤¥º¤ä +¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤¬É¬Íפʥե¡¥¤¥ë) ¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +¤³¤ÎÊѹ¹¤ËÂбþ¤¹¤ë¤¿¤á¡¢¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤È¥µ¥¤¥º¤ò°·¤¦ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÃÖ¤­´¹¤¨¤¬É¬ÍפȤʤä¿¡£¤½¤Î·ë²Ì¡¢ +.BR fcntl64 (2), +.BR ftruncate64 (2), +.BR getdents64 (2), +.BR stat64 (2), +.BR statfs64 (2) +¤È¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ä¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ÇƱ¤¸µ¡Ç½¤ò»ý¤Ä +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Äɲ䵤줿¡£ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¡¢ËöÈø¤Î "64" ¤¬ÉÕ¤«¤Ê¤¤Æ±Ì¾¤Î +¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤ËÂå¤ï¤Ã¤Æ»È¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +⤷¡¢"stat" ·Ï¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤½¤Î¸Â¤ê¤Ç¤Ï¤Ê¤¤¡£ + +64-bit ¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹¤È 32-bit UID ¤Î¤ß¤ò»ý¤Ä +¿·¤·¤¤¥×¥é¥Ã¥È¥Õ¥©¡¼¥à (alpha, ia64, s390x ¤Ê¤É) ¤Ç¤Ï¡¢ +*64 ¤ä *32 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤Ê¤¤¡£ +*64 ¤ä *32 ¤È¤¤¤¦¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¾ì¹ç¡¢ +*64 ¤ä *32 ¤¬¤Ä¤¤¤Æ¤¤¤Ê¤¤¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÇѻ߰·¤¤¤Ç¤¢¤ë¡£ +.IP * +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë +.RB ( signal (7) +»²¾È) ¤Ø¤ÎÂбþ¤òÄɲ乤뤿¤á¤Ë¡¢ +.I rt_sig* +·Ï¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¥«¡¼¥Í¥ë 2.2 ¤ÇÄɲ䵤줿¡£ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¡¢ÀèƬ¤Ë "rt_" ¤¬ÉÕ¤«¤Ê¤¤Æ±Ì¾¤Î +¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤ËÂå¤ï¤Ã¤Æ»È¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +.IP * +.BR select (2) +¤È +.BR mmap (2) +¤Ï 5¤Ä¤â¤·¤¯¤Ï¤½¤ì°Ê¾å¤Î°ú¤­¿ô¤ò»ÈÍѤ·¤Æ¤ª¤ê¡¢ +i386 ¤Ç¤Ï°ú¤­¿ô¤Î¼õ¤±ÅϤ·¤ËÌäÂ꤬À¸¤¸¤ë¡£ +¤½¤Î¤¿¤á¡¢Â¾¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï +.I __NR_select +¤È +.I __NR_mmap +¤ËÂбþ¤¹¤ë +.IR sys_select () +¤È +.IR sys_mmap () +¤¬Â¸ºß¤¹¤ë¤¬¡¢i386 ¤Ç¤ÏÂå¤ï¤ê¤Ë +.IR old_select () +¤È +.IR old_mmap () +¤È¤¤¤¦¥ë¡¼¥Á¥ó¤¬¤¢¤ë +(¤³¤ì¤é¤Î¥ë¡¼¥Á¥ó¤Ï°ú¤­¿ô¥Ö¥í¥Ã¥¯¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò»ÈÍѤ¹¤ë)¡£ +¸½ºß¤Ç¤Ï 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. +.SH ´ØÏ¢¹àÌÜ +.BR syscall (2), +.BR unimplemented (2), +.BR libc (7) diff --git a/release/man2/sysctl.2 b/release/man2/sysctl.2 new file mode 100644 index 00000000..2dc0d88c --- /dev/null +++ b/release/man2/sysctl.2 @@ -0,0 +1,179 @@ +.\" Copyright (C) 1996 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 April 1996 by Andries Brouwer +.\" 960412: Added comments from Stephen Tweedie +.\" 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 ¥Ä¥ê¡¼ +.\" +.TH SYSCTL 2 2008-11-20 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sysctl \- ¥·¥¹¥Æ¥à¡¦¥Ñ¥é¥á¡¼¥¿¡¼¤òÆɤ߽ñ¤­¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "int _sysctl(struct __sysctl_args *" args ); +.fi +.SH ÀâÌÀ +.B ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ÈÍѤ·¤Ê¤¤¤³¤È! +¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¡£ + +.BR _sysctl () +¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë¥Ñ¥é¥á¡¼¥¿¡¼¤òÆɤ߽ñ¤­¤¹¤ë¡£Î㤨¤Ð¡¢ +¥Û¥¹¥È¥Í¡¼¥à¤äƱ»þ¤Ë¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤ÎºÇÂç¿ô¤Ê¤É¡£ +°ú¤­¿ô¤Ï°Ê²¼¤Î·Á¼°¤Ç¤¢¤ë¡£ +.PP +.in +4n +.nf +struct __sysctl_args { + int *name; /* integer vector describing variable */ + int nlen; /* length of this vector */ + void *oldval; /* 0 or address where to store old value */ + size_t *oldlenp; /* available room for old value, + overwritten by actual size of old value */ + void *newval; /* 0 or address of new value */ + size_t newlen; /* size of new value */ +}; +.fi +.in +.PP +¤³¤Î¥³¡¼¥ë¤Ï +.I /proc/sys +¤Î²¼¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¦¥Ä¥ê¡¼¤Ë»÷¤¿ÌÚ¹½Â¤(tree structure)¤ò¸¡º÷¤¹¤ë¡£ +¤½¤·¤Æ¡¢Í׵ᤵ¤ì¤¿¹àÌܤ¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤ÏŬÀڤʥ롼¥Á¥ó¤ò¸Æ¤Ó½Ð¤·¤Æ +ÃͤòÆɤó¤À¤ê½¤Àµ¤·¤¿¤ê¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï +.BR _sysctl () +¤Ï 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¤½¤Î¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I oldval +¤Ë NULL ¤Ç¤Ê¤¤ÃͤòÀßÄꤷ¤Æ¡¢°ÊÁ°¤ÎÃͤòÍ׵ᤷ¤Æ¤¤¤ë¤Î¤Ë¡¢ +.I oldlenp +¤Ë¶õ¤­¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I name +¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPERM +¡Ö¥Ç¥£¥ì¥¯¥È¥ê¡×¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä¤¬¤Ê¤«¤Ã¤¿¤«¡¢ +.I oldval +¤¬ 0 ¤Ç¤Ê¤¤¤Î¤ËÆɤ߹þ¤ßµö²Ä¤¬¤Ê¤«¤Ã¤¿¤«¡¢ +.I newval +¤¬ 0 ¤Ç¤Ê¤¤¤Î¤Ë½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +¤³¤Î¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ·¤Æ¤Ï +¤¤¤±¤Ê¤¤¡£ +.SH Îò»Ë +.BR sysctl () +¥³¡¼¥ë¤Ï +Linux ¤Î¥Ð¡¼¥¸¥ç¥ó 1.3.57 ¤«¤é¸ºß¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï 4.4BSD ¤ËͳÍ褷¤Æ¤¤¤ë¡£Linux ¤Ï +.I /proc/sys +¤Ë¼Ì¤·(mirror)¤ò¤â¤Ã¤Æ¤ª¤ê¡¢¹àÌܤÎ̾Á°¤ÎÉÕ¤±Êý¤¬ Linux ¤È 4.4BSD ¤Ç¤Ï +°Û¤Ã¤Æ¤¤¤ë¡£¤·¤«¤· +.BR sysctl () +´Ø¿ô¤ÎÀë¸À¤ÏξÊý¤ÇƱ¤¸¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£ + +¤È¤¤¤¦¤è¤ê¤Ï¡¦¡¦¡¦¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤µ¤Ê¤¤¤³¤È¡£ +Ť¤´Ö¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î»ÈÍѤÏÈó¿ä¾©¤È¤µ¤ì¤Æ¤ª¤ê¡¢ +¡Ö¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¤Çºï½ü¤µ¤ì¤ë¤è¤¦¤À¡×¤È¸À¤ï¤ì¤ë¤Û¤É¤Ç¤¢¤ë¡£ +.\" http://lwn.net/Articles/247243/ »²¾È +¤¢¤Ê¤¿¤Î¥×¥í¥°¥é¥à¤Ë¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤¢¤ì¤Ð¡¢¤¹¤°¤Ë¤Ç¤âºï½ü¤¹¤ë¤³¤È¡£ +Âå¤ï¤ê¤Ë +.I /proc/sys +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.SH ¥Ð¥° +¥ª¥Ö¥¸¥§¥¯¥È¤Î̾Á°¤Ï¡¢¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤´¤È¤Ë°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤³¤Î¤¿¤á¡¢¤³¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤È¤Ã¤Æ +̵²ÁÃͤʤâ¤Î¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.PP +Á´¤Æ¤Î²Äǽ¤Ê¹àÌܤ¬Àµ³Î¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.PP +º£¤Î¤È¤³¤í +.I /proc/sys/kernel/ostype +¤Ë½ñ¤­¹þ¤à¤³¤È¤Ç¥ª¥Ú¡¼¥ì¡¼¥Æ¥£¥ó¥°¡¦¥·¥¹¥Æ¥à¤òÊѤ¨¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.SH Îã +.nf +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +int _sysctl(struct __sysctl_args *args ); + +#define OSNAMESZ 100 + +int +main(void) +{ + struct __sysctl_args args; + char osname[OSNAMESZ]; + size_t osnamelth; + int name[] = { CTL_KERN, KERN_OSTYPE }; + + memset(&args, 0, sizeof(struct __sysctl_args)); + args.name = name; + args.nlen = sizeof(name)/sizeof(name[0]); + args.oldval = osname; + args.oldlenp = &osnamelth; + + osnamelth = sizeof(osname); + + if (syscall(SYS__sysctl, &args) == \-1) { + perror("_sysctl"); + exit(EXIT_FAILURE); + } + printf("This machine is running %*s\\n", osnamelth, osname); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR proc (5) diff --git a/release/man2/sysfs.2 b/release/man2/sysfs.2 new file mode 100644 index 00000000..59d09840 --- /dev/null +++ b/release/man2/sysfs.2 @@ -0,0 +1,116 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created Wed Aug 9 1995 Thomas K. Dyas +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Tue Mar 4 00:03:08 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Sat Jun 2 20:46:34 JST 2001 +.\" by Yuichi SATO +.\" +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: identifier string ¼±ÊÌʸ»úÎó +.\"WORD: type index ·¿¥¤¥ó¥Ç¥Ã¥¯¥¹ +.\" +.TH SYSFS 2 1995-08-09 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sysfs \- ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à (file system) ¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.BI "int sysfs(int " option ", const char *" fsname ); + +.BI "int sysfs(int " option ", unsigned int " fs_index ", char *" buf ); + +.BI "int sysfs(int " option ); +.SH ÀâÌÀ +.BR sysfs () +¤Ï¸½ºß¥«¡¼¥Í¥ë (kernel) ¤Ë¸ºß¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î·¿ (type) ¾ðÊó¤òÊÖ¤¹¡£ +¤½¤ì¤¾¤ì¤Î +.BR sysfs () +¥³¡¼¥ë¤Î·Á¼°¤ÈÊÖ¤µ¤ì¤ë¾ðÊó¤Ï +.I option +¤Ë°Í¸¤·¤Æ¤ª¤ê¡¢¤½¤ì¤Ï: +.TP 3 +.B 1 +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¼±ÊÌʸ»úÎó (identifier string) +.I fsname +¤ò¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î·¿¥¤¥ó¥Ç¥Ã¥¯¥¹ (type index) ¤ËËÝÌõ¤¹¤ë¡£ +.TP +.B 2 +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î·¿¥¤¥ó¥Ç¥Ã¥¯¥¹ +.I fs_index +¤ò NULL ½ªÃ¼¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¼±ÊÌʸ»úÎó¤ËËÝÌõ¤¹¤ë¡£ +¤³¤Îʸ»úÎó¤Ï +.I buf +¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¡¼¤Ø½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.I buf +¤Ëʸ»úÎó¤òÆþ¤ì¤ë¤À¤±¤Î½½Ê¬¤ÊÍÆÎ̤¬¤¢¤ë¤³¤È¤ò³Î¤«¤á¤ë¤³¤È¡£ +.TP +.B 3 +¸½ºß¥«¡¼¥Í¥ë¤Ë¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à·¿¤Î¿ô¤Î¹ç·×¤òÊÖ¤¹¡£ +.PP +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î·¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î¿ô¤Ï¥¼¥í¤«¤é»Ï¤Þ¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç +.BR sysfs () +¤Ï¡¢ +¥ª¥×¥·¥ç¥ó +.B 1 +¤Ç¤Ï +¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÖ¤¹¡£ +¥ª¥×¥·¥ç¥ó +.B 2 +¤Ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +¥ª¥×¥·¥ç¥ó +.B 3 +¤Ï¸½ºßÀßÄꤵ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.RI fsname " ¤È " buf +¤Î¤É¤Á¤é¤«¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Ë¤¢¤ë¡£ +.TP +.B EINVAL +.I fsname +¤¬Àµ¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î·¿¼±Ê̻ҤǤϤʤ¤; +.I fs_index +¤¬ÈϰϤγ°¤Ë¤¢¤ë; +.I option +¤¬Àµ¤·¤¯¤Ê¤¤¡£ +.SH ½àµò +SVr4. +.SH Ãí°Õ +Linux ¤Ç¤Ï +.I /proc +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë +.I proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»È¤Ã¤Æ¡¢ +.I /proc/filesystems +¤è¤êƱ¤¸¾ðÊó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ¥Ð¥° +libc ¤Þ¤¿¤Ï glibc ¤Î¥µ¥Ý¡¼¥È¤Ï¸ºß¤·¤Ê¤¤¡£ +\fIbuf\fP ¤ÎÂ礭¤µ¤¬¤É¤ì¤À¤±É¬Íפ«¤ò¿ä¬¤¹¤ëÊýË¡¤¬¤Ê¤¤¡£ diff --git a/release/man2/sysinfo.2 b/release/man2/sysinfo.2 new file mode 100644 index 00000000..5c138865 --- /dev/null +++ b/release/man2/sysinfo.2 @@ -0,0 +1,104 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (C) 1993 by Dan Miner (dminer@nyx.cs.du.edu) +.\" +.\" Permission is granted to freely distribute or modify this file +.\" for the purpose of improving Linux or its documentation efforts. +.\" If you modify this file, please put a date stamp and HOW you +.\" changed this file. Thanks. -DM +.\" +.\" 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 +.\" +.\" 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 ·¿Àë¸À +.\" +.TH SYSINFO 2 2007-11-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sysinfo \- ¥·¥¹¥Æ¥àÁ´ÂΤÎÅý·×¾ðÊó¤òÊÖ¤¹¡£ +.SH ½ñ¼° +.B #include +.sp +.BI "int sysinfo(struct sysinfo *" info ); +.SH ÀâÌÀ +Linux 2.3.16 ¤Þ¤Ç¤Ï +.BR sysinfo () +¤Ï°Ê²¼¤Î¹½Â¤ÂΤ˾ðÊó¤òÆþ¤ì¤ÆÊÖ¤¹¡£ + +.nf +.in +4n +struct sysinfo { + long uptime; /* Seconds since boot */ + unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ + unsigned long totalram; /* Total usable main memory size */ + unsigned long freeram; /* Available memory size */ + unsigned long sharedram; /* Amount of shared memory */ + unsigned long bufferram; /* Memory used by buffers */ + unsigned long totalswap; /* Total swap space size */ + unsigned long freeswap; /* swap space still available */ + unsigned short procs; /* Number of current processes */ + char _f[22]; /* Pads structure to 64 bytes */ +}; +.in +.fi +.PP +¤³¤³¤Ç¥Ð¥¤¥Èñ°Ì¤ÇÍ¿¤¨¤é¤ì¤ë¡£ + +Linux 2.3.23 (i386)¡¢2.3.48 (Á´¤Æ¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã) ¤«¤é¤Ï¹½Â¤ÂÎ¤Ï + +.nf +.in +4n +struct sysinfo { + long uptime; /* Seconds since boot */ + unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ + unsigned long totalram; /* Total usable main memory size */ + unsigned long freeram; /* Available memory size */ + unsigned long sharedram; /* Amount of shared memory */ + unsigned long bufferram; /* Memory used by buffers */ + unsigned long totalswap; /* Total swap space size */ + unsigned long freeswap; /* swap space still available */ + unsigned short procs; /* Number of current processes */ + unsigned long totalhigh; /* Total high memory size */ + unsigned long freehigh; /* Available high memory size */ + unsigned int mem_unit; /* Memory unit size in bytes */ + char _f[20\-2*sizeof(long)\-sizeof(int)]; /* Padding for libc5 */ +}; +.in +.fi +.PP +¤È¤Ê¤ê¡¢Â礭¤µ¤Ï \fImem_unit\fP ¥Ð¥¤¥È¤ÎÇÜ¿ô¤ÇÍ¿¤¨¤é¤ì¤ë¡£ + +.BR sysinfo () +¤Ï¥·¥¹¥Æ¥àÁ´ÂΤÎÅý·×¤ò¼èÆÀ¤¹¤ë´Êñ¤ÊÊýË¡¤òÄ󶡤¹¤ë¡£ +¤³¤ì¤Ï \fI/dev/kmem\fP ¤òÆɤà¤è¤ê¤â°Ü¿¢À­¤Î¹â¤¤ÊýË¡¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Ê¤é¤Ð \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I sysinfo ¹½Â¤ÂÎ +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.sp +Linux ¥«¡¼¥Í¥ë¤Ï 0.98.pl6 ¤«¤é +.BR sysinfo () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +Linux ¤Î libc ¤Ï 5.3.5 ¤è¤ê¡¢glibc ¤Ç¤Ï 1.90 ¤è¤ê +.BR sysinfo () +¥ë¡¼¥Á¥ó¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR proc (5) diff --git a/release/man2/syslog.2 b/release/man2/syslog.2 new file mode 100644 index 00000000..e38150dd --- /dev/null +++ b/release/man2/syslog.2 @@ -0,0 +1,268 @@ +.\" 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 +.\" 2008-02-15, Jeremy Kerr +.\" Add info on command type 10; add details on types 6, 7, 8, & 9. +.\" 2008-02-15, Michael Kerrisk +.\" Update LOG_BUF_LEN details; update RETURN VALUE section. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Mon Dec 16 11:16:34 JST 2001 +.\" by HANATAKA Shinya +.\" Updated Thu Mar 6 2003 by Akihiro MOTOKI +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2008-04-04, Akihiro MOTOKI, LDP v2.79 +.\" Updated 2008-07-31, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: message ring buffer ¥á¥Ã¥»¡¼¥¸¡¦¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡ +.\"WORD: library ¥é¥¤¥Ö¥é¥ê +.\"WORD: kernel log buffer ¥«¡¼¥Í¥ë¡¦¥í¥°¡¦¥Ð¥Ã¥Õ¥¡ +.\"WORD: console ¥³¥ó¥½¡¼¥ë +.\"WORD: kernel panic ¥«¡¼¥Í¥ë¡¦¥Ñ¥Ë¥Ã¥¯ +.\"WORD: loglevel ¥í¥°¥ì¥Ù¥ë +.\"WORD: debug message ¥Ç¥Ð¥Ã¥°¡¦¥á¥Ã¥»¡¼¥¸ +.\" +.TH SYSLOG 2 2008-06-20 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +syslog, klogctl \- ¥«¡¼¥Í¥ë¤Î¥á¥Ã¥»¡¼¥¸¡¦¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¤òÆɤó¤À¤ê¾Ãµî¤·¤¿¤ê¤¹¤ë; +console_loglevel ¤ÎÀßÄê¤ò¹Ô¤¦ +.SH ½ñ¼° +.nf +.BI "int syslog(int " type ", char *" bufp ", int " len ); +.B " /* glibc ¤Ç¤Ï¥é¥Ã¥Ñ¡¼´Ø¿ô¤ÏÄ󶡤µ¤ì¤Æ¤¤¤Ê¤¤ */" +.sp +/* glibc ¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹ */ +.br +.B "#include " +.sp +.BI "int klogctl(int " type ", char *" bufp ", int " len ); +.fi +.SH ÀâÌÀ +.RB ( syslogd (8) +¤ÈÏä¹) C ¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î +.BR syslog () +¤¬É¬Íפʾì¹ç¤Ï¡¢ +.BR syslog (3) +¤ò¸«¤ë¤³¤È¡£ +¤³¤Î̾Á°¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë¤Î +.IR printk () +¥Ð¥Ã¥Õ¥¡¤òÀ©¸æ¤¹¤ë¤â¤Î¤Ç¤¢¤ê¡¢glibc ¤Ç¤Ï +.BR klogctl () +¤È¸Æ¤Ð¤ì¤Æ¤¤¤ë¡£ + +\fItype\fP °ú¤­¿ô¤Ï¤³¤Î´Ø¿ô¤ÎÆ°ºî¤ò·èÄꤹ¤ë¡£ + +.I kernel/printk.c +¤«¤é¤Î°úÍÑ : +.nf +/* + * Commands to sys_syslog: + * + * 0 \-\- ¥í¥°¤òÊĤ¸¤ë¡£¸½ºß¤Î¼ÂÁõ¤Ç¤Ï²¿¤â¤·¤Ê¤¤ (NOP) ¡£ + * 1 \-\- ¥í¥°¤ò³«¤¯¡£¸½ºß¤Î¼ÂÁõ¤Ç¤Ï²¿¤â¤·¤Ê¤¤ (NOP) ¡£ + * 2 \-\- ¥í¥°¤«¤éÆɤ߽Ф¹¡£ + * 3 \-\- ¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¤Ë»Ä¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¤ò¤¹¤Ù¤ÆÆɤ߽Ф¹¡£ + * 4 \-\- ¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¤Ë»Ä¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¤ò¤¹¤Ù¤ÆÆɤ߽Ф·¡¢¾Ãµî¤¹¤ë¡£ + * 5 \-\- ¥ê¥ó¥°¥Ð¥Ã¥Õ¥¡¤ò¾Ãµî¤¹¤ë¡£ + * 6 \-\- ¥³¥ó¥½¡¼¥ë¤Ø¤Î printk ¤ò̵¸ú¤Ë¤¹¤ë¡£ + * 7 \-\- ¥³¥ó¥½¡¼¥ë¤Ø¤Î printk ¤òÍ­¸ú¤Ë¤¹¤ë¡£ + * 8 \-\- ¥³¥ó¥½¡¼¥ë¤Ëɽ¼¨¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¤Î¥ì¥Ù¥ë¤òÀßÄꤹ¤ë¡£ + * 9 \-\- ¥í¥°¥Ð¥Ã¥Õ¥¡¤Î̤ÆɤÎʸ»ú¿ô¤òÊÖ¤¹¡£ + * 10 \-\- ¥í¥°¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òÊÖ¤¹¡£ + */ +.fi + +ÈóÆø¢¥×¥í¥»¥¹¤Ë¤Ï¥³¥Þ¥ó¥É 3 ¤È 10 ¤Î¤ß¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë +(¥³¥Þ¥ó¥É 9 ¤Ï Linux 2.4.10 ¤Ç¡¢¥³¥Þ¥ó¥É 10 ¤Ï Linux 2.6.6 ¤ÇÄɲ䵤줿)¡£ +.SS ¥«¡¼¥Í¥ë¡¦¥í¥°¡¦¥Ð¥Ã¥Õ¥¡ (kernel log buffer) +¥«¡¼¥Í¥ë¤ÏŤµ +.B LOG_BUF_LEN +¤Î½ä²ó¼°¤Î¥Ð¥Ã¥Õ¥¡¤ò»ý¤Ã¤Æ¤ª¤ê¡¢ +¤½¤ì¤Ë¤Ï¥«¡¼¥Í¥ë´Ø¿ô¤Î +.BR printk () +¤Î°ú¤­¿ô¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿ +¥á¥Ã¥»¡¼¥¸¤¬ (¤½¤Î¥í¥°¥ì¥Ù¥ë¤Ë¤«¤«¤ï¤é¤º) ³ÊǼ¤µ¤ì¤ë¡£ +½é´ü¤Î¥«¡¼¥Í¥ë¤Ç¤Ï +.B LOG_BUF_LEN +¤ÎÃÍ¤Ï 4096 ¤Ç¤¢¤Ã¤¿¡£ +¥«¡¼¥Í¥ë 1.3.54 ¤«¤é¤Ï 8192¡¢ +¥«¡¼¥Í¥ë 2.1.113 ¤«¤é¤Ï 16384 ¤Ë¤Ê¤ê¡¢ +¥«¡¼¥Í¥ë 2.4.23 °Ê¹ß¤ª¤è¤Ó 2.6 °Ê¹ß¤Ç¤Ï¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +ÃͤòÀßÄê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" Under "General setup" ==> "Kernel log buffer size" +.\" For 2.6, precisely the option seems to have appeared in 2.5.55. +ºÇ¶á¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥³¥Þ¥ó¥É 10 ¤Ç¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òÌ䤤¹ç¤ï¤»¤Ç¤­¤ë¡£ + +.I "syslog(2,buf,len)" +¤Î¸Æ¤Ó½Ð¤·¤Ï¥«¡¼¥Í¥ë¡¦¥í¥°¡¦¥Ð¥Ã¥Õ¥¡¤¬¶õ¤Ç¤Ê¤¯¤Ê¤ë¤Þ¤ÇÂԤäơ¢ +ºÇÂç \fIlen\fP ¥Ð¥¤¥È¤Þ¤Ç \fIbuf\fP ¤Ø¤ÈÆɤ߽Ф·¡¢Æɤ߹þ¤ó¤À +¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¥í¥°¤«¤éÆɤޤ줿¥Ð¥¤¥È¤Ï¥í¥°¡¦¥Ð¥Ã¥Õ¥¡¤«¤é¾Ã¤¨¤ë: +¾ðÊó¤Ï°ìÅÙ¤·¤«Æɤळ¤È¤¬¤Ç¤­¤Ê¤¤¡£ +¤³¤ì¤Ï¥æ¡¼¥¶¡¼¤Î¥×¥í¥°¥é¥à¤¬ +.I /proc/kmsg +¤òÆɤó¤À»þ¤Ë¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¼Â¹Ô¤µ¤ì¤ë´Ø¿ô¤Ç¤â¤¢¤ë¡£ + +.I syslog(3,buf,len) +¤Î¸Æ¤Ó½Ð¤·¤Ï¥í¥°¡¦¥Ð¥Ã¥Õ¥¡¤ÎºÇ¸å¤Î \fIlen\fP ¥Ð¥¤¥È¤ò +(ÈóÇ˲õŪ¤Ë)Æɤ߽Ф¹¡¢¤·¤«¤·¡¢Ä¾¶á¤Î¡Ö¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¾Ãµî¡×Ì¿Îá +(¤³¤ÎÌ¿Îá¤Ï¥Ð¥Ã¥Õ¥¡¤ò¾Ãµî¤¹¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤) +°Ê¹ß¤Ë¥Ð¥Ã¥Õ¥¡¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¾ðÊó¤·¤«Æɤ߽Ф»¤Ê¤¤¡£ +ÊÖ¤êÃͤÏÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤Ç¤¢¤ë¡£ + +.I syslog(4,buf,len) +¸Æ¤Ó½Ð¤·¤Ï¡Ö¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¾Ãµî¡×Ì¿Îá¤â¼Â¹Ô¤¹¤ë°Ê³°¤Ï +µ¡Ç½ 3 ¤È´°Á´¤ËƱ¤¸¤Ç¤¢¤ë¡£ + +.I syslog(5,dummy,dummy) +¸Æ¤Ó½Ð¤·¤Ï¡Ö¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¾Ãµî¡×Ì¿Îá¤Î¤ß¤ò¼Â¹Ô¤¹¤ë +(¸Æ¤Ó½Ð¤·¤Î½ñ¼°¤Ç¡¢ +.I buf +¤ä +.I len +¤¬ "dummy" ¤Èµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤Î°ú¤­¿ô¤ÎÃͤ¬Ìµ»ë¤µ¤ì¤ë¤³¤È¤òɽ¤¹)¡£ + +.I syslog(6,dummy,dummy) +¸Æ¤Ó½Ð¤·¤Ï¥³¥ó¥½¡¼¥ë¤Î¥í¥°¥ì¥Ù¥ë¤òºÇ¾®¤ËÀßÄꤷ¡¢ +¥³¥ó¥½¡¼¥ë¤Ë¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£ + +.I syslog(7,dummy,dummy) +¸Æ¤Ó½Ð¤·¤Ï¥³¥ó¥½¡¼¥ë¤Î¥í¥°¥ì¥Ù¥ë¤ò¥Ç¥Õ¥©¥ë¥È¤ËÀßÄꤷ¡¢ +¥³¥ó¥½¡¼¥ë¤Ë¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤ë¤è¤¦¤Ë¤¹¤ë¡£ + +.I syslog(8,dummy,level) +¸Æ¤Ó½Ð¤·¤Ï¥³¥ó¥½¡¼¥ë¤Î¥í¥°¥ì¥Ù¥ë¤ò +.I level +¤ËÀßÄꤹ¤ë¡£ +.I level +¤Ï 1 °Ê¾å 8 °Ê²¼¤ÎÀ°¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¾ÜºÙ¤Ï +.B ¥í¥°¥ì¥Ù¥ë (loglevel) +¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ + +.I syslog(9,dummy,dummy) +¸Æ¤Ó½Ð¤·¤Ï¥«¡¼¥Í¥ë¡¦¥í¥°¥Ð¥Ã¥Õ¥¡¤Ë¤¢¤ë¸½ºßÆɤ߽Ф·²Äǽ¤Ê¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ + +.I syslog(10,dummy,dummy) +¸Æ¤Ó½Ð¤·¤Ï¥«¡¼¥Í¥ë¡¦¥í¥°¥Ð¥Ã¥Õ¥¡¤ÎÁíÎ̤òÊÖ¤¹¡£ +.SS ¥í¥°¥ì¥Ù¥ë (loglevel) +¥«¡¼¥Í¥ë¡¦¥ë¡¼¥Á¥ó¤Î +.BR printk () +¤Ï¡¢¥í¥°¥ì¥Ù¥ë¤¬ +.I console_loglevel +ÊÑ¿ô¤è¤ê¾®¤µ¤¤¤È¤­¤Ë¤Î¤ß¡¢¥³¥ó¥½¡¼¥ë¤Ë¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£ +.I console_loglevel +¤ÏºÇ½é +.B DEFAULT_CONSOLE_LOGLEVEL +(7) ¤ËÀßÄꤵ¤ì¤ë¤¬¡¢µ¯Æ°»þ¤Ë¥«¡¼¥Í¥ë¤Î +¥³¥Þ¥ó¥É¡¦¥é¥¤¥ó¡¦¥ª¥×¥·¥ç¥ó¤Ë "debug" ¤È¤¤¤¦Ã±¸ì¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï +10 ¤ËÀßÄꤵ¤ì¡¢¥«¡¼¥Í¥ë¡¦¥Õ¥©¡¼¥ë¥È¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤Ï 15 ¤ËÀßÄꤵ¤ì¤ë +(⤷¡¢10 ¤ä 15 ¤È¤¤¤¦¿ô»ú¤Ë°ÕÌ£¤Ï¤Ê¤¯¡¢8 ¤ÈƱÅù¤Ç¤¢¤ë)¡£ +¤³¤ÎÊÑ¿ô¤Ï +.IR syslog(8,dummy,value) . +¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¡¢ÃͤÎÈÏ°Ï¤Ï 1-8 ¤Ç¤¢¤ë¡£ +.I syslog(type,dummy,dummy) +¸Æ¤Ó½Ð¤·¤Ç \fItype\fP ¤¬ 6 ¤â¤·¤¯¤Ï 7 ¤Î¾ì¹ç¡¢ +console_loglevel ¤Ï 1 (¥«¡¼¥Í¥ë¡¦¥Ñ¥Ë¥Ã¥¯¤Î¤ß)¡¢ +7 (¥Ç¥Ð¥Ã¥°¡¦¥á¥Ã¥»¡¼¥¸°Ê³°¤ÎÁ´¤Æ) ¤Ë¤½¤ì¤¾¤ìÀßÄꤵ¤ì¤ë¡£ + +¥á¥Ã¥»¡¼¥¸¤Î³Æ¹Ô¤Ï¤½¤ì¤¾¤ì¤Ë¥í¥°¥ì¥Ù¥ë¤ò»ý¤Ä¡£¤³¤Î¥í¥°¥ì¥Ù¥ë¤Ï +.I "DEFAULT_MESSAGE_LOGLEVEL \- 1" +(6) ¤Ç¤¢¤ë¤¬¡¢ (\fId\fP ¤Ï 1-7 ¤ÎÈϰϤοô»ú) ¤Ç»Ï¤Þ¤ë¹Ô¤Î +¥í¥°¥ì¥Ù¥ë¤Ï \fId\fP ¤Ç¤¢¤ë¡£ +¥í¥°¥ì¥Ù¥ë¤Î´·½¬Åª¤Ê°ÕÌ£¤Ï +.I +¤Ë°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: + +.nf +#define KERN_EMERG "<0>" /* ¥·¥¹¥Æ¥à¤¬»ÈÍÑÉÔǽ */ +#define KERN_ALERT "<1>" /* ľ¤Á¤ËÂн褬ɬÍ× */ +#define KERN_CRIT "<2>" /* Ã×̿Ū¤Ê¾õÂÖ */ +#define KERN_ERR "<3>" /* ¥¨¥é¡¼¾õÂÖ */ +#define KERN_WARNING "<4>" /* ·Ù¹ð¾õÂÖ */ +#define KERN_NOTICE "<5>" /* Ä̾ï¾õÂÖ¤À¤¬Âç»ö¤Ê¾ðÊó */ +#define KERN_INFO "<6>" /* ÄÌÃÎ */ +#define KERN_DEBUG "<7>" /* ¥Ç¥Ð¥Ã¥°¥ì¥Ù¥ë¤Î¾ðÊó */ +.fi +.SH ÊÖ¤êÃÍ +\fItype\fP ¤¬ 2, 3, 4 ¤Î¾ì¹ç¡¢À®¸ù¤¹¤ë¤È +.BR syslog () +¤ÏÆɤ߽Ф·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +\fItype\fP ¤¬ 9 ¤Î¾ì¹ç¡¢ +¥«¡¼¥Í¥ë¡¦¥í¥°¥Ð¥Ã¥Õ¥¡¤Ë¤¢¤ë¸½ºßÆɤ߽Ф·²Äǽ¤Ê¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +\fItype\fP ¤¬ 10 ¤Î¾ì¹ç¡¢ +¥«¡¼¥Í¥ë¡¦¥í¥°¥Ð¥Ã¥Õ¥¡¤ÎÁíÎ̤òÊÖ¤¹¡£ +\fItype\fP ¤¬¤½¤ì°Ê³°¤ÎÃͤξì¹ç¡¢À®¸ù¤¹¤ë¤È 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1\ ¤¬Ê֤ꡢ +\fIerrno\fP ¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +ÉÔÀµ¤Ê°ú¤­¿ô +(¶ñÂÎŪ¤Ë¤Ï¡¢ +.I type +¤¬Àµ¤·¤¯¤Ê¤¤¡¢¤â¤·¤¯¤Ï +.I type +¤¬ 2, 3, 4 ¤Î¾ì¹ç¤Ë +.I buf +¤¬ NULL ¤« +.I len +¤¬ 0 ̤Ëþ¤Ç¤¢¤ë¡¢¤â¤·¤¯¤Ï +.I type +¤¬ 8 ¤Î¾ì¹ç¤Ë +.I level +¤¬ 1 °Ê¾å 8 °Ê²¼¤ÎÈϰϤËÆþ¤Ã¤Æ¤¤¤Ê¤¤)¡£ +.TP +.B EPERM +½½Ê¬¤Ê¸¢¸Â¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹ (Àµ³Î¤Ë¤Ï +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹) ¤¬ console_loglevel¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿¤«¡¢ +¥«¡¼¥Í¥ë¡¦¥á¥Ã¥»¡¼¥¸¡¦¥ê¥ó¥°¤ò¾Ãµî¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B ERESTARTSYS +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¡¢²¿¤âÆɤ߽Ф»¤Ê¤«¤Ã¤¿¡£ +(¥È¥ì¡¼¥¹Ãæ¤Ë¤·¤«È¯À¸¤¹¤ë¤³¤È¤Ï¤Ê¤¤) +.TP +.B ENOSYS +¥«¡¼¥Í¥ë¤ÎÀßÄꥪ¥×¥·¥ç¥ó +.BR CONFIG_PRINTK +¤ò̵¸ú¤Ë¤·¤Æ¥«¡¼¥Í¥ë¤¬¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢ +.BR syslog () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÍøÍѤǤ­¤Ê¤¤¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.SH Ãí°Õ +¤«¤Ê¤ê½é´ü¤Îº¢¤«¤é¡¢Æ±¤¸Ì¾Á°¤ò»ý¤Ä¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤È +¥é¥¤¥Ö¥é¥ê¡¦¥ë¡¼¥Á¥ó¤¬Á´¤¯°Û¤Ê¤ëÂåʪ¤Ç¤¢¤ë¤Î¤ÏÉÔ¹¬¤Ê¤³¤È¤À¤È +µ¤ÉÕ¤«¤ì¤Æ¤¤¤¿¡£ +libc4 ¤È libc5 ¤Ç¤Ï¤³¤Î¥³¡¼¥ë¤ÎÈÖ¹æ¤Ï +.B SYS_klog +¤ÈÄêµÁ¤µ¤ì¤Æ¤¤¤¿¡£ +glibc2.0 ¤Ç¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.BR klogctl () +¤È¤¤¤¦Ì¾Á°¤Ë²þ¤á¤é¤ì¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR syslog (3) diff --git a/release/man2/tee.2 b/release/man2/tee.2 new file mode 100644 index 00000000..9496dfc2 --- /dev/null +++ b/release/man2/tee.2 @@ -0,0 +1,209 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 2006 Jens Axboe +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-02-04, Akihiro MOTOKI +.\" +.TH TEE 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +tee \- ¥Ñ¥¤¥×¤ÎÃæ¿È¤òÊ£À½¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "ssize_t tee(int " fd_in ", int " fd_out ", size_t " len \ +", unsigned int " flags ); +.fi +.\" Return type was long before glibc 2.7 +.SH ÀâÌÀ +.\" Example programs http://brick.kernel.dk/snaps +.\" +.\" +.\" add a "tee(in, out1, out2)" system call that duplicates the pages +.\" (again, incrementing their reference count, not copying the data) from +.\" one pipe to two other pipes. +.BR tee () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd_in +¤¬»²¾È¤¹¤ë¥Ñ¥¤¥×¤«¤é¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd_out +¤¬»²¾È¤¹¤ë¥Ñ¥¤¥×¤ØºÇÂç +.I len +¥Ð¥¤¥È¤Î¥Ç¡¼¥¿¤òÊ£À½¤¹¤ë¡£ +¤³¤ÎÁàºî¤Ç¤Ï¡¢Ê£À½¤µ¤ì¤ë¥Ç¡¼¥¿¤Ï +.I fd_in +¤«¤é¤Ï¾ÃÈñ¤µ¤ì¤Ê¤¤¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤ì¤é¤Î¥Ç¡¼¥¿¤ò¤³¤Î¸å¤Î +.BR splice (2) +¤Ç¥³¥Ô¡¼¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.I flags +¤Ï°ìÏ¢¤Î½¤¾þ¥Õ¥é¥°¤Ç¤¢¤ê¡¢ +.BR splice (2) +¤ä +.BR vmsplice (2) +¤È¶¦Ä̤Î̾Á°¤Ç¤¢¤ë¡£ +.TP 1.9i +.B SPLICE_F_MOVE +¸½ºß¤Î¤È¤³¤í +.BR tee () +¤Ç¤Ï²¿¤Î¸ú²Ì¤â¤Ê¤¤¡£ +.BR splice (2) +»²¾È¡£ +.TP +.B SPLICE_F_NONBLOCK +Æþ½ÐÎÏ»þ¤ËÄä»ß (block) ¤·¤Ê¤¤¡£ +¾ÜºÙ¤Ï +.BR splice (2) +»²¾È¡£ +.TP +.B SPLICE_F_MORE +¸½ºß¤Î¤È¤³¤í +.BR tee () +¤Ç¤Ï²¿¤Î¸ú²Ì¤â¤Ê¤¤¤¬¡¢¾­ÍèŪ¤Ë¤Ï¼ÂÁõ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.BR splice (2) +»²¾È¡£ +.TP +.B SPLICE_F_GIFT +.BR tee () +¤Ç¤Ï̤»ÈÍÑ¡£ +.BR vmsplice (2) +»²¾È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤Æ´°Î»¤¹¤ë¤È¡¢ +.BR tee () +¤ÏÆþ½ÐÎÏ´Ö¤ÇÊ£À½¤µ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +ÊÖ¤êÃÍ 0 ¤Ï¥Ç¡¼¥¿¤ÎžÁ÷¤¬¹Ô¤ï¤ì¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î¾ì¹ç¡¢½èÍý¤òÄä»ß (block) ¤·¤Æ¤â̵°ÕÌ£¤Ç¤¢¤ë¡£ +¤Ê¤¼¤Ê¤é¡¢ +.I fd_in +¤¬»²¾È¤¹¤ë¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¼Ô¤¬¤¤¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ + +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR tee () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I fd_in +¤È +.I fd_out +¤Î¤É¤Á¤é¤«¤¬¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£¤â¤·¤¯¤Ï +.I fd_in +¤È +.I fd_out +¤¬Æ±¤¸¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.TP +.B ENOMEM +¥á¥â¥êÉÔ­¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR tee () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6.17 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +³µÇ°¤È¤·¤Æ¤Ï¡¢ +.BR tee () +¤ÏÆó¤Ä¤Î¥Ñ¥¤¥×´Ö¤Ç¥Ç¡¼¥¿¤Î¥³¥Ô¡¼¤ò¹Ô¤¦¡£ +¤·¤«¤·¡¢¼ÂºÝ¤Ë¤Ï¼Â¥Ç¡¼¥¿¤Î¥³¥Ô¡¼¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +ÆâÉô¤Ç¤Ï¡¢ +.BR tee () +¤ÏÆþÎϦ¤ËÂФ¹¤ë»²¾È¤À¤±¤òºîÀ®¤¹¤ë¤³¤È¤Ç½ÐÎϦ¤Ë¥Ç¡¼¥¿¤ò +Äɲ乤롣 +.SH Îã +°Ê²¼¤ÎÎã¤Ï¡¢ +.BR tee () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¡¢ +´ðËÜŪ¤Ê +.BR tee (1) +¥×¥í¥°¥é¥à¤ò¼ÂÁõ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.nf + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int fd; + int len, slen; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd == \-1) { + perror("open"); + exit(EXIT_FAILURE); + } + + do { + /* + * tee stdin to stdout. + */ + len = tee(STDIN_FILENO, STDOUT_FILENO, + INT_MAX, SPLICE_F_NONBLOCK); + + if (len < 0) { + if (errno == EAGAIN) + continue; + perror("tee"); + exit(EXIT_FAILURE); + } else + if (len == 0) + break; + + /* + * Consume stdin by splicing it to a file. + */ + while (len > 0) { + slen = splice(STDIN_FILENO, NULL, fd, NULL, + len, SPLICE_F_MOVE); + if (slen < 0) { + perror("splice"); + break; + } + len \-= slen; + } + } while (1); + + close(fd); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR splice (2), +.BR vmsplice (2), +.BR feature_test_macros (7) diff --git a/release/man2/time.2 b/release/man2/time.2 new file mode 100644 index 00000000..4ba4f063 --- /dev/null +++ b/release/man2/time.2 @@ -0,0 +1,86 @@ +.\" 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 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 µª¸µ +.\" +.TH TIME 2 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +time \- ÉÃñ°Ì¤Î»þ´Ö¤òÆÀ¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "time_t time(time_t *" t ); +.SH ÀâÌÀ +.BR time () +¤Ï¡¢µª¸µ (Epoch; 1970-01-01 00:00:00 (UTC)) ¤«¤é¤ÎÉÿô¤ÇÊÖ¤¹¡£ + +¤â¤· +.I t +¤¬ NULL ¤Ç¤Ê¤«¤Ã¤¿¤éÊÖ¤êÃÍ¤Ï +.I t +¤Î»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤Ë¤â³ÊǼ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢µª¸µ(the Epoch)¤«¤é¤Î·Ð²áÉÿô¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï +\fI((time_t)\ \-1)\fP ¤òÊÖ¤·¡¢\fIerrno\fP ¤òÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I t +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.\" .br +.\" 4.3BSD ¤Ç¤Ï¤³¤Î´Ø¿ô¤Ï +.\" .BR gettimeofday (2) +.\" ¤Ë¼è¤Ã¤ÆÂå¤ï¤é¤ì¤Æ¤¤¤ë¡£ +POSIX ¤Ë¤Ï¥¨¥é¡¼¾õÂ֤ε¬Äê¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +POSIX.1 ¤Ç¤Ï +.I ¡Öµª¸µ¤«¤é¤Î·Ð²áÉÿô (seconds since the Epoch)¡× +¤Ï»ØÄꤷ¤¿»þ¹ï¤Èµª¸µ¤È¤Î´Ö¤ÎÉÿô¤Ç¤¢¤ë¤ÈÄêµÁ¤·¤Æ¤¤¤ë¡£ +¤¿¤À¤·¤³¤Î¤È¤­ UTC (¶¨ÄêÀ¤³¦»þ) ¤«¤éÉäòµá¤á¤ëÊÑ´¹¤Ë¤Ï¡¢ÁÇËѤÊÊÑ´¹¼° +(±¼Éäò̵»ë¤·¡¢ 4 ¤Ç³ä¤êÀÚ¤ì¤ëǯ¤ò¤¹¤Ù¤Æ±¼Ç¯¤È¤·¤¿¼°) +¤òÍѤ¤¤ë¤â¤Î¤È¤·¤Æ¤¤¤ë¡£ +¤³¤ÎÃͤϵª¸µ¤È¸½ºß»þ¹ï¤È¤Î´Ö¤Ç¼ÂºÝ¤Ë·Ð²á¤·¤¿Éÿô¤ÈƱ¤¸¤Ç¤Ï¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¤Ð±¼Éä¬Â¸ºß¤¹¤ë¤·¡¢»þ·×(clock)¤òɸ½à»þ´Ö(standard reference)¤Ë +Ʊ´ü¤µ¤»¤ë¤³¤È¤òÍ׵ᤵ¤ì¤Æ¤¤¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +¤³¤ÎÄêµÁ¤Î°Õ¿Þ¤Ïµª¸µ¤«¤é¤Î·Ð²áÉÿô¤Î²ò¼á¤ò°ìÄê¤Ë¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +¤è¤ê¾Ü¤·¤¤¸¶Íý¤Ï POSIX.1 Annex B 2.2.2 ¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR date (1), +.BR gettimeofday (2), +.BR ctime (3), +.BR ftime (3), +.BR time (7) diff --git a/release/man2/timerfd_create.2 b/release/man2/timerfd_create.2 new file mode 100644 index 00000000..4407b00e --- /dev/null +++ b/release/man2/timerfd_create.2 @@ -0,0 +1,543 @@ +.\" Copyright (C) 2008 Michael Kerrisk +.\" +.\" 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 +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-11-19, Akihiro MOTOKI , LDP v3.13 +.\" Updated 2009-04-24, Akihiro MOTOKI , LDP 3.20 +.\" +.TH TIMERFD_CREATE 2 2009-03-10 Linux "Linux Programmer's Manual" +.SH ̾Á° +timerfd_create, timerfd_settime, timerfd_gettime \- +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤ÇÄÌÃΤ¹¤ë¥¿¥¤¥Þ¡¼ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int timerfd_create(int " clockid ", int " flags ); +.sp +.BI "int timerfd_settime(int " fd ", int " flags , +.BI " const struct itimerspec *" new_value , +.BI " struct itimerspec *" old_value ); +.sp +.BI "int timerfd_gettime(int " fd ", struct itimerspec *" curr_value ); +.fi +.SH ÀâÌÀ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ËþλÄÌÃΤò¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤ÇÇÛÁ÷¤¹¤ë +¥¿¥¤¥Þ¡¼¤ÎÀ¸À®¤ÈÁàºî¤ò¹Ô¤¦¡£ +¤³¤ì¤é¤Ï¡¢ +.BR setitimer (2) +¤ä +.BR timer_create (2) +¤òÍѤ¤¤ëÊýË¡¤ÎÂå¤ï¤ê¤È¤Ê¤ë¤â¤Î¤Ç¤¢¤ê¡¢¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +.BR select (2), +.BR poll (2), +.BR epoll (7) +¤Ç´Æ»ë¤Ç¤­¤ë¤È¤¤¤¦ÍøÅÀ¤¬¤¢¤ë¡£ + +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Î¤Ï¡¢¤½¤ì¤¾¤ì +.BR timer_create (2), +.BR timer_settime (2), +.BR timer_gettime (2) +¤ò»È¤¦¤Î¤ÈƱÍͤǤ¢¤ë +.RB ( timer_getoverrun (2) +¤ËÂбþ¤¹¤ë¤â¤Î¤Ï¤Ê¤¯¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ë¤è¤¦¤Ë +¤³¤Îµ¡Ç½¤Ï +.BR read (2) +¤Ë¤è¤êÄ󶡤µ¤ì¤ë)¡£ +.\" +.SS timerfd_create() +.BR timerfd_create () +¤Ï¿·µ¬¤Î¥¿¥¤¥Þ¡¼¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¤·¡¢¤½¤Î¥¿¥¤¥Þ¡¼¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.I clockid +°ú¤­¿ô¤Ï¡¢¥¿¥¤¥Þ¡¼¤Î¿ÊĽ¤ò´ÉÍý¤¹¤ë¤¿¤á¤Î¥¯¥í¥Ã¥¯¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¡¢ +.B CLOCK_REALTIME +¤« +.B CLOCK_MONOTONIC +¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B CLOCK_REALTIME +¤Ï¥·¥¹¥Æ¥àÁ´ÂΤǻÈÍѤµ¤ì¤ë¥¯¥í¥Ã¥¯¤Ç¡¢¤³¤Î¥¯¥í¥Ã¥¯¤ÏÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +.B CLOCK_MONOTONIC +¤ÏÊѹ¹¤µ¤ì¤ë¤³¤È¤Î¤Ê¤¤¥¯¥í¥Ã¥¯¤Ç¡¢(¥·¥¹¥Æ¥à»þ¹ï¤Î¼êÆ°¤Ç¤ÎÊѹ¹¤Ê¤É¤Î) +¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤ÎÉÔϢ³¤ÊÊѲ½¤Î±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡£ +¤³¤ì¤é¤Î¥¯¥í¥Ã¥¯¤Î¸½ºß¤ÎÃÍ¤Ï +.BR clock_gettime (2) +¤ò»È¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£ + +Linux 2.6.27 °Ê¹ß¤Ç¤Ï¡¢ +°Ê²¼¤ÎÃͤΤ¤¤¯¤Ä¤«¤ò¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýÏ (OR) ¤Ç»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +.BR timerfd_create () +¤Î¿¶Éñ¤¤¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 14 +.B TFD_NONBLOCK +¿·¤·¤¯À¸À®¤µ¤ì¤ë¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò (open file description) ¤Î +.B O_NONBLOCK +¥Õ¥¡¥¤¥ë¥¹¥Æ¡¼¥¿¥¹¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤³¤È¤Ç¡¢ +.B O_NONBLOCK +¤ò¥»¥Ã¥È¤¹¤ë¤¿¤á¤Ë +.BR fcntl (2) +¤òÄɲäǸƤӽФ¹É¬Íפ¬¤Ê¤¯¤Ê¤ë¡£ +.TP +.B TFD_CLOEXEC +¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +close-on-exec +.RB ( FD_CLOEXEC ) +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬Ìò¤ËΩ¤ÄÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR open (2) +¤Î +.B O_CLOEXEC +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.PP +¥Ð¡¼¥¸¥ç¥ó 2.6.26 °ÊÁ°¤Î Linux ¤Ç¤Ï¡¢ +.I flags +°ú¤­¿ô¤Ï̤»ÈÍѤǤ¢¤ê¡¢0 ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SS timerfd_settime() +.BR timerfd_settime () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥¿¥¤¥Þ¡¼¤ò³«»Ï¤·¤¿¤êÄä»ß¤·¤¿¤ê¤¹¤ë¡£ + +.I new_value +°ú¤­¿ô¤Ï¡¢¥¿¥¤¥Þ¡¼¤ÎËþλ»þ´Ö (expiration) ¤Î½é´üÃÍ¤È´Ö³Ö (interval) ¤ò +»ØÄꤹ¤ë¡£¤³¤Î°ú¤­¿ô¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë +.I itimerspec +¹½Â¤ÂÎ¤Ë¤Ï 2 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤¬¤¢¤ê¡¢³Æ¥Õ¥£¡¼¥ë¥É¤Ï +.I timespec +·¿¤Î¹½Â¤ÂΤǤ¢¤ë¡£ +.in +4n +.nf + +struct timespec { + time_t tv_sec; /* Seconds */ + long tv_nsec; /* Nanoseconds */ +}; + +struct itimerspec { + struct timespec it_interval; /* Interval for periodic timer */ + struct timespec it_value; /* Initial expiration */ +}; +.fi +.in +.PP +.I new_value.it_value +¤Ï¥¿¥¤¥Þ¡¼¤ÎËþλ»þ´Ö¤Î½é´üÃͤò¡¢ÉäȥʥÎÉäǻØÄꤹ¤ë¡£ +.I new_value.it_value +¤Î¥Õ¥£¡¼¥ë¥É¤Î¤¦¤Á¾¯¤Ê¤¯¤È¤â°ìÊý¤Ë 0 °Ê³°¤ÎÃͤòÀßÄꤹ¤ë¤È¡¢ +¥¿¥¤¥Þ¡¼¤¬³«»Ï¤µ¤ì¤ë¡£ +ξÊý¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤òÀßÄꤹ¤ë¤È¡¢¥¿¥¤¥Þ¡¼¤¬Ää»ß¤¹¤ë¡£ + +.I new_value.it_interval +¤Ï¥¿¥¤¥Þ¡¼¤Î°ì²óÌܤÎËþλ¸å¤Ë·«¤êÊÖ¤·¥¿¥¤¥Þ¡¼¤ÎËþλ´Ö³Ö¤ò¡¢ÉäȥʥÎÉäǻØÄꤹ¤ë¡£ +.I new_value.it_interval +¤Î¥Õ¥£¡¼¥ë¥É¤Î¤¦¤Á¾¯¤Ê¤¯¤È¤â°ìÊý¤Ë 0 °Ê³°¤ÎÃͤòÀßÄꤹ¤ë¤È¡¢ +·«¤êÊÖ¤·¥¿¥¤¥Þ¡¼¤¬Í­¸ú¤Ë¤Ê¤ë¡£ +ξÊý¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤òÀßÄꤷ¤¿¾ì¹ç¡¢¥¿¥¤¥Þ¡¼¤Ï +.I new_value.it_value +¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¸å¤Ë¡¢°ì²ó¤À¤±Ëþλ¤·¤ÆÄä»ß¤¹¤ë¡£ + +.I flags +°ú¤­¿ô¤Ë¤Ï 0 ¤« +.B TFD_TIMER_ABSTIME +¤ò»ØÄꤹ¤ë¡£ +0 ¤ÏÁêÂлþ¹ï¥¿¥¤¥Þ¡¼¤ò°ÕÌ£¤·¡¢ +.I new_value.it_interval +¤Ç¤Ï +.I clockid +¤Ç»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯¤Î¸½ºß¤ÎÃͤ«¤é¤ÎÁêÂÐŪ¤Ê»þ¹ï¤ò»ØÄꤹ¤ë¡£ +.B TFD_TIMER_ABSTIME +¤ÏÀäÂлþ¹ï¥¿¥¤¥Þ¡¼¤ò°ÕÌ£¤·¡¢ +.I new_value.it_interval +¤Ç¤Ï +.I clockid +¤Ç»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯¤ÎÀäÂлþ¹ï¤ò»ØÄꤹ¤ë¡£¤Ä¤Þ¤ê¡¢ +¥¯¥í¥Ã¥¯¤ÎÃͤ¬ +.I new_value.it_interval +¤Ç»ØÄꤵ¤ì¤¿»þ¹ï¤Ë㤷¤¿¤é¡¢¥¿¥¤¥Þ¡¼¤¬Ëþλ¤¹¤ë¡£ + +.I old_value +°ú¤­¿ô¤òÄ̤¸¤Æ¡¢ +.BR timerfd_settime () +¤ò¸Æ¤Ó½Ð¤·¤¿»þÅÀ¤Ç¤Î¥¿¥¤¥Þ¡¼¤ÎÀßÄê¤òÊÝ»ý¤·¤¿¹½Â¤ÂΤ¬ÊÖ¤µ¤ì¤ë¡£ +²¼µ­¤Î +.BR timerfd_gettime () +¤ÎÀâÌÀ¤ò»²¾È¡£ +.\" +.SS timerfd_gettime() +.BR timerfd_gettime () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥¿¥¤¥Þ¡¼¤Î¸½ºß¤ÎÀßÄ꤬Æþ¤Ã¤¿ +.I itimerspec +¹½Â¤ÂΤò¡¢ +.I curr_value +¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ + +.I it_value +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥¿¥¤¥Þ¡¼¤¬¼¡¤ËËþλ¤¹¤ë¤Þ¤Ç¤Î»Ä¤ê»þ´Ö¤òÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂΤÎξÊý¤Î¥Õ¥£¡¼¥ë¥É¤¬ 0 ¤Ç¤¢¤ì¤Ð¡¢¥¿¥¤¥Þ¡¼¤Ï¸½ºßÄä»ß¤·¤Æ¤¤¤ë¡£ +¥¿¥¤¥Þ¡¼ÀßÄê»þ¤Ë +.B TFD_TIMER_ABSTIME +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿¤«¤Ë´Ø¤ï¤é¤º¡¢¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¾ï¤ËÁêÂÐÃͤ¬³ÊǼ¤µ¤ì¤ë¡£ + +.I it_interval +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥¿¥¤¥Þ¡¼¤Î´Ö³Ö¤òÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂΤÎξÊý¤Î¥Õ¥£¡¼¥ë¥É¤¬ 0 ¤Ç¤¢¤ì¤Ð¡¢¥¿¥¤¥Þ¡¼¤Ï +.I new_value.it_value +¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¸å¤Ë°ì²ó¤À¤±Ëþλ¤·¤ÆÄä»ß¤¹¤ë¤è¤¦¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¡£ +.SS ¥¿¥¤¥Þ¡¼¡¦¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ëÁàºî +.BR timerfd_create () +¤¬ÊÖ¤¹¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï°Ê²¼¤ÎÁàºî¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.TP +.BR read (2) +.BR timerfd_settime () +¤ò»È¤Ã¤Æ¥¿¥¤¥Þ¡¼¤ÎÀßÄ꤬ºÇ¸åÊѹ¹¤µ¤ì¤Æ°Ê¹ß¡¢¤Þ¤¿¤Ï +.BR read (2) +¤Î¸Æ¤Ó½Ð¤·¤ËºÇ¸å¤ËÀ®¸ù¤·¤Æ°Ê¹ß¤Ë¡¢¥¿¥¤¥Þ¡¼¤ÎËþ뤬°ì²ó°Ê¾åȯÀ¸¤·¤Æ¤¤¤ì¤Ð¡¢ +.BR read (2) +¤ËÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë¡¢¥¿¥¤¥Þ¡¼Ëþλ²ó¿ô¤ò¼¨¤¹ 8 ¥Ð¥¤¥È¤Î unsigned ·¿¤ÎÀ°¿ô +.RI ( uint64_t ) +¤¬ÊÖ¤µ¤ì¤ë +(ÊÖ¤µ¤ì¤ëÃͤϥۥ¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¢¤Ä¤Þ¤ê¤½¤Î¥Û¥¹¥È¥Þ¥·¥ó¤Ë¤ª¤±¤ë +À°¿ô¤ÎÄ̾ï¤Î¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤¢¤ë)¡£ +.IP +.BR read (2) +¤ò¹Ô¤Ã¤¿»þÅÀ¤Ç¥¿¥¤¥Þ¡¼¤ÎËþλ¤¬È¯À¸¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +.BR read (2) +¤ÏÄä»ß (block) ¤¹¤ë¡¢¤â¤·¤¯¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +ÈóÄä»ß (nonblocking) ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë (ÈóÄä»ß¥â¡¼¥É¤Ë¤¹¤ë¤Ë¤Ï¡¢ +.BR fcntl (2) +¤Î +.B F_SETFL +Ì¿Îá¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë)¡£ +.IP +ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤¬ 8 ¥Ð¥¤¥È̤Ëþ¤Î¾ì¹ç¡¢ +.BR read (2) +¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.TP +.BR poll "(2), " select "(2) (¤ÈƱÍͤÎÁàºî)" +°ì¤Ä°Ê¾å¤Î¥¿¥¤¥Þ¡¼Ëþλ¤¬È¯À¸¤·¤Æ¤¤¤ì¤Ð¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÆɤ߽Ф·²Äǽ¤È¤Ê¤ë +.RB ( select (2) +¤Î +.I readfds +°ú¤­¿ô¤ä +.BR poll (2) +¤Î +.B POLLIN +¥Õ¥é¥°)¡£ +.IP +¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢Â¾¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿Â¿½Å API ¤Ç¤¢¤ë +.BR pselect (2), +.BR ppoll (2), +.BR epoll (7) +¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.TP +.BR close (2) +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¤½¤ì°Ê¹ß¤ÏɬÍפʤ¯¤Ê¤Ã¤¿ºÝ¤Ë¤Ï¡¢¥¯¥í¡¼¥º¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Ʊ¤¸ timer ¥ª¥Ö¥¸¥§¥¯¥È¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Á´¤Æ +¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¡¢¤½¤Î¥¿¥¤¥Þ¡¼¤Ï²ò½ü¤µ¤ì¡¢ +¤½¤Î¥ª¥Ö¥¸¥§¥¯¥ÈÍѤλñ¸»¤¬¥«¡¼¥Í¥ë¤Ë¤è¤ê²òÊü¤µ¤ì¤ë¡£ +.\" +.SS fork(2) ¤Ç¤Î°·¤¤ +.BR fork (2) +¤¬¹Ô¤ï¤ì¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤Ï +.BR timerfd_create () +¤Ë¤è¤êÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥³¥Ô¡¼¤ò +·Ñ¾µ¤¹¤ë¡£¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¿Æ¥×¥í¥»¥¹¤ÎÂбþ¤¹¤ë +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÈƱ¤¸¥¿¥¤¥Þ¡¼¥ª¥Ö¥¸¥§¥¯¥È¤ò»²¾È¤·¤Æ¤ª¤ê¡¢ +»Ò¥×¥í¥»¥¹¤Î +.BR read (2) +¤Ç¤âƱ¤¸¥¿¥¤¥Þ¡¼¤ÎËþλ¤Ë´Ø¤¹¤ë¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£ +.\" +.SS execve(2) ¤Ç¤Î°·¤¤ +.BR execve (2) +¤ÎÁ°¸å¤Ç +.BR timerfd_create () +¤Ë¤è¤êÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÊÝ»ý¤µ¤ì¡¢ +¥¿¥¤¥Þ¡¼¤¬³«»Ï¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¥¿¥¤¥Þ¡¼¤ÎËþλ¤¬È¯À¸¤·Â³¤±¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR timerfd_create () +¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ + +.BR timerfd_settime () +¤È +.BR timerfd_gettime () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.BR timerfd_create () +¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.I clockid +°ú¤­¿ô¤¬ +.B CLOCK_MONOTONIC +¤Ç¤â +.B CLOCK_REALTIME +¤Ç¤â¤Ê¤¤¡£ +.TP +.B EINVAL +.I flags +¤¬Ìµ¸ú¤Ç¤¢¤ë¡£¤â¤·¤¯¤Ï¡¢Linux 2.6.26 °ÊÁ°¤Î¾ì¹ç¤Ï +.I flags +¤¬ 0 °Ê³°¤Ç¤¢¤ë¡£ +.TP +.B EMFILE +¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô¤¬¥×¥í¥»¥¹¤¢¤¿¤ê¤Î¾å¸Â¤Ë +㤷¤Æ¤¤¤¿¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ëÁí¿ô¤¬¥·¥¹¥Æ¥àÁ´ÂΤξå¸Â¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENODEV +(¥«¡¼¥Í¥ëÆâ¤Î) ̵̾ inode ¥Ç¥Ð¥¤¥¹¤ò¥Þ¥¦¥ó¥È¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +¥¿¥¤¥Þ¡¼¤òºîÀ®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥«¡¼¥Í¥ë¥á¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.PP +.BR timerfd_settime () +¤È +.BR timerfd_gettime () +¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EFAULT +.IR new_value , +.IR old_value , +.I curr_value +¤¬Í­¸ú¤Ê¥Ý¥¤¥ó¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINVAL +.I fd +¤¬Í­¸ú¤Ê timerfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.PP +.BR timerfd_settime () +¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤â¤¢¤ë¡£ +.TP +.B EINVAL +.I new_value +¤¬Å¬Àڤ˽é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤ +.RI ( tv_nsec +¤Î°ì¤Ä¤¬ 0 ¤«¤é 999,999,999 ¤Þ¤Ç¤ÎÈϰϤËÆþ¤Ã¤Æ¤¤¤Ê¤¤)¡£ +.TP +.B EINVAL +.\" This case only checked since 2.6.29, and 2.2.2[78].some-stable-version. +.\" In older kernel versions, no check was made for invalid flags. +.I flags +¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.6.25 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +¥é¥¤¥Ö¥é¥ê¦¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.8 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥¿¥¤¥Þ¡¼¤òºîÀ®¤·¡¢¤½¤Î¿ÊĽ¤ò¥â¥Ë¥¿¡¼¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥×¥í¥°¥é¥à¤ÏºÇÂç¤Ç 3 ¸Ä¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ò¼è¤ê¡¢ +Âè°ì°ú¤­¿ô¤Ç¤Ï¥¿¥¤¥Þ¡¼¤ÎËþλ»þ´Ö¤Î½é´üÃÍ (Éÿôñ°Ì) ¤ò¡¢ +ÂèÆó°ú¤­¿ô¤Ç¤Ï¥¿¥¤¥Þ¡¼¤Î´Ö³Ö (Éÿôñ°Ì) ¤ò¡¢ +Âè»°°ú¤­¿ô¤Ç¤Ï¥¿¥¤¥Þ¡¼¤¬²¿²óËþλ¤·¤¿¤é¥×¥í¥°¥é¥à¤¬½ªÎ»¤¹¤ë¤«¤ò»ØÄꤹ¤ë¡£ +ÂèÆó°ú¤­¿ô¤ÈÂè»°°ú¤­¿ô¤Ï¾Êά²Äǽ¤Ç¤¢¤ë¡£ + +°Ê²¼¤Î¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥ó¤Ï¤³¤Î¥×¥í¥°¥é¥à¤Î»ÈÍÑÎã¤ò¼¨¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.in +4n +.nf + +.RB "$" " a.out 3 1 100" +0.000: timer started +3.000: read: 1; total=1 +4.000: read: 1; total=2 +.BR "^Z " " # type control-Z to suspend the program" +[1]+ Stopped ./timerfd3_demo 3 1 100 +.RB "$ " "fg" " # Resume execution after a few seconds" +a.out 3 1 100 +9.660: read: 5; total=7 +10.000: read: 1; total=8 +11.000: read: 1; total=9 +.BR "^C " " # type control-C to suspend the program" +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +.\" The commented out code here is what we currently need until +.\" the required stuff is in glibc +.\" +.\" +.\"/* Link with -lrt */ +.\"#define _GNU_SOURCE +.\"#include +.\"#include +.\"#include +.\"#if defined(__i386__) +.\"#define __NR_timerfd_create 322 +.\"#define __NR_timerfd_settime 325 +.\"#define __NR_timerfd_gettime 326 +.\"#endif +.\" +.\"static int +.\"timerfd_create(int clockid, int flags) +.\"{ +.\" return syscall(__NR_timerfd_create, clockid, flags); +.\"} +.\" +.\"static int +.\"timerfd_settime(int fd, int flags, struct itimerspec *new_value, +.\" struct itimerspec *curr_value) +.\"{ +.\" return syscall(__NR_timerfd_settime, fd, flags, new_value, +.\" curr_value); +.\"} +.\" +.\"static int +.\"timerfd_gettime(int fd, struct itimerspec *curr_value) +.\"{ +.\" return syscall(__NR_timerfd_gettime, fd, curr_value); +.\"} +.\" +.\"#define TFD_TIMER_ABSTIME (1 << 0) +.\" +.\"//////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include +#include /* Definition of uint64_t */ + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +static void +print_elapsed_time(void) +{ + static struct timespec start; + struct timespec curr; + static int first_call = 1; + int secs, nsecs; + + if (first_call) { + first_call = 0; + if (clock_gettime(CLOCK_MONOTONIC, &start) == \-1) + handle_error("clock_gettime"); + } + + if (clock_gettime(CLOCK_MONOTONIC, &curr) == \-1) + handle_error("clock_gettime"); + + secs = curr.tv_sec \- start.tv_sec; + nsecs = curr.tv_nsec \- start.tv_nsec; + if (nsecs < 0) { + secs\-\-; + nsecs += 1000000000; + } + printf("%d.%03d: ", secs, (nsecs + 500000) / 1000000); +} + +int +main(int argc, char *argv[]) +{ + struct itimerspec new_value; + int max_exp, fd; + struct timespec now; + uint64_t exp, tot_exp; + ssize_t s; + + if ((argc != 2) && (argc != 4)) { + fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\\n", + argv[0]); + exit(EXIT_FAILURE); + } + + if (clock_gettime(CLOCK_REALTIME, &now) == \-1) + handle_error("clock_gettime"); + + /* Create a CLOCK_REALTIME absolute timer with initial + expiration and interval as specified in command line */ + + new_value.it_value.tv_sec = now.tv_sec + atoi(argv[1]); + new_value.it_value.tv_nsec = now.tv_nsec; + if (argc == 2) { + new_value.it_interval.tv_sec = 0; + max_exp = 1; + } else { + new_value.it_interval.tv_sec = atoi(argv[2]); + max_exp = atoi(argv[3]); + } + new_value.it_interval.tv_nsec = 0; + + fd = timerfd_create(CLOCK_REALTIME, 0); + if (fd == \-1) + handle_error("timerfd_create"); + + if (timerfd_settime(fd, TFD_TIMER_ABSTIME, &new_value, NULL) == \-1) + handle_error("timerfd_settime"); + + print_elapsed_time(); + printf("timer started\\n"); + + for (tot_exp = 0; tot_exp < max_exp;) { + s = read(fd, &exp, sizeof(uint64_t)); + if (s != sizeof(uint64_t)) + handle_error("read"); + + tot_exp += exp; + print_elapsed_time(); + printf("read: %llu; total=%llu\\n", + (unsigned long long) exp, + (unsigned long long) tot_exp); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH ¥Ð¥° +¸½ºß¤Î¤È¤³¤í¡¢ +.\" 2.6.29 +.BR timerfd_create () +¤¬Âбþ¤·¤Æ¤¤¤ë clockid ¤Î¼ïÎà¤Ï +.BR timer_create (2) +¤è¤ê¤â¾¯¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR eventfd (2), +.BR poll (2), +.BR read (2), +.BR select (2), +.BR setitimer (2), +.BR signalfd (2), +.BR timer_create (2), +.BR timer_gettime (2), +.BR timer_settime (2), +.BR epoll (7), +.BR time (7) diff --git a/release/man2/times.2 b/release/man2/times.2 new file mode 100644 index 00000000..5b2756cd --- /dev/null +++ b/release/man2/times.2 @@ -0,0 +1,224 @@ +.\" 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 Sat Jul 24 14:29:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 961203 and 001211 and 010326 by aeb@cwi.nl +.\" Modified 001213 by Michael Haardt (michael@moria.de) +.\" Modified 13 Jun 02, Michael Kerrisk +.\" Added note on nonstandard behavior when SIGCHLD is ignored. +.\" Modified 2004-11-16, mtk, Noted that the nonconformance when +.\" SIGCHLD is being ignored is fixed in 2.6.9; other minor changes +.\" Modified 2004-12-08, mtk, in 2.6 times() return value changed +.\" 2005-04-13, mtk +.\" 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 ¥¯¥í¥Ã¥¯¿ô +.\" +.TH TIMES 2 2008-06-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +times - ¥×¥í¥»¥¹»þ´Ö¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "clock_t times(struct tms *" buf ); +.SH ÀâÌÀ +.BR times () +¤Ï¸½ºß¤Î¥×¥í¥»¥¹»þ´Ö¤ò +.I buf +¤¬»Ø¤·¤Æ¤¤¤ë +.B "struct tms" +¤Ë³ÊǼ¤¹¤ë¡£ +.I struct tms +¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct tms { + clock_t tms_utime; /* user time */ + clock_t tms_stime; /* system time */ + clock_t tms_cutime; /* user time of children */ + clock_t tms_cstime; /* system time of children */ +}; +.fi +.in +.LP +.I tms_utime +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬Ì¿Îá¤ò¼Â¹Ô¤¹¤ë¤Î¤Ë¾ÃÈñ¤·¤¿ +CPU »þ´Ö¤Ç¤¢¤ë¡£ +.I tms_stime +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¤¿¤á¤Ë¼Â¹Ô¤µ¤ì¤¿¥¿¥¹¥¯¤Ç¡¢ +¥·¥¹¥Æ¥à¤¬¾ÃÈñ¤·¤¿ CPU »þ´Ö¤Ç¤¢¤ë¡£ +.I tms_cutime +¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +½ªÎ»¤òÂԤäƤ¤¤ëÁ´¤Æ¤Î»Ò¥×¥í¥»¥¹¤Î +.I tms_utime +¤È +.I tms_cutime +¤Î¹ç·×¤Ç¤¢¤ë¡£ +.I tms_cstime +¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +½ªÎ»¤òÂԤäƤ¤¤ëÁ´¤Æ¤Î»Ò¥×¥í¥»¥¹¤Î +.I tms_stime +¤È +.I tms_cstime +¤Î¹ç·×¤Ç¤¢¤ë¡£ +.LP +½ªÎ»¤¹¤ë»Ò(µÚ¤Ó¤½¤Î»Ò¹)¥×¥í¥»¥¹¤Î»þ´Ö¤Ï +.BR wait (2) +¤ä +.BR waitpid (2) +¤¬¥×¥í¥»¥¹ ID ¤òÊÖ¤·¤¿½Ö´Ö¤Ë²Ã»»¤µ¤ì¤ë¡£ +¤Ä¤Þ¤ê¡¢»Ò¤¬¤Þ¤À½ªÎ»¤òÂԤäƤ¤¤Ê¤¤¾õÂÖ¤Ç¤Ï +¹¥×¥í¥»¥¹¤Î»þ´Ö¤Ï·è¤·¤Æ¸½¤ì¤Ê¤¤¡£ +.LP +Á´¤Æ¤Î»þ´Ö¤Ï¥¯¥í¥Ã¥¯¿ô¤ÇÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR times () +¤Ï²áµî¤Î¤¢¤ë»þÅÀ¤«¤é·Ð²á¤·¤¿¥¯¥í¥Ã¥¯¿ô (clock tick) ¤òÊÖ¤¹¡£ +¤³¤ÎÊÖ¤êÃÍ¤Ï +.I clock_t +·¿¤¬¼è¤êÆÀ¤ëÈϰϤ«¤é¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\fI(clock_t)\ \-1\fP ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.\" The only possible error is EFAULT. +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +°ìÉ䢤¿¤ê¤Î¥¯¥í¥Ã¥¯¿ô¤Ï +.in +4n + +sysconf(_SC_CLK_TCK); + +.in +¤ò»È¤Ã¤ÆÆÀ¤ë¤³¤È¤¬½ÐÍè¤ë¡£ +.PP +POSIX.1-1996 ¤Ç¤Ï¡¢\fBCLK_TCK\fP ¥·¥ó¥Ü¥ë +.RI ( +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë) ¤Ï¸Å¤¤¤â¤Î¤Ç¤¢¤ë¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +º£¤Ç¤Ï¤³¤ì¤Ï¸Å¤¤¤â¤Î¤Ç¤¢¤ë¡£ +.PP +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 °Ê¹ß¤Ç½¤Àµ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" 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 ¤Ç¤Ï¡¢ +.I buf +°ú¿ô¤Ë NULL ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¡¢¤½¤Î¾ì¹ç¤Ï +.BR times () +¤Ïñ¤Ë´Ø¿ô¤Î·ë²Ì¤òÊÖ¤¹¡£ +¤·¤«¤·¡¢POSIX ¤Ï¤³¤Î¿¶¤ëÉñ¤¤¤Ïµ¬Äꤵ¤ì¤Æ¤ª¤é¤º¡¢ +¤½¤Î¾¤Î¤Û¤È¤ó¤É¤Î Unix ¼ÂÁõ¤Ï +.I buf +¤ÎÃͤȤ·¤ÆÈó NULL ¤ÎÃͤòÍ׵᤹¤ë¡£ +.LP +.BR clock (3) +¤â +.I clock_t +·¿¤ÎÃͤòÊÖ¤¹¤¬¡¢¤³¤ÎÃÍ¤Ï +.BR times () +¤Ç»ÈÍѤµ¤ì¤ë¥¯¥í¥Ã¥¯ tick ¿ô¤Ç¤Ï¤Ê¤¯¡¢ +.B CLOCKS_PER_SEC +¤¬Ã±°Ì¤Ç¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ + +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 +.\" ¸Å¤¤¥·¥¹¥Æ¥à¤Ç¤Ï°ìÉ䢤¿¤ê¤Î¥¯¥í¥Ã¥¯¿ô¤Ï HZ ÊÑ¿ô¤ÇÍ¿¤¨¤é¤ì¤ë¡£ +.SS Îò»Ë +SVr1-3 ¤Ç¤Ï +.I long +¤òÊÖ¤·¡¢¹½Â¤ÂΤΥá¥ó¥Ð¤Ë +.I time_t +·¿¤ò»È¤Ã¤Æ¤¤¤¿¤¬¡¢µª¸µ¤«¤é¤ÎÉÿô¤Ç¤Ï¤Ê¤¯¥¯¥í¥Ã¥¯¿ô¤ò³ÊǼ¤·¤Æ¤¤¤¿¡£ +V7 ¤Ç¤Ï¹½Â¤ÂΤΥá¥ó¥Ð¤Ë +.I long +·¿¤ò»È¤Ã¤Æ¤¤¤¿¡£¤Þ¤À +.I time_t +·¿¤¬¤Ê¤«¤Ã¤¿¤«¤é¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +¤¤¤¯¤Ä¤«¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã (ÆÃ¤Ë 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 +.SH ´ØÏ¢¹àÌÜ +.BR time (1), +.BR getrusage (2), +.BR wait (2), +.BR clock (3), +.BR sysconf (3), +.BR time (7) diff --git a/release/man2/tkill.2 b/release/man2/tkill.2 new file mode 100644 index 00000000..a2099f11 --- /dev/null +++ b/release/man2/tkill.2 @@ -0,0 +1,116 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2008 Michael Kerrisk +.\" and 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. +.\" +.\" 2004-05-31, added tgkill, ahu, aeb +.\" 2008-01-15 mtk -- rewote DESCRIPTION +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved. +.\" Translated 2003-03-05, Akihiro MOTOKI +.\" Updated 2005-02-28, Akihiro MOTOKI +.\" +.TH TKILL 2 2008-10-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +tkill, tgkill \- ¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë +.SH ½ñ¼° +.nf +.BI "int tkill(int " tid ", int " sig ); +.sp +.BI "int tgkill(int " tgid ", int " tid ", int " sig ); +.fi +.SH ÀâÌÀ +.BR tgkill () +¤Ï¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥× +.I tgid +¤Ë°¤¹¤ë¥¹¥ì¥Ã¥É ID ¤¬ +.I tid +¤Î¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë +.I sig +¤òÁ÷¤ë¡£ +(¤³¤ì¤ËÂФ·¡¢ +.BR kill (2) +¤Ï°ì¤Ä¤Î¥×¥í¥»¥¹ (¤¹¤Ê¤ï¤Á¡¢¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×) ¤Ë¤Þ¤È¤á¤Æ¥·¥°¥Ê¥ë¤ò +Á÷¤ë¤Î¤Ë¤À¤±ÍøÍѤǤ­¤ë¡£ +.BR kill (2) +¤ÇÁ÷¿®¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ï¥×¥í¥»¥¹Æâ¤ÎǤ°Õ¤Î¥¹¥ì¥Ã¥É¤ËÇÛÁ÷¤µ¤ì¤ë¡£) + +.BR tkill () +¤Ï¤â¤¦»È¤ï¤ì¤Ê¤¯¤Ê¤Ã¤¿ +.BR tgkill () +¤ÎÀèÁĤǤ¢¤ë¡£ +.BR tkill () +¤Ç¤Ï¥·¥°¥Ê¥ë¤ÎÁ÷¤êÀè¤Î¥¹¥ì¥Ã¥É ID ¤·¤«»ØÄê¤Ç¤­¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢¥¹¥ì¥Ã¥É¤¬½ªÎ»¤·¤Æ¡¢¤½¤Î¥¹¥ì¥Ã¥É ID ¤¬ºÆÍøÍѤµ¤ì¤ë¾ì¹ç¤Ë¡¢ +°Õ¿Þ¤·¤Ê¤¤¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î»ÈÍѤÏÈò¤±¤ë¤³¤È¡£ + +.I tgid +¤Ë \-1 ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.BR tgkill () +¤Ï +.BR tkill () +¤ÈÅù²Á¤Ç¤¢¤ë¡£ + +¤³¤ì¤é¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ø¤ÎľÀܤΥ¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ê¡¢ +¥¹¥ì¥Ã¥É¡¦¥é¥¤¥Ö¥é¥êÆâÉô¤Ç¤Î»ÈÍѤò°Õ¿Þ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +\fIerrno\fP ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É ID¡¢¥¹¥ì¥Ã¥É¥°¥ë¡¼¥× ID¡¢¥·¥°¥Ê¥ë¤¬ÉÔÀµ¤Ç¤¢¤Ã¤¿¡£ +.TP +.B EPERM +µö²Ä¤¬¤Ê¤«¤Ã¤¿¡£¤É¤Î¤è¤¦¤Êµö²Ä¤¬É¬Íפ«¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR kill (2) +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B ESRCH +»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥ÉID (¤È¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×ID) ¤ò»ý¤Ä¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR tkill () +¤Ï Linux 2.4.19 / 2.5.4 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¡¢ +.BR tgkill () +¤Ï Linux 2.5.75 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +.BR tkill () +¤È +.BR tgkill () +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢ +°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤ÎÀâÌÀ¤Ë¤Ä¤¤¤Æ¤Ï +.BR clone (2) +¤Î +.B CLONE_THREAD +¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ + +glibc ¤Ï¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£ +.BR syscall (2) +¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR gettid (2), +.BR kill (2) diff --git a/release/man2/truncate.2 b/release/man2/truncate.2 new file mode 100644 index 00000000..1e070742 --- /dev/null +++ b/release/man2/truncate.2 @@ -0,0 +1,233 @@ +.\" 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 2009-02-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +truncate, ftruncate \- »ØÄꤷ¤¿Ä¹¤µ¤Ë¥Õ¥¡¥¤¥ë¤òÀÚ¤êµÍ¤á¤ë +.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 +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.ad l +.sp +.BR truncate (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR ftruncate (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _POSIX_C_SOURCE\ >=\ 200112L +.ad b +.SH ÀâÌÀ +.BR truncate () +¤Ï +.I path +¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¤ò¡¢ +.BR ftruncate () +¤Ï +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ò +.I length +¥Ð¥¤¥È¤ÎŤµ¤Ë¤Ê¤ë¤è¤¦¤Ë±äŤ¹¤ë¡¢¤â¤·¤¯¤ÏÀÚ¤êµÍ¤á¤ë¡£ +¤â¤·ÀÚ¤êµÍ¤á¤ëÁ°¤Î¥Õ¥¡¥¤¥ë¤¬ +.I length +¤è¤êŤ±¤ì¤Ð¡¢length ¥Ð¥¤¥È¤ò±Û¤¨¤ëÉôʬ¤Î¥Ç¡¼¥¿¤Ï¼º¤ï¤ì¤ë¡£ +¤â¤·ÀÚ¤êµÍ¤á¤ëÁ°¤Î¥Õ¥¡¥¤¥ë¤¬ +.I length +¤è¤êû¤«¤±¤ì¤Ð¡¢¿­Ä¥¤µ¤ì¤ë¡£ +¿­Ä¥¤µ¤ì¤¿Éôʬ¤òÆɤó¤À¾ì¹ç¤Ï NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤ÎÎó¤¬ÊÖ¤µ¤ì¤ë¡£ +.LP +¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.LP +Â礭¤µ¤¬Êѹ¹¤µ¤ì¤ë¤È¡¢¥Õ¥¡¥¤¥ë¤Î st_ctime ¤È st_mtime ¥Õ¥£¡¼¥ë¥É +(¤½¤ì¤¾¤ìºÇ½ª¾õÂÖÊѹ¹»þ¹ï¡¢ºÇ½ª½¤Àµ»þ¹ï; +.BR stat (2) +»²¾È) ¤¬¹¹¿·¤µ¤ì¤ë¡£ +¤Þ¤¿¡¢set-user-ID ¤È set-group-ID ¤Îµö²Ä¥Ó¥Ã¥È¤¬¥¯¥ê¥¢¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +.BR ftruncate () +¤Î¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤Ï½ñ¤­¹þ¤ßÍѤ˳«¤¤¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BR truncate () +¤Î¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤Ï½ñ¤­¹þ¤ß²Äǽ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç 0 ¤¬Ê֤롣¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤¬Ê֤ꡢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR truncate () +¤Ç¤Ï°Ê²¼¤Î¥¨¥é¡¼¥³¡¼¥É¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EACCES +¥Ñ¥¹¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸¡º÷µö²Ä¤Î¤Ê¤¤¤â¤Î¤¬¤¢¤ë +(ÌõÃí:x ¥Ó¥Ã¥È¤¬Î©¤Ã¤Æ¤¤¤Ê¤¤)¡£ +¤¢¤ë¤¤¤Ï¡¢»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.RB ( path_resolution (7) +¤â»²¾È¤Î¤³¤È) +.TP +.B EFAULT +.I path +¤¬¥×¥í¥»¥¹¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EFBIG +°ú¤­¿ô +.I length +¤¬ºÇÂç¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤è¤êÂ礭¤¤¡£(XSI) +.TP +.B EINTR +¼Â¹ÔÃæ¤Ë¥·¥°¥Ê¥ë¤ò¼õ¤±¤¿¡£ +.TP +.B EINVAL +°ú¤­¿ô +.I length +¤¬Éé¿ô¤Ç¤¢¤ë¤«¡¢ºÇÂç¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤è¤êÂ礭¤¤¡£ +.TP +.B EIO +inode ¤Î¹¹¿·»þ¤Ë I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EINTR +´°Î»ÂÔ¤Á¤ÇÄä»ß (block) ¤·¤Æ¤¤¤ë´Ö¤Ë¡¢¸Æ¤Ó½Ð¤·¤¬ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.BR fcntl (2) +¤È +.BR signal (7) +¤ò»²¾È¡£ +.TP +.B EISDIR +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¡£ +.TP +.B ELOOP +¥Ñ¥¹Ì¾¤ò²ò¼á¤¹¤ëºÝ¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Â¿¤¹¤®¤¿¡£ +.TP +.B ENAMETOOLONG +¥Ñ¥¹Ì¾Ãæ¤Î¥Ç¥£¥ì¥¯¥È¥ê̾¤¬ 255 ʸ»ú¤ò±Û¤¨¤Æ¤¤¤ë¡¢¤â¤·¤¯¤Ï¥Ñ¥¹Ì¾Á´ÂΤ¬ +1023 ʸ»ú¤ò±Û¤¨¤Æ¤¤¤ë¡£ +.TP +.B ENOENT +»ØÄꤵ¤ì¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOTDIR +¥Ñ¥¹Ì¾Ãæ¤Î¹àÌܤ˥ǥ£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¤â¤Î¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.TP +.B EPERM +.\" This happens for at least MSDOS and VFAT file systems +.\" on kernel 2.6.13 +²¼Áؤˤ¢¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¸½ºß¤Î¥Õ¥¡¥¤¥ëŤò±Û¤¨¤Æ +¥Õ¥¡¥¤¥ë¤ò¿­Ä¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.B EROFS +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ÏÆɤ߽Ф·ÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥àÃæ¤Ë¤¢¤ë¡£ +.TP +.B ETXTBSY +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.PP +.BR ftruncate () +¤Ë¤âƱÍͤΥ¨¥é¡¼¤¬Å¬ÍѤµ¤ì¤ë¡£ +⤷¡¢ +.I path +¤Ë´Ø¤¹¤ë¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.I fd +¤Ë´Ø¤¹¤ë¥¨¥é¡¼¤È¤Ê¤ë¡£ +.TP +.B EBADF +.I fd +¤¬Ìµ¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤¢¤ë¡£ +.TP +.BR EBADF " ¤Þ¤¿¤Ï " EINVAL +.I fd +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¤â¤Î¤¬½ñ¤­¹þ¤ß¥â¡¼¥É¤Ç³«¤«¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EINVAL +.I fd +¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +4.4BSD, SVr4, POSIX.1-2001 (¤³¤ì¤é¤Î¥³¡¼¥ë¤Ï 4.2BSD ¤Ç½é¤á¤ÆÅо줷¤¿)¡£ +.\" POSIX 1003.1-1996 ¤Ë¤Ï +.\" .BR ftruncate () +.\" ¤¬¤¢¤ë¡£ +.\" POSIX.1-2001 ¤Ë¤Ï +.\" XSI ³ÈÄ¥¤È¤·¤Æ +.\" .BR truncate () +.\" ¤â¤¢¤ë¡£ +.\" .LP +.\" SVr4 ¤Ë¤Ï¾¤Î¥¨¥é¡¼¥³¡¼¥É¤È¤·¤Æ¡¢ +.\" .BR truncate () +.\" ¤Ë¤Ï EMFILE, EMULTIHP, ENFILE, ENOLINK ¤¬¡¢ +.\" .BR ftruncate () +.\" ¤Ë¤Ï EAGAIN ¤¬¤½¤ì¤¾¤ìµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +¾åµ­¤Îµ­½Ò¤Ï XSI ½àµò¤Î¥·¥¹¥Æ¥à¤Î¤â¤Î¤Ç¤¢¤ë¡£ +XSI Èó½àµò¤Î¥·¥¹¥Æ¥à¤Î¾ì¹ç¡¢POSIX ɸ½à¤Ï +.BR ftruncate () +¤ËÂФ·¤Æ +.I length +¤¬¥Õ¥¡¥¤¥ë¤ÎŤµ¤è¤êŤ«¤Ã¤¿¾ì¹ç¡¢ +¥¨¥é¡¼¤òÊÖ¤¹¤«¥Õ¥¡¥¤¥ë¤ò¿­Ä¥¤¹¤ë¤«¤ÎÆó¤Ä¤ÎÆ°ºî¤òµöÍƤ·¤Æ¤¤¤ë¡£ +.BR truncate () +¤ËÂФ·¤Æ¤ÏÁ´¤¯µ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤Û¤È¤ó¤É¤Î Unix ¼ÂÁõ¤ÈƱÍÍ¡¢Linux ¤Ï¥Í¥¤¥Æ¥£¥Ö (Linux ͳÍè) ¤Î +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î°·¤¤¤Ç¤Ï XSI Í×µá»ÅÍͤˤ·¤¿¤¬¤Ã¤Æ¤¤¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¤¤¤¯¤Ä¤«¤ÎÈó¥Í¥¤¥Æ¥£¥Ö¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR truncate () +¤ä +.BR ftruncate () +¤ò»È¤Ã¤Æ¸½ºß¤Î¥Õ¥¡¥¤¥ëŤò±Û¤¨¤Æ¥Õ¥¡¥¤¥ë¤ò¿­Ä¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +Linux ¤Ç¤Îͭ̾¤ÊÎã¤È¤·¤Æ¤Ï VFAT ¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR open (2), +.BR stat (2), +.BR path_resolution (7) diff --git a/release/man2/umask.2 b/release/man2/umask.2 new file mode 100644 index 00000000..033ffed5 --- /dev/null +++ b/release/man2/umask.2 @@ -0,0 +1,130 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 2006, 2008, Michael Kerrisk (mtk.manpages@gmail.com) +.\" (A few fragments remain from an earlier (1992) version written in +.\" 1992 by Drew Eckhardt .) +.\" +.\" 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 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 +.\" 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 +.\" +.TH UMASK 2 2008-01-09 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +umask \- ¥Õ¥¡¥¤¥ë¥â¡¼¥ÉºîÀ®¥Þ¥¹¥¯¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "mode_t umask(mode_t " mask ); +.SH ÀâÌÀ +.BR umask () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥â¡¼¥ÉºîÀ®¥Þ¥¹¥¯ (umask) ¤ò +.I mask +& 0777 ¤ËÀßÄꤷ +.RI ( umask +¤Î¥Õ¥¡¥¤¥ëµö²Ä¤ËÂбþ¤¹¤ë¥Ó¥Ã¥È¤Î¤ß¤ò»ÈÍѤ¹¤ë)¡¢ +Êѹ¹Á°¤Î¥Þ¥¹¥¯ÃͤòÊÖ¤¹¡£ + +umask ¤Ï¡¢ +.BR open (2), +.BR mkdir (2) +¤ä¥Õ¥¡¥¤¥ëºîÀ®¤ò¹Ô¤¦¤½¤Î¾¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢ +.\" Î㤨¤Ð mkfifo(), creat(), mknod(), sem_open(), mq_open(), shm_open() +.\" System V IPC *get() ¥³¡¼¥ë¤Ï³ºÅö¤·¤Ê¤¤¡£ +¿·¤·¤¯ºîÀ®¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤Îµö²Ä (permission) ¤ò +½¤Àµ¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +¶ñÂÎŪ¤Ë¤Ï umask ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ëµö²Ä¤¬ +.BR open (2) +¤ä +.BR mkdir (2) +¤Î \fImode\fP °ú¤­¿ô¤«¤é¼è¤ê¾Ã¤µ¤ì¤ë¡£ + +.I mask +¤Ë»ØÄꤹ¤ë¤Î¤Ë»ÈÍѤ¹¤Ù¤­Äê¿ô¤Ë¤Ä¤¤¤Æ¤Ï +.BR stat (2) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ + +¥×¥í¥»¥¹¤Î umask ¤Î¤è¤¯¤¢¤ë¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï +.I S_IWGRP\ |\ S_IWOTH +(8¿Ê¤Ç 022) ¤Ç¤¢¤ë¡£ +¿·¤·¤¤¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ëºÝ¤Ë +.BR open (2) +¤Î +.I mode +°ú¤­¿ô¤Ë +.nf + + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH +.fi +¤ò»ØÄꤹ¤ë¤È¤¤¤¦¤è¤¯¤¢¤ë¥±¡¼¥¹¤Ç¤Ï¡¢ºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï +.nf + + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH + +.fi +¤È¤¤¤¦µö²Ä¤ò»ý¤Ä¤³¤È¤Ë¤Ê¤ë +(¤Ê¤¼¤Ê¤é 0666 & ~022 = 0644¡¢¤Ä¤Þ¤ê rw\-r\-\-r\-\-)¡£ +.SH ÊÖ¤êÃÍ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ïɬ¤ºÀ®¸ù¤·¡¢°ÊÁ°¤Î umask ÃͤòÊÖ¤¹¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Î umask ¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤Ë¤è¤Ã¤Æ umask ¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ + +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 ¥ª¥Ö¥¸¥§¥¯¥È¤ËÀßÄꤵ¤ì¤ëµö²Ä¤Ë¤Ï +±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR chmod (2), +.BR mkdir (2), +.BR open (2), +.BR stat (2) +.\" FIXME . eventually: .BR acl (5) diff --git a/release/man2/umount.2 b/release/man2/umount.2 new file mode 100644 index 00000000..38a653ac --- /dev/null +++ b/release/man2/umount.2 @@ -0,0 +1,182 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1993 Rickard E. Faith +.\" and Copyright (C) 1994 Andries E. Brouwer +.\" and Copyright (C) 2002, 2005 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. +.\" +.\" 2008-10-06, mtk: Created this as a new page by splitting +.\" umount/umount2 material out of mount.2 +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-11-20, Akihiro MOTOKI , LDP v3.13 +.\" +.TH UMOUNT 2 2009-09-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +umount, umount2 \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥¢¥ó¥Þ¥¦¥ó¥È¤¹¤ë +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int umount(const char *" target ); +.sp +.BI "int umount2(const char *" target ", int " flags ); +.fi +.SH ÀâÌÀ +.BR umount () +¤È +.BR umount2 () +¤Ï +.I target +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë (ºÇ¾å°Ì¤Î) ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò³°¤¹¡£ +.\" Note: the kernel naming differs from the glibc naming +.\" umount2 is the glibc name for what the kernel now calls umount +.\" and umount is the glibc name for oldumount + +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¢¥ó¥Þ¥¦¥ó¥È¤ò¹Ô¤¦¤Ë¤Ï¡¢ +ŬÀڤʸ¢¸Â (Linux ¤Ç¤Ï +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤¬É¬ÍפǤ¢¤ë¡£ + +Linux 2.1.116 ¤«¤é¡¢ +.BR umount2 () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Äɲ䵤줿¡£¤³¤ì¤Ï +.BR umount () +¤ÈƱÍÍ¤Ë +.I target +¤ò¥¢¥ó¥Þ¥¦¥ó¥È¤¹¤ë¤¬¡¢ +.I flags +¤¬Äɲ䵤ì¤Æ¤ª¤ê¡¢Áàºî»þ¤Î¿¶¤ëÉñ¤¤¤òÀ©¸æ¤Ç¤­¤ë¡£ +.TP +.BR MNT_FORCE " (2.1.116 °Ê¹ß)" +»ÈÍÑÃæ (busy) ¤Ç¤â¶¯À©Åª¤Ë¥¢¥ó¥Þ¥¦¥ó¥È¤ò¼Â¹Ô¤¹¤ë¡£ +¤³¤ì¤ò¹Ô¤¦¤È¥Ç¡¼¥¿¤ò¼º¤¦²ÄǽÀ­¤¬¤¢¤ë¡£ +(NFS ¥Þ¥¦¥ó¥ÈÀìÍÑ) +.TP +.BR MNT_DETACH " (2.4.11 °Ê¹ß)" +Ãٱ䥢¥ó¥Þ¥¦¥ó¥È¤ò¹Ô¤¦¡£¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ËÂФ¹¤ë¿·µ¬¤Î¥¢¥¯¥»¥¹¤Ï +ÉÔ²Äǽ¤È¤Ê¤ê¡¢¼ÂºÝ¤Î¥¢¥ó¥Þ¥¦¥ó¥È¤Ï¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤¬¥Ó¥¸¡¼¤Ç +¤Ê¤¯¤Ê¤Ã¤¿»þÅÀ¤Ç¹Ô¤¦¡£ +.TP +.BR MNT_EXPIRE " (Linux 2.6.8 °Ê¹ß)" +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë´ü¸ÂÀÚ¤ì¤Î°õ¤ò¤Ä¤±¤ë¡£ +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤¬¸½ºß»ÈÍÑÃæ¤Ç¤Ê¤¤¾ì¹ç¡¢¤³¤Î¥Õ¥é¥°¤ò¤Ä¤±¤Æ +.BR umount2 () +¤ò½é¤á¤Æ¸Æ¤Ó½Ð¤¹¤È +.B EAGAIN +¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¤¬¡¢¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë¤Ï´ü¸ÂÀÚ¤ì (expire) +¤Î°õ¤¬¤Ä¤±¤é¤ì¤ë¡£ +¤½¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ï¤¤¤º¤ì¤«¤Î¥×¥í¥»¥¹¤¬¥¢¥¯¥»¥¹¤·¤Ê¤¤¸Â¤ê +´ü¸ÂÀÚ¤ì¤Î°õ¤¬¤Ä¤¤¤¿¤Þ¤Þ¤È¤Ê¤ë¡£ +¤â¤¦°ìÅÙ +.B MNT_EXPIRE +¤ò¤Ä¤±¤Æ +.BR umount2 () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢´ü¸ÂÀÚ¤ì¤Î°õ¤Î¤Ä¤¤¤¿¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤¬ +¥¢¥ó¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò +.B MNT_FORCE +¤â¤·¤¯¤Ï +.B MNT_DETACH +¤ÈƱ»þ¤Ë»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç 0 ¤¬Ê֤롣 +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬Ê֤ꡢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤˤ·¤¿¤¬¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +°Ê²¼¤Ë¼¨¤¹¥¨¥é¡¼¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¿¥¤¥×¤Ë¤Ï¸ÇÍ­¤Î¥¨¥é¡¼¤¬Â¸ºß¤¹¤ë¾ì¹ç¤¬¤¢¤ê¡¢ +Æȼ«¤ÎÆ°ºî¤ò¤¹¤ë¤³¤È¤â¤¢¤ë¡£¾Ü¤·¤¯¤Ï¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¤ò¸«¤ÆÍߤ·¤¤¡£ +.TP +.B EAGAIN +.B MNT_EXPIRE +¤ò»ØÄꤷ¤¿ +.BR umount2 () +¤Î¸Æ¤Ó½Ð¤·¤Ç¡¢Àµ¾ï¤Ë̤»ÈÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë´ü¸ÂÀÚ¤ì¤Î°õ¤ò +¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤¿¡£ +.TP +.B EBUSY +»ÈÍÑÃæ (busy) ¤Î¤¿¤á¡¢ +.I target +¤ò¥¢¥ó¥Þ¥¦¥ó¥È¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EFAULT +.I target +¤¬¥æ¡¼¥¶¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I target +¤¬¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤Ï¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.BR umount2 () +¤Ç¡¢ +.B MNT_EXPIRE +¤¬»ØÄꤵ¤ì¤¿ +.BR umount2 () +¤Ç¡¢ +.B MNT_DETACH +¤« +.B MNT_FORCE +¤¬Æ±»þ¤Ë»ØÄꤵ¤ì¤¿¡£ +.TP +.B ENAMETOOLONG +¥Ñ¥¹Ì¾¤ÎŤµ¤¬ +.B MAXPATHLEN +¤è¤êŤ«¤Ã¤¿¡£ +.TP +.B ENOENT +¥Ñ¥¹Ì¾¤¬¶õ¤Ç¤¢¤ë¡£¤â¤·¤¯¤Ï»ØÄꤵ¤ì¤¿¥Ñ¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOMEM +¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë̾¤ä¥Ç¡¼¥¿¤ò¥³¥Ô¡¼¤¹¤ë¤¿¤á¤Î¶õ¤­¥Ú¡¼¥¸¤ò³ÎÊݤǤ­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¤¬É¬Íפʸ¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=10092 +.BR MNT_DETACH +¤È +.BR MNT_EXPIRE +¤Ï¥Ð¡¼¥¸¥ç¥ó 2.11 °Ê¹ß¤Î glibc ¤Ç¤Î¤ßÍøÍѤǤ­¤ë¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï Linux ¸ÇÍ­¤Î´Ø¿ô¤Ç¤¢¤ê¡¢°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +»ÈÍѤ¹¤Ù¤­¤Ç¤Ê¤¤¡£ +.SH Ãí°Õ +¸µ¡¹¤Î +.BR umount () +´Ø¿ô¤Ï \fIumount(device)\fP ¤Î·Á¤Ç¸Æ¤Ó½Ð¤µ¤ì¡¢ +¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹°Ê³°¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤¹¤È +.B ENOTBLK +¤òÊÖ¤·¤¿¡£ +Linux 0.98p4 ¤Ç¡¢ÌµÌ¾¥Ç¥Ð¥¤¥¹ (anonymous device) ¤ËÂбþ¤¹¤ë¤¿¤á¤Ë +\fIumount(dir)\fP ¤Î·Á¤Ç¤Î¸Æ¤Ó½Ð¤·¤¬²Ã¤¨¤é¤ì¤¿¡£ +Linux 2.3.99-pre7 ¤Ç¡¢\fIumount(device)\fP ¤Ïºï½ü¤µ¤ì¡¢ +\fIumount(dir)\fP ¤À¤±¤¬»Ä¤µ¤ì¤¿ +(°ì¤Ä¤Î¥Ç¥Ð¥¤¥¹¤òÊ£¿ô¤Î°ÌÃ֤˥ޥ¦¥ó¥È½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤¿¤á¡¢ +¥Ç¥Ð¥¤¥¹¤ò»ØÄꤷ¤¿¤À¤±¤Ç¤ÏÉÔ½½Ê¬¤À¤«¤é¤Ç¤¢¤ë)¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mount (2), +.BR path_resolution (7), +.BR mount (8), +.BR umount (8) diff --git a/release/man2/uname.2 b/release/man2/uname.2 new file mode 100644 index 00000000..145f3aae --- /dev/null +++ b/release/man2/uname.2 @@ -0,0 +1,167 @@ +.\" 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. +.\" +.\" 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" +.SH ̾Á° +uname \- ¸½ºß²ÔƯÃæ¤Î¥«¡¼¥Í¥ë¤Ë¤Ä¤¤¤Æ¤Î̾Á°¤È¾ðÊó¤òÆÀ¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int uname(struct utsname *" buf ); +.SH ÀâÌÀ +.BR uname () +¤Ï +.I buf +¤Ç»Ø¤µ¤ì¤ë¹½Â¤ÂΤ˥·¥¹¥Æ¥à¾ðÊó¤òÊÖ¤¹¡£ +.I utsname +¹½Â¤ÂÎ¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.in +4n +.nf + +struct utsname { + char sysname[]; /* OS ¤Î̾Á° (Îã: "Linux") */ + char nodename[]; /* ¡Ö¼ÂÁõ»þ¤ËÄêµÁ¤µ¤ì¤¿¡¢²¿¤é¤«¤Î + ¥Í¥Ã¥È¥ï¡¼¥¯¡×¤Ë¤ª¤±¤ë¥Þ¥·¥ó̾ */ + char release[]; /* OS ¤Î¥ê¥ê¡¼¥¹ (Îã: "2.6.28") */ + char version[]; /* OS ¤Î¥Ð¡¼¥¸¥ç¥ó */ + char machine[]; /* ¥Ï¡¼¥É¥¦¥§¥¢¼±ÊÌ»Ò */ +#ifdef _GNU_SOURCE + char domainname[]; /* NIS ¤ä YP ¤Î¥É¥á¥¤¥ó̾ */ +#endif +}; + +.fi +.in +.I struct utsname +¤Ë¤¢¤ëÇÛÎó¤ÎŤµ¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤ (¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È)¡£ +¥Õ¥£¡¼¥ë¥É¤Ï NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç 0 ¤¬Ê֤롣¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤¬Ê֤ꡢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I buf +¤¬Í­¸ú¤Ç¤Ê¤¤¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +4.3BSD ¤Ë¤Ï +.BR uname () +¥³¡¼¥ë¤¬¤Ê¤¤¡£ +.PP +.I domainname +¥á¥ó¥Ð¡¼ (NIS ¤Þ¤¿¤Ï YP ¥É¥á¥¤¥ó̾) ¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¤³¤ì¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ê¡¢OS ¤Ï̾Á°¡¦¥ê¥ê¡¼¥¹¡¦¥Ð¡¼¥¸¥ç¥ó¤Ê¤É¤ò +¤¿¤Ö¤óʬ¤«¤Ã¤Æ¤¤¤ë¤À¤í¤¦¡£ +¤µ¤é¤Ë¤½¤ì¤¬²ÔƯ¤·¤Æ¤¤¤ë¥Ï¡¼¥É¥¦¥§¥¢¤âʬ¤«¤Ã¤Æ¤¤¤ë¤À¤í¤¦¡£ +¤è¤Ã¤Æ¹½Â¤ÂΤΠ4 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï°ÕÌ£¤¬¤¢¤ë¡£ +°ìÊý¡¢\fInodename\fP ¥Õ¥£¡¼¥ë¥É¤Ë¤Ï°ÕÌ£¤¬¤Ê¤¤: +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¸½ºß¤Î¥Þ¥·¥ó¤Î (ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤) +¤É¤³¤«¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤Ë¤ª¤±¤ë̾Á°¤òÍ¿¤¨¤ë¤¬¡¢ +Ä̾ï¥Þ¥·¥ó¤ÏÊ£¿ô¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤Ë°¤·¡¢Ê£¿ô¤Î̾Á°¤ò»ý¤Ä¡£ +¤µ¤é¤Ë¡¢¥«¡¼¥Í¥ë¤Ï¤³¤Î¤è¤¦¤Ê¾ðÊó¤òÃΤë½Ñ¤ò»ý¤¿¤Ê¤¤¤Î¤Ç¡¢ +¤³¤³¤Ç¤ÎÅú¤¨¤ÏÁ°¤â¤Ã¤Æ¶µ¤¨¤Æ¤ä¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤ÏÄɲåե£¡¼¥ë¥É¤Ç¤¢¤ë \fIdomainname\fP ¤Ë¤Ä¤¤¤Æ¤âƱÍͤǤ¢¤ë¡£ +.LP +¤³¤Î¤¿¤á Linux ¤Ç¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR sethostname (2) +¤È +.BR setdomainname (2) +¤¬»È¤ï¤ì¤ë¡£ +.RB ¡Ö sethostname (2) +¤ÇÀßÄꤵ¤ì¤ë¥Û¥¹¥È̾¤Ï¡¢ +.BR uname () +¤ÇÊÖ¤µ¤ì¤ë¹½Â¤ÂΤΠ\fInodename\fP ¥Õ¥£¡¼¥ë¥É¤ÈƱ¤¸Ê¸»úÎó¤Ç¤¢¤ë¡× +¤Èµ¬Äꤷ¤Æ¤¤¤ëɸ½àµ¬³Ê¤Ï¤Ê¤¤ +(¼ÂºÝ¡¢256 ¥Ð¥¤¥È¤Î¥Û¥¹¥È̾¤È 8 ¥Ð¥¤¥È¤Î¥Î¡¼¥É̾¤òµö²Ä¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë)¡£ +¤·¤«¤·¡¢Linux ¤Ç¤ÏƱ¤¸Ê¸»úÎó¤¬ÊÖ¤µ¤ì¤ë¡£ +.BR setdomainname (2) +¤È \fIdomainname\fP ¥Õ¥£¡¼¥ë¥É¤Ë¤Ä¤¤¤Æ¤âƱ¤¸¤³¤È¤¬À®¤êΩ¤Ä¡£ +.LP +¹½Â¤ÂΤΥե£¡¼¥ë¥É¤ÎŤµ¤Ï¤µ¤Þ¤¶¤Þ¤Ç¤¢¤ë¡£ +OS ¤ä¥é¥¤¥Ö¥é¥ê¤ÎÃæ¤Ë¤Ï¡¢ +¥Ï¡¼¥É¥³¡¼¥É¤µ¤ì¤¿ 9, 33, 65, 257 ¤Ê¤É¤ÎÃͤò»È¤Ã¤Æ¤¤¤ë¤â¤Î¤â¤¢¤ë¡£ +¤Þ¤¿ +.BR SYS_NMLN , +.BR _SYS_NMLN , +.BR UTSLEN , +.B _UTSNAME_LENGTH +¤Ê¤É¤ò»È¤Ã¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +¤Ï¤Ã¤­¤ê¸À¤Ã¤Æ¡¢¤³¤ì¤é¤ÎÄê¿ô¤ò»È¤¦¤Î¤Ï°­¤¤¹Í¤¨Êý¤Ç¤¢¤ê¡¢ +sizeof(...) ¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Û¥¹¥È̾¤Ç»È¤¦Îΰè¤ò»ý¤¿¤»¤ë¤¿¤á¤Ë¡¢ +257 ¤¬Áª¤Ð¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ +.LP +utsname ¤Î¾ðÊó¤Ï¡¢ +.IR /proc/sys/kernel/ { ostype , +.IR hostname , +.IR osrelease , +.IR version , +.IR domainname } +¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.SS Çظå¤Î¥«¡¼¥Í¥ë¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.LP +»þ´Ö¤Î·Ð²á¤È¤È¤â¤Ë¡¢ +.I utsname +¹½Â¤ÂΤΥµ¥¤¥º¤¬Â礭¤¯¤Ê¤ê¡¢¤³¤Î±Æ¶Á¤Ç +.BR uname () +¤Ë¤Ï 3¤Ä¤Î¥Ð¡¼¥¸¥ç¥ó¤¬Â¸ºß¤¹¤ë: +.IR sys_olduname () +(¥¹¥í¥Ã¥È¤Ï +.IR __NR_oldolduname )¡¢ +.IR sys_uname () +(¥¹¥í¥Ã¥È¤Ï +.IR __NR_olduname )¡¢ +.IR sys_newuname () +(¥¹¥í¥Ã¥È¤Ï +.IR __NR_uname )¡£ +.IR sys_olduname () +.\" ¤³¤ì¤Ï Linux 1.0 ¤è¤êÁ°¤ËÁ̤ëÏäǤ¢¤ë¡£ +¤Ï¤¹¤Ù¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤¬Ä¹¤µ 9 ¤ò»È¤Ã¤Æ¤¤¤¿¡£ +.IR sys_uname () +.\" ¤³¤ì¤â Linux 1.0 ¤è¤êÁ°¤ËÁ̤ëÏäǤ¢¤ë¡£ +¤ÏŤµ 65 ¤ò»È¤Ã¤Æ¤¤¤¿¡£ +.IR sys_newuname () +¤âŤµ 65 ¤ò»È¤Ã¤Æ¤¤¤ë¤¬¡¢ +\fIdomainname\fP ¥Õ¥£¡¼¥ë¥É¤¬Äɲ䵤ì¤Æ¤¤¤ë¡£ +glibc ¤Î +.BR uname () +¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¤³¤ì¤é¤Î¾ÜºÙ¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é±£Êä·¡¢ +¥«¡¼¥Í¥ë¤¬Ä󶡤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¤¦¤ÁºÇ¿·¤Î¥Ð¡¼¥¸¥ç¥ó¤òµ¯Æ°¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR uname (1), +.BR getdomainname (2), +.BR gethostname (2) diff --git a/release/man2/unimplemented.2 b/release/man2/unimplemented.2 new file mode 100644 index 00000000..6f0bcd45 --- /dev/null +++ b/release/man2/unimplemented.2 @@ -0,0 +1,68 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. +.\" +.\" 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. +.\" +.\" 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" +.SH ̾Á° +afs_syscall, break, ftime, getpmsg, gtty, lock, madvise1, mpx, prof, profil, +putpmsg, security, stty, tuxcall, ulimit, vserver \- ¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥¹¥Æ¥à¥³¡¼¥ë +.SH ½ñ¼° +¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥¹¥Æ¥à¥³¡¼¥ë +.SH ÀâÌÀ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6.22 ¥«¡¼¥Í¥ë¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¾ï¤Ë \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.BR ENOSYS +¤òÀßÄꤹ¤ë¡£ +.SH Ãí°Õ +.BR ftime (3), +.BR profil (3), +.BR ulimit (3) +¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ + +.BR alloc_hugepages (2), +.BR free_hugepages (2), +.BR ioperm (2), +.BR iopl (2), +.BR vm86 (2) +¤Î¤è¤¦¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÆÃÄê¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤Î¤ß¸ºß¤¹¤ë¡£ + +.BR ipc (2), +.BR create_module (2), +.BR init_module (2), +.BR delete_module (2) +¤Î¤è¤¦¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¥«¡¼¥Í¥ë¤¬¤½¤ì¤é¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤è¤¦ +¤Ë¹½ÃÛ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ß¸ºß¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR syscalls (2) diff --git a/release/man2/unlink.2 b/release/man2/unlink.2 new file mode 100644 index 00000000..5dfeec37 --- /dev/null +++ b/release/man2/unlink.2 @@ -0,0 +1,180 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Ian Jackson. +.\" +.\" 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 1996-09-08 by Arnt Gulbrandsen +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2001-05-17 by aeb +.\" Modified 2004-06-23 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Fri Dec 12 00:42:31 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Tue Sep 5 02:03:33 JST 2000 +.\" by Yuichi SATO +.\" Modified Sat Jun 2 08:48:36 JST 2001 by Yuichi SATO +.\" Modified Sun Jul 7 02:58:51 JST 2002 by Yuichi SATO +.\" Updated & Modified Sun Jan 9 23:28:11 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: file system ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.\"WORD: link ¥ê¥ó¥¯ +.\"WORD: open ¥ª¡¼¥×¥ó +.\"WORD: close ¥¯¥í¡¼¥º +.\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\"WORD: socket ¥½¥±¥Ã¥È +.\"WORD: device ¥Ç¥Ð¥¤¥¹ +.\"WORD: effective UID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: sticky-bit ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È +.\"WORD: dangling symbolic link ²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ +.\"WORD: memory ¥á¥â¥ê +.\"WORD: protocol ¥×¥í¥È¥³¥ë +.\" +.TH UNLINK 2 2004-06-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +unlink \- ̾Á°¤òºï½ü¤·¡¢¾ì¹ç¤Ë¤è¤Ã¤Æ¤Ï¤½¤ì¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤âºï½ü¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int unlink(const char *" pathname ); +.SH ÀâÌÀ +.BR unlink () +¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î̾Á°¤òºï½ü¤¹¤ë¡£ +¤â¤·¤½¤Î̾Á°¤¬¥Õ¥¡¥¤¥ë¤Ø¤ÎºÇ¸å¤Î¥ê¥ó¥¯ (link) ¤Ç¤¢¤ê¡¢ +¤É¤Î¥×¥í¥»¥¹¤â¤½¤Î¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó (open) ¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +¥Õ¥¡¥¤¥ë¤Ïºï½ü¤µ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬»ÈÍѤ·¤Æ¤¤¤¿¥Ç¥£¥¹¥¯¾å¤ÎÎΰè¤ÏºÆÍøÍѤ¬²Äǽ¤Ë¤Ê¤ë¡£ + +¤â¤·ºï½ü¤¹¤ë̾Á°¤¬¥Õ¥¡¥¤¥ë¤Ø¤ÎºÇ¸å¤Î¥ê¥ó¥¯¤À¤¬¡¢¤É¤ì¤«¤Î¥×¥í¥»¥¹¤¬ +¤½¤Î¥Õ¥¡¥¤¥ë¤ò¤Þ¤À¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ëºÇ¸å¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ (file descriptor) +¤¬¥¯¥í¡¼¥º (close) ¤µ¤ì¤ë¤Þ¤Ç¥Õ¥¡¥¤¥ë¤Ï¸ºß¤·Â³¤±¤ë¡£ + +¤â¤·¤½¤Î̾Á°¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ (symbolic link) ¤ò»²¾È¤·¤Æ¤¤¤ì¤Ð¡¢ +¥ê¥ó¥¯¤Ïºï½ü¤µ¤ì¤ë¡£ + +¤â¤·Ì¾Á°¤¬¥½¥±¥Ã¥È (socket) ¤ä fifo ¤ä¥Ç¥Ð¥¤¥¹ (device) ¤ò»²¾È¤·¤Æ¤¤¤ì¤Ð +̾Á°¤Ïºï½ü¤µ¤ì¤ë¤¬¤½¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¥ª¡¼¥×¥ó¤·¤Æ¤¤¤¿¥×¥í¥»¥¹¤Ï +¤½¤ì¤ò»È¤¤Â³¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Ê¤é¤Ð \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.I pathname +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¥×¥í¥»¥¹¤Î¼Â¸ú (effective) +¥æ¡¼¥¶¡¼ ID ¤ËÍ¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +.I pathname +¤ÎÃæ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.BR EBUSY " (Linux °Ê³°)" +¥Õ¥¡¥¤¥ë +.I pathname +¤¬¥·¥¹¥Æ¥à¤Þ¤¿¤Ï¾¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤Æ +¥ê¥ó¥¯¤¬ºï½ü¤Ç¤­¤Ê¤«¤Ã¤¿¤Î¤Ç¡¢¤³¤Î¼ÂÁõ¤Ç¤Ï¥¨¥é¡¼¤È¤·¤¿¡£ +.TP +.B EFAULT +.I pathname +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EIO +I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EISDIR +.I pathname +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +(¤³¤ì¤Ï POSIX ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤Ãͤǡ¢Linux 2.1.132 °Ê¹ß¤ÇÊÖ¤µ¤ì¤ë¡£) +.TP +.B ELOOP +.I pathname +¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£ +.TP +.B ENAMETOOLONG +.IR pathname " ¤¬Ä¹²á¤®¤ë¡£" +.TP +.B ENOENT +.I pathname +¤ËÂбþ¤¹¤ë¤â¤Î¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¤«¡¢ +.I pathname +¤¬¶õ¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +½½Ê¬¤Ê¥«¡¼¥Í¥ë (kernel) ¤Î¥á¥â¥ê¡¼¤¬»ÈÍѤǤ­¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I pathname +¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¡¢¼ÂºÝ¤Ë¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.TP +.B EPERM +¥·¥¹¥Æ¥à¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ¹¤ë unlink Áàºî¤òµö²Ä¤·¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ¹¤ë unlink Áàºî¤Î¤¿¤á¤ËɬÍפÊÆø¢¤ò +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +(¤³¤ì¤Ï POSIX ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤ÎÊÖ¤·Êý¤Ç¤¢¤ë¡£ +¾å½Ò¤ÎÄ̤ꡢ¤³¤Î¾ì¹ç¤Ë¤Ï Linux ¤Ï +.B EISDIR +¤òÊÖ¤¹¡£) +.TP +.BR EPERM " (Linux ¤Î¤ß)" +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë unlink Áàºî¤òµö¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.BR EPERM " ¤Þ¤¿¤Ï " EACCES +.I pathname +¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È (sticky-bit) +.RB ( S_ISVTX ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¡¢¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ºï½ü¤·¤è¤¦¤È¤¹¤ë¥Õ¥¡¥¤¥ë¤Î +UID ¤Ç¤â¤½¤ì¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¤â¤Î¤Ç¤â¤Ê¤¯¡¢ +¤«¤Ä¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¤ (Linux ¤Ç¤Ï +.B CAP_FOWNER +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¤Ê¤¤)¡£ +.TP +.B EROFS +.I pathname +¤¬Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\" SVr4 ¤Ë¤Ï¾¤Ë EINTR, EMULTIHOP, ETXTBSY, ENOLINK ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Î +.\" µ­½Ò¤¬¤¢¤ë¡£ +.SH ¥Ð¥° +NFS ¥×¥í¥È¥³¥ë (protocol) ¤ÎÀøºßŪ¤ÊÉÔÎɤˤè¤ê¡¢ +¤Þ¤À»ÈÍÑÃæ¤Î¥Õ¥¡¥¤¥ë¤ÎÆÍÁ³¤Î¾ÃÌǤò°ú¤­µ¯¤³¤¹¤³¤È¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR rm (1), +.BR chmod (2), +.BR link (2), +.BR mknod (2), +.BR open (2), +.BR rename (2), +.BR rmdir (2), +.BR unlinkat (2), +.BR mkfifo (3), +.BR remove (3), +.BR path_resolution (7), +.BR symlink (7) diff --git a/release/man2/unlinkat.2 b/release/man2/unlinkat.2 new file mode 100644 index 00000000..03f757e8 --- /dev/null +++ b/release/man2/unlinkat.2 @@ -0,0 +1,158 @@ +.\" 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-08-24 by Yuichi SATO , LDP v2.39 +.\" +.TH UNLINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +unlinkat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê¤òºï½ü¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int unlinkat(int " dirfd ", const char *" pathname ", int " flags ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR unlinkat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +.BR unlinkat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.RI ( flags +¤Ë +.B AT_REMOVEDIR +¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤ë¤«Èݤ«¤Ë¤è¤ê) +.BR unlink (2) +¤Þ¤¿¤Ï +.BR rmdir (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹Ì¾¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I dirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( unlink (2) +¤Þ¤¿¤Ï +.BR rmdir (2) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹Ì¾¤Ç¤¢¤ê¡¢¤«¤Ä +.I dirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I pathname +¤Ï +.RB ( unlink (2) +¤Þ¤¿¤Ï +.BR rmdir (2) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÀäÂХѥ¹Ì¾¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ + +.I flags +¤Ï¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ê¡¢0 ¤Þ¤¿¤Ï +.BR unlinkat () +¤ÎÁàºî¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°ÃͤΠOR ¤ò»ØÄê¤Ç¤­¤ë¡£ +¸½ºß¤Î¤È¤³¤í 1 ¤Ä¤Î¥Õ¥é¥°¤À¤±¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.TP +.B AT_REMOVEDIR +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR unlinkat () +¤Ï +.I pathname +¤ËÂФ·¤Æ +.BR unlink (2) +¤ÈƱ¤¸Áàºî¤ò¹Ô¤¦¡£ +.B AT_REMOVEDIR +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤ë¤È¡¢ +.I pathname +¤ËÂФ·¤Æ +.BR rmdir (2) +¤ÈƱ¤¸Áàºî¤ò¹Ô¤¦¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR unlinkat () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR unlink (2) +¤Þ¤¿¤Ï +.BR rmdir (2) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR unlinkat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR unlinkat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I dirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.I flags +¤ËÉÔÀµ¤Ê¥Õ¥é¥°Ãͤ¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B ENOTDIR +.I pathname +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I dirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR unlinkat () +¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2008. +Solaris ¤Ë¤Ï¡¢¤³¤ì¤ÈƱ¤¸¤è¤¦¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¡£ +.SH Ãí°Õ +.BR unlinkat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR openat (2), +.BR rmdir (2), +.BR unlink (2), +.BR path_resolution (7) diff --git a/release/man2/unshare.2 b/release/man2/unshare.2 new file mode 100644 index 00000000..595c1a2d --- /dev/null +++ b/release/man2/unshare.2 @@ -0,0 +1,188 @@ +.\" 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 2008-11-20 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +unshare \- ¥×¥í¥»¥¹¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Î°ìÉô¤òʬΥ¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.\" 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 +.SH ÀâÌÀ +.BR unshare () +¤ò»È¤¦¤È¡¢¥×¥í¥»¥¹¤Ï¾¤Î¥×¥í¥»¥¹¤È¸½ºß¶¦Í­¤·¤Æ¤¤¤ë +¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Î°ìÉô¤òʬΥ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Î°ìÉô¡¢¤¿¤È¤¨¤Ð¥Þ¥¦¥ó¥È̾Á°¶õ´Ö (mount namespace) +¤Ê¤É¤Ï¡¢¿·¤·¤¤¥×¥í¥»¥¹¤ò +.BR fork (2) +¤Þ¤¿¤Ï +.BR vfork (2) +¤ò»È¤Ã¤ÆÀ¸À®¤·¤¿¤È¤­¤Ë¡¢°ÅÌۤΤ¦¤Á¤Ë¶¦Í­¤µ¤ì¤ë¡£ +°ìÊý¡¢²¾ÁÛ¥á¥â¥ê¤Ê¤É¤Ï¡¢ +.BR clone (2) +¤ò»È¤Ã¤Æ¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¤È¤­¤Ë¡¢ÌÀ¼¨Åª¤Ë¶¦Í­¤¹¤ë¤³¤È¤òÍ×µá¤Ç¤­¤ë¡£ + +.BR unshare () +¤Î¼ç¤ÊÍøÍÑË¡¤Ï¡¢¥×¥í¥»¥¹¤¬¿·¤·¤¤¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¤³¤È¤Ê¤¯¡¢ +¶¦Í­¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤òÀ©¸æ¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ + +.I flags +°ú¤­¿ô¤Ï¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ê¡¢ +¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Î¤É¤ÎÉôʬ¤Î¶¦Í­¤ò²ò½ü¤¹¤ë¤«¤òɽ¤¹¡£ +¤³¤Î°ú¤­¿ô¤Ï¡¢°Ê²¼¤ÎÄê¿ô¤Î 0 ¸Ä°Ê¾å¤Î OR ¤Ç»ØÄꤹ¤ë: +.TP +.B CLONE_FILES +.BR clone (2) +.B CLONE_FILES +¥Õ¥é¥°¤Î¸ú²Ì¤ò¼è¤ê¾Ã¤¹¡£ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¥Æ¡¼¥Ö¥ë¤ò¶¦Í­¤µ¤»¤º¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï¾¤Î¥×¥í¥»¥¹¤È¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¶¦Í­¤·¤Ê¤¯¤Ê¤ë¡£ +.TP +.B CLONE_FS +.BR clone (2) +.B CLONE_FS +¥Õ¥é¥°¤Î¸ú²Ì¤ò¼è¤ê¾Ã¤¹¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à°À­¤ò¶¦Í­¤µ¤»¤º¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï¾¤Î¥×¥í¥»¥¹¤È¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¡¦ +¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¡¦umask °À­¤ò¶¦Í­¤·¤Ê¤¯¤Ê¤ë¡£ +.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. +¤³¤Î¥Õ¥é¥°¤Ï +.BR clone (2) +.B CLONE_NEWNS +¥Õ¥é¥°¤È\fIƱ¤¸\fR¸ú²Ì¤ò»ý¤Ä¡£ +¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤ò¶¦Í­¤»¤º¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï +¾¤Î¥×¥í¥»¥¹¤È¤Ï¶¦Í­¤·¤Ê¤¤¸ÇÍ­¤Î̾Á°¶õ´Ö¤Î¥³¥Ô¡¼¤ò»ý¤Ä¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢ +.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 +.I flags +¤Ë 0 ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.BR unshare () +¤Ï²¿¤â¹Ô¤ï¤Ê¤¤¤Î¤Ç¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Ï¡¢²¿¤âÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I flags +¤ËÉÔÀµ¤Ê¥Ó¥Ã¥È¤¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B ENOMEM +¸Æ¤Ó½Ð¤·¸µ¤Î¥³¥ó¥Æ¥­¥¹¥È¤Î¤¦¤Á¶¦Í­¤ò²ò½ü¤¹¤ëɬÍפ¬¤¢¤ëÉôʬ¤ò¥³¥Ô¡¼¤¹¤ë¤¿¤á¤Ë¡¢ +½½Ê¬¤Ê¥á¥â¥ê¤¬³ÎÊݤǤ­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPERM +.I flags +¤Ë +.B CLONE_NEWNS +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ËÆø¢ +.RB ( CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤¬¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR unshare () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +.BR unshare () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR clone (2) +¤Ç¿·¤·¤¤¥×¥í¥»¥¹¤òÀ¸À®¤·¤¿¤È¤­¤Ë¶¦Í­¤µ¤ì¤ëÁ´¤Æ¤Î¥×¥í¥»¥¹Â°À­¤ò¡¢ +.BR unshare () +¤Ë¤è¤Ã¤Æ¶¦Í­¤Î²ò½ü¤¬¤Ç¤­¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +Æäˡ¢¥«¡¼¥Í¥ë 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 , +.\" FIXME . check future kernel versions (e.g., 2.6.17) +.\" to see if CLONE_VM gets implemented. +.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 +¤³¤ì¤é¤Îµ¡Ç½¤Ï¡¢É¬ÍפǤ¢¤ì¤Ð¾­ÍèÄɲ䵤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\" +.\"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. +.\" +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR fork (2), +.BR vfork (2), +Documentation/unshare.txt diff --git a/release/man2/uselib.2 b/release/man2/uselib.2 new file mode 100644 index 00000000..7c847394 --- /dev/null +++ b/release/man2/uselib.2 @@ -0,0 +1,115 @@ +.\" 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 1996-10-22 by Eric S. Raymond +.\" 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 ÆÃÍ­ +.\" +.TH USELIB 2 2005-01-09 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +uselib \- ¶¦Í­¥é¥¤¥Ö¥é¥ê¤òÁªÂò¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int uselib(const char *" library ); +.SH ÀâÌÀ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR uselib () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬»ÈÍѤ¹¤ë +¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤¹¤ëºÝ¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤Ï¥é¥¤¥Ö¥é¥ê¤Î¥Ñ¥¹Ì¾¤ò»ØÄꤹ¤ë¡£ +¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤¹¤ë¥¢¥É¥ì¥¹¤Ï¥é¥¤¥Ö¥é¥ê¼«¿È¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¥é¥¤¥Ö¥é¥ê¤Ïǧ¼±²Äǽ¤Ê¥Ð¥¤¥Ê¥ê·Á¼°¤Ç¤¢¤ì¤Ð¤É¤ó¤Ê·Á¼°¤Ç¤â¤è¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.BR open (2) +¤È +.BR mmap (2) +¤¬ÊÖ¤¹¥¨¥é¡¼¥³¡¼¥É¤Ë²Ã¤¨¤Æ¡¢°Ê²¼¤Î¥¨¥é¡¼¥³¡¼¥É¤¬ÀßÄꤵ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +.B EACCES +.I library +¤Ç»ØÄꤵ¤ì¤¿¥é¥¤¥Ö¥é¥ê¤ËÂФ¹¤ëÆɤ߹þ¤ßµö²Ä¡¢¤Þ¤¿¤Ï¼Â¹Ôµö²Ä¤¬¤Ê¤¤¡£ +¤â¤·¤¯¤Ï +.I library +¤¬Â¸ºß¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤½¤Î¾å°Ì¤Î¤¤¤º¤ì¤«¤ËÂФ¹¤ë¸¡º÷µö²Ä¤¬¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È)¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥àÁ´ÂΤξå¸Â¤Ë㤷¤¿¡£ +.TP +.B ENOEXEC +.I library +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¡¢¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤Èǧ¼±¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¼ïÊÌ¤Ç¤Ï +¤Ê¤¤¡¢¤Ä¤Þ¤êÀµ¤·¤¤¥Þ¥¸¥Ã¥¯¡¦¥Ê¥ó¥Ð¡¼¤¬ÉÕ¤¤¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +.BR uselib () +¤Ï Linux ÆÃÍ­¤Î´Ø¿ô¤Ç¤¢¤ê¡¢°Ü¿¢À­¤ò»ý¤¿¤»¤¿¤¤¥×¥í¥°¥é¥à +¤Ë¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ê¤¤¡£ +.SH Ãí°Õ +½é´ü¤Î libc ¤Îµ¯Æ°¥³¡¼¥É¤Ï¡¢ +.BR uselib () +¤ò»È¤Ã¤Æ¡¢ +¥Ð¥¤¥Ê¥êÃæ¤Î¥ê¥¹¥È¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò +¥ê¥¹¥ÈÃæ¤Î¤½¤Î¤Þ¤Þ¤Î̾Á°¤Ç¥í¡¼¥É¤·¤Æ¤¤¤¿¡£ +.LP +.\" libc 4.3.1f - changelog 1993-03-02 +libc 4.3.2 °Ê¹ß¤Ç¤Ï¡¢¤³¤ì¤é¤Î̾Á°¤ÎÁ°¤Ë "/usr/lib", "/lib", "" ¤ò +¤Ä¤±¤Æ¶¦Í­¥é¥¤¥Ö¥é¥ê¤òõ¤¹¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +.\" libc 4.3.4 - changelog 1993-04-21 +libc 4.3.4 °Ê¹ß¤Ç¤Ï¡¢¤³¤ì¤é¤Î̾Á°¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò¤Þ¤º +.B LD_LIBRARY_PATH +¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Çõ¤·¡¢¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð¡¢ +̾Á°¤ÎÁ°¤Ë "/usr/lib", "/lib", "/" ¤ò¤Ä¤±¤Æõ¤¹¡£ +.LP +libc 4.4.4 °Ê¹ß¤Ç¤Ï¡¢¥é¥¤¥Ö¥é¥ê "/lib/ld.so" ¤À¤±¤¬¥í¡¼¥É¤µ¤ì¡¢¤½¤Î¸å¤Ç +¤³¤ÎưŪ¥é¥¤¥Ö¥é¥ê¤¬ (¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¤â¤¦°ìÅٻȤäÆ) +ɬÍפʻĤê¤Î¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.LP +glibc2 ¤Ï¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ÈÍѤ·¤Ê¤¤¡£ +.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) diff --git a/release/man2/ustat.2 b/release/man2/ustat.2 new file mode 100644 index 00000000..78e1cf26 --- /dev/null +++ b/release/man2/ustat.2 @@ -0,0 +1,129 @@ +.\" Copyright (C) 1995, Thomas K. Dyas +.\" +.\" 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. +.\" +.\" Created 1995-08-09 Thomas K. Dyas +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2001-03-22 by aeb +.\" Modified 2003-08-04 by aeb +.\" +.\" Japanese Version Copyright (c) 1996 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Wed Dec 4 23:12:06 JST 1996 +.\" by HANATAKA Shinya +.\" Updated & Modified Sat May 22 19:00:40 JST 2004 +.\" by Yuichi SATO +.\" +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: mount ¥Þ¥¦¥ó¥È +.\"WORD: device ¥Ç¥Ð¥¤¥¹ +.\"WORD: member ¥á¥ó¥Ð¡¼ +.\"WORD: NUL character ¥Ì¥ëʸ»ú +.\"WORD: implement ¼ÂÁõ +.\"WORD: pointer ¥Ý¥¤¥ó¥¿¡¼ +.\" +.TH USTAT 2 2003-08-04 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ustat \- ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à (file system) ¤ÎÅý·×¤òÆÀ¤ë +.SH ½ñ¼° +.nf +.B #include +.br +.BR "#include " " /* libc[45] */" +.br +.BR "#include " " /* glibc2 */" +.sp +.BI "int ustat(dev_t " dev ", struct ustat *" ubuf ); +.fi +.SH ÀâÌÀ +.BR ustat () +¤Ï¥Þ¥¦¥ó¥È (mount) ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¾ðÊó¤òÊÖ¤¹¡£ +.I dev +¤ÏÄ´¤Ù¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥Ð¥¤¥¹ (device) ¤Î +¥Ç¥Ð¥¤¥¹Èֹ档 +.I ubuf +¤Ï°Ê²¼¤Î¥á¥ó¥Ð¡¼¤ò´Þ¤à ustat ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡¼: +.in +4n +.nf + +daddr_t f_tfree; /* Total free blocks */ +ino_t f_tinode; /* Number of free inodes */ +char f_fname[6]; /* Filsys name */ +char f_fpack[6]; /* Filsys pack name */ +.fi +.in +.PP +¸å¤ÎÆó¤Ä¤Î¥Õ¥£¡¼¥ë¥É +.I f_fname +¤È +.I f_fpack +¤Ï¼ÂÁõ¤µ¤ì¤Æ¤ª¤é¤º¡¢¾ï¤Ë NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤ÇËä¤á¤é¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¡¢ +.I ubuf +¤¬»Ø¤¹ +.I ustat +¹½Â¤ÂΤ¬Ëä¤á¤é¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +.I ubuf +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¶õ´Ö¤Î³°Â¦¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I dev +¤¬¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ò´Þ¤à¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOSYS +.I dev +¤Ç»²¾È¤µ¤ì¤ë¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬¤³¤ÎÁàºî (operation) ¤ò +¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤«¡¢Linux ¤Î¥Ð¡¼¥¸¥ç¥ó¤¬ 1.3.16 °ÊÁ°¤Ç¤¢¤ë¡£ +.SH ½àµò +SVr4. +.\" SVr4 ¤Ë¤Ï¾¤Ë ENOLINK, ECOMM, EINTR ¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¤¬¡¢ +.\" ENOSYS ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +.BR ustat () +¤Ï¿ä¾©¤µ¤ì¤º¡¢¸ß´¹À­¤Î¤¿¤á¤À¤±¤ËÄ󶡤µ¤ì¤ë¡£ +¿·¤·¤¤¥×¥í¥°¥é¥à¤ÏÁ´¤Æ¤³¤ì¤ÎÂå¤ê¤Ë +.BR statfs (2) +¤ò»ÈÍѤ¹¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.SS "HP-UX ¤Ë¤ª¤±¤ëÃí°Õ" +HP-UX ÈǤι½Â¤ÂÎ +.I ustat +¤Ë¤Ï¡¢¤½¤Î¾¤Ë¥Õ¥£¡¼¥ë¥É +.I f_blksize +¤¬Â¸ºß¤¹¤ë¤¬¡¢Â¾¤Ç¤Ï¸«¤«¤±¤Ê¤¤¡£ +HP-UX ¤Ï¼¡¤Î¤è¤¦¤Ë·Ù¹ð¤·¤Æ¤¤¤ë: +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÃæ¤Ë¤Ï¡¢²òÊü¤µ¤ì¤Æ¤¤¤ë inode ¤Î¿ô¤òÊѹ¹¤·¤Ê¤¤¤â¤Î¤â¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢¥Õ¥£¡¼¥ë¥É +.I f_tinode +¤Ë \-1 ¤òÊÖ¤¹¡£ +.\" ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ NFS ¤Ç¤¢¤ë¤«Èݤ«¤ò¥Æ¥¹¥È¤¹¤ë¤¿¤á¤Ë +.\" ¤³¤ì¤ò»ÈÍѤ¹¤ë¥½¥Õ¥È¥¦¥§¥¢¤â¤¢¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÃæ¤Ë¤Ï¡¢inode ¤òưŪ¤Ë³ÎÊݤ¹¤ë¤â¤Î¤â¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢¸½ºß²òÊü¤µ¤ì¤Æ¤¤¤ë inode ¤Î¿ô¤òÊÖ¤¹¡£ +.SH ´ØÏ¢¹àÌÜ +.BR stat (2), +.BR statfs (2) diff --git a/release/man2/utime.2 b/release/man2/utime.2 new file mode 100644 index 00000000..94797a1b --- /dev/null +++ b/release/man2/utime.2 @@ -0,0 +1,187 @@ +.\" 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-06-10 by Andries Brouwer +.\" 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" +.SH ̾Á° +utime, utimes \- ¥Õ¥¡¥¤¥ë¤ÎºÇ½ª¥¢¥¯¥»¥¹»þ¹ï¤È½¤Àµ»þ¹ï¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "int utime(const char *" filename ", const struct utimbuf *" times ); +.sp +.B #include +.sp +.BI "int utimes(const char *" filename ", const struct timeval " times [2]); +.fi +.SH ÀâÌÀ +.BR utime () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +.I filename +¤Ç¼¨¤µ¤ì¤ë inode ¤Î¥¢¥¯¥»¥¹»þ¹ï¤È½¤Àµ»þ¹ï¤ò +.I times +Ãæ¤Î +.IR actime " ¤È " modtime +¤Ë¤½¤ì¤¾¤ìÊѹ¹¤¹¤ë¡£ + +.I times +¤¬ +.B NULL +¤Î¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹»þ¹ï¤È½¤Àµ»þ¹ï¤Ï¸½ºß¤Î»þ¹ï¤ËÀßÄꤵ¤ì¤ë¡£ + +¥¿¥¤¥à¥¹¥¿¥ó¥×¤ÎÊѹ¹¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Î¾ì¹ç¤Ëµö²Ä¤µ¤ì¤ë¡£ +¥×¥í¥»¥¹¤ËŬÀÚ¤ÊÆø¢¤¬¤¢¤ë¾ì¹ç¡¢ +¼Â¸ú (effective) ¥æ¡¼¥¶ ID ¤¬¥Õ¥¡¥¤¥ë¤Î¥æ¡¼¥¶ ID ¤ÈÅù¤·¤¤¾ì¹ç¡¢ +.I times +¤¬ NULL ¤«¤Ä¡¢¥×¥í¥»¥¹¤¬¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡£ + +¹½Â¤ÂÎ +.I utimbuf +¤Ï°Ê²¼¤Ë¼¨¤¹¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct utimbuf { + time_t actime; /* ¥¢¥¯¥»¥¹»þ¹ï */ + time_t modtime; /* ½¤Àµ»þ¹ï */ +}; +.fi +.in + +.BR utime () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï 1 ÉäÎʬ²òǽ¤Ç¥¿¥¤¥à¥¹¥¿¥ó¥×¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.BR utimes () +¤Ï +.BR utime () +¤ÈƱÍͤǤ¢¤ë¤¬¡¢ +.I times +°ú¤­¿ô¤¬¹½Â¤ÂΤǤϤʤ¯ÇÛÎó¤ò»²¾È¤¹¤ë¡£ +¤³¤ÎÇÛÎó¤ÎÍ×ÁÇ¤Ï +.I timeval +¹½Â¤ÂΤǡ¢¥¿¥¤¥à¥¹¥¿¥ó¥×¤Î»ØÄê¤ò 1 ¥Þ¥¤¥¯¥íÉäÎʬ²òǽ¤Ç¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¹½Â¤ÂÎ +.I timeval +¤Ï°Ê²¼¤Ë¼¨¤¹Ä̤ê¤Ç¤¢¤ë¡£ + +.in +4n +.nf +struct timeval { + long tv_sec; /* Éà */ + long tv_usec; /* ¥Þ¥¤¥¯¥íÉà */ +}; +.fi +.in +.PP +.IR times [0] +¤Ï¿·¤·¤¤¥¢¥¯¥»¥¹»þ¹ï¤ò¡¢ +.IR times [1] +¤Ï¿·¤·¤¤½¤Àµ»þ¹ï¤òµ¬Äꤹ¤ë¡£ +.I times +¤¬ NULL ¤Î¾ì¹ç¡¢ +.BR utime () +ƱÍÍ¡¢¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹»þ¹ï¤È½¤Àµ»þ¹ï¤Ï¸½ºß¤Î»þ¹ï¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç 0 ¤¬Ê֤롣¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤¬Ê֤ꡢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +.I path +¤ò¹½À®¤¹¤ë²¿¤ì¤«¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸¡º÷µö²Ä¤¬¤Ê¤¤ +.RB ( path_resolution (7) +¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EACCES +.I times +¤¬ NULL ¤Ç¤¢¤ë¡£ +¤Þ¤¿¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤È°ìÃפ·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤¬¤½¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤¿¤º¡¢ +Æø¢¤â»ý¤Ã¤Æ¤¤¤Ê¤¤ (Linux ¤Î¾ì¹ç¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.B CAP_DAC_OVERRIDE +¤â +.B CAP_FOWNER +¤â»ý¤Ã¤Æ¤¤¤Ê¤¤)¡£¤Þ¤¿¤Ï¡¢ +.TP +.B ENOENT +.I filename +¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B EPERM +.I times +¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä¸Æ¤Ó½Ð¤·¸µ¤Î¼Â¸ú UID ¤¬¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤È°ìÃפ»¤º¡¢ +¤«¤Ä¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤ +(Linux ¤Î¾ì¹ç¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.B CAP_FOWNER +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤)¡£ +.TP +.B EROFS +.I path +¤¬Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ë¤¢¤ë¡£ +.SH ½àµò +.BR utime (): +SVr4, POSIX.1-2001. +POSIX.1-2008 ¤Ï +.BR utime () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +.br +.BR utimes (): +4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +Linux ¤Ç¤Ï¡¢ÉÔÊÑ (immutable) ¥Õ¥¡¥¤¥ë¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÊѹ¹¤·¤¿¤ê¡¢ +ÄɲÃÀìÍÑ (append-only) ¤Î¥Õ¥¡¥¤¥ë¤Ë¸½ºß»þ¹ï°Ê³°¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤ò +ÀßÄꤷ¤¿¤ê¤¹¤ë¤³¤È¤Ï¡¢µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +libc4 ¤È libc5 ¤Ç¤Ï¡¢ +.BR utimes () +¤Ïñ¤Ë +.BR utime () +¤Î¥é¥Ã¥Ñ¡¼ (wrapper) ¤Ç¤¢¤ë¡£ +¤½¤Î¤¿¤áÉðʲ¼¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR chattr (1), +.BR futimesat (2), +.BR stat (2), +.BR utimensat (2), +.BR futimes (3), +.BR futimens (3) diff --git a/release/man2/vfork.2 b/release/man2/vfork.2 new file mode 100644 index 00000000..348643c7 --- /dev/null +++ b/release/man2/vfork.2 @@ -0,0 +1,216 @@ +.\" 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 2009-06-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +vfork \- »Ò¥×¥í¥»¥¹¤òÀ¸À®¤·¿Æ¥×¥í¥»¥¹¤òÄä»ß¤µ¤»¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.B pid_t vfork(void); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR vfork (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.SS µ¬³Ê¤ÎÀâÌÀ +(POSIX.1 ¤è¤ê°úÍÑ) +.BR vfork () +´Ø¿ô¤Ï +.BR fork (2) +¤ÈƱ¤¸Æ¯¤­¤ò¤¹¤ë¤¬¡¢ +.BR vfork () +¤ÇºîÀ®¤µ¤ì¤¿¥×¥í¥»¥¹¤¬ +.BR vfork () +¤«¤é¤ÎÊÖ¤êÃͤò³ÊǼ¤·¤Æ¤¤¤ë +.I pid_t +·¿¤ÎÊÑ¿ô°Ê³°¤òÊѹ¹¤·¤¿¤ê¡¢ +.BR vfork () +¤ò¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë´Ø¿ô¤«¤é return ¤·¤¿¤ê¡¢ +.BR _exit (2) +¤ä +.BR exec (3) +²¤Î´Ø¿ô¤ò¥³¡¼¥ë¤¹¤ëÁ°¤Ë¾¤Î´Ø¿ô¤ò¥³¡¼¥ë¤·¤¿¾ì¹ç¤ÎÆ°ºî¤¬ +̤ÄêµÁ¤Ç¤¢¤ë¤È¤¤¤¦ÅÀ¤¬°Û¤Ê¤ë¡£ +.SS "LINUX ¤Ç¤ÎÀâÌÀ" +.BR vfork () +¤Ï +.BR fork (2) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤Ë¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¡£ +¾Ü¤·¤¤ÀâÌÀ¤ÈÊÖ¤êÃÍ¡¢¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Ï +.BR fork (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +.BR vfork () +¤Ï +.BR clone (2) +¤ÎÆüì¤Ê¾ì¹ç¤Ç¤¢¤ë¡£ +¿Æ¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¥Æ¡¼¥Ö¥ë¤Î¥³¥Ô¡¼¤ò¹Ô¤ï¤º¤Ë¿·¤·¤¤¥×¥í¥»¥¹¤ò +ºîÀ®¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£¤³¤ì¤ÏÀ­Ç½¤ËÉÒ´¶¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤ª¤¤¤Æ +»Ò¥×¥í¥»¥¹¤òÀ¸À®¤·¤Æ¤¹¤°¤Ë +.BR execve (2) +¤¹¤ë¾ì¹ç¤ËÍ­ÍѤ«¤â¤·¤ì¤Ê¤¤¡£ +.PP +.BR vfork () +¤Ï +.BR fork (2) +¤È°ã¤¤¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤«¡¢ +.BR execve (2) +¤ò¥³¡¼¥ë¤¹¤ë¤Þ¤Ç¿Æ¥×¥í¥»¥¹¤òÄä»ß (suspend) ¤µ¤»¤ë¡£ +»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤Ï¡¢ +.BR _exit (2) +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ëÄ̾ェλ¡¢ +Ã×̿Ū¤Ê¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¸å¤Î°Û¾ï½ªÎ»¤ÎÆó¤Ä¤Î¥±¡¼¥¹¤¬¤¢¤ë¡£ +¤³¤Î»þÅÀ¤Þ¤Ç¤Ï¡¢»Ò¥×¥í¥»¥¹¤Ï¥¹¥¿¥Ã¥¯¤ò´Þ¤àÁ´¤Æ¤Î¥á¥â¥ê¤ò +¿Æ¥×¥í¥»¥¹¤È¶¦Í­¤¹¤ë¡£ +»Ò¥×¥í¥»¥¹¤Ï¸½ºß¤Î´Ø¿ô¤«¤é return ¤·¤Æ¤Ï¤Ê¤é¤º¡¢ +.BR exit (3) +¤â¥³¡¼¥ë¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¤¬¡¢ +.BR _exit (2) +¤Ê¤é¤Ð¥³¡¼¥ë¤·¤Æ¤â¤è¤¤¡£ +.PP +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ï·Ñ¾µ¤µ¤ì¤ë¤¬¡¢¶¦Í­¤Ï¤µ¤ì¤Ê¤¤¡£ +¿Æ¥×¥í¥»¥¹¤Ø¤Î¥·¥°¥Ê¥ë¤Ï¡¢»Ò¥×¥í¥»¥¹¤¬¿Æ¥×¥í¥»¥¹¤Î¥á¥â¥ê¤ò +²òÊü¤·¤¿¸å (¤¹¤Ê¤ï¤Á¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤« +.BR execve (2) +¤ò¸Æ¤ó¤À¸å) ¤ËÅþÃ夹¤ë¡£ +.SS Îò»ËŪ¤ÊÀâÌÀ +Linux ¤Ë¤ª¤¤¤Æ +.BR fork (2) +¤Ï½ñ¤­¹þ¤ß»þ¥³¥Ô¡¼ (copy-on-write) ¥Ú¡¼¥¸¤ò»ÈÍѤ·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤½¤Î¤¿¤á +.BR fork (2) +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë¤è¤Ã¤ÆÈï¤ë»³²¤Ï¿Æ¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¡¦¥Æ¡¼¥Ö¥ë¤ò +Ê£À½¤¹¤ë¤¿¤á¤ËɬÍפʻþ´Ö¤È¥á¥â¥ê¤À¤±¤Ç¤¢¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢´÷¤·¤­ÀÎ¤Ë¤Ï +.BR fork (2) +¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥Ç¡¼¥¿¶õ´Ö¤ÎÁ´¤Æ¤Î¥³¥Ô¡¼¤·¤Æ¤¤¤¿¤¬¡¢ +¤³¤ì¤Ï¤·¤Ð¤·¤ÐÉÔɬÍפǤ¢¤Ã¤¿¡£¤Ê¤¼¤Ê¤é¡¢¤¿¤¤¤Æ¤¤¤Ï¤¹¤°¸å¤Ë +.BR exec (3) +¤ò¼Â¹Ô¤·¤Æ¤¤¤¿¤«¤é¤Ç¤¢¤ë¡£ +¤³¤Î¾ì¹ç¤Î¸úΨ¤ò¾å¤²¤ë¤¿¤á¤Ë BSD ¤Ï +.BR vfork () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òƳÆþ¤·¤Æ¿Æ¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ò´°Á´¤Ë¥³¥Ô¡¼ +¤¹¤ë¤«¤ï¤ê¤Ë¡¢ +.BR execve (2) +¤ò¥³¡¼¥ë¤¹¤ë¤« exit ¤¬µ¯¤­¤ë¤Þ¤Ç¿Æ¥×¥í¥»¥¹¤Î¥á¥â¥ê¤ÈÀ©¸æ¥¹¥ì¥Ã¥É +¤ò¼Ú¤ê¤ë¤è¤¦¤Ë¤·¤¿¡£ +¿Æ¥×¥í¥»¥¹¤Ï»Ò¥×¥í¥»¥¹¤¬¤½¤Î»ñ¸»¤ò»ÈÍѤ·¤Æ¤¤¤ë´Ö¤ÏÄä»ß¤µ¤ì¤¿¡£ +.BR vfork () +¤Ï»È¤¤¤Ë¤¯¤¤¤â¤Î¤Ç¤¢¤Ã¤¿: Î㤨¤Ð¡¢¿Æ¥×¥í¥»¥¹¤ÎÊÑ¿ô¤òÊѹ¹¤·¤Ê +¤¤¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¤É¤ÎÊÑ¿ô¤¬¥ì¥¸¥¹¥¿¤ËÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¤«¤òÃΤé¤Ê +¤±¤ì¤Ð¤Ê¤é¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +4.3BSD, POSIX.1-2001. +POSIX.1-2008 ¤Ç¤Ï¡¢ +.BR vfork () +¤Îµ¬Ä꤬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +.BR vfork () +¥³¡¼¥ë¤Ï¾¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¡¦¥·¥¹¥Æ¥à¤ÎƱ̾¤Î¥³¡¼¥ë¤È +¤Á¤ç¤Ã¤È»÷¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£µ¬³Ê¤¬ +.BR vfork () +¤ËÍ׵ᤷ¤Æ¤¤¤ë¤³¤È¤Ï¡¢ +.BR fork (2) +¤ËÍ׵ᤷ¤Æ¤¤¤ë¤³¤È¤è¤ê¤Ï¼å¤¤¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +ξ¼Ô¤òƱ¤¸¤â¤Î¤È¤·¤Æ¼ÂÁõ¤·¤Æ¤â¡¢µ¬³Ê¤Ë½àµò¤·¤Æ¤¤¤ë¤³¤È¤Ë¤Ê¤ë¡£ +ÆÃ¤Ë¥×¥í¥°¥é¥Þ¡¼¤Ï¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤« +.BR execve (2) +¤ò¸Æ¤Ó½Ð¤¹¤Þ¤Ç¿Æ¥×¥í¥»¥¹¤¬Ää»ß¤·¤Æ¤¤¤ë¤³¤È¤ä¡¢¥á¥â¥ê¤ò¶¦Í­¤¹¤ë¤³ +¤È¤Ë¤è¤ëÆüì¤ÊÆ°ºî¤ò¤¢¤Æ¤Ë¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\" In AIXv3.1 vfork is equivalent to fork. +.SH Ãí°Õ +.SS Linux ¤Ç¤ÎÃí°Õ +.BR pthread_atfork (3) +¤ò»È¤Ã¤ÆÀßÄꤵ¤ì¤¿ fork ¥Ï¥ó¥É¥é¤Ï +NPTL ¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤òºÎÍѤ·¤¿¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥°¥é¥à¤Ç¤Ï +¸Æ¤Ó½Ð¤µ¤ì¤Ê¤¤¡£°ìÊý¡¢LinuxThreads ¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤ò»È¤Ã¤¿ +¥×¥í¥°¥é¥à¤Ç¤Ï¡¢fork ¥Ï¥ó¥É¥é¤Ï¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +(Linux ¤Î¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤ÎÀâÌÀ¤Ï +.BR pthreads (7) +¤ò»²¾È¡£) +.SS Îò»Ë +.BR vfork () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï 3.0BSD ¤Ë¸½¤ï¤ì¤¿¡£ +.\" In the release notes for 4.2BSD Sam Leffler wrote: `vfork: Is still +.\" present, but definitely on its way out'. +4.4BSD ¤Ë¤ª¤¤¤Æ +.BR fork (2) +¤ÎƱµÁ¸ì¤È¤Ê¤Ã¤¿¤¬¡¢NetBSD ¤Ç¤ÏºÆ¤ÓƳÆþ¤µ¤ì¤¿¡£ +http://www.netbsd.org/Documentation/kernel/vfork.html ¤ò»²¾È¡£ +Linux ¤Ç¤Ï 2.2.0-pre6 ¤¢¤¿¤ê¤Þ¤Ç¤Ï +.BR fork (2) +¤ÈÅù²Á¤Ç¤¢¤Ã¤¿¡£(i386 ¤Ç¤Ï) 2.2.0-pre9 ¤«¤é (¾¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï +¾¯¤·ÃÙ¤ì¤Æ) ÆÈΩ¤·¤¿¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤Ê¤Ã¤¿¡£ +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï glibc-2.0.112 ¤ÇÄɲ䵤줿¡£ +.SH ¥Ð¥° +Linux ¤¬¤³¤Î²áµî¤ÎË´Îî¤òÉü³è¤µ¤»¤¿¤³¤È¤Ï¡¢¤à¤·¤íÉÔ¹¬¤È¸À¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +BSD ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤Ï¡¢ +¡Ö¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÂÅÅö¤Ê¥·¥¹¥Æ¥à¶¦Í­µ¡¹½¤¬¼ÂÁõ¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï +ºï½ü¤µ¤ì¤ë¡£¥æ¡¼¥¶¤Ï +.BR vfork () +¤Î¥á¥â¥ê¶¦Í­µ¡Ç½¤Ë°Í¸¤¹¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£²¿¸Î¤Ê¤é¤Ð¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë +¤¬ºï½ü¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤ì¤Ï +.BR fork (2) +¤ÎƱµÁ¸ì¤È¤µ¤ì¤ë¤«¤é¤Ç¤¢¤ë¡£¡×¤È½ñ¤«¤ì¤Æ¤¤¤ë¡£ + +¥·¥°¥Ê¥ë¤Î°·¤¤¤Î¾ÜºÙ¤ÏÉÔÌÀÎƤǥ·¥¹¥Æ¥à¤´¤È¤Ë°Û¤Ã¤Æ¤¤¤ë¡£ +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: +.\" ¸½ºß¤Î¤È¤³¤í (Linux 2.3.25)¡¢ +.\" .BR strace (1) +.\" ¤Ï +.\" .BR vfork () +.\" ¤òÄÉÀפ¹¤ë¤³¤È¤¬¤Ç¤­¤º¡¢¥«¡¼¥Í¥ë¥Ñ¥Ã¥Á¤¬É¬ÍפǤ¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR execve (2), +.BR fork (2), +.BR unshare (2), +.BR wait (2) diff --git a/release/man2/vhangup.2 b/release/man2/vhangup.2 new file mode 100644 index 00000000..4ce7078d --- /dev/null +++ b/release/man2/vhangup.2 @@ -0,0 +1,78 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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, 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 üËö +.\" +.TH VHANGUP 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +vhangup \- ¸½ºß¤Î tty ¤ò²¾ÁÛŪ¤Ë (virtualy) ¥Ï¥ó¥°¥¢¥Ã¥× (hangup) ¤µ¤»¤ë +.SH ½ñ¼° +.B #include +.sp +.B int vhangup(void); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR vhangup (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.ad b +.SH ÀâÌÀ +.BR vhangup () +¤Ï¸½ºß¤ÎüËö (terminal) ¤Ç¥Ï¥ó¥°¥¢¥Ã¥×¤ò¥·¥ß¥å¥ì¡¼¥È¤¹¤ë¡£ +¤³¤Î¥³¡¼¥ë¤Ï¾¤Î¥æ¡¼¥¶¡¼¤¬¥í¥°¥¤¥ó¤·¤¿»þ¤ËåºÎï (clean) ¤Ê tty ¤ò +ÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¼êÇÛ¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë +.BR vhangup () +¤ò¸Æ¤Ó½Ð¤¹¤¿¤á¤Î½½Ê¬¤ÊÆø¢¤¬¤Ê¤¤¡£ +.B CAP_SYS_TTY_CONFIG +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬É¬ÍפǤ¢¤ë¡£ +.SH ½àµò +¤³¤Î¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç +»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR capabilities (7), +.BR init (8) diff --git a/release/man2/vm86.2 b/release/man2/vm86.2 new file mode 100644 index 00000000..70c2bf5f --- /dev/null +++ b/release/man2/vm86.2 @@ -0,0 +1,82 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Copyright 1997 Andries E. 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. +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated Thu Jun 26 21:32:38 JST 1997 +.\" by SUTO, Mitsuaki +.\" Modified Sun Mar 21 17:23:16 JST 1999 +.\" by HANATAKA Shinya +.\" Updated & Modified Sat May 22 19:50:44 JST 2004 +.\" by Yuichi SATO +.\" +.TH VM86 2 2009-02-20 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +vm86old, vm86 \- ²¾ÁÛ 8086 ¥â¡¼¥É¤Ø°Ü¹Ô¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int vm86old(struct vm86_struct *" info ); +.sp +.BI "int vm86(unsigned long " fn ", struct vm86plus_struct *" v86 ); +.SH ÀâÌÀ +.BR vm86 () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 0.97p2 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +¤³¤ì¤Ï Linux 2.1.15 ¤È 2.0.28 ¤Ç +.BR vm86old () +¤Ë̾Á°¤¬Êѹ¹¤µ¤ì¡¢ +¿·¤·¤¤ +.BR vm86 () +¤¬Æ³Æþ¤µ¤ì¤¿¡£ +\fIstruct vm86_struct\fP ¤ÎÄêµÁ¤Ï 1.1.8 ¤È 1.1.9 ¤ÇÊѹ¹¤µ¤ì¤¿¡£ +.LP +¤³¤ì¤é¤Î¥³¡¼¥ë¤Ë¤è¤Ã¤Æ¥×¥í¥»¥¹¤Ï VM86 ¥â¡¼¥É +(Intel ¤Îʸ½ñ¤Ç¤Ï²¾ÁÛ 8086 ¥â¡¼¥É) ¤Ø¤È°Ü¹Ô¤¹¤ë¡£ +¤³¤ì¤é¤Î¥³¡¼¥ë¤Ï +.B dosemu +¤Ç»ÈÍѤµ¤ì¤ë¡£ +.PP +VM86 ¥â¡¼¥É¤Ï¥×¥í¥Æ¥¯¥È¥â¡¼¥É¥¿¥¹¥¯¤Ë¤ª¤±¤ë +¥ê¥¢¥ë¥â¡¼¥É¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EFAULT +¤³¤ÎÊÖ¤êÃÍ¤Ï i386 ¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢ +¥æ¡¼¥¶¡¼¶õ´Ö¤Î¥Ç¡¼¥¿¤ò¼èÆÀ¤¹¤ëºÝ¤ËÌäÂ꤬¤¢¤Ã¤¿¤³¤È¤ò¼¨¤¹¡£ +.TP +.B ENOSYS +¤³¤ÎÊÖ¤êÃͤϡ¢¤³¤Î¥³¡¼¥ë¤¬¸½ºß¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£ +.TP +.B EPERM +Êݸ¤µ¤ì¤¿¥«¡¼¥Í¥ë¥¹¥¿¥Ã¥¯¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤ë¡£(¤³¤ì¤Ï¥«¡¼¥Í¥ë¤¬Ä̾ï¤Î +¾õÂ֤Ǥ¢¤ë¤«¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¤¤ë¡£Êݸ¤µ¤ì¤¿¥¹¥¿¥Ã¥¯¤Ï vm86 ¥â¡¼¥É¤Ç +¤·¤«Â¸ºß¤·¤Ê¤¤¡£) +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï 32 ¥Ó¥Ã¥È Intel ¥×¥í¥»¥Ã¥µ¾å¤Î Linux ÆÃÍ­¤Î´Ø¿ô¤Ç¤¢¤ê¡¢ +°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ê¤¤¡£ diff --git a/release/man2/vmsplice.2 b/release/man2/vmsplice.2 new file mode 100644 index 00000000..e1c93b13 --- /dev/null +++ b/release/man2/vmsplice.2 @@ -0,0 +1,162 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 2006 Jens Axboe +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-02-04, Akihiro MOTOKI +.\" +.TH VMSPLICE 2 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +vmsplice \- ¥æ¡¼¥¶¡¦¥Ú¡¼¥¸¤ò¥Ñ¥¤¥×¤Ë·Ñ¤®¹ç¤ï¤»¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.B #include + +.BI "ssize_t vmsplice(int " fd ", const struct iovec *" iov , +.BI " unsigned long " nr_segs ", unsigned int " flags ); +.fi +.\" Return type was long before glibc 2.7 +.SH ÀâÌÀ +.\" Linus: vmsplice() system call to basically do a "write to +.\" the buffer", but using the reference counting and VM traversal +.\" to actually fill the buffer. This means that the user needs to +.\" be careful not to reuse the user-space buffer it spliced into +.\" the kernel-space one (contrast this to "write()", which copies +.\" the actual data, and you can thus reuse the buffer immediately +.\" after a successful write), but that is often easy to do. +.BR vmsplice () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +.I iov +¤Ç»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¡¦¥á¥â¥ê¤Î +.I nr_segs +¤ÎÈϰϤò¥Ñ¥¤¥×¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¡£ +.I fd +¤Ï¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +¥Ý¥¤¥ó¥¿ +.I iov +¤Ï +.I iovec +¹½Â¤ÂΤÎÇÛÎó¤ò»Ø¤¹¡£ +.I iovec +¹½Â¤ÂÎ¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: + +.in +4n +.nf +struct iovec { + void *iov_base; /* ³«»Ï¥¢¥É¥ì¥¹ */ + size_t iov_len; /* ¥Ð¥¤¥È¿ô */ +}; +.in +.fi + +.I flags +°ú¤­¿ô¤Ë¤Ï¡¢°Ê²¼¤ÎÃͤΠ0 ¸Ä°Ê¾å¤ò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýϤηÁ¤Ç»ØÄꤹ¤ë¡£ +.TP 1.9i +.B SPLICE_F_MOVE +.BR vmsplice () +¤Ç¤Ï̤»ÈÍÑ¡£ +.BR splice (2) +»²¾È¡£ +.TP +.B SPLICE_F_NONBLOCK +.\" Not used for vmsplice +.\" May be in the future -- therefore EAGAIN +Æþ½ÐÎϤÇÄä»ß (block) ¤·¤Ê¤¤¡£¾ÜºÙ¤Ï +.BR splice (2) +»²¾È¡£ +.TP +.B SPLICE_F_MORE +¸½ºß¤Î¤È¤³¤í +.BR vmsplice () +¤Ç¤Ï²¿¤Î¸ú²Ì¤â¤Ê¤¤¤¬¡¢¾­ÍèŪ¤Ë¤Ï¼ÂÁõ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.BR splice (2) +»²¾È¡£ +.TP +.B SPLICE_F_GIFT +¥æ¡¼¥¶¡¦¥Ú¡¼¥¸¤¬¥«¡¼¥Í¥ë¤ØÅϤ¹¤â¤Î (gift) ¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤Î¥á¥â¥ê¤òÀäÂФËÊѹ¹¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.\" FIXME Explain the following line in a little more detail: +¤µ¤â¤Ê¤±¤ì¤Ð¡¢¥Ú¡¼¥¸¥­¥ã¥Ã¥·¥å¤È¥Ç¥£¥¹¥¯¾å¤Î¥Ç¡¼¥¿¤Ï +°ìÃפ·¤Ê¤¯¤Ê¤ë¤À¤í¤¦¡£ +¥Ú¡¼¥¸¤ò¥«¡¼¥Í¥ë¤ËÅϤ¹¤È¡¢¤³¤Î¼¡¤Î +.BR splice (2) +.B SPLICE_F_MOVE +¤Ç¤½¤Î¥Ú¡¼¥¸¤Î°ÜÆ°¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¤³¤Î¼¡¤Î +.BR splice (2) +.B SPLICE_F_MOVE +¤Ç¤½¤Î¥Ú¡¼¥¸¤Î¥³¥Ô¡¼¤ò¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥Ç¡¼¥¿¤Ï¥á¥â¥ê¾å¤Ç¥Ú¡¼¥¸¶­³¦¤Ë¤¢¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +Ťµ¤â¥Ú¡¼¥¸¶­³¦¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" .... if we expect to later SPLICE_F_MOVE to the cache. +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤Æ´°Î»¤¹¤ë¤È¡¢ +.BR vmsplice () +¤Ï¥Ñ¥¤¥×¤ËžÁ÷¤·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR vmplice () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ç¤Ê¤¤¡¢¤â¤·¤¯¤Ï¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EINVAL +.I nr_segs +¤¬ 0 ¤â¤·¤¯¤Ï +.B IOV_MAX +¤è¤ê¤âÂ礭¤¤¡£¤Þ¤¿¤Ï +.B SPLICE_F_GIFT +¤¬ÀßÄꤵ¤ì¤¿¤¬¥á¥â¥ê¤¬¥Ú¡¼¥¸¶­³¦¤Ë¤¢¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOMEM +¥á¥â¥êÉÔ­¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR vmsplice () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6.17 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH È÷¹Í +»ØÄꤵ¤ì¤¿¥»¥°¥á¥ó¥È¿ô¤¬¾å¸Â¤Ë㤷¤¿¾ì¹ç¡¢ +.BR vmsplice () +¤Ï¾¤Î¥Ù¥¯¥È¥ë·Á¼°¤Î read/write ¤ò¹Ô¤¦´Ø¿ô¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¡£ +¾å¸Â¤Ï +.B IOV_MAX +¤Ç¤¢¤ê¡¢ +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥É¥­¥å¥á¥ó¥È¤ò½ñ¤¤¤¿»þÅÀ¤Ç¤ÎÃÍ¤Ï 1024 ¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR splice (2), +.BR tee (2), +.BR feature_test_macros (7) diff --git a/release/man2/wait.2 b/release/man2/wait.2 new file mode 100644 index 00000000..7ed0f3bf --- /dev/null +++ b/release/man2/wait.2 @@ -0,0 +1,644 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 by Thomas Koenig +.\" and Copyright (c) 2004 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. +.\" License. +.\" +.\" Modified Sat Jul 24 13:30:06 1993 by Rik Faith +.\" Modified Sun Aug 21 17:42:42 1994 by Rik Faith +.\" (Thanks to Koen Holtman ) +.\" Modified Wed May 17 15:54:12 1995 by Rik Faith +.\" To remove *'s from status in macros (Thanks to Michael Shields). +.\" Modified as suggested by Nick Duffek , aeb, 960426 +.\" Modified Mon Jun 23 14:09:52 1997 by aeb - add EINTR. +.\" Modified Thu Nov 26 02:12:45 1998 by aeb - add SIGCHLD stuff. +.\" Modified Mon Jul 24 21:37:38 2000 by David A. Wheeler +.\" - noted thread issues. +.\" Modified 26 Jun 01 by Michael Kerrisk +.\" Added __WCLONE, __WALL, and __WNOTHREAD descriptions +.\" Modified 2001-09-25, aeb +.\" Modified 26 Jun 01 by Michael Kerrisk, +.\" Updated notes on setting disposition of SIGCHLD to SIG_IGN +.\" 2004-11-11, mtk +.\" Added waitid(2); added WCONTINUED and WIFCONTINUED() +.\" Added text on SA_NOCLDSTOP +.\" Updated discussion of SA_NOCLDWAIT to reflect 2.6 behavior +.\" Much other text rewritten +.\" 2005-05-10, mtk, __W* flags can't be used with waitid() +.\" 2008-07-04, mtk, removed erroneous text about SA_NOCLDSTOP +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya all rights reserved. +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 1997-03-04, HANATAKA Shinya +.\" Modified 2000-09-23, HANATAKA Shinya +.\" Updated 2001-06-25, Kentaro Shirakata +.\" Updated 2001-10-15, Kentaro Shirakata +.\" Updated 2001-12-13, Kentaro Shirakata +.\" Updated 2002-10-21, Kentaro Shirakata +.\" Updated 2003-01-27, Kentaro Shirakata +.\" Updated 2003-09-12, Kentaro Shirakata +.\" Updated 2005-03-19, Akihiro MOTOKI +.\" Updated 2005-12-26, Akihiro MOTOKI +.\" Updated 2008-07-31, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: signal handling ¥·¥°¥Ê¥ë½èÍý +.\"WORD: suspend Ää»ß(suspend) +.\"WORD: zombie ¥¾¥ó¥Ó(zombie) +.\"WORD: child process »Ò¥×¥í¥»¥¹ +.\"WORD: process group ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× +.\"WORD: process group ID ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×ID +.\"WORD: stop Ää»ß(stop) +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: block ¶Ø»ß(block) +.\" +.TH WAIT 2 2009-04-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +wait, waitpid, waitid \- ¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤òÂÔ¤Ä +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "pid_t wait(int *" "status" ); + +.BI "pid_t waitpid(pid_t " pid ", int *" status ", int " options ); + +.BI "int waitid(idtype_t " idtype ", id_t " id \ +", siginfo_t *" infop ", int " options ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR waitid (): +_SVID_SOURCE || _XOPEN_SOURCE +.SH ÀâÌÀ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤¤¤º¤ì¤â¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î +¾õÂÖÊѲ½¤òÂÔ¤Á¡¢¾õÂÖ¤¬ÊѲ½¤·¤¿¤½¤Î»Ò¥×¥í¥»¥¹¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ë¤Î¤Ë +»ÈÍѤµ¤ì¤ë¡£ +¾õÂÖÊѲ½¤È¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë: +»Ò¥×¥í¥»¥¹¤Î½ªÎ»¡¢¥·¥°¥Ê¥ë¤Ë¤è¤ë»Ò¥×¥í¥»¥¹¤ÎÄä»ß¡¢ +¥·¥°¥Ê¥ë¤Ë¤è¤ë»Ò¥×¥í¥»¥¹¤ÎºÆ³«¡£ +»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¾ì¹ç¤Ï¡¢wait ¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¡¢ +¥·¥¹¥Æ¥à¤¬¤½¤Î»Ò¥×¥í¥»¥¹¤Ë´ØÏ¢¤¹¤ë¥ê¥½¡¼¥¹¤ò²òÊü¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +wait ¤¬¼Â¹Ô¤µ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤Ï +¡Ö¥¾¥ó¥Ó¡×¾õÂ֤ǻĤ곤±¤ë (²¼µ­¤ÎÃí°Õ¤Î¾Ï¤ò»²¾È¤Î¤³¤È)¡£ + +»Ò¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤¬¤¹¤Ç¤ËȯÀ¸¤·¤Æ¤¤¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î¥³¡¼¥ë¤Ï +¤¹¤°¤ËÉüµ¢¤¹¤ë¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢»Ò¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤¬µ¯¤³¤ë¤«¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÃæÃǤµ¤ì¤ë¤Þ¤Ç¡¢ +Ää»ß (block) ¤¹¤ë (¸å¼Ô¤Ï¡¢ +.BR sigaction (2) +¤Î +.B SA_RESTART +¥Õ¥é¥°¤Ë¤è¤ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤ +¾ì¹ç¤ÎÆ°ºî¤Ç¤¢¤ë)¡£ +°Ê²¼¤ÎÀâÌÀ¤Ç¤Ï¡¢¾õÂÖÊѲ½¤¬µ¯¤³¤Ã¤¿¤¬¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¤¤¤º¤ì¤«¤Ë +¤è¤Ã¤ÆÂÔ¤¿¤ì¤Æ¤¤¤Ê¤¤»Ò¥×¥í¥»¥¹¤ò +.I waitable +(ÂÔ¤Á²Äǽ) ¤È¸Æ¤Ö¡£ +.SS "wait() ¤È waitpid()" +.BR wait () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢»Ò¥×¥í¥»¥¹¤Î¤¤¤º¤ì¤«¤¬½ªÎ»¤¹¤ë¤Þ¤Ç +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò°ì»þÄä»ß¤¹¤ë¡£ +°Ê²¼¤ÎÆó¤Ä¤Î¸Æ¤Ó½Ð¤·¤ÏÅù²Á¤Ç¤¢¤ë: +.nf + + wait(&status); + + waitpid(\-1, &status, 0); +.fi + +.BR waitpid () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +.I pid +°ú¤­¿ô¤Ç»ØÄꤷ¤¿»Ò¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤¬µ¯¤³¤ë¤Þ¤Ç¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò°ì»þÄä»ß¤¹¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR waitpid () +¤Ï»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤À¤±¤òÂԤĤ¬¡¢¤³¤ÎÆ°ºî¤Ï +.I options +°ú¤­¿ô¤Ë¤è¤êÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ + +.I pid +¤Ë»ØÄê¤Ç¤­¤ëÃͤϰʲ¼¤ÎÄ̤ê: +.IP "< \-1" +¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤¬ +.I pid +¤ÎÀäÂÐÃͤËÅù¤·¤¤»Ò¥×¥í¥»¥¹¤Î¤¤¤º¤ì¤«¤¬½ªÎ»¤¹¤ë¤Þ¤Ç¤òÂԤġ£ +.IP \-1 +»Ò¥×¥í¥»¥¹¤Î¤É¤ì¤«¤¬½ªÎ»¤¹¤ë¤Þ¤ÇÂԤġ£ +.IP 0 +¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤¬¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¤â¤Î¤ÈÅù¤·¤¤ +»Ò¥×¥í¥»¥¹¤òÂԤġ£ +.IP "> 0" +¥×¥í¥»¥¹ID ¤¬ +.I pid +¤ËÅù¤·¤¤»Ò¥×¥í¥»¥¹¤òÂԤġ£ +.PP +.I options +¤ÎÃͤϼ¡¤ÎÄê¿ô¤Î 0 ¸Ä°Ê¾å¤ÎÏÀÍýϤǤ¢¤ë: +.TP 12 +.B WNOHANG +¾õÂÖÊѲ½¤¬µ¯¤³¤Ã¤¿»Ò¥×¥í¥»¥¹¤¬¤Ê¤¤¾ì¹ç¤Ë¤¹¤°¤ËÉüµ¢¤¹¤ë¡£ +.TP +.B WUNTRACED +»Ò¥×¥í¥»¥¹¤¬Ää»ß¤·¤¿¾ì¹ç¤Ë¤âÉüµ¢¤¹¤ë (»Ò¥×¥í¥»¥¹¤¬ +.BR ptrace (2) +¤Ç¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï½ü¤¯)¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤â¡¢Ää»ß¤·¤¿¥×¥í¥»¥¹¤¬ +¡Ö¥È¥ì¡¼¥¹ (traced)¡×¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢»Ò¥×¥í¥»¥¹¤Î¾õÂÖ¤¬Êó¹ð¤µ¤ì¤ë¡£ +.TP +.BR WCONTINUED " (Linux 2.6.10 °Ê¹ß)" +Ää»ß¤·¤¿»Ò¥×¥í¥»¥¹¤¬ +.B SIGCONT +¤ÎÇÛÁ÷¤Ë¤è¤êºÆ³«¤·¤¿¾ì¹ç¤Ë¤âÉüµ¢¤¹¤ë¡£ +.PP +(Linux ÀìÍÑ¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò¤¹¤ë) +.PP +.I status +¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢ +.BR wait () +¤ä +.BR waitpid () +¤Ï +.I status +¤Ç»Ø¤¹ \fIint\fP ¤Ë¾õÂÖ¾ðÊó¤ò³ÊǼ¤¹¤ë¡£ +¤³¤ÎÀ°¿ô¤Ï°Ê²¼¤Î¥Þ¥¯¥í¤ò»È¤Ã¤Æ¸¡ºº¤Ç¤­¤ë¡£ +(¤³¤ì¤é¤Î¥Þ¥¯¥í¤Î°ú¤­¿ô¤Ë¤Ï¡¢ +.BR wait () +¤ä +.BR waitpid () +¤¬½ñ¤­¹þ¤ó¤ÀÀ°¿ô¤½¤Î¤â¤Î¤ò»ØÄꤹ¤ë¡£¥Ý¥¤¥ó¥¿¤Ç¤Ï¤Ê¤¤!) +.TP +.BI WIFEXITED( status ) +»Ò¥×¥í¥»¥¹¤¬Àµ¾ï¤Ë½ªÎ»¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£ +¡ÖÀµ¾ï¤Ë¡×¤È¤Ï¡¢ +.BR exit (3) +¤« +.BR _exit (2) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢¤â¤·¤¯¤Ï +main() ¤«¤éÉüµ¢¤·¤¿¾ì¹ç¤Ç¤¢¤ë¡£ +.TP +.BI WEXITSTATUS( status ) +»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤òÊÖ¤¹¡£ +½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ï +.I status +°ú¤­¿ô¤Î²¼°Ì 8¥Ó¥Ã¥È¤Ç¹½À®¤µ¤ì¤Æ¤ª¤ê¡¢ +.BR exit (3) +¤ä +.BR _exit (2) +¤Î¸Æ¤Ó½Ð¤·»þ¤ËÅϤµ¤ì¤¿ÃÍ¡¢¤â¤·¤¯¤Ï main() ¤Î return ʸ¤Î +°ú¤­¿ô¤È¤·¤Æ»ØÄꤵ¤ì¤¿ÃͤǤ¢¤ë¡£ +¤³¤Î¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤Î¤Ï +.B WIFEXITED +¤¬¿¿¤òÊÖ¤·¤¿¾ì¹ç¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.BI WIFSIGNALED( status ) +»Ò¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤Ë¤è¤ê½ªÎ»¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£ +.TP +.BI WTERMSIG( status ) +»Ò¥×¥í¥»¥¹½ªÎ»¤Î¸¶°ø¤È¤Ê¤Ã¤¿¥·¥°¥Ê¥ë¤ÎÈÖ¹æ¤òÊÖ¤¹¡£ +¤³¤Î¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤Î¤Ï +.B WIFSIGNALED +¤¬¿¿¤òÊÖ¤·¤¿¾ì¹ç¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.BI WCOREDUMP( status ) +»Ò¥×¥í¥»¥¹¤¬¥³¥¢¥À¥ó¥×¤òÀ¸À®¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£ +¤³¤Î¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤Î¤Ï +.B WIFSIGNALED +¤¬¿¿¤òÊÖ¤·¤¿¾ì¹ç¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤Î¥Þ¥¯¥í¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤ª¤é¤º¡¢ +(AIX, SunOS ¤Ê¤É¤Î) ¤¤¤¯¤Ä¤«¤Î Unix ¤Î¼ÂÁõ¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +ɬ¤º #ifdef WCOREDUMP ... #endif ¤Ç³ç¤Ã¤Æ»ÈÍѤ¹¤ë¤³¤È¡£ +.TP +.BI WIFSTOPPED( status ) +»Ò¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤Ë¤è¤êÄä»ß¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£ +¤³¤ì¤¬¿¿¤Ë¤Ê¤ë¤Î¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ +.B WUNTRACED +¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤«¡¢»Ò¥×¥í¥»¥¹¤¬¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤ë¾ì¹ç +.RB ( ptrace (2) +»²¾È) ¤À¤±¤Ç¤¢¤ë¡£ +.TP +.BI WSTOPSIG( status ) +»Ò¥×¥í¥»¥¹¤òÄä»ß¤µ¤»¤¿¥·¥°¥Ê¥ë¤ÎÈÖ¹æ¤òÊÖ¤¹¡£ +¤³¤Î¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤Î¤Ï +.B WIFSTOPPED +¤¬ 0 °Ê³°¤òÊÖ¤·¤¿¾ì¹ç¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.BI WIFCONTINUED( status ) +(Linux 2.6.10 °Ê¹ß) +»Ò¥×¥í¥»¥¹¤¬ +.B SIGCONT +¤ÎÇÛÁ÷¤Ë¤è¤êºÆ³«¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£ +.SS "waitid()" +.BR waitid () +¥·¥¹¥Æ¥à¥³¡¼¥ë (Linux 2.6.9 °Ê¹ß¤ÇÍøÍѲÄǽ) ¤ò»È¤¦¤È¡¢ +»Ò¥×¥í¥»¥¹¤Î¤É¤Î¾õÂÖÊѲ½¤òÂԤĤ«¤Ë¤Ä¤¤¤Æ¤è¤êºÙ¤«¤ÊÀ©¸æ¤¬¤Ç¤­¤ë¡£ + +°ú¤­¿ô +.I idtype +¤È +.I id +¤Ç¤É¤Î»Ò¥×¥í¥»¥¹¤òÂԤĤ«¤òÁªÂò¤¹¤ë: +.IP "\fIidtype\fP == \fBP_PID\fP" +¥×¥í¥»¥¹ID ¤¬ +.I id +¤È°ìÃפ¹¤ë»Ò¥×¥í¥»¥¹¤òÂԤġ£ +.IP "\fIidtype\fP == \fBP_PGID\fP" +¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤¬ +.I id +¤È°ìÃפ¹¤ë»Ò¥×¥í¥»¥¹¤òÂԤġ£ +.IP "\fIidtype\fP == \fBP_ALL\fP" +»Ò¥×¥í¥»¥¹Á´Éô¤òÂоݤËÂԤġ£ +.I id +¤Ï̵»ë¤µ¤ì¤ë¡£ +.PP +»Ò¥×¥í¥»¥¹¤Î¤É¤Î¾õÂÖÊѲ½¤òÂԤĤ«¤Ï°Ê²¼¤Î¥Õ¥é¥°¤Ç»ØÄꤹ¤ë +.RI ( options +¤Ë¤Ï 1¸Ä°Ê¾å¤Î¥Õ¥é¥°¤ÎÏÀÍýϤò¤È¤Ã¤Æ»ØÄꤹ¤ë): +.TP 12 +.B WEXITED +»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤òÂԤġ£ +.TP +.B WSTOPPED +»Ò¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤Ë¤è¤êÄä»ß¤¹¤ë¤Î¤òÂԤġ£ +.TP +.B WCONTINUED +(Ää»ß¤·¤Æ¤¤¤¿) »Ò¥×¥í¥»¥¹¤¬ +.B SIGCONT +¤¬ÇÛÁ÷¤µ¤ì¤ÆºÆ³«¤¹¤ë¤Î¤òÂԤġ£ +.PP +¤µ¤é¤Ë°Ê²¼¤Î¥Õ¥é¥°¤òÏÀÍýϤηÁ¤Ç +.I options +¤Ë»ØÄê¤Ç¤­¤ë: +.TP 12 +.B WNOHANG +.BR waitpid () +¤ÈƱÍÍ¡£ +.TP +.B WNOWAIT +waitable ¾õÂÖ¤Î¥×¥í¥»¥¹¤ò¤½¤Î¤Þ¤Þ¤Ë¤¹¤ë¡£¤³¤Î¸å¤Ç wait ¥³¡¼¥ë¤ò +»È¤Ã¤Æ¡¢Æ±¤¸»Ò¥×¥í¥»¥¹¤Î¾õÂÖ¾ðÊó¤ò¤â¤¦°ìÅÙ¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +.BR waitid () +¤Ï +.I infop +¤¬»Ø¤¹ +.I siginfo_t +¹½Â¤ÂΤΰʲ¼¤Î¥Õ¥£¡¼¥ë¥É¤òÀßÄꤹ¤ë: +.TP 12 +\fIsi_pid\fP +»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ID¡£ +.TP +\fIsi_uid\fP +»Ò¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ID +(¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¾¤Î¤Û¤È¤ó¤É¤Î¼ÂÁõ¤Ç¤ÏÀßÄꤵ¤ì¤Ê¤¤)¡£ +.TP +\fIsi_signo\fP +¾ï¤Ë +.B SIGCHLD +¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +\fIsi_status\fP +.BR _exit (2) +(¤« +.BR exit (3)) +¤Ë»ØÄꤵ¤ì¤¿»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¡¢¤â¤·¤¯¤Ï +»Ò¥×¥í¥»¥¹¤Î½ªÎ»¡¢Ää»ß¡¢ºÆ³«¤Î¸¶°ø¤È¤Ê¤Ã¤¿¥·¥°¥Ê¥ë¤¬ÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤ò¤É¤¦²ò¼á¤¹¤ë¤«¤Ï¡¢ +.I si_code +¥Õ¥£¡¼¥ë¥É¤ò»²¾È¤·¤Æ·è¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +\fIsi_code\fP +°Ê²¼¤Î¤¤¤º¤ì¤«¤¬ÀßÄꤵ¤ì¤ë: +.B CLD_EXITED +(»Ò¥×¥í¥»¥¹¤¬ +.BR _exit (2) +¤ò¸Æ¤Ó½Ð¤·¤¿); +.B CLD_KILLED +(¥·¥°¥Ê¥ë¤Ë¤è¤ê»Ò¥×¥í¥»¥¹¤¬ kill ¤µ¤ì¤¿); +.B CLD_DUMPED +(¥·¥°¥Ê¥ë¤Ë¤è¤ê»Ò¥×¥í¥»¥¹¤¬ kill ¤µ¤ì¡¢¥³¥¢¡¦¥À¥ó¥×¤¬¹Ô¤ï¤ì¤¿); +.B CLD_STOPPED +(¥·¥°¥Ê¥ë¤Ë¤è¤ê»Ò¥×¥í¥»¥¹¤¬Ää»ß¤·¤¿); +.BR CLD_TRAPPED +(¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤¿»Ò¥×¥í¥»¥¹¤¬¥È¥é¥Ã¥×¤ò¼õ¿®¤·¤¿); +.B CLD_CONTINUED +.RB ( SIGCONT +¤Ë¤è¤ê»Ò¥×¥í¥»¥¹¤¬ºÆ³«¤µ¤ì¤¿)¡£ +.PP +.B WNOHANG +¤¬ +.I options +¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +waitable ¾õÂÖ¤Î»Ò¥×¥í¥»¥¹¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +.BR waitid () +¤Ï¤¹¤°¤Ë 0 ¤òÊÖ¤¹¡£¤³¤Î¤È¤­¡¢ +.I infop +¤¬»Ø¤¹ +.I siginfo_t +¹½Â¤ÂΤÎÆâÍƤÏÉÔÄê¤Ç¤¢¤ë¡£ +.\" POSIX.1-2001 ¤Ç¤Ï¡¢ÉÔÄê¤Î²ÄǽÀ­¤ò»Ä¤·¤Æ¤¤¤ë¡£ +.\" (Linux ¤ò´Þ¤à) ¤Û¤È¤ó¤É¤Î¼ÂÁõ¤Ç¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¹½Â¤ÂΤò 0 ¤ÇËä¤á¤ë¤¬¡¢ +.\" ¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¼ÂÁõ (AIX 5.1) ¤Ç¤Ï¤½¤¦¤Ê¤é¤Ê¤¤¡£ -- MTK Nov 04 +¤³¤Î¾ì¹ç¤ò waitable ¾õÂÖ¤Î»Ò¥×¥í¥»¥¹¤¬¤¢¤Ã¤¿¾ì¹ç¤È¶èÊ̤¹¤ë¤Ë¤Ï¡¢ +.BR waitid () +¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë +.I si_pid +¤ò 0 ¤Ë¤·¤Æ¤ª¤­¡¢¥³¡¼¥ë¤¬Éüµ¢¤·¤¿¸å¤Ç¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬ 0 °Ê³°¤ÎÃͤ«¤É¤¦¤« +¤ò¥Á¥§¥Ã¥¯¤¹¤ì¤Ð¤è¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wait (): +À®¸ù¤¹¤ë¤È¡¢½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ID ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£ + +.BR waitpid (): +À®¸ù¤¹¤ë¤È¡¢¾õÂÖ¤¬ÊѲ½¤·¤¿»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ID ¤òÊÖ¤¹¡£ +.B WNOHANG +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.I pid +¤Ç»Ø¼¨¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤¬°ì¤Ä°Ê¾å¸ºß¤¹¤ë¤¬¡¢¤É¤Î»Ò¥×¥í¥»¥¹¤Ç¤â +¾õÂÖÊѲ½¤¬µ¯¤³¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£ + +.BR waitid (): +À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +.B WNOHANG +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.I pid +¤Ç»Ø¼¨¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ç¾õÂÖÊѲ½¤¬µ¯¤³¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤â +0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£ +.\" FIXME: As reported by Vegard Nossum, if infop is NULL, then waitid() +.\" returns the PID of the child. Either this is a bug, or it is intended +.\" behavior that needs to be documented. See my Jan 2009 LKML mail +.\" "waitid() return value strangeness when infop is NULL". +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤¤¤º¤ì¤â +.I errno +¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B ECHILD +.RB ( wait () +¤Î¾ì¹ç) +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤Ï¡¢wait ¤ò¹Ô¤Ã¤Æ¤¤¤Ê¤¤»Ò¥×¥í¥»¥¹¤Ï¤Ê¤¤¡£ +.TP +.B ECHILD +.RB ( waitpid () +¤« +.BR waitid () +¤Î¾ì¹ç) +.I pid +.RB ( waitpid ()) +¤« +.I idtype +¤È +.I id +.RB ( waitid ()) +¤Ç»ØÄꤷ¤¿¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Ç¤Ê¤¤ +.RB ( SIGCHLD +¤ÎÆ°ºî¤Ë +.B SIG_IGN +¤òÀßÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢¼«Ê¬¼«¿È¤Î»Ò¥×¥í¥»¥¹¤Ç¤âµ¯¤³¤ê¤¦¤ë¡£ +¥¹¥ì¥Ã¥É¤Ë´Ø¤·¤Æ¤Ï¡ÖLinux ¤Ç¤ÎÃí°Õ¡×¤ÎÀá¤â»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.B EINTR +.B WNOHANG +¤¬ÀßÄꤵ¤ì¤Æ¤ª¤é¤º¡¢¶Ø»ß (block) ¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤ä +.B SIGCHLD +¤ò¼õ¿®¤·¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.I options +°ú¤­¿ô¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +½ªÎ»¤·¤¿¤¬¡¢wait ¤µ¤ì¤Æ¤¤¤Ê¤¤»Ò¥×¥í¥»¥¹¤Ï¡Ö¥¾¥ó¥Ó¡×¤Ë¤Ê¤ë¡£ +¸å¤Ç¿Æ¥×¥í¥»¥¹¤¬ wait ¤ò¼Â¹Ô¤·¤Æ»Ò¥×¥í¥»¥¹¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¼èÆÀ¤Ç¤­¤ë¤è¤¦¤Ë¡¢ +¥«¡¼¥Í¥ë¤Ï¥¾¥ó¥Ó¥×¥í¥»¥¹¤Ë¤Ä¤¤¤ÆºÇ¾®¸Â¤Î¾ðÊó (PID¡¢½ªÎ»¥¹¥Æ¡¼¥¿¥¹¡¢ +¥ê¥½¡¼¥¹»ÈÍѾõ¶·) ¤òÊÝ»ý¤¹¤ë¡£ +¥¾¥ó¥Ó¥×¥í¥»¥¹¤Ï¡¢ wait ¤Ë¤è¤Ã¤Æ¥·¥¹¥Æ¥à¤«¤éºï½ü¤µ¤ì¤Ê¤¤¸Â¤ê¡¢ +¥«¡¼¥Í¥ë¤Î¥×¥í¥»¥¹¥Æ¡¼¥Ö¥ë¤Î 1 ¥¨¥ó¥È¥ê¤ò¾ÃÈñ¤¹¤ë¡£¤³¤Î¥×¥í¥»¥¹¥Æ¡¼¥Ö¥ë¤¬ +°ìÇդˤʤë¤È¡¢¿·¤¿¤Ë¥×¥í¥»¥¹¤òºî¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +¿Æ¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤È¡¢¤½¤Î¿Æ¥×¥í¥»¥¹¤Î¡Ö¥¾¥ó¥Ó¡×¤Î +»Ò¥×¥í¥»¥¹¤Ï (¤â¤·¤¢¤ì¤Ð) +.BR init (8) +¤ÎÍܻҤȤʤ롣 +.BR init (8) +¤Ï wait ¤ò¼«Æ°Åª¤Ë¼Â¹Ô¤·¡¢¥¾¥ó¥Ó¤òºï½ü¤¹¤ë¡£ + +POSIX.1-2001 ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.B SIGCHLD +¤ÎÆ°ºî¤¬ +.B SIG_IGN +¤ËÀßÄꤵ¤ì¤¿¤«¡¢ +.B SIGCHLD +¤ËÂФ·¤Æ +.B SA_NOCLDWAIT +¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç +.RB ( sigaction (2) +»²¾È)¡¢½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤Ï¥¾¥ó¥Ó¤Ë¤Ï¤Ê¤é¤º¡¢ +.BR wait () +¤ä +.BR waitpid () +¤Î¸Æ¤Ó½Ð¤·¤ÏÁ´¤Æ¤Î»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤Þ¤ÇÄä»ß¤·¡¢ +»Ò¥×¥í¥»¥¹¤¬Á´Éô½ªÎ»¤·¤¿¸å +.I errno +¤Ë +.B ECHILD +¤òÀßÄꤷ¤Æ¼ºÇÔ¤¹¤ë¡£ +(¤â¤È¤â¤È¤Î POSIX ɸ½à¤Ï +.B SIGCHLD +¤Ë +.B SIG_IGN +¤òÀßÄꤷ¤¿¾ì¹ç¤Î¿¶¤ëÉñ¤¤¤ò̤µ¬Äê¤Î¤Þ¤Þ¤Ë¤·¤Æ¤¤¤ë¡£ +.B SIGCHLD +¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤¬¡Ö̵»ë¡×¤Ç¤¢¤ë¤Ë¤â¤«¤«¤ï¤é¤º¡¢ +.B SIGCHLD +¤ÎÆ°ºî¤È¤·¤Æ +.B SIG_IGN +¤òÌÀ¼¨Åª¤ËÀßÄꤷ¤¿¾ì¹ç¤Ë¤Ï¥¾¥ó¥Ó¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î°·¤¤¤¬ +°Û¤Ê¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£) +Linux 2.6 ¤Ï¤³¤Î»ÅÍͤ˽àµò¤·¤Æ¤¤¤ë¡£ +¤·¤«¤·¡¢Linux 2.4 (¤È¤½¤ì°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó) ¤Ï¤½¤¦¤Ç¤Ï¤Ê¤¤: +.B SIGCHLD +¤¬Ìµ»ë¤µ¤ì¤ë¾õÂÖ¤Ç +.BR wait () +¤Þ¤¿¤Ï +.BR waitpid () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢ +.B SIGCHLD +¤¬Ìµ»ë¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¤Î¤è¤¦¤Ë¿¶¤ëÉñ¤¦¡£ +¤Ä¤Þ¤ê¡¢¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ¼¡¤Î»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤Þ¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¡¢ +½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤Î PID ¤È¾õÂÖ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SS Linux ¤Ç¤ÎÃí°Õ +Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¥¹¥±¥¸¥å¡¼¥ë¤µ¤ì¤ë¥¹¥ì¥Ã¥É¤Ï +¥×¥í¥»¥¹¤ÈÌÀ³Î¤Ë¶èÊ̤Ǥ­¤ë¹½À®Í×ÁǤǤϤʤ¤¡£¥¹¥ì¥Ã¥É¤Ï Linux ¸ÇÍ­¤Î +.BR clone (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ÈÍѤ·¤ÆÀ¸À®¤µ¤ì¤ë¥×¥í¥»¥¹¤Ë²á¤®¤Ê¤¤¡£ +°Ü¿¢À­¤Î¤¢¤ë +.BR pthread_create (3) +¥³¡¼¥ë¤Î¤è¤¦¤Ê¾¤Î¥ë¡¼¥Á¥ó¤Ï +.BR clone (2) +¤ò»ÈÍѤ·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë; +¤³¤ì¤é¤Ç¤Ï +.BR waitid () +¤ò»È¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +Linux 2.4 ¤è¤êÁ°¤Ç¤Ï¡¢¥¹¥ì¥Ã¥É¤Ïñ¤ËÆüì¤Ê¥×¥í¥»¥¹¤Ç¤¢¤Ã¤¿¤Î¤Ç¡¢ +Î㤨Ʊ¤¸¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Ç¤¢¤Ã¤Æ¤â¡¢ +¤¢¤ë¥¹¥ì¥Ã¥É¤¬Ê̤Υ¹¥ì¥Ã¥É¤Î»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤Î¤òÂԤĤ³¤È¤Ï½ÐÍè¤Ê¤«¤Ã¤¿¡£ +¤·¤«¤·¡¢POSIX ¤Ç¤Ï¤³¤Î¤è¤¦¤Êµ¡Ç½¤òµ¬Äꤷ¤Æ¤ª¤ê¡¢ +Linux 2.4 °Ê¹ß¤Ç¤Ï¡¢¤¢¤ë¥¹¥ì¥Ã¥É¤¬Æ±¤¸¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Î¾¤Î¥¹¥ì¥Ã¥É¤Î +»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤Î¤òÂԤĤ³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +¤½¤·¤Æ¾­Íè¤Ï¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ë¤Ê¤ë¤Ç¤¢¤í¤¦¡£ +.LP +.BR clone (2) +¤òÍѤ¤¤Æºî¤é¤ì¤¿»Ò¥×¥í¥»¥¹¤Ë¤Ï¡¢°Ê²¼¤Î Linux ¸ÇÍ­¤Î +.I options +¤¬»ÈÍѤǤ­¤ë¡£ +.TP +.B __WCLONE +.\" since 0.99pl10 +"clone" ¤Ê»Ò¥×¥í¥»¥¹¤À¤±¤òÂԤġ£ +»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤ÏÈó "clone" ¤Ê»Ò¥×¥í¥»¥¹¤À¤±¤òÂÔ¤Ä +("clone" ¤Ê»Ò¥×¥í¥»¥¹¤Ï¡¢½ªÎ»»þ¤Ë¿Æ¥×¥í¥»¥¹¤ØÁ´¤¯¥·¥°¥Ê¥ë¤òÁ÷¤é¤Ê¤¤¤«¡¢ +.B SIGCHLD +°Ê³°¤Î¥·¥°¥Ê¥ë¤òÁ÷¤ë)¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B __WALL +¤â»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.BR __WALL " (Linux 2.4 °Ê¹ß)" +.\" since patch-2.3.48 +"clone" ¤Ç¤¢¤ë¤«¤Ê¤¤¤«¤Ë´Ø¤ï¤é¤º¡¢ +Á´¤Æ¤Î»Ò¥×¥í¥»¥¹¤òÂԤġ£ +.TP +.BR __WNOTHREAD " (Linux 2.4 °Ê¹ß)" +.\" since patch-2.4.0-test8 +Ʊ¤¸¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Î¾¤Î¥¹¥ì¥Ã¥É¤Î»Ò¥×¥í¥»¥¹¤ÏÂÔ¤¿¤Ê¤¤¡£ +Linux 2.4 ¤è¤êÁ°¤Ç¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤¢¤Ã¤¿¡£ +.SH Îã +.\" fork.2 ¤â¤³¤Î¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +.BR fork (2) +¤È +.BR waitpid () +¤Î»ÈÍÑÊýË¡¤ÎÎã¤ò¼¨¤·¤Æ¤¤¤ë¡£ +¤³¤Î¥×¥í¥°¥é¥à¤Ç¤Ï»Ò¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¡£ +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¤È¤­¤Ï¡¢ +»Ò¥×¥í¥»¥¹¤Ï +.BR pause (2) +¤ò»È¤Ã¤Æ¤½¤Î¼Â¹Ô¤ò°ì»þÄä»ß¤·¡¢¥æ¡¼¥¶¤¬¤½¤Î»Ò¥×¥í¥»¥¹¤Ë +¥·¥°¥Ê¥ë¤òÁ÷¿®¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +»Ò¥×¥í¥»¥¹¤Ïľ¤Á¤Ë½ªÎ»¤·¡¢ +¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç»ØÄꤵ¤ì¤¿À°¿ô¤ò½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤È¤·¤Æ»ÈÍѤ¹¤ë¡£ +¿Æ¥×¥í¥»¥¹¤Ï¡¢ +.BR waitpid () +¤ò»È¤Ã¤Æ»Ò¥×¥í¥»¥¹¤ò´Æ»ë¤·¡¢ +wait ¤Î¥¹¥Æ¡¼¥¿¥¹Ãͤò¾åµ­¤Î W*() ¥Þ¥¯¥í¤ò»È¤Ã¤Æ²òÀϤ¹¤ë¤È¤¤¤¦ +¥ë¡¼¥×¤ò¼Â¹Ô¤¹¤ë¡£ + +²¼µ­¤Î¤Î¥·¥§¥ë¡¦¥»¥Ã¥·¥ç¥ó¤Ï¥×¥í¥°¥é¥à¤Î¼Â¹ÔÎã¤Ç¤¢¤ë: +.in +4n +.nf + +.RB "$" " ./a.out &" +Child PID is 32360 +[1] 32359 +.RB "$" " kill \-STOP 32360" +stopped by signal 19 +.RB "$" " kill \-CONT 32360" +continued +.RB "$" " kill \-TERM 32360" +killed by signal 15 +[1]+ Done ./a.out +$ +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + pid_t cpid, w; + int status; + + cpid = fork(); + if (cpid == \-1) { + perror("fork"); + exit(EXIT_FAILURE); + } + + if (cpid == 0) { /* Code executed by child */ + printf("Child PID is %ld\\n", (long) getpid()); + if (argc == 1) + pause(); /* Wait for signals */ + _exit(atoi(argv[1])); + + } else { /* Code executed by parent */ + do { + w = waitpid(cpid, &status, WUNTRACED | WCONTINUED); + if (w == \-1) { + perror("waitpid"); + exit(EXIT_FAILURE); + } + + if (WIFEXITED(status)) { + printf("exited, status=%d\\n", WEXITSTATUS(status)); + } else if (WIFSIGNALED(status)) { + printf("killed by signal %d\\n", WTERMSIG(status)); + } else if (WIFSTOPPED(status)) { + printf("stopped by signal %d\\n", WSTOPSIG(status)); + } else if (WIFCONTINUED(status)) { + printf("continued\\n"); + } + } while (!WIFEXITED(status) && !WIFSIGNALED(status)); + exit(EXIT_SUCCESS); + } +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR _exit (2), +.BR clone (2), +.BR fork (2), +.BR kill (2), +.BR ptrace (2), +.BR sigaction (2), +.BR signal (2), +.BR wait4 (2), +.BR pthread_create (3), +.BR credentials (7), +.BR signal (7) diff --git a/release/man2/wait4.2 b/release/man2/wait4.2 new file mode 100644 index 00000000..ca911030 --- /dev/null +++ b/release/man2/wait4.2 @@ -0,0 +1,159 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" and Copyright (c) 2004 by Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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 13:32:44 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon Jun 23 14:09:52 1997 by aeb - add EINTR. +.\" Modified Tue Jul 7 12:26:42 1998 by aeb - changed return value wait3 +.\" Modified 2004-11-11, Michael Kerrisk +.\" Rewrote much of this page, and removed much duplicated text, +.\" replacing with pointers to wait.2 +.\" +.\" Japanese Version Copyright (c) 1997,1998 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-03-04, HANATAKA Shinya +.\" Modified 1997-09-28, HANATAKA Shinya +.\" Modified 2001-08-17, HANATAKA Shinya +.\" Updated 2001-12-13, Kentaro Shirakata +.\" Updated 2003-09-12, Kentaro Shirakata +.\" Updated 2005-03-04, Akihiro MOTOKI +.\" +.\"WORD: signal handling ¥·¥°¥Ê¥ë½èÍý +.\"WORD: suspend Ää»ß(suspend) +.\"WORD: zombie ¥¾¥ó¥Ó(zombie) +.\"WORD: child process »Ò¥×¥í¥»¥¹ +.\"WORD: process group ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× +.\"WORD: process group ID ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×ID +.\"WORD: stop Ää»ß(stop) +.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID +.\"WORD: block ¶Ø»ß(block) +.\"WORD: catch Êá³Í(catch) +.\"WORD: account ¥¢¥«¥¦¥ó¥È +.\" +.TH WAIT4 2 2008-09-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +wait3, wait4 \- BSD ¥¹¥¿¥¤¥ë¤Ç¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤òÂÔ¤Ä +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.B #include +.sp +.BI "pid_t wait3(int *" "status" ", int " options , +.BI " struct rusage *" rusage ); +.sp +.BI "pid_t wait4(pid_t " pid ", int *" status ", int " options , +.BI " struct rusage *" rusage ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR wait3 (): +_BSD_SOURCE +.br +.BR wait4 (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR wait3 () +¤È +.BR wait4 () +¤Ï +.BR waitpid (2) +¤ÈƱÍͤÎÆ°ºî¤ò¤¹¤ë¡£¤½¤ì¤Ë²Ã¤¨¡¢»Ò¥×¥í¥»¥¹¤Î¥ê¥½¡¼¥¹»ÈÍѾõ¶·¤Î¾ðÊó¤ò +.I rusage +¤¬»Ø¤¹¹½Â¤ÂΤËÆþ¤ì¤ÆÊÖ¤¹¡£ +.PP +.I rusage +¤ò»ÈÍѤ¹¤ëÅÀ¤ò½ü¤±¤Ð¡¢°Ê²¼¤Î 2¤Ä¤ÏÅù²Á¤Ç¤¢¤ë¡£ +.nf + + wait3(status, options, rusage); + + waitpid(\-1, status, options); + +.fi +ƱÍͤˡ¢°Ê²¼¤Î 2¤Ä¤âÅù²Á¤Ç¤¢¤ë¡£ +.nf + + wait4(pid, status, options, rusage); + + waitpid(pid, status, options); + +.fi +¸À¤¤´¹¤¨¤ë¤È¡¢ +.BR wait3 () +¤ÏÁ´¤Æ¤Î»Ò¥×¥í¥»¥¹¤òÂоݤËÂԤĤ¬¡¢ +.BR wait4 () +¤Ç¤ÏÆÃÄê¤Î»Ò¥×¥í¥»¥¹ (Ê£¿ô²Ä) ¤òÁª¤ó¤ÇÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.I rusage +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I rusage +¤¬»Ø¤¹ +.I rusage ¹½Â¤ÂÎ +¤Ë¤Ï»Ò¥×¥í¥»¥¹¤Î¥¢¥«¥¦¥ó¥È¾ðÊ󤬳ÊǼ¤µ¤ì¤ë¡£ +¾Ü¤·¤¯¤Ï +.BR getrusage (2) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR waitpid (2) +¤ÈƱÍÍ¡£ +.SH ¥¨¥é¡¼ +.BR waitpid (2) +¤ÈƱÍÍ¡£ +.SH ½àµò +4.3BSD. +.SH Ãí°Õ +¸½ºß¤Ç¤Ï +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëɬÍפϤʤ¤¤¬¡¢¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ¤ª¤¯¤È +°Ü¿¢À­¤ò¹â¤á¤ë¤³¤È¤¬¤Ç¤­¤ë (¼ÂºÝ¤Ë¤Ï +.I +¤Ç +.I rusage +¹½Â¤ÂΤ¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¤½¤Î¥Õ¥£¡¼¥ë¥É¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë +.I struct timeval +·¿¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ + +Linux ¤Ç¤Ï¡¢ +.BR wait3 () +¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤¢¤ê¡¢ +.BR wait4 () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fork (2), +.BR getrusage (2), +.BR sigaction (2), +.BR signal (2), +.BR wait (2), +.BR signal (7) diff --git a/release/man2/write.2 b/release/man2/write.2 new file mode 100644 index 00000000..d6171366 --- /dev/null +++ b/release/man2/write.2 @@ -0,0 +1,251 @@ +.\" 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 Sat Jul 24 13:35:59 1993 by Rik Faith +.\" Modified Sun Nov 28 17:19:01 1993 by Rik Faith +.\" Modified Sat Jan 13 12:58:08 1996 by Michael Haardt +.\" +.\" Modified Sun Jul 21 18:59:33 1996 by Andries Brouwer +.\" 2001-12-13 added remark by Zack Weinberg +.\" 2007-06-18 mtk: +.\" Added details about seekable files and file offset. +.\" Noted that write() may write less than 'count' bytes, and +.\" gave some examples of why this might occur. +.\" Noted what happens if write() is interrupted by a signal. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Tue Mar 4 00:18:20 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Wed Jun 13 20:57:55 JST 2001 +.\" by Yuichi SATO +.\" Updated Mon Jun 25 JST 2001 by Kentaro Shirakata +.\" Updated Fri Dec 21 JST 2001 by Kentaro Shirakata +.\" Updated 2002-09-24 by Akihiro MOTOKI +.\" Updated 2005-10-14 by Akihiro MOTOKI +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" Updated 2007-09-01, Akihiro MOTOKI, LDP v2.64 +.\" Updated 2008-04-13, Akihiro MOTOKI, LDP v3.20 +.\" +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡¡¼ +.\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à +.\"WORD: object ¥ª¥Ö¥¸¥§¥¯¥È +.\"WORD: pipe ¥Ñ¥¤¥× +.\"WORD: socket ¥½¥±¥Ã¥È +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: catch Êá³Í(catch) +.\"WORD: block Ää»ß(block) +.\"WORD: interrupt ³ä¤ê¹þ¤ß +.\"WORD: nonblocking I/O ÈóÄä»ß I/O +.\"WORD: device ¥Ç¥Ð¥¤¥¹ +.\"WORD: low-level I/O Äã¥ì¤Ù¥ë I/O +.\" +.TH WRITE 2 2009-02-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +write \- ¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿ (file descriptor) ¤Ë½ñ¤­¹þ¤à +.SH ½ñ¼° +.B #include +.sp +.BI "ssize_t write(int " fd ", const void *" buf ", size_t " count ); +.SH ÀâÌÀ +.BR write () +¤Ï¡¢ +.I buf +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤«¤é¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤¬»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¤Ø¡¢ºÇÂç +.I count +¥Ð¥¤¥È¤ò½ñ¤­¹þ¤à¡£ + +½ñ¤­¹þ¤Þ¤ì¤ë¥Ð¥¤¥È¿ô¤Ï +.I count +¤è¤ê¤â¾®¤µ¤¯¤Ê¤ë¤³¤È¤¬¤¢¤ë¡£ +Î㤨¤Ð¡¢½ñ¤­¹þ¤ßÂоݤÎʪÍý¥á¥Ç¥£¥¢¤Ë½½Ê¬¤ÊÎΰ褬¤Ê¤¤¾ì¹ç¡¢ +¥ê¥½¡¼¥¹¾å¸Â +.B RLIMIT_FSIZE +¤Ë㤷¤¿¾ì¹ç +.RB ( setrlimit (2) +»²¾È)¡¢ +.I count +¥Ð¥¤¥È̤Ëþ¤Î½ñ¤­¹þ¤ß¤¬¹Ô¤ï¤ì¤¿¸å¤Ç +¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢ +¤Ê¤É¤Ç¤¢¤ë¡£ +.RB ( pipe (7) +¤â»²¾È¤Î¤³¤È¡£) + +seek ²Äǽ¤Ê¥Õ¥¡¥¤¥ë (¤Ä¤Þ¤ê +.BR lseek (2) +¤¬Å¬ÍѤǤ­¤ë¥Õ¥¡¥¤¥ë¡¢Î㤨¤ÐÄ̾ï¤Î¥Õ¥¡¥¤¥ë) ¤Ç¤Ï¡¢ +½ñ¤­¹þ¤ß¤Ï¸½ºß¤Î¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤«¤é¹Ô¤ï¤ì¡¢ +¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤Ï¼ÂºÝ¤Ë½ñ¤­¹þ¤ß¤¬¹Ô¤ï¤ì¤¿¥Ð¥¤¥È¿ôʬ +²Ã»»¤µ¤ì¤ë¡£¥Õ¥¡¥¤¥ë¤¬ +.B O_APPEND +¤Ç +.BR open (2) +¤µ¤ì¤¿¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤Ï½ñ¤­¹þ¤ßÁ°¤Ë +¥Õ¥¡¥¤¥ë¤ÎËöÈø¤ËÀßÄꤵ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤ÎÄ´À°¤È½ñ¤­¹þ¤ßÁàºî¤Ï¥¢¥È¥ß¥Ã¥¯¤Ê½èÍý¤È¤·¤Æ +¼Â¹Ô¤µ¤ì¤ë¡£ + +POSIX ¤Ï +.BR write () +¤¬¹Ô¤Ê¤ï¤ì¤¿¸å¤Ë¼Â¹Ô¤·¤¿ +.BR read (2) +¤¬ +¿·¤·¤¤¥Ç¡¼¥¿¤òÊÖ¤¹¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬ POSIX ½àµò¤Ç¤Ï¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë +(¥¼¥í¤Ï²¿¤â½ñ¤­¹þ¤Þ¤ì¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤¹)¡£ +¥¨¥é¡¼¤Ê¤é¤Ð \-1 ¤¬ÊÖ¤µ¤ì¡¢\fIerrno\fP ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ + +\fIcount\fP ¤¬ 0 ¤Ç¡¢ +.I fd +¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë (regular file) ¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR write () +¤Ï¸å½Ò¤Î¥¨¥é¡¼¤Î¤¤¤º¤ì¤«¤ò¸¡½Ð¤·¤¿¾ì¹ç¡¢¼ºÇÔ¤òÊÖ¤¹¤³¤È¤¬¤¢¤ë¡£ +¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +0 ¤òÊÖ¤·¡¢Â¾¤Ë²¿¤Î±Æ¶Á¤âÍ¿¤¨¤Ê¤¤¡£ +\fIcount\fP ¤¬ 0 ¤Ç¡¢ +.I fd +¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +¤½¤Î·ë²Ì¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤¬¥½¥±¥Ã¥È°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤Æ¡¢ +ÈóÄä»ß (nonblocking) ¥â¡¼¥É +.RB ( O_NONBLOCK ) +¤ËÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤ÈÄä»ß¤¹¤ë¾õ¶·¤Ë¤¢¤ë¡£ +.TP +.BR EAGAIN " ¤Þ¤¿¤Ï " EWOULDBLOCK +.\" Actually EAGAIN on Linux +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤¬¥½¥±¥Ã¥È¤ò»²¾È¤·¤Æ¤¤¤Æ¡¢ÈóÄä»ß (nonblocking) ¥â¡¼¥É +.RB ( O_NONBLOCK ) +¤ËÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤ÈÄä»ß¤¹¤ë¾õ¶·¤Ë¤¢¤ë¡£ +POSIX.1-2001 ¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¤É¤Á¤é¤Î¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤âǧ¤á¤Æ¤ª¤ê¡¢ +¤³¤ì¤é 2 ¤Ä¤ÎÄê¿ô¤¬Æ±¤¸Ãͤò»ý¤Ä¤³¤È¤âµá¤á¤Æ¤¤¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢Î¾Êý¤Î²ÄǽÀ­¤ò +³Îǧ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¤«½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó +(open) ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFAULT +.I buf +¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö (address space) ¤Î³°¤Ë¤¢¤ë¡£ +.TP +.B EFBIG +¼ÂÁõÄêµÁ¤ÎºÇÂç¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Þ¤¿¤Ï¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥µ¥¤¥ºÀ©¸Â¤ò +Ķ¤¨¤Æ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤â¤¦¤È¤·¤¿¡£ +¤Þ¤¿¤Ïµö²Ä¤µ¤ì¤¿¥ª¥Õ¥»¥Ã¥ÈÃͤ賦¤òĶ¤¨¤¿Àè¤Î°ÌÃÖ¤Ë +½ñ¤­¹þ¤â¤¦¤È¤·¤¿¡£ +.TP +.B EINTR +²¿¤Î¥Ç¡¼¥¿¤â½ñ¤«¤Ê¤¤´Ö¤Ë¥·¥°¥Ê¥ë¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿ (interrupt)¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.I fd +¤¬½ñ¤­¹þ¤ß¤¬ÉÔŬÀڤʥª¥Ö¥¸¥§¥¯¥È¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +¤â¤·¤¯¤Ï¡¢¥Õ¥¡¥¤¥ë¤¬ +.B O_DIRECT +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +.I buf +¤Ë»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¡¢ +.I count +¤Ë»ØÄꤵ¤ì¤¿ÃÍ¡¢ +¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Î¤¤¤º¤ì¤«¤Î +¥¢¥é¥¤¥ó¥á¥ó¥È¤¬ÉÔŬÀڤǤ¢¤ë¡£ +.TP +.B EIO +inode ¤Î½¤ÀµÃæ¤ËÄã¥ì¤Ù¥ë (low-level) I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B ENOSPC +.I fd +¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Ç¥Ð¥¤¥¹ (device) ¤Ë½½Ê¬¤Ê¶õ¤­¤¬¤Ê¤¤¡£ +.TP +.B EPIPE +.I fd +¤¬¥Ñ¥¤¥× (pipe) ¤«¥½¥±¥Ã¥È (socket) ¤ËÀܳ¤µ¤ì¤Æ¤ª¤ê¡¢ +¤½¤ÎÈ¿ÂЦ (Æɤ߹þ¤ß¦) ¤¬¥¯¥í¡¼¥º (close) ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤Ï¡¢½ñ¤­¹þ¤ß¤ò¹Ô¤Ê¤¦¥×¥í¥»¥¹¤Ï +.B SIGPIPE +¥·¥°¥Ê¥ë (signal)¤â¼õ¤±¤ë¡£ +(¤·¤¿¤¬¤Ã¤Æ¡¢¥×¥í¥°¥é¥à¤¬¤³¤Î¥·¥°¥Ê¥ë¤òÊá³Í (catch)¡¢Ää»ß (block)¡¢Ìµ»ë (ignore) +¤·¤¿¾ì¹ç¤Î¤ß¡¢write ¤ÎÊÖ¤êÃͤò»²¾È¤Ç¤­¤ë¡£) +.PP +.I fd +¤ËÀܳ¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤è¤Ã¤Æ¤Ï¡¢Â¾¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.\" SVr4 ¤Ë¤Ï¾¤Ë EDEADLK, ENOLCK, ENOLNK, +.\" ENOSR, ENXIO, ERANGE ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£ + +SVr4 ¤Ç¤Ï write ¤¬³ä¤ê¹þ¤Þ¤ì¤ë¤È¡¢¥Ç¡¼¥¿¤¬½ñ¤­¹þ¤Þ¤ì¤ëľÁ°¤Ç¤Ï¤Ê¤¯¡¢ +¤½¤Î»þÅÀ¤Ç +.B EINTR +¤¬Ê֤롣 +.SH Ãí°Õ +.BR write () +¤¬À®¸ù¤·¤ÆÊ֤äƤ­¤Æ¤â¡¢¥Ç¡¼¥¿¤¬¥Ç¥£¥¹¥¯¤Ëµ­Ï¿¤µ¤ì¤¿¤³¤È¤ò +Êݾڤ¹¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +¼ÂºÝ¡¢¥Ç¡¼¥¿¤Î¤¿¤á¤Î¥¹¥Ú¡¼¥¹¤¬³ÎÊݤµ¤ì¤¿¤³¤È¤¹¤éÊݾڤµ¤ì¤Ê¤¤¤È¤¤¤¦ +¥Ð¥°¤Ã¤Ý¤¤¼ÂÁõ¤â¤¢¤ë¡£ +¤³¤ì¤ò³Î¼Â¤Ë¤¹¤ëÍ£°ì¤ÎÊýË¡¤Ï¡¢ +Á´¤Æ¤Î¥Ç¡¼¥¿¤ò write ¤·¤¿¸å¤Ë +.BR fsync (2) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¤¢¤ë¡£ + +.BR write () +¤¬ 1 ¥Ð¥¤¥È¤â½ñ¤­¹þ¤Þ¤Ê¤¤¤¦¤Á¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢ +.BR write () +¤Ï¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¡£ +1¥Ð¥¤¥È¤Ç¤â½ñ¤­¹þ¤ó¤À¸å¤Ç³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +.BR write () +¤ÏÀ®¸ù¤·¡¢½ñ¤­¹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR fcntl (2), +.BR fsync (2), +.BR ioctl (2), +.BR lseek (2), +.BR open (2), +.BR pwrite (2), +.BR read (2), +.BR select (2), +.BR writev (2), +.BR fwrite (3) diff --git a/release/man3/INFINITY.3 b/release/man3/INFINITY.3 new file mode 100644 index 00000000..7aee1651 --- /dev/null +++ b/release/man3/INFINITY.3 @@ -0,0 +1,97 @@ +.\" Copyright 2004 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) 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" +.SH ̾Á° +INFINITY, NAN, HUGE_VAL, HUGE_VALF, HUGE_VALL \- ÉâÆ°¾®¿ôÅÀ¿ô¤ÎÄê¿ô +.SH ½ñ¼° +.nf +.B #define _ISOC99_SOURCE +.br +.B #include +.sp +.B INFINITY +.sp +.B NAN +.sp +.B HUGE_VAL +.br +.B HUGE_VALF +.br +.B HUGE_VALL +.fi +.SH ÀâÌÀ +¥Þ¥¯¥í +.B INFINITY +¤ÏÀµ¤Î̵¸ÂÂç¤òɽ¤¹ +\fIfloat\fP ·¿¤ÎÄê¿ô¤ËŸ³«¤µ¤ì¤ë¡£ + +(¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç) ¥Þ¥¯¥í +.B NAN +¤Ï quiet NaN ¤òɽ¤¹ \fIfloat\fP ·¿¤ÎÄê¿ô¤ËŸ³«¤µ¤ì¤ë¡£ +.I quiet +NaN ¤Ï·×»»¼°¤ÎÃæ¤Ç»È¤ï¤ì¤¿¤È¤­¤ËÎã³°¤òµ¯¤³¤µ¤Ê¤¤ +NaN ("not-a-number") ¤Ç¤¢¤ë¡£ +¤³¤ÎÈ¿ÂÐ¤Ï +.I signalling +NaN ¤Ç¤¢¤ë¡£ +IEC 60559:1989 ¤ò»²¾È¤¹¤ë¤³¤È¡£ + +¥Þ¥¯¥í +.BR HUGE_VAL , +.BR HUGE_VALF , +.B HUGE_VALL +¤Ï¤½¤ì¤¾¤ì \fIdouble\fP, \fIfloat\fP, \fIlong double\fP ·¿¤ÎÄê¿ô¤Ç¡¢ +Â礭¤ÊÀµ¤ÎÃͤòɽ¤·¡¢²Äǽ¤Ê¾ì¹ç¤Ë¤ÏÀµ¤Î̵¸ÂÂç¤òɽ¤¹¡£ +.SH ½àµò +C99. +.SH ²ÄÍÑÀ­ +glibc ¥·¥¹¥Æ¥à¤Ç¤Ï¥Þ¥¯¥í +.B HUGE_VAL +¤¬¾ï¤Ë»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.B NAN +¥Þ¥¯¥í¤¬»ÈÍѤǤ­¤ë¤«¤Ï¡¢ +.B "#ifdef NAN" +¤ò»È¤Ã¤Æ¥Æ¥¹¥È¤Ç¤­¤ë¡£ +.BR INFINITY , +.BR HUGE_VALF , +.B HUGE_VALL +¤âƱÍͤǤ¢¤ë¡£ +.B _ISOC99_SOURCE +¤« +.B _GNU_SOURCE +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¤Þ¤¿¤Ï +.B __STDC_VERSION__ +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Æ¡¢¤½¤ÎÃͤ¬ 199901L °Ê¾å¤Ç¤¢¤ë¾ì¹ç¡¢ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fpclassify (3), +.BR feature_test_macros (7), +.BR math_error (7) diff --git a/release/man3/MB_CUR_MAX.3 b/release/man3/MB_CUR_MAX.3 new file mode 100644 index 00000000..efd73a34 --- /dev/null +++ b/release/man3/MB_CUR_MAX.3 @@ -0,0 +1,47 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" 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" +.SH ̾Á° +MB_CUR_MAX \- ¸½ºß¤Î¥í¥±¡¼¥ë¤Ç¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ÎºÇÂçĹ +.SH ½ñ¼° +.nf +.B #include +.fi +.SH ÀâÌÀ +.B MB_CUR_MAX +¥Þ¥¯¥í¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Ç°ì¤Ä¤Î¥ï¥¤¥Éʸ»ú¤òɽ¸½¤¹¤ë¤¿¤á¤ËɬÍ×¤Ê +ºÇÂç¥Ð¥¤¥È¿ô¤òɽ¤¹À°¿ôɽ¸½¤òÄêµÁ¤¹¤ë¡£ +¤³¤ì¤Ï¥í¥±¡¼¥ë°Í¸¤Ç¤¢¤ê¡¢¥³¥ó¥Ñ¥¤¥ë»þ¤Ë·è¤Þ¤ëÄê¿ô¤Ç¤Ï¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +[1, +.BR MB_LEN_MAX ] +¤ÎÈϰϤÎÀ°¿ô¤òÊÖ¤¹¡£ +1 ¤È¤¤¤¦ÃͤÏÅÁÅýŪ¤Ê (traditional) 8-bit ¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿Ê¸»ú¤ò°ÕÌ£¤¹¤ë¡£ +.SH ½àµò +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) diff --git a/release/man3/MB_LEN_MAX.3 b/release/man3/MB_LEN_MAX.3 new file mode 100644 index 00000000..e15006e7 --- /dev/null +++ b/release/man3/MB_LEN_MAX.3 @@ -0,0 +1,47 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" Modified, aeb, 990824 +.\" +.\" Japanese Version Copyright (c) 1999 HAYAKAWA Hitoshi +.\" all rights reserved. +.\" Translated Sep 11, 1999 HAYAKAWA Hitoshi +.\" +.\"WORD: locale ¥í¥±¡¼¥ë +.\" +.TH MB_LEN_MAX 3 1999-07-04 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +MB_LEN_MAX \- Á´¤Æ¤Î¥í¥±¡¼¥ë¤Ç¤Î£±Ê¸»ú¤ÎºÇÂç¥Þ¥ë¥Á¥Ð¥¤¥ÈĹ +.SH ½ñ¼° +.nf +.B #include +.fi +.SH ÀâÌÀ +.B MB_LEN_MAX +¥Þ¥¯¥í¤Ï¡¢Á´¤Æ¤Î¥í¥±¡¼¥ë¤Ç°ì¤Ä¤Î¥ï¥¤¥Éʸ»ú¤òɽ¸½¤¹¤ë¤¿¤á¤ËɬÍפȤʤë +ºÇÂç¥Ð¥¤¥È¿ô¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +0 ¤è¤êÂ礭¤¤¤ÎÀ°¿ô·¿¤ÎÄê¿ô¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH Ãí°Õ +.B MB_LEN_MAX +¤È +.I sizeof(wchar_t) +¤ÎÃͤˤϤʤó¤Î´Ø·¸¤â¤Ê¤¤¡£ +glibc ¤Ç¤Ï +.B MB_LEN_MAX +¤ÏÄ̾ï¤Ï 6 ¤Ç¡¢ +.I sizeof(wchar_t) +¤Ï 4 ¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR MB_CUR_MAX (3) diff --git a/release/man3/__setfpucw.3 b/release/man3/__setfpucw.3 new file mode 100644 index 00000000..8fac162e --- /dev/null +++ b/release/man3/__setfpucw.3 @@ -0,0 +1,73 @@ +.\" Written Sat Mar 8 10:35:08 MEZ 1997 by +.\" J. "MUFTI" Scheurich (mufti@csv.ica.uni-stuttgart.de) +.\" This page is licensed under the GNU General Public License +.\" +.\" Japanese Version Copyright (c) 1998-2000 ISHIOKA Takashi and NAKANO Takeo +.\" all rights reserved. +.\" Translated Mon May 25 10:45:50 1998 +.\" by ISHIOKA Takashi +.\" Updated Wed Sep 20 2000 by NAKANO Takeo +.\" +.\"WORD: (floating-point) exception (ÉâÆ°¾®¿ôÅÀ) Îã³° +.\"WORD: rounding ´Ý¤á +.\" +.TH __SETFPUCW 3 1997-03-08 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +__setfpucw \- i386 ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤±¤ë FPU +¤Î¥³¥ó¥È¥í¡¼¥ë¥ï¡¼¥É¤ÎÀßÄê (obsolete) +.SH ½ñ¼° +.B #include +.sp +.BI "void __setfpucw(unsigned short " control_word ); +.SH ÀâÌÀ +.BR __setfpucw () +¤Ï¡¢i386¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤¤¤Æ +.I control_word +¤ò FPU (floating-point unit) ¤Î¥ì¥¸¥¹¥¿¤ËžÁ÷¤¹¤ë¡£ +¤³¤ì¤ÏÉâÆ°¾®¿ôÅÀ±é»»¤ÎÀºÅÙ¡¢´Ý¤áÊý¡¢ +¤ª¤è¤ÓÉâÆ°¾®¿ôÅÀÎã³°¤òÀ©¸æ¤¹¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +glibc 2.1 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ï¸ºß¤·¤Ê¤¤¡£ +¿·¤¿¤Ê´Ø¿ô·²¤¬ C99 ¤«¤éƳÆþ¤µ¤ì¤¿¡£¤³¤ì¤é¤Î¥×¥í¥È¥¿¥¤¥×¤Ï +.I +¤ËÃÖ¤«¤ì¤Æ¤¤¤ë¡£ FPU ¤Î´Ý¤á¥â¡¼¥É¤ÎÀ©¸æ¤Ë¤Ï +.IR fegetround , +.I fesetround +¤Ê¤É¤¬¡¢ÉâÆ°¾®¿ôÅÀ´ØÏ¢¤Î´Ä¶­¤Ë¤Ï +.IR fegetenv , +.IR feholdexcept , +.IR fesetenv , +.I feupdateenv +¤Ê¤É¤¬¡¢ FPU Îã³°½èÍý¤Ë¤Ï +.IR feclearexcept , +.IR fegetexceptflag , +.IR feraiseexcept , +.IR fesetexceptflag , +.I fetestexcept +¤Ê¤É¤¬Æ³Æþ¤µ¤ì¤¿¡£ +.PP +FPU ¤Î¥³¥ó¥È¥í¡¼¥ë¥ï¡¼¥É¤Ø¤É¤¦¤·¤Æ¤âľÀÜ¥¢¥¯¥»¥¹¤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢ +.I +¤Î +.B _FPU_GETCW +¥Þ¥¯¥í¤È +.B _FPU_SETCW +¥Þ¥¯¥í¤òÍѤ¤¤ë¤³¤È¤Ï²Äǽ¤Ç¤¢¤ë¡£ +.SH Îã +.B __setfpucw(0x1372) + +¤Ï¡¢i386¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤±¤ë FPU ¤Î¥³¥ó¥È¥í¡¼¥ë¥ï¡¼¥É¤ò¡¢ +.br + \- ³ÈÄ¥ÀºÅÙ +.br + \- ºÇ¤â¶á¤¤À°¿ô¤Ø´Ý¤á¤ë¡¢Ãæ´Ö¤Î¾ì¹ç¤Ï¶ö¿ô¤òÁªÂò¤¹¤ë¡£ +.br + \- ·å°î¤ì¡¢0¤Ç½ü»»¡¢µÚ¤Ó̵¸úÃÍ(NaN)¤È¤­¤ËÎã³°¤òȯÀ¸ +.br +¤ËÀßÄꤹ¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR feclearexcept (3) +.br +.I diff --git a/release/man3/a64l.3 b/release/man3/a64l.3 new file mode 100644 index 00000000..2ba09ce5 --- /dev/null +++ b/release/man3/a64l.3 @@ -0,0 +1,85 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" 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 Éä¹æ³ÈÄ¥ +.\" +.TH A64L 3 2007-07-26 "" "Linux Programmer's Manual" +.SH ̾Á° +a64l, l64a \- long ¤È base-64 ¤òÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "long a64l(char *" str64 ); +.sp +.BI "char *l64a(long " value ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR a64l (), +.BR l64a (): +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï 32 ¥Ó¥Ã¥È long À°¿ô¤È +¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó base-64 ASCII ʸ»úÎó (Ťµ 0 ¡Á 6) ¤Î´Ö¤ÎÊÑ´¹¤ò¹Ô¤¦¡£ +.BR a64l () +¤Î°ú¤­¿ô¤Îʸ»úÎó¤¬ 7 ʸ»ú°Ê¾å¤Î¾ì¹ç¡¢ +ºÇ½é¤Î 6 ¥Ð¥¤¥È¤¬»È¤ï¤ì¤ë¡£ +.I long +·¿¤¬ 32 ¥Ó¥Ã¥È¤è¤êÂ礭¤¤¾ì¹ç¡¢ +.BR l64a () +¤Ï +.I value +¤Î²¼°Ì 32 ¥Ó¥Ã¥È¤Î¤ß¤ò»È¤¤¡¢ +.BR a64l () +¤Ï 32 ¥Ó¥Ã¥È¤Î·ë²Ì¤òÉä¹æ³ÈÄ¥ (sign-extend) ¤¹¤ë¡£ +.LP +base-64 ¥·¥¹¥Æ¥à¤Ç»È¤ï¤ì¤ë 64 ¸Ä¤Îʸ»ú¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.RS +.nf + +\&\(aq.\(aq ¤Ï 0 ¤òɽ¤¹¡£ +\&\(aq/\(aq ¤Ï 1 ¤òɽ¤¹¡£ +0-9 ¤Ï 2-11 ¤òɽ¤¹¡£ +A-Z ¤Ï 12-37 ¤òɽ¤¹¡£ +a-z ¤Ï 38-63 ¤òɽ¤¹¡£ + +.fi +.RE +¤è¤Ã¤Æ 123 = 59*64^0 + 1*64^1 = "v/" ¤Ç¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.BR a64l () +¤ÇÊÖ¤µ¤ì¤ëÃͤÏÀÅŪ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç¡¢ +°Ê¹ß¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.LP +.I value +¤¬Éé¤Î¾ì¹ç¡¢ +.BR l64a () +¤ÎÆ°ºî¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.I value +¤¬ 0 ¤Î¾ì¹ç¤Ï¶õʸ»úÎó¤òÊÖ¤¹¡£ +.LP +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc 2.2.5 °ÊÁ°¤Ç¤Ï´Ö°ã¤Ã¤Æ¤¤¤ë +(ºÇ¾å°Ì¥Ç¥¸¥Ã¥È¤òºÇ½é¤Ë¤·¤Æ¤¤¤ë)¡£ +.LP +¤³¤ì¤Ï +.BR uuencode (1) +¤Ç»È¤ï¤ì¤ë¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ç¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR uuencode (1), +.\" .BR itoa (3), +.BR strtoul (3) diff --git a/release/man3/abort.3 b/release/man3/abort.3 new file mode 100644 index 00000000..15e15304 --- /dev/null +++ b/release/man3/abort.3 @@ -0,0 +1,82 @@ +.\" Copyright 2007 (C) Michael Kerrisk +.\" some parts 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 Sat Jul 24 21:46:21 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Aug 4 10:51:53 2000 - patch from Joseph S. Myers +.\" 2007-12-15, mtk, Mostly rewritten +.\" +.\" Japanese Version Copyright (c) 1996 Kentaro OGAWA +.\" all rights reserved. +.\" Translated 1996-07-13, Kentaro OGAWA +.\" Updated 2008-02-09, Akihiro MOTOKI +.\" +.TH ABORT 3 2007-12-15 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +abort \- ¥×¥í¥»¥¹¤Î°Û¾ï½ªÎ»¤òÀ¸¤¸¤µ¤»¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.B void abort(void); +.fi +.SH ÀâÌÀ +.BR abort () +´Ø¿ô¤Ï¡¢¤Þ¤º +.B SIGABRT +¤Î¶Ø»ß (block) ¤ò²ò½ü¤·¤Æ¤«¤é¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë +.B SIGABRT +¥·¥°¥Ê¥ë¤ò¾å¤²¤ë¡£¤½¤Î·ë²Ì¡¢ +.B SIGABRT +¥·¥°¥Ê¥ë¤¬¤òÊ᪠(caught) ¤µ¤ì¤Æ¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¡¼¤¬Ê֤äÆÍè¤Ê¤¤ +¾ì¹ç¤ò½ü¤¤¤Æ¡¢¥×¥í¥°¥é¥à¤Î°Û¾ï½ªÎ»¤¬µ¯¤³¤ë +.RB ( longjmp (3) +»²¾È)¡£ +.PP +.BR abort () +´Ø¿ô¤Ë¤è¤Ã¤Æ¥×¥í¥»¥¹¤Î½ªÎ»¤¬°ú¤­µ¯¤³¤µ¤ì¤¿¤È¤­¤Ë¤Ï¡¢ +¤¹¤Ù¤Æ¤Î³«¤¤¤Æ¤¤¤ë¥¹¥È¥ê¡¼¥à¤ÏÊĤ¸¤é¤ì¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë¡£ +.PP +.B SIGABRT +¥·¥°¥Ê¥ë¤¬Ìµ»ë¡¢¤Þ¤¿¤ÏÊ֤äÆÍè¤ë¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¡¼¤Ç +Ê᪤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢ +.BR abort () +´Ø¿ô¤Ï¤½¤Î¥×¥í¥»¥¹¤ò½ªÎ»¤¹¤ë¡£ +.B SIGABRT +¥·¥°¥Ê¥ë¤ËÂФ¹¤ë½èÍýÊýË¡¤ò¥Ç¥Õ¥©¥ë¥È¤ËÌᤷ¤Æ¤«¤é¡¢ºÆÅÙ +.B SIGABRT +¥·¥°¥Ê¥ë¤ò¾å¤²¤ë¤³¤È¤Ç¡¢¤³¤Î¤è¤¦¤ÊÆ°ºî¤Ë¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR abort () +´Ø¿ô¤Ï¡¢²¿¤âÊÖ¤µ¤Ê¤¤¡£ +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD, C89, C99. +.SH ´ØÏ¢¹àÌÜ +.BR gdb (1), +.BR sigaction (2), +.BR exit (3), +.BR longjmp (3), +.BR raise (3) diff --git a/release/man3/abs.3 b/release/man3/abs.3 new file mode 100644 index 00000000..cb77c1f0 --- /dev/null +++ b/release/man3/abs.3 @@ -0,0 +1,118 @@ +.\" 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 Mon Mar 29 22:31:13 1993, David Metcalfe +.\" Modified Sun Jun 6 23:27:50 1993, David Metcalfe +.\" 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 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +abs, labs, llabs, imaxabs \- À°¿ô¤ÎÀäÂÐÃͤò·×»»¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int abs(int " j ); +.br +.BI "long int labs(long int " j ); +.br +.BI "long long int llabs(long long int " j ); +.sp +.B #include +.sp +.BI "intmax_t imaxabs(intmax_t " j ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR llabs (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; ¤Þ¤¿¤Ï +.I cc\ -std=c99 +.SH ÀâÌÀ +.BR abs () +´Ø¿ô¤Ï¡¢À°¿ô¤Î°ú¿ô \fIj\fP ¤ÎÀäÂÐÃͤò·×»»¤¹¤ë¡£ +.BR labs (), +.BR llabs (), +.BR imaxabs () +´Ø¿ô¤Ï¡¢ +¤½¤ì¤¾¤ì¤Î´Ø¿ô¤Î·¿¤Ë±þ¤¸¤¿°ú¿ô \fIj\fP ¤ÎÀäÂÐÃͤò·×»»¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +¤½¤ì¤¾¤ì¤Î´Ø¿ô¤Î·¿¤Ë±þ¤¸¤¿À°¿ô¤Î°ú¿ô¤ÎÀäÂÐÃͤòÊÖ¤¹¡£ +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD, C99. +.\" POSIX.1 (1996 ǯÈÇ) ¤Ï +.\" .BR abs () +.\" ´Ø¿ô¤Î¤ß¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +C89 ¤Ï +.BR abs () +´Ø¿ô¤È +.BR labs () +´Ø¿ô¤Î¤ß¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +.BR llabs () +´Ø¿ô¤È +.BR imaxabs () +´Ø¿ô¤Ï C99 ¤ÇÄɲ䵤줿¡£ +.SH Ãí°Õ +ºÇÂç¤ÎÉéÀ°¿ô¤ÎÀäÂÐÃͤϡ¢ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.BR llabs () +´Ø¿ô¤Ï¥Ð¡¼¥¸¥ç¥ó 2.0 ¤«¤é glibc ¤Ë´Þ¤Þ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤¬¡¢ +libc5 ¤ä libc4 ¤Ë¤Ï¤Ê¤¤¡£ +.BR imaxabs () +´Ø¿ô¤Ï ¥Ð¡¼¥¸¥ç¥ó 2.1.1 ¤«¤é glibc ¤Ë´Þ¤Þ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +.PP +.BR llabs () +¤¬Àë¸À¤µ¤ì¤ë¤¿¤á¤Ë¤Ï¡¢É¸½à¥Ø¥Ã¥À¤ò include ¤¹¤ëÁ°¤Ë +\fB_ISOC99_SOURCE\fP ¤« \fB_ISOC9X_SOURCE\fP(¤É¤Á¤é¤«¤Ï glibc ¤Î +¥Ð¡¼¥¸¥ç¥ó¤Ë°Í¸¤¹¤ë)¤ò define ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +.PP +GCC ¤Ï +.BR abs () +¤È +.BR labs () +¤ò¥Ó¥ë¥É¥¤¥ó´Ø¿ô¤È¤·¤Æ°·¤¦¡£ +GCC 3.0 ¤Ï +.BR llabs () +¤È +.BR imaxabs () +¤â¥Ó¥ë¥É¥¤¥ó¤È¤·¤Æ°·¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR ceil (3), +.BR fabs (3), +.BR floor (3), +.BR rint (3) diff --git a/release/man3/acos.3 b/release/man3/acos.3 new file mode 100644 index 00000000..0a62d3f9 --- /dev/null +++ b/release/man3/acos.3 @@ -0,0 +1,117 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +acos, acosf, acosl \- µÕ;¸¹¡Êarc cosine¡Ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double acos(double " x ); +.BI "float acosf(float " x ); +.BI "long double acosl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR acosf (), +.BR acosl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR acos () +´Ø¿ô¤Ï \fIx\fP ¤ÎµÕ;¸¹¡Êarc cosine) ¤ò·×»»¤¹¤ë¡£ +¤¹¤Ê¤ï¤Á¡¢¤½¤Î;¸¹ (cosine) ¤¬ \fIx\fP ¤È¤Ê¤ëÃͤǤ¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎµÕ;¸¹¤ò¥é¥¸¥¢¥óñ°Ì¤ÇÊÖ¤¹¡£ +ÊÖ¤êÃÍ¤Ï [0,\ pi] ¤ÎÈϰϤȤʤ롣 + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +1 ¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ [\-1,\ 1] ¤ÎÈϰϤËÆþ¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬ [\-1,\ 1] ¤ÎÈϰϤËÆþ¤Ã¤Æ¤¤¤Ê¤¤ +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +̵¸ú (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï 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) diff --git a/release/man3/acosh.3 b/release/man3/acosh.3 new file mode 100644 index 00000000..76422899 --- /dev/null +++ b/release/man3/acosh.3 @@ -0,0 +1,122 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +acosh, acoshf, acoshl \- µÕÁжÊÀþ;¸¹¡Êinverse hyperbolic cosine¡Ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double acosh(double " x ); +.br +.BI "float acoshf(float " x ); +.br +.BI "long double acoshl(long double " x ); +.sp +.fi +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR acosh (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR acoshf (), +.BR acoshl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR acosh () +´Ø¿ô¤Ï \fIx\fP ¤ÎµÕÁжÊÀþ;¸¹¡Êinverse hyperbolic cosine¡Ë¤ò +·×»»¤¹¤ë¡£ +¤¹¤Ê¤ï¤Á¡¢¤½¤ÎÁжÊÀþ;¸¹¡Êhyperbolic cosine¡Ë¤¬ \fIx\fP ¤Ë +¤Ê¤ë¤è¤¦¤ÊÃͤǤ¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎµÕÁжÊÀþ;¸¹¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +1 ¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ 1 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬ 1 ¤è¤ê¾®¤µ¤¤ +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +̵¸ú (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR asinh (3), +.BR atanh (3), +.BR cacosh (3), +.BR cosh (3), +.BR sinh (3), +.BR tanh (3) diff --git a/release/man3/addseverity.3 b/release/man3/addseverity.3 new file mode 100644 index 00000000..cd8044b7 --- /dev/null +++ b/release/man3/addseverity.3 @@ -0,0 +1,80 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" adapted glibc info page +.\" +.\" polished a little, aeb +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Thu Jul 1 01:12:35 JST 2004 +.\" by Yuichi SATO +.\" +.\"WORD: severity class ½ÅÂçÅÙ +.\" +.TH ADDSEVERITY 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +addseverity \- ¿·¤·¤¤½ÅÂçÅÙ (severity class) ¤òƳÆþ¤¹¤ë +.SH ½ñ¼° +.nf +.sp +.B #include +.sp +.BI "int addseverity(int " severity ", const char *" s ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR addseverity (): +_SVID_SOURCE +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤Ë¤è¤ê¡¢¿·¤·¤¤½ÅÂçÅÙ¤òƳÆþ¤Ç¤­¤ë¡£ +¤³¤Î½ÅÂçÅ٤ϡ¢ +.BR fmtmsg (3) +´Ø¿ô¤Î +.I severity +°ú¤­¿ô¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¸å¼Ô¤Î +.BR fmtmsg (3) +´Ø¿ô¤Ï½ÅÂçÅÙ 0-4 (ʸ»úÎó¤Ç¤Ï (none), HALT, ERROR, WARNING, INFO) ¤Î +¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ëÊýË¡¤·¤«ÃΤé¤Ê¤¤¡£ +¤³¤Î +.BR addseverity (3) +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ê¡¢»ØÄꤵ¤ì¤¿Ê¸»úÎó +.I s +¤Ë»ØÄꤵ¤ì¤¿ÃÍ +.I severity +¤òÉղ乤롣 +.I s +¤¬ NULL ¤Î¾ì¹ç¡¢¿ôÃÍ +.I severity +¤Î½ÅÂçÅÙ¤¬ºï½ü¤µ¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î½ÅÂçÅ٤Τɤ줫¤ò¾å½ñ¤­¤·¤¿¤êºï½ü¤·¤¿¤ê¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +½ÅÂçÅÙ¤ÎÃͤÏÉé¤Ç¤Ê¤¤¿ô¤È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ÃÍ +.B MM_OK +¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ÊÖ¤êÃÍ¤Ï +.B MM_NOTOK +¤Ç¤¢¤ë¡£ +µ¯¤³¤ë²ÄǽÀ­¤¬¤¢¤ë¥¨¥é¡¼¤Ë¤Ï¡¢°Ê²¼¤Î¤â¤Î¤¬´Þ¤Þ¤ì¤ë: +¥á¥â¥ê¤ò»È¤¤²Ì¤¿¤·¤¿¡£ +¸ºß¤·¤Ê¤¤½ÅÂçÅÙ¤Þ¤¿¤Ï¥Ç¥Õ¥©¥ë¥È¤Î½ÅÂçÅÙ¤òºï½ü¤·¤è¤¦¤È¤·¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR addseverity () +¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +.BR fmtmsg (3) +´Ø¿ô¤Ï X/Open Portability Guide ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¤¬¡¢ +¤³¤Î´Ø¿ô¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤Ï System V ¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¿·¤·¤¤½ÅÂçÅ٤ϡ¢´Ä¶­ÊÑ¿ô +.B SEV_LEVEL +¤òÀßÄꤹ¤ë¤³¤È¤ÇÄɲ乤뤳¤È¤â¤Ç¤­¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fmtmsg (3) diff --git a/release/man3/adjtime.3 b/release/man3/adjtime.3 new file mode 100644 index 00000000..32635866 --- /dev/null +++ b/release/man3/adjtime.3 @@ -0,0 +1,137 @@ +.\" Copyright (c) 2006 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. +.\" +.\" 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" +.SH ̾Á° +adjtime \- ¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤ËƱ´ü¤¹¤ë»þ¹ï¤òÄ´À°¤¹¤ë +.SH ½ñ¼° +.nf +.BI "int adjtime(const struct timeval *" delta ", struct timeval *" olddelta ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR adjtime (): +_BSD_SOURCE +.SH ÀâÌÀ +.BR adjtime () +´Ø¿ô¤Ï +.RB ( gettimeofday (2) +¤¬ÊÖ¤¹) ¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤ò½ù¡¹¤ËÄ´À°¤¹¤ë¡£ +Ä´À°¤¹¤Ù¤­¥¯¥í¥Ã¥¯¤Î»þ´ÖÎÌ¤Ï +.I delta +¤¬»Ø¤¹¹½Â¤ÂΤǻØÄꤵ¤ì¤ë¡£ +¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î·Á¤Ç¤¢¤ë: +.in +4n +.nf + +struct timeval { + time_t tv_sec; /* Éà */ + suseconds_t tv_usec; /* ¥Þ¥¤¥¯¥íÉà */ +}; +.fi +.in +.PP +.I delta +¤ÎÄ´À°Î̤¬Àµ¤Î¾ì¹ç¡¢Ä´À°Î̤Ë㤹¤ë¤Þ¤Ç¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤ò +¾¯¤·³ä¹ç¤À¤±¥¹¥Ô¡¼¥É¥¢¥Ã¥×¤µ¤»¤ë (¤Ä¤Þ¤ê¡¢ËèÉÃ¥¯¥í¥Ã¥¯Ãͤ˾¯¤·¤À¤± +»þ¹ï¤ò²Ã»»¤¹¤ë)¡£ +.I delta +¤ÎÄ´À°Î̤¬Éé¤Î¾ì¹ç¡¢Æ±ÍͤÎÊýË¡¤Ç¥¯¥í¥Ã¥¯¤òÃÙ¤¯¤¹¤ë¡£ + +.BR adjtime () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¤È¤­¤Ë°ÊÁ°¤Î +.BR adjtime () +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ë¥¯¥í¥Ã¥¯¤ÎÄ´À°¤¬¤Þ¤À¼Â¹ÔÃæ¤Ç¡¢¤«¤Ä¸å¤Î +.BR adjtime () +¤Î +.I delta +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢¼Â¹ÔÃæ¤ÎÄ´À°¤ÏÄä»ß¤µ¤ì¤ë¡£ +¤·¤«¤·¡¢¤¹¤Ç¤Ë¼Â¹Ô¤µ¤ì¤¿Ä´À°¤Î¼è¤ê¾Ã¤·¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ + +.I olddelta +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I olddelta +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë¡¢²áµî¤ÎÄ´À°Í×µá¤Ç¤Þ¤À´°Î»¤»¤º»Ä¤Ã¤Æ¤¤¤ë»þ´ÖÎ̤¬ +³ÊǼ¤·¤ÆÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR adjtime () +¤Ï 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤¹¤ë¤È¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I delta +¤Ç»ØÄꤵ¤ì¤¿Ä´À°Î̤¬µö²Ä¤µ¤ì¤¿ÈϰϤËÆþ¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¼Ô¤¬»þ¹ï¤òÄ´À°¤¹¤ë¤Î¤ËɬÍפʸ¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +Linux ¤Ç¤Ï +.B CAP_SYS_TIME +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.SH ½àµò +4.3BSD, System V. +.SH Ãí°Õ +.BR adjtime () +¤¬¹Ô¤¦¥¯¥í¥Ã¥¯¤ÎÄ´À°¤Ï¡¢¥¯¥í¥Ã¥¯¤Ï¾ï¤ËñĴÁý²Ã¤¹¤ë¤È¤¤¤¦ÈÏ°ÏÆâ¤Ç +¼Â¹Ô¤µ¤ì¤ë¡£ +.BR adjtime () +¤ò»È¤Ã¤Æ»þ¹ï¤òÄ´À°¤¹¤ë¤³¤È¤Ç¡¢¥·¥¹¥Æ¥à¥¿¥¤¥à¤ÎÆÍÁ³¤ÎÀµ¤äÉé¤Î¥¸¥ã¥ó¥× +¤Ë¤è¤ê¡¢¤¤¤¯¤Ä¤«¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó (Î㤨¤Ð +.BR make (1) +¤Ê¤É) ¤Ëµ¯¤³¤ëÌäÂê¤òËɤ°¤³¤È¤¬¤Ç¤­¤ë¡£ + +.BR adjtime () +¤Ï¥·¥¹¥Æ¥à»þ¹ï¤Ë¾¯¤·¤º¤ÄÄ´À°¤ò¹Ô¤¦¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¤³¤È¤ò´üÂÔ¤µ¤ì¤Æ¤¤¤ë¡£ +¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I delta +¤Ë»ØÄê¤Ç¤­¤ëÄ´À°Î̤ËÀ©¸Â¤ò²Ý¤·¤Æ¤¤¤ë¡£ +glibc ¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.I delta +¤Ï (INT_MIN / 1000000 + 2) °Ê¾å (INT_MAX / 1000000 \- 2) °Ê²¼ +(i386 ¤Ç¤Ï \-2145 °Ê¾å 2145 °Ê²¼) ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ¥Ð¥° +¤º¤Ã¤ÈÀΤ«¤é¡¢ +.\" 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 °Ê¹ß¤Î¥·¥¹¥Æ¥à¤Ç½¤Àµ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR adjtimex (2), +.BR gettimeofday (2), +.BR time (7) diff --git a/release/man3/aio_cancel.3 b/release/man3/aio_cancel.3 new file mode 100644 index 00000000..add8196e --- /dev/null +++ b/release/man3/aio_cancel.3 @@ -0,0 +1,95 @@ +.\" 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" +.SH ̾Á° +aio_cancel \- ´°Î»¤·¤Æ¤¤¤Ê¤¤ÈóƱ´ü I/O ¥ê¥¯¥¨¥¹¥È¤ò¥­¥ã¥ó¥»¥ë¤¹¤ë +.SH ½ñ¼° +.B "#include " +.sp +.BI "int aio_cancel(int " fd ", struct aiocb *" aiocbp ); +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR aio_cancel () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë¤Ä¤¤¤Æ¤Î´°Î»¤·¤Æ¤¤¤Ê¤¤ÈóƱ´ü I/O ¥ê¥¯¥¨¥¹¥È¤ò¥­¥ã¥ó¥»¥ë¤·¤è¤¦¤È¤¹¤ë¡£ +.I aiocbp +¤¬ NULL ¤Î¾ì¹ç¡¢¤½¤Î¤è¤¦¤ÊÁ´¤Æ¤Î¥ê¥¯¥¨¥¹¥È¤¬¥­¥ã¥ó¥»¥ë¤µ¤ì¤ë¡£ +.I aiocbp +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I aiocbp +¤Ç»Ø¤µ¤ì¤¿À©¸æ¥Ö¥í¥Ã¥¯¤Çµ­½Ò¤µ¤ì¤¿¥ê¥¯¥¨¥¹¥È¤Î¤ß¤¬¥­¥ã¥ó¥»¥ë¤µ¤ì¤ë¡£ +.LP +¥­¥ã¥ó¥»¥ë¤µ¤ì¤¿¥ê¥¯¥¨¥¹¥È¤ËÂФ·¤Æ¡¢Ä̾ï¤ÎÈóƱ´üÄÌÃΤ¬µ¯¤³¤ë¡£ +¥ê¥¯¥¨¥¹¥È¤ÎÊÖ¤êÃÍ¤Ï \-1 ¤ËÀßÄꤵ¤ì¡¢ +¥ê¥¯¥¨¥¹¥È¤Î¥¨¥é¡¼¾õÂÖ¤Ï +.B ECANCELED +¤ËÀßÄꤵ¤ì¤ë¡£ +¥­¥ã¥ó¥»¥ë¤Ç¤­¤Ê¤«¤Ã¤¿¥ê¥¯¥¨¥¹¥È¤ÎÀ©¸æ¥Ö¥í¥Ã¥¯¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.LP +.I aiocbp +¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä +.I fd +¤¬ÈóƱ´üÁàºî¤¬³«»Ï¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤È°Û¤Ê¤ë¾ì¹ç¡¢ +À¸¤¸¤ë·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¡£ +.LP +¤É¤ÎÁàºî¤ò¥­¥ã¥ó¥»¥ë¤Ç¤­¤ë¤«¤Ï¡¢¼ÂÁõÄêµÁ¤Ç¤¢¤ë¡£ +.\" FreeBSD: raw ¥Ç¥£¥¹¥¯¥Ç¥Ð¥¤¥¹¤Ø¤Î¥ê¥¯¥¨¥¹¥È¤Ï¥­¥ã¥ó¥»¥ë¤Ç¤­¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +Á´¤Æ¤Î¥ê¥¯¥¨¥¹¥È¤Î¥­¥ã¥ó¥»¥ë¤¬À®¸ù¤·¤¿¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï +.B AIO_CANCELED +¤òÊÖ¤¹¡£ +»ØÄꤵ¤ì¤¿¥ê¥¯¥¨¥¹¥È¤Î¤¦¤Á¾¯¤Ê¤¯¤È¤â 1 ¤Ä¤¬¿Ê¹ÔÃæ¤Ç¤¢¤ë¤¿¤á¤Ë +¥­¥ã¥ó¥»¥ë¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +.B AIO_NOTCANCELED +¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤Î¾ì¹ç¤Ï¡¢ +.BR aio_error (3) +¤ò»È¤Ã¤Æ¸Ä¡¹¤Î¥ê¥¯¥¨¥¹¥È¤Î¾õÂÖ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¸Æ¤Ó½Ð¤µ¤ì¤ëÁ°¤ËÁ´¤Æ¤Î¥ê¥¯¥¨¥¹¥È¤¬´°Î»¤·¤Æ¤¤¤¿¾ì¹ç¡¢ +¤³¤Î´Ø¿ô¤Ï +.B AIO_ALLDONE +¤òÊÖ¤¹¡£ +²¿¤é¤«¤Î¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ï¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.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/release/man3/aio_error.3 b/release/man3/aio_error.3 new file mode 100644 index 00000000..3eb31897 --- /dev/null +++ b/release/man3/aio_error.3 @@ -0,0 +1,73 @@ +.\" 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" +.SH ̾Á° +aio_error \- ÈóƱ´ü I/O Áàºî¤Î¥¨¥é¡¼¾õÂÖ¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B "#include " +.sp +.BI "int aio_error(const struct aiocb *" aiocbp ); +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR aio_error () +´Ø¿ô¤Ï +.I aiocbp +¤Ç»Ø¤µ¤ì¤¿À©¸æ¥Ö¥í¥Ã¥¯¤Ç¤ÎÈóƱ´ü I/O ¥ê¥¯¥¨¥¹¥È¤Î¥¨¥é¡¼¾õÂÖ¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +¥ê¥¯¥¨¥¹¥È¤¬¤Þ¤À´°Î»¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï +.B EINPROGRESS +¤òÊÖ¤¹¡£¥ê¥¯¥¨¥¹¥È¤¬¥­¥ã¥ó¥»¥ë¤µ¤ì¤¿¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï +.B ECANCELED +¤òÊÖ¤¹¡£¥ê¥¯¥¨¥¹¥È¤¬À®¸ù¤·¤Æ´°Î»¤·¤¿¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï 0 ¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¥¨¥é¡¼Ãͤ¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤Î¥¨¥é¡¼Ãͤϡ¢Æ±´ü +.IR read , +.IR write , +.IR fsync , +.I fdatasync +¥ê¥¯¥¨¥¹¥È¤Î¾ì¹ç¤Ë +.I errno +¤Ë³ÊǼ¤µ¤ì¤ë¤Î¤ÈƱ¤¸ÃͤǤ¢¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¥¨¥é¡¼Ãͤ¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I aiocbp +¤¬¡¢¤Þ¤ÀÊÖ¤êÃÍ (return status) +.RB ( aio_return (3) +¤ò»²¾È) ¤¬¼èÆÀ¤µ¤ì¤Æ¤¤¤Ê¤¤ÈóƱ´ü I/O ¥ê¥¯¥¨¥¹¥È¤ÎÀ©¸æ¥Ö¥í¥Ã¥¯¤ò»Ø¤·¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.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/release/man3/aio_fsync.3 b/release/man3/aio_fsync.3 new file mode 100644 index 00000000..697d95a5 --- /dev/null +++ b/release/man3/aio_fsync.3 @@ -0,0 +1,100 @@ +.\" 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" +.SH ̾Á° +aio_fsync \- ÈóƱ´ü¥Õ¥¡¥¤¥ë¤òƱ´ü¤µ¤»¤ë +.SH ½ñ¼° +.B "#include " +.sp +.BI "int aio_fsync(int " op ", struct aiocb *" aiocbp ); +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR aio_fsync () +´Ø¿ô¤Ï¡¢ +.I aiocbp\->aio_fildes +¤Ç´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¤Þ¤À´°Î»¤·¤Æ¤¤¤Ê¤¤Á´¤Æ¤ÎÈóƱ´ü I/O Áàºî¤òƱ´ü¤µ¤»¤ë¡£ +.LP +¤è¤êÀµ³Î¤Ë¸À¤¦¤È¡¢ +.I op +¤¬ +.B O_SYNC +¤Î¾ì¹ç¡¢¸½ºß¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î I/O Áàºî¤Ï¡¢ +.BR fsync (2) +¤¬¸Æ¤Ð¤ì¤¿¤«¤Î¤è¤¦¤Ë´°Î»¤µ¤ì¤ë¤À¤í¤¦¡£ +¤Þ¤¿ +.I op +¤¬ +.B O_DSYNC +¤Î¾ì¹ç¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤Ï +.BR fdatasync (2) +¤ÎÈóƱ´üÈǤȤʤ롣 +¤³¤Î´Ø¿ô¤Ï¥ê¥¯¥¨¥¹¥È¤ò¹Ô¤¦¤À¤±¤Ç¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È \(em +¤³¤Î¸Æ¤Ó½Ð¤·¤Ï I/O ¤Î´°Î»¤òÂÔ¤¿¤Ê¤¤¡£ +.LP +.I aiocbp +¤Ç»Ø¤µ¤ì¤ë¹½Â¤ÂΤΥե£¡¼¥ë¥É¤Î¤¦¤Á¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤Ç +.I aio_fildes +°Ê³°¤Ë»ÈÍѤµ¤ì¤ë¤Î¤Ï +.I aio_sigevent +¥Õ¥£¡¼¥ë¥É (\fIstruct sigevent\fP) ¤Î¤ß¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢´°Î»»þ¤ÎÈóƱ´üÄÌÃΤ˻ÈÍѤ·¤¿¤¤¥¿¥¤¥×¤ò¼¨¤¹¡£ +¤½¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç (Ʊ´ü¥ê¥¯¥¨¥¹¥È¤ò¥­¥å¡¼¤ËÆþ¤ì¤ë¤Î¤ËÀ®¸ù¤·¤¿¾ì¹ç)¡¢ +¤³¤Î´Ø¿ô¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +¥ê¥½¡¼¥¹¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B EBADF +.I aio_fildes +¤¬½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINVAL +¤³¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëƱ´ü I/O ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤Þ¤¿¤Ï +.I op +¤¬ +.B O_SYNC +¤Ç¤â +.B O_DSYNC +¤Ç¤â¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.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/release/man3/aio_read.3 b/release/man3/aio_read.3 new file mode 100644 index 00000000..56ebd289 --- /dev/null +++ b/release/man3/aio_read.3 @@ -0,0 +1,128 @@ +.\" 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" +.SH ̾Á° +aio_read \- ÈóƱ´ü¤ÇÆɤ߹þ¤à +.SH ½ñ¼° +.B "#include " +.sp +.BI "int aio_read(struct aiocb *" aiocbp ); +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.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 +¥Ç¡¼¥¿¤Ï¡¢¥«¥ì¥ó¥È¤Î¥Õ¥¡¥¤¥ë°ÌÃ֤˴ط¸¤Ê¤¯¡¢ÀäÂÐ¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È +.I aiocbp\->aio_offset +¤ò³«»ÏÅÀ¤È¤·¤ÆÆɤ߹þ¤Þ¤ì¤ë¡£ +¤³¤Î¥ê¥¯¥¨¥¹¥È¸å¤Î¡¢¥«¥ì¥ó¥È¤Î¥Õ¥¡¥¤¥ë°ÌÃ֤ϵ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.LP +¡ÖÈóƱ´ü¡×¤È¤Ï¡Ö¥ê¥¯¥¨¥¹¥È¤¬¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤¿¤é¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤Ï¤¹¤°¤ËÊÖ¤ë¡× +¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +¸Æ¤Ó½Ð¤·¤«¤éÌá¤Ã¤¿»þ¤Ë¡¢Æɤ߹þ¤ß¤Ï´°Î»¤·¤Æ¤¤¤ë¤«¤âÃΤì¤Ê¤¤¤·¡¢ +´°Î»¤·¤Æ¤¤¤Ê¤¤¤«¤âÃΤì¤Ê¤¤¡£ +.BR aio_error (3) +¤ò»È¤¦¤³¤È¤Ç´°Î»¤·¤¿¤«¤ò¥Æ¥¹¥È¤Ç¤­¤ë¡£ +.LP +.B _POSIX_PRIORITIZED_IO +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Æ¡¢ +¤«¤Ä¥Õ¥¡¥¤¥ë¤¬¤³¤ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +ÈóƱ´üÁàºî¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤«¤é +.I aiocbp\->aio_reqprio +¤ò°ú¤¤¤¿Í¥ÀèÅÙ¤ÇÅÐÏ¿ (submit) ¤µ¤ì¤ë¡£ +.LP +¥Õ¥£¡¼¥ë¥É +.I aiocbp\->aio_lio_opcode +¤Ï̵»ë¤µ¤ì¤ë¡£ +.LP +ºÇÂ祪¥Õ¥»¥Ã¥È¤òĶ¤¨¤¿Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤«¤é¤Ï¡¢²¿¤â¥Ç¡¼¥¿¤¬Æɤ߹þ¤Þ¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¥ê¥¯¥¨¥¹¥È¤Ï¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤º¡¢ +\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +¥¨¥é¡¼¤ÏºÇ½é¤Ë¸¡ÃΤµ¤ì¤¿¸å¤Ç¡¢ +(¾õÂÖ \-1 ¤òÊÖ¤¹) +.BR aio_return (3) +¤È +.RI ( errno +¤Ç¼èÆÀ¤Ç¤­¤ë +.B EBADF +¤Î¤è¤¦¤Ê¥¨¥é¡¼¾õÂÖ¤òÊÖ¤¹) +.BR aio_error (3) +¤ÇÊó¹ð¤µ¤ì¤ë¤À¤í¤¦¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +¥ê¥½¡¼¥¹¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B EBADF +.I aio_fildes +¤ÏÆɤ߹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.IR aio_offset , +.IR aio_reqprio , +.I aio_nbytes +¤Î¤¦¤Á 1 ¤Ä°Ê¾å¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.TP +.B ENOSYS +¤³¤Î´Ø¿ô¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EOVERFLOW +¥Õ¥¡¥¤¥ë¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¡¢ +¥Õ¥¡¥¤¥ë¤Î½ªÃ¼¤ÎÁ°¤«¤éÆɤ߹þ¤ß¤ò³«»Ï¤·¤Æ¡¢ +¾¯¤Ê¤¯¤È¤â 1 ¥Ð¥¤¥È¤òÆɤ߹þ¤â¤¦¤È¤·¤¿¡£ +¤·¤«¤·³«»Ï°ÌÃÖ¤¬¤³¤Î¥Õ¥¡¥¤¥ë¤ÎºÇÂ祪¥Õ¥»¥Ã¥È¤òĶ¤¨¤Æ¤¤¤¿¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +»ÈÍѤ¹¤ëÁ°¤ËÀ©¸æ¥Ö¥í¥Ã¥¯¤ò 0 ¤Ë¤·¤Æ¤ª¤¯¤Î¤Ï¡¢¤è¤¤¹Í¤¨¤Ç¤¢¤ë¡£ +¤³¤ÎÀ©¸æ¥Ö¥í¥Ã¥¯¤Ï¡¢Æɤ߹þ¤ßÁàºî¤¬¿Ê¹Ô¤·¤Æ¤¤¤ë´Ö¤ÏÊѹ¹¤¹¤Ù¤­¤Ç¤Ê¤¤¡£ +Æɤ߹þ¤Þ¤ì¤ë¥Ð¥Ã¥Õ¥¡Îΰè¤Ï +.\" ¤Þ¤¿¤ÏÁàºî¤ÎÀ©¸æ¥Ö¥í¥Ã¥¯¤Ï +Áàºî¤ÎºÇÃæ¤Ë¥¢¥¯¥»¥¹¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¤µ¤â¤Ê¤¤¤Èµ¯¤³¤ë·ë²Ì¤¬ÉÔÄê¤Ë¤Ê¤ë¡£ +¤³¤ì¤Ë´Þ¤Þ¤ì¤ë¥á¥â¥êÎΰè¤Ï¡¢Í­¸ú¤Ê¤Þ¤Þ¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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/release/man3/aio_return.3 b/release/man3/aio_return.3 new file mode 100644 index 00000000..2537f459 --- /dev/null +++ b/release/man3/aio_return.3 @@ -0,0 +1,71 @@ +.\" 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" +.SH ̾Á° +aio_return \- ÈóƱ´ü I/O Áàºî¤ÎÊÖ¤êÃÍ (return status) ¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B "#include " +.sp +.BI "ssize_t aio_return(struct aiocb *" aiocbp ); +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR aio_return () +´Ø¿ô¤Ï +.I aiocbp +¤Ç»Ø¤µ¤ì¤¿À©¸æ¥Ö¥í¥Ã¥¯¤Ë¤ª¤±¤ëÈóƱ´ü I/O ¥ê¥¯¥¨¥¹¥È¤ÎºÇ½ªÅª¤ÊÊÖ¤êÃͤòÊÖ¤¹¡£ +.LP +¤³¤Î´Ø¿ô¤Ï¡¢ +.BR aio_error (3) +¤¬ +.B EINPROGRESS +°Ê³°¤òÊÖ¤·¤¿¸å¤Ç¡¢ +Í¿¤¨¤é¤ì¤¿¥ê¥¯¥¨¥¹¥È¤ËÂФ·¤Æ 1 ²ó¤À¤±¸Æ¤Ð¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +ÈóƱ´ü I/O Áàºî¤¬´°Î»¤·¤¿¾ì¹ç¡¢¤³¤Î´Ø¿ô¤ÏƱ´ü +.IR read , +.IR write , +.I fsync +¥ê¥¯¥¨¥¹¥È¤Î¤È¤­¤ËÊÖ¤µ¤ì¤ë¤Î¤ÈƱ¤¸ÃͤòÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ÊÖ¤êÃͤÏ̤ÄêµÁ¤Ç¤¢¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¥¨¥é¡¼Ãͤ¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I aiocbp +¤¬¡¢ÊÖ¤êÃͤ¬¤Þ¤À¼èÆÀ¤µ¤ì¤Æ¤¤¤Ê¤¤ÈóƱ´ü I/O ¥ê¥¯¥¨¥¹¥È¤Î +À©¸æ¥Ö¥í¥Ã¥¯¤ò»Ø¤·¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.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/release/man3/aio_suspend.3 b/release/man3/aio_suspend.3 new file mode 100644 index 00000000..470d1124 --- /dev/null +++ b/release/man3/aio_suspend.3 @@ -0,0 +1,92 @@ +.\" 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" +.SH ̾Á° +aio_suspend \- ÈóƱ´ü I/O Áàºî¤Þ¤¿¤Ï¥¿¥¤¥à¥¢¥¦¥È¤òÂÔ¤Ä +.SH ½ñ¼° +.nf +.sp +.B "#include " +.sp +.BI "int aio_suspend(const struct aiocb * const " cblist [], +.br +.BI " int " n ", const struct timespec *" timeout ); +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.SH ÀâÌÀ +.BR aio_suspend () +´Ø¿ô¤Ï¡¢Ä¹¤µ +.I n +¤Î¥ê¥¹¥È +.I cblist +¤Ë´Þ¤Þ¤ì¤ëÈóƱ´ü I/O ¥ê¥¯¥¨¥¹¥È¤Î¤¦¤Á¾¯¤Ê¤¯¤È¤â 1 ¤Ä¤¬´°Î»¤¹¤ë¤«¡¢ +¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤«¡¢ +.I timeout +¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä¤½¤Î»þ´Ö¤¬²á¤®¤ë¤Þ¤Ç¡¢ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤òÄä»ß (suspend) ¤¹¤ë¡£ +.LP +¥ê¥¹¥È¤Î³Æ¥¢¥¤¥Æ¥à¤Ï¡¢NULL (¤³¤ì¤Ï̵»ë¤µ¤ì¤ë) ¤«¡¢ +.BR aio_read (3), +.BR aio_write (3), +.BR lio_listio (3) +¤ò»È¤Ã¤Æ I/O ¤¬³«»Ï¤µ¤ì¤¿À©¸æ¥Ö¥í¥Ã¥¯¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.LP +.B CLOCK_MONOTONIC +¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤ë¾ì¹ç¡¢ +¤³¤Î¥¯¥í¥Ã¥¯¤ò»È¤Ã¤Æ¥¿¥¤¥à¥¢¥¦¥È¤Î´Ö³Ö¤¬·×¬¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +»Ø¼¨¤µ¤ì¤¿¥ê¥¯¥¨¥¹¥È¤Î 1 ¤Ä¤¬´°Î»¤·¤¿¸å¤Ë¤³¤Î´Ø¿ô¤¬ÊÖ¤ë¾ì¹ç¤Ï¡¢0 ¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¤Æ¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +»Ø¼¨¤µ¤ì¤¿Áàºî¤Î¤É¤ì¤â´°Î»¤·¤Ê¤¤¤¦¤Á¤Ë¡¢ +¤³¤Î¸Æ¤Ó½Ð¤·¤¬¥¿¥¤¥à¥¢¥¦¥È¤Ë¤è¤Ã¤Æ½ªÎ»¤µ¤»¤é¤ì¤¿¡£ +.TP +.B EINTR +¤³¤Î¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ½ªÎ»¤µ¤»¤é¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +(¤³¤Î¥·¥°¥Ê¥ë¤Ï¡¢´°Î»¤òÂԤäƤ¤¤¿Áàºî¤Î¤¤¤º¤ì¤«¤Î´°Î»¥·¥°¥Ê¥ë¤Î²ÄǽÀ­¤â¤¢¤ë¡£) +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +»þ´Ö´Ö³Ö¤¬ 0 ¤Ç¤¢¤ë¤³¤È¤ò»ØÄꤹ¤ë NULL ¤Ç¤Ï¤Ê¤¤ +.I timeout +¤ò»È¤Ã¤Æ¡¢¥Ý¡¼¥ê¥ó¥°¤ò¹Ô¤¦¤³¤È¤â¤Ç¤­¤ë¡£ +.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/release/man3/aio_write.3 b/release/man3/aio_write.3 new file mode 100644 index 00000000..5e8d5dba --- /dev/null +++ b/release/man3/aio_write.3 @@ -0,0 +1,130 @@ +.\" 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" +.SH ̾Á° +aio_write \- ÈóƱ´ü¤Ç½ñ¤­¹þ¤à +.SH ½ñ¼° +.B "#include " +.sp +.BI "int aio_write(struct aiocb *" aiocbp ); +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.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 +.B O_APPEND +¤¬ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢¥«¥ì¥ó¥È¤Î¥Õ¥¡¥¤¥ë°ÌÃ֤˴ط¸¤Ê¤¯¡¢ +¥Ç¡¼¥¿¤ÏÀäÂÐ¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È +.I aiocbp\->aio_offset +¤ò³«»ÏÅÀ¤È¤·¤Æ½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.B O_APPEND +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥Ç¡¼¥¿¤Ï¥Õ¥¡¥¤¥ë¤Î½ªÃ¼¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +¤³¤Î¥ê¥¯¥¨¥¹¥È¤Î¸å¤Î¡¢¥«¥ì¥ó¥È¤Î¥Õ¥¡¥¤¥ë°ÌÃ֤ϵ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.LP +¡ÖÈóƱ´ü¡×¤È¤Ï¡Ö¥ê¥¯¥¨¥¹¥È¤¬¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤¿¤é¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤Ï¤¹¤°¤ËÊÖ¤ë¡× +¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +¸Æ¤Ó½Ð¤·¤«¤éÌá¤Ã¤¿»þ¤Ë¡¢½ñ¤­¹þ¤ß¤Ï´°Î»¤·¤Æ¤¤¤ë¤«¤âÃΤì¤Ê¤¤¤·¡¢ +´°Î»¤·¤Æ¤¤¤Ê¤¤¤«¤âÃΤì¤Ê¤¤¡£ +.BR aio_error (3) +¤ò»È¤¦¤³¤È¤Ç´°Î»¤·¤¿¤«¤ò¥Æ¥¹¥È¤Ç¤­¤ë¡£ +.LP +.B _POSIX_PRIORITIZED_IO +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Æ¡¢ +¤«¤Ä¥Õ¥¡¥¤¥ë¤¬¤³¤ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +ÈóƱ´üÁàºî¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤«¤é +.I aiocbp\->aio_reqprio +¤ò°ú¤¤¤¿Í¥ÀèÅÙ¤ÇÅÐÏ¿ (submit) ¤µ¤ì¤ë¡£ +.LP +¥Õ¥£¡¼¥ë¥É +.I aiocbp\->aio_lio_opcode +¤Ï̵»ë¤µ¤ì¤ë¡£ +.LP +ºÇÂ祪¥Õ¥»¥Ã¥È¤òĶ¤¨¤¿Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢²¿¤â¥Ç¡¼¥¿¤¬½ñ¤­¹þ¤Þ¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¥ê¥¯¥¨¥¹¥È¤Ï¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤º¡¢ +\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +¥¨¥é¡¼¤ÏºÇ½é¤Ë¸¡ÃΤµ¤ì¤¿¸å¤Ç¡¢ +(¾õÂÖ \-1 ¤òÊÖ¤¹) +.BR aio_return (3) +¤È +.RI ( errno +¤Ç¼èÆÀ¤Ç¤­¤ë +.B EBADF +¤Î¤è¤¦¤Ê¥¨¥é¡¼¾õÂÖ¤òÊÖ¤¹) +.BR aio_error (3) +¤ÇÊó¹ð¤µ¤ì¤ë¤À¤í¤¦¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +¥ê¥½¡¼¥¹¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B EBADF +.I aio_fildes +¤Ï½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EFBIG +¥Õ¥¡¥¤¥ë¤ÏÄ̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¡¢¾¯¤Ê¤¯¤È¤â 1 ¥Ð¥¤¥È¤ò½ñ¤­¹þ¤â¤¦¤È¤·¤Æ¤¤¤ë¡£ +¤·¤«¤·³«»Ï°ÌÃÖ¤¬¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ÎºÇÂ祪¥Õ¥»¥Ã¥È¤ÈƱ¤¸¤«¤½¤ì¤òĶ¤¨¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.IR aio_offset , +.IR aio_reqprio , +.I aio_nbytes +¤Î¤¦¤Á 1 ¤Ä°Ê¾å¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.TP +.B ENOSYS +¤³¤Î´Ø¿ô¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +»ÈÍѤ¹¤ëÁ°¤ËÀ©¸æ¥Ö¥í¥Ã¥¯¤ò 0 ¤Ë¤·¤Æ¤ª¤¯¤Î¤Ï¡¢¤è¤¤¹Í¤¨¤Ç¤¢¤ë¡£ +¤³¤ÎÀ©¸æ¥Ö¥í¥Ã¥¯¤Ï¡¢Æɤ߹þ¤ßÁàºî¤¬¿Ê¹Ô¤·¤Æ¤¤¤ë´Ö¤ÏÊѹ¹¤¹¤Ù¤­¤Ç¤Ê¤¤¡£ +Æɤ߹þ¤Þ¤ì¤ë¥Ð¥Ã¥Õ¥¡Îΰè¤Ï +.\" ¤Þ¤¿¤ÏÁàºî¤ÎÀ©¸æ¥Ö¥í¥Ã¥¯¤Ï +Áàºî¤ÎºÇÃæ¤Ë¥¢¥¯¥»¥¹¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¤µ¤â¤Ê¤¤¤Èµ¯¤³¤ë·ë²Ì¤¬ÉÔÄê¤Ë¤Ê¤ë¡£ +¤³¤ì¤Ë´Þ¤Þ¤ì¤ë¥á¥â¥êÎΰè¤Ï¡¢Í­¸ú¤Ê¤Þ¤Þ¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.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/release/man3/alloca.3 b/release/man3/alloca.3 new file mode 100644 index 00000000..cde5ab8f --- /dev/null +++ b/release/man3/alloca.3 @@ -0,0 +1,158 @@ +.\" Copyright (c) 1980, 1991 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. +.\" +.\" @(#)alloca.3 5.1 (Berkeley) 5/2/91 +.\" +.\" Converted Mon Nov 29 11:05:55 1993 by Rik Faith +.\" Modified Tue Oct 22 23:41:56 1996 by Eric S. Raymond +.\" Modified 2002-07-17, aeb +.\" 2008-01-24, mtk: +.\" 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" +.SH ̾Á° +alloca \- ¼«Æ°Åª¤Ë²òÊü¤µ¤ì¤ë¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "void *alloca(size_t " size ); +.SH ÀâÌÀ +.BR alloca () +´Ø¿ô¤Ï¡¢ +.I size +¥Ð¥¤¥È¤ÎÎΰè¤ò¸Æ½Ð¸µ¤Î¥¹¥¿¥Ã¥¯¡¦¥Õ¥ì¡¼¥à¤Ë³ä¤êÉÕ¤±¤ë¡£ +¤³¤Î°ì»þŪ¤ÊÎΰè¤Ï¡¢ +.BR alloca () +¤ò¸Æ¤Ó½Ð¤·¤¿´Ø¿ô¤¬¸Æ½Ð¸µ¤ËÊÖ¤ë¤È¤­¤Ë¼«Æ°Åª¤Ë²òÊü¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR alloca () +´Ø¿ô¤Ï¡¢³ä¤êÉÕ¤±¤¿Îΰè¤Î»Ï¤Þ¤ê¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +³ä¤êÉÕ¤±¤Ë¤è¤Ã¤Æ¥¹¥¿¥Ã¥¯¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬µ¯¤Ã¤¿¾ì¹ç¤Î +¥×¥í¥°¥é¥à¤ÎÆ°ºî¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ + +32V, PWB, PWB.2, 3BSD, 4BSD ¤Ë +.BR alloca () +´Ø¿ô¤¬Åо줷¤¿¾Úµò¤¬¤¢¤ë¡£ +4.3BSD ¤Ë¤Ï¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤¬¤¢¤ë¡£ +Linux ¤Ï¡¢GNU ÈǤò»È¤Ã¤Æ¤¤¤ë¡£ +¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +.BR alloca () +´Ø¿ô¤Ï¡¢µ¡¼ï¤È¥³¥ó¥Ñ¥¤¥é¤Ë°Í¸¤¹¤ë¡£ +ÆÃÄê¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ò»È¤¦¤È +.BR malloc (3) +¤È +.BR free (3) +¤òÁȤ߹ç¤ï¤»¤Æ»È¤Ã¤¿¾ì¹ç¤ËÈæ¤Ù¤Æ¸úΨ¤ò²þÁ±¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +ÆÃÄê¤Î¾ì¹ç¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ò»È¤¦¤³¤È¤Ç¡¢ +.BR longjmp (3) +¤ä +.BR siglongjmp (3) +¤ò»È¤¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Î¥á¥â¥ê¤Î³«Êü¤ò´Êñ¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Î»ÈÍѤϿ侩¤µ¤ì¤Ê¤¤¡£ + +.BR alloca () +¤Ë¤è¤ê³ä¤êÅö¤Æ¤é¤ì¤ë¶õ´Ö¤Ï¥¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤«¤é³ä¤êÅö¤Æ¤é¤ë¤Î¤Ç¡¢ +´Ø¿ô¤ÎÌá¤êÀ褬 +.BR longjmp (3) +¤ä +.BR siglongjmp (3) +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ê¥¸¥ã¥ó¥×¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +³ä¤êÅö¤Æ¤é¤ì¤¿¶õ´Ö¤Ï¼«Æ°Åª¤Ë²òÊü¤µ¤ì¤ë¡£ + +.BR alloca () +¤Ç³ä¤êÅö¤Æ¤é¤ì¤¿¶õ´Ö¤ò +.BR free (3) +¤·¤è¤¦¤È¤¹¤ë¤³¤È¤Î¤Ê¤¤¤è¤¦¤Ë¡ª +.SH Ãí°Õ +.SS GNU ÈǤˤĤ¤¤Æ¤ÎÃí°Õ +Ä̾ï +.BR gcc (1) +¤Ï +.BR alloca () +¤Î¸Æ¤Ó½Ð¤·¤ò¥¤¥ó¥é¥¤¥ó¥³¡¼¥É¤ËÊÑ´¹¤¹¤ë¡£ +.IR "\-ansi" , +.IR "\-std=c89" , +.IR "\-std=c99" , +.IR "\-fno\-builtin" +¤Î¤¤¤º¤ì¤«¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¤³¤ÎÊÑ´¹¤Ï¹Ô¤ï¤ì¤Ê¤¤ +(¤Þ¤¿ +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤â¹Ô¤ï¤ì¤Ê¤¤)¡£ +¤À¤À¤·¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï glibc ÈǤΠ+.I +¤Ï +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ¤ª¤ê¡¢¤³¤ì¤Ë¤Ï°Ê²¼¤Î¹Ô¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤Î¤ÇÃí°Õ¤¹¤ë¤³¤È¡£ +.nf + + #define alloca(size) __builtin_alloca (size) + +.fi +Æȼ«ÈǤΠ__builtin_alloca (size) ´Ø¿ô¤¬¤¢¤ë¤ÈÌñ²ð¤Ê·ë²Ì¤Ë¤Ê¤ë¡£ +.LP +¤³¤Î¥³¡¼¥É¤Ï¥¤¥ó¥é¥¤¥ó²½¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢ +¤³¤Î´Ø¿ô¤Î¥¢¥É¥ì¥¹¤ò¼èÆÀ¤·¤¿¤ê¡¢ +¾¤Î¥é¥¤¥Ö¥é¥ê¤ò¥ê¥ó¥¯¤·¤ÆÆ°ºî¤òÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.LP +Ä̾盧¤Î¥¤¥ó¥é¥¤¥ó¥³¡¼¥É¤Ï¥¹¥¿¥Ã¥¯¥Ý¥¤¥ó¥¿¤ò°ÜÆ°¤¹¤ë +1 ¤Ä¤ÎÌ¿Îá (instruction) ¤«¤é¹½À®¤µ¤ì¤Æ¤ª¤ê¡¢ +¥¹¥¿¥Ã¥¯¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ò¥Á¥§¥Ã¥¯¤·¤Ê¤¤¡£ +¤è¤Ã¤Æ NULL ¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.SH ¥Ð¥° +¥¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤¬³ÈÄ¥¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥¨¥é¡¼ÄÌÃΤϹԤï¤ì¤Ê¤¤¡£ +(¤·¤«¤·¤Ê¤¬¤é¡¢³ä¤êÅö¤Æ¤Ë¼ºÇÔ¤·¤¿¸å¤Ç¡¢¥×¥í¥°¥é¥à¤¬³ä¤êÅö¤Æ¤é¤ì¤Ê¤«¤Ã¤¿ +¶õ´Ö¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë +.B SIGSEGV +¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¤³¤È¤À¤í¤¦¡£) + +¿¤¯¤Î¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¡¢´Ø¿ô¥³¡¼¥ë¤Î°ú¤­¿ô¤Î¥ê¥¹¥ÈÆâ¤Ç¤Ï +.BR alloca () +¤¬»È¤¨¤Ê¤¤¡£ +¤³¤ì¤Ï¡¢ +.BR alloca () +¤Ë¤è¤Ã¤ÆͽÌ󤵤ì¤ë¥¹¥¿¥Ã¥¯Îΰ褬¡¢ +´Ø¿ô°ú¤­¿ô¤Ë»È¤ï¤ì¤ë¥¹¥¿¥Ã¥¯Îΰè¤ÎÃæ¤Ë¸½¤ì¤Æ¤·¤Þ¤¦¤¿¤á¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR brk (2), +.BR longjmp (3), +.BR malloc (3) diff --git a/release/man3/argz_add.3 b/release/man3/argz_add.3 new file mode 100644 index 00000000..a800befa --- /dev/null +++ b/release/man3/argz_add.3 @@ -0,0 +1,214 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" based on the description in glibc source and infopages +.\" +.\" Corrections and additions, aeb +.\" +.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI, all rights reserved. +.\" Translated Mon Feb 2 2003 by Akihiro MOTOKI +.\" +.TH ARGZ_ADD 3 2007-05-18 "" "Linux Programmer's Manual" +.SH ̾Á° +argz_add, argz_add_sep, argz_append, argz_count, argz_create, +argz_create_sep, argz_delete, argz_extract, argz_insert, +argz_next, argz_replace, argz_stringify \- argz ¥ê¥¹¥È¤òÁàºî¤¹¤ë¤¿¤á¤Î´Ø¿ô·² +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "error_t argz_add(char **" argz ", size_t *" argz_len \ +", const char *" str ); +.sp +.BI "error_t argz_add_sep(char **" argz ", size_t *" argz_len , +.ti 20n +.BI "const char *" str ", int " delim ); +.sp +.BI "error_t argz_append(char **" argz ", size_t *" argz_len , +.ti 20n +.BI "const char *" buf ", size_t " buf_len ); +.sp +.BI "size_t argz_count(const char *" argz ", size_t " argz_len ); +.sp +.BI "error_t argz_create(char * const " argv "[], char **" argz , +.ti 20n +.BI "size_t *" argz_len ); +.sp +.BI "error_t argz_create_sep(const char *" str ", int " sep ", char **" argz , +.ti 20n +.BI "size_t *" argz_len ); +.sp +.BI "error_t argz_delete(char **" argz ", size_t *" argz_len ", char *" entry ); +.sp +.BI "void argz_extract(char *" argz ", size_t " argz_len ", char **" argv ); +.sp +.BI "error_t argz_insert(char **" argz ", size_t *" argz_len ", char *" before , +.ti 20n +.BI "const char *" entry ); +.sp +.BI "char *argz_next(char *" argz ", size_t " argz_len ", const char *" entry ); +.sp +.BI "error_t argz_replace(char **" argz ", size_t *" argz_len \ +", const char *" str , +.ti 20n +.BI "const char *" with ", unsigned int *" replace_count ); +.sp +.BI "void argz_stringify(char *" argz ", size_t " len ", int " sep ); +.fi +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¸ÇÍ­¤Ç¤¢¤ë¡£ +.LP +argz vector ¤ÏŤµ¾ðÊóÉÕ¤­¤Îʸ»ú¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +ʸ»ú¥Ð¥Ã¥Õ¥¡¤Ç¤Ï¡¢Ê£¿ô¤Îʸ»úÎó¤¬ NULL ¥Ð¥¤¥È (\\(aq\\0\\(aq) ¤Ç¶èÀÚ¤é¤ì¤Æ¤ª¤ê¡¢ +ʸ»úÎó¤ÎÇÛÎó¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +Ťµ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢¥Ð¥Ã¥Õ¥¡¤ÎºÇ¸å¤Î¥Ð¥¤¥È¤Ï NULL ¥Ð¥¤¥È¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.LP +¤³¤ì¤é¤Î´Ø¿ô¤Ï argz vector ¤òÁàºî¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¥Ú¥¢ (NULL,0) ¤Ï argz vector ¤Ç¤¢¤ê¡¢µÕ¤Ë¸À¤¨¤Ð +Ťµ 0 ¤Î argz vector¤Ï NULL ¥Ý¥¤¥ó¥¿¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¶õ¤Ç¤Ê¤¤ argz vector ¤Î³ä¤êÅö¤Æ¤Ï +.BR malloc (3) +¤ò»È¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢argz vector ¤ò²òÊü¤¹¤ë¤Î¤Ë +.BR free (3) +¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +.BR argz_add () +¤Ï¡¢Ê¸»úÎó +.I str +¤òÇÛÎó +.IR *argz +¤ÎËöÈø¤ËÄɲä·¡¢ +.IR *argz +¤È +.IR *argz_len +¤ò¹¹¿·¤¹¤ë¡£ +.LP +.BR argz_add_sep () +¤âƱÍͤÎÆ°ºî¤ò¤¹¤ë¤¬¡¢¶èÀÚ¤êʸ»ú +.I delim +¤Ë¤·¤¿¤¬¤Ã¤Æʸ»úÎó +.I str +¤òÊ£¿ô¤Îʸ»úÎó¤Ëʬ³ä¤¹¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +Î㤨¤Ð¡¢¶èÀÚ¤êʸ»ú \\(aq:\\(aq ¤ò»ØÄꤷ¤Æ¡¢Unix ¥µ¡¼¥Á¡¦¥Ñ¥¹¤ËÂФ·¤Æ +¤³¤Î´Ø¿ô¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¤À¤í¤¦¡£ +.LP +.BR argz_append () +¤Ï argz vector +.RI ( buf ,\ buf_len ) +¤Î¸å¤í¤Ë +.RI (* argz ,\ *argz_len ) +¤òÉÕ¤±²Ã¤¨¡¢ +.I *argz +¤È +.I *argz_len +¤ò¹¹¿·¤¹¤ë¡£ +(¤·¤¿¤¬¤Ã¤Æ¡¢ +.I *argz_len +¤Ï +.I buf_len +¤À¤±Áý²Ã¤¹¤ë¡£) +.LP +.BR argz_count () +¤Ï +.RI ( argz ,\ argz_len ) +Æâ¤Îʸ»úÎó¤Î¿ô¤ò¿ô¤¨¤ë¡£¼ÂºÝ¤Ë¤Ï NULL ¥Ð¥¤¥È (\\(aq\\0\\(aq) ¤Î¿ô¤ò¿ô¤¨¤Æ¤¤¤ë¡£ +.LP +.BR argz_create () +¤Ï¡¢Unix ή¤Î°ú¤­¿ô¥Ù¥¯¥È¥ë¤Ç¤¢¤ë +.RI ( "(char *) 0" +¤Ç½ªÃ¼¤µ¤ì¤ë) +.I argv +¤ò¡¢argz vector +.RI ( *argz ,\ *argz_len ) +¤ËÊÑ´¹¤¹¤ë¡£ +.LP +.BR argz_create_sep () +¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó +.I str +¤ò¶èÀÚ¤êʸ»ú +.I sep +¤¬¸½¤ì¤ëËè¤Ëʬ³ä¤·¤Ê¤¬¤é¡¢argz vector +.RI (* argz ,\ *argz_len ) +¤ËÊÑ´¹¤¹¤ë¡£ +.LP +.BR argz_delete () +¤Ï¡¢ +.I entry +¤Ç»Ø¤·¼¨¤µ¤ì¤¿Ê¸»úÎó¤ò argz vector +.RI ( *argz ,\ *argz_len ) +¤«¤éºï½ü¤·¡¢ +.I *argz +¤È +.I *argz_len +¤ò¹¹¿·¤¹¤ë¡£ +.LP +.BR argz_extract () +¤Ï +.BR argz_create () +¤ÎÈ¿ÂФÎÁàºî¤ò¹Ô¤¦¡£argz vector +.RI ( argz ,\ argz_len ) +¤òÄ´¤Ù¡¢ +.I argv +¤«¤é»Ï¤Þ¤ëÇÛÎó¤ò¥µ¥Öʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÇËä¤á¤Æ¤¤¤­¡¢ +°ìÈֺǸå¤Ë NULL ¤òÆþ¤ì¤Æ¡¢Unix ή¤Î argv ¥Ù¥¯¥È¥ë¤òºîÀ®¤¹¤ë¡£ +ÇÛÎó +.I argv +¤Ï +.IR argz_count ( argz , argz_len ") + 1" +¸Ä¤Î¥Ý¥¤¥ó¥¿¤ò¼ýÍƤǤ­¤ë¶õ´Ö¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.LP +.BR argz_insert () +¤Ï +.BR argz_delete () +¤ÎÈ¿ÂФÎÁàºî¤ò¹Ô¤¦¡£argz vector +.RI ( *argz ,\ *argz_len ) +¤Î°ÌÃÖ +.I before +¤Ë°ú¤­¿ô +.I entry +¤òÁÞÆþ¤·¡¢ +.I *argz +¤È +.I *argz_len +¤ò¹¹¿·¤¹¤ë¡£ +.I before +¤¬ NULL ¤Î¾ì¹ç¡¢ +.I entry +¤ÏËöÈø¤ËÁÞÆþ¤µ¤ì¤ë¡£ +.LP +.BR argz_next () +¤Ï argz vector ¤ò½çÈÖ¤ËÄ´¤Ù¤ë¤¿¤á¤Î´Ø¿ô¤Ç¤¢¤ë¡£ +.I entry +¤¬ NULL ¤Î¾ì¹ç¡¢ºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +¼¡¤Î¥¨¥ó¥È¥ê¤¬¤Ê¤¤¾ì¹ç¡¢NULL ¤òÊÖ¤¹¡£ +.LP +.BR argz_replace () +¤Ï¡¢ +.I str +¤ò¤¹¤Ù¤Æ +.I with +¤ÇÃÖ¤­´¹¤¨¤ë (ɬÍפ˱þ¤¸¤Æ argz ¤ÎºÆ³ä¤êÅö¤Æ¤ò¹Ô¤¦)¡£ +.I replace_count +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I *replace_count +¤òÃÖ¤­´¹¤¨¤ò¹Ô¤Ã¤¿¿ô¤À¤±Áý¤ä¤¹¡£ +.LP +.BR argz_stringify () +¤Ï +.BR argz_create_sep () +¤ÎÈ¿ÂФÎÁàºî¤ò¹Ô¤¦¡£ +ËöÈø¤Î NULL ¥Ð¥¤¥È°Ê³°¤ÎÁ´¤Æ¤Î NULL ¥Ð¥¤¥È (\\(aq\\0\\(aq) ¤ò +.I sep +¤ÇÃÖ¤­´¹¤¨¤Æ¡¢ +argz vector ¤òÄ̾ï¤Îʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +¥á¥â¥ê³ä¤êÅö¤Æ¤ò¹Ô¤¦ argz ´Ø¿ô·²¤Ï¤¹¤Ù¤Æ \fIerror_t\fP ·¿¤ÎÊÖ¤êÃͤò»ý¤Ä¡£ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤·¡¢³ä¤êÅö¤Æ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï +\fBENOMEM\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£Ãí°Õ¤·¤Æ»ÈÍѤ¹¤ë¤³¤È¡£ +.SH ¥Ð¥° +NULL ¥Ð¥¤¥È¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤ argz vector ¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢ +segmentation fault ¤òµ¯¤³¤¹¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR envz_add (3) diff --git a/release/man3/asin.3 b/release/man3/asin.3 new file mode 100644 index 00000000..bd81c5ff --- /dev/null +++ b/release/man3/asin.3 @@ -0,0 +1,118 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +asin, asinf, asinl \- µÕÀµ¸¹¡Êarc sine¡Ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double asin(double " x ); +.br +.BI "float asinf(float " x ); +.br +.BI "long double asinl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR asinf (), +.BR asinl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR asin () +´Ø¿ô¤Ï \fIx\fP ¤ÎµÕÀµ¸¹¡Êarc sine) ¤Î¼çÃͤò·×»»¤¹¤ë¡£ +¤¹¤Ê¤ï¤Á¡¢¤½¤ÎÀµ¸¹¡Êsine¡Ë¤¬ \fIx\fP ¤È¤Ê¤ë¤è¤¦¤ÊÃͤǤ¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎµÕÀµ¸¹¤Î¼çÃͤò¥é¥¸¥¢¥óñ°Ì¤ÇÊÖ¤¹¡£ +ÊÖ¤êÃÍ¤Ï [\-pi/2,\ pi/2] ¤ÎÈϰϤȤʤ롣 + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 (\-0) ¤Î¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.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. +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬ [\-1,\ 1] ¤ÎÈϰϤËÆþ¤Ã¤Æ¤¤¤Ê¤¤ +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +̵¸ú (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï 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) diff --git a/release/man3/asinh.3 b/release/man3/asinh.3 new file mode 100644 index 00000000..ee5234bb --- /dev/null +++ b/release/man3/asinh.3 @@ -0,0 +1,107 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2008-08-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +asinh, asinhf, asinhl \- µÕÁжÊÀþÀµ¸¹¡Êinverse hyperbolic sine¡Ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double asinh(double " x ); +.br +.BI "float asinhf(float " x ); +.br +.BI "long double asinhl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR asinh (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR asinhf (), +.BR asinhl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR asinh () +´Ø¿ô¤Ï \fIx\fP µÕÁжÊÀþÀµ¸¹¡Êinverse hyperbolic sine¡Ë¤ò +·×»»¤¹¤ë¡£¤¹¤Ê¤ï¤Á¡¢¤½¤ÎÁжÊÀþÀµ¸¹¡Êhyperbolic sine¡Ë¤¬ \fIx\fP ¤Ë +¤Ê¤ë¤è¤¦¤ÊÃͤǤ¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎµÕÁжÊÀþÀµ¸¹¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 (\-0) ¤Î¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\" +.\" POSIX.1-2001 documents an optional range error for subnormal x; +.\" glibc 2.8 does not do this. +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR acosh (3), +.BR atanh (3), +.BR casinh (3), +.BR cosh (3), +.BR sinh (3), +.BR tanh (3) diff --git a/release/man3/asprintf.3 b/release/man3/asprintf.3 new file mode 100644 index 00000000..91009456 --- /dev/null +++ b/release/man3/asprintf.3 @@ -0,0 +1,73 @@ +.\" 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. +.\" +.\" Text fragments inspired by Martin Schulze . +.\" +.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. +.\" Translated Mon 14 Jan 2002 by NAKANO Takeo +.\" +.TH ASPRINTF 3 2001-12-18 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +asprintf, vasprintf \- ʸ»úÎó¤ò³ä¤êÅö¤Æ¤Æ¤½¤ì¤Ë½ÐÎϤ¹¤ë +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int asprintf(char **" strp ", const char *" fmt ", ...);" +.sp +.BI "int vasprintf(char **" strp ", const char *" fmt ", va_list " ap ); +.SH ÀâÌÀ +.BR asprintf () +´Ø¿ô¤È +.BR vasprintf () +´Ø¿ô¤È¤Ï¡¢¤½¤ì¤¾¤ì +.BR sprintf (3) +´Ø¿ô¤È +.BR vsprintf (3) +´Ø¿ô¤È¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ +½ÐÎÏʸ»úÎó¤ò (½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤â´Þ¤á¤Æ) +ÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Î¥á¥â¥ê¤ò³ÎÊݤ·¡¢ +ºÇ½é¤Î°ú¿ô¤Ë¤½¤Îʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢ÉÔÍפˤʤ俤é +.BR free (3) +¤ËÅϤ·¡¢³ä¤êÅö¤Æ¤é¤ì¤¿µ­²±Îΰè¤ò²òÊü¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï½ÐÎϤµ¤ì¤¿¥Ð¥¤¥È¿ô¤ò +.RB ( sprintf (3) +¤Î¤è¤¦¤Ë) ÊÖ¤¹¡£ +¥á¥â¥ê¤Î³ä¤êÅö¤Æ¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¤ê¡¢ +¤½¤Î¾¥¨¥é¡¼¤¬À¸¤¸¤ë¤È¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤Ï \-1 ¤òÊÖ¤·¡¢ +.I strp +¤ÎÆâÍƤÏ̤ÄêµÁ¤È¤Ê¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢C ¤ä POSIX ¤Î¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +¤³¤ì¤é¤Ï *BSD ¤Ç¤âÍøÍѤǤ­¤ë¡£ +FreeBSD ¤Î¼ÂÁõ¤Ç¤Ï¡¢¥¨¥é¡¼¤ÎºÝ¤Ë¤Ï +.I strp +¤ò NULL ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR free (3), +.BR malloc (3), +.BR printf (3), +.BR feature_test_macros (7) diff --git a/release/man3/assert.3 b/release/man3/assert.3 new file mode 100644 index 00000000..f4cbd725 --- /dev/null +++ b/release/man3/assert.3 @@ -0,0 +1,84 @@ +.\" 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 21:42:42 1993 by Rik Faith +.\" Modified Tue Oct 22 23:44:11 1996 by Eric S. Raymond +.\" +.\" Japanese Version Copyright (c) 1996 Kentaro OGAWA +.\" all rights reserved. +.\" Translated Sun, 14 Jul 1996 01:33:26 +0900 +.\" by Kentaro OGAWA +.\" Updated Fri 6 Oct JST 2000 by Kentaro Shirakata +.\" Updated Thu 19 Sep JST 2002 by Kentaro Shirakata +.\" +.TH ASSERT 3 2002-08-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +assert \- ¿ÇÃǤ¬µ¶¤Î»þ¤Ë¥×¥í¥°¥é¥à¤òÃæ»ß¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void assert(scalar " expression ); +.fi +.SH ÀâÌÀ +.I +¤¬ºÇ¸å¤Ë¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤¿»þÅÀ¤Ç¡¢ +.B NDEBUG +¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢ +.BR assert () +¥Þ¥¯¥í¤Ï²¿¤Î¥³¡¼¥É¤âÀ¸À®¤»¤º¡¢½¾¤Ã¤ÆÁ´¤¯²¿¤â¤·¤Ê¤¤¡£ +¤µ¤â¤Ê¤±¤ì¤Ð¡¢ +.BR assert (3) +¥Þ¥¯¥í¤Ï +.I expression +¤¬µ¶¤Î»þ(¤¹¤Ê¤ï¤Á¡¢Èæ³Ó¤Î·ë²Ì¤¬0¤ÈÅù¤·¤¤»þ)¤Ë +ɸ½à¥¨¥é¡¼½ÐÎϤ˥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¡¢¤µ¤é¤Ë +.BR abort () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥×¥í¥°¥é¥à¤ò½ªÎ»¤µ¤»¤ë¡£ +.LP +¤³¤Î¥Þ¥¯¥í¤ÎÌÜŪ¤Ï¡¢¥×¥í¥°¥é¥Þ¡¼¤¬¥×¥í¥°¥é¥à¤Î¥Ð¥°¤òȯ¸«¤¹¤ë¼ê½õ¤±¤ò +¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£"assertion failed in file foo.c, function do_bar(), line 1287" +¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤Ï¥æ¡¼¥¶¡¼¤Ë¤Ï²¿¤Î½õ¤±¤Ë¤â¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +ÃͤÏÊÖ¤µ¤ì¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001, C89, C99. +C89 ¤Ç¤Ï +.B expression +¤Ï +.I int +·¿¤Ç¤¢¤ë¤³¤È¤¬É¬ÍפȤµ¤ì¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤ÎÆ°ºî¤Ï̤ÄêµÁ¤È¤µ¤ì¤Æ¤¤¤¿¡£ +¤·¤«¤· C99 ¤Ç¤Ï¤É¤Î¤è¤¦¤Ê¥¹¥«¥éÃͤǤâ¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤¿¡£ +.\" ¾ÜºÙ¤ÏÉÔ¶ñ¹çÊó¹ð 107 ¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥Ð¥° +.BR assert () +¤Ï¡¢¥Þ¥¯¥í¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£¤¹¤Ê¤ï¤Á¡¢ +»î¤µ¤ì¤Æ¤¤¤ë¼°¤¬ÉûºîÍѤò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¥Þ¥¯¥í +.B NDEBUG +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ë°Í¸¤·¤Æ¡¢¥×¥í¥°¥é¥à¤Î¿¶Éñ¤¤¤Ï°Û¤Ê¤ë¤À¤í¤¦¡£ +¤³¤ì¤Ë¤è¤Ã¤Æ¡¢¥Ð¥°½Ð¤·¤¹¤ë¤È¤­¤Ë¤Ï¾Ã¤¨¤Æ¤·¤Þ¤¦ +¥Ï¥¤¥¼¥ó¥Ð¥°(Heisenbugs)¤òÀ¸¤ß½Ð¤¹¤À¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR abort (3), +.BR assert_perror (3), +.BR exit (3) diff --git a/release/man3/assert_perror.3 b/release/man3/assert_perror.3 new file mode 100644 index 00000000..a83e418b --- /dev/null +++ b/release/man3/assert_perror.3 @@ -0,0 +1,78 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 05:09:37 JST 2003 +.\" by Akihiro MOTOKI +.\" +.TH ASSERT_PERROR 3 2002-08-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +assert_perror \- test errnum and abort +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "void assert_perror(int " errnum ); +.fi +.SH ÀâÌÀ +ºÇ¸å¤Ë +.I +¤¬¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤¿»þ¤Ë¥Þ¥¯¥í +.B NDEBUG +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢¥Þ¥¯¥í +.BR assert_perror () +¤Ï²¿¤Î¥³¡¼¥É¤âÀ¸À®¤»¤º¡¢¤·¤¿¤¬¤Ã¤ÆÁ´¤¯²¿¤â¤·¤Ê¤¤¡£ +¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢¥Þ¥¯¥í +.BR assert_perror () +¤Ïɸ½à¥¨¥é¡¼¤Ë¥¨¥é¡¼¡¦¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¡¢ +.I errnum +¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï +.BR abort (3) +¤ò¸Æ¤Ó½Ð¤·¤Æ¥×¥í¥°¥é¥à¤ò½ªÎ»¤µ¤»¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ë̾¡¢¥Þ¥¯¥í¸Æ¤Ó½Ð¤·¤¬¤¢¤Ã¤¿´Ø¿ô̾¤È¹ÔÈֹ桢 +.I strerror(errnum) +¤Î½ÐÎϤ¬´Þ¤Þ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +ÊÖ¤êÃͤϤʤ¤¡£ +.SH ½àµò +¤³¤ì¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +assert ¥Þ¥¯¥í¤ÎÌÜŪ¤Ï¡¢¥×¥í¥°¥é¥Þ¤¬¥×¥í¥°¥é¥àÃæ¤Î¥Ð¥°¤òõ¤¹¼ê½õ¤±¤ò¤¹¤ë¤³¤È +¤Ç¤¢¤ê¡¢¥³¡¼¥Ç¥£¥ó¥°´Ö°ã¤¤¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï²¿¤¬µ¯¤³¤ë¤³¤È¤Ï¤¢¤ê¤¨¤Ê¤¤¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤Î¾ì¹ç¡¢¾õ¶·¤¬¤«¤Ê¤ê°ã¤Ã¤Æ¤¤¤Æ¡¢ +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ê¤¨¤ë¤·¡¢¼ÂºÝ¤¢¤ë¤À¤í¤¦¡£¤½¤·¤Æ¤½¤Î¤è¤¦¤Ê¾õ¶·¤Ç¤â +¥Æ¥¹¥È¤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ +.B NDEBUG +¤òÄêµÁ¤¹¤ë¤³¤È¤Ç̵¸ú¤Ë¤Ç¤­¤ë +assert ¤Ç¤Ï¤Ê¤¯¡¢Å¬Àڤʥ¨¥é¡¼½èÍý¥³¡¼¥É¤ÇÂн褹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤Î¥Þ¥¯¥í¤Ï·è¤·¤Æ»È¤ï¤Ê¤¤¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR abort (3), +.BR assert (3), +.BR exit (3), +.BR strerror (3), +.BR feature_test_macros (7) diff --git a/release/man3/atan.3 b/release/man3/atan.3 new file mode 100644 index 00000000..0b39111c --- /dev/null +++ b/release/man3/atan.3 @@ -0,0 +1,106 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2008-12-02 "" "Linux Programmer's Manual" +.SH ̾Á° +atan, atanf, atanl \- µÕÀµÀÜ¡Êarc tangent¡Ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double atan(double " x ); +.br +.BI "float atanf(float " x ); +.br +.BI "long double atanl( long double " x ); +.sp +.fi +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR atanf (), +.BR atanl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR atan () +\fIx\fP ¤ÎµÕÀµÀÜ¡Êarc tangent¡Ë¤Î¼çÃͤò·×»»¤¹¤ë¡£ +¤¹¤Ê¤ï¤Á¡¢ +¤½¤ÎÀµÀÜ¡Êtangent¡Ë¤¬ \fIx\fP ¤È¤Ê¤ë¤è¤¦¤ÊÃͤǤ¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎµÕÀµÀܤμçÃͤò¥é¥¸¥¢¥óñ°Ì¤ÇÊÖ¤¹¡£ +ÊÖ¤êÃÍ¤Ï [\-pi/2,\ pi/2] ¤ÎÈϰϤȤʤ롣 + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 (\-0) ¤Î¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Î¾ì¹ç¡¢+pi/2 (\-pi/2) ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\" +.\" POSIX.1-2001 documents an optional range error for subnormal x; +.\" glibc 2.8 does not do this. +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï 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) diff --git a/release/man3/atan2.3 b/release/man3/atan2.3 new file mode 100644 index 00000000..41bebf6e --- /dev/null +++ b/release/man3/atan2.3 @@ -0,0 +1,167 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2008-11-20 "" "Linux Programmer's Manual" +.SH ̾Á° +atan2, atan2f, atan2l \- Æó¤Ä¤ÎÊÑ¿ô¤ËÂФ¹¤ëµÕÀµÀÜ¡Êarc tangent¡Ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include + +.BI "double atan2(double " y ", double " x ); +.BI "float atan2f(float " y ", float " x ); +.BI "long double atan2l(long double " y ", long double " x ); + +.fi +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR atan2f (), +.BR atan2l (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR atan2 () +´Ø¿ô¤Ï +.I y/x +¤ÎµÕÀµÀÜ (arg tangent) ¤Î¼çÃͤò·×»»¤¹¤ë¡£ +Æó¤Ä¤Î°ú¤­¿ô¤ÎÉä¹æ¤Ï·ë²Ì¤Î¾Ý¸Â¤ò·èÄꤹ¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I y/x +¤ÎµÕÀµÀܤμçÃͤò¥é¥¸¥¢¥óñ°Ì¤ÇÊÖ¤¹¡£ +ÊÖ¤êÃÍ¤Ï [\-pi,\ pi] ¤ÎÈϰϤȤʤ롣 + +.I y +¤¬ +0 (\-0) ¤Ç +.I x +¤¬ 0 ̤Ëþ¤Î¾ì¹ç¡¢+pi (\-pi) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I y +¤¬ +0 (\-0) ¤Ç +.I x +¤¬ 0 ¤è¤êÂ礭¤¤¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I y +¤¬ 0 ̤Ëþ¤Ç +.I x +¤¬ +0 ¤« \-0 ¤Î¾ì¹ç¡¢\-pi/2 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I y +¤¬ 0 ¤è¤êÂ礭¤¯ +.I x +¤¬ +0 ¤« \-0 ¤Î¾ì¹ç¡¢pi/2 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\" POSIX.1 says: +.\" If +.\" .I x +.\" is 0, a pole error shall not occur. +.\" +.I x +¤« +.I y +¤Î¤¤¤º¤«¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\" POSIX.1 says: +.\" If the result underflows, a range error may occur and +.\" .I y/x +.\" should be returned. +.\" +.I y +¤¬ +0 (\-0) ¤Ç +.I x +¤¬ \-0 ¤Î¾ì¹ç¡¢+pi (\-pi) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I y +¤¬ +0 (\-0) ¤Ç +.I x +¤¬ +0 ¤Î¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I y +¤¬ 0 ¤è¤êÂ礭¤¤ (¾®¤µ¤¤) Í­¸ÂÃÍ¤Ç +.I x +¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢+pi (\-pi) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I y +¤¬ 0 ¤è¤êÂ礭¤¤ (¾®¤µ¤¤) Í­¸ÂÃÍ¤Ç +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I y +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Ç +.I x +¤¬Í­¸ÂÃͤξì¹ç¡¢pi/2 (\-pi/2) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I y +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Ç +.I x +¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢+3*pi/4 (-3*pi/4) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I y +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Ç +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢+pi/4 (-pi/4) ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\" +.\" POSIX.1 says: +.\" If both arguments are 0, a domain error shall not occur. +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.\" POSIX.1 documents an optional underflow error +.\" glibc 2.8 does not do this. +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï 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) diff --git a/release/man3/atanh.3 b/release/man3/atanh.3 new file mode 100644 index 00000000..37132cf0 --- /dev/null +++ b/release/man3/atanh.3 @@ -0,0 +1,154 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +atanh, atanhf, atanhl \- µÕÁжÊÀþÀµÀÜ¡Êinverse hyperbolic tangent¡Ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double atanh(double " x ); +.br +.BI "float atanhf(float " x ); +.br +.BI "long double atanhl(long double " x ); +.sp +.fi +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR atanh (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR atanhf (), +.BR atanhl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR atanh () +´Ø¿ô¤Ï \fIx\fP ¤ÎµÕÁжÊÀþÀµÀÜ (inverse hyperbolic tangent) ¤ò·×»»¤¹¤ë¡£ +¤¹¤Ê¤ï¤Á¡¢¤½¤ÎÁжÊÀþÀµÀÜ (hyperbolic tangent) ¤¬ \fIx\fP ¤Ë¤Ê¤ë +¤è¤¦¤ÊÃͤǤ¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎµÕÁжÊÀþÀµÀܤòÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 (\-0) ¤Î¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +1 ¤« \-1 ¤Î¾ì¹ç¡¢ +¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢ +´Ø¿ô¤Î¼ïÎà¤Ë±þ¤¸¤Æ¡¢¿ô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤Î +.BR HUGE_VAL , +.BR HUGE_VALF , +.BR HUGE_VALL +¤¬¤½¤ì¤¾¤ìÊÖ¤µ¤ì¤ë¡£ + +.I x +¤ÎÀäÂÐÃͤ¬ 1 ¤è¤êÂ礭¤¤¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ +NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\" +.\" POSIX.1-2001 documents an optional range error for subnormal x; +.\" glibc 2.8 does not do this. +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬ \-1 ¤è¤ê¾®¤µ¤¤¤« +1 ¤è¤êÂ礭¤¤ +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +̵¸ú (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.TP +¶Ë¥¨¥é¡¼ (pole error): \fIx\fP ¤¬ +1 ¤« \-1 +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë (⤷¡Ö¥Ð¥°¡×¤ÎÀá¤â»²¾È)¡£ +.\" FIXME . glibc actually gives EDOM for this case +0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_DIVBYZERO ) +¤¬¾å¤¬¤ë¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +¶Ë¥¨¥é¡¼¤Î¾ì¹ç¤Ë¡¢ +.\" +.\" FIXME . this is as at glibc 2.8; check later if this bug is fixed +.\" This can be seen in sysdeps/ieee754/k_standard.c +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6759 +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +POSIX.1 ¤Ç¤Ï¡¢ +.B ERANGE +¤òÀßÄꤹ¤Ù¤­¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR acosh (3), +.BR asinh (3), +.BR catanh (3), +.BR cosh (3), +.BR sinh (3), +.BR tanh (3) diff --git a/release/man3/atexit.3 b/release/man3/atexit.3 new file mode 100644 index 00000000..63165b1d --- /dev/null +++ b/release/man3/atexit.3 @@ -0,0 +1,162 @@ +.\" 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-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" +.SH ̾Á° +atexit \- ¥×¥í¥»¥¹¤¬Àµ¾ï½ªÎ»¤·¤¿»þ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë´Ø¿ô¤òÅÐÏ¿¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int atexit(void (*" function )(void)); +.fi +.SH ÀâÌÀ +.BR atexit () +´Ø¿ô¤Ï¡¢Í¿¤¨¤é¤ì¤¿ \fIfunction\fP ¤ò¡¢ +.BR exit (3) +¤ä¥×¥í¥°¥é¥à¤Î \fImain\fP() +´Ø¿ô¤«¤é¤ÎÊÖ¤ê¤òÄ̤¸¤Æ¡¢¥×¥í¥»¥¹¤¬Àµ¾ï½ªÎ»¤·¤¿»þ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë +´Ø¿ô¤È¤·¤ÆÅÐÏ¿¤¹¤ë¡£ +¤³¤³¤ÇÄêµÁ¤µ¤ì¤¿´Ø¿ô¤Ï¡¢ÅÐÏ¿¤·¤¿½çÈ֤ȤϵդνçÈ֤ǸƤӽФµ¤ì¤ë¡£ +ÅÐÏ¿¤·¤¿´Ø¿ô¤Ë°ú¤­¿ô¤ÏÅϤµ¤ì¤Ê¤¤¡£ + +Ʊ¤¸´Ø¿ô¤òÊ£¿ô²óÅÐÏ¿¤·¤Æ¤â¤è¤¤¡£ +ÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤ÏÅÐÏ¿ 1 ²ó¤Ë¤Ä¤­ 1 ²ó¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.LP +POSIX.1-2001 ¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤Ê´Ø¿ô¤ò¾¯¤Ê¤¯¤È¤â +.B ATEXIT_MAX +¸Ä (32¸Ä) ÅÐÏ¿¤Ç¤­¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +¤½¤Î¼ÂÁõ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¼ÂºÝ¤Î¾å¸Â¤Ï +.BR sysconf (3) +¤ò»È¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£ +.LP +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤ÎÅÐÏ¿¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.BR exec (3) +¥Õ¥¡¥ß¥ê¡¼¤Î´Ø¿ô¤Î¤¤¤º¤ì¤«¤Î¸Æ¤Ó½Ð¤·¤ËÀ®¸ù¤¹¤ë¤È¡¢ +Á´¤Æ¤ÎÅÐÏ¿¤¬ºï½ü¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR atexit () +´Ø¿ô¤Ï¡¢´Ø¿ôÅÐÏ¿¤¬À®¸ù¤·¤¿»þ¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.SH Ãí°Õ +.BR atexit () +(¤È +.BR on_exit (3)) +¤ò»È¤Ã¤ÆÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤Ï¡¢ +¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤Ë¤è¤ê¥×¥í¥»¥¹¤¬°Û¾ï½ªÎ»¤·¤¿¾ì¹ç¤Ë¤Ï¸Æ¤Ó½Ð¤µ¤ì¤Ê¤¤¡£ + +ÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤Î°ì¤Ä¤¬ +.BR _exit (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¡¢»Ä¤ê¤Î´Ø¿ô¤Ï¤É¤ì¤âµ¯Æ°¤µ¤ì¤º¡¢ +.BR exit (3) +¤Ë¤è¤ê¼Â¹Ô¤µ¤ì¤ë¾¤Î¥×¥í¥»¥¹½ªÎ»¥¹¥Æ¥Ã¥×¤Ï¼Â¹Ô¤µ¤ì¤Ê¤¤¡£ + +POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR atexit (3) +¤ò»È¤Ã¤ÆÅÐÏ¿¤µ¤ì¤¿°ì¤Ä¤Î´Ø¿ôÆâ¤Ç¡¢Ê£¿ô²ó +.BR exit (3) +¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Î·ë²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.\" 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. +(Linux ¤Ç¤Ï¤Ê¤¤¤¬) ¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î¾ì¹ç¡¢ +·«¤êÊÖ¤·¤¬Ìµ¸Â¤Ëµ¯¤³¤ë¤³¤È¤Ë¤Ê¤ë¡£ +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +.BR atexit (3) +¤ÇÅÐÏ¿¤µ¤ì¤¿´Ø¿ôÆâ¤Ç +.BR exit (3) +¤òµ¯Æ°¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ + +.BR atexit () +¤È +.BR on_exit (3) +¤Ï¡¢Æ±¤¸¥ê¥¹¥È¤ËÂФ·¤Æ´Ø¿ô¤òÅÐÏ¿¤¹¤ë¡£ +¥×¥í¥»¥¹¤¬Àµ¾ï¤Ë½ªÎ»¤·¤¿ºÝ¤Ë¤Ï¡¢ +¤³¤ì¤é¤ÎÆó¤Ä¤Î´Ø¿ô¤ÇÅÐÏ¿¤µ¤ì¤¿½ç½ø¤ÎµÕ½ç¤Ç¡¢ +ÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤¬µ¯Æ°¤µ¤ì¤ë¡£ + +POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR atexit (3) +¤ÇÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤Î¼Â¹Ô¤ò½ªÎ»¤¹¤ë¤¿¤á¤Ë +.BR longjmp (3) +¤¬»ÈÍѤµ¤ì¤¿¾ì¹ç¤Î·ë²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.\" In glibc, things seem to be handled okay +.SS Linux ¤Ç¤ÎÃí°Õ +glibc 2.2.3 °Ê¹ß¤Ç¤Ï¡¢¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬¥¢¥ó¥í¡¼¥É¤µ¤ì¤ë¤È¤­¤Ë¸Æ¤Ð¤ì¤ë +´Ø¿ô¤òÅÐÏ¿¤¹¤ë¤¿¤á¤Ë¡¢¶¦Í­¥é¥¤¥Ö¥é¥ê¤ÎÃæ¤Ç +.BR atexit () +(¤È +.BR on_exit (3)) +¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.SH Îã +.nf +#include +#include +#include + +void +bye(void) +{ + printf("That was all, folks\en"); +} + +int +main(void) +{ + long a; + int i; + + a = sysconf(_SC_ATEXIT_MAX); + printf("ATEXIT_MAX = %ld\en", a); + + i = atexit(bye); + if (i != 0) { + fprintf(stderr, "cannot set exit function\en"); + exit(EXIT_FAILURE); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR _exit (2), +.BR exit (3), +.BR on_exit (3) diff --git a/release/man3/atof.3 b/release/man3/atof.3 new file mode 100644 index 00000000..64cff82a --- /dev/null +++ b/release/man3/atof.3 @@ -0,0 +1,67 @@ +.\" 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 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 +.\" +.TH ATOF 3 1993-03-29 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +atof \- ʸ»úÎó¤ò double ·¿¤Î¿ôÃͤËÊÑ´¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double atof(const char *" nptr ); +.fi +.SH ÀâÌÀ +.BR atof () +´Ø¿ô¤Ï¡¢\fInptr\fP¤Ë¤è¤Ã¤Æ»Ø¼¨¤µ¤ì¤ëʸ»úÎó¤Î¤Ï¤¸¤á¤ÎÉôʬ¤ò +.I double +·¿¤Î¿ôÃͤËÊÑ´¹¤¹¤ë¡£ +¤³¤Î¿¶¤ëÉñ¤¤¤Ï¡¢ +.BR atof () +´Ø¿ô¤¬¥¨¥é¡¼¤ò¸«¤Ä¤±¤Ê¤¤¤³¤È¤ò½ü¤¤¤Æ¤Ï¡¢ +.sp +.in +4n +strtod(nptr, (char **) NULL); +.in +.sp +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +ÊÑ´¹¤µ¤ì¤¿ÃÍ¡£ +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD, C89, C99. +.SH ´ØÏ¢¹àÌÜ +.BR atoi (3), +.BR atol (3), +.BR strtod (3), +.BR strtol (3), +.BR strtoul (3) diff --git a/release/man3/atoi.3 b/release/man3/atoi.3 new file mode 100644 index 00000000..346f471b --- /dev/null +++ b/release/man3/atoi.3 @@ -0,0 +1,115 @@ +.\" 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 Mon Mar 29 22:39:41 1993, David Metcalfe +.\" 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 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +atoi, atol, atoll, atoq \- ʸ»úÎó¤òÀ°¿ô·¿¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int atoi(const char *" nptr ); +.br +.BI "long atol(const char *" nptr ); +.br +.BI "long long atoll(const char *" nptr ); +.br +.BI "long long atoq(const char *" nptr ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR atoll (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; +¤Þ¤¿¤Ï +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR atoi () +´Ø¿ô¤Ï¡¢\fInptr\fP ¤Ë¤è¤Ã¤Æ»Ø¼¨¤µ¤ì¤ëʸ»úÎó¤Î¤Ï¤¸¤á¤ÎÉôʬ¤ò +.I int +·¿À°¿ô¤ËÊÑ´¹¤¹¤ë¡£ +¤³¤Î¿¶¤ëÉñ¤¤¤Ï¡¢ +.BR atoi () +´Ø¿ô¤¬¥¨¥é¡¼¤ò¸«¤Ä¤±¤Ê¤¤ÅÀ°Ê³°¤Ï¡¢ +.sp +.in +4n +strtol(nptr, (char **) NULL, 10); +.in +.sp +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.PP +.BR atol () +´Ø¿ô¤È +.BR atoll () +´Ø¿ô¤Ï +.BR atoi () +¤ÈƱÍͤﶤëÉñ¤¤¤ò¤¹¤ë¤¬¡¢ +ʸ»úÎó¤Î¤Ï¤¸¤á¤ÎÉôʬ¤ò¤½¤ì¤¾¤ì \fIlong\fP ¤ä \fIlong long\fP ¤ËÊÑ´¹¤¹¤ë¡£ +.BR atoq () +¤Ï +.BR atoll () +¤Î¸Å¤¤Ì¾Á°¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +ÊÑ´¹¤µ¤ì¤¿ÃÍ¡£ +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD, C99. +C89 ¤È POSIX.1-1996 ¤Ë¤Ï +.BR atoi () +¤È +.BR atol () +¤À¤±¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.BR atoq () +¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +Èóɸ½à¤Ç¤¢¤ë +.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 ¤Ë¤Ï¸ºß¤·¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR atof (3), +.BR strtod (3), +.BR strtol (3), +.BR strtoul (3) diff --git a/release/man3/backtrace.3 b/release/man3/backtrace.3 new file mode 100644 index 00000000..6df34903 --- /dev/null +++ b/release/man3/backtrace.3 @@ -0,0 +1,254 @@ +.\" Copyright (C) 2007 Michael Kerrisk +.\" drawing on material by Justin Pryzby +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" References: +.\" glibc manual and source +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-10-16, Akihiro MOTOKI , LDP v2.66 +.\" +.TH BACKTRACE 3 2008-06-14 GNU "Linux Programmer's Manual" +.SH ̾Á° +backtrace, backtrace_symbols, backtrace_symbols_fd \- +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¼«¿È¤Ç¤Î¥Ç¥Ð¥Ã¥°¤Î¥µ¥Ý¡¼¥È +.SH ½ñ¼° +.B #include + +.B int backtrace(void +.BI ** buffer , +.B int +.IB size ); + +.B char **backtrace_symbols(void *const +.BI * buffer , +.B int +.IB size ); + +.B void backtrace_symbols_fd(void *const +.BI * buffer , +.B int +.IB size , +.B int +.IB fd ); +.SH ÀâÌÀ +.BR backtrace () +¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥°¥é¥à¤Î¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤ò +.I buffer +¤¬»Ø¤¹ÇÛÎó¤ËÆþ¤ì¤ÆÊÖ¤¹¡£¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤Ï¡¢¥×¥í¥°¥é¥à¤Ç +¸½ºßÆ°ºîÃæ¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤ÎʤӤǤ¢¤ë¡£ +.I buffer +¤¬»Ø¤¹ÇÛÎó¤Î¸Ä¡¹¤ÎÍ×ÁÇ¤Ï \fIvoid *\fP ·¿¤Ç¡¢ +Âбþ¤¹¤ë¥¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤«¤é¤Î¥ê¥¿¡¼¥ó¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I size +°ú¤­¿ô¤Ï +.I buffer +¤Ë³ÊǼ¤Ç¤­¤ë¥¢¥É¥ì¥¹¤ÎºÇÂç¸Ä¿ô¤ò»ØÄꤹ¤ë¡£ +¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤¬ +.I size +¤è¤êÂ礭¤¤¾ì¹ç¡¢ +.I size +¸Ä¤Îľ¶á¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤ËÂбþ¤¹¤ë¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¤ë¡£ +´°Á´¤Ê¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë¤Ï¡¢³Î¼Â¤Ë +.I buffer +¤È +.I size +¤¬½½Ê¬Â礭¤¯¤Ê¤ë¤è¤¦¤Ë¤¹¤ë¤³¤È¡£ + +.BR backtrace () +¤Ë¤è¤Ã¤Æ +.I buffer +¤Ë¥¢¥É¥ì¥¹¤Î½¸¹ç¤¬ÆÀ¤é¤ì¤¿¤é¡¢ +.BR backtrace_symbols () +¤Ë¤è¤Ã¤Æ¡¢¥¢¥É¥ì¥¹½¸¹ç¤ò¡¢¤½¤Î¥¢¥É¥ì¥¹¤ò¥·¥ó¥Ü¥ë¤Çɽ¤·¤¿Ê¸»úÎó¤ÎÇÛÎó +¤ËËÝÌõ¤Ç¤­¤ë¡£ +.I size +°ú¤­¿ô¤Ï +.I buffer +¤Ë³ÊǼ¤µ¤ì¤¿¥¢¥É¥ì¥¹¤Î¿ô¤ò»ØÄꤹ¤ë¡£ +¸Ä¡¹¤Î¥¢¥É¥ì¥¹¤Î¥·¥ó¥Ü¥ëɽ¸½¤Ï¡¢´Ø¿ô̾ (ÆÃÄê¤Ç¤­¤¿¾ì¹ç)¡¢ +´Ø¿ô¤Ø¤Î¥ª¥Õ¥»¥Ã¥È (16¿Êɽµ­)¡¢¼ÂºÝ¤Î¥ê¥¿¡¼¥ó¥¢¥É¥ì¥¹ (16¿Êɽµ­) +¤«¤é¹½À®¤µ¤ì¤ë¡£ +.BR backtrace_symbols () +¤Î¼Â¹Ô·ë²Ì¤È¤·¤Æ¤Ï¡¢ +ʸ»úÎó¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Î¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤ÎÇÛÎó¤Ï +.BR backtrace_symbols () +¤Ë¤è¤Ã¤Æ +.BR malloc (3) +¤µ¤ì¡¢¸Æ¤Ó½Ð¤·Â¦¤Ç free ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(¥Ý¥¤¥ó¥¿¤ÎÇÛÎ󤬻ؤ¹¸Ä¡¹¤Îʸ»úÎó¤Ï free ¤¹¤ëɬÍפϤʤ¤¤·¡¢ +free ¤¹¤Ù¤­¤Ç¤â¤Ê¤¤)¡£ + +.BR backtrace_symbols_fd () +¤Ï¡¢ +.BR backtrace_symbols () +¤ÈƱ¤¸°ú¤­¿ô +.I buffer +¤È +.I size +¤ò¤È¤ë¤¬¡¢¸Æ¤Ó½Ð¤·Â¦¤Ëʸ»úÎó¤ÎÇÛÎó¤òÊÖ¤¹Âå¤ï¤ê¤Ë¡¢ +ʸ»úÎó¤ò¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë 1 ¹Ô¤Ë 1 ¥¨¥ó¥È¥ê¤Î·Á¤Ç½ñ¤­¹þ¤à¡£ +.BR backtrace_symbols_fd () +¤Ï +.BR malloc (3) +¤ò¸Æ¤Ó½Ð¤µ¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢¤³¤ì¤Ë³¤¯´Ø¿ô¤¬¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¾õ¶·¤Ç¤âÍøÍѤǤ­¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR backtrace () +¤Ï +.I buffer +¤Ë³ÊǼ¤·¤¿¥¢¥É¥ì¥¹¤Î¸Ä¿ô¤òÊÖ¤¹¡£¤½¤Î¸Ä¿ô¤Ï +.I size +¤è¤êÂ礭¤¯¤Ê¤ë¤³¤È¤Ï¤Ê¤¤¡£ +ÊÖ¤êÃͤ¬ +.I size +¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢¥Ð¥Ã¥¯¥È¥ì¡¼¥¹Á´ÂΤ¬³ÊǼ¤µ¤ì¤Æ¤¤¤ë¡£ÊÖ¤êÃͤ¬ +.I size +¤ÈÅù¤·¤¤¾ì¹ç¡¢¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤ÏÀÚ¤êµÍ¤á¤é¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +ÀÚ¤êµÍ¤á¤é¤ì¤¿¾ì¹ç¡¢ºÇ¤â¸Å¤¤¥¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤Î¥¢¥É¥ì¥¹¤Ï +ÊÖ¤µ¤ì¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£ + +.BR backtrace_symbols () +¤Ï¡¢À®¸ù¤¹¤ë¤È¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤Ç +.BR malloc (3) +¤µ¤ì¤¿ÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ NULL ¤òÊÖ¤¹¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR backtrace (), +.BR backtrace_symbols (), +.BR backtrace_symbols_fd () +¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢´Ø¿ô¤Î¥ê¥¿¡¼¥ó¥¢¥É¥ì¥¹¤¬¥¹¥¿¥Ã¥¯¾å¤Ç¤É¤Î¤è¤¦¤Ë³ÊǼ¤µ¤ì¤ë¤« +¤Ë´Ø¤·¤Æ¤¢¤ë²¾Äê¤òÃÖ¤¤¤Æ¤¤¤ë¡£ +°Ê²¼¤ÎÅÀ¤ËÃí°Õ¡£ +.IP * 3 +.RB ( gcc (1) +¤Î 0 °Ê³°¤ÎºÇŬ²½¥ì¥Ù¥ë¤Ç°ÅÌۤΤ¦¤Á¤Ë¹Ô¤ï¤ì¤ë) +¥Õ¥ì¡¼¥à¥Ý¥¤¥ó¥¿¤Î¾Êά¤ò¹Ô¤¦¤È¡¢¤³¤ì¤é¤ÎÁ°Äó¤¬Êø¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.IP * +¥¤¥ó¥é¥¤¥ó´Ø¿ô¤Ï¥¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤ò»ý¤¿¤Ê¤¤¡£ +.IP * +ËöÈø¸Æ¤Ó½Ð¤·¤ÎºÇŬ²½ (tail-call optimization) ¤ò¹Ô¤¦¤È¡¢ +¤¢¤ë¥¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤¬Ê̤Υ¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤òÃÖ¤­´¹¤¨¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.PP +¥·¥ó¥Ü¥ë̾¤ÏÆÃÊ̤ʥê¥ó¥«¡¦¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤Ê¤¤¤ÈÍøÍѤǤ­¤Ê¤¤¾ì¹ç¤¬¤¢¤ë¡£ +GNU ¥ê¥ó¥«¤ò»ÈÍѤ¹¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I \-rdynamic +¥ê¥ó¥«¡¦¥ª¥×¥·¥ç¥ó¤ò»È¤¦É¬Íפ¬¤¢¤ë¡£ +"static" ¤Ê´Ø¿ô¤Î¥·¥ó¥Ü¥ë̾¤Ï¸ø³«¤µ¤ì¤º¡¢ +¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +.BR backtrace () +¤È +.BR backtrace_symbols () +¤Î»ÈÍÑÎã¤ò¼¨¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +°Ê²¼¤Ë¼¨¤¹¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥ó¤Ï¡¢ +¤³¤Î¥×¥í¥°¥é¥à¤òÆ°¤«¤·¤¿ºÝ¤Î¼Â¹ÔÎã¤Ç¤¢¤ë¡£ +.nf +.in +4n + +.RB "$" " cc \-rdynamic prog.c \-o prog" +.RB "$" " ./prog 3" +backtrace() returned 8 addresses +\&./prog(myfunc3+0x5c) [0x80487f0] +\&./prog [0x8048871] +\&./prog(myfunc+0x21) [0x8048894] +\&./prog(myfunc+0x1a) [0x804888d] +\&./prog(myfunc+0x1a) [0x804888d] +\&./prog(main+0x65) [0x80488fb] +\&/lib/libc.so.6(__libc_start_main+0xdc) [0xb7e38f9c] +\&./prog [0x8048711] +.in +.fi +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include + +void +myfunc3(void) +{ + int j, nptrs; +#define SIZE 100 + void *buffer[100]; + char **strings; + + nptrs = backtrace(buffer, SIZE); + printf("backtrace() returned %d addresses\\n", nptrs); + + /* backtrace_symbols_fd(buffer, nptrs, STDOUT_FILENO) ¤ò + ¸Æ¤Ó½Ð¤·¤Æ¤â¡¢°Ê²¼¤ÈƱÍͤνÐÎϤ¬ÆÀ¤é¤ì¤ë¡£ */ + + strings = backtrace_symbols(buffer, nptrs); + if (strings == NULL) { + perror("backtrace_symbols"); + exit(EXIT_FAILURE); + } + + for (j = 0; j < nptrs; j++) + printf("%s\\n", strings[j]); + + free(strings); +} + +static void /* "static" ¤Ï¥·¥ó¥Ü¥ë¤ò¸ø³«¤·¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë */ +myfunc2(void) +{ + myfunc3(); +} + +void +myfunc(int ncalls) +{ + if (ncalls > 1) + myfunc(ncalls \- 1); + else + myfunc2(); +} + +int +main(int argc, char *argv[]) +{ + if (argc != 2) { + fprintf(stderr, "%s num\-calls\\n", argv[0]); + exit(EXIT_FAILURE); + } + + myfunc(atoi(argv[1])); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR gcc (1), +.BR ld (1), +.BR dlopen (3), +.BR malloc (3) diff --git a/release/man3/basename.3 b/release/man3/basename.3 new file mode 100644 index 00000000..e1f86272 --- /dev/null +++ b/release/man3/basename.3 @@ -0,0 +1,181 @@ +.\" Copyright (c) 2000 by Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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. +.\" Created, 14 Dec 2000 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. +.\" Translated 2001-03-31, NAKANO Takeo +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" +.TH BASENAME 3 2009-03-30 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +basename, dirname \- ¥Ñ¥¹Ì¾¤ò²òÀϤ·¤Æ³ÆÉôʬ¤ò¼è¤ê½Ð¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *dirname(char *" path ); + +.BI "char *basename(char *" path ); +.fi +.SH ÀâÌÀ +·Ù¹ð: +.BR basename () +¤Ë¤Ï°Û¤Ê¤ë¥Ð¡¼¥¸¥ç¥ó¤¬ 2¤Ä¸ºß¤¹¤ë¡£²¼µ­¤Î¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ +.LP +.BR dirname () +¤È +.BR basename () +¤Ï¡¢NULL ¤Ç½ªÃ¼¤µ¤ì¤¿¥Ñ¥¹Ì¾¤Îʸ»úÎó¤ò¡¢ +¥Ç¥£¥ì¥¯¥È¥êÉôʬ¡¦¥Õ¥¡¥¤¥ë̾Éôʬ¤Ëʬ³ä¤¹¤ë¡£ +Ä̾ï¤Ï¡¢ +.BR dirname () +¤ÏºÇ¸å¤Î \(aq/\(aq ¤Þ¤Ç¤ÎÉôʬ (ºÇ¸å¤Î \(aq/\(aq ¤Ï´Þ¤Þ¤Ê¤¤) ¤òÊÖ¤·¡¢ +.BR basename () +¤ÏºÇ¸å¤Î \(aq/\(aq °Ê¹ß¤ÎÉôʬ¤òÊÖ¤¹¡£ +ʸ»úÎó¤ÎËöÈø¤Ë¤Ä¤¤¤¿ \(aq/\(aq ʸ»ú¤Ï¡¢¥Ñ¥¹Ì¾¤Î°ìÉô¤È¤Ï¤ß¤Ê¤µ¤ì¤Ê¤¤¡£ +.PP +.I path +¤Ë '/' ʸ»ú¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢ +.BR dirname () +¤Ïʸ»úÎó "." ¤òÊÖ¤·¡¢ +.BR basename () +¤Ï +.I path +¤ÈƱ¤¸ÆâÍƤòÊÖ¤¹¡£ +.I path +¤¬Ê¸»úÎó "/" ¤ËÅù¤·¤¤¾ì¹ç¤Ï¡¢ +.BR dirname () +¤â +.BR basename () +¤âʸ»úÎó "/" ¤òÊÖ¤¹¡£ +.I path +¤¬ NULL ¥Ý¥¤¥ó¥¿¤À¤Ã¤¿¤ê¡¢¶õ¤Îʸ»úÎó¤ò»Ø¤·¤Æ¤¤¤¿¾ì¹ç¤Ï¡¢ +.BR dirname () +¤â +.BR basename () +¤âʸ»úÎó "." ¤òÊÖ¤¹¡£ +.PP +.BR dirname () +¤ÎÊÖ¤·¤¿Ê¸»úÎó¡¢ "/"¡¢ +.BR basename () +¤ÎÊÖ¤·¤¿Ê¸»úÎó¡¢ +¤ò½ç¤Ë·ë¹ç¤¹¤ë¤È¡¢´°Á´¤Ê¥Ñ¥¹Ì¾¤¬ÆÀ¤é¤ì¤ë¡£ +.PP +.BR dirname () +¤È +.BR basename () +¤Ï¡¢¤¤¤º¤ì¤â +.I path +¤ÎÆâÍƤòÊѹ¹¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë¤Ï +¥³¥Ô¡¼¤òÅϤ¹¤Î¤¬Ë¾¤Þ¤·¤¤¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¤³¤È¤¬¤¢¤ê¡¢ +¤³¤ì¤é¤ÎÎΰè¤Ï¸å¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤Þ¤¿¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I path +¤Î°ìÉôʬ¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¤³¤È¤â¤¢¤ë¡£¤½¤Î¤¿¤á¡¢ +.I path +¤Ç»²¾È¤µ¤ì¤ëʸ»úÎó¤Ï¡¢´Ø¿ô¤¬ÊÖ¤¹¥Ý¥¤¥ó¥¿¤¬ÉÔÍפˤʤë¤Þ¤Ç¤Ï +Êѹ¹¤·¤¿¤ê free ¤·¤¿¤ê¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.PP +°Ê²¼¤Î°ìÏ¢¤ÎÎã (SUSv2 ¤«¤é°úÍÑ) ¤Ï¡¢ +¤¤¤í¤¤¤í¤Ê path ¤ËÂФ·¤Æ +.BR dirname () +¤È +.BR basename () +¤¬ÊÖ¤¹Ê¸»úÎó¤òɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.sp +.nf +.B "path dirname basename" +"/usr/lib" "/usr" "lib" +"/usr/" "/" "usr" +"usr" "." "usr" +"/" "/" "/" +"." "." "." +".." "." ".." +.fi +.SH ÊÖ¤êÃÍ +.BR dirname () +¤È +.BR basename () +¤Ï¡¢¤¤¤º¤ì¤â NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +(¤³¤ì¤é¤Î¥Ý¥¤¥ó¥¿¤ò +.BR free (3) +¤ËÅϤµ¤Ê¤¤¤³¤È¡£) +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.BR basename () +¤Ë¤Ï 2¼ïÎà¤Î°Û¤Ê¤ë¥Ð¡¼¥¸¥ç¥ó¤¬¤¢¤ë¡£ +°ì¤Ä¤Ï¤¹¤Ç¤ËÀâÌÀ¤·¤¿ POSIX ¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ê¡¢ +¤â¤¦°ì¤Ä¤Ï GNU ¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë¡£ +GNU ¥Ð¡¼¥¸¥ç¥ó¤ò»ÈÍѤ¹¤ë¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¡£ +.br +.nf + +.B " #define _GNU_SOURCE" +.br +.B " #include " + +.fi +GNU ¥Ð¡¼¥¸¥ç¥ó¤Ï°ú¤­¿ô¤òÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ê¤¯¡¢ +.I path +¤ÎËöÈø¤¬ '/'¤Î¾ì¹ç¤Ï¶õ¤Îʸ»úÎó¤òÊÖ¤¹¡£ +ÆÃ¤Ë +.I path +¤¬ "/" ¤Î¾ì¹ç¤â¶õʸ»úÎó¤òÊÖ¤¹¡£ +.BR dirname () +¤Ë¤Ï GNU ¥Ð¡¼¥¸¥ç¥ó¤Ï¤Ê¤¤¡£ +.LP +glibc ¤Ç¤Ï¡¢ +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤È POSIX ¥Ð¡¼¥¸¥ç¥ó¤Î +.BR basename () +¤¬»ÈÍѤµ¤ì¡¢¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï GNU ¥Ð¡¼¥¸¥ç¥ó¤È¤Ê¤ë¡£ +.SH ¥Ð¥° +glibc ¤Î POSIX ¥Ð¡¼¥¸¥ç¥ó¤Î¼ÂÁõ¤Ç¤Ï¡¢°ú¤­¿ô¤ÎÆâÍƤ¬Êѹ¹¤µ¤ì¡¢ +°ú¤­¿ô¤Ë ("/usr/" ¤Ê¤É¤Î) Äê¿ôʸ»úÎó¤ò»ØÄꤵ¤ì¤ë¤È +¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó¥Õ¥©¡¼¥ë¥È¤òµ¯¤³¤¹¡£ +¥Ð¡¼¥¸¥ç¥ó 2.2.1 °ÊÁ°¤Î glibc ¤Ç¤Ï¡¢ glibc ¤Î +.BR dirname () +¤ÏËöÈø¤¬ \(aq/\(aq ʸ»ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥Ñ¥¹Ì¾¤òÀµ¤·¤¯°·¤¨¤º¡¢ +°ú¤­¿ô¤¬ NULL ¤À¤È¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó¥Õ¥©¡¼¥ë¥È¤òµ¯¤³¤·¤¿¡£ +.SH Îã +.in +4n +.nf +char *dirc, *basec, *bname, *dname; +char *path = "/etc/passwd"; + +dirc = strdup(path); +basec = strdup(path); +dname = dirname(dirc); +bname = basename(basec); +printf("dirname=%s, basename=%s\\n", dname, bname); +.fi +.in +.SH ´ØÏ¢¹àÌÜ +.BR basename (1), +.BR dirname (1), +.BR feature_test_macros (7) diff --git a/release/man3/bcmp.3 b/release/man3/bcmp.3 new file mode 100644 index 00000000..cc6ff1d8 --- /dev/null +++ b/release/man3/bcmp.3 @@ -0,0 +1,76 @@ +.\" +.\" 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 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 +.\" +.TH BCMP 3 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +bcmp \- ¥Ð¥¤¥ÈÎó¤òÈæ³Ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int bcmp(const void *" s1 ", const void *" s2 ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR bcmp () +¤Ï¡¢2 ¤Ä¤Î¥Ð¥¤¥ÈÎó +.I s1 +¤È +.I s2 +¤ÎÀèƬ +.I n +¥Ð¥¤¥È¤ò +Èæ³Ó¤¹¤ë¡£2 ¤Ä¤¬Åù¤·¤¤¤«¡¢ÆÃ¤Ë +.I n +¤¬ 0 ¤Î¾ì¹ç +.BR bcmp () +¤Ï 0 ¤òÊÖ¤¹¡£ +¤µ¤â¤Ê¤±¤ì¤Ð 0 °Ê³°¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +¥Ð¥¤¥ÈÎó¤¬Åù¤·¤¤¾ì¹ç¤Ï 0 ¡¢Åù¤·¤¯¤Ê¤¤¾ì¹ç¤Ï 0 °Ê³°¤òÊÖ¤¹¡£ +.SH ½àµò +4.3BSD. +¤³¤Î´Ø¿ô¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë (POSIX.1-2001 ¤Ç¤Ï +²áµî¤Î̾»Ä (LEGACY) ¤È¤µ¤ì¤Æ¤¤¤ë)¡£¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï +.BR memcmp (3) +¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +POSIX.1-2008 ¤Ç¤Ï +.BR bcmp () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR memcmp (3), +.BR strcasecmp (3), +.BR strcmp (3), +.BR strcoll (3), +.BR strncasecmp (3), +.BR strncmp (3) diff --git a/release/man3/bcopy.3 b/release/man3/bcopy.3 new file mode 100644 index 00000000..15a394b0 --- /dev/null +++ b/release/man3/bcopy.3 @@ -0,0 +1,78 @@ +.\" 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 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" +.SH ̾Á° +bcopy \- ¥Ð¥¤¥ÈÎó¤ò¥³¥Ô¡¼¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void bcopy(const void *" src ", void *" dest ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR bcopy () +¤Ï +.I src +¤«¤éÀèƬ +.I n +¥Ð¥¤¥È¤ò +.I dest +¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +Îΰ褬½Å¤Ê¤Ã¤Æ¤¤¤Æ¤â¡¢·ë²Ì¤ÏÀµ¤·¤¤¤â¤Î¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +¤Ê¤·¡£ +.SH ½àµò +4.3BSD. +¤³¤Î´Ø¿ô¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë (POSIX.1-2001 ¤Ç¤Ï +²áµî¤Î̾»Ä (LEGACY) ¤È¤µ¤ì¤Æ¤¤¤ë)¡£¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï +.BR memcpy () +¤ä +.BR memmove () +¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.BR memcpy () +¤ä +.BR memmove () +¤Ç¤Ï¡¢ºÇ½é¤Î 2 ¤Ä¤Î°ú¿ô¤Î½ç½ø¤¬Æþ¤ìÂؤï¤Ã¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +POSIX.1-2008 ¤Ç¤Ï¡¢ +.BR bcopy () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR memccpy (3), +.BR memcpy (3), +.BR memmove (3), +.BR strcpy (3), +.BR strncpy (3) diff --git a/release/man3/bindresvport.3 b/release/man3/bindresvport.3 new file mode 100644 index 00000000..2bcb36dd --- /dev/null +++ b/release/man3/bindresvport.3 @@ -0,0 +1,110 @@ +.\" Copyright (C) 2007, Michael Kerrisk +.\" and 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. +.\" +.\" 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" +.SH ̾Á° +bindresvport \- ¥½¥±¥Ã¥È¤òÆø¢ IP ¥Ý¡¼¥È¤Ë¥Ð¥¤¥ó¥É¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.LP +.BI "int bindresvport(int " sockfd ", struct sockaddr_in *" sin ); +.fi +.SH ÀâÌÀ +.LP +.BR bindresvport () +¤Ï¡¢¥½¥±¥Ã¥È¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÆø¢ÌµÌ¾ (privileged anonymous) IP ¥Ý¡¼¥È¤Ë +¥Ð¥¤¥ó¥É¤¹¤ë¤Î¤Ë»È¤¦¡£Æø¢ÌµÌ¾ IP ¥Ý¡¼¥È¤È¤Ï¡¢ +¥Ý¡¼¥ÈÈֹ椬 512 ¤«¤é 1023 ¤ÎÈϰϤ«¤éǤ°Õ¤ËÁªÂò¤µ¤ì¤ë¥Ý¡¼¥È¤Ç¤¢¤ë¡£ +.\" Glibc actually starts searching with a port # in the range 600 to 1023 + +.BR bindresvport () +¤Ë¤è¤Ã¤Æ¼Â¹Ô¤µ¤ì¤¿ +.BR bind (2) +¤¬À®¸ù¤·¡¢ +.I sin +¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢¼ÂºÝ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥Ý¡¼¥ÈÈֹ椬 +.I sin\->sin_port +¤ËÆþ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ + +.I sin +¤Ë¤Ï NULL ¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¡¢¤½¤Î¾ì¹ç¤Ë¤Ï +.I sin\->sin_family +¤Ï°ÅÌۤΤ¦¤Á¤Ë +.B AF_INET +¤È¤ß¤Ê¤µ¤ì¤ë¡£ +¤·¤«¤·¡¢¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR bindresvport () +¤Ï¼ÂºÝ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥Ý¡¼¥ÈÈÖ¹æ¤òÊÖ¤¹¼êÃʤò»ý¤¿¤Ê¤¤ +(³ä¤êÅö¤Æ¤é¤ì¤¿¥Ý¡¼¥ÈÈÖ¹æ¤Ï¡¢¸å¤Ç +.BR getsockname (2) +¤ò»È¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë)¡£ +.SH ÊÖ¤êÃÍ +.BR bindresvport () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤Î¸¶°ø¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.BR bindresvport () +¤Ï +.BR bind (2) +¤ÈƱ¤¸¸¶°ø¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤µ¤é¤Ë¡¢°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤³¤È¤¬¤¢¤ë: +.TP +.BR EACCES +¸Æ¤Ó½Ð¤·¸µ¤¬¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤ÎÆø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿ (¤è¤êÀµ³Î¤Ë¸À¤¦¤È¡¢ +.B CAP_NET_BIND_SERVICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë)¡£ +.TP +.B EADDRINUSE +Á´¤Æ¤ÎÆø¢¥Ý¡¼¥È¤¬»ÈÍÑÃæ¤Ç¤¢¤ë¡£ +.TP +.BR EAFNOSUPPORT " (glibc 2.7 °ÊÁ°¤Ç¤Ï " EPFNOSUPPORT ")" +.I sin +¤¬ NULL °Ê³°¤Ç¡¢¤«¤Ä +.I sin->sin_family +¤¬ +.B AF_INET +¤Ç¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD, Solaris ¤ª¤è¤Ó¤½¤Î¾¤Î¿¤¯¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +.SH Ãí°Õ +.LP +.BR bindresvport () +¤Î¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤È°Û¤Ê¤ê¡¢glibc ¤Î¼ÂÁõ¤Ç¤Ï¸Æ¤Ó½Ð¤·¸µ¤¬ +.I sin\->sin_port +¤ÇÅϤ·¤¿ÃͤϤɤó¤ÊÃͤǤ¢¤Ã¤Æ¤â̵»ë¤µ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR bind (2), +.BR getsockname (2) diff --git a/release/man3/bsd_signal.3 b/release/man3/bsd_signal.3 new file mode 100644 index 00000000..045c4941 --- /dev/null +++ b/release/man3/bsd_signal.3 @@ -0,0 +1,105 @@ +.\" 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 +.\" +.\"WORD: reliable ¿®ÍêÀ­¤Î¤¢¤ë +.\"WORD: unreliable ¿®ÍêÀ­¤Ë·ç¤±¤ë +.\"WORD: signal semantics ¥·¥°¥Ê¥ë½èÍýÊý¼° +.\" +.TH BSD_SIGNAL 3 2009-03-15 "" "Linux Programmer's Manual" +.SH ̾Á° +bsd_signal \- BSD Êý¼°¤Î¥·¥°¥Ê¥ë½èÍý +.SH ½ñ¼° +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "sighandler_t bsd_signal(int " signum ", sighandler_t " handler ); +.SH ÀâÌÀ +.BR bsd_signal () +´Ø¿ô¤Ï +.BR signal (2) +¤ÈƱ¤¸°ú¤­¿ô¤ò¤È¤ê¡¢Æ±¤¸½èÍý¤ò¼Â¹Ô¤¹¤ë¡£ + +ξ¼Ô¤Î°ã¤¤¤Ï¡¢ +.BR bsd_signal () +¤Ç¤Ï¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤ÎÄ󶡤¬Êݾڤµ¤ì¤Æ¤¤¤ë¤³¤È¤Ç¤¢¤ë¡£ +¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤Ï°Ê²¼¤ÎÆÃħ¤ò»ý¤Ä¡£ +a) ¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤¿¾ì¹ç¤Ë¡¢¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡ (disposition) ¤¬ +¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤Ê¤¤¡¢ +b) ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¡¢¤½¤ì°Ê¹ß¤ËȯÀ¸¤·¤¿Æ±¤¸¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤¬ +¥Ö¥í¥Ã¥¯¤µ¤ì¤Ê¤¤¡¢ +c) ¥Ï¥ó¥É¥é¤¬Ää»ßÃæ¤Î (blocking ¤·¤Æ¤¤¤ë) ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò +ÃæÃǤ·¤¿¾ì¹ç¡¢¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¼«Æ°Åª¤ËºÆ³«¤µ¤ì¤ë¡£ +°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +.BR signal (2) +¤Ç¤³¤ì¤é¤¬Êݾڤµ¤ì¤ë¤³¤È¤òÁ°Äó¤Ë¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR bsd_signal () +´Ø¿ô¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎľÁ°¤ÎÃͤòÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.B SIG_ERR +¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.BR signal (2) +¤ÈƱ¤¸¡£ +.SH ½àµò +4.2BSD, POSIX.1-2001. +POSIX.1-2008 ¤Ç¤Ï +.BR bsd_signal () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +Âå¤ï¤ê¤Ë¡¢ +.BR sigaction (2) +¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.BR bsd_signal () +¤Î»ÈÍѤÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£Âå¤ï¤ê¤Ë +.BR sigaction (2) +¤ò»È¤¦¤³¤È¡£ + +ºÇ¶á¤Î Linux ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR bsd_signal () +¤È +.BR signal (2) +¤ÏÅù²Á¤Ç¤¢¤ë¡£¤·¤«¤·¡¢°ÊÁ°¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR signal (2) +¤Ï¿®ÍêÀ­¤Ë·ç¤±¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤òÄ󶡤·¤Æ¤¤¤¿¡£ +¾ÜºÙ¤Ï +.BR signal (2) +¤ò»²¾È¡£ + +.I sighandler_t +¤ò»È¤Ã¤Æ¤¤¤ë¤Î¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +¤³¤Î·¿¤Ïµ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _GNU_SOURCE +¤òÄêµÁ¤·¤¿¾ì¹ç¤Ë¤Î¤ßÄêµÁ¤µ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sigaction (2), +.BR signal (2), +.BR sysv_signal (3), +.BR feature_test_macros (7), +.BR signal (7) diff --git a/release/man3/bsearch.3 b/release/man3/bsearch.3 new file mode 100644 index 00000000..4605f2c1 --- /dev/null +++ b/release/man3/bsearch.3 @@ -0,0 +1,121 @@ +.\" 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 Mon Mar 29 22:41:16 1993, David Metcalfe +.\" Modified Sat Jul 24 21:35:16 1993, Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-03-18, NAKANO Takeo +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" +.TH BSEARCH 3 2003-11-01 "" "Linux Programmer's Manual" +.SH ̾Á° +bsearch \- ¥½¡¼¥È¤µ¤ì¤¿ÇÛÎó¤òÆóʬÌÚ¸¡º÷ (binary search) ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *bsearch(const void *" key ", const void *" base , +.BI " size_t " nmemb ", size_t " size , +.BI " int (*" compar ")(const void *, const void *));" +.fi +.SH ÀâÌÀ +.BR bsearch () +´Ø¿ô¤Ï \fInmemb\fP ¸Ä¤Î¥ª¥Ö¥¸¥§¥¯¥È¤«¤é¤Ê¤ëÇÛÎó¤ò¸¡º÷ +¤¹¤ë¡£ÇÛÎó¤ÎºÇ½é¤Î¥á¥ó¥Ð¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï \fIbase\fP ¤Ë¤è¤Ã¤ÆÍ¿¤¨¤ë¡£ +¥Ý¥¤¥ó¥¿ \fIkey\fP ¤Ç»²¾È¤µ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È¤È°ìÃפ¹¤ë¥á¥ó¥Ð¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +ÇÛÎóÃæ¤Î³Æ¡¹¤Î¥á¥ó¥Ð¡¼¤Î¥µ¥¤¥º¤Ï \fIsize\fP ¤Ë¤è¤Ã¤Æ»ØÄꤹ¤ë¡£ +.PP +ÇÛÎó¤ÎÆâÍƤÏÈæ³Ó´Ø¿ô \fIcompar\fP ¤Ë´ð¤Å¤­¡¢¾º½ç¤Ë¥½¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤±¤ì +¤Ð¤Ê¤é¤Ê¤¤¡£ \fIcompar\fP ¥ë¡¼¥Á¥ó¤ÏÆó¤Ä¤Î°ú¿ô¤ò¼è¤ë´Ø¿ô¤Ç¡¢°ì¤Ä +ÌÜ¤Ë \fIkey\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¡¢¼¡¤ËÇÛÎó¤Î¥á¥ó¥Ð¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò¼è¤ë¡£ +¤³¤Î½ç¤Ë»ØÄꤷ¤¿¤È¤­¡¢ \fIkey\fP ¤¬ÇÛÎó¥á¥ó¥Ð¡¼¤è¤ê¾®¤µ¤¤¤È¤­¤Ë¤Ï +Éé¤ÎÀ°¿ô¤ò¡¢Â礭¤¤¤È¤­¤Ë¤ÏÀµ¤ÎÀ°¿ô¤ò¡¢°ìÃפ·¤¿¤È¤­¤Ë¤Ï 0 ¤ò¡¢¤½¤ì¤¾¤ì +\fIcompar\fP ¤ÏÊÖ¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR bsearch () +´Ø¿ô¤Ï¡¢ÇÛÎó¤Î¥á¥ó¥Ð¡¼¤Î¤¦¤Á¡¢°ìÃפ·¤¿¤â¤Î¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò +ÊÖ¤¹¡£¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¤È¤­¤Ï NULL ¤òÊÖ¤¹¡£ \fIkey\fP ¤È°ìÃפ·¤¿¥á¥ó¥Ð¡¼¤¬ +Ê£¿ô¤¢¤ë¤È¤­¡¢¤½¤Î¤¦¤Á¤Î¤É¤Î¥á¥ó¥Ð¡¼¤¬ÊÖ¤µ¤ì¤ë¤«¤Ï¤ï¤«¤é¤Ê¤¤¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001, C89, C99. +.SH Îã +°Ê²¼¤ÎÎã¤Ï¡¢ +.BR qsort (3) +¤ò»È¤Ã¤Æ¹½Â¤ÂΤÎÇÛÎó¤ÎʤӴ¹¤¨¤ò¹Ô¤Ã¤¿¸å¡¢ +½ê˾¤ÎÍ×ÁǤò +.BR bsearch () +¤ò»È¤Ã¤Æ¼èÆÀ¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.sp +.nf +#include +#include +#include + +struct mi { + int nr; + char *name; +} months[] = { + { 1, "jan" }, { 2, "feb" }, { 3, "mar" }, { 4, "apr" }, + { 5, "may" }, { 6, "jun" }, { 7, "jul" }, { 8, "aug" }, + { 9, "sep" }, {10, "oct" }, {11, "nov" }, {12, "dec" } +}; + +#define nr_of_months (sizeof(months)/sizeof(months[0])) + +static int +compmi(const void *m1, const void *m2) +{ + struct mi *mi1 = (struct mi *) m1; + struct mi *mi2 = (struct mi *) m2; + return strcmp(mi1\->name, mi2\->name); +} + +int +main(int argc, char **argv) +{ + int i; + + qsort(months, nr_of_months, sizeof(struct mi), compmi); + for (i = 1; i < argc; i++) { + struct mi key, *res; + key.name = argv[i]; + res = bsearch(&key, months, nr_of_months, + sizeof(struct mi), compmi); + if (res == NULL) + printf("\(aq%s\(aq: unknown month\en", argv[i]); + else + printf("%s: month #%d\en", res\->name, res\->nr); + } + exit(EXIT_SUCCESS); +} +.fi +.\" ¤³¤ÎÎã¤Ï qsort.3 ¤Ç»²¾È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR hsearch (3), +.BR lsearch (3), +.BR qsort (3), +.BR tsearch (3) diff --git a/release/man3/bstring.3 b/release/man3/bstring.3 new file mode 100644 index 00000000..c011a67f --- /dev/null +++ b/release/man3/bstring.3 @@ -0,0 +1,92 @@ +.\" 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-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 +.\" +.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 +.sp +.BI "int bcmp(const void *" s1 ", const void *" s2 ", int " n ); +.sp +.BI "void bcopy(const void *" src ", void *" dest ", int " n ); +.sp +.BI "void bzero(void *" s ", int " n ); +.sp +.BI "void *memccpy(void *" dest ", const void *" src ", int " c ", size_t " n ); +.sp +.BI "void *memchr(const void *" s ", int " c ", size_t " n ); +.sp +.BI "int memcmp(const void *" s1 ", const void *" s2 ", size_t " n ); +.sp +.BI "void *memcpy(void *" dest ", const void *" src ", size_t " n ); +.sp +.BI "void *memfrob(void *" s ", size_t " n ); +.sp +.BI "void *memmem(const void *" needle ", size_t " needlelen , +.BI " const void *" haystack ", size_t " haystacklen ); +.sp +.BI "void *memmove(void *" dest ", const void *" src ", size_t " n ); +.sp +.BI "void *memset(void *" s ", int " c ", size_t " n ); +.fi +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï NULL ½ªÃ¼¤¹¤ëɬÍפΤʤ¤Ê¸»úÎó (¥Ð¥¤¥ÈÇÛÎó) ¤ÎÁàºî¤ò¹Ô¤¦¡£ +´Ø¿ô¤Î¾Ü¤·¤¤ÀâÌÀ¤Ï¡¢¤½¤ì¤¾¤ì¤Î man ¥Ú¡¼¥¸¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH Ãí°Õ +.BR bcmp (), +.BR bcopy (), +.BR bzero () +´Ø¿ô¤Ï¸Å¤¤¤â¤Î¤Ç¤¢¤ë¡£Âå¤ï¤ê¤Ë +.BR memcmp (), +.BR memcpy () +.BR memset () +¤ò»È¤¦¤³¤È¡£ +.\" ¸Å¤¤´Ø¿ô¤Ï GNU/Linux °Ê³°¤Î¥·¥¹¥Æ¥à¤Ç¤ÏÍÑ°Õ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤¹¤é¤¢¤ë¡£ +.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) diff --git a/release/man3/btowc.3 b/release/man3/btowc.3 new file mode 100644 index 00000000..4803bc88 --- /dev/null +++ b/release/man3/btowc.3 @@ -0,0 +1,69 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" Japanese Version Copyright (c) 1999 HAYAKAWA Hitoshi +.\" all rights reserved. +.\" Translated Sep 11, 1999 HAYAKAWA Hitoshi +.\" +.\"WORD: locale ¥í¥±¡¼¥ë +.\"WORD: convert ¥³¥ó¥Ð¡¼¥È +.\"WORD: single byte ¥·¥ó¥°¥ë¥Ð¥¤¥È +.\"WORD: wide character ¥ï¥¤¥É¥­¥ã¥é¥¯¥¿¡¼ +.\"WORD: state ¾õÂÖ +.\" +.TH BTOWC 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +btowc \- ¥·¥ó¥°¥ë¥Ð¥¤¥È¤ò¥ï¥¤¥Éʸ»ú¤Ë¥³¥ó¥Ð¡¼¥È¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wint_t btowc(int " c ); +.fi +.SH ÀâÌÀ +.BR btowc () +´Ø¿ô¤Ï½é´ü¥·¥Õ¥È¾õÂÖ¤«¤é»Ï¤Þ¤ëŤµ 1 ¤Î¥Þ¥ë¥Á¥Ð¥¤¥È¤Î¥·¡¼¥±¥ó¥¹¤È¤·¤Æ +²ò¼á¤µ¤ì¡¢\fIc\fP ¤ò¥ï¥¤¥Éʸ»ú¤Ë¥³¥ó¥Ð¡¼¥È¤·¤ÆÊÖ¤¹¡£ +\fIc\fP ¤¬ +.B EOF +¤â¤·¤¯¤ÏŤµ 1 ¤Î̵¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤Î¾ì¹ç¡¢ +.BR btowc () +´Ø¿ô¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +.BR btowc () +´Ø¿ô¤Ï¥·¥ó¥°¥ë¥Ð¥¤¥È \fIc\fP ¤«¤é¥³¥ó¥Ð¡¼¥È¤µ¤ì¤¿¥ï¥¤¥Éʸ»ú¤òÊÖ¤¹¡£ +\fIc\fP ¤¬ +.B EOF +¤â¤·¤¯¤ÏŤµ 1 ¤Î̵¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤Î¾ì¹ç¡¢ +.BR btowc () +´Ø¿ô¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH Ãí°Õ +.BR btowc () +¤Î¿¶¤ëÉñ¤¤¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¡¼¤Ë°Í¸¤¹¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤Ï»ÈÍѤµ¤ì¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£¾õÂÖ(state)¤ò»ý¤Ã¤¿¥¨¥ó¥³¡¼¥É¤Ë¤Ï»È¤¨¤º¡¢ +¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤È¤Ï°ã¤¤¡¢É¬¤º¤·¤â¥·¥ó¥°¥ë¥Ð¥¤¥È +¤ò¼è¤ê°·¤¨¤ë¤È¤Ï¸Â¤é¤Ê¤¤¡£ +.BR mbtowc () +¤òÂå¤ï¤ê¤È¤·¤Æ»ÈÍѤ·¤Ê¤µ¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR wctob (3), +.BR mbtowc (3) diff --git a/release/man3/btree.3 b/release/man3/btree.3 new file mode 100644 index 00000000..37a2204a --- /dev/null +++ b/release/man3/btree.3 @@ -0,0 +1,238 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)btree.3 8.4 (Berkeley) 8/18/94 +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito +.\" all rights reserved. +.\" Translated Mon Jul 26 21:43:11 JST 1999 +.\" by Shouichi Saito +.\" Proofed Mon Aug 16 1999 by NAKANO Takeo +.\" +.\"WORD: access method ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.\"WORD: prefix (comparison) Á°ÃÖÈæ³Ó +.TH BTREE 3 1994-08-18 "" "Linux Programmer's Manual" +.UC 7 +.SH ̾Á° +btree \- btree ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.SH ½ñ¼° +.nf +.ft B +#include +#include +.ft R +.fi +.SH ÀâÌÀ +¥ë¡¼¥Á¥ó +.BR dbopen (3) +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¤Ò¤È¤Ä¤Ë btree ¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¡£ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ë´Ø¤¹¤ë°ìÈÌŪ¤Êµ­½Ò¤Ï +.BR dbopen (3) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï btree ÆÃÍ­¤Î¾ðÊó¤Ë¤Ä¤¤¤Æ¤Î¤ßµ­½Ò¤¹¤ë¡£ +.PP +btree ¥Ç¡¼¥¿¹½Â¤¤Ç¤Ï¡¢¥½¡¼¥È¤µ¤ì¤¿¥Ð¥é¥ó¥¹¥Ä¥ê¡¼¹½Â¤¤Ë +¸ß¤¤¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥­¡¼/¥Ç¡¼¥¿ÂФò³ÊǼ¤·¤Æ¤¤¤ë¡£ +.PP +.BR dbopen (3) +¤ËÅϤµ¤ì¤ë btree ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤ËÆÃÍ­¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢ +.I +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ç¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf + +typedef struct { + unsigned long flags; + unsigned int cachesize; + int maxkeypage; + int minkeypage; + unsigned int psize; + int (*compare)(const DBT *key1, const DBT *key2); + size_t (*prefix)(const DBT *key1, const DBT *key2); + int lorder; +} BTREEINFO; +.fi +.in +.sp +¤³¤Î¹½Â¤ÂΤÎÍ×ÁǤò°Ê²¼¤Ë¼¨¤¹¡£ +.TP +.I flags +.I flags +¤ÎÃͤϰʲ¼¤ÎÃͤΤ¤¤º¤ì¤«¤«¡¢¤³¤ì¤é¤ÎÏÀÍýϤǻØÄꤵ¤ì¤ë¡£ +.RS +.TP +.B R_DUP +¥Ä¥ê¡¼¤ÎÃæ¤Ë¥­¡¼¤Î½ÅÊ£¤òµö¤¹¡£¤¹¤Ê¤ï¤Á¥Ä¥ê¡¼¤ÎÃæ¤ËÁÞÆþ¤µ¤ì¤è¤¦¤È¤·¤Æ¤¤¤ë +¥­¡¼¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤Æ¤â¡¢¤½¤ÎÁÞÆþ¤òµö²Ä¤¹¤ë¡£¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï +.BR dbopen (3) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¡¢¿·¤·¤¤¥­¡¼¤¬ÁÞÆþ¤µ¤ì¤ë¤È°ìÃפ·¤¿¥­¡¼¤ò¾å½ñ¤­¤¹¤ë¡£ +¤¢¤ë¤¤¤Ï +.B R_NOOVERWRITE +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤ÈÁÞÆþ¤Ë¼ºÇÔ¤¹¤ë¡£ +.B R_DUP +¥Õ¥é¥°¤Ï +.B R_NOOVERWRITE +¥Õ¥é¥°¤Ë¤è¤Ã¤Æ¾å½ñ¤­¤µ¤ì¤ë¡£¤Ä¤Þ¤ê +.B R_NOOVERWRITE +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥Ä¥ê¡¼¤ËÊ£À½¥­¡¼¤òÁÞÆþ¤·¤è¤¦¤È¤¹¤ë¤È¼ºÇÔ¤¹¤ë¡£ +.IP +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥­¡¼¤Î½ÅÊ£¤¬¤¢¤ë¤È¡¢ +.I get +¥ë¡¼¥Á¥ó¤ò»È¤Ã¤¿¾ì¹ç¤Î¥­¡¼/¥Ç¡¼¥¿ÂФμèÆÀ½ç¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£¤½¤ì¤ËÂФ·¡¢ +.B R_CURSOR +¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¤Æ +.I seq +¥ë¡¼¥Á¥ó¤ò»È¤¦¤È¡¢Ê£À½¥­¡¼¤Î¥°¥ë¡¼¥×¤ÎÃæ¤Î +ÏÀÍýŪ¤Ë¡ÖºÇ½é¡×¤Î¥­¡¼¤òɬ¤ºÊÖ¤·¤Æ¤¯¤ë¡£ +.RE +.TP +.I cachesize +ÁÛÄꤵ¤ì¤ë¥á¥â¥ê¥­¥ã¥Ã¥·¥å¤ÎºÇÂ祵¥¤¥º (¥Ð¥¤¥Èñ°Ì)¡£ +¤³¤ÎÃÍ¤Ï +.I ¤¢¤¯¤Þ¤Ç +»²¹Í¤Ç¤¢¤ê¡¢¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ï¤³¤ÎÃͤò±Û¤¨¤¿¥á¥â¥ê¤Î +³ä¤êÅö¤Æ¤ËÀ®¸ù¤¹¤ë¤³¤È¤â¤¢¤ë¡£ +²Ã¤¨¤Æ¡¢ÊªÍýŪ¤Ê½ñ¤­¹þ¤ß¤Ï²Äǽ¤Ê¸Â¤êÃٱ䤵¤ì¤ë¤Î¤Ç¡¢ +¥­¥ã¥Ã¥·¥å¤ÎÂ礭¤µ¤òŬÅ٤ˤ·¤Æ¤ª¤±¤Ð I/O Áàºî¤Î²ó¿ô¤ò¤«¤Ê¤ê¸º¤é¤¹¤³¤È +¤¬¤Ç¤­¤ë¡£ +¤¢¤­¤é¤«¤Ë¥­¥ã¥Ã¥·¥å¤ò»È¤¦¤È¡¢¥Ä¥ê¡¼¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤ëÅÓÃæ¤Ç +¥·¥¹¥Æ¥à¤¬¥¯¥é¥Ã¥·¥å¤·¤¿¾ì¹ç¤Î¥Ç¡¼¥¿Ç˲õ¤ä¥Ç¡¼¥¿¥í¥¹¥È¤Î²ÄǽÀ­¤Ï +Áý¤¨¤ë (¤Þ¤¢¤Ç¤â¤½¤ì¤À¤±¤Î¤³¤È)¡£ +.I cachesize +¤¬ 0 (¥µ¥¤¥º¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥­¥ã¥Ã¥·¥å¤¬»È¤ï¤ì¤ë¡£ +.TP +.I maxkeypage +ñ°ì¥Ú¡¼¥¸¤ËǼ¤á¤é¤ì¤ëºÇÂ祭¡¼¿ô¤Ç¤¢¤ë¡£¸½ºß¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" The maximum number of keys which will be stored on any single page. +.\" Because of the way the btree data structure works, +.\" .I maxkeypage +.\" must always be greater than or equal to 2. +.\" If +.\" .I maxkeypage +.\" is 0 (no maximum number of keys is specified) the page fill factor is +.\" made as large as possible (which is almost invariably what is wanted). +.TP +.I minkeypage +ñ°ì¥Ú¡¼¥¸¤ËǼ¤á¤é¤ì¤ëºÇ¾®¥­¡¼¿ô¤Ç¤¢¤ë¡£¤³¤ÎÃͤϡ¢¤É¤Î¥­¡¼¤ò +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¥Ú¡¼¥¸ +¤ËǼ¤á¤ë¤«·è¤á¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£¤¹¤Ê¤ï¤Á¥­¡¼¤Þ¤¿¤Ï¥Ç¡¼¥¿¤¬ +minkeypage ¤ÎÃͤÇʬ³ä¤µ¤ì¤¿¥Ú¡¼¥¸¥µ¥¤¥º¤è¤êÂ礭¤¤»þ¡¢¤½¤Î¥Ú¡¼¥¸¤ËǼ¤á +¤ëÂå¤ï¤ê¤Ë¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¥Ú¡¼¥¸¤ËǼ¤á¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.I minkeypage +¤¬ 0 (¥­¡¼¤ÎºÇ¾®Ãͤ¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢ÃͤȤ·¤Æ 2 ¤¬»È¤ï¤ì¤ë¡£ +.TP +.I psize +¥Ä¥ê¡¼¤ÎÃæ¤Î¥Î¡¼¥É¤Ë»È¤ï¤ì¤ë¥Ú¡¼¥¸¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì)¡£ +ºÇ¾®ÃÍ¤Ï 512 ¥Ð¥¤¥È¤Ç¡¢ºÇÂçÃÍ¤Ï 64K ¤Ç¤¢¤ë¡£ +.I psize +¤¬ 0 (¥Ú¡¼¥¸¥µ¥¤¥º¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î I/O ¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤Ë´ð¤Å¤¤¤Æ·è¤á¤é¤ì¤ë¡£ +.TP +.I compare +.I compare +¤Ï¥­¡¼¤ÎÈæ³Ó´Ø¿ô¤Ç¤¢¤ë¡£ +ºÇ½é¤Î¥­¡¼°ú¿ô¤ËÂФ·¡¢ÆóÈÖÌܤΥ­¡¼°ú¿ô¤¬Â礭¤¤¾ì¹ç¤Ë¤ÏÀµ¤ÎÀ°¿ô¤ò¡¢ +Ʊ¤¸¾ì¹ç¤Ë¤Ï¥¼¥í¤ò¡¢¾®¤µ¤¤¾ì¹ç¤Ë¤ÏÉé¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +¥Ä¥ê¡¼¤ò³«¤¯ºÝ¤Ë¤Ï¡¢¾ï¤ËƱ¤¸Èæ³Ó´Ø¿ô¤¬»È¤ï¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I compare +¤¬ NULL (Èæ³Ó´Ø¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢ +¼­½ñŪ¤ËÈæ³Ó¤µ¤ì¤ë¡£Ã»¤¤¥­¡¼¤ÏŤ¤¥­¡¼¤è¤ê¾®¤µ¤¤¤³¤È¤Ë¤Ê¤ë¡£ +.TP +.I prefix +.I prefix +¤ÏÁ°ÃÖÈæ³Ó´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Á¥ó¤Ï (»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï)¡¢ÆóÈÖÌܤΥ­¡¼°ú¿ô¤Î +¥Ð¥¤¥È¿ô¤òÊÖ¤µ¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¤³¤ì¤ÏÆóÈÖÌܤΥ­¡¼°ú¿ô¤¬ +°ìÈÖÌܤΥ­¡¼°ú¿ô¤è¤êÂ礭¤¤¤«¤É¤¦¤«·è¤á¤ë¤Î¤ËɬÍפǤ¢¤ë¡£ +.\"NAKANO ¤Á¤ç¤Ã¤È°ÕÌ£¤ï¤«¤é¤ó... +¥­¡¼¤¬Æ±¤¸¾ì¹ç¡¢¥­¡¼¤ÎŤµ¤¬Ê֤롣¤³¤Î¥ë¡¼¥Á¥ó¤¬Í­ÍѤ«¤É¤¦¤«¤Ï¡¢ +¥Ç¡¼¥¿¤Ë¶¯¤¯°Í¸¤¹¤ë¡£¤·¤«¤·¥Ç¡¼¥¿¥»¥Ã¥È¤Ë¤è¤Ã¤Æ¤Ï¡¢ÌÀ¤é¤«¤Ë¥Ä¥ê¡¼ +¤Î¥µ¥¤¥º¤È¸¡º÷»þ´Ö¤ò¸º¤é¤·¤Æ¤¯¤ì¤ë¡£ +.I prefix +¤¬ NULL (prefix ´Ø¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Ç¡¢ +.I ¤«¤Ä +Èæ³Ó´Ø¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢¥Ç¥Õ¥©¥ë¥È¤Î¼­½ñÈæ³Ó¥ë¡¼¥Á¥ó¤¬»È¤ï¤ì¤ë¡£ +.I prefix +¤¬ NULL ¤ÇÈæ³Ó´Ø¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢Á°ÃÖÈæ³Ó¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +.TP +.I lorder +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥á¥¿¥Ç¡¼¥¿¤ÎÀ°¿ôÃͤΥХ¤¥È¥ª¡¼¥À¡¼¡£ +¤³¤Î¿ô»ú¤Ï¡¢½ç½ø¤òÀ°¿ô¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +Î㤨¤Ð¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤Ê¤é¡¢¤³¤Î¿ôÃÍ¤Ï 4,321 ¤È¤Ê¤ë¡£ +.I lorder +¤¬ 0 (»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢¸½ºß¤Î¥Û¥¹¥È +¤Ç»È¤ï¤ì¤Æ¤¤¤ë¥Ð¥¤¥È¥ª¡¼¥À¡¼¤¬»È¤ï¤ì¤ë¡£ +.PP +¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤ë (¤Þ¤¿¤Ï +.B O_TRUCT +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤È¡¢ +°ú¤­¿ô +.IR flag , +.IR lorder , +.I psize +¤Ë»ØÄꤵ¤ì¤¿ÃͤÏ̵»ë¤µ¤ì¡¢ +¥Ä¥ê¡¼¤¬ºî¤é¤ì¤¿»þ¤Ë»È¤Ã¤¿Ãͤ¬ÍѤ¤¤é¤ì¤ë¡£ +.PP +¥Ä¥ê¡¼¤ÎÁ°Êý½ç¸¡º÷¤Ï¡¢ºÇ¾®¥­¡¼¤«¤éºÇÂ祭¡¼¤Ë¸þ¤«¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +.PP +¥Ä¥ê¡¼¤«¤é¥­¡¼/¥Ç¡¼¥¿ÂФ¬ºï½ü¤µ¤ì¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤Ç¤­¤¿¥¹¥Ú¡¼¥¹¤Ï¡¢ +Ä̾ïºÆÍøÍѤǤ­¤ë·Á¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¬ºÆÍøÍѤµ¤ì¤ë¤³¤È¤Ï̵¤¤¡£ +¤Ä¤Þ¤ê brtee µ­²±¹½Â¤¤ÏÈîÂ礹¤ë°ìÊý¤Ç¤¢¤ë¡£ +Âкö¤Ï²áÅ٤κï½ü¤òÈò¤±¤ë¤«¡¢ +¸ºß¤¹¤ë¥Ä¥ê¡¼¤òÄ´¤Ù¤ÆÄê´üŪ¤Ë¿·¤·¤¤¥Ä¥ê¡¼¤òºî¤ë¤«¡¢¤À¤±¤Ç¤¢¤ë¡£ +.PP +.SH ¥¨¥é¡¼ +.I btree +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¥ë¡¼¥Á¥ó¤Ï¼ºÇÔ¤¹¤ë¤È¡¢¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR dbopen (3) +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Î¤¤¤º¤ì¤«¤ò +.I errno +¤È¤·¤ÆÊÖ¤¹¡£ +.SH ¥Ð¥° +¥Ð¥¤¥È¥ª¡¼¥À¡¼¤È¤·¤Æ¤Ï¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤È¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó¤Î¤ß¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR dbopen (3), +.BR hash (3), +.BR mpool (3), +.BR recno (3) +.sp +.IR "The Ubiquitous B-tree" , +Douglas Comer, ACM Comput. Surv. 11, 2 (June 1979), 121-138. +.sp +.IR "Prefix B-trees" , +Bayer and Unterauer, ACM Transactions on Database Systems, Vol. 2, 1 +(March 1977), 11-26. +.sp +.IR "The Art of Computer Programming Vol. 3: Sorting and Searching" , +D.E. Knuth, 1968, pp 471-480. diff --git a/release/man3/byteorder.3 b/release/man3/byteorder.3 new file mode 100644 index 00000000..7eacef82 --- /dev/null +++ b/release/man3/byteorder.3 @@ -0,0 +1,80 @@ +.\" 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 Sat Jul 24 21:29:05 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Thu Jul 26 14:06:20 2001 by Andries Brouwer (aeb@cwi.nl) +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-05-18, NAKANO Takeo +.\" Updated 2005-11-04, Akihiro MOTOKI +.\" +.TH BYTEORDER 3 2009-01-15 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +htonl, htons, ntohl, ntohs \- ¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¼¤È¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Î´Ö¤ÇÃͤòÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "uint32_t htonl(uint32_t " hostlong ); +.sp +.BI "uint16_t htons(uint16_t " hostshort ); +.sp +.BI "uint32_t ntohl(uint32_t " netlong ); +.sp +.BI "uint16_t ntohs(uint16_t " netshort ); +.fi +.SH ÀâÌÀ +.BR htonl () +´Ø¿ô¤Ï unsigned integer \fIhostlong\fP ¤ò +¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¼¤«¤é¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤ËÊÑ´¹¤¹¤ë¡£ +.PP +.BR htons () +´Ø¿ô¤Ï unsigned short integer \fIhostshort\fP ¤ò +¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¼¤«¤é¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤ËÊÑ´¹¤¹¤ë¡£ +.PP +.BR ntohl () +´Ø¿ô¤Ï unsigned integer \fInetlong\fP ¤ò +¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤«¤é¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¼¤ËÊÑ´¹¤¹¤ë¡£ +.PP +.BR ntohs () +´Ø¿ô¤Ï unsigned short integer \fInetshort\fP ¤ò +¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤«¤é¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¼¤ËÊÑ´¹¤¹¤ë¡£ +.PP +i80x86 ¤Î¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç¤ÏºÇ²¼°Ì¥Ð¥¤¥È¤¬¼ã¤¤¥¢¥É¥ì¥¹¤ËÇÛÃÖ¤µ¤ì¤ë¤¬¡¢ +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤ÇÍѤ¤¤é¤ì¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç¤ÏºÇ¾å°Ì¥Ð¥¤¥È +¤¬Àè¤ËÇÛÃÖ¤µ¤ì¤ë¡£ +.SH ½àµò +POSIX.1-2001. + +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I +¤ÎÂå¤ï¤ê¤Ë +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR endian (3), +.BR gethostbyname (3), +.BR getservent (3) diff --git a/release/man3/bzero.3 b/release/man3/bzero.3 new file mode 100644 index 00000000..ed768de0 --- /dev/null +++ b/release/man3/bzero.3 @@ -0,0 +1,68 @@ +.\" 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 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 +.\" +.TH BZERO 3 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +bzero \- ÃÍ 0 ¤Î¥Ð¥¤¥È¤ÇËä¤á¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void bzero(void *" s ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR bzero () +´Ø¿ô¤Ï +¥Ð¥¤¥ÈÎó +.I s +¤«¤é»Ï¤Þ¤ë¥Ð¥¤¥ÈÎΰè¤ÎÀèƬ +.I n +¥Ð¥¤¥È¤ò +¿ôÃÍ¥¼¥í (Ãͤ¬ \(aq\\0\(aq ¤Î¥Ð¥¤¥È) ¤ÇËä¤á¤ë¡£ +.SH ÊÖ¤êÃÍ +¤Ê¤·¡£ +.SH ½àµò +4.3BSD. +¤³¤Î´Ø¿ô¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë (POSIX.1-2001 ¤Ç¤Ï +²áµî¤Î̾»Ä (LEGACY) ¤È¤µ¤ì¤Æ¤¤¤ë)¡£¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï +.BR memset (3) +¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +POSIX.1-2008 ¤Ç¤Ï +.BR bzero () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR memset (3), +.BR swab (3) diff --git a/release/man3/cabs.3 b/release/man3/cabs.3 new file mode 100644 index 00000000..46d403fd --- /dev/null +++ b/release/man3/cabs.3 @@ -0,0 +1,44 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Wed Jul 23 05:04:09 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: complex number Ê£ÁÇ¿ô +.\"WORD: alias ¥¨¥¤¥ê¥¢¥¹ +.\" +.TH CABS 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +cabs, cabsf, cabsl \- Ê£ÁÇ¿ô¤ÎÀäÂÐÃÍ +.SH ½ñ¼° +.B #include +.sp +.BI "double cabs(double complex " z ); +.br +.BI "float cabsf(float complex " z ); +.br +.BI "long double cabsl(long double complex " z ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR cabs () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎÀäÂÐÃͤòÊÖ¤¹¡£ +·ë²Ì¤Ï¼Â¿ô¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH È÷¹Í +¼ÂºÝ¤Ë¤Ï¡¢¤³¤Î´Ø¿ô¤Ï +.I "hypot(a,\ b)" +.RI ( "sqrt(a*a\ +\ b*b)" +¤ÈÅù²Á) ¤Ø¤Î¥¨¥¤¥ê¥¢¥¹¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR abs (3), +.BR cimag (3), +.BR hypot (3), +.BR complex (7) diff --git a/release/man3/cacos.3 b/release/man3/cacos.3 new file mode 100644 index 00000000..fe694d86 --- /dev/null +++ b/release/man3/cacos.3 @@ -0,0 +1,49 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Wed Jul 23 05:24:21 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: arc sine µÕÀµ¸¹ +.\"WORD: arc cosine µÕ;¸¹ +.\"WORD: arc tangent µÕÀµÀÜ +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CACOS 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +cacos, cacosf, cacosl \- Ê£ÁÇ¿ô¤ÎµÕ;¸¹ (arc cosine) +.SH ½ñ¼° +.B #include +.sp +.BI "double complex cacos(double complex " z ); +.br +.BI "float complex cacosf(float complex " z ); +.br +.BI "long double complex cacosl(long double complex " z ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR cacos () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµÕ;¸¹ (arc cosine) ¤ò·×»»¤¹¤ë¡£ +\fIy\ =\ cacos(z)\fP ¤Ê¤é¤Ð¡¢ \fIz\ =\ ccos(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤Î¼ÂÉô¤ÎÃͤ϶è´Ö [0,pi] ¤«¤éÁªÂò¤µ¤ì¤ë¡£ +.LP +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + cacos(z) = \-i clog(z + csqrt(z * z \- 1)) +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR ccos (3), +.BR clog (3), +.BR complex (7) diff --git a/release/man3/cacosh.3 b/release/man3/cacosh.3 new file mode 100644 index 00000000..cfd8aff9 --- /dev/null +++ b/release/man3/cacosh.3 @@ -0,0 +1,54 @@ +.\" Copyright 2002 Walter Harms(walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 00:26:52 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: hyperbolic ÁжÊ(Àþ¤Î) +.\"WORD: arc sine µÕÀµ¸¹ +.\"WORD: arc cosine µÕ;¸¹ +.\"WORD: arc tangent µÕÀµÀÜ +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CACOSH 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +cacosh, cacoshf, cacoshl \- Ê£ÁÇ¿ô¤ÎµÕÁжÊÀþ;¸¹ (arc hyperbolic cosine) +.SH ½ñ¼° +.B #include +.sp +.BI "double complex cacosh(double complex " z ); +.br +.BI "float complex cacoshf(float complex " z ); +.br +.BI "long double complex cacoshl(long double complex " z ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR cacosh () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµÕÁжÊÀþ;¸¹ (arc hyperbolic cosine) ¤ò·×»»¤¹¤ë¡£ +\fIy\ =\ cacosh(z)\fP ¤Ê¤é¤Ð¡¢ +\fIz\ =\ ccosh(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤ÎµõÉô¤ÎÃͤ϶è´Ö [\-pi,pi] ¤«¤éÁªÂò¤µ¤ì¡¢ +.I y +¤Î¼ÂÉô¤ÎÃͤÏÈóÉé¤ÎÃͤ¬ÁªÂò¤µ¤ì¤ë¡£ +.LP +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + cacosh(z) = (0.5) * clog((1 + z) / (1 \- z)) +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR acosh (3), +.BR cabs (3), +.BR cimag (3), +.BR complex (7) diff --git a/release/man3/canonicalize_file_name.3 b/release/man3/canonicalize_file_name.3 new file mode 100644 index 00000000..28ad3263 --- /dev/null +++ b/release/man3/canonicalize_file_name.3 @@ -0,0 +1,26 @@ +.\" Copyright 2005 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" 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" +.SH ̾Á° +canonicalize_file_name \- Àµµ¬²½¤µ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤òÊÖ¤¹ +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *canonicalize_file_name(const char *" path ");" +.SH ÀâÌÀ +.I canonicalize_file_name(path) +¤Ï +.I "realpath(path,\ NULL)" +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR realpath (3), +.BR feature_test_macros (7) diff --git a/release/man3/carg.3 b/release/man3/carg.3 new file mode 100644 index 00000000..7ae4730f --- /dev/null +++ b/release/man3/carg.3 @@ -0,0 +1,62 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-24, Akihiro MOTOKI +.\" Updated 2005-10-02, Akihiro MOTOKI +.\" +.\"WORD: argument (¶ËºÂɸ¤Î)ÊÐ³Ñ +.\"WORD: coordinates ºÂɸ +.\"WORD: rectangular coordinates ľ¸òºÂɸ +.\"WORD: polar coordinates ¶ËºÂɸ +.\" +.TH CARG 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +carg, cargf, cargl \- Ê£ÁÇ¿ô¤ÎÊгѤò·×»»¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "double carg(double complex " z ");" +.br +.BI "float cargf(float complex " z ");" +.br +.BI "long double cargl(long double complex " z ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +Ê£ÁÇ¿ô¤Ï 2¤Ä¤Î¼Â¿ôÃͤ«¤é¤Ê¤ëºÂɸ¤Çɽ¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +ľ¸òºÂɸ¤ò»È¤¦¤È¡¢°Ê²¼¤Î¤è¤¦¤Ë½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ + +.nf + z = x + I * y +.fi + +¤³¤³¤Ç¡¢\fIx\ =\ creal(z)\fP, \fIy\ =\ cimag(z)\fP ¤Ç¤¢¤ë¡£ +.LP +¤Þ¤¿¡¢¶ËºÂɸ¤ò»È¤¦¤È¡¢°Ê²¼¤Î¤è¤¦¤Ë½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ +.nf + + z = r * cexp(I * a) + +.fi +¤³¤³¤Ç¡¢ +\fIr\ =\ cabs(z)\fP ¤Ï¡ÖȾ·Â¡×¡¢¡Ö·¸¿ô¡×¤Ç¤¢¤ê¡¢ +\fIz\fP ¤ÎÀäÂÐÃͤǤ¢¤ë¡£ +\fIa\ =\ carg(z)\fP ¤Ï¡Ö°ÌÁê³Ñ¡×¤Ç¤¢¤ê¡¢ +\fIz\fP ¤ÎÊгѤǤ¢¤ë¡£ +.LP +¼¡¤Î´Ø·¸¤¬À°Íý¤¹¤ë: +.nf + + tan(carg(z)) = cimag(z) / creal(z) +.fi +.SH ÊÖ¤êÃÍ +ÊÖ¤êÃÍ¤Ï [\-pi,pi] ¤ÎÈϰϤǤ¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR complex (7) diff --git a/release/man3/casin.3 b/release/man3/casin.3 new file mode 100644 index 00000000..5a9129fc --- /dev/null +++ b/release/man3/casin.3 @@ -0,0 +1,49 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 00:07:40 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: arc sine µÕÀµ¸¹ +.\"WORD: arc cosine µÕ;¸¹ +.\"WORD: arc tangent µÕÀµÀÜ +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CASIN 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +casin, casinf, casinl \- Ê£ÁÇ¿ô¤ÎµÕÀµ¸¹ (arc sine) +.SH ½ñ¼° +.B #include +.sp +.BI "double complex casin(double complex " z ); +.br +.BI "float complex casinf(float complex " z ); +.br +.BI "long double complex casinl(long double complex " z ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR casin () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµÕÀµ¸¹ (arg sine) ¤ò·×»»¤¹¤ë¡£ +\fIy\ =\ casin(z)\fP ¤Ê¤é¤Ð¡¢ \fIz\ =\ csin(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤Î¼ÂÉô¤ÎÃͤ϶è´Ö [\-pi/2,pi/2] ¤«¤éÁªÂò¤µ¤ì¤ë¡£ +.LP +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + casin(z) = \-i clog(iz + csqrt(1 \- z * z)) +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR ccos (3), +.BR clog (3), +.BR complex (7) diff --git a/release/man3/casinh.3 b/release/man3/casinh.3 new file mode 100644 index 00000000..6b5d8d5a --- /dev/null +++ b/release/man3/casinh.3 @@ -0,0 +1,51 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 00:41:13 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: hyperbolic ÁжÊ(Àþ¤Î) +.\"WORD: arc sine µÕÀµ¸¹ +.\"WORD: arc cosine µÕ;¸¹ +.\"WORD: arc tangent µÕÀµÀÜ +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CASINH 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +casinh, casinhf, casinhl \- Ê£ÁÇ¿ô¤ÎµÕÁжÊÀþÀµ¸¹ (arc sine hyperbolic) +.SH ½ñ¼° +.B #include +.sp +.BI "double complex casinh(double complex " z ); +.br +.BI "float complex casinhf(float complex " z ); +.br +.BI "long double complex casinhl(long double complex " z ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR casinh () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµÕÁжÊÀþÀµ¸¹ (arc hyperbolic sine) ¤ò·×»»¤¹¤ë¡£ +\fIy\ =\ casinh(z)\fP ¤Ê¤é¤Ð¡¢ \fIz\ =\ csinh(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤ÎµõÉô¤ÎÃͤ϶è´Ö [\-pi/2,pi/2] ¤«¤éÁªÂò¤µ¤ì¤ë¡£ +.LP +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + casinh(z) = clog(z + csqrt(z * z + 1)) +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR asinh (3), +.BR cabs (3), +.BR cimag (3), +.BR complex (7) diff --git a/release/man3/catan.3 b/release/man3/catan.3 new file mode 100644 index 00000000..82c2cfa6 --- /dev/null +++ b/release/man3/catan.3 @@ -0,0 +1,49 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 00:22:25 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: arc sine µÕÀµ¸¹ +.\"WORD: arc cosine µÕ;¸¹ +.\"WORD: arc tangent µÕÀµÀÜ +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CATAN 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +catan, catanf, catanl \- Ê£ÁÇ¿ô¤ÎµÕÀµÀÜ (arc tangent) +.SH ½ñ¼° +.B #include +.sp +.BI "double complex catan(double complex " z ); +.br +.BI "float complex catanf(float complex " z ); +.br +.BI "long double complex catanl(long double complex " z ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR catan () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµÕÀµÀÜ (arc tangent) ¤ò·×»»¤¹¤ë¡£ +\fIy = catan(z)\fP ¤Ê¤é¤Ð¡¢ \fIz = ctan(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤Î¼ÂÉô¤ÎÃͤ϶è´Ö [\-pi/2,pi/2] ¤«¤éÁªÂò¤µ¤ì¤ë¡£ +.LP +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + catan(z) = 1 / 2i clog((1 + iz) / (1 \- iz)) +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR ccos (3), +.BR clog (3), +.BR complex (7) diff --git a/release/man3/catanh.3 b/release/man3/catanh.3 new file mode 100644 index 00000000..03125f50 --- /dev/null +++ b/release/man3/catanh.3 @@ -0,0 +1,51 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 00:43:35 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: hyperbolic ÁжÊ(Àþ¤Î) +.\"WORD: arc sine µÕÀµ¸¹ +.\"WORD: arc cosine µÕ;¸¹ +.\"WORD: arc tangent µÕÀµÀÜ +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CATANH 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +catanh, catanhf, catanhl \- Ê£ÁÇ¿ô¤ÎµÕÁжÊÀþÀµÀÜ (arc tangents hyperbolic) +.SH ½ñ¼° +.B #include +.sp +.BI "double complex catanh(double complex " z ); +.br +.BI "float complex catanhf(float complex " z ); +.br +.BI "long double complex catanhl(long double complex " z ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR catanh () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµÕÁжÊÀþÀµ¸¹ (arc hyperbolic tangent) ¤ò·×»»¤¹¤ë¡£ +\fIy = catanh(z)\fP ¤Ê¤é¤Ð¡¢ \fIz = ctanh(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤ÎµõÉô¤ÎÃͤ϶è´Ö [\-pi/2,pi/2] ¤«¤éÁªÂò¤µ¤ì¤ë¡£ +.LP +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + catanh(z) = 0.5 * clog((1 + z) / (1 \- z)) +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR atanh (3), +.BR cabs (3), +.BR cimag (3), +.BR complex (7) diff --git a/release/man3/catgets.3 b/release/man3/catgets.3 new file mode 100644 index 00000000..21ad2fb7 --- /dev/null +++ b/release/man3/catgets.3 @@ -0,0 +1,91 @@ +.\" Copyright 1993 Mitchum DSouza +.\" +.\" 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. +.\" +.\" Updated, aeb, 980809 +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Tue Dec 16 19:43:01 JST 1997 +.\" by HIROFUMI Nishizuka +.\" Updated & Modified Mon Mar 1 1999 +.\" by NAKANO Takeo +.\" +.TH CATGETS 3 1998-08-09 "" "Linux Programmer's Manual" +.SH ̾Á° +catgets \- ¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤«¤é¥á¥Ã¥»¡¼¥¸¤ò¼è¤ê½Ð¤¹ +.SH ½ñ¼° +.nf +.B #include + +.BI "char *catgets(nl_catd " catalog ", int " set_number \ +", int " message_number , +.BI " const char *" message ); +.fi +.SH ÀâÌÀ +.BR catgets () +¤Ï catalog ¤Ç»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤«¤é¡¢ +¥»¥Ã¥È +.I set_number +¤Î¥á¥Ã¥»¡¼¥¸ +.I message_number +¤òÆɤ߼è¤ë¡£ +.I catalog +¤Ï¡¢ +.BR catopen (3) +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤¿¥«¥¿¥í¥° +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»ØÄꤹ¤ë¡£ +4ÈÖÌܤΰú¿ô +.I message +¤Ï¡¢»ØÄê¤Î¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤¬¸½ºßÍøÍѤǤ­¤Ê¤¤ +¾ì¹ç¤Ë +.BR catgets () +¤¬ÊÖ¤¹¥Ç¥Õ¥©¥ë¥È¤Î¥á¥Ã¥»¡¼¥¸¤ò»Ø¤¹¡£ +¥á¥Ã¥»¡¼¥¸¥Æ¥­¥¹¥È¤ÏÆâÉô¤Î¥Ð¥Ã¥Õ¥¡Îΰè¤Ë³ÊǼ¤µ¤ì¤Æ¤ª¤ê¡¢ +Êݸ¤äÊѹ¹¤ò¹Ô¤¦¾ì¹ç¤Ë¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¦¤Ç¥³¥Ô¡¼¤¹¤ëɬÍפ¬¤¢¤ë¡£ +ÊÖ¤µ¤ì¤ëʸ»úÎó¤Ï¾ï¤Ë¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.LP +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR catgets () +¤ÏÆâÉô¤Î¥Ð¥Ã¥Õ¥¡Îΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤³¤Ë¤Ï¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸Ê¸»úÎ󤬳ÊǼ¤µ¤ì¤Æ¤¤¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï +.I message +¤òÊÖ¤¹¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤Ï libc.so.4.4.4c °Ê¹ß¤Ç¤·¤«»È¤¨¤Ê¤¤¡£ +Jan 1987 X/Open Portability Guide ¤Ç¤Ï¡¢¥¨¥é¡¼¤Î»þ¤Ë +ÊÖ¤µ¤ì¤ëÃͤˤè¤êÈù̯¤Ê»ØÄê¤ò¤·¤Æ¤¤¤ë¡£ +.I catalog +¤Ç»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤¬ÍøÍѤǤ­¤Ê¤¤¾ì¹ç¤Ï +.I message +¤òÊÖ¤·¡¢°ìÊý¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤Ï¤¢¤ë¤¬»ØÄꤷ¤¿¥á¥Ã¥»¡¼¥¸¤¬¤Ê¤¤¾ì¹ç¤Ï +¶õ¤Îʸ»úÎó¤¬ÊÖ¤µ¤ì¤ë¡£ +SUSv2 ¤Ç¤Ï¤³¤ÎÆó¼ïÎà¤Î¥¨¥é¡¼¥ê¥¿¡¼¥ó¤ÏÇѻߤµ¤ì¡¢ +¾ï¤Ë +.I message +¤òÊÖ¤¹¤³¤È¤Ë¤·¤¿¤è¤¦¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR catopen (3), +.BR setlocale (3) diff --git a/release/man3/catopen.3 b/release/man3/catopen.3 new file mode 100644 index 00000000..1bdde5e5 --- /dev/null +++ b/release/man3/catopen.3 @@ -0,0 +1,193 @@ +.\" Copyright 1993 Mitchum DSouza +.\" +.\" 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 Thu Dec 13 22:51:19 2001 by Martin Schulze +.\" Modified 2001-12-14 aeb +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Tue Dec 16 19:43:18 JST 1997 +.\" by HIROFUMI Nishizuka +.\" Updated & Modified Mon Jan 14 06:48:39 JST 2002 +.\" by Yuichi SATO +.\" +.TH CATOPEN 3 2001-12-14 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +catopen, catclose \- ¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤Î¥ª¡¼¥×¥ó/¥¯¥í¡¼¥º +.SH ½ñ¼° +.B #include +.sp +.BI "nl_catd catopen(const char *" name ", int " flag ); + +.BI "int catclose(nl_catd " catalog ); +.SH ÀâÌÀ +´Ø¿ô +.BR catopen () +¤Ï¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤ò¥ª¡¼¥×¥ó¤·¡¢¥«¥¿¥í¥°¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¤³¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.BR catclose () +¤Þ¤¿¤Ï +.BR execve (2) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤Þ¤ÇÍ­¸ú¤Ç¤¢¤ë¡£ +¥«¥¿¥í¥°¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¼ÂÁõ¤¹¤ë¤¿¤á¤Ë +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»ÈÍѤ¹¤ë¤È¡¢ +.B FD_CLOEXEC +¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤ë¡£ +.LP +°ú¤­¿ô +.I name +¤Ï¥ª¡¼¥×¥ó¤¹¤ë¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤Î̾Á°¤ò»ØÄꤹ¤ë¡£ +.I name +¤¬ÀäÂХѥ¹¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç (¤¹¤Ê¤ï¤Á \(aq/\(aq ¤ò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç)¡¢ +.I name +¤Ï¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤Ø¤Î¥Ñ¥¹Ì¾¤Ç¤¢¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢´Ä¶­ÊÑ¿ô +.B NLSPATH +¤¬ +.I name +¤È¤È¤â¤Ë»ÈÍѤµ¤ì +.B %N +¤òÃÖ¤­´¹¤¨¤ë +.RB ( locale (7) +»²¾È)¡£ +¥×¥í¥»¥¹¤¬ root ¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤ë¤È¤­¤Ë +.B NLSPATH +¤¬»È¤ï¤ì¤ë¤«¤É¤¦¤«¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.B NLSPATH +´Ä¶­ÊÑ¿ô¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢ +.B NLSPATH +¤Ç»ØÄꤵ¤ì¤¿¥Ñ¥¹¤ÎÃæ¤Î +¤É¤Î¥Ñ¥¹¤Ë¤ª¤¤¤Æ¤â¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤ò¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤¾ì¹ç¡¢ +¼ÂÁõ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Ñ¥¹¤¬»È¤ï¤ì¤ë¡£ +¸å¼Ô¤Î¥Ç¥Õ¥©¥ë¥È¥Ñ¥¹¤Ï¡¢ +.I flag +°ú¤­¿ô¤¬ +.B NL_CAT_LOCALE +¤Î¾ì¹ç¤Ë¤Ï +.B LC_MESSAGES +¤Î¥í¥±¡¼¥ëÀßÄê¤Ë°Í¸¤·¡¢ +.I flag +°ú¤­¿ô¤¬ 0 ¤Î¾ì¹ç¤Ë¤Ï +.B LANG +´Ä¶­ÊÑ¿ô¤Ë°Í¸¤¹¤ë¡£ +¥í¥±¡¼¥ë¤Î +.B LC_MESSAGES +¤òÊѹ¹¤¹¤ë¤È¡¢ +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥«¥¿¥í¥°¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Ìµ¸ú¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +.BR catopen () +¤Î +.I flag +°ú¤­¿ô¤Ï¡¢»ÈÍѤµ¤ì¤ë¸À¸ì¤Î¥½¡¼¥¹¤ò¼¨¤¹¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.B NL_CAT_LOCALE +¤ËÀßÄꤵ¤ì¤ë¤È¡¢ +.B LC_MESSAGES +¤Î¸½ºß¤Î¥í¥±¡¼¥ëÀßÄ꤬»È¤ï¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï +.B LANG +´Ä¶­ÊÑ¿ô¤¬»È¤ï¤ì¤ë¡£ +.LP +´Ø¿ô +.BR catclose () +¤Ï +.I catalog +¤Ç»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +¤³¤ì¤Ï¡¢°Ê¹ß¤Î +.I catalog +¤Ç»ØÄꤵ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤Ø¤ÎÁ´¤Æ¤Î»²¾È¤ò̵¸ú¤Ë¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +´Ø¿ô +.BR catopen () +¤¬À®¸ù¤¹¤ë¤È¡¢ +.I nl_catd +·¿¤Î¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \fI(nl_catdv) \-1\fP ¤òÊÖ¤·¡¢ +.I errno +¤òÀßÄꤷ¤Æ¥¨¥é¡¼¤ò¼¨¤¹¡£ +¤³¤³¤Çµ¯¤³¤êÆÀ¤ë¥¨¥é¡¼¤ÎÃͤˤϡ¢ +.BR open (2) +¤Î¸Æ¤Ó½Ð¤·¤ÎºÝ¤Ëµ¯¤³¤êÆÀ¤ëÁ´¤Æ¤Î¥¨¥é¡¼¤ÎÃͤ¬´Þ¤Þ¤ì¤ë¡£ +.LP +´Ø¿ô +.BR catclose () +¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç 0 ¤ò¡¢¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤òÊÖ¤¹¡£ +.SH ´Ä¶­ÊÑ¿ô +.TP +.B LC_MESSAGES +.B LC_MESSAGES +¥í¥±¡¼¥ëÀßÄê¤Î¥½¡¼¥¹¤Ë¤Ê¤ë¤³¤È¤â²Äǽ¤Ê¤Î¤Ç¡¢ +.I flag +¤¬ +.B NL_CAT_LOCALE +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢»ÈÍѤ¹¤ë¸À¸ì¤ò·èÄꤹ¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£ +.TP +.B LANG +.I flag +¤¬ 0 ¤Î¾ì¹ç¡¢»ÈÍѤ¹¤ë¸À¸ì¤ò·èÄꤹ¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.\" XPG 1987, Vol. 3 ¤Ë¤Ï¡¢¡Ö\fIcatopen ¤Î flag °ú¤­¿ô¤Ï +.\" ¾­Íè»ÈÍѤ¹¤ë¤¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¤Î¤Ç¡¢ +.\" 0 ¤ËÀßÄꤷ¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£\fR¡×¤È½ñ¤«¤ì¤Æ¤¤¤ë¡£ +Äê¿ô +.B MCLoadBySet +¤È +.B MCLoadAll +¤ËÂбþ¤¹¤ë¥½¡¼¥¹¤¬²¿¤Ç¤¢¤ë¤Î¤«¤¬¤Ï¤Ã¤­¤ê¤·¤Æ¤¤¤Ê¤¤ (²¼µ­»²¾È)¡£ +.SH Ãí°Õ +°Ê¾å¤Ï POSIX.1-2001 ¤Ë¤ª¤±¤ëÀâÌÀ¤Ç¤¢¤ë¡£ +glibc ¤Ç¤Ï +.B NL_CAT_LOCALE +¤ÎÃÍ¤Ï 1 ¤Ç¤¢¤ë +(°Ê²¼¤Î +.B MCLoadAll +¤ÈÈæ³Ó¤Î¤³¤È)¡£ +¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¤Ï¾ì¹ç¤Ë¤è¤Ã¤ÆÍÍ¡¹¤Ç¤¢¤ë¤¬¡¢Ä̾ï¤Ï +.I /usr/share/locale +°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤¬Ä´¤Ù¤é¤ì¤ë¡£ +.SS Linux ¤Ë¤ª¤±¤ëÃí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤Ï libc.so.4.4.4c °Ê¹ß¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +linux ¤Î libc4 ¤È libc5 ¤Ë¤ª¤¤¤Æ¤Ï¡¢¥«¥¿¥í¥°¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I nl_catd +¤Ï +.BR mmap (2) +¤µ¤ì¤¿¥á¥â¥ê¤ÎÎΰè¤Ç¤¢¤Ã¤Æ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.BR catopen () +¤Î +.I flag +¤Ï¡¢ +.B MCLoadBySet +(=0) ¤« +.B MCLoadAll +(=1) ¤Î¤É¤Á¤é¤«¤Ç¤¢¤ë¡£ +Á°¼Ô¤Î¾ì¹ç¡¢¥«¥¿¥í¥°¤Î¥»¥Ã¥È¤ÏɬÍ×»þ¤Ë¥í¡¼¥É¤µ¤ì¤ë¡£ +¸å¼Ô¤Î¾ì¹ç¡¢ºÇ½é¤Î +.BR catopen () +¤Î¸Æ¤Ó½Ð¤·¤Î¤È¤­¤ËÁ´¤Æ¤Î¥«¥¿¥í¥°¤¬¥á¥â¥êÆâ¤Ë¥í¡¼¥É¤µ¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¤Ï¾ì¹ç¤Ë¤è¤Ã¤ÆÍÍ¡¹¤Ç¤¢¤ë¤¬¡¢Ä̾ï¤Ï +.I /etc/locale +¤È +.I /usr/share/locale +°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤¬Ä´¤Ù¤é¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR catgets (3), +.BR setlocale (3) diff --git a/release/man3/cbrt.3 b/release/man3/cbrt.3 new file mode 100644 index 00000000..52a35c83 --- /dev/null +++ b/release/man3/cbrt.3 @@ -0,0 +1,95 @@ +.\" Copyright 1995 Jim Van Zandt +.\" +.\" 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. +.\" +.\" changed `square root' into `cube root' - aeb, 950919 +.\" +.\" 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 ¤Ë¤è¤ë³ÈÄ¥ +.\" +.TH CBRT 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +cbrt, cbrtf, cbrtl \- ΩÊýº¬¤ò·×»»¤¹¤ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double cbrt(double " x ); +.br +.BI "float cbrtf(float " x ); +.br +.BI "long double cbrtl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR cbrt (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR cbrtf (), +.BR cbrtl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR cbrt () +´Ø¿ô¤Ï \fIx\fP ¤Î (¼Â¿ô)ΩÊýº¬¤òÊÖ¤¹¡£ +¤³¤Î´Ø¿ô¤¬¼ºÇÔ¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢ +¤¹¤Ù¤Æ¤ÎÆâÉôɽ¸½²Äǽ¤Ê (representable) ¼Â¿ô¤Ï +ɬ¤ºÆâÉôɽ¸½²Äǽ¤ÊΩÊýº¬¤ò»ý¤Ä¤¿¤á¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎΩÊýº¬¤òÊÖ¤¹¡£ + +.I x +¤¬ +0¡¢-0¡¢Àµ¤Î̵¸ÂÂç¡¢Éé¤Î̵¸ÂÂç¡¢NaN ¤Î¤¤¤º¤ì¤«¤Î¾ì¹ç¡¢ +.I x +¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.SH ½àµò +C99, POSIX.1-2001. +.\" .BR cbrt () +.\" ¤Ï°ÊÁ°¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤Ã¤¿¡£ +.\" ¸½ºß¤Ï C99 ¤Çɬ¿Ü¤Î´Ø¿ô¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR pow (3), +.BR sqrt (3) diff --git a/release/man3/ccos.3 b/release/man3/ccos.3 new file mode 100644 index 00000000..d38bfbf5 --- /dev/null +++ b/release/man3/ccos.3 @@ -0,0 +1,40 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Wed Jul 23 05:24:15 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: sine Àµ¸¹ +.\"WORD: cosine ;¸¹ +.\"WORD: tangent ÀµÀÜ +.\" +.TH CCOS 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +ccos, ccosf, ccosl \- Ê£ÁÇ¿ô¤Î;¸¹ (cosine) +.SH ½ñ¼° +.B #include +.sp +.BI "double complex ccos(double complex " z ");" +.br +.BI "float complex ccosf(float complex " z ");" +.br +.BI "long double complex ccosl(long double complex " z ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +Ê£ÁÇ¿ô¤Î;¸¹ (cosine) ´Ø¿ô ccos(z) ¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.nf + + ccos(z) = (exp(i * z) + exp(\-i * z)) / 2 +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR csin (3), +.BR ctan (3), +.BR complex (7) diff --git a/release/man3/ccosh.3 b/release/man3/ccosh.3 new file mode 100644 index 00000000..c633cd9d --- /dev/null +++ b/release/man3/ccosh.3 @@ -0,0 +1,42 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Mon Jul 28 23:42:41 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: hyperbolic ÁжÊ(Àþ¤Î) +.\"WORD: sine Àµ¸¹ +.\"WORD: cosine ;¸¹ +.\"WORD: tangent ÀµÀÜ +.\" +.TH CCOSH 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +ccosh, ccoshf, ccoshl \- Ê£ÁÇ¿ô¤ÎÁжÊÀþ;¸¹ (hyperbolic cosine) +.SH ½ñ¼° +.B #include +.sp +.BI "double complex ccosh(double complex " z ");" +.br +.BI "float complex ccoshf(float complex " z ");" +.br +.BI "long double complex ccoshl(long double complex " z ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +Ê£ÁÇ¿ô¤ÎÁжÊÀþ;¸¹ (hyperbolic cosine) ´Ø¿ô ccosh(z) ¤Ï +°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.nf + + ccosh(z) = (exp(z)+exp(\-z))/2 +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR csinh (3), +.BR ctanh (3), +.BR complex (7) diff --git a/release/man3/ceil.3 b/release/man3/ceil.3 new file mode 100644 index 00000000..b624a77d --- /dev/null +++ b/release/man3/ceil.3 @@ -0,0 +1,119 @@ +.\" Copyright 2001 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. +.\" +.\" 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 ²¾¿ô +.\" +.TH CEIL 3 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +ceil, ceilf, ceill \- °ú¤­¿ô¤ò²¼²ó¤é¤Ê¤¤ºÇ¾®¤ÎÀ°¿ôÃÍ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double ceil(double " x ); +.br +.BI "float ceilf(float " x ); +.br +.BI "long double ceill(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR ceilf (), +.BR ceill (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï \fIx\fP ¤è¤ê¾®¤µ¤¯¤Ê¤¤ºÇ¾®¤ÎÀ°¿ôÃͤòÊÖ¤¹¡£ + +Î㤨¤Ð¡¢ +.I ceil(0.5) +¤Ï 1.0 ¤Ç¤¢¤ê¡¢ +.I ceil(\-0.5) +¤Ï 0.0 ¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ò²¼²ó¤é¤Ê¤¤À°¿ôÃͤòÊÖ¤¹¡£ + +\fIx\fP ¤¬À°¿ô¡¢+0¡¢\-0¡¢NaN¡¢Ìµ¸Â¤Î¤¤¤º¤ì¤«¤Î¾ì¹ç¡¢ +\fIx\fP ¤½¤Î¤â¤Î¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ËÂФ·¤ÆÈÏ°Ï¥¨¥é¡¼¤¬µ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +SUSv2 ¤È POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ë´Ø¤¹¤ëµ­½Ò¤¬¤¢¤ê¡¢ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ÎºÝ¤Ë¤Ï +.I errno +¤ò +.B ERANGE +¤ËÀßÄꤹ¤ë¤« +.B FE_OVERFLOW +Îã³°¤òµ¯¤³¤¹¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +¼ÂºÝ¤Î¤È¤³¤í¡¢¤É¤Î¸½¹Ô¤Î¥Þ¥·¥ó¤Ç¤â·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤¹¤³¤È¤Ï +¤Ê¤¤¤Î¤Ç¡¢¤³¤Î¥¨¥é¡¼½èÍý¤Ï°ÕÌ£¤¬¤Ê¤¤¡£ +.\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point. +(¤è¤êÀµ³Î¤Ë¸À¤¦¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ï»Ø¿ôÉô¤ÎºÇÂçÃͤ¬ +²¾¿ôÉô¤òɽ¤¹¥Ó¥Ã¥È¤Î¿ô¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ë¤·¤«µ¯¤³¤é¤Ê¤¤¡£ +IEEE-754 µ¬³Ê¤Î 32 ¥Ó¥Ã¥È¤È 64 ¥Ó¥Ã¥È¤ÎÉâÆ°¾®¿ô¤Ç¤Ï¡¢ +»Ø¿ôÉô¤ÎºÇÂçÃͤϤ½¤ì¤¾¤ì 128 ¤È 1024 ¤Ç¤¢¤ê¡¢ +²¾¿ôÉô¤Î¥Ó¥Ã¥È¿ô¤Ï¤½¤ì¤¾¤ì 24 ¤È 53 ¤Ç¤¢¤ë¡£) + +¤³¤ì¤é¤Î´Ø¿ô¤¬ÊÖ¤¹À°¿ôÃͤÏÀ°¿ô·¿ +.RI ( int , +.I long +¤Ê¤É) ¤Ë³ÊǼ¤¹¤ë¤Ë¤ÏÂ礭²á¤®¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Î·ë²Ì¤Ïʬ¤«¤é¤Ê¤¤¤Î¤Ç¡¢ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òÈò¤±¤ë¤¿¤á¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤ÏÀ°¿ô·¿¤ËÂåÆþ¤¹¤ëÁ°¤Ë +ÊÖ¤µ¤ì¤¿ÃͤÎÈϰϳÎǧ¤ò¼Â¹Ô¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR floor (3), +.BR lrint (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3), +.BR trunc (3) diff --git a/release/man3/cerf.3 b/release/man3/cerf.3 new file mode 100644 index 00000000..3ae513a4 --- /dev/null +++ b/release/man3/cerf.3 @@ -0,0 +1,47 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-24, Akihiro MOTOKI +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" +.\"WORD: error function ¸íº¹´Ø¿ô +.\" +.TH CERF 3 2007-12-26 "" "Linux Programmer's Manual" +.SH ̾Á° +cerf, cerff, cerfl, cerfc, cerfcf, cerfcl \- Ê£ÁÇ¿ô¤Î¸íº¹´Ø¿ô +.SH ½ñ¼° +.B #include +.sp +.BI "double complex cerf(double complex " z ); +.br +.BI "float complex cerff(float complex " z ); +.br +.BI "long double complex cerfl(long double complex " z ); +.sp +.BI "double complex cerfc(double complex " z ); +.br +.BI "float complex cerfcf(float complex " z ); +.br +.BI "long double complex cerfcl(long double complex " z ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR cerf () +´Ø¿ô¤Ï¸íº¹´Ø¿ô¤ÎÊ£ÁÇ¿ôÈǤǤ¢¤ê¡¢ +.TP +erf(z) = 2/sqrt(pi) * exp(\-t*t) dt ¤Î 0 ¤«¤é z ¤Þ¤Ç¤ÎÀÑʬ +.PP +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.BR cerfc () +´Ø¿ô¤ÎÄêµÁ¤Ï cerfc(z) = 1-cerf(z) ¤Ç¤¢¤ë¡£ +.\" 1/sqrt(2*pi) ¤Î¥Á¥§¥Ã¥¯¤ò¤·¤Ê¤¯¤Æ¤â¤¤¤¤¤Î¡© +.SH ½àµò +´Ø¿ô̾¤Ï C99 ¤Çº£¸å»ÈÍѤ¹¤ë¤¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.SH ²ÄÍÑÀ­ +¥Ð¡¼¥¸¥ç¥ó 2.8 »þÅÀ¤Ç¤Ï¡¢glibc ¤Ë¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" ¤·¤«¤·¡¢Ì¾Á°¶õ´Ö¤ÏͽÌóºÑ¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR erf (3), +.BR complex (7) diff --git a/release/man3/cexp.3 b/release/man3/cexp.3 new file mode 100644 index 00000000..5a6a14ec --- /dev/null +++ b/release/man3/cexp.3 @@ -0,0 +1,42 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 02:05:20 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: exponential »Ø¿ô +.\"WORD: natural logarithm ¼«Á³Âпô +.\"WORD: base Äì +.\" +.TH CEXP 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +cexp, cexpf, cexpl \- Ê£ÁÇ¿ô¤Î»Ø¿ô´Ø¿ô +.SH ½ñ¼° +.B #include +.sp +.BI "double complex cexp(double complex " z ");" +.br +.BI "float complex cexpf(float complex " z ");" +.br +.BI "long double complex cexpl(long double complex " z ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤Ï e (2.71828..., ¼«Á³Âпô¤ÎÄì) ¤Î \fIz\fR ¾è¤ò·×»»¤¹¤ë¡£ +.LP +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + cexp(I * z) = ccos(z) + I * csin(z) +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR clog (3), +.BR cpow (3), +.BR complex (7) diff --git a/release/man3/cexp2.3 b/release/man3/cexp2.3 new file mode 100644 index 00000000..3fb007e3 --- /dev/null +++ b/release/man3/cexp2.3 @@ -0,0 +1,35 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-24, Akihiro MOTOKI +.\" Updated 2005-02-24, Akihiro MOTOKI +.\" +.\"WORD: exponent Îß¾è +.\" +.TH CEXP2 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +cexp2, cexp2f, cexp2l \- Ê£ÁÇ¿ô¤Î 2 ¤ÎÎß¾è +.SH ½ñ¼° +.B #include +.sp +.BI "double complex cexp2(double complex " z ");" +.br +.BI "float complex cexp2f(float complex " z ");" +.br +.BI "long double complex cexp2l(long double complex " z ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤Ï 2 ¤Î \fIz\fR ¾è¤òÊÖ¤¹¡£ +.SH ½àµò +´Ø¿ô̾¤Ï C99 ¤Çº£¸å»ÈÍѤ¹¤ë¤¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.SH ²ÄÍÑÀ­ +¥Ð¡¼¥¸¥ç¥ó 2.8 »þÅÀ¤Ç¤Ï¡¢glibc ¤Ë¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" ¤·¤«¤·¡¢Ì¾Á°¶õ´Ö¤ÏͽÌóºÑ¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR cexp (3), +.BR clog10 (3), +.BR complex (7) diff --git a/release/man3/cfree.3 b/release/man3/cfree.3 new file mode 100644 index 00000000..1eb583d3 --- /dev/null +++ b/release/man3/cfree.3 @@ -0,0 +1,130 @@ +.\" 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 19 04:38:03 JST 2004 +.\" by Yuichi SATO +.\" +.TH CFREE 3 2007-07-26 "" "Linux Programmer's Manual" +.SH ̾Á° +cfree \- ³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë +.SH ½ñ¼° +.nf +.sp +.B "#include " +.sp +/* SunOS 4 ¤Ç¤Ï */ +.BI "int cfree(void *" ptr ); +.sp +/* glibc ¤È FreeBSD libcompat ¤Ç¤Ï */ +.BI "void cfree(void *" ptr ); +.sp +/* SCO OpenServer ¤Ç¤Ï */ +.BI "void cfree(char *" ptr ", unsigned " num ", unsigned " size ); +.sp +/* Solaris watchmalloc.so.1 ¤Ç¤Ï */ +.BI "void cfree(void *" ptr ", size_t " nelem ", size_t " elsize ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR cfree (): +_BSD_SOURCE || _SVID_SOURCE +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤Ï·è¤·¤Æ»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë +.BR free (3) +¤ò»È¤¦¤³¤È¡£ +.SS "°ú¤­¿ô¤¬ 1 ¤Ä¤Î cfree" +glibc ¤Ç¤Ï¡¢´Ø¿ô +.BR cfree () +¤Ï +.BR free (3) +¤ÎÊÌ̾¤Ç¤¢¤ê¡¢¡ÖSunOS ¤È¤Î¸ß´¹À­¤Î¤¿¤á¤ËÄɲ䵤줿¡×¡£ +.LP +¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î̾Á°¤ÎÊ̤δؿô¤¬¤¢¤ë¡£ +¤³¤ÎÀë¸À¤Ï +.I +¤Ë¸ºß¤¹¤ë¾ì¹ç¤â¤¢¤ë¤·¡¢ +.I +¤Ë¸ºß¤¹¤ë¾ì¹ç¤â¤¢¤ë¡£ +.SS "°ú¤­¿ô¤¬ 3 ¤Ä¤Î cfree" +SCO ¤È Solaris ¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ +°ú¤­¿ô¤¬ 3 ¤Ä¤Î +.BR cfree () +¤¬´Þ¤Þ¤ì¤ë malloc ¥é¥¤¥Ö¥é¥ê¤¬¤¢¤ë¡£ +¤³¤ì¤ÏÌÀ¤é¤«¤Ë +.BR calloc (3) +¤ËÎà»÷¤·¤Æ¤¤¤ë¡£ +.LP +²¿¤«¤ò°Ü¿¢¤¹¤ë»þ¤Ë¤³¤Î´Ø¿ô¤¬É¬Íפʾì¹ç¡¢ +.sp +.in +4n +#define cfree(p, n, s) free((p)) +.in +.sp +¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤뤳¤È¡£ +.LP +¤è¤¯¿Ò¤Í¤é¤ì¤ë¼ÁÌä¤Ï +.RB ¡Ö calloc (3) +¤Ç³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë¤Î¤Ë +.BR free (3) +¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¤«¡¢ +¤½¤ì¤È¤â +.BR cfree () +¤ò»È¤¦É¬Íפ¬¤¢¤ë¤«¡×¤È¤¤¤¦¤â¤Î¤Ç¤¢¤ë¡£ +Åú¤¨: +.BR free (3) +¤ò»È¤¦¤³¤È¡£ +.LP +SCO ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë: +¡Öcfree ¥ë¡¼¥Á¥ó¤Ï iBCSe2 µ¬³Ê¤Ë½¾¤¦¤¿¤á¤ËÄ󶡤µ¤ì¤Æ¤ª¤ê¡¢ +ñ¤Ë free ¤ò¸Æ¤ó¤Ç¤¤¤ë¤À¤±¤Ç¤¢¤ë¡£ +cfree ¤Î num ¤È size °ú¤­¿ô¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£¡× +.SH ÊÖ¤êÃÍ +SunOS ÈǤΠ+.BR cfree () +.RB ( free (3) +¤ÎÊÌ̾) ¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ë 1 ¤òÊÖ¤·¡¢¼ºÇÔ¤·¤¿¾ì¹ç¤Ë 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.I errno +¤¬ +.B EINVAL +¤ËÀßÄꤵ¤ì¤ë: +.I ptr +¤ÎÃͤ¬ +.BR malloc () +·Ï¤Î¥ë¡¼¥Á¥ó¤Î 1 ¤Ä¤Ç°ÊÁ°¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ +¥Ö¥í¥Ã¥¯¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¤¡£ +.SH ½àµò +SCO ¤ÇÍѤ¤¤é¤ì¤Æ¤¤¤ë°ú¤­¿ô¤¬ 3 ¤Ä¤Î +.BR cfree () +¤Ï¡¢iBCSe2 µ¬³Ê: +Intel386 Binary Compatibility Specification, Edition 2 +(Intel386 ¥Ð¥¤¥Ê¥ê¸ß´¹»ÅÍÍ¡¢Âè 2 ÈÇ) ¤Ë½àµò¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR malloc (3) diff --git a/release/man3/cimag.3 b/release/man3/cimag.3 new file mode 100644 index 00000000..830feafd --- /dev/null +++ b/release/man3/cimag.3 @@ -0,0 +1,46 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 01:37:31 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CIMAG 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +cimag, cimagf, cimagl \- Ê£ÁÇ¿ô¤ÎµõÉô¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "double cimag(double complex " z ");" +.br +.BI "float cimagf(float complex " z ");" +.br +.BI "long double cimagl(long double complex " z ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR cimag () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤ÎµõÉô¤òÊÖ¤¹¡£ +.LP +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + z = creal(z) + I * cimag(z) +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +gcc ¤Ç¤Ï __imag__ ¤ò»È¤¦¤³¤È¤â¤Ç¤­¤ë¤¬¡¢ +¤³¤ì¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR creal (3), +.BR complex (7) diff --git a/release/man3/clearenv.3 b/release/man3/clearenv.3 new file mode 100644 index 00000000..0daab8b3 --- /dev/null +++ b/release/man3/clearenv.3 @@ -0,0 +1,107 @@ +.\" Copyright 2001 John Levon +.\" +.\" 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, 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 +.\" +.TH CLEARENV 3 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +clearenv \- ´Ä¶­ (environment) ¤ò¥¯¥ê¥¢¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.B "int clearenv(void);" +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR clearenv (): +_SVID_SOURCE || _XOPEN_SOURCE +.SH ÀâÌÀ +.BR clearenv () +´Ø¿ô¤Ï¡¢Ì¾Á°¤ÈÃͤ¬ÁȤˤʤä¿Á´¤Æ¤Î´Ä¶­¤ò¥¯¥ê¥¢¤¹¤ë¡£ +¤µ¤é¤Ë³°ÉôÊÑ¿ô +.I environ +¤ÎÃͤò NULL ¤Ë¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR clearenv () +´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤·¡¢ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 °Ê³°¤òÊÖ¤¹¡£ +.\" Unix ·Ï OS ¤Î¿¤¯¤Ï¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë \-1 ¤òÊÖ¤¹¡£ +.\" ¤â¤·¤¯¤Ï¥¨¥é¡¼¤Î¾ì¹ç¤Ç¤â²¿¤âÊÖ¤µ¤Ê¤¤¡£ +.\" glibc ¤Î info ¤È Watcom C ¥é¥¤¥Ö¥é¥ê¤Ë¤Ï¡¢ +.\" ¡Ö0 °Ê³°¤ÎÃÍ (¤òÊÖ¤¹)¡×¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +libc4, libc5 ¤Ç¤Ï»ÈÍѤǤ­¤Ê¤¤¡£ +glibc 2.0 °Ê¹ß¤Î glibc ¤Ç»ÈÍѤǤ­¤ë¡£ +.SH ½àµò +(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 () +¤ÎÄɲäÏÈݷ褵¤ì¤¿¡£ +.SH Ãí°Õ +¤³¤Î´Ø¿ô¤Ï¥»¥­¥å¥ê¥Æ¥£¤Ë¹Íθ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç»È¤ï¤ì¤ë¡£ +¤³¤Î´Ø¿ô¤¬»ÈÍѤǤ­¤Ê¤¤¾ì¹ç¤Ï¡¢ +.nf + + environ = NULL; + +.fi +¤È¤¤¤¦¤è¤¦¤ËÊÑ¿ô environ ¤òÀßÄꤹ¤ì¤Ð¤è¤¤¡£ +.LP +DG/UX ¤È Tru64 man ¥Ú¡¼¥¸¤Ë¤Ï¼¡¤Î¤è¤¦¤Ëµ­¤µ¤ì¤Æ¤¤¤ë¡§ +.I environ +¤¬ +.BR putenv (3), +.BR getenv (3), +.BR clearenv () +´Ø¿ô°Ê³°¤ÇÊѹ¹¤µ¤ì¤¿¾ì¹ç¡¢ +.BR clearenv () +¤Ï¥¨¥é¡¼¤òÊÖ¤·¡¢¥×¥í¥»¥¹´Ä¶­¤ÏÊѹ¹Á°¤Î¤Þ¤Þ¤Ë¤µ¤ì¤ë¡£ +.\" .LP +.\" HP-UX ¤Ë¤Ï ENOMEM ¥¨¥é¡¼¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getenv (3), +.BR putenv (3), +.BR setenv (3), +.BR unsetenv (3), +.BR environ (7) diff --git a/release/man3/clock.3 b/release/man3/clock.3 new file mode 100644 index 00000000..f28102d9 --- /dev/null +++ b/release/man3/clock.3 @@ -0,0 +1,97 @@ +.\" 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 21:27:01 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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. +.\" Tranlated 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 +.\" +.\"WORD: processor time ¥×¥í¥»¥Ã¥µ»þ´Ö +.\"WORD: CPU time CPU»þ´Ö +.\" +.TH CLOCK 3 2008-08-28 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +clock \- ¥×¥í¥»¥Ã¥µ»þ´Ö¤Î¼èÆÀ +.SH ½ñ¼° +.nf +.B #include +.sp +.B clock_t clock(void); +.fi +.SH ÀâÌÀ +.BR clock () +¤Ï¥×¥í¥°¥é¥à¤Î»ÈÍѤ·¤¿¥×¥í¥»¥Ã¥µ»þ´Ö¤Î¶á»÷ÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +ÊÖ¤êÃÍ¤Ï +.I clock_t +ñ°Ì¤Ç¤Î CPU »þ´Ö¤Ç¤¢¤ë¡£ +ÉÃñ°Ì¤Ç¤ÎÃͤòÆÀ¤ë¤¿¤á¤Ë¤Ï +.B CLOCKS_PER_SEC +¤Ç³ä¤ì¤Ð¤è¤¤¡£ +»ÈÍѤ·¤¿¥×¥í¥»¥Ã¥µ»þ´Ö¤¬ÆÀ¤é¤ì¤Ê¤¤¾ì¹ç¤ä¡¢¤½¤ÎÃͤòɽ¸½¤Ç¤­¤Ê¤¤¾ì¹ç¡¢ +¤³¤Î´Ø¿ô¤Ï +.I (clock_t)\ \-1 +¤òÊÖ¤¹¡£ +.SH ½àµò +C89, C99, POSIX.1-2001. +POSIX ¤Ï¼ÂºÝ¤ÎÀºÅ٤ˤϤè¤é¤º +.B CLOCKS_PER_SEC +¤¬ 1000000 ¤Ç¤¢¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +C ¤Îɸ½àµ¬³Ê¤Ç¤Ï¥×¥í¥°¥é¥à¤Î³«»Ï¤Î»þÅÀ¤Ç¤Ï¤É¤ó¤ÊÃͤ¬Ê֤äƤ­¤Æ¤â +¤«¤Þ¤ï¤Ê¤¤¡£ +°Ü¿¢À­¤òºÇÂç¸Â³ÎÊݤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥×¥í¥°¥é¥à¤Î³«»Ï»þ¤Ë +.BR clock () +¤ò¸Æ¤Ó½Ð¤·¤Æ¤½¤ÎÃͤòº¹¤·°ú¤¯¤³¤È¡£ +.PP +»þ¹ï¤Ï·å¤¢¤Õ¤ì¤¹¤ë²ÄǽÀ­¤¬¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.B CLOCKS_PER_SEC +¤¬ 1000000 ¤Ç¤¢¤ë 32 ¥Ó¥Ã¥È¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +¤³¤Î´Ø¿ô¤ÏÌó 72 ʬËè¤ËƱ¤¸ÃͤòÊÖ¤¹¤³¤È¤Ë¤Ê¤ë¡£ +.PP +¼ÂÁõ¤Ë¤è¤Ã¤Æ¤Ï¡¢ +.BR clock () +¤ÇÊÖ¤µ¤ì¤ëÃÍ¤Ë +.BR wait (2) +(¤¢¤ë¤¤¤Ï¤½¤Î¾¤Î wait ¤Î¤è¤¦¤Ê´Ø¿ô) ¤Ç¼ý½¸¤µ¤ì¤¿ +»Ò¥×¥í¥»¥¹¤Î»þ´Ö¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¤â¤¢¤ë¡£ +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 +.BR times (2) +´Ø¿ô¤Ï¸Æ¤Ó½Ð¤·¸µ¤È¤½¤Î»Ò¥×¥í¥»¥¹¤Ë´Ø¤¹¤ë¾ðÊó¤ò +(ÊÌ¡¹¤Ë) ÌÀ¼¨Åª¤ËÊÖ¤¹¤Î¤Ç¡¢¤è¤ê¹¥¤Þ¤·¤¤¤À¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR clock_gettime (2), +.BR getrusage (2), +.BR times (2) diff --git a/release/man3/clog.3 b/release/man3/clog.3 new file mode 100644 index 00000000..0c307875 --- /dev/null +++ b/release/man3/clog.3 @@ -0,0 +1,54 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 01:47:42 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: natural logarithm ¼«Á³Âпô +.\"WORD: logarithm Âпô +.\"WORD: exponential »Ø¿ô +.\"WORD: inverse function µÕ´Ø¿ô +.\" +.TH CLOG 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +clog, clogf, clogl \- Ê£ÁÇ¿ô¤Î¼«Á³Âпô +.SH ½ñ¼° +.B #include +.sp +.BI "double complex clog(double complex " z ); +.br +.BI "float complex clogf(float complex " z ); +.br +.BI "long double complex clogl(long double complex " z ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +Âпô +.BR clog () +¤Ï»Ø¿ô´Ø¿ô +.BR cexp () +¤ÎµÕ´Ø¿ô¤Ç¤¢¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢ \fIy = clog(z)\fP ¤Ê¤é¤Ð¡¢ \fIz = cexp(y)\fP ¤¬À®Î©¤¹¤ë¡£ +.I y +¤Îµõ¿ôÉô¤ÎÃͤ϶è´Ö [\-pi,pi] ¤«¤éÁªÂò¤µ¤ì¤ë¡£ +.LP +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + clog(z) = log(cabs(z)) + I * carg(z) +.fi +.LP +.I z +¤È¤·¤Æ 0 ¤Ë¶á¤¤ÃͤòÆþ¤ì¤ë¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤¹¤¿¤á¡¢ +Ãí°Õ¤¬É¬ÍפǤ¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR cexp (3), +.BR clog10 (3), +.BR complex (7) diff --git a/release/man3/clog10.3 b/release/man3/clog10.3 new file mode 100644 index 00000000..0fa2e05d --- /dev/null +++ b/release/man3/clog10.3 @@ -0,0 +1,53 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-24, Akihiro MOTOKI +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" Updated 2007-01-05, Akihiro MOTOKI, catch up to LDP v2.43 +.\" +.\"WORD: logarithm Âпô +.\"WORD: base Äì +.\" +.TH CLOG10 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +clog10, clog10f, clog10l \- Ä줬 10 ¤ÎÊ£ÁÇ¿ô¤ÎÂпô +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "double complex clog10(double complex " z ); +.br +.BI "float complex clog10f(float complex " z ); +.br +.BI "long double complex clog10l(long double complex " z ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.I clog10(z) +¤Î¸Æ¤Ó½Ð¤·¤Ï +.I clog(z)/log(10) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +¾¤Î´Ø¿ô¤ÏƱ¤¸µ¡Ç½¤ò»ý¤Ä +.I float +ÈÇ¤È +.I "long double" +ÈǤǤ¢¤ë¡£ + +.I z +¤È¤·¤Æ 0 ¤Ë¶á¤¤ÃͤòÆþ¤ì¤ë¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤¹¤¿¤á¡¢ +Ãí°Õ¤¬É¬ÍפǤ¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +C99 ¤Ç¤Ïº£¸å¤Î¤¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR cexp (3), +.BR clog (3), +.BR clog2 (3), +.BR complex (7), +.BR feature_test_macros (7) diff --git a/release/man3/clog2.3 b/release/man3/clog2.3 new file mode 100644 index 00000000..a76537be --- /dev/null +++ b/release/man3/clog2.3 @@ -0,0 +1,51 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-24, Akihiro MOTOKI +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" Updated 2007-01-05, Akihiro MOTOKI, catch up to LDP v2.43 +.\" +.\"WORD: logarithm ¼«Á³Âпô +.\"WORD: base Äì +.\" +.TH CLOG2 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +clog2, clog2f, clog2l \- Ä줬 2 ¤ÎÊ£ÁÇ¿ô¤ÎÂпô +.SH ½ñ¼° +.B #include +.sp +.BI "double complex clog2(double complex " z ); +.br +.BI "float complex clog2f(float complex " z ); +.br +.BI "long double complex clog2l(long double complex " z ); +.\" .sp +.\" \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.I clog2(z) +¤Î¸Æ¤Ó½Ð¤·¤Ï +.I clog(z)/log(2) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ + +¾¤Î´Ø¿ô¤ÏƱ¤¸µ¡Ç½¤ò»ý¤Ä +.I float +ÈÇ¤È +.I "long double" +ÈǤǤ¢¤ë¡£ + +.I z +¤È¤·¤Æ 0 ¤Ë¶á¤¤ÃͤòÆþ¤ì¤ë¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤¹¤¿¤á¡¢ +Ãí°Õ¤¬É¬ÍפǤ¢¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô̾¤Ï C99 ¤Çº£¸å»ÈÍѤ¹¤ë¤¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.SH ²ÄÍÑÀ­ +¥Ð¡¼¥¸¥ç¥ó 2.8 »þÅÀ¤Ç¤Ï¡¢glibc ¤Ë¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" ¤·¤«¤·¡¢Ì¾Á°¶õ´Ö¤ÏͽÌóºÑ¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR cexp (3), +.BR clog (3), +.BR clog10 (3), +.BR complex (7) diff --git a/release/man3/closedir.3 b/release/man3/closedir.3 new file mode 100644 index 00000000..e82e1284 --- /dev/null +++ b/release/man3/closedir.3 @@ -0,0 +1,80 @@ +.\" Copyright (C) 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 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 +.\" +.\"WORD: directory stream descriptor ¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\" +.TH CLOSEDIR 3 2008-09-23 "" "Linux Programmer's Manual" +.SH ̾Á° +closedir \- ¥Ç¥£¥ì¥¯¥È¥ê¤ò¥¯¥í¡¼¥º¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.B #include +.sp +.BI "int closedir(DIR *" dirp ); +.fi +.SH ÀâÌÀ +.BR closedir () +´Ø¿ô¤Ï \fIdirp\fP ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.BR closedir () +¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤È¡¢ +.I dirp +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤â¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +(directory stream descriptor) \fIdirp\fP ¤Ï¡¢ +¤³¤Î¸Æ¤Ó½Ð¤·¤Î¸å¤Ç¤Ï»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR closedir () +´Ø¿ô¤ÏÀ®¸ù»þ¤Ë 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ \fIdirp\fP ¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.SH ½àµò +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) diff --git a/release/man3/cmsg.3 b/release/man3/cmsg.3 new file mode 100644 index 00000000..410eeb2a --- /dev/null +++ b/release/man3/cmsg.3 @@ -0,0 +1,226 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: cmsg.3,v 1.3 2001/01/14 05:30:39 hanataka Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito +.\" all rights reserved. +.\" Translated Mon Jul 26 21:58:26 JST 1999 +.\" by Shouichi Saito +.\" Proofed Tue Aug 17 1999 by NAKANO Takeo +.\" +.TH CMSG 3 2008-11-20 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +CMSG_ALIGN, CMSG_SPACE, CMSG_NXTHDR, CMSG_FIRSTHDR \- Êä½õ¥Ç¡¼¥¿¤Ë¥¢¥¯¥»¥¹¤¹¤ë¡£ +.SH ½ñ¼° +.B #include +.sp +.BI "struct cmsghdr *CMSG_FIRSTHDR(struct msghdr *" msgh ); +.br +.BI "struct cmsghdr *CMSG_NXTHDR(struct msghdr *" msgh ", struct cmsghdr *" cmsg ); +.br +.BI "size_t CMSG_ALIGN(size_t " length ); +.br +.BI "size_t CMSG_SPACE(size_t " length ); +.br +.BI "size_t CMSG_LEN(size_t " length ); +.br +.BI "unsigned char *CMSG_DATA(struct cmsghdr *" cmsg ); +.sp +.nf +struct cmsghdr { + socklen_t cmsg_len; /* data byte count, including header */ + int cmsg_level; /* originating protocol */ + int cmsg_type; /* protocol-specific type */ + /* followed by unsigned char cmsg_data[]; */ +}; +.fi +.SH ÀâÌÀ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤ÏÀ©¸æ¥á¥Ã¥»¡¼¥¸ +(Êä½õ¥Ç¡¼¥¿ (ancillary data) ¤È¤â¸Æ¤Ð¤ì¤ë) ¤òºî¤ê¡¢ +¤½¤ì¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +À©¸æ¥á¥Ã¥»¡¼¥¸¤Ï¥½¥±¥Ã¥È¤Ë¤Î¤ë¥Ç¡¼¥¿¤Ç¤Ï¤Ê¤¤¡£ +¤³¤ÎÀ©¸æ¾ðÊó¤Ï¡¢ÅþÃ夷¤¿¥Ñ¥±¥Ã¥È¤Ø¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¡¢ÍÍ¡¹¤Ê¤¢¤Þ¤ê +»È¤ï¤ì¤Ê¤¤¥Ø¥Ã¥À¡¼¥Õ¥£¡¼¥ë¥É¡¢¥¨¥é¡¼µ­½Ò¤Î³ÈÄ¥¡¢¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê +¥×¥¿¤Î½¸¹ç¤ä¡¢Unix¤Ë¤ª¤±¤ë¿®Íê¾ðÊó (credential) ¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +À©¸æ¥á¥Ã¥»¡¼¥¸¤Ï¡¢Î㤨¤Ð IP ¥ª¥×¥·¥ç¥ó¤Î¤è¤¦¤ÊÄɲåإåÀ¡¼¥Õ¥£¡¼¥ë¥É¤ò +Á÷¤ë¤Î¤Ë»È¤¦»ö¤¬¤Ç¤­¤ë¡£ +Êä½õ¥Ç¡¼¥¿¤Ï¡¢ +.BR sendmsg (2) +¤ò¸Æ¤Ó½Ð¤·¤ÆÁ÷¤ê¡¢ +.BR recvmsg (2) +¤ò¸Æ¤Ó½Ð¤·¤Æ¼õ¤±¼è¤ë¡£ +¾ÜºÙ¤Ï¤½¤ì¤é¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¡£ +.PP +Êä½õ¥Ç¡¼¥¿¤Ï +.I struct cmsghdr +¹½Â¤ÂΤΥ·¡¼¥±¥ó¥¹¤ËÄɲåǡ¼¥¿¤¬Éղ䵤줿¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥·¡¼¥±¥ó¥¹¤Ë¤Ï¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë½ñ¤«¤ì¤Æ¤¤¤ë +¥Þ¥¯¥í¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤¹¤Ù¤­¤Ç¡¢Ä¾ÀÜ¥¢¥¯¥»¥¹¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +»ÈÍѲÄǽ¤ÊÀ©¸æ¥á¥Ã¥»¡¼¥¸¤Î¥¿¥¤¥×¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +¤½¤ì¤¾¤ì¤Î¥×¥í¥È¥³¥ë¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤Î¤³¤È¡£ +ÀܳËè¤ÎºÇÂçÊä½õÍѥХåե¡¥µ¥¤¥º¤Ï +.I /proc/sys/net/core/optmem_max +¤ò»È¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡£ +.BR socket (7) +¤ò»²¾È¡£ +.PP +.BR CMSG_FIRSTHDR () +¤Ï¡¢ÅϤ·¤¿ +.I msghdr +¤Ë´ØÏ¢¤·¤¿Êä½õ¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡Ãæ¤Î¡¢ºÇ½é¤Î +.I cmsghdr +¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.BR CMSG_NXTHDR () +¤Ï¡¢ÅϤ·¤¿ +.I cmsghdr +¤Î¼¡¤Ë¤¯¤ë (Í­¸ú¤Ê) +.I cmsghdr +¤òÊÖ¤¹¡£ +¥Ð¥Ã¥Õ¥¡¤Ë½½Ê¬¤Ê¶õ¤­¤¬Ìµ¤¤¾ì¹ç¡¢NULL ¤òÊÖ¤¹¡£ +.PP +.BR CMSG_ALIGN () +¤ËŤµ¤òÍ¿¤¨¤ë¤È¡¢É¬Íפʥ¢¥é¥¤¥ó¥á¥ó¥È¤ò²ÃÌ£¤·¤¿Ä¹¤µ¤òÊÖ¤·¤Æ¤¯¤ë¡£ +¤³¤ì¤ÏÄê¿ô¼°¤Ç¤¢¤ë¡£ +.PP +.BR CMSG_SPACE () +¤Ï¡¢Í¿¤¨¤¿¥Ç¡¼¥¿Ä¹¤¬Àê¤á¤ë¤Î¤ËɬÍפÊÊä½õÍ×ÁÇ (ancillary element) ¤Î +¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¤³¤ì¤ÏÄê¿ô¼°¤Ç¤¢¤ë¡£ +.PP +.BR CMSG_DATA () +¤Ï¡¢ +.I cmsghdr +¤Î¥Ç¡¼¥¿Éôʬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.BR CMSG_LEN () +¤Ï¡¢ +.I cmsghdr +¹½Â¤ÂΤΠ+.I cmsg_len +¥á¥ó¥Ð¤Ë¥Ç¡¼¥¿¤ò³ÊǼ¤¹¤ëºÝ¤ËɬÍפÊÃͤòÊÖ¤¹¡£¥¢¥é¥¤¥ó¥á¥ó¥È¤â¹Íθ¤ËÆþ¤ì +¤é¤ì¤ë¡£ +°ú¿ô¤È¤·¤Æ¥Ç¡¼¥¿Ä¹¤ò¤È¤ë¡£¤³¤ì¤ÏÄê¿ô¼°¤Ç¤¢¤ë¡£ +.PP +Êä½õ¥Ç¡¼¥¿¤òºî¤ë¤¿¤á¤Ë¤ÏºÇ½é¤Ë +.I msghdr +¤Î¥á¥ó¥Ð¡¼ +.I msg_controllen +¤ò¡¢À©¸æ¥á¥Ã¥»¡¼¥¸¥Ð¥Ã¥Õ¥¡¤ÎŤµ¤Ç½é´ü²½¤¹¤ë¡£ +.BR CMSG_FIRSTHDR () +¤ò +.I msghdr +¤ËÍѤ¤¤ë¤ÈºÇ½é¤ÎÀ©¸æ¥á¥Ã¥»¡¼¥¸¤¬ÆÀ¤é¤ì¡¢ +.BR CMSG_NEXTHDR () +¤ò»È¤¦¤È¼¡¤ÎÀ©¸æ¥á¥Ã¥»¡¼¥¸¤¬ÆÀ¤é¤ì¤ë¡£ +¤½¤ì¤¾¤ì¤ÎÀ©¸æ¥á¥Ã¥»¡¼¥¸¤Ç¤Ï¡¢ +.I cmsg_len +¤ò½é´ü²½¤¹¤ë +.RB ( CMSG_LEN () +¤ò»È¤¦)¡£ +¤½¤Î¾¤Î +.I cmsghdr +¥Ø¥Ã¥À¡¼¥Õ¥£¡¼¥ë¥É¡¢¤½¤·¤Æ¥Ç¡¼¥¿Éôʬ¤ËÂФ·¤Æ¤â +.BR CMSG_DATA () +¤ò»È¤Ã¤Æ½é´ü²½¤ò¤¹¤ë¡£ +ºÇ¸å¤Ë +.I msghdr +¤Î +.I msg_controllen +¥Õ¥£¡¼¥ë¥É¤Ë¡¢¥Ð¥Ã¥Õ¥¡Ãæ¤ÎÀ©¸æ¥á¥Ã¥»¡¼¥¸¤ÎŤµ¤Î +.BR CMSG_SPACE () +¤Î¹ç·×¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.I msghdr +¤Ë¤Ä¤¤¤Æ¤Î¾ÜºÙ¤Ï +.BR recvmsg (2) +¤ò»²¾È¡£ +.PP +À©¸æ¥á¥Ã¥»¡¼¥¸¥Ð¥Ã¥Õ¥¡¤¬Á´¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤òǼ¤á¤ë¤Î¤Ë¤Ïû¤¹¤®¤ë¾ì¹ç¡¢ +.I msghdr +¤Î +.I msg_flags +¥á¥ó¥Ð¡¼¤Ë +.B MSG_CTRUNC +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ½àµò +¤³¤ÎÊä½õ¥Ç¡¼¥¿¥â¥Ç¥ë¤Ï¡¢POSIX.1g draft, 4.4BSD-Lite, RFC\ 2292 ¤Ë +µ­½Ò¤µ¤ì¤Æ¤¤¤ë IPv6 advanced API, ¤½¤·¤Æ SUSv2 +¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR CMSG_ALIGN () +¤Ï Linux ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +°Ü¿¢À­¤Î¤¿¤á¤Ë¡¢Êä½õ¥Ç¡¼¥¿¤Ø¤Î¥¢¥¯¥»¥¹¤Ë¤Ï¡¢ +¤³¤³¤Ç½Ò¤Ù¤é¤ì¤Æ¤¤¤ë¥Þ¥¯¥í¤ò»È¤¦¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.BR CMSG_ALIGN () +¤Ï Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢°Ü¿¢À­¤ò¹Í¤¨¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»È¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.PP +Linux ¤Ç¤Ï +.BR CMSG_LEN (), +.BR CMSG_DATA (), +.BR CMSG_ALIGN () +¤ÏÄê¿ô¼°¤Ç¤¢¤ë (¤½¤ì¤é¤Î°ú¿ô¤¬Äê¿ô¤È¤ß¤Ê¤µ¤ì¤ë)¡£ +¤³¤Î¤³¤È¤Ï¡¢Âç°èÊÑ¿ô¤Î¥µ¥¤¥º¤òÀë¸À¤¹¤ë¤Î¤Ë»È¤¨¤ë¡£ +¤·¤«¤·°Ü¿¢À­¤Ï¤Ê¤¯¤Ê¤ë¤À¤í¤¦¡£ +.SH Îã +¼¡¤Î¥³¡¼¥É¤Ï¡¢¼õ¤±¼è¤Ã¤¿Êä½õ¥Ð¥Ã¥Õ¥¡¤«¤é +.B IP_TTL +¥ª¥×¥·¥ç¥ó¤òõ¤¹¤â¤Î¤Ç¤¢¤ë¡£ +.PP +.in +4n +.nf +struct msghdr msgh; +struct cmsghdr *cmsg; +int *ttlptr; +int received_ttl; + +/* Receive auxiliary data in msgh */ +for (cmsg = CMSG_FIRSTHDR(&msgh); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msgh,cmsg)) { + if (cmsg\->cmsg_level == IPPROTO_IP + && cmsg\->cmsg_type == IP_TTL) { + ttlptr = (int *) CMSG_DATA(cmsg); + received_ttl = *ttlptr; + break; + } +} +if (cmsg == NULL) { + /* + * Error: IP_TTL not enabled or small buffer + * or I/O error. + */ +} +.fi +.in +.PP +°Ê²¼¤Î¥³¡¼¥É¤Ï¡¢ +.B SCM_RIGHTS +¤ò»È¤¤¡¢¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤ÎÇÛÎó¤ò Unix ¥½¥±¥Ã¥È¤òÄ̤·¤ÆÁ÷¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.PP +.in +4n +.nf +struct msghdr msg = {0}; +struct cmsghdr *cmsg; +int myfds[NUM_FD]; /* Contains the file descriptors to pass. */ +char buf[CMSG_SPACE(sizeof myfds)]; /* ancillary data buffer */ +int *fdptr; + +msg.msg_control = buf; +msg.msg_controllen = sizeof buf; +cmsg = CMSG_FIRSTHDR(&msg); +cmsg\->cmsg_level = SOL_SOCKET; +cmsg\->cmsg_type = SCM_RIGHTS; +cmsg\->cmsg_len = CMSG_LEN(sizeof(int) * NUM_FD); +/* Initialize the payload: */ +fdptr = (int *) CMSG_DATA(cmsg); +memcpy(fdptr, myfds, NUM_FD * sizeof(int)); +/* Sum of the length of all control messages in the buffer: */ +msg.msg_controllen = cmsg\->cmsg_len; +.fi +.in +.SH ´ØÏ¢¹àÌÜ +.BR recvmsg (2), +.BR sendmsg (2) +.PP +RFC\ 2292 diff --git a/release/man3/confstr.3 b/release/man3/confstr.3 new file mode 100644 index 00000000..91996465 --- /dev/null +++ b/release/man3/confstr.3 @@ -0,0 +1,149 @@ +.\" 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:53:02 1993 by Rik Faith (faith@cs.unc.edu) +.\" FIXME Many more values for 'name' are supported, some of which +.\" are documented under 'info confstr'. +.\" 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 +.\" +.TH CONFSTR 3 2010-02-03 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +confstr \- ¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥ó¤Ë°Í¸¤·¤¿Ê¸»úÎóÊÑ¿ô¤Î¼èÆÀ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t confstr(int " "name" ", char *" buf ", size_t " len ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR confstr (): +_POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE +.SH ÀâÌÀ +.BR confstr () +¤Ï¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥ó¤Ë°Í¸¤·¤¿Ê¸»úÎóÊÑ¿ô¤ÎÃͤò¼èÆÀ¤¹¤ë¡£ +.PP +°ú¤­¿ô +.I name +¤Ï¡¢Ì䤤¹ç¤ï¤»ÆâÍƤòɽ¤¹¥·¥¹¥Æ¥àÊÑ¿ô¤Ç¤¢¤ë¡£ +°Ê²¼¤ÎÊÑ¿ô¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.BR _CS_GNU_LIBC_VERSION " (GNU C library ¸ÂÄê; glibc 2.3.2 °Ê¹ß)" +¤½¤Î¥·¥¹¥Æ¥à¤Î GNU C ¥é¥¤¥Ö¥é¥ê¤Î¥Ð¡¼¥¸¥ç¥ó¤ò¼¨¤¹Ê¸»úÎó +(Î㤨¤Ð "glibc 2.3.4")¡£ +.TP +.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 +¤¹¤Ù¤Æ¤Î POSIX.2 ɸ½à¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤¬¸«¤Ä¤«¤ë¤è¤¦¤Ê +.B PATH +¤ÎÃÍ¡£ +.PP +.I buf +¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä +.I len +¤¬ 0 ¤Ç¤Ê¤±¤ì¤Ð +.BR confstr () +¤Ï¼èÆÀ¤·¤¿Ê¸»úÎó¤ÎÆâÍƤò +.I buf +¤Ë¥³¥Ô¡¼¤¹¤ë¡£É¬Íפʤé¤ÐŤµ¤Ï +.I len \- 1 +ʸ»ú¤ËÀÚ¤ê¼Î¤Æ¤é¤ì¤Æ¡¢NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +ËöÈø¤¬ÀÚ¤ê¼Î¤Æ¤é¤ì¤¿¤«¤É¤¦¤«¤òȽÄꤹ¤ë¤Ë¤Ï¡¢ +.BR confstr () +¤ÎÊÖ¤êÃͤò +.I len +¤ÈÈæ³Ó¤¹¤ì¤Ð¤è¤¤¡£ +.PP +.I len +¤¬ 0 ¤Ç +.I buf +¤¬ NULL ¤Ê¤é¤Ð¡¢ +.BR confstr () +¤Ï°Ê²¼¤ÇÄêµÁ¤µ¤ì¤¿ÃÍ (ÌõÃí: ÀÚ¤ê¼Î¤Æ¤ëÁ°¤Î¡¢¼èÆÀ¤·¤¿Ê¸»úÎó¤ÎŤµ) ¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +.I name +¤¬Í­¸ú¤Ê¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥óÊÑ¿ô¤Î¾ì¹ç¡¢ +.BR confstr () +¤Ï¤½¤ÎÊÑ¿ô¤ÎÃÍÁ´ÂΤòÊÝ»ý¤¹¤ë¤Î¤ËɬÍפǤ¢¤Ã¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹ +(ʸ»úÎó½ªÃ¼¤Î¥Ì¥ë¥Ð¥¤¥È¤â´Þ¤à)¡£¤³¤ÎÃÍ¤Ï +.I len +¤è¤êÂ礭¤¤¤³¤È¤â¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I buf +¤Ë³ÊǼ¤µ¤ì¤¿ÃͤÎËöÈø¤¬ÀÚ¤êµÍ¤á¤é¤ì¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ + +.I name +¤¬Í­¸ú¤Ê¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥óÊÑ¿ô¤À¤¬¡¢ +ÊÑ¿ô¤¬Ãͤò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.BR confstr () +¤Ï 0 ¤òÊÖ¤¹¡£ +.I name +¤¬Í­¸ú¤Ê¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥óÊÑ¿ô¤ËÂбþ¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +.BR confstr () +¤Ï 0 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B EINVAL +¤òÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I name +¤ÎÃͤ¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Îã +¼¡¤ÎÉôʬŪ¤Ê¥³¡¼¥É¤Ï¡¢ POSIX.2 ¥·¥¹¥Æ¥à¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤¬¤¢¤ë¥Ñ¥¹ +¤ò¼èÆÀ¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.br +.nf +.in +4n + +char *pathbuf; +size_t n; + +n = confstr(_CS_PATH,NULL,(size_t) 0); +pathbuf = malloc(n); +if (pathbuf == NULL) + abort(); +confstr(_CS_PATH, pathbuf, n); +.in +.fi +.SH ´ØÏ¢¹àÌÜ +.BR sh (1), +.BR exec (3), +.BR system (3) diff --git a/release/man3/conj.3 b/release/man3/conj.3 new file mode 100644 index 00000000..07990e28 --- /dev/null +++ b/release/man3/conj.3 @@ -0,0 +1,42 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 02:38:18 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: complex conjugate Ê£ÁǶ¦Ìò +.\"WORD: imaginary part µõÉô +.\" +.TH CONJ 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +conj, conjf, conjl \- Ê£ÁǶ¦Ìò¤ò·×»»¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "double complex conj(double complex " z ); +.br +.BI "float complex conjf(float complex " z ); +.br +.BI "long double complex conjl(long double complex " z ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR conj () +´Ø¿ô¤Ï \fIz\fR ¤ÎÊ£ÁǶ¦Ìò¤òÊÖ¤¹¡£ +¤½¤ÎÃͤϵõÉô¤ÎÉä¹æ¤òȿž¤·¤ÆÆÀ¤é¤ì¤ë¡£ +.LP +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + cabs(z) = csqrt(z * conj(z)) +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR sqrt (3), +.BR complex (7) diff --git a/release/man3/copysign.3 b/release/man3/copysign.3 new file mode 100644 index 00000000..68af3cc8 --- /dev/null +++ b/release/man3/copysign.3 @@ -0,0 +1,90 @@ +.\" 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-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 +.\" +.TH COPYSIGN 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +copysign, copysignf, copysignl \- ¿ô¤ÎÉä¹æ¤ò¥³¥Ô¡¼¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double copysign(double " x ", double " y ); +.br +.BI "float copysignf(float " x ", float " y ); +.br +.BI "long double copysignl(long double " x ", long double " y ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR copysign (), +.BR copysignf (), +.BR copysignl (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; +¤Þ¤¿¤Ï +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +´Ø¿ô +.BR copysign () +¤ÏÀäÂÐÃͤ¬ +\fIx\fP ¤ËÅù¤·¤¯¡¢Éä¹æ¥Ó¥Ã¥È¤¬ \fIy\fP ¤ËÅù¤·¤¤ÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤½¤ÎÀäÂÐÃÍ¤Ï +.I x +¤ËÅù¤·¤¯¡¢Éä¹æ¤Ï +.I y +¤ËÅù¤·¤¤ÃͤòÊÖ¤¹¡£ + +\fIx\fP ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤Ë \fIy\fP ¤ÎÉä¹æ¥Ó¥Ã¥È¤ò¤Ä¤±¤ÆÊÖ¤¹¡£ +.SH ½àµò +C99, POSIX.1-2001. +.\" 4.3BSD. +¤³¤Î´Ø¿ô¤Ï IEC 559 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +(¤Þ¤¿ IEEE 754/IEEE 854 ¤Ç¤Ï¡¢ÉÕÏ¿¤Ç¿ä¾©´Ø¿ô¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£) +.SH Ãí°Õ +ÉâÆ°¾®¿ôÅÀ·Á¼°¤¬ IEEE 754 ½àµò¤Ç¤Ê¤¤¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢ +.BR copysign () +¤ÏÉé¤Î 0 ¤òÀµ¤È¤·¤Æ°·¤¦¤³¤È¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR signbit (3) diff --git a/release/man3/cos.3 b/release/man3/cos.3 new file mode 100644 index 00000000..2fbef583 --- /dev/null +++ b/release/man3/cos.3 @@ -0,0 +1,119 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 +.\" +.TH COS 3 2009-02-04 "" "Linux Programmer's Manual" +.SH ̾Á° +cos, cosf, cosl \- ;¸¹ (¥³¥µ¥¤¥ó) ´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double cos(double " x ); +.br +.BI "float cosf(float " x ); +.br +.BI "long double cosl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR cosf (), +.BR cosl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR cos () +´Ø¿ô¤Ï \fIx\fP ¤Î;¸¹ (¥³¥µ¥¤¥ó) ¤ÎÃͤòÊÖ¤¹¡£ +\fIx\fP ¤Ï¥é¥¸¥¢¥óñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤Î;¸¹¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬Ìµ¸ÂÂç¤Ç¤¢¤ë +.\" .I errno +.\" is set to +.\" .BR EDOM . +̵¸ú (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I errno +¤òÀßÄꤷ¤Ê¤¤¡£ +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6780 +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.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) diff --git a/release/man3/cosh.3 b/release/man3/cosh.3 new file mode 100644 index 00000000..d4d4d13f --- /dev/null +++ b/release/man3/cosh.3 @@ -0,0 +1,130 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" 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) +.\" +.\" 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 2008-08-10 "" "Linux Programmer's Manual" +.SH ̾Á° +cosh, coshf, coshl \- ÁжÊÀþ;¸¹ (¥Ï¥¤¥Ñ¥Ü¥ê¥Ã¥¯¥³¥µ¥¤¥ó) ´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double cosh(double " x ); +.br +.BI "float coshf(float " x ); +.br +.BI "long double coshl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR coshf (), +.BR coshl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR cosh () +´Ø¿ô¤ÏÁжÊÀþ;¸¹ (¥Ï¥¤¥Ñ¥Ü¥ê¥Ã¥¯¥³¥µ¥¤¥ó) ¤ÎÃͤòÊÖ¤¹¡£ +¿ô³ØŪ¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë. +.nf + + cosh(x) = (exp(x) + exp(\-x)) / 2 +.fi +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÁжÊÀþ;¸¹¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 ¤« \-0 ¤Î¾ì¹ç¡¢ 1 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.RB + HUGE_VAL , +.RB + HUGE_VALF , +.RB + HUGE_VALL +¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼ (range error): ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤·¤¿ +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +glibc ¥Ð¡¼¥¸¥ç¥ó 2.3.4 °ÊÁ°¤Ç¤Ï¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬È¯À¸¤·¤¿¤È¤­¤Ë¡¢ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤é¤Ê¤«¤Ã¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR acosh (3), +.BR asinh (3), +.BR atanh (3), +.BR ccos (3), +.BR sinh (3), +.BR tanh (3) diff --git a/release/man3/cpow.3 b/release/man3/cpow.3 new file mode 100644 index 00000000..c6a6267b --- /dev/null +++ b/release/man3/cpow.3 @@ -0,0 +1,39 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\"WORD: power Îß¾è +.\"WORD: branch cut ʬ»ÞÀÚÃÇ +.\" +.TH CPOW 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +cpow, cpowf, cpowl \- Ê£ÁÇ¿ô¤ÎÎß¾è´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double complex cpow(double complex " x ", complex double " z ");" +.br +.BI "float complex cpowf(float complex " x ", complex float " z ");" +.br +.BI "long double complex cpowl(long double complex " x , +.BI " complex long double " z ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤Ï +.I x +¤Î +.I z +¾è¤ò·×»»¤¹¤ë +(¼Â¼´¤ÎÉé¤ÎÉôʬ¤Ë±è¤Ã¤Æ +.I x +¤Îʬ»ÞÀÚÃÇ (branch cut) ¤¬¤¢¤ë)¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR pow (3), +.BR complex (7) diff --git a/release/man3/cproj.3 b/release/man3/cproj.3 new file mode 100644 index 00000000..39472b93 --- /dev/null +++ b/release/man3/cproj.3 @@ -0,0 +1,45 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-24, Akihiro MOTOKI +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" +.\"WORD: Riemann Sphere ¥ê¡¼¥Þ¥óµå +.\"WORD: project ¼Í±Æ +.\"WORD: complex plane Ê£ÁÇÊ¿ÌÌ +.\"WORD: compactification ¥³¥ó¥Ñ¥¯¥È(´°Á´Ï¢Â³)¤Ë¤Ê¤ë(¤Î̾»ì·Á) +.\" +.TH CPROJ 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +cproj, cprojf, cprojl \- ¥ê¡¼¥Þ¥óµå¤Ø¤Î¼Í±Æ +.SH ½ñ¼° +.B #include +.sp +.BI "double complex cproj(double complex " z ");" +.br +.BI "float complex cprojf(float complex " z ");" +.br +.BI "long double complex cprojl(long double complex " z ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤Ï¡¢Ê¿Ì̾å¤ÎÅÀ¤ò¥ê¡¼¥Þ¥óµå¤ÎɽÌ̤˼ͱƤ¹¤ë¡¢¤Ä¤Þ¤ê +Ê£ÁÇÊ¿Ì̤ΰì¤Ä¤Î¼´¤Ø¤Î¥³¥ó¥Ñ¥¯¥È²½ (one-point compactification) ¤ò¹Ô¤¦¡£ +Í­¸Â¤ÊÅÀ +.I z +¤Ï¤¤¤º¤ì¤â +.I z +¼«¿È¤Ø¼Í±Æ¤µ¤ì¤ë¡£ +̵¸Â¤ÎÃͤò»ý¤ÄÁ´¤Æ¤ÎÊ£ÁÇ¿ô¤Ï¡¢°ì¤Ä¤Î̵¸ÂÃͤ˼ͱƤµ¤ì¤ë¡£ +¤â¤Ã¤È¾Ü¤·¤¯¸À¤¦¤È¡¢¼Â¿ô¼´¤ÎÀµ¤Î̵¸ÂÂç¤Ë¼Í±Æ¤µ¤ì¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +glibc ¤Î¼ÂÁõ¤Ï¤ª¤«¤·¤¯¡¢Á´¤¯°ã¤Ã¤¿¤³¤È¤ò¤·¤Æ¤·¤Þ¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR complex (7) diff --git a/release/man3/creal.3 b/release/man3/creal.3 new file mode 100644 index 00000000..df5f2a58 --- /dev/null +++ b/release/man3/creal.3 @@ -0,0 +1,46 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 01:33:13 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: real part ¼ÂÉô +.\"WORD: imaginary part µõÉô +.\" +.TH CREAL 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +creal, crealf, creall \- Ê£ÁÇ¿ô¤Î¼ÂÉô¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "double creal(double complex " z ); +.br +.BI "float crealf(float complex " z ); +.br +.BI "long double creall(long double complex " z ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR creal () +´Ø¿ô¤ÏÊ£ÁÇ¿ô +.I z +¤Î¼ÂÉô¤òÊÖ¤¹¡£ +.LP +¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë: +.nf + + z = creal(z) + I * cimag(z) +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +gcc ¤Ç¤Ï __real__ ¤ò»È¤¦¤³¤È¤â¤Ç¤­¤ë¤¬¡¢ +¤³¤ì¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR cimag (3), +.BR complex (7) diff --git a/release/man3/crypt.3 b/release/man3/crypt.3 new file mode 100644 index 00000000..5aafd5e7 --- /dev/null +++ b/release/man3/crypt.3 @@ -0,0 +1,232 @@ +.\" Michael Haardt (michael@cantor.informatik.rwth.aachen.de) +.\" Sat Sep 3 22:00:30 MET DST 1994 +.\" +.\" 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. +.\" +.\" Sun Feb 19 21:32:25 1995, faith@cs.unc.edu edited details away +.\" +.\" TO DO: This manual page should go more into detail how DES is perturbed, +.\" which string will be encrypted, and what determines the repetition factor. +.\" Is a simple repetition using ECB used, or something more advanced? I hope +.\" the presented explanations are at least better than nothing, but by no +.\" means enough. +.\" +.\" 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 2008-08-25 "" "Linux Programmer's Manual" +.SH ̾Á° +crypt, crypt_r \- ¥Ñ¥¹¥ï¡¼¥É¤È¥Ç¡¼¥¿¤Î°Å¹æ²½ +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "char *crypt(const char *" key ", const char *" salt ); +.sp +.BI "char *crypt_r(const char *" key ", const char *" salt , +.BI " struct crypt_data *" data ); +.fi +.sp +\fI\-lcrypt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR crypt () +¤Ï¥Ñ¥¹¥ï¡¼¥É°Å¹æ²½´Ø¿ô¤Ç¤¢¤ë¡£ +¸°Ãµº÷¤Î¥Ï¡¼¥É¥¦¥§¥¢¤Ë¤è¤ë¼ÂÁõ¤ò˸¤²¤ë¤è¤¦¤Ë(¤½¤Î¾¤Ë¤â¤¤¤í¤¤¤í) +Êѹ¹¤·¤¿ Data Encryption Standard ¥¢¥ë¥´¥ê¥º¥à¤ò¸µ¤Ë¤·¤Æ¤¤¤ë¡£ +.PP +.I key +¤Ï¥æ¡¼¥¶¤¬ÆþÎϤ¹¤ë¥Ñ¥¹¥ï¡¼¥É¤Ç¤¢¤ë¡£ +.PP +.I salt +¤Ï½¸¹ç +[\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP] +¤«¤éÁª¤Ð¤ì¤¿ 2 ʸ»ú¤Îʸ»úÎó¤Ç¤¢¤ë¡£ +¤³¤Îʸ»úÎó¤Ï¥¢¥ë¥´¥ê¥º¥à¤Î½ÐÎϤò 4096 Ä̤ê¤Ë¤«¤­Í𤹤Τ˻Ȥï¤ì¤ë¡£ +.PP +.I key +¤ÎºÇ½é¤Î 8 ʸ»ú¤Î³Æʸ»ú¤«¤é²¼°Ì 7 ¥Ó¥Ã¥È¤ò¤È¤Ã¤Æ 56 ¥Ó¥Ã¥È¤Î¸°¤¬ÆÀ¤é¤ì¤ë¡£ +¤³¤Î 56 ¥Ó¥Ã¥È¤Î¸°¤ÏÆÃÄê¤Îʸ»úÎó(¤Õ¤Ä¤¦¤Ï¤¹¤Ù¤Æ 0 ¤Îʸ»úÎó) +¤ò·«¤êÊÖ¤·°Å¹æ²½¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +ÊÖ¤êÃͤϰŹ沽¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¡¢13 ¤Î°õ»ú²Äǽ¤Ê ASCII ʸ»ú +¤«¤é¤Ê¤ë(ºÇ½é¤Î 2 ʸ»ú¤Ï salt ¤½¤Î¤â¤Î)¡£ +ÊÖ¤êÃͤϡ¢´Ø¿ô¸Æ½Ð¤·¤Î¤¿¤Ó¤Ë¾å½ñ¤­¤µ¤ì¤ëÀÅŪ¤Ê¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.PP +·Ù¹ð: ¸°¶õ´Ö¤Ï +.if t 2\s-2\u56\s0\d +.if n 2**56 += 7.2e16 ¤Î²Äǽ¤ÊÃͤ«¤éÀ®¤ë¡£ +¤³¤Î¸°¶õ´Ö¤ÎÁ´Ãµº÷¤Ï¶¯ÎϤÊÊÂÎó·×»»µ¡¤ò»È¤¨¤Ð²Äǽ¤Ç¤¢¤ë¡£¤Þ¤¿ +.BR crack (1) +¤Î¤è¤¦¤Ê¥½¥Õ¥È¥¦¥§¥¢¤Ï¤³¤Î¸°¶õ´Ö¤ÎÃæ¤Ç¡¢Â¿¤¯¤Î¿Í¤Ë¥Ñ¥¹¥ï¡¼¥É¤È¤·¤Æ +»È¤ï¤ì¤ë¤è¤¦¤Ê¸°¤Ë¤Ä¤¤¤Æ¤ÎÁ´Ãµº÷¤¬²Äǽ¤Ç¤¢¤ë¡£ +¤½¤ì¤æ¤¨¡¢¥Ñ¥¹¥ï¡¼¥É¤òÁªÂò¤¹¤ë¤È¤­¤Ë¤Ï¡¢¤¹¤¯¤Ê¤¯¤È¤â¡¢ +°ìÈÌŪ¤Ë»È¤ï¤ì¤ëñ¸ì¤È̾Á°¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.BR passwd (1) +¤ò»È¤¦»þ¤Ë¤Ï¥¯¥é¥Ã¥¯¤µ¤ì¤¦¤ë¥Ñ¥¹¥ï¡¼¥É¤Ë¤Ä¤¤¤Æ¤Î¸¡ºº¤ò¤¹¤ë¤³¤È¤¬ +¿ä¾©¤µ¤ì¤ë¡£ +.PP +DES ¥¢¥ë¥´¥ê¥º¥à¤Ë¤Ï¤¤¤¯¤Ä¤«¤ÎÊʤ¬¤¢¤ê¡¢¤½¤ì¤Ë¤è¤Ã¤Æ¥Ñ¥¹¥ï¡¼¥Éǧ¾Ú°Ê³°¤Ë +.BR crypt () +¤ò»È¤¦¤Î¤Ï¤¿¤¤¤Ø¤ó¤è¤¯¤Ê¤¤ÁªÂò¤È¤Ê¤Ã¤Æ¤¤¤ë¡£¤â¤· +.BR crypt () +¤ò°Å¹æ¥×¥í¥¸¥§¥¯¥È¤Ë»È¤ª¤¦¤È¤¤¤¦°Æ¤ò¤â¤Ã¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢¤½¤ì¤Ï¤ä¤á¤¿¤Û¤¦¤¬ +¤è¤¤¡£°Å¹æ²½¤Ë¤Ä¤¤¤Æ¤Î¤è¤¤ËܤÈï¤Ç¤âÆþ¼ê¤Ç¤­¤ë DES ¥é¥¤¥Ö¥é¥ê¤Î¤Ò¤È¤Ä¤ò +¼ê¤Ë¤¤¤ì¤ë¤Ù¤­¤À¡£ + +.BR crypt_r () +¤Ï +.BR crypt () +¤ÎºÆÆþ²ÄǽÈǤǤ¢¤ë¡£ +.I data +¤Ç¼¨¤µ¤ì¤ë¹½Â¤ÂΤϷë²Ì¥Ç¡¼¥¿¤ÎÊݸ¤È¾ðÊó¤Î´ÉÍý¤Ë»È¤ï¤ì¤ë¡£ +¤³¤Î¹½Â¤ÂΤËÂФ·¤Æ(¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤ë¤³¤È°Ê³°¤Ë)¸Æ¤Ó½Ð¤·¸µ¤¬¤¹¤ë¤Ù¤­Í£°ì¤Î +¤³¤È¤Ï¡¢ +.BR crypt_r () +¤Î½é²ó¤Î¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë +.I data->initialized +¤ò¥¼¥í¤Ë¤¹¤ë¤³¤È¤À¤±¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤Î¾ì¹ç¤Ë¤Ï¡¢°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï NULL ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOSYS +.BR crypt () +´Ø¿ô¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£Â¿Ê¬¥¢¥á¥ê¥«¤ÎÍ¢½Ðµ¬À©¤Î¤¿¤á¤Ë¡£ +.\" ¤³¤Î¥ì¥Ù¥ë¤Î¾ÜºÙ¤Ï¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤ÏɬÍפʤ¤¤À¤í¤¦¡Ä +.\" (ÌõÃí: °Ê²¼¤Ï MAEHARA Kouichi ¤µ¤ó¤ÎÌõ) +.\" .PP +.\"ʿʸ P ¤ò¸° K ¤Ç¤â¤Ã¤Æ DES ¤òÍѤ¤¤Æ°Å¹æ²½¤·¤¿¤È¤­¤Î·ë²Ì¤Î°Å¹æʸ +.\"¤ò C ¤È¤¹¤ë¤Ê¤é¤Ð¡¢P ¤ËÂФ¹¤ë 2 ¤ÎÊä¿ôŪ¤Êʿʸ P' ¤ò¸° K +.\"¤ËÂФ¹¤ëƱÍͤËÊä¿ôŪ¤Ê¸° K' ¤òÍѤ¤¤Æ°Å¹æ²½¤¹¤ë¤È C ¤ËÂФ·¤Æ¤ä¤Ï¤êÊä +.\"¿ôŪ¤Ê°Å¹æʸ C' ¤È¤Ê¤ë¡£ +.\".PP +.\"DES ¤Ë¤è¤ë¸°¤ÎÊÑ·Á¤Ë¤ª¤¤¤Æ¡¢¾ï¤Ë¹¶·â¤ËÂФ·¤Æ¼å¤¤¸°¤¬Â¸ºß¤¹¤ë¡£¤è¤¯ +.\"ÃΤé¤ì¤¿»Í¤Ä¤Î¼å¤¤¸°¤Ï 0101010101010101¡¢fefefefefefefefe¡¢ +.\"1f1f1f1f0e0e0e0e¡¢e0e0e0e0f1f1f1f1 ¤Ç¤¢¤ê¤³¤ì¤é¤Î»ÈÍѤÏÈò¤±¤Ê¤±¤ì¤Ð +.\"¤Ê¤é¤Ê¤¤¡£ +.\".PP +.\"Ʊ°ì¤Î°Å¹æ²½·ë²Ì¤òƳ¤¤¤Æ¤·¤Þ¤¦Ï»ÁȤΤä¤ä¼å¤¤¸°¤â¤¢¤ë¡£¤³¤¦¤·¤¿¤¤¤¯ +.\"¤Ä¤«¤Î¸°¤Î»ÈÍѤϤä¤Ï¤êÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.\"¿½¤·¤ï¤±¤Ê¤¤¤³¤È¤À¤¬¡¢¤³¤ì¤Ë¤É¤ó¤Ê¸°¤¬³ºÅö¤¹¤ë¤Î¤«¤ÏÄ´¤Ù¤­¤ì¤Ê¤«¤Ã +.\"¤¿¡£ +.\".PP +.\"¶Ëü¤Ë¾éĹ²½¤Ç¤¢¤ë¥Ç¡¼¥¿¤Ï¡¢ +.\".BR crypt () +.\"¤Î¤è¤¦¤Ë +.\".I "°Å¹æɽ(codebook)" +.\"¥â¡¼¥É¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë DES ¤Ë¤è¤ë°Å¹æ²½¤Ë¤ª¤¤¤Æ¤Ï¥È¥é¥Ö¥ë¤Î¤â¤È¤È¤Ê +.\"¤ë¡£ +.\".BR crypt () +.\"¤Ï¤½¤ÎÁÛÄêÄ̤ꡢ¥Ñ¥¹¥ï¡¼¥É¤Îǧ¾Ú¤ÎÌÜŪ¤Ë¤Î¤ßÍøÍѤ¹¤Ù¤­¤â¤Î¤Ç¤¢¤ê¡¢ +.\"¥Ç¡¼¥¿¤Î°Å¹æ²½¥Ä¡¼¥ë¤È¤·¤ÆÍѤ¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.\".PP +.\"Âè»Í S-box ¤Î¡¢ÀèƬ¤ÈËöÈø»°¤Ä¤Î½ÐÎÏ bit ·²¤Ï¡¢¤½¤ÎÆþÎÏ bit ·²¤Î´Ø¿ô +.\"¤È¤·¤Æɽ¤ï¤¹¤³¤È¤¬¤Ç¤­¤ë¡£¤³¤Î¤è¤¦¤Ê S-box ·²¤ÏƱ¤¸ÆþÎϤËÂФ·¤Æ¤ÏÉô +.\"ʬŪ¤ËƱ¤¸°Å¹æ²½·ë²Ì¤òÀ¸À®¤·¤Æ¤·¤Þ¤¦¤³¤È¤¬¼Â¸³¤Ë¤è¤Ã¤Æ¤¢¤­¤é¤«¤Ë¤µ +.\"¤ì¤Æ¤¤¤ë¡£¤³¤ì¤Ï¡¢¹ñ²È°ÂÁ´Êݾã¶É(NSA)¤¬ DES ¤Ë¤è¤ë°Å¹æ¥Ç¡¼¥¿¤Î²òÆɤò²Äǽ +.\"¤Ë¤¹¤ë¤¿¤á¤ËÀߤ±¤¿Î¢¸ý¤Ê¤Î¤Ç¤Ï¤Ê¤¤¤«¤Èµ¿¤ï¤ì¤Æ¤¤¤ë¡£ +.\".PP +.\"¤³¤¦¤¤¤Ã¤¿Íýͳ¤Ë¤è¤ê¡¢crypt() ¤ò»ÈÍѤ·¤¿°Å¹æ²½¥Ç¡¼¥¿¤ò¸ø³«¤¹¤ë¤³¤È +.\"¤Ï°ÂÁ´¤Ç¤Ï¤Ê¤¤¤Èǧ¼±¤¹¤ë¤Ù¤­¤Ê¤Î¤Ç¤¢¤ë¡£ +.SH ½àµò +.BR crypt (): +SVr4, 4.3BSD, POSIX.1-2001. +.BR crypt_r () +¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.SS glibc ¤Ç¤ÎÃí°Õ +¤³¤Î´Ø¿ô¤Î glibc2 ÈǤÏÄɲäΰŹ沽¥¢¥ë¥´¥ê¥º¥à¤ËÂбþ¤·¤Æ¤¤¤ë¡£ + +¤â¤· +.I salt +¤Îʸ»úÎó¤¬ "$\fIid\fP$" ¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Æ¡¢"$" ¤Ç½ª¤ï¤Ã¤Æ¤¤¤ëʸ»úÎó¤¬ +³¤¤¤Æ¤¤¤ë¾ì¹ç: +.RS + +$\fIid\fP$\fIsalt\fP$\fIencrypted\fP + +.RE +DES ¤ò»È¤¦Âå¤ï¤ê¤Ë¡¢ +.I id +¤Ç»ÈÍѤ¹¤ë°Å¹æ²½¼êË¡¤ò¼±Ê̤·¡¢¤³¤ì¤¬¥Ñ¥¹¥ï¡¼¥Éʸ»úÎó¤Î»Ä¤ê¤ÎÉôʬ¤ò²ò¼á¤¹¤ë +ÊýË¡¤ò·èÄꤹ¤ë¡£ +.I id +¤ÎÃͤȤ·¤Æ¡¢°Ê²¼¤ÎÃͤËÂбþ¤·¤Æ¤¤¤ë: +.RS +.TS +l l. +ID | Method +_ +1 | MD5 +2a | Blowfish (ËÜή¤Î glibc ¤Ë¤ÏÆþ¤Ã¤Æ¤¤¤Ê¤¤; + | ¤¤¤¯¤Ä¤«¤Î Linux ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤ÇÄɲ䵤ì¤Æ¤¤¤ë) +.\" openSUSE has Blowfish, but AFAICS, this option is not supported +.\" natively by glibc -- mtk, Jul 08 +.\" +.\" md5 | Sun MD5 +.\" glibc doesn't appear to natively support Sun MD5; I don't know +.\" if any distros add the support. +5 | SHA-256 (glibc 2.7 °Ê¹ß) +6 | SHA-512 (glibc 2.7 °Ê¹ß) +.TE +.RE + +½¾¤Ã¤Æ¡¢$5$\fIsalt\fP$\fIencrypted\fP ¤Ï SHA-256 ¤Ç¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿ +¥Ñ¥¹¥ï¡¼¥É¤Ç¤¢¤ê¡¢$6$\fIsalt\fP$\fIencrypted\fP ¤Ï SHA-512 ¤Ç +¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ç¤¢¤ë¡£ + +"\fIsalt\fP" ¤Ï salt ¤Ë¤ª¤±¤ë "$\fIid\fP$" ¤Ë°ú¤­Â³¤¯ 16 ʸ»ú°Ê²¼¤Î +ʸ»úÎó¤Ç¤¢¤ë¡£ +¥Ñ¥¹¥ï¡¼¥Éʸ»úÎó¤Î°Å¹æ²½Éôʬ¤Ï¼ÂºÝ¤Ë·×»»¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ç¤¢¤ë¡£ +¤³¤Îʸ»úÎó¤Î¥µ¥¤¥º¤Ï¸ÇÄê¤Ç¤¢¤ë: +.TS +l l. +MD5 | 22 characters +SHA-256 | 43 characters +SHA-512 | 86 characters +.TE + +"\fIsalt\fP" ¤È "\fIencrypted\fP" ¤Îʸ»ú¤Ï +[\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP] ¤Î½¸¹ç¤«¤é +Áª¤Ð¤ì¤ë¡£ +SHA ¼ÂÁõ¤Ç¤Ï¡¢(ºÇ½é¤Î 8 ʸ»ú¤Ç¤Ï¤Ê¤¯) +.I ¥­¡¼ +Á´ÂΤ¬°ÕÌ£¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR login (1), +.BR passwd (1), +.BR encrypt (3), +.BR getpass (3), +.BR passwd (5), +.BR feature_test_macros (7) diff --git a/release/man3/csin.3 b/release/man3/csin.3 new file mode 100644 index 00000000..70322617 --- /dev/null +++ b/release/man3/csin.3 @@ -0,0 +1,40 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Wed Jul 23 05:24:36 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: sine Àµ¸¹ +.\"WORD: cosine ;¸¹ +.\"WORD: tangent ÀµÀÜ +.\" +.TH CSIN 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +csin, csinf, csinl \- Ê£ÁÇ¿ô¤ÎÀµ¸¹ (sine) +.SH ½ñ¼° +.B #include +.sp +.BI "double complex csin(double complex " z ");" +.br +.BI "float complex csinf(float complex " z ); +.br +.BI "long double complex csinl(long double complex " z ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +Ê£ÁÇ¿ô¤ÎÀµ¸¹ (sine) ´Ø¿ô csin(z) ¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.nf + + csin(z) = (exp(i * z) \- exp(\-i * z)) / (2 * i) +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR ccos (3), +.BR ctan (3), +.BR complex (7) diff --git a/release/man3/csinh.3 b/release/man3/csinh.3 new file mode 100644 index 00000000..310e02d3 --- /dev/null +++ b/release/man3/csinh.3 @@ -0,0 +1,41 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Wed Jul 23 05:54:24 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: hyperbolic ÁжÊ(Àþ¤Î) +.\"WORD: sine Àµ¸¹ +.\"WORD: cosine ;¸¹ +.\"WORD: tangent ÀµÀÜ +.\" +.TH CSINH 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +csinh, csinhf, csinhl \- Ê£ÁÇ¿ô¤ÎÁжÊÀþÀµ¸¹ (hyperbolic sine) +.SH ½ñ¼° +.B #include +.sp +.BI "double complex csinh(double complex " z ");" +.br +.BI "float complex csinhf(float complex " z ");" +.br +.BI "long double complex csinhl(long double complex " z ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +Ê£ÁÇ¿ô¤ÎÁжÊÀþÀµ¸¹ (hyperbolic sine) ´Ø¿ô sinh(z) ¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.nf + + csinh(z) = (exp(z)\-exp(\-z))/2 +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR ccosh (3), +.BR ctanh (3), +.BR complex (7) diff --git a/release/man3/csqrt.3 b/release/man3/csqrt.3 new file mode 100644 index 00000000..02aa9bee --- /dev/null +++ b/release/man3/csqrt.3 @@ -0,0 +1,40 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Jul 24 00:47:23 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: square root Ê¿Êýº¬ +.\"WORD: branch cut ʬ»ÞÀÚÃÇ +.\" +.TH CSQRT 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +csqrt, csqrtf, csqrtl \- Ê£ÁÇ¿ô¤ÎÊ¿Êýº¬ +.SH ½ñ¼° +.B #include +.sp +.BI "double complex csqrt(double complex " z ");" +.br +.BI "float complex csqrtf(float complex " z ");" +.br +.BI "long double complex csqrtl(long double complex " z ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +Í¿¤¨¤é¤ì¤¿Ê£ÁÇ¿ô¤ÎÊ¿Êýº¬¤ò·×»»¤¹¤ë¡£ +⤷¡¢Ê¿Êýº¬¤Î¤¦¤Á¼Â¿ôÉô¤¬ÈóÉé¤ÎÃͤòÊÖ¤¹¡£ +¼Â¼´¤ÎÉé¤ÎÉôʬ¤Ë±è¤Ã¤Æʬ»ÞÀÚÃÇ (branch cut) ¤¬¤¢¤ë¡£ +(¤Ä¤Þ¤ê¡¢ \fIeps\fP ¤ò¾®¤µ¤ÊÀµ¤Î¼Â¿ô¤È¤·¤¿¾ì¹ç¡¢ +\fIcsqrt(\-1+eps*I)\fP ¤¬ I ¤Ë¶áÉÕ¤¤¤Æ¤¤¤­¡¢ +°ìÊý \fIcsqrt(\-1\-eps*I)\fP ¤Ï \-I ¤Ë¶áÉÕ¤¤¤Æ¤¤¤¯¡¢ +¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£) +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR cexp (3), +.BR complex (7) diff --git a/release/man3/ctan.3 b/release/man3/ctan.3 new file mode 100644 index 00000000..8f5fea4a --- /dev/null +++ b/release/man3/ctan.3 @@ -0,0 +1,40 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-23, Akihiro MOTOKI +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" +.\"WORD: sine Àµ¸¹ +.\"WORD: cosine ;¸¹ +.\"WORD: tangent ÀµÀÜ +.\" +.TH CTAN 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +ctan, ctanf, ctanl \- Ê£ÁÇ¿ô¤ÎÀµÀÜ (tangent) ´Ø¿ô +.SH ½ñ¼° +.B #include +.sp +.BI "double complex ctan(double complex " z ");" +.br +.BI "float complex ctanf(float complex " z ); +.br +.BI "long double complex ctanl(long double complex " z ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +Ê£ÁÇ¿ô¤ÎÀµÀÜ (tangent) ´Ø¿ô ctan(z) ¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.nf + + ctan(z) = csin(z) / ccos(z) +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR ccos (3), +.BR csin (3), +.BR complex (7) diff --git a/release/man3/ctanh.3 b/release/man3/ctanh.3 new file mode 100644 index 00000000..133cb363 --- /dev/null +++ b/release/man3/ctanh.3 @@ -0,0 +1,41 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-23, Akihiro MOTOKI +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" +.\"WORD: hyperbolic ÁжÊ(Àþ¤Î) +.\"WORD: sine Àµ¸¹ +.\"WORD: cosine ;¸¹ +.\"WORD: tangent ÀµÀÜ +.\" +.TH CTANH 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +ctanh, ctanhf, ctanhl \- Ê£ÁÇ¿ô¤ÎÁжÊÀþÀµÀÜ (hyperbolic tangent) +.SH ½ñ¼° +.B #include +.sp +.BI "double complex ctanh(double complex " z ");" +.br +.BI "float complex ctanhf(float complex " z ); +.br +.BI "long double complex ctanhl(long double complex " z ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +Ê£ÁÇ¿ô¤ÎÁжÊÀþÀµÀÜ (hyperbolic tangent) ´Ø¿ô¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ +.nf + + ctanh(z) = csinh(z) / ccosh(z) +.fi +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR ccosh (3), +.BR csinh (3), +.BR complex (7) diff --git a/release/man3/ctermid.3 b/release/man3/ctermid.3 new file mode 100644 index 00000000..de32c545 --- /dev/null +++ b/release/man3/ctermid.3 @@ -0,0 +1,72 @@ +.\" 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:51:06 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 +.\" +.TH CTERMID 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +ctermid \- À©¸æüËö̾¤Î¼èÆÀ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *ctermid(char *" "s" ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR ctermid (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.\" From : _XOPEN_SOURCE +.SH ÀâÌÀ +.BR ctermid () +¤Ï¥×¥í¥»¥¹¤Î¸½ºß¤ÎÀ©¸æüËö¤Î¥Ñ¥¹Ì¾¤òÊÖ¤¹¡£ +.I s +¤¬ NULL ¤Î¾ì¹ç¡¢ÀÅŪ¤Ê¥Ð¥Ã¥Õ¥¡¤òÍѤ¤¤ë¡£¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.I s +¤ÏüËö¥Ñ¥¹Ì¾¤òÊÝ»ý¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ë¡£ +¥·¥ó¥Ü¥ëÄê¿ô +.B L_ctermid +¤ÏÊÖ¤µ¤ì¤ë¥Ñ¥¹Ì¾¤ÎºÇÂçʸ»ú¿ô¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +¥Ñ¥¹Ì¾¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.SH ¥Ð¥° +ÊÖ¤µ¤ì¤¿¥Ñ¥¹¤Ï¤¿¤Ö¤óÀ©¸æüËö¤ò°ì°Õ¤Ë¤ÏÆÃÄê¤Ç¤­¤Ê¤¤¡£ +¤¿¤È¤¨¤Ð +.I /dev/tty +¤Î¤è¤¦¤Ë¡£ +.PP +¥×¥í¥°¥é¥à¤¬Ã¼Ëö¤ò¥ª¡¼¥×¥ó¤Ç¤­¤ë¤³¤È¤ÏÊݾڤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" in glibc 2.3.x, x >= 4, the glibc headers threw an error +.\" if ctermid() was given an argument; fixed in 2.4. +.SH ´ØÏ¢¹àÌÜ +.BR ttyname (3) diff --git a/release/man3/ctime.3 b/release/man3/ctime.3 new file mode 100644 index 00000000..164cc1ca --- /dev/null +++ b/release/man3/ctime.3 @@ -0,0 +1,366 @@ +.\" 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 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 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 Í×ÁÇÊ̤λþ¹ï +.\" +.TH CTIME 3 2010-02-25 "" "Linux Programmer's Manual" +.SH ̾Á° +asctime, ctime, gmtime, localtime, mktime, asctime_r, ctime_r, gmtime_r, +localtime_r \- ÆüÉդȻþ¹ï¤òÍ×ÁÇÊ̤λþ¹ï¤ä ASCII ¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *asctime(const struct tm *" tm ); +.br +.BI "char *asctime_r(const struct tm *" tm ", char *" buf ); +.sp +.BI "char *ctime(const time_t *" timep ); +.br +.BI "char *ctime_r(const time_t *" timep ", char *" buf ); +.sp +.BI "struct tm *gmtime(const time_t *" timep ); +.br +.BI "struct tm *gmtime_r(const time_t *" timep ", struct tm *" result ); +.sp +.BI "struct tm *localtime(const time_t *" timep ); +.br +.BI "struct tm *localtime_r(const time_t *" timep ", struct tm *" result ); +.sp +.BI "time_t mktime(struct tm *" tm ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR asctime_r (), +.BR ctime_r (), +.BR gmtime_r (), +.BR localtime_r (): +.br +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.SH ÀâÌÀ +´Ø¿ô +.BR ctime (), +.BR gmtime (), +.BR localtime () +¤Ï +\fItime_t\fP ·¿¤Î¥«¥ì¥ó¥À¡¼»þ¹ï¤ò°ú¤­¿ô¤Ë¤È¤ë¡£ +°ú¤­¿ô¤¬ÀäÂÐÃͤȤ·¤Æ²ò¼á¤µ¤ì¤ë¾ì¹ç¤Ï¡¢»þ¹ïµª¸µ (Epoch; +1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤Î·Ð²áÉÿô¤È²ò¼á¤µ¤ì¤ë¡£ +.PP +´Ø¿ô +.BR asctime () +¤È +.BR mktime () +¤Ï +ǯ¡¦·î¡¦Æü¤Ê¤É¤ËʬΥ¤µ¤ì¤¿Í×ÁÇÊ̤λþ¹ï¤ò°ú¤­¿ô¤È¤¹¤ë¡£ +.PP +Í×ÁÇÊ̤λþ¹ï¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +\fItm\fP ¹½Â¤ÂΤËÊÝ»ý¤µ¤ì¤ë¡£ +.sp +.in +4n +.nf +struct tm { + int tm_sec; /* Éà */ + int tm_min; /* ʬ */ + int tm_hour; /* »þ´Ö */ + int tm_mday; /* Æü */ + int tm_mon; /* ·î */ + int tm_year; /* ǯ */ + int tm_wday; /* ÍËÆü */ + int tm_yday; /* ǯÆâÄÌ»»Æü */ + int tm_isdst; /* ²Æ»þ´Ö */ +}; +.fi +.in +.PP +\fItm\fP ¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Ï°Ê²¼¤ÎÄ̤ê: +.TP 10 +.I tm_sec +Éÿô¡¢¤Õ¤Ä¤¦¤Ï 0 ¤«¤é 59 ¤Þ¤Ç¤ÎÃÍ¡¢ +¤·¤«¤·±¼ÉäΤ¿¤á 60 ¤Þ¤Ç¤ÎÃͤϵö¤µ¤ì¤ë¡£ +.TP +.I tm_min +ʬ¿ô¡¢0 ¤«¤é 59 ¤Þ¤Ç¤ÎÃÍ¡£ +.TP +.I tm_hour +¿¿ÌëÃ椫¤é¤ÎÄÌ»»»þ´Ö¡¢0 ¤«¤é 23 ¤Þ¤Ç¤ÎÃÍ¡£ +.TP +.I tm_mday +·î¤Ï¤¸¤á¤«¤é¤ÎÆü¿ô¡¢1 ¤«¤é 31 ¤Þ¤Ç¤ÎÃÍ¡£ +.TP +.I tm_mon +1·î¤«¤é¤ÎÄÌ»»·î¿ô¡¢0 ¤«¤é 11 ¤Þ¤Ç¤ÎÃÍ¡£ +.TP +.I tm_year +1900 ǯ¤«¤é¤ÎÄÌ»»Ç¯¿ô¡£ +.TP +.I tm_wday +ÆüÍËÆü¤«¤é¤ÎÄÌ»»Æü¿ô(ÍËÆü)¡£0 ¤«¤é 6 ¤Þ¤Ç¤ÎÃÍ¡£ +.TP +.I tm_yday +1 ·î 1 Æü¤«¤é¤ÎÄÌ»»Æü¿ô¡¢0 ¤«¤é 365 ¤Þ¤Ç¤ÎÃÍ¡£ +.TP +.I tm_isdst +²Æ»þ´Ö¤¬Í­¸ú¤«¤É¤¦¤«¤Î¥Õ¥é¥°¡£ +Àµ¤ÎÃͤʤé¤Ð²Æ»þ´Ö¤ÏÍ­¸ú¤Ë¤Ê¤ê¡¢0 ¤Ê¤é¤Ð̵¸ú¡¢Éé¤ÎÃͤʤé¤Ð¤³¤Î¾ðÊó¤Ë¤Ï +°ÕÌ£¤¬¤Ê¤¤¡£ +.PP +.BI ctime( t ) +´Ø¿ô¤Ï¡¢ +.BI asctime(localtime( t )) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +¥«¥ì¥ó¥À¡¼»þ¹ï \fIt\fP ¤ò +.sp +.RS +"Wed Jun 30 21:49:08 1993\\n" +.RE +.sp +¤È¤¤¤¦·Á¼°¤Î 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 +¤Ë¸½ºß¤Î¥¿¥¤¥à¥¾¡¼¥ó¤Î¾ðÊó¤òÀßÄꤹ¤ë +.RB ( tzset (3) +»²¾È)¡£ +¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤ¢¤ë +.BR ctime_r () +¤âƱÍͤÀ¤¬¡¢ +ʸ»úÎó¤Ï¥æ¡¼¥¶¡¼¤¬ÍÑ°Õ¤·¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ë¡£¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ï +¾¯¤Ê¤¯¤È¤â 26 ¥Ð¥¤¥È°Ê¾å¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤Ï \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP +¤òÀßÄꤹ¤ëɬÍפϤʤ¤¡£ +.PP +´Ø¿ô +.BR gmtime () +¤Ï¡¢¥«¥ì¥ó¥À¡¼»þ¹ï \fItimep\fP ¤ò +¶¨ÄêÀ¤³¦»þ (UTC) ¤Ç¤ÎÍ×ÁÇÊ̤λþ¹ï¤ØÊÑ´¹¤¹¤ë¡£ +ǯ¤¬À°¿ô·¿¤Ë¼ý¤Þ¤é¤Ê¤¤¾ì¹ç¡¢NULL ¤òÊÖ¤¹¡£ +ÊÖ¤êÃͤÏÀÅŪ¤Ë³ÎÊݤµ¤ì¤¿¹½Â¤ÂΤò»Ø¤·¤Æ¤ª¤ê¡¢¤³¤Î¸å¤Ç +ÆüÉÕ¤ä»þ¹ï¤Ë´Ø¤¹¤ë´Ø¿ô¤Î¤¤¤º¤ì¤«¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤È +¾å½ñ¤­¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.BR gmtime_r () +¤âƱÍͤÀ¤¬¡¢ +¥Ç¡¼¥¿¤Ï¥æ¡¼¥¶¡¼¤¬ÍÑ°Õ¤·¤¿¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ë¡£ +.PP +´Ø¿ô +.BR localtime () +¤Ï¡¢¥æ¡¼¥¶¤¬»ØÄꤷ¤¿¥¿¥¤¥à¥¾¡¼¥ó¤Ç¤Î»þ¹ïÍ×ÁǤØÊÑ´¹¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï +.BR tzset (3) +¤ò¸Æ¤Ó½Ð¤·¤¿¤«¤Î¤è¤¦¤Ë¿¶Éñ¤¤¡¢ +Âç°èÊÑ¿ô \fItzname\fP ¤Ë¸½ºß¤Î¥¿¥¤¥à¥¾¡¼¥ó¤Î¾ðÊó¤òÀßÄꤹ¤ë¡£ +¤Þ¤¿¡¢\fItimezone\fP ¤Ë¶¨ÄêÀ¤³¦»þ (UTC) ¤È¥í¡¼¥«¥ëɸ½à»þ¤È¤Î +»þº¹¤ÎÉÿô¤òÀßÄꤷ¡¢ +°ìǯ¤Î°ìÉô¤Ç²Æ»þ´Ö¤¬Å¬ÍѤµ¤ì¤ë¾ì¹ç¤Ï \fIdaylight\fP ¤Ë 0 ¤¬ÀßÄꤵ¤ì¤ë¡£ +ÊÖ¤êÃͤÏÀÅŪ¤Ë³ÎÊݤµ¤ì¤¿¹½Â¤ÂΤò»Ø¤·¤Æ¤ª¤ê¡¢¤³¤Î¸å¤Ç +ÆüÉÕ¤ä»þ¹ï¤Ë´Ø¤¹¤ë´Ø¿ô¤Î¤¤¤º¤ì¤«¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤È +¾å½ñ¤­¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.BR localtime_r () +¤âƱÍͤÀ¤¬¡¢ +¥Ç¡¼¥¿¤Ï¥æ¡¼¥¶¡¼¤¬ÍÑ°Õ¤·¤¿¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ë¡£ +¤³¤Î´Ø¿ô¤Ï \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP +¤òÀßÄꤹ¤ëɬÍפϤʤ¤¡£ +.PP +´Ø¿ô +.BR asctime () +¤Ï¡¢Í×ÁÇÊ̤λþ¹ï \fItm\fP ¤ò +.BR ctime () +¤ÈƱ¤¸·Á¼°¤Î NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤ØÊÑ´¹¤¹¤ë¡£ +ÊÖ¤êÃͤÏÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¤³¤Îʸ»úÎó¤Ï¡¢ +ÆüÉÕ¡¦»þ¹ï´Ø¿ô¤Î¤¤¤º¤ì¤«¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤È¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤ¢¤ë +.BR asctime_r () +¤âƱÍͤÀ¤¬¡¢ +ʸ»úÎó¤Ï¥æ¡¼¥¶¡¼¤¬ÍÑ°Õ¤·¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ë¡£¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ï +¾¯¤Ê¤¯¤È¤â 26 ¥Ð¥¤¥È°Ê¾å¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +´Ø¿ô +.BR mktime () +¤Ï¡¢(¥í¡¼¥«¥ë¥¿¥¤¥à¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤ë) Í×ÁÇÊ̤λþ¹ï¤ò +¥«¥ì¥ó¥À¡¼»þ¹ï¤ØÊÑ´¹¤¹¤ë¡£¤³¤ÎºÝ¡¢¸Æ¤Ó½Ð¤·¸µ¤¬¥Õ¥£¡¼¥ë¥É +.I tm_wday +¤È +.I tm_yday +¤Ç»ØÄꤷ¤¿ÃͤÏ̵»ë¤µ¤ì¤ë¡£ +.BR mktime () +¤Ï¡¢¥Õ¥£¡¼¥ë¥É +.I tm_isdst +¤Ç»ØÄꤵ¤ì¤¿Ãͤˤè¤ê¡¢ +.I tm +¹½Â¤ÂΤÇÅϤµ¤ì¤¿»þ¹ï¤Ç²Æ»þ´Ö (daylight saving time; DST) ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ +¤¤¤ë¤«¤òÃΤ롣 +Àµ¤ÎÃͤϲƻþ´Ö¤¬Í­¸ú¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +Éé¤ÎÃͤǤ¢¤ì¤Ð¡¢ +.BR mktime () +¤Ï (¥¿¥¤¥à¥¾¡¼¥ó¾ðÊó¤È¥·¥¹¥Æ¥à¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»È¤Ã¤Æ) +»ØÄꤵ¤ì¤¿»þ¹ï¤Ç²Æ»þ´Ö¤¬Í­¸ú¤«¤É¤¦¤«¤òȽÃǤ¹¤ëɬÍפ¬¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ + +.BR mktime () +¤Ï +.I tm +¹½Â¤ÂΤγƥե£¡¼¥ë¥É¤ò°Ê²¼¤Î¤è¤¦¤Ë½¤Àµ¤¹¤ë¡£ +.I tm_wday +¤È +.I tm_yday +¤Ë¤Ï¾¤Î¥Õ¥£¡¼¥ë¥É¤ÎÆâÍƤ«¤éµá¤á¤¿ÃͤòÀßÄꤹ¤ë¡£ +¹½Â¤ÂΤÎÍ×ÁǤ¬Í­¸ú¤ÊÈϰϤˤʤ¤¾ì¹ç¡¢Àµµ¬²½¤µ¤ì¤ë +(Î㤨¤Ð¡¢10 ·î 40 Æü¤Ï 11 ·î 9 Æü¤ËÊѹ¹¤µ¤ì¤ë)¡£ +.I tm_isdst +¤Ë¤Ï (ºÇ½é¤ÎÃͤˤ«¤«¤ï¤é¤º) Àµ¤ÎÃͤ« 0 ¤¬ÀßÄꤵ¤ì¤ë¡£ +Àµ¤ÎÃͤϻØÄꤵ¤ì¤¿»þ´Ö¤Ç²Æ»þ´Ö¤¬Í­¸ú¤Ç¤¢¤ë¤³¤È¤ò¼¨¤·¡¢ +0 ¤Ï̵¸ú¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +´Ø¿ô +.BR mktime () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢ +Âç°èÊÑ¿ô \fItzname\fP ¤¬¸½ºß¤Î¥¿¥¤¥à¥¾¡¼¥ó¤ËÀßÄꤵ¤ì¤ë¡£ + +Í×ÁÇÊ̤λþ¹ï¤ò¥«¥ì¥ó¥À¡¼»þ¹ï (µª¸µ (Epoch) ¤«¤é¤ÎÉÿô) ¤Çɽ¸½¤Ç¤­¤Ê¤¤¾ì¹ç¡¢ +.BR mktime () +¤Ï +.I (time_t)\ (-1) +¤òÊÖ¤·¡¢Í×ÁÇÊ̤λþ¹ï¤Î¹½Â¤ÂÎ¥á¥ó¥Ð¡¼¤òÊѹ¹¤·¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ìÁ°½Ò¤·¤¿ÃͤòÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï NULL +.RB ( mktime () +¤Ç¤Ï \-1) ¤òÊÖ¤¹¡£ +.SH ½àµò +POSIX.1-2001. +C89 ¤È C99 ¤Ç¤Ï +.BR asctime (), +.BR ctime (), +.BR gmtime (), +.BR localtime (), +.BR mktime () +¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2008 ¤Ï¡¢ +.BR asctime (), +.BR asctime_r (), +.BR ctime (), +.BR ctime_r () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +Âå¤ï¤ê¤Ë¡¢ +.BR strftime (3) +¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.BR asctime (), +.BR ctime (), +.BR gmtime (), +.BR localtime () +¤Î 4 ¤Ä¤Î´Ø¿ô¤ÏÀÅŪ¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¤Î¤Ç¡¢¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Î¥¹¥ì¥Ã¥É¥»¡¼¥ÕÈǤǤ¢¤ë +.BR asctime_r (), +.BR ctime_r (), +.BR gmtime_r (), +.BR localtime_r () +¤Ï SUSv2 ¤Çµ¬Äꤵ¤ì¤Æ¤ª¤ê¡¢ +libc 5.2.5 °Ê¹ß¤ÇÍøÍѤǤ­¤ë¡£ + +POSIX.1-2001 ¤Ç¤Ï¡¢¡Ö´Ø¿ô +.BR asctime (), +.BR ctime (), +.BR gmtime (), +.BR localtime () +¤Ï¡¢Í×ÁÇÊ̤λþ¹ï¤Î¹½Â¤ÂΤ« +.I char +·¿¤ÎÇÛÎ󤫤ΤɤÁ¤é¤«¤ÎÀÅŪ¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¤â¤Î¤È¤¹¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Î¤¤¤º¤ì¤«¤ò¼Â¹Ô¤¹¤ë¤È¡¢Â¾¤Î´Ø¿ô¤Î¤É¤ì¤«¤¬¤³¤ì¤é¤Î +ÀÅŪ¥ª¥Ö¥¸¥§¥¯¥È¤Î¤É¤Á¤é¤«¤Ë³ÊǼ¤·¤ÆÊÖ¤·¤¿¾ðÊ󤬾å½ñ¤­¤µ¤ì¤ë¤«¤â +¤·¤ì¤Ê¤¤¡£¡×¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤³¤Î¤³¤È¤Ï glibc ¤Î¼ÂÁõ¤Çµ¯¤³¤ê¤¦¤ë¡£ +.LP +glibc ¤ò´Þ¤à¿¤¯¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.I tm_mday +¤Ë 0 ¤ò»ØÄꤹ¤ë¤ÈÁ°·î¤ÎºÇ½ªÆü¤ò°ÕÌ£¤·¤Æ¤¤¤ë¤È²ò¼á¤µ¤ì¤ë¡£ +.LP +glibc ¤Ç¤Ï¡¢ +.I +¤¬¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤ëÁ°¤Ë +.B _BSD_SOURCE +¤¬ÄêµÁ¤µ¤ì¤ë¤È¡¢ +\fIstruct tm\fP ¤Ë°Ê²¼¤Î¥Õ¥£¡¼¥ë¥É¤¬Äɲ䵤ì¤ë¡£ +.sp +.RS +.nf +long tm_gmtoff; /* Seconds east of UTC */ +const char *tm_zone; /* Timezone abbreviation */ +.fi +.RE +.sp +¤³¤ì¤Ï BSD ³ÈÄ¥¤Ç¤¢¤ê¡¢4.3BSD-Reno ¤«¤é¸½¤ì¤¿¡£ + +POSIX.1-2004 ¤Ë¤è¤ë¤È¡¢ +.BR localtime () +¤Ï¤¢¤¿¤«¤â +.BR tzset () +¤¬¸Æ¤Ð¤ì¤¿¤«¤Î¤è¤¦¤Ë¿¶Éñ¤¦¤³¤È¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë¤¬¡¢ +.BR localtime_r () +¤Ë¤Ï¤³¤ÎÍ×·ï¤Ï¤Ê¤¤¡£ +.\" http://thread.gmane.org/gmane.comp.time.tz/2034/ ¤ò»²¾È¡£ +°Ü¿¢À­¤¬É¬Íפʥ³¡¼¥É¤Ç¤Ï¡¢ +.BR localtime_r () +¤ÎÁ°¤Ë +.BR tzset () +¤ò¸Æ¤Ó½Ð¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.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) diff --git a/release/man3/daemon.3 b/release/man3/daemon.3 new file mode 100644 index 00000000..1d21f08e --- /dev/null +++ b/release/man3/daemon.3 @@ -0,0 +1,109 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)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 +.\" +.\"WORD: detach ʬΥ +.\"WORD: controlling terminal À©¸æüËö +.\"WORD: current working directory ¥«¥ì¥ó¥È¡¦¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: global variable Âç°èÊÑ¿ô +.\" +.TH DAEMON 3 2009-12-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +daemon \- ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤ÇÆ°ºî¤µ¤»¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int daemon(int " nochdir ", int " noclose ); +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.SH ÀâÌÀ +.BR daemon () +¤Ï¡¢À©¸æüËö¤«¤éʬΥ¤µ¤»¤Æ¥·¥¹¥Æ¥à¥Ç¡¼¥â¥ó¤È¤·¤ÆÆ°ºî¤µ¤»¤¿¤¤ +¥×¥í¥°¥é¥à¤Î¤¿¤á¤Î´Ø¿ô¤Ç¤¢¤ë¡£ +.PP +.I nochdir +¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR daemon () +¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê (current working directory) +¤ò¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê ("/") ¤ËÊѹ¹¤¹¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.PP +.I noclose +¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR daemon () +¤Ïɸ½àÆþÎÏ¡¦É¸½à½ÐÎÏ¡¦É¸½à¥¨¥é¡¼¤ò \fI/dev/null\fP ¤Ë¥ê¥À¥¤¥ì¥¯¥È¤¹¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +(¤³¤Î´Ø¿ô¤¬ fork ¤·¤Æ +.BR fork (2) +¤¬À®¸ù¤¹¤ë¤È¡¢¿Æ¥×¥í¥»¥¹¤Ç¤Ï +.BR _exit (2) +¤ò¸Æ¤Ó½Ð¤¹¤Î¤Ç¡¢¤³¤ì°Ê¹ß¤Î¥¨¥é¡¼¤Ï»Ò¥×¥í¥»¥¹¤«¤é¤·¤«¸«¤ì¤Ê¤¤)¡£ +.\" ¥¢¥ó¥À¡¼¥¹¥³¥¢ _ ¤Ë²¼Àþ¤ò°ú¤«¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤¿¤á .IR ¤Ï»È¤ï¤Ê¤¤¡£ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR daemon () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.BR daemon () +¤Ï \-1 ¤òÊÖ¤¹¡£ +¤µ¤é¤Ë¡¢ +.I errno +¤Ë +.BR fork (2) +¤È +.BR setsid (2) +¤Ë´Ø¤·¤Æµ¬Äꤵ¤ì¤¿¥¨¥é¡¼¤òÀßÄꤹ¤ë¡£ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +ƱÍͤδؿô¤¬ BSD ¤Ë¤Ï¸«¤é¤ì¤ë¡£ +.BR daemon () +´Ø¿ô¤Ï 4.4BSD ¤Ç»Ï¤á¤ÆÅо줷¤¿¡£ +.SH Ãí°Õ +.I /dev/null +¤Ï¸ºß¤¹¤ë¤¬¡¢ÁÛÄꤹ¤ë¥á¥¸¥ã¡¼ÈÖ¹æ¤È¥Þ¥¤¥Ê¡¼ÈÖ¹æ¤Î +¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹¤Ç¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +glibc ¤Î¼ÂÁõ¤Ç¤â \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤Î¾ì¹ç¡¢ +.I errno +¤¬ÀßÄꤵ¤ì¤ëɬÍפϤʤ¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fork (2), +.BR setsid (2) diff --git a/release/man3/dbopen.3 b/release/man3/dbopen.3 new file mode 100644 index 00000000..d62bb847 --- /dev/null +++ b/release/man3/dbopen.3 @@ -0,0 +1,543 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)dbopen.3 8.5 (Berkeley) 1/2/94 +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito +.\" all rights reserved. +.\" Translated Thu Jul 22 00:00:00 JST 1999 +.\" by Shouichi Saito +.\" Proofed Tue Aug 19 1999 by NAKANO Takeo +.\" +.\"WORD: descriptor ¥Ç¥¹¥¯¥ê¥×¥¿ +.TH DBOPEN 3 1994-01-02 "" "Linux Programmer's Manual" +.UC 7 +.SH ̾Á° +dbopen \- ¥Ç¡¼¥¿¥Ù¡¼¥¹¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include + +.BI "DB *dbopen(const char *" file ", int " flags ", int " mode \ +", DBTYPE " type , +.BI " const void *" openinfo ); +.fi +.SH ÀâÌÀ +.BR dbopen () +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï btree, hash, +UNIX ¥Õ¥¡¥¤¥ë¤Ë»Ø¸þ¤·¤¿¥Õ¥©¡¼¥Þ¥Ã¥È, ¤Î 3 ¤Ä¤Ç¤¢¤ë¡£ +btree ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢¥½¡¼¥È¤µ¤ì¤¿¥Ð¥é¥ó¥¹¥Ä¥ê¡¼¹½Â¤¤Ç¤¢¤ë¡£ +hashed ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢³ÈÄ¥²Äǽ¤ÊưŪ hash ¥¹¥­¡¼¥à¤Ç¤¢¤ë¡£ +¥Õ¥é¥Ã¥È¥Õ¥¡¥¤¥ë (flat-file) ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢ +¸ÇÄêĹ/²ÄÊÑĹ¤Î¥ì¥³¡¼¥É¤«¤é¤Ê¤ë¥Ð¥¤¥È¥¹¥È¥ê¡¼¥à¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤È¡¢¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤ËÆÃÍ­¤Î¾ðÊó¤Ï +¤½¤ì¤¾¤ìÂбþ¤¹¤ë¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸ +.BR btree (3), +.BR hash (3), +.BR recno (3) +¤Ë¾ÜºÙ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.BR dbopen () +¤Ï +.I file +¤òÆɤ߹þ¤ß (Æɤ߽ñ¤­) ¤¹¤ë¤¿¤á¤Ë¥ª¡¼¥×¥ó¤¹¤ë¡£ +.I file +°ú¤­¿ô¤ò NULL ¤Ë¤¹¤ì¤Ð¡¢ +¥Ç¥£¥¹¥¯¾å¤ËÊݸ¤·¤¿¤¯¤Ê¤¤¥Õ¥¡¥¤¥ë¤òºî¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.PP +.I flags +¤È +.I mode +°ú¤­¿ô¤Ï +.BR open (2) +¥ë¡¼¥Á¥ó¤Ç»ØÄꤹ¤ë¤Î¤ÈƱÍͤǤ¢¤ë¡£¤¿¤À¤· +°ÕÌ£¤ò»ý¤Ä¥Õ¥é¥°¤Ï +.BR O_CREAT , +.BR O_EXCL , +.BR O_EXLOCK , +.BR O_NONBLOCK , +.BR O_RDONLY , +.BR O_RDWR , +.BR O_SHLOCK , +.B O_TRUNC +¤À¤±¤Ç¤¢¤ë¡£ +(Ãí°Õ: +.B O_WRONLY +¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ò³«¤¯»ö¤Ï½ÐÍè¤Ê¤¤) +.\"Three additional options may be specified by +.\".IR or 'ing +.\"them into the +.\".I flags +.\"argument. +.\".TP +.\"DB_LOCK +.\"Do the necessary locking in the database to support concurrent access. +.\"If concurrent access isn't needed or the database is read-only this +.\"flag should not be set, as it tends to have an associated performance +.\"penalty. +.\".TP +.\"DB_SHMEM +.\"Place the underlying memory pool used by the database in shared +.\"memory. +.\"Necessary for concurrent access. +.\".TP +.\"DB_TXN +.\"Support transactions in the database. +.\"The DB_LOCK and DB_SHMEM flags must be set as well. +.PP +.I type +°ú¤­¿ô¤Ï +.I DBTYPE +·¿¤Ç¤¢¤ë (¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +.BR DB_BTREE , +.BR DB_HASH , +.B DB_RECNO +¤Î¤¤¤º¤ì¤«¤ò¥»¥Ã¥È¤Ç¤­¤ë¡£ +.PP +.I openinfo +°ú¤­¿ô¤Ï¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ë¸ÇÍ­¤Ê¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¹½Â¤ÂΤ˴ؤ·¤Æ¤Ï³Æ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Î +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.I openinfo +¤¬ NULL ¤Î¾ì¹ç¡¢¤½¤ì¤¾¤ì¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤È¥·¥¹¥Æ¥à¤È¤ËŬ¹ç¤·¤¿ +¥Ç¥Õ¥©¥ë¥È¤¬ÍѤ¤¤é¤ì¤ë¡£ +.PP +.BR dbopen () +¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç +.I DB +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò¡¢¥¨¥é¡¼¤Î¾ì¹ç NULL ¤òÊÖ¤¹¡£ +.I DB +¹½Â¤ÂÎ¤Ï +.I +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤ÎÃæ¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +¾¯¤Ê¤¯¤È¤â°Ê²¼¤Î¤è¤¦¤Ê¥Õ¥£¡¼¥ë¥É¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +typedef struct { + DBTYPE type; + int (*close)(const DB *db); + int (*del)(const DB *db, const DBT *key, unsigned int flags); + int (*fd)(const DB *db); + int (*get)(const DB *db, DBT *key, DBT *data, + unsigned int flags); + int (*put)(const DB *db, DBT *key, const DBT *data, + unsigned int flags); + int (*sync)(const DB *db, unsigned int flags); + int (*seq)(const DB *db, DBT *key, DBT *data, + unsigned int flags); +} DB; +.fi +.in +.PP +³ÆÍ×ÁǤˤϡ¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¿¥¤¥×¤È¡¢ +ÍÍ¡¹¤ÊÆ°ºî¤ò¤¹¤ë´Ø¿ô¤Î¥»¥Ã¥È¤¬µ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.BR dbopen () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò°ú¤­¿ô¤Ë¤È¤ë¡£ +¥­¡¼/¥Ç¡¼¥¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ä¥Õ¥é¥°Ãͤò¼è¤ë¤â¤Î¤â¤¢¤ë¡£ +.TP +.I type +ÍѤ¤¤é¤ì¤Æ¤¤¤ë¥¢¥¯¥»¥¹¥á¥½¥Ã¥É (¤È¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È) ¤Î·¿¡£ +.TP +.I close +¥­¥ã¥Ã¥·¥å¤µ¤ì¤¿¾ðÊó¤ò¥Ç¥£¥¹¥¯¤ËÁݤ­¤À¤¹¤¿¤á¤Î¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +³ä¤êÅö¤Æ¤é¤ì¤¿¥ê¥½¡¼¥¹¤ò²òÊü¤·¡¢ÍøÍѤ·¤¿¥Õ¥¡¥¤¥ë(·²)¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +¥­¡¼/¥Ç¡¼¥¿ÂФ¬¥á¥â¥ê¤Ë¥­¥ã¥Ã¥·¥å¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.I close +¤ä +.I sync +´Ø¿ô¤Ç¤ÎƱ´ü¤Ë¼ºÇÔ¤¹¤ë¤È¡¢¾ðÊó¤ËÌ·½â¤¬À¸¤¸¤ë¤«¾ðÊó¤ò¼º¤¦²ÄǽÀ­¤¬¤¢¤ë¡£ +.I close +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +.TP +.I del +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥­¡¼/¥Ç¡¼¥¿ÂФòºï½ü¤¹¤ë¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.IP +.I flag +°ú¤­¿ô¤Ï¼¡¤ÎÃͤ¬¥»¥Ã¥È¤Ç¤­¤ë¡£ +.RS +.TP +.B R_CURSOR +¥«¡¼¥½¥ë (cursor) ¤¬»²¾È¤·¤Æ¤¤¤ë¥ì¥³¡¼¥É¤òºï½ü¤¹¤ë¡£ +¥«¡¼¥½¥ë¤ÏÁ°¤â¤Ã¤Æ½é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.RE +.IP +.I delete +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¤Þ¤¿»ØÄê¤Î +.I key +¤¬¥Õ¥¡¥¤¥ëÃæ¤Ë̵¤¤¾ì¹ç 1 ¤òÊÖ¤¹¡£ +.TP +.I fd +ÍѤ¤¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¥ë¡¼¥Á¥ó +¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +Ʊ¤¸¥Õ¥¡¥¤¥ë̾ +.I file +¤Ç +.BR dbopen () +¤ò¸Æ¤Ó½Ð¤·¤¿Á´¤Æ¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤ò¼¨¤¹Ã±°ì¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤Ï¥í¥Ã¥¯´Ø¿ô +.BR fcntl (2) +¤È +.BR flock (2) +¤Ø¤Î°ú¤­¿ô¤È¤·¤Æ°ÂÁ´¤Ë»ÈÍѤǤ­¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤Ï¡¢É¬¤º¤·¤â¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ç +ÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Î¤¤¤º¤ì¤«¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤Ê¤¯¤Æ¤âÎɤ¤¡£ +¥á¥â¥êÆâ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ï¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤Ï̵¤¤¡£ +.I fd +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢À®¸ù¤¹¤ë¤È¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.TP +.I get +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥­¡¼¤òÍѤ¤¤Æ¥Ç¡¼¥¿¤ò¼è¤ê½Ð¤¹¤¿¤á¤Î +¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +»ØÄꤷ¤¿ +.I key +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥Ç¡¼¥¿¤Î¥¢¥É¥ì¥¹¤ÈŤµ¤¬ +.I data +¤¬»²¾È¤¹¤ë¹½Â¤ÂΤËÊÖ¤µ¤ì¤ë¡£ +.I get +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¤Þ¤¿ +.I key +¤¬¥Õ¥¡¥¤¥ëÃæ¤Ë̵¤¤¾ì¹ç 1 ¤òÊÖ¤¹¡£ +.TP +.I put +¥­¡¼/¥Ç¡¼¥¿ÂФò¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËǼ¤á¤ë¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.IP +.I flag +°ú¤­¿ô¤Ë¤Ï¼¡¤ÎÃͤΤ¦¤Á¤Î¤É¤ì¤«°ì¤Ä¤¬¥»¥Ã¥È¤Ç¤­¤ë¡£ +.RS +.TP +.B R_CURSOR +¥«¡¼¥½¥ë¤¬»²¾È¤·¤Æ¤¤¤ë¥­¡¼/¥Ç¡¼¥¿ÂФòÃÖ¤­´¹¤¨¤ë¡£ +¥«¡¼¥½¥ë¤ÏÁ°¤â¤Ã¤Æ½é´ü²½¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +.TP +.B R_IAFTER +.I key +¤Ç»²¾È¤µ¤ì¤ë¥Ç¡¼¥¿¤Îľ¸å¤Ë¡¢ +¿·¤·¤¤¥­¡¼/¥Ç¡¼¥¿ÂФòºî¤Ã¤Æ¥Ç¡¼¥¿¤òÄɲ乤롣 +Äɲ䵤줿¥­¡¼/¥Ç¡¼¥¿ÂФΥ쥳¡¼¥ÉÈÖ¹æ¤Ï +.I key +¹½Â¤ÂΤËÊÖ¤µ¤ì¤ë¡£ +.RB ( DB_RECNO +¥¢¥¯¥»¥¹ÊýË¡¤Ç¤Î¤ß»È¤¨¤ë¡£) +.TP +.B R_IBEFORE +.I key +¤Ç»²¾È¤µ¤ì¤ë¥Ç¡¼¥¿¤ÎľÁ°¤Ë¡¢ +¿·¤·¤¤¥­¡¼/¥Ç¡¼¥¿ÂФòºî¤Ã¤Æ¥Ç¡¼¥¿¤òÁÞÆþ¤¹¤ë¡£ +Äɲ䵤줿¥­¡¼/¥Ç¡¼¥¿ÂФΥ쥳¡¼¥ÉÈÖ¹æ¤Ï +.I key +¹½Â¤ÂΤËÊÖ¤µ¤ì¤ë¡£ +.RB ( DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ç¤Î¤ß»È¤¨¤ë¡£) +.TP +.B R_NOOVERWRITE +¥­¡¼¤¬¤¢¤é¤«¤¸¤á¸ºß¤·¤Ê¤¤¾ì¹ç¤Ë¸Â¤ê¡¢¿·¤·¤¤¥­¡¼/¥Ç¡¼¥¿ÂФò¤¤¤ì¤ë¡£ +.TP +.B R_SETCURSOR +¥­¡¼/¥Ç¡¼¥¿ÂФòǼ¤á¡¢¤½¤ì¤ò»Ø¤¹¤è¤¦¤Ë¥«¡¼¥½¥ë°ÌÃÖ¤ò¥»¥Ã¥È¤¢¤ë¤¤¤Ï½é´ü +²½¤¹¤ë¡£ +.RB ( DB_BTREE +¤È +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ç¤Î¤ß»È¤¨¤ë¡£) +.RE +.IP +.B R_SETCURSOR +¤Ï +.B DB_BTREE +¤È +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ç¤·¤«ÍøÍѤǤ­¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é +.B R_SETCURSOR +¤òÍѤ¤¤ë¤Ë¤Ï¡¢Êѹ¹¤µ¤ì¤ë»ö¤Î̵¤¤¸ÇÍ­¤Î½ç½ø¤ò¥­¡¼ +¤¬»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.IP +.B R_IAFTER +¤È +.B R_IBEFORE +¤Ï +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ç¤·¤«ÍøÍѤǤ­¤Ê¤¤¡£ +¤³¤ì¤é¤ò¼Â¸½¤¹¤ë¤Ë¤Ï¡¢¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤¬ +¿·¤·¤¤¥­¡¼¤òºî¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +¤³¤ì¤¬À®Î©¤¹¤ë¤Î¤Ï¡¢Î㤨¤Ð¡¢½ç½ø¤Å¤±¤é¤¿ÆÈΩ¤Ê¥ì¥³¡¼¥ÉÈֹ椬 +¥­¡¼¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤è¤¦¤Ê¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +.IP +.I put +¥ë¡¼¥Á¥ó¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¡¢¿·¤·¤¤¥­¡¼/¥Ç¡¼¥¿ÂФò +´û¤Ë¸ºß¤¹¤ë¥­¡¼¤òÃÖ¤­´¹¤¨¤ë»ö¤Æ³ÊǼ¤¹¤ëÆ°ºî¤Ç¤¢¤ë¡£ +.IP +.I put +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¤Þ¤¿ +.I flag +¤Ë +.B R_NOOVERWRITE +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Æ¥­¡¼¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç 1 ¤òÊÖ¤¹¡£ +.TP +.I seq +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥·¡¼¥±¥ó¥·¥ã¥ë¤Ë¥Ç¡¼¥¿¤ò¼è¤ê½Ð¤¹¤¿¤á¤Î +¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +¥­¡¼¤Î¥¢¥É¥ì¥¹¤ÈŤµ¤¬ +.I key +¤¬»²¾È¤¹¤ë¹½Â¤ÂΤËÊÖ¤µ¤ì¤ë¡£¥Ç¡¼¥¿¤Î¥¢¥É¥ì¥¹¤ÈŤµ¤¬ +.I data +¤¬»²¾È¤¹¤ë¹½Â¤ÂΤËÊÖ¤µ¤ì¤ë¡£ +.IP +¥·¡¼¥±¥ó¥·¥ã¥ë¤Ê¥­¡¼/¥Ç¡¼¥¿ÂФμèÆÀ¤Ï¤¤¤Ä¤Ç¤â¹Ô¤¨¤ë¡£¤Þ¤¿ +¡Ö¥«¡¼¥½¥ë¡×¤Î°ÌÃÖ¤Ï +.IR del , +.IR get , +.IR put , +.I sync +¥ë¡¼¥Á¥ó¤Î¸Æ¤Ó½Ð¤·¤Ë¤Ï±Æ¶Á¤µ¤ì¤Ê¤¤¡£ +¥·¡¼¥±¥ó¥·¥ã¥ë¤Ê¥¹¥­¥ã¥ó¤ÎÅÓÃæ¤Ë¹Ô¤ï¤ì¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÊѹ¹¤Ï +¥¹¥­¥ã¥ó¤ËÈ¿±Ç¤µ¤ì¤ë¡£¤¹¤Ê¤ï¤Á¡¢¥«¡¼¥½¥ë¤Î¸å¤í¤ËÁÞÆþ¤µ¤ì¤¿¥ì¥³¡¼¥É¤Ï +ÊÖ¤µ¤ì¤Ê¤¤¤¬¡¢¥«¡¼¥½¥ë¤ÎÁ°¤ËÁÞÆþ¤µ¤ì¤¿¥ì¥³¡¼¥É¤ÏÊÖ¤µ¤ì¤ë¡£ +.IP +¥Õ¥é¥°ÃͤˤÏ\fBɬ¤º\fP°Ê²¼¤Ë¼¨¤¹¤¦¤Á¤Î +¤É¤ì¤«°ì¤Ä¤ò¥»¥Ã¥È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.RS +.TP +.B R_CURSOR +»ØÄꤷ¤¿¥­¡¼¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥Ç¡¼¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +.I get +¥ë¡¼¥Á¥ó¤È¤Î°ã¤¤¤Ï¡¢¥«¡¼¥½¥ë¤¬¥­¡¼¤Î°ÌÃ֤˥»¥Ã¥È¤¢¤ë¤¤¤Ï +½é´ü²½¤µ¤ì¤ëÅÀ¤Ç¤¢¤ë¡£ +(Ãí°Õ: +.B DB_BTREE +¥¢¥¯¥»¥¹ÊýË¡¤Ç¤Ï¡¢ÊÖ¤µ¤ì¤¿¥­¡¼¤¬ +ɬ¤º¤·¤â»ØÄꤷ¤¿¥­¡¼¤ËÀµ¤·¤¯¥Þ¥Ã¥Á¤·¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +ÊÖ¤µ¤ì¤¿¥­¡¼¤Ï¡¢»ØÄꤵ¤ì¤¿¥­¡¼¤ËÅù¤·¤¤¤«¤è¤êÂ礭¤¤¤â¤Î¤Î¤¦¤Á +ºÇ¾®¤Î¤â¤Î¤Ë¤Ê¤ë +(Éôʬ¥­¡¼¥Þ¥Ã¥Á¤«Èϰϸ¡º÷¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë¾ì¹ç)¡£) +.TP +.B R_FIRST +¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎºÇ½é¤Î¥­¡¼/¥Ç¡¼¥¿ÂФ¬ÊÖ¤µ¤ì¤ë¡£ +¥«¡¼¥½¥ë¤Ï¤½¤ì¤ò»²¾È¤¹¤ë¤è¤¦¤Ë¥»¥Ã¥È¤Þ¤¿¤Ï½é´ü²½¤µ¤ì¤ë¡£ +.TP +.B R_LAST +¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎºÇ¸å¤Î¥­¡¼/¥Ç¡¼¥¿ÂФ¬ÊÖ¤µ¤ì¤ë¡£¥«¡¼¥½¥ë¤Ï¤½¤ì¤ò»²¾È¤¹¤ë +¤è¤¦¤Ë¥»¥Ã¥È¤Þ¤¿¤Ï½é´ü²½¤µ¤ì¤ë¡£ +.RB ( DB_BTREE +¤È +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤À¤±¤Ç»È¤¨¤ë¡£) +.TP +.B R_NEXT +¥«¡¼¥½¥ëľ¸å¤Î¥­¡¼/¥Ç¡¼¥¿ÂФò¼èÆÀ¤¹¤ë¡£ +¥«¡¼¥½¥ë¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï +.B R_FIRST +¥Õ¥é¥°¤ÈƱ¤¸¡£ +.TP +.B R_PREV +¥«¡¼¥½¥ëľÁ°¤Î¥­¡¼/¥Ç¡¼¥¿ÂФò¼èÆÀ¤¹¤ë¡£ +¥«¡¼¥½¥ë¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï +.B R_LAST +¥Õ¥é¥°¤ÈƱ¤¸¡£ +.RB ( DB_BTREE +¤È +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤À¤±¤Ç»È¤¨¤ë¡£) +.RE +.IP +.B R_LAST +¤È +.B R_PREV +¤Ï¡¢ +.B DB_BTREE +¤È +.B DB_RECNO +¥¢¥¯¥»¥¹ÊýË¡¤Ç¤·¤«»È¤¨¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é +.B R_SETCURSOR +¤òÍѤ¤¤ë¤Ë¤Ï¡¢Êѹ¹¤µ¤ì¤ë»ö¤Î̵¤¤¸ÇÍ­¤Î½ç½ø¤ò¥­¡¼¤¬»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.IP +.I seq +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢ +À®¸ù¤Î¾ì¹ç 0 ¤òÊÖ¤¹¡£ +»ØÄꤷ¤¿¥­¡¼¤ä¥«¥ì¥ó¥È¥­¡¼¤è¤ê¤âÂ礭¤¤/¾®¤µ¤¤¥­¡¼/¥Ç¡¼¥¿ÂФ¬¤Ê¤¤¾ì¹ç¤Ï +1 ¤òÊÖ¤¹¡£ +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤ò»È¤Ã¤Æ¤¤¤Æ¡¢ +¤«¤Ä¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤¬Ê¸»ú·¿¤Î¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ç¡¢ +´°À®¤·¤Æ¤¤¤ë¥­¡¼/¥Ç¡¼¥¿ÂФ¬Ìµ¤¤¾ì¹ç¤Ë¤Ï¡¢ +.I seq +¥ë¡¼¥Á¥ó¤Ï 2 ¤òÊÖ¤¹¡£ +.TP +.I sync +¥­¥ã¥Ã¥·¥å¤µ¤ì¤¿¾ðÊó¤ò¥Ç¥£¥¹¥¯¤ËÁݤ­½Ð¤¹¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¥á¥â¥ê¤ÎÃæ¤À¤±¤Ë¤¢¤ë¾ì¹ç¡¢ +.I sync +¥ë¡¼¥Á¥ó¤Ï²¿¤Î¸ú²Ì¤â¤Ê¤¯¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.IP +flag ¤Ë¤Ï°Ê²¼¤ÎÃͤ¬¥»¥Ã¥È¤Ç¤­¤ë¡£ +.RS +.TP +.B R_RECNOSYNC +.B DB_RECNO +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë +¤³¤Î¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢ +recno ¥Õ¥¡¥¤¥ë¤½¤Î¤â¤Î¤Ë¤Ç¤Ï¤Ê¤¯¡¢ +¤½¤Î¥Ù¡¼¥¹¤Ë¤Ê¤Ã¤Æ¤¤¤ë btree ¥Õ¥¡¥¤¥ë¤Ë sync ¤¬¹Ô¤ï¤ì¤ë¡£ +(¾ÜºÙ¤Ï +.BR recno (3) +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç +.I bfname +¥Õ¥£¡¼¥ë¥É¤òÀâÌÀ¤·¤Æ¤¤¤ëÉôʬ¤ò»²¾È¤Î¤³¤È¡£) +.RE +.IP +.I sync +¥ë¡¼¥Á¥ó¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤· +.RI ( errno +¤ò¥»¥Ã¥È¤¹¤ë)¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +.SS ¥­¡¼/¥Ç¡¼¥¿ÂÐ +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤Ë¤ª¤¤¤Æ¡¢ +¥­¡¼/¥Ç¡¼¥¿ÂФò¥Ù¡¼¥¹¤Ë¤·¤Æ¥¢¥¯¥»¥¹¤¬¹Ô¤ï¤ì¤ë¡£ +¥­¡¼¤È¥Ç¡¼¥¿¤Î¤¤¤º¤ì¤â¡¢¼¡¤Î¥Ç¡¼¥¿¹½Â¤¤Çµ­½Ò¤µ¤ì¤ë¡£ +.in +4n +.nf + +typedef struct { + void *data; + size_t size; +} DBT; +.fi +.in +.I DBT +¹½Â¤ÂΤγÆÍ×ÁǤϼ¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.I data +¥Ð¥¤¥Èʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.TP +.I size +¥Ð¥¤¥Èʸ»úÎó¤ÎŤµ¡£ +.PP +¥­¡¼¤È¥Ç¡¼¥¿¤Î¥Ð¥¤¥Èʸ»úÎó¤Ï¡¢ +´ðËÜŪ¤Ë¤Ï̵À©¸Â¤ÎŤµ¤Îʸ»úÎó¤ò»²¾È¤Ç¤­¤ë¤¬¡¢ +¤·¤«¤·¤¤¤º¤ì¤â»ÈÍѲÄǽ¤Ê¥á¥â¥ê¤Ë¼ý¤Þ¤Ã¤Æ¤¤¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ï¥Ð¥¤¥Èʸ»úÎó¤Î¥¢¥é¥¤¥ó¥á¥ó¥È¤Ë¤Ä¤¤¤Æ¤Ï +²¿¤âÊݾڤ·¤Æ¤¤¤Ê¤¤»ö¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH ¥¨¥é¡¼ +.BR dbopen () +¥ë¡¼¥Á¥ó¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR open (2) +¤È +.BR malloc (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£¤¢¤ë¤¤¤Ï°Ê²¼¤ò¥»¥Ã¥È¤¹¤ë¡£ +.TP +.B [EFTYPE] +¥Õ¥¡¥¤¥ë¤¬Àµ¤·¤¯¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B [EINVAL] +»ØÄꤷ¤¿¥Ñ¥é¥á¡¼¥¿(¥Ï¥Ã¥·¥å´Ø¿ô¡¢¥Ð¥¤¥ÈËä¤á¤Ê¤É)¤¬¸½ºß¤Î¥Õ¥¡¥¤¥ë»ÅÍÍ¤Ë +¹ç¤Ã¤Æ¤¤¤Ê¤¤¡¢¥Ñ¥é¥á¡¼¥¿¤¬´Ø¿ô¤Ë¤È¤Ã¤Æ̵°ÕÌ£ +(Î㤨¤Ð¤¢¤é¤«¤¸¤á½é´ü²½¤·¤Ê¤¤¤Ç¥«¡¼¥½¥ë¤ò»È¤¦¤È¤«)¡¢ +¥Õ¥¡¥¤¥ë¤È¥½¥Õ¥È¥¦¥§¥¢¤Î¥Ð¡¼¥¸¥ç¥ó¤¬¹ç¤Ã¤Æ¤¤¤Ê¤¤¡£ +.PP +.I close +¥ë¡¼¥Á¥ó¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR close (2), +.BR read (2), +.BR write (2), +.BR free (3), +.BR fsync (2) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.IR del , +.IR get , +.I put +¤È +.I seq +¥ë¡¼¥Á¥ó¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR read (2), +.BR write (2), +.BR free (3), +.BR malloc (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.I fd +¥ë¡¼¥Á¥ó¤Ï¥á¥â¥êÆâ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ·¼ºÇÔ¤¹¤ë¤È +.I errno +¤Ë +.B ENOENT +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.I sync +¥ë¡¼¥Á¥ó¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR fsync (2) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥Ð¥° +typedef +.I DBT +¤Ï ``data base thang''¤Îά¸ì¤Ç¤¢¤ë¤¬¡¢¤³¤ì¤¬»È¤ï¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢ +¤Þ¤À»È¤ï¤ì¤Æ¤¤¤Ê¤¤ÂÅÅö¤Ê̾Á°¤¬»×¤¤ÉÕ¤«¤Ê¤«¤Ã¤¿¤¿¤á¤Ç¤¢¤ë¡£ +.PP +¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤ò»È¤Ã¤¿¤ä¤ê¤È¤ê¤Ï¤Ò¤É¤¤Âåʪ¤Ç¤¢¤ê¡¢ +¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ïºï½ü¤µ¤ì¤ë¤À¤í¤¦¡£ +.PP +¤É¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤â¡¢Æ±»þ¥¢¥¯¥»¥¹¡¢¥í¥Ã¥¯¡¢¥È¥é¥ó¥¶¥¯¥·¥ç¥ó +¤Î»ÅÁȤߤÏÈ÷¤¨¤Æ¤¤¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR btree (3), +.BR hash (3), +.BR mpool (3), +.BR recno (3) +.sp +.IR "LIBTP: Portable, Modular Transactions for UNIX" , +Margo Seltzer, Michael Olson, USENIX proceedings, Winter 1992. diff --git a/release/man3/des_crypt.3 b/release/man3/des_crypt.3 new file mode 100644 index 00000000..21660e1b --- /dev/null +++ b/release/man3/des_crypt.3 @@ -0,0 +1,134 @@ +.\" @(#)des_crypt.3 2.1 88/08/11 4.0 RPCSRC; from 1.16 88/03/02 SMI; +.\" +.\" Taken from libc4 sources, which say: +.\" Copyright (C) 1993 Eric Young - can be distributed under GPL. +.\" +.\" However, the above header line suggests that this file in fact is +.\" 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" +.SH ̾Á° +des_crypt, ecb_crypt, cbc_crypt, des_setparity, DES_FAILED \- ¹â®¤Ê DES °Å¹æ²½ +.SH ½ñ¼° +.nf +.\" Sun ¤Î¾ì¹ç¤Ï +.\" .B #include +.B #include +.LP +.BI "int ecb_crypt(char *" key ", char *" data ", unsigned " datalen , +.BI " unsigned " mode ); +.LP +.BI "int cbc_crypt(char *" key ", char *" data ", unsigned " datalen , +.BI " unsigned " mode ", char *" ivec ); +.LP +.BI "void des_setparity(char *" key ); +.LP +.BI "int DES_FAILED(int " status ); +.fi +.SH ÀâÌÀ +.BR ecb_crypt () +¤È +.BR cbc_crypt () +¤Ï +NBS +DES +(Data Encryption Standard, ¥Ç¡¼¥¿°Å¹æ²½µ¬³Ê) ¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥ë¡¼¥Á¥ó¤Ï +.BR crypt (3) +¤è¤ê¤â¹â®¤Ç¤è¤ê°ìÈÌŪ¤ÊÌÜŪ¤Ë»ÈÍѤǤ­¤ë¡£ +ÍøÍѲÄǽ¤Ç¤¢¤ì¤Ð¡¢¤³¤ì¤é¤Î¥ë¡¼¥Á¥ó¤Ï +DES +¥Ï¡¼¥É¥¦¥§¥¢¤ò»ÈÍѤ¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.BR ecb_crypt () +¤Ï +ECB +(Electronic Code Book) ¥â¡¼¥É¤Ç°Å¹æ²½¤¹¤ë¡£ +¤³¤Î¥â¡¼¥É¤Ç¤Ï (¸Ä¡¹¤Î) ¥Ç¡¼¥¿¤Î¥Ö¥í¥Ã¥¯¤òÆÈΩ¤·¤Æ°Å¹æ²½¤¹¤ë +.BR cbc_crypt () +¤Ï +CBC +(Cipher Block Chaining) ¥â¡¼¥É¤Ç°Å¹æ²½¤¹¤ë¡£ +¤³¤Î¥â¡¼¥É¤Ç¤ÏϢ³¤¹¤ë¥Ö¥í¥Ã¥¯¤ò¸ß¤¤¤ËÏ¢º¿¤µ¤»¤Æ°Å¹æ²½¤¹¤ë¡£ +CBC +¤Ï¥Ö¥í¥Ã¥¯¤ÎÁÞÆþ¡¦ºï½ü¡¦ÃÖ¤­´¹¤¨¤«¤éÊݸ¤ë¡£ +¤Þ¤¿Ê¿Ê¸¤Îµ¬Â§À­¤¬°Å¹æʸ¤Ë¸½¤ì¤Ê¤¤¡£ +.LP +¤³¤ì¤é¤Î¥ë¡¼¥Á¥ó¤Î»ÈÍÑË¡¤ò¼¨¤¹¡£ +Âè 1 °ú¤­¿ô +.I key +¤Ï¥Ñ¥ê¥Æ¥£ÉÕ¤­¤Î 8 ¥Ð¥¤¥È¤Î°Å¹æ²½¸°¤Ç¤¢¤ë¡£ +¸°¤Î¥Ñ¥ê¥Æ¥£¤òÀßÄꤹ¤ë¤Ë¤Ï +.BR des_setparity () +¤ò»È¤¦¤³¤È¡£ +DES +¤Î¾ì¹ç¡¢¸°¤Î¥Ñ¥ê¥Æ¥£¤Ï³Æ¥Ð¥¤¥È¤ÎºÇ²¼°Ì¥Ó¥Ã¥È¤Ç¤¢¤ë¡£ +Âè 2 °ú¤­¿ô +.I data +¤Ï°Å¹æ²½¤Þ¤¿¤ÏÉü¹æ²½¤µ¤ì¤ë¥Ç¡¼¥¿¤ò´Þ¤à¡£ +Âè 3 °ú¤­¿ô +.I datalen +¤Ï +.I data +¤Î¥Ð¥¤¥ÈŤǤ¢¤ê¡¢8 ¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Âè 4 °ú¤­¿ô +.I mode +¤Ï¤¤¤¯¤Ä¤«¤ÎÃͤò OR ¤¹¤ë¤³¤È¤ÇºîÀ®¤¹¤ë¡£ +°Å¹æ²½¤ÎÊý¸þ (ÌõÃð: °Å¹æ²½¤Ê¤Î¤«Éü¹æ²½¤Ê¤Î¤«) ¤ò»ØÄꤹ¤ë¤¿¤á¡¢ +.BR DES_ENCRYPT +¤Þ¤¿¤Ï +.BR DES_DECRYPT +¤ò OR ¤¹¤ë¡£ +°Å¹æ²½¤ò¥½¥Õ¥È¥¦¥§¥¢¤Ç¹Ô¤¦¤«¥Ï¡¼¥É¥¦¥§¥¢¤Ç¹Ô¤¦¤«¤ò»ØÄꤹ¤ë¤¿¤á¡¢ +.BR DES_HW +¤Þ¤¿¤Ï +.BR DES_SW +¤ò OR ¤¹¤ë¡£ +.BR DES_HW +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢¤«¤Ä¥Ï¡¼¥É¥¦¥§¥¢¤¬¤Ê¤¤¾ì¹ç¡¢ +°Å¹æ²½¤Ï¥½¥Õ¥È¥¦¥§¥¢¤Ç¼Â¹Ô¤µ¤ì¤Æ¡¢¥ë¡¼¥Á¥ó¤Ï +.BR DESERR_NOHWDEVICE +¤òÊÖ¤¹¡£ +.BR cbc_crypt () +¤Ë¤ª¤¤¤Æ¡¢°ú¤­¿ô +.I ivec +¤Ï¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤òÏ¢º¿¤µ¤»¤ëºÝ¤Î 8 ¥Ð¥¤¥È¤Î½é´ü²½¥Ù¥¯¥È¥ë¤Ç¤¢¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ï¥ë¡¼¥Á¥ó¤«¤éÌá¤ë¤È¤­¤Ë¼¡¤Î½é´ü²½¥Ù¥¯¥È¥ë¤Ë¹¹¿·¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.PD 0 +.TP 20 +.B DESERR_NONE +¥¨¥é¡¼¤Ê¤·¡£ +.TP +.B DESERR_NOHWDEVICE +°Å¹æ²½¤ÏÀ®¸ù¤·¤¿¤¬¡¢Í׵ᤵ¤ì¤¿¥Ï¡¼¥É¥¦¥§¥¢¤ÎÂå¤ï¤ê¤Ë¥½¥Õ¥È¥¦¥§¥¢¤Ç¼Â¹Ô¤µ¤ì¤¿¡£ +.TP +.B DESERR_HWERROR +¥Ï¡¼¥É¥¦¥§¥¢¤Þ¤¿¤Ï¥É¥é¥¤¥Ð¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B DESERR_BADPARAM +¥ë¡¼¥Á¥ó¤Ø¤Î°ú¤­¿ô¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.PD +.LP +·ë²Ì¤Î¾õÂÖ +.I stat +¤òÍ¿¤¨¤¿¤È¤­¡¢¥Þ¥¯¥í +.\" .BR DES_FAILED\c +.\" .BR ( stat ) +.BI DES_FAILED( stat ) +¤¬ false ¤Ë¤Ê¤ë¤Î¤Ï¡¢ºÇ½é¤Î 2 ¤Ä¤À¤±¤Ç¤¢¤ë¡£ +.\" ¤³¤³¤Þ¤Ç¤¬ Sun ¤Î man ¥Ú¡¼¥¸¤Ç¤¢¤ë¡£ +.\" aeb ¤¬¤¤¤¯¤Ä¤«Äɲäò¹Ô¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î¥ë¡¼¥Á¥ó¤Ï libc 4.6.27 °Ê¹ß¤È glibc 2.1 °Ê¹ß¤Ë¸ºß¤¹¤ë¡£ +.SH ½àµò +4.3BSD. POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR des (1), +.BR crypt (3), +.BR xcrypt (3) diff --git a/release/man3/difftime.3 b/release/man3/difftime.3 new file mode 100644 index 00000000..91888283 --- /dev/null +++ b/release/man3/difftime.3 @@ -0,0 +1,80 @@ +.\" 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 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 +.\" +.\"WORD: epoch µª¸µ +.\" +.TH DIFFTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +difftime \- »þ¹ï¤Î´Ö³Ö¤Î·×»» +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double difftime(time_t " time1 ", time_t " time0 ); +.fi +.SH ÀâÌÀ +´Ø¿ô +.BR difftime () +¤Ï»þ¹ï \fItime0\fP ¤«¤é +»þ¹ï \fItime1\fP ¤Þ¤Ç¤Î·Ð²á»þ´Ö¤ò +.I double +·¿¤ÇÊÖ¤¹¡£³Æ¡¹¤Î»þ¹ï¤Ï¥«¥ì¥ó¥À¡¼»þ´Ö¤Ç»ØÄꤹ¤ë¡£ +¤Ä¤Þ¤ê¡¢µª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤Î +·Ð²á»þ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.SH Ãí°Õ +POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï +.I time_t +¤Ï¿ôÃÍ·¿¤Ê¤Î¤Ç¡¢°ú¤­»»¤ÎºÝ¤Ëµ¯¤³¤ë²ÄǽÀ­¤Î¤¢¤ë¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ò +µ¤¤Ë¤·¤Ê¤¤¾ì¹ç¤Ï¡¢Ã±½ã¤Ë +.RS +.nf + +#define difftime(t1,t0) (double)(t1 \- t0) + +.fi +.RE +¤ÈÄêµÁ¤Ç¤­¤ë¡£ +¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥Ç¡¼¥¿·¿ +.I time_t +¤Ë²¿¤«Ê̤Υ¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤¬»È¤ï¤ì¤Æ¤¤¤ë¤³¤È¤¬¤¢¤ê¡¢ +¤½¤Î¾ì¹ç¤Ë¤ÏľÀÜ°ú¤­»»¤ò¹Ô¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR date (1), +.BR gettimeofday (2), +.BR time (2), +.BR ctime (3), +.BR gmtime (3), +.BR localtime (3) diff --git a/release/man3/dirfd.3 b/release/man3/dirfd.3 new file mode 100644 index 00000000..0147db08 --- /dev/null +++ b/release/man3/dirfd.3 @@ -0,0 +1,100 @@ +.\" Copyright (C) 2002 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. +.\" +.\" +.\" 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 +.\" +.TH DIRFD 3 2008-08-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +dirfd \- ¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¹¥È¥ê¡¼¥à¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "int dirfd(DIR *" dirp ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR dirfd (): +_BSD_SOURCE || _SVID_SOURCE +.SH ÀâÌÀ +´Ø¿ô +.BR dirfd () +¤Ï¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¹¥È¥ê¡¼¥à +.I dirp +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.LP +¤³¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¹¥È¥ê¡¼¥à¤¬ÆâÉô¤Ç»ÈÍѤ¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤è¤Ã¤Æ¡¢¥Õ¥¡¥¤¥ë¤Î°ÌÃ֤˰͸¤»¤º¡¢¤«¤Ä¤½¤Î°ÌÃÖ¤òÊѹ¹¤·¤Ê¤¤´Ø¿ô +.BR fstat (2) +¤ä +.BR fchdir (2) +¤Ê¤É¤Ç¤·¤«Ìò¤ËΩ¤¿¤Ê¤¤¡£ +¤³¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.BR closedir (3) +¤¬¸Æ¤Ð¤ì¤¿¤È¤­¤Ë¼«Æ°Åª¤Ë¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢Éé¤Ç¤Ê¤¤ÃͤΥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +POSIX.1-2008 ¤Ç¤Ï 2 ¤Ä¤Î¥¨¥é¡¼¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¤É¤Á¤é¤Î¥¨¥é¡¼¤âÊÖ¤µ¤ì¤Ê¤¤¡£ +.\" glibc 2.8 +.TP +.B EINVAL +.I dirp +¤¬Í­¸ú¤Ê¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¹¥È¥ê¡¼¥à¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTSUP +¤³¤Î¼ÂÁõ¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥Ç¥£¥ì¥¯¥È¥ê¤È¤Î´ØÏ¢ÉÕ¤±¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2008. +¤³¤Î´Ø¿ô¤Ï BSD ³ÈÄ¥¤Ç¤¢¤Ã¤¿¡£ +4.3BSD-Reno ¤Ë¤Ï¸ºß¤¹¤ë¤¬¡¢4.2BSD ¤Ë¤Ï¸ºß¤·¤Ê¤¤¡£ +.\" libc5 (5.1.2 °Ê¹ß) ¤È glibc2 ¤Ë¸ºß¤¹¤ë¡£ +.SH Ãí°Õ +.BR dirfd () +¤Î¥×¥í¥È¥¿¥¤¥×¤¬»ÈÍѲÄǽ¤Ê¤Î¤Ï¡¢ +.B _BSD_SOURCE +¤Þ¤¿¤Ï +.B _SVID_SOURCE +¤¬ÄêµÁ¤µ¤ì¤¿¤È¤­¤Î¤ß¤Ç¤¢¤ë¡£ +.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) diff --git a/release/man3/div.3 b/release/man3/div.3 new file mode 100644 index 00000000..25729b7e --- /dev/null +++ b/release/man3/div.3 @@ -0,0 +1,102 @@ +.\" 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-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 2007-07-26 "" "Linux Programmer's Manual" +.SH ̾Á° +div, ldiv, lldiv, imaxdiv \- integer ·¿¤Î³ä»»¤Î¾¦¤È;¤ê¤ò·×»»¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "div_t div(int " numerator ", int " denominator ); +.br +.BI "ldiv_t ldiv(long " numerator ", long " denominator ); +.br +.BI "lldiv_t lldiv(long long " numerator ", long long " denominator ); +.sp +.B #include +.sp +.BI "imaxdiv_t imaxdiv(intmax_t " numerator ", intmax_t " denominator ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR lldiv (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.SH ÀâÌÀ +.BR div () +´Ø¿ô¤Ï \fInumerator\fP/\fIdenominator\fP ¤ÎÃͤò·×»»¤¹¤ë¡£ +¾¦¤È;¤ê¤Ï¡¢ +\fIquot\fP (¾¦) ¤È \fIrem\fP (;¤ê) ¤È¤¤¤¦Ì¾Á°¤Î 2 ¤Ä¤Î integer ·¿¥á¥ó¥Ð¤ò´Þ¤à +\fIdiv_t\fP ¤È¤¤¤¦¹½Â¤ÂΤÎÃæ¤ËÊÖ¤µ¤ì¤ë +(¥á¥ó¥Ð¤Î½çÈÖ¤ÏÉÔÄê¤Ç¤¢¤ë)¡£ +¾¦¤Ï 0 ¤Ë¶á¤¤Êý¤Ë´Ý¤á¤é¤ì¤ë¡£ +·ë²Ì¤Ï \fIquot\fP*\fIdenominator\fP+\fIrem\fP = \fInumerator\fP ¤òËþ¤¿¤¹¡£ +.LP +.BR ldiv (), +.BR lldiv (), +.BR imaxdiv () +´Ø¿ô¤ÏƱÍͤÊÆ°ºî¤ò¤·¡¢ +¾å¤Ë¼¨¤·¤¿·¿¤Î¿ôÃͤò³ä»»¤·¤Æ¡¢¾å¤Ë¼¨¤·¤¿Ì¾Á°¤Î¹½Â¤ÂΤ˷ë²Ì¤òÊÖ¤¹¡£ +¤É¤Î¾ì¹ç¤Ç¤â¥Õ¥£¡¼¥ë¥É \fIquot\fP ¤È \fIrem\fP ¤Ï¡¢ +´Ø¿ô¤Î°ú¤­¿ô¤ÈƱ¤¸·¿¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +\fIdiv_t\fP (¤Ê¤É¤Î) ¹½Â¤ÂΡ£ +.SH ½àµò +SVr4, 4.3BSD, C89. +´Ø¿ô +.BR lldiv () +¤È +.BR imaxdiv () +¤Ï C99 ¤ËÄɲ䵤줿¡£ +.SH Îã +.nf + + div_t q = div(\-5, 3); + +.fi +¤ò·×»»¤¹¤ë¤È¡¢\fIq.quot\fP ¤È \fIq.rem\fP ¤Ï¤½¤ì¤¾¤ì \-1 ¤È \-2 ¤Ë¤Ê¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR abs (3), +.BR remainder (3) diff --git a/release/man3/dl_iterate_phdr.3 b/release/man3/dl_iterate_phdr.3 new file mode 100644 index 00000000..3790b1f4 --- /dev/null +++ b/release/man3/dl_iterate_phdr.3 @@ -0,0 +1,200 @@ +.\" Copyright (c) 2003 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. +.\" 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" +.SH ̾Á° +dl_iterate_phdr \- ¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Î¥ê¥¹¥È¤òé¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +\fBint dl_iterate_phdr(\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 +.SH ÀâÌÀ +.BR dl_iterate_phdr () +´Ø¿ô¤ò»È¤¦¤È¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¼Â¹Ô»þ¤Ë +¤É¤Î¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤ò¥í¡¼¥É¤·¤¿¤«¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.BR dl_iterate_phdr () +´Ø¿ô¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Î¥ê¥¹¥È¤òé¤ê¡¢ +³Æ¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ·¤Æ´Ø¿ô +.I callback +¤ò 1 ²ó¤º¤Ä¸Æ¤Ó½Ð¤¹¡£ +¤³¤ì¤ÏÁ´¤Æ¤Î¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤¬½èÍý¤µ¤ì¤ë¤«¡¢ +.I callback +¤¬ 0 °Ê³°¤ÎÃͤòÊÖ¤¹¤Þ¤Ç¹Ô¤ï¤ì¤ë¡£ + +³Æ¡¹¤Î +.I callback +¸Æ¤Ó½Ð¤·¤Ï 3 ¤Ä¤Î°ú¤­¿ô¤ò¼õ¤±¼è¤ë: +.I info +¤Ï¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Î¾ðÊó¤òÊÝ»ý¤¹¤ë¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I size +¤Ï +.I info +¤Ç»Ø¤µ¤ì¤ë¹½Â¤ÂΤΥµ¥¤¥º¤Ç¤¢¤ë¡£ +.I data +¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥°¥é¥à¤«¤é +.BR dl_iterate_phdr () +¤Î¸Æ¤Ó½Ð¤·¤Î (Ʊ¤¸¤¯ +.I data +¤È¤¤¤¦Ì¾Á°¤Î) Âè 2 °ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¤ëÃͤΥ³¥Ô¡¼¤Ç¤¢¤ë¡£ + +.I info +°ú¤­¿ô¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê·¿¤Î¹½Â¤ÂΤǤ¢¤ë¡£ + +.in +4n +.nf +struct dl_phdr_info { + ElfW(Addr) dlpi_addr; /* ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹ */ + const char *dlpi_name; /* (null ʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿) + ¥ª¥Ö¥¸¥§¥¯¥È̾ */ + const ElfW(Phdr) *dlpi_phdr; /* ¤³¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Î + ELF ¥×¥í¥°¥é¥à¥Ø¥Ã¥À¤Î + ÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ */ + ElfW(Half) dlpi_phnum; /* \fIdlpi_phdr\fP ¤Î¥¢¥¤¥Æ¥à¿ô */ +}; +.fi +.in + +.RI ( ElfW () +¥Þ¥¯¥íÄêµÁ¤Ï°ú¤­¿ô¤ò¥Ï¡¼¥É¥¦¥§¥¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ËŬ¤·¤¿ +ELF ¥Ç¡¼¥¿·¿¤Î̾Á°¤ËÊÑ´¹¤¹¤ë¡£ +¤¿¤È¤¨¤Ð¡¢32 ¥Ó¥Ã¥È¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤Ï +ElfW(Addr) ¤Ï¥Ç¡¼¥¿·¿Ì¾ Elf32_Addr ¤òÀ¸À®¤¹¤ë¡£ +¤³¤ì¤é¤Î·¿¤Ë¤Ä¤¤¤Æ¤Î¹¹¤Ë¾ÜºÙ¤Ê¾ðÊó¤Ï¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.IR " ¤È " +¤Ë¤¢¤ë¡£ + +.I dlpi_addr +¥Õ¥£¡¼¥ë¥É¤Ï¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹ +(¤Ä¤Þ¤ê¡¢¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Î²¾ÁÛ¥á¥â¥ê¥¢¥É¥ì¥¹¤È¡¢ +¥Õ¥¡¥¤¥ë (¤³¤Î¥Õ¥¡¥¤¥ë¤«¤é¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤¬¥í¡¼¥É¤µ¤ì¤ë) ¤Ë¤ª¤±¤ë +¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Î¥ª¥Õ¥»¥Ã¥È¤È¤Îº¹Ê¬) ¤òɽ¤¹¡£ +.I dlpi_name +¤Ï null ʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ê¡¢ +¤³¤Î¥Ñ¥¹Ì¾¤Î¥Õ¥¡¥¤¥ë¤«¤é¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤¬¥í¡¼¥É¤µ¤ì¤ë¡£ + +.I dlpi_phdr +¤È +.I dlpi_phnum +¥Õ¥£¡¼¥ë¥É¤Î°ÕÌ£¤òÍý²ò¤¹¤ë¤Ë¤Ï¡¢ +ELF ¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤¬´ö¤Ä¤«¤Î¥»¥°¥á¥ó¥È¤«¤é¹½À®¤µ¤ì¤Æ¤¤¤ë¤³¤È¤È¡¢ +³Æ¥»¥°¥á¥ó¥È¤¬¤½¤ì¤ËÂбþ¤¹¤ë¥×¥í¥°¥é¥à¥Ø¥Ã¥À +(¤½¤Î¥»¥°¥á¥ó¥È¤òÀâÌÀ¤¹¤ë) ¤ò»ý¤Ã¤Æ¤¤¤ë¤³¤È¤òÃΤäƤ¤¤ëɬÍפ¬¤¢¤ë¡£ +.I dlpi_phdr +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤³¤Î¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Î¥×¥í¥°¥é¥à¥Ø¥Ã¥À¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I dlpi_phnum +¤Ï¡¢¤³¤ÎÇÛÎó¤Î¥µ¥¤¥º¤òɽ¤¹¡£ + +¤³¤ì¤é¤Î¥×¥í¥°¥é¥à¥Ø¥Ã¥À¤Ï°Ê²¼¤Î¤è¤¦¤Ê·Á¼°¤Î¹½Â¤ÂΤǤ¢¤ë: +.in +4n +.nf + +typedef struct +{ + Elf32_Word p_type; /* ¥»¥°¥á¥ó¥È¤Î·¿ */ + Elf32_Off p_offset; /* ¥»¥°¥á¥ó¥È¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È */ + Elf32_Addr p_vaddr; /* ¥»¥°¥á¥ó¥È¤Î²¾ÁÛ¥¢¥É¥ì¥¹ */ + Elf32_Addr p_paddr; /* ¥»¥°¥á¥ó¥È¤ÎʪÍý¥¢¥É¥ì¥¹ */ + Elf32_Word p_filesz; /* ¥Õ¥¡¥¤¥ë¤Ë¤ª¤±¤ë¥»¥°¥á¥ó¥È¥µ¥¤¥º */ + Elf32_Word p_memsz; /* ¥á¥â¥ê¤Ë¤ª¤±¤ë¥»¥°¥á¥ó¥È¥µ¥¤¥º */ + Elf32_Word p_flags; /* ¥»¥°¥á¥ó¥È¥Õ¥é¥° */ + Elf32_Word p_align; /* ¥»¥°¥á¥ó¥È¤ÎÇÛÃÖ (alignment) */ +} Elf32_Phdr; +.fi +.in + +ÆÃÄê¤Î¥×¥í¥°¥é¥à¥Ø¥Ã¥À +.I x +¤Î²¾ÁÛ¥á¥â¥ê¤Ë¤ª¤±¤ë°ÌÃ֤ϡ¢°Ê²¼¤Î¼°¤Ç·×»»¤Ç¤­¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È: + +.nf + addr == info\->dlpi_addr + info\->dlpi_phdr[x].p_vaddr; +.fi +.SH ÊÖ¤êÃÍ +.BR dl_iterate_phdr () +´Ø¿ô¤ÏºÇ¸å¤Î +.I callback +¤Î¸Æ¤Ó½Ð¤·¤ÇÊÖ¤µ¤ì¤¿ÃͤòÊÖ¤¹¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR dl_iterate_phdr () +¤Ï glibc ¤Î¥Ð¡¼¥¸¥ç¥ó 2.2.4 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +.BR dl_iterate_phdr () +´Ø¿ô¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò¹Í¤¨¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤¬¥í¡¼¥É¤µ¤ì¤¿ +¥Ñ¥¹Ì¾¤Î°ìÍ÷¤òɽ¼¨¤¹¤ë¡£ +³Æ¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ä¤¤¤Æ¡¢¤³¤Î¥×¥í¥°¥é¥à¤Ï +¥ª¥Ö¥¸¥§¥¯¥È¤Î ELF ¥»¥°¥á¥ó¥È¤¬¥í¡¼¥É¤µ¤ì¤¿ +²¾ÁÛ¥¢¥É¥ì¥¹¤Î°ìÍ÷¤òɽ¼¨¤¹¤ë¡£ + +.nf +#define _GNU_SOURCE +#include +#include +#include + +static int +callback(struct dl_phdr_info *info, size_t size, void *data) +{ + int j; + + printf("name=%s (%d segments)\\n", info\->dlpi_name, + info\->dlpi_phnum); + + for (j = 0; j < info\->dlpi_phnum; j++) + printf("\\t\\t header %2d: address=%10p\\n", j, + (void *) (info\->dlpi_addr + info\->dlpi_phdr[j].p_vaddr)); + return 0; +} + +int +main(int argc, char *argv[]) +{ + dl_iterate_phdr(callback, NULL); + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR ldd (1), +.BR objdump (1), +.BR readelf (1), +.BR dlopen (3), +.BR elf (5), +.BR feature_test_macros (7), +.BR ld.so (8), +¥ª¥ó¥é¥¤¥ó¤Î¤¤¤í¤¤¤í¤Ê¾ì½ê¤ÇÆþ¼ê¤Ç¤­¤ë +.I "Executable and Linking Format Specification" diff --git a/release/man3/dlopen.3 b/release/man3/dlopen.3 new file mode 100644 index 00000000..77e69dc3 --- /dev/null +++ b/release/man3/dlopen.3 @@ -0,0 +1,537 @@ +.\" -*- nroff -*- +.\" Copyright 1995 Yggdrasil Computing, Incorporated. +.\" written by Adam J. Richter (adam@yggdrasil.com), +.\" with typesetting help from Daniel Quinlan (quinlan@yggdrasil.com). +.\" and Copyright 2003 Michael Kerrisk (mtk.manpages@gmail.com). +.\" +.\" 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. +.\" +.\" Modified by David A. Wheeler 2000-11-28. +.\" Applied patch by Terran Melconian, aeb, 2001-12-14. +.\" Modified by Hacksaw 2003-03-13. +.\" Modified by Matt Domsch, 2003-04-09: _init and _fini obsolete +.\" Modified by Michael Kerrisk 2003-05-16. +.\" 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 ưŪ¥é¥¤¥Ö¥é¥ê +.\" +.TH DLOPEN 3 2008-12-06 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +dlclose, dlerror, dlopen, dlsym \- ưŪ¥ê¥ó¥¯¤ò¹Ô¤¦¥í¡¼¥À¤Ø¤Î +¥×¥í¥°¥é¥ß¥ó¥°¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.SH ½ñ¼° +.B #include +.sp +.BI "void *dlopen(const char *" filename ", int " flag ); +.sp +.B "char *dlerror(void);" +.sp +.BI "void *dlsym(void *" handle ", const char *" symbol ); +.sp +.BI "int dlclose(void *" handle ); +.sp +\fI\-ldl\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR dlopen (), +.BR dlsym (), +.BR dlclose (), +.BR dlerror () +¤Î 4¤Ä¤Î´Ø¿ô¤Ï¡¢Æ°Åª¥ê¥ó¥¯ (dynamic linking) ¤ò¹Ô¤¦¥í¡¼¥À¤Ø¤Î +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.SS "dlerror()" +´Ø¿ô +.BR dlerror () +¤Ï¡¢Á°²ó +.BR dlerror () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¸å¤Ë¡¢ +.BR dlopen (), +.BR dlsym (), +.BR dlclose () +¤Î¤¤¤º¤ì¤«¤ÇºÇ¸å¤ËȯÀ¸¤·¤¿¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀ¥á¥Ã¥»¡¼¥¸¤òÊÖ¤¹¡£ +½é´ü²½¸å¤Þ¤¿¤ÏÁ°²ó¸Æ¤Ó½Ð¤µ¤ì¤¿¸å¤Ç¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤¤¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£ +.SS "dlopen()" +´Ø¿ô +.BR dlopen () +¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó +.I filename +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤ÎưŪ¥é¥¤¥Ö¥é¥ê (dynamic library) ¤ò¥í¡¼¥É¤·¡¢ +¤½¤ÎưŪ¥é¥¤¥Ö¥é¥ê¤Ø¤ÎÆâÉô¡Ö¥Ï¥ó¥É¥ë¡×¤òÊÖ¤¹¡£ +.I filename +¤¬ NULL ¤Î¾ì¹ç¡¢¥á¥¤¥ó¡¦¥×¥í¥°¥é¥à¤Ø¤Î¥Ï¥ó¥É¥ë¤¬ÊÖ¤µ¤ì¤ë¡£ +.I filename +¤¬¥¹¥é¥Ã¥·¥å ("/") ¤ò´Þ¤à¾ì¹ç¡¢(ÁêÂФ«ÀäÂФ«¤Î)¥Ñ¥¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢Æ°Åª¥ê¥ó¥«¤Ï°Ê²¼¤Î¼ê½ç¤Ç¥é¥¤¥Ö¥é¥ê¤ò¸¡º÷¤¹¤ë +(¾ÜºÙ¤Ï +.BR ld.so (8) +¤ò»²¾È): +.IP o 4 +(ELF ¤Î¤ß) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥°¥é¥à¤Î¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ë DT_RPATH ¥¿¥°¤¬´Þ¤Þ¤ì¤Æ¤ª¤ê¡¢ +DT_RUNPATH ¥¿¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢DT_RPATH ¥¿¥°¤Ë½ñ¤«¤ì¤Æ¤¤¤ë +¥Ç¥£¥ì¥¯¥È¥ê¡¦¥ê¥¹¥È¤ò¸¡º÷¤¹¤ë¡£ +.IP o +¥×¥í¥°¥é¥à¤Î³«»Ï»þ¤Ë´Ä¶­ÊÑ¿ô +.B LD_LIBRARY_PATH +¤Ë¥³¥í¥ó¶èÀÚ¤ê¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢ +¤³¤Î´Ä¶­ÊÑ¿ô¤ËÄêµÁ¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬¸¡º÷¤µ¤ì¤ë +(¥»¥­¥å¥ê¥Æ¥£¾å¤ÎÍýͳ¤Ç¡¢¤³¤ÎÊÑ¿ô¤Ï set-UID ¤ä set-GID ¤µ¤ì¤¿ +¥×¥í¥°¥é¥à¤Î¾ì¹ç¤Ï̵»ë¤µ¤ì¤ë)¡£ +.IP o +(ELF ¤Î¤ß) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥°¥é¥à¤Î¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ë DT_RUNPATH ¥¿¥°¤¬´Þ¤Þ¤ì¤Æ +¤¤¤ë¾ì¹ç¡¢¤½¤Î¥¿¥°¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¡¦¥ê¥¹¥È¤ò¸¡º÷¤¹¤ë¡£ +.IP o +¥­¥ã¥Ã¥·¥å¥Õ¥¡¥¤¥ë +.I /etc/ld.so.cache +¤ÎÃæ¤Ë +.I filename +¤Î¥¨¥ó¥È¥ê¤¬Æþ¤Ã¤Æ¤¤¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë +.RB ( /etc/ld.so.cache +¤Ï +.BR ldconfig (8) +¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤Æ¤¤¤ë)¡£ +.IP o +¥Ç¥£¥ì¥¯¥È¥ê +.I /lib +¤È +.I /usr/lib +¤ò¤³¤Î½çÈ֤Ǹ¡º÷¤¹¤ë¡£ +.PP +¤½¤Î¥é¥¤¥Ö¥é¥ê¤¬Â¾¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +°Í¸¤·¤Æ¤¤¤ë¥é¥¤¥Ö¥é¥ê¤âưŪ¥ê¥ó¥«¤¬Æ±¤¸¸¡º÷¥ë¡¼¥ë¤Ë´ð¤Å¤¤¤Æ +¼«Æ°Åª¤Ë¥í¡¼¥É¤¹¤ë (¤½¤ì¤é¤Î¥é¥¤¥Ö¥é¥ê¤Ë¤µ¤é¤Ë°Í¸´Ø·¸¤¬¤¢¤ë¾ì¹ç¤Ê¤É¤Ï +¤³¤Î½èÍý¤ÏºÆµ¢Åª¤Ë¹Ô¤ï¤ì¤ë)¡£ +.PP +.I flag +¤Ë¤Ï°Ê²¼¤Î 2 ¤Ä¤ÎÃͤΤ¤¤º¤ì¤«¤ò´Þ¤á¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤: +.TP +.B RTLD_LAZY +lazy binding (¼êÈ´¤­¤Ê¥·¥ó¥Ü¥ë¤Î·ë¤ÓÉÕ¤±) ¤¬¹Ô¤¦¡£ +¥·¥ó¥Ü¥ë¤Î²ò·è¤Ï¤½¤Î¥·¥ó¥Ü¥ë¤ò»²¾È¤¹¤ë¥³¡¼¥É¤¬¼Â¹Ô¤µ¤ì¤ë¤È¤­¤Ë¤Î¤ß +¹Ô¤ï¤ì¤ë¡£¥·¥ó¥Ü¥ë¤¬°ìÅ٤⻲¾È¤µ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥·¥ó¥Ü¥ë¤Ï +²ò·è¤µ¤ì¤Ê¤¤¤Þ¤Þ¤È¤Ê¤ë¡£ +(lazy binding ¤Ï´Ø¿ô»²¾È¤Ë¤Ä¤¤¤Æ¤Î¤ß¼Â»Ü¤µ¤ì¤ë; ÊÑ¿ô¤Ø¤Î»²¾È¤Ï¾ï¤Ë +¥é¥¤¥Ö¥é¥ê¤¬¥í¡¼¥É¤µ¤ì¤¿»þÅÀ¤Çľ¤Á¤Ë²ò·è¤µ¤ì¤ë¡£) +.TP +.B RTLD_NOW +¤³¤ÎÃͤ¬»ØÄꤵ¤ì¤ë¤«¡¢´Ä¶­ÊÑ¿ô +.B LD_BIND_NOW +¤Ë¶õ¤Ç¤Ê¤¤Ê¸»úÎó¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +¥é¥¤¥Ö¥é¥êÃæ¤Î̤ÄêµÁ¤Î¥·¥ó¥Ü¥ë¤òÁ´¤Æ²ò·è¤·¤Æ¤«¤é +.BR dlopen () +¤ÏÉüµ¢¤¹¤ë¡£²ò·è¤Ç¤­¤Ê¤«¤Ã¤¿¤È¤­¤Ë¤Ï¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +°Ê²¼¤ÎÃͤΤ¦¤Á 0 ¸Ä°Ê¾å¤òÏÀÍýÏ (OR) ¤Î·Á¤Ç +.I flag +¤ËÄɲ乤뤳¤È¤â¤Ç¤­¤ë: +.TP +.B RTLD_GLOBAL +¤³¤Î¥é¥¤¥Ö¥é¥ê¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥·¥ó¥Ü¥ë¤¬¡¢¤³¤ì¤è¤ê¸å¤Ç¥í¡¼¥É¤µ¤ì¤ë +¥é¥¤¥Ö¥é¥ê¤Î¥·¥ó¥Ü¥ë²ò·è¤ÇÍøÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.TP +.B RTLD_LOCAL +¤³¤Î¥Õ¥é¥°¤Ï +.B RTLD_GLOBAL +¤ÎÈ¿ÂФΰÕÌ£¤Ç¤¢¤ê¡¢¤É¤Á¤é¤Î¥Õ¥é¥°¤â»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï +¤³¤Á¤é¤¬¥Ç¥Õ¥©¥ë¥È¤È¤Ê¤ë¡£ +¤³¤Î¥é¥¤¥Ö¥é¥ê¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥·¥ó¥Ü¥ë¤Ï¡¢¤³¤ì¤è¤ê¸å¤Ç¥í¡¼¥É¤µ¤ì¤ë +¥é¥¤¥Ö¥é¥ê¤Ç¤Î¥·¥ó¥Ü¥ë»²¾È¤ÇÍøÍѤǤ­¤Ê¤¤¡£ +.TP +.BR RTLD_NODELETE " (glibc 2.2 °Ê¹ß)" +.BR dlclose () +Ãæ¤Ë¤½¤Î¥é¥¤¥Ö¥é¥ê¤ò¥¢¥ó¥í¡¼¥É¤·¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢Æ±¤¸¥é¥¤¥Ö¥é¥ê¤ò¤³¤ì°Ê¹ß¤Ë +.BR dlopen () +¤ÇºÆÅÙ¥í¡¼¥É¤·¤¿¾ì¹ç¤Ë¡¢¥é¥¤¥Ö¥é¥êÆâ¤ÎÀÅŪÊÑ¿ô¤ÏºÆ½é´ü²½¤µ¤ì¤Ê¤¤¡£ +¤³¤Î¥Õ¥é¥°¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" (¤·¤«¤· Solaris ¤Ë¸ºß¤¹¤ë) +.TP +.BR RTLD_NOLOAD " (glibc 2.2 °Ê¹ß)" +¤½¤Î¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤·¤Ê¤¤¡£ +¤³¤Î¥Õ¥é¥°¤Ï¤½¤Î¥é¥¤¥Ö¥é¥ê¤¬¤¹¤Ç¤ËÁȤ߹þ¤Þ¤ì¤Æ¤¤¤ë¤«¤ò¸¡ºº¤¹¤ë¤Î¤Ë +ÍøÍѤǤ­¤ë +.RB ( dlopen () +¤Ï¡¢¥é¥¤¥Ö¥é¥ê¤¬ÁȤ߹þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤·¡¢ +¤¹¤Ç¤ËÁȤ߹þ¤Þ¤ì¤Æ¤¤¤ì¤Ð¤½¤Î¥é¥¤¥Ö¥é¥ê¤Î¥Ï¥ó¥É¥ë¤òÊÖ¤¹)¡£ +¤Þ¤¿¡¢¤¹¤Ç¤Ë¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥é¥¤¥Ö¥é¥ê¤Î¥Õ¥é¥°¤ò¾º³Ê¤µ¤»¤ë¤Î¤Ë¤â +ÍøÍѤǤ­¤ë¡£Î㤨¤Ð¡¢²áµî¤Ë +.B RTLD_LOCAL +¤Ç¥í¡¼¥É¤·¤¿¥é¥¤¥Ö¥é¥ê¤ò +.BR RTLD_NOLOAD\ |\ RTLD_GLOBAL +¤ÇºÆ¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" (¤·¤«¤· Solaris ¤Ë¸ºß¤¹¤ë) +.TP +.BR RTLD_DEEPBIND " (glibc 2.3.4 °Ê¹ß)" +.\" Inimitably described by UD in +.\" http://sources.redhat.com/ml/libc-hacker/2004-09/msg00083.html. +¤³¤Î¥é¥¤¥Ö¥é¥êÆâ¤Î¥·¥ó¥Ü¥ë¤Î»²¾ÈÎΰè¤ò¥°¥í¡¼¥Ð¥ëÎΰè¤è¤ê¤âÁ°¤ËÇÛÃÖ¤¹¤ë¡£ +¤Ä¤Þ¤ê¡¢Æ⢷¿¤Î¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢¤¹¤Ç¤Ë¥í¡¼¥É¤µ¤ì¤¿¥é¥¤¥Ö¥é¥ê¤Ë´Þ¤Þ¤ì¤ë +Ʊ¤¸Ì¾Á°¤Î¥°¥í¡¼¥Ð¥ë¤Ê¥·¥ó¥Ü¥ë¤è¤ê¤â¼«¥é¥¤¥Ö¥é¥êÆâ¤Î¥·¥ó¥Ü¥ë¤¬Í¥À褷¤Æ +»È¤ï¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.I filename +¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¾ì¹ç¤Ï¡¢ +ÊÖ¤µ¤ì¤ë¥Ï¥ó¥É¥ë¤Ï¥á¥¤¥ó¡¦¥×¥í¥°¥é¥à¤Î¤â¤Î¤Ë¤Ê¤ë¡£ +¤³¤Î¥Ï¥ó¥É¥ë¤¬ +.BR dlsym () +¤ËÅϤµ¤ì¤ë¤È¡¢¥·¥ó¥Ü¥ë¤Î¸¡º÷¤Ï¡¢¥á¥¤¥ó¡¦¥×¥í¥°¥é¥àÆâ¡¢ +¥×¥í¥°¥é¥à¤Îµ¯Æ°»þ¤Ë¥í¡¼¥É¤µ¤ì¤ëÁ´¤Æ¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¡¢ +.BR dlopen () +¤Ë¤è¤Ã¤Æ +.B RTLD_GLOBAL +¥Õ¥é¥°ÉÕ¤­¤Ç¥í¡¼¥É¤µ¤ì¤¿Á´¤Æ¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¡¢¤Î½ç½ø¤Ç¹Ô¤ï¤ì¤ë¡£ +.PP +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥é¥¤¥Ö¥é¥êÃæ¤Ç¤Î³°Éô»²¾È¤Ï¡¢ +¤½¤Î¥é¥¤¥Ö¥é¥ê¤Î°Í¸¥ê¥¹¥È¤Ë¤¢¤ë¥é¥¤¥Ö¥é¥ê¤«¡¢ +.B RTLD_GLOBAL +¥Õ¥é¥°ÉÕ¤­¤Ç´û¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥é¥¤¥Ö¥é¥ê¤ò»È¤Ã¤Æ²ò·è¤µ¤ì¤ë¡£ +¼Â¹Ô¥Õ¥¡¥¤¥ë¤¬ "\-rdynamic" ¥Õ¥é¥° ("\-\-export\-dynamic" ¤âƱµÁ) +ÉÕ¤­¤Ç¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¼Â¹Ô¥Õ¥¡¥¤¥ëÃæ¤Î¥°¥í¡¼¥Ð¥ë¥·¥ó¥Ü¥ë¤â¡¢ +ưŪ¤Ë¥í¡¼¥É¤µ¤ì¤ë¥é¥¤¥Ö¥é¥êÆâ¤Î»²¾È²ò·è¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +Ʊ¤¸¥é¥¤¥Ö¥é¥ê¤¬ +.BR dlopen () +¤Ë¤è¤Ã¤ÆºÆÅÙ¥í¡¼¥É¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤¬ÊÖ¤µ¤ì¤ë¡£ +dl ¥é¥¤¥Ö¥é¥ê¤Ï¥é¥¤¥Ö¥é¥ê¥Ï¥ó¥É¥ë¤Î¥ê¥ó¥¯¿ô¤ò´ÉÍý¤·¤Æ¤¤¤ë¡£ +¤·¤¿¤¬¤Ã¤ÆưŪ¥é¥¤¥Ö¥é¥ê¤Ï +.BR dlclose () +¤¬ +.BR dlopen () +¤ÈƱ¤¸²ó¿ô¤À¤±¸Æ¤Ó½Ð¤µ¤ì¤Ê¤¤¸Â¤ê¥¢¥ó¥í¡¼¥É¤µ¤ì¤Ê¤¤¡£ +.BR _init () +¥ë¡¼¥Á¥ó¤Ï°ìÅÙ¤À¤±¸Æ¤Ó½Ð¤µ¤ì¤ë +.RB ( _init () +¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Î¤ß)¡£ +.B RTLD_NOW +¤¬»ØÄꤵ¤ì¤Æ +.BR dlopen () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢ +.B RTLD_LAZY +¤Ç°ÊÁ°¤Ë¥í¡¼¥É¤µ¤ì¤¿¥é¥¤¥Ö¥é¥ê¤Î¥·¥ó¥Ü¥ë²ò·è¤¬¼Â¹Ô¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.PP +.BR dlopen () +¤Ï¡¢²¿¤é¤«¤ÎÍýͳ¤Ç¼ºÇÔ¤¹¤ë¤È NULL ¤òÊÖ¤¹¡£ + +.SS "dlsym()" +´Ø¿ô +.BR dlsym () +¤Ï¡¢ +.BR dlopen () +¤¬ÊÖ¤·¤¿Æ°Åª¥é¥¤¥Ö¥é¥ê¤Î¡Ö¥Ï¥ó¥É¥ë¡×¤È¡¢ +NULL ½ªÃ¼¤µ¤ì¤¿¥·¥ó¥Ü¥ë̾¤Îʸ»úÎó¤ò°ú¤­¿ô¤Ë¼è¤ê¡¢ +¤½¤Î¥·¥ó¥Ü¥ë¤¬¥í¡¼¥É¤µ¤ì¤¿¥á¥â¥ê¤Î¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£ +¥·¥ó¥Ü¥ë¤¬¡¢»ØÄꤵ¤ì¤¿¥é¥¤¥Ö¥é¥ê¤È¡¢»ØÄꤵ¤ì¤¿¥é¥¤¥Ö¥é¥ê¤¬¥í¡¼¥É¤µ¤ì¤ëºÝ¤Ë +.BR dlopen () +¤¬¼«Æ°Åª¤Ë¥í¡¼¥É¤·¤Æ¥é¥¤¥Ö¥é¥ê¤Î¤¤¤º¤ì¤Ë¤â¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +.BR dlsym () +¤Ï NULL ¤òÊÖ¤¹ +.RB ( dlsym () +¤Ë¤è¤ë¸¡º÷¤Ï¡¢¤³¤ì¤é¤Î¥é¥¤¥Ö¥é¥ê¤Î°Í¸´Ø·¸¤Î¥Ä¥ê¡¼¤òÀèƬ¤«¤é +é¤Ã¤Æ¹Ô¤ï¤ì¤ë)¡£ +¼ÂºÝ¤Ë¤Ï¥·¥ó¥Ü¥ë¤ÎÃͼ«ÂΤ¬ NULL ¤Ë¤Ê¤ë¤³¤È¤â¤¢¤ë (¤½¤Î¤¿¤á¡¢ +.BR dlsym () +¤ÎÊÖ¤êÃͤ¬ NULL ¤Ç¤¢¤Ã¤¿¤È¤·¤Æ¤âɬ¤º¤·¤â¥¨¥é¡¼¤È¤¤¤¦Ìõ¤Ç¤Ï¤Ê¤¤)¡£ +¥¨¥é¡¼¤«¤É¤¦¤«¤ò³Îǧ¤¹¤ëÀµ¤·¤¤ÊýË¡¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.BR dlerror () +¤ò¸Æ¤Ó½Ð¤·¤Æ°ÊÁ°¤Î¥¨¥é¡¼¾õÂÖ¤ò¥¯¥ê¥¢¤·¤Æ¤«¤é¡¢ +.BR dlsym () +¤ò¸Æ¤Ó½Ð¤¹¡£¤½¤Î¸å¤Ç¤â¤¦°ìÅÙ +.BR dlerror () +¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢ +.BR dlerror () +¤ÎÊÖ¤êÃͤòÊÑ¿ô¤ËÊݸ¤·¡¢Êݸ¤·¤¿Ãͤ¬ NULL ¤Ç¤¢¤ë¤«È½Äꤹ¤ë¡£ +.PP +.B RTLD_DEFAULT +¤È +.B RTLD_NEXT +¤È¤¤¤¦Æó¤Ä¤ÎÆÃÊ̤ʵ¼»÷¥Ï¥ó¥É¥ë¤¬¤¢¤ë¡£ +.B RTLD_DEFAULT +¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥é¥¤¥Ö¥é¥ê¸¡º÷½ç½ø¤Ë¤·¤¿¤¬¤Ã¤Æ¡¢ +¸¡º÷ÂоݤΥ·¥ó¥Ü¥ë¤¬ºÇ½é¤Ë¸½¤ì¤ë¤È¤³¤í¤òõ¤¹¡£ +.B RTLD_NEXT +¤Ï¡¢¥é¥¤¥Ö¥é¥ê¸¡º÷½ç½ø¤ÎÃæ¤Ç¸½ºß¤Î¥é¥¤¥Ö¥é¥ê°Ê¹ß¤ÇºÇ½é¤Ë +´Ø¿ô¤¬¸½¤ì¤ë¤È¤³¤í¤òõ¤¹¡£¤³¤Îµ¡Ç½¤ò»È¤¦¤³¤È¤Ç¡¢Ê̤ζ¦Í­¥é¥¤¥Ö¥é¥ê¤Î +´Ø¿ô¤Ø¤Î¥é¥Ã¥Ñ¡¼¤òÄ󶡤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SS "dlclose()" +´Ø¿ô +.BR dlclose () +¤ÏưŪ¥é¥¤¥Ö¥é¥ê¤Î¥Ï¥ó¥É¥ë +.I handle +¤Î»²¾È¥«¥¦¥ó¥È¤ò 1 ¸º¤é¤¹¡£»²¾È¥«¥¦¥ó¥È¤¬ 0 ¤Ë¤Ê¤ê¡¢¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë +¾¤Î¥é¥¤¥Ö¥é¥ê¤«¤é¤½¤Î¥é¥¤¥Ö¥é¥êÆâ¤Î¥·¥ó¥Ü¥ë¤¬»È¤ï¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +¤½¤ÎưŪ¥é¥¤¥Ö¥é¥ê¤ò¥¢¥ó¥í¡¼¥É¤¹¤ë¡£ +.LP +´Ø¿ô +.BR dlclose () +¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤Î¾ì¹ç 0 °Ê³°¤òÊÖ¤¹¡£ +.SS "Çѻߤµ¤ì¤¿¥·¥ó¥Ü¥ë _init() ¤È _fini()" +¥ê¥ó¥«¤Ï +.B _init +¤È +.B _fini +¤òÆÃÊ̤ʥ·¥ó¥Ü¥ë¤È²ò¼á¤¹¤ë¡£ +¤¢¤ëưŪ¥é¥¤¥Ö¥é¥ê¤Ç +.BR _init () +¤È¤¤¤¦Ì¾Á°¤Î¥ë¡¼¥Á¥ó¤¬¥¨¥¯¥¹¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢ +¤½¤Î¥³¡¼¥É¤Ï¡¢¥é¥¤¥Ö¥é¥ê¤Î¥í¡¼¥É¸å¡¢¤«¤Ä +.BR dlopen () +¤¬Éüµ¢¤¹¤ëÁ°¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ +¤½¤ÎưŪ¥é¥¤¥Ö¥é¥ê¤Ç +.BR _fini () +¤È¤¤¤¦Ì¾Á°¤Î¥ë¡¼¥Á¥ó¤¬¥¨¥¯¥¹¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢ +¥é¥¤¥Ö¥é¥ê¤¬¥¢¥ó¥í¡¼¥É¤µ¤ì¤ëľÁ°¤Ë¤½¤Î¥ë¡¼¥Á¥ó¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +¥·¥¹¥Æ¥à¤Îµ¯Æ°¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥ê¥ó¥¯¤òÈò¤±¤ëɬÍפ¬¤¢¤ë¾ì¹ç¡¢ +.BR gcc (1) +¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë +.I \-nostartfiles +¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ì¤Ð¤è¤¤¡£ +.LP +¤³¤Î¥ë¡¼¥Á¥ó¤ä¡¢gcc ¤Î¥ª¥×¥·¥ç¥ó +.B \-nostartfiles +¤ä +.B \-nostdlib +¤Ï»ÈÍѤ·¤Ê¤¤¤³¤È¤ò¿ä¾©¤¹¤ë¡£ +¤³¤ì¤é¤ò»È¤¦¤È¡¢Ë¾¤Þ¤·¤¯¤Ê¤¤Æ°ºî¤ò¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +¤Ê¤¼¤Ê¤é¡¢(ÆÃÊ̤ÊÁ¼ÃÖ¤¬¹Ô¤ï¤ì¤Ê¤¤¸Â¤ê) ¤³¤ì¤é¤Î constructor/destructor +¥ë¡¼¥Á¥ó¤Ï¼Â¹Ô¤µ¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.\" void _init(void) __attribute__((constructor)); +.\" void _fini(void) __attribute__((destructor)); +.LP +Âå¤ï¤ê¤Ë¡¢¥é¥¤¥Ö¥é¥ê¤Ï +.B __attribute__((constructor)) +¤ä +.B __attribute__((destructor)) +¤Î´Ø¿ô°À­¤ò»È¤Ã¤ÆɬÍפʥ롼¥Á¥ó¤ò¥¨¥¯¥¹¥Ý¡¼¥È¤¹¤ë¤Î¤¬¤è¤¤¡£ +¤³¤ì¤é¤Ë¤Ä¤¤¤Æ¤Ï gcc ¤Î info ¥Ú¡¼¥¸¤ò»²¾È¤Î¤³¤È¡£ +constructor ¥ë¡¼¥Á¥ó¤Ï +.BR dlopen () +¤¬Éüµ¢¤¹¤ëÁ°¤Ë¼Â¹Ô¤µ¤ì¡¢ +destructor ¥ë¡¼¥Á¥ó¤Ï +.BR dlclose () +¤¬Éüµ¢¤¹¤ëÁ°¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ +.SS GNU ¤Ç¤Î³ÈÄ¥: dladdr() ¤È dlvsym() +glibc ¤Ç¤Ï POSIX ¤Ë¤Ïµ­ºÜ¤µ¤ì¤Æ¤¤¤Ê¤¤´Ø¿ô¤¬ 2¤ÄÄɲ䵤ì¤Æ¤¤¤ë¡£ +¥×¥í¥È¥¿¥¤¥×¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.sp +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int dladdr(void *" addr ", Dl_info *" info ); +.sp +.BI "void *dlvsym(void *" handle ", char *" symbol ", char *" version ); +.fi +.PP +´Ø¿ô +.BR dladdr () +¤Ï¡¢´Ø¿ô¤Î¥Ý¥¤¥ó¥¿¤ò°ú¤­¿ô¤Ë¤È¤ê¡¢´Ø¿ô¤Î̾Á°¤È´Ø¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë +¥Õ¥¡¥¤¥ë¤Î²ò·è¤ò»î¤ß¤ë¡£¾ðÊó¤Ï +.I Dl_info +¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ë¡£ +.sp +.in +4n +.nf +typedef struct { + const char *dli_fname; /* Pathname of shared object that + contains address */ + void *dli_fbase; /* Address at which shared object + is loaded */ + const char *dli_sname; /* Name of nearest symbol with address + lower than \fIaddr\fP */ + void *dli_saddr; /* Exact address of symbol named + in \fIdli_sname\fP */ +} Dl_info; +.fi +.in +.PP +.I addr +¤Ë¥Þ¥Ã¥Á¤¹¤ë¥·¥ó¥Ü¥ë¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.I dli_sname +¤È +.I dli_saddr +¤Ï NULL ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.BR dladdr () +¤Ï¡¢¥¨¥é¡¼»þ¤Ë¤Ï 0 ¤òÊÖ¤·¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 °Ê³°¤òÊÖ¤¹¡£ +.PP +´Ø¿ô +.BR dlvsym () +¤Ï +.BR dlsym () +¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¤¬¡¢¥Ð¡¼¥¸¥ç¥ó¤Îʸ»úÎó¤òÅϤ¹°ú¤­¿ô¤¬ +Äɲ䵤ì¤Æ¤¤¤ëÅÀ¤¬°Û¤Ê¤ë +.RB ( dlvsym () +¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë)¡£ +.SH ½àµò +POSIX.1-2003 ¤Ë¤Ï +.BR dlclose (), +.BR dlerror (), +.BR dlopen (), +.BR dlsym (). +¤Îµ­ºÜ¤¬¤¢¤ë¡£ +.SH Ãí°Õ +¥·¥ó¥Ü¥ë +.B RTLD_DEFAULT +¤È +.B RTLD_NEXT +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥ÉÁ°¤Ë +.B _GNU_SOURCE +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ßÍ­¸ú¤È¤Ê¤ë¡£ +.\" .LP +.\" .BR dlerror () +.\" ¤¬ÊÖ¤¹Ê¸»úÎó¤ÏÊѹ¹¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢ +.\" °Ê²¼¤Î¤è¤¦¤Ê¥×¥í¥È¥¿¥¤¥×¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" .sp +.\" .in +5 +.\" .B "const char *dlerror(void);" +.\" .in + +glibc 2.2.3 °Ê¹ß¤Ç¤Ï¡¢ +.BR atexit (3) +¤ò»È¤Ã¤Æ¡¢¥é¥¤¥Ö¥é¥ê¤¬¥¢¥ó¥í¡¼¥É¤µ¤ì¤ëºÝ¤Ë¼«Æ°Åª¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë +½ªÎ»¥Ï¥ó¥É¥é (exit handler) ¤òÅÐÏ¿¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SS Îò»Ë +dlopen ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Îɸ½à¤Ï SunOS ¤ò¤â¤È¤Ë¤·¤Æ¤¤¤ë¡£ +SunOS ¤Ë¤Ï +.BR dladdr () +¤â¤¢¤Ã¤¿¤¬¡¢ +.BR dlvsym () +¤Ï¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¥° +»þ¤È¤·¤Æ¡¢ +.BR dladdr () +¤ËÅϤ·¤¿´Ø¿ô¥Ý¥¤¥ó¥¿¤Ï¶Ã¤¯¤è¤¦¤ÊÃͤˤʤ뤳¤È¤¬¤¢¤ë¡£ +¤¤¤¯¤Ä¤«¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã (ÆÃ¤Ë i386 ¤È x86_64) ¤Ç¤Ï¡¢ +°ú¤­¿ô¤È¤·¤Æ»ÈÍѤ·¤¿´Ø¿ô¤¬Æ°Åª¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê¤ÇÄêµÁ¤µ¤ì¤ë¤â¤Î¤Ç +¤¢¤Ã¤¿¤È¤·¤Æ¤â¡¢ +.I dli_fname +¤È +.I dli_fbase +¤¬ +.BR dladdr () +¤ò¸Æ¤Ó½Ð¤·¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ò»²¾È¤·¤¿¾õÂ֤ǽª¤ï¤Ã¤Æ¤¤¤ë¤³¤È¤¬¤¢¤ë¡£ +.PP +ÌäÂê¤Ï¡¢´Ø¿ô¥Ý¥¤¥ó¥¿¤Î²ò·è¤Ïº£¤Ê¤ª¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¹Ô¤ï¤ì¤ë¤¬¡¢ +¤½¤Î¥Ý¥¤¥ó¥¿¤Ï¸µ¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Î +.I plt +(Procedure Linkage Table) ¥»¥¯¥·¥ç¥ó¤ò»Ø¤·¤Æ¤¤¤ë¤À¤±¤À¤È¤¤¤¦ÅÀ¤Ë¤¢¤ë +(¥ª¥Ö¥¸¥§¥¯¥È¼«ÂΤϡ¢¥À¥¤¥Ê¥ß¥Ã¥¯¥ê¥ó¥«¤Ë¤è¤Ã¤Æ¥·¥ó¥Ü¥ë¤Î²ò·è¤¬¹Ô¤ï¤ì¤¿¸å¤Ë¡¢ +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦)¡£ +¤³¤ì¤ËÂн褹¤ëÊýË¡¤È¤·¤Æ¤Ï¡¢ +¥³¡¼¥É¤ò position-independent ¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤È¤¤¤¦ÊýË¡¤¬¤¢¤ë¡£ +¤½¤¦¤¹¤ë¤È¡¢¥³¥ó¥Ñ¥¤¥é¤Ï¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥Ý¥¤¥ó¥¿¤òÍÑ°Õ¤¹¤ë¤³¤È¤¬¤Ç¤­¤º¡¢ +º£Æü¤Î +.BR gcc (1) +¤Ç¤Ï¡¢¼Â¹Ô»þ¤Ë +.BR dladdr () +¤Ë´Ø¿ô¥Ý¥¤¥ó¥¿¤òÅϤ¹Á°¤Ë¡¢ +.I got +(Global Offset Table) ¤«¤éºÇ½ªÅª¤Ê¥·¥ó¥Ü¥ë¤Î¥¢¥É¥ì¥¹¤ò¥í¡¼¥É¤¹¤ë¤À¤±¤Î +¥³¡¼¥É¤¬À¸À®¤µ¤ì¤ë¡£ +.SH Îã +math ¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤·¡¢2.0 ¤Î;¸¹¤òɽ¼¨¤¹¤ë +.nf + +#include +#include +#include + +int +main(int argc, char **argv) +{ + void *handle; + double (*cosine)(double); + char *error; + + handle = dlopen("libm.so", RTLD_LAZY); + if (!handle) { + fprintf(stderr, "%s\en", dlerror()); + exit(EXIT_FAILURE); + } + + dlerror(); /* Clear any existing error */ + + /* Writing: cosine = (double (*)(double)) dlsym(handle, "cos"); + would seem more natural, but the C99 standard leaves + casting from "void *" to a function pointer undefined. + The assignment used below is the POSIX.1\-2003 (Technical + 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. + + if ((error = dlerror()) != NULL) { + fprintf(stderr, "%s\en", error); + exit(EXIT_FAILURE); + } + + printf("%f\en", (*cosine)(2.0)); + dlclose(handle); + exit(EXIT_SUCCESS); +} +.fi +.PP +¤³¤Î¥×¥í¥°¥é¥à¤ò "foo.c" ¤Ë½ñ¤¤¤¿¤È¤¹¤ë¤È¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤Ç¥×¥í¥°¥é¥à¤ò +¥Ó¥ë¥É¤Ç¤­¤ë¡£ +.in +4n +.LP + gcc \-rdynamic \-o foo foo.c \-ldl +.in +.PP +.BR _init () +¤È +.BR _fini () +¤ò¥¨¥¯¥¹¥Ý¡¼¥È¤¹¤ë¥é¥¤¥Ö¥é¥ê¤Î¾ì¹ç¤Ï +°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤¹¤ëɬÍפ¬¤¢¤ë¡£ +Îã¤È¤·¤Æ \fIbar.c\fP ¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¾ì¹ç: +.in +4n +.LP + gcc \-shared \-nostartfiles \-o bar bar.c +.in +.SH ´ØÏ¢¹àÌÜ +.BR ld (1), +.BR ldd (1), +.BR dl_iterate_phdr (3), +.BR feature_test_macros (7), +.BR rtld-audit (7), +.BR ld.so (8), +.BR ldconfig (8), +ld.so info pages, gcc info pages, ld info pages diff --git a/release/man3/dprintf.3 b/release/man3/dprintf.3 new file mode 100644 index 00000000..d43809a8 --- /dev/null +++ b/release/man3/dprintf.3 @@ -0,0 +1,86 @@ +.\" 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. +.\" +.\" Text fragments inspired by Martin Schulze . +.\" +.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. +.\" Translated Sat 12 Jan 2002 by NAKANO Takeo +.\" +.TH DPRINTF 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +dprintf, vdprintf \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ëʸ»ú½ÐÎϤ¹¤ë +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int dprintf(int " fd ", const char *" format ", ...);" +.sp +.BI "int vdprintf(int " fd ", const char *" format ", va_list " ap ); +.SH ÀâÌÀ +(glibc2 ¥é¥¤¥Ö¥é¥ê¤Ë¤ª¤±¤ë) +.BR dprintf () +´Ø¿ô¤È +.BR vdprintf () +´Ø¿ô¤È¤Ï¡¢¤½¤ì¤¾¤ì +.BR fprintf (3) +´Ø¿ô¤È +.BR vfprintf (3) +´Ø¿ô¤È¤Ë¤Á¤ç¤¦¤ÉÂбþ¤¹¤ë¤¬¡¢ +¤³¤ì¤é¤Ï +.I stdio +¥¹¥È¥ê¡¼¥à¤Ç¤Ï¤Ê¤¯¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.I fd +¤ËÂФ·¤Æ½ÐÎϤò¹Ô¤¦¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ê¡¢ +¸½ºß¤Ç¤Ï POSIX.1-2008 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.\" .SH Ãí°Õ +.\" ¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢C ¤ä POSIX ¤Î¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +.\" ¸«¤Æ¤ï¤«¤ë¤È¤ª¤ê¡¢Ì¾Á°¤ÎÉÕ¤±Êý¤Ï¤¢¤Þ¤êÎɤ¯¤Ê¤¤¡£ +.\" ¿¤¯¤Î¥·¥¹¥Æ¥à (MacOS ¤Ê¤É) ¤Ë¤Ï¡¢ +.\" .BR dprintf () +.\" ¤È¤¤¤¦Ì¾Á°¤Î¡¢¤³¤ì¤È¤Ï¸ß´¹¤Ç¤Ê¤¤´Ø¿ô¤¬¤¢¤ê¡¢ +.\" ¤¿¤¤¤Æ¤¤¤Ï¤Ê¤ó¤é¤«¤Î¥Ç¥Ð¥Ã¥°ÍѤΠ+.\" .BR printf (3) +.\" ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£¥×¥í¥È¥¿¥¤¥×¤Ï +.\" +.\" .BI "void dprintf(int level, const char *" format ", ...);" +.\" +.\" ¤Ç¡¢ºÇ½é¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¥Ç¥Ð¥Ã¥°¥ì¥Ù¥ë¤Ë¤Ê¤Ã¤Æ¤¤¤ë +.\" (¤Þ¤¿½ÐÎÏ¤Ï +.\" .I stderr +.\" ¤Ë¹Ô¤ï¤ì¤ë)¡£ +.\" ¤µ¤é¤Ë¡¢ +.\" .BR dprintf () +.\" (¤¢¤ë¤¤¤Ï +.\" .BR DPRINTF ) +.\" ¤Ï¥Ç¥Ð¥Ã¥°½èÍýÍѤΠprintf ¤Î¥Þ¥¯¥í¤È¤·¤Æ¤âÎɤ¯ÍѤ¤¤é¤ì¤ë¡£ +.\" ¤·¤¿¤¬¤Ã¤Æ¶²¤é¤¯¡¢°Ü¿¢À­¤òɬÍפȤ¹¤ë¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +.\" ¤³¤Î´Ø¿ô¤ÏÍѤ¤¤Ê¤¤¤Û¤¦¤¬Îɤ¤¤À¤í¤¦¡£ +.\" +.\" ¤è¤êÎɤ¤Ì¾Á°¤Ï +.\" .BR fdprintf () +.\" ¤À¤Ã¤¿¤«¤È»×¤ï¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR printf (3), +.BR feature_test_macros (7) diff --git a/release/man3/drand48.3 b/release/man3/drand48.3 new file mode 100644 index 00000000..fb6cfd8a --- /dev/null +++ b/release/man3/drand48.3 @@ -0,0 +1,215 @@ +.\" 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 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 +.\" +.\" WORD: internal buffer ÆâÉô¥Ð¥Ã¥Õ¥¡ +.\" +.TH DRAND48 3 2007-07-26 "" "Linux Programmer's Manual" +.SH ̾Á° +drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48, +lcong48 \- °ìÍÍʬÉÛ¤¹¤ëµ¿»÷Íð¿ô¤òÀ¸À®¤¹¤ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.B double drand48(void); +.sp +.BI "double erand48(unsigned short " xsubi [3]); +.sp +.B long int lrand48(void); +.sp +.BI "long int nrand48(unsigned short " xsubi [3]); +.sp +.B long int mrand48(void); +.sp +.BI "long int jrand48(unsigned short " xsubi [3]); +.sp +.BI "void srand48(long int " seedval ); +.sp +.BI "unsigned short *seed48(unsigned short " seed16v [3]); +.sp +.BI "void lcong48(unsigned short " param [7]); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô: +.\" .BR drand48 (), +.\" .BR erand48 (), +.\" .BR lrand48 (), +.\" .BR nrand48 (), +.\" .BR mrand48 (), +.\" .BR jrand48 (), +.\" .BR srand48 (), +.\" .BR seed48 (), +.\" .BR lcong48 (): +_SVID_SOURCE || _XOPEN_SOURCE +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÀþ·Á¹çƱ¥¢¥ë¥´¥ê¥º¥à¤È 48¥Ó¥Ã¥ÈÀ°¿ô±é»»¤òÍѤ¤¤Æ +µ¿»÷Íð¿ô¤òÀ¸À®¤¹¤ë¡£ +.PP +´Ø¿ô +.BR drand48 () +¤È +.BR erand48 () +¤Ï¡¢¶è´Ö [0.0, 1.0) ¤Ç +°ìÍÍʬÉÛ¤¹¤ëÈóÉé¤ÎÇÜÀºÅÙÉâÆ°¾®¿ôÅÀ¼Â¿ôÃͤòÊÖ¤¹¡£ +.PP +´Ø¿ô +.BR lrand48 () +¤È +.BR nrand48 () +¤Ï 0 ¤È 2^31 ¤Î´Ö¤Ç°ìÍÍʬÉÛ¤¹¤ë +ÈóÉé¤Î¥í¥ó¥°À°¿ô¤òÊÖ¤¹¡£ +.PP +´Ø¿ô +.BR mrand48 () +¤È +.BR jrand48 () +¤Ï +\-2^31 ¤È 2^31 ¤Î´Ö¤Ç°ìÍÍʬÉÛ¤¹¤ëÉä¹æÉÕ¤­¥í¥ó¥°À°¿ô¤òÊÖ¤¹¡£ +.PP +´Ø¿ô +.BR srand48 (), +.BR seed48 (), +.BR lcong48 () +¤Ï½é´ü²½´Ø¿ô +¤Ç¤¢¤ë¡£ +´Ø¿ô +.BR drand48 (), +.BR lrand48 (), +.BR mrand48 () +¤ò +»ÈÍѤ¹¤ëÁ°¤Ë¡¢¤³¤ì¤é¤Î½é´ü²½´Ø¿ô¤Î¤¤¤º¤ì¤«¤ò¸Æ¤Ö¤Ù¤­¤Ç¤¢¤ë¡£ +´Ø¿ô +.BR erand48 (), +.BR nrand48 (), +.BR jrand48 () +¤Ï½é¤á¤Ë +½é´ü²½´Ø¿ô¤ò¸Æ¤Ö¤³¤È¤òɬÍפȤ·¤Ê¤¤¡£ +.PP +¤³¤³¤ÇÀâÌÀ¤·¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î´Ø¿ô¤Ï 48¥Ó¥Ã¥È¤ÎÀ°¿ô¤Î +¥·¡¼¥±¥ó¥¹ (\fIXi\fP) ¤òÀ¸À®¤¹¤ë¤³¤È¤Ç +µ¡Ç½¤·¤Æ¤¤¤ë¡£À¸À®ÊýË¡¤Ï°Ê²¼¤ÎÀþ·Á¹çƱ¤Î¼°¤Ë¤è¤ë¡£ +.sp +.nf +.RS +.B Xn+1 = (aXn + c) mod m, +.RE +.fi +.sp +¤³¤³¤Ç n >= 0 ¤Ç¤¢¤ë¡£ +¥Ñ¥é¥á¡¼¥¿¤¬ \fIm\fP = 2^48 ¤Ç¤¢¤ë¤¿¤á¡¢48¥Ó¥Ã¥ÈÀ°¿ô±é»»¤¬¹Ô¤ï¤ì¤Æ¤¤¤ë¡£ +.BR lcong48 () +¤¬¸Æ¤Ð¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢\fIa\fP ¤È \fIc\fP ¤Ï°Ê²¼¤Î¼°¤ÇÍ¿¤¨¤é¤ì¤ë¡£ +.sp +.nf +.RS +.B a = 0x5DEECE66D +.B c = 0xB +.RE +.fi +.sp +´Ø¿ô +.BR drand48 (), +.BR erand48 (), +.BR lrand48 (), +.BR nrand48 (), +.BR mrand48 (), +.BR jrand48 () +¤ÇÊÖ¤µ¤ì¤ëÃͤϼ¡¤Î¤è¤¦¤Ë¤·¤Æ·×»»¤µ¤ì¤ë¡£ +¤Ï¤¸¤á¤Ë¡¢¼¡¤Î48¥Ó¥Ã¥È¤Î \fIXi\fP ¤¬·×»»¤µ¤ì¤ë¡£ +¤½¤·¤Æ¡¢ÊÖ¤¹¤Ù¤­¥Ç¡¼¥¿¤Î·¿¤Ë°Í¸¤·¤¿Å¬ÀÚ¤Ê +¥Ó¥Ã¥È¿ô¤¬ \fIXi\fP ¤Î¾å°Ì¥Ó¥Ã¥È¤«¤é¥³¥Ô¡¼¤µ¤ì¤ë¡£ +ºÇ¸å¤Ë¡¢¤³¤ÎÃͤòÊÖ¤êÃͤËÊÑ´¹¤¹¤ë¡£ +.PP +´Ø¿ô +.BR drand48 (), +.BR lrand48 (), +.BR mrand48 () +¤Ï +ºÇ¸å¤ËÀ¸À®¤µ¤ì¤¿48¥Ó¥Ã¥È¤Î \fIXi\fP ¤òÆâÉô¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤¹¤ë¡£ +ÇÛÎó¤Î·Á¤Î°ú¿ô \fIxsubi\fP ¤Ë¸Ä¡¹¤Î \fIXi\fP ¤ÎÃͤò +³ÊǼ¤Ç¤­¤ë¤è¤¦¤ÊÎΰè¤ò³ÎÊݤ¹¤ë¤³¤È¤ò¡¢ +´Ø¿ô +.BR erand48 (), +.BR nrand48 (), +.BR jrand48 () +¤Ï¡¢ +¸Æ¤Ó½Ð¤·Â¦¤Î¥×¥í¥°¥é¥à¤ËÍ׵᤹¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤Ï¤¸¤á¤Æ¤½¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤ÖÁ°¤Ë \fIXi\fP ¤Î½é´üÃͤòÇÛÎó¤Ë +ÂåÆþ¤¹¤ë¤³¤È¤Ç½é´ü²½¤µ¤ì¤ë¡£ +.PP +½é´ü²½´Ø¿ô +.BR srand48 () +¤Ï¡¢\fIXi\fP ¤Î +¾å°Ì32¥Ó¥Ã¥È¤ò°ú¿ô \fIseedval\fP ¤ËÀßÄꤹ¤ë¡£ +²¼°Ì¤Î16¥Ó¥Ã¥È¤Ï¡¢Å¬Åö¤Ë·è¤á¤é¤ì¤¿ÃͤǤ¢¤ë0x330E¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +½é´ü²½´Ø¿ô +.BR seed48 () +¤Ï¡¢\fIXi\fP ¤ÎÃͤò¡¢ +ÇÛÎó¤Î·Á¤ò¤·¤¿°ú¿ô¤Ç¤¢¤ë \fIseed16v\fP ¤ÎÃæ¤Ç»ØÄꤵ¤ì¤¿ 48¥Ó¥Ã¥È¤ÎÃͤËÀßÄꤹ¤ë¡£ +\fIXi\fP ¤ÎÁ°¤ÎÃͤÏÆâÉô¥Ð¥Ã¥Õ¥¡¤Ë¥³¥Ô¡¼¤µ¤ì¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬ +.BR seed48 () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë¡£ +.PP +½é´ü²½´Ø¿ô +.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 ¤Î +ɸ½àÃͤ¬ºÆ¤ÓÀßÄꤵ¤ì¤ë¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.SH Ãí°Õ +SVID 3 ¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Ï»þÂåÃÙ¤ì¤ÈÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£ +SVID 3 ¤Ç¤Ï +.BR rand (3) +¤¬Âå¤ï¤ê¤Ë»ÈÍѤµ¤ì¤ë¤Ù¤­¤À¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR rand (3), +.BR random (3) diff --git a/release/man3/drand48_r.3 b/release/man3/drand48_r.3 new file mode 100644 index 00000000..03e56cda --- /dev/null +++ b/release/man3/drand48_r.3 @@ -0,0 +1,107 @@ +.\" Copyright 2003 Walter Harms, 2004 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. +.\" +.\" 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" +.SH ̾Á° +drand48_r, erand48_r, lrand48_r, nrand48_r, mrand48_r, jrand48_r, srand48_r, seed48_r, lcong48_r \- °ìÍÍʬÉÛ¤¹¤ëµ¿»÷Íð¿ô¤ò¥ê¥¨¥ó¥È¥é¥ó¥È (reentrant) ¤ËÀ¸À®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int drand48_r(struct drand48_data *" buffer ", double *" result ); +.sp +.BI "int erand48_r(unsigned short " xsubi [3] "," +.br +.BI " struct drand48_data *"buffer ", double *" result ");" +.sp +.BI "int lrand48_r(struct drand48_data *" buffer ", long int *" result ); +.sp +.BI "int nrand48_r(unsigned short int " xsubi[3] "," +.br +.BI " struct drand48_data *"buffer ", long int *" result ");" +.sp +.BI "int mrand48_r(struct drand48_data *" buffer ",long int *" result ");" +.sp +.BI "int jrand48_r(unsigned short int " xsubi[3] "," +.br +.BI " struct drand48_data *" buffer ", long int *" result ");" +.sp +.BI "int srand48_r(long int " seedval ", struct drand48_data *" buffer ");" +.sp +.BI "int seed48_r(unsigned short int " seed16v[3] "," +.br +.BI " struct drand48_data *" buffer ");" +.sp +.BI "int lcong48_r(unsigned short int " param[7] "," +.br +.BI " struct drand48_data *" buffer ");" +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô: +.\" .BR drand48_r (), +.\" .BR erand48_r (), +.\" .BR lrand48_r (), +.\" .BR nrand48_r (), +.\" .BR mrand48_r (), +.\" .BR jrand48_r (), +.\" .BR srand48_r (), +.\" .BR seed48_r (), +.\" .BR lcong48_r (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.BR drand48 (3) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤ËÎà»÷¤¹¤ë¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê´Ø¿ô¤Ç¤¢¤ë¡£ +Âç°èŪ¤ÊÍð¿ôÀ¸À®¤Î¾õÂÖ¤òÊѹ¹¤¹¤ëÂå¤ï¤ê¤Ë¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤Ï»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿ +.I buffer +¤ò»È¤¦¡£ + +ºÇ½é¤Ë»È¤¦Á°¤Ë¡¢¤³¤Î¹½Â¤ÂΤϽé´ü²½¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +½é´ü²½¤Ï¡¢¤¿¤È¤¨¤Ð 0 ¤ÇËä¤á¤¿¤ê¡¢´Ø¿ô +.BR srand48_r (), +.BR seed48_r (), +.BR lcong48_r () +¤Î¤¤¤º¤ì¤«¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +ÊÖ¤êÃÍ¤Ï 0 ¤Ç¤¢¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ê¡¢°Ü¿¢À­¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR drand48 (3), +.BR rand (3), +.BR random (3) diff --git a/release/man3/dysize.3 b/release/man3/dysize.3 new file mode 100644 index 00000000..414b2e5d --- /dev/null +++ b/release/man3/dysize.3 @@ -0,0 +1,61 @@ +.\" Copyright 2001 Walter Harms (walter.harms@informatik.uni-oldenburg.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. +.\" +.\" aeb: some corrections +.\" +.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. +.\" Translated Sun 6 Jan 2002 by NAKANO Takeo +.\" +.TH DYSIZE 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +dysize \- Í¿¤¨¤¿Ç¯¤ÎÆü¿ô¤òÊÖ¤¹ +.SH ½ñ¼° +.B "#include " +.sp +.BI "int dysize(int " year ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR dysize (): +_BSD_SOURCE || _SVID_SOURCE +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤ÏÄ̾ï¤Îǯ¤Ë¤Ï 365 ¤òÊÖ¤·¡¢¤¦¤ë¤¦Ç¯¤Ë¤Ï 366 ¤òÊÖ¤¹¡£ +¤¦¤ë¤¦Ç¯¤Î·×»»¤Ï¼¡¤Î¼°¤Ë¤è¤ë: +.sp +(year) %4 == 0 && ((year) %100 != 0 || (year) %400 == 0) +.sp +¤³¤Î¼°¤Ï +.I __isleap(year) +¥Þ¥¯¥í¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +.I +¤Ë¤â¤¢¤ë¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï SunOS 4.x ¤ÇÀ¸¤Þ¤ì¤¿¡£ +.SH Ãí°Õ +¤³¤ì¤Ï¸ß´¹ÍѤδؿô¤Ë²á¤®¤Ê¤¤¡£¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï»È¤ï¤Ê¤¤¤³¤È¡£ +¤³¤Î´Ø¿ô¤Î SCO ÈÇ¤Ë¤Ï 2000 ǯÌäÂ꤬´Þ¤Þ¤ì¤Æ¤¤¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR strftime (3) diff --git a/release/man3/ecvt.3 b/release/man3/ecvt.3 new file mode 100644 index 00000000..50d1922d --- /dev/null +++ b/release/man3/ecvt.3 @@ -0,0 +1,118 @@ +.\" 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 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 2009-03-15 "" "Linux Programmer's Manual" +.SH ̾Á° +ecvt, fcvt \- ÉâÆ°¾®¿ôÅÀ¿ô¤Îʸ»úÎó¤Ø¤ÎÊÑ´¹ +.SH ½ñ¼° +.B #include +.sp +.BI "char *ecvt(double " number ", int " ndigits ", int *" decpt , +.BI "int *" sign ); +.sp +.BI "char *fcvt(double " number ", int " ndigits ", int *" decpt , +.BI "int *" sign ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR ecvt (), +.BR fcvt (): +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +´Ø¿ô +.BR ecvt () +¤Ï \fInumber\fP ¤ò NUL ʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿ +\fIndigits\fP ʸ»ú¤Îʸ»úÎó¤ØÊÑ´¹¤·¡¢¤½¤Îʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹ +(\fIndigits\fP ¤¬ +.I double +¤ÎÀºÅ٤ˤè¤Ã¤Æ·èÄꤵ¤ì¤ë¥·¥¹¥Æ¥à°Í¸¤Î¾å¸ÂÃͤè¤êÂ礭¤¤¾ì¹ç¤Ï¡¢ +¤½¤Î¾ò·ïÃͤ¬ \fIndigits\fP ¤ÎÃͤȤʤë)¡£ +.I number +¤¬ 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢ºÇ¾å°Ì¤Î·å¤Ï 0 °Ê³°¤Ç¤¢¤ë¡£ +ºÇ²¼°Ì¤Î·å¤Ï´Ý¤á¤é¤ì¤ë¡£ +ʸ»úÎó¤Ë¤Ï¾®¿ôÅÀ¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£¤½¤Î¤«¤ï¤ê¤Ë¡¢Ê¸»úÎó¤ÎÀèƬ¤«¤é¤Î¾®¿ôÅÀ¤Î +°ÌÃÖ¤¬ \fI*decpt\fP ¤ËÊÝ»ý¤µ¤ì¤ë¡£ +\fI*decpt\fP ¤¬Éé¤ÎÃͤξì¹ç¡¢¾®¿ôÅÀ¤¬Ê¸»úÎó¤ÎÀèƬ¤Îº¸Â¦¤Ë¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¤â¤·(\fInumber\fP¤Î)Éä¹æ¤¬Éé¤Ê¤é¤Ð \fI*sign\fP ¤Ï 0 °Ê³°¤ÎÃͤˡ¢ +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤ËÀßÄꤵ¤ì¤ë¡£ +.I number +¤¬ 0 ¤Ê¤é¡¢\fI*decpt\fP ¤¬ 0 ¤« 1 ¤«¤Ï̤µ¬Äê¤Ç¤¢¤ë¡£ +.PP +´Ø¿ô +.BR fcvt () +¤Ï +.BR ecvt () +¤ÈƱ¤¸µ¡Ç½¤ò»ý¤Ä¤¬¡¢\fIndigits\fP ¤Ï¾®¿ôÅÀ°Ê²¼¤Îʸ»ú¿ô¤ò»ØÄꤹ¤ë¡£ +.SH ÊÖ¤êÃÍ +´Ø¿ô +.BR ecvt () +¤È +.BR fcvt () +¤Ï \fInumber\fP ¤Î ASCII ɽ¸½¤ò´Þ¤à +ÀÅŪ¤ÊÎΰèÆâ¤Îʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Îʸ»úÎó¤Ï +.BR ecvt () +¤ä +.BR fcvt () +¤Î¸Æ¤Ó½Ð¤·¤Î¤¿¤Ó¤Ë¾å½ñ¤­¤µ¤ì¤ë¡£ +.SH ½àµò +SVr2¡£ +POSIX.1-2001 ¤Ç¤Ï¡Ö²áµî¤Î̾»Ä (LEGACY)¡×¤È°ÌÃÖÉÕ¤±¤é¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2008 ¤Ç¤Ï +.BR ecvt () +¤È +.BR fcvt () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¡¢Âå¤ï¤ê¤Ë +.BR sprintf (3) +¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë(¤·¤«¤· +.BR snprintf (3) +¤¬¤è¤êŬÀÚ¤«¤â¤·¤ì¤Ê¤¤)¡£ +.SH Ãí°Õ +Linux libc4 ¤È libc5 ¤Ç¤Ï +.I ndigits +¤Î·¿¤Ï +.I size_t +¤È¤Ê¤Ã¤Æ¤¤¤¿¡£ +¾®¿ôÅÀ¤Ë¥Ô¥ê¥ª¥É¤ò»È¤ï¤Ê¤¤¥í¥±¡¼¥ë¤â¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ecvt_r (3), +.BR gcvt (3), +.BR qecvt (3), +.BR setlocale (3), +.BR sprintf (3) diff --git a/release/man3/ecvt_r.3 b/release/man3/ecvt_r.3 new file mode 100644 index 00000000..f2c2fa07 --- /dev/null +++ b/release/man3/ecvt_r.3 @@ -0,0 +1,99 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.\" +.\" 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 Çѻߤµ¤ì¤¿ +.\" +.TH ECVT_R 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +ecvt_r, fcvt_r, qecvt_r, qfcvt_r \- ÉâÆ°¾®¿ôÅÀ¿ô¤Îʸ»úÎó¤Ø¤ÎÊÑ´¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int ecvt_r(double " number ", int " ndigits ", int *" decpt , +.BI " int *" sign ", char *" buf ", size_t " len ); +.sp +.BI "int fcvt_r(double " number ", int " ndigits ", int *" decpt , +.BI " int *" sign ", char *" buf ", size_t " len ); +.sp +.BI "int qecvt_r(long double " number ", int " ndigits ", int *" decpt , +.BI " int *" sign ", char *" buf ", size_t " len ); +.sp +.BI "int qfcvt_r(long double " number ", int " ndigits ", int *" decpt , +.BI " int *" sign ", char *" buf ", size_t " len ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR ecvt_r (), +.BR fcvt_r (), +.BR qecvt_r (), +.BR qfcvt_r (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.ad b +.SH ÀâÌÀ +´Ø¿ô +.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) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤ò¡¢¤½¤ì°Ê³°¤Ï \-1 ¤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÇѻߤµ¤ì¤¿¡£Âå¤ï¤ê¤Ë +.BR sprintf (3) +¤Î»ÈÍѤò¿ä¾©¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ecvt (3), +.BR qecvt (3), +.BR sprintf (3) diff --git a/release/man3/encrypt.3 b/release/man3/encrypt.3 new file mode 100644 index 00000000..bf1de552 --- /dev/null +++ b/release/man3/encrypt.3 @@ -0,0 +1,168 @@ +.\" Copyright 2000 Nicolas Lichtmaier +.\" Created 2000-07-22 00:52-0300 +.\" +.\" 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. +.\" +.\" Modified 2002-07-23 19:21:35 CEST 2002 Walter Harms +.\" +.\" +.\" 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 Éü¹æ²½ +.\" +.TH ENCRYPT 3 2003-04-04 "" "Linux Programmer's Manual" +.SH ̾Á° +encrypt, setkey, encrypt_r, setkey_r \- 64 ¥Ó¥Ã¥È¤Î¥á¥Ã¥»¡¼¥¸¤ò°Å¹æ²½¤¹¤ë +.SH ½ñ¼° +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "void encrypt(char " block "[64], int " edflag ); +.sp +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "void setkey(const char *" key ); +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "void setkey_r(const char *" key ", struct crypt_data *" data ); +.br +.BI "void encrypt_r(char *" block ", int " edflag \ +", struct crypt_data *" data ); +.sp +¤³¤ì¤é¤Î´Ø¿ô¤Ï \fI\-lcrypt\fP ¤Ç¥ê¥ó¥¯¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢64 ¥Ó¥Ã¥È¤Î¥á¥Ã¥»¡¼¥¸¤Î°Å¹æ²½¤ÈÉü¹æ²½¤ò¹Ô¤¦¡£ +.BR setkey () +´Ø¿ô¤Ï +.BR encrypt () +¤Ë¤è¤Ã¤Æ»È¤ï¤ì¤ë°Å¹æ¸°¤òÀßÄꤹ¤ë¡£ +¤³¤³¤Ç»È¤ï¤ì¤ë°ú¤­¿ô +.I key +¤Ï 64 ¥Ð¥¤¥È¤ÎÇÛÎó¤Ç¤¢¤ê¡¢³Æ¥Ð¥¤¥È¤Ï¿ôÃÍ 1 ¤Þ¤¿¤Ï 0 ¤Ç¤¢¤ë¡£ +n=8*i-1 ¤ËÂФ¹¤ë¥Ð¥¤¥È key[n] ¤Ï̵»ë¤µ¤ì¤ë¤Î¤Ç¡¢ +Í­¸ú¤Ê°Å¹æ¸°¤ÎŤµ¤Ï 56 ¥Ó¥Ã¥È¤Ë¤Ê¤ë¡£ +.PP +.BR encrypt () +´Ø¿ô¤Ï¡¢ +.I edflag +¤¬ 0 ¤Î¾ì¹ç¤Ï°Å¹æ²½¤·¡¢1 ¤¬ÅϤµ¤ì¤¿¾ì¹ç¤ÏÉü¹æ²½¤¹¤ë¤È¤¤¤¦¤è¤¦¤Ë¡¢ +ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤òÊѹ¹¤¹¤ë¡£ +°ú¤­¿ô +.I key +¤ÈƱÍͤˡ¢ +.I block +¤Ï¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿¼ÂºÝ¤ÎÃͤòɽ¸½¤¹¤ë¥Ó¥Ã¥È¤ÎÇÛÎó¤Ç¤¢¤ë¡£ +·ë²Ì¤Ï¤³¤ÎƱ¤¸ÇÛÎó¤ò»È¤Ã¤ÆÊÖ¤µ¤ì¤ë¡£ +.PP +¤³¤ì¤é 2 ¤Ä¤Î´Ø¿ô¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È (reentrant) ¤Ç¤Ï¤Ê¤¤¡£ +¤Ä¤Þ¤ê°Å¹æ¸°¥Ç¡¼¥¿¤ÏÀÅŪ¤ÊÎΰè¤ËÊݸ¤µ¤ì¤ë¡£ +´Ø¿ô +.BR setkey_r () +¤È +.BR encrypt_r () +¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï°Å¹æ¸°¥Ç¡¼¥¿¤òÊÝ»ý¤¹¤ë¤¿¤á¤Ë°Ê²¼¤Î¤è¤¦¤Ê¹½Â¤ÂΤò»È¤¦¡£ +.in +4n +.nf + +struct crypt_data { + char keysched[16 * 8]; + char sb0[32768]; + char sb1[32768]; + char sb2[32768]; + char sb3[32768]; + char crypt_3_buf[14]; + char current_salt[2]; + long int current_saltbits; + int direction; + int initialized; +}; +.fi +.in +.PP +.BR setkey_r () +¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë¤Ï¡¢ +.I data\->initialized +¤ò 0 ¤ËÀßÄꤹ¤ë¤³¤È¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤Ê¤Ë¤âÃͤòÊÖ¤µ¤Ê¤¤¡£ +.SH ¥¨¥é¡¼ +¾åµ­¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë +.I errno +¤ò 0 ¤ËÀßÄꤹ¤ë¤³¤È¡£ +À®¸ù¤·¤¿¾ì¹ç¡¢¤³¤ÎÃͤÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.TP +.B ENOSYS +(Î㤨¤Ð°ÊÁ°¤Î¥¢¥á¥ê¥«¹ç½°¹ñÍ¢½Ðµ¬À©¤Ê¤É¤Ë¤è¤ê) +¤³¤Î´Ø¿ô¤¬Ä󶡤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +´Ø¿ô +.BR encrypt () +¤È +.BR setkey () +¤Ï SVr4, SUSv2, and POSIX.1-2001 ¤Ë½àµò¤¹¤ë¡£ +´Ø¿ô +.BR encrypt_r () +¤È +.BR setkey_r () +¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +glibc 2.2 ¤Ç¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï DES ¥¢¥ë¥´¥ê¥º¥à¤ò»È¤¦¡£ +.SH Îã +¤³¤ÎÎã¤ò glibc ¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤Ë¤Ï libcrypt ¤È¥ê¥ó¥¯¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¼ÂºÝ¤ËÆ°ºî¤µ¤»¤ë¤¿¤á¤Ë¤Ï¡¢ÇÛÎó +.I key[] +¤È +.I txt[] +¤ËÍ­¸ú¤Ê¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.sp +.nf +#define _XOPEN_SOURCE +#include +#include + +int +main(void) +{ + char key[64]; /* bit pattern for key */ + char txt[64]; /* bit pattern for messages */ + + setkey(key); + encrypt(txt, 0); /* encode */ + encrypt(txt, 1); /* decode */ +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR cbc_crypt (3), +.BR crypt (3), +.BR ecb_crypt (3), +.\" .BR fcrypt (3), +.BR feature_test_macros (7) diff --git a/release/man3/end.3 b/release/man3/end.3 new file mode 100644 index 00000000..b2fc8296 --- /dev/null +++ b/release/man3/end.3 @@ -0,0 +1,113 @@ +.\" Copyright (c) 2008, Linux Foundation, written by 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. +.\" 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" +.SH ̾Á° +etext, edata, end \- ¥×¥í¥°¥é¥à¥»¥°¥á¥ó¥È¤Î½ª¤ï¤ê +.SH ½ñ¼° +.nf +.BI extern " etext" ; +.BI extern " edata" ; +.BI extern " end" ; +.fi +.SH ÀâÌÀ +¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤Î¥¢¥É¥ì¥¹¤Ï³Æ¼ï¤Î¥×¥í¥°¥é¥à¥»¥°¥á¥ó¥È¤Î½ª¤ï¤ê¤ò¼¨¤¹¡£ +.TP +.I etext +¥Æ¥­¥¹¥È¥»¥°¥á¥ó¥È (¥×¥í¥°¥é¥à¤Î¥³¡¼¥É) ¤ÎËöÈø¤Î¼¡¤Î¥¢¥É¥ì¥¹¡£ +.TP +.I edata +½é´ü²½¤µ¤ì¤¿¥Ç¡¼¥¿¤Î¥»¥°¥á¥ó¥È¤ÎËöÈø¤Î¼¡¤Î¥¢¥É¥ì¥¹¡£ +.TP +.I end +½é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ç¡¼¥¿¤Î¥»¥°¥á¥ó¥È (BSS ¥»¥°¥á¥ó¥È¤È¤â¸À¤ï¤ì¤ë) +¤ÎËöÈø¤Î¼¡¤Î¥¢¥É¥ì¥¹¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤ÏĹǯ¤Û¤È¤ó¤É¤Î Unix ¥·¥¹¥Æ¥à¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +ɸ½à²½¤µ¤ì¤Æ¤Ï¤¤¤Ê¤¤¡£Ãí°Õ¤·¤Æ»È¤¦¤³¤È¡£ +.SH Ãí°Õ +¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤ÏÌÀ¼¨Åª¤ËÀë¸À¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤é¤Ï¤É¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ç¤âÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤Î̾Á°¤ÏÁ°¤Ë¥¢¥ó¥À¡¼¥¹¥³¥¢¤¬ +ÉÕ¤¤¤Æ¤¤¤Æ¡¢ +.IR _etext , +.IR _edata , +.I _end +¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +Linux ¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤Ç¤âÄêµÁ¤µ¤ì¤ë¡£ + +¥×¥í¥°¥é¥à¤Î¼Â¹Ô³«»Ï»þ¤Ë¡¢¥×¥í¥°¥é¥à¡¦¥Ö¥ì¡¼¥¯¤Ï +.I &end +¤Î¶á¤¯¤Î¤É¤³¤« (¤ª¤½¤é¤¯¼¡¤Î¥Ú¡¼¥¸¤ÎÀèƬ) ¤Ë¤Ê¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢ +.BR brk (2) +¤ä +.BR malloc (3) +¤Ç¥á¥â¥ê¤¬³ä¤êÅö¤Æ¤é¤ì¤ë¤ËÏ¢¤ì¤Æ¡¢¥×¥í¥°¥é¥à¡¦¥Ö¥ì¡¼¥¯¤ÏÊѲ½¤·¤Æ¤¤¤¯¡£ +°ú¤­¿ô¤Ë 0 ¤ò»ØÄꤷ¤Æ +.BR sbrk (2) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢¥×¥í¥°¥é¥à¡¦¥Ö¥ì¡¼¥¯¤Î¸½ºßÃͤòÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.SH Îã +²¼µ­¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤È¡¢¼¡¤Î¤è¤¦¤Ê½ÐÎϤ¬ÆÀ¤é¤ì¤ë¡£ +.in +4n +.nf + +.RB "$" " ./a.out" +First address past: + program text (etext) 0x8048568 + initialized data (edata) 0x804a01c + uninitialized data (end) 0x804a024 +.fi +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.in +.nf +#include +#include + +extern char etext, edata, end; /* The symbols must have some type, + or "gcc -Wall" complains */ + +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); + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR objdump (1), +.BR readelf (1), +.BR sbrk (2), +.BR elf (5) diff --git a/release/man3/envz_add.3 b/release/man3/envz_add.3 new file mode 100644 index 00000000..28fb1ed6 --- /dev/null +++ b/release/man3/envz_add.3 @@ -0,0 +1,142 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" based on the description in glibc source and infopages +.\" +.\" Corrections and additions, aeb +.\" +.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI, all rights reserved. +.\" Translated Mon Feb 2 2003 by Akihiro MOTOKI +.\" +.TH ENVZ_ADD 3 2007-05-18 "" "Linux Programmer's Manual" +.SH ̾Á° +envz_add, envz_entry, envz_get, envz_merge, +envz_remove, envz_strip \- ´Ä¶­ÊÑ¿ôʸ»úÎó¤ÎÁàºî +.SH ½ñ¼° +.nf +.B "#include " + +.BI "error_t envz_add(char **" envz ", size_t *" envz_len , +.ti 20n +.BI "const char *" name ", const char *" value ); + +.BI "char *envz_entry(const char *" envz ", size_t *" envz_len \ +", const char *" name ); + +.BI "char *envz_get(const char *" envz ", size_t *" envz_len \ +", const char *" name ); + +.BI "error_t envz_merge(char **" envz ", size_t *" envz_len , +.ti 20n +.BI "const char *" envz2 ", size_t " envz2_len ", int " override ); + +.BI "void envz_remove(char **" envz ", size_t *" envz_len \ +", const char *" name ); + +.BI "void envz_strip(char **" envz ", size_t *" envz_len ); +.fi +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô glibc ¸ÇÍ­¤Ç¤¢¤ë¡£ +.LP +argz vector ¤ÏŤµ¾ðÊóÉÕ¤­¤Îʸ»ú¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.BR argz_add (3) +¤ò»²¾È¤Î¤³¤È¡£ +envz vector ¤Ï¡¢Ê¸»úÎó¤¬ "name=value (̾Á°=ÃÍ)" ¤Î·Á¼°¤Ë¤Ê¤Ã¤Æ¤¤¤ëÆÃÊÌ¤Ê +argz vector ¤Ç¤¢¤ë¡£ +ºÇ½é¤Î \(aq=\(aq °Ê¹ß¤Ï¤¹¤Ù¤ÆÃͤȤߤʤµ¤ì¤ë¡£\(aq=\(aq ¤¬¤Ê¤±¤ì¤Ð¡¢ +ÃÍ¤Ï NULL ¤È²ò¼á¤µ¤ì¤ë¡£(ʸ»úÎó¤Î°ìÈֺǸå¤Îʸ»ú¤¬ \(aq=\(aq ¤Î¾ì¹ç¡¢Ãͤ϶õʸ»úÎó +"" ¤È²ò¼á¤µ¤ì¤ë¡£) +.LP +¤³¤ì¤é¤Î´Ø¿ô¤Ï envz vector ¤òÁàºî¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.LP +.BR envz_add () +¤Ï¡¢Ê¸»úÎó +.RI \&" name = value \&" +.RI ( value +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç) ¤Þ¤¿¤Ï +.RI \&" name \&" +.RI ( value +¤¬ NULL ¤Î¾ì¹ç) ¤ò +envz vector +.RI ( *envz ,\ *envz_len ) +¤ËÄɲä·¡¢ +.I *envz +¤È +.I *envz_len +¤ò¹¹¿·¤¹¤ë¡£ +.I name +¤ÈƱ¤¸Ì¾Á°¤ò»ý¤Ä¥¨¥ó¥È¥ê¤¬¤¢¤Ã¤¿¾ì¹ç¡¢¸µ¤Î¥¨¥ó¥È¥ê¤Ïºï½ü¤µ¤ì¤ë¡£ +.LP +.BR envz_entry () +¤Ï¡¢envz vector +.RI ( envz ,\ envz_len ) +¤«¤é̾Á°¤¬ +.I name +¤Î¥¨¥ó¥È¥ê¤ò¸¡º÷¤¹¤ë¡£ +¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ï¤½¤Î¥¨¥ó¥È¥ê¤òÊÖ¤·¡¢¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.LP +.BR envz_get () +¤Ï¡¢envz vector +.RI ( envz ,\ envz_len ) +¤«¤é̾Á°¤¬ +.I name +¤Î¥¨¥ó¥È¥ê¤ò¸¡º÷¤¹¤ë¡£ +¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ï¥¨¥ó¥È¥ê¤ÎÃͤòÊÖ¤·¡¢¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +(ÃÍ¤Ï NULL ¤Î¾ì¹ç¤â¤¢¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£Ì¾Á°¤¬ +.I name +¤Î¥¨¥ó¥È¥ê¤Ë \(aq=\(aq Éä¹æ¤¬¤Ê¤¤¾ì¹ç¤¬³ºÅö¤¹¤ë¡£) +.LP +.BR envz_merge () +¤Ï¡¢ +.BR envz_add () +¤ÈƱ¤¸¤è¤¦¤Ë +.I envz2 +¤Î³Æ¥¨¥ó¥È¥ê¤ò +.I *envz +¤ËÄɲ乤롣 +.I override +¤¬¿¿¤Î¾ì¹ç¡¢ +.I envz2 +¤ÎÃÍ¤Ç +.I *envz +Æâ¤ÎƱ¤¸Ì¾Á°¤ò¤â¤ÄÃͤϾå½ñ¤­¤µ¤ì¤ë¡£ +µ¶¤Î¾ì¹ç¤Ï¾å½ñ¤­¤µ¤ì¤Ê¤¤¡£ +.LP +.BR envz_remove () +¤Ï¡¢Ì¾Á°¤¬ +.I name +¤Î¥¨¥ó¥È¥ê¤¬¤¢¤ì¤Ð +.RI ( *envz ,\ *envz_len ) +¤«¤éºï½ü¤¹¤ë¡£ +.LP +.BR envz_strip () +¤Ï¡¢Ãͤ¬ NULL ¤Î¥¨¥ó¥È¥ê¤ò¤¹¤Ù¤Æºï½ü¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +¥á¥â¥ê³ä¤êÅö¤Æ¤ò¹Ô¤¦ envz ´Ø¿ô·²¤Ï¤¹¤Ù¤Æ \fIerror_t\fP ·¿¤ÎÊÖ¤êÃͤò»ý¤Ä¡£ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤·¡¢³ä¤êÅö¤Æ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï +\fBENOMEM\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£Ãí°Õ¤·¤Æ»ÈÍѤ¹¤ë¤³¤È¡£ +.SH Îã +.nf +#include +#include +#include + +int +main(int argc, char *argv[], char *envp[]) +{ + int i, e_len = 0; + char *str; + + for (i = 0; envp[i] != NULL; i++) + e_len += strlen(envp[i]) + 1; + + str = envz_entry(*envp, e_len, "HOME"); + printf("%s\en", str); + str = envz_get(*envp, e_len, "HOME"); + printf("%s\en", str); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR argz_add (3) diff --git a/release/man3/erf.3 b/release/man3/erf.3 new file mode 100644 index 00000000..9cb69b72 --- /dev/null +++ b/release/man3/erf.3 @@ -0,0 +1,125 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 ÈóÀµµ¬²½¤Î +.\" +.TH ERF 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +erf, erff, erfl \- ¸íº¹´Ø¿ô +.SH ½ñ¼° +.nf +.B #include + +.BI "double erf(double " x ); +.BI "float erff(float " x ); +.BI "long double erfl(long double " x ); + +.fi +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR erf (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR erff (), +.BR erfl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600|| _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR erf () +¤Ï \fIx\fP ¤Î¸íº¹´Ø¿ô¤òÊÖ¤¹´Ø¿ô¤Ç¡¢°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP + erf(x) = 2/sqrt(pi)* integral from 0 to x of exp(\-t*t) dt +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤Î¸íº¹´Ø¿ô¤òÊÖ¤¹¡£ +ÊÖ¤êÃÍ¤Ï [\-1,\ 1] ¤ÎÈϰϤȤʤ롣 + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 (\-0) ¤Î¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Î¾ì¹ç¡¢+1 (\-1) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ÈóÀµµ¬²½¿ô¤Î¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢ +ÊÖ¤êÃÍ¤Ï 2*x/sqrt(pi) ¤È¤Ê¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼ (range error): ·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë (\fIx\fP ¤¬ÈóÀµµ¬²½¿ô) +.\" .I errno +.\" is set to +.\" .BR ERANGE . +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.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 +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cerf (3), +.BR erfc (3), +.BR exp (3) diff --git a/release/man3/erfc.3 b/release/man3/erfc.3 new file mode 100644 index 00000000..86d19da3 --- /dev/null +++ b/release/man3/erfc.3 @@ -0,0 +1,123 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-09-15, Akihiro MOTOKI +.\" +.\"WORD: subnormal ÈóÀµµ¬²½¤Î +.\" +.TH ERFC 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +erfc, erfcf, erfcl \- ÁêÊä¸íº¹´Ø¿ô +.SH ½ñ¼° +.nf +.B #include + +.BI "double erfc(double " x ); +.BI "float erfcf(float " x ); +.BI "long double erfcl(long double " x ); + +.fi +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR erfc (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR erfcf (), +.BR erfcl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600|| _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR erfc () +´Ø¿ô¤Ï +.I x +¤ÎÁêÊä¸íº¹´Ø¿ô¡¢¤Ä¤Þ¤ê 1.0 \- erf(x) ¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÁêÊä¸íº¹´Ø¿ô¤òÊÖ¤¹¡£ +ÊÖ¤êÃÍ¤Ï [0,2] ¤ÎÈϰϤȤʤ롣 + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 ¤« \-0 ¤Î¾ì¹ç¡¢1 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢+2 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +´Ø¿ô¤Î·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤·¡¢É½¸½¤Ç¤­¤Ê¤¤ÃͤȤʤë¾ì¹ç¤Ï¡¢ +ÊÖ¤êÃÍ¤Ï 0.0 ¤È¤Ê¤ë¡£ + +´Ø¿ô¤Î·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¤¬¡¢ +ɽ¸½¤Ç¤­¤ëÃÍ (¤Ä¤Þ¤êÈóÀµµ¬²½¿ô (subnormal)) ¤È¤Ê¤ë¾ì¹ç¤Ï¡¢ +.\" Î㤨¤Ð x86-32 ¤Ç¤Î erfc(27) +¤½¤ÎÃͤ¬ÊÖ¤µ¤ì¡¢ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼ (·ë²Ì¤¬ÈóÀµµ¬²½¿ô) +.\" .I errno +.\" is set to +.\" .BR ERANGE . +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.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 +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.BR erfc () +´Ø¿ô¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢ +.I x +¤¬Â礭¤ÊÃͤξì¹ç¤Ë (erf(x) ¤ÎÃÍ¤Ï 1 ¤Ë¶áÉÕ¤¤¤Æ¤¤¤¯¤³¤È¤Ç) +1-erf(x) ¤Î·×»»¤Ë¤ª¤¤¤ÆÀºÅÙ¤¬¼º¤ï¤ì¤ë¤Î¤òÈò¤±¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cerf (3), +.BR erf (3), +.BR exp (3) diff --git a/release/man3/err.3 b/release/man3/err.3 new file mode 100644 index 00000000..b1083684 --- /dev/null +++ b/release/man3/err.3 @@ -0,0 +1,162 @@ +.\" Copyright (c) 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. +.\" +.\" From: @(#)err.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/gen/err.3,v 1.11.2.5 2001/08/17 15:42:32 ru Exp $ +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.TH ERR 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +err, verr, errx, verrx, warn, vwarn, warnx, vwarnx \- ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÀ°·Á¤¹¤ë +.Nd +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void err(int " eval ", const char *" fmt ", ...);" +.sp +.BI "void errx(int " eval ", const char *" fmt ", ...);" +.sp +.BI "void warn(const char *" fmt ", ...);" +.sp +.BI "void warnx(const char *" fmt ", ...);" +.sp +.B #include +.sp +.BI "void verr(int " eval ", const char *" fmt ", va_list " args ); +.sp +.BI "void verrx(int " eval ", const char *" fmt ", va_list " args ); +.sp +.BI "void vwarn(const char *" fmt ", va_list " args ); +.sp +.BI "void vwarnx(const char *" fmt ", va_list " args ); +.fi +.SH ÀâÌÀ +.BR err () +´Ø¿ô·²¤È +.BR warn () +´Ø¿ô·²¤Ï¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÀ°·Á¤·¤Æɸ½à¥¨¥é¡¼½ÐÎϤËɽ¼¨¤¹¤ë¡£ +¤É¤Î´Ø¿ô¤Î¾ì¹ç¤â¡¢(¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤ò¾Ê¤¤¤¿)¥×¥í¥°¥é¥à̾¡¢ +¥³¥í¥ó 1¸Ä¡¢¥¹¥Ú¡¼¥¹ 1¸Ä¤¬½ÐÎϤµ¤ì¤ë¡£ +.I fmt +°ú¤­¿ô¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.BR printf (3) +¤ÈƱÍͤËÀ°·Á¤¬¹Ô¤ï¤ì¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½ÐÎϤµ¤ì¤ë¡£ +½ÐÎϤϲþ¹Ôʸ»ú¤Ç½ª¤ï¤ë¡£ +.PP +\"O motoki: based on a code or ¡Á ¤Î¡Öa code¡×¤È¤Ï¡© +´Ø¿ô +.BR err (), +.BR verr (), +.BR warn (), +.BR vwarn () +¤Ï¡¢¥³¡¼¥É¤Þ¤¿¤Ï¥°¥í¡¼¥Ð¥ëÊÑ¿ô +.I errno +¤Ë´ð¤Å¤¤¤Æ +.BR strerror (3) +¤«¤éÆÀ¤¿¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ¹¤ë¡£ +.I fmt +°ú¤­¿ô¤¬ NULL +¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢°ì¸Ä¤º¤Ä¤Î¥³¥í¥ó¤È¥¹¥Ú¡¼¥¹¤Ë³¤±¤Æ½ÐÎϤ¹¤ë¡£ +.PP +´Ø¿ô +.BR err (), +.BR verr (), +.BR warn (), +.BR vwarn () +¤Ï¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òõ¤¹¤¿¤á¤Ë¥°¥í¡¼¥Ð¥ëÊÑ¿ô +.I errno +¤ò»ÈÍѤ¹¤ë¡£ +.PP +´Ø¿ô +.BR errx (), +.BR warnx () +¤Ï¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÉÕ¤±²Ã¤¨¤Ê¤¤¡£ +.PP +´Ø¿ô +.BR err (), +.BR verr (), +.BR errx (), +.BR verrx () +¤ÏÊÖ¤êÃͤòÊÖ¤µ¤Ê¤¤¤¬¡¢°ú¤­¿ô +.I eval +¤ÎÃͤò exit status ¤ËÀßÄꤷ½ªÎ»¤¹¤ë¡£ +.SH Îã +¸½ºß¤Î +.I errno +¤Î¾ðÊó¤òɽ¼¨¤·¡¢½ªÎ»¤¹¤ë: +.in +4n +.nf + +if ((p = malloc(size)) == NULL) + err(1, NULL); +if ((fd = open(file_name, O_RDONLY, 0)) == \-1) + err(1, "%s", file_name); +.fi +.in +.PP +¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¡¢½ªÎ»¤¹¤ë: +.in +4n +.nf + +if (tm.tm_hour < START_TIME) + errx(1, "too early, wait until %s", start_time_string); +.fi +.in +.PP +¥¨¥é¡¼¤ò·Ù¹ðɽ¼¨¤¹¤ë: +.in +4n +.nf + +if ((fd = open(raw_device, O_RDONLY, 0)) == \-1) + warnx("%s: %s: trying the block device", + raw_device, strerror(errno)); +if ((fd = open(block_device, O_RDONLY, 0)) == \-1) + err(1, "%s", block_device); +.fi +.in +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤ÏÈóɸ½à¤Î BSD ³ÈÄ¥¤Ç¤¢¤ë¡£ +.\" .SH Îò»Ë +.\" ´Ø¿ô +.\" .BR err () +.\" ¤È +.\" .BR warn () +.\" ¤Ï +.\" 4.4BSD +.\" ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR error (3), +.BR exit (3), +.BR perror (3), +.BR printf (3), +.BR strerror (3) diff --git a/release/man3/errno.3 b/release/man3/errno.3 new file mode 100644 index 00000000..60ca6c56 --- /dev/null +++ b/release/man3/errno.3 @@ -0,0 +1,542 @@ +.\" Copyright (c) 1996 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. +.\" +.\" 5 Oct 2002, Modified by Michael Kerrisk +.\" Updated for POSIX.1 2001 +.\" 2004-12-17 Martin Schulze , mtk +.\" Removed errno declaration prototype, added notes +.\" 2006-02-09 Kurt Wall, mtk +.\" Added non-POSIX errors +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-24, HIROFUMI Nishizuka +.\" Updated 1999-03-01, NAKANO Takeo +.\" Updated 1999-08-21, NAKANO Takeo +.\" Updated 2003-07-03, Akihiro MOTOKI +.\" Updated 2005-03-15, Akihiro MOTOKI +.\" Updated 2006-02-15, Akihiro MOTOKI, Catch up to LDP v2.23 +.\" Updated 2006-07-14, Akihiro MOTOKI, Catch up to LDP v2.34 +.\" Updated 2008-08-07, Akihiro MOTOKI, Catch up to LDP v3.05 +.\" +.TH ERRNO 3 2008-07-09 "" "Linux Programmer's Manual" +.SH ̾Á° +errno \- ľ¶á¤ËȯÀ¸¤·¤¿¥¨¥é¡¼¤ÎÈÖ¹æ +.SH ½ñ¼° +.B #include +.\".sp +.\".BI "extern int " errno ; +.SH ÀâÌÀ +¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.I +¤ÇÀ°¿ô·¿¤ÎÊÑ¿ô +.I errno +¤¬ÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¤¤¤¯¤Ä¤«¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿ºÝ¤Ë +¤³¤ÎÊÑ¿ô¤Ë¤½¤Î¸¶°ø¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +¤³¤ÎÃͤϸƤӽФ·¤ÎÊÖ¤êÃͤ¬¥¨¥é¡¼ (¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤Ï +\-1 ¤Ç¡¢¤Û¤È¤ó¤É¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤Ï \-1 ¤« NULL) ¤ò¼¨¤·¤¿¤È¤­¤Ë +¤Î¤ß°ÕÌ£¤ò»ý¤Ä¤¬¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤â +.I errno +¤òÊѹ¹¤¹¤ë¤³¤È¤¬µö¤µ¤ì¤Æ¤¤¤ë¡£ + +Í­¸ú¤Ê¥¨¥é¡¼ÈÖ¹æ¤Ï¤¤¤º¤ì¤â 0 °Ê³°¤ÎÃͤò»ý¤Ä¡£ +¤É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤â¥é¥¤¥Ö¥é¥ê´Ø¿ô¤â +\fIerrno\fP ¤ò 0 ¤ËÀßÄꤹ¤ë¤³¤È¤Ï¤Ê¤¤¡£ + +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô (Î㤨¤Ð +.BR getpriority (2)) +¤Ç¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤ÎÍ­¸ú¤ÊÊÖ¤êÃͤȤ·¤Æ \-1 ¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¾ì¹ç¡¢À®¸ù¤Ê¤Î¤«¥¨¥é¡¼¤Ê¤Î¤«¤ò¶èÊ̤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë +.I errno +¤ò 0 ¤ËÀßÄꤷ¤Æ¤ª¤±¤Ð¤è¤¤¡£¸Æ¤Ó½Ð¤·¤ÎÊÖ¤êÃͤ¬¥¨¥é¡¼È¯À¸¤Î²ÄǽÀ­¤ò +¼¨¤¹¤â¤Î¤À¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +.I errno +¤¬ 0 °Ê³°¤ÎÃͤ«¤ò¸«¤Æ³Îǧ¤¹¤ì¤Ð¤è¤¤¡£ + +\fIerrno\fP ¤Ï¡¢ISO C standard ¤Ç \fIint\fP ·¿¤ÎÊѹ¹²Äǽ¤Êº¸ÊÕÃÍ +¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ÌÀ¼¨Åª¤ËÀë¸À¤ò¹Ô¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤; +\fIerrno\fP ¤Ï¥Þ¥¯¥í¤Î¾ì¹ç¤â¤¢¤ê¤¨¤ë¡£ +\fIerrno\fP ¤Ï¥¹¥ì¥Ã¥ÉËè¤ËÃͤò»ý¤Ä¡£ +¤Ä¤Þ¤ê¤¢¤ë¥¹¥ì¥Ã¥É¤Ç \fIerrno\fP ¤¬ÀßÄꤵ¤ì¤Æ¤â¡¢ +¾¤Î¥¹¥ì¥Ã¥É¤Î \fIerrno\fP ¤Ë¤Ï±Æ¶Á¤·¤Ê¤¤¡£ + +POSIX.1 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î¥¨¥é¡¼Ì¾¤Ë¤Ï¡¢ +¤½¤ì¤¾¤ì°Û¤Ê¤ëÃͤ¬Âбþ¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +⤷¡¢ +.B EAGAIN +¤È +.B EWOULDBLOCK +¤ÏÎã³°¤Ç¡¢¤³¤ì¤é¤ÏƱ¤¸Ãͤò»ý¤Ã¤Æ¤â¤è¤¤¡£ + +.\" The following is now +.\" POSIX.1 (2001 ǯÈÇ) ¤Ç¤Î¥¨¥é¡¼Ì¾¥·¥ó¥Ü¥ë¤Î¥ê¥¹¥È¤ò°Ê²¼¤Ë¼¨¤¹¡£ +.\" ¤³¤ì¤é¤Î¤¦¤Á¡¢ \fBEDOM\fP ¤È \fBERANGE\fP ¤Ï ISO C standard ¤Ë¤¢¤ë¡£ +.\" ¤µ¤é¤Ë¡¢ISO C Amendment 1 ¤Ç¤Ï¡¢¥¨¥é¡¼ÈÖ¹æ \fBEILSEQ\fP ¤¬ +.\" ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ä¥ï¥¤¥Éʸ»ú¤Ç¤ÎÉä¹æ²½¥¨¥é¡¼¤òɽ¤¹¤¿¤á¤Ë +.\" ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" +.TP 16 +.B E2BIG +°ú¤­¿ô¥ê¥¹¥È¤¬Ä¹²á¤®¤ë (POSIX.1) +.TP +.B EACCES +µö²Ä¤¬¤Ê¤¤ (POSIX.1) +.TP +.B EADDRINUSE +¥¢¥É¥ì¥¹¤¬¤¹¤Ç¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë (POSIX.1) +.TP +.B EADDRNOTAVAIL +¥¢¥É¥ì¥¹¤¬»ÈÍѤǤ­¤Ê¤¤ (POSIX.1) +.\" EADV ¤Ï HURD ¤Ë¤ª¤¤¤Æ¤À¤±¤Î¥¨¥é¡¼(?) +.TP +.B EAFNOSUPPORT +¥¢¥É¥ì¥¹¡¦¥Õ¥¡¥ß¥ê¡¼¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1) +.TP +.B EAGAIN +¥ê¥½¡¼¥¹¤¬°ì»þŪ¤ËÍøÍÑÉÔ²Ä +.RB ( EWOULDBLOCK +¤ÈƱ¤¸ÃͤǤâ¤è¤¤) (POSIX.1) +.TP +.B EALREADY +Àܳ¤¬´û¤Ë½èÍýÃæ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EBADE +ÉÔÀµ¤Ê¤ä¤ê¼è¤ê (exchange) ¤Ç¤¢¤ë +.TP +.B EBADF +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EBADFD +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¤Ê¾õÂ֤Ǥ¢¤ë +.TP +.B EBADMSG +¥á¥Ã¥»¡¼¥¸¤¬ÉÔÀµ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EBADR +ÉÔÀµ¤Ê¥ê¥¯¥¨¥¹¥È¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.TP +.B EBADRQC +ÉÔÀµ¤Ê¥ê¥¯¥¨¥¹¥È¥³¡¼¥É +.TP +.B EBADSLT +ÉÔÀµ¤Ê¥¹¥í¥Ã¥È +.\" EBFONT is defined but appears not to be used by kernel or glibc. +.TP +.B EBUSY +¥ê¥½¡¼¥¹¤¬»ÈÍÑÃæ¤Ç¤¢¤ë (POSIX.1) +.TP +.B ECANCELED +Áàºî¤¬¥­¥ã¥ó¥»¥ë¤µ¤ì¤¿ (POSIX.1) +.TP +.B ECHILD +»Ò¥×¥í¥»¥¹¤¬Ìµ¤¤ (POSIX.1) +.TP +.B ECHRNG +¥Á¥ã¥ó¥Í¥ëÈֹ椬Èϰϳ°¤Ç¤¢¤ë +.TP +.B ECOMM +Á÷¿®»þ¤ËÄÌ¿®¥¨¥é¡¼¤¬È¯À¸¤·¤¿ +.TP +.B ECONNABORTED +Àܳ¤¬Ãæ»ß¤µ¤ì¤¿ (POSIX.1) +.TP +.B ECONNREFUSED +Àܳ¤¬µñÈݤµ¤ì¤¿ (POSIX.1) +.TP +.B ECONNRESET +Àܳ¤¬¥ê¥»¥Ã¥È¤µ¤ì¤¿ (POSIX.1) +.TP +.B EDEADLK +¥ê¥½¡¼¥¹¤Î¥Ç¥Ã¥É¥í¥Ã¥¯¤ò²óÈò¤·¤¿ (POSIX.1) +.TP +.B EDEADLOCK +.B EDEADLK +¤ÎƱµÁ¸ì +.TP +.B EDESTADDRREQ +°¸À襢¥É¥ì¥¹¤¬É¬ÍפǤ¢¤ë (POSIX.1) +.TP +.B EDOM +¿ô³Ø´Ø¿ô¤Ç°ú¤­¿ô¤¬Îΰ賰¤Ç¤¢¤ë (out of domain) +.\" EDOTDOT is defined but appears to be unused +.TP +.B EDQUOT +.\" POSIX just says "Reserved" +¥Ç¥£¥¹¥¯¡¦¥¯¥©¡¼¥¿ (quota) ¤òĶ²á¤·¤¿ (POSIX.1) +.TP +.B EEXIST +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë (POSIX.1) +.TP +.B EFAULT +¥¢¥É¥ì¥¹¤¬ÉÔÀµ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EFBIG +¥Õ¥¡¥¤¥ë¤¬Â礭²á¤®¤ë (POSIX.1) +.TP +.B EHOSTDOWN +¥Û¥¹¥È¤¬¥À¥¦¥ó¤·¤Æ¤¤¤ë +.TP +.B EHOSTUNREACH +¥Û¥¹¥È¤ËÅþãÉÔǽ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EIDRM +¼±Ê̻Ҥ¬ºï½ü¤µ¤ì¤¿ (POSIX.1) +.TP +.B EILSEQ +ÉÔÀµ¤Ê¥Ð¥¤¥ÈÎó (POSIX.1, C99) +.TP +.B EINPROGRESS +Áàºî¤¬¼Â¹ÔÃæ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EINTR +´Ø¿ô¸Æ¤Ó½Ð¤·¤¬³ä¤ê¹þ¤Þ¤ì¤¿ (POSIX.1); +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +°ú¿ô¤¬Ìµ¸ú¤Ç¤¢¤ë (POSIX.1) +.TP +.B EIO +Æþ½ÐÎÏ¥¨¥é¡¼ (POSIX.1) +.TP +.B EISCONN +¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤ë (POSIX.1) +.TP +.B EISDIR +¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë (POSIX.1) +.TP +.B EISNAM +̾Á°ÉÕ¤­¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë +.TP +.B EKEYEXPIRED +¸°¤¬´ü¸ÂÀÚ¤ì¤È¤Ê¤Ã¤¿ +.TP +.B EKEYREJECTED +¸°¤¬¥µ¡¼¥Ð¤Ë¤è¤êµñÈݤµ¤ì¤¿ +.TP +.B EKEYREVOKED +¸°¤¬Ìµ¸ú¤È¤Ê¤Ã¤¿ +.TP +.B EL2HLT +Ää»ß (¥ì¥Ù¥ë 2) +.TP +.B EL2NSYNC +Ʊ´ü¤Ç¤­¤Æ¤¤¤Ê¤¤ (¥ì¥Ù¥ë 2) +.TP +.B EL3HLT +Ää»ß (¥ì¥Ù¥ë 3) +.TP +.B EL3RST +¥ê¥»¥Ã¥È (¥ì¥Ù¥ë 3) +.TP +.B ELIBACC +ɬÍפʶ¦Í­¥é¥¤¥Ö¥é¥ê¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿ +.TP +.B ELIBBAD +²õ¤ì¤¿¶¦Í­¥é¥¤¥Ö¥é¥ê¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤¿ +.TP +.B ELIBMAX +¥ê¥ó¥¯¤·¤è¤¦¤È¤·¤¿¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬Â¿²á¤®¤ë +.TP +.B ELIBSCN +a.out ¤Î¥é¥¤¥Ö¥é¥ê¥»¥¯¥·¥ç¥ó¤¬²õ¤ì¤Æ¤¤¤ë (corrupted) +.TP +.B ELIBEXEC +¶¦Í­¥é¥¤¥Ö¥é¥ê¤òľÀܼ¹ԤǤ­¤Ê¤«¤Ã¤¿ +.TP +.B ELOOP +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î²ó¿ô¤¬Â¿²á¤®¤ë (POSIX.1) +.\" ELNRNG is defined but appears to be unused +.TP +.B EMEDIUMTYPE +´Ö°ã¤Ã¤¿¥á¥Ç¥£¥¢¼ïÊ̤Ǥ¢¤ë +.TP +.B EMFILE +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬Â¿²á¤®¤ë (POSIX.1) +.TP +.B EMLINK +¥ê¥ó¥¯¤¬Â¿²á¤®¤ë (POSIX.1) +.TP +.B EMSGSIZE +¥á¥Ã¥»¡¼¥¸¤¬Ä¹²á¤®¤ë (POSIX.1) +.TP +.B EMULTIHOP +.\" POSIX says "Reserved" +¥Þ¥ë¥Á¥Û¥Ã¥× (multihop) ¤ò»î¤ß¤¿ (POSIX.1) +.TP +.B ENAMETOOLONG +¥Õ¥¡¥¤¥ë̾¤¬Ä¹²á¤®¤ë (POSIX.1) +.\" ENAVAIL is defined, but appears not to be used +.TP +.B ENETDOWN +¥Í¥Ã¥È¥ï¡¼¥¯¤¬ÉÔÄ̤Ǥ¢¤ë (POSIX.1) +.TP +.B ENETRESET +Àܳ¤¬¥Í¥Ã¥È¥ï¡¼¥¯Â¦¤«¤éÃæ»ß¤µ¤ì¤¿ (POSIX.1) +.TP +.B ENETUNREACH +¥Í¥Ã¥È¥ï¡¼¥¯¤¬ÅþãÉÔǽ¤Ç¤¢¤ë (POSIX.1) +.TP +.B ENFILE +¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬Â¿²á¤®¤ë (POSIX.1) +.\" ENOANO is defined but appears to be unused. +.TP +.B ENOBUFS +»ÈÍѲÄǽ¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬¤Ê¤¤ (POSIX.1 (XSI STREAMS option)) +.\" ENOCSI is defined but appears to be unused. +.TP +.B ENODATA +¥¹¥È¥ê¡¼¥à¤ÎÆɤ߽Ф·¥­¥å¡¼¤ÎÀèƬ¤ËÆɤ߽Ф·²Äǽ¤Ê¥á¥Ã¥»¡¼¥¸¤¬¤Ê¤¤ +(POSIX.1) +.TP +.B ENODEV +¤½¤Î¤è¤¦¤Ê¥Ç¥Ð¥¤¥¹¤Ï̵¤¤ (POSIX.1) +.TP +.B ENOENT +¤½¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤Ï̵¤¤ (POSIX.1) +.TP +.B ENOEXEC +¼Â¹Ô¥Õ¥¡¥¤¥ë·Á¼°¤Î¥¨¥é¡¼ (POSIX.1) +.TP +.B ENOKEY +Í׵ᤵ¤ì¤¿¸°¤¬ÍøÍѤǤ­¤Ê¤¤ +.TP +.B ENOLCK +ÍøÍѤǤ­¤ë¥í¥Ã¥¯¤¬Ìµ¤¤ (POSIX.1) +.TP +.B ENOLINK +.\" POSIX says "Reserved" +¥ê¥ó¥¯¤¬ÀÚ¤ì¤Æ¤¤¤ë (POSIX.1) +.TP +.B ENOMEDIUM +¥á¥Ç¥£¥¢¤¬¸«¤Ä¤«¤é¤Ê¤¤ +.TP +.B ENOMEM +½½Ê¬¤Ê¶õ¤­¥á¥â¥êÎΰ褬̵¤¤ (POSIX.1) +.TP +.B ENOMSG +Í׵ᤵ¤ì¤¿·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬Â¸ºß¤·¤Ê¤¤ (POSIX.1) +.TP +.B ENONET +¥Þ¥·¥ó¤¬¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Ë¤Ê¤¤ +.TP +.B ENOPKG +¥Ñ¥Ã¥±¡¼¥¸¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤Ê¤¤ +.TP +.B ENOPROTOOPT +»ØÄꤵ¤ì¤¿¥×¥í¥È¥³¥ë¤¬ÍøÍѤǤ­¤Ê¤¤ (POSIX.1) +.TP +.B ENOSPC +¥Ç¥Ð¥¤¥¹¤Ë¶õ¤­Îΰ褬̵¤¤ (POSIX.1) +.TP +.B ENOSR +»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¡¦¥ê¥½¡¼¥¹¤¬Â¸ºß¤·¤Ê¤¤ (POSIX.1 (XSI STREAMS option)) +.TP +.B ENOSTR +¥¹¥È¥ê¡¼¥à¤Ç¤Ï¤Ê¤¤ (POSIX.1 (XSI STREAMS option)) +.TP +.B ENOSYS +´Ø¿ô¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1) +.TP +.B ENOTBLK +¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤¬É¬ÍפǤ¢¤ë +.TP +.B ENOTCONN +¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1) +.TP +.B ENOTDIR +¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤ (POSIX.1) +.TP +.B ENOTEMPTY +¥Ç¥£¥ì¥¯¥È¥ê¤¬¶õ¤Ç¤Ï¤Ê¤¤ (POSIX.1) +.\" ENOTNAM is defined but appears to be unused. +.TP +.B ENOTSOCK +¥½¥±¥Ã¥È¤Ç¤Ï¤Ê¤¤ (POSIX.1) +.TP +.B ENOTSUP +Áàºî¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1) +.TP +.B ENOTTY +I/O À©¸æÁàºî¤¬Å¬ÀڤǤʤ¤ (POSIX.1) +.TP +.B ENOTUNIQ +̾Á°¤¬¥Í¥Ã¥È¥ï¡¼¥¯¤Ç°ì°Õ¤Ç¤Ï¤Ê¤¤ +.TP +.B ENXIO +¤½¤Î¤è¤¦¤Ê¥Ç¥Ð¥¤¥¹¤ä¥¢¥É¥ì¥¹¤Ï¤Ê¤¤ (POSIX.1) +.TP +.B EOPNOTSUPP +¥½¥±¥Ã¥È¤Ç¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤Áàºî¤Ç¤¢¤ë (POSIX.1) +.sp +(Linux ¤Ç¤Ï +.B ENOTSUP +¤È +.B EOPNOTSUPP +¤ÏƱ¤¸Ãͤò»ý¤Ä¤¬¡¢ +POSIX.1 ¤Ë½¾¤¨¤Ðξ¼Ô¤Î¥¨¥é¡¼Ãͤ϶èÊ̤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£) +.TP +.B EOVERFLOW +»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿·¿¤Ë³ÊǼ¤¹¤ë¤Ë¤ÏÃͤ¬Â礭²á¤®¤ë (POSIX.1) +.TP +.B EPERM +Áàºî¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1) +.TP +.B EPFNOSUPPORT +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥×¥í¥È¥³¥ë¥Õ¥¡¥ß¥ê¡¼¤Ç¤¢¤ë +.TP +.B EPIPE +¥Ñ¥¤¥×¤¬²õ¤ì¤Æ¤¤¤ë (POSIX.1) +.TP +.B EPROTO +¥×¥í¥È¥³¥ë¡¦¥¨¥é¡¼ (POSIX.1) +.TP +.B EPROTONOSUPPORT +¥×¥í¥È¥³¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ (POSIX.1) +.TP +.B EPROTOTYPE +¥½¥±¥Ã¥È¤Ë»ØÄê¤Ç¤­¤Ê¤¤¥×¥í¥È¥³¥ë¡¦¥¿¥¤¥×¤Ç¤¢¤ë (POSIX.1) +.TP +.B ERANGE +·ë²Ì¤¬Â礭²á¤®¤ë (POSIX.1, C99) +.TP +.B EREMCHG +¥ê¥â¡¼¥È¥¢¥É¥ì¥¹¤¬ÊѤï¤Ã¤¿ +.TP +.B EREMOTE +¥ª¥Ö¥¸¥§¥¯¥È¤¬¥ê¥â¡¼¥È¤Ë¤¢¤ë +.TP +.B EREMOTEIO +¥ê¥â¡¼¥È I/O ¥¨¥é¡¼ +.TP +.B ERESTART +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÃæÃǤµ¤ìºÆ¥¹¥¿¡¼¥È¤¬É¬ÍפǤ¢¤ë +.TP +.B EROFS +Æɤ߽Ф·ÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë (POSIX.1) +.TP +.B ESHUTDOWN +ÄÌ¿®Áê¼ê¤¬¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤ÆÁ÷¿®¤Ç¤­¤Ê¤¤ +.TP +.B ESPIPE +̵¸ú¤Ê¥·¡¼¥¯ (POSIX.1) +.TP +.B ESOCKTNOSUPPORT +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¼ïÊ̤Ǥ¢¤ë +.TP +.B ESRCH +¤½¤Î¤è¤¦¤Ê¥×¥í¥»¥¹¤Ï̵¤¤ (POSIX.1) +.\" ESRMNT is defined but appears not to be used +.TP +.B ESTALE +¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤¬¸Å¤¤¾õÂ֤ˤʤäƤ¤¤ë (POSIX.1) +.sp +NFS ¤ä¾¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Çµ¯¤³¤ê¤¦¤ë¡£ +.TP +.B ESTRPIPE +¥¹¥È¥ê¡¼¥à¡¦¥Ñ¥¤¥×¡¦¥¨¥é¡¼ +.TP +.B ETIME +»þ´Ö¤¬·Ð²á¤·¤¿ +(POSIX.1 (XSI STREAMS option)) +.sp +(POSIX.1 ¤Ç¤Ï "STREAM +.BR ioctl (2) +timeout" ¤È½ñ¤«¤ì¤Æ¤¤¤ë) +.TP +.B ETIMEDOUT +Áàºî¤¬¥¿¥¤¥à¥¢¥¦¥È¤·¤¿ (POSIX.1) +.\" ETOOMANYREFS is defined, but appears not to be used. +.TP +.B ETXTBSY +¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤¬»ÈÍÑÃæ¤Ç¤¢¤ë (POSIX.1) +.TP +.B EUCLEAN +Structure needs cleaning +.TP +.B EUNATCH +¥×¥í¥È¥³¥ë¤Î¥É¥é¥¤¥Ð¤¬ÉÕÍ¿ (attach) ¤µ¤ì¤Æ¤¤¤Ê¤¤ +.TP +.B EUSERS +¥æ¡¼¥¶¿ô¤¬Â¿²á¤®¤ë +.TP +.B EWOULDBLOCK +Áàºî¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¸«¹þ¤ß¤Ç¤¢¤ë +.RB ( EAGAIN +¤ÈƱ¤¸ÃͤǤâ¤è¤¤) (POSIX.1) +.TP +.B EXDEV +ÉÔŬÀڤʥê¥ó¥¯ (POSIX.1) +.TP +.B EXFULL +ÊÑ´¹¥Æ¡¼¥Ö¥ë¤¬°ìÇդǤ¢¤ë +.SH Ãí°Õ +°Ê²¼¤Ï¤è¤¯¤ä¤ë´Ö°ã¤¤¤Ç¤¢¤ë¡£ +.in +4n +.nf + +if (somecall() == \-1) { + printf("somecall() failed\en"); + if (errno == ...) { ... } +} + +.fi +.in +¤³¤Î¤è¤¦¤Ë¤¹¤ë¤È¡¢»²¾È¤·¤Æ¤¤¤ë»þÅÀ¤Ç¤Ï +.I errno +¤Ï¤â¤Ï¤ä +.IR somecall () +¤«¤éÊÖ¤µ¤ì¤¿ÃͤòÊÝ»ý¤·¤Æ¤¤¤ë¤È¤Ï¸Â¤é¤Ê¤¤ +.RB ( printf (3) +¤Ë¤è¤êÊѹ¹¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤)¡£ +¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤ò¤Þ¤¿¤¤¤Ç +.I errno +¤ÎÃͤòÊݸ¤·¤¿¤¤¾ì¹ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤ËÊݸ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤: +.in +4n +.nf + +if (somecall() == \-1) { + int errsv = errno; + printf("somecall() failed\en"); + if (errsv == ...) { ... } +} +.fi +.in +.PP +ÀΤΠC ¤Ç¤Ï¡¢ +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯ +.I errno +¤ò¼êÆ°¤Ç +.RI ( "extern int errno" +¤Î¤è¤¦¤Ë) ÄêµÁ¤¹¤ë¤Î¤¬°ìÈÌŪ¤Ç¤¢¤Ã¤¿¡£ +.BR "¤³¤Î¤è¤¦¤Ê¤³¤È¤Ï¤·¤Ê¤¤¤³¤È" "¡£" +¤³¤¦¤¹¤ë¤È¡¢ºÇ¶á¤Î¥Ð¡¼¥¸¥ç¥ó¤Î C ¥é¥¤¥Ö¥é¥ê¤Ç¤ÏÀµ¤·¤¯Æ°ºî¤·¤Ê¤¤¤À¤í¤¦¡£ +¤·¤«¤·¡¢(Èó¾ï¤Ë) ¸Å¤¤ Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I +¤¬¤Ê¤¯¡¢Àë¸À¤¬É¬Íפʤ³¤È¤¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.BR err (3), +.BR error (3), +.BR perror (3), +.BR strerror (3) diff --git a/release/man3/error.3 b/release/man3/error.3 new file mode 100644 index 00000000..5049500f --- /dev/null +++ b/release/man3/error.3 @@ -0,0 +1,138 @@ +.\" Copyright (C) 2006 Justin Pryzby +.\" and Copyright (C) 2006 Michael Kerrisk +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" References: +.\" glibc manual and source +.\" +.\" Japanese Version Copyright (c) 2006 Yuichi SATO +.\" all rights reserved. +.\" Translated 2006-08-04 by Yuichi SATO , LDP v2.36 +.\" +.TH ERROR 3 2006-04-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +error, error_at_line, error_message_count, error_on_per_line, error_print_progname \- glibc ¤Î¥¨¥é¡¼½ñ¤­½Ð¤·´Ø¿ô +.SH ½ñ¼° +.nf +\fB#include + +\fBvoid error(int \fIstatus, \fBint\fI errnum, \ +\fBconst char *\fIformat, \fB...); + +\fBvoid error_at_line(int \fIstatus, \fBint \fIerrnum, \ +\fBconst char *\fIfilename, + \fBunsigned int \fIlinenum, \ +\fBconst char *\fIformat, \fB...); + +\fBextern unsigned int \fIerror_message_count\fP; + +\fBextern int \fIerror_one_per_line\fP; + +\fBextern void (* \fIerror_print_progname\fB) (void); +.fi +.SH ÀâÌÀ +.BR error () +¤ÏÈÆÍÑŪ¤Ê¥¨¥é¡¼½ñ¤­½Ð¤·´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ïɸ½à½ÐÎÏ +.RI ( stdout ) +¤Ë½ñ¤­½Ð¤·¤Æ¤«¤é¡¢É¸½à¥¨¥é¡¼½ÐÎÏ +.RI ( stderr ) +¤Ë½ñ¤­½Ð¤¹¡£ +½ñ¤­½Ð¤¹ÆâÍƤϡ¢¥×¥í¥°¥é¥à̾¡¦¥³¥í¥ó¡¦¥¹¥Ú¡¼¥¹¡¦ +.BR printf (3) +·Á¼°¤Î +¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó \fIformat\fP ¤Ç»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤Ç¤¢¤ë¡£ +\fIerrnum\fP ¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢2 ¤ÄÌܤΥ³¥í¥ó¤È¥¹¥Ú¡¼¥¹¤Î¸å¤Ë +\fBperror(\fIerrnum\fB)\fP +¤Ç»ØÄꤵ¤ì¤¿Ê¸»úÎó¤â½ñ¤­½Ð¤¹¡£ +.I format +¤ËɬÍפÊǤ°Õ¤Î°ú¤­¿ô¤¬¡¢°ú¤­¿ô¥ê¥¹¥È¤Î +.I format +¤Î¸å¤Ë³¤¯¡£ +½ÐÎϤνªÃ¼¤Ë¤Ï²þ¹Ôʸ»ú¤¬ÉÕ¤¯¡£ + +.BR error () +¤Ç½ÐÎϤµ¤ì¤ë¥×¥í¥°¥é¥à̾¤Ï¡¢Âç°èÊÑ¿ô +.BR program_invocation_name (3) +¤ÎÃͤǤ¢¤ë¡£ +.I program_invocation_name +¤Î½é´üÃÍ¤Ï +.IR main () +¤Î +.I argv[0] +¤ÎÃͤÈÅù¤·¤¤¡£ +¤³¤ÎÊÑ¿ô¤ÎÃͤÏÊѹ¹²Äǽ¤Ç¤¢¤ê¡¢Êѹ¹¤¹¤ë¤È +.BR error () +¤Î½ÐÎϤ¬ÊѤï¤ë¡£ + +\fIstatus\fP ¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢ +.BR error () +¤Ï +.BR exit (3) +¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢»ØÄꤵ¤ì¤¿½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ç¥×¥í¥°¥é¥à¤ò½ªÎ»¤µ¤»¤ë¡£ + +.BR error_at_line () +´Ø¿ô¤Ï¡¢°ú¤­¿ô +.I filename +¤È +.I linenum +¤¬Äɲ䵤ì¤Æ¤¤¤ë°Ê³°¤Ï¡¢ +.BR error () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +À¸À®¤µ¤ì¤ë½ÐÎϤϡ¢¥×¥í¥°¥é¥à̾¤Î¸å¤Ë +¥³¥í¥ó¡¦\fIfilename\fR ¤ÎÃÍ¡¦¥³¥í¥ó¡¦\fIlinenum\fR ¤ÎÃͤ¬½ñ¤­½Ð¤µ¤ì¤ë°Ê³°¤Ï¡¢ +.BR error () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +¥×¥ê¥×¥í¥»¥Ã¥µ¤ÎÃÍ \fB__LINE__\fP ¤È \fB__FILE__\fP ¤Ï¡¢ +.BR error_at_line () +¤ò¸Æ¤Ó½Ð¤¹¤È¤­¤ËÌò¤ËΩ¤Ä¡£ +¤½¤Î¾¤Î¥×¥ê¥×¥í¥»¥Ã¥µ¤ÎÃͤâ»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +Î㤨¤Ð¡¢¤³¤ì¤é¤Î°ú¤­¿ô¤ÇÆþÎÏ¥Õ¥¡¥¤¥ë¤Ë¤ª¤±¤ë°ÌÃÖ¤ò»²¾È¤Ç¤­¤ë¡£ + +Âç°èÊÑ¿ô \fIerror_one_per_line\fP ¤¬ 0 °Ê³°¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +\fIfilename\fP ¤È \fIlinenum\fP ¤ÎÃͤ¬¶¦¤ËÅù¤·¤¤ +.BR error_at_line () +¤Î¸Æ¤Ó½Ð¤·¤Ï¡¢ +1 ¤Ä¤Î (ºÇ½é¤Î) ¥á¥Ã¥»¡¼¥¸¤Î½ÐÎϤˤޤȤá¤é¤ì¤ë¡£ + +Âç°èÊÑ¿ô \fIerror_message_count\fP ¤Ï¡¢ +.BR error () +¤È +.BR error_at_line () +¤Ç½ÐÎϤµ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤Î¿ô¤òɽ¤¹¡£ + +Âç°èÊÑ¿ô \fIerror_print_progname\fP ¤Ë +´Ø¿ô¤Î¥¢¥É¥ì¥¹¤¬³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¾ì¹ç (¤Ä¤Þ¤ê NULL ¤Ç¤Ï¤Ê¤¤¾ì¹ç)¡¢ +¥á¥Ã¥»¡¼¥¸¤ÎÁ°¤Ë¥×¥í¥°¥é¥à̾¤È¥³¥í¥ó¤ò½ñ¤­½Ð¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¡£ +¤³¤Î´Ø¿ô¤Ïɸ½à¥¨¥é¡¼½ÐÎÏ +.RI ( stderr ) +¤ËÂФ·¤Æ¤ÎŬÀÚ¤Êʸ»úÎó¤ò½ñ¤­½Ð¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤ÈÊÑ¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ê¡¢ +°Ü¿¢À­¤ò¹Í¤¨¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR err (3), +.BR errno (3), +.BR exit (3), +.BR perror (3), +.BR program_invocation_name (3), +.BR strerror (3) diff --git a/release/man3/ether_aton.3 b/release/man3/ether_aton.3 new file mode 100644 index 00000000..04e0c1d8 --- /dev/null +++ b/release/man3/ether_aton.3 @@ -0,0 +1,139 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 2002 Ian Redfern (redferni@logica.com) +.\" +.\" 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 +.\" FreeBSD 4.4 man pages +.\" +.\" Minor additions, aeb, 2002-07-20 +.\" +.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Thu Aug 22 2002 by Akihiro MOTOKI +.\" +.TH ETHER_ATON 3 2002-07-20 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +ether_aton, ether_ntoa, ether_ntohost, ether_hostton, ether_line, +ether_ntoa_r, ether_aton_r \- Ethernet ¥¢¥É¥ì¥¹¤ÎÁàºîÍÑ´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *ether_ntoa(const struct ether_addr *" addr ); +.sp +.BI "struct ether_addr *ether_aton(const char *" asc ); +.sp +.BI "int ether_ntohost(char *" hostname ", const struct ether_addr *" addr ); +.sp +.BI "int ether_hostton(const char *" hostname ", struct ether_addr *" addr ); +.sp +.BI "int ether_line(const char *" line ", struct ether_addr *" addr , +.BI " char *" hostname ); +.sp +/* GNU ³ÈÄ¥ */ +.br +.BI "char *ether_ntoa_r(const struct ether_addr *" addr ", char *" buf ); +.sp +.BI "struct ether_addr *ether_aton_r(const char *" asc , +.BI " struct ether_addr *" addr ); +.fi +.SH ÀâÌÀ +´Ø¿ô +.BR ether_aton () +¤Ï¡¢É¸½àŪ¤Ê 16¿Ê¿ô¤È¥³¥í¥ó¤Î·Á¼°¤Ç½ñ¤«¤ì¤¿ 48¥Ó¥Ã¥È¤Î +Ethernet ¥Û¥¹¥È¥¢¥É¥ì¥¹ \fIasc\fP ¤ò¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤Ç¤Î¥Ð¥¤¥È½ç (byte order) +¤Î¥Ð¥¤¥Ê¥ê¥Ç¡¼¥¿¤ËÊÑ´¹¤·¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤¿¥Ç¡¼¥¿ +¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¡¢¤³¤ì°Ê¹ß¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¡£ +¥¢¥É¥ì¥¹¤¬ÉÔÀµ¤Ê¾ì¹ç¡¢ +.BR ether_aton () +¤Ï NULL ¤òÊÖ¤¹¡£ +.PP +´Ø¿ô +.BR ether_ntoa () +¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤Î¥Ð¥¤¥È½ç¤Çɽ¤µ¤ì¤¿ Ethernet +¥Û¥¹¥È¥¢¥É¥ì¥¹ \fIaddr\fP ¤ò¡¢É¸½àŪ¤Ê 16¿Ê¿ô¤È¥³¥í¥ó¤Î·Á¼°¤Îʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£ +⤷¡¢ÀèƬ¤Î 0 ¤Ï¾Êά¤µ¤ì¤ë¡£ÊÑ´¹¸å¤Îʸ»úÎó¤ÏÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡ +¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¡¢¤³¤ì°Ê¹ß¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¡£ +.PP +´Ø¿ô +.BR ether_ntohost () +¤Ï¡¢Ethernet ¥¢¥É¥ì¥¹¤ËÂбþ¤¹¤ë¥Û¥¹¥È̾¤ò +.I /etc/ethers +¤ò¸¡º÷¤·¤Æ³ä¤êÅö¤Æ¤ë¡£Âбþ¤¹¤ë¥Û¥¹¥È̾¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +Èó 0 ¤òÊÖ¤¹¡£ +.PP +´Ø¿ô +.BR ether_hostton () +¤Ï¡¢¥Û¥¹¥È̾¤ËÂбþ¤¹¤ë Ethernet ¥¢¥É¥ì¥¹¤ò +.I /etc/ethers +¤ò¸¡º÷¤·¤Æ³ä¤êÅö¤Æ¤ë¡£Âбþ¤¹¤ë¥Û¥¹¥È̾¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +Èó 0 ¤òÊÖ¤¹¡£ +.PP +´Ø¿ô +.BR ether_line () +¤Ï¡¢ +.I /etc/ethers +·Á¼°¤Ë¤Ê¤Ã¤¿¹Ô¤ò²òÀϤ·¡¢ +¥¢¥É¥ì¥¹¤È¥Û¥¹¥È̾¤ÎÁȤòÊÖ¤¹ +.RI ( /etc/ethers +·Á¼°¤Ï¡¢Ethernet ¥¢¥É¥ì¥¹¡¢¥Û¥¹¥È̾¤¬¶õÇòʸ»ú (whitespace) +¤Ç¶èÀÚ¤é¤ì¤¿½ñ¼°¤Ç¡¢\(aq#\(aq °Ê¹ß¤Ï¥³¥á¥ó¥È¤È¤ß¤Ê¤µ¤ì¤ë)¡£ +²òÀϤǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢Èó 0 ¤òÊÖ¤¹¡£ +.I hostname +¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ï½½Ê¬¤ÊŤµ¤¬É¬ÍפǤ¢¤ë¡£¤Ä¤Þ¤ê¡¢ +.I line +¤ÈƱ¤¸Ä¹¤µ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +´Ø¿ô +.BR ether_ntoa_r () +¤È +.BR ether_aton_r () +¤Ï¡¢ +¤½¤ì¤¾¤ì +.BR ether_ntoa () +¤È +.BR ether_aton () +¤Î +¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ê¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ê¡¢ +ÀÅŪ¤Ê¥Ð¥Ã¥Õ¥¡¤ò»ÈÍѤ·¤Ê¤¤¡£ +.PP +\fIether_addr\fP ¹½Â¤ÂÎ¤Ï +.I +¤Ç¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct ether_addr { + uint8_t ether_addr_octet[6]; +} +.fi +.in +.SH ½àµò +4.3BSD, SunOS. +.SH ¥Ð¥° +glibc 2.2.5 ¤Ç¤Î +.BR ether_line () +¤Î¼ÂÁõ¤Ï¤ª¤«¤·¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ethers (5) diff --git a/release/man3/euidaccess.3 b/release/man3/euidaccess.3 new file mode 100644 index 00000000..b2b4979c --- /dev/null +++ b/release/man3/euidaccess.3 @@ -0,0 +1,95 @@ +.\" 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 2007-07-26 "" "Linux Programmer's Manual" +.SH ̾Á° +euidaccess, eaccess \- ¥Õ¥¡¥¤¥ë¤Ø¤Î¥¢¥¯¥»¥¹¸¢¤ò¼Â¸ú¥æ¡¼¥¶¤Ç¥Á¥§¥Ã¥¯¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int euidaccess(const char *" pathname ", int " mode ); +.BI "int eaccess(const char *" pathname ", int " mode ); +.fi +.SH ÀâÌÀ +.BR access (2) +¤ÈƱÍÍ¡¢ +.BR euidaccess () +¤Ï°ú¤­¿ô +.I pathname +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Îµö²Ä (permission) ¤È¸ºß¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¡£ +.BR access (2) +¤Ï¥×¥í¥»¥¹¤Î¼Â (real) ¥æ¡¼¥¶ID / ¼Â¥°¥ë¡¼¥×ID ¤òÍѤ¤¤Æ¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¤Î¤ËÂФ·¡¢ +.BR euidaccess () +¤Ï¼Â¸ú (effective) ID ¤òÍѤ¤¤ë¡£ + +.I mode +¤Ï +.BR R_OK ", " W_OK ", " X_OK ", " F_OK +¤Î°ì¤Ä°Ê¾å¤«¤é¹½À®¤µ¤ì¤ë¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +.BR R_OK ", " W_OK ", " X_OK ", " F_OK +¤Ï +.BR access (2) +¤ÈƱ¤¸°ÕÌ£¤ò»ý¤Ä¡£ + +.BR eaccess () +¤Ï +.BR euidaccess () +¤ÎƱµÁ¸ì¤Ç¤¢¤ê¡¢Â¾¤Î¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤È¤Î¸ß´¹À­¤Î¤¿¤á¤ËÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç (Í׵ᤷ¤¿Á´¤Æ¤Ë¤Ä¤¤¤Æ¤Îµö²Ä¤¬ÆÀ¤é¤ì¤¿¤é)¡¢¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç +.RI ( mode +¤Î¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¥Ó¥Ã¥È¤ÇÍ׵ᤷ¤¿µö²Ä¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¤ä¡¢ +¾¤Î¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç)¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR access (2) +¤ÈƱ¤¸¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR eaccess () +´Ø¿ô¤Ï glibc ¤Î¥Ð¡¼¥¸¥ç¥ó 2.4 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç¤¢¤ë¡£ +¾¤Î¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ë¤Ï +.\" Î㤨¤Ð¡¢FreeBSD 6.1. +.BR eaccess () +´Ø¿ô¤¬¤¢¤ë¡£ +.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/release/man3/exec.3 b/release/man3/exec.3 new file mode 100644 index 00000000..c0b08a7c --- /dev/null +++ b/release/man3/exec.3 @@ -0,0 +1,216 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)exec.3 6.4 (Berkeley) 4/19/91 +.\" +.\" Converted for Linux, Mon Nov 29 11:12:48 1993, faith@cs.unc.edu +.\" Updated more for Linux, Tue Jul 15 11:54:18 1997, pacman@cqc.com +.\" 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 +.\" +.\"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 (¥×¥í¥°¥é¥à¤Î)Æ°ºî +.\" +.TH EXEC 3 2009-02-22 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +execl, execlp, execle, execv, execvp \- ¥Õ¥¡¥¤¥ë¤ò¼Â¹Ô¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.B extern char **environ; +.sp +.BI "int execl(const char *" path ", const char *" arg ", ...);" +.br +.BI "int execlp(const char *" file ", const char *" arg ", ...);" +.br +.BI "int execle(const char *" path ", const char *" arg , +.br +.BI " ..., char * const " envp "[]);" +.br +.BI "int execv(const char *" path ", char *const " argv "[]);" +.br +.BI "int execvp(const char *" file ", char *const " argv "[]);" +.SH ÀâÌÀ +.BR exec () +¥Õ¥¡¥ß¥ê¡¼¤Î´Ø¿ô¤Ï¸½ºß¤Î¥×¥í¥»¥¹¥¤¥á¡¼¥¸¤ò¿·¤·¤¤¥×¥í¥»¥¹¥¤¥á¡¼¥¸¤ÇÃÖ¤­ +´¹¤¨¤ë¡£¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤Ï +.BR execve (2) +¤Î¥Õ¥í¥ó¥È¥¨¥ó¥É¤Ç¤¢¤ë¡£ +(¸½ºß¤Î¥×¥í¥»¥¹¥¤¥á¡¼¥¸¤ÎÃÖ¤­´¹¤¨¤Ë¤Ä¤¤¤Æ¤Î¾ÜºÙ¤Ï +.BR execve (2) +¤Î¥Þ¥Ë¥å¥¢¥ë¤ò»²¾È) +.PP +¤³¤ì¤é¤Î´Ø¿ô¤ÎºÇ½é¤Î°ú¤­¿ô¤Ï¡¢¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤Ç¤¢¤ë¡£ +.PP +´Ø¿ô +.BR execl (), +.BR execlp (), +.BR execle () +¤Î +.I "const char *arg" +¤È¤½¤ì¤Ë³¤¯¾ÊάÉôʬ¤Ï +.IR arg0 , +.IR arg1 , +\&..., +.I argn +¤È¤ß¤Ê¤µ¤ì¤ë¡£ +¤³¤ì¤é¤Ë¤Ï¡¢¼Â¹Ô¤µ¤ì¤ë¥×¥í¥°¥é¥à¤ÇÍøÍѲÄǽ¤Ê°ú¤­¿ô¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë +(°ú¤­¿ô¤Î¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤«¤é¹½À®¤µ¤ì¤ë)¡£ +´·½¬¤È¤·¤Æ¡¢ºÇ½é¤Î°ú¤­¿ô¤Ï¡¢¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë̾ +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ë¤¹¤ë¡£°ú¤­¿ô¤Î¥ê¥¹¥È¤Ïɬ¤º NULL +¤Ç½ª¤ï¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï²ÄÊÑĹ°ú¤­¿ô´Ø¿ô¤Ê¤Î¤Ç¡¢ +¤³¤Î¥Ý¥¤¥ó¥¿¤Ï +.I "(char *) NULL" +¤È¥­¥ã¥¹¥È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +´Ø¿ô +.BR execv () +¤È +.BR execvp () +¤Ï¡¢ÍøÍѲÄǽ¤Ê°ú¤­¿ô¥ê¥¹¥È (NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î +¥Ý¥¤¥ó¥¿¤ÎÇÛÎó) ¤ò¿·¤·¤¤¥×¥í¥°¥é¥à¤ËÅϤ¹¡£ +´·½¬¤È¤·¤Æ¡¢ºÇ½é¤Î°ú¤­¿ô¤Ï¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë̾¤Ø +¤Î¥Ý¥¤¥ó¥¿¤Ë¤¹¤ë¡£¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Ïɬ¤º +NULL ¤Ç½ª¤ï¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +´Ø¿ô +.BR execle () +¤Ç¤Ï¿·¤·¤¤¥×¥í¥»¥¹¤Î´Ä¶­¤â»ØÄꤹ¤ë¡£ +´Ä¶­¤Ï°ú¤­¿ô¥ê¥¹¥È (°ú¤­¿ô¥ê¥¹¥È¤â¤·¤¯¤ÏÄɲäΰú¤­¿ô¤ò»ý¤Ã¤¿ +.I argv +ÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿) ¤ÎºÇ¸å¤Î NULL ¥Ý¥¤¥ó¥¿¤Ë³¤±¤Æ»ØÄꤹ¤ë¡£ +Äɲäΰú¤­¿ô¤Ï¡¢NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Ç¤¢¤ê¡¢ +NULL ¥Ý¥¤¥ó¥¿¤Ç½ª¤ï¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¾¤Î´Ø¿ô¤Ç¤Ï¡¢¸½ºß¤Î¥×¥í¥»¥¹¤Î³°ÉôÊÑ¿ô +.B environ +¤«¤é¿·¤·¤¤¥×¥í¥»¥¹ÍѤδĶ­¤òÍ¿¤¨¤ë¡£ +.SS execlp() ¤È execvp() ¤ÎÆÃÊ̤ÊÆ°ºî +.PP +´Ø¿ô +.BR execlp () +¤È +.BR execvp () +¤Ï¡¢»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤¬¥¹¥é¥Ã¥·¥å (/) ¤ò´Þ¤ó¤Ç¤¤¤Ê¤¤¾ì¹ç¡¢ +¥·¥§¥ë¤ÈƱ¤¸Æ°ºî¤Ç¼Â¹Ô²Äǽ¤Ê¥Õ¥¡¥¤¥ë¤òõº÷¤¹¤ë¡£ +¸¡º÷¥Ñ¥¹¤Ï´Ä¶­ÊÑ¿ô +.B PATH +¤Ç»ØÄꤵ¤ì¤¿¥Ñ¥¹¤Ç¤¢¤ë¡£ +¤³¤ÎÊÑ¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥ÈPATH¤È¤·¤Æ +":/bin:/usr/bin" ¤¬»ÈÍѤµ¤ì¤ë¡£ +¤Þ¤¿¡¢¤¤¤¯¤Ä¤«¤Î¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Î°·¤¤¤¬Æüì¤Ç¤¢¤ë¡£ +.PP +¤â¤·¥Õ¥¡¥¤¥ë¤¬¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ç¤Ê¤¤¾ì¹ç (¤³¤Î¤È¤­¸Æ¤Ó½Ð¤½¤¦¤È¤·¤¿ +.BR execve (2) +¤Ï¥¨¥é¡¼ +.B EACCES +¤Ç¼ºÇÔ¤¹¤ë)¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï»Ä¤ê¤Î¸¡º÷¥Ñ¥¹¤Î¸¡º÷¤ò³¤±¤ë¡£ +¾¤Ë¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤é¤Ê¤¯¤Ê¤Ã¤¿¾ì¹ç +.I errno +¤Ë +.B EACCES +¤òÀßÄꤷÉüµ¢¤¹¤ë¡£ +.\" fujiwara: ¸Ä¿ÍŪ¤Ë¤Ï¡ÖÉüµ¢¤¹¤ë¡×¤ÎÊý¤¬¹¥¤­(^_^; +.PP +¥Õ¥¡¥¤¥ë¤Î¥Ø¥Ã¥À¤¬¼Â¹Ô·Á¼°¤È¤·¤Æǧ¼±¤Ç¤­¤Ê¤¤¾ì¹ç +(¤³¤Î¤È¤­¸Æ¤Ó½Ð¤½¤¦¤È¤·¤¿ +.BR execve (2) +¤Ï¥¨¥é¡¼ +.B ENOEXEC +¤Ç¼ºÇÔ¤¹¤ë)¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¤½¤Î¥Õ¥¡¥¤¥ë¤òºÇ½é¤Î°ú¤­¿ô¤È¤·¤¿¥·¥§¥ë +.RI ( /bin/sh ) +¤ò¼Â¹Ô¤¹¤ë (¤³¤ì¤Ë¤â¼ºÇÔ¤·¤¿¾ì¹ç¡¢¤³¤ì°Ê¾å¤Î¸¡º÷¤Ï¹Ô¤ï¤ì¤Ê¤¤)¡£ +.SH ÊÖ¤êÃÍ +¤â¤· +.BR exec () +¥Õ¥¡¥ß¥ê¡¼¤¬Éüµ¢¤·¤Æ¤­¤¿¾ì¹ç¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤¤¤ë¡£ +ÊÖ¤êÃÍ¤Ï \-1 ¤Ç¡¢ +.I errno +¤Ë¤½¤Î¥¨¥é¡¼¤ÎÆâÍƤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤éÁ´¤Æ¤Î´Ø¿ô¤Ï¼ºÇÔ¤¹¤ë¾ì¹ç¤¬¤¢¤ë¡£¤½¤Î¾ì¹ç¥é¥¤¥Ö¥é¥ê´Ø¿ô +.BR execve (2) +¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥¨¥é¡¼¤ò +.I errno +¤ËÀßÄꤹ¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +Linux °Ê³°¤Î¥·¥¹¥Æ¥à¤Ë¤Ï¡¢ +(´Ä¶­ÊÑ¿ô \fBPATH\fR ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¤Î) +¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¤Ë¤ª¤¤¤Æ¡¢¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤¬ +.I /bin +¤È +.I /usr/bin +¤Î¸å¤í¤ËÇÛÃÖ¤µ¤ì¤ë¤â¤Î¤â¤¢¤ë¡£ +¤³¤ì¤Ï¥È¥í¥¤¤ÎÌÚÇÏÂкö¤Î¤¿¤á¤Ç¤¢¤ë¡£ +Linux ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¤Ë¡¢ÀΤʤ¬¤é¤Î¡Ö¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò +Àè¤Ëõº÷¡×¤È¤¤¤¦¥ë¡¼¥ë¤ò»È¤Ã¤Æ¤¤¤ë¡£ +.PP +¥Õ¥¡¥¤¥ë¤ò¼Â¹Ô¤·¤è¤¦¤È¤·¤Æ¤¤¤ë´Ö¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿»þ¤Î +.BR execlp () +¤È +.BR execvp () +¤Î¤Õ¤ë¤Þ¤¤¤Ë¤Ä¤¤¤ÆÎò»ËŪ¤Ê´·½¬¤Ï¤¢¤ë¤¬¡¢ÅÁÅýŪ¤Ëʸ½ñ¤È¤·¤Æµ­ºÜ¤µ¤ì¤Æ¤ª¤é¤º¡¢ +POSIX ɸ½à¤Ç¤âµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£BSD (¤Þ¤¿¤ª¤½¤é¤¯Â¾¤Î¥·¥¹¥Æ¥à) ¤Ç¤Ï¡¢ +.B ETXTBSY +¤¬È¯À¸¤·¤¿¾ì¹ç¡¢¼«Æ°Åª¤ËÃæÃÇ (sleep) ¤·ºÆ»î¹Ô¤ò¹Ô¤¦¡£ +Linux ¤Ï¤½¤ì¤ò¥Ï¡¼¥É¥¨¥é¡¼¤È¤·¤Æ¼è¤ê°·¤¤Â¨ºÂ¤ËÉüµ¢¤¹¤ë¡£ +.PP +ÅÁÅýŪ¤Ë¡¢´Ø¿ô +.BR execlp () +¤È +.BR execvp () +¤Ï¡¢¾å¤ÇÀâÌÀ¤·¤¿¥¨¥é¡¼¤È¡¢¤³¤ì¤é 2 ¤Ä¤Î´Ø¿ô¼«¿È¤¬ÊÖ¤¹ +.B ENOMEM +¤È +.B E2BIG +°Ê³°¤ÎÁ´¤Æ¤Î¥¨¥é¡¼¤ò̵»ë¤·¤Æ¤¤¤¿¤¬¡¢ +º£¤Ç¤Ï¡¢¾å¤ÇÀâÌÀ¤·¤¿°Ê³°¤Î¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ç¤â¡¢ +Ê֤äƤ¯¤ë¤è¤¦Êѹ¹¤µ¤ì¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sh (1), +.BR execve (2), +.BR fork (2), +.BR ptrace (2), +.BR fexecve (3), +.BR environ (7) diff --git a/release/man3/exit.3 b/release/man3/exit.3 new file mode 100644 index 00000000..e43ae577 --- /dev/null +++ b/release/man3/exit.3 @@ -0,0 +1,174 @@ +.\" 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 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" +.SH ̾Á° +exit \- ¥×¥í¥»¥¹¤ÎÀµ¾ï½ªÎ» +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void exit(int " status ); +.fi +.SH ÀâÌÀ +.BR exit () +´Ø¿ô¤Ï¡¢¥×¥í¥»¥¹¤òÀµ¾ï¤Ë½ªÎ»¤µ¤»¡¢ +\fIstatus & 0377\fP ¤È¤¤¤¦Ãͤò¿Æ¥×¥í¥»¥¹¤ØÊÖ¤¹ +.RB ( wait (2) +¤ò»²¾È)¡£ +.LP +.BR atexit (3) +¤ä +.BR on_exit (3) +¤Ë¤è¤Ã¤Æ +ÅÐÏ¿¤µ¤ì¤¿Á´¤Æ¤Î´Ø¿ô¤Ï¡¢¤½¤ì¤é¤¬ÅÐÏ¿¤µ¤ì¤¿½çÈ֤ȵսç¤Ë¥³¡¼¥ë¤µ¤ì¤ë¡£ +(ÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤ÎÃæ¤Ç +.BR atexit (3) +or +.BR on_exit (3) +¤ò»È¤Ã¤Æ +exit ½èÍýÃæ¤Ë¼Â¹Ô¤µ¤ì¤ëÄɲäδؿô¤òÅÐÏ¿¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë; +¿·µ¬¤ËÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤Ï¡¢¤³¤Î¸å¤Ç¼Â¹Ô¤µ¤ì¤ë´Ø¿ô¥ê¥¹¥È¤ÎÀèƬ¤Ë +Äɲ䵤ì¤ë¡£) +¤³¤ì¤é¤Î´Ø¿ô¤Î°ì¤Ä¤¬ÊÖ¤é¤Ê¤«¤Ã¤¿¾ì¹ç +(Î㤨¤Ð¡¢¤½¤Î´Ø¿ô¤¬ +.BR _exit (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¤ê¡¢¥·¥°¥Ê¥ë¤Ç¼«Ê¬¼«¿È¤ò kill ¤·¤¿¾ì¹ç)¡¢ +»Ä¤ê¤Î´Ø¿ô¤Ï¤É¤ì¤â¸Æ¤Ó½Ð¤µ¤ì¤º¡¢¤½¤ì°Ê¹ß¤Î exit ½èÍý +(ÆÃ¤Ë +.BR stdio (3) +¥¹¥È¥ê¡¼¥à¤Î¥Õ¥é¥Ã¥·¥å¤Ê¤É) ¤ÏÃæ»ß¤µ¤ì¤ë¡£ +¤¢¤ë´Ø¿ô¤¬ +.BR atexit (3) +¤ä +.BR on_exit (3) +¤ò»È¤Ã¤ÆÊ£¿ô²óÅÐÏ¿¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢ +¤½¤Î´Ø¿ô¤ÏÅÐÏ¿¤µ¤ì¤¿¤Î¤ÈƱ¤¸²ó¿ô¤À¤±¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.LP +¥ª¡¼¥×¥óÃæ¤Î +.BR stdio (3) +¥¹¥È¥ê¡¼¥à¤ÏÁ´¤Æ¥Õ¥é¥Ã¥·¥å¤µ¤ì¤Æ¡¢¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.BR tmpfile (3) +¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ïºï½ü¤µ¤ì¤ë¡£ +.LP +C ɸ½à¤Ç¤Ï +.B EXIT_SUCCESS +¤È +.B EXIT_FAILURE +¤È¤¤¤¦ 2¤Ä¤ÎÄê¿ô¤¬ +ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£¤½¤ì¤¾¤ìÀµ¾ï½ªÎ»¤È°Û¾ï½ªÎ»¤ò¼¨¤¹¤â¤Î¤Ç¡¢ +.BR exit () +¤È¤·¤ÆÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR exit () +´Ø¿ô¤ÏÊÖ¤é¤Ê¤¤¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001, C89, C99. +.SH Ãí°Õ +.LP +.BR atexit (3) +¤ä +.BR on_exit (3) +¤ò»È¤Ã¤ÆÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤ÎÃæ¤Ç +.BR exit () +¤« +.BR longjmp (3) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢ +²¿¤¬µ¯¤³¤ë¤«¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.LP +.B EXIT_SUCCESS +¤È +.B EXIT_FAILURE +¤ò»È¤¦¤È¡¢0 ¤ä (1 ¤ä \-1 ¤È¤¤¤Ã¤¿) 0 °Ê³°¤ÎÃͤò»È¤¦¤Î¤ËÈæ¤Ù¤Æ +(Unix °Ê³°¤Î´Ä¶­¤Ë) °Ü¿¢¤¹¤ë¤Î¤¬¤¤¤¯¤é¤«´Êñ¤Ë¤Ê¤ë¡£ +ÆÃ¤Ë VMS ¤ÏÊ̤ÎÊý¼°¤òÍѤ¤¤Æ¤¤¤ë¡£ +.LP +BSD ¤Ï½ªÎ»¥³¡¼¥É¤òɸ½à²½¤·¤è¤¦¤È¤·¤Æ¤¤¤ë; +.I +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.LP +.BR exit () +¤Î¸å¡¢¿Æ¥×¥í¥»¥¹¤Ë½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤¬ÅϤµ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤ÎÅϤ·Êý¤Ë¤Ï 3 ¤Ä¤Î¾ì¹ç¤¬¤¢¤ë¡£ +¿Æ¥×¥í¥»¥¹¤¬ +.B SA_NOCLDWAIT +¤òÀßÄꤷ¤¿¾ì¹ç¡¢ +¤Þ¤¿¤Ï +.B SIGCHLD +¥Ï¥ó¥É¥é¤ò +.B SIG_IGN +¤ËÀßÄꤷ¤¿¾ì¹ç¡¢ +¥¹¥Æ¡¼¥¿¥¹¤ÏÇË´þ¤µ¤ì¤ë¡£ +¿Æ¥×¥í¥»¥¹¤¬»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤òÂԤäƤ¤¤ë¾ì¹ç¡¢ +¿Æ¥×¥í¥»¥¹¤Ë½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤¬ÅÁ¤¨¤é¤ì¤ë¡£ +¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â exit ¤Î¥×¥í¥»¥¹¤Ïľ¤Á¤Ë½ªÎ»¤¹¤ë¡£ +¡Ö½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤ò´ØÃΤ»¤º½ªÎ»¤âÂÔ¤¿¤Ê¤¤¡× +¤È¤¤¤¦¤³¤È¤ò¿Æ¥×¥í¥»¥¹¤¬»Ø¼¨¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +exit ¥×¥í¥»¥¹¤Ï (½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤òɽ¤¹ 1 ¥Ð¥¤¥È¤Î¤ß¤òÊÝ»ý¤¹¤ë) +¡Ö¥¾¥ó¥Ó¡×¥×¥í¥»¥¹¤Ë¤Ê¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¸å¤«¤é +.BR wait (2) +´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢ +¿Æ¥×¥í¥»¥¹¤Ï½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤òÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.LP +.B SIGCHLD +¥·¥°¥Ê¥ë¤Î¥µ¥Ý¡¼¥È¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¤³¤Î¥·¥°¥Ê¥ë¤Ï¿Æ¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤ë¡£ +¿Æ¥×¥í¥»¥¹¤¬ +.B SA_NOCLDWAIT +¤òÀßÄꤷ¤¿¾ì¹ç¡¢ +.B SIGCHLD +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¤«¤É¤¦¤«¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.LP +¤½¤Î¥×¥í¥»¥¹¤¬¥»¥Ã¥·¥ç¥ó¤Î¥ê¡¼¥À¡¼¤Ç¡¢ +¤½¤Î¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤¬¤½¤Î¥»¥Ã¥·¥ç¥ó¤ÎÀ©¸æüËö¤Ç¤¢¤ë¾ì¹ç¡¢ +¤³¤ÎÀ©¸æüËö¤Î¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë¤¢¤ë +³Æ¥×¥í¥»¥¹¤Ë +.B SIGHUP +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¡¢Ã¼Ëö¤¬¥»¥Ã¥·¥ç¥ó¤«¤éÀÚ¤êÎ¥¤µ¤ì¤ë¡£ +¤³¤ì¤Ë¤è¤ê¿·¤·¤¤À©¸æ¥×¥í¥»¥¹¤ò¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢¥×¥í¥»¥¹¥°¥ë¡¼¥×¤¬¸ÉΩ¤·¤Æ¡¢ +¤½¤Î¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤Î¤¦¤Á¤Î¤É¤ì¤«¤¬Ää»ß¤·¤¿¾ì¹ç¡¢ +¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î³Æ¥×¥í¥»¥¹¤ËÂФ·¤Æ +.B SIGHUP +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¡¢Â³¤¤¤Æ +.B SIGCONT +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +¸ÉΩ¤·¤¿ (orphaned) ¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÀâÌÀ¤Ï +.BR setpgid (2) +¤ò»²¾È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR _exit (2), +.BR setpgid (2), +.BR wait (2), +.BR atexit (3), +.BR on_exit (3), +.BR tmpfile (3) diff --git a/release/man3/exp.3 b/release/man3/exp.3 new file mode 100644 index 00000000..df53b899 --- /dev/null +++ b/release/man3/exp.3 @@ -0,0 +1,128 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 Mon Sep 7 23:27:52 JST 2003 +.\" by Akihiro MOTOKI +.\" Updated 2008-09-16, Akihiro MOTOKI +.\" +.TH EXP 3 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +exp, expf, expl \- Ä줬 e ¤Î»Ø¿ô´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double exp(double " x ); +.br +.BI "float expf(float " x ); +.br +.BI "long double expl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR expf (), +.BR expl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR exp () +´Ø¿ô¤Ï e ¤Î \fIx\fP ¾è¤ÎÃͤòÊÖ¤¹ +(e ¤Ï¼«Á³Âпô¤ÎÄì)¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï e ¤Î +.I x +¾è¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ +ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.RB + HUGE_VAL , +.RB + HUGE_VALF , +.RB + HUGE_VALL +¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ + +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼ (range error)¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Î¾ì¹ç +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼¡¢¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Î¾ì¹ç +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR cexp (3), +.BR exp10 (3), +.BR exp2 (3), +.BR sqrt (3) diff --git a/release/man3/exp10.3 b/release/man3/exp10.3 new file mode 100644 index 00000000..9e21edb0 --- /dev/null +++ b/release/man3/exp10.3 @@ -0,0 +1,88 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 +.\" +.TH EXP10 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +exp10, exp10f, exp10l \- ´ð¿ô¤¬ 10 ¤Î»Ø¿ô´Ø¿ô +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "double exp10(double " x ); +.br +.BI "float exp10f(float " x ); +.br +.BI "long double exp10l(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR exp10 () +´Ø¿ô¤Ï 10 ¤Î \fIx\fP ¾è¤ÎÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï 10 ¤Î +.I x +¾è¤òÊÖ¤¹¡£ + +̵¸ÂÂç¤ä NaN ¤Î°·¤¤¤ä¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤È¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Ê¤É¤Î +¤µ¤Þ¤¶¤Þ¤ÊÆÃÊ̤ʾõ¶·¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR exp (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ + +¤³¤ì¤é¤Î´Ø¿ô¤ÇȯÀ¸¤¹¤ë¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR exp (3), +.BR exp2 (3), +.BR log10 (3), +.BR sqrt (3), +.BR feature_test_macros (7) diff --git a/release/man3/exp2.3 b/release/man3/exp2.3 new file mode 100644 index 00000000..80b1c174 --- /dev/null +++ b/release/man3/exp2.3 @@ -0,0 +1,99 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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:27:35 JST 2003 +.\" by Akihiro MOTOKI +.\" +.TH EXP2 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +exp2, exp2f, exp2l \- Ä줬 2 ¤Î»Ø¿ô´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double exp2(double " x ); +.br +.BI "float exp2f(float " x ); +.br +.BI "long double exp2l(long double " x ); +.fi +.sp +\fI-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR exp2 (), +.BR exp2f (), +.BR exp2l (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR exp2 () +´Ø¿ô¤Ï 2 ¤Î \fIx\fP ¾è¤ÎÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï 2 ¤Î +.I x +¾è¤òÊÖ¤¹¡£ + +̵¸ÂÂç¤ä NaN ¤Î°·¤¤¤ä¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤È¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Ê¤É¤Î +¤µ¤Þ¤¶¤Þ¤ÊÆÃÊ̤ʾõ¶·¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR exp (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ + +¤³¤ì¤é¤Î´Ø¿ô¤ÇȯÀ¸¤¹¤ë¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR exp (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR cexp2 (3), +.BR exp (3), +.BR exp10 (3), +.BR sqrt (3) diff --git a/release/man3/expm1.3 b/release/man3/expm1.3 new file mode 100644 index 00000000..fcde6c52 --- /dev/null +++ b/release/man3/expm1.3 @@ -0,0 +1,148 @@ +.\" Copyright 1995 Jim Van Zandt +.\" 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. +.\" +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +expm1, expm1f, expm1l \- °ú¤­¿ô¤Î»Ø¿ô¤«¤é 1 ¤ò°ú¤¤¤¿ÃÍ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double expm1(double " x ); +.br +.BI "float expm1f(float " x ); +.br +.BI "long double expm1l(long double " x ); +.sp +.fi +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR expm1 (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR expm1f (), +.BR expm1l (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BI expm1( x ) +¤Ï°Ê²¼¤ÈÅù¤·¤¤ÃͤòÊÖ¤¹¡£ +.nf + + exp(x) \- 1 + +.fi +\fIx\fP ¤¬ 0 ¤Ë¶á¤¯¡¢ +.I "exp(x) \- 1" +¤¬°ú¤­»»»þ¤Î·åÍî¤Á¤Î¤¿¤á¤ËÉÔÀµ³Î¤È¤Ê¤ë¤è¤¦¤Ê¾ì¹ç¤Ç¤â¡¢ +Àµ³Î¤ÊÃͤ¬·×»»¤Ç¤­¤ëÊýË¡¤¬ÍѤ¤¤é¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I "exp(x)\ \-\ 1" +¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 (\-0) ¤Î¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.RB - HUGE_VAL , +.RB - HUGE_VALF , +.RB - HUGE_VALL +¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼ (range error)¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Î¾ì¹ç +.\" .I errno +.\" is set to +.\" .BR ERANGE . +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I errno +¤òÀßÄꤷ¤Ê¤¤¡£ +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6788 +.\" +.\" +.\" POSIX.1 specifies an optional range error (underflow) if +.\" x is subnormal. Glibc does not implement this. +.SH ½àµò +C99, POSIX.1-2001. +.\" BSD. +.SH ¥Ð¥° +.I x +¤¬Éé¤ÎÂ礭¤ÊÃͤξì¹ç (¤³¤Î¾ì¹ç¤Ë¤Ï´Ø¿ô¤Î·ë²Ì¤Ï \-1 ¤Ë¶áÉÕ¤¤¤Æ¤¤¤¯)¡¢ +.BR expm1 () +¤Ï´Ö°ã¤Ã¤Æ¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°¤ò¾å¤²¤ë¤³¤È¤¬¤¢¤ë¡£ +.\" FIXME . +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6778 + +.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. +.SH ´ØÏ¢¹àÌÜ +.BR exp (3), +.BR log (3), +.BR log1p (3) diff --git a/release/man3/fabs.3 b/release/man3/fabs.3 new file mode 100644 index 00000000..f2dc8746 --- /dev/null +++ b/release/man3/fabs.3 @@ -0,0 +1,96 @@ +.\" 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 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +fabs, fabsf, fabsl \- ÉâÆ°¾®¿ôÅÀ¼Â¿ô¤ÎÀäÂÐÃÍ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double fabs(double " x ); +.br +.BI "float fabsf(float " x ); +.br +.BI "long double fabsl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR fabsf (), +.BR fabsl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR fabs () +´Ø¿ô·²¤ÏÉâÆ°¾®¿ôÅÀ¼Â¿ô \fIx\fP ¤ÎÀäÂÐÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÀäÂÐÃͤòÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ \-0 ¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Éé¤Î̵¸ÂÂ礫Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤Ïµ¯¤³¤é¤Ê¤¤¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR abs (3), +.BR cabs (3), +.BR ceil (3), +.BR floor (3), +.BR labs (3), +.BR rint (3) diff --git a/release/man3/fclose.3 b/release/man3/fclose.3 new file mode 100644 index 00000000..dbcd29b8 --- /dev/null +++ b/release/man3/fclose.3 @@ -0,0 +1,114 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fclose.3 6.7 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:19:14 1993, faith@cs.unc.edu +.\" +.\" Modified 2000-07-22 by Nicolas Lichtmaier +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated Mon Jan 20 18:30:47 JST 1997 +.\" by Takashi Yoshino +.\" Updated Mon Sep 25 01:58:44 JST 2000 +.\" by Kentaro Shirakata +.\" Updated & Modified Tue Apr 3 20:49:00 JST 2001 +.\" by Yuichi SATO +.\" Updated & Modified Mon Jan 10 08:08:29 JST 2005 +.\" by Yuichi SATO +.\" +.TH FCLOSE 3 2009-02-23 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fclose \- ¥¹¥È¥ê¡¼¥à¤òÊĤ¸¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int fclose(FILE *" fp ); +.SH ÀâÌÀ +.BR fclose () +´Ø¿ô¤Ï +.I fp +¤Ç»Ø¤µ¤ì¤ë¥¹¥È¥ê¡¼¥à¤ò (¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤¿Á´¤Æ¤Î½ÐÎϥǡ¼¥¿¤ò +.BR fflush (3) +¤òÍѤ¤¤Æ½ñ¤­¹þ¤ó¤Ç) ¥Õ¥é¥Ã¥·¥å¤·¡¢ +¤½¤Î´ð¤È¤Ê¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +´Ø¿ô¤¬Àµ¾ï¤Ë½ªÎ»¤¹¤ë¤È 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +Àµ¾ï¤Ë½ªÎ»¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï +.B EOF +¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¥¨¥é¡¼¤ò¼¨¤¹¤¿¤á¤ËÀßÄꤵ¤ì¤ë¡£ +¤É¤Á¤é¤Î¾ì¹ç¤â¡¢¤½¤Î¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ë +.RB ( fclose () +¤Ø¤Î¤µ¤é¤Ê¤ë¸Æ¤Ó½Ð¤·¤ò´Þ¤à) ¤½¤ì°Ê¾å¤Î¥¢¥¯¥»¥¹¤Ï +̤ÄêµÁ¤ÎÆ°ºî¤òÀ¸¤¸¤µ¤»¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fp +¤Î´ð¤È¤Ê¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.\" Ʊ¤¸¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ ANSI C stdio ¤ÎÁàºî¤ÈÄã¥ì¥Ù¥ë¥Õ¥¡¥¤¥ëÁàºî¤ò +.\" ¼è¤êº®¤¼¤Æ¹Ô¤ï¤Ê¤¤¸Â¤ê¡¢¤³¤Î¥¨¥é¡¼¤Ïµ¯¤³¤é¤Ê¤¤¡£ +.\" ¤³¤Î¥¨¥é¡¼¤ò¼õ¤±¼è¤Ã¤¿¤Î¤Ï¡¢¥¹¥È¥ê¡¼¥à¤ÎÄã¥ì¥Ù¥ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¡¢ +.\" close(fileno(fp)) ¤Ê¤É¤Ç¡¢´û¤Ë¥¯¥í¡¼¥º¤·¤Æ¤·¤Þ¤Ã¤¿¤«¤é¤Ë°ã¤¤¤Ê¤¤¡£ +.PP +.BR fclose () +´Ø¿ô¤Ï¤³¤ì°Ê³°¤Ë¤â +.BR close (2), +.BR write (2), +.BR fflush (3) +¤Î¥ë¡¼¥Á¥ó¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ë¡£¤½¤Î¾ì¹ç¤Ï +.I errno +¤¬¡¢¼ºÇÔ¤·¤¿¥ë¡¼¥Á¥ó¤ÇÀßÄꤵ¤ì¤¿ÃͤËÀßÄꤵ¤ì¤ë¡£ +.SH ½àµò +C89, C99. +.SH Ãí°Õ +.BR fclose () +¤Ï C ¥é¥¤¥Ö¥é¥ê¤ÇÄ󶡤µ¤ì¤¿¥æ¡¼¥¶¡¼¶õ´Ö¥Ð¥Ã¥Õ¥¡¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¤À¤±¤Ç +¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¥Ç¡¼¥¿¤ò³Î¼Â¤ËʪÍýŪ¤Ë¥Ç¥£¥¹¥¯¤Ëµ­Ï¿¤¹¤ë¤¿¤á¤Ë¤Ï +¥«¡¼¥Í¥ë¥Ð¥Ã¥Õ¥¡¤â +.RB ( sync (2) +¤ä +.BR fsync (2) +¤òÍѤ¤¤Æ) ¥Õ¥é¥Ã¥·¥å¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR fcloseall (3), +.BR fflush (3), +.BR fopen (3), +.BR setbuf (3) diff --git a/release/man3/fcloseall.3 b/release/man3/fcloseall.3 new file mode 100644 index 00000000..0edf070a --- /dev/null +++ b/release/man3/fcloseall.3 @@ -0,0 +1,67 @@ +.\" Copyright (c) 2006 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. +.\" License. +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated 2000-06-24, Yuichi SATO +.\" Updated 2007-05-04, Akihiro MOTOKI , LDP v2.46 +.\" +.\"WORD: standard streams ɸ½àÆþ½ÐÎÏ +.\" +.TH FCLOSEALL 3 2006-12-27 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fcloseall \- ³«¤¤¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î¥¹¥È¥ê¡¼¥à¤òÊĤ¸¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.B int fcloseall(void); +.fi +.SH ÀâÌÀ +.BR fcloseall () +´Ø¿ô¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬³«¤¤¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î¥¹¥È¥ê¡¼¥à¤òÊĤ¸¤ë¡£ +¥¹¥È¥ê¡¼¥à¤òÊĤ¸¤ëÁ°¤Ë¡¢ +.RB ( fflush (3) +¤ÈƱ¤¸¤è¤¦¤Ë) ³Æ¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¤Ëί¤Ã¤Æ¤¤¤ë½ÐÎϥǡ¼¥¿¤Ï½ñ¤­½Ð¤µ¤ì¤ë¡£ +ÆþÎϥХåե¡Æâ¤Î¥Ç¡¼¥¿¤ÏÇË´þ¤µ¤ì¤ë¡£ + +ɸ½àÆþ½ÐÎÏ +.IR stdin , +.IR stdout , +.I stderr +¤âÊĤ¸¤é¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤Î´Ø¿ô¤Ï¡¢¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤¬Àµ¾ï¤ËÊĤ¸¤é¤ì¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.B EOF +¤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR fclose (3), +.BR fflush (3), +.BR fopen (3), +.BR setbuf (3), +.BR feature_test_macros (7) diff --git a/release/man3/fdim.3 b/release/man3/fdim.3 new file mode 100644 index 00000000..2b48d811 --- /dev/null +++ b/release/man3/fdim.3 @@ -0,0 +1,80 @@ +.\" Copyright 2003 Walter Harms, Andries Brouwer +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +fdim, fdimf, fdiml \- Àµ¤Îº¹Ê¬¤ò·×»»¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "double fdim(double " x ", double " y ); +.br +.BI "float fdimf(float " x ", float " y ); +.br +.BI "long double fdiml(long double " x ", long double " y ); +.sp +\fI-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR fdimf (), +.BR fdiml (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢Æó¤Ä¤Î°ú¤­¿ô´Ö¤ÎÀµ¤Îº¹Ê¬ max(\fIx\fP-\fIy\fP,0) ¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤ÏÀµ¤Îº¹Ê¬¤òÊÖ¤¹¡£ + +.I x +¤« +.I y +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.BR HUGE_VAL , +.BR HUGE_VALF , +.B HUGE_VALL +¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼ (range error)¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Î¾ì¹ç +.\" .I errno +.\" is set to +.\" .BR ERANGE . +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR fmax (3) diff --git a/release/man3/fenv.3 b/release/man3/fenv.3 new file mode 100644 index 00000000..4156924a --- /dev/null +++ b/release/man3/fenv.3 @@ -0,0 +1,336 @@ +.\" Copyright (c) 2000 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. +.\" +.\" 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 ÆâÉô¤Î +.\" +.TH FENV 3 2008-08-11 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag, +fetestexcept, fegetenv, fegetround, feholdexcept, fesetround, +fesetenv, feupdateenv, feenableexcept, fedisableexcept, +fegetexcept \- ÉâÆ°¾®¿ôÅÀ¤Î´Ý¤á¤ÈÎã³°¤Î¼è¤ê°·¤¤ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int feclearexcept(int " excepts ); +.br +.BI "int fegetexceptflag(fexcept_t *" flagp ", int " excepts ); +.br +.BI "int feraiseexcept(int " excepts ); +.br +.BI "int fesetexceptflag(const fexcept_t *" flagp ", int " excepts ); +.br +.BI "int fetestexcept(int " excepts ); +.sp +.B "int fegetround(void);" +.br +.BI "int fesetround(int " rounding_mode ); +.sp +.BI "int fegetenv(fenv_t *" envp ); +.br +.BI "int feholdexcept(fenv_t *" envp ); +.br +.BI "int fesetenv(const fenv_t *" envp ); +.br +.BI "int feupdateenv(const fenv_t *" envp ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +¤³¤ì¤é¤Î 11 ¸Ä¤Î´Ø¿ô¤Ï C99 ¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +ÉâÆ°¾®¿ôÅÀ¤Î´Ý¤á¤ÈÎã³° (¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¡¢¥¼¥í¤Ë¤è¤ë½ü»»¤Ê¤É) +¤Î¼è¤ê°·¤¤¤òµ¬Äꤹ¤ë¡£ +.SS Îã³° +.I divide-by-zero +Îã³°¤Ï¡¢Í­¸Â¤Î¿ôÃͤËÂФ¹¤ë±é»»¤¬¡¢ +̵¸ÂÂç¤ÎÅú¤¨¤òÀ¸À®¤¹¤ë¤è¤¦¤Ê¾ì¹ç¤Ëµ¯¤³¤ë¡£ +.LP +.I overflow +Îã³°¤Ï¡¢·ë²Ì¤¬ÉâÆ°¾®¿ôÅÀ¿ôÃͤÇɽµ­¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Î¤Ë¡¢ +¤½¤ÎÀäÂÐÃͤ¬É½¸½²Äǽ¤ÊÉâÆ°¾®¿ôÅÀ¿ô¤Î (Í­¸Â¤Î) ºÇÂçÃͤè¤ê¤â +(¤º¤Ã¤È) Â礭¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤è¤¦¤Ê¾ì¹ç¤Ëµ¯¤³¤ë¡£ +.LP +.I underflow +Îã³°¤Ï¡¢·ë²Ì¤¬ÉâÆ°¾®¿ôÅÀ¿ôÃͤÇɽµ­¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Î¤Ë¡¢ +¤½¤ÎÀäÂÐÃͤ¬Àµ¤ÎÀµµ¬²½ÉâÆ°¾®¿ôÅÀ¿ô¤ÎºÇ¾®Ãͤè¤ê¤â +¾®¤µ¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦ +(¤½¤·¤Æ ÈóÀµµ¬²½¿ô¤Çɽ¸½¤·¤¿¾ì¹ç¤ËÈó¾ï¤ËÀºÅÙ¤ò¼º¤Ã¤Æ¤·¤Þ¤¦) +¤è¤¦¤Ê¾ì¹ç¤Ëµ¯¤³¤ë¡£ +.LP +.I inexact +Îã³°¤Ï¡¢´Ý¤á¸å¤Î±é»»·ë²Ì¤¬¡¢ +̵¸ÂÀºÅ٤ηë²Ì¤È°Û¤Ê¤ë¤è¤¦¤Ê¾ì¹ç¤Ëµ¯¤³¤ë¡£ +.I overflow +Îã³°¤« +.I underflow +Îã³°¤¬µ¯¤­¤¿¤È¤­¤Ë¤Ï¡¢¾ï¤Ë¤³¤ÎÎã³°¤âµ¯¤³¤ë¡£ +.LP +.I invalid +Îã³°¤Ï¡¢±é»»·ë²Ì¤¬¤¦¤Þ¤¯ÄêµÁ¤Ç¤­¤Ê¤¤·ë²Ì¤òÀ¸¤¸¤ë¤è¤¦¤Ê¾ì¹ç¤Ëµ¯¤³¤ë¡£ +Î㤨¤Ð 0/0¡¢Ìµ¸ÂÂç \- ̵¸ÂÂç¡¢sqrt(\-1) ¤Ê¤É¡£ +.SS Îã³°½èÍý +Îã³°¤Îɽ¤·Êý¤Ë¤Ï 2 ¤Ä¤ÎÊýË¡¤¬¤¢¤ë¡£ +¤Ò¤È¤Ä¤Ï¡¢Ã±°ì¤Î¥Ó¥Ã¥È¤Ç (Îã³°¤¬¤¢¤Ã¤¿¤«¤Ê¤«¤Ã¤¿¤«¤ò) ɽ¤¹ÊýË¡¤Ç¡¢ +¤³¤ì¤é¤Î¥Ó¥Ã¥È¤ÏÀ°¿ô¤Î¤¢¤ë¥Ó¥Ã¥È°ÌÃÖ¤ËÂбþ¤·¡¢¥Ó¥Ã¥È¤ÎÂбþÉÕ¤±¤Ï +¼ÂÁõ°Í¸¤Ç¤¢¤ë¡£¤â¤¦°ì¤Ä¤Ï¡¢ÆâÉô¹½Â¤ÂΤò»È¤Ã¤Æɽ¤¹ÊýË¡¤Ç¡¢ +¤³¤ÎÊýË¡¤ÎÊý¤¬Îã³°¤Ë´Ø¤¹¤ë¤è¤ê¿¤¯¤Î¾ðÊó +(Î㤨¤ÐÎã³°¤¬µ¯¤³¤Ã¤¿¥³¡¼¥É¤Î¥¢¥É¥ì¥¹¤Ê¤É) ¤¬´Þ¤Þ¤ì¤ë¡£ +.LP +.BR FE_DIVBYZERO , +.BR FE_INEXACT , +.BR FE_INVALID , +.BR FE_OVERFLOW , +.B FE_UNDERFLOW +¤Î³Æ¥Þ¥¯¥í¤Ï¡¢¤½¤ì¤¾¤ìÂбþ¤¹¤ëÎã³°¤Î½èÍý¤ò +¼ÂÁõ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç¤ËÄêµÁ¤µ¤ì¤ë¡£ +¤³¤Î¤È¤­Âбþ¤¹¤ë¥Ó¥Ã¥È¤ò¤½¤ì¤¾¤ìÄêµÁ¤¹¤ë¤³¤È¤Ë¤Ê¤ë¤Î¤Ç¡¢ +Îã³°½èÍý´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤ò¡¢Î㤨¤Ð +.BR FE_OVERFLOW | FE_UNDERFLOW +¤È¤¤¤¦À°¿ô¤Î°ú¤­¿ô¤òÍѤ¤¤Æ¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¾¤ÎÎã³°¤â¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.B FE_ALL_EXCEPT +¥Þ¥¯¥í¤Ï¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÎã³°¤ËÂбþ¤¹¤ë¥Ó¥Ã¥È¤¬Á´¤Æ¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë +(¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÎã³°Á´¤Æ¤ÎÏÀÍýϤǤ¢¤ë)¡£ +.PP +.BR feclearexcept () +´Ø¿ô¤Ï¡¢°ú¤­¿ô +.I excepts +¤Î¥Ó¥Ã¥ÈÎó¤Ç»ØÄꤵ¤ì¤¿Îã³°¤ò¥¯¥ê¥¢¤¹¤ë +(½èÍý¤Ï¼ÂÁõ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÎã³°¤Ë¤Ä¤¤¤Æ¤Î¤ß¹Ô¤ï¤ì¤ë)¡£ +.LP +.BR fegetexceptflag () +´Ø¿ô¤Ï¡¢°ú¤­¿ô +.I excepts +¤Ç»ØÄꤵ¤ì¤¿Îã³°¥Õ¥é¥°¤Î¾õÂÖ¤ò +.I *flagp +¤¬»Ø¤¹ÆâÉô¥ª¥Ö¥¸¥§¥¯¥È¤ËÊݸ¤¹¤ë¡£ +.LP +.BR feraiseexcept () +´Ø¿ô¤Ï¡¢ +.I excepts +¤Î¥Ó¥Ã¥ÈÎó¤Ç»ØÄꤵ¤ì¤¿Îã³°¤Î¤¦¤Á¡¢ +¼ÂÁõ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤â¤Î¤òȯÀ¸¤µ¤»¤ë¡£ +.LP +.BR fesetexceptflag () +´Ø¿ô¤Ï¡¢ +.I excepts +¤Ç»ØÄꤵ¤ì¤¿Îã³°¤ËÂбþ¤¹¤ë¥Õ¥é¥°¤Î¾õÂÖ¤ò +.I *flagp +¤ÎÃͤËÀßÄꤹ¤ë¡£ +.I *flagp +¤ÎÃͤϡ¢¤³¤Î´Ø¿ô¤ò¸Æ¤ÖÁ°¤Ë +.BR fegetexceptflag () +´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤Æ¼èÆÀ¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(¤³¤Î¤È¤­¡¢ +.BR fegetexceptflag () +¤ÎºÇ¸å¤Î°ú¤­¿ô¤Ë¤Ï¡¢ +.BR fesetexceptflag () +¤ËÅϤ¹ +.I excepts +¤Î¤¹¤Ù¤Æ¤Î¥Ó¥Ã¥È¤ò´Þ¤àÃͤò»ØÄꤹ¤ë¤³¤È)¡£ +.LP +.BR fetestexcept () +´Ø¿ô¤Ï¡¢ +.I excepts +°ú¤­¿ô¤Ç¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Ó¥Ã¥È¤Î¤¦¤Á¡¢ +¸½ºßÀßÄꤵ¤ì¤Æ¤¤¤ëÎã³°¤ËÂбþ¤¹¤ë¥Ó¥Ã¥È¤¬ 1 ¤Ë¤Ê¤Ã¤¿¥ï¡¼¥É¤òÊÖ¤¹¡£ +.SS ´Ý¤á¥â¡¼¥É +´Ý¤á¥â¡¼¥É¤Ï¡¢·ë²Ì¤¬²¾¿ôÉô¤À¤±¤ÇÀµ³Î¤Ëɽ¸½¤Ç¤­¤Ê¤¤ºÝ¤Ë¡¢ +ÉâÆ°¾®¿ôÅÀÁàºî¤Î·ë²Ì¤ò¤É¤Î¤è¤¦¤Ë°·¤¦¤«¤ò·è¤á¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤µ¤Þ¤¶¤Þ¤Ê´Ý¤á¥â¡¼¥É¤òÄ󶡤¹¤ë¤³¤È¤¬¤Ç¤­¤ë: +ºÇ¤â¶á¤¤Ãͤ˴ݤá¤ë (¥Ç¥Õ¥©¥ë¥È)¡¢ +(Àµ¤Î̵¸ÂÂç¤Ë¸þ¤«¤Ã¤Æ) Â礭¤¯¤Ê¤ëÊý¸þ¤Ë´Ý¤á¤ë¡¢ +(Éé¤Î̵¸ÂÂç¤Ë¸þ¤«¤Ã¤Æ) ¾®¤µ¤¯¤Ê¤ëÊý¸þ¤Ë´Ý¤á¤ë¡¢ +0 ¤Ë¸þ¤±¤Æ´Ý¤á¤ë¡¢¤Ç¤¢¤ë¡£ + +.BR FE_TONEAREST , +.BR FE_UPWARD , +.BR FE_DOWNWARD , +.BR FE_TOWARDZERO +¤Î³Æ¥Þ¥¯¥í¤Ï¡¢¤½¤ì¤¾¤ìÂбþ¤¹¤ë´Ý¤á¤ÎÊý¸þ¤ò +¼ÂÁõ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç¤ËÄêµÁ¤µ¤ì¤ë¡£ +.LP +.BR fegetround () +´Ø¿ô¤Ï¸½ºß¤Î´Ý¤á¥â¡¼¥É¤ËÂбþ¤¹¤ë¥Þ¥¯¥í¤òÊÖ¤¹¡£ +.LP +.BR fesetround () +´Ø¿ô¤Ï´Ý¤á¥â¡¼¥É¤ò°ú¤­¿ô¤ËÍ¿¤¨¤é¤ì¤¿Ãͤˤ·¡¢ +À®¸ù¤·¤¿¤é¥¼¥í¤òÊÖ¤¹¡£ + +C99 ¤È POSIX.1-2008 ¤Ç¤Ï +.B FLT_ROUNDS +¤È¤¤¤¦¼±Ê̻Ҥ¬µ¬Äꤵ¤ì¤Æ¤ª¤ê¡¢ +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£¤³¤Î¼±ÊÌ»Ò¤Ï +ÉâÆ°¾®¿ôÅÀ¿ô¤Î²Ã»»¤Ë¤Ä¤¤¤Æ¤Î¼ÂÁõÄêµÁ¤µ¤ì¤¿´Ý¤áÆ°ºî¤òɽ¤·¡¢ +°Ê²¼¤Î¤¤¤º¤ì¤«¤ÎÃͤò»ý¤Ä¡£ +.IP \-1 +´Ý¤á¥â¡¼¥É¤Ï·è¤á¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +.IP 0 +0 ¤Ë¸þ¤±¤Æ´Ý¤á¤ë¡£ +.IP 1 +ºÇ¤â¶á¤¤¿ô¤Ë´Ý¤á¤ë¡£ +.IP 2 +Àµ¤Î̵¸ÂÂç¤Ë¸þ¤±¤Æ´Ý¤á¤ë¡£ +.IP 3 +Éé¤Î̵¸ÂÂç¤Ë¸þ¤±¤Æ´Ý¤á¤ë¡£ +.PP +¾¤ÎÃͤϥޥ·¥ó°Í¸¤Ç¤¢¤ê¡¢É¸½àŪ¤Ç¤Ï¤Ê¤¤´Ý¤á¥â¡¼¥É¤Ç¤¢¤ë¡£ +.PP +.BR FLT_ROUNDS +¤ÎÃͤˤϡ¢ +.BR fesetround () +¤ÇÀßÄꤵ¤ì¤¿¸½ºß¤Î´Ý¤á¥â¡¼¥É¤¬È¿±Ç¤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë +(⤷¡¢¡Ö¥Ð¥°¡×¤ÎÀá¤ò»²¾È)¡£ +.SS ÉâÆ°¾®¿ôÅÀ´ØÏ¢¤Î´Ä¶­ +ÉâÆ°¾®¿ôÅÀ´ØÏ¢¤Î´Ä¶­¤ÎÁ´ÂΤϡ¢ +À©¸æ¥â¡¼¥É¤ä¾õÂ֥ե饰¤â´Þ¤á¡¢ +.I fenv_t +·¿¤ÎÆâÉô¥ª¥Ö¥¸¥§¥¯¥È°ì¤Ä¤Ç¼è¤ê°·¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î´Ä¶­¤Ï¡¢ +.RI ( "const fenv_t *" +·¿¤Î) +.B FE_DFL_ENV +¤Ç¼¨¤µ¤ì¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï¥×¥í¥°¥é¥à¤Î³«»Ï»þ¤Ë¹½ÃÛ¤µ¤ì¤ë´Ä¶­¤Ç¤¢¤ê¡¢ +ISO C ¤Ç¤Ï¡¢´Ý¤á¥â¡¼¥É¤òºÇ¤â¶á¤¤Ãͤؤδݤá +.RB ( FE_TONEAREST ) +¤ËÀßÄꤷ¡¢¤¹¤Ù¤Æ¤ÎÎã³°¤ò¥¯¥ê¥¢¤·¡¢ÉÔÄä»ß (nonstop) +(Îã³°¤¬µ¯¤­¤Æ¤â·Ñ³¤¹¤ë) ¥â¡¼¥É¤È¤¹¤ë¤è¤¦¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.LP +.BR fegetenv () +´Ø¿ô¤Ï¡¢¸½ºß¤ÎÉâÆ°¾®¿ôÅÀ´Ä¶­¤ò¡¢¥ª¥Ö¥¸¥§¥¯¥È +.I *envp +¤ËÊݸ¤¹¤ë¡£ +.LP +.BR feholdexcept () +´Ø¿ô¤âƱ¤¸Æ°ºî¤ò¹Ô¤¤¡¢ +¤µ¤é¤Ë²Äǽ¤Ç¤¢¤ì¤Ð¡¢Á´¤Æ¤ÎÎã³°¥Õ¥é¥°¤ò¥¯¥ê¥¢¤·¡¢ +nonstop (Îã³°»þ¤Ë¤â¼Â¹Ô¤ò·Ñ³) ¥â¡¼¥É¤ËÀßÄꤹ¤ë¡£ +.LP +.BR fesetenv () +´Ø¿ô¤Ï¡¢ÉâÆ°¾®¿ôÅÀ´Ä¶­¤ò¡¢¥ª¥Ö¥¸¥§¥¯¥È +.I *envp +¤«¤é¼è¤ê½Ð¤·¤¿ÃͤËÌ᤹¡£ +¤³¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢Í­¸ú¤Ç¤¢¤ë¤³¤È¤¬»öÁ°¤Ëʬ¤«¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Î㤨¤Ð¡¢ +.BR fegetenv () +¤ä +.BR feholdexcept () +¤ò¸Æ¤Ó½Ð¤·¤¿·ë²Ì¤Ç¤¢¤ë¤È¤«¡¢ +.B FE_DFL_ENV +¤ËÅù¤·¤¤¤È¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤ÏÎã³°¤òȯÀ¸¤·¤Ê¤¤¡£ +.LP +.BR feupdateenv () +´Ø¿ô¤Ï¡¢¥ª¥Ö¥¸¥§¥¯¥È +.I *envp +¤¬É½¸½¤¹¤ëÉâÆ°¾®¿ôÅÀ´Ä¶­¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¡£ +¤¿¤À¤·¡¢¸½ºßȯÀ¸¤·¤Æ¤¤¤ëÎã³°¤Ï¥¯¥ê¥¢¤µ¤ì¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤ò¸Æ¤ó¤À¸å¤ËΩ¤Ã¤Æ¤¤¤ëÎã³°¤Ï¡¢ +´Ø¿ô¤ò¸Æ¤ÖÁ°¤ÎÃÍ¤È +.I *envp +¤ÎÃͤȤΥӥåȤ´¤È¤Î OR ¤ò¼è¤Ã¤¿¤â¤Î¤Ë¤Ê¤ë¡£ +¾åµ­¤ÈƱÍͤˡ¢¥ª¥Ö¥¸¥§¥¯¥È +.I *envp +¤Ï¡¢»öÁ°¤ËÍ­¸ú¤Ç¤¢¤ë¤³¤È¤¬Ê¬¤«¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢À®¸ù¤Î¾ì¹ç 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È 0 °Ê³°¤òÊÖ¤¹¡£ +.\" °ÊÁ°¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤Î¤¦¤Á 7¤Ä¤Ï void ¤òÊÖ¤¹¤â¤Î¤È½ñ¤«¤ì¤Æ¤¤¤¿¡£ +.\" ¤³¤ì¤Ï C99 ɸ½à¤Î Corrigendum 1 (ISO/IEC 9899:1999/Cor.1:2001(E)) +.\" ¤Ç½¤Àµ¤µ¤ì¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +IEC 60559 (IEC 559:1989), ANSI/IEEE 854, C99, POSIX.1-2001. +.SH Ãí°Õ +.SS glibc ¤Ç¤ÎÃí°Õ +²Äǽ¤Ê¾ì¹ç¤Ë¤Ï¡¢GNU C Library ¤Ï¥Þ¥¯¥í +.B FE_NOMASK_ENV +¤òÄêµÁ¤¹¤ë¡£¤³¤Î¥Þ¥¯¥í¤Ï¤¹¤Ù¤Æ¤ÎÎã³°¤Ç¥È¥é¥Ã¥×¤¬À¸¤¸¤ë¤è¤¦¤Ê´Ä¶­¤òɽ¤¹¡£ +.B #ifdef +¤ò»È¤Ã¤Æ¤³¤Î¥Þ¥¯¥í¤ò¥Æ¥¹¥È¤Ç¤­¤ë¡£¤³¤ì¤Ï +.B _GNU_SOURCE +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¸Â¤Ã¤ÆÄêµÁ¤µ¤ì¤ë¡£ +C99 ɸ½à¤ÏÉâÆ°¾®¿ôÅÀ¥Þ¥¹¥¯ (Î㤨¤ÐÆÃÄê¤Î¥Õ¥é¥°¤Ç¤Î¥È¥é¥Ã¥×¤Ê¤É) +¤Î³Æ¥Ó¥Ã¥È¤ÎÀßÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤ÏÄêµÁ¤·¤Æ¤¤¤Ê¤¤¡£ +glibc 2.2 ¤Ï +.BR feenableexcept () +´Ø¿ô¤È +.BR fedisableexcept () +´Ø¿ô¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤ª¤ê¡¢ +³Æ¡¹¤ÎÉâÆ°¾®¿ôÅÀ¥È¥é¥Ã¥×¤òÀßÄê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤Þ¤¿ +.BR fegetexcept () +¤Ë¤è¤Ã¤Æ¾õÂÖ¤ÎÌ䤤¹ç¤ï¤»¤â¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.sp +.nf +.B "#define _GNU_SOURCE" +.br +.B "#include " +.sp +.BI "int feenableexcept(int " excepts ); +.br +.BI "int fedisableexcept(int " excepts ); +.br +.B "int fegetexcept(void);" +.br +.fi +.LP +.BR feenebleexcept () +´Ø¿ô¤È +.BR fedisableexcept () +´Ø¿ô¤Ï +.I excepts +¤Ë¤è¤Ã¤Æɽ¸½¤µ¤ì¤ë³ÆÎã³°¤Î¥È¥é¥Ã¥×¤òÍ­¸ú (̵¸ú) ¤Ë¤¹¤ë¡£ +À®¸ù¤·¤¿¾ì¹ç¤ÏľÁ°¤ËÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤¿Îã³°¤Î¥»¥Ã¥È¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.BR fegetexcept () +´Ø¿ô¤Ï¸½ºßÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëÎã³°Á´¤Æ¤«¤é¤Ê¤ë¥»¥Ã¥È¤òÊÖ¤¹¡£ +.SH ¥Ð¥° +C99 ¤Îµ¬Äê¤Ç¤Ï¡¢ +.BR FLT_ROUNDS +¤ÎÃÍ¤Ë¤Ï +.BR fesetround () +¤ÇÀßÄꤵ¤ì¤¿¸½ºß¤Î´Ý¤á¥â¡¼¥É¤¬È¿±Ç¤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¤È¤µ¤ì¤Æ¤¤¤ë¡£ +¸½ºß¤Î¤È¤³¤í¡¢ +.\" Aug 08, glibc 2.8 +¤³¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤ª¤é¤º¡¢ +.B FLT_ROUNDS +¤Ï¾ï¤ËÃÍ 1 ¤È¤Ê¤ë¡£ +.\" See http://gcc.gnu.org/ml/gcc/2002-02/msg01535.html +.SH ´ØÏ¢¹àÌÜ +.BR feature_test_macros (7), +.BR math_error (7) diff --git a/release/man3/ferror.3 b/release/man3/ferror.3 new file mode 100644 index 00000000..e829441c --- /dev/null +++ b/release/man3/ferror.3 @@ -0,0 +1,129 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)ferror.3 6.8 (Berkeley) 6/29/91 +.\" +.\" +.\" Converted for Linux, Mon Nov 29 14:24:40 1993, faith@cs.unc.edu +.\" Added remark on EBADF for fileno, aeb, 2001-03-22 +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Fri Dec 26 10:49:26 JST 1997 +.\" by HIROFUMI Nishizuka +.\" Updated Sat May 19 JST 2001 by Kentaro Shirakata +.\" Updated Fri Nov 2 JST 2001 by Kentaro Shirakata +.\" +.TH FERROR 3 2008-08-29 "" "Linux Programmer's Manual" +.SH ̾Á° +clearerr, feof, ferror, fileno \- ¥¹¥È¥ê¡¼¥à¥¹¥Æ¡¼¥¿¥¹¤Î¥Á¥§¥Ã¥¯¤È¥ê¥»¥Ã¥È +.SH ½ñ¼° +.B #include +.sp +.BI "void clearerr(FILE *" stream ); + +.BI "int feof(FILE *" stream ); + +.BI "int ferror(FILE *" stream ); + +.BI "int fileno(FILE *" stream ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR fileno (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.SH ÀâÌÀ +´Ø¿ô +.BR clearerr () +¤Ï +.I stream +¤Ç¼¨¤µ¤ì¤ë¥¹¥È¥ê¡¼¥à¤Î EOF(end-of-file) »Ø¼¨»Ò¤È¥¨¥é¡¼»Ø¼¨»Ò¤ò¥¯¥ê¥¢¤¹¤ë¡£ +.PP +´Ø¿ô +.BR feof () +¤Ï +.I stream +¤Ç¼¨¤µ¤ì¤ë¥¹¥È¥ê¡¼¥à¤Î EOF »Ø¼¨»Ò¤ò¥Æ¥¹¥È¤·¡¢ +¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð 0 °Ê³°¤Î¿ô¤òÊÖ¤¹¡£ +EOF »Ø¼¨»Ò¤Ï¡¢´Ø¿ô +.BR clearerr () +¤Ë¤è¤Ã¤Æ¤Î¤ß¥¯¥ê¥¢¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +´Ø¿ô +.BR ferror () +¤Ï +.I stream +¤Ç¼¨¤µ¤ì¤ë¥¹¥È¥ê¡¼¥à¤Î¥¨¥é¡¼»Ø¼¨»Ò¤ò¥Æ¥¹¥È¤·¡¢ +¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð 0 °Ê³°¤Î¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼»Ø¼¨»Ò¤Ï¡¢´Ø¿ô +.BR clearerr () +¤Ë¤è¤Ã¤Æ¤Î¤ß¥ê¥»¥Ã¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +´Ø¿ô +.BR fileno () +¤Ï¡¢°ú¿ô +.I stream +¤òÄ´¤Ù¡¢¤½¤ÎÀ°¿ô¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤òÊÖ¤¹¡£ +.PP +¥í¥Ã¥¯¤»¤º¤Ë¤³¤ì¤é¤Î½èÍý¤ò¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¼ºÇÔ¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¯¡¢¤Þ¤¿¡¢³°ÉôÊÑ¿ô +.I errno +¤ËÃͤò¥»¥Ã¥È¤·¤Ê¤¤¡£ +(¤·¤«¤·¡¢ +.BR fileno () +´Ø¿ô¤Î¾ì¹ç¤Ç¡¢°ú¿ô¤¬Í­¸ú¤Ê¥¹¥È¥ê¡¼¥à¤Ç¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +´Ø¿ô¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B EBADF +¤òÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£) +.SH ½àµò +´Ø¿ô +.BR clearerr (), +.BR feof (), +.BR ferror () +¤Ï C89 ¤È C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR open (2), +.BR fdopen (3), +.BR stdio (3), +.BR unlocked_stdio (3) diff --git a/release/man3/fexecve.3 b/release/man3/fexecve.3 new file mode 100644 index 00000000..a726d47c --- /dev/null +++ b/release/man3/fexecve.3 @@ -0,0 +1,94 @@ +.\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-31, Akihiro MOTOKI +.\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.18 +.\" +.TH FEXECVE 3 2009-02-04 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +fexecve \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int fexecve(int " fd ", char *const " argv "[], char *const " envp []); +.fi +.SH ÀâÌÀ +.BR fexecve () +¤Ï +.BR execve (2) +¤ÈƱ¤¸ºî¶È¤ò¹Ô¤¦¡£°ã¤¦¤Î¤Ï¡¢ +¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¤ò¡¢¥Ñ¥¹Ì¾¤Ç¤Ï¤Ê¤¯¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤òÍѤ¤¤Æ»ØÄꤹ¤ëÅÀ¤Ç¤¢¤ë¡£ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ï¡¢Æɤ߹þ¤ßÀìÍѤǥª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë +¼Â¹Ôµö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" POSIX.1-2008 specifies the O_EXEC flag for open as an alternative, +.\" but Linux doesn't support this flag yet. +.SH ÊÖ¤êÃÍ +.BR fexecve () +¤Ï¸Æ¤Ó½Ð¤·¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢Ìá¤ë¤³¤È¤Ï¤Ê¤¤¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ÊÖ¤êÃͤȤ·¤Æ \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤Ï +.BR execve (2) +¤ÈƱ¤¸¤À¤¬¡¢°Ê²¼¤Î¥¨¥é¡¼¤¬ÄɲäˤʤäƤ¤¤ë: +.TP +.B EINVAL +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£¤Þ¤¿¤Ï +.I argv +¤¬ NULL ¤Ç¤¢¤ë¡£¤Þ¤¿¤Ï +.I envp +¤¬ NULL ¤Ç¤¢¤ë¡£ +.TP +.B ENOSYS +.I /proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR fexecve () +¤Ï glibc 2.3.2 °Ê¹ß¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +POSIX.1-2008. +¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤ª¤é¤º¡¢ +¾¤Î¥·¥¹¥Æ¥à¤Ç¹­¤¯ÍøÍѤǤ­¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +Linux ¤Ç¤Ï¡¢ +.BR fexecve () +¤Ï +.BR proc (5) +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +¤½¤Î¤¿¤á¡¢¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹»þÅÀ¤Ç¤Ï +.I /proc +¤¬¥Þ¥¦¥ó¥È¤µ¤ì¤ÆÍøÍѲÄǽ¤È¤Ê¤Ã¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR execve (2) diff --git a/release/man3/fflush.3 b/release/man3/fflush.3 new file mode 100644 index 00000000..2fe03606 --- /dev/null +++ b/release/man3/fflush.3 @@ -0,0 +1,128 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fflush.3 5.4 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu +.\" +.\" Modified 2000-07-22 by NicoláÔ Lichtmaier +.\" Modified 2001-10-16 by John Levon +.\" +.\" Japanese Version Copyright (c) 1997-2000 YOSHINO Takashi and NAKANO Takeo +.\" all rights reserved. +.\" Translated 1997-02-13,YOSHINO Takashi +.\" Update & Modified 1999-03-01, NAKANO Takeo +.\" Update & Modified 2000-09-21, NAKANO Takeo +.\" Updated 2001-11-02, Kentaro Shirakata +.\" Updated 2010-04-10, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: global variable Âç°èÊÑ¿ô +.\"WORD: buffered ¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤¿ +.\" +.TH FFLUSH 3 2009-09-06 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fflush \- ¥¹¥È¥ê¡¼¥à¤ÎÆâÍƤò¶¯À©Åª¤Ë½ÐÎÏ(¥Õ¥é¥Ã¥·¥å)¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int fflush(FILE *" stream ); +.SH ÀâÌÀ +½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ë´Ø¤·¤Æ¤Ï¡¢ +.BR fflush () +¤Ï¡¢¥æ¡¼¥¶¡¼¶õ´Ö¤Ç¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¤ò +»ØÄꤵ¤ì¤¿½ÐÎϤ˽ñ¤­½Ð¤¹ (¥Õ¥é¥Ã¥·¥å¤¹¤ë)¡¢ +¤â¤·¤¯¤Ï¥¹¥È¥ê¡¼¥à +.I stream +¤Î²¼°Ì¤Ë¤¢¤ë½ñ¤­¹þ¤ß´Ø¿ô¤òÍѤ¤¤Æ¤³¤Î¥¹¥È¥ê¡¼¥à¤ò¹¹¿·¤¹¤ë¡£ +ÆþÎÏ¥¹¥È¥ê¡¼¥à¤Ë´Ø¤·¤Æ¤Ï¡¢ +.BR fflush () +¤Ï¡¢Âбþ¤¹¤ë¥Õ¥¡¥¤¥ë¤«¤é¼èÆÀ¤µ¤ì¤¿¤¬¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é¤Ï +Æɤ߽Фµ¤ì¤Æ¤¤¤Ê¤¤¥Ð¥Ã¥Õ¥¡¥Ç¡¼¥¿¤òÁ´¤ÆÇË´þ¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Ï³«¤¤¤¿¾õÂ֤ΤޤޤǤ¢¤ê¡¢ +¤³¤Î´Ø¿ô¤Ë¤è¤Ã¤Æ²¿¤Î±Æ¶Á¤â¼õ¤±¤Ê¤¤¡£ +.PP +.I stream +°ú¿ô¤¬ .BR NULL ¤Ê¤é¤Ð¡¢ +.BR fflush () +¤Ï³«¤¤¤Æ¤¤¤ë\fI¤¹¤Ù¤Æ¤Î\fR½ÐÎÏ¥¹¥È¥ê¡¼¥à¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.PP +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï +.B EOF +¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¡¢¥¨¥é¡¼¤ËÂбþ¤·¤¿ÃͤËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I Stream +¤Ï³«¤¤¤Æ¤¤¤ë¥¹¥È¥ê¡¼¥à¤Ç¤Ï¤Ê¤¤¡£ +¤¢¤ë¤¤¤Ï¥¹¥È¥ê¡¼¥à¤Ï½ñ¤­¹þ¤ßÍѤǤϤʤ¤¡£ +.PP +.BR fflush () +´Ø¿ô¤Ï +.BR write (2) +¤Ë´Ø¤·¤Æµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤â¤¢¤ë¡£ +¤³¤Î¾ì¹ç +.I errno +¤â¤½¤ÎÃͤËÀßÄꤵ¤ì¤ë¡£ +.SH ½àµò +C89, C99, POSIX.1-2001, POSIX.1-2008. + +ɸ½à¤Ç¤Ï¡¢ÆþÎÏ¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ëÆ°ºî¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¾¤Î¤Û¤È¤ó¤É¤Î¼ÂÁõ¤Ï Linux ¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¡£ +.\" Verified on: Solaris 8. +.SH Ãí°Õ +.BR fflush () +¤Ï¡¢ C ¥é¥¤¥Ö¥é¥ê¤¬Í¿¤¨¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¶õ´Ö¤Î¥Ð¥Ã¥Õ¥¡¤·¤«¥Õ¥é¥Ã¥·¥å¤·¤Ê¤¤¡£ +¥Ç¡¼¥¿¤¬ÊªÍýŪ¤Ë¥Ç¥£¥¹¥¯¤ËÊݸ¤µ¤ì¤ë¤³¤È¤òÊݾڤ·¤¿¤±¤ì¤Ð¡¢ +¥«¡¼¥Í¥ë¥Ð¥Ã¥Õ¥¡¤â¥Õ¥é¥Ã¥·¥å¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤Ë¤ÏÎ㤨¤Ð +.BR sync (2) +¤ä +.BR fsync (2) +¤òÍѤ¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fsync (2), +.BR sync (2), +.BR write (2), +.BR fclose (3), +.BR fopen (3), +.BR setbuf (3), +.BR unlocked_stdio (3) diff --git a/release/man3/ffs.3 b/release/man3/ffs.3 new file mode 100644 index 00000000..33b1c8d3 --- /dev/null +++ b/release/man3/ffs.3 @@ -0,0 +1,82 @@ +.\" 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 Sat Jul 24 19:39:35 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" 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 +.\" +.TH FFS 3 2009-08-27 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +ffs, ffsl, ffsll \- ¥ï¡¼¥É¤ÎÃæ¤ÇºÇ½é¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Ó¥Ã¥È¤Î¸¡½Ð +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int ffs(int " i ); +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int ffsl(long int " i ); +.sp +.BI "int ffsll(long long int " i ); +.fi +.SH ÀâÌÀ +.BR ffs () +´Ø¿ô¤Ï¡¢¥ï¡¼¥É \fIi\fP ¤ÎÃæ¤ÇºÇ½é¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë +(ºÇ²¼°Ì)¥Ó¥Ã¥È¤Î°ÌÃÖ¤òÊÖ¤¹¡£ +ºÇ²¼°Ì¥Ó¥Ã¥È¤Î°ÌÃÖ¤Ï 1¡¢ºÇ¾å°Ì¥Ó¥Ã¥È¤Î°ÌÃÖ¤ÏÎ㤨¤Ð 32 ¤ä 64 ¤Ç¤¢¤ë¡£ +.BR ffsll () +´Ø¿ô¤È +.BR ffsl () +´Ø¿ô¤âƱÍͤÀ¤¬¡¢ +°Û¤Ê¤Ã¤¿¥µ¥¤¥º¤Î°ú¿ô¤ò¤È¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ºÇ½é¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Ó¥Ã¥È¤Î°ÌÃÖ¤òÊÖ¤·¡¢ +.I i +¤Î¤É¤Î¥Ó¥Ã¥È¤â¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +.BR ffs (): 4.3BSD, POSIX.1-2001. +.BR ffsl () +¤È +.BR ffsll () +¤Ï glibc ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +BSD ¥·¥¹¥Æ¥à¤Ç¤Ï +.I +¤Ë¥×¥í¥È¥¿¥¤¥×¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR memchr (3), +.BR feature_test_macros (7) diff --git a/release/man3/fgetgrent.3 b/release/man3/fgetgrent.3 new file mode 100644 index 00000000..7945bbc8 --- /dev/null +++ b/release/man3/fgetgrent.3 @@ -0,0 +1,102 @@ +.\" 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 Sat Jul 24 19:38:44 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-19, HIROFUMI Nishizuka +.\" Updated 2008-08-01, Akihiro MOTOKI +.\" +.TH FGETGRENT 3 2008-07-10 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fgetgrent \- ¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤Î¼è¤ê½Ð¤· +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "struct group *fgetgrent(FILE *" stream ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR fgetgrent (): +_SVID_SOURCE +.SH ÀâÌÀ +.BR fgetgrent () +´Ø¿ô¤Ï¡¢ +.I stream +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤«¤é¼è¤ê½Ð¤·¤¿¥°¥ë¡¼¥×¾ðÊó +¤ò´Þ¤à¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤Ï +ºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤·¡¢¤½¤ì°Ê¹ß¤Ï¡¢¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +.I stream +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ï¡¢ +.I /etc/group +¤ÈƱ¤¸·Á¼°¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.RB ( group (5) +»²¾È)¡£ +.PP +\fIgroup\fP ¹½Â¤ÂΤϡ¢\fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct group { + char *gr_name; /* ¥°¥ë¡¼¥×̾ */ + char *gr_passwd; /* ¥°¥ë¡¼¥×¤Î¥Ñ¥¹¥ï¡¼¥É */ + gid_t gr_gid; /* ¥°¥ë¡¼¥× ID */ + char **gr_mem; /* ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð */ +}; +.fi +.in +.SH ÊÖ¤êÃÍ +.BR fgetgrent () +´Ø¿ô¤Ï +.I group +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ì°Ê¾å¥¨¥ó¥È¥ê¤¬Ìµ¤¤¤«¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +.I group +¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£ +.SH ½àµò +SVr4. +.SH ´ØÏ¢¹àÌÜ +.BR endgrent (3), +.BR fgetgrent_r (3), +.BR fopen (3), +.BR getgrent (3), +.BR getgrgid (3), +.BR getgrnam (3), +.BR putgrent (3), +.BR setgrent (3), +.BR group (5) diff --git a/release/man3/fgetpwent.3 b/release/man3/fgetpwent.3 new file mode 100644 index 00000000..5b687090 --- /dev/null +++ b/release/man3/fgetpwent.3 @@ -0,0 +1,111 @@ +.\" 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 Sat Jul 24 19:37:37 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon May 27 22:40:48 1996 by Martin Schulze (joey@linux.de) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-18, HIROFUMI Nishizuka +.\" Updated 2008-08-01, Akihiro MOTOKI +.\" +.TH FGETPWENT 3 2008-07-10 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fgetpwent \- ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤Î¼è¤ê½Ð¤· +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "struct passwd *fgetpwent(FILE *" stream ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR fgetpwent (): +_SVID_SOURCE +.SH ÀâÌÀ +.BR fgetpwent () +´Ø¿ô¤Ï¡¢\fIstream\fP ¤«¤éÆÀ¤é¤ì¤¿¹Ô¤òʬ²ò¤·¤¿¥Õ¥£¡¼¥ë¥É +¤ò´Þ¤à¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +ºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤Ë¤ÏºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤·¡¢¤½¤ì°Ê¹ß¤Ï +¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +.I stream +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ï +.I /etc/passwd +¤ÈƱ¤¸·Á¼°¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.RB ( passwd (5) +»²¾È)¡£ +.PP +\fIpasswd\fP ¹½Â¤ÂΤϡ¢\fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.nf +.in +4n +struct passwd { + char *pw_name; /* ¥æ¡¼¥¶Ì¾ */ + char *pw_passwd; /* ¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É */ + uid_t pw_uid; /* ¥æ¡¼¥¶ ID */ + gid_t pw_gid; /* ¥°¥ë¡¼¥× ID */ + char *pw_gecos; /* ËÜ̾ */ + char *pw_dir; /* ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê */ + char *pw_shell; /* ¥·¥§¥ë¥×¥í¥°¥é¥à */ +}; +.fi +.in +.SH ÊÖ¤êÃÍ +.BR fgetpwent () +´Ø¿ô¤Ï¡¢ +.I passwd +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ì°Ê¾å¥¨¥ó¥È¥ê¤¬Ìµ¤¤¤«¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +.I passwd +¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/passwd +¥Ñ¥¹¥ï¡¼¥É¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.SH ½àµò +SVr4. +.SH ´ØÏ¢¹àÌÜ +.BR endpwent (3), +.BR fgetpwent_r (3), +.BR fopen (3), +.BR getpw (3), +.BR getpwent (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR putpwent (3), +.BR setpwent (3), +.BR passwd (5) diff --git a/release/man3/fgetwc.3 b/release/man3/fgetwc.3 new file mode 100644 index 00000000..2d4f4202 --- /dev/null +++ b/release/man3/fgetwc.3 @@ -0,0 +1,88 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Aug 29 15:03:27 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 JST 1999 by Kentaro Shirakata +.\" Updated Fri Nov 2 JST 2001 by Kentaro Shirakata +.\" +.TH FGETWC 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.\") .SH NAME +.SH ̾Á° +fgetwc, getwc \- ¥ï¥¤¥Éʸ»ú¤ò FILE ¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤à +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "wint_t fgetwc(FILE *" stream ); +.BI "wint_t getwc(FILE *" stream ); +.fi +.SH ÀâÌÀ +.BR fgetwc () +´Ø¿ô¤Ï¡¢ +.BR fgetc (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï \fIstream\fP ¤«¤é¥ï¥¤¥Éʸ»ú¤ò 1 ʸ»úÆɤ߹þ¤ß¡¢¤³¤ì¤òÊÖ¤¹¡£ +¥¹¥È¥ê¡¼¥à¤Î½ªÃ¼¤Ë㤹¤ë¤«¡¢\fIferror(stream)\fP ¤¬¿¿¤Ë¤Ê¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +¤³¤Î´Ø¿ô¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +¥ï¥¤¥Éʸ»úÊÑ´¹¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï¡¢ +\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤ò¥»¥Ã¥È¤·¡¢ +.B WEOF +¤òÊÖ¤¹¡£ +.PP +.BR getwc () +´Ø¿ô¤¢¤ë¤¤¤Ï¥Þ¥¯¥í¤Ï¡¢ +.BR fgetwc () +¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥Þ¥¯¥í¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç¡¢°ú¤­¿ô¤¬Ê£¿ô²óɾ²Á¤µ +¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£¤³¤Î´Ø¿ô¤ò»È¤¦Íýͳ¤Ï¤â¤Ï¤ä¸ºß¤·¤Ê¤¤¡£ +.PP +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR fgetwc () +´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤Î¼¡¤Î¥ï¥¤¥Éʸ»ú¤«¡¢¤¢¤ë¤¤¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +Ä̾ï¤Î¥¨¥é¡¼¤Ë²Ã¤¨¤Æ¡¢°Ê²¼¤Î¥¨¥é¡¼¤¬¤¢¤ë: +.TP +.B EILSEQ +ÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é¼èÆÀ¤·¤¿¥Ç¡¼¥¿¤¬¡¢Àµ¤·¤¤Ê¸»ú¤Ç¤Ê¤¤¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH Ãí°Õ +.BR fgetwc () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.BR fopen (3) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ÄɲþðÊ󤬤ʤ¤¾ì¹ç¤Ë¤Ï¡¢ +.BR fgetwc () +¤¬¼ÂºÝ +¤Ë¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤ò¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤ß¡¢¤³¤ì¤ò¥ï¥¤¥Éʸ»ú¤Ë +ÊÑ´¹¤¹¤ë¤È´üÂÔ¤¹¤ë¤³¤È¤ÏŬÀڤǤ¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fgetws (3), +.BR fputwc (3), +.BR ungetwc (3), +.BR unlocked_stdio (3) diff --git a/release/man3/fgetws.3 b/release/man3/fgetws.3 new file mode 100644 index 00000000..79c4e390 --- /dev/null +++ b/release/man3/fgetws.3 @@ -0,0 +1,72 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Aug 29 15:03:42 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sat Oct 27 09:01:41 JST 2001 +.\" by Yuichi SATO +.\" +.\" WORD: null wide characters ¥Ê¥ë¥ï¥¤¥Éʸ»ú +.\" +.TH FGETWS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fgetws \- ¥ï¥¤¥Éʸ»ú¤Îʸ»úÎó¤ò FILE ¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤à +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *fgetws(wchar_t *" ws ", int " n ", FILE *" stream ); +.fi +.SH ÀâÌÀ +.BR fgetws () +´Ø¿ô¤Ï +.BR fgets (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢ºÇÂç \fIn\-1\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤ò +\fIws\fP ¤¬¼¨¤¹¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤ËÆɤ߹þ¤ß¡¢½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤òÄɲ乤롣 +¤³¤Î´Ø¿ô¤Ï¡¢¥ï¥¤¥Éʸ»ú¤Î²þ¹Ôʸ»ú¤ò¸«¤Ä¤±¡¢¤³¤ì¤ò³ÊǼ¤¹¤ë¤ÈÆɤ߹þ¤à¤Î¤ò»ß¤á¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤Î½ª¤ï¤ê¤Ë㤷¤¿¾ì¹ç¤âÆɤ߹þ¤ß¤ò»ß¤á¤ë¡£ +.PP +¥×¥í¥°¥é¥Þ¤Ï¡¢\fIws\fP ¤Ë¤Ï¾¯¤Ê¤¯¤È¤â \fIn\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤ò +³ÊǼ¤Ç¤­¤ëÎΰè¤òɬ¤º³ÎÊݤ·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR fgetws () +¤ÏÀ®¸ù¤¹¤ë¤È \fIws\fP ¤òÊÖ¤¹¡£ +´û¤Ë¥¹¥È¥ê¡¼¥à¤Î½ª¤ï¤ê¤Ë㤷¤Æ¤¤¤ë¤«¡¢¥¨¥é¡¼¤¬µ¯¤­¤¿¾ì¹ç¤Ë¤Ï NULL ¤òÊÖ¤¹¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH Ãí°Õ +.BR fgetws () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.BR fopen (3) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ÄɲäξðÊ󤬤ʤ¤¾ì¹ç¤Ë¤Ï¡¢ +.BR fgetws () +¤¬¼ÂºÝ¤Ë¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤ò¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤ß¡¢ +¤³¤ì¤ò¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤¹¤ë¤È´üÂÔ¤¹¤ë¤³¤È¤ÏŬÀڤǤ¢¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤Ï¿®Íê¤Ç¤­¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢ÆþÎϤ˴ޤޤì¤ë¤«¤â¤·¤ì¤Ê¤¤ +¥Ê¥ë¥ï¥¤¥Éʸ»ú¤òŬÀڤ˽èÍý¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fgetwc (3), +.BR unlocked_stdio (3) diff --git a/release/man3/finite.3 b/release/man3/finite.3 new file mode 100644 index 00000000..e3fe826e --- /dev/null +++ b/release/man3/finite.3 @@ -0,0 +1,120 @@ +.\" Copyright 2004 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) 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 ̵¸úÃÍ +.\" +.TH FINITE 3 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +finite, finitef, finitel, isinf, isinff, isinfl, isnan, isnanf, isnanl \- +BSD ¤ÎÉâÆ°¾®¿ôÅÀʬÎà´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int finite(double " x ); +.br +.BI "int finitef(float " x ); +.br +.BI "int finitel(long double " x ); +.sp +.BI "int isinf(double " x ); +.br +.BI "int isinff(float " x ); +.br +.BI "int isinfl(long double " x ); +.sp +.BI "int isnan(double " x ); +.br +.BI "int isnanf(float " x ); +.br +.BI "int isnanl(long double " x ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR finite (), +.BR finitef (), +.BR finitel (): +_BSD_SOURCE || _SVID_SOURCE +.br +.BR isinf (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; +.I cc\ -std=c99 +.br +.BR isinff (), +.BR isinfl (): +_BSD_SOURCE || _SVID_SOURCE +.br +.BR isnan (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; +.I cc\ -std=c99 +.br +.BR isnanf (), +.BR isnanl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH ÀâÌÀ +.BR finite () +´Ø¿ô¤Ï¡¢ \fIx\fP ¤¬Ìµ¸ÂÂç¤ä̵¸úÃÍ (NaN) ¤Î¤¤¤º¤ì¤Ç¤â¤Ê¤¤ +¾ì¹ç¤Ë 0 °Ê³°¤ÎÃͤòÊÖ¤·¡¢¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ + +.BR isnan () +´Ø¿ô¤Ï¡¢ \fIx\fP ¤¬ NaN ¤Î¾ì¹ç 0 °Ê³°¤ÎÃͤòÊÖ¤·¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ + +.BR isinf () +´Ø¿ô¤Ï¡¢ \fIx\fP ¤¬Àµ¤Î̵¸ÂÂç¤Ç¤¢¤ì¤Ð 1 ¤òÊÖ¤·¡¢\fIx\fP ¤¬Éé¤Î̵¸ÂÂç¤Ç +¤¢¤ì¤Ð \-1 ¤òÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÇѻߤµ¤ì¤¿ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +C99 ¤Ç¤Ï¡¢¤³¤ì¤é¤ÎÃÖ¤­´¹¤¨¤È¤·¤Æ (¤É¤ó¤Ê·¿¤Ë¤âŬÍѤǤ­¤ë) +.BR isfinite (), +.BR isinf (), +.BR isnan () +¤È¤¤¤¦¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤µ¤é¤Ë C99 ¤Î +.BR isinf () +¤ÏÊÖ¤êÃͤ˴ؤ·¤Æ¼å¤¤°ÕÌ£¤Ç¤ÎÊݾڤ·¤«¤Ê¤¤¤³¤È¤Ë¤â +Ãí°Õ¤¹¤ë¤³¤È¡£¾ÜºÙ¤Ï +.BR fpclassify (3) +¤ò»²¾È¡£ +.\" +.\" finite* not on HP-UX; they exist on Tru64. +.\" .SH Îò»Ë +.\" .BR finite () +.\" ´Ø¿ô¤Ï 4.3BSD ¤ÇÅо줷¤¿¡£ +.\" 4.3BSD ¤Î¥Þ¥Ë¥å¥¢¥ë¤Î IEEE.3 ¤ò»²¾È +.SH ´ØÏ¢¹àÌÜ +.BR fpclassify (3) diff --git a/release/man3/flockfile.3 b/release/man3/flockfile.3 new file mode 100644 index 00000000..68f35ce7 --- /dev/null +++ b/release/man3/flockfile.3 @@ -0,0 +1,126 @@ +.\" 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) 2001 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Nov 4 14:09:45 2001 +.\" by Akihiro MOTOKI +.\" +.\"WORD: lockcount ¥í¥Ã¥¯¿ô +.\"WORD: owner thread ½êÍ­¼Ô¥¹¥ì¥Ã¥É +.\" +.TH FLOCKFILE 3 2008-08-29 "" "Linux Programmer's Manual" +.SH ̾Á° +flockfile, ftrylockfile, funlockfile \- ɸ½àÆþ½ÐÎÏ FILE ¤Î¥í¥Ã¥¯¤ò¹Ô¤¦ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void flockfile(FILE *" filehandle ); +.br +.BI "int ftrylockfile(FILE *" filehandle ); +.br +.BI "void funlockfile(FILE *" filehandle ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.ad l +.sp +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô: +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +ɸ½àÆþ½ÐÎÏ´Ø¿ô¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤¢¤ë¡£¤³¤ì¤Ï¡¢³Æ +.I FILE +¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ·¡¢¥í¥Ã¥¯¿ô (lockcount) ¤È +(¥í¥Ã¥¯¿ô¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¤Ï) ½êÍ­¼Ô¥¹¥ì¥Ã¥É (owner thread) +¤ò´ÉÍý¤¹¤ë¤³¤È¤Ç¼Â¸½¤µ¤ì¤ë¡£ +¥é¥¤¥Ö¥é¥ê¤Î¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤ëËè¤Ë¡¢É¸½àÆþ½ÐÎÏ´Ø¿ô¤Ï +.I FILE +¥ª¥Ö¥¸¥§¥¯¥È¤¬Â¾¤Î¥¹¥ì¥Ã¥É¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¾õÂ֤ˤʤë¤Þ¤ÇÂÔ¤Á¡¢ +.I FILE +¥ª¥Ö¥¸¥§¥¯¥È¤ò¥í¥Ã¥¯¤·¡¢Í׵ᤵ¤ì¤ÆÆþ½ÐÎϤò¹Ô¤¤¡¢ +¥ª¥Ö¥¸¥§¥¯¥È¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë¡£ +.LP +(Ãí: ¤³¤Î¥í¥Ã¥¯¤Ï¡¢ +.BR flock (2) +¤ä +.BR lockf (3) +¤È¤¤¤Ã¤¿´Ø¿ô¤¬¹Ô¤¦¥í¥Ã¥¯¤È¤ÏÁ´¤¯Ìµ´Ø·¸¤Ç¤¢¤ë¡£) +.LP +¤³¤ì¤é¤Î¤³¤È¤Ï¤¹¤Ù¤Æ C ¥×¥í¥°¥é¥Þ¤Ë¤Ï¸«¤¨¤Ê¤¤Éôʬ¤Ç¹Ô¤ï¤ì¤ë¤¬¡¢ +¤è¤êºÙ¤«¤¤À©¸æ¤¬¤Ç¤­¤¿Êý¤¬¤è¤¤Íýͳ¤¬2¤Ä¤¢¤ë¤À¤í¤¦¡£°ì¤Ä¤Ï¡¢°ì¤Ä¤Î¥¹¥ì¥Ã¥É¤¬ +¹Ô¤¦°ìÏ¢¤ÎÆþ½ÐÎÏÆ°ºî¤Ï°ì½ï¤Ë¹Ô¤ï¤ì¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤ÎÆþ½ÐÎϤˤè¤Ã¤ÆÃæÃǤµ¤ì¤Ê¤¤ +Êý¤¬¤è¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤í¤¦¡£¤â¤¦°ì¤Ä¤Ï¡¢¸úΨ¤òÂ礭¤¯¾å¤²¤ë¤¿¤á¤Ë¤Ï +¥í¥Ã¥¯¤Î¥ª¡¼¥Ð¥Ø¥Ã¥É¤òÈò¤±¤ëɬÍפ¬¤¢¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤í¤¦¡£ +.LP +¤³¤ÎÌÜŪ¤ò¼Â¸½¤¹¤ë¤¿¤á¤Ë¡¢ +.I FILE +¥ª¥Ö¥¸¥§¥¯¥È¤Î¥í¥Ã¥¯¡¢°ìÏ¢¤ÎÆþ½ÐÎÏÆ°ºî¤Î¼Â¹Ô¡¢ +¥í¥Ã¥¯¤Î²ò½ü¤ò¥¹¥ì¥Ã¥É¤¬ÌÀ¼¨Åª¤Ë»Ø¼¨¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤¬ÅÓÃæ¤ÇÆþ½ÐÎϤò¹Ô¤¦¤Î¤òËɻߤ¹¤ë¡£ +¤³¤Î¤è¤¦¤Ê¤³¤È¤ò¹Ô¤¦Íýͳ¤¬¸úΨ¤Î¸þ¾å¤Ç¤¢¤ë¤Ê¤é¤Ð¡¢ +¥í¥Ã¥¯¤ò¹Ô¤ï¤Ê¤¤¥Ð¡¼¥¸¥ç¥ó¤Îɸ½àÆþ½ÐÎÏ´Ø¿ô¤ò»È¤¦¤³¤È¤â¤Ç¤­¤ë¡£ +Î㤨¤Ð¡¢ +.BR getc (3) +¤ä +.BR putc (3) +¤ÎÂå¤ï¤ê¤Ë +.BR getc_unlocked (3) +¤ä +.BR putc_unlocked (3) +¤ò»ÈÍѤ¹¤ë¡£ +.LP +.BR flockfile () +´Ø¿ô¤Ï¡¢\fI*filehandle\fP ¤¬Â¾¤Î¥¹¥ì¥Ã¥É¤Ë¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê +¤¤¾õÂ֤ˤʤë¤Þ¤ÇÂԤ俤ΤÁ¡¢¸½ºß¤Î¥¹¥ì¥Ã¥É¤ò \fI*filehandle\fP ¤Î¥ª¡¼¥Ê¤ËÀß +Äꤷ¡¢¥í¥Ã¥¯¿ô¤ò²Ã»»¤¹¤ë¡£ +.LP +.BR funlockfile () +´Ø¿ô¤Ï¡¢¥í¥Ã¥¯¿ô¤ò¸º»»¤¹¤ë¡£ +.LP +.BR ftrylockfile () +´Ø¿ô¤Ï +.BR flockfile () +¤Î¥Ö¥í¥Ã¥­¥ó¥°¤ò¹Ô¤ï¤Ê¤¤ +¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë¡£Â¾¤Î¥¹¥ì¥Ã¥É¤¬ \fI*filehandle\fP ¤ò¥í¥Ã¥¯¤·¤Æ¤¤¤ë»þ¤Ï +²¿¤â¹Ô¤ï¤º¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï \fI*filehandle\fP ¤Î½êÍ­¸¢¤ò³ÍÆÀ¤·¡¢ +¥í¥Ã¥¯¿ô¤ò²Ã»»¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR ftrylockfile () +´Ø¿ô¤Ï¥í¥Ã¥¯¤ËÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤Ê¤·¡£ +.SH ½àµò +POSIX.1-2001. +.SH ²ÄÍÑÀ­ +.B _POSIX_THREAD_SAFE_FUNCTIONS +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ë¤³¤ì¤é¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +5.1.1 °Ê¹ß¤Î libc ¤È 2.0 °Ê¹ß¤Î glibc ¤Ë¸ºß¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR unlocked_stdio (3) diff --git a/release/man3/floor.3 b/release/man3/floor.3 new file mode 100644 index 00000000..0624593b --- /dev/null +++ b/release/man3/floor.3 @@ -0,0 +1,113 @@ +.\" Copyright 2001 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. +.\" +.\" 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 ²¾¿ô +.\" +.TH FLOOR 3 2008-10-06 "" "Linux Programmer's Manual" +.SH ̾Á° +floor, floorf, floorl \- °ú¤­¿ô¤ò±Û¤¨¤Ê¤¤ºÇÂç¤ÎÀ°¿ôÃÍ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double floor(double " x ); +.br +.BI "float floorf(float " x ); +.br +.BI "long double floorl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR floorf (), +.BR floorl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤è¤êÂ礭¤¯¤Ê¤¤ºÇÂç¤ÎÀ°¿ôÃͤòÊÖ¤¹¡£ + +Î㤨¤Ð¡¢ +.I floor(0.5) +¤Ï 0.0 ¤Ç¡¢ +.I floor(\-0.5) +¤Ï \-1.0 ¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ò±Û¤¨¤Ê¤¤ºÇ¾®¤ÎÀ°¿ôÃͤòÊÖ¤¹¡£ + +\fIx\fP ¤¬À°¿ô¡¢+0¡¢\-0¡¢NaN¡¢Ìµ¸ÂÂç¤Î¤¤¤º¤ì¤«¤Î¾ì¹ç¡¢ +\fIx\fP ¤½¤Î¤â¤Î¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ËÂФ·¤ÆÈÏ°Ï¥¨¥é¡¼¤¬µ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +SUSv2 ¤È POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ë´Ø¤¹¤ëµ­½Ò¤¬¤¢¤ê¡¢ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I errno +¤ò +.B ERANGE +¤ËÀßÄꤹ¤ë¤«¡¢ +.B FE_OVERFLOW +Îã³°¤òȯÀ¸¤¹¤ë¤³¤È¤È¤µ¤ì¤Æ¤¤¤ë¡£ +¼ÂºÝ¤Î¤È¤³¤í¡¢¸½¹Ô¤Î¥Þ¥·¥ó¤Ç¤Ï·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤¹¤³¤È¤Ï¤Ê¤¤¤Î¤Ç¡¢ +¤³¤Î¥¨¥é¡¼½èÍý¤Ï°ÕÌ£¤¬¤Ê¤¤¡£ +.\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point. +(¤è¤êÀµ³Î¤Ë¸À¤¦¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ï»Ø¿ôÉô¤ÎºÇÂçÃͤ¬ +²¾¿ôÉô¤òɽ¤¹¥Ó¥Ã¥È¤Î¿ô¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ë¤·¤«µ¯¤³¤é¤Ê¤¤¡£ +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) diff --git a/release/man3/fma.3 b/release/man3/fma.3 new file mode 100644 index 00000000..364ec925 --- /dev/null +++ b/release/man3/fma.3 @@ -0,0 +1,146 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" Distributed under GPL, 2002-07-27 Walter Harms +.\" 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 2008-10-06 "" "Linux Programmer's Manual" +.SH ̾Á° +fma, fmaf, fmal \- ÉâÆ°¾®¿ôÅÀ¿ô¤ÎÀѤÈϤò·×»»¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double fma(double " x ", double " y ", double " z ); +.br +.BI "float fmaf(float " x ", float " y ", float " z ); +.br +.BI "long double fmal(long double " x ", long double " y ", long double " z ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR fma (), +.BR fmaf (), +.BR fmal (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR fma () +´Ø¿ô¤Ï +.IR x " * " y " + " z +¤ò·×»»¤¹¤ë¡£ +·ë²Ì¤Ï¡¢°ì¤Ä¤Î»°¹à±é»»¤È¤·¤Æ¸½ºß¤Î´Ý¤á¥â¡¼¥É¤Ë¤·¤¿¤¬¤Ã¤Æ´Ý¤á¤é¤ì¤ë +.RB ( fenv (3) +»²¾È)¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.IR x " * " y " + " z +¤Î¡¢°ì¤Ä¤Î»°¹à±é»»¤È¤·¤Æ´Ý¤á¤é¤ì¤¿ÃͤòÊÖ¤¹¡£ + +.I x +¤« +.I y +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I y +¤Î +.I x +Çܤ¬¤Á¤ç¤¦¤É̵¸ÂÂç¤Ç¡¢ +.I z +¤¬¤½¤ì¤È¤ÏÈ¿ÂФÎÉä¹æ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (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. +.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. + +.\" POSIX.1 makes the domain error optional for this case. +.I x +¤È +.I y +¤Î¤¦¤Á°ìÊý¤¬Ìµ¸ÂÂç¤Ç¡¢¤â¤¦°ìÊý¤¬ 0 ¤Ç¡¢ +.I z +¤¬ NaN ¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I y +¤Î +.I x +Çܤ¬ 0 ¤Î̵¸ÂÂçÇÜ (¤â¤·¤¯¤Ï¤½¤ÎµÕ) ¤Ç¤Ï¤Ê¤¯¡¢ +.I z +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢ +Àµ¤·¤¤Éä¹æ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ +ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢Éä¹æÉÕ¤­¤Î 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼: \fIx\fP * \fIy\fP + \fIz\fP ¤« \ +\fIx\fP * \fIy\fP ¤¬Ìµ¸ú¤Ç¡¢\fIz\fP ¤¬ NaN ¤Ç¤Ï¤Ê¤¤ +.\" .I errno +.\" is set to +.\" .BR EDOM . +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.\" .I errno +.\" is set to +.\" .BR ERANGE . +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.\" .I errno +.\" is set to +.\" .BR ERANGE . +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR remainder (3), +.BR remquo (3) diff --git a/release/man3/fmax.3 b/release/man3/fmax.3 new file mode 100644 index 00000000..3ec7eae7 --- /dev/null +++ b/release/man3/fmax.3 @@ -0,0 +1,63 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +fmax, fmaxf, fmaxl \- Æó¤Ä¤ÎÉâÆ°¾®¿ôÅÀ¿ô¤ÎºÇÂçÃͤòµá¤á¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "double fmax(double " x ", double " y ); +.br +.BI "float fmaxf(float " x ", float " y ); +.br +.BI "long double fmaxl(long double " x ", long double " y ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR fmax (), +.BR fmaxf (), +.BR fmaxl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤È +.I y +¤Î¤¦¤ÁÂ礭¤¤Êý¤ÎÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤È +.I y +¤ÎºÇÂçÃͤòÊÖ¤¹¡£ + +°ìÊý¤Î°ú¤­¿ô¤¬ NaN ¤Î¾ì¹ç¡¢¤â¤¦°ìÊý¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¡£ + +ξÊý¤Î°ú¤­¿ô¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR fmin (3) diff --git a/release/man3/fmemopen.3 b/release/man3/fmemopen.3 new file mode 100644 index 00000000..0e21aa18 --- /dev/null +++ b/release/man3/fmemopen.3 @@ -0,0 +1,260 @@ +.\" Copyright 2005 walter harms (walter.harms@informatik.uni-oldenburg.de), +.\" and Copyright 2005 Michael Kerrisk +.\" Distributed under the GPL. +.\" 2008-12-04, Petr Baudis : Document open_wmemstream() +.\" +.\" Japanese Version Copyright (c) 2005, 2006 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2005-12-26, Akihiro MOTOKI +.\" Updated 2006-01-20, Akihiro MOTOKI +.\" Updated 2006-07-20, Akihiro MOTOKI +.\" Updated 2008-11-08, Akihiro MOTOKI, LDP v3.13 +.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24 +.\" +.TH FMEMOPEN 3 2009-09-15 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fmemopen, open_memstream, open_wmemstream \- ¥á¥â¥ê¤ò¥¹¥È¥ê¡¼¥à¤È¤·¤Æ¥ª¡¼¥×¥ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "FILE *fmemopen(void *"buf ", size_t "size ", const char *" mode ");" + +.BI "FILE *open_memstream(char **" ptr ", size_t *" sizeloc ); + +.B #define _GNU_SOURCE +.B #include + +.BI "FILE *open_wmemstream(wchar_t **" ptr ", size_t *" sizeloc ); +.fi +.SH ÀâÌÀ +.BR fmemopen () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤·¡¢¤½¤Î¥¹¥È¥ê¡¼¥à¤Ë +.I mode +¤Ç»ØÄꤵ¤ì¤¿¥¢¥¯¥»¥¹µö²Ä¤òÀßÄꤹ¤ë¡£ +¤½¤Î¥¹¥È¥ê¡¼¥à¤òÄ̤¸¤Æ¡¢ +.I buf +¤Ç»ØÄꤵ¤ì¤¿Ê¸»úÎó¤ä¥á¥â¥ê¥Ð¥Ã¥Õ¥¡¤Ø¤ÎÆɤ߽ñ¤­¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¾¯¤Ê¤¯¤È¤â +.I size +¥Ð¥¤¥È¤ÎŤµ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +°ú¤­¿ô +.I mode +¤Ï +.BR fopen (3) +¤Î¾ì¹ç¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.I mode +¤ÇÄɵ­¥â¡¼¥É (append mode) ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥Õ¥¡¥¤¥ë°ÌÃ֤νé´üÃÍ¤Ï +¥Ð¥Ã¥Õ¥¡Ãæ¤ÎºÇ½é¤Î NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Î°ÌÃÖ¤ËÀßÄꤵ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¥Õ¥¡¥¤¥ë°ÌÃ֤νé´üÃͤϥХåե¡¤ÎÀèƬ¤Ë¤Ê¤ë¡£ +glibc 2.9 °Ê¹ß¤Ç¤Ï¡¢Ê¸»ú 'b' ¤ò +.I mode +¤ÎÆóÈÖÌܤÎʸ»ú¤È¤·¤Æ»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Îʸ»ú¤Ï¡Ö¥Ð¥¤¥Ê¥ê¡×¥â¡¼¥É¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥â¡¼¥É¤Ç¤Ï¡¢½ñ¤­¹þ¤ß»þ¤Ëʸ»úÎó½ªÃ¼¤Î¥Ì¥ë¥Ð¥¤¥È¤¬ÌۤäÆÄɲà +¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£¤Þ¤¿¡¢ +.BR fseek (3) +.B SEEK_END +¤Ï¡¢Ê¸»úÎó¤ÎŤµ¤«¤é¤ÎÁêÂÐÃͤǤϤʤ¯¡¢¥Ð¥Ã¥Õ¥¡¤ÎËöÈø +.RI ( size +¤Ç»ØÄꤷ¤¿ÃÍ) ¤«¤é¤ÎÁêÂÐÃͤȤʤ롣 +.PP +½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ò¥Õ¥é¥Ã¥·¥å +.RB ( fflush (3)) +¤ä¥¯¥í¡¼¥º +.RB ( fclose (3)) +¤·¤¿»þ¤Ë¡¢ +(¥Ð¥Ã¥Õ¥¡¤Ë¶õ¤­¤¬¤¢¤ì¤Ð) NULL ¥Ð¥¤¥È¤¬¥Ð¥Ã¥Õ¥¡¤ÎËöÈø¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +¤³¤Î¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï +¥Ð¥Ã¥Õ¥¡¤Ë 1¥Ð¥¤¥È;͵¤òºî¤ë +.RI ( size +¤Ë¤³¤Î 1¥Ð¥¤¥È¤ò´Þ¤á¤¿Ãͤò»ØÄꤹ¤ë) ɬÍפ¬¤¢¤ë¡£ + +¥Ð¥Ã¥Õ¥¡¤Ë +.I size +¥Ð¥¤¥È¤è¤ê¤¿¤¯¤µ¤ó½ñ¤­¹þ¤â¤¦¤È¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¥¨¥é¡¼¤È¤Ê¤ë¡£ +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤Ê¥¨¥é¡¼¤¬¸«¤¨¤ë¤Î¤Ï +.I stdio +¥Ð¥Ã¥Õ¥¡¤¬¥Õ¥é¥Ã¥·¥å¤µ¤ì¤¿»þ¤À¤±¤Ç¤¢¤ë¡£ +.I setbuf(fp,\ NULL) +¤ò»È¤Ã¤Æ¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ò̵¸ú¤Ë¤¹¤ëÊýË¡¤Ï¡¢ +½ÐÎÏÁàºî¤ò¹Ô¤Ã¤¿»þÅÀ¤Ç¥¨¥é¡¼¤ò¸¡½Ð¤¹¤ë¤Î¤ËÌòΩ¤Ä¡£ +Ê̤ÎÊýË¡¤È¤·¤Æ¤Ï¡¢ +.IR "setbuffer(fp, buf, size)" +¤ò»È¤Ã¤Æ¡¢¸Æ¤Ó½Ð¤·Â¦¤¬ÌÀ¼¨Åª¤Ë +stdio ¥¹¥È¥ê¡¼¥à¥Ð¥Ã¥Õ¥¡¤È¤·¤Æ +.I buf +¤ò»ØÄꤷ¡¢¥Ð¥Ã¥Õ¥¡¤Î»ØÄê»þ¤Ë¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò +stdio ¤Ë¶µ¤¨¤ëÊýË¡¤¬¤¢¤ë¡£) +.\" See http://sourceware.org/bugzilla/show_bug.cgi?id=1995 +.\" and +.\" http://sources.redhat.com/ml/libc-alpha/2006-04/msg00064.html +.PP +Æɤ߽Ф·ÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ç¤Ï¡¢ +¥Ð¥Ã¥Õ¥¡Æâ¤Ë NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤¬¤¢¤Ã¤Æ¤â +Æɤ߽Ф·Áàºî¤¬¥Õ¥¡¥¤¥ëËöÈø (end-of-file) ¤òÊÖ¤¹¤³¤È¤Ï¤Ê¤¤¡£ +¥Ð¥Ã¥Õ¥¡¤«¤é¤ÎÆɤ߽Ф·¤Ç¥Õ¥¡¥¤¥ëËöÈø¤¬ÊÖ¤ë¤Î¤Ï¡¢ +¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤¬¥Ð¥Ã¥Õ¥¡¤ÎÀèƬ¤«¤é +.I size +¥Ð¥¤¥È¤ò±Û¤¨¤ÆÀè¤Ë¿Ê¤â¤¦¤È¤·¤¿¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +.PP +.I buf +¤Ë NULL ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.BR fmemopen () +¤ÏưŪ¤Ë +.I size +¥Ð¥¤¥È¤ÎŤµ¤Î¥Ð¥Ã¥Õ¥¡¤ò³ÎÊݤ¹¤ë¡£ +¤³¤ÎÊýË¡¤Ï¡¢°ì»þ¥Ð¥Ã¥Õ¥¡¤Ë¥Ç¡¼¥¿¤Î½ñ¤­¹þ¤ß¤ò¹Ô¤Ã¤Æ¤«¤é¡¢ +¤½¤ÎÆâÍƤòºÆÅÙÆɤ߽Ф¹¤è¤¦¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÍ­ÍѤǤ¢¤ë¡£ +¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¥¹¥È¥ê¡¼¥à¤¬¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¤­¤Ë¼«Æ°Åª¤Ë²òÊü¤µ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¤«¤é¤Ï¤³¤Î´Ø¿ô¤¬³ä¤êÅö¤Æ¤¿°ì»þ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿Ãͤò +ÃΤëÊýË¡¤Ï¸ºß¤·¤Ê¤¤ÅÀ¤ËÃí°Õ (²¼µ­¤Î +.BR open_memstream () +¤â»²¾È)¡£ + +.BR open_memstream () +´Ø¿ô¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Ø¤Î½ñ¤­¹þ¤ßÍѤ˥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +¥Ð¥Ã¥Õ¥¡¤Ï +.RB ( malloc (3) +¤ò»È¤Ã¤Æ) ưŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¡¢É¬Íפ˱þ¤¸¤Æ¼«Æ°Åª¤Ë¿­Ä¹¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤ò¥¯¥í¡¼¥º¤·¤¿¸å¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï¤³¤Î¥Ð¥Ã¥Õ¥¡¤ò +.BR free (3) +¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +¤³¤Î¥¹¥È¥ê¡¼¥à¤¬ +¥¯¥í¡¼¥º +.RB ( fclose (3)) +¤µ¤ì¤¿¤ê¥Õ¥é¥Ã¥·¥å +.RB ( fflush (3)) +¤µ¤ì¤¿»þ¤Ë¡¢ +.I ptr +¤È +.I sizeloc +¤ÎÃͤϤ½¤ì¤¾¤ì¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤½¤Î¥µ¥¤¥º¤Ë¹¹¿·¤µ¤ì¤ë¡£ +¤³¤ì¤é¤ÎÃͤϡ¢¸Æ¤Ó½Ð¤·¸µ¤¬¤½¤Î¥¹¥È¥ê¡¼¥à¤Ë¿·¤¿¤Ê½ñ¤­¹þ¤ß¤ò +¹Ô¤ï¤Ê¤¤¾ì¹ç¤Ë¸Â¤êÍ­¸ú¤Ç¤¢¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤Ã¤¿ºÝ¤Ë¤Ï¡¢¤³¤ì¤é¤ÎÊÑ¿ô¤ò»²¾È¤¹¤ëÁ°¤Ë +¥¹¥È¥ê¡¼¥à¤òºÆÅÙ¥Õ¥é¥Ã¥·¥å¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +¥Ð¥Ã¥Õ¥¡ËöÈø¤Î NULL ¥Ð¥¤¥È¤ÏÊÝ»ý¤µ¤ì¤ë¡£ +¤³¤Î NULL ¥Ð¥¤¥È¤Ï +.I sizeloc +¤Ë³ÊǼ¤µ¤ì¤ë¥µ¥¤¥º¤Ë¤Ï¡Ö´Þ¤Þ¤ì¤Ê¤¤¡×¡£ + +¥¹¥È¥ê¡¼¥à¤Î¥Õ¥¡¥¤¥ë°ÌÃÖ¤Ï +.BR fseek (3) +¤ä +.BR fseeko (3) +¤ÇÊѹ¹¤Ç¤­¤ë¡£ +¤¹¤Ç¤Ë¥Ç¡¼¥¿¤¬½ñ¤­¹þ¤Þ¤ì¤¿Îΰè¤ÎËöÈø¤è¤êÀè¤Ë¥Õ¥¡¥¤¥ë°ÌÃÖ¤òÆ°¤«¤¹¤È¡¢ +¤½¤Î´Ö¤ÎÎΰè¤Ï 0 ¤ÇËä¤á¤é¤ì¤ë¡£ + +.BR open_wmemstream () +¤Ï +.BR open_memstream () +¤ÈƱÍͤÀ¤¬¡¢¥Ð¥¤¥È¤Ç¤Ï¤Ê¤¯¥ï¥¤¥Éʸ»ú¤ËÂФ·¤ÆÁàºî¤ò¹Ô¤¦ÅÀ¤¬°Û¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤Æ½ªÎ»¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +.BR fmemopen (), +.BR open_memstream (), +.BR open_wmemstream () +¤Ï +.I FILE +¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢ NULL ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR fmemopen () +¤È +.BR open_memstream () +¤Ï glibc 1.0.x ¤Ç¤¹¤Ç¤ËÍøÍѲÄǽ¤Ç¤¢¤Ã¤¿¡£ +.BR open_wmemstream () +¤Ï glibc 2.4 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2008. +¤³¤ì¤é¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äê¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +Linux °Ê³°¤Î¥·¥¹¥Æ¥à¤Ç¹­¤¯ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤¬ÊÖ¤¹¥Õ¥¡¥¤¥ë¥¹¥È¥ê¡¼¥à¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¤Ê¤¤ (¤Ä¤Þ¤ê¡¢ÊÖ¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ +.BR fileno (3) +¤ò¸Æ¤Ó½Ð¤¹¤È¥¨¥é¡¼¤¬Ê֤뤳¤È¤Ë¤Ê¤ë)¡£ +.SH ¥Ð¥° +¥Ð¡¼¥¸¥ç¥ó 2.7 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢ +.BR open_memstream () +¤ÇºîÀ®¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ÎËöÈø¤è¤êÀè¤Ë¥Õ¥¡¥¤¥ë°ÌÃÖ¤òÆ°¤«¤·¤Æ¤â¡¢ +¥Ð¥Ã¥Õ¥¡¤¬¿­Ä¹¤µ¤ì¤º¡¢ +.BR fseek () +¤¬¼ºÇÔ¤· \-1 ¤¬Ê֤롣 +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=1996 +.SH Îã +¤³¤Î¥×¥í¥°¥é¥à¤Ï +.BR fmemopen () +¤ò»È¤Ã¤Æ½ÐÎϥХåե¡¤ò¥ª¡¼¥×¥ó¤·¡¢ +.BR open_memstream () +¤ò»È¤Ã¤ÆưŪ¤Ë¥µ¥¤¥º¤¬ÊѲ½¤¹¤ë½ÐÎϥХåե¡¤ò¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¡£ +(¥×¥í¥°¥é¥à¤ÎÂè°ì¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤«¤é¼è¤Ã¤¿) ÆþÎÏʸ»úÎó¤ò +¥¹¥­¥ã¥ó¤·¤ÆÀ°¿ô¤òÆɤ߹þ¤ß¡¢¤³¤ì¤é¤ÎÀ°¿ô¤ÎÆó¾è¤ò½ÐÎϥХåե¡¤Ë½ñ¤­½Ð¤¹¡£ +¤³¤Î¥×¥í¥°¥é¥à¤Î¼Â¹ÔÎã¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£ +.in +4n +.nf + +.RB "$" " ./a.out \(aq1 23 43\(aq" +size=11; ptr=1 529 1849 +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#define _GNU_SOURCE +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int +main(int argc, char *argv[]) +{ + FILE *out, *in; + int v, s; + size_t size; + char *ptr; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + in = fmemopen(argv[1], strlen(argv[1]), "r"); + if (in == NULL) + handle_error("fmemopen"); + + out = open_memstream(&ptr, &size); + if (out == NULL) + handle_error("fmemopen"); + + for (;;) { + s = fscanf(in, "%d", &v); + if (s <= 0) + break; + + s = fprintf(out, "%d ", v * v); + if (s == \-1) + handle_error("fprintf"); + } + fclose(in); + fclose(out); + printf("size=%ld; ptr=%s\\n", (long) size, ptr); + free(ptr); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR fopen (3), +.BR fopencookie (3), +.BR feature_test_macros (7) diff --git a/release/man3/fmin.3 b/release/man3/fmin.3 new file mode 100644 index 00000000..eaaa91c5 --- /dev/null +++ b/release/man3/fmin.3 @@ -0,0 +1,63 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +fmin, fminf, fminl \- Æó¤Ä¤ÎÉâÆ°¾®¿ôÅÀ¿ô¤ÎºÇ¾®Ãͤòµá¤á¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "double fmin(double " x ", double " y ); +.br +.BI "float fminf(float " x ", float " y ); +.br +.BI "long double fminl(long double " x ", long double " y ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR fmin (), +.BR fminf (), +.BR fminl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤È +.I y +¤Î¤¦¤Á¾®¤µ¤¤Êý¤ÎÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤È +.I y +¤ÎºÇ¾®ÃͤòÊÖ¤¹¡£ + +°ìÊý¤Î°ú¤­¿ô¤¬ NaN ¤Î¾ì¹ç¡¢¤â¤¦°ìÊý¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¡£ + +ξÊý¤Î°ú¤­¿ô¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR fmax (3) diff --git a/release/man3/fmod.3 b/release/man3/fmod.3 new file mode 100644 index 00000000..a0f8f281 --- /dev/null +++ b/release/man3/fmod.3 @@ -0,0 +1,138 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 ¾ê;´Ø¿ô +.\" +.TH FMOD 3 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +fmod, fmodf, fmodl \- ÉâÆ°¾®¿ôÅÀ¾ê;´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double fmod(double " x ", double " y ); +.br +.BI "float fmodf(float " x ", float " y ); +.br +.BI "long double fmodl(long double " x ", long double " y ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR fmodf (), +.BR fmodl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR fmod () +´Ø¿ô¤Ï \fIx\fP ¤ò \fIy\fP ¤Ç³ä¤Ã¤¿ÉâÆ°¾®¿ôÅÀ¾ê;¤ò·×»»¤¹¤ë¡£ +ÊÖ¤êÃÍ¤Ï \fIx\fP \- \fIn\fP * \fIy\fP ¤Ç¤¢¤ë¡£ +¤³¤³¤Ç¡¢\fIn\fP ¤Ï \fIx\fP / \fIy\fP ¤Î¾¦¤ò +¥¼¥í¤Ë¸þ¤«¤¦Êý¸þ¤ÇÀ°¿ôÃͤ˴ݤ᤿¤â¤Î¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï \fIx\fP\ \-\ \fIn\fP*\fIy\fP ¤òÊÖ¤¹¡£ +\fIn\fP ¤Ï¡¢ÊÖ¤êÃͤ¬ +.I x +¤ÈƱ¤¸Éä¹æ¤Ç¡¢¤½¤ÎÀäÂÐÃͤ¬ +.I y +¤ÎÀäÂÐÃͤè¤ê¤â¾®¤µ¤¯¤Ê¤ë¤è¤¦¤ÊÀ°¿ô¤Ç¤¢¤ë¡£ + +.I x +¤« +.I y +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Ìµ¸ÂÂç¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ +NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I y +¤¬ 0 ¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼¤¬È¯À¸¤·¡¢ +NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 (\-0) ¤Ç +.I y +¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼: \fIx\fP ¤¬Ìµ¸ÂÂç +.\" .I errno +.\" is set to +.\" .BR EDOM . +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.IP +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤³¤Î¾ì¹ç¤Ë +.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=6784 +.TP +Îΰ襨¥é¡¼: \fIy\fP ¤¬¥¼¥í +.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 +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR remainder (3) diff --git a/release/man3/fmtmsg.3 b/release/man3/fmtmsg.3 new file mode 100644 index 00000000..b38ad3ac --- /dev/null +++ b/release/man3/fmtmsg.3 @@ -0,0 +1,297 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" adapted glibc info page +.\" +.\" This should run as 'Guru Meditation' (amiga joke :) +.\" The function is quite complex and deserves an example +.\" +.\" Polished, aeb, 2003-11-01 +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Sat Jul 24 20:19:54 JST 2004 +.\" by Yuichi SATO +.\" +.TH FMTMSG 3 2008-06-14 "" "Linux Programmer's Manual" +.SH ̾Á° +fmtmsg \- À°·Á¤µ¤ì¤¿¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fmtmsg(long " classification ", const char *" label , +.br +.BI " int " severity ", const char *" text , +.br +.BI " const char *" action ", const char *" tag ); +.fi +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤Ï¡¢°ú¤­¿ô¤Çµ­½Ò¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤ò¡¢ +.I classification +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿¥Ç¥Ð¥¤¥¹¾å¤Ëɽ¼¨¤¹¤ë¡£ +.I stderr +¤Ë½ñ¤­½Ð¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢ +.B MSGVERB +´Ä¶­ÊÑ¿ô¤Ë°Í¸¤¹¤ë¡£ +.LP +.I label +°ú¤­¿ô¤Ï¥á¥Ã¥»¡¼¥¸¤ÎȯÀ¸¸»¤ò¼±Ê̤¹¤ë¡£ +¤³¤Îʸ»úÎó¤Ï¥³¥í¥ó¤Ç¶èÀÚ¤é¤ì¤¿ 2 ¤Ä¤ÎÉôʬ¤«¤é¹½À®¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +1 ¤ÄÌܤÎÉôʬ¤Ï 10 ʸ»ú°ÊÆâ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +2 ¤ÄÌܤÎÉôʬ¤Ï 14 ʸ»ú°ÊÆâ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.LP +.I text +°ú¤­¿ô¤Ë¤Ï¥¨¥é¡¼¾ò·ï¤òµ­½Ò¤¹¤ë¡£ +.LP +.I action +°ú¤­¿ô¤Ë¤Ï¥¨¥é¡¼¤«¤é²óÉü¤¹¤ë¤¿¤á¤ËÍøÍѲÄǽ¤Ê¥¹¥Æ¥Ã¥×¤òµ­½Ò¤¹¤ë¡£ +¤³¤ì¤¬É½¼¨¤µ¤ì¤ë¾ì¹ç¡¢"TO FIX: " ¤¬Á°¤ËÉÕ¤¯¡£ +.LP +.I tag +°ú¤­¿ô¤Ï¤è¤ê¿¤¯¤Î¾ðÊó¤ò¸«¤Ä¤±¤ë¤¿¤á¤Î¥ª¥ó¥é¥¤¥ó¥É¥­¥å¥á¥ó¥È¤Ø¤Î»²¾È¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï +.I label +Ãͤȥæ¥Ë¡¼¥¯¤Ê¼±ÊÌÈÖ¹æ¤ò´Þ¤ó¤Ç¤¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.SS ¥À¥ß¡¼°ú¤­¿ô +³Æ°ú¤­¿ô¤Ë¤Ï¥À¥ß¡¼¤ÎÃͤòÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥À¥ß¡¼¤Î +.I classification +ÃÍ +.B MM_NULLMC +(0L) ¤Ï½ÐÎϤò²¿¤â»ØÄꤷ¤Ê¤¤¡£¤½¤Î¤¿¤á²¿¤âɽ¼¨¤µ¤ì¤Ê¤¤¡£ +¥À¥ß¡¼¤Î +.I severity +ÃÍ +.B NO_SEV +(0) ¤Ï½ÅÂçÅÙ (severity) ¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤òɽ¤¹¡£ +ÃÍ +.BR MM_NULLLBL , +.BR MM_NULLTXT , +.BR MM_NULLACT , +.B MM_NULLTAG +¤Ï +.I "((char *) 0)" +¤È¶õʸ»úÎó¤ÎÊÌ̾¤Ç¤¢¤ê¡¢ +.B MM_NULLSEV +¤Ï +.B NO_SEV +¤ÎÊÌ̾¤Ç¤¢¤ë¡£ +.SS "classification °ú¤­¿ô" +.I classification +°ú¤­¿ô¤Ï 4 ¼ïÎà¤Î¾ðÊó¤òµ­½Ò¤¹¤ëÃͤÎϤǤ¢¤ë¡£ +.br +.sp +ºÇ½é¤ÎÃͤϽÐÎÏ¥Á¥ã¥ó¥Í¥ë¤òÄêµÁ¤¹¤ë¡£ +.TP 12n +.B MM_PRINT +.I stderr +¤Ë½ÐÎϤ¹¤ë¡£ +.TP +.B MM_CONSOLE +¥·¥¹¥Æ¥à¥³¥ó¥½¡¼¥ë¤Ë½ÐÎϤ¹¤ë¡£ +.TP +.B "MM_PRINT | MM_CONSOLE" +ξÊý¤Ë½ÐÎϤ¹¤ë¡£ +.PP +2 ÈÖÌܤÎÃͤϥ¨¥é¡¼¤ÎȯÀ¸¸»¤Ç¤¢¤ë: +.TP 12n +.B MM_HARD +¥Ï¡¼¥É¥¦¥§¥¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B MM_FIRM +¥Õ¥¡¡¼¥à¥¦¥§¥¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B MM_SOFT +¥½¥Õ¥È¥¦¥§¥¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.PP +3 ÈÖÌܤÎÃͤÏÌäÂê¤Î¸¡ÃΤò¹Ô¤Ã¤¿¤â¤Î¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë: +.TP 12n +.B MM_APPL +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¸¡ÃΤµ¤ì¤¿¡£ +.TP +.B MM_UTIL +¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ë¤è¤Ã¤Æ¸¡ÃΤµ¤ì¤¿¡£ +.TP +.B MM_OPSYS +¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¸¡ÃΤµ¤ì¤¿¡£ +.PP +4 ÈÖÌܤÎÃͤÏÌäÂê¤Î½ÅÂçÅÙ¤òɽ¤¹: +.TP 12n +.B MM_RECOVER +²óÉü²Äǽ¤Ê¥¨¥é¡¼¤Ç¤¢¤ë¡£ +.TP +.B MM_NRECOV +²óÉüÉÔ²Äǽ¤Ê¥¨¥é¡¼¤Ç¤¢¤ë¡£ +.SS "severity °ú¤­¿ô" +.I severity +°ú¤­¿ô¤Ï°Ê²¼¤Î 1 ¤Ä¤ÎÃͤò¤È¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 12n +.B MM_NOSEV +½ÅÂçÅÙ¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¡£ +.TP +.B MM_HALT +¤³¤ÎÃÍ¤Ï HALT ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ +.TP +.B MM_ERROR +¤³¤ÎÃÍ¤Ï ERROR ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ +.TP +.B MM_WARNING +¤³¤ÎÃÍ¤Ï WARNING ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ +.TP +.B MM_INFO +¤³¤ÎÃÍ¤Ï INFO ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ +.PP +¿ôÃͤξì¹ç¤Ï 0 ¤«¤é 4 ¤Ç¤¢¤ë¡£ +.BR addseverity (3) +¤Þ¤¿¤Ï´Ä¶­ÊÑ¿ô +.B SEV_LEVEL +¤ò»È¤¦¤³¤È¤Ë¤è¤ê¡¢É½¼¨¤¹¤ë¥ì¥Ù¥ë¤Èʸ»úÎó¤ò¹¹¤ËÄɲäǤ­¤ë¡£ +.SH ÊÖ¤êÃÍ +´Ø¿ô¤Ï 4 ¤Ä¤ÎÃͤòÊÖ¤¹: +.TP 12n +.B MM_OK +Á´¤Æ¤¬¤¦¤Þ¤¯¤¤¤Ã¤¿¡£ +.TP +.B MM_NOTOK +´°Á´¤Ë¼ºÇÔ¤·¤¿¡£ +.TP +.B MM_NOMSG +.I stderr +¤Ë½ñ¤­¹þ¤à¤È¤­¤Ë¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B MM_NOCON +¥³¥ó¥½¡¼¥ë¤Ë½ñ¤­¹þ¤à¤È¤­¤Ë¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.SH ´Ä¶­ÊÑ¿ô +´Ä¶­ÊÑ¿ô +.B MSGVERB +("message verbosity") ¤Ï +.I stderr +¤Ø¤Î½ÐÎϤΰìÉô¤òÍÞÀ©¤¹¤ë¤Î¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +(¥³¥ó¥½¡¼¥ë¤Ø¤Î½ÐÎϤˤϱƶÁ¤·¤Ê¤¤¡£) +¤³¤ÎÊÑ¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¡¢NULL ¤Ç¤Ê¤¯¡¢ +¥³¥í¥ó¤Ç¶èÀÚ¤é¤ì¤¿Í­¸ú¤Ê¥­¡¼¥ï¡¼¥É¤Î¥ê¥¹¥È¤Ç¤¢¤ë¾ì¹ç¡¢ +¥­¡¼¥ï¡¼¥É¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¤Î°ìÉô¤Î¤ß¤¬É½¼¨¤µ¤ì¤ë¡£ +Í­¸ú¤Ê¥­¡¼¥ï¡¼¥É¤Ï "label", "severity", "text", "action", "tag" ¤Ç¤¢¤ë¡£ +.PP +´Ä¶­ÊÑ¿ô +.B SEV_LEVEL +¤Ï¿·¤·¤¤½ÅÂçÅÙ¥ì¥Ù¥ë¤òƳÆþ¤¹¤ë¤Î¤Ë»ÈÍѤǤ­¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¾åµ­¤Î 5 ¤Ä¤Î½ÅÂçÅÙ¥ì¥Ù¥ë¤Î¤ß¤¬ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +¾¤Î¿ôÃͤξì¹ç¡¢ +.BR fmtmsg () +¤Ï²¿¤âɽ¼¨¤·¤Ê¤¤¡£ +.BR fmtmsg () +¤ò½é¤á¤Æ¸Æ¤Ó½Ð¤¹Á°¤Ë¡¢¥æ¡¼¥¶¤¬ +.B SEV_LEVEL +¤ò +.sp +.RS +SEV_LEVEL=[description[:description[:...]]] +.RE +.sp +¤Î¤è¤¦¤Ê·Á¼°¤Ç¥×¥í¥»¥¹¤Î´Ä¶­¤ËÀßÄꤹ¤ë¤È¡¢ +.BR fmtmsg () +¤Ï (ɸ½à¤Î¥ì¥Ù¥ë 0-4 ¤Ë²Ã¤¨¤Æ) level ¤Ë»ØÄꤵ¤ì¤¿Ãͤâ¼õ¤±ÉÕ¤±¡¢ +¤½¤Î¤è¤¦¤Ê¥ì¥Ù¥ë¤ÎÌäÂ꤬ȯÀ¸¤¹¤ë¤È»ØÄꤵ¤ì¤¿ printstring ¤òɽ¼¨¤¹¤ë¡£ +³Æ description ¤Ï +.sp +.RS +severity-keyword,level,printstring +.RE +.sp +¤È¤¤¤¦·Á¼°¤Ç¤¢¤ë¡£ +.LP +severity-keyword Éô¤Ï +.BR fmtmsg () +¤Ë»ÈÍѤµ¤ì¤Ê¤¤¤¬¡¢Â¸ºß¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +level Éô¤Ï¿ôÃͤòʸ»úÎó¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¿ôÃÍ¤Ï 4 ¤è¤êÂ礭¤¤ÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ÎÃÍ¤Ï +.BR fmtmsg () +¤Î severity °ú¤­¿ô¤Ç»ÈÍѤµ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¤³¤Î½ÅÂçÅÙ¤òÁªÂò¤¹¤ë¡£ +Á°¤â¤Ã¤ÆÀë¸À¤µ¤ì¤¿½ÅÂçÅÙ¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +printstring ¤Ï¡¢ +¤³¤Î½ÅÂçÅ٤Υá¥Ã¥»¡¼¥¸¤¬ +.BR fmtmsg () +¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤¿¾ì¹ç¤Ëɽ¼¨¤µ¤ì¤ëʸ»úÎó¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR fmtmsg () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +´Ø¿ô +.BR fmtmsg () +¤È +.BR addseverity (3) +¤È´Ä¶­ÊÑ¿ô +.B MSGVERB +¤È +.B SEV_LEVEL +¤Ï System V ¤ËͳÍ褷¤Æ¤¤¤ë¡£ +´Ø¿ô +.BR fmtmsg () +¤È´Ä¶­ÊÑ¿ô +.B MSGVERB +¤Ï POSIX.1-2001 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +System V ¤È Unixware ¤Î man ¥Ú¡¼¥¸¤Ë¤Ï¡¢ +¡Ö¤³¤ì¤é¤Î´Ø¿ô¤Ï "pfmt() ¤È addsev()" +¤Þ¤¿¤Ï "pfmt(), vpfmt(), lfmt(), vlfmt()" ¤ÇÃÖ¤­´¹¤¨¤é¤ì¤Æ¤ª¤ê¡¢ +¾­Íè¤Ïºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¢¤ë¡×¤È½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.SH Îã +.nf +#include +#include +#include + +int +main(void) +{ + long class = MM_PRINT | MM_SOFT | MM_OPSYS | MM_RECOVER; + int err; + + err = fmtmsg(class, "util\-linux:mount", MM_ERROR, + "unknown mount option", "See mount(8).", + "util\-linux:mount:017"); + switch (err) { + case MM_OK: + break; + case MM_NOTOK: + printf("Nothing printed\en"); + break; + case MM_NOMSG: + printf("Nothing printed to stderr\en"); + break; + case MM_NOCON: + printf("No console output\en"); + break; + default: + printf("Unknown error from fmtmsg()\en"); + } + exit(EXIT_SUCCESS); +} +.fi +.PP +½ÐÎÏ¤Ï +.nf + + util\-linux:mount: ERROR: unknown mount option + TO FIX: See mount(8). util\-linux:mount:017 + +.fi +¤Î¤è¤¦¤Ë¤Ê¤ê¡¢ +.nf + + MSGVERB=text:action; export MSGVERB + +.fi +¤ò¼Â¹Ô¤·¤¿¸å¤Ç¤Ï +.nf + + unknown mount option + TO FIX: See mount(8). + +.fi +¤È¤Ê¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR addseverity (3), +.BR perror (3) diff --git a/release/man3/fnmatch.3 b/release/man3/fnmatch.3 new file mode 100644 index 00000000..5a7bda7b --- /dev/null +++ b/release/man3/fnmatch.3 @@ -0,0 +1,110 @@ +.\" 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:35:54 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon Oct 16 00:16:29 2000 following Joseph S. Myers +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-03-18, NAKANO Takeo +.\" Modified 1998-12-18, NAKANO Takeo +.\" Updated 2006-03-05, Akihiro MOTOKI, catch up to LDP v2.25 +.\" +.TH FNMATCH 3 2000-10-15 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fnmatch \- ¥Õ¥¡¥¤¥ë̾¤Þ¤¿¤Ï¥Ñ¥¹Ì¾¤Ø¤Î¥Þ¥Ã¥Á¤ò¹Ô¤¦ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fnmatch(const char *" "pattern" ", const char *" string ", int " flags ); +.fi +.SH ÀâÌÀ +.BR fnmatch () +´Ø¿ô¤Ï +.I strings +°ú¤­¿ô¤¬ +.I pattern +°ú¤­¿ô¤Ë¥Þ¥Ã¥Á¤¹¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +.I pattern +¤Ë¤Ï¥·¥§¥ë¤Î¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤òÍ¿¤¨¤ë¡£ +.PP +.I flags +°ú¤­¿ô¤Ë¤è¤êÆ°ºî¤òÊѹ¹¤Ç¤­¤ë¡£ +.I flags +¤Ï°Ê²¼¤Î¥Õ¥é¥°¤Î¥Ó¥Ã¥ÈËè¤Î OR ¤Ç»ØÄꤹ¤ë¡£ +.TP +.B FNM_NOESCAPE +¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å (\\) ¤ò¥¨¥¹¥±¡¼¥×ʸ»ú +¤Ç¤Ï¤Ê¤¯Ä̾ï¤Îʸ»ú¤È¤·¤Æ°·¤¦¡£ +.TP +.B FNM_PATHNAME +¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +.I string +Ãæ¤Î¥¹¥é¥Ã¥·¥å (/) ¤ò +.I pattern +¤Ë¤¢¤ë¥¹¥é¥Ã¥·¥å¤½¤Î¤â¤Î¤Ë¤À¤±¥Þ¥Ã¥Á¤µ¤»¡¢ +¥¢¥¹¥¿¥ê¥¹¥¯ (*) ¤äµ¿ÌäÉä (?) ¤Î¥á¥¿¥­¥ã¥é¥¯¥¿¤ä¡¢ +¥¹¥é¥Ã¥·¥å¤ò´Þ¤à¥Ö¥é¥±¥Ã¥Èɽ¸½ ([]) ¤Ë¤Ï¥Þ¥Ã¥Á¤µ¤»¤Ê¤¤¡£ +.TP +.B FNM_PERIOD +¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +.I string +¤ÎÀèƬ¥Ô¥ê¥ª¥É (leading period) ¤Ï +.I pattern +Ãæ¤Î¥Ô¥ê¥ª¥É¤½¤Î¤â¤Î¤Ë¤·¤«¥Þ¥Ã¥Á¤·¤Ê¤¤¡£ÀèƬ¥Ô¥ê¥ª¥É¤È¤Ï¡¢ +.I string +¤ÎºÇ½é¤Îʸ»ú°ÌÃ֤ˤ¢¤ë¥Ô¥ê¥ª¥É¤Î¤³¤È¤Ç¤¢¤ë¡£¤¿¤À¤· +.B FNM_PATHNAME +¥Õ¥é¥°¤¬Æ±»þ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¥¹¥é¥Ã¥·¥å¤Îľ¸å¤Ë³¤¯¥Ô¥ê¥ª¥É +¤âÀèƬ¥Ô¥ê¥ª¥É¤È¤ß¤Ê¤µ¤ì¤ë¡£ +.TP +.B FNM_FILE_NAME +¤³¤ì¤Ï \fBFNM_PATHNAME\fR ¤ËÂФ¹¤ë GNU ¤Ç¤ÎƱµÁ¸ì¤Ç¤¢¤ë. +.TP +.B FNM_LEADING_DIR +¤³¤Î¥Õ¥é¥°¤Ï GNU ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£¤³¤ì¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¥Ñ¥¿¡¼¥ó¤¬ +.I string +¤ÎºÇ½é¤ÎÉôʬ (¤Ë¥¹¥é¥Ã¥·¥å¤òÉÕ¤±¤¿¤â¤Î) ¤Ë¥Þ¥Ã¥Á¤¹¤ì¤Ð¡¢ +¥Þ¥Ã¥Á¤·¤¿¤â¤Î¤È¤ß¤Ê¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¼ç¤È¤·¤Æ glibc ¤ÇÆâÉôŪ¤Ë»ÈÍѤ·¡¢¤½¤Î¤¿¤á¤Î¤ß¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B FNM_CASEFOLD +¤³¤Î¥Õ¥é¥°¤Ï GNU ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£¤³¤ì¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¥Ñ¥¿¡¼¥ó¤Î¥Þ¥Ã¥Á¤ËÂçʸ»ú¾®Ê¸»ú¤¬¶èÊ̤µ¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.I string +¤¬ +.I pattern +¤Ë¥Þ¥Ã¥Á¤¹¤ì¤Ð 0 ¤òÊÖ¤¹¡£¥Þ¥Ã¥Á¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï +.B FNM_NOMATCH +¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï¤½¤ì°Ê³°¤ÎÈó¥¼¥íÃͤòÊÖ¤¹¡£ +.SH ½àµò +POSIX.2. +.BR FNM_FILE_NAME ", " FNM_LEADING_DIR ", " FNM_CASEFOLD +¥Õ¥é¥°¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sh (1), +.BR glob (3), +.BR scandir (3), +.BR wordexp (3), +.BR glob (7) diff --git a/release/man3/fopen.3 b/release/man3/fopen.3 new file mode 100644 index 00000000..aa4a1584 --- /dev/null +++ b/release/man3/fopen.3 @@ -0,0 +1,326 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fopen.3 6.8 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu +.\" Modified, aeb, 960421, 970806 +.\" Modified, joey, aeb, 2002-01-03 +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated Thu Feb 13 12:10:38 JST 1997 +.\" by YOSHINO Takashi +.\" Updated & Modified Mon Mar 1 1999 +.\" by NAKANO Takeo +.\" Updated 1999-12-08, Kentaro Shirakata +.\" Updated 2001-12-13, Kentaro Shirakata +.\" Updated 2002-03-23, Kentaro Shirakata +.\" Updated 2005-10-15, Kentaro Shirakata +.\" Updated 2006-07-20, Akihiro MOTOKI +.\" +.\"WORD: file descriptor ¥Õ¥¡¥¤¥ëµ­½Ò»Ò +.\"WORD: file position indicator ¥Õ¥¡¥¤¥ë°ÌÃֻؼ¨»Ò +.\"WORD: indicator »Ø¼¨»Ò +.\"WORD: global variable Âç°èÊÑ¿ô +.\"WORD: cancellation points ¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È +.\" +.TH FOPEN 3 2009-02-23 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fopen, fdopen, freopen \- ¥¹¥È¥ê¡¼¥à¤ò³«¤¯´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "FILE *fopen(const char *" path ", const char *" mode ); + +.BI "FILE *fdopen(int " fd ", const char *" mode ); + +.BI "FILE *freopen(const char *" path ", const char *" mode ", FILE *" stream ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR fdopen (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.SH ÀâÌÀ +.BR fopen () +´Ø¿ô¤Ï¡¢ +.I path +¤Ç»ØÄꤵ¤ì¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤ò³«¤­¡¢¥¹¥È¥ê¡¼¥à¤È·ë¤Ó¤Ä¤±¤ë¡£ +.PP +°ú¿ô +.I mode +¤Ï¡¢°Ê²¼¤Ë³¤¯Ê¸»ú¤Î¤Ò¤È¤Ä¤«¤é»Ï¤Þ¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë +(ÄɲäÎʸ»ú¤¬¤³¤Îʸ»ú¤Î¸å¤Ë³¤¯¤³¤È¤â¤¢¤ë): +.TP +.B r +¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤òÆɤ߽Ф¹¤¿¤á¤Ë³«¤¯¡£ +¥¹¥È¥ê¡¼¥à¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë°ÌÃÖ¤µ¤ì¤ë¡£ +.TP +.B r+ +Æɤ߽Ф·¤ª¤è¤Ó½ñ¤­¹þ¤ß¤¹¤ë¤¿¤á¤Ë³«¤¯¡£ +¥¹¥È¥ê¡¼¥à¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë°ÌÃÖ¤µ¤ì¤ë¡£ +.TP +.B w +¥Õ¥¡¥¤¥ë¤ò½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë³«¤¯¡£ +¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ë¤ÏŤµ¥¼¥í¤ËÀÚ¤êµÍ¤á¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¿·¤¿¤ËºîÀ®¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë°ÌÃÖ¤µ¤ì¤ë¡£ +.TP +.B w+ +Æɤ߽Ф·¤ª¤è¤Ó½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë³«¤¯¡£ +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¿·¤¿¤ËºîÀ®¤¹¤ë¡£ +¸ºß¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤ÏŤµ¥¼¥í¤ËÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë°ÌÃÖ¤µ¤ì¤ë¡£ +.TP +.B a +Äɲà (¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë½ñ¤­¹þ¤à) ¤Î¤¿¤á¤Ë³«¤¯¡£ +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¿·¤¿¤ËºîÀ®¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Ï¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë°ÌÃÖ¤µ¤ì¤ë¡£ +.TP +.B a+ +Æɤ߽Ф·¤ª¤è¤ÓÄɲà (¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë½ñ¤­¹þ¤à) ¤Î¤¿¤á¤Ë³«¤¯¡£ +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¿·¤¿¤ËºîÀ®¤¹¤ë¡£ +Æɤ߽Ф·¤Î½é´ü¥Õ¥¡¥¤¥ë°ÌÃ֤ϥե¡¥¤¥ë¤ÎÀèƬ¤Ç¤¢¤ë¤¬¡¢ +½ñ¤­¹þ¤ß¤Ï¾ï¤Ë¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤ËÄɲ䵤ì¤ë¡£ +.PP +.I mode +ʸ»úÎó¤Ë¤Ïʸ»ú \(aqb\(aq ¤òÄɲûØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¡¢ +.I mode +ʸ»úÎó¤ÎºÇ¸å¤Îʸ»ú¤È¤·¤Æ»ØÄꤹ¤ë¡£ +¾åµ­¤Î¤¦¤Á 2 ʸ»ú¤Î¥â¡¼¥É¤Î¾ì¹ç¤Ë¤Ï 2 ¤Ä¤Îʸ»ú¤Î´Ö¤Ë»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤ì¤Ï C89 ¤È¤Î¸ß´¹À­¤Î¤¿¤á¤À¤±¤ËÍÑ°Õ¤µ¤ì¤¿ +¤â¤Î¤Ç¤¢¤ê¡¢´Ø¿ô¤Î¼Â¹Ô¤ËÂФ·¤Æ¤Ï¤¤¤«¤Ê¤ë±Æ¶Á¤â»ý¤¿¤Ê¤¤¡£ +¤¹¤Ê¤ï¤Á¡¢Linux ¤ò´Þ¤àÁ´¤Æ¤Î POSIX ½àµò¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +¤³¤Î \(aqb\(aq ¤Ï̵»ë¤µ¤ì¤ë¡£ +(¤½¤Î¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤È¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë¤òÊÌ¡¹¤Ë°·¤¦¤â¤Î¤â¤¢¤ë¤Î¤Ç¡¢ +¤â¤·¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë¤ÎÆþ½ÐÎϤò¹Ô¤¤¡¢ +¤½¤Î¥×¥í¥°¥é¥à¤¬Èó UNIX ´Ä¶­¤Ø°Ü¿¢¤µ¤ì¤ë¤Èͽ¬¤¹¤ë¤Ê¤é¡¢ +\(aqb\(aq¤òÉÕ¤±¤Æ¤ª¤¯¤Î¤ÏÎɤ¤¹Í¤¨¤Ç¤¢¤ë) +.PP +.I mode +¤Î glibc ¤Ë¤è¤ë³ÈÄ¥¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï²¼µ­¤Î¡ÖÃí°Õ¡×¤ò»²¾È¡£ +.PP +¤¹¤Ù¤Æ¤ÎÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¡¢ +.BR S_IRUSR " | " S_IWUSR " | " S_IRGRP " | " S_IWGRP " | " S_IROTH " | " S_IWOTH +(0666) ¤Î¥â¡¼¥É¤ò +¤½¤Î¥×¥í¥»¥¹¤Î umask Ãͤˤè¤Ã¤Æ½¤Àµ¤·¤¿¥â¡¼¥É¤ò»ý¤Ä +.RB ( umask (2) +¤ò¸«¤è)¡£ +.PP +Æɤ߽Ф·/½ñ¤­¹þ¤ß¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¤ÏǤ°Õ¤Î½ç½ø¤ÇÆɤ߽ñ¤­¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤¿¤À¤· ANSI C ¤Ç¤Ï¡¢ +(ÆþÎÏÁàºî¤¬¥Õ¥¡¥¤¥ë¤ÎËöÈø¤ËÅþ㤷¤¿¾ì¹ç¤ò½ü¤¤¤Æ) +½ÐÎϤÈÆþÎϤδ֤ˤϥե¡¥¤¥ë¤Î°ÌÃÖ·è¤á´Ø¿ô¤ò +¶´¤Þ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ¤µ¤ì¤¿¤¤ +(¤³¤Î¾ò·ï¤òËþ­¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢Æɤ߹þ¤ßÁàºî¤Ï¡¢ +ºÇ¸å¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¤â¤Î¤Ç¤Ê¤¯¡¢°ÊÁ°¤Ë½ñ¤­¹þ¤Þ¤ì¤¿ +ÃͤòÊÖ¤¹¤³¤È¤òµö¤µ¤ì¤Æ¤¤¤ë)¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Î¤è¤¦¤Ê¥¹¥È¥ê¡¼¥à¤Ç¤ÎÆɤ߽ñ¤­Áàºî¤Î´Ö¤Ë¤Ï +.BR fseek (3) +¤Þ¤¿¤Ï +.BR fgetpos (3) +Áàºî¤ò¶´¤ó¤Ç¤ª¤¯¤ÈÎɤ¤¤À¤í¤¦ +(Linux ¤Ç¤ÏËÜÅö¤ËɬÍפȤʤ뤳¤È¤â¤È¤­¤É¤­¤¢¤ë)¡£ +¤³¤ÎÁàºî¤Ï¸«¤«¤±¾å²¿¤â¤·¤Ê¤¤Áàºî (no-op) ¤Ç¤âÎɤ¤ +(Î㤨¤Ð \fIfseek(..., 0L, SEEK_CUR)\fP ¤ò +¤½¤ÎÉû¼¡Åª¸ú²Ì¤Ç¤¢¤ëƱ´ü¤Î¤¿¤á¤À¤±¤Ë¸Æ¤Ù¤ÐÎɤ¤)¡£ +.PP +¥Õ¥¡¥¤¥ë¤òÄɲå⡼¥É +.RI ( mode +¤ÎºÇ½é¤Îʸ»ú¤ò \fBa\fP ¤Ë¤¹¤ë) ¤Ç³«¤¯¤È¡¢ +¤³¤Î¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ë½ñ¤­¹þ¤ßÁàºî¤Ï (Àè¤Ë +.nf + + fseek(stream,0,SEEK_END); + +.fi +¤Î¸Æ¤Ó½Ð¤·¤ò¼Â¹Ô¤·¤¿¤«¤Î¤è¤¦¤Ë) ¥Õ¥¡¥¤¥ëËöÈø¤ËÂФ·¤Æ¹Ô¤ï¤ì¤ë¡£ +.PP +.BR fdopen () +´Ø¿ô¤Ï¡¢´û¸¤Î¥Õ¥¡¥¤¥ëµ­½Ò»Ò +.I fd +¤Ë¥¹¥È¥ê¡¼¥à¤ò·ë¤Ó¤Ä¤±¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Î +.I mode +("r", "r+", "w", "w+", "a", "a+" ¤Î¤¤¤º¤ì¤«) ¤Ï +¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Î¥â¡¼¥É¤È¸ß´¹¤Î¤â¤Î¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¿·¤·¤¤¥¹¥È¥ê¡¼¥à¤Î¥Õ¥¡¥¤¥ë°ÌÃֻؼ¨»Ò¤Ï +.I fd +¤Ë°¤·¤Æ¤¤¤ëÃͤËÀßÄꤵ¤ì¤ë¡£ +error ¤È end-of-file ¤Î³Æ»Ø¼¨»Ò¤Ï¥¯¥ê¥¢¤µ¤ì¤ë¡£ +"w" ¤ª¤è¤Ó "w+" ¥â¡¼¥É¤Ç¤Î¥Õ¥¡¥¤¥ë¤ÎÀÚ¤êµÍ¤á¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤ÎÊ£À½¤Ï¹Ô¤Ê¤ï¤ì¤Ê¤¤¡£ +.BR fdopen () +¤ÇºîÀ®¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤¬ÊĤ¸¤é¤ì¤¿¤È¤­¤Ë¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤â +ÊĤ¸¤é¤ì¤ë¡£ +¶¦Í­¥á¥â¥ê¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ø +.BR fdopen () +¤ò¹Ô¤Ã¤¿¤È¤­¤Î·ë²Ì¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.BR freopen () +´Ø¿ô¤Ï +.I path +¤Ç̾Á°¤¬»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò³«¤­¡¢ +.I stream +¤Ç»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ë¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤ò·ë¤Ó¤Ä¤±¤ë¡£ +¤â¤È¤Î¥¹¥È¥ê¡¼¥à¤Ï (¤â¤·Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï) ÊĤ¸¤é¤ì¤ë¡£ +.I mode +°ú¿ô¤Ï +.BR fopen () +´Ø¿ô¤ÈƱ¤¸·Á¤Ç»È¤ï¤ì¤ë¡£ +.BR freopen () +´Ø¿ô¤Î¼ç¤ÊÍÑÅӤϡ¢É¸½à¥Æ¥­¥¹¥È¥¹¥È¥ê¡¼¥à +.RI ( stderr ", " stdin ", " stdout ) +¤ÈÂбþÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤òÊѹ¹¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR fopen (), +.BR fdopen (), +.BR freopen () +¤ÏÀ®¸ù¤¹¤ë¤È +.I FILE +·¿¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È NULL ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¥¨¥é¡¼¤ò¼¨¤¹Ãͤ˥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.BR fopen (), +.BR fdopen (), +.BR freopen () +¤ÇÍ¿¤¨¤é¤ì¤¿ +.I mode +¤¬ÉÔŬÀڤǤ¢¤ë¡£ +.PP +.BR fopen (), +.BR fdopen (), +.BR freopen () +´Ø¿ô¤Ï +.BR malloc (3) +¥ë¡¼¥Á¥ó¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ç¤â¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ê¡¢ +¤½¤Î»þ¤ÏÂбþ¤¹¤ëÃÍ¤Ë +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.BR fopen () +´Ø¿ô¤Ï +.BR open (2) +¥ë¡¼¥Á¥ó¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ç¤â¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ê¡¢ +¤½¤Î»þ¤ÏÂбþ¤¹¤ëÃÍ¤Ë +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.BR fdopen () +´Ø¿ô¤Ï +.BR fcntl (2) +¥ë¡¼¥Á¥ó¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ç¤â¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ê¡¢ +¤½¤Î»þ¤ÏÂбþ¤¹¤ëÃÍ¤Ë +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +.BR freopen () +´Ø¿ô¤Ï +.BR open (2), +.BR fclose (3), +.BR fflush (3) +³Æ¥ë¡¼¥Á¥ó¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ç¤â¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ê¡¢ +¤½¤Î»þ¤ÏÂбþ¤¹¤ëÃÍ¤Ë +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.SH ½àµò +.BR fopen () +´Ø¿ô¤È +.BR freopen () +´Ø¿ô¤Ï C89¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR fdopen () +´Ø¿ô¤Ï POSIX.1-1990 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.SS glibc ¤Ç¤ÎÃí°Õ +GNU C ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢ +.I mode +¤Ë»ØÄê¤Ç¤­¤ëʸ»úÎó¤È¤·¤Æ¡¢°Ê²¼¤Î³ÈÄ¥¤¬¹Ô¤ï¤ì¤Æ¤¤¤ë: +.TP +.BR c " (glibc 2.3.3 °Ê¹ß)" +open Áàºî¡¢¤½¤ì¤Ë³¤¯ read/write Áàºî¤Î¡¢ +¥¹¥ì¥Ã¥É¤Î¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È (cancellation points) +¤òºîÀ®¤·¤Ê¤¤¡£ +.TP +.BR e " (glibc 2.7 °Ê¹ß)" +.B O_CLOEXEC +¥Õ¥é¥°¤òÍ­¸ú¤Ë¤·¤Æ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +¾ÜºÙ¤Ï +.BR open (2) +¤ò»²¾È¡£ +.TP +.BR m " (glibc 2.3 °Ê¹ß)" +I/O ¥·¥¹¥Æ¥à¥³¡¼¥ë +.RB ( read (2), +.BR write (2)) +¤Ç¤Ï¤Ê¤¯¡¢ +.BR mmap (2) +¤ò»È¤Ã¤Æ¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤¹¤ë¡£ +.\" glibc 2.4 ¤Ç¤Ï +.BR mmap (2) +¤ò»È¤ª¤¦¤È¤¹¤ë¤Î¤Ï¡¢Æɤ߽Ф·ÍѤ˥ª¡¼¥×¥ó¤¹¤ë¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤À¤±¤Ç¤¢¤ë¡£ +.TP +.B x +¥Õ¥¡¥¤¥ë¤òÇÓ¾Ū¤Ë¥ª¡¼¥×¥ó¤¹¤ë +.RB ( open (2) +¤Î +.B O_EXCL +¥Õ¥é¥°¤ÈƱÍÍ)¡£ +¥Õ¥¡¥¤¥ë¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢ +.BR fopen () +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EEXIST +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï +.BR fdopen () +¤Ç¤Ï̵»ë¤µ¤ì¤ë¡£ +.\" FIXME document /,ccs= charset/ +.SH ´ØÏ¢¹àÌÜ +.BR open (2), +.BR fclose (3), +.BR fileno (3), +.BR fmemopen (3), +.BR fopencookie (3) diff --git a/release/man3/fpathconf.3 b/release/man3/fpathconf.3 new file mode 100644 index 00000000..d488d6e2 --- /dev/null +++ b/release/man3/fpathconf.3 @@ -0,0 +1,175 @@ +.\" 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 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 +.\" +.TH FPATHCONF 3 1993-04-04 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fpathconf, pathconf \- ¥Õ¥¡¥¤¥ë¤ÎÀßÄêÃͤò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long fpathconf(int " fd ", int " name ); +.br +.BI "long pathconf(char *" path ", int " name ); +.fi +.SH ÀâÌÀ +.BR fpathconf () +¤Ï¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¡¼ +.I fd +¤ËÂФ·¤ÆÀßÄꤵ¤ì¤Æ¤¤¤ë¥ª¥×¥·¥ç¥ó +.I name +¤ÎÃͤò¼èÆÀ¤¹¤ë¡£ +.PP +.BR pathconf () +¤Ï¥Õ¥¡¥¤¥ë̾ +.I path +¤ËÂФ·¤ÆÀßÄꤵ¤ì¤Æ¤¤¤ë¥ª¥×¥·¥ç¥ó +.I name +¤ÎÃͤò¼èÆÀ¤¹¤ë¡£ +.PP +Âбþ¤¹¤ë¥Þ¥¯¥í¤Î¤¦¤Á +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤ÏºÇ¾®ÃͤǤ¢¤ë¡£¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï¤³¤ì¤é¤Î +ÃͤòÊѹ¹¤·¤Æ¤è¤êÍ­Íø¤ÊÆ°ºî¤ò¹Ô¤ª¤¦¤È¤¹¤ë¤â¤Î¤¬¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ç¤â +.BR fpathconf () +¤Þ¤¿¤Ï +.BR pathconf () +¤Ï¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£¤³¤Î¾ì¹ç¤Ï¤è¤êÂ礭¤ÊÃͤ¬Ê֤뤳¤È¤Ë¤Ê¤í¤¦¡£ +.PP +.I name +¤ò°Ê²¼¤ÎÄê¿ô¤Î¤É¤ì¤«¤Ë¤¹¤ë¤È¡¢Âбþ¤¹¤ëÀßÄꥪ¥×¥·¥ç¥ó¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.B _PC_LINK_MAX +¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯¤ÎºÇÂç¿ô¤òÊÖ¤¹¡£ +.I fd +¤Þ¤¿¤Ï +.I path +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¤Ï¡¢¤³¤ÎÃͤϥǥ£¥ì¥¯¥È¥êÁ´ÂΤËŬÍѤµ¤ì¤ë¡£Âбþ¤¹¤ë +¥Þ¥¯¥í¤Ï +.B _POSIX_LINK_MAX +¤Ç¤¢¤ë¡£ +.TP +.B _PC_MAX_CANON +¥Õ¥©¡¼¥Þ¥Ã¥ÈÉÕ¤­ÆþÎϹԤκÇÂçŤòÊÖ¤¹¡£¤³¤Î¤È¤­ +.I fd +¤Þ¤¿¤Ï +.I path +¤ÏüËö¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Âбþ¤¹¤ë¥Þ¥¯¥í¤Ï +.B _POSIX_MAX_CANON +¤Ç¤¢¤ë¡£ +.TP +.B _PC_MAX_INPUT +ÆþÎϹԤκÇÂçŤòÊÖ¤¹¡£¤³¤Î¤È¤­ +.I fd +¤Þ¤¿¤Ï +.I path +¤ÏüËö¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Âбþ¤¹¤ë¥Þ¥¯¥í¤Ï +.B _POSIX_MAX_INPUT +¤Ç¤¢¤ë¡£ +.TP +.B _PC_NAME_MAX +¥Ç¥£¥ì¥¯¥È¥ê +.I path +¤Þ¤¿¤Ï +.I fd +Æâ¤Ë¡¢¤½¤Î¥×¥í¥»¥¹¤¬ºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¥Õ¥¡¥¤¥ë̾¤ÎºÇÂçŤòÊÖ¤¹¡£ +Âбþ¤¹¤ë¥Þ¥¯¥í¤Ï +.B _POSIX_NAME_MAX +¤Ç¤¢¤ë¡£ +.TP +.B _PC_PATH_MAX +.I path +¤Þ¤¿¤Ï +.I fd +¤¬¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¡¢ÁêÂХѥ¹Ì¾¤ÎºÇÂçŤòÊÖ¤¹¡£ +Âбþ¤¹¤ë¥Þ¥¯¥í¤Ï +.B _POSIX_PATH_MAX +¤Ç¤¢¤ë¡£ +.TP +.B _PC_PIPE_BUF +¥Ñ¥¤¥× (pipe) ¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òÊÖ¤¹¡£¤³¤Î¤È¤­ +.I fd +¤Ï¥Ñ¥¤¥×¤« FIFO ¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +.I path +¤Ï FIFO ¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Âбþ¤¹¤ë¥Þ¥¯¥í¤Ï +.B _POSIX_PIPE_BUF +¤Ç¤¢¤ë¡£ +.TP +.B _PC_CHOWN_RESTRICTED +¤³¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë +.BR chown (2) +¤Î¸Æ¤Ó½Ð¤·¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +.I fd +¤Þ¤¿¤Ï +.I path +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤³¤ÎÀ©¸Â¤Ï¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤¹¤Ù¤Æ +¤Î¥Õ¥¡¥¤¥ë¤ËŬÍѤµ¤ì¤ë¡£ +Âбþ¤¹¤ë¥Þ¥¯¥í¤Ï +.B _POSIX_CHOWN_RESTRICTED +¤Ç¤¢¤ë¡£ +.TP +.B _PC_NO_TRUNC +¥¢¥¯¥»¥¹Ãæ¤Î¥Õ¥¡¥¤¥ë̾¤¬ +.B _POSIX_NAME_MAX +¤è¤ê¤âŤ¯¡¢¥¨¥é¡¼¤È¤Ê¤ë¾ì¹ç¤Ë¤Ï 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +Âбþ¤¹¤ë¥Þ¥¯¥í¤Ï +.B _POSIX_NAME_MAX +¤Ç¤¢¤ë¡£ +.TP +.B _PC_VDISABLE +Æüìʸ»ú (special character) ¤Î½èÍý¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï 0 °Ê³°¤ÎÃͤò +ÊÖ¤¹¡£¤³¤Î¤È¤­ +.I fd +¤Þ¤¿¤Ï +.I path +¤ÏüËö¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +(¸ºß¤·¤Æ¤¤¤ì¤Ð) À©¸ÂÃͤ¬ÊÖ¤µ¤ì¤ë¡£Í׵ᤵ¤ì¤¿¥ê¥½¡¼¥¹¤Ø¤Î¥·¥¹¥Æ¥à¤ÎÀ© +¸Â¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤±¤ì¤Ð \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ë¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¥¨¥é¡¼¤ËÂбþ¤·¤¿ÃͤËÀßÄꤵ¤ì¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.I name +¤Ë +.B _PC_NAME_MAX +¤òÆþ¤ì¤ÆÊÖ¤µ¤ì¤¿Ãͤè¤ê¤âŤ¤¥Õ¥¡¥¤¥ë̾¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤¬¡¢Í¿¤¨¤é¤ì¤¿¥Ç¥£ +¥ì¥¯¥È¥ê¤Ë¸ºß¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +ÊÖ¤êÃͤÏÈó¾ï¤ËÂ礭¤ÊÃͤˤʤ뤳¤È¤â¤¢¤ë¡£¥á¥â¥ê¡¼¤Î³ä¤êÅö¤ÆÍѤÎÃͤˤÏÂç +¤­¤¹¤®¤ÆŬ¤µ¤Ê¤¤¤«¤âÃΤì¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getconf (1), +.BR open (2), +.BR statfs (2), +.BR sysconf (3) diff --git a/release/man3/fpclassify.3 b/release/man3/fpclassify.3 new file mode 100644 index 00000000..90923cc7 --- /dev/null +++ b/release/man3/fpclassify.3 @@ -0,0 +1,125 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL, 2002-07-27 Walter Harms +.\" 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 +.\" +.TH FPCLASSIFY 3 2008-08-07 "" "Linux Programmer's Manual" +.SH ̾Á° +fpclassify, isfinite, isnormal, isnan, isinf \- ÉâÆ°¾®¿ôÅÀ¿ô¤ÎʬÎà¥Þ¥¯¥í +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fpclassify(" x ); +.sp +.BI "int isfinite(" x ); +.sp +.BI "int isnormal(" x ); +.sp +.BI "int isnan(" x ); +.sp +.BI "int isinf(" x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (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 (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; ¤Þ¤¿¤Ï +.I cc\ -std=c99 +.br +.BR isnan (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; ¤Þ¤¿¤Ï +.I cc\ -std=c99 +.br +.BR isinf (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; +¤Þ¤¿¤Ï +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +ÉâÆ°¾®¿ôÅÀ¿ô¤Ï̵¸ÂÂç¤ä NaN ¤Î¤è¤¦¤ÊÆÃÊ̤ÊÃͤò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Þ¥¯¥í +.BI fpclassify( x ) +¤Ç +.I x +¤¬¤É¤Î¤è¤¦¤Ê¼ïÊ̤«¤òÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +¥Þ¥¯¥í¤ÏǤ°Õ¤ÎÉâÆ°¾®¿ôÅÀ¿ôɽ¸½¤ò°ú¤­¿ô¤È¤·¤Æ¤È¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +·ë²Ì¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤Ç¤¢¤ë: +.TP 14 +.B FP_NAN +.I x +¤¬ "Not a Number" ¤Ç¤¢¤ë (¿ôÃͤǤϤʤ¤)¡£ +.TP +.B FP_INFINITE +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Þ¤¿¤ÏÉé¤Î̵¸ÂÂç¤Ç¤¢¤ë¡£ +.TP +.B FP_ZERO +.I x +¤¬ 0 ¤Ç¤¢¤ë¡£ +.TP +.B FP_SUBNORMAL +.I x +¤òÀµµ¬²½·Á¼°¤Çɽ¸½¤¹¤ë¤Ë¤Ï¾®¤µ¤¹¤®¤ë¡£ +.TP +.B FP_NORMAL +¾åµ­¤Î¤É¤ì¤Ë¤âÅö¤Æ¤Ï¤Þ¤é¤Ê¤¤¾ì¹ç¤Ç¤¢¤ê¡¢ +ÃͤÏÄ̾ï¤ÎÉâÆ°¾®¿ôÅÀ¿ô¤Ç¤¢¤ë¤Ï¤º¤À¡£ +.LP +¾¤Î¥Þ¥¯¥í¤Ï¡¢¤¤¤¯¤Ä¤«¤Îɸ½àŪ¤ÊÌ䤤¤ËÂФ·¤Æ¡¢´Êñ¤ÊÅú¤¨¤òÄ󶡤¹¤ë¡£ +.TP 14 +.BI isfinite( x ) +(fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE) +¤Î¾ì¹ç¤Ë 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +.TP +.BI isnormal( x ) +(fpclassify(x) == FP_NORMAL) +¤Î¾ì¹ç¤Ë 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +.TP +.BI isnan( x ) +(fpclassify(x) == FP_NAN) +¤Î¾ì¹ç¤Ë 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +.TP +.BI isinf( x ) +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¤Ï 1 ¤ò¡¢ +Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99, POSIX.1. + +.BR isinf () +¤Ë´Ø¤·¤Æ¡¢É¸½àµ¬³Ê¤ÇÄê¤á¤é¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢ +ÊÖ¤êÃͤ¬ 0 °Ê³°¤Ë¤Ê¤ë¤Î¤Ï°ú¤­¿ô¤¬Ìµ¸ÂÂç¤Î¾ì¹ç¤À¤±¤È¤¤¤¦¤³¤È¤À¤±¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +glibc 2.01 °ÊÁ°¤Ç¤Ï¡¢ +.BR isinf () +¤Ï +.I x +¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ +0 °Ê³°¤ÎÃÍ (¼ÂºÝ¤Ë¤Ï 1) ¤òÊÖ¤¹ +(C99 ¤ÎÍ×µá»ÅÍͤǷè¤Þ¤Ã¤Æ¤¤¤ë¤Î¤Ï +0 °Ê³°¤ÎÃͤòÊÖ¤¹¤È¤¤¤¦¤³¤È¤À¤±¤Ç¤¢¤ë)¡£ +.SH ´ØÏ¢¹àÌÜ +.BR finite (3), +.BR INFINITY (3), +.BR isgreater (3), +.BR signbit (3) diff --git a/release/man3/fpurge.3 b/release/man3/fpurge.3 new file mode 100644 index 00000000..4f886a09 --- /dev/null +++ b/release/man3/fpurge.3 @@ -0,0 +1,83 @@ +.\" 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) 2002 NAKANO Takeo all rights reserved. +.\" Translated Sat 12 Jan 2002 by NAKANO Takeo +.\" +.TH FPURGE 3 2001-12-15 "" "Linux Programmer's Manual" +.SH ̾Á° +fpurge, __fpurge \- ¥¹¥È¥ê¡¼¥à¤ò°ìÁÝ (purge) ¤¹¤ë +.SH ½ñ¼° +.nf +/* unsupported */ +.B #include +.sp +.BI "int fpurge(FILE *" stream ); +.sp +/* supported */ +.B #include +.br +.B #include +.sp +.BI "void __fpurge(FILE *" stream ); +.fi +.SH ÀâÌÀ +.BR fpurge () +´Ø¿ô¤Ï¡¢Í¿¤¨¤é¤ì¤¿¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¤ò¥¯¥ê¥¢¤¹¤ë¡£ +½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ç¤³¤ì¤ò¹Ô¤¦¤È¡¢½ñ¤­½Ð¤µ¤ì¤Æ¤¤¤Ê¤¤½ÐÎϤϼΤƤé¤ì¤ë¡£ +ÆþÎÏ¥¹¥È¥ê¡¼¥à¤Ç¤³¤ì¤ò¹Ô¤¦¤È¡¢ +²¼Áؤˤ¢¤ë¥ª¥Ö¥¸¥§¥¯¥È¤«¤éÆɤ߹þ¤Þ¤ì +.BR getc (3) +¤Ë¤è¤ë¼èÆÀ¤òÂԤäƤ¤¤ëÆþÎϤ¬¡¢¤¹¤Ù¤Æ¼Î¤Æ¤é¤ì¤ë¡£ +¤³¤ì¤Ë¤Ï +.BR ungetc (3) +¤Ë¤è¤Ã¤ÆÌᤵ¤ì¤¿¥Æ¥­¥¹¥È¤â´Þ¤Þ¤ì¤ë¡£ +.BR fflush (3) +¤â»²¾È¤Î¤³¤È¡£ +.LP +.BR __fpurge () +´Ø¿ô¤âÁ´¤¯Æ±¤¸¤³¤È¤ò¹Ô¤¦¤¬¡¢¤¿¤À¤·ÊÖ¤êÃͤòÊÖ¤µ¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È +.BR fpurge () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤ë¤È \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ÊÃͤËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I stream +¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ïɸ½à¤Ç¤Ï¤Ê¤¯¡¢¤è¤Ã¤Æ°Ü¿¢À­¤â¤Ê¤¤¡£ +.BR fpurge () +´Ø¿ô¤Ï 4.4BSD ¤ÇƳÆþ¤µ¤ì¤¿¤¬¡¢Linux ¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +.BR __fpurge () +´Ø¿ô¤Ï Solaris ¤ÇƳÆþ¤µ¤ì¡¢glibc 2.1.95 °Ê¹ß¤Ë¤Ï¸ºß¤·¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +Ä̾ï¤ÏÆþÎϥХåե¡¤ò¼Î¤Æ¤è¤¦¤È¤¹¤ë¤Î¤Ï´Ö°ã¤Ã¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.\" .BR fclean (3), +.BR fflush (3), +.BR setbuf (3), +.BR stdio_ext (3) diff --git a/release/man3/fputwc.3 b/release/man3/fputwc.3 new file mode 100644 index 00000000..80cd9f68 --- /dev/null +++ b/release/man3/fputwc.3 @@ -0,0 +1,84 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Aug 29 15:03:11 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sat Jan 8 JST 2000 by Kentaro Shirakata +.\" Updated Fri Nov 2 JST 2001 by Kentaro Shirakata +.\" +.TH FPUTWC 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fputwc, putwc \- ¥ï¥¤¥Éʸ»ú¤ò FILE ¥¹¥È¥ê¡¼¥à¤Ë½ñ¤­¹þ¤à +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "wint_t fputwc(wchar_t " wc ", FILE *" stream ); +.BI "wint_t putwc(wchar_t " wc ", FILE *" stream ); +.fi +.SH ÀâÌÀ +.BR fputwc () +´Ø¿ô¤Ï¡¢ +.BR fputc (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£¤³¤Î +´Ø¿ô¤Ï¡¢¥ï¥¤¥Éʸ»ú \fIwc\fP ¤ò \fIstream\fP ¤Ë½ñ¤­¹þ¤à¡£ +\fIferror(stream)\fP ¤¬¿¿¤Ë¤Ê¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +¥ï¥¤¥Éʸ»úÊÑ´¹¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï¡¢ +\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤ò¥»¥Ã¥È¤·¡¢ +.B WEOF +¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ï \fIwc\fP ¤òÊÖ¤¹¡£ +.PP +.BR putwc () +´Ø¿ô¤¢¤ë¤¤¤Ï¥Þ¥¯¥í¤Ï¡¢ +.BR fputwc () +¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥Þ¥¯¥í¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç¡¢°ú¤­¿ô¤¬Ê£¿ô²óɾ²Á¤µ +¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£¤³¤Î´Ø¿ô¤ò»È¤¦Íýͳ¤Ï¤â¤Ï¤ä¸ºß¤·¤Ê¤¤¡£ +.PP +¤³¤ì¤é¤Î½èÍý¤òÄä»ß¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR fputwc () +´Ø¿ô¤Ï¡¢¥¨¥é¡¼¤¬µ¯¤­¤Ê¤±¤ì¤Ð \fIwc\fP ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +ÉáÄ̤Τâ¤Î¤Î¾¤Ë¡¢°Ê²¼¤Î¤â¤Î¤¬¤¢¤ë¡£ +.TP +.B EILSEQ +\fIwc\fP ¤«¤é¥¹¥È¥ê¡¼¥à¤ÎÉä¹æ¤Ø¤ÎÊÑ´¹¤Ë¼ºÇÔ¤·¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH Ãí°Õ +.BR fputwc () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.BR fopen (3) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ÄɲþðÊ󤬤ʤ¤¾ì¹ç¤Ë¤Ï¡¢ +.BR fputwc () +¤Ï +¼ÂºÝ¤Ë¤Ï¥ï¥¤¥Éʸ»ú \fIwc\fP ¤ËÂбþ¤¹¤ë¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤ò½ñ¤­¹þ¤à¤È +´üÂÔ¤·¤Æ¤è¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fgetwc (3), +.BR fputws (3), +.BR unlocked_stdio (3) diff --git a/release/man3/fputws.3 b/release/man3/fputws.3 new file mode 100644 index 00000000..7cedc1cb --- /dev/null +++ b/release/man3/fputws.3 @@ -0,0 +1,59 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Aug 29 15:09:40 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Fri Nov 2 JST 2001 by Kentaro Shirakata +.\" +.TH FPUTWS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fputws \- ¥ï¥¤¥Éʸ»ú¤Îʸ»úÎó¤ò FILE ¥¹¥È¥ê¡¼¥à¤Ë½ñ¤­¹þ¤à +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fputws(const wchar_t *" ws ", FILE *" stream ); +.fi +.SH ÀâÌÀ +.BR fputws () +´Ø¿ô¤Ï¡¢ +.BR fputs (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIws\fP ¤«¤é»Ï¤Þ¤ë¥ï¥¤¥Éʸ»úÎó¤ò½ªÃ¼¤Î L'\\0' ¤Þ +¤Ç \fIstream\fP ¤Ë½ñ¤­½Ð¤¹¡£¤¿¤À¤·½ªÃ¼¤Î L\(aq\\0\(aq ¤Ï½ÐÎϤ·¤Ê¤¤¡£ +.PP +¤³¤ì¤é¤Î½èÍý¤òÄä»ß¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR fputws () +¤Ï¡¢Áàºî¤¬À®¸ù¤·¤¿»þ¤Ë¤ÏÉé¤Ç¤Ê¤¤À°¿ôÃͤòÊÖ¤¹¡£¥¨¥é¡¼¤Î»þ +¤Ë¤Ï \-1 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH Ãí°Õ +.BR fputws () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +.BR fopen (3) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ÄɲþðÊ󤬤ʤ¤¾ì¹ç¤Ë¤Ï¡¢ +.BR fputws () +¤¬¼ÂºÝ +¤Ë¤Ï¥ï¥¤¥Éʸ»ú¤Îʸ»úÎó¤Ç¤¢¤ë \fIws\fP ¤ËÂбþ¤¹¤ë¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹ +¤ò½ñ¤­¹þ¤à¤È´üÂÔ¤¹¤ë¤³¤È¤ÏŬÀڤǤ¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fputwc (3), +.BR unlocked_stdio (3) diff --git a/release/man3/fread.3 b/release/man3/fread.3 new file mode 100644 index 00000000..107c2827 --- /dev/null +++ b/release/man3/fread.3 @@ -0,0 +1,115 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fread.3 6.6 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:37:33 1993, faith@cs.unc.edu +.\" Sun Feb 19 21:26:54 1995 by faith, return values +.\" Modified Thu Apr 20 20:43:53 1995 by Jim Van Zandt +.\" Modified Fri May 17 10:21:51 1996 by Martin Schulze +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated Tue Jan 21 21:57:33 JST 1997 +.\" by YOSHINO Takashi +.\" Updated & Modified Mon Mar 1 1999 +.\" by NAKANO Takeo +.\" Updated Sat Nov 3 JST 2001 by Kentaro Shirakata +.\" +.TH FREAD 3 1996-05-17 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fread, fwrite \- ¥Ð¥¤¥Ê¥ê¥¹¥È¥ê¡¼¥à¤ÎÆþ½ÐÎÏ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t fread(void *" ptr ", size_t " size ", size_t " nmemb \ +", FILE *" stream ); +.sp +.BI "size_t fwrite(const void *" ptr ", size_t " size ", size_t " nmemb , +.BI " FILE *" stream ); +.fi +.SH ÀâÌÀ +.BR fread () +´Ø¿ô¤Ï +.I stream +¥Ý¥¤¥ó¥¿¤Ç»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤«¤é +.I nmemb +¸Ä¤Î¥Ç¡¼¥¿¤òÆɤ߹þ¤ß¡¢ +.I ptr +¤ÇÍ¿¤¨¤é¤ì¤¿¾ì½ê¤Ë³ÊǼ¤¹¤ë¡£ +¸Ä¡¹¤Î¥Ç¡¼¥¿¤Ï +.I size +¥Ð¥¤¥È¤ÎŤµ¤ò»ý¤Ä¡£ +.PP +.BR fwrite () +´Ø¿ô¤Ï +.I ptr +¤Ç»ØÄꤵ¤ì¤¿¾ì½ê¤«¤éÆÀ¤¿ +.I nmemb +¸Ä¤Î¥Ç¡¼¥¿¤ò¡¢ +.I stream +¥Ý¥¤¥ó¥¿¤Ç»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ë½ñ¤­¹þ¤à¡£ +¸Ä¡¹¤Î¥Ç¡¼¥¿¤Ï +.I size +¥Ð¥¤¥È¤ÎŤµ¤ò»ý¤Ä¡£ +.PP +¤³¤ì¤é¤Î½èÍý¤òÄä»ß¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR fread () +¤È +.BR fwrite () +¤ÏÆɤ߽ñ¤­¤ËÀ®¸ù¤·¤¿Í×ÁǤθĿô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬À¸¤¸¤¿¾ì¹ç¤ä¡¢end-of-file(¥Õ¥¡¥¤¥ë¤ÎºÇ¸å)¤Ë㤷¤¿¾ì¹ç¡¢ +ÊÖ¤êÃͤϻØÄꤷ¤¿¸Ä¿ô¤è¤ê¤â¾®¤µ¤¤ÃÍ(¤Þ¤¿¤Ï¥¼¥í)¤È¤Ê¤ë¡£ +.PP +.BR fread () +¤Ï end-of-file ¤È¥¨¥é¡¼¤ò¶èÊ̤·¤Ê¤¤¤Î¤Ç¡¢ +¤É¤Á¤é¤¬À¸¤¸¤¿¤«¤òȽÃǤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +¸Æ¤Ó½Ð¤·Â¦¤Ç +.BR feof (3) +¤È +.BR ferror (3) +¤È¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ½àµò +C89, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR read (2), +.BR write (2), +.BR feof (3), +.BR ferror (3), +.BR unlocked_stdio (3) diff --git a/release/man3/frexp.3 b/release/man3/frexp.3 new file mode 100644 index 00000000..3e698349 --- /dev/null +++ b/release/man3/frexp.3 @@ -0,0 +1,130 @@ +.\" 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-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) 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 2008-10-29 "" "Linux Programmer's Manual" +.SH ̾Á° +frexp, frexpf, frexpl \- ÉâÆ°¾®¿ôÅÀ¼Â¿ô¤ò¾®¿ôÀ®Ê¬¤ÈÀ°¿ôÀ®Ê¬¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double frexp(double " x ", int *" exp ); +.br +.BI "float frexpf(float " x ", int *" exp ); +.br +.BI "long double frexpl(long double " x ", int *" exp ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR frexpf (), +.BR frexpl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR frexp () +´Ø¿ô¤ÏÉâÆ°¾®¿ôÅÀ¼Â¿ô \fIx\fP ¤òÀµµ¬²½¾®¿ô¤È»Ø¿ô¤Ëʬ²ò¤·¡¢ +»Ø¿ô¤ò *\fIexp\fP ¤Ë³ÊǼ¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR frexp () +´Ø¿ô¤ÏÀµµ¬²½¾®¿ô¤òÊÖ¤¹¡£ +°ú¿ô \fIx\fP ¤¬¥¼¥í¤Ç¤Ê¤¤¾ì¹ç¡¢¤³¤ÎÀµµ¬²½¾®¿ô¤Ï +\fIx\fP ¤Ë 2 ¤ÎÎß¾è¤ò¾è¤¸¤¿¤â¤Î¤Ç¤¢¤ê¡¢¤½¤ÎÀäÂÐÃÍ¤Ï +¾ï¤Ë 1/2 °Ê¾å 1 ̤Ëþ¡¢¤Ä¤Þ¤ê [0.5,1) ¤È¤Ê¤ë¡£ + +\fIx\fP ¤¬¥¼¥í¤Î¾ì¹ç¡¢Àµµ¬²½¾®¿ô¤Ï¥¼¥í¤Ë¤Ê¤ê +*\fIexp\fP ¤Ë¤Ï¥¼¥í¤¬³ÊǼ¤µ¤ì¤ë¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ +.I *exp +¤ÎÃͤÏÉÔÄê¤Ç¤¢¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Î¾ì¹ç¡¢ +Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤¬ÊÖ¤µ¤ì¤ë¡£ +.I *exp +¤ÎÃͤÏÉÔÄê¤Ç¤¢¤ë¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH Îã +¤³¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤È°Ê²¼¤Î¤è¤¦¤Ê·ë²Ì¤È¤Ê¤ë: +.sp +.nf +.in +4n +.RB "$" " ./a.out 2560" +frexp(2560, &e) = 0.625: 0.625 * 2^12 = 2560 +.RB "$" " ./a.out \-4" +frexp(\-4, &e) = \-0.5: \-0.5 * 2^3 = -4 +.in +.fi +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + double x, r; + int exp; + + x = strtod(argv[1], NULL); + r = frexp(x, &exp); + + printf("frexp(%g, &e) = %g: %g * %d^%d = %g\\n", + x, r, r, FLT_RADIX, exp, x); + exit(EXIT_SUCCESS); +} /* main */ +.fi +.SH ´ØÏ¢¹àÌÜ +.BR ldexp (3), +.BR modf (3) diff --git a/release/man3/fseek.3 b/release/man3/fseek.3 new file mode 100644 index 00000000..2edfc749 --- /dev/null +++ b/release/man3/fseek.3 @@ -0,0 +1,179 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)fseek.3 6.11 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu +.\" +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Mon Apr 27 1998 by NAKANO Takeo +.\" +.\" WORD: file position indicator ¥Õ¥¡¥¤¥ë°ÌÃÖɽ¼¨»Ò +.\" WORD: error indicator ¥¨¥é¡¼É½¼¨»Ò +.\" +.TH FSEEK 3 1993-11-29 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fgetpos, fseek, fsetpos, ftell, rewind \- ¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int fseek(FILE *" stream ", long " offset ", int " whence ); + +.BI "long ftell(FILE *" stream ); + +.BI "void rewind(FILE *" stream ); + +.BI "int fgetpos(FILE *" stream ", fpos_t *" pos ); +.br +.BI "int fsetpos(FILE *" stream ", fpos_t *" pos ); +.SH ÀâÌÀ +.BR fseek () +´Ø¿ô¤Ï +.I stream +¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ë¤ª¤¤¤Æ¡¢¥Õ¥¡¥¤¥ë°ÌÃÖɽ¼¨»Ò +(file position indicator) ¤ò¥»¥Ã¥È¤¹¤ë¡£¿·¤¿¤Ê°ÌÃÖ (¥Ð¥¤¥Èñ°Ì) +¤Ï +.I whence +¤Ç»ØÄꤵ¤ì¤¿°ÌÃÖ¤Ë +.I offset +¥Ð¥¤¥È¤ò²Ã¤¨¤ë¤³¤È¤Ë¤è¤Ã¤ÆÍ¿¤¨¤é¤ì¤ë¡£ +.I whence +¤¬ +.BR SEEK_SET , +.BR SEEK_CUR , +.B SEEK_END +¤Î¤É¤ì¤«¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤½¤ì¤¾¤ì¥Õ¥¡¥¤¥ë¤ÎÀèƬ¡¢¸½ºß¤Î°ÌÃÖɽ¼¨»Ò¡¢ +¥Õ¥¡¥¤¥ë¤ÎËöÈø¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤¬¼è¤é¤ì¤ë¡£ +.BR fseek () +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤È¡¢¥¹¥È¥ê¡¼¥à¤Î end-of-file ɽ¼¨»Ò¤Ï +¥¯¥ê¥¢¤µ¤ì¡¢¤½¤ì¤Þ¤Ç¤Ë +.BR ungetc (3) +´Ø¿ô¤ÇÌᤷ¤¿¥Ç¡¼¥¿¤Ï¤Ê¤«¤Ã¤¿¤³¤È¤Ë¤Ê¤ë¡£ +.PP +.BR ftell () +´Ø¿ô¤Ï +.I stream +¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ë¤ª¤±¤ë¡¢¥Õ¥¡¥¤¥ë°ÌÃÖɽ¼¨»Ò +¤Î¸½»þÅÀ¤Ç¤ÎÃͤòÍ¿¤¨¤ë¡£ +.PP +.BR rewind () +´Ø¿ô¤Ï +.I stream +¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ë¤ª¤¤¤Æ¡¢¥Õ¥¡¥¤¥ë°ÌÃÖɽ¼¨»Ò +¤ò¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë¥»¥Ã¥È¤¹¤ë¡£¤³¤Î´Ø¿ô¤Ï°Ê²¼¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.PP +.RS +(void) fseek(stream, 0L, SEEK_SET) +.RE +.PP +¤¿¤À¤· +.BR rewind () +¤Ç¤Ï¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ë¥¨¥é¡¼É½¼¨»Ò (error indicator) ¤âƱ»þ¤Ë +¥¯¥ê¥¢¤µ¤ì¤ë ( +.BR clearerr (3) +¤ò¸«¤è)¡£ +.PP +.BR fgetpos () +´Ø¿ô¤È +.BR fsetpos () +´Ø¿ô¤Ï¡¢¤½¤ì¤¾¤ì +.BR ftell () +¤È +.BR fseek () +¤Ç +.I whence +¤Ë +.B SEEK_SET +¤ò»ØÄꤷ¤¿¾ì¹ç¤ÈƱÍͤε¡Ç½¤ò¡¢°Û¤Ê¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÇÄ󶡤¹¤ë¡£ +.BR fgetpos () +¤Ï¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Î¸½ºß¤ÎÃͤò +.I pos +¤¬»²¾È¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤ËÊݸ¤·¡¢ +.BR fsetpos () +¤Ï¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ò +.I pos +¤ËÀßÄꤹ¤ë¡£ +Unix °Ê³°¤Î¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¤Ï¡¢ +.I fpos_t +¤¬¹½Â¤ÂΤʤɤÎÊ£»¨¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¡¢¤³¤ì¤é¤Î¥ë¡¼¥Á¥ó¤¬¥Æ¥­¥¹ +¥È¥¹¥È¥ê¡¼¥à¤Ç¥Õ¥¡¥¤¥ë°ÌÃÖ¤òÊѹ¹¤¹¤ëÊýË¡¤Î¤¦¤Á¡¢°Ü¿¢À­¤Î¤¢¤ëÍ£°ì¤Î¤â¤Î +¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤â¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR rewind () +¤ÏÊÖ¤êÃͤò»ý¤¿¤Ê¤¤¡£ +.BR fgetpos (), +.BR fseek (), +.BR fsetpos () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +.BR ftell () +¤Ï¸½ºß¤Î¥ª¥Õ¥»¥Ã¥È¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤ÏÊÖ¤êÃÍ¤Ï \-1 ¤È¤Ê¤ê¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +»ØÄꤷ¤¿ +.I stream +¤¬¥·¡¼¥¯¤Ç¤­¤Ê¤¤¡£ +.TP +.B EINVAL +.BR fseek () +´Ø¿ô¤ËÂФ·¤ÆÍ¿¤¨¤¿ +.I whence +°ú¿ô¤¬ +.BR SEEK_SET , +.BR SEEK_END , +.B SEEK_CUR +°Ê³°¤ÎÃͤǤ¢¤Ã¤¿¡£ +.PP +.BR fgetpos (), +.BR fseek (), +.BR fsetpos (), +.BR ftell () +¤Ï¡¢¤½¤ì¤¾¤ì +.BR fflush (3), +.BR fstat (2), +.BR lseek (2), +.BR malloc (3) +¤Ê¤É¤Î¥ë¡¼¥Á¥ó¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ï +¤½¤ì¤¾¤ìÂбþ¤·¤¿ +.I errno +¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ½àµò +C89, C99. +.SH ´ØÏ¢¹àÌÜ +.BR lseek (2), +.BR fseeko (3) diff --git a/release/man3/fseeko.3 b/release/man3/fseeko.3 new file mode 100644 index 00000000..e4f86b33 --- /dev/null +++ b/release/man3/fseeko.3 @@ -0,0 +1,86 @@ +.\" Copyright 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) 2002 NAKANO Takeo all rights reserved. +.\" Translated 2002-01-06, NAKANO Takeo +.\" Updated 2006-01-18, Akihiro MOTOKI +.\" +.TH FSEEKO 3 2001-11-05 "" "Linux Programmer's Manual" +.SH ̾Á° +fseeko, ftello \- ¥Õ¥¡¥¤¥ë°ÌÃÖ¤òõ¤¹/Êó¹ð¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fseeko(FILE *" stream ", off_t " offset ", int " whence ); +.sp +.BI "off_t ftello(FILE *" stream ); +.BI +.fi +.SH ÀâÌÀ +.BR fseeko () +´Ø¿ô¤ª¤è¤Ó +.BR ftello () +´Ø¿ô¤Ï¡¢ +¤½¤ì¤¾¤ì +.BR fseek (3) +¤ª¤è¤Ó +.BR ftell (3) +¤ÈƱ°ì¤Îµ¡Ç½¤ò»ý¤Ä +.RB ( fseek (3) +¤ò¸«¤è) ¤¬¡¢¤¿¤À¤· +.BR fseeko () +´Ø¿ô¤Î \fIoffset\fP °ú¿ô¤È +.BR ftello () +¤ÎÊÖ¤êÃͤ¬¡¢ +\fIlong\fP ¤Ç¤Ï¤Ê¤¯ \fIoff_t\fP ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.LP +¿¤¯¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï +\fIoff_t\fP ¤â \fIlong\fP ¤â¶¦¤Ë 32 ¥Ó¥Ã¥È¤Î·¿¤Ç¤¢¤ë¤¬¡¢ +.RS +.nf + +#define _FILE_OFFSET_BITS 64 + +.fi +.RE +¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤È \fIoff_t\fP ¤Ï 64 ¥Ó¥Ã¥È·¿¤È¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR fseeko () +¤Ï 0 ¤ò¡¢ +.BR ftello () +¤Ï¸½ºß¤Î¥ª¥Õ¥»¥Ã¥È¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.BR fseek (3) +¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£ +.SH ½àµò +SUSv2, POSIX.1-2001. +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤Ï System V Ū¤Ê¥·¥¹¥Æ¥à¤Ë¤¢¤ë¡£ +libc4, libc5, glibc 2.0 ¤Ë¤Ï¤Ê¤«¤Ã¤¿¤¬¡¢ +glibc 2.1 ¤«¤é»È¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fseek (3) diff --git a/release/man3/ftime.3 b/release/man3/ftime.3 new file mode 100644 index 00000000..e7d4b932 --- /dev/null +++ b/release/man3/ftime.3 @@ -0,0 +1,113 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (u31b3hs@pool.informatik.rwth-aachen.de) +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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. +.\" +.\" 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 +.\" +.TH FTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +ftime \- ÆüÉդȻþ´Ö¤òÊÖ¤¹ +.SH ½ñ¼° +.B "#include " +.sp +.BI "int ftime(struct timeb *" tp ); +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤Ï¸½ºß¤Î»þ¹ï¤ò¡¢µª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) +¤«¤é¤ÎÉÿô¤È¥ß¥êÉÿô¤ÇÊÖ¤¹¡£ +»þ¹ï¤Ï +.I tp +¤ÇÊÖ¤µ¤ì¡¢¤³¤ì¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct timeb { + time_t time; + unsigned short millitm; + short timezone; + short dstflag; +}; +.fi +.in +.LP +¤³¤³¤Ç¡¢\fItime\fP ¤Ïµª¸µ (the Epoch) ¤«¤é¤ÎÉÿô¡¢ +\fImillitm\fP ¤Ï µª¸µ¤«¤é \fItime\fP Éø夫¤é¤Î¥ß¥êÉÿô¤Ç¤¢¤ë¡£ +\fItimezone\fP ¥Õ¥£¡¼¥ë¥É¤Ï¥°¥ê¥Ë¥Ã¥¸¤«¤éÀ¾¼þ¤ê¤Îʬ¤Ç·×¬¤µ¤ì¤ë +¥í¡¼¥«¥ë¥¿¥¤¥à¥¾¡¼¥ó¤Ç¤¢¤ë(Éé¿ô¤Î¾ì¹ç¤Ï¥°¥ê¥Ë¥Ã¥¸¤«¤é¤ÎÅì²ó¤ê¤Îʬ¤ò +¼¨¤¹)¡£ +\fIdstflag\fP ¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤â¤· 0 ¤Ç¤Ê¤±¤ì¤Ð°ìǯ¤Î°ìÉô¤Ç²Æ»þ´Ö¤¬ +¸ºß¤¹¤ë¤³¤È¤ò¼¨¤¹¥Õ¥é¥°¤Ç¤¢¤ë¡£ +.LP +POSIX.1-2001 ¤Ç¤Ï¡¢\fItimezone\fP ¤È \fIdstflag\fP ¤ÎÆâÍƤÏ̤ÄêµÁ¤Ç¤¢¤ë; +¤³¤ì¤ËÍê¤ë¤Î¤ÏÈò¤±¤ë¤³¤È¡£ +\"O .SH "RETURN VALUE" +.SH ÊÖ¤êÃÍ +\"O This function always returns 0. +¤³¤Î´Ø¿ô¤Ï¾ï¤Ë 0 ¤òÊÖ¤¹¡£ +(POSIX.1-2001 »ÅÍ͵ڤӤ¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Î¥É¥­¥å¥á¥ó¥È¤Ç¤Ï¡¢ +¥¨¥é¡¼»þ¤Ë \-1 ¤òÊÖ¤¹¡£) +\"O .SH "CONFORMING TO" +.SH ½àµò +4.2BSD, POSIX.1-2001. +POSIX.1-2008 ¤Ç¤Ï +.BR ftime () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ + +¤³¤Î´Ø¿ô¤Ï¸Å¤¤¤â¤Î¤Ç¤¢¤ë¡£»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +ÉÃñ°Ì¤Î»þ´Ö¤Ç½½Ê¬¤Ê¤é¡¢ +.BR time (2) +¤¬ÍøÍѤǤ­¤ë¡£ +.BR gettimeofday (2) +¤Ç¥Þ¥¤¥¯¥íÉä¬ÆÀ¤é¤ì¤ë¡£ +.BR clock_gettime (2) +¤Ç¥Ê¥ÎÉä¬ÆÀ¤é¤ì¤ë¤¬¡¢¹­¤¯ÍøÍѲÄǽ¤ÊÌõ¤Ç¤Ï¤Ê¤¤¡£ +\"O .SH BUGS +.SH ¥Ð¥° +.LP +\"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 Îò»Ë +.\" .BR ftime () +.\" ´Ø¿ô¤Ï 4.2BSD ¤Ë¸½¤ì¤¿¡£ +\"O .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR gettimeofday (2), +.BR time (2) diff --git a/release/man3/ftok.3 b/release/man3/ftok.3 new file mode 100644 index 00000000..635f4304 --- /dev/null +++ b/release/man3/ftok.3 @@ -0,0 +1,110 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 2001-11-28, by Michael Kerrisk, +.\" Changed data type of proj_id; minor fixes +.\" aeb: further fixes; added notes. +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Tue Apr 28 1998 by NAKANO Takeo +.\" Updated Sun 6 Jan 2002 by NAKANO Takeo +.\" +.TH FTOK 3 2001-11-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ftok \- ¥Ñ¥¹Ì¾¤È¥×¥í¥¸¥§¥¯¥È¼±Ê̻Ҥò System V IPC ¥­¡¼¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.fi +.sp +.BI "key_t ftok(const char *" pathname ", int " proj_id ); +.SH ÀâÌÀ +.BR ftok () +´Ø¿ô¤Ï +.I pathname +¤ÇÍ¿¤¨¤é¤ì¤¿¥Õ¥¡¥¤¥ë (¸ºß¤·¡¢¥¢¥¯¥»¥¹²Äǽ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤) +¤Î¥Õ¥¡¥¤¥ë̾¤Î¼±Ê̾ðÊó (identity) ¤È¡¢ +.I proj_id +(0 ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤) ¤ÎÄã°Ì 8 ¥Ó¥Ã¥È¤È¤òÍѤ¤¤Æ¡¢ +.I key_t +·¿¤Î System V IPC ¥­¡¼¤òÀ¸À®¤¹¤ë¡£ +¤³¤Î¥­¡¼¤Ï +.BR msgget (2), +.BR semget (2), +.BR shmget (2) +¤Ê¤É¤Ç¤ÎÍøÍѤËŬ¤·¤Æ¤¤¤ë¡£ +.LP +Ʊ¤¸¥Õ¥¡¥¤¥ë¤ò¼¨¤¹¤¢¤é¤æ¤ë¥Ñ¥¹Ì¾¤È¡¢Æ±¤¸ +.I proj_id +¤ËÂФ·¤Æ¤Ï¡¢·ë²Ì¤ÎÃͤÏÅù¤·¤¯¤Ê¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬°ã¤Ã¤¿¤ê (¤³¤Î¾ì¹çξ¼Ô¤ÏƱ»þ¤Ë¸ºß¤·¤Æ¤¤¤ë¤Ï¤º)¡¢ +.I proj_id +¤¬°Û¤Ê¤ë¤È¡¢ÊÖ¤êÃͤâ°Û¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤ÏÀ¸À®¤µ¤ì¤¿ +.I key_t +¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +¼ºÇÔ¤¹¤ë¤È \-1 ¤¬ÊÖ¤µ¤ì¡¢¥¨¥é¡¼¤ÎÆâÍƤ¬ +.B errno +¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£¤³¤ÎÆâÍƤϥ·¥¹¥Æ¥à¥³¡¼¥ë +.BR stat (2) +¤Î¤â¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +libc4 ¤È libc5 (¤ª¤è¤Ó SunOS 4.x) ¤Ç¤Ï¡¢ +¥×¥í¥È¥¿¥¤¥×¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.sp +.RS +.BI "key_t ftok(char *" pathname ", char " proj_id ); +.RE +.PP +¸½ºß¤Ç¤Ï +.I proj_id +¤Ï +.I int +¤À¤¬¡¢°ÍÁ³¤È¤·¤Æ 8 ¥Ó¥Ã¥È¤·¤«ÍѤ¤¤é¤ì¤Ê¤¤¡£ +Ä̾ï¤Ï ASCII ¥­¥ã¥é¥¯¥¿¤¬ +.I proj_id +¤ËÍѤ¤¤é¤ì¤ë¡£ +.I proj_id +¤¬ 0 ¤Î¤È¤­¤Î¿¶¤ëÉñ¤¤¤¬Ì¤ÄêµÁ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ï¡¢¤³¤ì¤¬Íýͳ¤Ç¤¢¤ë¡£ +.LP +¤â¤Á¤í¤ó +.I key_t +¤¬Â¾¤È½Å¤Ê¤é¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¤«¤É¤¦¤«¤ÏÊݾڤµ¤ì¤Ê¤¤¡£ +ºÇÁ±¤Î¾ì¹ç¤ÎÁȤ߹ç¤ï¤»¤ò¹Í¤¨¤Æ¤â¡¢ +.I proj_id +¤Î 1 ¥Ð¥¤¥È¡¢i ¥Î¡¼¥ÉÈÖ¹æ¤ÎÄã°Ì 16 ¥Ó¥Ã¥È¡¢¤ª¤è¤Ó +¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤ÎÄã°Ì 8 ¥Ó¥Ã¥È¤Ê¤Î¤Ç¡¢·ë²Ì¤Ï 32 ¥Ó¥Ã¥È¤Ë²á¤®¤Ê¤¤¡£ +Î㤨¤Ð +.I /dev/hda1 +¤È +.I /dev/sda1 +¤½¤ì¤¾¤ì¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¡¢¾×ÆͤÏÍưפ˵¯¤³¤ê¤¦¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR msgget (2), +.BR semget (2), +.BR shmget (2), +.BR stat (2), +.BR svipc (7) diff --git a/release/man3/fts.3 b/release/man3/fts.3 new file mode 100644 index 00000000..627631b1 --- /dev/null +++ b/release/man3/fts.3 @@ -0,0 +1,751 @@ +.\" $NetBSD: fts.3,v 1.13.2.1 1997/11/14 02:09:32 mrg Exp $ +.\" +.\" Copyright (c) 1989, 1991, 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. +.\" 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. +.\" +.\" @(#)fts.3 8.5 (Berkeley) 4/16/94 +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jul 11 19:02:58 JST 2000 +.\" by Yuichi SATO +.\" +.\"WORD: hierarchy ³¬ÁØ +.\"WORD: traverse ¤¿¤É¤ë +.\"WORD: pointer ¥Ý¥¤¥ó¥¿ +.\"WORD: restore Éü¸µ¤¹¤ë +.\"WORD: null-terminated NULL ½ªÃ¼¤µ¤ì¤¿ +.\" +.TH FTS 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +fts, fts_open, fts_read, fts_children, fts_set, fts_close \- \ +¥Õ¥¡¥¤¥ë³¬Áؤò¤¿¤É¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "FTS *fts_open(char * const *" path_argv ", int " options ", " +.BI " int (*" compar ")(const FTSENT **, const FTSENT **));" +.sp +.BI "FTSENT *fts_read(FTS *" ftsp ); +.sp +.BI "FTSENT *fts_children(FTS *" ftsp ", int " options ); +.sp +.BI "int fts_set(FTS *" ftsp ", FTSENT *" f ", int " options ); +.sp +.BI "int fts_close(FTS *" ftsp ); +.fi +.SH ÀâÌÀ +fts ´Ø¿ô·²¤Ï¡¢¥Õ¥¡¥¤¥ë³¬Áؤò¤¿¤É¤ë¤¿¤á¤ËÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +´Êñ¤Ë³µÎ¬¤¹¤ë¤È¼¡¤Î¤è¤¦¤Ë¤Ê¤ë¡£ +.BR fts_open () +´Ø¿ô¤Ï¡¢Â¾¤Î fts ´Ø¿ô·²¤ËÅϤ¹¤¿¤á¤Î¡¢¥Õ¥¡¥¤¥ë³¬ÁؤΡ֥ϥó¥É¥ë¡×¤òÊÖ¤¹¡£ +.BR fts_read () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë³¬ÁØÃæ¤Ë¤¢¤ë 1 ¤Ä¤Î¥Õ¥¡¥¤¥ë¤òµ­½Ò¤¹¤ë¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.BR fts_children () +´Ø¿ô¤Ï¡¢³¬ÁØÃæ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤òµ­½Ò¤¹¤ë¹½Â¤ÂΤΠ+¥ê¥ó¥¯¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +°ìÈ̤˥ǥ£¥ì¥¯¥È¥ê¤Ï¡¢ +preorder (ÀµÊý¸þ¡§²¼¤Î³¬ÁؤΥǥ£¥ì¥¯¥È¥ê¤ò¤¿¤É¤ëÁ°) ¤È +postorder (µÕÊý¸þ¡§²¼¤Î³¬ÁؤΥǥ£¥ì¥¯¥È¥ê¤ò¤¹¤Ù¤Æ¤¿¤É¤Ã¤¿¸å) ¤È¤¤¤¦¡¢ +°Û¤Ê¤ëÊý¸þ¤Ç 2 ²ó¤¿¤É¤é¤ì¤ë¡£¥Õ¥¡¥¤¥ë¤Ï 1 ²ó¤¿¤É¤é¤ì¤ë¡£ +¥Ç¥£¥ì¥¯¥È¥ê³¬Áؤò¡ÖÏÀÍýŪ¤Ë¡×(¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥°¤ò̵»ë¤·¤Æ) °ÜÆ°¤¹¤ë¤³¤È¤â¡¢ +ʪÍýŪ¤Ë (¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò¤¿¤É¤Ã¤Æ) °ÜÆ°¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¢¤ë¡£ +¤Þ¤¿¡¢³¬ÁØÃæ¤Î°ÜÆ°¤ÎÆ»¶Ú¤ò»Ø¼¨¤¹¤ë¤³¤È¡¦ +;ʬ¤Ê¤â¤Î¤ò¼è¤ê½ü¤¯¤³¤È¡¦³¬ÁؤΰìÉô¤òºÆ¤Ó¤¿¤É¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¡£ +.PP +2 ¤Ä¤Î¹½Â¤ÂΤ¬¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë (¤µ¤é¤Ë typedef ¤µ¤ì¤Æ¤¤¤ë)¡£ +1 ¤ÄÌܤϡ¢¥Õ¥¡¥¤¥ë³¬Áؤ½¤Î¤â¤Î¤òɽ¸½¤¹¤ë +.I FTS +¹½Â¤ÂΤǤ¢¤ë¡£ +2 ¤ÄÌܤϡ¢¥Õ¥¡¥¤¥ë³¬ÁØÃæ¤Î¥Õ¥¡¥¤¥ë¤òɽ¸½¤¹¤ë +.I FTSENT +¹½Â¤ÂΤǤ¢¤ë¡£ +.I FTSENT +¹½Â¤ÂΤÏÄ̾¥Õ¥¡¥¤¥ë³¬ÁØÃæ¤Î¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤ÆÊÖ¤µ¤ì¤ë¡£ +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ï¡¢¡Ö¥Õ¥¡¥¤¥ë¡×¤È +.RI ¡Ö FTSENT +¹½Â¤ÂΡפò°ìÈ̤ËÆɤßÊѤ¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.I FTSENT +¹½Â¤ÂΤϡ¢¾¯¤Ê¤¯¤È¤â¼¡¤Î¤è¤¦¤Ê¥Õ¥£¡¼¥ë¥É¤ò»ý¤Ã¤Æ¤ª¤ê¡¢ +°Ê²¼¤Ç¤è¤ê¾Ü¤·¤¯ÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +.in +4n +.nf + +typedef struct _ftsent { + unsigned short fts_info; /* FTSENT ¹½Â¤ÂΤΤ¿¤á¤Î¥Õ¥é¥° */ + char *fts_accpath; /* ¥¢¥¯¥»¥¹¥Ñ¥¹ */ + char *fts_path; /* ¥ë¡¼¥È¥Ñ¥¹ */ + short fts_pathlen; /* fts_path ¤ÎŤµ */ + char *fts_name; /* ¥Õ¥¡¥¤¥ë̾ */ + short fts_namelen; /* fts_name ¤ÎŤµ */ + short fts_level; /* ¿¼¤µ (\-1 ¡Á N) */ + int fts_errno; /* ¥Õ¥¡¥¤¥ë¤Î¥¨¥é¡¼ÈÖ¹æ */ + long fts_number; /* ¥í¡¼¥«¥ë¤ÊÈÖ¹æ */ + void *fts_pointer; /* ¥í¡¼¥«¥ë¤Ê¥¢¥É¥ì¥¹ÈÖ¹æ */ + struct ftsent *fts_parent; /* ¿Æ¥Ç¥£¥ì¥¯¥È¥ê */ + struct ftsent *fts_link; /* ¼¡¤Î¥Õ¥¡¥¤¥ë¹½Â¤ÂÎ */ + struct ftsent *fts_cycle; /* ½Û´Ä¤·¤Æ¤¤¤ë¹½Â¤ÂÎ */ + struct stat *fts_statp; /* stat(2) ¤Î¾ðÊó */ +} FTSENT; +.fi +.in +.PP +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" .Bl -tag -width "fts_namelen" +.TP 12 +.IR fts_info +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢ÊÖ¤µ¤ì¤¿ +.I FTSENT +¹½Â¤ÂΤȥե¡¥¤¥ë¤òÀâÌÀ¤¹¤ë°Ê²¼¤Î¥Õ¥é¥°¤Î¤¤¤º¤ì¤«¤òɽ¤·¤Æ¤¤¤ë¡£ +¥¨¥é¡¼¤Î¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê +.RB ( FTS_D ), +¤Î¾ì¹ç¤ÏÎã³°¤È¤·¤Æ¡¢¤½¤ì°Ê³°¤Î¤¹¤Ù¤Æ¤Î¥¨¥ó¥È¥ê¤Ï½ªÃ¼¤Ç¤¢¤ë¡£ +¤Ä¤Þ¤ê¡¢¥¨¥ó¥È¥ê¤ÏºÆ¤Ó¤¿¤É¤é¤ì¤ë¤³¤È¤â¤Ê¤¯¡¢ +¤½¤ì¤è¤ê²¼¤Î³¬Áؤ¬¤¿¤É¤é¤ì¤ë¤³¤È¤â¤Ê¤¤¡£ +.\" .Bl -tag -width FTS_DEFAULT +.RS 12 +.TP 12 +.BR FTS_D +preorder ¤Ç¤¿¤É¤é¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¡£ +.TP +.BR FTS_DC +¥Ä¥ê¡¼¤ÎÃæ¤Ç½Û´Ä¤·¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¡£ +.RI ( FTSENT +¹½Â¤ÂΤΠ+.I fts_cycle +¥Õ¥£¡¼¥ë¥É¤âƱÍͤËËä¤á¤é¤ì¤ë¡£) +.TP +.BR FTS_DEFAULT +¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤òɽ¸½¤¹¤ë +.I FTSENT +¹½Â¤ÂΤ¬¡¢ +.I fts_info +¤Î¾¤Î¤¤¤º¤ì¤«¤ÎÃͤÇÌÀ¼¨Åª¤ËÀâÌÀ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.BR FTS_DNR +Æɤ߹þ¤ß¤¬¤Ç¤­¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¡£ +¤³¤ì¤Ï¥¨¥é¡¼¤Î¾ì¹ç¤ÎÊÖ¤êÃͤǤ¢¤ê¡¢ +²¿¤¬¥¨¥é¡¼¤òµ¯¤³¤·¤¿¤«¤ò¼¨¤¹¤¿¤á¤Ë +.I fts_errno +¥Õ¥£¡¼¥ë¥É¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +.BR FTS_DOT +.BR fts_open () +¤Ø¤Î¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿ +"." ¤Þ¤¿¤Ï ".." +¤È¤¤¤¦Ì¾Á°¤Î¥Õ¥¡¥¤¥ë +.RB ( FTS_SEEDOT +¤ò»²¾È¤¹¤ë¤³¤È)¡£ +.TP +.BR FTS_DP +postorder ¤Ç¤¿¤É¤é¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¡£ +.I FTSENT +¹½Â¤ÂΤÎÆâÍƤϡ¢preorder ¤Î¤È¤­¤ËÊÖ¤µ¤ì¤¿¾õÂÖ +(¤Ä¤Þ¤ê¡¢ +.I fts_info +¥Õ¥£¡¼¥ë¥É¤¬ +.B FTS_D +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾õÂÖ) ¤«¤éÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.TP +.B FTS_ERR +¤³¤ì¤Ï¥¨¥é¡¼¤Î¾ì¹ç¤ÎÊÖ¤êÃͤǤ¢¤ê¡¢ +.I fts_errno +¥Õ¥£¡¼¥ë¥É¤Ï¡¢²¿¤¬¥¨¥é¡¼¤òµ¯¤³¤·¤¿¤«¤ò¼¨¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£ +.TP +.B FTS_F +Ä̾ï¤Î¥Õ¥¡¥¤¥ë¡£ +.TP +.B FTS_NS +.BR stat (2) +¾ðÊó¤¬ÆÀ¤é¤ì¤Ê¤«¤Ã¤¿¥Õ¥¡¥¤¥ë¡£ +.I fts_statp +¥Õ¥£¡¼¥ë¥É¤ÎÆâÍƤÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ +¤³¤ì¤Ï¥¨¥é¡¼¤Î¾ì¹ç¤ÎÊÖ¤êÃͤǤ¢¤ê¡¢ +.I fts_errno +¥Õ¥£¡¼¥ë¥É¤Ï¡¢²¿¤¬¥¨¥é¡¼¤òµ¯¤³¤·¤¿¤«¤ò¼¨¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£ +.TP +.B FTS_NSOK +.BR stat (2) +¾ðÊó¤¬Í׵ᤵ¤ì¤Ê¤«¤Ã¤¿¥Õ¥¡¥¤¥ë¡£ +.I fts_statp +¥Õ¥£¡¼¥ë¥É¤ÎÆâÍƤÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ +.TP +.B FTS_SL +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¡£ +.TP +.B FTS_SLNONE +¥ê¥ó¥¯Àè¤Î¸ºß¤·¤Ê¤¤¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¡£ +.I fts_statp +¥Õ¥£¡¼¥ë¥É¤ÎÆâÍƤϡ¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤½¤Î¤â¤Î¤Î¥Õ¥¡¥¤¥ëÆÃÀ­¾ðÊó¤ò»²¾È¤¹¤ë¡£ +.\" .El +.RE +.TP +.IR fts_accpath +¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î¥Ñ¥¹¡£ +.TP +.IR fts_path +³¬Áؤò¤¿¤É¤ë¤È¤­¤Î¥ë¡¼¥È¤«¤é¤ß¤¿¥Õ¥¡¥¤¥ë¤ÎÁêÂÐŪ¤Ê¥Ñ¥¹¡£ +¤³¤Î¥Ñ¥¹¤Ë¤Ï¡¢ +.BR fts_open () +¤Ë»ØÄꤷ¤¿¥Ñ¥¹¤¬¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤È¤·¤Æ´Þ¤Þ¤ì¤ë¡£ +.TP +.IR fts_pathlen +.I fts_path +¤Ç»²¾È¤µ¤ì¤ëʸ»úÎó¤ÎŤµ¡£ +.TP +.IR fts_name +¥Õ¥¡¥¤¥ë¤Î̾Á°¡£ +.TP +.IR fts_namelen +.I fts_name +¤Ç»²¾È¤µ¤ì¤ëʸ»úÎó¤ÎŤµ¡£ +.TP +.IR fts_level +³¬Áؤò¤¿¤É¤Ã¤Æ¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤¬¤ß¤Ä¤«¤Ã¤¿¿¼¤µ¡£ +\-1 ¡Á N ¤Î¿ôÃͤÇɽ¤µ¤ì¤ë¡£ +³¬Áؤò¤¿¤É¤ë¤È¤­¤Î½ÐȯÅÀ (¥ë¡¼¥È) ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤òɽ¤¹ +.I FTSENT +¹½Â¤ÂÎ¤Ç¤Ï \-1 ¤È¤Ê¤ë¡£ +¤Þ¤¿¡¢¥ë¡¼¥È¼«¿È¤Î +.I FTSENT +¹½Â¤ÂÎ¤Ç¤Ï 0 ¤Ë¤Ê¤ë¡£ +.TP +.IR fts_errno +´Ø¿ô +.BR fts_children () +¤È +.BR fts_read () +¤«¤éÊÖ¤µ¤ì¤ë +.I FTSENT +¹½Â¤ÂΤΠ+.I fts_info +¥Õ¥£¡¼¥ë¥É¤¬ +.BR FTS_DNR , +.BR FTS_ERR , +.B FTS_NS +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.I fts_errno +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥¨¥é¡¼¤Î¸¶°ø¤ò¼¨¤¹³°ÉôÊÑ¿ô +.I errno +¤ÎÃͤ¬Æþ¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.I fts_errno +¥Õ¥£¡¼¥ë¥É¤ÎÆâÍƤÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ +.TP +.IR fts_number +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é»ÈÍѤ¹¤ë¤¿¤á¤ËÄ󶡤µ¤ì¡¢ +fts ´Ø¿ô·²¤Ç¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï 0 ¤Ç½é´ü²½¤µ¤ì¤ë¡£ +.TP +.IR fts_pointer +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é»ÈÍѤ¹¤ë¤¿¤á¤ËÄ󶡤µ¤ì¡¢ +fts ´Ø¿ô·²¤Ç¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï +.B NULL +¤Ç½é´ü²½¤µ¤ì¤ë¡£ +.TP +.IR fts_parent +¸½ºß¤Î¥Õ¥¡¥¤¥ë¤Î¤¹¤°¾å¤Î³¬Áؤˤ¢¤ë¥Õ¥¡¥¤¥ë +(¤Ä¤Þ¤ê¡¢¸½ºß¤Î¥Õ¥¡¥¤¥ë¤¬¥á¥ó¥Ð¡¼¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê) ¤ò»²¾È¤¹¤ë +.I FTSENT +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡£ +ºÇ½é¤Î½ÐȯÅÀ¤ËÂФ·¤Æ¤â¡¢¿Æ¤È¤Ê¤ë¹½Â¤ÂΤÏÍ¿¤¨¤é¤ì¤ë¡£ +¤·¤«¤·¡¢ +.IR fts_level , +.IR fts_number , +.I fts_pointer +¥Õ¥£¡¼¥ë¥É¤Î¤ß¤Î½é´ü²½¤·¤«Êݾڤµ¤ì¤Ê¤¤¡£ +.TP +.IR fts_link +.BR fts_children () +¤«¤éÊÖ¤µ¤ì¤ë¾ì¹ç¡¢ +.I fts_link +¥Õ¥£¡¼¥ë¥É¤Ï¥Ç¥£¥ì¥¯¥È¥ê¥á¥ó¥Ð¡¼¤Î NUL ½ªÃ¼¤µ¤ì¤¿¥ê¥ó¥¯¥ê¥¹¥È¤Î·Á¼°¤Ç¡¢ +¼¡¤Î¹½Â¤ÂΤò»Ø¤·¼¨¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.I fts_link +¥Õ¥£¡¼¥ë¥É¤ÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ +.TP +.IR fts_cycle +2 ¤Ä¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥Ï¡¼¥É¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤ë¤¿¤á¡¢ +¤Þ¤¿¤Ï¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò»Ø¤·¤Æ¤¤¤ë¤¿¤á¤Ë¡¢ +¥Ç¥£¥ì¥¯¥È¥ê¤¬½Û´Ä¤¹¤ë³¬Áع½Â¤¤òºî¤Ã¤Æ¤¤¤ë¾ì¹ç +.RB ( FTS_DC +¤ò»²¾È)¡¢ +¹½Â¤ÂΤΠ+.I fts_cycle +¥Õ¥£¡¼¥ë¥É¤Ï¡¢³¬ÁØÃæ¤Ç¸½ºß¤Î +.I FTSENT +¹½Â¤ÂΤÈƱ¤¸¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë +.I FTSENT +¹½Â¤ÂΤò»Ø¤·¼¨¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.I fts_cycle +¥Õ¥£¡¼¥ë¥É¤ÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ +.TP +.IR fts_statp +¤³¤Î¥Õ¥¡¥¤¥ë¤Î +.BR stat (2) +¾ðÊó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.\" .El +.PP +¥Õ¥¡¥¤¥ë³¬ÁØÃæ¤Î¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¤ËÂФ·¤Æ¡¢ +¤¿¤À 1 ¤Ä¤Î¥Ð¥Ã¥Õ¥¡¡¼¤¬»È¤ï¤ì¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢ +.I fts_path +¤È +.I fts_accpath +¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +.BR fts_read () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤¿ºÇ¤â¿·¤·¤¤¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¡Ö¤Î¤ß¡× +NULL ½ªÃ¼¤µ¤ì¤ë¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤ò¡¢Â¾¤Î +.I FTSENT +¹½Â¤ÂΤÇɽ¸½¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¤¿¤á¤Ë»È¤¦¤Ë¤Ï¡¢ +.I FTSENT +¹½Â¤ÂΤΠ+.I fts_pathlen +¥Õ¥£¡¼¥ë¥É¤Ë¤¢¤ë¾ðÊó¤ò»È¤Ã¤Æ¥Ñ¥¹¤Î¥Ð¥Ã¥Õ¥¡¡¼¤ò½¤Àµ¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤ì¤é¤Î½¤Àµ¤Ï¡¢¤µ¤é¤Ë +.BR fts_read () +¤ò¸Æ¤Ó½Ð¤½¤¦¤È¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢¸µ¤ËÌᤷ¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I fts_name +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¾ï¤Ë +.B NUL +½ªÃ¼¤µ¤ì¤ë¡£ +.SS fts_open() +.BR fts_open () +´Ø¿ô¤Ï¡¢Ê¸»úÎó¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò°ú¤­¿ô¤Ë¼è¤ë¡£ +¤³¤Îʸ»úÎó¥Ý¥¤¥ó¥¿¤Ï¡¢ÏÀÍý¥Õ¥¡¥¤¥ë³¬Áؤò¤Ä¤¯¤ë 1 ¤Ä°Ê¾å¤Î¥Ñ¥¹¤Î̾Á°¤Ë¤Ê¤ë¡£ +ÇÛÎó¤Ï¡¢ +.B NULL +¥Ý¥¤¥ó¥¿¤Ç½ªÃ¼¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +¿¤¯¤Î¥ª¥×¥·¥ç¥ó¤¬¤¢¤ê¡¢¾¯¤Ê¤¯¤È¤â 1 ¤Ä +.RB ( FTS_LOGICAL +¤Þ¤¿¤Ï +.BR FTS_PHYSICAL ) +¤¬»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¼¡¤Î¥ª¥×¥·¥ç¥ó¤¬ +.I or +¤ò¤È¤Ã¤ÆÁªÂò¤µ¤ì¤ë¡£ +.\" .Bl -tag -width "FTS_PHYSICAL" +.TP +.B FTS_COMFOLLOW +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.B FTS_LOGICAL +¤Î»ØÄê¤Ë¤«¤«¤ï¤é¤º¡¢ +¥ë¡¼¥È¥Ñ¥¹¤Ë»ØÄꤵ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò¤¹¤°¤Ë¤¿¤É¤é¤»¤ë¡£ +.TP +.B FTS_LOGICAL +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +fts ¥ë¡¼¥Á¥ó¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤½¤Î¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬»Ø¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Î +.I FTSENT +¹½Â¤ÂΤòÊÖ¤µ¤»¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +.I FTSENT +¹½Â¤ÂΤ¬¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÊÖ¤µ¤ì¤ë¤è¤¦¤Ê +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¤ß¤¬¡¢Â¸ºß¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.B FTS_LOGICAL +¤Þ¤¿¤Ï +.B FTS_PHYSICAL +¤Î¤É¤Á¤é¤«¤ò¡¢ +.BR fts_open () +´Ø¿ô¤ËÍ¿¤¨¤Ê¤±¤ì¤Ð¡Ö¤Ê¤é¤Ê¤¤¡×¡£ +.TP +.B FTS_NOCHDIR +¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ÎºÇŬ²½¤Î¤¿¤á¡¢ +fts ´Ø¿ô·²¤Ï¥Õ¥¡¥¤¥ë³¬Áؤò¤¿¤É¤ë¤È¤­¥Ç¥£¥ì¥¯¥È¥ê¤òÊѤ¨¤ë¡£ +¤³¤ì¤Ë¤Ï¡¢³¬Áؤò¤¿¤É¤Ã¤Æ¤¤¤ë´Ö¤Ï +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¤¢¤ëÆÃÄê¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¤¤ë¤È¤¤¤¦¤³¤È¤Ë +°Í¸¤Ç¤­¤Ê¤¤¡¢¤È¤¤¤¦ÉûºîÍѤ¬¤¢¤ë¡£ +.B FTS_NOCHDIR +¥ª¥×¥·¥ç¥ó¤ÇºÇŬ²½¤ò̵¸ú¤Ë¤¹¤ë¤È¡¢ +fts ´Ø¿ô·²¤Ï¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤·¤Ê¤¤¡£ +.B FTS_NOCHDIR +¤¬»ØÄꤵ¤ì¡¢¤«¤Ä +.BR fts_open () +¤Î°ú¤­¿ô¤È¤·¤ÆÀäÂХѥ¹Ì¾¤¬Í¿¤¨¤é¤ì¤¿¤È¤­°Ê³°¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢ +¼«¤é¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤·¤¿¤ê¡¢ +¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤·¤¿¤ê¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡¢¤È¤¤¤¦ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.TP +.B FTS_NOSTAT +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ÊÖ¤µ¤ì¤¿ +.I FTSENT +¹½Â¤ÂΤϡ¢¤¿¤É¤é¤ì¤¿³Æ¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤Î¥Õ¥¡¥¤¥ëÆÃħ¾ðÊó +.I ( statp +¥Õ¥£¡¼¥ë¥É) ¤ò»²¾È¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +fts ´Ø¿ô·²¤¬ +.I fts_info +¥Õ¥£¡¼¥ë¥É¤ò +.B FTS_NSOK +¤ËÀßÄꤷ +.I statp +¤ÎÆâÍƤòÄêµÁ¤µ¤ì¤Ê¤¤¤Þ¤Þ¤Ë¤¹¤ë¤³¤È¤òµö¤¹¤³¤È¤Ë¤è¤ê¡¢ +¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ÎºÇŬ²½¤ËɬÍפʤâ¤Î¤ò´ËϤ¹¤ë¡£ +.TP +.B FTS_PHYSICAL +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +fts ¥ë¡¼¥Á¥ó¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬»Ø¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Ç¤Ï¤Ê¤¯¡¢ +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¼«¿È¤Î +.I FTSENT +¹½Â¤ÂΤòÊÖ¤µ¤»¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤ë¤È¡¢³¬ÁØÃæ¤Î¤¹¤Ù¤Æ¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î +.I FTSENT +¹½Â¤ÂΤ¬¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÊÖ¤µ¤ì¤ë¡£ +.B FTS_LOGICAL +¤Þ¤¿¤Ï +.B FTS_PHYSICAL +¤Î¤É¤Á¤é¤«¤ò +.BR fts_open () +´Ø¿ô¤ËÍ¿¤¨¤Ê¤±¤ì¤Ð¡Ö¤Ê¤é¤Ê¤¤¡×¡£ +.TP +.B FTS_SEEDOT +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR fts_open () +¤Î¥Ñ¥¹°ú¤­¿ô¤È¤·¤Æ»ØÄꤵ¤ì¤Ê¤¤¸Â¤ê¡¢¥Õ¥¡¥¤¥ë³¬ÁØÃæ¤Ë¤¢¤ë +"." ¤Þ¤¿¤Ï ".." ¤È¤¤¤¦Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤Ï̵»ë¤µ¤ì¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +fts ¥ë¡¼¥Á¥ó¤Ë¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î +.I FTSENT +¹½Â¤ÂΤòÊÖ¤µ¤»¤ë¡£ +.TP +.B FTS_XDEV +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +fts ¤¬²¼¤ê»Ï¤á¤Î¥Õ¥¡¥¤¥ë¤È¤Ï°Û¤Ê¤ë¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤ò»ý¤Ã¤Æ¤¤¤ë +¥Ç¥£¥ì¥¯¥È¥ê¤Ë²¼¤ê¤ë¤Î¤òÁ˻ߤ¹¤ë¡£ +.\" .El +.PP +°ú¤­¿ô +.BR compar () +¤Ï¡¢³¬Áؤò¤¿¤É¤ë½çÈÖ¤ò·è¤á¤ë¤Î¤Ë»È¤ï¤ì¤ë¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô¤ò»ØÄꤹ¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢°ú¤­¿ô¤È¤·¤Æ +.I FTSENT +¹½Â¤ÂΤΥݥ¤¥ó¥¿¤Î¥Ý¥¤¥ó¥¿¤ò 2 ¤Ä¤È¤ê¡¢ +1 ÈÖÌܤΰú¤­¿ô¤Ç»²¾È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬ +2 ÈÖÌܤΰú¤­¿ô¤Ç»²¾È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤è¤ê +Á°¤Ë¤¢¤ë¾ì¹ç¤ÏÉé¤ÎÃÍ¡¦Æ±¤¸¾ì¹ç¤Ï¥¼¥í¡¦¸å¤Ë¤¢¤ë¾ì¹ç¤ÏÀµ¤ÎÃͤò +ÊÖ¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I FTSENT +¹½Â¤ÂΤΠ+.IR fts_accpath , +.IR fts_path , +.I fts_pathlen +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤³¤ÎÈæ³Ó¤Ë¡ÖÀäÂС׻ȤäƤϤ¤¤±¤Ê¤¤¡£ +.I fts_info +¥Õ¥£¡¼¥ë¥É¤¬ +.B FTS_NS +¤Þ¤¿¤Ï +.B FTS_NSOK +¤ËÀßÄꤵ¤ì¤ë¾ì¹ç¡¢ +.I fts_statp +¥Õ¥£¡¼¥ë¥É¤Ï¤³¤ì¤é¤Î¤É¤Á¤é¤Ç¤â¤Ê¤¤¡£ +.BR compar () +°ú¤­¿ô¤¬ +.B NULL +¤Î¾ì¹ç¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ò¤¿¤É¤ë½çÈ֤ϡ¢¥ë¡¼¥È¥Ñ¥¹¤Ë¤Ä¤¤¤Æ¤Ï +.I path_argv +¤Î¤Ê¤«¤Ç¥ê¥¹¥È¤µ¤ì¤¿½çÈ֤ǡ¢ +¤½¤Î¾¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤Ï¥Ç¥£¥ì¥¯¥È¥êÆâ¤Ç¥ê¥¹¥È¤µ¤ì¤¿½çÈ֤Ȥʤ롣 +.SS fts_read() +.BR fts_read () +´Ø¿ô¤Ï¡¢³¬ÁØÃæ¤Î¥Õ¥¡¥¤¥ë¤òµ­½Ò¤¹¤ë +.I FTSENT +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +(Æɤ߹þ¤ß²Äǽ¤Ç¡¢½Û´Ä¤·¤Æ¤¤¤Ê¤¤) ¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢ +1 ²ó¤Ï preorder ¤Ç¡¢¤â¤¦ 1 ²ó¤Ï postorder ¤Ç¡¢¾¯¤Ê¤¯¤È¤â 2 ²ó¤¿¤É¤é¤ì¤ë¡£ +¾¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¾¯¤Ê¤¯¤È¤â 1 ²ó¤¿¤É¤é¤ì¤ë¡£ +(¥Ç¥£¥ì¥¯¥È¥ê´Ö¤Î¥Ï¡¼¥É¥ê¥ó¥¯¤Ë¤è¤Ã¤Æ +½Û´Ä¤ä¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬µ¯¤³¤é¤Ê¤¤¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¤Ï 2 ²ó°Ê¾å¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ï 3 ²ó°Ê¾å¤¿¤É¤é¤ì¤ë¡£) +.PP +³¬ÁØÃæ¤Î¤¹¤Ù¤Æ¤Î¥á¥ó¥Ð¡¼¤¬ÊÖ¤µ¤ì¤¿¾ì¹ç¡¢ +.BR fts_read () +¤Ï +.B NULL +¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô +.I errno +¤ò 0 ¤Ë¤¹¤ë¡£ +³¬ÁØÃæ¤Î¥Õ¥¡¥¤¥ë¤Ë´Ø·¸¤·¤Ê¤¤¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.BR fts_read () +¤Ï +.B NULL +¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ËÂбþ¤·¤¿Ãͤˤ¹¤ë¡£ +³¬ÁØÃæ¤Î¥Õ¥¡¥¤¥ë¤Ë´Ø·¸¤·¤¿¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.I FTSENT +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ÏÀßÄꤵ¤ì¤ë¾ì¹ç¤ÈÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¤¬¤¢¤ë +.RI ( fts_info +¤ò»²¾È¤¹¤ë¤³¤È)¡£ +.PP +.BR fts_read () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë +.I FTSENT +¹½Â¤ÂΤϡ¢Æ±¤¸¥Õ¥¡¥¤¥ë³¬ÁØ¥¹¥È¥ê¡¼¥à¤Ø¤Î +.BR fts_close () +¤Î¸Æ½Ð¤·¤Î¸å¤Ë¾å½ñ¤­¤µ¤ì¤ë¡£ +¤Þ¤¿¡¢Æ±¤¸¥Õ¥¡¥¤¥ë³¬ÁØ¥¹¥È¥ê¡¼¥à¤Ø¤Î +.BR fts_read () +¤Î¸Æ½Ð¤·¤Î¸å¤Ç¤â¡¢¹½Â¤ÂΤ¬¥Ç¥£¥ì¥¯¥È¥ê¤òɽ¸½¤·¤Æ¤¤¤Ê¤¤¸Â¤ê¾å½ñ¤­¤µ¤ì¤ë¡£ +¤³¤Î¾ì¹ç¡¢ +.BR fts_read () +´Ø¿ô¤Ë¤è¤Ã¤Æ postorder ¤Ç +.I FTSENT +¹½Â¤ÂΤ¬ÊÖ¤µ¤ì¤¿¸å¡¢ +.BR fts_read () +¤Î¸Æ½Ð¤·¤¬¤¢¤ë¤Þ¤Ç¡¢ +¤³¤ì¤é¤Î¹½Â¤ÂΤϾå½ñ¤­¤µ¤ì¤Ê¤¤¡£ +.SS fts_children() +.BR fts_children () +´Ø¿ô¤Ï¡¢ +.I FTSENT +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂΤϡ¢( +.BR fts_read () +¤ÇºÇ¤â¿·¤·¤¯ÊÖ¤µ¤ì¤¿ +.I FTSENT +¹½Â¤ÂΤÇɽ¸½¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤Î) +NUL ½ªÃ¼¤µ¤ì¤¿¥ê¥ó¥¯¥ê¥¹¥È¤ÎºÇ½é¤Î¥¨¥ó¥È¥ê¤òµ­½Ò¤¹¤ë¡£ +¤³¤Î¥ê¥¹¥È¤Ï¡¢ +.I FTSENT +¹½Â¤ÂΤΠ+.I fts_link +¥Õ¥£¡¼¥ë¥É¤ò»È¤Ã¤Æ¥ê¥ó¥¯¤µ¤ì¡¢ +¥æ¡¼¥¶¡¼»ØÄê¤ÎÈæ³Ó´Ø¿ô¤¬¤¢¤ë¾ì¹ç¤Ï¡¢¤½¤ì¤Ç½ç½ø¤Å¤±¤é¤ì¤ë¡£ +.BR fts_children () +¤Î¸Æ½Ð¤·¤ò·«¤êÊÖ¤¹¤³¤È¤Ç¡¢ +¤³¤Î¥ê¥ó¥¯¥ê¥¹¥È¤ÏºÆÀ¸À®¤µ¤ì¤ë¡£ +.PP +ÆÃÊ̤ʾì¹ç¤È¤·¤Æ¡¢ +.BR fts_read () +¤¬¥Õ¥¡¥¤¥ë³¬ÁؤˤĤ¤¤Æ¸Æ¤Ð¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.BR fts_children () +¤Ï +.BR fts_open () +¤Ë»ØÄꤵ¤ì¤¿ÏÀÍý¥Ç¥£¥ì¥¯¥È¥ê (¤Ä¤Þ¤ê¡¢ +.BR fts_open () +¤Ë»ØÄꤵ¤ì¤¿°ú¤­¿ô) ¤ÎÃæ¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ç¡¢ +.BR fts_read () +¤Ë¤è¤Ã¤ÆºÇ¤â¿·¤·¤¯ÊÖ¤µ¤ì¤¿ +.I FTSENT +¹½Â¤ÂΤ¬ preorder ¤Ç¤¿¤É¤é¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¾ì¹ç¤ä +²¿¤â´Þ¤ó¤Ç¤¤¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¤Ï¡¢ +.BR fts_children () +¤Ï +.B NULL +¤òÊÖ¤·¡¢ +.I errno +¤ò 0 ¤Ë¤¹¤ë¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.BR fts_children () +¤Ï +.B NULL +¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ËÂбþ¤·¤¿Ãͤˤ¹¤ë¡£ +.PP +.BR fts_children () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë +.I FTSENT +¹½Â¤ÂΤϡ¢Æ±¤¸¥Õ¥¡¥¤¥ë³¬ÁØ¥¹¥È¥ê¡¼¥à¤Ø¤Î +.BR fts_children (), +.BR fts_close (), +.BR fts_read () +¤Î¸Æ½Ð¤·¤Î¸å¤Ë¾å½ñ¤­¤µ¤ì¤ë¾ì¹ç¤¬¤¢¤ë¡£ +.PP +.I option +¤Ï¡¢¼¡¤ÎÃͤËÀßÄê¤Ç¤­¤ë¡£ +.\" .Bl -tag -width FTS_NAMEONLY +.TP +.B FTS_NAMEONLY +¥Õ¥¡¥¤¥ë̾¤Î¤ß¤¬É¬ÍפȤµ¤ì¤Æ¤¤¤ë¡£ +ÊÖ¤µ¤ì¤¿¹½Â¤ÂΤΥê¥ó¥¯¥ê¥¹¥È¤Î +.IR fts_name , +.I fts_namelen +¥Õ¥£¡¼¥ë¥É°Ê³°¤Î +¤¹¤Ù¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤ÎÆâÍƤÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ +.\" .El +.SS fts_set() +´Ø¿ô +.BR fts_set () +¤Ï¡¢¥æ¡¼¥¶¡¼¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ +¥¹¥È¥ê¡¼¥à +.I ftsp +¤Î¥Õ¥¡¥¤¥ë +.I f +¤Ë¤Ä¤¤¤Æ¹¹¤Ê¤ë½èÍý¤ò·èÄꤹ¤ë¤³¤Èµö¤¹¡£ +.BR fts_set () +´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤ò¡¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.I option +¤Ï¡¢¼¡¤ÎÃͤΤ¤¤º¤ì¤« 1 ¤Ä¤ËÀßÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" .Bl -tag -width FTS_PHYSICAL +.TP +.B FTS_AGAIN +¥Õ¥¡¥¤¥ë¤òºÆ¤Ó¤¿¤É¤ë¡£¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤¬ºÆ¤Ó¤¿¤É¤é¤ì¤ë¡£ +¼¡¤Î +.BR fts_read () +¤Î¸Æ½Ð¤·¤Ë¤è¤ê¡¢»²¾È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬ÊÖ¤µ¤ì¤ë¡£ +¹½Â¤ÂΤΠ+.IR fts_stat , +.I fts_info +¥Õ¥£¡¼¥ë¥É¤Ï¤³¤Î»þ¤Ë½é´ü²½¤µ¤ì¤ë¤¬¡¢Â¾¤Î¥Õ¥£¡¼¥ë¥É¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.BR fts_read () +¤Ë¤è¤Ã¤ÆºÇ¤â¿·¤·¤¯ÊÖ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +Ä̾ï¤Ï¡¢postorder ¤Ç¥Ç¥£¥ì¥¯¥È¥ê¤ò¤¿¤É¤ë¾ì¹ç¤Ë»ÈÍѤ·¡¢ +¤½¤Î²¼¤Î³¬ÁؤÈƱÍͤˡ¢ +¥Ç¥£¥ì¥¯¥È¥ê¤ò (preorder ¤È postorder ¤ÎξÊý¤Ç) ºÆ¤Ó¤¿¤É¤é¤»¤ë¡£ +.TP +.B FTS_FOLLOW + +»²¾È¤µ¤ì¤Æ¤ë¥Õ¥¡¥¤¥ë¤Ï¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +»²¾È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬ +.BR fts_read () +¤Ë¤è¤Ã¤ÆºÇ¤â¿·¤·¤¯ÊÖ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¾ì¹ç¡¢¼¡¤Î +.BR fts_read () +¤Î¸Æ½Ð¤·¤Ç¤Ï¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤½¤Î¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬»Ø¤·¤Æ¤¤¤ëÀè¤òÈ¿±Ç¤¹¤ë¤è¤¦¤Ë +.IR fts_info , +.I fts_statp +¤òºÆ¤Ó½é´ü²½¤·¤¿¥Õ¥¡¥¤¥ë¤¬ÊÖ¤µ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬ +.BR fts_children () +¤Ë¤è¤Ã¤ÆºÇ¤â¿·¤·¤¯ÊÖ¤µ¤ì¤¿¤â¤Î¤Î 1 ¤Ä¤Ç¤¢¤ë¾ì¹ç¡¢ +.BR fts_read () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤¿¤È¤­¡¢¹½Â¤ÂΤΠ+.IR fts_info , +.I fts_statp +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤½¤Î¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬»Ø¤·¤Æ¤¤¤ëÀè¤òÈ¿±Ç¤¹¤ë¡£ +¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬»Ø¤·¤Æ¤¤¤ëÀ褬¤Ê¤¤¤È¤­¤Ï¡¢ +ÊÖ¤µ¤ì¤¿¹½Â¤ÂΤΥե£¡¼¥ë¥É¤ÏÊѹ¹¤µ¤ì¤º¡¢ +.I fts_info +¥Õ¥£¡¼¥ë¥É¤¬ +.B FTS_SLNONE +¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +¥ê¥ó¥¯À褬¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¤¬ preorder ¤ÇÊÖ¤µ¤ì¤¿¸å¡¢²¼¤Î³¬ÁؤΤ¹¤Ù¤Æ¥Õ¥¡¥¤¥ë¤¬ÊÖ¤µ¤ì¡¢ +¤½¤Î¸å¤Ç postorder ¤ÇÊÖ¤µ¤ì¤ë¡£ +.TP +.B FTS_SKIP +¤³¤Î¥Õ¥¡¥¤¥ë¤Î²¼¤Î³¬ÁؤϤ¿¤É¤é¤ì¤Ê¤¤¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢ +.BR fts_children () +¤Þ¤¿¤Ï +.BR fts_read () +¤Î¤É¤Á¤é¤«¤Ë¤è¤Ã¤ÆºÇ¤â¿·¤·¤¯ÊÖ¤µ¤ì¤¿¤â¤Î¤Î 1 ¤Ä¤Ç¤¢¤ë¡£ +.\" .El +.SS fts_close() +.BR fts_close () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë³¬ÁØ¥¹¥È¥ê¡¼¥à +.I ftsp +¤òÊĤ¸¤ë¡£¤½¤·¤Æ¡¢¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò +.I ftsp +¤ò³«¤¯¤¿¤á¤Ë +.BR fts_open () +¤¬¸Æ¤Ð¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÉü¸µ¤¹¤ë¡£ +.BR fts_close () +´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤ò¡¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.SS ¥¨¥é¡¼ +´Ø¿ô +.BR fts_open () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ï¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô +.BR open (2) +¤È +.BR malloc (3) +¤ËÂФ·¤Æ»ØÄꤵ¤ì¤ë¥¨¥é¡¼¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +´Ø¿ô +.BR fts_close () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ï¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô +.BR chdir (2) +¤È +.BR close (2) +¤ËÂФ·¤Æ»ØÄꤵ¤ì¤ë¥¨¥é¡¼¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +´Ø¿ô +.BR fts_read () +¤È +.BR fts_children () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤Ï¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô +.BR chdir (2), +.BR malloc (3), +.BR opendir (3), +.BR readdir (3), +.BR stat (2) +¤ËÂФ·¤Æ»ØÄꤵ¤ì¤ë¥¨¥é¡¼¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +¹¹¤Ë¡¢ +.BR fts_children (), +.BR fts_open (), +.BR fts_set () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.I errno +¤¬¼¡¤ÎÃͤˤµ¤ì¤ë¡£ +.TP +.B EINVAL +¥ª¥×¥·¥ç¥ó¤¬Ìµ¸ú¤Ç¤¢¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢Linux ¤Ç¤Ï glibc2 ¤«¤é»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +4.4BSD. +.\" The following statement is years old, and seems no closer to +.\" being true -- mtk +.\" .I fts +.\" ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ï¡¢¾­Íè¤Î +.\" POSIX.1 +.\" ¥ê¥Ó¥¸¥ç¥ó¤Ë´Þ¤Þ¤ì¤ë¤È´üÂÔ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR find (1), +.BR chdir (2), +.BR stat (2), +.BR ftw (3), +.BR qsort (3) diff --git a/release/man3/ftw.3 b/release/man3/ftw.3 new file mode 100644 index 00000000..07f90f52 --- /dev/null +++ b/release/man3/ftw.3 @@ -0,0 +1,465 @@ +.\" Copyright (c) 1993 Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de) +.\" and copyright (c) 1999 Andries Brouwer (aeb@cwi.nl) +.\" and copyright (c) 2006 Justin Pryzby +.\" and copyright (c) 2006 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., 675 Mass Ave, Cambridge, MA 02139, +.\" USA. +.\" +.\" Modified Sun Jul 25 11:02:22 1993 by Rik Faith (faith@cs.unc.edu) +.\" 2006-05-24, Justin Pryzby +.\" document FTW_ACTIONRETVAL; include .SH "RETURN VALUE"; +.\" 2006-05-24, Justin Pryzby and +.\" Michael Kerrisk +.\" reorganized and rewrote much of the page +.\" 2006-05-24, Michael Kerrisk +.\" Added an example program. +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-04-28, NAKANO Takeo +.\" Updated & Modified 1999-09-14, NAKANO Takeo +.\" Updated & Modified 2005-11-04, Akihiro MOTOKI +.\" Updated 2006-07-26, Akihiro MOTOKI , LDP v2.36 +.\" +.\" WORD: file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\" +.TH FTW 3 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ftw, nftw \- ¥Õ¥¡¥¤¥ë¥Ä¥ê¡¼¤òÊ⤭¤Þ¤ï¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int ftw(const char *" dirpath , +.BI " int (*" fn ") (const char *" fpath ", const struct stat *" sb , +.BI " int " typeflag ), +.BI " int " nopenfd ); +.sp +.B #define _XOPEN_SOURCE 500 +.B #include +.sp +.BI "int nftw(const char *" dirpath , +.BI " int (*" fn ") (const char *" fpath ", const struct stat *" sb , +.BI " int " typeflag ", struct FTW *" ftwbuf ), +.BI " int " nopenfd ", int " flags ); +.fi +.SH ÀâÌÀ +.BR ftw () +¤Ï¡¢ +.I dirpath +¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼Á´ÂΤòÊ⤭¤Þ¤ï¤ê¡¢ +¥Ä¥ê¡¼Ãæ¤Ç¥¨¥ó¥È¥ê¤¬¸«ÉÕ¤«¤ë¤´¤È¤Ë¡¢ +.IR fn () +¤ò¸Æ¤Ó½Ð¤¹¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤½¤Î¤â¤Î¤¬¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤ä +¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤è¤ê¤âÀè¤Ë½èÍý¤µ¤ì¤ë (¹Ô¤­¤¬¤±½çõº÷; preorder traversal)¡£ + +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»È¤¤ÀÚ¤Ã¤Æ +¤·¤Þ¤ï¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤¿¤á¡¢ +.BR ftw () +¤¬Æ±»þ¤Ë¥ª¡¼¥×¥ó¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÎºÇÂç¿ô¤ò +.I nopenfd +¤Ç»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +õº÷¤Î¿¼¤µ¤¬¤³¤ÎÃͤò±Û¤¨¤ë¤È¡¢ +°ì¤Ä¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òÊĤ¸¤Æ¤«¤é¾¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¥ª¡¼¥×¥ó¤·Ä¾¤¹¤³¤È +¤Ë¤Ê¤ë¤Î¤Ç¡¢ +.BR ftw () +¤ÎÆ°ºî¤ÏÃÙ¤¯¤Ê¤ë¡£ +.BR ftw () +¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤Î³¬ÁØ 1 ¥ì¥Ù¥ë¤Ë¤Ä¤­¡¢ +ºÇÂç¤Ç¤â°ì¤Ä¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤·¤«»ÈÍѤ·¤Ê¤¤¡£ + +¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤Ç¸«¤Ä¤«¤Ã¤¿¥¨¥ó¥È¥êËè¤Ë¡¢ +.BR ftw () +¤Ï +.IR fpath , +.IR sb , +.I typeflag +¤Î 3¤Ä¤ò°ú¤­¿ô¤È¤·¤Æ +.IR fn () +¤ò¸Æ¤Ó½Ð¤¹¡£ +.I fpath +¤Ï¥¨¥ó¥È¥ê¤Î +.I dirpath +¤«¤é¤ÎÁêÂХѥ¹Ì¾¤Ç¤¢¤ë¡£ +.I sb +¤Ï +.I fpath +¤ËÂФ¹¤ë +.BR stat (2) +¤Î¸Æ¤Ó½Ð¤·¤ÇÊÖ¤µ¤ì¤ë +.I stat +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I typeflag +¤ÏÀ°¿ô¤Ç¡¢°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤Ç¤¢¤ë: +.TP +.B FTW_F +.I fpath +¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë +.TP +.B FTW_D +.I fpath +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë +.TP +.B FTW_DNR +.I fpath +¤¬Æɤ߹þ¤ß¤Ç¤­¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë +.TP +.B FTW_NS +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤Ï¤Ê¤¤ +.I fpath +¤ËÂФ¹¤ë +.BR stat (2) +¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤·¤¿¡£ +.sp +.I fpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¡¢¤«¤Ä +.BR stat (2) +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.B FTW_NS +¤È +.B FTW_SL +(¸å½Ò) ¤Î¤É¤Á¤é¤¬ +.I typeflag +¤ËÅϤµ¤ì¤ë¤«¤Ï̤ÄêµÁ¤Ç¤¢¤ë¤È¡¢POSIX.1-2001 ¤Ë¤Ï½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +¥Ä¥ê¡¼¤Îõº÷¤ò»ß¤á¤¿¤¤¾ì¹ç¤Ï¡¢ +.IR fn () +¤¬ 0 °Ê³°¤ÎÃͤòÊÖ¤»¤ÐÎɤ¤ +(¤³¤ÎÃÍ¤Ï +.BR ftw () +¼«¿È¤ÎÌá¤êÃͤȤʤë)¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï +.BR ftw () +¤Ï¥Ä¥ê¡¼Á´ÂΤÎõº÷¤ò³¤±¡¢¤¹¤Ù¤Æ¤Î¥Ä¥ê¡¼¤òõº÷¤·½ª¤¨¤¿¤È¤³¤í¤Ç +0 ¤òÊÖ¤¹¡£Ãµº÷Ãæ¤Ë +.RB ( malloc (3) +¤Î¼ºÇԤʤɤÎ) ¥¨¥é¡¼¤¬µ¯¤³¤ë¤È \-1 ¤òÊÖ¤¹¡£ +.PP +.BR ftw () +¤ÏưŪ¤Ê¥Ç¡¼¥¿¹½Â¤¤òÍѤ¤¤ë¤Î¤Ç¡¢¥Ä¥ê¡¼Ãµº÷¤ò°ÂÁ´¤ËÃæÃǤ¹¤ëÍ£°ì¤ÎÊýË¡¤Ï +0 °Ê³°¤ÎÃͤò +.IR fn () +¤ÎÊÖ¤êÃͤȤ¹¤ë¤³¤È¤Ç¤¢¤ë¡£³ä¤ê¹þ¤ß¤ò°·¤¦¤Ë¤Ï¡¢ +Î㤨¤ÐȯÀ¸¤·¤¿³ä¤ê¹þ¤ß¤ò¥Þ¡¼¥¯¤·¤Æ¤ª¤¤¤Æ¡¢ 0 °Ê³°¤ÎÃͤòÊÖ¤¹¤è¤¦¤Ë¤¹¤ë +¥·¥°¥Ê¥ë¤Ë¤è¤ê¥á¥â¥ê¥ê¡¼¥¯¤òµ¯¤³¤µ¤º¤Ëõº÷¤ò½ªÎ»¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ç +.IR fn () +¤¬¥Á¥§¥Ã¥¯¤¹¤ë¥°¥í¡¼¥Ð¥ë¤Ê¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤è¤¦¤Ë¤¹¤ì¤Ð¤è¤¤¡£ +¥×¥í¥°¥é¥à¤ò½ªÎ»¤µ¤»¤ë¾ì¹ç°Ê³°¤Ï¡¢ +.BR longjmp (3) +¤ò»ÈÍѤ·¤Ê¤¤¤³¤È¡£ +.SS nftw() +´Ø¿ô +.BR nftw () +¤Ï +.BR ftw () +¤ÈƱ¤¸¤À¤¬¡¢°ú¤­¿ô +.I flags +¤¬Äɲ䵤ì¤ëÅÀ¤È¡¢ +.IR fn () +¤Î°ú¤­¿ô¤Ë +.I ftwbuf +¤¬Äɲ䵤ì¤ëÅÀ¤¬°Û¤Ê¤ë¡£ + +¤³¤Î +.I flags +°ú¤­¿ô¤Ï²¼µ­¤Î¥Õ¥é¥°¤Î 0 ¸Ä°Ê¾å¤ÎÏÀÍýϤò¼è¤Ã¤¿¤â¤Î¤Ç¤¢¤ë: +.TP +.BR FTW_ACTIONRETVAL " (glibc 2.3.3 °Ê¹ß)" +¤³¤Î¥Õ¥é¥°¤Ï glibc ¸ÇÍ­¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢ +.BR nftw () +¤Î +.IR fn () +¤ÎÊÖ¤êÃͤΰ·¤¤¤¬ÊѤï¤ë¡£ +.IR fn () +¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤òÊÖ¤¹É¬Íפ¬¤¢¤ë¡£ +.RS +.TP +.B FTW_CONTINUE +.BR nftw () +¤ÏÄ̾ïÄ̤ê½èÍý¤ò³¤±¤ë¡£ +.TP +.B FTW_SKIP_SIBLINGS +.IR fn () +¤¬¤³¤ÎÃͤòÊÖ¤·¤¿¾ì¹ç¡¢½èÍýÃæ¤Î¥¨¥ó¥È¥ê¤Î·»Äï (Ʊ¤¸³¬ÁؤΥ¨¥ó¥È¥ê) +¤Î½èÍý¤Ï¥¹¥­¥Ã¥×¤µ¤ì¡¢¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ç³¤­¤Î½èÍý¤¬¹Ô¤ï¤ì¤ë¡£ +.\" If \fBFTW_DEPTH\fP +.\" is set, the entry's parent directory is processed next (with +.\" \fIflag\fP set to \fBFTW_DP\fP). +.TP +.B FTW_SKIP_SUBTREE +.IR fn () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¥¨¥ó¥È¥ê¤¬¥Ç¥£¥ì¥¯¥È¥ê +.RI ( typeflag +¤¬ +.BR FTW_D ) +¤Î¾ì¹ç¤Ë¡¢¤³¤ÎÃͤòÊÖ¤¹¤È +.IR fn () +¤Î°ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥¨¥ó¥È¥ê¤Î½èÍý¤¬¹Ô¤ï¤ì¤Ê¤¯¤Ê¤ë¡£ +.BR nftw () +¤Ï½èÍýÃæ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î·»Äï (Ʊ¤¸³¬ÁؤΥ¨¥ó¥È¥ê) ¤«¤é½èÍý¤ò³¤±¤ë¡£ +.TP +.B FTW_STOP +.B nftw () +¤Ï¡¢ÊÖ¤êÃÍ +.B FTW_STOP +¤Ç¤¹¤°¤ËÉüµ¢¤¹¤ë¡£ +.PP +¾¤ÎÊÖ¤êÃͤϾ­Íè¿·¤·¤¤Æ°ºî¤ËÂбþÉÕ¤±¤é¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.IR fn () +¤Ï¾åµ­¤Î¥ê¥¹¥È¤Ë¤¢¤ëÃͰʳ°¤òÊÖ¤µ¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.I +¤Ç +.B FTW_ACTIONRETVAL +¤¬ÄêµÁ¤µ¤ì¤ë¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¡¢ +µ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _GNU_SOURCE +¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.RE +.TP +.B FTW_CHDIR +¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍƤò½èÍý¤¹¤ëÁ°¤Ë +¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë +.BR chdir (2) +¤¹¤ë¡£¤³¤Î¥Õ¥é¥°¤Ï¡¢ +.I fpath +¤¬Â°¤¹¥Ç¥£¥ì¥¯¥È¥ê¤Ç²¿¤é¤«¤ÎÆ°ºî¤ò¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ë +ÊØÍø¤Ç¤¢¤ë¡£ +.TP +.B FTW_DEPTH +¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢µ¢¤ê¤¬¤±½çõº÷ (post-order traversal) ¤ò¹Ô¤¦¡£ +¤Ä¤Þ¤ê¡¢¥Ç¥£¥ì¥¯¥È¥ê¤½¤Î¤â¤Î¤ò°ú¤­¿ô¤È¤·¤¿ +.IR fn () +¸Æ½Ð¤·¤Ï¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤È¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë +ÂФ¹¤ë½èÍý¤Î¡Ö¸å¤Ç¡×¹Ô¤ï¤ì¤ë +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¼«¿È¤Î½èÍý¤Ï¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥¨¥ó¥È¥ê +¤è¤ê¡ÖÁ°¤Ë¡×¹Ô¤Ê¤ï¤ì¤ë)¡£ +.TP +.B FTW_MOUNT +¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÃæ¤À¤±¤òõº÷ÂоݤȤ¹¤ë +(¤Ä¤Þ¤ê¡¢¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò¤Þ¤¿¤°¤³¤È¤Ï¤Ê¤¤)¡£ +.TP +.B FTW_PHYS +¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òé¤é¤Ê¤¤ (¤ª¤½¤é¤¯¤³¤Á¤é¤¬ +Ä̾ï˾¤Þ¤·¤¤Æ°ºî¤À¤í¤¦)¡£¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò +é¤ë¤¬¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¤¬Æó²óÊó¹ð¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.sp +.B FTW_PHYS +¤¬¥»¥Ã¥È¤µ¤ì¤º¤Ë +.B FTW_DEPTH +¤¬¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢¼«Ê¬¼«¿È¤ËÂФ¹¤ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òÇÛ²¼¤Ë»ý¤Ä +¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ +.IR fn () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£ +.LP +¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤Î¥¨¥ó¥È¥êËè¤Ë¡¢ +.BR nftw () +¤Ï 4¤Ä¤Î°ú¤­¿ô¤Ç +.IR fn () +¤ò¸Æ¤Ó½Ð¤¹¡£ +.I fpath +¤È +.I sb +¤Ï +.BR ftw () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.I typeflag +¤Ë¤Ï¡¢ +.BR ftw () +¤Ç¼è¤êÆÀ¤ëÃͤΤ¤¤º¤ì¤«¡¢¤Þ¤¿¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤¬ÅϤµ¤ì¤ë: +.TP +.B FTW_DP +.I fpath +¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¡¢¤«¤Ä +.I flags +¤Ç +.B FTW_DEPTH +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¡£ +.I fpath +ÇÛ²¼¤Î¥Õ¥¡¥¤¥ë¤È¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ÏÁ´¤Æ½èÍý¤¬½ª¤ï¤Ã¤Æ¤¤¤ë¡£ +.TP +.B FTW_SL +.I fpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¡¢¤«¤Ä \fBFTW_PHYS\fP ¤¬ \fIflags\fP ¤Ë +¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¡£ +.\" To obtain the definition of this constant from +.\" .IR , +.\" either +.\" .B _BSD_SOURCE +.\" must be defined, or +.\" .BR _XOPEN_SOURCE +.\" must be defined with a value of 500 or more. +.TP +.B FTW_SLN +.I fpath +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¡¢Â¸ºß¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë +(¤³¤ì¤¬¥»¥Ã¥È¤µ¤ì¤ë¤Î¤Ï +.B FTW_PHYS +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤À¤±¤Ç¤¢¤ë)¡£ +.LP +.BR nftw () +¤¬ +.IR fn () +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤ËÅϤ¹ 4¤Ä¤á¤Î°ú¤­¿ô¤Ï +.I FTW +·¿¤Î¹½Â¤ÂΤǤ¢¤ë¡£ +.in +4n +.nf + +struct FTW { + int base; + int level; +}; + +.fi +.in +.I base +¤Ï¡¢¥Õ¥¡¥¤¥ë̾ (basename Í×ÁÇ) ¤Î¡¢ +.I fpath +¤ÇÅϤµ¤ì¤ë¥Ñ¥¹Ì¾¤ÎÃæ¤Ç¤Î¥ª¥Õ¥»¥Ã¥È¤Ç¤¢¤ë¡£ +.I level +¤Ï¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤Ç¤Î +.I fpath +¤Î¿¼¤µ¤ò¼¨¤¹¡£¿¼¤µ¤Ï¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤Î¥È¥Ã¥× (root) ¤«¤é¤Î +ÁêÂÐÃͤǤ¢¤ë +.RI ( dirpath +¤Ï¿¼¤µ 0 ¤Ç¤¢¤ë)¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤ò¡¢¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È \-1 ¤òÊÖ¤¹¡£ + +.IR fn () +¤¬ 0 °Ê³°¤òÊÖ¤·¤¿¾ì¹ç¡¢¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤Îõº÷¤ò½ªÎ»¤·¡¢ +.IR fn () +¤¬ÊÖ¤·¤¿Ãͤò +.BR ftw () +¤ä +.BR nftw () +¤Î·ë²Ì¤È¤·¤ÆÊÖ¤¹¡£ + +.BR nftw () +¤¬ +.B FTW_ACTIONRETVAL +¥Õ¥é¥°ÉÕ¤­¤Ç¸Æ¤Ð¤ì¤¿¾ì¹ç¡¢¥Ä¥ê¡¼¤Îõº÷¤ò½ªÎ»¤µ¤»¤ë¤¿¤á¤Ë +.IR fn () +¤¬»ÈÍѤǤ­¤ë¡¢Èó 0 ¤ÎÃÍ¤Ï +.B FTW_STOP +¤À¤±¤Ç¤¢¤ê¡¢ +¤³¤ÎÃÍ¤Ï +.BR nftw () +¤ÎÊÖ¤êÃͤȤ·¤ÆÊÖ¤µ¤ì¤ë¡£ +.SH ½àµò +POSIX.1-2001, SVr4, SUSv1. +POSIX.1-2008 ¤Ï +.BR ftw () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.BR nftw () +´Ø¿ô¤È¡¢ +.BR ftw () +¤Ë¤ª¤±¤ë +.B FTW_SL +¤Ï¡¢SUSv1 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.LP +.BR ftw () +¤Ç +.B FTW_SL +¤ò°ìÀڻȤï¤Ê¤¤¥·¥¹¥Æ¥à¤ä¡¢ +¸ºß¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¤Î¤ß +.B FTW_SL +¤ò»È¤¦¥·¥¹¥Æ¥à¡¢¤Þ¤¿ +.BR ftw () +¤¬Á´¤Æ¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ËÂФ·¤Æ +.B FTW_SL +¤ò»È¤¦¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +ͽ¬²Äǽ¤ÊÆ°ºî¤ò¤µ¤»¤ë¤¿¤á¤Ë¤Ï¡¢ +.BR nftw () +¤ò»È¤¦¤³¤È¡£ +.LP +Linux ¤Ç¤Ï¡¢ libc4, libc5, glibc 2.0.6 ¤Ï +¡Östat ¤Ç¤­¤ë¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¥ª¥Ö¥¸¥§¥¯¥È¡× +(¥Õ¥¡¥¤¥ë, ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯, fifo Åù) +¤ËÂФ·¤Æ¤Ï¤¹¤Ù¤Æ +.B FTW_F +¤ò»È¤¦¡£ + +.BR nftw () +´Ø¿ô¤Ï glibc 2.1 °Ê¹ß¤ÇÍøÍѤǤ­¤ë¡£ + +.B FTW_ACTIONRETVAL +¤Ï glibc ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢°ì¤ÄÌܤΥ³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ò̾Á°¤Ë»ý¤Ä¥Ñ¥¹°Ê²¼¤Î +¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤òõº÷¤¹¤ë¡£°ú¤­¿ô¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤òõº÷¤¹¤ë¡£ +³Æ¡¹¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤ÆÍÍ¡¹¤Î¾ðÊó¤¬É½¼¨¤µ¤ì¤ë¡£ +ÆóÈÖÌܤΥ³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ëʸ»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +.BR nftw () +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë +.I flags +°ú¤­¿ô¤ËÅϤ¹ÃͤòÀ©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.nf + +#define _XOPEN_SOURCE 500 +#include +#include +#include +#include +#include + +static int +display_info(const char *fpath, const struct stat *sb, + int tflag, struct FTW *ftwbuf) +{ + printf("%\-3s %2d %7jd %\-40s %d %s\\n", + (tflag == FTW_D) ? "d" : (tflag == FTW_DNR) ? "dnr" : + (tflag == FTW_DP) ? "dp" : (tflag == FTW_F) ? "f" : + (tflag == FTW_NS) ? "ns" : (tflag == FTW_SL) ? "sl" : + (tflag == FTW_SLN) ? "sln" : "???", + ftwbuf\->level, (intmax_t) sb\->st_size, + fpath, ftwbuf\->base, fpath + ftwbuf\->base); + return 0; /* To tell nftw() to continue */ +} + +int +main(int argc, char *argv[]) +{ + int flags = 0; + + if (argc > 2 && strchr(argv[2], \(aqd\(aq) != NULL) + flags |= FTW_DEPTH; + if (argc > 2 && strchr(argv[2], \(aqp\(aq) != NULL) + flags |= FTW_PHYS; + + if (nftw((argc < 2) ? "." : argv[1], display_info, 20, flags) + == \-1) { + perror("nftw"); + exit(EXIT_FAILURE); + } + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR stat (2), +.BR fts (3), +.BR readdir (3), +.BR feature_test_macros (7) diff --git a/release/man3/futimes.3 b/release/man3/futimes.3 new file mode 100644 index 00000000..8d34cf8c --- /dev/null +++ b/release/man3/futimes.3 @@ -0,0 +1,104 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 2006, 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. +.\" +.\" 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 ½¤Àµ»þ¹ï +.\" +.TH FUTIMES 3 2008-04-07 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +futimes, lutimes \- ¥Õ¥¡¥¤¥ë¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÊѹ¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include + +.BI "int futimes(int " fd ", const struct timeval " tv [2]); + +.BI "int lutimes(const char *" filename ", const struct timeval " tv [2]); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR futimes (), +.BR lutimes (): +_BSD_SOURCE +.SH ÀâÌÀ +.BR futimes () +¤Ï +.BR utimes (2) +¤ÈƱ¤¸ÊýË¡¤Ç¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹»þ¹ï¤È½¤Àµ»þ¹ï¤òÊѹ¹¤¹¤ë¡£ +°ã¤¤¤Ï¡¢¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÊѹ¹¤¹¤ë¥Õ¥¡¥¤¥ë¤ò¡¢ +¥Ñ¥¹Ì¾¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤òÍѤ¤¤Æ»ØÄꤹ¤ëÅÀ¤Ç¤¢¤ë¡£ + +.BR lutimes () +¤Ï +.BR utimes (2) +¤ÈƱ¤¸ÊýË¡¤Ç¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹»þ¹ï¤È½¤Àµ»þ¹ï¤òÊѹ¹¤¹¤ë¡£ +°ã¤¤¤Ï¡¢ +.I filename +¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢¥ê¥ó¥¯¤ÎŸ³«¤ò¹Ô¤ï¤º¡¢ +Âå¤ï¤ê¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÊѹ¹¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤Ï +.BR utimes (2) +¤ÈƱ¤¸¤À¤¬¡¢ +.BR futimes () +¤Ç¤Ï°Ê²¼¤Î¥¨¥é¡¼¤¬ÄɲäˤʤäƤ¤¤ë: +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B ENOSYS +.I /proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR futimes () +¤Ï glibc 2.3 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.BR lutimes () +¤Ï glibc 2.6 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ê¡¢ +.BR utimensat (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.BR utimensat (2) +¤Ï¥«¡¼¥Í¥ë 2.6.22 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï¤É¤Îɸ½à¤Ç¤âµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +Linux °Ê³°¤Ç¤Ï¡¢¤³¤ì¤é¤Ï BSD ¤Ç¤Î¤ßÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR utimensat (2), +.BR utime (2), +.BR symlink (7) diff --git a/release/man3/fwide.3 b/release/man3/fwide.3 new file mode 100644 index 00000000..5df7db55 --- /dev/null +++ b/release/man3/fwide.3 @@ -0,0 +1,85 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:36 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH FWIDE 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fwide \- FILE ¥¹¥È¥ê¡¼¥à¤ÎÆþ½ÐÎÏñ°Ì¤òÀßÄê¤Þ¤¿¤Ï¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fwide(FILE *" stream ", int " mode ); +.fi +.sp +.in -4n +.in +.sp +.BR fwide (): +_XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; ¤Þ¤¿¤Ï +.I cc\ -std=c99 +.SH ÀâÌÀ +\fImode\fP ¤¬¥¼¥í¤Ê¤é¤Ð +.BR fwide () +´Ø¿ô¤Ï \fIstream\fP ¤Î¸½ºß¤Î +Æþ½ÐÎÏñ°Ì¤ò·èÄꤷ¤ÆÊÖ¤¹¡£\fIstream\fP ¤¬¥ï¥¤¥Éʸ»úñ°Ì¤Î¤È¤­¡¢ +¤¹¤Ê¤ï¤Á¥ï¥¤¥Éʸ»ú I/O ¤Ïµö¤µ¤ì¤Æ¥Ð¥¤¥È (char) I/O ¤Ïµö¤µ¤ì¤Æ¤¤¤Ê¤¤ +¤È¤­¤Ë¤Ï¡¢Àµ¤ÎÃͤòÊÖ¤¹¡£ +\fIstream\fP ¤¬¥Ð¥¤¥Èñ°Ì¤Î¤È¤­¡¢¤¹¤Ê¤ï¤Á¥Ð¥¤¥È I/O ¤Ïµö¤µ¤ì¤Æ +¥ï¥¤¥Éʸ»ú I/O ¤Ïµö¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¤Ë¤Ï¡¢Éé¤ÎÃͤòÊÖ¤¹¡£ +\fIstream\fP ¤ÎÆþ½ÐÎÏñ°Ì¤¬¤Þ¤À·èÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤Î¾ì¹ç¤Ë¤Ï¼¡¤Î I/O Áàºî¤Ë¤è¤Ã¤ÆÆþ½ÐÎÏñ°Ì¤¬Êѹ¹¤µ¤ì¤ë +(¥Ð¥¤¥È I/O Áàºî¤Î¾ì¹ç¤Ë¤Ï¥Ð¥¤¥Èñ°Ì¤Ë¡¢¥ï¥¤¥Éʸ»ú I/O Áàºî¤Î¾ì¹ç¤Ë¤Ï +¥ï¥¤¥Éʸ»úñ°Ì¤Ë¤Ê¤ë)¡£ +.PP +°ìÅÙ¥¹¥È¥ê¡¼¥à¤ÎÆþ½ÐÎÏñ°Ì¤¬·è¤Þ¤ë¤È¡¢Êѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤º¡¢ +¥¹¥È¥ê¡¼¥à¤¬¥¯¥í¡¼¥º (close) ¤µ¤ì¤ë¤Þ¤ÇÊÝ»ý¤µ¤ì¤ë¡£ +.PP +\fImode\fP ¤¬¥¼¥í¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï +.BR fwide () +´Ø¿ô¤ÏºÇ½é¤Ë \fIstream\fP +¤ÎÆþ½ÐÎÏñ°Ì¤òÀßÄꤷ¤è¤¦¤È¤¹¤ë +(\fImode\fP ¤¬ 0 ¤è¤êÂ礭¤¤¾ì¹ç¤Ë¤Ï¥ï¥¤¥Éʸ»úñ°Ì¤Ë¡¢ +\fImode\fP ¤¬ 0 ¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ë¤Ï¥Ð¥¤¥Èñ°Ì¤ËÀßÄꤷ¤è¤¦¤È¤¹¤ë)¡£ +¤½¤·¤Æ¾åµ­¤ÈƱÍͤ˸½ºß¤ÎÆþ½ÐÎÏñ°Ì¤òÊÖ¤¹¡£ + +.SH ÊÖ¤êÃÍ +.BR fwide () +´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤ÎÆþ½ÐÎÏñ°Ì¤ÎÀßÄê¤ò»î¤ß¤¿¸å¤Ë¤½¤ÎÃͤòÊÖ¤¹¡£ +Àµ¤ÎÊÖ¤êÃͤϥ磻¥Éʸ»úñ°Ì¤ò¡¢Éé¤ÎÊÖ¤êÃͤϥХ¤¥Èñ°Ì¤ò°ÕÌ£¤¹¤ë¡£ +ÊÖ¤êÃͤ¬ 0 ¤Ê¤é¤Ð̤·èÄê¤ò°ÕÌ£¤¹¤ë¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH Ãí°Õ +¥Ð¥¤¥Èñ°Ì¤Î¥¹¥È¥ê¡¼¥à¤Ë¥ï¥¤¥Éʸ»ú¤ò½ÐÎϤˤ¹¤ë¤Ë¤Ï +.BR fprintf (3) +´Ø¿ô¤Î +.B %lc +ÊÑ´¹¤ä +.B %ls +ÊÑ´¹¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +¥ï¥¤¥Éʸ»úñ°Ì¤Î¥¹¥È¥ê¡¼¥à¤Ë¥Ð¥¤¥Èñ°Ì¤Î½ÐÎϤò¹Ô¤¦¤Ë¤Ï +.BR fwprintf (3) +´Ø¿ô¤Î +.B %c +ÊÑ´¹¤ä +.B %s +ÊÑ´¹¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fprintf (3), +.BR fwprintf (3) diff --git a/release/man3/gamma.3 b/release/man3/gamma.3 new file mode 100644 index 00000000..7d57604d --- /dev/null +++ b/release/man3/gamma.3 @@ -0,0 +1,108 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" 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" +.SH ̾Á° +gamma, gammaf, gammal \- ¥¬¥ó¥Þ´Ø¿ô (¤Î¼«Á³Âпô) +.SH ½ñ¼° +.B #include +.sp +.BI "double gamma(double " x ");" +.br +.BI "float gammaf(float " x ");" +.br +.BI "long double gammal(long double " x ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR gamma (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.br +.BR gammaf (), +.BR gammal (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.\" Also seems to work: -std=c99 -D_XOPEN_SOURCE +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÈó¿ä¾©¤Ç¤¢¤ë¡£¤½¤ÎÂå¤ï¤ê¡¢¾ìÌ̤˱þ¤¸¤Æ +.BR tgamma (3) +¤« +.BR lgamma (3) +¤ò»È¤¦¤³¤È¡£ + +¥¬¥ó¥Þ´Ø¿ô¤ÎÄêµÁ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR tgamma (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SS *BSDÈÇ +4.4BSD ¤Î libm ¤È FreeBSD ¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤Ï¡¢´Ø¿ô +.BR gamma () +¤¬´Þ¤Þ¤ì¤Æ¤ª¤ê¡¢´üÂÔÄ̤ꥬ¥ó¥Þ´Ø¿ô¤ò·×»»¤Ç¤­¤ë¡£ +.SS glibcÈÇ +Glibc¤Ï¡¢´Ø¿ô +.BR gamma () +¤ò´Þ¤ó¤Ç¤¤¤ë¤¬¡¢¤³¤ì¤Ï +.BR lgamma (3) +¤ÈÅù²Á¤Ç¤¢¤ê¡¢¥¬¥ó¥Þ´Ø¿ô¤Î¼«Á³Âпô¤ò·×»»¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR lgamma (3) +¤ò»²¾È¡£ +.SH ¥¨¥é¡¼ +.BR lgamma (3) +¤ò»²¾È¡£ +.SH ½àµò +¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¿¶Éñ¤¤¤¬°Û¤Ê¤ë¤È¤¤¤¦Îò»ËŪ¤Ê·Ð°Þ¤Î¤¿¤á¡¢ +¤³¤Î´Ø¿ô¤Ï¤É¤Îɸ½àµ¬³Ê¤Ç¤âµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH Ãí°Õ +.SS Îò»Ë +4.2BSD¤Ë¤ª¤¤¤Æ¤Ï¡¢´Ø¿ô +.BR gamma () +¤¬¼ÂºÝ¤Ë·×»»¤¹¤ë¤Î¤Ï +.RI ln(|Gamma(| x |)|) +¤Ç¤¢¤ê¡¢ +.RI Gamma(| x |) +¤ÎÉä¹æ¤¬ extern int \fIsigngam\fP ¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤¿¡£ +4.3BSD¤Ë¤Ê¤Ã¤Æ´Ø¿ô̾¤¬Êѹ¹¤µ¤ì¡¢ +.BR lgamma (3) +¤È¤Ê¤ê¡¢¤½¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï +.sp +.in +4n +¡Ö¤¤¤Ä¤ÎÆü¤« gamma ¤Î̾¤ÏÉü³è¤·¡¢¥¬¥ó¥Þ´Ø¿ô¤Ë´§¤µ¤ì¤ë¤Ç¤¢¤í¤¦¡× +.in +.sp +¤È¤¤¤¦ÀÀ¤¤¤¬½Ò¤Ù¤é¤ì¤Æ¤¤¤¿¡£ +.\" 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) +¤È¤¤¤¦¡ÖËÜÅö¤Î¥¬¥ó¥Þ´Ø¿ô¡×¤¬¤¹¤Ç¤Ë¸ºß¤·¤Æ¤¤¤ë¤Î¤Ç¤¢¤ë¡£ +.\" FreeBSD¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤è¤ì¤Ð¡¢gamma()¤Ïsigngam¤ò¥»¥Ã¥È¤·¤Ê¤¤ +.\" ¤³¤È¤ò½ü¤±¤Ðlgamma()¤ÈƱÍͤÀ¤È¤¤¤¦¡£ +.\" ¤Þ¤¿¡¢4.4BSD¤Ç¤Ïgamma()¤ÏËÜÅö¤Î¥¬¥ó¥Þ´Ø¿ô¤ò·×»»¤¹¤ë¤È¤â¤¤¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR lgamma (3), +.BR signgam (3), +.BR tgamma (3) diff --git a/release/man3/gcvt.3 b/release/man3/gcvt.3 new file mode 100644 index 00000000..72a87720 --- /dev/null +++ b/release/man3/gcvt.3 @@ -0,0 +1,81 @@ +.\" 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 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 +.\" +.TH GCVT 3 2009-03-15 "" "Linux Programmer's Manual" +.SH ̾Á° +gcvt \- ÉâÆ°¾®¿ôÅÀ¿ô¤òʸ»úÎó¤ØÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *gcvt(double " number ", size_t " ndigit ", char *" buf ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR gcvt (): +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +´Ø¿ô +.BR gcvt () +¤Ï¡¢ \fInumber\fP ¤ò¡¢ºÇû¤ÎŤµ¤Î NULL ½ªÃ¼¤µ¤ì¤¿ ASCII +ʸ»úÎó¤ØÊÑ´¹¤·¡¢ÊÑ´¹¸å¤Îʸ»úÎó¤ò \fIbuf\fP ¤Ë³ÊǼ¤¹¤ë¡£ +.BR printf (3) +¤Î F ¥Õ¥©¡¼¥Þ¥Ã¥È¤ä E ¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¤è¤¦¤Ë \fIndigit\fP ·å¤Î +Í­¸ú¿ô»ú¤òÀ¸À®¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +´Ø¿ô +.BR gcvt () +¤Ïʸ»úÎó \fIbuf\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ½àµò +POSIX.1-2001 ¤Ç¤Ï¡¢ +¤³¤Î´Ø¿ô¤Ï¡Ö²áµî¤Î̾»Ä (LEGACY)¡×¤È°ÌÃÖÉÕ¤±¤é¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2008 ¤Ç¤Ï¡¢ +.BR gcvt () +¤Î»ÅÍͤϺï½ü¤µ¤ì¡¢ +Âå¤ï¤ê¤Ë +.BR sprintf (3) +¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë +.RB ( snprintf (3) +¤ÎÊý¤¬Å¬ÀÚ¤«¤â¤·¤ì¤Ê¤¤¤¬)¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ecvt (3), +.BR fcvt (3), +.BR sprintf (3) diff --git a/release/man3/getaddrinfo.3 b/release/man3/getaddrinfo.3 new file mode 100644 index 00000000..64596632 --- /dev/null +++ b/release/man3/getaddrinfo.3 @@ -0,0 +1,844 @@ +.\" Copyright (c) 2007, 2008 Michael Kerrisk +.\" and Copyright (c) 2006 Ulrich Drepper +.\" A few pieces of an earlier version remain: +.\" Copyright 2000, Sam Varshavchik +.\" +.\" 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: RFC 2553 +.\" +.\" 2005-08-09, mtk, added AI_ALL, AI_ADDRCONFIG, AI_V4MAPPED, +.\" and AI_NUMERICSERV. +.\" 2006-11-25, Ulrich Drepper +.\" Add text describing Internationalized Domain Name extensions. +.\" 2007-06-08, mtk: added example programs +.\" 2008-02-26, mtk; clarify discussion of NULL 'hints' argument; other +.\" minor rewrites. +.\" 2008-06-18, mtk: many parts rewritten +.\" 2008-12-04, Petr Baudis +.\" Describe results ordering and reference /etc/gai.conf. +.\" FIXME . glibc's 2.9 NEWS file documents DCCP and UDP-lite support +.\" and is SCTP support now also there? +.\" +.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. +.\" Translated Sun Jan 14 2001 by NAKANO Takeo +.\" Updated 2005-10-09 by Kentaro Shirakata +.\" Updated 2007-01-01 by Kentaro Shirakata +.\" Updated 2007-06-13, Akihiro MOTOKI , LDP v2.55 +.\" Updated 2008-04-04, Akihiro MOTOKI, LDP v2.79 +.\" Updated 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" Updated 2008-12-26, Akihiro MOTOKI, LDP v3.15 +.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24 +.\" +.\"WORD: null pointer ¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿ +.\" +.TH GETADDRINFO 3 2009-09-03 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getaddrinfo, freeaddrinfo, gai_strerror \- +¥Í¥Ã¥È¥ï¡¼¥¯¤Î¥¢¥É¥ì¥¹¤È¥µ¡¼¥Ó¥¹¤òÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int getaddrinfo(const char *" "node" ", const char *" "service" , +.BI " const struct addrinfo *" "hints" , +.BI " struct addrinfo **" "res" ); +.sp +.BI "void freeaddrinfo(struct addrinfo *" "res" ); +.sp +.BI "const char *gai_strerror(int " "errcode" ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.ad l +.in +.sp +.BR getaddrinfo (), +.BR freeaddrinfo (), +.BR gai_strerror (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +.BR getaddrinfo () +¤Ï¡¢(¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î¥Û¥¹¥È¤È¥µ¡¼¥Ó¥¹¤ò¼±Ê̤¹¤ë) +.I node +¤È +.I service +¤òÅϤ¹¤È¡¢°ì¤Ä°Ê¾å¤Î +.I addrinfo +¹½Â¤ÂΤòÊÖ¤¹¡£¤½¤ì¤¾¤ì¤Î +.I addrinfo +¹½Â¤ÂΤˤϡ¢ +.BR bind (2) +¤ä +.BR connect (2) +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë»ØÄê¤Ç¤­¤ë¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹¤¬³ÊǼ¤µ¤ì¤Æ¤¤¤ë¡£ +.BR getaddrinfo () +´Ø¿ô¤Ï¡¢ +.\" .BR getipnodebyname (3), +.\" .BR getipnodebyaddr (3), +.BR getservbyname (3) +¤È +.BR getservbyport (3) +¤Îµ¡Ç½¤ò¤Þ¤È¤á¤Æ°ì¤Ä¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¤¬¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤È°ã¤¤¡¢ +.BR getaddrinfo () +¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤¢¤ê¡¢ +.BR getaddrinfo () +¤ò»È¤¦¤³¤È¤Ç¥×¥í¥°¥é¥à¤Ï IPv4 ¤È IPv6 ¤Î°ã¤¤¤Ë´Ø¤¹¤ë°Í¸´Ø·¸¤ò +¤Ê¤¯¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.BR getaddrinfo () +¤¬ÍѤ¤¤ë +.I addrinfo +¹½Â¤ÂΤϰʲ¼¤Î¥Õ¥£¡¼¥ë¥É¤ò´Þ¤à¡£ +.sp +.in +4n +.nf +struct addrinfo { + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + size_t ai_addrlen; + struct sockaddr *ai_addr; + char *ai_canonname; + struct addrinfo *ai_next; +}; +.fi +.in +.PP +.I hints +°ú¤­¿ô¤Ï +.I addrinfo +¹½Â¤ÂΤò»Ø¤·¼¨¤·¡¢¤³¤Î¹½Â¤ÂΤòÍѤ¤¤Æ +.I res +¤¬»Ø¤¹¥ê¥¹¥È¤ËÆþ¤ì¤ÆÊÖ¤¹¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¹½Â¤ÂΤòÁªÂò¤¹¤ë¤¿¤á¤Î´ð½à¤ò»ØÄꤹ¤ë¡£ +.I hints +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I hints +¤Ï +.I addrinfo +¹½Â¤ÂΤò»Ø¤·¼¨¤·¡¢¤½¤Î¹½Â¤ÂΤΥե£¡¼¥ë¥É +.IR ai_family , +.IR ai_socktype , +.I ai_protocol +¤Ç +.BR getaddrinfo () +¤¬ÊÖ¤¹¥½¥±¥Ã¥È¥¢¥É¥ì¥¹½¸¹ç¤ËÂФ¹¤ë´ð½à¤ò»ØÄꤹ¤ë¡£ +.TP 12 +.I ai_family +¤³¤Î¥Õ¥£¡¼¥ë¥É¤ÏÊÖ¤µ¤ì¤ë¥¢¥É¥ì¥¹¤Î´õ˾¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë»ØÄê¤Ç¤­¤ëÍ­¸ú¤ÊÃͤȤ·¤Æ¤Ï +.B AF_INET +¤È +.B AF_INET6 +¤¬¤¢¤ë¡£ +¤Þ¤¿¡¢ÃÍ +.B AF_UNSPEC +¤ò»ØÄꤹ¤ë¤È¡¢ +.BR getaddrinfo () +¤Ï +.I node +¤È +.I service +¤Ç»ÈÍѤǤ­¤ë¤¤¤º¤ì¤«¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼ (Î㤨¤Ð IPv4 ¤« IPv6) ¤Î +¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤òÊÖ¤¹¤³¤È¤òµá¤á¤é¤ì¤ë¡£ +.TP +.I ai_socktype +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¿ä¾©¤Î¥½¥±¥Ã¥È·¿ (Î㤨¤Ð +.B SOCK_STREAM +¤ä +.BR SOCK_DGRAM ) +¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤ò»ØÄꤹ¤ë¤È¡¢Ç¤°Õ¤Î¥½¥±¥Ã¥È·¿¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ò +.BR getaddrinfo () +¤¬ÊÖ¤·¤Æ¤è¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.TP +.I ai_protocol +¤³¤Î¥Õ¥£¡¼¥ë¥É¤ÏÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Î¥×¥í¥È¥³¥ë¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤ò»ØÄꤹ¤ë¤È¡¢Ç¤°Õ¤Î¥×¥í¥È¥³¥ë¤Î¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ò +.BR getaddrinfo () +¤¬ÊÖ¤·¤Æ¤è¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.TP +.I ai_flags +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢ÄɲäΥª¥×¥·¥ç¥ó (²¼µ­) ¤ò»ØÄꤹ¤ë¡£ +Ê£¿ô¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ëºÝ¤Ë¤Ï¡¢¤½¤ì¤é¤ÎÏÀÍý OR ¤ò¤È¤Ã¤Æ»ØÄꤹ¤ë¡£ +.PP +.I hints +¤¬»Ø¤·¼¨¤¹¹½Â¤ÂΤξ¤Î¤¹¤Ù¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï +0 ¤« NULL ¥Ý¥¤¥ó¥¿¤òŬÀÚ¤ËÆþ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I hints +¤Ë NULL ¤ò»ØÄꤹ¤ë¤Î¤Ï¡¢ +.I ai_socktype +¤È +.I ai_protocol +¤Ë 0 ¤ò¡¢ +.I ai_family +¤Ë +.B AF_UNSPEC +¤ò¡¢ +.I ai_flags +¤Ë +.B "(AI_V4MAPPED\ |\ AI_ADDRCONFIG)" +¤òÀßÄꤹ¤ë¤Î¤ÈÅù²Á¤Ç¤¢¤ë¡£ + +.I node +¤Ë¤Ï¡¢¿ôÃÍ·Á¼°¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹ +(IPv4 ¤Î¾ì¹ç¤Ï +.BR inet_aton (3) +¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥É¥Ã¥È¶èÀÚ¤ê¤Î¿ô»ú¤Ë¤è¤ëɽµ­¡¢ +IPv6 ¤Î¾ì¹ç¤Ï +.BR inet_pton (3) +¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë 16 ¿Ê¿ô¤Îʸ»úÎó·Á¼°) ¤â¤·¤¯¤Ï +¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È̾¤ò»ØÄꤹ¤ë¡£ +¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È̾¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¸¡º÷¤µ¤ì¡¢ +̾Á°²ò·è¤¬¹Ô¤Ê¤ï¤ì¤ë¡£ +.I hints.ai_flags +¤Ë +.B AI_NUMERICHOST +¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.I node +¤Ï¿ôÃÍ·Á¼°¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B AI_NUMERICHOST +¥Õ¥é¥°¤ò»È¤¦¤È¡¢»þ´Ö¤Î³Ý¤«¤ë²ÄǽÀ­¤Î¤¢¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¥¢¥É¥ì¥¹¤Î¸¡º÷¤Ï +¤¹¤Ù¤ÆÍÞÀ©¤µ¤ì¤ë¡£ +.PP +.IR hints.ai_flags +¤Ë +.B AI_PASSIVE +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¡¢¤«¤Ä +.I node +¤¬ NULL ¤Î¾ì¹ç¡¢ +ÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï +¥³¥Í¥¯¥·¥ç¥ó¤ò +.BR accept (2) +¤¹¤ë¤¿¤á¤Î¥½¥±¥Ã¥È¤ò +.BR bind (2) +¤¹¤ë¤Î¤ËŬ¤·¤¿¤â¤Î¤È¤Ê¤ë¡£ +ÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ë¤Ï¡Ö¥ï¥¤¥ë¥É¥«¡¼¥É¡¦¥¢¥É¥ì¥¹¡× +(IPv4 ¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï +.BR INADDR_ANY ¡¢ +IPv6 ¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï +.BR IN6ADDR_ANY_INIT ) +¤¬Æþ¤ë¡£ +¥ï¥¤¥ë¥É¥«¡¼¥É¡¦¥¢¥É¥ì¥¹¤Ï¡¢Ç¤°Õ¤Î¥Û¥¹¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ÇÀܳ¤ò +¼õ¤±ÉÕ¤±¤è¤¦¤È¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó (Ä̾ï¤Ï¥µ¡¼¥Ð¡¼) ¤ÇÍѤ¤¤é¤ì¤ë¡£ +.I node +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.B AI_PASSIVE +¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë¡£ +.PP +.I hints.ai_flags +¤Ë +.B AI_PASSIVE +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +ÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï +.BR connect (2), +.BR sendto (2), +.BR sendmsg (2) +¤Ç¤Î»ÈÍѤËŬ¤·¤¿¤â¤Î¤È¤Ê¤ë¡£ +.I node +¤¬ NULL ¤Î¾ì¹ç¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ë¤Ï¥ë¡¼¥×¥Ð¥Ã¥¯¡¦¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Î +¥¢¥É¥ì¥¹ (IPv4 ¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï +.BR INADDR_LOOPBACK +IPv6 ¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï +.BR IN6ADDR_LOOPBACK_INIT ) ¤¬ÀßÄꤵ¤ì¤ë¡£ +¤³¤ì¤ÏƱ¤¸¥Û¥¹¥È¾å¤ÇÆ°ºî¤·¤Æ¤¤¤ëÀܳÁê¼ê¤ÈÄÌ¿®¤¹¤ë¤è¤¦¤Ê +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÍѤ¤¤é¤ì¤ë¡£ +.PP +.I service +¤Ë¤è¤ê¡¢ÊÖ¤µ¤ì¤ë³Æ¥¢¥É¥ì¥¹¹½Â¤ÂΤΥݡ¼¥ÈÈֹ椬·è¤Þ¤ë¡£ +¤³¤Î°ú¤­¿ô¤¬¥µ¡¼¥Ó¥¹Ì¾ +.RB ( services (5) +»²¾È) ¤Î¾ì¹ç¡¢Âбþ¤¹¤ë¥Ý¡¼¥ÈÈÖ¹æ¤ËËÝÌõ¤µ¤ì¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ë¤Ï 10 ¿Ê¿ô¤â»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¡¢ +¤³¤Î¾ì¹ç¤Ë¤Ï¥Ð¥¤¥Ê¥ê¤Ø¤ÎÊÑ´¹¤À¤±¤¬¹Ô¤ï¤ì¤ë¡£ +.I service +¤¬ NULL ¤Î¾ì¹ç¡¢ÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Î¥Ý¡¼¥ÈÈÖ¹æ¤Ï +½é´ü²½¤µ¤ì¤Ê¤¤¤Þ¤Þ¤È¤Ê¤ë¡£ +.I hints.ai_flags +¤Ë +.B AI_NUMERICSERV +¤¬»ØÄꤵ¤ì¡¢¤«¤Ä +.I service +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ +.I service +¤Ï¿ôÃͤΥݡ¼¥ÈÈÖ¹æ¤ò´Þ¤àʸ»úÎó¤ò»Ø¤·¼¨¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢Ì¾Á°²ò·è¥µ¡¼¥Ó¥¹¤¬ÉÔÍפǤ¢¤ë¤³¤È¤¬Ê¬¤«¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +¥µ¡¼¥Ó¥¹¤Îµ¯Æ°¤òÍÞÀ©¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +.I node +¤È +.I service +¤Î¤É¤Á¤é¤«¤Ï NULL ¤Ë¤·¤Æ¤è¤¤¤¬¡¢Î¾ÊýƱ»þ¤Ë NULL ¤Ë¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +.BR getaddrinfo () +´Ø¿ô¤Ï¡¢ +.I addrinfo +¹½Â¤ÂΤΥá¥â¥ê³ÎÊݤò¹Ô¤¤¡¢ +.I addrinfo +¹½Â¤ÂΤΥê¥ó¥¯¥ê¥¹¥È¤ò½é´ü²½¤·¡¢ +.I res +¤Ë¥ê¥¹¥È¤ÎÀèƬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÆþ¤ì¤ÆÊÖ¤¹¡£ +¤³¤Î¤È¤­¡¢³Æ¹½Â¤ÂΤΥͥåȥ¥¯¥¢¥É¥ì¥¹¤Ï +.I node +¤È +.I service +¤Ë°ìÃפ·¡¢ +.I hints +¤Ç²Ý¤µ¤ì¤¿¤¹¤Ù¤Æ¤ÎÀ©¸Â¤òËþ¤¿¤¹¤â¤Î¤È¤Ê¤ë¡£ +¥ê¥ó¥¯¥ê¥¹¥È¤ÎÍ×ÁÇ¤Ï +.I ai_next +¥Õ¥£¡¼¥ë¥É¤Ë¤è¤êÏ¢·ë¤µ¤ì¤ë¡£ + +¥ê¥ó¥¯¥ê¥¹¥È¤Î +.I addrinfo +¹½Â¤ÂΤÏÊ£¿ô¸Ä¤Ë¤Ê¤ë¤³¤È¤â¤¢¤ê¡¢¤½¤ÎÍýͳ¤Ï¤¤¤¯¤Ä¤«¤¢¤ë¡£ +¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤¬¥Þ¥ë¥Á¥Û¡¼¥à¤Ç¤¢¤ë¡¢ +Ê£¿ô¤Î¥×¥í¥È¥³¥ë¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë (Î㤨¤Ð +.B AF_INET +¤È +.B AF_INET6 +¤ÎξÊý) ¡¢ +Ê£¿ô¤Î¥½¥±¥Ã¥È¼ïÊ̤ÇƱ¤¸¥µ¡¼¥Ó¥¹¤¬ÍøÍѤǤ­¤ë +(Î㤨¤Ð¡¢¤Ò¤È¤Ä¤¬ +.B SOCK_STREM +¥¢¥É¥ì¥¹¤Ç¡¢¤â¤¦¤Ò¤È¤Ä¤¬ +.B SOCK_DGRAM +¥¢¥É¥ì¥¹¤Ç¤¢¤ë)¡¢¤¬¤¢¤ë¡£ +Ä̾ï¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÏÊÖ¤µ¤ì¤¿½ç½ø¤Ç¥¢¥É¥ì¥¹¤ò»î¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.BR getaddrinfo () +¤ÎÃæ¤Ç»ÈÍѤµ¤ì¤ëʤÙÂؤ¨´Ø¿ô¤Ï RFC\ 3484 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +Æüì¤Ê¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I /etc/gai.conf +¤òÊÔ½¸¤¹¤ë¤³¤È¤Ç¡¢¤³¤Î½ç½ø¤òÈùÄ´À°¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.RI ( /etc/gai.conf +¤Ï glibc 2.5 °Ê¹ß¤ÇÍøÍѤǤ­¤ë)¡£ +.PP +.I hints.ai_flags +¤Ë +.B AI_CANONNAME +¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ÊÖ¤µ¤ì¤ë¥ê¥¹¥È¤ÎºÇ½é¤Î +.I addrinfo +¹½Â¤ÂΤΠ+.I ai_canonname +¥Õ¥£¡¼¥ë¥É¤Ï¥Û¥¹¥È¤Î¸ø¼°¤Ê̾Á°¤ò»Ø¤¹¤è¤¦¤ËÀßÄꤵ¤ì¤ë¡£ +.\" In glibc prior to 2.3.4, the ai_canonname of each addrinfo +.\" structure was set pointing to the canonical name; that was +.\" more than POSIX.1-2001 specified, or other implementations provided. +.\" MTK, Aug 05 + +ÊÖ¤µ¤ì¤ë³Æ¡¹¤Î +.I addrinfo +¹½Â¤ÂΤλĤê¤Î¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤Î¤è¤¦¤Ë½é´ü²½¤µ¤ì¤ë¡£ +.IP * 2 +.IR ai_family , +.IR ai_socktype , +.I ai_protocol +¥Õ¥£¡¼¥ë¥É¤Ï¥½¥±¥Ã¥ÈÀ¸À®¥Ñ¥é¥á¡¼¥¿¤òÊÖ¤¹ +(¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Î°ÕÌ£¤Ï +.BR socket (2) +¤ÎƱ¤¸Ì¾Á°¤Î°ú¤­¿ô¤ÈƱ¤¸¤Ç¤¢¤ë)¡£ +Î㤨¤Ð¡¢ +.I ai_family +¤Ï +.B AF_INET +¤ä +.B AF_INET6 +¤òÊÖ¤·¡¢ +.I ai_socktype +¤Ï +.B SOCK_DGRAM +¤ä +.BR SOCK_STREAM +¤òÊÖ¤·¡¢ +.I ai_protocol +¤Ï¤½¤Î¥½¥±¥Ã¥È¤Î¥×¥í¥È¥³¥ë¤òÊÖ¤¹¡£ +.IP * +.I ai_addr +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬½ñ¤­¹þ¤Þ¤ì¡¢ +.I ai_addrlen +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ÎŤµ¤¬¥Ð¥¤¥Èñ°Ì¤Ç½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.PP +.I hints.ai_flags +¤¬ +.B AI_ADDRCONFIG +¤ò´Þ¤à¾ì¹ç¡¢ +.I res +¤¬»Ø¤¹¥ê¥¹¥È¤Ë¤Ï¡¢ +¥í¡¼¥«¥ë¥·¥¹¥Æ¥à¤ËºÇÄã°ì¤Ä¤Î IPv4 ¥¢¥É¥ì¥¹¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï +IPv4 ¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¡¢ +¥í¡¼¥«¥ë¥·¥¹¥Æ¥à¤ËºÇÄã°ì¤Ä¤Î IPv6 ¥¢¥É¥ì¥¹¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï +IPv6 ¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.I hint.ai_flags +¤Ë +.B AI_V4MAPPED +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.I hints.ai_family +¤Ë +.B AF_INET6 +¤¬»ØÄꤵ¤ì¡¢ +¥Þ¥Ã¥Á¤¹¤ë IPv6 ¥¢¥É¥ì¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.I res +¤¬»Ø¤¹¥ê¥¹¥È¤Ë¤Ï IPv4-mapped IPv6 ¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¤ë¡£ +.I hints.ai_family +¤Ë +.B AI_V4MAPPED +¤È +.B AI_ALL +¤ÎξÊý¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.I res +¤¬»Ø¤¹¥ê¥¹¥È¤Ë¤Ï IPv6 ¥¢¥É¥ì¥¹¤È IPv4-mapped IPv6 ¥¢¥É¥ì¥¹¤Î +ξÊý¤¬ÊÖ¤µ¤ì¤ë¡£ +.B AI_V4MAPPED +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.B AI_ALL +¤Ï̵»ë¤µ¤ì¤ë¡£ +.PP +.BR freeaddrinfo () +´Ø¿ô¤Ï¡¢ +¥ê¥ó¥¯¥ê¥¹¥È +.I res +¤ËÂФ·¤ÆưŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£ +.SS "¹ñºÝ²½¥É¥á¥¤¥ó̾¤Î¤¿¤á¤Î getaddrinfo() ¤Î³ÈÄ¥" +.PP +glibc 2.3.4 ¤«¤é¡¢ +.BR getaddrinfo () +¤ÏÆþ½ÐÎϤ¹¤ë¥Û¥¹¥È̾¤òÆ©²áŪ¤Ë¹ñºÝ²½¥É¥á¥¤¥ó̾ (IDN) ·Á¼° (RFC 3490 ¤Î +.I "Internationalizing Domain Names in Applications (IDNA)" +¤ò»²¾È¤Î¤³¤È) ¤ÈÊÑ´¹¤¹¤ë¤³¤È¤òÁªÂòŪ¤Ëǧ¤á¤ë¤è¤¦¤Ë³ÈÄ¥¤µ¤ì¤Æ¤¤¤ë¡£ +4 ¤Ä¤Î¿·¤·¤¤¥Õ¥é¥°¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.TP +.B AI_IDN +¤³¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤ë¤È¡¢ +.I node +¤ÇÍ¿¤¨¤é¤ì¤¿¥Î¡¼¥É̾¤ÏɬÍפ¬¤¢¤ì¤Ð IDN ·Á¼°¤ËÊÑ´¹¤µ¤ì¤ë¡£ +¥½¡¼¥¹Éä¹æ²½·Á¼°¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î¤â¤Î¤Ç¤¢¤ë¡£ + +ÆþÎÏ̾¤ËÈó ASCII ʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +IDN Éä¹æ²½·Á¼°¤¬»È¤ï¤ì¤ë¡£ +Èó ASCII ʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë(¥Ô¥ê¥ª¥É¤Ç¶èÀÚ¤é¤ì¤ë)Éôʬ¥Î¡¼¥É̾¤Ï¡¢ +̾Á°²ò·èµ¡Ç½¤ËÅϤµ¤ì¤ëÁ°¤Ë ASCII ¸ß´¹Éä¹æ²½·Á¼° (ACE) ¤ò»È¤Ã¤Æ +Éä¹æ²½¤µ¤ì¤ë¡£ +.\" Implementation Detail: +.\" To minimize effects on system performance the implementation might +.\" want to check whether the input string contains any non-ASCII +.\" characters. If there are none the IDN step can be skipped completely. +.\" On systems which allow not-ASCII safe encodings for a locale this +.\" might be a problem. +.TP +.B AI_CANONIDN +.B AI_CANONNAME +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR getaddrinfo () +¤Ï̾Á°¤Î¸¡º÷¤ËÀ®¸ù¤·¤¿¸å¡¢ +ÊÖ¤µ¤ì¤¿ +.I addrinfo +¹½Â¤ÂΤËÂбþ¤¹¤ë¥Î¡¼¥É¤ÎÀµµ¬Ì¾¤òÊÖ¤¹¡£ +ÊÖ¤êÃͤÏ̾Á°²ò·èµ¡Ç½¤«¤éÊÖ¤µ¤ì¤¿ÃͤÎÀµ³Î¤Ê¥³¥Ô¡¼¤Ç¤¢¤ë¡£ + +.B AI_CANONIDN +̾Á°¤¬ ACE ¤ÇÉä¹æ²½¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢°ì¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î̾Á°¤Î¹½À®Í×ÁǤÎÀèƬ¤Ë +.I xn\-\- +¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +¤³¤ì¤é¤Î¹½À®Í×ÁǤòÆɤ߹þ¤ß²Äǽ¤Ê·Á¤ËÊÑ´¹¤¹¤ë¤¿¤á¤Ë¡¢ +.B AI_CANONNAME +¤È¶¦¤Ë +.B AI_CANONIDN +¥Õ¥é¥°¤òÅϤ¹¤³¤È¤â½ÐÍè¤ë¡£ +ÊÖ¤µ¤ì¤ëʸ»úÎó¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤ÎÉä¹æ²½·Á¼°¤ÇÉä¹æ²½¤µ¤ì¤Æ¤¤¤ë¡£ +.\" +.\"Implementation Detail: +.\"If no component of the returned name starts with xn\-\- the IDN +.\"step can be skipped, therefore avoiding unnecessary slowdowns. +.TP +.BR AI_IDN_ALLOW_UNASSIGNED ", " AI_IDN_USE_STD3_ASCII_RULES +¤³¤ì¤é¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤ë¤È¡¢ +IDNA ¥Ï¥ó¥É¥ê¥ó¥°¤ò»È¤¦¤È¤­¤Ë¤½¤ì¤¾¤ì +IDNA_ALLOW_UNASSIGNED (Èó³ä¤êÅö¤Æ Unicode ¥³¡¼¥É¥Ý¥¤¥ó¥È¤òµö²Ä¤¹¤ë) ¤È +IDNA_USE_STD3_ASCII_RULES (½ÐÎϤ¬ STD3 ½àµò¥Û¥¹¥È̾¤Ç¤¢¤ë¤³¤È¤ò³Îǧ¤¹¤ë) +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤ë¡£ + +.SH ÊÖ¤êÃÍ +.\" FIXME glibc defines the following additional errors, some which +.\" can probably be returned by getaddrinfo(); they need to +.\" be documented. +.\" #ifdef __USE_GNU +.\" #define EAI_INPROGRESS -100 /* Processing request in progress. */ +.\" #define EAI_CANCELED -101 /* Request canceled. */ +.\" #define EAI_NOTCANCELED -102 /* Request not canceled. */ +.\" #define EAI_ALLDONE -103 /* All requests done. */ +.\" #define EAI_INTR -104 /* Interrupted by a signal. */ +.\" #define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ +.\" #endif +.BR getaddrinfo () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤¹¤ë¤È°Ê²¼¤ÎÈó 0 ¤Î¥¨¥é¡¼¥³¡¼¥É¤Î¤¤¤º¤ì¤«¤òÊÖ¤¹¡£ +.TP +.B EAI_ADDRFAMILY +.\" Not in SUSv3 +»ØÄꤵ¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Ë¤Ï¡¢ +Í׵ᤵ¤ì¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¤Ê¤¤¡£ +.TP +.B EAI_AGAIN +¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é°ì»þŪ¤Ê¼ºÇÔ (temporary failure) +¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£¸å¤Ç¤â¤¦°ìÅٻ¤Æ¤ß¤è¡£ +.TP +.B EAI_BADFLAGS +.I hints.ai_flags +¤Î¥Õ¥é¥°¤ËÉÔÀµ¤Ê¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£¤Þ¤¿¤Ï¡¢ +.I hints.ai_flags +¤Ë +.B AI_CANONNAME +¤¬´Þ¤Þ¤ì¤Æ¤¤¤Æ¡¢¤«¤Ä +.I name +¤¬ NULL ¤Ç¤¢¤Ã¤¿¡£ +.TP +.B EAI_FAIL +¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é¹±µ×Ū¤Ê¼ºÇÔ (permanent failure) +¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£ +.TP +.B EAI_FAMILY +Í׵ᤵ¤ì¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EAI_MEMORY +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B EAI_NODATA +.\" Not in SUSv3 +»ØÄꤵ¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Ï¸ºß¤¹¤ë¤¬¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¤Ò¤È¤Ä¤âÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EAI_NONAME +.I node +¤È +.I service +¤Î¤É¤Á¤é¤«¤¬ÉÔÌÀ¡¢¤Þ¤¿¤Ï +.I node +¤È +.I service +¤ÎξÊý¤¬ NULL ¤À¤Ã¤¿¾ì¹ç¡¢¤Þ¤¿¤Ï +.B AI_NUMERICSERV +¤¬ +.I hints.ai_flags +¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.I hints.ai_flags +¤È +.I service +¤¬¿ôÃͤΥݡ¼¥ÈÈÖ¹æ¤Îʸ»úÎó¤Ç¤Ê¤¤¡£ +.TP +.B EAI_SERVICE +Í׵ᤵ¤ì¤¿¥µ¡¼¥Ó¥¹¤Ï¡¢Í׵ᤵ¤ì¤¿¥½¥±¥Ã¥È¥¿¥¤¥×¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +¾¤Î¥½¥±¥Ã¥È¥¿¥¤¥×¤Ç¤Ê¤éÍøÍѲÄǽ¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ëÎã¤È¤·¤Æ¤Ï¡¢ +.I service +¤¬ "shell" (¥¹¥È¥ê¡¼¥à¡¦¥½¥±¥Ã¥È¤Ç¤Î¤ßÍøÍѤǤ­¤ë¥µ¡¼¥Ó¥¹) ¤Ç¡¢ +.I hints.ai_protocol +¤Ë +.B IPPROTO_UDP +¤¬»ØÄꤵ¤ì¤¿¤ê¡¢ +.I hints.ai_socktype +¤Ë +.B SOCK_DGRAM +¤¬»ØÄꤵ¤ì¤¿¤ê¤·¤¿¾ì¹ç¤¬¤¢¤ë¡£ +¤Þ¤¿¡¢ +.I service +¤¬ NULL °Ê³°¤Ç¡¢ +.I hints.ai_socktype +¤Ë +.B SOCK_RAW +(¥µ¡¼¥Ó¥¹¤Î¹Í¤¨Êý¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¼ïÊÌ) +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤â¡¢¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¡£ +.TP +.B EAI_SOCKTYPE +Í׵ᤵ¤ì¤¿¥½¥±¥Ã¥È¥¿¥¤¥×¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ëÎã¤È¤·¤Æ¤Ï¡¢ +.I hints.ai_socktype +¤È +.I hints.ai_protocol +¤¬Ì·½â¤·¤Æ¤¤¤ë¾ì¹ç (Î㤨¤Ð +.I hints.ai_socktype +¤¬ +.B SOCK_DGRAM +¤Ç +.I hints.ai_protocol +¤¬ +.BR IPPROTO_TCP ) +¤¬¤¢¤ë¡£ +.TP +.B EAI_SYSTEM +¤½¤Î¾¤Î¥·¥¹¥Æ¥à¥¨¥é¡¼¡£¾Ü¤·¤¯¤Ï +.I errno +¤òÄ´¤Ù¤ë¤³¤È¡£ +.PP +.BR gai_strerror () +´Ø¿ô¤òÍѤ¤¤ë¤È¡¢¤³¤ì¤é¤Î¥¨¥é¡¼¥³¡¼¥É¤ò¿Í´Ö¤Ë²ÄÆɤÊʸ»úÎó¤ËÊÑ´¹¤Ç¤­¤ë¤Î¤Ç¡¢ +¥¨¥é¡¼Êó¹ð¤ËŬ¤¹¤ë¤À¤í¤¦¡£ +.SH ¥Õ¥¡¥¤¥ë +.I /etc/gai.conf +.SH ½àµò +POSIX.1-2001. +.BR getaddrinfo () +´Ø¿ô¤Ï RFC 2553 ¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.BR getaddrinfo () +¤Ï¡¢IPv6 scope-ID ¤ò»ØÄꤹ¤ë¤¿¤á¤Ë +.IB address % scope-id +µ­Ë¡¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ + +.BR AI_ADDRCONFIG , +.BR AI_ALL , +.B AI_V4MAPPED +¤Ï glibc 2.3.3 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.B AI_NUMERICSERV +¤Ï glibc 2.3.4 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ + +POSIX.1-2001 ¤Ë¤è¤ë¤È¡¢ +.I hints +¤Ë NULL ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.I ai_flags +¤ò 0 ¤È¤ß¤Ê¤¹¤Ù¤­¤È¤µ¤ì¤Æ¤¤¤ë¡£ +GNU C ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¡¢Âå¤ï¤ê¤Ë +.I ai_flags +¤ò +.BR "(AI_V4MAPPED\ |\ AI_ADDRCONFIG)" +¤È¤ß¤Ê¤¹¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤³¤ÎÃͤÎÊý¤¬É¸½àµ¬³Ê¤Î²þÁ±¤Ë¤Ê¤ë¤È¹Í¤¨¤é¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +.SH Îã +.\" getnameinfo.3 refers to this example +.\" socket.2 refers to this example +.\" bind.2 refers to this example +.\" connect.2 refers to this example +.\" recvfrom.2 refers to this example +.\" sendto.2 refers to this example +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +.BR getaddrinfo (), +.BR gai_strerror (), +.BR freeaddrinfo (), +.BR getnameinfo (3) +¤Î»È¤¤Êý¤ò¼¨¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¥×¥í¥°¥é¥à¤Ï UDP ¥Ç¡¼¥¿¥°¥é¥à¤Î echo ¥µ¡¼¥Ð¤È¥¯¥é¥¤¥¢¥ó¥È¤Ç¤¢¤ë¡£ +.SS ¥µ¡¼¥Ð¤Î¥×¥í¥°¥é¥à +\& +.nf +#include +#include +#include +#include +#include +#include +#include + +#define BUF_SIZE 500 + +int +main(int argc, char *argv[]) +{ + struct addrinfo hints; + struct addrinfo *result, *rp; + int sfd, s; + struct sockaddr_storage peer_addr; + socklen_t peer_addr_len; + ssize_t nread; + char buf[BUF_SIZE]; + + if (argc != 2) { + fprintf(stderr, "Usage: %s port\\n", argv[0]); + exit(EXIT_FAILURE); + } + + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ + hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */ + hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */ + hints.ai_protocol = 0; /* Any protocol */ + hints.ai_canonname = NULL; + hints.ai_addr = NULL; + hints.ai_next = NULL; + + s = getaddrinfo(NULL, argv[1], &hints, &result); + if (s != 0) { + fprintf(stderr, "getaddrinfo: %s\\n", gai_strerror(s)); + exit(EXIT_FAILURE); + } + + /* getaddrinfo() returns a list of address structures. + Try each address until we successfully bind(2). + If socket(2) (or bind(2)) fails, we (close the socket + and) try the next address. */ + + for (rp = result; rp != NULL; rp = rp\->ai_next) { + sfd = socket(rp\->ai_family, rp\->ai_socktype, + rp\->ai_protocol); + if (sfd == \-1) + continue; + + if (bind(sfd, rp\->ai_addr, rp\->ai_addrlen) == 0) + break; /* Success */ + + close(sfd); + } + + if (rp == NULL) { /* No address succeeded */ + fprintf(stderr, "Could not bind\\n"); + exit(EXIT_FAILURE); + } + + freeaddrinfo(result); /* No longer needed */ + + /* Read datagrams and echo them back to sender */ + + for (;;) { + peer_addr_len = sizeof(struct sockaddr_storage); + nread = recvfrom(sfd, buf, BUF_SIZE, 0, + (struct sockaddr *) &peer_addr, &peer_addr_len); + if (nread == \-1) + continue; /* Ignore failed request */ + + char host[NI_MAXHOST], service[NI_MAXSERV]; + + s = getnameinfo((struct sockaddr *) &peer_addr, + peer_addr_len, host, NI_MAXHOST, + service, NI_MAXSERV, NI_NUMERICSERV); + if (s == 0) + printf("Received %ld bytes from %s:%s\\n", + (long) nread, host, service); + else + fprintf(stderr, "getnameinfo: %s\\n", gai_strerror(s)); + + if (sendto(sfd, buf, nread, 0, + (struct sockaddr *) &peer_addr, + peer_addr_len) != nread) + fprintf(stderr, "Error sending response\\n"); + } +} +.fi +.SS ¥¯¥é¥¤¥¢¥ó¥È¤Î¥×¥í¥°¥é¥à +\& +.nf +#include +#include +#include +#include +#include +#include +#include + +#define BUF_SIZE 500 + +int +main(int argc, char *argv[]) +{ + struct addrinfo hints; + struct addrinfo *result, *rp; + int sfd, s, j; + size_t len; + ssize_t nread; + char buf[BUF_SIZE]; + + if (argc < 3) { + fprintf(stderr, "Usage: %s host port msg...\\n", argv[0]); + exit(EXIT_FAILURE); + } + + /* Obtain address(es) matching host/port */ + + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ + hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */ + hints.ai_flags = 0; + hints.ai_protocol = 0; /* Any protocol */ + + s = getaddrinfo(argv[1], argv[2], &hints, &result); + if (s != 0) { + fprintf(stderr, "getaddrinfo: %s\\n", gai_strerror(s)); + exit(EXIT_FAILURE); + } + + /* getaddrinfo() returns a list of address structures. + Try each address until we successfully connect(2). + If socket(2) (or connect(2)) fails, we (close the socket + and) try the next address. */ + + for (rp = result; rp != NULL; rp = rp\->ai_next) { + sfd = socket(rp\->ai_family, rp\->ai_socktype, + rp\->ai_protocol); + if (sfd == \-1) + continue; + + if (connect(sfd, rp\->ai_addr, rp\->ai_addrlen) != \-1) + break; /* Success */ + + close(sfd); + } + + if (rp == NULL) { /* No address succeeded */ + fprintf(stderr, "Could not connect\\n"); + exit(EXIT_FAILURE); + } + + freeaddrinfo(result); /* No longer needed */ + + /* Send remaining command\-line arguments as separate + datagrams, and read responses from server */ + + for (j = 3; j < argc; j++) { + len = strlen(argv[j]) + 1; + /* +1 for terminating null byte */ + + if (len + 1 > BUF_SIZE) { + fprintf(stderr, + "Ignoring long message in argument %d\\n", j); + continue; + } + + if (write(sfd, argv[j], len) != len) { + fprintf(stderr, "partial/failed write\\n"); + exit(EXIT_FAILURE); + } + + nread = read(sfd, buf, BUF_SIZE); + if (nread == \-1) { + perror("read"); + exit(EXIT_FAILURE); + } + + printf("Received %ld bytes: %s\\n", (long) nread, buf); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.\" .BR getipnodebyaddr (3), +.\" .BR getipnodebyname (3) +.BR gethostbyname (3), +.BR getnameinfo (3), +.BR inet (3), +.BR hostname (7), +.BR ip (7) diff --git a/release/man3/getcwd.3 b/release/man3/getcwd.3 new file mode 100644 index 00000000..e0a0a508 --- /dev/null +++ b/release/man3/getcwd.3 @@ -0,0 +1,254 @@ +.\" 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 Wed Jul 21 22:35:42 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 18 Mar 1996 by Martin Schulze (joey@infodrom.north.de): +.\" Corrected description of getwd(). +.\" Modified Sat Aug 21 12:32:12 MET 1999 by aeb - applied fix by aj +.\" 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)¡× +.\" +.TH GETCWD 3 2009-03-31 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getcwd, getwd, get_current_dir_name \- ¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê̾¤Î¼èÆÀ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *getcwd(char *" buf ", size_t " size ); +.sp +.BI "char *getwd(char *" buf ); +.sp +.B "char *get_current_dir_name(void);" +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR getcwd (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR get_current_dir_name (): +_GNU_SOURCE +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤Î +ÀäÂХѥ¹Ì¾ (absolute pathname) ¤¬Æþ¤Ã¤¿Ê¸»úÎó¤òÊÖ¤¹¡£ +ÊÖ¤µ¤ì¤ëʸ»úÎó¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +¥Ñ¥¹Ì¾¤Ï´Ø¿ô¤Î·ë²Ì¤È¤·¤ÆÊÖ¤µ¤ì¡¢°ú¿ô +.I buf +¤¬¤¢¤ë¾ì¹ç¤Ï +.I buf +·Ðͳ¤Ç¤âÊÖ¤µ¤ì¤ë¡£ + +.BR getcwd () +´Ø¿ô¤Ï¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ÎÀäÂХѥ¹Ì¾¤ò +.I buf +¤Ç¼¨¤µ¤ì¤¿ +.I size +ŤÎÇÛÎó¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +.PP +½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤â´Þ¤á¤¿¡¢¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤Î +ÀäÂХѥ¹Ì¾¤ÎŤµ¤¬ +.I size +¥Ð¥¤¥È¤òĶ¤¨¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ÊÖ¤êÃͤȤ·¤Æ NULL ¤¬ÊÖ¤ê +.I errno +¤Ë +.B ERANGE +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤Î¥¨¥é¡¼¤ò¥Á¥§¥Ã¥¯¤·¡¢ +ɬÍפ˱þ¤¸¤Æ¤è¤êŤ¤¥Ð¥Ã¥Õ¥¡¤òÍÑ°Õ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +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) +¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.BR get_current_dir_name () +¤Ï¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ÎÀäÂХѥ¹Ì¾¤ò¼ý¤á¤ë¤Î¤Ë +½½Ê¬¤ÊÂ礭¤µ¤ÎÇÛÎó¤ò +.BR malloc (3) +¤Ç³ÍÆÀ¤¹¤ë¡£´Ä¶­ÊÑ¿ô +.B PWD +¤¬ÀßÄꤵ¤ì¤Æ¤ª¤ê¤½¤ÎÃͤ¬Àµ¤·¤±¤ì¤Ð¡¢¤½¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·Â¦¤Ç¡¢ÊÖ¤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ò +.BR free (3) +¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.BR getwd () +¤Ï +.BR malloc (3) +¤Ë¤è¤ë¥á¥â¥ê³ÍÆÀ¤ò°ìÀڹԤʤï¤Ê¤¤¡£ +.I buf +°ú¿ô¤Ï¾¯¤Ê¤¯¤È¤â +.B PATH_MAX +¥Ð¥¤¥È¤ÎŤµ¤ò»ý¤ÄÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ëɬÍפ¬¤¢¤ë¡£ +½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤â´Þ¤á¤¿¡¢¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤Î +ÀäÂХѥ¹Ì¾¤ÎŤµ¤¬ +.B PATH_MAX +¥Ð¥¤¥È¤òĶ¤¨¤Æ¤¤¤ë¾ì¹ç¡¢ +NULL ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤Ë +.B ENAMETOOLONG +¤¬ÀßÄꤵ¤ì¤ë¡£ +(¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢ +.B PATH_MAX +¤Ïɬ¤º¤·¤â¥³¥ó¥Ñ¥¤¥ë»þ¤Ë·è¤Þ¤ëÄê¿ô¤Ç¤Ï¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤Þ¤¿¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¾ì¹ç¤â¤¢¤ë¡£ +.BR pathconf (3) +¤ò»²¾È¡£) +°Ü¿¢À­¤È¥»¥­¥å¥ê¥Æ¥£¾å¤ÎÍýͳ¤«¤é¡¢ +.BR getwd () +¤ÎÍøÍѤϿ侩¤µ¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ÎÀäÂХѥ¹Ì¾ +¤¬Æþ¤Ã¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.BR getcwd () +¤È +.BR getwd () +¤Î¾ì¹ç¡¢ÊÖ¤êÃÍ¤Ï +.I buf +¤ÈƱ¤¸Ãͤˤʤ롣 + +¼ºÇÔ¤·¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï NULL ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.I buf +¤¬»Ø¤¹ÇÛÎó¤ÎÆâÍƤÏ̤ÄêµÁ¤Ç¤¢¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¥Õ¥¡¥¤¥ë̾¤Î¹½À®Í×ÁǤËÂФ¹¤ëÆɤ߹þ¤ß¤¢¤ë¤¤¤Ï¸¡º÷¤Î¸¢¸Â¤¬¤Ê¤¤¡£ +.TP +.B EFAULT +.I buf +¤¬ÉÔÀµ¤Ê¥¢¥É¥ì¥¹¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I size +°ú¿ô¤¬ 0 ¤«¤Ä¡¢ +.I buf +°ú¿ô¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.BR getwd (): +.I buf +¤¬ NULL ¤Ç¤¢¤ë¡£ +.TP +.B ENAMETOOLONG +.BR getwd (): +ÀäÂХѥ¹Ì¾¤¬Æþ¤Ã¤¿ NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤ÎŤµ¤¬ +.B PATH_MAX +¥Ð¥¤¥È¤òĶ¤¨¤Æ¤¤¤ë¡£ +.TP +.B ENOENT +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ERANGE +.I size +°ú¿ô¤ÎÃͤ¬¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ÎÀäÂХѥ¹Ì¾¤ÎŤµ¤è¤ê¾®¤µ¤¤¡£ +Ťµ¤Ë¤Ïʸ»úÎó¤Î½ªÃ¼¥Ð¥¤¥È¤â´Þ¤Þ¤ì¤ë¡£ +¤è¤êÂ礭¤¤ÇÛÎó¤ò³ÎÊݤ·¤Æ¤â¤¦°ìÅټ¹Ԥ¹¤ëɬÍפ¬¤¢¤ë¡£ +.SH ½àµò +.BR getcwd () +¤Ï POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Ï¡¢ +.I buf +¤¬ NULL ¤Î¾ì¹ç¤Î +.BR getcwd () +¤ÎÆ°ºî¤òµ¬Äꤷ¤Ê¤¤¤Þ¤Þ¤È¤·¤Æ¤¤¤ë¡£ + +.BR getwd () +¤Ï POSIX.1-2001 ¤Ë¸ºß¤·¤Æ¤¤¤ë¤¬¡¢¡Ö²áµî¤Î̾»Ä(LEGACY)¡×¤È¤µ¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2008 ¤Ç¤Ï¡¢ +.BR getwd () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +Âå¤ï¤ê¤Ë +.BR getcwd () +¤ò»È¤¦¤³¤È¡£ +POSIX.1-2001 ¤Ï +.BR getwd () +¤Ë´Ø¤¹¤ë¥¨¥é¡¼¤òÄêµÁ¤·¤Æ¤¤¤Ê¤¤¡£ + +.BR get_current_dir_name () +¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +Linux ¤Ç¤Ï (2.1.92 °Ê¹ß)¡¢ +.BR getcwd () +¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£ +¸Å¤¤¥·¥¹¥Æ¥à¤Ç¤Ï +.I /proc/self/cwd +¤ò»²¾È¤¹¤ë¡£ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤â proc ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤â¤Ê¤¤¾ì¹ç¡¢ +°ìÈÌŪ¤Ê¼ÂÁõ¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +¤³¤Î¾ì¹ç¤Ë¤ª¤¤¤Æ¤Î¤ß¡¢(Linux ¤Ç¤Ï) ¤³¤Î´Ø¿ô¤Ï +.B EACCES +¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.LP +¤³¤ì¤é¤Î´Ø¿ô¤Ï¤·¤Ð¤·¤Ð¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤Î°ÌÃÖ¤òÊݸ¤·¡¢ +¸å¤ÇÌá¤Ã¤Æ¤¯¤ë¤¿¤á¤ËÍøÍѤµ¤ì¤ë¡£ +̤»ÈÍѤΥե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬½½Ê¬¤¢¤ë¾ì¹ç¤Ï¡¢ +¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê (".") ¤ò³«¤¤¤Æ +.BR fchdir (2) +¤ò¸Æ¤Ó½Ð¤¹¤Û¤¦¤¬ÉáÄ̤Ϲ⮤ǿ®ÍêÀ­¤¬¤¢¤ë¡£ +ÆÃ¤Ë Linux °Ê³°¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Î¾ì¹ç¤Ï¤½¤¦¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR chdir (2), +.BR fchdir (2), +.BR open (2), +.BR unlink (2), +.BR free (3), +.BR malloc (3) diff --git a/release/man3/getdate.3 b/release/man3/getdate.3 new file mode 100644 index 00000000..3aa790c6 --- /dev/null +++ b/release/man3/getdate.3 @@ -0,0 +1,295 @@ +.\" Copyright 2001 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" 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. +.\" +.\" 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 +.\" +.\"WORD: broken-down time Í×ÁÇÊ̤λþ¹ï +.\" +.TH GETDATE 3 2008-09-07 "" "Linux Programmer's Manual" +.SH ̾Á° +getdate, getdate_r \- ÆüÉդȻþ¹ï¤Îʸ»úÎó¤òÍ×ÁÇÊ̤λþ¹ï¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.B "#define _XOPEN_SOURCE 500" +.br +.B "#include " +.sp +.BI "struct tm *getdate(const char *" string ); +.sp +.B "extern int getdate_err;" +.sp +.B "#define _GNU_SOURCE" +.br +.B "#include " +.sp +.BI "int getdate_r(const char *" string ", struct tm *" res ); +.SH ÀâÌÀ +.BR getdate () +´Ø¿ô¤Ï¡¢ +.I string +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤¿Ê¸»úÎóɽ¸½¤ÎÆüÉդȻþ¹ï¤ò¡¢ +Í×ÁÇÊ̤λþ¹ï (broken-down time) ¤ËÊÑ´¹¤¹¤ë¡£ +Í×ÁÇÊ̤λþ¹ï¤Ï +.I tm +¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¡¢¤³¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤¬´Ø¿ô¤Î·ë²Ì¤È¤·¤ÆÊÖ¤µ¤ì¤ë¡£ +¤³¤Î +.I tm +¹½Â¤ÂΤÏÀÅŪ¤Ê¥á¥â¥êÎΰè¤Ë¤¢¤ê¡¢ +.BR getdate () +¤Î¤½¤ì°Ê¹ß¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤µ¤ì¤Ê¤¤¡£ +.PP +.RI ( format +°ú¤­¿ô¤Ç¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë) +.BR strptime (3) +¤È¤Ï°ã¤¤¡¢ +.BR getdate () +¤Ï´Ä¶­ÊÑ¿ô +.B DATEMSK +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥ë¥Ñ¥¹Ì¾¤Î¥Õ¥¡¥¤¥ë¤Ë½ñ¤¤¤Æ¤¢¤ë¥Õ¥©¡¼¥Þ¥Ã¥È¤òÍѤ¤¤ë¡£ +.PP +¥Þ¥Ã¥Á¤ÎºÝ¤Ë¤ÏÂçʸ»ú¾®Ê¸»ú¤ò¶èÊ̤·¤Ê¤¤¡£ +¥Ñ¥¿¡¼¥óÃæ¤Ç¤âÊÑ´¹¤µ¤ì¤ëʸ»úÎóÃæ¤Ç¤â¡¢Í¾Ê¬¤Ê¶õÇòʸ»ú¤Ï̵»ë¤µ¤ì¤ë¡£ +.PP +¥Ñ¥¿¡¼¥ó¤Ë»ØÄê¤Ç¤­¤ëÊÑ´¹»ØÄê¤Ï¡¢ +.BR strptime (3) +¤Î¤â¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï°ì¤Ä¤ÎÊÑ´¹»ØÄ꤬Äɲäǵ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.TP +.B %Z +¥¿¥¤¥à¥¾¡¼¥ó¤Î̾Á°¡£ +glibc ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.LP +.B %Z +¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢Í×ÁÇÊ̤λþ¹ï¤ò³ÊǼ¤¹¤ë¹½Â¤ÂΤϡ¢ +»ØÄꤵ¤ì¤¿¥¿¥¤¥à¥¾¡¼¥ó¤Ë¤ª¤±¤ë¸½ºß»þ¹ï¤ËÂбþ¤¹¤ëÃͤǽé´ü²½¤µ¤ì¤ë¡£ +»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¤³¤Î¹½Â¤ÂΤϸ½ºß¤Î¥í¡¼¥«¥ë¥¿¥¤¥à¤ËÂбþ¤¹¤ë +Í×ÁÇÊ̤λþ¹ï¤Ç½é´ü²½¤µ¤ì¤ë +.RB ( localtime (3) +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤ÈƱ¤¸)¡£ +.LP +ÍËÆü¤À¤±¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +º£Æü¤Þ¤¿¤Ïº£Æü°Ê¹ß¤Ç¡¢ +¤½¤ÎÍËÆü¤Ë¹çÃפ¹¤ëºÇ½é¤ÎÆü¤¬ºÎÍѤµ¤ì¤ë¡£ +.LP +(ǯ¤Ê¤·¤Ç) ·î¤À¤±¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +º£·î¤Þ¤¿¤Ïº£·î°Ê¹ß¤Ç¡¢ +¤½¤Î·î¤Ë¹çÃפ¹¤ëºÇ½é¤Î·î¤¬ºÎÍѤµ¤ì¤ë¡£ +.LP +»þ¡¦Ê¬¡¦É䬤¤¤º¤ì¤â»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +¸½ºß¤Î»þ¡¦Ê¬¡¦É䬺ÎÍѤµ¤ì¤ë¡£ +.LP +ÆüÉդλØÄ꤬¤Ê¤«¤Ã¤¿¤¬¡¢»þ´Ö (hour) ¤À¤±»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +¸½ºß¤Î»þ´Ö¤Þ¤¿¤Ï¤½¤ì°Ê¹ß¤Ç¡¢¤½¤Î»ØÄê¤Ë¹çÃפ¹¤ëºÇ½é¤Î»þ´Ö¤¬ºÎÍѤµ¤ì¤ë¡£ + +.BR getdate_r () +¤Ï GNU ³ÈÄ¥¤Ç +.BR getdate () +¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤòÄ󶡤·¤Æ¤¤¤ë¡£ +.BR getdate_r () +¤Ç¤Ï¡¢¥¨¥é¡¼¤òÊó¹ð¤¹¤ë¤Î¤Ë¥°¥í¡¼¥Ð¥ëÊÑ¿ô¤ò»ÈÍѤ·¤¿¤ê¡¢ +Í×ÁÇÊ̤λþ¹ï¤òÊÖ¤¹¤Î¤ËÀÅŪ¤Ê¥Ð¥Ã¥Õ¥¡¤ò»ÈÍѤ·¤¿¤ê¤»¤º¡¢ +¥¨¥é¡¼¤ò´Ø¿ô¤ÎÊÖ¤êÃÍ·Ðͳ¤ÇÊó¹ð¤·¡¢Í×ÁÇÊ̤λþ¹ï¤ò +°ú¤­¿ô +.I res +¤¬»Ø¤·¼¨¤¹¸Æ¤Ó½Ð¤·Â¦¤Ç³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR getdate () +¤Ï +.I struct tm +¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È NULL ¤òÊÖ¤·¡¢¥°¥í¡¼¥Ð¥ëÊÑ¿ô +.I getdate_err +¤Ë°Ê²¼¤Ë¼¨¤¹¥¨¥é¡¼ÈÖ¹æ¤Î¤¤¤º¤ì¤«°ì¤Ä¤òÀßÄꤹ¤ë¡£ +.I errno +¤ÎÊѹ¹¤Ë¤Ä¤¤¤Æ¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ + +À®¸ù¤¹¤ë¤È¡¢ +.BR getdate_r () +¤Ï 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È¡¢°Ê²¼¤Ë¼¨¤¹¥¨¥é¡¼ÈÖ¹æ¤Î¤¤¤º¤ì¤«°ì¤Ä¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +°Ê²¼¤Î¥¨¥é¡¼¤¬¡¢ +.RB ( getdate () +¤Ç¤Ï) +.I getdate_err +·Ðͳ¤ÇÊÖ¤µ¤ì¡¢ +.RB ( getdate_r () +¤Ç¤Ï) ´Ø¿ô¤ÎÊÖ¤êÃͤȤ·¤ÆÊÖ¤µ¤ì¤ë¡£ +.TP 4n +.B 1 +´Ä¶­ÊÑ¿ô +.B DATEMASK +¤¬Ì¤ÄêµÁ¡¢¤Þ¤¿¤Ï¤½¤ÎÃͤ¬¶õʸ»úÎó¤Ç¤¢¤ë¡£ +.TP +.B 2 +.B DATEMSK +¤Ç»ØÄꤵ¤ì¤¿¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤ßÍѤ˥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤¡£ +.TP +.B 3 +¥Õ¥¡¥¤¥ë¤Î¥¹¥Æ¡¼¥¿¥¹¾ðÊ󤬼èÆÀ¤Ç¤­¤Ê¤¤¡£ +.\" stat() +.TP +.B 4 +¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤Ê¤¤¡£ +.TP +.B 5 +¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ßÃæ¤Ë¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B 6 +¥á¥â¥ê¤Î³ä¤êÅö¤Æ¤Ë¼ºÇÔ¤·¤¿ (¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤)¡£ +.\" ¥¨¥é¡¼ 6 ¤Ï glibc ¤Ç¤ÏȯÀ¸¤·¤Ê¤¤¤è¤¦¤Ë¸«¤¨¤ë¡£ +.TP +.B 7 +ÆþÎϤ˥ޥåÁ¤·¤¿¥Õ¥¡¥¤¥ë¤Ë¡¢¹Ô¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B 8 +ÆþÎÏ»ØÄ꤬Àµ¤·¤¯¤Ê¤¤¡£ +.SH ´Ä¶­ÊÑ¿ô +.TP +.B DATEMSK +½ñ¼°¥Ñ¥¿¡¼¥ó¤ò´Þ¤à¥Õ¥¡¥¤¥ë¡£ +.TP +.BR TZ ", " LC_TIME +.BR strptime (3) +¤¬ÍѤ¤¤ëÊÑ¿ô¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +POSIX.1-2001 »ÅÍͤǤϡ¢ +.BR strptime (3) +¤Ë¤Ä¤¤¤Æ¤Ï +.B %E +¤ä +.B %O +¤È¤¤¤Ã¤¿½¤Àµ»Ò¤òÍѤ¤¤¿ÊÑ´¹»ØÄê¤òµ¬Äꤷ¤Æ¤¤¤ë¤¬¡¢ +.BR getdate () +¤Ë¤Ä¤¤¤Æ¤Ï¤³¤Î¤è¤¦¤Ê½¤¾þ»Ò¤Îµ¬Äê¤Ï¤Ê¤¤¡£ +glibc ¤Ç¤Ï¡¢ +.BR getdate () +¤Ï +.BR strptime (3) +¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢ +ξ¼Ô¤Ç¤ÏÁ´¤¯Æ±¤¸ÊÑ´¹¤¬Î¾¼Ô¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Î¤½¤ì¤¾¤ì¤Ë¤Ä¤¤¤Æ +.BR getdate () +¤ò¸Æ¤Ó½Ð¤·¡¢¤½¤ì¤¾¤ì¤Ë¤Ä¤¤¤ÆÊÖ¤µ¤ì¤¿ +.I tm +¹½Â¤ÂΤΥե£¡¼¥ë¥ÉÃͤòɽ¼¨¤¹¤ë¡£ +¼¡¤Î¥·¥§¥ë¡¦¥»¥Ã¥·¥ç¥ó¤Ï¡¢¥×¥í¥°¥é¥à¤ÎÆ°ºîÎã¤Ç¤¢¤ë¡£ + +.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" +Sun Sep 7 06:03:36 CEST 2008 +Call 1 ("Tuesday") succeeded: + tm_sec = 36 + tm_min = 3 + tm_hour = 6 + tm_mday = 9 + tm_mon = 8 + tm_year = 108 + tm_wday = 2 + tm_yday = 252 + tm_isdst = 1 +Call 2 ("2009-12-28") succeeded: + tm_sec = 36 + tm_min = 3 + tm_hour = 6 + tm_mday = 28 + tm_mon = 11 + tm_year = 109 + tm_wday = 1 + tm_yday = 361 + tm_isdst = 0 +Call 3 ("12:22:33") succeeded: + tm_sec = 33 + tm_min = 22 + tm_hour = 12 + tm_mday = 7 + tm_mon = 8 + tm_year = 108 + tm_wday = 0 + tm_yday = 250 + tm_isdst = 1 +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#define _GNU_SOURCE 500 +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct tm *tmp; + int j; + + for (j = 1; j < argc; j++) { + tmp = getdate(argv[j]); + + if (tmp == NULL) { + printf("Call %d failed; getdate_err = %d\\n", + 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); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR time (2), +.BR localtime (3), +.BR setlocale (3), +.BR strftime (3), +.BR strptime (3), +.BR feature_test_macros (7) diff --git a/release/man3/getdirentries.3 b/release/man3/getdirentries.3 new file mode 100644 index 00000000..680295e5 --- /dev/null +++ b/release/man3/getdirentries.3 @@ -0,0 +1,76 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" Portions extracted from /usr/include/dirent.h are: +.\" Copyright 1991, 1992 Free Software Foundation +.\" +.\" 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 NAKANO Takeo all rights reserved. +.\" Translated Thu Apr 30 1998 by NAKANO Takeo +.\" +.TH GETDIRENTRIES 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getdirentries \- ¥Ç¥£¥ì¥¯¥È¥ê¤Î¥¨¥ó¥È¥ê¤ò¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Ê¤¤·Á¼°¤Ç¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (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 ); +.SH ÀâÌÀ +.I fd +¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¥¨¥ó¥È¥ê¤òÆɤߡ¢ +.I buf +¤Ë³ÊǼ¤¹¤ë¡£ºÇÂç¤Ç +.I nbytes +¤¬Æɤ߹þ¤Þ¤ì¤ë¡£Æɤ߹þ¤ß¤Ï¥ª¥Õ¥»¥Ã¥È +.I *basep +¤«¤é³«»Ï¤µ¤ì¡¢Æɤ߹þ¤ß½ªÎ»»þ¤Ë¤Ï +.I *basep +¤Ï¿·¤·¤¤°ÌÃ֤˹¹¿·¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR getdirentries () +¤ÏÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÊÖ¤¹¤«¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ÎºÇ¸å¤Ë¤­¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤é \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ËÂбþ¤¹¤ëÃͤ˥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +¾ÜºÙ¤Ï Linux ¤Î¥é¥¤¥Ö¥é¥ê¥½¡¼¥¹¥³¡¼¥É¤òÆɤó¤Ç¤Û¤·¤¤¡£ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ¤Ë¸ºß¤·¡¢Â¾¤Ë¤â¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ë¤â¤¢¤ë¡£ +Âå¤ï¤ê¤Ë +.BR opendir (3) +¤È +.BR readdir (3) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR lseek (2), +.BR open (2) diff --git a/release/man3/getenv.3 b/release/man3/getenv.3 new file mode 100644 index 00000000..f4109203 --- /dev/null +++ b/release/man3/getenv.3 @@ -0,0 +1,86 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's "POSIX Programmer's Guide" (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" 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" +.SH ̾Á° +getenv \- ´Ä¶­ÊÑ¿ô¤òÆÀ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *getenv(const char *" name ); +.fi +.SH ÀâÌÀ +´Ø¿ô +.BR getenv () +¤Ï¡¢´Ä¶­¥ê¥¹¥È¤«¤é̾Á°¤¬ +.I name +¤Î´Ä¶­ÊÑ¿ô¤ò¸¡º÷¤·¡¢Âбþ¤¹¤ë +.I value +ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +´Ø¿ô +.BR getenv () +¤Ï¡¢´Ä¶­¤Ë¤ª¤±¤ëÃÍ value ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +\fIname\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë´Ä¶­ÊÑ¿ô¤¬Â¸ºß¤·¤Ê¤¤¤È¤­¤Ë¤Ï NULL ¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD, C89, C99. +.SH Ãí°Õ +´Ä¶­¥ê¥¹¥È¤Îʸ»úÎó¤Ï \fIname=value\fP ¤È¤¤¤¦·Á¼°¤ò¤·¤Æ¤¤¤ë¡£ + +Ä̾ï¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.BR getenv () +¤Ï´Ä¶­¥ê¥¹¥ÈÆâ¤Îʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï¤³¤Îʸ»úÎó¤òÊѹ¹¤·¤Ê¤¤¤è¤¦¤ËÃí°Õ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Îʸ»úÎó¤òÊѹ¹¤¹¤ë¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Î´Ä¶­¤òÊѲ½¤µ¤»¤ë¤³¤È¤Ë¤Ê¤ë¤«¤é¤Ç¤¢¤ë¡£ + +.BR getenv () +¤Î¼ÂÁõ¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È (ºÆÆþ²Äǽ) ¤Ç¤¢¤ë¤³¤È¤òÍ׵ᤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.BR getenv () +¤ÎÊÖ¤êÃͤˤè¤ê»²¾È¤µ¤ì¤ëʸ»úÎó¤ÏÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤â¤è¤¯¡¢ +ʸ»úÎó¤ÎÆâÍƤϸ峤Π+.BR getenv (), +.BR putenv (3), +.BR setenv (3), +.BR unsetenv (3) +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤êÊѹ¹¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR clearenv (3), +.BR putenv (3), +.BR setenv (3), +.BR unsetenv (3), +.BR environ (7) diff --git a/release/man3/getfsent.3 b/release/man3/getfsent.3 new file mode 100644 index 00000000..86826e9c --- /dev/null +++ b/release/man3/getfsent.3 @@ -0,0 +1,138 @@ +.\" Copyright (C) 2002 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. +.\" +.\" Inspired by a page written by Walter Harms. +.\" +.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. +.\" Translated Wed 7 Aug 2002 by NAKANO Takeo +.\" +.TH GETFSENT 3 2002-02-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getfsent, getfsspec, getfsfile, setfsent, endfsent \- fstab ¥¨¥ó¥È¥ê¤Î½èÍý +.SH ½ñ¼° +.B #include +.sp +.B "void endfsent(void);" +.sp +.B "struct fstab *getfsent(void);" +.sp +.BI "struct fstab *getfsfile(const char *" mount_point ); +.sp +.BI "struct fstab *getfsspec(const char *" special_file ); +.sp +.B "int setfsent(void);" +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I /etc/fstab +¥Õ¥¡¥¤¥ë¤«¤é¾ðÊó¤òÆɤ߹þ¤à¡£\fIfstab\fP ¹½Â¤ÂΤϼ¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +.in +4n +.nf +struct fstab { + char *fs_spec; /* block device name */ + char *fs_file; /* mount point */ + char *fs_vfstype; /* file-system type */ + char *fs_mntops; /* mount options */ + const char *fs_type; /* rw/rq/ro/sw/xx option */ + int fs_freq; /* dump frequency, in days */ + int fs_passno; /* pass number on parallel dump */ +}; +.fi +.in +.PP +*BSD ¥·¥¹¥Æ¥à¤Î¾ì¹ç¡¢ +.I fs_type +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢5 ¤Ä¤Îʸ»úÎó +"rw", "rq", "ro", "sw", "xx" +¤Î¤¤¤º¤ì¤«¤¬Æþ¤ë +(¤½¤ì¤¾¤ì read-write, quota ÉÕ¤­ read-write, read-only, swap, ignore)¡£ + +´Ø¿ô +.BR setfsent () +¤Ï¸Æ¤Ó½Ð¤µ¤ì¤ë¤È fstab ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¡¢ +ºÇ½é¤Î¹Ô¤Ë°ÜÆ°¤¹¤ë¡£ +.LP +´Ø¿ô +.BR getfsent () +¤Ï fstab ¥Õ¥¡¥¤¥ë¤«¤é¼¡¤Î¹Ô¤ò¥Ñ¡¼¥¹¤¹¤ë +(ɬÍפʾì¹ç¤Ï¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë)¡£ +.LP +´Ø¿ô +.BR endfsent () +¤Ï¸Æ¤Ó½Ð¤µ¤ì¤ë¤È fstab ¥Õ¥¡¥¤¥ë¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.LP +´Ø¿ô +.BR getfsspec () +¤Ï fstab ¥Õ¥¡¥¤¥ë¤òÀèƬ¤«¤é¸¡º÷¤·¡¢ +.I fs_spec +¥Õ¥£¡¼¥ë¥É¤¬ +.I special_file +°ú¿ô¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤Ã¤¿¤é¡¢¤½¤ÎºÇ½é¤Î¤â¤Î¤òÊÖ¤¹¡£ +.LP +´Ø¿ô +.BR getfsfile () +¤Ï fstab ¥Õ¥¡¥¤¥ë¤òÀèƬ¤«¤é¸¡º÷¤·¡¢ +.I fs_file +¥Õ¥£¡¼¥ë¥É¤¬ +.I mount_point +°ú¿ô¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤Ã¤¿¤é¡¢¤½¤ÎºÇ½é¤Î¤â¤Î¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR getfsent (), +.BR getfsfile (), +.BR getfsspec () +¤Î³Æ´Ø¿ô¤Ï \fIfstab\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤·¡¢ +.BR setfsent () +´Ø¿ô¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È¤³¤ì¤é¤Î´Ø¿ô¤Ï NULL ¤òÊÖ¤·¡¢ +end-of-file ¤Ë¤Ê¤Ã¤¿¤é 0 ¤òÊÖ¤¹¡£ +.\" .SH ÍúÎò +.\" .BR getfsent () +.\" ´Ø¿ô¤Ï 4.0BSD ¤ÇÅо줷¤¿¡£ +.\" ¾¤Î 4 ¤Ä¤Î´Ø¿ô¤Ï 4.3BSD ¤ÇÅо줷¤¿¡£ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Ï¸ºß¤·¤Ê¤¤¡£ +¤³¤ì¤é¤Î´Ø¿ô¤ò¤â¤Ä OS ¤Ï¤¤¤¯¤Ä¤«¤¢¤ê¡¢ +*BSD, SunOS, Digital Unix, AIX Åù¤Ç¤¢¤ë +(AIX ¤Ë¤Ï +.BR getfstype () +¤â¤¢¤ë)¡£ +HP-UX ¤Ë¤âƱ̾¤Î´Ø¿ô·²¤¬¤¢¤ë¤¬¡¢ +HP-UX ¤Î¤â¤Î¤Ï \fIfstab\fP ¹½Â¤ÂΤǤϤʤ¯ \fIchecklist\fP ¹½Â¤ÂΤòÍѤ¤¤ë¡£ +¤Þ¤¿¤³¤ì¤é¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤Ï obsolete ¤Ç¡¢ +.BR getmntent (3) +¤Ë¼è¤Ã¤ÆÂå¤ï¤é¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¡£ +.LP +Linux ¤Ç¤Ï¥Ö¥í¥Ã¥¯¥¹¥Ú¥·¥ã¥ë¥Ç¥Ð¥¤¥¹¤òÊ£¿ô¤Î¾ì½ê¤Ë¥Þ¥¦¥ó¥È¤Ç¤­¡¢ +¤Þ¤¿Ê£¿ô¤Î¥Ç¥Ð¥¤¥¹¤¬Æ±¤¸¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò¶¦Í­¤Ç¤­¤ë +(¤³¤Î¾ì¹ç¤Ï¤½¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ËºÇ¸å¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Ç¥Ð¥¤¥¹¤¬°ÕÌ£¤ò»ý¤Ä) +¤¬¡¢ +.BR getfsfile () +¤È +.BR getfsspec () +¤Ï¥Þ¥Ã¥Á¤·¤¿ºÇ½é¤Î¥¨¥ó¥È¥ê¤·¤«ÊÖ¤µ¤Ê¤¤¤Î¤Ç¡¢ +¤³¤ì¤é¤Î 2 ¤Ä¤Î´Ø¿ô¤Ï Linux ¤Ç¤ÎÍøÍѤˤÏŬ¤·¤Æ¤¤¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getmntent (3), +.BR fstab (5) diff --git a/release/man3/getgrent.3 b/release/man3/getgrent.3 new file mode 100644 index 00000000..815239cb --- /dev/null +++ b/release/man3/getgrent.3 @@ -0,0 +1,150 @@ +.\" 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 Sat Jul 24 19:29:54 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-19, HIROFUMI Nishizuka +.\" Updated & Modified 2004-05-30, Yuichi SATO +.\" Updated & Modified 2005-09-06, Akihiro MOTOKI +.\" +.TH GETGRENT 3 2009-03-30 "" "Linux Programmer's Manual" +.SH ̾Á° +getgrent, setgrent, endgrent \- ¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤Î¼èÆÀ +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.B struct group *getgrent(void); +.sp +.B void setgrent(void); +.sp +.B void endgrent(void); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR getgrent (), +.BR setgrent (), +.BR endgrent (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.ad b +.SH ÀâÌÀ +.BR getgrent () +´Ø¿ô¤Ï¡¢¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¼èÆÀ¤·¤¿¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹ +(¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÎã: +¥í¡¼¥«¥ë¤Î¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë +.IR /etc/group , +NIS, LDAP)¡£ +ºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤ÏºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤·¡¢¤½¤ì°Ê¹ß¤Ï +¸Æ¤Ó½Ð¤µ¤ì¤ëËè¤Ë¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +.PP +.BR setgrent () +´Ø¿ô¤ò»È¤¦¤È¡¢¤â¤¦°ìÅÙÆɤ߹þ¤á¤ë¤è¤¦¤Ë¡¢ +¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀèƬ¤ËÌá¤ë¡£ +.PP +.BR endgrent () +´Ø¿ô¤Ï¡¢Á´¤Æ¤Î½èÍý¤¬½ª¤ï¤Ã¤¿¸å¤Ë¥°¥ë¡¼¥×¡¦ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +\fIgroup\fP ¹½Â¤ÂΤϡ¢\fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct group { + char *gr_name; /* ¥°¥ë¡¼¥×̾ */ + char *gr_passwd; /* ¥°¥ë¡¼¥×¤Î¥Ñ¥¹¥ï¡¼¥É */ + gid_t gr_gid; /* ¥°¥ë¡¼¥× ID */ + char **gr_mem; /* ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð */ +}; +.fi +.in +.SH ÊÖ¤êÃÍ +.BR getgrent () +´Ø¿ô¤Ï +.I group +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ì°Ê¾å¥¨¥ó¥È¥ê¤¬Ìµ¤¤¤«¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.LP +¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +¤³¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¸å¤Ë +.I errno +¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢¸Æ¤Ó½Ð¤·Á°¤Ë +.I errno +¤ò 0 ¤ËÀßÄꤷ¤Æ¤ª¤«¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£ + +ÊÖ¤êÃͤÏÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤½¤Î¸å¤Î +.BR getgrent (), +.BR getgrgid (3), +.BR getgrnam (3) +¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +(ÊÖ¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤ò +.BR free (3) +¤ËÅϤµ¤Ê¤¤¤³¤È¡£) +.SH ¥¨¥é¡¼ +.TP +.B EINTR +¥·¥°¥Ê¥ë¤¬¥­¥ã¥Ã¥Á¤µ¤ì¤¿¡£ +.TP +.B EIO +I/O ¥¨¥é¡¼¡£ +.TP +.B EMFILE +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬´û¤Ë¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·²á¤®¤Æ¤¤¤ë¡£ +.TP +.B ENFILE +¥·¥¹¥Æ¥à¾å¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¿²á¤®¤ë¡£ +.TP +.B ENOMEM +.\" POSIX ¤Ë¤Ï¤Ê¤¤¡£ +.I group +¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£ +.TP +.B ERANGE +½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/group +¥í¡¼¥«¥ë¤Î¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR fgetgrent (3), +.BR getgrent_r (3), +.BR getgrgid (3), +.BR getgrnam (3) +.BR getgrouplist (3), +.BR putgrent (3) diff --git a/release/man3/getgrent_r.3 b/release/man3/getgrent_r.3 new file mode 100644 index 00000000..580b6510 --- /dev/null +++ b/release/man3/getgrent_r.3 @@ -0,0 +1,196 @@ +.\" 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 29 02:26:07 JST 2004 +.\" by Yuichi SATO +.\" +.TH GETGRENT_R 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getgrent_r, fgetgrent_r \- ¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤ò¥ê¥¨¥ó¥È¥é¥ó¥È (reentrant) ¤Ë¼è¤ê½Ð¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getgrent_r(struct group *" gbuf ", char *" buf , +.br +.BI " size_t " buflen ", struct group **" gbufp ); +.sp +.BI "int fgetgrent_r(FILE *" fp ", struct group *" gbuf ", char *" buf , +.br +.BI " size_t " buflen ", struct group **" gbufp ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR getgrent_r (): +_GNU_SOURCE +.\" FIXME . The FTM requirements seem inconsistent here. File a glibc bug? +.br +.BR fgetgrent_r (): +_SVID_SOURCE +.SH ÀâÌÀ +´Ø¿ô +.BR getgrent_r () +¤È +.BR fgetgrent_r () +¤Ï +.BR getgrent (3) +¤È +.BR fgetgrent (3) +¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤ¢¤ë¡£ +Á°¼Ô¤Ï¡¢ +.BR setgrent (3) +¤Ë¤è¤Ã¤Æ½é´ü²½¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤«¤é¡¢¼¡¤Î¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à¡£ +¸å¼Ô¤Ï¡¢¥¹¥È¥ê¡¼¥à +.I fp +¤«¤é¼¡¤Î¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à¡£ +.PP +\fIgroup\fP ¹½Â¤ÂÎ¤Ï +.I +¤Ë¤ª¤¤¤Æ°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct group { + char *gr_name; /* ¥°¥ë¡¼¥×̾ */ + char *gr_passwd; /* ¥°¥ë¡¼¥×¥Ñ¥¹¥ï¡¼¥É */ + gid_t gr_gid; /* ¥°¥ë¡¼¥× ID */ + char **gr_mem; /* ¥°¥ë¡¼¥×¥á¥ó¥Ð */ +}; +.fi +.in +.sp +¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ê¤¤´Ø¿ô¤ÏÀÅŪ¤Ê³ÊǼÎΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ÎÀÅŪ¤Ê³ÊǼÎΰè¤Ë¤Ï¡¢¹¹¤Ë¥°¥ë¡¼¥×̾¡¦¥Ñ¥¹¥ï¡¼¥É¡¦ +¥á¥ó¥Ð¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬´Þ¤Þ¤ì¤ë¡£ +¤³¤³¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê´Ø¿ô¤Ï¡¢ +¸Æ¤Ó½Ð¤·Â¦¤«¤éÄ󶡤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë¥°¥ë¡¼¥×̾¤Ê¤ÉÁ´¤Æ¤òÊÖ¤¹¡£ +ºÇ½é¤Î°ú¤­¿ô¤È¤·¤Æ \fIstruct group\fP ¤òÊÝ»ý¤Ç¤­¤ë¥Ð¥Ã¥Õ¥¡ +.I gbuf +¤¬¤¢¤ë¡£ +¼¡¤Ë¤½¤Î¾¤Îʸ»úÎó¤òÊÝ»ý¤Ç¤­¤ë¥µ¥¤¥º +.I buflen +¤Î¥Ð¥Ã¥Õ¥¡ +.I buf +¤¬¤¢¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Î·ë²Ì (¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤Þ¤ì¤¿ \fIstruct group\fP) ¤Ï¡¢ +Ä󶡤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡ +.IR *gbuf +¤Ë³ÊǼ¤µ¤ì¡¢¤³¤Î \fIstruct group\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï +.IR *gbufp +¤ËÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï 0 ¤òÊÖ¤·¡¢ +.RI * gbufp +¤Ï \fIstruct group\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¨¥é¡¼ÃͤòÊÖ¤·¡¢ +.RI * gbufp +¤Ï NULL ¤Ë¤Ê¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOENT +¼¡¤Î¥¨¥ó¥È¥ê¤¬¤Ê¤¤¡£ +.TP +.B ERANGE +½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +¤â¤Ã¤ÈÂ礭¤Ê¥Ð¥Ã¥Õ¥¡¤ÇºÆÅټ¹Ԥ¹¤ë¤³¤È¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ê¡¢POSIX ÈǤδؿô +.BR getpwnam_r (3) +¤Î·Á¼°¤Ë»÷¤»¤Æ¤¢¤ë¡£ +¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï°Ê²¼¤Î¥×¥í¥È¥¿¥¤¥×¤¬»È¤ï¤ì¤Æ¤¤¤ë¡£ +.sp +.nf +.in +4n +struct group *getgrent_r(struct group *grp, char *buf, + int buflen); +.in +.fi +.sp +¤è¤êÎɤ¤¤â¤Î¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.sp +.nf +.in +4n +int getgrent_r(struct group *grp, char *buf, int buflen, + FILE **gr_fp); +.in +.fi +.SH Ãí°Õ +´Ø¿ô +.BR getgrent_r () +¤ÏËÜÅö¤Î¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ï¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢¥¹¥È¥ê¡¼¥à¤ÎÆɤ߹þ¤ß°ÌÃÖ¤ò +¾¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤È¶¦Í­¤·¤Æ¤¤¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.SH Îã +.nf +#define _GNU_SOURCE +#include +#include +#include +#define BUFLEN 4096 + +int +main(void) +{ + struct group grp, *grpp; + char buf[BUFLEN]; + int i; + + setgrent(); + while (1) { + i = getgrent_r(&grp, buf, BUFLEN, &grpp); + if (i) + break; + printf("%s (%d):", grpp\->gr_name, grpp\->gr_gid); + for (i = 0; ; i++) { + if (grpp\->gr_mem[i] == NULL) + break; + printf(" %s", grpp\->gr_mem[i]); + } + printf("\en"); + } + endgrent(); + exit(EXIT_SUCCESS); +} +.fi +.\" ¤¿¤Ö¤ó¥¨¥é¡¼¥Á¥§¥Ã¥¯¤òÄɲ䷤ơ¢strerror_r ¤ò»È¤¦¤Ù¤­¤À¤í¤¦¡£ +.\" #include +.\" #include +.\" if (i) { +.\" if (i == ENOENT) +.\" break; +.\" printf("getgrent_r: %s", strerror(i)); +.\" exit(EXIT_FAILURE); +.\" } +.SH ´ØÏ¢¹àÌÜ +.BR fgetgrent (3), +.BR getgrent (3), +.BR getgrgid (3), +.BR getgrnam (3), +.BR putgrent (3), +.BR group (5) diff --git a/release/man3/getgrnam.3 b/release/man3/getgrnam.3 new file mode 100644 index 00000000..552daae8 --- /dev/null +++ b/release/man3/getgrnam.3 @@ -0,0 +1,240 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" 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-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2003-11-15 by aeb +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-19, HIROFUMI Nishizuka +.\" Updated & Modefied 1999-02-26, Shouichi Saito +.\" Updated & Modified 2004-06-05, Yuichi SATO +.\" Updated & Modified 2005-09-06, Akihiro MOTOKI +.\" Updated 2008-12-24, Akihiro MOTOKI, LDP v3.14 +.\" +.TH GETGRNAM 3 2009-03-30 "" "Linux Programmer's Manual" +.SH ̾Á° +getgrnam, getgrnam_r, getgrgid, getgrgid_r \- ¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤Î¼è¤ê½Ð¤· +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "struct group *getgrnam(const char *" name ); +.sp +.BI "struct group *getgrgid(gid_t " gid ); +.sp +.BI "int getgrnam_r(const char *" name ", struct group *" grp , +.br +.BI " char *" buf ", size_t " buflen ", struct group **" result ); +.sp +.BI "int getgrgid_r(gid_t " gid ", struct group *" grp , +.br +.BI " char *" buf ", size_t " buflen ", struct group **" result ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.ad l +.in +.sp +.BR getgrnam_r (), +.BR getgrgid_r (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +.BR getgrnam () +´Ø¿ô¤Ï¡¢¥°¥ë¡¼¥×̾ +.I name +¤Ë¥Þ¥Ã¥Á¤¹¤ë¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹ +(¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÎã: +¥í¡¼¥«¥ë¤Î¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë +.IR /etc/group , +NIS, LDAP)¡£ +.PP +.BR getgrgid () +´Ø¿ô¤Ï¡¢¥°¥ë¡¼¥× ID +.I uid +¤Ë¥Þ¥Ã¥Á¤¹¤ë¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.BR getgrnam_r () +¤È +.BR getgrgid_r () +´Ø¿ô¤Ï (¾åµ­¤Î´Ø¿ô¤È) Ʊ¤¸¾ðÊó¤ò¼èÆÀ¤¹¤ë¤¬¡¢ +¼èÆÀ¤·¤¿ +.I group +¹½Â¤ÂΤò +.I grp +¤¬»Ø¤¹Îΰè¤Ë³ÊǼ¤¹¤ë¡£ +¤³¤Î +.I group +¹½Â¤ÂΤˤÏʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬´Þ¤Þ¤ì¡¢ +¤³¤ì¤é¤Îʸ»úÎó¤Ï¥µ¥¤¥º +.I buflen +¤Î¥Ð¥Ã¥Õ¥¡ +.I buf +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +À®¸ù¤·¤¿¾ì¹ç +.I *gbufp +¤Ë¤Ï·ë²Ì¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬³ÊǼ¤µ¤ì¤ë¡£ +¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤ä¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤Ï +.I *result +¤Ë¤Ï NULL ¤¬Æþ¤ë¡£ +.PP +\fIgroup\fP ¹½Â¤ÂΤϡ¢\fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct group { + char *gr_name; /* ¥°¥ë¡¼¥×̾ */ + char *gr_passwd; /* ¥°¥ë¡¼¥×¤Î¥Ð¥¹¥ï¡¼¥É */ + gid_t gr_gid; /* ¥°¥ë¡¼¥× ID */ + char **gr_mem; /* ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð */ +}; +.fi +.in +.PP +.I buf +¤ËºÇÂçɬÍפʥµ¥¤¥º¤Ï¡¢ +.BR sysconf (3) +¤Ë°ú¤­¿ô +.B _SC_GETGR_R_SIZE_MAX +¤ò»ØÄꤷ¤Æ¼Â¹Ô¤¹¤ë¤³¤È¤Çʬ¤«¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR getgrnam () +¤È +.BR getgrgid () +´Ø¿ô¤Ï¡¢ +.I group +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤ä¡¢ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¤Î¸å¤Ç +.I errno +¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢ +¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë (¤³¤ÎÃͤò) 0 ¤ËÀßÄꤷ¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.LP +ÊÖ¤êÃͤÏÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤½¤Î¸å¤Î +.BR getgrent (3), +.BR getgrgid (), +.BR getgrnam () +¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +(ÊÖ¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤ò +.BR free (3) +¤ËÅϤµ¤Ê¤¤¤³¤È¡£) +.LP +À®¸ù¤¹¤ë¤È¡¢ +.BR getgrnam_r () +¤È +.BR getgrgid_r () +¤Ï 0 ¤òÊÖ¤·¡¢ +.I *result +¤Ë +.I grp +¤òÀßÄꤹ¤ë¡£ +¥Þ¥Ã¥Á¤¹¤ë¥°¥ë¡¼¥×¡¦¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +0 ¤òÊÖ¤·¡¢ +.I *result +¤Ë NULL ¤òÀßÄꤹ¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤·¡¢ +.I *result +¤Ë NULL ¤òÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.BR 0 " ¤Þ¤¿¤Ï " ENOENT " ¤Þ¤¿¤Ï " ESRCH " ¤Þ¤¿¤Ï " EBADF " ¤Þ¤¿¤Ï " EPERM " ¤Þ¤¿¤Ï ... " +»ØÄꤵ¤ì¤¿ +.I name +¤Þ¤¿¤Ï +.I gid +¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINTR +¥·¥°¥Ê¥ë¤¬¥­¥ã¥Ã¥Á¤µ¤ì¤¿¡£ +.TP +.B EIO +I/O ¥¨¥é¡¼¡£ +.TP +.B EMFILE +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ë¤ª¤¤¤Æ¡¢ +´û¤ËºÇÂç¿ô +.RB ( OPEN_MAX ) +¤Î¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ENFILE +¥·¥¹¥Æ¥à¾å¤Ç´û¤ËºÇÂç¿ô¤Î¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ENOMEM +.\" POSIX ¤Ë¤Ï¤Ê¤¤ +.I group +¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£ +.\" ¥°¥ë¡¼¥×¾ðÊó¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¡¢¤Þ¤¿¤Ï¥Ð¥Ã¥Õ¥¡¤ò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î +.TP +.B ERANGE +Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬ÉÔ½½Ê¬¤Ç¤¢¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/group +¥í¡¼¥«¥ë¤Î¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +¾åµ­¤Î¡ÖÊÖ¤êÃ͡װʲ¼¤Îµ­½Ò¤Ï POSIX.1-2001 ¤Ëµò¤ë¡£ +¤³¤Îɸ½à¤Ï¡Ö(¥¨¥ó¥È¥ê¤¬) ¸«¤Ä¤«¤é¤Ê¤¤¤³¤È¡×¤ò¥¨¥é¡¼¤È¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢ +¤½¤Î¤è¤¦¤Ê¾ì¹ç¤Ë +.I errno +¤¬¤É¤Î¤è¤¦¤ÊÃͤˤʤ뤫¤òÄê¤á¤Æ¤¤¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢¥¨¥é¡¼¤òǧ¼±¤¹¤ë¤³¤È¤ÏÉÔ²Äǽ¤Ç¤¢¤ë¡£ +POSIX ¤Ë½àµò¤·¤Æ¡¢¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï +.I errno +¤òÊѹ¹¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡¢¤È¼çÄ¥¤¹¤ë¿Í¤â¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +ÍÍ¡¹¤Ê Unix ·Ï¤Î¥·¥¹¥Æ¥à¤Ç»î¤·¤Æ¤ß¤ë¤È¡¢¤½¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï +0, ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM ¤È¤¤¤Ã¤¿ÍÍ¡¹¤ÊÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +¾¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\" ¤è¤êÀµ³Î¤Ë¤Ï: +.\" AIX 5.1 ¤Ï ESRCH ¤òÊÖ¤¹¡£ +.\" OSF1 4.0g ¤Ï EWOULDBLOCK ¤òÊÖ¤¹¡£ +.\" libc, glibc (¥Ð¡¼¥¸¥ç¥ó 2.6 ¤Þ¤Ç), Irix 6.5 ¤Ï ENOENT ¤òÊÖ¤¹¡£ +.\" glibc (¥Ð¡¼¥¸¥ç¥ó 2.7 °Ê¹ß) ¤Ï 0 ¤òÊÖ¤¹¡£ +.\" FreeBSD 4.8, OpenBSD 3.2, NetBSD 1.6 ¤Ï EPERM ¤òÊÖ¤¹¡£ +.\" SunOS 5.8 ¤Ï EBADF ¤òÊÖ¤¹¡£ +.\" Tru64 5.1b, HP-UX-11i, SunOS 5.7 ¤Ï 0 ¤òÊÖ¤¹¡£ +.SH ´ØÏ¢¹àÌÜ +.BR endgrent (3), +.BR fgetgrent (3), +.BR getgrent (3), +.BR getpwnam (3), +.BR setgrent (3), +.BR group (5) diff --git a/release/man3/getgrouplist.3 b/release/man3/getgrouplist.3 new file mode 100644 index 00000000..2e9aa606 --- /dev/null +++ b/release/man3/getgrouplist.3 @@ -0,0 +1,206 @@ +.\" 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. +.\" +.\" A few pieces remain from an earlier version written in +.\" 2002 by Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated 2004-08-07, Yuichi SATO +.\" Updated 2008-08-11, Akihiro MOTOKI , LDP v3.05 +.\" +.TH GETGROUPLIST 3 2009-07-03 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getgrouplist \- ¥æ¡¼¥¶¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤Î¥ê¥¹¥È¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int getgrouplist(const char *" user ", gid_t " group , +.br +.BI " gid_t *" groups ", int *" ngroups ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR getgrouplist (): +_BSD_SOURCE +.SH ÀâÌÀ +.BR getgrouplist () +´Ø¿ô¤Ï¡¢¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹ +.RB ( group (5) +»²¾È) ¤òÄ´¤Ù¤Æ¡¢ +.I user +¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤Î¥ê¥¹¥È¤ò¼èÆÀ¤¹¤ë¡£ +¸«¤Ä¤«¤Ã¤¿¥°¥ë¡¼¥×¤Î¤¦¤ÁºÇÂç +.I *ngroups +¸Ä¤Î¥°¥ë¡¼¥×¤¬¡¢ÇÛÎó +.I groups +¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ + +°ú¤­¿ô +.I group +¤¬¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë +.I user +¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.BR getgrouplist () +¤¬ÊÖ¤¹¥°¥ë¡¼¥×¤Î¥ê¥¹¥È¤Ë°ú¤­¿ô +.I group +¤âÄɲ䵤ì¤ë¡£ +Ä̾ï¤Ï¡¢¤³¤Î°ú¤­¿ô¤Ë¤Ï¥æ¡¼¥¶ +.I user +¤Î¥Ñ¥¹¥ï¡¼¥É¥ì¥³¡¼¥É¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥°¥ë¡¼¥× ID ¤ò»ØÄꤹ¤ë¡£ + +°ú¤­¿ô +.I ngroups +¤Ï¡¢ÃÍÅϤ·¤È·ë²Ì¤ÎξÊý¤Ë»ÈÍѤµ¤ì¤ë°ú¤­¿ô (value-result argument) ¤Ç¤¢¤ê¡¢ +¥ê¥¿¡¼¥ó»þ¤Ë¤Ï¡¢¾ï¤Ë +.I group +¤â´Þ¤á¤¿ +.I user +¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¿ô¤¬³ÊǼ¤µ¤ì¤ë¡£ +¤³¤ÎÃÍ¤Ï +.I groups +¤Ë³ÊǼ¤µ¤ì¤¿¥°¥ë¡¼¥×¿ô¤è¤êÂ礭¤¯¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.I user +¤¬½ê°¤·¤Æ¤¤¤ë¥°¥ë¡¼¥×¿ô¤¬ +.I *ngroups +°Ê²¼¤Î¾ì¹ç¡¢ +.I *ngroups +¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¡£ + +»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¤¬ +.I *ngroups +¤è¤ê¿¤¯¤Î¥°¥ë¡¼¥×¤Ë½ê°¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR getgrouplist () +¤Ï \-1 ¤òÊÖ¤¹¡£ +¤³¤Î¾ì¹ç¡¢ +.I *ngroups +¤ÇÊÖ¤µ¤ì¤ëÃͤò»È¤Ã¤Æ¡¢¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òÊѹ¹¤·¤Æ¤«¤é¡¢ +.BR getgrouplist () +¤ò¤â¤¦°ìÅٸƤӽФ¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î´Ø¿ô¤Ï glibc 2.2.4 ¤«¤é¸ºß¤¹¤ë¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç¤¢¤ë¡£¤Û¤È¤ó¤É¤Î BSD ¤Ë¸ºß¤¹¤ë¡£ +.SH ¥Ð¥° +¥Ð¡¼¥¸¥ç¥ó 2.3.3 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢ +¤³¤Î´Ø¿ô¤Î¼ÂÁõ¤Ë¤Ï¥Ð¥Ã¥Õ¥¡¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Î¥Ð¥°¤¬¤¢¤ê¡¢ +.I user +¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¿ô¤¬ +.I *ngroups +¤è¤ê¿¤¤¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢ +.I user +¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤ÎÁ´¥ê¥¹¥È¤òÇÛÎó +.I groups +¤Ë³ÊǼ¤·¤Æ¤·¤Þ¤¦¡£ +.SH Îã +.PP +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢°ì¤ÄÌܤΥ³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿Ì¾Á°¤Î¥æ¡¼¥¶ +¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤Î¥ê¥¹¥È¤òɽ¼¨¤¹¤ë¡£ +ÆóÈÖÌܤΥ³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ë¤Ï¡¢ +.BR getgrouplist () +¤ËÅϤ¹ +.I ngroups +¤ÎÃͤò»ØÄꤹ¤ë¡£ +°Ê²¼¤Î¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥ó¤Ï¤³¤Î¥×¥í¥°¥é¥à¤Î»ÈÍÑÎã¤ò¼¨¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.in +4n +.nf + +.RB "$" " ./a.out cecilia 0" +getgrouplist() returned -1; ngroups = 3 +.RB "$" " ./a.out cecilia 3" +ngroups = 3 +16 (dialout) +33 (video) +100 (users) +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int j, ngroups; + gid_t *groups; + struct passwd *pw; + struct group *gr; + + if (argc != 3) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + ngroups = atoi(argv[2]); + + groups = malloc(ngroups * sizeof (gid_t)); + if (groups == NULL) { + perror("malloc"); + exit(EXIT_FAILURE); + } + + /* Fetch passwd structure (contains first group ID for user) */ + + pw = getpwnam(argv[1]); + if (pw == NULL) { + perror("getpwnam"); + exit(EXIT_SUCCESS); + } + + /* Retrieve group list */ + + if (getgrouplist(argv[1], pw\->pw_gid, groups, &ngroups) == \-1) { + fprintf(stderr, "getgrouplist() returned \-1; ngroups = %d\\n", + ngroups); + exit(EXIT_FAILURE); + } + + /* Display list of retrieved groups, along with group names */ + + fprintf(stderr, "ngroups = %d\\n", ngroups); + for (j = 0; j < ngroups; j++) { + printf("%d", groups[j]); + gr = getgrgid(groups[j]); + if (gr != NULL) + printf(" (%s)", gr\->gr_name); + printf("\\n"); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR getgroups (2), +.BR setgroups (2), +.BR getgrent (3), +.BR group (5), +.BR passwd (5) diff --git a/release/man3/gethostbyname.3 b/release/man3/gethostbyname.3 new file mode 100644 index 00000000..2cfdb1cd --- /dev/null +++ b/release/man3/gethostbyname.3 @@ -0,0 +1,462 @@ +.\" 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-05-22, David Metcalfe +.\" Modified 1993-07-25, Rik Faith (faith@cs.unc.edu) +.\" Modified 1997-02-16, Andries Brouwer (aeb@cwi.nl) +.\" Modified 1998-12-21, Andries Brouwer (aeb@cwi.nl) +.\" Modified 2000-08-12, Andries Brouwer (aeb@cwi.nl) +.\" Modified 2001-05-19, Andries Brouwer (aeb@cwi.nl) +.\" Modified 2002-08-05, Michael Kerrisk +.\" Modified 2004-10-31, Andries Brouwer +.\" +.\" Japanese Version Copyright (c) 1998-2000 NAKANO Takeo all rights reserved. +.\" Translated 1998-04-30, NAKANO Takeo +.\" Modified 1998-12-06, NAKANO Takeo +.\" Updated & Modified 1999-10-12, NAKANO Takeo +.\" Updated & Modified 2001-07-01, Yuichi SATO +.\" Updated & Modified 2002-01-03, Yuichi SATO +.\" Updated & Modified 2003-11-27, Yuichi SATO +.\" Updated & Modified 2005-01-10, Yuichi SATO +.\" Updated 2006-01-18, Akihiro MOTOKI +.\" Updated 2007-06-11, Akihiro MOTOKI, LDP v2.54 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" +.TH GETHOSTBYNAME 3 2009-12-03 "" "Linux Programmer's Manual" +.SH ̾Á° +gethostbyname, gethostbyaddr, sethostent, gethostent, endhostent, +h_errno, +herror, hstrerror, +gethostbyaddr_r, +gethostbyname2, gethostbyname2_r, gethostbyname_r, +gethostent_r \- ¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î¥Û¥¹¥È¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B extern int h_errno; +.sp +.BI "struct hostent *gethostbyname(const char *" name ); +.sp +.BR "#include " " /* AF_INET ¤ò»È¤¦¾ì¹ç */" +.BI "struct hostent *gethostbyaddr(const void *" addr , +.BI " socklen_t " len ", int " type ); +.sp +.BI "void sethostent(int " stayopen ); +.sp +.B void endhostent(void); +.sp +.BI "void herror(const char *" s ); +.sp +.BI "const char *hstrerror(int " err ); +.sp +/* System V/POSIX ³ÈÄ¥ */ +.br +.B struct hostent *gethostent(void); +.sp +/* GNU ³ÈÄ¥ */ +.br +.BI "struct hostent *gethostbyname2(const char *" name ", int " af ); +.sp +.B "int gethostent_r(" +.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , +.BI " struct hostent **" result ", int *" h_errnop ); +.sp +.BI "int gethostbyaddr_r(const void *" addr ", socklen_t " len ", int " type , +.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , +.BI " struct hostent **" result ", int *" h_errnop ); +.sp +.BI "int gethostbyname_r(const char *" name , +.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , +.BI " struct hostent **" result ", int *" h_errnop ); +.sp +.BI "int gethostbyname2_r(const char *" name ", int " af, +.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , +.BI " struct hostent **" result ", int *" h_errnop ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR gethostbyname2 (), +.BR gethostent_r (), +.BR gethostbyaddr_r (), +.BR gethostbyname_r (), +.BR gethostbyname2_r (): +_BSD_SOURCE || _SVID_SOURCE + +.BR herror (), +.BR hstrerror () +(glibc 2.8 °Ê¹ß): _BSD_SOURCE || _SVID_SOURCE || _GNU_SOURCE +.ad b +.SH ÀâÌÀ +.BR gethostbyname* () +¤È +.BR gethostbyaddr* () +¤Ï²áµî¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢Âå¤ï¤ê¤Ë +.BR getaddrinfo (3) +¤È +.BR getnameinfo (3) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ + +.BR gethostbyname () +´Ø¿ô¤ÏÍ¿¤¨¤é¤ì¤¿¥Û¥¹¥È̾ +.I name +¤ËÂбþ¤¹¤ë¹½Â¤ÂÎ +.I hostent +¤òÊÖ¤¹¡£ +.I name +¤Ë¤Ï¥Û¥¹¥È̾¡¢¥É¥Ã¥È¶èÀÚ¤ê¤Î IPv4 ¥¢¥É¥ì¥¹ +.RB ( inet_addr (3) +»²¾È)¡¢¥³¥í¥ó¶èÀÚ¤ê¤Î IPv6 ¥¢¥É¥ì¥¹ (¤ª¤½¤é¤¯¥É¥Ã¥È¶èÀÚ¤ê¤Ç¤âÂç¾æÉ×) +¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë +(IPv6 ¥¢¥É¥ì¥¹¤Îµ­½ÒÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï RFC\ 1884 ¤ò»²¹Í¤Ë¤·¤Æ¤Û¤·¤¤)¡£ +.I name +¤¬ IPv4 ¤« IPv6 ¤Î¥¢¥É¥ì¥¹¤À¤Ã¤¿¾ì¹ç¡¢ +̾Á°²ò·è (lookup) ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£¤½¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR gethostbyname () +¤Ï +.I name +¤ò¤½¤Î¤Þ¤Þ +.I hostent +¹½Â¤ÂΤΠ+.I h_name +¥Õ¥£¡¼¥ë¥É¤Ë¥³¥Ô¡¼¤·¡¢ +¤µ¤é¤Ë +.I name +¤ò +.I struct in_addr +·Á¼°¤Çɽ¤·¤¿¥Ç¡¼¥¿¤ò +.I hostent +¹½Â¤ÂΤΠ+.I h_addr_list[0] +¥Õ¥£¡¼¥ë¥É¤ËÆþ¤ì¤Æ¡¢¤½¤Î +.I hostent +¹½Â¤ÂΤòÊÖ¤¹¡£ +.I name +¤¬¥É¥Ã¥È¤Ç½ªÎ»¤·¤Æ¤¤¤Æ¡¢¤«¤Ä´Ä¶­ÊÑ¿ô +.B HOSTALIASES +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤Þ¤º +.B HOSTALIASES +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥¤¥ê¥¢¥¹¥Õ¥¡¥¤¥ë¤«¤é +.I name +¤Î¥¨¥ó¥È¥ê¤¬¸¡º÷¤µ¤ì¤ë (¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR hostname (7) +¤ò»²¾È¤Î¤³¤È)¡£ +.I name +¤¬¥É¥Ã¥È¤Ç½ªÎ»¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¸½ºß¤Î¥É¥á¥¤¥ó¤È¤½¤Î¿Æ¥É¥á¥¤¥ó¤¬¸¡º÷¤µ¤ì¤ë¡£ +.PP +.BR gethostbyaddr () +´Ø¿ô¤ÏÍ¿¤¨¤é¤ì¤¿¥Û¥¹¥È¥¢¥É¥ì¥¹ +.I addr +(Ťµ \fIlen\fP¡¢ ¥¿¥¤¥× \fItype\fP) ¤ËÂбþ¤¹¤ë¹½Â¤ÂÎ +.I hostent +¤òÊÖ¤¹¡£ +ÍѤ¤¤ë¤³¤È¤Î¤Ç¤­¤ë¥¿¥¤¥×¤Ï +.B AF_INET +¤È +.B AF_INET6 +¤Ç¤¢¤ë¡£ +¥Û¥¹¥È¥¢¥É¥ì¥¹°ú¤­¿ô¤Ï¥¢¥É¥ì¥¹¥¿¥¤¥×¤Ë°Í¸¤·¤¿ +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢¥¢¥É¥ì¥¹¥¿¥¤¥× +.B AF_INET +¤ËÂФ·¤Æ¤Ï +.RB ( inet_addr (3) +¤Î¸Æ¤Ó½Ð¤·¤ÇÆÀ¤é¤ì¤ë) +\fIstruct in_addr *\fP ¤Ç¤¢¤ë¡£ +.PP +.BR sethostent () +´Ø¿ô¤Ï¡¢¥Í¡¼¥à¥µ¡¼¥Ð¤Ø¤ÎÀܳ·ÁÂÖ¤ò»ØÄꤹ¤ë¡£ +.I stayopen +¤¬¿¿ (1) ¤Ê¤é¤Ð¡¢¥Í¡¼¥à¥µ¡¼¥Ð¤Ø¤ÎÌ䤤¹ç¤ï¤»¤Ë¤Ï¡¢ +Àܳ¤µ¤ì¤¿ TCP ¥½¥±¥Ã¥È¤òÍѤ¤¡¢Ï¢Â³¤·¤¿Ì䤤¹ç¤ï¤»¤Î´Ö¤ËÀܳ¤ò°Ý»ý¤¹¤ë¡£ +µ¶¤Ê¤é¤Ð¥Í¡¼¥à¥µ¡¼¥Ð¤Ø¤ÎÌ䤤¹ç¤ï¤»¤Ë UDP ¥Ç¡¼¥¿¥°¥é¥à¤òÍѤ¤¤ë¡£ +.PP +.BR endhostent () +´Ø¿ô¤Ï¥Í¡¼¥à¥µ¡¼¥Ð¤Ø¤ÎÌ䤤¹ç¤ï¤»¤ËÍѤ¤¤¿ TCP Àܳ¤ÎÍøÍѤò½ªÎ»¤¹¤ë¡£ +.PP +(ÇÑ»ßͽÄê¤Î) +.BR herror () +´Ø¿ô¤Ï¸½ºß¤Î +.I h_errno +¤ËÂбþ¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɸ½à¥¨¥é¡¼ \fIstderr\fP ¤Ë½ÐÎϤ¹¤ë¡£ +.PP +(ÇÑ»ßͽÄê¤Î) +.BR hstrerror () +´Ø¿ô¤Ï¥¨¥é¡¼ÈÖ¹æ (Ä̾ï¤Ï \fIh_errno\fP) ¤ò°ú¤­¿ô¤Ë¼è¤ê¡¢ +Âбþ¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸Ê¸»úÎó¤òÊÖ¤¹¡£ +.PP +.BR gethostbyname () +¤È +.BR gethostbyaddr () +¤Ë¤è¤Ã¤Æ¼Â¹Ô¤µ¤ì¤ë¥É¥á¥¤¥ó̾¤ÎÌ䤤¹ç¤ï¤»¤Ç¤Ï¡¢¥Í¡¼¥à¥µ¡¼¥Ð +.BR named (8)¡¢ +.I /etc/hosts +¤Î¥Ç¡¼¥¿¹Ô¡¢¤ª¤è¤Ó +Network Information Service (NIS ¤Þ¤¿¤Ï YP) +¤¬ÁȤ߹ç¤ï¤»¤Æ»ÈÍѤµ¤ì¤ë¡£²¿¤¬»ÈÍѤµ¤ì¤ë¤«¤Ï¡¢ +.I /etc/host.conf +¤Î +.I order +¹Ô¤ÎÆâÍƤˤè¤ê·è¤Þ¤ë¡£ +.\" (¾Ü¤·¤¯¤Ï +.\" .BR resolv+ (8) +.\" ¤ò»²¾È)¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤Þ¤º +.BR named (8) +¤ËÌ䤤¹ç¤ï¤»¤ò¹Ô¤¤¡¢¼¡¤¤¤Ç +.I /etc/hosts +¤ò»²¾È¤¹¤ë¡£ +.PP +.I hostent +¹½Â¤ÂÎ¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +.ne 7 +struct hostent { + char *h_name; /* official name of host */ + char **h_aliases; /* alias list */ + int h_addrtype; /* host address type */ + int h_length; /* length of address */ + char **h_addr_list; /* list of addresses */ +} +#define h_addr h_addr_list[0] /* ²áµî¤È¤Î¸ß´¹À­¤Î¤¿¤á */ +.fi +.in +.PP +.I hostent +¹½Â¤ÂΤΥá¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ +.TP +.I h_name +¥Û¥¹¥È¤ÎÀµ¼°Ì¾ (official name)¡£ +.TP +.I h_aliases +¥Û¥¹¥È¤ÎÊÌ̾¤ÎÇÛÎó¡£ÇÛÎó¤Ï NULL ¥Ý¥¤¥ó¥¿¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.TP +.I h_addrtype +¥¢¥É¥ì¥¹¤Î¥¿¥¤¥×¡£¸½ºß¤Ï¤¹¤Ù¤Æ +.B AF_INET +¤Þ¤¿¤Ï +.B AF_INET6 +¤Ç¤¢¤ë¡£ +.TP +.I h_length +¥Ð¥¤¥Èñ°Ì¤Çɽ¤·¤¿¥¢¥É¥ì¥¹¤ÎŤµ¡£ +.TP +.I h_addr_list +¥Û¥¹¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¡£ +ÇÛÎó¤Ï NULL ¥Ý¥¤¥ó¥¿¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À·Á¼°¤Ç¤¢¤ë¡£ +.TP +.I h_addr +.I h_addr_list +¤ÎºÇ½é¤Î¥¢¥É¥ì¥¹¡£²áµî¤È¤Î¸ß´¹À­¤òÊݤĤ¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR gethostbyname () +¤ª¤è¤Ó +.BR gethostbyaddr () +´Ø¿ô¤Ï +.I hostent +¹½Â¤ÂΤòÊÖ¤¹¡£¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤é NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¥¨¥é¡¼¤ÎºÝ¤Ë¤Ï +.I h_errno +ÊÑ¿ô¤¬¥¨¥é¡¼¤ÎÈÖ¹æ¤òÊÝ»ý¤¹¤ë¡£ +ÊÖ¤êÃͤ¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ÀÅŪ¥Ç¡¼¥¿¤ò¥Ý¥¤¥ó¥¿¤Ç»Ø¤·¤Æ¤¤¤ë¤³¤È¤â¤¢¤ë¡£ +°Ê²¼¤Î¡ÖÃí°Õ¡×¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ¥¨¥é¡¼ +.I h_errno +ÊÑ¿ô¤Ï°Ê²¼¤ÎÃͤò¼è¤ê¤¦¤ë¡£ +.TP +.B HOST_NOT_FOUND +»ØÄꤷ¤¿¥Û¥¹¥È¤¬¸«¤Ä¤«¤é¤Ê¤¤¡£ +.TP +.B NO_ADDRESS " ¤Þ¤¿¤Ï " NO_DATA +»ØÄꤷ¤¿Ì¾Á°¤ÏÍ­¸ú¤À¤¬ IP ¥¢¥É¥ì¥¹¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B NO_RECOVERY +¥Í¡¼¥à¥µ¡¼¥Ð¤ÎÉüµìÉÔǽ¤Ê¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B TRY_AGAIN +authoritative ¤Ê¥Í¡¼¥à¥µ¡¼¥Ð¤Ç°ì»þŪ¤Ê¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +»þ´Ö¤ò¤ª¤¤¤Æ¤â¤¦°ìÅٻ¤³¤È¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/host.conf +̾Á°²ò·è¤ÎÀßÄê¥Õ¥¡¥¤¥ë +.TP +.I /etc/hosts +¥Û¥¹¥È¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.TP +.I /etc/nsswitch.conf +¥Í¡¼¥à¥µ¡¼¥Ó¥¹ÀÚÂØÀßÄê +.SH ½àµò +POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR gethostbyname (), +.BR gethostbyaddr (), +.BR sethostent (), +.BR endhostent (), +.BR gethostent (), +.I h_errno +¤¬µ¬Äꤵ¤ì¤Æ¤ª¤ê¡¢ +.BR gethostbyaddr () +¤È +.BR gethostbyname () +¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¤È¤µ¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2008 ¤Ç¤Ï +.BR gethostbyname (), +.BR gethostbyaddr (), +.I h_errno +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +Âå¤ï¤ê¤Ë¡¢ +.BR getaddrinfo (3) +¤È +.BR getnameinfo (3) +¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.BR gethostbyname () +¤ª¤è¤Ó +.BR gethostbyaddr () +´Ø¿ô¤ÏÀÅŪ¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢¤½¤Î¸å¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.I hostent +¹½Â¤ÂΤϥݥ¤¥ó¥¿¤ò´Þ¤ó¤Ç¤¤¤ë¤Î¤Ç¡¢¹½Â¤ÂΤΥ³¥Ô¡¼¤À¤±¤Ç¤ÏÉÔ½½Ê¬¤Ç¤¢¤ë; +¤è¤ê¿¼¤¤¥³¥Ô¡¼¤¬É¬ÍפǤ¢¤ë¡£ +.LP +¥ª¥ê¥¸¥Ê¥ë¤Î BSD ¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.BR gethostbyname () +¤Î +.I len +°ú¤­¿ô¤Ï +.I int +¤Ç¤¢¤Ã¤¿¡£ +SUSv2 ɸ½à¤Ï¥Ð¥°¤¬Â¿¤¯¡¢ +.BR gethostbyaddr () +¤Î +.I len +¥Ñ¥é¥á¡¼¥¿¤ò +.I size_t +·¿¤È¤·¤ÆÀë¸À¤·¤Æ¤¤¤ë¡£ +(¤³¤ì¤Ï¸í¤ê¤Ç¡¢ +.I size_t +·¿¤Ç¤Ï¤Ê¤¯ +.I int +·¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +POSIX.1-2001 ¤Ç¤Ï¤³¤ì¤ò +.I socklen_t +¤È¤·¤Æ¤¤¤ë¤¬¡¢¤³¤ì¤Ï OK¡£) +.BR accept (2) +¤â»²¾È¡£ +.LP +.BR gethostbyaddr () +¤Î BSD ¤Î¥×¥í¥È¥¿¥¤¥×¤Ï¡¢ºÇ½é¤Î°ú¤­¿ô¤È¤·¤Æ +.I const char * +¤ò»È¤¦¡£ +.SS "System V/POSIX ³ÈÄ¥" +POSIX ¤Ç¤Ï¡¢ +.BR gethostent () +¤¬É¬¿Ü¤È¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥Û¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +DNS/BIND ¤ò»È¤¦¾ì¹ç¤Ï¤¢¤Þ¤ê°ÕÌ£¤ò»ý¤¿¤Ê¤¤¤¬¡¢ +¥Û¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ 1 ¹Ô¤º¤ÄÆɤ߹þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¾ì¹ç¤Ï°ÕÌ£¤¬¤¢¤ë¡£ +¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î̾Á°¤Î¥ë¡¼¥Á¥ó¤Ï¥Õ¥¡¥¤¥ë +.I /etc/hosts +¤òÆɤ߹þ¤à¡£ +.\" Î㤨¤Ð¡¢Linux, FreeBSD, Unixware, HP-UX +DNS ¥µ¥Ý¡¼¥È¤Ê¤·¤Ç¥é¥¤¥Ö¥é¥ê¤¬¥Ó¥ë¥É¤µ¤ì¤¿¾ì¹ç¤Ë¤Î¤ßÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\" Î㤨¤Ð¡¢FreeBSD, AIX +glibc ÈÇ¤Ï ipv6 ¥¨¥ó¥È¥ê¤ò̵»ë¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È (reentrant) ¤Ç¤Ï¤Ê¤¯¡¢ +glibc ¤Ë¤Ï¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤΠ+.BR gethostent_r () +¤¬Äɲ䵤줿¡£ +.SS "GNU ³ÈÄ¥" +glibc2 ¤Ë¤Ï +.BR gethostbyname2 () +¤â¤¢¤ê¡¢ +.BR gethostbyname () +¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¤¬¡¢ +¤³¤Á¤é¤Ï¥¢¥É¥ì¥¹¤¬Â°¤¹¤ë¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +glibc2 ¤Ë¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê +.BR gethostent_r (), +.BR gethostbyaddr_r (), +.BR gethostbyname_r () +¤È +.BR gethostbyname2_r () +¤â¤¢¤ë¡£ +¸Æ¤Ó½Ð¤·Â¦¤Ï¡¢À®¸ù»þ¤Ë·ë²Ì¤¬³ÊǼ¤µ¤ì¤ë +.I hostent +¹½Â¤ÂÎ +.I ret +¤È¡¢Â礭¤µ +.I buflen +¤Î°ì»þŪ¤Êºî¶È¥Ð¥Ã¥Õ¥¡ +.I buf +¤òÄ󶡤¹¤ë¡£ +¥³¡¼¥ë½ªÎ»¸å¡¢À®¸ù¤·¤¿¾ì¹ç +.I result +¤Ï·ë²Ì¤ò»Ø¤·¤Æ¤¤¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤Þ¤¿¤Ï¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.I result +¤Ï NULL ¤Ë¤Ê¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤·¡¢¼ºÇԤξì¹ç¤Ï 0 °Ê³°¤Î¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Î¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ê¤¤¥Ð¡¼¥¸¥ç¥ó¤¬ÊÖ¤¹¥¨¥é¡¼¤Ë²Ã¤¨¤Æ¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ +.I buf +¤¬¾®¤µ¤¹¤®¤¿¾ì¹ç¤Ë +.B ERANGE +¤òÊÖ¤¹¡£¤³¤Î¾ì¹ç¤Ï¤â¤Ã¤ÈÂ礭¤Ê¥Ð¥Ã¥Õ¥¡¤òÍÑ°Õ¤·¤Æ +´Ø¿ô¸Æ¤Ó½Ð¤·¤òºÆÅÙ¹Ô¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +Âç°èÊÑ¿ô +.I h_errno +¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¤¬¡¢¥¨¥é¡¼ÈÖ¹æ¤ò³ÊǼ¤¹¤ëÊÑ¿ô¤Î¥¢¥É¥ì¥¹¤¬ +.I h_errnop +¤ËÅϤµ¤ì¤ë¡£ +.SH ¥Ð¥° +.BR gethostbyname () +¤Ï¡¢16¿Ê¿ôɽ¸½¤Î¥É¥Ã¥È¶èÀÚ¤ê¤Î IPv4 ¥¢¥É¥ì¥¹Ê¸»úÎó¤ÎÍ×ÁǤòǧ¼±¤·¤Ê¤¤¡£ +.\" http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=482973 +.SH ´ØÏ¢¹àÌÜ +.BR getaddrinfo (3), +.\" .BR getipnodebyaddr (3), +.\" .BR getipnodebyname (3), +.BR getnameinfo (3), +.BR inet (3), +.BR inet_ntop (3), +.BR inet_pton (3), +.BR resolver (3), +.BR hosts (5), +.BR nsswitch.conf (5), +.BR hostname (7), +.BR named (8) +.\" .BR resolv+ (8) diff --git a/release/man3/gethostid.3 b/release/man3/gethostid.3 new file mode 100644 index 00000000..61f3e8e6 --- /dev/null +++ b/release/man3/gethostid.3 @@ -0,0 +1,131 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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. +.\" +.\" Updated with additions from Mitchum DSouza +.\" 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 +.\" +.\" (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 2009-01-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +gethostid, sethostid \- ¸½ºß¤Î¥Û¥¹¥È¤Î¸ÇÍ­¤Î¼±Ê̻Ҥò¼èÆÀ/ÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.sp +.B long gethostid(void); +.br +.BI "int sethostid(long " hostid ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR sethostid (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.ad b +.SH ÀâÌÀ +.BR gethostid () +¤È +.BR sethostid () +¤Ï¡¢¤½¤ì¤¾¤ì¡¢¸½ºß»ÈÍѤ·¤Æ¤¤¤ë¥Û¥¹¥È¤Ë¸ÇÍ­¤Î 32 ¥Ó¥Ã¥È¤Î¼±Ê̻ҤΠ+¼èÆÀ/ÀßÄê¤ò¹Ô¤¦¡£ +¤³¤Î 32 ¥Ó¥Ã¥È¤Î¼±Ê̻Ҥϡ¢¸½ºß¸ºß¤·¤Æ¤¤¤ëÁ´¤Æ¤Î Unix ¥·¥¹¥Æ¥à +¤ÎÃæ¤ÇÍ£°ì¤Ë¤Ê¤ë¤è¤¦¤Ë·è¤á¤é¤ì¤ë¡£Ä̾ï¤Ï +.BR gethostbyname (3) +¤Ë¤è¤êÊÖ¤µ¤ì¤ë¥í¡¼¥«¥ë¥Þ¥·¥ó¤Î Internet ¥¢¥É¥ì¥¹¤¬Âå¤ï¤ê¤Ë»ÈÍѤµ¤ì¡¢ +ÉáÄ̤ϼ±Ê̻Ҥò¤¢¤¨¤ÆÀßÄꤹ¤ëɬÍפϤʤ¤¡£ + +.BR sethostid () +¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤·¤«»ÈÍѤǤ­¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR gethostid () +¤Ï¡¢ +.BR sethostid () +¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤¿¡¢¸½ºß»ÈÍѤ·¤Æ¤¤¤ë¥Û¥¹¥È¤Î 32 ¥Ó¥Ã¥È¤Î¼±Ê̻ҤÎÃͤòÊÖ¤¹¡£ + +À®¸ù¤¹¤ë¤È¡¢ +.BR sethostid () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.BR sethostid () +¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EACCES +¸Æ¤Ó½Ð¤·¸µ¤¬¥Û¥¹¥È ID ¤òÊݸ¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ø¤Î +½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPERM +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID/GID ¤¬Âбþ¤¹¤ë¼Â UID/GID ¤ÈƱ¤¸¤Ç¤Ï¤Ê¤¤¡£ +.SH ½àµò +4.2BSD¡£4.4BSD ¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£ +SVr4 ¤Ë¤Ï +.BR gethostid () +¤Ï´Þ¤Þ¤ì¤Æ¤¤¤ë¤¬¡¢ +.BR sethostid () +¤Ï´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR gethostid () +¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤ë¤¬¡¢ +.BR sethostid () +¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH Ãí°Õ +glibc ¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.I hostid +¤Ï¥Õ¥¡¥¤¥ë +.I /etc/hostid +¤ËÊݸ¤µ¤ì¤ë +(¥Ð¡¼¥¸¥ç¥ó 2.2 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢ +.I /var/adm/hostid +¤¬»ÈÍѤµ¤ì¤Æ¤¤¤¿)¡£ +.\" libc5 used /etc/hostid; libc4 didn't have these functions + +glibc ¤Î¼ÂÁõ¤Ç¤Ï¡¢¥Û¥¹¥È ID ¤òÊݸ¤·¤¿¥Õ¥¡¥¤¥ë¤ò +¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.BR gethostid () +¤Ï +.BR gethostname (2) +¤ò»È¤Ã¤Æ¥Û¥¹¥È̾¤òÆþ¼ê¤·¡¢¤½¤Î¥Û¥¹¥È̾¤ò +.BR gethostbyname_r (3) +¤ËÅϤ·¥Û¥¹¥È¤Î IPv4 ¥¢¥É¥ì¥¹¤ò¼èÆÀ¤·¤Æ¡¢ +¤½¤Î IPv4 ¥¢¥É¥ì¥¹¤Î¥Ó¥Ã¥ÈÆþ¤ìÂؤ¨¤ò¹Ô¤Ã¤¿ÃͤòÊÖ¤¹¡£ +.SH ¥Ð¥° +¼±Ê̻Ҥ¬À¤³¦Ãæ¤Ç°ì°Õ¤Ç¤¢¤ë¤³¤È¤òÊݾڤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR hostid (1), +.BR gethostbyname (3) diff --git a/release/man3/getipnodebyname.3 b/release/man3/getipnodebyname.3 new file mode 100644 index 00000000..2e3f579c --- /dev/null +++ b/release/man3/getipnodebyname.3 @@ -0,0 +1,263 @@ +.\" Copyright 2000 Sam Varshavchik +.\" +.\" 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: RFC 2553 +.\" +.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. +.\" Translated Sun Jan 14 2001 by NAKANO Takeo +.\" Updated Tue Nov 26 2002 by Kentaro Shirakata +.\" +.\"WORD: null pointer ¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿¡¼ +.\" +.TH GETIPNODEBYNAME 3 2007-11-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getipnodebyname, getipnodebyaddr, freehostent \- ¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î̾Á°¤È¥¢¥É¥ì¥¹¤Î¼èÆÀ +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "struct hostent *getipnodebyname(const char *" name ", int " af , +.BI " int " flags ", int *" error_num ); +.sp +.BI "struct hostent *getipnodebyaddr(const void *" addr ", size_t " len , +.BI " int " af ", int *" "error_num" ); +.sp +.BI "void freehostent(struct hostent *" "ip" ); +.fi +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÈó¿ä¾©¤Ç¤¢¤ë (glibc ¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤)¡£ +Âå¤ï¤ê¤Ë +.BR getaddrinfo (3) +¤È +.BR getnameinfo (3) +¤ò»È¤¦¤³¤È¡£ +.LP +.BR getipnodebyname () +¤È +.BR getipnodebyaddr () +¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î̾Á°¤È¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢°Ê²¼¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.sp +.in +4n +.nf +struct hostent { + char *h_name; + char **h_aliases; + int h_addrtype; + int h_length; + char **h_addr_list; +}; +.fi +.in +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ IPv4 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¤Ë¤·¤«¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤ +.BR gethostbyname (3) +¤ä +.BR gethostbyaddr (3) +¤òÃÖ¤­´¹¤¨¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.BR getipnodebyname () +´Ø¿ô¤È +.BR getipnodebyaddr () +´Ø¿ô¤ÏÊ£¿ô¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ë¥¢¥¯¥»¥¹²Äǽ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ +.B gethostby +¤Î´Ø¿ô·²¤È°Û¤Ê¤ê¡¢Æ°Åª¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¸µ¤¬¤³¤ì¤é¤Î +.I hostent +¹½Â¤ÂΤòɬÍפȤ·¤Ê¤¯¤Ê¤Ã¤¿¸å¤Ï¡¢ +.BR freehostent () +´Ø¿ô¤òÍѤ¤¤ì¤ÐưŪ¤Ê³ä¤êÅö¤Æ¥á¥â¥ê¤ò²òÊü¤Ç¤­¤ë¡£ +.SS getipnodebyname() ¤Î°ú¤­¿ô +.BR getipnodebyname () +´Ø¿ô¤Ï +.I name +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿¥Û¥¹¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ò°ú¤¯¡£ +.I af +°ú¤­¿ô¤Ë¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ +.TP +.B AF_INET +.I name +°ú¤­¿ô¤Ï¡¢¥É¥Ã¥È¤Ç 4 ¤Ä¤Ë¶èÀÚ¤é¤ì¤¿ IPv4 ¥¢¥É¥ì¥¹¤«¡¢ +IPv4 ¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î̾Á°¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.TP +.B AF_INET6 +.I name +°ú¤­¿ô¤Ï¡¢16 ¿Ê¤Î IPv6 ¥¢¥É¥ì¥¹¤«¡¢ +IPv6 ¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î̾Á°¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.PP +.I flags +¥Ñ¥é¥á¡¼¥¿¤Ë¤ÏÄɲäΥª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¡£ +Ê£¿ô¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤Ë¤Ï¡¢¤½¤ì¤é¤ÎÏÀÍý OR ¤ò¤È¤Ã¤Æ»ØÄꤹ¤ì¤Ð¤è¤¤¡£ +¥ª¥×¥·¥ç¥ó¤ò¤Ò¤È¤Ä¤â»ØÄꤷ¤¿¤¯¤Ê¤¤¤È¤­¤Ë¤Ï¡¢ +.I flags +¤Ë 0 ¤òÀßÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ +.TP +.B AI_V4MAPPED +¤³¤Î¥Õ¥é¥°¤Ï +.B AF_INET6 +¤È¶¦¤ËÍѤ¤¤é¤ì¡¢IPv6 ¥¢¥É¥ì¥¹¤ÎÂå¤ï¤ê¤Ë IPv4 ¥¢¥É¥ì¥¹¤òÌ䤤¹ç¤ï¤»¤ë¡£ +Ì䤤¹ç¤ï¤»¤ë IPv4 ¥¢¥É¥ì¥¹¤Ï IPv6 ¥¢¥É¥ì¥¹¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¡£ +.TP +.B AI_ALL +¤³¤Î¥Õ¥é¥°¤Ï +.B AI_V4MAPPED +¤È¶¦¤ËÍѤ¤¤é¤ì¡¢IPv4 ¥¢¥É¥ì¥¹¤È IPv6 ¥¢¥É¥ì¥¹¤ÎξÊý¤òÌ䤤¹ç¤ï¤»¤ë¡£ +¸«¤Ä¤«¤Ã¤¿ IPv4 ¥¢¥É¥ì¥¹¤Ï¡¢¤¹¤Ù¤Æ IPv6 ¥¢¥É¥ì¥¹¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¡£ +.TP +.B AI_ADDRCONFIG +¤³¤Î¥Õ¥é¥°¤Ï +.B AF_INET6 +¤È¶¦¤ËÍѤ¤¤é¤ì¡¢ +IPv6 ¤¬³ä¤êÅö¤Æ¤é¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ +¥·¥¹¥Æ¥à¤Ë¤Ò¤È¤Ä¤â¤Ê¤±¤ì¤Ð IPv6 ¥¢¥É¥ì¥¹¤ÎÌ䤤¹ç¤ï¤»¤ò¹Ô¤ï¤º¡¢ +IPv4 ¤¬³ä¤êÅö¤Æ¤é¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ +¥·¥¹¥Æ¥à¤Ë¤Ò¤È¤Ä¤â¤Ê¤±¤ì¤Ð IPv4 ¥¢¥É¥ì¥¹¤ÎÌ䤤¹ç¤ï¤»¤ò¹Ô¤ï¤Ê¤¤¤è¤¦¤ËÍ׵᤹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ÏñÆȤǤ⡢¤¢¤ë¤¤¤Ï +.B AI_V4MAPPED +¥Õ¥é¥°¤È¶¦¤Ë¤Ç¤âÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B AI_DEFAULT +¤³¤Î¥Õ¥é¥°¤Ï +.BR (AI_ADDRCONFIG | AI_V4MAPPED) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.SS "getipnodebyaddr() ¤Î°ú¤­¿ô" +.BR getipnodebyaddr () +´Ø¿ô¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬ +.I addr +°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿¥Û¥¹¥È¤Î̾Á°¤ò°ú¤¯¡£ +.I af +°ú¤­¿ô¤Ë¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ +.TP +.B AF_INET +.I addr +°ú¤­¿ô¤Ï +.I struct in_addr +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ê¡¢ +.I len +°ú¤­¿ô¤Ï +.I sizeof(struct in_addr) +¤ËÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B AF_INET6 +.I addr +°ú¤­¿ô¤Ï +.I struct in6_addr +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ê¡¢ +.I len +°ú¤­¿ô¤Ï +.I sizeof(struct in6_addr) +¤ËÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +¥¨¥é¡¼¤¬µ¯¤³¤ë¤È¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿¡¼¤¬ÊÖ¤µ¤ì¡¢ +.I error_num +¤Ë°Ê²¼¤Ë¥ê¥¹¥È¤µ¤ì¤¿¥¨¥é¡¼¥³¡¼¥É¤Î¤¤¤º¤ì¤«¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +.B HOST_NOT_FOUND +¥Û¥¹¥È̾¤Þ¤¿¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.TP +.B NO_ADDRESS +¥É¥á¥¤¥ó¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤Ï +¤½¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Þ¤¿¤Ï¥Í¥Ã¥È¥ï¡¼¥¯Ì¾¤òǧ¼±¤·¤¿¤¬¡¢ +ÊÖ»ö¤¬Ê֤äƤ³¤Ê¤«¤Ã¤¿¡£¸¶°ø¤È¤·¤Æ¤Ï¡¢ +Î㤨¤Ð IPv4 ¥¢¥É¥ì¥¹¤·¤«»ý¤¿¤Ê¤¤¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤ËÂФ·¤Æ +IPv6 ¤Î¾ðÊó¤ÎÌ䤤¹ç¤ï¤»¤¬¹Ô¤ï¤ì¤¿ (¤ª¤è¤Ó¤½¤ÎµÕ) ¤Ê¤É¤¬¹Í¤¨¤é¤ì¤ë¡£ +.TP +.B NO_RECOVERY +¥É¥á¥¤¥ó¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é¹±µ×Ū¤Ê¼ºÇÔ (permanent failure) +¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£ +.TP +.B TRY_AGAIN +¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é°ì»þŪ¤Ê¼ºÇÔ (temporary failure) +¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£¼¡¤Ë¤Ï¤â¤¦¤Á¤ç¤Ã¤È±¿¤¬É¬Íפ«¤â¡£ +.PP +Ì䤤¹ç¤ï¤»¤ËÀ®¸ù¤¹¤ë¤È¡¢ +.I hostent +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¥Õ¥£¡¼¥ë¥É¤«¤é¤Ê¤ë¡£ +.TP +.I h_name +¤³¤ì¤Ï¤³¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î¥ª¥Õ¥£¥·¥ã¥ë¤Ê̾Á°¤Ç¤¢¤ë¡£ +.TP +.I h_aliases +¤³¤ì¤Ï¡¢¤½¤Î¥Û¥¹¥È¤Î¥ª¥Õ¥£¥·¥ã¥ë¤Ç¤Ê¤¤ÊÌ̾¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤ÎÇÛÎó¤Ç¤¢¤ë¡£ +ÇÛÎó¤Ï¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿¡¼¤Ç½ªÃ¼¤¹¤ë¡£ +.TP +.I h_addrtype +¤³¤ì¤Ï +.BR getipnodebyname () +¤Þ¤¿¤Ï +.BR getipnodebyaddr () +¤ËÍ¿¤¨¤é¤ì¤¿ +.I af +°ú¤­¿ô¤Î¥³¥Ô¡¼¤Ç¤¢¤ë¡£ +.I af +°ú¤­¿ô¤¬ +.B AF_INET +¤Ê¤é +.I h_addrtype +¤Ï¾ï¤Ë +.B AF_INET +¤Ë¤Ê¤ê¡¢ +.I af +°ú¤­¿ô¤¬ +.B AF_INET6 +¤Ê¤é +.I h_addrtype +¤â¾ï¤Ë +.B AF_INET6 +¤Ë¤Ê¤ë¡£ +.TP +.I h_length +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +.I h_addrtype +¤¬ +.B AF_INET +¤Ê¤é +.I sizeof(struct in_addr) +¤Ë¡¢ +.I h_addrtype +¤¬ +.B AF_INET6 +¤Ê¤é +.I sizeof(struct in6_addr) +¤ËÀßÄꤵ¤ì¤ë¡£ +.TP +.I h_addr_list +¤³¤ì¤Ï¤Ò¤È¤Ä°Ê¾å¤Î¥Ý¥¤¥ó¥¿¡¼¤ÎÇÛÎó¤Ç¡¢ +¤½¤ì¤¾¤ì¤Î¥Ý¥¤¥ó¥¿¡¼¤Ï¡¢ +¤½¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤ËÂбþ¤¹¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¹½Â¤ÂΤò»Ø¤¹¡£ +¤³¤ÎÇÛÎó¤Ï¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿¡¼¤Ç½ªÃ¼¤¹¤ë¡£ +.SH ½àµò +RFC\ 2553. +.\" POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc 2.1.91-95 ¤Ë¸ºß¤·¤¿¤¬¡¢ºÆ¤Óºï½ü¤µ¤ì¤¿¡£ +¤¤¤¯¤Ä¤«¤Î Unix É÷¥·¥¹¥Æ¥à¤Ï¤³¤ì¤é¤Î´Ø¿ô¤ËÂбþ¤·¤Æ¤¤¤ë¤¬¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÁ´¤Æ¿ä¾©¤µ¤ì¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getaddrinfo (3), +.BR getnameinfo (3), +.BR inet_ntop (3), +.BR inet_pton (3) diff --git a/release/man3/getline.3 b/release/man3/getline.3 new file mode 100644 index 00000000..6575876e --- /dev/null +++ b/release/man3/getline.3 @@ -0,0 +1,178 @@ +.\" Copyright (c) 2001 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. +.\" +.\" Japanese Version Copyright (c) 2001 Yuichi SATO +.\" all rights reserved. +.\" Translated 2001-11-09, Yuichi SATO +.\" Updated 2006-07-20, Akihiro MOTOKI , LDP v2.34 +.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24 +.\" +.\"WORD: delimiter ¶èÀÚ¤êʸ»ú +.\" +.TH GETLINE 3 2009-12-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getline, getdelim \- ¶èÀÚ¤êʸ»ú¤Þ¤Ç¤Îʸ»úÎóÆþÎϤòÆɤ߹þ¤à +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "ssize_t getline(char **" lineptr ", size_t *" n ", FILE *" stream ); + +.BI "ssize_t getdelim(char **" lineptr ", size_t *" n ", int " delim \ +", FILE *" stream ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in + +glibc 2.10 ¤è¤êÁ°: +.br +.BR getline (), +.BR getdelim (): +_GNU_SOURCE + +glibc 2.10 °Ê¹ß: +.br +.BR getline (), +.BR getdelim (): +_POSIX_C_SOURCE >= 200809 || _XOPEN_SOURCE >= 700 +.SH ÀâÌÀ +.BR getline () +¤Ï \fIstream\fP ¤«¤é 1 ¹ÔÁ´¤Æ¤òÆɤ߹þ¤ß¡¢¥Æ¥­¥¹¥È¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡¤Î¥¢¥É¥ì¥¹¤ò +.I "*lineptr" +¤Ë³ÊǼ¤¹¤ë¡£ +¥Ð¥Ã¥Õ¥¡¤Ï¥Ì¥ëʸ»ú (\e0) ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +²þ¹Ôʸ»ú¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ï¡¢²þ¹Ôʸ»ú¤â¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ë¡£ + +.I "*lineptr" +¤¬ NULL ¤Î¾ì¹ç¡¢ +.BR getline () +¤Ï¹Ô¤ÎÆâÍƤò³ÊǼ¤¹¤ë¤¿¤á¤Î¥Ð¥Ã¥Õ¥¡¤ò³ÎÊݤ¹¤ë¡£ +¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¥æ¡¼¥¶¡¼¤Î¥×¥í¥°¥é¥à¤Ç²òÊü¤¹¤Ù¤­¤Ç¤¢¤ë +.RI ( *n +¤ÎÃͤÏ̵»ë¤µ¤ì¤ë)¡£ + +Ê̤ÎÊýË¡¤È¤·¤Æ¡¢ +.BR getline () +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë¡¢ +.I "*lineptr" +¤Ë +.BR malloc (3) +¤Ç³ÎÊݤ·¤¿Â礭¤µ +.I "*n" +¥Ð¥¤¥È¤Î¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÆþ¤ì¤ÆÅϤ¹¤³¤È¤â¤Ç¤­¤ë¡£ +Æɤ߹þ¤ó¤À¹Ô¤òÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¤¬¤Ê¤¤¾ì¹ç¡¢ +.BR getline () +¤Ï +.BR realloc (3) +¤ò»È¤Ã¤Æ¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òÊѹ¹¤·¡¢É¬Íפ˱þ¤¸¤Æ +.I "*lineptr" +¤È +.I "*n" +¤ò¹¹¿·¤¹¤ë¡£ + +¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢¸Æ¤Ó½Ð¤·¤ËÀ®¸ù¤·¤¿¤È¤­¤Ë¤Ï¡¢ +.I "*lineptr" +¤È +.I "*n" +¤¬¥Ð¥Ã¥Õ¥¡¤Î¥¢¥É¥ì¥¹¤È³ä¤êÅö¤Æ¤¿¥µ¥¤¥º¤òÈ¿±Ç¤·¤¿Ãͤ˹¹¿·¤µ¤ì¤ë¡£ + +.BR getdelim () +¤Ï +.BR getline () +¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¤¬¡¢²þ¹Ôʸ»ú°Ê³°¤Î¶èÀÚ¤êʸ»ú¤ò°ú¤­¿ô +.I delim +¤Ë»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR getline () +¤ÈƱÍͤˡ¢¥Õ¥¡¥¤¥ë½ªÃ¼¤Ë㤹¤ë¤Þ¤Ç¤ËÆþÎϹԤ˶èÀÚ¤êʸ»ú¤¬¸«ÉÕ¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢ +¶èÀÚ¤êʸ»ú¤ò¥Ð¥Ã¥Õ¥¡¤ËÄɲ䷤ʤ¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR getline () +¤È +.BR getdelim () +¤ÏÆɤ߹þ¤ó¤Àʸ»ú¿ô¤òÊÖ¤¹¡£ +ʸ»ú¿ô¤Ë¤Ï¶èÀÚ¤êʸ»ú¤Ï´Þ¤Þ¤ì¤ë¤¬¡¢½ªÃ¼¤Ë»È¤¦ NULL ¥Ð¥¤¥È¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +¤³¤ÎÃͤˤè¤Ã¤Æ¡¢Æɤ߹þ¤ó¤À¹Ô¤Ë´Þ¤Þ¤ì¤ë NULL ¥Ð¥¤¥È¤òÁàºî¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¤É¤Á¤é¤Î´Ø¿ô¤â¡¢¹Ô¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤¹ +(¥Õ¥¡¥¤¥ë¤Î½ªÃ¼¤Ë㤷¤¿¾ì¹ç¤Ë¤â \-1 ¤òÊÖ¤¹)¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +°ú¤­¿ô¤¬ÉÔÀµ¤Ç¤¢¤ë +.RI ( n +¤Þ¤¿¤Ï +.I lineptr +¤¬ NULL ¤Ç¤¢¤ë¡£ +¤â¤·¤¯¤Ï +.I stream +¤¬Í­¸ú¤Ç¤Ê¤¤)¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï libc 4.6.27 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +.BR getline () +¤È +.BR getdelim () +¤Ï¡¢¤É¤Á¤é¤â¸µ¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤Ã¤¿¤¬¡¢ +POSIX.1-2008 ¤Çɸ½à²½¤µ¤ì¤¿¡£ +.SH Îã +.nf +#define _GNU_SOURCE +#include +#include + +int +main(void) +{ + FILE * fp; + char * line = NULL; + size_t len = 0; + ssize_t read; + + fp = fopen("/etc/motd", "r"); + if (fp == NULL) + exit(EXIT_FAILURE); + + while ((read = getline(&line, &len, fp)) != \-1) { + printf("Retrieved line of length %zu :\en", read); + printf("%s", line); + } + + if (line) + free(line); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR read (2), +.BR fgets (3), +.BR fopen (3), +.BR fread (3), +.BR gets (3), +.BR scanf (3), +.BR feature_test_macros (7) diff --git a/release/man3/getloadavg.3 b/release/man3/getloadavg.3 new file mode 100644 index 00000000..c6f03a5d --- /dev/null +++ b/release/man3/getloadavg.3 @@ -0,0 +1,74 @@ +.\" Copyright (c) 1989, 1991, 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. 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. +.\" +.\" @(#)getloadavg.3 8.1 (Berkeley) 6/4/93 +.\" +.\" 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 Éé²ÙÊ¿¶Ñ +.\" +.TH GETLOADAVG 3 2007-12-08 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getloadavg \- get system load averages +.SH ½ñ¼° +.nf +.B #define _BSD_SOURCE +.B #include +.sp +.BI "int getloadavg(double " loadavg[] ", int " nelem ); +.fi +.SH ÀâÌÀ +.BR getloadavg () +´Ø¿ô¤Ï¥·¥¹¥Æ¥à¤Î¼Â¹Ô¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î¿ô¤ò¡¢ +ÍÍ¡¹¤Ê´ü´Ö¤Ë¤Ä¤¤¤ÆÊ¿¶Ñ¤·¤¿ÃͤòÊÖ¤¹¡£ +.I nelem +¸Ä¤Þ¤Ç¤Î¥µ¥ó¥×¥ëÃͤò¼èÆÀ¤·¡¢ +.IR loadavg [] +¤ÎϢ³¤¹¤ëÍ×ÁǤËÂåÆþ¤¹¤ë¡£ +¥·¥¹¥Æ¥à¤¬Ä󶡤¹¤ë¥µ¥ó¥×¥ë¿ô¤Ï 3 ¸Ä¤Þ¤Ç¤Ç¡¢ +¤½¤ì¤¾¤ìºÇ¶á 1, 5, 15 ʬ¤ÎÊ¿¶Ñ¤òɽ¤·¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +Éé²ÙÊ¿¶Ñ¤¬¼èÆÀ¤Ç¤­¤Ê¤¤¤È \-1 ¤òÊÖ¤¹¡£ +¼èÆÀ¤Ç¤­¤¿¾ì¹ç¤Ï¡¢¼ÂºÝ¤Ë¼èÆÀ¤·¤¿¥µ¥ó¥×¥ëÃͤοô¤òÊÖ¤¹¡£ +.\" .SH ÍúÎò +.\" .BR getloadavg () +.\" ´Ø¿ô¤Ï +.\" 4.3BSD Reno +.\" ¤ÇÅо줷¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î´Ø¿ô¤Ï glibc ¤Î¥Ð¡¼¥¸¥ç¥ó 2.2 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¤È Solaris ¤Ë¸ºß¤¹¤ë¡£ +.\" mdoc seems to have a bug - there must be no newline here +.SH ´ØÏ¢¹àÌÜ +.BR uptime (1), +.BR proc (5), +.BR feature_test_macros (7) diff --git a/release/man3/getlogin.3 b/release/man3/getlogin.3 new file mode 100644 index 00000000..4df8c4b3 --- /dev/null +++ b/release/man3/getlogin.3 @@ -0,0 +1,200 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1995 James R. Van Zandt +.\" +.\" 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. +.\" +.\" 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 +.\" +.TH GETLOGIN 3 2008-06-29 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getlogin, getlogin_r, cuserid \- ¥æ¡¼¥¶¡¼Ì¾¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.B "char *getlogin(void);" +.br +.BI "int getlogin_r(char *" buf ", size_t " bufsize ); +.sp +.B #include +.sp +.BI "char *cuserid(char *" string ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR getlogin_r (): +_REENTRANT || _POSIX_C_SOURCE\ >=\ 199506L +.br +.BR cuserid (): +_XOPEN_SOURCE +.SH ÀâÌÀ +.BR getlogin () +¤Ï¡¢¸½ºß¤Î¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤Ë¥í¥°¥¤¥ó¤·¤Æ¤¤¤ë¥æ¡¼¥¶¡¼Ì¾¤Îʸ»úÎó¤Ø¤Î +¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¥æ¡¼¥¶¡¼Ì¾¤¬·èÄê¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï null ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +ʸ»úÎó¤ÏÀÅŪÎΰè¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤ª¤ê¡¢¤³¤Î¸å¤Ç¤³¤Î´Ø¿ô¤ä +.BR cuserid () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿ºÝ¤Ë¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.PP +.BR getlogin_r () +¤Ï¡¢¾åµ­¤ÎƱ¤¸¥æ¡¼¥¶Ì¾¤ò¡¢Â礭¤µ +.I bufsize +¤ÎÇÛÎó +.I buf +¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +.PP +.BR cuserid () +¤Ï¡¢¸½ºß¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ID ¤ËÂбþ¤¹¤ë¥æ¡¼¥¶¡¼Ì¾¤Î +ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +\fIstring\fP ¤¬ null ¥Ý¥¤¥ó¥¿°Ê³°¤Î¾ì¹ç¡¢\fIstring\fP ¤Ï¾¯¤Ê¤¯¤È¤â +\fBL_cuserid\fP ʸ»ú¤òÊÝ»ý¤Ç¤­¤ëÇÛÎó¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +\fIstring\fP ¤¬ null ¥Ý¥¤¥ó¥¿¤Î¾ì¹ç¤Ë¤Ï¡¢ÀÅŪÎΰè¤ËÃÖ¤«¤ì¤¿Ê¸»úÎó¤Ø¤Î +¥Ý¥¤¥ó¥¿¤¬ÊÖ¤µ¤ì¤ë¡£¤³¤Îʸ»úÎó¤ÏÀÅŪÎΰè¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤ª¤ê¡¢¸å¤Ç +¤³¤Î´Ø¿ô¤ä +.BR getlogin () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿ºÝ¤Ë¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.PP +¥Þ¥¯¥í \fBL_cuserid\fP ¤Ï integer ¤ÎÄê¿ô¤Ç¡¢¥æ¡¼¥¶¡¼Ì¾¤òÊÝ»ý¤¹¤ë¤¿¤á¤Ë +ɬÍפÊÇÛÎó¤ÎŤµ¤ò¼¨¤¹¡£ \fBL_cuserid\fP ¤Ï \fBstdio.h\fP ¤ÇÀë¸À¤µ¤ì¤Æ +¤¤¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤ò»È¤¦¤È¡¢¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¥æ¡¼¥¶¡¼ +.RB ( cuserid ()) +¤ä +¤³¤Î¥»¥Ã¥·¥ç¥ó¤Ë¥í¥°¥¤¥ó¤·¤Æ¤¤¤ë¥æ¡¼¥¶¡¼ +.RB ( getlogin ()) +¤òÌÀ³Î¤ËÆÃÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë +(¤¿¤À¤· set-user-ID ¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¾õ¶·¤¬°ã¤¦¤³¤È¤â¤¢¤ë)¡£ +.PP +¤¿¤¤¤Æ¤¤¤ÎÌÜŪ¤Ç¤Ï¡¢¥æ¡¼¥¶¡¼¤ÎÆÃÄê¤Ë¤Ï´Ä¶­ÊÑ¿ô \fBLOGNAME\fP ¤òÄ´¤Ù +¤ë¤Û¤¦¤¬ÊØÍø¤Ç¤¢¤ë¡£LOGNAME ÊÑ¿ô¤Ï¥æ¡¼¥¶¡¼¤¬¼«Í³¤ËÀßÄê¤Ç¤­¤ë¤Î¤Ç +¤è¤ê½ÀÆð¤ÊÂбþ¤¬²Äǽ¤Ë¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR getlogin () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï¥æ¡¼¥¶Ì¾¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤·¡¢¼ºÇÔ¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.BR getlogin_r () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤¹¤ë¤È 0 °Ê³°¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +POSIX ¤Ç¤Ï°Ê²¼¤Î¥¨¥é¡¼¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë: +.TP +.B EMFILE +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤¬¤¹¤Ç¤Ë¥×¥í¥»¥¹¤¢¤¿¤ê¤Î +¾å¸Â¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENFILE +¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤¬¤¹¤Ç¤Ë¾å¸Â¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENXIO +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤ÏÀ©¸æüËö¤¬¤Ê¤¤¡£ +.TP +.B ERANGE +(getlogin_r) +(½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤â´Þ¤á¤¿) ¥æ¡¼¥¶Ì¾¤ÎŤµ¤¬ +.I bufsize +¤è¤ê¤âŤ¤¡£ +.LP +Linux/glibc ¤Ë¤Ï°Ê²¼¤Î¥¨¥é¡¼¤â¤¢¤ë¡£ +.TP +.B ENOENT +utmp ¥Õ¥¡¥¤¥ë¤ËÂбþ¤¹¤ë¥¨¥ó¥È¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +passwd ¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOTTY +ɸ½àÆþÎϤ¬Ã¼Ëö¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤ (¡Ö¥Ð¥°¡×¤ÎÀá¤ò»²¾È)¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +\fI/etc/passwd\fP +¥Ñ¥¹¥ï¡¼¥É¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Õ¥¡¥¤¥ë +.TP +\fI/var/run/utmp\fP +(ÅÁÅýŪ¤Ë¤Ï \fI/etc/utmp\fP ¤¬»È¤ï¤ì¤Æ¤¤¤ë; +libc ¤ÎÃæ¤Ë¤Ï \fI/var/adm/utmp\fP ¤ò»È¤¦¤â¤Î¤â¤¢¤ë) +.SH ½àµò +.BR getlogin () +¤È +.BR getlogin_r () +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +System V ¤Ë¤â +.BR cuserid () +¤¬¤¢¤ë¤¬¡¢ +¤³¤ì¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤Ç¤Ï¤Ê¤¯¡¢¼Â¥æ¡¼¥¶¡¼ ID ¤ò»ÈÍѤ¹¤ë¡£ +.BR cuserid () +´Ø¿ô¤Ï 1988 ǯÈǤΠPOSIX ¤Ë¤Ï´Þ¤Þ¤ì¤Æ¤¤¤¿¤¬¡¢ +1990 ǯÈǤǤϺï½ü¤µ¤ì¤¿¡£ +SUSv2 ¤Ë¸ºß¤·¤¿¤¬¡¢POSIX.1-2001 ¤Çºï½ü¤µ¤ì¤¿¡£ +.LP +OpenBSD ¤Ë¤Ï +.BR getlogin () +¤È +.BR setlogin () +¤¬¤¢¤ê¡¢ +¥»¥Ã¥·¥ç¥ó¤ËÂбþ¤·¤¿¥æ¡¼¥¶Ì¾¤¬¤¢¤ë¡£À©¸æüËö¤¬¤Ê¤¤ +¥»¥Ã¥·¥ç¥ó¤Î¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢Âбþ¤¹¤ë¥æ¡¼¥¶Ì¾¤¬¤¢¤ë¡£ +.SH ¥Ð¥° +»ÄÇ°¤Ê¤¬¤é¡¢ +.BR getlogin () +¤ò¤À¤Þ¤¹¤Î¤Ï¤½¤ì¤Û¤ÉÆñ¤·¤¤¤³¤È¤Ç¤Ï¤Ê¤¤¡£ÊÌ¤Î¥×¥í¥°¥é¥à¤¬ utmp ¥Õ¥¡¥¤¥ë¤ò +²õ¤·¤Æ¤·¤Þ¤¦¤È¡¢Á´¤¯Æ°ºî¤·¤Ê¤¤¤³¤È¤â¤¢¤ë¡£¤Þ¤¿¥í¥°¥¤¥ó̾¤ÎºÇ½é¤Î 8 ʸ»ú +¤·¤«ÊÖ¤µ¤Ê¤¤¤³¤È¤â¿¤¤¡£¤Þ¤¿¥×¥í¥°¥é¥à¤òÀ©¸æ¤·¤Æ¤¤¤ë tty ¤Ë +¸½ºß¥í¥°¥¤¥ó¤·¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¤Ï¡¢¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤¿ +¥æ¡¼¥¶¡¼¤Ç¤Ê¤¤¾ì¹ç¤â¤¢¤ë¡£ +¥»¥­¥å¥ê¥Æ¥£¤ÎÍí¤àÍÑÅÓ¤Ë¤Ï +.BR getlogin () +¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.LP +glibc ¤Ï POSIX »ÅÍͤˤϽ¾¤Ã¤Æ¤ª¤é¤º¡¢ +.I /dev/tty +¤Ç¤Ï¤Ê¤¯ +.I "ɸ½àÆþÎÏ (stdin)" +¤ò»È¤¦¡£¤³¤ì¤Ï¥Ð¥°¤Ç¤¢¤ë¡£ +(SunOS 5.8 ¤ä HP-UX 11.11 ¤ä FreeBSD 4.8 ¤È¤¤¤Ã¤¿Â¾¤ÎºÇ¶á¤Î¥·¥¹¥Æ¥à¤Ï¤¤¤º¤ì¤â¡¢ +.I ɸ½àÆþÎÏ +¤¬¥ê¥À¥¤¥ì¥¯¥È¤µ¤ì¤¿¾ì¹ç¤Ç¤â¥í¥°¥¤¥ó̾¤òÊÖ¤¹¡£) +.LP +.BR cuserid () +¤¬²¿¤ò¹Ô¤Ã¤Æ¤¤¤ë¤Î¤«¡¢¼ÂºÝ¤Î¤È¤³¤í¤òÃΤäƤ¤¤ë¼Ô¤Ïï¤â¤¤¤Ê¤¤; +°Ü¿¢À­¤¬µá¤á¤é¤ì¤ë¥×¥í¥°¥é¥à¤Ç¤Ï +.BR cuserid () +¤Ï»È¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¤È¤¤¤¦¤«¤É¤ó¤Ê¥×¥í¥°¥é¥à¤Ç¤â»È¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤: +Âå¤ï¤ê¤Ë +.I getpwuid(geteuid()) +¤òÍѤ¤¤ë¤Ù¤­¤Ç¤¢¤ë +(¤³¤ì¤¬°Õ¿Þ¤·¤Æ¤¤¤ë¤³¤È¤Ê¤é¤Ð¡¢¤À¤¬)¡£ +.BR cuserid () +¤Ï¡Ö»È¤ï¤Ê¤¤¡×¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR geteuid (2), +.BR getuid (2), +.BR utmp (5) diff --git a/release/man3/getmntent.3 b/release/man3/getmntent.3 new file mode 100644 index 00000000..97fe8d5a --- /dev/null +++ b/release/man3/getmntent.3 @@ -0,0 +1,193 @@ +.\" 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 Sat Jul 24 21:46:57 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 961109, 031115, aeb +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-03-01, NAKANO Takeo +.\" Updated 2000-09-03, Kentaro Shirakata +.\" Updated 2005-03-18, Akihiro MOTOKI +.\" +.TH GETMNTENT 3 2009-09-15 "" "Linux Programmer's Manual" +.SH ̾Á° +getmntent, setmntent, addmntent, endmntent, hasmntopt, +getmntent_r \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àµ­½Ò¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "FILE *setmntent(const char *" filename ", const char *" type ); +.sp +.BI "struct mntent *getmntent(FILE *" fp ); +.sp +.BI "int addmntent(FILE *" fp ", const struct mntent *" mnt ); +.sp +.BI "int endmntent(FILE *" fp ); +.sp +.BI "char *hasmntopt(const struct mntent *" mnt ", const char *" opt ); +.sp +/* GNU ¤Ë¤è¤ë³ÈÄ¥ */ +.B #include +.sp +.BI "struct mntent *getmntent_r(FILE *" fp ", struct mntent *" mntbuf , +.BI " char *" buf ", int " buflen ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR getmntent_r (): +_BSD_SOURCE || _SVID_SOURCE +.SH ÀâÌÀ +¤³¤ì¤é¤Î¥ë¡¼¥Á¥ó¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òµ­½Ò¤·¤¿¥Õ¥¡¥¤¥ë \fI/etc/fstab\fP +¤È¡¢¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òµ­½Ò¤·¤¿¥Õ¥¡¥¤¥ë +\fI/etc/mtab\fP ¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +.BR setmntent () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Îµ­½Ò¥Õ¥¡¥¤¥ë \fIfilename\fP ¤ò¥ª¡¼¥×¥ó¤·¤Æ¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¤³¤Î¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤Ï +.BR getmntent () +¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£°ú¤­¿ô \fItype\fP ¤ÏÍ׵᤹¤ë¥¢¥¯¥»¥¹·Á¼°¤Ç¡¢ +.BR fopen (3) +¤Î \fImode\fP °ú¤­¿ô¤ÈƱ¤¸Ãͤò¼è¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.BR getmntent () +´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Îµ­½Ò¥Õ¥¡¥¤¥ë \fIfp\fP ¤«¤é¿·¤·¤¤¹Ô¤òÆÉ +¤ß¹þ¤ß¡¢¹Ô¤ò¥Õ¥£¡¼¥ë¥É¤Ëʬ³ä¤·¤¿ÆâÍƤò¼ý¤á¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¥Ý¥¤¥ó¥¿¤Ï¥á¥â¥ê¤ÎÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤³¤ÎÎΰè¤Ï +.BR getmntent () +¤ò¼¡¤Ë¸Æ¤Ó½Ð¤·¤¿¤È¤­¤Ë¾å½ñ¤­¤µ¤ì¤Æ¤·¤Þ¤¦¡£ +.PP +.BR addmntent () +´Ø¿ô¤Ï +.I mntent +¹½Â¤ÂÎ \fImnt\fP ¤ÎÆâÍƤò¡¢¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë +\fIfp\fP ¤ÎºÇ¸å¤ËÄɲ乤롣 +.PP +.BR endmntent () +´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Îµ­½Ò¥Õ¥¡¥¤¥ë \fIfp\fP ¤òÊĤ¸¤ë¡£ +.PP +.BR hasmntopt () +´Ø¿ô¤Ï +.I mntent +¹½Â¤ÂÎ \fImnt\fP ¤Î \fImnt_opts\fP ¥Õ¥£¡¼¥ë¥É (²¼µ­ +»²¾È) ¤ò¥¹¥­¥ã¥ó¤·¡¢ \fIopt\fP ¤Ë°ìÃפ¹¤ëÉôʬʸ»úÎ󤬤¢¤ë¤«¤òÄ´¤Ù¤ë¡£ +Í­¸ú¤Ê¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ï \fI\fP ¤È +.BR mount (8) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê´Ø¿ô +.BR getmntent_r () +¤Ï +.BR getmntent () +¤ÈƱ¤¸¤À¤¬¡¢ +¥æ¡¼¥¶¤¬ÍÑ°Õ¤·¤¿ +.I *mntbuf +¤Ë \fIstruct mount\fP ¤ò³ÊǼ¤·¡¢¤½¤Î¹½Â¤ÂΤγƥ¨¥ó¥È¥ê¤¬»Ø¤·¼¨¤¹Ê¸»úÎó¤ò +¥æ¡¼¥¶¤¬ÍÑ°Õ¤·¤¿Â礭¤µ +.I buflen +¤ÎÇÛÎó +.I buf +¤Ë½ñ¤­¹þ¤à¡£ + +.PP +\fImntent\fP ¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +struct mntent { + char *mnt_fsname; /* name of mounted file system */ + char *mnt_dir; /* file system path prefix */ + char *mnt_type; /* mount type (see mntent.h) */ + char *mnt_opts; /* mount options (see mntent.h) */ + int mnt_freq; /* dump frequency in days */ + int mnt_passno; /* pass number on parallel fsck */ +}; +.fi +.in + +mtab ¤ä fstab ¥Õ¥¡¥¤¥ë¤Ç¤Ï¡¢³Æ¥Õ¥£¡¼¥ë¥É¤Ï¶õÇò¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢ +¥¹¥Ú¡¼¥¹¡¢¥¿¥Ö¡¢²þ¹Ô¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Î 4ʸ»ú¤ò¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ç +»È¤¤¤¿¤¤¾ì¹ç¤Ç¡¢¤«¤Ä +.I mntent +¹½Â¤ÂΤΠ4¤Ä¤Îʸ»úÎó¥á¥ó¥Ð¡¼¤Î¤¤¤º¤ì¤«¤ËÂбþ¤¹¤ë¥Õ¥£¡¼¥ë¥ÉÆâ¤Ç +»È¤¤¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢8¿Ê¤Î¥¨¥¹¥±¡¼¥×ɽµ­¤ò»È¤Ã¤Æɽ¸½¤¹¤ë: +¥¹¥Ú¡¼¥¹ (\e040), ¥¿¥Ö (\e011), ²þ¹Ô (\e012), ¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å (\e134)¡£ +.BR addmntent () +¤È +.BR getmntent () +¤Ï¡¢Ê¸»úÎóɽ¸½¤«¤é +¥¨¥¹¥±¡¼¥×ɽ¸½¤Ø¤ÎÊÑ´¹¡¢¤ª¤è¤Ó¤½¤ÎµÕ¤ò¹Ô¤¦¡£ +.SH ÊÖ¤êÃÍ +.BR getmntent () +¤È +.BR getmntent_r () +¤Ï +.I mntent +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.PP +.\Baddmntent\fP() ´Ø¿ô¤ÏÀ®¸ù¤·¤¿¤é 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤·¤¿¤é 1 ¤òÊÖ¤¹¡£ +.PP +.BR endmntent () +´Ø¿ô¤Ï¤Ä¤Í¤Ë 1 ¤òÊÖ¤¹¡£ +.PP +.BR hasmntopt () +´Ø¿ô¤Ï¡¢¥Þ¥Ã¥Á¤·¤¿¾ì¹ç¤ÏÉôʬʸ»úÎó¤Ø¤Î¥¢¥É¥ì¥¹¤òÊÖ¤·¡¢ +¥Þ¥Ã¥Á¤·¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£ +.SH ¥Õ¥¡¥¤¥ë +.nf +/etc/fstab ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àµ­½Ò¥Õ¥¡¥¤¥ë +/etc/mtab ¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Îµ­½Ò¥Õ¥¡¥¤¥ë +.fi +.SH ½àµò +¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ê¤¤´Ø¿ô¤Ï SunOS 4.1.3 ͳÍè¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.BR getmntent_r () +´Ø¿ô¤Ï HPUX 10 ¤ÇƳÆþ¤µ¤ì¤¿¤¬¡¢¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï int ¤òÊÖ¤¹¡£ +¾åµ­¤Ë¼¨¤·¤¿¥×¥í¥È¥¿¥¤¥×¤Ï glibc Æȼ«¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +System V ¤Ë¤â +.BR getmntent () +´Ø¿ô¤Ï¤¢¤ë¤¬¡¢ +¸Æ¤Ó½Ð¤·¼ê½ç¤¬°Û¤Ê¤ê¡¢ÊÖ¤µ¤ì¤ë¹½Â¤ÂΤâ°Û¤Ê¤ë¡£ +System V ¤Ç¤Ï +.I /etc/mnttab +¤¬ÍѤ¤¤é¤ì¤ë¡£ +4.4BSD ¤È Digital Unix ¤Ë¤Ï +.BR getmntinfo () +¤¬¤¢¤ë¤¬¡¢ +¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR getfsstat () +¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fopen (3), +.BR fstab (5), +.BR mount (8) diff --git a/release/man3/getnameinfo.3 b/release/man3/getnameinfo.3 new file mode 100644 index 00000000..c2a47761 --- /dev/null +++ b/release/man3/getnameinfo.3 @@ -0,0 +1,299 @@ +.\" This page is in the public domain. +.\" Almost all details are from RFC 2553. +.\" +.\" 2004-12-14, mtk, Added EAI_OVERFLOW error +.\" 2004-12-14 Fixed description of error return +.\" +.\" Translated 2005-02-26, Akihiro MOTOKI +.\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2010-04-10, Akihiro MOTOKI, LDP v3.24 +.\" +.TH GETNAMEINFO 3 2009-12-03 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getnameinfo \- ¥¢¥É¥ì¥¹¤«¤é̾Á°¤Ø¤ÎÊÑ´¹¤ò¥×¥í¥È¥³¥ë¤Ë°Í¸¤·¤Ê¤¤¤«¤¿¤Á¤Ç¹Ô¤¦ +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "int getnameinfo(const struct sockaddr *" "sa" ", socklen_t " "salen" , +.BI " char *" "host" ", size_t " "hostlen" , +.BI " char *" "serv" ", size_t " "servlen" ", int " "flags" ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.ad l +.in +.sp +.BR getnameinfo (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +.BR getnameinfo () +´Ø¿ô¤Ï¡¢ +.BR getaddrinfo (3) +¤ÎµÕ¤ÎÆ°ºî¤ò¹Ô¤¦¡£¤Ä¤Þ¤ê¡¢¥×¥í¥È¥³¥ë¤Ë°Í¸¤·¤Ê¤¤¤«¤¿¤Á¤Ç +¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤«¤éÂбþ¤¹¤ë¥Û¥¹¥È̾¤È¥µ¡¼¥Ó¥¹¤Ø¤ÎÊÑ´¹¤ò¹Ô¤¦¡£ +¤³¤Î´Ø¿ô¤Ï +.BR gethostbyaddr (3) +¤È +.BR getservbyport (3) +¤Îµ¡Ç½¤ò°ì¤Ä¤Ë¤·¤¿¤â¤Î¤À¤¬¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤È°ã¤¤¡¢ +.BR getnameinfo (3) +¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤¢¤ê¡¢IPv4 ¤È IPv6 ¤Îº¹Ê¬¤Ë°Í¸¤·¤Ê¤¤¤«¤¿¤Á¤Ç +¥×¥í¥°¥é¥à¤ò½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ + +.I sa +°ú¤­¿ô¤Ï¡¢ +IP ¥¢¥É¥ì¥¹¤È¥Ý¡¼¥ÈÈÖ¹æ¤Î¾ðÊó¤òÊÝ»ý¤·¤Æ¤¤¤ë +ÈÆÍÑŪ¤Ê¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¹½Â¤ÂÎ +.RI ( sockaddr_in +·¿¤Þ¤¿¤Ï +.I sockaddr_in6 +·¿) ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I salen +¤Ï +.I sa +¤Î¥µ¥¤¥º¤Ç¤¢¤ë¡£ +.I host +¤È +.I serv +°ú¤­¿ô¤Ï¡¢(¤½¤ì¤¾¤ì¥µ¥¤¥º¤¬ +.I hostlen +¤È +.I servlen +¤Î) ¸Æ¤Ó½Ð¤·Â¦¤Ç³ÎÊݤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ê¡¢ +¥Û¥¹¥È̾¤È¥µ¡¼¥Ó¥¹Ì¾¤ò´Þ¤à NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤¬ +¤½¤ì¤¾¤ì¤Î¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ë¡£ + +¥Û¥¹¥È̾¤¬ÉÔÍפǤ¢¤ë¤³¤È¤ò¤³¤Î´Ø¿ô¤ËÅÁ¤¨¤ë¤Ë¤Ï¡¢ +.I host +¤Ë NULL ¤ò»ØÄꤹ¤ë¤«¡¢ +.I hostlen +¤Ë 0 ¤ò»ØÄꤹ¤ë¡£Æ±Íͤˡ¢¥µ¡¼¥Ó¥¹Ì¾¤¬ÉÔÍפʾì¹ç¤Ï¡¢ +.I serv +¤Ë NULL ¤ò»ØÄꤹ¤ë¤«¡¢ +.I servlen +¤Ë 0 ¤ò»ØÄꤹ¤ë¡£ +¤·¤«¤·¡¢¥Û¥¹¥È̾¤È¥µ¡¼¥Ó¥¹Ì¾¤ÎξÊý¤òÉÔÍפÀ¤È»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤ +(¤¤¤º¤ì¤«°ìÊý¤ÏÍ׵᤹¤ë¤³¤È)¡£ + +.I flags +°ú¤­¿ô¤Ç +.BR getnameinfo () +¤ÎÆ°ºî¤òÊѤ¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£»ØÄê¤Ç¤­¤ëÃͤϰʲ¼¤ÎÄ̤ê: +.TP +.B NI_NAMEREQD +»ØÄꤹ¤ë¤È¡¢¥Û¥¹¥È̾¤¬·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¥¨¥é¡¼¤òÊÖ¤¹¡£ +.TP +.B NI_DGRAM +»ØÄꤹ¤ë¤È¡¢¥¹¥È¥ê¡¼¥à¥Ù¡¼¥¹ (TCP) ¤Ç¤Ê¤¯¥Ç¡¼¥¿¥°¥é¥à¥Ù¡¼¥¹ (UDP) +¤Î¥µ¡¼¥Ó¥¹¤òÂоݤˤ¹¤ë¡£¿ô¤Ï¾¯¤Ê¤¤¤¬¡¢ +UDP ¤È TCP ¤Ç°ã¤¦¥µ¡¼¥Ó¥¹¤òÄ󶡤·¤Æ¤¤¤ë¥Ý¡¼¥È +(512-514) ¤ËÂФ·¤ÆɬÍפȤʤ롣 +.TP +.B NI_NOFQDN +»ØÄꤹ¤ë¤È¡¢¥í¡¼¥«¥ë¤Ê¥Û¥¹¥È¤Ë¤Ï fully qualified domain name (FQDN) ¤Î +¥Û¥¹¥È̾¤ÎÉôʬ¤Î¤ß¤òÊÖ¤¹¡£ +.TP +.B NI_NUMERICHOST +»ØÄꤹ¤ë¤È¡¢¿ôÃÍ·Á¼°¤Î¥Û¥¹¥È̾¤¬ÊÖ¤µ¤ì¤ë¡£ +.\" Î㤨¤Ð +.\" .BR gethostbyaddr () +.\" ¤ÎÂå¤ï¤ê¤Ë +.\" .BR inet_ntop () +.\" ¤ò¸Æ¤Ö +(»ØÄꤷ¤Ê¤¯¤Æ¤â¡¢¥Î¡¼¥É¤Î̾Á°¤¬·èÄê¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¿ôÃÍ·Á¼°¤¬Ê֤뤳¤È¤¬¤¢¤ë)¡£ +.\" POSIX.1-2003 has NI_NUMERICSCOPE, but glibc doesn't have it. +.TP +.B NI_NUMERICSERV +»ØÄꤹ¤ë¤È¡¢¿ôÃÍ·Á¼°¤Î¥µ¡¼¥Ó¥¹Ì¾ (Î㤨¤Ð¥Ý¡¼¥ÈÈÖ¹æ) ¤¬ÊÖ¤µ¤ì¤ë +(»ØÄꤷ¤Ê¤¯¤Æ¤â¡¢¥µ¡¼¥Ó¥¹Ì¾¤¬·èÄê¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¿ôÃÍ·Á¼°¤¬Ê֤뤳¤È¤¬¤¢¤ë)¡£ +.SS "¹ñºÝ²½¥É¥á¥¤¥ó̾¤Î¤¿¤á¤Î getnameinfo() ¤Î³ÈÄ¥" +.PP +glibc 2.3.4 ¤«¤é¡¢ +.BR getnameinfo () +¤Ë³ÈÄ¥¤¬¹Ô¤ï¤ì¡¢¥Û¥¹¥È̾¤È +¹ñºÝ²½¥É¥á¥¤¥ó̾ (Internationalized Domain Name; IDN) ·Á¼°¤È¤Î´Ö¤Ç +Æ©²áŪ¤ÊÊÑ´¹¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë +(IDN ·Á¼°¤Ë¤Ä¤¤¤Æ¤Ï RFC 3490 ¤Î +.I "Internationalizing Domain Names in Applications (IDNA)" +¤ò»²¾È)¡£3¤Ä¤Î¥Õ¥é¥°¤¬¿·¤¿¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.TP +.B NI_IDN +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢É¬ÍפǤ¢¤ì¤Ð¡¢¸¡º÷½èÍý¤Ç¸«¤Ä¤«¤Ã¤¿Ì¾Á°¤Ï +IDN ·Á¼°¤«¤é¥í¥±¡¼¥ë¤Ë±þ¤¸¤¿Éä¹æ²½·Á¼°¤ËÊÑ´¹¤µ¤ì¤ë¡£ +ASCII ʸ»ú¤À¤±¤Î̾Á°¤Ï¤³¤ÎÊÑ´¹¤Ç¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡£¤³¤Î¤¿¤á¡¢ +´û¸¤Î¥×¥í¥°¥é¥à¤ä´Ä¶­¤Ç¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR NI_IDN_ALLOW_UNASSIGNED ", " NI_IDN_USE_STD3_ASCII_RULES +¤³¤ì¤é¤Î¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢IDNA ½èÍý¤Ç»ÈÍѤµ¤ì¤ë¥Õ¥é¥° +IDNA_ALLOW_UNASSIGNED (̤³ä¤êÅö¤Æ¤Î Unicode ¤Î¥³¡¼¥É¥Ý¥¤¥ó¥È¤òµöÍÆ) ¤È +IDNA_USE_STD3_ASCII_RULES (½ÐÎϤ¬ STD3 ½àµò¤Î¥Û¥¹¥È̾¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë) +¤¬¤½¤ì¤¾¤ìÍ­¸ú¤Ë¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +.\" FIXME glibc defines the following additional errors, some which +.\" can probably be returned by getnameinfo(); they need to +.\" be documented. +.\" #ifdef __USE_GNU +.\" #define EAI_INPROGRESS -100 /* Processing request in progress. */ +.\" #define EAI_CANCELED -101 /* Request canceled. */ +.\" #define EAI_NOTCANCELED -102 /* Request not canceled. */ +.\" #define EAI_ALLDONE -103 /* All requests done. */ +.\" #define EAI_INTR -104 /* Interrupted by a signal. */ +.\" #define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ +.\" #endif +À®¸ù¤¹¤ë¤È 0 ¤¬Ê֤ꡢ(Í׵ᤵ¤ì¤Æ¤¤¤ì¤Ð) ¥Î¡¼¥É¤È¥µ¡¼¥Ó¥¹¤Î̾Á°¤¬ +NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Î·Á¼°¤Ç¤½¤ì¤¾¤ì¤Î»ØÄê¥Ð¥Ã¥Õ¥¡¤ËÊÖ¤µ¤ì¤ë +(¥Ð¥Ã¥Õ¥¡¤ÎŤµ¤Ë¤¢¤¦¤è¤¦¤Ë½Ì¤á¤é¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤)¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢°Ê²¼¤Î 0 °Ê³°¤Î¥¨¥é¡¼¡¦¥³¡¼¥É¤¬ÊÖ¤µ¤ì¤ë: +.TP +.B EAI_AGAIN +»ØÄꤵ¤ì¤¿Ì¾Á°¤¬¸½»þÅÀ¤Ç¤Ï²ò·è¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +¸å¤ÇºÆ»î¹Ô¤·¤Æ¤ß¤ë¤³¤È¡£ +.TP +.B EAI_BADFLAGS +.I flags +°ú¤­¿ô¤ËÉÔÀµ¤ÊÃͤ¬Í¿¤¨¤é¤ì¤¿¡£ +.TP +.B EAI_FAIL +²óÉü¤Ç¤­¤Ê¤¤¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ +.TP +.B EAI_FAMILY +»ØÄꤷ¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤¬Ç§¼±¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +¤¢¤ë¤¤¤Ï¥¢¥É¥ì¥¹¤ÎŤµ¤¬»ØÄꤵ¤ì¤¿¥Õ¥¡¥ß¥ê¡¼¤Ë¹ç¤¦¤â¤Î¤Ç¤Ê¤«¤Ã¤¿¡£ +.TP +.B EAI_MEMORY +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B EAI_NONAME +Í¿¤¨¤é¤ì¤¿¥Ñ¥é¥á¡¼¥¿¤Ç¤Ï̾Á°¤¬²ò·è¤Ç¤­¤Ê¤¤¡£ +.B NI_NAMEREQD +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤¿¤¬¥Û¥¹¥È̾¤¬·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿¤«¡¢ +¥Û¥¹¥È̾¤â¥µ¡¼¥Ó¥¹Ì¾¤âÍ׵ᤵ¤ì¤Ê¤«¤Ã¤¿¡£ +.TP +.B EAI_OVERFLOW +.I host +¤Þ¤¿¤Ï +.I serv +¤¬»Ø¤·¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ¤¹¤®¤¿¡£ +.TP +.B EAI_SYSTEM +¥·¥¹¥Æ¥à¥¨¥é¡¼¤¬µ¯¤Ã¤¿¡£ +¥¨¥é¡¼¥³¡¼¥É¤Ï +.I errno +¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +.BR gai_strerror (3) +´Ø¿ô¤ò»È¤¦¤È¡¢¤³¤ì¤é¤Î¥¨¥é¡¼¡¦¥³¡¼¥É¤ò¡¢¥¨¥é¡¼¡¦¥ì¥Ý¡¼¥È¤ËŬ¤·¤¿ +¿Í´Ö¤¬Æɤߤ䤹¤¤Ê¸»úÎó¤ËËÝÌõ¤·¤Æ¤¯¤ì¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +/etc/hosts +.br +/etc/nsswitch.conf +.br +/etc/resolv.conf +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR getnameinfo () +¤Ï¡¢glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +RFC\ 2553, POSIX.1-2001. +.SH Ãí°Õ +ŬÀڤʥХåե¡¥µ¥¤¥º¤òÁªÂò¤Ç¤­¤ë¤è¤¦¤Ë¡¢ +.I +¤Ë°Ê²¼¤ÎÄê¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.in +4n +.nf + +#define NI_MAXHOST 1025 +#define NI_MAXSERV 32 +.fi +.in + +glibc 2.8 °Ê¹ß¤Ç¤Ï¡¢µ¡Ç½¸¡ºº¥Þ¥¯¥í +.BR _BSD_SOURCE , +.BR _SVID_SOURCE , +.BR _GNU_SOURCE +¤Î¤¤¤º¤ì¤«¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë¤Î¤ß¡¢¤³¤ì¤é¤ÎÄêµÁ¤¬¸ø³«¤µ¤ì¤ë¡£ +.PP +Á°¼Ô¤Ï¡¢ºÇ¶á¤Î¥Ð¡¼¥¸¥ç¥ó¤Î BIND ¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.I +Ãæ¤ÎÄê¿ô +.B MAXDNAME +¤ÈƱ¤¸ÃͤǤ¢¤ë¡£ +¸å¼Ô¤Ï¡¢³ä¤êÅö¤ÆºÑ¤Î¿ôÃͤˤĤ¤¤Æµ­¤·¤¿¸½ºß¤Î RFC ¤Ë +Îóµó¤µ¤ì¤Æ¥µ¡¼¥Ó¥¹¤«¤é¿äÎ̤·¤¿ÃͤǤ¢¤ë¡£ +.SH Îã +°Ê²¼¤Î¥³¡¼¥É¤Ï¡¢»ØÄꤵ¤ì¤¿¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ËÂФ¹¤ë +¥Û¥¹¥È¤È¥µ¡¼¥Ó¥¹¤Î¿ôÃÍɽ¼°¤ò¼èÆÀ¤·¤è¤¦¤È»î¤ß¤ë¡£ +ÆÃÄê¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤ËÂФ¹¤ë»²¾È¾ðÊó¤Ï +°ìÀڥϡ¼¥É¥³¡¼¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ËÃåÌܤ·¤Æ¤Û¤·¤¤¡£ + +.in +4n +.nf +struct sockaddr *sa; /* input */ +socklen_t len; /* input */ +char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV]; + +if (getnameinfo(sa, len, hbuf, sizeof(hbuf), sbuf, + sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV) == 0) + printf("host=%s, serv=%s\en", hbuf, sbuf); +.fi +.in + +°Ê²¼¤Ç¤Ï¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ë +µÕ¸þ¤­¤Î¥¢¥É¥ì¥¹¥Þ¥Ã¥Ô¥ó¥°¤¬Â¸ºß¤¹¤ë¤«¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct sockaddr *sa; /* input */ +socklen_t len; /* input */ +char hbuf[NI_MAXHOST]; + +if (getnameinfo(sa, len, hbuf, sizeof(hbuf), + NULL, 0, NI_NAMEREQD)) + printf("could not resolve hostname"); +else + printf("host=%s\en", hbuf); +.fi +.in +.PP +.BR getnameinfo () +¤ò»È¤Ã¤¿¥×¥í¥°¥é¥àÎ㤬 +.BR getaddrinfo (3) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR accept (2), +.BR getpeername (2), +.BR getsockname (2), +.BR recvfrom (2), +.BR socket (2), +.BR getaddrinfo (3), +.BR gethostbyaddr (3), +.BR getservbyname (3), +.BR getservbyport (3), +.BR inet_ntop (3), +.BR hosts (5), +.BR services (5), +.BR hostname (7), +.BR named (8) +.LP +R. Gilligan, S. Thomson, J. Bound and W. Stevens, +.IR "Basic Socket Interface Extensions for IPv6" , +RFC\ 2553, March 1999. +.LP +Tatsuya Jinmei and Atsushi Onoe, +.IR "An Extension of Format for IPv6 Scoped Addresses" , +internet draft, work in progress. +ftp://ftp.ietf.org/internet\-drafts/draft\-ietf\-ipngwg\-scopedaddr\-format\-02.txt +.LP +Craig Metz, +.IR "Protocol Independence Using the Sockets API" , +Proceedings of the freenix track: +2000 USENIX annual technical conference, June 2000. +http://www.usenix.org/publications/library/proceedings/usenix2000/freenix/metzprotocol.html diff --git a/release/man3/getnetent.3 b/release/man3/getnetent.3 new file mode 100644 index 00000000..65bb8055 --- /dev/null +++ b/release/man3/getnetent.3 @@ -0,0 +1,136 @@ +.\" 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 Sat Jul 24 21:48:06 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-03-01, NAKANO Takeo +.\" Modified 1998-06-22, NAKANO Takeo +.\" Updated 2008-09-19, Akihiro MOTOKI +.\" +.TH GETNETENT 3 2008-08-19 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \- ¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.B struct netent *getnetent(void); +.sp +.BI "struct netent *getnetbyname(const char *" name ); +.sp +.BI "struct netent *getnetbyaddr(uint32_t " net ", int " type ); +.sp +.BI "void setnetent(int " stayopen ); +.sp +.B void endnetent(void); +.fi +.SH ÀâÌÀ +.BR getnetent () +´Ø¿ô¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¼¡¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤ß¡¢ +¤½¤Î¥¨¥ó¥È¥ê¤ò \fInetent\fP ¹½Â¤ÂΤÎÍ×ÁÇÊ̤Υե£¡¼¥ë¥É¤Ë³ÊǼ¤·¡¢ +¤½¤Î¹½Â¤ÂΤòÊÖ¤¹¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.BR getnetbyname () +´Ø¿ô¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯Ì¾ \fIname\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fInetent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£ +.PP +.BR getnetbyaddr () +´Ø¿ô¤Ï¡¢\fItype\fP ·¿¤Î¥Í¥Ã¥È¥ï¡¼¥¯ÈÖ¹æ \fInet\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fInetent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£ +.I net +°ú¤­¿ô¤Ï¥Û¥¹¥È¡¦¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.BR setnetent () +´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥ª¡¼¥×¥ó¤·¡¢ +¼¡¤ÎÆɤ߹þ¤ß¥¨¥ó¥È¥ê¤òÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤹ¤ë¡£ +\fIstayopen\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢ +°ì¤Ä°ì¤Ä¤Î +.BR getnet* () +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¡£ +.PP +.BR endnetent () +´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +\fInetent\fP ¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +struct netent { + char *n_name; /* official network name */ + char **n_aliases; /* alias list */ + int n_addrtype; /* net address type */ + uint32_t n_net; /* network number */ +} +.fi +.in +.PP +\fInetent\fP ¹½Â¤ÂΤΥá¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ +.RS +.TP 12 +.I n_name +¥Í¥Ã¥È¥ï¡¼¥¯¤ÎÀµ¼°Ì¾ (official name)¡£ +.TP +.I n_aliases +¥Í¥Ã¥È¥ï¡¼¥¯¤ÎÊÌ̾¤«¤é¤Ê¤ë¥ê¥¹¥È¡£ +¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.TP +.I n_addrtype +¥Í¥Ã¥È¥ï¡¼¥¯ÈÖ¹æ¤Î·Á¼°¡£¸½ºß¤Ï +.B AF_INET +¤Î¤ß¡£ +.TP +.I n_net +¥Û¥¹¥È¡¦¥Ð¥¤¥È¥ª¡¼¥À·Á¼°¤Î¥Í¥Ã¥È¥ï¡¼¥¯Èֹ档 +.RE +.SH ÊÖ¤êÃÍ +.BR getnetent (), +.BR getnetbyname (), +.BR getnetbyaddr () +´Ø¿ô¤Ï¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ \fInetent\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/networks +¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.SH ½àµò +4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +¥Ð¡¼¥¸¥ç¥ó 2.2 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢ +.BR getnetbyaddr () +¤Î°ú¤­¿ô +.I net +¤Ï +.I long +·¿¤À¤Ã¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getnetent_r (3), +.BR getprotoent (3), +.BR getservent (3) +.\" .BR networks (5) +.br +RFC\ 1101 diff --git a/release/man3/getopt.3 b/release/man3/getopt.3 new file mode 100644 index 00000000..9040204f --- /dev/null +++ b/release/man3/getopt.3 @@ -0,0 +1,526 @@ +.\" 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:27:50 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon Aug 30 22:02:34 1995 by Jim Van Zandt +.\" longindex is a pointer, has_arg can take 3 values, using consistent +.\" names for optstring and longindex, "\n" in formats fixed. Documenting +.\" opterr and getopt_long_only. Clarified explanations (borrowing heavily +.\" from the source code). +.\" 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 +.\" 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 Í×ÁÇ +.\" +.TH GETOPT 3 2010-02-03 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getopt, getopt_long, getopt_long_only, +optarg, optind, opterr, optopt \- ¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤ò²ò¼á¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getopt(int " argc ", char * const " argv[] , +.BI " const char *" optstring ); +.sp +.BI "extern char *" optarg ; +.BI "extern int " optind ", " opterr ", " optopt ; +.sp +.B #include +.sp +.BI "int getopt_long(int " argc ", char * const " argv[] , +.BI " const char *" optstring , +.BI " const struct option *" longopts ", int *" longindex ); +.sp +.BI "int getopt_long_only(int " argc ", char * const " argv[] , +.BI " const char *" optstring , +.BI " const struct option *" longopts ", int *" longindex ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.ad l +.in +.sp +.BR getopt (): +_POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE +.br +.BR getopt_long (), +.BR getopt_long_only (): +_GNU_SOURCE +.ad b +.SH ÀâÌÀ +.BR getopt () +´Ø¿ô¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ò²ò¼á¤¹¤ë¡£ +.BR getopt () +¤¬¤È¤ë°ú¤­¿ô +.I argc +¤È +.I argv +¤Ï¡¢¤½¤ì¤¾¤ì¥×¥í¥°¥é¥à¤Îµ¯Æ°»þ¤Ë +.IR main () +´Ø¿ô¤ËÅϤµ¤ì¤¿°ú¤­¿ô¤Î¸Ä¿ô¤ÈÇÛÎó¤Ç¤¢¤ë¡£ +\fIargv\fP ¤ÎÍ×ÁǤΤ¦¤Á \(aq\-\(aq ¤Ç»Ï¤Þ¤ë¤â¤Î +(¤«¤Ä "\-" ñÆȤä "\-\-" ñÆȤǤϤʤ¤¤â¤Î) ¤Ï +¥ª¥×¥·¥ç¥óÍ×ÁÇ (option element) ¤È¤ß¤Ê¤µ¤ì¤ë¡£ +¤³¤ÎÍ×ÁǤ«¤éÀèƬ¤Î \(aq\-\(aq ¤ò½ü¤¤¤¿Ê¸»ú¤Ï +¥ª¥×¥·¥ç¥óʸ»ú (option character) ¤È¤µ¤ì¤ë¡£ +.BR getopt () +¤Ï¡¢·«¤êÊÖ¤·¸Æ¤Ó½Ð¤µ¤ì¤ë¤´¤È¤Ë¡¢¼¡¤Î¥ª¥×¥·¥ç¥óʸ»ú¤òÊÖ¤¹¡£ +.PP +ÊÑ¿ô +.I optind +¤Ï¡¢ +.I argv +¤Î¼¡¤Ë½èÍý¤µ¤ì¤ëÍ×ÁǤΥ¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤¢¤ë¡£ +¥·¥¹¥Æ¥à¤Ë¤è¤ê¤³¤ÎÊÑ¿ô¤ÎÃÍ¤Ï 1 ¤Ë½é´ü²½¤µ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·Â¦¤Ç¤³¤ÎÃͤò 1 ¤Ë¥ê¥»¥Ã¥È¤¹¤ë¤³¤È¤Ç¡¢Æ±¤¸ +.I argv +¤Î¥¹¥­¥ã¥ó¤ò¤ä¤êľ¤·¤¿¤ê¡¢¿·¤·¤¤°ú¤­¿ô¥Ù¥¯¥È¥ë¤ò¥¹¥­¥ã¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +¿·¤¿¤Ê¥ª¥×¥·¥ç¥óʸ»ú¤ò¸«¤Ä¤±¤ë¤È¡¢ +.BR getopt () +¤Ï¤½¤Îʸ»ú¤òÊÖ¤·¡¢ +³°ÉôÊÑ¿ô \fIoptind\fP ¤È¥¹¥¿¥Æ¥£¥Ã¥¯¤ÊÊÑ¿ô \fInextchar\fP ¤ò¹¹¿·¤¹¤ë¡£ +¤³¤ì¤é¤Ë¤è¤Ã¤Æ¡¢ +.BR getopt () +¤Ï¼¡²ó¤Î¸Æ¤Ó½Ð¤·¤ÎºÝ¤Ë¡¢ +°Ê¹ß¤Î¥ª¥×¥·¥ç¥óʸ»ú¤ä \fIargv\fP Í×ÁǤΥ¹¥­¥ã¥ó¤ò·Ñ³¤Ç¤­¤ë¡£ +.PP +¥ª¥×¥·¥ç¥óʸ»ú¤¬¤½¤ì°Ê¾å¸«¤Ä¤«¤é¤Ê¤¯¤Ê¤ë¤È¡¢ +.BR getopt () +¤Ï +\-1 ¤òÊÖ¤¹¡£¤½¤·¤Æ \fIoptind\fP ¤Ï¡¢\fIargv\fP ¤ÎÍ×ÁǤΤ¦¤Á¡¢ +¥ª¥×¥·¥ç¥ó¤Ç¤Ê¤¤ºÇ½é¤ÎÍ×ÁǤò¼¨¤¹¤è¤¦¤Ë¤Ê¤ë¡£ +.PP +.I optstring +¤Ï¼õ¤±ÉÕ¤±¤ë¥ª¥×¥·¥ç¥óʸ»ú¤«¤é¤Ê¤ëʸ»úÎó¤Ç¤¢¤ë¡£ +ʸ»ú¤Î¤¢¤È¤Ë¥³¥í¥ó (:) ¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¥ª¥×¥·¥ç¥ó¤Ë¤Ï°ú¤­¿ô¤¬É¬ÍפǤ¢¤ë¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î¤È¤­ +.BR getopt () +¤Ï¡¢¸½ºßÃíÌܤ·¤Æ¤¤¤ë +\fIargv\fP Í×ÁǤǡ¢¥ª¥×¥·¥ç¥óʸ»ú¤Ë°ú¤­Â³¤¯¥Æ¥­¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤«¡¢ +¤¢¤ë¤¤¤Ï¼¡¤Î \fIargv\fP Í×ÁǤΥƥ­¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò +.I optarg +¤ËÂåÆþ¤¹¤ë¡£ +2 ¸ÄϢ³¤·¤Æ¥³¥í¥ó¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¤½¤Î¥ª¥×¥·¥ç¥ó¤Ï°ú¤­¿ô¤ò¤È¤Ã¤Æ¤â¤È¤é¤Ê¤¯¤Æ¤â¤è¤¤¡£ +¸½ºß¤Î \fIargv\fP Í×ÁǤ˥ƥ­¥¹¥È¤¬¤¢¤ì¤Ð +(¤Ä¤Þ¤ê¡¢"\-oarg" ¤Î¤è¤¦¤Ë¡¢¥ª¥×¥·¥ç¥ó̾¼«¿È¤ÈƱ¤¸¥ï¡¼¥ÉÆâ¤Ë +¥Æ¥­¥¹¥È¤¬¤¢¤ë¾ì¹ç)¡¢¤½¤ì¤¬ \fIoptarg\fP ¤ËÊÖ¤µ¤ì¤ë¡£ +¤Ê¤±¤ì¤Ð \fIoptarg\fP ¤Ï 0 ¤ËÀßÄꤵ¤ì¤ë¡£ +¤³¤ì¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.I optstring +¤Ë +.B W +¤È¤½¤ì¤Ë³¤¯¥»¥ß¥³¥í¥ó¤¬Æþ¤Ã¤Æ¤¤¤ë¤È¡¢ +.B \-W foo +¤ÏŤ¤¥ª¥×¥·¥ç¥ó +.B \-\-foo +¤ÈƱ¤¸¤è¤¦¤Ë°·¤ï¤ì¤ë +(POSIX.2 ¤Ï +.B \-W +¥ª¥×¥·¥ç¥ó¤ò¼ÂÁõ°Í¸¤Î³ÈÄ¥¤È¤·¤ÆͽÌ󤷤Ƥ¤¤ë)¡£ +¤³¤ÎÆ°ºî¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ê¡¢glibc 2 °ÊÁ°¤Î¥é¥¤¥Ö¥é¥ê¤Ç¤Ï +ÍøÍѤǤ­¤Ê¤¤¡£ +.PP +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +.BR getopt () +¤Ï \fIargv\fP ¤ò¥¹¥­¥ã¥ó¤¹¤ëºÝ¤Ë½ç½ø¤òÊѹ¹¤·¡¢ +¥ª¥×¥·¥ç¥ó°Ê³°¤ÎÍ×ÁǤòºÇ¸å¤Ë°ÜÆ°¤¹¤ë¡£ +¾¤Ë¤â 2 ¤Ä¤Î¥â¡¼¥É¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +\fIoptstring\fP ¤ÎÀèƬʸ»ú¤¬ \(aq+\(aq ¤Ç¤¢¤ë¤«¡¢´Ä¶­ÊÑ¿ô +.B POSIXLY_CORRECT +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¥ª¥×¥·¥ç¥ó¤òÂоݤȤ¹¤ëÆ°ºî¤Ï¡¢ +È󥪥ץ·¥ç¥ó¤Î°ú¤­¿ô¤¬¸½¤ì¤¿Ãʳ¬¤Ç½ªÎ»¤¹¤ë¡£ +\fIoptstring\fP ¤ÎÀèƬʸ»ú¤¬ \(aq\-\(aq ¤Ç¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢ +¥ª¥×¥·¥ç¥ó¤Ç¤Ê¤¤ \fIargv\fP Í×ÁǤϡ¢ +ʸ»ú¥³¡¼¥É 1 ¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¤«¤Î¤è¤¦¤Ë°·¤ï¤ì¤ë (¤³¤ì¤òÍѤ¤¤ë¥×¥í¥°¥é¥à¤Ï¡¢ +¥ª¥×¥·¥ç¥ó¤ä \fIargv\fP Í×ÁǤòǤ°Õ¤Î½ç½ø¤Ç¼õ¤±Æþ¤ì¡¢¤«¤Ä¤½¤ì¤é¤Î½ç½ø¤¬ +°ÕÌ£¤ò»ý¤Ä¤è¤¦¤Ë½ñ¤«¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë)¡£ +"\-\-" ¤ÏÆüì¤Ê°ú¤­¿ô¤Ç¡¢¥¹¥­¥ã¥ó¤Î¥â¡¼¥É¤Ë¤è¤é¤º¡¢ +¥ª¥×¥·¥ç¥ó¤Î¥¹¥­¥ã¥ó¤ò¶¯À©Åª¤Ë½ªÎ»¤µ¤»¤ë¡£ +.PP +ǧ¼±¤Ç¤­¤Ê¤¤¥ª¥×¥·¥ç¥óʸ»ú¤¬¤¢¤ë¤È¡¢ +.BR getopt () +¤Ï¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɸ½à¥¨¥é¡¼½ÐÎÏ \fIstderr\fP ¤Ëɽ¼¨¤·¡¢ +¤½¤Îʸ»ú¤ò \fIoptopt\fP ¤ËÊݸ¤·¤Æ \(aq?\(aq ¤òÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥°¥é¥à¤Ç \fIopterr\fP ¤ò 0 ¤Ë¤·¤Æ¤ª¤±¤Ð¡¢ +¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Îɽ¼¨¤òÍÞÀ©¤Ç¤­¤ë¡£ +.PP +.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 () +¤Ï¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£ +.SS getopt_long() ¤È getopt_long_only() +.BR getopt_long () +´Ø¿ô¤Ï¡¢Ä¹¤¤¥ª¥×¥·¥ç¥ó (2 ¤Ä¤Î¥À¥Ã¥·¥å "\-\-" ¤Ç»Ï¤Þ¤ë¥ª¥×¥·¥ç¥ó) ¤ò +¼õ¤±Æþ¤ì¤ë¤³¤È¤ò½ü¤¤¤Æ +.BR getopt () +¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë +(¥×¥í¥°¥é¥à¤ËŤ¤¥ª¥×¥·¥ç¥ó¤À¤±¤¬ÅϤµ¤ì¤¿¾ì¹ç¡¢ +.I optstring +¤Ï NULL ¤Ç¤Ï¤Ê¤¯¶õʸ»úÎó ("") ¤È¤Ê¤ë)¡£ +Ť¤¥ª¥×¥·¥ç¥ó¤Î̾Á°¤Ï¡¢Â¾¤È½Å¤Ê¤é¤Ê¤¤ÈϰϤˤª¤¤¤Æû½Ì¤Ç¤­¤ë¡£ +¤¢¤ë¤¤¤ÏÄêµÁ¤µ¤ì¤¿¥ª¥×¥·¥ç¥ó¤ËÀµ³Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¤â¤Î¤Ç¤â (ÅöÁ³) ¤«¤Þ¤ï¤Ê¤¤¡£ +Ť¤¥ª¥×¥·¥ç¥ó¤Ï°ú¤­¿ô¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¡¢ +.B \-\-arg=param +¤Þ¤¿¤Ï +.B "\-\-arg param" +¤È¸À¤¦·Á¼°¤Ç»ØÄꤹ¤ë¡£ +.PP +.I longopts +¤Ï +.I struct option +¤ÎÍ×ÁǤ«¤é¤Ê¤ëÇÛÎó¤Î¡¢ÀèƬÍ×ÁǤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I struct option +¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.in +4n +.nf +.sp +struct option { + const char *name; + int has_arg; + int *flag; + int val; +}; +.fi +.in +.PP +¤½¤ì¤¾¤ì¤Î¥Õ¥£¡¼¥ë¥É¤Î°ÕÌ£¤Ï°Ê²¼¤ÎÄ̤ꡣ +.TP +.I name +Ť¤¥ª¥×¥·¥ç¥ó¤Î̾Á°¡£ +.TP +.I has_arg +\fBno_argument\fP (¤Þ¤¿¤Ï 0) ¤Ê¤é¡¢¥ª¥×¥·¥ç¥ó¤Ï°ú¤­¿ô¤ò¤È¤é¤Ê¤¤¡£ +\fBrequired_argument\fP (¤Þ¤¿¤Ï 1) ¤Ê¤é¡¢¥ª¥×¥·¥ç¥ó¤Ï°ú¤­¿ô¤òɬÍפȤ¹¤ë¡£ +\fBoptional_argument\fP (¤Þ¤¿¤Ï 2) ¤Ê¤é¡¢¥ª¥×¥·¥ç¥ó¤Ï°ú¤­¿ô¤ò¤È¤Ã¤Æ¤â +¤È¤é¤Ê¤¯¤Æ¤âÎɤ¤¡£ +.TP +.I flag +Ť¤¥ª¥×¥·¥ç¥ó¤ËÂФ¹¤ë·ë²Ì¤ÎÊÖ¤·Êý¤ò»ØÄꤹ¤ë¡£\fIflag\fP ¤¬ +NULL ¤Ê¤é +.BR getopt_long () +¤Ï \fIval\fP ¤òÊÖ¤¹ +(Î㤨¤Ð¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +\fIval\fP ¤ËÅù²Á¤Ê¥ª¥×¥·¥ç¥óʸ»ú¤òÂåÆþ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë)¡£ +NULL °Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR getopt_long () +¤Ï 0 ¤òÊÖ¤¹¡£ +¤³¤Î¤È¤­¥ª¥×¥·¥ç¥ó¤¬¸«¤Ä¤«¤ë¤È \fIflag\fP ¤¬¥Ý¥¤¥ó¥È¤¹¤ëÊÑ¿ô¤Ë +\fIval\fP ¤¬ÂåÆþ¤µ¤ì¤ë¡£¸«¤Ä¤«¤é¤Ê¤¤¤È¤³¤ÎÊÑ¿ô¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.TP +\fIval\fP +ÊÖ¤êÃÍ¡¢¤Þ¤¿¤Ï \fIflag\fP ¤¬¥Ý¥¤¥ó¥È¤¹¤ëÊÑ¿ô¤Ø¥í¡¼¥É¤µ¤ì¤ëÃÍ¡£ +.PP +ÇÛÎó¤ÎºÇ¸å¤ÎÍ×ÁǤϡ¢Á´¤Æ 0 ¤ÇËä¤á¤é¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +\fIlongindex\fP ¤Ï¡¢NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢ +Ť¤¥ª¥×¥·¥ç¥ó¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò +.I longopts +¤«¤é¤ÎÁêÂаÌÃ֤Ȥ·¤ÆÊÝ»ý¤·¤Æ¤¤¤ëÊÑ¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ë¡£ +.PP +.BR getopt_long_only () +¤Ï +.BR getopt_long () +¤ÈƱÍͤÎÆ°ºî¤ò¤¹¤ë¤¬¡¢ \(aq\-\(aq ¤â "\-\-" ¤ÈƱÍͤˡ¢ +Ť¤¥ª¥×¥·¥ç¥ó¤È¤·¤Æ°·¤ï¤ì¤ë¡£\(aq\-\(aq ¤Ç»Ï¤Þ¤ë +("\-\-" °Ê³°¤Î) ¥ª¥×¥·¥ç¥ó¤¬¡¢Ä¹¤¤¤â¤Î¤Ë¤Ï¥Þ¥Ã¥Á¤·¤Ê¤¤¤¬Ã»¤¤¤â¤Î¤Ë +¥Þ¥Ã¥Á¤¹¤ë¾ì¹ç¤Ë¤ª¤¤¤Æ¤Ï¡¢¤½¤ì¤Ïû¤¤¥ª¥×¥·¥ç¥ó¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +¥ª¥×¥·¥ç¥ó¤¬Àµ¾ï¤Ë¸«¤Ä¤«¤ì¤Ð +.BR getopt () +¤Ï¤½¤Î¥ª¥×¥·¥ç¥óʸ»ú¤òÊÖ¤¹¡£ +¤¹¤Ù¤Æ¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤Î²òÀϤ¬½ª¤ï¤Ã¤¿¤é¡¢ +.BR getopt () +¤Ï \-1 ¤òÊÖ¤¹¡£ +.I optstring +¤Ë´Þ¤Þ¤ì¤Ê¤¤¥ª¥×¥·¥ç¥óʸ»ú¤¬¸«¤Ä¤«¤ë¤È¡¢\(aq?\(aq ¤òÊÖ¤¹¡£ +°ú¤­¿ô¤¬Â­¤ê¤Ê¤¤¥ª¥×¥·¥ç¥ó¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¡¢ +ÊÖ¤êÃÍ¤Ï +.I optstring +¤ÎºÇ½é¤Îʸ»ú¤Ë¤è¤ë°Û¤Ê¤ë: ºÇ½é¤Îʸ»ú¤¬ \(aq:\(aq ¤Ç¤¢¤ì¤Ð \(aq:\(aq ¤òÊÖ¤·¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï \(aq?\(aq ¤òÊÖ¤¹¡£ +.PP +.BR getopt_long () +¤È +.BR getopt_long_only () +¤â¡¢ +û¤¤¥ª¥×¥·¥ç¥óʸ»ú¤òǧ¼±¤·¤¿¾ì¹ç¤Ë¤Ï¤½¤Îʸ»ú¤òÊÖ¤¹¡£ +Ť¤¥ª¥×¥·¥ç¥ó¤ËÂФ·¤Æ¤Ï¡¢ +\fIflag\fP ¤¬ NULL ¤Ê¤é \fIval\fP ¤òÊÖ¤·¡¢ +\fIflag\fP ¤¬ NULL °Ê³°¤Ê¤é 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤È \-1 ¤ÎÊÖ¤êÃÍ¤Ï +.BR getopt () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +¤µ¤é¤Ë \(aq?\(aq ¤Ï¡¢¥Þ¥Ã¥Á¤¬³ÎÄê¤Ç¤­¤Ê¤¤¾ì¹ç¤ä;ʬ¤Ê¥Ñ¥é¥á¡¼¥¿¡¼¤¬¤¢¤ë¾ì¹ç¤Ë¤âÊ֤롣 +.SH ´Ä¶­ +.TP +.B POSIXLY_CORRECT +¤³¤ì¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢È󥪥ץ·¥ç¥ó¤Î°ú¤­¿ô¤ËÅþ㤷¤¿»þÅÀ¤Ç¥ª¥×¥·¥ç¥ó +¤ËÂФ¹¤ëÁàºî¤¬Ää»ß¤µ¤ì¤ë¡£ +.TP +.B __GNU_nonoption_argv_flags_ +¤³¤ÎÊÑ¿ô¤Ï +.BR bash (1) +2.0 ¤¬ glibc ¤ÈÄÌ¿®¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤¿¡£ +¤É¤Î°ú¤­¿ô¤¬¥ï¥¤¥ë¥É¥«¡¼¥É¤òŸ³«¤·¤¿·ë²Ì¤Ç¡¢ +¤·¤¿¤¬¤Ã¤Æ¥ª¥×¥·¥ç¥ó¤È¤ß¤Ê¤¹¤Ù¤­¤Ç¤Ê¤¤¤«¤òÃΤ餻¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Îµ¡Ç½¤Ï +.BR bash (1) +¤Î¥Ð¡¼¥¸¥ç¥ó 2.01 ¤Çºï½ü¤µ¤ì¤¿¤¬¡¢glibc ¤Ë¤Ï¤Þ¤À»Ä¤Ã¤Æ¤¤¤ë¡£ +.SH ½àµò +.TP +.BR getopt (): +´Ä¶­ÊÑ¿ô +.B POSIXLY_CORRECT +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï POSIX.2 ¤È POSIX.1-2001 ¤Ë½àµò¤¹¤ë¡£ +¾¤Î¾ì¹ç¤Ï \fIargv\fP ¤ÎÍ×ÁǤÏËÜÅö¤Î°ÕÌ£¤Ç¤ÎÄê¿ô¤Ë¤Ï¤Ê¤é¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é½ç½ø¤¬Êѹ¹¤µ¤ì¤Æ¤·¤Þ¤¦¤«¤é¤Ç¤¢¤ë¡£ +¤¿¤À¤·¤½¤ì¤é¤Ï¡¢¥×¥í¥È¥¿¥¤¥×¤Ç¤ÏÄê¿ô¤Ç¤¢¤ë¤«¤Î¤è¤¦¤Ë¤·¤Æ¤¢¤ë¡£ +¤³¤ì¤Ï¾¤Î¥·¥¹¥Æ¥à¤È¤Î¸ß´¹À­¤Î¤¿¤á¤Ç¤¢¤ë¡£ + +.I optstring +¤Ç \(aq+\(aq ¤ä \(aq\-\(aq ¤ò»È¤¦¤Î¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë. + +¸Å¤¤¼ÂÁõ¤Î¤¤¤¯¤Ä¤«¤Ç¤Ï¡¢ +.BR getopt () +¤Ï +.I +¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤¿¡£ +SUSv1 ¤Ç¤Ï¡¢ +.I +¤« +.I +¤Î¤É¤Á¤é¤«¤Ç +Àë¸À¤·¤Æ¤â¤è¤«¤Ã¤¿¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢ +.B getopt +¤ÎÀë¸À¤ò +.I +¤Ç¹Ô¤¦¤Î¤Ï¡Ö²áµî¤Î̾»Ä¡×¤Ç¤¢¤ë¤È¤µ¤ì¤¿¡£ +POSIX.1-2001 ¤Ç¤Ï +.I +¤ÇÀë¸À¤ò¹Ô¤¦¤³¤È¤òǧ¤á¤Æ¤¤¤Ê¤¤¡£ +.TP +.BR getopt_long "(), " getopt_long_only (): +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +Ê£¿ô¤Î°ú¤­¿ô¥Ù¥¯¥È¥ë¤ò¥¹¥­¥ã¥ó¤·¤¿¤ê¡¢Æ±¤¸°ú¤­¿ô¥Ù¥¯¥È¥ë¤òÆó²ó°Ê¾å +¥¹¥­¥ã¥ó¤¹¤ë¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¡¢ +.I optstring +¤ÎÀèƬ¤Ç \(aq+\(aq ¤ä \(aq\-\(aq ¤È¤¤¤Ã¤¿ GNU ¤Ë¤è¤ë³ÈÄ¥µ¡Ç½¤ò»ÈÍѤ·¤¿¤ê¡¢ +°ú¤­¿ô¥Ù¥¯¥È¥ë¤ÎÀÚ¤êÂؤ¨»þ¤Ë +.B POSIXLY_CORRECT +¤ÎÃͤòÊѹ¹¤·¤¿¤ê¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢ +.I optind +¤òÅÁÅýŪ¤Ê 1 ¤Ç¤Ï¤Ê¤¯ 0 ¤Ë¥ê¥»¥Ã¥È¤¹¤ë¤³¤È¤Ç +.BR getopt () +¤òºÆ½é´ü²½¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(0 ¤Ë¥ê¥»¥Ã¥È¤¹¤ë¤³¤È¤Ç¡¢ +.B POSIXLY_CORRECT +¤ä +.I optstring +¤Î GNU ³ÈÄ¥µ¡Ç½¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦ÆâÉô½é´ü²½¥ë¡¼¥Á¥ó¤¬µ¯Æ°¤µ¤ì¤ë)¡£ +.SH ¥Ð¥° +POSIX.2 ¤Ë¤ª¤±¤ë +.BR getopt () +¤Î»ÅÍͤˤϵ»½ÑŪ¤ÊÌäÂ꤬¤¢¤ê¡¢ +¤½¤ÎÆâÍÆ¤Ï POSIX.2 Interpretation 150 ¤Ëµ­¤µ¤ì¤Æ¤¤¤ë¡£ +GNU ¤Ë¤è¤ë¼ÂÁõ¤Ç¤Ï (¤ª¤½¤é¤¯Â¾¤Î¤¹¤Ù¤Æ¤Î¼ÂÁõ¤Ç¤â)¡¢ +»ÅÍͤȰۤʤëÀµ¤·¤¤Æ°ºî¤ò¤¹¤ë¤è¤¦¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Îã +°Ê²¼¤Ë¼¨¤¹´Êñ¤Ê¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +Æó¼ïÎà¤Î¥×¥í¥°¥é¥à¥ª¥×¥·¥ç¥ó¤ò°·¤¦¤Î¤Ë +.BR getopt () +¤ò»ÈÍѤ·¤Æ¤¤¤ë¡£°ì¤Ä¤ÏÃͤòȼ¤ï¤Ê¤¤ +.I \-n +¤Ç¡¢¤â¤¦°ì¤Ä¤ÏÂбþ¤¹¤ëÃͤ¬É¬Í×¤Ê +.I "\-t val" +¤Ç¤¢¤ë¡£ +.nf +.sp +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int flags, opt; + int nsecs, tfnd; + + nsecs = 0; + tfnd = 0; + flags = 0; + while ((opt = getopt(argc, argv, "nt:")) != \-1) { + switch (opt) { + case \(aqn\(aq: + flags = 1; + break; + case \(aqt\(aq: + nsecs = atoi(optarg); + tfnd = 1; + break; + default: /* \(aq?\(aq */ + fprintf(stderr, "Usage: %s [\-t nsecs] [\-n] name\\n", + argv[0]); + exit(EXIT_FAILURE); + } + } + + printf("flags=%d; tfnd=%d; optind=%d\\n", flags, tfnd, optind); + + if (optind >= argc) { + fprintf(stderr, "Expected argument after options\\n"); + exit(EXIT_FAILURE); + } + + printf("name argument = %s\\n", argv[optind]); + + /* Other code omitted */ + + exit(EXIT_SUCCESS); +} +.fi +.PP +°Ê²¼¤Ï¡¢ +.BR getopt_long () +¤Î»ÈÍÑË¡¤ò¡¢¤Û¤Ü¤¹¤Ù¤Æ¤Îµ¡Ç½¤Ë¤Ä¤¤¤Æ¼¨¤·¤¿¥×¥í¥°¥é¥à¤ÎÎã¤Ç¤¢¤ë¡£ +.nf +.sp +#include /* for printf */ +#include /* for exit */ +#include + +int +main(int argc, char **argv) { + int c; + int digit_optind = 0; + + while (1) { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 1, 0, \(aqc\(aq}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long(argc, argv, "abc:d:012", + long_options, &option_index); + if (c == \-1) + break; + + switch (c) { + case 0: + printf("option %s", long_options[option_index].name); + if (optarg) + printf(" with arg %s", optarg); + printf("\\n"); + 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"); + digit_optind = this_option_optind; + printf("option %c\\n", c); + break; + + case \(aqa\(aq: + printf("option a\\n"); + break; + + case \(aqb\(aq: + printf("option b\\n"); + break; + + case \(aqc\(aq: + printf("option c with value \(aq%s\(aq\\n", optarg); + break; + + case \(aqd\(aq: + printf("option d with value \(aq%s\(aq\\n", optarg); + break; + + case \(aq?\(aq: + break; + + default: + printf("?? getopt returned character code 0%o ??\\n", c); + } + } + + if (optind < argc) { + printf("non-option ARGV\-elements: "); + while (optind < argc) + printf("%s ", argv[optind++]); + printf("\\n"); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR getsubopt (3), +.BR feature_test_macros (7) diff --git a/release/man3/getpass.3 b/release/man3/getpass.3 new file mode 100644 index 00000000..8a4fbd43 --- /dev/null +++ b/release/man3/getpass.3 @@ -0,0 +1,139 @@ +.\" Copyright (c) 2000 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) 1997 Hiroaki Nagoya +.\" all rights reserved. +.\" Translated Mon Sep 21 20:47:50 JST 1998 by Hiroaki Nagoya +.\" Updated&Modified Fri 9 Feb 2001 by NAKANO Takeo +.\" +.TH GETPASS 3 2000-12-05 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +getpass \- ¥Ñ¥¹¥ï¡¼¥É¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "char *getpass( const char *" prompt ); +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤Ï obsolete ¤Ç¤¢¤ë¡£ÍѤ¤¤Ê¤¤¤³¤È¡£ +.PP +.BR getpass () +´Ø¿ô¤Ï +.I /dev/tty +(¥×¥í¥»¥¹¤ÎÀ©¸æüËö) ¤ò¥ª¡¼¥×¥ó¤·¡¢Ê¸»úÎó +.I prompt +¤ò½ÐÎϤ¹¤ë¡£¤½¤·¤Æ echo ¤ò¥ª¥Õ¤Ë¤·¡¢°ì¹Ô (¡Ö¥Ñ¥¹¥ï¡¼¥É¡×) +¤òÆɤ߹þ¤ß¡¢Ã¼Ëö¤Î¾õÂÖ¤ò¸µ¤ËÌᤷ¤Æ¡¢ºÆ¤Ó +.I /dev/tty +¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR getpass () +´Ø¿ô¤ÏÆþÎϤµ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É +(¤ÎºÇ½é¤Î +.B PASS_MAX +¥Ð¥¤¥È¤Þ¤Ç) ¤¬½ñ¤­¤³¤Þ¤ì¤¿¡¢ +¥¹¥¿¥Æ¥£¥Ã¥¯¤Ê¥Ð¥Ã¥Õ¥¡¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +ËöÈø¤Î²þ¹Ô¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£¤³¤Îʸ»úÎó¤Ï NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +¤³¤Î¥Ð¥Ã¥Õ¥¡¡¼¤Ï¡¢°Ê¹ß¤Î´Ø¿ô¥³¡¼¥ë¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¥¨¥é¡¼¤¬µ¯¤³¤ë¤È¡¢Ã¼Ëö¤Î¾õÂÖ¤òÉü¸µ¤·¡¢ +.I errno +¤òŬÀÚ¤ÊÃͤËÀßÄꤷ¤Æ¡¢NULL ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤³¤Î´Ø¿ô¤Ï°Ê²¼¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¼ºÇÔ¤·¤¦¤ë¡£ +.TP +.B ENXIO +¥×¥í¥»¥¹¤¬À©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +.I /dev/tty +.\" .SH ÍúÎò +.\" .BR getpass () +.\" ´Ø¿ô¤Ï Version 7 AT&T UNIX ¤ÇÅо줷¤¿¡£ +.SH ½àµò +SUSv2 ¤Ë¤Ï¸ºß¤¹¤ë¤¬¡¢²áµî¤Î̾»Ä (LEGACY) ¤È°ÌÃÖÉÕ¤±¤é¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Çºï½ü¤µ¤ì¤¿¡£ +.SH Ãí°Õ +libc4 ¤È libc5 ¤Ç¤Ï¡¢ +.I prompt +¤Ï +.I /dev/tty +¤Ë¤Ç¤Ï¤Ê¤¯ +.I stderr +¤Ë½ÐÎϤµ¤ì¤¿¡£¤µ¤é¤Ë¡¢ +.I /dev/tty +¤¬¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ñ¥¹¥ï¡¼¥É¤Ï +.I stdin +¤«¤éÆɤ߹þ¤Þ¤ì¤¿¡£ +¥¹¥¿¥Æ¥£¥Ã¥¯¤Ê¥Ð¥Ã¥Õ¥¡¡¼¤ÎŤµ¤Ï 128 ¥Ð¥¤¥È¤À¤Ã¤¿¤Î¤Ç¡¢ +¥Ñ¥¹¥ï¡¼¥É¤ÎºÇ½é¤Î 127 ʸ»ú¤À¤±¤¬ÊÖ¤µ¤ì¤¿¡£ +¥Ñ¥¹¥ï¡¼¥É¤òÆɤó¤Ç¤¤¤ëÅÓÃæ¤Ë¤Ï¡¢¥·¥°¥Ê¥ë¤Îȯ¹Ô +.RB ( SIGINT , +.BR SIGQUIT , +.BR SIGSTOP , +.BR SIGTSTOP ) +¤Ï̵¸ú¤Ë¤µ¤ì¡¢ +¤½¤ì¤¾¤ì¤ËÂбþ¤¹¤ëʸ»ú (Ä̾ï¤Ï Ctrl-C, Ctrl-\e, Ctrl-Z, Ctrl-Y) +¤Ï¤½¤Î¤Þ¤Þ¥Ñ¥¹¥ï¡¼¥É¤Î°ìÉô¤È¤·¤ÆÅϤµ¤ì¤¿¡£ +libc 5.4.19 ¤«¤é¤Ï¹ÔÊÔ½¸¤¬Ìµ¸ú¤Ë¤µ¤ì¡¢ +¤·¤¿¤¬¤Ã¤Æ¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤Ê¤É¤â¥Ñ¥¹¥ï¡¼¥É¤Î°ìÉô¤È¤ß¤Ê¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +.PP +glibc2 ¤Ç¤Ï¡¢ +.I /dev/tty +¤¬¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï +.I prompt +¤Ï +.I stderr +¤Ë½ñ¤­½Ð¤µ¤ì¡¢¥Ñ¥¹¥ï¡¼¥É¤Ï +.I stdin +¤«¤éÆɤ߹þ¤Þ¤ì¤¿¡£ +¥Ñ¥¹¥ï¡¼¥É¤ÎŤµ¤Ë¤ÏÀ©¸Â¤Ï¤Ê¤¯¡¢ +¹ÔÊÔ½¸¤â̵¸ú¤Ë¤Ï¤µ¤ì¤Ê¤«¤Ã¤¿¡£ +.PP +SUSv2 ¤Ë¤è¤ì¤Ð¡¢ +.B PASS_MAX +¤ÎÃͤ¬ 8 °Ê²¼¤Î¾ì¹ç¤Ï¡¢¤³¤ÎÃÍ¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤¤¤º¤ì¤Î¾ì¹ç¤Ç¤â¤³¤ÎÃÍ¤Ï +.I sysconf(_SC_PASS_MAX) +¤Ë¤è¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£ +¤·¤«¤·¡¢POSIX.2 ¤ÏÄê¿ô +.BR PASS_MAX , +.B _SC_PASS_MAX +¤È´Ø¿ô +.BR getpass () +¤ò¼è¤ê²¼¤²¤¿¡£ +libc4 ¤È libc5 ¤Ç¤Ï¡¢ +.B PASS_MAX +¤È +.B _SC_PASS_MAX +¤Ï°ìÅ٤⥵¥Ý¡¼¥È¤µ¤ì¤¿¤³¤È¤Ï¤Ê¤¤¡£ +glibc2 ¤Ï +.B _SC_PASS_MAX +¤ò¼õÉÕ¤±¡¢ +.B BUFSIZE +(Î㤨¤Ð 8192) ¤òÊÖ¤¹¡£ +.SH ¥Ð¥° +¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¡¢ +¤Ç¤­¤ë¸Â¤êÁ᤯¤½¤Î¥Ñ¥¹¥ï¡¼¥É¤ò¾Ãµî (¥¼¥í¥¯¥ê¥¢) ¤·¡¢ +¥¯¥ê¥¢¥Æ¥­¥¹¥È¤Î¥Ñ¥¹¥ï¡¼¥É¤¬ +¤½¤Î¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ç¸«¤¨¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR crypt (3) diff --git a/release/man3/getprotoent.3 b/release/man3/getprotoent.3 new file mode 100644 index 00000000..422546ed --- /dev/null +++ b/release/man3/getprotoent.3 @@ -0,0 +1,124 @@ +.\" 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 Sat Jul 24 19:26:03 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Fri Mar 15 1998 by NAKANO Takeo +.\" Updated 2008-09-19, Akihiro MOTOKI +.\" +.TH GETPROTOENT 3 2008-08-19 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getprotoent, getprotobyname, getprotobynumber, setprotoent, endprotoent \- +¥×¥í¥È¥³¥ë¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.B struct protoent *getprotoent(void); +.sp +.BI "struct protoent *getprotobyname(const char *" name ); +.sp +.BI "struct protoent *getprotobynumber(int " proto ); +.sp +.BI "void setprotoent(int " stayopen ); +.sp +.B void endprotoent(void); +.fi +.SH ÀâÌÀ +.BR getprotoent () +´Ø¿ô¤Ï¡¢¥×¥í¥È¥³¥ë¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.RB ( protocols (5) +»²¾È) ¤«¤é¼¡¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤ß¡¢ +¤½¤Î¥¨¥ó¥È¥ê¤ò \fIprotoent\fP ¹½Â¤ÂΤÎÍ×ÁÇÊ̤Υե£¡¼¥ë¥É¤Ë³ÊǼ¤·¡¢ +¤½¤Î¹½Â¤ÂΤòÊÖ¤¹¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.BR getprotobyname () +´Ø¿ô¤Ï¡¢¥×¥í¥È¥³¥ë̾ \fIname\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fIprotoent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.BR getprotobynumber () +´Ø¿ô¤Ï¡¢¥×¥í¥È¥³¥ëÈÖ¹æ \fInumber\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò +¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fIprotoent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.BR setprotoent () +´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥ª¡¼¥×¥ó¤·¡¢ +¼¡¤ÎÆɤ߹þ¤ß¥¨¥ó¥È¥ê¤òÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤹ¤ë¡£ +\fIstayopen\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢ +°ì¤Ä°ì¤Ä¤Î +.BR getproto* () +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¡£ +.PP +.BR endprotoent () +´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +\fIprotoent\fP ¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +struct protoent { + char *p_name; /* official protocol name */ + char **p_aliases; /* alias list */ + int p_proto; /* protocol number */ +} +.fi +.in +.PP +\fIprotoent\fP ¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Ï°Ê²¼¤ÎÄ̤ꡣ +.RS +.TP 12 +.I p_name +¥×¥í¥È¥³¥ë¤ÎÀµ¼°Ì¾ (official name)¡£ +.TP +.I p_aliases +¥×¥í¥È¥³¥ë¤ÎÊÌ̾¤Î¥ê¥¹¥È¡£ +¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.TP +.I p_proto +¥×¥í¥È¥³¥ë¤ÎÈÖ¹æ +.RE +.SH ÊÖ¤êÃÍ +.BR getprotoent (), +.BR getprotobyname (), +.BR getprotobynumber () +´Ø¿ô¤Ï¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ \fIprotoent\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë㤷¤¿¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ¥Õ¥¡¥¤¥ë +.PD 0 +.TP +.I /etc/protocols +¥×¥í¥È¥³¥ë¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.PD +.SH ½àµò +4.3BSD, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR getnetent (3), +.BR getprotoent_r (3), +.BR getservent (3), +.BR protocols (5) diff --git a/release/man3/getpt.3 b/release/man3/getpt.3 new file mode 100644 index 00000000..31024aee --- /dev/null +++ b/release/man3/getpt.3 @@ -0,0 +1,60 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This man page was written by Jeremy Phelps . +.\" Redistribute and modify at will. +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 01:44:54 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: pseudo-terminal µ¼»÷üËö +.\"WORD: specific Æȼ«¤Î +.\" +.TH GETPT 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getpt \- µ¼»÷üËö¥Þ¥¹¥¿ (PTM) ¤ò¥ª¡¼¥×¥ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.B "int getpt(void);" +.fi +.SH ÀâÌÀ +.BR getpt () +¤Ï¡¢µ¼»÷üËö¥Þ¥¹¥¿¤ò¥ª¡¼¥×¥ó¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¤³¤ì¤Ï¡¢ Linux ¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¤Ï +.nf + + open(/dev/ptmx, O_RDWR | O_NOCTTY); + +.fi +¤ÈÅù²Á¤Ç¤¢¤ë¡£Ã¢¤·¡¢ GNU Libc ¤ò»ÈÍѤ·¤Æ¤¤¤Æ¤â¡¢ +µ¼»÷üËö¥Þ¥¹¥¿¤¬¤É¤³¤«Â¾¤Î¾ì½ê¤Ë¤¢¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR getpt () +¤Ï¥ª¡¼¥×¥ó¤·¤¿¥Õ¥¡¥¤¥ë¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR getpt () +¤Ï +.BR open (2) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¼ï¡¹¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR getpt () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +.BR getpt () +¤Ï glibc Æȼ«¤Ç¤¢¤ë¡£Âå¤ï¤ê¤Ë +.BR posix_openpt (3) +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR grantpt (3), +.BR posix_openpt (3), +.BR ptsname (3), +.BR unlockpt (3), +.BR ptmx (4), +.BR pty (7) diff --git a/release/man3/getpw.3 b/release/man3/getpw.3 new file mode 100644 index 00000000..1448508e --- /dev/null +++ b/release/man3/getpw.3 @@ -0,0 +1,114 @@ +.\" 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 Sat Jul 24 19:23:25 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon May 27 21:37:47 1996 by Martin Schulze (joey@linux.de) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-19, HIROFUMI Nishizuka +.\" Modified 1999-12-08, Kentaro Shirakata +.\" Modified 2005-09-04, Akihiro MOTOKI +.\" Modified 2008-07-23, Kentaro Shirakata +.\" +.TH GETPW 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getpw \- ¥Ñ¥¹¥ï¡¼¥É¹Ô¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.B #include +.sp +.BI "int getpw(uid_t " uid ", char *" buf ); +.fi +.SH ÀâÌÀ +.BR getpw () +´Ø¿ô¤Ï¡¢¥Ð¥Ã¥Õ¥¡ \fIbuf\fP ¤Ë»ØÄê¥æ¡¼¥¶ ID \fIuid\fP ¤Î +¥Ñ¥¹¥ï¡¼¥É¹Ô¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë¡£ +ÊÖ¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ï¡¢°Ê²¼¤Î·Á¼°¤Î¹Ô¤ò´Þ¤à¡£ +.sp +.in +4n +.B name:passwd:uid:gid:gecos:dir:shell +.in +.PP +\fIpasswd\fP ¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct passwd { + char *pw_name; /* username */ + char *pw_passwd; /* user password */ + uid_t pw_uid; /* user ID */ + gid_t pw_gid; /* group ID */ + char *pw_gecos; /* real name */ + char *pw_dir; /* home directory */ + char *pw_shell; /* shell program */ +}; +.fi +.in +.SH ÊÖ¤êÃÍ +.BR getpw () +´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹; ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç \-1 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤ò +¼¨¤¹¤¿¤á¤Ë +.I error +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I buf +¤¬ NULL¡£ +.TP +.B ENOENT +.I uid +¤ËÂбþ¤¹¤ë¥æ¡¼¥¶¤¬¤¤¤Ê¤¤¡£ +.TP +.B ENOMEM +.I passwd +¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/passwd +¥Ñ¥¹¥ï¡¼¥É¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.SH ½àµò +SVr2 +.SH ¥Ð¥° +.BR getpw () +´Ø¿ô¤Ï¡¢Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡ +.I buf +¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç´í¸±¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï +.BR getpwuid (3) +¤Ë¤è¤Ã¤Æ¸Å¤¤¤â¤Î¤È¤Ê¤Ã¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR endpwent (3), +.BR fgetpwent (3), +.BR getpwent (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR putpwent (3), +.BR setpwent (3), +.BR passwd (5) diff --git a/release/man3/getpwent.3 b/release/man3/getpwent.3 new file mode 100644 index 00000000..b6f3c086 --- /dev/null +++ b/release/man3/getpwent.3 @@ -0,0 +1,155 @@ +.\" 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 Sat Jul 24 19:22:14 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon May 27 21:37:47 1996 by Martin Schulze (joey@linux.de) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-18, HIROFUMI Nishizuka +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" +.TH GETPWENT 3 2009-03-30 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getpwent, setpwent, endpwent \- ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤Î¼èÆÀ +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.B struct passwd *getpwent(void); +.sp +.B void setpwent(void); +.sp +.B void endpwent(void); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR getpwent (), +.BR setpwent (), +.BR endpwent (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE > = 500 +.ad b +.SH ÀâÌÀ +.BR getpwent () +´Ø¿ô¤Ï¡¢¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¼èÆÀ¤·¤¿¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹ +(¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÎã: +¥í¡¼¥«¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë +.IR /etc/passwd , +NIS, LDAP)¡£ +ºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤ÏºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤·¡¢¤½¤ì°Ê¹ß¤Ï +¸Æ¤Ó½Ð¤µ¤ì¤ëËè¤Ë¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +.PP +.BR setpwent () +´Ø¿ô¤ò»È¤¦¤È¡¢¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀèƬ¤ËÌá¤ë¡£ +.PP +.BR endpwent () +´Ø¿ô¤Ï¡¢Á´¤Æ¤Î½èÍý¤¬½ª¤ï¤Ã¤¿¸å¤Ë¥Ñ¥¹¥ï¡¼¥É¡¦ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +\fIpasswd\fP ¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct passwd { + char *pw_passwd; /* ¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É */ + uid_t pw_uid; /* ¥æ¡¼¥¶ ID */ + gid_t pw_gid; /* ¥°¥ë¡¼¥× ID */ + char *pw_gecos; /* ¼Â̾ */ + char *pw_dir; /* ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê */ + char *pw_shell; /* ¥·¥§¥ë¥×¥í¥°¥é¥à */ +}; +.fi +.in +.SH ÊÖ¤êÃÍ +.BR getpwent () +´Ø¿ô¤Ï +.I passwd +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ì°Ê¾å¥¨¥ó¥È¥ê¤¬Ìµ¤¤¤«¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +¤³¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¸å¤Ë +.I errno +¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢¸Æ¤Ó½Ð¤·Á°¤Ë +.I errno +¤ò 0 ¤ËÀßÄꤷ¤Æ¤ª¤«¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£ + +ÊÖ¤êÃͤÏÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤½¤Î¸å¤Î +.BR getpwent (), +.BR getpwnam (3), +.BR getpwuid (3) +¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +(ÊÖ¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤ò +.BR free (3) +¤ËÅϤµ¤Ê¤¤¤³¤È¡£) +.SH ¥¨¥é¡¼ +.TP +.B EINTR +¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤¿¡£ +.TP +.B EIO +Æþ½ÐÎÏ¥¨¥é¡¼¡£ +.TP +.B EMFILE +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤¬ +¤¹¤Ç¤Ë¾å¸Â +.RB ( OPEN_MAX ) +¤Ç¤¢¤Ã¤¿¡£ +.TP +.B ENFILE +¥·¥¹¥Æ¥à¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤¬¤¹¤Ç¤Ë¾å¸Â¤Ç¤¢¤Ã¤¿¡£ +.TP +.B ENOMEM +.\" POSIX ¤Ë¤Ï¤Ê¤¤¡£ +.I passwd +¹½Â¤ÂΤ˳ä¤êÅö¤Æ¤ë¥á¥â¥ê¤¬½½Ê¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B ERANGE +½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/passwd +¥í¡¼¥«¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR fgetpwent (3), +.BR getpw (3), +.BR getpwent_r (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR putpwent (3), +.BR passwd (5) diff --git a/release/man3/getpwent_r.3 b/release/man3/getpwent_r.3 new file mode 100644 index 00000000..7a87b1bf --- /dev/null +++ b/release/man3/getpwent_r.3 @@ -0,0 +1,195 @@ +.\" 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 Aug 8 00:53:40 JST 2004 +.\" by Yuichi SATO +.\" +.TH GETPWENT_R 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getpwent_r, fgetpwent_r \- ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤ò +¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¼è¤ê½Ð¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getpwent_r(struct passwd *" pwbuf ", char *" buf , +.br +.BI " size_t " buflen ", struct passwd **" pwbufp ); +.sp +.BI "int fgetpwent_r(FILE *" fp ", struct passwd *" pwbuf ", char *" buf , +.br +.BI " size_t " buflen ", struct passwd **" pwbufp ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR getpwent_r (), +_BSD_SOURCE || _SVID_SOURCE +.br +.BR fgetpwent_r (): +_SVID_SOURCE +.SH ÀâÌÀ +´Ø¿ô +.BR getpwent_r () +¤È +.BR fgetpwent_r () +¤Ï +.BR getpwent (3) +¤È +.BR fgetpwent (3) +¤Î¥ê¥¨¥ó¥È¥é¥ó¥È (reentrant) ÈǤǤ¢¤ë¡£ +Á°¼Ô¤Ï¡¢ +.BR setpwent (3) +¤Ë¤è¤Ã¤Æ½é´ü²½¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤«¤é¡¢¼¡¤Î¥Ñ¥¹¥ï¡¼¥É¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à¡£ +¸å¼Ô¤Ï¡¢¥¹¥È¥ê¡¼¥à +.I fp +¤«¤é¼¡¤Î¥Ñ¥¹¥ï¡¼¥É¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à¡£ +.PP +\fIpasswd\fP ¹½Â¤ÂÎ¤Ï +.I +¤Ë¤ª¤¤¤Æ°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +struct passwd { + char *pw_name; /* ¥æ¡¼¥¶Ì¾ */ + char *pw_passwd; /* ¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É */ + uid_t pw_uid; /* ¥æ¡¼¥¶ ID */ + gid_t pw_gid; /* ¥°¥ë¡¼¥× ID */ + char *pw_gecos; /* ¼ÂºÝ¤Î̾Á° */ + char *pw_dir; /* ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê */ + char *pw_shell; /* ¥·¥§¥ë¥×¥í¥°¥é¥à */ +}; +.fi +.in +.sp +¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ê¤¤´Ø¿ô¤ÏÀÅŪ¤Ê³ÊǼÎΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ÎÀÅŪ¤Ê³ÊǼÎΰè¤Ë¤Ï¡¢¹¹¤Ë¥æ¡¼¥¶Ì¾¡¦¥Ñ¥¹¥ï¡¼¥É¡¦gecos ¥Õ¥£¡¼¥ë¥É¡¦ +¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¡¦¥·¥§¥ë¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬´Þ¤Þ¤ì¤ë¡£ +¤³¤³¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤδؿô¤Ï¡¢ +¸Æ¤Ó½Ð¤·Â¦¤«¤éÄ󶡤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë¥æ¡¼¥¶Ì¾¤Ê¤ÉÁ´¤Æ¤òÊÖ¤¹¡£ +ºÇ½é¤Î°ú¤­¿ô¤È¤·¤Æ \fIstruct passwd\fP ¤òÊÝ»ý¤Ç¤­¤ë¥Ð¥Ã¥Õ¥¡ +.I pwbuf +¤¬¤¢¤ë¡£ +¼¡¤Ë¤½¤Î¾¤Îʸ»úÎó¤òÊÝ»ý¤Ç¤­¤ë¥µ¥¤¥º +.I buflen +¤Î¥Ð¥Ã¥Õ¥¡ +.I buf +¤¬¤¢¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Î·ë²Ì (¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤Þ¤ì¤¿ \fIstruct passwd\fP) ¤Ï¡¢ +Ä󶡤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡ +.I *pwbuf +¤Ë³ÊǼ¤µ¤ì¡¢¤³¤Î \fIstruct passwd\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï +.I *pwbufp +¤ËÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï 0 ¤òÊÖ¤·¡¢ +.I *pwbufp +¤Ï \fIstruct passwd\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¨¥é¡¼ÃͤòÊÖ¤·¡¢ +.I *pwbufp +¤Ï NULL ¤Ë¤Ê¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOENT +¼¡¤Î¥¨¥ó¥È¥ê¤¬¤Ê¤¤¡£ +.TP +.B ERANGE +½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +¤â¤Ã¤ÈÂ礭¤Ê¥Ð¥Ã¥Õ¥¡¤ÇºÆÅټ¹Ԥ¹¤ë¤³¤È¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ê¡¢POSIX ÈǤδؿô +.BR getpwnam_r (3) +¤Î·Á¼°¤Ë»÷¤»¤Æ¤¢¤ë¡£ +¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï°Ê²¼¤Î¥×¥í¥È¥¿¥¤¥×¤¬»È¤ï¤ì¤Æ¤¤¤ë¡£ +.sp +.nf +.in +4n +struct passwd * +getpwent_r(struct passwd *pwd, char *buf, int buflen); +.in +.fi +.sp +¤è¤êÎɤ¤¤â¤Î¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.sp +.nf +.in +4n +int +getpwent_r(struct passwd *pwd, char *buf, int buflen, + FILE **pw_fp); +.in +.fi +.SH Ãí°Õ +´Ø¿ô +.BR getpwent_r () +¤ÏËÜÅö¤Î¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ï¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢¥¹¥È¥ê¡¼¥à¤ÎÆɤ߹þ¤ß°ÌÃÖ¤ò +¾¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤È¶¦Í­¤·¤Æ¤¤¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.SH Îã +.nf +#define _GNU_SOURCE +#include +#include +#define BUFLEN 4096 + +int +main(void) +{ + struct passwd pw, *pwp; + char buf[BUFLEN]; + int i; + + setpwent(); + while (1) { + i = getpwent_r(&pw, buf, BUFLEN, &pwp); + if (i) + break; + printf("%s (%d)\etHOME %s\etSHELL %s\en", pwp\->pw_name, + pwp\->pw_uid, pwp\->pw_dir, pwp\->pw_shell); + } + endpwent(); + exit(EXIT_SUCCESS); +} +.fi +.\" ¤¿¤Ö¤ó¥¨¥é¡¼¥Á¥§¥Ã¥¯¤òÄɲ䷤ơ¢strerror_r ¤ò»È¤¦¤Ù¤­¤À¤í¤¦¡£ +.\" #include +.\" #include +.\" if (i) { +.\" if (i == ENOENT) +.\" break; +.\" printf("getpwent_r: %s", strerror(i)); +.\" exit(EXIT_SUCCESS); +.\" } +.SH ´ØÏ¢¹àÌÜ +.BR fgetpwent (3), +.BR getpw (3), +.BR getpwent (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR putpwent (3), +.BR passwd (5) diff --git a/release/man3/getpwnam.3 b/release/man3/getpwnam.3 new file mode 100644 index 00000000..c34559aa --- /dev/null +++ b/release/man3/getpwnam.3 @@ -0,0 +1,318 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's "POSIX Programmer's Guide" (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1996-05-27 by Martin Schulze (joey@linux.de) +.\" Modified 2003-11-15 by aeb +.\" 2008-11-07, mtk, Added an example program for getpwnam_r(). +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-18, HIROFUMI Nishizuka +.\" Updated & Modified 2004-01-06, Yuichi SATO +.\" Updated & Modified 2005-09-06, Akihiro MOTOKI +.\" Updated & Modified 2005-10-08, Akihiro MOTOKI +.\" Updated 2008-12-24, Akihiro MOTOKI, LDP v3.14 +.\" +.TH GETPWNAM 3 2009-03-30 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getpwnam, getpwnam_r, getpwuid, getpwuid_r \- ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤Î¼èÆÀ +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "struct passwd *getpwnam(const char *" name ); +.sp +.BI "struct passwd *getpwuid(uid_t " uid ); +.sp +.BI "int getpwnam_r(const char *" name ", struct passwd *" pwd , +.br +.BI " char *" buf ", size_t " buflen ", struct passwd **" result ); +.sp +.BI "int getpwuid_r(uid_t " uid ", struct passwd *" pwd , +.br +.BI " char *" buf ", size_t " buflen ", struct passwd **" result ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR getpwnam_r (), +.BR getpwuid_r (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +.BR getpwnam () +´Ø¿ô¤Ï¡¢¥æ¡¼¥¶Ì¾ +.I name +¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹ +(¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÎã: +¥í¡¼¥«¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë +.IR /etc/passwd , +NIS, LDAP)¡£ +.PP +.BR getpwuid () +´Ø¿ô¤Ï¡¢¥æ¡¼¥¶ ID +.I uid +¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.BR getpwnam_r () +¤È +.BR getpwuid_r () +´Ø¿ô¤Ï (¾åµ­¤Î´Ø¿ô¤È) Ʊ¤¸¾ðÊó¤ò¼èÆÀ¤¹¤ë¤¬¡¢ +¼èÆÀ¤·¤¿ +.I passwd +¹½Â¤ÂΤò +.I pwd +¤¬»Ø¤¹Îΰè¤Ë³ÊǼ¤¹¤ë¡£ +¤³¤Î +.I passwd +¹½Â¤ÂΤˤÏʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬´Þ¤Þ¤ì¡¢ +¤³¤ì¤é¤Îʸ»úÎó¤Ï¥µ¥¤¥º +.I buflen +¤Î¥Ð¥Ã¥Õ¥¡ +.I buf +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +À®¸ù¤·¤¿¾ì¹ç +.I *result +¤Ë¤Ï·ë²Ì¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬³ÊǼ¤µ¤ì¤ë¡£ +¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤ä¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤Ï +.I *result +¤Ë¤Ï NULL ¤¬Æþ¤ë¡£ +.PP +\fIpasswd\fP ¹½Â¤ÂΤϡ¢\fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct passwd { + char *pw_name; /* ¥æ¡¼¥¶Ì¾ */ + char *pw_passwd; /* ¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É */ + uid_t pw_uid; /* ¥æ¡¼¥¶ ID */ + gid_t pw_gid; /* ¥°¥ë¡¼¥× ID */ + char *pw_gecos; /* ¼Â̾ */ + char *pw_dir; /* ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê */ + char *pw_shell; /* ¥·¥§¥ë¥×¥í¥°¥é¥à */ +}; +.fi +.in +.PP +.I buf +¤ËºÇÂçɬÍפʥµ¥¤¥º¤Ï¡¢ +.BR sysconf (3) +¤Ë°ú¤­¿ô +.B _SC_GETPW_R_SIZE_MAX +¤ò»ØÄꤷ¤Æ¼Â¹Ô¤¹¤ë¤³¤È¤Çʬ¤«¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR getpwnam () +¤È +.BR getpwuid () +´Ø¿ô¤Ï¡¢ +.I passwd +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +°ìÃפ¹¤ë¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤ä¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¤Î¸å¤Ç +.I errno +¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢ +¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë (¤³¤ÎÃͤò) 0 ¤ËÀßÄꤷ¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.LP +ÊÖ¤êÃͤÏÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤½¤Î¸å¤Î +.BR getpwent (3), +.BR getpwnam (), +.BR getpwuid () +¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +(ÊÖ¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤ò +.BR free (3) +¤ËÅϤµ¤Ê¤¤¤³¤È¡£) +.LP +À®¸ù¤¹¤ë¤È¡¢ +.BR getpwnam_r () +¤È +.BR getpwuid_r () +¤Ï 0 ¤òÊÖ¤·¡¢ +.I *result +¤Ë +.I pwd +¤òÀßÄꤹ¤ë¡£ +¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹¥ï¡¼¥É¡¦¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +0 ¤òÊÖ¤·¡¢ +.I *result +¤Ë NULL ¤òÀßÄꤹ¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤·¡¢ +.I *result +¤Ë NULL ¤òÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.BR 0 " ¤Þ¤¿¤Ï " ENOENT " ¤Þ¤¿¤Ï " ESRCH " ¤Þ¤¿¤Ï " EBADF " ¤Þ¤¿¤Ï " EPERM " ¤Þ¤¿¤Ï ... " +»ØÄꤵ¤ì¤¿ +.I name +¤Þ¤¿¤Ï +.I uid +¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINTR +¥·¥°¥Ê¥ë¤¬¥­¥ã¥Ã¥Á¤µ¤ì¤¿¡£ +.TP +.B EIO +I/O ¥¨¥é¡¼¡£ +.TP +.B EMFILE +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ë¤ª¤¤¤Æ¡¢ +´û¤ËºÇÂç¿ô (OPEN_MAX) ¤Î¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ENFILE +¥·¥¹¥Æ¥à¾å¤Ç´û¤ËºÇÂç¿ô¤Î¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ENOMEM +.\" not in POSIX +.\" POSIX ¤Ë¤Ï¤Ê¤¤¡£ +.I passwd +¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£ +.\" ¤³¤Î¹½Â¤ÂΤÏÀÅŪ¤Ç¤¢¤ê¡¢0 ²ó¤Þ¤¿¤Ï 1 ²ó³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +.\" ¥á¥â¥ê¥ê¡¼¥¯¤Ï̵¤¤¡£(libc45) +.TP +.B ERANGE +Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬ÉÔ½½Ê¬¤Ç¤¢¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/passwd +¥í¡¼¥«¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +¾åµ­¤Î¡ÖÊÖ¤êÃ͡װʲ¼¤Îµ­½Ò¤Ï POSIX.1-2001 ¤Ëµò¤ë¡£ +¤³¤Îɸ½à¤Ï¡Ö(¥¨¥ó¥È¥ê¤¬) ¸«¤Ä¤«¤é¤Ê¤¤¤³¤È¡×¤ò¥¨¥é¡¼¤È¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢ +¤½¤Î¤è¤¦¤Ê¾ì¹ç¤Ë +.I errno +¤¬¤É¤Î¤è¤¦¤ÊÃͤˤʤ뤫¤òÄê¤á¤Æ¤¤¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢¥¨¥é¡¼¤òǧ¼±¤¹¤ë¤³¤È¤ÏÉÔ²Äǽ¤Ç¤¢¤ë¡£ +POSIX ¤Ë½àµò¤·¤Æ¡¢¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï +.I errno +¤òÊѹ¹¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡¢¤È¼çÄ¥¤¹¤ë¿Í¤â¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +ÍÍ¡¹¤Ê Unix ·Ï¤Î¥·¥¹¥Æ¥à¤Ç»î¤·¤Æ¤ß¤ë¤È¡¢¤½¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï +0, ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM ¤È¤¤¤Ã¤¿ÍÍ¡¹¤ÊÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +¾¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\" ¤è¤êÀµ³Î¤Ë¤Ï: +.\" AIX 5.1 ¤Ï ESRCH ¤òÊÖ¤¹¡£ +.\" OSF1 4.0g ¤Ï EWOULDBLOCK ¤òÊÖ¤¹¡£ +.\" libc, glibc (¥Ð¡¼¥¸¥ç¥ó 2.6 ¤Þ¤Ç), Irix 6.5 ¤Ï ENOENT ¤òÊÖ¤¹¡£ +.\" glibc (¥Ð¡¼¥¸¥ç¥ó 2.7 °Ê¹ß) ¤Ï 0 ¤òÊÖ¤¹¡£ +.\" FreeBSD 4.8, OpenBSD 3.2, NetBSD 1.6 ¤Ï EPERM ¤òÊÖ¤¹¡£ +.\" SunOS 5.8 ¤Ï EBADF ¤òÊÖ¤¹¡£ +.\" Tru64 5.1b, HP-UX-11i, SunOS 5.7 ¤Ï 0 ¤òÊÖ¤¹¡£ + +¥Õ¥£¡¼¥ë¥É +.I pw_dir +¤Ë¤Ï¡¢¥æ¡¼¥¶¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê̾¤Î½é´üÃͤ¬³ÊǼ¤µ¤ì¤ë¡£ +¥í¥°¥¤¥ó¥×¥í¥»¥¹¤Ï¡¢¤³¤Î¥Õ¥£¡¼¥ë¥É¤ÎÃͤò»È¤Ã¤Æ¡¢ +¥í¥°¥¤¥ó¥·¥§¥ë¤Î +.B HOME +´Ä¶­ÊÑ¿ô¤ò½é´ü²½¤¹¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¡¢¥æ¡¼¥¶¤Î¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ò·èÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ +.RI ( getpwuid(getuid())\->pw_dir +¤ÎÃͤǤϤʤ¯) +.B HOME +¤ÎÃͤò¸¡ºº¤¹¤ë¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤Ê¤¼¤Ê¤é¡¢¤³¤Î¤è¤¦¤Ë¤¹¤ë¤³¤È¤Ç¡¢¥æ¡¼¥¶¤¬¥í¥°¥¤¥ó¡¦¥»¥Ã¥·¥ç¥óÃæ¤Ç +¡Ö¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê¡×¤Î°ÕÌ£¤òÊѹ¹¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¤«¤é¤Ç¤¢¤ë¡£ +Ê̤Υ桼¥¶¤Î¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê (¤Î½é´üÃÍ) ¤òÃΤë¤Ë¤Ï +.I getpwnam("username")\->pw_dir +¤«Æ±ÍͤÎÊýË¡¤ò»È¤¦É¬Íפ¬¤¢¤ë¡£ +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï +.BR getpwnam_r () +¤Î»ÈÍÑÎã¤ò¼¨¤·¤¿¤â¤Î¤Ç¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ÇÅϤµ¤ì¤¿¥æ¡¼¥¶Ì¾¤ËÂФ¹¤ë +´°Á´¤Ê¥æ¡¼¥¶Ì¾¤È¥æ¡¼¥¶ ID ¤òõ¤¹¤â¤Î¤Ç¤¢¤ë¡£ + +.nf +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct passwd pwd; + struct passwd *result; + char *buf; + size_t bufsize; + int s; + + if (argc != 2) { + fprintf(stderr, "Usage: %s username\\n", argv[0]); + exit(EXIT_FAILURE); + } + + bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); + if (bufsize == \-1) /* Ãͤò·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿ */ + bufsize = 16384; /* ½½Ê¬Â礭¤ÊÃͤˤ¹¤Ù¤­ */ + + buf = malloc(bufsize); + if (buf == NULL) { + perror("malloc"); + exit(EXIT_FAILURE); + } + + s = getpwnam_r(argv[1], &pwd, buf, bufsize, &result); + if (result == NULL) { + if (s == 0) + printf("Not found\\n"); + else { + errno = s; + perror("getpwnam_r"); + } + exit(EXIT_FAILURE); + } + + printf("Name: %s; UID: %ld\\n", pwd.pw_gecos, (long) pwd.pw_uid); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR endpwent (3), +.BR fgetpwent (3), +.BR getgrnam (3), +.BR getpw (3), +.BR getpwent (3), +.BR getspnam (3), +.BR putpwent (3), +.BR setpwent (3), +.BR passwd (5) diff --git a/release/man3/getrpcent.3 b/release/man3/getrpcent.3 new file mode 100644 index 00000000..9ffed11f --- /dev/null +++ b/release/man3/getrpcent.3 @@ -0,0 +1,104 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 2000-01-11, HANATAKA Shinya +.\" Updated 2008-09-19, Akihiro MOTOKI +.\" +.TH GETRPCENT 3 2008-08-19 "" "Linux Programmer's Manual" +.SH ̾Á° +getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent \- +RPC ¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include + +.BI "struct rpcent *getrpcent(void);" + +.BI "struct rpcent *getrpcbyname(char *" name ); + +.BI "struct rpcent *getrpcbynumber(int " number ); + +.BI "void setrpcent(int " stayopen ); + +.BI "void endrpcent(void);" +.fi +.SH ÀâÌÀ +.LP +.BR getrpcent (), +.BR getrpcbyname (), +.BR getrpcbynumber () +¤Ï¤½¤ì¤¾¤ì°Ê²¼¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï RPC ¥×¥í¥°¥é¥àÈÖ¹æ¥Ç¡¼¥¿¥Ù¡¼¥¹ +¤Î³Æ¹Ô¤Î¥Õ¥£¡¼¥ë¥É¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +.in +4n +.nf + +struct rpcent { + char *r_name; /* name of server for this RPC program */ + char **r_aliases; /* alias list */ + long r_number; /* RPC program number */ +}; +.fi +.in +.LP +¤³¤Î¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Ï°Ê²¼¤ÎÄ̤ꡣ +.RS 4 +.TP 12 +.I r_name +¤³¤Î RPC ¥×¥í¥°¥é¥à¤Î¥µ¡¼¥Ð¤Î̾Á° +.TP +.I r_aliases +RPC ¥×¥í¥°¥é¥à¤ÎÊÌ̾¤Î¥ê¥¹¥È¡£¥¼¥í¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.I r_number +¤³¤Î¥µ¡¼¥Ó¥¹¤Î RPC ¥×¥í¥°¥é¥àÈֹ档 +.RE +.LP +.BR getrpcent () +¤Ï¥Õ¥¡¥¤¥ë¤Î¼¡¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à¡£ +ɬÍפʤé¤Ð¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.LP +.BR setrpcent () +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥ª¡¼¥×¥ó¤·¡¢ +¼¡¤ÎÆɤ߹þ¤ß¥¨¥ó¥È¥ê¤òÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤹ¤ë¡£ +\fIstayopen\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢ +°ì¤Ä°ì¤Ä¤Î +.BR getrpc* () +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¡£ +.LP +.BR endrpcent () +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.LP +.BR getrpcbyname () +¤È +.BR getrpcbynumber () +¤Ï¥Õ¥¡¥¤¥ë¤ÎºÇ½é¤«¤é°ìÃפ¹¤ë RPC ¥×¥í¥°¥é¥à̾¤«¥×¥í¥°¥é¥àÈֹ椬 +¸«¤Ä¤«¤ë¤«¡¢¥Õ¥¡¥¤¥ë¤ÎºÇ¸å (end-of-file) ¤ËÅþ㤹¤ë¤Þ¤Ç¡¢½çÈÖ¤Ë +õ¤·¤Æ¤¤¤¯¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR getrpcent (), +.BR getrpcbyname (), +.BR getrpcbynumber () +¤Ï¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ +.I rpcent +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +EOF ¤« ¥¨¥é¡¼¤ËÁø¶ø¤·¤¿¾ì¹ç¤Ë¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/rpc +RPC ¥×¥í¥°¥é¥àÈÖ¹æ¥Ç¡¼¥¿¥Ù¡¼¥¹ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¡¢Solaris ¤ä¾¤Î¿¤¯¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +.SH ¥Ð¥° +Á´¤Æ¤Î¾ðÊó¤ÏÀÅŪÎΰè¤Ë³ÊǼ¤µ¤ì¤ë¡£ +Êݸ¤¹¤ë¤¿¤á¤Ë¤ÏÁ´¤Æ¤ò¥³¥Ô¡¼¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getrpcent_r (3), +.BR rpc (5), +.BR rpcinfo (8), +.BR ypserv (8) diff --git a/release/man3/getrpcport.3 b/release/man3/getrpcport.3 new file mode 100644 index 00000000..3011d0ac --- /dev/null +++ b/release/man3/getrpcport.3 @@ -0,0 +1,40 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)getrpcport.3r 2.2 88/08/02 4.0 RPCSRC; from 1.12 88/02/26 SMI +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Tue Jan 11 00:56:31 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH GETRPCPORT 3 2007-12-23 "" "Linux Programmer's Manual" +.SH ̾Á° +getrpcport \- RPC ¥Ý¡¼¥ÈÈÖ¹æ¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.BI "int getrpcport(char *" host ", int " prognum ", int " versnum \ +", int " proto ); +.fi +.SH ÀâÌÀ +.BR getrpcport () +¤Ï +.I host +¾å¤Ç +.I proto +¥×¥í¥È¥³¥ë¤ò»ÈÍѤ·¤Æ¤¤¤ë¥Ð¡¼¥¸¥ç¥ó +.I versnum +¤Î RPC ¥×¥í¥°¥é¥à +.I prognum +¤Î¥Ý¡¼¥ÈÈÖ¹æ¤òÊÖ¤¹¡£ +¥Ý¡¼¥È¥Þ¥Ã¥Ñ¡¼¤ÈÏ¢Íí¤¬¼è¤ì¤Ê¤¤¾ì¹ç¤ä +.I prognum +¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.I prognum +¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¥Ð¡¼¥¸¥ç¥ó +.I versnum +¤Ç¤Ê¤¤¾ì¹ç¤Ë¤â¡¢¤½¤Î¥×¥í¥°¥é¥à¤¬¼ÂºÝ¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò¼¨¤¹¤¿¤á¤Ë +(¤½¤Î¥×¥í¥°¥é¥à¤Î¥Ð¡¼¥¸¥ç¥ó¤Î)¥Ý¡¼¥ÈÈÖ¹æ¤òÊÖ¤¹¡£ +¥Ð¡¼¥¸¥ç¥ó¤ÎÉÔ°ìÃפϺǽé¤Ë¤½¤Î¥µ¡¼¥Ó¥¹¤ò¸Æ¤Ó½Ð¤·¤¿»þ¤Ë¸¡½Ð¤µ¤ì¤ë¡£ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¡¢Solaris ¤ä¾¤Î¿¤¯¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ diff --git a/release/man3/gets.3 b/release/man3/gets.3 new file mode 100644 index 00000000..0485e6c1 --- /dev/null +++ b/release/man3/gets.3 @@ -0,0 +1,192 @@ +.\" 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 Wed Jul 28 11:12:07 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1997 IMAMURA Nobutaka +.\" all rights reserved. +.\" Translated 1997-02-14, IMAMURA Nobutaka +.\" Updated 1999-08-29, Kentaro Shirakata +.\" Updated 2001-11-02, Kentaro Shirakata +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" +.TH GETS 3 2008-08-06 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fgetc, fgets, getc, getchar, gets, ungetc \- ʸ»ú¤Èʸ»úÎó¤ÎÆþÎÏ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fgetc(FILE *" stream ); + +.BI "char *fgets(char *" "s" ", int " "size" ", FILE *" "stream" ); + +.BI "int getc(FILE *" stream ); + +.B "int getchar(void);" + +.BI "char *gets(char *" "s" ); + +.BI "int ungetc(int " c ", FILE *" stream ); +.fi +.SH ÀâÌÀ +.BR fgetc () +¤Ï¡¢ +.I stream +¤«¤é¼¡¤Îʸ»ú¤ò +.I unsigned char +¤È¤·¤ÆÆɤߡ¢ +.I int +¤Ë¥­¥ã¥¹¥È¤·¤ÆÊÖ¤¹¡£¥Õ¥¡¥¤¥ë¤Î½ª¤ï¤ê¤ä¥¨¥é¡¼¤È¤Ê¤Ã¤¿¾ì¹ç¤Ï +.B EOF +¤òÊÖ¤¹¡£ +.PP +.BR getc () +¤Ï +.BR fgetc () +¤ÈƱÍͤÀ¤¬¡¢ +.I stream +¤òÊ£¿ô²óɾ²Á¤¹¤ë¥Þ¥¯¥í¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +.BR getchar () +¤Ï +.BI "getc(" stdin ) \fR +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.PP +.BR gets () +¤Ï¡¢²þ¹Ôʸ»ú¤« +.B EOF +¤Þ¤Ç¤Î 1¹Ô¤ò +.I stdin +¤«¤éÆɤ߹þ¤ß +.I s +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤¹¤ë +(ËöÈø¤Î²þ¹Ôʸ»ú¤ä +.B EOF +¤Ï +.B \(aq\e0\(aq +¤ËÃÖ¤­´¹¤¨¤é¤ì¤ë)¡£ +¥Ð¥Ã¥Õ¥¡¡¦¥ª¡¼¥Ð¡¼¥é¥ó¤Î¥Á¥§¥Ã¥¯¤Ï¹Ô¤ï¤ì¤Ê¤¤ (²¼µ­¤Î¡Ö¥Ð¥°¡×¤ò»²¾È)¡£ +.PP +.BR fgets () +¤Ï +.I stream +¤«¤éºÇÂç¤Ç +.IR size " - 1" +¸Ä¤Îʸ»ú¤òÆɤ߹þ¤ß¡¢ +.I s +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤¹¤ë¡£Æɤ߹þ¤ß¤Ï +.B EOF +¤Þ¤¿¤Ï²þ¹Ôʸ»ú¤òÆɤ߹þ¤ó¤À¸å¤ÇÄä»ß¤¹¤ë¡£ +Æɤ߹þ¤Þ¤ì¤¿²þ¹Ôʸ»ú¤Ï¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.B \(aq\e0\(aq +ʸ»ú¤¬°ì¤Ä¥Ð¥Ã¥Õ¥¡¤ÎÃæ¤ÎºÇ¸å¤Îʸ»ú¤Î¸å¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.PP +.BR ungetc () +¤Ï¡¢¸å¤Î read Áàºî¤ÇÆɤá¤ë¤è¤¦¤Ë¡¢ +.I c +¤ò +.I "unsigned char" +¤Ë¥­¥ã¥¹¥È¤·¤Æ +.I stream +¤Ë½ñ¤­Ì᤹¡£ +½ñ¤­Ìᤵ¤ì¤¿Ê¸»ú¤ÏµÕ½ç¤ËÌᤵ¤ì¤ë; +½ñ¤­Ìᤷ¤È¤·¤ÆÊݾڤµ¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢°ìʸ»ú¤À¤±¤Ç¤¢¤ë¡£ +.PP +¤³¤³¤Ç½Ò¤Ù¤¿´Ø¿ô¤ä +.I stdio +¥é¥¤¥Ö¥é¥ê¤ÎÆþÎÏ´Ø¿ô¤òƱ¤¸ÆþÎÏ¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¸ß¤¤¤Ëº®¤¼¤Æ»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR fgetc (), +.BR getc (), +.BR getchar () +¤Ï¡¢Ê¸»ú¤ò +.I unsigned char +¤È¤·¤ÆÆɤó¤Ç +.I int +¤Ë¥­¥ã¥¹¥È¤·¤ÆÊÖ¤¹¡£¥Õ¥¡¥¤¥ë¤Î½ª¤ï¤ê¤ä¥¨¥é¡¼¤Î¾ì¹ç¤Ï +.B EOF +¤òÊÖ¤¹¡£ +.PP +.BR gets () +¤È +.BR fgets () +¤Ï¡¢À®¸ù¤¹¤ë¤È +.I s +¤òÊÖ¤·¡¢¥¨¥é¡¼¤ä 1 ʸ»ú¤âÆɤ߹þ¤ó¤Ç¤¤¤Ê¤¤¤Î¤Ë¥Õ¥¡¥¤¥ë¤Î½ª¤ï¤ê¤Ë¤Ê¤Ã¤¿ +¾ì¹ç¤Ë NULL ¤òÊÖ¤¹¡£ +.PP +.BR ungetc () +¤ÏÀ®¸ù¤¹¤ë¤È +.I c +¤òÊÖ¤·¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ï +.B EOF +¤òÊÖ¤¹¡£ +.SH ½àµò +C89, C99, POSIX.1-2001. +LSB ¤Ç¤Ï +.BR gets () +¤ÏÈó¿ä¾©¤Ç¤¢¤ë¡£ +POSIX.1-2008 ¤Ç¤Ï +.BR gets () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +.BR gets () +¤ÏÀäÂФ˻ÈÍѤ·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +Á°¤â¤Ã¤Æ¥Ç¡¼¥¿¤òÃΤ뤳¤È¤Ê¤·¤Ë +.BR gets () +¤¬²¿Ê¸»úÆɤफ¤òÃΤ뤳¤È¤Ï¤Ç¤­¤º¡¢ +.BR gets () +¤¬¥Ð¥Ã¥Õ¥¡¤Î½ª¤ï¤ê¤ò±Û¤¨¤Æ½ñ¤­¹þ¤ß³¤±¤ë¤¿¤á¡¢ +.BR gets () +¤ò»È¤¦¤Î¤Ï¶Ë¤á¤Æ´í¸±¤Ç¤¢¤ë¡£ +¤³¤ì¤òÍøÍѤ·¤Æ¥³¥ó¥Ô¥å¡¼¥¿¤Î¥»¥­¥å¥ê¥Æ¥£¤¬Çˤé¤ì¤Æ¤­¤¿¡£ +Âå¤ï¤ê¤Ë +.BR fgets () +¤ò»È¤¦¤³¤È¡£ +.PP +ÆþÎÏ¥¹¥È¥ê¡¼¥à¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ¡¢ +.I stdio +¥é¥¤¥Ö¥é¥ê¤ÎÆþÎÏ´Ø¿ô¤È¡¢Äã¥ì¥Ù¥ë¸Æ¤Ó½Ð¤·¤Î +.BR read (2) +¤òº®¤¼¤Æ¸Æ¤Ó½Ð¤¹»ö¤Ï´«¤á¤é¤ì¤Ê¤¤¡£ +·ë²Ì¤¬¤É¤¦¤Ê¤ë¤«¤Ïʬ¤«¤é¤º¡¢¤ª¤½¤é¤¯¤¢¤Ê¤¿¤Î +˾¤ó¤Ç¤¤¤ë·ë²Ì¤Ë¤Ï¤Ê¤é¤Ê¤¤¤À¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR read (2), +.BR write (2), +.BR ferror (3), +.BR fgetwc (3), +.BR fgetws (3), +.BR fopen (3), +.BR fread (3), +.BR fseek (3), +.BR getline (3), +.BR getwchar (3), +.BR puts (3), +.BR scanf (3), +.BR ungetwc (3), +.BR unlocked_stdio (3) diff --git a/release/man3/getservent.3 b/release/man3/getservent.3 new file mode 100644 index 00000000..20d15de1 --- /dev/null +++ b/release/man3/getservent.3 @@ -0,0 +1,137 @@ +.\" 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 Sat Jul 24 19:19:11 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Wed Oct 18 20:23:54 1995 by Martin Schulze +.\" Modified Mon Apr 22 01:50:54 1996 by Martin Schulze +.\" 2001-07-25 added a clause about NULL proto (Martin Michlmayr or David N. Welton) +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Fri Mar 15 1998 by NAKANO Takeo +.\" Updated Thu 16 Aug 2001 by NAKANO Takeo +.\" Updated 2008-09-19, Akihiro MOTOKI +.\" +.TH GETSERVENT 3 2008-08-19 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getservent, getservbyname, getservbyport, setservent, endservent \- ¥µ¡¼¥Ó¥¹¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.B struct servent *getservent(void); +.sp +.BI "struct servent *getservbyname(const char *" name ", const char *" proto ); +.sp +.BI "struct servent *getservbyport(int " port ", const char *" proto ); +.sp +.BI "void setservent(int " stayopen ); +.sp +.B void endservent(void); +.fi +.SH ÀâÌÀ +.BR getservent () +´Ø¿ô¤Ï¥µ¡¼¥Ó¥¹¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.RB ( services (5) +»²¾È) ¤«¤é¼¡¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤ß¡¢ +¤½¤Î¥¨¥ó¥È¥ê¤ò \fIservent\fP ¹½Â¤ÂΤÎÍ×ÁÇÊ̤Υե£¡¼¥ë¥É¤Ë³ÊǼ¤·¡¢ +¤½¤Î¹½Â¤ÂΤòÊÖ¤¹¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.BR getservbyname () +´Ø¿ô¤Ï¡¢ +¥×¥í¥È¥³¥ë \fIproto\fP ¤òÍѤ¤¤ë¥µ¡¼¥Ó¥¹¤Î̾Á° \fIname\fP +¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢ +¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fIservent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£ +\fIproto\fP ¤¬ NULL ¤Î¾ì¹ç¤Ï¡¢Ç¤°Õ¤Î¥×¥í¥È¥³¥ë¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.BR getservbyport () +´Ø¿ô¤Ï¡¢ +¥×¥í¥È¥³¥ë \fIproto\fP ¤òÍѤ¤¤ë¥µ¡¼¥Ó¥¹¤Î¥Ý¡¼¥ÈÈÖ¹æ \fIport\fP +¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢ +¤½¤Î¥¨¥ó¥È¥ê¤ÎÆâÍƤò¼ý¤á¤¿ \fIservent\fP ¹½Â¤ÂΤòÊÖ¤¹ +(¥Ý¡¼¥ÈÈÖ¹æ \fIport\fP ¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥Ð¥¤¥È¥ª¡¼¥À¤Ç»ØÄꤹ¤ë)¡£ +\fIproto\fP ¤¬ NULL ¤Î¾ì¹ç¤ÏǤ°Õ¤Î¥×¥í¥È¥³¥ë¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +.PP +.BR setservent () +´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥ª¡¼¥×¥ó¤·¡¢ +¼¡¤ÎÆɤ߹þ¤ß¥¨¥ó¥È¥ê¤òÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤹ¤ë¡£ +\fIstayopen\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢ +°ì¤Ä°ì¤Ä¤Î +.BR getserv* () +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¡£ +.PP +.BR endservent () +´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +\fIservent\fP ¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +struct servent { + char *s_name; /* official service name */ + char **s_aliases; /* alias list */ + int s_port; /* port number */ + char *s_proto; /* protocol to use */ +} +.fi +.in +.PP +\fIservent\fP ¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Ï°Ê²¼¤ÎÄ̤ꡣ +.RS +.TP 12 +.I s_name +¥µ¡¼¥Ó¥¹¤ÎÀµ¼°Ì¾ (official name)¡£ +.TP +.I s_aliases +¥µ¡¼¥Ó¥¹¤ÎÊÌ̾¤Î¥ê¥¹¥È¡£ +¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.TP +.I s_port +¥µ¡¼¥Ó¥¹¤Î¥Ý¡¼¥ÈÈֹ档¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Ç»ØÄꤵ¤ì¤ë¡£ +.TP +.I s_proto +¤³¤Î¥µ¡¼¥Ó¥¹¤È¶¦¤ËÍѤ¤¤ë¥×¥í¥È¥³¥ë¤Î̾Á°¡£ +.RE +.SH ÊÖ¤êÃÍ +.BR getservent (), +.BR getservbyname (), +.BR getservbyport () +´Ø¿ô¤Ï¡¢ +ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ \fIservent\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/services +¥µ¡¼¥Ó¥¹¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.SH ½àµò +4.3BSD, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR getnetent (3), +.BR getprotoent (3), +.BR getservent_r (3), +.BR services (5) diff --git a/release/man3/getspnam.3 b/release/man3/getspnam.3 new file mode 100644 index 00000000..2138dab7 --- /dev/null +++ b/release/man3/getspnam.3 @@ -0,0 +1,248 @@ +.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) and +.\" Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated 2004-08-20, Yuichi SATO +.\" +.TH GETSPNAM 3 2010-02-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getspnam, getspnam_r, getspent, getspent_r, setspent, endspent,fgetspent, fgetspent_r, sgetspent, sgetspent_r, putspent, lckpwdf, ulckpwdf \- shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +/* °ìÈÌŪ¤Ê shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë API */ +.br +.B #include +.sp +.BI "struct spwd *getspnam(const char *" name ); +.sp +.B struct spwd *getspent(void); +.sp +.B void setspent(void); +.sp +.B void endspent(void); +.sp +.BI "struct spwd *fgetspent(FILE *" fp ); +.sp +.BI "struct spwd *sgetspent(const char *" s ); +.sp +.BI "int putspent(struct spwd *" p ", FILE *" fp ); +.sp +.B int lckpwdf(void); +.sp +.B int ulckpwdf(void); +.sp +/* GNU ÈǤˤª¤±¤ë³ÈÄ¥ */ +.br +.B #include +.sp +.BI "int getspent_r(struct spwd *" spbuf , +.br +.BI " char *" buf ", size_t " buflen ", struct spwd **" spbufp ); +.sp +.BI "int getspnam_r(const char *" name ", struct spwd *" spbuf , +.br +.BI " char *" buf ", size_t " buflen ", struct spwd **" spbufp ); +.sp +.BI "int fgetspent_r(FILE *" fp ", struct spwd *" spbuf , +.br +.BI " char *" buf ", size_t " buflen ", struct spwd **" spbufp ); +.sp +.BI "int sgetspent_r(const char *" s ", struct spwd *" spbuf , +.br +.BI " char *" buf ", size_t " buflen ", struct spwd **" spbufp ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR getspent_r (), +.BR getspnam_r (), +.BR fgetspent_r (), +.BR sgetspent_r (): +_BSD_SOURCE || _SVID_SOURCE +.ad b +.SH ÀâÌÀ +ÀΤϰŹ沽¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤ò¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Ë +¸«¤¨¤ë¤è¤¦¤Ë¸ø³«¤·¤Æ¤ª¤¤¤Æ¤â°ÂÁ´¤À¤È¹Í¤¨¤é¤ì¤Æ¤¤¤¿¡£ +Julianne Frances Haugh ¤Ï shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥¹¥¤¡¼¥È¤ò¼ÂÁõ¤·¤¿¡£ +¤³¤ì¤Ï°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤ò¡¢root ¤Î¤ß¤¬Æɤळ¤È¤¬¤Ç¤­¤ë +shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹ (Î㤨¤Ð¡¢ +¥í¡¼¥«¥ë¤Î shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë +.IR /etc/shadow , +NIS, LDAP) +¤ËÊÝ»ý¤¹¤ë¡£ +.LP +°Ê²¼¤ÇÀâÌÀ¤¹¤ë´Ø¿ô¤Ï¡¢ÅÁÅýŪ¤Ê¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë +´Ø¿ô¤Ë»÷¤Æ¤¤¤ë (Î㤨¤Ð +.BR getpwnam (3) +¤ä +.BR getpwent (3) +¤ò»²¾È)¡£ +.\" FIXME °Ê²¼¤ò°ì»þŪ¤Ë¥³¥á¥ó¥È¥¢¥¦¥È¤·¤¿¡£ +.\" PAM ¤È nsswitch.conf ¤Î´Ø·¸¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥æ¡¼¥¶¡¢¥°¥ë¡¼¥×¡¢shadow +.\" ¥Ñ¥¹¥ï¡¼¥É¤Î´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Î¥Ú¡¼¥¸¤«¤é»²¾È¤µ¤ì¤ë¤É¤³¤«¤Ë¤Ï¤Ã¤­¤ê¤È +.\" µ­ºÜ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +.\" (Jul 2005, mtk) +.\" +.\" ¤³¤Î shadow ¥Ñ¥¹¥ï¡¼¥É¤ÎÀßÄê¤Ï +.\" PAM (pluggable authentication modules) ¤Ç¼è¤êÂؤ¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\" ¸½ºß¤Î¤È¤³¤í¡¢¤É¤Î¾ðÊ󸻤ò»ÈÍѤ¹¤ë¤«¤Ï +.\" .I /etc/nsswitch.conf +.\" ¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤ë¡£ +.LP +.BR getspnam () +´Ø¿ô¤Ï¡¢¥æ¡¼¥¶Ì¾ +.I name +¤Ë¥Þ¥Ã¥Á¤¹¤ë shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¨¥ó¥È¥ê¤ò +Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.LP +.BR getspent () +´Ø¿ô¤Ï shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤ª¤±¤ë¼¡¤Î¥¨¥ó¥È¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +ÆþÎÏ¥¹¥È¥ê¡¼¥à¤Ë¤ª¤±¤ë°ÌÃ֤ϡ¢ +.BR setspent () +¤Ç½é´ü²½¤µ¤ì¤ë¡£ +Æɤ߹þ¤ß¤¬½ª¤ï¤Ã¤¿¸å¤Ë¡¢ +.BR endspent () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¥ê¥½¡¼¥¹¤ò²òÊü¤Ç¤­¤ë¡£ +.\" ºÇ½é¤Ë getspent() ¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë¡¢ +.\" setspent() ¤ò¸Æ¤Ó½Ð¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.\" glibc ¤Ç¤Ï¤½¤ÎɬÍפ¬¤Ê¤¤¡£ +.LP +.BR fgetspent () +´Ø¿ô¤Ï +.BR getspent () +¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ +.BR setspent () +¤Ç°ÅÌۤΤ¦¤Á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤ë¥¹¥È¥ê¡¼¥à¤Ç¤Ï¤Ê¤¯¡¢Í¿¤¨¤é¤ì¤¿¥¹¥È¥ê¡¼¥à¤ò»È¤¦¡£ +.LP +.BR sgetspent () +´Ø¿ô¤ÏÍ¿¤¨¤é¤ì¤¿Ê¸»úÎó +.I s +¤ò²òÀϤ· struct +.I spwd +¤Ë³ÊǼ¤¹¤ë¡£ +.LP +.BR putspent () +´Ø¿ô¤ÏÍ¿¤¨¤é¤ì¤¿ struct +.I spwd +.I *p +¤ÎÆâÍƤò shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë·Á¼°¤Î¥Æ¥­¥¹¥È¹Ô¤Ç¥¹¥È¥ê¡¼¥à +.I fp +¤Ë½ñ¤­½Ð¤¹¡£ +¶õʸ»úÎó¤È¤·¤Æ¡¢ +Ãͤ¬ NULL ¤Îʸ»úÎ󥨥ó¥È¥ê¤ÈÃͤ¬ \-1 ¤Î¿ôÃÍ¥¨¥ó¥È¥ê¤¬ +½ñ¤­½Ð¤µ¤ì¤ë¡£ +.LP +.BR lckpwdf () +´Ø¿ô¤Ï¡¢ shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò +¿½ÅƱ»þ¥¢¥¯¥»¥¹¤«¤é¼é¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥í¥Ã¥¯¤Î³ÍÆÀ¤ò»î¤ß¡¢ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç (15 ÉðÊÆâ¤Ë¥í¥Ã¥¯¤¬¼èÆÀ¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç) ¤Ï \-1 ¤òÊÖ¤¹¡£ +.BR ulckpwdf () +´Ø¿ô¤Ï¥í¥Ã¥¯¤òºÆ¤Ó²òÊü¤¹¤ë¡£ +shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Ø¤ÎľÀÜ¥¢¥¯¥»¥¹¤«¤é +Êݸ¤ë¼êÃʤ¬¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.BR lckpwdf () +¤ò»È¤¦¥×¥í¥°¥é¥à¤À¤±¤¬¥í¥Ã¥¯¤òÄÌÃΤǤ­¤ë¡£ +.LP +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥ª¥ê¥¸¥Ê¥ë¤Î shadow API ¤ò¹½À®¤·¤Æ¤¤¤¿´Ø¿ô¤Ç¤¢¤ê¡¢ +¤¤¤í¤¤¤í¤Ê¥·¥¹¥Æ¥à¤Ç¹­¤¯ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\" libc5 ¤Ç¤âÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\" SUN ¤Ë¤Ï sgetspent() ¤¬¤Ê¤¤¡£ +.SS ¥ê¥¨¥ó¥È¥é¥ó¥ÈÈÇ +¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤÈƱ¤¸¤è¤¦¤Ë¡¢ +glibc ¤Ë¤Ï shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤ¬¤¢¤ë¡£ +.BR getspnam_r () +´Ø¿ô¤Ï +.BR getspnam () +¤È»÷¤Æ¤¤¤ë¤¬¡¢¼èÆÀ¤·¤¿ shadow ¥Ñ¥¹¥ï¡¼¥É¹½Â¤ÂΤò +.I spbuf +¤¬»Ø¤¹Îΰè¤Ë³ÊǼ¤¹¤ë¡£ +shadow ¥Ñ¥¹¥ï¡¼¥É¹½Â¤ÂΤÏʸ»úÎ󷲤ؤΥݥ¤¥ó¥¿¤ò´Þ¤ß¡¢ +¤³¤ì¤é¤Îʸ»úÎ󷲤ϥµ¥¤¥º +.I buflen +¤Î¥Ð¥Ã¥Õ¥¡ +.I buf +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.I *spbufp +¤Ë¤Ï (À®¸ù¤·¤¿¾ì¹ç¤Ï) ·ë²Ì¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬³ÊǼ¤µ¤ì¡¢ +(¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Þ¤¿¤Ï¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ï) +NULL ¤¬³ÊǼ¤µ¤ì¤ë¡£ +.LP +´Ø¿ô +.BR getspent_r (), +.BR fgetspent_r (), +.BR sgetspent_r () +¤Ï¤½¤ì¤¾¤ì¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ê¤¤¥Ð¡¼¥¸¥ç¥ó¤ÈƱÍͤε¡Ç½¤ò»ý¤Ä¡£ +.LP +glibc ¤Ç¤Ê¤¤¥·¥¹¥Æ¥à¤Ë¤â¤³¤ì¤é¤ÈƱ¤¸Ì¾Á°¤Î´Ø¿ô¤¬¤¢¤ë¤¬¡¢ +¥×¥í¥È¥¿¥¤¥×¤¬°Û¤Ê¤ë¤³¤È¤â¿¤¤¡£ +.\" SUN ¤Ë¤Ï sgetspent_r() ¤¬¤Ê¤¤¡£ +.SS ¹½Â¤ÂÎ +shadow ¥Ñ¥¹¥ï¡¼¥É¹½Â¤ÂÎ¤Ï \fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct spwd { + char *sp_namp; /* ¥í¥°¥¤¥ó̾ */ + char *sp_pwdp; /* °Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É */ + long sp_lstchg; /* ºÇ½ª¹¹¿·Æü + (1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤ÎÆü¿ô) */ + long sp_min; /* Êѹ¹¤¬½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤ë¤Þ¤Ç¤ÎºÇûÆü¿ô */ + long sp_max; /* Êѹ¹¤ò¤·¤Ê¤¯¤Æ¤â¤è¤¤ºÇĹÆü¿ô */ + long sp_warn; /* ¥Ñ¥¹¥ï¡¼¥É¤¬´ü¸ÂÀÚ¤ì¤Ë¤Ê¤ëÁ°¤Ë + ¥æ¡¼¥¶¤ËÊѹ¹¤Î·Ù¹ð¤ò½Ð¤¹Æü¿ô */ + long sp_inact; /* ¥Ñ¥¹¥ï¡¼¥É¤¬´ü¸ÂÀÚ¤ì¤Ë¤Ê¤Ã¤Æ¤«¤é + ¥¢¥«¥¦¥ó¥È¤¬Ìµ¸ú¤Ë¤Ê¤ë¤Þ¤Ç¤ÎÆü¿ô */ + long sp_expire; /* ¥¢¥«¥¦¥ó¥È¤¬Ìµ¸ú¤Ë¤Ê¤ëÆüÉÕ + (1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤ÎÆü¿ô) */ + unsigned long sp_flag; /* ͽÌó¥Õ¥£¡¼¥ë¥É */ +}; +.fi +.in +.SH ÊÖ¤êÃÍ +¥Ý¥¤¥ó¥¿¤òÊÖ¤¹´Ø¿ô¤Ï¡¢¤³¤ì°Ê¾å¥¨¥ó¥È¥ê¤¬¤Ê¤¤¾ì¹ç¤ä +½èÍýÃæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç NULL ¤òÊÖ¤¹¡£ +\fIint\fP ¤òÊÖ¤êÃͤȤ·¤Æ»ý¤Ä´Ø¿ô¤Ï¡¢ +À®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤òÊÖ¤¹¡£ +.LP +¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤʤ¤´Ø¿ô¤Ç¤Ï¡¢ÊÖ¤êÃͤ¬ÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢ +°ú¤­Â³¤¤¤Æ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤Ë¾å½ñ¤­¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.LP +¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤδؿô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ë 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢¥¨¥é¡¼Èֹ椬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B ERANGE +Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ¤¹¤®¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/shadow +¥í¡¼¥«¥ë¤Î shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.TP +.I /etc/.pwd.lock +¥í¥Ã¥¯¥Õ¥¡¥¤¥ë +.LP +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ÏÄê¿ô +.B _PATH_SHADOW +¤òÄêµÁ¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï shadow ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤Ç¤¢¤ë¡£ +.SH ½àµò +shadow ¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤È´ØÏ¢ API ¤Ï POSIX.1-2001 +¤Ë¤Ïµ­ºÜ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£¤·¤«¤·¤Ê¤¬¤é¡¢Â¿¤¯¤Î¾¤Î¥·¥¹¥Æ¥à¤Ç¤â +ƱÍͤΠAPI ¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getgrnam (3), +.BR getpwnam (3), +.BR getpwnam_r (3), +.BR shadow (5) diff --git a/release/man3/getsubopt.3 b/release/man3/getsubopt.3 new file mode 100644 index 00000000..457c3021 --- /dev/null +++ b/release/man3/getsubopt.3 @@ -0,0 +1,219 @@ +.\" Copyright (C) 2007 Michael Kerrisk +.\" and Copyright (C) 2007 Justin Pryzby +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" 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 2008-05-29 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getsubopt \- ʸ»úÎóÃæ¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó°ú¤­¿ô¤Î²ò¼á¤ò¹Ô¤¦ +.SH ½ñ¼° +.B #define _XOPEN_SOURCE 500 +.br +.B #include + +.BI "int getsubopt(char **"optionp ", char * const *" tokens \ +", char **" valuep ); +.SH ÀâÌÀ +.BR getsubopt () +¤Ï¡¢ +.I optionp +¤ÇÍ¿¤¨¤é¤ì¤¿¥«¥ó¥Þ¶èÀÚ¤ê¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¡¦¥ê¥¹¥È¤ò²òÀϤ¹¤ë¡£ +(¤³¤Î¤è¤¦¤Ê¥µ¥Ö¥ª¥×¥·¥ç¥ó¡¦¥ê¥¹¥È¤Ï +.BR getopt (3) +¤ò»È¤Ã¤Æ¥³¥Þ¥ó¥É¥é¥¤¥ó¤ò²ò¼á¤·¤¿¾ì¹ç¤Ë¸½¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ +Î㤨¤Ð¡¢ +.BR mount (8) +¤Î \fI-o\fP ¥ª¥×¥·¥ç¥ó¤ò¸«¤ë¤È¤è¤¤¡£) +¤½¤ì¤¾¤ì¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤Ë¤ÏÂбþ¤¹¤ëÃͤò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥µ¥Ö¥ª¥×¥·¥ç¥ó¤Î̾Á°¤ÈÂбþ¤¹¤ëÃͤÏÅù¹æ (\(aq=\(aq) ¤Ç¶èÀÚ¤é¤ì¤ë¡£ +Î㤨¤Ð¡¢°Ê²¼¤Î¤è¤¦¤Êʸ»úÎó¤ò +.I optionp +¤ËÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.sp +.in +4n +.B ro,name=xyz +.in + +.I tokens +°ú¤­¿ô¤Ï¥È¡¼¥¯¥ó¤Î¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¡¢¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.BR getsubopt () +¤Ï¤³¤Î¥È¡¼¥¯¥ó¤ò +.I optionp +Æâ¤Çõ¤¹¡£ +¤½¤ì¤¾¤ì¤Î¥È¡¼¥¯¥ó¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿ 1ʸ»ú°Ê¾å¤Îʸ»úÎó¤Ç¡¢ +¾¤Î¥È¡¼¥¯¥ó¤È¶èÊ̤Ǥ­¤ëɬÍפ¬¤¢¤ë¡£ +¤Þ¤¿¡¢Åù¹æ¤È¥«¥ó¥Þ¤ò´Þ¤ó¤Ç¤Ï¤Ê¤é¤Ê¤¤¡£ + +.BR getsubopt () +¤Ï¸Æ¤Ó½Ð¤µ¤ì¤ë¤¿¤Ó¤Ë¡¢ +.I optionp +Ãæ¤Î¼¡¤Î̤½èÍý¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤Î¾ðÊó¤òÊÖ¤¹¡£ +¥µ¥Ö¥ª¥×¥·¥ç¥óÆâ¤ËÅù¹æ¤¬¤¢¤Ã¤¿¾ì¹ç¡¢ºÇ½é¤ÎÅù¹æ¤Ï +¤½¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤Î̾Á°¤ÈÃͤζèÀÚ¤ê¤È²ò¼á¤µ¤ì¤ë¡£ +¶èÀڤ꤫¤é¼¡¤Î¥«¥ó¥Þ (ºÇ¸å¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤Î¾ì¹ç¡¢Ê¸»úÎó¤ÎËöÈø) +¤Þ¤Ç¤¬¡¢¥µ¥Ö¥ª¥×¥·¥ç¥ó¤ÎÃͤȤʤ롣 +¥µ¥Ö¥ª¥×¥·¥ç¥ó¤Î̾Á°¤¬ +.I tokens +Æâ¤Î̾Á°¤È°ìÃפ·¡¢Ãͤòɽ¤¹Ê¸»úÎ󤬸«¤Ä¤«¤Ã¤¿¾ì¹ç¡¢ +.BR getsubopt () +¤Ï +.I *valuep +¤òÃͤòɽ¤¹Ê¸»úÎó¤Î¥¢¥É¥ì¥¹¤ËÀßÄꤹ¤ë¡£ +.I optionp +Ãæ¤ÎºÇ½é¤Î¥«¥ó¥Þ¤Ï¥Ì¥ë¥Ð¥¤¥È¤Ç¾å½ñ¤­¤µ¤ì¤ë¡£¤½¤Î¤¿¤á¡¢ +.I *valuep +¤Ï¤½¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤Î¡ÖÃͤÎʸ»úÎó¡×¤½¤Î¤â¤Î¤È¤Ê¤ë¡£ + +¥µ¥Ö¥ª¥×¥·¥ç¥ó¤¬Ç§¼±¤µ¤ì¤¿¤¬¡¢Ãͤòɽ¤¹Ê¸»úÎ󤬸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.RI * valuep +¤Ï NULL ¤ËÀßÄꤵ¤ì¤ë¡£ + +.BR getsubopt () +¤¬ÊÖ¤ë»þ¡¢ +.I optionp +¤Ï¼¡¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤ò»Ø¤·¤Æ¤¤¤ë¡£ +¤Á¤ç¤¦¤ÉºÇ¸å¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤¬½èÍý¤µ¤ì¤¿¾ì¹ç¤Ï¡¢ +ʸ»úÎóËöÈø¤Î¥Ì¥ëʸ»ú¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +.I optionp +Æâ¤Ç¥µ¥Ö¥ª¥×¥·¥ç¥ó¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¡¢ +.BR getsubopt () +¤ÏºÇ½é¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë +.I tokens +¤ÎÍ×ÁǤÎź»ú¤òÊÖ¤¹¡£ +¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢\-1 ¤òÊÖ¤¹¡£¤³¤Î¾ì¹ç¡¢ +.I *valuep +¤Ï +.IB name [= value ] +¤Îʸ»úÎóÁ´ÂΤȤʤ롣 + +.I *optionp +¤ÏÊѹ¹¤µ¤ì¤ë¤Î¤Ç¡¢ +.BR getsubopt () +¤ò¸Æ¤Ó½Ð¤¹Á°¤ÎºÇ½é¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤Ï +.BR getsubopt () +¤ò¸Æ¤Ó½Ð¤·¸å¤Î¥µ¥Ö¥ª¥×¥·¥ç¥ó¤Èɬ¤º¤·¤âƱ¤¸¤È¤Ï¸Â¤é¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ + +.BR getsubopt () +¤Ï¡¢Ê¸»úÎó +.RI * optionp +Ãæ¤Ë¸«¤Ä¤±¤¿¥«¥ó¥Þ¤ò¾å½ñ¤­¤¹¤ë¤Î¤Ç¡¢Ê¸»úÎó +.I *optionp +¤Ï½ñ¤­¹þ¤ß²Äǽ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +ʸ»úÎóÄê¿ô¤Ë¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï "\-o" ¥ª¥×¥·¥ç¥ó¤Ë³¤¤¤Æ¥µ¥Ö¥ª¥×¥·¥ç¥ó¤¬¤¢¤ë¤³¤È¤ò +´üÂÔ¤·¤Æ¤¤¤ë¡£ + +.nf +#define _XOPEN_SOURCE 500 +#include +#include +#include + +int main(int argc, char **argv) +{ + enum { + RO_OPT = 0, + RW_OPT, + NAME_OPT + }; + char *const token[] = { + [RO_OPT] = "ro", + [RW_OPT] = "rw", + [NAME_OPT] = "name", + NULL + }; + char *subopts; + char *value; + int opt; + + int readonly = 0; + int readwrite = 0; + char *name = NULL; + int errfnd = 0; + + while ((opt = getopt(argc, argv, "o:")) != \-1) { + switch (opt) { + case \(aqo\(aq: + subopts = optarg; + while (*subopts != \(aq\\0\(aq && !errfnd) { + + switch (getsubopt(&subopts, token, &value)) { + case RO_OPT: + readonly = 1; + break; + + case RW_OPT: + readwrite = 1; + break; + + case NAME_OPT: + if (value == NULL) { + fprintf(stderr, "Missing value for " + "suboption \(aq%s\(aq\\n", token[NAME_OPT]); + errfnd = 1; + continue; + } + + name = value; + break; + + default: + fprintf(stderr, "No match found " + "for token: /%s/\\n", 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]); + errfnd = 1; + } + break; + + default: + errfnd = 1; + } + } + + if (errfnd || argc == 1) { + fprintf(stderr, "\\nUsage: %s \-o \\n", argv[0]); + fprintf(stderr, "suboptions are \(aqro\(aq, \(aqrw\(aq, " + "and \(aqname=\(aq\\n"); + exit(EXIT_FAILURE); + } + + /* Remainder of program... */ + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR getopt (3), +.BR feature_test_macros (7) diff --git a/release/man3/getttyent.3 b/release/man3/getttyent.3 new file mode 100644 index 00000000..9e9f4c2f --- /dev/null +++ b/release/man3/getttyent.3 @@ -0,0 +1,84 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Fri Aug 20 03:27:22 JST 2004 +.\" by Yuichi SATO +.\" +.TH GETTTYENT 3 2002-07-18 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getttyent, getttynam, setttyent, endttyent \- ttys ¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B "#include " +.sp +.B "struct ttyent *getttyent(void);" +.sp +.BI "struct ttyent *getttynam(const char *" name ); +.sp +.B "int setttyent(void);" +.sp +.B "int endttyent(void);" +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë +.B _PATH_TTYS +(Î㤨¤Ð +.IR /etc/ttys ) +¤Ø¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ + +´Ø¿ô +.BR setttyent () +¤Ï¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +¤Þ¤¿´û¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢´¬¤­Ì᤹¡£ + +´Ø¿ô +.BR endttyent () +¤Ï¥Õ¥¡¥¤¥ë¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ + +´Ø¿ô +.BR getttynam () +¤Ï»ØÄꤵ¤ì¤¿Ã¼Ëö̾¤Ë¤Ä¤¤¤Æ¥Õ¥¡¥¤¥ë¤ò¸¡º÷¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï (°Ê²¼¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë) +.I ttyent +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ + +´Ø¿ô +.BR getttyent () +¤Ï (¤â¤·É¬ÍפǤ¢¤ì¤Ð) ¥Õ¥¡¥¤¥ë +.B _PATH_TTYS +¤ò¥ª¡¼¥×¥ó¤·¡¢ºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +¥Õ¥¡¥¤¥ë¤¬´û¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +.I ttyent +¹½Â¤ÂΤϰʲ¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.in +4n +.nf + +struct ttyent { + char *ty_name; /* üËö¥Ç¥Ð¥¤¥¹Ì¾ */ + char *ty_getty; /* ¼Â¹Ô¤¹¤ë¥³¥Þ¥ó¥É¡£Ä̾ï¤Ï getty */ + char *ty_type; /* termcap ¤Î¤¿¤á¤ÎüËö¥¿¥¤¥× */ + int ty_status; /* ¾õÂ֥ե饰 */ + char *ty_window; /* ¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¤òµ¯Æ°¤¹¤ë¥³¥Þ¥ó¥É */ + char *ty_comment; /* ¥³¥á¥ó¥È¥Õ¥£¡¼¥ë¥É */ +}; +.fi +.in + +.I ty_status +¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«Ãͤò¤È¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.nf + +#define TTY_ON 0x01 /* ¥í¥°¥¤¥ó¤òÍ­¸ú¤Ë¤¹¤ë (ty_getty ¥×¥í¥°¥é¥à¤ò³«»Ï¤¹¤ë) */ +#define TTY_SECURE 0x02 /* ¥æ¡¼¥¶ ID 0 ¤Ç¤Î¥í¥°¥¤¥ó¤òµö²Ä¤¹¤ë */ +.fi +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¤Ë¸ºß¤·¡¢¤ª¤½¤é¤¯Â¾¤Î¥·¥¹¥Æ¥à¤Ë¤â¤¢¤ë¤À¤í¤¦¡£ +.SH Ãí°Õ +Linux ¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë +.I /etc/ttys +¤È¾å¤ÇÀâÌÀ¤·¤¿´Ø¿ô¤Ï»È¤ï¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ttyname (3), +.BR ttyslot (3) diff --git a/release/man3/getumask.3 b/release/man3/getumask.3 new file mode 100644 index 00000000..3e1bc044 --- /dev/null +++ b/release/man3/getumask.3 @@ -0,0 +1,66 @@ +.\" Copyright (C) 2002 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. +.\" +.\" 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 2009-01-20 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getumask \- ¥Õ¥¡¥¤¥ëºîÀ®¥Þ¥¹¥¯¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B "#include " +.br +.B "#include " +.sp +.B "mode_t getumask(void);" +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤Ï¸½ºß¤Î¥Õ¥¡¥¤¥ëºîÀ®¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +´ðËÜŪ¤Ë¤Ï°Ê²¼¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.in +4n +.nf + +mode_t getumask(void) +{ + mode_t mask = umask( 0 ); + umask(mask); + return mask; +} + +.fi +.in +¥É¥­¥å¥á¥ó¥È¤Ë¤è¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï +¥¹¥ì¥Ã¥É¡¦¥»¡¼¥Õ¤Ç¤¢¤ë +.RB ( umask (2) +¥é¥¤¥Ö¥é¥ê¡¦¥³¡¼¥ë¤È¥í¥Ã¥¯¤ò¶¦Í­¤¹¤ë) +ÅÀ¤¬°Û¤Ê¤ë¡£ +.SH ½àµò +¥É¥­¥å¥á¥ó¥È¤Ë½ñ¤¤¤Æ¤¢¤ë¤À¤±¤Î GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¥Ð¡¼¥¸¥ç¥ó 2.9 »þÅÀ¤Î glibc ¤Ç¤Ï¡¢ +¤³¤Î´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Îµ­ºÜ¤Ï¤¢¤ë¤¬¡¢¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR umask (2) diff --git a/release/man3/getusershell.3 b/release/man3/getusershell.3 new file mode 100644 index 00000000..2859fd7f --- /dev/null +++ b/release/man3/getusershell.3 @@ -0,0 +1,85 @@ +.\" 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 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" +.SH ̾Á° +getusershell, setusershell, endusershell \- µö²Ä¤µ¤ì¤¿¥æ¡¼¥¶¥·¥§¥ë¤òÆÀ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.B char *getusershell(void); +.sp +.B void setusershell(void); +.sp +.B void endusershell(void); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR getusershell (), +.BR setusershell (), +.BR endusershell (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.ad b +.SH ÀâÌÀ +.BR getusershell () +´Ø¿ô¤Ï \fI/etc/shells\fP ¥Õ¥¡¥¤¥ë¤«¤é +(³«¤¯É¬Íפ¬¤¢¤ì¤Ð¤³¤Î¥Õ¥¡¥¤¥ë¤ò³«¤¤¤Æ¤«¤é) ¸½ºß¹Ô¤Î¼¡¤Î°ì¹Ô¤òÊÖ¤¹¡£ +ÊÖ¤µ¤ì¤¿¹Ô¤ÎÃæ¿È¤ÏÍ­¸ú¤Ê¥æ¡¼¥¶¥·¥§¥ë¤Î¤¦¤Á¤Î°ì¤Ä¤Î¥Ñ¥¹Ì¾¤Ç¤¢¤ë¡£ +(ÌõÃí. °ì¹Ô¤ËÉÕ¤­°ì¤Ä¤Î¥·¥§¥ë¤Î¥Ñ¥¹Ì¾¤¬½ñ¤«¤ì¤Æ¤¤¤ë¡£) +¤â¤· \fI/etc/shells\fP ¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢Æɤ߹þ¤ßÉԲĤξì¹ç¤Ë¤Ï¡¢ +.BR getusershell () +¤Ï \fI/bin/sh\fP ¤È \fI/bin/csh\fP +¤¬¥Õ¥¡¥¤¥ë¤Ëµ­¤µ¤ì¤Æ¤¤¤ë¤«¤Î¤è¤¦¤Ë¤Õ¤ë¤Þ¤¦¡£ +.PP +.BR setusershell () +´Ø¿ô¤Ï \fI/etc/shells\fP ¥Õ¥¡¥¤¥ë¤Î +¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤òÀèƬ¤ËÌ᤹¡£ +.PP +.BR endusershell () +´Ø¿ô¤Ï \fI/etc/shells\fP ¥Õ¥¡¥¤¥ë¤òÊĤ¸¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR getusershell () +´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¤Î½ªÃ¼¤Ç¤ÏNULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ¥Õ¥¡¥¤¥ë +.nf +/etc/shells +.fi +.SH ½àµò +4.3BSD. +.SH ´ØÏ¢¹àÌÜ +.BR shells (5) diff --git a/release/man3/getutent.3 b/release/man3/getutent.3 new file mode 100644 index 00000000..0579c2f5 --- /dev/null +++ b/release/man3/getutent.3 @@ -0,0 +1,289 @@ +.\" Copyright 1995 Mark D. Roth (roth@uiuc.edu) +.\" +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Solaris manpages +.\" +.\" Modified Thu Jul 25 14:43:46 MET DST 1996 by Michael Haardt +.\" +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-03-15, NAKANO Takeo +.\" Updated 2001-10-16, Kentaro Shirakata +.\" Updated 2002-01-03, Kentaro Shirakata +.\" Updated 2005-03-18, Akihiro MOTOKI +.\" Updated 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" +.TH GETUTENT 3 2008-06-29 "" "Linux Programmer's Manual" +.SH ̾Á° +getutent, getutid, getutline, pututline, setutent, endutent, utmpname \- +utmp ¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤Ë¥¢¥¯¥»¥¹¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.B struct utmp *getutent(void); +.br +.BI "struct utmp *getutid(struct utmp *" ut ); +.br +.BI "struct utmp *getutline(struct utmp *" ut ); +.sp +.BI "struct utmp *pututline(struct utmp *" ut ); +.sp +.B void setutent(void); +.br +.B void endutent(void); +.sp +.BI "int utmpname(const char *" file ); +.SH ÀâÌÀ +¿·¤·¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤Î "utmpx" ÈǤò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Ï POSIX.1 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£¡Ö½àµò¡×¤ÎÀá¤ò»²¾È¡£ + +.BR utmpname () +¤Ï¡¢Â¾¤Î utmp ´Ø¿ô¤¬¥¢¥¯¥»¥¹¤¹¤ë (utmp ¥Õ¥©¡¼¥Þ¥Ã¥È¤Î) +¥Õ¥¡¥¤¥ë¤Î̾Á°¤ò»ØÄꤹ¤ë¡£Â¾¤Î´Ø¿ô¤ò»È¤¦Á°¤Ë +.BR utmpname () +¤ò»È¤Ã¤Æ +¥Õ¥¡¥¤¥ë̾¤Î»ØÄê¤ò¹Ô¤ï¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ \fI\fP ¤Ç +ÄêµÁ¤µ¤ì¤Æ¤¤¤ë \fB_PATH_UTMP\fP ¤¬¥Õ¥¡¥¤¥ë̾¤È¤ß¤Ê¤µ¤ì¤ë¡£ +.PP +.BR setutent () +¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤ò utmp ¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë°ÜÆ°¤¹¤ë¡£ +°ìÈÌŪ¤Ë¤Ï¡¢Â¾¤Î´Ø¿ô¤ò»È¤¦Á°¤Ë¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤Æ¤ª¤¯¤ÈÎɤ¤¤À¤í¤¦¡£ +.PP +.BR endutent () +¤Ï utmp ¥Õ¥¡¥¤¥ë¤ò¥¯¥í¡¼¥º¤¹¤ë¡£¥æ¡¼¥¶¡¼¥³¡¼¥É¤Ç +¾¤Î´Ø¿ô¤ò»È¤Ã¤Æ¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤ò¹Ô¤Ã¤¿»þ¤Ï¡¢ºÇ¸å¤Ë¤³¤Î´Ø¿ô¤ò +¸Æ¤Ó½Ð¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.BR getutent () +¤Ï utmp ¥Õ¥¡¥¤¥ë¤Î¸½ºß¤Î¥Õ¥¡¥¤¥ë°ÌÃÖ¤«¤é°ì¹ÔÆɤ߹þ¤ß¡¢ +¹Ô¤Î³Æ¥Õ¥£¡¼¥ë¥É¤ÎÆâÍƤò¼ý¤á¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂΤÎÄêµÁ¤Ï +.BR utmp (5) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +.BR getutid () +¤Ï¡¢ utmp ¥Õ¥¡¥¤¥ëÃæ¤Î¸½ºß¤Î°ÌÃÖ¤«¤é½çÊý¸þ +(ËöÈø¤Ë¸þ¤«¤¦Êý¸þ) ¤Ø \fIut\fP ¤Ë´ð¤¯¸¡º÷¤ò¹Ô¤¦¡£ \fIut\fP\->ut_type ¤¬ +\fBRUN_LVL\fP, \fBBOOT_TIME\fP, \fBNEW_TIME\fP, \fBOLD_TIME\fP ¤Î +¤¤¤º¤ì¤«¤Ê¤é¡¢ +.BR getutid () +¤Ï \fBut_type\fP ¥Õ¥£¡¼¥ë¥É¤¬ +\fIut\fP\->ut_type ¤Ë°ìÃפ¹¤ëºÇ½é¤Î¥¨¥ó¥È¥ê¤òõ¤¹¡£ +\fIut\fP\->ut_type ¤¬ \fBINIT_PROCESS\fP, \fBLOGIN_PROCESS\fP, +\fBUSER_PROCESS\fP, \fBDEAD_PROCESS\fP ¤Î¤¤¤º¤ì¤«¤Ê¤é¡¢ +.BR getutid () +¤Ï +.I ut_id +¥Õ¥£¡¼¥ë¥É¤¬ \fIut\fP\->ut_id ¤Ë +°ìÃפ¹¤ëºÇ½é¤Î¥¨¥ó¥È¥ê¤òõ¤¹¡£ +.PP +.BR getutline () +¤Ï¡¢ utmp ¥Õ¥¡¥¤¥ë¤Î¸½ºß¤Î°ÌÃÖ¤«¤éËöÈø¤Ë¸þ¤«¤Ã¤Æ¸¡º÷¤ò¹Ô¤¦¡£ +.I ut_type +¤¬ \fBUSER_PROCESS\fP ¤Þ¤¿¤Ï \fBLOGIN_PROCESS\fP ¤Ç¡¢ +.I ut_line +¥Õ¥£¡¼¥ë¥É¤¬ \fIut\fP->ut_line ¤Ë¥Þ¥Ã¥Á¤¹¤ëºÇ½é¤Î¹Ô¤òÊÖ¤¹¡£ +.PP +.BR pututline () +¤Ï +.I utmp +¹½Â¤ÂÎ \fIut\fP ¤ÎÆâÍƤò utmp ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹¡£ +.BR pututline () +¤Ï +.BR getutid () +¤òÍѤ¤¤Æ¡¢¿·¤¿¤Ê¥¨¥ó¥È¥ê¤ò +ÁÞÆþ¤¹¤ë¤Î¤Ë¤Õ¤µ¤ï¤·¤¤¾ì½ê¤òõ¤¹¡£ \fIut\fP ¤òÁÞÆþ¤¹¤ë¤Õ¤µ¤ï¤·¤¤¾ì½ê¤¬ +¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢¿·¤¿¤Ê¥¨¥ó¥È¥ê¤ò¥Õ¥¡¥¤¥ë¤ÎËöÈø¤ËÄɲ乤롣 +.SH ÊÖ¤êÃÍ +.BR getutent (), +.BR getutid (), +.BR getutline () +¤Ï¡¢À®¸ù¤¹¤ë¤È \fIstruct utmp\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È NULL ¤òÊÖ¤¹ (¥ì¥³¡¼¥É¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤â¼ºÇԤȤʤë)¡£ +¤³¤Î \fIstruct utmp\fP ¤ÏÀÅŪ¤Êµ­²±Îΰè¤Ë³ÎÊݤµ¤ì¡¢¼¡¤Ë¤³¤ì¤é¤Î´Ø¿ô¤ò +¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + +.BR pututline () +¤ÏÀ®¸ù¤¹¤ë¤È +.I ut +¤òÊÖ¤¹¡£¼ºÇÔ¤¹¤ë¤È NULL ¤òÊÖ¤¹¡£ + +.BR utmpname () +¤Ï¡¢¿·¤·¤¤Ì¾Á°¤Î³ÊǼ¤ËÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤¹¤ë¤È \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +¥á¥â¥êÉÔ­¡£ +.TP +.B ESRCH +¥ì¥³¡¼¥É¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.PP +´Ø¿ô +.BR setutent (), +.BR pututent (), +.BR getut* () +¤Ï +.BR open (2) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ëÍýͳ¤Ç¤â¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +/var/run/utmp ¸½ºß¥í¥°¥¤¥óÃæ¤Î¥æ¡¼¥¶¡¼¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.br +/var/log/wtmp ²áµî¤Î¥æ¡¼¥¶¡¼¥í¥°¥¤¥ó¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.SH ½àµò +XPG2, SVr4. +.LP +XPG2 ¤È SVID 2 ¤Ç¤Ï¡¢ +.BR pututline () +´Ø¿ô¤ÏÃͤòÊÖ¤µ¤Ê¤¤¤È¤µ¤ì¤Æ¤ª¤ê¡¢ +(AIX, HP-UX, Linux libc5 ¤Ê¤É¤Î) ¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¤½¤¦¤Ê¤Ã¤Æ¤¤¤ë¡£ +HP-UX ¤Ç¤Ï¡¢¾å½Ò¤Î +.BR pututline () +¤ÈƱ¤¸¥×¥í¥È¥¿¥¤¥×¤ò»ý¤Ä +¿·¤·¤¤´Ø¿ô +.BR _pututline () +¤¬Æ³Æþ¤µ¤ì¤Æ¤¤¤ë +(¤³¤Î´Ø¿ô¤Ï Linux libc5 ¤Ë¤â¤¢¤ë)¡£ +.LP +¸½ºß¤Ç¤Ï¡¢Linux °Ê³°¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤ÏÁ´¤ÆÇѻߤµ¤ì¤Æ¤¤¤ë¡£ +SUSv1 ¤Î¸å¤Ë½Ð¤Æ¤­¤¿ POSIX.1-2001 ¤Ç¤Ï¡¢¤â¤Ï¤ä¤³¤ì¤é¤Î´Ø¿ô¤Ï¤Ê¤¯¡¢ +Âå¤ï¤ê¤Ë°Ê²¼¤Î¤â¤Î¤ò»È¤¦¡£ +.sp +.B #include +.sp +.B struct utmpx *getutxent(void); +.br +.B struct utmpx *getutxid(const struct utmpx *); +.br +.B struct utmpx *getutxline(const struct utmpx *); +.br +.B struct utmpx *pututxline(const struct utmpx *); +.br +.B void setutxent(void); +.br +.B void endutxent(void); +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¤Ë¤è¤êÄ󶡤µ¤ì¤Æ¤ª¤ê¡¢ +"x" ¤¬¤Ê¤¤´Ø¿ô¤ÈƱ¤¸½èÍý¤ò¹Ô¤¦¤¬¡¢ +.I "struct utmpx" +¤ò»ÈÍѤ¹¤ë¡£ +Linux ¤Ç¤Ï¡¢¤³¤Î¹½Â¤ÂΤÎÄêµÁ¤Ï +.I "struct utmp" +¤ÈƱ¤¸¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +´°Á´¤ò´ü¤¹¤¿¤á¤Ë¡¢glibc ¤Ç¤Ï +.BR utmpxname () +¤âÄ󶡤·¤Æ¤¤¤ë¡£¤³¤Î´Ø¿ô¤Ï POSIX.1 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +Linux °Ê³°¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +\fIutmpx\fP ¹½Â¤ÂÎ¤Ï \fIutmp\fP ¹½Â¤ÂΤξå°Ì½¸¹ç (superset) ¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¡¢ +ÄɲäΥե£¡¼¥ë¥É¤¬¤¢¤Ã¤¿¤ê¡¢´û¸¤Î¥Õ¥£¡¼¥ë¥É¤Î¥µ¥¤¥º¤¬Â礭¤¯¤Ê¤Ã¤Æ¤¤¤¿¤ê +¤¹¤ë¤â¤Î¤â¤¢¤ë¡£Ê£¿ô¤Î¥Õ¥¡¥¤¥ë¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¾ì¹ç¤â¤¢¤ê¡¢Â¿¤¯¤Î¾ì¹ç +.I /var/*/utmpx +¤È +.I /var/*/wtmpx +¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬»È¤ï¤ì¤ë¡£ +.LP +°ìÊý¡¢ Linux glibc ¤Ç¤ÏÊ£¿ô¤Î \fIutmpx\fP ¥Õ¥¡¥¤¥ë ¤Ï»È¤ï¤ì¤Æ¤¤¤Ê¤¤¡£ +\fIutmp\fP ¹½Â¤ÂΤ¬½½Ê¬¤ËÂ礭¤¤¤«¤é¤Ç¤¢¤ë¡£ +\fIgetutxent\fP() ¤Ê¤É¤Î´Ø¿ô¤Ï \fIgetutent\fP() ¤Ê¤É¤ÎÊÌ̾¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.SS glibc ¤Ç¤ÎÃí°Õ +¾åµ­¤Î´Ø¿ô·²¤Ï¥¹¥ì¥Ã¥É¡¦¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¡£ +glibc ¤Ë¤Ï¥ê¥¨¥ó¥È¥é¥ó¥ÈÈÇ (reentrant) ¤¬Äɲ䵤ì¤Æ¤¤¤ë¡£ +.sp +.nf +.BR "#define _GNU_SOURCE" " /* or _SVID_SOURCE or _BSD_SOURCE */" +.B #include +.sp +.BI "int getutent_r(struct utmp *" ubuf ", struct utmp **" ubufp ); +.sp +.BI "int getutid_r(struct utmp *" ut , +.BI " struct utmp *" ubuf ", struct utmp **" ubufp ); +.sp +.BI "int getutline_r(struct utmp *" ut , +.BI " struct utmp *" ubuf ", struct utmp **" ubufp ); +.fi +.sp +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢ËöÈø¤Î _r ¤ò¤È¤Ã¤¿Ì¾Á°¤Î´Ø¿ô¤È +ƱÍͤε¡Ç½¤ò»ý¤Ä¡£ +.I ubuf +¥Ñ¥é¥á¡¼¥¿¤Ï·ë²Ì¤ò³ÊǼ¤¹¤ë¾ì½ê¤ò»ØÄꤹ¤ë¡£ +À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢·ë²Ì¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò +.I *ubufp +¤Ë½ñ¤­¹þ¤à¡£¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£ +¾åµ­¤Î´Ø¿ô¤ËÂбþ¤¹¤ë utmpx ÈǤϸºß¤·¤Ê¤¤ +(POSIX.1 ¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤òµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤)¡£ +.SH Îã +°Ê²¼¤ÎÎã¤Ç¤Ï¡¢ utmp ¤Î¥ì¥³¡¼¥É¤ÎÄɲᦺï½ü¤ò¹Ô¤Ã¤Æ¤¤¤ë¡£¤³¤Î¥³¡¼¥É¤Ï¡¢ +µ¼»÷üËö (pseudo terminal) ¤«¤é¼Â¹Ô¤µ¤ì¤ë¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤ë¡£ +¼ÂºÝ¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï +.BR getpwuid (3) +¤È +.BR ttyname (3) +¤ÎÌá¤êÃͤò¸¡ºº¤¹¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.nf +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct utmp entry; + + system("echo before adding entry:;who"); + + entry.ut_type = USER_PROCESS; + entry.ut_pid = getpid(); + strcpy(entry.ut_line, ttyname(STDIN_FILENO) + strlen("/dev/")); + /* only correct for ptys named /dev/tty[pqr][0\-9a\-z] */ + strcpy(entry.ut_id, ttyname(STDIN_FILENO) + strlen("/dev/tty")); + time(&entry.ut_time); + strcpy(entry.ut_user, getpwuid(getuid())\->pw_name); + memset(entry.ut_host, 0, UT_HOSTSIZE); + entry.ut_addr = 0; + setutent(); + pututline(&entry); + + system("echo after adding entry:;who"); + + entry.ut_type = DEAD_PROCESS; + memset(entry.ut_line, 0, UT_LINESIZE); + entry.ut_time = 0; + memset(entry.ut_user, 0, UT_NAMESIZE); + setutent(); + pututline(&entry); + + system("echo after removing entry:;who"); + + endutent(); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR getutmp (3), +.BR utmp (5), +.BR feature_test_macros (7) diff --git a/release/man3/getw.3 b/release/man3/getw.3 new file mode 100644 index 00000000..bfac738f --- /dev/null +++ b/release/man3/getw.3 @@ -0,0 +1,72 @@ +.\" Copyright (c) 1995 by Jim Van Zandt +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Wed Dec 24 12:33:19 JST 1997 +.\" by HIROFUMI Nishizuka +.\" Updated Sun Jun 18 16:38:02 JST 2000 +.\" by Kentaro Shirakata +.\" +.\" 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. +.TH GETW 3 2007-12-20 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getw, putw \- ¥ï¡¼¥É(int)¤ÎÆþ½ÐÎÏ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getw(FILE *" stream ); + +.BI "int putw(int " w ", FILE *" stream ); +.fi +.SH ÀâÌÀ +.BR getw () +¤Ï \fIstream\fP ¤«¤é¥ï¡¼¥É (\fIint\fP·¿) ¤òÆɤ߹þ¤à¡£ +¤³¤Î´Ø¿ô¤Ï¡¢SVr4 ¤È¤Î¸ß´¹À­¤Î¤¿¤á¤ËÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î´Ø¿ô¤ÎÂå¤ï¤ê¤Ë +.BR fread (3) +¤ò»ÈÍѤ¹¤ë¤³¤È¤ò´«¤á¤ë¡£ +.P +.BR putw () +¤Ï \fIstream\fP ¤Ë¥ï¡¼¥É \fIw\fP (\fIint\fP·¿) ¤ò½ñ¤­¹þ¤à¡£ +¤³¤Î´Ø¿ô¤Ï SVr4 ¤È¤Î¸ß´¹À­¤Î¤¿¤á¤ËÄ󶡤µ¤ì¤Æ¤¤¤ë¤¬¡¢¤³¤Î´Ø¿ô¤ÎÂå¤ï¤ê¤Ë +.BR fwrite (3) +¤ò»ÈÍѤ¹¤ë¤³¤È¤ò´«¤á¤ë¡£ +.SH ÊÖ¤êÃÍ +Ä̾ +.BR getw () +¤ÏÆɤ߹þ¤ó¤À¥ï¡¼¥É¤òÊÖ¤·¡¢ +.BR putw () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï \fBEOF\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, SUSv2. POSIX.1-2001 ¤Ë¤Ï¸ºß¤·¤Ê¤¤¡£ +.SH ¥Ð¥° +¥¨¥é¡¼¤Î»þ¤ËÊÖ¤µ¤ì¤ëÃͤϡ¢Àµ¤·¤¤¥Ç¡¼¥¿¤È¤·¤ÆÊÖ¤µ¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +.BR ferror (3) +¤òÍѤ¤¤ë¤È¡¢¤³¤ÎÆó¤Ä¤Î¾ì¹ç¤ò¶èÊ̤¹¤ë¤³¤È¤¬½ÐÍè¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ferror (3), +.BR fread (3), +.BR fwrite (3), +.BR getc (3), +.BR putc (3) diff --git a/release/man3/getwchar.3 b/release/man3/getwchar.3 new file mode 100644 index 00000000..a35da27c --- /dev/null +++ b/release/man3/getwchar.3 @@ -0,0 +1,64 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:29 JST 2000 +.\" by HANATAKA Shinya +.\" Updated Sat Nov 3 JST 2001 by Kentaro Shirakata +.\" +.TH GETWCHAR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +getwchar \- ɸ½àÆþÎϤè¤ê¥ï¥¤¥Éʸ»ú¤òÆɤ߹þ¤à +.SH ½ñ¼° +.nf +.B #include +.sp +.B "wint_t getwchar(void);" +.fi +.SH ÀâÌÀ +.BR getwchar () +´Ø¿ô¤Ï +.BR getchar (3) +´Ø¿ô¤Î¥ï¥¤¥Éʸ»úÈǤǤ¢¤ë¡£ +\fBstdin\fP ¤«¤é¥ï¥¤¥Éʸ»ú¤òÆɤ߹þ¤ó¤Ç¤½¤ì¤òÊÖ¤¹¡£ +¥¹¥È¥ê¡¼¥à¤ÎºÇ¸å¤Ë㤷¤Æ¤¤¤ë¾ì¹ç¤ä \fIferror(stdin)\fP ¤¬¿¿¤Î¾ì¹ç¤Ë¤Ï +.B WEOF +¤òÊÖ¤¹¡£¥ï¥¤¥Éʸ»úÊÑ´¹¤Ç¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ë¤Ï \fIerrno\fP ¤Ë +\fBEILSEQ\fP ¤òÀßÄꤷ¤Æ +.B WEOF +¤òÊÖ¤¹¡£ +.PP +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR getwchar () +´Ø¿ô¤Ïɸ½àÆþÎϤμ¡¤Î¥ï¥¤¥Éʸ»ú¤òÊÖ¤¹¤«¡¢ +.B WEOF +¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR getwchar () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +.BR getwchar () +¤¬¼ÂºÝ¤Ë¤Ïɸ½àÆþÎϤ«¤é¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤òÆɤ߹þ¤ó¤Ç +¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤¹¤ë¤³¤È¤ò´üÂÔ¤·¤Æ¤âÎɤ¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fgetwc (3), +.BR unlocked_stdio (3) diff --git a/release/man3/glob.3 b/release/man3/glob.3 new file mode 100644 index 00000000..da166d5d --- /dev/null +++ b/release/man3/glob.3 @@ -0,0 +1,323 @@ +.\" 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 Wed Jul 28 11:12:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Mon May 13 23:08:50 1996 by Martin Schulze (joey@linux.de) +.\" Modified 11 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) +.\" Modified 990912 by aeb +.\" 2007-10-10 mtk +.\" Added description of GLOB_TILDE_NOMATCH +.\" Expanded the description of various flags +.\" Various wording fixes. +.\" +.\" Japanese Version Copyright (c) 1998 Ken Wakasa all rights reserved. +.\" Translated 1998-06-24, Ken Wakasa +.\" Updated 1999-01-04, Kentaro Shirakata +.\" Updated 2008-02-12, Akihiro MOTOKI , LDP v2.77 +.\" +.TH GLOB 3 2007-10-10 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +glob, globfree \- ¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹Ì¾¤ò¸«ÉÕ¤±¤ë¡£glob() ¤Ë¤è¤Ã +¤Æ³ÎÊݤµ¤ì¤¿¥á¥â¥êÎΰè¤ò²òÊü¤¹¤ë¡£ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int glob(const char *" pattern ", int " flags , +.br +.BI " int (*" errfunc ") (const char *" epath ", int " eerrno ), +.br +.BI " glob_t *" pglob ); +.br +.BI "void globfree(glob_t *" pglob ); +.fi +.SH ÀâÌÀ +.BR glob () +´Ø¿ô¤Ï¥·¥§¥ë¤¬ÍѤ¤¤Æ¤¤¤ë¥ë¡¼¥ë +.RB ( glob (7) +»²¾È) ¤Ë´ð¤Å¤¤¤Æ¥Ñ¥¿¡¼¥ó +.I pattern +¤Ë¥Þ¥Ã¥Á¤¹¤ë¤¹¤Ù¤Æ¤Î¥Ñ¥¹Ì¾¤ò¸¡º÷¤¹¤ë¡£ +¥Á¥ë¥À (~) ¤ÎŸ³«¤ä¥Ñ¥é¥á¡¼¥¿ÃÖ´¹¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£¤½¤ì¤é¤ò¹Ô¤¤¤¿¤¤¾ì¹ç¤Ï +.BR wordexp (3) +¤ò»È¤¦¤È¤è¤¤¡£ +.PP +.BR globfree () +´Ø¿ô¤ÏÁ°¤Ë¸Æ¤Ð¤ì¤¿ +.BR glob () +¤Ë¤è¤êưŪ¤Ë³ÎÊݤµ¤ì¤¿µ­²±Îΰè¤ò²òÊü¤¹¤ë¡£ +.PP +.BR glob () +¤Î·ë²Ì¤Ï +.I pglob +¤¬¥Ý¥¤¥ó¥È¤¹¤ë¹½Â¤ÂΤËÊÖ¤µ¤ì¤ë¡£ +.I pglob +¤Ï +.I glob_t +·¿¤Î¹½Â¤ÂΤǤ¢¤ë¡£ +.I glob_t +·¿¤Ï +.I +Æâ¤ÇÀë¸À¤µ¤ì¤Æ¤ª¤ê¡¢°Ê²¼¤ÎÍ×ÁǤò´Þ¤ó¤Ç¤¤¤ë¡£¤³¤ì¤é¤ÎÍ×ÁÇ¤Ï POSIX.2 ¤ÇÄêµÁ +¤µ¤ì¤Æ¤¤¤ë (¤µ¤é¤Ë¿¤¯¤ÎÍ×ÁǤ¬³ÈÄ¥¤È¤·¤ÆÆþ¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤)¡£ +.PP +.br +.in +4n +.nf +typedef struct { + size_t gl_pathc; /* º£¤Þ¤Ç¤Ë¥Þ¥Ã¥Á¤·¤¿¥Ñ¥¹¤Î¿ô */ + char **gl_pathv; /* ¥Þ¥Ã¥Á¤·¤¿¥Ñ¥¹Ì¾¤Î¥ê¥¹¥È */ + size_t gl_offs; /* \fIgl_pathv\fP Æâ¤Ë³ÎÊݤ¹¤ë¥¹¥í¥Ã¥È¿ô */ +} glob_t; +.fi +.in +.PP +·ë²Ì¤ÏưŪ¤Ë³ÎÊݤµ¤ì¤¿µ­²±Îΰè¤ËÆþ¤ì¤é¤ì¤ë¡£ +.PP +¥Ñ¥é¥á¡¼¥¿ +.I flags +¤Ë¤Ï°Ê²¼¤Î¼¨¤¹Äê¿ô¤Î¤¦¤Á¡¢»ØÄꤷ¤¿¤¤¤â¤Î¤ò¥Ó¥Ã¥È¤´¤È¤Î OR ¤ÇÍ¿¤¨¤ë +(°ì¤Ä¤â +»ØÄꤷ¤Ê¤¯¤Æ¤â¤è¤¤)¡£¤³¤ì¤Ë¤è¤Ã¤Æ +.BR glob () +¤ÎÆ°ºî¤òÊѹ¹¤Ç¤­¤ë¡£ +.TP +.B GLOB_ERR +(Î㤨¤Ð¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ËÆɤ߼è¤êµö²Ä°À­¤¬Ìµ¤¤¾ì¹ç¤Ê¤É¤Ç) +Æɤ߼è¤ê¥¨¥é¡¼¤¬È¯À¸¤·¤¿ºÝ¤Ë´Ø¿ô¤«¤éÌá¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥¨¥é¡¼¤Ë´Ø¤ï¤é¤º +Æɤ߼è¤ê²Äǽ¤Ê¥Ç¥£¥ì¥¯¥È¥ê¤òÁ´¤Æ¤Ë¤Ä¤¤¤ÆÆɤ߼è¤ê¤ò¼Â¹Ô¤·¤è¤¦¤È¤¹¤ë¡£ +.TP +.B GLOB_MARK +¥Ç¥£¥ì¥¯¥È¥ê¤ËÂбþ¤¹¤ë³Æ¡¹¤Î¥Ñ¥¹¤Ë¥¹¥é¥Ã¥·¥å¤òÉղ乤롣 +.TP +.B GLOB_NOSORT +ÊÖ¤µ¤ì¤ë¥Ñ¥¹Ì¾¤Î¥½¡¼¥È¤ò¹Ô¤ï¤Ê¤¤¡£ +¥½¡¼¥È¤ò¹Ô¤ï¤Ê¤¤Íýͳ¤Ï¡¢½èÍý»þ´Ö¤òÀáÌ󤹤뤿¤á¤À¤±¤Ç¤¢¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ÊÖ¤µ¤ì¤ë¥Ñ¥¹Ì¾¤Ï¥½¡¼¥È¤µ¤ì¤ë¡£ +.TP +.B GLOB_DOOFFS +.I pglob->pathv +¤Îʸ»úÎó¥ê¥¹¥È¤ÎÀèƬ¤Ë +.I pglob->gl_offs +¥¹¥í¥Ã¥Èʬ¤ÎÎΰè¤òͽÌ󤹤롣 +ͽÌ󤵤줿¥¹¥í¥Ã¥È¤Ë¤Ï NULL ¥Ý¥¤¥ó¥¿¤¬Æþ¤ë¡£ +.TP +.B GLOB_NOCHECK +¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¿¡¼¥ó¤¬¤Ê¤±¤ì¤Ð¡¢¸µ¤Î¥Ñ¥¿¡¼¥ó¤òÊÖ¤¹¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR glob () +¤Ï¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¿¡¼¥ó¤¬¤Ê¤±¤ì¤Ð +.B GLOB_NOMATCH +¤òÊÖ¤¹¡£ +.TP +.B GLOB_APPEND +¤³¤Î¸Æ¤Ó½Ð¤·¤Ç¤Î·ë²Ì¤òľÁ°¤Î +.BR glob () +¤Î¸Æ¤Ó½Ð¤·¤ÇÊÖ¤µ¤ì¤¿·ë²Ì¤Î¥Ù¥¯¥È¥ë¤ËÄɲ乤롣ºÇ½é¤Î +.BR glob () +¤Î¸Æ¤Ó½Ð¤·¤ÎºÝ¤Ë¤Ï¤³¤Î¥Õ¥é¥°¤òÀßÄꤷ¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.TP +.B GLOB_NOESCAPE +¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å (\(aq\\\(aq) ¤ò¥¨¥¹¥±¡¼¥×ÍÑʸ»ú¤È¤·¤Æ»ÈÍѤǤ­¤Ê¤¤¡£ +Ä̾ï¤Ï¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤ò»È¤Ã¤Æ¡¢¼¡¤Ë³¤¯Ê¸»ú¤ò¥¯¥©¡¼¥È¤¹¤ë¤³¤È¤Ç¡¢ +ÆÃÊ̤ʰÕÌ£¤ò»ý¤Ä¥á¥¿¥­¥ã¥é¥¯¥¿¤ò̵¸ú¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.I flags +¤Ë¤Ï°Ê²¼¤Ë¼¨¤¹¤â¤Î¤â»ØÄê¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Ï GNU ¤Ç³ÈÄ¥¤µ¤ì¤¿¤â¤Î¤Ç¡¢POSIX.2 ¤Ç¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B GLOB_PERIOD +ÀèƬ¤Î¥Ô¥ê¥ª¥É¤¬¥á¥¿¥­¥ã¥é¥¯¥¿¤Ë¥Þ¥Ã¥Á¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥á¥¿¥­¥ã¥é¥¯¥¿¤ÏÀèƬ¤Î¥Ô¥ê¥ª¥É¤Ë¤Ï¥Þ¥Ã¥Á¤Ç¤­¤Ê¤¤¡£ +.TP +.B GLOB_ALTDIRFUNC +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¢¥¯¥»¥¹¤¹¤ëºÝ¤Ë¡¢Ä̾ï¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ÎÂå¤ï¤ê¤Ë +ÂåÂشؿô +.IR pglob\->gl_closedir , +.IR pglob\->gl_readdir , +.IR pglob\->gl_opendir , +.IR pglob\->gl_lstat , +.I pglob\->gl_stat +¤¬ÍѤ¤¤é¤ì¤ë¡£ +.TP +.B GLOB_BRACE +\fB{a,b}\fR +¤È¤¤¤¦·Á¼°¤Î +.BR csh (1) +¥¹¥¿¥¤¥ë¤Î³ç¸Ìɽ¸½¤òŸ³«¤¹¤ë¡£ +³ç¸Ìɽ¸½¤ÏÆþ¤ì»Ò¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢Î㤨¤Ð¡¢"{foo/{,cat,dog},bar}" ¤È¤¤¤¦¥Ñ¥¿¡¼¥ó¤ò +»ØÄꤷ¤¿¾ì¹ç¤ËÆÀ¤é¤ì¤ë·ë²Ì¤Ï¡¢ +4¤Ä¤Îʸ»úÎó "foo/", "foo/cat", "foo/dog", "bar" ¤Î¤½¤ì¤¾¤ì¤Ë¤Ä¤¤¤Æ +.BR glob () +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ +.TP +.B GLOB_NOMAGIC +¥Ñ¥¿¡¼¥ó¤Ë¥á¥¿¥­¥ã¥é¥¯¥¿¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¥Þ¥Ã¥Á·ë²Ì¤È¤·¤Æ»ØÄꤵ¤ì¤¿¥Ñ¥¿¡¼¥ó¤À¤±¤òÊÖ¤¹¡£ +¥Ñ¥¿¡¼¥ó¤Ç»ØÄꤵ¤ì¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢ +¤½¤Î¥Ñ¥¿¡¼¥ó¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.B GLOB_TILDE +¥Á¥ë¥À¤ÎŸ³«¤ò¹Ô¤¦¡£ +¥Á¥ë¥À (\(aq~\(aq) ¤¬¥Ñ¥¿¡¼¥óÆâ¤ÎÍ£°ì¤Îʸ»ú¤Î¾ì¹ç¤«¡¢ÀèƬ¤Î¥Á¥ë¥À¤Îľ¸å¤Îʸ»ú¤¬ +¥¹¥é¥Ã¥·¥å (\(aq/\(aq) ¤Î¾ì¹ç¡¢¥Á¥ë¥À¤ò¸Æ¤Ó½Ð¤·¼Ô¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ÇÃÖ´¹¤¹¤ë¡£ +ÀèƬ¤Î¥Á¥ë¥À¤Ë¥æ¡¼¥¶Ì¾¤¬Â³¤¯¾ì¹ç (Î㤨¤Ð "~andrea/bin")¡¢ +¥Á¥ë¥À¤È¥æ¡¼¥¶Ì¾¤ò¤½¤Î¥æ¡¼¥¶¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ÇÃÖ´¹¤¹¤ë¡£ +¥æ¡¼¥¶Ì¾¤¬Ìµ¸ú¤Ê¾ì¹ç¤ä¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤¬·èÄê¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¡¢ +ÃÖ´¹¤Ï¼Â¹Ô¤µ¤ì¤Ê¤¤¡£ +.TP +.B GLOB_TILDE_CHECK +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È +.B GLOB_TILDE +¤ÈƱÍͤο¶Éñ¤¤¤ò¤¹¤ë¡£ +.B GLOB_TILDE +¤È¤Î°ã¤¤¤Ï¡¢¥æ¡¼¥¶Ì¾¤¬Ìµ¸ú¤À¤Ã¤¿¾ì¹ç¤ä +¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤¬·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¡¢ +¥Ñ¥¿¡¼¥ó¼«¿È¤ò»ÈÍѤ¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +.BR glob () +¤¬¥¨¥é¡¼¤ò¼¨¤¹ +.B GLOB_NOMATCH +¤òÊÖ¤¹¤³¤È¤Ç¤¢¤ë¡£ +.TP +.B GLOB_ONLYDIR +¤³¤Î¥Õ¥é¥°¤Ï¡¢ +.BR glob () +¤ËÂФ¹¤ë¡Ö¥Ò¥ó¥È¡×¤Ç¤¢¤ê¡¢ +¸Æ¤Ó½Ð¤·Â¦¤¬¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤·¤«¶½Ì£¤¬¤Ê¤¤¤³¤È¤òÃΤ餻¤ë¡£ +¼ÂÁõ¤Ë¤ª¤¤¤Æ¥Õ¥¡¥¤¥ë¤Î¼ïÊ̾ðÊó¤ò´Êñ¤Ë·èÄê¤Ç¤­¤ë¾ì¹ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤ +¥Õ¥¡¥¤¥ë¤Ï¸Æ¤Ó½Ð¤·Â¦¤ËÊÖ¤µ¤ì¤Ê¤¤¡£¤·¤«¤·¤Ê¤¬¤é¡¢¸Æ¤Ó½Ð¤·Â¦¤Ç¤Ï¡¢ÊÖ¤µ¤ì¤¿ +¥Õ¥¡¥¤¥ë¥ê¥¹¥È¤¬¥Ç¥£¥ì¥¯¥È¥ê¤«¤É¤¦¤«¤ò³Îǧ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +(¤³¤Î¥Õ¥é¥°¤¬Â¸ºß¤¹¤ë¤Î¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤·¤«¶½Ì£¤¬¤Ê¤¤ºÝ¤Ë +À­Ç½¤òºÇŬ²½¤¹¤ëÌÜŪ¤Î¤¿¤á¤À¤±¤Ç¤¢¤ë¡£) +.PP +.I errfunc +¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ë¤Ï´Ø¿ô +.I errfunc +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£´Ø¿ô¤Î°ú¿ô¤Ë¤Ï¡¢¼ºÇÔ¤·¤¿¥Ñ¥¹Ì¾ +.I epath +¤È +.I errno +.RB ( opendir (3), +.BR readdir (3), +.BR stat (2). +¤Î¤¤¤º¤ì¤«¤Ë¤è¤Ã¤Æ¥»¥Ã¥È¤µ¤ì¤¿ÃÍ) ¤¬Í¿¤¨¤é¤ì¤ë¡£ +.I errfunc +¤¬ 0 °Ê³°¤ÎÃͤòÊÖ¤¹¤«¤â¤·¤¯¤Ï +.B GLOB_ERR +¤¬¥»¥Ã¥È¤µ¤ì¤¿¾ì¹ç +.BR glob () +¤Ï +.I errfunc +¤Î¸Æ¤Ó½Ð¤·¸å¤Ë½ªÎ»¤¹¤ë¡£ +.PP +¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤ÆÌá¤Ã¤¿¾ì¹ç +.I pglob\->gl_pathc +¤Ë¤Ï¥Þ¥Ã¥Á¤·¤¿¥Ñ¥¹Ì¾¤¬´Þ¤Þ¤ì¡¢ +.I pglob\->gl_pathv +¤Ï¥Þ¥Ã¥Á¤·¤¿¥Ñ¥¹Ì¾¤Ø¤Î¥Ý¥¤¥ó¥¿¤Î¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ë¡£ +¥Ý¥¤¥ó¥¿¤Î¥ê¥¹¥È¤Ï NULL ¥Ý¥¤¥ó¥¿¤Ç½ªÃ¼¤µ¤ì¤ë¡£ +.PP +.BR glob () +¤ò²¿ÅÙ¤«Â³¤±¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£¤½¤ÎºÝ2²óÌܰʹߤθƤӽФ·¤Ç¤Ï +.B GLOB_APPEND +¥Õ¥é¥°¤¬ +.I flags +¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +GNU ¤Î³ÈÄ¥¤È¤·¤Æ¡¢ +.I pglob\->gl_flags +¤Ë¤Ï»ØÄꤷ¤¿¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£¤â¤·°ì¤Ä¤Ç¤â¥á¥¿¥­¥ã¥é¥¯¥¿¤¬¸«ÉÕ¤«¤ì¤Ð +¤³¤Î¥Õ¥é¥°¤È +.B GLOB_MAGCHAR +¤È¤Î \fBOR\fR ¤ò¼è¤Ã¤¿·ë²Ì¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤Æ´°Î»¤¹¤ë¤È +.BR glob () +¤Ï 0 ¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤ÎÊÖ¤êÃͤϰʲ¼¤ÎÄ̤ê: +.TP +.B GLOB_NOSPACE +¥á¥â¥ê¤ò»È¤¤²Ì¤¿¤·¤¿ +.TP +.B GLOB_ABORTED +Æɤ߼è¤ê¥¨¥é¡¼ +.TP +.B GLOB_NOMATCH +°ì¤Ä¤â¥Þ¥Ã¥Á¤·¤Ê¤«¤Ã¤¿ +.SH ½àµò +POSIX.2, POSIX.1-2001. +.SH Ãí°Õ +glibc 2.1 ¤Ç¤Ï¡¢ +.I gl_pathc +¤È +.I gl_offs +¤Ï POSIX.2 ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë +.I size_t +¤È¤·¤ÆÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£ +libc4, libc5, glibc 2.0 ¤Ç¤Ï¡¢ +.I int +¤È¤·¤ÆÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +.BR glob () +´Ø¿ô¤Ï¤½¤ÎÃæ¤Ç¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë +.BR malloc (3) +¤ä +.BR opendir (3) +¤Ê¤É¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤Ç¼ºÇÔ¤¬µ¯¤³¤ë¤È¼ºÇÔ¤¹¤ë¡£ +¤³¤ì¤Ë¤è¤ê +.I errno +¤Ë¤½¤Î¥¨¥é¡¼¥³¡¼¥É¤¬Æþ¤ë¡£ +.SH Îã +»ÈÍÑË¡¤Î°ìÎã¤ò°Ê²¼¤Ë¼¨¤¹¡£°Ê²¼¤Ï¥·¥§¥ë¤Ç +.sp +.in +4n +ls \-l *.c ../*.c +.in +.sp +¤ò¥¿¥¤¥×¤·¤¿¾ì¹ç¤ò¥·¥ß¥å¥ì¡¼¥È¤·¤Æ¤¤¤ë¡£ +.nf +.in +4n + +glob_t globbuf; + +globbuf.gl_offs = 2; +glob("*.c", GLOB_DOOFFS, NULL, &globbuf); +glob("../*.c", GLOB_DOOFFS | GLOB_APPEND, NULL, &globbuf); +globbuf.gl_pathv[0] = "ls"; +globbuf.gl_pathv[1] = "\-l"; +execvp("ls", &globbuf.gl_pathv[0]); +.in +.fi +.SH ´ØÏ¢¹àÌÜ +.BR ls (1), +.BR sh (1), +.BR stat (2), +.BR exec (3), +.BR fnmatch (3), +.BR malloc (3), +.BR opendir (3), +.BR readdir (3), +.BR wordexp (3), +.BR glob (7) diff --git a/release/man3/gnu_get_libc_version.3 b/release/man3/gnu_get_libc_version.3 new file mode 100644 index 00000000..d0a751ce --- /dev/null +++ b/release/man3/gnu_get_libc_version.3 @@ -0,0 +1,79 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 +.\" +.TH GNU_GET_LIBC_VERSION 3 2008-07-02 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +gnu_get_libc_version, gnu_get_libc_release \- glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤È +¥ê¥ê¡¼¥¹¾õÂÖ¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +.B const char *gnu_get_libc_version(void); +.B const char *gnu_get_libc_release(void); +.fi +.SH ÀâÌÀ +.BR gnu_get_libc_version () +´Ø¿ô¤Ï¡¢¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ê glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤òÆÃÄꤹ¤ëʸ»úÎó¤òÊÖ¤¹¡£ + +.BR gnu_get_libc_release () +´Ø¿ô¤Ï¡¢¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ê glibc ¥Ð¡¼¥¸¥ç¥ó¤Î¥ê¥ê¡¼¥¹¾õÂÖ¤ò¼¨¤¹ +ʸ»úÎó¤òÊÖ¤¹¡£ +.I "stable" +¤È¤¤¤Ã¤¿Ê¸»úÎó¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Îã +²¼µ­¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤È¡¢¼¡¤Î¤è¤¦¤Ê½ÐÎϤ¬ÆÀ¤é¤ì¤ë¡£ +.in +4n +.nf + +.RB "$" " ./a.out" +GNU libc version: 2.8 +GNU libc release: stable +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + printf("GNU libc version: %s\\n", gnu_get_libc_version()); + printf("GNU libc release: %s\\n", gnu_get_libc_release()); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR confstr (3) diff --git a/release/man3/grantpt.3 b/release/man3/grantpt.3 new file mode 100644 index 00000000..614ec67e --- /dev/null +++ b/release/man3/grantpt.3 @@ -0,0 +1,76 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This page is in the public domain. - aeb +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 01:56:27 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: pseudo-terminal µ¼»÷üËö +.\"WORD: pseudotty µ¼»÷üËö +.\" +.TH GRANTPT 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +grantpt \- ¥¹¥ì¡¼¥Öµ¼»÷üËö¤Ø¤Î¥¢¥¯¥»¥¹¤òµö²Ä¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "int grantpt(int " fd ");" +.fi +.SH ÀâÌÀ +.BR grantpt () +´Ø¿ô¤Ï¡¢ +.I fd +¤Ç»²¾È¤µ¤ì¤¿¥Þ¥¹¥¿µ¼»÷üËö¤ËÂбþ¤¹¤ë¥¹¥ì¡¼¥Öµ¼»÷üËö¥Ç¥Ð¥¤¥¹ (pty) +¤Î¥â¡¼¥É¤È½êÍ­¼Ô¤òÊѹ¹¤¹¤ë¡£ +¥¹¥ì¡¼¥Ö¤Î¥æ¡¼¥¶ID ¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â UID ¤ËÀßÄꤵ¤ì¤ë¡£ +¥°¥ë¡¼¥×ID ¤È¤·¤ÆÀßÄꤵ¤ì¤ëÃͤϵ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤ (Î㤨¤Ð \fItty\fP ¤Ë¤Ê¤ë)¡£ +¥¹¥ì¡¼¥Ö¤Î¥â¡¼¥É¤Ï 0620 (crw\-\-w\-\-\-\-) ¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +.B SIGCHLD +¥·¥°¥Ê¥ë¤òÊ᪤¹¤ë¤¿¤á¤Ë¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î +.BR grantpt () +¤ÎÆ°ºî¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR grantpt () +¤Ï 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +Âбþ¤¹¤ë¥¹¥ì¡¼¥Öµ¼»÷üËö¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EBADF +°ú¤­¿ô +.I fd +¤¬Í­¸ú¤Ê¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +°ú¤­¿ô +.I fd +¤ÏÍ­¸ú¤À¤¬¡¢¥Þ¥¹¥¿µ¼»÷üËö¤ËÂбþ¤¹¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR grantpt () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH È÷¹Í +¤³¤ì¤Ï Unix98 pty »ÅÍͤΰìÉô¤Ç¤¢¤ë¡£ +.BR pts (4) +¤ò»²¾È¤Î¤³¤È¡£ +¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ï "pt_chown" ¤È¸Æ¤Ð¤ì¤ë set-user-ID ¤µ¤ì¤¿ +Êä½õ¥Ð¥¤¥Ê¥ê¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +Linux ¤Î devpts ¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤ÊÊä½õ¥Ð¥¤¥Ê¥ê¤òɬÍפȤ·¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR open (2), +.BR posix_openpt (3), +.BR ptsname (3), +.BR unlockpt (3), +.BR pts (4), +.BR feature_test_macros (7), +.BR pty (7) diff --git a/release/man3/gsignal.3 b/release/man3/gsignal.3 new file mode 100644 index 00000000..8c0cd07f --- /dev/null +++ b/release/man3/gsignal.3 @@ -0,0 +1,111 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.\" +.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI, all rights reserved. +.\" Translated Mon Feb 2 2003 by Akihiro MOTOKI +.\" +.\"WORD: broken Àµ¤·¤¯¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤ +.\" +.TH GSIGNAL 3 2007-07-26 "" "Linux Programmer's Manual" +.SH ̾Á° +gsignal, ssignal \- ¥½¥Õ¥È¥¦¥§¥¢¡¦¥·¥°¥Ê¥ëµ¡Ç½ +.SH ½ñ¼° +.nf +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "int gsignal(int " signum ); +.sp +.BI "sighandler_t ssignal(int " signum ", sighandler_t " action ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR gsignal (), +.BR ssignal (): +_SVID_SOURCE +.SH ÀâÌÀ +Linux ¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤ò»ÈÍѤ·¤Ê¤¤¤³¤È¡£ +²áµî¤Ë´Ö°ã¤¤¤¬¤¢¤ê¡¢Linux ¤Ç¤Ï +.BR gsignal () +¤È +.BR ssignal () +¤Ï¤½¤ì¤¾¤ì +.BR raise (3) +¤È +.BR signal (2) +¤ÎÊÌ̾¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.LP +°ìÊý¡¢System V É÷¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ç¡¢ +½¾Íè¤Î +.BR signal (2) +¤ä +.BR kill (2) +¤Î´Ø¿ô·²¤È¤Ï´°Á´¤ËÆÈΩ¤Ê¡¢ +¥½¥Õ¥È¥¦¥§¥¢¡¦¥·¥°¥Ê¥ê¥ó¥°¤ò¼Â¸½¤·¤Æ¤¤¤ë¡£ +.BR ssignal () +´Ø¿ô¤Ï¡¢ÈÖ¹æ +.I signum +¤Î¥½¥Õ¥È¥¦¥§¥¢¡¦¥·¥°¥Ê¥ë¤¬ +.BR gsignal () +´Ø¿ô¤ò»È¤Ã¤ÆȯÀ¸¤µ¤ì¤¿»þ¤Ë¤È¤ë¤Ù¤­¥¢¥¯¥·¥ç¥ó¤òÄêµÁ¤¹¤ë¡£ +.BR gsignal () +¤ÎÊÖ¤êÃͤϡ¢°ì¤ÄÁ°¤Ë»ØÄꤵ¤ì¤Æ¤¤¤¿¥¢¥¯¥·¥ç¥ó¡¢¤â¤·¤¯¤Ï +.B SIG_DFL +¤Ç¤¢¤ë¡£ +.BR gsignal () +¤Ï°Ê²¼¤Î¤è¤¦¤ÊÆ°ºî¤ò¹Ô¤¦: +.I signum +¤ËÂФ·¤Æ¥¢¥¯¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢¥¢¥¯¥·¥ç¥ó +.B SIG_DFL +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢²¿¤â¤»¤º¤Ë 0 ¤òÊÖ¤¹¡£ +.I signum +¤ËÂФ·¤Æ ¥¢¥¯¥·¥ç¥ó +.B SIG_IGN +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢²¿¤â¤»¤º¤Ë 1 ¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥¢¥¯¥·¥ç¥ó¤ò +.B SIG_DFL +¤Ë¥ê¥»¥Ã¥È¤·¡¢°ú¤­¿ô¤Ë +.I signum +¤ò»ØÄꤷ¤Æ¥¢¥¯¥·¥ç¥ó´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢¥¢¥¯¥·¥ç¥ó´Ø¿ô¤ÎÊÖ¤êÃͤòÊÖ¤¹¡£ +.I signum +¤¬¤È¤êÆÀ¤ëÃͤÎÈϰϤϼÂÁõ¤Ë¤è¤ê°Û¤Ê¤ë (¿¤¯¤Î¾ì¹ç 1¡Á15 ¤« 1¡Á17 ¤Ç¤¢¤ë)¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢AIX, DG/UX, HP-UX, SCO, Solaris, Tru64 ¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¤Î¤Û¤È¤ó¤É¤ÇÇѻߤµ¤ì¤¿¤³¤È¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +Linux ¤Î libc ¤ª¤è¤Ó glibc ¤Ç¤ÏÀµ¤·¤¯¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.BR gsignal_r () +¤È +.BR ssignal_r () +¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR signal (2), +.BR raise (3) diff --git a/release/man3/hash.3 b/release/man3/hash.3 new file mode 100644 index 00000000..7e575514 --- /dev/null +++ b/release/man3/hash.3 @@ -0,0 +1,174 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)hash.3 8.6 (Berkeley) 8/18/94 +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito +.\" all rights reserved. +.\" Translated Mon Jul 26 14:22:49 JST 1999 +.\" by Shouichi Saito +.\" Proofed Tue Aug 17 1999 by NAKANO Takeo +.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 +.\" +.\"WORD: access method ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.\"WORD: bucket ¥Ð¥±¥Ã¥È +.\" +.TH HASH 3 1994-08-18 "" "Linux Programmer's Manual" +.UC 7 +.SH ̾Á° +hash \- hash ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.SH ½ñ¼° +.nf +.ft B +#include +#include +.ft R +.fi +.SH ÀâÌÀ +¥ë¡¼¥Á¥ó +.BR dbopen (3) +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¤Ò¤È¤Ä¤Ë hash ¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¡£ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ë´Ø¤¹¤ë°ìÈÌŪ¤Êµ­½Ò¤Ï +.BR dbopen (3) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï hash ÆÃÍ­¤Î¾ðÊó¤Ë¤Ä¤¤¤Æ¤Î¤ßµ­½Ò¤¹¤ë¡£ +.PP +hash ¥Ç¡¼¥¿¹½Â¤¤Ï¡¢³ÈÄ¥²Äǽ¤ÊưŪ¥Ï¥Ã¥·¥å¥¹¥­¡¼¥à¤Ç¤¢¤ë¡£ +.PP +.BR dbopen (3) +¤ËÅϤµ¤ì¤ë hash ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤ËÆÃÍ­¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢ +.I +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.in +4n +.nf + +typedef struct { + unsigned int bsize; + unsigned int ffactor; + unsigned int nelem; + unsigned int cachesize; + uint32_t (*hash)(const void *, size_t); + int lorder; +} HASHINFO; +.fi +.in +.PP +¤³¤Î¹½Â¤ÂΤÎÍ×ÁǤò°Ê²¼¤Ë¼¨¤¹¡£ +.TP 10 +.I bsize +hash ¥Æ¡¼¥Ö¥ë¥Ð¥±¥Ã¥È (table bucket) ¤Î¥µ¥¤¥º¤òÄêµÁ¤¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 256 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +¥Ç¥£¥¹¥¯¤ËÃÖ¤«¤ì¤ë¥Æ¡¼¥Ö¥ë¤ä¥Ç¡¼¥¿¥¢¥¤¥Æ¥à¤¬Â礭¤¤¥Æ¡¼¥Ö¥ë¤Ç¤Ï +¥Ú¡¼¥¸¥µ¥¤¥º¤òÂ礭¤¯¤¹¤ë¤Û¤¦¤¬Îɤ¤¤À¤í¤¦¡£ +.TP +.I ffactor +¥æ¡¼¥¶¤¬Ë¾¤à hash ¥Æ¡¼¥Ö¥ëÃæ¤ÎÌ©Å٤Ǥ¢¤ë¡£ +¤³¤ì¤Ï¤½¤ì¤¾¤ì¤Î¥Ð¥±¥Ã¥È¤Ë³ÊǼ¤Ç¤­¤ë¥­¡¼¤Î³µ¿ô¤Ç¤¢¤ê¡¢ +hash ¥Æ¡¼¥Ö¥ë¤ò³ÈÂ硦½Ì¾®¤òºîÍѤ¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 8 ¤Ç¤¢¤ë¡£ +.TP +.I nelem +hash ¥Æ¡¼¥Ö¥ë¤ÎºÇ½ª¥µ¥¤¥º¤òÂç¤Þ¤«¤Ë¸«ÀѤâ¤Ã¤¿ÃͤǤ¢¤ë¡£ +¤³¤ÎÃͤ¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤ê¡¢¤¢¤Þ¤ê¤ËÄ㤯¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +hash ¥Æ¡¼¥Ö¥ë¤Ï¥­¡¼¤¬Æþ¤Ã¤Æ¤¯¤ë¤Ë±þ¤¸¤Æ³ÈÄ¥¤µ¤ì¤ë¡£ +¤·¤«¤·¾¯¤·¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤¬ (¤ª¤½¤é¤¯µ¤ÉÕ¤¯ÄøÅÙ¤Ë) Íî¤Á¤ë¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 1 ¤Ç¤¢¤ë¡£ +.TP +.I cachesize +¥á¥â¥ê¥­¥ã¥Ã¥·¥å¤ÎºÇÂçÃÍ (¥Ð¥¤¥Èñ°Ì) ¤Î»²¹ÍÃÍ¡£ +¤³¤ÎÃÍ¤Ï +.BR ¤¢¤¯¤Þ¤Ç»²¹Í¤Ç¤¢¤ê ¡¢ +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ï¤³¤ÎÃͤò±Û¤¨¤¿¥á¥â¥ê¤Î³ä¤êÅö¤Æ¤ËÀ®¸ù¤¹¤ë¤³¤È¤â¤¢¤ë¡£ +.TP +.I hash +¤Ï¥æ¡¼¥¶¡¼ÄêµÁ¤Î hash ´Ø¿ô¤Ç¤¢¤ë¡£ +Á´¤Æ¤Î¥Ç¡¼¥¿¤ËÂФ·¤Æ¤¦¤Þ¤¯ºîÍѤ¹¤ë hash ´Ø¿ô¤È¸À¤¦¤Î¤Ï¤Ê¤¤¤«¤é¡¢ +ÆÃÄê¤Î¥Ç¡¼¥¿¥»¥Ã¥È¤ËÂФ·¤Æ¤ÏÁȤ߹þ¤ß¤Î hash ´Ø¿ô¤Ç¤Ï +¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤¬Ä㤤¤³¤È¤â¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¥æ¡¼¥¶¡¼ÄêµÁ¤Î hash ´Ø¿ô¤ÏÆó¤Ä¤Î°ú¿ô¤ò¤È¤é¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤ (¥Ð¥¤¥Èʸ»ú +Îó¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¡¢Ä¹¤µ)¡£ +¤½¤·¤Æ hash ÃͤȤ·¤Æ»È¤ï¤ì¤ë 32¥Ó¥Ã¥È¤ÎÃͤòÊÖ¤µ¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.I lorder +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥á¥¿¥Ç¡¼¥¿¤ÎÀ°¿ôÃͤΥХ¤¥È¥ª¡¼¥À¡¼¡£ +¤³¤Î¿ô»ú¤Ï¡¢½ç½ø¤òÀ°¿ô¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +Î㤨¤Ð¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤Ê¤é¡¢¤³¤Î¿ôÃÍ¤Ï 4,321 ¤È¤Ê¤ë¡£ +.I lorder +¤¬ 0 (»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤)¾ì¹ç¡¢¸½ºß¤Î¥Û¥¹¥È +¤Ç»È¤ï¤ì¤Æ¤¤¤ëʤӽ礬»È¤ï¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢»ØÄꤷ¤¿ÃͤÏ̵»ë¤µ¤ì¥Ä¥ê¡¼¤¬ºî¤é¤ì +¤¿»þ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤¿Ãͤ¬»È¤ï¤ì¤ë¡£ +.PP +.\"NAKANO the tree ¢ª the hash, ¤Ç¤·¤ç¤¦. +¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤ë (¤Þ¤¿¤Ï +.B O_TRUNC +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤È¡¢ +.IR bsize , +.IR ffactor , +.IR lorder , +.I nelem +¤Ë»ØÄꤵ¤ì¤¿ÃͤÏ̵»ë¤µ¤ì¡¢ +¥Ï¥Ã¥·¥å¤¬ºî¤é¤ì¤¿»þ¤Ë»È¤Ã¤¿Ãͤ¬»È¤ï¤ì¤ë¡£ +.PP +hash ´Ø¿ô¤¬»ØÄꤵ¤ì¤ë¤È¡¢ +.I hash_open +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ºî¤é¤ì¤¿»þ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤¿ +hash ´Ø¿ô¤Èº£²ó»ØÄꤵ¤ì¤¿ hash ´Ø¿ô¤¬Æ±¤¸¤«¤É¤¦¤«¤òÄ´¤Ù¡¢ +Ʊ¤¸¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¼ºÇÔ¤¹¤ë¡£ +.PP +.BR dbm (3), +¤È +.BR ndbm (3) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥ë¡¼¥Á¥ó¤Ø¤Î²áµî¸ß´¹¤ò¼è¤ë¤¿¤á¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤¬ +¸ºß¤¹¤ë¡£¤·¤«¤·¤³¤ì¤é¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï°ÊÁ°¤Î¥Õ¥¡¥¤¥ë¥Õ¥©¡¼ +¥Þ¥Ã¥È¤È¤Ï¸ß´¹À­¤¬¤Ê¤¤¡£ +.SH ¥¨¥é¡¼ +.I hash +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¥ë¡¼¥Á¥ó¤Ï¡¢¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR dbopen (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥Ð¥° +¥Ð¥¤¥È¥ª¡¼¥À¡¼¤È¤·¤Æ¤Ï¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤È¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó¤Î¤ß¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR btree (3), +.BR dbopen (3), +.BR mpool (3), +.BR recno (3) +.sp +.IR "Dynamic Hash Tables" , +Per-Ake Larson, Communications of the ACM, April 1988. +.sp +.IR "A New Hash Package for UNIX" , +Margo Seltzer, USENIX Proceedings, Winter 1991. diff --git a/release/man3/hsearch.3 b/release/man3/hsearch.3 new file mode 100644 index 00000000..9998c25b --- /dev/null +++ b/release/man3/hsearch.3 @@ -0,0 +1,352 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" Copyright 1993 Ulrich Drepper (drepper@karlsruhe.gmd.de) +.\" and Copyright 2008, Linux Foundation, written by 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. +.\" +.\" References consulted: +.\" SunOS 4.1.1 man pages +.\" Modified Sat Sep 30 21:52:01 1995 by Jim Van Zandt +.\" Remarks from dhw@gamgee.acad.emich.edu Fri Jun 19 06:46:31 1998 +.\" Modified 2001-12-26, 2003-11-28, 2004-05-20, aeb +.\" 2008-09-02, mtk: various additions and rewrites +.\" 2008-09-03, mtk, restructured somewhat, in part after suggestions from +.\" Timothy S. Nelson +.\" +.\" Japanese Version Copyright (c) 1998 George Momma, +.\" Copyright (c) 2001-2005 Yuichi SATO, +.\" and Copyright (c) 2008 Akihiro MOTOKI +.\" Translated 1998-05-23, George Momma +.\" Updated & Modified 2001-10-15, Yuichi SATO +.\" Updated & Modified 2002-01-03, Yuichi SATO +.\" Updated & Modified 2004-01-17, Yuichi SATO +.\" Updated & Modified 2005-01-10, Yuichi SATO +.\" Updated 2008-09-20, Akihiro MOTOKI +.\" +.\"WORD: hash table ¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë +.\"WORD: entry ¥¨¥ó¥È¥ê¡¼ +.\"WORD: allocate ³ä¤êÅö¤Æ +.\"WORD: NUL-terminated ¥Ì¥ëʸ»ú \0 ¤Ç½ªÃ¼¤µ¤ì¤¿ +.\"WORD: pointer ¥Ý¥¤¥ó¥¿ +.\"WORD: character ʸ»ú·¿ +.\"WORD: item ¹àÌÜ +.\" +.TH HSEARCH 3 2008-10-06 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +hcreate, hdestroy, hsearch, hcreate_r, hdestroy_r, +hsearch_r \- ¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Î´ÉÍý +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int hcreate(size_t " nel ); +.sp +.BI "ENTRY *hsearch(ENTRY " item ", ACTION " action ); +.sp +.B "void hdestroy(void);" +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int hcreate_r(size_t " nel ", struct hsearch_data *" htab ); +.sp +.BI "int hsearch_r(ENTRY " item ", ACTION " action ", ENTRY **" retval , +.BI " struct hsearch_data *" htab ); +.sp +.BI "void hdestroy_r(struct hsearch_data *" htab ); +.fi +.SH ÀâÌÀ +.BR hcreate (), +.BR hsearch (), +.BR hdestroy () +¤Î 3 ¤Ä¤Î´Ø¿ô¤òÍøÍѤ¹¤ë¤È¡¢¥­¡¼ (ʸ»úÎó) ¤ÈÂбþ¤¹¤ë¥Ç¡¼¥¿¤«¤é¹½À®¤µ¤ì¤ë +¥¨¥ó¥È¥ê¤ò³ÊǼ¤Ç¤­¤ë¥Ï¥Ã¥·¥å¸¡º÷¥Æ¡¼¥Ö¥ë¤òºîÀ®¡¢´ÉÍý¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤ò»È¤Ã¤Æ¡¢°ìÅ٤˻ÈÍѤǤ­¤ë¤Î¤Ï°ì¤Ä¤Î¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤À¤±¤Ç¤¢¤ë¡£ + +.BR hcreate_r (), +.BR hsearch_r (), +.BR hdestroy_r () +¤Î 3 ¤Ä¤Î´Ø¿ô¤Ï¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǡ¢¤³¤ì¤é¤òÍøÍѤ¹¤ë¤È¡¢ +°ì¤Ä¤Î¥×¥í¥°¥é¥à¤ÇƱ»þ¤ËÊ£¿ô¤Î¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +ºÇ¸å¤Î°ú¤­¿ô +.I htab +¤Ï´Ø¿ô¤ÎÁàºîÂоݤȤʤë¥Æ¡¼¥Ö¥ë¤ò¼¨¤¹¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +¥×¥í¥°¥é¥Þ¤Ï¤³¤Î¹½Â¤ÂΤò¥Ö¥é¥Ã¥¯¥Ü¥Ã¥¯¥¹¤È¤·¤Æ°·¤¦¤Ù¤­¤Ç¤¢¤ë +(¤Ä¤Þ¤ê¡¢¤³¤Î¹½Â¤ÂΤΥե£¡¼¥ë¥É¤ËľÀÜ¥¢¥¯¥»¥¹¤·¤¿¤êÊѹ¹¤·¤¿¤ê +¤·¤Ê¤¤¤³¤È)¡£ + +ºÇ½é¤Ë¡¢ +.BR hcreate () +´Ø¿ô¤Ë¤è¤Ã¤Æ¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤òºîÀ®¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +°ú¤­¿ô \fInel\fP ¤Ç¥Æ¡¼¥Ö¥ë¤ÎºÇÂ票¥ó¥È¥ê¿ô¤ò»ØÄꤹ¤ë +(¤³¤ÎºÇÂçÃͤϸå¤ÇÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¤Î¤Ç¡¢¤è¤¯¹Í¤¨¤ÆÁªÂò¤¹¤ë¤³¤È)¡£ +ºîÀ®¤µ¤ì¤ë¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ÎÀ­Ç½¤ò¸þ¾å¤µ¤»¤ë¤¿¤á¤Ë¡¢ +´Ø¿ôÆâÉô¤Î¼ÂÁõ¤Ë¤è¤ê¤³¤ÎÃͤÏÁý¤ä¤µ¤ì¤ë¾ì¹ç¤â¤¢¤ë¡£ +.\" e.g., in glibc it is raised to the next higher prime number + +.BR hcreate_r () +´Ø¿ô¤Ï +.BR hcreate () +¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¤¬¡¢¹½Â¤ÂÎ +.I *htab +¤Ç¼¨¤µ¤ì¤ë¥Æ¡¼¥Ö¥ë¤òÂоݤȤ·¤ÆÆ°ºî¤¹¤ë¡£ +.I htab +¤¬»Ø¤·¼¨¤¹¹½Â¤ÂΤϡ¢ +.BR hcreate_r () +¤ò½é¤á¤Æ¸Æ¤Ó½Ð¤¹Á°¤Ë 0 ¤ÇËä¤á¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.BR hdestroy () +´Ø¿ô¤Ï¡¢ +.BR hcreate () +¤ÇºîÀ®¤µ¤ì¤¿¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤¬ÀêÍ­¤·¤Æ¤¤¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£ +¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Ë¤è¤Ã¤ÆÀêÍ­¤µ¤ì¤Æ¤¤¤¿¥á¥â¥ê¤ò²òÊü¤·¡¢ +¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤òºîÀ®¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +.BR hdestroy () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¤½¤Î¸å¤Ï +.BR hcreate () +¤ò»È¤Ã¤Æ¿·¤·¤¤¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR hdestroy_r () +´Ø¿ô¤Ï¡¢Æ±ÍͤνèÍý¤ò¡¢¤½¤ì°ÊÁ°¤Ë +.BR hcreate_r () +¤ò»È¤Ã¤ÆºîÀ®¤·¤¿ +.I *htab +¤Ç¼¨¤µ¤ì¤ë¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¼Â¹Ô¤¹¤ë¡£ + +.BR hsearch () +´Ø¿ô¤Ï¡¢\fIitem\fP ¤ÈƱ¤¸¥­¡¼¤ò»ý¤Ä¹àÌܤò¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤«¤é +¸¡º÷¤·¡¢¹àÌܤ¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¤½¤Î¹àÌܤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹ +(¡ÖƱ¤¸¡×¤«¤É¤¦¤«¤Ï +.BR strcmp (3) +¤ò»È¤Ã¤ÆȽÄꤹ¤ë)¡£ + +°ú¤­¿ô \fIitem\fP ¤Ï \fBENTRY\fP ·¿¤Ç¤¢¤ê¡¢\fI\fP ¤ÎÃæ¤Ç +°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.in +4n +.sp +.nf +typedef struct entry { + char *key; + void *data; +} ENTRY; +.in +.fi +.sp +¥Õ¥£¡¼¥ë¥É \fIkey\fP ¤Ï¸¡º÷¥­¡¼¤È¤Ê¤ë NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤ò»Ø¤¹¡£ +¥Õ¥£¡¼¥ë¥É \fIdata\fP ¤Ï¡¢¤³¤Î¥­¡¼¤ËÂбþ¤¹¤ë¥Ç¡¼¥¿¤ò»Ø¤¹¡£ + +¸¡º÷¤¬¼ºÇÔ¤·¤¿¸å¤ÎÆ°ºî¤Ï¡¢°ú¤­¿ô \fIaction\fP ¤Ë¤è¤ê·è¤Þ¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ë¤Ï +.B ENTER +¤« +.B FIND +¤Î¤¤¤º¤ì¤«¤ÎÃͤò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B ENTER +¤Ï +.I item +¤Î¥³¥Ô¡¼¤òÁÞÆþ¤¹¤ë¤³¤È¤ò +(´Ø¿ô¤Î·ë²Ì¤È¤·¤Æ¿·¤·¤¤¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹)¡¢ +.B FIND +¤Ï NULL ¤òÊÖ¤¹¤³¤È¤ò°ÕÌ£¤¹¤ë +.RI ( action +¤¬ +.B FIND +¤Î¾ì¹ç¡¢ +.I data +¤Ï̵»ë¤µ¤ì¤ë)¡£ + +.BR hsearch_r () +´Ø¿ô¤Ï +.BR hsearch () +¤ÈƱÍͤÀ¤¬¡¢ +.I *htab +¤Ç¼¨¤µ¤ì¤ë¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ½èÍý¤ò¹Ô¤¦¡£ +.BR hsearch_r () +´Ø¿ô¤¬ +.BR hsearch () +¤È°Û¤Ê¤ë¤Î¤Ï¡¢¸«¤Ä¤«¤Ã¤¿¹àÌܤؤΥݥ¤¥ó¥¿¤ò¡¢ +´Ø¿ô¤Î·ë²Ì¤È¤·¤Æ¤Ç¤Ï¤Ê¤¯¡¢ +.I *retval +¤Ë³ÊǼ¤·¤ÆÊÖ¤¹ÅÀ¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR hcreate () +¤È +.BR hcreate_r () +¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç 0 °Ê³°¤ÎÃͤòÊÖ¤·¡¢ +¥¨¥é¡¼¤Î¾ì¹ç 0 ¤òÊÖ¤¹¡£ + +À®¸ù¤¹¤ë¤È¡¢ +.BR hsearch () +¤Ï¡¢¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ëÆâ¤Î¥¨¥ó¥È¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR hsearch () +¤Ï NULL ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤È¤Ê¤ë¤Î¤Ï¡¢ +\fIaction\fP ¤¬ \fBENTER\fP ¤Ç¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤¬¤¤¤Ã¤Ñ¤¤¤Î¾ì¹ç¤«¡¢ +\fIaction\fP ¤¬ \fBFIND\fP ¤Ç \fIitem\fP ¤¬¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ëÆâ¤Ë +¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ç¤¢¤ë¡£ +.BR hsearch_r () +¤Ï¡¢À®¸ù¤¹¤ë¤È 0 °Ê³°¤òÊÖ¤·¡¢¥¨¥é¡¼¤Î¾ì¹ç 0 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.LP +.BR hcreate () +¤È +.BR hcreate_r () +¤Ï°Ê²¼¤ÎÍýͳ¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B EINVAL +.RB ( hcreate_r ()) +.I htab +¤¬ NULL ¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +\fBENTER\fP ¤ËÀßÄꤵ¤ì¤¿ \fIaction\fP ¤Ç¡¢ +¥Æ¡¼¥Ö¥ë¤¬¤¤¤Ã¤Ñ¤¤¤Ë¤Ê¤Ã¤¿¡£ +.TP +.B ESRCH +\fIaction\fP °ú¤­¿ô¤¬ \fBFIND\fP ¤Ç¡¢ +¤«¤ÄÂбþ¤¹¤ëÍ×ÁǤ¬¥Æ¡¼¥Ö¥ë¤Ë¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.\" hdestroy_r() ¤Ï 'tab' ¤¬ NULL ¤Î¾ì¹ç errno ¤Ë EINVAL ¤òÀßÄꤹ¤ë¾ì¹ç¤¬¤¢¤ë¡£ +.PP +.BR hsearch () +¤È +.BR hsearch_r () +¤Ï°Ê²¼¤ÎÍýͳ¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B ENOMEM +.I action +¤¬ +.B ENTER +¤Ç¡¢ +.I key +¤¬¥Æ¡¼¥Ö¥ëÆâ¤Ë¸«¤Ä¤«¤é¤º¡¢ +¥Æ¡¼¥Ö¥ë¤Ë¿·¤·¤¤¥¨¥ó¥È¥ê¤òÄɲ乤ë;ÃϤ¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B ESRCH +.I action +¤¬ +.B FIND +¤Ç¡¢ +.I key +¤¬¥Æ¡¼¥Ö¥ëÆâ¤Ë¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£ +.PP +POSIX.1-2001 ¤¬µ¬Äꤷ¤Æ¤¤¤ë¤Î¤Ï¡¢¥¨¥é¡¼ +.B ENOMEM +¤À¤±¤Ç¤¢¤ë¡£ +.SH ½àµò +´Ø¿ô +.BR hcreate (), +.BR hsearch (), +.BR hdestroy () +¤Ï SVr4 ¤«¤éƳÆþ¤µ¤ì¤¿¤â¤Î¤Ç¡¢POSIX.1-2001 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +´Ø¿ô +.BR hcreate_r , +.BR hsearch_r , +.B hdestroy_r +¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +Ä̾¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Î¼ÂÁõ¤Ï¡¢¾×ÆͤòºÇ¾®¸Â¤Ë¤¹¤ë¤¿¤á¤Ë +¥Æ¡¼¥Ö¥ë¤Ë½½Ê¬¤Ê¶õ¤­Îΰ褬¤¢¤ë¾ì¹ç¤Ë¸úΨ¤¬¤è¤¯¤Ê¤ë¡£ +¤³¤Î¤¿¤á¡¢ÉáÄ̤ϡ¢ +.I nel +¤ò¡¢¸Æ¤Ó½Ð¤·Â¦¤¬¥Æ¡¼¥Ö¥ë¤Ë³ÊǼ¤·¤è¤¦¤È»×¤Ã¤Æ¤¤¤ë +¥¨¥ó¥È¥ê¤ÎºÇÂç¿ô¤è¤ê¾¯¤Ê¤¯¤È¤â 25% ¤ÏÂ礭¤ÊÃͤˤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.BR hdestroy () +¤È +.BR hdestroy_r () +¤Ï¡¢¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¤ÎÍ×ÁǤǤ¢¤ë +.I key +¤È +.I data +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤ò²òÊü¤·¤Ê¤¤ +(¤³¤ì¤¬¤Ç¤­¤Ê¤¤¤Î¤Ï¡¢¤³¤ì¤é¤Î¥Ð¥Ã¥Õ¥¡¤¬Æ°Åª¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¤Î¤«¤ò +ÃΤ뤳¤È¤¬¤Ç¤­¤Ê¤¤¤«¤é¤Ç¤¢¤ë)¡£ +¤³¤ì¤é¤Î¥Ð¥Ã¥Õ¥¡¤ò²òÊü¤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¡¢ +¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥Ð¥Ã¥Õ¥¡¤ò²òÊü¤Ç¤­¤ë¤è¤¦¤Ë´ÉÍýÍѤΥǡ¼¥¿¹½Â¤¤ò +Àߤ±¤Æ¡¢¤³¤ì¤ò´ÉÍý¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(²òÊü¤¬É¬ÍפȤʤëÍýͳ¤Ï¡¢¤¿¤¤¤Æ¤¤¤Ï¡¢¥×¥í¥°¥é¥à¼«¿È¤ÈÀ¸Â¸´ü´Ö¤¬Æ±¤¸ +¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ò°ì¤Ä¤À¤±ºîÀ®¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢¤½¤Î¥×¥í¥°¥é¥à¤Ç¤ÏÊ£¿ô¤Î +¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ò·«¤êÊÖ¤·¤ÆºîÀ®¤·¤¿¤êÇË´þ¤·¤¿¤ê¤¹¤ë¤«¤é¤Ç¤¢¤í¤¦)¡£ +.SH ¥Ð¥° +SVr4 ¤È POSIX.1-2001 ¤Îµ¬Äê¤Ç¤Ï¡¢ +\fIaction\fP ¤Ï¸¡º÷¤¬¼ºÇÔ¤·¤¿¤È¤­¤Ë¤À¤±°ÕÌ£¤ò»ý¤Ä¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤è¤Ã¤Æ¡¢¸¡º÷¤¬À®¸ù¤·¤¿¾ì¹ç¡¢\fIaction\fP ¤ÎÃͤ¬ \fBENTER\fP ¤Ç¤â +²¿¤â¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +(¥Ð¡¼¥¸¥ç¥ó 2.3 ¤è¤êÁ°¤Î) libc ¤È glibc ¤Î¼ÂÁõ¤Ï¤³¤Îµ¬³Ê¤Ë°ãÈ¿¤·¤Æ¤ª¤ê¡¢ +¤³¤Î¾õ¶·¤Ç¡¢»ØÄꤵ¤ì¤¿ \fIkey\fP ¤ËÂбþ¤¹¤ë \fIdata\fP ¤¬¹¹¿·¤µ¤ì¤ë¡£ + +¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¡¼¤ÎÄɲäϤǤ­¤ë¤¬¡¢ºï½ü¤¬¤Ç¤­¤Ê¤¤¡£ +.SH Îã +.PP +¼¡¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Ë 24 ¸Ä¤Î¹àÌܤòÁÞÆþ¤·¡¢ +¤½¤ì¤«¤é¤½¤Î¤¦¤Á¤Î¤¤¤¯¤Ä¤«¤òɽ¼¨¤¹¤ë¡£ +.nf + +#include +#include +#include + +char *data[] = { "alpha", "bravo", "charlie", "delta", + "echo", "foxtrot", "golf", "hotel", "india", "juliet", + "kilo", "lima", "mike", "november", "oscar", "papa", + "quebec", "romeo", "sierra", "tango", "uniform", + "victor", "whisky", "x\-ray", "yankee", "zulu" +}; + +int main() +{ + ENTRY e, *ep; + int i; + + hcreate(30); + + for (i = 0; i < 24; i++) { + e.key = data[i]; + /* ¥Ç¡¼¥¿¤Ï¡¢¥Ý¥¤¥ó¥¿¤Ç¤Ï¤Ê¤¯¡¢Ã±¤Ê¤ëÀ°¿ôÃͤǤ¢¤ë¡£ */ + e.data = (void *) i; + ep = hsearch(e, ENTER); + /* ¥¨¥é¡¼¤Ïµ¯¤³¤é¤Ê¤¤¤Ï¤º¤Ç¤¢¤ë¡£ */ + if (ep == NULL) { + fprintf(stderr, "entry failed\\n"); + exit(EXIT_FAILURE); + } + } + + for (i = 22; i < 26; i++) { + /* ¥Æ¡¼¥Ö¥ë¤Ë¤¢¤ë 2 ¤Ä¤Î¥¨¥ó¥È¥ê¤òɽ¼¨¤·¡¢ + ¤¢¤È¤Î 2 ¤Ä¤¬¥Æ¡¼¥Ö¥ë¤Ë¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£ */ + e.key = data[i]; + ep = hsearch(e, FIND); + printf("%9.9s \-> %9.9s:%d\\n", e.key, + ep ? ep\->key : "NULL", ep ? (int)(ep\->data) : 0); + } + hdestroy(); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR bsearch (3), +.BR lsearch (3), +.BR malloc (3), +.BR tsearch (3), +.BR feature_test_macros (7) diff --git a/release/man3/hypot.3 b/release/man3/hypot.3 new file mode 100644 index 00000000..038f9c2f --- /dev/null +++ b/release/man3/hypot.3 @@ -0,0 +1,158 @@ +.\" 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-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: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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +hypot, hypotf, hypotl \- ¥æ¡¼¥¯¥ê¥Ã¥Éµ÷Î¥´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double hypot(double " x ", double " y ); +.br +.BI "float hypotf(float " x ", float " y ); +.br +.BI "long double hypotl(long double " x ", long double " y ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR hypot (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR hypotf (), +.BR hypotl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR hypot () +´Ø¿ô¤Ï +.RI sqrt( x * x + y * y ) +¤ÎÃͤòÊÖ¤¹¡£ +¤³¤ì¤Ï +ľ³Ñ¤ò¶´¤à 2 ÊÕ¤ÎŤµ¤¬ +.I x +¤È +.I y +¤Ç¤¢¤ëľ³Ñ»°³Ñ·Á¤Î¼ÐÊÕ¤ÎŤµ¡¢ +¤¹¤Ê¤ï¤Á¡¢¸¶ÅÀ¤ÈÅÀ +.RI ( x , y ) +¤È¤Îµ÷Î¥¤Ç¤¢¤ë¡£ + +·×»»¤ÎÃæ´Ö¥¹¥Æ¥Ã¥×¤Ç¤Ï¡¢É¬Íװʾå¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ä¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¬ +µ¯¤­¤Ê¤¤¤è¤¦¤Ë¤·¤Æ·×»»¤¬¼Â¹Ô¤µ¤ì¤ë¡£ +.\" e.g., hypot(DBL_MIN, DBL_MIN) does the right thing, as does, say +.\" hypot(DBL_MAX/2.0, DBL_MAX/2.0). +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ +ľ³Ñ¤ò¶´¤à 2 ÊÕ¤ÎŤµ¤¬ +.I x +¤È +.I y +¤Ç¤¢¤ëľ³Ñ»°³Ñ·Á¤Î¼ÐÊÕ¤ÎŤµ¤òÊÖ¤¹¡£ + +.I x +¤« +.I y +¤¬Ìµ¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤« +.I y +¤Î°ìÊý¤¬ NaN ¤Ç¡¢¤â¤¦°ìÊý¤¬Ìµ¸ÂÂç¤Ç¤Ê¤¤¾ì¹ç¡¢ +NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.BR HUGE_VAL , +.BR HUGE_VALF , +.B HUGE_VALL +¤òÊÖ¤¹¡£ + +ξÊý¤Î°ú¤­¿ô¤¬ÈóÀµµ¬²½¿ô (subnormal) ¤Ç¡¢·ë²Ì¤âÈóÀµµ¬²½¿ô (subnormal) ¤Î¾ì¹ç¡¢ +.\" Actually, could the result not be subnormal if both arguments +.\" are subnormal? I think not -- mtk, Jul 2008 +ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢Àµ¤·¤¤·ë²Ì¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.\" .I errno +.\" is set to +.\" .BR ERANGE . +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +.IP +¤³¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.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 +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR sqrt (3) diff --git a/release/man3/iconv.3 b/release/man3/iconv.3 new file mode 100644 index 00000000..d6e65e8e --- /dev/null +++ b/release/man3/iconv.3 @@ -0,0 +1,136 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" 2000-06-30 correction by Yuichi SATO +.\" 2000-11-15 aeb, fixed prototype +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated 2000-07-11, Yuichi SATO +.\" Updated 2008-09-14, Akihiro MOTOKI , LDP v3.09 +.\" +.\"WORD: conversion ÊÑ´¹ +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\"WORD: sequence ʸ»úÎó +.\"WORD: +.\" +.TH ICONV 3 2008-09-08 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iconv \- ʸ»ú¥»¥Ã¥ÈÊÑ´¹¤ò¹Ô¤¦ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t iconv(iconv_t " cd , +.BI " char **" inbuf ", size_t *" inbytesleft , +.BI " char **" outbuf ", size_t *" outbytesleft ); +.fi +.SH ÀâÌÀ +°ú¤­¿ô \fIcd\fP ¤Ï¡¢´Ø¿ô +.BR iconv_open (3) +¤ò»È¤Ã¤ÆÀ¸À®¤µ¤ì¤ë +ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +¼ç¤Ë»È¤ï¤ì¤ë¤Î¤Ï¡¢ +¡Ö\fIinbuf\fP ¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä \fI*inbuf\fP ¤¬ NULL ¤Ç¤Ê¤¤¡× +¤È¤¤¤¦¾ì¹ç¤Ç¤¢¤ë¡£ +¤³¤Î¾ì¹ç¡¢ +.BR iconv () +´Ø¿ô¤Ï¡¢ +\fI*inbuf\fP ¤Ç»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò +\fI*outbuf\fP ¤Ç»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£ +\fI*inbuf\fP ¤òÀèƬ¤È¤·¤ÆºÇÂç \fI*inbytesleft\fP ¥Ð¥¤¥È¤¬Æɤ߹þ¤Þ¤ì¡¢ +\fI*outbuf\fP ¤òÀèƬ¤È¤·¤ÆºÇÂç \fI*outbytesleft\fP ¥Ð¥¤¥È¤¬½ñ¤­½Ð¤µ¤ì¤ë¡£ +.PP +.BR iconv () +´Ø¿ô¤Ï 1 ÅÙ¤Ë 1 ¤Ä¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤òÊÑ´¹¤¹¤ë¡£ +¤½¤·¤Æ¡¢³Æʸ»úÊÑ´¹Ëè¤Ë¡¢ÊÑ´¹¤µ¤ì¤¿ÆþÎϥХ¤¥È¤Î¿ô¤À¤± +\fI*inbuf\fP ¤òÁý²Ã¤µ¤»¡¢\fI*inbytesleft\fP ¤ò¸º¾¯¤µ¤»¤ë¡£ +¤Þ¤¿¡¢ÊÑ´¹¤µ¤ì¤¿½ÐÎϥХ¤¥È¤Î¿ô¤À¤± +\fI*outbuf\fP ¤òÁý²Ã¤µ¤»¡¢\fI*outbytesleft\fP ¤ò¸º¾¯¤µ¤»¤ë¡£ +¤µ¤é¤Ë¡¢\fIcd\fP ¤Ë´Þ¤Þ¤ì¤ëÊÑ´¹¾õÂÖ¤ò¹¹¿·¤¹¤ë¡£ +ÆþÎϤÎʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤¬¤¬¾õÂÖ¤ò»ý¤Ä¾ì¹ç¡¢ +.BR iconv () +´Ø¿ô¤ÏÆþÎϥХ¤¥È¤ÎÎó¤ËÂФ·¤ÆÊÑ´¹¤Ë¤âÂбþ¤·¤Æ¤ª¤ê¡¢ +¥Ð¥¤¥È½ÐÎϤòȼ¤ï¤º¤ËÊÑ´¹¾õÂÖ¤ò¹¹¿·¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +ÊÑ´¹¤Ï¡¢¼¡¤Î 4 ¤Ä¤Î¾ì¹ç¤ËÄä»ß¤¹¤ë¡£ +.PP +1. ÆþÎϤË̵¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬤¢¤Ã¤¿¾ì¹ç¡£ +¤³¤Î¾ì¹ç¡¢´Ø¿ô¤Ï \fIerrno\fP ¤ò \fBEILSEQ\fP ¤ËÀßÄꤷ¡¢ +.I (size_t)\ \-1 +¤òÊÖ¤¹¡£ +\fI*inbuf\fP ¤Ï¡¢Ìµ¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ÎÀèƬ¤ò»Ø¤·¤¿¤Þ¤Þ¤Ë¤Ê¤ë¡£ +.PP +2. ÆþÎϥХ¤¥Èʸ»úÎ󤬴°Á´¤ËÊÑ´¹¤µ¤ì¡¢\fI*inbytesleft\fP ¤¬ 0 ¤Ë¤Ê¤Ã¤¿¾ì¹ç¡£ +¤³¤Î¾ì¹ç¡¢ +.BR iconv () +¤Ï¡¢¸Æ½Ð¤·¤Î´Ö¤ËÈó²ÄµÕÊÑ´¹¤¬¹Ô¤ï¤ì¤¿²ó¿ô¤òÊÖ¤¹¡£ +.PP +3. ÆþÎϤËÉÔ´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬤¢¤ê¡¢ +ÆþÎϥХ¤¥Èʸ»úÎ󤬤½¤Î¸å¤Ç½ªÎ»¤·¤Æ¤¤¤ë¾ì¹ç¡£ +¤³¤Î¾ì¹ç¡¢´Ø¿ô¤Ï¡¢\fIerrno\fP ¤ò \fBEINVAL\fP ¤ËÀßÄꤷ¡¢ +.I (size_t)\ \-1 +¤òÊÖ¤¹¡£ +\fI*inbuf\fP ¤Ï¡¢ÉÔ´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ÎÀèƬ¤ò»Ø¤·¤¿¤Þ¤Þ¤Ë¤µ¤ì¤ë¡£ +.PP +4. ½ÐÎϥХåե¡¡¼¤Ë¼¡¤ÎÊÑ´¹¤µ¤ì¤¿Ê¸»úÎó¤Î¤¿¤á¤Î¶õ¤­¤¬¤Ê¤¤¾ì¹ç¡£ +¤³¤Î¾ì¹ç¡¢\fIerrno\fP ¤¬ \fBE2BIG\fP ¤ËÀßÄꤵ¤ì¡¢ +.I (size_t)\ \-1 +¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +Ê̤Υ±¡¼¥¹¤È¤·¤Æ¤Ï¡¢ +¡Ö\fIinbuf\fP ¤¬ NULL¡¢¤Þ¤¿¤Ï \fI*inbuf\fP ¤¬ NULL ¤Ç¤¢¤ë¡£ +¤·¤«¤·¡¢\fIoutbuf\fP ¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä \fI*outbuf\fP ¤¬ NULL ¤Ç¤Ê¤¤¡× +¤È¤¤¤¦¾ì¹ç¤¬¤¢¤ë¡£ +¤³¤Î¾ì¹ç¡¢ +.BR iconv () +´Ø¿ô¤Ï¡¢\fIcd\fP ¤ÎÊÑ´¹¾õÂÖ¤ò½é´ü¾õÂ֤ˤ·¤Æ¡¢ +Âбþ¤¹¤ë¥·¥Õ¥Èʸ»úÎó¤ò \fI*outbuf\fP ¤ËÊݸ¤·¤è¤¦¤È¤¹¤ë¡£ +ºÇÂç \fI*outbytesleft\fP ¥Ð¥¤¥È¤¬¡¢\fI*outbuf\fP ¤ò»Ï¤á¤È¤·¤Æ½ñ¤­½Ð¤µ¤ì¤ë¡£ +¤³¤Î¥ê¥»¥Ã¥È¤µ¤ì¤¿Ê¸»úÎó¤ËÂФ·¤Æ¡¢½ÐÎϥХåե¡¡¼¤Ë¶õ¤­¤¬¤Ê¤¤¾ì¹ç¡¢ +¤³¤Î´Ø¿ô¤Ï \fIerrno\fP ¤ò \fBE2BIG\fP ¤ËÀßÄꤷ¡¢ +.I (size_t)\ \-1 +¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï¡¢½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¤Î¿ô¤À¤± +\fI*outbuf\fP ¤òÁý²Ã¤µ¤»¡¢\fI*outbytesleft\fP ¤ò¸º¾¯¤µ¤»¤ë¡£ +.PP +3 ÈÖÌܤΥ±¡¼¥¹¤·¤Æ¤Ï¡¢ +¡Ö\fIinbuf\fP ¤¬ NULL¡¢¤Þ¤¿¤Ï \fI*inbuf\fP ¤¬ NULL ¤Ç¤¢¤ë¡£ +¤«¤Ä¡¢\fIoutbuf\fP ¤¬ NULL¡¢¤Þ¤¿¤Ï \fI*outbuf\fP ¤¬ NULL ¤Ç¤¢¤ë¡× +¤È¤¤¤¦¾ì¹ç¤¬¤¢¤ë¡£ +¤³¤Î¾ì¹ç¡¢ +.BR iconv () +´Ø¿ô¤Ï¡¢\fIcd\fP ¤ÎÊÑ´¹¾õÂÖ¤ò½é´ü¾õÂ֤ˤ¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR iconv () +´Ø¿ô¤Ï¡¢¸Æ½Ð¤·¤Î´Ö¤ËÈó²ÄµÕ¤ÊÊýË¡¤ÇÊÑ´¹¤µ¤ì¤¿Ê¸»ú¿ô¤òÊÖ¤¹¡£ +¤Ä¤Þ¤ê¡¢²ÄµÕÊÑ´¹¤Ï¥«¥¦¥ó¥È¤µ¤ì¤Ê¤¤¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï \fIerrno\fP ¤òÀßÄꤷ¡¢ +.I (size_t)\ \-1 +¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¾¤Î¤¤¤í¤¤¤í¤Ê¥¨¥é¡¼¤Î¤¦¤Á¤«¤é¡¢°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ê¤¦¤ë¡£ +.TP +.B E2BIG +\fI*outbuf\fP ¤Ë½½Ê¬¤Ê¶õ¤­¤¬¤Ê¤¤¡£ +.TP +.B EILSEQ +ÆþÎϤË̵¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬤¢¤Ã¤¿¡£ +.TP +.B EINVAL +ÆþÎϤËÉÔ´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬤¢¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î´Ø¿ô¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR iconv_close (3), +.BR iconv_open (3) diff --git a/release/man3/iconv_close.3 b/release/man3/iconv_close.3 new file mode 100644 index 00000000..0927d8d9 --- /dev/null +++ b/release/man3/iconv_close.3 @@ -0,0 +1,50 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jul 11 19:02:58 JST 2000 +.\" by Yuichi SATO +.\" +.\"WORD: conversion ÊÑ´¹ +.\"WORD: deallocate ²òÊü¤¹¤ë +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ +.\"WORD: +.\" +.TH ICONV_CLOSE 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iconv_close \- ʸ»ú¥»¥Ã¥ÈÊÑ´¹¤Î¤¿¤á¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤ò²òÊü¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iconv_close(iconv_t " cd ); +.fi +.SH ÀâÌÀ +.BR iconv_close () +´Ø¿ô¤Ï¡¢ +.BR iconv_open (3) +¤ò»È¤Ã¤Æ°ÊÁ°¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ +ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼ \fIcd\fP ¤ò²òÊü¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR iconv_close () +´Ø¿ô¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï +.I errno +¤òÀßÄꤷ \-1 ¤òÊÖ¤¹¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î´Ø¿ô¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +UNIX98, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR iconv (3), +.BR iconv_open (3) diff --git a/release/man3/iconv_open.3 b/release/man3/iconv_open.3 new file mode 100644 index 00000000..0374660f --- /dev/null +++ b/release/man3/iconv_open.3 @@ -0,0 +1,97 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" OpenGroup's Single Unix specification +.\" http://www.UNIX-systems.org/online.html +.\" +.\" 2007-03-31 Bruno Haible, Describe the glibc/libiconv //TRANSLIT +.\" and //IGNORE extensions for 'tocode'. +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jul 11 19:02:58 JST 2000 +.\" by Yuichi SATO +.\" Updated 2007-06-01, Akihiro MOTOKI , LDP v2.50 +.\" +.\"WORD: allocate ³ä¤êÅö¤Æ¤ë +.\"WORD: descriptor ¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD: conversion ÊÑ´¹ +.\"WORD: sequence ʸ»úÎó +.\" +.TH ICONV_OPEN 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iconv_open \- ʸ»ú¥»¥Ã¥ÈÊÑ´¹¤Î¤¿¤á¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò³ä¤êÅö¤Æ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "iconv_t iconv_open(const char *" tocode ", const char *" fromcode ); +.fi +.SH ÀâÌÀ +.BR iconv_open () +´Ø¿ô¤Ï¡¢Ê¸»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥° \fIfromcode\fP ¤«¤é +ʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥° \fItocode\fP ¤Ø¤Î¥Ð¥¤¥Èʸ»úÎóÊÑ´¹¤ËŬ¤·¤¿ +ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò³ä¤êÅö¤Æ¤ë¡£ +.PP +\fIfromcode\fP ¤È \fItocode\fP ¤Ë»È¤¦¤³¤È¤Î¤Ç¤­¤ëÃͤȡ¢ +¥µ¥Ý¡¼¥È¤µ¤ì¤ëÁȤ߹ç¤ï¤»¤Ï¡¢¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¡£ +GNU C ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢»È¤¦¤³¤È¤Î¤Ç¤­¤ëÃÍ¤Ï +\fBiconv \-\-list\fP ¥³¥Þ¥ó¥É¤Ç¥ê¥¹¥È¤µ¤ì¡¢ +¥ê¥¹¥È¤µ¤ì¤¿¤¹¤Ù¤Æ¤ÎÃͤÎÁȤ߹ç¤ï¤»¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤ë¡£ +¤µ¤é¤Ë¡¢ GNU C ¥é¥¤¥Ö¥é¥ê¤È GNU libiconv ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢ +°Ê²¼¤ÎÀÜÈø¼­¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +//TRANSLIT +\fItocode\fP ¤Î¸å¤í¤Ëʸ»úÎó "//TRANSLIT" ¤¬ÉÕ¤¤¤Æ¤¤¤ë¾ì¹ç¡¢ +ËÝÌõ (transliteration) ¤¬Í­¸ú¤Ë¤Ê¤ë¡£¤³¤Î¾ì¹ç¡¢ +ÊÑ´¹Àè¤Îʸ»ú¥»¥Ã¥È¤Çɽ¸½¤Ç¤­¤Ê¤¤Ê¸»ú¤ò¡¢¤½¤Îʸ»ú¤ÈƱ¤¸¤è¤¦¤Ë¸«¤¨¤ë +ʸ»ú (Ê£¿ôʸ»ú¤Î¾ì¹ç¤â¤¢¤ë) ¤Çɽ¸½¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +//IGNORE +\fItocode\fP ¤Î¸å¤í¤Ëʸ»úÎó "//IGNORE" ¤¬ÉÕ¤¤¤Æ¤¤¤ë¾ì¹ç¡¢ +ÊÑ´¹Àè¤Îʸ»ú¥»¥Ã¥È¤Çɽ¸½¤Ç¤­¤Ê¤¤Ê¸»ú¤ÏÌۤäÆ̵»ë¤µ¤ì¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤òÆɤó¤ÇÆÀ¤é¤ì¤¿ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢ +.BR iconv (3) +¤Ç +²¿Å٤Ǥâ»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ï +.BR iconv_close (3) +¤ò»È¤Ã¤Æ²òÊü¤µ¤ì¤ë¤Þ¤ÇÍ­¸ú¤Ç¤¢¤ë¡£ +.PP +ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÊÑ´¹¾õÂÖ¤ò»ý¤Ä¡£ +.BR iconv_open () +¤òÍѤ¤¤ÆÀ¸À®¤µ¤ì¤¿¸å¡¢ÊÑ´¹¾õÂ֤Ͻé´ü¾õÂ֤Ǥ¢¤ë¡£ +.BR iconv (3) +¤ò»È¤¦¤³¤È¤Ë¤è¤ê¡¢¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÊÑ´¹¾õÂÖ¤¬Êѹ¹¤µ¤ì¤ë¡£ +(ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Ç +Ʊ»þ¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤Ê¤¤¤³¤È¤ò°ÕÌ£¤·¤Æ¤¤¤ë¡£) +ÊÑ´¹¾õÂÖ¤ò½é´ü¾õÂÖ¤ËÌ᤹¤Ë¤Ï¡¢ +\fIinbuf\fP °ú¤­¿ô¤ò NULL ¤È¤·¤Æ +.BR iconv (3) +¤òÍѤ¤¤ë¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR iconv_open () +´Ø¿ô¤Ï¡¢¿·¤¿¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï \fIerrno\fP ¤òÀßÄꤷ¡¢ +.I (iconv_t)\ \-1 +¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¾¤Î¤¤¤í¤¤¤í¤Ê¥¨¥é¡¼¤Î¤¦¤Á¡¢°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ê¤¦¤ë¡£ +.TP +.B EINVAL +\fIfromcode\fP ¤«¤é \fItocode\fP ¤Ø¤ÎÊÑ´¹¤Ï¡¢¤³¤Î¼ÂÁõ¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î´Ø¿ô¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +UNIX98, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR iconv (1), +.BR iconv (3), +.BR iconv_close (3) diff --git a/release/man3/ilogb.3 b/release/man3/ilogb.3 new file mode 100644 index 00000000..adcd2e50 --- /dev/null +++ b/release/man3/ilogb.3 @@ -0,0 +1,142 @@ +.\" 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. +.\" +.\" 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 2009-02-04 "" "Linux Programmer's Manual" +.SH ̾Á° +ilogb, ilogbf, ilogbl \- ÉâÆ°¾®¿ôÅÀ¿ô¤Î»Ø¿ôÉô¤òÀ°¿ô¤È¤·¤Æ¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int ilogb(double " x ); +.br +.BI "int ilogbf(float " x ); +.br +.BI "int ilogbl(long double " x ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR ilogb (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR ilogbf (), +.BR ilogbl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï°ú¤­¿ô¤Î»Ø¿ôÉô¤òÉä¹æÉÕ¤­À°¿ô¤È¤·¤ÆÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢Âбþ¤¹¤ë +.BR logb (3) +´Ø¿ô¤ò +.I int +¤Ç¥­¥ã¥¹¥È¤·¤¿¤â¤Î¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤Î»Ø¿ôÉô¤òÉä¹æÉÕ¤­À°¿ô¤È¤·¤ÆÊÖ¤¹¡£ + +.\" the POSIX.1 spec for logb() says logb() gives pole error for this +.\" case, but for ilogb() it says domain error. +.\" glibc: The numeric value is either `INT_MIN' or `-INT_MAX'. +.I x +¤¬¥¼¥í¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ +.B FP_ILOGB0 +¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\" 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 +¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Éé¤Î̵¸ÂÂ礫Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ +.B INT_MAX +¤¬ÊÖ¤µ¤ì¤ë¡£ +.\" +.\" POSIX.1-2001 also says: +.\" If the correct value is greater than {INT_MAX}, {INT_MAX} +.\" shall be returned and a domain error shall occur. +.\" +.\" If the correct value is less than {INT_MIN}, {INT_MIN} +.\" shall be returned and a domain error shall occur. +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼: \fIx\fP ¤¬ 0 ¤« NaN +.\" .I errno +.\" is set to +.\" .BR EDOM . +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.IP +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤³¤Î¾õ¶·¤Ç +.I errno +¤òÀßÄꤷ¤Ê¤¤¡£ +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6794 +.TP +Îΰ襨¥é¡¼: \fIx\fP ¤¬Ìµ¸ÂÂç +.\" .I errno +.\" is set to +.\" .BR EDOM . +.\" An invalid floating-point exception +.\" .RB ( FE_INVALID ) +.\" is raised. +.IP +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤³¤Î¾õ¶·¤Ç +.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 +.SH ½àµò +C99, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR log (3), +.BR logb (3), +.BR significand (3) diff --git a/release/man3/index.3 b/release/man3/index.3 new file mode 100644 index 00000000..ebbce0be --- /dev/null +++ b/release/man3/index.3 @@ -0,0 +1,82 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Fri Dec 12 12:41:35 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. +.\" +.\" 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 Mon Apr 12 12:54:34 1993, David Metcalfe +.\" Modified Sat Jul 24 19:13:52 1993, Rik Faith (faith@cs.unc.edu) +.TH INDEX 3 2009-03-15 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +index, rindex \- ʸ»úÎóÃæ¤Îʸ»ú¤Î°ÌÃÖ¤ò¼¨¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *index(const char *" s ", int " c ); +.sp +.BI "char *rindex(const char *" s ", int " c ); +.fi +.SH ÀâÌÀ +.BR index () +´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP Ãæ¤ËºÇ½é¤Ëʸ»ú \fIc\fP ¤¬ +¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.BR rindex () +´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP Ãæ¤ËºÇ¸å¤Ëʸ»ú \fIc\fP ¤¬ +¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +ʸ»úÎó¤ò½ªÃ¼¤¹¤ë NULL ʸ»ú¤Ï¡¢Ê¸»úÎó¤Î°ìÉô¤È¤ß¤Ê¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR index () +¤È +.BR rindex () +´Ø¿ô¤Ï¡¢°ìÃפ·¤¿Ê¸»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤«¡¢ +¤â¤·Ê¸»ú¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.SH ½àµò +4.3BSD; +POSIX.1-2001 ¤Ç¤Ï¡Ö²áµî¤Î̾»Ä (LEGACY)¡×¤È°ÌÃÖÉÕ¤±¤é¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2008 ¤Ç¤Ï +.BR index () +¤È +.BR rindex () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +Âå¤ï¤ê¤Ë¡¢ +.BR strchr (3) +¤È +.BR strrchr (3) +¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR memchr (3), +.BR strchr (3), +.BR strpbrk (3), +.BR strrchr (3), +.BR strsep (3), +.BR strspn (3), +.BR strstr (3), +.BR strtok (3) diff --git a/release/man3/inet.3 b/release/man3/inet.3 new file mode 100644 index 00000000..38e814a3 --- /dev/null +++ b/release/man3/inet.3 @@ -0,0 +1,304 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" libc.info (from glibc distribution) +.\" Modified Sat Jul 24 19:12:00 1993 by Rik Faith +.\" Modified Sun Sep 3 20:29:36 1995 by Jim Van Zandt +.\" Changed network into host byte order (for inet_network), +.\" Andreas Jaeger , 980130. +.\" 2008-06-19, mtk +.\" Describe the various address forms supported by inet_aton(). +.\" Clarify discussion of inet_lnaof(), inet_netof(), and inet_makeaddr(). +.\" Add discussion of Classful Addressing, noting that it is obsolete. +.\" Added an EXAMPLE program. +.\" +.\" Japanese Version Copyright (c) 1998 Ueyama Rui +.\" all rights reserved. +.\" Translated 1998-05-23, Ueyama Rui +.\" Updated & Modefied 1999-02-26, Shouichi Saito +.\" Updated 1999-12-26, Kentaro Shirakata +.\" Updated 2005-10-04, Kentaro Shirakata +.\" Updated 2007-05-01, Akihiro MOTOKI , LDP v2.46 +.\" Updated 2008-08-13, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: numbers-and-dots notation ¿ôÃͤȥɥåȤˤè¤ëµ­Ë¡ +.\"WORD: dotted-decimal notation ¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ôµ­Ë¡ +.\"WORD: feature test macro µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\" +.TH INET 3 2008-06-19 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +inet_aton, inet_addr, inet_network, inet_ntoa, inet_makeaddr, inet_lnaof, +inet_netof \- ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹Áàºî¥ë¡¼¥Á¥ó +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int inet_aton(const char *" cp ", struct in_addr *" inp ); +.sp +.BI "in_addr_t inet_addr(const char *" cp ); +.sp +.BI "in_addr_t inet_network(const char *" cp ); +.sp +.BI "char *inet_ntoa(struct in_addr " in ); +.sp +.BI "struct in_addr inet_makeaddr(int " net ", int " host ); +.sp +.BI "in_addr_t inet_lnaof(struct in_addr " in ); +.sp +.BI "in_addr_t inet_netof(struct in_addr " in ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR inet_aton (), +.BR inet_ntoa (): +_BSD_SOURCE || _SVID_SOURCE +.SH ÀâÌÀ +.BR inet_aton () +¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Û¥¹¥È¤Î¥¢¥É¥ì¥¹ \fIcp\fP ¤ò¡¢ +IPv4 ¤Î¿ôÃͤȥɥåȤˤè¤ëɽµ­¤«¤é (¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Î) ¥Ð¥¤¥Ê¥êÃÍ¤Ø +ÊÑ´¹¤·¡¢ÊÑ´¹·ë²Ì¤ò \fIinp\fP ¤¬»Ø¤·¤Æ¤¤¤ë¹½Â¤ÂΤ˳ÊǼ¤¹¤ë¡£ +¥¢¥É¥ì¥¹¤¬Í­¸ú¤Ê¾ì¹ç 0 °Ê³°¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.I cp +¤ÇÅϤ¹¥¢¥É¥ì¥¹¤È¤·¤Æ¡¢°Ê²¼¤Î·Á¼°¤òÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 10 +.I a.b.c.d +4 ¤Ä¤Î¿ô»ú¤Î¤½¤ì¤¾¤ì¤Ï¥¢¥É¥ì¥¹¤Î³Æ¥Ð¥¤¥È¤ò¼¨¤¹¡£ +¤³¤ì¤é¤Î¥Ð¥¤¥È¤Ïº¸¤«¤é±¦¤Î½ç½ø¤Ç¥Ð¥¤¥Ê¥ê¥¢¥É¥ì¥¹¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +.TP +.I a.b.c +.I a +¤È +.I b +¤Ï¥Ð¥¤¥Ê¥ê¥¢¥É¥ì¥¹¤ÎºÇ½é¤Î 2 ¥Ð¥¤¥È¤ò¼¨¤¹¡£ +.I c +¤Ï 16 ¥Ó¥Ã¥ÈÃͤȲò¼á¤µ¤ì¡¢¥Ð¥¤¥Ê¥ê¥¢¥É¥ì¥¹¤Î±¦Â¦¤Î 2 ¥Ð¥¤¥È¤òɽ¤¹¡£ +¤³¤Îɽµ­¤Ï¡¢(²áµî¤Î¤â¤Î¤È¤Ê¤Ã¤¿) ¥¯¥é¥¹ B ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ò +»ØÄꤹ¤ë¤Î¤ËŬ¤·¤Æ¤¤¤ë¡£ +.TP +.I a.b +.I a +¤Ï¥Ð¥¤¥Ê¥ê¥¢¥É¥ì¥¹¤ÎºÇ½é¤Î¥Ð¥¤¥È¤ò¼¨¤¹¡£ +.I b +¤Ï 24 ¥Ó¥Ã¥ÈÃͤȲò¼á¤µ¤ì¡¢¥Ð¥¤¥Ê¥ê¥¢¥É¥ì¥¹¤Î±¦Â¦¤Î 3 ¥Ð¥¤¥È¤òɽ¤¹¡£ +¤³¤Îɽµ­¤Ï¡¢(²áµî¤Î¤â¤Î¤È¤Ê¤Ã¤¿) ¥¯¥é¥¹ C ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ò +»ØÄꤹ¤ë¤Î¤ËŬ¤·¤Æ¤¤¤ë¡£ +.TP +.I a +ÃÍ +.I a +¤Ï 32 ¥Ó¥Ã¥ÈÃͤȲò¼á¤µ¤ì¡¢¥Ð¥¤¥È¤ÎºÆÇÛÃ֤ϹԤï¤ì¤º¡¢ +¤½¤Î¤Þ¤Þ¥Ð¥¤¥Ê¥ê¥¢¥É¥ì¥¹¤È¤·¤Æ³ÊǼ¤µ¤ì¤ë¡£ +.PP +¾åµ­¤ÎÁ´¤Æ¤Î·Á¼°¤Ç¡¢¥É¥Ã¥È¶èÀÚ¤ê¤Î¥¢¥É¥ì¥¹¤Î³ÆÍ×ÁǤϡ¢10 ¿Ê¿ô¡¢ +8 ¿Ê¿ô (ÀèƬ¤Ë +.I 0 +¤òÉÕ¤±¤ë)¡¢ +16 ¿Ê¿ô (ÀèƬ¤Ë +.I 0X +¤òÉÕ¤±¤ë) ¤Ç»ØÄê¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î·Á¼°¤Î¥¢¥É¥ì¥¹¤ò¤Þ¤È¤á¤Æ +.I "IPv4 ¤Î¿ôÃͤȥɥåȤˤè¤ëɽµ­ (IPv4 numbers-and-dots notation)" +¤È¸Æ¤Ö¡£ +¤Þ¤¿¡¢10 ¿Ê¿ô 4 ¤Ä¤À¤±¤ò»È¤Ã¤¿·Á¼°¤ò +.I "IPv4 ¤Î¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ôɽµ­ (IPv4 dotted-decimal notation)" +¤È¸Æ¤Ö +.RI ( "IPv4 ¤Î¥É¥Ã¥È¶èÀÚ¤ê 4 ʬ³äɽµ­ (IPv4 dotted-decimal notation)" +¤È¸Æ¤Ö¤³¤È¤â¤¢¤ë)¡£ +.PP +.BR inet_addr () +´Ø¿ô¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Û¥¹¥È¤Î¥¢¥É¥ì¥¹ \fIcp\fP ¤ò¡¢ +IPv4 ¤Î¿ôÃͤȥɥåȤˤè¤ëɽµ­¤«¤é¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤Î +¥Ð¥¤¥Ê¥êÃͤØÊÑ´¹¤·¤ÆÊÖ¤¹¡£ +ÆþÎϤ¬ÉÔÀµ¤Ê¾ì¹ç¡¢ +.B INADDR_NONE +(ÉáÄÌ¤Ï \-1) ¤òÊÖ¤¹¡£ +\-1 ¤ÏÍ­¸ú¤Ê¥¢¥É¥ì¥¹ (255.255.255.255) ¤Ê¤Î¤Ç¡¢¤³¤Î´Ø¿ô¤ò»È¤¦¤È +ÌäÂê¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤ò»È¤¦¤Î¤ÏÈò¤±¡¢Âå¤ï¤ê¤Ë +.BR inet_aton (), +.BR inet_pton (3), +.BR getaddrinfo (3) +¤ò»È¤¦¤Î¤¬¤è¤¤¡£ +¤³¤ì¤é¤Î´Ø¿ô¤ÎÊý¤¬¡¢¥¨¥é¡¼¤ÎÄÌÃΤ¬¤è¤ê¤­¤ì¤¤¤ÊÊýË¡¤Ç¹Ô¤ï¤ì¤ë¡£ +.PP +.BR inet_network () +´Ø¿ô¤Ï¡¢ +IPv4 ¤Î¿ôÃͤȥɥåȤˤè¤ëɽµ­¤Îʸ»úÎó \fIcp\fP ¤ò¡¢ +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹¤È¤·¤Æ¤Î»ÈÍѤËŬ¤·¤¿ +¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¤Î¿ôÃͤËÊÑ´¹¤¹¤ë¡£ +À®¸ù¤¹¤ë¤È¡¢ÊÑ´¹¤µ¤ì¤¿¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£ +ÆþÎϤ¬ÉÔÀµ¤Ê¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.PP +.BR inet_ntoa () +´Ø¿ô¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤ÇÅϤµ¤ì¤¿¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Û¥¹¥È¥¢¥É¥ì¥¹ +\fIin\fP ¤ò¡¢ IPv4 ¤Î¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ôɽµ­¤Îʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£ +ʸ»úÎó¤ÏÀÅŪ¤Ë³äÅö¤Æ¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¤Î¤Ç¡¢ +¤³¤Î¸å¤Ç¤³¤Î´Ø¿ô¤òºÆÅٸƤӽФ¹¤Èʸ»úÎó¤Ï¾å½ñ¤­¤µ¤ì¤ë¡£ +.PP +.BR inet_lnaof () +´Ø¿ô¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹ \fIin\fP ¤Î¥í¡¼¥«¥ë¥Í¥Ã¥È¥ï¡¼¥¯Éôʬ¤òÊÖ¤¹¡£ +¤³¤ÎÊÖ¤êÃͤϥۥ¹¥È¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤¢¤ë¡£ +.PP +.BR inet_netof () +´Ø¿ô¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹ \fIin\fP ¤Î¥Í¥Ã¥È¥ï¡¼¥¯Éôʬ¤òÊÖ¤¹¡£ +¤³¤ÎÊÖ¤êÃͤϥۥ¹¥È¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤¢¤ë¡£ +.PP +.BR inet_makeaddr () +´Ø¿ô¤Ï +.BR inet_netof () +¤È +.BR inet_lnaof () +¤ÎµÕ¤Îµ¡Ç½¤ò»ý¤Ä¡£ +¥Í¥Ã¥È¥ï¡¼¥¯ÈÖ¹æ \fInet\fP ¤È¡¢¥í¡¼¥«¥ë¥¢¥É¥ì¥¹ \fIhost\fP ¤ò +ÁȤ߹ç¤ï¤»¤ÆÀ¸À®¤·¤¿¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Û¥¹¥È¥¢¥É¥ì¥¹¤ò +¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤ÇÊÖ¤¹¡£ +\fIhost\fP, \fInet\fP ¤Ï¤È¤â¤Ë¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤¢¤ë¡£ +.PP +.BR inet_ntoa (), +.BR inet_makeaddr (), +.BR inet_lnaof (), +.BR inet_netof () +¤Ç»ÈÍѤ¹¤ë¹½Â¤ÂÎ \fIin_addr\fP ¤Ï +.I +¤Ç¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +typedef uint32_t in_addr_t; + +struct in_addr { + in_addr_t s_addr; +}; +.fi +.in +.SH ½àµò +4.3BSD. +.BR inet_addr (), +.BR inet_ntoa () +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.BR inet_aton () +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +i386 ¤Ç¤Ï¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¤Ï Least Significant Byte (LSB) first +(¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó) ¤À¤¬¡¢ +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ç»È¤ï¤ì¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Ï +Most Significant Byte (MSB) first (¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó) +¤Ç¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ + +.BR inet_lnaof (), +.BR inet_netof (), +.BR inet_makeaddr () +¤Ï²áµî¤Î̾»Ä¤Ç¤¢¤ê¡¢ÅϤµ¤ì¤¿¥¢¥É¥ì¥¹¤¬ +.I "¥¯¥é¥¹¥Õ¥ë¡¦¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹ (classful network addresses)" +¤Ç¤¢¤ë¤È²¾Äꤷ¤Æ½èÍý¤ò¹Ô¤¦¡£ +¥¯¥é¥¹¥Õ¥ë¡¦¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ç¤Ï¡¢°Ê²¼¤Ë¤¢¤ë¤è¤¦¤Ë¡¢ +IPv4 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ò¥Ð¥¤¥È¶­³¦¤Ç¥Í¥Ã¥È¥ï¡¼¥¯Éô¤È¥Û¥¹¥ÈÉô¤Ëʬ³ä¤¹¤ë¡£ +.TP 10 +Class A +(¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Î) ¥¢¥É¥ì¥¹¤ÎºÇ¾å°Ì¥Ó¥Ã¥È¤¬ 0 ¤Î¾ì¹ç¡¢ +¤³¤Î¥¢¥É¥ì¥¹¼ïÊ̤Ȥʤ롣¤³¤Î¥¢¥É¥ì¥¹¼ïÊ̤Ǥϡ¢ +ºÇ¾å°Ì¥Ð¥¤¥È¤¬¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤òɽ¤·¡¢ +»Ä¤ê¤Î 3 ¥Ð¥¤¥È¤¬¥Û¥¹¥È¥¢¥É¥ì¥¹¤òɽ¤¹¡£ +.TP +Class B +(¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Î) ¥¢¥É¥ì¥¹¤Î¾å°Ì¦ 2 ¥Ó¥Ã¥È¤¬¥Ð¥¤¥Ê¥êÃÍ¤Ç +10 ¤Î¾ì¹ç¡¢¤³¤Î¥¢¥É¥ì¥¹¼ïÊ̤Ȥʤ롣¤³¤Î¥¢¥É¥ì¥¹¼ïÊ̤Ǥϡ¢ +¾å°Ì 2 ¥Ð¥¤¥È¤¬¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤òɽ¤·¡¢ +»Ä¤ê¤Î 2 ¥Ð¥¤¥È¤¬¥Û¥¹¥È¥¢¥É¥ì¥¹¤òɽ¤¹¡£ +.TP +Class C +(¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Î) ¥¢¥É¥ì¥¹¤Î¾å°Ì¦ 3 ¥Ó¥Ã¥È¤¬¥Ð¥¤¥Ê¥êÃÍ¤Ç +110 ¤Î¾ì¹ç¡¢¤³¤Î¥¢¥É¥ì¥¹¼ïÊ̤Ȥʤ롣¤³¤Î¥¢¥É¥ì¥¹¼ïÊ̤Ǥϡ¢ +¾å°Ì 3 ¥Ð¥¤¥È¤¬¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤òɽ¤·¡¢ +»Ä¤ê¤Î 1 ¥Ð¥¤¥È¤¬¥Û¥¹¥È¥¢¥É¥ì¥¹¤òɽ¤¹¡£ +.PP +¥¯¥é¥¹¥Õ¥ë¡¦¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ï¸½ºß¤Ç¤ÏÇѻߤµ¤ì¡¢ +¥¯¥é¥¹¥ì¥¹¡¦¥É¥á¥¤¥ó´Ö¥ë¡¼¥Á¥ó (CIDR) ¤Ë¼è¤Ã¤ÆÂå¤ï¤é¤ì¤¿¡£ +CIDR ¤Ç¤Ï¡¢¥¢¥É¥ì¥¹¤òǤ°Õ¤Î¥Ó¥Ã¥È¶­³¦ (¥Ð¥¤¥È¶­³¦¤Ç¤Ï¤Ê¤¤) ¤Ç +¥Í¥Ã¥È¥ï¡¼¥¯Éô¤È¥Û¥¹¥ÈÉô¤Ëʬ³ä¤¹¤ë¡£ +.SH Îã +°Ê²¼¤Ï +.BR inet_aton () +¤È +.BR inet_ntoa () +¤Î»ÈÍÑÎã¤Ç¤¢¤ë¡£¤³¤Î¤è¤¦¤Ë¼Â¹Ô¤¹¤ë¡£ +.in +4n +.nf + +.RB "$" " ./a.out 226.000.000.037" " # Last byte is in octal" +226.0.0.31 +.RB "$" " ./a.out 0x7f.1 " " # First byte is in hex" +127.0.0.1 +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#define _BSD_SOURCE +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct in_addr addr; + + if (argc != 2) { + fprintf(stderr, "%s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + if (inet_aton(argv[1], &addr) == 0) { + perror("inet_aton"); + exit(EXIT_FAILURE); + } + + printf("%s\\n", inet_ntoa(addr)); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR byteorder (3), +.BR getaddrinfo (3), +.BR gethostbyname (3), +.BR getnameinfo (3), +.BR getnetent (3), +.BR inet_ntop (3), +.BR inet_pton (3), +.BR hosts (5), +.BR networks (5) diff --git a/release/man3/inet_ntop.3 b/release/man3/inet_ntop.3 new file mode 100644 index 00000000..c1474f95 --- /dev/null +++ b/release/man3/inet_ntop.3 @@ -0,0 +1,137 @@ +.\" Copyright 2000 Sam Varshavchik +.\" +.\" 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: RFC 2553 +.\" +.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. +.\" Translated 2001-01-14, NAKANO Takeo +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" +.TH INET_NTOP 3 2008-11-11 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +inet_ntop \- IPv4/IPv6 ¥¢¥É¥ì¥¹¤ò¥Ð¥¤¥Ê¥ê·Á¼°¤«¤é¥Æ¥­¥¹¥È·Á¼°¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "const char *inet_ntop(int " "af" ", const void *" "src" , +.BI " char *" "dst" ", socklen_t " "size" ); +.fi +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤Ï¡¢ +.I af +¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¹½Â¤ÂÎ +.I src +¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£ +ÊÑ´¹·ë²Ì¤Îʸ»úÎó¤Ï¡¢ +.I dst +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ +.I dst +¤Ï NULL ¤Ç¤Ê¤¤¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¸Æ¤Ó½Ð¤·»þ¤Ë¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡¤ÇÍøÍѤǤ­¤ë¥Ð¥¤¥È¿ô¤ò +°ú¤­¿ô +.I size +¤Ë»ØÄꤹ¤ë¡£ +.PP +.BR inet_ntop () +¤Ï +.BR inet_ntoa (3) +´Ø¿ô¤ò³ÈÄ¥¤·¤ÆÊ£¿ô¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤ò°·¤¨¤ë¤è¤¦¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +º£¸å¤Ï +.BR inet_ntoa (3) +¤Ï»È¤ï¤º¡¢ +.BR inet_ntop () +¤ò»È¤¦¤è¤¦¤Ë¤¹¤ë¤ÈÎɤ¤¤À¤í¤¦¡£ +¸½ºß¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ï°Ê²¼¤ÎÄ̤ê: +.TP +.B AF_INET +¤³¤Î¾ì¹ç +.I src +¤Ï (¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Î) +.I "struct in_addr" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤ß¤Ê¤µ¤ì¡¢¤³¤Î¹½Â¤ÂΤÎÆâÍƤ¬ +¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ô·Á¼° "\fIddd.ddd.ddd.ddd\fP" ¤Î +IPv4 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ËÊÑ´¹¤µ¤ì¤ë¡£ +¥Ð¥Ã¥Õ¥¡ +.I dst +¤Ï¾¯¤Ê¤¯¤È¤â +.B INET_ADDRSTRLEN +¥Ð¥¤¥È¤ÎŤµ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B AF_INET6 +¤³¤Î¾ì¹ç +.I src +¤Ï (¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Î) +.I "struct in6_addr" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤ß¤Ê¤µ¤ì¡¢¤³¤Î¹½Â¤ÂΤÎÆâÍƤ¬¡¢ +(¤³¤Î¥¢¥É¥ì¥¹¤ËÂФ·¤Æ¤â¤Ã¤È¤âŬÀÚ¤Ê) +IPv6 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Îɽ¼¨·Á¼°¤ËÊÑ´¹¤µ¤ì¤ë¡£ +¥Ð¥Ã¥Õ¥¡ +.I dst +¤Ï¾¯¤Ê¤¯¤È¤â +.B INET6_ADDRSTRLEN +¥Ð¥¤¥È¤ÎŤµ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR inet_ntop () +¤Ï +.I dst +¤Ø¤Î (NULL ¤Ç¤Ê¤¤) ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAFNOSUPPORT +.I af +¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ç¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOSPC +ÊÑ´¹¤µ¤ì¤¿¥¢¥É¥ì¥¹Ê¸»úÎó¤ÎŤµ¤¬ +.I size +¤Ç»ØÄꤵ¤ì¤¿¥µ¥¤¥º¤òĶ²á¤·¤Æ¤·¤Þ¤¦¡£ +.SH ½àµò +POSIX.1-2001. +RFC\ 2553 ¤Ç¤ÏºÇ¸å¤Î°ú¤­¿ô +.I size +¤Î¥×¥í¥È¥¿¥¤¥×¤ò +.I size_t +·¿¤ÈÄêµÁ¤·¤Æ¤¤¤ë¡£Â¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï RFC\ 2553 ¤Ë¤·¤¿¤¬¤Ã¤Æ¤¤¤ë¡£ +glibc 2.0 ¤È 2.1 ¤Ç¤Ï +.I size_t +¤À¤¬¡¢ +glibc 2.2 °Ê¹ß¤Ç¤Ï +.I socklen_t +¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" 2.1.3: size_t, 2.1.91: socklen_t +.SH ¥Ð¥° +.B AF_INET6 +¤Ï IPv4 ¤¬¥Þ¥Ã¥×¤µ¤ì¤¿ IPv6 ¥¢¥É¥ì¥¹¤ò +IPv6 ·Á¼°¤ËÊÑ´¹¤·¤Æ¤·¤Þ¤¦¡£ +.SH Îã +.BR inet_pton (3) +¤ò»²¾È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getnameinfo (3), +.BR inet (3), +.BR inet_pton (3) diff --git a/release/man3/inet_pton.3 b/release/man3/inet_pton.3 new file mode 100644 index 00000000..ca0d3afa --- /dev/null +++ b/release/man3/inet_pton.3 @@ -0,0 +1,229 @@ +.\" Copyright 2000 Sam Varshavchik +.\" 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: RFC 2553 +.\" +.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. +.\" Translated 2001-01-14, NAKANO Takeo +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" +.TH INET_PTON 3 2008-06-18 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +inet_pton \- IPv4/IPv6 ¥¢¥É¥ì¥¹¤ò¥Æ¥­¥¹¥È·Á¼°¤«¤é¥Ð¥¤¥Ê¥ê·Á¼°¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include + +.BI "int inet_pton(int " "af" ", const char *" "src" ", void *" "dst" ); +.fi +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤Ïʸ»úÎó +.I src +¤ò¡¢¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼ +.I af +¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¹½Â¤ÂΤËÊÑ´¹¤·¡¢ +.I dst +¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +.I af +°ú¤­¿ô¤Ï +.B AF_INET +¤« +.B AF_INET6 +¤Î¤É¤Á¤é¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +¸½ºß¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.TP +.B AF_INET +.I src +¤Ï¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ô·Á¼° "\fIddd.ddd.ddd.ddd\fP" +¤Î IPv4 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I ddd +¤Ï 0 ¤«¤é 255 ¤Þ¤Ç¤ÎÈϰϤκÇÂç 3 ·å¤Î 10 ¿Ê¿ô¤Ç¤¢¤ë¡£ +¤³¤Î¥¢¥É¥ì¥¹¤Ï +.I "struct in_addr" +¤ËÊÑ´¹¤µ¤ì¤Æ +.I dst +¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ +.I dst +¤ÎŤµ¤Ï +.I "sizeof(struct in_addr)" +(4) ¥Ð¥¤¥È (32¥Ó¥Ã¥È) ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B AF_INET6 +.I src +¤Ï IPv6 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬³ÊǼ¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤³¤Î¥¢¥É¥ì¥¹¤Ï +.I "struct in6_addr" +¤ËÊÑ´¹¤µ¤ì¤Æ +.I dst +¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ +.I dst +¤ÎŤµ¤Ï +.I "sizeof(struct in6_addr)" +(16) ¥Ð¥¤¥È (128 ¥Ó¥Ã¥È) ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +°Ê²¼¤Î 3 ¤Ä¤Î¥ë¡¼¥ë¤Ë¤·¤¿¤¬¤Ã¤¿·Á¼°¤¬ IPv6 ¥¢¥É¥ì¥¹¤È¤·¤ÆÆþÎϤǤ­¤ë¡£ +.RS +.IP 1. 3 +¿ä¾©·Á¼°¤Ï +.I x:x:x:x:x:x:x:x +¤Ç¤¢¤ë¡£¤³¤Î·Á¼°¤Ï 8 ¸Ä¤Î 16 ¿Ê¿ô¤«¤é¹½À®¤µ¤ì¡¢ +³Æ¡¹¤Î 16 ¿Ê¿ô¤Ï 16 ¥Ó¥Ã¥ÈÃͤòɽ¤¹ +.RI ( x +¤ÏºÇÂç 4 ·å¤Î 16 ¿Ê¿ô¤Ç¤¢¤ë)¡£ +.IP 2. +¿ä¾©·Á¼°¤ÎÃæ¤ÎϢ³¤¹¤ë 0 ¤ÎÎó¤Ï +.I :: +¤Ëû½Ì¤Ç¤­¤ë¡£¥¢¥É¥ì¥¹Ãæ¤Ç»ÈÍѤǤ­¤ë +.I :: +¤Ï 1 ¸Ä¤À¤±¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢¥ë¡¼¥×¥Ð¥Ã¥¯¥¢¥É¥ì¥¹ +.I 0:0:0:0:0:0:0:1 +¤Ï +.I ::1 +¤Èû½Ì¤Ç¤­¤ë¡£ +Á´¥Ó¥Ã¥È¤¬ 0 ¤Ç¹½À®¤µ¤ì¤ë¥ï¥¤¥ë¥É¥«¡¼¥É¥¢¥É¥ì¥¹¤Ï +.I :: +¤Èµ­ºÜ¤Ç¤­¤ë¡£ +.IP 3. +IPv4 ¤ò¥Þ¥Ã¥Ô¥ó¥°¤·¤¿ IPv6 ¥¢¥É¥ì¥¹¤òɽµ­¤¹¤ë¤Ë¤ÏÊ̤ηÁ¼°¤¬ÊØÍø¤Ç¤¢¤ë¡£ +¤³¤ÎÊ̤ηÁ¼°¤Ï +.I x:x:x:x:x:x:d.d.d.d +¤È½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ +ºÇ½é¤Î 6 ¸Ä¤Î +.I x +¤Ï¥¢¥É¥ì¥¹¤ò 16 ¥Ó¥Ã¥Èñ°Ì¤Ë¶èÀڤ俤Ȥ­¤Î¾å°Ì¦ 6 ¸Äʬ (¤Ä¤Þ¤ê 96 ¥Ó¥Ã¥Èʬ) +¤òÄêµÁ¤¹¤ë 16 ¿Ê¿ô¤Ç¤¢¤ê¡¢ +.I d +¤ÎÉôʬ¤Ï¥¢¥É¥ì¥¹¤Î²¼°Ì 32 ¥Ó¥Ã¥È¤ò¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ôɽµ­¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.I ::FFFF:204.152.189.116 +¤Ï¤³¤Î·Á¼°¤ÎÎã¤Ç¤¢¤ë¡£ +.RE +.IP +IPv6 ¥¢¥É¥ì¥¹¤Îɽ¸½ÊýË¡¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï RFC 2373 ¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë (¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬Àµ¾ï¤ËÊÑ´¹¤µ¤ì¤ë) ¤È¡¢ +.BR inet_pton () +¤Ï 1 ¤òÊÖ¤¹¡£ +.I src +¤¬»ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤ËÂФ¹¤ë +Àµ¤·¤¤¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹É½µ­¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +0 ¤òÊÖ¤¹¡£ +.I af +¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B EAFNOSUPPORT +¤òÀßÄꤹ¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.BR inet_aton (3) +¤ä +.BR inet_addr (3) +¤È°Û¤Ê¤ê¡¢ +.BR inet_pton () +¤Ï IPv6 ¥¢¥É¥ì¥¹¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +°ìÊý¤Ç¡¢ +.BR inet_pton () +¤¬¼õ¤±ÉÕ¤±¤ë IPv4 ¥¢¥É¥ì¥¹¤Ï¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ôɽµ­¤À¤±¤Ç¤¢¤ë¡£ +¤³¤ì¤ËÂФ·¡¢ +.BR inet_aton (3) +¤ä +.BR inet_addr (3) +¤Ç¤Ï¤â¤Ã¤È°ìÈÌŪ¤Ê¥É¥Ã¥È¶èÀÚ¤ê¤Î¿ô»úɽµ­ (16 ¿Ê¿ô¤ä 8 ¿Ê¿ô¤Î·Á¼°¤ä¡¢ +4 ¥Ð¥¤¥ÈÁ´¤Æ¤òÌÀ¼¨Åª¤Ë½ñ¤«¤Ê¤¯¤Æ¤â¤è¤¤·Á¼°) ¤¬»ÈÍѤǤ­¤ë¡£ +¥É¥Ã¥È¶èÀÚ¤ê¤Î¿ô»úɽµ­¤Ç IPv6 ¥¢¥É¥ì¥¹¤È IPv4 ¥¢¥É¥ì¥¹¤ÎξÊý¤ò°·¤¨¤ë +¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR getaddrinfo (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥Ð¥° +.B AF_INET6 +¤Ï IPv4 ¥¢¥É¥ì¥¹¤òǧ¼±¤·¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë IPv4 ¥¢¥É¥ì¥¹¤ò¥Þ¥Ã¥Ô¥ó¥°¤·¤¿ IPv6 ¥¢¥É¥ì¥¹¤ò +.I src +¤ËÍ¿¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï +.BR inet_pton () +¤È +.BR inet_ntop (3) +¤Î»ÈÍÑÎã¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£ +¼Â¹Ô¤¹¤ë¤È°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£ +.in +4n +.nf + +.RB "$" " ./a.out i6 0:0:0:0:0:0:0:0" +:: +.RB "$" " ./a.out i6 1:0:0:0:0:0:0:8" +1::8 +.RB "$" " ./a.out i6 0:0:0:0:0:FFFF:204.152.189.116" +::ffff:204.152.189.116 +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + unsigned char buf[sizeof(struct in6_addr)]; + int domain, s; + char str[INET6_ADDRSTRLEN]; + + if (argc != 3) { + fprintf(stderr, "Usage: %s {i4|i6|} string\\n", argv[0]); + exit(EXIT_FAILURE); + } + + domain = (strcmp(argv[1], "i4") == 0) ? AF_INET : + (strcmp(argv[1], "i6") == 0) ? AF_INET6 : atoi(argv[1]); + + s = inet_pton(domain, argv[2], buf); + if (s <= 0) { + if (s == 0) + fprintf(stderr, "Not in presentation format"); + else + perror("inet_pton"); + exit(EXIT_FAILURE); + } + + if (inet_ntop(domain, buf, str, INET6_ADDRSTRLEN) == NULL) { + perror("inet_ntop"); + exit(EXIT_FAILURE); + } + + printf("%s\\n", str); + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR getaddrinfo (3), +.BR inet (3), +.BR inet_ntop (3) diff --git a/release/man3/infnan.3 b/release/man3/infnan.3 new file mode 100644 index 00000000..612455eb --- /dev/null +++ b/release/man3/infnan.3 @@ -0,0 +1,80 @@ +.\" 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 Sat Jul 24 19:11:11 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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" +.SH ̾Á° +infnan \- ̵¸ÂÂç¤È̵¸úÃÍ (NaN) ¤ò¼è°·¤¦ +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "double infnan(int " error ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +´Ø¿ô +.BR infnan () +¤Ï̵¸ÂÂç¤È̵¸úÃÍ (NaN) ¤Î·ë²Ì¤ËÂФ¹¤ëŬÀÚ¤ÊÃͤòÊÖ¤¹¡£ +\fIerror\fP ¤ÎÃͤϡ¢Ìµ¸ÂÂç¤òɽ¤¹ +.B ERANGE +¤« NaN ¤òɽ¤¹¤½¤ì°Ê³°¤ÎÃͤǤ¢¤ë¡£ +\fIerrno\fP ¤âƱÍͤËÀßÄꤵ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +\fIerror\fP ¤¬ +.B ERANGE +(̵¸ÂÂç) ¤Î¾ì¹ç¡¢ +.B HUGE_VAL +¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +\fIerror\fP ¤¬ \-\fBERANGE\fP (Éé¤Î̵¸ÂÂç) ¤Î¾ì¹ç¡¢ +\-\fBHUGE_VAL\fP ¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +\fIerror\fP ¤¬¤½¤ì°Ê³°¤ÎÃͤξì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EDOM +\fIerror\fP ¤ÎÃͤ¬Ìµ¸úÃÍ (NaN) ¤Ç¤¢¤ë¡£ +.TP +.B ERANGE +\fIerror\fP ¤ÎÃͤ¬Àµ¤Î̵¸ÂÂç¤â¤·¤¯¤ÏÉé¤Î̵¸ÂÂç¤Ç¤¢¤ë¡£ +.SH ½àµò +4.3BSD. +.SH Ãí°Õ +¤³¤ÎÇѻߤµ¤ì¤¿ (obsolete) ´Ø¿ô¤Ï¡¢ +libc4 ¤È libc5 ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤¿¤¬¡¢ glibc2 ¤Ç¤ÏÄ󶡤µ¤ì¤Æ¤¤¤Ê¤¤¡£ diff --git a/release/man3/initgroups.3 b/release/man3/initgroups.3 new file mode 100644 index 00000000..74c04971 --- /dev/null +++ b/release/man3/initgroups.3 @@ -0,0 +1,89 @@ +.\" 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-07-24 by Rik Faith +.\" Modified 2004-10-10 by aeb +.\" +.\" Japanese Version Copyright (c) 1998 +.\" ISHIKAWA Mutsumi, all rights reserved. +.\" Translated 1998-05-23, ISHIKAWA Mutsumi +.\" Updated 2002-01-09, Kentaro Shirakata +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" +.TH INITGROUPS 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +initgroups \- ÄɲäΥ°¥ë¡¼¥×¥¢¥¯¥»¥¹¥ê¥¹¥È¤Î½é´ü²½ +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "int initgroups(const char *" user ", gid_t " group ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR initgroups (): +_BSD_SOURCE +.SH ÀâÌÀ +.BR initgroups () +´Ø¿ô¤Ï¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹ \fI/etc/group\fP ¤òÆÉ¤ß +¹þ¤ó¤Ç¡¢\fIuser\fP ¤¬½ê°¤·¤Æ¤¤¤ëÁ´¤Æ¤Î¥°¥ë¡¼¥×¤ò»È¤Ã¤Æ¡¢¥°¥ë¡¼¥×¥¢¥¯ +¥»¥¹¥ê¥¹¥È¤ò½é´ü²½¤¹¤ë¡£¤µ¤é¤Ë¡¢\fIgroup\fP ¤Ë¼¨¤µ¤ì¤ë¥°¥ë¡¼¥×¤â¥°¥ë¡¼ +¥×¥¢¥¯¥»¥¹¥ê¥¹¥È¤ËÄɲ䵤ì¤ë¡£ + +.I user +°ú¿ô¤Ï NULL ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR initgroups () +´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +¥°¥ë¡¼¥×¾ðÊó¹½Â¤ÂΤòÇÛÃÖ¤¹¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ­¤·¤Æ¤¤¤ë¡£ +.TP +.B EPERM +¸Æ½Ð¤·¥×¥í¥»¥¹¤¬½½Ê¬¤ÊÆø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤Î΢¤Ç¼Â¹Ô¤µ¤ì¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR setgroups (2) +¤â»²¾È¤Î¤³¤È¡£ +.SH ¥Õ¥¡¥¤¥ë +.nf +\fI/etc/group\fP ¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë +.fi +.SH ½àµò +SVr4, 4.3BSD. +.SH ´ØÏ¢¹àÌÜ +.BR getgroups (2), +.BR setgroups (2), +.BR credentials (7) diff --git a/release/man3/insque.3 b/release/man3/insque.3 new file mode 100644 index 00000000..ec1cafea --- /dev/null +++ b/release/man3/insque.3 @@ -0,0 +1,95 @@ +.\" peter memishian -- meem@gnu.ai.mit.edu +.\" $Id: insque.3,v 1.2 1996/10/30 21:03:39 meem Exp meem $ +.\" +.\" 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 (5.4.7) +.\" Solaris 2.x, OSF/1, and HP-UX manpages +.\" Curry's "UNIX Systems Programming for SVR4" (O'Reilly & Associates 1996) +.\" +.\" Changed to POSIX, 2003-08-11, aeb+wh +.\" +.\" Japanese Version Copyright (c) 1998 AKAMATSU Kazuo +.\" all rights reserved. +.\" Translated Thu Jan 7 16:00 JST 1999 +.\" by AKAMATSU Kazuo +.\" Updated Sun Sep 14 JST 2003 by Kentaro Shirakata +.\" +.TH INSQUE 3 2008-07-11 "" "Linux Programmer's Manual" +.SH ̾Á° +insque, remque \- ¥­¥å¡¼¤Ë¥¢¥¤¥Æ¥à¤òÁÞÆþ/ºï½ü¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void insque(void *" elem ", void *" prev ); + +.BI "void remque(void *" elem ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR insque (), +.BR remque (): +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.BR insque () +¤È +.BR remque () +¤ÏÁÐÊý¸þÏ¢·ë¥ê¥¹¥È (doubly-linked list) ¤òÁàºî¤¹¤ë´Ø¿ô¤Ç¤¢¤ë¡£ +¥ê¥¹¥ÈÃæ¤Î¤½¤ì¤¾¤ì¤ÎÍ×ÁǤϡ¢ºÇ½é¤ÎÆó¤Ä¤Î¹½Â¤ÂÎÍ×ÁǤ¬ +¼¡¤ÈÁ°¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤è¤¦¤Ê¹½Â¤ÂΤǤ¢¤ë¡£ + +.BR insque () +¤Ï \fIelem\fP ¤Ç¼¨¤µ¤ì¤ëÍ×ÁǤò \fIprev\fP ¤Ç¼¨¤µ¤ì¤ë +Í×ÁǤÎľ¸å¤ËÁÞÆþ¤¹¤ë¡£ \fIprev\fP ¤Ï NULL ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +.BR remque () +¤Ï \fIelem\fP ¤Ç¼¨¤µ¤ì¤ëÍ×ÁǤòÁÐÊý¸þÏ¢·ë¥ê¥¹¥È¤«¤é¼è¤ê½ü¤¯¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +ÅÁÅýŪ¤Ë (SunOS, Linux libc 4,5 ¤Ç¤Ï) ¤³¤ì¤é¤Î´Ø¿ô¤Î°ú¿ô¤Ï +\fIstruct qelem *\fP·¿¤Ç¤¢¤ê¡¢¤³¤ì¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct qelem { + struct qelem *q_forw; + struct qelem *q_back; + char q_data[1]; +}; +.fi +.in + +¤³¤ÎÄêµÁ¤Ï \fI\fP ¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëÁ°¤Ë +.B _GNU_SOURCE +¤òÄêµÁ¤¹¤ë¤³¤È¤ÇÆÀ¤é¤ì¤ë¡£ + +¤³¤ì¤é¤Î´Ø¿ô¤Î¥×¥í¥È¥¿¥¤¥×¤ÎÃÖ¤«¤ì¤ë¾ì½ê¤Ï¡¢Unix ¤Î¼ïÎà¤Ë¤è¤ê°Û¤Ê¤ë¡£ +¾åµ­¤Ï POSIX ÈǤǤ¢¤ë¡£ +\fI\fP ¤Ë¤¢¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +Linux libc4 ¤È libc5 ¤Ï \fI\fP ¤Ë¥×¥í¥È¥¿¥¤¥×¤òÃÖ¤¤¤Æ¤¤¤ë¡£ diff --git a/release/man3/intro.3 b/release/man3/intro.3 new file mode 100644 index 00000000..44b6ef82 --- /dev/null +++ b/release/man3/intro.3 @@ -0,0 +1,96 @@ +.\" 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. +.\" +.\" 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-02-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +intro \- ¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î¾Ò²ð +.SH ÀâÌÀ +¥Þ¥Ë¥å¥¢¥ë¤Î 3 ¾Ï¤Ç¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¼ÂÁõ¤·¤¿ 2 ¾Ï¤ÇÀâÌÀ¤µ¤ì¤¿ +¥é¥¤¥Ö¥é¥ê´Ø¿ô (¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥é¥Ã¥Ñ¡¼) ¤ò½ü¤¤¤¿ +Á´¤Æ¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤ë¡£ + +¤³¤Î¾Ï¤ÇÀâÌÀ¤·¤Æ¤¤¤ë´Ø¿ô¤Î¿¤¯¤Ïɸ½à C ¥é¥¤¥Ö¥é¥ê +.RI ( libc ) +¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤Þ¤¿¡¢¤¤¤¯¤Ä¤«¤Î´Ø¿ô¤Ï¡¢Â¾¤Î¥é¥¤¥Ö¥é¥ê (Î㤨¤Ð¡¢¿ô³Ø¥é¥¤¥Ö¥é¥ê¤Î +.I libm +¤ä¥ê¥¢¥ë¥¿¥¤¥à¥é¥¤¥Ö¥é¥ê +.I librt ) +¤Î¤â¤Î¤Ç¤¢¤ë¡£¸å¼Ô¤Î¾ì¹ç¤Ï¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¡¢ +ɬÍפʥ饤¥Ö¥é¥ê¤È¥ê¥ó¥¯¤¹¤ë¤¿¤á¤ËɬÍפʥê¥ó¥«¥ª¥×¥·¥ç¥ó¤¬ +¼¨¤µ¤ì¤Æ¤¤¤ë (Î㤨¤Ð¡¢Á°½Ò¤Î¥é¥¤¥Ö¥é¥ê¤Î¾ì¹ç¤Ï¤½¤ì¤¾¤ì +.I \-lm +¤ä +.I \-lrt +¤Ç¤¢¤ë)¡£ + +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¡Ö½ñ¼°¡×¤ÎÀá¤Ëµ¬Äꤵ¤ì¤¿¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤«¤é´Ø¿ô¤ÎÄêµÁ¤ò +ÆÀ¤ë¤¿¤á¤Ë¡¢¥×¥í¥°¥é¥Þ¤¬µ¡Ç½¸¡ºº¥Þ¥¯¥í¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¾ì¹ç¤¬¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï¡¢É¬Íפʥޥ¯¥í¤¬¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤Î¤µ¤é¤Ê¤ë¾ðÊó¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR feature_test_macros (7) +¤ò»²¾È¤Î¤³¤È¡£ +.\" +.\" ¾ÏÈÖ¹æ¤ËÉÕ¤±²Ã¤¨¤é¤ì¤Æ¤¤¤ëʸ»ú¤Ë¤è¤Ã¤Æ¼±Ê̤Ǥ­¤ëÍÍ¡¹¤Ê´Ø¿ô¤Î¥°¥ë¡¼¥×¤¬¤¢¤ë: +.\" .IP (3C) +.\" ¤³¤ì¤é2¾Ï¤È3S¾Ï¤«¤é¤Î´Ø¿ô¤Ïɸ½àC¥é¥¤¥Ö¥é¥ê libc Ãæ¤Ë´Þ¤Þ¤ì¤ë¤â¤Î¤Ç¤¢¤ê¡¢ +.\" ¥Ç¥Õ¥©¥ë¥È¤Ç +.\" .BR cc (1) +.\" ¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¤Ç¤¢¤í¤¦¡£ +.\" .IP (3S) +.\" ¤³¤ì¤é¤Î´Ø¿ô¤Ï +.\" .BR stdio (3) +.\" ¥é¥¤¥Ö¥é¥ê¤Î°ìÉô¤Ç¤¢¤ë¡£É¸½àC¥é¥¤¥Ö¥é¥ê libc ¤Ë´Þ¤Þ¤ì¤ë¡£ +.\" .IP (3M) +.\" ¤³¤ì¤é¤Î´Ø¿ô¤Ï¿ô³Ø´Ø¿ô¥é¥¤¥Ö¥é¥ê libm ¤Ë´Þ¤Þ¤ì¤ë¡£¤³¤ì¤é¤Ï +.\" ¥Ç¥Õ¥©¥ë¥È¤Ç +.\" .BR f77 (1) +.\" ¥Õ¥©¡¼¥È¥é¥ó¥³¥ó¥Ñ¥¤¥é¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¡¢¤·¤«¤· +.\" .BR cc (1) +.\" C¥³¥ó¥Ñ¥¤¥é¤Ç»ÈÍѤ¹¤ë¤È¤­¤Ï¡¢\fI\-lm\fP ¥ª¥×¥·¥ç¥ó¤¬É¬ÍפȤʤ롣 +.\" .IP (3F) +.\" ¤³¤ì¤é¤Î´Ø¿ô¤Ï¥Õ¥©¡¼¥È¥é¥ó¥é¥¤¥Ö¥é¥ê libF77 ¤Î°ìÉô¤Ç¤¢¤ë¡£ +.\" ¤³¤ì¤é¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤¿¤á¤ËÆÃÊ̤ʥ³¥ó¥Ñ¥¤¥é¥Õ¥é¥°¤ÏɬÍפʤ¤¡£ +.\" .IP (3X) +.\" ÍÍ¡¹¤ÊÆÃÊ̤ʥ饤¥Ö¥é¥ê¤Ç¤¢¤ë¡£¤³¤ì¤é¤Î´Ø¿ô¤òʸ½ñ²½¤·¤¿¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï +.\" ¥é¥¤¥Ö¥é¥ê̾¤ò»ØÄꤹ¤ë¡£ +.SH ½àµò +¤³¤Î¾Ï¤Î´Ø¿ô¤¬½àµò¤¹¤ë Unix ¥·¥¹¥Æ¥à¤äɸ½à¤ò¼¨¤¹¤Î¤Ë¤¤¤¯¤Ä¤«¤Îñ¸ì¤äά¹æ¤¬ +»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +.BR standards (7) +¤ò»²¾È¤Î¤³¤È¡£ +.SH È÷¹Í +.SS Ãø¼Ô¤ÈÃøºî¸¢ +Ãø¼Ô¤ÈÃøºî¸¢¤Î¾õÂ֤ϥޥ˥奢¥ë¥Ú¡¼¥¸¤Î¥Ø¥Ã¥À¤ò¸«¤ë¤³¤È¡£ +¤³¤ì¤é¤Ï¥Ú¡¼¥¸Ëè¤Ë°Û¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ë¤³¤È¤ËÃí°Õ¡£ +.SH ´ØÏ¢¹àÌÜ +.BR intro (2), +.BR errno (3), +.BR feature_test_macros (7), +.BR libc (7), +.BR standards (7) diff --git a/release/man3/isalpha.3 b/release/man3/isalpha.3 new file mode 100644 index 00000000..7a29b858 --- /dev/null +++ b/release/man3/isalpha.3 @@ -0,0 +1,206 @@ +.\" 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:10:00 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Aug 21 17:51:50 1994 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sat Sep 2 21:52:01 1995 by Jim Van Zandt +.\" Modified Mon May 27 22:55:26 1996 by Martin Schulze (joey@linux.de) +.\" +.\" Japanese Version Copyright (c) 1997 Ueyama Rui +.\" all rights reserved. +.\" Translated 1997-08-29, Ueyama Rui +.\" Updated 1999-07-16, Kentaro Shirakata +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" +.TH ISALPHA 3 2009-03-15 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower, +isprint, ispunct, isspace, isupper, isxdigit \- ʸ»ú¤òʬÎह¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int isalnum(int " "c" ); +.br +.BI "int isalpha(int " "c" ); +.br +.BI "int isascii(int " "c" ); +.br +.BI "int isblank(int " "c" ); +.br +.BI "int iscntrl(int " "c" ); +.br +.BI "int isdigit(int " "c" ); +.br +.BI "int isgraph(int " "c" ); +.br +.BI "int islower(int " "c" ); +.br +.BI "int isprint(int " "c" ); +.br +.BI "int ispunct(int " "c" ); +.br +.BI "int isspace(int " "c" ); +.br +.BI "int isupper(int " "c" ); +.br +.BI "int isxdigit(int " "c" ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR isascii (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.br +.BR isblank (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Ë½¾¤Ã¤Æ +.I c +¤òʬÎह¤ë¡£ +.I c +¤Ï +.I unsigned char +¤« +.B EOF +¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BR isalnum () +±Ñ»ú¤Þ¤¿¤Ï¿ô»ú¤Ç¤¢¤ë¤«¤òÄ´¤Ù¤ë¡£ +.BI "(isalpha(" c ") || isdigit(" c "))" \fR +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.TP +.BR isalpha () +¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤«¤É¤¦¤«Ä´¤Ù¤ë¡£É¸½à¤Î \fB"C"\fP ¥í¥±¡¼¥ë¤Ç¤Ï +.BI "(isupper(" c ") || islower(" c "))" \fR +¤ÈÅù²Á¤Ç¤¢¤ë¡£Â¾¤Î¥í¥±¡¼¥ë¤Ç¤Ï¡¢Âçʸ»ú¤Ç¤â¾®Ê¸»ú¤Ç¤â¤Ê¤¤Â¾¤Îʸ»ú¤Ç¤â +.BR isalpha () +¤¬ true ¤òÊÖ¤¹¤³¤È¤¬¤¢¤ë¡£ +.TP +.BR isascii () +\fIc\fP ¤¬¡¢ASCIIʸ»ú¥»¥Ã¥È¤Ë¹çÃפ¹¤ë 7¥Ó¥Ã¥È¤Î +.I unsigned char +¤Ç¤¢¤ë¤«¤òÄ´¤Ù¤ë¡£ +.TP +.BR isblank () +¶õÇòʸ»ú (¥¹¥Ú¡¼¥¹¤«¥¿¥Ö) ¤Ç¤¢¤ë¤«¤òÄ´¤Ù¤ë¡£ +.TP +.BR iscntrl () +À©¸æʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.TP +.BR isdigit () +¿ô»ú (0¡Á9) ¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.TP +.BR isgraph () +ɽ¼¨²Äǽ¤Êʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£¥¹¥Ú¡¼¥¹¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +.TP +.BR islower () +¾®Ê¸»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.TP +.BR isprint () +ɽ¼¨²Äǽ¤Êʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£¥¹¥Ú¡¼¥¹¤â´Þ¤Þ¤ì¤ë¡£ +.TP +.BR ispunct () +ɽ¼¨²Äǽ¤Êʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£¥¹¥Ú¡¼¥¹¤È±Ñ¿ô»ú¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +.TP +.BR isspace () +¶õÇòʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.B """C""" +¥í¥±¡¼¥ë¤« +.B """POSIX""" +¥í¥±¡¼¥ë¤Ç¤Ï¡¢¶õÇòʸ»ú¤È¤Ï¡¢¥¹¥Ú¡¼¥¹¡¢¥Õ¥©¡¼¥à¥Õ¥£¡¼¥É +.RB ( \(aq\ef\(aq ) +¡¢²þ¹Ô(newline) +.RB ( \(aq\en\(aq ) +¡¢Éüµ¢(carriage return) +.RB ( \(aq\er\(aq ) +¡¢¿åÊ¿¥¿¥Ö +.RB ( \(aq\et\(aq ) +¡¢¿âľ¥¿¥Ö +.RB ( \(aq\ev\(aq ) +¤Ç¤¢¤ë¡£ +.TP +.BR isupper () +¾®Ê¸»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.TP +.BR isxdigit () +16¿Ê¿ô¤Ç¤Î¿ô»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.br +.B "0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F" +¤Îʸ»ú¤Ç¤¢¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¤³¤È¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +ʸ»ú +.I c +¤¬Ä´¤Ù¤¿Ê¸»ú¤Î¼ïÎà¤Ë¹ç¤Ã¤Æ¤¤¤ì¤Ð 0 °Ê³°¤òÊÖ¤¹¡£ +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99, 4.3BSD. +C89 ¤Ç¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤Î¤¦¤Á +.BR isascii () +¤È +.BR isblank () +°Ê³°¤Î +¤¹¤Ù¤Æ¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.BR isascii () +¤Ï BSD ¤ä SVr4 ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.BR isblank () +¤Ï POSIX.1-2001 ¤È C99 7.4.1.3 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +POSIX.1-2008 ¤Ï¡¢ +.BR isascii () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +¥í¡¼¥«¥é¥¤¥º¤µ¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢°Ü¿¢À­¤ò³ÎÊݤ·¤Ä¤Ä¡¢ +¤³¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH Ãí°Õ +¤¢¤ëʸ»ú¤¬¤É¤Î¼ïÎà¤ËÆþ¤ë¤«¤È¤¤¤¦¤³¤È¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Ë°Í¸¤¹¤ë¡£ +¤¿¤È¤¨¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤Î +.B "C" +¥í¥±¡¼¥ë¤Ç¤Ï +.BR isupper () +¤Ï A ¤Î¥¦¥à¥é¥¦¥È¤òǧ¼±¤Ç¤­¤Ê¤¤¤Î¤Ç¡¢¤½¤ì¤¬Âçʸ»ú¤À¤È¤¤¤¦¤³¤È¤¬¤ï¤«¤é¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iswalnum (3), +.BR iswalpha (3), +.BR iswblank (3), +.BR iswcntrl (3), +.BR iswdigit (3), +.BR iswgraph (3), +.BR iswlower (3), +.BR iswprint (3), +.BR iswpunct (3), +.BR iswspace (3), +.BR iswupper (3), +.BR iswxdigit (3), +.BR setlocale (3), +.BR toascii (3), +.BR tolower (3), +.BR toupper (3), +.BR ascii (7), +.BR locale (7) diff --git a/release/man3/isatty.3 b/release/man3/isatty.3 new file mode 100644 index 00000000..fc4b2ac7 --- /dev/null +++ b/release/man3/isatty.3 @@ -0,0 +1,68 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya +.\" all rights reserved. +.\" Translated Mon Feb 10 1997 by Hiroaki Nagoya +.\" +.TH ISATTY 3 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +isatty \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Ã¼Ëö¤ò»²¾È¤·¤Æ¤¤¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int isatty(int " fd ); +.fi +.SH ÀâÌÀ +.BR isatty () +´Ø¿ô¤Ï¡¢ +.I fd +¤¬Ã¼Ëö¤ò»²¾È¤¹¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤É¤¦¤«¤ò +¥Á¥§¥Ã¥¯¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR isatty () +¤Ï¡¢ +.I fd +¤¬Ã¼Ëö¤ò»²¾È¤¹¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ì¤Ð 1 ¤òÊÖ¤¹¡£ +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EINVAL +.\" FIXME File a bug for this? +.I fd +¤¬Ã¼Ëö°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¥¨¥é¡¼ +.B ENOTTY +¤òÊÖ¤¹¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR fstat (2), +.BR ttyname (3) diff --git a/release/man3/isgreater.3 b/release/man3/isgreater.3 new file mode 100644 index 00000000..c8e23909 --- /dev/null +++ b/release/man3/isgreater.3 @@ -0,0 +1,101 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered \- +NaN ¤ËÂФ·¤ÆÎã³°¤òȯÀ¸¤»¤º¤Ë¡¢ÉâÆ°¾®¿ôÅÀ¿ô¤ÎÂç¾®´Ø·¸¤ÎȽÄê¤ò¹Ô¤¦ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int isgreater(" x ", " y ); +.sp +.BI "int isgreaterequal(" x ", " y ); +.sp +.BI "int isless(" x ", " y ); +.sp +.BI "int islessequal(" x ", " y ); +.sp +.BI "int islessgreater(" x ", " y ); +.sp +.BI "int isunordered(" x ", " y ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +¤³¤³¤ÇÀâÌÀ¤¹¤ëÁ´¤Æ¤Î´Ø¿ô: +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +(\fB<\fP¡¢¡Ö¾®¤Ê¤ê¡×¤Î¤è¤¦¤Ê) Ä̾ï¤Î´Ø·¸Áàºî (relation operations) ¤Ï¡¢ +¥ª¥Ú¥é¥ó¥É¤Î°ìÊý¤¬ NaN ¤Î¾ì¹ç¤Ë¤Ï¼ºÇÔ¤¹¤ë¡£ +¤³¤ì¤ÏÎã³°¤Î¸¶°ø¤Ë¤Ê¤ë¡£ +¤³¤ì¤òÈò¤±¤ë¤¿¤á¡¢C99 ¤Ç¤Ï¼¡¤Î¤è¤¦¤Ê¥Þ¥¯¥í¤òÄêµÁ¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï¥ª¥Ú¥é¥ó¥É¤ò 1 ²ó¤À¤±É¾²Á¤¹¤ë¤³¤È¤¬Êݾڤµ¤ì¤Æ¤¤¤ë¡£ +¥ª¥Ú¥é¥ó¥É¤Ë¤ÏǤ°Õ¤Î¼Â¿ô¤ÎÉâÆ°¾®¿ôÅÀ¿ô·¿¤ò»ØÄê¤Ç¤­¤ë¡£ +.TP +.BR isgreater () +\fI(x)\ >\ (y)\fP ¤ò·èÄꤹ¤ë¡£ +\fIx\fP ¤Þ¤¿¤Ï \fIy\fP ¤¬ NaN ¤Ç¤âÎã³°¤òȯÀ¸¤·¤Ê¤¤¡£ +.TP +.BR isgreaterequal () +\fI(x)\ >=\ (y)\fP ¤ò·èÄꤹ¤ë¡£ +\fIx\fP ¤Þ¤¿¤Ï \fIy\fP ¤¬ NaN ¤Ç¤âÎã³°¤òȯÀ¸¤·¤Ê¤¤¡£ +.TP +.BR isless () +\fI(x)\ <\ (y)\fP ¤ò·èÄꤹ¤ë¡£ +\fIx\fP ¤Þ¤¿¤Ï \fIy\fP ¤¬ NaN ¤Ç¤âÎã³°¤òȯÀ¸¤·¤Ê¤¤¡£ +.TP +.BR islessequal () +\fI(x)\ <=\ (y)\fP ¤ò·èÄꤹ¤ë¡£ +\fIx\fP ¤Þ¤¿¤Ï \fIy\fP ¤¬ NaN ¤Ç¤âÎã³°¤òȯÀ¸¤·¤Ê¤¤¡£ +.TP +.BR islessgreater () +\fI(x)\ < (y) || (x) >\ (y)\fP ¤ò·èÄꤹ¤ë¡£ +\fIx\fP ¤Þ¤¿¤Ï \fIy\fP ¤¬ NaN ¤Ç¤âÎã³°¤òȯÀ¸¤·¤Ê¤¤¡£ +¤³¤Î¥Þ¥¯¥í¤Ï \fIx\ !=\ y\fP ¤ÈÅù²Á¤Ç¤Ï¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢¤³¤Îɾ²Á¼°¤Ï \fIx\fP ¤Þ¤¿¤Ï \fIy\fP ¤¬ NaN ¤Î¾ì¹ç¤Ë +true ¤È¤Ê¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.TP +.BR isunordered () +°ú¤­¿ô¤¬ unordered ¤«¤É¤¦¤«¡¢¤Ä¤Þ¤ê°ú¤­¿ô¤Î¾¯¤Ê¤¯¤È¤â°ìÊý¤¬ NaN ¤«¤É¤¦¤« +¤òȽÄꤹ¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR isunordered () +°Ê³°¤Î¥Þ¥¯¥í¤Ï´Ø·¸Áàºî¤Î·ë²Ì¤òÊÖ¤¹¡£ +°ìÊý¤Î°ú¤­¿ô¤¬ NaN ¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï 0 ¤òÊÖ¤¹¡£ + +.BR isunordered () +¤Ï \fIx\fP ¤« \fIy\fP ¤¬ NaN ¤Î¾ì¹ç 1 ¤ò¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç 0 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÁ´¤Æ¤Î¥Ï¡¼¥É¥¦¥§¥¢¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¥Þ¥¯¥í¤Ç¥¨¥ß¥å¥ì¡¼¥È¤µ¤ì¤ë¡£ +¥¨¥ß¥å¥ì¡¼¥È¤µ¤ì¤ë¾ì¹ç¤Ï¡¢À­Ç½¾å¤Ç¤ÎÉÔÍø¤È¤Ê¤ë¡£ +NaN ¤Ë¤Ä¤¤¤Æ¿´ÇÛ¤·¤Ê¤¯¤Æ¹½¤ï¤Ê¤¤¾ì¹ç¤Ï¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤ò»È¤ï¤Ê¤¤¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fpclassify (3), +.BR isnan (3) diff --git a/release/man3/iswalnum.3 b/release/man3/iswalnum.3 new file mode 100644 index 00000000..41905024 --- /dev/null +++ b/release/man3/iswalnum.3 @@ -0,0 +1,68 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Aug 30 21:33:06 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:08 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWALNUM 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iswalnum \- ±Ñ¿ô»ú¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswalnum(wint_t " wc ); +.fi +.SH ÀâÌÀ +.BR iswalnum () +´Ø¿ô¤Ï¡¢ +.BR isalnum (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢¤¢¤ë¥ï¥¤¥Éʸ»ú¤¬Ê¸»ú¥¯¥é¥¹ "alnum" ¤Ë°¤¹¤ë¤«¤É¤¦¤«¤òÄ´¤Ù +¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢ +¤ê¡¢¤·¤¿¤¬¤Ã¤Æ¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤È "digit" ¤ÎÏ +½¸¹ç¤Ç¤¢¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Î¥¯¥é¥¹¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" ¤â´Þ¤à¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \(aqA\(aq ¤«¤é \(aqZ\(aq, +\(aqa\(aq ¤«¤é \(aqz\(aq ¤Þ¤Ç¤Îʸ»ú¤È \(aq0\(aq ¤«¤é \(aq9\(aq ¤Þ¤Ç¤Î¿ô»ú¤ò +¾ï¤Ë´Þ¤à¡£ +.SH ÊÖ¤êÃÍ +.BR iswalnum () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬Ê¸»ú¥¯¥é¥¹ "alnum" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú +¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR iswalnum () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR isalnum (3), +.BR iswctype (3) diff --git a/release/man3/iswalpha.3 b/release/man3/iswalpha.3 new file mode 100644 index 00000000..991b98a8 --- /dev/null +++ b/release/man3/iswalpha.3 @@ -0,0 +1,70 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Wed Aug 31 22:40:19 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:18 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWALPHA 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iswalpha \- ±Ñ»ú¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswalpha(wint_t " wc ); +.fi +.SH ÀâÌÀ +.BR iswalpha () +´Ø¿ô¤Ï +.BR isalpha (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï \fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢ +¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤È¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î +¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" ¤È "lower" ¤ò´Þ +¤à¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \(aqA\(aq ¤«¤é \(aqZ\(aq, +\(aqa\(aq ¤«¤é \(aqz\(aq ¤Þ¤Ç¤Îʸ»ú¤ò¾ï¤Ë´Þ¤à¡£ +.SH ÊÖ¤êÃÍ +.BR iswalpha () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Ë°¤¹¤ë +¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR iswalpha () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR isalpha (3), +.BR iswctype (3) diff --git a/release/man3/iswblank.3 b/release/man3/iswblank.3 new file mode 100644 index 00000000..2e0bd976 --- /dev/null +++ b/release/man3/iswblank.3 @@ -0,0 +1,71 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Wed Sep 1 22:40:19 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:26 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWBLANK 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iswblank \- ¶õÇò¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswblank(wint_t " wc ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR iswblank (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR iswblank () +´Ø¿ô¤Ï¡¢ +.BR isblank (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "blank" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "blank" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "blank" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤È¤Ï¶¦ÄÌÉôʬ¤ò»ý¤¿¤º¡¢¤·¤¿¤¬¤Ã¤Æ¤½¤Î¥µ¥Ö¥¯¥é¥¹ +¤Ç¤¢¤ë "alnum", "alpha", "upper", "lower", "digit", "xdigit", "punct" +¤È¤â¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "blank" ¤Ï¡¢¾¯¤Ê¤¯¤È¤â¶õÇòʸ»ú¤ÈÀ©¸æʸ»ú \(aq\\t\(aq ¤ò¾ï¤Ë +´Þ¤à¡£ +.SH ÊÖ¤êÃÍ +.BR iswblank () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "blank" ¤Ë°¤¹¤ë +¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.BR iswblank () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR isblank (3), +.BR iswctype (3) diff --git a/release/man3/iswcntrl.3 b/release/man3/iswcntrl.3 new file mode 100644 index 00000000..37c8d661 --- /dev/null +++ b/release/man3/iswcntrl.3 @@ -0,0 +1,55 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Wed Sep 1 22:51:30 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH ISWCNTRL 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iswcntrl \- ¥ï¥¤¥ÉÀ©¸æʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswcntrl(wint_t " wc ); +.fi +.SH ÀâÌÀ +.BR iswcntrl () +´Ø¿ô¤Ï¡¢ +.BR iscntrl (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤È¤Ï¶¦ÄÌÉôʬ¤ò»ý¤¿ +¤º¡¢¤·¤¿¤¬¤Ã¤Æ¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "graph", "alpha", "upper", "lower", +"digit", "xdigit", "punct" ¤È¤â¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +unsigned char ·¿¤Ç¤¢¤ë \fIc\fP ¤ËÂФ·¤Æ¤Ï¡¢\fIiscntrl(c)\fP ¤Ï°ÅÌÛŪ¤Ë +\fIiswcntrl(btowc(c))\fP ¤ò¹Ô¤¦¡£ +.SH ÊÖ¤êÃÍ +´Ø¿ô +.BR iswcntrl () +¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤Ë°¤¹¤ë +¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR iswcntrl () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iscntrl (3), +.BR iswctype (3) diff --git a/release/man3/iswctype.3 b/release/man3/iswctype.3 new file mode 100644 index 00000000..371ef304 --- /dev/null +++ b/release/man3/iswctype.3 @@ -0,0 +1,66 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Thu Sep 2 21:47:20 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.\" WORD: character property descriptor ʸ»ú°À­»Ø¼¨»Ò +.\" +.TH ISWCTYPE 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iswctype \- ¥ï¥¤¥Éʸ»ú¤ÎʬÎà +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswctype(wint_t " wc ", wctype_t " desc ); +.fi +.SH ÀâÌÀ +\fIwc\fP ¤¬ +\fIdesc\fP ¤Ç»Ø¼¨¤µ¤ì¤¿Ê¸»ú°À­¤ò»ý¤Ä (¸À¤¤´¹¤¨¤ë¤È¡¢\fIdesc\fP ¤Ç»Ø¼¨ +¤µ¤ì¤¿Ê¸»ú¥¯¥é¥¹¤Ë°¤¹¤ë) ¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð¡¢ +.BR iswctype () +´Ø¿ô¤Ï 0 ¤Ç +¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¤³¤Î´Ø¿ô¤Ï 0 ¤òÊÖ¤¹¡£\fIwc\fP ¤¬ +.B WEOF +¤Ê¤é¤Ð 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +\fIdesc\fP ¤Ï +.BR wctype () +´Ø¿ô¤¬ÊÖ¤¹Ê¸»ú°À­»Ø¼¨»Ò¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR iswctype () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬»Ø¼¨¤µ¤ì¤¿Â°À­¤ò»ý¤Ä¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ +ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR iswctype () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iswalnum (3), +.BR iswalpha (3), +.BR iswblank (3), +.BR iswcntrl (3), +.BR iswdigit (3), +.BR iswgraph (3), +.BR iswlower (3), +.BR iswprint (3), +.BR iswpunct (3), +.BR iswspace (3), +.BR iswupper (3), +.BR iswxdigit (3), +.BR wctype (3) diff --git a/release/man3/iswdigit.3 b/release/man3/iswdigit.3 new file mode 100644 index 00000000..e2de3582 --- /dev/null +++ b/release/man3/iswdigit.3 @@ -0,0 +1,70 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Thu Sep 2 21:56:46 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:32 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWDIGIT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iswdigit \- ¿ô»ú¥ï¥¤¥Éʸ»ú¤Ç¤¢¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswdigit(wint_t " wc ); +.fi +.SH ÀâÌÀ +.BR iswdigit () +´Ø¿ô¤Ï¡¢ +.BR isdigit (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢ +¤ë¡£¤·¤¿¤¬¤Ã¤Æ¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤ä¡¢¤½¤Î¿Æ¥¯¥é¥¹¤Ç¤¢¤ë "graph", +¤µ¤é¤Ë¤½¤Î¿Æ¥¯¥é¥¹¤Ç¤¢¤ë "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿ +¤Ê¤¤¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "lower", "upper" ¤È¤â¶¦ÄÌÉôʬ¤ò +»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤Ïɬ¤º¡¢\(aq0\(aq ¤«¤é \(aq9\(aq ¤Þ¤Ç¤Î +¿ô»ú¤À¤±¤«¤é¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR iswdigit () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤Ë°¤¹¤ë¥ï +¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR iswdigit () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR isdigit (3), +.BR iswctype (3) diff --git a/release/man3/iswgraph.3 b/release/man3/iswgraph.3 new file mode 100644 index 00000000..e201cc52 --- /dev/null +++ b/release/man3/iswgraph.3 @@ -0,0 +1,67 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Sep 4 21:22:34 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:38 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWGRAPH 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iswgraph \- ¥°¥é¥Õ¥£¥Ã¥¯¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswgraph(wint_t " wc ); +.fi +.SH ÀâÌÀ +.BR iswgraph () +´Ø¿ô¤Ï¡¢ +.BR isgraph (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿ +¤Ê¤¤¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¤â¶¦ÄÌÉôʬ¤ò +»ý¤¿¤Ê¤¤¡£ +.\" Note: UNIX98 (susv2/xbd/locale.html) says that "graph" and "space" may +.\" have characters in common, except U+0020. But C99 (ISO/IEC 9899:1999 +.\" section 7.25.2.1.10) says that "space" and "graph" are disjoint. +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢ +¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¤Ï¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Ë°¤¹¤ëʸ»ú¤Î¤¦ +¤Á¶õÇòʸ»ú¤ò½ü¤¯Á´¤Æ¤Î¥ï¥¤¥Éʸ»ú¤ò´Þ¤ó¤Ç¤¤¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Ë¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "almun" ¤È "punct" ¤¬´Þ +¤Þ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR iswgraph () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Ë°¤¹¤ë¥ï +¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR iswgraph () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR isgraph (3), +.BR iswctype (3) diff --git a/release/man3/iswlower.3 b/release/man3/iswlower.3 new file mode 100644 index 00000000..138871ad --- /dev/null +++ b/release/man3/iswlower.3 @@ -0,0 +1,77 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Sep 4 21:40:16 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sat Jan 8 01:52:20 JST 2000 +.\" by Kentaro Shirakata +.\" +.TH ISWLOWER 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iswlower \- ¾®Ê¸»ú¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswlower(wint_t " wc ); +.fi +.SH ÀâÌÀ +.BR iswlower () +´Ø¿ô¤Ï¡¢ +.BR islower (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬Ê¸»ú¥¯¥é¥¹ "lower" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤ò +Ä´¤Ù¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ê¡¢ +¤·¤¿¤¬¤Ã¤Æ¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤È¤½¤Î¿Æ¥¯¥é¥¹¤Ç¤¢¤ë "graph", ¤µ¤é¤Ë +¤½¤Î¿Æ¥¯¥é¥¹¤Ç¤¢¤ë "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" ¤Ï¾¯¤Ê¤¯¤È¤â¡¢\fIwc\fP ¤È \fItowlower(wc)\fP +¤¬Åù¤·¤¯¤Ê¤ê¡¢¤«¤Ä \fItowupper(wc)\fP ¤È°Û¤Ê¤ë¤è¤¦¤Êʸ»ú¤ò´Þ¤à¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" ¤Ï¾¯¤Ê¤¯¤È¤â \(aqa\(aq ¤«¤é \(aqz\(aq ¤òɬ¤º´Þ¤à¡£ +.SH ÊÖ¤êÃÍ +.BR iswlower () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "lower" ¤Ë°¤¹¤ë¥ï +¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR iswlower () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤Ç Unicode ¤ò°·¤¦¤Î¤Ï¤¢¤Þ¤êŬÀڤǤʤ¤¡£ +¤Ê¤¼¤Ê¤é¡¢Unicode ¤Ë¤Ï +Âçʸ»ú (upper case)¡¦¾®Ê¸»ú (lower case)¡¦¥¿¥¤¥È¥ëʸ»ú (title case) +¤Î 3 ¤Ä¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR islower (3), +.BR iswctype (3), +.BR towlower (3) diff --git a/release/man3/iswprint.3 b/release/man3/iswprint.3 new file mode 100644 index 00000000..3b520532 --- /dev/null +++ b/release/man3/iswprint.3 @@ -0,0 +1,52 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Sep 4 23:03:32 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH ISWPRINT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iswprint \- °õ»ú²Äǽ¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswprint(wint_t " wc ); +.fi +.SH ÀâÌÀ +.BR iswprint () +´Ø¿ô¤Ï¡¢ +.BR isprint (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿ +¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤ò´Þ¤à¡£ +.SH ÊÖ¤êÃÍ +.BR iswprint () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Ë°¤¹¤ë¥ï +¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR iswprint () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR isprint (3), +.BR iswctype (3) diff --git a/release/man3/iswpunct.3 b/release/man3/iswpunct.3 new file mode 100644 index 00000000..01baef10 --- /dev/null +++ b/release/man3/iswpunct.3 @@ -0,0 +1,67 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Sep 5 21:47:49 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:52 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWPUNCT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iswpunct \- ¶çÆÉÅÀ¡¦µ­¹æ¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswpunct(wint_t " wc ); +.fi +.SH ÀâÌÀ +.BR iswpunct () +´Ø¿ô¤Ï¡¢ +.BR ispunct (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê +¤¤¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "alpha", "upper", "lower", "digit", "xdigit" +¤È¤â¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤Ï +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR iswpunct () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤Ë°¤¹¤ë +¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR iswpunct () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤Î̾Á°¤Ï Unicode ʸ»ú¤ò°·¤¦ºÝ¤Ë¤ÏÀµ¤·¤¯¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢¥ï¥¤¥É +ʸ»ú¥¯¥é¥¹ "punct" ¤Ï¶çÆÉÅÀʸ»ú¤Èµ­¹æʸ»ú(¿ô³Øµ­¹æ¡¢²ßʾµ­¹æ¤Ê¤É)¤Îξ +Êý¤ò´Þ¤à¤«¤é¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ispunct (3), +.BR iswctype (3) diff --git a/release/man3/iswspace.3 b/release/man3/iswspace.3 new file mode 100644 index 00000000..15b726a2 --- /dev/null +++ b/release/man3/iswspace.3 @@ -0,0 +1,61 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Sep 5 22:05:50 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:31:58 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWSPACE 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iswspace \- ¶õÇò¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswspace(wint_t " wc ); +.fi +.SH ÀâÌÀ +.BR iswspace () +´Ø¿ô¤Ï¡¢ +.BR isspace (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "alnum", "alpha", "upper", "lower", +"digit", "xdigit", "punct" ¤È¤â¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.\" Note: UNIX98 (susv2/xbd/locale.html) says that "space" and "graph" may +.\" have characters in common, except U+0020. But C99 (ISO/IEC 9899:1999 +.\" section 7.25.2.1.10) says that "space" and "graph" are disjoint. +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "blank" ¤ò´Þ¤à¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Ï¾¯¤Ê¤¯¤È¤â¡¢¶õÇòʸ»ú¤ª¤è¤ÓÀ©¸æʸ»ú \(aq\\f\(aq, +\(aq\\n\(aq, \(aq\\r\(aq, \(aq\\t\(aq, \(aq\\v\(aq ¤òɬ¤º´Þ¤à¡£ +.SH ÊÖ¤êÃÍ +.BR iswspace () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤Ë´Þ¤Þ¤ì¤ë +¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR iswspace () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR isspace (3), +.BR iswctype (3) diff --git a/release/man3/iswupper.3 b/release/man3/iswupper.3 new file mode 100644 index 00000000..c86ee7ee --- /dev/null +++ b/release/man3/iswupper.3 @@ -0,0 +1,75 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Sep 5 22:21:05 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:32:06 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWUPPER 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iswupper \- Âçʸ»ú¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswupper(wint_t " wc ); +.fi +.SH ÀâÌÀ +.BR iswupper () +´Ø¿ô¤Ï¡¢ +.BR isupper (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤«¤É +¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" ¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ê¡¢ +¤·¤¿¤¬¤Ã¤Æ¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤È¤½¤Î¿Æ¥¯¥é¥¹¤Ç¤¢¤ë "graph", ¤µ¤é¤Ë +¤½¤Î¿Æ¥¯¥é¥¹¤Ç¤¢¤ë "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alpha" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "digit" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" ¤Ï¾¯¤Ê¤¯¤È¤â¡¢\fIwc\fP ¤È \fItowupper(wc)\fP +¤¬Åù¤·¤¯¤Ê¤ê¡¢¤«¤Ä \fItowupper(wc)\fP ¤È°Û¤Ê¤ë¤è¤¦¤Êʸ»ú¤ò´Þ¤à¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" ¤Ï¾¯¤Ê¤¯¤È¤â \(aqA\(aq ¤«¤é \(aqZ\(aq ¤òɬ¤º´Þ¤à¡£ +.SH ÊÖ¤êÃÍ +.BR iswupper () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "upper" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð +0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR iswupper () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤Ç Unicode ¤ò°·¤¦¤Î¤Ï¤¢¤Þ¤êŬÀڤǤʤ¤¡£¤Ê¤¼¤Ê¤é¡¢Unicode ¤Ë¤Ï +Âçʸ»ú¡¦¾®Ê¸»ú¡¦¥¿¥¤¥È¥ëʸ»ú¤Î 3 ¤Ä¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR isupper (3), +.BR iswctype (3), +.BR towupper (3) diff --git a/release/man3/iswxdigit.3 b/release/man3/iswxdigit.3 new file mode 100644 index 00000000..52241b3a --- /dev/null +++ b/release/man3/iswxdigit.3 @@ -0,0 +1,66 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Sep 5 22:21:05 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Sun Dec 26 19:32:14 JST 1999 +.\" by Kentaro Shirakata +.\" +.TH ISWXDIGIT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +iswxdigit \- 16 ¿Ê¿ô¥ï¥¤¥Éʸ»ú¤«¤É¤¦¤«¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int iswxdigit(wint_t " wc ); +.fi +.SH ÀâÌÀ +.BR iswxdigit () +´Ø¿ô¤Ï¡¢ +.BR isxdigit (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" ¤Ë°¤¹¤ë¥ï¥¤¥Éʸ»ú¤« +¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" ¤Ï¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ç +¤¢¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤È¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" +¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤â¤¢¤ë¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "print" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "cntrl" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "graph" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "space" ¤È¤½¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¢¤ë "blank" ¤È¶¦ÄÌ +Éôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "alnum" ¤Î¥µ¥Ö¥¯¥é¥¹¤Ê¤Î¤Ç¡¢¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" +¤Ï¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "punct" ¤È¶¦ÄÌÉôʬ¤ò»ý¤¿¤Ê¤¤¡£ +.PP +¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" ¤Ï¾¯¤Ê¤¯¤È¤â¡¢Ê¸»ú \(aqA\(aq ¤«¤é \(aqF\(aq, +\(aqa\(aq ¤«¤é \(aqf\(aq ¤È¿ô»ú \(aq0\(aq ¤«¤é \(aq9\(aq ¤òɬ¤º´Þ¤à¡£ +.SH ÊÖ¤êÃÍ +.BR iswxdigit () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¥¯¥é¥¹ "xdigit" ¤Ë°¤¹¤ë +¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤Ç¤Ê¤¤ÃͤòÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR iswxdigit () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iswctype (3), +.BR isxdigit (3) diff --git a/release/man3/j0.3 b/release/man3/j0.3 new file mode 100644 index 00000000..d4f52799 --- /dev/null +++ b/release/man3/j0.3 @@ -0,0 +1,153 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified Sat Jul 24 19:08:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-08-25, aeb +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +j0, j0f, j0l, j1, j1f, j1l, jn, jnf, jnl \- Âè°ì¼ï¥Ù¥Ã¥»¥ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.fi +.BI "double j0(double " x ); +.br +.BI "double j1(double " x ); +.br +.BI "double jn(int " n ", double " x ); +.sp +.BI "float j0f(float " x ); +.br +.BI "float j1f(float " x ); +.br +.BI "float jnf(int " n ", float " x ); +.sp +.BI "long double j0l(long double " x ); +.br +.BI "long double j1l(long double " x ); +.br +.BI "long double jnl(int " n ", long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR j0 (), +.BR j1 (), +.BR jn (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE +.br +.BR j0f (), +.BR j0l (), +.BR j1f (), +.BR j1l (), +.BR jnf (), +.BR jnl (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.\" Also seems to work: -std=c99 -D_XOPEN_SOURCE +.ad b +.SH ÀâÌÀ +´Ø¿ô +.BR j0 (), +.BR j1 () +¤Ï¤½¤ì¤¾¤ì \fIx\fP ¤Î0¼¡¡¢1¼¡¤Î +Âè°ì¼ï¥Ù¥Ã¥»¥ë´Ø¿ô¤ÎÃͤòÊÖ¤¹¡£ +´Ø¿ô +.BR jn () +¤Ï \fIx\fP ¤Î \fIn\fP ¼¡¤Î +Âè°ì¼ï¥Ù¥Ã¥»¥ë´Ø¿ô¤ÎÃͤòÊÖ¤¹¡£ +.PP +.BR j0f () +·²¤Î´Ø¿ô¡¢ +.BR j0l () +·²¤Î´Ø¿ô¤Ï¡¢¤½¤ì¤¾¤ì +.I float +·¿¡¢ +.I "long double" +·¿¤ÎÊÖ¤êÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ËÂФ¹¤ëÂè°ì¼ï¥Ù¥Ã¥»¥ë´Ø¿ô¤ÎÃͤòÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤ÎÀäÂÐÃͤ¬Â礭²á¤®¤ë¾ì¹ç¤ä·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ +ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢ÊÖ¤êÃͤ¬ 0 ¤È¤Ê¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼¤ä¡¢\fIx\fP ¤ÎÀäÂÐÃͤ¬Â礭²á¤®¤ë +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +.\" An underflow floating-point exception +.\" .RB ( FE_UNDERFLOW ) +.\" is raised. +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ +.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 +.SH ½àµò +.I double +·¿¤ÎÃͤòÊÖ¤¹´Ø¿ô¤Ï¡¢SVr4, 4.3BSD, POSIX.1-2001 +¤Ë½àµò¤¹¤ë¡£ +¤½¤ì°Ê³°¤ÏÈóɸ½à¤Î´Ø¿ô¤Ç¡¢BSD ¤Ë¤â¸ºß¤¹¤ë¡£ +.SH ¥Ð¥° +\-8 ¤«¤é 8 ¤Þ¤Ç¤Î \fIx\fP ¤ÎÃͤˤĤ¤¤Æ +.BR j0 (), +.BR j1 (), +.BR jn () +¤¬ÊÖ¤¹Ãͤˤϡ¢ºÇÂç¤Ç 2e\-16 ¤Î¸íº¹¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR y0 (3) diff --git a/release/man3/key_setsecret.3 b/release/man3/key_setsecret.3 new file mode 100644 index 00000000..bccf665f --- /dev/null +++ b/release/man3/key_setsecret.3 @@ -0,0 +1,70 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" I had no way the check the functions out +.\" be careful +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI all rights reserved. +.\" Translated Mon Jan 27 2003 by Akihiro MOTOKI +.\" +.\"WORD: authentication ǧ¾Ú +.\"WORD: asymmetric ÈóÂоθ°(°Å¹æ) +.\"WORD: symmetric Âоθ°(°Å¹æ) +.\" +.TH KEY_SETSECRET 3 2002-07-18 "" "Linux Programmer's Manual" +.SH ̾Á° +key_decryptsession, key_encryptsession, key_setsecret, key_gendes, +key_secretkey_is_set \- rpc ¸°¥µ¡¼¥Ð¡¦¥Ç¡¼¥â¥ó¤È¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.SH ½ñ¼° +.B "#include " +.sp +.BI "int key_decryptsession(const char *" remotename , +.BI "des_block *" deskey ); +.sp +.BI "int key_encryptsession(const char *" remotename , +.BI "des_block *" deskey ); +.sp +.BI "int key_gendes(des_block *" deskey ); +.sp +.BI "int key_setsecret(const char *" key ); +.sp +.B "int key_secretkey_is_set(void);" +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï RPC ¤Î°ÂÁ´¤Êǧ¾Úµ¡¹½ (AUTH_DES) ¤Ç»ÈÍѤµ¤ì¤ë¡£ +¥æ¡¼¥¶¡¦¥×¥í¥°¥é¥à¤Ç¤³¤ì¤é¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ëɬÍפϤʤ¤¡£ + +´Ø¿ô +.BR key_decryptsession () +¤Ï(¥ê¥â¡¼¥È)¥µ¡¼¥Ð¤Î¥Í¥Ã¥È̾¤òÍѤ¤¤Æ¡¢Éü¹æÍѤΠDES ¸°¤ò¼èÆÀ¤¹¤ë¡£ +¥µ¡¼¥Ð¤Î¸ø³«¸°¤È¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤ËÂбþ¤¹¤ëÈëÌ©¸°¤¬»ÈÍѤµ¤ì¤ë¡£ + +´Ø¿ô +.BR key_encryptsession () +¤Ï +.BR key_decryptsession () +¤ÎµÕ¤Î½èÍý¤ò¹Ô¤¦¡£ +¥µ¡¼¥Ð¤Î¸ø³«¸°¤È¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤ËÂбþ¤¹¤ëÈëÌ©¸°¤Ç +DES ¸°¤ò°Å¹æ¤¹¤ë¡£ + +´Ø¿ô +.BR key_gendes () +¤Ï¡¢¸°¥µ¡¼¥Ð¤Ë°ÂÁ´¤ÊÄÌ¿®¤ò¹Ô¤¦¤¿¤á¤Î¸°¤òÍ׵᤹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ + +´Ø¿ô +.BR key_setsecret () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤ËÂФ·¤Æ¸°¤òÀßÄꤹ¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ + +´Ø¿ô +.BR key_secretkey_is_set () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤ËÂФ·¤Æ¸°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò +Ä´¤Ù¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÀ®¸ù¤·¤¿¾ì¹ç 1 ¤ò¡¢¼ºÇÔ¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£ +.SH Ãí°Õ +¤³¤³¤Ç¤Ï 2 ¼ïÎà¤Î°Å¹æÊý¼°¤¬Åо줹¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +°ì¤Ä¤Ï¸ø³«¸°¤ÈÈëÌ©¸°¤ò»ÈÍѤ¹¤ëÈóÂоθ°°Å¹æ¤Ç¤¢¤ê¡¢ +¤â¤¦°ì¤Ä¤ÏÂоθ°°Å¹æ¤Ç¤¢¤ë 64 ¥Ó¥Ã¥È DES ¤Ç¤¢¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï Linux/Doors-project ¤ÎÀ®²Ì¤Î°ìÉô¤À¤Ã¤¿¤¬¡¢ +¸½ºß¤Þ¤Ç¤Ë³ºÅö²Õ½ê¤Ï¤¹¤Ù¤ÆÇË´þ¤µ¤ì¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR crypt (3) diff --git a/release/man3/ldexp.3 b/release/man3/ldexp.3 new file mode 100644 index 00000000..83c3550e --- /dev/null +++ b/release/man3/ldexp.3 @@ -0,0 +1,135 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +ldexp, ldexpf, ldexpl \- ÉâÆ°¾®¿ôÅÀ¼Â¿ô¤È 2 ¤ÎÀ°¿ô¾è¤È¤ÎÀѤò·×»»¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double ldexp(double " x ", int " exp ); +.br +.BI "float ldexpf(float " x ", int " exp ); +.br +.BI "long double ldexpl(long double " x ", int " exp ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR ldexpf (), +.BR ldexpl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR ldexp () +´Ø¿ô¤Ï¡¢ÉâÆ°¾®¿ôÅÀ¼Â¿ô +.I x +¤È 2 ¤Î +.I exp +¾è¤È¤ÎÀѤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I "x * (2^exp)" +¤òÊÖ¤¹¡£ + +.I exp +¤¬¥¼¥í¤Î¾ì¹ç¡¢ +.I x +¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Î¾ì¹ç¡¢ +Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ +ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.BR HUGE_VAL , +.BR HUGE_VALF , +.B HUGE_VALL +¤òÊÖ¤¹¡£ÊÖ¤êÃͤÎÉä¹æ¤Ï +.I x +¤ÈƱ¤¸¤È¤Ê¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR frexp (3), +.BR modf (3), +.BR scalbln (3) diff --git a/release/man3/lgamma.3 b/release/man3/lgamma.3 new file mode 100644 index 00000000..7eb8a10b --- /dev/null +++ b/release/man3/lgamma.3 @@ -0,0 +1,163 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" based on glibc infopages +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +lgamma, lgammaf, lgammal, lgamma_r, lgammaf_r, lgammal_r, signgam \- +¥¬¥ó¥Þ´Ø¿ô¤ÎÂпô¤ò·×»»¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double lgamma(double " x ); +.br +.BI "float lgammaf(float " x ); +.br +.BI "long double lgammal(long double " x ); +.sp +.BI "double lgamma_r(double " x ", int *" signp ); +.br +.BI "float lgammaf_r(float " x ", int *" signp ); +.br +.BI "long double lgammal_r(long double " x ", int *" signp ); +.sp +.BI "extern int " signgam ; +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR lgamma (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR lgammaf (), +.BR lgammal (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR lgamma_r (), +.BR lgammaf_r (), +.BR lgammal_r (): +_BSD_SOURCE || _SVID_SOURCE +.br +.IR signgam : +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.ad b +.SH ÀâÌÀ +¥¬¥ó¥Þ´Ø¿ô¤ÎÄêµÁ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR tgamma (3) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +´Ø¿ô +.BR lgamma () +¤Ï¡¢¥¬¥ó¥Þ´Ø¿ô¤ÎÀäÂÐÃͤμ«Á³Âпô¤òÊÖ¤¹¡£ +¥¬¥ó¥Þ´Ø¿ô¤ÎÉä¹æ¤Ï¡¢ +.I +¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë extern int \fIsigngam\fP ¤Ë³ÊǼ¤µ¤ì¤ë¡£ +³ÊǼ¤µ¤ì¤ëÃͤϡ¢¥¬¥ó¥Þ´Ø¿ô¤¬Àµ¤Þ¤¿¤Ï 0 ¤Î¾ì¹ç 1¡¢ +Éé¤Î¾ì¹ç \-1 ¤Ç¤¢¤ë¡£ +.PP +.I signgam +¤È¤¤¤¦¸ÇÄꤵ¤ì¤¿¾ì½ê¤ò»È¤¦¤³¤È¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢ +´Ø¿ô +.BR lgamma_r () +¤Ê¤É¤¬Æ³Æþ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ç¤Ï¡¢Éä¹æ¤Ï°ú¤­¿ô +.I signp +·Ðͳ¤ÇÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï Gamma(x) ¤Î¼«Á³Âпô¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ 1 ¤« 2 ¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ +Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Ç¤Ê¤¤À°¿ô¤Î¾ì¹ç¡¢¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.RB + HUGE_VAL , +.RB + HUGE_VALF , +.RB + HUGE_VALL +¤òÊÖ¤¹¡£ + +.\" e.g., lgamma(DBL_MAX) +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.BR HUGE_VAL , +.BR HUGE_VALF , +.B HUGE_VALL +¤òÊÖ¤¹¡£ÊÖ¤êÃͤˤϿô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +¶Ë¥¨¥é¡¼: \fIx\fP ¤¬Àµ¤Ç¤Ê¤¤À°¿ô +.\" FIXME . glibc 2.8 gives EDOM! +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë (¡Ö¥Ð¥°¡×¤ÎÀá¤ò»²¾È)¡£ +0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_DIVBYZERO ) +¤¬¾å¤¬¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.\" glibc (as at 2.8) also supports an inexact +.\" exception for various cases. +.SH ½àµò +´Ø¿ô +.BR lgamma () +¤Ï C99 ¤È POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.I signgam +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¤¬¡¢C99 ¤Ë¤Ï¤Ê¤¤¡£ +´Ø¿ô +.BR lgamma_r () +¤ÏÈóɸ½à¤À¤¬¡¢¤¤¤¯¤Ä¤«¤Î¾¤Î¥·¥¹¥Æ¥à¤Ë¤â¸ºß¤¹¤ë¡£ +.SH ¥Ð¥° +¶Ë¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.\" +.\" FIXME . this is as at glibc 2.8; check later if this bug is fixed +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6777 +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +POSIX.1 ¤Ç¤Ï¡¢ +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¤Ù¤­¤È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR tgamma (3) diff --git a/release/man3/localeconv.3 b/release/man3/localeconv.3 new file mode 100644 index 00000000..24cd6d23 --- /dev/null +++ b/release/man3/localeconv.3 @@ -0,0 +1,71 @@ +.\" 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:01:20 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated Tue May 26 00:11:13 JST 1998 +.\" by YOSHINO Takashi +.\" +.TH LOCALECONV 3 1993-04-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +localeconv \- ¿ôÃͤ˴ؤ¹¤ë½ñ¼°¾ðÊó¤òÆÀ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.B struct lconv *localeconv(void); +.fi +.SH ÀâÌÀ +.BR localeconv () +´Ø¿ô¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¾ðÊó¤òɽ¤¹ +.I struct lconv +¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï +.BR locale (7) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤ª¤ê¡¢¥í¥±¡¼¥ë¡¦¥«¥Æ¥´¥ê +.B LC_NUMERIC +¤È +.B LC_MONETARY +¤Ë´ØÏ¢¤¹¤ë¤¹¤Ù¤Æ¤ÎÃͤò´Þ¤ó¤Ç¤¤¤ë¡£ +¤³¤Î´Ø¿ô¤òÍѤ¤¤ë¥×¥í¥°¥é¥à¤Ï¡¢¤ª¤½¤é¤¯Æ±»þ¤Ë +.BR printf (3) +¤ä +.BR strfmon (3) +¤Î¤è¤¦¤Ê´Ø¿ô¤âÍѤ¤¤ë¤À¤í¤¦¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¸½ºß»ÈÍѤµ¤ì¤Æ¤¤¤ë¥í¥±¡¼¥ë¤Ë½¾¤Ã¤¿Æ°ºî¤ò¤¹¤ë¡£ +.SH ½àµò +C89, C99 +.SH ¥Ð¥° +.BR printf (3) +¥°¥ë¡¼¥×¤Î´Ø¿ô¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤òÈ¿±Ç¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¤·¡¢ +¤·¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR locale (1), +.BR localedef (1), +.BR isalpha (3), +.BR nl_langinfo (3), +.BR setlocale (3), +.BR strcoll (3), +.BR strftime (3), +.BR locale (7) diff --git a/release/man3/lockf.3 b/release/man3/lockf.3 new file mode 100644 index 00000000..12906e72 --- /dev/null +++ b/release/man3/lockf.3 @@ -0,0 +1,178 @@ +.\" Copyright 1997 Nicolas Lichtmaier +.\" Created Thu Aug 7 00:44:00 ART 1997 +.\" +.\" 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. +.\" +.\" 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: +.\" +.TH LOCKF 3 2009-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +lockf \- ¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë POSIX ¥í¥Ã¥¯¤ÎŬÍÑ¡¦¥Æ¥¹¥È¡¦²ò½ü¤ò¹Ô¤¦ +.SH ½ñ¼° +.B #include +.sp +.BI "int lockf(int " fd ", int " cmd ", off_t " len ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR lockf (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥»¥¯¥·¥ç¥ó¤ËÂФ·¤Æ¡¢ +POSIX ¥í¥Ã¥¯¤ÎŬÍÑ¡¦¥Æ¥¹¥È¡¦²ò½ü¤ò¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤Ï +.I fd +¤Ç»ØÄꤵ¤ì¤ë¡£ +.I fd +¤Ï½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤·¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +¥¢¥¯¥·¥ç¥ó¤Ï +.I cmd +¤Ç»ØÄꤵ¤ì¤ë¡£ +.I pos +¤ò¸½ºß¤Î¥Õ¥¡¥¤¥ë°ÌÃ֤Ȥ¹¤ë¤È¡¢ +.I len +¤¬Àµ¤Î¾ì¹ç¡¢¥»¥¯¥·¥ç¥ó¤Ï¥Ð¥¤¥È°ÌÃÖ +.IR pos .. pos + len \-1 +¤È¤Ê¤ê¡¢ +.I len +¤¬Éé¤Î¾ì¹ç¡¢¥»¥¯¥·¥ç¥ó¤Ï¥Ð¥¤¥È°ÌÃÖ +.IR pos - len .. pos \-1 +¤È¤Ê¤ë¡£ +.I len +¤¬ 0 ¤Î¾ì¹ç¡¢¥»¥¯¥·¥ç¥ó¤Ï¸½ºß¤Î¥Õ¥¡¥¤¥ë°ÌÃÖ¤«¤é̵¸ÂÂç¤Þ¤Ç¤È¤Ê¤ë +(¤Ä¤Þ¤ê¸½ºß¤Î¡¢¤¢¤ë¤¤¤ÏÊѹ¹¤µ¤ì¤¿¾ì¹ç¤Ï¾­Íè¤Î¡¢¥Õ¥¡¥¤¥ë½ªÃ¼°ÌÃÖ¤Þ¤Ç)¡£ +¤É¤Î¾ì¹ç¤Ë¤ª¤¤¤Æ¤â¡¢¥»¥¯¥·¥ç¥ó¤Ï°ÊÁ°¤Î¥Õ¥¡¥¤¥ë½ªÃ¼¤è¤ê¤â³ÈÂ礵¤ì¤¦¤ë¡£ +.LP +Linux ¤Ç¤Ï¡¢ +.BR lockf () +¤Ïñ¤Ë +.BR fcntl (2) +¤Î¥í¥Ã¥¯¤Ø¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +¿¤¯¤Î¾¤Î¥·¥¹¥Æ¥à¤Ç +.BR lockf () +¤Ï¤³¤Î¤è¤¦¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +POSIX.1-2001 ¤Ç¤Ï +.BR lockf () +¤È +.BR fcntl (2) +¤Î¥í¥Ã¥¯¤È¤Î´Ø·¸¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤ª¤½¤é¤¯¡¢°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +.BR lockf () +¤È +.BR fcntl (2) +¤Î¥í¥Ã¥¯¤òº®¤¼¤Æ¸Æ¤Ó½Ð¤¹¤Î¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤í¤¦¡£ +.LP +Í­¸ú¤Ê¥ª¥×¥·¥ç¥ó¤ò°Ê²¼¤Ëµó¤²¤ë¡£ +.TP +.B F_LOCK +¥Õ¥¡¥¤¥ë¤Î»ØÄꤵ¤ì¤¿¥»¥¯¥·¥ç¥ó¤ËÇÓ¾¥í¥Ã¥¯¤òÀßÄꤹ¤ë¡£ +¤½¤Î¥»¥¯¥·¥ç¥ó (¤Î°ìÉô) ¤¬´û¤Ë¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢ +Á°¤Î¥í¥Ã¥¯¤¬²ò½ü¤µ¤ì¤ë¤Þ¤Ç´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤¬Á°¤Ë¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¥»¥¯¥·¥ç¥ó¤È½Å¤Ê¤Ã¤¿¾ì¹ç¡¢ +2 ¤Ä¤Î¥»¥¯¥·¥ç¥ó¤Ï·ë¹ç¤µ¤ì¤ë¡£ +¥í¥Ã¥¯¤òÊÝ»ý¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤¬¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë¤È¡¢ +¥Õ¥¡¥¤¥ë¥í¥Ã¥¯¤Ï²òÊü¤µ¤ì¤ë¡£ +»Ò¥×¥í¥»¥¹¤Ï¥í¥Ã¥¯¤ò·Ñ¾µ¤·¤Ê¤¤¡£ +.TP +.B F_TLOCK +.B F_LOCK +¤ÈƱÍͤǤ¢¤ë¤¬¡¢¥Õ¥¡¥¤¥ë¤¬´û¤Ë¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤Ï¥Ö¥í¥Ã¥¯¤ò¹Ô¤ï¤º¤Ë¥¨¥é¡¼¤òÊÖ¤¹¡£ +.TP +.B F_ULOCK +¥Õ¥¡¥¤¥ë¤Î»ØÄꤵ¤ì¤¿¥»¥¯¥·¥ç¥ó¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë¡£ +¤³¤ì¤Ë¤è¤ê¥í¥Ã¥¯¤µ¤ì¤¿¥»¥¯¥·¥ç¥ó¤¬ 2 ¤Ä¤Ëʬ³ä¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.B F_TEST +¼¡¤Î¤è¤¦¤Ë¥í¥Ã¥¯¤Î¥Æ¥¹¥È¤ò¤¹¤ë¡£ +»ØÄꤵ¤ì¤¿¥»¥¯¥·¥ç¥ó¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢ +¤³¤Î¥×¥í¥»¥¹¤Ë¤è¤ê¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢0 ¤òÊÖ¤¹¡£ +¾¤Î¥×¥í¥»¥¹¤¬¥í¥Ã¥¯¤òÊÝ»ý¤·¤Æ¤¤¤ë¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EAGAIN +(¤¤¤¯¤Ä¤«¤Î¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï +.BR EACCES ) +¤ËÀßÄꤹ¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¥¨¥é¡¼¤ËÂбþ¤·¤¿ÃͤËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.BR EACCES " ¤â¤·¤¯¤Ï " EAGAIN +¥í¥Ã¥¯¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¡¢ +.B F_TLOCK +¤Þ¤¿¤Ï +.B F_TEST +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ +¤Þ¤¿¤Ï¡¢¥Õ¥¡¥¤¥ë¤¬Â¾¤Î¥×¥í¥»¥¹¤Ë¤è¤ê¥á¥â¥ê¡¼¥Þ¥Ã¥×¤µ¤ì¤Æ¤ª¤ê¡¢ +»ØÄꤵ¤ì¤¿Áàºî¤¬¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EBADF +.I fd +¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EDEADLK +¥³¥Þ¥ó¥É¤¬ +.B T_LOCK +¤Ç¤¢¤ê¡¢¤³¤Î¥í¥Ã¥¯Áàºî¤ò¹Ô¤¦¤È¥Ç¥Ã¥É¥í¥Ã¥¯¤¬È¯À¸¤·¤Æ¤·¤Þ¤¦¡£ +.TP +.B EINVAL +.I fd +¤Ë̵¸ú¤ÊÁàºî¤¬»ØÄꤵ¤ì¤¿¡£ +.TP +.B ENOLCK +Èó¾ï¤Ë¿¤¯¤Î¥»¥°¥á¥ó¥È¥í¥Ã¥¯¤¬³«¤«¤ì¡¢¥í¥Ã¥¯¥Æ¡¼¥Ö¥ë¤¬°ìÇդǤ¢¤ë¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR fcntl (2), +.BR flock (2) +.br +¥«¡¼¥Í¥ë¥½¡¼¥¹¤Î +.I Documentation/filesystems +¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë +.I locks.txt +¤È +.I mandatory-locking.txt +(°ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï +.I Documentation +¥Ç¥£¥ì¥¯¥È¥êľ²¼¤Ë¤¢¤ê¡¢ +.I mandatory-locking.txt +¤Ï +.I mandatory.txt +¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤Ã¤¿¡£) diff --git a/release/man3/log.3 b/release/man3/log.3 new file mode 100644 index 00000000..25ba2c00 --- /dev/null +++ b/release/man3/log.3 @@ -0,0 +1,135 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 Wed Aug 6 00:35:20 JST 2003 +.\" by Akihiro MOTOKI +.\" Updated 2008-09-16, Akihiro MOTOKI +.\" +.TH LOG 3 2008-08-10 "" "Linux Programmer's Manual" +.SH ̾Á° +log, logf, logl \- ¼«Á³Âпô´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double log(double " x ); +.br +.BI "float logf(float " x ); +.br +.BI "long double logl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR logf (), +.BR logl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR log () +´Ø¿ô¤Ï \fIx\fP ¤Î¼«Á³Âпô¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤Î¼«Á³Âпô¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ 1 ¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ 0 ¤Î¾ì¹ç¡¢¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.RB - HUGE_VAL , +.RB - HUGE_VALF , +.RB - HUGE_VALL +¤òÊÖ¤¹¡£ + +.I x +¤¬Éé¤Î¾ì¹ç (Éé¤Î̵¸ÂÂç¤â´Þ¤à)¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ +NaN (not a number) ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬Éé¤Ç¤¢¤ë +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.TP +¶Ë¥¨¥é¡¼ (pole error): \fIx\fP ¤¬ 0 ¤Ç¤¢¤ë +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_DIVBYZERO ) +¤¬¾å¤¬¤ë¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +glibc 2.5 °ÊÁ°¤Ç¤Ï¡¢ +NaN ¤ËÂФ·¤Æ +.BR log () +¤ò¤È¤ë¤È¡¢´Ö°ã¤Ã¤ÆÉÔÀµÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬È¯À¸¤·¤Æ¤¤¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR clog (3), +.BR log1p (3), +.BR sqrt (3) diff --git a/release/man3/log10.3 b/release/man3/log10.3 new file mode 100644 index 00000000..c276c335 --- /dev/null +++ b/release/man3/log10.3 @@ -0,0 +1,96 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 Wed Aug 6 00:35:20 JST 2003 +.\" by Akihiro MOTOKI +.\" Updated 2008-09-16, Akihiro MOTOKI +.\" +.TH LOG10 3 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +log10, log10f, log10l \- Ä줬 10 ¤ÎÂпô´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double log10(double " x ); +.br +.BI "float log10f(float " x ); +.br +.BI "long double log10l(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR log10f (), +.BR log10l (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR log10 () +´Ø¿ô¤Ï \fIx\fP ¤Î¾ïÍÑÂпô (Ä줬 10 ¤ÎÂпô) ¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤Î¾ïÍÑÂпô (Ä줬 10 ¤ÎÂпô) ¤òÊÖ¤¹¡£ + +.I x +¤¬ 0¡¢1¡¢É顢̵¸ÂÂç¡¢NaN ¤Ê¤É¤Î¤µ¤Þ¤¶¤Þ¤ÊÆÃÊ̤ʾõ¶·¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR log (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ + +¤³¤ì¤é¤Î´Ø¿ô¤ÇȯÀ¸¤¹¤ë¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR log (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR clog10 (3), +.BR exp10 (3), +.BR sqrt (3) diff --git a/release/man3/log1p.3 b/release/man3/log1p.3 new file mode 100644 index 00000000..8ccb2c9b --- /dev/null +++ b/release/man3/log1p.3 @@ -0,0 +1,135 @@ +.\" Copyright 1995 Jim Van Zandt +.\" 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. +.\" +.\" 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 LOG1P 3 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +log1p, log1pf, log1pl \- °ú¤­¿ô¤Ë 1 ¤ò²Ã¤¨¤¿ÃͤÎÂпô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double log1p(double " x ); +.br +.BI "float log1pf(float " x ); +.br +.BI "long double log1pl(long double " x ); +.sp +.fi +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR log1p (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR log1pf (), +.BR log1pl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.I log1p(x) +¤Ï°Ê²¼¤ÈÅù²Á¤ÊÃͤòÊÖ¤¹¡£ +.nf + + log (1 + \fIx\fP) + +.fi +\fIx\fP ¤ÎÃͤ¬ 0 ¤Ë¶á¤¤¾ì¹ç¤Ç¤âÀµ³Î¤Ë·×»»¤Ç¤­¤ëÊýË¡¤¬ÍѤ¤¤é¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I "(1\ +\ x)" +¤Î¼«Á³Âпô¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ \-1 ¤Î¾ì¹ç¡¢¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.RB - HUGE_VAL , +.RB - HUGE_VALF , +.RB - HUGE_VALL +¤òÊÖ¤¹¡£ + +.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 +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬ \-1 ¤è¤ê¾®¤µ¤¤ +.\" .I errno +.\" is set to +.\" .BR EDOM . +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.TP +¶Ë¥¨¥é¡¼ (pole error): \fIx\fP ¤¬ \-1 ¤Ç¤¢¤ë +.\" .I errno +.\" is set to +.\" .BR ERANGE . +0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_DIVBYZERO ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.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 +.SH ½àµò +C99, POSIX.1-2001. +.\" BSD +.SH ´ØÏ¢¹àÌÜ +.BR exp (3), +.BR expm1 (3), +.BR log (3) diff --git a/release/man3/log2.3 b/release/man3/log2.3 new file mode 100644 index 00000000..2cb2fc67 --- /dev/null +++ b/release/man3/log2.3 @@ -0,0 +1,99 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995-08-14 by Arnt Gulbrandsen +.\" 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 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +log2, log2f, log2l \- Ä줬 2 ¤ÎÂпô´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double log2(double " x ); +.br +.BI "float log2f(float " x ); +.br +.BI "long double log2l(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR log2 (), +.BR log2f (), +.BR log2l (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR log2 () +´Ø¿ô¤ÏÄì¤ò 2 ¤È¤¹¤ë \fIx\fP ¤ÎÂпô¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÄì¤ò 2 ¤È¤¹¤ëÂпô¤òÊÖ¤¹¡£ + +.I x +¤¬ 0¡¢1¡¢É顢̵¸ÂÂç¡¢NaN ¤Ê¤É¤Î¤µ¤Þ¤¶¤Þ¤ÊÆÃÊ̤ʾõ¶·¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR log (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ + +¤³¤ì¤é¤Î´Ø¿ô¤ÇȯÀ¸¤¹¤ë¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR log (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR clog2 (3), +.BR sqrt (3) diff --git a/release/man3/logb.3 b/release/man3/logb.3 new file mode 100644 index 00000000..8f6ec988 --- /dev/null +++ b/release/man3/logb.3 @@ -0,0 +1,138 @@ +.\" 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. +.\" +.\" 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 ÈóÀµµ¬²½¤Î +.\" +.TH LOGB 3 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +logb, logbf, logbl \- ÉâÆ°¾®¿ôÅÀ¿ô¤Î»Ø¿ô¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "double logb(double " x ); +.br +.BI "float logbf(float " x ); +.br +.BI "long double logbl(long double " x ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR logb (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR logbf (), +.BR logbl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ +.I x +¤ÎÉâÆ°¾®¿ôÅÀ¤ÎÆâÉôɽ¸½¤«¤é»Ø¿ôÉô¤òÃê½Ð¤·¡¢ÉâÆ°¾®¿ôÅÀ¿ôÃͤȤ·¤ÆÊÖ¤¹¡£ +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÀ°¿ôÄê¿ô +.B FLT_RADIX +¤Ï¡¢¥·¥¹¥Æ¥à¤ÎÉâÆ°¾®¿ôÅÀɽ¸½¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë´ð¿ô¤òɽ¤¹¡£ +.B FLT_RADIX +¤¬ 2 ¤Î¾ì¹ç¡¢ +.BI logb( x ) +¤Ï +.BI floor(log2( x ))\fR +¤ÈÅù¤·¤¤¤¬¡¢¸å¼Ô¤ÎÊý¤¬¤¿¤Ö¤ó¹â®¤Ç¤¢¤ë¡£ +.LP +.I x +¤¬ÈóÀµµ¬²½¿ô¤Î¾ì¹ç¡¢ +.BR logb () +¤Ï +.I x +¤¬Àµµ¬²½¤µ¤ì¤¿¾ì¹ç¤Î»Ø¿ô¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤Î»Ø¿ôÉô¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ 0 ¤Î¾ì¹ç¡¢¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.RB - HUGE_VAL , +.RB - HUGE_VALF , +.RB - HUGE_VALL +¤òÊÖ¤¹¡£ + +.I x +¤¬Éé¤Î̵¸ÂÂ礫Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ +.\" .SH ÊÖ¤êÃÍ +.\" ¤³¤ì¤é¤Î´Ø¿ô¤Ï°ú¤­¿ô¤Î»Ø¿ôÉô¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +¶Ë¥¨¥é¡¼ (pole error): \fIx\fP ¤¬ 0 ¤Ç¤¢¤ë +.\" .I errno +.\" is set to +.\" .BR ERANGE . +0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_DIVBYZERO ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.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 +.\" +.\" .SH ÍúÎò +.\" .BR logb () +.\" ´Ø¿ô¤Ï 4.3BSD ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.\" 4.3BSD ¥Þ¥Ë¥å¥¢¥ë¤Î IEEE.3 ¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR ilogb (3), +.BR log (3) diff --git a/release/man3/login.3 b/release/man3/login.3 new file mode 100644 index 00000000..376c3a3f --- /dev/null +++ b/release/man3/login.3 @@ -0,0 +1,134 @@ +.\" 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. +.\" +.\" Derived from text written by Martin Schulze (or taken from glibc.info) +.\" and text written by Paul Thompson - both copyright 2002. +.\" +.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO +.\" all rights reserved. +.\" Translated Thu Aug 26 06:04:53 JST 2004 +.\" by Yuichi SATO +.\" Updated & Modified Sat Jan 15 06:38:41 JST 2005 by Yuichi SATO +.\" +.TH LOGIN 3 2004-05-06 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +login, logout \- utmp ¤È wtmp ¥¨¥ó¥È¥ê¤ò½ñ¤­¹þ¤à +.SH ½ñ¼° +.B #include +.sp +.BI "void login(const struct utmp *" ut ); +.sp +.BI "int logout(const char *" ut_line ); +.sp +\fI\-lutil\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +utmp ¥Õ¥¡¥¤¥ë¤Ï¸½ºß¥·¥¹¥Æ¥à¤ò»ÈÍѤ·¤Æ¤¤¤ë¥æ¡¼¥¶¤òµ­Ï¿¤¹¤ë¡£ +wtmp ¥Õ¥¡¥¤¥ë¤Ï¤¹¤Ù¤Æ¤Î¥í¥°¥¤¥ó¤È¥í¥°¥¢¥¦¥È¤òµ­Ï¿¤¹¤ë¡£ +.BR utmp (5) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.LP +´Ø¿ô +.BR login () +¤ÏÍ¿¤¨¤é¤ì¤¿ \fIstruct utmp\fP +.I ut +¤ò utmp ¤È wtmp ¥Õ¥¡¥¤¥ë¤ÎξÊý¤Ë½ñ¤­¹þ¤à¡£ +.LP +´Ø¿ô +.BR logout () +¤Ï utmp ¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë¥¨¥ó¥È¥ê¤ò¥¯¥ê¥¢¤¹¤ë¡£ +.SS "GNU ÈǤξܺÙ" +¤è¤êÀµ³Î¤Ë¤Ï¡¢ +.BR login () +¤Ï°ú¤­¿ô +.I ut +¹½Â¤ÂΤò¤È¤ê¡¢(¤â¤·Â¸ºß¤¹¤ë¤Ê¤é¤Ð) ¥Õ¥£¡¼¥ë¥É +.I ut\->ut_type +¤ò +.B USER_PROCESS +¤È¤¤¤¦Ãͤˤ·¡¢(¤â¤·Â¸ºß¤¹¤ë¤Ê¤é¤Ð) ¥Õ¥£¡¼¥ë¥É +.I ut\->ut_pid +¤ò¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤ÎÃͤˤ¹¤ë¡£ +¼¡¤Ë¥Õ¥£¡¼¥ë¥É +.I ut\->ut_line +¤ÎÃͤòÀßÄꤷ¤è¤¦¤È¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢É¸½àÆþÎÏ¡¦É¸½à½ÐÎÏ¡¦É¸½à¥¨¥é¡¼½ÐÎϤÎÃ椫¤é +üËö (tty) ¤Ç¤¢¤ëºÇ½é¤Î¤â¤Î¤ò¤È¤ê¡¢ +Âбþ¤¹¤ë¥Ñ¥¹Ì¾¤«¤éÀèƬ¤Î \fI/dev/\fP ¤ò°ú¤¤¤¿¤â¤Î¤ò +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë³ÊǼ¤·¤Æ¡¢¤³¤Î¹½Â¤ÂΤò utmp ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à¡£ +°ìÊý¡¢Ã¼Ëö̾¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï "???" ¤È¤µ¤ì¤Æ¡¢ +¤³¤Î¹½Â¤ÂÎ¤Ï utmp ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤Ê¤¤¡£ +¤½¤Î¸å¤Ë¤³¤Î¹½Â¤ÂÎ¤Ï wtmp ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.LP +.BR logout () +´Ø¿ô¤Ï utmp ¥Õ¥¡¥¤¥ë¤«¤é +.I ut_line +°ú¤­¿ô¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤òõ¤¹¡£ +¥ì¥³¡¼¥É¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¡¢ +.I ut_name +¤È +.I ut_host +¥Õ¥£¡¼¥ë¥É¤ò¥¯¥ê¥¢¤·¤Æ¡¢ +.I ut_tv +¥¿¥¤¥à¥¹¥¿¥ó¥×¥Õ¥£¡¼¥ë¥É¤ò¹¹¿·¤·¡¢ +(¤â¤·Â¸ºß¤¹¤ë¤Ê¤é¤Ð) +.I ut_type +¥Õ¥£¡¼¥ë¥É¤ò +.B DEAD_PROCESS +¤Ë¹¹¿·¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +¥¨¥ó¥È¥ê¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë½ñ¤­¹þ¤à¤Î¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ +.BR logout () +´Ø¿ô¤Ï 1 ¤òÊÖ¤¹¡£ +¤Þ¤¿¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢0 ¤òÊÖ¤¹¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /var/run/utmp +¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¡£ +.I +¤Ë¤ª¤±¤ë +.B _PATH_UTMP +¤ÇÀßÄꤵ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /var/log/wtmp +¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È¥í¥°¥Õ¥¡¥¤¥ë¡£ +.I +¤Ë¤ª¤±¤ë +.B _PATH_WTMP +¤ÇÀßÄꤵ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¤Ë¸ºß¤¹¤ë¡£ +.SH Ãí°Õ +.I struct utmp +¤Î¥á¥ó¥Ð +.I ut_user +¤Ï¡¢BSD ¤Ç¤Ï +.I ut_name +¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤½¤Î¤¿¤á +.I ut_name +¤Ï +.I +¤Ë¤ª¤¤¤Æ +.I ut_user +¤Î¥¨¥¤¥ê¥¢¥¹¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getutent (3), +.BR utmp (5) diff --git a/release/man3/longjmp.3 b/release/man3/longjmp.3 new file mode 100644 index 00000000..c813c171 --- /dev/null +++ b/release/man3/longjmp.3 @@ -0,0 +1,137 @@ +.\" Written by Michael Haardt, Fri Nov 25 14:51:42 MET 1994 +.\" +.\" 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. +.\" +.\" Added siglongjmp, Sun Mar 2 22:03:05 EST 1997, jrv@vanzandt.mv.com +.\" Modifications, Sun Feb 26 14:39:45 1995, faith@cs.unc.edu +.\" " +.\" Japanese Version Copyright (c) 1998 Seiiti Obara +.\" all rights reserved. +.\" Translated 1998-05-27, Seiiti Obara +.\" Updated 2009-02-24, Akihiro MOTOKI, LDP v3.19 +.\" +.\"WORD: stack context ¥¹¥¿¥Ã¥¯¥³¥ó¥Æ¥­¥¹¥È +.\"WORD: signal masks ¥·¥°¥Ê¥ë¥Þ¥¹¥¯ +.\"WORD: signal context ¥·¥°¥Ê¥ë¥³¥ó¥Æ¥­¥¹¥È +.\"WORD: flag ¥Õ¥é¥° +.\"WORD: low-level Äã¥ì¥Ù¥ë +.\" +.TH LONGJMP 3 2009-01-13 "" "Linux Programmer's Manual" +.SH ̾Á° +longjmp, siglongjmp \- Êݸ¤µ¤ì¤¿¥¹¥¿¥Ã¥¯¥³¥ó¥Æ¥­¥¹¥È (stack context) +¤Ø¤ÎÈó¶É½êŪ¤Ê¥¸¥ã¥ó¥× +.SH ½ñ¼° +.nf +.B #include + +.BI "void longjmp(jmp_buf " env ", int " val ); + +.BI "void siglongjmp(sigjmp_buf " env ", int " val ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR siglongjmp (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_C_SOURCE +.SH ÀâÌÀ +.BR longjmp () +¤È +.BR setjmp (3) +¤Ï¡¢¥×¥í¥°¥é¥à¤ÎÄã¥ì¥Ù¥ë¤Ê¥µ¥Ö¥ë¡¼¥Á¥ó¤Ë¤ª¤¤¤Æ¡¢ +¥¨¥é¡¼¤ä³ä¤ê¹þ¤ß¤¬È¯À¸¤·¤¿»þ¤Î½èÍý¤ËÊØÍø¤Ç¤¢¤ë¡£ +.BR longjmp () +¤Ï¡¢\fIenv\fP °ú¤­¿ô¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿ºÇ¸å¤Î +.BR setjmp (3) +¤Ë¤è¤Ã¤ÆÊݸ¤µ¤ì¤¿´Ä¶­¤òÉü¸µ¤¹¤ë¡£ +.BR longjmp () +¤Î´°Î»¸å¡¢¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤Ï¡¢¤Þ¤ë¤ÇÂбþ¤¹¤ë +.BR setjmp (3) +¤Î¸Æ¤Ó½Ð¤·¤¬ÃÍ \fIval\fP ¤ÇÊ֤äÆÍ褿¤«¤è¤¦¤Ë³¹Ô¤µ¤ì¤ë¡£ +.BR longjmp () +¤Ï 0 ¤òÊÖ¤¹¤è¤¦¤Ë»Ø¼¨¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +ÆóÈÖÌܤΰú¤­¿ô¤Ë 0 ¤ò»ØÄꤷ¤Æ +.BR longjmp () +¤¬¸Æ¤Ð¤ì¤¿¾ì¹ç¤Ï¡¢Âå¤ï¤ê¤Ë 1 ¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.P +.BR siglongjmp () +¤Ï¡¢°ú¤­¿ô \fIenv\fP ¤Î·¿¤¬°Û¤Ê¤ëÅÀ°Ê³°¤Ï¡¢ +.BR longjmp () +¤ÈƱÍͤǤ¢¤ë¡£ +\fIenv\fP ¤òÊݸ¤·¤¿ +.BR sigsetjmp (3) +¤¬ 0 °Ê³°¤Î \fIsavesigs\fP ¥Õ¥é¥°¤Ç¸Æ¤Ó½Ð¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ç¡¢ +¤«¤Ä¡¢¤½¤Î¾ì¹ç¤Ë¤Î¤ß¡¢ +.BR siglongjmp (3) +¤Ï +.BR sigsetjmp (3) +¤è¤êÊݸ¤µ¤ì¤Æ¤¤¤¿¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÎÉü¸µ¤ò¹Ô¤¦¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤¬Ê֤뤳¤È¤Ï¤Ê¤¤¡£ +.SH ½àµò +.BR longjmp () +¤Ï C89, C99, POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.BR siglongjmp () +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +POSIX ¤Ç¤Ï¡¢ +.BR longjmp () +¤¬¥·¥°¥Ê¥ë¥³¥ó¥Æ¥­¥¹¥È (signal context) ¤òÉü¸µ¤¹¤ë¤«¤É¤¦¤«µ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤ +.RB ( setjmp (3) +¤Ë¤â¾¯¤·¾Ü¤·¤¤¾ðÊ󤬤¢¤ë)¡£ +°Ü¿¢À­¤Î¤¢¤ëÊýË¡¤Ç¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊݸ¤·Éü¸µ¤µ¤»¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +.BR sigsetjmp (3) +¤È +.BR siglongjmp () +¤ò»È¤¦¤³¤È¡£ +.P +°Ê²¼¤Î¾ò·ï¤¬Á´¤ÆÀ®Î©¤¹¤ë¾ì¹ç¡¢ +.BR longjmp () +¤Î¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤¿¸å¤Î¼«Æ°ÊÑ¿ô¤ÎÃͤÏ̤ÄêµÁ (unspecified) ¤È¤Ê¤ë¡£ +.IP \(bu 3 +¤½¤Î¼«Æ°ÊÑ¿ô¤¬¡¢Âбþ¤¹¤ë +.BR setjmp (3) +¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ã¤¿´Ø¿ô¤Î¥í¡¼¥«¥ëÊÑ¿ô¤Ç¤¢¤ë¡£ +.IP \(bu +¼«Æ°ÊÑ¿ô¤ÎÃͤ¬ +.BR setjmp (3) +¤È +.BR longjmp () +¤Î´Ö¤ÇÊѹ¹¤µ¤ì¤Æ¤¤¤ë¡£ +.IP \(bu +.I volatile +¤È¤·¤ÆÀë¸À¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.P +ƱÍͤÎÃí°Õ¤¬ +.BR siglongjmp () +¤Ë¤â¤¢¤Æ¤Ï¤Þ¤ë¡£ +.P +.BR longjmp () +¤ä +.BR siglongjmp () +¤ò»È¤¦¤È¡¢¥×¥í¥°¥é¥à¤ÏÍý²ò¤·¤Å¤é¤¯¡¢Êݼ餷¤Ë¤¯¤¤¤â¤Î¤Ë¤Ê¤ë¡£ +Ê̤ÎÊýË¡¤¬²Äǽ¤Ê¤é¡¢¤½¤ì¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR setjmp (3), +.BR sigsetjmp (3) diff --git a/release/man3/lrint.3 b/release/man3/lrint.3 new file mode 100644 index 00000000..4d7742e5 --- /dev/null +++ b/release/man3/lrint.3 @@ -0,0 +1,116 @@ +.\" Copyright 2001 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. +.\" +.\" 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 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +lrint, lrintf, lrintl, llrint, llrintf, llrintl \- ºÇ¤â¶á¤¤À°¿ôÃͤ˴ݤá¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long int lrint(double " x ); +.br +.BI "long int lrintf(float " x ); +.br +.BI "long int lrintl(long double " x ); +.sp +.BI "long long int llrint(double " x ); +.br +.BI "long long int llrintf(float " x ); +.br +.BI "long long int llrintl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +All functions shown above: +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¸½ºß¤Î´Ý¤áÊý¸þ¤Ë´ð¤Å¤­¡¢ºÇ¤â¶á¤¤À°¿ô¤Ë°ú¤­¿ô¤ò´Ý¤á¤ë +(¸½ºß¤Î´Ý¤áÊý¸þ¤Ë¤Ä¤¤¤Æ¤Ï +.BR fesetround (3) +¤ò»²¾È)¡£ + +.BR rint (3) +¤È°ã¤¤¡¢¤³¤ì¤é¤Î´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ï°ú¤­¿ô¤Î·¿¤È°Û¤Ê¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï´Ý¤á¤¿À°¿ôÃͤòÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤«Ìµ¸ÂÂç¤Î¾ì¹ç¡¢¤â¤·¤¯¤Ï´Ý¤á¤¿Ãͤ¬Â礭²á¤®¤Æ +.I long +.RB ( ll* +´Ø¿ô¤Î¾ì¹ç¤Ë¤Ï +.IR "long long" ) +¤Ë³ÊǼ¤Ç¤­¤Ê¤¤¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ÊÖ¤êÃͤÏÉÔÄê¤È¤Ê¤ë¡£ +.\" The return value is -(LONG_MAX - 1) or -(LLONG_MAX -1) +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼: \fIx\fP ¤¬ NaN ¤«Ìµ¸ÂÂç¡¢¤â¤·¤¯¤Ï´Ý¤á¤¿Ãͤ¬Â礭²á¤®¤ë +.\" .I errno +.\" is set to +.\" .BR EDOM . +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR ceil (3), +.BR floor (3), +.BR lround (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3) diff --git a/release/man3/lround.3 b/release/man3/lround.3 new file mode 100644 index 00000000..a2644585 --- /dev/null +++ b/release/man3/lround.3 @@ -0,0 +1,120 @@ +.\" Copyright 2001 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. +.\" +.\" 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 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +lround, lroundf, lroundl, llround, llroundf, llroundl \- +(0 ¤«¤é±ó¤¤Êý¤Î) ºÇ¤â¶á¤¤À°¿ôÃͤ˴ݤá¤ë +.nf +.B #include +.sp +.BI "long int lround(double " x ); +.br +.BI "long int lroundf(float " x ); +.br +.BI "long int lroundl(long double " x ); +.sp +.BI "long long int llround(double " x ); +.br +.BI "long long int llroundf(float " x ); +.br +.BI "long long int llroundl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +¤³¤³¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î´Ø¿ô: +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +\"O .SH DESCRIPTION +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤ÏºÇ¤â¶á¤¤À°¿ô¤Ë°ú¤­¿ô¤ò´Ý¤á¤ë¡£ +¸½ºß¤Î´Ý¤áÊý¸þ¤Ë´Ø·¸¤Ê¤¯¡¢ +0 ¤«¤é±ó¤¤Êý¤ÎºÇ¤â¶á¤¤À°¿ô¤Ë°ú¤­¿ô¤Ï´Ý¤á¤é¤ì¤ë +(¸½ºß¤Î´Ý¤áÊý¸þ¤Ë¤Ä¤¤¤Æ¤Ï +.BR fenv (3) +»²¾È)¡£ + +.BR round (3), +.BR ceil (3) +¤Ê¤É¤È°ã¤¤¡¢¤³¤ì¤é¤Î´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ï°ú¤­¿ô¤Î·¿¤È°Û¤Ê¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï´Ý¤á¤¿À°¿ôÃͤòÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤«Ìµ¸ÂÂç¤Î¾ì¹ç¡¢¤â¤·¤¯¤Ï´Ý¤á¤¿Ãͤ¬Â礭²á¤®¤Æ +.I long +.RB ( ll* +´Ø¿ô¤Î¾ì¹ç¤Ë¤Ï +.IR "long long" ) +¤Ë³ÊǼ¤Ç¤­¤Ê¤¤¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ÊÖ¤êÃͤÏÉÔÄê¤È¤Ê¤ë¡£ +.\" The return value is -(LONG_MAX - 1) or -(LLONG_MAX -1) +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬ NaN ¤«Ìµ¸ÂÂç¡¢¤â¤·¤¯¤Ï´Ý¤á¤¿Ãͤ¬Â礭²á¤®¤ë +.\" .I errno +.\" is set to +.\" .BR EDOM . +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR ceil (3), +.BR floor (3), +.BR lrint (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3) diff --git a/release/man3/lsearch.3 b/release/man3/lsearch.3 new file mode 100644 index 00000000..7c7a5ef8 --- /dev/null +++ b/release/man3/lsearch.3 @@ -0,0 +1,95 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" Copyright 1995 Jim Van Zandt +.\" +.\" 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. +.\" +.\" Corrected prototype and include, aeb, 990927 +.\" +.\" Japanese Version Copyright (c) 1998 Ueyama Rui +.\" all rights reserved. +.\" Translated 1998-05-23, Ueyama Rui +.\" Updated 2005-02-26, Akihiro MOTOKI +.\" +.\"WORD: linear search Àþ·Á¸¡º÷ +.\" +.TH LSEARCH 3 1999-09-27 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +lfind, lsearch \- ÇÛÎó¤òÀþ·Á¸¡º÷¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *lfind(const void *" key ", const void *" base ", size_t *" nmemb , +.BI " size_t " size ", int(*" compar ")(const void *, const void *));" +.sp +.BI "void *lsearch(const void *" key ", void *" base ", size_t *" nmemb , +.BI " size_t " size ", int(*" compar ")(const void *, const void *));" +.fi +.SH ÀâÌÀ +.BR lfind () +¤È +.BR lsearch () +¤Ï¡¢ +.I size +¥Ð¥¤¥È¤ÎÍ×ÁÇ +.I *nmemb +¸Ä¤«¤é¤Ê¤ëÇÛÎó +.I base +¤«¤é¡¢ +.I key +¤òÀþ·Á¸¡º÷¤¹¤ë¡£Èæ³Ó¤ò¹Ô¤¦¤Î¤Ï +.I compar +¤¬»²¾È¤·¤Æ¤¤¤ë´Ø¿ô¤Ç¡¢ +¤³¤ì¤Ï 2¤Ä¤Î°ú¤­¿ô¤ò»ý¤Á¡¢1¤Ä¤á¤Î°ú¤­¿ô¤¬ +.I key +¤ò¡¢2¤Ä¤á¤Î°ú¤­¿ô¤ÏÇÛÎó¥á¥ó¥Ð¡¼¤ò»Ø¤¹¡£¤Þ¤¿ +.I compar +¤Ï¡¢ +.I key +¤¬ÇÛÎó¤Î¥á¥ó¥Ð¡¼¤È¥Þ¥Ã¥Á¤·¤¿¤Ê¤é 0¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð +0 °Ê³°¤òÊÖ¤¹¤³¤È¤¬´üÂÔ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.BR lsearch () +¤Ï¡¢¥Þ¥Ã¥Á¤¹¤ëÍ×ÁǤò¸«¤Ä¤±¤é¤ì¤Ê¤«¤Ã¤¿¤È¤­¡¢ +ÇÛÎó¤ÎºÇ¸å¤Ë +.I key +¤ò¤Ä¤±²Ã¤¨¤ë¡£¤½¤·¤Æ +.I *nmemb +¤ò 1 ¤Õ¤ä¤¹¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ëºÝ¤Ë¤Ï¡¢¥Þ¥Ã¥Á¤¹¤ëÍ×ÁǤ¬Â¸ºß¤¹¤ë¤«¡¢ +¤â¤·¤¯¤ÏÇÛÎó¤ËÍ×ÁǤòÄɲ乤뤿¤á¤ÎÎΰ褬¤¢¤ë¤«¡¢¤òÇÄ°®¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR lfind () +¤ÎÊÖ¤êÃͤϡ¢ÇÛÎó¤Î¥Þ¥Ã¥Á¤·¤¿¥á¥ó¥Ð¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤â¤·¥Þ¥Ã¥Á¤¹¤ë¥á¥ó¥Ð¡¼¤¬¸«¤Ä¤«¤é¤Ê¤¤¤È NULL ¤òÊÖ¤¹¡£ +.BR lsearch () +¤ÎÊÖ¤êÃͤ⡢ÇÛÎó¤Î¥Þ¥Ã¥Á¤·¤¿¥á¥ó¥Ð¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +¥Þ¥Ã¥Á¤¹¤ë¥á¥ó¥Ð¡¼¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¤È¤­¤Ï¡¢ +¿·¤¿¤Ë¤Ä¤±²Ã¤¨¤¿¥á¥ó¥Ð¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +libc ¤Ë¤Ï libc-4.6.27 °Ê¹ß¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +´Ø¿ô¤Î̾Á°¤ÎÁª¤ÓÊý¤¬¤è¤¯¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR bsearch (3), +.BR hsearch (3), +.BR tsearch (3) diff --git a/release/man3/lseek64.3 b/release/man3/lseek64.3 new file mode 100644 index 00000000..62653ca1 --- /dev/null +++ b/release/man3/lseek64.3 @@ -0,0 +1,168 @@ +.\" Copyright 2004 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) 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Jan 30 03:23:04 JST 2005 +.\" by Yuichi SATO +.\" +.TH LSEEK64 3 2004-12-11 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +lseek64 \- ¥Õ¥¡¥¤¥ë¤Î 64 ¥Ó¥Ã¥È¤ÎÆɤ߽ñ¤­¥ª¥Õ¥»¥Ã¥È¤Î°ÌÃÖ¤òÊѤ¨¤ë +.SH ½ñ¼° +.B #define _LARGEFILE64_SOURCE +.br +.B #include +.br +.B #include +.sp +.BI "off64_t lseek64(int " fd ", off64_t " offset ", int " whence ); +.SH ÀâÌÀ +.BR lseek (2) +´Ø¿ô¥Õ¥¡¥ß¥ê¡¼¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë´ØÏ¢¤¹¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥ª¥Õ¥»¥Ã¥È¤ò¡¢ +¥Õ¥¡¥¤¥ë¤Î³«»Ï°ÌÃÖ¡¦¸½ºß°ÌÃÖ¡¦½ªÃ¼¤«¤é +.I offset +¤Î°ÌÃÖ¤ØÊѹ¹¤¹¤ë¡£ +¤³¤ì¤Ï +.I whence +¤¬¤½¤ì¤¾¤ì +.BR SEEK_SET , +.BR SEEK_CUR , +.B SEEK_END +¤Î¾ì¹ç¤ËÂбþ¤¹¤ë¡£ +.LP +¹¹¤Ë¾Ü¤·¤¤ÀâÌÀ¡¦ÊÖ¤êÃÍ¡¦¥¨¥é¡¼¤Ï¡¢ +.BR lseek (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +4 ¤Ä¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬»ÈÍѲÄǽ¤Ç¤¢¤ë: +.BR lseek (2), +.BR lseek64 (), +.BR llseek (2) +¤È¸µ¤È¤Ê¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR _llseek (2) +¤Ç¤¢¤ë¡£ +.SS lseek +¥×¥í¥È¥¿¥¤¥×: +.nf +.sp +.in +4n +.BI "off_t lseek(int " fd ", off_t " offset ", int " whence ); +.in +.fi +.sp +.BR lseek (2) +¤Ï·¿ +.I off_t +¤ò»È¤¦¡£ +¤³¤ì¤Ï 32 ¥Ó¥Ã¥È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¾å¤Ç¤Ï 32 ¥Ó¥Ã¥ÈÉä¹æÉÕ¤­·¿¤Ç¤¢¤ë¡£ +¤¿¤À¤·¡¢ +.nf +.sp +.in +4n +#define _FILE_OFFSET_BITS 64 +.in +.sp +.fi +¤òÄêµÁ¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤¿¾ì¹ç¤Ï 64 ¥Ó¥Ã¥ÈÉä¹æÉÕ¤­·¿¤Ç¤¢¤ë¡£ +.SS lseek64 +¥×¥í¥È¥¿¥¤¥×: +.nf +.sp +.in +4n +.BI "off64_t lseek64(int " fd ", off64_t " offset ", int " whence ); +.in +.fi +.sp +¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR lseek64 () +¤Ï +.I off_t +¤¬ 32 ¥Ó¥Ã¥È·¿¤Ç¤¢¤Ã¤Æ¤â 64 ¥Ó¥Ã¥È·¿¤ò»È¤¦¡£ +¤³¤Î¥×¥í¥È¥¿¥¤¥× (¤È·¿ +.IR off64_t ) +¤Ï¡¢°Ê²¼¤ÎÄêµÁ¤ò¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤¿¾ì¹ç¤Ë¤Î¤ß»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.nf +.sp +.in +4n +#define _LARGEFILE64_SOURCE +.in +.sp +.fi +´Ø¿ô +.BR lseek64 () +.\" glibc 2.0.94 ¤Ë¤Ï¸ºß¤¹¤ë¤¬ 2.0.6 ¤Ë¤Ï¸ºß¤·¤Ê¤¤ +¤Ï glibc 2.1 °Ê¹ß¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ê¡¢ +.BR llseek () +¤Î¥¨¥¤¥ê¥¢¥¹¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SS llseek +¥×¥í¥È¥¿¥¤¥×: +.nf +.sp +.in +4n +.BI "loff_t llseek(int " fd ", loff_t " offset ", int " whence ); +.in +.fi +.sp +·¿ +.I loff_t +¤Ï 64 ¥Ó¥Ã¥ÈÉä¹æÉÕ¤­·¿¤Ç¤¢¤ë¡£ +¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR llseek () +.\" libc 5.0.9 ¤Ë¤Ï¸ºß¤¹¤ë¤¬ 4.7.6 ¤Ï¸ºß¤·¤Ê¤¤ +¤Ï libc5 ¤È glibc ¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ê¡¢ÆÃÊ̤ÊÄêµÁ¤Ê¤·¤ËÆ°ºî¤¹¤ë¡£ +¤³¤Î¥×¥í¥È¥¿¥¤¥×¤Ï¡¢libc5 ¤Ç¤Ï +.I +¤ÇÍ¿¤¨¤é¤ì¤ë¤¬¡¢glibc ¤Ï¥×¥í¥È¥¿¥¤¥×¤òÄ󶡤·¤Ê¤¤¡£ +¤³¤ì¤Ï¥×¥í¥È¥¿¥¤¥×¤¬É¬Íפˤʤë¤Î¤ÇÎɤ¯¤Ê¤¤¡£ +¥æ¡¼¥¶¤Ï¾åµ­¤Î¥×¥í¥È¥¿¥¤¥×¤Þ¤¿¤Ï¤½¤ì¤ÈƱÅù¤Î¤â¤Î¤ò¡¢ +¼«¿È¤Î¥½¡¼¥¹¤ËÄɲ䷤ʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î¥Ç¡¼¥¿¤¬¤Ê¤¤¤³¤È¤Ë¤è¤Ã¤Æ +.BR e2fsck (8) +¤Î¥³¥ó¥Ñ¥¤¥ë¤¬¼ºÇÔ¤¹¤ë¤È¤¤¤¦¶ì¾ð¤¬¥æ¡¼¥¶¤«¤é½Ð¤¿¤Î¤Ç¡¢ +glibc 2.1.3 ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ê¥ê¥ó¥¯»þ¤Î·Ù¹ð¤¬Äɲ䵤줿¡£ +.sp +.in +4n +"the \`llseek\' function may be dangerous; use \`lseek64\' instead." +.in +.sp +¤³¤ì¤Ë¤è¤ê¡¢·Ù¹ð¤Ê¤·¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢¤³¤Î´Ø¿ô¤ò»ÈÍÑÉԲĤˤǤ­¤ë¡£ +.SS _llseek +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô¤Ï¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë´ð¤Å¤¤¤Æ¼ÂÁõ¤µ¤ì¤ë¡£ +¥×¥í¥È¥¿¥¤¥×¤Ï°Ê²¼¤ÎÄ̤ê: +.nf +.sp +.in +4n +.BI "int _llseek(int " fd ", off_t " offset_hi ", off_t " offset_lo , +.BI " loff_t *" result ", int " whence ); +.in +.fi +.sp +¹¹¤Ë¾Ü¤·¤¤¾ðÊó¤Ï¡¢ +.BR llseek (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR llseek (2), +.BR lseek (2), +.BR feature_test_macros (7) diff --git a/release/man3/makecontext.3 b/release/man3/makecontext.3 new file mode 100644 index 00000000..fb5b90ac --- /dev/null +++ b/release/man3/makecontext.3 @@ -0,0 +1,229 @@ +.\" Copyright (C) 2001 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. +.\" 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 +.\" +.TH MAKECONTEXT 3 2009-03-31 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +makecontext, swapcontext \- ¥æ¡¼¥¶¥³¥ó¥Æ¥­¥¹¥È¤òÁàºî¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "void makecontext(ucontext_t *" ucp ", void (*" func )(), +.BI "int " argc ", ...);" +.sp +.BI "int swapcontext(ucontext_t *" oucp ", ucontext_t *" ucp ); +.SH ÀâÌÀ +System V Ū¤Ê´Ä¶­¤Ç¤Ï¡¢ +\fBmcontext_t\fP ¤ª¤è¤Ó \fBucontext_t\fP ¤È¤¤¤¦ 2 ¤Ä¤Î·¿¤È¡¢ +.BR getcontext (2), +.BR setcontext (2), +.BR makecontext (), +.BR swapcontext () +¤È¤¤¤¦ 4 ¤Ä¤Î´Ø¿ô¤¬ +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢¤¢¤ë¥×¥í¥»¥¹ÆâÉô¤ÇÀ©¸æ²¼¤Ë¤¢¤ëÊ£¿ô¤Î¥¹¥ì¥Ã¥É´Ö¤Ç¡¢ +¥æ¡¼¥¶¥ì¥Ù¥ë¤Î¥³¥ó¥Æ¥­¥¹¥ÈÀÚÂؤ¨¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.LP +¤³¤ì¤é¤Î·¿¤È¡¢ºÇ½é¤Î 2 ¤Ä¤Î´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR getcontext (2) +¤ò»²¾È¤Î¤³¤È¡£ +.LP +.BR makecontext () +´Ø¿ô¤Ï¡¢¥Ý¥¤¥ó¥¿ \fIucp\fP ¤¬»Ø¤¹¥³¥ó¥Æ¥­¥¹¥È¤òÊѹ¹¤¹¤ë +(\fIucp\fP ¤Ï°ÊÁ°¤Î +.BR getcontext (2) +¸Æ¤Ó½Ð¤·¤ÇÆÀ¤é¤ì¤¿¤â¤Î¤Ç¤¢¤ë)¡£ +.BR makecontext () +¤òµ¯Æ°¤¹¤ëÁ°¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¼Ô¤Ï¡¢¤³¤Î¥³¥ó¥Æ¥­¥¹¥ÈÍÑ¤Ë +¿·¤·¤¤¥¹¥¿¥Ã¥¯¤ò³ÎÊݤ·¡¢¤½¤Î¥¢¥É¥ì¥¹¤ò \fIucp\->uc_stack\fP ¤ËÂåÆþ¤·¡¢ +¤µ¤é¤Ë¸å·Ñ¤Î¥³¥ó¥Æ¥­¥¹¥È¤òÄêµÁ¤·¡¢¤½¤Î¥¢¥É¥ì¥¹¤ò \fIucp\->uc_link\fP ¤Ë +ÂåÆþ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +¤³¤Î¥³¥ó¥Æ¥­¥¹¥È¤¬¾­Íè +.RB ( setcontext (2) +¤Þ¤¿¤Ï +.BR swapcontext () +¤Ë¤è¤Ã¤Æ) +Í­¸ú¤Ë¤µ¤ì¤ë¤È¡¢´Ø¿ô \fIfunc\fP ¤¬¸Æ¤Ð¤ì¡¢ +°ú¤­¿ô¤È¤·¤Æ +.I argc +°Ê¹ß¤ÎÀ°¿ô +.RI ( int ) +°ú¤­¿ô¤ÎÎó¤¬ÅϤµ¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¼Ô¤Ï +.I argc +¤Ë¤³¤ì¤é¤Î°ú¤­¿ô¤Î¸Ä¿ô¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤¬Ìá¤ë¤È¡¢¸å·Ñ¤Î¥³¥ó¥Æ¥­¥¹¥È¤¬Í­¸ú¤Ë¤Ê¤ë¡£ +¸å·Ñ¥³¥ó¥Æ¥­¥¹¥È¤Î¥Ý¥¤¥ó¥¿¤¬ NULL ¤Î¾ì¹ç¡¢¤½¤Î¥¹¥ì¥Ã¥É¤¬½ªÎ»¤¹¤ë¡£ +.LP +.BR swapcontext () +´Ø¿ô¤Ï¸½ºß¤Î¥³¥ó¥Æ¥­¥¹¥È¤ò +¥Ý¥¤¥ó¥¿ \fIoucp\fP ¤¬»Ø¤¹¹½Â¤ÂΤËÊݸ¤·¡¢ +¥Ý¥¤¥ó¥¿ \fIucp\fP ¤¬»Ø¤¹¥³¥ó¥Æ¥­¥¹¥È¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR swapcontext () +¤ÏÊÖ¤é¤Ê¤¤ +(¤·¤«¤·¸å¤Ë \fIoucp\fP ¤¬Í­¸ú¤Ë¤Ê¤Ã¤¿¾ì¹ç¤Ë¤ÏÊ֤뤳¤È¤¬¤¢¤ë¡£ +¤³¤Î¤È¤­¤Ë¤Ï +.BR swapcontext () +¤Ï 0 ¤òÊÖ¤¹¤è¤¦¤Ë¸«¤¨¤ë¡£) +¼ºÇÔ¤¹¤ë¤È¡¢ +.BR swapcontext () +¤Ï \-1 ¤òÊÖ¤·¡¢ +\fIerrno\fP ¤ò¥¨¥é¡¼¤Ë±þ¤¸¤ÆÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +¥¹¥¿¥Ã¥¯¤Ë³ä¤êÅö¤Æ¤ë¶õ´Ö¤¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR makecontext () +¤È +.BR swapcontext () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +SUSv2, POSIX.1-2001. +POSIX.1-2008 ¤Ç¤Ï¡¢°Ü¿¢À­¤ÎÌäÂ꤫¤é +.BR makecontext () +¤È +.BR swapcontext () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +Âå¤ï¤ê¤Ë¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò POSIX ¥¹¥ì¥Ã¥É¤ò»È¤Ã¤Æ½ñ¤­Ä¾¤¹¤³¤È¤¬ +¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +\fIucp\->uc_stack\fP ¤Î²ò¼á¤Ï +.BR sigaltstack (2) +¤Î¾ì¹ç¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +¤¹¤Ê¤ï¤Á¤³¤Î¹½Â¤ÂΤˤϡ¢ +¥¹¥¿¥Ã¥¯¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¥á¥â¥êÎΰè¤Î³«»Ï¥¢¥É¥ì¥¹¤ÈŤµ¤¬´Þ¤Þ¤ì¡¢ +¤³¤ì¤Ï¥¹¥¿¥Ã¥¯¤¬¿­¤Ó¤ëÊý¸þ¤¬¤É¤Á¤é¤Ç¤¢¤ë¤«¤Ë¤Ï´Ø·¸¤·¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥æ¡¼¥¶¥×¥í¥°¥é¥à¤Ï¤³¤Î·ï¤Ë¤Ä¤¤¤Æ¤Ï¿´ÇÛ¤·¤Ê¤¯¤Æ¤è¤¤¡£ + +.I int +¤È¥Ý¥¤¥ó¥¿·¿¤¬Æ±¤¸Â礭¤µ¤Ç¤¢¤ë¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï +(x86-32 ¤Ï¤½¤ÎÎã¤Ç¤¢¤ê¡¢Î¾Êý¤Î·¿¤È¤â 32 ¥Ó¥Ã¥È¤Ç¤¢¤ë)¡¢ +.BR makecontext () +¤Î +.I argc +°Ê¹ß¤Î°ú¤­¿ô¤È¤·¤Æ¥Ý¥¤¥ó¥¿¤òÅϤ·¤Æ¤â¤¦¤Þ¤¯Æ°¤¯¤«¤â¤·¤ì¤Ê¤¤¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¤³¤Î¤è¤¦¤Ë¤¹¤ë¤È¡¢°Ü¿¢À­¤ÏÊݾڤµ¤ì¤º¡¢ +ɸ½à¤Ë½¾¤¨¤ÐÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ê¡¢¥Ý¥¤¥ó¥¿¤¬ +.I int +¤è¤ê¤âÂ礭¤¤¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤ÏÀµ¤·¤¯Æ°ºî¤·¤Ê¤¤¤³¤È¤À¤í¤¦¡£ +¤½¤ì¤Ë¤â´Ø¤ï¤é¤º¡¢¥Ð¡¼¥¸¥ç¥ó 2.8 °Ê¹ß¤Î glibc ¤Ç¤Ï¡¢ +.BR makecontext (3) +¤ËÊѹ¹¤¬¹Ô¤ï¤ì¡¢(x86-64 ¤Ê¤É¤Î) ¤¤¤¯¤Ä¤«¤Î 64 ¥Ó¥Ã¥È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç +°ú¤­¿ô¤È¤·¤Æ¥Ý¥¤¥ó¥¿¤òÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SH Îã +.PP +°Ê²¼¤Î¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ï¡¢ +.BR getcontext (2), +.BR makecontext (), +.BR swapcontext () +¤Î»ÈÍÑÊýË¡¤ÎÎã¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤È¡¢°Ê²¼¤Î¤è¤¦¤Ê½ÐÎϤ¬ÆÀ¤é¤ì¤ë: +.in +4n +.nf + +.RB "$" " ./a.out" +main: swapcontext(&uctx_main, &uctx_func2) +func2: started +func2: swapcontext(&uctx_func2, &uctx_func1) +func1: started +func1: swapcontext(&uctx_func1, &uctx_func2) +func2: returning +func1: returning +main: exiting +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include + +static ucontext_t uctx_main, uctx_func1, uctx_func2; + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +static void +func1(void) +{ + printf("func1: started\\n"); + printf("func1: swapcontext(&uctx_func1, &uctx_func2)\\n"); + if (swapcontext(&uctx_func1, &uctx_func2) == \-1) + handle_error("swapcontext"); + printf("func1: returning\\n"); +} + +static void +func2(void) +{ + printf("func2: started\\n"); + printf("func2: swapcontext(&uctx_func2, &uctx_func1)\\n"); + if (swapcontext(&uctx_func2, &uctx_func1) == \-1) + handle_error("swapcontext"); + printf("func2: returning\\n"); +} + +int +main(int argc, char *argv[]) +{ + char func1_stack[16384]; + char func2_stack[16384]; + + if (getcontext(&uctx_func1) == \-1) + handle_error("getcontext"); + uctx_func1.uc_stack.ss_sp = func1_stack; + uctx_func1.uc_stack.ss_size = sizeof(func1_stack); + uctx_func1.uc_link = &uctx_main; + makecontext(&uctx_func1, func1, 0); + + if (getcontext(&uctx_func2) == \-1) + handle_error("getcontext"); + uctx_func2.uc_stack.ss_sp = func2_stack; + uctx_func2.uc_stack.ss_size = sizeof(func2_stack); + /* Successor context is f1(), unless argc > 1 */ + uctx_func2.uc_link = (argc > 1) ? NULL : &uctx_func1; + makecontext(&uctx_func2, func2, 0); + + printf("main: swapcontext(&uctx_main, &uctx_func2)\\n"); + if (swapcontext(&uctx_main, &uctx_func2) == \-1) + handle_error("swapcontext"); + + printf("main: exiting\\n"); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR getcontext (2), +.BR sigaction (2), +.BR sigaltstack (2), +.BR sigprocmask (2), +.BR sigsetjmp (3) diff --git a/release/man3/malloc.3 b/release/man3/malloc.3 new file mode 100644 index 00000000..d3243fa9 --- /dev/null +++ b/release/man3/malloc.3 @@ -0,0 +1,277 @@ +.\" 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" +.SH ̾Á° +calloc, malloc, free, realloc \- ưŪ¤Ê¥á¥â¥ê¤Î³ä¤êÅö¤Æ¤È²òÊü¤ò¹Ô¤¦ +.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 +.SH ÀâÌÀ +.BR calloc () +¤Ï +.I size +¥Ð¥¤¥È¤ÎÍ×ÁÇ +.I nmemb +¸Ä¤«¤é¤Ê¤ëÇÛÎó¤Ë¥á¥â¥ê¤ò³ä¤êÅö¤Æ¡¢ +³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ËÂФ¹¤ë¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥á¥â¥ê¤ÎÆâÍƤϿôÃÍ¥¼¥í (Á´¥Ó¥Ã¥È¤¬¥¼¥í¤Î¥Ð¥¤¥È) ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.I nmemb +¤« +.I size +¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR calloc () +¤Ï NULL +.\" glibc ¤Ï¤³¤Á¤é +¤Þ¤¿¤Ï +.BR free () +¤Ë¸å¤ÇÅϤ·¤Æ¤âÌäÂê¤Îµ¯¤³¤é¤Ê¤¤°ì°Õ¤Ê¥Ý¥¤¥ó¥¿ÃͤòÊÖ¤¹¡£ +.PP +.BR malloc () +¤Ï +.I size +¥Ð¥¤¥È¤ò³ä¤êÅö¤Æ¡¢ +³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ËÂФ¹¤ë¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥á¥â¥ê¤ÎÆâÍƤϥ¯¥ê¥¢¤µ¤ì¤Ê¤¤¡£ +.I size +¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR malloc () +¤Ï NULL +.\" glibc ¤Ï¤³¤Á¤é +¤Þ¤¿¤Ï +.BR free () +¤Ë¸å¤ÇÅϤ·¤Æ¤âÌäÂê¤Îµ¯¤³¤é¤Ê¤¤°ì°Õ¤Ê¥Ý¥¤¥ó¥¿ÃͤòÊÖ¤¹¡£ +.PP +.BR free () +¤Ï¥Ý¥¤¥ó¥¿ +.I ptr +¤¬»Ø¤¹¥á¥â¥ê¶õ´Ö¤ò²òÊü¤¹¤ë¡£¤³¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢°ÊÁ°¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿ +.BR malloc (), +.BR calloc (), +.BR realloc () +¤Î¤¤¤º¤ì¤«¤¬ÊÖ¤·¤¿ÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì°Ê³°¤Î¥Ý¥¤¥ó¥¿¤ò»ØÄꤷ¤¿¤ê¡¢¤¹¤Ç¤Ë +.I free(ptr) +¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤¿¤ê¤·¤¿¾ì¹ç¤ÎÆ°ºî¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.I ptr +¤¬ NULL ¤Î¾ì¹ç¤Ë¤Ï¡¢¤Ê¤ó¤ÎÆ°ºî¤â¹Ô¤ï¤ì¤Ê¤¤¡£ +.PP +.BR realloc () +¤Ï¡¢¥Ý¥¤¥ó¥¿ +.I ptr +¤¬¼¨¤¹¥á¥â¥ê¥Ö¥í¥Ã¥¯¤Î¥µ¥¤¥º¤òÊѹ¹¤·¤Æ +.I size +¥Ð¥¤¥È¤Ë¤¹¤ë¡£ +¿·µì¤Î¥µ¥¤¥º¤Î¤¦¤Á¡¢¾®¤µ¤¤¤Û¤¦¤Î¥Ö¥í¥Ã¥¯¤Ë´Þ¤Þ¤ì¤ëÆâÍƤÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +¿·¤·¤¯³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ÎÆâÍƤϽé´ü²½¤µ¤ì¤Ê¤¤¡£ +.I size +¤¬¤É¤ÎÃͤǤ¢¤Ã¤Æ¤â¡¢ +.I ptr +¤¬ NULL ¤Î¾ì¹ç¤Ë¤Ï +.I malloc(size) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.I size +¤¬ 0 ¤Ç +.I ptr +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +.I free(ptr) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.I ptr +¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢ +.I ptr +¤Ï°ÊÁ°¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿ +.BR malloc (), +.BR calloc (), +.BR realloc () +¤Î¤¤¤º¤ì¤«¤¬ÊÖ¤·¤¿ÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I ptr +¤¬»Ø¤¹Îΰ褬°ÜÆ°¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ï +.I free(ptr) +¤¬¼Â¹Ô¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR calloc () +¤È +.BR malloc () +¤Ï¡¢³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤Ï¡¢¤¢¤é¤æ¤ë¼ïÎà¤ÎÊÑ¿ô¤ËÂбþ¤Ç¤­¤ë¤è¤¦¤Ë +¥¢¥é¥¤¥ó¥á¥ó¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï NULL ¤òÊÖ¤¹¡£ +.I size +¤¬ 0 ¤Ç¸Æ¤Ó½Ð¤·¤¿ +.BR malloc () +¤ä¡¢ +.I nmemb +¤« +.I size +¤¬ 0 ¤Ç¸Æ¤Ó½Ð¤·¤¿ +.BR calloc () +¤¬À®¸ù¤·¤¿¾ì¹ç¤Ë¤â NULL ¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.BR free () +¤ÏÃͤòÊÖ¤µ¤Ê¤¤¡£ +.PP +.BR realloc () +¤Ï¿·¤¿¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ì¤Ï¤¢¤é¤æ¤ë¼ïÎà¤ÎÊÑ¿ô¤ËÂбþ¤Ç¤­¤ë¤è¤¦¤Ë¥¢¥é¥¤¥ó¥á¥ó¥È¤µ¤ì¤Æ¤ª¤ê¡¢ +.I ptr +¤È¤Ï°Û¤Ê¤ë¤³¤È¤â¤¢¤ë¡£ +³ä¤êÅö¤ÆÍ×µá¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ï NULL ¤¬Ê֤롣 +.I size +¤¬ 0 ¤Î¾ì¹ç¤Ë¤Ï¡¢NULL ¤â¤·¤¯¤Ï +.BR free () +¤ËÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¥Ý¥¤¥ó¥¿¤¬Ê֤롣 +.BR realloc () +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¸µ¤Î¥Ö¥í¥Ã¥¯¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +¤Ä¤Þ¤ê¡¢²òÊü¤µ¤ì¤¿¤ê°ÜÆ°¤µ¤ì¤¿¤ê¤Ï¤·¤Ê¤¤¡£ +.SH ½àµò +C89, C99. +.SH Ãí°Õ +Ä̾ +.BR malloc () +¤Ï¡¢¥Ò¡¼¥×¤«¤é¥á¥â¥ê¤ò³ä¤êÅö¤Æ¡¢É¬Íפ˱þ¤¸¤Æ¥Ò¡¼¥×¤Î¥µ¥¤¥º¤ò +.BR sbrk (2) +¤ò»È¤Ã¤ÆÄ´À᤹¤ë¡£ +.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. +.BR mmap (2) +¤ò»È¤Ã¤Æ¹Ô¤ï¤ì¤¿¥á¥â¥ê³ä¤êÅö¤Æ¤Ï +.B RLIMIT_DATA +¥ê¥½¡¼¥¹¾å¸Â¤Î±Æ¶Á¤ò¼õ¤±¤Ê¤¤ +.RB ( getrlimit (2) +»²¾È)¡£ + +Unix98 ɸ½à¤Ç¤Ï¡¢ +.BR malloc (), +.BR calloc (), +.BR realloc () +¤Ï¼Â¹Ô¤Ë¼ºÇÔ¤·¤¿¤È¤­¤Ë +.I errno +¤ò +.B ENOMEM +¤ËÀßÄꤹ¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +Glibc ¤Ç¤Ï¤³¤ì¤¬¼é¤é¤ì¤Æ¤¤¤ë¤³¤È¤ò²¾Äꤷ¤Æ¤¤¤ë +(¤Þ¤¿¤³¤ì¤é¤Î¥ë¡¼¥Á¥ó¤Î glibc ¥Ð¡¼¥¸¥ç¥ó¤Ï¤³¤Î¤³¤È¤ò¼é¤Ã¤Æ¤¤¤ë)¡£ +¸Ä¿ÍŪ¤ËÊ̤Πmalloc ¤Î¼ÂÁõ¤ò»È¤Ã¤Æ¤¤¤Æ¡¢¤½¤Î malloc ¤¬ +.I errno +¤òÀßÄꤷ¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¼ºÇÔ¤·¤¿ºÝ¤Ë +.I errno +¤Ë¥¨¥é¡¼¤ÎÍýͳ¤òÀßÄꤷ¤Ê¤¤¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó¤¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +.BR malloc (), +.BR calloc (), +.BR realloc (), +.BR free () +¤Ë¤ª¤±¤ë»ö¸Î¤Ï¡¢ +¤Û¤È¤ó¤É¤Î¾ì¹ç¤Ï¥Ò¡¼¥×¤ÎÇ˲õ (corruption) ¤¬¸¶°ø¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢³ä¤êÅö¤Æ¤é¤ì¤¿Îΰè¤ò¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¡¢ +Ʊ¤¸¥Ý¥¤¥ó¥¿¤ËÆóÅÙ free ¤¹¤ë¡¢¤Ê¤É¤¬¤³¤ì¤Ë¤¢¤¿¤ë¡£ +.PP +ºÇ¶á¤Î¥Ð¡¼¥¸¥ç¥ó¤Î Linux libc (5.4.23 °Ê¹ß) ¤È glibc (2.x) ¤Ç¤Ï¡¢ +.BR malloc () +¤ÎÆ°ºî¤ò´Ä¶­ÊÑ¿ô¤Ë¤è¤Ã¤ÆÀ©¸æ¤Ç¤­¤ë¤è¤¦¤Ê¼ÂÁõ¤¬¤µ¤ì¤Æ¤¤¤ë¡£ +.B MALLOC_CHECK_ +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢Æüì¤Ê¼ÂÁõ¤¬ÍѤ¤¤é¤ì¡¢ +ñ½ã¤Ê¥¨¥é¡¼¤Ë¤ÏÂѤ¨¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë (¸úΨ¤Ï°­¤¯¤Ê¤ë)¡£Î㤨¤Ð¡¢ +.BR free () +¤òƱ¤¸°ú¤­¿ô¤ÇÆóÅٸƤӽФ·¤Æ¤·¤Þ¤¦¡¢ +1 ¥Ð¥¤¥È¤À¤±¹Ô¤­¤¹¤®¤Æ¤·¤Þ¤¦ (off-by-one ¥Ð¥°) ¤Ê¤É¤¬¤³¤ì¤ËÅö¤¿¤ë¡£ +¤·¤«¤·¡¢¤³¤ì¤é¤Î¥¨¥é¡¼¤ÎÁ´¤Æ¤òËɤ°¤³¤È¤¬¤Ç¤­¤ë¤ï¤±¤Ç¤Ï¤Ê¤¯¡¢ +¤½¤Î¾ì¹ç¤Ë¤Ï¥á¥â¥ê¥ê¡¼¥¯¤¬µ¯¤³¤Ã¤Æ¤·¤Þ¤¦¡£ +.B MALLOC_CHECK_ +¤¬ 0 ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢¥Ò¡¼¥×¤ÎÇ˲õ¤òÌۤäÆ̵»ë¤¹¤ë¡£ +1 ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢¿ÇÃÇ¥á¥Ã¥»¡¼¥¸¤¬É¸½à¥¨¥é¡¼½ÐÎϤËɽ¼¨¤µ¤ì¤ë¡£ +2 ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢¤¿¤À¤Á¤Ë +.BR abort (3) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +3 ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢¿ÇÃÇ¥á¥Ã¥»¡¼¥¸¤¬É¸½à¥¨¥é¡¼½ÐÎϤËɽ¼¨¤µ¤ì¡¢ +¥×¥í¥°¥é¥à¤Ï¶¯À©½ªÎ» (abort) ¤µ¤ì¤ë¡£ +.B MALLOC_CHECK_ +¤Ë 0 °Ê³°¤ÎÃͤò¥»¥Ã¥È¤·¤ÆÌò¤ËΩ¤Ä¾õ¶·¤È¤·¤Æ¤Ï¡¢ +¼ÂºÝ¤Î¥×¥í¥»¥¹¤Î¥¯¥é¥Ã¥·¥å¤¬¤º¤Ã¤È¸å¤Ëµ¯¤³¤ê¡¢ +ËÜÅö¤Î¸¶°ø¤òõ¤·½Ð¤¹¤Î¤¬Èó¾ï¤Ëº¤Æñ¤Ê¾ì¹ç¤Ê¤É¤¬µó¤²¤é¤ì¤ë¤À¤í¤¦¡£ +.SH ¥Ð¥° +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢Linux ¤Ï³Ú´ÑŪ¥á¥â¥êÇÛÃÖÀïά¤òÍѤ¤¤Æ¤¤¤ë¡£ +¤Ä¤Þ¤ê¡¢ +.BR malloc () +¤¬ NULL ¤Ç¤Ê¤¤ÃͤòÊÖ¤·¤Æ¤â¡¢¤½¤Î¥á¥â¥ê¤¬¼ÂºÝ¤ËÍøÍѲÄǽ¤Ç¤¢¤ë¤³¤È¤¬ +Êݾڤµ¤ì¤Ê¤¤¡£¤³¤ì¤ÏËÜÅö¤Ë¤Þ¤º¤¤¥Ð¥°¤Ç¤¢¤ë¡£ +¥·¥¹¥Æ¥à¤¬¥á¥â¥êÉÔ­¾õÂ֤ˤʤ俤Ȥ­¡¢°­Ì¾¹â¤¤¥á¥â¥êÉÔ­²ò·è´ï (OOM killer) +¤Ë¤è¤Ã¤Æ°ì¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î¥×¥í¥»¥¹¤¬ºï½ü¤µ¤ì¤ë¡£ +ÆÍÁ³¤¢¤ë¥×¥í¥»¥¹¤¬ºï½ü¤µ¤ì¤ë¤Î¤¬Ë¾¤Þ¤·¤¯¤Ê¤¤¾õ¶·¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤Æ¡¢ +¤·¤«¤â¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤¬½½Ê¬¤ËºÇ¶á¤Î¤â¤Î¤Ç¤¢¤ì¤Ð¡¢¤³¤Î¥á¥â¥ê¤ò +³ä¤êÅö¤Æ²á¤®¤ëÆ°ºî (overcommitting behavior) ¤ò°Ê²¼¤Î¥³¥Þ¥ó¥É¤Ç +̵¸ú¤Ë¤Ç¤­¤ë¡£ +.in +4n +.sp +.nf +.RB "#" " echo 2 > /proc/sys/vm/overcommit_memory" + +.fi +.in +¥«¡¼¥Í¥ë¤ÎÉÕ°ʸ½ñ¤Î +.I vm/overcommit-accounting +¤È +.I sysctl/vm.txt +¤â»²¾È¤Î¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR brk (2), +.BR posix_memalign (3) +.\" .BR mallopt (3), +.BR mmap (2), +.BR alloca (3), diff --git a/release/man3/malloc_hook.3 b/release/man3/malloc_hook.3 new file mode 100644 index 00000000..0d0a857e --- /dev/null +++ b/release/man3/malloc_hook.3 @@ -0,0 +1,138 @@ +.\" 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" +.SH ̾Á° +__malloc_hook, __malloc_initialize_hook, +__memalign_hook, __free_hook, __realloc_hook, +__after_morecore_hook \- malloc ¥Ç¥Ð¥Ã¥°ÍѤÎÊÑ¿ô +.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 +.SH ÀâÌÀ +GNU C ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢Å¬Àڤʥե寴ؿô (hook function) ¤ò»ØÄꤹ¤ë¤³¤È¤Ç +.BR malloc (3), +.BR realloc (3), +.BR free (3) +¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£Î㤨¤Ð¡¢Æ°Åª¤Ë¥á¥â¥ê³ä¤êÅö¤Æ¤ò¹Ô¤¦ +¥×¥í¥°¥é¥à¤Î¥Ç¥Ð¥Ã¥°¤Ë¤³¤ì¤é¤Î¥Õ¥Ã¥¯¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +ÊÑ¿ô +.B __malloc_initialize_hook +¤Ï malloc ¤Î¼ÂÁõ¤¬½é´ü²½¤µ¤ì¤ëºÝ¤Ë°ìÅÙ¤À¤±¸Æ¤Ð¤ì¤ë´Ø¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤³¤ÎÊÑ¿ô¤Ï½ñ¤­´¹¤¨²Äǽ (weak) ¤Ç¤¢¤ê¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥óÆâ¤Ç +°Ê²¼¤Î¤è¤¦¤ÊÄêµÁ¤Ç¾å½ñ¤­¤Ç¤­¤ë: + +.nf + void (*__malloc_initialize_hook)(void) = my_init_hook; +.fi + +¤Ê¤ª¡¢´Ø¿ô +.IR my_init_hook () +¤ÇÁ´¤Æ¤Î¥Õ¥Ã¥¯¤Î½é´ü²½¤ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +.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 +ÊÑ¿ô +.B __after_morecore_hook +¤Ï¡¢Îΰè¤ÎÄɲÃÍ׵᤬¤¢¤ê +.BR sbrk (2) +¤¬¸Æ¤Ð¤ì¤¿¸å¤ÇËè²ó¸Æ¤Ó½Ð¤µ¤ì¤ë´Ø¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Îã +¤³¤ì¤é¤ÎÊÑ¿ô¤Î»È¤¤Êý¤Î´Êñ¤ÊÎã¤ò°Ê²¼¤Ë¼¨¤¹¡£ +.sp +.nf +#include +#include + +/* »È¤ª¤¦¤È¤¹¤ë¥Õ¥Ã¥¯¤Î¥×¥í¥È¥¿¥¤¥×Àë¸À */ +static void my_init_hook(void); +static void *my_malloc_hook(size_t, const void *); + +/* ¸µ¡¹¤Î¥Õ¥Ã¥¯¤òÊݸ¤¹¤ë¤¿¤á¤ÎÊÑ¿ô */ +static void *(*old_malloc_hook)(size_t, const void *); + +/* 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; + + /* ¸µ¡¹¤Î¥Õ¥Ã¥¯¤òÁ´¤ÆÌ᤹ */ + __malloc_hook = old_malloc_hook; + + /* malloc ¤ÎºÆµ¢Åª¸Æ¤Ó½Ð¤· */ + result = malloc(size); + + /* ¸½ºßÀßÄꤵ¤ì¤Æ¤¤¤ë¥Õ¥Ã¥¯ (underlying hook) ¤òÊݸ¤¹¤ë */ + old_malloc_hook = __malloc_hook; + + /* printf() ¤Ï malloc() ¤ò¸Æ¤Ó½Ð¤¹²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç + ¤³¤³¤Ç¤â¥¬¡¼¥É¤ò¹Ô¤¦ (¸µ¡¹¤Î¥Õ¥Ã¥¯¤Î¤Þ¤Þ¤Ë¤·¤Æ¤ª¤¯) */ + printf("malloc(%u) called from %p returns %p\\n", + (unsigned int) size, caller, result); + + /* ¥æ¡¼¥¶¤¬»È¤ª¤¦¤È¤¹¤ë¥Õ¥Ã¥¯¤òºÆÀßÄꤹ¤ë */ + __malloc_hook = my_malloc_hook; + + return result; +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR mallinfo (3), +.BR malloc (3), +.BR mcheck (3), +.BR mtrace (3) diff --git a/release/man3/mblen.3 b/release/man3/mblen.3 new file mode 100644 index 00000000..af021251 --- /dev/null +++ b/release/man3/mblen.3 @@ -0,0 +1,76 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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 +.\" +.\" +.TH MBLEN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mblen \- ¼¡¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int mblen(const char *" s ", size_t " n ); +.fi +.SH ÀâÌÀ +\fIs\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ç¤Ê¤±¤ì¤Ð¡¢ +.BR mblen () +´Ø¿ô¤Ï \fIs\fP ¤«¤é»Ï¤Þ¤ëºÇÂç \fIn\fP ¥Ð¥¤¥È¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò¸¡ºº¤·¤Æ¡¢ +¼¡¤Î´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò¼è¤ê½Ð¤¹¡£¤³¤ì¤Ë¤Ï +.BR mblen () +´Ø¿ô¤Î¤ß¤¬»ÈÍѤ¹¤ëÀÅŪ¤Ç̾Á°¤Î¤Ê¤¤¥·¥Õ¥È¾õÂÖ¤¬»ÈÍѤµ¤ì¤ë¡£ +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤¬¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ç¤Ê¤±¤ì¤Ð \fIs\fP ¤«¤é¾ÃÈñ¤µ¤ì¤ë +¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤¬¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤òÊÖ¤¹¡£ +.PP +\fIs\fP ¤«¤é»Ï¤Þ¤ë \fIn\fP ¥Ð¥¤¥È¤¬´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò´Þ¤ó¤Ç +¤¤¤Ê¤±¤ì¤Ð¡¢ +.BR mblen () +¤Ï \-1 ¤òÊÖ¤¹¡£¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó +¤Ë¾éĹ¤Ê¥·¥Õ¥È¥·¡¼¥±¥ó¥¹¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤È¡¢ +\fIn\fP ¤¬ \fIMB_CUR_MAX\fP °Ê¾å¤Î¾ì¹ç¤Ë¤â +¤³¤Î¤è¤¦¤Ê¤³¤È¤¬µ¯¤³¤ê¤¨¤ë¡£ +.PP +\fIs\fP ¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬼¡¤Î´°Á´¤Êʸ»ú¤ÎÁ°¤Ë +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¤Ë¤â¡¢ +.BR mblen () +¤Ï \-1 ¤òÊÖ¤¹¡£ +.PP +.\" The Dinkumware doc and the Single Unix specification say this, but +.\" glibc doesn't implement this. +\fIs\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ê¤é¤Ð¡¢ +.BR mblen () +´Ø¿ô¤Ï¤³¤Î´Ø¿ô¤Î¤ß¤¬ +»ÈÍѤ¹¤ë¥·¥Õ¥È¾õÂÖ¤ò½é´ü²½¾õÂÖ¤ËÌᤷ¡¢¥·¥Õ¥È¾õÂÖ¤ò»ÈÍѤ·¤¿Ê¸»úÉä¹æ¤Î¾ì¹ç¤Ë +¤Ï¥¼¥í°Ê³°¤ò¡¢Ê¸»úÉä¹æ¤¬¥·¥Õ¥È¾õÂÖ¤ò»ý¤¿¤Ê¤¤¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +.BR mblen () +´Ø¿ô¤Ï \fIs\fP ¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò¸¡ºº¤·¤Æ +¥Ê¥ë¥ï¥¤¥Éʸ»ú°Ê³°¤ò³Îǧ¤·¤¿¾ì¹ç¤Ë¤Ï¤½¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥Ê¥ë¥ï¥¤¥Éʸ»ú¤ò³Îǧ¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Ë +Áø¶ø¤·¤¿¾ì¹ç¤ä´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò²òÀϤǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR mblen () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +.BR mbrlen (3) +´Ø¿ô¤ÏƱ¤¸µ¡Ç½¤Î¤è¤êÎɤ¤¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mbrlen (3) diff --git a/release/man3/mbrlen.3 b/release/man3/mbrlen.3 new file mode 100644 index 00000000..a44c89f6 --- /dev/null +++ b/release/man3/mbrlen.3 @@ -0,0 +1,74 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:19 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH MBRLEN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mbrlen \- ¼¡¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ÎŤµ¤ò¥Ð¥¤¥È¿ô¤ÇÊÖ¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t mbrlen(const char *" s ", size_t " n ", mbstate_t *" ps ); +.fi +.SH ÀâÌÀ +.BR mbrlen () +´Ø¿ô¤Ï \fIs\fP ¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò +ºÇÂç \fIn\fP ¥Ð¥¤¥ÈÄ´¤Ù¤Æ¼¡¤Î´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò¼è¤ê½Ð¤¹¡£ +Ʊ»þ¤Ë¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò¹¹¿·¤¹¤ë¡£ +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤¬¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ç¤Ê¤±¤ì¤Ð \fIs\fP ¤«¤é +¾ÃÈñ¤¹¤ë¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò +½é´ü¾õÂÖ¤ËÌᤷ¤Æ¡¢0 ¤òÊÖ¤¹¡£ +.PP +\fIs\fP ¤«¤é»Ï¤Þ¤ë \fIn\fP ¥Ð¥¤¥È¤Îʸ»úÎ󤬴°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò´Þ¤ó¤Ç +¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï +.BR mbrlen () +¤Ï \fI(size_t)\ \-2\fP ¤òÊÖ¤¹¡£ +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤Ë¾éĹ¤Ê¥·¥Õ¥È¥·¡¼¥±¥ó¥¹¤ò´Þ¤Þ¤ì¤Æ¤¤¤ë¤È +\fIn\fP >= \fIMB_CUR_MAX\fP ¤Î»þ¤Ë¤â¤³¤Î¤è¤¦¤Ê¤³¤È¤¬µ¯¤³¤ê¤¨¤ë¡£ +.PP +\fIs\fP ¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬡¢¼¡¤Î´°Á´¤Êʸ»ú¤ÎÁ°¤Ë +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR mbrlen () +¤Ï +\fI(size_t)\ \-1\fP ¤òÊÖ¤· \fIerrno\fP ¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¾ì¹ç¤Î \fI*ps\fP ¤Ø¤Î±Æ¶Á¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.PP +\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ê¤é¤Ð¡¢Âå¤ê¤Ë +.BR mbrlen () +´Ø¿ô¤Î¤ß¤¬»ÈÍѤ¹¤ëÀÅŪ¤Ç̾Á°¤Î¤Ê¤¤¾õÂÖ¤¬»ÈÍѤµ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +¥Ê¥ë¥ï¥¤¥Éʸ»ú°Ê³°¤Îʸ»ú¤ò³Îǧ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +.BR mbrlen () +´Ø¿ô¤Ï \fIs\fP +¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥ÈÎ󤫤é»ÈÍѤ·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥Ê¥ë¥ï¥¤¥Éʸ»ú¤¬³Îǧ¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¾ì¹ç¤Ë¤Ï +.I "(size_t)\ \-1" +¤òÊÖ¤· +\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£ +´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò²òÀϤǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï \fI(size_t)\ \-2\fP ¤òÊÖ¤¹¡£ +¤³¤ì¤Ï \fIn\fP ¤òÁý¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR mbrlen () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mbrtowc (3) diff --git a/release/man3/mbrtowc.3 b/release/man3/mbrtowc.3 new file mode 100644 index 00000000..d226f10d --- /dev/null +++ b/release/man3/mbrtowc.3 @@ -0,0 +1,105 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:16 JST 2000 +.\" by HANATAKA Shinya +.\" Updated Thu Dec 13 JST 2001 by Kentaro Shirakata +.\" +.TH MBRTOWC 3 2001-11-22 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mbrtowc \- ¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t mbrtowc(wchar_t *" pwc ", const char *" s ", size_t " n \ +", mbstate_t *" ps ); +.fi +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤¬ÍѤ¤¤é¤ì¤ë¾ì¹ç¡¢Ä̾ï \fIs\fP ¤¬ NULL ¤Ç¤Ê¤¯ \fIpwc\fP ¤â NULL ¤Ç +¤Ê¤¤¡£¤³¤Î¾ì¹ç¤Ï¡¢ +.BR mbrtowc () +´Ø¿ô¤Ï \fIs\fP ¤«¤é»Ï¤Þ¤ëºÇÂç \fIn\fP ¥Ð¥¤¥È¤Î +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò¸¡ºº¤·¤Æ¡¢¼¡¤Î´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò¼è¤ê½Ð¤·¡¢ +¤½¤ì¤ò¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤·¤Æ \fI*pwc\fP ¤Ë³ÊǼ¤¹¤ë¡£ +Ʊ»þ¤Ë¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò¹¹¿·¤¹¤ë¡£ÊÑ´¹¤·¤¿¥ï¥¤¥Éʸ»ú¤¬ L\(aq\\0\(aq ¤Ç +¤Ê¤±¤ì¤Ð¡¢\fIs\fP ¤«¤é¾ÃÈñ¤¹¤ë¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +ÊÑ´¹¤·¤¿¥ï¥¤¥Éʸ»ú¤¬ L\(aq\\0\(aq ¤Î¾ì¹ç¤Ë¤Ï¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò +½é´ü¾õÂÖ¤ËÌᤷ¤Æ 0 ¤òÊÖ¤¹¡£ +.PP +\fIs\fP ¤«¤é»Ï¤Þ¤ë \fIn\fP ¥Ð¥¤¥È¤¬´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò´Þ¤ó¤Ç¤¤¤Ê¤¤ +¾ì¹ç¤Ë¤Ï¡¢ +.BR mbrtowc () +¤Ï \fI(size_t)\ \-2\fP ¤òÊÖ¤¹¡£ +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤Ë¾éĹ¤Ê¥·¥Õ¥È¥·¡¼¥±¥ó¥¹¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤È¡¢ +\fIn\fP >= \fIMB_CUR_MAX\fP ¤Î»þ¤Ë¤â¤³¤Î¤è¤¦¤Ê¤³¤È¤¬µ¯¤³¤ê¤¨¤ë¡£ +.PP +\fIs\fP ¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬡¢¼¡¤Î´°Á´¤Êʸ»ú¤ÎÁ°¤Ë +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR mbrtowc () +¤Ï +\fI(size_t)\ \-1\fP ¤òÊÖ¤·¡¢\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£ +¤³¤Î¾ì¹ç¤Ï \fI*ps\fP ¤Ø¤Î±Æ¶Á¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.PP +\fIs\fP ¤¬ NULL ¤Ç¤Ê¤¯ \fIpwc\fP ¤¬ NULL ¤Î¾ì¹ç¤Ï +.BR mbrtowc () +´Ø¿ô¤Ï +¾åµ­¤ÈƱÍͤËÆ°ºî¤¹¤ë¤¬¡¢ÊÑ´¹¤·¤¿¥ï¥¤¥Éʸ»ú¤Ï¥á¥â¥ê¤Ë¤Ï½ñ¤­¹þ¤Þ¤ì¤Ê¤¤¡£ +.PP +puts \fI*ps\fP in the initial state and returns 0. +»°ÈÖÌܤξì¹ç¤È¤·¤Æ \fIs\fP ¤¬ NULL ¤Î¾ì¹ç¡¢ \fIpwc\fP ¤È \fIn\fP ¤Ï +̵»ë¤µ¤ì¤ë¡£ +\fI*ps\fP ¤¬É½¸½¤¹¤ëÊÑ´¹¾õÂÖ¤¬ÉÔ´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÊÑ´¹¤ò¼¨¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.BR mbrtowc () +´Ø¿ô¤Ï \fI(size_t)\ \-1\fP ¤òÊÖ¤·¡¢ +\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤ò¥»¥Ã¥È¤·¡¢ +\fI*ps\fP ¤Ï̤ÄêµÁ¾õÂ֤Τޤޤˤ¹¤ë¡£ +¤µ¤â¤Ê¤±¤ì¤Ð¡¢ +.BR mbrtowc () +´Ø¿ô¤Ï \fI*ps\fP ¤ò½é´ü¾õÂ֤ˤ·¤Æ 0 ¤òÊÖ¤¹¡£ +.PP +¾åµ­¤ÎÁ´¤Æ¤Î¾ì¹ç¤Ë¤ª¤¤¤Æ¡¢\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ê¤é¤ÐÂå¤ï¤ê¤Ë +mbrtowc ´Ø¿ô¤Î¤ß¤¬»ÈÍѤ¹¤ëÀÅŪ¤Ç̾Á°¤Î¤Ê¤¤¾õÂÖ¤¬»ÈÍѤµ¤ì¤ë¡£ +¤µ¤â¤Ê¤±¤ì¤Ð¡¢\fI*ps\fP ¤ÏÍ­¸ú¤Ê \fImbstate_t\fP ¥ª¥Ö¥¸¥§¥¯¥È¤Ç +¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +\fImbstate_t\fP ¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ë \fIa\fP ¤Ï¥¼¥í¤ÇËä¤á¤ë¤³¤È¤Ë¤è¤Ã¤Æ +½é´ü¾õÂ֤˽é´ü²½¤Ç¤­¤ë¡£°Ê²¼¤ËÎã¤ò¼¨¤¹¡£ +.sp +.in +4n +memset(&a, 0, sizeof(a)); +.in +.SH ÊÖ¤êÃÍ +L\(aq\\0\(aq °Ê³°¤Î¥ï¥¤¥Éʸ»ú¤òǧ¼±¤·¤¿¾ì¹ç¤Ë¤Ï +.BR mbrtowc () +´Ø¿ô¤Ï \fIs\fP +¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥ÈÎ󤫤é²òÀϤ·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +L\(aq\\0\(aq ¥ï¥¤¥Éʸ»ú¤òǧ¼±¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤òÊÖ¤·¡¢ +\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò +²òÀϤǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-2 +¤òÊÖ¤· \fIn\fP ¤òÁý²Ã¤µ¤»¤ëɬÍפ¬¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR mbrtowc () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mbsrtowcs (3) diff --git a/release/man3/mbsinit.3 b/release/man3/mbsinit.3 new file mode 100644 index 00000000..2fcfe4da --- /dev/null +++ b/release/man3/mbsinit.3 @@ -0,0 +1,86 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:13 JST 2000 +.\" by HANATAKA Shinya +.\" +.\"WORD: initial shift state ½é´ü¥·¥Õ¥È¾õÂÖ +.\" +.TH MBSINIT 3 2000-11-20 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mbsinit \- ½é´ü¥·¥Õ¥È¾õÂÖ¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int mbsinit(const mbstate_t *" ps ); +.fi +.SH ÀâÌÀ +ʸ»ú¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èɽ¸½¤È¥ï¥¤¥Éʸ»úɽ¸½¤Î´Ö¤ÇÊÑ´¹¤¹¤ë¾ì¹ç¤Ë¤Ï +\fImbstate_t\fP ·¿¤ÎÊÑ´¹¾õÂÖ¤ò»ÈÍѤ¹¤ë¡£Ê¸»úÎó¤ÎÊÑ´¹¤ÏÍ­¸Â¾õÂÖ¥Þ¥·¥ó +¤ò»ÈÍѤ¹¤ë¡£¤¤¤¯¤é¤«¤Îʸ»ú¤ÎÊÑ´¹¤ò´°Î»¤·¤¿¸å¤Ë¡¢»Ä¤ê¤Îʸ»ú¤ò½èÍý¤¹¤ë +¤¿¤á¤Ë¾õÂÖ¤òÊݸ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£¤³¤Î¤è¤¦¤ÊÊÑ´¹¾õÂÖ¤Ï +ISO-2022 ¤ä UTF-7 ¤Î¤è¤¦¤ÊÉä¹æ¤ò°·¤¦¤Î¤ËɬÍפȤµ¤ì¤ë¡£ +.PP +½é´ü¾õÂ֤ȤÏʸ»úÎó¤ÎÊÑ´¹¤ò³«»Ï¤¹¤ë»þ¤Î¾õÂ֤Ǥ¢¤ë¡£¾õÂ֤ˤÏÆó¼ïÎब +¸ºß¤·¡¢°ì¤Ä¤Ï +.BR mbsrtowcs (3) +¤Î¤è¤¦¤Ê¥Þ¥ë¥Á¥Ð¥¤¥È¤ò¥ï¥¤¥Éʸ»ú¤Ë +ÊÑ´¹¤¹¤ë´Ø¿ô¤Ç»ÈÍѤµ¤ì¤ë¡£¤â¤¦°ì¤Ä¤Ï +.BR wcsrtombs (3) +¤Î¤è¤¦¤Ê +¥ï¥¤¥Éʸ»ú¤ò¥Þ¥ë¥Á¥Ð¥¤¥È¤ËÊÑ´¹¤¹¤ë´Ø¿ô¤Ç»ÈÍѤµ¤ì¤ë¡£¤·¤«¤·Î¾Êý¤È¤â +\fImbstate_t\fP ¤Ë³ÊǼ¤µ¤ì¡¢½é´ü¾õÂ֤Ȥ·¤ÆƱ¤¸É½¸½¤ò»ý¤Ä¡£ +.PP +8¥Ó¥Ã¥ÈÉä¹æ¤Ë¤ª¤¤¤Æ¤ÏÁ´¤Æ¤Î¾õÂ֤Ͻé´ü¾õÂÖ¤ÈÅù²Á¤Ç¤¢¤ë¡£ +UTF-8, EUC-*, BIG5, SJIS ¤Î¤è¤¦¤Ê¿¥Ð¥¤¥ÈÉä¹æ¤Ë¤ª¤¤¤Æ¥ï¥¤¥Éʸ»ú¤«¤é +¿¥Ð¥¤¥Èʸ»ú¤Ø¤ÎÊÑ´¹´Ø¿ô¤ÏÈó½é´ü¾õÂ֤ˤϤʤé¤Ê¤¤¡£ +¤·¤«¤· +.BR mbrtowc (3) +¤Î¤è¤¦¤Ê¿¥Ð¥¤¥Èʸ»ú¤«¤é¥ï¥¤¥Éʸ»ú¤Ø¤ÎÊÑ´¹´Ø¿ô¤Ç¤Ï +ʸ»ú¤Î²ò¼á¤ÎÅÓÃæ¤ÇÈó½é´ü¾õÂ֤Ȥʤë¾ì¹ç¤¬¤¢¤ë¡£ +.PP +½é´ü¾õÂ֤Π+.I mbstate_t +¤òºîÀ®¤¹¤ëÊýË¡¤Î°ì¤Ä¤Ï¡¢¤½¤ì¤ò¥¼¥í¤ËÀßÄꤹ¤ë¤³¤È¤Ç¤¢¤ë: +.nf + + mbstate_t state; + memset(&state,0,sizeof(mbstate_t)); +.fi +.PP +Linux ¤Ë¤ª¤¤¤Æ¤Ï°Ê²¼¤ÎÊýË¡¤Ç¤âƱÍͤǤ¢¤ë¤¬¡¢¥³¥ó¥Ñ¥¤¥é¡¼¤Î·Ù¹ð¤¬ +À¸À®¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.nf + + mbstate_t state = { 0 }; +.fi +.PP +.BR mbsinit () +¤Ï \fI*ps\fP ¤¬½é´ü¾õÂ֤˰ìÃפ¹¤ë¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR mbsinit () +¤Ï \fI*ps\fP ¤¬½é´ü¾õÂ֤ξì¹ç¤ä NULL ¥Ý¥¤¥ó¥¿¡¼¤Î¾ì¹ç¤Ë¤Ï +¥¼¥í°Ê³°¤òÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR mbsinit () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mbsrtowcs (3), +.BR wcsrtombs (3) diff --git a/release/man3/mbsnrtowcs.3 b/release/man3/mbsnrtowcs.3 new file mode 100644 index 00000000..29225297 --- /dev/null +++ b/release/man3/mbsnrtowcs.3 @@ -0,0 +1,92 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Tue Jan 11 00:56:10 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH MBSNRTOWCS 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mbsnrtowcs \- ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "size_t mbsnrtowcs(wchar_t *" dest ", const char **" src , +.BI " size_t " nms ", size_t " len ", mbstate_t *" ps ); +.fi +.SH ÀâÌÀ +.BR mbsnrtowcs () +´Ø¿ô¤Ï +.BR mbsrtowcs (3) +´Ø¿ô¤Ë»÷¤Æ¤¤¤ë¤¬ +ÊÑ´¹¤¹¤ë¥Ð¥¤¥È¿ô¤¬ \fI*src\fP ¤«¤é»Ï¤Þ¤ë \fInms\fP ¥Ð¥¤¥È¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë +ÅÀ¤¬°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +.PP +\fIdest\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ç¤Ê¤±¤ì¤Ð +.BR mbsnrtowcs () +´Ø¿ô¤Ï +\fI*src\fP ¤«¤é¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ÎºÇÂç \fInms\fP ¤Þ¤Ç¤ò +\fIdest\fP ¤«¤é¤Î¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£ +ºÇÂç \fIlen\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤¬ \fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +Ʊ»þ¤Ë¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò¹¹¿·¤¹¤ë¡£ +ÊÑ´¹¤Ï +.I "mbrtowc(dest, *src, n, ps)" +¤ò¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¸Â¤ê¡¢·«¤êÊÖ¤·¼Â¹Ô¤·¤¿¤Î¤È¼Â¼ÁŪ¤ËƱÍͤǤ¢¤ë¡£ +¤³¤³¤Ç¤Î \fIn\fP ¤ÏÀµ¤Î¿ô¤Ç¤¢¤ê¡¢·«¤êÊÖ¤·¤´¤È¤Ë \fIdest\fP ¤¬ 1 Áý²Ã¤µ¤»¤é¤ì¡¢ +\fI*src\fP ¤¬¾ÃÈñ¤·¤¿¥Ð¥¤¥È¿ô¤À¤±Áý²Ã¤µ¤»¤é¤ì¤ë¡£ÊÑ´¹¤Ï°Ê²¼¤Î»°¤Ä¤Î +¤¤¤º¤ì¤«¤Î¾ò·ï¤ÇÄä»ß¤¹¤ë: +.IP 1. 3 +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¡£¤³¤Î¾ì¹ç¤Ë¤Ï \fI*src\fP ¤ÏÉÔÀµ¤Ê +¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò»Ø¤¹¤è¤¦¤Ë¤·¤Æ¡¢ +.I (size_t)\ \-1 +¤òÊÖ¤·¡¢\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£ +.IP 2. +\fInms\fP À©¸Â¤Ë¤è¤Ã¤Æ¶¯À©Åª¤ËÄä»ß¤¹¤ë¤«¡¢\fIlen\fP ʸ»ú¤Î L\(aq\\0\(aq °Ê³°¤Î +¥ï¥¤¥Éʸ»ú¤ò \fIdest\fP ¤Ë³ÊǼ¤·¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ï \fI*src\fP ¤Ï +¼¡¤ËÊÑ´¹¤µ¤ì¤ë¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò»Ø¤¹¤è¤¦¤Ë¤·¤Æ¡¢\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿ +¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +.IP 3. +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬽ªÃ¼¤Î \(aq\\0\(aq ¤Þ¤Ç´Þ¤á¤Æ´°Á´¤ËÊÑ´¹¤µ¤ì¤¿¾ì¹ç¡£ +(¤³¤Î»þ¡¢ÉûºîÍѤȤ·¤Æ \fI*ps\fP ¤¬½é´ü¾õÂÖ¤ËÌᤵ¤ì¤ë¡£) +¤³¤Î¾ì¹ç¤Ï \fI*src\fP ¤Ë¤Ï NULL ¤¬ÀßÄꤵ¤ì¡¢½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤ò½ü¤¤¤Æ +\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¿ô¤òÊÖ¤¹¡£ +.PP +\fIdest\fP ¤¬ NULL ¤Î¾ì¹ç¡¢\fIlen\fP ¤Ï̵»ë¤µ¤ì¡¢¾åµ­¤ÈƱÍͤÎÊÑ´¹¤¬ +¹Ô¤ï¤ì¤ë¤¬¡¢ÊÑ´¹¤µ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Ï¥á¥â¥ê¤Ë½ñ¤­¹þ¤Þ¤ì¤º¡¢ÊÑ´¹Àè¤Î¾å¸Â +¤¬Â¸ºß¤·¤Ê¤¤¡£ +.PP +¾åµ­¤Î¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ê¤é¤Ð¡¢Âå¤ê¤Ë +mbsnrtowcs ´Ø¿ô¤Î¤ß¤¬»ÈÍѤ¹¤ëÀÅŪ¤Ç̾Á°¤Î¤Ê¤¤¾õÂÖ¤¬»ÈÍѤµ¤ì¤ë¡£ +.PP +¥×¥í¥°¥é¥Þ¡¼¤Ï \fIdest\fP ¤ËºÇÄã¤Ç¤â \fIlen\fP ¥ï¥¤¥Éʸ»ú¤ò½ñ¤­¹þ¤à¤³ +¤È¤¬¤Ç¤­¤ë¶õ´Ö¤¬¤¢¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR mbsnrtowcs () +´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹´°Î»¤·¤¿¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +½ªÃ¼¤Î¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ï´Þ¤Þ¤Ê¤¤¡£ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤òÊÖ¤·¡¢\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR mbsnrtowcs () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +\fIps\fP ¤È¤·¤Æ NULL ¤òÅϤ¹¤³¤È¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Ç¤Ï°ÂÁ´¤Ç¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iconv (3), +.BR mbsrtowcs (3) diff --git a/release/man3/mbsrtowcs.3 b/release/man3/mbsrtowcs.3 new file mode 100644 index 00000000..2d970e3f --- /dev/null +++ b/release/man3/mbsrtowcs.3 @@ -0,0 +1,86 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:08 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH MBSRTOWCS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mbsrtowcs \- ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t mbsrtowcs(wchar_t *" dest ", const char **" src , +.BI " size_t " len ", mbstate_t *" ps ); +.fi +.SH ÀâÌÀ +\fIdest\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ç¤Ê¤±¤ì¤Ð¡¢ +.BR mbsrtowcs () +´Ø¿ô¤Ï +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó \fI*src\fP ¤ò \fIdest\fP ¤«¤é»Ï¤Þ¤ë¥ï¥¤¥Éʸ»úÎó¤Ë +ÊÑ´¹¤¹¤ë¡£\fIdest\fP ¤Ë¤ÏºÇÂç¤Ç \fIlen\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤¬ +½ñ¤­¹þ¤Þ¤ì¤ë¡£Æ±»þ¤Ë¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò¹¹¿·¤¹¤ë¡£ +ÊÑ´¹¤Ï +.I "mbrtowc(dest, *src, n, ps)" +¤ò¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¸Â¤ê·«¤êÊÖ¤·¼Â¹Ô¤·¤¿¤Î¤È¼Â¼ÁŪ¤ËƱÍͤǤ¢¤ë¡£ +¤³¤³¤Ç \fIn\fP ¤ÏÀµ¤Î¿ô¤Ç¤¢¤ê¡¢·«¤êÊÖ¤·¤´¤È¤Ë \fIdest\fP ¤¬ 1 Áý²Ã¤µ¤»¤é¤ì¡¢ +\fI*src\fP ¤¬¾ÃÈñ¤·¤¿¥Ð¥¤¥È¿ô¤À¤±Áý²Ã¤µ¤»¤é¤ì¤ë¡£ÊÑ´¹¤Ï°Ê²¼¤Î»°¤Ä¤Î +¤¤¤º¤ì¤«¤Î¾ò·ï¤ÇÄä»ß¤¹¤ë: +.IP 1. 3 +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¡£¤³¤Î¾ì¹ç¤Ë¤Ï \fI*src\fP ¤ÏÉÔÀµ¤Ê +¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò»Ø¤¹¤è¤¦¤Ë¤·¤Æ¡¢ +.I (size_t)\ \-1 +¤òÊÖ¤·¡¢\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£ +.IP 2. +\fIlen\fP ʸ»ú¤Î L\(aq\\0\(aq °Ê³°¤Î¥ï¥¤¥Éʸ»ú¤ò \fIdest\fP ¤Ë³ÊǼ¤·¤¿¾ì¹ç¡£ +¤³¤Î¾ì¹ç¤Ï \fI*src\fP ¤Ï¼¡¤ËÊÑ´¹¤µ¤ì¤ë¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò»Ø¤¹¤è¤¦¤Ë¤·¤Æ¡¢ +\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +.IP 3. +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬽ªÃ¼¤Î \(aq\\0\(aq ¤Þ¤Ç´Þ¤á¤Æ´°Á´¤ËÊÑ´¹¤µ¤ì¤¿¾ì¹ç¡£ +(¤³¤Î»þ¡¢ÉûºîÍѤȤ·¤Æ \fI*ps\fP ¤¬½é´ü¾õÂÖ¤ËÌᤵ¤ì¤ë¡£) +¤³¤Î¾ì¹ç¤Ï \fI*src\fP ¤Ë¤Ï NULL ¤¬ÀßÄꤵ¤ì¡¢½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤ò½ü¤¤¤Æ +\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¿ô¤òÊÖ¤¹¡£ +.PP +\fIdest\fP ¤¬ NULL ¤Î¾ì¹ç¡¢\fIlen\fP ¤Ï̵»ë¤µ¤ì¡¢¾åµ­¤ÈƱÍͤÎÊÑ´¹¤¬ +¹Ô¤ï¤ì¤ë¤¬¡¢ÊÑ´¹¤µ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Ï¥á¥â¥ê¤Ë½ñ¤­¹þ¤Þ¤ì¤º¡¢ÊÑ´¹Àè¤Î¾å¸Â +¤¬Â¸ºß¤·¤Ê¤¤¡£ +.PP +¾åµ­¤Î¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ê¤é¤Ð¡¢ +Âå¤ê¤Ë +.BR mbsrtowcs () +´Ø¿ô¤Î¤ß¤¬»ÈÍѤ¹¤ëÀÅŪ¤Ç̾Á°¤Î¤Ê¤¤¾õÂÖ¤¬»ÈÍѤµ¤ì¤ë¡£ +.PP +¥×¥í¥°¥é¥Þ¡¼¤Ï \fIdest\fP ¤ËºÇÄã¤Ç¤â \fIlen\fP ¥ï¥¤¥Éʸ»ú¤ò½ñ¤­¹þ¤à¤³ +¤È¤¬¤Ç¤­¤ë¶õ´Ö¤¬¤¢¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR mbsrtowcs () +´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹´°Î»¤·¤¿¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +½ªÃ¼¤Î¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ï´Þ¤Þ¤Ê¤¤¡£ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤òÊÖ¤·¡¢\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤹ¤ë¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR mbsrtowcs () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +\fIps\fP ¤È¤·¤Æ NULL ¤òÅϤ¹¤³¤È¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Ç¤Ï°ÂÁ´¤Ç¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iconv (3), +.BR mbsnrtowcs (3), +.BR mbstowcs (3) diff --git a/release/man3/mbstowcs.3 b/release/man3/mbstowcs.3 new file mode 100644 index 00000000..8a6e2291 --- /dev/null +++ b/release/man3/mbstowcs.3 @@ -0,0 +1,76 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mbstowcs \- ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t mbstowcs(wchar_t *" dest ", const char *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +\fIdest\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ç¤Ê¤±¤ì¤Ð +.BR mbstowcs () +´Ø¿ô¤Ï +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó \fI*src\fP ¤ò \fIdest\fP ¤«¤é»Ï¤Þ¤ë¥ï¥¤¥Éʸ»úÎó¤Ë +ÊÑ´¹¤¹¤ë¡£\fIdest\fP ¤Ë¤ÏºÇÂç¤Ç \fIn\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤¬ +½ñ¤­¹þ¤Þ¤ì¤ë¡£ÊÑ´¹¤Ï½é´ü¾õÂ֤dz«»Ï¤µ¤ì¡¢ +°Ê²¼¤Î»°¤Ä¤Î¤¤¤º¤ì¤«¤Î¾ò·ï¤ÇÄä»ß¤¹¤ë: +.IP 1. 3 +ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¡£¤³¤Î¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤òÊÖ¤¹¡£ +.IP 2. +\fIn\fP ʸ»ú¤Î L\(aq\\0\(aq °Ê³°¤Î¥ï¥¤¥Éʸ»ú¤ò \fIdest\fP ¤Ë³ÊǼ¤·¤¿¾ì¹ç¡£ +¤³¤Î¾ì¹ç¤Ï \fI*src\fP ¤¬¼¡¤ËÊÑ´¹¤µ¤ì¤ë¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò»Ø¤¹¤è¤¦¤Ë¤·¤Æ¡¢ +\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£¤·¤«¤·¤³¤Î»Ø¤·¤Æ¤¤¤ë +¾ì½ê¤Î¥·¥Õ¥È¾õÂ֤ϼº¤ï¤ì¤ë¡£ +.IP 3. +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬽ªÃ¼¤Î \(aq\\0\(aq ¤Þ¤Ç´Þ¤á¤Æ´°Á´¤ËÊÑ´¹¤µ¤ì¤¿¾ì¹ç¡£ +¤³¤Î¾ì¹ç¤Ï½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤ò½ü¤¤¤Æ +\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¿ô¤òÊÖ¤¹¡£ +.PP +¥×¥í¥°¥é¥Þ¡¼¤Ï \fIdest\fP ¤ËºÇÄã¤Ç¤â \fIn\fP ¥ï¥¤¥Éʸ»ú¤ò½ñ¤­¹þ¤à¤³ +¤È¤¬¤Ç¤­¤ë¶õ´Ö¤¬¤¢¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +\fIdest\fP ¤¬ NULL ¤Î¾ì¹ç¡¢\fIn\fP ¤Ï̵»ë¤µ¤ì¡¢¾åµ­¤ÈƱÍͤÎÊÑ´¹¤¬ +¹Ô¤ï¤ì¤ë¤¬¡¢ÊÑ´¹¤µ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Ï¥á¥â¥ê¤Ë½ñ¤­¹þ¤Þ¤ì¤º¡¢ÊÑ´¹Àè¤Î¾å¸Â +¤¬Â¸ºß¤·¤Ê¤¤¡£ +.PP +¾åµ­¤Î 2. ¤Î¾ì¹ç¤òÈò¤±¤ë¤¿¤á¤Ë¥×¥í¥°¥é¥Þ¡¼¤Ï \fIn\fP ¤¬ +\fImbstowcs(NULL,src,0)+1\fP °Ê¾å¤Ç¤¢¤ë¤³¤È¤òÊݾڤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR mbstowcs () +´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úÎó¤ËÊÑ´¹´°Î»¤·¤¿¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +½ªÃ¼¤Î¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ï´Þ¤Þ¤Ê¤¤¡£ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÁø¶ø¤·¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR mbstowcs () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +.BR mbsrtowcs (3) +´Ø¿ô¤ÏƱ¤¸µ¡Ç½¤Î¤è¤êÎɤ¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mbsrtowcs (3) diff --git a/release/man3/mbtowc.3 b/release/man3/mbtowc.3 new file mode 100644 index 00000000..6cca0f43 --- /dev/null +++ b/release/man3/mbtowc.3 @@ -0,0 +1,86 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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 2001-07-04 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mbtowc \- ¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int mbtowc(wchar_t *" pwc ", const char *" s ", size_t " n ); +.fi +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤¬ÍѤ¤¤é¤ì¤ë¾ì¹ç¡¢Ä̾ï \fIs\fP ¤¬ NULL ¤Ç¤Ê¤¯ \fIpwc\fP ¤â NULL +¤Ç¤Ê¤¤¡£¤³¤Î¾ì¹ç¤Ï +.BR mbtowc () +´Ø¿ô¤Ï \fIs\fP ¤«¤é»Ï¤Þ¤ë +ºÇÂç \fIn\fP ¥Ð¥¤¥È¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò¸¡ºº¤·¤Æ¡¢¼¡¤Î´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥È +ʸ»ú¤ò¼è¤ê½Ð¤·¡¢¤½¤ì¤ò¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤·¤Æ \fI*pwc\fP ¤Ë³ÊǼ¤¹¤ë¡£ +Ʊ»þ¤Ë mbtowc ´Ø¿ô¤Î¤ß¤¬»ÈÍѤ¹¤ëÆâÉô¾õÂÖ¤ò¹¹¿·¤¹¤ë¡£\fIs\fP ¤¬ \(aq\\0\(aq +°Ê³°¤Î¥Ð¥¤¥È¤ò»Ø¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢\fIs\fP ¤«¤é¾ÃÈñ¤¹¤ë¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +\fIs\fP ¤¬ \(aq\\0\(aq ¤ò»Ø¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.PP +\fIs\fP ¤«¤é»Ï¤Þ¤ë \fIn\fP ¥Ð¥¤¥È¤¬´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò´Þ¤ó¤Ç +¤¤¤Ê¤¤¾ì¹ç¤äÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¤Ë¤Ï +.BR mbtowc () +¤Ï +\-1 ¤òÊÖ¤¹¡£¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤Ë¾éĹ¤Ê¥·¥Õ¥È¥·¡¼¥±¥ó¥¹¤¬ +´Þ¤Þ¤ì¤Æ¤¤¤ë¤È \fIn\fP >= \fIMB_CUR_MAX\fP ¤Î¾ì¹ç¤â¤³¤Î¤è¤¦¤Ê¤³¤È¤¬ +µ¯¤³¤ê¤¨¤ë¡£ +.PP +\fIs\fP ¤¬ NULL ¤Ç¤Ê¤¯ \fIpwc\fP ¤¬ NULL ¤Î¾ì¹ç¤Ï +.BR mbtowc () +´Ø¿ô¤Ï +¾åµ­¤ÈƱÍͤËÆ°ºî¤¹¤ë¤¬¡¢ÊÑ´¹¤·¤¿¥ï¥¤¥Éʸ»ú¤Ï¥á¥â¥ê¤Ë¤Ï½ñ¤­¹þ¤Þ¤ì¤Ê¤¤¡£ +.PP +.\" The Dinkumware doc and the Single Unix specification say this, but +.\" glibc doesn't implement this. +»°ÈÖÌܤξì¹ç¤È¤·¤Æ \fIs\fP ¤¬ NULL ¤Î¾ì¹ç¤Ï \fIpwc\fP ¤È \fIn\fP ¤Ï +̵»ë¤µ¤ì¤ë¡£ +.BR mbtowc () +´Ø¿ô¤Î¤ß¤¬»ÈÍѤ¹¤ë¥·¥Õ¥È¾õÂ֤Ͻé´ü¾õÂÖ¤Ë +Ìᤵ¤ì¤ë¡£¤½¤·¤Æʸ»úÉä¹æ¤¬¥·¥Õ¥È¾õÂ֤˰͸¤¹¤ë¤Ê¤é¤Ð¥¼¥í°Ê³°¤ò¡¢Ê¸»úÉä¹æ¤¬ +¾õÂ֤ˤè¤é¤Ê¤¤¤Ê¤é¤Ð¥¼¥í¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +\fIs\fP ¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð +.BR mbtowc () +´Ø¿ô¤Ï \fIs\fP ¤«¤é¾ÃÈñ¤·¤¿ +¥Ð¥¤¥È¿ô¤ò¡¢\fIs\fP ¤¬¥Ê¥ëʸ»ú¤ò»Ø¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¥¼¥í¤ò¡¢ +ÊÑ´¹¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.PP +\fIs\fP ¤¬ NULL ¤Ê¤é¤Ð +.BR mbtowc () +´Ø¿ô¤Ïʸ»úÉä¹æ¤¬¥·¥Õ¥È¾õÂ֤˰͸ +¤·¤Æ¤¤¤ì¤Ð¥¼¥í°Ê³°¤ò¡¢¾õÂ֤ˤè¤é¤Ê¤±¤ì¤Ð¥¼¥í¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR mbtowc () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Ç¤Ï°ÂÁ´¤Ç¤Ï¤Ê¤¤¡£ +.BR mbrtowc (3) +´Ø¿ô¤Ï +Ʊ¤¸µ¡Ç½¤Î¤è¤êÎɤ¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR MB_CUR_MAX (3), +.BR mbrtowc (3), +.BR mbstowcs (3) diff --git a/release/man3/memccpy.3 b/release/man3/memccpy.3 new file mode 100644 index 00000000..e4e1e3e2 --- /dev/null +++ b/release/man3/memccpy.3 @@ -0,0 +1,63 @@ +.\" 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 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" +.SH ̾Á° +memccpy \- ¥á¥â¥êÎΰè¤ò¥³¥Ô¡¼¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *memccpy(void *" dest ", const void *" src ", int " c ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR memccpy () +¤Ï¡¢¥á¥â¥êÎΰè \fIsrc\fP ¤«¤é¥á¥â¥êÎΰè \fIdest\fP ¤Ë +ºÇÂç¤Ç \fIn\fP ¥Ð¥¤¥È¤Î¥³¥Ô¡¼¤ò¹Ô¤¦¡£ +\fIn\fP ¥Ð¥¤¥È¥³¥Ô¡¼¤¹¤ëÁ°¤Ëʸ»ú \fIc\fP ¤¬¸«¤Ä¤«¤ë¤È¡¢ +¤½¤³¤Ç¥³¥Ô¡¼¤òÃæ»ß¤¹¤ë¡£ + +¥³¥Ô¡¼¸µ¤È¥³¥Ô¡¼Àè¤Î¥á¥â¥êÎΰ褬½Å¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR memccpy () +¤Ï¡¢\fIdest\fP Ãæ¤Ë¸«¤Ä¤«¤Ã¤¿ \fIc\fP ¤Î +¼¡¤Ë¤¢¤ë¥­¥ã¥é¥¯¥¿¡¼·¿¤ÎÊÑ¿ô¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢NULL ¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR bcopy (3), +.BR memcpy (3), +.BR memmove (3), +.BR strcpy (3), +.BR strncpy (3) diff --git a/release/man3/memchr.3 b/release/man3/memchr.3 new file mode 100644 index 00000000..76db725b --- /dev/null +++ b/release/man3/memchr.3 @@ -0,0 +1,141 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" 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 +.\" +.\" 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 Mon Apr 12 12:49:57 1993, David Metcalfe +.\" Modified Sat Jul 24 18:56:22 1993, Rik Faith (faith@cs.unc.edu) +.\" Modified Wed Feb 20 21:09:36 2002, Ian Redfern (redferni@logica.com) +.\" 2008-07-09, mtk, add rawmemchr() +.\" +.TH MEMCHR 3 2009-12-04 "" "Linux Programmer's Manual" +.SH ̾Á° +memchr, memrchr, rawmemchr \- ʸ»ú¤òõ¤¹¤¿¤á¤Ë¥á¥â¥ê¤ò¥¹¥­¥ã¥ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #include + +.BI "void *memchr(const void *" s ", int " c ", size_t " n ); + +.BI "void *memrchr(const void *" s ", int " c ", size_t " n ); + +.BI "void *rawmemchr(const void *" s ", int " c ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR memrchr (): +.BR rawmemchr (): +_GNU_SOURCE +.SH ÀâÌÀ +.BR memchr () +´Ø¿ô¤Ï¡¢¥Ý¥¤¥ó¥¿ \fIs\fP ¤¬»Ø¤·¼¨¤¹¥á¥â¥ê¥Ö¥í¥Ã¥¯¤Î +ÀèƬ¤Î \fIn\fP ¥Ð¥¤¥È¤«¤éʸ»ú \fIc\fP ¤òõ¤¹¡£ +ºÇ½é¤Ë \fIc\fP (unsigned char ¤È²ò¼á¤µ¤ì¤ë) ¤¬¸«¤Ä¤«¤Ã¤¿»þÅÀ¤ÇÆ°ºî¤¬Ää»ß¤¹¤ë¡£ +.PP +.BR memrchr () +´Ø¿ô¤Ï +.BR memchr () +´Ø¿ô¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ +ÀèƬ¤«¤é½çÊý¸þ¤Ëõ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥Ý¥¤¥ó¥¿ \fIs\fP ¤¬»Ø¤·¼¨¤¹ \fIn\fP ¥Ð¥¤¥È¤Î¥á¥â¥ê¥Ö¥í¥Ã¥¯¤Î +ËöÈø¤«¤éµÕ¸þ¤­¤Ëõ¤¹¡£ + +.BR rawmemchr () +´Ø¿ô¤Ï +.BR memchr () +¤ÈƱÍͤÀ¤¬¡¢ +ʸ»ú +.I c +¤¬Ê¸»úÎó +.I s +Æâ¤Î¤É¤³¤«¤Ë¤¢¤ë¤³¤È¤òÁ°Äó¤Ë¤·¤Æ +(¤Ä¤Þ¤ê¡¢¥×¥í¥°¥é¥Þ¤Ï¤½¤Î¤³¤È¤òÃΤäƤ¤¤ë)¡¢ +ºÇŬ²½¤·¤¿ÊýË¡¤Çʸ»ú +.I c +¤Î¸¡º÷¤ò¼Â¹Ô¤¹¤ë +(¤¹¤Ê¤ï¤Á¡¢½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤Î¥Á¥§¥Ã¥¯¤â¹Ô¤ï¤ì¤Ê¤¤¤·¡¢ +¸¡º÷ÈϰϤξå¸Â¤ò¼¨¤¹°ú¤­¿ô +.I n +¤â»ÈÍѤµ¤ì¤Ê¤¤)¡£ +ʸ»ú +.I c +¤¬Ê¸»úÎó +.I s +Æâ¤Ë¤Ê¤¤¾ì¹ç¡¢ +.BR rawmemchr () +¤Ïʸ»úÎóËöÈø¤ò±Û¤¨¤Æ¸¡º÷¤ò¼Â¹Ô¤¹¤ë¤«¤â¤·¤ì¤º¡¢·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¡£ +¼¡¤Ë¼¨¤¹¸Æ¤Ó½Ð¤·¤Ï¡¢Ê¸»úÎó½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤Î°ÌÃÖ¤òÆÃÄꤹ¤ë +¹â®¤Ê¼êÃʤǤ¢¤ë¡£ +.in +4n +.nf + +char *p = rawmemchr(s,\ \(aq\\0\(aq); +.fi +.in +.SH ÊÖ¤êÃÍ +.BR memchr () +´Ø¿ô¤È +.BR memrchr () +´Ø¿ô¤Ï°ìÃפ¹¤ëʸ»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤·¡¢ +¤â¤·Ê¸»ú¤¬»ØÄê¥á¥â¥êÎΰè¤Ë¸½¤ì¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ + +.BR rawmemchr () +´Ø¿ô¤Ï¥Þ¥Ã¥Á¤¹¤ë¥Ð¥¤¥È¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ï¥Þ¥Ã¥Á¤·¤¿¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥Þ¥Ã¥Á¤¹¤ë¥Ð¥¤¥È¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR rawmemchr () +¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ + +.BR memrchr () +¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.2 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +.BR memchr () +´Ø¿ô¤Ï SVr4, 4.3BSD, C89, C99, POSIX.1-2001 ¤Ë½àµò¤¹¤ë¡£ + +.BR memrchr () +´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ê¡¢glibc 2.1.91 ¤«¤é»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ + +.BR rawmemchr () +´Ø¿ô¤Ï 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) diff --git a/release/man3/memcmp.3 b/release/man3/memcmp.3 new file mode 100644 index 00000000..57f44e41 --- /dev/null +++ b/release/man3/memcmp.3 @@ -0,0 +1,64 @@ +.\" 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 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 +.\" +.TH MEMCMP 3 1993-04-10 "" "Linux Programmer's Manual" +.SH ̾Á° +memcmp \- ¥á¥â¥êÎΰè¤òÈæ³Ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int memcmp(const void *" s1 ", const void *" s2 ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR memcmp () +´Ø¿ô¤Ï¡¢¥á¥â¥êÎΰè \fIs1\fP ¤È\fIs2\fP ¤ÎºÇ½é¤Î \fIn\fP +¥Ð¥¤¥È¤òÈæ³Ó¤¹¤ë¡£ +\fIs1\fP ¤¬ \fIs2\fP ¤è¤ê¾®¤µ¤¤¤«¡¢Æ±¤¸¤«¡¢¤¢¤ë¤¤¤ÏÂ礭¤¤¤«¤Ë¤è¤Ã¤Æ +¤½¤ì¤¾¤ì¡¢Éé¤ÎÀ°¿ô¡¢0¡¢Àµ¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +.BR memcmp () +´Ø¿ô¤Ï¡¢\fIs1\fP ¤ÎºÇ½é¤Î \fIn\fP ¥Ð¥¤¥È¤¬ +\fIs2\fP ¤ÎºÇ½é¤Î \fIn\fP ¥Ð¥¤¥È¤è¤ê¤â +¾®¤µ¤¤¤«¡¢Æ±¤¸¤«¡¢¤¢¤ë¤¤¤ÏÂ礭¤¤¤«¤Ë¤è¤Ã¤Æ¤½¤ì¤¾¤ì¡¢Éé¤ÎÀ°¿ô¡¢0¡¢ +Àµ¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +.SH ½àµò +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) diff --git a/release/man3/memcpy.3 b/release/man3/memcpy.3 new file mode 100644 index 00000000..a9158abc --- /dev/null +++ b/release/man3/memcpy.3 @@ -0,0 +1,62 @@ +.\" 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 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 +.\" +.TH MEMCPY 3 1993-04-10 "" "Linux Programmer's Manual" +.SH ̾Á° +memcpy \- ¥á¥â¥êÎΰè¤ò¥³¥Ô¡¼¤¹¤ë¡£ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *memcpy(void *" dest ", const void *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR memcpy () +¤Ï¥á¥â¥êÎΰè \fIsrc\fP ¤ÎÀèƬ \fPn\fP ¥Ð¥¤¥È¤ò +¥á¥â¥êÎΰè \fIdest\fP ¤Ë¥³¥Ô¡¼¤¹¤ë¡£¥³¥Ô¡¼¸µ¤ÎÎΰè¤È +¥³¥Ô¡¼Àè¤ÎÎΰ褬½Å¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£½Å¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï +.BR memmove (3) +¤ò»È¤¦¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR memcpy () +¤Ï \fIdest\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ½àµò +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) diff --git a/release/man3/memfrob.3 b/release/man3/memfrob.3 new file mode 100644 index 00000000..02a526d8 --- /dev/null +++ b/release/man3/memfrob.3 @@ -0,0 +1,62 @@ +.\" 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 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 +.\" +.TH MEMFROB 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +memfrob \- ¥á¥â¥ê¥¨¥ê¥¢¤ÎÁàºî (°Å¹æ²½) +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "void *memfrob(void *" s ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR memfrob () +´Ø¿ô¤Ï¡¢¥á¥â¥ê¥¨¥ê¥¢ \fIs\fP ¤ÎºÇ½é¤Î \fIn\fP ¥Ð¥¤¥È¤Î +¤½¤ì¤¾¤ì¤Îʸ»ú¤ò 42 ¤È¤ÎÇÓ¾ŪÏÀÍý¤ò¤È¤ë¤³¤È¤Ë¤è¤Ã¤Æ°Å¹æ²½¤¹¤ë¡£ +ÊÑ´¹¸å¤Î¥Ç¡¼¥¿¤Ï¡¢°Å¹æ²½¤µ¤ì¤Æ¤¤¤ë¥á¥â¥ê¥¨¥ê¥¢¤Ë (ºÆÅÙ) +.BR memfrob () +´Ø¿ô¤ò»Ü¤¹¤³¤È¤Ç¡¢¸µ¤ËÌ᤹¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤ÏÂÅÅö¤Ê°Å¹æ²½¥ë¡¼¥Á¥ó¤Ç¤¢¤ë¤È¤Ï¸À¤¨¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤ÆÍߤ·¤¤¡£ +XOR ¤ò¤È¤ëÄê¿ô¤ò¸ÇÄꤷ¤Æ¤¤¤ë¤Î¤Ç¡¢¤»¤¤¤¼¤¤¡¢Ê¸»úÎó¤ò±£¤¹ÄøÅÙ¤ÎÍÑË¡¤Ë¤· +¤«¸þ¤¤¤Æ¤¤¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR memfrob () +´Ø¿ô¤Ï¡¢°Å¹æ²½¤µ¤ì¤¿¥á¥â¥ê¥¨¥ê¥¢¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ½àµò +.BR memfrob () +´Ø¿ô¤Ï GNU C ¥é¥¤¥Ö¥é¥ê¤Ë¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR strfry (3) diff --git a/release/man3/memmem.3 b/release/man3/memmem.3 new file mode 100644 index 00000000..3888405a --- /dev/null +++ b/release/man3/memmem.3 @@ -0,0 +1,72 @@ +.\" 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 +.\" 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 +.\" +.TH MEMMEM 3 2008-12-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +memmem \- Éôʬʸ»úÎó¤Î°ÌÃÖ¤ò¼¨¤¹ +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "void *memmem(const void *" haystack ", size_t " haystacklen , +.BI " const void *" needle ", size_t " needlelen ); +.fi +.SH ÀâÌÀ +.BR memmem () +´Ø¿ô¤Ï¡¢ +\fIhaystacklen\fP ¤ÎÂ礭¤µ¤ò»ý¤Ä¥á¥â¥êÎΰè \fIhaystack\fP ¤ÎÃæ¤Ç +\fIneedlelen\fP ¤ÎÂ礭¤µ¤ò»ý¤ÄÉôʬʸ»úÎó \fIneedle\fP ¤¬ +ºÇ½é¤Ë¸½¤ì¤ë°ÌÃÖ¤ò¸«¤Ä¤±¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR memmem () +´Ø¿ô¤Ï¡¢Éôʬʸ»úÎó¤Î³«»Ï¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤·¡¢¤â¤·Éôʬʸ»úÎó¤¬ +¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU extension ¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +Linux ¤Î¥é¥¤¥Ö¥é¥ê¤Ë´Ø¤·¤Æ¤¤¤¦¤È¡¢ libc 5.0.9 ¤È +¤½¤ì°ÊÁ°¤Î¤¹¤Ù¤Æ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¡¢¤³¤Î´Ø¿ô¤Ï²õ¤ì¤Æ¤¤¤ë¡£ +¤½¤ì¤é¤Î¥é¥¤¥Ö¥é¥ê¤Ç¤Ï \fIneedle\fP ¤È \fIhaystack\fP °ú¿ô¤¬ +Æþ¤ìÂؤï¤Ã¤Æ¤ª¤ê¡¢ \fIneedle\fP ¤¬ºÇ½é¤Ë½Ð¸½¤¹¤ëÉôʬ¤ÎºÇ¸å¤ò +¼¨¤¹¥Ý¥¤¥ó¥¿¤¬ÊÖ¤µ¤ì¤Æ¤¤¤¿¤Î¤Ç¤¢¤ë¡£ + +¿·µìξÊý¤Î libc ¥é¥¤¥Ö¥é¥ê¤¬¡¢ +\fIneedle\fP ¤¬¶õ¤Î¾ì¹ç (\fIhaystack\fP ¤Î¤«¤ï¤ê¤Ë) \fIhaystack-1\fP\ ¤¬ +ÊÖ¤µ¤ì¤ë¤È¤¤¤¦¥Ð¥°¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +¤½¤·¤Æ¡¢glibc 2.0 ¤Ç¤Ï¤µ¤é¤Ë°­¤¯¤Ê¤Ã¤Æ¤ª¤ê¡¢ +\fIhaystack\fP ¤ÎºÇ¸å¤Î¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤ì¤Ï glibc 2.1 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR strstr (3), +.BR feature_test_macros (7) diff --git a/release/man3/memmove.3 b/release/man3/memmove.3 new file mode 100644 index 00000000..91e9c7ad --- /dev/null +++ b/release/man3/memmove.3 @@ -0,0 +1,69 @@ +.\" 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 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 +.\" +.TH MEMMOVE 3 1993-04-10 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +memmove \- ¥á¥â¥êÎΰè¤ò¥³¥Ô¡¼¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *memmove(void *" dest ", const void *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR memmove () +¤Ï¡¢¥á¥â¥êÎΰè \fIsrc\fP ¤ÎÀèƬ \fIn\fP ¥Ð¥¤¥È¤ò +¥á¥â¥êÎΰè \fIdest\fP ¤Ë¥³¥Ô¡¼¤¹¤ë¡£¥³¥Ô¡¼¸µ¤È¥³¥Ô¡¼Àè¤Î +Îΰ褬½Å¤Ê¤Ã¤Æ¤¤¤Æ¤â¤è¤¤¡£ +ºÇ½é¤Ë +.I src +¤Î¥Ð¥¤¥È¤¬ +.I src +¤È¤â +.I dest +¤È¤â½Å¤Ê¤é¤Ê¤¤°ì»þŪ¤ÊÇÛÎó¤Ë¥³¥Ô¡¼¤µ¤ì¤Æ¤«¤é¡¢°ì»þŪ¤ÊÇÛÎ󤫤é +.I dest +¤Ë¥Ð¥¤¥È¤Î¥³¥Ô¡¼¤¬¹Ô¤ï¤ì¤¿¤«¤Î¤è¤¦¤Ë¡¢¥³¥Ô¡¼¤¬¹Ô¤ï¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR memmove () +¤Ï \fIdest\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ½àµò +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) diff --git a/release/man3/mempcpy.3 b/release/man3/mempcpy.3 new file mode 100644 index 00000000..d6b8d552 --- /dev/null +++ b/release/man3/mempcpy.3 @@ -0,0 +1,78 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" 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 +.\" +.TH MEMPCPY 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mempcpy, wmempcpy \- ¥á¥â¥êÎΰè¤ò¥³¥Ô¡¼¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n ); +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR mempcpy () +´Ø¿ô¤Ï +.BR memcpy (3) +´Ø¿ô¤È¤Û¤ÜƱ°ì¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢ +.I src +¤Ç»Ï¤Þ¤ë¥ª¥Ö¥¸¥§¥¯¥È¤«¤é +.I n +¥Ð¥¤¥È¤ò¡¢ +.I dest +¤Ç»Ø¤µ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +¤¿¤À¤· +.I dest +¤ÎÃͤòÊÖ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢ +ºÇ¸å¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¤Î¸å¤Ë³¤¯¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +¤³¤Î´Ø¿ô¤Ï¤¤¤¯¤Ä¤«¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬ +Ϣ³Ū¤Ê¥á¥â¥ê¤Î¾ì½ê¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¤è¤¦¤Ê¾õ¶·¤ÇÌò¤ËΩ¤Ä¡£ +.PP +.BR wmempcpy () +´Ø¿ô¤Ï¤³¤Î´Ø¿ô¤ÈƱ¤¸¤Ç¤¢¤ë¤¬¡¢ +.I wchar_t +·¿¤Î°ú¤­¿ô¤ò¤È¤ê¡¢ +.I n +¥ï¥¤¥Éʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +\fIdest\fP + \fIn\fP. +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR mempcpy () +¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤ª¤±¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Îã +.nf +void * +combine (void *o1, size_t s1, void *o2, size_t s2) +{ + void *result = malloc(s1 + s2); + if (result != NULL) + mempcpy(mempcpy(result, o1, s1), o2, s2); + return result; + +.fi +.SH ´ØÏ¢¹àÌÜ +.BR memccpy (3), +.BR memcpy (3), +.BR memmove (3), +.BR wmemcpy (3), +.BR feature_test_macros (7) diff --git a/release/man3/memset.3 b/release/man3/memset.3 new file mode 100644 index 00000000..704c5a87 --- /dev/null +++ b/release/man3/memset.3 @@ -0,0 +1,55 @@ +.\" 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 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 +.\" +.TH MEMSET 3 1993-04-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +memset \- ¤¢¤ë°ìÄê¤Î¥Ð¥¤¥È¤Ç¥á¥â¥êÎΰè¤òËä¤á¤ë¡£ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *memset(void *" s ", int " c ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR memset () +¤Ï \fIs\fP ¤Ç¼¨¤µ¤ì¤ë¥á¥â¥êÎΰè¤ÎÀèƬ¤«¤é \fIn\fP ¥Ð¥¤¥È¤ò +\fIc\fP ¤ÇËä¤á¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR memset () +¤Ï \fIs\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR bzero (3), +.BR swab (3), +.BR wmemset (3) diff --git a/release/man3/mkdtemp.3 b/release/man3/mkdtemp.3 new file mode 100644 index 00000000..174e3e35 --- /dev/null +++ b/release/man3/mkdtemp.3 @@ -0,0 +1,88 @@ +.\" Copyright 2001 John Levon +.\" Based on mkstemp(3), Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and 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. +.\" +.\" Japanese Version Copyright (c) 2001 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Oct 21 03:28:34 JST 2001 +.\" by Yuichi SATO +.\" +.TH MKDTEMP 3 2008-08-21 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mkdtemp \- ¾¤È½Å¤Ê¤é¤Ê¤¤°ì»þŪ¤Ê¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *mkdtemp(char *" template ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR mkdtemp (): +_BSD_SOURCE +.SH ÀâÌÀ +.BR mkdtemp () +´Ø¿ô¤Ï¡¢Â¾¤È½Å¤Ê¤é¤Ê¤¤Ì¾Á°¤Î°ì»þŪ¤Ê¥Ç¥£¥ì¥¯¥È¥ê¤ò +\fItemplate\fP ¤«¤éºîÀ®¤¹¤ë¡£ +\fItemplate\fP ¤Î¸å¤«¤é 6 ʸ»ú¤Ï XXXXXX ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ÎÉôʬ¤Ï¥Ç¥£¥ì¥¯¥È¥ê̾¤ò¾¤È½Å¤Ê¤é¤Ê¤¯¤¹¤ë¤¿¤á¤Î +ʸ»úÎó¤ÇÃÖ¤­´¹¤¨¤é¤ì¤ë¡£ +¥Ç¥£¥ì¥¯¥È¥ê¤Ïµö²Ä°À­¤ò 0700 ¤È¤·¤ÆºîÀ®¤µ¤ì¤ë¡£ +.I template +¤ÏÊѹ¹¤µ¤ì¤ë¤Î¤Ç¡¢Ê¸»úÎóÄê¿ô¤Ë¤·¤Æ¤Ï¤Ê¤é¤º¡¢Ê¸»úÇÛÎó¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR mkdtemp () +´Ø¿ô¤Ï +Êѹ¹¤µ¤ì¤¿ template ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢NULL ¤òÊÖ¤·¤Æ¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +\fItemplate\fP ¤Î¸å¤í¤«¤é 6 ʸ»ú¤¬ XXXXXX ¤Ç¤Ê¤¤¡£ +¤³¤Î¾ì¹ç¡¢\fItemplate\fP ¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.PP +\fIerrno\fP ¤ËÀßÄꤵ¤ì¤ë¾¤ÎÃͤˤĤ¤¤Æ¤Ï¡¢ +.BR mkdir (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +OpenBSD 2.2 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.SH ½àµò +POSIX.1-2008. +¤³¤Î´Ø¿ô¤Ï BSD ¤Ë¸ºß¤¹¤ë¡£ +.\" 2006 ǯ»þÅÀ¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ï POSIX.1 ¤ËÆþ¤ì¤ë¤«¸¡Æ¤Ãæ¤Ç¤¢¤ë¡£ +.\" NetBSD 1.4 ¤Ë¤â¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mkdir (2), +.BR mkstemp (3), +.BR mktemp (3), +.BR tempnam (3), +.BR tmpfile (3), +.BR tmpnam (3) diff --git a/release/man3/mkfifo.3 b/release/man3/mkfifo.3 new file mode 100644 index 00000000..7b726ede --- /dev/null +++ b/release/man3/mkfifo.3 @@ -0,0 +1,116 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1995 James R. Van Zandt +.\" +.\" 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. +.\" +.\" changed section from 2 to 3, aeb, 950919 +.\" +.\" Japanese Version Copyright (c) 1998 George Momma +.\" all rights reserved. +.\" Translated Mon May 25 23:11:03 JST 1998 +.\" by George Momma +.\" Updated 1999-12-11 by Kentaro Shirakata +.\" Updated 2008-07-30 by Kentaro Shirakata +.\" +.\"WORD: named pipe ̾Á°ÉÕ¤­¥Ñ¥¤¥× +.\"WORD: permission µö²Ä¥â¡¼¥É +.\"WORD: filename ¥Õ¥¡¥¤¥ë̾ +.\"WORD: filename component ¥Õ¥¡¥¤¥ë̾Éôʬ +.\"WORD: directory component ¥Ç¥£¥ì¥¯¥È¥êÉôʬ +.TH MKFIFO 3 2008-06-12 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mkfifo \- FIFO¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë(̾Á°ÉÕ¤­¥Ñ¥¤¥×)¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "int mkfifo(const char *" pathname ", mode_t " mode ); +.fi +.SH ÀâÌÀ +.BR mkfifo () +¤Ï̾Á° \fIpathname\fP ¤ò»ý¤ÄFIFO¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤òºîÀ® +¤¹¤ë¡£FIFO¤Îµö²Ä¥â¡¼¥É¤Ï \fImode\fP ¤Ç»ØÄꤵ¤ì¡¢¥×¥í¥»¥¹¤Î +\fBumask\fP ¤Ë¤è¤Ã¤ÆÄ̾ï¤ÎÊý¼°¤ÇÊѹ¹¤ò¼õ¤±¤ë: ºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Îµö²Ä +¥â¡¼¥É¤Ï \fB(\fP\fImode\fP\fB & ~umask)\fP ¤È¤Ê¤ë¡£ +.PP +FIFO¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ï¥Ñ¥¤¥×¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ºîÀ®¤Î¤µ¤ìÊý¤Î¤ß¤¬°Û¤Ê¤Ã¤Æ +¤¤¤ë¡£FIFO¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ï̾Á°¤Î¤Ê¤¤ÄÌ¿®Ï©¤Ç¤Ï¤Ê¤¯¡¢ +.BR mkfifo () +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÃæ¤Ë²Ã¤¨¤é¤ì¤ë¡£ +.PP +¤Ò¤È¤¿¤Ó¤³¤Î¤è¤¦¤Ë¤·¤ÆFIFO¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤ë¤È¡¢Ä̾ï¤Î¥Õ¥¡ +¥¤¥ë¤ÈƱ¤¸¤è¤¦¤Ë¡¢¤É¤Î¥×¥í¥»¥¹¤«¤é¤Ç¤âÆɤ߽Ф·¡¢½ñ¤­¹þ¤ßÍѤˤ³¤ì¤ò¥ª¡¼ +¥×¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤¿¤À¤·¡¢¤³¤ì¤ËÂФ¹¤ëÁ´¤Æ¤ÎÆþ½ÐÎÏÁàºî¤ËÀèΩ¤Ã¤Æ +¤½¤Îξü¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£FIFO¤òÆɤ߽Ф·ÍѤ˥ª¡¼¥×¥ó¤¹¤ë +¤È¡¢Ä̾ï¾¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤ÆƱ¤¸FIFO¤¬½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤ë¤Þ¤Ç¥Ö +¥í¥Ã¥¯¤µ¤ì¡¢µÕ¤Î¾ì¹ç¤âƱÍͤǤ¢¤ë¡£ +FIFO¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤ò¥Ö¥í¥Ã¥¯¤»¤º¤Ë°·¤¦ÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï +.BR fifo (7) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç +.BR mkfifo () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹ (¤Þ¤¿ \fIerrno\fP ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë)¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +\fIpathname\fP ¤ÎÃæ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î°ì¤Ä¤ËÂФ·¸¡º÷(¼Â¹Ô)µö²Ä¤¬¤Ê¤¤¡£ +.TP +.B EEXIST +\fIpathname\fP ¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¡£ +¤³¤ì¤Ë¤Ï¡¢ +.I pathname +¤¬(¥ê¥ó¥¯Àڤ줫¤É¤¦¤«¤Ë´Ø¤ï¤é¤º)¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¤â´Þ¤à¡£ +.TP +.B ENAMETOOLONG +\fIpathname\fP ¤ÎŤµ¤¬ \fBPATH_MAX\fP ¤òĶ¤¨¤Æ¤¤¤ë¤«¡¢¸Ä¡¹¤Î¥Õ¥¡¥¤¥ë +̾Éôʬ¤ÎŤµ¤¬ \fBNAME_MAX\fP ¤òĶ¤¨¤Æ¤¤¤ë¡£GNU¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¤Ï¡¢¥Õ¥¡ +¥¤¥ë̾¤ÎÁ´ÂΤÎŤµ¤ËÂФ·¤Æ¤ÏÀ©¸Â¤Ï²Ý¤»¤é¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +¤Ë¤è¤Ã¤Æ¤Ï³ÆÉôʬ¤ÎŤµ¤ËÀ©¸Â¤Î¤¢¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B ENOENT +\fIpathname\fP ¤ÎÃæ¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢¥ê¥ó¥¯Àè¤Î¤Ê¤¤¥· +¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¡£ +.TP +.B ENOSPC +¥Ç¥£¥ì¥¯¥È¥ê¤Þ¤¿¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¿·µ¬¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë;ÃϤ¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +\fIpathname\fP Ãæ¤Ç¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤ëÉôʬ¤¬¼ÂºÝ¤Ë¤Ï¥Ç¥£ +¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EROFS +\fIpathname\fP ¤¬Æɤ߼è¤êÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR mkfifo (1), +.BR close (2), +.BR open (2), +.BR read (2), +.BR stat (2), +.BR umask (2), +.BR write (2), +.BR mkfifoat (3), +.BR fifo (7) diff --git a/release/man3/mkfifoat.3 b/release/man3/mkfifoat.3 new file mode 100644 index 00000000..cc57e0aa --- /dev/null +++ b/release/man3/mkfifoat.3 @@ -0,0 +1,124 @@ +.\" 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-08-04 by Yuichi SATO , LDP v2.36 +.\" +.TH MKFIFOAT 3 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mkfifoat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤ÎÁêÂаÌÃÖ¤Ë FIFO (̾Á°ÉÕ¤­¥Ñ¥¤¥×) ¤òºî¤ë +.SH ½ñ¼° +.nf +.B #include /* AT_* Äê¿ô¤ÎÄêµÁ */ +.B #include +.sp +.BI "int mkfifoat(int " dirfd ", const char *" pathname ", mode_t " mode ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR mkfifoat (): +.br +glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L +.br +glibc 2.10 ¤è¤êÁ°: +_ATFILE_SOURCE +.SH ÀâÌÀ +.BR mkfifoat () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢ +.BR mkfifo (3) +¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ + +.I pathname +¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹Ì¾¤Ç¤¢¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I dirfd +¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë +.RB ( mkfifo (3) +¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£ + +.I pathname +¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä +.I dirfd +¤¬ÆÃÊ̤ÊÃÍ +.B AT_FDCWD +¤Ç¤¢¤ë¾ì¹ç¡¢ +.I pathname +¤Ï +.RB ( mkfifo (3) +¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î +¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ + +.I pathname +¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢ +.I dirfd +¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR mkfifoat () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR mkfifo (3) +¤ÈƱ¤¸¥¨¥é¡¼¤¬ +.BR mkfifoat () +¤Ç¤âµ¯¤³¤ë¡£ +.BR mkfifoat () +¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë: +.TP +.B EBADF +.I dirfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B ENOTDIR +.I pathname +¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä +.I dirfd +¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR mkfifoat () +¤Ï glibc ¤Î¥Ð¡¼¥¸¥ç¥ó 2.4 ¤ÇÄɲ䵤줿¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +¥«¡¼¥Í¥ë 2.6.16 °Ê¹ß¤Î Linux ¤ÇÍøÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿ +.BR mknod (2) +¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +POSIX.1-2008. +.SH Ãí°Õ +.BR mkfifoat () +¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR openat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR openat (2), +.BR mkfifo (3), +.BR path_resolution (7) diff --git a/release/man3/mkstemp.3 b/release/man3/mkstemp.3 new file mode 100644 index 00000000..62e11cc6 --- /dev/null +++ b/release/man3/mkstemp.3 @@ -0,0 +1,167 @@ +.\" 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" +.SH ̾Á° +mkstemp, mkostemp \- ¾¤È½Å¤Ê¤é¤Ê¤¤Ì¾Á°¤ò»ý¤Ä°ì»þ¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int mkstemp(char *" template ); +.sp +.BI "int mkostemp (char *" template ", int " flags ); +.fi +.sp +.in -4n +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 ÀâÌÀ +´Ø¿ô +.BR mkstemp () +¤Ï°ú¿ô +.I template +¤«¤é¾¤È½Å¤Ê¤é¤Ê¤¤°ì»þ¥Õ¥¡¥¤¥ë̾¤òÀ¸À®¤·¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤ÎºîÀ®¤È¥ª¡¼¥×¥ó¤ò¹Ô¤¤¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ + +°ú¿ô +.I template +¤Ç»Ø¼¨¤¹¤ëʸ»úÎó¤Î¸å¤í¤Î 6 ʸ»ú¤Ï XXXXXX ¤Ç¤¢¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤ÎÉôʬ¤¬¥Õ¥¡¥¤¥ë̾¤ò¾¤È½Å¤Ê¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤ëʸ»ú¤ÇÃÖ¤­´¹¤¨¤é¤ì¤ë¡£ +.I template +¤Ï½ñ¤­´¹¤¨¤é¤ì¤ë¤¿¤á¡¢Ê¸»úÎóÄê¿ô¤Ç¤Ï¤Ê¤¯Ê¸»úÇÛÎó¤È¤·¤Æ +Àë¸À¤¹¤ë¤è¤¦¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +¥Õ¥¡¥¤¥ë¤Ïµö²Ä¥â¡¼¥É 0600 ¤ÇºîÀ®¤µ¤ì¡¢½êÍ­¼Ô¤Î¤ß¤¬Æɤ߽ñ¤­²Äǽ¤Ç¤¢¤ë +(glibc ¥Ð¡¼¥¸¥ç¥ó 2.06 °ÊÁ°¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë¤Ïµö²Ä¥â¡¼¥É 0666 ¤ÇºîÀ®¤µ¤ì¡¢ +Á´¤Æ¤Î¥æ¡¼¥¶¤¬Æɤ߽ñ¤­²Äǽ¤Ç¤¢¤Ã¤¿)¡£ +ÊÖ¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ø¤ÎÆɤ߽ñ¤­Î¾Êý¤Î¥¢¥¯¥»¥¹¤¬ +²Äǽ¤Ç¤¢¤ë¡£ +¸Æ¤Ó½Ð¤·¼Ô¤¬¤½¤Î¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¥×¥í¥»¥¹¤Ç¤¢¤ë¤³¤È¤òÊݾڤ¹¤ë¤¿¤á¤Ë¡¢ +¥Õ¥¡¥¤¥ë¤Ï +.BR open (2) +¤Î +.B O_EXCL +¥Õ¥é¥°ÉÕ¤­¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ + +.BR mkostemp () +¤Ï +.BR mkstemp () +¤ÈƱÍͤÀ¤¬¡¢ +.BR open (2) +¤ËÅϤµ¤ì¤ë¥Õ¥é¥° +.RB O_APPEND , +.B O_SYNC +¤Ê¤É) ¤ò +.I flags +¤Ç»ØÄê¤Ç¤­¤ëÅÀ¤¬°Û¤Ê¤ë +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï°ì»þ¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EEXIST +¤¹¤Ç¤ËƱ¤¸Ì¾Á°¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤¿¡£ +\fItemplate\fP ¤ÎÆâÍƤÏÉÔÄê¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +°ú¿ô \fItemplate\fP ¤Ç»Ø¼¨¤µ¤ì¤¿Ê¸»úÇÛÎó¤Î¸å¤í¤Î 6 ʸ»ú¤¬ XXXXXX ¤Ç¤Ê¤¤¡£ +\fItemplate\fP ¤ÎÆâÍƤÏÊѲ½¤·¤Ê¤¤¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.BR open (2) +¤Ë½ñ¤«¤ï¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Î¤¤¤º¤ì¤«¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤â¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR mkostemp () +¤Ï glibc 2.7 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +.BR mkstemp (): +4.3BSD, POSIX.1-2001. +.BR mkostemp (): +glibc ¤Ë¤è¤ë³ÈÄ¥¡£ +.SH Ãí°Õ +µö²Ä¥â¡¼¥É 0666 ¤Ç¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¤È¤¤¤¦¸Å¤¤Æ°ºî¤Ï¡¢ +¥»¥­¥å¥ê¥Æ¥£¾å¤Î¥ê¥¹¥¯¤Ë¤Ê¤ë¾ì¹ç¤¬¤¢¤ë¡£ +Æä˾¤Î Unix ¤Ç¤Ïµö²Ä¥â¡¼¥É¤È¤·¤Æ 0600 ¤ò»È¤¦¤¿¤á¡¢ +¥×¥í¥°¥é¥à¤ò°Ü¿¢¤¹¤ëºÝ¡¢¤³¤ÎºÙ¤«¤Ê°ã¤¤¤ò¸«Íî¤È¤¹²ÄǽÀ­¤¬ +¤¢¤ë¤«¤é¤À¡£ + +¤è¤ê°ìÈÌŪ¤Ë¤Ï¡¢ +.BR mkstemp () +¤Î POSIX µ¬Äê¤Ç¤Ï¥Õ¥¡¥¤¥ë¥â¡¼¥É¤Ë¤Ä¤¤¤Æ²¿¤â½Ò¤Ù¤Æ¤¤¤Ê¤¤¡£ +½¾¤Ã¤Æ¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï +.BR mkstemp () +(¤ä +.BR mkostemp ()) +¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë¥Õ¥¡¥¤¥ë¥â¡¼¥ÉÀ¸À®¥Þ¥¹¥¯ +.RB ( umask (2) +»²¾È) ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¤«³Îǧ¤¹¤ë¤Ù¤­¤Ç¤¢¤ë¡£ + +.BR mktemp () +¤Î¥×¥í¥È¥¿¥¤¥×Àë¸À¤Ï¡¢libc4, libc5, glibc1 ¤Ç¤Ï +.I +¤Ë´Þ¤Þ¤ì¤ë; glibc2 ¤Ç¤Ï POSIX.1 ¤Ë½àµò¤· +.I +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mkdtemp (3), +.BR mktemp (3), +.BR tempnam (3), +.BR tmpfile (3), +.BR tmpnam (3) diff --git a/release/man3/mktemp.3 b/release/man3/mktemp.3 new file mode 100644 index 00000000..611cda7f --- /dev/null +++ b/release/man3/mktemp.3 @@ -0,0 +1,111 @@ +.\" Copyright (C) 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 Sat Jul 24 18:48:06 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Jun 23 01:26:34 1995 by Andries Brouwer (aeb@cwi.nl) +.\" (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 ´Ø¿ô +.\" +.TH MKTEMP 3 2008-08-06 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +mktemp \- ¾¤È½Å¤Ê¤é¤Ê¤¤¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë̾¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *mktemp(char *" template ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR mktemp (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +\"O .SH DESCRIPTION +.SH ÀâÌÀ +´Ø¿ô +.BR mktemp () +¤Ï°ú¿ô \fItemplate\fP ¤«¤é¾¤È½Å¤Ê¤é¤Ê¤¤ +¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë̾¤òºîÀ®¤¹¤ë¡£°ú¿ô \fItemplate\fP ¤Ç»Ø¼¨¤¹¤ëʸ»úÇÛÎó +¤Î¸å6ʸ»ú¤Ï XXXXXX ¤Ç¤¢¤ëɬÍפ¬¤¢¤ë¡£¤³¤ÎÉôʬ¤¬¥Õ¥¡¥¤¥ë̾¤ò¾¤È +½Å¤Ê¤é¤Ê¤¤¤Ë¤¹¤ë¤è¤¦¤Êʸ»ú¤ÇÃÖ¤­´¹¤¨¤é¤ì¤ë¡£ +.I template +¤Ï½ñ¤­´¹¤¨¤é¤ì¤ë¤¿¤á¡¢Ê¸»úÎóÄê¿ô¤Ç¤Ï¤Ê¤¯Ê¸»úÇÛÎó¤È¤·¤ÆÀë¸À¤¹¤ë¤è¤¦¤Ë +¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +´Ø¿ô +.BR mktemp () +¤Ï¾ï¤Ë \fItemplate\fP ¤òÌ᤹¡£ +°ì°Õ¤Ê̾Á°¤¬ºîÀ®¤µ¤ì¤¿¾ì¹ç¡¢ +\fItemplate\fP ¤ÎºÇ¸å¤Î 6 ¥Ð¥¤¥È¤Ë +¾¤È½Å¤Ê¤é¤Ê¤¤Ì¾Á° (¤½¤ì¤Þ¤Ç¤Ë½Ð¤Æ¤¤¤Ê¤¤Ì¾Á°) ¤Ë¤Ê¤ë¤è¤¦¤ÊÃͤ¬³ÊǼ¤µ¤ì¤ë¡£ +°ì°Õ¤Ê̾Á°¤¬ºîÀ®¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +\fItemplate\fP ¤Ë¤Ï¶õʸ»úÎ󤬥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +°ú¿ô \fItemplate\fP ¤Ç»Ø¼¨¤µ¤ì¤¿Ê¸»úÎó¤Î¸å6ʸ»ú¤¬ XXXXXX ¤Ç¤Ê¤¤¡£ +.SH ½àµò +4.3BSD, POSIX.1-2001. +POSIX.1-2008 ¤Ç¤Ï +.BR mktemp () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +libc4, libc5, glibc1 ¤Ç¤Î¥×¥í¥È¥¿¥¤¥×Àë¸À¤Ï +.I +¤Ë´Þ¤Þ¤ì¤ë; glibc2 ¤Ç¤Ï Single Unix Specification ¤Ë½¾¤Ã¤Æ +.I +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +.BR mktemp () +¤ò·è¤·¤Æ»È¤ï¤Ê¤¤¤³¤È¡£4.3BSD ·Ï¤Î¼ÂÁõ¤ä XXXXXX ¤ò +¥×¥í¥»¥¹ ID ¤È1ʸ»ú¤Ë¤è¤êÃÖ¤­´¹¤¨¤ëÊý¼°¤Ç¤Ï¤»¤¤¤¼¤¤26¤Î̾Á°¤òÊÖ¤¹ +¤³¤È¤¬¤Ç¤­¤ë¤Ë¤¹¤®¤Ê¤¤¡£ +¤³¤Î̾Á°¤Ï´Êñ¤Ë¿ä¬¤Ç¤­¤ë¤³¤È¤ä¡¢¤½¤Î̾Á°¤¬¤¹¤Ç¤Ë¸ºß¤·¤Æ¤¤¤ë¤«¤É¤¦¤« +¥Æ¥¹¥È¤·¤Æ¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë´Ö¤Ë¶¥¹ç¤¬¤¢¤ë»ö¤«¤é¡¢ +.BR mktemp () +¤ò»È¤¦¤Î¤ÏËè²ó¥»¥­¥å¥ê¥Æ¥£¥ê¥¹¥¯¤ò¤ª¤«¤¹¤³¤È¤Ë¤Ê¤ë¡£ +¤³¤Î¶¥¹ç¤Ï +.BR mkstemp (3) +¤ò»È¤¦¤³¤È¤ÇÈò¤±¤é¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mkstemp (3), +.BR tempnam (3), +.BR tmpfile (3), +.BR tmpnam (3) diff --git a/release/man3/modf.3 b/release/man3/modf.3 new file mode 100644 index 00000000..2f4e8675 --- /dev/null +++ b/release/man3/modf.3 @@ -0,0 +1,92 @@ +.\" 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-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) 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +modf, modff, modfl \- ÉâÆ°¾®¿ôÅÀ¼Â¿ô¤«¤é¡¢Éä¹æÉÕ¤­À°¿ô¤È¾®¿ôÉôʬ¤ò¼è¤ê½Ð¤¹´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double modf(double " x ", double *" iptr ); +.br +.BI "float modff(float " x ", float *" iptr ); +.br +.BI "long double modfl(long double " x ", long double *" iptr ); +.fi +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR modf (), +.BR modl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR modf () +´Ø¿ô¤Ï¡¢°ú¿ô \fIx\fP ¤òÀ°¿ôÉôʬ¤È¾®¿ôÉôʬ¤Ëʬ³ä¤¹¤ë¡£ +¤³¤Î¤È¤­¡¢¤Õ¤¿¤Ä¤ÎÃͤϤȤâ¤Ë \fIx\fP ¤ÈƱ¤¸Éä¹æ¤ò»ý¤Ä¡£ +À°¿ôÉôʬ¤Ï \fIiptr\fP ¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR modf () +´Ø¿ô¤Ï \fIx\fP ¤Î¾®¿ôÉôʬ¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¡¢ +.IR *iptr +¤Ë NaN ¤¬ÀßÄꤵ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Î¾ì¹ç¡¢ ++0 (\-0) ¤¬ÊÖ¤µ¤ì¡¢ +.IR *iptr +¤ËÀµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR frexp (3), +.BR ldexp (3) diff --git a/release/man3/mpool.3 b/release/man3/mpool.3 new file mode 100644 index 00000000..0ee4ed1b --- /dev/null +++ b/release/man3/mpool.3 @@ -0,0 +1,225 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)mpool.3 8.1 (Berkeley) 6/4/93 +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito +.\" all rights reserved. +.\" Translated Mon Jul 26 21:51:36 JST 1999 +.\" by Shouichi Saito +.\" Proofed Tue Aug 19 1999 by NAKANO Takeo +.\" +.\"WORD: descriptor ¥Ç¥¹¥¯¥ê¥×¥¿ +.TH MPOOL 3 1993-06-04 "" "Linux Programmer's Manual" +.UC 7 +.SH ̾Á° +mpool \- ¶¦Í­¥á¥â¥ê¥Ð¥Ã¥Õ¥¡¥×¡¼¥ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "MPOOL *mpool_open(DBT *" key ", int " fd ", pgno_t " pagesize \ +", pgno_t " maxcache ); +.sp +.BI "void mpool_filter(MPOOL *" mp ", void (*pgin)(void *, pgno_t, void *)," +.BI " void (*" pgout ")(void *, pgno_t, void *)," +.BI " void *" pgcookie ); +.sp +.BI "void *mpool_new(MPOOL *" mp ", pgno_t *" pgnoaddr ); +.sp +.BI "void *mpool_get(MPOOL *" mp ", pgno_t " pgno ", unsigned int " flags ); +.sp +.BI "int mpool_put(MPOOL *" mp ", void *" pgaddr ", unsigned int " flags ); +.sp +.BI "int mpool_sync(MPOOL *" mp ); +.sp +.BI "int mpool_close(MPOOL *" mp ); +.fi +.SH ÀâÌÀ +.I mpool +¤Ï¡¢¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥Ú¡¼¥¸»Ø¸þ¤Î¥Ð¥Ã¥Õ¥¡´ÉÍý¤ò¼ÂÁõ¤·¤¿ +¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ç¤¢¤ë¡£ +.PP +´Ø¿ô +.BR mpool_open () +¤Ï¥á¥â¥ê¥×¡¼¥ë¤ò½é´ü²½¤¹¤ë¡£ +.I key +°ú¿ô¤Ï¥Ð¥¤¥Èʸ»úÎó¤Ç¤¢¤ê¡¢¥Ð¥Ã¥Õ¥¡¤ò¶¦Í­¤·¤¿¤¤Ê£¿ô¥×¥í¥»¥¹´Ö +¤Ç¤Î¥Í¥´¥·¥¨¡¼¥·¥ç¥ó¤Ë»È¤ï¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¥Ð¥Ã¥Õ¥¡¤¬¶¦Í­¥á¥â¥ê¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¤È¡¢ +Ʊ¤¸¥­¡¼¤ò»È¤¦¥×¥í¥»¥¹¤ÏÁ´¤Æ¥Ð¥Ã¥Õ¥¡¤ò¶¦Í­¤¹¤ë¡£ +.I key +¤¬ NULL ¤À¤È¡¢¥Ð¥Ã¥Õ¥¡¤Ï¥×¥é¥¤¥Ù¡¼¥È¤Ê¥á¥â¥ê¤Ë³ä¤êÉÕ¤±¤é¤ì¤ë¡£ +.I fd +°ú¿ô¤Ï¤â¤È¤Ë¤Ê¤ë¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¤Ï¥·¡¼¥¯²Äǽ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.I key +¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä´û¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Ë¥Þ¥Ã¥Á¤·¤¿¾ì¹ç¡¢ +.I fd +°ú¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.PP +.I pagesize +°ú¿ô¤Ï¥Ð¥¤¥Èñ°Ì¤Ç¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤Ç¤¢¤ê¡¢¥Õ¥¡¥¤¥ë¤Ï¤³¤Î¥µ¥¤¥º¤Ëʬ³ä¤µ¤ì¤ë¡£ +.I maxcache +°ú¿ô¤Ï´ð¥Õ¥¡¥¤¥ë¤ò¥­¥ã¥Ã¥·¥å¤¹¤ë¤È¤­¤ËÍѤ¤¤ëºÇÂç¥Ú¡¼¥¸¿ô¤Ç¤¢¤ë¡£ +.\"NAKANO "at any one time" ¤Ï¡Ö¤É¤ó¤Ê½Ö´Ö¤Ë¤ª¤¤¤Æ¤â (ºÇÂç)¡×¤Ç¤¹¤¬¡¢ +.\"NAKANO ¾Êά²Äǽ¤Ç¤·¤ç¤¦¡£ +¤³¤ÎÃͤϥե¡¥¤¥ë¥Ð¥Ã¥Õ¥¡¤ò¶¦Í­¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î¿ô¤Ë¤Ï´Ø·¸¤Ê¤¤¤¬¡¢ +¥Õ¥¡¥¤¥ë¤ò¶¦Í­¤¹¤ë¥×¥í¥»¥¹¤¬»ØÄꤷ¤¿¤¦¤Á¤ÎºÇÂçÃͤ¬¼ÂºÝ¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +´Ø¿ô +.BR mpool_filter () +¤ÏÆ©²áŪ¤Ê¥Ú¡¼¥¸Æþ½ÐÎϽèÍý¤ò²Äǽ¤Ë¤¹¤ë¡£ +´Ø¿ô +.I pgin +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢ +¥Õ¥¡¥¤¥ë¤«¤é¥á¥â¥ê¥×¡¼¥ë¤ËÆɤ߹þ¤Þ¤ì¤ëÅ٤ˤ³¤Î´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +´Ø¿ô +.I pgout +¤¬»ØÄꤵ¤ì¤Æ¤¤¤È¡¢ +¥Ð¥Ã¥Õ¥¡¤«¤é¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤µ¤ì¤ëÅ٤ˤ³¤Î´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +¤É¤Á¤é¤Î´Ø¿ô¤â¡¢ +.I pgcookie +¥Ý¥¤¥ó¥¿¡¢¥Ú¡¼¥¸¿ô¡¢Æɤ߽ñ¤­¤µ¤ì¤ë¥Ú¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò°ú¿ô¤Ë¤È¤ë¡£ +.PP +´Ø¿ô +.BR mpool_new () +¤Ï +.I MPOOL +¥Ý¥¤¥ó¥¿¤È¥¢¥É¥ì¥¹¤ò°ú¿ô¤Ë¤È¤ë¡£ +¿·¤·¤¤¥Ú¡¼¥¸¤¬³ä¤êÅö¤Æ²Äǽ¤Ê¾ì¹ç¡¢¥Ú¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬ÊÖ¤µ¤ì¡¢ +¥Ú¡¼¥¸¿ô¤¬ +.I pgnoaddr +¥¢¥É¥ì¥¹¤ËǼ¤á¤é¤ì¤ë¡£ +³ä¤êÅö¤Æ¤¬ÉÔ²Äǽ¤Ê¾ì¹ç¤Ï NULL ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +´Ø¿ô +.BR mpool_get () +¤Ï +.I MPOOL +¥Ý¥¤¥ó¥¿¤È¥Ú¡¼¥¸¿ô¤ò°ú¿ô¤Ë¤È¤ë¡£¥Ú¡¼¥¸¤¬Â¸ºß¤·¤Æ¤¤¤ë¤È¡¢ +¥Ú¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +¸ºß¤·¤Æ¤¤¤Ê¤¤¤È NULL ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.I flags +°ú¤­¿ô¤Ï¸½ºß»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +´Ø¿ô +.BR mpool_put () +¤Ï +.I pgaddr +¤¬»²¾È¤¹¤ë¥Ú¡¼¥¸¤ò²òÊü¤¹¤ë¡£ +.I pgaddr +¤Ï°ÊÁ°¤Ë +.BR mpool_get () +¤« +.BR mpool_new () +¤¬ÊÖ¤·¤¿¥¢¥É¥ì¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +flag ¤ÎÃͤϰʲ¼¤ÎÃͤΤ¤¤º¤ì¤«¤«¡¢¤³¤ì¤é¤ÎÏÀÍýϤǤ¢¤ë¡£ +.TP +.B MPOOL_DIRTY +¥Ú¡¼¥¸¤ÏÊѹ¹¤µ¤ì¤Æ¤ª¤ê¡¢¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹É¬Íפ¬¤¢¤ë¡£ +.PP +.BR mpool_put () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤ò¡¢¥¨¥é¡¼¤¬¤¢¤ë¤È \-1 ¤òÊÖ¤¹¡£ +.PP +´Ø¿ô +.BR mpool_sync () +¤Ï +.I MPOOL +¥Ý¥¤¥ó¥¿¤Î¼¨¤¹¥Ú¡¼¥¸¤Î¤¦¤Á¡¢ +Êѹ¹¤µ¤ì¤¿¤â¤Î¤òÁ´¤Æ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹¡£ +.BR mpool_sync () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤ò¡¢¥¨¥é¡¼¤¬¤¢¤ë¤È \-1 ¤òÊÖ¤¹¡£ +.PP +´Ø¿ô +.BR mpool_close () +¤Ï¥á¥â¥ê¥×¡¼¥ë¥¯¥Ã¥­¡¼¤Î¼¨¤¹³ä¤êÅö¤ÆºÑ¤ß¤Î¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£ +Êѹ¹¤µ¤ì¤¿¥Ú¡¼¥¸¤Ï¥Õ¥¡¥¤¥ë¤Ë\fB½ñ¤­½Ð¤µ¤ì¤Ê¤¤\fP¡£ +.I mpool_close () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤ò¡¢¥¨¥é¡¼¤¬¤¢¤ë¤È \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +´Ø¿ô +.BR mpool_open () +¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR malloc (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +´Ø¿ô +.BR mpool_get () +¤Ï¼ºÇÔ¤¹¤ë¤È¼¡¤Î¤è¤¦¤Ê +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.TP 15 +.B EINVAL +Í×µá¤Î¤¢¤Ã¤¿¥ì¥³¡¼¥É¤Ï¸ºß¤·¤Ê¤¤¡£ +.PP +´Ø¿ô +.BR mpool_new () +¤È +.BR mpool_get () +¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR read (2), +.BR write (2), +.BR malloc (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +´Ø¿ô +.BR mpool_sync () +¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR write (2) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.PP +´Ø¿ô +.BR mpool_close () +¤Ï¼ºÇÔ¤¹¤ë¤È¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó +.BR free (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¤Ë¸ºß¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR btree (3), +.BR dbopen (3), +.BR hash (3), +.BR recno (3) diff --git a/release/man3/mq_close.3 b/release/man3/mq_close.3 new file mode 100644 index 00000000..05148a9e --- /dev/null +++ b/release/man3/mq_close.3 @@ -0,0 +1,75 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-23, Akihiro MOTOKI +.\" +.TH MQ_CLOSE 3 2006-02-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mq_close \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò¤ò¥¯¥í¡¼¥º¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "mqd_t mq_close(mqd_t " mqdes ); +.fi +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR mq_close () +¤Ï¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò (message queue descriptor) +.I mqdes +¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ + +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬ +.I mqdes +·Ðͳ¤Ç¤³¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ËÄÌÃÎÍ×µá (notification request) +¤òÀßÄꤷ¤Æ¤¤¤ë¾ì¹ç¡¢ÄÌÃÎÍ×µá¤Ïºï½ü¤µ¤ì¡¢Â¾¤Î¥×¥í¥»¥¹¤¬¤½¤Î¥­¥å¡¼¤Ë +ÂФ·¤ÆÄÌÃÎÍ×µá¤òÀßÄê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR mq_close () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I mqdes +¤Ç»ØÄꤵ¤ì¤¿µ­½Ò»Ò¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +¥×¥í¥»¥¹½ªÎ»»þ¡¢¤â¤·¤¯¤Ï +.BR execve (2) +¼Â¹Ô»þ¤Ë¡¢Á´¤Æ¤Î¥ª¡¼¥×¥ó¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï¼«Æ°Åª¤Ë¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR mq_overview (7) diff --git a/release/man3/mq_getattr.3 b/release/man3/mq_getattr.3 new file mode 100644 index 00000000..d603017b --- /dev/null +++ b/release/man3/mq_getattr.3 @@ -0,0 +1,162 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-23, Akihiro MOTOKI +.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" +.TH MQ_GETATTR 3 2008-09-29 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mq_getattr, mq_setattr \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î°À­¤òÀßÄê/¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "mqd_t mq_getattr(mqd_t " mqdes ", struct mq_attr *" attr ); + +.BI "mqd_t mq_setattr(mqd_t " mqdes ", struct mq_attr *" newattr "," +.BI " struct mq_attr *" oldattr ); +.fi +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR mq_getattr () +¤È +.BR mq_setattr () +¤Ï¡¢µ­½Ò»Ò +.I mqdes +¤Ç»²¾È¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î°À­¤Î¼èÆÀ¤ÈÊѹ¹¤ò¤½¤ì¤¾¤ì¹Ô¤¦¡£ + +.BR mq_getattr () +¤Ï¡¢ +.I attr +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë +.I mq_attr +¹½Â¤ÂΤò³ÊǼ¤·¤ÆÊÖ¤¹¡£¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +struct mq_attr { + long mq_flags; /* ¥Õ¥é¥°: 0 ¤« O_NONBLOCK */ + long mq_maxmsg; /* ¥­¥å¡¼¤ÎºÇÂç¥á¥Ã¥»¡¼¥¸¿ô */ + long mq_msgsize; /* ºÇÂç¥á¥Ã¥»¡¼¥¸¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) */ + long mq_curmsgs; /* ¥­¥å¡¼¤Ë¸½ºßÆþ¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¿ô */ +}; +.fi +.in +.PP +.I mq_flags +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢¥ª¡¼¥×¥ó¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò (open message queue +description) ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Õ¥é¥°¤¬³ÊǼ¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï +.BR mq_open (3) +¤Ç¥­¥å¡¼¤¬ºîÀ®¤µ¤ì¤ëºÝ¤Ë½é´ü²½¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë¸½¤ì¤ë¥Õ¥é¥°¤Ï +.B O_NONBLOCK +¤À¤±¤Ç¤¢¤ë¡£ + +.I mq_maxmsg +¤È +.I mq_msgsize +¥Õ¥£¡¼¥ë¥É¤Ï +.BR mq_open (3) +¤Ç¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬ºîÀ®¤µ¤ì¤ëºÝ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.I mq_maxmsg +¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +.BR mq_send (3) +¤ò»È¤Ã¤Æ¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¥á¥Ã¥»¡¼¥¸¿ô¤Î¾å¸Â¤Ç¤¢¤ë¡£ +.I mq_msgsize +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¥á¥Ã¥»¡¼¥¸¤Î +¾å¸Â¥µ¥¤¥º¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï¤É¤Á¤é¤â 0 ¤è¤êÂ礭¤ÊÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤ËÀßÄê¤Ç¤­¤ëÃͤξå¸Â¤Ï +.I /proc +¥Õ¥¡¥¤¥ë¤Ë¤è¤ê·è¤Þ¤ë¡£ +.I /proc +¥Õ¥¡¥¤¥ë¤Î¾ÜºÙ¤Ï +.BR mq_open (3) +¤ËÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ + +.I mq_curmsgs +¥Õ¥£¡¼¥ë¥É¤Ï¥­¥å¡¼¤Ë¸½ºß³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¿ô¤òÊÖ¤¹¡£ + +.BR mq_setattr () +¤Ï¡¢ +.I newattr +¤¬»Ø¤¹ +.I mq_attr +¹½Â¤ÂΤÇÍ¿¤¨¤é¤ì¤¿¾ðÊó¤ò»È¤Ã¤Æ¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î°À­¤òÀßÄꤹ¤ë¡£ +Êѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë°À­¤Ï¡¢ +.I mq_flags +¤Î +.B O_NONBLOCK +¥Õ¥é¥°¤ÎÀßÄê¤À¤±¤Ç¤¢¤ë¡£ +.I newattr +¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤Ï̵»ë¤µ¤ì¤ë¡£ +.I oldattr +¥Õ¥£¡¼¥ë¥É¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢ +.BR mq_getattr () +¤¬ÊÖ¤¹¤Î¤ÈƱ¤¸¾ðÊó¤ò³ÊǼ¤·¤¿ +.I mq_attr +¹½Â¤ÂΤò +.I oldattr +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.I mq_getattr () +¤È +.I mq_setattr () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I mqdes +¤Ç»ØÄꤵ¤ì¤¿µ­½Ò»Ò¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EINVAL +.I newattr\->mq_flags +¤Ë +.B O_NONBLOCK +°Ê³°¤Î¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +Linux ¤Ç¤Ï¡¢ +.BR mq_getattr () +¤È +.BR mq_setattr () +¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤¢¤ê¡¢ +.BR mq_getsetattr (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mq_close (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR mq_overview (7) diff --git a/release/man3/mq_notify.3 b/release/man3/mq_notify.3 new file mode 100644 index 00000000..4c8b9ac5 --- /dev/null +++ b/release/man3/mq_notify.3 @@ -0,0 +1,289 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-31, Akihiro MOTOKI +.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24 +.\" +.TH MQ_NOTIFY 3 2009-09-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mq_notify \- ¥á¥Ã¥»¡¼¥¸ÅþÃå»þ¤ËÄÌÃΤò¹Ô¤¦¤è¤¦ÅÐÏ¿¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "mqd_t mq_notify(mqd_t " mqdes ", const struct sigevent *" notification ); +.fi +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR mq_notify () +¤ò»È¤¦¤È¡¢¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I mqdes +¤Ç»²¾È¤µ¤ì¤ë¶õ¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ë¿·¤·¤¯¥á¥Ã¥»¡¼¥¸¤¬ÅþÃ夷¤¿»þ¤Ë +ÈóƱ´ü¤ÎÄÌÃÎ (notification) ¤ÎÇÛÁ÷¤¬¹Ô¤ï¤ì¤ë¤è¤¦¤ËÅÐÏ¿¤·¤¿¤ê¡¢ +¤½¤Î²ò½ü¤ò¹Ô¤Ã¤¿¤ê¤Ç¤­¤ë¡£ + +.I notification +°ú¤­¿ô¤Ï +.I sigevent +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I sigevent +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤Ê´¶¤¸¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.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 for thread + notification */ + void *sigev_notify_attributes; + /* Thread function attributes */ +}; +.fi +.in +.PP +.I notification +¤¬ NULL ¤Ç¤Ê¤¤¥Ý¥¤¥ó¥¿¤Ç¤¢¤ì¤Ð¡¢ +.BR mq_notify () +¤Ï¥á¥Ã¥»¡¼¥¸ÄÌÃΤò¼õ¤±¼è¤ë¤è¤¦¤Ë¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤òÅÐÏ¿¤¹¤ë¡£ +.I notification +¤¬»Ø¤¹ +.I sigevent +¤Î +.I sigev_notify +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤É¤Î¤è¤¦¤ÊÄÌÃΤò¹Ô¤¦¤Î¤«¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤ò»ý¤Ä¡£ +.TP +.B SIGEV_NONE +¡Ö¶õ¤Î (null)¡×¤ÎÄÌÃÎ: ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤òÄÌÃΤΰ¸Àè¤È¤·¤ÆÅÐÏ¿¤¹¤ë¤¬¡¢ +¼ÂºÝ¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬ÅþÃ夷¤¿»þ¤ËÄÌÃΤÏÁ÷¤é¤ì¤Ê¤¤¡£ +.\" When is SIGEV_NONE useful? +.TP +.B SIGEV_SIGNAL +.I sigev_signo +¤Ç»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤òÁ÷¤Ã¤Æ¡¢¥×¥í¥»¥¹¤ËÄÌÃΤ¹¤ë¡£ +.BR sigaction (2) +¤Î +.B SA_SIGINFO +¥Õ¥é¥°¤Ç¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÅÐÏ¿¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +¤½¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ç¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÂèÆó°ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¤ë +.I siginfo_t +¹½Â¤ÂΤγƥե£¡¼¥ë¥É¤Ï°Ê²¼¤Î¤è¤¦¤ËÀßÄꤵ¤ì¤ë¡£ +.I si_code +¤Ë¤Ï +.B SI_MESGQ +¤¬¡¢ +.I si_signo +¤Ë¤Ï¥·¥°¥Ê¥ëÈֹ椬¡¢ +.I si_value +¤Ë¤Ï +.I notification\->sigev_value +¤Ç»ØÄꤷ¤¿Ãͤ¬ÀßÄꤵ¤ì¤ë¡£ +.\" I don't know of other implementations that set +.\" si_pid and si_uid -- MTK +.I si_pid +¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤·¤¿¥×¥í¥»¥¹¤Î PID ¤¬¡¢ +.I si_uid +¤Ë¤ÏÁ÷¿®¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID ¤¬ÀßÄꤵ¤ì¤ë¡£ +.BR sigwaitinfo (2) +¤ò»È¤Ã¤Æ¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¾ì¹ç¤â¡¢Æ±¤¸¾ðÊó¤¬ÆÀ¤é¤ì¤ë¡£ +.TP +.B SIGEV_THREAD +¿·¤·¤¤¥¹¥ì¥Ã¥É¤Î³«»Ï´Ø¿ô¤È¤·¤Æ +.I notification\->sigev_thread_function +¤òµ¯Æ°¤¹¤ë¤³¤È¤ÇÄÌÃΤò¹Ô¤¦¡£ +µ¯Æ°»þ¤Î´Ø¿ô¤Î°ú¤­¿ô¤È¤·¤Æ¤Ï +.I notification\->sigev_value +¤À¤±¤¬ÅϤµ¤ì¤ë¡£ +.I notification\->sigev_notify_attributes +¤Ï¡¢NULL °Ê³°¤Î¾ì¹ç¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¤Î°À­¤òÄêµÁ¤¹¤ë +.I pthread_attr_t +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤È¤Ê¤Ã¤Æ¤¤¤ëɬÍפ¬¤¢¤ë +.RB ( pthread_attr_init (3) +»²¾È)¡£ +.PP +°ì¤Ä¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤«¤éÄÌÃΤò¼õ¿®¤¹¤ë¤è¤¦¤ËÅÐÏ¿¤Ç¤­¤ë¥×¥í¥»¥¹¤Ï +°ì¤Ä¤À¤±¤Ç¤¢¤ë¡£ + +.I notification +¤¬ NULL ¤Ç¡¢¤«¤Ä¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¤³¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤«¤é¤Î +ÄÌÃΤò¼õ¿®¤¹¤ë¤Ë¸½ºßÅÐÏ¿¤·¤Æ¤¤¤ë¾ì¹ç¡¢ÅÐÏ¿¤òºï½ü¤¹¤ë¡£ +¤³¤ì°Ê¹ß¡¢ÊÌ¤Î¥×¥í¥»¥¹¤¬¤³¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤«¤éÄÌÃΤò¼õ¿®¤¹¤ë¤è¤¦¤Ë +ÅÐÏ¿¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + +¥á¥Ã¥»¡¼¥¸ÄÌÃΤϡ¢¤½¤ì¤Þ¤Ç¶õ¤Î¥­¥å¡¼¤Ë¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¤¬ÅþÃ夷¤¿ +¾ì¹ç¤Ë¤Î¤ß¹Ô¤ï¤ì¤ë¡£ +.BR mq_notify () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤Ë¤½¤Î¥­¥å¡¼¤¬¶õ¤Ç¤Ê¤¤¾ì¹ç¡¢ +¤½¤Î¥­¥å¡¼¤¬¶õ¤Ë¤Ê¤ê¡¢¤½¤Î¸å¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¤¬ÅþÃ夷¤¿»þ¤Ë +½é¤á¤ÆÄÌÃΤ¬¹Ô¤ï¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ + +ÊÌ¤Î¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤¬ +.BR mq_receive (3) +¤ò»È¤Ã¤Æ¡¢¶õ¤Î¥­¥å¡¼¤«¤é¥á¥Ã¥»¡¼¥¸¤ÎÆɤ߽Ф·¤òÂԤäƤ¤¤ë¾ì¹ç¡¢ +¥á¥Ã¥»¡¼¥¸ÄÌÃΤÎÅÐÏ¿¤ÏÁ´¤Æ̵»ë¤µ¤ì¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤Ï +.BR mq_receive (3) +¤ò¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤ËÇÛÁ÷¤µ¤ì¡¢ +¥á¥Ã¥»¡¼¥¸ÄÌÃΤÎÅÐÏ¿¤Ï¸úÎϤò»ý¤Ã¤¿¤Þ¤Þ¤È¤Ê¤ë¡£ + +ÄÌÃΤϰìÅÙ¤À¤±¹Ô¤ï¤ì¤ë¡£ÄÌÃΤ¬Á÷¤é¤ì¤¿¸å¤Ï¡¢ÄÌÃÎÍ×µá¤ÎÅÐÏ¿¤Ïºï½ü¤µ¤ì¡¢ +ÊÌ¤Î¥×¥í¥»¥¹¤¬¥á¥Ã¥»¡¼¥¸ÄÌÃΤò¼õ¿®¤¹¤ë¤è¤¦¤ËÅÐÏ¿¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +ÄÌÃΤò¼õ¤±¤¿¥×¥í¥»¥¹¤¬¼¡¤ÎÄÌÃΤâ¼õ¿®¤·¤¿¤¤¾ì¹ç¤Ï¡¢ +.BR mq_notify () +¤ò»È¤Ã¤Æ¤½¤Î¸å¤ÎÄÌÃΤâ¼õ¤±¤ë¤è¤¦¤ËÍ׵᤹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR mq_notify () +¤òºÆÅٸƤӽФ¹¤Î¤Ï¡¢Æɤ߽Ф·¤Æ¤¤¤Ê¤¤¥á¥Ã¥»¡¼¥¸¤òÁ´ÉôÆɤ߽Ф·¤Æ +¥­¥å¡¼¤¬¶õ¤Ë¤Ê¤ëÁ°¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë +(¥­¥å¡¼¤«¤é¤Î¥á¥Ã¥»¡¼¥¸Æɤ߽Ф·¤ò¥­¥å¡¼¤¬¶õ¤Ë¤Ê¤Ã¤¿»þ¤Ë +Ää»ß (block) ¤»¤º¤Ë¹Ô¤¦¤Ë¤Ï¡¢¥­¥å¡¼¤òÈóÄä»ß¥â¡¼¥É (non-blocking mode) +¤ËÀßÄꤷ¤Æ¤ª¤¯¤È¤è¤¤)¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR mq_notify () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I mqdes +¤Ë»ØÄꤵ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EBUSY +ÊÌ¤Î¥×¥í¥»¥¹¤¬¤¹¤Ç¤Ë +¤³¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ËÂФ¹¤ëÄÌÃΤò¼õ¿®¤¹¤ë¤è¤¦¤ËÅÐÏ¿¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I notification\->sigev_notify +¤¬µö²Ä¤µ¤ì¤¿ÃͤΤ¤¤º¤ì¤Ç¤â¤Ê¤¤¡£¤â¤·¤¯¤Ï +.I notification\->sigev_notify +¤¬ +.B SIGEV_SIGNAL +¤À¤¬ +.I notification\->sigev_signo +¤¬Í­¸ú¤Ê¥·¥°¥Ê¥ëÈÖ¹æ¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ENOMEM +ɬÍפʥá¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.PP +POSIX.1-2008 ¤Ç¤Ï¡¢ +.I notifications +¤¬ NULL ¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¥­¥å¡¼ +.I mqdes +¤Ë´Ø¤¹¤ëÄÌÃΤò¼õ¿®¤¹¤ë¤è¤¦¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥¨¥é¡¼ +.B EINVAL +¤òÀ¸À®¤¹¤ë¤è¤¦¤Ê¼ÂÁõ¤ò¹Ô¤Ã¤Æ¤â¡Ö¤è¤¤¡×¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" Linux ¤Î¼ÂÁõ¤Ç¤Ï EINVAL ¤ÏÀ¸À®¤µ¤ì¤Ê¤¤ +.SH ½àµò +POSIX.1-2001. +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿Ì¾Á°¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ø¤Î +ÄÌÃÎÍ×µá¤òÅÐÏ¿¤·¡¢ÄÌÃΤϥ¹¥ì¥Ã¥É¤ÎºîÀ®¤Ë¤è¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +¤½¤Î¥¹¥ì¥Ã¥É¤Ï¡¢¤½¤Î¥­¥å¡¼¤«¤é¥á¥Ã¥»¡¼¥¸¤ò°ì¤ÄÆɤ߽Ф·¤Æ¤«¤é¡¢ +¥×¥í¥»¥¹¤ò½ªÎ»¤¹¤ë´Ø¿ô¤ò¼Â¹Ô¤¹¤ë¡£ +.nf + +#include +#include +#include +#include +#include + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +static void /* ¥¹¥ì¥Ã¥É³«»Ï´Ø¿ô */ +tfunc(union sigval sv) +{ + struct mq_attr attr; + ssize_t nr; + void *buf; + mqd_t mqdes = *((mqd_t *) sv.sival_ptr); + + /* ºÇÂç¥á¥Ã¥»¡¼¥¸¥µ¥¤¥º¤ò·èÄꤷ¡¢ + ¥á¥Ã¥»¡¼¥¸¼õ¿®ÍѤΥХåե¡¤ò³ÎÊݤ¹¤ë */ + + if (mq_getattr(mqdes, &attr) == \-1) + handle_error("mq_getattr"); + buf = malloc(attr.mq_msgsize); + if (buf == NULL) + handle_error("malloc"); + + nr = mq_receive(mqdes, buf, attr.mq_msgsize, NULL); + if (nr == \-1) + handle_error("mq_receive"); + + printf("Read %ld bytes from MQ\\n", (long) nr); + free(buf); + exit(EXIT_SUCCESS); /* ¥×¥í¥»¥¹¤ò½ªÎ»¤¹¤ë */ +} + +int +main(int argc, char *argv[]) +{ + mqd_t mqdes; + struct sigevent not; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \\n", argv[0]); + exit(EXIT_FAILURE); + } + + mqdes = mq_open(argv[1], O_RDONLY); + if (mqdes == (mqd_t) \-1) + handle_error("mq_open"); + + not.sigev_notify = SIGEV_THREAD; + not.sigev_notify_function = tfunc; + not.sigev_notify_attributes = NULL; + not.sigev_value.sival_ptr = &mqdes; /* ¥¹¥ì¥Ã¥É´Ø¿ô¤ËÅϤ¹°ú¤­¿ô */ + if (mq_notify(mqdes, ¬) == \-1) + handle_error("mq_notify"); + + pause(); /* ¥×¥í¥»¥¹¤Ï¥¹¥ì¥Ã¥É´Ø¿ô¤Ë¤è¤ê½ªÎ»¤µ¤ì¤ë */ +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR mq_overview (7) diff --git a/release/man3/mq_open.3 b/release/man3/mq_open.3 new file mode 100644 index 00000000..f48d4753 --- /dev/null +++ b/release/man3/mq_open.3 @@ -0,0 +1,232 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-23, Akihiro MOTOKI +.\" +.TH MQ_OPEN 3 2009-02-20 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mq_open \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ò¥ª¡¼¥×¥ó¤¹¤ë +.SH ½ñ¼° +.nf +.BR "#include " " /* For O_* constants */" +.BR "#include " " /* For mode constants */" +.B #include +.sp +.BI "mqd_t mq_open(const char *" name ", int " oflag ); +.BI "mqd_t mq_open(const char *" name ", int " oflag ", mode_t " mode , +.BI " struct mq_attr *" attr ); +.fi +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR mq_open () +¤Ï¡¢¿·¤·¤¤ POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òºîÀ®¤¹¤ë¤«¡¢´û¸¤Î¥­¥å¡¼¤ò +¥ª¡¼¥×¥ó¤¹¤ë¡£¥­¥å¡¼¤Ï +.I name +¤Ç¼±Ê̤µ¤ì¤ë¡£ +.I name +¤Î¹½À®¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.B mq_overview (7) +¤ò»²¾È¡£ + +.I oflag +°ú¤­¿ô¤Ë¤Ï¡¢´Ø¿ô¸Æ¤Ó½Ð¤·¤ÎÁàºî¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°¤ò»ØÄꤹ¤ë +(oflag ¤ÎÃͤÎÄêµÁ¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ë¤è¤êÆÀ¤é¤ì¤ë)¡£ +.I oflag +¤Ë¤Ï¡¢°Ê²¼¤Î¤¦¤Á¤¤¤º¤ì¤«°ì¤Ä¤òɬ¤º»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B O_RDONLY +¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®ÀìÍѤȤ·¤Æ¥­¥å¡¼¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +.TP +.B O_WRONLY +¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®ÀìÍѤȤ·¤Æ¥­¥å¡¼¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +.TP +.B O_RDWR +¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¼õ¿®Î¾ÍѤȤ·¤Æ¥­¥å¡¼¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +.PP +0 ¸Ä°Ê¾å¤Î²¼µ­¤Î¥Õ¥é¥°¤ò¡¢¥Ó¥Ã¥Èñ°Ì¤Î OR (ÏÀÍýÏÂ) ¤Ç +.I oflag +¤ËÄɲäǻØÄê¤Ç¤­¤ë¡£ +.TP +.B O_NONBLOCK +ÈóÄä»ß (nonblocking) ¥â¡¼¥É¤Ç¥­¥å¡¼¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +.BR mq_receive (3) +¤È +.BR mq_send (3) +¤Ï¡¢Ä̾ï¤ÏÄä»ß (block) ¤¹¤ë¾õ¶·¤Ë¤ª¤¤¤Æ¡¢¥¨¥é¡¼ +.B EAGAIN +¤Ç¼ºÇÔ¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.TP +.B O_CREAT +¸ºß¤·¤Ê¤¤¾ì¹ç¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òºîÀ®¤¹¤ë¡£ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î½êÍ­¼Ô (¥æ¡¼¥¶ ID) ¤È¥°¥ë¡¼¥×½êÍ­¸¢ (¥°¥ë¡¼¥× ID) ¤Ï¡¢ +¤½¤ì¤¾¤ì¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤È¼Â¸ú¥°¥ë¡¼¥× ID ¤ËÀßÄꤵ¤ì¤ë¡£ +.\" ¼ÂºÝ¤Ï¡¢Linux ¤Ç¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID ¤¬»ÈÍѤµ¤ì¤ë¡£ +.TP +.B O_EXCL +.B O_CREAT +¤¬ +.I oflag +¤Ë»ØÄꤵ¤ì¡¢¤«¤Ä»ØÄꤵ¤ì¤¿Ì¾Á° +.I name +¤ò»ý¤Ä¥­¥å¡¼¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢¥¨¥é¡¼ +.B EEXIST +¤Ç¼ºÇÔ¤¹¤ë¡£ +.PP +.I oflag +¤Ë +.B O_CREAT +¤ò»ØÄꤹ¤ë¾ì¹ç¡¢ÄÉ²Ã¤Ç 2¤Ä¤Î°ú¤­¿ô¤òÍ¿¤¨¤ëɬÍפ¬¤¢¤ë¡£ +.I mode +°ú¤­¿ô¤Ï¡¢¿·¤·¤¤¥­¥å¡¼¤ËŬÍѤµ¤ì¤ëµö²ÄÀßÄê (permission) ¤ò¡¢ +.BR open (2) +¤ÈƱ¤¸¤è¤¦¤Ë»ØÄꤹ¤ë +(µö²Ä¥Ó¥Ã¥È¤Î¥·¥ó¥Ü¥ëÄêµÁ¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ë¤è¤êÆÀ¤é¤ì¤ë)¡£ +µö²ÄÀßÄê¤Ï¥×¥í¥»¥¹¤Î umask ¤Ç¥Þ¥¹¥¯¤µ¤ì¤ë¡£ +.I attr +°ú¤­¿ô¤Ï¡¢¥­¥å¡¼¤Î°À­¤ò»ØÄꤹ¤ë¡£¾ÜºÙ¤Ï¡¢ +.BR mq_getattr (3) +¤ò»²¾È¡£ +.I attr +¤¬ NULL ¤Î¾ì¹ç¡¢¥­¥å¡¼¤Ï¼ÂÁõ¤ÇÄêµÁ¤µ¤ì¤¿¥Ç¥Õ¥©¥ë¥È°À­¤ÇºîÀ®¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR mq_open () +¤Ï¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò (message queue descriptor) ¤òÊÖ¤¹¡£ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò¤Ï¾¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼´ØÏ¢¤Î´Ø¿ô¤Ç»ÈÍѤµ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR mq_open () +¤Ï +.I "(mqd_t)\ \-1" +¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¥­¥å¡¼¤Ï¸ºß¤¹¤ë¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¤¬»ØÄꤵ¤ì¤¿¥â¡¼¥É¤Ç¤½¤Î¥­¥å¡¼ +¤ò¥ª¡¼¥×¥ó¤¹¤ëµö²Ä¤ò»ý¤¿¤Ê¤¤¡£ +.TP +.B EACCES +.I name +¤Ë¥¹¥é¥Ã¥·¥å¤¬ 2 ¸Ä°Ê¾å´Þ¤Þ¤ì¤Æ¤¤¤¿¡£ +.\" Note that this isn't consistent with the same case for sem_open() +.TP +.B EEXIST +.I oflag +¤Ë +.B O_CREAT +¤È +.B O_EXCL +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¤¬¡¢»ØÄꤵ¤ì¤¿Ì¾Á° +.I name +¤ò»ý¤Ä¥­¥å¡¼¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¡£ +.TP +.B EINVAL +.I oflag +¤Ë +.B O_CREAT +¤¬»ØÄꤵ¤ì¡¢¤«¤Ä +.I attr +¤¬ NULL °Ê³°¤À¤¬¡¢ +.I attr\->mq_maxmsg +¤« +.I attr\->mq_msqsize +¤¬ÉÔÀµ¤Ç¤¢¤Ã¤¿¡£ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤ÏξÊý¤È¤â 0 ¤è¤êÂ礭¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥×¥í¥»¥¹¤¬Æø¢¤ò»ý¤¿¤Ê¤¤ +.RB ( CAP_SYS_RESOURCE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤) ¾ì¹ç¡¢ +.I attr\->mq_maxmsg +¤È +.I attr\->mq_msgsize +¤Ï¡¢¤½¤ì¤¾¤ì¾å¸Â +.IR msg_max ¡¢ +.I msgsize_max +°Ê²¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤Þ¤¿¡¢Æø¢¥×¥í¥»¥¹¤Î¾ì¹ç¤Ç¤â¡¢ +.I attr\->mq_maxmsg +¤Ï +.B HARD_MAX +¾å¸Â¤òĶ¤¨¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +(¤³¤ì¤é¤Î¾å¸Â¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï +.BR mq_overview (7) +¤ò»²¾È¡£) +.TP +.B EMFILE +¤½¤Î¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤È¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¿ô¤¬ +¥×¥í¥»¥¹Ëè¤Î¾å¸Â¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENAMETOOLONG +.I name +¤¬Ä¹¤¹¤®¤ë¡£ +.TP +.B ENFILE +¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤È¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¹ç·×¿ô¤¬ +¥·¥¹¥Æ¥à¾å¸Â¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENOENT +.B O_CREAT +¥Õ¥é¥°¤¬ +.I oflag +¤Ë»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¤¬¡¢»ØÄꤵ¤ì¤¿Ì¾Á° +.I name +¤ò»ý¤Ä¥­¥å¡¼¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOENT +.I name +¤¬ "/" ¤À¤±¤Ç¡¢¤½¤Î¸å¤í¤Ë¾¤Îʸ»ú¤¬Â³¤¤¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.\" Note that this isn't consistent with the same case for sem_open() +.TP +.B ENOMEM +½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOSPC +¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òºîÀ®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¶õ´Ö¤¬¤Ê¤¤¡£ +¤³¤Î¥¨¥é¡¼¤Ï¤ª¤½¤é¤¯ +.I queues_max +¾å¸Â¤ËÄñ¿¨¤·¤¿¤¿¤áµ¯¤³¤Ã¤¿¤Î¤À¤í¤¦¡£ +.BR mq_overview (7) +¤ò»²¾È¡£ +.SH ½àµò +POSIX.1-2001. +.SH ¥Ð¥° +2.6.14 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¡¢ +¥×¥í¥»¥¹¤Î umask ¤¬ +.I mode +¤Ç»ØÄꤵ¤ì¤¿µö²ÄÀßÄê¤ËŬÍѤµ¤ì¤Ê¤«¤Ã¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR mq_overview (7) diff --git a/release/man3/mq_receive.3 b/release/man3/mq_receive.3 new file mode 100644 index 00000000..eb73aa44 --- /dev/null +++ b/release/man3/mq_receive.3 @@ -0,0 +1,173 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-23, Akihiro MOTOKI +.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" +.TH MQ_RECEIVE 3 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mq_receive, mq_timedreceive \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤«¤é¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "ssize_t mq_receive(mqd_t " mqdes ", char *" msg_ptr , +.BI " size_t " msg_len ", unsigned *" msg_prio ); +.sp +.B #define _XOPEN_SOURCE 600 +.B #include +.B #include +.sp +.BI "ssize_t mq_timedreceive(mqd_t " mqdes ", char *" msg_ptr , +.BI " size_t " msg_len ", unsigned *" msg_prio , +.BI " const struct timespec *" abs_timeout ); +.fi +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR mq_receive () +¤Ï¡¢µ­½Ò»Ò +.I mqdes +¤Ç»²¾È¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤«¤éºÇ¤â¹â¤¤Í¥ÀèÅÙ¤ò»ý¤Ä +ºÇ¤â¸Å¤¤¥á¥Ã¥»¡¼¥¸¤òºï½ü¤·¡¢¤½¤Î¥á¥Ã¥»¡¼¥¸¤ò +.I msg_ptr +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤¹¤ë¡£ +.I msg_len +°ú¤­¿ô¤Ï¡¢ +.I msg_ptr +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤ò¼¨¤¹¡£¤³¤ÎÃͤϥ­¥å¡¼¤Î +.I mq_msgsize +°À­¤è¤ê¤âÂ礭¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.RB ( mq_getattr (3) +»²¾È)¡£ +.I prio +¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢ +.I prio +¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë¼õ¿®¤·¤¿¥á¥Ã¥»¡¼¥¸¤ÎÍ¥ÀèÅÙ¤¬³ÊǼ¤µ¤ì¤ë¡£ + +¥­¥å¡¼¤¬¶õ¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR mq_receive () +¤Ï¡¢¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¤¬ÆϤ¯¤«¡¢´Ø¿ô¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê +ÃæÃǤµ¤ì¤ë¤Þ¤Ç¡¢Ää»ß (block) ¤¹¤ë¡£ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò (message queue description) ¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.BR mq_receive () +¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¤¹¤°¤Ë¼ºÇÔ¤¹¤ë¡£ + +.BR mq_timedreceive () +¤Ï +.BR mq_receive () +¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë¤¬¡¢ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬¶õ¤Ç¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤¬Ää»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤ò +.I abs_timeout +¤¬»Ø¤¹¹½Â¤ÂΤǻØÄꤹ¤ëÅÀ¤¬°Û¤Ê¤ë¡£¤³¤Î¾å¸Â¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥È¤Î»þ¹ï¤ò¡¢ +»þ¹ïµª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤Î·Ð²á»þ´Ö +(ÉäȥʥÎÉäÎÁÈ) ¤Ç»ØÄꤹ¤ë¡£¥¿¥¤¥à¥¢¥¦¥È»þ¹ï¤Ï°Ê²¼¤Î¹½Â¤ÂΤǻØÄꤹ¤ë: +.sp +.in +4n +.nf +struct timespec { + time_t tv_sec; /* Éà */ + long tv_nsec; /* ¥Ê¥ÎÉà */ +}; + +.fi +.in +¥á¥Ã¥»¡¼¥¸¤¬¥­¥å¡¼¤Ë¤Ê¤¯¡¢´Ø¿ô¸Æ¤Ó½Ð¤·»þ¤Ë¤¹¤Ç¤Ë¥¿¥¤¥à¥¢¥¦¥È»þ¹ï¤¬ +²á¤®¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR mq_timedreceive () +¤Ï¤¹¤°¤ËÊ֤롣 +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR mq_receive () +¤È +.BR mq_timedreceive () +¤Ï¼õ¿®¤·¤¿¥á¥Ã¥»¡¼¥¸¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +¥­¥å¡¼¤¬¶õ¤Ç¡¢¤«¤Ä +.I mqdes +¤Ç»²¾È¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¡£ +.TP +.B EBADF +.I mqdes +¤Ç»ØÄꤵ¤ì¤¿µ­½Ò»Ò¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EINTR +´Ø¿ô¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤êÃæÃǤµ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +´Ø¿ô¸Æ¤Ó½Ð¤·¤ÏÄä»ß¤¹¤ë¤Ï¤º¤Ç¤¢¤Ã¤¿¤¬¡¢ +.I abs_timeout +¤¬ÉÔÀµ¤Ç¤¢¤Ã¤¿¡£ +.I abs_timeout +¤¬ÉÔÀµ¤È¤Ï¡¢ +.I tv_sec +¤¬ 0 ̤Ëþ¡¢¤â¤·¤¯¤Ï +.I tv_nsec +¤¬ 0 ̤Ëþ¤« 1,000,000,000 ¤è¤êÂ礭¤¤¡¢¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.TP +.B EMSGSIZE +.I msg_len +¤¬¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î +.I mq_msgsize +°À­¤è¤ê¤â¾®¤µ¤«¤Ã¤¿¡£ +.TP +.B ETIMEDOUT +¥á¥Ã¥»¡¼¥¸¤¬Å¾Á÷¤µ¤ì¤ëÁ°¤Ë´Ø¿ô¸Æ¤Ó½Ð¤·¤¬¥¿¥¤¥à¥¢¥¦¥È¤·¤¿¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +Linux ¤Ç¤Ï¡¢ +.BR mq_timedreceive () +¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£ +.BR mq_receive () +¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¡¢ +.BR mq_timedreceive () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR feature_test_macros (7), +.BR mq_overview (7), +.BR time (7) diff --git a/release/man3/mq_send.3 b/release/man3/mq_send.3 new file mode 100644 index 00000000..ffd6350c --- /dev/null +++ b/release/man3/mq_send.3 @@ -0,0 +1,175 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-23, Akihiro MOTOKI +.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" +.TH MQ_SEND 3 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mq_send, mq_timedsend \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ë¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "mqd_t mq_send(mqd_t " mqdes ", const char *" msg_ptr , +.BI " size_t " msg_len ", unsigned " msg_prio ); +.sp +.B #define _XOPEN_SOURCE 600 +.B #include +.B #include +.sp +.BI "mqd_t mq_timedsend(mqd_t " mqdes ", const char *" msg_ptr , +.BI " size_t " msg_len ", unsigned " msg_prio , +.BI " const struct timespec *" abs_timeout ); +.fi +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR mq_send () +¤Ï¡¢µ­½Ò»Ò +.I mqdes +¤Ç»²¾È¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ë +.I msg_ptr +¤¬»Ø¤¹¥á¥Ã¥»¡¼¥¸¤òÄɲ乤롣 +.I msg_len +°ú¤­¿ô¤Ï¡¢ +.I msg_ptr +¤¬»Ø¤¹¥á¥Ã¥»¡¼¥¸¤ÎŤµ¤ò¼¨¤¹¡£¤³¤ÎŤµ¤Ï¥­¥å¡¼¤Î +.I mq_msgsize +°À­°Ê²¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Ťµ¤¬ 0 ¤Î¥á¥Ã¥»¡¼¥¸¤âǧ¤á¤é¤ì¤Æ¤¤¤ë¡£ + +.I msg_prio +°ú¤­¿ô¤Ï¡¢¥á¥Ã¥»¡¼¥¸¤ÎÍ¥ÀèÅÙ¤ò»ØÄꤹ¤ëÉé¤Ç¤Ê¤¤À°¿ô¤Ç¤¢¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤ÏÍ¥ÀèÅ٤ι߽ç¤Ç¥­¥å¡¼¤Ë³ÊǼ¤µ¤ì¡¢Æ±¤¸Í¥ÀèÅ٤ο·¤·¤¤¥á¥Ã¥»¡¼¥¸¤Ï +Ʊ¤¸Í¥ÀèÅ٤θŤ¤¥á¥Ã¥»¡¼¥¸¤Î¸å¤í¤Ë³ÊǼ¤µ¤ì¤ë¡£ + +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬¤¹¤Ç¤Ë°ìÇդξì¹ç +(¤¹¤Ê¤ï¤Á¡¢¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¿ô¤¬¥­¥å¡¼¤Î +.I mq_maxmsg +°À­¤ÈÅù¤·¤¤¾ì¹ç)¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.B mq_send () +¤Ï¡¢¥á¥Ã¥»¡¼¥¸¤ò¥­¥å¡¼¥¤¥ó¥°¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¶õ´Ö¤¬¤Ç¤­¤ë¤«¡¢ +´Ø¿ô¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤êÃæÃǤµ¤ì¤ë¤Þ¤Ç¡¢Ää»ß (block) ¤¹¤ë¡£ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò (message queue description) ¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.BR mq_send () +¤Ï¥¨¥é¡¼ +.B EAGAIN +¤Ç¤¹¤°¤Ë¼ºÇÔ¤¹¤ë¡£ + +.BR mq_timedsend () +¤Ï +.BR mq_send () +¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë¤¬¡¢ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬°ìÇդǡ¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤¬Ää»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤ò +.I abs_timeout +¤¬»Ø¤¹¹½Â¤ÂΤǻØÄꤹ¤ëÅÀ¤¬°Û¤Ê¤ë¡£¤³¤Î¾å¸Â¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥È¤Î»þ¹ï¤ò +»þ¹ïµª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤Î·Ð²á»þ´Ö +(ÉäȥʥÎÉäÎÁÈ) ¤Ç»ØÄꤹ¤ë¡£¥¿¥¤¥à¥¢¥¦¥È»þ¹ï¤Ï°Ê²¼¤Î¹½Â¤ÂΤǻØÄꤹ¤ë: +.sp +.in +4n +.nf +struct timespec { + time_t tv_sec; /* Éà */ + long tv_nsec; /* ¥Ê¥ÎÉà */ +}; + +.fi +.in +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬°ìÇդǡ¢´Ø¿ô¸Æ¤Ó½Ð¤·»þ¤Ë¤¹¤Ç¤Ë¥¿¥¤¥à¥¢¥¦¥È»þ¹ï¤¬ +²á¤®¤Æ¤¤¤ë¾ì¹ç¡¢ +.BR mq_timedsend () +¤Ï¤¹¤°¤ËÊ֤롣 +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR mq_send () +¤È +.BR mq_timedsend () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +¥­¥å¡¼¤¬°ìÇդǡ¢¤«¤Ä +.I mqdes +¤Ç»²¾È¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò¤Ç +.B O_NONBLOCK +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¡£ +.TP +.B EBADF +.I mqdes +¤Ç»ØÄꤵ¤ì¤¿µ­½Ò»Ò¤¬ÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.B EINTR +´Ø¿ô¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤êÃæÃǤµ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +´Ø¿ô¸Æ¤Ó½Ð¤·¤ÏÄä»ß¤¹¤ë¤Ï¤º¤Ç¤¢¤Ã¤¿¤¬¡¢ +.I abs_timeout +¤¬ÉÔÀµ¤Ç¤¢¤Ã¤¿¡£ +.I abs_timeout +¤¬ÉÔÀµ¤È¤Ï¡¢ +.I tv_sec +¤¬ 0 ̤Ëþ¡¢¤â¤·¤¯¤Ï +.I tv_nsec +¤¬ 0 ̤Ëþ¤« 1,000,000,000 ¤è¤êÂ礭¤¤¡¢¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.TP +.B EMSGSIZE +.I msg_len +¤¬¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î +.I mq_msgsize +°À­¤è¤ê¤âÂ礭¤«¤Ã¤¿¡£ +.TP +.B ETIMEDOUT +¥á¥Ã¥»¡¼¥¸¤¬Å¾Á÷¤µ¤ì¤ëÁ°¤Ë´Ø¿ô¸Æ¤Ó½Ð¤·¤¬¥¿¥¤¥à¥¢¥¦¥È¤·¤¿¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +Linux ¤Ç¤Ï¡¢ +.BR mq_timedsend () +¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£ +.BR mq_send () +¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¡¢ +.BR mq_timedsend () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_unlink (3), +.BR feature_test_macros (7), +.BR mq_overview (7), +.BR time (7) diff --git a/release/man3/mq_unlink.3 b/release/man3/mq_unlink.3 new file mode 100644 index 00000000..6124a7b7 --- /dev/null +++ b/release/man3/mq_unlink.3 @@ -0,0 +1,77 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-23, Akihiro MOTOKI +.\" +.TH MQ_UNLINK 3 2006-02-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mq_unlink \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òºï½ü¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "mqd_t mq_unlink(const char *" name ); +.fi +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR mq_unlink () +¤Ï»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¥­¥å¡¼ +.I name +¤òºï½ü¤¹¤ë¡£ +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼Ì¾¤Ïľ¤Á¤Ëºï½ü¤µ¤ì¤ë¡£ +¥­¥å¡¼¼«ÂΤϡ¢¤½¤Î¥­¥å¡¼¤ò¥ª¡¼¥×¥ó¤·¤¿Â¾¤Î¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤¬ +¤½¤Î¥­¥å¡¼¤ò»²¾È¤¹¤ëµ­½Ò»Ò¤ò¥¯¥í¡¼¥º¤·¤¿»þÅÀ¤ÇÇË´þ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR mq_unlink () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¤³¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òºï½ü (unlink) ¤¹¤ë +µö²Ä¤ò»ý¤¿¤Ê¤¤¡£ +.TP +.B ENAMETOOLONG +.I name +¤¬Ä¹²á¤®¤ë¡£ +.TP +.B ENOENT +»ØÄꤵ¤ì¤¿Ì¾Á° +.I name +¤ò»ý¤Ä¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬Â¸ºß¤·¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_overview (7) diff --git a/release/man3/mtrace.3 b/release/man3/mtrace.3 new file mode 100644 index 00000000..4a5b944b --- /dev/null +++ b/release/man3/mtrace.3 @@ -0,0 +1,50 @@ +.\" 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" +.SH ̾Á° +mtrace, muntrace \- malloc debugging +.SH ½ñ¼° +.B "#include " +.sp +.B "void mtrace(void);" +.sp +.B "void muntrace(void);" +.SH ÀâÌÀ +´Ø¿ô +.BR mtrace () +¤Ï¡¢ +.BR malloc (3), +.BR realloc (3), +.BR free (3) +¤Î¥Ï¥ó¥É¥é¤òÁȤ߹þ¤à¡£ +´Ø¿ô +.BR muntrace () +¤Ï¤³¤ì¤é¤Î¥Ï¥ó¥É¥é¤ò²ò½ü¤¹¤ë¡£ +.br +´Ä¶­ÊÑ¿ô +.B MALLOC_TRACE +¤Ï +.BR mtrace () +¤¬½ÐÎϤò½ñ¤­½Ð¤¹¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¡£ +¥æ¡¼¥¶¤¬½ñ¤­¹þ¤ß¸¢¸Â¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +½ñ¤­¹þ¤ß¸¢¸Â¤¬¤Ê¤¤¾ì¹ç¡¢ +.BR mtrace () +¤Ï²¿¤â¤·¤Ê¤¤¡£ +.\" motoki: truncate ¤Ã¤Æ¡Ö¸å¤í¤òÀڤäƤ·¤Þ¤¦¡×¤è¤¦¤Ê°ÕÌ£¤Î¤Ï¤º¤À¤±¤É +.\" motoki: ¼ÂºÝ¤Ë»î¤·¤Æ¤ß¤ë¤È¡¢¸µ¤Î¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤­¤¹¤ë¤è¤¦¤Ç¤¹¡¦¡¦¡¦ +¥Õ¥¡¥¤¥ë¤¬¶õ¤Ç¤Ê¤¤¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤Î¸µ¤ÎÆâÍƤò¾å½ñ¤­¤¹¤ë¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR mtrace () +¤Î½ÐÎÏ¤Ï ASCII ·Á¼°¤À¤¬¡¢¿Í¤¬Æɤߤ䤹¤¤¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£ +¤½¤³¤Ç¡¢glibc ¤Ë¤Ï mtrace ½ÐÎϤòʬ¤«¤ê¤ä¤¹¤¤·Á¼°¤ËÊÑ´¹¤¹¤ë +perl ¥¹¥¯¥ê¥×¥È¤¬ÉÕ°¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR malloc (3), +.BR malloc_hook (3) diff --git a/release/man3/nan.3 b/release/man3/nan.3 new file mode 100644 index 00000000..5fc521e6 --- /dev/null +++ b/release/man3/nan.3 @@ -0,0 +1,81 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" 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 +.\" +.\"WORD: NaN ̵¸úÃÍ +.\"WORD: quiet NaN SIGFPE ¥·¥°¥Ê¥ë¤Ê¤·¤Î̵¸úÃÍ +.\" +.TH NAN 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +nan, nanf, nanl \- ̵¸úÃÍ ('Not a Number') ¤òÊÖ¤¹ +.SH ½ñ¼° +.B #include +.sp +.BI "double nan(const char *" tagp ); +.br +.BI "float nanf(const char *" tagp ); +.br +.BI "long double nanl(const char *" tagp ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR nan (), +.BR nanf (), +.BR nanl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.SH ÀâÌÀ +.\" motoki: quiet NaN ¤È¤Ï²¿¤À¤í¤¦¡© +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢SIGFPE ¥·¥°¥Ê¥ë¤Ê¤·¤Î̵¸úÃÍ (NaN) ¤ò¼¨¤¹É½¸½¤òÊÖ¤¹ +(¤É¤Îɽ¸½¤ò»ÈÍѤ¹¤ë¤«¤Ï +.I tagp +¤Ç»ØÄꤹ¤ë)¡£SIGFPE ¥·¥°¥Ê¥ë¤Ê¤·¤Î NaN ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¼ÂÁõ¤Ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.I nan("char-sequence") +¤ò¸Æ¤Ó½Ð¤¹¤Î¤Ï¡¢ +.nf + + strtod("NAN(char-sequence)", NULL); + +.fi +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.PP +ƱÍͤˡ¢ +.BR nanf () +¤ä +.BR nanl () +¤ò¸Æ¤Ó½Ð¤¹¤Î¤Ï¡¢ +.BR strtof () +¤ä +.BR strtold () +¤ò¸Æ¤Ö¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.PP +°ú¤­¿ô +.I tagp +¤Î»È¤¤Êý¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +IEEE 754 ½àµò¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢NaN ¤Ë¤âÊ£¿ô¤Îɽ¸½¤¬Â¸ºß¤·¡¢ +.I tagp +¤Ï¤½¤ÎÁªÂò¤Ë»ÈÍѤµ¤ì¤ë¡£ +¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢²¿¤Î°ÕÌ£¤â¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +IEC 559 ¤ä¿ä¾©´Ø¿ô¤Ë¤Ê¤Ã¤Æ¤¤¤ë IEEE 754/IEEE 854 +¤ÎÉÕÏ¿¤â»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR isnan (3), +.BR strtod (3), +.BR math_error (7) diff --git a/release/man3/netlink.3 b/release/man3/netlink.3 new file mode 100644 index 00000000..8c8bd9f4 --- /dev/null +++ b/release/man3/netlink.3 @@ -0,0 +1,100 @@ +.\" 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 $ +.\" +.\" 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 +.\" +.\"WORD: payload ³ÊǼÎΰè +.\"WORD: lvalue º¸ÊÕÃÍ +.\" +.TH NETLINK 3 1999-05-14 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +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 +.br +.B #include +.sp +.BI "int NLMSG_ALIGN(size_t " len ); +.br +.BI "int NLMSG_LENGTH(size_t " len ); +.br +.BI "int NLMSG_SPACE(size_t " len ); +.br +.BI "void *NLMSG_DATA(struct nlmsghdr *" nlh ); +.br +.BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len ); +.br +.BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len ); +.br +.BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len ); +.fi +.SH ÀâÌÀ +.I +¤Ç¤Ï¡¢ netlink ¥Ç¡¼¥¿¥°¥é¥à¤Ë¥¢¥¯¥»¥¹¤·¤¿¤ê¡¢¤³¤ì¤òºîÀ®¤¹¤ë¤¿¤á¤Î +ɸ½à¥Þ¥¯¥í¤¬¤¤¤¯¤Ä¤«ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Ï +.BR cmsg (3) +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÊä½õ¥Ç¡¼¥¿ (auxiliary data) ÍѤΥޥ¯¥í¤È¡¢ +¤½¤ÎÀº¿À¤Ë¤ª¤¤¤Æ»÷¤Æ¤¤¤ë¤â¤Î¤Ç¤¢¤ë¡£ +netlink ¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤ä¤ê¤È¤ê¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¡¢ +ɬ¤º¤³¤ì¤é¤Î¥Þ¥¯¥í¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B NLMSG_ALIGN +netlink ¥á¥Ã¥»¡¼¥¸¤ÎŤµ¤ò´Ý¤á¤ÆÀµ¤·¤¯Â·¤¨¤ë¡£ +.TP +.B NLMSG_LENGTH +³ÊǼÎΰè (payload) ¤ÎŤµ +.I len +¤ò°ú¿ô¤Ë¤È¤ê¡¢ +.I nlmsghdr +¤Î +.I nlmsg_len +¥Õ¥£¡¼¥ë¥É¤ËÂåÆþ¤Ç¤­¤ë +·¤¨¤é¤ì¤¿Ä¹¤µ (aligned length) ¤òÊÖ¤¹¡£ +.TP +.B NLMSG_SPACE +¥Ú¥¤¥í¡¼¥É¤ÎŤµ¤¬ +.I len +¤Î netlink ¥á¥Ã¥»¡¼¥¸¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +.TP +.B NLMSG_DATA +Í¿¤¨¤¿ +.I nlmsghdr +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿³ÊǼÎΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.TP +.\" this is bizarre, maybe the interface should be fixed. +.B NLMSG_NEXT +¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸¤Ë¤ª¤¤¤Æ¡¢¼¡¤Î +.I nlmsghdr +¤òÆþ¼ê¤¹¤ë¡£¤³¤ì¤ò¸Æ¤Ó½Ð¤¹¤È¤­¤Ë¤Ï¡¢ +¸½ºß¤Î nlmsghdr ¤Ç NLMSG_DONE ¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò +³Îǧ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤Î´Ø¿ô¤Ï½ªÃ¼¤Ç NULL ¤òÊÖ¤µ¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.I len +°ú¿ô¤Ï¥á¥Ã¥»¡¼¥¸¥Ð¥Ã¥Õ¥¡¤Î»Ä¤êŤµ¤¬Æþ¤Ã¤¿º¸ÊÕÃͤǤ¢¤ë¡£ +¤³¤Î¥Þ¥¯¥í¤Ï¤³¤Î°ú¿ô¤«¤é¥á¥Ã¥»¡¼¥¸¥Ø¥Ã¥À¤ÎŤµÊ¬¤òº¹¤·°ú¤¯¡£ +.TP +.B NLMSG_OK +Netlink ¥á¥Ã¥»¡¼¥¸¤¬ÅÓÀÚ¤ì¤Æ¤ª¤é¤º¡¢¥Ñ¡¼¥º²Äǽ¤Ç¤¢¤ì¤Ð¿¿¤òÊÖ¤¹¡£ +.TP +.B NLMSG_PAYLOAD +.I nlmsghdr +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿³ÊǼÎΰè¤ÎŤµ¤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥Þ¥¯¥í¤ÏÈóɸ½à¤Ç Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +Ä̾ï¤Ï¥«¡¼¥Í¥ë¤ÎÄã¥ì¥Ù¥ë¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤è¤ê¤â¡¢ +.I libnetlink +·Ðͳ¤Ç netlink ¤òÍѤ¤¤ë¤Û¤¦¤¬Îɤ¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR netlink (7) +.br +¤ª¤è¤Ó libnetlink ¤Ë´Ø¤·¤Æ¤Ï ftp://ftp.inr.ac.ru/ip-routing/iproute2* diff --git a/release/man3/nextafter.3 b/release/man3/nextafter.3 new file mode 100644 index 00000000..80e5375c --- /dev/null +++ b/release/man3/nextafter.3 @@ -0,0 +1,151 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 +.\" +.\"WORD: mantissa ²¾¿ôÉô +.\"WORD: normalized Àµµ¬²½¤µ¤ì¤¿ +.\"WORD: subnormal ÈóÀµµ¬²½¤Î +.\" +.TH NEXTAFTER 3 2009-12-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \- +ÉâÆ°¾®¿ôÅÀ¿ô¤ÎÁàºî +.SH ½ñ¼° +.B #include +.sp +.BI "double nextafter(double " x ", double " y ); +.br +.BI "float nextafterf(float " x ", float " y ); +.br +.BI "long double nextafterl(long double " x ", long double " y ); +.sp +.BI "double nexttoward(double " x ", long double " y ); +.br +.BI "float nexttowardf(float " x ", long double " y ); +.br +.BI "long double nexttowardl(long double " x ", long double " y ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR nextafter (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR nextafterf (), +.BR nextafterl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR nexttoward (), +.BR nexttowardf (), +.BR nexttowardl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR nextafter () +´Ø¿ô·²¤Ï¡¢\fIy\fP ¤Ë¸þ¤«¤¦Êý¸þ¤Ç \fIx\fP ¤Î¤¹¤°¼¡¤ÎÉâÆ°¾®¿ôÅÀ¿ôɽ¸½¤òÊÖ¤¹¡£ +.I y +¤¬ +.I x +¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.I x +¤è¤ê¾®¤µ¤¤ºÇÂç¤ÎÉâÆ°¾®¿ôÅÀɽ¸½¤ÎÃͤòÊÖ¤¹¡£ + +\fIx\fP ¤¬ \fIy\fP ¤ÈÅù¤·¤¤¾ì¹ç¡¢\fIy\fP ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.BR nexttoward () +´Ø¿ô·²¤Ï¡¢2 ÈÖÌܤΰú¤­¿ô¤¬ +.I long double +·¿¤Ç¤¢¤ëÅÀ°Ê³°¡¢ +.BR nextafter () +´Ø¿ô·²¤ÈƱ¤¸¤Ï¤¿¤é¤­¤ò¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï \fIy\fP ¤Ë¸þ¤«¤¦Êý¸þ¤Ç \fIx\fP ¤Î +¤¹¤°¼¡¤ÎÉâÆ°¾®¿ôÅÀ¿ôɽ¸½¤òÊÖ¤¹¡£ + +.I x +¤¬ +.I y +¤ÈÅù¤·¤¤¾ì¹ç¡¢ +.RI ( x +¤ÈƱ¤¸·¿¤Ë¥­¥ã¥¹¥È¤µ¤ì¤¿) +.I y +¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤« +.I y +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Í­¸ÂÃÍ¤Ç +.\" e.g., DBL_MAX +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ +ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.BR HUGE_VAL , +.BR HUGE_VALF , +.B HUGE_VALL +¤òÊÖ¤¹¡£ÊÖ¤êÃͤˤϿô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£ + +.I x +¤¬ +.I y +¤ÈƱ¤¸¤Ç¤Ï¤Ê¤¯¡¢Àµ¤·¤¤´Ø¿ô¤Î·ë²Ì¤¬ÈóÀµµ¬²½¿ô¤«¥¼¥í¤«¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Î¾ì¹ç¡¢ +ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢ +(ɽ¸½²Äǽ¤Ê¾ì¹ç¤Ë¤Ï) Àµ¤·¤¤Ãͤ¬¡¢(¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï) 0.0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.\" e.g., nextafter(DBL_MAX, HUGE_VAL); +.\" .I errno +.\" is set to +.\" .BR ERANGE . +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤¬ÈóÀµµ¬²½¿ô¤«¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.\" e.g., nextafter(DBL_MIN, 0.0); +.\" .I errno +.\" is set to +.\" .BR ERANGE . +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.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 +.SH ½àµò +C99, POSIX.1-2001. +¤³¤Î´Ø¿ô¤Ï IEC 559 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +(¤Þ¤¿ IEEE 754/IEEE 854 ¤Ç¤ÏÉÕÏ¿¤Ç¿ä¾©´Ø¿ô¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë) +.SH ¥Ð¥° +glibc ¥Ð¡¼¥¸¥ç¥ó 2.5 °ÊÁ°¤Ç¤Ï¡¢¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¬È¯À¸¤·¤¿ºÝ¤Ë¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤ò¾å¤¬¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR nearbyint (3) diff --git a/release/man3/nl_langinfo.3 b/release/man3/nl_langinfo.3 new file mode 100644 index 00000000..1a4b835b --- /dev/null +++ b/release/man3/nl_langinfo.3 @@ -0,0 +1,123 @@ +.\" Copyright (c) 2001 Markus Kuhn +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 manual +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" Corrected prototype, 2002-10-18, aeb +.\" +.\" Japanese Version Copyright (c) 2001 +.\" UCHIDA Norihiro all rights reserved. +.\" Translated Sun Jul 15 2001 +.\" by UCHIDA Norihiro +.\" +.TH NL_LANGINFO 3 2001-05-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +nl_langinfo \- ¸À¸ì¤È¥í¥±¡¼¥ë¤Î¾ðÊó¤òÌ䤤¹ç¤ï¤»¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *nl_langinfo(nl_item " item ); +.fi +.SH ÀâÌÀ +.BR nl_langinfo () +´Ø¿ô¤Ï¡¢ +.BR localeconv (3) +¤è¤ê½ÀÆð¤Ê¥í¥±¡¼¥ë¾ðÊó¤Ø¤Î¥¢¥¯¥»¥¹ÊýË¡¤òÄ󶡤¹¤ë¡£ +¥í¥±¡¼¥ë¥«¥Æ¥´¥ê¤Î¸Ä¡¹¤ÎÍ×ÁǤäÄɲäÎÍ×ÁǤòÌ䤤¹ç¤ï¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +\fI\fP ¤ËÄê¿ô¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤Æ¡¢ +\fIitem\fP ¤Ë»ØÄê¤Ç¤­¤ë¥í¥±¡¼¥ëÍ×ÁǤÎÎã¤ò°Ê²¼¤Ë¼¨¤¹: +.TP +.BR CODESET \ (LC_CTYPE) +ÁªÂò¤µ¤ì¤¿¥í¥±¡¼¥ë¤ÇÍѤ¤¤é¤ì¤ëʸ»ú¥¨¥ó¥³¡¼¥É̾¤ò¼¨¤¹Ê¸»úÎó¤òÊÖ¤¹¡£ +ʸ»ú¥¨¥ó¥³¡¼¥É̾¤È¤·¤Æ¤Ï¡¢"UTF-8" ¤ä "ISO-8859-1"¡¢"ANSI_X3.4-1968" +(¤³¤ì¤Ï US-ASCII ¤È¤¤¤¦Ì¾Á°¤ÎÊý¤¬¤è¤¯ÃΤé¤ì¤Æ¤¤¤ë) ¤Ê¤É¤¬¤¢¤ë¡£ +¤³¤Îʸ»úÎó¤Ï¡¢"locale charmap" ¤ò¼Â¹Ô¤·¤ÆÆÀ¤é¤ì¤ë¤â¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +ʸ»ú¥¨¥ó¥³¡¼¥É̾¤Î¥ê¥¹¥È¤òÆÀ¤ë¤Ë¤Ï¡¢"locale \-m" ¤ò¼Â¹Ô¤¹¤ë¤È¤è¤¤¡£ +»²¹Í: +.BR locale (1) +.TP +.BR D_T_FMT \ (LC_TIME) +¥í¥±¡¼¥ë¸ÇÍ­¤Î»þ´Ö¤ÈÆüÉÕ¤òɽ¸½¤¹¤ë¤È¤­¤Ë¡¢ +.BR strftime (3) +¤Ç»ÈÍѤǤ­¤ë½ñ¼°ÉÕ¤­Ê¸»úÎó¤òÊÖ¤¹¡£ +.TP +.BR D_FMT \ (LC_TIME) +¥í¥±¡¼¥ë¸ÇÍ­¤ÎÆüÉÕ¤òɽ¸½¤¹¤ë¤È¤­¤Ë¡¢ +.BR strftime (3) +¤Ç»ÈÍѤǤ­¤ë½ñ¼°ÉÕ¤­Ê¸»úÎó¤òÊÖ¤¹¡£ +.TP +.BR T_FMT \ (LC_TIME) +¥í¥±¡¼¥ë¸ÇÍ­¤Î»þ´Ö¤òɽ¸½¤¹¤ë¤È¤­¤Ë¡¢ +.BR strftime (3) +¤Ç»ÈÍѤǤ­¤ë½ñ¼°ÉÕ¤­Ê¸»úÎó¤òÊÖ¤¹¡£ +.TP +.BR DAY_ "{1\(en7} (LC_TIME)" +ÍËÆü̾ (½µ¤Î \fIn\fP ÈÖÌܤÎÆü¤Î̾Á°) ¤òÊÖ¤¹¡£[·Ù¹ð: ¤³¤ÎÍ×ÁǤϥ¢¥á¥ê¥«¤Î +´·½¬¤Ë½¾¤Ã¤Æ DAY_1 ¤¬ ÆüÍËÆü¤È¤Ê¤ë¡£¹ñºÝŪ¤Ê´·½¬ (ISO 8601) ¤Ç¤Ï·îÍËÆü¤¬ +½µ¤ÎºÇ½é¤ÎÆü¤Ç¤¢¤ë¡£] +.TP +.BR ABDAY_ "{1\(en7} (LC_TIME)" +ÍËÆü (½µ¤Î \fIn\fP ÈÖÌܤÎÆü) ¤Î¾Êά̾¤òÊÖ¤¹¡£ +.TP +.BR MON_ "{1\(en12} (LC_TIME)" +\fIn\fP ÈÖÌܤηî¤Î̾Á°¤òÊÖ¤¹¡£ +.TP +.BR ABMON_ "{1\(en12} (LC_TIME)" +\fIn\fP ÈÖÌܤηî¤Î¾Êά̾¤òÊÖ¤¹¡£ +.TP +.BR RADIXCHAR \ (LC_NUMERIC) +´ð¿ôµ­¹æ (¾®¿ôÅÀ¤ä¥³¥ó¥Þ¤Ê¤É) ¤òÊÖ¤¹¡£ +.TP +.BR THOUSEP \ (LC_NUMERIC) +Àé¤Î°Ì (3 ·å¤Î¿ôÃÍ) ¤Î¶èÀÚ¤êʸ»ú¤òÊÖ¤¹¡£ +.TP +.BR YESEXPR \ (LC_MESSAGES) +yes/no ¤Î¼ÁÌä¤ËÂФ¹¤ë¹ÎÄê¤Î±þÅú¤òǧ¼±¤¹¤ë¤¿¤á¤Ë¡¢ +.BR regex (3) +´Ø¿ô¤Ç»ÈÍѤǤ­¤ëÀµµ¬É½¸½¤òÊÖ¤¹¡£ +.TP +.BR NOEXPR \ (LC_MESSAGES) +yes/no ¤Î¼ÁÌä¤ËÂФ¹¤ëÈÝÄê¤Î±þÅú¤òǧ¼±¤¹¤ë¤¿¤á¤Ë +.BR regex (3) +´Ø¿ô¤Ç»ÈÍѤǤ­¤ëÀµµ¬É½¸½¤òÊÖ¤¹¡£ +.TP +.BR CRNCYSTR \ (LC_MONETARY) +Ä̲ߵ­¹æ¤òÊÖ¤¹¡£ +µ­¹æ¤¬¿ôÃͤÎÁ°¤ËÇÛÃÖ¤µ¤ì¤ë¾ì¹ç¤Ï¡¢"\-" ¤¬Ä̲ߵ­¹æ¤ËÁ°ÃÖ¤µ¤ì¤ë¡£ +¿ôÃͤθå¤Ëµ­¹æ¤¬ÇÛÃÖ¤µ¤ì¤ë¾ì¹ç¤Ï "+" ¤¬¡¢ +µ­¹æ¤¬´ð¿ôʸ»ú¤ÈÃÖ¤­´¹¤ï¤ë¾ì¹ç¤Ï "." ¤¬Á°ÃÖ¤µ¤ì¤ë¡£ +.PP +¾åµ­¤Î¥ê¥¹¥È¤Ï¡¢Í×µá¤Ç¤­¤ëÄêµÁ¤Î¤´¤¯°ìÉô¤Ç¤¢¤ë¡£ +¾ÜºÙ¤Ê¥ê¥¹¥È¤Ï¡¢ +.I "GNU C ¥é¥¤¥Ö¥é¥ê¡¦¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë" +¤ò»²¾È¤·¤Æ¤Û¤·¤¤¡£ +.SH ÊÖ¤êÃÍ +ŬÀڤʥ«¥Æ¥´¥ê¤Î¥í¥±¡¼¥ë¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢ +.BR nl_langinfo () +¤Ï "C" ¥í¥±¡¼¥ë¤Î¤È¤­¤ËÁêÅö¤¹¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +̵¸ú¤Ê \fIitem\fP ¤Î¾ì¹ç¤Ï¡¢¶õʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +¤³¤Î¥Ý¥¤¥ó¥¿¤ÏÀÅŪ¤Ê¥Ç¡¼¥¿Îΰè¤ò»Ø¤·¡¢¤½¤ÎÆâÍƤϼ¡²ó¤Î +.BR nl_langinfo () +¤ä +.BR setlocale (3) +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ½ñ¤­Âؤï¤ë¤³¤È¤¬¤¢¤ë¡£ +.SH ½àµò +SUSv2, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR locale (1), +.BR localeconv (3), +.BR setlocale (3), +.BR charsets (7), +.BR locale (7) +.br +GNU C ¥é¥¤¥Ö¥é¥ê¡¦¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë diff --git a/release/man3/offsetof.3 b/release/man3/offsetof.3 new file mode 100644 index 00000000..c11efc44 --- /dev/null +++ b/release/man3/offsetof.3 @@ -0,0 +1,105 @@ +.\" Copyright (C) 2006 Justin Pryzby +.\" and Copyright (C) 2006 Michael Kerrisk +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" References: +.\" /usr/lib/gcc/i486-linux-gnu/4.1.1/include/stddef.h +.\" glibc-doc +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2006-07-25, Akihiro MOTOKI, Catch up to LDP v2.34 +.\" +.TH OFFSETOF 3 2008-07-12 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +offsetof \- ¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Î¥ª¥Õ¥»¥Ã¥È¤òÊÖ¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t offsetof(" type ", " member ); +.fi +.SH ÀâÌÀ +.BR offsetof () +¥Þ¥¯¥í¤Ï¡¢¥Õ¥£¡¼¥ë¥É \fImember\fP ¤Î +¹½Â¤ÂÎ \fItype\fP ¤ÎÀèƬ¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤òÊÖ¤¹¡£ + +¤³¤Î¥Þ¥¯¥í¤¬Í­ÍѤʤΤϡ¢ +¹½Â¤ÂΤò¹½À®¤¹¤ë¥Õ¥£¡¼¥ë¥É¤Î¥µ¥¤¥º¤Ï¼ÂÁõ¤Ë¤è¤Ã¤ÆÊѲ½¤¹¤ë¤·¡¢ +¥³¥ó¥Ñ¥¤¥é¤Ë¤è¤ê¥Õ¥£¡¼¥ë¥É´Ö¤ËÁÞÆþ¤¹¤ë¥Ñ¥Ç¥£¥ó¥°¤Î¥Ð¥¤¥È¿ô¤â +°ã¤¦²ÄǽÀ­¤¬¤¢¤ë¤«¤é¤Ç¤¢¤ë¡£ +¤½¤Î·ë²Ì¡¢¤¢¤ë¥¨¥ì¥á¥ó¥È¤Î¥ª¥Õ¥»¥Ã¥È¤Ïɬ¤º¤·¤â¤½¤ì¤è¤êÁ°¤Î +¥¨¥ì¥á¥ó¥È¤Î¥µ¥¤¥º¤Î¹ç·×¤È¤Ï¤Ê¤é¤Ê¤¤¡£ + +\fImember\fP ¤¬¥Ð¥¤¥È¶­³¦¤Ë°ÌÃÖ¤·¤Æ¤¤¤Ê¤¤¾ì¹ç +(¤¹¤Ê¤ï¤Á¡¢¥Ó¥Ã¥È¥Õ¥£¡¼¥ë¥É¤Î¾ì¹ç) ¤Ë¤Ï¡¢ +¥³¥ó¥Ñ¥¤¥é¤Ç¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR offsetof () +¤Ï¡¢»ØÄꤵ¤ì¤¿ +.I member +¤Î»ØÄꤵ¤ì¤¿ +.I type +¤ÎÃæ¤Ç¤Î¥ª¥Õ¥»¥Ã¥È¤ò¡¢¥Ð¥¤¥Èñ°Ì¤ÇÊÖ¤¹¡£ +.SH ½àµò +C89, C99, POSIX.1-2001. +.SH Îã +Linux/i386 ¥·¥¹¥Æ¥à¤Ç¡¢ +.BR gcc (1) +¤Î¥Ç¥Õ¥©¥ë¥È¥ª¥×¥·¥ç¥ó¤Ç +¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¾ì¹ç¡¢²¼µ­¤Î¥×¥í¥°¥é¥à¤Ï°Ê²¼¤Î¤è¤¦¤Ê½ÐÎϤòÊÖ¤¹¡£ +.in +4n +.nf + +.RB "$" " ./a.out" +offsets: i=0; c=4; d=8 a=16 +sizeof(struct s)=16 +.fi +.nf +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include + +int +main(void) +{ + struct s { + int i; + char c; + double d; + char a[]; + }; + + /* ½ÐÎϤϥ³¥ó¥Ñ¥¤¥é°Í¸¤Ç¤¢¤ë */ + + printf("offsets: i=%ld; c=%ld; d=%ld a=%ld\\n", + (long) offsetof(struct s, i), + (long) offsetof(struct s, c), + (long) offsetof(struct s, d), + (long) offsetof(struct s, a)); + printf("sizeof(struct s)=%ld\\n", (long) sizeof(struct s)); + + exit(EXIT_SUCCESS); +} +.fi diff --git a/release/man3/on_exit.3 b/release/man3/on_exit.3 new file mode 100644 index 00000000..d917ca76 --- /dev/null +++ b/release/man3/on_exit.3 @@ -0,0 +1,87 @@ +.\" 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-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 +.\" +.TH ON_EXIT 3 2008-12-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +on_exit \- ¥×¥í¥»¥¹¤¬Àµ¾ï¤Ë½ªÎ»¤·¤¿ºÝ¤Ë¸Æ¤Ð¤ì¤ë´Ø¿ô¤òÅÐÏ¿¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int on_exit(void (*" function ")(int , void *), void *" arg ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR on_exit (): +_BSD_SOURCE || _SVID_SOURCE +.SH ÀâÌÀ +.BR on_exit () +´Ø¿ô¤Ï¡¢»ØÄꤵ¤ì¤¿´Ø¿ô \fIfunction\fP ¤ò¡¢¥×¥í¥»¥¹¤¬ +Àµ¾ï¤Ë½ªÎ»¤·¤¿ºÝ¤Ë¸Æ¤Ð¤ì¤ë´Ø¿ô¤È¤·¤ÆÅÐÏ¿¤¹¤ë¡£Àµ¾ï¤Ê½ªÎ»¤È¤Ï¡¢ +.BR exit (3) +¤Þ¤¿¤Ï¥×¥í¥°¥é¥à¤Î \fImain\fP() +´Ø¿ô¤ÎÃæ¤Î return Ì¿Îá¤Ë¤è¤ë½ªÎ»¤Ç¤¢¤ë¡£ +´Ø¿ô \fIfunction\fP ¤Ë¤Ï¡¢Ä¾¶á¤Î +.BR exit (3) +¤Î¸Æ¤Ó½Ð¤·¤ÇÅϤµ¤ì¤¿ status °ú¿ô¤È +.BR on_exit () +¤Î \fIarg\fP °ú¿ô¤¬ÅϤµ¤ì¤ë¡£ + +Ʊ¤¸´Ø¿ô¤òÊ£¿ô²óÅÐÏ¿¤·¤Æ¤â¤è¤¤¡£ +ÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤ÏÅÐÏ¿ 1 ²ó¤Ë¤Ä¤­ 1 ²ó¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ + +.BR fork (2) +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤ÎÅÐÏ¿¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.BR exec (3) +·²¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤ËÀ®¸ù¤¹¤ë¤È¡¢Á´¤Æ¤ÎÅÐÏ¿¤¬ºï½ü¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR on_exit () +´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¤é 0 ¤ò¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 °Ê³°¤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï SunOS 4 ͳÍè¤Ç¤¢¤ë¤¬¡¢libc4, libc5, glibc ¤Ë¤â¸ºß¤¹¤ë¡£ +Solaris (SunOS 5) ¤Ë¤Ï¤â¤Ï¤ä¸ºß¤·¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤Î»ÈÍѤÏÈò¤±¡¢Âå¤ï¤ê¤Ëɸ½à¤Î +.BR atexit (3) +¤ò»È¤¦¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR _exit (2), +.BR atexit (3), +.BR exit (3) diff --git a/release/man3/opendir.3 b/release/man3/opendir.3 new file mode 100644 index 00000000..604d4c13 --- /dev/null +++ b/release/man3/opendir.3 @@ -0,0 +1,139 @@ +.\" Copyright (C) 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 Sat Jul 24 18:46:01 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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 +.\" +.\"WORD: directory stream ¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à +.\"WORD: entry ¥¨¥ó¥È¥ê +.\"WORD: Permission denied ¥¢¥¯¥»¥¹¸¢¸Â¤¬¤Ê¤¤ +.\"WORD: file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\" +.TH OPENDIR 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +opendir, fdopendir \- ¥Ç¥£¥ì¥¯¥È¥ê¤ò¥ª¡¼¥×¥ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "DIR *opendir(const char *" name ); +.BI "DIR *fdopendir(int " fd ); +.fi +.SH ÀâÌÀ +.BR opendir () +´Ø¿ô¤Ï¥Ç¥£¥ì¥¯¥È¥ê \fIname\fP ¤ËÂбþ¤¹¤ë +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤·¡¢¤½¤Î¥¹¥È¥ê¡¼¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¹¥È¥ê¡¼¥à¤Î°ÌÃ֤ϥǥ£¥ì¥¯¥È¥ê¤ÎÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤵ¤ì¤ë¡£ + +.BR fdopendir () +´Ø¿ô¤Ï +.BR opendir () +¤ÈƱÍͤÀ¤¬¡¢¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ¹¤ë +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤òÊÖ¤¹¡£ +.BR fdopendir () +¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿¸å¤Ï¡¢ +.I fd +¤Ï¼ÂÁõ¤ÎÆâÉô¤Ç»ÈÍѤµ¤ì¤ë¡£¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï +.I fd +¤ò¾¤Î¾ìÌ̤ǻÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +´Ø¿ô +.BR opendir () +¤È +.BR fdopendir () +¤Ï¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢NULL ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¥¢¥¯¥»¥¹¸¢¸Â¤¬¤Ê¤¤¡£ +.TP +.B EBADF +.I fd +¤¬Æɤ߽Ф·ÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤¿¡¢Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EMFILE +¥×¥í¥»¥¹¤¬»ÈÍÑÃæ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENFILE +¥·¥¹¥Æ¥à¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬Â¿¤¹¤®¤ë¡£ +.TP +.B ENOENT +¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢¤Þ¤¿¤Ï \fIname\fP ¤¬¶õʸ»úÎó¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +Ì¿Îá¤ò¼Â¹Ô¤¹¤ë¤Î¤Ë½¼Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.TP +.B ENOTDIR +\fIname\fP ¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR fdopendir () +¤Ï glibc 2.4 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +.BR opendir () +¤Ï SVr4 ¤È 4.3BSD ¤Ë¸ºß¤·¡¢ +POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.BR fdopendir () +¤Ï POSIX.1-2008 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.BR dirfd (3) +¤ò»ÈÍѤ·¤ÆÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.BR opendir () +´Ø¿ô¤Ï¡¢ +.I "DIR *" +¤ÎÇظå¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î close-on-exec ¥Õ¥é¥°¤òÀßÄꤹ¤ë¡£ +.BR fdopendir () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î close-on-exec ¥Õ¥é¥°¤ÎÀßÄê¤òÊѹ¹¤·¤Ê¤¤¡£ +.BR fdopendir () +¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿ºÝ¤Ë¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Î 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) diff --git a/release/man3/openpty.3 b/release/man3/openpty.3 new file mode 100644 index 00000000..692952a6 --- /dev/null +++ b/release/man3/openpty.3 @@ -0,0 +1,183 @@ +.\" Copyright (c) OpenBSD Group +.\" 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. 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. +.\" +.\" Converted into a manpage again by Martin Schulze +.\" +.\" Added -lutil remark, 030718 +.\" +.\" Japanese Version Copyright (c) 2002 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jan 22 21:42:05 JST 2002 +.\" by Yuichi SATO +.\" Updated Mon Mar 8 2003 by Akihiro MOTOKI +.\" Updated Sun Sep 14 2003 by Akihiro MOTOKI +.\" +.\"WORD: tty üËö +.\"WORD: pseudo-tty µ¿»÷üËö +.\" +.TH OPENPTY 3 2003-07-18 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +openpty, login_tty, forkpty \- üËö (tty) ¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int openpty(int *" amaster ", int *" aslave ", char *" name , +.BI " struct termios *" termp ", struct winsize *" winp ); +.sp +.BI "pid_t forkpty(int *" amaster ", char *" name ", struct termios *" termp , +.BI " struct winsize *" winp ); +.sp +.B #include +.sp +.BI "int login_tty(int " fd ); +.sp +\fI\-lutil\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.fi +.SH ÀâÌÀ +.BR openpty () +´Ø¿ô¤Ï¡¢»ÈÍѲÄǽ¤Êµ¿»÷üËö (pseudo-terminal) ¤ò¸«¤Ä¤±¤Æ¡¢ +¥Þ¥¹¥¿¤È¥¹¥ì¡¼¥Ö¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +.I amaster +¤È +.I aslave +¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +.I name +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢¥¹¥ì¡¼¥Ö¤Î¥Õ¥¡¥¤¥ë̾¤¬ +.I name +¤ËÊÖ¤µ¤ì¤ë¡£ +.I termp +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢¥¹¥ì¡¼¥Ö¤ÎüËö¥Ñ¥é¥á¡¼¥¿¤Ï +.I termp +¤ÎÃͤËÀßÄꤵ¤ì¤ë¡£ +.I winp +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢¥¹¥ì¡¼¥Ö¤Î¥¦¥¤¥ó¥É¥¦¥µ¥¤¥º¤Ï +.I winp +¤ËÀßÄꤵ¤ì¤ë¡£ + +.BR login_tty () +´Ø¿ô¤Ï¡¢Ã¼Ëö +.I fd +¤Ë¥í¥°¥¤¥ó¤¹¤ë½àÈ÷¤ò¤¹¤ë +.RI ( fd +¤Ï¼ÂºÝ¤ÎüËö¥Ç¥Ð¥¤¥¹¤Ç¤â¡¢ +.BR openpty () +¤ÇÊÖ¤µ¤ì¤ëµ¿»÷üËö¤Î¥¹¥ì¡¼¥Ö¤Ç¤â¤è¤¤)¡£ +¶ñÂÎŪ¤Ë¤Ï¡¢¿·¤·¤¤¥»¥Ã¥·¥ç¥ó¤òºîÀ®¤·¡¢ +.I fd +¤ò¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤È¤·¡¢ +¸Æ¤Ó½Ð¤·¸µ¤Îɸ½àÆþÎÏ¡¦É¸½à½ÐÎÏ¡¦É¸½à¥¨¥é¡¼¤Î¥¹¥È¥ê¡¼¥à¤ò +.I fd +¤ËÀßÄꤷ¤¿¸å¡¢ +.I fd +¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ + +.BR forkpty () +´Ø¿ô¤Ï +.BR openpty (), +.BR fork (2), +.BR login_tty () +¤òÁȤ߹ç¤ï¤»¡¢µ¿»÷üËö¤òÁàºî¤¹¤ë¿·¤·¤¤¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¡£ +µ¿»÷üËö¤Î¥Þ¥¹¥¿Â¦¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.I amaster +¤ËÊÖ¤µ¤ì¡¢ +.I name +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥¹¥ì¡¼¥Ö¤Î¥Õ¥¡¥¤¥ë̾¤¬ +.I name +¤ËÊÖ¤µ¤ì¤ë¡£ +.I termp +¤È +.I winp +°ú¤­¿ô¤Ï¡¢NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢ +µ¿»÷üËö¤Î¥¹¥ì¡¼¥Ö¦¤ÎüËö°À­¤È¥¦¥¤¥ó¥É¥¦¥µ¥¤¥º¤ò·èÄꤹ¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR openpty (), +.BR login_tty (), +.BR forkpty () +¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤Ï¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR openpty (), +.BR login_tty () +¤ª¤è¤Ó +.BR forkpty () +¤Î»Ò¥×¥í¥»¥¹¤Ï 0 ¤òÊÖ¤·¡¢ +.BR forkpty () +¤Î¿Æ¥×¥í¥»¥¹¤Ï»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +°Ê²¼¤Î¾ì¹ç¤Ë +.BR openpty () +¤Ï¼ºÇÔ¤¹¤ë: +.TP +.B ENOENT +»ÈÍѲÄǽ¤ÊüËö¤¬¤Ê¤¤¡£ +.LP +.BR ioctl (2) +¤¬ +.I fd +¤ò¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤ËÀßÄꤹ¤ë¤Î¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.BR login_tty () +¤Ï¼ºÇÔ¤¹¤ë¡£ +.LP +.BR openpty () +¤Þ¤¿¤Ï +.BR fork (2) +¤Î¤É¤Á¤é¤«¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.BR forkpty () +¤Ï¼ºÇÔ¤¹¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Ï BSD ¤Î´Ø¿ô¤Ç¤¢¤ê¡¢libc5 ¤È glibc2 ¤Ë¸ºß¤¹¤ë¡£ +.SH Ãí°Õ +.\" ¤³¤ì¤é¤Î´Ø¿ô¤Ï libutil ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢¥³¥ó¥Ñ¥¤¥ë»þ¤Î +.\" ¥ª¥×¥·¥ç¥ó¤Ë +.\" .B \-lutil +.\" ¤ò²Ã¤¨¤ëɬÍפ¬¤¢¤ë¡£ +.\" +2.0.92 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢ +.BR openpty () +¤Ï BSD µ¿»÷üËö¥Ú¥¢¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +2.0.92 °Ê¹ß¤Î glibc ¤Ç¤Ï¡¢ +.BR openpty () +¤Ï¤Þ¤º Unix 98 µ¿»÷üËö¥Ú¥¢¤ò¥ª¡¼¥×¥ó¤·¤è¤¦¤È¤·¡¢¤½¤ì¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë +BSD µ¿»÷üËö¥Ú¥¢¤Î¥ª¡¼¥×¥ó¤Ø¤È°Ü¹Ô¤¹¤ë¡£ +.SH ¥Ð¥° +ï¤â +.I name +¤ËÂФ·¤Æ¤É¤Î¤¯¤é¤¤Â礭¤µ¤òͽÌ󤷤Ƥª¤±¤Ð¤¤¤¤¤«Ê¬¤«¤é¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢NULL ¤Ç¤Ê¤¤ +.I name +¤ò°ú¤­¿ô¤È¤·¤Æ +.BR openpty () +¤ä +.BR forkpty () +¤ò¸Æ¤Ó½Ð¤¹¤Î¤Ï°ÂÁ´¤Ç¤¢¤ë¤È¤Ï¸À¤¨¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fork (2), +.BR ttyname (3), +.BR pty (7) diff --git a/release/man3/perror.3 b/release/man3/perror.3 new file mode 100644 index 00000000..793241a8 --- /dev/null +++ b/release/man3/perror.3 @@ -0,0 +1,146 @@ +.\" Copyright (c) 1994 Michael Haardt (michael@moria.de), 1994-06-04 +.\" Copyright (c) 1995 Michael Haardt +.\" (michael@cantor.informatik.rwth-aachen.de), 1995-03-16 +.\" Copyright (c) 1996 Andries Brouwer (aeb@cwi.nl), 1996-01-13 +.\" +.\" 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-01-13 aeb: merged in some text contributed by Melvin Smith +.\" (msmith@falcon.mercer.peachnet.edu) and various other changes. +.\" Modified 1996-05-16 by Martin Schulze (joey@infodrom.north.de) +.\" +.\" Japanese Version Copyright (c) 1998 TACHIBANA Akira +.\" all rights reserved. +.\" Translated 1998-05-28, TACHIBANA Akira +.\" Updated 2001-12-21, Kentaro Shirakata +.\" Updated 2005-03-15, Akihiro MOTOKI +.\" +.TH PERROR 3 2007-07-26 "" "Linux Programmer's Manual" +.SH ̾Á° +perror \- ¥·¥¹¥Æ¥à¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "void perror(const char " *s ); +.sp +.B #include +.sp +.BI "const char *" sys_errlist []; +.br +.BI "int " sys_nerr ; +.br +.BI "int " errno ; +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.IR sys_errlist , +.IR sys_nerr : +_BSD_SOURCE +.SH ÀâÌÀ +´Ø¿ô +.BR perror () +¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤Ë¤ª¤¤¤Æ¡¢ºÇ¸å¤ËȯÀ¸¤·¤¿ +¥¨¥é¡¼¤Ë´Ø¤¹¤ëÀâÌÀ¥á¥Ã¥»¡¼¥¸¤òÀ¸À®¤·¡¢É¸½à¥¨¥é¡¼½ÐÎϤ˽ÐÎϤ¹¤ë¡£ +.RI ( s +¤¬ NULL ¤Ç¤Ê¤¯¡¢ +.I *s +¤¬ NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï) °ú¤­¿ô¤Îʸ»úÎó +.I s +¤¬¤Þ¤º½ÐÎϤµ¤ì¡¢Â³¤¤¤Æ¥³¥í¥ó¡¢¶õÇò¤¬½ÐÎϤµ¤ì¡¢ +¤½¤ì¤«¤é¥á¥Ã¥»¡¼¥¸¤È²þ¹Ô¤¬½ÐÎϤµ¤ì¤ë¡£ + +¤³¤Î¥á¥Ã¥»¡¼¥¸¤òºÇÂç¸Â³èÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢°ú¤­¿ôʸ»úÎó¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿ +´Ø¿ô̾¤òÆþ¤ì¤Æ¤ª¤¯¤È¤è¤¤¡£ +¥¨¥é¡¼ÈÖ¹æ¤Ï³°ÉôÊÑ¿ô +.I errno +¤«¤é¼èÆÀ¤µ¤ì¤ë¡£ +.I errno +¤Ï¥¨¥é¡¼¤¬È¯À¸¤·¤¿»þ¤ËÀßÄꤵ¤ì¡¢ +À®¸ù¤·¤¿¸Æ¤Ó½Ð¤·¤Ç¤Ï¥¯¥ê¥¢¤µ¤ì¤Ê¤¤¡£ + +Âç°èÊÑ¿ô¤Î¥¨¥é¡¼¥ê¥¹¥È +.IR sys_errlist "[]" +¤Ï +.I errno +¤òź»ú¤È¤¹¤ëÇÛÎó¤Ç¡¢¤³¤ÎÇÛÎ󤫤é²þ¹Ô̵¤·¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬¼èÆÀ¤µ¤ì¤ë¡£ +¥Æ¡¼¥Ö¥ë¤Ç¤ÎºÇÂç¤Î¥á¥Ã¥»¡¼¥¸ÈÖ¹æ¤Ï +.IR sys_nerr " \-1" +¤È¤Ê¤ë¡£ +¤³¤Î¥Æ¡¼¥Ö¥ë¤òľÀÜ»²¾È¤¹¤ëºÝ¤Ë¤ÏÃí°Õ¤¹¤ë¤³¤È¡£¤Ê¤¼¤Ê¤é¡¢¿·¤·¤¤¥¨¥é¡¼Èֹ椬 +.IR sys_errlist "[]" +¤ËÄɲúѤȤϸ¤é¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ + +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢Ä̾ÊÖ¤êÃͤȤ·¤Æ \-1 ¤¬Ê֤ꡢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼±Ê̤¹¤ëÃͤ¬ÀßÄꤵ¤ì¤ë (ÀßÄꤵ¤ì¤ë¥¨¥é¡¼ÈÖ¹æ¤Ï +.I +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë)¡£ +¿¤¯¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤âƱÍͤÎÆ°ºî¤È¤Ê¤ë¡£ +´Ø¿ô +.BR perror () +¤Ï¡¢¤³¤Î¥¨¥é¡¼¥³¡¼¥É¤Î²ÄÆɤʥá¥Ã¥»¡¼¥¸¤Ø¤ÎÊÑ´¹¤ò¹Ô¤¦¡£ +.I errno +¤Ï¡¢¥é¥¤¥Ö¥é¥ê¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿¸å¤Ë¤Ï̤ÄêµÁ¤Ç¤¢¤ë¤³¤È¤ËÃí°Õ¤¬É¬ÍפǤ¢¤ë: +¤½¤Î¸Æ¤Ó½Ð¤·¼«¿È¤ÏÀ®¸ù¤·¤¿¤È¤·¤Æ¤â¡¢ÆâÉô¤Ç¸Æ¤Ó½Ð¤·¤¿Â¾¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤¬ +¼ºÇÔ¤·¤Æ¡¢¤½¤Î·ë²Ì¤ò¤³¤ÎÊÑ¿ô¤ËÀßÄꤹ¤ë¤³¤È¤¬¤¢¤ë¤«¤é¤À¡£ +¤è¤Ã¤Æ¡¢¼ºÇÔ¤·¤¿¸Æ¤Ó½Ð¤·¤Îľ¸å¤Ë +.BR perror () +¤ò¸Æ¤Ð¤Ê¤¤¾ì¹ç¤Ë¤Ï +.I errno +¤ÎÃͤò +Êݸ¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ½àµò +´Ø¿ô +.BR perror () +¤È³°ÉôÊÑ¿ô +.I errno +.RB ( errno (3) +»²¾È) ¤Ï C89, 4.3BSD, POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +³°ÉôÊÑ¿ô +.I sys_nerr +¤È +.I sys_errlist +¤Ï BSD ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +³°ÉôÊÑ¿ô +.I sys_nerr +¤È +.I sys_errlist +¤Ï glibc ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +.I +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.\" .B _BSD_SOURCE +.\" ¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë¤Î¤ß¡¢¤³¤ì¤é¤ÎÊÑ¿ô¤ÏÄêµÁ¤µ¤ì¤ë¡£ +.\" .B _GNU_SOURCE +.\" ¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ï¡¢ +.\" .I _sys_nerr +.\" ¤È +.\" .I _sys_errlist +.\" ¤È¤¤¤¦¥·¥ó¥Ü¥ë¤¬Ä󶡤µ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR err (3), +.BR errno (3), +.BR error (3), +.BR strerror (3) diff --git a/release/man3/popen.3 b/release/man3/popen.3 new file mode 100644 index 00000000..1a51e711 --- /dev/null +++ b/release/man3/popen.3 @@ -0,0 +1,209 @@ +.\" Copyright 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. +.\" +.\" @(#)popen.3 6.4 (Berkeley) 4/30/91 +.\" +.\" Converted for Linux, Mon Nov 29 14:45:38 1993, faith@cs.unc.edu +.\" Modified Sat May 18 20:37:44 1996 by Martin Schulze (joey@linux.de) +.\" Modified 7 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) +.\" +.\" Japanese Version Copyright (c) 1997 Takashi Yoshino +.\" all rights reserved. +.\" Translated 1997-01-21, Takashi Yoshino +.\" Modified 2007-05-03, Akihiro MOTOKI +.\" Modified 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" +.TH POPEN 3 2010-02-03 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +popen, pclose \- ¥×¥í¥»¥¹¤È¤ÎÆþÎÏ/½ÐÎÏÍѤΥѥ¤¥×¡¦¥¹¥È¥ê¡¼¥à +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "FILE *popen(const char *" command ", const char *" type ); +.sp +.BI "int pclose(FILE *" stream ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.ad l +.in +.sp +.BR popen (), +.BR pclose (): +_POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE +.ad b +.SH ÀâÌÀ +.BR popen () +´Ø¿ô¤Ï¡¢¥×¥í¥»¥¹¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£¶ñÂÎŪ¤Ë¤Ï¡¢ +¥Ñ¥¤¥×¤òÀ¸À®¤·¡¢¥Õ¥©¡¼¥¯¤ò¹Ô¤¤¡¢¥·¥§¥ë¤òµ¯Æ°¤¹¤ë¡£ +ÄêµÁ¤«¤éʬ¤«¤ë¤è¤¦¤Ë¡¢¥Ñ¥¤¥×¤Ï°ìÊý¸þ¤Ê¤Î¤Ç¡¢ +.I type +°ú¤­¿ô¤Ë¤ÏÆɤ߹þ¤ß¤«½ñ¤­¹þ¤ß¤Î¤É¤Á¤é¤«°ìÊý¤À¤±¤ò»ØÄê¤Ç¤­¤ë +(ξÊý¤Ï»ØÄê¤Ç¤­¤Ê¤¤)¡£ +À¸À®¤µ¤ì¤ë¥¹¥È¥ê¡¼¥à¤Ï¡¢¤³¤Î»ØÄê¤ËÂбþ¤·¤Æ¡¢Æɤ߼è¤êÀìÍѤޤ¿¤Ï +½ñ¤­¹þ¤ßÀìÍѤΤ¤¤º¤ì¤«¤È¤Ê¤ë¡£ +.PP +.I command +°ú¤­¿ô¤Ï¡¢¥·¥§¥ë¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤ò´Þ¤à +NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤³¤Î¥³¥Þ¥ó¥É¤Ï +.B \-c +¥Õ¥é¥°¤òÍѤ¤¤Æ +.I /bin/sh +¤ËÅϤµ¤ì¤ë¡£ +¥³¥Þ¥ó¥É¤Î²ò¼á¤Ï (¤â¤·É¬Íפʤé¤Ð) ¥·¥§¥ë¤Ë¤è¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +.I type +°ú¤­¿ô¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¡¢ +Æɤ߹þ¤ß¤ò¼¨¤¹Ê¸»ú \(aqr\(aq ¤«¡¢½ñ¤­¹þ¤ß¤ò¼¨¤¹Ê¸»ú \(aqw\(aq ¤Î +¤É¤Á¤é¤«°ìÊý¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +glibc 2.9 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î°ú¤­¿ô¤Ëʸ»ú \(aqe\(aq ¤òÄɲäǻØÄê¤Ç¤­¤ë¡£ +ʸ»ú \(aqe\(aq ¤ò»ØÄꤹ¤ë¤È¡¢ +Âбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤ª¤¤¤Æ¡¢ +close-on-exec ¥Õ¥é¥° +.RB ( FD_CLOEXEC ) +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +¤³¤ì¤¬Ìò¤ËΩ¤ÄÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR open (2) +¤Î +.B O_CLOEXEC +¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.PP +.BR popen () +¤«¤é¤ÎÊÖ¤êÃͤϡ¢Ä̾ï¤Îɸ½à I/O ¥¹¥È¥ê¡¼¥à¤ÈƱ¤¸¤Ç¤¢¤ë¤¬¡¢ +.BR fclose (3) +¤Ç¤Ï¤Ê¤¯ +.BR pclose () +¤ÇÊĤ¸¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¤³¤È¤À¤±¤¬°Û¤Ê¤ë¡£ +¤³¤Î¥¹¥È¥ê¡¼¥à¤Ø½ñ¤­¹þ¤ó¤À·ë²Ì¤Ï¥³¥Þ¥ó¥É¤Îɸ½àÆþÎϤ˽ñ¤­¹þ¤Þ¤ì¤ë¡£ +¤½¤·¤Æ¡¢¥³¥Þ¥ó¥É¤Îɸ½à½ÐÎϤϡ¢ +¥³¥Þ¥ó¥É¤½¤Î¤â¤Î¤¬ÃÖ¤­´¹¤ï¤Ã¤Æ¤·¤Þ¤ï¤Ê¤¤¸Â¤ê¡¢ +.BR popen () +¤ò¸Æ¤ó¤À¥×¥í¥»¥¹¤Îɸ½à½ÐÎϤÈƱ¤¸¤³¤È¤Ë¤Ê¤ë¡£ +µÕ¤Ë¡¢"popened" +.RB ( popen () +¤Ë¤è¤Ã¤Æ³«¤«¤ì¤¿) ¥¹¥È¥ê¡¼¥à¤«¤é¤ÎÆɤ߹þ¤ß¤Ï¡¢ +¤½¤Î¥³¥Þ¥ó¥É¤Îɸ½à½ÐÎϤòÆɤ߹þ¤à¤³¤È¤Ë¤Ê¤ë¡£ +¤½¤·¤Æ¡¢¤½¤Î¥³¥Þ¥ó¥É¤Îɸ½àÆþÎÏ¤Ï +.BR popen () +¤ò¸Æ¤ó¤À¥×¥í¥»¥¹¤Îɸ½àÆþÎϤÈƱ°ì¤Ç¤¢¤ë¡£ +.PP +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.BR popen () +¤Î½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ï´°Á´¤Ë¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤ë¤³¤È¤ËÃí°Õ¤·¤è¤¦¡£ +.PP +.BR pclose () +´Ø¿ô¤Ï¡¢(¥Ñ¥¤¥×¤Ë) ´ØÏ¢¤Å¤±¤é¤ì¤¿¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤Î¤òÂÔ¤Á¡¢ +.BR wait4 (2) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤¿¥³¥Þ¥ó¥É¤Î½ªÎ»¾õÂÖ¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +.BR popen () +´Ø¿ô¤Ï¡¢ +.BR fork (2) +¤Þ¤¿¤Ï +.BR pipe (2) +¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤ä¡¢ +¥á¥â¥ê³ä¤êÅö¤Æ¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ NULL ¤òÊÖ¤¹¡£ +.PP +.BR pclose () +´Ø¿ô¤Ï¡¢ +.BR wait4 (2) +¤¬¥¨¥é¡¼¤òÊÖ¤·¤¿¤ê¡¢²¿¤«Â¾¤Î¥¨¥é¡¼¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¡¢ +\-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.BR popen () +´Ø¿ô¤Ï¡¢¥á¥â¥ê¥¢¥í¥±¡¼¥·¥ç¥ó¤Ë¼ºÇÔ¤·¤Æ¤â +.I errno +¤ò¥»¥Ã¥È¤·¤Ê¤¤¡£ +.BR popen () +¤¬Ãæ¤Ç¸Æ¤Ó½Ð¤¹ +.BR fork (2) +¤ä +.BR pipe (2) +¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +.I errno +¤¬Å¬Àڤ˥»¥Ã¥È¤µ¤ì¤ë¡£ +°ú¤­¿ô +.I type +¤¬Ìµ¸ú¤Ç¤¢¤ê¡¢¤³¤Î¾õÂÖ¤¬¸¡ÃΤµ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +.I errno +¤¬ +.B EINVAL +¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.BR pclose () +¤¬¡¢»Ò¥×¥í¥»¥¹¤Î¾õÂÖ¤ò¼èÆÀ¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.I errno +¤¬ +.B ECHILD +¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ½àµò +POSIX.1-2001. + +.I type +¤Ë»ØÄê¤Ç¤­¤ë \(aqe\(aq ¤Ï Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +Æɤ߹þ¤ß¤Î¤¿¤á¤Ë³«¤«¤ì¤¿¥³¥Þ¥ó¥É¤Îɸ½àÆþÎÏ¤Ï +.BR popen (), +¤ò¸Æ¤ó¤À¥×¥í¥»¥¹¤È°ì½ï¤Ë¡¢¤½¤ÎÆɤ߼è¤ê°ÌÃÖ¤ò¶¦Í­¤¹¤ë¡£ +¤½¤Î¤¿¤á¡¢¤â¤È¤Î¥×¥í¥»¥¹¤¬¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤¿Æɤ߼è¤ê¤ò½ªÎ»¤·¤¿¤é¡¢ +¤½¤Î¥³¥Þ¥ó¥É¤ÎÆþÎÏ°ÌÃÖ¤ÏͽÁÛ¤µ¤ì¤¿¤â¤Î¤Ë¤Ï +¤Ê¤Ã¤Æ¤¤¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +ƱÍͤˡ¢½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë³«¤«¤ì¤¿¥³¥Þ¥ó¥É¤«¤é¤Î½ÐÎϤϡ¢ +¤â¤È¤Î¥×¥í¥»¥¹¤Î½ÐÎϤȺ®¤¶¤ê¹ç¤¦¤³¤È¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¸å¼Ô¤Ï +.BR popen () +¤ÎÁ°¤Ë +.BR fflush (3) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤Æ²óÈò²Äǽ¤Ç¤¢¤ë¡£ +.PP +¥·¥§¥ë¤Î¼Â¹Ô¤Î¼ºÇԤϡ¢ +¥·¥§¥ë¤¬¥³¥Þ¥ó¥É¤Î¼Â¹Ô¤Ë¼ºÇÔ¤·¤¿¤³¤È¤ä¡¢ +¥³¥Þ¥ó¥É¤¬¤¹¤°¤Ë½ªÎ»¤·¤Æ¤·¤Þ¤Ã¤¿¤³¤È¤È¡¢¶èÊ̤¬¤Ä¤«¤Ê¤¤¡£ +Í£°ì¤Î¥Ò¥ó¥È¤Ï½ªÎ»¾õÂÖ¤¬ 127 ¤Ë¤Ê¤ë¤³¤È¤Ç¤¢¤ë¡£ +.\" .SH ÍúÎò +.\" .BR popen () +.\" ´Ø¿ô¤È +.\" .BR pclose () +.\" ´Ø¿ô¤Ï AT&T UNIX ¤Î Version 7 ¤«¤éƳÆþ¤µ¤ì¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sh (1), +.BR fork (2), +.BR pipe (2), +.BR wait4 (2), +.BR fclose (3), +.BR fflush (3), +.BR fopen (3), +.BR stdio (3), +.BR system (3) diff --git a/release/man3/posix_fallocate.3 b/release/man3/posix_fallocate.3 new file mode 100644 index 00000000..7162bceb --- /dev/null +++ b/release/man3/posix_fallocate.3 @@ -0,0 +1,119 @@ +.\" 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-07-13, Yuichi SATO . LDP v2.29 +.\" Updated 2010-04-11, Akihiro MOTOKI , LDP v3.24 +.\" +.TH POSIX_FALLOCATE 3 2009-09-30 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +posix_fallocate \- ¥Õ¥¡¥¤¥ë¤Î¥¹¥Ú¡¼¥¹¤ò³ÎÊݤ¹¤ë +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE 600 +.B #include +.sp +.BI "int posix_fallocate(int " fd ", off_t " offset ", off_t " len ); +.fi +.SH ÀâÌÀ +´Ø¿ô +.BR posix_fallocate () +¤Ï¡¢¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¡¢¥Ç¥£¥¹¥¯¥¹¥Ú¡¼¥¹¤ò³Î¼Â¤Ë³ÎÊݤ¹¤ë¡£ +¥Ç¥£¥¹¥¯¥¹¥Ú¡¼¥¹¤Ï +.I offset +¤«¤é»Ï¤Þ¤ë +.I len +¥Ð¥¤¥È¤ÎÈϰϤΥХ¤¥È¤Ç¤¢¤ë¡£ +.BR posix_fallocate () +¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿¸å¡¢»ØÄꤵ¤ì¤¿ÈϰϤΥХ¤¥È¤ËÂФ¹¤ë½ñ¤­¹þ¤ß¤Ï¡¢ +¥Ç¥£¥¹¥¯¥¹¥Ú¡¼¥¹¤ÎÉÔ­¤Ç¼ºÇÔ¤·¤Ê¤¤¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ + +¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤¬ +.IR offset + len +¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤Ï¤³¤Î¥µ¥¤¥º¤Ë¤Ê¤ë¤è¤¦¤Ë³ÈÂ礵¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ÏÊѤï¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR posix_fallocate () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç¡¢0 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹¡£ +.I errno +¤¬ÀßÄꤵ¤ì¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤¬Í­¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +¤Þ¤¿¤Ï½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EFBIG +.I offset+len +¤¬ºÇÂç¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤òĶ¤¨¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.I offset +¤¬ 0 ̤Ëþ¤À¤Ã¤¿¤«¡¢ +.I len +¤¬ 0 °Ê²¼¤À¤Ã¤¿¡£ +.TP +.B ENODEV +.I fd +¤¬Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤È¤·¤Æ»²¾È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOSPC +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¥Ç¥Ð¥¤¥¹¤Ë¡¢½½Ê¬¤Ê¥¹¥Ú¡¼¥¹¤¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ESPIPE +.I fd +¤¬¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR posix_fallocate () +¤Ï glibc 2.1.94 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2001. + +POSIX.1-2008 ¤Ç¤Ï¡¢ +.I len +¤¬ 0 ¤Î¾ì¹ç¡¢¤â¤·¤¯¤Ï +.I offset +¤¬ 0 ̤Ëþ¤Î¾ì¹ç¡¢ +.B EINVAL +¥¨¥é¡¼¤òÊÖ¤¹¤â¤Î¤È¤µ¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢ +.I len +¤¬ 0 ̤Ëþ¤Î¾ì¹ç¡¢¤â¤·¤¯¤Ï +.I offset +¤¬ 0 ̤Ëþ¤Î¾ì¹ç¡¢ +.B EINVAL +¥¨¥é¡¼¤òÊÖ¤¹¤â¤Î¤È¤µ¤ì¤Æ¤¤¤ë¡£¤Þ¤¿¡¢ +.I len +¤¬ 0 ¤Î¾ì¹ç¡¢ +.B EINVAL +¥¨¥é¡¼¤òÊÖ¤·¤Æ¤â¤è¤¤¤È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fallocate (2), +.BR lseek (2), +.BR posix_fadvise (2), +.BR feature_test_macros (7) diff --git a/release/man3/posix_memalign.3 b/release/man3/posix_memalign.3 new file mode 100644 index 00000000..e62f7962 --- /dev/null +++ b/release/man3/posix_memalign.3 @@ -0,0 +1,243 @@ +.\" 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 2009-03-30 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +posix_memalign, memalign, valloc \- ¥¢¥é¥¤¥ó¥á¥ó¥È¤µ¤ì¤¿¥á¥â¥ê¤Î³ä¤êÅö¤Æ¤ò¹Ô¤¦ +.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 +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR posix_memalign (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH ÀâÌÀ +´Ø¿ô +.BR posix_memalign () +¤Ï¡¢ +.I size +¥Ð¥¤¥È¤Î¥á¥â¥ê¤ò³ä¤êÅö¤Æ¡¢³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤Î¥¢¥É¥ì¥¹¤ò +.I "*memptr" +¤ËÀßÄꤹ¤ë¡£ +³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤Î¥¢¥É¥ì¥¹¤Ï +.I "alignment" +¤ÎÇÜ¿ô¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Ï¤º¤Ç¤¢¤ë¡£ +.I "alignment" +¤Ï 2 ¤Î¤Ù¤­¾è¤Ç¡¢¤«¤Ä +.IR "sizeof(void *)" +¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I size +¤¬ 0 ¤Î¾ì¹ç¡¢ +.BR posix_memalign () +¤Ï NULL ¤«°ì°Õ¤Ê¥Ý¥¤¥ó¥¿ÃͤòÊÖ¤¹¡£ +¤³¤Î¥Ý¥¤¥ó¥¿Ãͤϡ¢¸å¤Ç +.BR free () +¤ËÌäÂê¤Ê¤¯ÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¡£ + +Çѻߤµ¤ì¤¿´Ø¿ô¤Ç¤¢¤ë +.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. + +Çѻߤµ¤ì¤¿´Ø¿ô¤Ç¤¢¤ë +.BR valloc () +¤Ï +.I size +¥Ð¥¤¥È¤Î¥á¥â¥ê¤ò³ä¤êÅö¤Æ¡¢³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥á¥â¥ê¤Î¥¢¥É¥ì¥¹¤Ï¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Ï¤º¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï +.I "memalign(sysconf(_SC_PAGESIZE),size)" +¤ÈÅù²Á¤Ç¤¢¤ë¡£ + +.\" motoki: be not zeroed ¤Ã¤Æ¤É¤¦¤¤¤¦°ÕÌ£¡© +3 ¤Ä¤Î´Ø¿ô¤Ï¤¤¤º¤ì¤â¥á¥â¥ê¤Î¥¼¥í¥¯¥ê¥¢¤ò¹Ô¤ï¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR memalign () +¤È +.BR valloc () +¤Ï³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +³ä¤êÅö¤Æ¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ + +.BR posix_memalign () +¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤·¡¢ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¼¡¤Î¥»¥¯¥·¥ç¥ó¤Ëµ­ºÜ¤µ¤ì¤¿¥¨¥é¡¼ÃͤΤ¤¤º¤ì¤«¤òÊÖ¤¹¡£ +.I errno +¤Ï¥»¥Ã¥È¤µ¤ì¤Ê¤¤¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I alignment +°ú¤­¿ô¤¬ 2 ¤Î¤Ù¤­¾è¤Ç¤Ê¤«¤Ã¤¿¤«¡¢ +.IR "sizeof(void *)" +¤ÎÇÜ¿ô¤Ç¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +³ä¤êÅö¤ÆÍ×µá¤òËþ¤¿¤¹¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR memalign () +¤È +.BR valloc () +¤Ï¤¹¤Ù¤Æ¤Î Linux libc ¥é¥¤¥Ö¥é¥ê¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.BR posix_memalign () +¤Ï glibc 2.1.91 °Ê¹ß¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +´Ø¿ô +.BR valloc () +¤Ï 3.0BSD ¤ÇÅо줷¤¿¡£4.3BSD ¤Ç¤ÏÇѻߤµ¤ì¤¿¤Èµ­ºÜ¤µ¤ì¤Æ¤ª¤ê¡¢ +SUSv2 ¤Ç¤Ï²áµî¤Î̾»Ä¤À¤Èµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Ë¤Ï¤â¤Ï¤ä¸ºß¤·¤Ê¤¤¡£ +´Ø¿ô +.BR memalign () +¤Ï SunOS 4.1.3 ¤ÇÅо줷¤¿¤¬¡¢4.4BSD ¤Ë¤Ï¤Ê¤¤¡£ +´Ø¿ô +.BR posix_memalign () +¤Ï POSIX.1d ¤ËͳÍ褹¤ë¡£ +.SS ¥Ø¥Ã¥À +.BR posix_memalign () +¤ÎÀë¸À¤ò \fI\fP ¤Ç¹Ô¤¦¤³¤È¤Ë´Ø¤·¤Æ¤Ï¡¢ +³§¤Î°Õ¸«¤¬°ìÃפ·¤Æ¤¤¤ë¡£ + +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR memalign () +¤Ï \fI\fP ¤Ç¤Ï¤Ê¤¯ \fI\fP ¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£ + +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 ¤è¤ê¾®¤µ¤¯¤Ê¤¤ÃͤËÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +.SH Ãí°Õ +¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥¢¥é¥¤¥ó¥á¥ó¥È¤Ë´Ø¤·¤ÆÀ©¸Â¤¬¤¢¤ë¡£Î㤨¤Ð¡¢ +¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë¥À¥¤¥ì¥¯¥È I/O ¤Ë»ÈÍѤ¹¤ë¥Ð¥Ã¥Õ¥¡¤Ë¤Ï +¥¢¥é¥¤¥ó¥á¥ó¥È¤Ë´Ø¤¹¤ëÀ©¸Â¤¬¤¢¤ë¡£ +POSIX ¤Ç¤Ï¡¢¤É¤ó¤Ê¥¢¥é¥¤¥ó¥á¥ó¥È¤¬É¬Íפ«¤òÃΤ뤿¤á¤Ë +.I "pathconf(path,_PC_REC_XFER_ALIGN)" +¥³¡¼¥ë¤òµ¬Äꤷ¤Æ¤¤¤ë¡£¤³¤³¤Ç +.BR posix_memalign () +¤ò»È¤¦¤È¡¢¤³¤ÎɬÍ×¾ò·ï¤òËþ¤¿¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ + +.BR posix_memalign () +¤Ï +.I alignment +¤¬¾å¤Ç¾ÜºÙ¤Ë½Ò¤Ù¤¿É¬Í×¾ò·ï¤òËþ¤¿¤¹¤«¤É¤¦¤«¤ò³Î¤«¤á¤ë¡£ +.BR memalign () +¤Ï +.I boundary +°ú¤­¿ô¤¬Àµ¤·¤¤¤«¤É¤¦¤«¤Î³Îǧ¤ò¹Ô¤ï¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ + +POSIX ¤Ç¤Ï +.BR posix_memalign () +¤Ë¤è¤Ã¤Æ³ÍÆÀ¤·¤¿¥á¥â¥ê¤Ï +.BR free (3) +¤ò»È¤Ã¤Æ²òÊü¤¹¤ë¤³¤È¤¬¤Ç¤­¤ëɬÍפ¬¤¢¤ë¡£ +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï +.BR memalign () +¤ä +.BR valloc () +¤Ç³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤òºÆÍøÍѤ¹¤ë¼êÃʤ¬Ä󶡤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" 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). +glibc ¤Î¼ÂÁõ¤Ç¤Ï¡¢ +¤³¤³¤Ë½Ò¤Ù¤¿ 3 ¤Ä¤Î´Ø¿ô¤Î¤¤¤º¤ì¤Ç³ÍÆÀ¤·¤¿¥á¥â¥ê¤â +.BR free (3) +¤ÇºÆÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +glibc ¤Î +.BR malloc (3) +¤Ï¾ï¤Ë 8 ¥Ð¥¤¥È¤Ë¥¢¥é¥¤¥ó¥á¥ó¥È¤µ¤ì¤¿¥á¥â¥ê¥¢¥É¥ì¥¹¤òÊÖ¤¹¤Î¤Ç¡¢ +¤³¤³¤Ç½Ò¤Ù¤¿´Ø¿ô¤¬É¬Íפˤʤë¤Î¤Ï +8 ¥Ð¥¤¥È¤è¤ê¤âÂ礭¤Ê¥¢¥é¥¤¥ó¥á¥ó¥È¤¬É¬Íפʾì¹ç¤À¤±¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR brk (2), +.BR getpagesize (2), +.BR free (3), +.BR malloc (3) diff --git a/release/man3/posix_openpt.3 b/release/man3/posix_openpt.3 new file mode 100644 index 00000000..00d88297 --- /dev/null +++ b/release/man3/posix_openpt.3 @@ -0,0 +1,105 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2004 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) 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Jan 30 08:55:16 JST 2005 +.\" by Yuichi SATO +.\" +.TH POSIX_OPENPT 3 2007-07-26 "" "Linux Programmer's Manual" +.SH ̾Á° +posix_openpt \- µ¿»÷üËö (pseudo-terminal) ¥Ç¥Ð¥¤¥¹¤ò¥ª¡¼¥×¥ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "int posix_openpt(int " flags ");" +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR posix_openpt (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH ÀâÌÀ +.BR posix_openpt () +´Ø¿ô¤Ï»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤µ¿»÷üËö¥Þ¥¹¥¿¥Ç¥Ð¥¤¥¹¤ò¥ª¡¼¥×¥ó¤·¡¢ +¤½¤Î¥Ç¥Ð¥¤¥¹¤ò»²¾È¤¹¤ë¤¿¤á¤Ë»È¤¦¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.I flags +°ú¤­¿ô¤Ï¡¢°Ê²¼¤Î¥Õ¥é¥°¤Î¤¦¤Á 0 ¸Ä°Ê¾å¤Î OR ¤ò¤È¤Ã¤¿¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +.TP +.B O_RDWR +Æɤ߽ñ¤­¤Î¤¿¤á¤Ë¥Ç¥Ð¥¤¥¹¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +ÉáÄ̤Ϥ³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¡£ +.TP +.B O_NOCTTY +¤³¤Î¥Ç¥Ð¥¤¥¹¤ò¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤È¤·¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR posix_openpt () +¤ÏÉé¤Ç¤Ï¤Ê¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¤³¤ì¤Ï»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¦¤ÁºÇ¾®¤ÎÃͤǤ¢¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢¥¨¥é¡¼¤ò¼¨¤¹¤¿¤á¤Ë +.I errno +¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.BR open (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR posix_openpt () +¤Î glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.2.1 °Ê¹ß¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +.BR posix_openpt () +¤Ï Unix98 µ¿»÷üËö¥µ¥Ý¡¼¥È +.RB ( pts (4) +¤ò»²¾È) ¤Î°ìÉô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +¤³¤Î´Ø¿ô¤Ï POSIX ¤Ë¤ª¤¤¤ÆºÇ¶áºî¤é¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ +System V (ÊÌ̾ Unix 98) µ¿»÷üËö¤ò¥µ¥Ý¡¼¥È¤¹¤ë Unix ¼ÂÁõ¤ÎÃæ¤Ë¤Ï¡¢ +¤³¤Î´Ø¿ô¤ò»ý¤¿¤Ê¤¤¤â¤Î¤â¤¢¤ë¤¬¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ´Êñ¤Ë¼ÂÁõ¤Ç¤­¤ë: +.in +4n +.nf + +int +posix_openpt(int flags) +{ + return open("/dev/ptmx", flags); +} +.fi +.in +.SH ´ØÏ¢¹àÌÜ +.BR open (2), +.BR getpt (3), +.BR grantpt (3), +.BR ptsname (3), +.BR unlockpt (3), +.BR pts (4), +.BR pty (7) diff --git a/release/man3/pow.3 b/release/man3/pow.3 new file mode 100644 index 00000000..2e42ab58 --- /dev/null +++ b/release/man3/pow.3 @@ -0,0 +1,316 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 +.\" +.TH POW 3 2008-08-10 "" "Linux Programmer's Manual" +.SH ̾Á° +pow, powf, powl \- Îß¾è´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double pow(double " x ", double " y ); +.br +.BI "float powf(float " x ", float " y ); +.br +.BI "long double powl(long double " x ", long double " y ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR powf (), +.BR powl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR pow () +´Ø¿ô¤Ï \fIx\fP ¤Î \fIy\fP ¾è¤ÎÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤Î +.I y +¾è¤ÎÃͤòÊÖ¤¹¡£ + +.I x +¤¬ 0 ̤Ëþ¤ÎÍ­¸ÂÃÍ¤Ç +.I y +¤¬À°¿ô¤Ç¤Ê¤¤Í­¸ÂÃͤξì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ +.\" The domain error is generated at least as far back as glibc 2.4 +NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ +ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢ +.\" The range error is generated at least as far back as glibc 2.4 +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.BR HUGE_VAL , +.BR HUGE_VALF , +.BR HUGE_VALL +¤òÊÖ¤¹¡£ÊÖ¤êÃͤˤϿô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤·¡¢¤½¤ÎÃͤ¬É½¸½²Äǽ¤Ç¤Ê¤¤¾ì¹ç¡¢ +ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢ 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. + +°Ê²¼¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¡¢ +.I x +¤« +.I y +¤¬ NaN ¤Î¾ì¹ç¡¢ÊÖ¤êÃÍ¤Ï NaN ¤È¤Ê¤ë¡£ + +.I x +¤¬ +1 ¤Î¾ì¹ç¡¢ +.RI ( y +¤¬ NaN ¤Ç¤¢¤Ã¤¿¤È¤·¤Æ¤â) ÊÖ¤êÃÍ¤Ï 1.0 ¤È¤Ê¤ë¡£ + +.I y +¤¬ 0 ¤Î¾ì¹ç¡¢ +.RI ( x +¤¬ NaN ¤Ç¤¢¤Ã¤¿¤È¤·¤Æ¤â) ÊÖ¤êÃÍ¤Ï 1.0 ¤È¤Ê¤ë¡£ + +.I x +¤¬ +0 (\-0) ¤Ç +.I y +¤¬ 0 ¤è¤êÂ礭¤Ê´ñ¿ô¤Î¾ì¹ç¡¢ÊÖ¤êÃÍ¤Ï +0 (\-0) ¤È¤Ê¤ë¡£ + +.I x +¤¬ 0 ¤Ç¡¢ +.I y +¤¬ 0 ¤è¤êÂ礭¤¯´ñ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢ÊÖ¤êÃÍ¤Ï +0 ¤È¤Ê¤ë¡£ + +.I x +¤¬ \-1 ¤Ç¡¢ +.I y +¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃÍ¤Ï 1.0 ¤È¤Ê¤ë¡£ + +.I x +¤ÎÀäÂÐÃͤ¬ 1 ̤Ëþ¤Ç¡¢ +.I y +¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£ + +.I x +ÀäÂÐÃͤ¬ 1 ¤è¤êÂ礭¤¯¡¢ +.I y +¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃÍ¤Ï +0 ¤È¤Ê¤ë¡£ + +.I x +¤ÎÀäÂÐÃͤ¬ 1 ̤Ëþ¤Ç¡¢ +.I y +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃÍ¤Ï +0 ¤È¤Ê¤ë¡£ + +.I x +¤ÎÀäÂÐÃͤ¬ 1 ¤è¤êÂ礭¤¯¡¢ +.I y +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£ + +.I x +¤¬Éé¤Î̵¸ÂÂç¤Ç¡¢ +.I y +¤¬ 0 ¤è¤ê¾®¤µ¤¤´ñ¿ô¤Î¾ì¹ç¡¢ÊÖ¤êÃÍ¤Ï \-0 ¤È¤Ê¤ë¡£ + +.I x +¤¬Éé¤Î̵¸ÂÂç¤Ç¡¢ +.I y +¤¬ 0 ¤è¤ê¾®¤µ¤¯´ñ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢ÊÖ¤êÃÍ¤Ï +0 ¤È¤Ê¤ë¡£ + +.I x +¤¬Éé¤Î̵¸ÂÂç¤Ç¡¢ +.I y +¤¬ 0 ¤è¤êÂ礭¤¤´ñ¿ô¤Î¾ì¹ç¡¢ÊÖ¤êÃͤÏÉé¤Î̵¸ÂÂç¤È¤Ê¤ë¡£ + +.I x +¤¬Éé¤Î̵¸ÂÂç¤Ç¡¢ +.I y +¤¬ 0 ¤è¤êÂ礭¤¯´ñ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Ç¡¢ +.I y +¤¬ 0 ̤Ëþ¤Î¾ì¹ç¡¢ÊÖ¤êÃÍ¤Ï +0 ¤È¤Ê¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Ç¡¢ +.I y +¤¬ 0 ¤è¤êÂ礭¤¤¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£ + +.I x +¤¬ +0 ¤« \-0 ¤Ç¡¢ +.I y +¤¬ 0 ¤è¤ê¾®¤µ¤¤´ñ¿ô¤Î¾ì¹ç¡¢ +¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢ÊÖ¤êÃÍ¤Ï +.BR HUGE_VAL , +.BR HUGE_VALF , +.BR HUGE_VALL +¤È¤Ê¤ë¡£ +.I x +¤ÈƱ¤¸Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 ¤« \-0 ¤Ç¡¢ +.I y +¤¬ 0 ¤è¤ê¾®¤µ¤¯´ñ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢ +¶Ë¥¨¥é¡¼¤¬È¯À¸¤·¡¢ +.\" The pole error is generated at least as far back as glibc 2.4 +ÊÖ¤êÃÍ¤Ï +.BR + HUGE_VAL , +.BR + HUGE_VALF , +.BR + HUGE_VALL +¤È¤Ê¤ë¡£ +.SH ¥¨¥é¡¼ +.\" FIXME . review status of this error +.\" longstanding bug report for glibc: +.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=369 +.\" For negative x, and -large and +large y, glibc 2.8 gives incorrect +.\" results +.\" pow(-0.5,-DBL_MAX)=nan +.\" EDOM FE_INVALID nan; fail-errno fail-except fail-result; +.\" FAIL (expected: range-error-overflow (ERANGE, FE_OVERFLOW); +INF) +.\" +.\" pow(-1.5,-DBL_MAX)=nan +.\" EDOM FE_INVALID nan; fail-errno fail-except fail-result; +.\" FAIL (expected: range-error-underflow (ERANGE, FE_UNDERFLOW); +0) +.\" +.\" pow(-0.5,DBL_MAX)=nan +.\" EDOM FE_INVALID nan; fail-errno fail-except fail-result; +.\" FAIL (expected: range-error-underflow (ERANGE, FE_UNDERFLOW); +0) +.\" +.\" 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) +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼: \fIx\fP ¤¬Éé¤Ç¡¢\fIy\fP ¤¬À°¿ô¤Ç¤Ê¤¤Í­¸ÂÃÍ +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.TP +¶Ë¥¨¥é¡¼: \fIx\fP ¤¬¥¼¥í¤Ç¡¢\fIy\fP ¤¬Éé +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +.\" FIXME . glibc 2.8 gives EDOM +0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_DIVBYZERO ) +¤¬¾å¤¬¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +¶Ë¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.\" +.\" FIXME . this is as at glibc 2.8; check later if this bug is fixed +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776 +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +POSIX.1 ¤Îµ¬Äê¤Ç¤Ï¡¢ +.B ERANGE +¤òÀßÄꤹ¤Ù¤­¤È¤µ¤ì¤Æ¤¤¤ë¡£ + +.I x +¤¬Éé¤Î¾ì¹ç¡¢Â礭¤ÊÀµÉé¤ÎÃͤΠ+.I y +¤¬Í¿¤¨¤é¤ì¤ë¤È¡¢´Ø¿ô¤Î·ë²Ì¤¬ NaN ¤È¤Ê¤ê¡¢ +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¡¢ +ÉÔÀµÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬È¯À¸¤¹¤ë¡£ +Î㤨¤Ð¡¢ +.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 + +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. +¥¢¥ó¥À¡¼¥Õ¥í¡¼¤ä¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¾ì¹ç¡¢ +glibc ¤Î +.BR pow () +¤Ï¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼Îã³°¤ä¥¢¥ó¥À¡¼¥Õ¥í¡¼Îã³°¤ò¾å¤²¤ë¤À¤±¤Ç¤Ê¤¯¡¢ +ÉÔÀµÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤ò´Ö°ã¤Ã¤ÆȯÀ¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR cpow (3), +.BR sqrt (3) diff --git a/release/man3/pow10.3 b/release/man3/pow10.3 new file mode 100644 index 00000000..d8a589df --- /dev/null +++ b/release/man3/pow10.3 @@ -0,0 +1,58 @@ +.\" Copyright 2004 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. +.\" +.\" 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" +.SH ̾Á° +pow10, pow10f, pow10l \- Ä줬 10 ¤ÎÎß¾è´Ø¿ô +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "double pow10(double " x ); +.br +.BI "float pow10f(float " x ); +.br +.BI "long double pow10l(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR pow10 () +´Ø¿ô¤Ï 10 ¤Î \fIx\fP ¾è¤ÎÃͤòÊÖ¤¹¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +¤³¤ì¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.BR exp10 (3) +¤Ç¥ê¥¹¥È¤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤ÈƱ°ì¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR exp10 (3), +.BR pow (3), +.BR feature_test_macros (7) diff --git a/release/man3/printf.3 b/release/man3/printf.3 new file mode 100644 index 00000000..6f7b81bf --- /dev/null +++ b/release/man3/printf.3 @@ -0,0 +1,1014 @@ +.\" Copyright (c) 1999 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. +.\" +.\" +.\" Earlier versions of this page influenced the present text. +.\" It was derived from a Berkeley page with version +.\" @(#)printf.3 6.14 (Berkeley) 7/30/91 +.\" converted for Linux by faith@cs.unc.edu, updated by +.\" Helmut.Geyer@iwr.uni-heidelberg.de, agulbra@troll.no and Bruno Haible. +.\" +.\" 1999-11-25 aeb - Rewritten, using SUSv2 and C99. +.\" 2000-07-26 jsm28@hermes.cam.ac.uk - three small fixes +.\" 2000-10-16 jsm28@hermes.cam.ac.uk - more fixes +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi all rights reserved. +.\" Translated 1998-02-17, YOSHINO Takashi +.\" Updated 2000-10-02, Kentaro Shirakata +.\" Updated 2001-01-29, Kentaro Shirakata +.\" Updated 2002-01-03, Kentaro Shirakata +.\" Updated 2002-10-17, Kentaro Shirakata +.\" Updated 2005-03-15, Akihiro MOTOKI +.\" Updated 2006-07-20, Akihiro MOTOKI +.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 +.\" Updated 2009-03-03, Akihiro MOTOKI , LDP v3.19 +.\" +.\" WORD: conversion specifier ÊÑ´¹»ØÄê»Ò +.\" WORD: length modifier Ťµ½¤¾þ»Ò +.\" +.TH PRINTF 3 2008-12-19 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, +vsnprintf \- »ØÄꤵ¤ì¤¿½ñ¼°¤ËÊÑ´¹¤·¤Æ½ÐÎϤò¹Ô¤¦ +.SH ½ñ¼° +.B #include +.sp +.BI "int printf(const char *" format ", ...);" +.br +.BI "int fprintf(FILE *" stream ", const char *" format ", ...);" +.br +.BI "int sprintf(char *" str ", const char *" format ", ...);" +.br +.BI "int snprintf(char *" str ", size_t " size ", const char *" format ", ...);" +.sp +.B #include +.sp +.BI "int vprintf(const char *" format ", va_list " ap ); +.br +.BI "int vfprintf(FILE *" stream ", const char *" format ", va_list " ap ); +.br +.BI "int vsprintf(char *" str ", const char *" format ", va_list " ap ); +.br +.BI "int vsnprintf(char *" str ", size_t " size ", const char *" format \ +", va_list " ap ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR snprintf (), +.BR vsnprintf (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I "cc -std=c99" +.ad b +.SH ÀâÌÀ +.BR printf () +´Ø¿ô¥°¥ë¡¼¥×¤Ï¡¢°Ê²¼¤Ç½Ò¤Ù¤ë¤è¤¦¤Ë¡¢ +.I format +¤Ë½¾¤Ã¤Æ½ÐÎϤòÀ¸À®¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.BR printf () +¤È +.BR vprintf () +¤Ï½ÐÎϤò +.I stdout +(ɸ½à½ÐÎÏ¥¹¥È¥ê¡¼¥à) ¤Ë½ñ¤­½Ð¤¹¡£ +.BR fprintf () +¤È +.BR vfprintf () +¤Ï½ÐÎϤò»ØÄꤵ¤ì¤¿½ÐÎÏ +.I stream +¤Ë½ñ¤­½Ð¤¹¡£ +.BR sprintf (), +.BR snprintf (), +.BR vsprintf (), +.BR vsnprintf () +¤Ï½ÐÎϤòʸ»úÎó +.IR str +¤Ë½ñ¤­¹þ¤à¡£ +.PP +.BR snprintf () +¤È +.BR vsnprintf () +¤ÏºÇÂç¤Ç +.I size +¥Ð¥¤¥È¤ò +.I str +¤Ë½ñ¤­¹þ¤à +.RI ( size +¤Ë¤Ïʸ»úÎó¤ò½ªÃ¼¤¹¤ë \(aq\e0\(aq ¤â¤ò´Þ¤Þ¤ì¤ë)¡£ +.PP +.BR vprintf (), +.BR vfprintf (), +.BR vsprintf (), +.BR vsnprintf () +¤Î³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.BR printf (), +.BR fprintf (), +.BR sprintf (), +.BR snprintf (), +¤Î³Æ´Ø¿ô¤ÈÅù²Á¤Ç¤¢¤ê¡¢²ÄÊÑ¿ô°ú¤­¿ô¤ÎÂå¤ï¤ê¤Ë +.I va_list +¤ò°ú¤­¿ô¤È¤·¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ç¤Ï +.I va_end +¥Þ¥¯¥í¤Ï¸Æ¤Ó½Ð¤µ¤ì¤Ê¤¤¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I va_arg +¤ò¸Æ¤Ó½Ð¤¹¤Î¤Ç¡¢¸Æ¤Ó½Ð¤·¸å¤Î +.I ap +¤ÎÃͤÏ̤ÄêµÁ¤Ç¤¢¤ë¡£ +.BR stdarg (3) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +¤³¤ì¤é¤Î 8 ¤Ä¤Î´Ø¿ô¤Ï +.I format +ʸ»úÎó¤ÎÀ©¸æ¤Ë½¾¤Ã¤Æ½ÐÎϤò½ñ¤­½Ð¤¹¡£ +.I format +ʸ»úÎó¤Ï¡¢¤³¤ì¤Ë³¤¯°ú¤­¿ô (¤Þ¤¿¤Ï +.BR stdarg (3) +¤Î²ÄÊÑĹ°ú¤­¿ôµ¡¹½¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤Ç¤­¤ë°ú¤­¿ô) +¤ò¤É¤Î¤è¤¦¤ËÊÑ´¹¤·¤Æ½ÐÎϤ¹¤ë¤«¤ò»ØÄꤹ¤ë¡£ + +C99 ¤È POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR sprintf (), +.BR snprintf (), +.BR vsprintf (), +.BR vsnprintf () +¤Î¸Æ¤Ó½Ð¤·¤Ç¡¢ÈϰϤ¬½ÅÊ£¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È´Ö¤Ç¥³¥Ô¡¼¤¬È¯À¸¤¹¤ë¾ì¹ç¤Î +·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë (Î㤨¤Ð¡¢½ÐÎÏÀè¤Îʸ»úÎó¤ÈÆþÎϤµ¤ì¤¿ +°ú¤­¿ô¤Î°ì¤Ä¤¬Æ±¤¸¥Ð¥Ã¥Õ¥¡¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤Ê¤É¤Ç¤¢¤ë)¡£ +¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¡£ +.SS ÊÖ¤êÃÍ +À®¸ù»þ¤Ë¤Ï¡¢¾åµ­¤Î´Ø¿ô¤Ï½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¿ô¤òÊÖ¤¹ +(ʸ»úÎó¤ÎºÇ¸å¤ò¼¨¤¹¤¿¤á¤Ë»ÈÍѤ¹¤ë \(aq\e0\(aq ¤Ï¿ô¤Ë´Þ¤Þ¤ì¤Ê¤¤)¡£ + +.BR snprintf () +¤È +.BR vsnprintf () +¤Ï¡¢ +.I size +¥Ð¥¤¥È¤ò±Û¤¨¤ëʸ»ú¿ô¤ò½ñ¤­¹þ¤Þ¤Ê¤¤ +.RI ( size +¤Ë¤Ïʸ»úÎó¤ò½ªÃ¼¤¹¤ë \(aq\e0\(aq ¤â¤ò´Þ¤Þ¤ì¤ë)¡£ +¤³¤ÎÀ©¸Â¤Ë¤è¤Ã¤Æ½ÐÎϤ¬ÀÚ¤êµÍ¤á¤é¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +¤â¤·½½Ê¬¤Ê¥¹¥Ú¡¼¥¹¤¬¤¢¤ì¤Ð½ñ¤­¹þ¤Þ¤ì¤¿¤Ç¤¢¤í¤¦Ê¸»ú¤Î¸Ä¿ô +(ʸ»úÎó¤ò½ªÃ¼¤¹¤ë \(aq\e0\(aq ¤ò½ü¤¯) ¤òÊÖ¤¹¡£ +½¾¤Ã¤Æ¡¢ÊÖ¤êÃͤ¬ +.I size +°Ê¾å¤À¤Ã¤¿¾ì¹ç¡¢½ÐÎϤ¬ÀÚ¤êµÍ¤á¤é¤ì¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë +(¸å½Ò¤ÎÃí°Õ¤â»²¾È¤Î¤³¤È)¡£ + +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï¡¢Éé¤Î¿ô¤òÊÖ¤¹¡£ +.SS ¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Ïʸ»ú¤ÎÎó¤Ç¡¢ +(¤â¤·¤¢¤ë¤Ê¤é) ½é´ü¥·¥Õ¥È¾õÂ֤ǻϤޤꡢ½é´ü¥·¥Õ¥È¾õÂ֤ǽª¤ï¤ë¡£ +¥Õ¥©¡¼¥Þ¥Ã¥ÈÍѤÎʸ»úÎó¤Ï 0 ¸Ä°Ê¾å¤ÎÌ¿Îá (directives) ¤Ë¤è¤Ã¤Æ¹½À®¤µ¤ì¤ë¡£ +Ì¿Îá¤Ë¤Ï¡¢Ä̾ïʸ»ú¤ÈÊÑ´¹»ØÄê (conversion specifications) ¤¬¤¢¤ë¡£ +Ä̾ïʸ»ú¤Ï +.B % +°Ê³°¤Îʸ»ú¤Ç¡¢½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ë¤½¤Î¤Þ¤Þ¥³¥Ô¡¼¤µ¤ì¤ë¡£ +ÊÑ´¹»ØÄê¤Ï¡¢¤½¤ì¤¾¤ì¤¬ 0 ¸Ä°Ê¾å¤Î°ú¤­¿ô¤ò¼è¤ë¡£ +³ÆÊÑ´¹»ØÄê¤Ïʸ»ú +.B % +¤Ç»Ï¤Þ¤ê¡¢ +.I "ÊÑ´¹»ØÄê»Ò (conversion specifier)" +¤Ç½ª¤ï¤ë¡£ +.B % +¤ÈÊÑ´¹»ØÄê»Ò¤Î´Ö¤Ë¤Ï¡¢0 ¸Ä°Ê¾å¤Î +.I ¥Õ¥é¥° ¡¢ +ºÇ¾® +.I ¥Õ¥£¡¼¥ë¥ÉÉý ¡¢ +.I ÀºÅÙ ¡¢ +.I Ťµ½¤¾þ»Ò +¤ò (¤³¤Î½ç½ø¤Ç) ÃÖ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ + +°ú¤­¿ô¤Ï (·¿¤Î³Ê¾å¤²¤Î¸å¤Ï) ÊÑ´¹»ØÄê»Ò¤¬É½¤¹·¿¤ÈÀµ³Î¤ËÂбþ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢\(aq*\(aq ¤äÊÑ´¹»ØÄê»Ò¤¬½Ð¤Æ¤¯¤ëËè¤Ë¼¡¤Î°ú¤­¿ô¤òÍ׵ᤵ¤ì¡¢ +°ú¤­¿ô¤Ï»ØÄꤵ¤ì¤¿½ç½ø¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤¯ +(»ØÄꤵ¤ì¤¿°ú¤­¿ô¤Î¸Ä¿ô¤¬ÉÔ½½Ê¬¤Ê¤é¥¨¥é¡¼¤È¤Ê¤ë)¡£ +¤Þ¤¿¡¢°ú¤­¿ô¤¬É¬Íפʲսê¤Ç \(aq%\(aq ¤ÎÂå¤ï¤ê¤Ë "%m$"¡¢ +\(aq*\(aq¤ÎÂå¤ï¤ê¤Ë "*m$" ¤È½ñ¤¯¤³¤È¤Ç¡¢ +ÌÀ¼¨Åª¤Ë¤É¤Î°ú¤­¿ô¤ò»ÈÍѤ¹¤ë¤«¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤³¤Ç 10¿Ê¤ÎÀ°¿ô m ¤Ï´õ˾¤Î°ú¤­¿ô¤Î°ú¤­¿ô¥ê¥¹¥È¤Ç¤Î°ÌÃÖ¤ò¼¨¤¹ +(ºÇ½é¤Î°ú¤­¿ô¤ÎÈֹ椬 1 ¤Ç¤¢¤ë)¡£ +½¾¤Ã¤Æ¡¢°Ê²¼¤ÎÆó¤Ä¤ÏÅù²Á¤Ç¤¢¤ë¡£ +.in +4n +.nf + +printf("%*d", width, num); + +printf("%2$*1$d", width, num); + +.fi +.in +¤ÏÅù²Á¤Ç¤¢¤ë¡£ +ÆóÈÖÌܤνñ¤­Êý¤Ç¤ÏƱ¤¸°ú¤­¿ô¤ò·«¤êÊÖ¤·»²¾È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +C99 ɸ½à¤Ë¤Ï¡¢ Single Unix Specification ͳÍè¤Î \(aq$\(aq ¤ò»È¤Ã¤¿½ñ¤­Êý¤Ï´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£ +\(aq$\(aq ¤ò»È¤Ã¤¿¥¹¥¿¥¤¥ë¤ò»È¤¦¤È¡¢°ú¤­¿ô¤ò¼è¤ëÊÑ´¹µÚ¤ÓÉý¤ÈÀºÅ٤ΰú¤­¿ô¤ò +Á´¤Æ¤³¤Î¥¹¥¿¥¤¥ë¤Ç»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤¬¡¢ +°ú¤­¿ô¤ò¾ÃÈñ¤·¤Ê¤¤ "%%" ¥Õ¥©¡¼¥Þ¥Ã¥È¤Èº®¤¶¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +\(aq$\(aq ¤Ç»ØÄꤵ¤ì¤ë°ú¤­¿ô¤ÎÈÖ¹æ¤Ë¶õ¤­¤¬¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +Î㤨¤Ð¡¢¤â¤·°ú¤­¿ô 1 ¤È 3 ¤¬»ØÄꤵ¤ì¤ë¤È¡¢°ú¤­¿ô 2 ¤â¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Î¤É¤³¤«¤Ç +»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +¿ôÃÍÊÑ´¹¤Ë¤Ï¾®¿ôÅÀ¤ä 1000 ñ°Ì¤Î¶èÀÚ¤êʸ»ú¤ò»È¤¦¤â¤Î¤â¤¢¤ë¡£ +¼ÂºÝ¤Ë¤É¤Îʸ»ú¤ò»È¤¦¤«¤Ï¥í¥±¡¼¥ë¤Î +.B LC_NUMERIC +¤Ë¤è¤ë¡£ +POSIX ¥í¥±¡¼¥ë¤Ç¤Ï¾®¿ôÅÀ¤Ë \(aq.\(aq ¤òÍѤ¤¡¢ +¶èÀÚ¤êʸ»ú¤Ï»È¤ï¤Ê¤¤¡£ +½¾¤Ã¤Æ¡¢ +.in +4n +.nf + +printf("%\(aq.2f", 1234567.89); + +.fi +.in +¤Ï¡¢ POSIX ¥í¥±¡¼¥ë¤Ç¤Ï "1234567.89" ¡¢ nl_NL ¥í¥±¡¼¥ë¤Ç¤Ï "1234567,89"¡¢ +da_DK ¥í¥±¡¼¥ë¤Ç¤Ï "1.234.567,89" ¤È¤Ê¤ë¡£ +.SS ¥Õ¥é¥°Ê¸»ú +% ʸ»ú¤Î¸å¤í¤Ë¤Ï 0 ¸Ä°Ê¾å¤Î¥Õ¥é¥°Ê¸»ú¤¬Â³¤¯¡£ +.TP +.B # +ÃͤϡÖÊ̤ηÁ¼°¡×¤ËÊÑ´¹¤µ¤ì¤ë¡£ +.B o +ÊÑ´¹¤Î¾ì¹ç¡¢(ÀèƬʸ»ú¤¬ 0 ¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤ËÀèƬ¤Ë 0 ¤òÄɲ乤뤳¤È¤Ç) +½ÐÎÏʸ»úÎó¤ÎºÇ½é¤Îʸ»ú¤ò 0 ¤Ë¤¹¤ë¡£ +.B x +¤È +.B X +ÊÑ´¹¤Î¾ì¹ç¡¢¿ôÃͤ¬ 0 ¤Ç¤Ê¤¤¤È¤­¤Ë¤Ïʸ»úÎó "0x" +.RB ( X +ÊÑ´¹¤Î¾ì¹ç¤Ë¤Ï "0X") ¤¬Á°¤ËÉÕÍ¿¤µ¤ì¤ë¡£ +.BR a , +.BR A , +.BR e , +.BR E , +.BR f , +.BR F , +.BR g , +.B G +ÊÑ´¹¤Ç¤Ï¡¢ ¾®¿ôÅÀ¤Ë³¤¯¿ô»ú¤¬¤Ê¤¯¤Æ¤â¡¢ +½ÐÎϤˤϾï¤Ë¾®¿ôÅÀ¤¬´Þ¤Þ¤ì¤ë +(Ä̾ï¤Ï¡¢¾®¿ôÅÀ¤Î¸å¤Ë¿ô»ú¤¬Â³¤¯¾ì¹ç¤Ë¤Î¤ß¡¢ +¾®¿ôÅÀ¤¬É½¼¨¤µ¤ì¤ë)¡£ +.B g +¤È +.B G +ÊÑ´¹¤Î¾ì¹ç¡¢Â¾¤ÎÊÑ´¹¤È¤Ï°Û¤Ê¤ê¡¢ËöÈø¤Î¥¼¥í¤¬ÊÑ´¹·ë²Ì¤«¤éºï½ü¤µ¤ì¤Ê¤¤¡£ +¤½¤Î¾¤ÎÊÑ´¹¤Ç¤Ï¡¢·ë²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.TP +.B \&0 +Ãͤò¥¼¥í¤ÇËä¤á¤ë¡£ +.BR d , +.BR i , +.BR o , +.BR u , +.BR x , +.BR X , +.BR a , +.BR A , +.BR e , +.BR E , +.BR f , +.BR F , +.BR g , +.B G +ÊÑ´¹¤Ç¤Ï¡¢ÊÑ´¹¤·¤¿Ãͤκ¸Â¦¤ò¶õÇòʸ»ú¤ÎÂå¤ï¤ê¤Ë¥¼¥í¤ÇËä¤á¤ë¡£ +.B \&0 +¤È +.B \- +¤¬Î¾Êý¤È¤â»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +.B \&0 +¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë¡£ +ÀºÅÙ¤¬¿ôÃÍÊÑ´¹ +.RB ( d , +.BR i , +.BR o , +.BR u , +.BR x , +.BR X ) +¤ÈƱ»þ¤Ë»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +.B \&0 +¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë¡£ +¤½¤Î¾¤ÎÊÑ´¹¤Ç¤Ï¡¢Æ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.TP +.B \- +ÊÑ´¹Ãͤò¥Õ¥£¡¼¥ë¥É¶­³¦¤Çº¸Â·¤¨¤Ë¤¹¤ë +(¥Ç¥Õ¥©¥ë¥È¤Ï±¦Â·¤¨¤Ç¤¢¤ë)¡£ +.B n +ÊÑ´¹°Ê³°¤Ç¤Ï¡¢ÊÑ´¹¤µ¤ì¤¿ÃÍ¤Ï +º¸Â¦¤Ç¤Ï¤Ê¤¯±¦Â¦¤ò¶õÇòʸ»ú¤ä¥¼¥í¤ÇËä¤á¤é¤ì¤ë¡£ +.B \- +¤È +.B \&0 +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +.B \- +¤¬Í¥À褵¤ì¤ë¡£ +.TP +.B ' ' +(1¸Ä¤ÎȾ³Ñ¥¹¥Ú¡¼¥¹) +Éä¹æÉÕ¤­ÊÑ´¹¤ÇÀ¸À®¤µ¤ì¤¿Àµ¤Î¿ô»ú¤ÎÁ°¤Ë¶õÇò (¤Þ¤¿¤Ï¶õʸ»úÎó) ¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.B + +Éä¹æÉÕ¤­ÊÑ´¹¤Ë¤è¤Ã¤Æ½ÐÎϤµ¤ì¤ë¿ô»ú¤ÎÁ°¤Ë¡¢¾ï¤ËÉä¹æ (+ ¤« \-) ¤¬ÃÖ¤«¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢Éä¹æ¤ÏÉé¤Î¿ô»ú¤Î¾ì¹ç¤Î¤ßÉÕÍ¿¤µ¤ì¤ë¡£ +.B + +¤ÈȾ³Ñ¥¹¥Ú¡¼¥¹¤Î +ξÊý¤¬»È¤ï¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +.B + +¤¬Í¥À褵¤ì¤ë¡£ +.PP +¾åµ­¤Î 5 ¤Ä¤Î¥Õ¥é¥°¤Ï C ɸ½à¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +SUSv2 ¤Ç¤Ï¡¢¤µ¤é¤Ë¤â¤¦°ì¤Ä¥Õ¥é¥°Ê¸»ú¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.TP +.B \(aq +10¿Ê¿ôÊÑ´¹ +.RB ( i , +.BR d , +.BR u , +.BR f , +.BR F , +.BR g , +.BR G ) +¤Ë¤ª¤¤¤Æ¡¢¥í¥±¡¼¥ë¾ðÊó¤Ë»ØÄ꤬¤¢¤ì¤Ð 1000 ñ°Ì¤Î¶èÀÚ¤êʸ»ú¤ò½ÐÎϤ¹¤ë¡£ +.BR gcc (1) +¤Î¿¤¯¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò²ò¼á¤¹¤ë¤³¤È¤¬¤Ç¤­¤º¡¢ +·Ù¹ð¤ò½ÐÎϤ¹¤ë¤³¤È¤ËÃí°Õ¤»¤è¡£ +%\(aqF ¤Ï SUSv2 ¤Ë¤Ï´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +glibc 2.2 ¤Ç¤Ï¡¢¤µ¤é¤Ë°ì¤Ä¥Õ¥é¥°Ê¸»ú¤¬Äɲ䵤ì¤Æ¤¤¤ë¡£ +.TP +.B I +10¿ÊÀ°¿ôÊÑ´¹ +.RB ( i , +.BR d , +.BR u ) +¤Ë¤ª¤¤¤Æ¡¢¥í¥±¡¼¥ë¤ÎÂåÂؽÐÎÏ¿ô»ú¤¬¤¢¤ì¤Ð¡¢¤½¤ì¤òÍѤ¤¤Æ½ÐÎϤ¹¤ë¡£ +Î㤨¤Ð¡¢ glibc 2.2.3 °Ê¹ß¤Ç¤Ï¡¢¥Ú¥ë¥·¥¢ ("fa_IR") ¥í¥±¡¼¥ë¤Ç +¥¢¥é¥Ó¥¢¿ô»ú (Arabic-Indic digits) ¤ò½ÐÎϤǤ­¤ë¡£ +.\" ¥í¥±¡¼¥ë¥Õ¥¡¥¤¥ë¤Ë¤Ï outdigits ¤È¤¤¤¦¥­¡¼¥ï¡¼¥É¤¬¤¢¤ë¡£ +.SS ¥Õ¥£¡¼¥ë¥ÉÉý +ºÇ¾®¤Î¥Õ¥£¡¼¥ë¥ÉÉý¤ò»ØÄꤹ¤ë 10¿Ê¿ô¤Î¿ôÃÍʸ»úÎó (ʸ»úÎó¤ÎºÇ½é¤Îʸ»ú¤Ï +¥¼¥í°Ê³°)¡£ËܹàÌܤϥª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +ÊÑ´¹¤µ¤ì¤¿ÃͤÎʸ»ú¿ô¤¬¥Õ¥£¡¼¥ë¥ÉŤè¤ê¤â¾¯¤Ê¤¤¾ì¹ç¡¢ +¥Õ¥£¡¼¥ë¥É¤Îº¸Â¦¤ò¥¹¥Ú¡¼¥¹¤ÇËä¤á¤ë +(º¸Â·¤¨¤Î¥Õ¥é¥°¤¬¤¢¤ë¾ì¹ç¤Ï±¦Â¦¤òËä¤á¤ë)¡£ +10¿Ê¿ô¤Îʸ»úÎó¤ÎÂå¤ï¤ê¤Ë "*" ¤ä "*m$" (\fIm\fP ¤Ï 10¿ÊÀ°¿ô) ¤ò½ñ¤¯¤³¤È¤â¤Ç¤­¤ë¡£ +"*" ¤È "*m$" ¤Ï¤½¤ì¤¾¤ì¡¢¼¡¤Î°ú¤­¿ô¤È \fIm\fP ÈÖÌܤΰú¤­¿ô¤ò¥Õ¥£¡¼¥ë¥ÉÉý¤È¤·¤Æ +»È¤¦¤³¤È¤ò»ØÄꤹ¤ë (¤³¤ì¤é¤Î°ú¤­¿ô¤Ï +.I int +·¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ +¥Õ¥£¡¼¥ë¥ÉÉý¤ËÉé¤Î¿ô¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +\(aq\-\(aq ¥Õ¥é¥°¤ÈÀµ¤Î¿ô¤Î¥Õ¥£¡¼¥ë¥ÉÉý¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +¥Õ¥£¡¼¥ë¥ÉÉý¤¬¾®¤µ¤«¤Ã¤¿¤ê»ØÄ꤬¤Ê¤«¤Ã¤¿¤ê¤·¤Æ¤â¡¢¥Õ¥£¡¼¥ë¥É¤¬ÀÚ¤êµÍ¤á¤é¤ì¤ë +¤³¤È¤Ï¤Ê¤¤¡£¤â¤·ÊÑ´¹·ë²Ì¤¬¥Õ¥£¡¼¥ë¥ÉÉý¤è¤ê¤â¹­¤«¤Ã¤¿¾ì¹ç¡¢ +¥Õ¥£¡¼¥ë¥É¤ÏÊÑ´¹·ë²Ì¤¬Æþ¤ëÉý¤Ë¹­¤²¤é¤ì¤ë¡£ +.SS ÀºÅÙ +¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ëÀºÅ٤ϡ¢¥Ô¥ê¥ª¥É (\(aq.\(aq) ¤È¤½¤ì¤Ë³¤¯10¿Ê¿ô¤È¤¤¤¦ +·Á¼°¤Ç»ØÄꤹ¤ë (10¿Ê¿ô¤Ï¥ª¥×¥·¥ç¥ó) ¡£ +10¿Ê¿ô¤Îʸ»úÎó¤ÎÂå¤ï¤ê¤Ë "*" ¤ä "*m$" (m ¤Ï 10 ¿ÊÀ°¿ô)¤ò½ñ¤¯¤³¤È¤â¤Ç¤­¤ë¡£ +"*" ¤È "*m$" ¤Ï¤½¤ì¤¾¤ì¡¢¼¡¤Î°ú¤­¿ô¤È m ÈÖÌܤΰú¤­¿ô¤òÀºÅ٤Ȥ·¤Æ +»È¤¦¤³¤È¤ò»ØÄꤹ¤ë (¤³¤ì¤é¤Î°ú¤­¿ô¤Ï +.I int +·¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ +ÀºÅ٤Ȥ·¤Æ \(aq.\(aq ¤À¤±¤¬»ØÄꤵ¤ì¤¿¤ê¡¢ÀºÅÙ¤¬Éé¤Î¿ô¤À¤Ã¤¿¾ì¹ç¡¢ +ÀºÅ٤ϥ¼¥í¤È¤ß¤Ê¤µ¤ì¤ë¡£ +.BR d , +.BR i , +.BR o , +.BR u , +.BR x , +.B X +ÊÑ´¹¤Ç¤Ï¡¢É½¼¨¤µ¤ì¤ëºÇ¾®¤Î·å¿ô¤ò»ØÄꤹ¤ë¡£ +.BR a , +.BR A , +.BR e , +.BR E , +.BR f , +.B F +ÊÑ´¹¤Ç¤Ï¡¢¾®¿ôÅÀ°Ê²¼¤Ëɽ¼¨¤µ¤ì¤ë¿ô»ú¤Î·å¿ô¤ò»ØÄꤹ¤ë¡£ +.B g +¤È +.B G +ÊÑ´¹¤Ç¤Ï¡¢Í­¸ú¿ô»ú¤ÎºÇÂç·å¿ô¤ò»ØÄꤹ¤ë¡£ +.B s +¤È +.B S +ÊÑ´¹¤Ç¤Ï¡¢Ê¸»úÎ󤫤é½ÐÎϤµ¤ì¤ëºÇÂçʸ»ú¿ô¤ò»ØÄꤹ¤ë¡£ +.SS Ťµ½¤¾þ»Ò +¡ÖÀ°¿ôÊÑ´¹¡×¤È¤Ï¡¢ +.BR d , +.BR i , +.BR o , +.BR u , +.BR x , +.B X +ÊÑ´¹¤Î¤³¤È¤Ç¤¢¤ë¡£ +.TP +.B hh +À°¿ôÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I signed char +¤« +.I unsigned char +¤Ç¡¢ +.B n +ÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I signed char +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.B h +À°¿ôÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I short int +¤« +.I unsigned short int +¤Ç¡¢ +.B n +ÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I short int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.BR l " (¥¨¥ë)" +³ÆÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬¡¢ +À°¿ôÊÑ´¹¤Ç¤Ï +.IR "long int" ¤« +.IR "unsigned long int" ¡¢ +.B n +ÊÑ´¹¤Ç¤Ï +.I long long int +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¢ +.B c +ÊÑ´¹¤Ç¤Ï +.IR wint_t ¡¢ +.B s +ÊÑ´¹¤Ç¤Ï +.I wchar_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ + +.TP +.BR ll " (¥¨¥ë¥¨¥ë)" +À°¿ôÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I long long int +¤« +.I unsigned long long int +¤Ç¡¢ +.B n +ÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I long int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.B L +.BR a , +.BR A , +.BR e , +.BR E , +.BR f , +.BR F , +.BR g , +.B G +ÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I long double +¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +(C99 ¤Ç¤Ï %LF ¤ò»È¤¦¤³¤È¤òǧ¤á¤Æ¤¤¤ë¤¬¡¢SUSv2 ¤Ç¤Ïǧ¤á¤é¤ì¤Æ¤¤¤Ê¤¤¡£) +.TP +.B q +("quad"¡£ 4.4BSD ¤È Linux libc5 ¤Î¤ßÍ­¸ú¡£»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£) +.B ll +¤ÈƱ¤¸°ÕÌ£¤Ç¤¢¤ë¡£ +.TP +.B j +À°¿ôÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I intmax_t +¤« +.I uintmax_t +¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.B z +À°¿ôÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I size_t +¤« +.I ssize_t +¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +(Linux libc5 ¤Ç¤Ï¡¢¤³¤ì¤ò»ØÄꤹ¤ë¤Î¤Ë +.B Z +¤òÍѤ¤¤ë¡£»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£) +.TP +.B t +À°¿ôÊÑ´¹¤ËÂбþ¤¹¤ë°ú¤­¿ô¤¬ +.I ptrdiff_t +¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.PP +SUSv2 ¤ÇŤµ½¤¾þ»Ò¤È¤·¤Æ»ÈÍѤǤ­¤ë¤Î¤Ï¡¢ +.B h +.RB ( hd , +.BR hi , +.BR ho , +.BR hx , +.BR hX , +.BR hn ), +.B l +.RB ( ld , +.BR li , +.BR lo , +.BR lx , +.BR lX , +.BR ln , +.BR lc , +.BR ls ), +.B L +.RB ( Le , +.BR LE , +.BR Lf , +.BR Lg , +.BR LG ) +¤À¤±¤Ç¤¢¤ë¡£ +.SS ÊÑ´¹»ØÄê»Ò +ŬÍѤµ¤ì¤ëÊÑ´¹¤Î·¿¤ò»ØÄꤹ¤ëʸ»ú¡£ +.PP +ÊÑ´¹»ØÄê»Ò¤È¤½¤Î°ÕÌ£¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.TP +.BR d ", " i +.I int +°ú¤­¿ô¤òÉä¹æÉÕ¤­ 10 ¿Êɽµ­¤ËÊÑ´¹¤¹¤ë¡£ +ÀºÅÙ»ØÄ꤬¤¢¤ì¤Ð¡¢ÀºÅ٤ǻØÄꤷ¤¿·å¿ô¤Ïɬ¤º½ÐÎϤµ¤ì¤ë¡£ÊÑ´¹¸å¤ÎÃͤ¬ +»ØÄꤵ¤ì¤¿·å¿ô¤Ë­¤ê¤Ê¤¤¾ì¹ç¤Ï¡¢º¸Â¦¤¬ 0 ¤ÇËä¤á¤é¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÀºÅÙ¤Ï 1 ¤Ç¤¢¤ë¡£ +0 ¤òɽ¼¨¤·¤è¤¦¤È¤·¤¿»þ¤Ë¡¢ÌÀ¼¨Åª¤ËÀºÅ٤Ȥ·¤Æ 0 ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢ +½ÐÎϤ϶õʸ»úÎó¤È¤Ê¤ë¡£ +.TP +.BR o ", " u ", " x ", " X +.I "unsigned int" +°ú¤­¿ô¤ò¡¢ +Éä¹æ¤Ê¤·8¿Ê¿ô +.RB ( o ), +Éä¹æ¤Ê¤·10¿Ê¿ô +.RB ( u ), +Éä¹æ¤Ê¤·16¿Ê¿ô +.RB ( x +¤È +.BR X ) +¤ËÊÑ´¹¤¹¤ë¡£ +.B x +ÊÑ´¹¤Ç¤Ï +.B abcdef +¤¬»ÈÍѤµ¤ì¡¢ +.B X +ÊÑ´¹¤Ç¤Ï +.B ABCDEF +¤¬»ÈÍѤµ¤ì¤ë¡£ +ÀºÅÙ»ØÄ꤬¤¢¤ì¤Ð¡¢ÀºÅ٤ǻØÄꤷ¤¿·å¿ô¤Ïɬ¤º½ÐÎϤµ¤ì¤ë¡£ÊÑ´¹¸å¤ÎÃͤ¬ +»ØÄꤵ¤ì¤¿·å¿ô¤Ë­¤ê¤Ê¤¤¾ì¹ç¤Ï¡¢º¸Â¦¤¬ 0 ¤ÇËä¤á¤é¤ì¤ë¡£ +.TP +.BR e ", " E +.I double +°ú¤­¿ô¤ò´Ý¤á¤Æ +.if \w'\*(Pm'=0 .ds Pm \(+- +.RB [\-]d \&. ddd e \\*(Pmdd +¤Î·Á¤ËÊÑ´¹¤¹¤ë¡£ +¾®¿ôÅÀ¤ÎÁ°¤Ë¤Ï°ì·å¤Î¿ô»ú¤¬¤¢¤ê¡¢¾®¿ôÅÀ°Ê²¼¤Î·å¿ô¤ÏÀºÅ٤ǻØÄꤵ¤ì¤¿ +·å¿ô¤Ë¤Ê¤ë¡£ÀºÅ٤ϻØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç 6 ¤È¤ß¤Ê¤µ¤ì¤ë¡£ +ÀºÅÙ¤¬ 0 ¤Î¾ì¹ç¤Ë¤Ï¡¢¾®¿ôÅÀ°Ê²¼¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¡£ +.B E +ÊÑ´¹¤Ç¤Ï¡¢»Ø¿ô¤òɽ¸½¤¹¤ë¤È¤­¤Ë +.RB ( e +¤Ç¤Ï¤Ê¤¯) +.B E +¤¬»È¤ï¤ì¤ë¡£ +»Ø¿ôÉôʬ¤Ï¾¯¤Ê¤¯¤È¤â 2·åɽ¼¨¤µ¤ì¤ë¡£ +¤Ä¤Þ¤ê¡¢»Ø¿ô¤ÎÃͤ¬ 0 ¤Î¾ì¹ç¤Ë¤Ï¡¢00 ¤Èɽ¼¨¤µ¤ì¤ë¡£ +.TP +.BR f ", " F +.I double +°ú¤­¿ô¤ò´Ý¤á¤Æ +.RB [\-]ddd \&. ddd +¤Î·Á¤Î10¿Êɽ¸½¤ËÊÑ´¹¤¹¤ë¡£ +¾®¿ôÅÀ¤Î¸å¤Î·å¿ô¤Ï¡¢ÀºÅ٤ǻØÄꤵ¤ì¤¿ÃͤȤʤ롣 +ÀºÅÙ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï 6 ¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +ÀºÅ٤Ȥ·¤ÆÌÀ¼¨Åª¤Ë 0 ¤¬»ØÄꤵ¤ì¤¿¤È¤­¤Ë¤Ï¡¢¾®¿ôÅÀ°Ê²¼¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¡£ +¾®¿ôÅÀ¤òɽ¼¨¤¹¤ëºÝ¤Ë¤Ï¡¢¾®¿ôÅÀ¤ÎÁ°¤Ë¾¯¤Ê¤¯¤È¤â°ì·å¤Ï¿ô»ú¤¬É½¼¨¤µ¤ì¤ë¡£ + +(SUSv2 ¤Ç¤Ï¡¢ +.B F +¤Ïµ¬Äꤵ¤ì¤Æ¤ª¤é¤º¡¢Ìµ¸Â¤ä NaN ¤Ë´Ø¤¹¤ëʸ»úÎóɽ¸½¤ò +¹Ô¤Ã¤Æ¤â¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ + C99 ɸ½à¤Ç¤Ï¡¢ +.B f +ÊÑ´¹¤Ç¤Ï¡¢Ìµ¸Â¤Ï "[\-]inf" ¤« "[\-]infinity" ¤Èɽ¼¨¤·¡¢ +NaN ¤Ïʸ»úÎó¤ÎÀèƬ¤Ë `nan' ¤ò¤Ä¤±¤Æɽ¼¨¤¹¤ë¤è¤¦¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.B F +ÊÑ´¹¤Î¾ì¹ç¤Ï "[\-]INF", "[\-]INFINITY", "NAN*" ¤Èɽ¼¨¤µ¤ì¤ë¡£) +.TP +.BR g ", " G +.I double +°ú¤­¿ô¤ò +.B f +¤« +.B e +.RB ( G +ÊÑ´¹¤Î¾ì¹ç¤Ï +.B F +¤« +.BR E ) +¤Î·Á¼°¤ËÊÑ´¹¤¹¤ë¡£ +ÀºÅÙ¤Ïɽ¼¨¤¹¤ë·å¿ô¤ò»ØÄꤹ¤ë¡£ +ÀºÅÙ¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢6·å¤È¤ß¤Ê¤µ¤ì¤ë¡£ +ÀºÅÙ¤¬ 0 ¤Î¾ì¹ç¤Ï¡¢1·å¤È¤ß¤Ê¤µ¤ì¤ë¡£ +ÊÑ´¹¤µ¤ì¤ëÃͤλؿô¤¬¡¢ \-4 ¤è¤ê¾®¤µ¤¤¤«¡¢ÀºÅٰʾå¤Î¾ì¹ç¤Ë¡¢ +.B e +·Á¼°¤¬»ÈÍѤµ¤ì¤ë¡£ +ÊÑ´¹¤µ¤ì¤¿·ë²Ì¤Î¾®¿ôÉôʬ¤ÎËöÈø¤Î 0 ¤Ïºï½ü¤µ¤ì¤ë¡£¾®¿ôÅÀ¤¬É½¼¨¤µ¤ì¤ë¤Î¤Ï¡¢ +¾®¿ôÅÀ°Ê²¼¤Ë¿ô»ú¤¬¾¯¤Ê¤¯¤È¤â°ì¤Ä¤¢¤ë¾ì¹ç¤Ë¤À¤±¤Ç¤¢¤ë¡£ +.TP +.BR a ", " A +(C99 ¤Ë¤Ï¤¢¤ë¤¬ SUSv2 ¤Ë¤Ï¤Ê¤¤) +.B a +ÊÑ´¹¤Ç¤Ï¡¢ +.I double +°ú¤­¿ô¤ò (abcdef ¤Îʸ»ú¤ò»È¤Ã¤Æ) +.RB [\-] 0x h \&. hhhh p \\*(Pmd; +·Á¼°¤Î 16 ¿Êɽµ­¤ËÊÑ´¹¤¹¤ë¡£ +.B A +ÊÑ´¹¤Ç¤Ï¡¢Á°ÃÖʸ»úÎó +.BR 0X , +ʸ»ú ABCDEF, »Ø¿ôʸ»ú +.B P +¤òÍѤ¤¤ë¡£ +¾®¿ôÅÀ¤ÎÁ°¤Ë¤Ï 1·å¤Î16¿Ê¿ô¤¬ÃÖ¤«¤ì¡¢¾®¿ôÅÀ¤Î¸å¤í¤Î·å¿ô¤Ï +ÀºÅ٤ǻØÄꤵ¤ì¤¿ÃͤȤʤ롣 +¥Ç¥Õ¥©¥ë¥È¤ÎÀºÅ٤ϡ¢¤½¤ÎÃͤ¬ 2¿Ê¿ô¤ÇÀµ³Î¤Ëɽ¸½¤Ç¤­¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤½¤ÎÃͤòÀµ³Î¤Ëɽ¸½¤Ç¤­¤ë·å¿ô¤È¤Ê¤ë¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢ +.I double +·¿¤ÎÃͤò¶èÊ̤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤È¤Ê¤ë¡£ +.\" motoki 2005/03/19: ¹ç¤Ã¤Æ¤¤¤ë¤«¤Ê¡© +¾®¿ôÅÀ¤ÎÁ°¤Î¿ô»ú¤Ï¡¢Àµµ¬²½¤µ¤ì¤Æ¤¤¤Ê¤¤¿ô¤Î¾ì¹ç¤Ï¤¤¤¯¤Ä¤Ë¤Ê¤ë¤«Ê¬¤«¤é¤Ê¤¤¡£ +Àµµ¬²½¤µ¤ì¤¿¿ô¤Î¾ì¹ç¤Ï¡¢ 0 °Ê³°¤ÎÃͤˤʤ뤬¡¢¤¤¤¯¤Ä¤Ë¤Ê¤ë¤«¤Ïʬ¤«¤é¤Ê¤¤¡£ +.TP +.B c +.B l +½¤¾þ»Ò¤¬¤Ê¤±¤ì¤Ð¡¢ +.I int +°ú¤­¿ô¤ò +.IR "unsigned char" +¤ËÊÑ´¹¤·¤Æ¡¢¤½¤Î·ë²Ì¤ËÂбþ¤¹¤ëʸ»ú¤ò½ÐÎϤ¹¤ë¡£ +.B l +½¤¾þ»Ò¤¬¤¢¤ì¤Ð¡¢ +.I wint_t +(¥ï¥¤¥Éʸ»ú) °ú¤­¿ô¤ò¡¢ +.BR wcrtomb (3) +´Ø¿ô¤ò½é´ü¥·¥Õ¥È¾õÂ֤ǸƤӽФ·¤Æ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤·¡¢ +ÊÑ´¹¤µ¤ì¤¿¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò½ÐÎϤ¹¤ë¡£ +.TP +.B s +.B l +½¤¾þ»Ò¤¬¤Ê¤¤¾ì¹ç¡¢ +°ú¤­¿ô¤Ï +.I "const char *" +·¿¤Çʸ»ú·¿¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ (ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿) ¤Ç¤¢¤ë¤³¤È¤¬ +´üÂÔ¤µ¤ì¤Æ¤¤¤ë¡£ÇÛÎóÃæ¤Îʸ»ú¤Ï¡¢½ªÃ¼¤Î NULL ¥Ð¥¤¥È (\(aq\\0\(aq) +¤¬½Ð¤Æ¤¯¤ë¤Þ¤Ç½ÐÎϤµ¤ì¤ë (½ªÃ¼Ê¸»ú¤Ï½ÐÎϤµ¤ì¤Ê¤¤)¡£ +ÀºÅÙ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢»ØÄꤵ¤ì¤¿»ú¿ô°Ê¾å¤Ï½ÐÎϤµ¤ì¤Ê¤¤¡£ +ÀºÅÙ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢½ªÃ¼¥Ð¥¤¥È¤¬Â¸ºß¤¹¤ëɬÍפϤʤ¤¡£ +ÀºÅÙ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤ê¡¢ÀºÅÙ¤ÎÃͤ¬ÇÛÎó¤ÎÂ礭¤µ¤è¤êÂ礭¤¤¾ì¹ç¤Ë¤Ï¡¢ +ÇÛÎó¤Ï½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ò´Þ¤ó¤Ç¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.B l +½¤¾þ»Ò¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +°ú¤­¿ô¤Ï +.I "const wchar_t *" +·¿¤Ç¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤¬´üÂÔ¤µ¤ì¤Æ¤¤¤ë¡£ +ÇÛÎóÃæ¤Î¥ï¥¤¥Éʸ»ú¤Ï (1ʸ»úËè¤Ë +.BR wcrtomb (3) +¤ò¸Æ¤Ó½Ð¤·¤Æ) ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ËÊÑ´¹¤µ¤ì¤ë +(ºÇ½é¤Î¥ï¥¤¥Éʸ»ú¤ÎÊÑ´¹¤ÎÁ°¤Ë +.BR wcrtomb () +¤Î¥·¥Õ¥È¾õÂÖ¤ò½é´ü¾õÂÖ¤ËÌᤷ¤Æ¤«¤éÊÑ´¹¤Ï¹Ô¤ï¤ì¤ë)¡£ +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Ø¤ÎÊÑ´¹¤Ï¡¢Ê¸»úÎó¤ò½ªÃ¼¤¹¤ë NULL ¥ï¥¤¥Éʸ»ú¤¬ +½Ð¤Æ¤¯¤ë¤Þ¤Ç¹Ô¤ï¤ì¡¢½ªÃ¼ NULL ¥ï¥¤¥Éʸ»ú¤â´Þ¤á¤ÆÊÑ´¹¤µ¤ì¤ë¡£ +·ë²Ì¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤Ï¡¢½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤¬½Ð¤Æ¤¯¤ë¤Þ¤Ç +½ÐÎϤµ¤ì¤ë (½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤Ï½ÐÎϤµ¤ì¤Ê¤¤)¡£ +ÀºÅÙ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢»ØÄꤵ¤ì¤¿¥Ð¥¤¥È¿ô°Ê¾å¤Ë¤Ï½ÐÎϤµ¤ì¤Ê¤¤¡£ +⤷¡¢¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Î°ìÉôʬ¤À¤±¤¬½ÐÎϤµ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +ÀºÅ٤ϡ֥Х¤¥È¡×¿ô¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ê¡¢¡Ö¥ï¥¤¥Éʸ»ú¡×¿ô¤ä +¡Ö²èÌ̤ǤΰÌÃ֡פò»ØÄꤹ¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¤³¤È¤ËÃí°Õ¡£ +ÀºÅÙ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢¤µ¤é¤Ë½ÐÎϤ¬ÇÛÎó¤ÎËöÈø¤Ë㤹¤ëÁ°¤Ë½ÐÎϥХ¤¥È¿ô¤¬ +ÀºÅÙ¤ÎÃͤòĶ¤¨¤ë¾ì¹ç¤À¤±¤Ï¡¢ÇÛÎó¤Ï NULL ¥ï¥¤¥Éʸ»ú¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤â¤è¤¤¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢É¬¤ºÇÛÎó¤Ï NULL ¥ï¥¤¥Éʸ»ú¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B C +(C99 ¤Ë¤Ï¤Ê¤¤¤¬ SUSv2 ¤Ë¤Ï¤¢¤ë) +.B lc +¤ÈƱ¤¸¡£»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.B S +(C99 ¤Ë¤Ï¤Ê¤¤¤¬ SUSv2 ¤Ë¤Ï¤¢¤ë) +.B ls +¤ÈƱ¤¸¡£»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.B p +.I "void *" +¥Ý¥¤¥ó¥¿°ú¤­¿ô¤ò +.RB ( %#x +¤ä +.BR %#lx +¤Î¤è¤¦¤Ê) 16 ¿Ê¿ô¤Ç½ÐÎϤ¹¤ë¡£ +.TP +.B n +¤³¤ì¤Þ¤Ç¤Ë½ÐÎϤµ¤ì¤¿Ê¸»ú¿ô¤ò +.I "int *" +(¤Þ¤¿¤ÏÎà»÷¤Î·¿) ¤Î¥Ý¥¤¥ó¥¿°ú¤­¿ô¤¬»Ø¤¹À°¿ô¤ËÊݸ¤¹¤ë¡£ +°ú¤­¿ô¤ÎÊÑ´¹¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +.TP +.B m +(glibc ¤Ç¤Î³ÈÄ¥) +.I strerror(errno) +¤Î½ÐÎϤòɽ¼¨¤¹¤ë¡£°ú¤­¿ô¤ÏɬÍפʤ¤¡£ +.TP +.B % +\(aq%\(aq ʸ»ú¤ò½ÐÎϤ¹¤ë¡£ÊÑ´¹¤µ¤ì¤ë°ú¤­¿ô¤Ï̵¤¤¡£ +ÊÑ´¹»ØÄêÁ´ÂΤò½ñ¤¯¤È "%%" ¤È¤Ê¤ë¡£ +.SH ½àµò +.BR fprintf (), +.BR printf (), +.BR sprintf (), +.BR vprintf (), +.BR vfprintf (), +.BR vsprintf () +´Ø¿ô¤Ï¡¢C89 ¤È C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR snprintf () +¤È +.BR vsnprintf () +¤Ï C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.PP +.BR snprintf () +¤ÎÊÖ¤êÃͤò¸«¤ë¤È¡¢ +SUSv2 ¤È C99 ɸ½à¤Ï¸ß¤¤¤ËÌ·½â¤·¤Æ¤¤¤ë¡£ +SUSv2 ¤Ç¤Ï¡¢ +.BR snprintf () +¤¬ +.IR size =0 +¤Ç¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢ 1 ̤Ëþ¤ÎÃͤò²¿¤«ÊÖ¤êÃͤȤ¹¤ë¤è¤¦¤Ëµ¬Äꤷ¤Æ¤¤¤ë¡£ +°ìÊý C99 ¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤Ê¾ì¹ç +.I str +¤ò NULL ¤È¤·¡¢ÊÖ¤êÃͤȤ·¤Æ (Ä̾ïÄ̤ê) ½ÐÎϥХåե¡¤¬½½Ê¬¤ÊÂ礭¤µ¤¬ +¤¢¤Ã¤¿¾ì¹ç¤Ë½ÐÎϤµ¤ì¤ë¤Ç¤¢¤í¤¦Ê¸»ú¿ô¤òÊÖ¤¹¡£ +.PP +Linux libc4 ¤Ç¤Ï¡¢ 5 ¤Ä¤Î C ɸ½à¤Î¥Õ¥é¥°¡¢ +Ťµ½¤¾þ»Ò \fBh\fP, \fBl\fP, \fBL\fP¡¢ÊÑ´¹ +\fBc\fP, \fBd\fP, \fBe\fP, \fBE\fP, \fBf\fP, \fBF\fP, +\fBg\fP, \fBG\fP, \fBi\fP, \fBn\fP, \fBo\fP, \fBp\fP, +\fBs\fP, \fBu\fP, \fBx\fP, \fBX\fP +¤¬»È¤¨¤ë¡£ +⤷ \fBF\fP ¤Ï \fBf\fP ¤ÈƱµÁ¤Ç¤¢¤ë¡£ +¤Þ¤¿¡¢ \fBD\fP, \fBO\fP, and \fBU\fP ¤ò \fBld\fP, \fBlo\fP, and \fBlu\fP +¤ÈƱ¤¸¤â¤Î¤È¤·¤Æ»È¤¨¤ë +(¤³¤ì¤Ï¤Þ¤º¤¤»ÅÍͤǡ¢ ¸å¤Ë \fB%D\fP ¤ÎÂбþ¤¬ÂǤÁÀÚ¤é¤ì¤¿»þ¤Ë¿¼¹ï¤Ê¥Ð¥°¤ò +°ú¤­µ¯¤³¤·¤¿)¡£¥í¥±¡¼¥ë°Í¸¤Î¾®¿ôÅÀ¡¢1000 ¶èÀڤꡢ NaN ¤È̵¸Â¡¢ +"%m$" ¤È "*m$" ¤Ï»È¤¨¤Ê¤¤¡£ +.PP +Linux libc5 ¤Ç¤Ï¡¢ 5 ¤Ä¤Î C ɸ½à¤Î¥Õ¥é¥°¤È \(aq ¥Õ¥é¥°¡¢¥í¥±¡¼¥ë¡¢ +"%m$" ¤È "*m$" ¤¬»È¤¨¤ë¡£ +¤Þ¤¿¡¢Ä¹¤µ½¤¾þ»Ò \fBh\fP, \fBl\fP, \fBL\fP, \fBZ\fP, iand \fBq\fP ¤¬»È¤¨¤ë¤¬¡¢ +\fBL\fP ¤È \fBq\fP ¤ÏξÊý¤È¤â +\fIlong double\fP ¤È \fIlong long int\fP ¤ËÂбþ¤·¤Æ¤¤¤ë (¤³¤ì¤Ï¥Ð¥°¤Ç¤¢¤ë)¡£ +¸½ºß¤Ç¤ÏÊÑ´¹ \fBF\fP, \fBD\fP, \fBO\fP, \fBU\fP ¤Ïǧ¼±¤µ¤ì¤Ê¤¤¤¬¡¢ÊÑ´¹Ê¸»ú +.B m +¤¬Äɲ䵤줿¡£¤³¤ì¤Ï +.I strerror(errno) +¤ò½ÐÎϤ¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.PP +glibc 2.0 ¤Ç¤Ï¡¢ÊÑ´¹Ê¸»ú \fBC\fP ¤È \fBS\fP ¤¬Äɲ䵤줿¡£ +.PP +glibc 2.1 ¤Ç¤Ï¡¢Ä¹¤µ½¤¾þ»Ò \fBhh\fP, \fBj\fP, \fBt\fP, \fBz\fP +¤ÈÊÑ´¹Ê¸»ú \fBa\fP, \fBA\fP ¤¬Äɲ䵤줿¡£ +.PP +glibc 2.2 ¤Ç¤Ï¡¢ C99 ¤Çµ¬Äꤵ¤ì¤¿°ÕÌ£¤Ç¤ÎÊÑ´¹Ê¸»ú \fBF\fP ¤È +¥Õ¥é¥°Ê¸»ú \fBI\fP ¤¬Äɲ䵤줿¡£ +.SH Ãí°Õ +¥Æ¥­¥¹¥È¤ò +.I buf +¤ËÄɲ乤ë¤Î¤Ë¡¢·ÚΨ¤Ë¤â¼¡¤Î¤è¤¦¤Ê¥³¡¼¥É¤ò»È¤Ã¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤¬¤¢¤ë¡£ + + sprintf(buf, "%s some further text", buf); + +¤·¤«¤·¤Ê¤¬¤é¡¢É¸½àµ¬³Ê¤Ç¤Ï¡¢ +.BR sprintf (), +.BR snprintf (), +.BR vsprintf (), +.BR vsnprintf () +¤Î¸Æ¤Ó½Ð¤·¤Ë¤ª¤¤¤Æ¡¢¥³¥Ô¡¼¸µ¤È¥³¥Ô¡¼Àè¤Î¥Ð¥Ã¥Õ¥¡¤¬½Å¤Ê¤Ã¤Æ¤¤¤¿¾ì¹ç¤Î +·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¡¢¤ÈÌÀµ­¤µ¤ì¤Æ¤¤¤ë¡£ +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=7075 +»ÈÍѤ¹¤ë +.BR gcc (1) +¤Î¥Ð¡¼¥¸¥ç¥ó¤ä»ØÄꤷ¤¿¥³¥ó¥Ñ¥¤¥é¤Î¥ª¥×¥·¥ç¥ó¼¡Âè¤Ç¤Ï¡¢ +¾åµ­¤Î¤è¤¦¤Ê¸Æ¤Ó½Ð¤·¤Ç¡¢´üÂÔ¤·¤¿·ë²Ì¤¬ÆÀ¤é¤ì¡Ö¤Ê¤¤¡×¤³¤È¤¬¤¢¤ë¡£ + +glibc ¤Î +.BR snprintf () +¤È +.BR vsnprintf () +¤Î¼ÂÁõ¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Ï C99 ɸ½à¤Ë½àµò¤·¤Æ¤ª¤ê¡¢ +¾åµ­¤ÎÄ̤ê¤ÎÆ°ºî¤ò¤¹¤ë¡£ +glibc 2.0.6 ¤Þ¤Ç¤Ï¡¢½ÐÎϤ¬ÀÚ¤êµÍ¤á¤é¤ì¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.\" .SH Îò»Ë +.\" Unix V7 ¤Ç¤Ï +.\" .BR printf (), +.\" .BR fprintf (), +.\" .BR sprintf () +.\" ¤Î 3 ¤Ä¤Î´Ø¿ô¤È¡¢¥Õ¥é¥° \-¡¢Éý¤ÈÀºÅ٤ǤΠ*¡¢Ä¹¤µ½¤¾þ»Ò l¡¢ +.\" ÊÑ´¹ doxfegcsu¡¢¤½¤·¤Æ ld,ld,lu,lx ¤ÎƱµÁ¸ì¤È¤·¤Æ D,O,U,X ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" 2.9.1BSD ¤Ç¤â¤³¤ì¤ÏƱ¤¸¤À¤Ã¤¿¤¬¡¢ 2.10BSD ¤Ç¤Ï +.\" ¥Õ¥é¥° #, +, ¶õÇò¤¬Äɲ䵤졢 D,O,U,X ¤Ë¤Ä¤¤¤Æ¤Ïµ­ºÜ¤µ¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£ +.\" 2.11BSD ¤Ç¤Ï +.\" .BR vprintf (), +.\" .BR vfprintf (), +.\" .BR vsprintf () +.\" ¤¬Äɲ䵤졢 D,O,U,X ¤ò»È¤ï¤Ê¤¤¤è¤¦¤Ë·Ù¹ð¤µ¤ì¤¿¡£ +.\" 4.3BSD Reno ¤Ç¤Ï¥Õ¥é¥° 0¡¢Ä¹¤µ½¤¾þ»Ò h ¤È L¡¢ +.\" ÊÑ´¹ n, p, E, G, (¸½ºß¤Î°ÕÌ£¤Ç¤Î) X ¤¬Äɲ䵤졢 +.\" D,O,U ¤ÏÈó¿ä¾©°·¤¤¤È¤Ê¤Ã¤¿¡£ +.\" 4.4BSD ¤Ç¤Ï¡¢´Ø¿ô +.\" .BR snprintf ()¤È +.\" .BR vsnprintf ()¡¢ +.\" Ťµ½¤¾þ»Ò q ¤¬Æ³Æþ¤µ¤ì¤¿¡£ +.\" FreeBSD ¤Ç¤Ï¡¢ +.\" .BR sprintf () +.\" ¤Î¤¿¤á¤Ë½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¤ò³ÎÊݤ¹¤ë +.\" .BR asprintf () +.\" ¤È +.\" .BR vasprintf () +.\" ¤¬Äɲ䵤ì¤Æ¤¤¤ë¡£ +.\" glibc ¤Ë¤Ï¡¢´Ø¿ô +.\" .BR dprintf (), +.\" .BR vdprintf () +.\" ¤¬¤¢¤ê¡¢¤³¤ì¤é¤Ï¥¹¥È¥ê¡¼¥à¤Ç¤Ï¤Ê¤¯¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë½ÐÎϤ¹¤ë¡£ +.SH ¥Ð¥° +.BR sprintf () +¤È +.BR vsprintf () +¤Ï¾¡¼ê¤Ë½½Ê¬¤ËŤ¤Ê¸»úÎóÎΰ褬¤¢¤ë¤È²¾Äꤹ¤ë¤Î¤Ç¡¢¸Æ¤Ó½Ð¤·Â¦¤Ï +¼ÂºÝ¤ÎÎΰ褫¤é¤¢¤Õ¤ì¤Ê¤¤¤è¤¦¤ËÃí°Õ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤·¤«¤·¡¢¤³¤ì¤òÊݾڤ¹¤ë¤³¤È¤¬ÉÔ²Äǽ¤Ê¾ì¹ç¤¬Â¿¤¤¡£ +À¸À®¤µ¤ì¤ëʸ»úÎó¤ÎŤµ¤Ï¥í¥±¡¼¥ë°Í¸¤Ç¤¢¤ê¡¢Í½Â¬¤¬Æñ¤·¤¤¤³¤È¤ËÃí°Õ¡£ +Âå¤ï¤ê¤Ë +.BR snprintf () +¤È +.BR vsnprintf () +(¤Þ¤¿¤Ï +.BR asprintf (3) +¤È +.BR vasprintf (3)) +¤ò»È¤¦¤³¤È¡£ +.PP +Linux libc4.[45] ¤Ë¤Ï +.BR snprintf () +¤Ï¤Ê¤¤¤¬¡¢ libbsd ¤¬Ä󶡤µ¤ì¤Æ¤ª¤ê¡¢ +¤½¤ÎÃæ¤Ë¤Ï +.BR sprintf () +¤ÈÅù²Á¤Ê (¤Ä¤Þ¤ê +.I size +°ú¤­¿ô¤ò̵»ë¤¹¤ë) +.BR snprintf () +¤¬¤¢¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢½é´ü¤Î libc4 ¤Ç +.BR snprintf () +¤ò»È¤¦¤È¡¢¿¼¹ï¤Ê¥»¥­¥å¥ê¥Æ¥£ÌäÂê¤ò°ú¤­µ¯¤³¤¹¤³¤È¤¬¤¢¤ë¡£ +.PP +.BI printf( foo ); +¤Î¤è¤¦¤Ê¥³¡¼¥É¤Ï¤·¤Ð¤·¤Ð¥Ð¥°¤ò°ú¤­µ¯¤³¤¹¡£ +¤Ê¤¼¤Ê¤é +.I foo +¤Ë % ʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤ë¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.I foo +¤¬¿®Íê¤Ç¤­¤Ê¤¤¥æ¡¼¥¶¡¼ÆþÎϤ«¤éºî¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤½¤ÎÃæ¤Ë \fB%n\fP ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤³¤È¤¬¤¢¤ê¡¢ +.BR printf () +¸Æ¤Ó½Ð¤·»þ¤Ë¥á¥â¥ê¤Ø¤Î½ñ¤­¹þ¤ß¤¬µ¯¤³¤ê¡¢ +¥»¥­¥å¥ê¥Æ¥£¡¼¥Û¡¼¥ë¤òºî¤ë¤³¤È¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\".PP +.\".\"O Some floating-point conversions under early libc4 +.\".\"O caused memory leaks. +.\"½é´ü¤Î libc4 ¤Ç¤Î¼Â¿ôÊÑ´¹¤Ë¤Ï¥á¥â¥ê¥ê¡¼¥¯¤ò°ú¤­µ¯¤³¤¹¤³¤È¤¬¤¢¤ë¡£ +.SH Îã +.if \w'\*(Pi'=0 .ds Pi pi +\*(Pi ¤ò 5 ·å¤Ç½ÐÎϤ¹¤ë¡£ +.in +4n +.nf + +#include +#include +fprintf(stdout, "pi = %.5f\en", 4 * atan(1.0)); +.fi +.in +.PP +ÆüÉդȻþ´Ö¤ò "Sunday, July 3, 10:02" ¤Î·Á¼°¤Ç½ÐÎϤ¹¤ë¡£ +.RI ( weekday +¤È +.I month +¤Ïʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë) +.in +4n +.nf + +#include +fprintf(stdout, "%s, %s %d, %.2d:%.2d\en", + weekday, month, day, hour, min); +.fi +.in +.PP +Æü - ·î - ǯ ¤Î½ç½ø¤Çɽ¼¨¤ò¹Ô¤¦¹ñ¤â¿¤¤¡£ +½¾¤Ã¤Æ¡¢¹ñºÝÈǤǤϽñ¼°¤Ç»ØÄꤵ¤ì¤¿½çÈÖ¤Ç +°ú¤­¿ô¤òɽ¼¨¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.in +4n +.nf + +#include +fprintf(stdout, format, + weekday, month, day, hour, min); + +.fi +.in +.I format +¤Ï¥í¥±¡¼¥ë¤Ë°Í¸¤·¤Æ¤ª¤ê¡¢°ú¤­¿ô¤Î½çÈÖ¤òÊѤ¨¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.I format +¤¬ +.in +4n +.nf + +"%1$s, %3$d. %2$s, %4$d:%5$.2d\en" + +.fi +.in +¤Ç¤¢¤ì¤Ð¡¢ "Sonntag, 3. Juli, 10:02" ¤È¤¤¤¦·ë²Ì¤Ë¤Ê¤ë¡£ +.PP +½½Ê¬¤ËÂ礭¤Êʸ»úÎóÎΰè¤ò³ÎÊݤ·¤Æ¡¢¤½¤³¤Ë¥á¥Ã¥»¡¼¥¸¤ò³ÊǼ¤¹¤ë¤Ë¤Ï +(glibc 2.0 ¤È glibc 2.1 ¤ÎξÊý¤ÇÀµ¤·¤¯Æ°ºî¤¹¤ë¥³¡¼¥É): +.nf + +#include +#include +#include +char * +make_message(const char *fmt, ...) +{ + /* Guess we need no more than 100 bytes. */ + int n, size = 100; + char *p, *np; + va_list ap; + + if ((p = malloc(size)) == NULL) + return NULL; + + while (1) { + /* Try to print in the allocated space. */ + va_start(ap, fmt); + n = vsnprintf(p, size, fmt, ap); + va_end(ap); + /* If that worked, return the string. */ + if (n > \-1 && n < size) + return p; + /* Else try again with more space. */ + if (n > \-1) /* glibc 2.1 */ + size = n+1; /* precisely what is needed */ + else /* glibc 2.0 */ + size *= 2; /* twice the old size */ + if ((np = realloc (p, size)) == NULL) { + free(p); + return NULL; + } else { + p = np; + } + } +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR printf (1), +.BR asprintf (3), +.BR dprintf (3), +.BR scanf (3), +.BR setlocale (3), +.BR wcrtomb (3), +.BR wprintf (3), +.BR locale (5) diff --git a/release/man3/profil.3 b/release/man3/profil.3 new file mode 100644 index 00000000..aa1eb5dc --- /dev/null +++ b/release/man3/profil.3 @@ -0,0 +1,103 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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 Fri Jun 23 01:35:19 1995 Andries Brouwer +.\" (prompted by Bas V. de Bakker ) +.\" Corrected (and moved to man3), 980612, aeb +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated San Feb 23 20:40:50 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Sun Jun 21 17:30:21 JST 1998 +.\" by HANATAKA Shinya +.\" Updated & Modified Thu Feb 17 00:57:49 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: profile ¥×¥í¥Õ¥¡¥¤¥ë +.\"WORD: kernel ¥«¡¼¥Í¥ë +.\"WORD: implement ¼ÂÁõ +.\"WORD: library ¥é¥¤¥Ö¥é¥ê +.\"WORD: core ¥á¥â¥ê +.\"WORD: virtual ²¾ÁÛ +.\"WORD: word ¥ï¡¼¥É +.\"WORD: increment ¥¤¥ó¥¯¥ê¥á¥ó¥È +.\"WORD: core dump ¥³¥¢¡¦¥À¥ó¥× +.\" +.TH PROFIL 3 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +profil \- ¼Â¹Ô»þ´Ö¥×¥í¥Õ¥¡¥¤¥ë (profile) +.SH ½ñ¼° +.B #include +.sp +.BI "int profil(unsigned short *" buf ", size_t " bufsiz \ +", size_t " offset ", unsigned int " scale ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR profil (): +_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.SH ÀâÌÀ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥×¥í¥°¥é¥à¤Î¤É¤³¤ÎÉôʬ¤Ç»þ´Ö¤òÈñ¤ä¤·¤Æ¤¤¤ë¤«¤òÄ´¤Ù¤ë +¼êÃʤòÄ󶡤¹¤ë¡£°ú¤­¿ô +.I buf +¤Ï +.I bufsiz +¥Ð¥¤¥È¤Î¥á¥â¥ê¤ò»Ø¤·¤Æ¤¤¤ë¡£²¾ÁۤΠ10 ¥ß¥êÉ䴤Ȥˡ¢¥æ¡¼¥¶¡¼¤Î +¥×¥í¥°¥é¥à¡¦¥«¥¦¥ó¥¿¡¼ (PC) ¤¬¸¡ºº¤µ¤ì¤ë: +.I offset +¤¬°ú¤«¤ì¡¢¤½¤Î·ë²Ì¤¬ +.I scale +Çܤµ¤ì 65536 ¤Ç³ä¤é¤ì¤ë¡£ +·ë²Ì¤¬ +.I bufsiz +¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ï +.I buf +¤ÎÂбþ¤¹¤ë¥¨¥ó¥È¥ê¤¬¥¤¥ó¥¯¥ê¥á¥ó¥È¤µ¤ì¤ë¡£ +.I buf +¤¬ NULL ¤Ê¤é¤Ð¡¢¥×¥í¥Õ¥¡¥¤¥ë (profile) ¤Ï̵¸ú¤Ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +¾ï¤Ë 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ½àµò +SVr4 ¤Î¥³¡¼¥ë¤Ë»÷¤Æ¤¤¤ë (¤·¤«¤· POSIX.1-2001 ¤Ç¤Ï¤Ê¤¤)¡£ +.SH ¥Ð¥° +.BR profil () +¤Ï +.B ITIMER_PROF +¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¡¼¤â»ÈÍѤ·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤǤ­¤Ê¤¤ +.RB ( setitimer (2) +»²¾È)¡£ + +ËÜÅö¤Î¥«¡¼¥Í¥ë¡¦¥×¥í¥Õ¥¡¥¤¥ë¤Ï¤è¤êÀµ³Î¤Ê·ë²Ì¤òÍ¿¤¨¤ë¡£ +libc 4.4 ¤Ë¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë profil ¤òÄ󶡤¹¤ë¤¿¤á¤Î +¥«¡¼¥Í¥ë¥Ñ¥Ã¥Á¤¬´Þ¤Þ¤ì¤Æ¤¤¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR gprof (1), +.BR setitimer (2), +.BR sigaction (2), +.BR signal (2) diff --git a/release/man3/program_invocation_name.3 b/release/man3/program_invocation_name.3 new file mode 100644 index 00000000..dcf0c3b9 --- /dev/null +++ b/release/man3/program_invocation_name.3 @@ -0,0 +1,66 @@ +.\" Copyright (C) 2006 Michael Kerrisk +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" 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) 2006 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-03-13, Akihiro MOTOKI +.\" +.TH INVOCATION_NAME 3 2006-04-29 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +program_invocation_name, program_invocation_short_name \- \ +¥×¥í¥°¥é¥à¤Îµ¯Æ°¤Ë»È¤ï¤ì¤¿Ì¾Á°¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +.BI "extern char *" program_invocation_name ; +.BI "extern char *" program_invocation_short_name ; +.fi +.SH ÀâÌÀ +.I program_invocation_name +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥°¥é¥à¤Îµ¯Æ°¤Ë»ÈÍѤµ¤ì¤¿Ì¾Á°¤òÊÝ»ý¤¹¤ë¡£ +ÆâÍÆ¤Ï +.IR main () +¤Î +.I argv[0] +¤ÎÃͤÈƱ¤¸¤À¤¬¡¢ +.I program_invocation_name +¤ÎÊý¤Ï¥¹¥³¡¼¥×¤¬¥°¥í¡¼¥Ð¥ë¤Ç¤¢¤ëÅÀ¤¬°Û¤Ê¤ë¡£ + +.I program_invocation_short_name +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥°¥é¥à¤Îµ¯Æ°¤Ë»ÈÍѤµ¤ì¤¿Ì¾Á°¤Î basename Éôʬ¤ò +ÊÝ»ý¤¹¤ë¡£¤Ä¤Þ¤ê¡¢¤³¤ÎÊÑ¿ô¤ÎÆâÍƤϡ¢ºÇ¸å¤Î¥¹¥é¥Ã¥·¥å (/) ¤È¤½¤ì¤è¤êÁ°¤Î +Éôʬ¤¬¤¢¤ë¾ì¹ç¡¢ +.I program_invocation_name +¤«¤é¤³¤ÎÉôʬ¤òºï½ü¤·¤¿¤â¤Î¤È¤Ê¤ë¡£ + +¤³¤ì¤é¤ÎÊÑ¿ô¤Ï glibc ¤Î¥é¥ó¥¿¥¤¥à¡¦¥¹¥¿¡¼¥È¥¢¥Ã¥×¡¦¥³¡¼¥É¤Ç +¼«Æ°Åª¤Ë½é´ü²½¤µ¤ì¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤ÎÊÑ¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢ +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ê¤¤¡£ +.SH È÷¹Í +Linux Æȼ«¤Î¥Õ¥¡¥¤¥ë +.I /proc/[number]/cmdline +¤Ç¤âƱÍͤξðÊó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR proc (5), +.BR feature_test_macros (7) diff --git a/release/man3/psignal.3 b/release/man3/psignal.3 new file mode 100644 index 00000000..4572b862 --- /dev/null +++ b/release/man3/psignal.3 @@ -0,0 +1,75 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Fri Dec 26 13:19:15 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. +.\" +.\" 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:45:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" FIXME glibc 2.10 adds psiginfo(), specified in SUSv4. This function +.\" should be documented, probably on this page. +.TH PSIGNAL 3 2008-08-21 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +psignal \- ¥·¥°¥Ê¥ë¥á¥Ã¥»¡¼¥¸¤òɽ¼¨ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void psignal(int " sig ", const char *" s ); +.sp +.BI "extern const char *const " sys_siglist []; +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR psignal (): +_SVID_SOURCE || _BSD_SOURCE +.br +.IR sys_siglist : +_BSD_SOURCE +\"O .SH DESCRIPTION +.SH ÀâÌÀ +.BR psignal () +´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP¡¢¥³¥í¥ó¡¢¥¹¥Ú¡¼¥¹¡¢ +¥·¥°¥Ê¥ëÈÖ¹æ \fIsig\fP ¤òÀâÌÀ¤¹¤ëʸ»úÎ󤫤鹽À®¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¤ò +\fIstderr\fP ¤Ëɽ¼¨¤¹¤ë¡£¤â¤· \fIsig\fP ¤¬ÉÔÀµ¤Ê¤é¤Ð¡¢É½¼¨¤µ¤ì¤ë +¥á¥Ã¥»¡¼¥¸¤Ï̤ÃΤΥ·¥°¥Ê¥ë¤ò¼¨¤¹¡£ +.PP +ÇÛÎó \fIsys_siglist\fP ¤Ï¥·¥°¥Ê¥ë¤òÀâÌÀ¤¹¤ëʸ»úÎó¤òÊÝ»ý¤·¤Æ¤ª¤ê¡¢ +ÇÛÎó¤Ø¤Î¥¢¥¯¥»¥¹¤Ë¤Ï¥·¥°¥Ê¥ëÈÖ¹æ¤òź¤¨»ú¤È¤·¤ÆÍѤ¤¤ë»ö¤¬¤Ç¤­¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR psignal () +´Ø¿ô¤Ï¡¢ÃͤòÊÖ¤µ¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2008, 4.3BSD. +.SH ´ØÏ¢¹àÌÜ +.BR perror (3), +.BR strsignal (3) diff --git a/release/man3/ptsname.3 b/release/man3/ptsname.3 new file mode 100644 index 00000000..fa942718 --- /dev/null +++ b/release/man3/ptsname.3 @@ -0,0 +1,106 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This page is in the public domain. - aeb +.\" +.\" 2004-12-17, mtk, added description of ptsname_r() + ERRORS +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-07-08, Akihiro MOTOKI +.\" Updated 2005-02-27, Akihiro MOTOKI +.\" +.\"WORD: pseudo-terminal µ¼»÷üËö +.\" +.TH PTSNAME 3 2008-09-03 "" "Linux Programmer's Manual" +.SH ̾Á° +ptsname, ptsname_r \- ¥¹¥ì¡¼¥Öµ¼»÷üËö¤Î̾Á°¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "char *ptsname(int " fd ");" +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int ptsname_r(int " fd ", char *" buf ", size_t " buflen ");" +.fi +.SH ÀâÌÀ +.BR ptsname () +´Ø¿ô¤Ï +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥Þ¥¹¥¿µ¼»÷üËö (pts) ¥Ç¥Ð¥¤¥¹¤ËÂбþ¤¹¤ë +¥¹¥ì¡¼¥Öµ¼»÷üËö¥Ç¥Ð¥¤¥¹¤Î̾Á°¤òÊÖ¤¹¡£ + +.BR ptsname_r () +´Ø¿ô¤Ï +.BR ptsname () +¤Î¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢¥¹¥ì¡¼¥Öµ¿»÷üËö¥Ç¥Ð¥¤¥¹¤Î̾Á°¤ò¡¢ +NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Î·Á¤Ç +.I buf +¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ +.I buflen +°ú¤­¿ô¤Ë¤Ï +.I buf +¤Î¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤Î¾ì¹ç¡¢ +.BR ptsname () +¤ÏÀÅŪµ­²±Îΰè¤Îʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤³¤Îµ­²±Îΰè¤Ï¤³¤Î¸å¤Î +.BR ptsname () +¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¡£ +¤³¤Î¥Ý¥¤¥ó¥¿¤ò free ¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ + +À®¸ù¤Î¾ì¹ç¡¢ +.BR ptsname_r () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢0 °Ê³°¤ÎÃͤòÊÖ¤·¡¢ +.I errno +¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£ +.\" ¼ÂºÝ¤Ë¤Ï¡¢errno ¤ÎÃͤ¬´Ø¿ô¤Î·ë²Ì¤ÎÊÖ¤êÃͤȤ·¤Æ¤âÊÖ¤µ¤ì¤ë¡£-- MTK, Dec 04 +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.RB ( ptsname_r () +¤Î¤ß) +.I buf +¤¬ NULL ¤Ç¤¢¤ë¡£ +.TP +.B ENOTTY +.I fd +¤¬¥Þ¥¹¥¿µ¿»÷üËö¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ERANGE +.RB ( ptsname_r () +¤Î¤ß) +.I buf +¤¬¾®¤µ¤¹¤®¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR ptsname () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +.BR ptsname () +¤Ï Unix98 µ¿»÷üËö»ÅÍͤΰìÉô¤Ç¤¢¤ë +.RB ( pts (4) +¤ò»²¾È¤Î¤³¤È)¡£¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +.BR ptsname_r () +¤Ï Linux ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Îµ­ºÜ¤¬¤¢¤ë¤â¤Î¤È¤·¤Æ Tru64 ¤È HP-UX ¤¬¤¢¤ë¤¬¡¢ +¤³¤ì¤é¤Î OS ¤Ç¤Î¼ÂÁõ¤Ç¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î´Ø¿ô¤Î»ÈÍѤÏÈò¤±¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR grantpt (3), +.BR posix_openpt (3), +.BR ttyname (3), +.BR unlockpt (3), +.BR pts (4), +.BR feature_test_macros (7), +.BR pty (7) diff --git a/release/man3/putenv.3 b/release/man3/putenv.3 new file mode 100644 index 00000000..93c2740c --- /dev/null +++ b/release/man3/putenv.3 @@ -0,0 +1,118 @@ +.\" 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 +.\" Single UNIX Specification, Version 2 +.\" Modified Thu Apr 8 15:00:12 1993, David Metcalfe +.\" Modified Sat Jul 24 18:44:45 1993, Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Feb 14 21:47:50 1997 by Andries Brouwer (aeb@cwi.nl) +.\" 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 +.\" +.TH PUTENV 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +putenv \- ´Ä¶­ÊÑ¿ô¤ÎÊѹ¹¤Þ¤¿¤ÏÄɲà +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int putenv(char *" string ); +.\" Not: const char * +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR putenv (): +_SVID_SOURCE || _XOPEN_SOURCE +\"O .SH DESCRIPTION +.SH ÀâÌÀ +.BR putenv () +´Ø¿ô¤Ï¡¢´Ä¶­ÊÑ¿ô¤ÎÄɲäޤ¿¤ÏÃͤÎÊѹ¹¤ò¹Ô¤¦¡£ +°ú¿ô \fIstring\fP ¤Ï \fIname\fP=\fIvalue\fP ¤È¤¤¤¦·Á¼°¤ò¼è¤ë¡£ +\fIname\fP ¤¬´Ä¶­¤Ë¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï \fIstring\fP ¤¬´Ä¶­¤ËÄɲ䵤ì¤ë¡£ +\fIname\fP ¤¬´Ä¶­¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ï \fIname\fP ¤ÎÃÍ¤Ï \fIvalue\fP ¤ËÊѹ¹¤µ¤ì¤ë¡£ +\fIstring\fP ¤¬»Ø¤·¤Æ¤¤¤ëʸ»úÎó¤Ï´Ä¶­¤Î°ìÉô¤È¤Ê¤ë¤Î¤Ç¡¢ +ʸ»úÎó¤òÊѹ¹¤¹¤ë¤È´Ä¶­¤âÊѹ¹¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR putenv () +´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç 0 ¤ò¡¢ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç 0 °Ê³°¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +¿·¤·¤¤´Ä¶­¤ò³ä¤êÅö¤Æ¤ë¤Î¤Ë½½Ê¬¤Ê¶õ¤­¤¬¤Ê¤¤¡£ +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD. +.SH Ãí°Õ +.BR putenv () +¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤¢¤ë¤³¤È¤òµá¤á¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +libc4, libc5, glibc 2.0 ¤Ç¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ï¤Ê¤¤¡£ +glibc 2.1 ¤Ç¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤¢¤ë¡£ +.LP +libc4, libc5, glibc ¤Ë´Ø¤¹¤ëÀâÌÀ: +¤â¤·°ú¿ô \fIstring\fP ¤¬ \fIname\fP ñÆȤǡ¢ +\(aq=\(aq ʸ»ú¤ò´Þ¤ó¤Ç¤¤¤Ê¤¤¾ì¹ç¡¢´Ä¶­ÊÑ¿ô \fIname\fP ¤Ï´Ä¶­¤«¤é½üµî¤µ¤ì¤ë¡£ +¤â¤· +.BR putenv () +¤¬¿·¤·¤¤ \fIenviron\fP ÇÛÎó¤ò³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤»þ¡¢ +°ÊÁ°¤Î \fIenviron\fP ÇÛÎó¤â +.BR putenv () +¤Ë¤è¤Ã¤Æ³ÎÊݤµ¤ì¤¿¤â¤Î¤Ê¤é¤Ð¡¢ +¤½¤ì¤Ï²òÊü¤µ¤ì¤ë¡£ +´Ä¶­ÊÑ¿ô¤½¤Î¤â¤Î¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¸Å¤¤µ­²±Îΰ褬²òÊü¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.LP +libc4 ¤È libc5 ¤È glibc 2.1.2 ¤Ç¤Ï SUSv2 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR putenv () +¤ÇÍ¿¤¨¤é¤ì¤¿¥Ý¥¤¥ó¥¿ \fIstring\fP ¤¬»È¤ï¤ì¤ë¡£ +¤³¤Îʸ»úÎó¤Ï´Ä¶­¤Î°ìÉô¤È¤Ê¤ê¡¢¸å¤ÇÊѹ¹¤¹¤ë¤È´Ä¶­¤âÊѤï¤ë¡£ +(½¾¤Ã¤Æ¡¢ +.BR putenv () +¤ò¼«Æ°ÊÑ¿ô¤ò°ú¿ô¤È¤·¤Æ¸Æ¤Ó½Ð¤·¡¢ +\fIstring\fP¤¬´Ä¶­¤Î°ìÉô¤Î¤Þ¤Þ¤Ç¸Æ¤Ó½Ð¤·¤¿´Ø¿ô¤«¤é return ¤¹¤ë¤È¥¨¥é¡¼¤Ë¤Ê¤ë) +¤·¤«¤·¡¢glibc 2.0-2.1.1 ¤Ç¤Ï°Û¤Ê¤ê¡¢Ê¸»úÎó¤Î¥³¥Ô¡¼¤¬»È¤ï¤ì¤ë¡£ +¤³¤ì¤Ï¥á¥â¥ê¥ê¡¼¥¯¤ò°ú¤­µ¯¤³¤¹¤À¤±¤Ç¤Ê¤¯¡¢ SUSv2 ¤Ë°ãÈ¿¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï glibc2.1.2 ¤Ç½¤Àµ¤µ¤ì¤¿¡£ +.LP +4.4BSD ¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢glibc 2.0 ¤ÈƱÍͤ˥³¥Ô¡¼¤ò»È¤¦¡£ +.LP +SUSv2 ¤Ç¤Ï¥×¥í¥È¥¿¥¤¥×¤«¤é \fIconst\fP ¤¬¼è¤ê½ü¤«¤ì¤Æ¤ª¤ê¡¢ +glibc 2.1.3 ¤â¤½¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR clearenv (3), +.BR getenv (3), +.BR setenv (3), +.BR unsetenv (3), +.BR environ (7) diff --git a/release/man3/putgrent.3 b/release/man3/putgrent.3 new file mode 100644 index 00000000..ad97f40d --- /dev/null +++ b/release/man3/putgrent.3 @@ -0,0 +1,49 @@ +.\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Sat Aug 28 14:07:20 JST 2004 +.\" by Yuichi SATO +.\" +.TH PUTGRENT 3 2003-09-09 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +putgrent \- ¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¥¨¥ó¥È¥ê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int putgrent(const struct group *" grp ", FILE *" fp ); +.SH ÀâÌÀ +.BR putgrent () +´Ø¿ô¤Ï +.BR fgetgrent (3) +¤ÎµÕ¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤ÏÍ¿¤¨¤é¤ì¤¿ \fIstruct group\fP ¤ò +.I fp +¤Ç»Ø¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à¡£ +¥°¥ë¡¼¥×¥á¥ó¥Ð¤Î¥ê¥¹¥È¤Ï¡¢NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¤«¡¢ +NULL ¤Ç½é´ü²½¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.sp +\fIstruct group\fP ¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.sp +.in +4n +.nf +struct group { + char *gr_name; /* ¥°¥ë¡¼¥×̾ */ + char *gr_passwd; /* ¥°¥ë¡¼¥×¥Ñ¥¹¥ï¡¼¥É */ + gid_t gr_gid; /* ¥°¥ë¡¼¥× ID */ + char **gr_mem; /* ¥°¥ë¡¼¥×¥á¥ó¥Ð */ +}; +.fi +.in +.SH ÊÖ¤êÃÍ +¤³¤Î´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ï 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fgetgrent (3), +.BR getgrent (3), +.BR group (5), +.BR feature_test_macros (7) diff --git a/release/man3/putpwent.3 b/release/man3/putpwent.3 new file mode 100644 index 00000000..9c3286c9 --- /dev/null +++ b/release/man3/putpwent.3 @@ -0,0 +1,91 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Thu Dec 18 17:43:46 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. +.\" +.\" 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:43:46 1993 by Rik Faith (faith@cs.unc.edu) +.TH PUTPWENT 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +putpwent \- ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤Î½ñ¤­¹þ¤ß +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.sp +.BI "int putpwent(const struct passwd *" p ", FILE *" stream ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR putpwent (): +_SVID_SOURCE +.SH ÀâÌÀ +.BR putpwent () +´Ø¿ô¤Ï¡¢¹½Â¤ÂÎ \fIp\fP ¤«¤é¤Î¥Ñ¥¹¥ï¡¼¥É¥¨¥ó¥È¥ê¤ò +\fIstream\fP ¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à¡£ + +.PP +\fIpasswd\fP ¹½Â¤ÂΤϡ¢\fI\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.sp +.in +4n +.nf +struct passwd { + char *pw_name; /* ¥æ¡¼¥¶Ì¾ */ + char *pw_passwd; /* ¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É */ + uid_t pw_uid; /* ¥æ¡¼¥¶ ID */ + gid_t pw_gid; /* ¥°¥ë¡¼¥× ID */ + char *pw_gecos; /* ËÜ̾ */ + char *pw_dir; /* ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê */ + char *pw_shell; /* ¥·¥§¥ë¥×¥í¥°¥é¥à */ +}; +.fi +.in +.SH ÊÖ¤êÃÍ +.BR putpwent () +´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤ò¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï +\-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +̵¸ú¤Ê(NULL)°ú¿ô¤¬ÅϤµ¤ì¤¿¡£ +.SH ½àµò +SVr4. +.SH ´ØÏ¢¹àÌÜ +.BR endpwent (3), +.BR fgetpwent (3), +.BR getpw (3), +.BR getpwent (3), +.BR getpwnam (3), +.BR getpwuid (3), +.BR setpwent (3) diff --git a/release/man3/puts.3 b/release/man3/puts.3 new file mode 100644 index 00000000..8bbaeda8 --- /dev/null +++ b/release/man3/puts.3 @@ -0,0 +1,135 @@ +.\" 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 18:42:59 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Wed Dec 24 12:33:40 JST 1997 +.\" by HIROFUMI Nishizuka +.\" Updated Fri Nov 2 JST 2001 by Kentaro Shirakata +.\" +.TH PUTS 3 1993-04-04 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +fputc, fputs, putc, putchar, puts \- ʸ»ú¤Èʸ»úÎó¤Î½ÐÎÏ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int fputc(int " c ", FILE *" stream ); + +.BI "int fputs(const char *" "s" ", FILE *" "stream" ); + +.BI "int putc(int " c ", FILE *" stream ); + +.BI "int putchar(int " c ); + +.BI "int puts(const char *" "s" ); +.fi +.SH ÀâÌÀ +.BR fputc () +¤Ï¡¢¥­¥ã¥é¥¯¥¿ +.I c +¤ò +.I "unsigned char" +¤Ë¥­¥ã¥¹¥È¤·¡¢ +.I stream +¤Ë½ñ¤­¹þ¤à¡£ +.PP +.BR fputs () +¤Ï¡¢Ê¸»úÎó +.I s +¤ò +.I stream +¤Ë½ñ¤­¹þ¤à¡£ +ʸ»úÎó¤Ë³¤¯ +.B \(aq\e0\(aq +¤Ï½ÐÎϤ·¤Ê¤¤¡£ +.PP +.BR putc () +¤Ï¡¢ +.I stream +¤ò°ìÅٰʾåɾ²Á¤¹¤ë¥Þ¥¯¥í¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤«¤âÃΤì¤Ê¤¤¤È¤¤¤¦ÅÀ¤ò½ü¤­¡¢ +.BR fputc () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.PP +.BI "putchar(" c ); +¤Ï¡¢ +.BI "putc(" c , stdout ) +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.PP +.BR puts () +¤Ï¡¢Ê¸»úÎó +.I s +¤È²þ¹Ô¤ò +.I stdout +¤Ë½ñ¤­¹þ¤à¡£ +.PP +¤³¤³¤ÇÀâÌÀ¤µ¤ì¤¿´Ø¿ô¤Ï¤ª¸ß¤¤¤Ëº®ºß¤·¤Æ»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¡¢¤Þ¤¿¡¢ +.I stdio +¥é¥¤¥Ö¥é¥ê¤Ë´Þ¤Þ¤ì¤ë¾¤Î½ÐÎÏ´Ø¿ô¤òƱ¤¸½ÐÎÏ¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ +¸Æ¤Ó½Ð¤¹»ö¤¬½ÐÍè¤ë¡£ +.PP +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR fputc (), +.BR putc (), +.BR putchar () +¤Ï +.I unsigned char +¤È¤·¤Æ½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¤ò +.I int +¤Ë¥­¥ã¥¹¥È¤·¤ÆÊÖ¤¹¡£ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï +.B EOF +¤òÊÖ¤¹¡£ +.PP +.BR puts () +¤È +.BR fputs () +¤Ï¡¢À®¸ù¤¹¤ë¤ÈÉé¤Ç¤Ï¤Ê¤¤¿ô¤ò¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï +.B EOF +¤òÊÖ¤¹¡£ +.SH ½àµò +C89, C99. +.SH ¥Ð¥° +.I stdio +¥é¥¤¥Ö¥é¥ê¤Ë´Þ¤Þ¤ì¤ë½ÐÎÏ´Ø¿ô¤È¡¢Æ±¤¸½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤¿ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ë +.BR write (2) +¤ÎÄã¥ì¥Ù¥ë¸Æ¤Ó½Ð¤·¤òº®ºß¤·¤Æ +»ÈÍѤ¹¤ë¤³¤È¤Ï¸­ÌÀ¤Ç¤Ï¤Ê¤¤¡£ +¤½¤Î·ë²Ì¤ÏÄêµÁ¤µ¤ì¤Æ¤ª¤é¤º¡¢Ë¾¤à·ë²Ì¤¬ÆÀ¤é¤ì¤Ê¤¤²ÄǽÀ­¤¬¹â¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR write (2), +.BR ferror (3), +.BR fopen (3), +.BR fputwc (3), +.BR fputws (3), +.BR fseek (3), +.BR fwrite (3), +.BR gets (3), +.BR putwchar (3), +.BR scanf (3), +.BR unlocked_stdio (3) diff --git a/release/man3/putwchar.3 b/release/man3/putwchar.3 new file mode 100644 index 00000000..c6fab71b --- /dev/null +++ b/release/man3/putwchar.3 @@ -0,0 +1,66 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:58 JST 2000 +.\" by HANATAKA Shinya +.\" Updated Sat Nov 3 JST 2001 by Kentaro Shirakata +.\" +.TH PUTWCHAR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +putwchar \- ¥ï¥¤¥Éʸ»ú¤òɸ½à½ÐÎϤؽñ¤­½Ð¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wint_t putwchar(wchar_t " wc ); +.fi +.SH ÀâÌÀ +.BR putwchar () +´Ø¿ô¤Ï +.BR putchar () +¤Î¥ï¥¤¥Éʸ»úÈǤǤ¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï \fIwc\fP ¤ò \fIstdout\fP ¤Ø¤È½ñ¤­½Ð¤¹¡£\fIferror(stdout)\fP ¤¬ +¿¿¤Ê¤é¤Ð +.B WEOF +¤òÊÖ¤¹¡£¥ï¥¤¥Éʸ»ú¤ÎÊÑ´¹¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï \fIerrno\fP ¤Ë +\fBEILSEQ\fP ¤òÀßÄꤷ¤Æ +.B WEOF +¤òÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï \fIwc\fP ¤òÊÖ¤¹¡£ +.PP +¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +.BR unlocked_stdio (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÊÖ¤êÃÍ +¥¨¥é¡¼¤¬µ¯¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.BR putwchar () +´Ø¿ô¤Ï \fIwc\fP ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤­¤¿¾ì¹ç¤Ï +.B WEOF +¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR putwchar () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +.BR putwchar () +¤¬¼ÂºÝ¤Ë¤Ï¥ï¥¤¥Éʸ»ú \fIwc\fP ¤ÈÅù²Á¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò +½ñ¤­½Ð¤¹¤³¤È¤ò´üÂÔ¤·¤Æ¤â¤è¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fputwc (3), +.BR unlocked_stdio (3) diff --git a/release/man3/qecvt.3 b/release/man3/qecvt.3 new file mode 100644 index 00000000..0f76d02a --- /dev/null +++ b/release/man3/qecvt.3 @@ -0,0 +1,85 @@ +.\" Copyright (C) 2002 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. +.\" +.\" 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 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +qecvt, qfcvt, qgcvt \- ÉâÆ°¾®¿ôÅÀ¿ô¤Îʸ»úÎó¤Ø¤ÎÊÑ´¹ +.SH ½ñ¼° +.B #include +.sp +.BI "char *qecvt(long double " number ", int " ndigits ", int *" decpt , +.BI "int *" sign ); +.sp +.BI "char *qfcvt(long double " number ", int " ndigits ", int *" decpt , +.BI "int *" sign ); +.sp +.BI "char *qgcvt(long double " number ", int " ndigit ", char *" buf ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR qecvt (), +.BR qfcvt (), +.BR qgcvt (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.ad b +.SH ÀâÌÀ +´Ø¿ô +.BR qecvt (), +.BR qfcvt (), +.BR qgcvt () +¤Ï¡¢¤½¤ì¤¾¤ì +.BR ecvt (3), +.BR fcvt (3), +.BR gcvt (3) +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +°ú¤­¿ô +.I number +¤¬ +.I "long double" +·¿¤Ç¤¢¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +.SH ½àµò +SVr4. +¿¤¯¤Î°ìÈÌŪ¤Ê Unix ¤Ë¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢SunOS ¤Ë¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +libc4 ¤È libc5 ¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +glibc ¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÇѻߤµ¤ì¤¿¡£Âå¤ï¤ê¤Ë +.BR sprintf (3) +¤Î»ÈÍѤò¿ä¾©¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ecvt (3), +.BR ecvt_r (3), +.BR gcvt (3), +.BR sprintf (3) diff --git a/release/man3/qsort.3 b/release/man3/qsort.3 new file mode 100644 index 00000000..788f2ce1 --- /dev/null +++ b/release/man3/qsort.3 @@ -0,0 +1,124 @@ +.\" 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-07-24, Rik Faith (faith@cs.unc.edu) +.\" 2006-01-15, mtk, Added example program. +.\" +.\" FIXME glibc 2.8 added qsort_r(), which needs to be documented. +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated 1997-01-21, YOSHINO Takashi +.\" Updated & Modified 2004-06-06, Yuichi SATO +.\" Updated 2006-01-18, Akihiro MOTOKI +.\" +.TH QSORT 3 2009-09-15 "" "Linux Programmer's Manual" +.SH ̾Á° +qsort \- ÇÛÎó¤òʤÙÊѤ¨¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void qsort(void *" base ", size_t " nmemb ", size_t " size , +.BI " int(*" compar ")(const void *, const void *));" +.fi +.SH ÀâÌÀ +.BR qsort () +´Ø¿ô¤Ï¡¢ +\fInmemb\fP ¸Ä¤ÎÂ礭¤µ \fIsize\fP ¤ÎÍ×ÁǤò¤â¤ÄÇÛÎó¤òʤÙÊѤ¨¤ë¡£ +\fIbase\fP °ú¤­¿ô¤ÏÇÛÎó¤ÎÀèƬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.PP +\fIcompar\fP ¤ò¥Ý¥¤¥ó¥¿¤È¤¹¤ëÈæ³Ó´Ø¿ô¤Ë¤è¤Ã¤Æ¡¢ +ÇÛÎó¤ÎÃæ¿È¤Ï¾º½ç (ÃͤÎÂ礭¤¤¤â¤Î¤Û¤É¸å¤ËʤֽçÈÖ) ¤Ëʤ٤é¤ì¤ë¡£ +Èæ³Ó´Ø¿ô¤Î°ú¤­¿ô¤ÏÈæ³Ó¤µ¤ì¤ë¤Õ¤¿¤Ä¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.PP +Èæ³Ó´Ø¿ô¤Ï¡¢Âè°ì°ú¤­¿ô¤¬ÂèÆó°ú¤­¿ô¤ËÂФ·¤Æ¡¢ +1) ¾®¤µ¤¤¡¢2) Åù¤·¤¤¡¢3) Â礭¤¤¤Î¤½¤ì¤¾¤ì¤Ë±þ¤¸¤Æ¡¢ +1) ¥¼¥í¤è¤ê¾®¤µ¤¤À°¿ô¡¢2) ¥¼¥í¡¢3) ¥¼¥í¤è¤êÂ礭¤¤À°¿ô¤Î +¤¤¤º¤ì¤«¤òÊÖ¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Æó¤Ä¤ÎÍ×ÁǤÎÈæ³Ó·ë²Ì¤¬Åù¤·¤¤¤È¤­¡¢ +ʤÙÊѤ¨¤¿¸å¤ÎÇÛÎó¤Ç¤Ï¡¢¤³¤ì¤éÆó¤Ä¤Î½ç½ø¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR qsort () +¤ÏÃͤòÊÖ¤µ¤Ê¤¤¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.SH Ãí°Õ +.I compar +°ú¤­¿ô¤Ë»ÈÍѤ¹¤ë¤Î¤ËŬ¤·¤Æ¤¤¤ë¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó¤È¤·¤Æ¤Ï +.BR alphasort (3), +.BR versionsort (3) +¤¬¤¢¤ë¡£ +C ¤Îʸ»úÎó¤òÈæ³Ó¤¹¤ë¾ì¹ç¡¢°Ê²¼¤ÎÎã¤Ë¤¢¤ë¤è¤¦¤ËÈæ³Ó´Ø¿ô¤Ç +.BR strcmp (3) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤â¤Ç¤­¤ë¡£ +.SH Îã +»ÈÍÑÎã¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR bsearch (3) +¤Ë¤¢¤ëÎã¤ò»²¾È¤¹¤ë¤³¤È¡£ + +°Ê²¼¤Î¥×¥í¥°¥é¥à¤ËÊ̤λÈÍÑÎã¤ò¼¨¤¹¡£¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿Ê¸»úÎó¤ÎʤӴ¹¤¨¤ò¹Ô¤¦¡£ +.sp +.nf +#include +#include +#include + +static int +cmpstringp(const void *p1, const void *p2) +{ + /* ¤³¤Î´Ø¿ô¤Î¼ÂºÝ¤Î°ú¤­¿ô¤Ï "char ·¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤Î¥Ý¥¤¥ó¥¿" ¤À¤¬¡¢ + strcmp(3) ¤Î°ú¤­¿ô¤Ï "char ·¿¤Ø¤Î¥Ý¥¤¥ó¥¿" ¤Ç¤¢¤ë¡£ + ¤½¤³¤Ç¡¢°Ê²¼¤Î¤è¤¦¤Ë¥­¥ã¥¹¥È¤ò¤·¤Æ¤«¤é¥Ý¥¤¥ó¥¿¤ÎµÕ»²¾È¤ò¹Ô¤¦¡£*/ + + return strcmp(* (char * const *) p1, * (char * const *) p2); +} + +int +main(int argc, char *argv[]) +{ + int j; + + if (argc < 2) { + fprintf(stderr, "Usage: %s ...\\n", argv[0]); + exit(EXIT_FAILURE); + } + + qsort(&argv[1], argc \- 1, sizeof(char *), cmpstringp); + + for (j = 1; j < argc; j++) + puts(argv[j]); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR sort (1), +.BR alphasort (3), +.BR strcmp (3), +.BR versionsort (3) diff --git a/release/man3/queue.3 b/release/man3/queue.3 new file mode 100644 index 00000000..73c44dca --- /dev/null +++ b/release/man3/queue.3 @@ -0,0 +1,489 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)queue.3 8.2 (Berkeley) 1/24/94 +.\" +.\" hch, 2002-03-25 +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Thu Sep 2 04:41:11 JST 2004 +.\" by Yuichi SATO +.\" +.\"WORD: circular queue ½Û´Ä¥­¥å¡¼ +.\" +.TH QUEUE 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +LIST_ENTRY, LIST_HEAD, LIST_INIT, LIST_INSERT_AFTER, \ +LIST_INSERT_HEAD, LIST_REMOVE, TAILQ_ENTRY, TAILQ_HEAD, \ +TAILQ_INIT, TAILQ_INSERT_AFTER, TAILQ_INSERT_HEAD, TAILQ_INSERT_TAIL, \ +TAILQ_REMOVE, CIRCLEQ_ENTRY, CIRCLEQ_HEAD, CIRCLEQ_INIT, \ +CIRCLEQ_INSERT_AFTER, CIRCLEQ_INSERT_BEFORE, \ +CIRCLEQ_INSERT_HEAD, CIRCLEQ_INSERT_TAIL, \ +CIRCLEQ_REMOVE \- ¥ê¥¹¥È¡¦¥Æ¡¼¥ë (tail) ¥­¥å¡¼¡¦½Û´Ä¥­¥å¡¼¤Î¼ÂÁõ +.SH ½ñ¼° +.nf +.B #include + +.BI "LIST_ENTRY(" TYPE ); +.BI "LIST_HEAD(" HEADNAME ", " TYPE ); +.BI "LIST_INIT(LIST_HEAD *" head ); +.BI "LIST_INSERT_AFTER(LIST_ENTRY *" listelm ", " +.BI " TYPE *" elm ", LIST_ENTRY " NAME ); +.BI "LIST_INSERT_HEAD(LIST_HEAD *" head ", " +.BI " TYPE *" elm ", LIST_ENTRY " NAME ); +.BI "LIST_REMOVE(TYPE *" elm ", LIST_ENTRY " NAME ); + +.BI "TAILQ_ENTRY(" TYPE ); +.BI "TAILQ_HEAD("HEADNAME ", " TYPE ); +.BI "TAILQ_INIT(TAILQ_HEAD *" head ); +.BI "TAILQ_INSERT_AFTER(TAILQ_HEAD *" head ", TYPE *" listelm ", " +.BI " TYPE *" elm ", TAILQ_ENTRY " NAME ); +.BI "TAILQ_INSERT_HEAD(TAILQ_HEAD *" head ", " +.BI " TYPE *" elm ", TAILQ_ENTRY " NAME ); +.BI "TAILQ_INSERT_TAIL(TAILQ_HEAD *" head ", " +.BI " TYPE *" elm ", TAILQ_ENTRY " NAME ); +.BI "TAILQ_REMOVE(TAILQ_HEAD *" head ", TYPE *" elm ", TAILQ_ENTRY " NAME ); + +.BI CIRCLEQ_ENTRY( TYPE ); +.BI "CIRCLEQ_HEAD(" HEADNAME ", " TYPE ); +.BI "CIRCLEQ_INIT(CIRCLEQ_HEAD *" head ); +.BI "CIRCLEQ_INSERT_AFTER(CIRCLEQ_HEAD *" head ", TYPE *" listelm ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.BI "CIRCLEQ_INSERT_BEFORE(CIRCLEQ_HEAD *" head ", TYPE *" listelm ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.BI "CIRCLEQ_INSERT_HEAD(CIRCLEQ_HEAD *" head ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.BI "CIRCLEQ_INSERT_TAIL(CIRCLEQ_HEAD *" head ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.BI "CIRCLEQ_REMOVE(CIRCLEQ_HEAD *" head ", " +.BI " TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); +.fi +.SH ÀâÌÀ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï¡¢¼¡¤Î 3 ¤Ä¤Î¥Ç¡¼¥¿¹½Â¤¤òÄêµÁ¤·¤ÆÁàºî¤¹¤ë: +¥ê¥¹¥È¡¦¥Æ¡¼¥ë¥­¥å¡¼¡¦½Û´Ä¥­¥å¡¼¡£ +3 ¤Ä¤Î¥Ç¡¼¥¿¹½Â¤¤¹¤Ù¤Æ¤Ë¤ª¤¤¤Æ°Ê²¼¤Îµ¡Ç½¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë: +.sp +.RS 4 +.PD 0 +.IP * 4 +¿·¤¿¤Ê¥¨¥ó¥È¥ê¤ò¥ê¥¹¥È¤ÎÀèƬ¤ËÁÞÆþ¤¹¤ë¡£ +.IP * +¿·¤¿¤Ê¥¨¥ó¥È¥ê¤ò¥ê¥¹¥È¤Î¤É¤ÎÍ×ÁǤè¤ê¤â¸å¤ËÁÞÆþ¤¹¤ë¡£ +.IP * +¥ê¥¹¥È¤ÎǤ°Õ¤Î¥¨¥ó¥È¥ê¤òºï½ü¤¹¤ë¡£ +.IP * +¥ê¥¹¥È¤ò½çÊý¸þ¤Ëé¤ë¡£ +.PD +.RE +.PP +¥ê¥¹¥È¤Ï 3 ¤Ä¤Î¥Ç¡¼¥¿¹½Â¤¤ÎÃæ¤ÇºÇ¤âñ½ã¤Ç¤¢¤ê¡¢ +¾åµ­¤Îµ¡Ç½¤Î¤ß¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ + +¥Æ¡¼¥ë¥­¥å¡¼¤Ï°Ê²¼¤Îµ¡Ç½¤òÄɲ乤ë: +.RS 4 +.IP * 4 +¥¨¥ó¥È¥ê¤ò¥ê¥¹¥È¤ÎºÇ¸å¤ËÄɲäǤ­¤ë¡£ +.RE +.PP +¤¿¤À¤·: +.sp +.RS 4 +.PD 0 +.IP 1. 4 +Á´¤Æ¤Î¥ê¥¹¥ÈÁÞÆþ¤Èºï½ü¤Ë¤ª¤¤¤Æ¡¢¥ê¥¹¥È¤ÎÀèƬ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP 2. +³ÆÀèƬ¥¨¥ó¥È¥ê¤Ï 1 ¤Ä¤Ç¤Ï¤Ê¤¯ 2 ¤Ä¤Î¥Ý¥¤¥ó¥¿¤òɬÍפȤ¹¤ë¡£ +.IP 3. +¥ê¥¹¥È¤ÈÈæ¤Ù¤Æ¡¢¥³¡¼¥É¥µ¥¤¥º¤Ï 15% Â礭¤¯¤Ê¤ê¡¢Áàºî¤Ï 20% ÃÙ¤¯¤Ê¤ë¡£ +.PD +.RE +.PP +½Û´Ä¥­¥å¡¼¤Ï°Ê²¼¤Îµ¡Ç½¤òÄɲ乤ë: +.sp +.RS 4 +.PD 0 +.IP * 4 +¥¨¥ó¥È¥ê¤ò¥ê¥¹¥È¤ÎºÇ¸å¤ËÄɲäǤ­¤ë¡£ +.IP * +¥¨¥ó¥È¥ê¤ò¾¤Î¥¨¥ó¥È¥ê¤ÎÁ°¤ËÄɲäǤ­¤ë¡£ +.IP * +µÕÊý¸þ¤ËËöÈø¤«¤éÀèƬ¤Øé¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PD +.RE +.PP +¤¿¤À¤·: +.sp +.RS 4 +.PD 0 +.IP 1. 4 +Á´¤Æ¤Î¥ê¥¹¥ÈÁÞÆþ¤Èºï½ü¤Ë¤ª¤¤¤Æ¡¢¥ê¥¹¥È¤ÎÀèƬ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP 2. +³ÆÀèƬ¥¨¥ó¥È¥ê¤Ï 1 ¤Ä¤Ç¤Ï¤Ê¤¯ 2 ¤Ä¤Î¥Ý¥¤¥ó¥¿¤òɬÍפȤ¹¤ë¡£ +.IP 3. +é¤ëºÝ¤Î½ªÎ»¾ò·ï¤¬¤è¤êÊ£»¨¤Ç¤¢¤ë¡£ +.IP 4. +¥ê¥¹¥È¤ÈÈæ¤Ù¤Æ¡¢¥³¡¼¥É¥µ¥¤¥º¤Ï 40% Â礭¤¯¤Ê¤ê¡¢Áàºî¤Ï 45% ÃÙ¤¯¤Ê¤ë¡£ +.PD +.RE +.PP +¥Þ¥¯¥íÄêµÁ¤Ë¤ª¤¤¤Æ +.I TYPE +¤Ï¥æ¡¼¥¶ÄêµÁ¹½Â¤ÂΤÎ̾Á°¤Ç¤¢¤ê¡¢ +.BR LIST_ENTRY , +.BR TAILQ_ENTRY , +.BR CIRCLEQ_ENTRY +¤Î²¿¤ì¤«·¿¤Î¥Õ¥£¡¼¥ë¥É¤È +»ØÄꤵ¤ì¤¿ +.I NAME +¤ò´Þ¤Þ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +°ú¤­¿ô +.I HEADNAME +¤Ï¥æ¡¼¥¶ÄêµÁ¹½Â¤ÂΤÎ̾Á°¤Ç¤¢¤ê¡¢ +¥Þ¥¯¥í +.BR LIST_HEAD , +.BR TAILQ_HEAD , +.BR CIRCLEQ_HEAD +¤òÍѤ¤¤ÆÀë¸À¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤¬¤É¤Î¤è¤¦¤Ë»È¤ï¤ì¤ë¤«¤Ë¤Ä¤¤¤Æ¤Î¹¹¤Ê¤ëÀâÌÀ¤Ï¡¢ +°Ê²¼¤ÎÎã¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SS ¥ê¥¹¥È +¥ê¥¹¥È¤ÎÀèƬ¤Ë¤Ï¡¢ +.B LIST_HEAD +¥Þ¥¯¥í¤ÇÄêµÁ¤µ¤ì¤ë¹½Â¤ÂΤ¬ÃÖ¤«¤ì¤ë¡£ +¤³¤Î¹½Â¤ÂΤϥꥹ¥È¤ÎºÇ½é¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿¤ò 1 ¤Ä´Þ¤à¡£ +Í×ÁÇ¤Ï 2 ½Å¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤ª¤ê¡¢ +Ǥ°Õ¤ÎÍ×ÁǤϥꥹ¥È¤òé¤é¤º¤Ëºï½ü¤Ç¤­¤ë¡£ +¿·¤·¤¤Í×ÁǤϴû¸¤ÎÍ×ÁǤθå¤Þ¤¿¤Ï¥ê¥¹¥È¤ÎÀèƬ¤ËÄɲäǤ­¤ë¡£ +.B LIST_HEAD +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +LIST_HEAD(HEADNAME, TYPE) head; +.fi +.in +.PP +¤³¤³¤Ç +.I HEADNAME +¤ÏÄêµÁ¤µ¤ì¤ë¹½Â¤ÂΤÎ̾Á°¤Ç¤¢¤ê¡¢ +.I TYPE +¤Ï¥ê¥ó¥¯Æâ¤Ç¥ê¥ó¥¯¤µ¤ì¤ëÍ×ÁǤη¿¤Ç¤¢¤ë¡£ +¥ê¥¹¥È¤ÎÀèƬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢¤½¤Î¸å¤Ç¼¡¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤ë: +.in +4n +.nf + +struct HEADNAME *headp; +.fi +.in +.PP +(̾Á° +.IR "head" +¤È +.IR "headp" +¤Ï¥æ¡¼¥¶¤¬ÁªÂò¤Ç¤­¤ë¡£) +.PP +¥Þ¥¯¥í +.B LIST_ENTRY +¤Ï¥ê¥¹¥È¤ÎÍ×ÁǤòÀܳ¤¹¤ë¹½Â¤ÂΤòÀë¸À¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B LIST_INIT +¤Ï +.I head +¤Ç»²¾È¤µ¤ì¤ë¥ê¥¹¥È¤ò½é´ü²½¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B LIST_INSERT_HEAD +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤ò¥ê¥¹¥È¤ÎÀèƬ¤ËÁÞÆþ¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B LIST_INSERT_AFTER +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤òÍ×ÁÇ +.I listelm +¤Î¸å¤ËÁÞÆþ¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B LIST_REMOVE +¤ÏÍ×ÁÇ +.I elm +¤ò¥ê¥¹¥È¤«¤éºï½ü¤¹¤ë¡£ +.SS ¥ê¥¹¥È¤ÎÎã +.nf + +LIST_HEAD(listhead, entry) head; +struct listhead *headp; /* ¥ê¥¹¥È¤ÎÀèƬ¡£*/ +struct entry { + ... + LIST_ENTRY(entry) entries; /* ¥ê¥¹¥È¡£ */ + ... +} *n1, *n2, *np; + +LIST_INIT(&head); /* ¥ê¥¹¥È¤ò½é´ü²½¤¹¤ë¡£*/ + +n1 = malloc(sizeof(struct entry)); /* ÀèƬ¤ËÁÞÆþ¤¹¤ë¡£*/ +LIST_INSERT_HEAD(&head, n1, entries); + +n2 = malloc(sizeof(struct entry)); /* ¸å¤í¤ËÁÞÆþ¤¹¤ë¡£*/ +LIST_INSERT_AFTER(n1, n2, entries); + /* ½çÊý¸þ¤Ëé¤ë¡£*/ +for (np = head.lh_first; np != NULL; np = np\->entries.le_next) + np\-> ... + +while (head.lh_first != NULL) /* ºï½ü¤¹¤ë¡£*/ + LIST_REMOVE(head.lh_first, entries); +.fi +.SS ¥Æ¡¼¥ë¥­¥å¡¼ +¥Æ¡¼¥ë¥­¥å¡¼¤ÎÀèƬ¤Ë¤Ï +.B TAILQ_HEAD +¥Þ¥¯¥í¤ÇÄêµÁ¤µ¤ì¤ë¹½Â¤ÂΤ¬ÃÖ¤«¤ì¤ë¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï 1 ÁȤΥݥ¤¥ó¥¿¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +1 ¤Ä¤Ï¥Æ¡¼¥ë¥­¥å¡¼¤ÎºÇ½é¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ê¡¢ +¤â¤¦ 1 ¤Ä¤Ï¥Æ¡¼¥ë¥­¥å¡¼¤ÎºÇ¸å¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +Í×ÁÇ¤Ï 2 ½Å¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤ª¤ê¡¢ +Ǥ°Õ¤ÎÍ×ÁǤϥơ¼¥ë¥­¥å¡¼¤òé¤é¤º¤Ëºï½ü¤Ç¤­¤ë¡£ +¿·¤·¤¤Í×ÁǤϴû¸¤ÎÍ×ÁǤθå¤Þ¤¿¤Ï¥Æ¡¼¥ë¥­¥å¡¼¤ÎÀèƬ¤Þ¤¿¤ÏËöÈø¤ËÄɲäǤ­¤ë¡£ +.B TAILQ_HEAD +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +TAILQ_HEAD(HEADNAME, TYPE) head; +.fi +.in +.PP +¤³¤³¤Ç +.Li HEADNAME +¤ÏÄêµÁ¤µ¤ì¤ë¹½Â¤ÂΤÎ̾Á°¤Ç¤¢¤ê¡¢ +.Li TYPE +¤Ï¥Æ¡¼¥ë¥­¥å¡¼Æâ¤Ç¥ê¥ó¥¯¤µ¤ì¤ëÍ×ÁǤη¿¤Ç¤¢¤ë¡£ +¥Æ¡¼¥ë¥­¥å¡¼¤ÎÀèƬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢¤½¤Î¸å¤Ç¼¡¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤ë: +.in +4n +.nf + +struct HEADNAME *headp; +.fi +.in +.PP +(̾Á° +.IR "head" +¤È +.IR "headp" +¤Ï¥æ¡¼¥¶¤¬ÁªÂò¤Ç¤­¤ë¡£) +.PP +¥Þ¥¯¥í +.B TAILQ_ENTRY +¤Ï¥Æ¡¼¥ë¥­¥å¡¼¤ÎÍ×ÁǤòÀܳ¤¹¤ë¹½Â¤ÂΤòÀë¸À¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B TAILQ_INIT +¤Ï +.I head +¤Ç»²¾È¤µ¤ì¤ë¥Æ¡¼¥ë¥­¥å¡¼¤ò½é´ü²½¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B TAILQ_INSERT_HEAD +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤ò¥Æ¡¼¥ë¥­¥å¡¼¤ÎÀèƬ¤ËÁÞÆþ¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B TAILQ_INSERT_TAIL +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤ò¥Æ¡¼¥ë¥­¥å¡¼¤ÎËöÈø¤ËÁÞÆþ¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B TAILQ_INSERT_AFTER +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤òÍ×ÁÇ +.Fa listelm +¤Î¸å¤ËÁÞÆþ¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B TAILQ_REMOVE +¤ÏÍ×ÁÇ +.I elm +¤ò¥Æ¡¼¥ë¥­¥å¡¼¤«¤éºï½ü¤¹¤ë¡£ +.SS ¥Æ¡¼¥ë¥­¥å¡¼¤ÎÎã +.nf + +TAILQ_HEAD(tailhead, entry) head; +struct tailhead *headp; /* ¥Æ¡¼¥ë¥­¥å¡¼¤ÎÀèƬ¡£*/ +struct entry { + ... + TAILQ_ENTRY(entry) entries; /* ¥Æ¡¼¥ë¥­¥å¡¼¡£*/ + ... +} *n1, *n2, *np; + +TAILQ_INIT(&head); /* ¥­¥å¡¼¤ò½é´ü²½¤¹¤ë¡£*/ + +n1 = malloc(sizeof(struct entry)); /* ÀèƬ¤ËÁÞÆþ¤¹¤ë¡£*/ +TAILQ_INSERT_HEAD(&head, n1, entries); + +n1 = malloc(sizeof(struct entry)); /* ËöÈø¤ËÁÞÆþ¤¹¤ë¡£*/ +TAILQ_INSERT_TAIL(&head, n1, entries); + +n2 = malloc(sizeof(struct entry)); /* ¸å¤í¤ËÁÞÆþ¤¹¤ë¡£*/ +TAILQ_INSERT_AFTER(&head, n1, n2, entries); + /* ½çÊý¸þ¤Ëé¤ë¡£*/ +for (np = head.tqh_first; np != NULL; np = np\->entries.tqe_next) + np\-> ... + /* ºï½ü¤¹¤ë¡£*/ +while (head.tqh_first != NULL) + TAILQ_REMOVE(&head, head.tqh_first, entries); +.fi +.SS ½Û´Ä¥­¥å¡¼ +½Û´Ä¥­¥å¡¼¤ÎÀèƬ¤Ë¤Ï +.B CIRCLEQ_HEAD +¥Þ¥¯¥í¤ÇÄêµÁ¤µ¤ì¤ë¹½Â¤ÂΤ¬ÃÖ¤«¤ì¤ë¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï 1 ÁȤΥݥ¤¥ó¥¿¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +1 ¤Ä¤Ï½Û´Ä¥­¥å¡¼¤ÎºÇ½é¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ê¡¢ +¤â¤¦ 1 ¤Ä¤Ï½Û´Ä¥­¥å¡¼¤ÎºÇ¸å¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +Í×ÁÇ¤Ï 2 ½Å¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤ª¤ê¡¢ +Ǥ°Õ¤ÎÍ×ÁǤϥ­¥å¡¼¤òé¤é¤º¤Ëºï½ü¤Ç¤­¤ë¡£ +¿·¤·¤¤Í×ÁǤϡ¢´û¸¤ÎÍ×ÁǤθå¤Þ¤¿¤ÏÁ°¡¢¤Þ¤¿¤Ï¥­¥å¡¼¤ÎÀèƬ¤Þ¤¿¤ÏËöÈø¤ËÄɲäǤ­¤ë¡£ +A +.B CIRCLEQ_HEAD +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +CIRCLEQ_HEAD(HEADNAME, TYPE) head; +.fi +.in +.PP +¤³¤³¤Ç +.IR "HEADNAME" +¤ÏÄêµÁ¤µ¤ì¤ë¹½Â¤ÂΤÎ̾Á°¤Ç¤¢¤ê¡¢ +.IR "TYPE" +¤Ï½Û´Ä¥­¥å¡¼Æâ¤Ç¥ê¥ó¥¯¤µ¤ì¤ëÍ×ÁǤη¿¤Ç¤¢¤ë¡£ +½Û´Ä¥­¥å¡¼¤ÎÀèƬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢¤½¤Î¸å¤Ç¼¡¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤ë: +.in +4n +.nf + +struct HEADNAME *headp; +.fi +.in +.PP +(̾Á° +.I head +¤È +.I headp +¤Ï¥æ¡¼¥¶¤¬ÁªÂò¤Ç¤­¤ë¡£) +.PP +¥Þ¥¯¥í +.B CIRCLEQ_ENTRY +¤Ï½Û´Ä¥­¥å¡¼¤ÎÍ×ÁǤòÀܳ¤¹¤ë¹½Â¤ÂΤòÀë¸À¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B CIRCLEQ_INIT +¤Ï +.I head +¤Ç»²¾È¤µ¤ì¤ë½Û´Ä¥­¥å¡¼¤ò½é´ü²½¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B CIRCLEQ_INSERT_HEAD +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤ò½Û´Ä¥­¥å¡¼¤ÎÀèƬ¤ËÁÞÆþ¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B CIRCLEQ_INSERT_TAIL +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤ò½Û´Ä¥­¥å¡¼¤ÎËöÈø¤ËÁÞÆþ¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B CIRCLEQ_INSERT_AFTER +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤òÍ×ÁÇ +.I listelm +¤Î¸å¤ËÁÞÆþ¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B CIRCLEQ_INSERT_AFTER +¤Ï¿·¤¿¤ÊÍ×ÁÇ +.I elm +¤òÍ×ÁÇ +.I listelm +¤ÎÁ°¤ËÁÞÆþ¤¹¤ë¡£ +.PP +¥Þ¥¯¥í +.B CIRCLEQ_REMOVE +¤ÏÍ×ÁÇ +.I elm +¤ò½Û´Ä¥­¥å¡¼¤«¤éºï½ü¤¹¤ë¡£ +.SS ½Û´Ä¥­¥å¡¼¤ÎÎã +.nf + +CIRCLEQ_HEAD(circleq, entry) head; +struct circleq *headp; /* ½Û´Ä¥­¥å¡¼¤ÎÀèƬ¡£*/ +struct entry { + ... + CIRCLEQ_ENTRY(entry) entries; /* ½Û´Ä¥­¥å¡¼¡£*/ + ... +} *n1, *n2, *np; + +CIRCLEQ_INIT(&head); /* ½Û´Ä¥­¥å¡¼¤ò½é´ü²½¤¹¤ë¡£*/ + +n1 = malloc(sizeof(struct entry)); /* ÀèƬ¤ËÁÞÆþ¤¹¤ë¡£*/ +CIRCLEQ_INSERT_HEAD(&head, n1, entries); + +n1 = malloc(sizeof(struct entry)); /* ËöÈø¤ËÁÞÆþ¤¹¤ë¡£*/ +CIRCLEQ_INSERT_TAIL(&head, n1, entries); + +n2 = malloc(sizeof(struct entry)); /* ¸å¤í¤ËÁÞÆþ¤¹¤ë¡£*/ +CIRCLEQ_INSERT_AFTER(&head, n1, n2, entries); + +n2 = malloc(sizeof(struct entry)); /* Á°¤ËÁÞÆþ¤¹¤ë¡£*/ +CIRCLEQ_INSERT_BEFORE(&head, n1, n2, entries); + /* ½çÊý¸þ¤Ëé¤ë¡£*/ +for (np = head.cqh_first; np != (void *)&head; np = np\->entries.cqe_next) + np\-> ... + /* µÕÊý¸þ¤Ëé¤ë¡£*/ +for (np = head.cqh_last; np != (void *)&head; np = np\->entries.cqe_prev) + np\-> ... + /* ºï½ü¤¹¤ë¡£*/ +while (head.cqh_first != (void *)&head) + CIRCLEQ_REMOVE(&head, head.cqh_first, entries); +.fi +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¤Ë¸ºß¤¹¤ë¡£ +queue ´Ø¿ô¤Ï 4.4BSD ¤Ç½é¤á¤ÆÅо줷¤¿¡£ diff --git a/release/man3/raise.3 b/release/man3/raise.3 new file mode 100644 index 00000000..1cb68234 --- /dev/null +++ b/release/man3/raise.3 @@ -0,0 +1,73 @@ +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" and Copyright (C) 2008 Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated 1997-12-25, HIROFUMI Nishizuka +.\" Updated 2008-08-08, Akihiro MOTOKI , LDP v3.05 +.\" +.\" 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 18:40:56 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995 by Mike Battersby (mib@deakin.edu.au) +.\" +.TH RAISE 3 2008-10-17 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +raise \- ¸Æ¤Ó½Ð¤·¸µ¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int raise(int " sig ); +.fi +.SH ÀâÌÀ +.BR raise () +´Ø¿ô¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤â¤·¤¯¤Ï¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +¥·¥ó¥°¥ë¥¹¥ì¥Ã¥É¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¡¢°Ê²¼¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.sp +.in +4n +.nf +kill(getpid(), sig); +.fi +.in +.PP +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¡¢°Ê²¼¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.sp +.in +4n +.nf +pthread_kill(pthread_self(), sig); +.fi +.in +.PP +¥·¥°¥Ê¥ë¤Ëµ¯°ø¤·¤Æ¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR raise () +¤¬ÊÖ¤ë¤Î¤Ïɬ¤º¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬Ê֤俸å¤Ë¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤ò¡¢¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +.SH ½àµò +C89, C99, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR getpid (2), +.BR kill (2), +.BR sigaction (2), +.BR signal (2), +.BR pthread_kill (3), +.BR signal (7) diff --git a/release/man3/rand.3 b/release/man3/rand.3 new file mode 100644 index 00000000..bc2327fb --- /dev/null +++ b/release/man3/rand.3 @@ -0,0 +1,166 @@ +.\" 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" +.SH ̾Á° +rand, srand \- Íð¿ô¤òÀ¸À®¤¹¤ë´Ø¿ô +.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 +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR rand_r (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.SH ÀâÌÀ +.BR rand () +´Ø¿ô¤Ï [0,\ \fBRAND_MAX\fR] ¤ÎÈϰϤε¿»÷Íð¿ôÀ°¿ô¤òÊÖ¤¹¡£ +.PP +.BR srand () +´Ø¿ô¤Ï¡¢ +.BR rand () +´Ø¿ô¤Çºî¤é¤ì¤ëµ¿»÷Íð¿ôÀ°¿ô·ÏÎó¤Î¿·¤·¤¤¼ï¤È¤·¤Æ¡¢ +¤½¤Î°ú¤­¿ô¤ÎÃͤò»ÈÍѤ¹¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤ò»ÈÍѤ·¤Æºî¤é¤ì¤¿µ¿»÷Íð¿ô·ÏÎó¤Ï¡¢ +Ʊ¤¸Ãͤò°ú¤­¿ô¤È¤·¤Æ +.BR srand () +¤ò¸Æ¤Ö¤³¤È¤Ç¡¢ +ºÆ¸½¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¡£ +.PP +¼ï¤ÎÃͤ¬Í¿¤¨¤é¤ì¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +.BR rand () +´Ø¿ô¤Ï +¼«Æ°Åª¤Ë 1 ¤ò¼ï¤È¤¹¤ë¡£ +.PP +.BR rand () +´Ø¿ô¤ÏºÆÆþ²Äǽ (reentrant) ¤Ç¤Ï¤Ê¤¤¡¢¤Ä¤Þ¤ê¥¹¥ì¥Ã¥É¡¦¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢¤³¤Î´Ø¿ô¤Ï±£¤·¾õÂÖ¤ò»ý¤Ã¤Æ¤ª¤ê¡¢¸Æ¤Ó½Ð¤µ¤ì¤ëÅÙ¤ËÊѹ¹¤¹¤ë¤«¤é¤Ç¤¢¤ë¡£ +¤Á¤ç¤¦¤É¤³¤Î±£¤·¾õÂÖ¤¬¼¡¤Î¸Æ¤Ó½Ð¤·»þ¤ÎÍð¿ô¤Î¼ï¤È¤·¤Æ»È¤ï¤ì¤ë¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +¼ÂºÝ¤Ë¤Ï¤â¤¦¾¯¤·Ê£»¨¤«¤â¤·¤ì¤Ê¤¤¤¬¡£¥¹¥ì¥Ã¥É¤ò»ÈÍѤ¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç +ºÆ¸½²Äǽ¤ÊÆ°ºî¤ò¤µ¤»¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢¤³¤Î±£¤·¾õÂÖ¤¬¸¶°ø¤ÇºÆ¸½À­¤¬¤Ê¤¯¤Ê¤ë¡£ +.BR rand_r () +´Ø¿ô¤Ï +.I unsigned int +·¿¤ÎÊÑ¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò°ú¤­¿ô¤Ë¤È¤ê¡¢ +¤³¤ÎÊÑ¿ô¤ò¾õÂÖ³ÊǼÍѤ˻ÈÍѤ¹¤ë¡£ +¾õÂÖ¿ô¤¬Èó¾ï¤Ë¾®¤µ¤¤¤Î¤Ç¡¢¤³¤Î´Ø¿ô¤Ï¤¢¤Þ¤ê¤è¤¤µ¼»÷Íð¿ôÀ¸À®´ï¤È¤Ï¸À¤¨¤Ê¤¤¤À¤í¤¦¡£ +Âå¤ï¤ê¤Ë +.BR drand48_r (3) +¤ò»È¤¦¤È¤è¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR rand () +¤È +.BR rand_r () +´Ø¿ô¤Ï 0 ¤È +.B RAND_MAX +¤Î´Ö¤Î¿ô¤òÊÖ¤¹¡£ +.BR srand () +´Ø¿ô¤ÏÃͤòÊÖ¤µ¤Ê¤¤¡£ +.SH ½àµò +´Ø¿ô +.BR rand () +¤È +.BR srand () +¤Ï SVr4, 4.3BSD, C89, C99, POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +´Ø¿ô +.BR rand_r () +¤Ï POSIX.1-2001 ¤ËͳÍ褹¤ë¡£ +POSIX.1-2008 ¤Ï¡¢ +.BR rand_r () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.BR rand () +¤È +.BR srand () +¤Î Linux C Library ÈǤϡ¢ +.BR random (3) +¤È +.BR srandom (3) +¤Îξ´Ø¿ô¤ÈƱ¤¸Íð¿ôÀ¸À® +¥¢¥ë¥´¥ê¥º¥à¤ò»ÈÍѤ·¤Æ¤¤¤ë¡£¤½¤Î¤¿¤á¡¢²¼°Ì¤Î¥Ó¥Ã¥È¤Ï¾å°Ì¤Î¥Ó¥Ã¥È¤È +Ʊ¤¸¤¯¤é¤¤¤Ë¥é¥ó¥À¥à¤Ç¤¢¤ë¡£ +¤·¤«¤·¡¢µìÈǤΠ+.BR rand () +¤Î¼ÂÁõ¤ä¡¢Â¾¤Î¥·¥¹¥Æ¥à¤Î¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢²¼°Ì¤Î¥Ó¥Ã¥È¤¬¾å°Ì¤Î¥Ó¥Ã¥È¤Û¤É +¥é¥ó¥À¥à¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¡£°Ü¿¢À­¤ò¹â¤á¤ë¾ì¹ç¤Ç¤â¡¢ÀºÅ٤ι⤤Íð¿ô¤¬É¬Í×¤Ê +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤Î´Ø¿ô¤Ï»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤ +(Âå¤ï¤ê¤Ë +.BR random (3) +¤ò»È¤¦¤³¤È)¡£ +.SH Îã +POSIX 1003.1-2003 ¤Ç¤Ï¡¢ +.BR rand () +¤È +.BR srand () +¤Î¼ÂÁõÎã¤È¤·¤Æ°Ê²¼¤òµó¤²¤Æ¤¤¤ë¡£¤³¤ì¤Ï¡¢°Û¤Ê¤ë£²¤Ä¤Î¥Þ¥·¥ó¤ÇƱ¤¸Íð¿ô·ÏÎó¤¬ +ɬÍפʾì¹ç¤Ë¤ÏÊØÍø¤Ç¤¢¤í¤¦¡£ +.sp +.in +4n +.nf +static unsigned long next = 1; + +/* RAND_MAX ¤ò 32767 ¤È²¾Äê */ +int myrand(void) { + next = next * 1103515245 + 12345; + return((unsigned)(next/65536) % 32768); +} + +void mysrand(unsigned seed) { + next = seed; +} +.fi +.in +.SH ´ØÏ¢¹àÌÜ +.BR drand48 (3), +.BR random (3) diff --git a/release/man3/random.3 b/release/man3/random.3 new file mode 100644 index 00000000..936f731d --- /dev/null +++ b/release/man3/random.3 @@ -0,0 +1,172 @@ +.\" 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 Sun Mar 28 00:25:51 1993, David Metcalfe +.\" 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 ¾õÂÖÇÛÎó +.\" +.TH RANDOM 3 2009-02-03 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +random, srandom, initstate, setstate \- Íð¿ô¤òÀ¸À®¤¹¤ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.B long int random(void); +.br +.BI "void srandom(unsigned int " seed ); + +.BI "char *initstate(unsigned int " seed ", char *" state ", size_t " n ); + +.BI "char *setstate(char *" state ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR random (), +.BR srandom (), +.BR initstate (), +.BR setstate (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.ad b +.SH ÀâÌÀ +.BR random () +´Ø¿ô¤Ï¡¢ÈóÀþ·Á²ÃË¡¥Õ¥£¡¼¥É¥Ð¥Ã¥¯¤òÍѤ¤¤¿Íð¿ôÀ¸À®´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢0 ¤«¤é \fBRAND_MAX\fR ¤Þ¤Ç¤Îµ¿»÷Íð¿ô¤òÊÖ¤¹¡£ +¤½¤Î¤¿¤á¤Ë 31 ¸Ä¤Î¥í¥ó¥°À°¿ô¤«¤é¤Ê¤ë¥Ç¥Õ¥©¥ë¥È¤Îɽ¤ò»ÈÍѤ¹¤ë¡£ +¤³¤ÎÍð¿ô¤òÀ¸À®¤¹¤ë´Ø¿ô¤Î¼þ´ü¤Ï¤È¤Æ¤âŤ¯¡¢¤ª¤è¤½ +.I "16\ *\ ((2^31)\ \-\ 1)" +¤Ç¤¢¤ë¡£ +.PP +.BR srandom () +´Ø¿ô¤Ï¡¢ +.BR random () +¤ÇÊÖ¤µ¤ì¤ëµ¿»÷Íð¿ôÀ°¿ô·ÏÎó¤Î¼ï¤òÀßÄꤹ¤ë¡£ +¤½¤Î¤¿¤á¤Ë¤Ï¿·¤·¤¤¼ï¤ò°ú¿ô¤Ë¤·¤Æ +.BR srandom () +¤ò¸Æ¤Ù¤Ð¤è¤¤¡£ +.BR random () +¤ÇÀ¸À®¤µ¤ì¤ë·ÏÎó¤Ï¡¢ +°ú¿ô¤ËƱ¤¸¼ï¤ÎÃͤòÍѤ¤¤Æ +.BR srandom () +¤ò¸Æ¤Ö¤³¤È¤ÇºÆ¸½²Äǽ¤Ç¤¢¤ë¡£ +¼ï¤ÎÃͤ¬Í¿¤¨¤é¤ì¤Ê¤¤¾ì¹ç¤Ë¤Ï +.BR random () +´Ø¿ô¤Ï¡¢¼«Æ°Åª¤Ë 1 ¤ò¼ï¤ËÀßÄꤹ¤ë¡£ +.PP +.BR initstate () +´Ø¿ô¤Ï¡¢ +.BR random () +¤Ç»ÈÍѤµ¤ì¤ë¾õÂÖÇÛÎó +\fIstate\fP ¤ò½é´ü²½¤¹¤ë¡£ +.BR initstate () +¤Ç¤Ï¡¢¾õÂÖÇÛÎó¤ÎÂ礭¤µ \fIn\fP ¤Ï +»ÈÍѤ¹¤ë´Ø¿ô¤ÎÍð¿ôÀ¸À®¤ÎÀ­Ç½¤ÎÄøÅÙ¤ò·èÄꤹ¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë +\(em ¾õÂÖÇÛÎó¤¬Â礭¤¤Äø¡¢Íð¿ô¤ÎÀ­Ç½¤Ï¤è¤¯¤Ê¤ë¡£ +\fIseed\fP ¤Ï½é´ü²½¤Î¤¿¤á¤Î¼ï¤Ç¤¢¤ë¡£ +¤³¤ì¤ÏÍð¿ô·ÏÎó¤Î³«»Ï°ÌÃÖ¤ò·èÄꤹ¤ë¤â¤Î¤Ç¤¢¤ê¡¢ +¤³¤ÎÃͤò»ØÄꤹ¤ë¤³¤È¤ÇƱ°ì¤Î³«»Ï°ÌÃÖ¤«¤éÍð¿ô¤ÎÀ¸À®¤ò +ºÆ³«¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.BR setstate () +´Ø¿ô¤Ï¡¢ +.BR random () +¤Ç»ÈÍѤµ¤ì¤ë¾õÂÖÇÛÎó¤òÊѹ¹¤¹¤ë¡£ +¾õÂÖÇÛÎó \fIstate\fP ¤Ï¡¢ +.BR initstate () +¤Þ¤¿¤Ï +.BR setstate () +¤¬ +¼¡¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¤Þ¤Ç¡¢Íð¿ô¤ÎÀ¸À®¤Ë»ÈÍѤµ¤ì¤ë¡£ +\fIstate\fP ¤Ï +.BR initstate () +¤òÍѤ¤¤ÆºÇ½é¤Ë½é´ü²½¤µ¤ì¤Æ¤¤¤ë¤«¡¢ +°ÊÁ°¤Ë¸Æ¤Ó½Ð¤·¤¿ +.BR setstate () +¤Î·ë²Ì¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR random () +´Ø¿ô¤Ï 0 ¤È +.B RAND_MAX +¤Î´Ö¤ÎÃͤòÊÖ¤¹¡£ +.BR srandom () +´Ø¿ô¤ÏÃͤòÊÖ¤µ¤Ê¤¤¡£ +.BR initstate () +´Ø¿ô¤È +.BR setstate () +´Ø¿ô¤Ï +ľÁ°¤Î¾õÂÖÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Þ¤¿¤Ï NULL ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.BR initstate () +¤Ç8¥Ð¥¤¥È¤è¤ê¤â¾®¤µ¤¤¾õÂÖÇÛÎó¤ò»ØÄꤷ¤¿¡£ +.SH ½àµò +4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +¾õÂÖÇÛÎó \fIn\fP ¤ÎÂ礭¤µ¤Î¸½ºß¤Î¡ÖºÇŬ¡×ÃÍ¤Ï +8¡¢32¡¢64¡¢128¡¢256 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +¤½¤Î¾¤ÎÎ̤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢»ØÄꤷ¤¿Î̤ò±Û¤¨¤Ê¤¤¾å½Ò¤ÎÃÍ¤Ë +ºÇ¤â¶á¤¤Ãͤˤʤ롣 +8 ¥Ð¥¤¥È̤Ëþ¤ÎÎ̤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï¥¨¥é¡¼¤Î¸¶°ø¤È¤Ê¤ë¡£ + +Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤¬ +.BR random () +¤ò»È¤¦¤è¤¦¤Ê¾õ¶·¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¤½¤Î¾ì¹ç¤Ë¤Ï +.BR random_r (3) +¤ò»È¤¦¤³¤È¡£ + +Íð¿ô¤ÎÀ¸À®¤ÏÊ£»¨¤ÊÏÃÂê¤Ç¤¢¤ë¡£ +.I Numerical Recipes in C: The Art of Scientific Computing +(William H. Press, Brian P. Flannery, Saul A. Teukolsky, William +T. Vetterling; New York: Cambridge University Press, 2007, 3rd ed.) +¤Ç¤Ï¼ÂÍÑŪ¤ÊÍð¿ôÀ¸À®¤òÏÀÅÀ¤È¤·¤¿Í¥¤ì¤¿µÄÏÀ¤¬Âè 7 ¾Ï (Íð¿ô) ¤ÇŸ³«¤µ¤ì¤Æ¤¤¤ë¡£ + +¤è¤êÍýÏÀŪ¤ÊµÄÏÀ¤Ë¤Ä¤¤¤Æ¤Ï Donald E. Knuth ¤Î +.IR "The Art of Computer Programming" , +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) diff --git a/release/man3/random_r.3 b/release/man3/random_r.3 new file mode 100644 index 00000000..864324d4 --- /dev/null +++ b/release/man3/random_r.3 @@ -0,0 +1,131 @@ +.\" Copyright 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. +.\" +.\" 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" +.SH ̾Á° +random_r, srandom_r, initstate_r, setstate_r \- ¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê +Íð¿ôÀ¸À®´ï +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int random_r(struct random_data *" buf ", int32_t *" result ); + +.BI "int srandom_r(unsigned int " seed ", struct random_data *" buf ); + +.BI "int initstate_r(unsigned int " seed ", char *" statebuf , +.BI " size_t " statelen ", struct random_data *" buf ); +.br +.BI "int setstate_r(char *" statebuf ", struct random_data *" buf ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR random_r (), +.BR srandom_r (), +.BR initstate_r (), +.BR setstate_r (): +_SVID_SOURCE || _BSD_SOURCE +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ +.BR random (3) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǡ¢Åù²Á¤Êµ¡Ç½¤ò»ý¤Ä¡£ +¤³¤ì¤é¤Ï¡¢ÆÈΩ¤·¤¿ºÆ¸½²Äǽ¤ÊÍð¿ôÎó¤ò³Æ¥¹¥ì¥Ã¥É¤¬ÆÀ¤ëɬÍפ¬¤¢¤ë¤è¤¦¤Ê +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¡¦¥×¥í¥°¥é¥à¤Ç¤Î»ÈÍѤËŬ¤·¤Æ¤¤¤ë¡£ + +.BR random_r () +´Ø¿ô¤Ï +.BR random (3) +¤ÈƱÍͤÀ¤¬¡¢ +Âç°èÊÑ¿ô (global variable) ¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¾ðÊó¤ò»È¤¦¤Î¤Ç¤Ï¤Ê¤¯¡¢ +.I buf +¤¬»Ø¤¹°ú¤­¿ô¤Ë³ÊǼ¤µ¤ì¤¿¾õÂÖ¾ðÊó¤ò»È¤¦¡£ +À¸À®¤µ¤ì¤¿Íð¿ô¤Ï°ú¤­¿ô +.I result +¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ + +.BR srandom_r () +´Ø¿ô¤Ï +.BR srandom (3) +¤ÈƱÍͤÀ¤¬¡¢ +Âç°èÊÑ¿ô¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¤ËÂбþ¤¹¤ëÍð¿ôÀ¸À®´ï¤Î¼ï¤Ç¤Ï¤Ê¤¯¡¢ +.I buf +¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¤ËÂбþ¤¹¤ëÍð¿ôÀ¸À®´ï¤Î¼ï¤ò +½é´ü²½¤¹¤ë¡£ + +.BR initstate_r () +´Ø¿ô¤Ï +.BR initstate (3) +¤ÈƱÍͤÀ¤¬¡¢Âç°èÊÑ¿ô¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¤ò½é´ü²½¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +.I buf +¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥ÈÆâ¤Î¾õÂÖ¤ò½é´ü²½¤¹¤ë¡£ + +.BR setstate_r () +´Ø¿ô¤Ï +.BR setstate (3) +¤ÈƱÍͤÀ¤¬¡¢Âç°èÊÑ¿ô¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¤òÊѹ¹¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +.I buf +¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥ÈÆâ¤Î¾õÂÖ¤òÊѹ¹¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +8 ¥Ð¥¤¥È¤è¤ê¾®¤µ¤¤¾õÂÖÇÛÎó¤¬ +.BR initstate_r () +¤Ë»ØÄꤵ¤ì¤¿¡£ +.TP +.B EINVAL +.BR setstate_r () +¤Î°ú¤­¿ô +.I statebuf +¤« +.I buf +¤¬ NULL ¤Ç¤¢¤Ã¤¿¡£ +.TP +.B EINVAL +.BR random_r () +¤Î°ú¤­¿ô +.I buf +¤« +.I result +¤¬ NULL ¤Ç¤¢¤Ã¤¿¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç glibc ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.\" These functions appear to be on Tru64, but don't seem to be on +.\" Solaris, HP-UX, or FreeBSD. +.SH ´ØÏ¢¹àÌÜ +.BR drand48 (3), +.BR rand (3), +.BR random (3) diff --git a/release/man3/rcmd.3 b/release/man3/rcmd.3 new file mode 100644 index 00000000..d6784f0a --- /dev/null +++ b/release/man3/rcmd.3 @@ -0,0 +1,219 @@ +.\" $NetBSD: rcmd.3,v 1.9 1996/05/28 02:07:39 mrg Exp $ +.\" +.\" Copyright (c) 1983, 1991, 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. +.\" +.\" @(#)rcmd.3 8.1 (Berkeley) 6/4/93 +.\" +.\" Contributed as Linux man page by David A. Holland, 970908 +.\" I have not checked whether the Linux situation is exactly the same. +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated Mon Mar 1 1999 by NAKANO Takeo +.\" +.\"WORD: standard name (¥Û¥¹¥È¤Î) ɸ½à̾ +.\"WORD: regular file Ä̾ï¥Õ¥¡¥¤¥ë +.\" +.TH RCMD 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +rcmd, rresvport, iruserok, ruserok \- ¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Ë¥¹¥È¥ê¡¼¥à¤òÊÖ¤¹´Ø¿ô·² +.SH ½ñ¼° +.nf +.B #include \ \ \fP/* Or on some systems */ +.sp +.BI "int rcmd(char **" ahost ", int " inport ", const char *" locuser ", " +.BI " const char *" remuser ", const char *" cmd ", int *" fd2p ); +.sp +.BI "int rresvport(int *" port ); +.sp +.BI "int iruserok(uint32_t " raddr ", int " superuser ", " +.BI " const char *" ruser ", const char *" luser ); +.sp +.BI "int ruserok(const char *" rhost ", int " superuser ", " +.BI " const char *" ruser ", const char *" luser ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR rcmd (), +.BR rresvport (), +.BR ruserok (): +_BSD_SOURCE +.SH ÀâÌÀ +.BR rcmd () +´Ø¿ô¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤¬¥ê¥â¡¼¥È¥Þ¥·¥ó¤Ç¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë +ÍѤ¤¤é¤ì¤ë¡£¤³¤Î¤È¤­Æø¢¥Ý¡¼¥ÈÈÖ¹æ¤ò¤â¤È¤Ë¤·¤¿Ç§¾Ú¥¹¥­¡¼¥à¤¬ +ÍѤ¤¤é¤ì¤ë¡£ +.BR rresvport () +´Ø¿ô¤Ï¡¢Æø¢¥Ý¡¼¥È¶õ´Ö¤Î¥¢¥É¥ì¥¹¤ò»ý¤Ä¥½¥±¥Ã¥È¤Î +¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤òÊÖ¤¹¡£ +.BR iruserok () +´Ø¿ô¤È +.BR ruserok () +´Ø¿ô¤Ï¡¢ +.BR rcmd () +¤Ç¥µ¡¼¥Ó¥¹Í×µá¤ò¹Ô¤Ã¤¿¥¯¥é¥¤¥¢¥ó¥È¤Îǧ¾Ú¤ò¹Ô¤¦¤¿¤á¤Ë +¥µ¡¼¥Ð¡¼¤¬ÍѤ¤¤ë´Ø¿ô¤Ç¤¢¤ë¡£ +°Ê¾å¤Î 4 ¤Ä¤Î´Ø¿ô¤Ï¡¢¤¹¤Ù¤ÆƱ¤¸¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤Æ¤ª¤ê¡¢ +.BR rshd (8) +¥µ¡¼¥Ð¡¼¤Ë¤è¤Ã¤Æ (¾¤Î´Ø¿ô¤È¤È¤â¤Ë) ÍøÍѤµ¤ì¤ë¡£ +.PP +.BR rcmd () +´Ø¿ô¤Ï +.BR gethostbyname (3) +¤òÍѤ¤¤Æ +.I *ahost +¤Î»²¾È¤ò¹Ô¤¦¡£¥Û¥¹¥È¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ï +.I *ahost +¤Ë¥Û¥¹¥È¤Îɸ½à̾ (standard name) ¤ò¥»¥Ã¥È¤·¤Æ¡¢ +ͽÌ󤵤ì¤Æ¤¤¤ë¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Ý¡¼¥È +.I inport +·Ðͳ¤Ç¥µ¡¼¥Ð¡¼¤Ø¤ÎÀܳ¤ò³ÎΩ¤¹¤ë¡£ +.PP +Àܳ¤ËÀ®¸ù¤·¤¿¤é¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥É¥á¥¤¥ó¤Ë¸ºß¤¹¤ë¥¿¥¤¥× +.B SOCK_STREAM +¤Î¥½¥±¥Ã¥È¤¬¸Æ¤Ó½Ð¤·¤â¤È¤ËÊÖ¤µ¤ì¤ë¡£ +¤³¤Î¥½¥±¥Ã¥È¤ÎÁê¼ê¦¤Ï¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Î +.I stdin +¤ª¤è¤Ó +.I stdout +¤ËÀܳ¤µ¤ì¤ë¡£ +.I fd2p +¤¬¥¼¥í¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢À©¸æ¥×¥í¥»¥¹¤Ø¤ÎÀܳ¤¬¤â¤¦°ì¤ÄÍÑ°Õ¤µ¤ì¡¢ +¤½¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤¬ +.I *fd2p +¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +À©¸æ¥×¥í¥»¥¹¤Ï¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤«¤é¤Îɸ½à¥¨¥é¡¼½ÐÎÏ (unit 2) ¤ò +¤³¤Î¥Á¥ã¥ó¥Í¥ë¤ËÊÖ¤¹¡£ +¤Þ¤¿À©¸æ¥×¥í¥»¥¹¤Ï¤³¤ÎÀܳ¤«¤é¼õ¤±¼è¤Ã¤¿¥Ð¥¤¥È¥Ç¡¼¥¿¤ò +Unix ¥·¥°¥Ê¥ë¤ÎÈÖ¹æ¤È¤·¤Æ°·¤¤¡¢¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Î¥×¥í¥»¥¹ +¥°¥ë¡¼¥×¤Ø¤È¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.I fd2p +¤¬¥¼¥í¤Î¾ì¹ç¤Ï¡¢ +.I stderr +(¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Î unit 2) ¤Ï +.I stdout +¤È°ì½ï¤Ë¤Þ¤È¤á¤é¤ì¤ë¡£¤Þ¤¿¤³¤Î¾ì¹ç¤Ï¥ê¥â¡¼¥È¥×¥í¥»¥¹¤Ø +Ǥ°Õ¤Î¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +¤¿¤À¤·ÂÓ°è³° (out-of-band) ¥Ç¡¼¥¿¤òÍѤ¤¤ì¤Ð¡¢ +¥ê¥â¡¼¥È¥×¥í¥»¥¹¤ÎÃí°Õ¤ò°ú¤¯¤³¤È¤Ï¤Ç¤­¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +¥×¥í¥È¥³¥ë¤Î¾ÜºÙ¤Ï +.BR rshd (8) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.BR rresvport () +´Ø¿ô¤ÏÆø¢¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤¿¥½¥±¥Ã¥È¤ò¼èÆÀ¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +¤³¤Î¥½¥±¥Ã¥È¤Ï +.BR rcmd () +¤Ê¤É¤Î´Ø¿ô¤Ç¤ÎÍøÍѤËŬ¤·¤Æ¤¤¤ë¡£¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Ý¡¼¥È¤ÎÆø¢¥Ý¡¼¥È¤Ï¡¢ +0 ¤«¤é 1023 ¤ÎÈϰϤǤ¢¤ë¡£¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤À¤±¤¬¤³¤ì¤é¤Î¥¢¥É¥ì¥¹¤ò +¥½¥±¥Ã¥È¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.BR iruserok () +¤È +.BR ruserok () +´Ø¿ô¤Ï¡¢¤Þ¤º°Ê²¼¤Î°ú¿ô¤ò¼è¤ë: ¥ê¥â¡¼¥È¥Û¥¹¥È ( +.BR iruserok () +¤Ï IP ¥¢¥É¥ì¥¹¤Ç¡¢ +.BR ruserok () +¤Ï¥Û¥¹¥È̾¤Ç»ØÄê)¡¢ 2 ¤Ä¤Î¥æ¡¼¥¶¡¼Ì¾¡¢¥í¡¼¥«¥ë¥æ¡¼¥¶¡¼¤Î̾Á°¤¬ +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤Î¤â¤Î¤Ç¤¢¤ë¤«¤É¤¦¤«¤ò¼¨¤¹¥Õ¥é¥°¡¢¤Ç¤¢¤ë¡£ +¤â¤·¥æ¡¼¥¶¡¼¤¬\fB¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤Ç¤Ï¤Ê¤¤\fP¾ì¹ç¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I /etc/hosts.equiv +¥Õ¥¡¥¤¥ë¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¤ê¡¢ +ÆâÍƤΥÁ¥§¥Ã¥¯¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥í¡¼¥«¥ë¥æ¡¼¥¶¡¼¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë +.I .rhosts +¥Õ¥¡¥¤¥ë¤ò¥Á¥§¥Ã¥¯¤·¤Æ¡¢¥µ¡¼¥Ó¥¹Í׵᤬µö²Ä¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«Ä´¤Ù¤ë¡£ +.PP +¤³¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¤ê¡¢ +Ä̾ï¥Õ¥¡¥¤¥ë (regular file) ¤Ç¤Ï¤Ê¤«¤Ã¤¿¤ê¡¢ +»ØÄê¥æ¡¼¥¶¡¼¤Þ¤¿¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼°Ê³°¤Î½êÍ­¤À¤Ã¤¿¤ê¡¢ +½êÍ­¼Ô°Ê³°¤«¤é½ñ¤­¹þ¤ß²Äǽ¤À¤Ã¤¿¤ê¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +¤³¤Î¥Á¥§¥Ã¥¯¤Ï¼«Æ°Åª¤Ë¼ºÇÔ¤¹¤ë¡£ +¥Þ¥·¥ó¤Î̾Á°¤¬ +.I hosts.equiv +¤Ë¥ê¥¹¥È¤µ¤ì¤Æ¤¤¤¿¤ê¡¢ +¥Û¥¹¥È¤È¥ê¥â¡¼¥È¥æ¡¼¥¶¡¼¤Î̾Á°¤¬ +.I .rhosts +¥Õ¥¡¥¤¥ë¤Ë½ñ¤«¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR iruserok () +¤È +.BR ruserok () +¤Ï \-1 ¤òÊÖ¤¹¡£ +.RB ( gethostname (2) +¤Ë¤è¤Ã¤Æ¼èÆÀ¤µ¤ì¤ë) ¥í¡¼¥«¥ë¥É¥á¥¤¥ó¤¬¥ê¥â¡¼¥È¤Î¥É¥á¥¤¥ó¤ÈƱ¤¸¾ì¹ç¤Ï¡¢ +¥Þ¥·¥ó¤Î̾Á°¤À¤±¤ò»ØÄꤹ¤ì¤Ð¤è¤¤¡£ +.PP +¥ê¥â¡¼¥È¥Û¥¹¥È¤Î IP ¥¢¥É¥ì¥¹¤¬¤ï¤«¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.BR ruserok () +¤è¤ê¤â +.BR iruserok () ¤òÍѤ¤¤ëÊý¤¬Îɤ¤¤À¤í¤¦¡£ +.BR ruserok () +¤Ï¥ê¥â¡¼¥È¥Û¥¹¥È¤Î½ê°¤¹¤ë¥É¥á¥¤¥ó¤Î DNS ¥µ¡¼¥Ð¡¼¤¬¿®Íê¤Ç¤­¤Ê¤¯¤Æ¤â +»ÈÍѤǤ­¤ë¤«¤é¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR rcmd () +´Ø¿ô¤ÏÀ®¸ù¤¹¤ë¤ÈÍ­¸ú¤Ê¥½¥±¥Ã¥È¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È \-1 ¤òÊÖ¤·¡¢É¸½à¥¨¥é¡¼½ÐÎϤ˿ÇÃÇ¥á¥Ã¥»¡¼¥¸¤ò +ɽ¼¨¤¹¤ë¡£ +.PP +.BR rresvport () +´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È¥Ð¥¤¥ó¥É¤µ¤ì¤¿Í­¸ú¤Ê¥½¥±¥Ã¥È¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤òÊÖ¤¹¡£ +¼ºÇÔ¤¹¤ë¤È \-1 ¤òÊÖ¤·¡¢¥°¥í¡¼¥Ð¥ëÊÑ¿ô +.I errno +¤ò¥¨¥é¡¼¤Î¸¶°ø¤ËÂбþ¤¹¤ëÃͤ˥»¥Ã¥È¤¹¤ë¡£ +¥¨¥é¡¼¥³¡¼¥É +.B EAGAIN +¤Ï¡¢¤³¤Î´Ø¿ô¤Ë¤ª¤¤¤Æ¤Ï¡Ö¤¹¤Ù¤Æ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥Ý¡¼¥È¤¬»ÈÍÑÃæ¡× +¤È¤¤¤¦°ÕÌ£¤òɽ¤¹¡£ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¡¢Solaris ¤ä¾¤Î¿¤¯¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï 4.2BSD ¤ÇÅо줷¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR rlogin (1), +.BR rsh (1), +.BR intro (2), +.BR rexec (3), +.BR rexecd (8), +.BR rlogind (8), +.BR rshd (8) diff --git a/release/man3/re_comp.3 b/release/man3/re_comp.3 new file mode 100644 index 00000000..88d37c05 --- /dev/null +++ b/release/man3/re_comp.3 @@ -0,0 +1,81 @@ +.\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Thu Dec 18 15:06:31 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. +.\" +.\" 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. +.\" +.\" Wed Jun 14 16:10:28 BST 1995 Wilf. (G.Wilford@@ee.surrey.ac.uk) +.\" +.TH RE_COMP 3 1995-07-14 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +re_comp, re_exec \- BSD ¤ÎÀµµ¬É½¸½´Ø¿ô +.SH ½ñ¼° +.B #define _REGEX_RE_COMP +.br +.B #include +.br +.B #include +.sp +.BI "char *re_comp(char *" regex ); +.sp +.BI "int re_exec(char *" string ); +.SH ÀâÌÀ +.BR re_comp () +¤Ï¡¢ +.I regex +¤Ç¼¨¤µ¤ì¤ë NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Àµµ¬É½¸½¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¤ÏÀÅŪ¤ÊÎΰè¤ò»ÈÍѤ·¤Æ¤ª¤ê¡¢¤½¤Î¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡ +¤Ï°Ê¹ß¤Î +.BR re_comp () +¤Î»ÈÍѤˤè¤Ã¤Æ¾å½ñ¤­¤µ¤ì¤ë¡£ +¤â¤· +.I regex +¤¬ NULL ¤Ê¤é¤Ð²¿¤ÎÁàºî¤â¹Ô¤ï¤ì¤º¡¢¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤ÎÆâÍÆ¤Ï +ÃÖ¤­´¹¤¨¤é¤ì¤Ê¤¤¡£ + +.BR re_exec () +¤Ï¡¢ +.I string +¤¬»Ø¤¹ NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤¬Á°²ó¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ +.I regex +¤Ë¥Þ¥Ã¥Á¤¹¤ë¤«¤É¤¦¤«¤òɾ²Á¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR re_comp () +¤Ï¡¢ +.I regex +¤Î¥³¥ó¥Ñ¥¤¥ë¤ËÀ®¸ù¤·¤¿¾ì¹ç NULL ¤òÊÖ¤·¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤ÏŬÀڤʥ¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ + +.BR re_exec () +¤Ï¡¢°ìÃפ·¤¿¾ì¹ç 1 ¤ò¡¢¼ºÇÔ¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£ +.SH ½àµò +4.3BSD. +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£Âå¤ï¤ê¤Ë +.BR regcomp (3) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë´Ø¿ô¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR regcomp (3), +.BR regex (7), +GNU regex manual diff --git a/release/man3/readdir.3 b/release/man3/readdir.3 new file mode 100644 index 00000000..1dda7657 --- /dev/null +++ b/release/man3/readdir.3 @@ -0,0 +1,268 @@ +.\" Copyright (C) 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 Sat Jul 24 16:09:49 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl) +.\" Modified 22 July 1996 by Andries Brouwer (aeb@cwi.nl) +.\" 2007-07-30 Ulrich Drepper , mtk: +.\" 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 2009-07-04 "" "Linux Programmer's Manual" +.SH ̾Á° +readdir, readdir_r \- ¥Ç¥£¥ì¥¯¥È¥ê¤òÆɤ߹þ¤à +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "struct dirent *readdir(DIR *" dirp ); +.sp +.BI "int readdir_r(DIR *" dirp ", struct dirent *" entry \ +", struct dirent **" result ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.ad l +.in +.sp +.BR readdir_r (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || +_SVID_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +.BR readdir () +´Ø¿ô¤Ï¡¢\fIdirp\fP ¤¬»Ø¤¹¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤ÎÃæ¤Ç¡¢ +¼¡¤Î¥Ç¥£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê¤òɽ¤¹ \fIdirent\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¤ä¡¢ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï¡¢ NULL ¤òÊÖ¤¹¡£ +.PP +Linux ¤Ç¤Ï +.I dirent +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.in +4n +.nf +struct dirent { + ino_t d_ino; /* inode ÈÖ¹æ */ + off_t d_off; /* ¼¡¤Î dirent ¤Ø¤Î¥ª¥Õ¥»¥Ã¥È */ + unsigned short d_reclen; /* ¤³¤Î¥ì¥³¡¼¥É¤ÎŤµ */ + unsigned char d_type; /* ¥Õ¥¡¥¤¥ë¼ïÊÌ¡£Á´¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à */ + ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤ */ + char d_name[256]; /* ¥Õ¥¡¥¤¥ë̾ */ +}; +.fi +.in +.PP +.I dirent +¹½Â¤ÂΤΥե£¡¼¥ë¥É¤Ç POSIX.1 ¤ÇÍ׵ᤵ¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢ +.IR d_name [] +¤È (XSI ³ÈÄ¥¤Ç¤Î) +.I d_ino +¤À¤±¤Ç¤¢¤ë¡£ +.IR d_name [] +¤Ï¤½¤ÎÂ礭¤µ¤âµ¬Äꤵ¤ì¤Æ¤ª¤é¤º¡¢ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤ÏºÇÂç¤Ç +.B NAME_MAX +¸Ä¤Îʸ»ú¤È¡¢¤½¤ì¤Ë³¤¯½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤¬³ÊǼ¤µ¤ì¤ë¡£ +¾¤Î¥Õ¥£¡¼¥ë¥É¤ÏÈóɸ½à¤Ç¤¢¤ê¡¢Á´¤Æ¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢²¼µ­¤Î¡ÖÃí°Õ¡×¤ò»²¾È¤Î¤³¤È¡£ +.PP +.BR readdir () +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë¥Ç¡¼¥¿¤Ï¡¢¤½¤ì°Ê¹ß¤ÎƱ¤¸¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ë +.BR readdir () +¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ¾å½ñ¤­¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ + +.BR readdir_r () +´Ø¿ô¤Ï +.BR readdir () +¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤ¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à +.I dirp +¤«¤é¼¡¤Î¥Ç¥£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê¤òÆɤ߹þ¤ß¡¢ +.I entry +¤¬»Ø¤¹¸Æ¤Ó½Ð¤·¸µ¤¬³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤Ë¤½¤Î¥¨¥ó¥È¥ê¤ò³ÊǼ¤·¤ÆÊÖ¤¹ +(¤³¤Î¥Ð¥Ã¥Õ¥¡¤Î³ä¤êÅö¤Æ¤Ë¤Ä¤¤¤Æ¤Ï¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È)¡£ +ÊÖ¤µ¤ì¤ë¥¨¥ó¥È¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬ +.I *result +¤Ë³ÊǼ¤µ¤ì¤ë¡£¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¤Ï¡¢ +NULL ¤¬ +.I *result +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR readdir () +¤Ï +.I dirent +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +(¤³¤Î¹½Â¤ÂΤÏÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î¥Ý¥¤¥ó¥¿¤ò +.BR free (3) +¤·¤è¤¦¤È¤·¤Ê¤¤¤³¤È¡£) +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¤Ë¤Ï¡¢NULL ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤ÏÊѲ½¤·¤Ê¤¤¡£ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¡¢NULL ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ + +À®¸ù¤¹¤ë¤È¡¢ +.BR readdir_r () +´Ø¿ô¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢Àµ¤Î¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹¡£ +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¡¢ +.BR readdir_r () +¤ÏÊÖ¤êÃͤȤ·¤Æ 0 ¤òÊÖ¤·¡¢ +.I *result +¤Ë NULL ¤ò³ÊǼ¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¥Ç¥£¥¹¥¯¥ê¥×¥¿ \fIdirp\fP ¤¬Ìµ¸ú¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +¥Õ¥£¡¼¥ë¥É +.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 +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤«¤ò¥Æ¥¹¥È¤¹¤ì¤Ð¤è¤¤¡£ + +.I d_type +¥Õ¥£¡¼¥ë¥É¤Ï¡¢Linux °Ê³°¤Ç¤Ï¡¢ +¼ç¤Ë BSD ·Ï¤Î¥·¥¹¥Æ¥à¤Ë¤À¤±Â¸ºß¤¹¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤ò»È¤¦¤È¡¢ +¤½¤Î¸å¤ÎÆ°ºî¤¬¥Õ¥¡¥¤¥ë¤Î¼ïÊ̤ˤè¤ê·è¤Þ¤ë¾ì¹ç¤Ë¡¢ +.BR lstat (2) +¤ò¸Æ¤Ó½Ð¤¹¥³¥¹¥È¤òÈò¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +µ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _BSD_SOURCE +¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¡¢glibc ¤Ï +.I d_type +¤ÇÊÖ¤µ¤ì¤ëÃͤȤ·¤Æ°Ê²¼¤Î¥Þ¥¯¥íÄê¿ô¤òÄêµÁ¤¹¤ë¡£ +.TP 12 +.B DT_BLK +¥Ö¥í¥Ã¥¯¡¦¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£ +.TP +.B DT_CHR +¥­¥ã¥é¥¯¥¿¡¦¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£ +.TP +.B DT_DIR +¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¡£ +.TP +.B DT_FIFO +̾Á°ÉÕ¤­¥Ñ¥¤¥× (FIFO) ¤Ç¤¢¤ë¡£ +.TP +.B DT_LNK +¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¡£ +.TP +.B DT_REG +Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.TP +.B DT_SOCK +Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£ +.TP +.B DT_UNKNOWN +¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤¬ÉÔÌÀ¤Ç¤¢¤ë¡£ +.\" The glibc manual says that on some systems this is the only +.\" value returned +.PP +¥Õ¥¡¥¤¥ë¼ïÊ̤ò·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +.I d_type +¤Ë +.B DT_UNKNOWN +¤¬Æþ¤ë¡£ + +¸½ºß¤Î¤È¤³¤í¡¢ +.\" ¥«¡¼¥Í¥ë 2.6.27 +.\" Ʊ¤¸ÀâÌÀʸ¤¬ readdir.2 ¤Ë¤â¤¢¤ë¡£ +.I d_type +¤Ç¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤òÊÖ¤¹µ¡Ç½¤¬´°Á´¤Ë¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢ +¤¤¤¯¤Ä¤«¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¤Î¤ß¤Ç¤¢¤ë +(Btrfs, ext2, ext3, ext4 ¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë)¡£ +¤É¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤â¡¢ +.B DT_UNKNOWN +¤¬ÊÖ¤µ¤ì¤¿ºÝ¤ËŬÀڤ˽èÍý¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +POSIX.1 ¤Ç¤Ï +.I d_name +¥Õ¥£¡¼¥ë¥É¤Î¥µ¥¤¥º¤Ïµ¬Äꤵ¤ì¤Æ¤ª¤é¤º¡¢ +.I dirent +¹½Â¤ÂΤΠ+.I d_name +¤Î¸å¤í¤Ë¾¤ÎÈóɸ½à¤Î¥Õ¥£¡¼¥ë¥É¤¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç¡¢ +°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç +.BR readdir_r () +¤ò»È¤¦¾ì¹ç¤Ï +.I entry +¤ËÅϤ¹¥Ð¥Ã¥Õ¥¡¤ò¼¡¤Î¤è¤¦¤Ë¤·¤Æ³ä¤êÅö¤Æ¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.in +4n +.nf + +len = offsetof(struct dirent, d_name) + + pathconf(dirpath, _PC_NAME_MAX) + 1 +entryp = malloc(len); + +.fi +.in +(POSIX.1 ¤Ç¤Ï +.I "struct dirent" +¤ÎºÇ¸å¤Î¥Õ¥£¡¼¥ë¥É¤¬ +.I d_name +¤Ç¤¢¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£) +.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), +.BR feature_test_macros (7) diff --git a/release/man3/realpath.3 b/release/man3/realpath.3 new file mode 100644 index 00000000..bea1b201 --- /dev/null +++ b/release/man3/realpath.3 @@ -0,0 +1,215 @@ +.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.) +.\" +.\" 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. +.\" +.\" Rewritten old page, 990824, aeb@cwi.nl +.\" 2004-12-14, mtk, added discussion of resolved_path == NULL +.\" +.\" Japanese Version Copyright (c) 1998 SHOJI Yasushi all rights reserved. +.\" Translated 1998-03-22, SHOJI Yasushi +.\" Updated 1999-03-07, Shouichi Saito +.\" Updated 2003-01-17, Akihiro MOTOKI +.\" Updated 2005-02-27, Akihiro MOTOKI +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2009-04-24, Akihiro MOTOKI, LDP v3.20 +.\" +.\"WORD: bounded À©¸Â¤¬¤Ê¤¤ +.\" +.TH REALPATH 3 2009-02-23 "" "Linux Programmer's Manual" +.SH ̾Á° +realpath \- Àµµ¬²½¤µ¤ì¤¿ÀäÂХѥ¹Ì¾¤òÊÖ¤¹ +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "char *realpath(const char *" path ", char *" resolved_path ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR realpath (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.BR realpath () +¤Ï +.I path +¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿ NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎóÃæ¤Î +¤¹¤Ù¤Æ¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òŸ³«¤·¡¢ +.IR "/./" ", " "/../" +¤Ë¤è¤ë»²¾È¤ä;ʬ¤Ê \(aq/\(aq +¤ò²ò·è¤·¤Æ¡¢Àµµ¬²½¤µ¤ì¤¿ÀäÂХѥ¹Ì¾¤òÀ¸À®¤¹¤ë¡£ +ÆÀ¤é¤ì¤¿ÀäÂХѥ¹Ì¾¤Ï¡¢ºÇÂç¤Ç +.B PATH_MAX +¥Ð¥¤¥È¤Î NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤È¤·¤Æ¡¢ +.I resolved_path +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ë¡£ +·ë²Ì¤È¤·¤ÆÊÖ¤ë¥Ñ¥¹¤ÎÃæ¤Ë¤Ï¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ä +.IR "/./" ", " "/../" +¤È¤¤¤Ã¤¿Í×ÁǤϴޤޤì¤Ê¤¤¡£ +.I resolved_path +¤Ë NULL ¤¬»ØÄꤵ¤ì¤ë¤È¡¢ +.BR realpath () +¤Ï +.BR malloc (3) +¤ò»È¤Ã¤Æ²ò·è¤·¤¿¥Ñ¥¹Ì¾¤òÊÝ»ý¤¹¤ë¤¿¤á¤Î¥Ð¥Ã¥Õ¥¡¤ò +ºÇÂç¤Ç +.B PATH_MAX +¥Ð¥¤¥È¤Þ¤Ç³ä¤êÅö¤Æ¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï¡¢ +.BR free (3) +¤ò»È¤Ã¤Æ¤³¤Î¥Ð¥Ã¥Õ¥¡¤ò²òÊü¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\" resolved_path == NULL ¤ò»ØÄꤷ¤¿¾ì¹ç¤Ç¤â¡¢²ò·è¤·¤¿¥Ñ¥¹Ì¾¤ÎŤµ¤¬ +.\" PATH_MAX ¥Ð¥¤¥È¤òĶ¤¨¤¿¤È¤­¤Ë¤Ï¡¢realpath() ¤ÏÁ°¤ÈƱ¤¸¤¯ +.\" ENAMETOOLONG ¤òÊÖ¤¹¡£-- MTK, Dec 04 +.\" .SH Îò»Ë +.\" .BR realpath () +.\" ´Ø¿ô¤Ï 4.4BSD ¤Ç½é¤á¤ÆÅо줷¤¿ (Jan-Simon Pendry ¤Ë¤è¤êÄ󶡤µ¤ì¤¿)¡£ +.SH ÊÖ¤êÃÍ +¥¨¥é¡¼¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.BR realpath () +¤Ï +.I resolved_path +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ + +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¥Ì¥ë (NULL) ¥Ý¥¤¥ó¥¿¡¼¤¬Ê֤ꡢÇÛÎó +.I resolved_path +¤ÎÆâÍƤÏÉÔÄê¤È¤Ê¤ê¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ÎÆâÍƤò¼¨¤¹Ãͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¥Ñ¥¹¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Ë¡¢Æɤ߽Ф·µö²Ä¤Þ¤¿¤Ï¸¡º÷µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EINVAL +.I path +¤« +.I resolved_path +¤Î¤¤¤º¤ì¤«¤¬ NULL ¤Ç¤¢¤ë¡£ +(libc5 ¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤Ê¾ì¹ç segfault ¤òµ¯¤³¤¹¤À¤±¤Ç¤¢¤í¤¦) +⤷¡¢²¼µ­¤Î¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B EIO +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÆɤà¤È¤­¤Ë¡¢I/O¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.TP +.B ELOOP +¥Ñ¥¹Ì¾¤ÎÊÑ´¹¤Ë¤¢¤¿¤ê¡¢²ò·è¤¹¤Ù¤­¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î¿ô¤¬Â¿²á¤®¤¿¡£ +.TP +.B ENAMETOOLONG +¥Ñ¥¹Ì¾¤Î°ìÍ×ÁǤÎʸ»ú¿ô¤¬ +.B NAME_MAX +¤ò±Û¤¨¤Æ¤¤¤ë¡¢¤Þ¤¿¤Ï¥Ñ¥¹Ì¾Á´ÂΤÎʸ»ú¿ô¤¬ +.B PATH_MAX +¤ò±Û¤¨¤Æ¤¤¤ë¡£ +.TP +.B ENOENT +»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£ +.TP +.B ENOTDIR +¥Ñ¥¹¤Î¥Ç¥£¥ì¥¯¥È¥êÍ×ÁǤ¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î´Ø¿ô¤¬ Linux ¤ËÅо줷¤¿¤Î¤Ï libc 4.5.21 ¤Ç¤¢¤ë¡£ +.SH ½àµò +4.4BSD, POSIX.1-2001. + +POSIX.1-2001 ¤Ç¤Ï +.I resolved_path +¤¬ NULL ¤Î¾ì¹ç¤ÎÆ°ºî¤Ï¼ÂÁõ¤Ë°Í¸¤¹¤ë¤È¤·¤Æ¤¤¤ë¡£ +POSIX.1-2008 ¤Ç¤Ï¡¢¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë½ñ¤«¤ì¤Æ¤¤¤ëÆ°ºî¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +4.4BSD ¤È Solaris ¤Ç¤Ï¡¢¥Ñ¥¹Ì¾¤ÎŤµ¤Î¾å¸Â¤Ï +(\fI\fP ¤ÎÃæ¤Ë¤¢¤ë) +.B MAXPATHLEN +¤Ç¤¢¤ë¡£SUSv2 ¤Ç¤Ï +.B PATH_MAX +¤È +.B NAME_MAX +¤¬µ¬Äꤵ¤ì¤Æ¤ª¤ê¡¢ +¤³¤ì¤é¤Ï \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤«¡¢ +.BR pathconf (3) +´Ø¿ô¤«¤éÆÀ¤é¤ì¤ë¡£°Ê²¼¤Î¤è¤¦¤Ê¥½¡¼¥¹¥³¡¼¥É¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¤¡£ +.LP +.in +4n +.nf +#ifdef PATH_MAX + path_max = PATH_MAX; +#else + path_max = pathconf(path, _PC_PATH_MAX); + if (path_max <= 0) + path_max = 4096; +#endif +.fi +.in +.LP +(¥Ð¥°¤Î¾Ï¤â»²¾È¤Î¤³¤È¡£) +.LP +4.4BSD¡¢Linux¡¢SUSv2 ¤Ç¤Ï¡¢ÊÖ¤êÃͤϾï¤ËÀäÂХѥ¹Ì¾¤Ç¤¢¤ë¡£ +Solaris ¤Ç¤Ï¡¢ +°ú¤­¿ô +.I path +¤¬ÁêÂХѥ¹¤Î¾ì¹ç¡¢ÊÖ¤êÃͤ¬ÁêÂХѥ¹¤Ë¤Ê¤ë¤³¤È¤¬¤¢¤ë¡£ +.BR realpath () +¤Î¥×¥í¥È¥¿¥¤¥×Àë¸À¤Ï¡¢ +libc4 ¤È libc5 ¤Ç¤Ï \fI\fP ¤Ë¤¢¤ë¤¬¡¢ +¤½¤ì°Ê³°¤Î´Ä¶­¤Ç¤Ï¤¤¤º¤ì¤â \fI\fP ¤Ë¤¢¤ë¡£ +.SH ¥Ð¥° +¤³¤Î´Ø¿ô¤Î POSIX.1-2001 ÈǤϡ¢Àß·×Ãʳ¬¤«¤éÌäÂ꤬¤¢¤ë¡£ +½ÐÎϥХåե¡ +.I resolved_path +¤ÎŬÀڤʥµ¥¤¥º¤ò·èÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï¥Ð¥Ã¥Õ¥¡¡¦¥µ¥¤¥º¤È¤·¤Æ +.B PATH_MAX +¤Ï½½Ê¬¤À¤È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +.B PATH_MAX +¤ÏÄêµÁºÑ¤ÎÄê¿ô¤Ç¤¢¤ëɬÍפϤʤ¯¡¢ +.BR pathconf (3) +¤ò»È¤Ã¤ÆÆÀ¤é¤ì¤ëÃͤǤ¢¤Ã¤Æ¤â¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.BR pathconf (3) +¤«¤é¥Ð¥Ã¥Õ¥¡¡¦¥µ¥¤¥º¤ò¼èÆÀ¤·¤¿¤È¤·¤Æ¤âɬ¤º¤·¤â½½Ê¬¤Ç¤Ï¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢POSIX ¤Ç·Ù¹ð¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¡¢ +.BR pathconf (3) +¤ÎÊÖ¤êÃͤ¬Â礭²á¤®¤ÆŬÀڤ˥á¥â¥ê¤ò³ÎÊݤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤ +¤«¤â¤·¤ì¤Ê¤¤°ìÊý¤Ç¡¢ +.BR pathconf (3) +¤Ï +.B PATH_MAX +¤ËÀ©¸Â¤¬¤Ê¤¤¤³¤È¤ò¼¨¤¹ \-1 ¤òÊÖ¤¹¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.I "resolved_path\ ==\ NULL" +¤Îµ¡Ç½¤ò»È¤¦¤È¡¢¤³¤ÎÀß·×¾å¤ÎÌäÂê¤ò²óÈò¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Îµ¡Ç½¤Ï POSIX.1-2001 ¤Ç¤Ïɸ½à²½¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +POSIX.1-2008 ¤Ç¤Ïɸ½à²½¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +libc4 ¤È libc5 ¤Î¼ÂÁõ¤Ï¥Ð¥Ã¥Õ¥¡¡¦¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Î²ÄǽÀ­¤ò»ý¤Ã¤Æ¤¤¤ë +(libc-5.4.13 ¤Ç½¤Àµ¤µ¤ì¤¿¤¬)¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +.BR mount (8) +¤Î¤è¤¦¤Ê set-user-ID ¤µ¤ì¤ë¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +¤³¤Î´Ø¿ôÁêÅö¤Î´Ø¿ô¤ò¼«Á°¤Ç»ý¤ÄɬÍפ¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR readlink (2), +.BR canonicalize_file_name (3), +.BR getcwd (3), +.BR pathconf (3), +.BR sysconf (3) diff --git a/release/man3/recno.3 b/release/man3/recno.3 new file mode 100644 index 00000000..2ec510ac --- /dev/null +++ b/release/man3/recno.3 @@ -0,0 +1,229 @@ +.\" Copyright (c) 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. +.\" +.\" @(#)recno.3 8.5 (Berkeley) 8/18/94 +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito +.\" all rights reserved. +.\" Translated Mon Jul 26 12:18:39 JST 1999 +.\" by Shouichi Saito +.\" Proofed Tue Aug 19 1999 by NAKANO Takeo +.\" +.\"WORD: access method ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.\"WORD: pad character Ëä¤áʸ»ú +.TH RECNO 3 1994-08-18 "" "Linux Programmer's Manual" +.UC 7 +.SH ̾Á° +recno \- ¥ì¥³¡¼¥ÉÈÖ¹æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É +.SH ½ñ¼° +.nf +.ft B +#include +#include +.ft R +.fi +.SH ÀâÌÀ +¥ë¡¼¥Á¥ó +.BR dbopen (3) +¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Î°ì¤Ä¤Ë¡¢ +¥ì¥³¡¼¥ÉÈÖ¹æ¥Õ¥¡¥¤¥ë (record number file: recno file) ¤¬¤¢¤ë¡£ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ë´Ø¤¹¤ë°ìÈÌŪ¤Êµ­½Ò¤Ï +.BR dbopen (3), +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï recno ÆÃÍ­¤Î¾ðÊó¤Ë¤Ä¤¤¤Æ¤Î¤ßµ­½Ò¤¹¤ë¡£ +.PP +¥ì¥³¡¼¥ÉÈÖ¹æ¥Ç¡¼¥¿¹½Â¤¤Ï¡¢¥Õ¥é¥Ã¥È¤Ê¥Õ¥¡¥¤¥ë·Á¼°¤Ë³ÊǼ¤µ¤ì¤¿ +²ÄÊÑĹ/¸ÇÄêĹ¥ì¥³¡¼¥É¤«¤é¤Ê¤ê¡¢ÏÀÍý¥ì¥³¡¼¥ÉÈÖ¹æ¤Ç¥¢¥¯¥»¥¹¤µ¤ì¤ë¡£ +¥ì¥³¡¼¥ÉÈÖ¹æ 5 ¤¬¤¢¤ì¤Ð¡¢¥ì¥³¡¼¥ÉÈÖ¹æ 1 ¤«¤é 4 ¤â¸ºß¤¹¤ë¡£ +¥ì¥³¡¼¥ÉÈÖ¹æ 1 ¤òºï½ü¤¹¤ë¤È¡¢¥ì¥³¡¼¥ÉÈÖ¹æ 5 ¤Ï 4 ¤ËÉÕ¤±Âؤ¨¤é¤ì¡¢ +¥«¡¼¥½¥ë¤â°ÜÆ°¤¹¤ë¡£¥ì¥³¡¼¥ÉÈÖ¹æ 1 °Ê¹ß¤Î¤â¤Î¤Ï°ì¤Ä·«¤ê¾å¤¬¤ë¤ï¤±¤Ç¤¢¤ë¡£ +.PP +.BR dbopen (3) +¤Ç»È¤¦ recno ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤ËÆÃÍ­¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢ +.I +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ç¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.in +4n +.nf +typedef struct { + unsigned long flags; + unsigned int cachesize; + unsigned int psize; + int lorder; + size_t reclen; + unsigned char bval; + char *bfname; +} RECNOINFO; +.fi +.in +.PP +¤³¤Î¹½Â¤ÂΤÎÍ×ÁǤò°Ê²¼¤Ë¼¨¤¹¡£ +.TP +flags +flag ¤ÎÃÍ¤Ï +°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤«¡¢¤³¤ì¤é¤ÎÏÀÍýϤǻØÄꤵ¤ì¤ë¡£ +.RS +.TP +.B R_FIXEDLEN +¥ì¥³¡¼¥ÉŤ¬¸ÇÄê¤Ç¤¢¤ê¡¢¥Ð¥¤¥È¶èÀÚ¤ê¤Ç¤Ï¤Ê¤¤¡£ +¹½Â¤ÂΤÎÍ×ÁÇ +.I reclen +¤Ï¥ì¥³¡¼¥É¤ÎŤµ¤ò»ØÄꤹ¤ë¡£¤Þ¤¿¡¢Í×ÁÇ +.I bval +¤ÏËä¤áʸ»ú (pad character) ¤ò»ØÄꤹ¤ë¡£ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÆþ¤ì¤é¤ì¤¿¥ì¥³¡¼¥É¤ÎÆâ +.I reclen +¥Ð¥¤¥È¤ËËþ¤¿¤Ê¤¤¤â¤Î¤Ç¤Ï¡¢»Ä¤ê¤ÎÉôʬ¤ËËä¤áʸ»ú¤¬¼«Æ°Åª¤ËÆþ¤ë¡£ +.TP +.B R_NOKEY +.BR dbopen (3) +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ç¤Ï¡¢¥·¡¼¥±¥ó¥·¥ã¥ë¤Ê¥ì¥³¡¼¥É¼èÆÀ¤Ï +¸Æ¤Ó½Ð¤·¥­¡¼¤È¥Ç¡¼¥¿¹½Â¤ÂΤÎξÊý¤òËä¤á¤Æ¤¤¤¯¡£ +.B R_NOKEY +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢¥­¡¼¹½Â¤ÂΤòËä¤á¤ë¤Î¤Ë +.I cursor +¥ë¡¼¥Á¥ó¤òɬÍפȤ·¤Ê¤¤¡£ +¤³¤ì¤òÍѤ¤¤ì¤Ð¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¥Õ¥¡¥¤¥ë¤Î½ª¤ê¤ÎÊý¤ò¼èÆÀ¤¹¤ëºÝ¤Ë¡¢ +¤½¤ÎÅÓÃæ¤Î¥ì¥³¡¼¥É¤òÆɤޤʤ¯¤Æ¤âºÑ¤à»ö¤Ë¤Ê¤ë¡£ +.TP +.B R_SNAPSHOT +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢ +.BR dbopen (3) +¤Î¸Æ¤Ó½Ð¤·¤ÎºÝ¡¢ +¥ª¥ê¥¸¥Ê¥ë¥Õ¥¡¥¤¥ë¤«¤éÊѹ¹¤µ¤ì¤Æ¤¤¤Ê¤¤¥ì¥³¡¼¥É¤òÆɤàÂå¤ï¤ê¤Ë¡¢ +¥Õ¥¡¥¤¥ë¤Î snapshot ¤òÍѤ¤¤ë¡£ +.RE +.TP +.I cachesize +ÁÛÄꤵ¤ì¤ë¥á¥â¥ê¥­¥ã¥Ã¥·¥å¤ÎºÇÂ祵¥¤¥º (¥Ð¥¤¥Èñ°Ì)¡£ +¤³¤ÎÃÍ¤Ï +.B ¤¢¤¯¤Þ¤Ç +»²¹Í¤Ç¤¢¤ê¡¢¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ï¤³¤ÎÃͤò±Û¤¨¤¿¥á¥â¥ê¤Î +³ä¤êÅö¤Æ¤ËÀ®¸ù¤¹¤ë¤³¤È¤â¤¢¤ë¡£ +.I cachesize +¤¬ 0 (¤¢¤ë¤¤¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥­¥ã¥Ã¥·¥å¤¬»È¤ï¤ì¤ë¡£ +.TP +.I psize +recno ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ï¡¢¼«¿È¤Î¥ì¥³¡¼¥É¤Î¥³¥Ô¡¼¤ò¥á¥â¥êÆâÉô¤Ë +btree ¤ÇÊݸ¤·¤Æ¤¤¤ë¡£ +¤³¤ÎÃͤϡ¢¤½¤Î btree Ãæ¤Î¥Î¡¼¥É¤ËÂФ·¤ÆÍѤ¤¤é¤ì¤ë +¥Ú¡¼¥¸¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤Ç¤¢¤ë¡£ +.I psize +¤¬ 0 (¤¢¤ë¤¤¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î I/O ¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ò´ð¤Ë¤·¤Æ +¥Ú¡¼¥¸¥µ¥¤¥º¤¬·è¤á¤é¤ì¤ë¡£ +¾ÜºÙ¤Ï +.BR btree (3) +¤ò»²¾È¡£ +.TP +.I lorder +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥á¥¿¥Ç¡¼¥¿¤ÎÀ°¿ôÃͤΥХ¤¥È¥ª¡¼¥À¡¼¡£ +¤³¤Î¿ô»ú¤Ï¡¢½ç½ø¤òÀ°¿ô¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +Î㤨¤Ð¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤Ê¤é¡¢¤³¤Î¿ôÃÍ¤Ï 4,321 ¤È¤Ê¤ë¡£ +.I lorder +¤¬ 0 (»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢¸½ºß¤Î¥Û¥¹¥È +¤Ç»È¤ï¤ì¤Æ¤¤¤ë¥Ð¥¤¥È¥ª¡¼¥À¡¼¤¬»È¤ï¤ì¤ë¡£ +.TP +.I reclen +¸ÇÄê¥ì¥³¡¼¥ÉŤÎŤµ¡£ +.TP +.I bval +²ÄÊѥ쥳¡¼¥ÉŤˤª¤¤¤Æ¡¢ +¥ì¥³¡¼¥É¤Î½ª¤ê¤ò¼¨¤¹¶èÀÚ¤ê¥Ð¥¤¥È (¶èÀÚ¤êʸ»ú) ¤Ç¤¢¤ë¡£ +¸ÇÄê¥ì¥³¡¼¥ÉŤǤÏËä¤áʸ»ú¤È¤·¤Æ»È¤ï¤ì¤ë¡£ +Ãͤ¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢ +²ÄÊѥ쥳¡¼¥ÉĹ¤Î¥ì¥³¡¼¥É¤Î½ª¤ê¤Ë¤Ï²þ¹Ô ("\en") ¤¬»È¤ï¤ì¤ë¡£ +¸ÇÄê¥ì¥³¡¼¥ÉĹ¤Î¥ì¥³¡¼¥É¤Ï¶õÇò (space) ¤ÇËä¤á¤é¤ì¤ë¡£ +.TP +.I bfname +recno ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ï¡¢ +¼«¿È¤Î¥ì¥³¡¼¥É¤Î¥³¥Ô¡¼¤ò¥á¥â¥êÆâÉô¤Ç btree ¤ËÊݸ¤·¤Æ¤¤¤ë¡£ +.I bfname +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢¤³¤ì¤Ï btree ¥Õ¥¡¥¤¥ë̾ +(btree ¥Õ¥¡¥¤¥ë¤ò +.BR dbopen (3) +¤¹¤ë»þ¤Ë»ØÄꤹ¤ë¥Õ¥¡¥¤¥ë̾) ¤ò»ØÄꤹ¤ë¡£ +.PP +.I recno +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ç»È¤ï¤ì¤ë¥­¡¼/¥Ç¡¼¥¿ÂФΥǡ¼¥¿Éôʬ¤Ï¡¢ +¾¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +¤·¤«¤·¥­¡¼¤Ï°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +¥­¡¼¤Î +.I data +¥Õ¥£¡¼¥ë¥É¤Ï +.I recno_t +·¿¤Î¡¢¥á¥â¥ê°ÌÃ֤ؤΥݥ¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I recno_t +¤Ï +.I +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î·¿¤ÏÄ̾¤½¤Î¼ÂÁõ¤ÇÍøÍѲÄǽ¤ÊºÇÂç¤ÎÉä¹æ̵¤·À°¿ô¤Ç¤¢¤ë¡£ +¥­¡¼¤Î +.I size +¥Õ¥£¡¼¥ë¥É¤Ï¤½¤Î·¿¤Î¥µ¥¤¥º¤È¤Ê¤ë¡£ +.PP +recno ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Î¥Õ¥¡¥¤¥ë¤Ë´ØÏ¢¤Å¤±¤é¤ì¤ë +¥á¥¿¥Ç¡¼¥¿¤Ï¸ºß¤Ç¤­¤Ê¤¤¤«¤é¡¢ +¥Ç¥Õ¥©¥ë¥ÈÃÍ (¸ÇÄê¥ì¥³¡¼¥ÉĹ¤ä¥»¥Ñ¥ì¡¼¥¿Ê¸»ú¤Ê¤É) +¤ËÂФ¹¤ëÊѹ¹¤Ï¥Õ¥¡¥¤¥ë¤ò³«¤¯Ëè¤ËÌÀ¼¨Åª¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.BR dbopen (3) +¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ç¤Ï¡¢ +.I put +¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤ò»È¤Ã¤Æ¿·¤·¤¤¥ì¥³¡¼¥É¤òºîÀ®¤¹¤ë¤È¤­¤Ë¡¢ +»ØÄꤷ¤¿¥ì¥³¡¼¥ÉÈֹ椬¥Ç¡¼¥¿¥Ù¡¼¥¹Ãæ¤Ë¸ºß¤·¤Æ¤¤¤ëºÇÂç¥ì¥³¡¼¥ÉÈÖ¹æ¤è¤ê +°ì¤Ä°Ê¾åÂ礭¤¤¤È¡¢ +¶õ¤Î¥ì¥³¡¼¥É¤¬Æ±»þ¤Ë¤Ç¤­¤Æ¤·¤Þ¤¦¡£ +.SH ¥¨¥é¡¼ +.I recno +¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¥ë¡¼¥Á¥ó¤Ï¼ºÇÔ¤¹¤ë¤È +.BR dbopen (3) +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ë±þ¤¸¤¿ +.IR errno " ¤«¡¢" +¤¢¤ë¤¤¤Ï°Ê²¼¤Ë¼¨¤¹ +.I errno +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.TP +.B EINVAL +¸ÇÄêĹ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥ì¥³¡¼¥É¤òÄɲ乤ë¤È¤­¡¢¥Ç¡¼¥¿¤¬Ä¹¤¹¤®¤¿¡£ +.SH ¥Ð¥° +¥Ð¥¤¥È¥ª¡¼¥À¡¼¤È¤·¤Æ¤Ï¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤È¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó¤Î¤ß¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR btree (3), +.BR dbopen (3), +.BR hash (3), +.BR mpool (3) +.sp +.IR "Document Processing in a Relational Database System" , +Michael Stonebraker, Heidi Stettner, Joseph Kalash, Antonin Guttman, +Nadene Lynn, Memorandum No. UCB/ERL M82/32, May 1982. diff --git a/release/man3/regex.3 b/release/man3/regex.3 new file mode 100644 index 00000000..f45e515b --- /dev/null +++ b/release/man3/regex.3 @@ -0,0 +1,312 @@ +.\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.) +.\" +.\" 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. +.\" +.\" Wed Jun 14 16:10:28 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk) +.\" Tiny change in formatting - aeb, 950812 +.\" Modified 8 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) +.\" +.\" Japanese Version Copyright (c) 1998 Takatsugu Nokubi +.\" all rights reserved. +.\" Translated 1998-06-30, Takatsugu Nokubi +.\" Updated & Modified 2001-11-05, Yuichi SATO +.\" Updated & Modified 2005-02-24, Yuichi SATO +.\" Updated 2008-08-02, Akihiro MOTOKI , LDP v3.05 +.\" +.\"WORD: bitwise-or ¥Ó¥Ã¥È¤´¤È¤ÎOR +.\"WORD: element (¹½Â¤ÂÎ)Í×ÁÇ +.\"WORD: collating element ¾È¹ç½ç½ø¤ÎÍ×ÁÇ +.\" +.\" show the synopsis section nicely +.de xx +.in \\n(INu+\\$1 +.ti -\\$1 +.. +.TH REGEX 3 2008-05-29 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +regcomp, regexec, regerror, regfree \- POSIX regex ´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.B #include + +.BI "int regcomp(regex_t *" preg ", const char *" regex ", int " cflags ); + +.BI "int regexec(const regex_t *" preg ", const char *" string \ +", size_t " nmatch , +.BI " regmatch_t " pmatch[] ", int " eflags ); + +.BI "size_t regerror(int " errcode ", const regex_t *" preg ", char *" errbuf , +.BI " size_t " errbuf_size ); + +.BI "void regfree(regex_t *" preg ); +.fi +.SH ÀâÌÀ +.SS "POSIX regex ¥³¥ó¥Ñ¥¤¥ë" +.BR regcomp () +¤Ï¡¢Àµµ¬É½¸½¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¡¢ +.BR regexec () +¤Ç¤Î¸¡º÷½èÍý¤ËŬ¹ç¤¹¤ë·ÁÂ֤ˤ¹¤ë¡£ + +.BR regcomp () +¤Ï¥Ñ¥¿¡¼¥ó¤òµ­²±¤¹¤ë¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ +.IR preg ¡¢ +¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó +.IR regex ¡¢ +¤½¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤Î·Á¼°¤ò·è¤á¤ë¤¿¤á¤Î¥Õ¥é¥° +.I cflag +¤ò°ú¿ô¤Ëȼ¤¦¡£ + +Á´¤Æ¤ÎÀµµ¬É½¸½¸¡º÷¤Ï¡¢¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¤Ë¤è¤Ã¤Æ¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤è¤Ã¤Æ¡¢ +.BR regexec () +¤Ë»ØÄꤹ¤ë¤Î¤Ï¡¢É¬¤º +.RB ( regcomp () +¤Ë¤è¤Ã¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿) ¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥¢¥É¥ì¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.I cflags +¤Ë¤Ï°Ê²¼¤Ë¼¨¤¹Äê¿ô°ì¤Ä°Ê¾å¤Î¥Ó¥Ã¥È¤´¤È¤Î OR (bitwise-or) ¤ò»ØÄꤹ¤ë¡£ +.TP +.B REG_EXTENDED +.I regex +¤Ë +.B POSIX +³ÈÄ¥Àµµ¬É½¸½¤ò»ÈÍѤ¹¤ë¡£¤â¤·¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢ +.B POSIX +ɸ½àÀµµ¬É½¸½¤¬»È¤ï¤ì¤ë¡£ +.TP +.B REG_ICASE +Âçʸ»ú¾®Ê¸»ú¤Î°ã¤¤¤ò̵»ë¤¹¤ë¡£¤³¤Î¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ +¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤òÍѤ¤¤Æ +.BR regexec () +´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¤È¡¢Âçʸ»ú¾®Ê¸»ú¤Î¶èÊ̤òÉÕ¤±¤º¤Ë¸¡º÷¤¬¹Ô¤ï¤ì¤ë¡£ +.TP +.B REG_NOSUB +¤³¤Î¥Õ¥é¥°¤òÀßÄꤷ¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤¬ +.BR regexec () +¤Î°ú¿ô¤Ë»ØÄꤵ¤ì¤ë¤È¡¢°ú¤­¿ô +.IR nmatch , +.I pmatch +¤¬Ìµ»ë¤µ¤ì¤ë¡£ +.TP +.B REG_NEWLINE +Á´¤Æ¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿¤Ë²þ¹Ô¤ò¥Þ¥Ã¥Á¤µ¤»¤Ê¤¤¡£ + +²þ¹Ô¤ò´Þ¤Þ¤Ê¤¤Èó¥Þ¥Ã¥Á¥ó¥°Ê¸»ú¥ê¥¹¥È +.RB ( [^...] ) +¤Ë²þ¹Ô¤ò¥Þ¥Ã¥Á¤µ¤»¤Ê¤¤¡£ + +.BR regexec () +¤Î¼Â¹Ô»þ¤Ë»ØÄꤹ¤ë¥Õ¥é¥° +.I eflags +¤Ë +.B REG_NOTBOL +¤ò´Þ¤à¤«¤É¤¦¤«¤Ë¤«¤«¤ï¤é¤º¡¢¹ÔƬ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿ +.RB ( ^ ) +¤ò²þ¹Ôľ¸å¤Î¶õʸ»úÎó¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¡£ + +.I eflags +¤Ë +.B REG_NOTEOL +¤ò´Þ¤à¤«¤É¤¦¤«¤Ë¤«¤«¤ï¤é¤º¡¢¹ÔËö¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿ +.RB ( $ ) +¤ò²þ¹ÔľÁ°¤Î¶õʸ»úÎó¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¡£ +.SS "POSIX regex ¥Þ¥Ã¥Á¥ó¥°" +.BR regexec () +¤Ï¡¢ +¥×¥ê¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡ +.I preg +¤ò¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¡£ +.I nmatch +¤È +.I pmatch +¤Ï¥Þ¥Ã¥Á¥ó¥°¤Î°ÌÃ֤˴ؤ¹¤ë¾ðÊó¤ò¼èÆÀ¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +.I eflags +¤Ë¤Ï +.B REG_NOTBOL +¤È +.B REG_NOTEOL +¤Î¤É¤Á¤é¤«¡¢¤â¤·¤¯¤ÏξÊý¤Î¥Ó¥Ã¥È¤´¤È¤Î +.BR OR " (bitwise-" or ) +¤ò»ØÄꤷ¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ë¤è¤¦¤Ë¥Þ¥Ã¥Á¥ó¥°Æ°ºî¤òÊѲ½¤µ¤»¤ë¡£ +.TP +.B REG_NOTBOL +¹ÔƬ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿¤Ï¡¢É¬¤º¥Þ¥Ã¥Á¤Ë¼ºÇÔ¤¹¤ë (¥³¥ó¥Ñ¥¤¥ë»þ¤Î¥Õ¥é¥° +.B REG_NEWLINE +¤Î¹àÌܤ⻲¾È)¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢Ê£¿ô¹Ô¤Ë¤Þ¤¿¤¬¤ëʸ»úÎó¤ò +.BR regexec () +¤Ç¸¡º÷¤¹¤ëºÝ¤Ë¡¢Ê¸»úÎó¤ÎÀèƬ¤ò¹Ô¤ÎÀèƬ¤È¤·¤Æ²ò¼á¤µ¤»¤Ê¤¤¾ì¹ç¤ËÍѤ¤¤ë¡£ +.TP +.B REG_NOTEOL +¹ÔËö¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿¤Ï¡¢É¬¤º¥Þ¥Ã¥Á¤Ë¼ºÇÔ¤¹¤ë (¥³¥ó¥Ñ¥¤¥ë»þ¤Î¥Õ¥é¥° +.B REG_NEWLINE +¤Î¹àÌܤ⻲¾È)¡£ +.SS ¥Ð¥¤¥È¥ª¥Õ¥»¥Ã¥È +¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B REG_NOSUB +¤¬ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢Éôʬʸ»úÎó¤Î¥Þ¥Ã¥Á¥ó¥°°ÌÃÖ¾ðÊó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.I pmatch +¤Ï¡¢¾¯¤Ê¤¯¤È¤â +.I nmatch +¤ÎÂ礭¤µ¤ò»ý¤Ä¤è¤¦¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BR regexec () +¤Î¼Â¹Ô¤Ë¤è¤Ã¤Æ¡¢¤½¤ì¤é¤ËÉôʬʸ»úÎó¥Þ¥Ã¥Á¥ó¥°°ÌÃÖ¾ðÊó¤¬ÂåÆþ¤µ¤ì¤ë¡£ +̤»ÈÍѤι½Â¤ÂÎÍ×ÁÇ¤Ë¤Ï \-1 ¤¬ÃͤȤ·¤ÆÂåÆþ¤µ¤ì¤ë¡£ + +.I pmatch +¤Î·¿¤Ç¤¢¤ë +.I regmatch_t +¹½Â¤ÂΤϡ¢ +.I +Æâ¤ÇÄêµÁ¤µ¤ì¤ë¡£ + +.in +4n +.nf +typedef struct { + regoff_t rm_so; + regoff_t rm_eo; +} regmatch_t; +.fi +.in + +¹½Â¤ÂÎÍ×ÁÇ +.I rm_so +¤ÎÃͤ¬ \-1 ¤Ç¤Ê¤¤¾ì¹ç¡¢¤½¤ì¤Ïʸ»úÎóÆâ¤Ç¤Î¼¡¤ÎºÇÂç¤Î¥Þ¥Ã¥Á¥ó¥°Éôʬ¤Î³«»Ï +¥ª¥Õ¥»¥Ã¥È°ÌÃÖ¤ò¼¨¤¹¡£¤½¤ì¤ËÂФ·¡¢¹½Â¤ÂÎÍ×ÁÇ +.I rm_eo +¤Ï¥Þ¥Ã¥Á¥ó¥°Éôʬ¤Î½ªÎ»¥ª¥Õ¥»¥Ã¥È°ÌÃÖ¤ò¼¨¤·¡¢ +¥Þ¥Ã¥Á¥ó¥°Éôʬ¤Îľ¸å¤Îʸ»ú¤Î¥ª¥Õ¥»¥Ã¥È°ÌÃÖ¤¬»ÈÍѤµ¤ì¤ë¡£ +.SS "POSIX ¥¨¥é¡¼¥ì¥Ý¡¼¥È" +.BR regerror () +¤Ï¡¢ +.BR regcomp () +¤È +.BR regexec () +¤Î¼Â¹Ô¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤ë¥¨¥é¡¼¥³¡¼¥É¤«¤é¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸Ê¸»úÎó¤ò +ÆÀ¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ + +.BR regerror () +¤Ï¥¨¥é¡¼¥³¡¼¥É +.IR errcode ¡¢ +¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡ +.IR preg ¡¢ +ʸ»úÎó¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ +.IR errbuf ¡¢ +ʸ»úÎó¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º +.I errbuf_size +¤ò°ú¿ô¤Ë¤È¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸Ê¸»úÎó¤ò³ÊǼ¤¹¤ë¤Î¤ËɬÍ×¤Ê +.I errbuf +¤Î¥µ¥¤¥º¤òÊÖ¤¹¡£¤â¤· +.I errbuf +¤È +.I errbuf_size +¤ÎξÊý¤¬Èó 0 ÃͤǤ¢¤ì¤Ð¡¢ +.I errbuf +¤Ë¤ÏºÇ½é¤Î +.I "errbuf_size \- 1" +ʸ»úʬ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤È½ªÃ¼¤Î¥Ì¥ëʸ»ú¤¬¼ý¤Þ¤ë¤è¤¦¤ËÂåÆþ¤µ¤ì¤ë¡£ +.SS "POSIX ¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡²òÊü" +°ú¿ô¤Ë¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡ +.I preg +¤òÍ¿¤¨¤Æ +.BR regfree () +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢ +.BR regcomp () +¤Ë¤è¤ë¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤¬²òÊü¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR regcomp () +¤Ï¡¢¥³¥ó¥Ñ¥¤¥ë¤ÎÀ®¸ù»þ¤Ë¤Ï 0 ¤òÊÖ¤·¡¢¼ºÇÔ»þ¤Ë¤Ï¥¨¥é¡¼¥³¡¼¥É¤òÊÖ¤¹¡£ + +.BR regexec () +¤Ï¡¢¥Þ¥Ã¥Á¥ó¥°¤ÎÀ®¸ù»þ¤Ë¤Ï 0 ¤òÊÖ¤·¡¢¼ºÇÔ»þ¤Ë¤Ï +.B REG_NOMATCH +¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.BR regcomp () +¤Ï°Ê²¼¤Î¥¨¥é¡¼¤òÊÖ¤¹¡£ +.TP +.B REG_BADBR +̵¸ú¤Ê¸åÊý»²¾È¥ª¥Ú¥ì¡¼¥¿¤Î»ÈÍÑ¡£ +.TP +.B REG_BADPAT +¥°¥ë¡¼¥×¤ä¥ê¥¹¥È¤Ê¤É¤Î¡¢¥Ñ¥¿¡¼¥ó¥ª¥Ú¥ì¡¼¥¿¤Î̵¸ú¤Ê»ÈÍÑ¡£ +.TP +.B REG_BADRPT +\(aq*\(aq ¤¬ºÇ½é¤Îʸ»ú¤È¤·¤Æ¤¯¤ë¤è¤¦¤Ê¡¢Ìµ¸ú¤Ê·«¤êÊÖ¤·¥ª¥Ú¥ì¡¼¥¿¤Î»ÈÍÑ¡£ +.TP +.B REG_EBRACE +¥¤¥ó¥¿¡¼¥Ð¥ë¥ª¥Ú¥ì¡¼¥¿ +.B {} +(brace interval operators) ¤¬ÊĤ¸¤Æ¤¤¤Ê¤¤¡£ +.TP +.B REG_EBRACK +¥ê¥¹¥È¥ª¥Ú¥ì¡¼¥¿ +.B [] +(bracket list operators) ¤¬ÊĤ¸¤Æ¤¤¤Ê¤¤¡£ +.TP +.B REG_ECOLLATE +¾È¹ç½ç½ø¤ÎÍ×ÁÇ (collating element) ¤È¤·¤ÆÍ­¸ú¤Ç¤Ï¤Ê¤¤¡£ + +(ÌõÃí) ¾È¹ç½ç½ø¤ÎÍ×ÁÇ (collating element) ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR regex (7) +¤ò»²¾È¡£ +.TP +.B REG_ECTYPE +̤ÃΤΥ­¥ã¥é¥¯¥¿¥¯¥é¥¹Ì¾¡£ +.TP +.B REG_EEND +̤ÄêµÁ¥¨¥é¡¼¡£¤³¤ì¤Ï POSIX.2 ¤Ë¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B REG_EESCAPE +Àµµ¬É½¸½¤¬¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Ç½ª¤Ã¤Æ¤¤¤ë¡£ + +(ÌõÃí) ÆüËܸì´Ä¶­¤Î¾ì¹ç¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤È¤Ê¤ë¤Ù¤­½ê¤¬±ßµ­¹æ¤Ç +ɽ¼¨¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¤¬¡¢¤³¤ì¤Ïñ¤Ëɽ¼¨¥Õ¥©¥ó¥È¤ÎÌäÂê¤Ç¡¢ +ÆâÉôŪ¤Ë¤ÏƱ¤¸°ÕÌ£¤Ç¤¢¤ë¡£ +.TP +.B REG_EPAREN +¥°¥ë¡¼¥×¥ª¥Ú¥ì¡¼¥¿ +.B () +(parenthesis group operators) ¤¬ÊĤ¸¤Æ¤¤¤Ê¤¤¡£ +.TP +.B REG_ERANGE +̵¸ú¤ÊÈÏ°Ï¥ª¥Ú¥ì¡¼¥¿¤Î»ÈÍÑ¡£ +Î㤨¤Ð¡¢ÈϰϤνªÎ»°ÌÃÖ¤¬³«»Ï°ÌÃÖ¤è¤ê¤âÁ°¤Ë¤¢¤ë¤è¤¦¤Ê¾ì¹ç¡£ +.TP +.B REG_ESIZE +Àµµ¬É½¸½¤Î¥³¥ó¥Ñ¥¤¥ë¤Ë¡¢64Kb °Ê¾å¤Î¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤¬É¬Íס£ +¤³¤ì¤Ï POSIX.2 ¤Ë¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B REG_ESPACE +regex ¥ë¡¼¥Á¥ó¤¬¥á¥â¥ê¤ò»È¤¤¤Ï¤¿¤·¤Æ¤¤¤ë¡£ +.TP +.B REG_ESUBREG +¥µ¥Ö¥¨¥¯¥¹¥×¥ì¥Ã¥·¥ç¥ó +.RB \e (...\e ) +(subexpression) ¤Ø¤Î̵¸ú¤Ê¸åÊý»²¾È¡£ +.SH ½àµò +POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR grep (1), +.BR regex (7), +GNU regex ¥Þ¥Ë¥å¥¢¥ë diff --git a/release/man3/remainder.3 b/release/man3/remainder.3 new file mode 100644 index 00000000..09e05e2e --- /dev/null +++ b/release/man3/remainder.3 @@ -0,0 +1,198 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-08-10 Walter Harms +.\" (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 2009-02-04 "" "Linux Programmer's Manual" +.SH ̾Á° +drem, dremf, dreml, remainder, remainderf, remainderl \- ÉâÆ°¾®¿ôÅÀ¾ê;´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +/* 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 ); +.sp +/* Çѻߤµ¤ì¤¿ÊÌ̾ */ +.BI "double drem(double " x ", double " y ); +.BI "float dremf(float " x ", float " y ); +.BI "long double dreml(long double " x ", long double " y ); +.sp +.fi +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR remainder (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR remainderf (), +.BR remainderl (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR drem (), +.BR dremf (), +.BR dreml (): +_SVID_SOURCE || _BSD_SOURCE +.ad b +.SH ÀâÌÀ +.BR remainder () +´Ø¿ô¤Ï +.I x +¤ò +.I y +¤Ç³ä¤Ã¤¿Í¾¤ê¤ò·×»»¤¹¤ë¡£ +ÊÖ¤êÃÍ¤Ï +\fIx\fP\-\fIn\fP*\fIy\fP +¤Ç¤¢¤ë¡£ +¤³¤³¤Ç +.I n +¤Ï +.I "x\ /\ y" +¤ÎÃͤòºÇ¤â¶á¤¤À°¿ô¤Ë´Ý¤á¤¿¤â¤Î¤Ç¤¢¤ë¡£ +\fIx\fP\-\fIn\fP*\fIy\fP +¤ÎÀäÂÐÃͤ¬ 0.5 ¤Î¾ì¹ç¡¢¶ö¿ô¤Ë¤Ê¤ë¤è¤¦¤Ë +.I n +¤¬Áª¤Ð¤ì¤ë¡£ + +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¸½ºß¤Î´Ý¤á¥â¡¼¥É¤Î±Æ¶Á¤ò¼õ¤±¤Ê¤¤ (´Ý¤á¥â¡¼¥É¤Ë¤Ä¤¤¤Æ¤Ï +.BR fenv (3) +¤ò»²¾È)¡£ +.LP +.BR drem () +´Ø¿ô¤Ï¤³¤ì¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤ÏÉâÆ°¾®¿ôÅÀ¤Î¾ê; \fIx\fP\-\fIn\fP*\fIy\fP ¤òÊÖ¤¹¡£ +ÊÖ¤êÃͤ¬ 0 ¤Î¾ì¹ç¡¢¤½¤ÎÉä¹æ¤Ï +.I x +¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ + +.I x +¤« +.I y +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Ìµ¸ÂÂç¤Ç +.I y +¤¬ NaN ¤Ç¤Ê¤¤¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.\" FIXME . Instead, glibc gives a domain error even if x is a NaN +.\" Interestingly, remquo(3) does not have the same problem. +.I y +¤¬¥¼¥í¤Ç +.I x +¤¬ NaN ¤Ç¤Ê¤¤¾ì¹ç¡¢ +Îΰ襨¥é¡¼¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬Ìµ¸ÂÂç¤Ç \fIy\fP ¤¬ NaN ¤Ç¤Ï¤Ê¤¤ +.\" .I errno +.\" is set to +.\" .BR EDOM . +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.IP +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤³¤Î¾ì¹ç¤Ë +.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 +Îΰ襨¥é¡¼: \fIy\fP ¤¬¥¼¥í¤Ç \fIx\fP ¤¬ NaN ¤Ç¤Ï¤Ê¤¤ (²¼µ­¤Î¡Ö¥Ð¥°¡×»²¾È) +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.SH ½àµò +.\" IEC 60559. +´Ø¿ô +.BR remainder (), +.BR remainderf (), +.BR remainderl () +¤Ï C99 ¤È POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +´Ø¿ô +.BR drem () +¤Ï 4.3BSD ¤ËͳÍ褹¤ë¡£ +.I float +¤È +.I "long double" +ÈǤΠ+.BR dremf () +¤È +.BR dreml () +¤Ï¡¢Tru64 ¤ä glibc2 ¤Î¤è¤¦¤Ê¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Î»ÈÍѤÏÈò¤±¤Æ¡¢ +.BR remainder () +¤Ê¤É¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.SH ¥Ð¥° + + 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 +.SH Îã +"remainder(29.0, 3.0)" ¤ò¸Æ¤Ó½Ð¤¹¤È \-1 ¤òÊÖ¤¹¡£ +.SH ´ØÏ¢¹àÌÜ +.BR div (3), +.BR fmod (3), +.BR remquo (3) diff --git a/release/man3/remove.3 b/release/man3/remove.3 new file mode 100644 index 00000000..442f0d7a --- /dev/null +++ b/release/man3/remove.3 @@ -0,0 +1,98 @@ +.\" This file is derived from unlink.2, which has the following copyright: +.\" +.\" --snip-- +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" 1993 Ian Jackson. +.\" +.\" 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. +.\" --snip-- +.\" +.\" Edited into remove.3 shape by: +.\" Graeme W. Wilford (G.Wilford@ee.surrey.ac.uk) on 13th July 1994 +.\" +.\" Japanese Version Copyright (c) 1998 Ueyama Rui +.\" all rights reserved. +.\" Translated Wed Feb 20 15:01:46 JST 1998 +.\" by Ueyama Rui +.\" Updated Sat Dec 11 JST 1999 by Kentaro Shirakata +.\" Updated Mon Feb 17 JST 2003 by Kentaro Shirakata +.\" +.TH REMOVE 3 2008-12-03 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +remove \- ¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int remove(const char *" pathname ); +.SH ÀâÌÀ +.BR remove () +¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤é¥Õ¥¡¥¤¥ë̾¤òºï½ü¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¤Ï +.BR unlink (2) +¤ò¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ¤Ï +.BR rmdir (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ + +¤â¤·¤½¤Î̾Á°¤¬ +¥Õ¥¡¥¤¥ë¤Ø¤ÎºÇ¸å¤Î¥ê¥ó¥¯¤Ç¡¢¤«¤Ä¡¢¤É¤Î¥×¥í¥»¥¹¤â¤½¤Î¥Õ¥¡¥¤¥ë¤ò +³«¤¤¤Æ¤¤¤Ê¤¤¤Ê¤é¡¢¥Õ¥¡¥¤¥ë¤âºï½ü¤¹¤ë¡£¥Õ¥¡¥¤¥ë¤ÎÀê¤á¤Æ¤¤¤¿ +Îΰè¤Ï¾¤Ç»È¤¦¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + +̾Á°¤¬¥Õ¥¡¥¤¥ë¤Ø¤ÎºÇ¸å¤Î¥ê¥ó¥¯¤Ç¤¢¤Ã¤Æ¤â¡¢¤É¤³¤«¤Î¥×¥í¥»¥¹¤¬ +¤½¤Î¥Õ¥¡¥¤¥ë¤ò³«¤¤¤Æ¤¤¤ë¤Ê¤é¡¢¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Î¥Õ¥¡¥¤¥ëµ­½Ò»Ò +(file descriptor) ¤¬ÊĤ¸¤é¤ì¤ë¤Þ¤Ç¥Õ¥¡¥¤¥ë¤Ï¸ºß¤·Â³¤±¤ë¡£ + +̾Á°¤¬»Ø¤·¤Æ¤¤¤ë¤Î¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ê¤é¡¢¤½¤Î¥ê¥ó¥¯¤òºï½ü¤¹¤ë¡£ + +̾Á°¤¬»Ø¤·¤Æ¤¤¤ë¤Î¤¬¥½¥±¥Ã¥È¡¢FIFO¡¢¥Ç¥Ð¥¤¥¹¤Î¾ì¹ç¡¢Ì¾Á°¤Ïºï½ü¤µ¤ì¤ë¤¬¡¢ +¤½¤Î¥½¥±¥Ã¥È¤Ê¤É¤ò³«¤¤¤Æ¤¤¤ë¥×¥í¥»¥¹¤Ï¤½¤Î¤Þ¤Þ»È¤¤Â³¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ì¤Ð 0 ¤¬Ê֤롣¥¨¥é¡¼¤Ê¤é \-1 ¤¬Ê֤ꡢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +ȯÀ¸¤¹¤ë¥¨¥é¡¼¤Ï +.BR unlink (2) +¤ª¤è¤Ó +.BR rmdir (2) +¤ÈƱ¤¸¤â¤Î¤Ç¤¢¤ë¡£ +.SH ½àµò +C89, C99, 4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +libc4 ¤È libc5 ¤Ë¤ª¤¤¤Æ¤Ï¡¢ +.BR remove () +¤Ï +.BR unlink (2) +¤ÎÊÌ̾¤Ç¤¢¤Ã¤¿ (½¾¤Ã¤Æ¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤Ç¤­¤Ê¤«¤Ã¤¿)¡£ +.SH ¥Ð¥° +NFS ¥×¥í¥È¥³¥ë¤Îº¬ËÜŪ¤ÊÉÔÅÔ¹ç¤Ë¤è¤ê¡¢»ÈÍÑÃæ¤Î¥Õ¥¡¥¤¥ë¤¬¡¢ +ÁÛÄê¤Ç¤­¤Ê¤¤·Á¤Çºï½ü¤µ¤ì¤ë¤³¤È¤¬¤¢¤ê¤¨¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR rm (1), +.BR unlink (1), +.BR link (2), +.BR mknod (2), +.BR open (2), +.BR rename (2), +.BR rmdir (2), +.BR unlink (2), +.BR mkfifo (3), +.BR symlink (7) diff --git a/release/man3/remquo.3 b/release/man3/remquo.3 new file mode 100644 index 00000000..25e621c3 --- /dev/null +++ b/release/man3/remquo.3 @@ -0,0 +1,121 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 +.\" +.TH REMQUO 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +remquo, remquof, remquol \- ¾¦¤Î°ìÉô¤È¾ê;¤òµá¤á¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double remquo(double " x ", double " y ", int *" quo ); +.br +.BI "float remquof(float " x ", float " y ", int *" quo ); +.br +.BI "long double remquol(long double " x ", long double " y ", int *" quo ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR remquo (), +.BR remquof (), +.BR remquol (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ò +.I y +¤Ç³ä¤Ã¤¿¤È¤­¤Î¾¦¤Î°ìÉô¤È¾ê;¤ò·×»»¤¹¤ë¡£ +¾¦¤Î¤¤¤¯¤Ä¤«¤Î¥Ó¥Ã¥È¤¬ +.I quo +¥Ý¥¤¥ó¥¿¤ò»È¤Ã¤Æ³ÊǼ¤µ¤ì¤ë¡£ +¾ê;¤Ï´Ø¿ô¤Î·ë²Ì¤È¤·¤ÆÊÖ¤µ¤ì¤ë¡£ + +¾ê;¤ÎÃÍ¤Ï +.BR remainder (3) +´Ø¿ô¤Ç·×»»¤µ¤ì¤ë¤â¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£ + +.I quo +¥Ý¥¤¥ó¥¿¤ò»È¤Ã¤Æ³ÊǼ¤µ¤ì¤ëÃͤˤϡ¢ +.I "x\ /\ y" +¤ÎÉä¹æ¤ÈºÇÄã¤Ç¤â¾¦¤Î²¼°Ì 3 ¥Ó¥Ã¥È¤¬´Þ¤Þ¤ì¤ë¡£ + +¤¿¤È¤¨¤Ð \fIremquo(29.0,\ 3.0)\fP ¤Ï \-1.0 ¤òÊÖ¤·¡¢ +(ÌõÃí: quo ¤Î»Ø¤·¤Æ¤¤¤ë¤â¤Î¤Ë¤Ï) 2 ¤¬³ÊǼ¤µ¤ì¤ë¡£ +¼ÂºÝ¤Î¾¦¤¬À°¿ôÃͤˤʤé¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.\" ¤³¤Î´Ø¿ô¤òÍøÍѤ¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È¤·¤Æ¤Ï¡¢ +.\" sin(x) ¤Î·×»»¤Ê¤É¤¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\" sin(x) ¤Ç¤Ï remquo(x, pi/2, &quo) ¤Ê¤É¤ò·×»»¤¹¤ë¡£ +.\" +.\" glibc, UnixWare: 3 ¥Ó¥Ã¥È¤òÊÖ¤¹¡£ +.\" MacOS 10: 7 ¥Ó¥Ã¥È¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.BR remainder (3) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ëƱÍͤδؿô¤ÈƱ¤¸ÃͤòÊÖ¤¹¡£ + +.I x +¤« +.I y +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Ìµ¸ÂÂç¤Ç +.I y +¤¬ NaN ¤Ç¤Ê¤¤¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I y +¤¬¥¼¥í¤Ç +.I x +¤¬ NaN ¤Ç¤Ê¤¤¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬Ìµ¸ÂÂ礫 \fIy\fP ¤¬ 0 ¤Ç¡¢ \ +¾¤Î°ú¤­¿ô¤¬ NaN ¤Ç¤Ê¤¤ +.\" .I errno +.\" is set to +.\" .BR EDOM . +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.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 +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR fmod (3), +.BR logb (3), +.BR remainder (3) diff --git a/release/man3/resolver.3 b/release/man3/resolver.3 new file mode 100644 index 00000000..be88208f --- /dev/null +++ b/release/man3/resolver.3 @@ -0,0 +1,264 @@ +.\" 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-07-25 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2004-10-31 by aeb +.\" +.\" Japanese Version Copyright (c) 1998 Shinji Orito all rights reserved. +.\" Translated Mon May 25 21:27:03 JST 1998 +.\" by Shinji Orito +.\" Updated & Modified Thu Feb 17 03:58:45 JST 2005 +.\" by Yuichi SATO +.\" +.\"WORD: resolver ¥ì¥¾¥ë¥Ð (¥ê¥¾¥ë¥Ð) +.\"WORD: override ¥ª¡¼¥Ð¡¼¥é¥¤¥É +.\"WORD: call ¸Æ¤Ó½Ð¤·¡¢¸Æ¤Ó½Ð¤¹ +.\"WORD: fully qualified domain name ´°Á´½¤¾þ¥É¥á¥¤¥ó̾(FQDN) +.\"WORD: type ·¿ +.\"WORD: class ¥¯¥é¥¹ +.\"WORD: query Ì䤤¹ç¤ï¤»¡¢Ì䤤¹ç¤ï¤»¤ë +.\"WORD: buffer ¥Ð¥Ã¥Õ¥¡¡¼ +.\"WORD: lower-level routines ²¼°Ì¥ë¡¼¥Á¥ó +.\"WORD: limit of the array ÇÛÎó¤ÎÈÏ°Ï +.\"WORD: state information ¾õÂ֤ξðÊó +.\"WORD: bitwise ``or'' ¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýÏ +.\"WORD: True ¿¿ÃÍ +.\"WORD: authoritative ¸¢°ÒÉÕ¤±¤µ¤ì¤¿ +.\"WORD: recursion desired bit ºÆµ¢Í×µá¥Ó¥Ã¥È +.\"WORD: single component names °ìÉôʬ¤«¤é¤Ê¤ë̾Á° +.\" +.TH RESOLVER 3 2008-11-07 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +res_init, res_query, res_search, res_querydomain, res_mkquery, res_send, dn_comp, dn_expand \- ¥ì¥¾¥ë¥Ð¡¦¥ë¡¼¥Á¥ó +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.B extern struct state _res; +.sp +.B int res_init(void); +.sp +.BI "int res_query(const char *" dname ", int " class ", int " type , +.RS +.BI "unsigned char *" answer ", int " anslen ); +.RE +.sp +.BI "int res_search(const char *" dname ", int " class ", int " type , +.RS +.BI "unsigned char *" answer ", int " anslen ); +.RE +.sp +.BI "int res_querydomain(const char *" name ", const char *" domain , +.RS +.BI "int " class ", int " type ", unsigned char *" answer , +.BI "int " anslen ); +.RE +.sp +.BI "int res_mkquery(int " op ", const char *" dname ", int " class , +.RS +.BI "int " type ", char *" data ", int " datalen ", struct rrec *" newrr , +.BI "char *" buf ", int " buflen ); +.RE +.sp +.BI "int res_send(const char *" msg ", int " msglen ", char *" answer , +.RS +.BI "int " anslen ); +.RE +.sp +.BI "int dn_comp(unsigned char *" exp_dn ", unsigned char *" comp_dn , +.RS +.BI "int " length ", unsigned char **" dnptrs ", unsigned char *" exp_dn , +.BI "unsigned char **" lastdnptr ); +.RE +.sp +.BI "int dn_expand(unsigned char *" msg ", unsigned char *" eomorig , +.RS +.BI "unsigned char *" comp_dn ", char *" exp_dn , +.BI "int " length ); +.RE +.fi +.sp +\fI\-lresolv\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î¥É¥á¥¤¥ó¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤ËÌ䤤¹ç¤ï¤»¡¢ +¤½¤Î±þÅú¤ò²ò¼á¤¹¤ë¡£ +.PP +.BR res_init () +´Ø¿ô¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥É¥á¥¤¥ó̾¡¢¸¡º÷½ç¡¢¥Í¡¼¥à¥µ¡¼¥Ð¡¼ +¥¢¥É¥ì¥¹¤òÆÀ¤ë¤¿¤á¤ËÀßÄê¥Õ¥¡¥¤¥ë (resolv.conf(5) »²¾È) ¤òÆɤࡣ +¤â¤·¥µ¡¼¥Ð¡¼¤¬¼¨¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¥í¡¼¥«¥ë¥Û¥¹¥È¤ò»î¤¹¡£ +¥É¥á¥¤¥ó¤¬¼¨¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¥í¡¼¥«¥ë¥Û¥¹¥È¤ËÉÕ¤±¤é¤ì¤¿¥É¥á¥¤¥ó¤òÍѤ¤¤ë¡£ +´Ä¶­ÊÑ¿ô +.B LOCALDOMAIN +¤Ç¥ª¡¼¥Ð¡¼¥é¥¤¥É¤Ç¤­¤ë¡£ +.BR res_init () +¤Ï¡¢¸å½Ò¤¹¤ë´Ø¿ô¤Î¤É¤ì¤«¤¬ºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¡¢¤½¤Î´Ø¿ô +¤«¤é¼Â¹Ô¤µ¤ì¤ë¡£ +.PP +.BR res_query () +´Ø¿ô¤Ï¡¢»ØÄꤵ¤ì¤¿ \fItype\fP ¤È \fIclass\fP ¤Î +´°Á´½¤¾þ¥É¥á¥¤¥ó̾ (FQDN) \fIname\fP ¤ò¡¢¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤ØÌ䤤¹ç¤ï¤»¤ë¡£ +±þÅú¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿Â¦¤Ë¤è¤Ã¤ÆÍÑ°Õ¤µ¤ì¤ëŤµ \fIanslen\fP ¤Î \fIanswer\fP +¥Ð¥Ã¥Õ¥¡¡¼¤Ë»Ä¤µ¤ì¤ë¡£ +.PP +.BR res_search () +´Ø¿ô¤Ï¡¢Ì䤤¹ç¤ï¤»¤ò¹Ô¤¤ +.BR res_query () +ƱÍͤ½¤Î±þÅú¤ò +ÂԤĤ¬¡¢¤µ¤é¤Ë¥Ç¥Õ¥©¥ë¥È¤ò¼ÂÁõ¤·¤Æ¤ª¤ê +.B RES_DEFNAMES +¤È +.B RES_DNSRCH +¤Ë¤è¤Ã¤Æµ¬Äꤵ¤ì¤ë¸¡º÷¥ë¡¼¥ë¤òŬÍѤ¹¤ë¡£ +(²¼µ­ \fI_res\fP ¥ª¥×¥·¥ç¥ó¤ÎÀâÌÀ¤ò»²¾È) +.PP +.BR res_querydomain () +´Ø¿ô¤Ï \fIname\fP ¤È \fIdomain\fP ¤Î·ë¹ç¤Ë +.BR res_query () +¤òÍѤ¤¤ÆÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦¡£ +.PP +¼¡¤Î´Ø¿ô¤Ï¡¢ +.BR res_query () +¤Ç»È¤ï¤ì¤ë²¼°Ì¥ë¡¼¥Á¥ó¤Ç¤¢¤ë¡£ +.PP +.BR res_mkquery () +´Ø¿ô¤Ï¡¢¥É¥á¥¤¥ó̾ \fIdname\fP ¤Î°Ù¤Ë¡¢Ä¹¤µ \fIbuflen\fP +¤Î \fIbuf\fP ¤ËÌ䤤¹ç¤ï¤»¤ë¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤¹¤ë¡£ +Ì䤤¹ç¤ï¤»¤Î·¿ \fIop\fP ¤ÏÄ̾ï +.B QUERY +¤À¤¬¡¢ \fI\fP ¤ÇÄêµÁ¤µ¤ì¤¿·¿¤Î¤É¤ì¤Ç¤âÎɤ¤¡£ +\fInewrr\fP ¤Ï¸½ºß»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.BR res_send () +´Ø¿ô¤Ï¡¢Ä¹¤µ \fImsglen\fP ¤Î \fImsg\fP ¤Ë·è¤á¤é¤ì¤¿½ñ¼° +¤ÇÌ䤤¹ç¤ï¤»¡¢\fIanswer\fP ¤ËŤµ \fIanslen\fP ¤Î²óÅú¤òÊÖ¤¹¡£ +¤Þ¤À¸Æ¤Ó½Ð¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð +.BR res_init () +¤ò¸Æ¤Ó½Ð¤¹¡£ +.PP +.BR dn_comp () +´Ø¿ô¤Ï¥É¥á¥¤¥ó̾ \fIexp_dn\fP ¤ò°µ½Ì¤·¤Æ¡¢Ä¹¤µ \fIlength\fP +¤Î¥Ð¥Ã¥Õ¥¡¡¼ \fIcomp_dn\fP ¤ËÊݸ¤¹¤ë¡£ +°µ½Ì¤Ë¤Ï¥Ý¥¤¥ó¥¿¡¼ÇÛÎó \fIdnptrs\fP ¤òÍѤ¤¤ë¡£ +¤³¤ì¤é¤Î¥Ý¥¤¥ó¥¿¡¼¤Ï¡¢¸½ºß¤Î¥á¥Ã¥»¡¼¥¸¤ÎÃæ¤Ë¤¢¤ë°ÊÁ°¤Ë°µ½Ì¤µ¤ì¤¿Ì¾Á°¤ò»Ø¤¹¡£ +ºÇ½é¤Î¥Ý¥¤¥ó¥¿¡¼¤Ï¥á¥Ã¥»¡¼¥¸¤ÎËÁƬ¤ò»Ø¤·¡¢¤½¤Î¥ê¥¹¥È¤Ï NULL ¤Ç½ª¤ï¤ë¡£ +ÇÛÎó¤ÎÈÏ°Ï¤Ï \fIlastdnptr\fP ¤Ç·è¤á¤é¤ì¤ë¡£ +\fIdnptr\fP ¤¬ NULL ¤Ê¤é¤Ð¥É¥á¥¤¥ó̾¤Ï°µ½Ì¤µ¤ì¤Ê¤¤¡£ +\fIlastdnptr\fP ¤¬ NULL ¤Ê¤é¤Ð¡¢¤½¤Î¥é¥Ù¥ë¤Î¥ê¥¹¥È¤Ï¥¢¥Ã¥×¥Ç¡¼¥È¤µ¤ì¤Ê¤¤¡£ +.PP +.BR dn_expand () +´Ø¿ô¤Ï¡¢°µ½Ì¤µ¤ì¤¿¥É¥á¥¤¥ó̾ \fIcomp_dn\fP ¤«¤é¥µ¥¤¥º +¤¬ \fIlength\fP ¤Î \fIexp_dn\fP ¥Ð¥Ã¥Õ¥¡¡¼¤ËÀµ¼°¤Ê¥É¥á¥¤¥ó̾¤òŸ³«¤¹¤ë¡£ +¤½¤Î°µ½Ì¤µ¤ì¤¿Ì¾Á°¤Ï¡¢Ì䤤¹ç¤ï¤»¡¢¤Þ¤¿¤Ï±þÅú¥á¥Ã¥»¡¼¥¸¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Æ¡¢ +\fImsg\fP ¤¬¥á¥Ã¥»¡¼¥¸¤ÎËÁƬ¤ò»Ø¤¹¡£ +.PP +¥ì¥¾¥ë¥Ð¡¦¥ë¡¼¥Á¥ó¤Ï¡¢\fI\fP ¤ËÄêµÁ¤µ¤ì¤¿ \fI_res\fP ¹½Â¤ÂÎ¤Ë +´Þ¤Þ¤ì¤Æ¤¤¤ëÁ´ÂÎŪ¤ÊÀßÄê¤È¾õÂ֤ξðÊó¤ò»ÈÍѤ¹¤ë¡£ +Ä̾ï¥æ¡¼¥¶¡¼¤ËÁàºî¤Ç¤­¤ë¹àÌÜ¤Ï \fI_res.options\fP ¤À¤±¤Ç¤¢¤ë¡£ +¤³¤Î¹àÌܤϰʲ¼¤Î¥ª¥×¥·¥ç¥ó¤Î¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýϤˤǤ­¤ë¡£ +.TP +.B RES_INIT +.BR res_init () +¤¬¸Æ¤Ó½Ð¤µ¤ì¤Æ¤¤¤ì¤Ð¿¿¡£ +.TP +.B RES_DEBUG +¥Ç¥Ð¥Ã¥°¡¦¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ¹¤ë¡£ +.TP +.B RES_AAONLY +¸¢°ÒÉÕ¤±¤µ¤ì¤¿ (authoritative) ²óÅú¤Î¤ß¼õ¤±Æþ¤ì¤ë¡£ +.BR res_send () +¤Ï¡¢ºÇ½ªÅª¤Ë¸¢°ÒÉÕ¤±¤µ¤ì¤¿²óÅú¤òÆÀ¤é¤ì¤ë¤«¡¢¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë +¤Þ¤Ç³¹Ô¤¹¤ë¡£ +[¸½ºß¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤] +.TP +.B RES_USEVC +Ì䤤¹ç¤ï¤»¤Ë UDP ¥Ç¡¼¥¿¥°¥é¥à¤Ç¤Ï¤Ê¤¯ TCP Àܳ¤òÍѤ¤¤ë¡£ +.TP +.B RES_PRIMARY +¥×¥é¥¤¥Þ¥ê¡¦¥É¥á¥¤¥ó¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤Î¤ßÌ䤤¹ç¤ï¤»¤ë¡£ +.TP +.B RES_IGNTC +ÀÚ¤êµÍ¤á¥¨¥é¡¼ (truncation error) ¤ò̵»ë¤¹¤ë¡£TCP ¤Ç¥ê¥È¥é¥¤¤·¤Ê¤¤¡£ +[¸½ºß¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤] +.TP +.B RES_RECURSE +ºÆµ¢Í×µá (recursion desired) ¥Ó¥Ã¥È¤òÌ䤤¹ç¤ï¤»¤ËÀßÄꤹ¤ë¡£ +ºÆµ¢¤Ï +.BR res_send () +¤Ç¤Ï¤Ê¤¯¥É¥á¥¤¥ó¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤Ë¤è¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +[¥Ç¥Õ¥©¥ë¥È¤ÇÍ­¸ú] +.TP +.B RES_DEFNAMES +ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢ +.BR res_search () +¤Ï¥Ç¥Õ¥©¥ë¥È¤Î¥É¥á¥¤¥ó̾¤ò°ìÉôʬ +¤Î¤ß¤«¤é¤Ê¤ë̾Á°¡¢¤¹¤Ê¤ï¤Á¥É¥Ã¥È¤ò´Þ¤Þ¤Ê¤¤Ì¾Á°¤ËÉÕ¤±²Ã¤¨¤ë¡£ +[¥Ç¥Õ¥©¥ë¥È¤ÇÍ­¸ú] +.TP +.B RES_STAYOPEN +Ì䤤¹ç¤ï¤»Ãæ¤Ë TCP Àܳ¤òÊݤĤ¿¤á +.B RES_USEVC +¤È¶¦¤ËÍѤ¤¤é¤ì¤ë¡£ +.TP +.B RES_DNSRCH +ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢ +.BR res_search () +¤Ï¸½ºß¤Î¥É¥á¥¤¥ó¤ª¤è¤Ó¿Æ¥É¥á¥¤¥ó¤Î +¥Û¥¹¥È̾¤òõ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.BR gethostbyname (3) +¤ÇÍѤ¤¤é¤ì¤ë¡£ +[¥Ç¥Õ¥©¥ë¥È¤ÇÍ­¸ú] +.SH ÊÖ¤êÃÍ +.BR res_init () +´Ø¿ô¤ÏÀ®¸ù¤¹¤ì¤Ð 0 ¤ò¡¢¥¨¥é¡¼¤¬È¯À¸¤¹¤ì¤Ð \-1 ¤òÊÖ¤¹¡£ +.PP +.BR res_query (), +.BR res_search (), +.BR res_querydomain (), +.BR res_mkquery (), +.BR res_send () +´Ø¿ô¤Ï±þÅú¤ÎŤµ¤òÊÖ¤¹¡£ +¤Þ¤¿¡¢¥¨¥é¡¼¤¬È¯À¸¤¹¤ì¤Ð \-1 ¤òÊÖ¤¹¡£ +.PP +.BR dn_comp () +¤È +.BR dn_expand () +´Ø¿ô¤Ï°µ½Ì¤µ¤ì¤¿¥É¥á¥¤¥ó̾¤ÎŤµ¤òÊÖ¤¹¡£ +¤Þ¤¿¡¢¥¨¥é¡¼¤¬È¯À¸¤¹¤ì¤Ð \-1 ¤òÊÖ¤¹¡£ +.SH ¥Õ¥¡¥¤¥ë +.nf +/etc/resolv.conf ¥ì¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë +/etc/host.conf ¥ì¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë +.fi +.SH ½àµò +4.3BSD. +.SH ´ØÏ¢¹àÌÜ +.BR gethostbyname (3), +.BR resolv.conf (5), +.BR resolver (5), +.BR hostname (7), +.BR named (8) diff --git a/release/man3/rewinddir.3 b/release/man3/rewinddir.3 new file mode 100644 index 00000000..8ee4cd27 --- /dev/null +++ b/release/man3/rewinddir.3 @@ -0,0 +1,60 @@ +.\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Wed Dec 24 12:34:00 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. +.\" +.\" 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:29:11 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl) +.TH REWINDDIR 3 1995-06-11 "" "Linux Programmer's Manual" +.SH ̾Á° +rewinddir \- ¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤Î½é´ü²½ +.SH ½ñ¼° +.nf +.B #include +.sp +.B #include +.sp +.BI "void rewinddir(DIR *" dirp ); +.fi +.SH ÀâÌÀ +.BR rewinddir () +´Ø¿ô¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à \fIdirp\fP ¤Î°ÌÃÖ¤ò +¥Ç¥£¥ì¥¯¥È¥ê¤ÎÀèƬ¤Ë½é´ü²½¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR rewinddir () +´Ø¿ô¤Ï¡¢ÃͤòÊÖ¤µ¤Ê¤¤¡£ +.SH ½àµò +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) diff --git a/release/man3/rexec.3 b/release/man3/rexec.3 new file mode 100644 index 00000000..313e8464 --- /dev/null +++ b/release/man3/rexec.3 @@ -0,0 +1,119 @@ +.\" Copyright (c) 1983, 1991, 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. +.\" +.\" @(#)rexec.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libcompat/4.3/rexec.3,v 1.12 2004/07/02 23:52:14 ru Exp $ +.\" +.\" Taken from FreeBSD 5.4; not checked against Linux reality (mtk) +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-11-20, Akihiro MOTOKI +.\" +.TH REXEC 3 2007-12-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +rexec \- ¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Ø¤Î¥¹¥È¥ê¡¼¥à¤òÊÖ¤¹ +.SH ½ñ¼° +.nf +.sp +.BI "int rexec(char **" ahost ", int " inport ", char *" user ", " +.BI " char *" passwd ", char *" cmd ", int *" fd2p ); +.\" This function requires _BSD_SOURCE on Linux +.fi +.SH ÀâÌÀ +¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï +.BR rcmd (3) +¤Ë¤è¤Ã¤ÆÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ + +.BR rexec () +´Ø¿ô¤Ï +.BR gethostbyname (3) +¤ò»È¤Ã¤Æ¥Û¥¹¥È +.I *ahost +¤òõ¤¹¡£¥Û¥¹¥È¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï +.I *ahost +¤Ë¤½¤Î¥Û¥¹¥È¤Îɸ½àŪ¤Ê̾Á°¤òÀßÄꤹ¤ë¡£ +¥æ¡¼¥¶Ì¾¤È¥Ñ¥¹¥ï¡¼¥É¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢¤³¤ì¤é¤Ï +ÀܳÀè¤Î¥Û¥¹¥È¤Ø¤Îǧ¾Ú¤ËÍøÍѤµ¤ì¤ë¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +ŬÀڤʾðÊó¤òÆþ¼ê¤¹¤ë¤¿¤á¤Ë¡¢´Ä¶­ÊÑ¿ô¤È¡¢¤½¤Î¥æ¡¼¥¶¤Î +¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Î +.I .netrc +¥Õ¥¡¥¤¥ë¤¬¸¡º÷¤µ¤ì¤ë¡£¾ðÊ󤬸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿»þ¤Ë¤Ï¡¢ +¥æ¡¼¥¶¤ËÂФ·¤Æ¾ðÊó¤òÆþÎϤ¹¤ë¥×¥í¥ó¥×¥È¤¬É½¼¨¤µ¤ì¤ë¡£ +.PP +¥Ý¡¼¥È +.I inport +¤Ë¤Ï¡¢Àܳ¤Ë»ÈÍѤ¹¤ë DARPA Internet ¤Î well-known ¥Ý¡¼¥È¤ò»ØÄꤹ¤ë¡£ +.I "getservbyname(""exec"", ""tcp"")" +¤ò¸Æ¤Ó½Ð¤¹¤È¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤¬ÊÖ¤µ¤ì +.RB ( getservent (3) +»²¾È)¡¢¤³¤Î¹½Â¤ÂΤˤÏɬÍפʥݡ¼¥È¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +Àܳ¤Ë»ÈÍѤµ¤ì¤ë¥×¥í¥È¥³¥ë¤Ë¤Ä¤¤¤Æ¤Î¾ÜºÙ¤Ï +.BR rexecd (8) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë (ÌõÃí: ¸½ºß¤Î¤È¤³¤í¸ºß¤·¤Ê¤¤)¡£ +.PP +Àܳ¤ËÀ®¸ù¤¹¤ë¤È¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥É¥á¥¤¥ó¤Î +.B SOCK_STREAM +·¿¤Î¥½¥±¥Ã¥È¤¬ÊÖ¤µ¤ì¡¢¤½¤Î¥½¥±¥Ã¥È¤Ï¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Î +ɸ½àÆþÎϤª¤è¤Óɸ½à½ÐÎϤȤʤ롣 +.I fd2p +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢À©¸æ¥×¥í¥»¥¹¤Ø¤ÎÊä½õ¥Á¥ã¥ó¥Í¥ë¤¬¥»¥Ã¥È¥¢¥Ã¥×¤µ¤ì¡¢ +Êä½õ¥Á¥ã¥ó¥Í¥ë¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.I *fd2p +¤Ë½ñ¤«¤ì¤ë¡£ +À©¸æ¥×¥í¥»¥¹¤Ï¥³¥Þ¥ó¥É¤«¤é¤Î¿ÇÃÇ¥á¥Ã¥»¡¼¥¸½ÐÎÏ (¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ 2) +¤ò¤³¤Î¥Á¥ã¥ó¥Í¥ë¤ÇÊÖ¤¹¡£¤Þ¤¿¡¢¤³¤Î¥Á¥ã¥ó¥Í¥ë·Ðͳ¤Ç +Unix ¤Î¥·¥°¥Ê¥ëÈÖ¹æ¤ò¼¨¤¹¥Ð¥¤¥È¤ò¼õ¿®¤¹¤ë¡£¼õ¿®¤·¤¿¥·¥°¥Ê¥ë¤Ï +¥³¥Þ¥ó¥É¤¬Â°¤¹¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ËžÁ÷¤µ¤ì¤ë¡£ +¿ÇÃǾðÊó¤Ë¤Ï¥ê¥â¡¼¥È¤Îǧ¾Ú¼ºÇԤϴޤޤì¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢Ç§¾Ú¤Î³Îǧ¤¬¹Ô¤ï¤ì¤¿ +¸å¤ÇÊä½õ¥Á¥ã¥ó¥Í¥ë¤ÎÀܳ¤Ï¥»¥Ã¥È¥¢¥Ã¥×¤µ¤ì¤ë¤«¤é¤Ç¤¢¤ë¡£ +.I fd2p +¤¬ 0 ¤Î¾ì¹ç¡¢É¸½à¥¨¥é¡¼ (¥ê¥â¡¼¥È¥³¥Þ¥ó¥É¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ 2) ¤Ï +ɸ½à½ÐÎϤÈƱÍͤ˰·¤ï¤ì¡¢¥ê¥â¡¼¥È¥×¥í¥»¥¹¤ËǤ°Õ¤Î¥·¥°¥Ê¥ë¤òÁ÷¤ë¤¿¤á¤Î +¼êÃʤÏÄ󶡤µ¤ì¤Ê¤¤¡£Ã¢¤·¡¢¥ê¥â¡¼¥È¥×¥í¥»¥¹¤ËÂФ·¤Æ¥È¥ê¥¬¤ò¤«¤±¤ë¤¿¤á¤Ë¡¢ +ÂÓ°è³°¥Ç¡¼¥¿ (out-of-band data) ¤ò»È¤¦¤³¤È¤Ï¤Ç¤­¤ë¡£ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +BSD ·Ï¡¢Solaris ¤ä¾¤Î¿¤¯¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +.BR rexec () +´Ø¿ô¤Ï 4.2BSD ¤Ç»Ï¤á¤ÆÅо줷¤¿¡£ +.SH ¥Ð¥° +.BR rexec () +´Ø¿ô¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¤Ë°Å¹æ²½¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ñ¥¹¥ï¡¼¥É¤òÁ÷¿®¤¹¤ë¡£ +.PP +´ðÁÃŪ¤Ê¥µ¡¼¥Ó¥¹¤Ë¤ª¤¤¤Æ¤ÏÂ礭¤Ê¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤È¹Í¤¨¤é¤ì¤ë¤¿¤á¡¢ +¿¤¯¤Î¥µ¥¤¥È¤Ç̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£¾ÜºÙ¤Ï +.BR rexecd (8) +¤ò»²¾È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR rcmd (3), +.BR rexecd (8) diff --git a/release/man3/rint.3 b/release/man3/rint.3 new file mode 100644 index 00000000..2730aa2c --- /dev/null +++ b/release/man3/rint.3 @@ -0,0 +1,134 @@ +.\" Copyright 2001 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. +.\" +.\" 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 ²¾¿ô +.\" +.TH RINT 3 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +nearbyint, nearbyintf, nearbyintl, rint, rintf, rintl \- ºÇ¤â¶á¤¤À°¿ô¤Ë´Ý¤á¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double nearbyint(double " x ); +.br +.BI "float nearbyintf(float " x ); +.br +.BI "long double nearbyintl(long double " x ); +.sp +.BI "double rint(double " x ); +.br +.BI "float rintf(float " x ); +.br +.BI "long double rintl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR nearbyint (), +.BR nearbyintf (), +.BR nearbyintl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR rint (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.br +.BR rintf (), +.BR rintl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR nearbyint () +´Ø¿ô·²¤Ï¡¢¸½ºß¤Î´Ý¤áÊý¸þ +.RB ( fesetround (3) +»²¾È) ¤Ç°ú¤­¿ô¤òÉâÆ°¾®¿ôÅÀ·Á¼°¤ÎÀ°¿ô¤Ë´Ý¤á¤ë¡£ +.I inexact +Îã³°¤ò½Ð¤µ¤Ê¤¤¡£ +.LP +.BR rint () +´Ø¿ô·²¤âƱ¤¸¤è¤¦¤ÊÆ°ºî¤ò¤¹¤ë¤¬¡¢ +·ë²Ì¤¬°ú¤­¿ô¤È°Û¤Ê¤ë¾ì¹ç¤Ë +.I inexact +Îã³° +.RB ( FE_INEXACT ) +¤ò½Ð¤¹ (¤³¤ÎÎã³°¤Ï +.BR fetestexcept (3) +·Ðͳ¤Ç³Îǧ²Äǽ)¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï´Ý¤á¤¿À°¿ôÃͤòÊÖ¤¹¡£ + +\fIx\fP ¤¬À°¿ô¡¢+0¡¢\-0¡¢NaN¡¢Ìµ¸ÂÂç¤Î¤¤¤º¤ì¤«¤Î¾ì¹ç¡¢ +\fIx\fP ¤½¤Î¤â¤Î¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ç¤ÎÈÏ°Ï¥¨¥é¡¼ (range error) ¤Î +µ­ºÜ¤¬¤¢¤ë¡£¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH Ãí°Õ +SUSv2 ¤È POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ë´Ø¤¹¤ëµ­½Ò¤¬¤¢¤ê¡¢ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I errno +¤ò +.B ERANGE +¤ËÀßÄꤹ¤ë¤«¡¢ +.B FE_OVERFLOW +Îã³°¤òȯÀ¸¤¹¤ë¤³¤È¤È¤µ¤ì¤Æ¤¤¤ë¡£ +¼ÂºÝ¤Î¤È¤³¤í¡¢¤É¤Î¸½¹Ô¤Î¥Þ¥·¥ó¤Ç¤â·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤¹¤³¤È¤Ï¤Ê¤¤¤Î¤Ç¡¢ +¤³¤Î¥¨¥é¡¼½èÍý¤Ï°ÕÌ£¤¬¤Ê¤¤¡£ +(¤è¤êÀµ³Î¤Ë¸À¤¦¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ï»Ø¿ôÉô¤ÎºÇÂçÃͤ¬ +²¾¿ôÉô¤òɽ¤¹¥Ó¥Ã¥È¤Î¿ô¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ë¤·¤«µ¯¤³¤é¤Ê¤¤¡£ +IEEE-754 µ¬³Ê¤Î 32 ¥Ó¥Ã¥È¤È 64 ¥Ó¥Ã¥È¤ÎÉâÆ°¾®¿ô¤Ç¤Ï¡¢ +»Ø¿ôÉô¤ÎºÇÂçÃͤϤ½¤ì¤¾¤ì 128 ¤È 1024 ¤Ç¤¢¤ê¡¢ +²¾¿ôÉô¤Î¥Ó¥Ã¥È¿ô¤Ï¤½¤ì¤¾¤ì 24 ¤È 53 ¤Ç¤¢¤ë¡£) + +´Ý¤á¤¿ÃͤòÀ°¿ô·¿¤Ë³ÊǼ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¤ª¤½¤é¤¯¤³¤Î´Ø¿ô¤Ç¤Ï¤Ê¤¯ +.BR lrint (3) +¤ËºÜ¤Ã¤Æ¤¤¤ë´Ø¿ô¤Î¤É¤ì¤«¤ò»È¤¤¤¿¤¤¤Î¤À¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ceil (3), +.BR floor (3), +.BR lrint (3), +.BR round (3), +.BR trunc (3) diff --git a/release/man3/round.3 b/release/man3/round.3 new file mode 100644 index 00000000..c064b20f --- /dev/null +++ b/release/man3/round.3 @@ -0,0 +1,119 @@ +.\" Copyright 2001 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. +.\" +.\" 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 ²¾¿ô +.\" +.TH ROUND 3 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +round, roundf, roundl \- ºÇ¤â¶á¤¤À°¿ôÃͤ˴ݤá¤ë (2 ¤Ä¤ÎÀ°¿ô¤ÎÃæ´ÖÃͤξì¹ç¤Ï 0 ¤«¤é±ó¤¤Êý¤Ë´Ý¤á¤ë) +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double round(double " x ); +.br +.BI "float roundf(float " x ); +.br +.BI "long double roundl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR round (), +.BR roundf (), +.BR roundl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï \fIx\fP ¤òºÇ¤â¶á¤¤À°¿ôÃͤ˴ݤá¤ë¡£ +2 ¤Ä¤ÎÀ°¿ô¤ÎÃæ´ÖÃͤξì¹ç¤Ï¡¢ +.BR rint (3) +¤Î¤è¤¦¤ËºÇ¤â¶á¤¤¶ö¿ô¤Ë´Ý¤á¤¿¤ê¤»¤º¤Ë¡¢ +(¸½ºß¤Î´Ý¤áÊý¸þ¤Ë´Ø·¸¤Ê¤¯) 0 ¤«¤é±ó¤¤Êý¤Ë´Ý¤á¤ë +(´Ý¤áÊý¸þ¤Ë¤Ä¤¤¤Æ¤Ï +.BR fenv (3) +¤ò»²¾È)¡£ + +Î㤨¤Ð¡¢ +.I round(0.5) +¤Ï 1.0 ¤Ç¡¢ +.I round(\-0.5) +¤Ï \-1.0 ¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï´Ý¤á¤¿À°¿ôÃͤòÊÖ¤¹¡£ + +\fIx\fP ¤¬À°¿ô¡¢+0¡¢\-0¡¢NaN¡¢Ìµ¸Â¤Î¤¤¤º¤ì¤«¤Î¾ì¹ç¡¢ +\fIx\fP ¤½¤Î¤â¤Î¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ç¤ÎÈÏ°Ï¥¨¥é¡¼ (range error) ¤Î +µ­ºÜ¤¬¤¢¤ë¡£¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH Ãí°Õ +POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ë´Ø¤¹¤ëµ­½Ò¤¬¤¢¤ê¡¢ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I errno +¤ò +.B ERANGE +¤ËÀßÄꤹ¤ë¤«¡¢ +.B FE_OVERFLOW +Îã³°¤òȯÀ¸¤¹¤ë¤³¤È¤È¤µ¤ì¤Æ¤¤¤ë¡£ +¼ÂºÝ¤Î¤È¤³¤í¡¢¤É¤Î¸½¹Ô¤Î¥Þ¥·¥ó¤Ç¤Ï·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤¹¤³¤È¤Ï¤Ê¤¤¤Î¤Ç¡¢ +¤³¤Î¥¨¥é¡¼½èÍý¤Ï°ÕÌ£¤¬¤Ê¤¤¡£ +.\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point. +(¤è¤êÀµ³Î¤Ë¸À¤¦¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ï»Ø¿ôÉô¤ÎºÇÂçÃͤ¬ +²¾¿ôÉô¤òɽ¤¹¥Ó¥Ã¥È¤Î¿ô¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ë¤·¤«µ¯¤³¤é¤Ê¤¤¡£ +IEEE-754 µ¬³Ê¤Î 32 ¥Ó¥Ã¥È¤È 64 ¥Ó¥Ã¥È¤ÎÉâÆ°¾®¿ô¤Ç¤Ï¡¢ +»Ø¿ôÉô¤ÎºÇÂçÃͤϤ½¤ì¤¾¤ì 128 ¤È 1024 ¤Ç¤¢¤ê¡¢ +²¾¿ôÉô¤Î¥Ó¥Ã¥È¿ô¤Ï¤½¤ì¤¾¤ì 24 ¤È 53 ¤Ç¤¢¤ë¡£) + +´Ý¤á¤¿ÃͤòÀ°¿ô·¿¤Ë³ÊǼ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¤ª¤½¤é¤¯¤³¤Î´Ø¿ô¤Ç¤Ï¤Ê¤¯ +.BR lround (3) +¤ËºÜ¤Ã¤Æ¤¤¤ë´Ø¿ô¤Î¤É¤ì¤«¤ò»È¤¤¤¿¤¤¤Î¤À¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ceil (3), +.BR floor (3), +.BR lround (3), +.BR nearbyint (3), +.BR rint (3), +.BR trunc (3) diff --git a/release/man3/rpc.3 b/release/man3/rpc.3 new file mode 100644 index 00000000..35e672dd --- /dev/null +++ b/release/man3/rpc.3 @@ -0,0 +1,1104 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)rpc.3n 2.4 88/08/08 4.0 RPCSRC; from 1.19 88/06/24 SMI +.\" +.\" 2007-12-30, mtk, Convert function prototypes to modern C syntax +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Tue Jan 4 20:48:23 JST 2000 +.\" by HANATAKA Shinya +.\" Updated & Modified Sun Oct 21 01:07:09 JST 2001 +.\" by Yuichi SATO +.\" +.TH RPC 3 2008-07-17 "" "Linux Programmer's Manual" +.SH ̾Á° +rpc \- ±ó³Ö¼ê³¤­¸Æ¤Ó½Ð¤·(RPC)¤Î¤¿¤á¤Î¥é¥¤¥Ö¥é¥ê¡¦¥ë¡¼¥Æ¥£¥ó +.SH ½ñ¼°¤ÈÀâÌÀ +¤³¤ì¤é¤Î¥ë¡¼¥Æ¥£¥ó¤Ï C ¥×¥í¥°¥é¥à¤Ç¥Í¥Ã¥È¥ï¡¼¥¯¤òÄ̤·¤Æ +¾¤Î¥Þ¥·¥ó¤Ë¥¢¥¯¥»¥¹¤¹¤ë¥×¥í¥·¥¸¥ã¤òºîÀ®¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£ +ºÇ½é¤Ë¥¯¥é¥¤¥¢¥ó¥È¤Ï¥Ç¡¼¥¿¥Ñ¥±¥Ã¥È¤ò¥µ¡¼¥Ð¤ËÁ÷¤ë¤¿¤á¤Ë +¥×¥í¥·¥¸¥ã¤ò¸Æ¤Ó½Ð¤¹¡£ +¥µ¡¼¥Ð¤Ï¥Ñ¥±¥Ã¥È¤ò¼õ¤±¼è¤ë¤È¡¢ÇÛʬ¥ë¡¼¥Á¥ó¤ò¸Æ¤Ó½Ð¤·¤Æ +Í׵ᤵ¤ì¤¿¥µ¡¼¥Ó¥¹¤Ë¼Â¹Ô¤·¡¢ÊÖÅú¤òÁ÷¤êÊÖ¤¹¡£ +ºÇ¸å¤Ë¥×¥í¥·¥¸¥ã¡¦¥³¡¼¥ë¤Ï¥¯¥é¥¤¥¢¥ó¥È¤Ø¤ÈÌá¤ë¡£ +.\" .LP +.\" º£¸½ºß¤Ï rpc_secure.3 ¤ÏÆþ¤Ã¤Æ¤¤¤Ê¤¤ -- MTK, 19 Sep 05 +.\" (DES ǧ¾Ú¤Ë¤è¤ë) Secure RPC ¤Ç»ÈÍѤµ¤ì¤ë¥ë¡¼¥Æ¥£¥ó¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀ¤Ï +.\" .BR rpc_secure (3) +.\" ¤Ë¸ºß¤¹¤ë¡£ Secure RPC ¤Ï DES ǧ¾Ú¤¬ÍøÍѲÄǽ¤Ê¾ì¹ç¤Ë¤Î¤ß»ÈÍѤǤ­¤ë¡£ +.LP +¤³¤ì¤é¤Î¥ë¡¼¥Æ¥£¥ó¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.I "" +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤³¤È¡£ + +²¼µ­¤Î¥×¥í¥È¥¿¥¤¥×¤Ç¤Ï¼¡¤Î·¿¤ò»ÈÍѤ·¤Æ¤¤¤ë¡£ +.in +4n +.nf + +typedef int \fIbool_t\fP; + +typedef bool_t (*\fIxdrproc_t\fP) (XDR *, void *,...); + +typedef bool_t (*\fIresultproc_t\fP) (caddr_t resp, + struct sockaddr_in *raddr); +.fi +.in +.LP +·¿ +.IR AUTH , +.IR CLIENT , +.IR SVCXPRT , +.IR XDR +¤ÎÀë¸À¤Ë¤Ä¤¤¤Æ¤Ï¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ò»²¾È¡£ +.LP +.nf +.BI "void auth_destroy(AUTH *" auth ); +.fi +.IP +¤³¤Î¥Þ¥¯¥í¤Ï +.I auth +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ç§¾Ú¾ðÊó¤òÇ˲õ¤¹¤ë¡£Ç˲õ¤ÏÄ̾ï¤Ï»äŪ¤Ê¥Ç¡¼¥¿¹½Â¤¤Î +ÇË´þ¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +.BR auth_destroy () +¤ò¸Æ¤Ó½Ð¤·¤¿¸å¤Ë +.I auth +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "AUTH *authnone_create(void);" +.fi +.IP +³Æ¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¡¦¥³¡¼¥ë¤Ç»ÈÍѤǤ­¤Ê¤¤²¾¤Îǧ¾Ú¾ðÊó¤È¤·¤ÆÅϤµ¤ì¤ë +RPC ǧ¾Ú¥Ï¥ó¥É¥ë¤òºîÀ®¤·¤ÆÊÖ¤¹¡£ +¤³¤ì¤Ï RPC ¤Ç»ÈÍѤµ¤ì¤ë¥Ç¥Õ¥©¥ë¥È¤Îǧ¾Ú¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "AUTH *authunix_create(char *" host ", int " uid ", int " gid , +.BI " int " len ", int *" aup_gids ); +.fi +.IP +ǧ¾Ú¾ðÊó¤ò´Þ¤ó¤À RPC ǧ¾Ú¥Ï¥ó¥É¥ë¤òºîÀ®¤·¤ÆÊÖ¤¹¡£ +.I host +¥Ñ¥é¥á¡¼¥¿¡¼¤Ï¾ðÊ󤬺îÀ®¤µ¤ì¤¿¥Þ¥·¥ó¤Î̾Á°¤Ç¤¢¤ë¡£ +.I uid +¤Ï¤½¤Î¥æ¡¼¥¶¤Î¥æ¡¼¥¶ +.SM ID +¡¢ +.I gid +¤Ï¤½¤Î¥æ¡¼¥¶¤Î¸½ºß¤Î¥°¥ë¡¼¥× +.SM ID +¤Ç¤¢¤ë¡£ +.I len +¤È +.I aup_gids +¤Ï¤½¤Î¥æ¡¼¥¶¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤ÎÇÛÎó¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +¾¤Î¥æ¡¼¥¶¤Ë¤Ê¤ê¤¹¤Þ¤¹¤³¤È¤Ï´Êñ¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "AUTH *authunix_create_default(void);" +.fi +.IP +ŬÀڤʥѥé¥á¡¼¥¿¡¼¤Ç +.BR authunix_create () +¤ò¸Æ¤Ó½Ð¤¹¡£ +.LP +.nf +.BI "int callrpc(char *" host ", unsigned long " prognum , +.BI " unsigned long " versnum ", unsigned long " procnum , +.BI " xdrproc_t " inproc ", char *" in , +.BI " xdrproc_t " outproc ", char *" out ); +.fi +.IP +¥Þ¥·¥ó +.I host +¾å¤Ç +.IR prognum , +.IR versnum , +.I procnum +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¤ò¸Æ¤Ó½Ð¤¹¡£ +¥Ñ¥é¥á¡¼¥¿¡¼ +.I in +¤Ï¥×¥í¥·¥¸¥ã¤Î°ú¤­¿ô¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ê +.I out +¤Ï·ë²Ì¤ò³ÊǼ¤¹¤ë¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I inproc +¤Ï¥×¥í¥·¥¸¥ã¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¡¢ +.I outproc +¤Ï·ë²Ì¤ò¥Ç¥³¡¼¥É¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï +.B "enum clnt_stat" +¤òÀ°¿ô¤Ë¥­¥ã¥¹¥È¤·¤¿ÃͤòÊÖ¤¹¡£ +.BR clnt_perrno () +¥ë¡¼¥Æ¥£¥ó¤¬¼ºÇԤξõÂÖ¤ò¥á¥Ã¥»¡¼¥¸¤ËÊÑ´¹¤¹¤ë¤Î¤Ë»ÈÍѤǤ­¤ë¡£ +.IP +·Ù¹ð: ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ç¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¤ò¸Æ¤Ó½Ð¤¹¤ÈÄÌ¿®¤Ë¤Ï +UDP/IP ¤¬»ÈÍѤµ¤ì¤ë¡£¤³¤ÎºÝ¤ÎÀ©¸Â¤Ë¤Ä¤¤¤Æ¤Ï +.BR clntudp_create () +¤ò»²¾È¤¹¤ë¤³¤È¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ò»ÈÍѤ·¤Æǧ¾Ú¤ä»þ´ÖÀÚ¤ì¤ÎÀ©¸æ¤ò +¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.LP +.nf +.BI "enum clnt_stat clnt_broadcast(unsigned long " prognum , +.BI " unsigned long " versnum ", unsigned long " procnum , +.BI " xdrproc_t " inproc ", char *" in , +.BI " xdrproc_t " outproc ", char *" out , +.BI " resultproc_t " eachresult ); +.fi +.IP +.BR callrpc () +¤ÈƱÍͤǤ¢¤ë¤¬¡¢¥á¥Ã¥»¡¼¥¸¤¬¥í¡¼¥«¥ë¤Î¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¡¦¥Í¥Ã¥È¥ï¡¼¥¯ +Á´ÂÎ¤Ø¤È¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤µ¤ì¤ëÅÀ¤¬°Û¤Ã¤Æ¤¤¤ë¡£²óÅú¤ò¼õ¤±¼è¤ëÅÙ¤Ë +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï°Ê²¼¤Î·Á¼°¤Î +.BR eachresult () +¤ò¸Æ¤Ó½Ð¤¹¡£ +.IP +.in +4n +.nf +.BI "eachresult(char *" out ", struct sockaddr_in *" addr ); +.fi +.in +.IP +¤³¤³¤Ç +.I out +¤Ï +.BR clnt_broadcast () +¤ËÅϤµ¤ì¤ë +.I out +¤ÈƱ¤¸¤Ç¤¢¤ë¤¬¡¢¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¤«¤é¤Î½ÐÎϤ¬¥Ç¥³¡¼¥É¤µ¤ì¤Æ¤¤¤ë +ÅÀ¤Î¤ß¤¬°Û¤Ã¤Æ¤¤¤ë¡£ +.I addr +¤Ï·ë²Ì¤òÁ÷¤Ã¤ÆÍ褿¥Þ¥·¥ó¤Î¥¢¥É¥ì¥¹¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.BR eachresult () +¤¬¥¼¥í¤òÊÖ¤·¤¿¾ì¹ç¡¢ +.BR clnt_broadcast () +¤Ï¤µ¤é¤Ê¤ë²óÅú¤òÂԤġ£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐŬÀڤʾõÂ֤ǽªÎ»¤¹¤ë¡£ +.IP +·Ù¹ð: ¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¡¦¥½¥±¥Ã¥È¤Ï¥Ç¡¼¥¿¥ê¥ó¥¯ÁؤκÇÂçžÁ÷ñ°Ì¤Ë +À©¸Â¤µ¤ì¤Æ¤¤¤ë¡£¥¤¡¼¥µ¥Í¥Ã¥È¤Î¾ì¹ç¡¢ºÇÂçÃÍ¤Ï 1500 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "enum clnt_stat clnt_call(CLIENT *" clnt ", unsigned long " procnum , +.BI " xdrproc_t " inproc ", char *" in , +.BI " xdrproc_t " outproc ", char *" out , +.BI " struct timeval " tout ); +.fi +.IP +¤³¤Î¥Þ¥¯¥í¤Ï¥¯¥é¥¤¥¢¥ó¥È¡¦¥Ï¥ó¥É¥ë +.I clnt +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +.I procnum +¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¤ò¸Æ¤Ó½Ð¤¹¡£ +¥¯¥é¥¤¥¢¥ó¥È¡¦¥Ï¥ó¥É¥ë¤Ï +.BR clnt_create () +¤Î¤è¤¦¤Ê +.SM RPC +¥¯¥é¥¤¥¢¥ó¥ÈºîÀ®¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤ë¡£ +¥Ñ¥¿¥á¡¼¥¿ +.I in +¤Ï¥×¥í¥·¥¸¥ã¤Î°ú¤­¿ô¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I out +¤Ï¥×¥í¥·¥¸¥ã¤ÎÊÖ¤êÃͤò³ÊǼ¤¹¤ë¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I inproc +¤Ï¥×¥í¥·¥¸¥ã¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +.I outproc +¤Ï¥×¥í¥·¥¸¥ã¤ÎÊÖ¤êÃͤò¥Ç¥³¡¼¥É¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +.I tout +¤Ï·ë²Ì¤¬ÊÖ¤µ¤ì¤ë¤Î¤òÂԤĻþ´Ö¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "clnt_destroy(CLIENT *" clnt ); +.fi +.IP +¤³¤Î¥Þ¥¯¥í¤Ï¥¯¥é¥¤¥¢¥ó¥È¤Î RPC ¥Ï¥ó¥É¥ë¤òÇ˲õ¤¹¤ë¡£Ç˲õ¤Ë¤ÏÄ̾ï¤Ï +.I clnt +¼«¿È¤â´Þ¤á¤Æ»äŪ¤Ê¥Ç¡¼¥¿¹½Â¤ÂΤÎÇË´þ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.BR clnt_destroy () +¤Î¸Æ¤Ó½Ð¤·¤Î¸å¤Ë +.I clnt +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +RPC ¥é¥¤¥Ö¥é¥ê¤¬´ØÏ¢¤¹¤ë¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +¤½¤ì¤âÊĤ¸¤é¤ì¤ë¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¥½¥±¥Ã¥È¤Ï¥ª¡¼¥×¥ó¤µ¤ì¤¿¤Þ¤Þ¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "CLIENT *clnt_create(char *" host ", unsigned long " prog , +.BI " unsigned long " vers ", char *" proto ); +.fi +.IP +°ìÈÌŪ¤Ê¥¯¥é¥¤¥¢¥ó¥È¤ÎºîÀ®¥ë¡¼¥Æ¥£¥ó¤Ç¤¢¤ë¡£ +.I host +¤Ï¥µ¡¼¥Ð¤Î¤¢¤ë¥ê¥â¡¼¥È¥Û¥¹¥È¤Î̾Á°¤ò»ØÄꤹ¤ë¡£ +.I proto +¤É¤Î¤è¤¦¤ÊÄÌ¿®¥×¥í¥È¥³¥ë¤ò»ÈÍѤ¹¤ë¤«¤ò»ØÄꤹ¤ë¡£¸½ºß¤³¤³¤Ë +»ÈÍѤǤ­¤ëÃÍ¤Ï \(lqudp\(rq ¤È \(lqtcp\(rq ¤Ç¤¢¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î»þ´ÖÀڤ줬ÀßÄꤵ¤ì¤ë¤¬¡¢ +.BR clnt_control () +¤ò»ÈÍѤ·¤ÆÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +.IP +·Ù¹ð: +UDP ¤ò»ÈÍѤ·¤¿¾ì¹ç¤Ë¤Ï·çÅÀ¤¬¤¢¤ë¡£ +UDP ¤Ë´ð¤Å¤¤¤¿ RPC ¥á¥Ã¥»¡¼¥¸¤Ï +ºÇÂç¤Ç¤â 8 KByte ¤Î¥¨¥ó¥³¡¼¥É¥Ç¡¼¥¿¤·¤«ÊÝ»ý¤¹¤ë +¤³¤È¤¬¤Ç¤­¤Ê¤¤¤¿¤á¡¢Â礭¤Ê°ú¤­¿ô¤äµðÂç¤Ê·ë²Ì¤ò¼è¤ë¥×¥í¥·¥¸¥ã¤Ë +¤Ï»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.LP +.nf +.BI "bool_t clnt_control(CLIENT *" cl ", int " req ", char *" info ); +.fi +.IP +¤³¤Î¥Þ¥¯¥í¤Ï³Æ¼ï¥¯¥é¥¤¥¢¥ó¥È¤Ë¤Ä¤¤¤Æ¾ðÊó¤òÊѹ¹¤·¤¿¤ê¡¢¼èÆÀ¤·¤¿¤ê +¤¹¤ë¤Î¤Ë»ÈÍѤ¹¤ë¡£ +.I req +¤ÏÁàºî¤Î¼ïÎà¤ò»ØÄꤹ¤ë¡£ +.I info +¤Ï¾ðÊó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +UDP ¤È TCP ¤É¤Á¤é¤Î¾ì¹ç¤â»ÈÍѲÄǽ¤Ê +.I req +¤ÎÃͤȡ¢¤½¤Î°ú¤­¿ô¤Î·¿¡¢¤ª¤è¤Ó¤½¤ÎÆâÍƤϰʲ¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.IP +.in +4n +.nf +.ta +2.0i +2.0i +2.0i +\fBCLSET_TIMEOUT\fP \fIstruct timeval\fP // »þ´ÖÀÚ¤ì¤òÀßÄꤹ¤ë +\fBCLGET_TIMEOUT\fP \fIstruct timeval\fP // »þ´ÖÀÚ¤ì¤ò¼èÆÀ¤¹¤ë +.fi +.in +.IP +Ãí°Õ: +.BR clnt_control () +¤ò»ÈÍѤ·¤Æ»þ´ÖÀÚ¤ì¤òÀßÄꤷ¤¿¾ì¹ç¤Ë¤Ï¤½¤ì°Ê¸å¤Ï +.BR clnt_call () +¤ËÅϤµ¤ì¤ë»þ´ÖÀÚ¤ì¥Ñ¥é¥á¡¼¥¿¡¼¤ÏÁ´¤Æ̵»ë¤µ¤ì¤ë¡£ +.IP +.in +4n +.nf +\fBCLGET_SERVER_ADDR\fP \fIstruct sockaddr_in \fP // ¥µ¡¼¥Ð¥¢¥É¥ì¥¹¤ò¼èÆÀ¤¹¤ë +.fi +.in +.IP +°Ê²¼¤ÎÁàºî¤Ï UDP ¤Î¾ì¹ç¤Ë¤Î¤ßÍ­¸ú¤Ç¤¢¤ë: +.IP +.in +4n +.nf +\fBCLSET_RETRY_TIMEOUT\fP \fIstruct timeval\fP // ºÆÁ÷´Ö³Ö¤òÀßÄꤹ¤ë +\fBCLGET_RETRY_TIMEOUT\fP \fIstruct timeval\fP // ºÆÁ÷´Ö³Ö¤ò¼èÆÀ¤¹¤ë +.fi +.in +.IP +ºÆÁ÷´Ö³Ö¤Ï¼¡¤ËÍ×µá¤òºÆÁ÷¤¹¤ëÁ°¤Ë +"UDP RPC" ¤¬¥µ¡¼¥Ð¤Î²óÅú¤òÂԤĻþ´Ö¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "clnt_freeres(CLIENT * " clnt ", xdrproc_t " outproc ", char *" out ); +.fi +.IP +¤³¤Î¥Þ¥¯¥í¤Ï RPC ¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤Î¥Ç¥³¡¼¥É¤ÎºÝ¤Ë +RPC/XDR ¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ³äÅö¤Æ¤é¤ì¤¿¥Ç¡¼¥¿¤ò²òÊü¤¹¤ë¡£ +¥Ñ¥é¥á¡¼¥¿¡¼ +.I out +¤Ï·ë²Ì¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I outproc +¤Ï·ë²Ì¤òµ­½Ò¤·¤Æ¤¤¤ë XDR ¥ë¡¼¥Æ¥£¥ó¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï·ë²Ì¤Î²òÊü¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "void clnt_geterr(CLIENT *" clnt ", struct rpc_err *" errp ); +.fi +.IP +¤³¤Î¥Þ¥¯¥í¤Ï¥¯¥é¥¤¥¢¥ó¥È¡¦¥Ï¥ó¥É¥ë¤Î¥¨¥é¡¼¹½Â¤ÂΤò +.I errp +¥¢¥É¥ì¥¹¤Ç»ØÄꤵ¤ì¤¿¹½Â¤ÂΤإ³¥Ô¡¼¤¹¤ë¡£ +.LP +.nf +.BI "void clnt_pcreateerror(char *" s ); +.fi +.IP +ɸ½à¥¨¥é¡¼½ÐÎϤˡ¢¤Ê¤¼¥¯¥é¥¤¥¢¥ó¥È RPC ¥Ï¥ó¥É¥ë¤ÎºîÀ®¤¬ +¤Ç¤­¤Ê¤«¤Ã¤¿¤«¤Ë¤Ä¤¤¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤ÎÁ°¤Ëʸ»úÎó +.I s +¤È¥³¥í¥ó(:)¤¬É½¼¨¤µ¤ì¤ë¡£ +.BR clnt_create (), +.BR clntraw_create (), +.BR clnttcp_create (), +.BR clntudp_create () +¤Î¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤·¤¿»þ¤Ë»ÈÍѤ¹¤ë¤³¤È¡£ +.LP +.nf +.BI "void clnt_perrno(enum clnt_stat " stat ); +.fi +.IP +ɸ½à¥¨¥é¡¼½ÐÎÏ¤Ë +.I stat +¤Ë¤è¤Ã¤Æ»Ø¼¨¤µ¤ì¤ë¥¨¥é¡¼¾õÂÖ¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£ +.BR callrpc () +¤Î¸å¤Ë»ÈÍѤ¹¤ë¤³¤È¡£ +.LP +.nf +.BI "clnt_perror(CLIENT *" clnt ", char *" s ); +.fi +.IP +ɸ½à¥¨¥é¡¼½ÐÎϤˡ¢¤Ê¤¼ RPC ¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤·¤¿¤«¤Ë¤Ä¤¤¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£ +.I clnt +¤Ï¥³¡¼¥ë¤Ë»ÈÍѤ·¤¿¥Ï¥ó¥É¥ë¤Ç¤¢¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤ÎÁ°¤Ëʸ»úÎó +.I s +¤È¥³¥í¥ó(:)¤¬É½¼¨¤µ¤ì¤ë¡£ +.BR clnt_call () +¤¬¼ºÇÔ¤·¤¿¸å¤Ë»ÈÍѤ¹¤ë¤³¤È¡£ +.LP +.nf +.BI "char *clnt_spcreateerror(char *" s ); +.fi +.IP +.BR clnt_pcreateerror () +¤ÈƱÍͤǤ¢¤ë¤¬¡¢É¸½à¥¨¥é¡¼½ÐÎϤØɽ¼¨¤¹¤ë¤«¤ï¤ê¤Ëʸ»úÎó¤òÊÖ¤¹ÅÀ¤¬°Û¤Ã¤Æ¤¤¤ë¡£ +.IP +¥Ð¥°: ÀÅŪ¤ÊÎΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¤¿¤á¡¢¸Æ¤Ó½Ð¤·¤´¤È¤Ë¾å½ñ¤­¤µ¤ì¤ë¡£ +.LP +.nf +.BI "char *clnt_sperrno(enum clnt_stat " stat ); +.fi +.IP +.BR clnt_perrno () +¤ÈƱ¤¸°ú¤­¿ô¤ò¼è¤ë¤¬¡¢¤Ê¤¼ +RPC ¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤·¤¿¤«¤Ë¤Ä¤¤¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤òɸ½à¥¨¥é¡¼½ÐÎϤËɽ¼¨¤¹¤ë +¤«¤ï¤ê¤Ë¡¢¥á¥Ã¥»¡¼¥¸¤ò³ÊǼ¤·¤Æ¤¤¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +ʸ»úÎó¤Ï NEWLINE(²þ¹Ô) ¤Ç½ª¤Ã¤Æ¤¤¤ë¡£ +.IP +.BR clnt_sperrno () +¤Ï¥×¥í¥°¥é¥à¤¬É¸½à¥¨¥é¡¼½ÐÎϤò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç(¥×¥í¥°¥é¥à¤¬¥µ¡¼¥Ð¤È¤· +¤ÆÁö¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¤è¤¯¤¢¤ê¤¨¤ë)¤ä¡¢¥×¥í¥°¥é¥Þ¡¼¤¬¥á¥Ã¥»¡¼¥¸¤ò +.BR printf (3) +¤Ç½ÐÎϤ¹¤ë¤³¤È¤ò˾¤Þ¤Ê¤¤¾ì¹ç¤ä¡¢¥á¥Ã¥»¡¼¥¸¤Î·Á¼°¤¬ +.BR clnt_perrno () +¤¬¥µ¥Ý¡¼¥È¤¹¤ë¤â¤Î¤È¤Ï°Û¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ê¤É¤Ë +.BR clnt_perrno () +¤Î¤«¤ï¤ê¤Ë»ÈÍѤµ¤ì¤ë¡£ +Ãí°Õ: +.BR clnt_sperror () +¤ä +.BR clnt_spcreaterror () +¤È¤Ï°ã¤Ã¤Æ +.BR clnt_sperrno () +¤ÏÀÅŪ¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£¤·¤«¤·¸Æ¤Ó½Ð¤·¤´¤È¤Ë¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.LP +.nf +.BI "char *clnt_sperror(CLIENT *" rpch ", char *" s ); +.fi +.IP +.BR clnt_perror () +¤ÈƱÍͤǤ¢¤ë¤¬¡¢É¸½à¥¨¥é¡¼½ÐÎϤËɽ¼¨¤¹¤ëÂå¤ê¤Ë +.RB ( clnt_sperrno () +¤Î¤è¤¦¤Ë) ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹ÅÀ¤¬°Û¤Ã¤Æ¤¤¤ë¡£ +.IP +¥Ð¥°: ¸Æ¤Ó½Ð¤·¤´¤È¤Ë¾å½ñ¤­¤µ¤ì¤ëÀÅŪ¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +.LP +.nf +.BI "CLIENT *clntraw_create(unsigned long " prognum \ +", unsigned long " versnum ); +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à +.IR prognum ¡¢ +¥Ð¡¼¥¸¥ç¥ó +.I versnum +¤Î¤¿¤á¤Îµ¼»÷ RPC ¥¯¥é¥¤¥¢¥ó¥È¤òºîÀ®¤¹¤ë¡£¥á¥Ã¥»¡¼¥¸¤ò¥µ¡¼¥Ó¥¹¤ËÅϤ¹¤¿¤á¤Ë»ÈÍѤ¹¤ë +ÄÌ¿®¤Ï¼ÂºÝ¤Ë¤Ï¤½¤Î¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤¢¤ë¥Ð¥Ã¥Õ¥¡¡¼¤Ç¤¢¤ë¡£ +¤½¤ì¤Ç¡¢Âбþ¤¹¤ë RPC ¥µ¡¼¥Ð¤¬Æ±¤¸¥¢¥É¥ì¥¹¶õ´Ö¤ÎÃæ¤Ë¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BR svcraw_create () +¤ò»²¾È¤¹¤ë¤³¤È¡£ +¤³¤ì¤Ë¤è¤ê RPC ¤Î¥·¥ß¥å¥ì¡¼¥·¥ç¥ó¤ä¡¢¥«¡¼¥Í¥ë¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë±Æ¶Á¤µ¤ì¤º¤Ë +±þÅú»þ´Ö¤Ê¤É¤Î RPC ¥ª¡¼¥Ð¥Ø¥Ã¥É¤Î³ÍÆÀ¤¬¤Ç¤­¤ë¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï NULL ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "CLIENT *clnttcp_create(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " int *" sockp ", unsigned int " sendsz \ +", unsigned int " recvsz ); +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à +.IR prognum ¡¢ +¥Ð¡¼¥¸¥ç¥ó +.I versnum +¤Î¤¿¤á¤Î RPC ¥¯¥é¥¤¥¢¥ó¥È¤òºîÀ®¤¹¤ë¡£¥¯¥é¥¤¥¢¥ó¥È¤ÏÄÌ¿®¤Ë +TCP/IP ¤ò»ÈÍѤ¹¤ë¡£¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à¤Ï¥¤¥ó¥¿¡¼¥Í¥Ã¥È¡¦¥¢¥É¥ì¥¹¤Î +.I *addr +¤Ë¤¢¤ë¡£ +.\"The following inline font conversion is necessary for the hyphen indicator +\fIaddr\->sin_port\fR ¤¬¥¼¥í¤Ê¤é¤Ð¡¢¼ÂºÝ¤Ë¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à¤¬ +listen ¤·¤Æ¤¤¤ë¥Ý¡¼¥È¤¬ÀßÄꤵ¤ì¤ë¡£(¤³¤Î¾ðÊó¤Î¤¿¤á¤Ë¥ê¥â¡¼¥È¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤¬ÍøÍѤµ¤ì¤ë¡£) ¥Ñ¥é¥á¡¼¥¿¡¼ +.I sockp +¤Ï¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£¤â¤·¤³¤ì¤¬ +.B RPC_ANYSOCK +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤³¤Î¥ë¡¼¥Æ¥£¥ó¤¬¿·¤·¤¤¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤·¤Æ +.I sockp +¤ËÀßÄꤹ¤ë¡£ +TCP ¤Ë´ð¤Å¤¤¤¿ RPC ¤Ï¥Ð¥Ã¥Õ¥¡¤µ¤ì¤¿ I/O +¤ò»ÈÍѤ¹¤ë¤¿¤á¡¢¥æ¡¼¥¶¤Ï¥Ñ¥é¥á¡¼¥¿¡¼ +.I sendsz +¤È +.I recvsz +¤ò»ÈÍѤ·¤ÆÁ÷¿®¥Ð¥Ã¥Õ¥¡¤È¼õ¿®¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥¼¥í¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤ÏŬÀڤʥǥե©¥ë¥È¤¬ÁªÂò¤µ¤ì¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¼ºÇÔ¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "CLIENT *clntudp_create(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " struct timeval " wait ", int *" sockp ); +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à +.IR prognum ¡¢ +¥Ð¡¼¥¸¥ç¥ó +.I versnum +¤Î¤¿¤á¤Î RPC ¥¯¥é¥¤¥¢¥ó¥È¤òºîÀ®¤¹¤ë¡£¥¯¥é¥¤¥¢¥ó¥È¤ÏÄÌ¿®¤Ë +UDP/IP ¤ò»ÈÍѤ¹¤ë¡£¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à¤Ï¥¤¥ó¥¿¡¼¥Í¥Ã¥È¡¦¥¢¥É¥ì¥¹¤Î +.I *addr +¤Ë¤¢¤ë¡£ +\fIaddr\->sin_port\fR ¤¬¥¼¥í¤Ê¤é¤Ð¡¢¼ÂºÝ¤Ë¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à¤¬ +listen ¤·¤Æ¤¤¤ë¥Ý¡¼¥È¤¬ÀßÄꤵ¤ì¤ë¡£(¤³¤Î¾ðÊó¤Î¤¿¤á¤Ë¥ê¥â¡¼¥È¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤¬ÍøÍѤµ¤ì¤ë¡£) ¥Ñ¥é¥á¡¼¥¿¡¼ +.I sockp +¤Ï¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£¤â¤·¤³¤ì¤¬ +.B RPC_ANYSOCK +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤³¤Î¥ë¡¼¥Æ¥£¥ó¤¬¿·¤·¤¤¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤·¤Æ +.I sockp +¤ËÀßÄꤹ¤ë¡£ +UDP ÄÌ¿®¤Ï²óÅú¤¬¤¢¤ë¤«¡¢»þ´ÖÀڤ줬µ¯¤³¤ë¤Þ¤Ç +.B wait +´Ö³Ö¤Ç¸Æ¤Ó½Ð¤·¥á¥Ã¥»¡¼¥¸¤òºÆÁ÷¤¹¤ë¡£»þ´ÖÀڤ줬µ¯¤³¤ë¤Þ¤Ç¤Î¹ç·×»þ´Ö¤Ï +.BR clnt_call () +¤Ç»ØÄꤹ¤ë¡£ +.IP +·Ù¹ð: UDP ¤Ë´ð¤Å¤¤¤¿ +RPC ¥á¥Ã¥»¡¼¥¸¤ÏºÇÂç¤Ç¤â 8 Kbyte ¤Þ¤Ç¤Î¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿¥Ç¡¼¥¿¤·¤« +ÊÝ»ý¤Ç¤­¤Ê¤¤¤¿¤á¡¢¤³¤ÎÄÌ¿®¤ÏÂ礭¤Ê°ú¤­¿ô¤äµðÂç¤Ê·ë²Ì¤ò¼è¤ë +¥×¥í¥·¥¸¥ã¤Ë¤Ï»ÈÍѤǤ­¤Ê¤¤¡£ +.LP +.nf +.BI "CLIENT *clntudp_bufcreate(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " struct timeval " wait ", int *" sockp , +.BI " unsigned int " sendsize ", unsigned int "recosize ); +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à +.IR prognum ¡¢ +¥Ð¡¼¥¸¥ç¥ó +.I versnum +¤Î¤¿¤á¤Î RPC ¥¯¥é¥¤¥¢¥ó¥È¤òºîÀ®¤¹¤ë¡£¥¯¥é¥¤¥¢¥ó¥È¤ÏÄÌ¿®¤Ë +UDP/IP ¤ò»ÈÍѤ¹¤ë¡£¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à¤Ï¥¤¥ó¥¿¡¼¥Í¥Ã¥È¡¦¥¢¥É¥ì¥¹¤Î +.I *addr +¤Ë¤¢¤ë¡£ +\fIaddr\->sin_port\fR ¤¬¥¼¥í¤Ê¤é¤Ð¡¢¼ÂºÝ¤Ë¥ê¥â¡¼¥È¡¦¥×¥í¥°¥é¥à¤¬ +listen ¤·¤Æ¤¤¤ë¥Ý¡¼¥È¤¬ÀßÄꤵ¤ì¤ë¡£(¤³¤Î¾ðÊó¤Î¤¿¤á¤Ë¥ê¥â¡¼¥È¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤¬ÍøÍѤµ¤ì¤ë¡£) ¥Ñ¥é¥á¡¼¥¿¡¼ +.I sockp +¤Ï¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£¤â¤·¤³¤ì¤¬ +.B RPC_ANYSOCK +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤³¤Î¥ë¡¼¥Æ¥£¥ó¤¬¿·¤·¤¤¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤·¤Æ +.I sockp +¤ËÀßÄꤹ¤ë¡£ +UDP ÄÌ¿®¤Ï²óÅú¤¬¤¢¤ë¤«¡¢»þ´ÖÀڤ줬µ¯¤³¤ë¤Þ¤Ç +.B wait +´Ö³Ö¤Ç¸Æ¤Ó½Ð¤·¥á¥Ã¥»¡¼¥¸¤òºÆÁ÷¤¹¤ë¡£»þ´ÖÀڤ줬µ¯¤³¤ë¤Þ¤Ç¤Î¹ç·×»þ´Ö¤Ï +.BR clnt_call () +¤Ç»ØÄꤹ¤ë¡£ +.IP +¤³¤ì¤ò»ÈÍѤ¹¤ë¤È UDP ¤Ë´ð¤Å¤¤¤¿ RPC ¥á¥Ã¥»¡¼¥¸¤Ë¤ª¤¤¤ÆÁ÷¿®¥Ñ¥±¥Ã¥È¤ä +¼õ¿®¥Ñ¥±¥Ã¥È¤ÎºÇÂ祵¥¤¥º¤ò»ØÄꤹ¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤ë¡£ +.LP +.nf +.BI "void get_myaddress(struct sockaddr_in *" addr ); +.fi +.IP +¤³¤Î¥Þ¥·¥ó¤Î IP ¥¢¥É¥ì¥¹¤ò +.I *addr +¤Ë³ÊǼ¤¹¤ë¡£ +.I /etc/hosts +¤ò°·¤¦¥é¥¤¥Ö¥é¥ê¡¦¥ë¡¼¥Æ¥£¥ó¤Ï»ÈÍѤ·¤Ê¤¤¡£¥Ý¡¼¥ÈÈÖ¹æ¤Ï¾ï¤Ë +.B htons(PMAPPORT) +¤ËÀßÄꤵ¤ì¤ë¡£ +.LP +.nf +.BI "struct pmaplist *pmap_getmaps(struct sockaddr_in *" addr ); +.fi +.IP +.B portmap +¥µ¡¼¥Ó¥¹¤Î¤¿¤á¤Î¥æ¡¼¥¶¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ê¡¢ +IP ¥¢¥É¥ì¥¹ +.I *addr +¤Ë¤¢¤ë¥Û¥¹¥È¤Î¸½ºß¤Î RPC ¥×¥í¥°¥é¥à¤«¤é¥Ý¡¼¥ÈÈÖ¹æ¤Ø¤Î¥Þ¥Ã¥Ô¥ó¥°¤Î°ìÍ÷¤òÊÖ¤¹¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤¬ NULL ¤òÊÖ¤¹¾ì¹ç¤â¤¢¤ë¡£ +.RB ` "rpcinfo \-p" ' +¥³¥Þ¥ó¥É¤Ï¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ò»ÈÍѤ·¤Æ¤¤¤ë¡£ +.LP +.nf +.BI "unsigned short pmap_getport(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " unsigned int " protocol ); +.fi +.IP +.B portmap +¥µ¡¼¥Ó¥¹¤Î¤¿¤á¤Î¥æ¡¼¥¶¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¡¢ +¥×¥í¥°¥é¥àÈÖ¹æ +.IR prognum ¡¢ +¥Ð¡¼¥¸¥ç¥ó +.IR versnum ¡¢ +´ØÏ¢ÉÕ¤±¤é¤ì¤¿ÄÌ¿®¥×¥í¥È¥³¥ë +.I protocol +¤ò¥µ¥Ý¡¼¥È¤¹¤ë¥µ¡¼¥Ó¥¹¤¬ÂԤäƤ¤¤ë¥Ý¡¼¥ÈÈÖ¹æ¤òÊÖ¤¹¡£ +.I protocol +¤ÎÃͤϤۤȤó¤É¤Î¾ì¹ç IPPROTO_UDP ¤« IPPROTO_TCP ¤Ç¤¢¤ë¡£ +ÊÖ¤êÃÍ¥¼¥í¤Ï¥Þ¥Ã¥Ô¥ó¥°¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢ +RPC ¥·¥¹¥Æ¥à¤¬¥ê¥â¡¼¥È¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤Î»²¾È¤Ë¼ºÇÔ¤·¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë¡£¸å¼Ô¤Î¾ì¹ç¤ÏÂç°èÊÑ¿ô +.I rpc_createerr +¤¬ RPC ¾õÂÖ¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£ +.LP +.nf +.BI "enum clnt_stat pmap_rmtcall(struct sockaddr_in *" addr , +.BI " unsigned long " prognum ", unsigned long " versnum , +.BI " unsigned long " procnum , +.BI " xdrproc_t " inproc ", char *" in , +.BI " xdrproc_t " outproc ", char *" out , +.BI " struct timeval " tout ", unsigned long *" portp ); +.fi +.IP +.B portmap +¥µ¡¼¥Ó¥¹¤Î¤¿¤á¤Î¥æ¡¼¥¶¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¡¢ +IP ¥¢¥É¥ì¥¹ +.I *addr +¤Î¥Û¥¹¥È¤Î +.B portmap +¤ò»²¾È¤·¤Æ¡¢ +RPC ¸Æ¤Ó½Ð¤·¤òÀ¸À®¤·¡¢¤½¤Î¥Û¥¹¥È¾å¤Î¥×¥í¥·¥¸¥ã¤ò¸Æ¤Ó½Ð¤¹¡£ +¥Ñ¥é¥á¡¼¥¿¡¼ +.I *portp +¤Ï¥×¥í¥·¥¸¥ã¤¬À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¥×¥í¥°¥é¥à¤Î¥Ý¡¼¥ÈÈÖ¹æ¤Ë½¤Àµ¤µ¤ì¤ë¡£ +¾¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ÎÄêµÁ¤Ë¤Ä¤¤¤Æ¤Ï +.BR callrpc () +¤ä +.BR clnt_call () +¤ÇÀâÌÀ¤·¤Æ¤¢¤ë¡£ +¤³¤Î¥×¥í¥·¥¸¥ã¤Ï \(lqping\(rq ¤Î¤ß¤Ë»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.BR clnt_broadcast () +¤â»²¾È¤¹¤ë¤³¤È¡£ +.LP +.nf +.BI "bool_t pmap_set(unsigned long " prognum ", unsigned long " versnum , +.BI " unsigned int " protocol ", unsigned short " port ); +.fi +.IP +.B portmap +¥µ¡¼¥Ó¥¹¤Î¤¿¤á¤Î¥æ¡¼¥¶¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¡¢ +.RI [ prognum , versnum , protocol\fR] +¤ÎÁȤ߹ç¤ï¤»¤È +.I port +¤È¤Î´Ö¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¡¢¤½¤Î¥Þ¥·¥ó¾å¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤ËÅÐÏ¿¤¹¤ë¡£ +.I protocol +¤Ï¤Û¤È¤ó¤É¤Î¾ì¹ç +.B IPPROTO_UDP +¤« +.B IPPROTO_TCP +¤Î¤É¤Á¤é¤«¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.BR svc_register () +¤Ë¤è¤Ã¤Æ¼«Æ°Åª¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ +.LP +.nf +.BI "bool_t pmap_unset(unsigned long " prognum ", unsigned long " versnum ); +.fi +.IP +.B portmap +¥µ¡¼¥Ó¥¹¤Î¤¿¤á¤Î¥æ¡¼¥¶¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¡¢ +.RI [ prognum , versnum , *\fR] +¤ÎÁȤ߹ç¤ï¤»¤È +.B ports +¤Î´Ö¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¤½¤Î¥Þ¥·¥ó¾å¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤«¤éºï½ü¤¹¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "int registerrpc(unsigned long " prognum ", unsigned long " versnum , +.BI " unsigned long " procnum ", char *(*" procname ")(char *)," +.BI " xdrproc_t " inproc ", xdrproc_t " outproc ); +.fi +.IP +RPC ¥µ¡¼¥Ó¥¹¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ·¤Æ +.I procname +¥×¥í¥·¥¸¥ã¤òÅÐÏ¿¤¹¤ë¡£¥×¥í¥°¥é¥à +.IR prognum ¡¢ +¥Ð¡¼¥¸¥ç¥ó +.IR versnum ¡¢ +¥×¥í¥·¥¸¥ã +.I procnum +¤Ø¤ÎÍ׵᤬ÆϤ¤¤¿¾ì¹ç¡¢ +.I procname +¤¬¥Ñ¥é¥á¡¼¥¿¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤ò»ý¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.I progname +¤ÏÀÅŪ¤Ê·ë²Ì¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹É¬Íפ¬¤¢¤ë¡£ +.I inproc +¤Ï¥Ñ¥é¥á¡¼¥¿¡¼¤ò¥Ç¥³¡¼¥É¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +.I outproc +¤Ï·ë²Ì¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÅÐÏ¿¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤¹¡£ +.IP +·Ù¹ð: ¤³¤Î·Á¼°¤ÇÅÐÏ¿¤µ¤ì¤¿¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¤Ï +UDP/IP ÄÌ¿®¤ò»ÈÍѤ¹¤ë¡£À©¸Â¤Ë´Ø¤·¤Æ¤Ï +.BR svcudp_create () +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.LP +.nf +.BI "struct rpc_createerr " rpc_createerr ; +.fi +.IP +À®¸ù¤·¤Ê¤«¤Ã¤¿ RPC ¥¯¥é¥¤¥¢¥ó¥ÈÀ¸À®¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ëÂç°èÊÑ¿ô¡£ +.BR clnt_pcreateerror () +¥ë¡¼¥Æ¥£¥ó¤¬Íýͳ¤òɽ¼¨¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ +.LP +.nf +.BI "void svc_destroy(SVCXPRT *" xprt ); +.fi +.IP +¤³¤Î¥Þ¥¯¥í¤ÏÄÌ¿®¥Ï¥ó¥É¥ë +.I xprt +¤Î RPC ¥µ¡¼¥Ó¥¹¤òÇ˲õ¤¹¤ë¡£Ç˲õ¤Ë¤ÏÄ̾ +.I xprt +¤ò´Þ¤á¤Æ¡¢»äŪ¤Ê¥Ç¡¼¥¿¹½Â¤ÂΤÎÇË´þ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤·¤¿¸å¤Ë +.I xprt +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "fd_set " svc_fdset ; +.fi +.IP +RPC ¥µ¡¼¥Ó¥¹Â¦¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤òÈ¿±Ç¤·¤¿Âç°èÊÑ¿ô¡£ +.BR select (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤Î¤¿¤á¤ËÍøÍѤǤ­¤ë¡£¤³¤ì¤Ï +¥µ¡¼¥Ó¥¹¤Î¼ÂÁõ¼Ô¤¬ +.BR svc_run () +¤ò¸Æ¤Ó½Ð¤µ¤Ê¤º¤Ë¡¢Æȼ«¤ÎÈóƱ´ü¥¤¥Ù¥ó¥È½èÍý¤òÍѤ¤¤ë¾ì¹ç¤Ë¤Î¤ß°ÕÌ£¤¬¤¢¤ë¡£ +¤³¤ÎÊÑ¿ô¤ÏÆɤ߹þ¤ßÀìÍÑ¤Ç (¤½¤Î¤Þ¤Þ +.BR select (2) +¤ØÅϤ·¤Æ¤Ï¤Ê¤é¤Ê¤¤!)¡¢ +.BR svc_getreqset () +¸Æ¤Ó½Ð¤·¤äÀ¸À®¥ë¡¼¥Æ¥£¥ó¤Î¸å¤ËÊѹ¹¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +.nf +.BI "int " svc_fds ; +.fi +.IP +.B svc_fdset +¤Ë»÷¤Æ¤¤¤ë¤¬¡¢32 ¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï +.B svc_fdset +¤Ë¤è¤Ã¤ÆÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +.LP +.nf +.BI "svc_freeargs(SVCXPRT *" xprt ", xdrproc_t " inproc ", char *" in ); +.fi +.IP +¤³¤Î¥Þ¥¯¥í¤Ï¥µ¡¼¥Ó¥¹¡¦¥×¥í¥·¥¸¥ã¤¬ +.BR svc_getargs () +¤ò»ÈÍѤ·¤Æ°ú¤­¿ô¤ò¥Ç¥³¡¼¥É¤·¤¿»þ¤Ë +RPC/XDR ¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ³ä¤êÅö¤Æ¤é¤ì¤¿¥Ç¡¼¥¿¤ò²òÊü¤¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï²òÊü¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "svc_getargs(SVCXPRT *" xprt ", xdrproc_t " inproc ", char *" in ); +.fi +.IP +¤³¤Î¥Þ¥¯¥í¤Ï RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¥Ï¥ó¥É¥ë +.I xprt +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿ RPC Í×µá¤Î°ú¤­¿ô¤ò¥Ç¥³¡¼¥É¤¹¤ë¡£¥Ñ¥é¥á¡¼¥¿¡¼ +.I in +¤Ï°ú¤­¿ô¤Î³ÊǼ¤µ¤ì¤¿¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I inproc +¤Ï°ú¤­¿ô¤ò¥Ç¥³¡¼¥É¤¹¤ë¤¿¤á¤Î XDR ¥ë¡¼¥Æ¥£¥ó¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥Ç¥³¡¼¥É¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "struct sockaddr_in *svc_getcaller(SVCXPRT *" xprt ); +.fi +.IP +RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¥Ï¥ó¥É¥ë +.I xprt +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥×¥í¥·¥¸¥ã¤Î¸Æ¤Ó½Ð¤·¸µ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥¢¥É¥ì¥¹¤ò +¼èÆÀ¤¹¤ë¤¿¤á¤Îɸ½àŪ¤Ê¼êÃÊ¡£ +.LP +.nf +.BI "void svc_getreqset(fd_set *" rdfds ); +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥µ¡¼¥Ó¥¹¤Î¼ÂÁõ¼Ô¤¬ +.BR svc_run () +¤ò¸Æ¤Ó½Ð¤µ¤º¡¢Æȼ«¤ÎÈóƱ´ü¥¤¥Ù¥ó¥È½èÍý¤ò¼ÂÁõ¤¹¤ë¾ì¹ç¤Ë¤Î¤ß°ÕÌ£¤¬¤¢¤ë¡£ +¤³¤ì¤Ï +.BR select (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ RPC ¥½¥±¥Ã¥È¤Ë +RPC Í׵᤬ÅþÃ夷¤¿¤ÈÊÖ¤·¤¿¾ì¹ç¤Ë¤Î¤ß¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.I rdfds +¤Ï·ë²Ì¤ÎÆɤ߹þ¤ß¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.I rdfds +¤ÎÃͤ˴ØÏ¢ÉÕ¤±¤é¤ì¤¿Á´¤Æ¤Î¥½¥±¥Ã¥È¤Î¥µ¡¼¥Ó¥¹¤¬¹Ô¤Ê¤ï¤ì¤¿»þ¤Ë +Ê֤äƤ¯¤ë¡£ +.LP +.nf +.BI "void svc_getreq(int " rdfds ); +.fi +.IP +.BR svc_getreqset () +¤Ë»÷¤Æ¤¤¤ë¤¬¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Î¿ô¤¬ 32 ¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï +.BR svc_getreqset () +¤Ë¤è¤Ã¤ÆÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +.LP +.nf +.BI "bool_t svc_register(SVCXPRT *" xprt ", unsigned long " prognum , +.BI " unsigned long " versnum , +.BI " void (*" dispatch ")(svc_req *, SVCXPRT *)," +.BI " unsigned long " protocol ); +.fi +.IP +.I prognum +¤È +.I versnum +¤ò¥µ¡¼¥Ó¥¹ÇÛʬ¥×¥í¥·¥¸¥ã +.I dispatch +¤Ç´ØÏ¢ÉÕ¤±¤ë¡£ +.I protocol +¤¬¥¼¥í¤Î¾ì¹ç¡¢¥µ¡¼¥Ó¥¹¤Ï +.B portmap +¥µ¡¼¥Ó¥¹¤Ë¤ÏÅÐÏ¿¤µ¤ì¤Ê¤¤¡£ +.I protocol +¤¬¥¼¥í°Ê³°¤Î¾ì¹ç¡¢ +.RI [ prognum , versnum , protocol\fR] +¤ÎÁȤ߹ç¤ï¤»¤È \fIxprt\->xp_port\fR ¤È¤Î¥Þ¥Ã¥Ô¥ó¥°¤¬¥í¡¼¥«¥ë¤Î +.B portmap +¥µ¡¼¥Ó¥¹¤ËÅÐÏ¿¤µ¤ì¤ë¡£(°ìÈÌŪ¤Ë +.I protocol +¤Ï¥¼¥í¡¢ +.BR IPPROTO_UDP ¡¢ +.B IPPROTO_TCP +¤Î¤É¤ì¤«¤Ç¤¢¤ë¡£) +¥×¥í¥·¥¸¥ã +.I dispatch +¤Ï°Ê²¼¤Î·Á¼°¤Ç¤¢¤ë: +.in +4n +.nf + +dispatch(struct svc_req *request, SVCXPRT *xprt); +.fi +.in +.IP +.BR svc_register () +¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.B "void svc_run(void);" +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÌá¤Ã¤Æ¤³¤Ê¤¤¡£¤³¤ì¤Ï +.SM RPC +Í×µá¤ÎÅþÃå¤òÂÔ¤Á¡¢¤É¤ì¤«¤¬ÆϤ¤¤¿¾ì¹ç¤Ë +.BR svc_getreq () +¤ò»ÈÍѤ·¤ÆŬÀڤʥµ¡¼¥Ó¥¹¡¦¥×¥í¥·¥¸¥ã¤ò¸Æ¤Ó½Ð¤¹¡£ +¤³¤Î¥×¥í¥·¥¸¥ã¤ÏÄ̾ï¤Ï +.BR select (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤«¤éÊÖ¤ë¤Î¤òÂԤäƤ¤¤ë¡£ +.LP +.nf +.BI "bool_t svc_sendreply(SVCXPRT *" xprt ", xdrproc_t " outproc \ +", char *" out ); +.fi +.IP +RPC ¥µ¡¼¥Ó¥¹ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤Æ¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¡¦¥³¡¼¥ë¤Î·ë²Ì¤ò +ÊÖ¤¹¤¿¤á¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +¥Ñ¥é¥á¡¼¥¿¡¼ +.I xprt +¤Ï¤½¤ÎÍ×µá¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿ÄÌ¿®¥Ï¥ó¥É¥ë¤Ç¤¢¤ë¡£ +.I outproc +¤Ï·ë²Ì¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë XDR ¥ë¡¼¥Æ¥£¥ó¤Ç¤¢¤ë¡£ +.I out +¤Ï·ë²Ì¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "void svc_unregister(unsigned long " prognum ", unsigned long " versnum ); +.fi +.IP +ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤«¤é +.RI [ prognum , versnum ] +¤ª¤è¤Ó +.RI [ prognum , versnum , *\fR] +¤ÎÁȤ߹ç¤ï¤»¤«¤é¥Ý¡¼¥ÈÈÖ¹æ¤Ø¤Î¥Þ¥Ã¥Ô¥ó¥°¤òÁ´¤Æºï½ü¤¹¤ë¡£ +.LP +.nf +.BI "void svcerr_auth(SVCXPRT *" xprt ", enum auth_stat " why ); +.fi +.IP +ǧ¾Ú¥¨¥é¡¼¤Ë¤è¤ê¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¡¦¥³¡¼¥ë¤Î¼Â¹Ô¤òµñÈݤµ¤ì¤¿ +¾ì¹ç¤Ë¥µ¡¼¥Ó¥¹ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.LP +.nf +.BI "void svcerr_decode(SVCXPRT *" xprt ); +.fi +.IP +¥Ñ¥é¥á¡¼¥¿¤Î¥Ç¥³¡¼¥É¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë +¥µ¡¼¥Ó¥¹ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.BR svc_getargs () +¤â»²¾È¤¹¤ë¤³¤È¡£ +.LP +.nf +.BI "void svcerr_noproc(SVCXPRT *" xprt ); +.fi +.IP +Í×µá¤Î¤¢¤Ã¤¿¥×¥í¥·¥¸¥ãÈֹ椬¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë +¥µ¡¼¥Ó¥¹ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤è¤ê¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.LP +.nf +.BI "void svcerr_noprog(SVCXPRT *" xprt ); +.fi +.IP +RPC ¥Ñ¥Ã¥±¡¼¥¸¤ËÍ׵ᤵ¤ì¤¿¥×¥í¥°¥é¥à¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +¥µ¡¼¥Ó¥¹¤Î¼ÂÁõ¤Ë¤ÏÄ̾¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏɬÍפʤ¤¡£ +.LP +.nf +.BI "void svcerr_progvers(SVCXPRT *" xprt ); +.fi +.IP +RPC ¥Ñ¥Ã¥±¡¼¥¸¤ËÍ׵ᤵ¤ì¤¿¥Ð¡¼¥¸¥ç¥ó¤Î¥×¥í¥°¥é¥à¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë +¸Æ¤Ó½Ð¤µ¤ì¤ë¡£¥µ¡¼¥Ó¥¹¤Î¼ÂÁõ¤Ë¤ÏÄ̾¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏɬÍפʤ¤¡£ +.LP +.nf +.BI "void svcerr_systemerr(SVCXPRT *" xprt ); +.fi +.IP +ÆÃÄê¤Î¥×¥í¥È¥³¥ë¤Ë¤è¤Ã¤Æ¥«¥Ð¡¼¤µ¤ì¤Æ¤¤¤Ê¥·¥¹¥Æ¥à¡¦¥¨¥é¡¼¤¬ +¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ë¥µ¡¼¥Ó¥¹ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +Î㤨¤Ð¡¢¥µ¡¼¥Ó¥¹¤¬¤½¤ì°Ê¾å¡¢µ­²±ÁõÃÖ¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¾ì¹ç¤Ë¤Ï +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +.nf +.BI "void svcerr_weakauth(SVCXPRT *" xprt ); +.fi +.IP +ǧ¾Ú¥Ñ¥é¥á¡¼¥¿¤¬Â­¤ê¤Ê¤¤¤¿¤á¤Ë¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¡¦¥³¡¼¥ë¤Î¼Â¹Ô¤ò +µñÈݤµ¤ì¤¿¾ì¹ç¤Ë¥µ¡¼¥Ó¥¹ÇÛʬ¥ë¡¼¥Æ¥£¥ó¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.B "svcerr_auth(xprt, AUTH_TOOWEAK)" +¤ò¸Æ¤Ó½Ð¤¹¡£ +.LP +.nf +.BI "SVCXPRT *svcfd_create(int " fd ", unsigned int " sendsize , +.BI " unsigned int " recvsize ); +.fi +.IP +Ǥ°Õ¤Î¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¾å¤Ë¥µ¡¼¥Ó¥¹¤òºîÀ®¤¹¤ë¡£ +ŵ·¿Åª¤Ë¡¢¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ï +TCP ¤Î¤è¤¦¤Ê¥¹¥È¥ê¡¼¥à¡¦¥×¥í¥È¥³¥ë¤ÇÀܳ¤µ¤ì¤¿¥½¥±¥Ã¥È¤Ç¤¢¤ë¡£ +.I sendsize +¤È +.I recvsize +¤Ë¤ÏÁ÷¿®¥Ð¥Ã¥Õ¥¡¤È¼õ¿®¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤ò»ØÄꤹ¤ë¡£¤â¤·¥¼¥í¤¬»ØÄꤵ¤ì¤¿ +¾ì¹ç¤ÏŬÀڤʥǥե©¥ë¥È¤¬ÁªÂò¤µ¤ì¤ë¡£ +.LP +.nf +.BI "SVCXPRT *svcraw_create(void);" +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ïµ¼»÷ RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¤òÀ¸À®¤·¤Æ¡¢¤½¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +ÄÌ¿®¤Ï¼ÂºÝ¤Ë¤Ï¤½¤Î¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤¢¤ë¥Ð¥Ã¥Õ¥¡¤Ê¤Î¤Ç +Âбþ¤¹¤ë RPC ¥¯¥é¥¤¥¢¥ó¥È¤ÏƱ¤¸¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤¤¤ëɬÍפ¬¤¢¤ë¡£ +.BR clntraw_create () +¤ò»²¾È¤¹¤ë¤³¤È¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ç +RPC ¤Î¥·¥ß¥å¥ì¡¼¥·¥ç¥ó¤ä¡¢¥«¡¼¥Í¥ë¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë±Æ¶Á¤µ¤ì¤º¤Ë±þÅú»þ´Ö¤Ê¤É¤Î +RPC ¥ª¡¼¥Ð¥Ø¥Ã¥É¤ò¼èÆÀ¤¬¤Ç¤­¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¼ºÇÔ¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "SVCXPRT *svctcp_create(int " sock ", unsigned int " send_buf_size , +.BI " unsigned int " recv_buf_size ); +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï TCP/IP ¤Ë´ð¤Å¤¯ +RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¤òºîÀ®¤·¡¢¤½¤ì¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +ÄÌ¿®¤Ï¥½¥±¥Ã¥È +.I sock +¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤ë¡£ +.I sock +¤Ï +.B RPC_ANYSOCK +¤Ç¤âÎɤ¤¡£¤³¤Î¾ì¹ç¤Ï¿·¤·¤¤¥½¥±¥Ã¥È¤¬ºîÀ®¤µ¤ì¤ë¡£ +¤â¤·¥½¥±¥Ã¥È¤¬¥í¡¼¥«¥ë¤Ê TCP ¥Ý¡¼¥È¤Ë bind ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤¬Å¬Åö¤Ê¥Ý¡¼¥È¤Ë bind ¤¹¤ë¡£ +Êä´°¤µ¤ì¤¿¾ì¹ç¡¢\fIxprt\->xp_sock\fR ¤Ë¤ÏÄÌ¿®¤Î¥½¥±¥Ã¥È¡¦ +¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤¬¡¢\fIxprt\->xp_port\fR ¤Ë¤ÏÄÌ¿®¤Î¥Ý¡¼¥ÈÈֹ椬 +ÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¼ºÇÔ¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +TCP ¤Ë´ð¤Å¤¤¤¿ RPC ¤Ï¥Ð¥Ã¥Õ¥¡¤µ¤ì¤¿ I/O ¤ò»ÈÍѤ¹¤ë¤¿¤á¡¢ +¥æ¡¼¥¶¤Ï¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤ò»ØÄê¤Ç¤­¤ë¡£ +¥¼¥í¤ò»ØÄꤷ¤¿¾ì¹ç¤ÏŬÀڤʥǥե©¥ë¥È¤¬ÁªÂò¤µ¤ì¤ë¡£ +.LP +.nf +.BI "SVCXPRT *svcudp_bufcreate(int " sock ", unsigned int " sendsize , +.BI " unsigned int " recosize ); +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï UDP/IP ¤Ë´ð¤Å¤¤¤¿ RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¤òºîÀ®¤·¡¢ +¤½¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ÄÌ¿®¤Ï¥½¥±¥Ã¥È +.I sock +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤ë¡£ +.I sock +¤Ï +.B RPC_ANYSOCK +¤Ç¤âÎɤ¤¡£¤³¤Î¾ì¹ç¤Ï¿·¤·¤¤¥½¥±¥Ã¥È¤¬ºîÀ®¤µ¤ì¤ë¡£ +¥½¥±¥Ã¥È¤¬¥í¡¼¥«¥ë¤Î UDP ¥Ý¡¼¥È¤Ë bind ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏŬÅö¤Ê¥Ý¡¼¥È¤Ë bind ¤¹¤ë¡£ +Êä´°¤µ¤ì¤¿¾ì¹ç¡¢\fIxprt\->xp_sock\fR ¤ËÄÌ¿®¤Î¥½¥±¥Ã¥È¤Î +¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤¬¡¢\fIxprt\->xp_port\fR ¤ËÄÌ¿®¤Î¥Ý¡¼¥ÈÈֹ椬 +ÀßÄꤵ¤ì¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï NULL ¤òÊÖ¤¹¡£ +.IP +¤³¤ì¤Ë¤è¤ê¥æ¡¼¥¶¤Ï UDP ¤Ë´ð¤Å¤¤¤¿ RPC ¥á¥Ã¥»¡¼¥¸¤Ç +»ÈÍѤǤ­¤ëÁ÷¿®¥Ñ¥±¥Ã¥È¤ª¤è¤Ó¼õ¿®¥Ñ¥±¥Ã¥È¤ÎºÇÂ祵¥¤¥º¤ò»ØÄê¤Ç¤­¤ë¡£ +.LP +.nf +.BI "SVCXPRT *svcudp_create(int " sock ); +.fi +.IP +Á÷¿®¥Ñ¥±¥Ã¥È¤È¼õ¿®¥Ñ¥±¥Ã¥È¤Î¥µ¥¤¥º¤òƱ¤¸¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ \fISZ\fP ¤Ë»ØÄꤷ¤¿ +\fIsvcudp_bufcreate(sock,SZ,SZ)\fP ¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_accepted_reply(XDR *" xdrs ", struct accepted_reply *" ar ); +.fi +.IP +RPC ±þÅú¥á¥Ã¥»¡¼¥¸¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë¤Î¤Ë»ÈÍѤ¹¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +RPC ¥Ñ¥Ã¥±¡¼¥¸¤òÍѤ¤¤º¤Ë +RPC-·Á¼°¤Î¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_authunix_parms(XDR *" xdrs ", struct authunix_parms *" aupp ); +.fi +.IP +Unix ·Á¼°¤Î¾ÚÌÀ½ñ¤òµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +RPC ǧ¾Ú¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ»¤º¤Ë¤³¤ì¤é¤Î¾ÚÌÀ½ñ¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "void xdr_callhdr(XDR *" xdrs ", struct rpc_msg *" chdr ); +.fi +.IP +RPC ¸Æ¤Ó½Ð¤·¤Î¥Ø¥Ã¥À¡¼¡¦¥á¥Ã¥»¡¼¥¸¤òµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï RPC ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ»¤º¤Ë +RPC-·Á¼°¤Î¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_callmsg(XDR *" xdrs ", struct rpc_msg *" cmsg ); +.fi +.IP +RPC ¸Æ¤Ó½Ð¤·¥á¥Ã¥»¡¼¥¸¤òµ­½Ò¤¹¤ë¤Î¤Ë»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï RPC ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ»¤º¤Ë +RPC-·Á¼°¤Î¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_opaque_auth(XDR *" xdrs ", struct opaque_auth *" ap ); +.fi +.IP +PRC ǧ¾Ú¾ðÊó¥á¥Ã¥»¡¼¥¸¤òµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï RPC ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ»¤º¤Ë +RPC-·Á¼°¤Î¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_pmap(XDR *" xdrs ", struct pmap *" regs ); +.fi +.IP +³Æ¼ï¤Î +.B portmap +¥×¥í¥·¥¸¥ã¤Ø¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ò³°ÉôŪ¤Ëµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.B pmap +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»ÈÍѤ»¤º¤Ë¡¢¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ò +ºîÀ®¤·¤¿¤¤¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_pmaplist(XDR *" xdrs ", struct pmaplist **" rp ); +.fi +.IP +¥Ý¡¼¥È¤Î¥Þ¥Ã¥Ô¥ó¥°¤Î¥ê¥¹¥È¤ò³°ÉôŪ¤Ëµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.B pmap +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»ÈÍѤ»¤º¤Ë¡¢¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ò +ºîÀ®¤·¤¿¤¤¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_rejected_reply(XDR *" xdrs ", struct rejected_reply *" rr ); +.fi +.IP +RPC ±þÅú¥á¥Ã¥»¡¼¥¸¤òµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +RPC ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ»¤º¤Ë¡¢ +RPC-·Á¼°¤Î¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤·¤¿¤¤¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_replymsg(XDR *" xdrs ", struct rpc_msg *" rmsg ); +.fi +.IP +RPC ±þÅú¥á¥Ã¥»¡¼¥¸¤òµ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï RPC ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ»¤º¤Ë¡¢ +RPC ·Á¼°¤Î¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤·¤¿¤¤¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "void xprt_register(SVCXPRT *" xprt ); +.fi +.IP +RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¥Ï¥ó¥É¥ë¤òÀ¸À®¤·¤¿¸å¤Ë¡¢¤½¤ì¤é¼«¿È¤ò +RPC ¥µ¡¼¥Ó¥¹¡¦¥Ñ¥Ã¥±¡¼¥¸¤ËÅÐÏ¿¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÂç°èÊÑ¿ô +.I svc_fds +¤ò½¤Àµ¤¹¤ë¡£¥µ¡¼¥Ó¥¹¤Î¼ÂÁõ¼Ô¤ÏÄ̾¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏɬÍפʤ¤¡£ +.LP +.nf +.BI "void xprt_unregister(SVCXPRT *" xprt ); +.fi +.IP +RPC ¥µ¡¼¥Ó¥¹ÄÌ¿®¥Ï¥ó¥É¥ë¤òÇ˲õ¤¹¤ëÁ°¤Ë¡¢¤½¤ì¤ò +RPC ÄÌ¿®¥Ñ¥Ã¥±¡¼¥¸¤«¤éÅÐÏ¿²ò½ü¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÂç°èÊÑ¿ô +.I svc_fds +¤ò½¤Àµ¤¹¤ë¡£¥µ¡¼¥Ó¥¹¤Î¼ÂÁõ¼Ô¤ÏÄ̾¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏɬÍפʤ¤¡£ +.SH ´ØÏ¢¹àÌÜ +.\" º£¸½ºß¤Ï¡¢¤³¤ÎÇÛÉÛʪ (LDP_man-pages) ¤Ë¤Ï rpc_secure.3 ¤ÏÆþ¤Ã¤Æ¤¤¤Ê¤¤ +.\" -- MTK, 19 Sep 05 +.\" .BR rpc_secure (3), +.BR xdr (3) +.br +°Ê²¼¤Î¥Þ¥Ë¥å¥¢¥ë: +.RS +Remote Procedure Calls: Protocol Specification +.br +Remote Procedure Call Programming Guide +.br +rpcgen Programming Guide +.br +.RE +.IR "RPC: Remote Procedure Call Protocol Specification" , +RFC\ 1050, Sun Microsystems, Inc., +USC-ISI. diff --git a/release/man3/rpmatch.3 b/release/man3/rpmatch.3 new file mode 100644 index 00000000..b3ee516b --- /dev/null +++ b/release/man3/rpmatch.3 @@ -0,0 +1,145 @@ +.\" Copyright (C) 2006 Justin Pryzby +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be +.\" included in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" References: +.\" glibc manual and source +.\" +.\" 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" +.SH ̾Á° +rpmatch \- ¼ÁÌä¤Ø¤Î±þÅú¤¬¹ÎÄ꤫ÈÝÄ꤫¤òȽÄꤹ¤ë +.SH ½ñ¼° +.nf +.B #include + +.BI "int rpmatch(const char *" response ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR rpmatch (): +_SVID_SOURCE +.SH ÀâÌÀ +.BR rpmatch () +¤Ï yes/no ¤Î¼ÁÌä¤ËÂФ¹¤ë¥æ¡¼¥¶¤«¤é¤Î±þÅú¤ò½èÍý¤¹¤ë¡£ +¹ñºÝ²½ (I18N) ¤ËÂбþ¤·¤Æ¤¤¤ë¡£ + +.I response +¤Ë¤Ï¥æ¡¼¥¶¤«¤é¤Î±þÅú¤ò³ÊǼ¤·¤¿ NULL ½ªÃ¼Ê¸»úÎó¤¬Æþ¤Ã¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +¤¿¤¤¤Æ¤¤¤Ï¡¢ +.BR fgets (3) +¤ä +.BR getline (3) +¤Ç¼è¤ê¹þ¤ó¤À¤â¤Î¤Ç¤¢¤í¤¦¡£ + +¥×¥í¥°¥é¥à¤¬ +.BR setlocale (3) +¤ò¸Æ¤Ó½Ð¤·¤Æ´Ä¶­ÊÑ¿ô¤ÎÊѹ¹¤òÍ­¸ú¤Ë¤·¤¿¾ì¹ç¡¢ +´Ä¶­ÊÑ¿ô \fBLANG\fP, \fBLC_MESSAGES\fP, \fBLC_ALL\fP ¤¬ +¥æ¡¼¥¶¤Î¸À¸ìÀßÄê¤È¤·¤Æ¹Í褵¤ì¤ë¡£ + +¥í¥±¡¼¥ë¤Ë´Ø¤ï¤é¤º¡¢\fB^[Yy]\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë±þÅú¤Ï¾ï¤Ë¹ÎÄê¤À¤È²ò¼á¤µ¤ì¡¢ +\fB^[Nn]\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë±þÅú¤Ï¾ï¤ËÈÝÄê¤À¤È²ò¼á¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.I response +¤ò¸¡ºº¤·¤¿¸å¡¢ +.BR rpmatch () +¤ÏÈÝÄêŪ¤Ê±þÅú ("no") ¤Èǧ¼±¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤·¡¢ +¹ÎÄêŪ¤Ê±þÅú ("yes") ¤Èǧ¼±¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +.I response +¤ÎÃͤò²ò¼á¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +ÊÖ¤êÃÍ \-1 ¤¬Ê֤俾ì¹ç¡¢ÆþÎϤ¬ÉÔÀµ¤Ç¤¢¤Ã¤¿¤«¡¢Â¾¤Î²¿¤é¤«¤Î¥¨¥é¡¼¤¬ +¤¢¤Ã¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ÊÖ¤êÃͤ¬ 0 °Ê³°¤«¤É¤¦¤«¤ò³Îǧ¤¹¤ë¤À¤±¤Ç¤Ï +½½Ê¬¤Ç¤Ï¤Ê¤¤¡£ + +.BR rpmatch () +¤Ï¡¢ +.BR regcomp (3) +¤ä +.BR regexec (3) +¤¬¼ºÇÔ¤¹¤ëÍýͳ¤Î¤É¤ì¤«¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +¥¨¥é¡¼¤Î¸¶°ø¤ò +.I errno +¤ä¾¤Î²¿¤«¤ÇÃΤ뤳¤È¤Ï¤Ç¤­¤Ê¤¤¤¬¡¢ +.I errno +¤ÏÀµµ¬É½¸½¥¨¥ó¥¸¥ó¤Î¼ºÇԤθ¶°ø¤ò¼¨¤·¤Æ¤¤¤ë +(⤷¡¢¤³¤Î¥±¡¼¥¹¤È +.I response +¤ÎÃͤòǧ¼±¤Ç¤­¤º¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤ò¶èÊ̤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤)¡£ +.SH ½àµò +.BR rpmatch () +¤Ï¤É¤Îɸ½à¤Ç¤âɬ¿Ü¤È¤Ê¤Ã¤Æ¤¤¤Ê¤¤¤¬¡¢ +Linux °Ê³°¤Ë¤âÍøÍѤǤ­¤ë¥·¥¹¥Æ¥à¤â¤¤¤¯¤Ä¤«¤Ï¸ºß¤¹¤ë¡£ +.\" ¾¯¤Ê¤¯¤È¤â AIX 5.1 ¤È FreeBSD 6.0 ¤Ç¤ÏÍøÍѤǤ­¤ë¡£ +.SH ¥Ð¥° +.BR rpmatch () +¤Î¼ÂÁõ¤Ï +.I response +¤ÎºÇ½é¤Î 1 ʸ»ú¤À¤±¤ò¸«¤Æ¤¤¤ë¤è¤¦¤Ç¤¢¤ë¡£¤½¤Î·ë²Ì¡¢ +"nyes" ¤Ï 0 ¤òÊÖ¤·¡¢ +"ynever; not in a million years" ¤Ï 1 ¤òÊÖ¤¹¤³¤È¤Ë¤Ê¤ë¡£ +ÆþÎÏʸ»úÎó¤ò¤â¤Ã¤È¸·Ì©¤Ë²ò¼á¤·¤¿Êý¤¬¤è¤¤¤À¤í¤¦¡£ +Î㤨¤Ð¡¢ +.RB ( regex (7) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë³ÈÄ¥Àµµ¬É½¸½¤ò»È¤Ã¤Æ) +.BR ^([yY]|yes|YES)$ " ¤ä " ^([nN]|no|NO)$ +¤Ç²ò¼á¤¹¤ë¤Ê¤É¡£ +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ç +»ØÄꤵ¤ì¤¿Ê¸»úÎó¤ò +.BR rpmatch () +¤ËÅϤ·¤¿¾ì¹ç¤Î·ë²Ì¤òɽ¼¨¤¹¤ë¡£ +.nf + +#define _SVID_SOURCE +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + if (argc != 2 || strcmp(argv[1], "\-\-help") == 0) { + fprintf(stderr, "%s response\\n", argv[0]); + exit(EXIT_FAILURE); + } + + setlocale(LC_ALL, ""); + printf("rpmatch() returns: %d\\n", rpmatch(argv[1])); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR fgets (3), +.BR getline (3), +.BR nl_langinfo (3), +.BR regcomp (3), +.BR setlocale (3) diff --git a/release/man3/rtime.3 b/release/man3/rtime.3 new file mode 100644 index 00000000..00c42dc2 --- /dev/null +++ b/release/man3/rtime.3 @@ -0,0 +1,126 @@ +.\" Copyright 2003 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" Modified 2003-04-04 Walter Harms +.\" +.\" +.\" Slightly polished, aeb, 2003-04-06 +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Thu Sep 2 07:40:48 JST 2004 +.\" by Yuichi SATO +.\" +.TH RTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +rtime \- ¥ê¥â¡¼¥È¥Þ¥·¥ó¤«¤é»þ¹ï¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int rtime(struct sockaddr_in *" addrp ", struct rpc_timeval *" timep , +.BI " struct rpc_timeval *" timeout ); +.fi +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤Ï RFC\ 868 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥¿¥¤¥à¥µ¡¼¥Ð¥×¥í¥È¥³¥ë¤ò»ÈÍѤ·¡¢ +¥ê¥â¡¼¥È¥Þ¥·¥ó¤«¤é»þ¹ï¤ò¼èÆÀ¤¹¤ë¡£ +.LP +¥¿¥¤¥à¥µ¡¼¥Ð¥×¥í¥È¥³¥ë¤Ï 00:00:00 UTC, 1 Jan 1900 ¤«¤éÉÿô¤òÄ󶡤¹¤ë¤Î¤Ç¡¢ +¤³¤Î´Ø¿ô¤ÏŬÀÚ¤ÊÄê¿ôÃͤò°ú¤¯¤³¤È¤Ë¤è¤ê¡¢ +Ä󶡤µ¤ì¤¿Ãͤò Unix ¤Ë¤ª¤±¤ë»þ¹ïµª¸µ (1970-01-01 00:00:00 +0000 (UTC)) +¤«¤éÉÿô¤ËÊÑ´¹¤¹¤ë¡£ +.LP +.I timeout +¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢udp/time ¥½¥±¥Ã¥È (¥Ý¡¼¥È 37) ¤¬»ÈÍѤµ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢tcp/time ¥½¥±¥Ã¥È (¥Ý¡¼¥È 37) ¤¬»ÈÍѤµ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï¡¢0 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ÆÀ¤é¤ì¤¿ 32 ¥Ó¥Ã¥È¤Î»þ¹ïÃÍ¤Ï +.I timep\->tv_sec +¤Ë³ÊǼ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +ÆâÉô¤Ç»ÈÍѤ·¤Æ¤¤¤ë´Ø¿ô +.RB ( sendto (2), +.BR poll (2), +.BR recvfrom (2), +.BR connect (2), +.BR read (2)) +¤ÎÁ´¤Æ¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¹¹¤Ë¼¡¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë²ÄǽÀ­¤¬¤¢¤ë: +.TP +.B EIO +ÊÖ¤µ¤ì¤¿¥Ð¥¤¥È¿ô¤¬ 4 ¥Ð¥¤¥È¤Ç¤Ê¤¤¡£ +.TP +.B ETIMEDOUT +timeout ¤ÇÄêµÁ¤µ¤ì¤¿ÂÔ¤Á»þ´Ö¤Î´ü¸Â¤¬Àڤ줿¡£ +.SH Ãí°Õ +IPv4 ¤Î¤ß¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +.I in.timed +¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï TCP ¤·¤«¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤â¤Î¤â¤¢¤ë¡£ +.I use_tcp +¤ò 1 ¤ËÀßÄꤷ¤Æ¡¢Îã¤Ë¤¢¤ë¥×¥í¥°¥é¥à¤ò»î¤¹¤³¤È¡£ +.LP +libc5 ¤Ï¥×¥í¥È¥¿¥¤¥× +.br +int rtime(struct sockaddr_in *, struct timeval *, struct timeval *); +.br +¤ò»È¤¤¡¢ +.I +¤ÎÂå¤ï¤ê¤Ë +.I +¤òɬÍפȤ¹¤ë¡£ +.SH ¥Ð¥° +glibc 2.2.5 °ÊÁ°¤Î +.BR rtime () +¤Ï¡¢64 ¥Ó¥Ã¥È¥Þ¥·¥ó¤ÇÀµ³Î¤ËÆ°ºî¤·¤Ê¤¤¡£ +.SH Îã +¤³¤ÎÎã¤Ç¤Ï¥Ý¡¼¥È 37 ¤¬¥¢¥Ã¥×¤µ¤ì¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +.I /etc/inetd.conf +¤Î time ¥¨¥ó¥È¥ê¤¬¥³¥á¥ó¥È¥¢¥¦¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò³Îǧ¤·¤Æ¤Û¤·¤¤¡£ +.br +¤³¤Î¥×¥í¥°¥é¥à¤Ï "linux" ¤È¤¤¤¦¥³¥ó¥Ô¥å¡¼¥¿¤ËÀܳ¤¹¤ë¡£ +"localhost" ¤ò»È¤Ã¤¿¾ì¹ç¤ÏÆ°ºî¤·¤Ê¤¤¡£ +·ë²Ì¤Ï¥³¥ó¥Ô¥å¡¼¥¿ "linux" ¤Î¥í¡¼¥«¥ë»þ¹ï¤Ç¤¢¤ë¡£ +.sp +.nf +#include +#include +#include +#include +#include +#include +#include + +int use_tcp = 0; +char *servername = "linux"; + +int +main(void) +{ + struct sockaddr_in name; + struct rpc_timeval time1 = {0,0}; + struct rpc_timeval timeout = {1,0}; + struct hostent *hent; + int ret; + + memset((char *) &name, 0, sizeof(name)); + sethostent(1); + hent = gethostbyname(servername); + memcpy((char *) &name.sin_addr, hent\->h_addr, hent\->h_length); + + ret = rtime(&name, &time1, use_tcp ? NULL : &timeout); + if (ret < 0) + perror("rtime error"); + else + printf("%s\\n", ctime((time_t *) &time1.tv_sec)); + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.\" .BR netdate (1), +.BR ntpdate (1), +.\" .BR rdate (1), +.BR inetd (8) diff --git a/release/man3/rtnetlink.3 b/release/man3/rtnetlink.3 new file mode 100644 index 00000000..1dccfc13 --- /dev/null +++ b/release/man3/rtnetlink.3 @@ -0,0 +1,129 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: rtnetlink.3,v 1.3 1999/08/20 04:10:17 nakano 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 +.\" +.\"WORD: running length ¼ÂÆ°»þ¤ÎŤµ +.\" +.TH RTNETLINK 3 2010-01-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +rtnetlink \- rtnetlink ¥á¥Ã¥»¡¼¥¸¤òÁàºî¤¹¤ë¥Þ¥¯¥í +.SH ½ñ¼° +.B #include +.br +.B #include +.br +.B #include +.br +.B #include + +.BI "rtnetlink_socket = socket(AF_NETLINK, int " socket_type \ +", NETLINK_ROUTE);" +.sp +.BI "int RTA_OK(struct rtattr *" rta ", int " rtabuflen ); +.sp +.BI "void *RTA_DATA(struct rtattr *" rta ); +.sp +.BI "unsigned int RTA_PAYLOAD(struct rtattr *" rta ); +.sp +.BI "struct rtattr *RTA_NEXT(struct rtattr *" rta \ +", unsigned int " rtabuflen ); +.sp +.BI "unsigned int RTA_LENGTH(unsigned int " length ); +.sp +.BI "unsigned int RTA_SPACE(unsigned int "length ); +.SH ÀâÌÀ +Á´¤Æ¤Î +.BR rtnetlink (7) +¥á¥Ã¥»¡¼¥¸¤Ï +.BR netlink (7) +¥á¥Ã¥»¡¼¥¸¥Ø¥Ã¥À¤ÈÄɲðÀ­¤«¤é¤Ê¤ë¡£ +°À­¤ÎÁàºî¤Ï¡¢É¬¤º¤³¤³¤Ëµó¤²¤¿¥Þ¥¯¥í¤òÄ̤·¤Æ¹Ô¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.BI RTA_OK( rta ", " attrlen ) +¤Ï +.I rta +¤¬Í­¸ú¤Ê¥ë¡¼¥Æ¥£¥ó¥°Â°À­¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ì¤Ð¿¿¤òÊÖ¤¹¡£ +.I attrlen +¤Ï°À­¥Ð¥Ã¥Õ¥¡¤Î¼ÂƯ»þ¤ÎŤµ (running length) ¤Ç¤¢¤ë¡£ +¿¿¤Ç¤Ê¤±¤ì¤Ð¡¢Î㤨 +.I attrlen +¤¬¥¼¥í¤Ç¤Ê¤¯¤Æ¤â¡¢ +¥á¥Ã¥»¡¼¥¸Ãæ¤Ë¤Ï¤â¤¦¤½¤ì°Ê¾å°À­¤Ï̵¤¤¤È¹Í¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.BI RTA_DATA( rta ) +¤Ï¤³¤Î°À­¥Ç¡¼¥¿¤ÎÀèƬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.BI RTA_PAYLOAD( rta ) +¤Ï¤³¤Î°À­¥Ç¡¼¥¿¤ÎŤµ¤òÊÖ¤¹¡£ +.PP +.BI RTA_NEXT( rta ", " attrlen ) +¤Ï +.I rta +¤Î¼¡¤Ë¤¢¤ë°À­¤ò¼èÆÀ¤¹¤ë¡£ +¤³¤Î¥Þ¥¯¥í¤ò¸Æ¤Ö¤È +.I attrlen +¤¬¹¹¿·¤µ¤ì¤ë¡£ +.B RTA_OK +¤ò»È¤Ã¤Æ¡¢ÊÖ¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤¬Àµ¤·¤¤¤«¤ò¥Á¥§¥Ã¥¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.BI RTA_LENGTH( len ) +¤Ï +.I len +¥Ð¥¤¥È¤Î¥Ç¡¼¥¿ + ¥Ø¥Ã¥À¤ËɬÍפÊŤµ¤òÊÖ¤¹¡£ +.PP +.BI RTA_SPACE( len ) +¤Ï +.I len +¥Ð¥¤¥È¤Î¥Ç¡¼¥¿¤ò»ý¤Ä¥á¥Ã¥»¡¼¥¸¤ËɬÍפȤµ¤ì¤ëÍÆÎ̤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤ì¤é¤Î¥Þ¥¯¥í¤ÏÈóɸ½à¤Ç¡¢Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï´°Á´¤Ç¤Ï¤Ê¤¤¡£ +.SH Îã +.\" FIXME ? would be better to use libnetlink in the EXAMPLE code here +¥Ç¥Ð¥¤¥¹¤Î MTU ¤ò¥»¥Ã¥È¤¹¤ë rtnetlink ¥á¥Ã¥»¡¼¥¸¤òÀ¸À®¤¹¤ë +.nf + #include + + ... + + struct { + struct nlmsghdr nh; + struct ifinfomsg if; + char attrbuf[512]; + } req; + + struct rtattr *rta; + unsigned int mtu = 1000; + + int rtnetlink_sk = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); + + memset(&req, 0, sizeof(req)); + req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); + req.nh.nlmsg_flags = NLM_F_REQUEST; + req.nh.nlmsg_type = RTM_NEWLINK; + req.if.ifi_family = AF_UNSPEC; + req.if.ifi_index = INTERFACE_INDEX; + req.if.ifi_change = 0xffffffff; /* ???*/ + rta = (struct rtattr *)(((char *) &req) + + NLMSG_ALIGN(req.nh.nlmsg_len)); + rta\->rta_type = IFLA_MTU; + rta\->rta_len = 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) diff --git a/release/man3/scalb.3 b/release/man3/scalb.3 new file mode 100644 index 00000000..df34c2a2 --- /dev/null +++ b/release/man3/scalb.3 @@ -0,0 +1,184 @@ +.\" 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. +.\" +.\" 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 2009-03-15 "" "Linux Programmer's Manual" +.SH ̾Á° +scalb, scalbf, scalbl \- ÉâÆ°¾®¿ôÅÀ¿ô¤ËÀ°¿ô¤Ç¤¢¤ë´ð¿ô¤ÎÎß¾è¤ò³Ý¤±¤ë (ÇÑ»ßͽÄê) +.SH ½ñ¼° +.B #include +.sp +.BI "double scalb(double " x ", double " exp ); +.br +.BI "float scalbf(float " x ", double " exp ); +.br +.BI "long double scalbl(long double " x ", double " exp ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR scalb (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR scalbf (), +.BR scalbl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.ad b +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤ÏºÇ½é¤Î°ú¤­¿ô +.I x +¤Ë +.B FLT_RADIX +¤Î +.I exp +¾è¤ò³Ý¤±¤ë +.RB ( FLT_RADIX +¤Ï¤ª¤½¤é¤¯ 2 ¤Ç¤¢¤ë)¡£¤Ä¤Þ¤ê¡¢°Ê²¼¤Î¼°¤ÎÃͤòÊÖ¤¹¡£ +.nf + + x * FLT_RADIX ** exp +.fi + +.B FLT_RADIX +¤ÎÄêµÁ¤Ï +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤³¤È¤ÇÆÀ¤é¤ì¤ë¡£ +.\" /usr/include ¤Ç¤Ï¤Ê¤¯¡¢gcc ¤Î lib ¤Ë¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï \fIx\fP * \fBFLT_RADIX\fP ** \fIexp\fP ¤òÊÖ¤¹¡£ + +.I x +¤« +.I exp +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Ç +.I exp +¤¬Éé¤Î̵¸ÂÂç¤Ç¤Ê¤¤¾ì¹ç¡¢Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 (\-0) ¤Ç +.I exp +¤¬Àµ¤Î̵¸ÂÂç¤Ç¤Ê¤¤¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬¥¼¥í¤Ç +.I exp +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ +NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Ìµ¸ÂÂç¤Ç +.I exp +¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ +NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ +ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.BR HUGE_VAL , +.BR HUGE_VALF , +.BR HUGE_VALL +¤òÊÖ¤¹¡£Éä¹æ¤Ï +.I x +¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ + +·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï 0 ¤òÊÖ¤¹¡£Éä¹æ¤Ï +.I x +¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬ 0 ¤Ç \fIexp\fP ¤¬Àµ¤Î̵¸ÂÂç¡¢\ +¤Þ¤¿¤Ï \fIx\fP ¤¬Àµ¤Î̵¸ÂÂç¤Ç \fIexp\fP ¤¬Éé¤Î̵¸ÂÂç +.\" .I errno +.\" is set to +.\" .BR EDOM . +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼ (range error)¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.\" .I errno +.\" is set to +.\" .BR ERANGE . +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼ (range error)¡¢¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.\" .I errno +.\" is set to +.\" .BR ERANGE . +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.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 +.SH ½àµò +.BR scalb () +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¤¬¡¢ÇÑ»ßͽÄê¤È¤µ¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2008 ¤Ç¤Ï +.BR scalb () +¤Î»ÅÍͤϺï½ü¤µ¤ì¤Æ¤ª¤ê¡¢Âå¤ï¤ê¤Ë +.BR scalbln (3), +.BR scalblnf (3), +.BR scalblnl (3) +¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.BR scalb () +´Ø¿ô¤Ï 4.3BSD ¤ËͳÍ褹¤ë¡£ + +.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. +.SH ´ØÏ¢¹àÌÜ +.BR ldexp (3), +.BR scalbln (3) diff --git a/release/man3/scandir.3 b/release/man3/scandir.3 new file mode 100644 index 00000000..b1bf9d43 --- /dev/null +++ b/release/man3/scandir.3 @@ -0,0 +1,195 @@ +.\" Copyright (C) 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 Sat Jul 24 18:26:16 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Thu Apr 11 17:11:33 1996 by Andries Brouwer (aeb@cwi.nl): +.\" Corrected type of compar routines, as suggested by +.\" Miguel Barreiro (enano@avalon.yaix.es). Added example. +.\" Modified Sun Sep 24 20:15:46 2000 by aeb, following Petter Reinholdtsen. +.\" Modified 2001-12-26 by aeb, following Joey. Added versionsort. +.\" +.\" 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 +.\" +.TH SCANDIR 3 2009-02-10 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +scandir, alphasort, versionsort \- ¥Ç¥£¥ì¥¯¥È¥ê¤òÁöºº¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int scandir(const char *" dirp ", struct dirent ***" namelist , +.RS +.BI "int (*" filter ")(const struct dirent *)," +.BI "int (*" compar ")(const struct dirent **, const struct dirent **));" +.RE +.sp +.BI "int alphasort(const void *" a ", const void *" b ); +.sp +.BI "int versionsort(const void *" a ", const void *" b ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR scandir (), +.BR alphasort (): +_BSD_SOURCE || _SVID_SOURCE +.br +.BR versionsort (): +_GNU_SOURCE +.SH ÀâÌÀ +´Ø¿ô +.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 ¤Ê¤é¤Ð¡¢¤¹¤Ù¤Æ¤Î¥¨¥ó¥È¥ê¤¬ÁªÂò¤µ¤ì¤ë¡£ +.LP +Èæ³Ó´Ø¿ô +.IR compar () +¤Ë¤Ï +.BR alphasort () +´Ø¿ô¤È +.BR versionsort () +´Ø¿ô¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR alphasort () +¤Ï +.BR strcoll (3) +¤òÍѤ¤¤Æ¥Ç¥£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê¤ò¥½¡¼¥È¤·¡¢ +.BR versionsort () +¤Ïʸ»úÎó \fI(*a)\->d_name\fP ¤È \fI(*b)\->d_name\fP ¤ËÂФ·¤Æ +.BR strverscmp (3) +¤òÍѤ¤¤ë¡£ +.SH ÊÖ¤êÃÍ +´Ø¿ô +.BR scandir () +¤ÏÁªÂò¤µ¤ì¤¿¥¨¥ó¥È¥ê¤Î¿ô¤«¡¢ +(¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç) \-1 ¤òÊÖ¤¹¡£ +.PP +´Ø¿ô +.BR alphasort () +¤È +.BR versionsort () +¤Ï 1 ÈÖÌܤΰú¤­¿ô¤¬ 2 ÈÖÌܤΰú¤­¿ô¤ËÂФ·¤Æ¡¢ +[¾®¤µ¤¤/Åù¤·¤¤/Â礭¤¤] ¤«¤Ë±þ¤¸¤Æ¡¢0 ¤è¤ê [¾®¤µ¤¤/Åù¤·¤¤/Â礭¤¤] ÃͤòÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +Æ°ºî¤ò´°¿ë¤¹¤ë¤Ë¤Ï¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR versionsort () +¤Ï¡¢glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +.BR alphasort () +¤È +.BR scandir () +¤Ï POSIX.1-2008 ¤Çµ¬Äꤵ¤ì¤Æ¤ª¤ê¡¢¹­¤¯ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.BR versionsort () +¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.LP +´Ø¿ô +.BR scandir () +¤È +.BR alphasort () +¤Ï 4.3BSD ¤«¤é¼è¤êÆþ¤ì¤é¤ì¡¢Linux ¤Ç¤Ï libc4 ¤«¤é»ÈÍѲÄǽ¤Ë¤Ê¤Ã¤¿¡£ +libc4 ¤È libc5 ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Ã¤È¾ÜºÙ¤Ê¥×¥í¥È¥¿¥¤¥×¤ò»È¤Ã¤Æ¤¤¤ë¡£ +.sp +.nf + int alphasort(const struct dirent ** a, + const struct dirent **b); +.fi +.sp +¤·¤«¤· glibc 2.0 ¤Ç¤ÏÉÔÀµ³Î¤Ê BSD ¤Î¥×¥í¥È¥¿¥¤¥×¤ËÌá¤Ã¤¿¡£ +.LP +´Ø¿ô +.BR versionsort () +¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢glibc 2.1 °Ê¹ß¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.LP +glibc 2.1 °Ê¹ß¤Ç¤Ï +.BR alphasort () +¤Ï +.BR strcoll (3) +¤ò¸Æ¤Ó½Ð¤¹¡£ +.BR alphasort () +¤Ï°ÊÁ°¤Ï +.BR strcmp (3) +¤ò»È¤Ã¤Æ¤¤¤¿¡£ +.SH Îã +.nf +#define _SVID_SOURCE +/* ¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Õ¥¡¥¤¥ë¤òµÕ½ç¤Ë½ÐÎϤ¹¤ë */ +#include + +int +main(void) +{ + struct dirent **namelist; + int n; + + n = scandir(".", &namelist, 0, alphasort); + if (n < 0) + perror("scandir"); + else { + while (n\-\-) { + printf("%s\en", namelist[n]\->d_name); + free(namelist[n]); + } + free(namelist); + } +} +.fi +.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) diff --git a/release/man3/scanf.3 b/release/man3/scanf.3 new file mode 100644 index 00000000..a4df01f3 --- /dev/null +++ b/release/man3/scanf.3 @@ -0,0 +1,739 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)scanf.3 6.14 (Berkeley) 1/8/93 +.\" +.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu +.\" modified to resemble the GNU libio setup used in the Linux libc +.\" used in versions 4.x (x>4) and 5 Helmut.Geyer@iwr.uni-heidelberg.de +.\" Modified, aeb, 970121 +.\" 2005-07-14, mtk, added description of %n$ form; various text +.\" incorporated from the GNU C library documentation ((C) The +.\" Free Software Foundation); other parts substantially rewritten. +.\" +.\" 2008-06-23, mtk +.\" Add ERRORS section. +.\" Document the 'a' and 'm' modifiers for dynamic string allocation. +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated 1998-02-17, YOSHINO Takashi +.\" Updated 2003-02-23, Kentaro Shirakata +.\" Updated 2005-09-18, Akihiro MOTOKI +.\" Updated 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: conversion specifications ÊÑ´¹»ØÄê +.\"WORD: type modifier ·¿½¤¾þ»Ò +.\" +.TH SCANF 3 2008-07-12 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf \- ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +.SH ½ñ¼° +.nf +.B #include + +.BI "int scanf(const char *" format ", ...);" +.BI "int fscanf(FILE *" stream ", const char *" format ", ...);" +.BI "int sscanf(const char *" str ", const char *" format ", ...);" +.sp +.B #include + +.BI "int vscanf(const char *" format ", va_list " ap ); +.BI "int vsscanf(const char *" str ", const char *" format ", va_list " ap ); +.BI "int vfscanf(FILE *" stream ", const char *" format ", va_list " ap ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR vscanf (), +.BR vsscanf (), +.BR vfscanf (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I "cc -std=c99" +.SH ÀâÌÀ +.BR scanf () +´Ø¿ô¥°¥ë¡¼¥×¤Ï¡¢°Ê²¼¤Ë½Ò¤Ù¤ë¤è¤¦¤Ë¡¢ +.I format +¤Ë½¾¤Ã¤ÆÆþÎϤòÆɤ߹þ¤à¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î½ñ¼°¤Ë¤Ï +.I "¡ÖÊÑ´¹»ØÄê¡× (conversion specifications)" +¤ò´Þ¤á¤ë¤³¤È¤¬¤Ç¤­¡¢ÊÑ´¹»ØÄ꤬¤¢¤ì¤Ð¡¢¤½¤ÎÊÑ´¹¤Î·ë²Ì¤Ï +.I format +¤Ë³¤¯ +.I pointer +°ú¤­¿ô¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤µ¤ì¤ë¡£ +¤½¤ì¤¾¤ì¤Î +.I pointer +°ú¤­¿ô¤Î·¿¤Ï¡¢Âбþ¤¹¤ëÊÑ´¹»ØÄ꤬ÊÖ¤¹ÃÍ¤Ë +Ŭ¹ç¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.I format +Ãæ¤ÎÊÑ´¹»ØÄê¤Î¸Ä¿ô¤¬ +.I pointer +°ú¤­¿ô¤Î¿ô¤è¤ê¿¤«¤Ã¤¿¾ì¹ç¤Î·ë²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.I pointer +°ú¤­¿ô¤Î¿ô¤¬ÊÑ´¹»ØÄê¤Î¸Ä¿ô¤è¤ê¤â¿¤«¤Ã¤¿¾ì¹ç¡¢ +;ʬ¤Ê +.I pointer +°ú¤­¿ô¤Îɾ²Á¤Ï¹Ô¤ï¤ì¤ë¤¬¡¢¤½¤ì°Ê³°¤Ï¹Ô¤ï¤ì¤ºÌµ»ë¤µ¤ì¤ë¡£ + +.BR scanf () +´Ø¿ô¤Ïɸ½àÆþÎÏ¥¹¥È¥ê¡¼¥à +.I stdin +¤«¤é¤ÎÆþÎϤòÆɤ߹þ¤à¡£ +.BR fscanf () +¤Ï¥¹¥È¥ê¡¼¥à¥Ý¥¤¥ó¥¿ +.I stream +¤«¤é¤ÎÆþÎϤòÆɤ߹þ¤à¡£ +.BR sscanf () +¤Ïʸ»úÎó¥Ý¥¤¥ó¥¿ +.I str +¤Ç¼¨¤µ¤ì¤¿Ê¸»úÎ󤫤é¤ÎÆþÎϤòÆɤ߹þ¤à¡£ +.PP +.BR vfscanf () +´Ø¿ô¤Ï +.BR vfprintf (3) +¤ÈƱÍͤˡ¢¥¹¥È¥ê¡¼¥à¥Ý¥¤¥ó¥¿ +.I stream +¤«¤é¤ÎÆþÎϤò¥Ý¥¤¥ó¥¿¤Î²ÄÊÑĹ°ú¤­¿ô¥ê¥¹¥È¤òÍѤ¤¤ÆÆɤ߹þ¤à +.RB ( stdarg (3) +¤ò»²¾È)¡£ +.BR vscanf () +´Ø¿ô¤Ï¡¢²ÄÊÑĹ°ú¤­¿ô¤Î¥ê¥¹¥È¤Ë´ð¤Å¤­É¸½àÆþÎϤ«¤é¤ÎÆɤ߼è¤ê¤ò¹Ô¤¦¡£ +.BR vsscanf () +´Ø¿ô¤Ï¤½¤Î¥ê¥¹¥È¤Ë´ð¤Å¤­Ê¸»úÎ󤫤éÆɤ߼è¤ë¡£ +¤³¤ì¤é¤Î´Ø·¸¤Ï +.BR vprintf (3) +¤È +.BR vsprintf (3) +´Ø¿ô¤Î´Ø·¸¤ÈƱÍͤǤ¢¤ë¡£ +.PP +.I format +ʸ»úÎó¤Ï +.I "¡ÖÌ¿Îá¡× (directive)" +¤ÎÎó¤Ç¹½À®¤µ¤ì¤ë¡£Ì¿Îá¤ÏÆþÎÏʸ»ú¤Î·ÏÎó¤ò¤É¤Î¤è¤¦¤Ë½èÍý¤¹¤ë¤«¤ò»Ø¼¨¤¹¤ë +¤â¤Î¤Ç¤¢¤ë¡£¤¢¤ëÌ¿Îá¤Î½èÍý¤¬¼ºÇÔ¤¹¤ë¤È¡¢ÆþÎϤϤ½¤ì°Ê¾åÆɤ߹þ¤Þ¤ì¤º¡¢ +.BR scanf () +¤ÏÊ֤롣¡Ö¼ºÇÔ¡×¤Ï +.I "¡ÖÆþÎϤμºÇÔ¡× (input failure)" +¤È +.I "¡Ö°ìÃפμºÇÔ¡× (matching failure)" +¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ +ÆþÎϤμºÇÔ¤ÏÆþÎÏʸ»ú¤¬»ÈÍѤǤ­¤Ê¤«¤Ã¤¿¤³¤È¤ò°ÕÌ£¤·¡¢ +°ìÃפμºÇÔ¤ÏÆþÎϤ¬ÉÔŬÀڤǤ¢¤Ã¤¿¤³¤È (²¼µ­»²¾È) ¤ò°ÕÌ£¤¹¤ë¡£ + +Ì¿Îá¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë: +.TP +\(bu +¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹ (¥¹¥Ú¡¼¥¹¡¢¥¿¥Ö¡¢²þ¹Ô¤Ê¤É; +.BR isspace (3) +»²¾È) ¤ÎÎó¡£ +¤³¤ÎÌ¿Îá¤Ï¡¢ÆþÎÏÃæ¤ÎǤ°Õ¤Î¸Ä¿ô¤Î¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤Ë°ìÃפ¹¤ë¡£ +(¡Ö²¿¤â¤Ê¤·¡×¤Ë¤â°ìÃפ¹¤ë)¡£ +.TP +\(bu +Ä̾ïʸ»ú (¤Ä¤Þ¤ê¡¢¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤È \(aq%\(aq °Ê³°¤Îʸ»ú)¡£ +¤³¤Îʸ»ú¤ÏÆþÎϤμ¡¤Îʸ»ú¤ËÀµ³Î¤Ë°ìÃפ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +\(bu +ÊÑ´¹»ØÄê¡£ÊÑ´¹»ØÄê¤Ï \(aq%\(aq (¥Ñ¡¼¥»¥ó¥È) ʸ»ú¤Ç»Ï¤Þ¤ë¡£ +ÆþÎϤµ¤ì¤¿Ê¸»ú¤Î·ÏÎó¤Ï¤³¤Î»ØÄê¤Ë¤â¤È¤Å¤¤¤ÆÊÑ´¹¤µ¤ì¡¢ +ÊÑ´¹·ë²Ì¤ÏÂбþ¤¹¤ë +.I pointer +°ú¤­¿ô¤¬»Ø¤¹¾ì½ê¤Ë³ÊǼ¤µ¤ì¤ë¡£ +ÆþÎϤμ¡¤Îʸ»ú¤¬ÊÑ´¹»ØÄê¤È°ìÃפ·¤Ê¤¤¾ì¹ç¤Ï¡¢ÊÑ´¹¤Ï¼ºÇÔ¤¹¤ë +\(em ¤³¤ì¤¬ +.I "¡Ö°ìÃפμºÇÔ¡× (matching failure)" +¤Ç¤¢¤ë¡£ +.PP +.I format +Ãæ¤Î³Æ¡¹¤Î +.I "¡ÖÊÑ´¹»ØÄê¡×" +¤Ïʸ»ú \(aq%\(aq ¤«Ê¸»ú·ÏÎó "\fB%\fP\fIn\fP\fB$\fP" +(°ã¤¤¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò) ¤Ç»Ï¤Þ¤ê¡¢°Ê²¼¤ÎÍ×ÁǤ¬Â³¤¯¡£ +.TP +\(bu +ÂåÆþÍÞÀ©Ê¸»ú \(aq*\(aq (¾Êά²Äǽ)¡£ +.BR scanf () +¤ÏÊÑ´¹»ØÄê¤Ë»Ø¼¨¤µ¤ì¤¿Ä̤êÆþÎϤòÆɤ߹þ¤à¤¬¡¢¤½¤ÎÆþÎϤϼΤƤé¤ì¤ë¡£ +Âбþ¤¹¤ë +.I pointer +°ú¤­¿ô¤ÏɬÍפʤ¯¡¢ +.BR scanf () +¤¬ÊÖ¤¹ÂåÆþ¤¬À®¸ù¤·¤¿¿ô¤Ë¤³¤Î»ØÄê¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +.TP +\(bu +ʸ»ú \(aqa\(aq (¾Êά²Äǽ)¡£¤³¤ì¤Ïʸ»úÎóÊÑ´¹¤È¤È¤â¤Ë»ÈÍѤµ¤ì¡¢¤³¤ì¤ò»È¤¦¤È +¸Æ¤Ó½Ð¤·¸µ¤¬ÆþÎϤòÊÝ»ý¤¹¤ëÂбþ¤¹¤ë¥Ð¥Ã¥Õ¥¡¤ò³ÎÊݤ¹¤ëɬÍפ¬¤Ê¤¯¤Ê¤ë¡£ +Âå¤ï¤ê¤Ë +.BR scanf () +¤¬É¬ÍפÊÂ礭¤µ¤Î¥Ð¥Ã¥Õ¥¡¤ò³ÎÊݤ·¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡¤Î¥¢¥É¥ì¥¹¤ò +Âбþ¤¹¤ë +.I pointer +°ú¤­¿ô¤ËÂåÆþ¤¹¤ë¡£ +.I pointer +°ú¤­¿ô¤Ï +.I "char *" +·¿¤ÎÊÑ¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(ÊÑ¿ô¼«ÂΤϸƤӽФ·Á°¤Ë½é´ü²½¤µ¤ì¤Æ¤¤¤ëɬÍפϤʤ¤)¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï¡¢ÉÔÍפˤʤä¿»þÅÀ¤Ç¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡¤ò +.BR free (3) +¤¹¤Ù¤­¤Ç¤¢¤ë¡£¤³¤Îµ¡Ç½¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +C99 ¤Ï \(aqa\(aq ʸ»ú¤òÊÑ´¹»ØÄê¤È¤·¤Æ»ÈÍѤ·¤Æ¤¤¤ë +(¤³¤Á¤é¤â GNU ¤Î¼ÂÁõ¤ÈƱ¤¸¤è¤¦¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë)¡£ +.TP +\(bu +.I "¡ÖºÇÂç¥Õ¥£¡¼¥ë¥ÉÉý¡×" +¤ò»ØÄꤹ¤ë 10¿Ê¿ô (¾Êά²Äǽ)¡£ +¤³¤ÎºÇÂçÃͤË㤹¤ë¤«¡¢°ìÃפ·¤Ê¤¤Ê¸»ú¤¬¸«¤Ä¤«¤ë¤«¡¢¤Î¤É¤Á¤é¤«¤Ë +¤Ê¤ë¤È¡¢Ê¸»ú¤ÎÆɤ߹þ¤ß¤òÄä»ß¤¹¤ë¡£ +¤Û¤È¤ó¤É¤ÎÊÑ´¹¤Ç¤Ï¡¢ÀèƬ¤Î¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹Ê¸»ú¤Ï¼Î¤Æ¤é¤ì +(Îã³°¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò¤¹¤ë)¡¢ +¼Î¤Æ¤é¤ì¤¿¤³¤ì¤é¤Îʸ»ú¤ÏºÇÂç¥Õ¥£¡¼¥ë¥ÉÉý¤Î·×»»¤Ë¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +ʸ»úÎó¤ÎÆþÎÏÊÑ´¹¤Ç¤Ï¡¢ÆþÎϤÎËöÈø¤ò¼¨¤¹¥Ì¥ë½ªÃ¼Ê¸»ú (\(aq\\0\(aq) +¤â³ÊǼ¤µ¤ì¤ë¤¬¡¢ºÇÂç¥Õ¥£¡¼¥ë¥ÉÉý¤Ë¤Ï¤³¤Î½ªÃ¼Ê¸»ú¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +.TP +\(bu +.I "¡Ö·¿½¤¾þ»Ò¡× (type modifier characters)" +(¾Êά²Äǽ)¡£ +Î㤨¤Ð¡¢·¿½¤¾þ»Ò +.B l +¤ò +.B %d +¤Ê¤É¤ÎÀ°¿ôÊÑ´¹¤È°ì½ï¤Ë»È¤¦¤È¡¢Âбþ¤¹¤ë +.I pointer +°ú¤­¿ô¤¬ +.I int +¤Ç¤Ï¤Ê¤¯ +.I "long int" +¤ò»²¾È¤·¤Æ¤¤¤ë¤³¤È¤ò»ØÄê¤Ç¤­¤ë¡£ +.TP +\(bu +.I "¡ÖÊÑ´¹»ØÄê¡×" +: ¼Â¹Ô¤¹¤Ù¤­ÆþÎÏÊÑ´¹¤Î¼ïÎà¤ò»ØÄꤹ¤ë¡£ +.PP +.I format +Ãæ¤ÎÊÑ´¹»ØÄê¤Ï¡¢\(aq%\(aq ¤Ç»Ï¤Þ¤ë¤«¡¢ +"\fB%\fP\fIn\fP\fB$\fP" ¤Ç»Ï¤Þ¤ë¤«¤Î¡¢¤¤¤º¤ì¤«¤Î·Á¼°¤Ç¤¢¤ë¡£ +¤³¤ì¤é 2¤Ä¤Î·Á¼°¤òƱ¤¸ +.I format +ʸ»úÎó¤Ëº®¤¼¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£Ã¢¤·¡¢"\fB%\fP\fIn\fP\fB$\fP" ¤ò +´Þ¤àʸ»úÎó¤Ë +.B %% +¤È +.B %* +¤ò´Þ¤á¤ë¤³¤È¤Ï¤Ç¤­¤ë¡£ +.I format +¤Ë \(aq%\(aq »ØÄ꤬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢³Æ¡¹¤Î \(aq%\(aq »ØÄê¤È +¸å³¤Î +.I pointer +°ú¤­¿ô¤Ï¤½¤Î½çÈÖÄ̤ê¤ËÂбþ¤¹¤ë¡£ +"\fB%\fP\fIn\fP\fB$\fP" ·Á¼° +(POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤ë¤¬¡¢C99 ¤Ë¤Ï¤Ê¤¤) +¤Ç¤Ï¡¢ +.I n +¤Ï 10¿Ê¿ô¤Ç¤¢¤ê¡¢ÊÑ´¹¸å¤ÎÆþÎϤò +.I format +¤Î¸å¤í¤Î +.I n +ÈÖÌܤΠ+.I pointer +°ú¤­¿ô¤¬»²¾È¤¹¤ë¾ì½ê¤Ë³ÊǼ¤¹¤ë¤³¤È¤ò»ØÄꤹ¤ë¡£ +.SS ÊÑ´¹ +ÊÑ´¹»ØÄê¤Ë¤Ï¡¢°Ê²¼¤Î +.I "¡Ö·¿½¤¾þ»Ò¡×" +¤òÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B h +ÊÑ´¹¤¬ +\fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP, \fBn\fP +¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ê¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.RI ( int +¤Ç¤Ï¤Ê¤¯) +.I short int +¤« +.I unsigned short int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.B hh +.B h +¤ÈƱ¤¸¤À¤¬¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.I signed char +¤« +.I unsigned char +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.TP +.B j +.B h +¤ÈƱ¤¸¤À¤¬¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.I intmax_t +¤« +.I uintmax_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î½¤¾þ»Ò¤Ï C99 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.TP +.B l +ÊÑ´¹¤¬ +\fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP, \fBn\fP +¤« +.B n +¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ê¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.RI ( int +¤Ç¤Ï¤Ê¤¯) +.I long int +¤« +.I unsigned long int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¡¢¤Þ¤¿¤Ï¡¢ÊÑ´¹¤¬ +\fBe\fP, \fBf\fP, \fBg\fP +¤Î¤¦¤Á¤Î¤Ò¤È¤Ä¤Ç¤¢¤ê¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.RI ( float +¤Ç¤Ï¤Ê¤¯) +.I double +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.B l +ʸ»ú¤òÆó¤Ä»ØÄꤹ¤ë¤È¡¢ +.B L +¤ÈƱ¤¸°ÕÌ£¤È¤Ê¤ë¡£ +.B %c +¤ä +.B %s +¤È¤È¤â¤Ë»ÈÍѤ¹¤ë¤È¡¢ +¥Ñ¥é¥á¡¼¥¿¤Ï¤½¤ì¤¾¤ì¥ï¥¤¥Éʸ»ú¤ä¥ï¥¤¥Éʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤È +¤ß¤Ê¤µ¤ì¤ë¡£ +.\" l ¤Î¤³¤Î»ÈÍÑË¡¤Ï ISO C90 ¤Î Amendment 1 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.TP +.B L +\fBe\fP, \fBf\fP, \fBg\fP +ÊÑ´¹¤Ç¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.I "long double" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£¤â¤·¤¯¤Ï¡¢ +\fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP +ÊÑ´¹¤Ç¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.I "long long" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.\" MTK, Jul 05: °Ê²¼¤ÎÆâÍƤϿ·¤·¤¤ ANSI C (¤Ä¤Þ¤ê C99) ¤Ç¤Ï +.\" ¤â¤Ï¤äÀµ¤·¤¯¤Ê¤¤¡£ +.\" (long long ¤Ï +.\" .I ANSI C +.\" ¤Çµ¬Äꤵ¤ì¤¿·¿¤Ç¤Ï¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤è¤¦¡£ +.\" ¤³¤ì¤òÍѤ¤¤¿¥×¥í¥°¥é¥à¤ÏÁ´¤Æ¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ËÂФ·¤Æ +.\" °Ü¿¢²Äǽ¤Ç¤Ï¤Ê¤¤¡£) +.TP +.B q +.B L +¤ÈƱ°ì¤Ç¤¢¤ë¡£ +¤³¤Î½¤¾þ»Ò¤Ï ANSI C ¤Ë¤Ï¸ºß¤·¤Ê¤¤¡£ +.TP +.B t +.B h +¤ÈƱÍͤÀ¤¬¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.I ptrdiff_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î½¤¾þ»Ò¤Ï C99 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.TP +.B z +.B h +¤ÈƱÍͤÀ¤¬¡¢¼¡¤Î¥Ý¥¤¥ó¥¿¤¬ +.I size_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +¤³¤Î½¤¾þ»Ò¤Ï C99 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.PP +°Ê²¼¤Î +.I ¡ÖÊÑ´¹»ØÄê»Ò¡× +¤¬ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.TP +.B % +ʸ»ú \(aq%\(aq ¤ËÂбþ¤¹¤ë¡£ +½ñ¼°Ê¸»úÎó¤ÎÃæ¤Î +.B %\&% +¤Ïñ°ì¤Îʸ»ú \(aq%\(aq ¤ËÂбþ¤¹¤ë¡£ +ÊÑ´¹¤Ï¹Ô¤ï¤ì¤º (⤷¡¢ÀèƬ¤Î¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹Ê¸»ú¤Ï¼Î¤Æ¤é¤ì¤ë)¡¢ +ÊÑ¿ô¤Ø¤ÎÂåÆþ¤ÏÀ¸¤¸¤Ê¤¤¡£ +.TP +.B d +Éä¹æ¤Ä¤­¤Î 10¿Ê¤ÎÀ°¿ô¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B D +.I ld +¤ÈƱ°ì¤Ç¤¢¤ë¡£¤³¤ì¤Ï°ÊÁ°¤Î»ÅÍͤȤθߴ¹À­¤À¤±¤Î¤¿¤á¤Ë¤¢¤ë¡£ +(Ãí°Õ: ¤³¤ì¤Ï libc4 ¤Î¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ libc5 ¤ä glibc ¤Ç¤Ï +.B %D +¤Ï°ÅÌۤΤ¦¤Á¤Ë̵»ë¤µ¤ì¡¢¸Å¤¤¥×¥í¥°¥é¥à¤Ë¤ª¤¤¤ÆÆæ¤ËËþ¤Á¤¿¼ºÇԤθ¶°ø¤È¤Ê¤ë¡£) +.TP +.B i +Éä¹æ¤Ä¤­À°¿ô¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ÎÀ°¿ô¤Ï +.I 0x +¤Þ¤¿¤Ï +.I 0X +¤Ç³«»Ï¤¹¤ë¾ì¹ç¤Ë¤Ï 16 ¿Ê¿ô¡¢ +.I 0 +¤Ç³«»Ï¤¹¤ë¾ì¹ç¤Ë¤Ï 8 ¿Ê¿ô¡¢¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï 10¿Ê¿ô¤È¤·¤ÆÆɤ߹þ¤Þ¤ì¤ë¡£ +¤³¤ÎÊÑ´¹¤Ç»ÈÍѤµ¤ì¤ëʸ»ú¤Ï¡¢¤³¤ì¤é¤Î´ð¿ô¤ËÂбþ¤·¤Æ¤¤¤ë¤â¤Î¤À¤±¤Ç¤¢¤ë¡£ +.TP +.B o +Éä¹æ¤Ê¤·¤Î 8 ¿Ê¤ÎÀ°¿ô¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I "unsigned int" +¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B u +Éä¹æ¤Ê¤·¤Î 10¿Ê¤ÎÀ°¿ô¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I "unsigned int" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B x +Éä¹æ¤Ê¤·¤Î 16 ¿Ê¤ÎÀ°¿ô¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I "unsigned int" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B X +.B x +¤ÈƱ°ì¤Ç¤¢¤ë¡£ +.TP +.B f +Éä¹æ¤Ä¤­ÉâÆ°¾®¿ôÅÀ¼Â¿ô¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I float +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B e +.B f +¤ÈƱ°ì¤Ç¤¢¤ë¡£ +.TP +.B g +.B f +¤ÈƱ°ì¤Ç¤¢¤ë¡£ +.TP +.B E +.B f +¤ÈƱ°ì¤Ç¤¢¤ë¡£ +.TP +.B a +(C99) +.B f +¤ÈƱ°ì¤Ç¤¢¤ë¡£ +.TP +.B s +¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤Ç¤Ï¤Ê¤¤Ê¸»ú¤Ç¹½À®¤µ¤ì¤¿Ê¸»úÎó¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ïʸ»ú¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤½¤Îʸ»úÇÛÎó¤Ï¡¢ÆþÎϤµ¤ì¤¿Ê¸»úÎó¤È (¼«Æ°Åª¤ËÄɲ䵤ì¤ë) +¥Ì¥ë½ªÃ¼Ê¸»ú (\(aq\\0\(aq) ¤ò³ÊǼ¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ʸ»úÎó¤ÎÆþÎϤϡ¢¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤¬ÆþÎϤµ¤ì¤ë¤«¡¢ºÇÂç¥Õ¥£¡¼¥ë¥ÉÉý¤Ë +㤹¤ë¤«¡¢¤Î¤É¤Á¤é¤«¤¬µ¯¤³¤ë¤ÈÄä»ß¤µ¤ì¤ë¡£ +.TP +.B c +.I "¡ÖºÇÂç¥Õ¥£¡¼¥ë¥ÉÉý¡×" +(¥Ç¥Õ¥©¥ë¥È¤Ï 1) ¤Ç»ØÄꤵ¤ì¤¿Éý¤Îʸ»ú¤ÎÎó¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I char +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¡¢¤¹¤Ù¤Æ¤Îʸ»ú¤ò³ÊǼ¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÎΰ褬 +¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ (½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ÏÄɲ䵤ì¤Ê¤¤)¡£ +Ä̾ï¹Ô¤ï¤ì¤ëÀèƬ¤Î¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤ÎÆɤßÈô¤Ð¤·¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +ÀèƬ¤Î¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤òÆɤßÈô¤Ð¤¹¤¿¤á¤Ë¤Ï¡¢ +¥Õ¥©¡¼¥Þ¥Ã¥Èʸ¤ÎÃæ¤ÇÌÀ¼¨Åª¤Ë¥¹¥Ú¡¼¥¹¤ò»ÈÍѤ¹¤ì¤ÐÎɤ¤¡£ +.TP +.B \&[ +³ÊǼ¤µ¤ì¤¿Ê¸»úÎó¤Î¤¦¤Á¤«¤é¼è¤ê½Ð¤µ¤ì¤¿¡¢ +»ØÄꤵ¤ì¤¿Ê¸»ú¤Î½¸¹ç¤Ç¹½À®¤µ¤ì¤ë¶õ¤Ç¤Ï¤Ê¤¤Ê¸»ú¤ÎÎó¤ËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I char +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤½¤³¤Ë¤Ïʸ»úÎóÃæ¤Î¤¹¤Ù¤Æ¤Îʸ»ú¤È½ªÃ¼¤Î NULL ¥Ð¥¤¥È +¤ò³ÊǼ¤¹¤ë¤¿¤á¤Î½½Ê¬¤ÊÎΰ褬¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Ä̾ï¹Ô¤ï¤ì¤ëÀèƬ¤Î¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤ÎÆɤßÈô¤Ð¤·¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +¤³¤Îʸ»úÎó¤ÏÆÃÊ̤ʽ¸¹ç¤ÎÃæ¤Îʸ»ú¤Ç¹½À®¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î½¸¹ç¤Ï +³«¤­³ç¸Ì +.B [ +¤ÈÊĤ¸³ç¸Ì +.B ] +¤Î´Ö¤Îʸ»ú¤ÇÄêµÁ¤µ¤ì¤ë¡£ +³«¤­³ç¸Ì¤Î¤¢¤È¤ÎºÇ½é¤Îʸ»ú¤¬¶Ê¥¢¥¯¥»¥ó¥Èµ­¹æ +.RB ( ^ ) +¤Î¾ì¹ç¡¢½¸¹ç¤Ï¤³¤ì¤é¤Îʸ»ú¤ò´Þ¤Þ¤Ê¤¤¤â¤Î¤È¤Ê¤ë¡£ +ÊĤ¸³ç¸Ì¤ò½¸¹ç¤Ë´Þ¤Þ¤»¤ë¤¿¤á¤Ë¤Ï¡¢¤³¤Îʸ»ú¤ò³«¤­³ç¸Ì¤Þ¤¿¤Ï +¶Ê¥¢¥¯¥»¥ó¥Èµ­¹æ¤Î¤¢¤È¤ÎºÇ½é¤Îʸ»ú¤Ë¤¹¤ì¤Ð¤è¤¤¡£ +¤Ä¤Þ¤ê¡¢Â¾¤Î°ÌÃÖ¤ËÊĤ¸³ç¸Ì¤òÃÖ¤¯¤Èʸ»ú¤Î½¸¹ç¤¬½ª¤ë¡£ +¥Ï¥¤¥Õ¥ó +.B \- +¤â¤Þ¤¿Æüìʸ»ú¤Ç¤¢¤ë¡£ +Æó¤Ä¤Î°Û¤Ê¤ëʸ»ú¤Î´Ö¤ËÃÖ¤«¤ì¤¿»þ¡¢¤³¤Îʸ»ú¤Ï¡¢ +¤½¤Î´Ö¤Ë¤¢¤ëÁ´¤Æ¤Îʸ»ú¤ò½¸¹ç¤Ë²Ã¤¨¤ë¡£ +¥Ï¥¤¥Õ¥ó¼«ÂΤò´Þ¤Þ¤»¤ë¤¿¤á¤Ë¤Ï¡¢ +³ç¸Ì¤¬ÊĤ¸¤ëÁ°¤ÎºÇ¸å¤Î°ìʸ»ú¤ò¥Ï¥¤¥Õ¥ó¤Ë¤¹¤ì¤Ð¤è¤¤¡£ +Î㤨¤Ð¡¢ +.B [^]0\-9\-] +¤Ï¡ÖÊĤ¸³ç¸Ì¡¢0 ¡Á 9¡¢¥Ï¥¤¥Õ¥ó¤Î 3 ¼ïÎà¤ò½ü¤¯Á´¤Æ¤Îʸ»ú¡×¤Î½¸¹ç¤ò°ÕÌ£¤¹¤ë¡£ +¤³¤Îʸ»úÎó¤Ï +½¸¹ç¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤ (¶Ê¥¢¥¯¥»¥ó¥È¤Î¾ì¹ç¤Ë¤Ï´Þ¤Þ¤ì¤ë) ʸ»ú¤Î +½Ð¸½¤Þ¤¿¤Ï³ÎÊݤµ¤ì¤¿Îΰ褬»È¤¤ÀÚ¤é¤ì¤¿»þ¤Ë½ªÎ»¤¹¤ë¡£ +.TP +.B p +.RB ( printf (3) +¤Î +.B %p +¤Ç°õ»ú¤µ¤ì¤ë¤è¤¦¤Ê) ¥Ý¥¤¥ó¥¿ÃͤËÂбþ¤¹¤ë¡£ +¼¡¤Î¥Ý¥¤¥ó¥¿¤Ï +.I void +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B n +¤É¤ó¤ÊÆþÎϤâɬÍפȤ·¤Ê¤¤¡£ +¤½¤Î¤«¤ï¤ê¤Ë¡¢ +ÆþÎϤ«¤é¤³¤³¤Þ¤Ç¾ÃÈñ¤µ¤ì¤¿Ê¸»ú¿ô¤¬¼¡¤Î¥Ý¥¤¥ó¥¿¤Ç»ØÄꤵ¤ì¤¿¾ì½ê¤Ë +³ÊǼ¤µ¤ì¤ë¡£ +¤³¤Î¥Ý¥¤¥ó¥¿¤Ï +.I int +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ÊÑ´¹¤òÍÞÀ©¤¹¤ë¤Î¤Ç¤¢¤ì¤Ð +.B * +ÂåÆþÍÞÀ©Ê¸»ú¤ò»È¤Ã¤ÆÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤Î¤À¤¬¡¢ +¤³¤ÎÊÑ´¹»ØÄê»Ò¤ÏÊÑ´¹¤Ç¤Ï¡Ö¤Ê¤¤¡×¡£ +C ¸À¸ì¤Îɸ½àµ¬³Ê¤Ç¤Ï¡Ö¼Â¹Ô¤Î´°Î»»þ¤ËÊÖ¤µ¤ì¤ëÂåÆþ¤Î²ó¿ô¤Ï +.B %n +Ì¿Îá¤Î¼Â¹Ô¤Ç¤ÏÁý²Ã¤·¤Ê¤¤¡×¤È¤Ê¤Ã¤Æ¤¤¤ë¤¬¡¢ +Àµ¸íɽ¤ÎÆâÍƤϤ³¤ì¤ÈÌ·½â¤¹¤ë¤è¤¦¤Ç¤¢¤ë¡£¤ª¤½¤é¤¯¡¢ +.B %n +ÊÑ´¹¤¬ÊÖ¤êÃͤËÍ¿¤¨¤ë±Æ¶Á¤Ë¤Ä¤¤¤Æ¤Ï¤É¤Î¤è¤¦¤Ê²¾Äê¤â¤·¤Ê¤¤¤Î¤¬ +¸­ÌÀ¤Ç¤¢¤í¤¦¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢°ìÃפÈÂåÆþ¤¬À®¸ù¤·¤¿ÆþÎÏÍ×ÁǤθĿô¤òÊÖ¤¹¡£ +ÊÖ¤µ¤ì¤ëÃͤÏÅϤµ¤ì¤¿ÊÑ´¹¤Î¸Ä¿ô¤è¤ê¤â¾¯¤Ê¤¤¤³¤È¤â¤¢¤ê¡¢ +ºÇ½é¤Ë°ìÃפμºÇÔ¤¬¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï 0 ¤Ë¤Ê¤ë¤³¤È¤â¤¢¤ë¡£ + +ºÇ½é¤ÎÊÑ´¹¤¬À®¸ù¤¹¤ëÁ°¤ËÆþÎϤκǸå¤Ë㤷¤Æ¡¢°ìÃפμºÇÔ¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +.B EOF +¤¬ÊÖ¤µ¤ì¤ë¡£¤Þ¤¿¡¢ +Æɤ߹þ¤ß¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤â +.B EOF +¤¬ÊÖ¤µ¤ì¤ë¡£Æɤ߹þ¤ß¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥¹¥È¥ê¡¼¥à¤Î +¥¨¥é¡¼»Ø¼¨»Ò¤¬¥»¥Ã¥È¤µ¤ì +.RB ( ferror (3) +»²¾È)¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAGAIN +.I stream +¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ nonblocking ¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢ +Æɤ߹þ¤ßÁàºî¤ÏÄä»ß (block) ¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.TP +.B EBADF +.I stream +¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Ìµ¸ú¤Ç¤¢¤ë¤¬¡¢ +Æɤ߹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EILSEQ +ÆþÎϤµ¤ì¤¿¥Ð¥¤¥ÈÎó¤¬Í­¸ú¤Êʸ»ú¤ò¹½À®¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EINTR +Æɤ߹þ¤ßÁàºî¤¬¥·¥°¥Ê¥ë¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +°ú¤­¿ô¤¬½½Ê¬¤Ç¤Ê¤¤¡£¤Þ¤¿¤Ï +.I format +¤¬ NULL ¤Ç¤¢¤ë¡£ +.TP +.B ENOMEM +¥á¥â¥êÉÔ­¡£ +.TP +.B ERANGE +À°¿ôÊÑ´¹¤Î·ë²Ì¤¬¡¢Âбþ¤¹¤ëÀ°¿ô·¿¤Ë³ÊǼ¤Ç¤­¤ë¥µ¥¤¥º¤ò±Û¤¨¤Æ¤·¤Þ¤¦¡£ +.SH ½àµò +.BR fscanf (), +.BR scanf (), +.BR sscanf () +´Ø¿ô¤Ï C89, C99, POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Îɸ½à¤Ç¤Ï¡¢¥¨¥é¡¼ +.B ERANGE +¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.B q +»ØÄê»Ò¤Ï +.I "long long" +¤Î 4.4BSD ¤Ç¤Îµ­½ÒÊýË¡¤Ç¤¢¤ë¡£ +°ìÊý¡¢À°¿ôÊÑ´¹¤Ç¤Î +.B ll +¤Þ¤¿¤Ï +.B L +¤Î»ÈÍÑ¤Ï GNU ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Î Linux ÈÇ¤Ï +.I GNU +.I libio +¥é¥¤¥Ö¥é¥ê¡¼¤ò¸µ¤Ë¤·¤Æ¤¤¤ë¡£ +¤è¤ê´Ê·é¤ÊÀâÌÀ¤Ë¤Ï +.I GNU +.I libc (glibc-1.08) +¤Î +.I info +ʸ½ñ¤ËÌܤòÄ̤¹¤³¤È¡£ +.SH Ãí°Õ +GNU C ¥é¥¤¥Ö¥é¥ê (glibc) ¤Ç¤ÏÈóɸ½à¤Î¥ª¥×¥·¥ç¥ó¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤ª¤ê¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤ÈÊÑ´¹»ØÄê»Ò +.B %s +¤ä +\fB%a[\fP\fIrange\fP\fB]\fP +¤Ø¤ÎÆþÎÏʸ»úÎó¤ËÂФ·¤Æ½½Ê¬¤ÊÂ礭¤µ¤Îʸ»úÎó¤ò¥é¥¤¥Ö¥é¥ê¤¬Æ°Åª¤Ë³ÎÊݤ¹¤ë +¤è¤¦¤Ë¤Ê¤ë¡£ +.\" ¤³¤Îµ¡Ç½¤Ï¾¯¤Ê¤¯¤È¤â glibc 2.0 »þÅÀ¤«¤é¸ºß¤·¤Æ¤¤¤ë¤è¤¦¤À¡£ +¤³¤Îµ¡Ç½¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢Ä¹¤µ½¤¾þ»Ò¤È¤·¤Æ +.B a +¤ò»ØÄꤹ¤ë (¤·¤¿¤¬¤Ã¤Æ¡¢Á´ÂΤȤ·¤Æ¤Ï +.B %as +¤ä +\fB%a[\fP\fIrange\fP\fB]\fP ¤È¤Ê¤ë)¡£ +°Ê²¼¤ÎÎã¤Ë¤¢¤ë¤è¤¦¤Ë¡¢¸Æ¤Ó½Ð¤·Â¦¤ÏÊÖ¤µ¤ì¤¿Ê¸»úÎó¤ò +.BR free (3) +¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.in +4n +.nf + +char *p; +int n; + +errno = 0; +n = scanf("%a[a-z]", &p); +if (n == 1) { + printf("read: %s\\n", p); + free(p); +} else if (errno != 0) { + perror("scanf"); +} else { + fprintf(stderr, "No matching characters\\n"): +} +.fi +.in +.PP +¾åµ­¤ÎÎã¤Ë¤¢¤ë¤è¤¦¤Ë¡¢ +.BR scanf () +¤¬Ê¸»úÎó¤ÎÆɤ߹þ¤ß¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤À¤±¡¢ +.BR free (3) +¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢¤ë¡£ +.PP +.I "gcc -std=c99" +¤ä +.I "gcc -D_ISOC99_SOURCE" +¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +.RB ( _GNU_SOURCE +¤âƱ»þ¤Ë»ØÄꤷ¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢ +.B a +½¤¾þ»Ò¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +¾åµ­¤Î¾ì¹ç¡¢ +.B a +¤Ï (¾å½Ò¤ÎÄ̤ê) ÉâÆ°¾®¿ôÅÀ¿ô¤ò¼¨¤¹ÊÑ´¹»ØÄê»Ò¤È²ò¼á¤µ¤ì¤ë¡£ + +¥Ð¡¼¥¸¥ç¥ó 2.7 °Ê¹ß¤Ç¤Ï¡¢glibc ¤Ï +.B a +½¤¾þ»Ò¤ÈƱ¤¸ÌÜŪ¤Ç +.B m +½¤¾þ»Ò¤âÄ󶡤·¤Æ¤¤¤ë¡£ +.B m +½¤¾þ»Ò¤Ï°Ê²¼¤ÎÍøÅÀ¤¬¤¢¤ë¡£ +.IP * 2 +.B %c +ÊÑ´¹»ØÄê»Ò¤Ë¤âŬÍѤǤ­¤ë (Î㤨¤Ð +.BR %3mc )¡£ +.IP * +ÉâÆ°¾®¿ôÅÀÊÑ´¹»ØÄê»Ò¤È¤·¤Æ¤Î +.B %a +¤È¤Îʶ¤é¤ï¤·¤µ¤¬Èò¤±¤é¤ì¤ë (¤Þ¤¿ +.I "gcc -std=c99" +¤Ê¤É¤Î±Æ¶Á¤âÈò¤±¤é¤ì¤ë)¡£ +.IP * +POSIX.1 ɸ½à¤Î¼¡¤Î²þÄûÈǤǵ¬Äꤵ¤ì¤ë¡£ +.SH ¥Ð¥° +Á´¤Æ¤Î´Ø¿ô¤Ï¡¢´°Á´¤Ë C89 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£¤·¤«¤· +ÄÉ²Ã¤Ç +.B q +¤È +.B a +»ØÄê»Ò¤¬Ä󶡤µ¤ì¤Æ¤ª¤ê¡¢Æ±ÍÍ¤Ë +.B L +¤È +.B l +»ØÄê»Ò¤ÎÉÕ²ÃŪ¤Ê¿¶¤ëÉñ¤¤¤â¤¢¤ë¡£¸å¼Ô¤Ï¡¢ +C89 ¤ÇÄêµÁ¤µ¤ì¤¿»ØÄê»Ò¤Î¿¶¤ëÉñ¤¤¤òÊѹ¹¤¹¤ë¤â¤Î¤Ê¤Î¤Ç¡¢ +¥Ð¥°¤È¤ß¤Ê¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +ANSI C ¤ÇÄêµÁ¤µ¤ì¤¿·¿½¤¾þ»Ò¤ÈÊÑ´¹»ØÄê»Ò¤ÎÁȤ߹ç¤ï¤»¤ÎÃæ¤Ë¤Ï +°ÕÌ£¤ò¤Ê¤µ¤Ê¤¤¤â¤Î¤¬¤¢¤ë +(Î㤨¤Ð¡¢ +.BR "%Ld" )¡£ +¤³¤ì¤é¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +Linux ¾å¤Ç¤Ï¤Ï¤Ã¤­¤ê¤ÈÄêµÁ¤µ¤ì¤¿¿¶¤ëÉñ¤¤¤ò¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¤¬¡¢ +¾¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤âƱÍͤˤʤäƤ¤¤ë¤È¤Ï¸Â¤é¤Ê¤¤¡£ +¤½¤ì¤æ¤¨¤Ë¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢ +ANSI C ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤½¤¾þ»Ò¤ò»ÈÍѤ·¤¿Êý¤¬Îɤ¤¡£ +¤¹¤Ê¤ï¤Á¡¢ +\fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP +ÊÑ´¹¤ä +.B ll +¤ÈÁȤ߹ç¤ï¤»¤ë¾ì¹ç¤Ë¤Ï¡¢ +.B L +¤ÎÂå¤ï¤ê¤Ë +.B q +¤ò»ÈÍѤ·¤¿Êý¤¬Îɤ¤¡£ +.PP +.B q +¤Î»ÈÍÑÊýË¡¤Ï 4.4BSD ¤ÈƱ¤¸¤Ç¤Ï¤Ê¤¤¡£ +4.4BSD ¤Ç¤Ï +.B q +¤Ï +.B L +¤ÈƱÅù¤ËÉâÆ°¾®¿ô¤ÎÊÑ´¹¤Ë»ÈÍѤµ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getc (3), +.BR printf (3) +.BR setlocale (3), +.BR strtod (3), +.BR strtol (3), +.BR strtoul (3), diff --git a/release/man3/sched_getcpu.3 b/release/man3/sched_getcpu.3 new file mode 100644 index 00000000..7fff6f89 --- /dev/null +++ b/release/man3/sched_getcpu.3 @@ -0,0 +1,88 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 +.\" +.TH SCHED_GETCPU 3 2009-12-08 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sched_getcpu \- ¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë CPU ¤òÃΤë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include + +.B int sched_getcpu(void); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR sched_getcpu (): +_BSD_SOURCE || _SVID_SOURCE +.SH ÀâÌÀ +.BR sched_getcpu () +¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬¸½ºß¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë CPU ¤ÎÈÖ¹æ¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR sched_getcpu () +¤ÏÈóÉé¤Î CPU ÈÖ¹æ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOSYS +¤³¤Î¥«¡¼¥Í¥ë¤Ç¤Ï +.BR getcpu (2) +¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤Î´Ø¿ô¤Ï glibc 2.6 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ½àµò +.BR sched_getcpu () +¤Ï glibc ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.in +4n +.nf + +cpu = sched_getcpu(); + +.fi +.in +¤Ï¡¢°Ê²¼¤Î +.BR getcpu (2) +¤Î¸Æ¤Ó½Ð¤·¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.in +4n +.nf + +int c, s; +s = getcpu(&c, NULL, NULL); +cpu = (s == -1) ? s : c; +.fi +.in +.SH ´ØÏ¢¹àÌÜ +.BR getcpu (2) diff --git a/release/man3/seekdir.3 b/release/man3/seekdir.3 new file mode 100644 index 00000000..4ce555ea --- /dev/null +++ b/release/man3/seekdir.3 @@ -0,0 +1,89 @@ +.\" 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 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 +.\" +.TH SEEKDIR 3 2009-03-11 "" "Linux Programmer's Manual" +.SH ̾Á° +seekdir \- ¼¡¤Î readdir() ¸Æ¤Ó½Ð¤·¤Î¤¿¤á¤Ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥àÃæ¤Î°ÌÃÖ¤ò +ÀßÄꤹ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void seekdir(DIR *" dirp ", long " offset ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR seekdir (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.SH ÀâÌÀ +.BR seekdir () +´Ø¿ô¤Ï¡¢¼¡¤Î +.BR readdir (3) +¸Æ¤Ó½Ð¤·¤Î³«»Ï°ÌÃ֤Ǥ¢¤ë¡¢ +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¤ÎÃæ¤Ç¤Î°ÌÃÖ¤òÀßÄꤹ¤ë¡£ +.BR seekdir () +¤Ï +.BR telldir (3) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë +.I offset +¤È¤È¤â¤Ë»ÈÍѤµ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR seekdir () +´Ø¿ô¤Ï¡¢ÃͤòÊÖ¤µ¤Ê¤¤¡£ +.SH ½àµò +4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +¥Ð¡¼¥¸¥ç¥ó 2.1.1 °ÊÁ°¤Î glibc ¤Ç¤Ï¡¢ +.I offset +°ú¤­¿ô¤Î·¿¤Ï +.I off_t +¤Ç¤¢¤Ã¤¿¡£ +POSIX.1-2001 ¤Ç¤Ï +.I long +¤Èµ¬Äꤵ¤ì¤Æ¤ª¤ê¡¢glibc 2.1.2 °Ê¹ß¤Ç¤Ï +.I long +¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR lseek (2), +.BR closedir (3), +.BR opendir (3), +.BR readdir (3), +.BR rewinddir (3), +.BR scandir (3), +.BR telldir (3) diff --git a/release/man3/sem_close.3 b/release/man3/sem_close.3 new file mode 100644 index 00000000..b86527b6 --- /dev/null +++ b/release/man3/sem_close.3 @@ -0,0 +1,70 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_CLOSE 3 2006-03-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sem_close \- ̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤ò¥¯¥í¡¼¥º¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_close(sem_t *" sem ); +.fi +.sp +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR sem_close () +¤Ï +.I sem +¤¬»²¾È¤¹¤ë̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤ò¥¯¥í¡¼¥º¤·¡¢ +¤³¤Î¥»¥Þ¥Õ¥©ÍѤ˸ƤӽФ·¸µ¥×¥í¥»¥¹¤Ë¥·¥¹¥Æ¥à¤¬³ä¤êÅö¤Æ¤Æ¤¤¤¿ +¥ê¥½¡¼¥¹¤ò²òÊü¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_close () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I sem +¤ÏÍ­¸ú¤Ê¥»¥Þ¥Õ¥©¤Ç¤Ï¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +¥ª¡¼¥×¥ó¤µ¤ì¤¿¤¹¤Ù¤Æ¤Î̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤Ï¡¢¥×¥í¥»¥¹½ªÎ»»þ¡¢¤â¤·¤¯¤Ï +.BR execve (2) +¼Â¹Ô»þ¤Ë¼«Æ°Åª¤Ë¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sem_getvalue (3), +.BR sem_open (3), +.BR sem_post (3), +.BR sem_unlink (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/release/man3/sem_destroy.3 b/release/man3/sem_destroy.3 new file mode 100644 index 00000000..35791b7c --- /dev/null +++ b/release/man3/sem_destroy.3 @@ -0,0 +1,81 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_DESTROY 3 2006-03-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sem_destroy \- ̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤òÇË´þ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_destroy(sem_t *" sem ); +.fi +.sp +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR sem_destroy () +¤Ï +.I sem +¤¬»Ø¤¹¥¢¥É¥ì¥¹¤Ë¤¢¤ë̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤òÇË´þ¤¹¤ë¡£ + +.BR sem_destroy () +¤ò»È¤Ã¤ÆÇË´þ¤¹¤ë¤Î¤Ï¡¢ +.BR sem_init (3) +¤Ç½é´ü²½¤·¤¿¥»¥Þ¥Õ¥©¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +¾¤Î¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤¬ +.RB ( sem_wait (3) +¤Ç) ÂÔ¤Á¾õÂ֤ˤʤäƤ¤¤ë¥»¥Þ¥Õ¥©¤òÇË´þ¤·¤¿¾ì¹ç¤ÎµóÆ°¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +¤¹¤Ç¤ËÇË´þ¤µ¤ì¤¿¥»¥Þ¥Õ¥©¤ò¡¢ +.BR sem_init (3) +¤ò»È¤Ã¤ÆºÆ½é´ü²½¤µ¤ì¤ëÁ°¤Ë»ÈÍѤ·¤¿¾ì¹ç¡¢¤½¤Î·ë²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_destroy () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I sem +¤ÏÍ­¸ú¤Ê¥»¥Þ¥Õ¥©¤Ç¤Ï¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤Ï¡¢¤½¤Î¥»¥Þ¥Õ¥©¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¥á¥â¥ê¤¬²òÊü¤µ¤ì¤ëÁ°¤Ë¡¢ +.BR sem_destroy () +¤ò»È¤Ã¤ÆÇË´þ¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£¤³¤ì¤ò¹Ô¤ï¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¼ÂÁõ¤Ë¤è¤Ã¤Æ¤Ï +¥ê¥½¡¼¥¹¤Î¥ê¡¼¥¯¤¬µ¯¤³¤ê¤¨¤ë¡£ +.\" NPTL ¤Ç¤Ï¥ê¡¼¥¯¤Ïµ¯¤³¤é¤Ê¤¤¡£sem_destroy () ¤Ï²¿¤â¤·¤Ê¤¤¤À¤±.. +.SH ´ØÏ¢¹àÌÜ +.BR sem_init (3), +.BR sem_post (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/release/man3/sem_getvalue.3 b/release/man3/sem_getvalue.3 new file mode 100644 index 00000000..a8832bf7 --- /dev/null +++ b/release/man3/sem_getvalue.3 @@ -0,0 +1,77 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_GETVALUE 3 2006-03-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sem_getvalue \- ¥»¥Þ¥Õ¥©¤ÎÃͤò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_getvalue(sem_t *" sem ", int *" sval ); +.fi +.sp +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR sem_getvalue () +¤Ï¡¢ +.I sem +¤¬»Ø¤¹¥»¥Þ¥Õ¥©¤Î¸½ºß¤ÎÃͤò +.I sval +¤Ç»Ø¤¹À°¿ô¤Ë³ÊǼ¤¹¤ë¡£ + +POSIX.1-2001 ¤Ë¤è¤ë¤È¡¢ +1¤Ä°Ê¾å¤Î¥×¥í¥»¥¹¤«¥¹¥ì¥Ã¥É¤¬ +.BR sem_wait (3) +¤Ç¥»¥Þ¥Õ¥©¤Î¥í¥Ã¥¯ÂÔ¤Á¤ÇÄä»ß¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.I sval +¤ÇÊÖ¤µ¤ì¤ëÃÍ¤Ï 0 ¤â¤·¤¯¤ÏÉé¤ÎÃͤΤ¤¤º¤ì¤«¤È¤Ê¤ë¡£ +Éé¤ÎÃͤξì¹ç¡¢¤½¤ÎÀäÂÐÃÍ¤Ï +.BR sem_wait (3) +¤Ç¸½ºßÄä»ß¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤«¥¹¥ì¥Ã¥É¤Î¹ç·×¿ô¤ËÅù¤·¤¤¡£ +Linux ¤ÏÁ°¼Ô¤ÎÆ°ºî (0 ¤òÊÖ¤¹Æ°ºî) ¤òºÎÍѤ·¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_getvalue () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I sem +¤ÏÍ­¸ú¤Ê¥»¥Þ¥Õ¥©¤Ç¤Ï¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.BR sem_getvalue () +¤¬ÊÖ¤ë¤È¤­¤Ë¤Ï¡¢¤¹¤Ç¤Ë¥»¥Þ¥Õ¥©¤ÎÃͤÏÊѲ½¤·¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sem_post (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/release/man3/sem_init.3 b/release/man3/sem_init.3 new file mode 100644 index 00000000..68048006 --- /dev/null +++ b/release/man3/sem_init.3 @@ -0,0 +1,104 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_INIT 3 2008-07-27 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sem_init \- ̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤ò½é´ü²½¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_init(sem_t *" sem ", int " pshared ", unsigned int " value ); +.fi +.sp +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR sem_init () +¤Ï¡¢ +.I sem +¤¬»Ø¤¹¥¢¥É¥ì¥¹¤Ë¤¢¤ë̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤ò½é´ü²½¤¹¤ë¡£ +.I value +°ú¤­¿ô¤Ï¤½¤Î¥»¥Þ¥Õ¥©¤Î½é´üÃͤò»ØÄꤹ¤ë¡£ + +.I pshared +°ú¤­¿ô¤Ï¡¢¤³¤Î¥»¥Þ¥Õ¥©¤¬¥×¥í¥»¥¹Æâ¤Î¥¹¥ì¥Ã¥É´Ö¤Ç¶¦Í­¤µ¤ì¤ë¤Î¤«¡¢ +¥×¥í¥»¥¹´Ö¤Ç¶¦Í­¤µ¤ì¤ë¤Î¤«¡¢¤ò¼¨¤¹¡£ + +.I pshared +¤¬ 0 ¤Î¾ì¹ç¡¢¥»¥Þ¥Õ¥©¤Ï¥×¥í¥»¥¹Æâ¤Î¥¹¥ì¥Ã¥É´Ö¤Ç¶¦Í­¤µ¤ì¤ë¡£ +¥»¥Þ¥Õ¥©¤Ï¤¹¤Ù¤Æ¤Î¥¹¥ì¥Ã¥É¤«¤é»²¾È²Äǽ¤Ê¥¢¥É¥ì¥¹¤ËÇÛÃÖ¤¹¤Ù¤­¤Ç¤¢¤ë +(Î㤨¤Ð¡¢Âç°èÊÑ¿ô¤ä¡¢¥Ò¡¼¥×¾å¤ËưŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ÊÑ¿ô¤Ê¤É)¡£ + +.I pshared +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢¥»¥Þ¥Õ¥©¤Ï¥×¥í¥»¥¹´Ö¤Ç¶¦Í­¤µ¤ì¤ë¡£¥»¥Þ¥Õ¥©¤Ï +¶¦Í­¥á¥â¥êÎΰè¤ËÇÛÃÖ¤¹¤Ù¤­¤Ç¤¢¤ë +.RB ( shm_open (3), +.BR mmap (2), +.BR shmget (2) +»²¾È)¡£ +.RB ( fork (2) +¤ÇÀ¸À®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥á¥â¥ê¥Þ¥Ã¥Ô¥ó¥°¤ò·Ñ¾µ¤¹¤ë¤¿¤á¡¢ +»Ò¥×¥í¥»¥¹¤â¥»¥Þ¥Õ¥©¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£) +¶¦Í­¥á¥â¥êÎΰè¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¥×¥í¥»¥¹¤Ê¤é¤Ð¡¢¤É¤Î¥×¥í¥»¥¹¤Ç¤â +.BR sem_post (3) +¤ä +.BR sem_wait (3) +¤Ê¤É¤ò»È¤Ã¤Æ¥»¥Þ¥Õ¥©¤òÁàºî¤Ç¤­¤ë¡£ + +¤¹¤Ç¤Ë½é´ü²½ºÑ¤Î¥»¥Þ¥Õ¥©¤ò½é´ü²½¤·¤¿¾ì¹ç¤ÎµóÆ°¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_init () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I value +¤¬ +.B SEM_VALUE_MAX +¤òĶ¤¨¤Æ¤¤¤ë¡£ +.TP +.B ENOSYS +.I pshared +¤¬ 0 °Ê³°¤À¤¬¡¢¥·¥¹¥Æ¥à¤¬¥×¥í¥»¥¹¶¦Í­¥»¥Þ¥Õ¥©¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤ +.RB ( sem_overview (7) +»²¾È)¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +̯¤Ê¤³¤È¤Ë¡¢POSIX.1-2001 ¤Ï +.BR sem_init () +¤¬À®¸ù¤·¤¿¾ì¹ç¤ËÊÖ¤¹¤Ù¤­Ãͤòµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£ +POSIX.1-2008 ¤Ç¤Ï¤³¤ì¤¬½¤Àµ¤µ¤ì¡¢À®¸ù»þ¤Ë¤Ï 0 ¤òÊÖ¤¹¤³¤È¤¬µ¬Äꤵ¤ì¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sem_destroy (3), +.BR sem_post (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/release/man3/sem_open.3 b/release/man3/sem_open.3 new file mode 100644 index 00000000..d40650f1 --- /dev/null +++ b/release/man3/sem_open.3 @@ -0,0 +1,176 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.19 +.\" +.TH SEM_OPEN 3 2009-02-20 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sem_open \- ̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤ò½é´ü²½¤·¡¢¥ª¡¼¥×¥ó¤¹¤ë +.SH ½ñ¼° +.nf +.BR "#include " " /* For O_* constants */" +.BR "#include " " /* For mode constants */" +.B #include +.sp +.BI "sem_t *sem_open(const char *" name ", int " oflag ); +.BI "sem_t *sem_open(const char *" name ", int " oflag ", " +.BI " mode_t " mode ", unsigned int " value ); +.fi +.sp +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR sem_open () +¤Ï¡¢¿·µ¬¤Î POSIX ¥»¥Þ¥Õ¥©¤òºîÀ®¤¹¤ë¤«¡¢´û¸¤Î¥»¥Þ¥Õ¥©¤Î¥ª¡¼¥×¥ó¤ò¹Ô¤¦¡£ +¥»¥Þ¥Õ¥©¤Ï +.I name +¤Ç¼±Ê̤µ¤ì¤ë¡£ +.I name +¤Î¹½À®¤Î¾ÜºÙ¤Ï +.BR sem_overview (7) +¤ò»²¾È¡£ + +.I oflag +°ú¤­¿ô¤Ë¤Ï¡¢ +.BR sem_open () +¤ÎÆ°ºî¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°¤ò»ØÄꤹ¤ë +(oflag ¤ÎÃͤÎÄêµÁ¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ë¤è¤êÆÀ¤é¤ì¤ë)¡£ +.I oflag +¤Ë +.B O_CREAT +¤¬»ØÄꤵ¤ì¤ë¤È¡¢¤Þ¤À¸ºß¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï¤½¤Î¥»¥Þ¥Õ¥©¤¬ºîÀ®¤µ¤ì¤ë¡£ +¥»¥Þ¥Õ¥©¤Î½êÍ­¼Ô (¥æ¡¼¥¶ ID)¡¢¥°¥ë¡¼¥×½êÍ­¸¢ (¥°¥ë¡¼¥× ID) ¤Ë¤Ï¡¢ +¤½¤ì¤¾¤ì¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID¡¢¼Â¸ú GID ¤¬ÀßÄꤵ¤ì¤ë¡£ +.\" ¼ÂºÝ¤Ï¡¢Linux ¤Ç¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID ¤¬»ÈÍѤµ¤ì¤ë¡£ +.I oflag +¤Ë +.B O_CREAT +¤È +.B O_EXCL +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢»ØÄꤵ¤ì¤¿Ì¾Á° +.I name +¤Î¥»¥Þ¥Õ¥©¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¤È¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +.I oflag +¤Ë +.B O_CREAT +¤ò»ØÄꤹ¤ë¾ì¹ç¡¢¤µ¤é¤Ë°ú¤­¿ô¤¬ 2 ¤ÄɬÍפǤ¢¤ë¡£ +.I mode +°ú¤­¿ô¤Ï¡¢ +.BR open (2) +¤ÈƱ¤¸¤è¤¦¤Ë¡¢¿·¤·¤¤¥»¥Þ¥Õ¥©¤ËÀßÄꤵ¤ì¤ë¥¢¥¯¥»¥¹µö²Ä (permission) ¤ò +»ØÄꤹ¤ë¡£µö²ÄÀßÄê¤Ï¥×¥í¥»¥¹¤Î umask ¤Ç¥Þ¥¹¥¯¤µ¤ì¤ë +(µö²Ä¥Ó¥Ã¥È¤Î¥·¥ó¥Ü¥ëÄêµÁ¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ë¤è¤êÆÀ¤é¤ì¤ë)¡£ +¥»¥Þ¥Õ¥©¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤¹¤ë¥æ¡¼¥¶¤Ï¡¢Æɤ߽Ф·µö²Ä¤È½ñ¤­¹þ¤ßµö²Ä¤Î +ξÊý¤òÆÀ¤ëɬÍפ¬¤¢¤ë¡£ +.I value +°ú¤­¿ô¤Ï¿·¤·¤¤¥»¥Þ¥Õ¥©¤Î½é´üÃͤò»ØÄꤹ¤ë¡£ +.B O_CREAT +¤¬»ØÄꤵ¤ì¡¢»ØÄꤷ¤¿Ì¾Á° +.I name +¤Î¥»¥Þ¥Õ¥©¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢ +.I mode +¤È +.I value +¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_open () +¤Ï¿·¤·¤¤¥»¥Þ¥Õ¥©¤Î¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£ +¤³¤Î¥¢¥É¥ì¥¹¤Ï¾¤Î¥»¥Þ¥Õ¥©´ØÏ¢¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë»ÈÍѤµ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR sem_open () +¤Ï +.B SEM_FAILED +¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¤½¤Î¥»¥Þ¥Õ¥©¤¬Â¸ºß¤¹¤ë¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¤Ë¤Ï¤½¤Î¥»¥Þ¥Õ¥©¤ò¥ª¡¼¥×¥ó¤¹¤ë +µö²Ä¤¬¤Ê¤¤¡£ +.TP +.B EEXIST +.I oflag +¤Ë +.B O_CREAT +¤È +.B O_EXCL +¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¤¬¡¢ +.I name +¤È¤¤¤¦Ì¾Á°¤Î¥»¥Þ¥Õ¥©¤Ï¤¹¤Ç¤Ë¸ºß¤¹¤ë¡£ +.TP +.B EINVAL +.I value +¤¬ +.B SEM_VALUE_MAX +¤è¤ê¤âÂ礭¤¤¡£ +.TP +.B EINVAL +.I name +¤¬ "/" ¤À¤±¤Ç¹½À®¤µ¤ì¡¢¤½¤Î¸å¤í¤Ë¾¤Îʸ»ú¤¬Â³¤¤¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B EMFILE +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¿ô¤¬¤¹¤Ç¤Ë¤½¤Î¥×¥í¥»¥¹¤Ë¤ª¤±¤ë¾å¸Â¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENAMETOOLONG +.I name +¤¬Ä¹¤¹¤®¤ë¡£ +.TP +.B ENFILE +¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ëÁí¿ô¤¬¥·¥¹¥Æ¥àÁ´ÂΤǤξå¸Â¤Ë㤷¤Æ¤¤¤ë¡£ +.TP +.B ENOENT +.I oflag +¤Ë +.B O_CREAT +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤ª¤é¤º¡¢ +.I name +¤È¤¤¤¦Ì¾Á°¤Î¥»¥Þ¥Õ¥©¤â¸ºß¤·¤Ê¤¤¡£ +¤Þ¤¿¤Ï¡¢ +.\" this error can occur if we have a name of the (nonportable) form +.\" /dir/name, and the directory /dev/shm/dir does not exist. +.B O_CREAT +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢ +.I name +¤¬Å¬ÀڤʷÁ¼°¤Ç¤Ï¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR sem_close (3), +.BR sem_getvalue (3), +.BR sem_post (3), +.BR sem_unlink (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/release/man3/sem_post.3 b/release/man3/sem_post.3 new file mode 100644 index 00000000..d035ff06 --- /dev/null +++ b/release/man3/sem_post.3 @@ -0,0 +1,76 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_POST 3 2009-03-30 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sem_post \- ¥»¥Þ¥Õ¥©¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_post(sem_t *" sem ); +.fi +.sp +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR sem_post () +¤Ï¡¢ +.I sem +¤¬»Ø¤¹¥»¥Þ¥Õ¥©¤ÎÃͤò 1 Áý¤ä¤¹ (¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë)¡£¤½¤Î·ë²Ì¡¢ +¥»¥Þ¥Õ¥©¤ÎÃÍ¤Ï 0 ¤è¤êÂ礭¤ÊÃͤËÊѲ½¤·¡¢ +.BR sem_wait (3) +¤ÇÄä»ß¤·¤Æ¤¤¤ëÊÌ¤Î¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤¬¸Æ¤Óµ¯¤³¤µ¤ì¡¢ +¥»¥Þ¥Õ¥©¤ò¥í¥Ã¥¯¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_post () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢¥»¥Þ¥Õ¥©¤ÎÃͤÏÊѹ¹¤»¤º¤Ë¡¢ \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I sem +¤ÏÍ­¸ú¤Ê¥»¥Þ¥Õ¥©¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B EOVERFLOW +.\" Added in POSIX.1-2008 TC1 (Austin Interpretation 213) +°ì¤Ä¤Î¥»¥Þ¥Õ¥©¤Ç»ÈÍѤǤ­¤ëºÇÂçÃͤòĶ¤¨¤Æ¤·¤Þ¤¦¤È¤³¤í¤Ç¤¢¤Ã¤¿¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.BR sem_post () +¤Ï async-signal-safe ¤Ç¤¢¤ë¡£ +¤Ä¤Þ¤ê¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÃæ¤Ç¤â°ÂÁ´¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH Îã +.BR sem_wait (3) +»²¾È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sem_getvalue (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/release/man3/sem_unlink.3 b/release/man3/sem_unlink.3 new file mode 100644 index 00000000..a23d7365 --- /dev/null +++ b/release/man3/sem_unlink.3 @@ -0,0 +1,74 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_UNLINK 3 2006-03-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sem_unlink \- ̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤òºï½ü¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_unlink(const char *" name ); +.fi +.sp +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR sem_unlink () +¤Ï¡¢ +.I name +¤Ç»²¾È¤µ¤ì¤ë̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤òºï½ü¤¹¤ë¡£ +¥»¥Þ¥Õ¥©¤Î̾Á°¤Ïľ¤Á¤Ëºï½ü¤µ¤ì¤ë¡£ +¤³¤Î¥»¥Þ¥Õ¥©¤ò¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¾¤Î¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤¬¥»¥Þ¥Õ¥©¤ò +ÊĤ¸¤Æ½é¤á¤Æ¥»¥Þ¥Õ¥©¤Îºï½ü¤¬¹Ô¤ï¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR sem_unlink () +¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¸Æ¤Ó½Ð¤·¸µ¤Ë¤Ï¤³¤Î¥»¥Þ¥Õ¥©¤òºï½ü¤¹¤ëµö²Ä¤¬¤Ê¤¤¡£ +.TP +.B ENAMETOOLONG +.I name +¤¬Ä¹¤¹¤®¤ë¡£ +.TP +.B ENOENT +»ØÄꤵ¤ì¤¿Ì¾Á° +.I name +¤Î¥»¥Þ¥Õ¥©¤¬Â¸ºß¤·¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR sem_getvalue (3), +.BR sem_open (3), +.BR sem_post (3), +.BR sem_wait (3), +.BR sem_overview (7) diff --git a/release/man3/sem_wait.3 b/release/man3/sem_wait.3 new file mode 100644 index 00000000..f8339afc --- /dev/null +++ b/release/man3/sem_wait.3 @@ -0,0 +1,271 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" +.TH SEM_WAIT 3 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sem_wait, sem_timedwait, sem_trywait \- ¥»¥Þ¥Õ¥©¤ò¥í¥Ã¥¯¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sem_wait(sem_t *" sem ); +.sp +.BI "int sem_trywait(sem_t *" sem ); +.sp +.BI "int sem_timedwait(sem_t *" sem ", const struct timespec *" abs_timeout ); +.fi +.sp +.sp +\fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR sem_timedwait (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.SH ÀâÌÀ +.BR sem_wait () +¤Ï +.I sem +¤¬»Ø¤¹¥»¥Þ¥Õ¥©¤ÎÃͤò 1 ¸º¤é¤¹ (¥í¥Ã¥¯¤¹¤ë)¡£ +¥»¥Þ¥Õ¥©¤ÎÃͤ¬ 0 ¤è¤êÂ礭¤¤¾ì¹ç¡¢¸º»»¤¬¼Â¹Ô¤µ¤ì¡¢´Ø¿ô¤Ïľ¤Á¤ËÉüµ¢¤¹¤ë¡£ +¥»¥Þ¥Õ¥©¤Î¸½ºßÃͤ¬ 0 ¤Î¾ì¹ç¤Ë¤Ï¡¢¸º»»¤ò¼Â¹Ô¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë +(¤Ä¤Þ¤ê¡¢¥»¥Þ¥Õ¥©¤ÎÃͤ¬ 0 ¤è¤êÂ礭¤ÊÃͤˤʤë) ¤Þ¤Ç¡¢¤â¤·¤¯¤Ï +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤·¤¬ÃæÃǤµ¤ì¤ë¤Þ¤Ç¡¢ +´Ø¿ô¸Æ¤Ó½Ð¤·¤ÏÄä»ß (block) ¤¹¤ë¡£ + +.BR sem_trywait () +¤Ï +.BR sem_wait () +¤ÈƱ¤¸¤À¤¬¡¢¥»¥Þ¥Õ¥©Ãͤθº»»¤ò¤¹¤°¤Ë¼Â¹Ô¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¡¢ +Ää»ß (block) ¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¥¨¥é¡¼¤ÇÉüµ¢¤¹¤ë +.RI ( errno +¤Ë +.B EAGAIN +¤¬¥»¥Ã¥È¤µ¤ì¤ë) ÅÀ¤¬°Û¤Ê¤ë¡£ + +.BR sem_timedwait () +¤Ï +.BR sem_wait () +¤ÈƱ¤¸¤À¤¬¡¢¥»¥Þ¥Õ¥©Ãͤθº»»¤ò¤¹¤°¤Ë¼Â¹Ô¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë +´Ø¿ô¸Æ¤Ó½Ð¤·¤¬Ää»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤ò +.I abs_timeout +¤Ç»ØÄꤹ¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +.I abs_timeout +°ú¤­¿ô¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥È»þ¹ï¤ò»ØÄꤹ¤ë¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤³¤Î¹½Â¤ÂΤˤϡ¢¥¿¥¤¥à¥¢¥¦¥È»þ¹ï¤ò»þ¹ïµª¸µ (Epoch; +1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤Î +·Ð²á»þ´Ö (ÉáܥʥÎÉÃ) ¤Ç»ØÄꤹ¤ë¡£ +¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: + +.nf +.in +4n +struct timespec { + time_t tv_sec; /* Seconds */ + long tv_nsec; /* Nanoseconds [0 .. 999999999] */ +}; +.in +.fi +.PP +´Ø¿ô¸Æ¤Ó½Ð¤·»þÅÀ¤Ç¤¹¤Ç¤Ë¥¿¥¤¥à¥¢¥¦¥È¤Ë»ØÄꤷ¤¿»þ¹ï¤¬²á¤®¤Æ¤ª¤ê¡¢ +¤«¤Ä¥»¥Þ¥Õ¥©¤ò¤¹¤°¤Ë¥í¥Ã¥¯¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +.BR sem_timedwait () +¤Ï¥¿¥¤¥à¥¢¥¦¥È¥¨¥é¡¼ +.RI ( errno +¤Ë +.B ETIMEDOUT +¤¬¥»¥Ã¥È¤µ¤ì¤ë) ¤Ç¼ºÇÔ¤¹¤ë¡£ + +¥»¥Þ¥Õ¥©Áàºî¤¬¤¹¤°¤Ë¼Â¹Ô¤Ç¤­¤ë¤È¤­¤Ï¡¢ +.I abs_timeout +¤¬¤É¤ó¤ÊÃͤǤ¢¤Ã¤Æ¤â +.BR sem_timedwait () +¤¬¼ºÇÔ¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£¤µ¤é¤Ë¤¤¤¦¤È¡¢¤³¤Î¾ì¹ç¤Ë¤Ï +.I abs_timeout +¤ÎÀµÅöÀ­¤Î¸¡ºº¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢¥»¥Þ¥Õ¥©¤ÎÃͤòÊѹ¹¤»¤º¤Ë¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINTR +¸Æ¤Ó½Ð¤·¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤êÃæÃǤµ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +.I sem +¤ÏÍ­¸ú¤Ê¥»¥Þ¥Õ¥©¤Ç¤Ê¤¤¡£ +.PP +.BR sem_trywait () +¤Î¾ì¹ç¤Ë¤Ï¡¢¾åµ­¤Ë²Ã¤¨¤Æ°Ê²¼¤Î¥¨¥é¡¼¤âµ¯¤³¤ë¡£ +.TP +.B EAGAIN +Ää»ß (block) ¤»¤º¤Ë¥í¥Ã¥¯Áàºî¤ò´°Î»¤Ç¤­¤Ê¤«¤Ã¤¿ (¤Ä¤Þ¤ê¡¢ +¥»¥Þ¥Õ¥©¤Î¸½ºß¤ÎÃͤ¬ 0 ¤Ç¤¢¤Ã¤¿)¡£ +.PP +.BR sem_timedwait () +¤Î¾ì¹ç¡¢°Ê²¼¤Î¥¨¥é¡¼¤âµ¯¤³¤ë¡£ +.TP +.B EINVAL +.I abs_timeout.tv_nsecs +¤ÎÃͤ¬ 0 ̤Ëþ¡¢¤â¤·¤¯¤Ï 1,000,000,000 °Ê¾å¤Ç¤¢¤ë¡£ +.TP +.B ETIMEDOUT +¥»¥Þ¥Õ¥©¤Î¥í¥Ã¥¯¤ËÀ®¸ù¤¹¤ëÁ°¤Ë»þ´ÖÀÚ¤ì¤È¤Ê¤Ã¤¿¡£ +.\" POSIX.1-2001 ¤Ç¤Ï¥¨¥é¡¼¤È¤·¤Æ EDEADLK ¤âÍÑ°Õ¤·¤Æ¤¤¤ë¡£ +.\" ¤³¤ì¤Ï¥Ç¥Ã¥É¥í¥Ã¥¯¾ò·ï¤ò¸¡½Ð¤·¤¿¤³¤È¤ò¼¨¤¹¤â¤Î¤À¤¬¡¢ +.\" Linux ¤ÇȯÀ¸¤¹¤ë¤³¤È¤Ï¤Ê¤¤(?) +POSIX.1-2001. +.SH Ãí°Õ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ï¡¢ +.BR sigaction (2) +¤Î +.B SA_RESTART +¥Õ¥é¥°¤ò»ÈÍѤ·¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ë´Ø¤ï¤é¤º¡¢¤³¤ì¤é¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤¬ +Ää»ß¤·¤Æ¤¤¤ë¾ì¹ç¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê¾ï¤ËÃæÃǤµ¤ì¤ë¡£ +.\" sem_wait() ¤Ï¾¤Î¤Û¤È¤ó¤É¤Î¼ÂÁõ¤Ç¤Ï¾ï¤ËÃæÃǤµ¤ì¤ë¤¬¡¢ +.\" FreeBSD 5.4 ¤Ç¤Ï SA_RESTART ¤ò»ØÄꤷ¤Æ¤ª¤¯¤È¼Â¹Ô¤¬ºÆ³«¤µ¤ì¤ë¡£ +.SH Îã +.PP +°Ê²¼¤Ë¼¨¤¹ (¤Á¤ç¤Ã¤È¤·¤¿) ¥×¥í¥°¥é¥à¤Ï̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤ÎÁàºî¤ò¹Ô¤¦¡£ +¥×¥í¥°¥é¥à¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ò 2 ¤Ä¼è¤ë¡£ +ºÇ½é¤Î°ú¤­¿ô¤Ë¤Ï¡¢ +.B SIGALRM +¥·¥°¥Ê¥ë¤òÀ¸À®¤¹¤ë¤¿¤á¤Î¥¢¥é¡¼¥à¥¿¥¤¥Þ¡¼¤ÎÀßÄê¤Ë»È¤ï¤ì¤ëÃͤò +ÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£¤³¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ï¡¢ +.I main() +Æâ¤Ç +.BR sem_timedwait () +¤ò»È¤Ã¤ÆÂԤäƤ¤¤ë¥»¥Þ¥Õ¥©¤ò¡¢ +.BR sem_post (3) +¤ò»È¤Ã¤Æ²Ã»»¤¹¤ë¡£ +2ÈÖÌܤΰú¤­¿ô¤Ë¤Ï¡¢ +.BR sem_timedwait () +¤ËÅϤ¹¥¿¥¤¥à¥¢¥¦¥È¤Þ¤Ç¤Î»þ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ + +.in +4n +.nf +.RB "$" " ./a.out 2 3" +About to call sem_timedwait() +sem_post() from handler +sem_getvalue() from handler; value = 1 +sem_timedwait() succeeded +.RB "$" " ./a.out 2 1" +About to call sem_timedwait() +sem_timedwait() timed out +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include +#include +#include +#include +#include + +sem_t sem; + +#define handle_error(msg) \\ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +static void +handler(int sig) +{ + write(STDOUT_FILENO, "sem_post() from handler\\n", 24); + if (sem_post(&sem) == \-1) { + write(STDERR_FILENO, "sem_post() failed\\n", 18); + _exit(EXIT_FAILURE); + } +} + +int +main(int argc, char *argv[]) +{ + struct sigaction sa; + struct timespec ts; + int s; + + if (argc != 3) { + fprintf(stderr, "Usage: %s \\n", + argv[0]); + exit(EXIT_FAILURE); + } + + if (sem_init(&sem, 0, 0) == \-1) + handle_error("sem_init"); + + /* Establish SIGALRM handler; set alarm timer using argv[1] */ + + sa.sa_handler = handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + if (sigaction(SIGALRM, &sa, NULL) == \-1) + handle_error("sigaction"); + + alarm(atoi(argv[1])); + + /* Calculate relative interval as current time plus + number of seconds given argv[2] */ + + if (clock_gettime(CLOCK_REALTIME, &ts) == \-1) + handle_error("clock_gettime"); + + ts.tv_sec += atoi(argv[2]); + + printf("main() about to call sem_timedwait()\\n"); + while ((s = sem_timedwait(&sem, &ts)) == \-1 && errno == EINTR) + continue; /* Restart if interrupted by handler */ + + /* Check what happened */ + + if (s == \-1) { + if (errno == ETIMEDOUT) + printf("sem_timedwait() timed out\\n"); + else + perror("sem_timedwait"); + } else + printf("sem_timedwait() succeeded\\n"); + + exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR clock_gettime (2), +.BR sem_getvalue (3), +.BR sem_post (3), +.BR sem_overview (7), +.BR time (7) diff --git a/release/man3/setaliasent.3 b/release/man3/setaliasent.3 new file mode 100644 index 00000000..d58a6d7d --- /dev/null +++ b/release/man3/setaliasent.3 @@ -0,0 +1,153 @@ +.\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Polished a bit, added a little, aeb +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Sep 5 20:44:27 JST 2004 +.\" by Yuichi SATO +.\" +.TH SETALIASENT 3 2003-09-09 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +setaliasent, endaliasent, getaliasent, getaliasent_r, getaliasbyname, getaliasbyname_r \- ¥¨¥¤¥ê¥¢¥¹¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à +.SH ½ñ¼° +.B #include +.sp +.B "void setaliasent(void);" +.sp +.B "void endaliasent(void);" +.sp +.B "struct aliasent *getaliasent(void);" +.sp +.BI "int getaliasent_r(struct aliasent *" result "," +.br +.BI " char *" buffer ", size_t " buflen ", struct aliasent **" res ); +.sp +.BI "struct aliasent *getaliasbyname(const char *" name ); +.sp +.BI "int getaliasbyname_r(const char *" name ", struct aliasent *" result , +.br +.BI " char *" buffer ", size_t " buflen ", struct aliasent **" res ); +.SH ÀâÌÀ +¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥¹¥¤¥Ã¥Á (Name Service Switch, NSS) ¤Ç +ÍøÍѲÄǽ¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î 1 ¤Ä¤È¤·¤Æ¡¢ +¥á¡¼¥ë¥¨¥¤¥ê¥¢¥¹¤òÊÝ»ý¤¹¤ë¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¤¢¤ë¡£ +(¤É¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤òÄ´¤Ù¤ë¤Ë¤Ï¡¢ +getent \-\-help ¤ò¼Â¹Ô¤¹¤ë¤³¤È¡£) +¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Ë¡¢ +6 ¤Ä¤Î´Ø¿ô¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.BR getaliasent () +´Ø¿ô¤Ï¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¼è¤ê½Ð¤·¤¿ +¥°¥ë¡¼¥×¾ðÊó¤ò´Þ¤à¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +1 ²óÌܤ˴ؿô¤¬¸Æ¤Ð¤ì¤¿¤È¤­¤Ë¤Ï¡¢ºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹; +¤½¤ì°Ê¹ß¤Ï¤½¤Î¸å¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +.PP +.BR setaliasent () +´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤ò¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀèƬ¤Ë´¬¤­Ì᤹¡£ +.PP +.BR endaliasent () +´Ø¿ô¤Ï¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +.BR getaliasent_r () +´Ø¿ô¤Ï¾åµ­¤Î´Ø¿ô¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤ¢¤ë¡£ +Í׵ᤵ¤ì¤¿¹½Â¤ÂΤÏÂè 1 °ú¤­¿ô¤Ë³ÊǼ¤µ¤ì¤ë¤¬¡¢ +¥×¥í¥°¥é¥Þ¤Ï¾¤Î°ú¤­¿ô¤âËä¤á¤Æ¤ä¤ëɬÍפ¬¤¢¤ë¡£ +½¼Ê¬¤ÊÎΰ褬Ϳ¤¨¤é¤ì¤Ê¤¤¤È¡¢¤³¤Î´Ø¿ô¤Ï¼ºÇÔ¤¹¤ë¡£ +.PP +´Ø¿ô +.BR getaliasbyname () +¤Ï name °ú¤­¿ô¤ò¤È¤ê¡¢¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¸¡º÷¤¹¤ë¡£ +¥¨¥ó¥È¥ê¤Ï +.I "struct aliasent" +¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤·¤ÆÊÖ¤µ¤ì¤ë¡£ +.PP +.BR getaliasbyname_r () +¤Ï¾åµ­¤Î´Ø¿ô¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤ¢¤ë¡£ +Í׵ᤵ¤ì¤¿¹½Â¤ÂΤÏÂè 2 °ú¤­¿ô¤Ë³ÊǼ¤µ¤ì¤ë¤¬¡¢ +¥×¥í¥°¥é¥Þ¤Ï¾¤Î°ú¤­¿ô¤âËä¤á¤Æ¤ä¤ëɬÍפ¬¤¢¤ë¡£ +½¼Ê¬¤ÊÎΰ褬Ϳ¤¨¤é¤ì¤Ê¤¤¤È¡¢¤³¤Î´Ø¿ô¤Ï¼ºÇÔ¤¹¤ë¡£ +.PP +.I "struct aliasent" +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.in +4n +.nf + +struct aliasent { + char *alias_name; /* ¥¨¥¤¥ê¥¢¥¹Ì¾ */ + size_t alias_members_len; + char **alias_members; /* ¥¨¥¤¥ê¥¢¥¹Ì¾¤Î¥ê¥¹¥È */ + int alias_local; +}; +.fi +.in +.SH ÊÖ¤êÃÍ +´Ø¿ô +.BR getaliasent_r () +¤È +.BR getaliasbyname_r () +¤Ï¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£ +.SH ¥Õ¥¡¥¤¥ë +¥Ç¥Õ¥©¥ë¥È¤Î¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ï¡¢¥Õ¥¡¥¤¥ë +.I /etc/aliases +¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï +.I /etc/nsswitch.conf +¥Õ¥¡¥¤¥ë¤ÇÊѹ¹¤Ç¤­¤ë¡£ +.SH ½àµò +¤³¤Î¥ë¡¼¥Á¥ó¤Ï glibc ¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤ë¡£ +NeXT ¤Ë¤ÏƱÍͤΥ롼¥Á¥ó¤¬¤¢¤ë¡£ +.in +4n +.sp +.nf + +#include + +void alias_setent(void); +void alias_endent(void); +alias_ent *alias_getent(void); +alias_ent *alias_getbyname(char *name); +.fi +.in +.SH Îã +°Ê²¼¤ÎÎã¤Ï +.I "gcc example.c -o example" +¤Ç¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤ë¡£ +¤³¤ì¤Ï¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤¢¤ëÁ´¤Æ¤Î̾Á°¤ò¥À¥ó¥×¤¹¤ë¡£ +.sp +.nf +#include +#include +#include +#include + +int +main(void) +{ + struct aliasent *al; + setaliasent(); + for (;;) { + al = getaliasent(); + if (al == NULL) + break; + printf("Name: %s\\n", al\->alias_name); + } + if (errno) { + perror("reading alias"); + exit(EXIT_FAILURE); + } + endaliasent(); + exit(EXIT_SUCCESS); +.fi +.SH ´ØÏ¢¹àÌÜ +.BR getgrent (3), +.BR getpwent (3), +.BR getspent (3), +.BR aliases (5) +.\" +.\" /etc/sendmail/aliases +.\" Yellow Pages +.\" newaliases, postalias diff --git a/release/man3/setbuf.3 b/release/man3/setbuf.3 new file mode 100644 index 00000000..0e81bcf2 --- /dev/null +++ b/release/man3/setbuf.3 @@ -0,0 +1,207 @@ +.\" +.\" Japanese Version Copyright (c) 1999 ishikawa, keisuke +.\" all rights reserved. +.\" Translated Thu Jan 7 00:03:12 JST 1999 +.\" by ishikawa, keisuke +.\" Updated Sat May 19 JST 2001 by Kentaro Shirakata +.\" Updated & Modified Sun Jul 1 15:48:32 JST 2001 +.\" by Yuichi SATO +.\" +.\" Copyright (c) 1980, 1991 Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)setbuf.3 6.10 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 14:55:24 1993, faith@cs.unc.edu +.\" Added section to BUGS, Sun Mar 12 22:28:33 MET 1995, +.\" Thomas.Koenig@ciw.uni-karlsruhe.de +.\" Correction, Sun, 11 Apr 1999 15:55:18, +.\" Martin Vicente +.\" Correction, 2000-03-03, Andreas Jaeger +.\" Added return value for setvbuf, aeb, +.\" +.TH SETBUF 3 2008-06-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +setbuf, setbuffer, setlinebuf, setvbuf \- ¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ÎÁàºî +.SH ½ñ¼° +.nf +.B #include + +.BI "void setbuf(FILE *" stream ", char *" buf ); + +.BI "void setbuffer(FILE *" stream ", char *" buf ", size_t " size ); + +.BI "void setlinebuf(FILE *" stream ); + +.BI "int setvbuf(FILE *" stream ", char *" buf ", int " mode \ +", size_t " size ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR setbuffer (), +.BR setlinebuf (): +_BSD_SOURCE +.SH ÀâÌÀ +¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤Ë¤Ï unbuffered, block buffered, line buffered ¤Î3¤Ä¤Î¥¿¥¤¥×¤¬ +¤¢¤ë¡£½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Î¥¿¥¤¥×¤¬ unbuffered ¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¤ò½ñ¤­¹þ¤à¤È¤¹¤°¤Ë½Ð +ÎÏÀè¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¤«¥¿¡¼¥ß¥Ê¥ë¤Ëɽ¼¨¤µ¤ì¤ë¡£block buffered ¤Î¾ì¹ç¡¢Ê¸ +»ú¤ÎÆɤ߽ñ¤­¤Ï¥Ö¥í¥Ã¥¯Ã±°Ì¤Ç¤¤¤Ã¤Ú¤ó¤Ë¹Ô¤ï¤ì¤ë¡£line buffered ¤Î¾ì¹ç¡¢ +¿·¤·¤¤¹Ô¤¬½ÐÎϤµ¤ì¤ë¤«¡¢¥¿¡¼¥ß¥Ê¥ë¥Ç¥Ð¥¤¥¹¤ËÀܳ¤·¤Æ¤¤¤ë¥¹¥È¥ê¡¼¥à +(Ä̾\fIstdin\fP) ¤«¤é¿·¤·¤¤¹Ô¤¬ÆþÎϤµ¤ì¤ë¤Þ¤Çʸ»ú¤¬¤¿¤¯¤ï¤¨¤é¤ì¤ë¡£ +¥Ö¥í¥Ã¥¯¤ò¶¯À©Åª¤Ë½ÐÎϤ¹¤ë¤Ë¤Ï +.BR fflush (3) +´Ø¿ô¤ò»È¤¦¡£ +.RB ( fclose (3) +¤ò»²¾È¤Î¤³¤È) Ä̾¥Õ¥¡¥¤¥ë¤Ï¤¹¤Ù¤Æ block buffered ¤Ç¤¢¤ë¡£¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +½é¤á¤ÆÆþ½ÐÎϽèÍý¤ò¹Ô¤¦¤È +.BR malloc (3) +¤¬¸Æ¤Ó½Ð¤µ¤ì¥Ð¥Ã¥Õ¥¡¤¬³ÍÆÀ¤µ¤ì¤ë¡£¤â¤· ¥¹¥È¥ê¡¼¥à¤¬ (Ä̾ +.I stdout +¤¬¤½¤¦¤Ç¤¢¤ë¤è¤¦¤Ë) ¥¿¡¼¥ß¥Ê¥ë¤ò»²¾È¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤Ï line buffered ¤È +¤Ê¤ë¡£É¸½à¥¨¥é¡¼½ÐÎÏ +.I stderr +¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¾ï¤Ë unbuffered ¤Ç¤¢¤ë¡£ +.PP +.BR setvbuf () +´Ø¿ô¤Ï¡¢¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ëǤ°Õ¤Î¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¥Ð¥Ã¥Õ¥¡¤òÊѹ¹¤Ç¤­¤ë¡£ +°ú¤­¿ô +.I mode +¤Ï¡¢¼¡¤Î 3 ¤Ä¤Î¥Þ¥¯¥í¤Î¤¦¤Á¤¤¤º¤ì¤«¤Ç¤¢¤ë: +.RS +.TP +.B _IONBF +unbuffered +.TP +.B _IOLBF +line buffered +.TP +.B _IOFBF +fully buffered +.RE +.PP +unbuffered ¤Î¥Õ¥¡¥¤¥ë¤ò½ü¤­¡¢ +.I buf +°ú¿ô¤Ï +.I size +¥Ð¥¤¥È°Ê¾å¤ÎÂ礭¤µ¤Î¥Ð¥Ã¥Õ¥¡¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¸½ºß¤Î +¥Ð¥Ã¥Õ¥¡¤ÎÂå¤ï¤ê¤ËÍѤ¤¤é¤ì¤ë¡£¤â¤·¡¢°ú¿ô +.I buf +¤¬ NULL ¤Ê¤é¤Ð¡¢¥â¡¼¥É¤À¤±¤¬Êѹ¹¤µ¤ì¤ë¡£ +¿·¤·¤¤¥Ð¥Ã¥Õ¥¡¤Ï¼¡¤ËÆɤ߽ñ¤­¤·¤¿ºÝ¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +.BR setvbuf () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤·¤¿¸å¡¢ +¤½¤Î¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ²¿¤é¤«¤ÎÁàºî¤ò¤¹¤ëÁ°¤Ë¤Î¤ß»ÈÍѤǤ­¤ë¡£ +.PP +¾¤Î 3 ¤Ä¤Î´Ø¿ô¤Ï +.BR setvbuf () +¤Î¸Æ¤Ó½Ð¤·¤Ëñ½ã¤ËÃÖ¤­´¹¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR setbuf () +´Ø¿ô¤Ï¡¢ +.PP +.in +4n +setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ); + +.in +¤ÈÁ´¤¯Æ±Åù¤À¤·¡¢ +.BR setbuffer () +´Ø¿ô¤Ï¡¢¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤¬¥Ç¥Õ¥©¥ë¥ÈÃÍ +.B BUFSIZ +¤Ç¤Ï¤Ê¤¯°ú¿ô¤ÇÍ¿¤¨¤é¤ì¤ëÅÀ°Ê³°¤ÏƱ¤¸¤Ç¤¢¤ë¡£ +.BR setlinebuf () +´Ø¿ô¤Ï +.PP +.in +4n +setvbuf(stream, (char *) NULL, _IOLBF, 0); + +.in +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR setvbuf () +´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢0 °Ê³°¤ÎÃͤòÊÖ¤¹ +(¼ºÇԤȤϡ¢ +.I mode +¤¬ÉÔÀµ¤Ê¾ì¹ç¤Þ¤¿¤Ï¥ê¥¯¥¨¥¹¥È¤¬¾ò·ï¤òËþ¤¿¤µ¤Ê¤¤¾ì¹ç¤Ç¤¢¤ë)¡£ +.BR setvbuf () +´Ø¿ô¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ï +.I errno +¤òÀßÄꤹ¤ë¤³¤È¤â¤¢¤ë¡£ + +¤½¤Î¾¤Î´Ø¿ô¤ÏÃͤòÊÖ¤µ¤Ê¤¤¡£ +.SH ½àµò +.BR setbuf () +´Ø¿ô¤ª¤è¤Ó +.BR setvbuf () +´Ø¿ô¤Ï C89 ¤È C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +.BR setbuffer () +´Ø¿ô¤ª¤è¤Ó +.BR setlinebuf () +´Ø¿ô¤Ï 4.2BSD ¤è¤êÁ°¤Î BSD ¤È¤Ï¸ß´¹À­¤¬¤Ê¤¤¡£¤Þ¤¿ Linux ¤Ç¤â(¸Å¤¤¥Ð¡¼¥¸¥ç¥ó +¤Ç¤Ï)ÍøÍѤǤ­¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£4.2BSD ¤ª¤è¤Ó 4.3BSD ¤Î¥·¥¹¥Æ¥à¤Ç¤Ï +.BR setbuf () +¤Ïɬ¤ºÄɲäΥХåե¡¡¼¤Î¥µ¥¤¥º¤ò»ÈÍѤ¹¤ë¤Î¤Ç¡¢¤³¤ì¤â»È¤¦¤Ù¤­¤Ç¤Ê¤¤¡£ +.P +.I stream +¤òÊĤ¸¤ë»þ (¥×¥í¥°¥é¥à¤ò½ªÎ»¤¹¤ëºÝ¤Ë¤â¤³¤ì¤Ïµ¯¤­¤ë) ¤Ë¤Ï¡¢ +.I buf +¤¬»Ø¤·¼¨¤¹¶õ´Ö¤È¤¬Â¸ºß¤·¤Æ¤¤¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Î㤨¤Ð¡¢¼¡¤Î¤è¤¦¤Ê»È¤¤Êý¤Ïµö¤µ¤ì¤Ê¤¤: +.nf +.sp +#include + +int +main(void) +{ + char buf[BUFSIZ]; + setbuf(stdin, buf); + printf("Hello, world!\\n"); + return 0; +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR fclose (3), +.BR fflush (3), +.BR fopen (3), +.BR fread (3), +.BR malloc (3), +.BR printf (3), +.BR puts (3) diff --git a/release/man3/setenv.3 b/release/man3/setenv.3 new file mode 100644 index 00000000..3e5c43e1 --- /dev/null +++ b/release/man3/setenv.3 @@ -0,0 +1,136 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and Copyright (C) 2004, 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified Sat Jul 24 18:20:58 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Feb 14 21:47:50 1997 by Andries Brouwer (aeb@cwi.nl) +.\" Modified 9 Jun 2004, Michael Kerrisk +.\" Changed unsetenv() prototype; added EINVAL error +.\" 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" +.SH ̾Á° +setenv \- ´Ä¶­ÊÑ¿ô¤òÊѹ¹¤Þ¤¿¤ÏÄɲ乤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int setenv(const char *" name ", const char *" value ", int " overwrite ); +.sp +.BI "int unsetenv(const char *" name ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR setenv (), +.BR unsetenv (): +_BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH ÀâÌÀ +.BR setenv () +´Ø¿ô¤Ï¡¢\fIname\fP ¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç +´Ä¶­ÊÑ¿ô \fIname\fP ¤ËÃÍ \fIvalue\fP ¤òÀßÄꤷ¡¢´Ä¶­¤ËÄɲ乤롣 +\fIname\fP ¤¬´Ä¶­¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢\fIoverwrite\fP ¤¬ 0 °Ê³°¤Ê¤é¤Ð +¤½¤ÎÃͤò \fIvalue\fP ¤ËÊѹ¹¤·¡¢\fIoverwrite\fP ¤¬ 0 ¤Ê¤é¤Ð +\fIname\fP ¤ÎÃͤòÊѹ¹¤·¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¤Ï¡¢ +.RB ( putenv (3) +¤È°ã¤¤) +.I name +¤È +.I value +¤Ë¤è¤ê»²¾È¤µ¤ì¤ëʸ»úÎó¤Î¥³¥Ô¡¼¤ò¹Ô¤¦¡£ +.PP +.BR unsetenv () +´Ø¿ô¤Ï¡¢ÊÑ¿ô \fIname\fP ¤ò´Ä¶­¤«¤éºï½ü¤¹¤ë¡£ +.I name +¤¬´Ä¶­¤Ë¤Ê¤¤¾ì¹ç¡¢¤³¤Î´Ø¿ô¤ÏÀ®¸ù¤·¡¢´Ä¶­¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR setenv () +´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤Î¸¶°ø¤ò¼¨¤¹Ãͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ + +.BR unsetenv () +´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òÀßÄꤷ¤Æ¥¨¥é¡¼¤Î¸¶°ø¤ò¼¨¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I name +¤¬ NULL ¤Ç¤¢¤ë¤«¡¢Ä¹¤µ¤¬ 0 ¤Îʸ»úÎó¤ò»Ø¤·¤Æ¤¤¤ë¤«¡¢ +\(aq=\(aq ʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.B ENOMEM +´Ä¶­¤Ë¿·¤·¤¤ÊÑ¿ô¤òÄɲ乤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.SH ½àµò +4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +POSIX.1-2001 ¤Ï¡¢ +.BR setenv () +¤ä +.BR unsetenv () +¤¬¥ê¥¨¥ó¥È¥é¥ó¥È (ºÆÆþ²Äǽ) ¤Ç¤¢¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤Ê¤¤¡£ + +glibc 2.2.2 °ÊÁ°¤Ç¤Ï¡¢ +.BR unsetenv () +¤Ï +ÊÖ¤êÃͤ¬ \fIvoid\fP ¤Î¥×¥í¥È¥¿¥¤¥×¤Ç¤¢¤Ã¤¿¡£ +¤â¤Ã¤ÈºÇ¶á¤Î glibc ÈǤϡ¢¡Ö½ñ¼°¡×¥»¥¯¥·¥ç¥ó¤Ç¼¨¤·¤Æ¤¤¤ë¤è¤¦¤Ë +POSIX.1-2001 ¸ß´¹¤Î¥×¥í¥È¥¿¥¤¥×¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +POSIX.1-2001 ¤Ç¤Ï +.RI ¡Ö name +¤Ë \(aq=\(aq ʸ»ú¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¡¢ +.BR setenv () +¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤Ù¤­¤Ç¤¢¤ë¡×¤È½Ò¤Ù¤é¤ì¤Æ¤¤¤ë¡£ +¤·¤«¤· 2.3.4 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢ +.I name +¤Ë \(aq=\(aq ʸ»ú¤¬´Þ¤Þ¤ì¤ë¤Î¤òµö¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR clearenv (3), +.BR getenv (3), +.BR putenv (3), +.BR environ (7) diff --git a/release/man3/setjmp.3 b/release/man3/setjmp.3 new file mode 100644 index 00000000..4fb7d02b --- /dev/null +++ b/release/man3/setjmp.3 @@ -0,0 +1,131 @@ +.\" Written by Michael Haardt, Fri Nov 25 14:51:42 MET 1994 +.\" +.\" 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. +.\" +.\" Added sigsetjmp, Sun Mar 2 22:03:05 EST 1997, jrv@vanzandt.mv.com +.\" Modifications, Sun Feb 26 14:39:45 1995, faith@cs.unc.edu +.\" +.\" Japanese Version Copyright (c) 1998 Seiiti Obara +.\" all rights reserved. +.\" Translated 1998-05-27, Seiiti Obara +.\" Updated 1999-12-11, Kentaro Shirakata +.\" Modified 2007-12-20, Akihiro MOTOKI +.\" Updated 2009-02-12, Kentaro Shirakata +.\" +.\"WORD: stack context ¥¹¥¿¥Ã¥¯¥³¥ó¥Æ¥­¥¹¥È +.\"WORD: signal masks ¥·¥°¥Ê¥ë¥Þ¥¹¥¯ +.\"WORD: signal context ¥·¥°¥Ê¥ë¥³¥ó¥Æ¥­¥¹¥È +.\"WORD: low-level Äã¥ì¥Ù¥ë +.\" +.TH SETJMP 3 2009-06-26 "" "Linux Programmer's Manual" +.SH ̾Á° +setjmp, sigsetjmp \- Èó¶É½êŪ¤Ê¥¸¥ã¥ó¥×¤Î¤¿¤á¤Ë¡¢¥¹¥¿¥Ã¥¯¥³¥ó¥Æ¥­¥¹¥È (stack context) ¤òÊݸ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.nf +.BI "int setjmp(jmp_buf " env ); + +.BI "int sigsetjmp(sigjmp_buf " env ", int " savesigs ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR setjmp (): +¡ÖÃí°Õ¡×»²¾È¡£ +.br +.BR sigsetjmp (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_C_SOURCE +.SH ÀâÌÀ +.BR setjmp () +¤È +.BR longjmp (3) +¤Ï¡¢¥×¥í¥°¥é¥à¤ÎÄã¥ì¥Ù¥ë¤Ê¥µ¥Ö¥ë¡¼¥Á¥ó +¤Ë¤ª¤¤¤Æ¡¢¥¨¥é¡¼¤ä³ä¤ê¹þ¤ß¤¬È¯À¸¤·¤¿»þ¤Î½èÍý¤ËÊØÍø¤Ç¤¢¤ë¡£ +.BR setjmp () +¤Ï¡¢ +.BR longjmp (3) +¤Ë¤è¤Ã¤Æ»È¤ï¤ì¤ë \fIenv\fP ¤Ë +¥¹¥¿¥Ã¥¯¥³¥ó¥Æ¥­¥¹¥È/¥¹¥¿¥Ã¥¯´Ä¶­¤òÊݸ¤¹¤ë¡£ +.BR setjmp () +¤ò¸Æ¤Ó½Ð¤·¤¿ +´Ø¿ô¤¬ÊÖ¤ë¤È¤­¤Ë¡¢¤½¤Î¥¹¥¿¥Ã¥¯¥³¥ó¥Æ¥­¥¹¥È¤Ï̵¸ú¤Ë¤Ê¤ë¡£ +.P +.BR sigsetjmp () +¤â +.BR setjmp () +¤ÈƱÍͤǤ¢¤ë¡£ +\fIsavesigs\fP ¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢ +¤³¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤â \fIenv\fP ¤ËÊݸ¤µ¤ì¡¢ +¤³¤Î¥·¥°¥Ê¥ë¤Ï¸å¤Ç +.BR siglongjmp (3) +¤¬¤³¤Î \fIenv\fP ¤Ç¼Â¹Ô¤µ¤ì¤¿ºÝ¤ËÉü¸µ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +ľÀÜÊ֤äƤ¯¤ë¤È¤­¤Ï¡¢ +.BR setjmp () +¤È +.BR sigsetjmp () +¤Ï 0 ¤òÊÖ¤·¡¢Êݸ¤·¤¿¥³¥ó¥Æ¥­¥¹¥È¤ò»È¤Ã¤Æ +.BR longjmp (3) +¤ä +.BR siglongjmp (3) +¤«¤éÊ֤äƤ¯¤ë¤È¤­¤Ï 0 °Ê³°¤òÊÖ¤¹¡£ +.SH ½àµò +.BR setjmp () +¤Ï C89, C99, POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.BR sigsetjmp () +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +POSIX ¤Ï¡¢ +.BR setjmp () +¤¬¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊݸ¤¹¤Ù¤­¤«¤É¤¦¤«¤òµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£ +System V ¤Ç¤ÏÊݸ¤·¤Ê¤¤¡£ +4.3BSD ¤Ç¤ÏÊݸ¤¹¤ë; +4.3BSD ¤Ë¤Ï¥·¥°¥Ê¥ë¥³¥ó¥Æ¥­¥¹¥È¤òÊݸ¤·¤Ê¤¤´Ø¿ô \fB_setjmp\fP ¤â¤¢¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢Linux/glibc ¤Ï System V ¤Î¿¶¤ëÉñ¤¤¤Ë½¾¤¦¤¬¡¢ +.B _BSD_SOURCE +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¡¢ +.BR _POSIX_SOURCE , +.BR _POSIX_C_SOURCE , +.BR _XOPEN_SOURCE , +.BR _XOPEN_SOURCE_EXTENDED , +.BR _GNU_SOURCE , +.B _SVID_SOURCE +¤Î¤¤¤º¤ì¤âÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤»þ¤Ï BSD ¤Î¿¶¤ëÉñ¤¤¤È¤Ê¤ë¡£ + +°Ü¿¢À­¤Î¤¢¤ë·Á¤Ç¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊݸ¤ª¤è¤ÓÉü¸µ¤·¤¿¤¤¤Î¤Ê¤é¡¢ +.BR sigsetjmp () +¤È +.BR siglongjmp () +¤ò»È¤¦¤³¤È¡£ +.P +.BR setjmp () +¤ä +.BR sigsetjmp () +¤ò»È¤¦¤È¡¢¥×¥í¥°¥é¥à¤ÏÍý²ò¤·¤Å¤é¤¯¡¢Êݼ餷¤Ë¤¯¤¤¤â¤Î¤Ë¤Ê¤ë¡£ +Ê̤ÎÊýË¡¤¬²Äǽ¤Ê¤é¡¢¤½¤ì¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR longjmp (3), +.BR siglongjmp (3) diff --git a/release/man3/setlocale.3 b/release/man3/setlocale.3 new file mode 100644 index 00000000..6cedb2d5 --- /dev/null +++ b/release/man3/setlocale.3 @@ -0,0 +1,207 @@ +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" and Copyright 1999 by Bruno Haible (haible@clisp.cons.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. +.\" License. +.\" Modified Sat Jul 24 18:20:12 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Tue Jul 15 16:49:10 1997 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Sun Jul 4 14:52:16 1999 by Bruno Haible (haible@clisp.cons.org) +.\" Modified Tue Aug 24 17:11:01 1999 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Tue Feb 6 03:31:55 2001 by Andries Brouwer (aeb@cwi.nl) +.\" +.\" Japanese Version Copyright (c) 1998 Tanoshima Hidetohsi +.\" all rights reserved. +.\" May 29, 1998 Tanoshima Hidetoshi +.\" Modified Mon Oct 2 11:09:18 JST 2000 +.\" by HANATAKA Shinya +.\" Updated Fri May 4 01:49:48 JST 2001 +.\" by Kentaro Shirakata +.\" Updated Sat Oct 12 2002 by NAKANO Takeo +.\" +.\"WORD: locale ¥í¥±¡¼¥ë +.\"WORD: portable ¸ß´¹À­¤Î¤¢¤ë +.\"WORD: regular expression Àµµ¬É½¸½ +.\"WORD: range expressions ÈÏ°Ïɽ¸½ +.\"WORD: equivalence classes Åù²Á¥¯¥é¥¹ +.\"WORD: collation ¾È¹ç +.\"WORD: multibyte character ¿¥Ð¥¤¥Èʸ»ú +.\"WORD: wide character ¥ï¥¤¥Éʸ»ú +.\"WORD: opaque string ÆâÉôʸ»úÎó +.\" +.TH SETLOCALE 3 2008-12-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +setlocale \- ¸½ºß¤Î¥í¥±¡¼¥ë (locale) ¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *setlocale(int " category ", const char *" locale ); +.fi +.SH ÀâÌÀ +.BR setlocale () +´Ø¿ô¤Ï¥×¥í¥°¥é¥à¤Î¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤òÀßÄꤷ¤¿¤ê +Ì䤤¹ç¤ï¤»¤¿¤ê¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +.I locale +¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢¥×¥í¥°¥é¥à¤Î¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤Ï°ú¤­¿ô¤Ë½¾¤Ã¤ÆÊѹ¹¤µ¤ì¤ë¡£ +°ú¤­¿ô +.I category +¤Ï¥×¥í¥°¥é¥à¤Î¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤Î¤É¤ÎÉôʬ¤òÊѹ¹¤¹¤ë¤«¤ò·è¤á¤ë¡£ +.TP +.B LC_ALL +Á´¤Æ¤Î¥í¥±¡¼¥ë +.TP +.B LC_COLLATE +Àµµ¬É½¸½¤Î¥Þ¥Ã¥Á¥ó¥° (ÈÏ°Ïɽ¸½¤ÈÅù²Á¥¯¥é¥¹¤Î¥Þ¥Ã¥Á¥ó¥°¤ò·èÄꤹ¤ë) +¤Èʸ»úÎó¤Î¾È¹ç (collation) +.TP +.B LC_CTYPE +Àµµ¬É½¸½¤Î¥Þ¥Ã¥Á¥ó¥°¡¢Ê¸»ú¤ÎʬÎࡢʸ»ú¤ÎÊÑ´¹¡¢Âçʸ»ú¾®Ê¸»úÈæ³Ó¡¢ +¥ï¥¤¥Éʸ»ú´Ø¿ô +.TP +.B LC_MESSAGES +ÃÏ°è²½²Äǽ¤Ê¼«Á³¸À¸ì¥á¥Ã¥»¡¼¥¸ +.TP +.B LC_MONETARY +Ä̲ߤνñ¼° +.TP +.B LC_NUMERIC +¿ôÃͤνñ¼° (¾®¿ôÅÀ¤ä 3 ·å¤´¤È¤Î¶èÀÚ¤ê) +.TP +.B LC_TIME +»þ¹ï¤ÈÆüÉÕ¤±¤Î½ñ¼° +.PP +°ú¤­¿ô +.I locale +¤Ï +.I category +¤ËÀßÄꤹ¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤³¤Îʸ»úÎó¤Ï¤è¤¯ÃΤé¤ì¤¿Äê¿ô¤Ç¤¢¤ë "C" ¤ä "da_DK" ¤Ê¤É¤Ç¤âÎɤ¤¤· +(°Ê²¼¤ò»²¾È)¡¢Â¾¤Î¤È¤­¤Ë +.BR setlocale () +¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤ËÊÖ¤µ¤ì¤¿¡¢ÆâÉôÍѤÎʸ»úÎó¤Ç¤âÎɤ¤¡£ +.PP +.I locale +¤¬ \fB""\fP ¤Î¾ì¹ç¡¢¥í¥±¡¼¥ë¤Î³ÆÉôʬ¤ÎÀßÄê¤Ë¤Ï´Ä¶­ÊÑ¿ô¤¬»²¾È¤µ¤ì¤ë¡£ +¤½¤Î¾ÜºÙ¤Ï¼ÂÁõ°Í¸¤Ç¤¢¤ë¡£ +glibc ¤Î¾ì¹ç¡¢¤Þ¤ººÇ½é¤Ë (¤É¤ó¤Ê +.I category +¤ËÂФ·¤Æ¤â) ´Ä¶­ÊÑ¿ô +.B LC_ALL +¤¬¸¡ºº¤µ¤ì¤ë¡£ +¼¡¤Ë¥«¥Æ¥´¥ê (category) ¤ÈƱ¤¸Ì¾Á°¤Î´Ä¶­ÊÑ¿ô +.RB ( LC_COLLATE , +.BR LC_CTYPE , +.BR LC_MESSAGES , +.BR LC_MONETARY , +.BR LC_NUMERIC , +.BR LC_TIME ) +¤¬¸¡ºº¤µ¤ì¡¢ºÇ¸å¤Ë´Ä¶­ÊÑ¿ô +.B LANG +¤¬¸¡ºº¤µ¤ì¤ë¡£ +ºÇ½é¤Ë¸«¤Ä¤«¤Ã¤¿´Ä¶­ÊÑ¿ô¤ò»ÈÍѤ¹¤ë¡£ +¤½¤ÎÃͤ¬¥í¥±¡¼¥ë»ØÄê¤È¤·¤ÆÀµ¤·¤¯¤Ê¤±¤ì¤Ð¡¢¥í¥±¡¼¥ë¤ÏÊѹ¹¤µ¤ì¤º¡¢ +.BR setlocale () +¤Ï NULL ¤òÊÖ¤¹¡£ +.PP +\fB"C"\fP ¥í¥±¡¼¥ë¤ä \fB"POSIX"\fP ¥í¥±¡¼¥ë¤Ï¸ß´¹À­¤Î¤¢¤ë¥í¥±¡¼¥ë¤Ç¤¢¤ë¡£ +¤³¤Î +.B LC_CTYPE +¤ÎÉôʬ¤Ï 7 ¥Ó¥Ã¥È ASCII ʸ»ú½¸¹ç¤ËÁêÅö¤·¤Æ¤¤¤ë¡£ +.PP +¥í¥±¡¼¥ë̾¤Î½ñ¼°¤Ï¡¢Ä̾ï +.IR language "[_" territory "][." codeset "][@" modifier "]" +¤È¤¤¤¦¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤³¤Ç +.I language +¤Ï ISO 639 ¤Î¸À¸ì¥³¡¼¥É¤Ç¤¢¤ë¡£ +.I territory +¤Ï ISO 3166 ¤Î¹ñ̾¥³¡¼¥É¤Ç¤¢¤ë¡£ +.I codeset +¤Ï +.B "ISO-8859-1" +¤ä +.B "UTF-8" +¤Î¤è¤¦¤Êʸ»ú½¸¹ç¤äʸ»úÉä¹æ²½¼±Ê̻ҤǤ¢¤ë¡£ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥í¥±¡¼¥ë¤Î°ìÍ÷¤òÆÀ¤ë¤Ë¤Ï¡¢ +"locale \-a" ¤ò¼Â¹Ô¤·¤Æ¤ß¤è +.RB ( locale (1) +»²¾È¤Î¤³¤È)¡£ +.PP +.I locale +¤¬ NULL ¤Ê¤é¤Ð¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤òÌ䤤¹ç¤ï¤»¤ë¤Î¤ß¤ÇÊѹ¹¤Ï¤·¤Ê¤¤¡£ +.PP +main ¥×¥í¥°¥é¥à¤Îµ¯Æ°»þ¤Ë¤Ï¡¢ +¸ß´¹À­¤Î¤¢¤ë \fB"C"\fP ¥í¥±¡¼¥ë¤¬¥Ç¥Õ¥©¥ë¥È¤ÇÁªÂò¤µ¤ì¤ë¡£ +¥×¥í¥°¥é¥à¤ò¤¹¤Ù¤Æ¤Î¥í¥±¡¼¥ë¤ËÂФ·¤Æ¸ß´¹¤Ë¤·¤¿¤±¤ì¤Ð¡¢ +¥×¥í¥°¥é¥à¤Î½é´ü²½¤Î¸å¤Ë +.nf + + setlocale(LC_ALL, ""); + +.fi +¤ò¸Æ¤Ó½Ð¤·¡¢¥í¥±¡¼¥ë°Í¸¤Î¾ðÊó¤Ë¤Ï +.BR localeconv (3) +¤ÎÊÖ¤êÃͤòÍѤ¤¡¢ +.BR "MB_CUR_MAX > 1" +¤Î¾ì¹ç¤Ë¤Ïʸ»úÎó¤ÎÁàºî¤Ë¤Ï¿¥Ð¥¤¥Èʸ»ú¡¢¥ï¥¤¥Éʸ»ú´Ø¿ô¤ò»ÈÍѤ·¡¢ +ʸ»úÎó¤ÎÈæ³Ó¤Ë¤Ï +.BR strcoll (3), +.BR wcscoll (3) +¤ä +.BR strxfrm (3), +.BR wcsxfrm (3) +¤òÍѤ¤¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR setlocale () +¤Î¸Æ¤Ó½Ð¤·¤ËÀ®¸ù¤¹¤ë¤È¡¢ +¤½¤Î¥í¥±¡¼¥ë½¸¹ç¤ËÂбþ¤¹¤ëÆâÉôʸ»úÎó (opaque string) ¤òÊÖ¤¹¡£ +¤³¤Îʸ»úÎó¤ÏÀÅŪ¤Êµ­²±°è¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤ÎÊ֤äÆÍ褿ʸ»úÎó¤ò¡¢¥«¥Æ¥´¥ê»ØÄê¤È¶¦¤Ë¡¢ +¤Î¤Á¤Î setlocale ¤Î¸Æ¤Ó½Ð¤·¤Ë»ØÄꤹ¤ì¤Ð¡¢ +¥×¥í¥»¥¹¤Î¤½¤ÎÉôʬ¤Î¥í¥±¡¼¥ë¤¬Éü¸µ¤µ¤ì¤ë¡£ +ÀßÄê¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ÊÖ¤êÃÍ¤Ï NULL ¤Ë¤Ê¤ë¡£ +.SH ½àµò +C89, C99, POSIX.1-2001. +.SH Ãí°Õ +Linux (¤È¤¤¤¦¤« glibc) ¤Ï¸ß´¹À­¤Î¤¢¤ë¥í¥±¡¼¥ë¤È¤·¤Æ +\fB"C"\fP ¤È \fB"POSIX"\fP ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¸Å¤­¤è¤­»þÂå¤Ë¤Ï (Î㤨¤Ð libc-4.5.21 ¤È libc-4.6.27 ¤Ê¤É¤Ç¤Ï)¡¢ +European Latin-1 ¸þ¤±¤Ë +\fB"ISO-8859-1"\fP ¥í¥±¡¼¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤ª¤ê¡¢ +¥í¥·¥¢¸ì (Russian) ¸þ¤±¤Ë \fB"KOI-8"\fP +(¤è¤êÀµ³Î¤Ë¤Ï "koi-8r") ¥í¥±¡¼¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤¿¡£ +½¾¤Ã¤Æ´Ä¶­ÊÑ¿ô¤ò \fILC_CTYPE=ISO-8859-1\fP ¤È»ØÄꤹ¤ë¤À¤±¤Ç +.BR isprint (3) +¤ÏÀµ¤·¤¤Åú¤¨¤òÊÖ¤·¤¿¡£ +ºÇ¶á¤Ç¤Ï¡¢±Ñ¸ì°Ê³°¤ò»È¤¦¥è¡¼¥í¥Ã¥Ñ¿Í¤Ï¤â¤¦¾¯¡¹¤ä¤Ã¤«¤¤¤Êºî¶È¤òɬÍפȤ·¡¢ +¼ÂºÝ¤Î¥í¥±¡¼¥ë¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR locale (1), +.BR localedef (1), +.BR isalpha (3), +.BR localeconv (3), +.BR nl_langinfo (3), +.BR rpmatch (3), +.BR strcoll (3), +.BR strftime (3), +.BR charsets (7), +.BR locale (7) diff --git a/release/man3/setlogmask.3 b/release/man3/setlogmask.3 new file mode 100644 index 00000000..7fb687fb --- /dev/null +++ b/release/man3/setlogmask.3 @@ -0,0 +1,80 @@ +.\" 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) 2001 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Sat Nov 3 01:46:03 JST 2001 +.\" by Akihiro MOTOKI +.\" +.\"WORD: logging ¥í¥°¼ý½¸ +.\" +.TH SETLOGMASK 3 2001-10-05 "" "Linux Programmer's Manual" +.SH ̾Á° +setlogmask \- ¥í¥°¤ÎÍ¥ÀèÅÙ¥Þ¥¹¥¯¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int setlogmask(int " mask ); +.fi +.SH ÀâÌÀ +¥×¥í¥»¥¹¤Ë¤Ï¥í¥°Í¥ÀèÅÙ¥Þ¥¹¥¯(log priority mask)¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤Æ¡¢ +¤³¤ì¤òÍѤ¤¤Æ +.BR syslog (3) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤Ë¥í¥°µ­Ï¿¤ò¹Ô¤¦¤«¤É¤¦¤«¤ò·èÄꤹ¤ë¡£ +¾¤Î¤¹¤Ù¤Æ¤Î´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤Ï¥í¥°µ­Ï¿¤¬¹Ô¤ï¤ì¤Ê¤¤¡£ +.I mask +¤Î³Æ¥Ó¥Ã¥È¤ÏÍ¥ÀèÅÙ¤ËÂбþ¤·¤Æ¤ª¤ê¡¢Âбþ¤¹¤ë¥Ó¥Ã¥È¤¬ 1 ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë +Í¥ÀèÅÙ¤ËÂФ·¤Æ¥í¥°¼ý½¸(logging)¤¬Í­¸ú¤Ë¤Ê¤ë¡£ +¥Þ¥¹¥¯¤Î½é´üÃͤϡ¢¤¹¤Ù¤Æ¤ÎÍ¥ÀèÅÙ¤ËÂФ·¤Æ¥í¥°¼ý½¸¤¬Í­¸ú¤Ë¤Ê¤ë¤è¤¦¤ÊÃͤǤ¢¤ë¡£ +.LP +.BR setlogmask () +´Ø¿ô¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÂФ¹¤ë¥í¥°¥Þ¥¹¥¯¤òÀßÄꤷ¡¢ +Êѹ¹Á°¤Î¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +.I mask +°ú¤­¿ô¤¬ 0 ¤Ê¤é¤Ð¡¢¸½ºß¤Î¥í¥°¥Þ¥¹¥¯¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.LP +°Ê²¼¤Î8¥ì¥Ù¥ë¤ÎÍ¥ÀèÅÙ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë(Í¥ÀèÅ٤ι⤤½ç)¡§ +.BR LOG_EMERG , +.BR LOG_ALERT , +.BR LOG_CRIT , +.BR LOG_ERR , +.BR LOG_WARNING , +.BR LOG_NOTICE , +.BR LOG_INFO , +.BR LOG_DEBUG ¡£ +Í¥ÀèÅÙ \fIp\fP ¤ËÂбþ¤¹¤ë¥Ó¥Ã¥ÈÎó¤Ï \fBLOG_MASK\fP(\fIp\fP) ¤Ë¤è¤Ã¤Æµá¤á¤é¤ì¤ë¡£ +Í¥ÀèÅÙ \fIp\fP °Ê¾å¤Î¤¹¤Ù¤Æ¤ÎÍ¥ÀèÅÙ (\fIp\fP ¤ò´Þ¤à) ¤Î¥Þ¥¹¥¯¥Ó¥Ã¥È¤ò +µá¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¥Þ¥¯¥í \fBLOG_UPTO\fP(\fIp\fP) ¤ò»ÈÍѤǤ­¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +Êѹ¹Á°¤Î¥í¥°Í¥ÀèÅÙ¥Þ¥¹¥¯¤ÎÃͤòÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤Ê¤·¡£ +.SH Ãí°Õ +glibc 2.1.1 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï glibc ¤Î¥í¥°¥Þ¥¹¥¯¤Î°·¤¤¤ËÉÔ¶ñ¹ç¤¬¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2001. +POSIX.1-2001 ¤Ç¤ÎÀâÌÀ¤Ë¤Ï·ç´Ù¤¬¤¢¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR closelog (3), +.BR openlog (3), +.BR syslog (3) diff --git a/release/man3/setnetgrent.3 b/release/man3/setnetgrent.3 new file mode 100644 index 00000000..3b7a9166 --- /dev/null +++ b/release/man3/setnetgrent.3 @@ -0,0 +1,107 @@ +.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" based on glibc infopages +.\" polished - aeb +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2005-02-20, Akihiro MOTOKI +.\" +.TH SETNETGRENT 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +setnetgrent, endnetgrent, getnetgrent, getnetgrent_r, innetgr \- +¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥°¥ë¡¼¥×¤Î¥¨¥ó¥È¥ê¤òÁàºî¤¹¤ë +.SH ½ñ¼° +.nf +.B #include + +.BI "int setnetgrent(const char *" netgroup ); + +.B "void endnetgrent(void);" + +.BI "int getnetgrent(char **" host ", char **" user ", char **" domain ); + +.BI "int getnetgrent_r(char **" host ", char **" user "," +.BI " char **" domain ", char *" buf ", int " buflen ); + +.BI "int innetgr(const char *" netgroup ", const char *" host "," +.BI " const char *" user ", const char *" domain ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR setnetgrent (), +.BR endnetgrent (), +.BR getnetgrent (), +.BR getnetgrent_r (), +.BR innetgr (): +_BSD_SOURCE || _SVID_SOURCE +.ad b +.SH ÀâÌÀ +.I netgroup +¤Ï SunOS ¤Ç¹Í°Æ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£¥Í¥Ã¥È¥°¥ë¡¼¥×¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î +¥¨¥ó¥È¥ê¤Ï¡¢ 3 ¤Ä¤Îʸ»úÎó¤Î¥ê¥¹¥È +.RI ( hostname ", " username ", " domainname ) +¤â¤·¤¯¤Ï¥Í¥Ã¥È¥°¥ë¡¼¥×̾¤Ç¤¢¤ë¡£ +Á°µ­¤Î¥ê¥¹¥È¤Î³ÆÍ×ÁǤ϶õ¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¡£ +¶õ¤Ï²¿¤È¤Ç¤â°ìÃפ¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +ËÜ¥Ú¡¼¥¸¤ÇÀâÌÀ¤¹¤ë´Ø¿ô¤ò»È¤¦¤³¤È¤Ç¡¢¥Í¥Ã¥È¥°¥ë¡¼¥×¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë +¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤É¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¸¡º÷¤µ¤ì¤ë¤«¤Ï +.I /etc/nsswitch.conf +¥Õ¥¡¥¤¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.BR setnetgrent () +¥³¡¼¥ë¤Ï¡¢¤³¤Î¸å¤Ç¸Æ¤Ð¤ì¤ë +.BR getnetgrent () +¥³¡¼¥ë¤¬¸¡º÷¤¹¤ë¥Í¥Ã¥È¥°¥ë¡¼¥×¤òÄê¤á¤ë¡£ +.BR getnetgrent () +´Ø¿ô¤Ï¥Í¥Ã¥È¥°¥ë¡¼¥×¤Î¼¡¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤·¡¢ +.IR host , +.IR user , +.I domain +¤Ë¥Ý¥¤¥ó¥¿¤òÆþ¤ì¤ÆÊ֤롣 +NULL ¥Ý¥¤¥ó¥¿¤Ï¡¢Âбþ¤¹¤ë¥¨¥ó¥È¥ê¤¬¤É¤ó¤Êʸ»úÎó¤È¤â°ìÃפ¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +ÆÀ¤é¤ì¤¿¥Ý¥¤¥ó¥¿¤Ï¡¢¥Í¥Ã¥È¥°¥ë¡¼¥×´Ø·¸¤Î´Ø¿ô¤Î¤¤¤º¤ì¤«¤¬¸Æ¤Ð¤ì¤ë¤Þ¤Ç¤Î +´Ö¤À¤±Í­¸ú¤Ç¤¢¤ë¡£¤³¤ÎÌäÂê¤òÈò¤±¤ë¤¿¤á¤Ë¤Ï GNU ³ÈÄ¥¤Î´Ø¿ô +.BR getnetgrent_r () +¤ò»È¤¦¤È¤è¤¤¡£¤³¤Î´Ø¿ô¤Ï¸Æ¤Ó½Ð¤·Â¦¤¬ÍÑ°Õ¤·¤¿¥Ð¥Ã¥Õ¥¡¤Ë +ʸ»úÎó¤ò³ÊǼ¤¹¤ë¡£³ä¤êÅö¤ÆºÑ¤Î¥Ð¥Ã¥Õ¥¡¤òÁ´¤Æ²òÊü¤¹¤ë¤Ë¤Ï +.BR endnetgrent () +¤ò»ÈÍѤ¹¤ë¡£ +.PP +¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢ +.RI ( hostname ", " username ", " domainname ) +¤Î3Í×ÁǤÎÁȤ¬¥Í¥Ã¥È¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤«¤É¤¦¤«¤ò³Îǧ¤·¤¿¤¤¤À¤±¤Ç¤¢¤í¤¦¡£ +.BR innetgr () +´Ø¿ô¤ò»È¤¦¤È¡¢¾åµ­¤Î3¤Ä¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤µ¤º¤Ë¤³¤ÎÌÜŪ¤òãÀ®¤Ç¤­¤ë¡£ +¤â¤¦°ìÅÙ½ñ¤¤¤Æ¤ª¤¯¤¬¡¢NULL ¥Ý¥¤¥ó¥¿¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É¤Ç¤¢¤ê¡¢ +¤¢¤é¤æ¤ëʸ»úÎó¤È°ìÃפ¹¤ë¡£¤³¤Î´Ø¿ô¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÀ®¸ù¤¹¤ë¤È 1 ¤ò¡¢¼ºÇÔ¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +.SH ¥Õ¥¡¥¤¥ë +.I /etc/netgroup +.br +.I /etc/nsswitch.conf +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¤¬¡¢ +setnetgrent (), +endnetgrent (), +getnetgrent (), +innetgr () +¤Ï¤Û¤È¤ó¤É¤Î Unix ¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.BR getnetgrent_r () +¤Ï¹­¤¯Â¾¤Î¥·¥¹¥Æ¥à¤ÇÍøÍѤǤ­¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.\" getnetgrent_r() is on Solaris 8 and AIX 5.1, but not the BSDs. +.SH Ãí°Õ +BSD ¤Î¼ÂÁõ¤Ç¤Ï +.BR setnetgrent () +¤Ï void ¤òÊÖ¤¹¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sethostent (3), +.BR setprotoent (3), +.BR setservent (3) diff --git a/release/man3/shm_open.3 b/release/man3/shm_open.3 new file mode 100644 index 00000000..57b2752f --- /dev/null +++ b/release/man3/shm_open.3 @@ -0,0 +1,288 @@ +.\" 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. +.\" +.\" 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 +.\" +.TH SHM_OPEN 3 2009-02-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +shm_open, shm_unlink \- POSIX ¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ÎºîÀ®/¥ª¡¼¥×¥ó¡¢ +ºï½ü¤ò¹Ô¤¦ +.SH ½ñ¼° +.B #include +.br +.BR "#include " " /* mode Äê¿ôÍÑ */" +.br +.BR "#include " " /* O_* Äê¿ô¤ÎÄêµÁÍÑ */" +.sp +.BI "void * shm_open(const char *" name ", int " oflag ", mode_t " mode ); +.sp +.BI "int shm_unlink(const char *" name ); +.sp +\fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +.BR shm_open () +¤Ï¡¢POSIX ¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò¿·µ¬¤ËºîÀ®/¥ª¡¼¥×¥ó¤·¤¿¤ê¡¢ +¤¹¤Ç¤Ë¸ºß¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤ò¥ª¡¼¥×¥ó¤·¤¿¤ê¤¹¤ë¡£ +POSIX ¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢¼ÂºÝ¤Ë¤Ï¡¢´Ø·¸¤Î¤Ê¤¤¥×¥í¥»¥¹¤¬ +¶¦Í­¥á¥â¥ê¤ÎƱ¤¸Îΰè¤ò +.BR mmap (2) +¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¼êÃʤǤ¢¤ë¡£ +.BR shm_unlink () +¤Ï¡¢µÕ¤ÎÁàºî¡¢¤Ä¤Þ¤ê°ÊÁ°¤Ë +.BR shm_open () +¤ÇºîÀ®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤Îºï½ü¤ò¹Ô¤¦¡£ +.LP +.BR shm_open () +¤ÎÆ°ºî¤Ï +.BR open (2) +¤È¤è¤¯»÷¤Æ¤¤¤ë¡£ +.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. +¥¹¥é¥Ã¥·¥å¤Ç»Ï¤Þ¤ê¡¢¥¹¥é¥Ã¥·¥å°Ê³°¤Îʸ»ú¤¬ 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. +.LP +.I oflag +¤Ï¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¡¢ +.B O_RDONLY +¤È +.B O_RDWR +¤Î¤¤¤º¤ì¤«°ìÊý¤È¡¢°Ê²¼¤Ë½Ò¤Ù¤ë¾¤Î¥Õ¥é¥°¤ÎÏÀÍýϤò¤È¤Ã¤¿¤â¤Î +¤ò»ØÄꤹ¤ë¡£ +.TP 1.1i +.B O_RDONLY +Æɤ߽Ф·¥¢¥¯¥»¥¹ÍѤ˥ª¥Ö¥¸¥§¥¯¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤¿¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢ +Æɤ߽Ф· (\fBPROT_READ\fP) ¥¢¥¯¥»¥¹¤Ç¤Î¤ß +.BR mmap (2) +¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B O_RDWR +Æɤ߽ñ¤­¥¢¥¯¥»¥¹ÍѤ˥ª¥Ö¥¸¥§¥¯¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +.TP +.B O_CREAT +¸ºß¤·¤Ê¤¤¾ì¹ç¡¢¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤¹¤ë¡£ +¥ª¥Ö¥¸¥§¥¯¥È¤Î¥æ¡¼¥¶¤È¥°¥ë¡¼¥×¤Î½êÍ­¸¢¤Ï¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ÎÂбþ¤¹¤ë¼Â¸ú ID ¤¬»È¤ï¤ì¡¢ +.\" ËÜÅö¤Ï¡¢Linux ¤Ç¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID ¤¬»È¤ï¤ì¤ë¤Î¤À¤¬¡¢ +.\" ¤½¤ÎÃͤϤۤȤó¤É¤¤¤Ä¤â¼Â¸ú ID ¤ÈƱ¤¸¤Ç¤¢¤ë¡£ (MTK, Jul 05) +¥ª¥Ö¥¸¥§¥¯¥È¤Îµö²Ä¥Ó¥Ã¥È¤Ï +.I mode +¤Î²¼°Ì 9 ¥Ó¥Ã¥È¤Ë´ð¤Å¤¤¤ÆÀßÄꤵ¤ì¤ë¡£¤¿¤À¤·¡¢ +¥Õ¥¡¥¤¥ë¥â¡¼¥ÉºîÀ®¥Þ¥¹¥¯ +.RB ( umask (2) +»²¾È) ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ëÃͤϡ¢¿·µ¬¥ª¥Ö¥¸¥§¥¯¥È¤Ë´Ø¤·¤Æ¤Ï¥¯¥ê¥¢¤µ¤ì¤ë¡£ +.I mode +¤òÄêµÁ¤¹¤ë¤¿¤á¤Ë»ÈÍѤǤ­¤ë¥Þ¥¯¥íÄê¿ô(·²)¤Ï +.BR open (2) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë +(¤³¤ì¤é¤ÎÄê¿ô¤Î¥·¥ó¥Ü¥ëÄêµÁ¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ë¤è¤êÆÀ¤é¤ì¤ë)¡£ +.sp +¿·µ¬¤ËºîÀ®¤µ¤ì¤¿¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ÏŤµ 0 ¤Ç½é´ü²½¤µ¤ì¤ë¡£ +¥ª¥Ö¥¸¥§¥¯¥È¤ÎÂ礭¤µ¤Ï +.BR ftruncate (2) +¤ò»È¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡£ +¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ¿·µ¬¤Ë³ÎÊݤµ¤ì¤¿¥Ð¥¤¥È¤Ï¼«Æ°Åª¤Ë +0 ¤Ë½é´ü²½¤µ¤ì¤ë¡£ +.TP +.B O_EXCL +.B O_CREAT +¤¬°ì½ï¤Ë»ØÄꤵ¤ì¤Æ¤ª¤ê¡¢ +.I name +¤Ç»ØÄꤵ¤ì¤¿¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤¬´û¤Ë¸ºß¤·¤¿¾ì¹ç¡¢ +¥¨¥é¡¼¤òÊÖ¤¹¡£ +¥ª¥Ö¥¸¥§¥¯¥È¤Î¸ºß³Îǧ¤È¡¢Â¸ºß¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Î¥ª¥Ö¥¸¥§¥¯¥ÈºîÀ®¤Ï¡¢ +ɬ¤º°ìÏ¢¤ÎÁàºî¤È¤·¤Æ¼Â¹Ô¤µ¤ì¤ë (performed atomically)¡£ +.TP +.B O_TRUNC +¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤¬¤¹¤Ç¤Ë¸ºß¤·¤¿¾ì¹ç¡¢ +¤½¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò 0 ¥Ð¥¤¥È¤ËÀÚ¤êµÍ¤á¤ë¡£ +.LP +¤³¤ì¤é¤Î¥Õ¥é¥°ÃͤÎÄêµÁ¤Ï +.I +¤Î¥¤¥ó¥¯¥ë¡¼¥É¤Ë¤è¤êÆÀ¤é¤ì¤ë¡£ +.LP +À®¸ù¤·¤Æ´°Î»¤·¤¿¾ì¹ç¡¢ +.BR shm_open () +¤Ï¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò»²¾È¤¹¤ë¿·¤·¤¤¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤½¤Î¥×¥í¥»¥¹Æâ¤Ç²áµî¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤ +¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÃæ¤ÇºÇ¤â¾®¤µ¤Ê¿ô¤Ë¤Ê¤ë¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ +.B FD_CLOEXEC +¥Õ¥é¥° +.RB ( fcntl (2) +¤ò»²¾È) ¤¬¡¢¤³¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÀßÄꤵ¤ì¤ë¡£ +.PP +Ä̾¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤³¤Î¸å³¤±¤Æ¼Â¹Ô¤µ¤ì¤ë +.BR ftruncate (2) +(¿·µ¬¤ËºîÀ®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤Î¾ì¹ç¤Î¤ß) ¤È +.BR mmap (2) +¤Î¸Æ¤Ó½Ð¤·¤Ë»ÈÍѤµ¤ì¤ë¡£ +.BR mmap (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¸å¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤·¤Æ¤â¤è¤¯¡¢ +¥¯¥í¡¼¥º¤·¤Æ¤â¥á¥â¥ê¡¦¥Þ¥Ã¥Ô¥ó¥°¤Ë±Æ¶Á¤òÍ¿¤¨¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.PP +.BR shm_unlink () +¤ÎÆ°ºî¤Ï +.BR unlink (2) +¤È¤è¤¯»÷¤Æ¤¤¤ë: +¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È̾¤òºï½ü¤·¡¢¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤¬½èÍýÂоݤΠ+¥ª¥Ö¥¸¥§¥¯¥È¤ò¥¢¥ó¥Þ¥Ã¥×¤·¤¿»þÅÀ¤Ç¥ª¥Ö¥¸¥§¥¯¥È¤Î³ä¤êÅö¤Æ¤ò²ò½ü¤·¡¢ +Âбþ¤¹¤ë¥á¥â¥êÎΰè¤ÎÆâÍƤòÇË´þ¤¹¤ë¡£ +.BR shm_unlink () +¤¬À®¸ù¤·¤¿¸å¤Ç¡¢Æ±¤¸ +.I name +¤ò»ý¤Ä¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ·¤Æ +.BR shm_open () +¤ò¹Ô¤¦¤È¡¢ +.RB ( O_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç) ¼ºÇÔ¤¹¤ë¡£ +.RB ( O_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¿·¤·¤¯Ê̤Υª¥Ö¥¸¥§¥¯¥È¤¬ºîÀ®¤µ¤ì¤ë)¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR shm_open () +¤ÏÈóÉé¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +.BR shm_open () +¤Ï \-1 ¤òÊÖ¤¹¡£ +.BR shm_unlink () +¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç 0 ¤ò¡¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¼ºÇÔ¤·¤¿¾ì¹ç¡¢¥¨¥é¡¼¤Î¸¶°ø¤ò¼¨¤¹¤¿¤á +.I errno +¤¬ÀßÄꤵ¤ì¤ë¡£ +.I errno +¤ËÀßÄꤵ¤ì¤ëÃͤϰʲ¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.TP +.B EACCES +¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤ò +.BR shm_unlink () +¤¹¤ë¸¢¸Â¤¬¤Ê¤«¤Ã¤¿¡£ +.TP +.B EACCES +»ØÄꤵ¤ì¤¿ +.I mode +¤Ç +.I name +¤ò +.BR shm_open () +¤¹¤ë¸¢¸Â¤¬¤Ê¤«¤Ã¤¿¡£¤â¤·¤¯¤Ï¡¢ +.B O_TRUNC +¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¸Æ¤Ó½Ð¤·¸µ¤Ë¤Ï¤½¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ¹¤ë½ñ¤­¹þ¤ß¸¢¸Â¤¬ +¤Ê¤«¤Ã¤¿¡£ +.TP +.B EEXIST +.B O_CREAT +¤È +.B O_EXCL +¤ÎξÊý¤¬ +.BR shm_open () +¤Ë»ØÄꤵ¤ì¤¿¤¬¡¢ +.I name +¤Ç»ØÄꤵ¤ì¤¿¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤¬´û¤Ë¸ºß¤·¤¿¡£ +.TP +.B EINVAL +.BR shm_open () +¤ËÍ¿¤¨¤é¤ì¤¿ +.I name +°ú¤­¿ô¤¬ÉÔÀµ¤Ç¤¢¤Ã¤¿¡£ +.TP +.B EMFILE +¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó²Äǽ¤Ê¥Õ¥¡¥¤¥ë¿ô¤Î¾å¸Â¤Ë¤¹¤Ç¤Ë㤷¤Æ¤¤¤¿¡£ +.TP +.B ENAMETOOLONG +.I name +¤ÎŤµ¤¬ +.B PATH_MAX +¤ò±Û¤¨¤Æ¤¤¤ë¡£ +.TP +.B ENFILE +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¾å¸Â¤Ë㤷¤¿¡£ +.TP +.B ENOENT +¸ºß¤·¤Æ¤¤¤Ê¤¤ +.I name +¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò +.BR shm_open () +¤·¤è¤¦¤È¤·¤¿¤¬¡¢ +.B O_CREAT +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOENT +¸ºß¤·¤Ê¤¤ +.I name +¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò +.BR shm_unlink () +¤·¤è¤¦¤È¤·¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc 2.2 °Ê¹ß¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.LP +POSIX.1-2001 ¤Ë¤Ï¡¢¿·µ¬¤ËºîÀ®¤µ¤ì¤ë¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Î¥°¥ë¡¼¥×½êÍ­¸¢¤Ï¡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤« ¡Ö¥·¥¹¥Æ¥à¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥°¥ë¡¼¥× ID¡× +¤Î¤É¤Á¤é¤«¤ËÀßÄꤵ¤ì¤ë¡¢¤È½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.LP +POSIX ¤Ï +.B O_RDONLY +¤È +.B O_TRUNC +¤¬°ì½ï¤Ë»ØÄꤵ¤ì¤¿¾ì¹ç¤ÎÆ°ºî¤ò̤ÄêµÁ¤Ë¤·¤Æ¤¤¤ë¡£Linux ¤Ç¤Ï¡¢ +´û¸¤Î¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ¹¤ëÀÚ¤êµÍ¤á (truncate) ¤ÏÀ®¸ù¤¹¤ë¡£ +¤·¤«¤·¡¢Â¾¤Î Unix ¥·¥¹¥Æ¥à¤Ç¤âƱ¤¸¤Ç¤¢¤ë¤È¤Ï¸Â¤é¤Ê¤¤¡£ +.LP +Linux 2.4 ¤Ë¤ª¤±¤ë POSIX ¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È¤Î¼ÂÁõ¤Ï +ÀìÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»ÈÍѤ¹¤ë¡£¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÏÄ̾ï +.I /dev/shm +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +.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) diff --git a/release/man3/siginterrupt.3 b/release/man3/siginterrupt.3 new file mode 100644 index 00000000..ab7a4e0d --- /dev/null +++ b/release/man3/siginterrupt.3 @@ -0,0 +1,92 @@ +.\" 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 Sun Jul 25 10:40:51 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Apr 14 16:20:34 1996 by Andries Brouwer (aeb@cwi.nl) +.\" +.\" Japanese Version Copyright (c) 1998 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Sun May 24 13:44:00 JST 1998 +.\" by HANATAKA Shinya +.\" +.TH SIGINTERRUPT 3 2009-03-15 "" "Linux Programmer's Manual" +.SH ̾Á° +siginterrupt \- ¥·¥°¥Ê¥ë¤Ç¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ë³ä¤ê¹þ¤à¤³¤È¤òµö¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int siginterrupt(int " sig ", int " flag ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR siginterrupt (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.BR siginterrupt () +´Ø¿ô¤Ï¡¢¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬¥·¥°¥Ê¥ë \fIsig\fP +¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¸å¡¢ºÆ¼Â¹Ô¤ÎºÝ¤Î¿¶¤ëÉñ¤¤¤òÊѹ¹¤¹¤ë¡£ +\fIflag\fP °ú¤­¿ô¤¬µ¶ (0) ¤Ê¤é¤Ð¡¢¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬»ØÄꤷ¤¿ +¥·¥°¥Ê¥ë \fIsig\fP ¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¸å¤Ë¡¢¤½¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï +ºÆ¼Â¹Ô¤µ¤ì¤ë¡£¤³¤ì¤Ï Linux ¤Ë¤ª¤¤¤Æ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ç¤¢¤ë¡£°ìÊý¡¢ +.BR signal (2) +´Ø¿ô¤Ç¿·¤·¤¤¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¡¼¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï +¥Ç¥Õ¥©¥ë¥È¤Ç¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ÏÃæÃǤµ¤ì¤ë¡£ +.PP +\fIflag\fP °ú¤­¿ô¤¬¿¿ (1) ¤Ç¥Ç¡¼¥¿¤ÎžÁ÷¤¬Á´¤¯¹Ô¤Ê¤ï¤ì¤Æ¤¤¤Ê¤¤¤Ê¤é¤Ð¡¢ +¥·¥°¥Ê¥ë \fIsig\fP ¤Ç¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ÏÃæÃǤµ¤ì¤Æ¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +\fIerrno\fP ¤Ë +.B EINTR +¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +\fIflag\fP °ú¤­¿ô¤¬¿¿ (1) ¤Ç¥Ç¡¼¥¿¤ÎžÁ÷¤¬³«»Ï¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢ +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ÏÃæÃǤµ¤ì¡¢¤½¤ì¤Þ¤Ç¤Ë¼ÂºÝ¤ËžÁ÷¤µ¤ì¤¿¥Ç¡¼¥¿ +¤ÎÎ̤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR siginterrupt () +´Ø¿ô¤ÏÀ®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£ +¥·¥°¥Ê¥ëÈÖ¹æ \fIsig\fP ¤¬ÉÔÀµ¤Ê¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +»ØÄꤷ¤¿¥·¥°¥Ê¥ëÈֹ椬ÉÔÀµ¤Ç¤¢¤ë¡£ +.SH ½àµò +4.3BSD, POSIX.1-2001. +POSIX.1-2008 ¤Ï¡¢ +.BR siginterrupt () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +Âå¤ï¤ê¤Ë¡¢ +.BR sigaction (2) +¤Ë +.B SA_RESTART +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ»È¤¦¤³¤È¤ò¿ä¾©¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR signal (2) diff --git a/release/man3/signbit.3 b/release/man3/signbit.3 new file mode 100644 index 00000000..3416e0d9 --- /dev/null +++ b/release/man3/signbit.3 @@ -0,0 +1,63 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 +.\" +.TH SIGNBIT 3 2008-08-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +signbit \- ÉâÆ°¾®¿ôÅÀ¼Â¿ô¤ÎÉä¹æ (sign) ¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.B "#include " +.sp +.BI "int signbit(" x ");" +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR signbit (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR signbit () +¤Ï¡¢¤¢¤é¤æ¤ë¼ïÎà¤ÎÉâÆ°¾®¿ôÅÀ¼Â¿ô¤ËÂФ·¤Æ +ŬÍѲÄǽ¤ÊÈÆÍÑŪ¤Ê¥Þ¥¯¥í¤Ç¤¢¤ë¡£ +.I x +¤ÎÃͤÎÉä¹æ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢Èó 0 ¤ÎÃͤòÊÖ¤¹¡£ +.PP +¤³¤Î¥Þ¥¯¥í¤Ï +.I "x < 0.0" +¤ÈÁ´¤¯Æ±¤¸¤Ç¤Ï¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢IEEE 754 ¤ÎÉâÆ°¾®¿ôÅÀɽ¸½¤Ç¤Ï 0 ¤âÉä¹æ¤ò»ý¤Ä¤«¤é¤Ç¤¢¤ë¡£ +.I "-0.0 < 0.0" +¤È¤¤¤¦Èæ³Ó·ë²Ì¤Ïµ¶ (false) ¤À¤¬¡¢ +.IR "signbit (\-0.0)" +¤Ï Èó 0 ¤ÎÃͤòÊÖ¤¹¡£ + +NaN ¤È̵¸ÂÂç¤Ë¤ÏÉä¹æ¥Ó¥Ã¥È¤¬¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR signbit () +¥Þ¥¯¥í¤Ï +.I x +¤ÎÉä¹æ¤¬Éé¤Î¾ì¹ç 0 °Ê³°¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç 0 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.SH ½àµò +C99, POSIX.1-2001. +¤³¤Î´Ø¿ô¤Ï IEC 559 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë +(¤Þ¤¿ IEEE 754/IEEE 854 ¤Ç¤ÏÉÕÏ¿¤Ç¿ä¾©´Ø¿ô¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +.SH ´ØÏ¢¹àÌÜ +.BR copysign (3) diff --git a/release/man3/significand.3 b/release/man3/significand.3 new file mode 100644 index 00000000..41129b61 --- /dev/null +++ b/release/man3/significand.3 @@ -0,0 +1,56 @@ +.\" 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 +.\" +.TH SIGNIFICAND 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +significand, significandf, significandl \- ÉâÆ°¾®¿ôÅÀ¿ô¤Î²¾¿ô (mantissa) ¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "double significand(double " x ); +.br +.BI "float significandf(float " x ); +.br +.BI "long double significandl(long double " x ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR significand (), +.BR significandf (), +.BR significandl (): +_SVID_SOURCE || _BSD_SOURCE +.ad b +.SH ÀâÌÀ +.BR significand () +´Ø¿ô¤Ï +.I x +¤Î²¾¿ô¤ò [1,2) ¤ÎÈϰϤˤ·¤ÆÊÖ¤¹¡£ +¤³¤ì¤Ï¡¢°Ê²¼¤ÈÅù¤·¤¤¡£ +.sp +.in +4n +scalb(x, (double) \-ilogb(x)) +.in +.PP +¤³¤Î´Ø¿ô¤Ï¼ç¤Ë IEEE 754 ¤Ø¤Î½àµò¤òÄ´¤Ù¤ëɸ½à¥Æ¥¹¥È¤Ç»È¤ï¤ì¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç¤¢¤ë¡£¡£ +.I double +ÈǤϾ¤Î¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤âÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\" .SH ÍúÎò +.\" ¤³¤Î´Ø¿ô¤Ï BSD ¤ËͳÍ褹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ilogb (3), +.BR scalb (3) diff --git a/release/man3/sigpause.3 b/release/man3/sigpause.3 new file mode 100644 index 00000000..d003dbe2 --- /dev/null +++ b/release/man3/sigpause.3 @@ -0,0 +1,119 @@ +.\" Copyright (C) 2004 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. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1997-03-03, HANATAKA Shinya +.\" Updated 2005-12-05, Akihiro MOTOKI +.\" Catch up to LDP man-pages 2.16 +.\" Rename sigpause.2 to sigpause.3, and modified a little. +.\" +.\"WORD: signal ¥·¥°¥Ê¥ë +.\"WORD: interrupt ³ä¤ê¹þ¤ß +.\"WORD: mask ¥Þ¥¹¥¯ +.\"WORD: block ¥Ö¥í¥Ã¥¯¤¹¤ë +.\" +.TH SIGPAUSE 3 2005-12-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sigpause \- ¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤ò¥¢¥È¥ß¥Ã¥¯¤Ë²òÊü¤·¤Æ³ä¤ê¹þ¤ß¤òÂÔ¤Ä +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int sigpause(int " sigmask "); /* BSD */" +.sp +.BI "int sigpause(int " sig "); /* System V / Unix95 */" +.fi +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤ò»È¤ï¤Ê¤¤¤³¤È¡£ +Âå¤ï¤ê¤Ë +.BR sigsuspend (2) +¤ò»È¤¦¤³¤È¡£ +.LP +´Ø¿ô +.BR sigpause () +¤Ï¥·¥°¥Ê¥ë¤òÂԤĤ褦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯ (¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î¥»¥Ã¥È) ¤òÊѹ¹¤·¡¢ +¥·¥°¥Ê¥ë¤¬ÅþÃ夹¤ë¤Î¤òÂԤġ£ +¥·¥°¥Ê¥ë¤¬ÅþÃ夹¤ë¤È¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï¸µ¤ËÌᤵ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR sigpause () +¤¬Ê֤俾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤Æ¤¤¤ë¡£ +ÊÖ¤êÃÍ¤Ï \-1 ¤Ç¡¢ +.I errno +¤Ï +.B EINTR +¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ½àµò +System V ÈǤΠ+.BR sigpause () +¤Ï POSIX.1-2001 ¤Çɸ½à²½¤µ¤ì¤Æ¤¤¤ë¡£ +.SH È÷¹Í +.SS Îò»Ë +¤³¤Î´Ø¿ô¤Î¸ÅŵŪ¤Ê BSD ÈÇ¤Ï 4.2BSD ¤ÇÅо줷¤¿¡£ +¤³¤Î´Ø¿ô¤Ï¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò +.I sigmask +¤ËÀßÄꤹ¤ë¡£ +Unix95 ¤Ç¤Ï BSD ÈǤȸߴ¹À­¤Î¤Ê¤¤ System V ÈǤΤ³¤Î´Ø¿ô¤¬É¸½à²½¤µ¤ì¤¿¡£ +Unix95 ÈǤϡ¢»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë +.I sig +¤ò¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤«¤éºï½ü¤¹¤ë¤À¤±¤Ç¤¢¤ë¡£ +.\" __xpg_sigpause: Unix 95, spec 1170, SVID, SVr4, XPG +Ʊ¤¸Ì¾Á°¤Ç¸ß´¹À­¤Î¤Ê¤¤ 2 ¤Ä¤Î´Ø¿ô¤¬¤¢¤ë¤È¤¤¤¦ÉÔ¹¬¤Ê»öÂ֤ϡ¢ +.BR \%sigsuspend (2) +´Ø¿ô¤Ë¤è¤Ã¤Æ²ò¾Ã¤µ¤ì¤¿¡£ +¤³¤Î´Ø¿ô¤Ï +.RI ( int +¤ÎÂå¤ï¤ê¤Ë) +.B "sigset_t *" +°ú¤­¿ô¤ò¤È¤ë¡£ +.SS Linux ¤Ç¤ÎÃí°Õ +Linux ¤Ç¤Ï¡¢¤³¤Î¥ë¡¼¥Á¥ó¤Ï Sparc (sparc64) ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Î¤ß +¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ + +libc4 ¤È libc5 ¤Ë¤Ï BSD ÈǤ·¤«¤Ê¤¤¡£ + +µ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _BSD_SOURCE +¤¬ÄêµÁ¤µ¤ì¡¢ +.BR _POSIX_SOURCE , +.BR _POSIX_C_SOURCE , +.BR _XOPEN_SOURCE , +.BR _GNU_SOURCE , +.B _SVID_SOURCE +¤Î¤¤¤º¤ì¤âÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +glibc ¤Ï BSD ÈǤò»È¤¦¡£ +.B _XOPEN_SOURCE +¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¡¢System V ÈǤò»ÈÍѤ¹¤ë¡£ +.\" +.\" BSD ÈǤǤϡ¢ +.\" .RI ¡Ö sigmask +.\" ¤ò 0 ¤Ë¤·¤Æ¡¢¤É¤Î¥·¥°¥Ê¥ë¤â¥Ö¥í¥Ã¥¯¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡× +.\" ¤È¤¤¤¦¤Î¤¬¤è¤¯»È¤ï¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR sigaction (2), +.BR sigprocmask (2), +.BR sigsuspend (2), +.BR sigblock (3), +.BR sigvec (3), +.BR feature_test_macros (7) diff --git a/release/man3/sigset.3 b/release/man3/sigset.3 new file mode 100644 index 00000000..c059f6c7 --- /dev/null +++ b/release/man3/sigset.3 @@ -0,0 +1,263 @@ +'\" t +.\" Copyright (c) 2005 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. +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-12-04, Akihiro MOTOKI +.\" +.TH SIGSET 3 2009-03-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sigset, sighold, sigrelse, sigignore \- System V ÈÇ¥·¥°¥Ê¥ë API +.SH ½ñ¼° +.B #define _XOPEN_SOURCE 500 +.br +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "sighandler_t sigset(int " sig ", sighandler_t " disp ); +.sp +.BI "int sighold(int " sig ); +.sp +.BI "int sigrelse(int " sig ); +.sp +.BI "int sigignore(int " sig ); +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ÀΤʤ¬¤é¤Î System V ÈÇ¥·¥°¥Ê¥ë API ¤ò»ÈÍѤ·¤Æ¤¤¤ë¥×¥í¥°¥é¥à +¤ËÂФ·¤Æ¸ß´¹À­¤Î¤¢¤ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò glibc ¤ÇÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î API ¤Ï²áµî¤Î¤â¤Î¤Ç¤¢¤ê¡¢¿·¤·¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï +POSIX ¥·¥°¥Ê¥ë API +.RB ( sigaction (2), +.BR sigprocmask (2) +¤Ê¤É) ¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +´Ø¿ô +.BR sigset () +¤Ï¥·¥°¥Ê¥ë +.I sig +¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¡£ +.I disp +°ú¤­¿ô¤Ë¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Î¥¢¥É¥ì¥¹¤«¡¢ +°Ê²¼¤ÎÄê¿ô¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄê¤Ç¤­¤ë¡£ +.TP +.B SIG_DFL +.I sig +¤ÎÆ°ºî¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤¹¤ë¡£ +.TP +.B SIG_IGN +.I sig +¤ò̵»ë¤¹¤ë¡£ +.TP +.B SIG_HOLD +¤½¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë +.I sig +¤òÄɲ乤뤬¡¢ +.I sig +¤ÎÆ°ºî¤ÏÊѹ¹¤·¤Ê¤¤¡£ +.PP +.I disp +¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¥¢¥É¥ì¥¹¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë +.I sig +¤¬Äɲ䵤ì¤ë¡£ +.PP +.I disp +¤Ë +.B SIG_HOLD +°Ê³°¤ÎÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +¤½¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤«¤é +.I sig +¤¬ºï½ü¤µ¤ì¤ë¡£ +.PP +¥·¥°¥Ê¥ë +.B SIGKILL +¤È +.B SIGSTOP +¤ËÂФ¹¤ëÆ°ºî¤ÏÊѹ¹¤Ç¤­¤Ê¤¤¡£ +.PP +´Ø¿ô +.BR sighold () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë +.I sig +¤òÄɲ乤롣 + +´Ø¿ô +.BR sigrelse () +¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤«¤é +.I sig +¤òºï½ü¤¹¤ë¡£ + +´Ø¿ô +.BR sigignore () +¤Ï¡¢ +.I sig +¤ÎÆ°ºî¤ò +.B SIG_IGN +¤ËÀßÄꤹ¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR sigset () +¤ÏÀ®¸ù¤¹¤ë¤È¡¢ +¸Æ¤Ó½Ð¤·Á°¤Ë +.I sig +¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï +.B SIG_HOLD +¤òÊÖ¤·¡¢ +¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï +Êѹ¹Á°¤Î¤½¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR sigset () +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +⤷¡¢°Ê²¼¤Î¡Ö¥Ð¥°¡×¤ÎÀá¤â»²¾È¤Î¤³¤È¡£ + +´Ø¿ô +.BR sighold (), +.BR sigrelse (), +.BR sigignore () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.BR sigset () +¤Ë´Ø¤·¤Æ¤Ï¡¢ +.BR sigaction (2) +¤È +.BR sigprocmask (2) +¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£ + +.BR sighold () +¤È +.BR sigrelse () +¤Ë´Ø¤·¤Æ¤Ï¡¢ +.BR sigprocmask (2) +¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£ + +.BR sigignore () +¤Ë´Ø¤·¤Æ¤Ï¡¢ +.BR sigaction (2) +¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +¤³¤ì¤é¤Î´Ø¿ô¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ·¤Ê¤¤¤³¤È¡£ +POSIX.1-2008 ¤Ï¡¢ +.BR sighold (), +.BR sigignore (), +.BR sigpause (), +.BR sigrelse (), +.BR sigset () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +Âå¤ï¤ê¤Ë¡¢ +.BR sigaction (2), +.BR sigprocmask (2), +.BR pthread_sigmask (3), +.BR sigsuspend (2) +¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc 2.1 ¤ÇÅо줷¤¿¡£ + +.I sighandler_t +·¿¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ê¡¢¤³¤Î man page ¤Ç +.BR sigset () +¤Î¥×¥í¥È¥¿¥¤¥×¤ò¤è¤êÆɤߤ䤹¤¯¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤Æ¤¤¤ë¤À¤±¤Ç¤¢¤ë¡£ + +´Ø¿ô +.BR sigset () +¤Ï¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýµ¡¹½¤òÄ󶡤¹¤ë +.RI ( sa_mask +¤ò 0 ¤Ç +.BR sigaction (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤­¤ÈƱÍÍ)¡£ + +System V ¤Ç¤Ï¡¢´Ø¿ô +.BR signal () +¤¬Ä󶡤¹¤ë½èÍýµ¡¹½¤Ï¿®ÍêÀ­¤Î¤Ê¤¤¤â¤Î¤Ç¤¢¤ë +.RI ( sa_mask +¤ò +.IR "SA_RESETHAND | SA_NODEFER" +¤È¤·¤Æ +.BR sigaction (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤­¤ÈƱÍÍ)¡£ +BSD ¤Ç¤Ï¡¢ +.BR signal () +¤Ï¿®ÍêÀ­¤Î¤¢¤ë½èÍýµ¡¹½¤òÄ󶡤¹¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR signal () +¤Î¤³¤ÎÅÀ¤Ïµ¬Äꤷ¤Ê¤¤¤Þ¤Þ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤µ¤é¤Ê¤ë¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR signal (2) +¤ò»²¾È¡£ + +BSD ¤È System V ¤Î¤É¤Á¤é¤Î¥·¥¹¥Æ¥à¤Ç¤â +¥·¥°¥Ê¥ë¤òÂԤĤ¿¤á¤Ë¡¢ +.BR sigpause (3) +¤È¤¤¤¦Ì¾Á°¤Î´Ø¿ô¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +¤³¤Î´Ø¿ô¤Î°ú¤­¿ô¤ÏξÊý¤Î¥·¥¹¥Æ¥à¤Ç°Û¤Ê¤ë¡£ +¾ÜºÙ¤Ï +.BR sigpause (3) +¤ò»²¾È¡£ +.SH ¥Ð¥° +2.2 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢ +.I disp +¤Ë +.B SIG_HOLD +°Ê³°¤ÎÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.I sig +¤Î¥Ö¥í¥Ã¥¯²ò½ü¤ò¹Ô¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ + +2.3.5 °ÊÁ°¤ÎÁ´¤Æ¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢ +.BR sigset () +¤¬Êѹ¹Á°¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤òÀµ¤·¤¯ÊÖ¤µ¤Ê¤¤¾ì¹ç¤¬ 2¤Ä¤¢¤ë¡£ +°ì¤Ä¤á¤Ï¡¢ +.I disp +¤Ë +.B SIG_HOLD +¤¬»ØÄꤵ¤ì¤ë¤È¡¢À®¸ù¤·¤¿¾ì¹ç +.BR sigset () +¤Ï¾ï¤Ë +.B SIG_HOLD +¤òÊÖ¤¹¤³¤È¤Ç¤¢¤ë¡£ +Àµ¤·¤¯¤Ï¡¢(¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï) +Êѹ¹Á°¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤òÊÖ¤¹¤Ù¤­¤Ç¤¢¤ë +(¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¡¢ +.B SIG_HOLD +¤¬ÊÖ¤µ¤ì¤ë)¡£ +¤â¤¦°ì¤Ä¤Ï¡¢¥·¥°¥Ê¥ë¤¬¸½ºß¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +À®¸ù¤·¤¿¾ì¹ç¤Î +.BR sigset () +¤ÎÊÖ¤êÃÍ¤Ï +.B SIG_HOLD +¤Ë¤Ê¤ë¤Ù¤­¤Ç¤¢¤ë¤¬¡¢¼ÂºÝ¤Ë¤Ï +Êѹ¹Á°¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤ÎÌäÂê¤Ï glibc 2.5 °Ê¹ß¤Ç½¤Àµ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" See http://sourceware.org/bugzilla/show_bug.cgi?id=1951 +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR pause (2), +.BR sigaction (2), +.BR signal (2), +.BR sigprocmask (2), +.BR raise (3), +.BR sigpause (3), +.BR sigvec (3), +.BR feature_test_macros (7), +.BR signal (7) diff --git a/release/man3/sigsetops.3 b/release/man3/sigsetops.3 new file mode 100644 index 00000000..ea0a27d8 --- /dev/null +++ b/release/man3/sigsetops.3 @@ -0,0 +1,177 @@ +.\" Copyright (c) 1994 Mike Battersby +.\" +.\" 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 aeb, 960721 +.\" 2005-11-21, mtk, added descriptions of sigisemptyset(), sigandset(), +.\" and sigorset() +.\" 2007-10-26 mdw added wording that a sigset_t must be initialized +.\" prior to use +.\" +.\"WORD: signal set ¥·¥°¥Ê¥ë½¸¹ç +.\" +.\" Japanese Version Copyright (c) 1998 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1998-05-24, HANATAKA Shinya +.\" Updated 2005-12-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.16 +.\" Updated 2008-02-09, Akihiro MOTOKI , LDP v2.77 +.\" +.TH SIGSETOPS 3 2008-09-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sigemptyset, sigfillset, sigaddset, sigdelset, sigismember \- POSIX +¥·¥°¥Ê¥ë½¸¹ç¤ÎÁàºî +.SH ½ñ¼° +.B #include +.sp +.BI "int sigemptyset(sigset_t *" set ); +.sp +.BI "int sigfillset(sigset_t *" set ); +.sp +.BI "int sigaddset(sigset_t *" set ", int " signum ); +.sp +.BI "int sigdelset(sigset_t *" set ", int " signum ); +.sp +.BI "int sigismember(const sigset_t *" set ", int " signum ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR sigemptyset (), +.BR sigfillset (), +.BR sigaddset (), +.BR sigdelset (), +.BR sigismember (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï POSIX ¥·¥°¥Ê¥ë½¸¹ç(signal set)¤òÁàºî¤¹¤ë¤¿¤á»ÈÍѤ¹¤ë¡£ +.PP +.BR sigemptyset () +¤Ï +.I set +¤ÇÍ¿¤¨¤é¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤ò¶õ¤Ë½é´ü²½¤·¡¢¥·¥°¥Ê¥ë¤¬°ì¤Ä¤â +´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾õÂ֤ˤ¹¤ë¡£ +.PP +.BR sigfillset () +¤Ï +.I set +¤ÇÍ¿¤¨¤é¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤¬Á´¤Æ¤Î¥·¥°¥Ê¥ë¤ò´Þ¤à¤è¤¦¤Ë¤¹¤ë¡£ +.PP +.BR sigaddset () +¤È +.BR sigdelset () +¤Ï +.I set +¤Ë +.I signum +¥·¥°¥Ê¥ë¤ò¤½¤ì¤¾¤ì²Ã¤¨¤¿¤ê¡¢ºï½ü¤·¤¿¤ê¤¹¤ë¡£ +.PP +.BR sigismember () +¤Ï +.I signum +¤¬ +.I set +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¥Æ¥¹¥È¤¹¤ë¡£ +.PP +.I sigset_t +·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢´Ø¿ô +.BR sigaddset (), +.BR sigdelset (), +.BR sigismember () +¤ä¸å½Ò¤Î glibc ¤ÎÄɲôؿô +.RB ( sigisemptyset (), +.BR sigandset (), +.BR sigorset ()) +¤ËÅϤ¹Á°¤Ë¡¢ +.BR sigemptyset () +¤« +.BR sigfillset () +¤ò¸Æ¤Ó½Ð¤·¤Æ½é´ü²½¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +½é´ü²½¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Î·ë²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR sigemptyset (), +.BR sigfillset (), +.BR sigaddset (), +.BR sigdelset () +¤ÏÀ®¸ù¤¹¤ì¤Ð 0 ¤ò¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.PP +.BR sigismember () +¤Ï +.I signum +¤¬ +.I set +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ì¤Ð 1 ¤òÊÖ¤·¡¢´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I sig +¤¬Í­¸ú¤Ê¥·¥°¥Ê¥ë¤Ç¤Ï¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.SS glibc ¤Ç¤ÎÃí°Õ +.B _GNU_SOURCE +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +\fI\fP ¤Ç¥·¥°¥Ê¥ë½¸¹ç¤òÁàºî¤¹¤ë 3¤Ä¤Î´Ø¿ô¤¬ÄɲäǸø³«¤µ¤ì¤ë¡£ +.TP +.BI "int sigisemptyset(sigset_t *" set ); +.I set +¤Ë¥·¥°¥Ê¥ë¤¬°ì¤Ä¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð 1 ¤òÊÖ¤·¡¢ +¤½¤ì°Ê³°¤Ï 0 ¤òÊÖ¤¹¡£ +.TP +.BI "int sigorset(sigset_t *" dest ", sigset_t *" left \ +", sigset_t *" right ); +¥·¥°¥Ê¥ë½¸¹ç +.I left +¤È +.I left +¤ÎϽ¸¹ç¤ò +.I dest +¤Ë½ñ¤­¹þ¤à¡£ +.TP +.BI "int sigandset(sigset_t *" dest ", sigset_t *" left \ +", sigset_t *" right ); +¥·¥°¥Ê¥ë½¸¹ç +.I left +¤È +.I left +¤ÎÀѽ¸¹ç¤ò +.I dest +¤Ë½ñ¤­¹þ¤à¡£ +.PP +.BR sigorset () +¤È +.BR sigandset () +¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤ò¡¢¼ºÇÔ¤¹¤ë¤È \-1 ¤òÊÖ¤¹¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç¤¢¤ê¡¢(¾¤Ë¤âƱÍͤδؿô¤òÄ󶡤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â +¤¤¤¯¤Ä¤«¤Ï¤¢¤ë¤¬) °Ü¿¢À­¤ò¹Íθ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï»ÈÍѤòÈò¤±¤ë¤Ù¤­ +¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sigaction (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigsuspend (2) diff --git a/release/man3/sigvec.3 b/release/man3/sigvec.3 new file mode 100644 index 00000000..caa5d339 --- /dev/null +++ b/release/man3/sigvec.3 @@ -0,0 +1,256 @@ +'\" t +.\" Copyright (c) 2005 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. +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-12-04, Akihiro MOTOKI +.\" +.TH SIGVEC 3 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sigvec, sigblock, sigsetmask, siggetmask, sigmask \- BSD ÈÇ¥·¥°¥Ê¥ë API +.SH ½ñ¼° +.B #include +.sp +.BI "int sigvec(int " sig ", struct sigvec *" vec ", struct sigvec *" ovec ); +.sp +.BI "int sigmask(int " signum ); +.sp +.BI "int sigblock(int " mask ); +.sp +.BI "int sigsetmask(int " mask ); +.sp +.B int siggetmask(void); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô: +_BSD_SOURCE +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ÀΤʤ¬¤é¤Î BSD ÈÇ¥·¥°¥Ê¥ë API ¤ò»ÈÍѤ·¤Æ¤¤¤ë¥×¥í¥°¥é¥à +¤ËÂФ·¤Æ¸ß´¹À­¤Î¤¢¤ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò glibc ¤ÇÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î API ¤Ï²áµî¤Î¤â¤Î¤Ç¤¢¤ê¡¢¿·¤·¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï +POSIX ¥·¥°¥Ê¥ë API +.RB ( sigaction (2), +.BR sigprocmask (2) +¤Ê¤É) ¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +´Ø¿ô +.BR sigvec () +¤Ï¡¢(POSIX ¤Î +.BR sigaction (2) +¤ÈƱÍͤË) ¥·¥°¥Ê¥ë +.I sig +¤ÎÆ°ºî¤ÎÀßÄꡦ¼èÆÀ¤ò¹Ô¤¦¡£ +.I vec +¤Ï¡¢NULL °Ê³°¤Î¾ì¹ç¡¢ +.I sig +¤Î¿·¤·¤¤Æ°ºî¤òÄêµÁ¤·¤¿ +.I sigvec +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I ovec +¤Ï¡¢NULL °Ê³°¤Î¾ì¹ç¡¢ +.I sig +¤ÎÊѹ¹Á°¤ÎÆ°ºî¤òÊÖ¤¹¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë +.I sigvec +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +.I sig +¤ÎÆ°ºî¤òÊѹ¹¤»¤º¤Ë¸½ºß¤ÎÆ°ºî¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.I vec +¤Ë NULL ¤ò»ØÄꤷ¡¢ +.I ovec +¤Ë NULL ¤Ç¤Ê¤¤¥Ý¥¤¥ó¥¿¤ò»ØÄꤹ¤ì¤Ð¤è¤¤¡£ + +.B SIGKILL +¤È +.B SIGSTOP +¤ÎÆ°ºî¤ÏÊѹ¹¤Ç¤­¤Ê¤¤¡£ + +.I sigvec +¹½Â¤ÂΤϰʲ¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.in +4n +.nf + +struct sigvec { + void (*sv_handler)(); /* Signal disposition */ + int sv_mask; /* Signals to be blocked in handler */ + int sv_flags; /* Flags */ +}; + +.fi +.in +.I sv_handler +¥Õ¥£¡¼¥ë¥É¤Ï¥·¥°¥Ê¥ë¤ÎÆ°ºî¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Î¥¢¥É¥ì¥¹¤«¡¢ +.B SIG_DFL +¤È +.B SIG_IGN +¤Î¤¤¤º¤ì¤«¤ò»ØÄê¤Ç¤­¤ë¡£ +.B SIG_DFL +¤Ï¥·¥°¥Ê¥ë¤ËŬÍѤµ¤ì¤ë¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤ò°ÕÌ£¤·¡¢ +.B SIG_IGN +¤Ï¥·¥°¥Ê¥ë¤ò̵»ë¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ + +.I sv_handler +¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ +.I sv_mask +¤Ï¥Ï¥ó¥É¥é¤¬¼Â¹ÔÃæ¤Ë¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¤Ù¤­¥·¥°¥Ê¥ë¤Î¥Þ¥¹¥¯¤ò»ØÄꤹ¤ë¡£ +¤Þ¤¿¡¢¥Ï¥ó¥É¥é¤òµ¯Æ°¤·¤¿¥·¥°¥Ê¥ë¼«¿È¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¡£ +.B SIGKILL +¤« +.B SIGSTOP +¤ò¥Ö¥í¥Ã¥¯¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ÌۤäÆ̵»ë¤µ¤ì¤ë¡£ + +.I sv_handler +¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ +.I sv_flags +¥Õ¥£¡¼¥ë¥É¤Ï¥Ï¥ó¥É¥é¤¬¸Æ¤Ð¤ì¤¿ºÝ¤ÎµóÆ°¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢0 ¤«¡¢°Ê²¼¤Î¥Õ¥é¥°¤ò 1¸Ä°Ê¾å»ØÄê¤Ç¤­¤ë: +.TP +.B SV_INTERRUPT +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬Ää»ßÃæ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÃæÃǤ·¤¿¾ì¹ç¡¢ +¥Ï¥ó¥É¥é¤«¤éÉüµ¢¤·¤Æ¤â¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏºÆ³«¤µ¤ì¤º¡¢ +¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï +¥Ç¥Õ¥©¥ë¥È¤ÇºÆ³«¤µ¤ì¤ë¡£ +.TP +.B SV_RESETHAND +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë¥·¥°¥Ê¥ë¤ÎÆ°ºî¤ò +¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¤â¤¦°ìÅÙ +.BR sigvec () +¤ò¸Æ¤Ó½Ð¤·¤ÆÌÀ¼¨Åª¤Ëºï½ü¤µ¤ì¤ë¤«¡¢¥×¥í¥»¥¹¤¬ +.BR execve (2) +¤ò¼Â¹Ô¤¹¤ë¤Þ¤Ç¡¢¥Ï¥ó¥É¥é¤ÏÀßÄꤵ¤ì¤¿¤Þ¤Þ¤È¤Ê¤ë¡£ +.TP +.B SV_ONSTACK +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤Ç¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò¼Â¹Ô¤¹¤ë +(Îò»ËŪ¤Ë¡¢BSD ¤Ç¤ÏÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ÏÇѻߤµ¤ì¤¿´Ø¿ô +.BR sigstack () +¤ò»È¤Ã¤ÆÀßÄꤹ¤ë¡£POSIX ¤Ç¤Ï¡¢Âå¤ï¤ê¤Ë +.BR sigaltstack (2) +¤ò»ÈÍѤ¹¤ë)¡£ +.PP +´Ø¿ô +.BR sigmask () +¤Ï +.I signum +¤ËÂФ¹¤ë¡Ö¥·¥°¥Ê¥ë¥Þ¥¹¥¯¡×¤ò¹½À®¤·¤ÆÊÖ¤¹¡£ +Î㤨¤Ð¡¢°Ê²¼¤Î¤è¤¦¤Ê¥³¡¼¥É¤ò»È¤¦¤È¡¢ +.BR sigvec () +¤ËÅϤ¹ +.I vec.sv_mask +¤ò½é´ü²½¤Ç¤­¤ë¡£ +.nf + + vec.sv_mask = sigmask(SIGQUIT) | sigpause(SIGABRT); + /* Block SIGQUIT and SIGABRT during + handler execution */ +.fi +.PP +.BR sigblock () +´Ø¿ô¤Ï¡¢ +.I mask +¤Ë¤¢¤ë¥·¥°¥Ê¥ë¤ò¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ËÄɲä· +(POSIX ¤Î +.I sigprocmask(SIG_BLOCK) +¤ÈƱÍÍ)¡¢Êѹ¹Á°¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +.B SIGKILL +¤ä +.B SIGSTOP +¤ò¥Ö¥í¥Ã¥¯¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ÌۤäÆ̵»ë¤µ¤ì¤ë¡£ +.PP +.BR sigsetmask () +´Ø¿ô¤Ï¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò +.I mask +¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤷ (POSIX ¤Î +.I sigprocmask(SIG_SETMASK) +¤ÈƱÍÍ)¡¢Êѹ¹Á°¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +.PP +.BR siggetmask () +´Ø¿ô¤Ï¥×¥í¥»¥¹¤Î¸½ºß¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£¤³¤Î´Ø¿ô¤Ï +.I sigblock(0) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR sigvec () +´Ø¿ô¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ + +.BR sigblock () +¤È +.BR sigsetmask () +¤ÏÊѹ¹Á°¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ + +.BR sigmask () +´Ø¿ô¤Ï +.I signum +¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.BR sigaction (2) +¤È +.BR sigprocmask (2) +¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤Î¤¦¤Á +.BR siggetmask () +°Ê³°¤ÎÁ´¤Æ¤Ï 4.3BSD ¤Ë¤¢¤Ã¤¿¡£ +.BR siggetmask () +¤Î½Ð¼«¤Ï¤Ï¤Ã¤­¤ê¤·¤Ê¤¤¡£ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ê¡¢¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ·¤Ê¤¤¤³¤È¡£ +.SH Ãí°Õ +4.3BSD ¤Ç¤Ï¡¢¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýµ¡¹½¤òÄ󶡤¹¤ë +.RI ( vec.sv_mask +¤ò 0 ¤Ç +.BR sigvec () +¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤­¤ÈƱÍÍ)¡£ +System V ¤¬Ä󶡤¹¤ë½èÍýµ¡¹½¤Ï¿®ÍêÀ­¤Î¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢ +.BR signal () +¤Î¤³¤ÎÅÀ¤Ïµ¬Äꤷ¤Ê¤¤¤Þ¤Þ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤µ¤é¤Ê¤ë¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR signal (2) +¤ò»²¾È¡£ + +BSD ¤È System V ¤Î¤É¤Á¤é¤Î¥·¥¹¥Æ¥à¤Ç¤â +¥·¥°¥Ê¥ë¤òÂԤĤ¿¤á¤Ë¡¢ +.BR sigpause (3) +¤È¤¤¤¦Ì¾Á°¤Î´Ø¿ô¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +¤³¤Î´Ø¿ô¤Î°ú¤­¿ô¤ÏξÊý¤Î¥·¥¹¥Æ¥à¤Ç°Û¤Ê¤ë¡£ +¾ÜºÙ¤Ï +.BR sigpause (3) +¤ò»²¾È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (2), +.BR pause (2), +.BR sigaction (2), +.BR signal (2), +.BR sigprocmask (2), +.BR raise (3), +.BR sigpause (3), +.BR sigset (3), +.BR signal (7) diff --git a/release/man3/sigwait.3 b/release/man3/sigwait.3 new file mode 100644 index 00000000..56178499 --- /dev/null +++ b/release/man3/sigwait.3 @@ -0,0 +1,100 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 +.\" +.TH SIGWAIT 3 2009-02-10 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sigwait \- ¥·¥°¥Ê¥ë¤òÂÔ¤Ä +.SH ½ñ¼° +.nf +.B #include + +.BI " int sigwait(const sigset_t *" set ", int *" sig ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR sigwait (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +.BR sigwait () +´Ø¿ô¤Ï¡¢¥·¥°¥Ê¥ë½¸¹ç +.I set +¤Ç»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¤Î°ì¤Ä¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¡¢ +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤òÃæÃǤ¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¤½¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±¼è¤ê (¤Ä¤Þ¤ê¡¢½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Î¥ê¥¹¥È +¤«¤é¤½¤Î¥·¥°¥Ê¥ë¤òºï½ü¤·)¡¢¤½¤Î¥·¥°¥Ê¥ëÈÖ¹æ¤ò +.I sig +¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£ + +.BR sigwait () +¤ÎÆ°ºî¤Ï +.BR sigwaitinfo () +¤ÈƱ¤¸¤À¤¬¡¢°Ê²¼¤ÎÅÀ¤¬°Û¤Ê¤ë¡£ +.IP * 2 +.BR sigwait () +¤Ï¡¢¥·¥°¥Ê¥ë¤ÎÆâÍƤòɽ¤¹ +.I siginfo_t +¹½Â¤ÂΤòÊÖ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢Ã±¤Ë¥·¥°¥Ê¥ëÈÖ¹æ¤òÊÖ¤¹¡£ +.IP * +ÊÖ¤êÃͤ¬ +.BR sigwaitinfo () +¤È¤Ï°Û¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢ +.BR sigwait () +¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢Ä¾Á°¤Î¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.\" Does not occur for glibc. +.I set +¤Ë̵¸ú¤Ê¥·¥°¥Ê¥ëÈֹ椬Æþ¤Ã¤Æ¤¤¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.BR sigwait () +¤Ï +.BR sigtimedwait (2) +¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Îã +.BR pthread_sigmask (3) +¤ò»²¾È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sigaction (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigsuspend (2), +.BR sigwaitinfo (2), +.BR sigsetops (3), +.BR signal (7) diff --git a/release/man3/sin.3 b/release/man3/sin.3 new file mode 100644 index 00000000..d869b4d3 --- /dev/null +++ b/release/man3/sin.3 @@ -0,0 +1,120 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2009-02-04 "" "Linux Programmer's Manual" +.SH ̾Á° +sin, sinf, sinl \- Àµ¸¹ (¥µ¥¤¥ó) ´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double sin(double " x ); +.br +.BI "float sinf(float " x ); +.br +.BI "long double sinl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR sinf (), +.BR sinl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR sin () +´Ø¿ô¤Ï \fIx\fP ¤ÎÀµ¸¹ (¥µ¥¤¥ó) ¤ÎÃͤòÊÖ¤¹¡£ +\fIx\fP ¤Ï¥é¥¸¥¢¥óñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÀµ¸¹¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\" +.\" POSIX.1 allows an optional range error for subnormal x +.\" glibc 2.8 doesn't do this +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬Ìµ¸ÂÂç +.\" .I errno +.\" is set to +.\" .BR EDOM . +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I errno +¤òÀßÄꤷ¤Ê¤¤¡£ +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6781 +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.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) diff --git a/release/man3/sincos.3 b/release/man3/sincos.3 new file mode 100644 index 00000000..f9e6bfca --- /dev/null +++ b/release/man3/sincos.3 @@ -0,0 +1,84 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL, 2002-07-27 Walter Harms +.\" 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" +.SH ̾Á° +sincos, sincosf, sincosl \- Àµ¸¹¤È;¸¹¤òƱ»þ¤Ë·×»»¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void sincos(double " x ", double *" sin ", double *" cos ); +.br +.BI "void sincosf(float " x ", float *" sin ", float *" cos ); +.br +.BI "void sincosl(long double " x ", long double *" sin ", long double *" cos ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.SH ÀâÌÀ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÃæ¤Ë¤Ï¡¢Æ±¤¸³ÑÅÙ +.I x +¤Ë¤Ä¤¤¤ÆÀµ¸¹¤È;¸¹¤ÎξÊý¤Î·×»»¤¬É¬Íפʤâ¤Î¤¬¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ïξ¼Ô¤òƱ»þ¤Ë·×»»¤·¡¢¤½¤Î·ë²Ì¤ò +.I *sin +¤È +.I *cos +¤Ë³ÊǼ¤¹¤ë¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢ +.I *sin +¤È +.I *cos +¤Ë NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ +.I *sin +¤È +.I *cos +¤Ë NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I void +¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fp ¤¬Ìµ¸ÂÂç +.\" .I errno +.\" is set to +.\" .BR EDOM . +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.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. +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cos (3), +.BR sin (3), +.BR tan (3), +.BR feature_test_macros (7) diff --git a/release/man3/sinh.3 b/release/man3/sinh.3 new file mode 100644 index 00000000..be42f239 --- /dev/null +++ b/release/man3/sinh.3 @@ -0,0 +1,130 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" 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) +.\" +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +sinh, sinhf, sinhl \- ÁжÊÀþÀµ¸¹ (¥Ï¥¤¥Ñ¥Ü¥ê¥Ã¥¯¥µ¥¤¥ó) ´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double sinh(double " x ); +.br +.BI "float sinhf(float " x ); +.br +.BI "long double sinhl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR sinhf (), +.BR sinhl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR sinh () +´Ø¿ô¤ÏÁжÊÀþÀµ¸¹ (¥Ï¥¤¥Ñ¥Ü¥ê¥Ã¥¯¥µ¥¤¥ó) ´Ø¿ô¤ÎÃͤòÊÖ¤¹¡£ +¿ô³ØŪ¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.nf + + sinh(x) = (exp(x) \- exp(\-x)) / 2 +.fi +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÁжÊÀþÀµ¸¹¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 (\-0) ¤Î¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I 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. +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼ (range error): ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR acosh (3), +.BR asinh (3), +.BR atanh (3), +.BR cosh (3), +.BR csinh (3), +.BR tanh (3) diff --git a/release/man3/sleep.3 b/release/man3/sleep.3 new file mode 100644 index 00000000..b052de15 --- /dev/null +++ b/release/man3/sleep.3 @@ -0,0 +1,71 @@ +.\" 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 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 +.\" +.\" WORD: signal handler ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¡¼ +.\" +.TH SLEEP 3 2010-02-03 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +sleep \- »ØÄê¤ÎÉÿô¤Î´Ö¤À¤±µÙ»ß¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "unsigned int sleep(unsigned int " "seconds" ); +.fi +.SH ÀâÌÀ +.BR sleep () +¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤ò +.I seconds +Éô֤ޤ¿¤Ï̵»ë¤µ¤ì¤Ê¤¤¥·¥°¥Ê¥ë¤¬ÅþÃ夹¤ë¤Þ¤ÇµÙ»ß¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +Í׵ᤵ¤ì¤¿»þ´Ö¤¬²á¤®¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¡¼¤Ë³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¤Ï¡¢ +µÙ»ß¤Î»Ä¤ê»þ´Ö¤òÊÖ¤¹¡£ +.SH ½àµò +POSIX.1-2001. +.SH ¥Ð¥° +.BR sleep () +¤Ï +.B SIGALRM +¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£¤½¤Î¤¿¤á¡¢ +.BR alarm (2) +¤È +.BR sleep () +¤òº®¤¼¤Æ»ÈÍѤ¹¤ë¤Î¤Ï¡¢¤Þ¤º¤¤¹Í¤¨¤Ç¤¢¤ë¡£ +.PP +µÙ»ßÃæ¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¡¼¤«¤é +.BR longjmp (3) +¤ò»ÈÍѤ¹¤ë¤³¤È¤ä +.B SIGALRM +¤Î¥Ï¥ó¥É¥ê¥ó¥°¤òÊѹ¹¤¹¤ë¤³¤È¤Ï¡¢ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤·ë²Ì¤òÀ¸¤à¡£ +.SH ´ØÏ¢¹àÌÜ +.BR alarm (2), +.BR nanosleep (2), +.BR signal (2), +.BR signal (7) diff --git a/release/man3/sockatmark.3 b/release/man3/sockatmark.3 new file mode 100644 index 00000000..bdecc14c --- /dev/null +++ b/release/man3/sockatmark.3 @@ -0,0 +1,139 @@ +.\" Copyright (c) 2006, Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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-08-01 by Yuichi SATO , LDP v2.36 +.\" +.TH SOCKATMARK 3 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sockatmark \- ¤É¤Î¥½¥±¥Ã¥È¤ËÂÓ°è³° (out-of-band) ¥Þ¡¼¥¯¤¬ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¤«¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "int sockatmark(int " sockfd ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR sockatmark (): +_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +.ad b +.SH ÀâÌÀ +.BR sockatmark () +¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.I sockfd +¤Ç»²¾È¤µ¤ì¤ë¥½¥±¥Ã¥È¤ËÂÓ°è³°¥Þ¡¼¥¯¤¬ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¤«Èݤ«¤òÊÖ¤¹¡£ +¥½¥±¥Ã¥È¤Ë¥Þ¡¼¥¯¤¬ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥½¥±¥Ã¥È¤Ë¥Þ¡¼¥¯¤¬ÉÕ¤±¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤Î´Ø¿ô¤ÏÂÓ°è³°¥Þ¡¼¥¯¤òºï½ü¤·¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR sockatmark () +¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿¾ì¹ç¡¢¥½¥±¥Ã¥È¤ËÂÓ°è³°¥Þ¡¼¥¯¤¬ +ÉÕ¤±¤é¤ì¤Æ¤¤¤ì¤Ð 1 ¤òÊÖ¤·¡¢ÉÕ¤±¤é¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢¥¨¥é¡¼¤òɽ¤¹ \fIerrno\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I sockfd +¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.\" POSIX.1 says ENOTTY for this case +.I sockfd +¤Ï +.BR sockatmark () +¤¬Å¬ÍѤǤ­¤Ê¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR sockatmark () +¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.2.4 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.BR sockatmark () +¤¬ 1 ¤òÊÖ¤¹¾ì¹ç¡¢ÂÓ°è³°¥Ç¡¼¥¿¤Ï +.B MSG_OOB +¤ò»ØÄꤷ¤¿ +.BR recv (2) +¤ÇÆɤ߹þ¤à¤³¤È¤¬¤Ç¤­¤ë¡£ + +ÂÓ°è³°¥Ç¡¼¥¿¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¥×¥í¥È¥³¥ë¤Ç¤·¤« +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.BR sockatmark () +¤Ï +.B SIGURG +¥·¥°¥Ê¥ë¤Î¥Ï¥ó¥É¥é¤«¤é°ÂÁ´¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ + +.BR sockatmark () +¤Ï +.B SIOCATMARK +.BR ioctl (2) +Áàºî¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +glibc 2.4 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ +.BR sockatmark () +¤ÏÆ°ºî¤·¤Ê¤¤¡£ +.SH Îã +°Ê²¼¤Î¥³¡¼¥É¤Ï¡¢ +.B SIGURG +¥·¥°¥Ê¥ë¤ò¼õ¤±¼è¤Ã¤¿¸å¤Ë¥Þ¡¼¥¯¤Þ¤Ç¤ÎÁ´¤Æ¤Î¥Ç¡¼¥¿¤òÆɤ߹þ¤ó¤Ç (ÇË´þ¤·)¡¢ +¥Þ¡¼¥¯¤µ¤ì¤¿¥Ç¡¼¥¿¤Î¥Ð¥¤¥È¤òÆɤ߹þ¤à¤Î¤Ë»ÈÍѤǤ­¤ë¡£ +.nf + + char buf[BUF_LEN]; + char oobdata; + int atmark, s; + + for (;;) { + atmark = sockatmark(sockfd); + if (atmark == \-1) { + perror("sockatmark"); + break; + } + + if (atmark) + break; + + s = read(sockfd, buf, BUF_LEN) <= 0); + if (s == \-1) + perror("read"); + if (s <= 0) + break; + } + + if (atmark == 1) { + if (recv(sockfd, &oobdata, 1, MSG_OOB) == \-1) { + perror("recv"); + ... + } + } +.fi +.SH ´ØÏ¢¹àÌÜ +.BR fcntl (2), +.BR recv (2), +.BR send (2), +.BR tcp (7) diff --git a/release/man3/sqrt.3 b/release/man3/sqrt.3 new file mode 100644 index 00000000..2b23679d --- /dev/null +++ b/release/man3/sqrt.3 @@ -0,0 +1,111 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 +.\" +.TH SQRT 3 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +sqrt, sqrtf, sqrtl \- Ê¿Êýº¬´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double sqrt(double " x ); +.br +.BI "float sqrtf(float " x ); +.br +.BI "long double sqrtl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR sqrtf (), +.BR sqrtl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR sqrt () +´Ø¿ô¤Ï \fIx\fP ¤ÎÊ¿Êýº¬¤Î¤¦¤ÁÉé¤Ç¤Ê¤¤Êý¤ÎÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÊ¿Êýº¬¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 (\-0) ¤Î¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ 0 ̤Ëþ¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ +NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬ 0 ̤Ëþ +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cbrt (3), +.BR csqrt (3), +.BR hypot (3) diff --git a/release/man3/stdarg.3 b/release/man3/stdarg.3 new file mode 100644 index 00000000..1f57c58a --- /dev/null +++ b/release/man3/stdarg.3 @@ -0,0 +1,303 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)stdarg.3 6.8 (Berkeley) 6/29/91 +.\" +.\" Converted for Linux, Mon Nov 29 15:11:11 1993, faith@cs.unc.edu +.\" Additions, 2001-10-14, aeb +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Fri Mar 22 1998 by NAKANO Takeo +.\" Updated Tue Oct 16 2001 by Kentaro Shirakata +.\" +.TH STDARG 3 2001-10-14 "" "Linux Programmer's Manual" +.SH ̾Á° +stdarg, va_start, va_arg, va_end, va_copy \- ¸Ä¿ô¡¦·¿¤¬²ÄÊѤʰú¿ô¥ê¥¹¥È +.SH ½ñ¼° +.B #include +.sp +.BI "void va_start(va_list " ap ", " last ); +.br +.IB type " va_arg(va_list " ap ", " type ); +.br +.BI "void va_end(va_list " ap ); +.br +.BI "void va_copy(va_list " dest ", va_list " src ); +.SH ÀâÌÀ +´Ø¿ô¤Ï¸Æ¤Ó½Ð¤·¤ËºÝ¤·¤Æ¡¢¸Ä¿ô¤ä·¿¤¬²ÄÊѤʰú¿ô¤ò¤È¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤Ç¤Ï +.I va_list +·¿¤¬Àë¸À¤µ¤ì¤Æ¤ª¤ê¡¢3 ¤Ä¤Î¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£¤³¤ì¤é¤òÍѤ¤¤ë¤È¡¢ +¸Æ¤Ó½Ð¤µ¤ì¤¿´Ø¿ô¦¤Ç¤Ï¸Ä¿ô¤ä·¿¤òÃΤé¤Ê¤¤°ú¤­¿ô¤Î¥ê¥¹¥È¤ò¡¢½ç¤Ë°ì +¤Ä¤Å¤ÄÆɤ߹þ¤à¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +¸Æ¤Ó½Ð¤µ¤ì¤ë´Ø¿ô¤Ç¤Ï¡¢ +.I va_list +·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬Àë¸À¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬ +.BR va_start (), +.BR va_arg (), +.BR va_end () +¤Î³Æ¥Þ¥¯¥í¤Ë¤è¤Ã¤Æ°·¤ï¤ì¤ë¡£ +.SS va_start() +.BR va_start () +¥Þ¥¯¥í¤ÏºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤ì¤Ï +.I ap +¤ò½é´ü²½¤·¡¢ +.BR va_arg () +¤È +.BR va_end () +¤ÇÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +.PP +°ú¤­¿ô +.I last +¤Ï°ú¤­¿ô¥ê¥¹¥È¤Î¤¦¤Á¡¢²ÄÊѤÊÉôʬ¤ÎľÁ°¤ËÃÖ¤«¤ì¤ë°ú¤­¿ô¤Î̾Á°¤Ç¤¢ +¤ë¡£¤Ä¤Þ¤ê¸Æ¤Ó½Ð¤µ¤ì¤¿´Ø¿ô¤¬·¿¤òÃΤäƤ¤¤ëºÇ¸å¤Î°ú¤­¿ô¤Ç¤¢¤ë¡£ +.PP +¤³¤Î°ú¤­¿ô¤Ï¥ì¥¸¥¹¥¿ÊÑ¿ô¤ä´Ø¿ô¡¢ÇÛÎó¤È¤·¤Æ +Àë¸À¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¤³¤Î°ú¤­¿ô¤Î¥¢¥É¥ì¥¹¤¬ +.BR va_start () +¥Þ¥¯¥í¤ÇÍѤ¤¤é¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.SS va_arg() +.BR va_arg () +¥Þ¥¯¥í¤Ï¡¢¸Æ¤Ó½Ð¤·»þ¤Ë»ØÄꤵ¤ì¤¿°ú¤­¿ô¤Î¤¦¤Á¡¢ +¼¡¤Î°ÌÃ֤ˤ¢¤ë¤â¤Î¤ò»ØÄꤷ¤¿·¿ +.I type +¤ÎÃͤȤ·¤Æ¼èÆÀ¤¹¤ë¡£ +°ú¤­¿ô +.I ap +¤Ï +.I va_list +.I ap +¤Ç¡¢ +.BR va_start () +¤Ë¤è¤Ã¤Æ½é´ü²½¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +.BR va_arg () +¤ò¸Æ¤Ó½Ð¤¹¤´¤È¤Ë +.I ap +¤ÏÊѹ¹¤µ¤ì¡¢¼¡²ó¤Î¸Æ¤Ó½Ð¤·¤ÎºÝ¤Ë¡¢¤µ¤é¤Ë¼¡¤Î°ú¤­¿ô¤òÊÖ¤¹¤è¤¦¤Ë¤Ê¤ë¡£ +°ú¤­¿ô +.I type +¤Ï·¿¤Î̾Á°¤Ç¤¢¤ë¡£ +.I type +¤ÎÁ°¤Ë * ¤òÉÕ¤±¤ì¤Ð¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î·¿ÉÕ¤­¥Ý¥¤¥ó¥¿¤¬ÆÀ¤é¤ì¤ë¡£ +.PP +.BR va_start () +¥Þ¥¯¥í¤Îľ¸å¤Ë +.BR va_arg () +¤òºÇ½é¤Ë¼Â¹Ô¤¹¤ë¤È¡¢ +.I last +¤Î¼¡¤Î°ú¤­¿ô¤¬Ê֤롣³¤±¤Æ¼Â¹Ô¤¹¤ë¤È¡¢»Ä¤ê¤Î°ú¤­¿ô¤¬¤½¤ì¤¾¤ìÊ֤롣 +.PP +¼¡¤Î°ú¤­¿ô¤¬¤Ê¤«¤Ã¤¿¤ê¡¢ +.I type +¤¬¼¡¤Î°ú¤­¿ô¤Î¼ÂºÝ¤Î·¿¤È¸ß´¹¤Ç¤Ê¤¤¾ì¹ç (¥Ç¥Õ¥©¥ë¥È¤Î°ú¤­¿ôÊÑ´¹¤Ç°· +¤¨¤Ê¤«¤Ã¤¿¾ì¹ç) ¤Ë¤Ï¡¢Í½Â¬¤Ç¤­¤Ê¤¤¥¨¥é¡¼¤¬µ¯¤³¤ë¡£ +.PP +.I ap +¤¬ +.BI va_arg( ap , type ) +¤Î·Á¤Ç´Ø¿ô¤ËÅϤµ¤ì¤ë¤È¡¢ +.I ap +¤ÎÃͤϴؿô¤«¤éÊ֤äÆÍ褿¸å¤ÏÉÔÄê¤È¤Ê¤ë¡£ +.SS va_end() +.BR va_start () +¤¬¼Â¹Ô¤µ¤ì¤ëËè¤Ë¡¢Æ±¤¸´Ø¿ôÆâ¤ÇÂбþ¤¹¤ë +.BR va_end () +¤¬¼Â¹Ô¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BI va_end( ap ) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¸å¡¢ÊÑ¿ô +.I ap +¤ÎÃͤÏÉÔÄê¤È¤Ê¤ë¡£ +.BR va_start () +¤È +.BR va_end () +¤ÎÁȤò²¿²ó¤âʤ٤ƻȤ¦¤³¤È¤â²Äǽ¤Ç¤¢¤ë¡£ +.BR va_end () +¤Ï¥Þ¥¯¥í¤«¤â¤·¤ì¤Ê¤¤¤·´Ø¿ô¤«¤â¤·¤ì¤Ê¤¤¡£ +.SS va_copy() +¤¹¤°Ê¬¤«¤ë +.I va_list +¤Î¼ÂÁõ¤Ï¡¢variadic ¤Ê´Ø¿ô¤Î¥¹¥¿¥Ã¥¯¥Õ¥ì¡¼¥à¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.\"argrath: variadic? +¤³¤Î¤è¤¦¤Ê¾ì¹ç(¤Û¤È¤ó¤É¤Ï¤½¤¦¤Ç¤¢¤ë)¡¢ +ñ¤Ë°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ì¤Ð¤¤¤¤¤è¤¦¤Ë»×¤¨¤ë¡£ +.in +4n +.nf + +va_list aq = ap; + +.fi +.in +»ÄÇ°¤Ê¤¬¤é¡¢(Ťµ 1¤Î)¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤È¤·¤Æ°·¤¦¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +¤½¤Î¤è¤¦¤Ê¾ì¹ç¡¢°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.in +4n +.nf + +va_list aq; +*aq = *ap; + +.fi +.in +ºÇ¸å¤Ë¡¢°ú¤­¿ô¤ò¥ì¥¸¥¹¥¿¤ÇÅϤ¹¥·¥¹¥Æ¥à¤Î¾ì¹ç¡¢ +.BR va_start () +¤Ç¥á¥â¥ê¤ò³ä¤êÅö¤Æ¡¢°ú¤­¿ô¤ò³ÊǼ¤·¡¢ +¼¡¤Î°ú¤­¿ô¤¬¤É¤ì¤«¤ò»Ø¤·¼¨¤¹¤è¤¦¤Ë¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¤½¤·¤Æ +.BR va_arg () +¤Ç¥ê¥¹¥È¤ò½çÈ֤ˤ¿¤É¤ê¡¢ +.BR va_end () +¤Ç³ä¤êÅö¤Æ¤¿¥á¥â¥ê¤ò³«Êü¤¹¤ë¡£ +¤³¤Î¤è¤¦¤Ê¾õ¶·¤ËÂбþ¤¹¤ë¤¿¤á¡¢C99 ¤Ç¤Ï +.BR va_copy () +¥Þ¥¯¥í¤òÄɲä·¡¢ +Á°½Ò¤Î¤è¤¦¤Ê³ä¤êÅö¤Æ¤Ï°Ê²¼¤Î¤è¤¦¤ËÃÖ¤­´¹¤¨¤é¤ì¤ë¤è¤¦¤Ë¤·¤¿¡£ +.in +4n +.nf + +va_list aq; +va_copy(aq, ap); +\&... +va_end(aq); + +.fi +.in +.RE +.BR va_copy () +¤¬¼Â¹Ô¤µ¤ì¤ë¤´¤È¤Ë¡¢ +Âбþ¤¹¤ë +.BR va_end () +¤òƱ¤¸´Ø¿ôÆâ¤Ç¼Â¹Ô¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î̾Á°¤Ï¤Þ¤À draft proposal ¤Ê¤Î¤Ç¡¢ +.BR va_copy () +¤ÎÂå¤ï¤ê¤Ë +.B __va_copy +¤òÍѤ¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.SH ½àµò +.BR va_start (), +.BR va_arg (), +.BR va_end () +¥Þ¥¯¥í¤Ï C89 ½àµò¤Ç¤¢¤ë¡£ +.BR va_copy () +¤Ï C99 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ï¡¢°ÊÁ°¤«¤éÍѤ¤¤é¤ì¤Æ¤­¤¿Æ±Åù¤Î¥Þ¥¯¥í·²¤È +¸ß´¹¤Ç¤Ï\fI¤Ê¤¤\fP¡£²áµî¤Î¤â¤Î¤È¸ß´¹¤Ê¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢ +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤Ë¸ºß¤¹¤ë¡£ +.PP +Îò»ËŪ¤Ê¥»¥Ã¥È¥¢¥Ã¥×¤Ï°Ê²¼¤Î¤È¤ª¤ê¤Ç¤¢¤ë¡£ +.in +4n +.nf + +#include + +void +foo(va_alist) + va_dcl +{ + va_list ap; + + va_start(ap); + while (...) { + ... + x = va_arg(ap, type); + ... + } + va_end(ap); +} + +.fi +.in +.I va_start +¥Þ¥¯¥í¤Ë \(aq}\(aq ¤ò´Þ¤ß¡¢ +.I va_end +¥Þ¥¯¥í¤ËÂбþ¤¹¤ë \(aq{\(aq ¤ò´Þ¤à¥·¥¹¥Æ¥à¤â¤¢¤ë¤Î¤Ç¡¢ +¤³¤ÎÆó¤Ä¤Î¥Þ¥¯¥í¤ÏƱ¤¸´Ø¿ô¤Ë¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ¥Ð¥° +.B varargs +¥Þ¥¯¥í¤È¤Ï°Û¤Ê¤ê¡¢ +.B stdarg +¥Þ¥¯¥í¤Ç¤Ï¸ÇÄê°ú¤­¿ô¤Ê¤·¤Ç´Ø¿ô¤ò»ØÄꤹ¤ë¤³¤È¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤ì¤Ï +.B varargs +¥Ù¡¼¥¹¤Î¥³¡¼¥É¤ò +.B stdarg +¤Î¥³¡¼¥É¤Ë½ñ¤­´¹¤¨¤ë¤È¤­¤Ë¡¢ÌÌÅݤʺî¶È¤Î¤â¤È¤Ë¤Ê¤ë¡£ +¤Þ¤¿¡¢¤¹¤Ù¤Æ¤Î°ú¤­¿ô¤ò +.I va_list +¤È¤·¤Æ²ÄÊѸĻØÄꤷ¤¿¤¤¤è¤¦¤Ê¾ì¹ç +.RB ( vfprintf (3) +¤Ê¤É) ¤Ë¤â¾ã³²¤È¤Ê¤ë¡£ +.SH Îã +´Ø¿ô +.I foo +¤Ï½ñ¼°Ê¸»ú¤«¤é¤Ê¤ëʸ»úÎó¤ò¼õ¤±Æþ¤ì¡¢¤½¤Î½ñ¼°Ê¸»ú¤ËÂбþ¤¹¤ë·¿¤Ç²ÄÊѸĤΠ+°ú¤­¿ô¤òÆɤ߹þ¤ß¡¢°õ»ú¤¹¤ë¡£ +.nf + +#include +#include + +void +foo(char *fmt, ...) +{ + va_list ap; + int d; + char c, *s; + + va_start(ap, fmt); + while (*fmt) + switch (*fmt++) { + case \(aqs\(aq: /* string */ + s = va_arg(ap, char *); + printf("string %s\en", s); + break; + case \(aqd\(aq: /* int */ + d = va_arg(ap, int); + printf("int %d\en", d); + break; + case \(aqc\(aq: /* char */ + /* need a cast here since va_arg only + takes fully promoted types */ + c = (char) va_arg(ap, int); + printf("char %c\en", c); + break; + } + va_end(ap); +} +.fi diff --git a/release/man3/stdin.3 b/release/man3/stdin.3 new file mode 100644 index 00000000..15217cfc --- /dev/null +++ b/release/man3/stdin.3 @@ -0,0 +1,147 @@ +.\" From dholland@burgundy.eecs.harvard.edu Tue Mar 24 18:08:15 1998 +.\" +.\" This man page was written in 1998 by David A. Holland +.\" and placed in the Public Domain. Polished a bit by aeb. +.\" 2005-06-16 mtk, mentioned freopen() +.\" +.\" 2007-12-08, mtk, Converted from mdoc to man macros +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated 1998-03-22, NAKANO Takeo +.\" Updated 2005-09-04, Akihiro MOTOKI +.\" +.TH STDIN 3 2008-07-14 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +stdin, stdout, stderr \- ɸ½àÆþ½ÐÎÏ¥¹¥È¥ê¡¼¥à +.SH ½ñ¼° +.nf +.B #include + +.BI "extern FILE *" stdin ; +.BI "extern FILE *" stdout ; +.BI "extern FILE *" stderr ; +.fi +.SH ÀâÌÀ +ɸ½à¤Î´Ä¶­¤Ç¤Ï¡¢ Unix ¥×¥í¥°¥é¥à¤Ïµ¯Æ°»þ¤Ë¡¢¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥¹¥È¥ê¡¼ +¥à¤ò 3 ¤ÄÍ¿¤¨¤é¤ì¤ë¡£¤½¤ì¤¾¤ìÆþÎÏÍÑ¡¢½ÐÎÏÍÑ¡¢¿ÇÃÇ¥á¥Ã¥»¡¼¥¸¤ä¥¨¥é¡¼¥á¥Ã +¥»¡¼¥¸¤Îɽ¼¨ÍѤΤâ¤Î¤Ç¤¢¤ë¡£¤³¤ì¤é¤ÏÄ̾ï¥æ¡¼¥¶¤ÎüËö +.RB ( tty (4) +¤ò¸«¤è) ¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¿Æ¥×¥í¥»¥¹¤Ç¤ÎÁªÂò¡¦ÀßÄê¤Ë¤è¤Ã¤Æ¥Õ¥¡¥¤¥ë +¤ä¾¤Î¥Ç¥Ð¥¤¥¹¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤ë¤³¤È¤â¤¢¤ë +.RB ( sh (1) +¤Î¡Ö¥ê¥À¥¤¥ì¥¯¥·¥ç¥ó¡×¥»¥¯¥·¥ç¥ó¤â»²¾È¤Î¤³¤È)¡£ +.PP +ÆþÎÏ¥¹¥È¥ê¡¼¥à¤Ï "standard input" ¤È¸Æ¤Ð¤ì¤ë¡£½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ï +"standard output"¡¢¥¨¥é¡¼¥¹¥È¥ê¡¼¥à¤Ï "standard error" ¤È¸Æ¤Ð¤ì¤ë¡£ +¤³¤ì¤é¤ÎÍѸì¤òû½Ì¤·¤¿¤â¤Î¤¬¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ë¤ò¼¨¤¹¥·¥ó¥Ü¥ë¤È¤Ê¤ë¡£¤Ä +¤Þ¤ê +.IR stdin , +.IR stdout , +.I stderr +¤Ç¤¢¤ë¡£ +.PP +¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤Ï +.BR stdio (3) +¤Î¥Þ¥¯¥í¤Ç¡¢ FILE ¤Ø¤Î¥Ý¥¤¥ó¥¿·¿¤Ç¤¢¤ë¡£¤·¤¿¤¬¤Ã¤Æ +.BR fprintf (3) +¤ä +.BR fread (3) +¤Ê¤É¤Î´Ø¿ô¤È¤È¤â¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.I FILE +¤Ï Unix ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¥Ð¥Ã¥Õ¥¡µ¡Ç½¤òÄɲä·¤¿¥é¥Ã¥Ñ¡¼ +¤Ç¤¢¤ë¤«¤é¡¢¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ë¤âÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¡¢ Unix ¤Î raw ¥Õ¥¡ +¥¤¥ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.RB ( read (2) +¤ä +.BR lseek (2) +¤Ê¤É) ¤Ë¤è¤Ã¤Æ¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.PP +¥×¥í¥°¥é¥à¤Îµ¯Æ°»þ¤Ë¤Ï¡¢ +¥¹¥È¥ê¡¼¥à +.IR stdin , +.IR stdout , +.I stderr +¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÈÖ¹æ¤Ï¡¢ +¤½¤ì¤¾¤ì 0, 1, 2 ¤Ç¤¢¤ë¡£ +¥×¥ê¥×¥í¥»¥Ã¥µ¥·¥ó¥Ü¥ë +.BR STDIN_FILENO , +.BR STDOUT_FILENO , +.B STDERR_FILENO +¤Ï +.I +Ãæ¤Ç¤½¤ì¤¾¤ì¤³¤ì¤é¤ÎÃͤËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +(¤³¤ì¤é¤Î¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ +.BR freopen (3) +¤òŬÍѤ¹¤ë¤³¤È¤Ç¡¢¤½¤Î¥¹¥È¥ê¡¼¥à¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +¤ÎÈÖ¹æ¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£) +.PP +.I FILE +¤È raw ¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÊ»ÍѤϡ¢Í½´ü¤Ç¤­¤Ê¤¤·ë²Ì¤òÀ¸¤¸ +¤ë¤³¤È¤¬¤¢¤ë¤Î¤Ç¡¢Ä̾ï¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ (¥Þ¥¾¥Ò¥¹¥Æ¥£¥Ã¥¯¤Ê¿Í¤Ë: +POSIX.1 ¤Î¥»¥¯¥·¥ç¥ó 8.2.3 ¤Ë¤Ï¡¢¤³¤Îº®ÍѤÇÆ°ºî¤¬¤É¤Î¤è¤¦¤Ë¤Ê¤ê¤½¤¦ +¤«¤¬¾Ü¤·¤¯µ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£) +°ìÈÌŪ¤Ê¥ë¡¼¥ë¤Ï°Ê²¼¤ÎÄ̤ê: ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ +°·¤ï¤ì¡¢ stdio ¤Ïñ¤Ë¥é¥¤¥Ö¥é¥ê¤Ë¤è¤Ã¤Æ°·¤ï¤ì¤ë¤Î¤Ç¤¢¤ë¡£¤¹¤Ê¤ï¤ÁÎ㤨¤Ð +.BR exec (3) +¤Î¸å¤Ë¤Ï¡¢»Ò¥×¥í¥»¥¹¤Ï¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +¤ò¤¹¤Ù¤Æ·Ñ¾µ¤¹¤ë¤¬¡¢¿Æ¤«¤é¤Î¥¹¥È¥ê¡¼¥à¤Ï¤¹¤Ù¤Æ¥¢¥¯¥»¥¹ÉԲĤȤʤ롣 +.PP +¥·¥ó¥Ü¥ë +.IR stdin , +.IR stdout , +.I stderr +¤Ï¤¹¤Ù¤Æ¥Þ¥¯¥í¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢¤³¤ì¤é¤Ø¤ÎÂåÆþ +¤Ï°Ü¿¢À­¤òÊݾڤµ¤ì¤Ê¤¤¡£É¸½à¥¹¥È¥ê¡¼¥à¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô +.BR freopen (3) +¤òÍѤ¤¤ì¤Ð¡¢Ê̤Υե¡¥¤¥ë¤ò¼¨¤¹¤è¤¦¤ËÊѹ¹¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï +.IR stdin , +.IR stdout , +.I stderr +¤ÎºÆ³ä¤êÅö¤Æ¤¬²Äǽ¤Ê¤è¤¦¤ËÆÃÊ̤ËƳÆþ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ +ɸ½à¥¹¥È¥ê¡¼¥à¤Ï +.BR exit (3) +¤Î¸Æ¤Ó½Ð¤·¤È¡¢¥×¥í¥°¥é¥à¤ÎÀµ¾ï½ªÎ»¤Ë¤è¤Ã¤Æ¥¯¥í¡¼¥º¤µ¤ì¤ë¡£ +.SH ½àµò +.IR stdin , +.IR stdout , +.I stderr +¥Þ¥¯¥í¤Ï C89 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +¤Þ¤¿ C89 ¤Ç¤Ï¡¢¤³¤ì¤é 3 ¤Ä¤Î¥¹¥È¥ê¡¼¥à¤¬¥×¥í¥°¥é¥à +¤Îµ¯Æ°»þ¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤Ù¤­¤Ç¤¢¤ë¤³¤È¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.I stderr +¥¹¥È¥ê¡¼¥à¤Ï¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.I stdout +¥¹¥È¥ê¡¼¥à¤Ï¡¢Ã¼Ëö¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ë¤Ï¹Ôñ°Ì¤Ç¥Ð¥Ã¥Õ¥¡¥ê¥ó¥° +¤µ¤ì¤Æ¤¤¤ë¡£°ì¹Ô¤ËËþ¤¿¤Ê¤¤ÆâÍƤϡ¢ +.BR fflush (3) +¤« +.BR exit (3) +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤«¡¢²þ¹Ôʸ»ú¤¬°õ»ú¤µ¤ì¤ë¤Þ¤Çɽ¼¨¤µ¤ì¤Ê¤¤¡£¤³¤ì¤Ï¡¢ +Æä˥ǥХå°»þ¤Ë¤ª¤¤¤Æ¡¢Í½´ü¤·¤Ê¤¤·ë²Ì¤òÀ¸¤¸¤ë¸¶°ø¤È¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +ɸ½à¥¹¥È¥ê¡¼¥à¤Î (¤¢¤ë¤¤¤Ï¾¤Î¤¹¤Ù¤Æ¤Î¥¹¥È¥ê¡¼¥à¤Î) +¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¥â¡¼¥É¤Ï¡¢ +.BR setbuf (3) +¤Þ¤¿¤Ï +.BR setvbuf (3) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤ÆÊѹ¹¤Ç¤­¤ë¡£ +¤¿¤À¤·¡¢ +.I stdin +¤¬Ã¼Ëö¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ï¡¢Ã¼Ëö¤Î¥É¥é¥¤¥Ð¤Ç¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤ë +²ÄǽÀ­¤¬¤¢¤ëÅÀ¤Ë¤âÃí°Õ¤¹¤ë¤³¤È¡£¤³¤ì¤Ï stdio ¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤È¤ÏÁ´¤¯ +´Ø·¸¤Ê¤¯Â¸ºß¤·¤¦¤ë¡£ (¼ÂºÝ¡¢Ä̾ï¤À¤ÈüËöÆþÎϤϥ«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¹Ôñ°Ì +¤Ç¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤ë¡£) ¤³¤Î¥«¡¼¥Í¥ë¤Ë¤è¤ëÆþÎϤΰ·¤¤¤Ï +.BR tcsetattr (3) +¤Ê¤É¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤ÆÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR stty (1) +¤È +.BR termios (3) +¤â»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR csh (1), +.BR sh (1), +.BR open (2), +.BR fopen (3), +.BR stdio (3) diff --git a/release/man3/stdio.3 b/release/man3/stdio.3 new file mode 100644 index 00000000..60483657 --- /dev/null +++ b/release/man3/stdio.3 @@ -0,0 +1,276 @@ +.\" Copyright (c) 1990, 1991 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. +.\" +.\" @(#)stdio.3 6.5 (Berkeley) 5/6/91 +.\" +.\" Converted for Linux, Mon Nov 29 16:07:22 1993, faith@cs.unc.edu +.\" Modified, 2001-12-26, aeb +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated Mon Jan 20 23:06:18 JST 1997 +.\" by YOSHINO Takashi +.\" Updated & Modified Thu Feb 14 21:39:49 JST 2002 +.\" by Yuichi SATO +.\" Updated & Modified Sun Sep 7 14:36:19 JST 2003 +.\" by Yuichi SATO +.\" Updated & Modified Sat Jan 17 03:18:29 JST 2004 by Yuichi SATO +.\" +.\"WORD: position indicator °ÌÃֻؼ¨»Ò +.\"WORD: positioning requests °ÌÃÖ»ØÄê¥ê¥¯¥¨¥¹¥È +.\" +.TH STDIO 3 2001-12-26 "" "Linux Programmer's Manual" +.SH ̾Á° +stdio \- ɸ½àÆþ½ÐÎϥ饤¥Ö¥é¥ê´Ø¿ô +.SH ½ñ¼° +.B #include +.sp +.BI "FILE *" stdin ; +.br +.BI "FILE *" stdout ; +.br +.BI "FILE *" stderr ; +.SH ÀâÌÀ +ɸ½àÆþ½ÐÎϥ饤¥Ö¥é¥ê¤Ï¡¢´Êñ¤«¤Ä¸ú²Ì¤Î¤è¤¤¡¢ +¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤¿¥¹¥È¥ê¡¼¥àÆþ½ÐÎÏ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +ÆþÎϤȽÐÎϤÏÏÀÍý¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥à¤Ë³ä¤êÉÕ¤±¤é¤ì¡¢ +Æþ½ÐÎϤÎʪÍýŪ¤ÊÆÃħ¤Ï±£Ê䵤ì¤ë¡£ +¤³¤Î¥é¥¤¥Ö¥é¥ê¤Ë°¤¹¤ë´Ø¿ô¤È¥Þ¥¯¥í¤ò°Ê²¼¤Ëµó¤²¤ë¡£ +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¸Ä¡¹¤Î man ¥Ú¡¼¥¸¤«¤éÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +¥Õ¥¡¥¤¥ë¤ò +.I ¥ª¡¼¥×¥ó (open) ¤¹¤ë +¤³¤È¤Ë¤è¤Ã¤Æ¡¢ +¥¹¥È¥ê¡¼¥à¤Ï³°Éô¥Õ¥¡¥¤¥ë (Ä̾ï¤ÏʪÍý¥Ç¥Ð¥¤¥¹) ¤ËÏ¢·ë¤µ¤ì¤ë¡£ +¤³¤ÎÁàºî¤Ë¤Ï¿·¤·¤¯¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¤³¤È¤â´Þ¤Þ¤ì¤ë¡£ +´û¸¤Î¥Õ¥¡¥¤¥ë¤ÈƱ¤¸Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤ò¿·¤¿¤Ëºî¤ë¤È¡¢ +¤â¤È¤Î¥Õ¥¡¥¤¥ë¤ÎÃæ¿È¤¬¼Î¤Æ¤é¤ì¤Æ¤·¤Þ¤¦¡£ +¥Õ¥¡¥¤¥ë¤¬°ÌÃÖ»ØÄê¥ê¥¯¥¨¥¹¥È¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë +(¥Ç¥£¥¹¥¯¥Õ¥¡¥¤¥ë¤Ê¤É¤¬ÁêÅö¤¹¤ë¡£µÕ¤ÎÎã¤È¤·¤Æ¤ÏüËö¤¬µó¤²¤é¤ì¤ë) ¾ì¹ç¡¢ +¤½¤Î¥¹¥È¥ê¡¼¥à¤ËÏ¢·ë¤µ¤ì¤¿ +.I ¥Õ¥¡¥¤¥ë°ÌÃֻؼ¨»Ò (file position indicator) +¤Ï¡¢Äɲå⡼¥É¤Ç³«¤«¤ì¤Ê¤¤¸Â¤ê¥Õ¥¡¥¤¥ë¤ÎÀèƬ (0 ¥Ð¥¤¥ÈÌÜ) ¤Ë°ÌÃÖ¤¹¤ë¡£ +Äɲå⡼¥É¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢ +°ÌÃֻؼ¨»Ò¤ò¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤ËÃÖ¤«¤ì¤ë¤«ËöÈø¤ËÃÖ¤«¤ì¤ë¤«¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +°ÌÃֻؼ¨»Ò¤Ï¡¢ +°Ê¹ß¤ÎÆɤ߽ñ¤­¤ä°ÌÃÖ»ØÄê¥ê¥¯¥¨¥¹¥È¤Ë¤è¤Ã¤ÆÊѹ¹¤µ¤ì¤ë¡£ +¤¹¤Ù¤Æ¤ÎÆþÎϤϡ¢ +.BR fgetc (3) +´Ø¿ô¤ò¼¡¡¹¤Ë¸Æ¤Ó½Ð¤·¤Æʸ»ú¤òÆɤ߹þ¤ó¤À¤«¤Î¤è¤¦¤Ë¹Ô¤ï¤ì¤ë¡£ +°ìÊý¤¹¤Ù¤Æ¤Î½ÐÎϤϡ¢ +.BR fputc (3) +´Ø¿ô¤ò¼¡¡¹¤Ë¸Æ¤Ó½Ð¤·¤Æʸ»ú¤ò½ñ¤­¹þ¤ó¤À¤«¤Î¤è¤¦¤Ë¹Ô¤ï¤ì¤ë¡£ +.PP +¥Õ¥¡¥¤¥ë¤ò +.I ¥¯¥í¡¼¥º (close) ¤¹¤ë +¤³¤È¤Ë¤è¤Ã¤Æ¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ï¥¹¥È¥ê¡¼¥à¤«¤éÀÚ¤êÎ¥¤µ¤ì¤ë¡£ +½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ï¡¢¤½¤Î¥¹¥È¥ê¡¼¥à¤¬¥Õ¥¡¥¤¥ë¤«¤éÀÚ¤êÎ¥¤µ¤ì¤ëÁ°¤Ë¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë +(½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤¹¤Ù¤Æ¤Î¥Ð¥Ã¥Õ¥¡¤ÎÆâÍƤ¬¥Û¥¹¥È´Ä¶­¤ËžÁ÷¤µ¤ì¤ë)¡£ +.I FILE +¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÎÃͤϡ¢ +¥Õ¥¡¥¤¥ë¤òÊĤ¸¤¿¸å¤Ç¤ÏÉÔ³ÎÄê¤Ë¤Ê¤ë (¥´¥ß¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦)¡£ +.PP +¥Õ¥¡¥¤¥ë¤Ï¤½¤Î¸å (Ʊ¤¸¤Þ¤¿¤ÏÊÌ¤Î¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ) +ºÆ¤Ó¥ª¡¼¥×¥ó¤µ¤ì¤ë¤³¤È¤â¤¢¤ê¡¢ +¤½¤ÎÆâÍƤ¬½¤Àµ¤µ¤ì¤¿¤êÊѹ¹¤µ¤ì¤¿¤ê¤¹¤ë +(¤½¤Î¥Õ¥¡¥¤¥ë¤ÇÀèƬ¤Ø¤Î°ÌÃÖ°ÜÆ°¤¬²Äǽ¤Ç¤¢¤ì¤Ð)¡£ +main ´Ø¿ô¤¬¤â¤È¤Î¸Æ¤Ó½Ð¤·Â¦¤ËÊ֤俤ꡢ +.BR exit (3) +´Ø¿ô¤¬¸Æ¤Ð¤ì¤¿¾ì¹ç¡¢ +¥×¥í¥°¥é¥à¤Î½ªÎ»¤ÎÁ°¤Ë +¸½ºß³«¤¤¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤ÏÊĤ¸¤é¤ì¤ë +(¤½¤Î·ë²Ì¡¢¤¹¤Ù¤Æ¤Î½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ï¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë)¡£ +¥×¥í¥°¥é¥à¤ÎÄä»ß¤Ë +.BR abort (3) +¤Î¤è¤¦¤Ê¾¤ÎÊýË¡¤òÍѤ¤¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥Õ¥¡¥¤¥ë¤¬Àµ¤·¤¯ÊĤ¸¤é¤ì¤ëÊݾڤϤʤ¤¡£ +.PP +¥×¥í¥°¥é¥à¤Îµ¯Æ°»þ¤Ë 3 ¸Ä¤Î¥Æ¥­¥¹¥È¥¹¥È¥ê¡¼¥à¤¬Í½¤áÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +¤½¤ì¤é¤ÏÌÀ¼¨Åª¤Ë³«¤¯É¬Íפ¬¤Ê¤¤¡£ +\(em +.I ɸ½àÆþÎÏ (standard input) +(Ä̾ï¤ÎÆþÎϤòÆɤ߼è¤ë¤Î¤Ë»È¤¦)¡¢\(em +.I ɸ½à½ÐÎÏ (standard output) +(Ä̾ï¤Î½ÐÎϤò½ñ¤­¹þ¤à¤Î¤Ë»È¤¦)¡¢ +.I ɸ½à¥¨¥é¡¼½ÐÎÏ (standard error) +(¿ÇÃǽÐÎϤò½ñ¤­¹þ¤à¤Î¤Ë»È¤¦) ¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥¹¥È¥ê¡¼¥à¤Ï +.IR stdin , +.IR stdout , +.I stderr +¤Èû½Ì¤·¤Æɽ¸½¤µ¤ì¤ë¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿¤È¤­¤Ë¤Ï¡¢ +ɸ½à¥¨¥é¡¼¥¹¥È¥ê¡¼¥à¤Ï +´°Á´¤Ë¤Ï¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +ɸ½àÆþÎÏ¥¹¥È¥ê¡¼¥à¤Èɸ½à½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ï¡¢ +¥¹¥È¥ê¡¼¥à¤¬¥¤¥ó¥¿¥é¥¯¥Æ¥£¥Ö¤Ê¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +´°Á´¤Ë¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +üËö¥Ç¥Ð¥¤¥¹¤ò»²¾È¤¹¤ë½ÐÎÏ¥¹¥È¥ê¡¼¥à¤Ï¡¢ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¾ï¤Ë¹Ôñ°Ì¤Ç¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤ë¡£ +¤¿¤À¤·¤½¤Î¤è¤¦¤Ê¥¹¥È¥ê¡¼¥à¤Ë¤ª¤±¤ë¥Ð¥Ã¥Õ¥¡Æâ¤Î½ÐÎϤϡ¢ +üËö¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤ëÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é¤ÎÆɤ߹þ¤ß¤¬¤¢¤ë¤¿¤Ó¤Ë¡¢ +¼«Æ°Åª¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +½ÐÎÏüËö¤Ë¹Ô¤Î°ìÉô¤ò½ñ¤­¹þ¤ó¤À¸å¤ÇÂçÎ̤η׻»¤ò¹Ô¤¦¾ì¹ç¡¢ +½ÐÎϤ¬É½¼¨¤µ¤ì¤ë¤è¤¦¤Ë¡¢·×»»¤Ë¼è¤ê¤«¤«¤ëÁ°¤Ëɸ½à½ÐÎϤËÂФ·¤Æ +.BR fflush (3) +¤ò¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.PP +.I stdio +¥é¥¤¥Ö¥é¥ê¤Ï +.B libc +¥é¥¤¥Ö¥é¥ê¤Î°ìÉô¤Ç¤¢¤ê¡¢¥ë¡¼¥Á¥ó¤Ï +¥³¥ó¥Ñ¥¤¥é¡¼ +.BR cc (1) +¤È +.BR pc (1) +¤Ë¤è¤Ã¤ÆɬÍפʻþ¤Ë¼«Æ°Åª¤ËÆɤ߹þ¤Þ¤ì¤ë¡£ +¸å½Ò¤¹¤ë man ¥Ú¡¼¥¸Ãæ¤Î¡Ö½ñ¼°¡×¤ÎÀá¤Ë¤Ï¡¢ +¤É¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤«¡¢ +¤½¤Î´Ø¿ô¤Î¥³¥ó¥Ñ¥¤¥é¡¼Àë¸À¤Ï¤É¤Î¤è¤¦¤Ê¤â¤Î¤«¡¢ +¤É¤Î¤è¤¦¤Ê³°ÉôÊÑ¿ô¤¬´Ø·¸¤¹¤ë¤Î¤«¤¬¼¨¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.BR BUFSIZ , +.BR EOF , +.BR FILENAME_MAX , +.BR FOPEN_MAX , +.BR L_cuserid , +.BR L_ctermid , +.BR L_tmpnam , +.BR NULL , +.BR SEEK_END , +.BR SEEK_SET , +.BR SEEK_CUR , +.BR TMP_MAX , +.BR clearerr , +.BR feof , +.BR ferror , +.BR fileno , +.\" Not on Linux: .BR fropen , +.\" Not on Linux: .BR fwopen , +.BR getc , +.BR getchar , +.BR putc , +.BR putchar , +.BR stderr , +.BR stdin , +.B stdout +¤Ï¥Þ¥¯¥í¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î̾Á°¤Ï¡¢¸½ºß¤ÎÄêµÁ¤ò +.B #undef +¤Çºï½ü¤·¤Ê¤¤¸Â¤ê¡¢ºÆÍøÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¥Þ¥¯¥í´Ø¿ô¤Î´Ø¿ôÈǤȤ·¤Æ¡¢ +.BR feof , +.BR ferror , +.BR clearerr , +.BR fileno , +.BR getc , +.BR getchar , +.BR putc , +.B putchar +¤¬¤¢¤ë¡£ +¥Þ¥¯¥í¤ÎÄêµÁ¤¬ÌÀ¼¨Åª¤Ë¾Ãµî¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤³¤ì¤é¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë¤Ê¤ë¤À¤í¤¦¡£ +.SS ´Ø¿ô¤Î¥ê¥¹¥È +.TS +; +lb lb +lb l. +´Ø¿ô ÀâÌÀ +_ +clearerr ¥¹¥È¥ê¡¼¥à¤Î¾õÂ֤γÎǧ¤È¥ê¥»¥Ã¥È +fclose ¥¹¥È¥ê¡¼¥à¤ò¥¯¥í¡¼¥º¤¹¤ë +fdopen ¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤¹¤ë +feof ¥¹¥È¥ê¡¼¥à¤Î¾õÂ֤γÎǧ¤È¥ê¥»¥Ã¥È +ferror ¥¹¥È¥ê¡¼¥à¤Î¾õÂ֤γÎǧ¤È¥ê¥»¥Ã¥È +fflush ¥¹¥È¥ê¡¼¥à¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë +fgetc ¼¡¤Îʸ»ú¤Þ¤¿¤Ï¸ì¤òÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é³ÍÆÀ¤¹¤ë +fgetpos ¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ¤ò¼èÆÀ¤¹¤ë +.\"nakano ¢¬¸¶Ê¸°ã¤¦¤Î¤Ç¤Ï? +fgets ¥¹¥È¥ê¡¼¥à¤«¤é¹Ô¤ò¼èÆÀ¤¹¤ë +fileno °ú¤­¿ô¤Ç¤¢¤ë¥¹¥È¥ê¡¼¥à¤ÎÀ°¿ôÃͤΥǥ£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹ +fopen ¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤¹¤ë +fprintf ½ñ¼°ÉÕ¤­½ÐÎÏÊÑ´¹ +fpurge ¥¹¥È¥ê¡¼¥à¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë +fputc ʸ»ú¤Þ¤¿¤Ï¸ì¤ò¥¹¥È¥ê¡¼¥à¤Ë½ÐÎϤ¹¤ë +fputs ¹Ô¤ò¥¹¥È¥ê¡¼¥à¤Ë½ÐÎϤ¹¤ë +fread ¥Ð¥¤¥Ê¥ê¡¼¥¹¥È¥ê¡¼¥àÆþ½ÐÎÏ +freopen ¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤¹¤ë +fscanf ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +fseek ¥¹¥È¥ê¡¼¥à¤Î°ÌÃֻؼ¨»Ò¤ò°ÜÆ°¤¹¤ë +fsetpos ¥¹¥È¥ê¡¼¥à¤Î°ÌÃֻؼ¨»Ò¤ò°ÜÆ°¤¹¤ë +ftell ¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ¤ò¼èÆÀ¤¹¤ë +.\"nakano ¢¬¤³¤ì¤â¡£ +fwrite ¥Ð¥¤¥Ê¥ê¡¼¥¹¥È¥ê¡¼¥àÆþ½ÐÎÏ +getc ¼¡¤Îʸ»ú¤Þ¤¿¤Ï¸ì¤òÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é¼èÆÀ¤¹¤ë +getchar ¼¡¤Îʸ»ú¤Þ¤¿¤Ï¸ì¤òÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é¼èÆÀ¤¹¤ë +gets ¹Ô¤òÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é¼èÆÀ¤¹¤ë +getw ¼¡¤Îʸ»ú¤Þ¤¿¤Ï¸ì¤òÆþÎÏ¥¹¥È¥ê¡¼¥à¤«¤é¼èÆÀ¤¹¤ë +mktemp ¾¤È½Å¤Ê¤é¤Ê¤¤¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë̾¤òºî¤ë +perror ¥·¥¹¥Æ¥à¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ +printf ½ñ¼°ÉÕ¤­½ÐÎÏÊÑ´¹ +putc ʸ»ú¤Þ¤¿¤Ï¸ì¤ò¥¹¥È¥ê¡¼¥à¤Ë½ÐÎϤ¹¤ë +putchar ʸ»ú¤Þ¤¿¤Ï¸ì¤ò¥¹¥È¥ê¡¼¥à¤Ë½ÐÎϤ¹¤ë +puts ¹Ô¤ò¥¹¥È¥ê¡¼¥à¤Ë½ÐÎϤ¹¤ë +putw ʸ»ú¤Þ¤¿¤Ï¸ì¤ò¥¹¥È¥ê¡¼¥à¤Ë½ÐÎϤ¹¤ë +remove ¥Ç¥£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê¤òºï½ü¤¹¤ë +rewind ¥¹¥È¥ê¡¼¥à¤Î°ÌÃֻؼ¨»Ò¤ò°ÜÆ°¤¹¤ë +scanf ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +setbuf ¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ÎÁàºî +setbuffer ¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ÎÁàºî +setlinebuf ¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ÎÁàºî +setvbuf ¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ÎÁàºî +sprintf ½ñ¼°ÉÕ¤­½ÐÎÏÊÑ´¹ +sscanf ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +strerror ¥·¥¹¥Æ¥à¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ +sys_errlist ¥·¥¹¥Æ¥à¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ +sys_nerr ¥·¥¹¥Æ¥à¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ +tempnam ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤ÎÁàºî +tmpfile ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤ÎÁàºî +tmpnam ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤ÎÁàºî +ungetc ÆþÎÏ¥¹¥È¥ê¡¼¥à¤Ø 1 ʸ»úÌ᤹¡£ +vfprintf ½ñ¼°ÉÕ¤­½ÐÎÏÊÑ´¹ +vfscanf ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +vprintf ½ñ¼°ÉÕ¤­½ÐÎÏÊÑ´¹ +vscanf ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +vsprintf ½ñ¼°ÉÕ¤­½ÐÎÏÊÑ´¹ +vsscanf ½ñ¼°ÉÕ¤­ÆþÎÏÊÑ´¹ +.TE +.SH ½àµò +.I stdio +¥é¥¤¥Ö¥é¥ê¤Ï C89 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR open (2), +.BR read (2), +.BR write (2), +.BR stdout (3), +.BR unlocked_stdio (3) diff --git a/release/man3/stdio_ext.3 b/release/man3/stdio_ext.3 new file mode 100644 index 00000000..e1c1a68d --- /dev/null +++ b/release/man3/stdio_ext.3 @@ -0,0 +1,124 @@ +.\" 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) 2002 Akihiro MOTOKI all rights reserved. +.\" Translated Nov 2 2002 by Akihiro MOTOKI +.TH STDIO_EXT 3 2001-12-16 "" "Linux Programmer's Manual" +.SH ̾Á° +__fbufsize, __flbf, __fpending, __fpurge, __freadable, +__freading, __fsetlocking, __fwritable, __fwriting, _flushlbf \- +ɸ½àÆþ½ÐÎÏ¥Õ¥¡¥¤¥ë¹½Â¤ÂΤؤΥ¤¥ó¥¿¥Õ¥§¡¼¥¹ +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.BI "size_t __fbufsize(FILE *" stream ); +.br +.BI "size_t __fpending(FILE *" stream ); +.br +.BI "int __flbf(FILE *" stream ); +.br +.BI "int __freadable(FILE *" stream ); +.br +.BI "int __fwritable(FILE *" stream ); +.br +.BI "int __freading(FILE *" stream ); +.br +.BI "int __fwriting(FILE *" stream ); +.br +.BI "int __fsetlocking(FILE *" stream ", int " type ); +.br +.B "void _flushlbf(void);" +.br +.BI "void __fpurge(FILE *" stream ); +.SH ÀâÌÀ +Solaris ¤Ç¤Ï¡¢ +.I FILE +¹½Â¤ÂΤÎÆâÉô¤Ø¥Ý¡¼¥¿¥Ö¥ë¤Ê¤«¤¿¤Á¤Ç +¥¢¥¯¥»¥¹¤Ç¤­¤ë¼êÃʤ¬Æ³Æþ¤µ¤ì¤Æ¤ª¤ê¡¢¤³¤ì¤é¤Ï glibc ¤Ç¤â¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +.BR __fbufsize () +´Ø¿ô¤Ï¡¢»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤¬»ÈÍѤ·¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡¡¦¥µ¥¤¥º¤òÊÖ¤¹¡£ +.LP +.BR __fpending () +´Ø¿ô¤Ï¡¢½ÐÎϥХåե¡¤ËÆþ¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¥ï¥¤¥É¥­¥ã¥é¥¯¥¿¤ò°·¤¦¥¹¥È¥ê¡¼¥à¤Î¾ì¹ç¡¢¥ï¥¤¥É¥­¥ã¥é¥¯¥¿Ã±°Ì¤Ç·×»»¤µ¤ì¤ë¡£ +¥Ð¥Ã¥Õ¥¡¤¬Æɤ߽Ф·¥â¡¼¥É¤Î¾ì¹ç¤äÆɤ߽Ф·ÀìÍѤdz«¤«¤ì¤Æ¤¤¤ë¾ì¹ç¤Î +¤³¤Î´Ø¿ô¤Î¿¶Éñ¤¤¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.LP +.BR __flbf () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬¥é¥¤¥ó¥Ð¥Ã¥Õ¥¡¤Î¾ì¹ç¤Ï 0 °Ê³°¤ò¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.BR __freadable () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬Æɤ߽Ф·²Äǽ¤Ê¾ì¹ç¤Ï 0 °Ê³°¤ò¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.BR __fwritable () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬½ñ¤­¹þ¤ß²Äǽ¤Ê¾ì¹ç¤Ï 0 °Ê³°¤ò¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.BR __freading () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬Æɤ߽Ф·ÀìÍѤξì¹ç¡¢¤Þ¤¿¤Ï¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ëľÁ°¤ÎÁàºî¤¬ +Æɤ߽Ф·Áàºî¤Ç¤¢¤Ã¤¿¾ì¹ç¤Ï 0 °Ê³°¤òÊÖ¤·¡¢¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.BR __fwriting () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬½ñ¤­¹þ¤ßÀìÍÑ(¤â¤·¤¯¤ÏÄɲÃÀìÍÑ)¤Î¾ì¹ç¡¢ +¤Þ¤¿¤Ï¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ëľÁ°¤ÎÁàºî¤¬½ñ¤­¹þ¤ßÁàºî¤Ç¤¢¤Ã¤¿¾ì¹ç¤Ï 0 °Ê³°¤òÊÖ¤·¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.BR __fsetlocking () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤Î¥í¥Ã¥¯·Á¼°¤òÁªÂò¤¹¤ë¤¿¤á¤Ë»ÈÍѤǤ­¤ë¡£ +ÊÖ¤êÃͤϡ¢¸½ºß¤Î¥í¥Ã¥¯·Á¼°¤Ç¤¢¤ë¡£ +.I type +°ú¤­¿ô¤Ï°Ê²¼¤Î 3 ¼ïÎà¤ÎÃͤò¤È¤ë¤³¤È¤¬¤Ç¤­¤ë : +.TP +.B FSETLOCKING_INTERNAL +»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤ÆÁàºî¤¬¹Ô¤ï¤ì¤ëÅ٤ˡ¢Áàºî¤ÎÁ°¸å¤Ç +ÌÀ¼¨Åª¤Ë»Ø¼¨¤·¤Ê¤¯¤Æ¤â¥¹¥È¥ê¡¼¥à¤Î¥í¥Ã¥¯½èÍý¤ò¹Ô¤¦ +(⤷¡¢*_unlocked ´Ø¿ô¤ò»ÈÍѤ·¤¿¾ì¹ç¤ÏÎã³°¤Ç¤¢¤ë)¡£ +¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤Î¥í¥Ã¥¯·Á¼°¤Ç¤¢¤ë¡£ +.TP +.B FSETLOCKING_BYCALLER +´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¸µ¤Ç¥í¥Ã¥¯¤ÎÌÌÅݤò¤ß¤ë¡£ +(¤ª¤½¤é¤¯¡¢Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤¬Â¸ºß¤¹¤ë¾õ¶·¤Ç¤Ï +.BR flockfile (3) +¤ò»È¤¦¤³¤È¤Ë¤Ê¤ë¤À¤í¤¦) +¥í¥Ã¥¯·Á¼°¤¬ +.B FSETLOCKING_INTERNAL +¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¤Þ¤Ç¤Ïɸ½àÆþ½ÐÎÏ´ØÏ¢¤Î´Ø¿ô¤Ï¥í¥Ã¥¯½èÍý¤ò¹Ô¤ï¤Ê¤¤¡£ +.TP +.B FSETLOCKING_QUERY +¥í¥Ã¥¯·Á¼°¤ÎÊѹ¹¤ò¹Ô¤ï¤Ê¤¤¡£(¸½ºß¤Î·Á¼°¤òÊÖ¤¹¤À¤±¤Ç¤¢¤ë) +.LP +.BR _flushlbf () +´Ø¿ô¤Ï¡¢¤¹¤Ù¤Æ¤Î¥é¥¤¥ó¥Ð¥Ã¥Õ¥¡ (line-buffered) ¥¿¥¤¥×¤Î¥¹¥È¥ê¡¼¥à¤Î +ÆâÍƤò½ÐÎÏ(¥Õ¥é¥Ã¥·¥å)¤¹¤ë¡£ +(ÅöÁ³¤Ê¤¬¤é¡¢Ã¼Ëö¤Ø¤Î½ÐÎϤ¬¶¯À©Åª¤Ë¹Ô¤ï¤ì¤ë¤³¤È¤Ë¤Ê¤ë¤Î¤Ç¡¢ +¥­¡¼¥Ü¡¼¥É¤«¤é¤ÎÆþÎϤòÆɤߤ³¤àÁ°¤Ë¤³¤Î´Ø¿ô¤ò¸Æ¤ó¤ÀÊý¤¬¤¤¤¤¤À¤í¤¦) +.LP +.BR __fpurge () +´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¤ÎÆâÍƤòÇÑ´þ¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR flockfile (3), +.BR fpurge (3) diff --git a/release/man3/stpcpy.3 b/release/man3/stpcpy.3 new file mode 100644 index 00000000..1554d788 --- /dev/null +++ b/release/man3/stpcpy.3 @@ -0,0 +1,91 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" 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. +.\" +.\" 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. +.\" +.TH STPCPY 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +stpcpy \- ʸ»úÎó¤ò¥³¥Ô¡¼¤·¡¢¥³¥Ô¡¼¤·¤¿Ê¸»úÎó¤Î½ª¤ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹ +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *stpcpy(char *" dest ", const char *" src ); +.fi +.SH ÀâÌÀ +.BR stpcpy () +´Ø¿ô¤Ï¡¢\fIsrc\fP ¤Ç»Ø¤µ¤ì¤¿Ê¸»úÎó¤ò (ʸ»úÎó¤ò½ªÃ¼¤¹¤ë \(aq\\0\(aq +¤ò´Þ¤á¤Æ) \fIdest\fP ¤Ç»Ø¤µ¤ì¤¿ÇÛÎó¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +ʸ»úÎó¤Ï½ÅÊ£¤·¤Æ¤Ï¤Ê¤é¤º¡¢¥³¥Ô¡¼Àè¤Îʸ»úÎó \fIdest\fP ¤Ï¥³¥Ô¡¼¤ò¼õ¤±¼è¤ë +¤Î¤Ë½½Ê¬Â礭¤¯¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR stpcpy () +¤Ï¡¢Ê¸»úÎó \fIdest\fP ¤Î»Ï¤Þ¤ê¤Ç¤Ï¤Ê¤¯ +\fB½ª¤ê\fP¤ò»Ø¤¹¥Ý¥¤¥ó¥¿ (¤¹¤Ê¤ï¤Á¡¢Ê¸»úÎó¤ò½ªÃ¼¤¹¤ë NULL ¥Ð¥¤¥È) ¤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï¡¢C ¤ä POSIX.1 ɸ½à¤Î°ìÉô¤Ç¤Ï¤Ê¤¯¡¢Unix ¥·¥¹¥Æ¥à¤Î´·½¬Åª¤Ê +¤â¤Î¤Ç¤â¤Ê¤¤¤¬¡¢GNU ¤ÎȯÌÀ¤È¤¤¤¦¤ï¤±¤Ç¤â¤Ê¤¤¡£ +¤Ò¤ç¤Ã¤È¤·¤¿¤é MS-DOS ͳÍè¤Î¤â¤Î¤«¤â¤·¤ì¤Ê¤¤¡£ +¸½ºß¤Ç¤Ï¡¢BSD ·Ï¤Ë¤â¸ºß¤¹¤ë¡£ +.SH Îã +Îã¤È¤·¤Æ¡¢¤³¤Î¥×¥í¥°¥é¥à¤Ï \fBfoo\fP ¤È \fBbar\fP ¤òÏ¢·ë¤·¤Æ \fBfoobar\fP +¤òºî¤ë¤¿¤á¤Ë +.BR stpcpy () +¤ò»ÈÍѤ·¡¢¤½¤Î¸åɽ¼¨¤¹¤ë¡£ +.in +4n +.nf + +#define _GNU_SOURCE +#include +#include + +int +main(void) +{ + char buffer[20]; + char *to = buffer; + + to = stpcpy(to, "foo"); + to = stpcpy(to, "bar"); + printf("%s\\n", buffer); +} +.fi +.in +.SH ¥Ð¥° +¤³¤Î´Ø¿ô¤Ï¥Ð¥Ã¥Õ¥¡ +.I dest +¤ÎÈϰϤò¹Ô¤­²á¤®¤Æ¤·¤Þ¤¦²ÄǽÀ­¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR bcopy (3), +.BR memccpy (3), +.BR memcpy (3), +.BR memmove (3), +.BR strcpy (3), +.BR wcpcpy (3), +.BR feature_test_macros (7) diff --git a/release/man3/stpncpy.3 b/release/man3/stpncpy.3 new file mode 100644 index 00000000..98a37dc7 --- /dev/null +++ b/release/man3/stpncpy.3 @@ -0,0 +1,50 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" 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 +.\" +.TH STPNCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +stpncpy \- ¸ÇÄêŤÎʸ»úÎó¤ò¥³¥Ô¡¼¤·¤Æ¡¢¤½¤ÎºÇ¸å¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹ +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *stpncpy(char *" dest ", const char *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR stpncpy () +´Ø¿ô¤Ï \fIsrc\fP ¤¬»Ø¤·¤Æ¤¤¤ëʸ»úÎ󤫤齪ü¤Î \(aq\\0\(aq ʸ»ú¤ò +´Þ¤á¤ÆºÇÂç \fIn\fP ¥Ð¥¤¥È¤ò \fIdest\fP ¤Ë¥³¥Ô¡¼¤¹¤ë¡£Ä¹¤µ +\fIstrlen(src)\fP ¤¬ \fIn\fP ¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ë¤Ï \fIdest\fP ¤Î»Ä¤ê¤Î +Éôʬ¤Ë¤Ï \(aq\\0\(aq ʸ»ú¤¬Ëä¤á¤é¤ì¤ë¡£Ä¹¤µ \fIstrlen(src)\fP ¤¬ \fIn\fP °Ê¾å +¤Ê¤é¤Ð¡¢\fIdest\fP ¤¬»Ø¤¹Ê¸»úÎó¤Ï \(aq\\0\(aq ¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +Æó¤Ä¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +¥×¥í¥°¥é¥Þ¡¼¤Ï \fIdest\fP ¤Ë¾¯¤Ê¤¯¤È¤â \fIn\fP ¥Ð¥¤¥È¤Î¶õ¤­¤¬¤¢¤ë¤³¤È¤ò +Êݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR stpncpy () +¤Ï \fIdest\fP ¤Î½ªÃ¼¤Î¥Ê¥ëʸ»ú¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¤«¡¢ +\fIdest\fP ¤¬¥Ê¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï \fIdest + n\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR strncpy (3), +.BR wcpncpy (3), +.BR feature_test_macros (7) diff --git a/release/man3/strcasecmp.3 b/release/man3/strcasecmp.3 new file mode 100644 index 00000000..11e7a72d --- /dev/null +++ b/release/man3/strcasecmp.3 @@ -0,0 +1,70 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Thu Dec 25 10:54:13 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. +.\" +.\" 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:12:45 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRCASECMP 3 1993-04-11 "" "Linux Programmer's Manual" +.SH ̾Á° +strcasecmp, strncasecmp \- Æó¤Ä¤Îʸ»úÎó¤òÂçʸ»ú¾®Ê¸»ú¤ò¶èÊ̤»¤ºÈæ³Ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int strcasecmp(const char *" s1 ", const char *" s2 ); +.sp +.BI "int strncasecmp(const char *" s1 ", const char *" s2 ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR strcasecmp () +´Ø¿ô¤Ï¡¢Æó¤Ä¤Îʸ»úÎó¡¡\fIs1\fP ¤È \fIs2\fP ¤ò¡¢ +Âçʸ»ú¾®Ê¸»ú¤ò¶èÊ̤»¤º¤ËÈæ³Ó¤¹¤ë¡£ +\fIs1\fP ¤¬ \fIs2\fP ¤è¤ê¤â¾®¤µ¤¤¤«¡¢Æ±¤¸¤«¡¢Â礭¤¤¤«¤Ë¤è¤Ã¤Æ¤½¤ì¤¾¤ì +Éé¤ÎÀ°¿ô¡¢0¡¢Àµ¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +.PP +.BR strncasecmp () +´Ø¿ô¤âƱÍͤǤ¢¤ë¤¬¡¢ +\fIs1\fP ¤ÎºÇ½é¤Î \fIn\fP ʸ»ú¤À¤±¤òÈæ³Ó¤¹¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR strcasecmp () +¤È +.BR strncasecmp () +´Ø¿ô¤Ï¡¢\fIs1\fP +(¤Þ¤¿¤Ï¡¢¤½¤ÎºÇ½é¤Î \fIn\fP ¥Ð¥¤¥È)¤¬ \fIs2\fP ¤è¤ê¤â¾®¤µ¤¤¤«¡¢ +Ʊ¤¸¤«¡¢Â礭¤¤¤«¤Ë¤è¤ê¡¢¤½¤ì¤¾¤ìÉé¤ÎÀ°¿ô¡¢0¡¢Àµ¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +.SH ½àµò +4.4BSD, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR bcmp (3), +.BR memcmp (3), +.BR strcmp (3), +.BR strcoll (3), +.BR strncmp (3), +.BR wcscasecmp (3), +.BR wcsncasecmp (3) diff --git a/release/man3/strcat.3 b/release/man3/strcat.3 new file mode 100644 index 00000000..ebe7937b --- /dev/null +++ b/release/man3/strcat.3 @@ -0,0 +1,111 @@ +.\" 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 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 +.\" +.TH STRCAT 3 2008-06-13 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strcat, strncat \- Æó¤Ä¤Îʸ»úÎó¤òÏ¢·ë¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strcat(char *" dest ", const char *" src ); +.sp +.BI "char *strncat(char *" dest ", const char *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR strcat () +´Ø¿ô¤Ï¡¢\fIdest\fP ʸ»úÎó¤Î¸å¤Ë \fIsrc\fP ʸ»úÎó¤òÉÕ¤±²Ã¤¨¤ë¡£ +¤½¤ÎºÝ¤Ë¡¢\fIdest\fP ¤ÎºÇ¸å¤Ë¤¢¤ë¥Ì¥ë¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ï¾å½ñ¤­¤µ¤ì¡¢ +¿·¤¿¤ËÀ¸À®¤µ¤ì¤¿Ê¸»úÎó¤ÎËöÈø¤Ë½ªÃ¼¤Î¥Ì¥ë¥Ð¥¤¥È¤¬ÉÕÍ¿¤µ¤ì¤ë¡£ +Æó¤Ä¤Îʸ»úÎó \fIsrc\fP ¤È \fIdest\fP ¤Ï½Å¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¤Þ¤¿¡¢Ê¸»úÎó \fIdest\fP ¤Ï¡¢Ï¢·ë¸å¤Î·ë²Ì¤ò³ÊǼ¤¹¤ë¤Î¤Ë +½½Ê¬¤ÊÂ礭¤µ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.BR strncat () +¤âƱÍͤÀ¤¬¡¢°Ê²¼¤ÎÅÀ¤¬°Û¤Ê¤ë¡£ +.IP * 3 +\fIsrc\fP ¤Î¤¦¤ÁºÇÂç \fIn\fP ʸ»ú¤¬»ÈÍѤµ¤ì¤ë¡£ +.IP * +\fIsrc\fP ¤¬ \fIn\fP ʸ»ú°Ê¾å¤Î¾ì¹ç¡¢ +\fIsrc\fP ¤Ï¥Ì¥ë½ªÃ¼¤µ¤ì¤Æ¤¤¤ëɬÍפϤʤ¤¡£ +.PP +.BR strcat () +¤ÈƱ¤¸¤¯¡¢\fIdest\fP ¤Ë³ÊǼ¤µ¤ì¤ë·ë²Ì¤Îʸ»úÎó¤Ï¾ï¤Ë¥Ì¥ë½ªÃ¼¤µ¤ì¤ë¡£ +.PP +\fIsrc\fP ¤¬ \fIn\fP ʸ»ú°Ê¾å¤Î¾ì¹ç¡¢ +.BR strncat () +¤Ï \fIdest\fP ¤Ë \fIn+1\fP ʸ»ú¤ò½ñ¤­¹þ¤à +(\fIsrc\fP ¤«¤é¤Î \fIn\fP ʸ»ú¤È½ªÃ¼¤Î¥Ì¥ë¥Ð¥¤¥È¤Ç¤¢¤ë)¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢\fIdest\fP ¤ÎÂ礭¤µ¤ÏºÇÄã¤Ç¤â +\fIstrlen(dest)+n+1\fP ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.BR strncat () +¤Î´Êñ¤Ê¼ÂÁõ¤Ï°Ê²¼¤Î¤è¤¦¤Ê´¶¤¸¤Ç¤¢¤í¤¦: +.in +4n +.nf + +char* +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++) + dest[dest_len + i] = src[i]; + dest[dest_len + i] = \(aq\\0\(aq; + + return dest; +} +.fi +.in +.SH ÊÖ¤êÃÍ +.BR strcat () +´Ø¿ô¤È +.BR strncat () +´Ø¿ô¤Ï¡¢·ë²Ì¤È¤·¤Æ¤Ç¤­¤ëʸ»úÎó +\fIdest\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.SH ´ØÏ¢¹àÌÜ +.BR bcopy (3), +.BR memccpy (3), +.BR memcpy (3), +.BR strcpy (3), +.BR strncpy (3), +.BR wcscat (3), +.BR wcsncat (3) diff --git a/release/man3/strchr.3 b/release/man3/strchr.3 new file mode 100644 index 00000000..673b34e7 --- /dev/null +++ b/release/man3/strchr.3 @@ -0,0 +1,106 @@ +.\" 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 Mon Apr 12 12:51:24 1993, David Metcalfe +.\" 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 +.\" +.TH STRCHR 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strchr, strrchr, strchrnul \- ʸ»úÎóÃæ¤Îʸ»ú¤Î°ÌÃÖ¤òÆÃÄꤹ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strchr(const char *" s ", int " c ); +.sp +.BI "char *strrchr(const char *" s ", int " c ); +.sp +.B #define _GNU_SOURCE +.B #include +.sp +.BI "char *strchrnul(const char *" s ", int " c ); +.fi +.SH ÀâÌÀ +.BR strchr () +´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP Ãæ¤ËºÇ½é¤Ëʸ»ú \fIc\fP +¤¬¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.BR strrchr () +´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP Ãæ¤ËºÇ¸å¤Ëʸ»ú \fIc\fP +¤¬¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.BR strchrnul () +´Ø¿ô¤Ï +.BR strchr () +¤ÈƱÍͤÀ¤¬¡¢ +\fIc\fP ¤¬ \fIs\fP Ãæ¤Ë¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¡¢ÊÖ¤êÃͤȤ·¤Æ +NULL ¤Ç¤Ê¤¯¡¢\fIs\fP ¤ÎËöÈø¤Î¥Ì¥ë¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹ÅÀ¤¬°Û¤Ê¤ë¡£ +.PP +¤³¤³¤Ç¤¤¤¦¡Öʸ»ú¡×¤Ï¡Ö¥Ð¥¤¥È¡×¤Î°ÕÌ£¤Ê¤Î¤Ç¡¢ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»ú¤ä¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR strchr () +¤È +.BR strrchr () +´Ø¿ô¤Ï°ìÃפ·¤¿Ê¸»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò +ÊÖ¤·¡¢¤â¤·Ê¸»ú¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ + +.BR strchrnul () +´Ø¿ô¤Ï°ìÃפ·¤¿Ê¸»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +ʸ»ú¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢\fIs\fP ¤ÎËöÈø¤Î¥Ì¥ë¥Ð¥¤¥È¤Ø¤Î +¥Ý¥¤¥ó¥¿ (¤Ä¤Þ¤ê \fIs+strlen(s)\fP) ¤òÊÖ¤¹¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR strchrnul () +¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +.BR strchr () +¤È +.BR strrchr () +¤Ï SVr4, 4.3BSD, C89, C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR strchrnul () +¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR index (3), +.BR memchr (3), +.BR rindex (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), +.BR feature_test_macros (7) diff --git a/release/man3/strcmp.3 b/release/man3/strcmp.3 new file mode 100644 index 00000000..f093c345 --- /dev/null +++ b/release/man3/strcmp.3 @@ -0,0 +1,75 @@ +.\" 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 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 2009-04-21 "" "Linux Programmer's Manual" +.SH ̾Á° +strcmp, strncmp \- Æó¤Ä¤Îʸ»úÎó¤òÈæ¤Ù¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int strcmp(const char *" s1 ", const char *" s2 ); +.sp +.BI "int strncmp(const char *" s1 ", const char *" s2 ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR strcmp () +´Ø¿ô¤ÏÆó¤Ä¤Îʸ»úÎó \fIs1\fP ¤È \fIs2\fP ¤ò³Ó¤Ù¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢ +\fIs1\fP ¤¬ \fIs2\fP ¤Ë³Ó¤Ù¤Æ 1)¾®¤µ¤¤¡¢2)Åù¤·¤¤¡¢3)Â礭¤¤¾ì¹ç¤Ë¡¢ +¥¼¥í¤è¤ê¤â 1)¾®¤µ¤¤¡¢2)Åù¤·¤¤¡¢3)Â礭¤¤À°¿ô¤òÊÖ¤¹¡£ +.PP +.BR strncmp () +´Ø¿ô¤Ï¡¢\fIs1\fP ¤È \fIs2\fP ¤ÎºÇ½é¤Î +\fIn\fP ʸ»ú¤À¤±¤òÈæ³Ó¤¹¤ë¤³¤È¤ò½ü¤±¤Ð¡¢strcmp()¤ÈƱÍͤǤ¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR strcmp () +´Ø¿ô¤È +.BR strncmp () +´Ø¿ô¤ÏÀ°¿ô¤òÊÖ¤¹¡£ +¤³¤ÎÀ°¿ô¤Ï¡¢¥¼¥í¤è¤ê¤â¡¢1)¾®¤µ¤¤¡¢2)Åù¤·¤¤¡¢3)Â礭¤¤¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Ï¡¢\fIs1\fP¡Ê¤Þ¤¿¤Ï¡¢¤³¤Îʸ»úÎó¤ÎºÇ½é¤Î \fIn\fP ¥Ð¥¤¥È¡Ë¤¬ +\fIs2\fP ¤è¤ê¤â¡¢1)¾®¤µ¤¤¡¢2)Åù¤·¤¤¡¢3)Â礭¤¤¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.SH ´ØÏ¢¹àÌÜ +.BR bcmp (3), +.BR memcmp (3), +.BR strcasecmp (3), +.BR strcoll (3), +.BR strncasecmp (3), +.BR strverscmp (3), +.BR wcscmp (3), +.BR wcsncmp (3) diff --git a/release/man3/strcoll.3 b/release/man3/strcoll.3 new file mode 100644 index 00000000..0b18e689 --- /dev/null +++ b/release/man3/strcoll.3 @@ -0,0 +1,70 @@ +.\" 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 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 +.\" +.TH STRCOLL 3 1993-04-12 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strcoll \- ¸½ºß¤Î¥í¥±¡¼¥ë¤ò»ÈÍѤ·¤ÆÆó¤Ä¤Îʸ»úÎó¤òÈæ³Ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int strcoll(const char *" s1 ", const char *" s2 ); +.fi +.SH ÀâÌÀ +\fbstrcoll\fP() ´Ø¿ô¤ÏÆó¤Ä¤Îʸ»úÎó \fIs1\fP ¤È \fIs2\fP ¤òÈæ³Ó¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIs1\fP ¤¬ \fIs2\fP ¤è¤ê¤â¾®¤µ¤¤¤«¡¢Åù¤·¤¤¤«¡¢Â礭¤¤¤«¤Ë¤è¤Ã¤Æ +¤½¤ì¤¾¤ìÉé¤ÎÀ°¿ô¡¢0¡¢Àµ¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +Èæ³Ó¤Ï¡¢¥×¥í¥°¥é¥à¤Î¸½ºß¤Î¥í¥±¡¼¥ë¤Î \fBLC_COLLATE\fP ¥«¥Æ¥´¥ê¤Ë±þ¤¸¤Æ +²ò¼á¤µ¤ì¤¿Ê¸»úÎó¤Ë´ð¤Å¤¤¤Æ¹Ô¤ï¤ì¤ë +.RB ( setlocale (3) +»²¾È)¡£ +.SH ÊÖ¤êÃÍ +.BR strcoll () +´Ø¿ô¤Ï¡¢\fIs1\fP ¤¬ \fIs2\fP ¤è¤ê¤â¾®¤µ¤¤¤«¡¢Åù¤·¤¤¤«¡¢ +Â礭¤¤¤«¤Ë¤è¤Ã¤Æ¡¢¤½¤ì¤¾¤ìÉé¤ÎÀ°¿ô¡¢0¡¢Àµ¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +¤É¤Á¤é¤Îʸ»úÎó¤â¸½ºß¤Î¥í¥±¡¼¥ë¤Ë±þ¤¸¤Æ²ò¼á¤µ¤ì¤¿¤â¤Î¤¬»ÈÍѤµ¤ì¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.SH Ãí°Õ +\fI"POSIX"\fP ¤ª¤è¤Ó \fI"C"\fP ¥í¥±¡¼¥ë¤Ë¤ª¤¤¤Æ¤Ï¡¢ +.BR strcoll () +¤Ï +.BR strcmp (3) +¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR bcmp (3), +.BR memcmp (3), +.BR setlocale (3), +.BR strcasecmp (3), +.BR strcmp (3), +.BR strxfrm (3) diff --git a/release/man3/strcpy.3 b/release/man3/strcpy.3 new file mode 100644 index 00000000..33cc8e5f --- /dev/null +++ b/release/man3/strcpy.3 @@ -0,0 +1,146 @@ +.\" Copyright (C) 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 Sat Jul 24 18:06:49 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Fri Aug 25 23:17:51 1995 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Wed Dec 18 00:47:18 1996 by Andries Brouwer (aeb@cwi.nl) +.\" 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 +.\" +.TH STRCPY 3 2009-12-04 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strcpy, strncpy \- ʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strcpy(char *" dest ", const char *" src ); +.sp +.BI "char *strncpy(char *" dest ", const char *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR strcpy () +´Ø¿ô¤Ï +\fIsrc\fP ¤¬»Ø¤¹Ê¸»úÎó¤òËöÈø¤Î¥Ì¥ë¥Ð¥¤¥È (\(aq\\0\(aq) ¤â´Þ¤á¤Æ +\fIdest\fP ¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +Æó¤Ä¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¼õ¤±Â¦¤Îʸ»úÎó \fIdest\fP ¤Ï +¥³¥Ô¡¼¤ò¼õ¤±¼è¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.BR strncpy () +´Ø¿ô¤âƱÍͤÀ¤¬¡¢ +\fIsrc\fP ¤Î¤¦¤ÁºÇÂç¤Ç¤â \fIn\fP ¥Ð¥¤¥È¤·¤«¥³¥Ô¡¼¤µ¤ì¤Ê¤¤ÅÀ¤¬°Û¤Ê¤ë¡£ +.BR ·Ù¹ð : +\fIsrc\fP ¤ÎºÇ½é¤Î \fIn\fP ¥Ð¥¤¥È¤ÎÃæ¤Ë¥Ì¥ë¥Ð¥¤¥È¤¬¤Ê¤¤¾ì¹ç¡¢ +\fIdest\fP ¤Ë³ÊǼ¤µ¤ì¤ëʸ»úÎó¤Ï¥Ì¥ë¤Ç½ªÃ¼¤µ¤ì¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£ +.PP +.I src +¤ÎŤµ¤¬ +.I n +¤è¤ê¤âû¤¤¾ì¹ç¡¢ +.BR strncpy () +¤Ï +.I dest +¤Î»Ä¤ê¤ò¥Ì¥ë¥Ð¥¤¥È¤ÇËä¤á¤ë¡£ +.PP +.BR strncpy () +¤Î´Êñ¤Ê¼ÂÁõ¤Ï°Ê²¼¤Î¤è¤¦¤Ê´¶¤¸¤Ç¤¢¤í¤¦: +.in +4n +.nf + +char* +strncpy(char *dest, const char *src, size_t n){ + size_t i; + + for (i = 0 ; i < n && src[i] != \(aq\\0\(aq ; i++) + dest[i] = src[i]; + for ( ; i < n ; i++) + dest[i] = \(aq\\0\(aq; + + return dest; +} +.fi +.in +.SH ÊÖ¤êÃÍ +.BR strcpy () +´Ø¿ô¤È +.BR strncpy () +´Ø¿ô¤Ï +¼õ¤±Â¦¤Îʸ»úÎó\fIdest\fP¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.SH Ãí°Õ +.BR strncpy () +¤Ï¸úΨŪ¤Ç¤Ê¤¯´Ö°ã¤¤¤òµ¯¤³¤·¤ä¤¹¤¤¤È¹Í¤¨¤ë¥×¥í¥°¥é¥Þ¤â¤¤¤ë¤À¤í¤¦¡£ +¥×¥í¥°¥é¥Þ¤¬ \fIdest\fP ¤ÎÂ礭¤µ¤¬ \fIsrc\fP ¤ÎŤµ¤è¤ê¤â +Â礭¤¤¤³¤È¤òÃΤäƤ¤¤ë (¤Ä¤Þ¤ê¡¢¤½¤Î¤³¤È¤ò¥Á¥§¥Ã¥¯¤¹¤ë¥³¡¼¥É¤ò +½ñ¤¤¤Æ¤¤¤ë) ¾ì¹ç¤Ï¡¢ +.B strcpy() +¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ + +\fIsrc\fP ¤ÎºÇ½é¤Î \fIn\fP ʸ»ú¤Ë½ªÃ¼¤Î¥Ì¥ë¥Ð¥¤¥È¤¬¤Ê¤¤¾ì¹ç¡¢ +.BR strncpy () +¤Ï \fIdest\fP ¤Ë½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤Ê¸»úÎó¤òÀ¸À®¤¹¤ë¡£ +¥×¥í¥°¥é¥Þ¤Ï´Ö°ã¤¤¤òËɻߤ¹¤ë¤¿¤á¤Ë¡¢ +°Ê²¼¤Î¤è¤¦¤Ë¶¯À©Åª¤Ë½ªÃ¼¤ò¹Ô¤¦¤³¤È¤¬¤è¤¯¤¢¤ë¡£ +.in +4n +.nf + +strncpy(buf, str, n); +if (n > 0) + buf[n \- 1]= \(aq\\0\(aq; +.fi +.in +.SH ¥Ð¥° +.BR strcpy () +¤Î¼õ¤±Â¦¤Îʸ»úÎ󤬽½Ê¬¤ÊÂ礭¤µ¤Ç¤Ê¤¤¾ì¹ç¡¢²¿¤¬µ¯¤³¤ë¤«¤ï¤«¤é¤Ê¤¤¡£ +¸ÇÄêĹʸ»úÎó¤ò°î¤ì¤µ¤»¤ë¤Î¤Ï¡¢¥Þ¥·¥ó¤ÎÀ©¸æ¤ò¾¸Ãæ¤Ë¼ý¤á¤ë¤¿¤á¤Ë +¥¯¥é¥Ã¥«¡¼¤¬¹¥¤ó¤Ç»È¤¦¥Æ¥¯¥Ë¥Ã¥¯¤Ç¤¢¤ë¡£ +¥×¥í¥°¥é¥à¤Ç¥Ç¡¼¥¿¤ò¥Ð¥Ã¥Õ¥¡¤ËÆɤ߹þ¤ó¤À¤ê¥³¥Ô¡¼¤·¤¿¤ê¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢ +ɬ¤º¤Þ¤ººÇ½é¤Ë½½Ê¬¤ÊÂ礭¤µ¤¬¤¢¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¥×¥í¥°¥é¥Þ¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬ÉÔ²Äǽ¤À¤È¼¨¤»¤ë¾ì¹ç¤Ë¤Ï +¤³¤Î¥Á¥§¥Ã¥¯¤ÏÉÔÍפ«¤â¤·¤ì¤Ê¤¤¤¬¡¢½½Ê¬Ãí°Õ¤¹¤ë¤³¤È¡£ +Ť¤´Ö¤Ë¤Ï¡¢ÉÔ²Äǽ¤À¤Ã¤¿¤³¤È¤¬²Äǽ¤Ë¤Ê¤ë¤è¤¦¤ÊÊýË¡¤Ç¥×¥í¥°¥é¥à¤¬ +Êѹ¹¤µ¤ì¤ë¤³¤È¤â¤¢¤ë¤«¤é¤À¡£ +.SH ´ØÏ¢¹àÌÜ +.BR bcopy (3), +.BR memccpy (3), +.BR memcpy (3), +.BR memmove (3), +.BR stpcpy (3), +.BR strdup (3), +.BR wcscpy (3), +.BR wcsncpy (3) diff --git a/release/man3/strdup.3 b/release/man3/strdup.3 new file mode 100644 index 00000000..6251debe --- /dev/null +++ b/release/man3/strdup.3 @@ -0,0 +1,110 @@ +.\" 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 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 +.\" +.TH STRDUP 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strdup, strndup, strdupa, strndupa \- ʸ»úÎó¤òÊ£À½¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strdup(const char *" s ); +.sp +.BI "char *strndup(const char *" s ", size_t " n ); +.br +.BI "char *strdupa(const char *" s ); +.br +.BI "char *strndupa(const char *" s ", size_t " n ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR strdup (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +.BR strndup (), +.BR strdupa (), +.BR strndupa (): +_GNU_SOURCE +.SH ÀâÌÀ +.BR strdup () +´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP¤ÎÊ£À½¤Ç¤¢¤ë +¿·¤·¤¤Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¿·¤·¤¤Ê¸»úÎó¤Î¤¿¤á¤Î¥á¥â¥ê¤Ï +.BR malloc (3) +¤ÇÆÀ¤Æ¤¤¤ë¡£ +¤½¤·¤Æ¡¢ +.BR free (3) +¤Ç²òÊü¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.BR strndup () +´Ø¿ô¤ÏƱÍͤǤ¢¤ë¤¬¡¢ºÇÂç¤Ç \fIn\fP ʸ»ú¤À¤±¤òÊ£À½¤¹¤ë¡£ +\fIs\fP ¤¬ \fIn\fP ¤è¤ê¤âŤ¤¾ì¹ç¡¢\fIn\fP ʸ»ú¤À¤±¤¬Ê£À½¤µ¤ì¡¢ +½ªÃ¼¤Î NULL ¥Ð¥¤¥È (\(aq\\0\(aq)) ¤¬Äɲ䵤ì¤ë¡£ + +.BR strdupa () +¤È +.BR strndupa () +´Ø¿ô¤ÏƱÍͤǤ¢¤ë¤¬¡¢ +¥Ð¥Ã¥Õ¥¡¤ò³ä¤êÅö¤Æ¤ë¤Î¤Ë \fBalloca(3)\fP ¤òÍѤ¤¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU GCC ¤òÍѤ¤¤¿¾ì¹ç¤Ë¤Î¤ßÍ­¸ú¤Ç¡¢ +\fBalloca(3)\fP ¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤Î¤ÈƱÍͤÎÀ©¸Â¤ò¼õ¤±¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR strdup () +´Ø¿ô¤ÏÊ£À½¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¢¤Þ¤¿¤Ï +½½Ê¬¤Ê¥á¥â¥ê¤¬³ÎÊݤǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤ÏNULL¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +Ê£À½¤µ¤ì¤¿Ê¸»úÎó¤ò³ä¤êÅö¤Æ¤ë½½Ê¬¤Ê¥á¥â¥ê¤¬³ÎÊݤǤ­¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +.\" 4.3BSD-Reno, not (first) 4.3BSD. +.BR strdup () +¤Ï SVr4, 4.3BSD, POSIX.1-2001 ½àµò¤Ç¤¢¤ë¡£ +.BR strndup (), +.BR strdupa (), +.BR strndupa () +¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR alloca (3), +.BR calloc (3), +.BR free (3), +.BR malloc (3), +.BR realloc (3), +.BR wcsdup (3) diff --git a/release/man3/strerror.3 b/release/man3/strerror.3 new file mode 100644 index 00000000..76cd4328 --- /dev/null +++ b/release/man3/strerror.3 @@ -0,0 +1,194 @@ +.\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk) +.\" and Copyright (C) 2005, 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:05:30 1993 by Rik Faith +.\" Modified Fri Feb 16 14:25:17 1996 by Andries Brouwer +.\" Modified Sun Jul 21 20:55:44 1996 by Andries Brouwer +.\" Modified Mon Oct 15 21:16:25 2001 by John Levon +.\" Modified Tue Oct 16 00:04:43 2001 by Andries Brouwer +.\" Modified Fri Jun 20 03:04:30 2003 by Andries Brouwer +.\" 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 ½àµò¤Î +.\" +.TH STRERROR 3 2009-03-30 "" "Linux Programmer's Manual" +.SH ̾Á° +strerror, strerror_r \- ¥¨¥é¡¼ÈÖ¹æ¤òÀâÌÀ¤¹¤ëʸ»úÎó¤òÊÖ¤¹¡£ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strerror(int " errnum ); +.sp +.BI "char *strerror_r(int " errnum ", char *" buf ", size_t " buflen ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +¼¡¤Î¾ì¹ç¤Ë¤Ï +XSI ½àµò¤Î¥Ð¡¼¥¸¥ç¥ó¤Î +.BR strerror_r () +¤¬Ä󶡤µ¤ì¤ë: +.br +(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !\ _GNU_SOURCE +.fi +.SH ÀâÌÀ +.BR strerror () +´Ø¿ô¤Ï¡¢°ú¤­¿ô \fIerrnum\fP ¤ÇÅϤµ¤ì¤¿¥¨¥é¡¼¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤Î +ÀâÌÀ¤¬Æþ¤Ã¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +²Äǽ¤Ç¤¢¤ë¤Ê¤é¤Ð¡¢Å¬ÀڤʸÀ¸ì¤òÁªÂò¤¹¤ë¤¿¤á¤Ë¡¢ +¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_MESSAGES +¤ò»È¤¦¡£ +¤³¤Îʸ»úÎó¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÊѹ¹¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¤¬¡¢ +¤½¤Î¸å¤Ëµ¯¤³¤ë +.BR perror (3) +¤ä +.BR strerror () +¤Î¸Æ¤Ó½Ð¤·¤Ç +Êѹ¹¤µ¤ì¤Æ¤â¹½¤ï¤Ê¤¤¡£ +¤³¤Îʸ»úÎó¤òÊѹ¹¤¹¤ë¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï¤Ê¤¤¡£ + +.BR strerror_r () +´Ø¿ô¤Ï +.BR strerror () +¤È»÷¤Æ¤¤¤ë¤¬¡¢ +¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ë¤ÏÆó¼ïÎà¤Î¥Ð¡¼¥¸¥ç¥ó¤¬Â¸ºß¤·¡¢ +POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤¿ XSI ½àµò¤Î¥Ð¡¼¥¸¥ç¥ó +(glibc 2.3.4 °Ê¹ß¤ÇÍøÍѲÄǽ) ¤È¡¢ +GNU »ÅÍͤΥС¼¥¸¥ç¥ó (glibc 2.0 °Ê¹ß¤ÇÍøÍѲÄǽ) ¤Ç¤¢¤ë¡£ +¡Ö½ñ¼°¡×¤ÎÀá¤Ëµ­ºÜ¤µ¤ì¤¿µ¡Ç½¸¡ºº¥Þ¥¯¥í¤Î¾ì¹ç¤Ë¤Ï¡¢ +XSI ½àµò¤Î¥Ð¡¼¥¸¥ç¥ó¤¬Ä󶡤µ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï GNU »ÅÍͤΥС¼¥¸¥ç¥ó¤¬Ä󶡤µ¤ì¤ë¡£ +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬°ì¤Ä¤âÌÀ¼¨Åª¤ËÄêµÁ¤µ¤ì¤Ê¤¤¾ì¹ç¡¢ +(glibc 2.4 °Ê¹ß¤Ç¤Ï) ¥Ç¥Õ¥©¥ë¥È¤Ç +.B _POSIX_SOURCE +¤ÏÃÍ 200112l ¤ÇÄêµÁ¤µ¤ì¡¢¤½¤Î·ë²Ì +XSI ½àµò¤Î¥Ð¡¼¥¸¥ç¥ó¤Î +.BR strerror_r () +¤¬¥Ç¥Õ¥©¥ë¥È¤ÇÄ󶡤µ¤ì¤ë¡£ + +°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +XSI ½àµò¤Î +.BR strerror_r () +¤ò»È¤¦Êý¤¬¤è¤¤¡£ +¤³¤Î´Ø¿ô¤Ï¡¢¥æ¡¼¥¶¡¼¤«¤éÄ󶡤µ¤ì¤ëŤµ +.I buflen +¤Î¥Ð¥Ã¥Õ¥¡ +.I buf +¤Ë¥¨¥é¡¼Ê¸»úÎó¤òÊÖ¤¹¡£ + +GNU »ÅÍͤΠ+.BR strerror_r () +¤Ï¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò³ÊǼ¤·¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +ÊÖ¤êÃͤϡ¢¤³¤Î´Ø¿ô¤¬ +.I buf +¤Ë³ÊǼ¤·¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤«¡¢ +²¿¤é¤«¤Î (ÉÔÊѤÊ) ÀÅŪ¤Êʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¢¤Î¤¤¤º¤ì¤«¤È¤Ê¤ë +(¸å¼Ô¤Î¾ì¹ç¤Ï +.I buf +¤Ï»ÈÍѤµ¤ì¤Ê¤¤)¡£ +.I buf +¤Ëʸ»úÎ󤬳ÊǼ¤µ¤ì¤ë¾ì¹ç¤Ï¡¢ +ºÇÂç¤Ç +.I buflen +¥Ð¥¤¥È¤¬³ÊǼ¤µ¤ì +.RI ( buflen +¤¬¾®¤µ²á¤®¤¿¤È¤­¤Ë¤Ïʸ»úÎó¤ÏÀÚ¤êµÍ¤á¤é¤ì¤ë)¡¢ +ʸ»úÎó¤Ë¤Ïɬ¤º½ªÃ¼¥Ì¥ëʸ»ú¤¬´Þ¤Þ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR strerror () +¤È +.BR strerror_r () +¤Ï¥¨¥é¡¼ÆâÍƤòÀâÌÀ¤¹¤ë +ʸ»úÎó¤òÊÖ¤¹¡£¥¨¥é¡¼Èֹ椬̤ÃΤξì¹ç¤Ï "Unknown error nnn" ¤È¤¤¤¦ +¥á¥Ã¥»¡¼¥¸¤òÊÖ¤¹¡£ + +XSI ½àµò¤Î +.BR strerror_r () +´Ø¿ô¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï¡¢ \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë¥¨¥é¡¼ÆâÍƤò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +.I errnum +¤ÎÃͤ¬Í­¸ú¤Ê¥¨¥é¡¼ÈÖ¹æ¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ERANGE +¥¨¥é¡¼¥³¡¼¥É¤òÀâÌÀ¤¹¤ëʸ»úÎó¤Î¤¿¤á¤Ë¡¢½¼Ê¬¤ÊÎΰ褬³ÎÊݤǤ­¤Ê¤«¤Ã¤¿¡£ +.SH ½àµò +.BR strerror () +¤Ï POSIX.1-2001, C89, C99 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.BR strerror_r () +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +GNU »ÅÍͤΠ+.BR strerror_r () +´Ø¿ô¤ÏÈóɸ½à¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ + +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 +¤ò¥»¥Ã¥È¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR err (3), +.BR errno (3), +.BR error (3), +.BR perror (3), +.BR strsignal (3) diff --git a/release/man3/strfmon.3 b/release/man3/strfmon.3 new file mode 100644 index 00000000..402d424c --- /dev/null +++ b/release/man3/strfmon.3 @@ -0,0 +1,184 @@ +.\" Copyright (c) 2000 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) 2001 NAKANO Takeo all rights reserved. +.\" Translated Thu Fri 08 2001 by NAKANO Takeo +.\" +.\"WORD: numeric fill character ¿ôÃÍËä¤áʸ»ú +.\"WORD: grouping character ¥°¥ë¡¼¥×²½Ê¸»ú +.\"WORD: left precision º¸ÀºÅÙ +.\"WORD: right precision º¸ÀºÅÙ +.\"WORD: radix (character) ´ð¿ôÅÀ(ʸ»ú) +.\"WORD: conversion character ÊÑ´¹Ê¸»ú +.\"WORD: international currency format ¹ñºÝÄ̲ߥե©¡¼¥Þ¥Ã¥È +.\"WORD: national currency format ¹ñÆâÄ̲ߥե©¡¼¥Þ¥Ã¥È +.\" +.TH STRFMON 3 2000-12-05 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +strfmon \- ¶â³Û¤ÎÃͤòʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "ssize_t strfmon(char *" s ", size_t " max ", const char *" format , +.B "...);" +.SH ÀâÌÀ +.BR strfmon () +´Ø¿ô¤Ï¡¢»ØÄꤵ¤ì¤¿¿ôÎ̤ò +.I format +¤Ç»ØÄꤵ¤ì¤¿¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤·¤¿¤¬¤Ã¤ÆÀ°·Á¤·¡¢ +·ë²Ì¤ò¥µ¥¤¥º +.I max +¤Îʸ»úÇÛÎó +.I s +¤Ë½ñ¤­¤³¤à¡£ +.PP +.I format +Ãæ¤ÎÄ̾ï¤Îʸ»ú¤Ï¡¢ÊÑ´¹¤µ¤ì¤º¤Ë¤½¤Î¤Þ¤Þ +.I s +¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ÊÑ´¹»ØÄê¤Ï \(aq%\(aq ʸ»ú¤Ç»Ï¤Þ¤ë¡£ +¤³¤Îľ¸å¤Ë¤Ï¡¢°Ê²¼¤Î¥Õ¥é¥°¤ò 0 ¸Ä°Ê¾å³¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BI = f +1 ¥Ð¥¤¥Èʸ»ú +.I f +¤ò¿ôÃÍËä¤áʸ»ú (numeric fill character) ¤Ë¤¹¤ë +(º¸ÀºÅ٤ȶ¦¤ËÍѤ¤¤ë¡£°Ê²¼¤ò»²¾È)¡£ +»ØÄꤵ¤ì¤Ê¤¤¤È¡¢¥¹¥Ú¡¼¥¹Ê¸»ú¤¬ÍѤ¤¤é¤ì¤ë¡£ +.TP +.B ^ +¸½ºß¤Î¥í¥±¡¼¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤Ç¤¢¤í¤¦¥°¥ë¡¼¥×²½Ê¸»ú (grouping character) +¤ò°ìÀڻȤï¤Ê¤¤¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥°¥ë¡¼¥×²½¤ÏÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.TP +.BR ( " ¤Þ¤¿¤Ï " + +( ¥Õ¥é¥°¤Ï¡¢Éé¤Î¿ôÃͤò³ç¸Ì¤Ç³ç¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ ++ ¥Õ¥é¥°¤ÏÉä¹æ¤ò¥Ç¥Õ¥©¥ë¥È¤Î¤è¤¦¤Ë¼è¤ê°·¤¦¤³¤È¤ò°ÕÌ£¤¹¤ë +(¤¹¤Ê¤ï¤Á¿ôÃͤÎÁ°¤Ë¥í¥±¡¼¥ë¤ÎÉä¹æ¥Þ¡¼¥¯¤¬ÃÖ¤«¤ì¤ë¡£ +Î㤨¤ÐÀµ¤Ê¤é¤Ê¤Ë¤â¤Ê¤¯¡¢Éé¤Ê¤é \(aq\-\(aq ¤òÃÖ¤¯¡¢¤Ê¤É)¡£ +.TP +.B ! +Ä̲ߥ·¥ó¥Ü¥ë¤ò¾Êά¤¹¤ë¡£ +.TP +.B \- +¤¹¤Ù¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤òº¸µÍ¤á¤Ë¤¹¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ï±¦µÍ¤á¡£ +.LP +¼¡¤Î°ÌÃ֤ˤϡ¢¥Õ¥£¡¼¥ë¥É¤ÎÉý¤ò»ØÄê¤Ç¤­¤ë¡£ +10 ¿Ê¤Î¿ôÃÍʸ»úÎó¤Ç¡¢¥Õ¥£¡¼¥ë¥É¤ÎºÇ¾®Éý¤ò¥Ð¥¤¥Èñ°Ì¤Ç»ØÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 0¡£ +·ë²Ì¤¬¤³¤ÎÉý¤è¤ê¤â¶¹¤¯¤Ê¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +ÉÔ­ʬ¤¬¥¹¥Ú¡¼¥¹¤ÇËä¤á¤é¤ì¤ë +(º¸µÍ¤á¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ðº¸Â¦¤¬Ëä¤á¤é¤ì¤ë)¡£ +.LP +¼¡¤Î°ÌÃ֤ˤϡ¢"#" ¤Ë 10 ¿Ê¿ôÃÍʸ»úÎó¤ò³¤±¤¿·Á¼°¤Ç¡¢ +º¸ÀºÅÙ (left precision) ¤ò»ØÄê¤Ç¤­¤ë¡£ +Ä̲ߤδð¿ôÅÀ (radix) ¤è¤êº¸Â¦¤Î¿ôÃͤηå¿ô¤¬¤³¤Î»ØÄê¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ï¡¢ +¿ôÃÍËä¤áʸ»ú¤Çº¸Â¦¤¬Ëä¤á¤é¤ì¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥ÉÉý¤Î»ØÄê¤Ç¤Ï¡¢¥°¥ë¡¼¥×²½Ê¸»ú¤Ï¥«¥¦¥ó¥È¤µ¤ì¤Ê¤¤¡£ +.LP +¼¡¤Î°ÌÃ֤ˤϡ¢"." ¤Ë 10 ¿Ê¿ôÃÍʸ»úÎó¤ò³¤±¤¿·Á¼°¤Ç¡¢ +±¦ÀºÅÙ (right precision) ¤ò»ØÄê¤Ç¤­¤ë¡£ +À°·Á¤µ¤ì¤ë¿ôÃͤϡ¢À°·ÁÁ°¤Ë¤³¤Î·å¿ô¤Ë´Ý¤á¤é¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤Î +.I frac_digits +¤È +.I int_frac_digits +¤Î»ØÄê¤òÍѤ¤¤ë¡£ +±¦ÀºÅÙ¤¬ 0 ¤Î¾ì¹ç¤Ï¡¢´ð¿ôÅÀʸ»ú (radix character) ¤Ï°õ»ú¤µ¤ì¤Ê¤¤ +(¤³¤³¤Ç¤Î´ð¿ôÅÀʸ»ú¤Ï +.B LC_MONETARY +¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +.B LC_NUMERIC +¤Î»ØÄê¤È¤Ï°Û¤Ê¤Ã¤Æ¤¤¤Æ¤â¤è¤¤)¡£ +.LP +ºÇ¸å¤Ë¡¢ÊÑ´¹»ØÄê¤ÏÊÑ´¹Ê¸»ú (conversion character) +¤Ç½ªÎ»¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ÊÑ´¹Ê¸»ú¤Ë¤Ï°Ê²¼¤Î 3 ¤Ä¤¬¤¢¤ë¡£ +.TP +.B % +(¤³¤Î¾ì¹ç¤Ï»ØÄêÁ´ÂΤ¬ "%%" ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£) +·ë²Ì¤Îʸ»úÎó¤Ë \(aq%\(aq ʸ»ú¤ò½ñ¤­¤³¤à¡£ +.TP +.B i +.I double +·¿¤Î°ú¤­¿ô¤Ò¤È¤Ä¤¬¡¢ +¥í¥±¡¼¥ë¤Î¹ñºÝÄ̲ߥե©¡¼¥Þ¥Ã¥È (international currency format) +¤òÍѤ¤¤ÆÊÑ´¹¤µ¤ì¤ë¡£ +.TP +.B n +.I double +·¿¤Î°ú¤­¿ô¤Ò¤È¤Ä¤¬¡¢ +¥í¥±¡¼¥ë¤Î¹ñÆâÄ̲ߥե©¡¼¥Þ¥Ã¥È (national currency format) +¤òÍѤ¤¤ÆÊÑ´¹¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR strfmon () +´Ø¿ô¤Ï¡¢·ë²Ì¤Îʸ»úÎ󤬽ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ò´Þ¤á¤ÆÇÛÎó +.I s +¤Ë¼ý¤Þ¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +.I s +¤Ë½ñ¤­¤³¤Þ¤ì¤¿Ê¸»ú¿ô¤òÊÖ¤¹¡£NULL ¥Ð¥¤¥È¤Ïʸ»ú¿ô¤ËÆþ¤é¤Ê¤¤¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I errno +¤Ë +.B E2BIG +¤òÀßÄꤷ¤Æ \-1 ¤òÊÖ¤¹¡£ +¤³¤Î¾ì¹ç¤ÎÇÛÎó¤ÎÆâÍƤÏ̤ÄêµÁ¤Ç¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +¾¤Î¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +.SH Îã +.in +4n +.nf + +strfmon(buf, sizeof(buf), "[%^=*#6n] [%=*#6i]", + 1234.567, 1234.567); + +.fi +.in +¤Î¤è¤¦¤Ê´Ø¿ô¥³¡¼¥ë¤Î½ÐÎϤϡ¢¥ª¥é¥ó¥À¤Î¥í¥±¡¼¥ë¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ê½ÐÎϤˤʤ롣 +.in +4n + +[ fl **1234,57] [ NLG **1 234,57] + +.in +(fl ¤Ï "florijnen" ¤Î°Õ¡£NLG ¤Ï Netherlands Guilder¡£) +¥°¥ë¡¼¥×²½Ê¸»ú¤òÍѤ¤¤ë¤ÈÈó¾ï¤Ë½¹¤¯¤Ê¤ë¡£ +Ʊ»þ¤Ë´Ö°ã¤¤¤Ê¤¯º®Íð¤Î¸¶°ø¤Ë¤â¤Ê¤Ã¤Æ¤·¤Þ¤¦¤À¤í¤¦¡£ +¤³¤ì¤Ï¿ôÃͤÎȾʬ°Ê²¼¤ÎÉý¤Ç¤¢¤ë¤Ù¤­¤À¤¬¡¢ +¿ôÃͤÈƱ¤¸¤À¤±¤ÎÉý¤ò¼è¤Ã¤Æ¤·¤Þ¤¦¤«¤é¤Ç¤¢¤ë¡£ +¤Ò¤É¤¤¤³¤È¤Ë¡¢ "fl" ¤ÎÁ°¸å¤Ë¤Ï¥¹¥Ú¡¼¥¹¤¬Æþ¤Ã¤Æ¤·¤Þ¤¤¡¢ +¤Þ¤¿ "NLG" ¤ÎÁ°¤Ë¤Ï 1 ¤Ä¡¢¸å¤Ë¤Ï 2 ¤Ä¤Î¥¹¥Ú¡¼¥¹¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¥í¥±¡¼¥ë¥Õ¥¡¥¤¥ë¤Î¥Ð¥°¤Ç¤¢¤í¤¦¡£ +¥¤¥¿¥ê¥¢¡¦¥ª¡¼¥¹¥È¥é¥ê¥¢¡¦¥¹¥¤¥¹¡¦¥Ý¥ë¥È¥¬¥ë¤Î +³Æ¥í¥±¡¼¥ë¤Ç¤Î·ë²Ì¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£ +.in +4n + +[ L. **1235] [ ITL **1.235] +.br +[ $**1234.57] [ AUD **1,234.57] +.br +[Fr. **1234,57] [CHF **1.234,57] +.br +[ **1234$57Esc] [ **1.234$57PTE ] +.in +.SH ´ØÏ¢¹àÌÜ +.BR setlocale (3), +.BR sprintf (3), +.BR locale (7) diff --git a/release/man3/strfry.3 b/release/man3/strfry.3 new file mode 100644 index 00000000..7ae42bde --- /dev/null +++ b/release/man3/strfry.3 @@ -0,0 +1,58 @@ +.\" 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 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 +.\" +.TH STRFRY 3 1993-04-12 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strfry \- ʸ»úÎó¤ò¥é¥ó¥À¥à¤ËʤÙÊѤ¨¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *strfry(char *" string ); +.fi +.SH ÀâÌÀ +.BR strfry () +´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIstring\fP ¤ÎÆâÍƤò¥é¥ó¥À¥à¤ËʤӴ¹¤¨¤ë¡£ +ʤӴ¹¤¨¤Ï¡¢ +.BR rand (3) +´Ø¿ô¤òÍѤ¤¤Æ¡¢Ê¸»úÎóÃæ¤Î³Æʸ»ú¤ò̵ºî°Ù¤Ë +¸ò´¹¤¹¤ë¤³¤È¤Ç¼Â¸½¤µ¤ì¤ë¡£·ë²Ì¤Ï¡¢Ê¸»úÎó \fIstring\fP ¤Î¥¢¥Ê¥°¥é¥à¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR strfry () +´Ø¿ô¤Ï¡¢¥é¥ó¥À¥à¤ËʤӴ¹¤¨¤é¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ½àµò +.BR strfry () +´Ø¿ô¤Ï GNU C ¥é¥¤¥Ö¥é¥ê¤ËÆÃÍ­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR memfrob (3), +.BR feature_test_macros (7) diff --git a/release/man3/strftime.3 b/release/man3/strftime.3 new file mode 100644 index 00000000..0362bf09 --- /dev/null +++ b/release/man3/strftime.3 @@ -0,0 +1,537 @@ +.\" 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 +.\" GNU texinfo documentation on glibc date/time functions. +.\" Modified Sat Jul 24 18:03:44 1993 by Rik Faith (faith@cs.unc.edu) +.\" Applied fix by Wolfgang Franke, aeb, 961011 +.\" Corrected return value, aeb, 970307 +.\" Added Single Unix Spec conversions and %z, aeb/esr, 990329. +.\" 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 ¤Î½µÃ±°Ìɽµ­ +.\" +.TH STRFTIME 3 2010-01-17 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strftime \- ÆüÉÕ¤ª¤è¤Ó»þ¹ï¤Îʸ»úÎó¤Ø¤ÎÊÑ´¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t strftime(char *" s ", size_t " max ", const char *" format , +.BI " const struct tm *" tm ); +.fi +.SH ÀâÌÀ +.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 +.PP +½ñ¼°»ØÄê¤Ï NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ê¡¢ +¡ÖÊÑ´¹»ØÄê (conversion specification)¡×¤È¸Æ¤Ð¤ì¤ëÆÃÊ̤Êʸ»úÎó¤ò +´Þ¤Þ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +³Æ¡¹¤ÎÊÑ´¹»ØÄê¤Ï \(aq%\(aq ʸ»ú¤Ç»Ï¤Þ¤ê¡¢ +¡ÖÊÑ´¹»ØÄêʸ»ú (conversion specifier character)¡×¤È¸Æ¤Ð¤ì¤ë +²¿¤é¤«Â¾¤Îʸ»ú¤Ç½ªÃ¼¤µ¤ì¤ë¡£¾åµ­°Ê³°¤ÎÁ´¤Æ¤Îʸ»úÎó¤Ï +¡ÖÄ̾ï¤Îʸ»úÎó (ordinary character sequence)¡×¤È¤Ê¤ë¡£ +.PP +(NULL ¥Ð¥¤¥È¤â´Þ¤à) Ä̾ï¤Îʸ»úÎóÆâ¤Îʸ»ú¤Ï¡¢ +¤½¤Î¤Þ¤Þ \fIformat\fP ¤«¤é \fIs\fP ¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ +°ìÊý¡¢ÊÑ´¹»ØÄê¤Îʸ»ú¤Ï°Ê²¼¤Î¤è¤¦¤ËÃÖ´¹¤µ¤ì¤ë¡£ +.TP +.B %a +¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤±¤ëÍËÆü¤Î¾Êά̾¡£ +.TP +.B %A +¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤±¤ëÍËÆü¤Î´°Á´¤Ê̾Á°¡£ +.TP +.B %b +¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤±¤ë·î¤Î¾Êά̾¡£ +.TP +.B %B +¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤±¤ë·î¤Î´°Á´¤Ê̾Á°¡£ +.TP +.B %c +¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤¤¤Æ°ìÈÌŪ¤ÊÆüÉÕ¡¦»þ¹ï¤Îɽµ­¡£ +.TP +.B %C +À¤µª (À¾Îñǯ¤Î¾å 2 ·å)¡£ (SU) +.TP +.B %d +·îÆâÄÌ»»Æü (10 ¿Ê¿ôɽµ­) (01-31)¡£ +.TP +.B %D +.B %m/%d/%y +¤ÈÅù²Á¡£(¤¦¤¨¤Ã¡¢¥¢¥á¥ê¥«ÀìÍѤÀ¡£¥¢¥á¥ê¥«°Ê³°¤Î¹ñ¤Ç¤Ï +.B %d/%m/%y +¤ÎÊý¤¬°ìÈÌŪ¤À¡£Ê¶¤é¤ï¤·¤¤¤Î¤Ç¡¢»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£) (SU) +.TP +.B %e +.B %d +¤ÈƱÍͤ˷îÆâÄÌ»»Æü¤ò 10 ¿Ê¿ô¤Çɽ¸½¤¹¤ë¤¬¡¢ +1 ·å¤Î¾ì¹ç 10 ¤Î°Ì¤Ë¥¼¥í¤òÃÖ¤«¤º¥¹¥Ú¡¼¥¹¤òÃÖ¤¯¡£(SU) +.TP +.B %E +ÊÌ·Á¼°¤ò»ÈÍѤ¹¤ëºÝ¤Î½¤¾þ»Ò¡£²¼µ­»²¾È¡£ (SU) +.TP +.B %F +.B %Y-%m-%d +¤ÈÅù²Á (ISO\ 8601 ·Á¼°¤ÎÆüÉÕ¥Õ¥©¡¼¥Þ¥Ã¥È)¡£ (C99) +.TP +.B %G +ISO\ 8601 ½µÃ±°Ìɽµ­¤Îǯ (week-based year; ¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È)¡£ +À¤µª¤â 10 ¿Ê¿ô¤Çɽ¤¹¡£ +ISO ½µÈÖ¹æ +.RB ( %V +¤ò»²¾È) ¤ËÂбþ¤·¤¿ 4 ·å¤ÎÀ¾Îñǯ¡£ +¤³¤ì¤Ï´ðËÜŪ¤Ë¤Ï +.B %Y +¤ÈƱ¤¸·Á¼°¤À¤¬¡¢ISO ½µ¿ô¤¬Á°Ç¯¤äÍâǯ¤Ë¤Ê¤ë +¾ì¹ç¤Ë¤Ï¤½¤Îǯ¤¬»ÈÍѤµ¤ì¤ëÅÀ¤¬°Û¤Ê¤ë¡£(TZ) +.TP +.B %g +.B %G +¤ÈƱÍÍ¡£Ã¢¤·¡¢À¤µª¤ò´Þ¤Þ¤º²¼ 2 ·å¤Î¤ß¤òɽ¼¨ (00-99)¡£ (TZ) +.TP +.B %h +.B %b +¤ÈÅù²Á (SU) +.TP +.B %H +24 »þ´Öɽµ­¤Ç¤Î»þ (hour)¡£ (00-23) +.TP +.B %I +12 »þ´Öɽµ­¤Ç¤Î»þ (hour)¡£ (01-12) +.TP +.B %j +ǯ¤Î½é¤á¤«¤éÄÌ»»¤ÎÆü¿ô¡£ (001-366) +.TP +.B %k +24 »þ´Öɽµ­¤Ç¤Î»þ (0-23)¡£ +1 ·å¤Î¾ì¹ç¤Ë¤ÏÁ°¤Ë¥¼¥í¤Ç¤Ê¤¯¥¹¥Ú¡¼¥¹¤¬ÃÖ¤«¤ì¤ë¡£ +.RB ( %H +¤â»²¾È) (TZ) +.TP +.B %l +12 »þ´Öɽµ­¤Ç¤Î»þ (0-12)¡£ +1 ·å¤Î¾ì¹ç¤Ë¤ÏÁ°¤Ë¥¼¥í¤Ç¤Ê¤¯¥¹¥Ú¡¼¥¹¤¬ÃÖ¤«¤ì¤ë¡£ +.RB ( %I +¤â»²¾È) (TZ) +.TP +.B %m +·î (10 ¿Ê¿ôɽµ­)¡£ (01-12) +.TP +.B %M +ʬ (10 ¿Ê¿ôɽµ­) (00-59) +.TP +.B %n +²þ¹Ô¡£ (SU) +.TP +.B %O +ÊÌ·Á¼°¤ò»ÈÍѤ¹¤ëºÝ¤Î½¤¾þ»Ò¡£°Ê²¼¤ò»²¾È¡£(SU) +.TP +.B %p +¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤±¤ë¡Ö¸áÁ°¡×¡Ö¸á¸å¡×¤ËÁêÅö¤¹¤ëʸ»úÎó¡£ +±Ñ¸ì¤Î¾ì¹ç¤Ë¤Ï "AM" ¤Þ¤¿¤Ï "PM" ¤È¤Ê¤ë¡£ +Àµ¸á¤Ï¡Ö¸á¸å¡×¡¢¿¿ÌëÃæ¤Ï¡Ö¸áÁ°¡×¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +.TP +.B %P +.B %p +¤ÈƱÍͤǤ¢¤ë¤¬¾®Ê¸»ú¤¬»ÈÍѤµ¤ì¤ë¡£ +±Ñ¸ì¤Î¾ì¹ç¤Ë¤Ï "am" ¤ä "pm" ¤È¤Ê¤ë¡£(GNU) +.TP +.B %r +¸áÁ°¡¦¸á¸å·Á¼°¤Ç¤Î»þ¹ï¡£ +POSIX ¥í¥±¡¼¥ë¤Ç¤Ï +.B "%I:%M:%S %p" +¤ÈÅù²Á¤Ç¤¢¤ë¡£(SU) +.TP +.B %R +24 »þ´Öɽµ­¤Ç¤Î»þ¹ï¡¢ÉäÏɽ¼¨¤·¤Ê¤¤ +.RB ( %H:%M )¡£ +Éäò´Þ¤ó¤À¤â¤Î¤Ï°Ê²¼¤Î +.B %T +¤ò»²¾È¤¹¤ë¤³¤È¡£(SU) +.TP +.B %s +µª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤ÎÉÿô¡£ (TZ) +.TP +.B %S +Éà (10 ¿Ê¿ôɽµ­) (00-60) +(»þ¡¹¤¢¤ë±¼ÉäËÂбþ¤¹¤ë¤¿¤á¡¢ÃͤÎÈÏ°Ï¤Ï 60 ¤Þ¤Ç¤È¤Ê¤Ã¤Æ¤¤¤ë) +.TP +.B %t +¥¿¥Öʸ»ú (SU) +.TP +.B %T +24 »þ´Öɽµ­¤Î»þ´Ö (\fB%H:%M:%S\fP) (SU) +.TP +.B %u +½µ¤Î²¿ÈÖÌܤÎÆü (10 ¿Ê¿ôɽµ­) ¤«¡£·îÍËÆü¤ò 1 ¤È¤¹¤ë (1-7)¡£ +.B %w +¤â»²¾È¡£(SU) +.TP +.B %U +ǯ¤Î½é¤á¤«¤é¤ÎÄÌ»»¤Î½µÈÖ¹æ (10 ¿Ê¿ôɽµ­) (00-53)¡£ +¤½¤Îǯ¤ÎºÇ½é¤ÎÆüÍËÆü¤ò¡¢Âè 1 ½µ¤Î»Ï¤Þ¤ê¤È¤·¤Æ·×»»¤¹¤ë¡£ +.B %V +¤È +.B %W +¤â»²¾È¤¹¤ë¤³¤È¡£ +.TP +.B %V +ISO\ 8601 ·Á¼°¤Ç¤Îǯ¤Î»Ï¤á¤«¤é¤Î½µÈÖ¹æ (¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È)¡£ +10 ¿Ê¿ôɽµ­¤Ç¡¢01 ¤«¤é 53 ¤ÎÃͤȤʤ롣½µÈÖ¹æ¤Ï¡¢ +¿·¤·¤¤Ç¯¤¬¾¯¤Ê¤¯¤È¤â 4 Æü°Ê¾å´Þ¤Þ¤ì¤ëºÇ½é¤Î½µ¤ò 1 ¤È¤·¤Æ·×»»¤¹¤ë¡£ +.B %U +¤È +.B %W +¤â»²¾È¤Î¤³¤È¡£(SU) +.TP +.B %w +½µ¤Î²¿ÈÖÌܤÎÆü (10 ¿Ê¿ôɽµ­) ¤«¡£ÆüÍËÆü¤ò 0 ¤È¤¹¤ë¡£(0-6)¡£ +.B %u +¤â»²¾È¡£(SU) +.TP +.B %W +ǯ¤Î½é¤á¤«¤é¤ÎÄÌ»»¤Î½µÈÖ¹æ (10 ¿Ê¿ôɽµ­) (00-53)¡£ +¤½¤Îǯ¤ÎºÇ½é¤Î·îÍËÆü¤ò¡¢Âè 1 ½µ¤Î»Ï¤Þ¤ê¤È¤·¤Æ·×»»¤¹¤ë¡£ +.TP +.B %x +¸½ºß¤Î¥í¥±¡¼¥ë¤Ç°ìÈÌŪ¤ÊÆüÉÕɽµ­¡£»þ¹ï¤Ï´Þ¤Þ¤Ê¤¤¡£ +.TP +.B %X +¸½ºß¤Î¥í¥±¡¼¥ë¤Ç°ìÈÌŪ¤Ê»þ¹ïɽµ­¡£ÆüÉդϴޤޤʤ¤¡£ +.TP +.B %y +À¾Îñ¤Î²¼2·å (À¤µªÉôʬ¤ò´Þ¤Þ¤Ê¤¤Ç¯) (00-99)¡£ +.TP +.B %Y +À¤µªÉôʬ¤ò´Þ¤á¤¿ ( 4 ·å¤Î) À¾Îñǯ¡£ +.TP +.B %z +.I +hhmm +¤ä +.I -hhmm +¤Î·Á¼°¤Î¥¿¥¤¥à¥¾¡¼¥ó (UTC ¤Ø¤Î¥ª¥Õ¥»¥Ã¥È»þ´Ö)¡£(SU) +.TP +.B %Z +¥¿¥¤¥à¥¾¡¼¥ó¤Þ¤¿¤Ï¥¾¡¼¥ó̾¤Þ¤¿¤Ï¾Êά̾¡£ +.TP +.B %+ +.\" Nov 05 -- Not in Linux/glibc, but is in some BSDs (according to +.\" their man pages) +.BR date (1) +·Á¼°¤Ç¤ÎÆü»þ¡£(TZ) +(glibc2 ¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤) +.TP +.B %% +\(aq%\(aq ʸ»ú¡£ +.PP +¤¤¤¯¤Ä¤«¤ÎÊÑ´¹»ØÄê¤Ç¤Ï¡¢ÊÑ´¹»ØÄêʸ»ú¤ÎÁ°¤Ë +.B E +¤ä +.B O +¡Ö½¤¾þ»Ò¡×¤òÃÖ¤¯¤³¤È¤Ë¤è¤Ã¤ÆÊ̽ñ¼°¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤¤¤ÆÊ̽ñ¼°¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +Ä̾ï¤ÎÊÑ´¹»ØÄ꤬»ÈÍѤµ¤ì¤¿¤«¤Î¤è¤¦¤ËÆ°ºî¤¹¤ë (SU)¡£ +Åý°ì 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 °Ê¹ß¤Ç¤Î¤ßÍ­¸ú) +.PP +Í×ÁÇÊ̤λþ¹ï¹½Â¤ÂÎ \fItm\fP ¤Î¾ÜºÙ¤Ï \fI\fP ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.BR ctime (3) +¤â»²¾È¤¹¤ë¤³¤È¡£ +.SH ÊÖ¤êÃÍ +.BR strftime () +´Ø¿ô¤Ïʸ»úÎó \fIs\fP ¤Ë³ÊǼ¤µ¤ì¤¿Ê¸»ú¿ô¤òÊÖ¤¹¡£ +¤³¤Îʸ»ú¿ô¤Ë½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤Ï´Þ¤Þ¤Ê¤¤¡£ +½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ò³ÊǼ¤Ç¤­¤ë¤À¤±¤ÎÂ礭¤µ¤ò»ý¤Ã¤¿Ê¸»úÎó¤òÅϤ¹¤³¤È¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤·¡¢Ê¸»úÎó¤ÎÆâÍƤϽ¤Àµ¤µ¤ì¤Ê¤¤¡£ +(libc 4.4.4 °Ê¹ß¤Ç¤³¤ÎµóÆ°¤¬Å¬ÍѤµ¤ì¤Æ¤¤¤ë¡£ +libc 4.4.1 ¤Ê¤É¤ÎÈó¾ï¤Ë¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î libc ¤Ç¤Ï +ʸ»úÎó¤¬Ã»¤«²á¤®¤¿¾ì¹ç¤Ë¤Ï \fImax\fP ¤¬ÊÖ¤µ¤ì¤ë¡£) +.LP +ÊÖ¤êÃÍ 0 ¤Ïɬ¤º¤·¤â¥¨¥é¡¼¤ò°ÕÌ£¤·¤Æ¤¤¤ëÌõ¤Ç¤Ï¤Ê¤¤¤Î¤ÇÃí°Õ¤¹¤ë¤³¤È¡£ +Î㤨¤Ð¡¢Â¿¤¯¤Î¥í¥±¡¼¥ë¤Ç¤Ï +.B %p +¤Ï¶õʸ»úÎó¤òÊÖ¤¹¡£ +.SH ´Ä¶­ÊÑ¿ô +´Ä¶­ÊÑ¿ô +.B TZ +¤È +.B LC_TIME +¤¬»ÈÍѤµ¤ì¤ë¡£ +(ÌõÃí: +.B LC_ALL +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï +.B LC_TIME +¤è¤ê¤â¤½¤Á¤é¤¬Í¥À褵¤ì¤ë¡£ +.B LC_TIME +¤â +.B LC_ALL +¤âÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï +.B LANG +¤¬»ÈÍѤµ¤ì¤ë¡£) +.SH ½àµò +SVr4, C89, C99. +¸Ä¡¹¤ÎÊÑ´¹¤¬¸·Ì©¤Ë¤É¤Îµ¬³Ê¤Ë´Þ¤Þ¤ì¤ë¤«¤Ï¡¢ +ANSI C (°õ¤Ê¤·)¡¢Åý°ì UNIX µ¬³Ê (SU°õ)¡¢Olson ¤Î timezone ¥Ñ¥Ã¥±¡¼¥¸ (TZ°õ)¡¢ +glibc Æȼ« (GNU°õ) ¤Ç¼¨¤·¤Æ¤¤¤ë¡£glibc2 ¤Ç¤Ï +.B %+ +¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +¤¤¤¯¤Ä¤«¤Î³ÈÄ¥¤¬¹Ô¤ï¤ì¤Æ¤¤¤ë¡£POSIX.1 ¤Ç¤Ï ANSI C ¤Î¤ß¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +POSIX.2 ¤Î +.BR date (1) +¤Î¤È¤³¤í¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë´ö¤Ä¤«¤Î³ÈÄ¥¤Ï +.BR strftime () +¤Ë¤âŬÍѤǤ­¤ë¤À¤í¤¦¡£ +.B %F +ÊÑ´¹¤Ï C99 ¤È POSIX.1-2001 ¤Ë¤¢¤ë¡£ + +SUSv2 ¤Ç¤Ï¡¢ +.B %S +¤Ï 00 ¤«¤é 61 ¤ÎÈϰϤò¤È¤ë¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¡¢1ʬ´Ö¤Î¤¦¤Á±¼Éä¬ 2¤ÄÆþ¤ë²ÄǽÀ­¤¬ÍýÏÀŪ¤Ë¤Ï¤¢¤ë¤³¤È¤ò +¹Íθ¤·¤Æ¤Î¤â¤Î¤Ç¤¢¤ë (¼ÂºÝ¤Ë¤Ï¡¢¤³¤Î¤è¤¦¤Ê¾õ¶·¤Ï¤³¤ì¤Þ¤Ç°ìÅÙ¤â +µ¯¤³¤Ã¤Æ¤¤¤Ê¤¤)¡£ +.SH Ãí°Õ +.SS ISO\ 8601 ¤Î½µ¡¦ÍËÆüɽµ­ (Week Dates) +.BR %G , +.BR %g , +.BR %V +¤Ï¡¢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 ¤Ç¤ÎÃí°Õ +glibc ¤Ç¤ÏÊÑ´¹»ØÄê¤Ë¤¤¤¯¤Ä¤«³ÈÄ¥¤ò¹Ô¤Ã¤Æ¤¤¤ë +(¤³¤ì¤é¤Î³ÈÄ¥¤Ï POSIX.1-2001 ¤Ë¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +¾¤Î¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤ÇƱÍͤε¡Ç½¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë)¡£ +.\" HP-UX ¤È Tru64 ¤Ë¤âƱÍͤε¡Ç½¤¬¤¢¤ë¡£ +\(aq%\(aq ʸ»ú¤ÈÊÑ´¹»ØÄêʸ»ú¤Î´Ö¤Ë¡¢¥ª¥×¥·¥ç¥ó¤È¤·¤Æ +.I flag +¤È¥Õ¥£¡¼¥ë¥É¤Î +.I Éý +¤ò»ØÄê¤Ç¤­¤ë (¤³¤ì¤é¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï +.B E +¤ä +.B O +½¤¾þ»Ò¤ÎÁ°¤ËÃÖ¤¯)¡£ + +°Ê²¼¤Î¥Õ¥é¥°Ê¸»ú¤¬»ÈÍѤǤ­¤ë: +.TP +.B _ +(²¼Àþ) +¿ôÃͤηë²Ìʸ»úÎó¤Î¥Ñ¥Ç¥£¥ó¥° (·êËä¤á) ¤ò¥¹¥Ú¡¼¥¹ (¶õÇòʸ»ú) ¤Ç¹Ô¤¦¡£ +.TP +.B \- +(¥À¥Ã¥·¥å) +¿ôÃͤηë²Ìʸ»úÎó¤ËÂФ¹¤ë¥Ñ¥Ç¥£¥ó¥°¤ò¹Ô¤ï¤Ê¤¤¡£ +.TP +.B 0 +ÊÑ´¹»ØÄêʸ»ú¤¬¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥¹¥Ú¡¼¥¹¤Ç¥Ñ¥Ç¥£¥ó¥°¤ò¹Ô¤¦¾ì¹ç¤Ç¤â¡¢ +¿ôÃͤηë²Ìʸ»úÎó¤Ø¤Î¥Ñ¥Ç¥£¥ó¥°¤ò 0 ¤Ç¹Ô¤¦¡£ +.TP +.B ^ +·ë²Ìʸ»úÎóÃæ¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥Èʸ»ú¤òÂçʸ»ú¤ËÊÑ´¹¤¹¤ë¡£ +.TP +.B # +·ë²Ìʸ»úÎó¤ÎÂçʸ»ú¡¦¾®Ê¸»ú¤òÆþ¤ìÂؤ¨¤ë +(¤³¤Î¥Õ¥é¥°¤ÏÆÃÄê¤ÎÊÑ´¹»ØÄêʸ»ú¤Ç¤·¤«µ¡Ç½¤·¤Ê¤¤¡£¤½¤ÎÃæ¤Ç¤â +ËÜÅö¤ËÍ­ÍÑ¤Ê¤Î¤Ï +.B %Z +¤Î¾ì¹ç¤À¤±¤Ç¤¢¤ë)¡£ +.PP +¥ª¥×¥·¥ç¥ó¤Î10¿Ê¿ô¤ÎÉý»ØÄê»Ò¤Ï¥Õ¥é¥°¤Î¸å¤í¤ËÃÖ¤¯¤³¤È¤¬¤Ç¤­¤ë +(¥Õ¥é¥°¤Ï¤Ê¤¯¤Æ¤â¤è¤¤)¡£¥Õ¥£¡¼¥ë¥É¤ÎËÜÍè¤ÎÂ礭¤µ¤¬»ØÄꤵ¤ì¤¿Éý¤è¤ê¤â +¾®¤µ¤¤¾ì¹ç¡¢·ë²Ìʸ»úÎó¤Îº¸Â¦¤Ï»ØÄꤵ¤ì¤¿Éý¤Þ¤Ç¥Ñ¥Ç¥£¥ó¥°¤µ¤ì¤ë¡£ +.SH ¥Ð¥° +.BR gcc (1) +¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤Ï¤ª¤«¤·¤Ê¤È¤³¤í¤¬¤¢¤ê¡¢ +.B %c +¤Î»ÈÍÑË¡¤Ë¤Ä¤¤¤Æ°Ê²¼¤Î¤è¤¦¤Ê·Ù¹ð¤ò½Ð¤¹: +.I "warning: `%c' yields only last 2 digits of year in some locales" +.RI ( ·Ù¹ð: ¤¤¤¯¤Ä¤«¤Î¥í¥±¡¼¥ë¤Ç¤Ï `%c' ¤Ïǯ¤Î²¼2·å¤·¤«½ÐÎϤ·¤Ê¤¤ )¡£ +¤â¤Á¤í¤ó¥×¥í¥°¥é¥Þ¤¬ +.B %c +¤ò»È¤¦¤Î¤Ï¤ªÁ¦¤á¤Ç¤­¤ë¤³¤È¤Ç¤¢¤ë¡£ +.B %c +¤ò»È¤¦¤ÈŬÀÚ¤ÊÆüÉդȻþ¹ï¤Îɽµ­¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¤«¤é¤Ç¤¢¤ë¡£ +.BR gcc (1) +¤Î¤³¤ÎÌäÂê¤ò²óÈò¤·¤è¤¦¤È¤¹¤ë¤È¡¢²¿¤«¤¹¤Ã¤­¤ê¤·¤Ê¤¤µ¤Ê¬¤Ë¤Ê¤ë¤À¤í¤¦¡£ +Èæ³ÓŪ¤­¤ì¤¤¤Ê²ò·èÊýË¡¤Ï°Ê²¼¤Î¤è¤¦¤ÊÃæ´Ö´Ø¿ô¤òÄɲ乤뤳¤È¤Ç¤¢¤ë¡£ +.in +4n +.nf + +size_t +my_strftime(char *s, size_t max, const char *fmt, + const struct tm *tm) +{ + return strftime(s, max, fmt, tm); +} +.fi +.in +.RE + +¸½ºß¤Ç¤Ï¡¢ +.BR gcc (1) +¤Ï¤³¤Î·Ù¹ð¤òÍÞ¤¨¤ë¤¿¤á¤Î \fI\-Wno\-format\-y2k\fP ¥ª¥×¥·¥ç¥ó¤ò +Ä󶡤·¤Æ¤ª¤ê¡¢¾åµ­¤Î²óÈòºö¤Ï¤â¤Ï¤äɬÍפʤ¤¡£ +.SH Îã +.B "RFC\ 2822 ½àµò¤ÎÆüÉÕ·Á¼°" +(%a ¤È %b ¤Ï±Ñ¸ì¥í¥±¡¼¥ë) +.PP +.in +2n +"%a,\ %d\ %b\ %Y\ %T\ %z" +.PP +.B "RFC\ 822 ½àµò¤ÎÆüÉÕ·Á¼°" +(%a ¤È %b ¤Ï±Ñ¸ì¥í¥±¡¼¥ë) +.PP +.in +2n +"%a,\ %d\ %b\ %y\ %T\ %z" +.SS ¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à +°Ê²¼¤Î¥×¥í¥°¥é¥à¤ò»È¤¦¤È +.BR strftime () +¤Î¼Â¸³¤¬¤Ç¤­¤ë¡£ +.PP +°Ê²¼¤Ë¡¢ +.BR strftime () +¤Î glibc ¼ÂÁõ¤¬À¸À®¤¹¤ë·ë²Ì¤ÎÎã¤ò¤¤¤¯¤Ä¤«¼¨¤¹: +.nf + +.RB "$" " ./a.out \(aq%m\(aq" +Result string is "11" +.RB "$" " ./a.out \(aq%5m\(aq" +Result string is "00011" +.RB "$" " ./a.out \(aq%_5m\(aq" +Result string is " 11" +.fi +.in +.PP +¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹¤Ï°Ê²¼¤ÎÄ̤ê: +.nf + +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + char outstr[200]; +.PP +°Ê²¼¤Ë¡¢ +.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; + + t = time(NULL); + tmp = localtime(&t); + if (tmp == NULL) { + perror("localtime"); + exit(EXIT_FAILURE); + } + + if (strftime(outstr, sizeof(outstr), argv[1], tmp) == 0) { + fprintf(stderr, "strftime returned 0"); + exit(EXIT_FAILURE); + } + + printf("Result string is \\"%s\\"\\n", outstr); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR date (1), +.BR time (2), +.BR ctime (3), +.BR setlocale (3), +.BR sprintf (3), +.BR strptime (3) diff --git a/release/man3/string.3 b/release/man3/string.3 new file mode 100644 index 00000000..83cd1b8c --- /dev/null +++ b/release/man3/string.3 @@ -0,0 +1,122 @@ +.\" 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 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 +.\" +.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 +\- ʸ»úÎó¤òÁàºî¤¹¤ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int strcasecmp(const char *" s1 ", const char *" s2 ); +.sp +.BI "int strncasecmp(const char *" s1 ", const char *" s2 ", size_t " n ); +.sp +.BI "char *index(const char *" s ", int " c ); +.sp +.BI "char *rindex(const char *" s ", int " c ); +.sp +.B #include +.sp +.BI "char *stpcpy(char *" dest ", const char *" src ); +.sp +.BI "char *strcat(char *" dest ", const char *" src ); +.sp +.BI "char *strchr(const char *" s ", int " c ); +.sp +.BI "int strcmp(const char *" s1 ", const char *" s2 ); +.sp +.BI "int strcoll(const char *" s1 ", const char *" s2 ); +.sp +.BI "char *strcpy(char *" dest ", const char *" src ); +.sp +.BI "size_t strcspn(const char *" s ", const char *" reject ); +.sp +.BI "char *strdup(const char *" s ); +.sp +.BI "char *strfry(char *" string ); +.sp +.BI "size_t strlen(const char *" s ); +.sp +.BI "char *strncat(char *" dest ", const char *" src ", size_t " n ); +.sp +.BI "int strncmp(const char *" s1 ", const char *" s2 ", size_t " n ); +.sp +.BI "char *strncpy(char *" dest ", const char *" src ", size_t " n ); +.sp +.BI "char *strpbrk(const char *" s ", const char *" accept ); +.sp +.BI "char *strrchr(const char *" s ", int " c ); +.sp +.BI "char *strsep(char **" stringp ", const char *" delim ); +.sp +.BI "size_t strspn(const char *" s ", const char *" accept ); +.sp +.BI "char *strstr(const char *" haystack ", const char *" needle ); +.sp +.BI "char *strtok(char *" s ", const char *" delim ); +.sp +.BI "size_t strxfrm(char *" dest ", const char *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +ʸ»úÎó´Ø¿ô¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ë +ÂФ·¤Æ¡¢Ê¸»úÎóÁàºî¤ò¼Â¹Ô¤¹¤ë¡£ +¤½¤ì¤¾¤ì¤Î´Ø¿ô¤ÎÀâÌÀ¤Ë¤Ä¤¤¤Æ¤Ï¸Ä¡¹¤Îman¥Ú¡¼¥¸¤ò¸«¤è¡£ +.SH ´ØÏ¢¹àÌÜ +.BR index (3), +.BR rindex (3), +.BR strcasecmp (3), +.BR stpcpy (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) diff --git a/release/man3/strlen.3 b/release/man3/strlen.3 new file mode 100644 index 00000000..bb8af3b1 --- /dev/null +++ b/release/man3/strlen.3 @@ -0,0 +1,55 @@ +.\" 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 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 +.\" +.TH STRLEN 3 1993-04-12 "" "Linux Programmer's Manual" +.SH ̾Á° +strlen \- ʸ»úÎó¤ÎŤµ¤ò·×»»¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t strlen(const char *" s ); +.fi +.SH ÀâÌÀ +.BR strlen () +´Ø¿ô¤Ïʸ»úÎó \fIs\fP ¤ÎŤµ¤ò·×»»¤¹¤ë¡£ +¤³¤Î¤È¤­¡¢½ªÃ¼Ê¸»ú \(aq\\0\(aq ¤Ï·×»»¤Ë´Þ¤Þ¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR strlen () +´Ø¿ô¤Ï \fIs\fP ¤ÎÃæ¤Îʸ»ú¿ô¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.SH ´ØÏ¢¹àÌÜ +.BR string (3), +.BR wcslen (3), +.BR wcsnlen (3) diff --git a/release/man3/strnlen.3 b/release/man3/strnlen.3 new file mode 100644 index 00000000..cd7597bb --- /dev/null +++ b/release/man3/strnlen.3 @@ -0,0 +1,44 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" 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 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strnlen \- ¸ÇÄêŤÎʸ»úÎó¤ÎŤµ¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.sp +.B #include +.sp +.BI "size_t strnlen(const char *" s ", size_t " maxlen ); +.fi +.SH ÀâÌÀ +.BR strnlen () +´Ø¿ô¤Ï \fIs\fP ¤¬»Ø¤¹Ê¸»úÎó¤ÎŤµ¤ò¥Ð¥¤¥È¿ô¤ÇÊÖ¤¹¡£ +Ťµ¤Ë¤Ï½ªÃ¼¤Î \(aq\\0\(aq ʸ»ú¤ò´Þ¤Þ¤Ê¤¤¡£ +¤Þ¤¿Ä¹¤µ¤ÏºÇÂç¤Ç \fImaxlen\fP ¤Þ¤Ç¤Ç¤¢¤ê¡¢ +.BR strnlen () +¤Ï \fIs\fP ¤ÎºÇ½é¤Î \fImaxlen\fP ¥Ð¥¤¥È¤Î¤ß¤ò¸¡ºº¤· +\fIs+maxlen\fP ¤è¤êÀè¤ò¸¡ºº¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR strnlen () +´Ø¿ô¤Ï \fImaxlen\fP °Ê²¼¤Ê¤é¤Ð \fIstrlen(s)\fP ¤ÈƱ¤¸ +ÃͤòÊÖ¤¹¡£\fIs\fP ¤Î»Ø¤¹Ê¸»úÎ󤬺ÇÂç \fImaxlen\fP ¥Ð¥¤¥È¤Þ¤Ç¤Ë +\(aq\\0\(aq ʸ»ú¤ò´Þ¤Þ¤Ê¤¤¾ì¹ç¤Ë¤Ï \fImaxlen\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR strlen (3), +.BR feature_test_macros (7) diff --git a/release/man3/strpbrk.3 b/release/man3/strpbrk.3 new file mode 100644 index 00000000..d2b6e548 --- /dev/null +++ b/release/man3/strpbrk.3 @@ -0,0 +1,65 @@ +.\" 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 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 1993-04-12 "" "Linux Programmer's Manual" +.SH ̾Á° +strpbrk \- ʸ»ú¥»¥Ã¥ÈÃæ¤Îʸ»ú¤òʸ»úÎ󤫤鸡½Ð¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strpbrk(const char *" s ", const char *" accept ); +.fi +.SH ÀâÌÀ +.BR strpbrk () +´Ø¿ô¤Ïʸ»úÎó \fIaccept\fP ¤Ë´Þ¤Þ¤ì¤ëʸ»ú¤¬Ê¸»úÎó \fIs\fP ¤Ë +¤ª¤¤¤ÆºÇ½é¤Ë¸½¤ì¤ë°ÌÃÖ¤òÁܤ·½Ð¤¹¡£ +.SH ÊÖ¤êÃÍ +.BR strpbrk () +´Ø¿ô¤Ï¡¢ \fIs\fP ¤Ë´Þ¤Þ¤ì¤ëʸ»ú¤Î¤¦¤Á¡¢ +\fIaccept\fP ¤Ë´Þ¤Þ¤ì¤ëʸ»ú¤Î¤É¤ì¤«¤Ë°ìÃפ·¤¿¤â¤Î¤Ø¤Î +¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤½¤Î¤è¤¦¤Êʸ»ú¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.SH ´ØÏ¢¹àÌÜ +.BR index (3), +.BR memchr (3), +.BR rindex (3), +.BR strchr (3), +.BR strsep (3), +.BR strspn (3), +.BR strstr (3), +.BR strtok (3), +.BR wcspbrk (3) diff --git a/release/man3/strptime.3 b/release/man3/strptime.3 new file mode 100644 index 00000000..10dd7be7 --- /dev/null +++ b/release/man3/strptime.3 @@ -0,0 +1,417 @@ +.\" Copyright 1993 Mitchum DSouza +.\" +.\" 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, jmv@lucifer.dorms.spbu.ru, 1999-11-08 +.\" Modified, aeb, 2000-04-07 +.\" Updated from glibc docs, C. Scott Ananian, 2001-08-25 +.\" 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 Í×ÁÇÊ̤λþ¹ï +.\" +.TH STRPTIME 3 2009-12-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strptime \- ʸ»úÎó¤Ç¤¢¤é¤ï¤µ¤ì¤Æ¤¤¤ë»þ´Ö¤ò tm ¹½Â¤ÂΤλþ´Ö¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.BR "#define _XOPEN_SOURCE" " /* glibc2 ¤Ç¤Ï¡¢¤³¤ì¤¬É¬Íס£ */" +.br +.B #include +.sp +.BI "char *strptime(const char *" s ", const char *" format , +.BI "struct tm *" tm ); +.SH ÀâÌÀ +.BR strptime () +´Ø¿ô¤Ï +.BR strftime (3) +¤ÎµÕ´Ø¿ô¤Ç¤¢¤ê¡¢¥Ý¥¤¥ó¥¿ +.I s +¤¬»Ø¤¹Ê¸»úÎó¤ò»þ´Ö¤ËÊÑ´¹¤¹¤ë¡£ +ÊÑ´¹¤ÎºÝ¤Ë¤Ï +.I format +¤Ç»ØÄꤷ¤¿¥Õ¥©¡¼¥Þ¥Ã¥È¤òÍѤ¤¡¢Ãͤϥݥ¤¥ó¥¿ +.I tm +¤¬»Ø¤¹ +.I tm +¹½Â¤ÂΤ˼ý¤á¤é¤ì¤ë¡£ +.I format +¤Ï¡¢ +.BR scanf (3) +¤Ç»È¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤Ê¡¢ +¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤È¥Æ¥­¥¹¥Èʸ»ú¤Ç¹½À®¤µ¤ì¤Æ¤¤¤ëʸ»úÎó¤Ç¤¢¤ë¡£ +¸Ä¡¹¤Î¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ï +.B % +¤È¤½¤ì¤Ë³¤¯Ê¸»ú¤«¤é¤Ê¤ê¡¢ +¸å¼Ô¤Ë¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤òÃÖ¤­´¹¤¨¤ëÆâÍƤò»ØÄꤹ¤ë¡£ +.I format +ʸ»úÎóÃæ¤Î¾¤ÎÁ´¤Æ¤Îʸ»ú¤Ë¤Ï¡¢ÆþÎÏʸ»úÎó¤Ë¥Þ¥Ã¥Á¤¹¤ëʸ»ú¤¬¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎóÃæ¤Ë¤¢¤ë¶õÇò¤ÏÎã³°¤Ç¤¢¤ê¡¢ +ÆþÎÏʸ»úÎóÃæ¤Î 0 ¸Ä°Ê¾å¤Î¶õÇò¤È¥Þ¥Ã¥Á¤¹¤ë¡£ +2 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Î´Ö¤Ë¤Ï¡¢ +¶õÇò¡¦±Ñ»ú¡¦¿ô»ú¤¬¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.BR strptime () +´Ø¿ô¤Ï¡¢ÆþÎÏʸ»úÎó¤òº¸¤«¤é±¦¤Ø½èÍý¤¹¤ë¡£ +ÆþÎϤµ¤ì¤¿ 3 ¤Ä¤ÎÍ×ÁÇ (¶õÇò¡¦Ê¸»ú¡¦¥Õ¥©¡¼¥Þ¥Ã¥È) ¤Ï¡¢½ç¤Ë½èÍý¤µ¤ì¤ë¡£ +ÆþÎϤ¬¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤È¥Þ¥Ã¥Á¤Ç¤­¤Ê¤¤¾ì¹ç¡¢´Ø¿ô¤ÏÄä»ß¤¹¤ë¡£ +»Ä¤ê¤Î¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤ÈÆþÎÏʸ»úÎó¤Ï½èÍý¤µ¤ì¤Ê¤¤¡£ +.PP +»ÈÍѲÄǽ¤Ê¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤ò°Ê²¼¤Ëµó¤²¤ë¡£ +(ÍËÆü¤ä·î¤Î̾Á°¤È¤¤¤Ã¤¿) ʸ»úÎó¤ò¥Þ¥Ã¥Á¤µ¤»¤ë¾ì¹ç¡¢ +Âçʸ»ú¤È¾®Ê¸»ú¤Ï¶èÊ̤»¤º¤ËÈæ³Ó¤¹¤ë¡£ +¿ô¤ò¥Þ¥Ã¥Á¤µ¤»¤ë¾ì¹ç¡¢Á°¤Ë 0 ¤ò¤Ä¤±¤Æ¤â¹½¤ï¤Ê¤¤¤¬É¬¤º¤·¤âɬÍפǤϤʤ¤¡£ +.TP +.B %% +ʸ»ú¤È¤·¤Æ¤Î +.BR % ¡£ +.TP +.BR %a " ¤Þ¤¿¤Ï " %A +¸½ºß¤Î¥í¥±¡¼¥ë¤Ç¤ÎÍËÆü̾ (¾Êά̾¤Þ¤¿¤Ï´°Á´¤Ê̾Á°)¡£ +.TP +.BR %b " ¤Þ¤¿¤Ï " %B " ¤Þ¤¿¤Ï " %h +¸½ºß¤Î¥í¥±¡¼¥ë¤Ç¤Î·î̾ (¾Êά̾¤Þ¤¿¤Ï´°Á´¤Ê̾Á°)¡£ +.TP +.B %c +¸½ºß¤Î¥í¥±¡¼¥ë¤Ç¤ÎÆüÉդȻþ¹ï¤Îɽ¸½¡£ +.TP +.B %C +1 À¤µªÃæ¤Îǯ (0-99)¡£ +.TP +.BR %d " ¤Þ¤¿¤Ï " %e +·îÆâ¤ÎÆüÉÕ (1-31)¡£ +.TP +.B %D +ÆüÉÕ¡£ +.B %m/%d/%y +¤ÈƱ¤¸¡£ +(¤³¤ì¤Ï¥¢¥á¥ê¥«¼°¤ÎÆüÉÕ·Á¼°¤Ç¡¢ +¥è¡¼¥í¥Ã¥Ñ¤Ç¤ÏÆÃ¤Ë +.B %d/%m/%y +¤È¤¤¤¦·Á¼°¤¬¹­¤¯»È¤ï¤ì¤Æ¤¤¤ë¤¿¤á¤Ë¡¢ +¥¢¥á¥ê¥«¿Í°Ê³°¤Ë¤Ïʶ¤é¤ï¤·¤¯´¶¤¸¤é¤ì¤ë¡£ +ISO 8601 µ¬³Ê¤Ç¤Ï +.B %Y-%m-%d +¤È¤¤¤¦·Á¼°¤Ç¤¢¤ë¡£) +.TP +.B %H +»þ´Ö (0-23)¡£ +.TP +.B %I +12 »þ´ÖÀ©¤Ç¤Î»þ´Ö (1-12)¡£ +.TP +.B %j +ǯ¤Î½é¤á¤«¤é¤ÎÄÌ»»¤ÎÆüÉÕ (1-366)¡£ +.TP +.B %m +¿ô»úɽ¸½¤Î·î (1-12)¡£ +.TP +.B %M +ʬ (0-59)¡£ +.TP +.B %n +Ǥ°Õ¤Î¶õÇò¡£ +.TP +.B %p +¥í¥±¡¼¥ë¤Î AM (¸áÁ°) ¤È PM (¸á¸å) ¤ËÂбþ¤¹¤ë¤â¤Î¡£ +(Ãí°Õ: Âбþ¤¹¤ë¤â¤Î¤¬¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£) +.TP +.B %r +(¥í¥±¡¼¥ë¤Î AM ¤È PM ¤ò»È¤Ã¤¿) 12 »þ´ÖÀ©¤Î»þ´Ö¡£ +POSIX ¥í¥±¡¼¥ë¤Ç¤Ï +.B %I:%M:%S %p +¤ÈƱ¤¸¡£ +¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤¤¤Æ +.B LC_TIME +¥Ñ¡¼¥È¤Î +\fIt_fmt_ampm\fP ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +Æ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.TP +.B %R +.B %H:%M +¤ÈƱ¤¸¡£ +.TP +.B %S +Éà (0-60; 60 ¤Ï±¼Éäò¼¨¤¹¡£°ÊÁ°¤Ï 61 ¤â»ØÄê¤Ç¤­¤¿)¡£ +.TP +.B %t +Ǥ°Õ¤Î¶õÇò¡£ +.TP +.B %T +.B %H:%M:%S +¤ÈƱ¤¸¡£ +.TP +.B %U +ÆüÍËÆü¤ò½µ¤Î»Ï¤Þ¤ê¤È¤·¤¿Ç¯ÄÌ»»¤Ç¤Î½µ¿ô (0-53)¡£ +1 ·î¤ÎºÇ½é¤ÎÆüÍËÆü¤òÂè 1 ½µÌܤκǽé¤ÎÆü¤¹¤ë¡£ +.TP +.B %w +ÆüÍËÆü¤ò 0 ¤È¤·¤¿¿ô»úɽµ­¤ÎÍËÆü (0-6)¡£ +.TP +.B %W +·îÍËÆü¤ò½µ¤Î»Ï¤Þ¤ê¤È¤·¤¿Ç¯ÄÌ»»¤Ç¤Î½µ¿ô (0-53)¡£ +1 ·î¤ÎºÇ½é¤Î·îÍËÆü¤òÂè 1 ½µÌܤκǽé¤ÎÆü¤¹¤ë¡£ +.TP +.B %x +ÆüÉÕ¡£¥í¥±¡¼¥ë¤ÎÆüÉÕ¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»È¤¦¡£ +.TP +.B %X +»þ¹ï¡£¥í¥±¡¼¥ë¤Î»þ¹ï¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»È¤¦¡£ +.TP +.B %y +1 À¤µªÃæ¤Îǯ (0-99)¡£ +À¤µª¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢ +Ãͤ¬ 69-99 ¤ÎÈϰϤΤȤ­¤Ï 20 À¤µª¤Îǯ (1969-1999)¡¢ +Ãͤ¬ 00-68 ¤ÎÈϰϤΤȤ­¤Ï 21 À¤µª¤Îǯ (2000-2068) ¤È¤¹¤ë¡£ +.TP +.B %Y +ǯ¡£À¤µª¤ÎÉôʬ¤ò´Þ¤à (Îã: 1991)¡£ +.LP +E ¤ä O ¤È¤¤¤¦½¤Àµ»Ò¤ò»È¤¦¤³¤È¤ÇÊѹ¹¤Ç¤­¤ë¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¤â¤¢¤ë¡£ +¤³¤ì¤é¤Î½¤Àµ»Ò¤Ï¡¢Ê̤Υե©¡¼¥Þ¥Ã¥È¤ä»ÅÍͤò»È¤¦¤³¤È¤ò»Ø¼¨¤¹¤ë¡£ +Ê̤Υե©¡¼¥Þ¥Ã¥È¤ä»ÅÍͤ¬¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¸ºß¤·¤Ê¤¤¤È¤­¤Ï¡¢ +Êѹ¹¤·¤Æ¤¤¤Ê¤¤¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬»È¤ï¤ì¤ë¡£ +.LP +E ½¤Àµ»Ò¤Ï¡¢¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿ÆüÉդȻþ¹ï¤ÎÊ̤Îɽ¸½·Á¼°¤¬ +ÆþÎÏʸ»úÎó¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤³¤È¤ò»ØÄꤹ¤ë¡£ +.TP +.B %Ec +ÆüÉդȻþ¹ï¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£ +.TP +.B %EC +´ð½àǯ (´ü´Ö) ¤Î̾Á°¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£ +.TP +.B %Ex +ÆüÉÕ¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£ +.TP +.B %EX +»þ¹ï¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£ +.TP +.B %Ey +.B %EC +(ǯ¤Î¤ß) ¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£ +.TP +.B %EY +´°Á´¤Ê·Á¼°¤Îǯ¡£Ê̤Îɽ¸½·¿¼°¤ò»È¤¦¡£ +.LP +O ½¤Àµ»Ò¤Ï¡¢¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Υե©¡¼¥Þ¥Ã¥È¤ÎÃæ¤Ë +¿ôÃͤÎÆþÎϤ¬¤¢¤ë¤³¤È¤ò»ØÄꤹ¤ë¡£ +.TP +.BR %Od " ¤Þ¤¿¤Ï " %Oe +·î¤Î½é¤á¤«¤é¤ÎÄÌ»»¤ÎÆüÉÕ¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +0 ¤òƬ¤Ë¤Ä¤±¤Æ¤â¤è¤¤¤¬¡¢É¬¿Ü¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B %OH +»þ´Ö (24 »þ´ÖÀ©)¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.TP +.B %OI +»þ´Ö (12 »þ´ÖÀ©)¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.TP +.B %Om +·î¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.TP +.B %OM +ʬ¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.TP +.B %OS +Éá£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.TP +.B %OU +ǯ¤Î½é¤á¤«¤é¤ÎÄÌ»»¤Î½µ¿ô (ÆüÍËÆü¤ò½µ¤Î»Ï¤á¤È¤¹¤ë)¡£ +¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.TP +.B %Ow +¿ôÃÍɽµ­¤ÎÍËÆü (ÆüÍËÆü¤ò 0 ¤È¤¹¤ë)¡£ +¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.TP +.B %OW +ǯ¤Î½é¤á¤«¤é¤ÎÄÌ»»¤Î½µ¿ô (·îÍËÆü¤ò½µ¤Î»Ï¤á¤È¤¹¤ë)¡£ +¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.TP +.B %Oy +ǯ +.RB ( %C +¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È)¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£ +.LP +Í×ÁÇÊ̤λþ¹ï¹½Â¤ÂÎ \fItm\fP ¤Ï +\fI\fP Æâ¤Ç°Ê²¼¤ÎÍͤËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +struct tm { + int tm_sec; /* Éà */ + int tm_min; /* ʬ */ + int tm_hour; /* »þ´Ö */ + int tm_mday; /* Æü */ + int tm_mon; /* ·î */ + int tm_year; /* ǯ */ + int tm_wday; /* ÍËÆü */ + int tm_yday; /* ǯÆâÄÌ»»Æü */ + int tm_isdst; /* ²Æ»þ´Ö */ +}; +.fi +.in +.SH ÊÖ¤êÃÍ +¤³¤Î´Ø¿ô¤ÎÊÖ¤êÃͤϡ¢´Ø¿ô¤ÎÃæ¤Ç½èÍý¤µ¤ì¤Ê¤«¤Ã¤¿ºÇ½é¤Îʸ»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤¬É¬Íפ¹¤ë°Ê¾å¤Îʸ»ú¤¬ÆþÎÏʸ»úÎó¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +ÊÖ¤êÃͤϺǸå¤Ë½èÍý¤µ¤ì¤¿ÆþÎÏʸ»ú¤Î¼¡¤Îʸ»ú¤ò»Ø¤¹¡£ +¤¹¤Ù¤Æ¤ÎÆþÎÏʸ»úÎ󤬽èÍý¤µ¤ì¤¿¾ì¹ç¡¢ +ÊÖ¤êÃͤÏʸ»úÎóËöÈø¤Î NULL ¥Ð¥¤¥È¤ò»Ø¤¹¡£ +.BR strptime () +¤¬¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Î¤¹¤Ù¤Æ¤ÎÈæ³Ó¤Ë¼ºÇÔ¤·¡¢ +¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢´Ø¿ô¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ½àµò +SUSv2, POSIX.1-2001. +.SH Ãí°Õ +.LP +¸¶Â§¤È¤·¤Æ¡¢¤³¤Î´Ø¿ô¤Ï \fItm\fP ¤Î½é´ü²½¤Ï¤»¤º¤Ë¡¢ +»ØÄꤵ¤ì¤¿ÃͤΤߤòÆþ¤ì¤ë¡£ +¤Ä¤Þ¤ê¡¢¤³¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë \fItm\fP ¤ò½é´ü²½¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¾¤Î Unix ¥·¥¹¥Æ¥à¤È¤Ï¡¢ºÙ¤«¤¤ÅÀ¤Ç°Û¤Ê¤ë¡£ +glibc ¤Î¼ÂÁõ¤Ç¤Ï¡¢ÌÀ¼¨Åª¤Ë»ØÄꤵ¤ì¤Ê¤¤¥Õ¥£¡¼¥ë¥É¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +Îã³°¤È¤·¤Æ¡¢Ç¯¡¦·î¡¦Æü¤Î¤¤¤º¤ì¤«¤ÎÍ×ÁǤ¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¤Ë +.I tm_wday +¤È +.I tm_yday +¤¬ºÆ·×»»¤µ¤ì¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤Ï¡¢libc 4.6.8 °Ê¹ß¤Ç»ÈÍѤǤ­¤ë¡£ +Linux ¤Î libc4 ¤È libc5 ¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ï¡¢ +¤³¤Î´Ø¿ô¤Î¥×¥í¥È¥¿¥¤¥×¤ò¾ï¤ËÄêµÁ¤¹¤ë¡£ +glibc2 ¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ï¡¢ +.B _XOPEN_SOURCE +¤Þ¤¿¤Ï +.B _GNU_SOURCE +¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Î¤ß¡¢ +¤³¤Î´Ø¿ô¤Î¥×¥í¥È¥¿¥¤¥×¤òÄ󶡤¹¤ë¡£ +.PP +libc 5.4.13 ¤è¤êÁ°¤Ç¤Ï¡¢¶õÇò (¤È \(aqn\(aq ¤Þ¤¿¤Ï \(aqt\(aq »ØÄê) ¤Ï°·¤ï¤ì¤Ê¤«¤Ã¤¿¡£ +¥í¥±¡¼¥ë¤Î½¤Àµ»Ò \(aqE\(aq ¤È \(aqO\(aq ¤Ï¼õ¤±ÉÕ¤±¤é¤ì¤Ê¤«¤Ã¤¿¡£ +¤Þ¤¿¡¢\(aqC\(aq ¤Î»ØÄê¤Ï \(aqc\(aq ¤Î»ØÄê¤ÈƱ¤¸°ÕÌ£¤Ç°·¤ï¤ì¤¿¡£ +.PP +\(aqy\(aq (1 À¤µªÃæ¤Îǯ) ¤Î»ØÄê¤Ï¡¢libc4 ¤È libc5 ¤Ç¤Ï 20 À¤µª¤Îǯ¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +glibc 2.0 ¤Ç¤Ï 1950-2049 ¤ÎÈϰϤȤ·¤Æ²ò¼á¤µ¤ì¤ë¡£ +glibc 2.1 ¤«¤é¤Ï 1969-2068 ¤ÎÈϰϤȤ·¤Æ²ò¼á¤µ¤ì¤ë¡£ +.\" libc4 ¤È libc5 ¤Ç¤Ï %I ÍѤΥ³¡¼¥É¤¬²õ¤ì¤Æ¤¤¤ë (glibc ¤Ç½¤Àµ¤µ¤ì¤¿; +.\" %OI ¤Ï glibc 2.2.4 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£ +.SS glibc ¤Ç¤ÎÃí°Õ +ÂоÝÀ­¤Î¤¿¤á¤Ë¡¢glibc ¤Ç¤Ï +.BR strptime () +¤Ë +.BR strftime (3) +¤ÈƱ¤¸¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»ú¤ò¥µ¥Ý¡¼¥È¤µ¤»¤è¤¦¤È¤·¤Æ¤¤¤ë¡£ +¿¤¯¤Î¾ì¹ç¡¢Âбþ¤¹¤ë¥Õ¥£¡¼¥ë¥É¤¬²ò¼á¤µ¤ì¤ë¤¬¡¢ +\fItm\fP ¥Õ¥£¡¼¥ë¥É¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +»ÈÍѲÄǽ¤Ê¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»ú¤ò°Ê²¼¤Ë¼¨¤¹¡£ +.TP +.B %F +\fB%Y-%m-%d\fP ¤ÈƱ¤¸¡£ISO 8601 ¤ÎÆüÉÕ·Á¼°¡£ +.TP +.B %g +ISO ½µ¿ô¤ËÂбþ¤·¤¿À¾Îñǯ¡£À¤µª¤Ï´Þ¤Þ¤º (0-99) ¤ÎÈÏ°Ï¡£ +.TP +.B %G +ISO ½µ¿ô¤ËÂбþ¤·¤¿À¾Îñǯ (Î㤨¤Ð 1991)¡£ +.TP +.B %u +10 ¿Ê¿ôɽµ­¤ÎÍËÆü (1-7 ¤Ç·îÍËÆü¤ò 1 ¤È¤¹¤ë)¡£ +.TP +.B %V +ISO 8601:1988 ·Á¼°¤Ç¤ÎǯÄÌ»»¤Î 10 ¿Ê¿ôɽµ­¤Ç¤Î½µ¿ô (1-53)¡£ +1 ·î 1 Æü¤ò´Þ¤à (·îÍËÆü¤«¤é»Ï¤Þ¤ë) ½µ¤Ë 4 Æü°Ê¾å¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¤½¤Î½µ¤òÂè 1 ½µ¤È¤¹¤ë¡£ +3 Æü°Ê²¼¤·¤«´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢1 ·î 1 Æü¤ò´Þ¤à½µ¤òÁ°Ç¯¤ÎºÇ½ª¤Î½µ¤È¤·¤Æ¡¢ +¼¡¤Î½µ¤òÂè 1 ½µ¤È¤¹¤ë¡£ +.TP +.B %z +RFC-822/ISO 8601 ɸ½à¥¿¥¤¥à¥¾¡¼¥ó¤ò»ØÄꤹ¤ë¡£ +.TP +.B %Z +¥¿¥¤¥à¥¾¡¼¥ó̾¡£ +.LP +ƱÍͤˡ¢ +.BR strftime (3) +¤Î GNU ÈǤǤγÈÄ¥¤ËÂбþ¤¹¤ë¤¿¤á¤Ë¡¢ +.B %k +¤Ï +.B %H¡¢ +.B %P +¤Ï +.B %p +¤ÈÅù²Á¤Ë°·¤ï¤ì¤ë¡£¤Þ¤¿¡¢ +.B %l +¤Ï +.B %I +¤ÈÅù²Á¤Ë°·¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¤Ï¤º¤Ç¤¢¤ë¡£ + +¤µ¤é¤Ë°Ê²¼¤âÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B %s +µª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤ÎÄÌ»»¤ÎÉÿô¡£ +±¼É䬥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¸Â¤ê¡¢±¼Éäϥ«¥¦¥ó¥È¤·¤Ê¤¤¡£ +.LP +glibc ¤Ë¤ª¤±¤ë¼ÂÁõ¤Ç¤Ï¡¢2 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É´Ö¤Î¶õÇò¤ÏɬÍפʤ¤¡£ +.SH Îã +°Ê²¼¤ÎÎã¤Ï +.BR strptime () +¤È +.BR strftime (3) +¤Î»ÈÍÑË¡¤ò¼¨¤·¤Æ¤¤¤ë¡£ +.sp +.nf +#define _XOPEN_SOURCE +#include +#include +#include +#include + +int +main(void) +{ + struct tm tm; + char buf[255]; + + memset(&tm, 0, sizeof(struct tm)); + strptime("2001\-11\-12 18:31:01", "%Y\-%m\-%d %H:%M:%S", &tm); + strftime(buf, sizeof(buf), "%d %b %Y %H:%M", &tm); + puts(buf); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR time (2), +.BR getdate (3), +.BR scanf (3), +.BR setlocale (3), +.BR strftime (3), +.BR feature_test_macros (7) diff --git a/release/man3/strsep.3 b/release/man3/strsep.3 new file mode 100644 index 00000000..904801c6 --- /dev/null +++ b/release/man3/strsep.3 @@ -0,0 +1,101 @@ +.\" 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 Sat Jul 24 18:00:10 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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 ¶èÀÚ¤êʸ»ú +.\" +.TH STRSEP 3 2009-01-16 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strsep \- ʸ»úÎ󤫤é¥È¡¼¥¯¥ó¤ò¼è¤ê½Ð¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strsep(char **" stringp ", const char *" delim ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR strsep (): +_BSD_SOURCE +.SH ÀâÌÀ +\fI*stringp\fP ¤¬ NULL ¤Î¾ì¹ç¡¢ +.BR strsep () +´Ø¿ô¤Ï²¿¤â¤»¤º¤Ë NULL ¤òÊÖ¤¹¡£ +¤µ¤â¤Ê¤±¤ì¤Ð¡¢Ê¸»úÎó \fIstringp\fP ¤ò +\fIdelim\fP ¤Ë´Þ¤Þ¤ì¤ëʸ»ú¤Ç¶èÀڤä¿ +¥È¡¼¥¯¥ó¤Î¤¦¤ÁºÇ½é¤Î¤â¤Î¤òÊÖ¤¹¡£ +¥È¡¼¥¯¥ó¤Ï (¶èÀÚ¤êʸ»ú¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ) \(aq\\0\(aq ʸ»ú¤Ç½ªÃ¼¤µ¤ì¡¢ +\fI*stringp\fP ¤ÏÀÚ¤ê½Ð¤µ¤ì¤¿¥È¡¼¥¯¥ó¤Î¼¡¤Î°ÌÃÖ¤ò¼¨¤¹¤è¤¦¤Ë¹¹¿·¤µ¤ì¤ë¡£ +¶èÀÚ¤êʸ»ú¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¡¢\fI*stringp\fP ʸ»úÎóÁ´ÂΤ¬¥È¡¼¥¯¥ó¤È¤·¤Æ +°·¤ï¤ì¡¢\fI*stringp\fP ¤Ï NULL ¤È¤Ê¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR strsep () +´Ø¿ô¤Ï¡¢¥È¡¼¥¯¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤Ä¤Þ¤ê¡¢¸µ¤Î \fI*stringp\fP ¤ÎÃͤòÊÖ¤¹¡£ +.SH ½àµò +4.4BSD. +.SH Ãí°Õ +.BR strsep () +´Ø¿ô¤Ï¡¢ +.BR strtok (3) +´Ø¿ô¤¬¶õ¤Î¥Õ¥£¡¼¥ë¥É¤ò +°·¤¨¤Ê¤¤¤¿¤á¤Ë¡¢¤½¤ÎÂåÂØÉʤȤ·¤ÆƳÆþ¤µ¤ì¤¿¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢ +.BR strtok (3) +´Ø¿ô¤Ï C89/C99 ¤Ë½àµò¤·¤Æ¤ª¤ê¡¢¤è¤ê°Ü¿¢À­¤¬¤¢¤ë¡£ +.SH ¥Ð¥° +¤³¤Î´Ø¿ô¤ò»È¤¦»þ¤ÏÃí°Õ¤¹¤ë¤³¤È¡£ +¤â¤·»È¤¦¤Ê¤é¡¢°Ê²¼¤Î¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.IP * 2 +¤³¤Î´Ø¿ô¤ÏºÇ½é¤Î°ú¿ô¤òÊѹ¹¤¹¤ë¡£ +.IP * +¤³¤Î´Ø¿ô¤ÏÄê¿ôʸ»úÎó¤Ë¤Ï»È¤¨¤Ê¤¤¡£ +.IP * +¶èÀÚ¤êʸ»ú¤¬²¿¤Ç¤¢¤Ã¤¿¤«Ê¬¤«¤é¤Ê¤¯¤Ê¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR index (3), +.BR memchr (3), +.BR rindex (3), +.BR strchr (3), +.BR strpbrk (3), +.BR strspn (3), +.BR strstr (3), +.BR strtok (3) diff --git a/release/man3/strsignal.3 b/release/man3/strsignal.3 new file mode 100644 index 00000000..34ba5902 --- /dev/null +++ b/release/man3/strsignal.3 @@ -0,0 +1,75 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" 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 +.\" +.\" 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 17:59:03 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRSIGNAL 3 2008-08-21 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strsignal \- ¥·¥°¥Ê¥ë¤òÀâÌÀ¤¹¤ëʸ»úÎó¤òÊÖ¤¹ +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "char *strsignal(int " sig ); +.sp +.BI "extern const char * const " sys_siglist []; +.fi +.SH ÀâÌÀ +.BR strsignal () +´Ø¿ô¤Ï¡¢°ú¿ô \fIsig\fP ¤ÇÅϤµ¤ì¤¿¥·¥°¥Ê¥ëÈÖ¹æ¤ò +ÀâÌÀ¤¹¤ëʸ»úÎó¤òÊÖ¤¹¡£ +ʸ»úÎó¤Ï¡¢¼¡¤Î +.BR strsignal () +¤¬¸Æ¤Ð¤ì¤ë¤Þ¤Ç¤Î´Ö¤À¤±»ÈÍѤǤ­¤ë¡£ +.PP +ÇÛÎó \fIsys_siglist\fP ¤Ï¥·¥°¥Ê¥ë¤òÀâÌÀ¤¹¤ëʸ»úÎó¤òÊÝ»ý¤·¤Æ¤ª¤ê¡¢ +ÇÛÎó¤Ø¤Î¥¢¥¯¥»¥¹¤Ë¤Ï¥·¥°¥Ê¥ëÈÖ¹æ¤òź¤¨»ú¤È¤·¤ÆÍѤ¤¤ë»ö¤¬¤Ç¤­¤ë¡£ +½ÐÍè¤ë¤À¤±¤³¤ÎÇÛÎó¤ÎÂå¤ï¤ê¤Ë +.BR strsignal () +´Ø¿ô¤ò +»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR strsignal () +´Ø¿ô¤Ï¡¢¥·¥°¥Ê¥ë¤ÎŬÀÚ¤ÊÀâÌÀ¤òÊÖ¤¹¡£ +¤â¤·¥·¥°¥Ê¥ëÈֹ椬ÉÔÀµ¤Ê¾ì¹ç¤Ï¡¢Ì¤ÃΤΥ·¥°¥Ê¥ë(unknown signal)¤ò¼¨¤¹ +¥á¥Ã¥»¡¼¥¸¤òÊÖ¤¹¡£ +(Linux ¤Ï¤½¤¦¤Ç¤Ï¤Ê¤¤¤¬)ÉÔÀµ¤Ê¥·¥°¥Ê¥ëÈÖ¹æ¤ËÂФ·¤Æ¡¢ NULL ¥Ý¥¤¥ó¥¿¤ò +ÊÖ¤¹¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.SH ½àµò +POSIX.1-2008. +Solaris ¤È BSD ·Ï¤Ë¤â¸ºß¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR psignal (3), +.BR strerror (3), +.BR feature_test_macros (7) diff --git a/release/man3/strspn.3 b/release/man3/strspn.3 new file mode 100644 index 00000000..e013ce60 --- /dev/null +++ b/release/man3/strspn.3 @@ -0,0 +1,72 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Tue Dec 16 10:04:31 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. +.\" +.\" 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 17:57:50 1993 by Rik Faith (faith@cs.unc.edu) +.TH STRSPN 3 1993-04-12 "" "Linux Programmer's Manual" +.SH ̾Á° +strspn, strcspn \- ʸ»úÎ󤫤éʸ»ú¤Î¥»¥Ã¥È¤òõ¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t strspn(const char *" s ", const char *" accept ); +.sp +.BI "size_t strcspn(const char *" s ", const char *" reject ); +.fi +.SH ÀâÌÀ +.BR strspn () +´Ø¿ô¤Ï¡¢\fIaccept\fP ¤Ë´Þ¤Þ¤ì¤ëʸ»ú¤À¤±¤Ç¹½À®¤µ¤ì¤ëʸ»úÎó +¤ò \fIs\fP ¤«¤éõ¤·¡¢¤½¤ÎºÇ½é¤ÎÉôʬ¤ÎŤµ¤ò·×»»¤¹¤ë¡£ +.PP +.BR strcspn () +´Ø¿ô¤Ï¡¢\fIreject\fP ¤Ë´Þ¤Þ¤ì¤Ê¤¤Ê¸»ú¤À¤±¤Ç¹½À®¤µ¤ì¤ëʸ»úÎó +¤ò \fIs\fP ¤«¤éõ¤·¡¢¤½¤ÎºÇ½é¤ÎÉôʬ¤ÎŤµ¤ò·×»»¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR strspn () +´Ø¿ô¤Ï¡¢\fIaccept\fP ¤«¤é¤Îʸ»ú¤À¤±¤Ç¹½À®¤µ¤ì¤ë \fIs\fP ¤Î +ºÇ½é¤ÎÉôʬ¤Îʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +.PP +.BR strcspn () +´Ø¿ô¤Ï¡¢\fIs\fP ¤ÎºÇ½é¤ÎÉôʬ¤Ç¡¢Ê¸»úÎó \fIreject\fP ¤Ë +´Þ¤Þ¤ì¤Ê¤¤Ê¸»ú¤Î¿ô¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.SH ´ØÏ¢¹àÌÜ +.BR index (3), +.BR memchr (3), +.BR rindex (3), +.BR strchr (3), +.BR strpbrk (3), +.BR strsep (3), +.BR strstr (3), +.BR strtok (3), +.BR wcscspn (3), +.BR wcsspn (3) diff --git a/release/man3/strstr.3 b/release/man3/strstr.3 new file mode 100644 index 00000000..0841e6a5 --- /dev/null +++ b/release/man3/strstr.3 @@ -0,0 +1,89 @@ +.\" 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 Sat Jul 24 17:56:43 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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 2005-04-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strstr, strcasestr \- Éôʬʸ»úÎó¤Î°ÌÃÖ¤ò¼¨¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strstr(const char *" haystack ", const char *" needle ); +.sp +.B #define _GNU_SOURCE +.sp +.B #include +.sp +.BI "char *strcasestr(const char *" haystack ", const char *" needle ); +.fi +.SH ÀâÌÀ +.BR strstr () +´Ø¿ô¤Ï¡¢Éôʬʸ»úÎó \fIneedle\fP ¤¬Ê¸»úÎó \fIhaystack\fP Ãæ +¤ÇºÇ½é¤Ë¸½¤ì¤ë°ÌÃÖ¤ò¸«¤Ä¤±¤ë¡£ +ʸ»úÎó¤ò½ªÃ¼¤¹¤ë \(aq\\0\(aq ʸ»ú¤ÏÈæ³Ó¤µ¤ì¤Ê¤¤¡£ + +.BR strcasestr () +´Ø¿ô¤Ï +.BR strstr () +´Ø¿ô¤ÈƱÍͤÀ¤¬¡¢ +ξÊý¤Î°ú¿ô¤ËÂФ·¤ÆÂçʸ»ú¾®Ê¸»ú¤ò̵»ë¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢Éôʬʸ»úÎó¤Î³«»Ï¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤·¡¢ +¤â¤·Éôʬʸ»úÎ󤬸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.SH ½àµò +.BR strstr () +´Ø¿ô¤Ï C89 ¤È C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR strcasestr () +´Ø¿ô¤ÏÈóɸ½à³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +Linux libc ¤Î½é´ü¤Î¥Ð¡¼¥¸¥ç¥ó(4.5.26 ¤Þ¤Ç)¤Ï +.BR strstr () +´Ø¿ô¤Î \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 strpbrk (3), +.BR strsep (3), +.BR strspn (3), +.BR strtok (3), +.BR wcsstr (3), +.BR feature_test_macros (7) diff --git a/release/man3/strtod.3 b/release/man3/strtod.3 new file mode 100644 index 00000000..46fd07a1 --- /dev/null +++ b/release/man3/strtod.3 @@ -0,0 +1,177 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" 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. +.\" +.\" @(#)strtod.3 5.3 (Berkeley) 6/29/91 +.\" +.\" Modified Sun Aug 21 17:16:22 1994 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sat May 04 19:34:31 MET DST 1996 by Michael Haardt +.\" (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 2007-07-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +strtod, strtof, strtold \- ASCII ʸ»úÎó¤òÉâÆ°¾®¿ôÅÀ¼Â¿ô¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "double strtod(const char *" nptr ", char **" endptr ); +.br +.BI "float strtof(const char *" nptr ", char **" endptr ); +.br +.BI "long double strtold(const char *" nptr ", char **" endptr ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR strtof (), +.BR strtold (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.SH ÀâÌÀ +.BR strtod (), +.BR strtof (), +.BR strtold () +´Ø¿ô¤Ï¡¢ +.I nptr +¤¬»Ø¤·¼¨¤¹Ê¸»úÎó¤Î¤Ï¤¸¤á¤ÎÉôʬ¤ò +.IR double , +.IR float , +.I long double +·¿¤ÎÃͤˤ½¤ì¤¾¤ìÊÑ´¹¤¹¤ë¡£ + +ÆþÎϤ¹¤ëʸ»úÎó (¤ÎÀèƬÉôʬ) ¤Ï°Ê²¼¤Î·Á¼°¤¬´üÂÔ¤µ¤ì¤Æ¤¤¤ë¡£ +ÀèƬ¤Ë¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¡¢ +¼¡¤Ë¥×¥é¥¹ (\(aq+\(aq) ¤Þ¤¿¤Ï¥Þ¥¤¥Ê¥¹ (\(aq\-\(aq) ¤Îµ­¹æ¡¢ +¤½¤Î¸å¤Ë (i) 10 ¿Ê¿ô¡¢(ii) 16 ¿Ê¿ô¡¢(iii) ̵¸Â¡¢ +(iv) NAN (·×»»¤Ç¤­¤Ê¤¤¿ô¡¢not-a-number) ¤Î¤¤¤º¤ì¤«¤¬¤¢¤ë +(¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¡¢Éä¹æ¤Ï¾Êά²Äǽ¡£ +¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤Ï +.BR isspace (3) +¤Ç¼±Ê̤µ¤ì¤ë)¡£ +.LP +.I "10 ¿Ê¿ô" +¤Ï 1 ʸ»ú°Ê¾å¤Î 10 ¿Ê¤Î¿ô»ú¤ÎÎ󤫤é¤Ê¤ê¡¢ +´ð¤òɽ¤¹Ê¸»ú (radix charater) +(¾®¿ôÅÀ¡£¥í¥±¡¼¥ë¤Ë°Í¸¤¹¤ë¤¬¡¢Ä̾ï¤Ï \(aq.\(aq) ¤¬´Þ¤Þ¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +¤³¤Î¸å¤Ë 10 ¿Ê¤Î»Ø¿ôÉô¤¬Â³¤¤¤Æ¤âÎɤ¤¡£ +10 ¿Ê¤Î»Ø¿ôÉô¤Ï \(aqE\(aq ¤Þ¤¿¤Ï \(aqe\(aq ¤È¡¢¤½¤Î¸å¤ËÃÖ¤«¤ì¤ëÀµÉéµ­¹æ (¾Êά²Ä)¡¢ +¤ª¤è¤Ó¤½¤Î¸å¤Ë³¤¯ 1 ʸ»ú°Ê¾å¤Î 10 ¿Ê¤Î¿ô»ú¤ÎÎ󤫤é¤Ê¤ê¡¢ +10 ¤Î²¿¾è¤Ç¤¢¤ë¤«¤òɽ¤¹¡£ +.LP +.I "16 ¿Ê¿ô" +¤Ï¡¢"0x" ¤Þ¤¿¤Ï "0X" ¤È¤½¤Î¸å¤Ë³¤¯ 1 ʸ»ú°Ê¾å¤Î 16 ¿Ê¤Î¿ô»ú¤ÎÎ󤫤é¤Ê¤ê¡¢ +´ð¤òɽ¤¹Ê¸»ú¤¬´Þ¤Þ¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +¤³¤Î¸å¤Ë 2 ¿Ê¤Î»Ø¿ôÉô¤¬Â³¤¤¤Æ¤âÎɤ¤¡£ +2 ¿Ê¤Î»Ø¿ôÉô¤Ï \(aqP\(aq ¤Þ¤¿¤Ï \(aqp\(aq ¤È¡¢¤½¤Î¸å¤ËÃÖ¤«¤ì¤ëÀµÉéµ­¹æ (¾Êά²Ä)¡¢ +¤ª¤è¤Ó¤½¤Î¸å¤Ë³¤¯ 1 ʸ»ú°Ê¾å¤Î 10 ¿Ê¤Î¿ô»ú¤ÎÎ󤫤鹽À®¤µ¤ì¡¢ +2 ¤Î²¿¾è¤Ç¤¢¤ë¤«¤òɽ¤¹¡£ +´ð¤òɽ¤¹Ê¸»ú¤È 2 ¿Ê¤Î»Ø¿ôÉô¤Ï¡¢¤É¤Á¤é¤«°ìÊý¤·¤«Â¸ºß¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.LP +.I ̵¸Â +¤Ï "INF" ¤Þ¤¿¤Ï "INFINITY" ¤Çɽ¤µ¤ì¡¢Âçʸ»ú¾®Ê¸»ú¤Ï¶èÊ̤µ¤ì¤Ê¤¤¡£ +.LP +.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. +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ÊÑ´¹¤µ¤ì¤¿Ãͤ¬¤¢¤ì¤Ð¡¢¤½¤ì¤òÊÖ¤¹¡£ + +.I endptr +¤¬ NULL ¤Ç¤Ê¤¤¤È¤­¤Ï¡¢ÊÑ´¹¤Ë»È¤ï¤ì¤¿ºÇ½ªÊ¸»ú¤Î¼¡¤Îʸ»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤¬ +.I endptr +¤Ç»²¾È¤µ¤ì¤ë¾ì½ê¤ØÊݸ¤µ¤ì¤ë¡£ + +ÊÑ´¹¤¬¹Ô¤ï¤ì¤Ê¤«¤Ã¤¿¤È¤­¤Ë¤Ï 0 ¤¬Ê֤롣¤½¤·¤Æ +.I endptr +¤¬»²¾È¤·¤Æ¤¤¤ë¾ì½ê¤Ë +.I nptr +¤ÎÃÍ (ÊÑ´¹ÂоݤǤ¢¤ëʸ»úÎó¤Î³«»Ï¥¢¥É¥ì¥¹) ¤¬Êݸ¤µ¤ì¤ë¡£ + +Àµ¤·¤¤·Á¼°¤Î¿ôÃÍʸ»úÎó¤Ç¤¢¤ë¤¬¡¢ÊÑ´¹·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤·¤¿¾ì¹ç +¤Ë¤Ï¡¢¥×¥é¥¹¤Þ¤¿¤Ï¥Þ¥¤¥Ê¥¹¤Î +.B HUGE_VAL +.RB ( HUGE_VALF , +.BR HUGE_VALL ) +¤¬ÊÖ¤ê (ÃͤÎÉä¹æ¤Ë¤è¤ë)¡¢ +.B ERANGE +¤¬ +.I errno +¤ËÂåÆþ¤µ¤ì¤ë¡£ÊÑ´¹·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤òµ¯¤³¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤¬Ê֤ꡢ +.B ERANGE +¤¬ +.I errno +¤ËÂåÆþ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B ERANGE +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Þ¤¿¤Ï¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¬µ¯¤³¤Ã¤¿¡£ +.SH ½àµò +C89 ¤Ç¤Ï +.BR strtod () +¤¬¡¢C99 ¤Ç¤Ï»Ä¤ê¤Î 2 ¤Ä¤Î´Ø¿ô¤¬µ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +À®¸ù¡¢¼ºÇԤɤÁ¤é¤Î¾ì¹ç¤Ç¤â 0 ¤òÊÖ¤¹²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¡¢ +¥×¥í¥°¥é¥à¤Ï¸Æ¤Ó½Ð¤¹Á°¤Ë +.I errno +¤ò 0 ¤ËÀßÄꤷ¡¢¸Æ¤Ó½Ð¤·¸å¤Ë +.I errno +¤¬ 0 °Ê³°¤ÎÃͤ«¤É¤¦¤«¤ò³Îǧ¤·¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤É¤¦¤«¤òȽÃǤ¹¤ë +ɬÍפ¬¤¢¤ë¡£ +.SH Îã +.BR strtol (3) +¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÎã¤ò»²¾È¡£ +¤³¤Î¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤¿´Ø¿ô¤Î»ÈÍÑÊýË¡¤âƱÍͤǤ¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR atof (3), +.BR atoi (3), +.BR atol (3), +.BR strtol (3), +.BR strtoul (3) diff --git a/release/man3/strtoimax.3 b/release/man3/strtoimax.3 new file mode 100644 index 00000000..8930f37c --- /dev/null +++ b/release/man3/strtoimax.3 @@ -0,0 +1,70 @@ +.\" 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 Sep 5 21:02:09 JST 2004 +.\" by Yuichi SATO +.\" +.TH STRTOIMAX 3 2003-11-28 "" "Linux Programmer's Manual" +.SH ̾Á° +strtoimax, strtoumax \- ʸ»úÎó¤òÀ°¿ô¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "intmax_t strtoimax(const char *" nptr ", char **" endptr ", int " base ); +.br +.BI "uintmax_t strtoumax(const char *" nptr ", char **" endptr ", int " base ); +.fi +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¤Á¤ç¤¦¤É +.BR strtol (3) +¤È +.BR strtoul (3) +¤Ë»÷¤Æ¤¤¤ë¤¬¡¢¤½¤ì¤¾¤ì +.I intmax_t +¤È +.I uintmax_t +·¿¤ÎÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ÊÑ´¹¤µ¤ì¤¿Ãͤ¬ÊÖ¤µ¤ì¤ë¡£ +ÊÑ´¹¤¹¤ë¤â¤Î¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Þ¤¿¤Ï¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Î¾ì¹ç¡¢ +.B INTMAX_MAX +¤Þ¤¿¤Ï +.B INTMAX_MIN +¤Þ¤¿¤Ï +.B UINTMAX_MAX +¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬ +.B ERANGE +¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR imaxabs (3), +.BR imaxdiv (3), +.BR strtol (3), +.BR strtoul (3), +.BR wcstoimax (3) diff --git a/release/man3/strtok.3 b/release/man3/strtok.3 new file mode 100644 index 00000000..d7d38a13 --- /dev/null +++ b/release/man3/strtok.3 @@ -0,0 +1,208 @@ +.\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl) +.\" and Copyright (C) 2005 Michael Kerrisk (mtk.manpages@gmail.com) +.\" +.\" 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. +.\" +.\" Rewritten old page, 960210, aeb@cwi.nl +.\" Updated, added strtok_r. 2000-02-13 Nicolas 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 2008-10-29 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strtok, strtok_r \- ʸ»úÎ󤫤é¥È¡¼¥¯¥ó¤ò¼è¤ê½Ð¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *strtok(char *" str ", const char *" delim ); +.sp +.BI "char *strtok_r(char *" str ", const char *" delim ", char **" saveptr ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR strtok_r (): +_SVID_SOURCE || _BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 1 || +_XOPEN_SOURCE || _POSIX_SOURCE +.ad b +.SH ÀâÌÀ +.BR strtok () +´Ø¿ô¤Ïʸ»úÎó¤ò²òÀϤ·¤Æ¥È¡¼¥¯¥ó¤Ëʬ³ä¤¹¤ë¡£ +.BR strtok () +¤òºÇ½é¤Ë¸Æ¤Ó½Ð¤¹ºÝ¤Ë¤Ï¡¢²òÀÏÂоݤÎʸ»úÎó¤ò \fIstr\fP ¤Ë +»ØÄꤹ¤ë¡£Æ±¤¸Ê¸»úÎó¤Î²òÀϤò¹Ô¤¦¤½¤Î¸å¤Î¸Æ¤Ó½Ð¤·¤Ç¤Ï¡¢ +\fIstr\fP ¤Ë¤Ï NULL ¤ò»ØÄꤹ¤ë¡£ + +\fIdelim\fP °ú¤­¿ô¤Ë¤Ï¡¢²òÀϤ¹¤ëʸ»úÎó¤ò¥È¡¼¥¯¥ó¤Ë¶èÀÚ¤ëʸ»ú½¸¹ç¤ò +»ØÄꤹ¤ë¡£Æ±¤¸Ê¸»úÎó¤ò²òÀϤ¹¤ë°ìÏ¢¤Î¸Æ¤Ó½Ð¤·¤Ë¤ª¤¤¤Æ¡¢ +\fIdelim\fP ¤Ë°ã¤¦Ê¸»úÎó¤ò»ØÄꤷ¤Æ¤â¤è¤¤¡£ + +.BR strtok () +¤Î¤½¤ì¤¾¤ì¤Î¸Æ¤Ó½Ð¤·¤Ç¤Ï¡¢¼¡¤Î¥È¡¼¥¯¥ó¤ò +³ÊǼ¤·¤¿ NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤Îʸ»úÎó¤Ë¤Ï¶èÀÚ¤êʸ»ú¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +¤³¤ì°Ê¾å¥È¡¼¥¯¥ó¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢NULL ¤¬ÊÖ¤µ¤ì¤ë¡£ + +²òÀÏÂоݤÎʸ»úÎó¤Ë2¤Ä°Ê¾å¤Î¶èÀÚ¤êʸ»ú¤¬Ï¢Â³¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +°ì¤Ä¤Î¶èÀÚ¤êʸ»ú¤È¤ß¤Ê¤µ¤ì¤ë¡£ +ʸ»úÎó¤ÎÀèƬ¤äËöÈø¤Ë¤¢¤ë¶èÀÚ¤êʸ»ú¤Ï̵»ë¤µ¤ì¤ë¡£¸À¤¤´¹¤¨¤ë¤È¡¢ +.BR strtok () +¤¬ÊÖ¤¹¥È¡¼¥¯¥ó¤Ï¾ï¤Ë¶õ¤Ç¤Ê¤¤Ê¸»úÎó¤È¤Ê¤ë¡£ + +.BR strtok_r () +´Ø¿ô¤Ï +.BR strtok () +¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤ¢¤ë¡£ +\fIsaveptr\fP °ú¤­¿ô¤Ï \fIchar *\fP ÊÑ¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ê¡¢ +Ʊ¤¸Ê¸»úÎó¤Î²òÀϤò¹Ô¤¦ +.BR strtok_r () +¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç½èÍý¾õ¶·¤òÊݸ¤¹¤ë¤¿¤á¤Ë +.BR strtok_r () +ÆâÉô¤Ç»ÈÍѤµ¤ì¤ë¡£ + +.BR strtok_r () +¤òºÇ½é¤Ë¸Æ¤Ó½Ð¤¹ºÝ¤Ë¤Ï¡¢ +.I str +¤Ï²òÀÏÂоݤÎʸ»úÎó¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +.I saveptr +¤ÎÃͤÏ̵»ë¤µ¤ì¤ë¡£¤½¤ì°Ê¹ß¤Î¸Æ¤Ó½Ð¤·¤Ç¤Ï¡¢ +.I str +¤Ï NULL ¤È¤·¡¢ +.I saveptr +¤ÏÁ°²ó¤Î¸Æ¤Ó½Ð¤·°Ê¹ßÊѹ¹¤·¤Ê¤¤¤è¤¦¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +.BR strtok_r () +¤Î¸Æ¤Ó½Ð¤·»þ¤Ë°Û¤Ê¤ë \fIsaveptr\fP °ú¤­¿ô¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢ +°Û¤Ê¤ëʸ»úÎó¤Î²òÀϤòƱ»þ¤Ë¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR strtok () +¤È +.BR strtok_r () +¤Ï¼¡¤Î¥È¡¼¥¯¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¤«¡¢ +¥È¡¼¥¯¥ó¤¬¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£ +.SH ½àµò +.TP +.BR strtok () +SVr4, POSIX.1-2001, 4.3BSD, C89, C99. +.TP +.BR strtok_r () +POSIX.1-2001. +.SH ¥Ð¥° +¤³¤ì¤é¤Î´Ø¿ô¤ò»È¤¦¤Î¤Ï¿µ½Å¤Ë¶ãÌ£¤¹¤ë¤³¤È¡£ +»ÈÍѤ¹¤ë¾ì¹ç¤Ï¡¢°Ê²¼¤ÎÅÀ¤ËÃí°Õ¤¬É¬ÍפǤ¢¤ë¡£ +.IP * 2 +¤³¤ì¤é¤Î´Ø¿ô¤Ï¤½¤ÎºÇ½é¤Î°ú¿ô¤òÊѹ¹¤¹¤ë¡£ +.IP * +¤³¤ì¤é¤Î´Ø¿ô¤Ï const ¤Êʸ»úÎó¤Ç¤Ï»È¤¨¤Ê¤¤¡£ +.IP * +¶èÀÚ¤êʸ»ú¼«ÂΤϼº¤ï¤ì¤Æ¤·¤Þ¤¦¡£ +.IP * +.BR strtok () +´Ø¿ô¤Ïʸ»úÎó¤Î²òÀϤËÀÅŪ¥Ð¥Ã¥Õ¥¡¤òÍѤ¤¤ë¤Î¤Ç¡¢¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ê¤¤¡£ +¤³¤ì¤¬ÌäÂê¤Ë¤Ê¤ë¾ì¹ç¤Ï +.BR strtok_r () +¤òÍѤ¤¤ë¤³¤È¡£ +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢ +.BR strtok_r () +¤òÍøÍѤ¹¤ë¥ë¡¼¥×¤òÆþ¤ì»Ò¤Ë¤·¤Æ»ÈÍѤ·¡¢ +ʸ»úÎó¤ò2³¬ÁؤΥȡ¼¥¯¥ó¤Ëʬ³ä¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +1ÈÖÌܤΥ³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ë¤Ï¡¢²òÀÏÂоݤÎʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +2ÈÖÌܤΰú¤­¿ô¤Ë¤Ï¡¢Ê¸»úÎó¤ò¡ÖÂ礭¤Ê¡×¥È¡¼¥¯¥ó¤Ëʬ³ä¤¹¤ë¤¿¤á¤Ë +»ÈÍѤ¹¤ë¶èÀÚ¤êʸ»ú¤ò»ØÄꤹ¤ë¡£ +3ÈÖÌܤΰú¤­¿ô¤Ë¤Ï¡¢¡ÖÂ礭¤Ê¡×¥È¡¼¥¯¥ó¤òºÙ¤«¤¯Ê¬³ä¤¹¤ë¤¿¤á¤Ë +»ÈÍѤ¹¤ë¶èÀÚ¤êʸ»ú¤ò»ØÄꤹ¤ë¡£ +.PP +.PP +¤³¤Î¥×¥í¥°¥é¥à¤Î½ÐÎÏÎã¤ò°Ê²¼¤Ë¼¨¤¹¡£ +.PP +.in +4n +.nf +.RB "$" " ./a.out \(aqa/bbb///cc;xxx:yyy:\(aq \(aq:;\(aq \(aq/\(aq" +1: a/bbb///cc + \-\-> a + \-\-> bbb + \-\-> cc +2: xxx + \-\-> xxx +3: yyy + \-\-> yyy +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + char *str1, *str2, *token, *subtoken; + char *saveptr1, *saveptr2; + int j; + + if (argc != 4) { + fprintf(stderr, "Usage: %s string delim subdelim\\n", + argv[0]); + exit(EXIT_FAILURE); + } + + for (j = 1, str1 = argv[1]; ; j++, str1 = NULL) { + token = strtok_r(str1, argv[2], &saveptr1); + if (token == NULL) + break; + printf("%d: %s\\n", j, token); + + for (str2 = token; ; str2 = NULL) { + subtoken = strtok_r(str2, argv[3], &saveptr2); + if (subtoken == NULL) + break; + printf("\t \-\-> %s\\n", subtoken); + } + } + + exit(EXIT_SUCCESS); +} /* main */ +.fi +.SH ´ØÏ¢¹àÌÜ +.BR index (3), +.BR memchr (3), +.BR rindex (3), +.BR strchr (3), +.BR strpbrk (3), +.BR strsep (3), +.BR strspn (3), +.BR strstr (3), +.BR wcstok (3) diff --git a/release/man3/strtol.3 b/release/man3/strtol.3 new file mode 100644 index 00000000..362df22d --- /dev/null +++ b/release/man3/strtol.3 @@ -0,0 +1,269 @@ +.\" 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 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 +.\" +.\" WORD: base ´ð¿ô +.\" +.TH STRTOL 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strtol, strtoll, strtoq \- ʸ»úÎó¤ò long int ¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long int strtol(const char *" nptr ", char **" endptr ", int " base ); +.sp +.BI "long long int strtoll(const char *" nptr ", char **" endptr \ +", int " base ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR strtoll (): +XOPEN_SOURCE >= 600 || _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR strtol () +´Ø¿ô¤Ï¡¢ \fInptr\fP ¤Îʸ»úÎó¤ÎºÇ½é¤ÎÉôʬ¤ò¡¢ +\fIbase\fP ¤ò´ð¿ô¤È¤·¤Æ long int ¤ËÊÑ´¹¤¹¤ë¡£ +¤³¤Î \fIbase\fP ¤Ï 2 ¤«¤é 36 ¤Þ¤Ç¤ÎÃÍ +¤¢¤ë¤¤¤ÏÆÃÊ̤ʰÕÌ£¤ò»ý¤ÄÃÍ 0 ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +ʸ»úÎó¤ÎÀèƬ¤Ë¤Ï¡¢Ç¤°Õ¤Î¿ô¤Î¶õÇò¤¬¤¢¤Ã¤Æ¤â¤è¤¯ (¶õÇò¤Ï +.BR isspace (3) +¤ÇȽÄꤵ¤ì¤ë)¡¢¤Þ¤¿¿ô»ú¤ÎľÁ°¤Ë¤Ï \(aq+\(aq ¤« \(aq\-\(aq ¤Î +Éä¹æ¤¬¤¢¤Ã¤Æ¤â¤è¤¤¡£ +\fIbase\fP ¤¬ 0 ¤Þ¤¿¤Ï 16 ¤Î¾ì¹ç¤Ë¤Ï¡¢Ê¸»úÎó¤ÎÀèƬ¤Ë "0x" ¤òÃÖ¤¯¤³¤È¤¬ +¤Ç¤­¡¢¤½¤Î¾ì¹ç¤Ë¤Ïʸ»úÎó¤Ï 16¿Ê¿ô¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +¤³¤ì°Ê³°¤Îʸ»úÎó¤Ç \fIbase\fP ¤¬ 0 ¤Î¾ì¹ç¤Ï¡¢ +ʸ»úÎó¤¬ \(aq0\(aq ¤Ç»Ï¤Þ¤ë¤È¤­¤Ï 8¿Ê¿ô¤È¤·¤Æ¡¢ +¤½¤ì°Ê³°¤Î¤È¤­¤Ï 10¿Ê¿ô¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +.PP +¿ô»ú¤òɽ¤¹Ê¸»úÎó¤Ï +.I long int +¤ËÊÑ´¹¤µ¤ì¤ë¤¬¡¢´ð¿ô¤ËÂФ·¤Æ +Í­¸ú¤Ç¤Ê¤¤¿ô»ú¤¬¸½¤ì¤¿»þÅÀ¤ÇÊÑ´¹¤Ï½ªÎ»¤¹¤ë¡£(11¿Ê¿ô°Ê¾å¤Ç¤Ï \(aqA\(aq ¤Ï +Âçʸ»ú¡¦¾®Ê¸»ú¤Ë´Ø¤ï¤é¤º 10 ¤òɽ¤·¡¢ \(aqB\(aq ¤Ï 11 ¤òɽ¸½¤·¡¢ +°Ê²¼Æ±Íͤˡ¢ \(aqZ\(aq ¤Ï 35 ¤òɽ¤¹¡£) +.PP +\fIendptr\fP ¤¬¥Ì¥ëÃÍ (NULL) ¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢ºÇ½é¤Ë¸½¤ì¤¿ÉÔÀµ¤Êʸ»ú¤¬ +.BR strtol () +¤Ë¤è¤Ã¤Æ \fI*endptr\fP ¤ËÊݸ¤µ¤ì¤Æ¤¤¤ë¡£ +ʸ»úÎó¤ËÍ­¸ú¤Ê¿ô»ú¤¬¤Ò¤È¤Ä¤â¤Ê¤±¤ì¤Ð¡¢ +.BR strtol () +¤Ï \fInptr\fP +¤Î¸µ¤ÎÃͤò \fI*endptr\fP ¤ËÂåÆþ¤¹¤ë (¤½¤·¤Æ 0 ¤òÊÖ¤¹)¡£ +Æäˡ¢\fI*nptr\fP ¤¬ \(aq\\0\(aq °Ê³°¤Ç¡¢ÊÖ¤µ¤ì¤¿ \fI**endptr\fP ¤¬ +\(aq\\0\(aq ¤Ê¤é¤Ð¡¢Ê¸»úÎóÁ´ÂΤ¬Í­¸ú¤À¤Ã¤¿¤³¤È¤Ë¤Ê¤ë¡£ +.PP +.BR strtoll () +´Ø¿ô¤Ï +.BR strtol () +¤ÈƱÍͤÀ¤¬¡¢long long int ·¿¤ÎÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +¥¢¥ó¥À¡¼¥Õ¥í¡¼¤â¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤âµ¯¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.BR strtol () +´Ø¿ô¤Ï +ÊÑ´¹¤µ¤ì¤¿ÃͤòÊÖ¤¹¡£¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤·¤¿¾ì¹ç¤Ë¤Ï +.B LONG_MAX +¤¬Ê֤ꡢ +¥¢¥ó¥À¡¼¥Õ¥í¡¼¤·¤¿¾ì¹ç¤Ë¤Ï +.B LONG_MIN +¤¬Ê֤롣¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¡¢ +¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Î¤¤¤º¤ì¤Î¾ì¹ç¤Ë¤â +Âç°èÊÑ¿ô \fIerrno\fP ¤Ë¤Ï +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +.BR strtoll () +¤âƱÍͤǤ¢¤ë¤¬¡¢ +.B LONG_MIN +¤È +.B LONG_MAX +¤ÎÂå¤ï¤ê¤Ë +.B LLONG_MIN +¤È +.B LLONG_MAX +¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +(C99 ¤Ë¤Ï¤Ê¤¤) +.I base +¤¬Âбþ¤·¤Æ¤¤¤Ê¤¤ÃͤǤ¢¤ë¡£ +.TP +.B ERANGE +·ë²Ì¤ÎÃͤ¬Èϰϳ°¤Ç¤¢¤ë¡£ +.LP +¼ÂÁõ¤Ë¤è¤Ã¤Æ¤Ï¡¢ÊÑ´¹¤¬¹Ô¤ï¤ì¤Ê¤«¤Ã¤¿¾ì¹ç (¿ô»ú¤¬¤Ê¤¯¡¢0 ¤òÊÖ¤·¤¿¾ì¹ç)¡¢ +\fIerrno\fP ¤Ë \fBEINVAL\fP ¤¬ÀßÄꤵ¤ì¤ë¾ì¹ç¤¬¤¢¤ë¡£ +.SH ½àµò +.BR strtol () +¤Ï SVr4, 4.3BSD, C89, C99 ¤È POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR strtoll () +¤Ï C99 ¤È POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.B strtol () +¤«¤é¤ÏÀ®¸ù¡¢¼ºÇԤɤÁ¤é¤Î¾ì¹ç¤Ç¤â +0, +.BR LONG_MAX , +.B LONG_MIN +.RB ( strtoll () +¤Ç¤Ï +.BR LLONG_MAX , +.BR LLONG_MIN ) +¤¬ÊÖ¤ë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¡¢ +¥×¥í¥°¥é¥à¤Ï´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë +.I errno +¤ò 0 ¤ËÀßÄꤷ¡¢¸Æ¤Ó½Ð¤·¸å¤Ë +.I errno +¤¬ 0 °Ê³°¤ÎÃͤ«¤É¤¦¤«¤ò³Îǧ¤·¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤É¤¦¤«¤òȽÃǤ¹¤ë +ɬÍפ¬¤¢¤ë¡£ + +"C" °Ê³°¤Î¥í¥±¡¼¥ë¤Î¾ì¹ç¡¢¤½¤Î¾¤Îʸ»úÎó¤â¼õ¤±ÉÕ¤±¤é¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +(Î㤨¤Ð¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î 1000 Ëè¤Î¶èÀÚ¤êʸ»ú¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£) +.LP +BSD ¤Ë¤Ï¡¢ +.sp +.in +4n +.nf +.BI "quad_t strtoq(const char *" nptr ", char **" endptr ", int " base ); +.sp +.in +.fi +¤È¤¤¤¦´°Á´¤ËƱÍͤÎÄêµÁ¤ò»ý¤Ä´Ø¿ô¤¬¤¢¤ë¡£ +»ÈÍÑÃæ¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¥ï¡¼¥ÉĹ¼¡Âè¤Ç¤¢¤ë¤¬¡¢¤³¤Î´Ø¿ô¤Ï +.BR strtoll () +¤« +.BR strtol () +¤ÈÅù²Á¤È¤Ê¤ë¤³¤È¤â¤¢¤ë¡£ +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï +.BR strtol () +¤Î»ÈÍÑÎã¤Ç¤¢¤ë¡£ +ºÇ½é¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ë¤Ï +.BR strtol () +¤¬¿ô»ú¤È¤·¤Æ²ò¼á¤¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +(¾Êά²Äǽ¤Ê) ÆóÈÖÌܤΰú¤­¿ô¤Ë¤Ï +ÊÑ´¹¤Ë»ÈÍѤµ¤ì¤ë´ð¿ô¤ò»ØÄꤹ¤ë +(¤³¤Î°ú¤­¿ô¤Ï +.BR atoi (3) +¤ò»È¤Ã¤Æ¿ôÃͤËÊÑ´¹¤µ¤ì¤ë¡£ +.BR atoi (3) +¤Ï +.BR strtol () +¤è¤ê¤â´Êñ¤Ê¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò»ý¤Ä´Ø¿ô¤Ç¡¢ +¤½¤ÎÃæ¤Ç¤Ï¥¨¥é¡¼¥Á¥§¥Ã¥¯¤Ï¹Ô¤ï¤ì¤Ê¤¤)¡£ +¤³¤Î¥×¥í¥°¥é¥à¤Î¼Â¹ÔÎã¤ò¤¤¤¯¤Ä¤«°Ê²¼¤Ë¼¨¤¹: +.in +4n +.nf + +.RB "$" " ./a.out 123" +strtol() returned 123 +.RB "$" " ./a.out \(aq 123\(aq" +strtol() returned 123 +.RB "$" " ./a.out 123abc" +strtol() returned 123 +Further characters after number: abc +.RB "$" " ./a.out 123abc 55" +strtol: Invalid argument +.RB "$" " ./a.out \(aq\(aq" +No digits were found +.RB "$" " ./a.out 4000000000" +strtol: Numerical result out of range +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int base; + char *endptr, *str; + long val; + + if (argc < 2) { + fprintf(stderr, "Usage: %s str [base]\\n", argv[0]); + exit(EXIT_FAILURE); + } + + str = argv[1]; + base = (argc > 2) ? atoi(argv[2]) : 10; + + errno = 0; /* To distinguish success/failure after call */ + val = strtol(str, &endptr, base); + + /* Check for various possible errors */ + + if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN)) + || (errno != 0 && val == 0)) { + perror("strtol"); + exit(EXIT_FAILURE); + } + + if (endptr == str) { + fprintf(stderr, "No digits were found\\n"); + exit(EXIT_FAILURE); + } + + /* If we got here, strtol() successfully parsed a number */ + + printf("strtol() returned %ld\\n", val); + + if (*endptr != \(aq\\0\(aq) /* Not necessarily an error... */ + printf("Further characters after number: %s\\n", endptr); + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR atof (3), +.BR atoi (3), +.BR atol (3), +.BR strtod (3), +.BR strtoul (3) diff --git a/release/man3/strtoul.3 b/release/man3/strtoul.3 new file mode 100644 index 00000000..c71e0406 --- /dev/null +++ b/release/man3/strtoul.3 @@ -0,0 +1,192 @@ +.\" 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 Sun Jul 25 10:54:03 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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 ´ð¿ô +.\" +.TH STRTOUL 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strtoul, strtoull, strtouq \- ʸ»úÎó¤ò unsigned long int ¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "unsigned long int strtoul(const char *" nptr ", char **" endptr \ +", int " base ); +.sp +.BI "unsigned long long int strtoull(const char *" nptr ", char **" endptr , +.BI " int " base ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR strtoull (): +XOPEN_SOURCE >= 600 || _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR strtoul () +´Ø¿ô¤Ï¡¢ \fInptr\fP ¤Îʸ»úÎó¤ÎºÇ½é¤ÎÉôʬ¤ò¡¢ +\fIbase\fP ¤ò´ð¿ô¤È¤·¤Æ +.I "unsigned long int" +¤ËÊÑ´¹¤¹¤ë¡£ +¤³¤Î \fIbase\fP ¤Ï 2 ¤«¤é 36 ¤Þ¤Ç¤ÎÃÍ +¤¢¤ë¤¤¤ÏÆÃÊ̤ʰÕÌ£¤ò»ý¤ÄÃÍ 0 ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +ʸ»úÎó¤ÎÀèƬ¤Ë¤Ï¡¢Ç¤°Õ¤Î¿ô¤Î¶õÇò¤¬¤¢¤Ã¤Æ¤â¤è¤¯ (¶õÇò¤Ï +.BR ( isspace (3) +¤ÇȽÄꤵ¤ì¤ë) ¡¢¤Þ¤¿¿ô»ú¤ÎľÁ°¤Ë¤Ï \(aq+\(aq ¤« \(aq\-\(aq ¤Î +Éä¹æ¤¬¤¢¤Ã¤Æ¤â¤è¤¤¡£ +\fIbase\fP ¤¬ 0 ¤Þ¤¿¤Ï 16 ¤Î¾ì¹ç¤Ë¤Ï¡¢ ʸ»úÎó¤ÎÀèƬ¤Ë "0x" ¤òÃÖ¤¯¤³¤È¤¬ +¤Ç¤­¡¢¤½¤Î¾ì¹ç¤Ë¤Ïʸ»úÎó¤Ï 16¿Ê¿ô¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +¤³¤ì°Ê³°¤Îʸ»úÎó¤Ç \fIbase\fP ¤¬ 0 ¤Î¾ì¹ç¤Ï¡¢ +ʸ»úÎó¤¬ \(aq0\(aq ¤Ç»Ï¤Þ¤ë¤È¤­¤Ï 8¿Ê¿ô¤È¤·¤Æ¡¢ +¤½¤ì°Ê³°¤Î¤È¤­¤Ï 10¿Ê¿ô¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +.PP +ʸ»úÎó¤Î»Ä¤ê¤ÎÉôʬ¤Ï +.I "unsigned long int" +¤ËÊÑ´¹¤µ¤ì¤ë¤¬¡¢´ð¿ô¤ËÂФ·¤Æ +Í­¸ú¤Ç¤Ê¤¤¿ô»ú¤¬¸½¤ì¤¿»þÅÀ¤ÇÊÑ´¹¤Ï½ªÎ»¤¹¤ë¡£(11¿Ê¿ô°Ê¾å¤Ç¤Ï \(aqA\(aq ¤Ï +Âçʸ»ú¡¦¾®Ê¸»ú¤Ë´Ø¤ï¤é¤º 10 ¤òɽ¤·¡¢ \(aqB\(aq ¤Ï 11 ¤òɽ¸½¤·, +°Ê²¼Æ±Íͤˡ¢ \(aqZ\(aq ¤Ï 35 ¤òɽ¤¹¡£) +.PP +\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 ¤Ê¤é¤Ð¡¢Ê¸»úÎóÁ´ÂΤ¬Í­¸ú¤À¤Ã¤¿¤³¤È¤Ë¤Ê¤ë¡£ +.PP +.BR strtoull () +´Ø¿ô¤Ï +.BR strtoul () +´Ø¿ô¤ÈƱÍͤÀ¤¬¡¢ +.I "unsigned long long int" +·¿¤ÎÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +.BR strtoul () +´Ø¿ô¤ÏÊÑ´¹·ë²Ì¤òÊÖ¤¹¡£Ê¸»úÎ󤬥ޥ¤¥Ê¥¹Éä¹æ¤«¤é»Ï¤Þ¤Ã¤Æ¤¤¤¿¾ì +¹ç¤Ï¡¢(Éä¹æȿžÁ°¤ÎÃͤ¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤·¤Æ¤¤¤Ê¤±¤ì¤Ð) ÊÑ´¹·ë²Ì¤òÉä¹æȿž¤·¤¿ +Ãͤò unsigned ·¿¤ÇÊÖ¤¹¡£ÊÑ´¹¤Ç¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï +.B ULONG_MAX +¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B ERANGE +¤òÀßÄꤹ¤ë¡£ +.RB ( ULONG_MAX +¤ò +.B ULLONG_MAX +¤ÈÆɤßÂؤ¨¤ì¤Ð) +.BR strtoull () +¤Ï +.BR strtoul () +¤ÈÁ´¤¯Æ±¤¸¤Ç¤¢¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +(C99 ¤Ë¤Ï¤Ê¤¤) +Í¿¤¨¤é¤ì¤¿ +.I base +¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ÃͤǤ¢¤ë¡£ +.TP +.B ERANGE +ʸ»úÎ󤬿ôÃͤÎɽ¸½Èϰϳ°¤Ç¤¢¤ë¡£ +.LP +¼ÂÁõ¤Ë¤è¤Ã¤Æ¤Ï¡¢Á´¤¯ÊÑ´¹¤¬¹Ô¤ï¤ì¤Ê¤«¤Ã¤¿¾ì¹ç(Á´¤¯¿ô»ú¤¬¸½¤ì¤º¡¢ +0 ¤¬ÊÖ¤µ¤ì¤ë)¡¢\fIerrno\fP ¤Ë \fBEINVAL\fP ¤¬¥»¥Ã¥È¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ½àµò +.BR strtoul () +¤Ï SVr4, C89, C99 ¤È POSIX-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.BR strtoull () +¤Ï C99 ¤È POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.B strtoul () +¤«¤é¤ÏÀ®¸ù¡¢¼ºÇԤɤÁ¤é¤Î¾ì¹ç¤Ç¤â 0 ¤ä +.B LONG_MAX +.RB ( strtoull () +¤Ç¤Ï +.BR LLONG_MAX ) +¤¬ÊÖ¤ë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¡¢ +¥×¥í¥°¥é¥à¤Ï´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë +.I errno +¤ò 0 ¤ËÀßÄꤷ¡¢¸Æ¤Ó½Ð¤·¸å¤Ë +.I errno +¤¬ 0 °Ê³°¤ÎÃͤ«¤É¤¦¤«¤ò³Îǧ¤·¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤É¤¦¤«¤òȽÃǤ¹¤ë +ɬÍפ¬¤¢¤ë¡£ + +"C" °Ê³°¤Î¥í¥±¡¼¥ë¤Î¾ì¹ç¡¢¤½¤Î¾¤Îʸ»úÎó¤â¼õ¤±ÉÕ¤±¤é¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +(Î㤨¤Ð¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î 1000 Ëè¤Î¶èÀÚ¤êʸ»ú¤ËÂбþ¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£) +.LP +BSD ¤Ë¤Ï¡¢ +.sp +.in +4n +.nf +.BI "u_quad_t strtouq(const char *" nptr ", char **" endptr ", int " base ); +.sp +.in -4n +.fi +¤È¤¤¤¦´°Á´¤ËƱÍͤÎÄêµÁ¤ò»ý¤Ä´Ø¿ô¤¬¤¢¤ë¡£ +»ÈÍÑÃæ¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¥ï¡¼¥ÉĹ¼¡Âè¤Ç¤¢¤ë¤¬¡¢¤³¤Î´Ø¿ô¤Ï +.BR strtoull () +¤ä +.BR stroul () +¤ÈÅù²Á¤Ê¾ì¹ç¤â¤¢¤ê¤¨¤ë¡£ + +Éé¤ÎÃͤâÀµÅö¤ÊÆþÎϤȤߤʤµ¤ì¡¢¥¨¥é¡¼¤â¤Ê¤¯¡¢ +Âбþ¤¹¤ë +.I "unsigned long int" +·¿¤ÎÃͤËÊÑ´¹¤µ¤ì¤ë¡£ +.SH Îã +.BR strtol (3) +¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÎã¤ò»²¾È¡£ +¤³¤Î¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤¿´Ø¿ô¤Î»ÈÍÑÊýË¡¤âƱÍͤǤ¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR atof (3), +.BR atoi (3), +.BR atol (3), +.BR strtod (3), +.BR strtol (3) diff --git a/release/man3/strverscmp.3 b/release/man3/strverscmp.3 new file mode 100644 index 00000000..7cb93669 --- /dev/null +++ b/release/man3/strverscmp.3 @@ -0,0 +1,101 @@ +.\" 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) 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" +.SH ̾Á° +strverscmp \- 2¤Ä¤Î¥Ð¡¼¥¸¥ç¥óʸ»úÎó¤òÈæ³Ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "int strverscmp(const char *" s1 ", const char *" s2 ); +.fi +.SH ÀâÌÀ +.IR jan1 ", " jan2 ", ..., " jan9 ", " jan10 ", ..." +¤È¤¤¤Ã¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¾õ¶·¤Ï¤è¤¯¤¢¤ë¤¬¡¢ +.BR ls (1) +¤ò¼Â¹Ô¤·¤¿¤È¤­¤Ë +.IR jan1 ", " jan10 ", ..., " jan2 ", ..., " jan9 +¤Î½çÈÖ¤Çɽ¼¨¤µ¤ì¤ë¤Î¤Ë¤Ï°ãÏ´¶¤¬¤¢¤ë¡£ +.\" ¤³¤ì¤Þ¤Ç¤Î²ò·èÊýË¡: "rename jan jan0 jan?" +¤³¤ì¤ò½¤Àµ¤¹¤ë¤¿¤á¤Ë¡¢GNU ¤Ï +.BR ls (1) +¤Ë +.I \-v +¥ª¥×¥·¥ç¥ó¤òƳÆþ¤·¤¿¡£ +¤³¤Îµ¡Ç½¤Ï +.BR versionsort (3) +¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¤³¤ÎÃæ¤Ç +.BR strverscmp () +¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ + +¤³¤Î¤è¤¦¤Ë +.BR strverscmp () +¤ÎÌòÌܤÏ2¤Ä¤Îʸ»úÎó¤òÈæ³Ó¤·¤Æ¡ÖÀµ¤·¤¤¡×½ç½ø¤òõ¤¹¤³¤È¤Ç¤¢¤ë¡£ +¤³¤ì¤ËÂФ·¤Æ +.BR strcmp (3) +¤Ï¼­½ñ½ç¤ÇÈæ³Ó¤·¤¿·ë²Ì¤òÊÖ¤¹¤À¤±¤Ç¤¢¤ë¡£ +´Ø¿ô +.BR strverscmp () +¤Ï¥í¥±¡¼¥ë¤Î¥«¥Æ¥´¥ê¤Ç¤¢¤ë +.B LC_COLLATE +¤ò»ÈÍѤ·¤Ê¤¤¡£ +¤³¤Î¤³¤È¤«¤é¡¢¤³¤Î´Ø¿ô¤¬¼ç¤Ë¥¢¥¹¥­¡¼Ê¸»ú¤«¤éÀ®¤ëʸ»úÎó¤ò +ÁÛÄꤷ¤Æ¤¤¤ë¤³¤È¤¬Ê¬¤«¤ë¡£ + +¤³¤Î´Ø¿ô¤ÎÆ°ºî¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +ξÊý¤Îʸ»úÎó¤¬Åù¤·¤¤¾ì¹ç¡¢0 ¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¤½¤ÎľÁ°¤Þ¤Ç¤ÏξÊý¤Îʸ»úÎó¤¬Åù¤·¤¯¡¢ +¤½¤Îľ¸å¤Î¥Ð¥¤¥È¤Çξ¼Ô¤Ë°ã¤¤¤¬¤¢¤ë¤è¤¦¤Ê¡¢¥Ð¥¤¥È¤Î¶­³¦¤òõ¤¹¡£ +¸«¤Ä¤«¤Ã¤¿¥Ð¥¤¥È¶­³¦¤ò´Þ¤à¿ô»úÎó(¿ô»ú¤À¤±¤Îʸ»úÎó)¤ÎºÇĹ°ìÃ׸¡º÷¤ò¹Ô¤¦¡£ +(¿ô»úÎó¤Ï¶­³¦¤«¤é»Ï¤Þ¤Ã¤Æ¤¤¤Æ¤â¡¢¶­³¦¤Ç½ª¤ï¤Ã¤Æ¤¤¤Æ¤â¤è¤¤)¡£ +2¤Ä¤Îʸ»úÎ󤫤éÆÀ¤é¤ì¤¿¿ô»úÎó¤Î°ìÊý¤Þ¤¿¤ÏξÊý¤¬¶õ¤Ç¤¢¤ì¤Ð¡¢ +.BR strcmp (3) +¤¬ÊÖ¤·¤¿·ë²Ì¤ò´Ø¿ô¤ÎÊÖ¤êÃͤȤ·¤ÆÊÖ¤¹¡£ +¤¹¤Ê¤ï¤Á¡¢¥Ð¥¤¥ÈÃͤòÈæ³Ó¤·¤¿·ë²Ì¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î(¿ô»úÎó¤¬Î¾Êý¤È¤â¶õ¤Ç¤Ê¤¤)¾ì¹ç¡¢Î¾Êý¤Î¿ô»úÎó¤ò¿ô»ú½ç¤ÇÈæ³Ó¤¹¤ë¡£ +¤³¤Î¤È¤­¡¢1¤Ä°Ê¾å¤Î 0 ¤¬ÀèƬ¤Ë¤¢¤ë¿ô»úÎó¤Ï¡¢Á°¤Ë¾®¿ôÅÀ¤¬¤Ä¤¤¤Æ¤¤¤ë¤â¤Î¤È +²ò¼á¤µ¤ì¤ë¡£(ÀèƬ¤Ë 0 ¤¬Â¿¤¯¤¢¤ë¿ô»úÎó¤Û¤ÉÁ°¤ËÍè¤ë¤³¤È¤Ë¤Ê¤ë) +¤³¤Î·ë²Ì¡¢½ç½ø¤Ï¼¡¤Î¤è¤¦¤Ë¤Ê¤ë: +.IR 000 ", " 00 ", " 01 ", " 010 ", " 09 ", " 0 ", " 1 ", " 9 ", " 10 +.SH ÊÖ¤êÃÍ +´Ø¿ô +.BR strverscmp () +¤Ï¡¢¥¼¥í¤è¤ê¤â +1)¾®¤µ¤¤¡¢2)Åù¤·¤¤¡¢3)Â礭¤¤¤Î¤¤¤º¤ì¤«¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +¤½¤ì¤¾¤ì¤Ï¡¢\fIs1\fP ¤¬ \fIs2\fP ¤è¤ê¤â¡¢ +1)¾®¤µ¤¤¡¢2)Åù¤·¤¤¡¢3)Â礭¤¤ ¤³¤È¤ò¼¨¤¹¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR rename (1), +.BR strcasecmp (3), +.BR strcmp (3), +.BR strcoll (3), +.BR feature_test_macros (7) diff --git a/release/man3/strxfrm.3 b/release/man3/strxfrm.3 new file mode 100644 index 00000000..75dc7c8d --- /dev/null +++ b/release/man3/strxfrm.3 @@ -0,0 +1,80 @@ +.\" 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 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 +.\" +.TH STRXFRM 3 1993-04-12 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +strxfrm \- ʸ»úÎó¤ÎÊÑ´¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t strxfrm(char *" dest ", const char *" src ", size_t " n ); +.fi +.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) +¤ò»²¾È¤Î¤³¤È)¡£ +.SH ÊÖ¤êÃÍ +.BR strxfrm () +´Ø¿ô¤Ï¡¢ÊÑ´¹¤µ¤ì¤¿Ê¸»úÎó¤ò \fIdest\fP ¤ËÂåÆþ¤¹¤ë¤È¤­¤Ë +ɬÍפʥХ¤¥È¿ô¤«¤é¡¢½ªÃ¼¤Î \(aq\\0\(aq ʸ»ú¤Îʬ¤ò°ú¤¤¤¿¤â¤Î¤òÊÖ¤¹¡£¤â¤·ÊÖ¤êÃÍ +¤¬ \fIn\fP °Ê¾å¤Î¾ì¹ç¡¢ \fIdest\fP ¤ÎÆâÍƤÏÉÔÄê¤È¤Ê¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99. +.SH Ãí°Õ +\fI"POSIX"\fP ¤Þ¤¿¤Ï \fI"C"\fP ¥í¥±¡¼¥ë¤Ç¤Ï¡¢´Ø¿ô +.BR strxfrm () +¤Ï¡¢ +´Ø¿ô +.BR strncpy (3) +¤ò»È¤Ã¤Æʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR bcmp (3), +.BR memcmp (3), +.BR setlocale (3), +.BR strcasecmp (3), +.BR strcmp (3), +.BR strcoll (3) diff --git a/release/man3/swab.3 b/release/man3/swab.3 new file mode 100644 index 00000000..dbec0d02 --- /dev/null +++ b/release/man3/swab.3 @@ -0,0 +1,64 @@ +.\" 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 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 +.\" +.TH SWAB 3 2001-12-15 "" "Linux Programmer's Manual" +.SH ̾Á° +swab \- ÎÙÀܤ¹¤ë¥Ð¥¤¥È¤ò¸ò´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.B #include +.sp +.BI "void swab(const void *" from ", void *" to ", ssize_t " n ); +.fi +.SH ÀâÌÀ +.BR swab () +´Ø¿ô¤Ï¡¢\fIfrom\fP ¤Ç»Ø¤µ¤ì¤¿ÇÛÎ󤫤é \fIn\fP ¥Ð¥¤¥È¤ò +\fIto\fP ¤Ç»Ø¤µ¤ì¤¿ÇÛÎó¤Ë¡¢ÎÙÀܤ·¤¿¶ö¿ô/´ñ¿ô¥Ð¥¤¥È¤ò¸ò´¹¤·¤Ê¤¬¤é¥³¥Ô¡¼¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï°Û¤Ê¤ë¥Ð¥¤¥È¥ª¡¼¥À¡¼¤ò»ý¤Ä¥Þ¥·¥ó´Ö¤Ç¤Î¥Ç¡¼¥¿¸ò´¹¤Ë +»ÈÍѤµ¤ì¤ë¡£ +.LP +\fIn\fP ¤¬Éé¤Î¿ô¤Î¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï²¿¤â¤·¤Ê¤¤¡£ +\fIn\fP ¤¬Àµ¤Ç¤«¤Ä´ñ¿ô¤Î¾ì¹ç¡¢\fIn\-1\fP ¥Ð¥¤¥È¤Ï¾åµ­¤ÎÄ̤갷¤¤¡¢ +ºÇ¸å¤Î¥Ð¥¤¥È¤Ë¤Ä¤¤¤Æ¤Ï̤µ¬Äê¤ÎÆ°ºî¤ò¤¹¤ë +(¸À¤¤´¹¤¨¤ì¤Ð¡¢\fIn\fP ¤Ï¶ö¿ô¤Ë¤¹¤ë¤Ù¤­¤Ç¤¢¤ë)¡£ +.SH ÊÖ¤êÃÍ +.BR swab () +´Ø¿ô¤Ï¡¢ÃͤòÊÖ¤µ¤Ê¤¤¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR bstring (3), +.BR feature_test_macros (7) diff --git a/release/man3/sysconf.3 b/release/man3/sysconf.3 new file mode 100644 index 00000000..1eebaa29 --- /dev/null +++ b/release/man3/sysconf.3 @@ -0,0 +1,310 @@ +.\" 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: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 +.\" +.TH SYSCONF 3 2007-12-12 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +sysconf \- Æ°ºîÃæ¤ËÀßÄê¾ðÊó¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long sysconf(int " "name" ); +.fi +.SH ÀâÌÀ +POSIX ¤Ç¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¥³¥ó¥Ñ¥¤¥ë»þ¤ä¼Â¹Ô»þ¤Ë¡¢ +ÆÃÄê¤Î¥ª¥×¥·¥ç¥ó¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤ä¡¢ +ÀßÄê²Äǽ¤ÊÆÃÄê¤ÎÄê¿ô¤äÀ©¸Â¤¬¤É¤ó¤ÊÃͤ«¤ò¥Æ¥¹¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¹Ô¤¦¤Ë¤Ï¡¢ +.I +¤È +.I +¤ÎξÊý¤â¤·¤¯¤Ï°ìÊý¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¡¢ +ÆÃÄê¤Î¥Þ¥¯¥í¤ÎÃͤò³Îǧ¤¹¤ë¡£ +.LP +¼Â¹Ô»þ¤Ë¤Ï¡¢¤³¤³¤ÇÀâÌÀ¤¹¤ë´Ø¿ô +.BR sysconf () +¤ò»È¤Ã¤Æ¿ôÃͤòÌ䤤¹ç¤ï¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë´Ø¤¹¤ë¿ôÃͤϡ¢ +.BR fpathconf (3) +¤È +.BR pathconf (3) +¤ò»È¤Ã¤Æ³Îǧ¤Ç¤­¤ë¡£ +ʸ»úÎó¤ÎÃÍ¤Ï +.BR confstr (3) +¤ò»È¤Ã¤Æ³Îǧ¤Ç¤­¤ë¡£ +.LP +¤³¤ì¤é¤Î´Ø¿ô¤Ç¼èÆÀ¤µ¤ì¤ëÃͤÏÀßÄê²Äǽ¤Ê¥·¥¹¥Æ¥àÄê¿ô¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Ï¥×¥í¥»¥¹¤ÎÀ¸Â¸´ü´Ö¤Î´Ö¤ÏÊѲ½¤·¤Ê¤¤¡£ +.\" ⤷ RLIMIT_NOFILE ¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤òÊѹ¹¤¹¤ë setrlimit() ¤¬¸Æ¤Ó½Ð¤·¤¿ +.\" ¸å¤Ç¤Ï¡¢ sysconf(_SC_OPEN_MAX) ¤¬ÊÖ¤¹ÃͤÏÊѲ½¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +¥ª¥×¥·¥ç¥ó¤ò³Îǧ¤Ç¤­¤ë¤è¤¦¤Ë¡¢¤¿¤¤¤Æ¤¤¤Ï +.I +¤ÇÄê¿ô +.B _POSIX_FOO +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¤Ï¡¢¼Â¹Ô»þ¤ËÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦É¬Íפ¬¤¢¤ë¡£ +¤½¤ÎÃͤ¬ \-1 ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ï¡¢¤½¤Î¥ª¥×¥·¥ç¥ó¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +0 ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ï¡¢´ØÏ¢¤¹¤ë´Ø¿ô¤ä¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¤¬¡¢ +¤É¤ÎÄøÅÙ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤Ï¼Â¹Ô»þ¤Ë³Îǧ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +\-1 ¤Ç¤â 0 ¤Ç¤â¤Ê¤¤ÃͤËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ï¡¢¤½¤Î¥ª¥×¥·¥ç¥ó¤¬¥µ¥Ý¡¼¥È +¤µ¤ì¤Æ¤¤¤ë¡£Ä̾ï¤Ï¡¢¤½¤Î¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æµ­ºÜ¤·¤¿ POSIX ¤Î²þÄûǯ·î +¤ò¼¨¤¹ÃͤˤʤäƤ¤¤ë (Î㤨¤Ð 200112L)¡£ +glibc ¤Ç¤Ï 1 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢¤½¤Î¥ª¥×¥·¥ç¥ó¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +POSIX ¤Î²þÄûÈǤ¬¤Þ¤Àȯ¹Ô¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£ +.\" 999 ¤Ï¡¢¤½¤Î¥ª¥×¥·¥ç¥ó¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +.\" ºÇ¿·¤Îɸ½à¤Ë¤Ï¤â¤Ï¤ä¸ºß¤·¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£(?) +.BR sysconf () +¤Î°ú¤­¿ô¤Ë¤Ï +.B _SC_FOO +¤ò»ØÄꤹ¤ë¡£ +¥ª¥×¥·¥ç¥ó¤Î¥ê¥¹¥È¤Ë¤Ä¤¤¤Æ¤Ï +.BR posixoptions (7) +¤ò»²¾È¤Î¤³¤È¡£ +.LP +ÊÑ¿ô¤äÀ©¸Â¤ò³Îǧ¤Ç¤­¤ë¤è¤¦¤Ë¡¢¤¿¤¤¤Æ¤¤¤Ï¡¢ +.I +¤ÇÄê¿ô +.B _FOO +¤¬¡¢ +.I +¤Ç +.B _POSIX_FOO +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +À©¸Â¤¬µ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤ÏÄê¿ô¤ÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ +Äê¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ë¤Ï¡¢¤½¤ÎÄê¿ô¤ÏÊݾڤǤ­¤ëÃͤǤ¢¤ê¡¢ +¼ÂºÝ¤Ë¤Ï¤â¤Ã¤ÈÂ礭¤ÊÃͤ¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤³¤È¤â¤¢¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¥·¥¹¥Æ¥àËè¤ËÊѲ½¤¹¤ëÃͤòÍøÍѤ·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +.BR sysconf () +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¼Â¸½¤Ç¤­¤ë¡£ +.BR sysconf () +¤Î°ú¤­¿ô¤Ë¤Ï +.B _SC_FOO +¤ò»ØÄꤹ¤ë¡£ +.SS "POSIX.1 ÊÑ¿ô" +ÊÑ¿ô̾¡¢¤½¤ÎÃͤò¼èÆÀ¤¹¤ë¤Î¤Ë»È¤ï¤ì¤ë +.BR sysconf () +¤Î¥Ñ¥é¥á¡¼¥¿Ì¾¡¢´Êñ¤ÊÀâÌÀ¤ò°Ê²¼¤Ë¼¨¤¹¡£ +.LP +¤Þ¤º POSIX.1 ¸ß´¹¤ÎÊÑ¿ô¤ò¼¨¤¹¡£ +.TP +.BR ARG_MAX " - " _SC_ARG_MAX +.BR exec (3) +´Ø¿ô·²¤Î°ú¤­¿ô¤ÎºÇÂçĹ¡£ +.B _POSIX_ARG_MAX +(4096) ̤Ëþ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.BR CHILD_MAX " - " _SC_CHILD_MAX +¥æ¡¼¥¶ID ¤¢¤¿¤ê¤ÎƱ»þ¤Ë¸ºß¤Ç¤­¤ë¥×¥í¥»¥¹¤ÎºÇÂç¿ô¡£ +.B _POSIX_CHILD_MAX +(25) ̤Ëþ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.BR HOST_NAME_MAX " - " _SC_HOST_NAME_MAX +.BR gethostname (2) +¤ÇÊÖ¤µ¤ì¤ë¥Û¥¹¥È̾¤ÎºÇÂçĹ¡£ËöÈø¤Î NULL ¥Ð¥¤¥È¤ÏŤµ¤Ë´Þ¤Þ¤ì¤Ê¤¤¡£ +.B _POSIX_HOST_NAME_MAX +(255) ̤Ëþ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.BR LOGIN_NAME_MAX " - " _SC_LOGIN_NAME_MAX +¥í¥°¥¤¥ó̾¤ÎŤµ¤ÎºÇÂçÃÍ¡£ËöÈø¤Î NULL ¥Ð¥¤¥È¤âŤµ¤Ë´Þ¤Þ¤ì¤ë¡£ +.B _POSIX_LOGIN_NAME_MAX +(9) ̤Ëþ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.BR "" "clock ticks - " _SC_CLK_TCK +1É䢤¿¤ê¤Î¥¯¥í¥Ã¥¯¡¦¥Æ¥£¥Ã¥¯¿ô¡£ +Âбþ¤¹¤ëÊÑ¿ô¤ÏÇѻߤµ¤ì¤¿¡£¤³¤ÎÊÑ¿ô¤ÏÅöÁ³¤Ê¤¬¤é +.B CLK_TCK +¤È¸Æ¤Ð¤ì¤Æ¤¤¤¿¡£ +(Ãí°Õ: ¥Þ¥¯¥í +.B CLOCKS_PER_SEC +¤«¤é¤Ï¾ðÊó¤ÏÆÀ¤é¤ì¤Ê¤¤: ¤³¤ÎÃÍ¤Ï 1000000 ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤) +.TP +.BR OPEN_MAX " - " _SC_OPEN_MAX +°ì¤Ä¤Î¥×¥í¥»¥¹¤¬Æ±»þ¤Ë¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¾å¸Â¡£ +.B _POSIX_OPEN_MAX +(20) ̤Ëþ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.BR PAGESIZE " - " _SC_PAGESIZE +¥Ð¥¤¥Èñ°Ì¤Ç¤Î¥Ú¡¼¥¸¥µ¥¤¥º¡£ +1 ¤è¤ê¾®¤µ¤¯¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +(¤³¤ÎÂå¤ï¤ê¤Ë PAGE_SIZE ¤ò»È¤¦¥·¥¹¥Æ¥à¤â¤¢¤ë) +.TP +.BR RE_DUP_MAX " - " _SC_RE_DUP_MAX +.BR regexec (3) +¤È +.BR regcomp (3) +¤ÇµöÍƤµ¤ì¤Æ¤¤¤ë BRE (Basic Regular Expression; ´ðËÜÀµµ¬É½¸½) +¤Î·«¤êÊÖ¤·½Ð¸½²ó¿ô¤ÎºÇÂçÃÍ¡£ +.B _POSIX2_RE_DUP_MAX +(255) ̤Ëþ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.BR STREAM_MAX " - " _SC_STREAM_MAX +°ì¤Ä¤Î¥×¥í¥»¥¹¤¬Æ±»þ¤Ë¥ª¡¼¥×¥ó¤Ç¤­¤ë¥¹¥È¥ê¡¼¥à¿ô¤Î¾å¸Â¡£ +ÄêµÁ¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¡¢¤³¤ÎÃͤÏɸ½à C ¥Þ¥¯¥í¤Î +.B FOPEN_MAX +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.B _POSIX_STREAM_MAX +(8) ̤Ëþ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.B SYMLOOP_MAX +¥Ñ¥¹Ì¾¤Î²ò·è»þ¤Ë¸½¤ì¤Æ¤â¤è¤¤¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ÎºÇÂç¿ô¡£ +¤³¤Î¿ô¤òĶ¤¨¤ë¤È¡¢¥Ñ¥¹Ì¾²ò·è»þ¤Ë +.B ELOOP +¤¬ÊÖ¤µ¤ì¤ë¡£ +.B _POSIX_SYMLOOP_MAX +(8) ̤Ëþ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.BR TTY_NAME_MAX " - " _SC_TTY_NAME_MAX +üËö¥Ç¥Ð¥¤¥¹Ì¾¤ÎºÇÂçĹ¡£Ä¹¤µ¤Ë¤ÏËöÈø¤Î NULL ¥Ð¥¤¥È¤â´Þ¤Þ¤ì¤ë¡£ +.B _POSIX_TTY_NAME_MAX +(9) ̤Ëþ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.BR TZNAME_MAX " - " _SC_TZNAME_MAX +¥¿¥¤¥à¥¾¡¼¥ó̾¤È¤·¤Æ»È¤¨¤ë¥Ð¥¤¥È¿ô¤ÎºÇÂçÃÍ¡£ +.B _POSIX_TZNAME_MAX +(6) ̤Ëþ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.BR _POSIX_VERSION " - " _SC_VERSION +POSIX.1 ɸ½à¤¬¾µÇ§¤µ¤ì¤¿Ç¯·î¡£ +.B YYYYMML +¤È¤¤¤¦½ñ¼°¤Ç¤¢¤ë¡£ +.B 199009L +¤È¤¤¤¦Ãͤϡ¢1990ǯ 9·î ²þÄû¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.SS "POSIX.2 ÊÑ¿ô" +¼¡¤Ë¡¢POSIX.2 ¤ÎÃͤò¼¨¤¹¡£ +¤³¤ì¤é¤Ï³Æ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ËÂФ¹¤ëÀ©¸Â¤ò»ØÄꤹ¤ë¡£ +.TP +.BR BC_BASE_MAX " - " _SC_BC_BASE_MAX +.BR bc (1) +¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ÇµöÍƤµ¤ì¤ë +.I obase +¤ÎºÇÂçÃÍ¡£ +.TP +.BR BC_DIM_MAX " - " _SC_BC_DIM_MAX +.BR bc (1) +¤ÇµöÍƤµ¤ì¤ë°ì¤Ä¤ÎÇÛÎóÃæ¤ÎÍ×ÁÇ¿ô¤ÎºÇÂçÃÍ¡£ +.TP +.BR BC_SCALE_MAX " - " _SC_BC_SCALE_MAX +.BR bc (1) +¤Çµö¤µ¤ì¤ë +.I scale +¤ÎºÇÂçÃÍ¡£ +.TP +.BR BC_STRING_MAX " - " _SC_BC_STRING_MAX +.BR bc (1) +¤ÇµöÍƤµ¤ì¤ëʸ»úÎó¤ÎºÇÂçĹ¡£ +.TP +.BR COLL_WEIGHTS_MAX " - " _SC_COLL_WEIGHTS_MAX +¥í¥±¡¼¥ëÄêµÁ¥Õ¥¡¥¤¥ëÃæ¤Î +.B LC_COLLATE order +¥­¡¼¥ï¡¼¥É¤Î¥¨¥ó¥È¥ê¤Ë³ä¤êÅö¤Æ²Äǽ¤Ê½Å¤ß¤ÎºÇÂçÃÍ¡£ +.TP +.BR EXPR_NEST_MAX " - " _SC_EXPR_NEST_MAX +.BR expr (1) +¤Ë¤ª¤¤¤Æ¡¢³ç¸Ì¤ÇÆþ¤ì»Ò¤Ë¤Ç¤­¤ë¼°¤ÎºÇÂç¿ô¡£ +.TP +.BR LINE_MAX " - " _SC_LINE_MAX +¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ÎÆþÎϹԤκÇÂçĹ¡£É¸½àÆþÎϤÀ¤±¤Ç¤Ê¤¯¡¢¥Õ¥¡¥¤¥ë¤«¤é¤ÎÆþÎϤˤâ +ŬÍѤµ¤ì¤ë¡£Ä¹¤µ¤Ë¤Ï¹Ô¤ÎËöÈø¤Î²þ¹Ôʸ»ú¤â´Þ¤Þ¤ì¤ë¡£ +.TP +.BR RE_DUP_MAX " - " _SC_RE_DUP_MAX +Àµµ¬É½¸½¤Ç¶è´Öɽµ­ (interval notation) +.B \e{m,n\e} +¤¬»ÈÍѤµ¤ì¤¿¤È¤­¤ËµöÍƤµ¤ì¤ë·«¤êÊÖ¤·½Ð¸½²ó¿ô¤ÎºÇÂçÃÍ¡£ +.TP +.BR POSIX2_VERSION " - " _SC_2_VERSION +POSIX.2 ɸ½à¤Î¥Ð¡¼¥¸¥ç¥ó¡£YYYYMML ¤È¤¤¤¦½ñ¼°¤Çɽµ­¤µ¤ì¤ë¡£ +.TP +.BR POSIX2_C_DEV " - " _SC_2_C_DEV +POSIX.2 ¤Î C ¸À¸ì³«È¯µ¡Ç½¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤ò¼¨¤¹¡£ +.TP +.BR POSIX2_FORT_DEV " - " _SC_2_FORT_DEV +POSIX.2 ¤Î FORTRAN ³«È¯¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤ò¼¨¤¹¡£ +.TP +.BR POSIX2_FORT_RUN " - " _SC_2_FORT_RUN +POSIX.2 ¤Î FORTRAN ¥é¥ó¥¿¥¤¥à¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤ò¼¨¤¹¡£ +.TP +.BR _POSIX2_LOCALEDEF " - " _SC_2_LOCALEDEF +.BR localedef (1) +¤ò»È¤Ã¤¿¡¢POSIX.2 ¤Î¥í¥±¡¼¥ë¤ÎºîÀ®¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«¤ò¼¨¤¹¡£ +.TP +.BR POSIX2_SW_DEV " - " _SC_2_SW_DEV +POSIX.2 ¥½¥Õ¥È¥¦¥§¥¢³«È¯¥æ¡¼¥Æ¥£¥ê¥Æ¥£¥ª¥×¥·¥ç¥ó¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤ò¼¨¤¹¡£ +.PP +°Ê²¼¤ÎÃͤ⸺ߤ¹¤ë¤¬¡¢É¸½à¤Ë¤Ï´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.BR "" " - " _SC_PHYS_PAGES +ʪÍý¥á¥â¥ê¤Î¥Ú¡¼¥¸¿ô¡£ +¤³¤ÎÃÍ¤È +.B _SC_PAGE_SIZE +ÃͤÎÀѤϷå°î¤ì¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¤Î¤ÇÃí°Õ¤¹¤ë¤³¤È¡£ +.TP +.BR "" " - " _SC_AVPHYS_PAGES +¸½ºßÍøÍѲÄǽ¤ÊʪÍý¥á¥â¥ê¤Î¥Ú¡¼¥¸¿ô¡£ +.TP +.BR "" " - " _SC_NPROCESSORS_CONF +ÀßÄꤵ¤ì¤¿¥×¥í¥»¥Ã¥µ¿ô¡£ +.TP +.BR "" " - " _SC_NPROCESSORS_ONLN +¸½ºß¥ª¥ó¥é¥¤¥ó¤Î (ÍøÍѲÄǽ¤Ê) ¥×¥í¥»¥Ã¥µ¿ô¡£ +.SH ÊÖ¤êÃÍ +.I name +¤¬ÉÔÀµ¤Ê¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤Ë +.B EINVAL +¤¬ÀßÄꤵ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥·¥¹¥Æ¥à¥ê¥½¡¼¥¹¤ÎÃͤ¬ÊÖ¤êÃͤȤ·¤ÆÊÖ¤µ¤ì¡¢ +.I errno +¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£Ì䤤¹ç¤ï¤»¤¬¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ç¤¢¤ì¤Ð¡¢ +¤½¤Î¥ª¥×¥·¥ç¥ó¤¬ÍøÍѤǤ­¤ë¤È¤­¤ÏÀµ¤ÎÃͤ¬ÊÖ¤µ¤ì¡¢ +ÍøÍѤǤ­¤Ê¤¤¤È¤­¤Ï \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£Ì䤤¹ç¤ï¤»¤¬ +À©¸Â¤Ë¤Ä¤¤¤Æ¾ì¹ç¤Ï¡¢À©¸Â¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¤Ë \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH ¥Ð¥° +.B ARG_MAX +¤ò»È¤¦¤Î¤ÏÆñ¤·¤¤¡¢¤Ê¤¼¤Ê¤é¡¢ +.BR exec (3) +¤Î°ú¤­¿ôÎΰè (argument space) ¤Î¤¦¤Á¤É¤ì¤¯¤é¤¤¤¬ +¥æ¡¼¥¶¤Î´Ä¶­ÊÑ¿ô¤Ë¤è¤Ã¤Æ»È¤ï¤ì¤ë¤«¤Ïʬ¤«¤é¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.PP +¤¤¤¯¤Ä¤«¤ÎÊÖ¤êÃͤϤȤƤâÂ礭¤¯¤Ê¤ë¤À¤í¤¦¡£¤³¤ì¤é¤ò»È¤Ã¤Æ +¥á¥â¥ê¤Î³ä¤êÅö¤Æ¤ò¹Ô¤¦¤Î¤ÏŬÅö¤Ç¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR bc (1), +.BR expr (1), +.BR getconf (1), +.BR locale (1), +.BR fpathconf (3), +.BR pathconf (3), +.BR posixoptions (7) diff --git a/release/man3/syslog.3 b/release/man3/syslog.3 new file mode 100644 index 00000000..80bfc123 --- /dev/null +++ b/release/man3/syslog.3 @@ -0,0 +1,338 @@ +.\" Written Feb 1994 by Steve Greenland (stevegr@neosoft.com) +.\" +.\" 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. +.\" +.\" Updated 1999.12.19 by Karl M. Hegbloom +.\" +.\" Updated 13 Oct 2001, Michael Kerrisk +.\" Added description of vsyslog +.\" Added descriptions of LOG_ODELAY and LOG_NOWAIT +.\" Added brief description of facility and option arguments +.\" Added CONFORMING TO section +.\" 2001-10-13, aeb, minor changes +.\" Modified 13 Dec 2001, Martin Schulze +.\" Modified 3 Jan 2002, Michael Kerrisk +.\" +.\" Japanese Verion Copyright (c) 1996 Shoichi OZAWA +.\" all right reserved. +.\" Translated Sep 1 20:14:01 JST 1996 +.\" by Shoichi OZAWA +.\" Updated Thu Oct 18 01:00:02 JST 2001 +.\" by Akihiro MOTOKI +.\" Updated Fri Jan 4 22:15:21 JST 2002 +.\" by Akihiro MOTOKI +.\" Updated 2002-04-14 by Kentaro Shirakata +.\" Updated 2007-01-01 by Kentaro Shirakata +.\" +.TH SYSLOG 3 2008-11-12 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +closelog, openlog, syslog, vsyslog \- ¥·¥¹¥Æ¥à¥í¥¬¡¼¤Ë¥á¥Ã¥»¡¼¥¸¤òÁ÷¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "void openlog(const char *" ident ", int " option ", int " facility ); +.br +.BI "void syslog(int " priority ", const char *" format ", ...);" +.br +.B "void closelog(void);" +.sp +.B #include +.sp +.BI "void vsyslog(int " priority ", const char *" format ", va_list " ap ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR vsyslog (): +_BSD_SOURCE +.SH ÀâÌÀ +.BR closelog () +¤Ï¥·¥¹¥Æ¥à¤Î¥í¥°µ­Ï¿ÍÑ¥×¥í¥°¥é¥à(¥·¥¹¥Æ¥à¥í¥¬¡¼ +.BR syslogd (8)) +¥Ø¤ÎÀܳ¤ò½ªÎ»¤¹¤ë¡£ +.BR closelog () +¤Ïɬ¿Ü¤Ç¤Ï¤Ê¤¤¡£ +.sp +.BR openlog () +¤Ï¥í¥°¤ò½ÐÎϤ·¤è¤¦¤È¤·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤«¤é¥í¥°µ­Ï¿ÍÑ¥×¥í¥°¥é¥à¤Ø¤Î +Àܳ¤ò³«»Ï¤¹¤ë¡£ +.I ident +¤Ç»ØÄꤷ¤¿Ê¸»úÎó(Ä̾ï¤Ï +.BR openlog () +¤·¤¿¥×¥í¥°¥é¥à¤Î̾Á°)¤Ï¥í¥°½ÐÎϤΰìʸ°ìʸ¤ËÄɲ䵤졢¤É¤Î¥×¥í¥°¥é¥à +¤¬½ÐÎϤ·¤¿¥í¥°¤«¤ò¼±Ê̤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.I option +°ú¤­¿ô¤Ï¡¢ +.BR openlog () +¤ÎÆ°ºî¤È¤½¤Î¸å¤Î +.BR syslog () +¤Î¸Æ¤Ó½Ð¤·¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°¤ò»ØÄꤹ¤ë¡£ +.I facility +°ú¤­¿ô¤Ï¡¢¸å¤Ç +.BR syslog () +¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë facility ¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë»ÈÍѤµ¤ì¤ë +¥Ç¥Õ¥©¥ë¥ÈÃͤò·èÄꤹ¤ë¡£ +.I option +¤È +.I facility +¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò¤¹¤ë¡£ +.BR openlog () +¤Ïɬ¿Ü¤Ç¤Ï¤Ê¤¯¡¢É¬Íפ˱þ¤¸¤Æ +.BR syslog () +¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.BR syslog () +¤¬¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¡¢ +.I ident +¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï NULL ¤Ë¤Ê¤ë¡£ +.sp +.BR syslog () +¤Ï¥í¥°¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¡¢ +.BR syslogd (8) +¤¬¤½¤Î¥á¥Ã¥»¡¼¥¸¤òµ­Ï¿¤¹¤ë¡£ +.I priority +°ú¤­¿ô¤Ï +.I facility +¤È +.I level +¤È¤ÎÁȹ礻¤Ç»ØÄꤹ¤ë¡£ +.I facility +¤È +.I level +¤Î¼è¤ê¤¦¤ëÃͤϸå½Ò¤¹¤ë¡£ +»Ä¤ê¤Î +.I format +°ú¤­¿ô¤Ï +.BR printf (3) +¤È»÷¤¿¥¹¥¿¥¤¥ë¤Î½ñ¼°¤È¤½¤Î½ñ¼°¤ËÍ¿¤¨¤ëÃͤǤ¢¤ë¡£ +.I format +Ãæ¤Î2ʸ»ú +.B %m +¤Ï¤½¤Î»þÅÀ¤Ç¤Î +.I errno +¤Ë´ØÏ¢¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸Ê¸»úÎó +.RI ( strerror ) +¤Ë¤è¤Ã¤ÆÃÖ¤­´¹¤¨¤é¤ì¤ë¡£ +ɬÍפʾì¹ç¤ÏËöÈø¤Ë²þ¹Ô¤¬²Ã¤¨¤é¤ì¤ë¡£ +.BR vsyslog () +´Ø¿ô¤Ï +.BR syslog () +¤ÈƱ¤¸µ¡Ç½¤ò»ý¤Ä¤¬¡¢²ÄÊÑ°ú¤­¿ô¥ê¥¹¥È¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +»ØÄꤵ¤ì¤¿°ú¤­¿ô¤Ï¡¢ +.BR stdarg (3) +²ÄÊÑ°ú¤­¿ô¥ê¥¹¥È¥Þ¥¯¥í¤òÍѤ¤¤Æ¼èÆÀ¤µ¤ì¤ë¡£ + +°Ê²¼¤Î¥µ¥Ö¥»¥¯¥·¥ç¥ó¤Ç¤Ï¡¢ +.I option +¤È +.I facility +¤È +.I priority +¤ÎÃͤòÀßÄꤹ¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¥Ñ¥é¥á¡¼¥¿¤òÀâÌÀ¤¹¤ë¡£ +.SS option +²¼µ­¤ÎÃͤò OR ¤·¤¿¤â¤Î¤¬ +.BR openlog () +¤Î +.I option +°ú¤­¿ô¤Ë¤Ê¤ë: +.TP 15 +.B LOG_CONS +¥¨¥é¡¼¤¬¤¢¤ì¤Ð¡¢¥·¥¹¥Æ¥à¥í¥¬¡¼¤ËÁ÷¤ë°ìÊý¤Ç¥·¥¹¥Æ¥à¥³¥ó¥½¡¼¥ë¤Ë¤âľÀܽñ¤¯¡£ +.TP +.B LOG_NDELAY +¥í¥°µ­Ï¿ÍÑ¥×¥í¥°¥é¥à¤È¤ÎÀܳ¤ò¨ºÂ¤Ë³«»Ï¤¹¤ë +(Ä̾ï¤Ï¡¢ºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤¬µ­Ï¿¤µ¤ì¤ë»þ¤ËÀܳ¤ò³«¤¯)¡£ +.TP +.B LOG_NOWAIT +¥á¥Ã¥»¡¼¥¸¤òµ­Ï¿¤¹¤ëºÝ¤ËÀ¸À®¤µ¤ì¤ë»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤òÂÔ¤¿¤Ê¤¤¡£ +(GNU C ¥é¥¤¥Ö¥é¥ê¤Ï»Ò¥×¥í¥»¥¹¤òÀ¸À®¤·¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï Linux ¤Ç¤Ï̵¸ú¤Ç¤¢¤ë¡£) +.TP +.B LOG_ODELAY +.B LOG_NDELAY +¤ÎÈ¿ÂС£ +.BR syslog () +¤¬¸Æ¤Ð¤ì¤ë¤Þ¤Ç¡¢Àܳ¤Î³«»Ï¤ò¹Ô¤ï¤Ê¤¤¡£ +(¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤¢¤ê¡¢Æä˻ØÄꤹ¤ëɬÍפϤʤ¤¡£) +.TP +.B LOG_PERROR +stderr ¤Ë¤â½ÐÎϤ¹¤ë¡£(POSIX.1-2001 ¤Ç¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤) +.TP +.B LOG_PID +¸Ä¡¹¤Î¥á¥Ã¥»¡¼¥¸¤Ë PID ¤ò´Þ¤á¤ë¡£ +.SS facility +.I facility +°ú¤­¿ô¤Ï¥á¥Ã¥»¡¼¥¸¤Ëµ­Ï¿¤µ¤ì¤ë¥×¥í¥°¥é¥à¤Î¥¿¥¤¥×¤ò»ØÄꤹ¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +¤³¤ì¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¥¿¥¤¥×¤Î¥×¥í¥°¥é¥à¤«¤é¤Î¥á¥Ã¥»¡¼¥¸¤Ï°Û¤Ê¤ë°·¤¤¤ò +¤¹¤ë¤è¤¦¤ËÀßÄê¥Õ¥¡¥¤¥ë( +.BR syslog.conf (5)) +¤ËÄêµÁ¤Ç¤­¤ë¡£ +.TP 15 +.B LOG_AUTH +¥»¥­¥å¥ê¥Æ¥£/ǧ¾Ú ¥á¥Ã¥»¡¼¥¸ +(Èó¿ä¾©¡£Âå¤ï¤ê¤Ë +.B LOG_AUTHPRIV +¤ò»ÈÍѤ¹¤ë¤³¤È) +.TP +.B LOG_AUTHPRIV +¥»¥­¥å¥ê¥Æ¥£/ǧ¾Ú ¥á¥Ã¥»¡¼¥¸ (¥×¥é¥¤¥Ù¡¼¥È) +.TP +.B LOG_CRON +¥¯¥í¥Ã¥¯¥Ç¡¼¥â¥ó +.RB ( cron +¤È +.RB at ) +.TP +.B LOG_DAEMON +ÆÃÄê¤Î facility Ãͤò»ý¤¿¤Ê¤¤¥·¥¹¥Æ¥à¥Ç¡¼¥â¥ó +.TP +.B LOG_FTP +ftp ¥Ç¡¼¥â¥ó +.TP +.B LOG_KERN +¥«¡¼¥Í¥ë¥á¥Ã¥»¡¼¥¸ (¥æ¡¼¥¶¥×¥í¥»¥¹¤«¤éÀ¸À®¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤) +.\" LOG_KERN has the value 0; if used as a facility, zero translates to: +.\" "use the default facility". +.TP +.BR LOG_LOCAL0 " ¤«¤é " LOG_LOCAL7 +¥í¡¼¥«¥ë¤Ê»ÈÍѤΤ¿¤á¤Ë¥ê¥¶¡¼¥Ö¤µ¤ì¤Æ¤¤¤ë +.TP +.B LOG_LPR +¥é¥¤¥ó¥×¥ê¥ó¥¿¡¦¥µ¥Ö¥·¥¹¥Æ¥à +.TP +.B LOG_MAIL +¥á¡¼¥ë¡¦¥µ¥Ö¥·¥¹¥Æ¥à +.TP +.B LOG_NEWS +USENET ¥Ë¥å¡¼¥¹¡¦¥µ¥Ö¥·¥¹¥Æ¥à +.TP +.B LOG_SYSLOG +.BR syslogd (8) +¤Ë¤è¤Ã¤ÆÆâÉôŪ¤Ëȯ¹Ô¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸ +.TP +.BR LOG_USER " (¥Ç¥Õ¥©¥ë¥È)" +°ìÈÌŪ¤Ê¥æ¡¼¥¶¥ì¥Ù¥ë¥á¥Ã¥»¡¼¥¸ +.TP +.B LOG_UUCP +UUCP¥µ¥Ö¥·¥¹¥Æ¥à +.SS level +¤³¤ì¤Ï¥á¥Ã¥»¡¼¥¸¤ÎÍ¥ÀèÅÙ¤ò»ØÄꤹ¤ë¡£ +Í¥ÀèÅ٤ι⤤¤â¤Î¤«¤éÄ㤤¤â¤Î¤Î½ç¤Ç²¼µ­¤¹¤ë¡£ +.TP 15 +.B LOG_EMERG +¥·¥¹¥Æ¥à¤¬»ÈÍÑÉÔ²Ä +.TP +.B LOG_ALERT +ľ¤Á¤Ë¹ÔÆ°¤òµ¯¤³¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.TP +.B LOG_CRIT +´í¸±¤Ê¾õÂÖ +.TP +.B LOG_ERR +¥¨¥é¡¼¤Î¾õÂÖ +.TP +.B LOG_WARNING +¥ï¡¼¥Ë¥ó¥°¤Î¾õÂÖ +.TP +.B LOG_NOTICE +Ä̾ï¤À¤¬½ÅÍפʾõÂÖ +.TP +.B LOG_INFO +¥¤¥ó¥Õ¥©¥á¡¼¥·¥ç¥ó¥á¥Ã¥»¡¼¥¸ +.TP +.B LOG_DEBUG +¥Ç¥Ð¥Ã¥°¥ì¥Ù¥ë¤Î¥á¥Ã¥»¡¼¥¸ +.LP +.BR setlogmask (3) +´Ø¿ô¤ò»ÈÍѤ·¤Æ¡¢ +»ØÄꤵ¤ì¤¿¥ì¥Ù¥ë¤Î¥á¥Ã¥»¡¼¥¸¤À¤±¤òµ­Ï¿¤¹¤ë¤è¤¦¤Ë +À©¸Â¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ½àµò +.BR openlog (), +.BR closelog (), +.BR syslog () +¤Ï SUSv2 ¤È POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë +(⤷ +.BR vsyslog () +¤Ï½ü¤¯)¡£ +POSIX.1-2001 ¤Ç¤Ï +.I facility +¤È¤·¤Æ +.B LOG_USER +¤È +.B LOG_LOCAL* +¤ÎÃͤ¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¤À¤±¤Ç¤¢¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢ +.B LOG_AUTHPRIV +¤È +.B LOG_FTP +¤È¤¤¤¦Îã³°¤Ï¤¢¤ë¤¬¡¢ +¤½¤ì°Ê³°¤Î +.I facility +¤ÎÃͤÏ¿¤¯¤Î Unix ¥·¥¹¥Æ¥à¤Ç»È¤ï¤ì¤Æ¤¤¤ë¡£ +.I option +¤ÎÃͤΠ+.B LOG_PERROR +¤ÎÃͤϡ¢ POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +Unix ¤Î¿¤¯¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.\" .SH ÍúÎò +.\" .BR syslog () +.\" ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¡¦¥³¡¼¥ë¤Ï 4.2BSD ¤«¤é¼ÂÁõ¤µ¤ì¤¿¡£ +.\" 4.3BSD ¤Ë¤Ï +.\" .BR openlog (), +.\" .BR syslog (), +.\" .BR closelog (), +.\" .BR setlogmask () +.\" ¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" ¤Þ¤¿¡¢4.3BSD-Reno ¤Ë¤Ï +.\" .BR vsyslog () +.\" ¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" ÅöÁ³¤Ê¤¬¤é½é´ü¤Î v* ´Ø¿ô¤Ï +.\" .I +.\" ¤È¤Ï¸ß´¹À­¤Î¤Ê¤¤ +.\" .I +.\" ¤Î»ÅÁȤò»ÈÍѤ·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR openlog () +¸Æ¤Ó½Ð¤·¤Î +.I ident +°ú¤­¿ô¤Ï¡¢Ãͤ¬¤½¤Î¤Þ¤ÞÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¤³¤È¤òÁ°Äó¤Ë¤·¤Æ¤¤¤ë¡£ +¤½¤ì¤æ¤¨¡¢ +.I ident +¤Ç»ØÄꤵ¤ì¤¿Ê¸»úÎó¤¬Êѹ¹¤µ¤ì¤ë¤È¡¢ +.BR syslog () +¤ÏÊѹ¹¤µ¤ì¤¿Ê¸»úÎó¤ÎÄɲ乤ë¤À¤í¤¦¤·¡¢ +»ØÄꤵ¤ì¤¿Ê¸»úÎó¤¬Â¸ºß¤·¤Ê¤¯¤Ê¤Ã¤¿¾ì¹ç¡¢·ë²Ì¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +ºÇ¤â°Ü¿¢À­¤¬¤¢¤ëÊýË¡¤Ï¡¢Ê¸»úÎóÄê¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +.LP +¥æ¡¼¥¶¡¼¤«¤éÍ¿¤¨¤é¤ì¤¿¥Ç¡¼¥¿¤ò format ¤È¤·¤ÆÅϤ·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë°Ê²¼¤ò»È¤¦¤³¤È¡£ +.nf + + syslog(priority, "%s", string); +.fi +.SH ´ØÏ¢¹àÌÜ +.BR logger (1), +.BR setlogmask (3), +.BR syslog.conf (5), +.BR syslogd (8) diff --git a/release/man3/system.3 b/release/man3/system.3 new file mode 100644 index 00000000..47a3ce3f --- /dev/null +++ b/release/man3/system.3 @@ -0,0 +1,170 @@ +.\" 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:51:15 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 11 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) +.\" 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 µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\" +.TH SYSTEM 3 2004-12-20 "" "Linux Programmer's Manual" +.SH ̾Á° +system \- ¥·¥§¥ë¥³¥Þ¥ó¥É¤Î¼Â¹Ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int system(const char *" "command" ); +.fi +.SH ÀâÌÀ +.BR system () +¤Ï +.I command +¤Ç»ØÄꤷ¤¿¥³¥Þ¥ó¥É¤ò +.B "/bin/sh \-c" +.I command +¤Î·Á¤Ç¼Â¹Ô¤¹¤ë¡£»ØÄꤷ¤¿¥³¥Þ¥ó¥É¤¬½ªÎ»¤¹¤ì¤Ð¤³¤Î´Ø¿ô¤â½ªÎ»¤¹¤ë¡£ +¥³¥Þ¥ó¥É¼Â¹ÔÃæ¤Ï¡¢ +.B SIGCHLD +¤Ï¥Ö¥í¥Ã¥¯¤µ¤ì¡¢ +.B SIGINT +¤È +.B SIGQUIT +¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç +.RB ( fork (2) +¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ê¤É)¡¢\-1 ¤òÊÖ¤¹¡£ +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢¥³¥Þ¥ó¥É¤Î¥¹¥Æ¡¼¥¿¥¹¤òÊÖ¤¹¡£ +¸å¼Ô¤Î¾ì¹ç¡¢¥¹¥Æ¡¼¥¿¥¹¤Ï +.BR wait (2) +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Õ¥©¡¼¥Þ¥Ã¥È¤ÇÊ֤äƤ¯¤ë¡£ +½¾¤Ã¤Æ¡¢¥³¥Þ¥ó¥É¤Î½ªÎ»¥³¡¼¥É¤Ï +.I WEXITSTATUS(status) +¤ÇÆÀ¤ë¤³¤È¤¬½ÐÍè¤ë¡£ +.I /bin/sh +¤¬¼Â¹Ô½ÐÍè¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ï¥³¥Þ¥ó¥É¤¬ +.I exit(127) +¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ +.PP +.I command +¤ÎÃͤ¬ NULL ¤Î¤È¤­¤Ï¡¢ +.BR system () +¤Ï¥·¥§¥ë¤¬ÍøÍѲÄǽ¤Ê¤é¥¼¥í°Ê³°¤ÎÃͤòÊÖ¤·¡¢ÍøÍÑÉԲĤʤ饼¥í¤òÊÖ¤¹¡£ +.PP +.BR system () +¤Ï¾¤Î»Ò¥×¥í¥»¥¹¤Î¥¦¥¨¥¤¥È¥¹¥Æ¡¼¥¿¥¹¤Ë¤Ï±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡£ +.SH ½àµò +C89, C99, POSIX.1-2001. +.SH Ãí°Õ +.PP +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤Ç¤¢¤ë +.B _XOPEN_SOURCE +¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +.BR wait (2) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥Þ¥¯¥í·² +.RB ( WEXITSTATUS () +Åù) ¤¬ +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¤ÈÍøÍѲÄǽ¤Ë¤Ê¤ë¡£ +.PP +´û¤Ë½Ò¤Ù¤¿¤è¤¦¤Ë¡¢ +.BR system () +¤Ï +.B SIGINT +¤È +.B SIGQUIT +¤ò̵»ë¤¹¤ë¡£ +¤è¤Ã¤Æ¥ë¡¼¥×¤«¤é +.BR system () +¤ò¸Æ¤Ö¥×¥í¥°¥é¥à¤Ï¡¢ +°Ê²¼¤ÎÎã¤Î¤è¤¦¤Ë»Ò¥×¥í¥»¥¹¤Î½ªÎ»¾õÂÖ¤ò¼«Ê¬¤Ç¥Á¥§¥Ã¥¯¤·¤Æ¤ª¤«¤Ê¤¤¤È¡¢ +ÃæÃǤǤ­¤Ê¤¯¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.br +.nf + + while (something) { + int ret = system("foo"); + + if (WIFSIGNALED(ret) && + (WTERMSIG(ret) == SIGINT || WTERMSIG(ret) == SIGQUIT)) + break; + } +.fi +.PP +set-user-ID ¤ä set-group-ID ¤ÎÆø¢¤ò¤â¤Ä¥×¥í¥°¥é¥à¤ÎÃæ¤Ç¤Ï +.BR system () +¤ò»È¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢¤¢¤ë´Ä¶­ÊÑ¿ô¤Î̤ÃΤÎÃͤˤè¤Ã¤Æ +¥·¥¹¥Æ¥à¤Î°ÂÁ´¤¬Â»¤Ê¤ï¤ì¤ë¤«¤é¤Ç¤¢¤ë¡£Âå¤ï¤ê¤Ë +.BR exec (3) +´ØÏ¢¤Î´Ø¿ô·²¤ÎÃæ¤Ç +.BR execlp (3) +¤È +.BR execvp (3) +°Ê³°¤Î´Ø¿ô¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +¼ÂºÝ¤Î¤È¤³¤í¡¢ +.BR system () +¤Ï +.I /bin/sh +¤¬ bash ¥Ð¡¼¥¸¥ç¥ó 2 ¤Ç¤¢¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +set-user-ID ¤ä set-group-ID ¤ÎÆø¢¤ò»ý¤Ä¥×¥í¥°¥é¥à¤«¤é¤ÏÀµ¤·¤¯Æ°ºî¤·¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢bash ¥Ð¡¼¥¸¥ç¥ó 2 ¤Ï¥¹¥¿¡¼¥È¥¢¥Ã¥×»þ¤ËÆø¢¤òÍî¤È¤¹¤«¤é¤Ç¤¢¤ë¡£ +(Debian ¤Ç¤Ï¡¢sh ¤È¤·¤Æµ¯Æ°¤µ¤ì¤¿»þ¤Ë¤Ï¤³¤Î¤è¤¦¤ÊÆ°ºî¤ò¹Ô¤Ê¤ï¤Ê¤¤¤è¤¦¤Ë +½¤Àµ¤µ¤ì¤¿ bash ¤òÍѤ¤¤Æ¤¤¤ë) +.PP +glibc 2.1.3 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ +.I command +¤¬ NULL ¤Î¾ì¹ç¤Ë +.I /bin/sh +¤¬ÍøÍѲÄǽ¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯¤Ï¼ÂºÝ¤Ë¤Ï¹Ô¤ï¤º¡¢ +¤¤¤Ä¤Ç¤âÍøÍѲÄǽ¤Ç¤¢¤ë¤È¤ß¤Ê¤·¤Æ¤¤¤¿¡£ +.BR system () +¤Ï¤³¤Î¾ì¹ç¤Ë¾ï¤Ë 1 ¤òÊÖ¤·¤Æ¤¤¤¿¡£ +POSIX.1-2001 ¤Ç¤Ï¥·¥§¥ë¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¤È¤¤¤¦É¸½à¤Ë½àµò¤·¤¿¼ÂÁõ¤ò +Í׵ᤷ¤Æ¤¤¤ë¤¬¡¢glibc 2.1.3 °Ê¹ß¤Ç¤Ï¥·¥§¥ë¤Î¥Á¥§¥Ã¥¯¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¡£ +¤Ê¤¼¤Ê¤é¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥°¥é¥à¤¬ +.BR system () +¤ò¸Æ¤Ó½Ð¤¹¤è¤êÁ°¤Ë (POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤) +.BR chroot (2) +¤ò¸Æ¤Ó½Ð¤·¤Æ¤¤¤¿»þ¤Ë¤Ï¡¢¥·¥§¥ë¤¬ÍøÍѲÄǽ¤Ç¤Ê¤¤¾ì¹ç¤ä¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë +¤Ç¤Ê¤¤¾ì¹ç¤¬¤¢¤ë¤«¤é¤Ç¤¢¤ë¡£ +.PP +¼Â¹Ô¤·¤¿¥·¥§¥ë¥³¥Þ¥ó¥É¤¬ 127 +.RB ( /bin/sh +¤Î¸Æ¤Ó½Ð¤·¤Ë¼ºÇÔ¤·¤¿»þ¤ËÊÖ¤¹ÃÍ) ¤òÊÖ¤¹¤³¤È¤â¹Í¤¨¤é¤ì¤ë¡£ +¤½¤Î¤¿¤á¡¢¥×¥í¥°¥é¥à¤Ï (¥ê¥¿¡¼¥ó¥³¡¼¥É¤ò¸«¤ë¤À¤±¤Ç¤Ï) +.BR execve (2) +¤Î¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤·¤¿¤³¤È¤ò³Î¼Â¤ËÃΤ뤳¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sh (1), +.BR signal (2), +.BR wait (2), +.BR exec (3) diff --git a/release/man3/sysv_signal.3 b/release/man3/sysv_signal.3 new file mode 100644 index 00000000..73128ec5 --- /dev/null +++ b/release/man3/sysv_signal.3 @@ -0,0 +1,96 @@ +.\" 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 +.\" +.\"WORD: reliable ¿®ÍêÀ­¤Î¤¢¤ë +.\"WORD: unreliable ¿®ÍêÀ­¤Ë·ç¤±¤ë +.\"WORD: signal semantics ¥·¥°¥Ê¥ë½èÍýÊý¼° +.\" +.TH SYSV_SIGNAL 3 2007-05-04 "" "Linux Programmer's Manual" +.SH ̾Á° +sysv_signal \- System V Êý¼°¤Î¥·¥°¥Ê¥ë½èÍý +.SH ½ñ¼° +.B #define _GNU_SOURCE +.br +.B #include +.sp +.B typedef void (*sighandler_t)(int); +.sp +.BI "sighandler_t sysv_signal(int " signum ", sighandler_t " handler ); +.SH ÀâÌÀ +.BR sysv_signal () +´Ø¿ô¤Ï +.BR signal (2) +¤ÈƱ¤¸°ú¤­¿ô¤ò¤È¤ê¡¢Æ±¤¸½èÍý¤ò¼Â¹Ô¤¹¤ë¡£ + +¤·¤«¤·¤Ê¤¬¤é¡¢ +.BR sysv_signal () +¤Ï System V ¤Î¿®ÍêÀ­¤Ë·ç¤±¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤òÄ󶡤·¤Æ¤¤¤ë¡£ +¿®ÍêÀ­¤Ë·ç¤±¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤Ï°Ê²¼¤ÎÆÃħ¤ò»ý¤Ä¡£ +a) ¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤ë¤È¡¢¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡ (disposition) ¤¬ +¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡¢ +b) ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¡¢¤½¤ì°Ê¹ß¤ËȯÀ¸¤·¤¿Æ±¤¸¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤¬ +¥Ö¥í¥Ã¥¯¤µ¤ì¤Ê¤¤¡¢ +c) ¥Ï¥ó¥É¥é¤¬Ää»ßÃæ¤Î (blocking ¤·¤Æ¤¤¤ë) ¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÃæÃǤ·¤¿¾ì¹ç¡¢ +¼«Æ°Åª¤ËºÆ³«¤µ¤ì¤Ê¤¤¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR sysv_signal () +´Ø¿ô¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎľÁ°¤ÎÃͤòÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.B SIG_ERR +¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.BR signal (2) +¤ÈƱ¤¸¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR sysv_signal () +¤Î»ÈÍѤÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£Âå¤ï¤ê¤Ë +.BR sigaction (2) +¤ò»È¤¦¤³¤È¡£ + +°ÊÁ°¤Î Linux ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR sysv_signal () +¤È +.BR signal (2) +¤ÏÅù²Á¤Ç¤¢¤Ã¤¿¡£¤·¤«¤·¡¢¿·¤·¤á¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BR signal (2) +¤Ï¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤òÄ󶡤·¤Æ¤¤¤ë¡£ +¾ÜºÙ¤Ï +.BR signal (2) +¤ò»²¾È¡£ + +.I sighandler_t +¤ò»È¤Ã¤Æ¤¤¤ë¤Î¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +¤³¤Î·¿¤Ïµ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _GNU_SOURCE +¤òÄêµÁ¤·¤¿¾ì¹ç¤Ë¤Î¤ßÄêµÁ¤µ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sigaction (2), +.BR signal (2), +.BR bsd_signal (3), +.BR feature_test_macros (7), +.BR signal (7) diff --git a/release/man3/tan.3 b/release/man3/tan.3 new file mode 100644 index 00000000..96c07638 --- /dev/null +++ b/release/man3/tan.3 @@ -0,0 +1,140 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +tan, tanf, tanl \- ÀµÀÜ¡Ê¥¿¥ó¥¸¥§¥ó¥È¡Ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double tan(double " x ); +.br +.BI "float tanf(float " x ); +.br +.BI "long double tanl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR tanf (), +.BR tanl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR tan () +´Ø¿ô¤Ï \fIx\fP ¤ÎÀµÀÜ¡Ê¥¿¥ó¥¸¥§¥ó¥È¡Ë¤ÎÃͤòÊÖ¤¹¡£ +\fIx\fP ¤Ï¥é¥¸¥¢¥óñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÀµÀÜ (¥¿¥ó¥¸¥§¥ó¥È) ¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ +Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (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. +.\" Testing certainly seems to bear this out. -- mtk, Jul 08 +.\" +.\" POSIX.1 allows an optional underflow error; +.\" glibc 2.8 doesn't do this +.\" POSIX.1 an optional range error for subnormal x; +.\" glibc 2.8 doesn't do this +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤Ï̵¸ÂÂç¤Ç¤¢¤ë +.\" .I errno +.\" is set to +.\" .BR EDOM . +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.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 . +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I errno +¤òÀßÄꤷ¤Ê¤¤¡£ +.\" FIXME . Is it intentional that these functions do not set +.\" errno (at least for domain error)? +.\" Bug raised: http://sourceware.org/bugzilla/show_bug.cgi?id=6782 +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR acos (3), +.BR asin (3), +.BR atan (3), +.BR atan2 (3), +.BR cos (3), +.BR ctan (3), +.BR sin (3) diff --git a/release/man3/tanh.3 b/release/man3/tanh.3 new file mode 100644 index 00000000..6ad5f591 --- /dev/null +++ b/release/man3/tanh.3 @@ -0,0 +1,104 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 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) +.\" +.\" 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 2008-08-05 "" "Linux Programmer's Manual" +.SH ̾Á° +tanh, tanhf, tanhl \- ÁжÊÀþÀµÀÜ (hyperbolic tangent) ´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double tanh(double " x ); +.br +.BI "float tanhf(float " x ); +.br +.BI "long double tanhl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR tanhf (), +.BR tanhl (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR tanh () +´Ø¿ô¤Ï \fIx\fP ¤ÎÁжÊÀþÀµÀÜ (hyperbolic tangent) ´Ø¿ô¤òÊÖ¤¹¡£ +¿ô³ØŪ¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡¥ +.nf + + tanh(x) = sinh(x) / cosh(x) +.fi +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ÎÁжÊÀþÀµÀܤòÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬ +0 (\-0) ¤Î¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç (Éé¤Î̵¸ÂÂç) ¤Î¾ì¹ç¡¢+1 (\-1) ¤¬ÊÖ¤µ¤ì¤ë¡£ +.\" +.\" POSIX.1-2001 documents an optional range error (underflow) +.\" for subnormal x; +.\" glibc 2.8 does not do this. +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.SH ½àµò +C99, POSIX.1-2001. +.I double +ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR acosh (3), +.BR asinh (3), +.BR atanh (3), +.BR cosh (3), +.BR ctanh (3), +.BR sinh (3) diff --git a/release/man3/tcgetpgrp.3 b/release/man3/tcgetpgrp.3 new file mode 100644 index 00000000..e3bf477d --- /dev/null +++ b/release/man3/tcgetpgrp.3 @@ -0,0 +1,129 @@ +.\" Copyright (C) 2002 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) 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" +.SH ̾Á° +tcgetpgrp, tcsetpgrp \- üËö¤Î¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Î +¼èÆÀ/ÀßÄê¤ò¹Ô¤¦ +.SH ½ñ¼° +.B "#include " +.sp +.BI "pid_t tcgetpgrp(int " fd ); +.sp +.BI "int tcsetpgrp(int " fd ", pid_t " pgrp ); +.SH ÀâÌÀ +´Ø¿ô +.BR tcgetpgrp () +¤Ï¡¢ +.I fd +¤ËÂбþ¤¹¤ëüËö¤Î¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Î +¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× ID ¤òÊÖ¤¹¡£ +.I fd +¤Ç»ØÄꤵ¤ì¤¿Ã¼Ëö¤Ï¡¢¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" ¥×¥í¥»¥¹¼«ÂΤϥХ寥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¡£ +.LP +´Ø¿ô +.BR tcsetpgrp () +¤Ï¡¢¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×ID ¤¬ \fIpgrp\fP ¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ò +.I fd +¤ËÂбþ¤¹¤ëüËö¤Î¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Ë¤¹¤ë¡£ +¤³¤Î¤È¤­¡¢ +.I fd +¤Ï +.BR tcsetpgrp () +¤ò¸Æ¤Ó½Ð¤¹¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤µ¤é¤Ë¡¢ \fIpgrp\fP ¤Ï¡¢¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦¥×¥í¥»¥¹¤ÈƱ¤¸¥»¥Ã¥·¥ç¥ó¤Ë +°¤¹¤ë (¥á¥ó¥Ð¤¬¶õ¤Ç¤Ê¤¤) ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.LP +.BR tcsetpgrp () +¤¬¥»¥Ã¥·¥ç¥ó¤Ë°¤¹¤ë¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¡¦¥°¥ë¡¼¥×¡¦¥×¥í¥»¥¹¤Î¥á¥ó¥Ð¤«¤é +¸Æ¤Ó½Ð¤µ¤ì¡¢¤«¤Ä¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦¥×¥í¥»¥¹¤¬ +.B SIGTTOU +¤ò¥Ö¥í¥Ã¥¯¤·¤¿¤ê +̵»ë¤·¤¿¤ê¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.B SIGTTOU +¥·¥°¥Ê¥ë¤Ï +¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ÎÁ´¤Æ¤Î¥á¥ó¥Ð¤ËÁ÷¤é¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.I fd +¤¬¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ã¤¿¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢´Ø¿ô +.BR tcgetpgrp () +¤Ï¡¢¤½¤ÎÀ©¸æüËö¤Î¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤¬¤¢¤ì¤Ð +¤½¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Î ID ¤òÊÖ¤¹¡£ +¤½¤Î¤è¤¦¤Ê¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤¬¤Ê¤±¤ì¤Ð¡¢¸½ºß¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× ID +¤È¤·¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¡¢1¤è¤êÂ礭¤Ê²¿¤é¤«¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +.I fd +¤¬¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ã¤¿¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +\-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.LP +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR tcsetpgrp () +¤Ï 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢ \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤ÏÍ­¸ú¤Ê¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +.I pgrp +¤¬Ìµ¸ú¤ÊÃͤǤ¢¤ë¡£ +.TP +.B ENOTTY +¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ã¤¿¥×¥í¥»¥¹¤¬À©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡¢¤â¤·¤¯¤Ï +À©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤ë¤¬ +.I fd +¤Ç»²¾È¤µ¤ì¤ë¤â¤Î¤È¤Ï°Û¤Ê¤ë¡¢ +.BR tcsetpgrp () +¤Î¾ì¹ç¤Ï¡¢ +.I fd +¤Ç»ØÄꤵ¤ì¤¿À©¸æüËö¤¬¤¹¤Ç¤Ë¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ã¤¿¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó +¤È´Ø·¸¤Î¤Ê¤¤¤â¤Î¤Ë¤Ê¤Ã¤Æ¤¤¤ëºÝ¤Ë¤â¡¢¤³¤Î¥¨¥é¡¼¤È¤Ê¤ë¡£ +.TP +.B EPERM +.I pgrp +¤¬Í­¸ú¤ÊÃͤÀ¤¬¡¢¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ã¤¿¥×¥í¥»¥¹¤ÈƱ¤¸¥»¥Ã¥·¥ç¥ó¤Ë°¤¹¤ë +¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥× ID ¤Ë¤Ï³ºÅö¤¹¤ë¤â¤Î¤¬¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +¤³¤Î´Ø¿ô¤Ï +.B TIOCGPGRP +¤È +.B TIOCGSID +¤Î ioctl ·Ðͳ¤Ç¼Â¸½¤µ¤ì¤Æ¤¤¤ë¡£ +.SS Îò»Ë +¤³¤ì¤é¤Î ioctl ¤Ï 4.2BSD ¤ÇÅо줷¤¿¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï POSIX ¤Ç¹Í°Æ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR setpgid (2), +.BR setsid (2), +.BR credentials (7) diff --git a/release/man3/tcgetsid.3 b/release/man3/tcgetsid.3 new file mode 100644 index 00000000..7236e8ca --- /dev/null +++ b/release/man3/tcgetsid.3 @@ -0,0 +1,77 @@ +.\" Copyright (C) 2002 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) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Sat Jul 19 03:06:35 JST 2003 +.\" by Akihiro MOTOKI +.\" +.TH TCGETSID 3 2008-06-14 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +tcgetsid \- ¥»¥Ã¥·¥ç¥óID ¤ò¼èÆÀ¤¹¤ë +.SH ½ñ¼° +.B #define _XOPEN_SOURCE 500 +.br +.B "#include " +.sp +.BI "pid_t tcgetsid(int " fd ); +.SH ÀâÌÀ +´Ø¿ô +.BR tcgetsid () +¤Ï¡¢À©¸æüËö¤È¤·¤Æ +.I fd +¤ËÂбþ¤¹¤ëüËö¤ò»ý¤Ä¥«¥ì¥ó¥È¡¦¥»¥Ã¥·¥ç¥ó¤Î¥»¥Ã¥·¥ç¥óID ¤òÊÖ¤¹¡£ +¤³¤ÎüËö¤Ï \fBtcgetsid\fR() ¤Î¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤Ç +¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.I fd +¤¬¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ã¤¿¥»¥Ã¥·¥ç¥ó¤ÎÀ©¸æüËö¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +´Ø¿ô +.BR tcgetsid () +¤Ï¤³¤Î¥»¥Ã¥·¥ç¥ó¤Î¥»¥Ã¥·¥ç¥óID ¤òÊÖ¤¹¡£ +¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢ \-1 ¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +.I fd +¤ÏÍ­¸ú¤Ê¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Ç¤Ê¤¤¡£ +.TP +.B ENOTTY +¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ã¤¿¥×¥í¥»¥¹¤¬À©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡¢¤â¤·¤¯¤Ï +À©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤ë¤¬ +.I fd +¤Ç»²¾È¤µ¤ì¤ë¤â¤Î¤È¤Ï°Û¤Ê¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR tcgetsid () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +¤³¤Î´Ø¿ô¤Ï +.B TIOCGSID +.BR ioctl (2) +·Ðͳ¤Ç¼Â¸½¤µ¤ì¤Æ¤ª¤ê¡¢ +Linux 2.1.71 °Ê¹ß¤Ç¸ºß¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getsid (2) diff --git a/release/man3/telldir.3 b/release/man3/telldir.3 new file mode 100644 index 00000000..5483d3ba --- /dev/null +++ b/release/man3/telldir.3 @@ -0,0 +1,88 @@ +.\" 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 +.\" 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 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 +.\" +.TH TELLDIR 3 2009-03-11 "" "Linux Programmer's Manual" +.SH ̾Á° +telldir \- ¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥àÃæ¤Î¸½ºß°ÌÃÖ¤òÊÖ¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "long telldir(DIR *" dirp ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR telldir (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.SH ÀâÌÀ +.BR telldir () +´Ø¿ô¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à \fIdirp\fP ¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤¿ +¸½ºß°ÌÃÖ¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR telldir () +´Ø¿ô¤Ï¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥àÃæ¤Î¸½ºß°ÌÃÖ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +¥Ç¥£¥ì¥¯¥È¥ê¥¹¥È¥ê¡¼¥à¥Ç¥£¥¹¥¯¥ê¥×¥¿ \fIdirp\fP ¤¬Ìµ¸ú¤Ç¤¢¤ë¡£ +.SH ½àµò +4.3BSD, POSIX.1-2001. +.SH Ãí°Õ +¥Ð¡¼¥¸¥ç¥ó 2.1.1 °ÊÁ°¤Î glibc ¤Ç¤Ï¡¢ +.BR telldir ()9 +¤ÎÊÖ¤êÃͤη¿¤Ï +.I off_t +¤Ç¤¢¤Ã¤¿¡£ +POSIX.1-2001 ¤Ç¤Ï +.I long +¤Èµ¬Äꤵ¤ì¤Æ¤ª¤ê¡¢glibc 2.1.2 °Ê¹ß¤Ç¤Ï +.I long +¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR closedir (3), +.BR opendir (3), +.BR readdir (3), +.BR rewinddir (3), +.BR scandir (3), +.BR seekdir (3) diff --git a/release/man3/tempnam.3 b/release/man3/tempnam.3 new file mode 100644 index 00000000..bbbfc1b2 --- /dev/null +++ b/release/man3/tempnam.3 @@ -0,0 +1,185 @@ +.\" Copyright (c) 1999 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. +.\" +.\" Japanese Version Copyright (c) 1997-2000 Kazuyuki Tanisako and NAKANO Takeo +.\" all rights reserved. +.\" Translated 1997-05-17, Kazuyuki Tanisako +.\" Modified 1997-05-27, Kazuyuki Tanisako +.\" Modified 1998-02-04, Kazuyuki Tanisako +.\" Updated and Modified 2000-10-12, NAKANO Takeo +.\" Updated 2006-04-14, Akihiro MOTOKI , LDP v2.29 +.\" Updated 2006-07-26, Akihiro MOTOKI , LDP v2.36 +.\" +.\"WORD: temporary file ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë +.\"WORD: filename ¥Õ¥¡¥¤¥ë̾ +.\"WORD: function ´Ø¿ô +.\"WORD: directory ¥Ç¥£¥ì¥¯¥È¥ê +.\"WORD: environment variable ´Ä¶­ÊÑ¿ô +.\"WORD: argument °ú¤­¿ô +.\"WORD: storage ÊݸÎΰè +.\"WORD: pointer ¥Ý¥¤¥ó¥¿¡¼ +.\" +.TH TEMPNAM 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +tempnam \- ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤Î̾Á°¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *tempnam(const char *" dir ", const char *" pfx ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR tempnam (): +_BSD_SOURCE || _SVID_SOURCE +.SH ÀâÌÀ +.BR tempnam () +´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë̾¤È¤·¤ÆÀµ¤·¤¤Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +¤³¤Î¥Õ¥¡¥¤¥ë̾¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤Ï¡¢ +.BR tempnam () +¤¬¥Á¥§¥Ã¥¯¤·¤¿»þÅÀ¤Ë¤ª¤¤¤Æ¤Ï¸ºß¤·¤Ê¤¤ (¤·¤Ê¤«¤Ã¤¿)¡£ +.I pfx +¤¬ NULL ¤Ç¤Ê¤¤ 5 ¥Ð¥¤¥È°ÊÆâ¤Îʸ»úÎó¤Ç¤¢¤ì¤Ð¡¢ +À¸À®¤µ¤ì¤ë¥Ñ¥¹Ì¾¤Î¤¦¤Á¤Î¥Õ¥¡¥¤¥ë̾¤ÎÉôʬ¤Ï +.I pfx +¤«¤é»Ï¤Þ¤ë¤â¤Î¤Ë¤Ê¤ë¡£ +À¸À®¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÎÉôʬ¤Ï¡¢¡ÖŬÀڡפǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(ÂçÄñ¤Î¾ì¹ç¡¢¡ÖŬÀڡפǤ¢¤ë¤¿¤á¤Ë¤Ï¤Þ¤º¾¯¤Ê¤¯¤È¤â +½ñ¤­¹þ¤ß²Äǽ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ + +ŬÀڤʥǥ£¥ì¥¯¥È¥ê¤Îõº÷¤Ï¡¢°Ê²¼¤Î¼ê½ç¤Ë¤·¤¿¤¬¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +.TP 3 +a) +´Ä¶­ÊÑ¿ô +.B TMPDIR +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +¤½¤ÎÆâÍƤ¬Å¬Àڤʥǥ£¥ì¥¯¥È¥ê¤Î̾Á°¤Ê¤é¡¢¤½¤ì¤òÍѤ¤¤ë¡£ +.TP +b) +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.I dir +°ú¤­¿ô¤¬ NULL ¤Ç¤Ê¤¤Ê¸»úÎó¤Ç¤«¤ÄŬÀڤʤ顢¤½¤ì¤òÍѤ¤¤ë¡£ +.TP +c) +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.RI ( +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë) +.I P_tmpdir +¤¬Å¬Àڤʤ顢¤½¤ì¤òÍѤ¤¤ë¡£ +.TP +d) +ºÇ¸å¤Ë¼ÂÁõ¤ÇÄêµÁ¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬ÍѤ¤¤é¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.PP +.BR tempnam () +¤¬ÊÖ¤¹Ê¸»úÎó¤Ï +.BR malloc (3) +¤ò»È¤Ã¤Æ³ÎÊݤµ¤ì¤ë¡£¤½¤Î¤¿¤á¡¢ +.BR free (3) +¤Ç²òÊü¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR tempnam () +´Ø¿ô¤Ï¾¤È½Å¤Ê¤é¤Ê¤¤¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë̾¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¾¤È½Å¤Ê¤é¤Ê¤¤Ì¾Á°¤¬À¸À®¤Ç¤­¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +ÊݸÎΰè¤Î³ä¤êÅö¤Æ¤Ë¼ºÇÔ¤·¤¿¡£ +.SH ½àµò +SVr4, 4.3BSD, POSIX.1-2001. +POSIX.1-2008 ¤Ï +.BR tempnam () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.BR tempnam () +¤Ï¿ä¬¤¬Æñ¤·¤¤Ì¾Á°¤òÀ¸À®¤¹¤ë¤¬¡¢¤½¤ì¤Ë¤â¤«¤«¤ï¤é¤º¡¢ +.BR tempnam () +¤¬¥Ñ¥¹Ì¾¤òÊÖ¤·¤Æ¤«¤é¡¢¥×¥í¥°¥é¥à¤¬¤½¤Î¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë +¤Þ¤Ç¤Î´Ö¤Ë¡¢ÊÌ¤Î¥×¥í¥°¥é¥à¤¬Æ±¤¸¥Ñ¥¹Ì¾¤Ç¡¢¥Õ¥¡¥¤¥ë¤ò +.BR open (2) +¤ÇºîÀ®¤·¤¿¤ê¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤·¤¿¤ê¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤³¤ì¤Ï¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤Ë¤Ä¤Ê¤¬¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤½¤Î¤è¤¦¤Ê²ÄǽÀ­¤ò²óÈò¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.BR open (2) +¤Î +.B O_EXCL +¥Õ¥é¥°¤ò»È¤Ã¤Æ¥Ñ¥¹Ì¾¤ò¥ª¡¼¥×¥ó¤¹¤ì¤Ð¤è¤¤¡£ +¤â¤Ã¤È¤¤¤¤¤Î¤Ï¡¢ +.BR mkstemp (3) +¤ä +.BR tmpfile (3) +¤ò»È¤¦¤³¤È¤Ç¤¢¤ë¡£ + +SUSv2 ¤Ç¤Ï +.B TMPDIR +¤ËÉÕ¤¤¤Æ¸ÀµÚ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +glibc ¤Ï¡¢¥×¥í¥°¥é¥à¤¬ set-user-ID ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¸Â¤Ã¤Æ¤³¤ì¤òÍѤ¤¤ë¡£ +SVr4 ¤Ç¤Ï \fBd)\fP ¤Ç»ÈÍѤµ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò +.I /tmp +¤ÈÄê¤á¤Æ¤¤¤ë (glibc ¤â¤³¤ÎÄ̤ê¤Ç¤¢¤ë)¡£ +.LP +¥Ñ¥¹Ì¾¤òÊÖ¤¹¤Î¤Ë»ÈÍѤ¹¤ë¥á¥â¥ê¤òưŪ¤Ë³ÎÊݤ¹¤ë¤Î¤Ç¡¢ +.BR tmpnam (3) +¤È°ã¤¤¡¢ +.BR tempnam () +¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤¢¤ê¡¢¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤¢¤ë¡£ +.LP +.BR tempnam () +´Ø¿ô¤ÏºÇÂç +.B TMP_MAX +²ó¤Þ¤Ç¡¢¸Æ¤Ó½Ð¤µ¤ì¤ëÅ٤˰ۤʤëʸ»úÎó¤òºîÀ®¤¹¤ë +.RB ( TMP_MAX +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +¤â¤· +.B TMP_MAX +²ó°Ê¾å¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢Æ°ºî¤Ï¼ÂÁõ°Í¸¤Ç¤¢¤ë¡£ +.LP +.BR tempnam () +¤ÏºÇÂç¤Ç +.I pfx +¤ÎÀèƬ 5 ¥Ð¥¤¥È¤ò»ÈÍѤ¹¤ë¡£ + +¾¤È½Å¤Ê¤é¤Ê¤¤Ì¾Á°¤¬¸«¤Ä¤±¤é¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢glibc ¤Î +.BR tempnam () +¤Î¼ÂÁõ¤Ï¥¨¥é¡¼ +.B EEXIST +¤Ç¼ºÇÔ¤¹¤ë¡£ +.SH ¥Ð¥° +¡ÖŬÀڡפȤ¤¤¦¸ÀÍÕ¤ÎÀµ³Î¤Ê°ÕÌ£¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ¤É¤ÎÄøÅ٤Υ¢¥¯¥»¥¹¸¢¸Â¤¬É¬ÍפʤΤ«¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ + +·è¤·¤Æ¤³¤Î´Ø¿ô¤ò»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£Âå¤ï¤ê¤Ë +.BR mkstemp (3) +¤« +.BR tmpfile (3) +¤ò»È¤¦¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mkstemp (3), +.BR mktemp (3), +.BR tmpfile (3), +.BR tmpnam (3) diff --git a/release/man3/termios.3 b/release/man3/termios.3 new file mode 100644 index 00000000..d14319cd --- /dev/null +++ b/release/man3/termios.3 @@ -0,0 +1,950 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de) +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 1993-07-24 by Rik Faith +.\" Modified 1995-02-25 by Jim Van Zandt +.\" Modified 1995-09-02 by Jim Van Zandt +.\" moved to man3, aeb, 950919 +.\" Modified 2001-09-22 by Michael Kerrisk +.\" Modified 2001-12-17, aeb +.\" Modified 2004-10-31, aeb +.\" 2006-12-28, mtk: +.\" Added .SS headers to give some structure to this page; and a +.\" small amount of reordering. +.\" Added a section on canonical and noncanonical mode. +.\" Enhanced the discussion of "raw" mode for cfmakeraw(). +.\" Document CMSPAR. +.\" +.\" Japanese Version Copyright (c) 1998-1999 +.\" Michihide Hotta and NAKANO Takeo all rights reserved. +.\" Translated 1998-02-02, Michihide Hotta +.\" Updated 1999-03-14, NAKANO Takeo +.\" Updated 2001-02-17, Kentaro Shirakata +.\" Updated 2001-10-16, Kentaro Shirakata +.\" Updated 2002-01-04, Kentaro Shirakata +.\" Updated 2003-09-01, Kentaro Shirakata +.\" Updated 2006-07-26, Akihiro MOTOKI , LDP v2.36 +.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 +.\" Updated 2007-09-06, Akihiro MOTOKI, LDP v2.64 +.\" +.\"WORD: carriage return Éüµ¢(ʸ»ú) +.\"WORD: new line ²þ¹Ô(ʸ»ú) +.\"WORD: fill character ÊäŶʸ»ú +.\"WORD: horizontal tab ¿åÊ¿¥¿¥Ö +.\"WORD: backspace ¸åÂà(ʸ»ú) +.\"WORD: vertical tab ¿âľ¥¿¥Ö +.\"WORD: feature test macro µ¡Ç½¸¡ºº¥Þ¥¯¥í +.\" +.TH TERMIOS 3 2007-11-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +termios, tcgetattr, tcsetattr, tcsendbreak, tcdrain, tcflush, tcflow, +cfmakeraw, cfgetospeed, cfgetispeed, cfsetispeed, cfsetospeed, cfsetspeed \- +¥¿¡¼¥ß¥Ê¥ë°À­¤Î¼èÆÀ¡¦ÀßÄê¡¢¥é¥¤¥óÀ©¸æ¡¢¥Ü¡¼¥ì¡¼¥È¤Î¼èÆÀ¡¦ÀßÄê +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "int tcgetattr(int " fd ", struct termios *" termios_p ); +.sp +.BI "int tcsetattr(int " fd ", int " optional_actions , +.BI " const struct termios *" termios_p ); +.sp +.BI "int tcsendbreak(int " fd ", int " duration ); +.sp +.BI "int tcdrain(int " fd ); +.sp +.BI "int tcflush(int " fd ", int " queue_selector ); +.sp +.BI "int tcflow(int " fd ", int " action ); +.sp +.BI "void cfmakeraw(struct termios *" termios_p ); +.sp +.BI "speed_t cfgetispeed(const struct termios *" termios_p ); +.sp +.BI "speed_t cfgetospeed(const struct termios *" termios_p ); +.sp +.BI "int cfsetispeed(struct termios *" termios_p ", speed_t " speed ); +.sp +.BI "int cfsetospeed(struct termios *" termios_p ", speed_t " speed ); +.sp +.BI "int cfsetspeed(struct termios *" termios_p ", speed_t " speed ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR cfsetspeed (), +.BR cfmakeraw (): +_BSD_SOURCE +.SH ÀâÌÀ +termios ´Ø¿ô·²¤Ï¡¢ÈóƱ´üÄÌ¿®¥Ý¡¼¥È¤òÀ©¸æ¤¹¤ë¤¿¤á¤ÎÈÆÍÑ +¥¿¡¼¥ß¥Ê¥ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ +.SS "termios ¹½Â¤ÂÎ" +.LP +¤³¤³¤Ë¼¨¤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤Î¿¤¯¤Ï¡¢°ú¤­¿ô¤Ë \fItermios_p\fP ¤òÍѤ¤¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ï \fItermios\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£ +¤³¤Î¹½Â¤ÂΤˤϾ¯¤Ê¤¯¤È¤â°Ê²¼¤Ë¼¨¤¹¥á¥ó¥Ð¤¬´Þ¤Þ¤ì¤ë: +.sp +.in +4n +.nf +tcflag_t c_iflag; /* input modes */ +tcflag_t c_oflag; /* output modes */ +tcflag_t c_cflag; /* control modes */ +tcflag_t c_lflag; /* local modes */ +cc_t c_cc[NCCS]; /* control chars */ +.fi +.in +.PP +°Ê²¼¤Ë¡¢¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ë³ä¤êÅö¤Æ²Äǽ¤ÊÃͤˤĤ¤¤ÆÀâÌÀ¤¹¤ë¡£ +ºÇ½é¤Î 4 ¤Ä¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¥Õ¥£¡¼¥ë¥É¤Ç¤Ï¡¢ +´Ø·¸¤¹¤ë¥Õ¥é¥°¤ÎÄêµÁ¤Î¤¤¤¯¤Ä¤«¤Ï¡¢ÆÃÄê¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í +.RB ( feature_test_macros (7) +»²¾È) ¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë¤Î¤ß¸ø³«¤µ¤ì¤ë¡£ +ɬÍפʵ¡Ç½¸¡ºº¥Þ¥¯¥í¤Ï³Ñ³ç¸Ì ("[]") Æâ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.PP +°Ê²¼¤ÎÀâÌÀ¤Ç¡¢ "POSIX ¤Ë¤Ï¤Ê¤¤" ¤Ï +¤½¤ÎÃͤ¬ POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò°ÕÌ£¤·¡¢ +"XSI" ¤Ï¤½¤ÎÃͤ¬ POSIX.1-2001 ¤Î XSI ³ÈÄ¥¤Ç +µ¬Äꤵ¤ì¤Æ¤¤¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.PP +\fIc_iflag\fP ¥Õ¥é¥°¤Ë¤Ï°Ê²¼¤ÎÍ×ÁǤò»ØÄê¤Ç¤­¤ë: +.TP +.B IGNBRK +ÆþÎÏÃæ¤Î BREAK ¿®¹æ¤ò̵»ë¤¹¤ë¡£ +.TP +.B BRKINT +\fBIGNBRK\fP ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢BREAK ¿®¹æ¤Ï̵»ë¤µ¤ì¤ë¡£ +\fBIGNBRK\fP ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢\fBBRKINT\fP ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +BREAK ¿®¹æ¤Ë¤è¤Ã¤ÆÆþ½ÐÎÏ¥­¥å¡¼¤¬¥Õ¥é¥Ã¥·¥å¤µ¤ì¡¢ +¤µ¤é¤Ë¡¢Ã¼Ëö¤¬¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÀ©¸æüËö¤Î¾ì¹ç¤Ï¡¢ +¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë \fBSIGINT\fP ¤¬Á÷¤é¤ì¤ë¡£ +\fBIGNBRK\fP ¤â \fBBRKINT\fP ¤âÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +BREAK ¤ò NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤È¤·¤ÆÆɤ߹þ¤à¡£ +¤¿¤À¤·¡¢\fBPARMRK\fP ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï \\377 \\0 \\0 ¤Î¥·¡¼¥±¥ó¥¹¤È¤·¤Æ +Æɤ߹þ¤à¡£ +.TP +.B IGNPAR +¥Õ¥ì¡¼¥à¥¨¥é¡¼¤ª¤è¤Ó¥Ñ¥ê¥Æ¥£¥¨¥é¡¼¤ò̵»ë¤¹¤ë¡£ +.TP +.B PARMRK +\fBIGNPAR\fP ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥Ñ¥ê¥Æ¥£¥¨¥é¡¼¤¢¤ë¤¤¤Ï¥Õ¥ì¡¼¥à¥¨¥é¡¼ +¤ÎȯÀ¸¤·¤¿Ê¸»ú¤ÎÁ°¤Ë \\377 \\0 ¤òÉղ乤롣\fBIGNPAR\fP ¤â \fBPARMRK\fP ¤â +ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥Ñ¥ê¥Æ¥£¥¨¥é¡¼¤¢¤ë¤¤¤Ï¥Õ¥ì¡¼¥à¥¨¥é¡¼¤ÎȯÀ¸¤·¤¿Ê¸»ú¤ò +\\0 ¤È¤·¤ÆÆɤ߹þ¤à¡£ +.TP +.B INPCK +ÆþÎϤΥѥê¥Æ¥£¥Á¥§¥Ã¥¯¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.B ISTRIP +8 ¥Ó¥Ã¥ÈÌܤòÍî¤È¤¹¡£ +.TP +.B INLCR +ÆþÎϤΠNL (New Line: ²þ¹Ôʸ»ú) ¤ò CR (Carriage Return: Éüµ¢Ê¸»ú) ¤Ë +ÃÖ¤­´¹¤¨¤ë¡£ +.TP +.B IGNCR +ÆþÎϤΠCR ¤ò̵»ë¤¹¤ë¡£ +.TP +.B ICRNL +(\fBIGNCR\fP ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç) ÆþÎϤΠCR ¤ò NL ¤ËÃÖ¤­´¹¤¨¤ë¡£ +.TP +.B IUCLC +(POSIX ¤Ë¤Ï¤Ê¤¤) ÆþÎϤÎÂçʸ»ú¤ò¾®Ê¸»ú¤ËÃÖ¤­´¹¤¨¤ë¡£ +.TP +.B IXON +½ÐÎϤΠXON/XOFF ¥Õ¥í¡¼À©¸æ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.B IXANY +(XSI) Ǥ°Õ¤Îʸ»ú¤òÆþÎϤ¹¤ë¤È¡¢Ää»ß¤·¤Æ¤¤¤¿½ÐÎϤòºÆ³«¤¹¤ë +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢START ʸ»ú¤Ç¤Î¤ß½ÐÎϤ¬ºÆ³«¤µ¤ì¤ë)¡£ +.TP +.B IXOFF +ÆþÎϤΠXON/XOFF ¥Õ¥í¡¼À©¸æ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.B IMAXBEL +(POSIX ¤Ë¤Ï¤Ê¤¤) ÆþÎÏ¥­¥å¡¼¤¬°ìÇդλþ¤Ë¥Ù¥ë¤òÌĤ餹¡£ +Linux ¤Ç¤Ï¤³¤Î¥Ó¥Ã¥È¤Ï¼ÂÁõ¤µ¤ì¤Æ¤ª¤é¤º¡¢ +¾ï¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤«¤Î¤è¤¦¤Ë¿¶Éñ¤¦¡£ +.TP +.BR IUTF8 " (Linux 2.6.4 °Ê¹ß)" +(POSIX ¤Ë¤Ï¤Ê¤¤) ÆþÎϤ¬ UTF8 ¤Ç¤¢¤ë; +¤³¤ì¤Ë¤è¤ê cooked mode ¤Çʸ»úºï½ü (character-erase) ¤ò +Àµ¤·¤¯µ¡Ç½¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +POSIX.1 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë \fIc_oflag\fP ¥Õ¥é¥°¤ò°Ê²¼¤Ë¼¨¤¹: +.TP +.B OPOST +¼ÂÁõ¤Ë°Í¸¤·¤¿½ÐÎϽèÍý¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.PP +»Ä¤ê¤Î \fIc_oflag\fP ¥Õ¥é¥°¤Ï¡¢Æõ­¤Î¤Ê¤¤¸Â¤ê POSIX.1-2001 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B OLCUC +(POSIX ¤Ë¤Ï¤Ê¤¤) ½ÐÎÏ»þ¤Ë¾®Ê¸»ú¤òÂçʸ»ú¤ËÊÑ´¹¤¹¤ë¡£ +.TP +.B ONLCR +(XSI) ½ÐÎϤΠNL ¤ò CR-NL ¤ËÃÖ¤­´¹¤¨¤ë¡£ +.TP +.B OCRNL +½ÐÎϤΠCR ¤ò NL ¤ËÃÖ¤­´¹¤¨¤ë¡£ +.TP +.B ONOCR +0 ·åÌÜ¤Ç CR ¤ò½ÐÎϤ·¤Ê¤¤¡£ +.TP +.B ONLRET +CR ¤ò½ÐÎϤ·¤Ê¤¤¡£ +.TP +.B OFILL +žÁ÷»þ´Ö¤òÃ٤餻¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ÊäŶʸ»ú (fill character) ¤òÁ÷¤ë¡£ +(ÌõÃí:ÆÃÄê¤Îʸ»ú¤ËÂФ·¤Æ¡¢Ã¼Ëö¦¤Î½èÍý¤òÂԤĤ¿¤á¤ËžÁ÷¤ò°ìÄê»þ´Ö +Ã٤餻¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤Þ¤¿¡¢ \fBOFILL\fP ¤ò»ØÄꤹ¤ë¤È +žÁ÷¤òÃ٤餻¤ëÂå¤ï¤ê¤ËÊäŶʸ»ú¤òÁ÷¤ë¡£) +.TP +.B OFDEL +(POSIX ¤Ë¤Ï¤Ê¤¤) ÊäŶʸ»ú¤ò ASCII DEL ¤Ë¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï ASCII NUL (\(aq\\0\(aq) ¤Ë¤Ê¤ë¡£ +(Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +.TP +.B NLDLY +NL ¤ÎÃÙ±ä¤òÀßÄꤹ¤ë¡£ÃÍ¤Ï \fBNL0\fP (ÃÙ±ä¤Ê¤·) ¤ª¤è¤Ó \fBNL1\fP ¤Ç¤¢¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤« +.B _XOPEN_SOURCE +¤¬É¬Í×] +.TP +.B CRDLY +CR ¤ÎÃÙ±ä¤òÀßÄꤹ¤ë¡£ÃÍ¤Ï \fBCR0\fP (ÃÙ±ä¤Ê¤·), +\fBCR1\fP, \fBCR2\fP,\fBCR3\fP ¤Ç¤¢¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤« +.B _XOPEN_SOURCE +¤¬É¬Í×] +.TP +.B TABDLY +¿åÊ¿¥¿¥Ö (horizontal tab) ¤ÎÃÙ±ä¤òÀßÄꤹ¤ë¡£ +ÃÍ¤Ï \fBTAB0\fP (ÃÙ±ä¤Ê¤·), +\fBTAB1\fP, \fBTAB2\fP, \fBTAB3\fP (\fBXTABS\fP) ¤Ç¤¢¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤« +.B _XOPEN_SOURCE +¤¬É¬Í×] +XTAB3 (¤³¤ì¤Ï XTABS ¤ÈƱ¤¸¤Ç¤¢¤ë) ¤ÎÃͤϥ¿¥Ö¤ò¥¹¥Ú¡¼¥¹²¿¸Ä¤ËÊÑ´¹¤¹¤ë¤«¤ò¼¨¤¹ +(¥¿¥Ö¤Ï 8 ·åËè¤Ë»ß¤Þ¤ë)¡£ +.TP +.B BSDLY +¸åÂà (backspace) ¤ÎÃÙ±ä¤òÀßÄꤹ¤ë¡£ +ÃÍ¤Ï \fBBS0\fP (ÃÙ±ä¤Ê¤·) ¤¢¤ë¤¤¤Ï \fBBS1\fP ¤Ç¤¢¤ë¡£ +(¼ÂÁõ¤µ¤ì¤¿¤³¤È¤Ï¤Ê¤¤) +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤« +.B _XOPEN_SOURCE +¤¬É¬Í×] +.TP +.B VTDLY +¿âľ¥¿¥Ö (vertical tab) ¤ÎÃÙ±ä¤òÀßÄꤹ¤ë¡£ +ÃÍ¤Ï \fBVT0\fP (ÃÙ±ä¤Ê¤·) ¤¢¤ë¤¤¤Ï \fBVT1\fP ¤Ç¤¢¤ë¡£ +.TP +.B FFDLY +ÊÇÁ÷¤ê (form feed) ¤ÎÃÙ±ä¤òÀßÄꤹ¤ë¡£ +ÃÍ¤Ï \fBFF0\fP (ÃÙ±ä¤Ê¤·) ¤¢¤ë¤¤¤Ï \fBFF1\fP ¤Ç¤¢¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤« +.B _XOPEN_SOURCE +¤¬É¬Í×] +.PP +\fIc_cflag\fP ¥Õ¥é¥°¤Ï°Ê²¼¤ÎÄ̤ê: +.TP +.B CBAUD +(POSIX ¤Ë¤Ï¤Ê¤¤) ¥Ü¡¼¥ì¡¼¥È¥Þ¥¹¥¯ (4+1 ¥Ó¥Ã¥È)¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B CBAUDEX +(POSIX ¤Ë¤Ï¤Ê¤¤) ÄɲäΥܡ¼¥ì¡¼¥È¥Þ¥¹¥¯ (1 ¥Ó¥Ã¥È)¡£ +.B CBAUD +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.sp +(POSIX ¤Ç¤Ï¡¢ +.I termios +¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤¿¥Ü¡¼¥ì¡¼¥È¤ÏÀµ³Î¤Ê¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥Ü¡¼¥ì¡¼¥È¤òÁàºî¤¹¤ë¤¿¤á¤Ë +.BR cfgetispeed () +¤È +.BR cfsetispeed () +¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£ +.I c_cflag +Æâ¤Î +.B CBAUD +¤ÇÁªÂò¤µ¤ì¤¿¥Ó¥Ã¥È¤ò»È¤¦¥·¥¹¥Æ¥à¤â¤¢¤ì¤Ð¡¢ +.I sg_ispeed +¤ä +.I sg_ospeed +¤È¤¤¤Ã¤¿ÆÈΩ¤·¤¿¥Õ¥£¡¼¥ë¥É¤ò»È¤¦¤â¤Î¤â¤¢¤ë¡£) +.TP +.B CSIZE +ʸ»ú¥µ¥¤¥º¤òÀßÄꤹ¤ë¡£ +ÃÍ¤Ï \fBCS5\fP, \fBCS6\fP, \fBCS7\fP, \fBCS8\fP ¤Ç¤¢¤ë¡£ +.TP +.B CSTOPB +¥¹¥È¥Ã¥×¥Ó¥Ã¥È¤ò 1 ¤Ç¤Ï¤Ê¤¯ 2 ¤Ë¤¹¤ë¡£ +.TP +.B CREAD +¼õ¿®¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.B PARENB +½ÐÎϤ˥ѥê¥Æ¥£¤òÉղä·¡¢ÆþÎϤΥѥê¥Æ¥£¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¡£ +.TP +.B PARODD +ÀßÄꤵ¤ì¤ë¤È¡¢ÆþÎϤª¤è¤Ó½ÐÎϤËÂФ¹¤ë¥Ñ¥ê¥Æ¥£¤¬´ñ¿ô¥Ñ¥ê¥Æ¥£¤È¤Ê¤ë¡£ +ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢¶ö¿ô¥Ñ¥ê¥Æ¥£¤¬»ÈÍѤµ¤ì¤ë¡£ +.TP +.B HUPCL +ºÇ¸å¤Î¥×¥í¥»¥¹¤¬¥Ç¥Ð¥¤¥¹¤ò¥¯¥í¡¼¥º¤·¤¿¸å¡¢¥â¥Ç¥à¤ÎÀ©¸æÀþ¤ò low ¤Ë¤¹¤ë +(ÀÚÃǤ¹¤ë)¡£ +.TP +.B CLOCAL +¥â¥Ç¥à¤ÎÀ©¸æÀþ¤ò̵»ë¤¹¤ë¡£ +.TP +.B LOBLK +(POSIX ¤Ë¤Ï¤Ê¤¤) ¸½ºß¤Î¥·¥§¥ëÁذʳ°¤«¤é¤Î½ÐÎϤòÍÞÀ©¤¹¤ë¡£ + \fBshl\fP (¥·¥§¥ëÁØ) ¤ÇÍѤ¤¤é¤ì¤ë¡£(Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +.TP +.B CIBAUD +(POSIX ¤Ë¤Ï¤Ê¤¤) ÆþÎÏ®Å٤Υޥ¹¥¯¡£ +.B CIBAUD +¥Ó¥Ã¥È¤Î¤¿¤á¤ÎÃÍ¤Ï +.B CBAUD +¥Ó¥Ã¥È¤Î¤¿¤á¤ÎÃͤÈƱ¤¸¤Ç¤¢¤ê¡¢ +º¸¤Ë +.B IBSHIFT +¥Ó¥Ã¥È¥·¥Õ¥È¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +(Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +.TP +.B CMSPAR +(POSIX ¤Ë¤Ï¤Ê¤¤) +(°ìÉô¤Î¥·¥ê¥¢¥ë¥Ç¥Ð¥¤¥¹¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë) +¡Ö¥¹¥Æ¥£¥Ã¥¯ (stick)¡×¥Ñ¥ê¥Æ¥£ (¥Þ¡¼¥¯/¥¹¥Ú¡¼¥¹ ¥Ñ¥ê¥Æ¥£)¤ò»ÈÍѤ¹¤ë¡£ +.B PARODD +¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¥Ñ¥ê¥Æ¥£¥Ó¥Ã¥È¤Ï¾ï¤Ë 1 ¤È¤Ê¤ê¡¢ +ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¾ï¤Ë 0 ¤È¤Ê¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B CRTSCTS +(POSIX ¤Ë¤Ï¤Ê¤¤) RTS/CTS (¥Ï¡¼¥É¥¦¥§¥¢) ¥Õ¥í¡¼À©¸æ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.PP +\fIc_lflag\fP ¥Õ¥é¥°¤Ï°Ê²¼¤ÎÄ̤ê: +.TP +.B ISIG +INTR, QUIT, SUSP, DSUSP ¤Îʸ»ú¤ò¼õ¿®¤·¤¿»þ¡¢Âбþ¤¹¤ë¥·¥°¥Ê¥ë¤ò +ȯÀ¸¤µ¤»¤ë¡£ +.TP +.B ICANON +¥«¥Î¥Ë¥«¥ë¥â¡¼¥É¤òÍ­¸ú¤Ë¤¹¤ë (²¼µ­»²¾È)¡£ +.TP +.B XCASE +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤) +\fBICANON\fP ¤¬Æ±»þ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢Ã¼Ëö¤ÏÂçʸ»ú¤Î¤ß¤¬Í­¸ú¤Ç¤¢¤ë¡£ +ÆþÎϤµ¤ì¤¿Ê¸»ú¤Ï \\ ¤¬ÉÕ¤¤¤¿Ê¸»ú¤ò½ü¤¤¤Æ¾®Ê¸»ú¤ËÊÑ´¹¤µ¤ì¤ë¡£ +½ÐÎÏ»þ¤Ï¡¢Âçʸ»ú¤ÎÁ°¤Ë \\ ¤¬ÉÕ¤­¡¢¾®Ê¸»ú¤ÏÂçʸ»ú¤ËÊÑ´¹¤µ¤ì¤ë¡£ +.RB [ _BSD_SOURCE +¤¬ +.B _SVID_SOURCE +¤« +.B _XOPEN_SOURCE +¤¬É¬Í×] +.\" °Ê²¼¤Ï¤ª¤½¤é¤¯ glibc ¤Î´Ö°ã¤¤¤Ç¤¢¤í¤¦¡£ +.\" .B XCASE +.\" ¤ò¸ø³«¤¹¤ë¤Ë¤Ï +.\" .B _XOPEN_SOURCE +.\" ¤òÄêµÁ¤¹¤ë¤³¤È¡£ +.TP +.B ECHO +ÆþÎϤµ¤ì¤¿Ê¸»ú¤ò¥¨¥³¡¼¤¹¤ë¡£ +.TP +.B ECHOE +\fBICANON\fP ¤âƱ»þ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ERASE ʸ»ú¤ÏÁ°¤Îʸ»ú¤òºï½ü¤·¡¢ +WERASE ʸ»ú¤ÏÁ°¤Îñ¸ì¤òºï½ü¤¹¤ë¡£ +.TP +.B ECHOK +\fBICANON\fP ¤âƱ»þ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢KILL ʸ»ú¤Ï¸½ºß¤Î¹Ô¤òºï½ü¤¹¤ë¡£ +.TP +.B ECHONL +\fBICANON\fP ¤âƱ»þ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +ECHO ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤â NL ʸ»ú¤ò¥¨¥³¡¼¤¹¤ë¡£ +.TP +.B ECHOCTL +(POSIX ¤Ë¤Ï¤Ê¤¤) \fBECHO\fP ¤âƱ»þ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +TAB, NL, START, STOP ¤Î ASCII À©¸æʸ»ú¤¬ \fB^X\fP ¤È¤·¤Æ¥¨¥³¡¼¤µ¤ì¤ë¡£ +X ¤ÏÀ©¸æʸ»ú¤è¤ê ASCII ¥³¡¼¥É¤Ç 0x10 ¤À¤±Â礭¤Êʸ»ú¤Ç¤¢¤ë¡£ +Î㤨¤Ðʸ»ú 0x28 (BS) ¤Ï \fB^H\fP ¤È¥¨¥³¡¼¤µ¤ì¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B ECHOPRT +(POSIX ¤Ë¤Ï¤Ê¤¤) \fBICANON\fP ¤ª¤è¤Ó \fBIECHO\fP ¤¬Æ±»þ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +ºï½ü¤µ¤ì¤¿Ê¸»ú¤âɽ¼¨¤µ¤ì¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B ECHOKE +(POSIX ¤Ë¤Ï¤Ê¤¤) \fBICANON\fP ¤âÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +KILL ¤¬¹Ô¤Î³Æʸ»ú¤ò¾Ãµî¤¹¤ëÂå¤ï¤ê¤Ë¥¨¥³¡¼¤µ¤ì¤ë¡£ +¤³¤ì¤Ï \fBECHOE\fP ¤ª¤è¤Ó \fBECHOPRT\fP ¤ò»ØÄꤹ¤ë¤³¤È¤ÈÅù¤·¤¤¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B DEFECHO +(POSIX ¤Ë¤Ï¤Ê¤¤) ¥×¥í¥»¥¹¤¬Æɤ߹þ¤ó¤À¤È¤­¤Ë¤À¤±¥¨¥³¡¼¤¹¤ë¡£ +(Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +.TP +.B FLUSHO +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤) +½ÐÎϤò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£¤³¤Î¥Õ¥é¥°¤Ï DISCARD ʸ»ú¤òÆþÎϤ¹¤ë¤³¤È¤ÇÀÚÂؤ¨¤é¤ì¤ë¡£ +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B NOFLSH +.BR SIGINT , +.BR SIGQUIT , +.B SIGSUSP +¥·¥°¥Ê¥ëȯÀ¸»þ¤ÎÆþÎÏ¡¦½ÐÎÏ¥­¥å¡¼¤Î¥Õ¥é¥Ã¥·¥å¤ò̵¸ú¤Ë¤¹¤ë¡£ +.TP +.B TOSTOP +¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÇÀ©¸æüËö¤Ø +ʸ»ú¤ò½ÐÎϤ·¤è¤¦¤È¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤ËÂФ·¤Æ +.B SIGTTOU +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.TP +.B PENDIN +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤) +¼¡¤Îʸ»ú¤òÆɤ߹þ¤ó¤À»þ¡¢ÆþÎÏ¥­¥å¡¼Ãæ¤ÎÁ´Ê¸»ú¤òºÆɽ¼¨¤¹¤ë¡£ +.RB ( bash (1) +¤ÏÆþÎϹԤò¤³¤Î¤è¤¦¤Ë½èÍý¤·¤Æ¤¤¤ë¡£) +.RB [ _BSD_SOURCE +¤« +.B _SVID_SOURCE +¤¬É¬Í×] +.TP +.B IEXTEN +¼ÂÁõ°Í¸¤ÎÆþÎϽèÍý¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï¡¢Æüìʸ»ú¤Ç¤¢¤ë EOL2, LNEXT, REPRINT, WERASE ¤ä¡¢ +\fBIUCLC\fP ¥Õ¥é¥°¤òÍ­¸ú¤Ë¤¹¤ë¤¿¤á¤ËɬÍפǤ¢¤ë¡£ +.PP +\fIc_cc\fP ÇÛÎó¤ÏÆüì¤ÊÀ©¸æʸ»ú¤òÄêµÁ¤·¤Æ¤¤¤ë¡£ +¥·¥ó¥Ü¥ë¤Î°ìÍ÷ (½é´üÃÍ) ¤È°ÕÌ£¤Ï°Ê²¼¤ÎÄ̤ꡣ +.TP +.B VINTR +(003, ETX, Ctrl-C ¤« 0177, DEL, rubout) +³ä¤ê¹þ¤ßʸ»ú¡£ +.B SIGINT +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.B ISIG +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VQUIT +(034, FS, Ctrl-\e) +½ªÎ»Ê¸»ú¡£ +.B SIGQUIT +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.B ISIG +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VERASE +(0177, DEL, rubout ¤« 010, BS, Ctrl-H ¤« #) +¾Ãµîʸ»ú¡£¤³¤ì¤Ë¤è¤ê¡¢Ä¾Á°¤Î̤¾Ãµîʸ»ú¤ò¾Ãµî¤¹¤ë¡£ +¤·¤«¤·¡¢EOF ¤ä¹ÔƬ¤òĶ¤¨¤Æ¤Ï¾Ãµî¤·¤Ê¤¤¡£ +.B ICANON +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VKILL +(025, NAK, Ctrl-U ¤« Ctrl-X ¤« @) +´°Á´¾Ãµîʸ»ú¡£Ä¾Á°¤Î EOF ¤«¹ÔƬ°Ê¹ß¤ÎÁ´¤Æ¤ÎÆþÎϤò¾Ãµî¤¹¤ë¡£ +.B ICANON +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VEOF +(004, EOT, Ctrl-D) +¥Õ¥¡¥¤¥ë½ªÃ¼Ê¸»ú¡£ +¤è¤êÀµ³Î¤Ë¤Ï¡¢tty ¥Ð¥Ã¥Õ¥¡¤ÎÆâÍƤò¹ÔËö¤òÂÔ¤¿¤º¤Ë¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤ËÁ÷¤ë¡£ +¤³¤ì¤¬¹Ô¤ÎºÇ½é¤Îʸ»ú¤À¤Ã¤¿¾ì¹ç¡¢¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤Î +.BR read (2) +¤Ï 0 ¤ò +ÊÖ¤·¡¢¥Õ¥¡¥¤¥ë½ªÃ¼¤Ç¤¢¤ë¤³¤È¤òÃΤ餻¤ë¡£ +.B ICANON +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VMIN +È󥫥Υ˥«¥ëÆɤ߹þ¤ß»þ¤ÎºÇ¾®Ê¸»ú¿ô¡£ +.TP +.B VEOL +(0, NUL) +ÄɲäιÔËöʸ»ú¡£ +.B ICANON +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤¹¤ë¡£ +.TP +.B VTIME +È󥫥Υ˥«¥ëÆɤ߹þ¤ß»þ¤Î¥¿¥¤¥à¥¢¥¦¥È»þ´Ö (1/10 ÉÃñ°Ì)¡£ +.TP +.B VEOL2 +(POSIX ¤Ë¤Ï¤Ê¤¤; 0, NUL) +ÄɲäιÔËöʸ»ú¡£ +.B ICANON +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤¹¤ë¡£ +.TP +.B VSWTCH +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤; 0, NUL) +¥¹¥¤¥Ã¥Áʸ»ú (\fBshl\fP ¤Ç¤Î¤ßÍѤ¤¤é¤ì¤ë)¡£ +.TP +.B VSTART +(021, DC1, Ctrl-Q) +³«»Ïʸ»ú¡£Ää»ßʸ»ú¤ÇÄä»ß¤·¤¿½ÐÎϤòºÆ³«¤¹¤ë¡£ +.B IXON +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VSTOP +(023, DC3, Ctrl-S) +Ää»ßʸ»ú¡£³«»Ïʸ»ú¤¬ÆþÎϤµ¤ì¤ë¤Þ¤Ç½ÐÎϤòÄä»ß¤¹¤ë¡£ +.B IXON +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VSUSP +(032, SUB, Ctrl-Z) +ÃæÃÇʸ»ú¡£ +.B SIGTSTP +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.B ISIG +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VDSUSP +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤; 031, EM, Ctrl-Y) +ÃÙ±äÃæÃÇʸ»ú¡£¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤«¤éʸ»ú¤¬Æɤ߹þ¤Þ¤ì¤¿»þ¤Ë +.B SIGTSTP +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.B IEXTEN +¤È +.B ISIG +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Æ¡¢¥·¥¹¥Æ¥à¤¬¥¸¥ç¥ÖÀ©¸æ¤ËÂбþ¤·¤Æ¤¤¤ë¾ì¹ç¤Ë +ǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VLNEXT +(POSIX ¤Ë¤Ï¤Ê¤¤; 026, SYN Ctrl-V) +¥ê¥Æ¥é¥ë¡£¼¡¤ÎÆþÎÏʸ»ú¤ò¥¨¥¹¥±¡¼¥×¤·¡¢ÆÃÊ̤ʰÕÌ£¤¬¤¢¤Ã¤Æ¤â²ò¼á¤·¤Ê¤¤¡£ +.B IEXTEN +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VWERASE +(POSIX ¤Ë¤Ï¤Ê¤¤; 027, ETB, Ctrl-W) +ñ¸ì¾Ãµî¡£ +.B ICANON +¤È +.B IEXTEN +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VREPRINT +(POSIX ¤Ë¤Ï¤Ê¤¤; 022, DC2, Ctrl-R) +¤Þ¤ÀÆɤ߹þ¤ó¤Ç¤¤¤Ê¤¤Ê¸»úÎó¤òºÆɽ¼¨¤¹¤ë¡£ +.B ICANON +¤È +.B IEXTEN +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VDISCARD +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤; 017, SI, Ctrl-O) +̤Á÷¿®¥Ð¥Ã¥Õ¥¡¤ÎÆâÍƤÎÇË´þ/Êݸ¤òÀÚ¤êÂؤ¨¤ë¡£ +.B IEXTEN +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëǧ¼±¤·¡¢ÆþÎϤˤÏÅϤµ¤ì¤Ê¤¤¡£ +.TP +.B VSTATUS +(POSIX ¤Ë¤Ï¤Ê¤¤; Linux ¤Ç¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤; +¾õÂÖÍ×µá: 024, DC4, Ctrl-T) +.LP +¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤Î¼¨¤¹ÃͤÏÁ´¤Æ°Û¤Ê¤ë¡£ +¤¿¤À¤·¡¢ +.BR VTIME , +.B VMIN +¤Ï¤½¤ì¤¾¤ì +.BR VEOL , +.B VEOF +¤ÈƱ¤¸ÃͤǤ¢¤ë¡£ +È󥫥Υ˥«¥ë¥â¡¼¥É¤Ç¤Ï¡¢Æüìʸ»ú¤Î°ÕÌ£¤Ï¥¿¥¤¥à¥¢¥¦¥È¤Î°ÕÌ£¤ËÊѤï¤ë¡£ +.B VMIN +¤È +.B VTIME +¤ÎÀâÌÀ¤Ë¤Ä¤¤¤Æ¤Ï¡¢²¼µ­¤ÎÈ󥫥Υ˥«¥ë¥â¡¼¥É¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ +.SS "üËö¤ÎÀßÄê¤Î¼èÆÀ¤ÈÊѹ¹" +.PP +.BR tcgetattr () +¤Ï \fIfd\fP ¤Ë´Ø¤¹¤ë¥Ñ¥é¥á¡¼¥¿¤ò¼èÆÀ¤·¡¢\fItermios_p\fP ¤¬»²¾È¤¹¤ë¹½ +¤ÂÎ \fItermios\fP ¤ËÀßÄꤹ¤ë¡£¤³¤Î´Ø¿ô¤Ï¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¤«¤é +¸Æ¤Ð¤ì¤ë¤³¤È¤â¤¢¤ë¤¬¡¢¤³¤Î¾ì¹ç¡¢Ã¼Ëö¤Î°À­¤Ï¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹ +¤Ë¤è¤Ã¤ÆÊѲ½¤¹¤ë¤³¤È¤â¤¢¤ë¡£ +.LP +.BR tcsetattr () +¤ÏüËö¤Ë´ØÏ¢¤·¤¿¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë (¥Ï¡¼¥É¥¦¥§¥¢¤ÎÀßÄê¤ËɬÍפǡ¢¤³¤³¤Ç +ÀßÄê¤Ç¤­¤Ê¤¤¤â¤Î¤ò½ü¤¯)¡£ÀßÄê¤Ë¤Ï \fItermios_p\fP ¤¬»²¾È¤¹¤ë +\fItermios\fP ¹½Â¤ÂΤòÍѤ¤¤ë¡£ +\fIoptional_actions\fP ¤Ë¤ÏÊѹ¹¤¬Í­¸ú¤È¤Ê¤ë¥¿¥¤¥ß¥ó¥°¤òÀßÄꤹ¤ë: +.IP \fBTCSANOW\fP +¤¿¤À¤Á¤ËÊѹ¹¤¬Í­¸ú¤È¤Ê¤ë¡£ +.IP \fBTCSADRAIN\fP +.I fd +¤Ø¤Î½ÐÎϤ¬¤¹¤Ù¤ÆžÁ÷¤µ¤ì¤¿¸å¤ËÊѹ¹¤¬Í­¸ú¤Ë¤Ê¤ë¡£¤³¤Îµ¡Ç½¤Ï +½ÐÎϤ˱ƶÁ¤¹¤ë¥Ñ¥é¥á¡¼¥¿¤òÊѹ¹¤¹¤ë»þ¤Ë»ÈÍѤ¹¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.IP \fBTCSAFLUSH\fP +¥Ñ¥é¥á¡¼¥¿¤òÊѹ¹¤¹¤ëÁ°¤Ë¡¢ +.I fd +¤Ø¤Î½ÐÎϤ¬¤¹¤Ù¤ÆžÁ÷¤µ¤ì¡¢¼õ¿®¤·¤¿¤¬¤Þ¤ÀÆɤ߹þ¤ó¤Ç¤¤¤Ê¤¤¤¹¤Ù¤Æ¤Î +ÆþÎϤ¬ÇË´þ¤µ¤ì¤ë¡£ +.SS "¥«¥Î¥Ë¥«¥ë¥â¡¼¥É¤ÈÈ󥫥Υ˥«¥ë¥â¡¼¥É" +.I c_lflag +¤Î +.B ICANON +¥Õ¥é¥°¤ÎÀßÄê¤Ë¤è¤ê¡¢Ã¼Ëö¤¬¥«¥Î¥Ë¥«¥ë¥â¡¼¥É¤ÇÆ°ºî¤¹¤ë¤«¤¬·èÄꤵ¤ì¤ë¡£ +.B ICANON +¤¬¥»¥Ã¥È¤µ¤ì¤¿¾ì¹ç¡¢¥«¥Î¥Ë¥«¥ë¥â¡¼¥É (canonical mode) ¤È¤Ê¤ê¡¢ +¥»¥Ã¥È¤µ¤ì¤Ê¤¤¾ì¹ç¡¢È󥫥Υ˥«¥ë¥â¡¼¥É (noncanonical mode) ¤È¤Ê¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +.B ICANON +¤Ï¥»¥Ã¥È¤µ¤ì¤ë¡£ + +¥«¥Î¥Ë¥«¥ë¥â¡¼¥É¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤ÊÆ°ºî¤È¤Ê¤ë¡£ +.IP * 2 +ÆþÎϤϹÔñ°Ì¤Ë¹Ô¤ï¤ì¤ë¡£ +¹Ô¶èÀÚ¤êʸ»ú¤¬ÂǤÁ¹þ¤Þ¤ì¤¿»þÅÀ¤Ç¡¢ÆþÎϹԤ¬ÍøÍѲÄǽ¤È¤Ê¤ë¡£ +¹Ô¶èÀÚ¤êʸ»ú¤Ï NL, EOL, EOL2 ¤ª¤è¤Ó¹ÔƬ¤Ç¤Î EOF ¤Ç¤¢¤ë¡£ +EOF °Ê³°¤Î¾ì¹ç¡¢ +.BR read (2) +¤¬ÊÖ¤¹¥Ð¥Ã¥Õ¥¡¤Ë¹Ô¶èÀÚ¤êʸ»ú¤â´Þ¤á¤é¤ì¤ë¡£ +.IP * 2 +¹ÔÊÔ½¸¤¬Í­¸ú¤È¤Ê¤ë (ERASE, KILL ¤¬¸ú²Ì¤ò»ý¤Ä¡£ +.B IEXTEN +¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ +WERASE, REPRINT, LNEXT ¤â¸ú²Ì¤ò»ý¤Ä)¡£ +.BR read (2) +¤ÏºÇÂç¤Ç¤â 1¹Ô¤ÎÆþÎϤ·¤«ÊÖ¤µ¤Ê¤¤¡£ +.BR read (2) +¤¬Í׵ᤷ¤¿¥Ð¥¤¥È¿ô¤¬¸½ºß¤ÎÆþÎϹԤΥХ¤¥È¿ô¤è¤ê¤â¾¯¤Ê¤¤¾ì¹ç¡¢ +Í׵ᤷ¤¿¤Î¤ÈƱ¤¸¥Ð¥¤¥È¿ô¤À¤±¤¬Æɤ߹þ¤Þ¤ì¡¢ +»Ä¤ê¤Îʸ»ú¤Ï¼¡²ó¤Î +.BR read (2) +¤ÇÆɤ߹þ¤Þ¤ì¤ë¡£ +.PP +È󥫥Υ˥«¥ë¥â¡¼¥É¤Ç¤Ï¡¢ÆþÎϤϨºÂ¤ËÍøÍѲÄǽ¤È¤Ê¤ê +(¥æ¡¼¥¶¤Ï¹Ô¶èÀÚ¤êʸ»ú¤òÂǤÁ¹þ¤àɬÍפϤʤ¤)¡¢ +¹ÔÊÔ½¸¤Ï̵¸ú¤È¤Ê¤ë¡£ +MIN +.RI ( c_cc[VMIN] ) +¤È TIME +.RI ( c_cc[VTIME] ) +¤ÎÀßÄê¤Ë¤è¤ê¡¢ +.BR read (2) +¤¬´°Î»¤¹¤ë¾ò·ï¤¬·èÄꤵ¤ì¤ë¡£4¼ïÎà¤Î¾ì¹ç¤¬¤¢¤ë: +.IP * 2 +MIN == 0; TIME == 0: +¥Ç¡¼¥¿¤¬ÍøÍѲÄǽ¤Ç¤¢¤ì¤Ð¡¢ +.BR read (2) +¤Ï¤¹¤°¤ËÊ֤롣¤³¤Î¤È¤­¤ÎÊÖ¤êÃͤϡ¢¤½¤Î¤È¤­ÍøÍѲÄǽ¤Ê¥Ð¥¤¥È¿ô¤« +.BR read (2) +¤ÎÍ×µá¥Ð¥¤¥È¿ô¤Î¤¦¤Á¾®¤µ¤¤Êý¤È¤Ê¤ë¡£ +ÍøÍѲÄǽ¤Ê¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç +.BR read (2) +¤Ï 0 ¤òÊÖ¤¹¡£ +.IP * 2 +MIN > 0; TIME == 0: +.BR read (2) +¤Ï¡¢ÍøÍѲÄǽ¤Ê¥Ç¡¼¥¿¤¬ MIN ¥Ð¥¤¥È¤«Í×µá¥Ð¥¤¥È¿ô¤Î¤¤¤º¤ì¤«¤Ë㤹¤ë¤Þ¤Ç +Ää»ß¤¹¤ë¡£ÊÖ¤êÃͤϡ¢MIN ¤«Í×µá¥Ð¥¤¥È¿ô¤Î¾®¤µ¤¤Êý¤È¤Ê¤ë¡£ +.IP * 2 +MIN == 0; TIME > 0: +TIME ¤Ï¥¿¥¤¥Þ¤Î¾å¸Â¤òµ¬Äꤷ¡¢Ã±°Ì¤Ï 1/10 ÉäǤ¢¤ë¡£ +¥¿¥¤¥Þ¤Ï +.BR read (2) +¤¬¸Æ¤Ð¤ì¤¿»þÅÀ¤Ç³«»Ï¤µ¤ì¤ë¡£ +.BR read (2) +¤¬ÊÖ¤ë¤Î¤Ï¡¢¾¯¤Ê¤¯¤È¤â 1¥Ð¥¤¥È¤Î¥Ç¡¼¥¿¤¬ÍøÍѲÄǽ¤È¤Ê¤Ã¤¿»þÅÀ¡¢ +¤Þ¤¿¤Ï¥¿¥¤¥Þ¤¬»þ´ÖÀÚ¤ì¤È¤Ê¤Ã¤¿»þÅÀ¤Ç¤¢¤ë¡£ +ÆþÎϤ¬Á´¤¯¤Ê¤¯¥¿¥¤¥Þ¤¬»þ´ÖÀÚ¤ì¤È¤Ê¤Ã¤¿¾ì¹ç¡¢ +.BR read (2) +¤Ï 0 ¤òÊÖ¤¹¡£ +.IP * 2 +MIN > 0; TIME > 0: +TIME ¤Ï¥¿¥¤¥Þ¤Î¾å¸Â¤òµ¬Äꤷ¡¢Ã±°Ì¤Ï 1/10 ÉäǤ¢¤ë¡£ +ÆþÎϤκǽé¤Î¥Ð¥¤¥È¤¬ÍøÍѲÄǽ¤Ë¤Ê¤Ã¤¿¸å¤Ï¡¢ +¿·¤¿¤Ë 1¥Ð¥¤¥È¼õ¿®¤¹¤ëÅ٤˥¿¥¤¥Þ¤¬¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +.BR read (2) +¤¬ÊÖ¤ë¤Î¤Ï¡¢MIN ¥Ð¥¤¥È¤«Í×µá¥Ð¥¤¥È¿ô¤Î¤¦¤Á¾¯¤Ê¤¤Êý¤Þ¤ÇÆɤ߽Фµ¤ì¤¿»þÅÀ¤«¡¢ +¥Ð¥¤¥È´Ö¥¿¥¤¥Þ¤¬»þ´ÖÀÚ¤ì¤È¤Ê¤Ã¤¿»þÅÀ¤Ç¤¢¤ë¡£ +¤ÏºÇ½é¤Î¥Ð¥¤¥È¤¬ÍøÍѲÄǽ¤Ë¤Ê¤é¤Ê¤¤¤È¥¿¥¤¥Þ¤Ï³«»Ï¤µ¤ì¤Ê¤¤¤Î¤Ç¡¢ +¾¯¤Ê¤¯¤È¤â 1¥Ð¥¤¥È¤ÏÆɤ߹þ¤Þ¤ì¤ë¡£ +.SS "Raw mode" +.LP +.BR cfmakeraw () +¤Ï¡¢Ã¼Ëö¤òÀΤΠVersion 7 üËö¥É¥é¥¤¥Ð¤Î +"raw" ¥â¡¼¥É¤Î¤è¤¦¤ËÀßÄꤹ¤ë¡£ +ÆþÎϤÏʸ»úñ°Ì¤Ë²Äǽ¤Ç¤¢¤ê¡¢¥¨¥³¡¼¤¬Ìµ¸ú¤È¤Ê¤ê¡¢ +üËö¤ÎÆþ½ÐÎÏʸ»ú¤ËÂФ¹¤ëÆüì½èÍý¤Ï¤¹¤Ù¤Æ̵¸ú¤È¤Ê¤ë¡£ +üËö¤Î°À­¤Ï°Ê²¼¤Î¤è¤¦¤ËÀßÄꤵ¤ì¤ë: +.nf + + termios_p\->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP + | INLCR | IGNCR | ICRNL | IXON); + termios_p\->c_oflag &= ~OPOST; + termios_p\->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); + termios_p\->c_cflag &= ~(CSIZE | PARENB); + termios_p\->c_cflag |= CS8; +.fi +.SS "¥é¥¤¥óÀ©¸æ" +.LP +.BR tcsendbreak () +¤ÏüËö¤¬ÈóƱ´ü¤Î¥·¥ê¥¢¥ë¥Ç¡¼¥¿Å¾Á÷¤òÍѤ¤¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +Ϣ³¤·¤¿0¤Î¥Ó¥Ã¥ÈÎó¤ò°ìÄê´Ö³Ö¤ÇžÁ÷¤¹¤ë¡£ +\fIduration\fP ¤¬ 0 ¤Î¾ì¹ç¤Ï¡¢0 ¤Î¥Ó¥Ã¥È¤ò 0.25 Éðʾ塢 +0.5 Éðʲ¼¤Î´Ö³Ö¤ÇžÁ÷¤¹¤ë¡£ \fIduration\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢ +0 ¤Î¥Ó¥Ã¥È¤ò¼ÂÁõ°Í¸¤Î»þ´Ö´Ö³Ö¤ÇÁ÷¤ë¡£ +.LP +üËö¤¬ÈóƱ´ü¤Î¥·¥ê¥¢¥ë¥Ç¡¼¥¿Å¾Á÷¥â¡¼¥É¤Ç¤Ê¤¤¾ì¹ç¡¢ +.BR tcsendbreak () +¤Ï²¿¤â¹Ô¤ï¤º¤ËÌá¤ë¡£ +.LP +.BR tcdrain () +¤Ï +.I fd +¤¬¹Ô¤Ã¤Æ¤¤¤ë½ÐÎϤΞÁ÷¤¬´°Î»¤¹¤ë¤Þ¤ÇÂԤġ£ +.LP +.BR tcflush () +¤Ï +.I fd +¤¬¹Ô¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿¤Î½ÐÎϤǤޤÀžÁ÷¤µ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¡¢¤¢¤ë¤¤¤Ï¼õ¿®¤· +¤¿¤¬¤Þ¤ÀÆþÎϤ·¤Æ¤¤¤Ê¤¤¤â¤Î¤òÇË´þ¤¹¤ë¡£¤¤¤º¤ì¤ò¹Ô¤¦¤«¤Ï +.I queue_selector +¤ÎÃͤÇÄê¤á¤ë: +.\"??nakano flush == discard? +.IP \fBTCIFLUSH\fP +¼õ¿®¤·¤¿¤¬Æɤó¤Ç¤¤¤Ê¤¤¥Ç¡¼¥¿¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.IP \fBTCOFLUSH\fP +½ñ¤¤¤¿¤¬Á÷¿®¤·¤Æ¤¤¤Ê¤¤¥Ç¡¼¥¿¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.IP \fBTCIOFLUSH\fP +¼õ¿®¤·¤¿¤¬Æɤó¤Ç¤¤¤Ê¤¤¥Ç¡¼¥¿¡¦½ñ¤¤¤¿¤¬Á÷¿®¤·¤Æ¤¤¤Ê¤¤¥Ç¡¼¥¿Î¾Êý +¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.LP +.BR tcflow () +¤Ï +.I fd +¤Ç»ØÄꤵ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤ª¤±¤ë¥Ç¡¼¥¿¤ÎÁ÷¿®¤¢¤ë¤¤¤Ï¼õ¿®¤ò°ì»þŪ¤ËÃæÃǤ¹¤ë¡£ +Á÷¿®¤È¼õ¿®¤Î¤É¤Á¤é¤«¤Ï¡¢ +.IR action ¤Ç·è¤Þ¤ë: +.IP \fBTCOOFF\fP +½ÐÎϤÎÃæÃÇ¡£ +.IP \fBTCOON\fP +ÃæÃǤ·¤¿½ÐÎϤκƳ«¡£ +.IP \fBTCIOFF\fP +STOP ʸ»ú¤ÎÁ÷¿®¡£ +STOP ʸ»ú¤ÏüËö¥Ç¥Ð¥¤¥¹¤«¤é¥·¥¹¥Æ¥à¤Ø¤Î¥Ç¡¼¥¿Á÷¿®¤òÄä»ß¤¹¤ë¡£ +.IP \fBTCION\fP +START ʸ»ú¤ÎÁ÷¿®¡£ +START ʸ»ú¤ÏüËö¥Ç¥Ð¥¤¥¹¤«¤é¥·¥¹¥Æ¥à¤Ø¤Î¥Ç¡¼¥¿Á÷¿®¤ò³«»Ï¤¹¤ë¡£ +.LP +üËö¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¤È¤­¤Î¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +ÆþÎϤâ½ÐÎϤâÃæÃǤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SS "¥é¥¤¥ó®ÅÙ" +¥Ü¡¼¥ì¡¼¥È´Ø¿ô¤Ï \fItermios\fP ¹½Â¤ÂÎÃæ¤ÎÆþ½ÐÎϥܡ¼¥ì¡¼¥È¤ò +¼èÆÀ¡¢ÀßÄꤹ¤ë¤¿¤á¤ËÄ󶡤µ¤ì¤ë¡£ +ÀßÄꤵ¤ì¤¿ÃÍ¤Ï +.BR tcsetattr () +¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤Þ¤Ç¤ÏÍ­¸ú¤Ç¤Ï¤Ê¤¤¡£ + +®ÅÙ¤ò \fBB0\fP ¤ËÀßÄꤷ¤¿¾ì¹ç¡¢¥â¥Ç¥à¤ÏÄä»ß (hang up) ¤¹¤ë¡£ +\fBB38400\fP ¤Ë³ºÅö¤¹¤ë¼ÂºÝ¤Î¥Ó¥Ã¥È¥ì¡¼¥È¤Ï +.BR setserial (8) +¤Ç +Êѹ¹¤Ç¤­¤ë¡£ +.LP +ÆþÎϤª¤è¤Ó½ÐÎϥܡ¼¥ì¡¼¥È¤Ï \fItermios\fP ¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ë¡£ +.LP +.BR cfgetospeed () +¤Ï +.I termios_p +¤¬¼¨¤·¤Æ¤¤¤ë \fItermios\fP ¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤Æ¤¤¤ë +½ÐÎϥܡ¼¥ì¡¼¥È¤òÊÖ¤¹¡£ +.LP +.BR cfsetospeed () +¤Ï \fItermios_p\fP ¤Ç¼¨¤µ¤ì¤Æ¤¤¤ë \fItermios\fP ¹½Â¤ÂÎÃæ¤Î½ÐÎϥܡ¼¥ì¡¼¥È¤ò +\fIspeed\fP ¤ËÀßÄꤹ¤ë¡£Ãͤϰʲ¼¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤: +.nf + +.ft B + B0 + B50 + B75 + B110 + B134 + B150 + B200 + B300 + B600 + B1200 + B1800 + B2400 + B4800 + B9600 + B19200 + B38400 + B57600 + B115200 + B230400 +.ft P + +.fi +0¥Ü¡¼ (\fBB0\fP) ¤ÏÀܳ¤ÎÃæÃǤËÍѤ¤¤é¤ì¤ë¡£ +B0¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥â¥Ç¥à¤ÎÀ©¸æÀþ¤Ï»ÈÍѤµ¤ì¤Ê¤¤¾õÂ֤ˤʤꡢ°ìÈ̤ˤϤ³¤ì¤Ç +Àܳ¤¬ÀÚÃǤµ¤ì¤ë¡£ +\fBCBAUDEX\fP ¤ÏPOSIX.1¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë®ÅÙ¤ÎÈϰϳ° (57600 ¤ª¤è¤Ó¤½¤ì°Ê¾å) +¤òÀßÄꤹ¤ë¡£¤¹¤Ê¤ï¤ÁÎ㤨¤Ð \fBB57600\fP & \fBCBAUDEX\fP ¤Ï 0 ¤Ç¤Ê¤¤¡£ +.LP +.BR cfgetispeed () +¤Ï \fItermios\fP ¹½Â¤ÂÎÃæ¤ÎÆþÎϥܡ¼¥ì¡¼¥È¤òÊÖ¤¹¡£ +.LP +.BR cfsetispeed () +¤Ï \fItermios\fP ¹½Â¤ÂÎÃæ¤ÎÆþÎϥܡ¼¥ì¡¼¥È¤ò +.I speed +¤ËÀßÄꤹ¤ë¡£ +.I speed +¤Ë¤Ï¡¢¾å½Ò¤Î +.BR cfsetospeed () +¤Î¥Ü¡¼¥ì¡¼¥ÈÄê¿ô \fBBnnn\fP ¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ÆþÎϥܡ¼¥ì¡¼¥È¤¬ 0 ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ÆþÎϥܡ¼¥ì¡¼¥È¤Ï½ÐÎϥܡ¼¥ì¡¼¥È +¤ÈƱ¤¸ÃͤȤʤ롣 +.LP +.BR cfsetspeed () +¤Ï 4.4BSD ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£¤³¤Î´Ø¿ô¤Ï +.BR cfsetispeed () +¤ÈƱ¤¸°ú¤­¿ô¤ò¤È¤ê¡¢Æþ½ÐÎÏξÊý¤Î®ÅÙ¤òÀßÄꤹ¤ë¡£ +.SH ÊÖ¤êÃÍ +.LP +.BR cfgetispeed () +¤Ï \fItermios\fP ¹½Â¤ÂÎÃæ¤ÎÆþÎϥܡ¼¥ì¡¼¥È¤òÊÖ¤¹¡£ +.LP +.BR cfgetospeed () +¤Ï \fItermios\fP ¹½Â¤ÂÎÃæ¤Î½ÐÎϥܡ¼¥ì¡¼¥È¤òÊÖ¤¹¡£ +.LP +¾¤Î¤¹¤Ù¤Æ¤Î´Ø¿ô¤ÎÌá¤êÃÍ: +.IP 0 +¼Â¹ÔÀ®¸ù¡£ +.IP \-1 +¼Â¹Ô¼ºÇÔ¡£ +.I errno +¤¬¥¨¥é¡¼¤Î¼ïÎà¤ò¼¨¤¹¡£ +.LP +.BR tcsetattr () +¤Ï \fI¤Ê¤ó¤é¤«¤Î\fP Êѹ¹Í׵᤬À®¸ù¤·¤¿¾ì¹ç¤ËÀ®¸ù¤òÊÖ¤¹¤³¤È¤ËÃí°Õ¡£ +½¾¤Ã¤Æ¡¢Ê£¿ô¤ÎÊѹ¹¤ò¹Ô¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢°ú¤­Â³¤¤¤Æ +.BR tcgetattr () +¤ò¸Æ¤Ó½Ð¤·¤ÆÁ´¤Æ¤ÎÊѹ¹¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¤«¤ò³Îǧ¤¹¤ëɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ½àµò +.BR tcgetattr (), +.BR tcsetattr (), +.BR tcsendbreak (), +.BR tcdrain (), +.BR tcflush (), +.BR tcflow (), +.BR cfgetispeed (), +.BR cfgetospeed (), +.BR cfsetispeed (), +.BR cfsetospeed () +¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +.BR cfmakeraw () +¤È +.BR cfsetspeed () +¤ÏÈóɸ½à¤À¤¬¡¢BSD ¤Ç¤ÏÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +Unix V7 ¤È¤½¤Î¸å¤Î¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥Ü¡¼¥ì¡¼¥È¤Î 14 ¸Ä¤Î¥ê¥¹¥È¤Ç¤¢¤ë +B0, ..., B9600 ¤Î¸å¤í¤Ë EXTA, EXTB ("External A" ¤È "External B") ¤Î 2 ¤Ä¤ò +Äɲ䷤Ƥ¤¤ë¡£ +¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¤µ¤é¤Ë¹â®¤Ê¥Ü¡¼¥ì¡¼¥È¤Î¤¿¤á¤Ë¥ê¥¹¥È¤ò³ÈÄ¥¤·¤Æ¤¤¤ë¡£ +.LP +.BR tcsendbreak () +¤Ç \fIduration\fP ¤Ë 0 °Ê³°¤ò»ØÄꤷ¤¿¾ì¹ç¤Î¸ú²Ì¤ÏÍÍ¡¹¤Ç¤¢¤ë¡£ +SunOS ¤Ï +.IB duration * N +ÉäΥ֥졼¥¯¤òµ¬Äꤷ¤Æ¤¤¤ë¡£¤³¤³¤Ç \fIN\fP ¤Ï 0.25 °Ê¾å 0.5 ̤Ëþ¤Ç¤¢¤ë¡£ +Linux, AIX, DU, Tru64 ¤Ï +.I duration +¥ß¥êÉäΥ֥졼¥¯¤òÁ÷¿®¤¹¤ë¡£ +FreeBSD, NetBSD, HP-UX, MacOS ¤Ï +.I duration +¤ÎÃͤò̵»ë¤¹¤ë¡£ +Solaris ¤È Unixware ¤Ç¤Ï¡¢Èó¥¼¥í¤Î +.I duration +¤ò»ØÄꤷ¤¿ +.BR tcsendbreak () +¤Î¿¶¤ëÉñ¤¤¤Ï +.BR tcdrain () +¤ÈƱÍͤǤ¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR stty (1), +.BR console_ioctl (4), +.BR tty_ioctl (4), +.BR setserial (8) diff --git a/release/man3/tgamma.3 b/release/man3/tgamma.3 new file mode 100644 index 00000000..5e35e0b0 --- /dev/null +++ b/release/man3/tgamma.3 @@ -0,0 +1,179 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" Based on glibc infopages +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" 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 +.\" +.TH TGAMMA 3 2008-08-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +tgamma, tgammaf, tgammal \- ËÜÅö¤Î¥¬¥ó¥Þ´Ø¿ô +.SH ½ñ¼° +.B #include +.sp +.BI "double tgamma(double " x ); +.br +.BI "float tgammaf(float " x ); +.br +.BI "long double tgammal(long double " x ); +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.ad l +.BR tgamma (), +.BR tgammaf (), +.BR tgammal (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +¥¬¥ó¥Þ´Ø¿ô¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.sp + Gamma(x) = t^(x\-1) e^\-t dt ¤Î 0 ¤«¤é̵¸ÂÂç¤Þ¤Ç¤ÎÀÑʬ +.sp +¤³¤Î´Ø¿ô¤ÏÀµ¤Ç¤Ê¤¤À°¿ô¤ò½ü¤¯¤¹¤Ù¤Æ¤Î¼Â¿ô¤ËÂФ·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +ÈóÉé¤ÎÀ°¿ô \fIm\fP ¤Ë´Ø¤·¤Æ¡¢°Ê²¼¤¬À®Î©¤¹¤ë: +.sp + Gamma(m+1) = m! +.sp +¤è¤ê°ìÈÌŪ¤Ë¤Ï¡¢¤¹¤Ù¤Æ¤Î \fIx\fP ¤Ë´Ø¤·¤Æ°Ê²¼¤¬À®Î©¤¹¤ë: +.sp + Gamma(x+1) = x * Gamma(x) +.sp +¤µ¤é¤Ë¡¢¶Ë¤ò½ü¤¯¤¹¤Ù¤Æ¤Î \fIx\fP ¤Ç¼¡¼°¤âÀ®Î©¤¹¤ë: +.sp + Gamma(x) * Gamma(1 \- x) = PI / sin(PI * x) +.PP +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï Gamma(x) ¤òÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Éé¤ÎÀ°¿ô¤«Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ +NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.BR HUGE_VAL , +.BR HUGE_VALF , +.BR HUGE_VALL , +¤òÊÖ¤¹¡£¤³¤ÎºÝ¡¢¿ô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£ + +·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢ +´Ø¿ô¤Ï 0 ¤ò¤òÊÖ¤¹¡£¤³¤ÎºÝ¡¢¿ô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£ + +.I x +¤¬ \-0 ¤« +0 ¤Î¾ì¹ç¡¢¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.BR HUGE_VAL , +.BR HUGE_VALF , +.BR HUGE_VALL , +¤òÊÖ¤¹¡£ +0 ¤ÈƱ¤¸Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.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 +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë (¡Ö¥Ð¥°¡×¤ÎÀá¤ò»²¾È)¡£ +.TP +¶Ë¥¨¥é¡¼ (pole error): \fIx\fP ¤¬ +0 ¤« \-0 +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_DIVBYZERO ) +¤¬¾å¤¬¤ë¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼ (range error): ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.PP +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 . +¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ +¤³¤Î¾ì¹ç¤Ï +.I errno +¤ÏÀßÄꤵ¤ì¤Ê¤¤¡£ +.\" 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. +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH Ãí°Õ +¤³¤Î´Ø¿ô¤ò¡ÖËÜÅö¤Î (true) ¥¬¥ó¥Þ´Ø¿ô¡×¤È¸Æ¤Ð¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤«¤Ã¤¿¡£ +¤Ê¤¼¤Ê¤é¡¢Â¾¤ÎÃͤòÊÖ¤¹ +.BR gamma (3) +¤È¤¤¤¦´Ø¿ô¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¤«¤é¤Ç¤¢¤ë (¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR gamma (3) +¤ò»²¾È)¡£ +.SH ¥Ð¥° +.I x +¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ +.I errno +¤ÏÀßÄꤵ¤ì¤Ê¤¤ +.RB ( EDOM +¤¬ÀßÄꤵ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë)¡£ +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6809 + +glibc ¥Ð¡¼¥¸¥ç¥ó 2.3.3 °ÊÁ°¤Ç¤Ï¡¢ +°ú¤­¿ô¤Ë +0 ¤ä \-0 ¤òÅϤ¹¤È¡¢¶Ë¥¨¥é¡¼¤Ç¤Ï¤Ê¤¯¡¢ +Îΰ襨¥é¡¼¤ò´Ö°ã¤Ã¤ÆȯÀ¸¤·¤Æ¤¤¤¿ +(Îΰ襨¥é¡¼¤Î¾ì¹ç¡¢ +.I errno +¤Ë +.B EDOM +¤òÀßÄꤵ¤ì¡¢ +.B FE_INVALID +Îã³°¤¬È¯À¸¤¹¤ë)¡£ +.SH ´ØÏ¢¹àÌÜ +.BR gamma (3), +.BR lgamma (3) diff --git a/release/man3/timegm.3 b/release/man3/timegm.3 new file mode 100644 index 00000000..bc07d0bd --- /dev/null +++ b/release/man3/timegm.3 @@ -0,0 +1,104 @@ +.\" 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) 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" +.SH ̾Á° +timegm, timelocal \- gmtime ¤È localtime ¤ÎµÕ´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "time_t timelocal(struct tm *" tm ); +.sp +.BI "time_t timegm(struct tm *" tm ); +.sp +.fi +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR timelocal (), +.BR timegm (): +_BSD_SOURCE || _SVID_SOURCE +.SH ÀâÌÀ +.BR timelocal () +´Ø¿ô¤È +.BR timegm () +´Ø¿ô¤Ï¡¢¤½¤ì¤¾¤ì +.BR localtime (3) +´Ø¿ô¤È +.BR gmtime (3) +´Ø¿ô¤ÎµÕ´Ø¿ô¤Ç¤¢¤ë¡£ +.SH ½àµò +¤³¤ì¤é¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +BSD ·Ï¤Ë¤â¸ºß¤¹¤ë¡£ +¤³¤ì¤é¤Î»ÈÍѤÏÈò¤±¤ë¤³¤È¡£¡ÖÃí°Õ¡×»²¾È¡£ +.SH Ãí°Õ +.BR timelocal () +´Ø¿ô¤Ï POSIX ¤Îɸ½à´Ø¿ô +.BR mktime (3) +¤ÈƱ¤¸¤â¤Î¤Ç¤¢¤ë¡£ +¤Î¤Ç¡¢¤³¤ì¤ò»È¤¦Íýͳ¤Ï¤Ê¤¤¤Ï¤º¤Ç¤¢¤ë¡£ +.LP +.BR timegm () +¤ò°Ü¿¢À­¤¬¤¢¤ë¤è¤¦¤Ê¤«¤¿¤Á¤Ç¼Â¸½¤¹¤ë¤Ë¤Ï¡¢ +.B TZ +´Ä¶­ÊÑ¿ô¤ò UTC ¤ËÀßÄꤷ¤Æ¤«¤é +.BR mktime (3) +¤ò¸Æ¤ó¤Ç¡¢ +.B TZ +¤ÎÃͤò¼èÆÀ¤¹¤ì¤Ð¤è¤¤¡£ +Î㤨¤Ð¼¡¤Î¤è¤¦¤Ë¤Ê¤ë¤À¤í¤¦¡£ +.sp +.in +4n +.nf +#include +#include + +time_t my_timegm (struct tm *tm) +{ + time_t ret; + char *tz; + + tz = getenv("TZ"); + setenv("TZ", "", 1); + tzset(); + ret = mktime(tm); + if (tz) + setenv("TZ", tz, 1); + else + unsetenv("TZ"); + tzset(); + return ret; +} +.fi +.in +.SH ´ØÏ¢¹àÌÜ +.BR gmtime (3), +.BR localtime (3), +.BR mktime (3), +.BR tzset (3) diff --git a/release/man3/timeradd.3 b/release/man3/timeradd.3 new file mode 100644 index 00000000..c130ddea --- /dev/null +++ b/release/man3/timeradd.3 @@ -0,0 +1,160 @@ +.\" Copyright (c) 2007 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. +.\" +.\" 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" +.SH ̾Á° +timeradd, timersub, timercmp, timerclear, timerisset \- timeval ¤ÎÁàºî +.SH ½ñ¼° +.nf +.B #include + +.BI "void timeradd(struct timeval *" a ", struct timeval *" b , +.BI " struct timeval *" res ); + +.BI "void timersub(struct timeval *" a ", struct timeval *" b , +.BI " struct timeval *" res ); + +.BI "void timerclear(struct timeval *" tvp ); + +.BI "int timerisset(struct timeval *" tvp ); + +.BI "int timercmp(struct timeval *" a ", struct timeval *" b ", " CMP ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô: +_BSD_SOURCE +.SH ÀâÌÀ +.I timeval +¹½Â¤ÂΤòÁàºî¤¹¤ë¤¿¤á¤Î¥Þ¥¯¥í¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£ +.I timeval +¹½Â¤ÂÎ¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.sp +.in +4n +.nf +struct timeval { + time_t tv_sec; /* Éà */ + suseconds_t tv_usec; /* ¥Þ¥¤¥¯¥íÉà */ +}; +.fi +.in +.PP +.BR timeradd () +¤Ï¡¢ +.I a +¤È +.I b +¤Î»þ¹ïÃͤò²Ã»»¤·¡¢¤½¤Î¹ç·×¤ò +.I res +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë +.I timeval +¹½Â¤ÂΤ˳ÊǼ¤¹¤ë¡£·ë²Ì¤Ï¡¢ +.I res\->tv_usec +¤ÎÃͤ¬ 0 ¤«¤é 999,999 ¤ÎÈϰϤËÆþ¤ë¤è¤¦¤ËÀµµ¬²½¤µ¤ì¤ë¡£ + +.BR timersub () +¤Ï¡¢ +.I a +¤Î»þ¹ïÃͤ«¤é +.I b +¤Î»þ¹ïÃͤò¸º»»¤·¡¢¤½¤Î·ë²Ì¤ò +.I res +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë +.I timeval +¹½Â¤ÂΤ˳ÊǼ¤¹¤ë¡£·ë²Ì¤Ï¡¢ +.I res\->tv_usec +¤ÎÃͤ¬ 0 ¤«¤é 999,999 ¤ÎÈϰϤËÆþ¤ë¤è¤¦¤ËÀµµ¬²½¤µ¤ì¤ë¡£ + +.BR timerclear () +¤Ï +.I tvp +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë +.I timeval +¹½Â¤ÂΤò 0 ¤ÇËä¤á¤ë¡£ +0 ¤ÇËä¤á¤é¤ì¤¿ +.I timeval +¹½Â¤ÂΤϡ¢»þ¹ïµª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤òɽ¤¹¡£ + +.BR timerisset () +¤Ï¡¢ +.I tvp +¤Ë¤è¤ê»²¾È¤µ¤ì¤ë +.I timeval +¹½Â¤ÂΤΤ¤¤º¤ì¤«°ìÊý¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 °Ê³°¤ÎÃͤ¬Æþ¤Ã¤Æ¤¤¤ì¤Ð¡¢ +¿¿ (0 °Ê³°) ¤òÊÖ¤¹¡£ + +.BR timercmp () +¤Ï +.I a +¤È +.I b +¤Î»þ¹ïÃͤòÈæ³Ó±é»»»Ò +.I CMP +¤ò»È¤Ã¤ÆÈæ³Ó¤·¡¢Èæ³Ó·ë²Ì¤Ë´ð¤Å¤­¡¢¿¿ (0 °Ê³°) ¤«µ¶ (0) ¤òÊÖ¤¹¡£ +(Linux/glibc ¤Ï¤½¤¦¤Ç¤Ï¤Ê¤¤¤¬) +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.BRr timercmp () +¤Î¼ÂÁõ¤¬¤ª¤«¤·¤¯¡¢ +.\" HP-UX, Tru64, Irix ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.\"#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 == +¤ò»ØÄꤹ¤ë¤ÈÀµ¤·¤¯Æ°ºî¤·¤Ê¤¤¡£ +°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +Âå¤ï¤ê¤Ë°Ê²¼¤ò»È¤¦¤³¤È¡£ + + !timercmp(..., <) + !timercmp(..., >) + !timercmp(..., !=) +.SH ÊÖ¤êÃÍ +.BR timerisset () +¤È +.BR timercmp () +¤Ï¡¢¿¿ (0 °Ê³°) ¤«µ¶ (0) ¤òÊÖ¤¹¡£ +.BR +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +¤Û¤È¤ó¤É¤Î BSD ͳÍè¤Î¥·¥¹¥Æ¥à¤Ë¤Ï¸ºß¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR gettimeofday (2), +.BR time (7) diff --git a/release/man3/tmpfile.3 b/release/man3/tmpfile.3 new file mode 100644 index 00000000..55bfd939 --- /dev/null +++ b/release/man3/tmpfile.3 @@ -0,0 +1,96 @@ +.\" 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 Sat Jul 24 17:46:57 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2001-11-17, aeb +.\" +.\" Japanese Version Copyright (c) 1997 Tenkou N. Hattori +.\" all rights reserved. +.\" Translated Sat Jan 18 16:51:59 JST 1997 +.\" by Tenkou N. Hattori +.\" Updated & Modified Sun Dec 9 15:25:20 JST 2001 +.\" by Yuichi SATO +.\" +.TH TMPFILE 3 2008-07-14 "" "Linux Programmer's Manual" +.SH ̾Á° +tmpfile \- ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.B FILE *tmpfile(void); +.fi +.SH ÀâÌÀ +.BR tmpfile () +´Ø¿ô¤Ï¥æ¥Ë¡¼¥¯¤Ê¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤ò +¥Ð¥¤¥Ê¥ê¥ê¡¼¥É¥é¥¤¥È¥â¡¼¥É (w+b) ¤Ç¥ª¡¼¥×¥ó¤¹¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥¯¥í¡¼¥º»þ¤Þ¤¿¤Ï¥×¥í¥°¥é¥à¤Î½ªÎ»»þ¤Ë¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR tmpfile () +´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¤«¡¢ +¥æ¥Ë¡¼¥¯¤Ê¥Õ¥¡¥¤¥ë¤¬ºî¤ì¤Ê¤«¤Ã¤¿¤«¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +¸å¼Ô¤Î¾ì¹ç¡¢¥¨¥é¡¼¤òɽ¤¹ \fIerrno\fP ¤òÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¥Õ¥¡¥¤¥ë¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥µ¡¼¥Á¤Î¥¢¥¯¥»¥¹¸¢ (search permission) ¤¬¤Ê¤¤¡£ +.TP +.B EEXIST +¥æ¥Ë¡¼¥¯¤Ê¥Õ¥¡¥¤¥ë̾¤¬ºîÀ®¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.TP +.B EINTR +¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤ÆÃæÃǤµ¤ì¤¿¡£ +.TP +.B EMFILE +1 ¤Ä¤Î¥×¥í¥»¥¹¤Ç»ÈÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¿ô¤òĶ²á¤·¤¿¡£ +.TP +.B ENFILE +¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó²Äǽ¤Ê¥Õ¥¡¥¤¥ë¿ô¤òĶ²á¤·¤¿¡£ +.TP +.B ENOSPC +¥Ç¥£¥ì¥¯¥È¥ê¤Ë¿·¤·¤¤¥Õ¥¡¥¤¥ë¤òÄɲ乤뤿¤á¤Î¶õ¤­Îΰ褬¤Ê¤¤¡£ +.TP +.B EROFS +ÆɤߤÀ¤·ÀìÍÑ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001. +.SH Ãí°Õ +POSIX.1-2001 ¤Ç¤Ï¡¢ +¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +\fIstdout\fP ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½ñ¤­½Ð¤µ¤ì¤ë¡¢¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.LP +µ¬³Ê¤Ç¤Ï +.BR tmpfile () +¤¬»È¤¦¥Ç¥£¥ì¥¯¥È¥ê¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +glibc ¤Ç¤Ï \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë +\fIP_tmpdir\fP ¤ò¥Ñ¥¹¤ÎÀèƬ¤Ë»È¤ª¤¦¤È¤¹¤ë¡£ +¤³¤ì¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê \fI/tmp\fP ¤ò»È¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR exit (3), +.BR mkstemp (3), +.BR mktemp (3), +.BR tempnam (3), +.BR tmpnam (3) diff --git a/release/man3/tmpnam.3 b/release/man3/tmpnam.3 new file mode 100644 index 00000000..cc555ac0 --- /dev/null +++ b/release/man3/tmpnam.3 @@ -0,0 +1,155 @@ +.\" Copyright (c) 1999 Andries Brouwer (aeb@cwi.nl) +.\" Japanese Version Copyright 1997 Tenkou N. Hattori +.\" +.\" 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. +.\" +.\" 2003-11-15, aeb, added tmpnam_r +.\" +.\" Japanese Version Copyright (c) 1997 Tenkou N. Hattori +.\" all rights reserved. +.\" Translated 1997-01-18, Tenkou N. Hattori +.\" Updated 2000-03-15, Kentaro Shirakata +.\" Updated 2005-03-15, Akihiro MOTOKI +.\" Updated 2006-07-26, Akihiro MOTOKI , LDP v2.36 +.\" +.TH TMPNAM 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +tmpnam, tmpnam_r \- °ì»þ¥Õ¥¡¥¤¥ë¤Î̾Á°¤òºîÀ®¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *tmpnam(char *" s ); +.fi +.SH ÀâÌÀ +.BR tmpnam () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë̾¤Ë»È¤¨¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¤¢¤ë»þÅÀ¤Ç¤ÏƱ¤¸Ì¾Á°¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¥Õ¥¡¥¤¥ë̾¤¬ÊÖ¤µ¤ì¤ë¤Î¤Ç¡¢ +ÍÄÃÕ¤Ê¥×¥í¥°¥é¥Þ¤Ï¤³¤Îʸ»úÎ󤬰ì»þ¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ +Ŭ¤·¤Æ¤¤¤ë¤È¹Í¤¨¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +°ú¤­¿ô +.I s +¤¬ NULL ¤Ê¤é¡¢¤³¤Î̾Á°¤ÏÆâÉô¤ÎÀÅŪ¥Ð¥Ã¥Õ¥¡¤ËºîÀ®¤µ¤ì¡¢ +¼¡¤Ë +.BR tmpnam () +´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤Ë¾å½ñ¤­¤µ¤ì¤ë¡£ +.I s +¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢¥Õ¥¡¥¤¥ë̾¤Ï +.I s +¤¬»Ø¤¹ (¾¯¤Ê¤¯¤È¤â +.I L_tmpnam +¤ÎŤµ¤ò»ý¤Ä) ʸ»úÇÛÎó¤Ë¥³¥Ô¡¼¤µ¤ì¡¢ +À®¸ù¤·¤¿¾ì¹ç¤Ï +.I s +¤¬ÊÖ¤µ¤ì¤ë¡£ +.LP +ºîÀ®¤µ¤ì¤ë¥Ñ¥¹Ì¾¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ÎÉôʬ¤Ë +.I P_tmpdir +¤¬»È¤ï¤ì¤ë¡£ +.RI ( L_tmpnam +¤È +.I P_tmpdir +¤Ï¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ë +.B TMP_MAX +ƱÍÍ +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£) +.SH ÊÖ¤êÃÍ +.BR tmpnam () +´Ø¿ô¤Ï°ì°Õ¤Ê°ì»þ¥Õ¥¡¥¤¥ë̾¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +°ì°Õ¤Ê¥Õ¥¡¥¤¥ë̾¤¬ºîÀ®¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ½àµò +SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +POSIX.1-2008 ¤Ï +.BR tmpnam () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.BR tmpnam () +´Ø¿ô¤ÏºÇÂç +.B TMP_MAX +²ó¤Þ¤Ç¡¢¸Æ¤Ó½Ð¤µ¤ì¤ëÅ٤˰ۤʤëʸ»úÎó¤òºîÀ®¤¹¤ë¡£ +.B TMP_MAX +²ó°Ê¾å¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢¤½¤ÎÆ°ºî¤Ï¼ÂÁõ°Í¸¤Ç¤¢¤ë¡£ +.LP +.BR tmpnam () +¤Ï¿ä¬¤¬Æñ¤·¤¤Ì¾Á°¤òÀ¸À®¤¹¤ë¤¬¡¢¤½¤ì¤Ë¤â¤«¤«¤ï¤é¤º¡¢ +.BR tmpnam () +¤¬¥Ñ¥¹Ì¾¤òÊÖ¤·¤Æ¤«¤é¡¢¥×¥í¥°¥é¥à¤¬¤½¤Î¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë +¤Þ¤Ç¤Î´Ö¤Ë¡¢ÊÌ¤Î¥×¥í¥°¥é¥à¤¬Æ±¤¸¥Ñ¥¹Ì¾¤Ç¡¢¥Õ¥¡¥¤¥ë¤ò +.BR open (2) +¤ÇºîÀ®¤·¤¿¤ê¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤·¤¿¤ê¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤³¤ì¤Ï¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤Ë¤Ä¤Ê¤¬¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤½¤Î¤è¤¦¤Ê²ÄǽÀ­¤ò²óÈò¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.BR open (2) +¤Î +.B O_EXCL +¥Õ¥é¥°¤ò»È¤Ã¤Æ¥Ñ¥¹Ì¾¤ò¥ª¡¼¥×¥ó¤¹¤ì¤Ð¤è¤¤¡£ +¤â¤Ã¤È¤¤¤¤¤Î¤Ï¡¢ +.BR mkstemp (3) +¤ä +.BR tmpfile (3) +¤ò»È¤¦¤³¤È¤Ç¤¢¤ë¡£ +.LP +°Ü¿¢À­¤¬É¬Íפʡ¢¥¹¥ì¥Ã¥É¤ò»È¤Ã¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +.B _POSIX_THREADS +¤« +.B _POSIX_THREAD_SAFE_FUNCTIONS +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +.BR tmpnam () +´Ø¿ô¤ò NULL °ú¤­¿ô¤Ç¸Æ¤Ó½Ð¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.LP +POSIX Áð°Æ¤Ç¤Ï¡¢´Ø¿ô +.BR tmpnam_r () +¤ò»È¤¦¤³¤È¤òÄó°Æ¤·¤Æ¤¤¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +NULL ¤ò»È¤ï¤Ê¤¤¤è¤¦¤Ë¤È¤¤¤¦·Ù¹ð¤Î°ÕÌ£¤Ç NULL ¤òÊÌ°·¤¤¤·¤Æ¤¤¤ë¡£ +.sp +.nf +.in +4n +char * +tmpnam_r(char *s) +{ + return s ? tmpnam(s) : NULL; +} +.in +.fi +.sp +¿ô¤Ï¾¯¤Ê¤¤¤¬¡¢¤³¤Î´Ø¿ô¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Î glibc ¤Î¥×¥í¥È¥¿¥¤¥×¤ò»È¤¦¤Ë¤Ï¡¢ +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëÁ°¤Ë +.B _SVID_SOURCE +¤« +.B _BSD_SOURCE +¤òÄêµÁ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +.SH ¥Ð¥° +·è¤·¤Æ¤³¤Î´Ø¿ô¤ò»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£Âå¤ï¤ê¤Ë +.BR mkstemp (3) +¤« +.BR tmpfile (3) +¤ò»È¤¦¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mkstemp (3), +.BR mktemp (3), +.BR tempnam (3), +.BR tmpfile (3) diff --git a/release/man3/toascii.3 b/release/man3/toascii.3 new file mode 100644 index 00000000..9b2abd35 --- /dev/null +++ b/release/man3/toascii.3 @@ -0,0 +1,70 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" Copyright (c) 1995 by Jim Van Zandt +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Tue Dec 16 19:43:29 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. +.\" +.\" 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. +.\" +.\" Added BUGS section, aeb, 950919 +.\" +.TH TOASCII 3 2009-03-15 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +toascii \- ʸ»ú¤ò ASCII ¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int toascii(int " "c" ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR toascii (): +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE +.SH ÀâÌÀ +.BR toascii () +¤Ï¾å°Ì¥Ó¥Ã¥È¤ò¥¯¥ê¥¢¤¹¤ë»ö¤Ë¤è¤ê¡¢ +ASCII ʸ»ú¥»¥Ã¥È¤ËŬ¹ç¤¹¤ë¤è¤¦¤Ë \fIc\fP ¤ò 7¥Ó¥Ã¥È¤Î \fIunsigned char\fP +¤ËÊÑ´¹¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +ÊÑ´¹¤µ¤ì¤¿Ê¸»ú¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, BSD, POSIX.1-2001. +POSIX.1-2008 ¤Ï +.BR toascii () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +¥í¡¼¥«¥é¥¤¥º¤µ¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢°Ü¿¢À­¤ò³ÎÊݤ·¤Ä¤Ä¡¢ +¤³¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH ¥Ð¥° +¤³¤Î´Ø¿ô¤ò»È¤¦»ö¤Ç¤¿¤¯¤µ¤ó¤Î¿Í¡¹¤¬ÉÔ¹¬¤Ë¤Ê¤ë¤À¤í¤¦¡£ +¤³¤Î´Ø¿ô¤Ï¥¢¥¯¥»¥ó¥ÈÉÕ¤­¤Î»ú¤ò¤Ç¤¿¤é¤á¤Êʸ»ú¤ËÊÑ´¹¤·¤Æ¤·¤Þ¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR isascii (3), +.BR tolower (3), +.BR toupper (3) diff --git a/release/man3/toupper.3 b/release/man3/toupper.3 new file mode 100644 index 00000000..7f9f04de --- /dev/null +++ b/release/man3/toupper.3 @@ -0,0 +1,84 @@ +.\" 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:45:39 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2000-02-13 by Nicolas Lichtmaier +.\" +.\" Japanese Version Copyright (c) 1997 Ueyama Rui and HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Fri Aug 29 19:47:32 JST 1997 +.\" by Ueyama Rui +.\" by HIROFUMI Nishizuka +.\" Translated Sun Mar 12 21:42:31 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH TOUPPER 3 1993-04-04 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +toupper, tolower \- ¾®Ê¸»ú¤òÂçʸ»ú¤Ë¤¹¤ë¡£¤Þ¤¿¤ÏÂçʸ»ú¤ò¾®Ê¸»ú¤Ë¤¹¤ë¡£ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int toupper(int " "c" ); +.br +.BI "int tolower(int " "c" ); +.fi +.SH ÀâÌÀ +.BR toupper () +¤Ï¡¢ +.I c +¤¬Âçʸ»ú¤Ë¤Ç¤­¤ëʸ»ú¤Ç¤¢¤ë¤Ê¤é¤ÐÂçʸ»ú¤ËÊÑ´¹¤¹¤ë¡£ +.PP +.BR tolower () +¤Ï +.I c +¤¬¾®Ê¸»ú¤Ë¤Ç¤­¤ëʸ»ú¤Ç¤¢¤ë¤Ê¤é¤Ð¾®Ê¸»ú¤ËÊÑ´¹¤¹¤ë¡£ +.PP +¤â¤· +.I c +¤¬ +.I unsigned char +¤ÎÃͤǤʤ¤¤« +.B EOF +¤Ê¤é¤Ð¡¢¤³¤ì¤é¤Î´Ø¿ô¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +ÊÑ´¹¤¬¤Ç¤­¤ì¤ÐÊÑ´¹¸å¤Îʸ»ú¤òÊÖ¤¹¡£¤Ç¤­¤Ê¤±¤ì¤ÐÊÑ´¹Á°¤Î +.I c +¤òÊÖ¤¹¡£ +.SH ½àµò +C89, C99, 4.3BSD. +.SH ¥Ð¥° +¤Ê¤Ë¤¬Âçʸ»ú¤Ç¤Ê¤Ë¤¬¾®Ê¸»ú¤Ê¤Î¤«¤È¤¤¤¦¤³¤È¤Î¾ÜºÙ¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Ë +°Í¸¤·¤Æ¤¤¤ë¡£¤¿¤È¤¨¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤Î +.B """C""" +¥í¥±¡¼¥ë¤Ç¤Ï¥¦¥à¥é¥¦¥È¤òǧ¼±¤·¤Ê¤¤¤¿¤á¡¢¤½¤ì¤é¤Îʸ»ú¤ÏÊÑ´¹¤Ç¤­¤Ê¤¤¡£ +.PP +.\" ¤Þ¤¿¡¢±Ñ¸ì°Ê³°¤Î¥í¥±¡¼¥ë¤Ç¤Ï¡¢Âçʸ»ú¤È¾®Ê¸»ú¤¬Àµ¤·¤¯Âбþ¤·¤Ê¤¤ +.\" ¤³¤È¤¬¤¢¤ë¡£¤¿¤È¤¨¤Ð¡¢¥É¥¤¥Ä¸ì¤Î¥¨¥¹¥Ä¥§¥Ã¥È¤Ê¤É¤Ç¤¢¤ë¡£ +¤¤¤¯¤Ä¤«¤ÎÈó±Ñ¸ì¥í¥±¡¼¥ë¤Ç¤Ï¡¢Âбþ¤¹¤ëÂçʸ»ú¤ò»ý¤¿¤Ê¤¤¾®Ê¸»ú¤¬Â¸ºß¤¹¤ë¡£ +¥É¥¤¥Ä¸ì¤Î¥¨¥¹¥Ä¥§¥Ã¥È¤¬°ì¤Ä¤ÎÎã¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR isalpha (3), +.BR setlocale (3), +.BR towlower (3), +.BR towupper (3), +.BR locale (7) diff --git a/release/man3/towctrans.3 b/release/man3/towctrans.3 new file mode 100644 index 00000000..f18f59c4 --- /dev/null +++ b/release/man3/towctrans.3 @@ -0,0 +1,53 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 25 08:17:41 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.\" WORD: transliteration descriptor ÊÑ´¹µ­½Ò»Ò +.\" +.TH TOWCTRANS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +towctrans \- ¥ï¥¤¥Éʸ»ú¤ÎÊÑ´¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wint_t towctrans(wint_t " wc ", wctrans_t " desc ); +.fi +.SH ÀâÌÀ +\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð¡¢ +.BR towctrans () +´Ø¿ô¤ÏÊÑ´¹µ­½Ò»Ò +\fIdesc\fP ¤Ë½¾¤Ã¤Æ¤½¤Îʸ»ú¤òÊÑ´¹¤¹¤ë¡£\fIwc\fP ¤¬ \fBWEOF\fP ¤Ê¤é¤Ð¡¢ +\fBWEOF\fP ¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +\fIdesc\fP ¤Ï¡¢ +.BR wctrans (3) +¤¬ÊÖ¤·¤¿ÊÑ´¹µ­½Ò»Ò¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR towctrans () +´Ø¿ô¤Ï¡¢ÊÑ´¹·ë²Ì¤Î¥ï¥¤¥Éʸ»ú¤òÊÖ¤¹¡£\fIwc\fP ¤¬ \fBWEOF\fP +¤Ê¤é¤Ð¡¢\fBWEOF\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR towctrans () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR towlower (3), +.BR towupper (3), +.BR wctrans (3) diff --git a/release/man3/towlower.3 b/release/man3/towlower.3 new file mode 100644 index 00000000..bbf2d6f7 --- /dev/null +++ b/release/man3/towlower.3 @@ -0,0 +1,53 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 25 08:06:53 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH TOWLOWER 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +towlower \- ¥ï¥¤¥Éʸ»ú 1 ¸Ä¤ò¾®Ê¸»ú¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wint_t towlower(wint_t " wc ); +.fi +.SH ÀâÌÀ +.BR towlower () +´Ø¿ô¤Ï¡¢ +.BR tolower (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð¡¢¤³¤Îʸ»ú¤Ï¾®Ê¸»ú¤ËÊÑ´¹¤µ¤ì¤ë¡£ +Âçʸ»ú¡¦¾®Ê¸»ú¤Î¶èÊ̤¬¤Ê¤¤Ê¸»ú¤ÏÊÑ´¹¤µ¤ì¤º¤ËÊÖ¤µ¤ì¤ë¡£ +\fIwc\fP ¤¬ \fBWEOF\fP ¤Ê¤é¤Ð¡¢\fBWEOF\fP ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR towlower () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤ËÂбþ¤¹¤ë¾®Ê¸»ú¤òÊÖ¤¹¡£\fIwc\fP ¤¬ +\fBWEOF\fP ¤Ê¤é¤Ð¡¢\fBWEOF\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR towlower () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤ò Unicode ʸ»ú¤ËÂФ·¤Æ»È¤¦¤Î¤Ï¤¢¤Þ¤êŬÀڤǤʤ¤¡£¤Ê¤¼¤Ê¤é¡¢ +Unicode ¤Ë¤Ï¡¢Âçʸ»ú (upper case)¡¦¾®Ê¸»ú (lower case)¡¦ +¥¿¥¤¥È¥ëʸ»ú (title case) ¤È¤¤¤¦ 3 ¤Ä¤Î "case" ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iswlower (3), +.BR towctrans (3), +.BR towupper (3) diff --git a/release/man3/towupper.3 b/release/man3/towupper.3 new file mode 100644 index 00000000..723df8b8 --- /dev/null +++ b/release/man3/towupper.3 @@ -0,0 +1,52 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 25 08:16:12 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH TOWUPPER 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +towupper \- ¥ï¥¤¥Éʸ»ú 1 ¸Ä¤òÂçʸ»ú¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wint_t towupper(wint_t " wc ); +.fi +.SH ÀâÌÀ +.BR towupper () +´Ø¿ô¤Ï¡¢ +.BR toupper (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +\fIwc\fP ¤¬¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð¡¢¤³¤Îʸ»ú¤ÏÂçʸ»ú¤ËÊÑ´¹¤µ¤ì¤ë¡£ +Âçʸ»ú¡¦¾®Ê¸»ú¤Î¶èÊ̤¬¤Ê¤¤Ê¸»ú¤ÏÊÑ´¹¤µ¤ì¤º¤ËÊÖ¤µ¤ì¤ë¡£ +\fIwc\fP ¤¬ \fBWEOF\fP ¤Ê¤é¤Ð¡¢\fBWEOF\fP ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR towupper () +´Ø¿ô¤Ï¡¢\fIwc\fP ¤ËÂбþ¤¹¤ëÂçʸ»ú¤òÊÖ¤¹¡£\fIwc\fP ¤¬ +\fBWEOF\fP ¤Ê¤é¤Ð¡¢\fBWEOF\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +\fBtowlower\fP ¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤ò Unicode ʸ»ú¤ËÂФ·¤Æ»È¤¦¤Î¤Ï¤¢¤Þ¤êŬÀڤǤʤ¤¡£¤Ê¤¼¤Ê¤é¡¢ +Unicode ¤Ë¤Ï¡¢Âçʸ»ú (upper case)¡¦¾®Ê¸»ú (lower case)¡¦ +¥¿¥¤¥È¥ëʸ»ú (title case) ¤È¤¤¤¦ 3 ¤Ä¤Î "case" ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iswupper (3), +.BR towctrans (3), +.BR towlower (3) diff --git a/release/man3/trunc.3 b/release/man3/trunc.3 new file mode 100644 index 00000000..28ed173a --- /dev/null +++ b/release/man3/trunc.3 @@ -0,0 +1,86 @@ +.\" 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) 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 2008-08-11 "" "Linux Programmer's Manual" +.SH ̾Á° +trunc, truncf, truncl \- 0 ¤Ë¶á¤¤Êý¤ÎÀ°¿ôÃͤ˴ݤá¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double trunc(double " x ); +.br +.BI "float truncf(float " x ); +.br +.BI "long double truncl(long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR trunc (), +.BR truncf (), +.BR truncl (): +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤ÏÀäÂÐÃͤ¬ \fIx\fP ¤è¤ê¾®¤µ¤¤ +°ìÈֶᤤÀ°¿ôÃÍ¤Ë \fIx\fP ¤ò´Ý¤á¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï´Ý¤á¤é¤ì¤¿À°¿ôÃͤòÊÖ¤¹¡£ + +\fIx\fP ¤¬À°¿ô¡¢Ìµ¸ÂÂç¡¢NaN ¤Î¾ì¹ç¡¢\fIx\fP ¼«¿È¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ½àµò +C99, POSIX.1-2001. +.SH Ãí°Õ +¤³¤ì¤é¤Î´Ø¿ô¤¬ÊÖ¤¹À°¿ôÃͤÏÀ°¿ô·¿ +.RI ( int , +.I long +¤Ê¤É) ¤Ë³ÊǼ¤¹¤ë¤Ë¤ÏÂ礭²á¤®¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Î·ë²Ì¤Ïʬ¤«¤é¤Ê¤¤¤Î¤Ç¡¢ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òÈò¤±¤ë¤¿¤á¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤ÏÀ°¿ô·¿¤ËÂåÆþ¤¹¤ëÁ°¤Ë +ÊÖ¤µ¤ì¤¿ÃͤÎÈϰϳÎǧ¤ò¼Â¹Ô¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ceil (3), +.BR floor (3), +.BR lrint (3), +.BR nearbyint (3), +.BR rint (3), +.BR round (3) diff --git a/release/man3/tsearch.3 b/release/man3/tsearch.3 new file mode 100644 index 00000000..4e01a3e2 --- /dev/null +++ b/release/man3/tsearch.3 @@ -0,0 +1,254 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" Copyright 1995 by Jim Van Zandt +.\" +.\" 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 ishikawa, keisuke +.\" all rights reserved. +.\" Translated Tue Mar 9 08:21:04 JST 1999 +.\" by ishikawa, keisuke +.\" Updated & Modified Sun Jan 20 11:31:46 JST 2002 +.\" by Yuichi SATO +.\" +.TH TSEARCH 3 2008-09-23 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +tsearch, tfind, tdelete, twalk, tdestroy \- ÆóʬÌÚ (binary tree) ¤ÎÁàºî +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void *tsearch(const void *" key ", void **" rootp , +.BI " int (*" compar ")(const void *, const void *));" +.sp +.BI "void *tfind(const void *" key ", const void **" rootp , +.BI " int (*" compar ")(const void *, const void *));" +.sp +.BI "void *tdelete(const void *" key ", void **" rootp , +.BI " int (*" compar ")(const void *, const void *));" +.sp +.BI "void twalk(const void *" root ", void (*" action ")(const void *" nodep , +.BI " const VISIT " which , +.BI " const int " depth "));" +.sp +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "void tdestroy(void *" root ", void (*" free_node ")(void *" nodep )); +.fi +.SH ÀâÌÀ +.BR tsearch (), +.BR tfind (), +.BR twalk (), +.BR tdelete () +¤Ï +ÆóʬÌÚ¤òÁàºî¤¹¤ë´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î´Ø¿ô¤Ï Knuth (6.2.2) Algorithm T ¤Ë´ð¤Å¤¤¤Æ¤¤¤ë¡£ +ÌÚ¹½Â¤¤Ë¤ª¤±¤ë³Æ¥Î¡¼¥É¤ÎºÇ½é¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢Âбþ¤¹¤ë¥Ç¡¼¥¿¡¦ +¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +(»²¾ÈÀè¤Î¥Ç¡¼¥¿¤Ï¡¢¸Æ¤Ó½Ð¤·¥×¥í¥°¥é¥à¤ÇÍÑ°Õ¤¹¤ë¡£) +\fIcompar\fP ¤ÏÈæ³Ó¥ë¡¼¥Á¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +Èæ³Ó¥ë¡¼¥Á¥ó¤Ï¡¢¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿ 2 ¤Ä¤ò°ú¿ô¤Ë»ý¤Ä¡£ +Èæ³Ó¥ë¡¼¥Á¥ó¤ÎÊÖ¤êÃͤϡ¢1 ¤ÄÌܤΥ¢¥¤¥Æ¥à¤¬ 2 ¤ÄÌܤΥ¢¥¤¥Æ¥à¤è¤ê¤â +¡Ö¾®¤µ¤¤¡¢Åù¤·¤¤¡¢Â礭¤¤¡×¤Ë¤è¤Ã¤Æ¡¢ +¡ÖÉé¡¢0¡¢Àµ¡×¤ÎÀ°¿ôÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.BR tsearch () +¤Ï¡¢ÌÚ¹½Â¤¤«¤é¥¢¥¤¥Æ¥à¤ò¸¡º÷¤¹¤ë´Ø¿ô¤Ç¤¢¤ë¡£ +\fIkey\fP ¤Ï¡¢¸¡º÷¤¹¤ë¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +\fIrootp\fP ¤ÏÌÚ¹½Â¤¤Îº¬¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +ÌÚ¹½Â¤¤¬¥Î¡¼¥É¤ò´Þ¤Þ¤Ê¤¤¾ì¹ç¡¢\fIrootp\fP ¤Î»²¾È¤·¤Æ¤¤¤ëÊÑ¿ô¤Ï +NULL ¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ÌÚ¹½Â¤¤Ë¥¢¥¤¥Æ¥à¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¡¢ +.BR tsearch () +¤Ï¤½¤Î¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢¥¢¥¤¥Æ¥à¤òÌÚ¹½Â¤¤ËÄɲä·¡¢ +Äɲä·¤¿¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.PP +.BR tfind () +¤Ï¡¢ +.BR tsearch () +¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ +¥¢¥¤¥Æ¥à¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç NULL ¤òÊÖ¤¹ÅÀ¤¬°Û¤Ê¤ë¡£ +.PP +.BR tdelete () +¤ÏÌÚ¹½Â¤¤«¤é¥¢¥¤¥Æ¥à¤òºï½ü¤¹¤ë¡£ +°ú¿ô¤Ï +.BR tsearch () +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.PP +.BR twalk () +¤Ï¡¢ÆóʬÌÚ¤ò¿¼¤µÍ¥Àè (depth-first) ¤Ç¡¢ +º¸¤«¤é±¦¤Ë¤¿¤É¤Ã¤Æ¤¤¤¯´Ø¿ô¤Ç¤¢¤ë¡£ +\fIroot\fP ¤Ïµ¯ÅÀ¤È¤Ê¤ë¥Î¡¼¥É¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +\fIroot\fP ¤Ëº¬°Ê³°¤Î¥Î¡¼¥É¤ò»ØÄꤹ¤ë¤È¡¢ÉôʬÌÚ¤¬ÂоݤȤʤ롣 +.BR twalk () +¤Ï¡¢¥Î¡¼¥É¤òˬ¤ì¤ëÅÙ¤Ë +(¤Ä¤Þ¤ê¡¢ÆâÉô¥Î¡¼¥É¤ËÂФ·¤Æ¤Ï 3 ²ó¡¢ÍÕ¤ËÂФ·¤Æ¤Ï 1 ²ó) +¥æ¡¼¥¶´Ø¿ô \fIaction\fP ¤ò¸Æ¤Ó½Ð¤¹¡£ +\fIaction\fP ¤Ë¤Ï°Ê²¼¤Î½ç¤Ë 3 ¤Ä¤Î°ú¿ô¤¬Í¿¤¨¤é¤ì¤ë¡£ +ºÇ½é¤Î°ú¿ô¤Ïˬ¤ì¤¿¥Î¡¼¥É¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +2 ¤ÄÌܤΰú¿ô¤Ë¤Ï¡¢ÆâÉô¥Î¡¼¥É¤Î¾ì¹ç¤ÏˬÌä²ó¿ô¤Ë±þ¤¸¤Æ +\fBpreorder\fP, \fBpostorder\fP, \fBendorder\fP ¤¬¡¢ +Íդξì¹ç¤Ï \fBleaf\fP ¤¬Í¿¤¨¤é¤ì¤ë¡£ +(¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤Ï \fI\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£) +3 ¤ÄÌܤΰú¿ô¤Ï¥Î¡¼¥É¤Î¿¼¤µ¤Ç¡¢º¬¤Î¾ì¹ç¤Ï 0 ¤Ç¤¢¤ë¡£ +.PP +(¤è¤ê°ìÈÌŪ¤Ë¤Ï¡¢\fBpreorder\fP, \fBpostorder\fP, \fBendorder\fP ¤Ï +\fBpreorder\fP, \fBinorder\fP, \fBpostorder\fP ¤È¤·¤ÆÃΤé¤ì¤Æ¤¤¤ë: +¤½¤ì¤¾¤ì¡¢»ÒÍ×ÁǤòé¤ëÁ°¡¦ºÇ½é¤Î»ÒÍ×ÁǤòé¤Ã¤¿¸å¤«¤Ä 2 ÈÖÌܤλÒÍ×ÁǤòé¤ëÁ°¡¦ +»ÒÍ×ÁǤòé¤Ã¤¿¸å¤È¤¤¤¦¤³¤È¤òɽ¤·¤Æ¤¤¤ë¡£ +¤è¤Ã¤Æ \fBpost\%order\fP ¤È¤¤¤¦Ì¾Á°¤òÁª¤Ö¤Î¤Ï¾¯¤·Ê¶¤é¤ï¤·¤¤¡£) +.PP +.BR tdestroy () +¤Ï \fIroot\fP ¤¬»Ø¤¹ÌÚ¹½Â¤Á´ÂΤòºï½ü¤·¡¢ +.BR tsearch () +´Ø¿ô¤Ç³ÎÊݤµ¤ì¤¿¥ê¥½¡¼¥¹¤òÁ´¤Æ²òÊü¤¹¤ë¡£ +ÌÚ¹½Â¤¤Î³Æ¥Î¡¼¥É¤Ë¤Ä¤¤¤Æ¡¢´Ø¿ô \fIfree_node\fP ¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬¤³¤Î´Ø¿ô¤Î°ú¿ô¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +¤½¤Î¤è¤¦¤ÊÆ°ºî¤¬É¬ÍפǤʤ±¤ì¤Ð¡¢ +\fIfree_node\fP ¤Ï²¿¤â¤·¤Ê¤¤´Ø¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR tsearch () +¤Ï¡¢ÌÚ¹½Â¤¤Ë¸«¤Ä¤«¤Ã¤¿¥¢¥¤¥Æ¥à¤«¡¢ +¿·¤·¤¯Äɲä·¤¿¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥á¥â¥ê¤ÎÉÔ­¤Î¤¿¤á¥¢¥¤¥Æ¥à¤òÄɲäǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.BR tfind () +¤Ï¡¢¥¢¥¤¥Æ¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +°ìÃפ¹¤ë¥¢¥¤¥Æ¥à¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +¸¡º÷¾ò·ï¤Ë°ìÃפ¹¤ëÍ×ÁǤ¬Ê£¿ô¤¢¤ë¾ì¹ç¡¢ÊÖ¤µ¤ì¤ëÃͤÏÉÔÄê¤Ç¤¢¤ë¡£ +.PP +.BR tdelete () +¤Ïºï½ü¤·¤¿¥¢¥¤¥Æ¥à¤Î¿Æ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¢¥¤¥Æ¥à¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£ +.PP +\fIrootp\fP ¤¬ NULL ¤Î¾ì¹ç¡¢ +.BR tsearch (), +.BR tfind (), +.BR tdelete () +¤Ï NULL ¤òÊÖ¤¹¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +´Ø¿ô +.BR tdestroy () +¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR twalk () +¤Ïº¬¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò°ú¿ô¤Ë¤È¤ë¤¬¡¢ +¤Û¤«¤Î´Ø¿ô¤Ïº¬¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.PP +.BR twalk () +¤Ë¤ª¤¤¤Æ¤Ï¡¢\fBpostorder\fP ¤Ï +¡Öº¸¤ÎÉôʬÌڤθå¤Ç¡¢±¦¤ÎÉôʬÌÚ¤ÎÁ°¡×¤ò°ÕÌ£¤·¤Æ¤¤¤ë¡£ +¤·¤«¤·¡¢¿Í¤Ë¤è¤Ã¤Æ¤Ï¤³¤ì¤ò "inorder" ¤È¸Æ¤ó¤Ç¡¢ +"postorder" ¤ò¡ÖξÊý¤ÎÉôʬÌڤθå¡×¤È¤¹¤ë¾ì¹ç¤â¤¢¤ë¡£ +.PP +.BR tdelete () +¤Ï¡¢ºï½ü¤·¤¿¥Î¡¼¥É¤Î»ÈÍѤ·¤Æ¤¤¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë¤¬¡¢ +¥Î¡¼¥É¤ËÂбþ¤¹¤ë¥Ç¡¼¥¿¤Î¥á¥â¥ê¤Ï¡¢¥æ¡¼¥¶¤¬²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +²¼¤Î¥×¥í¥°¥é¥àÎã¤Ï¡¢¥æ¡¼¥¶´Ø¿ô¤¬ "endorder" ¤« "leaf" ¤ò°ú¿ô¤Ë¤·¤Æ +¸Æ¤Ó½Ð¤µ¤ì¤Æ°Ê¹ß¤Ï¡¢ +.BR twalk () +¤¬¤½¤Î¥Î¡¼¥É¤ò»²¾È¤·¤Ê¤¤¤³¤È¤òÁ°Äó¤È¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï GNU ¥é¥¤¥Ö¥é¥ê¤Î¼ÂÁõ¤Ç¤Ïµ¡Ç½¤¹¤ë¤¬¡¢System V ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤Ï¸ºß¤·¤Ê¤¤¡£ +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï 12 ¸Ä¤ÎÍð¿ô¤òÆóʬÌÚ¤ËÁÞÆþ¤·¤¿¸å¡¢ +ÁÞÆþ¤·¤¿¿ô¤ò½çÈ֤˽ÐÎϤ¹¤ë (ÁÞÆþ¤ÎºÝ¡¢½ÅÊ£¤·¤¿Íð¿ô¤Ï 1 ¤Ä¤Ë¤Þ¤È¤á¤é¤ì¤ë)¡£ +.sp +.nf +#define _GNU_SOURCE /* Expose declaration of tdestroy() */ +#include +#include +#include +#include + +void *root = NULL; + +void * +xmalloc(unsigned n) +{ + void *p; + p = malloc(n); + if (p) + return p; + fprintf(stderr, "insufficient memory\\n"); + exit(EXIT_FAILURE); +} + +int +compare(const void *pa, const void *pb) +{ + if (*(int *) pa < *(int *) pb) + return \-1; + if (*(int *) pa > *(int *) pb) + return 1; + return 0; +} + +void +action(const void *nodep, const VISIT which, const int depth) +{ + int *datap; + + switch (which) { + case preorder: + break; + case postorder: + datap = *(int **) nodep; + printf("%6d\\n", *datap); + break; + case endorder: + break; + case leaf: + datap = *(int **) nodep; + printf("%6d\\n", *datap); + break; + } +} + +int +main(void) +{ + int i, *ptr; + void *val; + + srand(time(NULL)); + for (i = 0; i < 12; i++) { + ptr = (int *) xmalloc(sizeof(int)); + *ptr = rand() & 0xff; + val = tsearch((void *) ptr, &root, compare); + if (val == NULL) + exit(EXIT_FAILURE); + else if ((*(int **) val) != ptr) + free(ptr); + } + twalk(root, action); + tdestroy(root, free); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR bsearch (3), +.BR hsearch (3), +.BR lsearch (3) +.BR qsort (3), +.BR feature_test_macros (7) diff --git a/release/man3/ttyname.3 b/release/man3/ttyname.3 new file mode 100644 index 00000000..cac5d0da --- /dev/null +++ b/release/man3/ttyname.3 @@ -0,0 +1,80 @@ +.\" Copyright (c) 1995 Jim Van Zandt +.\" +.\" 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 2001-12-13, Martin Schulze +.\" Added ttyname_r, aeb, 2002-07-20 +.\" +.\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya +.\" all rights reserved. +.\" Translated Mon Feb 10 1997 by Hiroaki Nagoya +.\" Updated Fri Dec 21 JST 2001 by Kentaro Shirakata +.\" Updated Fri Oct 16 JST 2002 by Kentaro Shirakata +.\" +.TH TTYNAME 3 2008-07-14 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ttyname, ttyname_r \- üËö̾¤òÊÖ¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "char *ttyname(int " fd ); + +.BI "int ttyname_r(int " fd ", char *" buf ", size_t " buflen ); +.fi +.SH ÀâÌÀ +.BR ttyname () +´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ \fIfd\fP ¤¬¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ëüËö¥Ç¥Ð¥¤¥¹¤Î +NULL ½ªÃ¼¤µ¤ì¤¿¥Ñ¥¹Ì¾¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬µ¯¤­¤¿¤Ê¤é¤Ð NULL ¤òÊÖ¤¹ +(¤¿¤È¤¨¤Ð¡¢\fIfd\fP ¤¬Ã¼Ëö¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¤È¤­)¡£ +ÊÖ¤êÃͤÏÀÅŪ¥Ç¡¼¥¿¤ò»Ø¤·¤Æ¤¤¤ë¤Î¤Ç¡¢¼¡¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.BR ttyname_r () +´Ø¿ô¤Ï¡¢¤³¤Î¥Ñ¥¹Ì¾¤òŤµ +.I buflen +¤Î¥Ð¥Ã¥Õ¥¡ +.I buf +¤Ë³ÊǼ¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR ttyname () +´Ø¿ô¤Ï¡¢À®¸ù»þ¤Ï¥Ñ¥¹Ì¾¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¨¥é¡¼»þ¤Ï NULL ¤òÊÖ¤·¡¢ +.I errno +¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£ +.BR ttyname_r () +´Ø¿ô¤Ï¡¢À®¸ù»þ¤Ë¤Ï 0 ¤òÊÖ¤·¡¢¥¨¥é¡¼»þ¤Ë¤Ï¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.BR ttyname_r (): +.TP +.B EBADF +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¡£ +.TP +.B ENOTTY +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Ã¼Ëö¥Ç¥Ð¥¤¥¹¤ò¼¨¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ERANGE +.I buflen +¤¬¥Ñ¥¹Ì¾¤ò³ÊǼ¤¹¤ë¤Ë¤Ïû¤¹¤®¤ë¡£ +.SH ½àµò +4.2BSD, POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR fstat (2), +.BR isatty (3) diff --git a/release/man3/ttyslot.3 b/release/man3/ttyslot.3 new file mode 100644 index 00000000..d8d4a0b6 --- /dev/null +++ b/release/man3/ttyslot.3 @@ -0,0 +1,159 @@ +.\" Copyright (C) 2002 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. +.\" +.\" This replaces an earlier man page written by Walter Harms +.\" . +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Wed Sep 8 01:25:01 JST 2004 +.\" by Yuichi SATO +.\" +.TH TTYSLOT 3 2007-11-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +ttyslot \- ¥«¥ì¥ó¥È¥æ¡¼¥¶¤ÎüËö¤Î¥¹¥í¥Ã¥È¤ò¥Õ¥¡¥¤¥ë¤«¤éõ¤¹ +.SH ½ñ¼° +.BR "#include " " /* BSD ·Ï¤Î¥·¥¹¥Æ¥à¤È Linux ¤Î¾ì¹ç */" +.br +.BR "#include " " /* System V ·Ï¤Î¥·¥¹¥Æ¥à¤Î¾ì¹ç */" +.sp +.B "int ttyslot(void);" +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR ttyslot (): +_BSD_SOURCE || (_XOPEN_SOURCE_EXTENDED && !\ _XOPEN_SOURCE\ >=\ 500) +.ad b +.SH ÀâÌÀ +¥ì¥¬¥·¡¼¤Ê´Ø¿ô +.BR ttyslot () +¤Ï¡¢¤¢¤ë¥Õ¥¡¥¤¥ë¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥«¥ì¥ó¥È¥æ¡¼¥¶¤Î¥¨¥ó¥È¥ê¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÖ¤¹¡£ +.LP +¡Ö¤É¤Î¥Õ¥¡¥¤¥ë¤Ê¤Î¤«¡©¡×¤È¤¤¤¦¼ÁÌ䤬¤¢¤ë¤À¤í¤¦¡£ +¤Ç¤Ï¡¢¤Þ¤ººÇ½é¤Ë¤½¤ÎÎò»Ë¤ò¸«¤Æ¤ß¤è¤¦¡£ +.SS ÂçÀΤÎÎò»Ë +Unix V6 ¤Ç¤Ï +.I /etc/ttys +¥Õ¥¡¥¤¥ë¤¬»È¤ï¤ì¤Æ¤¤¤¿¡£ +.BR init (8) +¥×¥í¥°¥é¥à¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤ß¡¢ +³ÆüËö¹Ô¤Ç²¿¤ò¤¹¤Ù¤­¤«¤òõ¤¹¡£ +³Æ¹Ô¤Ï 3 ʸ»ú¤«¤é¹½À®¤µ¤ì¤Æ¤¤¤ë¡£ +1 ʸ»úÌÜ¤Ï \(aq0\(aq ¤Þ¤¿¤Ï \(aq1\(aq ¤Ç¤¢¤ê¡¢ +\(aq0\(aq ¤Ï¡Ö̵»ë¤¹¤ë¡×¤³¤È¤òɽ¤¹¡£ +2 ʸ»úÌܤÏüËö¤ò¼¨¤¹: \(aq8\(aq ¤Ï "/dev/tty8" ¤òɽ¤¹¡£ +3 ʸ»úÌÜ¤Ï +.BR getty (8) +¤Ø¤Î°ú¤­¿ô¤Ç¤¢¤ê¡¢(Àܳ¤ò) »î¤ß¤ë²óÀþ®Å٤νç½ø¤òɽ¤¹ +(\(aq\-\(aq ¤Ï 110 ¥Ü¡¼¤ÇÀܳ¤Î»î¹Ô¤ò³«»Ï¤¹¤ë¤³¤È¤òɽ¤¹)¡£ +¤è¤Ã¤Æ°ìÈÌŪ¤Ê¹Ô¤Ï "18\-" ¤È¤Ê¤ë¡£ +¤¢¤ë¹Ô¤Ç¥Ï¥ó¥°¤·¤¿¾ì¹ç¤Ï¡¢\(aq1\(aq ¤ò \(aq0\(aq ¤ËÊѹ¹¤·¡¢ +init ¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ê¡¢\(aq0\(aq ¤ò \(aq1\(aq ºÆÅÙ¤ËÊѹ¹¤·¡¢ +init ¤ËºÆÅÙ¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤Ç²ò·è¤¹¤ë¡£ +.LP +Unix V7 ¤Ç¤Ï¥Õ¥©¡¼¥Þ¥Ã¥È¤¬Êѹ¹¤µ¤ì¤¿: +2 ʸ»úÌܤ¬ +.BR getty (8) +¤Î°ú¤­¿ô¤È¤Ê¤ê¡¢(Àܳ¤ò) »î¤ß¤ë²óÀþ®Å٤νç½ø¤òɽ¤¹¤è¤¦¤Ë¤Ê¤ê +(\(aq0\(aq ¤Ï 300-1200-150-110 ¤ò·«¤êÊÖ¤¹¤³¤È¤òɽ¤·¡¢ +\(aq4\(aq ¤Ï¥ª¥ó¥é¥¤¥ó¥³¥ó¥½¡¼¥ë DECwriter ¤òɽ¤¹)¡¢ +¹Ô¤Î»Ä¤ê (¤Îʸ»ú) ¤ÏüËö̾¤È¤Ê¤Ã¤¿¡£ +¤è¤Ã¤Æ¡¢°ìÈÌŪ¤Ê¹Ô¤Ï "14console" ¤È¤Ê¤ë¡£ +.LP +¸å¼Ô¤Î¥·¥¹¥Æ¥à¤Î½ñ¼°¤Ï¡¢¤è¤êÀº¹ª¤Ç¤¢¤ë¡£ +System V ·Ï¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢Âå¤ï¤ê¤Ë +.I /etc/inittab +¤¬¤¢¤ë¡£ +.SS "ÂçÀΤÎÎò»Ë (2)" +°ìÊý¡¢¸½ºß¥í¥°¥¤¥ó¤·¤Æ¤¤¤ë¿Í¤ò¥ê¥¹¥È¤¹¤ë¥Õ¥¡¥¤¥ë +.I /etc/utmp +¤¬¤¢¤ë¡£ +¤³¤ì¤Ï +.BR login (1) +¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¸ÇÄꤵ¤ì¤¿¥µ¥¤¥º¤Ç¤¢¤ê¡¢¥Õ¥¡¥¤¥ëÆâ¤ÎŬÀڤʥ¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¡¢ +.BR login (1) +¤Ë¤è¤Ã¤Æ·èÄꤵ¤ì¤ë¡£ +¤³¤ÎºÝ¤Ë +.BR ttyslot () +¤¬¸Æ¤Ð¤ì¤Æ¡¢ +.I /etc/ttys +¤Ë¤ª¤±¤ë¹ÔÈÖ¹æ¤ò¸«¤Ä¤±¤ë (¹ÔÈÖ¹æ¤Ï 1 ¤«¤é¿ô¤¨¤ë)¡£ +.SS "ttyslot ¤Î°ÕÌ£" +¤è¤Ã¤Æ¡¢´Ø¿ô +.BR ttyslot () +¤Ï¡¢¥Õ¥¡¥¤¥ë +.I /etc/ttys +¤Ë¤ª¤±¤ë¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÖ¤¹¡£ +¤³¤ì¤Ï +.I /etc/utmp +¤Ë¤ª¤±¤ë¥«¥ì¥ó¥È¥æ¡¼¥¶¤Î¥¨¥ó¥È¥ê¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤È (Ä̾ï¤Ï) Åù¤·¤¤¡£ +BSD ¤Ë¤Ï̤¤À¤Ë +.I /etc/ttys +¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¤¬¡¢System V ·Ï¤Î¥·¥¹¥Æ¥à¤Ë¤Ï¤Ê¤¤¤Î¤Ç¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¤è¤Ã¤Æ¡¢¤½¤Î¤è¤¦¤Ê¥·¥¹¥Æ¥à¤Ç¤Ï +.RB ¡Ö ttyslot () +¤Ï¥«¥ì¥ó¥È¥æ¡¼¥¶¤Î¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤ª¤±¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÖ¤¹¡× +¤È¥É¥­¥å¥á¥ó¥È¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï¥¹¥í¥Ã¥ÈÈÖ¹æ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç +(Î㤨¤Ð¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ 0, 1, 2 ¤Î²¿¤ì¤â +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤¢¤ëüËö¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢ +Unix V6, V7, BSD ·Ï¤Î¥·¥¹¥Æ¥à¤Ï 0 ¤òÊÖ¤¹¤¬¡¢ +System V ·Ï¤Î¥·¥¹¥Æ¥à¤Ï -1 ¤òÊÖ¤¹¡£ +.SH ½àµò +SUSv1¡£SUSv2 ¤Ç¤Ï¡Ö²áµî¤Î̾»Ä (LEGACY)¡×¤È°ÌÃÖÉÕ¤±¤é¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Çºï½ü¤µ¤ì¤¿¡£ +SUSv2 ¤Ç¤Ï¥¨¥é¡¼»þ¤Ë \-1 ¤òÊÖ¤¹¤³¤È¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +utmp ¥Õ¥¡¥¤¥ë¤ÏÍÍ¡¹¤Ê¥·¥¹¥Æ¥à¤Ç +.IR /etc/utmp , +.IR /var/adm/utmp , +.I /var/run/utmp +¤Î¤è¤¦¤Ë¤¤¤í¤¤¤í¤Ê¾ì½ê¤Ë¤¢¤ë¡£ +.LP +¤³¤Î´Ø¿ô¤Î glibc2 ¤Ë¤ª¤±¤ë¼ÂÁõ¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë +.B _PATH_TTYS +¤òÆɤ߹þ¤à¡£ +¤³¤ì¤Ï +.I +¤Ë¤ª¤¤¤Æ "/etc/ttys" ¤ÈÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¡¢0 ¤òÊÖ¤¹¡£ +Linux ¥·¥¹¥Æ¥à¤Ë¤ÏÄ̾ï "/etc/ttys" ¤¬¤Ê¤¤¤Î¤Ç¡¢¾ï¤Ë 0 ¤òÊÖ¤¹¡£ +.LP +Minix ¤Ë¤Ï +.IR fttyslot ( fd ) +¤â¤¢¤ë¡£ +.\" .SH ÍúÎò +.\" .BR ttyslot () +.\" ¤Ï Unix V7 ¤ËÅо줷¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getttyent (3), +.BR ttyname (3), +.BR utmp (5) diff --git a/release/man3/tzset.3 b/release/man3/tzset.3 new file mode 100644 index 00000000..24bab456 --- /dev/null +++ b/release/man3/tzset.3 @@ -0,0 +1,253 @@ +.\" 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 Sun Jul 25 11:01:58 1993 by Rik Faith (faith@cs.unc.edu) +.\" 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 ¥°¥ê¥Ë¥Ã¥¸»Ò¸áÀþ +.\" +.TH TZSET 3 2010-02-25 "" "Linux Programmer's Manual" +.SH ̾Á° +tzset, tzname, timezone, daylight \- »þ¹ï¤ÎÊÑ´¹¾ðÊó¤ò½é´ü²½¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.B void tzset (void); +.sp +.BI "extern char *" tzname [2]; +.BI "extern long " timezone ; +.BI "extern int " daylight ; +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR tzset (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.br +.IR tzname : +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +.br +.IR timezone : +_SVID_SOURCE || _XOPEN_SOURCE +.br +.IR daylight : +_SVID_SOURCE || _XOPEN_SOURCE +.SH ÀâÌÀ +.BR tzset () +´Ø¿ô¤Ï +.B TZ +´Ä¶­ÊÑ¿ô¤òÍѤ¤¤Æ \fItzname\fP ÊÑ¿ô¤ò½é´ü²½¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢¥¿¥¤¥à¥¾¡¼¥ó¤Ë°Í¸¤¹¤ë¾¤Î»þ¹ïÊÑ´¹´Ø¿ô¤«¤é¼«Æ°Åª¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +System V Ū¤Ê´Ä¶­¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ÏÊÑ¿ô \fItimezone\fP (UTC ¤«¤é¤ÎÀ¾¸þ¤­¤ÎÉÿô) ¤È +\fIdaylight\fP (¤³¤Î¥¿¥¤¥à¥¾¡¼¥ó¤Ë¥µ¥Þ¡¼¥¿¥¤¥à¤Ë´Ø¤¹¤ë¥ë¡¼¥ë¤¬¤Ê¤±¤ì¤Ð 0¡¢ +¥µ¥Þ¡¼¥¿¥¤¥à´ü´Ö¤¬°ìǯ¤Î¤É¤³¤«¤Ë¤¢¤ì¤Ð 0 °Ê³°) ¤âÀßÄꤹ¤ë¡£ +.PP +.B TZ +´Ä¶­ÊÑ¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +\fItzname\fP ÊÑ¿ô¤Ï¥í¡¼¥«¥ë¤ÊÊÉ»þ·×»þ¹ï (wall clock time) ¤Ë +ºÇ¤â¶á¤¤Ãͤ˽é´ü²½¤µ¤ì¤ë¡£ +¤³¤Î¥í¡¼¥«¥ë¤ÊÊÉ»þ·×»þ¹ï¤È¤·¤Æ¤Ï¡¢ +¥·¥¹¥Æ¥à¤Î¥¿¥¤¥à¥¾¡¼¥ó¥Ç¥£¥ì¥¯¥È¥ê (¸å½Ò) ¤Ë¤¢¤ë +.BR tzfile (5) +·Á¼°¤Î¥Õ¥¡¥¤¥ë \fIlocaltime\fP ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ëÃͤ¬ÍѤ¤¤é¤ì¤ë¡£ +(¤³¤ÎºÝ¤Ë¤Ï +.I /etc/localtime +¤â¤è¤¯ÍѤ¤¤é¤ì¤ë¡£ +¤³¤ì¤Ï¥·¥¹¥Æ¥à¤Î¥¿¥¤¥à¥¾¡¼¥ó¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë +ŬÀڤʥե¡¥¤¥ë¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£) +.PP +.B TZ +´Ä¶­ÊÑ¿ô¤¬Â¸ºß¤·¤Æ¤¤¤ë¤¬¡¢¤½¤ÎÃͤ¬¶õ¤À¤Ã¤¿¤ê¡¢ +°Ê²¼¤Ë¼¨¤¹·Á¼°¤Î¤É¤ì¤Ë¤â¤¢¤Æ¤Ï¤Þ¤é¤Ê¤¤¾ì¹ç¤Ï¡¢ +¶¨ÄêÀ¤³¦»þ (Coordinated Universal Time: UTC) ¤¬ÍѤ¤¤é¤ì¤ë¡£ +.PP +.B TZ +¤ÎÃͤϰʲ¼¤Î 3 ¤Ä¤Î·Á¼°¤Î¤¤¤º¤ì¤«¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +ºÇ½é¤Î·Á¼°¤Ï¥µ¥Þ¡¼¥¿¥¤¥à (daylight saving time) +¤ò»ý¤¿¤Ê¤¤¥í¡¼¥«¥ë¥¿¥¤¥à¥¾¡¼¥ó¤ËÂФ·¤ÆÍѤ¤¤ë¡£ +.sp +.RS +.I std offset +.RE +.sp +\fIstd\fP ʸ»úÎó¤Ï¥¿¥¤¥à¥¾¡¼¥ó¤Î̾Á°¤ò»ØÄꤹ¤ë¡£ +¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤«¤é¤Ê¤ë 3 ʸ»ú°Ê¾å¤Îʸ»úÎó¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +\fIoffset\fP ʸ»úÎó¤Ï \fIstd\fP ¤Îľ¸å¤Ë³¤­¡¢ +¶¨ÄêÀ¤³¦»þ (UTC) ¤òÆÀ¤ë¤¿¤á¤Ë +¥í¡¼¥«¥ë¤Ê»þ¹ï¤Ë²Ã¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤»þ´Ö¤ò»ØÄꤹ¤ë¡£ +.I offset +¤Ï¡¢¥í¡¼¥«¥ë¥¿¥¤¥à¥¾¡¼¥ó¤¬¥°¥ê¥Ë¥Ã¥¸»Ò¸áÀþ (Prime Meridian) +¤ÎÀ¾¤Ê¤éÀµ¤ÎÃÍ¡¢Åì¤Ê¤éÉé¤ÎÃͤò¼è¤ë¡£ +»þ´Ö (hour) ¤Ï 0 ¤«¤é 24 ¤Î´Ö¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ʬ (minute) ¤ÈÉà (second) ¤Ï 0 ¤«¤é 59 ¤Î´Ö¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +2 ÈÖÌܤηÁ¼°¤Ï¥µ¥Þ¡¼¥¿¥¤¥à¤¬¤¢¤ë¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¡£ +.sp +.RS +.I std offset dst [offset],start[/time],end[/time] +.RE +.sp +»ØÄê¤Ë¤Ï¥¹¥Ú¡¼¥¹¤ò´Þ¤á¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +ÀèƬ¤Î \fIstd\fP ¤È \fIoffset\fP ¤Ï 1 ÈÖÌܤηÁ¼°¤ÈƱ¤¸¤Ç¡¢ +ɸ½à¤Î¥¿¥¤¥à¥¾¡¼¥ó¤ò»ØÄꤹ¤ë¡£ +\fIdst\fP ʸ»úÎó¤È \fIoffset\fP ¤Ï¡¢ +Âбþ¤¹¤ë¥µ¥Þ¡¼¥¿¥¤¥à¥¾¡¼¥ó¤Î̾Á°¤È¥ª¥Õ¥»¥Ã¥È¤ò»ØÄꤹ¤ë¡£ +¥ª¥Õ¥»¥Ã¥È¤¬¾Êά¤µ¤ì¤ë¤È¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ïɸ½à¤Î°ì»þ´ÖÁ°¤È¤Ê¤ë¡£ +.PP +\fIstart\fP ¥Õ¥£¡¼¥ë¥É¤Ï¥µ¥Þ¡¼¥¿¥¤¥à¤¬Í­¸ú¤Ë¤Ê¤ë»þ¹ï¡¢ +\fIend\fP ¥Õ¥£¡¼¥ë¥É¤Ïɸ½à¤ËÌá¤ë»þ¹ï¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤Î·Á¼°¤Ç»ØÄꤹ¤ë¡£ +.TP +J\fIn\fP +ǯ¤ÎÄÌÆü (Julian day) ¤ÇÆü¤Ë¤Á¤ò»ØÄꤹ¤ë¡£ +\fIn\fP ¤Ï 1 ¤«¤é 365 ¤Î´Ö¤Î¿ôÃÍ¡£ +¤¦¤ë¤¦Ç¯¤Î¾ì¹ç¤Ç¤â 2 ·î 29 Æü¤Ï¥«¥¦¥ó¥È¤µ¤ì¤Ê¤¤¡£ +.TP +.I n +ǯ¤ÎÄÌÆü¤ÇÆü¤Ë¤Á¤ò»ØÄꤹ¤ë¡£ +\fIn\fP ¤Ï 1 ¤«¤é 365 ¤Î´Ö¤Î¿ôÃÍ¡£ +¤¦¤ë¤¦Ç¯¤Î¾ì¹ç¤Ë¤Ï 2 ·î 29 Æü¤¬¥«¥¦¥ó¥È¤µ¤ì¤ë¡£ +.TP +M\fIm\fP.\fIw\fP.\fId\fP +\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 +\fItime\fP ¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥í¡¼¥«¥ë¥¿¥¤¥à¤òÀÚ¤êÂؤ¨¤ë»þ¹ï¤ò¡¢ +Êѹ¹Á°¤Î¥í¡¼¥«¥ë¥¿¥¤¥à¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¾Êά¤µ¤ì¤¿¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¤Ï 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" +.fi +.PP +3 ÈÖÌܤηÁ¼°¤Ï¡¢¥¿¥¤¥à¥¾¡¼¥ó¤Î¾ðÊó¤ò¥Õ¥¡¥¤¥ë¤«¤éÆɤ߹þ¤à¤è¤¦¤Ë»ØÄꤹ¤ë¡£ +.sp +.RS +:[filespec] +.RE +.sp +¥Õ¥¡¥¤¥ë¤Î»ØÄê \fIfilespec\fP ¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¤Ï¡¢ +¥¿¥¤¥à¥¾¡¼¥ó¤Î¾ðÊó¤Ï¥·¥¹¥Æ¥à¥¿¥¤¥à¥¾¡¼¥ó¥Ç¥£¥ì¥¯¥È¥ê¤Î +.I localtime +¥Õ¥¡¥¤¥ë¤«¤éÆɤޤì¤ë¡£ +ºÇ¶á¤Ç¤Ï¥·¥¹¥Æ¥à¥¿¥¤¥à¥¾¡¼¥ó¥Ç¥£¥ì¥¯¥È¥ê¤ÏÉáÄÌ +.I /usr/share/zoneinfo/localtime +¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï +.BR tzfile (5) +·Á¼°¤Ç½ñ¤«¤ì¤Æ¤¤¤ë¡£ +\fIfilespec\fP ¤¬Í¿¤¨¤é¤ì¤¿¾ì¹ç¤Ï¡¢ +¥¿¥¤¥à¥¾¡¼¥ó¤Î¾ðÊó¤ò¤½¤Î¥Õ¥¡¥¤¥ë¤«¤éÆɤ߹þ¤à¡£¤³¤Î¥Õ¥¡¥¤¥ë¤â +.BR tzfile (5) +·Á¼°¤Ç½ñ¤«¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +\fIfilespec\fP ¤¬ \(aq/\(aq ¤Ç»Ï¤Þ¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥·¥¹¥Æ¥à¥¿¥¤¥à¥¾¡¼¥ó¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤Ç +¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤¿¤³¤È¤Ë¤Ê¤ë¡£ +.PP +Îã¤òµó¤²¤Æ¤ª¤¯¡£¤â¤¦°ìÅ٥˥塼¥¸¡¼¥é¥ó¥É¤ÎÎã¤Ç¤¢¤ë¡£ +.nf + + TZ=":Pacific/Auckland" +.fi +.SH ¥Õ¥¡¥¤¥ë +ÍѤ¤¤é¤ì¤ë¥·¥¹¥Æ¥à¥¿¥¤¥à¥¾¡¼¥ó¥Ç¥£¥ì¥¯¥È¥ê¤Ï (g)libc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë°Í¸¤¹¤ë¡£ +libc4 ¤È libc5 ¤Ï +.I /usr/lib/zoneinfo +¤òÍѤ¤¤ë¡£libc-5.4.6 °Ê¹ß¤Ç¤Ï¡¢¤³¤ì¤¬»È¤¨¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï +.I /usr/share/zoneinfo +¤ò»È¤ª¤¦¤È¤¹¤ë¡£ +glibc2 ¤Ç¤Ï´Ä¶­ÊÑ¿ô +.B TZDIR +¤¬Â¸ºß¤¹¤ì¤Ð¤½¤ì¤òÍѤ¤¤ë¡£ +¤³¤Î¥Ç¥Õ¥©¥ë¥È¤Ï¤É¤Î¤è¤¦¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¤«¤Ë¤è¤ë¤¬¡¢ +ÉáÄÌ¤Ï +.I /usr/share/zoneinfo +¤Ç¤¢¤ë¡£ +.LP +¤³¤Î¥¿¥¤¥à¥¾¡¼¥ó¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤ë¡£ +.sp +.nf +localtime ¥í¡¼¥«¥ë¥¿¥¤¥à¥¾¡¼¥ó¤Î¥Õ¥¡¥¤¥ë +posixrules POSIX ¼°¤Î TZ ½ñ¼°¥ë¡¼¥ë +.fi +.LP +.I /etc/localtime +¤Ï¡¢ +.I localtime +¥Õ¥¡¥¤¥ë¤ä¡¢ +¥·¥¹¥Æ¥à¤Î¥¿¥¤¥à¥¾¡¼¥ó¥Ç¥£¥ì¥¯¥È¥êÃæ¤ÎŬÀڤʥ¿¥¤¥à¥¾¡¼¥ó¥Õ¥¡¥¤¥ë¤Ø¤Î +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¤³¤È¤¬Â¿¤¤¡£ +.SH ½àµò +SVr4, POSIX.1-2001, 4.3BSD. +.SH Ãí°Õ +.I daylight +ÊÑ¿ô¤Ï¡¢¸½ºß¤¬¥µ¥Þ¡¼¥¿¥¤¥à¤Ç¤¢¤ë¤«¤É¤¦¤«¤ò¼¨¤·¤Æ¤¤¤ë¤Î¤Ç¤Ï¤Ê¤¤¡£ +¤³¤ì¤Ï¤¤¤¯¤Ä¤«¤¢¤ë¥¢¥ë¥´¥ê¥º¥à¤Î¤¦¤Á¤ÎÈÖ¹æ¤òÍ¿¤¨¤ë +(¥¢¥ë¥´¥ê¥º¥à¤Ë¤Ä¤¤¤Æ¤Ï +.BR gettimeofday (2) +¤Î +.I tz_dsttime +ÊÑ¿ô¤ò¸«¤è)¡£ +¤³¤ì¤Ï¤â¤¦²¿Ç¯¤â»È¤ï¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢SUSv2 ¤Ç¤ÏɬÍפȤµ¤ì¤Æ¤¤¤ë¡£ +.LP +4.3BSD ¤Ë¤Ï +.BI "char *timezone(" zone ", " dst ) +¤È¤¤¤¦¥ë¡¼¥Á¥ó¤¬¤¢¤ê¡¢¤³¤ì¤Ï +ºÇ½é¤Î°ú¿ô (UTC ¤«¤é¤ÎÀ¾¸þ¤­¤Îʬ¿ô) ¤ËÂбþ¤¹¤ë¥¿¥¤¥à¥¾¡¼¥ó¤Î̾Á°¤òÊÖ¤¹¡£ +ÆóÈÖÌܤΰú¿ô¤¬ 0 ¤Î¾ì¹ç¤Ïɸ½à¤Î̾Á°¤¬ÍѤ¤¤é¤ì¡¢ +¤½¤ì°Ê³°¤Ï¥µ¥Þ¡¼¥¿¥¤¥àÈǤÎ̾Á°¤¬ÍѤ¤¤é¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR date (1), +.BR gettimeofday (2), +.BR time (2), +.BR ctime (3), +.BR getenv (3), +.BR tzfile (5) diff --git a/release/man3/ualarm.3 b/release/man3/ualarm.3 new file mode 100644 index 00000000..14ef1e4b --- /dev/null +++ b/release/man3/ualarm.3 @@ -0,0 +1,126 @@ +.\" 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 Sep 11 07:32:05 JST 2004 +.\" by Yuichi SATO +.\" Updated 2007-05-04, Akihiro MOTOKI +.\" +.TH UALARM 3 2008-08-06 "" "Linux Programmer's Manual" +.SH ̾Á° +ualarm \- »ØÄꤷ¤¿¥Þ¥¤¥¯¥íÉøå¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ëͽÄê¤ò¤¹¤ë +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "useconds_t ualarm(useconds_t " usecs ", useconds_t " interval ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR ualarm (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.BR ualarm () +´Ø¿ô¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ +.I usecs +¥Þ¥¤¥¯¥íÉà (°Ê¾å) ¸å¤Ë +.B SIGALRM +¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +ÃÙ¤ì¤Ï¥·¥¹¥Æ¥à¤Î³èÀ­ÅÙ¡¦¸Æ¤Ó½Ð¤·¤Î½èÍý»þ´Ö¡¦ +¥·¥¹¥Æ¥à¥¿¥¤¥Þ¡¼¤ÎγÅ٤ˤè¤Ã¤ÆŤ¯¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +Ê᪤ޤ¿¤Ï̵»ë¤µ¤ì¤Ê¤¤¸Â¤ê¡¢ +.B SIGALRM +¥·¥°¥Ê¥ë¤Ï¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë¡£ +.LP +.I interval +°ú¤­¿ô¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢ºÇ½é¤Î +.B SIGALRM +¥·¥°¥Ê¥ë¤Î¸å¡¢ +¤µ¤é¤Ë +.I interval +¥Þ¥¤¥¯¥íÉÃËè¤Ë SIGALRM ¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +¤³¤Î´Ø¿ô¤Ï¡¢²áµî¤ËÀßÄꤵ¤ì¤¿ alarm ¤Î»Ä¤ê¥Þ¥¤¥¯¥íÉÿô¤òÊÖ¤¹¡£ +¼Â¹ÔÃæ¤Î alarm ¤¬¤Ê¤¤¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINTR +¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¡£ +.TP +.B EINVAL +\fIusecs\fP ¤Þ¤¿¤Ï \fIinterval\fP ¤¬ 1000000 ̤Ëþ¤Ç¤Ê¤¤ +(¤³¤ì¤¬¥¨¥é¡¼¤È¤·¤Æ°·¤ï¤ì¤ë¥·¥¹¥Æ¥à¤Î¾ì¹ç)¡£ +.SH ½àµò +4.3BSD, POSIX.1-2001. +POSIX.1-2001 ¤Ç¤Ï +.BR ualarm () +¤Ï²áµî¤Î¤â¤Î¤È¤µ¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2008 ¤Ç¤Ï¡¢ +.BR ualarm () +¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ +4.3BSD, SUSv2, POSIX ¤Ï¥¨¥é¡¼¤òÄêµÁ¤·¤Æ¤¤¤Ê¤¤¡£ +.SH Ãí°Õ +.I useconds_t +·¿¤Ï [0,1000000] ¤ÎÈϰϤÎÀ°¿ô¤òÊÝ»ý¤Ç¤­¤ëÉä¹æ¤Ê¤·À°¿ô·¿¤Ç¤¢¤ë¡£ +¤â¤È¤â¤È¤Î BSD ¤Ç¤Î¼ÂÁõ¤ä¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢ +.BR ualarm () +¤Î°ú¤­¿ô¤Î·¿¤Ï +.I "unsigned int" +¤Ç¤¢¤Ã¤¿¡£ +¥×¥í¥°¥é¥àÃæ¤ËÌÀ¼¨Åª¤Ë +.I useconds_t +¤È½ñ¤«¤Ê¤¤Êý¤¬¡¢°Ü¿¢À­¤¬¹â¤¯¤Ê¤ë¡£ +.LP +¤³¤Î´Ø¿ô¤È +.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) +¤Î¤è¤¦¤Ê¾¤Î¥¿¥¤¥Þ¡¼´Ø¿ô¤È¤ÎÁê¸ßºîÍѤϵ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.LP +¤³¤Î´Ø¿ô¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£ +Âå¤ï¤ê¤Ë +.BR setitimer (2) +¤â¤·¤¯¤Ï POSIX ¥¤¥ó¥¿¡¼¥Ð¥ë¥¿¥¤¥Þ +.RB ( timer_create (2) +¤Ê¤É) ¤ò»È¤¦¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR alarm (2), +.BR getitimer (2), +.BR nanosleep (2), +.BR select (2), +.BR setitimer (2), +.BR usleep (3), +.BR time (7) diff --git a/release/man3/ulimit.3 b/release/man3/ulimit.3 new file mode 100644 index 00000000..b16f7b68 --- /dev/null +++ b/release/man3/ulimit.3 @@ -0,0 +1,89 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 1996 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. +.\" +.\" Moved to man3, aeb, 980612 +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Sat 18 Jul 1998 by NAKANO Takeo +.\" Modified Sun Dec 18 1998 by NAKANO Takeo +.\" +.TH ULIMIT 3 2008-08-06 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ulimit \- ¥æ¡¼¥¶¡¼À©¸Â¤ò¼èÆÀ¡¦ÀßÄꤹ¤ë +.SH ½ñ¼° +.B #include +.sp +.BI "long ulimit(int " cmd ", long " newlimit ); +.SH ÀâÌÀ +Ãí°Õ: ¤³¤Î¥ë¡¼¥Á¥ó¤Ï¸Å¤¤¡£ +Âå¤ï¤ê¤Ë +.BR getrlimit (2), +.BR setrlimit (2), +.BR sysconf (3) +¤Ê¤É¤òÍѤ¤¤ë¤³¤È¡£ +¥·¥§¥ë¥³¥Þ¥ó¥É¤È¤·¤Æ¤Î +.BR ulimit () +¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR bash (1) +¤ò¸«¤ë¤³¤È¡£ + +.BR ulimit () +¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë´Ø¤¹¤ëÀ©¸Â¤Î¤¤¤¯¤Ä¤«¤ò¼èÆÀ¡¦ÀßÄꤹ¤ë¡£ +.I cmd +°ú¤­¿ô¤Ë¤Ï¡¢°Ê²¼¤ÎÃͤΤ¦¤Á¤Î¤É¤ì¤«°ì¤Ä¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B UL_GETFSIZE +¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ë´Ø¤¹¤ëÀ©¸Â¤òÊÖ¤¹¡£Ã±°Ì¤Ï 512 ¥Ð¥¤¥È¡£ +.TP +.B UL_SETFSIZE +¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ë´Ø¤¹¤ëÀ©¸Â¤òÀßÄꤹ¤ë¡£ +.TP +.B 3 +(Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +¥Ç¡¼¥¿¥»¥°¥á¥ó¥È¤Ç»ØÄê¤Ç¤­¤ë¥¢¥É¥ì¥¹¤ÎºÇÂçÃͤòÊÖ¤¹¡£ +.TP +.B 4 +(¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢Âбþ¤¹¤ë¥·¥ó¥Ü¥ê¥Ã¥¯¤ÊÄê¿ô¤Ï¸ºß¤·¤Ê¤¤) +¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤ÎºÇÂçÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È +.BR ulimit () +¤Ï 0 ¤Þ¤¿¤ÏÀµ¤ÎÃͤòÊÖ¤¹¡£ +¥¨¥é¡¼¤¬À¸¤¸¤ë¤È \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ÊÃͤËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EPERM +ÈóÆø¢¥×¥í¥»¥¹¤¬À©¸ÂÃͤòÁý²Ã¤µ¤»¤è¤¦¤È¤·¤¿¡£ +.SH ½àµò +SVr4, POSIX.1-2001. +POSIX.1-2008 ¤Ï +.BR ulimit () +¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR bash (1), +.BR getrlimit (2), +.BR setrlimit (2), +.BR sysconf (3) diff --git a/release/man3/undocumented.3 b/release/man3/undocumented.3 new file mode 100644 index 00000000..83cff8fc --- /dev/null +++ b/release/man3/undocumented.3 @@ -0,0 +1,197 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 1995 Jim Van Zandt +.\" From jrv@vanzandt.mv.com Mon Sep 4 21:11:50 1995 +.\" +.\" 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. +.\" +.\" 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" +.SH ̾Á° +none \- ¥É¥­¥å¥á¥ó¥È¤¬¤Ê¤¤¥é¥¤¥Ö¥é¥ê´Ø¿ô (library functions) +.SH ½ñ¼° +¥É¥­¥å¥á¥ó¥È¤¬¤Ê¤¤¥é¥¤¥Ö¥é¥ê´Ø¿ô +.SH ÀâÌÀ +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ï¡¢ +ɸ½à¥é¥¤¥Ö¥é¥ê¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +¤Þ¤À man ¥Ú¡¼¥¸¤¬Â¸ºß¤·¤Ê¤¤¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ò¾Ò²ð¤¹¤ë¡£ +.SS ´«Í¶ +¤³¤ì¤é¤Î´Ø¿ô¤Ë¤Ä¤¤¤Æ¾ðÊ󤬤¢¤Ã¤¿¤é¡¢ +¥½¡¼¥¹¥³¡¼¥É¤ò¸«¤Æ man ¥Ú¡¼¥¸¤ò (¾¤Î Linux ¥»¥¯¥·¥ç¥ó 3 ¤Î +man ¥Ú¡¼¥¸¤Ë»÷¤¿¥¹¥¿¥¤¥ë¤Ç) ½ñ¤­¡¢¤½¤Î¥Ú¡¼¥¸¤ò +.B mtk.manpages@gmail.com +¤Þ¤ÇÁ÷¤Ã¤Æ¤Û¤·¤¤¡£ +¼¡¤Î 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) diff --git a/release/man3/ungetwc.3 b/release/man3/ungetwc.3 new file mode 100644 index 00000000..95a6676c --- /dev/null +++ b/release/man3/ungetwc.3 @@ -0,0 +1,62 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:43 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH UNGETWC 3 1999-09-19 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +ungetwc \- ¥ï¥¤¥Éʸ»ú¤ò FILE ¥¹¥È¥ê¡¼¥à¤ØÌ᤹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wint_t ungetwc(wint_t " wc ", FILE *" stream ); +.fi +.SH ÀâÌÀ +.BR ungetwc () +´Ø¿ô¤Ï +.BR ungetc (3) +´Ø¿ô¤Î¥ï¥¤¥Éʸ»úÈǤǤ¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»ú¤ò \fIstream\fP ¤ØÌᤷ¤Æ¡¢¤½¤ì¤òÊÖ¤¹¡£ +.PP +\fIwc\fP ¤¬ \fBWEOF\fP ¤Î¾ì¹ç¡¢ \fBWEOF\fP ¤òÊÖ¤¹¡£ +\fIwc\fP ¤¬ÉÔÀµ¤Ê¥ï¥¤¥Éʸ»ú¤Î¾ì¹ç¡¢ +\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤òÀßÄꤷ¤Æ \fBWEOF\fP ¤òÊÖ¤¹¡£ +.PP +\fIwc\fP ¤¬Í­¸ú¤Ê¥ï¥¤¥Éʸ»ú¤Î¾ì¹ç¡¢¤½¤ì¤ò¥¹¥È¥ê¡¼¥à¤Ø¤ÈÌᤷ¤Æ¸å¤Î +¥ï¥¤¥Éʸ»úÆɤ߹þ¤ßÁàºî¤Ç¼èÆÀ¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£¥Õ¥¡¥¤¥ë°ÌÃÖ(file-position) +»Ø¼¨»Ò¤Ï1°Ê¾åÌᤵ¤ì¤ë¡£¥Õ¥¡¥¤¥ë½ªÃ¼(end-of-file)»Ø¼¨»Ò¤Ï¥¯¥ê¥¢¤µ¤ì¤ë¡£ +¤½¤Î¥Õ¥¡¥¤¥ë¤ÎÇظå¤Ë¤¢¤ëµ­²±ÇÞÂΤϱƶÁ¤ò¼õ¤±¤Ê¤¤¡£ +.PP +Ãí°Õ: \fIwc\fP ¤Ï¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤ó¤ÀºÇ¸å¤Î¥ï¥¤¥Éʸ»ú¤Ç¤¢¤ëɬÍפϤʤ¤¡£ +Í­¸ú¤Ê¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð²¿¤Ç¤âÎɤ¤¡£ +.PP +³¤±¤ÆÊ£¿ô¤Î¥ï¥¤¥Éʸ»ú¤òÌ᤹¤³¤È¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¼ÂÁõ¤Î¾ì¹ç¤Ï¡¢ +Ìᤷ¤¿¥ï¥¤¥Éʸ»ú¤Ï¡¢Ìᤷ¤¿¤Î¤È¤ÏµÕ¤Î½çÈÖ¤ÇÆɤ߹þ¤Þ¤ì¤ë¡£ +¤·¤«¤·¤³¤Î¾ì¹ç¤Ç¤â°ìÃʳ¬¤ÎÌᤷ¤·¤«Êݾڤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR ungetwc () +´Ø¿ô¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï \fIwc\fP ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï \fBWEOF\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR ungetwc () +´Ø¿ô¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fgetwc (3) diff --git a/release/man3/unlocked_stdio.3 b/release/man3/unlocked_stdio.3 new file mode 100644 index 00000000..276040cb --- /dev/null +++ b/release/man3/unlocked_stdio.3 @@ -0,0 +1,138 @@ +.\" 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) 2001 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Fri Nov 2 23:08:42 2001 +.\" by Akihiro MOTOKI +.\" +.TH UNLOCKED_STDIO 3 2008-08-29 "" "Linux Programmer's Manual" +.SH ̾Á° +getc_unlocked, getchar_unlocked, putc_unlocked, +putchar_unlocked \- ¥í¥Ã¥¯¤ò¹Ô¤ï¤º¤Ëɸ½àÆþ½ÐÎϤò¹Ô¤¦´Ø¿ô·² +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int getc_unlocked(FILE *" stream ); +.B "int getchar_unlocked(void);" +.BI "int putc_unlocked(int " c ", FILE *" stream ); +.BI "int putchar_unlocked(int " c ); +.sp +.BI "void clearerr_unlocked(FILE *" stream ); +.BI "int feof_unlocked(FILE *" stream ); +.BI "int ferror_unlocked(FILE *" stream ); +.BI "int fileno_unlocked(FILE *" stream ); +.BI "int fflush_unlocked(FILE *" stream ); +.BI "int fgetc_unlocked(FILE *" stream ); +.BI "int fputc_unlocked(int " c ", FILE *" stream ); +.BI "size_t fread_unlocked(void *" ptr ", size_t " size ", size_t " n , +.BI " FILE *" stream ); +.BI "size_t fwrite_unlocked(const void *" ptr ", size_t " size ", size_t " n , +.BI " FILE *" stream ); +.sp +.BI "char *fgets_unlocked(char *" s ", int " n ", FILE *" stream ); +.BI "int fputs_unlocked(const char *" s ", FILE *" stream ); +.sp +.B #include +.sp +.BI "wint_t getwc_unlocked(FILE *" stream ); +.B "wint_t getwchar_unlocked(void);" +.BI "wint_t fgetwc_unlocked(FILE *" stream ); +.BI "wint_t fputwc_unlocked(wchar_t " wc ", FILE *" stream ); +.BI "wint_t putwc_unlocked(wchar_t " wc ", FILE *" stream ); +.BI "wint_t putwchar_unlocked(wchar_t " wc ); +.BI "wchar_t *fgetws_unlocked(wchar_t *" ws ", int " n ", FILE *" stream ); +.BI "int fputws_unlocked(const wchar_t *" ws ", FILE *" stream ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.ad l +.in +.sp +.BR getc_unlocked (), +.BR getchar_unlocked (), +.BR putc_unlocked (), +.BR putchar_unlocked (): +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE || +_BSD_SOURCE || _SVID_SOURCE +.sp +.BR clearerr_unlocked (), +.BR feof_unlocked (), +.BR ferror_unlocked (), +.BR fileno_unlocked (), +.BR fflush_unlocked (), +.BR fgetc_unlocked (), +.BR fputc_unlocked (), +.BR fread_unlocked (), +.BR fwrite_unlocked (): +_BSD_SOURCE || _SVID_SOURCE +.sp +.BR fgets_unlocked (), +.BR fputs_unlocked (), +.BR getwc_unlocked (), +.BR getwchar_unlocked (), +.BR fgetwc_unlocked (), +.BR fputwc_unlocked (), +.BR putwchar_unlocked (), +.BR fgetws_unlocked (), +.BR fputws_unlocked (): +_GNU_SOURCE +.ad b +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ËöÈø¤Ë "_unlocked" ¤¬¤Ä¤¤¤Æ¤¤¤Ê¤¤´Ø¿ô¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¤¬¡¢ +¥Õ¥¡¥¤¥ë¤Î¥í¥Ã¥¯¤ò»ÈÍѤ·¤Ê¤¤ÅÀ¤¬°Û¤Ê¤ë¡£(¤³¤ì¤é¤Î´Ø¿ô¼«¿È¤Ï¥Õ¥¡¥¤¥ë¤Î¥í¥Ã¥¯ +¤ò¥»¥Ã¥È¤»¤º¡¢Â¾¤Î´Ø¿ô¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯¤â +¹Ô¤ï¤Ê¤¤) ¤½¤ì¤æ¤¨¡¢¥¹¥ì¥Ã¥É(thread)¤Ç°ÂÁ´¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.BR flockfile (3) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ½àµò +.BR getc_unlocked (), +.BR getchar_unlocked (), +.BR putc_unlocked (), +.BR putchar_unlocked () +¤Î 4 ¤Ä¤Î´Ø¿ô¤Ï +POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +Èóɸ½à¤Î +.BR *_unlocked () +¤ÎÃç´Ö¤Ï 2¡¢3 ¤Î Unix ¥·¥¹¥Æ¥à¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +ºÇ¶á¤Î glibc ¤Ç¤Ï»ÈÍѲÄǽ¤Ç¤¢¤ë¤¬¡¢ +.\" E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and +.\" moved to a compatibility library. +.\" Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked, +.\" feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked, +.\" fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked, +.\" fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked, +.\" ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked, +.\" getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked, +.\" putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked, +.\" putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked, +.\" ungetc_unlocked, ungetwc_unlocked. +¤³¤ì¤é¤Î´Ø¿ô¤Ï»È¤ï¤Ê¤¤Êý¤¬¤è¤¤¤À¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR flockfile (3), +.BR stdio (3), +.BR feature_test_macros (7) diff --git a/release/man3/unlockpt.3 b/release/man3/unlockpt.3 new file mode 100644 index 00000000..b6ac149a --- /dev/null +++ b/release/man3/unlockpt.3 @@ -0,0 +1,58 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This page is in the public domain. - aeb +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 02:25:57 JST 2003 +.\" by Akihiro MOTOKI +.\" +.TH UNLOCKPT 3 2008-06-14 "" "Linux Programmer's Manual" +.SH ̾Á° +unlockpt \- µ¼»÷üËö¥Þ¥¹¥¿/¥¹¥ì¡¼¥Ö¤Î¥Ú¥¢¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.br +.B #include +.sp +.BI "int unlockpt(int " fd ");" +.fi +.SH ÀâÌÀ +.BR unlockpt () +´Ø¿ô¤Ï +.I fd +¤Ç»²¾È¤µ¤ì¤ë¥Þ¥¹¥¿µ¼»÷üËö¤ËÂбþ¤¹¤ë¥¹¥ì¡¼¥Öµ¼»÷üËö¤Î¥í¥Ã¥¯¤ò +²ò½ü¤¹¤ë¡£ +.PP +µ¼»÷üËö¤Î¥¹¥ì¡¼¥Ö¦¤ò¥ª¡¼¥×¥ó¤¹¤ëÁ°¤Ë¡¢ +.BR unlockpt () +¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¡¢ +.BR grantpt () +¤Ï 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢ +.I errno +¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EBADF +°ú¤­¿ô +.I fd +¤¬½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£ +.TP +.B EINVAL +°ú¤­¿ô +.I fd +¤¬¥Þ¥¹¥¿µ¼»÷üËö¤ËÂбþ¤¹¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR unlockpt () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH ´ØÏ¢¹àÌÜ +.BR grantpt (3), +.BR posix_openpt (3), +.BR ptsname (3), +.BR pts (4), +.BR feature_test_macros (7), +.BR pty (7) diff --git a/release/man3/updwtmp.3 b/release/man3/updwtmp.3 new file mode 100644 index 00000000..28eb03cd --- /dev/null +++ b/release/man3/updwtmp.3 @@ -0,0 +1,92 @@ +.\" WORD: current process ID ¸½¥×¥í¥»¥¹ID +.\" WORD: AVAILABILITY ÍøÍѲÄǽ¤Ê´Ä¶­ +.\" Copyright 1997 NicoláÔ Lichtmaier +.\" Created Wed Jul 2 23:27:34 ART 1997 +.\" +.\" 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. +.\" +.\" Added info on availability, aeb, 971207 +.\" Added -lutil remark, 030718 +.\" 2008-07-02, mtk, document updwtmpx() +.\" +.\" Japanese Version Copyright (c) 1998 Tomoyuki NISHIOKA +.\" all rights reserved. +.\" Translated Sat May 23 18:46:34 JST 1998 +.\" by Tomoyuki NISHIOKA +.\" Updated 2003-09-14 by Kentaro Shirakata +.\" Updated 2008-07-30 by Kentaro Shirakata +.\" +.TH UPDWTMP 3 2008-07-02 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +updwtmp, logwtmp \- wtmp ¥Õ¥¡¥¤¥ë¤Ë¥¨¥ó¥È¥ê¤òÄɲ乤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "void updwtmp(const char *" wtmp_file ", const struct utmp *" ut ); +.br +.BI "void logwtmp(const char *" line ", const char *" name \ +", const char *" host ); +.fi +.SH ÀâÌÀ +.BR updwtmp () +¤Ï¡¢utmp ¹½Â¤ÂÎ +.I ut +¤ò wtmp ¥Õ¥¡¥¤¥ë¤ËÄɲ乤롣 +.PP +.BR logwtmp () +¤Ï¡¢ +.IR line ", " name ", " host , +¸½ºß»þ¹ï¡¢¸½¥×¥í¥»¥¹ID ¤«¤é utmp ¹½Â¤ÂΤòºî¤ê¡¢ +.BR updwtmp () +¤ò¸Æ¤Ó½Ð¤·¤Æ¤½¤Î¹½Â¤ÂΤò wtmp ¥Õ¥¡¥¤¥ë¤ËÄɲ乤롣 +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /var/log/wtmp +¥æ¡¼¥¶¥í¥°¥¤¥ó¤ÎÍúÎò¥Ç¡¼¥¿¥Ù¡¼¥¹ +.SH ½àµò +POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£ +Solaris, NetBSD ¤Ë¸ºß¤·¡¢¤ª¤½¤é¤¯Â¾¤Î¥·¥¹¥Æ¥à¤Ë¤â¤¢¤ë¤À¤í¤¦¡£ +.SH ÍøÍѲÄǽ¤Ê´Ä¶­ +glibc2 ¤Î²¼¤Ç¤Ï¤É¤Á¤é¤Î´Ø¿ô¤âÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +libc5 ¤Î²¼¤Ç¤Ï¤É¤Á¤é¤â»È¤¨¤Ê¤¤¤¬¡¢ +.BR logwtmp () +¤Ï¸Å¤¤ libbsd ¤Ë¤¢¤Ã¤¿¡£ +ºÇ¶á¤Ç¤Ï¡¢ +.BR logwtmp () +´Ø¿ô¤Ï libutil ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë +(¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤Î´Ø¿ô¤ò»È¤¦¤¿¤á¤Ë¤Ï¥³¥ó¥Ñ¥¤¥é¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë +\fI\-lutil\fP ¤òÄɲ乤ëɬÍפ¬¤¢¤ë)¡£ +.SH Ãí°Õ +¾¤Î "utmpx" ´Ø¿ô·² +.RB ( getutxent (3) +»²¾È) ¤È¤Î°ì´ÓÀ­¤Î¤¿¤á¤Ë¡¢glibc (¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß) ¤Ï°Ê²¼¤Î´Ø¿ô¤ò +Ä󶡤·¤Æ¤¤¤ë: +.nf +.sp +.B #include +.sp +.BI "void updwtmpx (const char *" wtmpx_file ", const struct utmpx *" utx ); +.fi +.PP +¤³¤Î´Ø¿ô¤Ï +.BR updwtmp () +¤ÈƱ¤¸ºî¶È¤ò¹Ô¤¦¤¬¡¢ºÇ¸å¤Î°ú¤­¿ô¤È¤·¤Æ +.I utmpx +¹½Â¤ÂΤò¼è¤ë¤È¤³¤í¤¬°Û¤Ê¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getutxent (3), +.BR wtmp (5) diff --git a/release/man3/usleep.3 b/release/man3/usleep.3 new file mode 100644 index 00000000..3d5f11bd --- /dev/null +++ b/release/man3/usleep.3 @@ -0,0 +1,137 @@ +.\" 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-07-24 by Rik Faith (faith@cs.unc.edu) +.\" 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 2007-07-26 "" "Linux Programmer's Manual" +.SH ̾Á° +usleep \- ¥Þ¥¤¥¯¥íÉÃñ°Ì¤Ç¼Â¹Ô¤ò±ä´ü¤¹¤ë +.SH ½ñ¼° +.nf +.B "#include " +.sp +.BI "int usleep(useconds_t " usec ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR usleep (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.SH ÀâÌÀ +.BR usleep () +´Ø¿ô¤Ï +(¾¯¤Ê¤¯¤È¤â) \fIusec\fP¥Þ¥¤¥¯¥íÉäδ֡¢ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò±ä´ü¤¹¤ë¡£ +¥·¥¹¥Æ¥à¤ÎÆ°ºî¾õ¶·¤ä¸Æ¤Ó½Ð¤·¤Ë¤è¤ë»þ´Ö¤Î¾ÃÈñ¤ä¥·¥¹¥Æ¥à¥¿¥¤¥Þ¤ÎγÅ٤ˤè¤Ã¤Æ¡¢ +Ää»ß»þ´Ö¤ÏÀßÄꤷ¤¿Ãͤè¤ê¤â¾¯¤·±ä¤Ð¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È 0¡¢¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINTR +¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤ÆÃæÃǤµ¤ì¤¿¡£ +.BR signal (7) +»²¾È¡£ +.TP +.B EINVAL +\fIusec\fP ¤¬ 1000000 °Ê¾å¤À¤Ã¤¿¡£ +(¤³¤ì¤ò¥¨¥é¡¼¤È¤ß¤Ê¤¹¥·¥¹¥Æ¥à¤Î¤ß) +.SH ½àµò +4.3BSD, POSIX.1-2001. +POSIX.1-2001 ¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ï²áµî¤Î¤â¤Î¤ÈÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£ +Âå¤ï¤ê¤Ë +.BR nanosleep (2) +¤ò»È¤¦¤³¤È¡£ +POSIX.1-2008 ¤Ç¤Ï¡¢ +.BR usleep () +¤Îµ¬Ä꤬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£ + +¤â¤È¤â¤È¤Î BSD ¤Î¼ÂÁõ¤ä¡¢¥Ð¡¼¥¸¥ç¥ó 2.2.2 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢ +¤³¤Î´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ï +.I void +¤Ç¤¢¤ë¡£ +POSIX ÈÇ¤Ï +.I int +¤òÊÖ¤·¡¢¤³¤Î¥×¥í¥È¥¿¥¤¥×¤Ï glibc 2.2.2 °Ê¹ß¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ + +¥¨¥é¡¼¤È¤·¤Æ +.B EINVAL +¤òÊÖ¤¹¤È¤¤¤¦¤Î¤Ï +SUSv2 ¤È POSIX.1-2001 ¤Ç¤Î¤ßʸ½ñ²½¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +.I useconds_t +·¿¤Ï [0,1000000] ¤ÎÈϰϤÎÀ°¿ô¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤ë +Éä¹æ¤Ê¤·À°¿ô·¿¤Ç¤¢¤ë¡£ +ÌÀ¼¨Åª¤Ë¤³¤Î·¿¤ò»È¤ï¤Ê¤¤¤³¤È¤Ç¥×¥í¥°¥é¥à¤Î°Ü¿¢À­¤¬¤è¤ê¹â¤Þ¤ë¡£ +°Ê²¼¤Î¤è¤¦¤Ë»È¤¦¤³¤È¡£ +.in +4n +.nf +.sp +#include +\&... + unsigned int usecs; +\&... + usleep(usecs); +.fi +.in +.LP +¤³¤Î´Ø¿ô¤È¡¢ +.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) +¤È¤¤¤Ã¤¿¤½¤Î¾¤Î¥¿¥¤¥Þ¡¼´Ø¿ô¤òƱ»þ¤Ë»È¤Ã¤¿¾ì¹ç¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.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) diff --git a/release/man3/wcpcpy.3 b/release/man3/wcpcpy.3 new file mode 100644 index 00000000..de07cd40 --- /dev/null +++ b/release/man3/wcpcpy.3 @@ -0,0 +1,49 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 25 22:24:35 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCPCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcpcpy \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥³¥Ô¡¼¤·¡¢¤½¤ÎËöÈø¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤¹ +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "wchar_t *wcpcpy(wchar_t *" dest ", const wchar_t *" src ); +.fi +.SH ÀâÌÀ +.BR wcpcpy () +´Ø¿ô¤Ï¡¢ +.BR stpcpy (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï \fIsrc\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¡¢½ªÃ¼¤Î L\(aq\\0\(aq ¤ò´Þ¤á¤Æ¡¢ +\fIdest\fP ¤¬»Ø¤¹ÇÛÎó¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +.PP +¤³¤ì¤é¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +¥×¥í¥°¥é¥Þ¤Ï¡¢\fIdest\fP ¤¬»Ø¤¹Îΰè¤Ë¾¯¤Ê¤¯¤È¤â¥ï¥¤¥Éʸ»ú +\fIwcslen(src)+1\fP ¸Äʬ¤ÎÎΰè¤ò³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wcpcpy () +¤Ï¡¢¥ï¥¤¥Éʸ»úʸ»úÎó \fIdest\fP ¤ÎËöÈø¡¢¤Ä¤Þ¤ê½ªÃ¼¤Î +L\(aq\\0\(aq ʸ»ú¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR strcpy (3), +.BR wcscpy (3), +.BR feature_test_macros (7) diff --git a/release/man3/wcpncpy.3 b/release/man3/wcpncpy.3 new file mode 100644 index 00000000..abb883f7 --- /dev/null +++ b/release/man3/wcpncpy.3 @@ -0,0 +1,54 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Wed Oct 27 02:17:42 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCPNCPY 3 2003-11-01 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcpncpy \- ¸ÇÄêĹ¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥³¥Ô¡¼¤·¡¢¤½¤ÎËöÈø¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤¹ +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "wchar_t *wcpncpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR wcpncpy () +´Ø¿ô¤Ï¡¢ +.BR stpncpy (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIsrc\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎ󤫤é \fIdest\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó +¤Ë¡¢½ªÃ¼¤Î L\(aq\\0\(aq ¤ò´Þ¤á¤ÆºÇÂç \fIn\fP ʸ»ú¤ò ¥³¥Ô¡¼¤¹¤ë¡£¤Á¤ç¤¦¤É +\fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤¬ \fIdest\fP ¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£¤Ä¤Þ¤ê¡¢ +\fIwcslen(src)\fP ¤ÎŤµ¤¬ \fIn\fP ¤è¤ê¾®¤µ¤±¤ì¤Ð¡¢\fIdest\fP ¤¬»Ø¤¹ÇÛ +ÎóÃæ¤Î»Ä¤ê¤Î¥ï¥¤¥Éʸ»ú¤Ï L\(aq\\0\(aq ʸ»ú¤ÇËä¤á¤é¤ì¤ë¡£¤â¤· +\fIwcslen(src)\fP ¤ÎŤµ¤¬ \fIn\fP °Ê¾å¤Ê¤é¤Ð¡¢\fIdest\fP ¤¬»Ø¤¹Ê¸»úÎó +¤Ï L\(aq\\0\(aq ¤Ç½ªÃ¼¤·¤Ê¤¤¡£ +.PP +2 ¤Ä¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +¥×¥í¥°¥é¥Þ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ò³ÊǼ¤Ç¤­¤ëÎΰè¤ò +\fIdest\fP ¤Ë³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wcpncpy () +¤Ï¡¢ºÇ¸å¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¡¢ +¤¹¤Ê¤ï¤Á \fIdest + n \- 1\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR stpncpy (3), +.BR wcsncpy (3), +.BR feature_test_macros (7) diff --git a/release/man3/wcrtomb.3 b/release/man3/wcrtomb.3 new file mode 100644 index 00000000..519c37f5 --- /dev/null +++ b/release/man3/wcrtomb.3 @@ -0,0 +1,72 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 25 22:55:40 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCRTOMB 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcrtomb \- ¥ï¥¤¥Éʸ»ú 1 ¤Ä¤ò¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t wcrtomb(char *" s ", wchar_t " wc ", mbstate_t *" ps ); +.fi +.SH ÀâÌÀ +¤³¤Î´Ø¿ô¤¬¼ç¤Ë»È¤ï¤ì¤ë¤Î¤Ï¡¢\fIs\fP ¤¬ NULL ¤Ç¤Ê¤¯¡¢\fIwc\fP ¤¬ L\(aq\\0\(aq +¤Ç¤Ê¤¤¾ì¹ç¤Ç¤¢¤ë¡£ +¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR wcrtomb () +´Ø¿ô¤Ï¥ï¥¤¥Éʸ»ú \fIwc\fP ¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èɽ +¸½¤ËÊÑ´¹¤·¡¢\fIs\fP ¤¬»Ø¤¹ char ·¿¤ÎÇÛÎó¤Ë¤³¤ì¤ò³ÊǼ¤¹¤ë¡£¤³¤Î´Ø¿ô¤Ï +¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò¹¹¿·¤·¡¢½ÐÎϤµ¤ì¤¿¥Þ¥ë¥Á¥Ð¥¤¥Èɽ¸½¤ÎŤµ¡¢¤¹¤Ê +¤ï¤Á \fIs\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +.PP +Ê̤Υ±¡¼¥¹¤È¤·¤Æ¤Ï¡¢\fIs\fP ¤Ï NULL ¤Ç¤Ê¤¤¤¬ \fIwc\fP ¤¬ L\(aq\\0\(aq ¤Î¤³¤È¤¬ +¤¢¤ë¡£¤³¤Î¾ì¹ç¤Î +.BR wcrtomb () +´Ø¿ô¤Ï¡¢\fI*ps\fP ¤ò½é´ü¾õÂÖ¤ËÌ᤹¤Î¤Ëɬ +Íפʥ·¥Õ¥È¥·¡¼¥±¥ó¥¹¤ò \fIs\fP ¤¬»Ø¤¹ char ·¿ÇÛÎó¤Ë³ÊǼ¤·¡¢¤½¤Î¸å¤Ë \(aq\\0\(aq +¤ò³ÊǼ¤¹¤ë¡£¤³¤Î´Ø¿ô¤Ï¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤ò¹¹¿·¤·(¤Ä¤Þ¤ê½é´ü¾õÂÖ¤ËÌá +¤·)¡¢¥·¥Õ¥È¥·¡¼¥±¥ó¥¹¤ÎŤµ¤Ë 1 ¤ò²Ã¤¨¤¿ÃͤòÊÖ¤¹¡£¤³¤ÎÃÍ¤Ï \fIs\fP ¤Ë +½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤Ç¤¢¤ë¡£ +.PP +»°ÈÖÌܤΥ±¡¼¥¹¤Ï¡¢\fIs\fP ¤¬ NULL ¤Î»þ¤Ç¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï \fIwc\fP ¤Ï +̵»ë¤µ¤ì¡¢´Ø¿ô¤Î¼ÂºÝ¤Î¸ú²Ì¤È¤·¤Æ¤Ï wcrtomb(buf,L\(aq\\0\(aq,\fIps\fP) ¤ÈƱ¤¸ +Ãͤ¬ÊÖ¤µ¤ì¤ë¡£¤³¤³¤Ç¡¢buf ¤ÏÆâÉôŪ¤Êƿ̾¤Î¥Ð¥Ã¥Õ¥¡¤Ç¤¢¤ë¡£ + +.PP +°Ê¾å¤Î¤¤¤º¤ì¤Î¾ì¹ç¤â¡¢\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ê¤é¤Ð¥·¥Õ¥È¾õÂÖ¤ÏÍѤ¤ +¤é¤ì¤º¡¢ +.BR wcrtomb () +´Ø¿ô¤À¤±¤¬ÃΤäƤ¤¤ëÀÅŪ¤Êƿ̾¤Î¾õÂÖ¤¬»È¤ï¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR wcrtomb () +´Ø¿ô¤Ï¡¢\fIs\fP ¤¬»Ø¤¹¥Ð¥¤¥ÈÎó¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¡¢¤¢ +¤ë¤¤¤Ï½ñ¤­¹þ¤Þ¤ì¤¿¤Ç¤¢¤í¤¦¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£\fIwc\fP ¤ò(¸½ºß¤Î¥í¥±¡¼¥ë¤Ë +½¾¤Ã¤Æ)¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Çɽ¸½¤Ç¤­¤Ê¤±¤ì¤Ð¡¢ +.I (size_t)\ \-1 +¤¬ÊÖ¤µ¤ì¡¢ \fIerrno\fP ¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR wcrtomb () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +\fIps\fP ¤Ë NULL ¤òÅϤ·¤¿ºÝ¤ÎÆ°ºî¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR wcsrtombs (3) diff --git a/release/man3/wcscasecmp.3 b/release/man3/wcscasecmp.3 new file mode 100644 index 00000000..84dffb9a --- /dev/null +++ b/release/man3/wcscasecmp.3 @@ -0,0 +1,56 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 25 23:52:06 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSCASECMP 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcscasecmp \- ¥ï¥¤¥Éʸ»úÎó¤òÈæ³Ó¤¹¤ë¡£Âçʸ»ú¤È¾®Ê¸»ú¤ò¶èÊ̤·¤Ê¤¤¡£ +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int wcscasecmp(const wchar_t *" s1 ", const wchar_t *" s2 ); +.fi +.SH ÀâÌÀ +.BR wcscasecmp () +´Ø¿ô¤Ï¡¢ +.BR strcasecmp (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô +¤Ç¤¢¤ë¡£¤³¤Î´Ø¿ô¤Ï¡¢\fIs1\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤È \fIs2\fP ¤¬»Ø¤¹ +¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¡¢Âçʸ»ú¤È¾®Ê¸»ú¤Î°ã¤¤ +.RB ( towupper (3), +.BR towlower (3)) +¤ò̵»ë¤·¤ÆÈæ³Ó¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR wcscasecmp () +´Ø¿ô¤Ï¡¢\fIs1\fP ¤È \fIs2\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úÎó¤òÂçʸ +»ú¤È¾®Ê¸»ú¤Î°ã¤¤¤ò̵»ë¤·¤ÆÈæ³Ó¤·¤¿»þ¤Ë¡¢Åù¤·¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£Âçʸ»ú¤È +¾®Ê¸»ú¤Î°ã¤¤¤ò̵»ë¤·¤Æ \fIs1\fP ¤ÎÊý¤¬ \fIs2\fP ¤è¤êÂ礭¤±¤ì¤ÐÀµ¤ÎÀ°¿ô +¤òÊÖ¤¹¡£ +Âçʸ»ú¤È¾®Ê¸»ú¤Î°ã¤¤¤ò̵»ë¤·¤Æ \fIs1\fP ¤ÎÊý¤¬ \fIs2\fP ¤è¤ê¾®¤µ¤±¤ì¤Ð +Éé¤ÎÀ°¿ô¤òÊÖ¤¹¡£ +.SH ½àµò +POSIX.1-2008. +¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +Linux °Ê³°¤Î¾¤Î¥·¥¹¥Æ¥à¤Ç¹­¤¯ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR wcscasecmp () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR strcasecmp (3), +.BR wcscmp (3) diff --git a/release/man3/wcscat.3 b/release/man3/wcscat.3 new file mode 100644 index 00000000..9f03785b --- /dev/null +++ b/release/man3/wcscat.3 @@ -0,0 +1,48 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Oct 17 21:56:31 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSCAT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcscat \- 2 ¤Ä¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤ò·ë¹ç¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcscat(wchar_t *" dest ", const wchar_t *" src ); +.fi +.SH ÀâÌÀ +.BR wcscat () +´Ø¿ô¤Ï¡¢ +.BR strcat (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIsrc\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó(½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤ò´Þ¤à)¤ò¡¢ +\fIdest\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎºÇ¸å¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +.PP +¤³¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +¥×¥í¥°¥é¥Þ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fIwcslen(dest)+wcslen(src)+1\fP ʸ»ú¤Î +¥ï¥¤¥Éʸ»ú¤¬Æþ¤ë¤À¤±¤ÎÎΰè¤ò \fIdest\fP ¤ËÂФ·¤Æ³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wcscat () +¤Ï \fIdest\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR strcat (3), +.BR wcpcpy (3), +.BR wcscpy (3), +.BR wcsncat (3) diff --git a/release/man3/wcschr.3 b/release/man3/wcschr.3 new file mode 100644 index 00000000..11f36c36 --- /dev/null +++ b/release/man3/wcschr.3 @@ -0,0 +1,45 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Oct 17 21:56:31 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSCHR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcschr \- ¥ï¥¤¥Éʸ»úʸ»úÎóÃæ¤Î¥ï¥¤¥Éʸ»ú¤ò¸¡º÷¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcschr(const wchar_t *" wcs ", wchar_t " wc ); +.fi +.SH ÀâÌÀ +.BR wcschr () +´Ø¿ô¤Ï¡¢ +.BR strchr (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwcs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎÃæ¤ÇºÇ½é¤Ë¸½¤ï¤ì¤ë \fIwc\fP ¤ò¸¡º÷¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR wcschr () +´Ø¿ô¤Ï¡¢\fIwcs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎÃæ¤ÇºÇ½é¤Ë¸½¤ï¤ì¤¿ +\fIwc\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£\fIwc\fP ¤¬Ê¸»úÎóÃæ¤Ë¸½¤ï¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï +NULL ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR strchr (3), +.BR wcspbrk (3), +.BR wcsrchr (3), +.BR wcsstr (3), +.BR wmemchr (3) diff --git a/release/man3/wcscmp.3 b/release/man3/wcscmp.3 new file mode 100644 index 00000000..1be4584a --- /dev/null +++ b/release/man3/wcscmp.3 @@ -0,0 +1,46 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Oct 17 22:09:35 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSCMP 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcscmp \- 2 ¤Ä¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤òÈæ³Ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int wcscmp(const wchar_t *" s1 ", const wchar_t *" s2 ); +.fi +.SH ÀâÌÀ +.BR wcscmp () +´Ø¿ô¤Ï¡¢ +.BR strcmp (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIs1\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤È +\fIs2\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤òÈæ³Ó¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR wcscmp () +´Ø¿ô¤Ï¡¢\fIs1\fP ¤È \fIs2\fP ¤¬¤½¤ì¤¾¤ì»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó +¤¬Æ±¤¸¤Ç¤¢¤ì¤Ð 0 ¤òÊÖ¤¹¡£°Û¤Ê¤ëʸ»ú¤¬ºÇ½é¤Ë¸½¤ï¤ì¤¿°ÌÃ֤ˤª¤¤¤Æ¡¢¤½¤Î°Ì +Ã֤ˤ¢¤ë¥ï¥¤¥Éʸ»ú \fIs1[i]\fP ¤¬ \fIs2[i]\fP ¤è¤êÂ礭¤±¤ì¤ÐÀµ¤ÎÃͤòÊÖ¤¹¡£ +°Û¤Ê¤ëʸ»ú¤¬ºÇ½é¤Ë¸½¤ï¤ì¤¿°ÌÃ֤ˤª¤¤¤Æ¡¢¤½¤Î°ÌÃ֤ˤ¢¤ë¥ï¥¤¥Éʸ»ú \fIs1[i]\fP +¤¬ \fIs2[i]\fP ¤è¤ê¾®¤µ¤±¤ì¤ÐÉé¤ÎÃͤòÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR strcmp (3), +.BR wcscasecmp (3), +.BR wmemcmp (3) diff --git a/release/man3/wcscpy.3 b/release/man3/wcscpy.3 new file mode 100644 index 00000000..116606e5 --- /dev/null +++ b/release/man3/wcscpy.3 @@ -0,0 +1,49 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Oct 17 22:19:07 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcscpy \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcscpy(wchar_t *" dest ", const wchar_t *" src ); +.fi +.SH ÀâÌÀ +.BR wcscpy () +´Ø¿ô¤Ï¡¢ +.BR strcpy (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIsrc\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»ú(½ªÃ¼¤Î L\(aq\\0\(aq ¤ò´Þ¤à)¤ò +\fIdest\fP ¤¬»Ø¤¹ÇÛÎó¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +.PP +¤³¤ì¤é¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +¥×¥í¥°¥é¥Þ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fIwcslen(src)+1\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú +¤¬Æþ¤ë¤À¤±¤ÎÎΰè¤ò \fIdest\fP ¤ËÂФ·¤Æ³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wcscpy () +¤Ï \fIdest\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR strcpy (3), +.BR wcpcpy (3), +.BR wcscat (3), +.BR wcsdup (3), +.BR wmemcpy (3) diff --git a/release/man3/wcscspn.3 b/release/man3/wcscspn.3 new file mode 100644 index 00000000..1bfd58e5 --- /dev/null +++ b/release/man3/wcscspn.3 @@ -0,0 +1,49 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sun Oct 17 22:19:07 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSCSPN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcscspn \- ¥ï¥¤¥Éʸ»úʸ»úÎ󤫤顢Ϳ¤¨¤¿Ê¸»ú½¸¹ç¤Ë´Þ¤Þ¤ì¤ëʸ»ú¤ò¸¡º÷¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t wcscspn(const wchar_t *" wcs ", const wchar_t *" reject ); +.fi +.SH ÀâÌÀ +.BR wcscspn () +´Ø¿ô¤Ï¡¢ +.BR strcspn (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwcs\fP ¤ÎÀèƬÉôʬ¤òÄ´¤Ù¡¢\fIreject\fP ¤ËÎóµó¤µ¤ì¤Æ¤¤¤Ê¤¤ +¥ï¥¤¥Éʸ»ú¤À¤±¤Ë¤è¤Ã¤Æ¹½À®¤µ¤ì¤ëÉôʬ¤òºÇ¤âŤ¯¼è¤Ã¤¿¾ì¹ç¤ÎŤµ¤òµá¤á¤ë¡£ +¸À¤¤´¹¤¨¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úʸ»úÎó \fIwcs\fP ¤ÎÃæ¤Ë¡¢¥ï¥¤¥Éʸ»úÎó +\fIreject\fP ¤Ë´Þ¤Þ¤ì¤ë¤¤¤º¤ì¤«¤Îʸ»ú¤¬¸½¤ï¤ì¤ëºÇ½é¤Î°ÌÃÖ¤òõ¤¹¡£ +.SH ÊÖ¤êÃÍ +.BR wcscspn () +´Ø¿ô¤Ï¡¢\fIwcs\fP ¤ÎÀèƬÉôʬ¤òÄ´¤Ù¡¢\fIreject\fP ¤ËÎóµó +¤µ¤ì¤Æ¤¤¤Ê¤¤¥ï¥¤¥Éʸ»ú¤À¤±¤Ë¤è¤Ã¤Æ¹½À®¤µ¤ì¤ëÉôʬ¤òºÇ¤âŤ¯¼è¤Ã¤¿¾ì¹ç¤Î +Ťµ¤òÊÖ¤¹¡£ +¸À¤¤´¹¤¨¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úʸ»úÎó \fIwcs\fP ¤ÎÃæ¤Ë¡¢¥ï¥¤¥Éʸ»úÎó +\fIreject\fP ¤Ë´Þ¤Þ¤ì¤ë¤¤¤º¤ì¤«¤Îʸ»ú¤¬¸½¤ï¤ì¤ëºÇ½é¤Î°ÌÃÖ¤òÊÖ¤¹¡£ +²¿¤â¸½¤ï¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï \fIwcslen(wcs)\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR strcspn (3), +.BR wcspbrk (3), +.BR wcsspn (3) diff --git a/release/man3/wcsdup.3 b/release/man3/wcsdup.3 new file mode 100644 index 00000000..504fb343 --- /dev/null +++ b/release/man3/wcsdup.3 @@ -0,0 +1,60 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 18 22:36:21 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated & Modified Sun Jun 6 13:23:46 JST 2004 +.\" by Yuichi SATO +.\" +.TH WCSDUP 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcsdup \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤òÊ£À½¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.br +.B #include +.sp +.BI "wchar_t *wcsdup(const wchar_t *" s ); +.fi +.SH ÀâÌÀ +.BR wcsdup () +´Ø¿ô¤Ï¡¢ +.BR strdup (3) +´Ø¿ô¤Î¥ï¥¤¥Éʸ»úÈǤǤ¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥Ý¥¤¥ó¥¿ \fIs\fP ¤¬»Ø¤·¼¨¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎÊ£À½¤ò +¿·¤·¤¤Îΰè¤Ë³ä¤êÅö¤Æ¤ÆÊÖ¤¹¡£ +.PP +¿·¤·¤¤¥ï¥¤¥Éʸ»úʸ»úÎó¤Î¤¿¤á¤Î¥á¥â¥ê¤Ï +.BR malloc (3) +¤ò»È¤Ã¤Æ³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +¤³¤ÎÎΰè¤Ï +.BR free (3) +¤ò»È¤Ã¤Æ²òÊü¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR wcsdup () +´Ø¿ô¤Ï¡¢¿·¤·¤¤¥ï¥¤¥Éʸ»úʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£ +.SH ¥¨¥é¡¼ +.TP +.B ENOMEM +Ê£À½Ê¸»úÎó¤ò³ä¤êÅö¤Æ¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2008. +¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +Linux °Ê³°¤Î¾¤Î¥·¥¹¥Æ¥à¤Ç¹­¤¯ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.\" libc5 ¤È glibc 2.0 ¤È¤½¤ì°Ê¹ß¤Ë¸ºß¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR strdup (3), +.BR wcscpy (3), +.BR feature_test_macros (7) diff --git a/release/man3/wcslen.3 b/release/man3/wcslen.3 new file mode 100644 index 00000000..f95cbe12 --- /dev/null +++ b/release/man3/wcslen.3 @@ -0,0 +1,40 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 18 22:43:56 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSLEN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcslen \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎŤµ¤òµá¤á¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t wcslen(const wchar_t *" s ); +.fi +.SH ÀâÌÀ +.BR wcslen () +´Ø¿ô¤Ï¡¢ +.BR strlen (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎŤµ¤òµá¤á¤ë¡£ +½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤Ï¤³¤ÎŤµ¤Ë¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wcslen () +´Ø¿ô¤Ï¡¢\fIs\fP ¤Ë´Þ¤Þ¤ì¤ë¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR strlen (3) diff --git a/release/man3/wcsncasecmp.3 b/release/man3/wcsncasecmp.3 new file mode 100644 index 00000000..4fe6e09b --- /dev/null +++ b/release/man3/wcsncasecmp.3 @@ -0,0 +1,58 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 18 22:59:06 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSNCASECMP 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcsncasecmp \- Âçʸ»ú¤È¾®Ê¸»ú¤ò¶èÊ̤»¤º¡¢2 ¤Ä¤Î¸ÇÄêĹ¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤òÈæ³Ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "int wcsncasecmp(const wchar_t *" s1 ", const wchar_t *" s2 ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR wcsncasecmp () +´Ø¿ô¤Ï¡¢ +.BR strncasecmp (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø +¿ô¤Ç¤¢¤ë¡£¤³¤Î´Ø¿ô¤Ï¡¢\fIs1\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤È \fIs2\fP ¤¬»Ø +¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤òÈæ³Ó¤¹¤ë¤¬¡¢ºÇÂç¤Ç¤âÀèƬ¤Î¥ï¥¤¥Éʸ»ú \fIn\fP ¸Ä +¤·¤«Èæ³Ó¤·¤Ê¤¤¡£¤Þ¤¿¡¢Âçʸ»ú¤È¾®Ê¸»ú +.RB ( towupper (3), +.BR towlower (3)) +¤Ï¶èÊ̤·¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wcsncasecmp () +´Ø¿ô¤Ï¡¢\fIs1\fP ¤È \fIs2\fP ¤¬¤½¤ì¤¾¤ì»Ø¤¹Ê¸»úÎó¤ò +\fIn\fP ʸ»ú¤Ë¼ý¤Þ¤ë¤è¤¦¤ËÀÚ¤êµÍ¤á¤¿¤â¤Î¤ò¡¢Âçʸ»ú¤È¾®Ê¸»ú¤Î°ã¤¤¤ò̵»ë +¤·¤ÆÈæ³Ó¤·¤¿¤È¤­¤ËÅù¤·¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£¤³¤Î´Ø¿ô¤Ï¡¢Âçʸ»ú¤È¾®Ê¸»ú¤ò¶è +Ê̤·¤Ê¤¤¾ì¹ç¤Ë¡¢\fIs1\fP ¤òÀÚ¤êµÍ¤á¤¿¤â¤Î¤¬ \fIs2\fP ¤òÀÚ¤êµÍ¤á¤¿¤â¤Î +¤è¤êÂ礭¤±¤ì¤ÐÀµ¤ÎÃͤòÊÖ¤¹¡£¤³¤Î´Ø¿ô¤Ï¡¢Âçʸ»ú¤È¾®Ê¸»ú¤ò¶èÊ̤·¤Ê¤¤¾ì¹ç +¤Ë¡¢\fIs1\fP ¤òÀÚ¤êµÍ¤á¤¿¤â¤Î¤¬ \fIs2\fP ¤òÀÚ¤êµÍ¤á¤¿¤â¤Î¤è¤ê¾®¤µ¤±¤ì +¤ÐÉé¤ÎÃͤòÊÖ¤¹¡£ +.SH ½àµò +POSIX.1-2008. +¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +Linux °Ê³°¤Î¾¤Î¥·¥¹¥Æ¥à¤Ç¹­¤¯ÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR wcsncasecmp () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR strncasecmp (3), +.BR wcsncmp (3) diff --git a/release/man3/wcsncat.3 b/release/man3/wcsncat.3 new file mode 100644 index 00000000..09f7c8fd --- /dev/null +++ b/release/man3/wcsncat.3 @@ -0,0 +1,47 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 18 23:11:34 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSNCAT 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcsncat \- 2 ¤Ä¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤ò·ë¹ç¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcsncat(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR wcsncat () +´Ø¿ô¤Ï +.BR strncat (3) +¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIsrc\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎ󤫤éºÇÂç \fIn\fP ¸Äʬ¤Î¥ï +¥¤¥Éʸ»ú¤ò¥³¥Ô¡¼¤·¤Æ¡¢\fIdest\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎËöÈø¤ËŽ¤êÉÕ +¤±¤ë¡£\fIdest\fP ¤Î½ªÃ¼¤Ë¤Ï L\(aq\\0\(aq ʸ»ú¤òÄɲ乤롣 +.PP +¤³¤ì¤é¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +¥×¥í¥°¥é¥Þ¤Ï¡¢\fIdest\fP ¤Ë¾¯¤Ê¤¯¤È¤â \fIwcslen(dest) + n + 1\fP +¸Ä¤Î¥ï¥¤¥Éʸ»ú¤¬Æþ¤ëÎΰè¤ò³ÎÊݤ·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wcsncat () +¤Ï \fIdest\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR strncat (3), +.BR wcscat (3) diff --git a/release/man3/wcsncmp.3 b/release/man3/wcsncmp.3 new file mode 100644 index 00000000..1ba3cf43 --- /dev/null +++ b/release/man3/wcsncmp.3 @@ -0,0 +1,49 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Mon Oct 18 23:40:56 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSNCMP 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcsncmp \- 2 ¤Ä¤Î¸ÇÄêĹ¥ï¥¤¥Éʸ»úʸ»úÎó¤òÈæ³Ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int wcsncmp(const wchar_t *" s1 ", const wchar_t *" s2 ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR wcsncmp () +´Ø¿ô¤Ï¡¢ +.BR strncmp (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIs1\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤È \fIs2\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ +»úʸ»úÎó¤òÈæ³Ó¤¹¤ë¤¬¡¢ºÇÂç¤Ç¤âÀèƬ¤Î¥ï¥¤¥Éʸ»ú \fIn\fP ¸Ä¤Þ¤Ç¤·¤«Èæ³Ó +¤·¤Ê¤¤¡£¤Þ¤¿¤¤¤º¤ì¤«¤Îʸ»úÎó¤Ë L\(aq\\0\(aq ʸ»ú¤¬¸½¤ì¤¿¤é¡¢Èæ³Ó¤Ï +¤½¤Î°ÌÃ֤ǽªÎ»¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR wcsncmp () +´Ø¿ô¤Ï¡¢\fIs1\fP ¤È \fIs2\fP ¤¬¤½¤ì¤¾¤ì»Ø¤¹Ê¸»úÎó¤ò +\fIn\fP ʸ»ú¤Ë¼ý¤Þ¤ë¤è¤¦¤ËÀÚ¤êµÍ¤á¤¿¤â¤Î¤¬Åù¤·¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +¤³¤Î´Ø¿ô¤Ï¡¢°Û¤Ê¤ëʸ»ú¤¬ºÇ½é¤Ë¸½¤ï¤ì¤¿°ÌÃÖ \fIi\fP (\fIi\fP < \fIn\fP) +¤Ë¤ª¤¤¤Æ¡¢¤½¤Î°ÌÃ֤ˤ¢¤ëʸ»ú \fIs1[i]\fP ¤¬ \fIs2[i]\fP ¤è¤êÂ礭¤±¤ì¤Ð +Àµ¤ÎÃͤòÊÖ¤¹¡£°Û¤Ê¤ëʸ»ú¤¬ºÇ½é¤Ë¸½¤ï¤ì¤¿°ÌÃÖ \fIi\fP (\fIi\fP < \fIn\fP) +¤Ë¤ª¤¤¤Æ¡¢¤½¤Î°ÌÃ֤ˤ¢¤ëʸ»ú \fIs1[i]\fP ¤¬ \fIs2[i]\fP ¤è¤ê¾®¤µ¤±¤ì¤Ð +Éé¤ÎÃͤòÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR strncmp (3), +.BR wcsncasecmp (3) diff --git a/release/man3/wcsncpy.3 b/release/man3/wcsncpy.3 new file mode 100644 index 00000000..1da2b2df --- /dev/null +++ b/release/man3/wcsncpy.3 @@ -0,0 +1,50 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 19 02:13:45 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSNCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcsncpy \- ¸ÇÄêĹ¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcsncpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR wcsncpy () +´Ø¿ô¤Ï¡¢ +.BR strncpy (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï \fIsrc\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎ󤫤顢½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤ò +´Þ¤á¤ÆºÇÂç \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ò¡¢\fIdest\fP ¤¬»Ø¤¹ÇÛÎó¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +¤Á¤ç¤¦¤É \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤¬ \fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +\fIwcslen(src)\fP ¤ÎŤµ¤¬ \fIn\fP ¤è¤ê¾®¤µ¤±¤ì¤Ð¡¢\fIdest\fP ¤¬»Ø¤¹ +ÇÛÎó¤Î»Ä¤ê¤Î¥ï¥¤¥Éʸ»ú¤ÎÉôʬ¤Ï L\(aq\\0\(aq ʸ»ú¤ÇËä¤á¤é¤ì¤ë¡£ +\fIwcslen(src)\fP ¤ÎŤµ¤¬ \fIn\fP °Ê¾å¤Ê¤é¤Ð¡¢\fIdest\fP ¤¬»Ø¤¹Ê¸»úÎó +¤¬ L\(aq\\0\(aq ¤Ç½ªÃ¼¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.PP +¤³¤ì¤é¤ÎÇÛÎó¤Ï½Å¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +¥×¥í¥°¥é¥Þ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fIn\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤¬Æþ¤ë¤À¤±¤ÎÎΰè¤ò +\fIdest\fP ¤ËÂФ·¤Æ³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wcsncpy () +¤Ï \fIdest\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR strncpy (3) diff --git a/release/man3/wcsnlen.3 b/release/man3/wcsnlen.3 new file mode 100644 index 00000000..68c06b67 --- /dev/null +++ b/release/man3/wcsnlen.3 @@ -0,0 +1,49 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 19 02:22:50 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSNLEN 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcsnlen \- ¸ÇÄêĹ¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎŤµ¤òµá¤á¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "size_t wcsnlen(const wchar_t *" s ", size_t " maxlen ); +.fi +.SH ÀâÌÀ +.BR wcsnlen () +´Ø¿ô¤Ï¡¢ +.BR strnlen (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIs\fP ¤¬»Ø¤¹Ê¸»úÎóÃæ¤Î¥ï¥¤¥Éʸ»ú¤Î¿ô¤òÊÖ¤¹¤¬¡¢¤³¤ì¤ÏºÇÂç +\fImaxlen\fP ʸ»ú¤Þ¤Ç¤Ç¤¢¤ë¡£¤Þ¤¿¡¢½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤Ï´Þ¤Þ¤Ê¤¤¡£ +¤³¤ì¤ò¹Ô¤¦ºÝ¤Ë¤Ï¡¢ +.BR wcsnlen () +¤Ï \fIs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úÎó¤ÎºÇ½é¤Î +\fImaxlen\fP ʸ»ú¤·¤«¸«¤º¡¢·è¤·¤Æ \fIs+maxlen\fP ʸ»ú¤òĶ¤¨¤Æʸ»úÎó¤ò +»²¾È¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wcsnlen () +´Ø¿ô¤Ï¡¢\fIwcslen(s)\fP ¤ÎÃͤ¬ \fImaxlen\fP ¤è¤ê¾®¤µ¤±¤ì +¤Ð \fIwcslen(s)\fP ¤òÊÖ¤¹¡£¤¢¤ë¤¤¤Ï¡¢\fIs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úÎóÃæ¤Î +ºÇ½é¤Î \fImaxlen\fP ʸ»ú¤Ë L\(aq\\0\(aq ʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð +\fImaxlen\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR strnlen (3), +.BR wcslen (3) diff --git a/release/man3/wcsnrtombs.3 b/release/man3/wcsnrtombs.3 new file mode 100644 index 00000000..d92d8cd5 --- /dev/null +++ b/release/man3/wcsnrtombs.3 @@ -0,0 +1,91 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Fri Oct 22 01:12:12 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSNRTOMBS 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcsnrtombs \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #define _GNU_SOURCE +.B #include +.sp +.BI "size_t wcsnrtombs(char *" dest ", const wchar_t **" src ", size_t " nwc , +.BI " size_t " len ", mbstate_t *" ps ); +.fi +.SH ÀâÌÀ +.BR wcsnrtombs () +´Ø¿ô¤Ï¡¢ +.BR wcsrtombs () +´Ø¿ô¤Ë»÷¤Æ¤¤¤ë¡£¤¿¤À¤·¡¢ +ÊÑ´¹¤µ¤ì¤ë¥ï¥¤¥Éʸ»ú¤Î¿ô¤¬(\fI*src\fP ¤«¤é¿ô¤¨¤Æ) \fInwc\fP ʸ»ú¤ËÀ©¸Â +¤µ¤ì¤Æ¤¤¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +.PP +\fIdest\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¡¢ +.BR wcsnrtombs () +´Ø¿ô¤Ï +¥ï¥¤¥Éʸ»úʸ»úÎó¤ÎºÇÂç \fInwc\fP ¸Ä¤Þ¤Ç¤Î¥ï¥¤¥Éʸ»ú¤ò \fIdest\fP ¤«¤é +»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£\fIdest\fP ¤Ë¤ÏºÇÂç \fIlen\fP ¥Ð¥¤ +¥È¤Þ¤Ç½ñ¤­¹þ¤Þ¤ì¤ë¡£¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤Ï¹¹¿·¤µ¤ì¤ë¡£¼ÂºÝ¤Î¸ú²Ì¤È¤· +¤Æ¤Ï¡¢¤³¤ÎÊÑ´¹¤Ï°Ê²¼¤ÎÆ°ºî¤ÈƱ¤¸¤Ë¤Ê¤ë: +.IR "wcrtomb(dest, *src, ps)" +¤ò¸Æ¤Ó¡¢À®¸ù¤¬Ê֤俤é +\fIdest\fP ¤ò½ñ¤­¹þ¤ó¤À¥Ð¥¤¥È¿ô¤À¤±Áý¤ä¤·¡¢\fI*src\fP ¤ò 1 Áý¤ä¤¹¡£ +¤½¤·¤Æ¡¢wcrtomb ¤¬À®¸ù¤òÊÖ¤¹¸Â¤ê¤³¤ì¤ò·«¤êÊÖ¤¹¡£ +ÊÑ´¹¤¬»ß¤Þ¤ëÍýͳ¤Ï 3 ¤Ä¹Í¤¨¤é¤ì¤ë: +.PP +1. (¸½ºß¤Î¥í¥±¡¼¥ë¤Ë´ð¤Å¤¤¤Æ)¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Çɽ¸½¤Ç¤­¤Ê¤¤¥ï¥¤¥Éʸ»ú¤Ë +½Ð²ñ¤Ã¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ï¡¢\fI*src\fP ¤ÏÉÔÀµ¤Ê¥ï¥¤¥Éʸ»ú¤ò»Ø¤·¤¿¾õÂ֤ˤʤꡢ +.I (size_t)\ \-1 +¤¬ÊÖ¤µ¤ì¡¢\fIerrno\fP ¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +2. L\(aq\\0\(aq ¤Ë½Ð²ñ¤ï¤Ê¤¤¤Ç \fInwc\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤òÊÑ´¹¤·¤¿¾ì¹ç¤«¡¢Ä¹ +¤µ¤ÎÀ©¸Â¤Ë¤è¤Ã¤ÆÊÑ´¹¤¬»ß¤á¤é¤ì¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢\fI*src\fP ¤Ï¼¡¤Ë +ÊÑ´¹¤µ¤ì¤ë¤Ù¤­¥ï¥¤¥Éʸ»ú¤ò»Ø¤·¤¿¾õÂ֤ˤʤꡢ\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿ +¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +3. ¥ï¥¤¥Éʸ»úÎ󤬽ªÃ¼¤Î L\(aq\\0\(aq (¤³¤ì¤Ë¤Ï \fI*ps\fP ¤ò½é´ü¾õÂÖ¤ËÌ᤹¤È +¤¤¤¦ÉûºîÍѤ¬¤¢¤ë)¤â´Þ¤á¤ÆÁ´¤ÆÊÑ´¹¤µ¤ì¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ë¤Ï \fI*src\fP +¤Ë NULL ¤¬ÀßÄꤵ¤ì¡¢\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë +(½ªÃ¼¤Î \(aq\\0\(aq ¤Ï¿ô¤¨¤Ê¤¤)¡£ +.PP +\fIdest\fP ¤¬ NULL ¤Ê¤é¤Ð \fIlen\fP ¤Ï̵»ë¤µ¤ì¤ÆÁ°½Ò¤Î¤è¤¦¤ËÊÑ´¹¤¬¹Ô¤ï +¤ì¤ë¤¬¡¢ÊÑ´¹¤µ¤ì¤¿¥Ð¥¤¥È¥Ç¡¼¥¿¤Ï¥á¥â¥ê¤Ë½ñ¤­½Ð¤µ¤ì¤Ê¤¤ÅÀ¤È¡¢½ÐÎÏÀè¤ÎĹ +¤µ¤ÎÀ©¸Â¤¬¤Ê¤¤ÅÀ¤¬°Û¤Ê¤ë¡£ +.PP +¾åµ­¤Î¤¤¤º¤ì¤Î¾ì¹ç¤â¡¢\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ê¤é¤Ð¡¢wcsnrtombs ´Ø¿ô +¤À¤±¤¬ÃΤäƤ¤¤ëÀÅŪ¤Êƿ̾¤Î¾õÂÖ¤¬¥·¥Õ¥È¾õÂÖ¤ÎÂå¤ï¤ê¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +¥×¥í¥°¥é¥Þ¤Ï¾¯¤Ê¤¯¤È¤â \fIlen\fP ¥Ð¥¤¥È¤ÎÎΰè¤ò \fIdest\fP ¤Ë³ÎÊݤ·¤Ê +¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wcsnrtombs () +´Ø¿ô¤Ï¡¢ÊÑ´¹¤·¤ÆÆÀ¤é¤ì¤¿¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Î¥Ð¥¤¥È¿ô¤òÊÖ +¤¹¡£¤³¤ì¤Ë¤Ï½ªÃ¼¤Î null ¥Ð¥¤¥È¤Ï´Þ¤Þ¤Ê¤¤¡£ +ÊÑ´¹¤Ç¤­¤Ê¤¤¥ï¥¤¥Éʸ»ú¤Ë½Ð²ñ¤Ã¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤¬ÊÖ¤µ¤ì¡¢ \fIerrno\fP ¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ½àµò +¤³¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.BR wcsnrtombs () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +\fIps\fP ¤Ë NULL ¤òÅϤ·¤¿ºÝ¤ÎÆ°ºî¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iconv (3), +.BR wcsrtombs (3) diff --git a/release/man3/wcspbrk.3 b/release/man3/wcspbrk.3 new file mode 100644 index 00000000..087d95e5 --- /dev/null +++ b/release/man3/wcspbrk.3 @@ -0,0 +1,44 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 15:19:34 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSPBRK 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcspbrk \- ¥ï¥¤¥Éʸ»úÎ󤫤顢Ϳ¤¨¤é¤ì¤¿¥ï¥¤¥Éʸ»ú½¸¹ç¤Ë´Þ¤Þ¤ì¤ëʸ»ú¤ò¸¡º÷¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcspbrk(const wchar_t *" wcs ", const wchar_t *" accept ); +.fi +.SH ÀâÌÀ +.BR wcspbrk () +´Ø¿ô¤Ï¡¢ +.BR strpbrk (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwcs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤Ë¤ª¤¤¤Æ¡¢\fIaccept\fP ¤¬ +¼¨¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤Î¤¤¤º¤ì¤«¤Îʸ»ú¤¬ºÇ½é¤Ë¸½¤ï¤ì¤ë°ÌÃÖ¤ò¸¡º÷¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR wcspbrk () +´Ø¿ô¤Ï¡¢\fIaccept\fP ¤ËÎóµó¤µ¤ì¤¿Ê¸»ú¤Î¤¤¤º¤ì¤«¤¬ +\fIwcs\fP Ãæ¤ËºÇ½é¤Ë¸½¤ï¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£¤³¤Î¤è¤¦¤Êʸ»ú¤¬ +\fIwcs\fP ¤Ë´Þ¤Þ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢NULL ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR strpbrk (3), +.BR wcschr (3), +.BR wcscspn (3) diff --git a/release/man3/wcsrchr.3 b/release/man3/wcsrchr.3 new file mode 100644 index 00000000..79c363ff --- /dev/null +++ b/release/man3/wcsrchr.3 @@ -0,0 +1,42 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 15:19:34 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSRCHR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcsrchr \- ¥ï¥¤¥Éʸ»úÎóÃæ¤Î¥ï¥¤¥Éʸ»ú¤òõ¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcsrchr(const wchar_t *" wcs ", wchar_t " wc ); +.fi +.SH ÀâÌÀ +.BR wcsrchr () +´Ø¿ô¤Ï¡¢ +.BR strrchr (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwcs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎóÃæ¤Ë \fIwc\fP ¤¬ºÇ¸å¤Ë¸½¤ï +¤ì¤ë°ÌÃÖ¤ò¸¡º÷¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +\fBwcsrchr\fP ´Ø¿ô¤Ï¡¢\fIwcs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎóÃæ¤Ë \fIwc\fP ¤¬ +ºÇ¸å¤Ë¸½¤ï¤ì¤¿°ÌÃÖ¤òÊÖ¤¹¡£¤³¤Îʸ»úÎó¤Ë \fIwc\fP ¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð +NULL ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR strrchr (3), +.BR wcschr (3) diff --git a/release/man3/wcsrtombs.3 b/release/man3/wcsrtombs.3 new file mode 100644 index 00000000..f497e8e1 --- /dev/null +++ b/release/man3/wcsrtombs.3 @@ -0,0 +1,87 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 15:38:11 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSRTOMBS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcsrtombs \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t wcsrtombs(char *" dest ", const wchar_t **" src , +.BI " size_t " len ", mbstate_t *" ps ); +.fi +.SH ÀâÌÀ +\fIdest\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¡¢ +.BR wcsrtombs () +´Ø¿ô¤Ï +¥ï¥¤¥Éʸ»úʸ»úÎó \fI*src\fP ¤ò \fIdest\fP ¤¬»Ø¤¹¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó +¤ËÊÑ´¹¤¹¤ë¡£ºÇÂç \fIlen\fP ¥Ð¥¤¥È¤Þ¤Ç¤¬ \fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤Ï¹¹¿·¤µ¤ì¤ë¡£¼ÂºÝ¤Î¸ú²Ì¤È¤·¤Æ¤Ï¡¢¤³¤ÎÊÑ´¹¤Ï°Ê²¼ +¤ÎÆ°ºî¤ÈƱ¤¸¤Ë¤Ê¤ë: +.IR "wcrtomb(dest, *src, ps)" +¤ò¸Æ¤Ó¡¢À®¸ù¤¬Ê֤俤顢 +\fIdest\fP ¤ò½ñ¤­¹þ¤ó¤À¥Ð¥¤¥È¿ô¤À¤±Áý¤ä¤·¡¢\fI*src\fP ¤ò 1 Áý¤ä¤¹¡£ +¤½¤·¤Æ¡¢wcrtomb ¤¬À®¸ù¤òÊÖ¤¹¸Â¤ê¤³¤ì¤ò·«¤êÊÖ¤¹¡£ +ÊÑ´¹¤¬»ß¤Þ¤ëÍýͳ¤Ï 3 ¤Ä¹Í¤¨¤é¤ì¤ë: +.PP +(¸½ºß¤Î¥í¥±¡¼¥ë¤Ë´ð¤Å¤¤¤Æ)¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Çɽ¸½¤Ç¤­¤Ê¤¤¥ï¥¤¥Éʸ»ú¤Ë +½Ð²ñ¤Ã¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ï¡¢\fI*src\fP ¤ÏÉÔÀµ¤Ê¥ï¥¤¥Éʸ»ú¤ò»Ø¤·¤¿¾õÂ֤ˤʤꡢ +.I (size_t)\ \-1 +¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +.PP +2. Ťµ¤ÎÀ©¸Â¤Ë¤è¤êÊÑ´¹¤¬»ß¤á¤é¤ì¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢\fI*src\fP ¤Ï¼¡¤Ë +ÊÑ´¹¤µ¤ì¤ë¤Ù¤­¥ï¥¤¥Éʸ»úÎó¤ò»Ø¤·¤¿¾õÂ֤ˤʤꡢ\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì +¤¿¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +3. ¥ï¥¤¥Éʸ»úÎ󤬽ªÃ¼¤Î L\(aq\\0\(aq (¤³¤ì¤Ë¤Ï \fI*ps\fP ¤ò½é´ü¾õÂÖ¤ËÌ᤹¤È +¤¤¤¦ÉûºîÍѤ¬¤¢¤ë)¤â´Þ¤á¤ÆÁ´¤ÆÊÑ´¹¤µ¤ì¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ë¤Ï \fI*src\fP +¤Ë NULL ¤¬ÀßÄꤵ¤ì¡¢\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë +(½ªÃ¼¤Î \(aq\\0\(aq ¤Ï¿ô¤¨¤Ê¤¤)¡£ +.PP +\fIdest\fP ¤¬ NULL ¤Ê¤é¤Ð \fIlen\fP ¤Ï̵»ë¤µ¤ì¤ÆÁ°½Ò¤Î¤è¤¦¤ËÊÑ´¹¤¬¹Ô¤ï +¤ì¤ë¤¬¡¢ÊÑ´¹¤µ¤ì¤¿¥Ð¥¤¥È¥Ç¡¼¥¿¤Ï¥á¥â¥ê¤Ë½ñ¤­½Ð¤µ¤ì¤Ê¤¤ÅÀ¤È¡¢½ÐÎÏÀè¤ÎĹ +¤µ¤ÎÀ©¸Â¤¬¤Ê¤¤ÅÀ¤¬°Û¤Ê¤ë¡£ +.PP +¾åµ­¤Î¤¤¤º¤ì¤Î¾ì¹ç¤â¡¢\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ê¤é¤Ð¡¢wcsnrtombs ´Ø¿ô +¤À¤±¤¬ÃΤäƤ¤¤ëÀÅŪ¤Êƿ̾¤Î¾õÂÖ¤¬¥·¥Õ¥È¾õÂÖ¤ÎÂå¤ï¤ê¤ËÍѤ¤¤é¤ì¤ë¡£ +.PP +¥×¥í¥°¥é¥Þ¤Ï¾¯¤Ê¤¯¤È¤â \fIlen\fP ¥Ð¥¤¥È¤ÎÎΰè¤ò \fIdest\fP ¤Ë³ÎÊݤ·¤Ê +¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wcsrtombs () +¤Ï¡¢ÊÑ´¹¤·¤ÆÆÀ¤é¤ì¤¿¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +¤³¤ì¤Ë¤Ï½ªÃ¼¤Î null ¥Ð¥¤¥È¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +ÊÑ´¹¤Ç¤­¤Ê¤¤¥ï¥¤¥Éʸ»ú¤Ë½Ð²ñ¤Ã¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤¬ÊÖ¤µ¤ì¡¢ +.I errno +¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ½àµò +C99. +.BR wcsrtombs () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +\fIps\fP ¤Ë NULL ¤òÅϤ·¤¿ºÝ¤ÎÆ°ºî¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iconv (3), +.BR wcsnrtombs (3), +.BR wcstombs (3) diff --git a/release/man3/wcsspn.3 b/release/man3/wcsspn.3 new file mode 100644 index 00000000..28b7c6aa --- /dev/null +++ b/release/man3/wcsspn.3 @@ -0,0 +1,48 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 15:46:13 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSSPN 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcsspn \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¿Ê¤ß¡¢¥ï¥¤¥Éʸ»ú¤Î½¸¹ç¤Îʸ»ú¤ò¥¹¥­¥Ã¥×¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t wcsspn(const wchar_t *" wcs ", const wchar_t *" accept ); +.fi +.SH ÀâÌÀ +.BR wcsspn () +´Ø¿ô¤Ï¡¢ +.BR strspn (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIwcs\fP ¤ÎÀèƬÉôʬ¤òÄ´¤Ù¡¢\fIaccept\fP ¤ËÎóµó¤µ¤ì¤Æ¤¤¤ë +¥ï¥¤¥Éʸ»ú¤À¤±¤Ë¤è¤Ã¤Æ¹½À®¤µ¤ì¤ëÉôʬ¤òºÇ¤âŤ¯¼è¤Ã¤¿¾ì¹ç¤ÎŤµ¤òµá¤á¤ë¡£ +¸À¤¤´¹¤¨¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úʸ»úÎó \fIwcs\fP ¤ÎÃæ¤Ë¡¢¥ï¥¤¥Éʸ»úÎó +\fIaccept\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤Ê¸»ú¤¬¸½¤ï¤ì¤ëºÇ½é¤Î°ÌÃÖ¤òõ¤¹¡£ +.SH ÊÖ¤êÃÍ +.BR wcsspn () +´Ø¿ô¤Ï¡¢\fIwcs\fP ¤ÎÀèƬÉôʬ¤òÄ´¤Ù¡¢\fIaccept\fP ¤ËÎóµó¤µ +¤ì¤Æ¤¤¤ë¥ï¥¤¥Éʸ»ú¤À¤±¤Ë¤è¤Ã¤Æ¹½À®¤µ¤ì¤ëÉôʬ¤òºÇ¤âŤ¯¼è¤Ã¤¿¾ì¹ç¤ÎŤµ +¤òÊÖ¤¹¡£ +¸À¤¤´¹¤¨¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úʸ»úÎó \fIwcs\fP ¤ÎÃæ¤Ë¡¢¥ï¥¤¥Éʸ»úÎó +\fIaccept\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤Ê¸»ú¤¬¸½¤ï¤ì¤ëºÇ½é¤Î°ÌÃÖ¤òÊÖ¤¹¡£ +²¿¤â¸½¤ï¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï \fIwcslen(wcs)\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR strspn (3), +.BR wcscspn (3) diff --git a/release/man3/wcsstr.3 b/release/man3/wcsstr.3 new file mode 100644 index 00000000..c437ed3e --- /dev/null +++ b/release/man3/wcsstr.3 @@ -0,0 +1,47 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 15:50:55 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSSTR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcsstr \- ¥ï¥¤¥Éʸ»úʸ»úÎóÃæ¤ÎÉôʬʸ»úÎó¤Î°ÌÃÖ¤òÆÃÄꤹ¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcsstr(const wchar_t *" haystack ", const wchar_t *" needle ); +.fi +.SH ÀâÌÀ +.BR wcsstr () +´Ø¿ô¤Ï¡¢ +.BR strstr (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»úʸ»úÎó¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥ï¥¤¥Éʸ»úʸ»úÎó \fIneedle\fP (½ªÃ¼¤Î L\(aq\\0\(aq ʸ»ú¤Ï´Þ¤Þ¤Ê¤¤) +¤¬¡¢¥ï¥¤¥Éʸ»úʸ»úÎó \fIhaystack\fP ¤ÎÉôʬʸ»úÎó¤È¤·¤ÆºÇ½é¤Ë¸½¤ï¤ì¤ë°Ì +ÃÖ¤òõ¤¹¡£ +.SH ÊÖ¤êÃÍ +.BR wcsstr () +´Ø¿ô¤Ï¡¢\fIhaystack\fP Ãæ¤Ë \fIneedle\fP ¤¬¸½¤ï¤ì¤¿ºÇ½é¤Î +°ÌÃÖ¤òÊÖ¤¹¡£\fIneedle\fP ¤¬ \fIhaystack\fP ¤ÎÉôʬʸ»úÎó¤Ç¤Ê¤±¤ì¤Ð +NULL ¤òÊÖ¤¹¡£ +.PP +°Ê²¼¤ÎÆüì¤Ê¾ì¹ç¤ËÃí°Õ¤¹¤ë¤³¤È: \fIneedle\fP ¤¬¶õ¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤Ê +¤é¤Ð¡¢ÊÖ¤êÃͤϾï¤Ë \fIhaystack\fP ¼«¿È¤È¤Ê¤ë¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR strstr (3), +.BR wcschr (3) diff --git a/release/man3/wcstoimax.3 b/release/man3/wcstoimax.3 new file mode 100644 index 00000000..39c1c36a --- /dev/null +++ b/release/man3/wcstoimax.3 @@ -0,0 +1,62 @@ +.\" 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 Sep 11 07:57:58 JST 2004 +.\" by Yuichi SATO +.\" +.TH WCSTOIMAX 3 2003-11-01 "" "Linux Programmer's Manual" +.SH ̾Á° +wcstoimax, wcstoumax \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤òÀ°¿ô¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.sp +.BI "intmax_t wcstoimax(const wchar_t *" nptr ", wchar_t **" endptr \ +", int " base ); +.br +.BI "uintmax_t wcstoumax(const wchar_t *" nptr ", wchar_t **" endptr \ +", int " base ); +.fi +.SH ÀâÌÀ +¤³¤ì¤é¤Î´Ø¿ô¤Ï¤Á¤ç¤¦¤É +.BR wcstol (3) +¤È +.BR wcstoul (3) +¤Ë»÷¤Æ¤¤¤ë¤¬¡¢¤½¤ì¤¾¤ì +.I intmax_t +¤È +.I uintmax_t +·¿¤ÎÃͤòÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR imaxabs (3), +.BR imaxdiv (3), +.BR strtoimax (3), +.BR strtoumax (3), +.\" FIXME . the pages referred to by the following xrefs are not yet written +.BR wcstol (3), +.BR wcstoul (3) diff --git a/release/man3/wcstok.3 b/release/man3/wcstok.3 new file mode 100644 index 00000000..b1c1a0ba --- /dev/null +++ b/release/man3/wcstok.3 @@ -0,0 +1,83 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 17:53:50 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSTOK 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcstok \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥È¡¼¥¯¥ó¤Ëʬ³ä¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wcstok(wchar_t *" wcs ", const wchar_t *" delim \ +", wchar_t **" ptr ); +.fi +.SH ÀâÌÀ +.BR wcstok () +´Ø¿ô¤Ï¡¢ +.BR strtok (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ë¡¢ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤ÎÆ°ºî¤ò¤µ¤»¤ë¤¿¤á¤Î°ú¤­¿ô¤òÄɲä·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤òÍѤ¤¤Æ¡¢¥ï¥¤¥Éʸ»úʸ»úÎó \fIwcs\fP ¤ò¥È¡¼¥¯¥ó¤Ëʬ²ò¤¹¤ë¤³¤È +¤¬¤Ç¤­¤ë¡£¤³¤³¤Ç¡¢¥È¡¼¥¯¥ó¤Ï \fIdelim\fP ¤ËÎóµó¤µ¤ì¤Æ¤¤¤ëʸ»ú¤ò´Þ¤Þ¤Ê +¤¤Éôʬʸ»úÎó¤È¤·¤ÆÄêµÁ¤µ¤ì¤ë¡£ +.PP +¸¡º÷¤Ï \fIwcs\fP ¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð \fIwcs\fP ¤«¤é³«»Ï¤µ¤ì¡¢\fIwcs\fP +¤¬ NULL ¤Ê¤é¤Ð \fI*ptr\fP ¤«¤é³«»Ï¤µ¤ì¤ë¡£¤Þ¤º¡¢Á´¤Æ¤Î¶èÀÚ¤ê¥ï¥¤¥Éʸ»ú +¤¬¥¹¥­¥Ã¥×¤µ¤ì¤ë¡£¤Ä¤Þ¤ê¡¢\fIdelim\fP ¤Ë´Þ¤Þ¤ì¤ë¥ï¥¤¥Éʸ»ú¤òĶ¤¨¤ë¤è¤¦ +¤Ë¥Ý¥¤¥ó¥¿¤¬Á°¤Ë¿Ê¤á¤é¤ì¤ë¡£ +¥ï¥¤¥Éʸ»úʸ»úÎó¤Î½ª¤ï¤ê¤Ë㤷¤¿¤é¡¢ +.BR wcstok () +¤Ï NULL ¤òÊÖ¤·¤Æ +¥È¡¼¥¯¥ó¤¬Á´¤¯¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤·¡¢¤³¤Î¸å¤Ë +.BR wcstok () +¤ò¸Æ¤Ó +½Ð¤·¤Æ¤â NULL ¤¬ÊÖ¤µ¤ì¤ë¤è¤¦¤Ë \fI*ptr\fP ¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£¤½¤ì +°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢ +.BR wcstok () +´Ø¿ô¤Ï¥È¡¼¥¯¥ó¤ÎÀèƬ¤ò¼±Ê̤·¡¢¤³¤ì¤ò»Ø¤¹ +¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¤¿¤À¤·¤³¤ì¤ò¹Ô¤¦Á°¤Ë¡¢¥È¡¼¥¯¥ó¤Î¸å¤Ë¤¢¤ë¡¢\fIdelim\fP +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ëʸ»ú¤ò L\(aq\\0\(aq ¤ËÃÖ¤­´¹¤¨¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥È¡¼¥¯¥ó¤ò 0 ¤Ç +½ªÃ¼¤µ¤»¤ë¡£¤µ¤é¤Ë \fI*ptr\fP ¤ò¹¹¿·¤·¡¢¸å¤Ç +.BR wcstok () +¤ò¸Æ¤Ó½Ð¤·¤¿ +ºÝ¤Ë¡¢¼±Ê̤µ¤ì¤¿¥È¡¼¥¯¥ó¤Î³¤­¤«¤é¸¡º÷¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR wcstok () +´Ø¿ô¤Ï¼¡¤Î¥È¡¼¥¯¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¥È¡¼¥¯¥ó¤¬¸«¤Ä¤«¤é +¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +´Ø¿ô¤ËÍ¿¤¨¤¿¥ï¥¤¥Éʸ»úÎó \fIwcs\fP ¤Ï¡¢´Ø¿ô¤ÎÆ°ºî¤Ë¤è¤Ã¤Æ´°Á´¤Ë½ñ¤­´¹ +¤¨¤é¤ì¤ë¡£ +.SH Îã +°Ê²¼¤Î¥³¡¼¥É¤Ï¡¢¥ï¥¤¥Éʸ»úʸ»úÎó¤Ë´Þ¤Þ¤ì¤ë¥È¡¼¥¯¥ó¤ò¼è¤ê½Ð¤·¤Ê¤¬¤é +¥ë¡¼¥×¤¹¤ë¡£ +.sp +.nf +wchar_t *wcs = ...; +wchar_t *token; +wchar_t *state; +for (token = wcstok(wcs, " \\t\\n", &state); + token != NULL; + token = wcstok(NULL, " \\t\\n", &state)) { + ... +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR strtok (3), +.BR wcschr (3) diff --git a/release/man3/wcstombs.3 b/release/man3/wcstombs.3 new file mode 100644 index 00000000..69b3a410 --- /dev/null +++ b/release/man3/wcstombs.3 @@ -0,0 +1,75 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcstombs \- ¥ï¥¤¥Éʸ»úÎó¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "size_t wcstombs(char *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +\fIdest\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¤¾ì¹ç¡¢ +.BR wcstombs () +´Ø¿ô¤Ï +¥ï¥¤¥Éʸ»úÎó \fIsrc\fP ¤ò \fIdest\fP ¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤Ë +ÊÑ´¹¤¹¤ë¡£\fIdest\fP ¤Ë¤ÏºÇÂç¤Ç \fIn\fP ¥Ð¥¤¥È¤¬½ñ¤­¹þ¤Þ¤ì¤ë¡£ +ÊÑ´¹¤Ï½é´ü¾õÂ֤dz«»Ï¤µ¤ì¤ë¡£ÊÑ´¹¤Ï°Ê²¼¤Î3¤Ä¤ÎÍýͳ¤Ë¤è¤êÄä»ß¤¹¤ë¡£ +.PP +1. (¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤±¤ë)¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Çɽ¸½¤Ç¤­¤Ê¤¤¥ï¥¤¥Éʸ»ú¤Ë +Áø¶ø¤·¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +2. ŤµÀ©¸Â¤Ë¤è¤Ã¤Æ¶¯À©Ää»ß¤µ¤»¤é¤ì¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ë¤Ï \fIdest\fP ¤Ë +½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë¡£¤·¤«¤·¤³¤Î»þÅÀ¤Ç¤Î¥·¥Õ¥È¾õÂ֤ϼº¤ï¤ì¤ë¡£ +.PP +3. ¥ï¥¤¥Éʸ»úÎ󤬽ªÃ¼¤Î L\(aq\\0\(aq ¤ò´Þ¤á¤Æ´°Á´¤ËÊÑ´¹¤µ¤ì¤¿¾ì¹ç¡£ +¤³¤Î¾ì¹ç¤Ë¤ÏÊÑ´¹¤Ï½é´ü¾õÂ֤ǽª¤ê¡¢½ªÃ¼¤Î \(aq\\0\(aq ¥Ð¥¤¥È¤ò½ü¤¤¤Æ +\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ +.PP +¥×¥í¥°¥é¥Þ¡¼¤Ï \fIdest\fP ¤ËºÇÄã¤Ç¤â \fIn\fP ¥Ð¥¤¥È¤Î¶õ¤­¤¬¤¢¤ë¤³¤È¤ò +Êݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +\fIdest\fP ¤¬ NULL ¤Î¾ì¹ç¡¢\fIn\fP ¤Ï̵»ë¤µ¤ì¤ë¡£¾åµ­¤ÈƱÍͤËÊÑ´¹¤¬¹Ô +¤Ê¤ï¤ì¤ë¤¬ÊÑ´¹·ë²Ì¤Î¥Ð¥¤¥ÈÎó¤Ï¥á¥â¥ê¤Ë¤Ï½ñ¤­¹þ¤Þ¤ì¤Ê¤¤¡£ +¤Þ¤¿Ä¹¤µ¤Î¾å¸Â¤¬Â¸ºß¤·¤Ê¤¤¡£ +.PP +¾åµ­¤Î 2. ¤Î¾ì¹ç¤òÈò¤±¤ë¤¿¤á¤Ë¡¢¥×¥í¥°¥é¥Þ¡¼¤Ï \fIn\fP ¤¬ +\fIwcstombs(NULL,src,0)+1\fP °Ê¾å¤Ç¤¢¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wcstombs () +´Ø¿ô¤ÏÀ¸À®¤·¤¿¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£½ªÃ¼¤Î +¥Ê¥ëʸ»ú¤Ï´Þ¤Þ¤Ê¤¤¡£¤â¤·ÊÑ´¹¤Ç¤­¤Ê¤¤¥ï¥¤¥Éʸ»ú¤ËÁø¶ø¤·¤¿¾ì¹ç¤Ë¤Ï +.I (size_t)\ \-1 +¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR wcstombs () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +.BR wcsrtombs () +´Ø¿ô¤ÏƱ¤¸µ¡Ç½¤Î¤¿¤á¤Î¥¹¥ì¥Ã¥É¡¦¥»¡¼¥Õ¤Ê +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR wcsrtombs (3) diff --git a/release/man3/wcswidth.3 b/release/man3/wcswidth.3 new file mode 100644 index 00000000..201369d3 --- /dev/null +++ b/release/man3/wcswidth.3 @@ -0,0 +1,45 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 18:44:42 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCSWIDTH 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcswidth \- ¸ÇÄꥵ¥¤¥º¤Î¥ï¥¤¥Éʸ»úʸ»úÎó¤Îɽ¼¨¤ËɬÍפʥ«¥é¥à¿ô¤òµá¤á¤ë +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.B #include +.sp +.BI "int wcswidth(const wchar_t *" s ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR wcswidth () +´Ø¿ô¤Ï¡¢\fIs\fP ¤¬»Ø¤¹¥ï¥¤¥Éʸ»úʸ»úÎó¤òɽ¸½¤¹¤ë¤¿¤á¤Ë +ɬÍפʥ«¥é¥à¿ô¤òÊÖ¤¹¡£¤¿¤À¤·¡¢ºÇÂç \fIn\fP ʸ»ú¤·¤«½èÍý¤·¤Ê¤¤¡£ +°õºþ²Äǽ¤Ç¤Ê¤¤¥ï¥¤¥Éʸ»ú¤¬Ê¸»úÎó¤Ë´Þ¤Þ¤ì¤ë¾ì¹ç¤Ë¤Ï¡¢ \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR wcswidth () +´Ø¿ô¤Ï¡¢¥ï¥¤¥Éʸ»úʸ»úÎó \fIs\fP ¤Îɽ¸½¤ËɬÍפʥ«¥é¥à¿ô +¤òÊÖ¤¹¡£¤¿¤À¤·¥ï¥¤¥Éʸ»úʸ»úÎó¤ÏºÇÂç \fIn\fP ¸Ä¤ËÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +.BR wcswidth () +¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iswprint (3), +.BR wcwidth (3) diff --git a/release/man3/wctob.3 b/release/man3/wctob.3 new file mode 100644 index 00000000..9f777fa6 --- /dev/null +++ b/release/man3/wctob.3 @@ -0,0 +1,56 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 19:35:47 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCTOB 3 2009-02-04 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wctob \- ¥ï¥¤¥Éʸ»ú¤Î¥·¥ó¥°¥ë¥Ð¥¤¥Èɽ¸½¤ò»î¤ß¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int wctob(wint_t " c ); +.fi +.SH ÀâÌÀ +.BR wctob () +´Ø¿ô¤Ï¡¢¥ï¥¤¥Éʸ»ú \fIc\fP ¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èɽ¸½(½é´ü¾õÂ֤dz« +»Ï)¤¬¥·¥ó¥°¥ë¥Ð¥¤¥Èʸ»ú¤À¤±¤Ç¤Ç¤­¤Æ¤¤¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£¤â¤·¤½¤¦¤Ç¤¢ +¤ì¤Ð¡¢¤³¤ì¤ò +.I "unsigned char" +·¿¤È¤·¤ÆÊÖ¤¹¡£ +.PP +¤³¤Î´Ø¿ô¤Ï·è¤·¤Æ»È¤ï¤Ê¤¤¤³¤È¡£¤³¤Î´Ø¿ô¤Ï¹ñºÝ²½¥×¥í¥°¥é¥à¤ò½ñ¤¯¾å¤Ç¤ÏÌò +¤ËΩ¤¿¤Ê¤¤¡£¹ñºÝ²½¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¥·¥ó¥°¥ë¥Ð¥¤¥Èʸ»ú¤È¥Þ¥ë¥Á¥Ð¥¤¥È +ʸ»ú¤ò¶èÊ̤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wctob () +´Ø¿ô¤Ï \fIc\fP ¤Î¥·¥ó¥°¥ë¥Ð¥¤¥Èɽ¸½¤¬Â¸ºß¤¹¤ì¤Ð¡¢¤½¤Îɽ¸½ +¤òÊÖ¤¹¡£Â¸ºß¤·¤Ê¤±¤ì¤Ð \fBEOF\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR wctob () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤Ï·è¤·¤Æ»È¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£¹ñºÝ²½¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¥·¥ó¥°¥ë¥Ð¥¤¥È +ʸ»ú¤È¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò¶èÊ̤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¤³¤Î´Ø¿ô¤Ç¤Ï¤Ê¤¯ +.BR wctomb (3) +´Ø¿ô¤ò»È¤¦¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR btowc (3), +.BR wctomb (3) diff --git a/release/man3/wctomb.3 b/release/man3/wctomb.3 new file mode 100644 index 00000000..5b2979e1 --- /dev/null +++ b/release/man3/wctomb.3 @@ -0,0 +1,70 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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" +.SH ̾Á° +wctomb \- ¥ï¥¤¥Éʸ»ú¤ò¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ËÊÑ´¹¤¹¤ë¡£ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int wctomb(char *" s ", wchar_t " wc ); +.fi +.SH ÀâÌÀ +.PP +\fIs\fP ¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢ +.BR wctomb () +´Ø¿ô¤Ï¥ï¥¤¥Éʸ»ú \fIwc\fP ¤ò +¥Þ¥ë¥Á¥Ð¥¤¥Èɽ¸½¤ËÊÑ´¹¤·¤Æ \fIs\fP ¤Î»Ø¤¹Ê¸»úÇÛÎó¤Ë³ÊǼ¤¹¤ë¡£ +Ʊ»þ¤Ë wctomb ´Ø¿ô¤Î¤ß¤¬»ÈÍѤ¹¤ëÀÅŪ¤Ç̾Á°¤Î¤Ê¤¤¥·¥Õ¥È¾õÂÖ¤ò¹¹¿·¤¹¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥Èɽ¸½¤ÎŤµ¡¢¤¹¤Ê¤ï¤Á \fIs\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿ +¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¥×¥í¥°¥é¥Þ¡¼¤Ï \fIs\fP ¤Ë¾¯¤Ê¤¯¤È¤â \fBMB_CUR_MAX\fP +¥Ð¥¤¥È¤Î¶õ¤­¤¬¤¢¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +\fIs\fP ¤¬ NULL ¤Ê¤é¤Ð¡¢ +.BR wctomb () +´Ø¿ô¤Ï¼«Ê¬¤Î¤ß¤¬»ÈÍѤ¹¤ë¥·¥Õ¥È¾õÂÖ¤ò +½é´ü¾õÂÖ¤ËÌᤷ¤Æ¡¢Ê¸»úÉä¹æ¤¬¥·¥Õ¥È¾õÂ֤˰͸¤·¤Æ¤¤¤ë¤Ê¤é¤Ð¥¼¥í°Ê³°¤ò +¥·¥Õ¥È¾õÂ֤˰͸¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +\fIs\fP ¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç +.BR wctomb () +´Ø¿ô¤Ï¥Ð¥¤¥ÈÇÛÎó \fIs\fP ¤Ë +½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£\fIwc\fP ¤¬(¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤¤¤Æ) +¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Çɽ¸½¤Ç¤­¤Ê¤¤¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤¹¡£ +.PP +\fIs\fP ¤¬ NULL ¤Î¾ì¹ç +.BR wctomb () +´Ø¿ô¤Ïʸ»úÉä¹æ¤¬¥·¥Õ¥È¾õÂÖ¤Ë +°Í¸¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¥¼¥í°Ê³°¡¢¥·¥Õ¥È¾õÂ֤˰͸¤·¤Ê¤¤¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR wctomb () +´Ø¿ô¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Ç¤Ï°ÂÁ´¤Ç¤Ï¤Ê¤¤¡£ +.BR wcrtomb (3) +´Ø¿ô¤Ï +Ʊ¤¸µ¡Ç½¤Î¤è¤êÎɤ¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR MB_CUR_MAX (3), +.BR wcrtomb (3), +.BR wcstombs (3) diff --git a/release/man3/wctrans.3 b/release/man3/wctrans.3 new file mode 100644 index 00000000..778b0931 --- /dev/null +++ b/release/man3/wctrans.3 @@ -0,0 +1,58 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 19:48:40 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCTRANS 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wctrans \- ¥ï¥¤¥Éʸ»úÊÑ´¹¥Þ¥Ã¥Ô¥ó¥° +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wctrans_t wctrans(const char *" name ); +.fi +.SH ÀâÌÀ +\fIwctrans_t\fP ·¿¤Ï¡¢¤¢¤ë¥ï¥¤¥Éʸ»ú¤ò¾¤Î¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤Ç¤­¤ë¥Þ¥Ã¥Ô +¥ó¥°¤òɽ¸½¤¹¤ë¡£ËܼÁŪ¤Ë¤Ï¼ÂÁõ°Í¸¤Ç¤¢¤ë¤¬¡¢Æüì¤ÊÃÍ +\fI(wctrans_t)0\fP ¤ÏÉÔÀµ¤Ê¥Þ¥Ã¥Ô¥ó¥°¤ò¼¨¤¹¡£0 ¤Ç¤Ê¤¤Ãͤò»ý¤Ä +\fIwctrans_t\fP ¤ò +.BR towctrans (3) +´Ø¿ô¤ËÅϤ¹¤³¤È¤Ë¤è¤Ã¤Æ¡¢¼ÂºÝ¤Ë +¥ï¥¤¥Éʸ»ú¤ÎÊÑ´¹¤ò¼Â¹Ô¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.BR wctrans () +¤Ï¡¢Ì¾Á°¤Ë¤è¤Ã¤ÆÍ¿¤¨¤é¤ì¤ë¥Þ¥Ã¥Ô¥ó¥°¤òÊÖ¤¹¡£Í­¸ú¤Ê̾Á°¤Î +½¸¹ç¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¤¬¡¢°Ê²¼¤Î̾Á°¤ÏÁ´¤Æ¤Î¥í¥±¡¼¥ë¤Ë¤ª¤¤¤ÆÍ­¸ú¤Ç¤¢¤ë¡£ +.nf + + "tolower" \- \fBtolower\fP(3) ¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¼Â¸½¤¹¤ë + "toupper" \- \fBtoupper\fP(3) ¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¼Â¸½¤¹¤ë +.fi +.SH ÊÖ¤êÃÍ +.BR wctrans () +´Ø¿ô¤Ï¡¢\fIname\fP ¤¬Í­¸ú¤Ê¤é¤Ð¥Þ¥Ã¥Ô¥ó¥°µ­½Ò»Ò¤òÊÖ¤¹¡£ +Í­¸ú¤Ç¤Ê¤±¤ì¤Ð \fI(wctrans_t) 0\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR wctrans () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR towctrans (3) diff --git a/release/man3/wctype.3 b/release/man3/wctype.3 new file mode 100644 index 00000000..ef6a006f --- /dev/null +++ b/release/man3/wctype.3 @@ -0,0 +1,70 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 20:01:16 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WCTYPE 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wctype \- ¥ï¥¤¥Éʸ»ú¤ÎʬÎà +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wctype_t wctype(const char *" name ); +.fi +.SH ÀâÌÀ +\fBwctype_t\fP ·¿¤Ï¡¢¥ï¥¤¥Éʸ»ú¤¬»ý¤Ã¤Æ¤¤¤ë¡¢¤¢¤ë¤¤¤Ï»ý¤Ã¤Æ¤¤¤Ê¤¤Â°À­ +¤òɽ¸½¤¹¤ë¡£¸À¤¤´¹¤¨¤ë¤È¡¢\fBwctype_t\fP ·¿¤Ï¥ï¥¤¥Éʸ»ú¤Î¥¯¥é¥¹¤ò +ɽ¸½¤¹¤ë¡£ +¤³¤Î·¿¤ÏËܼÁŪ¤Ë¼ÂÁõ°Í¸¤Ç¤¢¤ë¤¬¡¢Æüì¤ÊÃÍ \fI(wctype_t) 0\fP ¤ÏÉÔÀµ¤Ê +°À­¤ò¼¨¤¹¡£0 ¤Ç¤Ê¤¤Ãͤò»ý¤Ä \fBwctype_t\fP ¤ò +.BR iswctype (3) +´Ø¿ô¤ËÅÏ +¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¢Í¿¤¨¤é¤ì¤¿¥ï¥¤¥Éʸ»ú¤¬¤½¤Î°À­¤ò»ý¤Ä¤«¤É¤¦¤«¤ò¼ÂºÝ¤Ë¥Æ +¥¹¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +x.PP +.BR wctype () +´Ø¿ô¤Ï¡¢Ì¾Á°¤Ë¤è¤Ã¤ÆÍ¿¤¨¤é¤ì¤ë°À­¤òÊÖ¤¹¡£Í­¸ú¤Ê̾Á°¤Î½¸ +¹ç¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¤¬¡¢°Ê²¼¤Î̾Á°¤ÏÁ´¤Æ¤Î¥í¥±¡¼¥ë¤ÇÍ­¸ú¤Ç¤¢¤ë¡£ +.sp +.nf + "alnum" \- ¥¯¥é¥¹²½´Ø¿ô \fBisalnum\fP(3) ¤ò¼Â¸½¤¹¤ë + "alpha" \- ¥¯¥é¥¹²½´Ø¿ô \fBisalpha\fP(3) ¤ò¼Â¸½¤¹¤ë + "blank" \- ¥¯¥é¥¹²½´Ø¿ô \fBisblank\fP(3) ¤ò¼Â¸½¤¹¤ë + "cntrl" \- ¥¯¥é¥¹²½´Ø¿ô \fBiscntrl\fP(3) ¤ò¼Â¸½¤¹¤ë + "digit" \- ¥¯¥é¥¹²½´Ø¿ô \fBisdigit\fP(3) ¤ò¼Â¸½¤¹¤ë + "graph" \- ¥¯¥é¥¹²½´Ø¿ô \fBisgraph\fP(3) ¤ò¼Â¸½¤¹¤ë + "lower" \- ¥¯¥é¥¹²½´Ø¿ô \fBislower\fP(3) ¤ò¼Â¸½¤¹¤ë + "print" \- ¥¯¥é¥¹²½´Ø¿ô \fBisprint\fP(3) ¤ò¼Â¸½¤¹¤ë + "punct" \- ¥¯¥é¥¹²½´Ø¿ô \fBispunct\fP(3) ¤ò¼Â¸½¤¹¤ë + "space" \- ¥¯¥é¥¹²½´Ø¿ô \fBisspace\fP(3) ¤ò¼Â¸½¤¹¤ë + "upper" \- ¥¯¥é¥¹²½´Ø¿ô \fBisupper\fP(3) ¤ò¼Â¸½¤¹¤ë + "xdigit" \- ¥¯¥é¥¹²½´Ø¿ô \fBisxdigit\fP(3) ¤ò¼Â¸½¤¹¤ë +.fi +.SH ÊÖ¤êÃÍ +.BR wctype () +´Ø¿ô¤Ï¡¢\fIname\fP ¤¬Í­¸ú¤Ê¤é¤Ð°À­µ­½Ò»Ò¤òÊÖ¤¹¡£ +Í­¸ú¤Ç¤Ê¤±¤ì¤Ð \fI(wctype_t) 0\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR wctype () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iswctype (3) diff --git a/release/man3/wcwidth.3 b/release/man3/wcwidth.3 new file mode 100644 index 00000000..f0dc392a --- /dev/null +++ b/release/man3/wcwidth.3 @@ -0,0 +1,55 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Sat Oct 23 20:06:18 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" Updated Fri Aug 16 01:32:21 JST 2002 +.\" by Akihiro MOTOKI +.\" +.TH WCWIDTH 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wcwidth \- ¥ï¥¤¥Éʸ»ú¤¬É¬ÍפȤ¹¤ë¥«¥é¥à¿ô¤òÄ´¤Ù¤ë +.SH ½ñ¼° +.nf +.B #define _XOPEN_SOURCE +.B #include +.sp +.BI "int wcwidth(wchar_t " c ); +.fi +.SH ÀâÌÀ +.BR wcwidth () +´Ø¿ô¤Ï¡¢¥ï¥¤¥Éʸ»ú \fIc\fP ¤òɽ¸½¤¹¤ë¤¿¤á¤ËɬÍפʥ«¥é¥à +¿ô¤òÊÖ¤¹¡£\fIc\fP ¤¬°õºþ²Äǽʸ»ú¤Ê¤é¤Ð¡¢¤³¤ÎÃÍ¤Ï 0 °Ê¾å¤Ç¤¢¤ë¡£ +\fIc\fP ¤¬ L\(aq\\0\(aq ¤Ê¤é¤Ð¡¢ÃÍ¤Ï 0 ¤Ç¤¢¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR wcwidth () +´Ø¿ô¤Ï¡¢\fIc\fP ¤Îɽ¸½¤ËɬÍפʥ«¥é¥à¿ô¤òÊÖ¤¹¡£ +.SH ½àµò +POSIX.1-2001. + +glibc 2.2.5 °ÊÁ°¤Ç¤Ï°Ê²¼¤Î¥×¥í¥È¥¿¥¤¥×Àë¸À¤¬»ÈÍѤµ¤ì¤Æ¤¤¤¿¤³¤È¤Ë +Ãí°Õ¤¹¤ë¤³¤È¡£ +.br +.nf +.BI "int wcwidth(wint_t " c ); +.fi +.SH Ãí°Õ +.BR wcwidth () +¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR iswprint (3), +.BR wcswidth (3), +.BR feature_test_macros (7) diff --git a/release/man3/wmemchr.3 b/release/man3/wmemchr.3 new file mode 100644 index 00000000..5c5e2664 --- /dev/null +++ b/release/man3/wmemchr.3 @@ -0,0 +1,43 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 26 00:03:46 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WMEMCHR 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wmemchr \- ¥ï¥¤¥Éʸ»ú¤ÎÇÛÎ󤫤é¥ï¥¤¥Éʸ»ú¤òõ¤¹ +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wmemchr(const wchar_t *" s ", wchar_t " c ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR wmemchr () +´Ø¿ô¤Ï¡¢ +.BR memchr (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIs\fP ¤òÀèƬ¤È¤¹¤ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ÎÃ椫¤é¡¢ºÇ½é +¤Ë¥ï¥¤¥Éʸ»ú \fIc\fP ¤¬¸½¤ï¤ì¤ë¾ì½ê¤òõ¤¹¡£ +.SH ÊÖ¤êÃÍ +.BR wmemchr () +´Ø¿ô¤Ï¡¢\fIs\fP ¤òÀèƬ¤È¤¹¤ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ÎÃæ +¤Ë¤ª¤¤¤ÆºÇ½é¤Ë \fIc\fP ¤¬¸½¤ï¤ì¤ë¾ì½ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£\fIc\fP ¤¬¸½ +¤ï¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï NULL ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR memchr (3), +.BR wcschr (3) diff --git a/release/man3/wmemcmp.3 b/release/man3/wmemcmp.3 new file mode 100644 index 00000000..8b85c5e0 --- /dev/null +++ b/release/man3/wmemcmp.3 @@ -0,0 +1,47 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 26 00:39:25 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WMEMCMP 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wmemcmp \- ¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó 2 ¤Ä¤òÈæ³Ó¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "int wmemcmp(const wchar_t *" s1 ", const wchar_t *" s2 ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR wmemcmp () +´Ø¿ô¤Ï¡¢ +.BR memcmp (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIs1\fP ¤òÀèƬ¤È¤¹¤ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤È \fIs2\fP ¤ò +ÀèƬ¤È¤¹¤ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤òÈæ³Ó¤¹¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR wmemcmp () +´Ø¿ô¤Ï¡¢\fIs1\fP ¤È \fIs2\fP ¤òÀèƬ¤È¤¹¤ëÂ礭¤µ¤¬ +\fIn\fP ¤Î 2 ¤Ä¤ÎÇÛÎó¤¬Åù¤·¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ +ºÇ½é¤Ë°Û¤Ê¤ëʸ»ú¤¬¸½¤ï¤ì¤¿°ÌÃÖ \fIi\fP (\fIi\fP < \fIn\fP)¤Ë¤ª¤¤¤Æ¡¢¤½ +¤Î°ÌÃ֤ˤ¢¤ë¥ï¥¤¥Éʸ»ú \fIs1[i]\fP ¤¬ \fIs2[i]\fP ¤è¤êÂ礭¤±¤ì¤ÐÀµ¤ÎÀ° +¿ô¤òÊÖ¤¹¡£ +ºÇ½é¤Ë°Û¤Ê¤ëʸ»ú¤¬¸½¤ï¤ì¤¿°ÌÃÖ \fIi\fP (\fIi\fP < \fIn\fP)¤Ë¤ª¤¤¤Æ¡¢¤½ +¤Î°ÌÃ֤ˤ¢¤ë¥ï¥¤¥Éʸ»ú \fIs1[i]\fP ¤¬ \fIs2[i]\fP ¤è¤ê¾®¤µ¤±¤ì¤ÐÉé¤ÎÀ° +¿ô¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR memcmp (3), +.BR wcscmp (3) diff --git a/release/man3/wmemcpy.3 b/release/man3/wmemcpy.3 new file mode 100644 index 00000000..bea5f67f --- /dev/null +++ b/release/man3/wmemcpy.3 @@ -0,0 +1,50 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 26 00:43:58 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WMEMCPY 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wmemcpy \- ¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤ò¥³¥Ô¡¼¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wmemcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR wmemcpy () +´Ø¿ô¤Ï¡¢ +.BR memcpy (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fIsrc\fP ¤òÀèƬ¤È¤¹¤ëÇÛÎ󤫤é \fIdest\fP ¤òÀèƬ¤È¤¹¤ëÇÛÎó +¤Ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ò¥³¥Ô¡¼¤¹¤ë¡£ +.PP +2 ¤Ä¤ÎÇÛÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ÇÛÎ󤬽ŤʤäƤ¤¤ë¾ì¹ç¤Ë¤Ï +.BR wmemmove (3) +¤ò»È¤Ã¤Æ¥³¥Ô¡¼¤¹¤ë¤³¤È¡£ +.PP +¥×¥í¥°¥é¥Þ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤¬Æþ¤ëÎΰè¤ò \fIdest\fP +¤Ë³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wmemcpy () +¤Ï \fIdest\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR memcpy (3), +.BR wcscpy (3), +.BR wmemmove (3), +.BR wmempcpy (3) diff --git a/release/man3/wmemmove.3 b/release/man3/wmemmove.3 new file mode 100644 index 00000000..f6b4f2f0 --- /dev/null +++ b/release/man3/wmemmove.3 @@ -0,0 +1,45 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 26 00:51:13 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WMEMMOVE 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wmemmove \-¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤ò¥³¥Ô¡¼¤¹¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wmemmove(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR wmemmove () +´Ø¿ô¤Ï¡¢ +.BR memmove (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢ +¤ë¡£¤³¤Î´Ø¿ô¤Ï \fIsrc\fP ¤òÀèƬ¤È¤¹¤ëÇÛÎ󤫤é \fIdest\fP ¤òÀèƬ¤È¤¹¤ë +ÇÛÎó¤Ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ò¥³¥Ô¡¼¤¹¤ë¡£2 ¤Ä¤ÎÇÛÎó¤Ï½Å¤Ê¤Ã¤Æ¤¤¤Æ¤â +¹½¤ï¤Ê¤¤¡£ +.PP +¥×¥í¥°¥é¥Þ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤¬Æþ¤ëÎΰè¤ò \fIdest\fP +¤Ë³ÎÊݤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +.BR wmemmove () +¤Ï \fIdest\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR memmove (3), +.BR wmemcpy (3) diff --git a/release/man3/wmemset.3 b/release/man3/wmemset.3 new file mode 100644 index 00000000..2793228e --- /dev/null +++ b/release/man3/wmemset.3 @@ -0,0 +1,40 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" ISO/IEC 9899:1999 +.\" +.\" About this Japanese page, please contact to JM Project +.\" Translated Tue Oct 26 00:51:32 JST 1999 +.\" by FUJIWARA Teruyoshi +.\" +.TH WMEMSET 3 1999-07-25 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wmemset \- ¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤òÄê¿ô¤Î¥ï¥¤¥Éʸ»ú¤ÇËä¤á¤ë +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "wchar_t *wmemset(wchar_t *" wcs ", wchar_t " wc ", size_t " n ); +.fi +.SH ÀâÌÀ +.BR wmemset () +´Ø¿ô¤Ï¡¢ +.BR memset (3) +´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£ +¤³¤Î´Ø¿ô¤Ï¡¢\fBmemset\fP ¤òÀèƬ¤È¤¹¤ë \fIn\fP ¸Ä¤Î¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤ò¡¢ +¥ï¥¤¥Éʸ»ú \fIwc\fP ¤Î \fIn\fP ¸Ä¤Î¥³¥Ô¡¼¤ÇËä¤á¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR wmemset () +¤Ï \fIwcs\fP ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH ´ØÏ¢¹àÌÜ +.BR memset (3) diff --git a/release/man3/wordexp.3 b/release/man3/wordexp.3 new file mode 100644 index 00000000..935cce74 --- /dev/null +++ b/release/man3/wordexp.3 @@ -0,0 +1,218 @@ +.\" 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 Sep 12 05:05:19 JST 2004 +.\" by Yuichi SATO +.\" +.TH WORDEXP 3 2008-07-14 "" "Linux Programmer's Manual" +.SH ̾Á° +wordexp, wordfree \- posix ¥·¥§¥ë¤Î¤è¤¦¤Ëñ¸ì¤ÎŸ³«¤ò¹Ô¤¦ +.SH ½ñ¼° +.B "#include " +.sp +.BI "int wordexp(const char *" s ", wordexp_t *" p ", int " flags ); +.sp +.BI "void wordfree(wordexp_t *" p ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR wordexp (), +.BR wordfree (): +_XOPEN_SOURCE +.SH ÀâÌÀ +´Ø¿ô +.BR wordexp () +¤Ï¥·¥§¥ë¤Î¤è¤¦¤Ëʸ»úÎó +.I s +¤òŸ³«¤·¡¢ +.I p +¤Ç»Ø¤·¼¨¤¹¹½Â¤ÂΤ˷ë²Ì¤òÊÖ¤¹¡£ +¥Ç¡¼¥¿·¿ +.I wordexp_t +¤Ï¾¯¤Ê¤¯¤È¤â¥Õ¥£¡¼¥ë¥É +.IR we_wordc , +.IR we_wordv , +.I we_offs +¤ò»ý¤Ä¹½Â¤ÂΤǤ¢¤ë¡£ +¥Õ¥£¡¼¥ë¥É +.I we_wordc +¤Ï +.I size_t +¤Ç¤¢¤ê¡¢ +.I s +¤òŸ³«¤·¤¿·ë²Ì¤Ëñ¸ì¤¬¤¤¤¯¤Ä¤¢¤ë¤«¤òɽ¤¹¡£ +¥Õ¥£¡¼¥ë¥É +.I we_wordv +¤Ï +.I char ** +¤Ç¤¢¤ê¡¢¸«¤Ä¤«¤Ã¤¿Ã±¸ì¤ÎÇÛÎó¤ò»Ø¤·¼¨¤¹¡£ +.I size_t +·¿¤Î¥Õ¥£¡¼¥ë¥É +.I we_offs +¤Ï¡¢ +.I we_wordv +ÇÛÎó¤Ë¤¢¤ë½é´üÍ×ÁǤΤ¦¤Á¤¤¤¯¤Ä¤¬ +NULL ¤ÇËä¤á¤é¤ì¤ë¤Ù¤­¤«¤òɽ¤¹¤Î¤Ë»È¤ï¤ì¤¿¤ê¤¹¤ë +.RI ( flags +¤Ë¤è¤ê·èÄꤵ¤ì¤ë¡£²¼µ­¤ò»²¾È¡£)¡£ +.LP +´Ø¿ô +.BR wordfree () +¤Ï³ä¤êÅö¤Æ¤¿¥á¥â¥ê¤òºÆÅÙ²òÊü¤¹¤ë¡£ +¤è¤êÀµ³Î¤Ë¤¤¤¦¤È¡¢¤³¤Î´Ø¿ô¤Ï¤½¤Î°ú¤­¿ô¤ò²òÊü¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +ÇÛÎó +.I we_wordv +¤È¤½¤ì¤¬»Ø¤·¼¨¤¹Ê¸»úÎó¤ò²òÊü¤¹¤ë¡£ +.SS "ʸ»úÎó°ú¤­¿ô" +¤³¤ÎŸ³«¤Ï¥·¥§¥ë¤Ë¤è¤ë¥³¥Þ¥ó¥É¤Î¥Ñ¥é¥á¡¼¥¿¤ÎŸ³« +.RB ( sh (1) +¤ò»²¾È) ¤ÈƱ¤¸¤Ç¤¢¤ë¤Î¤Ç¡¢Ê¸»úÎó +.I s +¤Ï¥·¥§¥ë¥³¥Þ¥ó¥É¥Ñ¥é¥á¡¼¥¿¤ÇÉÔÀµ¤È¤µ¤ì¤ëʸ»ú¤ò´Þ¤ó¤Ç¤Ï¤Ê¤é¤Ê¤¤¡£ +Æä˥¨¥¹¥±¡¼¥×¤µ¤ì¤Æ¤¤¤Ê¤¤²þ¹Ô¡¢|, &, ;, <, >, (, ), {, } ʸ»ú¤ò +¥³¥Þ¥ó¥ÉÃÖ´¹¤ä¥Ñ¥é¥á¡¼¥¿ÃÖ´¹¤Î¾ìḬ̀ʳ°¤Ë´Þ¤á¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.LP +°ú¤­¿ô +.I s +¤Ë¥¯¥©¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥³¥á¥ó¥Èʸ»ú # ¤Ç»Ï¤Þ¤ëñ¸ì¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤½¤Îñ¸ì¤È¤½¤ì°Ê¹ß¤Îñ¸ì¤¬Ìµ»ë¤µ¤ì¤ë¤«¡¢ +¤½¤ì¤È¤â # ¤¬¥³¥á¥ó¥Èʸ»ú¤È¤·¤Æ°·¤ï¤Ê¤¤¤«¤Ï¡¢µ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SS "Ÿ³«" +¼Â¹Ô¤µ¤ì¤ëŸ³«¤Ï¡¢°Ê²¼¤ÎÃʳ¬¤Ç¹½À®¤µ¤ì¤ë: +¥Á¥ë¥ÀŸ³« (~user ¤ò user ¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤­´¹¤¨¤ë)¡¢ +ÊÑ¿ôŸ³« ($FOO ¤ò´Ä¶­ÊÑ¿ô FOO ¤ÎÃͤËÃÖ¤­´¹¤¨¤ë)¡¢ +¥³¥Þ¥ó¥ÉŸ³« ($(command) ¤Þ¤¿¤Ï \`command\` ¤ò command ¤Î½ÐÎϤÇÃÖ¤­´¹¤¨¤ë)¡¢ +»»½ÑŸ³«¡¢¥Õ¥£¡¼¥ë¥Éʬ³ä¡¢¥ï¥¤¥ë¥É¥«¡¼¥ÉŸ³«¡¢¥¯¥©¡¼¥È¤Î½üµî¡£ +.LP +Æüì¤Ê¥Ñ¥é¥á¡¼¥¿ ($@, $*, $#, $?, $\-, $$, $!, $0) ¤Î +Ÿ³«·ë²Ì¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.LP +¥Õ¥£¡¼¥ë¥Éʬ³ä¤Ï´Ä¶­ÊÑ¿ô $IFS ¤òÍѤ¤¤Æ¹Ô¤ï¤ì¤ë¡£ +¤³¤Î´Ä¶­ÊÑ¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¥Õ¥£¡¼¥ë¥É¶èÀÚ¤êʸ»ú¤Ï¥¹¥Ú¡¼¥¹¡¦¥¿¥Ö¡¦²þ¹Ô¤Ç¤¢¤ë¡£ +.SS "½ÐÎϤµ¤ì¤ëÇÛÎó" +ÇÛÎó +.I we_wordv +¤Ï¸«¤Ä¤«¤Ã¤¿Ã±¸ì¤ò¤ò´Þ¤ß¡¢ºÇ¸å¤Ë NULL ¤¬Â³¤¯¡£ +.SS "flags °ú¤­¿ô" +.I flags +°ú¤­¿ô¤Ï°Ê²¼¤ÎÃͤΥӥåÈÊñ´ÞŪ OR ¤Ç¤¢¤ë: +.TP +.B WRDE_APPEND +¸«¤Ä¤«¤Ã¤¿Ã±¸ì¤òÁ°²ó¤Î¸Æ¤Ó½Ð¤··ë²Ì¤ÎÇÛÎó¤ËÄɲ乤롣 +.TP +.B WRDE_DOOFFS +½é´ü¾õÂ֤Ǥ¢¤ë +.I we_offs +¸Ä¤Î NULL ¤òÇÛÎó +.I we_wordv +¤ËÁÞÆþ¤¹¤ë (¤³¤ì¤é¤ÏÊÖ¤µ¤ì¤ë +.I we_wordc +¤Ë¤Ï¥«¥¦¥ó¥È¤µ¤ì¤Ê¤¤)¡£ +.TP +.B WRDE_NOCMD +¥³¥Þ¥ó¥ÉÃÖ´¹¤ò¹Ô¤ï¤Ê¤¤¡£ +.TP +.B WRDE_REUSE +°ú¤­¿ô +.I p +¤ÏÁ°²ó¤Î +.BR wordexp () +¤Î¸Æ¤Ó½Ð¤··ë²Ì¤Ç¤¢¤ê¡¢ +.BR wordfree () +¤¬ (¤Þ¤À) ¸Æ¤Ó½Ð¤µ¤ì¤Ê¤¤¡£ +³ä¤êÅö¤Æ¤é¤ì¤¿Îΰè¤òºÆÍøÍѤ¹¤ë¡£ +.TP +.B WRDE_SHOWERR +Ä̾ï¤Ï¥³¥Þ¥ó¥ÉÃÖ´¹¤Î¤È¤­¤Ë +.I stderr +¤¬ +.I /dev/null +¤Ë¥ê¥À¥¤¥ì¥¯¥È¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï +.I stderr +¤ò¥ê¥À¥¤¥ì¥¯¥È¤·¤Ê¤¤¤è¤¦¤Ë»ØÄꤹ¤ë¡£ +.TP +.B WRDE_UNDEF +̤ÄêµÁ¤Î¥·¥§¥ëÊÑ¿ô¤òŸ³«¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¡¢¥¨¥é¡¼¤È¤·¤Æ°·¤¦¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï°Ê²¼¤Î 5 ¤Ä¤ÎÃͤΤ¦¤Á¤Î 1 ¤Ä¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.B WRDE_BADCHAR +²þ¹Ô¤Þ¤¿¤Ï |, &, ;, <, >, (, ), {, } ¤Î¤¦¤Á¤Î 1 ¤Ä¤¬ÉÔÀµ¤Ë½Ð¸½¤·¤¿¡£ +.TP +.B WRDE_BADVAL +̤ÄêµÁ¤Î¥·¥§¥ëÊÑ¿ô¤¬»²¾È¤µ¤ì¡¢¤«¤Ä +.B WRDE_UNDEF +¥Õ¥é¥°¤Ç¤³¤ì¤ò¥¨¥é¡¼¤È¤·¤Æ°·¤¦¤è¤¦¤Ë»Ø¼¨¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B WRDE_CMDSUB +¥³¥Þ¥ó¥ÉÃÖ´¹¤¬µ¯¤³¤ê¡¢¤«¤Ä +.B WRDE_NOCMD +¥Õ¥é¥°¤Ç¤³¤ì¤ò¥¨¥é¡¼¤È¤·¤Æ°·¤¦¤è¤¦¤Ë»Ø¼¨¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B WRDE_NOSPACE +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B WRDE_SYNTAX +Âбþ¤¹¤ë³ç¸Ì¤¬¤Ê¤¤¡¢¥¯¥©¡¼¥È¤¬¹çÃפ·¤Ê¤¤¤È¤¤¤Ã¤¿¡¢ +¥·¥§¥ë¤Î½ñ¼°¥¨¥é¡¼¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.BR wordexp () +¤È +.BR wordfree () +¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Îã +°Ê²¼¤Î¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Î½ÐÎϤϤÀ¤¤¤¿¤¤ "ls [a-c]*.c" ¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ +.LP +.nf +#include +#include +#include + +int +main(int argc, char **argv) +{ + wordexp_t p; + char **w; + int i; + + wordexp("[a-c]*.c", &p, 0); + w = p.we_wordv; + for (i = 0; i < p.we_wordc; i++) + printf("%s\en", w[i]); + wordfree(&p); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR fnmatch (3), +.BR glob (3) diff --git a/release/man3/wprintf.3 b/release/man3/wprintf.3 new file mode 100644 index 00000000..fa10e57c --- /dev/null +++ b/release/man3/wprintf.3 @@ -0,0 +1,208 @@ +.\" Copyright (c) Bruno Haible +.\" +.\" 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. +.\" +.\" References consulted: +.\" GNU glibc-2 source code and manual +.\" Dinkumware C library reference http://www.dinkumware.com/ +.\" 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:36 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH WPRINTF 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf \- ¥ï¥¤¥Éʸ»ú¤ò +¥Õ¥©¡¼¥Þ¥Ã¥È¤·¤Æ½ÐÎϤ¹¤ë +.SH ½ñ¼° +.nf +.B #include +.B #include +.sp +.BI "int wprintf(const wchar_t *" format ", ...);" +.BI "int fwprintf(FILE *" stream ", const wchar_t *" format ", ...);" +.BI "int swprintf(wchar_t *" wcs ", size_t " maxlen , +.BI " const wchar_t *" format ", ...);" +.sp +.BI "int vwprintf(const wchar_t *" format ", va_list " args ); +.BI "int vfwprintf(FILE *" stream ", const wchar_t *" format ", va_list " args ); +.BI "int vswprintf(wchar_t *" wcs ", size_t " maxlen , +.BI " const wchar_t *" format ", va_list " args ); +.fi +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô: +.\" .BR wprintf (), +.\" .BR fwprintf (), +.\" .BR swprintf (), +.\" .BR vwprintf (), +.\" .BR vfwprintf (), +.\" .BR vswprintf (): +_XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or +.I cc\ -std=c99 +.ad b +.SH ÀâÌÀ +.BR wprintf () +¥Õ¥¡¥ß¥ê¡¼¤Î´Ø¿ô¤Ï +.BR printf (3) +¥Õ¥¡¥ß¥ê¡¼¤Î´Ø¿ô¤Î +¥ï¥¤¥Éʸ»úÈǤǤ¢¤ë¡£¤³¤ì¤é¤Ï¥ï¥¤¥Éʸ»ú¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤·¤Æ½ÐÎϤ¹¤ë¡£ +.PP +.BR wprintf () +¤È +.BR vwprintf () +´Ø¿ô¤Ï \fIstdout\fP ¤Ë½ÐÎϤò¹Ô¤Ê¤¦¡£ +\fIstdout\fP ¤¬¥Ð¥¤¥Èñ°ÌÆþ½ÐÎϤǤ¢¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¡£¤è¤ê¾Ü¤·¤¤ÀâÌÀ¤Ï +.BR fwide (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +.BR fwprintf () +¤È +.BR vfwprintf () +´Ø¿ô¤Ï \fIstream\fP ¤Ë¥ï¥¤¥Éʸ»ú½ÐÎÏ +¤ò¹Ô¤Ê¤¦¡£ \fIstream\fP ¤¬¥Ð¥¤¥Èñ°ÌÆþ½ÐÎϤǤ¢¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +¤è¤ê¾Ü¤·¤¤ÀâÌÀ¤Ï +.BR fwide (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.PP +.BR swprintf () +¤È +.BR vswprintf () +´Ø¿ô¤Ï¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤Ë +¥ï¥¤¥Éʸ»ú½ÐÎϤò¹Ô¤Ê¤¦¡£¥×¥í¥°¥é¥Þ¡¼¤Ï \fIwcs\fP ¤ËºÇÄã¤Ç¤â +\fImaxlen\fP ʸ»ú¤Î¥ï¥¤¥Éʸ»ú¤ò½ÐÎϤǤ­¤ë¶õ¤­¤¬¤¢¤ë¤³¤È¤òÊݾڤ·¤Ê¤±¤ì¤Ð +¤Ê¤é¤Ê¤¤¡£ +.PP +¤³¤ì¤é¤Î´Ø¿ô¤Ï +.BR printf (3), +.BR vprintf (3), +.BR fprintf (3), +.BR vfprintf (3), +.BR sprintf (3), +.BR vsprintf (3) +´Ø¿ô¤Ë»÷¤Æ¤¤¤ë¤¬°Ê²¼¤Î +ÅÀ¤Ç°Û¤Ã¤Æ¤¤¤ë¡£ +.TP +.B \(bu +\fIformat\fP ¤¬¥ï¥¤¥Éʸ»úÎó¤ÇÍ¿¤¨¤é¤ì¤ë¡£ +.TP +.B \(bu +½ÐÎϤ¬¥Ð¥¤¥È¤Ç¤Ï¤Ê¤¯¥ï¥¤¥Éʸ»ú¤Ç¹½À®¤µ¤ì¤ë¡£ +.TP +.B \(bu +.BR swprintf () +¤È +.BR vswprintf () +¤Ï \fImaxlen\fP °ú¤­¿ô¤ò¼è¤ë¤¬¡¢ +.BR sprintf () +¤È +.BR vsprintf () +¤Ï¼è¤é¤Ê¤¤ +.RB ( snprintf () +¤È +.BR vsnprintf () +¤Ï \fImaxlen\fP °ú¤­¿ô¤ò¼è¤ë¤¬ +¤³¤ì¤é¤Î´Ø¿ô¤¬ Linux ¤Ç¤Ï¡¢¥Ð¥Ã¥Õ¥¡¡¼¤¬°î¤ì¤¿¾ì¹ç¤Ç¤â \-1 ¤òÊÖ¤µ¤Ê¤¤)¡£ +.PP +\fBc\fP ¤È \fBs\fP ÊÑ´¹Ê¸»ú¤Î°·¤¤¤¬°Û¤Ã¤Æ¤¤¤ë: +.TP +.B c +¤â¤· +.B l +½¤¾þ»Ò¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï +.I int +°ú¤­¿ô¤Ï +.BR btowc (3) +´Ø¿ô¤Ë¤è¤Ã¤Æ¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤µ¤ì¤ë¡£¤½¤·¤Æ·ë²Ì¤Î¥ï¥¤¥Éʸ»ú¤¬½ÐÎϤµ¤ì¤ë¡£ +.B l +½¤¾þ»Ò¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ï +.I wint_t +(¥ï¥¤¥Éʸ»ú)°ú¤­¿ô¤¬½ÐÎϤµ¤ì¤ë¡£ +.TP +.B s +¤â¤· +.B l +½¤¾þ»Ò¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +.I "const\ char\ *" +°ú¤­¿ô¤Ï½é´ü¾õÂÖ¤è¤ê»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò´Þ¤ó¤À +char ·¿¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼(ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼)¤È¤ß¤Ê¤µ¤ì¤ë¡£ +ÇÛÎó¤Îʸ»ú¤Ï(ºÇ½é¤Î¥Ð¥¤¥ÈÁ°¤Ë½é´ü¾õÂÖ¤ÇÊÑ´¹¤ò³«»Ï¤·¡¢¤½¤ì¤¾¤ì¤Îʸ»ú¤ò +.BR mbrtowc (3) +´Ø¿ô¤Ë¤è¤Ã¤Æ)¥ï¥¤¥Éʸ»ú¤Ø¤ÈÊÑ´¹¤µ¤ì¤ë¡£·ë²Ì¤Î¥ï¥¤¥Éʸ»ú¤Ï½ªÃ¼¤Î +¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Î¼êÁ°¤Þ¤Ç¤¬½ñ¤­¹þ¤Þ¤ì¤ë¡£ÀºÅÙ(precision)¤¬»ØÄꤵ¤ì¤¿ +¾ì¹ç¡¢»ØÄꤵ¤ì¤¿¿ô»ú¤òĶ¤¨¤ë¥ï¥¤¥Éʸ»ú¤Ï½ñ¤­¹þ¤Þ¤ì¤Ê¤¤¡£ÀºÅÙ¤Ï +½ñ¤­¹þ¤Þ¤ì¤ë +.I ¥Ð¥¤¥È +¿ô¤ä +.I ²èÌ̾å¤Î°ÌÃÖ +¤Ç¤Ï¤Ê¤¯ +.I ¥ï¥¤¥Éʸ»ú +¤Î¿ô¤ò»ØÄꤹ¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +ÀºÅÙ¤¬¤Ê¤¤¾ì¹ç¤Ë¤ÏÇÛÎó¤Î½ªÃ¼¤Ë¥Ê¥ëʸ»ú¤ò´Þ¤àɬÍפ¬¤¢¤ë¡£ +ÀºÅÙ¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ÇÛÎó¤ÎºÇ¸å¤ËÅþÃ夹¤ëÁ°¤ËÊÑ´¹¤µ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Î +¿ô¤¬¤½¤ì¤ËÅþ㤹¤ë¤è¤¦¡¢ÀºÅ٤Ͻ½Ê¬¤Ë¾®¤µ¤Ê¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤â¤· +.B l +½¤¾þ»Ò¤¬Â¸ºß¤¹¤ë¾ì¹ç¡¢ +.I "const\ wchar_t\ *" +°ú¤­¿ô¤Ï¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤È¤ß¤Ê¤µ¤ì¤ë¡£ +ÇÛÎó¤Î¥ï¥¤¥Éʸ»úÎó¤Ï½ªÃ¼¤Î¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Î¼ê´Ö¤Þ¤Ç½ÐÎϤµ¤ì¤ë¡£ +¤â¤·ÀºÅÙ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï»ØÄꤵ¤ì¤¿ÀºÅٰʾå¤Îʸ»ú¤Ï½ÐÎϤµ¤ì¤Ê¤¤¡£ +ÀºÅÙ¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ë¤Ï½ªÃ¼¤Î¥Ê¥ë¥ï¥¤¥Éʸ»ú¤ò´Þ¤àɬÍפ¬¤¢¤ë¡£ +ÀºÅÙ¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¤½¤ì¤Ï¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤ÎÂ礭¤µ¤è¤ê¤â¾®¤µ¤¯¤Ê +¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ÊÖ¤êÃÍ +¤³¤ì¤é¤Î´Ø¿ô¤Ï½ñ¤­¹þ¤Þ¤ì¤¿¥ï¥¤¥Éʸ»ú¤Îʸ»ú¿ô¤òÊÖ¤¹¡£ +.BR swprintf () +¤È +.BR vswprintf () +´Ø¿ô¤Î¾ì¹ç¤Ï +½ªÃ¼¤Î¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ï´Þ¤Þ¤Ê¤¤¡£¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +.SH ½àµò +C99. +.SH Ãí°Õ +.BR wprintf () +Åù¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£ +.PP +\fIformat\fP ʸ»úÎó¤¬ ASCII °Ê³°¤Î¥ï¥¤¥Éʸ»ú¤ò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¡¢ +¼Â¹Ô»þ¤Î¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤¬¥³¥ó¥Ñ¥¤¥ë»þ¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤È +°ìÃפ·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ß¥×¥í¥°¥é¥à¤ÏÀµ¾ï¤ËÆ°ºî¤¹¤ë¡£¤³¤ì¤Ï +.I wchar_t +¤Îɽ¸½¤¬¥í¥±¡¼¥ë¤ä¥×¥é¥Ã¥È¥Û¡¼¥à¤Ë°Í¸¤·¤Æ¤¤¤ë¤³¤È¤Ë¸¶°ø¤¬¤¢¤ë¡£ +(glibc ¤Ç¤Ï¥ï¥¤¥Éʸ»ú¤È¤·¤Æ Unicode (ISO-10646) ¤Î¥³¡¼¥É¥Ý¥¤¥ó¥È¤ò +»ÈÍѤ·¤Æ¤¤¤ë¡£Â¾¤Î¥×¥é¥Ã¥È¥Û¡¼¥à¤Ç¤Ï¤½¤¦¤Ç¤Ï¤Ê¤¤¡£Æ±ÍÍ¤Ë +ISO C99 ¤Î \\unnnn ·Á¼°¤ÎÈÆÍÑʸ»ú̾¾Î¤Ï¤³¤ÎÌäÂê¤ò²ò·è¤·¤Ê¤¤¡£) +¤³¤Î¤¿¤á¹ñºÝ²½¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ç¤Ï \fIformat\fP ʸ»úÎó¤ò ASCII ¥ï¥¤¥É +ʸ»ú¤Î¤ß¤Ë¤¹¤ë¤«¡¢¼Â¹Ô»þ¤Ë¹ñºÝ²½¤µ¤ì¤¿ÊýË¡¤Ç¹½À®¤¹¤ëɬÍפ¬¤¢¤ë +(Î㤨¤Ð +.BR gettext () +¤È +.BR iconv () +¤ä +.BR mbstowcs () +¤òÁȤ߹ç¤ï¤Æ»ÈÍѤ¹¤ë)¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fprintf (3), +.BR fputwc (3), +.BR fwide (3), +.BR printf (3), +.BR snprintf (3) +.\" .BR wscanf (3) diff --git a/release/man3/xcrypt.3 b/release/man3/xcrypt.3 new file mode 100644 index 00000000..50213170 --- /dev/null +++ b/release/man3/xcrypt.3 @@ -0,0 +1,75 @@ +.\" Copyright 2003 walter harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" this is the 3rd type of interface for cryptographic routines +.\" 1. encrypt() expects a bit field +.\" 2. cbc_crypt() byte values +.\" 3. xencrypt() a hexstring +.\" to bad to be true :( +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Wed Sep 15 01:02:11 JST 2004 +.\" by Yuichi SATO +.\" +.TH XCRYPT 3 2003-04-04 "" "Linux Programmer's Manual" +.SH ̾Á° +xencrypt, xdecrypt, passwd2des \- RFS ¥Ñ¥¹¥ï¡¼¥É°Å¹æ²½ +.SH ½ñ¼° +.B "#include " +.sp +.BI "void passwd2des(char " *passwd ", char *" key ");" +.sp +.BI "int xencrypt(char *" secret ", char *" passwd ");" +.sp +.BI "int xdecrypt(char *" secret ", char *" passwd ");" +.SH ÀâÌÀ +´Ø¿ô +.BR passwd2des () +¤ÏǤ°Õ¤ÎŤµ¤Îʸ»úÎó +.I passwd +¤ò¤È¤ê¡¢Ä¹¤µ 8 ¤Îʸ»úÇÛÎó +.I key +¤òËä¤á¤ë¡£ +ÇÛÎó +.I key +¤Ï DES ¥­¡¼¤È¤·¤Æ»È¤¦¤Î¤ËŬ¤·¤Æ¤¤¤ë¡£ +¤³¤ÎÇÛÎó¤Î³Æ¥Ð¥¤¥È¤Î¥Ó¥Ã¥È 0 ¤Ï´ñ¿ô¥Ñ¥ê¥Æ¥£¤Ç¤¢¤ë¡£ +¤³¤³¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë»Ä¤ê¤Î 2 ¤Ä¤Î´Ø¿ô¤Ï¡¢ +¤³¤Î´Ø¿ô¤ò»È¤¤¡¢°ú¤­¿ô +.I passwd +¤ò DES ¥­¡¼¤ËÊÑ´¹¤¹¤ë¡£ +.LP +.BR xencrypt () +´Ø¿ô¤Ï +.\" (¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È 0123456789abcdefABCDEF ¤Çɽ¤µ¤ì¤ë) +16 ¿Ê¿ô¤ÇÍ¿¤¨¤é¤ì¤¿ ASCII ʸ»úÎó +.I secret +¤ò¤È¤ë¡£ +¤³¤ÎŤµ¤Ï 16 ¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤½¤·¤Æ +.BR passwd2des () +¤Ë¤è¤Ã¤Æ +.I passwd +¤«¤éƳ¤­½Ð¤µ¤ì¤¿ DES ¥­¡¼¤ò»È¤¤¡¢ +.I secret +¤ò°Å¹æ²½¤¹¤ë¡£ +¤½¤Î·ë²Ì¤Ï +.\" (¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È 0123456789abcdef ¤Çɽ¤µ¤ì¤ë) +16 ¿Ê¿ôʸ»úÎó¤È¤·¤Æ +.I secret +¤ËºÆ¤ÓƱ¤¸Ä¹¤µ¤Ç½ÐÎϤµ¤ì¤ë¡£ +.LP +.BR xdecrypt () +´Ø¿ô¤ÏµÕ¤ÎÁàºî¤ò¹Ô¤¦¡£ +.SH ÊÖ¤êÃÍ +´Ø¿ô +.BR xencrypt () +¤È +.BR xdecrypt () +¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ë 1 ¤òÊÖ¤·¡¢¼ºÇÔ¤·¤¿¾ì¹ç¤Ë 0 ¤òÊÖ¤¹¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +¤³¤ì¤é¤Î¥ë¡¼¥Á¥ó¤Ï libc 4.6.27 °Ê¹ß¤È glibc 2.1 °Ê¹ß¤Ë¸ºß¤¹¤ë¡£ +.SH ¥Ð¥° +¾åµ­¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ë¥×¥í¥È¥¿¥¤¥×¤¬¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cbc_crypt (3) diff --git a/release/man3/xdr.3 b/release/man3/xdr.3 new file mode 100644 index 00000000..11de95d1 --- /dev/null +++ b/release/man3/xdr.3 @@ -0,0 +1,558 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)xdr.3n 2.2 88/08/03 4.0 RPCSRC; from 1.16 88/03/14 SMI +.\" +.\" 2007-12-30, mtk, Convert function prototypes to modern C syntax +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Tue Jan 4 20:48:51 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH XDR 3 2007-12-30 "" "Linux Programmer's Manual" +.SH ̾Á° +xdr \- ³°Éô¥Ç¡¼¥¿É½¸½(XDR)¤Î¤¿¤á¤Î¥é¥¤¥Ö¥é¥ê¡¦¥ë¡¼¥Æ¥£¥ó +.SH ½ñ¼°¤ÈÀâÌÀ +.LP +¤³¤ì¤é¤Î¥ë¡¼¥Æ¥£¥ó¤Ï C ¥×¥í¥°¥é¥Þ¡¼¤¬¥Þ¥·¥óÈó°Í¸¤Ê·Á¼°¤Ç +Ǥ°Õ¤Î¥Ç¡¼¥¿¹½Â¤ÂΤòµ­½Ò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£ +¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¡¦¥³¡¼¥ë¤Î¤¿¤á¤Î¥Ç¡¼¥¿¤Ï¤³¤ì¤é¤Î¥ë¡¼¥Æ¥£¥ó¤ò +»ÈÍѤ·¤ÆÁ÷¿®¤µ¤ì¤ë¡£ + +°Ê²¼¤Ë¼¨¤¹¥×¥í¥È¥¿¥¤¥×Àë¸À¤Ï +.I +¤Ç¹Ô¤ï¤ì¤Æ¤ª¤ê¡¢¤½¤ÎÃæ¤Ç¤Ï¼¡¤Î·¿¤¬»ÈÍѤµ¤ì¤ë¡£ +.in +4n +.nf + +typedef int \fIbool_t\fP; + +typedef bool_t (*\fIxdrproc_t\fP) (XDR *, void *,...); +.fi +.in +.LP +.I XDR +·¿¤ÎÀë¸À¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.I +¤ò»²¾È¡£ +.LP +.nf +.BI "bool_t xdr_array(XDR *" xdrs ", char **" arrp ", unsigned int *" sizep , +.BI " unsigned int " maxsize ", unsigned int " elsize , +.BI " xdrproc_t " elproc ); +.fi +.IP +²ÄÊÑŤÎÇÛÎó¤È¤½¤ì¤ËÂбþ¤¹¤ë³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +°ú¤­¿ô +.I arrp +¤ÏÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ê¡¢ +.I sizep +¤ÏÇÛÎó¤ÎÍ×ÁÇ¿ô¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤ÎÍ×ÁÇ¿ô¤Ï +.I maxsize +¤òĶ¤¨¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +°ú¤­¿ô +.I elsize +¤Ï³ÆÇÛÎó¤ÎÍ×ÁǤΠ+.I sizeof +¤Ç¤¢¤ê¡¢ +.I elproc +¤ÏÇÛÎóÍ×ÁǤò C ·Á¼°¤«¤é¤½¤Î³°Éôɽ¸½¤ËÊÑ´¹¤¹¤ë¤¿¤á¤Î XDR ¥Õ¥£¥ë¥¿¡¼¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_bool(XDR *" xdrs ", bool_t *" bp ); +.fi +.IP +¿¿µ¶ÃÍ(C ¤Î int)¤È¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¥Ç¡¼¥¿¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë»þ¡¢¤³¤Î¥Õ¥£¥ë¥¿¡¼¤Ï 1 ¤Þ¤¿ 0 ¤ÎÃͤòÀ¸À®¤¹¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_bytes(XDR *" xdrs ", char **" sp ", unsigned int *" sizep , +.BI " unsigned int " maxsize ); +.fi +.IP +¤¢¤ëŤµ¤Î¥Ð¥¤¥Èʸ»úÎó¤È¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +°ú¤­¿ô +.I sp +¤Ïʸ»úÎó¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£Ê¸»úÎó¤ÎŤµ¤Ï +.I sizep +¤Î¥¢¥É¥ì¥¹¤ËÃÖ¤¯¡£Ê¸»úÎó¤Ï +.I maxsize +¤è¤êŤ¯¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_char(XDR *" xdrs ", char *" cp ); +.fi +.IP +C ¤Îʸ»ú(char)¤È¤½¤Î³°Éôɽ¸½¤È¤Î´Ö¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£ +Ãí°Õ: ¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿¥Ç¡¼¥¿¤ÏµÍ¤á¹þ¤Þ¤ì¤Æ¤ª¤é¤º¡¢¤½¤ì¤¾¤ì 4 ¥Ð¥¤¥È¤ò +Àê¤á¤ë¡£Ê¸»ú¤ÎÇÛÎó¤Î¾ì¹ç¤Ë¤Ï +.BR xdr_bytes (), +.BR xdr_opaque (), +.BR xdr_string () +¤Ê¤É¤ò¹Íθ¤·¤¿Êý¤¬Îɤ¤¡£ +.LP +.nf +.BI "void xdr_destroy(XDR *" xdrs ); +.fi +.IP +¤³¤Î¥Þ¥¯¥í¤Ï XDR ¥¹¥È¥ê¡¼¥à +.I xdrs +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ç˲õ¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤¹¡£ +Ç˲õ¤Ë¤ÏÄ̾¥¹¥È¥ê¡¼¥à¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿»äŪ¥Ç¡¼¥¿¹½Â¤ÂΤβòÊü¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.BR xdr_destroy () +¤Î¸Æ¤Ó½Ð¤·¤Î¸å¤Ë +.I xdrs +¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ +.LP +.nf +.BI "bool_t xdr_double(XDR *" xdrs ", double *" dp ); +.fi +.IP +C ¤Î +.I ÇÜÀºÅÙ¿ô (double) +¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_enum(XDR *" xdrs ", enum_t *" ep ); +.fi +.IP +C ¤Î +.I enum +(¼ÂºÝ¤Ë¤Ï int)¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_float(XDR *" xdrs ", float *" fp ); +.fi +.IP +C ¤Î +.IR "ÉâÆ°¾®¿ôÅÀ¿ô (float)" +¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.LP +.nf +.BI "void xdr_free(xdrproc_t " proc ", char *" objp ); +.fi +.IP +ÈÆÍѲòÊü(free)¥ë¡¼¥Æ¥£¥ó¡£ºÇ½é¤Î°ú¤­¿ô¤Ï¥ª¥Ö¥¸¥§¥¯¥È¤ò²òÊü¤¹¤ë¤¿¤á¤Î +XDR ¥ë¡¼¥Æ¥£¥ó¤Ç¤¢¤ë¡£ÆóÈÖÌܤΰú¤­¿ô¤Ï¤½¤Î¥ª¥Ö¥¸¥§¥¯¥È¼«¿È¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼ +¤Ç¤¢¤ë¡£Ãí°Õ: ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ËÅϤµ¤ì¤ë¥Ý¥¤¥ó¥¿¡¼¤Ï +.I ²òÊü¤µ¤ì¤Ê¤¤ +¤¬¡¢¤³¤Î¥Ý¥¤¥ó¥¿¡¼¤Î»Ø¤¹¥Ç¡¼¥¿¤Ï(ºÆµ¢Åª¤Ë) +.IR ²òÊü¤µ¤ì¤ë ¡£ +.LP +.nf +.BI "unsigned int xdr_getpos(XDR *" xdrs ); +.fi +.IP +¤³¤Î¥Þ¥¯¥í¤Ï XDR ¥¹¥È¥ê¡¼¥à +.I xdrs +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿°ÌÃÖ¼èÆÀ¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤¹¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï XDR ¥Ð¥¤¥È¡¦¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ¤ò»Ø¼¨¤¹¤ëÉä¹æ̵¤·À°¿ô¤òÊÖ¤¹¡£ +XDR ¥¹¥È¥ê¡¼¥à¤Îµ¡Ç½¤È¤·¤Æ¤³¤Î¿ôÃͤÇñ½ã¤Ê»»½Ñºî¶È¤¬¤Ç¤­¤ë¤³¤È¤¬ +´üÂÔ¤µ¤ì¤Æ¤ë¤¤¤ë¡£¤·¤«¤·¤Ê¤¬¤é +XDR ¥¹¥È¥ê¡¼¥à¤Î¼ÂÂΤϤ³¤ì¤òÊݾڤ¹¤ëɬÍפϤʤ¤¡£ +.LP +.nf +.BI "long *xdr_inline(XDR *" xdrs ", int " len ); +.fi +.IP +¤³¤Î¥Þ¥¯¥í¤Ï XDR ¥¹¥È¥ê¡¼¥à +.I xdrs +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿ÆâÉô(inline)¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤¹¡£ +¥ë¡¼¥Æ¥£¥ó¤Ï¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¡¼¤ÎϢ³¤¹¤ëÃÇÊҤؤΥݥ¤¥ó¥¿¡¼¤òÊÖ¤¹¡£ +.I len +¤ÏÍ׵᤹¤ë¥Ð¥Ã¥Õ¥¡¡¼¤Î¥Ð¥¤¥ÈŤǤ¢¤ë¡£ +Ãí°Õ: ¥Ý¥¤¥ó¥¿¡¼¤Ï +.I "long *" +¤Ë¥­¥ã¥¹¥È¤µ¤ì¤ë¡£ +.IP +·Ù¹ð: +.BR xdr_inline () +¤Ï¥Ð¥Ã¥Õ¥¡¡¼¤ÎϢ³¤¹¤ëÃÇÊÒ¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï +NULL (0)¤òÊÖ¤¹¤«¤â¤·¤ì¤Ê¤¤¡£ +¤É¤Î¾ì¹ç¤â¤½¤ÎÆ°ºî¤Ï¥¹¥È¥ê¡¼¥à¤Î¼ÂÂΤˤè¤Ã¤ÆÊѲ½¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤ì¤Ï¸úΨ²½¤Î¤¿¤á¤Ë¸ºß¤·¤Æ¤¤¤ë¡£ +.LP +.nf +.BI "bool_t xdr_int(XDR *" xdrs ", int *" ip ); +.fi +.IP +C ¤ÎÀ°¿ô(int)¤È¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_long(XDR *" xdrs ", long *" lp ); +.fi +.IP +C ¤Î +.I long +À°¿ô¤È¤½¤Î¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "void xdrmem_create(XDR *" xdrs ", char *" addr ", unsigned int " size , +.BI " enum xdr_op " op ); +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.I xdrs +¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤Æ¤¤¤ë XDR ¥¹¥È¥ê¡¼¥à¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò½é´ü²½¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Î¥Ç¡¼¥¿¤Ï +.I addr +°ÌÃ֤ˤ¢¤ë¥á¥â¥ê¡¼¤Î²ô¤«¤éÆɤ߽ñ¤­¤µ¤ì¤ë¡£ +¤½¤ÎŤµ¤Ï¥Ð¥¤¥Èñ°Ì¤Ç +.I size +Ķ¤¨¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +.I op +¤Ï XDR ¥¹¥È¥ê¡¼¥à¤ÎÊÑ´¹Êý¸þ¤ò·èÄꤹ¤ë +.RB ( XDR_ENCODE , +.BR XDR_DECODE , +.B XDR_FREE +¤Î¤É¤ì¤«)¡£ +.LP +.nf +.BI "bool_t xdr_opaque(XDR *" xdrs ", char *" cp ", unsigned int " cnt ); +.fi +.IP +¸ÇÄêŤÎÉÔÌÀ¥Ç¡¼¥¿¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +°ú¤­¿ô +.I cp +¤ÏÉÔÌÀ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ê +.I cnt +¤Ï¤½¤Î¥Ð¥¤¥Èñ°Ì¤ÎÂ礭¤µ¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_pointer(XDR *" xdrs ", char **" objpp , +.BI " unsigned int " objsize ", xdrproc_t " xdrobj ); +.fi +.IP +.BR xdr_reference () +¤ÈƱÍͤǤ¢¤ë¤¬¡¢¤³¤ì¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤òÈֹ沽¤¹¤ë¤Î¤ËÂФ·¤Æ +.BR xdr_reference () +¤Ï¤½¤¦¤·¤Ê¤¤ÅÀ¤¬°Û¤Ê¤Ã¤Æ¤¤¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢ +.BR xdr_pointer () +¤ÏÆóʬÌÚ¤äÏ¢·ë¥ê¥¹¥È¤Î¤è¤¦¤ÊºÆµ¢Åª¤Ê¥Ç¡¼¥¿¹½Â¤ÂΤò +ɽ¸½¤Ç¤­¤ë¡£ +.LP +.nf +.BI "void xdrrec_create(XDR *" xdrs ", unsigned int " sendsize , +.BI " unsigned int " recvsize ", char *" handle , +.BI " int (*" readit ") (char *, char *, int)," +.BI " int (*" writeit ") (char *, char *, int));" +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.I xdrs +¤Ç»Ø¤µ¤ì¤¿ XDR ¥¹¥È¥ê¡¼¥à¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò½é´ü²½¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Î¥Ç¡¼¥¿¤ÏÂ礭¤µ +.I sendsize +¤Î¥Ð¥Ã¥Õ¥¡¤Ø½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.I sendsize +¤ò¥¼¥í¤Ë¤¹¤ë¤È¡¢¥·¥¹¥Æ¥à¤ËŬÀڤʥǥե©¥ë¥È¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë»Ø¼¨¤¹¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Î¥Ç¡¼¥¿¤ÏÂ礭¤µ +.I recvsize +¤Î¥Ð¥Ã¥Õ¥¡¤«¤éÆɤ߹þ¤Þ¤ì¤ë¡£¤³¤ì¤â¥¼¥í¤òÅϤ¹¤³¤È¤ÇŬÀڤʥǥե©¥ë¥È¤Ë +ÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Î½ÐÎϥХåե¡¤¬°ìÇդξì¹ç¤Ï +.I writeit +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£Æ±Íͤ˥¹¥È¥ê¡¼¥àÆþÎϥХåե¡¤¬¶õ¤Î¾ì¹ç¤Ë¤Ï +.I readit +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£¤³¤ì¤é¤ÎÆó¤Ä¤Î¥ë¡¼¥Æ¥£¥ó¤ÎÆ°ºî¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î +.BR read (2) +¤ä +.BR write (2) +¤È»÷¤Æ¤¤¤ë¤¬¡¢Á°¼Ô¤Î¥ë¡¼¥Æ¥£¥ó¤ÏºÇ½é¤Î°ú¤­¿ô¤È¤·¤Æ +.I handle +¤¬ÅϤµ¤ì¤ëÅÀ¤Ç°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +Ãí°Õ: XDR ¥¹¥È¥ê¡¼¥à¤Î +.I op +¤Ï¸Æ¤Ó½Ð¤·Â¦¤ÇÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP +·Ù¹ð: ¤³¤Î XDR ¥¹¥È¥ê¡¼¥à¤ÏÃæ´Ö¥ì¥³¡¼¥É¡¦¥¹¥È¥ê¡¼¥à¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +¥ì¥³¡¼¥É¶­³¦¤Î¾ðÊó¤òÄ󶡤¹¤ë¤¿¤á¤Ë¥¹¥È¥ê¡¼¥à¤Ë¤Ï;ʬ¤Ê¥Ð¥¤¥È¤¬Â¸ºß¤¹¤ë¡£ +.LP +.nf +.BI "bool_t xdrrec_endofrecord(XDR *" xdrs ", int " sendnow ); +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.BR xdrrec_create () +¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¤Î¤ß¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +½ÐÎϥХåե¡¤Î¥Ç¡¼¥¿¤Ï´°Á´¤Ê¥ì¥³¡¼¥É¤È¤·¤Æ°õ¤µ¤ì¡¢ +.I sendnow +¤¬¥¼¥í¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï½ÐÎϥХåե¡¤Ï½ñ¤­½Ð¤µ¤ì¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdrrec_eof(XDR *" xdrs ); +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.BR xdrrec_create () +¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¤Î¤ß¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +¥¹¥È¥ê¡¼¥à¤Î¸½ºß¤Î¥ì¥³¡¼¥É¤Î»Ä¤ê¤ò¾ÃÈñ¤·¤¿¸å¤Ë¡¢ +¥¹¥È¥ê¡¼¥à¤ËÆþÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdrrec_skiprecord(XDR *" xdrs ); +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.BR xdrrec_create () +¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¤Î¤ß¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +XDR ¤Î¼ÂÁõ¤Ë¤½¤Î¥¹¥È¥ê¡¼¥à¤ÎÆþÎϥХåե¡¡¼¤Î¸½ºß¤Î¥ì¥³¡¼¥É¤Î»Ä¤ê¤ò +¼Î¤Æ¤ë¤è¤¦¤ËÅÁ¤¨¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_reference(XDR *" xdrs ", char **" pp ", unsigned int " size , +.BI " xdrproc_t " proc ); +.fi +.IP +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡¼ÄÉÀפòÄ󶡤¹¤ë´ðËܥ롼¥Æ¥£¥ó¡£ +°ú¤­¿ô +.I pp +¤Ï¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I size +¤Ï +.I *pp +¤¬»Ø¤·¤Æ¤¤¤ë¹½Â¤ÂΤΠ+.I sizeof +¤Ç¤¢¤ë¡£ +.I proc +¤Ï¤½¤Î¹½Â¤ÂΤΠC ·Á¼°¤È³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦ XDR ¥×¥í¥·¥¸¥ã¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.IP +·Ù¹ð: ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï NULL ¥Ý¥¤¥ó¥¿¡¼¤òÍý²ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£¤«¤ï¤ê¤Ë +.BR xdr_pointer () +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.LP +.nf +.BI "xdr_setpos(XDR *" xdrs ", unsigned int " pos ); +.fi +.IP +¤³¤Î¥Þ¥¯¥í¤Ï XDR ¥¹¥È¥ê¡¼¥à +.I xdrs +¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿°ÌÃÖÀßÄê¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤¹¡£°ú¤­¿ô +.I pos +¤Ï +.BR xdr_getpos () +¤Ë¤è¤Ã¤Æ¼èÆÀ¤µ¤ì¤ë°ÌÃÖ¿ôÃͤǤ¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï XDR ¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ¤ÎÊѹ¹¤¬¤Ç¤­¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.IP +·Ù¹ð: ¤¢¤ë¼ï¤Î XDR ¥¹¥È¥ê¡¼¥à¤Î¾ì¹ç¤Ï°ÌÃÖ¤ÎÊѹ¹¤ò¹Ô¤Ê¤¦¤³¤È¤¬º¤Æñ¤Ç¤¢¤ë¡£ +¤½¤ì¤Ç¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¤¢¤ë¼ï¤Î¥¹¥È¥ê¡¼¥à¤Î¾ì¹ç¤Ë¤ÏÀ®¸ù¤·¡¢Ê̤μïÎà¤Î +¾ì¹ç¤Ë¤Ï¼ºÇÔ¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.LP +.nf +.BI "bool_t xdr_short(XDR *" xdrs ", short *" sp ); +.fi +.IP +C ¤Î +.I short +À°¿ô¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤¹¤ë¤È 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "void xdrstdio_create(XDR *" xdrs ", FILE *" file ", enum xdr_op " op ); +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï +.I xdrs +¤Ç»Ø¤µ¤ì¤¿ XDR ¥¹¥È¥ê¡¼¥à¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò½é´ü²½¤¹¤ë¡£ +XDR ¥¹¥È¥ê¡¼¥à¤ËÆɤ߽ñ¤­¤ì¤¿¥Ç¡¼¥¿¤Ï +.I stdio +¥¹¥È¥ê¡¼¥à +.I file +¤¬»ÈÍѤµ¤ì¤ë¡£ +.I op +°ú¤­¿ô¤Ï XDR ¥¹¥È¥ê¡¼¥à¤ÎÊÑ´¹Êý¸þ¤ò·èÄꤹ¤ë +.RB ( XDR_ENCODE , +.BR XDR_DECODE , +.B XDR_FREE +¤Î¤É¤ì¤«)¡£ +.IP +·Ù¹ð: ¤³¤Î¤è¤¦¤Ê XDR ¥¹¥È¥ê¡¼¥à¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ç˲õ¥ë¡¼¥Æ¥£¥ó¤Ï +.I file +¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ +.BR fflush (3) +¤ò¸Æ¤Ó½Ð¤¹¤¬ +.BR fclose (3) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ï¤Ê¤¤¡£ +.LP +.nf +.BI "bool_t xdr_string(XDR *" xdrs ", char **" sp ", unsigned int " maxsize ); +.fi +.IP +C ¤Îʸ»úÎó¤È¤½¤ì¤ËÂбþ¤¹¤ë³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +ʸ»úÎó¤Ï +.I maxsize +¤è¤êŤ¯¤Ï¤Ç¤­¤Ê¤¤¡£ +Ãí°Õ: +.I sp +¤Ïʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_u_char(XDR *" xdrs ", unsigned char *" ucp ); +.fi +.IP +C ¤Î +.I Éä¹æ̵¤·Ê¸»ú (unsigned char) +¤È¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned *" up ); +.fi +.IP +C ¤Î +.I Éä¹æ̵¤·À°¿ô (unsigned) +¤È¤½¤Î³°Éôɽ¸½¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_u_long(XDR *" xdrs ", unsigned long *" ulp ); +.fi +.IP +C ¤Î +.I "unsigned long" +À°¿ô¤È¤½¤Î³°Éôɽ¸½¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_u_short(XDR *" xdrs ", unsigned short *" usp ); +.fi +.IP +C ¤Î +.I "unsigned short" +À°¿ô¤È¤½¤Î³°Éôɽ¸½¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_union(XDR *" xdrs ", int *" dscmp ", char *" unp , +.BI " struct xdr_discrim *" choices , +.BI " xdrproc_t " defaultarm "); /* may equal NULL */" +.fi +.IP +ʬÊ̲Äǽ¤Ê C ¤Î +.I "¶¦ÍÑÂÎ (union)" +¤È¤½¤Î³°Éô·Á¼°¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +ºÇ½é¤Ë +.I dscmp +¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿¶¦ÍÑÂΤÎʬÊÌÍ×ÁǤ¬ÊÑ´¹¤µ¤ì¤ë¡£ +¤³¤ÎʬÊÌÍ×ÁǤϾï¤Ë +.I enum_t +¤Ç¤¢¤ë¡£ +¼¡¤Ë +.I unp +¤Î°ÌÃ֤ζ¦ÍÑÂΤ¬ÊÑ´¹¤µ¤ì¤ë¡£°ú¤­¿ô +.I choices +¤Ï +.BR xdr_discrim () +¹½Â¤ÂΤÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£³Æ¹½Â¤ÂÎ¤Ï +.RI [ value , proc ] +¤Î½ç½øÉÕ¤­¥Ú¥¢¤ò³ÊǼ¤·¤Æ¤¤¤ë¡£ +¤â¤·¶¦ÍÑÂΤÎʬÊÌÍ×ÁǤ¬´ØÏ¢ÉÕ¤±¤é¤ì¤¿ +.I value +¤ÈÅù¤·¤¤¾ì¹ç¤Ë¤Ï¡¢¶¦ÍÑÂΤòÊÑ´¹¤¹¤ë¤¿¤á¤Ë +.I proc +¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +.BR xdr_discrim () +¹½Â¤ÂΤÎÇÛÎó¤ÎºÇ¸å¤Ï¡¢¥ë¡¼¥Æ¥£¥ó¤È¤·¤Æ +.SM NULL +¤ò»ØÄꤹ¤ë¤³¤È¤Ç¼¨¤µ¤ì¤ë¡£ +ʬÊÌÍ×ÁǤ¬ +.I choices +ÇÛÎó¤ÎÃæ¤Ë¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.I defaultarm +¤¬ (NULL ¤Ç¤Ê¤±¤ì¤Ð) ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ +À®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_vector(XDR *" xdrs ", char *" arrp ", unsigned int " size , +.BI " unsigned int " elsize ", xdrproc_t " elproc ); +.fi +.IP +¸ÇÄêŤÎÇÛÎó¤È¤½¤ì¤é¤¬Âбþ¤¹¤ë³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£ +°ú¤­¿ô +.I arrp +¤ÏÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£°ìÊý¤Ç +.I size +¤ÏÇÛÎó¤ÎÍ×ÁÇ¿ô¤½¤Î¤â¤Î¤Ç¤¢¤ë¡£°ú¤­¿ô +.I elsize +¤ÏÇÛÎó¤Î³ÆÍ×ÁǤΠ+.I sizeof +¤Ç¡¢ +.I elproc +¤ÏÇÛÎó¤ÎÍ×ÁǤò C ·Á¼°¤«¤é¤½¤Î³°Éôɽ¸½¤Ø¤ÈÊÑ´¹¤¹¤ë XDR ¥Õ¥£¥ë¥¿¡¼¤Ç¤¢¤ë¡£ +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç 1 ¤òÊÖ¤¹¡£ +¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.LP +.nf +.BI "bool_t xdr_void(void);" +.fi +.IP +¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¾ï¤Ë 1 ¤òÊÖ¤¹¡£ +¤³¤ì¤Ï²¿¤â¹Ô¤Ê¤ï¤Ê¤¤¤¬¡¢´Ø¿ô°ú¤­¿ô¤¬É¬Í×¤Ê +RPC ¥ë¡¼¥Æ¥£¥ó¤ËÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +.nf +.BI "bool_t xdr_wrapstring(XDR *" xdrs ", char **" sp ); +.fi +.IP +.B "xdr_string(xdrs, sp, \s-1MAXUN.UNSIGNED\s0 );" +¤ò¸Æ¤Ó½Ð¤¹´ðËܥ롼¥Æ¥£¥ó¡£ +¤³¤³¤Ç +.B +.SM MAXUN.UNSIGNED +¤ÏÉä¹æ̵¤·À°¿ô(unsigned int)¤ÎºÇÂçÃͤǤ¢¤ë¡£ +.BR xdr_wrapstring () +¤Ï¡¢ +.SM RPC +¥Ñ¥Ã¥±¡¼¥¸¤ÏÆó¤Ä¤Î +.SM XDR +¥ë¡¼¥Æ¥£¥ó¤ÎºÇÂçÃͤò°ú¤­¿ô¤È¤·¤ÆÅϤ¹¤¿¤áÊØÍø¤Ç¤¢¤ë¡£ +.BR xdr_string () +¤ÏºÇ¤âÉÑÈˤËÍøÍѤµ¤ì¤ë´ðËܥ롼¥Æ¥£¥ó¤Ç¤¢¤ë¤¬»°¤Ä¤òÍ׵᤹¤ë¡£ +À®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡¢¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£ +.SH ´ØÏ¢¹àÌÜ +.BR rpc (3) +.LP +°Ê²¼¤Î¥Þ¥Ë¥å¥¢¥ë: +.RS +eXternal Data Representation Standard: Protocol Specification +.br +eXternal Data Representation: Sun Technical Notes +.br +.IR "XDR: External Data Representation Standard" , +RFC\ 1014, Sun Microsystems, Inc., +USC-ISI. +.RE diff --git a/release/man3/y0.3 b/release/man3/y0.3 new file mode 100644 index 00000000..02e0b7fd --- /dev/null +++ b/release/man3/y0.3 @@ -0,0 +1,231 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" 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. +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified Sat Jul 24 19:08:17 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2002-08-25, aeb +.\" 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" +.SH ̾Á° +y0, y0f, y0l, y1, y1f, y1l, yn, ynf, ynl \- +ÂèÆó¼ï¥Ù¥Ã¥»¥ë´Ø¿ô +.SH ½ñ¼° +.nf +.B #include +.sp +.BI "double y0(double " x ); +.br +.BI "double y1(double " x ); +.br +.BI "double yn(int " n ", double " x ); +.sp +.BI "float y0f(float " x ); +.br +.BI "float y1f(float " x ); +.br +.BI "float ynf(int " n ", float " x ); +.sp +.BI "long double y0l(long double " x ); +.br +.BI "long double y1l(long double " x ); +.br +.BI "long double ynl(int " n ", long double " x ); +.fi +.sp +\fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.ad l +.BR y0 (), +.BR y1 (), +.BR yn (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE +.br +.BR y0f (), +.BR y0l (), +.BR y1f (), +.BR y1l (), +.BR ynf (), +.BR ynl (): +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 +.\" Also seems to work: -std=c99 -D_XOPEN_SOURCE +.ad b +.SH ÀâÌÀ +.PP +´Ø¿ô +.BR y0 () +¤È +.BR y1 () +¤Ï¤½¤ì¤¾¤ì \fIx\fP ¤Î 0 ¼¡¡¢1 ¼¡¤Î +ÂèÆó¼ï¥Ù¥Ã¥»¥ë´Ø¿ô¤ÎÃͤòÊÖ¤¹¡£ +´Ø¿ô +.BR yn () +¤Ï \fIx\fP ¤Î \fIn\fP ¼¡¤Î +ÂèÆó¼ï¥Ù¥Ã¥»¥ë´Ø¿ô¤ÎÃͤòÊÖ¤¹¡£ +.PP +\fIx\fP ¤ÏÀµ¤ÎÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.BR y0f () +·²¤Î´Ø¿ô¡¢ +.BR y0l () +·²¤Î´Ø¿ô¤Ï¡¢¤½¤ì¤¾¤ì +.I float +·¿¡¢ +.I "long double" +·¿¤ÎÊÖ¤êÃͤòÊÖ¤¹¡£ +.SH ÊÖ¤êÃÍ +À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I x +¤ËÂФ¹¤ëÂèÆó¼ï¥Ù¥Ã¥»¥ë´Ø¿ô¤ÎÃͤòÊÖ¤¹¡£ + +.I x +¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£ + +.I x +¤¬Éé¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.RB - HUGE_VAL , +.RB - HUGE_VALF , +.RB - HUGE_VALL +¤òÊÖ¤¹ (POSIX.1-2001 ¤Ç¤Ï¤³¤Î¾ì¹ç¤Ë NaN ¤òÊÖ¤¹¤³¤È¤âǧ¤á¤Æ¤¤¤ë)¡£ + +.I x +¤¬ 0.0 ¤Î¾ì¹ç¡¢¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.RB - HUGE_VAL , +.RB - HUGE_VALF , +.RB - HUGE_VALL +¤òÊÖ¤¹¡£ + +·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ +ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï 0.0 ¤òÊÖ¤¹¡£ + +·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢ +³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì +.RB - HUGE_VAL , +.RB - HUGE_VALF , +.RB - HUGE_VALL +¤òÊÖ¤¹ (POSIX.1-2001 ¤Ç¤Ï¤³¤Î¾ì¹ç¤Ë 0.0 ¤òÊÖ¤¹¤³¤È¤âǧ¤á¤Æ¤¤¤ë)¡£ +.SH ¥¨¥é¡¼ +¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï +.BR math_error (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +Îΰ襨¥é¡¼: \fIx\fP ¤¬Éé +.I errno +¤Ë +.B EDOM +¤¬ÀßÄꤵ¤ì¤ë¡£ +ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤¬¾å¤¬¤ë¡£ +.TP +¶Ë¥¨¥é¡¼: \fIx\fP ¤¬ 0.0 +.\" Before POSIX.1-2001 TC2, this was (inconsistently) specified +.\" as a range error. +.\" FIXME . y0(0.0) gives EDOM +.I errno +¤Ë +.B ERANGE +¤¬ÀßÄꤵ¤ì¤ë (¡Ö¥Ð¥°¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È)¡£ +¤³¤Î¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR fetestexcept (3) +¤Ï +.B FE_DIVBYZERO +Îã³°¤òÊÖ¤µ¤Ê¤¤¡£ +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6808 +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼ +.\" e.g., y0(1e33) on glibc 2.8/x86-32 +.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 +¤³¤Î¥¨¥é¡¼¤Î¾ì¹ç¡¢ +.BR fetestexcept (3) +¤Ï +.B FE_UNDERFLOW +Îã³°¤òÊÖ¤µ¤Ê¤¤¡£ +.TP +ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ +.\" e.g., yn(10, 1e-40) on glibc 2.8/x86-32 +.\" .I errno +.\" is set to +.\" .BR ERANGE . +¤³¤Î¾ì¹ç¡¢ +.I errno +¤ÏÀßÄꤵ¤ì¤Ê¤¤¡£ +.\" FIXME . Is it intentional that errno is not set? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6808 +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ +.SH ½àµò +.I double +·¿¤ÎÃͤòÊÖ¤¹´Ø¿ô¤Ï¡¢SVr4, 4.3BSD, POSIX.1-2001 +¤Ë½àµò¤¹¤ë¡£ +¤½¤ì°Ê³°¤ÏÈóɸ½à¤Î´Ø¿ô¤Ç¡¢BSD ¤Ë¤â¸ºß¤¹¤ë¡£ +.SH ¥Ð¥° +¶Ë¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +.I errno +¤Ë +.B EDOM +¤òÀßÄꤹ¤ë¤¬¡¢ +POSIX.1-2004 ¤Ç¤Ï +.B ERANGE +¤òÀßÄꤹ¤ë¤³¤È¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë¡£ +.\" FIXME . +.\" Bug raised: http://sourceware.org/bugzilla/show_bug.cgi?id=6807 + +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. +Îΰ襨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï +ÉÔÀµÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤ò¾å¤²¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR j0 (3) diff --git a/release/man4/console.4 b/release/man4/console.4 new file mode 100644 index 00000000..08025aca --- /dev/null +++ b/release/man4/console.4 @@ -0,0 +1,116 @@ +.\" Copyright (c) 1994 Andries Brouwer (aeb@cwi.nl), Mon Oct 31 21:03:19 MET 1994 +.\" +.\" 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. +.\" +.\" Modified, Sun Feb 26 14:58:45 1995, faith@cs.unc.edu +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Sun Jan 4 16:25:42 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated Wed Jan 9 JST 2002 by Kentaro Shirakata +.\" +.\" WORD: console ¥³¥ó¥½¡¼¥ë +.\" WORD: terminal üËö +.\" WORD: virtual ²¾ÁÛ +.\" WORD: major number ¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ +.\" WORD: minor number ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ +.\" WORD: character device ¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹ +.\" WORD: device file ¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë +.\" WORD: kernel ¥«¡¼¥Í¥ë +.\" WORD: compile ¥³¥ó¥Ñ¥¤¥ë +.\" WORD: key mapping ¥­¡¼¥Þ¥Ã¥Ô¥ó¥° +.\" WORD: screen buffer ¥¹¥¯¥ê¡¼¥ó¥Ð¥Ã¥Õ¥¡ +.\" WORD: simulate ¥·¥ß¥å¥ì¡¼¥È +.\" WORD: escape sequence ¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ +.\" WORD: initial state ½é´ü¾õÂÖ +.\" WORD: reset ¥ê¥»¥Ã¥È +.TH CONSOLE 4 1994-10-31 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +console \- ¥³¥ó¥½¡¼¥ëüËö (console terminal) ¤È²¾ÁÛ¥³¥ó¥½¡¼¥ë (virtual console) +.SH ÀâÌÀ +Linux ¥·¥¹¥Æ¥à¤ÏÉáÄÌ¡¢\fI/dev/tty\fP\fIn\fP (n ¤Ï 1 \(<= \fIn\fP \(<= +63) ¤È¸Æ¤Ð¤ì¤ë\fI²¾ÁÛ¥³¥ó¥½¡¼¥ë\fP (¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ (major number) +4 ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ (minor number) 1 ¤«¤é 63 ¤Î¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹ +(character device)) ¤ò»ý¤Ä¡£ +¸½ºß¤Î¥³¥ó¥½¡¼¥ë¤Ï \fI/dev/console\fP ¤Þ¤¿¤Ï \fI/dev/tty0\fP (¥á¥¸¥ã¡¼ +¥Ê¥ó¥Ð¡¼ 4 ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ 0 ¤Î¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹) ¤Ë¤è¤Ã¤Æ¤â°·¤¨¤ë¡£ +¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë (device file) /dev/* ¤ÏÉáÄÌ MAKEDEV ¥¹¥¯¥ê¥×¥È¤Þ¤¿¤Ï +.BR mknod (1) +¤ò»È¤Ã¤Æ¥â¡¼¥É 0622¡¢½êÍ­¼Ô root.tty ¤È¤·¤ÆºîÀ®¤µ¤ì¤ë¡£ +.LP +¥«¡¼¥Í¥ë (kernel) ¥Ð¡¼¥¸¥ç¥ó 1.1.54 °ÊÁ°¤Ï¡¢²¾ÁÛ¥³¥ó¥½¡¼¥ë¤Î¿ô¤Ï¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +(tty.h Ãæ¤Î : #define NR_CONSOLES 8 ¤Ë¤è¤Ã¤Æ) ¥«¡¼¥Í¥ë¤ËËä¤á¹þ¤Þ¤ì¤Æ¤¤¤¿¡£ +¤½¤·¤Æ¡¢¤½¤ì¤òÊѹ¹¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·Ä¾¤¹¤³¤È¤Ç²¾ÁÛ¥³¥ó¥½¡¼¥ë¤Î¿ô¤òÊѹ¹¤Ç¤­¤¿¡£ +¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó 1.1.54 °Ê¹ß¤Ç¤Ï²¾ÁÛ¥³¥ó¥½¡¼¥ë¤¬É¬ÍפȤµ¤ì¤ë»þ¤Ï +¤¹¤°¤ËÆ°ºîÃæ¤ËºîÀ®¤µ¤ì¤ë¡£ +.LP +¥³¥ó¥½¡¼¥ë¾å¤Ç¥×¥í¥»¥¹¤ò³«»Ï¤¹¤ë°ìÈÌŪ¤ÊÊýË¡¤Ï: +(a) ¥³¥ó¥½¡¼¥ë¾å¤Ç +.BR mingetty (8) +(¤Þ¤¿¤Ï +.BR agetty (8)) +¤ò¥¹¥¿¡¼¥È¤µ¤»¤ë¤³¤È¤ò +.RB ( inittab (5) +¤ÎÃæ¤Ç) +.BR init (8) +¤ËÅÁ¤¨¤ë¡£ +(b) ¥³¥ó¥½¡¼¥ë¾å¤Ç¥×¥í¥»¥¹¤ò¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤ò +.BR openvt (1) +¤ËÍê¤à¡£ +(c) X ¤ò³«»Ï¤¹¤ë - X ¤Ï»È¤ï¤ì¤Æ¤¤¤Ê¤¤¥³¥ó¥½¡¼¥ë¤Î¤¦¤ÁºÇ½é¤Î¤â¤Î¤ò¸«ÉÕ¤±¡¢ +¤½¤³¤Ëɽ¼¨¤ò½ÐÎϤ¹¤ë¡£(ÀΤʤ¬¤é¤Î +.BR doshell (8) +¤â¤¢¤ë¡£) +.LP +¥³¥ó¥½¡¼¥ë¤òÀÚ¤êÂؤ¨¤ë°ìÈÌŪ¤ÊÊýË¡¤Ï: (a)¥³¥ó¥½¡¼¥ë \fIn\fP ¤ËÀÚ¤êÂؤ¨¤ë +¤¿¤á¤Ë Alt+F\fIn\fP ¤Þ¤¿¤Ï Ctrl+Alt+F\fIn\fP ¤ò»È¤¦¡£ +AltGr+F\fIn\fP ¤ò»È¤¦¤È¡¢¤ª¤½¤é¤¯¥³¥ó¥½¡¼¥ë \fIn\fP+12 ¤ËÀÚ¤êÂؤï¤ë +[¤³¤³¤Ç¤Î Alt ¤È AltGr ¤Ï¤½¤ì¤¾¤ìº¸±¦¤Î Alt ¥­¡¼¤ò¼¨¤¹]¡£ +(b) ¸½ºß³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥³¥ó¥½¡¼¥ë¤ò½Û´Ä¤¹¤ë¤¿¤á¤Ë Alt + ±¦Ìð°õ¥­¡¼ +¤Þ¤¿¤Ï Alt + º¸Ìð°õ¥­¡¼¤ò»È¤¦¡£(c) +.BR chvt (1) +¥×¥í¥°¥é¥à¤ò»È¤¦ +(¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¤Ï¥æ¡¼¥¶¤¬¥»¥Ã¥È¤Ç¤­¤ë¡¢ +.BR loadkeys (1) +¤ò¸«¤è¡£ +¾å¤Ç½Ò¤Ù¤¿¥­¡¼¥Ð¥¤¥ó¥É¤Ï¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¤Ë¤è¤ë¤â¤Î¤Ç¤¢¤ë)¡£ +.LP +.BR deallocvt (1) +¥³¥Þ¥ó¥É(°ÊÁ°¤Ï \fBdisalloc\fP ¤È¤¤¤¦Ì¾Á°¤À¤Ã¤¿)¤Ï¡¢ +¥×¥í¥»¥¹¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤Ê¤¤¥³¥ó¥½¡¼¥ë¤Î +¥¹¥¯¥ê¡¼¥ó¥Ð¥Ã¥Õ¥¡ (screen buffer) ¤Î¤¿¤á¤Ë»È¤ï¤ì¤Æ¤¤¤ë¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£ +.SS ÆÃÀ­ +¥³¥ó¥½¡¼¥ë¤Ï¿¤¯¤Î¾õÂÖ¤ò¤â¤Ã¤Æ¤¤¤ë¡£ +»ä¤Ï¡¢¤½¤ì¤Ë¤Ä¤¤¤Æ¤¤¤Ä¤«¥É¥­¥å¥á¥ó¥È¤Ë¤·¤¿¤¤¤È¹Í¤¨¤Æ¤¤¤ë¡£ +¤â¤Ã¤È¤â½ÅÍפʻö¼Â¤Ï¥³¥ó¥½¡¼¥ë¤Ï vt100 üËö¤ò¿¿»÷¤Æ¤¤¤ë +(¥·¥ß¥å¥ì¡¼¥È¤·¤Æ¤¤¤ë) ¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +¥³¥ó¥½¡¼¥ë¤Ï ESC c ¤È¤¤¤¦Æó¤Ä¤Îʸ»ú¤ò°õ»ú¤¹¤ë»ö¤Ë¤è¤Ã¤Æ¡¢ +½é´ü¾õÂ֤˥ꥻ¥Ã¥È¤µ¤ì¤ë¡£ +¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ (escape sequences) ¤Ë¤Ä¤¤¤Æ¤Ï +.BR console_codes (4) +¤ÇÁ´¤ÆÀâÌÀ¤·¤Æ¤¢¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +.I /dev/console +.br +.I /dev/tty* +.SH ´ØÏ¢¹àÌÜ +.BR chvt (1), +.BR deallocvt (1), +.BR loadkeys (1), +.BR mknod (1), +.BR openvt (1), +.BR console_codes (4), +.BR console_ioctl (4), +.BR tty (4), +.BR ttyS (4), +.BR charsets (7), +.BR agetty (8), +.BR init (8), +.BR mapscrn (8), +.BR mingetty (8), +.BR resizecons (8), +.BR setfont (8) diff --git a/release/man4/console_codes.4 b/release/man4/console_codes.4 new file mode 100644 index 00000000..e25abec0 --- /dev/null +++ b/release/man4/console_codes.4 @@ -0,0 +1,640 @@ +'\" t +.\" Copyright (c) 1996 Andries Brouwer , Mon Oct 31 22:13:04 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. +.\" +.\" This is combined from many sources. +.\" For Linux, the definitive source is of course console.c. +.\" About vt100-like escape sequences in general there are +.\" the ISO 6429 and ISO 2022 norms, the descriptions of +.\" an actual vt100, and the xterm docs (ctlseqs.ms). +.\" Substantial portions of this text are derived from a write-up +.\" by Eric S. Raymond . +.\" +.\" Tiny correction, aeb, 961107. +.\" +.\" 2006-05-27, Several corrections - Thomas E. Dickey +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 +.\" ISHIKAWA Mutsumi, TAKAHASHI Mutsuji +.\" all rights reserved. +.\" Translated Mon Jul 21 03:12:45 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" and TAKAHASHI Mutsuji +.\" +.\" Japanese Version Modified Mon Jan 12 03:29:14 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated Wed Jan 9 JST 2001 by Kentaro Shirakata +.\" Updated Sun Jul 23 JST 2006 by Kentaro Shirakata +.\" Updated Tue Jul 22 JST 2008 by Kentaro Shirakata +.\" +.\" WORD: private mode ¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É +.\" +.TH CONSOLE_CODES 4 2008-01-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +console_codes \- Linux ¥³¥ó¥½¡¼¥ë¤Î¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤È¥³¥ó¥È¥í¡¼¥ë +¥·¡¼¥±¥ó¥¹ +.SH ÀâÌÀ +Linux ¥³¥ó¥½¡¼¥ë¤Ï VT102 ¤È ECMA-48/ISO6429/ANSI X3.64 üËö¥³¥ó¥½¡¼¥ë¤Î +¥µ¥Ö¥»¥Ã¥È¤Ë¡¢¥«¥é¡¼¥Ñ¥ì¥Ã¥È¤äʸ»ú½¸¹ç¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ê¤É¤òÊѹ¹¤¹¤ë +¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É¥·¡¼¥±¥ó¥¹¤ò²Ã¤¨¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +°Ê²¼¤Îɽ¤Ç¤Ï¡¢µ¡Ç½¤Î ECMA-48 ¤Þ¤¿¤Ï DEC ¤Î¥Ë¡¼¥â¥Ë¥¯¥¹(DEC¤Ç»Ï¤Þ¤ì¤Ð¸å¼Ô)¤ò +2 ÈÖÌܤηå¤Ëµ­¤¹¡£ +¥Ë¡¼¥â¥Ë¥¯¥¹¤Î¤Ê¤¤¤â¤Î¤Ï ECMA-48 ¤Ç¤â VT102 ¤Ç¤â¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¡£ +.LP +¤¹¤Ù¤Æ¤Î½ÐÎϺî¶È¤¬½ª¤Ã¤Æ¡¢¼ÂºÝ¤Ë°õ»ú¤¹¤ë¤¿¤á¤Ëʸ»ú¤Î¥¹¥È¥ê¡¼¥à¤¬ +¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð¡¼¤ËÆϤ¤¤¿»þ¡¢ºÇ½é¤Ë¹Ô¤Ê¤ï¤ì¤ë¤Î¤¬¡¢½èÍýÍÑ¥³¡¼¥É¤«¤é +°õ»úÍѤΥ³¡¼¥É¤Ø¤ÎÊÑ´¹¤Ç¤¢¤ë¡£ +.LP +¤â¤·¡¢¥³¥ó¥½¡¼¥ë¤¬ UTF-8 ¥â¡¼¥É¤Ê¤é¡¢Æþ¤Ã¤ÆÍ褿¥Ð¥¤¥È(byte)¤Ï +16 ¥Ó¥Ã¥È¤Î Unicode ¤ËÁȤßΩ¤Æ¤é¤ì¤ë¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢¤½¤ì¤¾¤ì¤Î +¥Ð¥¤¥È¤Ï¸½ºß¤Î(³Æ¥Ð¥¤¥È¤ò Unicode ¤ÎÃͤËÊÑ´¹¤¹¤ë)¥Þ¥Ã¥Ô¥ó¥°¥Æ¡¼¥Ö¥ë¤Ë +½¾¤Ã¤ÆÊÑ´¹¤µ¤ì¤ë¡£¤³¤ì¤Ë´Ø¤·¤Æ¤Ï²¼¤Î¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È(Charcter Sets) +Àá¤ò»²¾È¤Î¤³¤È¡£ +.LP +Ä̾Unicode ¤ÎÃͤϥե©¥ó¥È¥¤¥ó¥Ç¥Ã¥¯¥¹(font index) ¤ËÊÑ´¹¤µ¤ì¡¢ +¥Ó¥Ç¥ª¥á¥â¥ê¤ËÃߤ¨¤é¤ì¤ë¡£¤½¤·¤Æ(¥Ó¥Ç¥ª ROM Ãæ¤Ë¸«ÉÕ¤±¤é¤ì¤ë) +Âбþ¤¹¤ë¥°¥ê¥Õ(glyph)¤¬²èÌ̤˸½¤ì¤ë¡£ +Unicode ¤òÍѤ¤¤ë¤È¡¢(PC ¸ß´¹µ¡¤ÎÀ߷פǤÏ) 512 ¤Î°Û¤Ê¤Ã¤¿ +¥°¥ê¥Õ¤òƱ»þ¤ËÍøÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.LP +¸½ºß¤Î Unicode ¤ÎÃͤ¬¥³¥ó¥È¥í¡¼¥ëʸ»ú¤Ç¤¢¤ë¤«¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤ò +½èÍý¤·¤Æ¤¤¤ë»þ¤Ë¤Ï¡¢¤½¤ÎÃͤÏÆÃÊ̤˰·¤ï¤ì¤ë¡£ +¥Õ¥©¥ó¥È¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ËÊÑ´¹¤µ¤ì¤Æ¥°¥ê¥Õ¤È¤·¤Æɽ¼¨¤µ¤ì¤ëÂå¤ï¤ê¤Ë¡¢¥«¡¼¥½¥ë¤Î +°ÜÆ°¤ä¤½¤Î¾¤Î¥³¥ó¥È¥í¡¼¥ëµ¡Ç½¤ò¼Â¹Ô¤µ¤»¤ë¡£ +¾Ü¤·¤¤¤³¤È¤Ï¡¢¸å½Ò¤Î¡ÖLINUX ¥³¥ó¥½¡¼¥ë¥³¥ó¥È¥í¡¼¥ë¡×¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È¤Î¤³¤È¡£ +.LP +°ìÈ̤ËüËö¥³¥ó¥È¥í¡¼¥ë¥³¡¼¥É¤ò¥×¥í¥°¥é¥àÃæ¤ËľÀܵ­½Ò¤¹¤ë¤Î¤Ï +Îɤ¤¤³¤È¤Ç¤Ï¤Ê¤¤¡£ +Linux¤Ç¤Ï¡¢Ã¼Ëö¤Ë¤ª¤¤¤Æ¼Â¸½²Äǽ¤ÊÁàºî¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç¤¢¤ë +.BR terminfo (5) +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¥³¥ó¥½¡¼¥ë¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤ò¤ï¤¶¤ï¤¶ÆþÎϤ¹¤ë¤è¤ê¤â¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç +terminfo ¤Î¾ðÊó¤ò»²¾È¤¹¤ë +.BR ncurses (3), +.BR tput (1), +¤ä +.BR reset (1) +¤Ê¤É¤Î¥¹¥¯¥ê¡¼¥ó¥é¥¤¥Ö¥é¥ê¤ä¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡¼¤ò»È¤¤¤¿¤¤¤È»×¤¦¤Ç¤¢¤í¤¦¡£ +.SS "Linux ¥³¥ó¥½¡¼¥ë¥³¥ó¥È¥í¡¼¥ë" +¤³¤Î¾Ï¤Ç¤Ï Linux ¥³¥ó¥½¡¼¥ë¤Ë¤ª¤¤¤ÆÆüì¤Êµ¡Ç½(¤Ä¤Þ¤ê¡¢¸½ºß¤Î¥«¡¼¥½¥ë°ÌÃÖ¤Ë +ʸ»ú¤Î¥¤¥á¡¼¥¸¤ò°õ»ú¤¹¤ë°Ê³°¤Î¤³¤È)¤òµ¯¤³¤µ¤»¤ëÁ´¤Æ¤Î¥³¥ó¥È¥í¡¼¥ëʸ»ú¤È +¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤ë¡£ +.PP +.B "¥³¥ó¥È¥í¡¼¥ëʸ»ú" +.sp +¥³¥ó¥È¥í¡¼¥ëʸ»ú¤È¤Ï¡¢(¥Þ¥Ã¥Ô¥ó¥°¥Æ¡¼¥Ö¥ë¤Ë¤è¤ëÊÑ´¹Á°¤Î¥³¡¼¥É¤¬) +00 (NUL), 07 (BEL), 08 (BS), 09 (HT), 0a (LF), 0b (VT), +0c (FF), 0d (CR), 0e (SO), 0f (SI), 18 (CAN), 1a (SUB), +1b (ESC), 7f (DEL) ¤Î 14 ¤Î¥³¡¼¥É¤Î¤¦¤Á¤Î¤É¤ì¤«¤Ç¤¢¤ëʸ»ú¤Ç¤¢¤ë¡£ +"¥³¥ó¥È¥í¡¼¥ëʸ»úɽ¼¨(display control characters)"¥â¡¼¥É(¸å½Ò)¤ò +ÀßÄꤹ¤ë¤È¡¢07, 09, 0b, 18, 1a, 7f ¤ò¥°¥ê¥Õ¤È¤·¤Æɽ¼¨¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°ìÊý¡¢ UTF-8 ¥â¡¼¥É¤Ç¤Ï¡¢00-1f ¤ÎÁ´¤Æ¤Î¥³¡¼¥É¤Ï¡¢¥³¥ó¥È¥í¡¼¥ëʸ»úɽ¼¨ +¥â¡¼¥É¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ç¤â¥³¥ó¥È¥í¡¼¥ëʸ»ú¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +.PP +¥³¥ó¥È¥í¡¼¥ëʸ»ú¤¬¤¢¤ë»þ¤Ë¤Ï¡¢¤½¤ì¤Ï¤¹¤°¤Ë(¤¿¤È¤¨¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤Î +ÅÓÃæ¤Ç¤â)¼Â¹Ô¤µ¤ì¡¢ÇË´þ¤µ¤ì¤ë¡£¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤Ï¼¡¤Îʸ»ú¤«¤é³¤±¤é¤ì¤ë +(¤·¤«¤·¡¢ESC ¤Ï¿·¤·¤¤¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤ò»Ï¤á¤ë¤Î¤Ç¡¢ +Á°¤Î½ªÎ»¤·¤Æ¤¤¤Ê¤¤¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤¬Ãæ»ß¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤µ¤é¤Ë¡¢CAN ¤È SUB ¤Ï¤É¤ó¤Ê¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤âÃæ»ß¤¹¤ë)¡£ +ǧ¤á¤é¤ì¤Æ¤¤¤ë¥³¥ó¥È¥í¡¼¥ëʸ»ú¤Ï¡¢BEL, BS, HT, LF, VT, FF, CR, SO, SI, +CAN, SUB, ESC, DEL, CSI ¤Ç¤¢¤ë¡£¤³¤ì¤é¤Ï´üÂԤɤª¤ê¤ÎÆ°ºî¤ò¤¹¤ë: +.HP +BEL (0x07, \fB^G\fP) ¤Ï¥Ó¡¼¥×²»¤òÌĤ餹; +.HP +BS (0x08, \fB^H\fP) ¤Ï¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹ +(¤¿¤À¤·¡¢¹ÔƬ¤Ï±Û¤¨¤Ê¤¤); +.HP +HT (0x09, \fB^I\fP) ¤Ï¼¡¤Î¥¿¥Ö¥¹¥È¥Ã¥×(tab stop)¤Ø°ÜÆ°¤¹¤ë¡¢¤½¤³¤«¤é¹ÔËö¤Þ¤Ç¤Ë +¥¿¥Ö¥¹¥È¥Ã¥×¤¬Ìµ¤¤¾ì¹ç¤Ï¹Ô¤Î½ª¤ê¤Ë°ÜÆ°¤¹¤ë; +.HP +LF (0x0A, \fB^J\fP), VT (0x0B, \fB^K\fP), FF (0x0C, \fB^L\fP) ¤³¤ì¤é¤ÏÁ´¤Æ +¥é¥¤¥ó¥Õ¥£¡¼¥É(linefeed)¤òÍ¿¤¨¤ë; +LF/NL (¥Ë¥å¡¼¥é¥¤¥ó¥â¡¼¥É(new line mode))¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð +¥­¥ã¥ê¥Ã¥¸¥ê¥¿¡¼¥ó¤â¥¢¥¯¥Æ¥£¥Ö¤Ë¤¹¤ë; +.HP +CR (0x0D, \fB^M\fP) ¤Ï¥­¥ã¥ê¥Ã¥¸¥ê¥¿¡¼¥ó¤òÍ¿¤¨¤ë; +.HP +SO (0x0E, \fB^N\fP) ¤Ï G1 ʸ»ú½¸¹ç¤ò¥¢¥¯¥Æ¥£¥Ö¤Ë¤¹¤ë¡£ +.HP +SI (0x0F, \fB^O\fP) ¤Ï G0 ʸ»ú½¸¹ç¤ò¥¢¥¯¥Æ¥£¥Ö¤Ë¤¹¤ë; +.HP +CAN (0x18, \fB^X\fP) ¤È SUB (0x1A, \fB^Z\fP) ¤Ï¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤òÃæÃǤ¹¤ë; +.HP +ESC (0x1B, \fB^[\fP) ¤Ï¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤ò»Ï¤á¤ë¡£ +.HP +DEL (0x7F) ¤Ï̵»ë¤µ¤ì¤ë; +.HP +CSI (0x9B) ¤Ï ESC [ ¤ÈÅù²Á¡£ +.PP +.B "¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤Ç¤¢¤ë¤¬ CSI ¥·¡¼¥±¥ó¥¹¤Ç¤Ê¤¤¤â¤Î" +.sp +.TS +l l l. +ESC c RIS ¥ê¥»¥Ã¥È¡£ +ESC D IND ¥é¥¤¥ó¥Õ¥£¡¼¥É¡£ +ESC E NEL ¥Ë¥å¡¼¥é¥¤¥ó¡£ +ESC H HTS ¸½ºß¤Î·å¤Î°ÌÃ֤˥¿¥Ö¥¹¥È¥Ã¥×¤òÀßÄꤹ¤ë¡£ +ESC M RI µÕ¥é¥¤¥ó¥Õ¥£¡¼¥É +ESC Z DECID T{ +DEC¸ÇÍ­¤Î¼±ÊÌÍÑ¡£¥«¡¼¥Í¥ë¤Ïʸ»úÎó ESC [ ? 6 c ¤òÊÖ¤¹¡£ +¤³¤ì¤ÏüËö¤¬VT102¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +T} +ESC 7 DECSC T{ +¸½ºß¤Î¾õÂÖ(¥«¡¼¥½¥ë¤ÎºÂɸ¡¢Â°À­¡¢G0, G1 ¤Ç¼¨¤·¤Æ¤¤¤ë +ʸ»ú½¸¹ç)¤ò¥»¡¼¥Ö¤¹¤ë¡£ +T} +ESC 8 DECRC ºÇ¸å¤Ë ESC 7 ¤Ç¥»¡¼¥Ö¤·¤¿¾õÂÖ¤òÉüµ¢¤µ¤»¤ë¡£ +ESC [ CSI ¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤òƳÆþ¤¹¤ë¡£ +ESC % ¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤òÁªÂò¤¹¤ë¥·¡¼¥±¥ó¥¹¤ò³«»Ï¤¹¤ë¡£ +ESC % @ \0\0\0 ¥Ç¥Õ¥©¥ë¥È(ISO 646 / ISO 8859-1)¤òÁªÂò¤¹¤ë¡£ +ESC % G \0\0\0 UTF-8 ¤òÁªÂò¤¹¤ë¡£ +ESC % 8 \0\0\0 UTF-8 ¤òÁªÂò¤¹¤ë(µì¼°)¡£ +ESC # 8 DECALN DEC ¤Î¥¹¥¯¥ê¡¼¥óÄ´À°¥Æ¥¹¥È \- ¥¹¥¯¥ê¡¼¥ó¤ò E ¤Ç + ¤¦¤á¤ë¡£ +ESC ( G0 ʸ»ú½¸¹ç¤òÄêµÁ¤¹¤ë¥·¡¼¥±¥ó¥¹¤ò³«»Ï¤¹¤ë¡£ +ESC ( B \0\0\0 ¥Ç¥Õ¥©¥ë¥È(ISO 8859-1 ¥Þ¥Ã¥Ô¥ó¥°)¤òÁªÂò¤¹¤ë¡£ +ESC ( 0 \0\0\0 VT100 ¥°¥é¥Õ¥£¥¯¥¹¥Þ¥Ã¥Ô¥ó¥°¤òÁªÂò¤¹¤ë¡£ +ESC ( U \0\0\0 ¥Ì¥ë¥Þ¥Ã¥Ô¥ó¥°¤òÁªÂò¤¹¤ë \- ¥­¥ã¥é¥¯¥¿ ROM ¤«¤é + \0\0\0 ľÀܥޥåԥ󥰤¹¤ë¡£ +ESC ( K \0\0\0 ¥æ¡¼¥¶¡¼ÄêµÁ¤Î¥Þ¥Ã¥Ô¥ó¥°¤òÁªÂò¤¹¤ë \- ¤½¤Î¥Þ¥Ã¥× + \0\0\0 ¤Ï \fBmapscrn\fP(8) ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡¼¤Ë¤è¤Ã¤Æ¥í¡¼ + \0\0\0 ¥É¤µ¤ì¤ë¡£ +ESC ) G1 ¤òÄêµÁ¤¹¤ë¥·¡¼¥±¥ó¥¹¤ò³«»Ï¤¹¤ë¡£ + (¤¹¤Ç¤Ë½Ò¤Ù¤¿¤è¤¦¤Ë B, 0, U, K ¤Î¤É¤ì¤«¤¬¼¡¤Ë³¤¯) +ESC > DECPNM ¿ôÃÍ¥­¡¼¥Ñ¥Ã¥É¥â¡¼¥É(numeric keypad mode)¤ò + ¥»¥Ã¥È¤¹¤ë¡£ +ESC = DECPAM ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥­¡¼¥Ñ¥Ã¥É¥â¡¼¥É(application keypad + mode) ¤ò¥»¥Ã¥È¤¹¤ë¡£ +ESC ] OSC T{ +("Operating system command"¤Î¤³¤È¤À¤í¤¦) +ESC ] P \fInrrggbb\fP: ºÇ¸å¤Î P ¤Î¤¢¤È¤Î 7 ¤Ä¤Î 16 ¿Ê¿ô¤ò +¥Ñ¥é¥á¡¼¥¿¤È¤·¤Æ :-( ¥Ñ¥ì¥Ã¥È¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤³¤Ç¡¢\fIn\fP¤Ï¿§ (0-15)¡¢\fIrrggbb\fP¤ÏÀÖ/ÎÐ/ÀĤÎÃÍ +(0-255)¤ò°ÕÌ£¤¹¤ë¡£ +ESC ] R: ¥Ñ¥ì¥Ã¥È¤ò¥ê¥»¥Ã¥È¤¹¤ë¡£ +T} +.TE +.PP +.B "ECMA-48 CSI ¥·¡¼¥±¥ó¥¹" +.sp +CSI (¤Þ¤¿¤Ï ESC [ ) ¤Î¤¢¤È¤Ë¡¢ºÇÂç¤Ç NPAR (16) ¸Ä¤Î¥»¥ß¥³¥í¥ó¤Ç¶èÀÚ¤é¤ì¤¿ +10 ¿Ê¿ô¤Î¥Ñ¥é¥á¡¼¥¿¥·¡¼¥±¥ó¥¹¤¬Â³¤¯¡£ +¶õ¤Ç¤¢¤ë¤«¤½¤³¤Ë¤Ê¤¤¥Ñ¥é¥á¡¼¥¿¤Ï 0 ¤È¤µ¤ì¤ë¡£ +¥Ñ¥é¥á¡¼¥¿¥·¡¼¥±¥ó¥¹¤ÎÁ°¤Ë¤Ï¤Ò¤È¤Ä¤Î¥¯¥¨¥¹¥Á¥ç¥ó¥Þ¡¼¥¯¤¬¤Ä¤¯¤³¤È¤¬¤¢¤ë¡£ +.PP +¤·¤«¤·¡¢CSI [ (¤Þ¤¿¤Ï ESC [ [ ) ¤Î¸å¤Ç¤Ï¡¢°ìʸ»ú¤¬Æɤޤ졢¤³¤Î¤¹¤Ù¤Æ¤Î +¥Ñ¥é¥á¡¼¥¿¥·¡¼¥±¥ó¥¹¤¬Ìµ»ë¤µ¤ì¤ë(Íפ¹¤ë¤Ë¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Î¥¨¥³¡¼¤Ï +̵»ë¤µ¤ì¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë)¡£ +.PP +CSI ¥·¡¼¥±¥ó¥¹¤ÎÆ°ºî¤Ï¡¢¤½¤ÎºÇ¸å¤Îʸ»ú¤Ë¤è¤Ã¤Æ·è¤Þ¤ë¡£ +.TS +l l l. +@ ICH »Ø¼¨¤µ¤ì¤¿¿ô¤Î¶õÇòʸ»ú¤òÁÞÆþ¤¹¤ë¡£ +A CUU »Ø¼¨¤µ¤ì¤¿¿ô¤À¤±¥«¡¼¥½¥ë¤ò¾åÊý¸þ¤Ë°ÜÆ°¤¹¤ë¡£ +B CUD ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¿ô¤Î¹Ô¤À¤±²¼Êý¸þ¤Ë°ÜÆ°¤¹¤ë¡£ +C CUF ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¿ô¤Î·å¤À¤±±¦¤Ë°ÜÆ°¤¹¤ë¡£ +D CUB ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¿ô¤Î·å¤À¤±º¸¤Ë°ÜÆ°¤¹¤ë¡£ +E CNL ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¿ô¤Î¹Ô¤À¤±²¼¤ÎÂè 1 ·å¤Ë°ÜÆ°¤¹¤ë¡£ +F CPL ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¿ô¤Î¹Ô¤À¤±¾å¤ÎÂè 1 ·å¤Ë°ÜÆ°¤¹¤ë¡£ +G CHA ¥«¡¼¥½¥ë¤ò¸½ºß¤Î¹Ô¤Î»Ø¼¨¤µ¤ì¤¿·å¤Ë°ÜÆ°¤¹¤ë¡£ +H CUP ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¹Ô¡¢·å(1,1¤ò¸¶ÅÀ¤È¤¹¤ë)¤Ë + °ÜÆ°¤¹¤ë¡£ +J ED ¥Ç¥£¥¹¥×¥ì¥¤¤Î¾Ãµî(¥Ç¥Õ¥©¥ë¥È: ¥«¡¼¥½¥ë¤«¤é¥Ç¥£¥¹¥×¥ì¥¤¤Î + ºÇ¸å¤Þ¤Ç)¡£ + ESC [ 1 J: ºÇ½é¤«¤é¥«¡¼¥½¥ë¤Þ¤Ç¤Î¾Ãµî¡£ + ESC [ 2 J: ¥Ç¥£¥¹¥×¥ì¥¤Á´ÂΤξõ +K EL ¹Ô¤Î¾Ãµî(¥Ç¥Õ¥©¥ë¥È: ¥«¡¼¥½¥ë¤«¤é¹ÔËö¤Þ¤Ç)¡£ + ESC [ 1 K: ¹ÔƬ¤«¤é¥«¡¼¥½¥ë¤Þ¤Ç¤Î¾Ãµî¡£ + ESC [ 2 K: ¹ÔÁ´ÂΤξõ +L IL »Ø¼¨¤µ¤ì¤¿¿ô¤Î¶õ¹Ô¤òÁÞÆþ¤¹¤ë¡£ +M DL »Ø¼¨¤µ¤ì¤¿¿ô¤Î¹Ô¤òºï½ü¤¹¤ë¡£ +P DCH ¸½ºß¤Î¹Ô¤«¤é»Ø¼¨¤µ¤ì¤¿¿ô¤Îʸ»ú¤òºï½ü¤¹¤ë¡£ +X ECH ¸½ºß¤Î¹Ô¤«¤é»Ø¼¨¤µ¤ì¤¿¿ô¤Îʸ»ú¤ò¾Ãµî¤¹¤ë¡£ +a HPR ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¿ô¤Î·å¤À¤±±¦¤Ë°ÜÆ°¤¹¤ë¡£ +c DA ESC [ ? 6 c ¤òÊÖ¤¹: "»ä¤ÏVT102¤Ç¤¹"(¤È¤¤¤¦¤³¤È)¡£ +d VPA ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¹Ô¤Î¸½ºß¤Î·å¤Ë°ÜÆ°¤¹¤ë¡£ +e VPR ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¹Ô¿ô¤À¤±²¼¤Ë°ÜÆ°¤¹¤ë¡£ +f HVP ¥«¡¼¥½¥ë¤ò»Ø¼¨¤µ¤ì¤¿¹Ô¡¢·å¤Ë°ÜÆ°¤¹¤ë¡£ +g TBC ¥Ñ¥é¥á¡¼¥¿¤Ê¤·¤Î»þ: ¸½ºß°ÌÃ֤Υ¿¥Ö¥¹¥È¥Ã¥×¤òºï½ü¤¹¤ë¡£ + ESC [ 3 g: ¤¹¤Ù¤Æ¤Î¥¿¥Ö¥¹¥È¥Ã¥×¤òºï½ü¤¹¤ë¡£ +h SM ¥â¡¼¥É¤Î¥»¥Ã¥È(¸å½Ò)¡£ +l RM ¥â¡¼¥É¤Î¥ê¥»¥Ã¥È(¸å½Ò)¡£ +m SGR °À­¤Î¥»¥Ã¥È(¸å½Ò)¡£ +n DSR ¾õÂÖ¤ÎÊó¹ð(¸å½Ò)¡£ +q DECLL ¥­¡¼¥Ü¡¼¥É¤Î LED ¤ò¥»¥Ã¥È¤¹¤ë¡£ + ESC [ 0 q: ¤¹¤Ù¤Æ¤Î LED ¤ò¾Ã¤¹¡£ + ESC [ 1 q: ¥¹¥¯¥í¡¼¥ë¥í¥Ã¥¯ LED ¤òÅÀÅô¡£ + ESC [ 2 q: ¥Ê¥ó¥Ð¡¼¥í¥Ã¥¯ LED ¤òÅÀÅô¡£ + ESC [ 3 q: ¥­¥ã¥Ô¥¿¥ë¥í¥Ã¥¯ LED ¤òÅÀÅô¡£ +r DECSTBM ¥¹¥¯¥í¡¼¥ë¤ÎÈϰϤΥ»¥Ã¥È; ¥Ñ¥é¥á¡¼¥¿¤Ï°ìÈÖ¾å¤Î¹Ô¤È + °ìÈÖ²¼¤Î¹Ô¡£ +s ? ¥«¡¼¥½¥ë°ÌÃÖ¤ÎÊݸ¡£ +u ? ¥«¡¼¥½¥ë°ÌÃÖ¤ÎÉüµ¢¡£ +\` HPA ¥«¡¼¥½¥ë¤ò¸½ºß¤Î¹Ô¤Î»Ø¼¨¤µ¤ì¤¿·å¤Ë°ÜÆ°¤¹¤ë¡£ +.TE +.PP +.B "ECMA-48 ¥°¥é¥Õ¥£¥¯¥¹¥ì¥ó¥Ç¥£¥·¥ç¥ó(Graphics Rendition)¤ÎÀßÄê" +.sp +ECMA-48 SGR ¥·¡¼¥±¥ó¥¹ ESC [ <¥Ñ¥é¥á¡¼¥¿> m ¤Ïɽ¼¨Â°À­¤òÀßÄꤹ¤ë¡£ +¥»¥ß¥³¥í¥ó¤Ç¶èÀڤ뤳¤È¤Ç¡¢Æ±¤¸¥·¡¼¥±¥ó¥¹¤Ç¤¤¤¯¤Ä¤«¤Î°À­¤òÀßÄê¤Ç¤­¤ë¡£ +¶õ¥Ñ¥é¥á¡¼¥¿(¥»¥ß¥³¥í¥ó¤«Ê¸»úÎ󳫻Ïʸ»ú¤«Ê¸»úÎó½ªÃ¼Ê¸»ú¤Î´Ö)¤Ï¥¼¥í¤È²ò¼á¤µ¤ì¤ë¡£ +.TS +l l. +¥Ñ¥é¥á¡¼¥¿ ·ë²Ì +0 ¤¹¤Ù¤Æ¤Î°À­¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤¹¤ë¡£ +1 ¥Ü¡¼¥ë¥É(bold)¤ò¥»¥Ã¥È¡£ +2 ¥Ï¡¼¥Õ¥Ö¥é¥¤¥È(half-bright)(¥«¥é¡¼¥Ç¥£¥¹¥×¥ì¥¤¤Ç¤Ï¿§¤ÇÂåÍÑ)¤ò + ¥»¥Ã¥È¡£ +4 T{ +²¼Àþ(underscore)¤ò¥»¥Ã¥È(¥«¥é¡¼¥Ç¥£¥¹¥×¥ì¥¤¤Ç¤Ï¿§¤ÇÂåÍÑ)¡£ +(¥Ç¥£¥à¤ä²¼Àþ¤òÂåÍѤ¹¤ë¤Î¤Ë»È¤ï¤ì¤ë¿§¤Ï ESC ] ... ¤Ë¤è¤ê¥»¥Ã¥È) +T} +5 ÅÀÌÇ(blink)¤ò¥»¥Ã¥È¡£ +7 ȿžɽ¼¨(reverce video)¤ò¥»¥Ã¥È¡£ +10 T{ +ÁªÂò¤·¤¿¥Þ¥Ã¥Ô¥ó¥°¡¢¥Ç¥£¥¹¥×¥ì¥¤¥³¥ó¥È¥í¡¼¥ë¥Õ¥é¥°(display +control flag)¡¢¥È¥°¥ë¥á¥¿¥Õ¥é¥°(toggle meta flag)¤ò¥ê¥»¥Ã¥È¤¹¤ë +(ECMA-48¤Ç¤Ï"primary font"¤È¸Æ¤ó¤Ç¤¤¤ë)¡£ +T} +11 T{ +¥Ì¥ë¥Þ¥Ã¥Ô¥ó¥°¤òÁªÂò¡¢¥Ç¥£¥¹¥×¥ì¥¤¥³¥ó¥È¥í¡¼¥ë¥Õ¥é¥°¤ò¥»¥Ã¥È¡¢ +¥È¥°¥ë¥á¥¿¥Õ¥é¥°¤ò¥ê¥»¥Ã¥È¤¹¤ë +(ECMA-48 ¤Ç¤Ï"first alternate font"¤È¸Æ¤ó¤Ç¤¤¤ë)¡£ +T} +12 T{ +¥Ì¥ë¥Þ¥Ã¥Ô¥ó¥°¤òÁªÂò¡¢¥Ç¥£¥¹¥×¥ì¥¤¥³¥ó¥È¥í¡¼¥ë¥Õ¥é¥°¡¢ +¥È¥°¥ë¥á¥¿¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë +(ECMA-48 ¤Ç¤Ï "second alternate font" ¤È¸Æ¤ó¤Ç¤¤¤ë)¡£ +¥È¥°¥ë¥á¥¿¥Õ¥é¥°¤¬¤¿¤Ã¤Æ¤¤¤ë¤È¡¢ +¥Þ¥Ã¥Ô¥ó¥°¥Æ¡¼¥Ö¥ë¤Ë¤è¤ëÊÑ´¹¤ò¤¹¤ëÁ°¤Ë¡¢¥Ð¥¤¥È¤Î¾å°Ì¤Î1¥Ó¥Ã¥È¤¬ +¥È¥°¥ë¤µ¤ì¤ë¡£ +T} +21 Ä̾ï¤Îµ±Å٤˥»¥Ã¥È(ECMA-48 ¤Ç¤Ï "doubly underlined" ¤È¸Æ¤ó¤Ç¤¤¤ë)¡£ +22 Ä̾ï¤Îµ±Å٤˥»¥Ã¥È¡£ +24 ²¼Àþ¥ª¥Õ¡£ +25 ÅÀÌÇ¥ª¥Õ¡£ +27 ȿžɽ¼¨¥ª¥Õ¡£ +30 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É(foreground)¤ò¹õ¤Ë¥»¥Ã¥È¡£ +31 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤òÀ֤˥»¥Ã¥È¡£ +32 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤òÎФ˥»¥Ã¥È¡£ +33 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤òÃã¤Ë¥»¥Ã¥È¡£ +34 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤òÀĤ˥»¥Ã¥È¡£ +35 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤ò¥Þ¥¼¥ó¥À¤Ë¥»¥Ã¥È¡£ +36 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤ò¥·¥¢¥ó¤Ë¥»¥Ã¥È¡£ +37 ¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤òÇò¤Ë¥»¥Ã¥È¡£ +38 ²¼Àþɽ¼¨¤ËÀßÄꤷ¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¥»¥Ã¥È¡£ +39 ²¼Àþɽ¼¨¤ò²ò½ü¤·¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¥»¥Ã¥È¡£ +40 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É(background)¤ò¹õ¤Ë¥»¥Ã¥È¡£ +41 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤òÀ֤˥»¥Ã¥È¡£ +42 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤òÎФ˥»¥Ã¥È¡£ +43 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤òÃã¤Ë¥»¥Ã¥È¡£ +44 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤òÀĤ˥»¥Ã¥È¡£ +45 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤ò¥Þ¥¼¥ó¥À¤Ë¥»¥Ã¥È¡£ +46 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤ò¥·¥¢¥ó¤Ë¥»¥Ã¥È¡£ +47 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤òÇò¤Ë¥»¥Ã¥È¡£ +49 ¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¥»¥Ã¥È¡£ +.TE +.PP +.B "ECMA-48 ¥â¡¼¥É¥¹¥¤¥Ã¥Á(Mode Switches)" +.TP +ESC [ 3 h +DECCRM (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥ª¥Õ): ¥³¥ó¥È¥í¡¼¥ëʸ»ú¤òɽ¼¨¤¹¤ë¡£ +.TP +ESC [ 4 h +DECIM (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥ª¥Õ): ÁÞÆþ¥â¡¼¥É¤Ë¤¹¤ë¡£ +.TP +ESC [ 20 h +LF/NL (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥ª¥Õ): LF, VT, FF¤ò¥¨¥³¡¼¤·¤¿¤¢¤È¼«Æ°Åª CR ¤ò¤Ä¤±¤ë¡£ +.\" +.PP +.B "ECMA-48 ¾õÂÖ¥ê¥Ý¡¼¥È¥³¥Þ¥ó¥É(Status Report Commands)" +.\" +.TP +ESC [ 5 n +¥Ç¥Ð¥¤¥¹¾õÂ֤Υê¥Ý¡¼¥È(DSR): ÊÖ»ö¤Ï ESC [ 0 n (üËö OK). +.TP +ESC [ 6 n +¥«¡¼¥½¥ë°ÌÃ֤Υê¥Ý¡¼¥È(CPR): ÊÖ»ö¤Ï ESC [ \fIy\fP ; \fIx\fP R¡¢ +\fIx,y\fP ¤Ï¥«¡¼¥½¥ë¤Î°ÌÃÖ¤ò¤¢¤é¤ï¤¹¡£ +.\" +.PP +.B "DEC ¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É (DECSET/DECRST) ¥·¡¼¥±¥ó¥¹" +.sp +.\" +¤³¤ì¤é¤Ï ECMA-48 ¤Ç¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¡£¤³¤³¤Ç¤Ï¡¢¥»¥Ã¥È¥â¡¼¥É +¥·¡¼¥±¥ó¥¹ (Set Mode sequences)¤òµ­ºÜ¤¹¤ë; ºÇ¸å¤Î \(aqh\(aq ¤ò \(aql\(aq ¤Ë +ÃÖ¤­´¹¤¨¤ë¤È¥ê¥»¥Ã¥È¥â¡¼¥É¥·¡¼¥±¥ó¥¹(Reset Mode sequences)¤Ë¤Ê¤ë¡£ +.TP +ESC [ ? 1 h +DECCKM (¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥Õ): ¥»¥Ã¥È¤µ¤ì¤¿»þ¤Ë¤Ï¥«¡¼¥½¥ë¥­¡¼¤Ï ESC [ ¤Ç¤Ï¤Ê¤¯ +ESC O ¤òÁ°¤Ë¤Ä¤±¤ÆÁ÷¤ë¡£ +.TP +ESC [ ? 3 h +DECCOLM (¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥Õ = 80 ·å): 80/132 ¤Î·å¥â¡¼¥ÉÀÚÂؤ¨¡£ +¥É¥é¥¤¥Ð¡¼¤Î¥½¡¼¥¹¤ÎÃí¼á¤Ë¤Ï¡¢¤³¤ì¤À¤±¤Ç¤Ï½½Ê¬¤Ç¤Ê¤¯ +.BR resizecons (8) +¤Î¤è¤¦¤Ê¥æ¡¼¥¶¡¼¥â¡¼¥É¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡¼¤Ç¡¢¥³¥ó¥½¡¼¥ë¥Ó¥Ç¥ª¥«¡¼¥É¤Î +¥Ï¡¼¥É¥¦¥§¥¢¥ì¥¸¥¹¥¿¤òÊѤ¨¤ëɬÍפ¬¤¢¤ë¤È½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +ESC [ ? 5 h +DECSCNM (¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥Õ): ȿžɽ¼¨¥â¡¼¥É¤Î¥»¥Ã¥È¡£ +.TP +ESC [ ? 6 h +DECOM(¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥Õ): ¥»¥Ã¥È¤µ¤ì¤¿»þ¤Ë¤Ï¡¢¥«¡¼¥½¥ë¤Î¥¢¥É¥ì¥Ã¥·¥ó¥°¤¬¡¢ +¥¹¥¯¥í¡¼¥ëÈϰϤκ¸¾å¶ù¤«¤é¤ÎÁêÂаÌÃ֤ˤʤ롣 +.TP +ESC [ ? 7 h +DECAWM(¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥ó): ¥ª¡¼¥È¥é¥Ã¥×¤òÀßÄê¡£¤³¤Î¥â¡¼¥É¤Î»þ¤Ï¡¢80 ·å +(DECCOLM ¤¬¥ª¥ó¤Î¤È¤­¤Ï 132 ·å)¤òĶ¤¨¤¿¥°¥é¥Õ¥£¥Ã¥¯¥­¥ã¥é¥¯¥¿¤Ï¡¢ +¶¯À©Åª¤Ë¼¡¤Î¹Ô¤ÎÀèƬ¤ËÀÞ¤êÊÖ¤µ¤ì¤Æɽ¼¨¤µ¤ì¤ë¡£ +.TP +ESC [ ? 8 h +DECARM(¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥ó): ¥­¡¼¥Ü¡¼¥É¤Î¥ª¡¼¥È¥ê¥Ô¡¼¥È¤ò¥ª¥ó¤Ë¥»¥Ã¥È¡£ +.TP +ESC [ ? 9 h +X10 ¥Þ¥¦¥¹¥ê¥Ý¡¼¥È(¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥Õ): ¥ê¥Ý¡¼¥È¥â¡¼¥É¤ò 1 ¤Ë¥»¥Ã¥È(¤Þ¤¿¤Ï¡¢ +0 ¤Ë¥ê¥»¥Ã¥È) \(em ¸å½Ò +.TP +ESC [ ? 25 h +DECTECM (¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥ó): ¥«¡¼¥½¥ë¤ò²Ä»ë(visible)¤Ë¤¹¤ë¡£ +.TP +ESC [ ? 1000 h +X11 ¥Þ¥¦¥¹¥ê¥Ý¡¼¥È(¥Ç¥Õ¥©¥ë¥È¤Ï¥ª¥Õ): ¥ê¥Ý¡¼¥È¥â¡¼¥É¤ò 2 ¤Ë¥»¥Ã¥È(¤Þ¤¿¤Ï¡¢ +0¤Ë¥ê¥»¥Ã¥È) \(em ¸å½Ò +.\" +.PP +.B "Linux ¥³¥ó¥½¡¼¥ë¥×¥é¥¤¥Ù¡¼¥È CSI ¥·¡¼¥±¥ó¥¹" +.sp +.\" +°Ê²¼¤Î¥·¡¼¥±¥ó¥¹¤Ï ECMA-48 ¤Î¤â¤Î¤Ç¤âËÜÍè¤Î VT102 ¤Î¤â¤Î¤Ç¤â¤Ç¤â¤Ê¤¯¡¢ +Linux¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð¡¼¤Ë¸ÇÍ­¤Ê¥·¡¼¥±¥ó¥¹¤Ç¤¢¤ë¡£¿§¤Ï SGR ¥Ñ¥é¥á¡¼¥¿¤Ç +ɽ¸½¤µ¤ì¤ë: 0 = ¹õ, 1= ÀÖ, 2 = ÎÐ, 3 = Ãã, 4 = ÀÄ, 5 = ¥Þ¥¼¥ó¥¿, +6 = ¥·¥¢¥ó, 7 = Çò +.TS +l l. +ESC [ 1 ; \fIn\fP ] ²¼Àþ¤Î¿§¤ò\fIn\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC [ 2 ; \fIn\fP ] ¥Ç¥£¥à¤Î¿§¤ò\fIn\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC [ 8 ] ¸½ºß¤Î¿§¤Î¥Ú¥¢¤ò¥Ç¥Õ¥©¥ë¥È°À­¤Ë¤¹¤ë¡£ +ESC [ 9 ; \fIn\fP ] ¥¹¥¯¥ê¡¼¥ó¥Ö¥é¥ó¥¯(screen blank)¤Î¥¿¥¤¥à¥¢¥¦¥È + ¤ò \fIn\fP ʬ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC [ 10 ; \fIn\fP ] ¥Ù¥ë¤Î¼þÇÈ¿ô(Hz)¤ò¥»¥Ã¥È¤¹¤ë¡£ +ESC [ 11 ; \fIn\fP ] ¥Ù¥ë¤ÎÌĤäƤ¤¤ë»þ´Ö(msec)¤ò¥»¥Ã¥È¤¹¤ë¡£ +ESC [ 12 ; \fIn\fP ] »ØÄê¤Î¥³¥ó¥½¡¼¥ë¤òÁ°Ì̤˻ý¤Ã¤Æ¤¯¤ë¡£ +ESC [ 13 ] ¥¹¥¯¥ê¡¼¥ó¤ò¥¢¥ó¥Ö¥é¥ó¥¯(Unblank)¤¹¤ë¡£ +ESC [ 14 ] VESAÅŸ»Ää»ß¥¤¥ó¥¿¡¼¥Ð¥ë(VESA powerdown + interval)¤ò¥»¥Ã¥È¤¹¤ë¡£ +.TE +.SS ʸ»ú½¸¹ç +¥«¡¼¥Í¥ë¤Ï¡¢¥Ð¥¤¥ÈÎ󤫤饳¥ó¥½¡¼¥ë¥¹¥¯¥ê¡¼¥óÉä¹æ¤ÎÊÑ´¹¤ò 4 ¤Ä +ÃΤäƤ¤¤ë¡£ +4 ¤Ä¤ÎÊÑ´¹¥Æ¡¼¥Ö¥ë¤È¤Ï¡¢a) Latin1 \-> PC, b) VT100 graphics \-> PC, +c) PC \-> PC, d) ¥æ¡¼¥¶¡¼ÄêµÁ, ¤Ç¤¢¤ë¡£ +.PP +G0 ¤È G1 ¤È¸Æ¤Ð¤ì¤ëÆó¤Ä¤Îʸ»ú½¸¹ç¤¬¤¢¤ê¡¢¤½¤Î¤¦¤Á°ì¤Ä¤¬¸½ºß¤Î +ʸ»ú½¸¹ç¤Ç¤¢¤ë(½é´üÃÍ¤Ï G0 )¡£ +\fB^N\fP ¤ò¥¿¥¤¥×¤¹¤ë¤È G1 ¤¬ \fB^O\fP ¤òÆþÎϤ¹¤ë¤È G0 ¤¬¸½ºß¤Îʸ»ú½¸¹ç¤Ë¤Ê¤ë¡£ +.PP +ÊÑ¿ô G0 ¤È G1 ¤ÏÊÑ´¹¥Æ¡¼¥Ö¥ë¤ò»Ø¤·¤Æ¤ª¤ê¡¢¥æ¡¼¥¶¡¼¤Ë¤è¤êÊѹ¹¤Ç¤­¤ë¡£ +ºÇ½é¤Ï¤½¤ì¤¾¤ì¥Æ¡¼¥Ö¥ë a) ¤È ¥Æ¡¼¥Ö¥ë b) ¤ò»Ø¤·¤Æ¤¤¤ë¡£ +ESC ( B ¡¢ ESC ( 0 ¡¢ ESC ( U ¡¢ ESC ( K ¤Î¤½¤ì¤¾¤ì¤Î¥·¡¼¥±¥ó¥¹¤Ë¤è¤ê¡¢ +G0 ¤¬ÊÑ´¹¥Æ¡¼¥Ö¥ë a)¡¢ b)¡¢ c)¡¢ d) ¤ò»Ø¤¹¤è¤¦¤Ë¤Ê¤ë¡£ +¤Þ¤¿¡¢ESC ) B ¡¢ ESC ) 0 ¡¢ ESC ) U ¡¢ ESC ) K ¤Î¤½¤ì¤¾¤ì¤Î¥·¡¼¥±¥ó¥¹ +¤Ë¤è¤ê¡¢G1 ¤¬ÊÑ´¹¥Æ¡¼¥Ö¥ë a)¡¢ b)¡¢ c)¡¢ d) ¤ò»Ø¤¹¤è¤¦¤Ë¤Ê¤ë¡£ +.PP +ESC c ¤Î¥·¡¼¥±¥ó¥¹¤ÏüËö¤ò¥ê¥»¥Ã¥È¤¹¤ë¡£¥¹¥¯¥ê¡¼¥ó¤¬¤á¤Á¤ã¤¯¤Á¤ã¤Ë¤Ê¤Ã¤¿ +»þ¤Ë¤½¤¦¤¹¤ë¤³¤È¤¬É¬ÍפǤ¢¤ë¡£¤è¤¯¥¢¥É¥Ð¥¤¥¹¤µ¤ì¤ë "echo ^V^O" ¤Ï G0 +¤ò¸½ºß¤Îʸ»ú½¸¹ç¤Ë¤¹¤ë¤À¤±¤Ç¤¢¤ê¡¢G0 ¤¬¥Æ¡¼¥Ö¥ë a) ¤ò»Ø¤·¤Æ¤¤¤ë¤È¤¤¤¦ +ÊݾڤϤʤ¤¡£ +¤¤¤¯¤Ä¤«¤Î¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ë¤Ï¡¢ +.BR reset (1) +¤È¤¤¤¦¥×¥í¥°¥é¥à¤¬´Þ¤Þ¤ì¤ë¤¬¡¢¤³¤ì¤Ï¤¿¤À "echo ^[c" ¤ò¼Â¹Ô¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤â¤·¡¢¥³¥ó¥½¡¼¥ë¤Î terminfo ¥¨¥ó¥È¥ê¡¼¤¬Àµ¤·¤¤(¤«¤Ä rs1=\\Ec ¤Î¥¨¥ó¥È¥ê¡¼¤¬ +¤¢¤ë)¤Ê¤é¤Ð¡¢"tput reset"¤Ç¤âƱ¤¸¸ú²Ì¤¬¤¢¤ë¡£ +.PP +¥æ¡¼¥¶¡¼ÄêµÁ¤Î¥Þ¥Ã¥Ô¥ó¥°¥Æ¡¼¥Ö¥ë¤Ï +.BR mapscrn (8) +¤ò»È¤Ã¤ÆÄêµÁ¤Ç¤­¤ë¡£ +¥Þ¥Ã¥Ô¥ó¥°¤Î·ë²Ì¡¢¥·¥ó¥Ü¥ë c ¤¬°õ»ú¤µ¤ì¤ë¤È¥·¥ó¥Ü¥ë s = map[c] ¤¬ +¥Ó¥Ç¥ª¥á¥â¥ê¤ËÁ÷¤é¤ì¤ë¡£s ¤ËÂбþ¤¹¤ë¥Ó¥Ã¥È¥Þ¥Ã¥×¤Ï¥­¥ã¥é¥¯¥¿¡¼ ROM ¤Ë¤¢¤ê¡¢ +.BR setfont (8) +¤Ë¤è¤êÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +.SS ¥Þ¥¦¥¹¥È¥é¥Ã¥­¥ó¥° +¥Þ¥¦¥¹¥È¥é¥Ã¥­¥ó¥°µ¡Ç½¤Ï¡¢ +.BR xterm (1)-¸ß´¹¤Î +¥Þ¥¦¥¹¥¹¥Æ¡¼¥¿¥¹¥ê¥Ý¡¼¥È(mouse +status reports)¤òÊÖ¤µ¤»¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð¡¼¤Ï¥Þ¥¦¥¹¤Î¥Ç¥Ð¥¤¥¹¤ä¼ïÎà¤Ë¤Ä¤¤¤ÆÃΤëÊýË¡¤¬ +¤Ê¤¤¤Î¤Ç¡¢²¾ÁÛ¥¿¡¼¥ß¥Ê¥ë¥É¥é¥¤¥Ð¡¼¤¬¥Þ¥¦¥¹¹¹¿·¤Î ioctl ¤ò¼õ¤±¼è¤Ã¤¿»þ¤À¤±¡¢ +¥Þ¥¦¥¹¥¹¥Æ¡¼¥¿¥¹¥ê¥Ý¡¼¥È¤¬¥³¥ó¥½¡¼¥ë¤ÎÆþÎÏ¥¹¥È¥ê¡¼¥à¤ËÁ÷¤é¤ì¤ë¡£ +¤³¤Î ioctl ¤Ï¡¢ +.BR gpm (8) +¥Ç¡¼¥â¥ó¤Î¤è¤¦¤Ê¥Þ¥¦¥¹Âбþ¤Î¥æ¡¼¥¶¡¼¥â¡¼¥É +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬È¯À¸¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +\fBxterm\fP(1) ¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤ëÁ´¤Æ¤Î¥Þ¥¦¥¹ÄÉÀ×¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤Î¤¿¤á¤Î +¥Ñ¥é¥á¡¼¥¿¤Ï¡¢¿ôÃͤò \fIvalue\fP+040 ¤Î¤è¤¦¤ËÉä¹æ²½¤·¡¢°ì¤Ä¤Îʸ»ú¤È¤·¤Æ +¤¢¤é¤ï¤¹¡£ +Î㤨¤Ð¡¢\(aq!\(aq ¤Ï 1 ¤Ë¤Ê¤ë¡£¥¹¥¯¥ê¡¼¥óºÂɸ¤Ï 1 ¤ò¥Ù¡¼¥¹¤Ë¤¹¤ë¡£ +.PP +X10 ¸ß´¹¥â¡¼¥É¤Ç¤Ï¡¢¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿»þ¤Ë¥Þ¥¦¥¹¤Î°ÌÃ֤Ȳ¡¤µ¤ì¤¿¥Þ¥¦¥¹¤Î +¥Ü¥¿¥ó¤È¤ò¥¨¥ó¥³¡¼¥É¤·¤¿¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤òÁ÷¤ë¡£ +¤³¤Îµ¡Ç½¤Ï ESC [ ? 9 h ¤òÁ÷¤ë¤ÈÍ­¸ú¤Ë¤Ê¤ê ESC [ ? 9 l ¤Ë¤è¤ê̵¸ú¤Ë¤Ê¤ë¡£ +¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤ë¤È \fBxterm\fP(1) ¤Ï ESC [ M \fIbxy\fP (¤Î 6 ʸ»ú)¤òÁ÷¤ë¡£ +¤³¤³¤Ç \fIb\fP ¤Ï button\-1, \fIx\fP ¤È \fIy\fP ¤Ï ¥Þ¥¦¥¹¤¬¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿ +»þ¤Î x ¤È y ºÂɸ¤Ç¤¢¤ë¡£ +¤³¤Î¥³¡¼¥É¤Ï¥«¡¼¥Í¥ë¤¬È¯À¸¤¹¤ë¤Î¤ÈƱ¤¸¥³¡¼¥É¤Ç¤¢¤ë¡£ +.PP +¥Î¡¼¥Þ¥ë¥È¥é¥Ã¥­¥ó¥°¥â¡¼¥É(Normal tracking mode)(Linux 2.0.24 ¤Ç¤Ï +¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤)¤Ç¤Ï¡¢Î¾Êý¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿¤«Î¥¤µ¤ì¤¿»þ¤Ë +¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤¬Á÷¤é¤ì¤ë¡£ +¥â¥Ç¥£¥Õ¥¡¥¤¥¢¤Î¾ðÊó¤â°ì½ï¤ËÁ÷¤é¤ì¤ë¡£ +¤³¤Îµ¡Ç½¤Ï¡¢ESC [ ? 1000 h ¤òÁ÷¤ë¤ÈÍ­¸ú¤Ë¤Ê¤ê ESC [ ? 1000 l ¤Ç̵¸ú¤Ë¤Ê¤ë¡£ +¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤ë¤«Î¥¤µ¤ì¤ë¤«¤·¤¿»þ¤Ë¤Ï¡¢\fBxterm\fP(1) ¤Ï ESC [ M +\fIbxy\fP ¤òÁ÷¤ë¡£ +\fIb\fP ¤ÎÄã°Ì¤Î2¥Ó¥Ã¥È¤Ë¤Ï¥Ü¥¿¥ó¾ðÊ󤬥¨¥ó¥³¡¼¥É¤µ¤ì¤ë: +0=MB1 ¤¬²¡¤µ¤ì¤¿, 1=MB2 ¤¬²¡¤µ¤ì¤¿, 2=MB3 ¤¬²¡¤µ¤ì¤¿, 3=Î¥¤µ¤ì¤¿¡£ +¹â°Ì¤Î¥Ó¥Ã¥È¤Ë¤Ï¡¢¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿»þ¤Ë¤É¤Î¥â¥Ç¥£¥Õ¥¡¥¤¥¢¤¬¥À¥¦¥ó¤·¤Æ¤¤¤¿¤«¤¬ +¥¨¥ó¥³¡¼¥É¤µ¤ì¤ë: 4=Shift, 8=Meta, 16=Control¡£ +¤½¤·¤Æ¡¢¾å°Ì¤È²¼°Ì¥Ó¥Ã¥È¤¬²Ã»»¤µ¤ì¤ë¡£ +¤³¤³¤Ç¤â \fIx\fP ¤È \fIy\fP ¤Ï¡¢¥Þ¥¦¥¹¥¤¥Ù¥ó¥È¤¬µ¯¤³¤Ã¤¿»þ¤Î +x ¤È y ºÂɸ¤Ç¤¢¤ê¡¢º¸¾å¤Î¶ù¤¬(1,1)¤Ç¤¢¤ë¡£ +.SS ¾¤Î¥¿¡¼¥ß¥Ê¥ë¤È¤ÎÈæ³Ó +¿¤¯¤Î°Û¤Ê¤ë¥¿¡¼¥ß¥Ê¥ë¥¿¥¤¥×¤¬¡¢Linux ¥³¥ó¥½¡¼¥ë¤Î¤è¤¦¤Ë¡¢"VT100¸ß´¹"¤ò +̾¾è¤Ã¤Æ¤¤¤ë¡£ +¤³¤³¤Ç¤Ï¡¢Linux ¥³¥ó¥½¡¼¥ë¤È 2 ¤Ä¤ÎºÇ¤â½ÅÍפʥ¿¡¼¥ß¥Ê¥ë¤Ç¤¢¤ë +DEC VT102 ¤È +.BR xterm (1) +¤È¤Î°ã¤¤¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤ë¡£ +.\" +.PP +.B ¥³¥ó¥È¥í¡¼¥ëʸ»ú¤Î¼è¤ê°·¤¤ +.sp +VT102 ¤Ï°Ê²¼¤Î¥³¥ó¥È¥í¡¼¥ëʸ»ú¤âǧ¼±¤¹¤ë: +.HP +NUL (0x00) ¤Ï̵»ë¤µ¤ì¤ë; +.HP +ENQ (0x05) ¤Ï¥¢¥ó¥µ¡¼¥Ð¥Ã¥¯¥á¥Ã¥»¡¼¥¸(answerback message)¤òȯÀ¸¤¹¤ë; +.HP +DC1 (0x11, \fB^Q\fP, XON) ¤ÏÁ÷¿®¤òºÆ³«¤¹¤ë; +.HP +DC3 (0x13, \fB^S\fP, XOFF) ¤Ï VT100 ¤Ë XOFF ¤È XON °Ê³°¤Î¥³¡¼¥É¤ò̵»ë(¤½¤·¤Æ +Á÷¿®¤ÎÄä»ß)¤òµ¯¤³¤µ¤»¤ë¡£ +.LP +tty ¥É¥é¥¤¥Ð¡¼¤Ë¤è¤ê VT100 ¤Ë»÷¤¿ DC1/DC3 ½èÍý¤ò¤Ç¤­¤ë¡£ +.LP +.BR xterm (1) +(VT100 ¥â¡¼¥É)¤Ï BEL, BS, HT, LF, VT, FF, CR, SO, SI, ESC ¤Î +¥³¥ó¥È¥í¡¼¥ëʸ»ú¤òǧ¼±¤¹¤ë¡£ +.\" +.PP +.B ¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ +.sp +Linux ¥³¥ó¥½¡¼¥ë¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤ VT100 ¥³¥ó¥½¡¼¥ë¥·¡¼¥±¥ó¥¹¤Ï°Ê²¼¤ÎÄ̤ê: +.TS +l l l. +ESC N SS2 ¥·¥ó¥°¥ë¥·¥Õ¥È 2 + (¼¡¤Îʸ»ú¤À¤± G2 ʸ»ú½¸¹ç¤òÁªÂò¤¹¤ë)¡£ +ESC O SS3 ¥·¥ó¥°¥ë¥·¥Õ¥È 3 + (¼¡¤Îʸ»ú¤À¤± G3 ʸ»ú½¸¹ç¤òÁªÂò¤¹¤ë)¡£ +ESC P DCS ¥Ç¥Ð¥¤¥¹À©¸æʸ»úÎó (ESC \\ ¤Ç½ª¤ï¤ë) +ESC X SOS ʸ»úÎó¤Î»Ï¤Þ¤ê¡£ +ESC ^ PM ¥×¥é¥¤¥Ð¥·¡¼¥á¥Ã¥»¡¼¥¸(ESC \\ ¤Ç½ª¤ï¤ë)¡£ +ESC \\ ST ʸ»úÎó¤Î½ªÃ¼Ê¸»ú¡£ +ESC * ... G2 ʸ»ú½¸¹ç¤ò»ØÄꤹ¤ë¡£ +ESC + ... G3 ʸ»ú½¸¹ç¤ò»ØÄꤹ¤ë¡£ +.TE +.PP +.BR xterm (1) +(VT100 ¥â¡¼¥É)¤Ï ESC c, ESC # 8, ESC >, ESC =, +ESC D, ESC E, ESC H, ESC M, ESC N, ESC O, ESC P ... ESC \\, +ESC Z ¤òǧ¼±¤¹¤ë("¤ï¤¿¤·¤Ï¹âÅù¥Ó¥Ç¥ª¥ª¥×¥·¥ç¥óÉÕ¤­¤Î VT100 ¤Ç¤¹"¤È¤¤¤¦ +°ÕÌ£¤Ç ESC [ ? 1 ; 2 c ¤ÈÊÖÅú¤¹¤ë)¡¢ESC ^ ... ESC \\ ¤Ï¾å½Ò¤ÈƱ¤¸°ÕÌ£¤ò +¤¢¤é¤ï¤¹¡£ESC (, ESC ), ESC *, ESC + ¤Ë³¤¯ 0, A, B ¤ò DEC Æüìʸ»ú¤È +¤·¤Æ¼õ¤±¡¢¤½¤ì¤¾¤ì¥é¥¤¥ó¥É¥í¡¼¥¤¥ó¥°(line drawing) ¤Î¥»¥Ã¥È¡¢UK¡¢ +US-ASCII ¤ò¤¢¤é¤ï¤¹¡£ +.PP +¥æ¡¼¥¶¡¼¤Ï \fBxterm\fP(1) ¤¬ VT220 ÆÃÍ­¤Î¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤Ë +È¿±þ¤¹¤ë¤è¤¦¤ËÀßÄê¤Ç¤­¡¢¤Þ¤¿ÀßÄê¤È½é´ü²½¤Î¤µ¤ì¤«¤¿¤Ë¤è¤Ã¤Æ +¼«Ê¬¼«¿È¤ò VT52, VT100 ¤Ê¤É¤Èǧ¼±¤¹¤ë¡£ +.PP +xterm ¤Ï¡¢ÆÃÄê¤Î¥ê¥½¡¼¥¹¤ÎÀßÄê¤Î¤¿¤á¤Ë ESC ] (OSC) ¤ò¼õ¤±ÉÕ¤±¤ë¡£ +ECMA-48 ¤Îʸ»úÎó½ªÃ¼Ê¸»ú (ST) ¤Ë²Ã¤¨¤Æ¡¢ +\fBxterm\fP(1) ¤Ï BEL ¤ò OSC ʸ»úÎó¤ò½ªÃ¼¤¹¤ë¤â¤Î¤È¤·¤Æ¼õ¤±ÉÕ¤±¤ë¡£ +°Ê²¼¤Ï \fBxterm\fP(1) ¤¬Ç§¼±¤¹¤ë OSC ¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤Î°ìÉô¤Ç¤¢¤ë¡£ +.TS +l l. +ESC ] 0 ; \fItxt\fP ST ¥¢¥¤¥³¥ó̾¤È¥¦¥¤¥ó¥É¥¦¥¿¥¤¥È¥ë¤ò \fItxt\fP ¤Ë + ¥»¥Ã¥È¤¹¤ë¡£ +ESC ] 1 ; \fItxt\fP ST ¥¢¥¤¥³¥ó̾¤ò \fItxt\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC ] 2 ; \fItxt\fP ST ¥¦¥¤¥ó¥É¥¦¥¿¥¤¥È¥ë¤ò \fItxt\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC ] 4 ; \fInum\fP; \fItxt\fP ST ANSI ¿§ \fInum\fP ¤ò \fItxt\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC ] 10 ; \fI\fItxt\fP\fP ST ưŪ¥Æ¥­¥¹¥È¿§¤ò \fItxt\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +ESC ] 4 6 ; \fIname\fP ST ¥Á¥§¥ó¥¸¥í¥°¥Õ¥¡¥¤¥ë¤ò \fIname\fP ¤ËÊѹ¹¤¹¤ë(Ä̾ï¤Ï + ¥³¥ó¥Ñ¥¤¥ë»þ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë)¡£ +ESC ] 5 0 ; \fIfn\fP ST ¥Õ¥©¥ó¥È¤ò \fIfn\fP ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +.TE +.PP +°Ê²¼¤Î¤â¤Î¤Ï¡¢¾¯¤·°ã¤Ã¤¿°ÕÌ£¤Ë¤È¤é¤ì¤ë +(¤è¤ê¿¤¯¤Î¾õÂÖ¤òÊݸ¤·¡¢¤è¤ê VT100/VT220 ¤Ë¶á¤¤¤Õ¤ë¤Þ¤¤¤ò¤¹¤ë): +.LP +.TS +l l l. +ESC 7 DECSC ¥«¡¼¥½¥ë¤ÎÊݸ¡£ +ESC 8 DECRC ¥«¡¼¥½¥ë¤ÎÉü¸µ¡£ +.TE +.PP +¤Þ¤¿¡¢¼¡¤Î¤â¤Î¤âǧ¼±¤¹¤ë: +.TS +l l l. +ESC F ¥«¡¼¥½¥ë¤ò¥¹¥¯¥ê¡¼¥ó¤Îº¸²¼¤Ë°ÜÆ°¤¹¤ë¡£ + (\fBxterm\fP(1) ¤Î \fBhpLowerleftBugCompat\fP¥ê¥½¡¼¥¹¤Ë¤è¤êÍ­¸ú¤Ê»þ) +ESC l (HP ¥¿¡¼¥ß¥Ê¥ëËè¤Ë)¥á¥â¥ê¥í¥Ã¥¯¡£ + ¥«¡¼¥½¥ë¤è¤ê¾å¤Î¥á¥â¥ê¤ò¥í¥Ã¥¯¤¹¤ë¡£ +ESC m (HP ¥¿¡¼¥ß¥Ê¥ëËè¤Ë)¥á¥â¥ê¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë¡£ +ESC n LS2 G2 ʸ»ú½¸¹ç¤Î¸Æ¤Ó½Ð¤·¡£ +ESC o LS3 G3 ʸ»ú½¸¹ç¤Î¸Æ¤Ó½Ð¤·¡£ +ESC | LS3R G3 ʸ»ú½¸¹ç¤ò GR ¤È¤·¤Æ¸Æ¤Ó½Ð¤¹¡£ +ESC } LS2R G2 ʸ»ú½¸¹ç¤ò GR ¤È¤·¤Æ¸Æ¤Ó½Ð¤¹¡£ +ESC ~ LS1R G1 ʸ»ú½¸¹ç¤ò GR ¤È¤·¤Æ¸Æ¤Ó½Ð¤¹¡£ +.TE +.PP +¤Þ¤¿ ESC % ¤òǧ¼±¤·¡¢Linux ¥³¥ó¥½¡¼¥ë¤è¤ê¹¹¤Ë´°Á´¤Ê UTF-8 ¼ÂÁõ¤òÄ󶡤¹¤ë¡£ +.\" +.PP +.B "CSI ¥·¡¼¥±¥ó¥¹" +.sp +X11R5 ͳÍè¤Î¤è¤¦¤Ê¡¢¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î \fBxterm\fP(1) ¤Ï¥Ö¥ê¥ó¥¯ SGR ¤ò +¥Ü¡¼¥ë¥É SGR ¤È¤·¤Æ²ò¼á¤¹¤ë¡£ +1995 ǯ¤Î XFree86 3.1.2A ¤Î¤è¤¦¤Ê¡¢ANSI ¥«¥é¡¼¤¬¼ÂÁõ¤µ¤ì¤¿¡¢¤è¤ê¿·¤·¤¤ +¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢¥Ö¥ê¥ó¥¯Â°À­¤ò¿§¤È¤·¤Æɽ¼¨¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤³¤ì¤ò +²þÁ±¤·¤Æ¤¤¤ë¡£ +ºÇ¶á¤Î¥Ð¡¼¥¸¥ç¥ó¤Î xterm ¤Ï¥Ö¥ê¥ó¥¯ SGR ¤ò¥Æ¥­¥¹¥È¤ò¥Ö¥ê¥ó¥¯¤µ¤»¤ë¤³¤È¤Ç +¼ÂÁõ¤·¡¢¤µ¤é¤Ë¤Þ¤¿¡¢SGR ɽ¼¨¤ÎÂåÂذƤȤ·¤Æ¿§ÉÕ¤­¤Î¥Æ¥­¥¹¥È¤âÍøÍѤǤ­¤ë¡£ +Stock X11R6 ÈǤǤϡ¢XFree86 xterm ¤¬ÁȤßÆþ¤ì¤é¤ì¤¿ X11R6.8 ¥ê¥ê¡¼¥¹¤Þ¤Ç +¿§ÀßÄê SGR ¤òǧ¼±¤·¤Ê¤«¤Ã¤¿¡£ +Linux ¤¬Ç§¼±¤¹¤ë¾¤Î¤¹¤Ù¤Æ¤Î ECMA-48 CSI ¥·¡¼¥±¥ó¥¹¤Ï +.I xterm +¤Ç¤âǧ¼±¤µ¤ì¤ë¤¬¡¢\fBxterm\fP(1) ¤Ï Linux ¤¬Ç§¼±¤·¤Ê¤¤ +¤¤¤¯¤Ä¤«¤Î ECMA-48 ¤È DEC ¤Î¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤â¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +.PP +\fBxterm\fP(1) ¤Ï¾å½Ò¤Î¤¹¤Ù¤Æ¤Î DEC ¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É¤Î¥·¡¼¥±¥ó¥¹¤òǧ¼±¤¹¤ë¤¬¡¢ +Linux ¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É¤Î¥·¡¼¥±¥ó¥¹¤Ï¤É¤ì¤âǧ¼±¤·¤Ê¤¤¡£ +\fBxterm\fP(1) ¼«¿È¤Î¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É¥·¡¼¥±¥ó¥¹¤Ë´Ø¤·¤Æ¤ÎµÄÏÀ¤Ï¡¢ +X ÇÛÉۤȤȤâ¤ËÆþ¼ê²Äǽ¤Ê Edward Moy, Stephen Gildea,Thomas E. Dickey ¤Ë¤è¤ë +\fIXterm Control Sequences\fP +¥É¥­¥å¥á¥ó¥È¤ò»²¾È¤µ¤ì¤¿¤¤¡£ +¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ï¡¢´Ê·é¤Ê¤â¤Î¤Ç¤¢¤ë¤¬¡¢¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤è¤ê +ÍÚ¤«¤ËŤ¤¤â¤Î¤Ç¤¢¤ë¡£ +ǯÂå½ç¤Î³µ´Ñ¤È¤·¤Æ¤Ï¡¢ +.PP +.in +4n +http://invisible-island.net/xterm/xterm.log.html +.in +.PP +¤Ë¤Ï xterm ¤ÎÊѹ¹¤Î¾ÜºÙ¤¬¤¢¤ë¡£ +.PP +\fIvttest\fP ¤Ï +.PP +.in +4n +http://invisible-island.net/vttest/ +.in +.PP +¤ÇÆþ¼ê¤Ç¤­¡¢¤³¤ì¤é¤Î¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤Î¿¤¯¤Ë´Ø¤¹¤ë¥Ç¥â¤ò¹Ô¤¦¡£ +\fBxterm\fP(1) ¥½¡¼¥¹ÇÛÉۥѥ屡¼¥¸¤Ë¤Ï +¤½¤Î¾¤Îµ¡Ç½¤ò³Ø¤Ö¤³¤È¤¬½ÐÍè¤ë¥µ¥ó¥×¥ë¥¹¥¯¥ê¥×¥È¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +ESC 8 (DECRC) ¤Ï ESC % ¤ÇÊѹ¹¤µ¤ì¤¿Ê¸»ú½¸¹ç¤òÉü¸µ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.SH ¥Ð¥° +2.0.23 ¤Ç¤Ï CSI ¤¬²õ¤ì¤Æ¤¤¤Æ¡¢¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹Ãæ¤Î NUL ¤¬ +̵»ë¤µ¤ì¤Ê¤¤¡£ +.PP +¸Å¤¤¥Ð¡¼¥¸¥ç¥ó(2.0 °Ê¹ß)¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¡¢8 ¥Ó¥Ã¥ÈÀ©¸æ¥·¡¼¥±¥ó¥¹¤ò²ò¼á¤¹¤ë¡£ +¤³¤ì¤é¤Î "C1 ¥³¥ó¥È¥í¡¼¥ë" ¤Ï ESC [, ESC ] ¤ª¤è¤ÓƱÍͤÊÀ©¸æ¥·¡¼¥±¥ó¥¹ +µ¯Æ°»Ò¤òÃÖ¤­´¹¤¨¤ë¤¿¤á¤Ë 128 ¤«¤é 159 ¤Î¥³¡¼¥É¤ò»È¤¦¡£ +¿·¤·¤¤¥«¡¼¥Í¥ë¤Ç¤Ï (UTF-8 Âбþ¤ÎÊѹ¹»þ¤Ë¸«Íî¤È¤µ¤ì¤¿¤«²õ¤ì¤¿¤¿¤á¤Ë) +À£ÃǤ·¤Æ¤¤¤ë¤¬¡¢¼ÂÁõ¤ÏÉÔ´°Á´¤Ç¿®Íê¤Ç¤­¤Ê¤¤¤â¤Î¤Èɾ²Á¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +Linux "¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É" ¥·¡¼¥±¥ó¥¹¤Ï ECMA-48 ¤Î¥×¥é¥¤¥Ù¡¼¥È¥â¡¼¥É +¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤Î¥ë¡¼¥ë¤Ë½¾¤Ã¤Æ¤¤¤Ê¤¤¡£ +Æäˡ¢ ] ¤Ç½ª¤ï¤ë¤â¤Î¤Ïɸ½à½ªÃ¼Ê¸»ú¤ò»È¤¨¤Ê¤¤¡£ +OSC(¥Ñ¥ì¥Ã¥ÈÀßÄê)¥·¡¼¥±¥ó¥¹¤ÏÂ礭¤ÊÌäÂ꤬¤¢¤ë¡£ +\fBxterm\fP(1) ¤Ï¤³¤ì¤òʸ»úÎó½ªÃ¼Ê¸»ú (ST) ¤¬É¬Íפʥ³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤È +²ò¼á¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +(ÉÔÀµ¤Ê¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤Ê¤Î¤Ç)̵»ë¤µ¤ì¤ë \fBsetterm\fP(1) ¥·¡¼¥±¥ó¥¹¤È +°ã¤¤¡¢¥Ñ¥ì¥Ã¥È¥·¡¼¥±¥ó¥¹¤Ï \fBxterm\fP(1) ¤ò¥Ï¥ó¥°¤µ¤»¤ë¤«¤â¤·¤ì¤Ê¤¤ +(¤·¤«¤·¥ê¥¿¡¼¥ó¥­¡¼¤ò²¡¤¹¤³¤È¤Ç²óÉü¤Ç¤­¤ë)¡£ +Linux ¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤ò¥Ï¡¼¥É¥³¡¼¥É¤·¤Æ¤¤¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë +Ŭ±þ¤µ¤»¤ë¤Ë¤Ï¡¢\fBxterm\fP(1) ¥ê¥½¡¼¥¹¤Î \fBbrokenLinuxOSC\fP ¤ò +¿¿ (true) ¤ËÀßÄꤹ¤ë¡£ +.PP +¤³¤Î¥É¥­¥å¥á¥ó¥È¤Î¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢Linux ¤¬ ECMA-48 ¤ÎÉԲĻë¥Æ¥­¥¹¥È¤Î +¥³¥ó¥È¥í¡¼¥ë¥·¡¼¥±¥ó¥¹¤òǧ¼±¤¹¤ë¤«¤Î¤è¤¦¤Ë½ñ¤«¤ì¤Æ¤¤¤¿¡£ +¤³¤ì¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR console (4), +.BR console_ioctl (4), +.BR charsets (7) diff --git a/release/man4/console_ioctl.4 b/release/man4/console_ioctl.4 new file mode 100644 index 00000000..14e8a903 --- /dev/null +++ b/release/man4/console_ioctl.4 @@ -0,0 +1,610 @@ +.\" Copyright (c) 1995 Jim Van Zandt and aeb +.\" Sun Feb 26 11:46:23 MET 1995 +.\" +.\" 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, Sun Feb 26 15:04:20 1995, faith@cs.unc.edu +.\" Modified, Thu Apr 20 22:08:17 1995, jrv@vanzandt.mv.com +.\" Modified, Mon Sep 18 22:32:47 1995, hpa@storm.net (H. Peter Anvin) +.\" FIXME The following are not documented: +.\" KDFONTOP (since 2.1.111) +.\" KDGKBDIACRUC (since 2.6.24) +.\" KDSKBDIACR +.\" KDSKBDIACRUC (since 2.6.24) +.\" KDKBDREP (since 2.1.113) +.\" KDMAPDISP (not implemented as at 2.6.27) +.\" KDUNMAPDISP (not implemented as at 2.6.27) +.\" VT_LOCKSWITCH (since 1.3.47, needs CAP_SYS_TTY_CONFIG) +.\" VT_UNLOCKSWITCH (since 1.3.47, needs CAP_SYS_TTY_CONFIG) +.\" VT_GETHIFONTMASK (since 2.6.18) +.\" +.\" Japanese Version Copyright (c) 1996,1997 TAKAHASHI Mutsuji +.\" 1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Sun Jan 11 03:24:14 JST 1998 +.\" by TAKAHASHI Mutsuji +.\" and ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Thu Feb 5 17:35:37 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated & Modefied Sat Feb 27 1999 by Shouichi Saito +.\" Updated Tue Jan 28 JST 2003 by Kentaro Shirakata +.\" +.TH CONSOLE_IOCTL 4 2009-02-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +console_ioctl \- ¥³¥ó¥½¡¼¥ëüËö¤È²¾ÁÛ¥³¥ó¥½¡¼¥ë¤Î ioctl +.SH ÀâÌÀ +¼¡¤Î¤è¤¦¤Ê Linux ¸ÇÍ­¤Î +.BR ioctl (2) +¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤½¤ì¤¾¤ì3ÈÖÌܤΰú¿ô¤¬É¬ÍפǤ¢¤ë¡¢¤³¤³¤Ç¤Ï \fIargp\fP ¤È¤¹¤ë¡£ +.IP \fBKDGETLED\fP +LED ¤Î¾õÂÖ¤ò¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤Ï \fIchar\fP ¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +\fI*argp\fP ¤Î²¼°Ì 3 ¥Ó¥Ã¥È¤Ë°Ê²¼¤Î¤è¤¦¤Ë LED ¤Î¾õÂÖ¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ + + LED_CAP 0x04 ¥­¥ã¥Ô¥¿¥ë¥í¥Ã¥¯¤¬ÅÀÅô + LEC_NUM 0x02 ¥Ê¥ó¥Ð¡¼¥í¥Ã¥¯¤¬ÅÀÅô + LED_SCR 0x01 ¥¹¥¯¥í¡¼¥ë¥í¥Ã¥¯¤¬ÅÀÅô +.IP \fBKDSETLED\fP +LED¤òÅÀÅô¤µ¤»¤ë¡£LED¤Ï \fIargp\fP ¤Î²¼°Ì 3 ¥Ó¥Ã¥È¤Ë½¾¤¤ÅÀÅô¤µ¤ì¤ë¡£ +¤·¤«¤·¡¢¤è¤ê¹â°Ì¤Î¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë»þ¤Ë¤Ï¡¢¥­¥ã¥Ô¥¿¥ë¥í¥Ã¥¯¡¢ +¥Ê¥ó¥Ð¡¼¥í¥Ã¥¯¡¢¥¹¥¯¥í¡¼¥ë¥í¥Ã¥¯¤Î¥­¡¼¥Ü¡¼¥Éµ¡Ç½¤Î¾õÂÖ¤òɽ¼¨¤¹¤ë LED ¤Ï +Ä̾ï¾õÂÖ¤ËÌá¤ë¡£ +.LP +¥«¡¼¥Í¥ë 1.1.54 °ÊÁ°¤Ï¡¢LED ¤Ï¤½¤ì¤¾¤ì¤Î¥­¡¼¥Ü¡¼¥É¥Õ¥é¥°¤Î¾õÂÖ¤òÈ¿±Ç¤¹¤ë +¤À¤±¤Ç¡¢KDGETLED/KDSETLED ¤â¥­¡¼¥Ü¡¼¥É¥Õ¥é¥°¤òÊѹ¹¤¹¤ë¤À¤±¤Ç¤¢¤Ã¤¿¡£ +¥«¡¼¥Í¥ël 1.1.54 ¤«¤é¤Ï LED ¤ËǤ°Õ¤Îɽ¼¨¤ò¤¹¤ë»ö¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤¬¡¢ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥­¡¼¥Ü¡¼¥É¥Õ¥é¥°¤òɽ¼¨¤¹¤ë¡£ +¼¡¤Ë¼¨¤¹ 2 ¤Ä¤Î ioctl ¤Ï¥­¡¼¥Ü¡¼¥É¥Õ¥é¥°¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +.IP \fBKDGKBLED\fP +¥­¥ã¥Ô¥¿¥ë¥í¥Ã¥¯¡¢¥Ê¥ó¥Ð¡¼¥í¥Ã¥¯¡¢¥¹¥¯¥í¡¼¥ë¥í¥Ã¥¯¤Î(LED ¤Îɽ¼¨¤Ç¤Ï +¤Ê¤¯)¥­¡¼¥Ü¡¼¥É¥Õ¥é¥°¤òÆÀ¤ë¡£ +\fIargp\fP ¤Ï¥Õ¥é¥°¤Î¾õÂÖ¤¬¥»¥Ã¥È¤µ¤ì¤ëʸ»úÊÑ¿ô¤ò»Ø¤¹¡£ +(0x7)¤Ç¥Þ¥¹¥¯¤·¤ÆÆÀ¤é¤ì¤ë²¼°Ì 3 ¥Ó¥Ã¥È¤¬¸½ºß¤Î¥Õ¥é¥°¤Î¾õÂÖ¤ò¼¨¤·¡¢ +(0x70)¤Ç¥Þ¥¹¥¯¤·¤ÆÆÀ¤é¤ì¤ë¼¡¤Î 3 ¥Ó¥Ã¥È¤¬¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥é¥°¤Î¾õÂÖ¤ò +¼¨¤¹¡£(¥«¡¼¥Í¥ë 1.1.54°Ê¹ß) +.IP \fBKDSKBLED\fP +¥­¥ã¥Ô¥¿¥ë¥í¥Ã¥¯¡¢¥Ê¥ó¥Ð¡¼¥í¥Ã¥¯¡¢¥¹¥¯¥í¡¼¥ë¥í¥Ã¥¯¤Î(LED ¤Îɽ¼¨¤Ç¤Ï¤Ê¤¯) +¥­¡¼¥Ü¡¼¥É¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +\fIargp\fP ¤¬¥»¥Ã¥È¤·¤¿¤¤¥Õ¥é¥°¤Ç¤¢¤ë¡£ +(0x7)¤Ç¥Þ¥¹¥¯¤·¤ÆÆÀ¤é¤ì¤ë²¼°Ì 3 ¥Ó¥Ã¥È¤¬¥Õ¥é¥°¤Î¾õÂ֤ǡ¢(0x70)¤Ç¥Þ¥¹¥¯¤·¤Æ +ÆÀ¤é¤ì¤ë¼¡¤Î 3 ¥Ó¥Ã¥È¤¬¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥é¥°¤Î¾õÂ֤Ǥ¢¤ë¡£(¥«¡¼¥Í¥ë +1.1.54°Ê¹ß) +.IP \fBKDGKBTYPE\fP +¥­¡¼¥Ü¡¼¥É¤Î¼ïÎà¤òÆÀ¤ë¡£¤³¤ì¤ÏÃÍ 0x02 ¤ÈÄêµÁ¤µ¤ì¤Æ¤¤¤ë KB_101¤òÊÖ¤¹¡£ +.IP \fBKDADDIO\fP +I/O¥Ý¡¼¥È¤òÍ­¸ú¤Êʪ¤È¤·¤Æ²Ã¤¨¤ë¡£¤³¤ì¤Ï \fIioperm(arg,1,1)\fP ¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.IP \fBKDDELIO\fP +I/O¥Ý¡¼¥È¤òÍ­¸ú¤Êʪ¤«¤é³°¤¹¡£¤³¤ì¤Ï \fIioperm(arg,1,0)\fP ¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.IP \fBKDENABIO\fP +¥Ó¥Ç¥ª¥Ü¡¼¥É¤Ø¤Î I/O ¤ò²Äǽ¤Ë¤¹¤ë¡£ +¤³¤ì¤Ï \fIioperm(0x3b4, 0x3df-0x3b4+1, 1)\fP ¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.IP \fBKDDISABIO\fP +¥Ó¥Ç¥ª¥Ü¡¼¥É¤Ø¤Î I/O ¤òÉÔ²Äǽ¤Ë¤¹¤ë¡£ +¤³¤ì¤Ï \fIioperm(0x3b4, 0x3df-0x3b4+1, 0)\fP ¤ÈÅù²Á¤Ç¤¢¤ë¡£ +.IP \fBKDSETMODE\fP +¥Æ¥­¥¹¥È/¥°¥é¥Õ¥£¥¯¥¹¥â¡¼¥É¤òÀßÄꤹ¤ë¡£ +\fIargp\fP ¤Ï¼¡¤Î¤¦¤Á¤Î¤É¤ì¤«¡§ + + KD_TEXT 0x00 + KD_GRAPHICS 0x01 +.IP \fBKDGETMODE\fP +¥Æ¥­¥¹¥È/¥°¥é¥Õ¥£¥¯¥¹¥â¡¼¥É¤ò¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤¬»Ø¤¹ \fIlong\fP ·¿ÊÑ¿ô¤Ë +¾å½Ò¤ÎÃͤΤɤÁ¤é¤«¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.IP \fBKDMKTONE\fP +»ØÄꤵ¤ì¤¿Ä¹¤µ¤Î¥È¡¼¥ó¤òȯÀ¸¤¹¤ë¡£ +\fIargp\fP ¤Î²¼°Ì 16 ¥Ó¥Ã¥È¤Ï¥¯¥í¥Ã¥¯¥µ¥¤¥¯¥ë¤òñ°Ì¤Ë¤·¤Æ¼þ´ü¤ò»ØÄꤷ¡¢ +¾å°Ì 16 ¥Ó¥Ã¥È¤¬ msec ¤Îñ°Ì¤Çɽ¤·¤¿¡¢(¥È¡¼¥ó¤òȯÀ¸¤µ¤»¤ë)»þ´Ö¤ò»ØÄꤹ¤ë¡£ +¥È¡¼¥ó¤òȯÀ¸¤µ¤»¤ë»þ´Ö¤¬¥¼¥í¤Î¤È¤­¤Ï¡¢¥µ¥¦¥ó¥É¤Ï¥ª¥Õ¤Ë¤Ê¤ë¡£ +À©¸æ¤Ïľ¤Á¤ËÌá¤ë¡£ +Î㤨¤Ð¡¢\fIargp\fP = (125<<16) + 0x637 ¤È¤¹¤ì¤Ð¡¢Ä̾ï ctrl-G ¤ò²¡¤·¤¿»þ¤Ë +ȯÀ¸¤¹¤ë²»¤Ë¤Ê¤ë¡£ +(¥«¡¼¥Í¥ë 0.99pl1 °Ê¹ß;¤³¤Îµ¡Ç½¤Ï ¥«¡¼¥Í¥ë 2.1.49 ¤«¤é +2.1.50 ¤Ç¤Ï¥Ð¥°¤Î¤¿¤áÆ°ºî¤·¤Ê¤¤) +.IP \fBKIOCSOUND\fP +²»¤ÎȯÀ¸¤Î³«»Ï¤äÄä»ß¤ò¹Ô¤¦¡£ +\fIargp\fP ¤Î²¼°Ì 16 ¥Ó¥Ã¥È¤Ï¥¯¥í¥Ã¥¯¥µ¥¤¥¯¥ë¤òñ°Ì¤È¤·¤Æ¼þ´ü¤ò¼¨¤¹¡£ +(¤Ä¤Þ¤ê \fIargp\fP = 1193180/¼þÇÈ¿ô)¡£ +\fIargp\fP = 0 ¤Î¾ì¹ç¡¢¥µ¥¦¥ó¥É¤Ï¥ª¥Õ¤Ë¤Ê¤ë¡£ +¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢¤¿¤À¤Á¤ËÀ©¸æ¤ÏÌá¤ë¡£ +.IP \fBGIO_CMAP\fP +¸½ºß¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥«¥é¡¼¥Þ¥Ã¥×¤ò¥«¡¼¥Í¥ë¤è¤ê¼èÆÀ¤¹¤ë¡£ +.IP \fBPIO_CMAP\fP +¥Ç¥Õ¥©¥ë¥È¤Î¥Æ¥­¥¹¥È¥â¡¼¥É¤Î¥«¥é¡¼¥Þ¥Ã¥×¤òÊѹ¹¤¹¤ë¡£ +\fIargp\fP ¤¬»Ø¤¹ 48 ¥Ð¥¤¥È¤ÎÇÛÎóÃæ¤Ë¤Ï¡¢16 ¤Î²Äǽ¤Ê¥¹¥¯¥ê¡¼¥ó¤Î¿§¤ò¡¢ +ÀÖ¡¢ÎС¢ÀĤνç¤Ë 0 ¤ò¥ª¥Õ¡¢255¤òºÇÂ綯Å٤Ȥ·¤¿ÃͤȤ·¤ÆǼ¤á¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î¿§¤Ï½ç¤Ë¡¢¹õ¡¢Ç»¤¤ÀÖ¡¢Ç»¤¤ÎС¢Ã㡢ǻ¤¤ÀÄ¡¢Ç»¤¤»ç¡¢Ç»¤¤¥·¥¢¥ó¡¢ +ÌÀ¤ë¤¤³¥¿§¡¢Ç»¤¤³¥¿§¡¢ÌÀ¤ë¤¤ÀÖ¡¢ÌÀ¤ë¤¤ÎС¢²«¡¢ÌÀ¤ë¤¤ÀÄ¡¢ÌÀ¤ë¤¤»ç¡¢ +ÌÀ¤ë¤¤¥·¥¢¥ó¡¢Çò¤Ç¤¢¤ë¡£(¥«¡¼¥Í¥ë 1.3.3°Ê¹ß) +.IP \fBGIO_FONT\fP +³ÈÄ¥¤µ¤ì¤¿·Á¼°¤Ç 256 ʸ»ú¤Î¥¹¥¯¥ê¡¼¥ó¥Õ¥©¥ó¥È¤òÆÀ¤ë¡£ +\fIargp\fP ¤Ï 8192 ¥Ð¥¤¥È¤ÎÇÛÎó¤ò»Ø¤¹¡£ +¸½ºß¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥Õ¥©¥ó¥È¤¬ 512 ʸ»ú¤Î¥Õ¥©¥ó¥È¤Ç¤¢¤ë¤«¡¢¥³¥ó¥½¡¼¥ë¤¬ +¥Æ¥­¥¹¥È¥â¡¼¥É¤Ç¤Ê¤¤»þ¤Ë¤Ï¼ºÇÔ¤· \fBEINVAL\fP ¤Î¥¨¥é¡¼¥³¡¼¥É¤òÊÖ¤¹¡£ +.IP \fBGIO_FONTX\fP +¥¹¥¯¥ê¡¼¥ó¥Õ¥©¥ó¥È¤È¤½¤ì¤Ë´ØÏ¢¤·¤¿¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤Ï¹½Â¤ÂÎ consolefontdesc (\fBPIO_FONTX\fP ¤ò»²¾È¤Î¤³¤È)¤ò»Ø¤¹¡£ +´Ø¿ô¸Æ¤Ó½Ð¤·¤Î¤È¤­¤Ë¤Ï¡¢\fIcharcount\fP ¤Ë¤Ï¡¢\fIchardata\fP ¤¬»Ø¤¹ +¥Ð¥Ã¥Õ¥¡¤Ë¤ª¤µ¤Þ¤ëºÇÂç¤Îʸ»ú¿ô¤ò¥»¥Ã¥È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +´Ø¿ô¸Æ¤Ó½Ð¤·¤«¤éÌá¤Ã¤¿»þ¤Ë¤Ï \fIcharcount\fP ¤È \fIcharheight\fP ¤Ë¤Ï¡¢ +¸½ºß¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥Õ¥©¥ó¥È¤Î³ºÅö¤¹¤ë¥Ç¡¼¥¿¤¬¼ý¤á¤é¤ì¤Æ¤¤¤ë¡£ +ÇÛÎó \fIchardata\fP ¤Ë¤Ï¡¢ºÇ½é¤Ë \fIcharcount\fP ¤Ë¤¤¤ì¤¿Ãͤˤè¤Ã¤Æ +¥Õ¥©¥ó¥È¤ò¼ý¤á¤ë¤Î¤Ë½½Ê¬¤Ê¥¹¥Ú¡¼¥¹¤¬¤¢¤ë¤È¤ï¤«¤ì¤Ð¥Õ¥©¥ó¥È¥Ç¡¼¥¿¤¬¼ý¤á¤é¤ì¤ë¡£ +¤½¤¦¤Ç¤Ê¤¤»þ¤Ë¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤ÏÊѹ¹¤µ¤ì¤º¡¢ \fIerrno\fP ¤Ë \fBENOMEM\fP ¤¬ +¥»¥Ã¥È¤µ¤ì¤ë(¥«¡¼¥Í¥ë 1.3.1 °Ê¹ß)¡£ +.IP \fBPIO_FONT\fP +256 ʸ»ú¤Î¥Õ¥©¥ó¥È¤ò¥»¥Ã¥È¤¹¤ë¡£EGA/VGA ¥­¥ã¥é¥¯¥¿¡¼¥¸¥§¥Í¥ì¡¼¥¿¡¼ +(character generator) ¤Ë¥Õ¥©¥ó¥È¤ò¥í¡¼¥É¤¹¤ë¡£ +\fIargp\fP ¤Ï¡¢8192 ¥Ð¥¤¥È(°ìʸ»ú 32 ¥Ð¥¤¥È)¤Î¥Þ¥Ã¥×¤ò»Ø¤¹¡£ +¥Þ¥Ã¥×¤Î¤¦¤Á¡¢ºÇ½é¤Î \fIN\fP ¤Î¤ß¤¬ 8x\fIN\fP ¤Î¥Õ¥©¥ó¥È¤Î¤¿¤á¤Ë +ÍѤ¤¤é¤ì¤ë(0 < \fIN\fP <= 32)¡£ +¤³¤Î¸Æ¤Ó½Ð¤·¤ò¤¹¤ë¤È Unicode ¤Î¥Þ¥Ã¥Ô¥ó¥°¤¬Ìµ¸ú¤Ë¤Ê¤ë¡£ +.IP \fBPIO_FONTX\fP +¥¹¥¯¥ê¡¼¥ó¥Õ¥©¥ó¥È¤È¡¢¤½¤ì¤Ë´ØÏ¢¤¹¤ë¥ì¥ó¥À¥ê¥ó¥°¾ðÊó¤ò¥»¥Ã¥È¤¹¤ë¡£ +\fIargp\fP ¤Ï¡¢°Ê²¼¤Î¹½Â¤ÂΤò»Ø¤¹¡£ + +.in +4n +.nf +struct consolefontdesc { + unsigned short charcount; /* ¥Õ¥©¥ó¥È¤Îʸ»ú¿ô + (256 ¤Þ¤¿¤Ï 512) */ + unsigned short charheight; /* °ìʸ»ú¤ÎÁöººÀþ¤Î¿ô + (1-32) */ + char *chardata; /* Ÿ³«¤µ¤ì¤¿¥Õ¥©¥ó¥È¥Ç¡¼¥¿ */ +}; +.fi +.in + +ɬÍפʤ饹¥¯¥ê¡¼¥ó¤ÏŬÅö¤Ë¥µ¥¤¥ºÊѹ¹¤µ¤ì¡¢\fBSIGWINCH\fP ¤¬Å¬ÀÚ¤Ê +¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤ë¡£ +¤³¤Î¥³¡¼¥ë¤Ë¤è¤ê Unicode ¤Î¥Þ¥Ã¥Ô¥ó¥°¤¬Ìµ¸ú¤Ë¤Ê¤ë¡£ +.IP \fBPIO_FONTRESET\fP +¥¹¥¯¥ê¡¼¥ó¥Õ¥©¥ó¥È¡¢¥µ¥¤¥º¡¢ Unicode ¥Þ¥Ã¥Ô¥ó¥°¤ò¥Ö¡¼¥È»þ¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ë +¥ê¥»¥Ã¥È¤¹¤ë¡£\fIargp\fP ¤ÏÍѤ¤¤é¤ì¤Ê¤¤¤¬¡¢¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Î +Linux ¤È¤Î¸ß´¹À­¤òÊݤĤ¿¤á¤Ë NULL ¤Ë¥»¥Ã¥È¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.IP \fBGIO_SCRNMAP\fP +¥¹¥¯¥ê¡¼¥ó¥Þ¥Ã¥Ô¥ó¥°¤ò¥«¡¼¥Í¥ë¤è¤ê¼èÆÀ¤¹¤ë¡£\fIargp\fP ¤Ï¥µ¥¤¥º E_TABSZ ¤Î +Îΰè¤ò»Ø¤¹¡£¤½¤ÎÎΰè¤Ë¤Ï³Æ¥­¥ã¥é¥¯¥¿¡¼¤òɽ¼¨¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¥Õ¥©¥ó¥È¤Î +°ÌÃÖ¤¬¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¸Æ¤Ó½Ð¤·¤Ï¸½ºß¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥Õ¥©¥ó¥È¤¬ 256 ʸ»ú¤è¤ê¤â¿¤¤»þ¤Ë¤Ï +̵°ÕÌ£¤Ê¾ðÊó¤òÊÖ¤¹»ö¤¬Â¿¤¤¡£ +.IP \fBGIO_UNISCRNMAP\fP +¥Õ¥ë Unicode ¥¹¥¯¥ê¡¼¥ó¥Þ¥Ã¥Ô¥ó¥°¤ò¥«¡¼¥Í¥ë¤è¤ê¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤Ï¥µ¥¤¥º E_TABSZ*sizeof(unsigned short) ¤ÎÎΰè¤ò»Ø¤¹¡£ +¤½¤ÎÎΰè¤Ë¤Ï³Æ¥­¥ã¥é¥¯¥¿¡¼¤ò¼¨¤¹ Unicode ¤¬¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¡£ +U+F000 ¤Ë»Ï¤Þ¤ë Unicode ¤ÎÆÃÊ̤ʽ¸¹ç¤Ï¡¢¡Ö¥Õ¥©¥ó¥ÈľÀܤÊ(direct to font)¡× +¥Þ¥Ã¥Ô¥ó¥°¤ò¼¨¤¹¤Î¤ËÍѤ¤¤é¤ì¤ë(¥«¡¼¥Í¥ë 1.3.1 °Ê¹ß)¡£ +.IP \fBPIO_SCRNMAP\fP +¡Ö¥æ¡¼¥¶¡¼ÄêµÁ²Äǽ¤Ê(user definable)¡×(4ÈÖÌܤÎ)¥Æ¡¼¥Ö¥ë¤ò¥«¡¼¥Í¥ë¤Ë +¥í¡¼¥É¤¹¤ë¡£¤½¤Î¥Æ¡¼¥Ö¥ë¤Ï³Æ¥Ð¥¤¥È¤ò¥¹¥¯¥ê¡¼¥ó¥·¥ó¥Ü¥ë¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¡£ +\fIargp\fP ¤Ï¥µ¥¤¥ºE_TABSZ¤ÎÎΰè¤ò»Ø¤¹¡£ +.IP \fBPIO_UNISCRNMAP\fP +¡Ö¥æ¡¼¥¶¡¼ÄêµÁ²Äǽ¤Ê¡×(4ÈÖÌܤÎ)¥Æ¡¼¥Ö¥ë¤ò¥«¡¼¥Í¥ë¤Ë¥í¡¼¥É¤¹¤ë¡£ +¤½¤Î¥Æ¡¼¥Ö¥ë¤Ï³Æ¥Ð¥¤¥È¤ò¥æ¥Ë¥³¡¼¥É¤Ë¥Þ¥Ã¥Ô¥ó¥°¤·¡¢¤½¤Î¸å¡¢ +¸½ºß¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥æ¥Ë¥³¡¼¥É¤«¤é¥Õ¥©¥ó¥È¤Ø¤Î¥Þ¥Ã¥×¤Ë½¾¤¤ +¥¹¥¯¥ê¡¼¥ó¥·¥ó¥Ü¥ë¤ËÊÑ´¹¤µ¤ì¤ë¡£ +U+F000 ¤Ë»Ï¤Þ¤ë¥æ¥Ë¥³¡¼¥É¤ÏľÀÜ¥Õ¥©¥ó¥È¥·¥ó¥Ü¥ë¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¤Î¤Ë +»È¤¨¤ë(¥«¡¼¥Í¥ë 1.3.1 °Ê¹ß) +.IP \fBGIO_UNIMAP\fP +Unicode ¤«¤é¥Õ¥©¥ó¥È¤Ø¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¥«¡¼¥Í¥ë¤«¤é¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤Ï¡¢ + +.in +4n +.nf +struct unimapdesc { + unsigned short entry_ct; + struct unipair *entries; +}; +.fi +.in + +¤È¤¤¤¦¹½Â¤ÂΤò»Ø¤¹¡£ +¤³¤³¤Ç \fIentries\fP ¤Ï¡¢ + +.in +4n +.nf +struct unipair { + unsigned short unicode; + unsigned short fontpos; +}; +.fi +.in + +¤È¤¤¤¦¹½Â¤ÂΤÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +(¥«¡¼¥Í¥ë 1.1.92 °Ê¹ß) +.IP \fBPIO_UNIMAP\fP +Unicode ¤«¤é¥Õ¥©¥ó¥È¤Ø¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¥«¡¼¥Í¥ë¤Ë¥»¥Ã¥È¤¹¤ë¡£\fIargp\fP +¤Ï¹½Â¤ÂÎ \fIstruct unimapdesc\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£(¥«¡¼¥Í¥ë 1.1.92 °Ê¹ß) +.IP \fBPIO_UNIMAPCLR\fP +¥Æ¡¼¥Ö¥ë¤ò¥¯¥ê¥¢¤·¡¢¤½¤Î»ö¤ò¥Ï¥·¥å¥¢¥ë¥´¥ê¥º¥à¤ËÅÁ¤¨¤ë¡£ +\fIargp\fP¤Ï + +.in +4n +.nf +struct unimapinit { + unsigned short advised_hashsize; /* 0 if no opinion */ + unsigned short advised_hashstep; /* 0 if no opinion */ + unsigned short advised_hashlevel; /* 0 if no opinion */ +}; +.fi +.in + +¤È¤¤¤¦¹½Â¤ÂΤò»Ø¤¹¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +(¥«¡¼¥Í¥ë 1.1.92 °Ê¹ß) +.IP \fBKDGKBMODE\fP +¸½ºß¤Î¥­¡¼¥Ü¡¼¥É¥â¡¼¥É¤ò¼èÆÀ¤¹¤ë¡£\fIargp\fP ¤Î»Ø¤¹ \fIlong\fP ·¿ÊÑ¿ô¤¬¡¢ +¼¡¤Î¤¦¤Á¤Î¤É¤ì¤«¤ËÀßÄꤵ¤ì¤ë¡£ + + K_RAW 0x00 + K_XLATE 0x01 + K_MEDIUMRAW 0x02 + K_UNICODE 0x03 +.IP \fBKDSKBMODE\fP +¸½ºß¤Î¥­¡¼¥Ü¡¼¥É¥â¡¼¥É¤òÀßÄꤹ¤ë¡£ +\fIargp\fP ¤Ï¾åµ­¤ÎÃͤΤ¦¤Á¤Î¤É¤ì¤«¤ËÅù¤·¤¤ \fIlong\fP ¤Ë¤¹¤ë¡£ +.IP \fBKDGKBMETA\fP +¥á¥¿¥­¡¼¥Ï¥ó¥É¥ê¥ó¥°¥â¡¼¥É(meta key handling mode)¤ò¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤¬»Ø¤¹ \fIlong\fP ·¿ÊÑ¿ô¤Ï¡¢¼¡¤Î¤¦¤Á¤Î¤É¤ì¤«¤ËÀßÄꤵ¤ì¤ë¡£ + + K_METABIT 0x03 set high order bit + K_ESCPREFIX 0x04 escape prefix +.IP \fBKDSKBMETA\fP +¥á¥¿¥­¡¼¥Ï¥ó¥É¥ê¥ó¥°¥â¡¼¥É¤òÀßÄꤹ¤ë¡£ +\fIargp\fP ¤Ï¾åµ­¤ÎÃͤΤɤ줫¤ËÅù¤·¤¤ \fIlong\fP ¤Ë¤¹¤ë¡£ +.IP \fBKDGKBENT\fP +¥­¡¼¥³¡¼¥É¤ò¥¢¥¯¥·¥ç¥ó¥³¡¼¥É¤ËÊÑ´¹¤¹¤ë¥­¡¼ÊÑ´¹É½¤Î¥¨¥ó¥È¥ê¡¼¤Î°ì¤Ä¤ò +¼èÆÀ¤¹¤ë¡£ +\fIargp\fP ¤Ï¡¢ + +.in +4n +.nf +struct kbentry { + unsigned char kb_table; + unsigned char kb_index; + unsigned short kb_value; +}; +.fi +.in + +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +ºÇ½é¤Î2¤Ä¤ÎÍ×ÁÇ¡¢\fIkb_table\fP ¤Ë¤ÏÁªÂò¤¹¤ë¥­¡¼¥Æ¡¼¥Ö¥ë (0 <= +\fIkb_table\fP < MAX_NR_KEYMAPS)¡¢\fIkb_index\fP ¤Ë¤Ï¥­¡¼¥³¡¼¥É(0 <= +\fIkb_index\fP < NR_KEYS)¤òÀßÄꤹ¤ë¡£ +\fIkb_value\fP ¤ÏÂбþ¤¹¤ë¥¢¥¯¥·¥ç¥ó¥³¡¼¥É¡¢¤Þ¤¿¤Ï¡¢¤½¤Î¤è¤¦¤Ê¥­¡¼¤¬ +¤Ê¤¤¤È¤­¤Ë¤Ï K_HOLE¡¢\fIkb_table\fP ¤¬Ìµ¸ú¤Ê»þ¤Ë¤Ï K_NOSUCHMAP ¤ËÀßÄꤵ¤ì¤ë¡£ +.IP \fBKDSKBENT\fP +ÊÑ´¹¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¡¼¤Î°ì¤Ä¤òÀßÄꤹ¤ë¡£\fIargp\fP ¤Ï +¹½Â¤ÂÎ \fIstruct kbentry\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +.IP \fBKDGKBSENT\fP +¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Îʸ»úÎó¤ò¼èÆÀ¤¹¤ë¡£\fIargp\fP ¤Ï¡¢ + +.in +4n +.nf +struct kbsentry { + unsigned char kb_func; + unsigned char kb_string[512]; +}; +.fi +.in + +¤È¤¤¤¦¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ + +\fIkb_func\fP ÈÖÌܤΥե¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Î¥¢¥¯¥·¥ç¥ó¥³¡¼¥É¤ËÂбþ¤¹¤ë +(NULL ¤Ç½ªÃ¼¤µ¤ì¤¿)ʸ»úÎó¤¬ \fIkb_string\fP ¤ËÀßÄꤵ¤ì¤ë¡£ +.IP \fBKDSKBSENT\fP +¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Îʸ»úÎó¤Î¥¨¥ó¥È¥ê¡¼¤òÀßÄꤹ¤ë¡£\fIargp\fP ¤Ï¡¢ +¹½Â¤ÂÎ \fIstruct kbsentry\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +.IP \fBKDGKBDIACR\fP +¥«¡¼¥Í¥ë¤Î¥¢¥¯¥»¥ó¥È¥Æ¡¼¥Ö¥ë(accent table)¤òÆɤ߹þ¤à¡£\fIargp\fP¤Ï¡¢ + +.in +4n +.nf +struct kbdiacrs { + unsigned int kb_cnt; + struct kbdiacr kbdiacr[256]; +}; +.fi +.in + +¤È¤¤¤¦¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +¤³¤³¤Ç¡¢\fIkb_cnt\fP ¤ÏÇÛÎóÃæ¤Î¥¨¥ó¥È¥ê¡¼¤Î¸Ä¿ô¤Ç¡¢¸Ä¡¹¤Î¥¨¥ó¥È¥ê¡¼¤Ï¡¢ + +.in +4n +.nf +struct kbdiacr { + unsigned char diacr; + unsigned char base; + unsigned char result; +}; +.fi +.in + +¤È¤¤¤¦¹½Â¤ÂΤǤ¢¤ë¡£ +.IP \fBKDGETKEYCODE\fP +¥«¡¼¥Í¥ë¤Î(¥¹¥­¥ã¥ó¥³¡¼¥É¤«¤é¥­¡¼¥³¡¼¥É¤Ø +ÊÑ´¹¤¹¤ë)¥­¡¼¥³¡¼¥É¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¡¼¤òÆɤ߹þ¤à¡£ +\fIargp\fP ¤Ï¡¢ + +.in +4n +.nf +struct kbkeycode { + unsigned int scancode; + unsigned int keycode; +}; +.fi +.in + +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +\fIkeycode\fP ¤Ï¡¢\fIscancode\fP ¤ËÂбþ¤·¤¿ÃͤËÀßÄꤵ¤ì¤ë¡£(¤¿¤À¤·¡¢89 +<= \fIscancode\fP <= 255 ¤Î¤ß¤Ë¤Ä¤¤¤Æ¡£1 <= \fIscancode\fP <= 88 ¤Ç¤Ï +\fIkeycode\fP == \fIscancode\fP ¤Ç¤¢¤ë¡£) +(¥«¡¼¥Í¥ë 1.1.63 °Ê¹ß) +.IP \fBKDSETKEYCODE\fP +¥«¡¼¥Í¥ë¤Î¥­¡¼¥³¡¼¥É¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¡¼¤ò½ñ¤­¹þ¤à¡£\fIargp\fP ¤Ï¹½Â¤ÂÎ +\fIstruct kbkeycode\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +(¥«¡¼¥Í¥ë 1.1.63 °Ê¹ß) +.IP \fBKDSIGACCEPT\fP +¤³¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤Ï¡¢ÆÃÊ̤ÊÁȹ礻¤Ç¥­¡¼¤ò²¡¤·¤¿»þ¤ËȯÀ¸¤¹¤ë¥·¥°¥Ê¥ë +\fIargp\fP (1 <= \fIargp\fP <= NSIG) ¤ò¿Ê¤ó¤Ç¼õ¤±ÉÕ¤±¤ë¤«¤É¤¦¤«¤ò¼¨¤¹¡£ +(linux/drivers/char/keyboard.c ¤Î Spawn_console() ¤ò¸«¤è¡£) +.IP \fBVT_OPENQRY\fP +ºÇ½é¤Î¶õ¤¤¤Æ¤¤¤ë(¤Þ¤À¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤)¥³¥ó¥½¡¼¥ë¤òÊÖ¤¹¡£ +\fIargp\fP ¤Î»Ø¤¹ \fIint\fP ·¿¤ÎÀ°¿ô¤Ë¤Ï¡¢vt ¤ÎÈֹ椬¥»¥Ã¥È¤µ¤ì¤ë +(1 <= \fI*argp\fP <= MAX_NR_CONSOLES)¡£ +.IP \fBVT_GETMODE\fP +¥¢¥¯¥Æ¥£¥Ö¤Ê vt ¤Î¥â¡¼¥É¤ò¼èÆÀ¤¹¤ë¡£\fIargp\fP¤Ï¡¢ + +.in +4n +.nf +struct vt_mode { + char mode; /* vt mode */ + char waitv; /* if set, hang on writes if not active */ + short relsig; /* signal to raise on release req */ + short acqsig; /* signal to raise on acquisition */ + short frsig; /* unused (set to 0) */ +}; +.fi +.in + +¤È¤¤¤¦¹½Â¤ÂΤò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ê¡¢¥¢¥¯¥Æ¥£¥Ö¤Ê vt ¤Î¥â¡¼¥É¤¬ +¥»¥Ã¥È¤µ¤ì¤ë¡£ +\fImode\fP ¤Ï¼¡¤Î¤É¤ì¤«¤ËÀßÄꤵ¤ì¤ë¡§ + + VT_AUTO ¼«Æ°vtÀÚÂؤ¨ + VT_PROCESS ¥×¥í¥»¥¹¥³¥ó¥È¥í¡¼¥ëÀÚÂؤ¨ + VT_ACKACQ ¥¢¥¯¥Î¥ê¥Ã¥¸ÀÚÂؤ¨ +.IP \fBVT_SETMODE\fP +¥¢¥¯¥Æ¥£¥Ö¤Ê vt ¤Î¥â¡¼¥É¤òÀßÄꤹ¤ë¡£\fIargp\fP ¤Ï¹½Â¤ÂÎ +\fIstruct vt_mode\fP ¤Ø¤Î +¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +.IP \fBVT_GETSTATE\fP +¥°¥í¡¼¥Ð¥ë¤Ê vt ¤Î¾õÂ֤ξðÊó¤ò¼èÆÀ¤¹¤ë¡£\fIargp\fP¤Ï¡¢ + +.in +4n +.nf +struct vt_stat { + unsigned short v_active; /* active vt */ + unsigned short v_signal; /* signal to send */ + unsigned short v_state; /* vt bit mask */ +}; +.fi +.in + +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +»ÈÍѤµ¤ì¤Æ¤¤¤ë¤½¤ì¤¾¤ì¤Î vt ¤Ë¤Ä¤­ \fIv_state\fP ¤ÎÂбþ¤¹¤ë¥Ó¥Ã¥È¤¬ +¥»¥Ã¥È¤µ¤ì¤ë¡£ +(¥«¡¼¥Í¥ël 1.0 ¤«¤é 1.1.92 ¤Þ¤Ç) +.IP \fBVT_RELDISP\fP +¥Ç¥£¥¹¥×¥ì¡¼¤ò²òÊü¤¹¤ë¡£ +.IP \fBVT_ACTIVATE\fP +\fIargp\fP (1 <= \fIargp\fP <= MAX_NR_CONSOLES)¤Î vt ¤ËÀÚÂؤ¨¤ë¡£ +.IP \fBVT_WAITACTIVE\fP +\fIargp\fP¤Î vt ¤¬¥¢¥¯¥Æ¥£¥Ö¤Ë¤Ê¤ë¤Þ¤ÇÂԤġ£ +.IP \fBVT_DISALLOCATE\fP +\fIargp\fP ¤Î vt ¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤¿¥á¥â¥ê¡¼¤ò²òÊü¤¹¤ë¡£ +(¥«¡¼¥Í¥ë 1.1.54 °Ê¹ß) +.IP \fBVT_RESIZE\fP +¥«¡¼¥Í¥ë¤¬Ç§¼±¤¹¤ë¥¹¥¯¥ê¡¼¥ó¥µ¥¤¥º¤òÀßÄꤹ¤ë¡£\fIargp\fP ¤Ï¡¢ + +.in +4n +.nf +struct vt_sizes { + unsigned short v_rows; /* # rows */ + unsigned short v_cols; /* # columns */ + unsigned short v_scrollsize; /* no longer used */ +}; +.fi +.in + +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï¥Ó¥Ç¥ª¥â¡¼¥É¤òÊѹ¹¤·¤Ê¤¤»ö¤ËÃí°Õ¡£ +.BR resizecons (8) +¤ò¸«¤è(¥«¡¼¥Í¥ë 1.1.54 °Ê¹ß)¡£ +.IP \fBVT_RESIZEX\fP +¥«¡¼¥Í¥ë¤¬Ç§¼±¤¹¤ë³Æ¼ï¤Î¥¹¥¯¥ê¡¼¥ó¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë¡£\fIargp\fP ¤Ï¡¢ + +.in +4n +.nf +struct vt_consize { + unsigned short v_rows; /* number of rows */ + unsigned short v_cols; /* number of columns */ + unsigned short v_vlin; /* number of pixel rows + on screen */ + unsigned short v_clin; /* number of pixel rows + per character */ + unsigned short v_vcol; /* number of pixel columns + on screen */ + unsigned short v_ccol; /* number of pixel columns + per character */ +}; +.fi +.in + +¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£ + +¥Ñ¥é¥á¡¼¥¿¤Ï¥¼¥í¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¡£¤½¤Î¤È¤­¤Ï¡ÖÊѹ¹¤·¤Ê¤¤¤³¤È¡×¤ò +°ÕÌ£¤¹¤ë¤¬¡¢Ê£¿ô¤Î¥Ñ¥é¥á¡¼¥¿¤¬ÀßÄꤵ¤ì¤¿»þ¤Ë¤Ï¤½¤ì¤é¤Î´Ö¤ÇÌ·½â¤¬ +¤Ê¤¤¤è¤¦¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ¤â¥Ó¥Ç¥ª¥â¡¼¥É¤ÏÊѹ¹¤µ¤ì¤Ê¤¤»ö¤ËÃí°Õ¡£ +.BR resizecons (8) +¤ò»²¾È¤Î»ö(¥«¡¼¥Í¥ë 1.3.3 °Ê¹ß)¡£ +.PP +°Ê²¼¤Î ioctl ¤¬¤É¤Î¤è¤¦¤ËÆ°ºî¤ò¤¹¤ë¤«¤Ï¡¢\fIargp\fP ¤¬»Ø¤¹¹½Â¤ÂΤΠ+ºÇ½é¤Î¥Ð¥¤¥È(¤³¤³¤Ç¤Ï \fIsubcode\fP ¤È¸Æ¤Ö)¤Ë°Í¸¤¹¤ë¡£ +¤³¤ì¤é¤Î¸Æ½Ð¤·¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤«¸½ºß¤Î tty ¤Î¥ª¡¼¥Ê¤Ë¤Î¤ßµö¤µ¤ì¤ë¡£ +.IP "\fBTIOCLINUX, subcode=0\fP" +¥¹¥¯¥ê¡¼¥ó¤ò¥À¥ó¥×(dump)¤¹¤ë +¥«¡¼¥Í¥ë 1.1.92 °Ê¹ß¤Ç¤Ê¤¯¤Ê¤Ã¤¿(1.1.92 °Ê¹ß¤Ç¤Ï¡¢Âå¤ï¤ê¤Ë /dev/vcsN +¤Þ¤¿¤Ï /dev/vcsaN ¤è¤êÆɤ߹þ¤à)¡£ +.IP "\fBTIOCLINUX, subcode=1\fP" +¥¿¥¹¥¯¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£¥«¡¼¥Í¥ë 1.1.92 ¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£ +.IP "\fBTIOCLINUX, subcode=2\fP" +ÁªÂò¤òÀßÄꤹ¤ë¡£ +\fIargp\fP ¤¬»Ø¤¹¤Î¤Ï¡¢ +.in +4n +.nf + +struct { + char subcode; + short xs, ys, xe, ye; + short sel_mode; +} + +.fi +.in +¤Ç¤¢¤ê¡¢¤³¤³¤Ç +\fIxs\fP ¤È \fIys\fP ¤Ï»Ï¤á¤Î·å¤È¹Ô¤Ç¡¢\fIxe\fP ¤È \fIye\fP ¤Ï½ª¤ê¤Î·å¤È +¹Ô¤Ç¤¢¤ë¡£ +(º¸¾å¤Î¶ù¤¬ ·å=¹Ô=1 ) +\fIsel_mode\fP ¤Ï 0 ¤¬Ê¸»úËè¤ÎÁªÂò¤Ç¡¢1¤Ï¸ìËè¤ÎÁªÂò¡¢2¤Ï¹ÔËè¤ÎÁªÂò¤ò +°ÕÌ£¤¹¤ë¡£ +¼¨¤µ¤ì¤¿¥¹¥¯¥ê¡¼¥ó¾å¤Îʸ»ú¤Ï¥Ï¥¤¥é¥¤¥Èɽ¼¨¤µ¤ì devices/char/console.c ¤Î +ÀÅŪÇÛÎó sel_buffer ¤ËÊݸ¤µ¤ì¤ë¡£ +.IP "\fBTIOCLINUX, subcode=3\fP" +ÁªÂò¤·¤¿¤â¤Î¤ò¥Ú¡¼¥¹¥È¤¹¤ë¡£ +ÁªÂò¥Ð¥Ã¥Õ¥¡Ãæ¤Îʸ»ú ¤¬ \fIfd\fP ¤Ë½ñ¤­½Ð¤µ¤ì¤ë¡£ +.IP "\fBTIOCLINUX, subcode=4\fP" +¥¹¥¯¥ê¡¼¥ó¤ò¥¢¥ó¥Ö¥é¥ó¥¯(unblank)¤¹¤ë¡£ +.IP "\fBTIOCLINUX, subcode=5\fP" +¸ìËè¤ÎÁªÂò¤Î¤¿¤á¤Î¡Ö¸ì¡×Ãæ¤Îʸ»ú¤òµ¬Äꤷ¤Æ¤¤¤ë 256 ¥Ó¥Ã¥È¤Î¥ë¥Ã¥¯¥¢¥Ã¥× +¥Æ¡¼¥Ö¥ë¤ÎÆâÍƤòÀßÄꤹ¤ë(¥«¡¼¥Í¥ë 1.1.32 °Ê¹ß)¡£ +.IP "\fBTIOCLINUX, subcode=6\fP" +\fIargp\fP ¤Ïʸ»úÊÑ¿ô¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¡¢¤½¤ÎÆâÍƤ¬¥«¡¼¥Í¥ëÊÑ¿ô +\fIshift_state\fP¤ÎÃͤËÀßÄꤵ¤ì¤ë(¥«¡¼¥Í¥ë 1.1.32 °Ê¹ß)¡£ +.IP "\fBTIOCLINUX, subcode=7\fP" +\fIargp\fP ¤Ïʸ»úÊÑ¿ô¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¡¢¤½¤ÎÆâÍƤ¬¥«¡¼¥Í¥ëÊÑ¿ô +\fIreport_mouse\fP ¤ÎÃͤËÀßÄꤵ¤ì¤ë(¥«¡¼¥Í¥ë 1.1.33 °Ê¹ß)¡£ +.IP "\fBTIOCLINUX, subcode=8\fP" +¥¹¥¯¥ê¡¼¥óÉý¡¢¥¹¥¯¥ê¡¼¥ó¹â¤µ¡¢¥«¡¼¥½¥ë°ÌÃÖ¡¢Á´¤Æ¤Îʸ»ú°À­¤ÎÁȤò¥À¥ó¥×¤¹¤ë +(¥«¡¼¥Í¥ë 1.1.67 ¤«¤é 1.1.91¤Þ¤Ç¤Î¤ß¡£ +¥«¡¼¥Í¥ë 1.1.92 °Ê¹ß¤Ç¤Ï /dev/vcsa*¤è¤êÆɤ߹þ¤à)¡£ +.IP "\fBTIOCLINUX, subcode=9\fP" +¥¹¥¯¥ê¡¼¥óÉý¡¢¥¹¥¯¥ê¡¼¥ó¹â¤µ¡¢¥«¡¼¥½¥ë°ÌÃÖ¡¢Á´¤Æ¤Îʸ»ú°À­¤ÎÁȤòÉü¸µ¤¹¤ë +(¥«¡¼¥Í¥ë 1.1.67 ¤«¤é 1.1.91 ¤Þ¤Ç¤Î¤ß¡£ +¥«¡¼¥Í¥ë 1.1.92 °Ê¹ß¤Ç¤Ï /dev/vcsa* ¤Ë½ñ¤­¹þ¤à)¡£ +.IP "\fBTIOCLINUX, subcode=10\fP" +¿·À¤Âå¥â¥Ë¥¿¡¼¤Î¥Ñ¥ï¡¼¥»¡¼¥Öµ¡Ç½¤òÀ©¸æ¤¹¤ë¡£ +VESA ¥¹¥¯¥ê¡¼¥ó¥Ö¥é¥ó¥­¥ó¥°¥â¡¼¥É¤¬ \fIargp\fP[1]¤ËÀßÄꤵ¤ì¤ë¡£ +¤½¤ÎÃͤϥ¹¥¯¥ê¡¼¥ó¥Ö¥é¥ó¥­¥ó¥°¤¬¤É¤Î¤è¤¦¤Ë¹Ô¤ï¤ì¤ë¤«¤ò¼¨¤¹¡£°Ê²¼¤¬¤½¤Î +ÃͤǤ¢¤ë¡£ + + \fI0\fP: ¥¹¥¯¥ê¡¼¥ó¥Ö¥é¥ó¥­¥ó¥°¤Ê¤·¡£ + + \fI1\fP:¸½ºß¤Î¥Ó¥Ç¥ª¥¢¥À¥×¥¿¡¼¥ì¥¸¥¹¥¿¤¬Êݸ¤µ¤ì¤¿¤¢¤È¡¢ +¥³¥ó¥È¥í¡¼¥é¤Ï¿âľƱ´ü¥Ñ¥ë¥¹¤ò¥ª¥Õ¤Ë¤¹¤ë¤è¤¦¥×¥í¥°¥é¥à¤µ¤ì¤ë¡£¤³¤ì¤Ë¤è¤ê +¥â¥Ë¥¿¡¼¤Ï¡Ö¥¹¥¿¥ó¥Ð¥¤¡×¥â¡¼¥É¤Ë¤Ï¤¤¤ë¡£ +¥â¥Ë¥¿¡¼¤Ë Off_Mode ¥¿¥¤¥Þ¤¬È÷¤ï¤Ã¤Æ¤ª¤ì¤Ð¡¢ºÇ½ªÅª¤Ë¤Ï¥â¥Ë¥¿¡¼¤¬¼«Ê¬¤Ç +ÅŸ»¤òÍ¡£ + + \fI2\fP:¸½ºß¤ÎÀßÄê¤òÊݸ¤·¤¿¸å¡¢¿âľ¡¢¿åʿƱ´ü¥Ñ¥ë¥¹¤¬¥ª¥Õ¤Ë¤Ê¤ë¡£ +¤³¤ì¤Ë¤è¤ê¥â¥Ë¥¿¡¼¤Ï¡Ö¥ª¥Õ¡×¥â¡¼¥É¤Ë¤Ê¤ë¡£ +¥â¥Ë¥¿¡¼¤Ë Off_Mode ¥¿¥¤¥Þ¡¼¤¬¤Ê¤¤»þ¡¢¤Þ¤¿¤Ï¡¢blank_timer ¤¬¥¿¥¤¥à¥¢¥¦¥È¤·¤¿¤é +¤¹¤°¤Ë¥â¥Ë¥¿¡¼¤ÎÅŸ»¤òÍ¤¿¤¤¤È¤­¤Ë¤³¤ÎÁªÂò»è¤òÁª¤Ö¡£ +(Ãí°Õ¡§ÉÑÈˤ˥â¥Ë¥¿¡¼¤ÎÅŸ»¤òÀÚ¤ë¤È¥â¥Ë¥¿¡¼¤òÄˤá¤ë¡£) + +(¥«¡¼¥Í¥ë 1.1.76 °Ê¹ß) + +.SH Ìá¤êÃÍ +À®¸ù»þ¤Ë¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤ËÂФ·¤Æ¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢ +\fIerrno\fP ¤¬ÀßÄꤵ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +\fIerrno\fP ¤Ï¼¡¤Î¤è¤¦¤ÊÃͤò¤È¤ë: +.TP +.B EBADF +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Ìµ¸ú¡£ +.TP +.B ENOTTY +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥­¥ã¥é¥¯¥¿¡¦¥¹¥Ú¥·¥ã¥ë¥Ç¥Ð¥¤¥¹¤È´ØÏ¢ÉÕ¤±¤é¤ì¤Æ +¤¤¤Ê¤¤¡£¤Þ¤¿¤Ï¡¢Í׵ᤵ¤ì¤¿¤â¤Î¤¬¤½¤ì¤ËÅö¤Æ¤Ï¤Þ¤é¤Ê¤¤¡£ +.TP +.B EINVAL +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Þ¤¿¤Ï \fIargp\fP ¤¬Ìµ¸ú¡£ +.TP +.B EPERM +¸¢¸Â¤¬ÉÔ½½Ê¬¡£ + +.SH Ãí°Õ +.BR ·Ù¹ð : +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò Linux ¤Î¥³¥ó¥½¡¼¥ë ioctl ¤òʸ½ñ²½¤·¤¿¤â¤Î¤È»×¤ï¤Ê¤¤»ö¡£ +¤³¤ì¤Ï¡¢¶½Ì£¤¬¤¢¤ë¿Í¤¬¥½¡¼¥¹¤òÆɤळ¤È¤ÎÂå¤ï¤ê¤Ë¤Ê¤ë¤è¤¦¤ËÍÑ°Õ¤·¤¿Êª¤Ç¤¢¤ë¡£ +ioctl ¤Ïʸ½ñ²½¤µ¤ì¤Ê¤¤ Linux ¤ÎÆâÉôµ¡Ç½¤Ç¤¢¤Ã¤Æ¡¢·Ù¹ð¤Ê¤·¤Ë +Êѹ¹¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +(¤½¤·¤Æ¡¢¤³¤Î¥Ú¡¼¥¸¤Ï¥«¡¼¥Í¥ë 1.1.94 ¤Î¤È¤­¤Î¾õ¶·¤òµ­½Ò¤·¤¿Êª¤Ç¡¢¤½¤ì¤Ï +°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤ÈÈæ¤Ù¤ì¤Ð¡¢Â¿¤¯¤Î°ã¤¤¤¬¤¢¤ë) + +ioctl ¤Ï¥«¡¼¥Í¥ë¤È¡¢¤¢¤ëÆÃÄê¤Î¤è¤¯ÃΤé¤ì¤¿¥×¥í¥°¥é¥à¤È¤Î¾ðÊó¸ò´¹¤Î¤¿¤á¤Ë +ƳÆþ¤µ¤ì¤ë»ö¤¬Èó¾ï¤Ë¿¤¤(fdisk, hdparm, setserial,tunelp, loadkeys, +selection, setfont ¤Ê¤É)¡£¤½¤Î¤¿¤á ioctl ¤ÎÆ°ºî¤Ï¡¢¤½¤ÎÆÃÄê¤Î¥×¥í¥°¥é¥à¤¬ +ɬÍפȤ·¤¿»þ¤Ë¤ÏÊѹ¹¤Ë¤Ê¤ë¡£ + +¤³¤ì¤é¤Î ioctl ¤ò»È¤Ã¤¿¥×¥í¥°¥é¥à¤Ï¾¤Î¥Ð¡¼¥¸¥ç¥ó¤Î Unix ¤È¤Î¸ß´¹À­¤¬ +¤Ê¤¤¤·¡¢¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Linux ¤Ç¤Ï¡¢Áö¤é¤Ê¤¤¡£¤µ¤é¤Ë¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Î +Linux ¤Ç¤ÏÁö¤é¤Ê¤¯¤Ê¤ë¤«¤âÃΤì¤Ê¤¤¡£ + +POSIX µ¡Ç½¤ò»È¤¤¤Ê¤µ¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR dumpkeys (1), +.BR kbd_mode (1), +.BR loadkeys (1), +.BR mknod (1), +.BR setleds (1), +.BR setmetamode (1), +.BR execve (2), +.BR fcntl (2), +.BR ioperm (2), +.BR termios (3), +.BR console (4), +.BR console_codes (4), +.BR mt (4), +.BR sd (4), +.BR tty (4), +.BR tty_ioctl (4), +.BR ttyS (4), +.BR vcs (4), +.BR vcsa (4), +.BR charsets (7), +.BR mapscrn (8), +.BR resizecons (8), +.BR setfont (8), +.IR /usr/include/linux/kd.h , +.I /usr/include/linux/vt.h diff --git a/release/man4/dsp56k.4 b/release/man4/dsp56k.4 new file mode 100644 index 00000000..a1dc6a43 --- /dev/null +++ b/release/man4/dsp56k.4 @@ -0,0 +1,123 @@ +'\" t +.\" Copyright (c) 2000 lars brinkhoff +.\" +.\" 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, Thu Jan 27 19:16:19 CET 2000, lars@nocrew.org +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jul 11 20:05:48 JST 2000 +.\" by Yuichi SATO +.\" +.\"WORD: handshake ¥Ï¥ó¥É¥·¥§¥¤¥¯ +.\"WORD: device ¥Ç¥Ð¥¤¥¹ +.\"WORD: processer ¥×¥í¥»¥Ã¥µ¡¼ +.\"WORD: transmit Á÷¿® +.\"WORD: recieve ¼õ¿® +.\"WORD: quantity ñ°Ì +.\" +.TH DSP56K 4 2000-03-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +dsp56k \- DSP56001 ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¡¦¥Ç¥Ð¥¤¥¹ +.SH ½ñ¼° +.nf +#include +.sp +.BI "ssize_t read(int " fd ", void *" data ", size_t " length ); +.BI "ssize_t write(int " fd ", void *" data ", size_t " length ); + +.BI "int ioctl(int " fd ", DSP56K_UPLOAD, struct dsp56k_upload *" program ); +.BI "int ioctl(int " fd ", DSP56K_SET_TX_WSIZE, int " wsize ); +.BI "int ioctl(int " fd ", DSP56K_SET_RX_WSIZE, int " wsize ); +.BI "int ioctl(int " fd ", DSP56K_HOST_FLAGS, struct dsp56k_host_flags *" flags ); +.BI "int ioctl(int " fd ", DSP56K_HOST_CMD, int " cmd ); +.fi +.SH ÀßÄê +dsp56k ¥Ç¥Ð¥¤¥¹¤Ï¡¢¥á¥¸¥ã¡¼ÈÖ¹æ 55¡¢¥Þ¥¤¥Ê¡¼ÈÖ¹æ 0 ¤Î +¥­¥ã¥é¥¯¥¿¡¼¡¦¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£ +.SH ÀâÌÀ +Motorola DSP56001 ¤Ï¡¢Atari Falcon030 ¸ß´¹¤Î¥³¥ó¥Ô¥å¡¼¥¿¤Ç»È¤ï¤ì¤Æ¤¤¤ë +¥Õ¥ë¥×¥í¥°¥é¥Þ¥Ö¥ë¤Ê 24 ¥Ó¥Ã¥È¤Î¥Ç¥¸¥¿¥ë¥·¥°¥Ê¥ë¥×¥í¥»¥Ã¥µ¡¼¤Ç¤¢¤ë¡£ +¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë \fIdsp56k\fP ¤Ï¡¢DSP56001 ¤ÎÀ©¸æ¤È +ÁÐÊý¸þ¥Ï¥ó¥É¥·¥§¥¤¥¯¥Û¥¹¥È¥Ý¡¼¥È¤Ç¤Î¥Ç¡¼¥¿¤ÎÁ÷¼õ¿®¤Î¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.PP +¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥à¤ò¥·¥°¥Ê¥ë¥×¥í¥»¥Ã¥µ¡¼¤ËÁ÷¿®¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ +.BR write (2) +¤ò»È¤¦¤³¤È¡£ +½èÍý¤µ¤ì¤¿¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.BR read (2) +¤ò»È¤¦¤³¤È¡£ +¥Û¥¹¥È¦¤Ç¤Ï¡¢¥Ç¡¼¥¿¤Ï 8, 16, 24, 32 ¥Ó¥Ã¥Èñ°Ì¤ÇÁ÷¼õ¿®¤Ç¤­¤ë¤¬¡¢ +DSP56001 Æâ¤Ç¤Ï¡¢24 ¥Ó¥Ã¥Èñ°Ì¤Ç°·¤ï¤ì¤ë¡£ +.PP +¼¡¤Î +.BR ioctl (2) +¥³¡¼¥ë¤¬ \fIdsp56k\fP ¥Ç¥Ð¥¤¥¹¤òÀ©¸æ¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.IP \fBDSP56K_UPLOAD\fP +DSP56001 ¤ò¥ê¥»¥Ã¥È¤·¡¢¥×¥í¥°¥é¥à¤ò¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë¡£ +.BR ioctl (2) +¤Î 3 ÈÖÌܤΰú¤­¿ô¤Ï¡¢ +¹½Â¤ÂÎ \fIstruct dsp56k_binary\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¹½Â¤ÂΤΥá¥ó¥Ð¡¼ \fIbin\fP ¤Ï DSP56001 ¥Ð¥¤¥Ê¥ê¥×¥í¥°¥é¥à¤ò»Ø¤·¡¢ +¹½Â¤ÂΤΥá¥ó¥Ð¡¼ \fIlen\fP ¤Ï 24 ¥Ó¥Ã¥È¥ï¡¼¥É¤Ç¿ô¤¨¤¿ +¥×¥í¥°¥é¥à¤ÎŤµ¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP \fBDSP56K_SET_TX_WSIZE\fP +Á÷¿®¥ï¡¼¥É¥µ¥¤¥º¤òÀßÄꤹ¤ë¡£ +ÀßÄê¤Ç¤­¤ëÃÍ¤Ï 1 ¡Á 4 ¤ÎÈϰϤǡ¢¤³¤Î¥Ð¥¤¥È¿ôʬ¤À¤± 1 ÅÙ¤Ë DSP56001 ¤ËÁ÷¿®¤¹¤ë¡£ +¤³¤Î¥Ç¡¼¥¿Ã±°Ì¤Ï¡¢DSP56001 ËÜÍè¤Î 24 ¥Ó¥Ã¥È¥Ç¡¼¥¿·Á¼°¤Ë¹ç¤ï¤»¤ë¤¿¤á¡¢ +¥¼¥í¤Î¥Ð¥¤¥È¤ÇËä¤á¤é¤ì¤¿¤ê¡¢ÀÚ¤êµÍ¤á¤é¤ì¤¿¤ê¤¹¤ë¡£ +.IP \fBDSP56K_SET_RX_WSIZE\fP +¼õ¿®¥ï¡¼¥É¥µ¥¤¥º¤òÀßÄꤹ¤ë¡£ +ÀßÄê¤Ç¤­¤ëÃÍ¤Ï 1 ¡Á 4 ¤ÎÈϰϤǡ¢ +¤³¤Î¥Ð¥¤¥È¿ôʬ¤À¤± 1 ÅÙ¤Ë DSP56001 ¤«¤é¼õ¿®¤¹¤ë¡£ +¤³¤Î¥Ç¡¼¥¿Ã±°Ì¤Ï¡¢DSP56001 ËÜÍè¤Î 24 ¥Ó¥Ã¥È¥Ç¡¼¥¿·Á¼°¤Ë¹ç¤ï¤»¤ë¤¿¤á¡¢ +ÀÚ¤êµÍ¤á¤é¤ì¤¿¤ê¡¢NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤ÇËä¤á¤é¤ì¤¿¤ê¤¹¤ë¡£ +.IP \fBDSP56K_HOST_FLAGS\fP +¥Û¥¹¥È¥Õ¥é¥°¤òÆɤ߽ñ¤­¤¹¤ë¡£ +¥Û¥¹¥È¥Õ¥é¥°¤Ï¡¢°ìÈÌŪ¤ÊÌÜŪ¤Ç»È¤¦¤³¤È¤Î¤Ç¤­¤ë¥Ó¥Ã¥È¤Ç¡¢ +¥Û¥¹¥È¥³¥ó¥Ô¥å¡¼¥¿¤È DSP56001 ¤ÎξÊý¤«¤éÆɤळ¤È¤¬¤Ç¤­¤ë¡£ +¥Ó¥Ã¥È 0 ¤È 1 ¤Ï¡¢¥Û¥¹¥È¤Ë¤è¤Ã¤Æ½ñ¤­¹þ¤à¤³¤È¤¬¤Ç¤­¡¢ +¥Ó¥Ã¥È 2 ¤È 3 ¤Ï¡¢DSP56001 ¤Ë¤è¤Ã¤Æ½ñ¤­¹þ¤à¤³¤È¤¬¤Ç¤­¤ë¡£ + +¥Û¥¹¥È¥Õ¥é¥°¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.BR ioctl (2) +¤Î 3 ÈÖÌܤΰú¤­¿ô¤¬ +¹½Â¤ÂÎ \fIstruct dsp56k_host_flags\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î¹½Â¤ÂΤΥá¥ó¥Ð¡¼ \fIdir\fP ¤Î¥Ó¥Ã¥È 0 ¤Þ¤¿¤Ï 1 ¤¬ÀßÄꤵ¤ì¤ë¤È¡¢ +¥á¥ó¥Ð¡¼ \fIout\fP ¤ÎÂбþ¤¹¤ë¥Ó¥Ã¥È¤ÎÃͤ¬¥Û¥¹¥È¥Õ¥é¥°¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +¤¹¤Ù¤Æ¤Î¥Û¥¹¥È¥Õ¥é¥°¤Î¾õÂ֤ϡ¢¹½Â¤ÂΤΥá¥ó¥Ð¡¼ \fIstatus\fP ¤Î +²¼¤«¤é 4 ¥Ó¥Ã¥È¤È¤·¤ÆÊÖ¤µ¤ì¤ë¡£ +.IP \fBDSP56K_HOST_CMD\fP +¥Û¥¹¥È¥³¥Þ¥ó¥É¤òÁ÷¿®¤¹¤ë¡£ +Á÷¿®¤Ç¤­¤ëÃÍ¤Ï 0 ¡Á 31 ¤ÎÈϰϤǡ¢DSP56001 ¤ÇÆ°ºî¤·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ +½èÍý¤µ¤ì¤ë¥æ¡¼¥¶¡¼ÄêµÁ¥³¥Þ¥ó¥É¤Ç¤¢¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +/dev/dsp56k +.\" .SH Ãø¼Ô +.\" Fredrik Noring , lars brinkhoff , +.\" Tomas Berndtsson . +.SH ´ØÏ¢¹àÌÜ +.IR linux/include/asm-m68k/dsp56k.h , +.IR linux/drivers/char/dsp56k.c , +.IR http://dsp56k.nocrew.org/ , +DSP56000/DSP56001 Digital Signal Processor User's Manual diff --git a/release/man4/fd.4 b/release/man4/fd.4 new file mode 100644 index 00000000..6c3d211e --- /dev/null +++ b/release/man4/fd.4 @@ -0,0 +1,231 @@ +'\" t +.\" Copyright (c) 1993 Michael Haardt (michael@cantor.informatik.rwth-aachen.de) +.\" and 1994,1995 Alain Knaff (Alain.Knaff@imag.fr) +.\" +.\" 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, Sun Feb 26 15:00:02 1995, faith@cs.unc.edu +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Sun Jan 11 03:25:38 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: floppy disk ¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯ +.\" WORD: double density ÇÜÌ©ÅÙ +.\" WORD: high density ¹âÌ©ÅÙ +.\" WORD: extra density ³Èĥ̩ÅÙ +.\" WORD: interleaved format ¥¤¥ó¥¿¡¼¥ê¡¼¥Ö¥É¥Õ¥©¡¼¥Þ¥Ã¥È +.\" WORD: media ¥á¥Ç¥£¥¢ +.\" WORD: geometry ¥¸¥ª¥á¥È¥ê +.\" WORD: buffer cache ¥Ð¥Ã¥Õ¥¡¥­¥ã¥Ã¥·¥å +.\" WORD: threshold ïçÃÍ +.\" WORD: clear ¥¯¥ê¥¢¡¼ +.\" +.TH FD 4 1995-01-29 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +fd \- ¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯(floppy disk)¥Ç¥Ð¥¤¥¹ +.SH ÀßÄê +¥Õ¥í¥Ã¥Ô¡¼¥É¥é¥¤¥Ö¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 2 ¤ò»ý¤Ä¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£ +°ìÈÌŪ¤Ë¤Ï¡¢¤³¤Î¥Ç¥Ð¥¤¥¹¤Î¥ª¡¼¥Ê¡¼¤Ï root.floppy (¥ª¡¼¥Ê¡¼ root¡¢ +¥°¥ë¡¼¥× floppy)¤Ç¡¢¥â¡¼¥É 0660 (¥°¥ë¡¼¥×¤Î¹½À®°÷¤Ç¤¢¤ë¤³¤È¤Ë +¤è¤Ã¤Æ¥¢¥¯¥»¥¹¥Á¥§¥Ã¥¯¤¬¹Ô¤ï¤ì¤ë)¡¢¤Þ¤¿¤Ï¡¢¥â¡¼¥É 0666 (ï¤Ç¤â¥¢¥¯¥»¥¹ +¤Ç¤­¤ë) ¤Ç¤¢¤ë¡£¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼¤Ï¥Ç¥Ð¥¤¥¹¤Î¥¿¥¤¥×¡¢¥É¥é¥¤¥Ö¤ÎÈֹ桢¥³ +¥ó¥È¥í¡¼¥é¡¼¤ÎÈÖ¹æ¤òÉä¹æ²½¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£¤½¤ì¤¾¤ì¤Î¥Ç¥Ð¥¤¥¹¥¿¥¤¥× +(¤³¤ì¤Ï¡¢Ì©ÅÙ (density) ¤È¥È¥é¥Ã¥¯¥«¥¦¥ó¥È (track count) ¤ÎÁȹ礻¤Ç¤¢¤ë) +¤Ï¡¢¥Ù¡¼¥¹¤È¤Ê¤ë¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼¤ò»ý¤Ã¤Æ¤¤¤ë¡£¤³¤Î¥Ù¡¼¥¹¥Ê¥ó¥Ð¡¼¤Ë¤½¤Î +¥³¥ó¥È¥í¡¼¥é¡¼¾å¤Î¥É¥é¥¤¥Ö¥Ê¥ó¥Ð¡¼¤ò²Ã¤¨¤ë¡£¤â¤·¡¢¤½¤Î¥É¥é¥¤¥Ö¤¬ 2 ÈÖÌܤΠ+¥³¥ó¥È¥í¡¼¥é¡¼¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¤Ê¤é¡¢¤µ¤é¤Ë 128 ¤ò²Ã¤¨¤ë¡£¼¡¤Î¥Ç¥Ð¥¤¥¹ +¥Æ¡¼¥Ö¥ë¤Ç¤Ï¡¢ \fIn\fP ¤Ï¥É¥é¥¤¥ÖÈÖ¹æ¤òɽ¤¹¡£ +.PP +·Ù¹ð: ¤â¤·¡¢¥É¥é¥¤¥Ö¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤è¤ê¿¤¯¤Î¥È¥é¥Ã¥¯¤ò»ý¤Ä¤è¤¦¤Ë +¥Õ¥©¡¼¥Þ¥Ã¥È¤·¤è¤¦¤È¤·¤¿¾ì¹ç¡¢µ¡³£Åª¤Ê¥À¥á¡¼¥¸¤ò°ú¤­µ¯¤³¤¹¤«¤âÃΤì¤Ê¤¤¡£ +.PP +ËÝÌõ¼ÔÃí: +°Ê²¼¤Îɽ¤ËÍѤ¤¤é¤ì¤ëÍѸì¤Ïɽ¤ÎÀ°·Á¤Î´Ø·¸¤«¤é +(°ì¹Ô¤Ë¤¦¤Þ¤¯Ç¼¤á¤ë»ö¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¤¿¤á) +¤«¤é¸¶Ê¸¤Î¤Þ¤Þ¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤È¤ÎÂбþ¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ +.TS +l l. +Name ̾Á° +Capac. ÍÆÎÌ +Cyl. ¥·¥ê¥ó¥À¿ô +Sect. ¥»¥¯¥¿¿ô +Heads. ¥Ø¥Ã¥À¿ô +Base minor # ¥Ù¡¼¥¹¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ +.TE + +¥á¥Ç¥£¥¢¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ÈÍÆÎ̤ò¼«Æ°Åª¤Ë¸¡½Ð¤¹¤ë¥É¥é¥¤¥ÖÈó°Í¸¤Î¥Ç¥Ð¥¤¥¹ +¥Õ¥¡¥¤¥ë: +.TS +l l. +Name Base minor # +_ +\fBfd\fP\fIn\fP 0 +.TE +.PP +5.25 ¥¤¥ó¥ÁÇÜÌ©ÅÙ(double density)¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBd360\fP 360K 40 9 2 4 +.TE +.PP +5.25 ¥¤¥ó¥Á¹âÌ©ÅÙ(high density)¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBh360\fP 360K 40 9 2 20 +\fBfd\fP\fIn\fP\fBh410\fP 410K 41 10 2 48 +\fBfd\fP\fIn\fP\fBh420\fP 420K 42 10 2 64 +\fBfd\fP\fIn\fP\fBh720\fP 720K 80 9 2 24 +\fBfd\fP\fIn\fP\fBh880\fP 880K 80 11 2 80 +\fBfd\fP\fIn\fP\fBh1200\fP 1200K 80 15 2 8 +\fBfd\fP\fIn\fP\fBh1440\fP 1440K 80 18 2 40 +\fBfd\fP\fIn\fP\fBh1476\fP 1476K 82 18 2 56 +\fBfd\fP\fIn\fP\fBh1494\fP 1494K 83 18 2 72 +\fBfd\fP\fIn\fP\fBh1600\fP 1600K 80 20 2 92 +.TE +.PP +3.5 ¥¤¥ó¥ÁÇÜÌ©ÅÙ(double density)¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBD360\fP 360K 80 9 1 12 +\fBfd\fP\fIn\fP\fBD720\fP 720K 80 9 2 16 +\fBfd\fP\fIn\fP\fBD800\fP 800K 80 10 2 120 +\fBfd\fP\fIn\fP\fBD1040\fP 1040K 80 13 2 84 +\fBfd\fP\fIn\fP\fBD1120\fP 1120K 80 14 2 88 +.TE +.PP +3.5 ¥¤¥ó¥Á¹âÌ©ÅÙ(high density)¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBH360\fP 360K 40 9 2 12 +\fBfd\fP\fIn\fP\fBH720\fP 720K 80 9 2 16 +\fBfd\fP\fIn\fP\fBH820\fP 820K 82 10 2 52 +\fBfd\fP\fIn\fP\fBH830\fP 830K 83 10 2 68 +\fBfd\fP\fIn\fP\fBH1440\fP 1440K 80 18 2 28 +\fBfd\fP\fIn\fP\fBH1600\fP 1600K 80 20 2 124 +\fBfd\fP\fIn\fP\fBH1680\fP 1680K 80 21 2 44 +\fBfd\fP\fIn\fP\fBH1722\fP 1722K 82 21 2 60 +\fBfd\fP\fIn\fP\fBH1743\fP 1743K 83 21 2 76 +\fBfd\fP\fIn\fP\fBH1760\fP 1760K 80 22 2 96 +\fBfd\fP\fIn\fP\fBH1840\fP 1840K 80 23 2 116 +\fBfd\fP\fIn\fP\fBH1920\fP 1920K 80 24 2 100 +.TE +.PP +3.5 ¥¤¥ó¥Á³Èĥ̩ÅÙ(extra density)¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë: +.TS +lw(1i) l l l l l. +Name Capac. Cyl. Sect. Heads Base minor # +_ +\fBfd\fP\fIn\fP\fBE2880\fP 2880K 80 36 2 32 +\fBfd\fP\fIn\fP\fBCompaQ\fP 2880K 80 36 2 36 +\fBfd\fP\fIn\fP\fBE3200\fP 3200K 80 40 2 104 +\fBfd\fP\fIn\fP\fBE3520\fP 3520K 80 44 2 108 +\fBfd\fP\fIn\fP\fBE3840\fP 3840K 80 48 2 112 +.TE +.SH ÀâÌÀ +\fBfd\fP ¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ï¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ö¤Ë¥í¡¼¥â¡¼¥É +(raw mode)¤Ç +¥¢¥¯¥»¥¹¤¹¤ë¡£\fBfd\fP ¤Ç¤Ï¡¢¼¡¤Î +.BR ioctl (2) +¥³¡¼¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.IP \fBFDCLRPRM\fP +¥É¥é¥¤¥Ö¤Î¥á¥Ç¥£¥¢¾ðÊó(¥É¥é¥¤¥ÖÆâ¤Î¥Ç¥£¥¹¥¯¤Î¥¸¥ª¥á¥È¥ê¾ðÊó)¤ò¥¯¥ê¥¢¤¹ +¤ë¡£ +.IP \fBFDSETPRM\fP +¥É¥é¥¤¥Ö¤Î¥á¥Ç¥£¥¢¾ðÊó¤ò¥»¥Ã¥È¤¹¤ë¡£¥á¥Ç¥£¥¢¾ðÊó¤Ï¥á¥Ç¥£¥¢¤¬¸ò´¹¤µ¤ì¤¿ +»þ¡¢¼º¤ï¤ì¤ë¡£ +.IP \fBFDDEFPRM\fP +¥É¥é¥¤¥Ö¤Î¥á¥Ç¥£¥¢¾ðÊó(¥É¥é¥¤¥ÖÆâ¤Î¥Ç¥£¥¹¥¯¤Î¥¸¥ª¥á¥È¥ê¾ðÊó)¤ò¥»¥Ã¥È¤¹ +¤ë¡£¥á¥Ç¥£¥¢¾ðÊó¤Ï¥á¥Ç¥£¥¢¤¬¸ò´¹¤µ¤ì¤¿»þ¤Ç¤â¼º¤ï¤ì¤Ê¤¤¡£¤³¤ì¤Ï(¥á¥Ç¥£ +¥¢¾ðÊó¤Î)¼«Æ°¸¡½Ð¤ò̵¸ú¤Ë¤¹¤ë¡£¼«Æ°¸¡½Ð¤òºÆ¤ÓÍ­¸ú¤Ë¤¹¤ë¤¿¤á¤Ë¡¢ +\fBFDCLRPRM\fP ¤òȯ¹Ô¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP \fBFDGETDRVTYP\fP +¥É¥é¥¤¥Ö¤Î¥¿¥¤¥×(̾Á°°ú¿ô)¤òÊÖ¤¹¡£¤½¤ì¤¾¤ì¤Î¥É¥é¥¤¥Ö¥¿¥¤¥×¤ËŬ¹ç¤¹¤ë¤è +¤¦¤Ë¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¹Ô¤¦¤¿¤á¡¢\fBFDGETDRVTYP\fP ¤Ï¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¥µ¥Ý¡¼¥È +¤¹¤ëºÇ¤â¸Å¤¤¥É¥é¥¤¥Ö¥¿¥¤¥×¤Î¤¿¤á¤ËŬÀÚ¤Ê̾Á°¤òÊÖ¤¹¡£ +.IP \fBFDFLUSH\fP +Í¿¤¨¤é¤ì¤¿¥É¥é¥¤¥Ö¤Î¥Ð¥Ã¥Õ¥¡¥­¥ã¥Ã¥·¥å¤ò̵¸ú¤Ë¤¹¤ë¡£ +.IP \fBFDSETMAXERRS\fP +¥¨¥é¡¼¤ÎÊó¹ð¡¢Áàºî¤ÎÃæ»ß¡¢ºÆ»î¹Ô¡¢¥ê¥»¥Ã¥È¡¢¥»¥¯¥¿¡¼Ëè¤ÎÆɤ߹þ¤ß¤Î¤¿¤á +¤Î¥¨¥é¡¼ïçÃͤò¥»¥Ã¥È¤¹¤ë¡£ +.IP \fBFDGETMAXERRS\fP +¸½ºß¤Î¥¨¥é¡¼ïçÃͤòÆÀ¤ë¡£ +.IP \fBFDGETDRVTYP\fP +¥É¥é¥¤¥Ö¤ÎÆâÉô̾¤òÆÀ¤ë¡£ +.IP \fBFDWERRORCLR\fP +½ñ¤­¹þ¤ß¥¨¥é¡¼¤ÎÅý·×¤ò¥¯¥ê¥¢¡¼¤¹¤ë¡£ +.IP \fBFDWERRORGET\fP +½ñ¤­¹þ¤ß¥¨¥é¡¼¤ÎÅý·×¤òÆɤࡣÅý·×¤Ï¡¢½ñ¤­¹þ¤ß¥¨¥é¡¼¤Î¹ç·×¡¢ºÇ½é¤Î½ñ¤­¹þ +¤ß¥¨¥é¡¼¤Ï¤É¤Î¥Ç¥£¥¹¥¯¤Î¤É¤³¤Çµ¯¤³¤Ã¤¿¤«¡¢¤½¤·¤Æ¡¢ºÇ¸å¤Î½ñ¤­¹þ¤ß¥¨¥é¡¼ +¤¬¤É¤Î¥Ç¥£¥¹¥¯¤Î¤É¤³¤Çµ¯¤³¤Ã¤¿¤«¤È¤¤¤¦¾ðÊó¤ò´Þ¤ó¤Ç¤¤¤ë¡£¥Ç¥£¥¹¥¯¤Ï¥Ç¥£ +¥¹¥¯¤Î¸ò´¹¤´¤È¤ËÁý¤¨¤ë¥¸¥§¥Í¥ì¡¼¥·¥ç¥óÈÖ¹æ¤Ë¤è¤Ã¤Æ¼±Ê̤µ¤ì¤ë¡£ +.IP \fBFDTWADDLE\fP +¿ô¥ß¥êÉäδ֥ɥ饤¥Ö¤Î¥â¡¼¥¿¡¼¤Î¥¹¥¤¥Ã¥Á¤òÀڤ롣¤³¤ì¤Ï¥Ç¥£¥¹¥¯¤Î¥»¥¯¥¿¡¼ +Ʊ»Î¤¬Àܶᤷ¤¹¤®¤Æ¤¤¤ë¥Ç¥£¥¹¥¯¤Î¥¢¥¯¥»¥¹¤Î¤¿¤á¤ËɬÍפǤ¢¤í¤¦¡£ +.IP \fBFDSETDRVPRM\fP +¥É¥é¥¤¥Ö¤ÎÍÍ¡¹¤Ê¥Ñ¥é¥á¡¼¥¿¤ò¥»¥Ã¥È¤¹¤ë¡£ +.IP \fBFDGETDRVPRM\fP +(\fBFDSETDRVPRM\fP ¤ò»È¤Ã¤Æ¥»¥Ã¥È¤·¤¿)¥Ñ¥é¥á¡¼¥¿¤òÆɤߤÀ¤¹¡£ +.IP \fBFDGETDRVSTAT\fP +¥­¥ã¥Ã¥·¥å¤µ¤ì¤Æ¤¤¤ë¥É¥é¥¤¥Ö¤Î¾õÂÖ(¥Ç¥£¥¹¥¯¤Î¸ò´¹¡¢¥é¥¤¥È¥×¥í¥Æ¥¯¥È¤Ê +¤É)¤òÆÀ¤ë¡£ +.IP \fBFDPOLLDRVSTAT\fP +¥É¥é¥¤¥Ö¤ò¥Ý¡¼¥ê¥ó¥°¤·¤Æ¡¢¤½¤Î¾õÂÖ¤òÊÖ¤¹¡£ +.IP \fBFDGETFDCSTAT\fP +¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¡¼¤Î¾õÂÖ¤òÆÀ¤ë¡£ +.IP \fBFDRESET\fP +¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¡¼¤ò¿®Íê¤Ç¤­¤ë¾õÂ֤˥ꥻ¥Ã¥È¤¹¤ë¡£ +.IP \fBFDRAWCMD\fP +¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¡¼¤ËÄã¥ì¥Ù¥ë¤Î¥³¥Þ¥ó¥É(raw command)¤òÁ÷¤ë¡£ +.PP +¤è¤êÀµ³Î¤Ê¾ðÊó¤Î¤¿¤á¤Ë¤Ï¡¢¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¡¼¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï¤â¤Á¤í +¤ó¡¢\fI\fP ¤È \fI\fP ¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤â»²¾È¤Î¤³¤È¡£ +.SH ¥Õ¥¡¥¤¥ë +/dev/fd* +.SH Ãí°Õ +ÍÍ¡¹¤Ê¥Ç¥£¥¹¥¯¤Î¥¿¥¤¥×¤ÇÍÍ¡¹¤Ê¼ïÎà¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ÎÆɤ߽ñ¤­¤¬µö¤µ¤ì¤Æ¤¤ +¤ë¡£¤·¤«¤·¡¢¤â¤·¥»¥¯¥¿´Ö¤Î¥®¥ã¥Ã¥×¤¬¾®¤µ¤¹¤®¤ë¤è¤¦¤Ë¥Õ¥í¥Ã¥Ô¡¼¤¬¥Õ¥©¡¼ +¥Þ¥Ã¥È¤µ¤ì¤¿¤Ê¤é¤Ð¡¢¥È¥é¥Ã¥¯Á´ÂΤΥ¢¥¯¥»¥¹¤Ë¿ôÉÃɬÍפˤʤ뤿¤áÀ­Ç½¤¬Äã +²¼¤¹¤ë¤À¤í¤¦¡£¤³¤ì¤òËɤ°¤¿¤á¤Ë¤Ï¡¢¥¤¥ó¥¿¡¼¥ê¡¼¥Ö¥É¡¦¥Õ¥©¡¼¥Þ¥Ã¥È +(interleaved format) ¤òÍѤ¤¤ë¡£ +.\" .SH Ãø¼Ô +.\" Alain Knaff (Alain.Knaff@imag.fr), David Niemi +.\" (niemidc@clark.net), Bill Broadhurst (bbroad@netcom.com). +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR floppycontrol (1), +.BR getfdprm (1), +.BR mknod (1), +.BR superformat (1), +.BR mount (8), +.BR setfdprm (8) +ËÝÌõ +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ diff --git a/release/man4/full.4 b/release/man4/full.4 new file mode 100644 index 00000000..a25aea85 --- /dev/null +++ b/release/man4/full.4 @@ -0,0 +1,63 @@ +.\" -*- nroff -*- +.\" +.\" This man-page is Copyright (C) 1997 John S. Kallal +.\" +.\" 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. +.\" +.\" correction, aeb, 970825 +.\" +.\" Japanese Version Copyright (c) 1998 +.\" ISHIKAWA Mutsumi, all rights reserved. +.\" +.\" Translated into Japanese Mon Jan 12 02:59:50 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated 2006-07-20, Akihiro MOTOKI , LDP v2.34 +.\" +.TH FULL 4 2007-11-24 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +full \- ¤¤¤Ä¤â full ¤Ç¤¢¤ë¥Ç¥Ð¥¤¥¹ +.SH ÀßÄê +¥·¥¹¥Æ¥à¤ËºîÀ®ºÑ¤ß¤Î \fI/dev/full\fP ¤¬¤Ê¤¤¾ì¹ç¡¢ +¼¡¤Î¥³¥Þ¥ó¥É¤Ë¤è¤êºîÀ®¤Ç¤­¤ë¡£ +.nf + + mknod \-m 666 /dev/full c 1 7 + chown root:root /dev/full +.fi +.SH ÀâÌÀ +\fI/dev/full\fP ¤Ï¡¢¥á¥¸¥ã¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 1¡¢ +¥Þ¥¤¥Ê¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 7 ¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.LP +\fI/dev/full\fP ¥Ç¥Ð¥¤¥¹¤Ø¤Î½ñ¤­¹þ¤ß¤Ï¡¢ +.B ENOSPC +¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¡£ +¤³¤ÎÆ°ºî¤ò»È¤Ã¤Æ¡¢¥×¥í¥°¥é¥à¤¬¥Ç¥£¥¹¥¯¥Õ¥ë¤Î¥¨¥é¡¼¤ò¤É¤Î¤è¤¦¤Ë +½èÍý¤¹¤ë¤«¤ò¥Æ¥¹¥È¤Ç¤­¤ë¡£ + +\fI/dev/full\fP ¥Ç¥Ð¥¤¥¹¤«¤é¤ÎÆɤ߽Ф·¤Ç¤Ï¡¢\\0 ʸ»ú(¥Ì¥ëʸ»ú)¤¬ÊÖ¤µ¤ì¤ë¡£ + +\fI/dev/full\fP ¤Î¥·¡¼¥¯ (seek) ¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +/dev/full +.SH ´ØÏ¢¹àÌÜ +.BR mknod (1), +.BR null (4), +.BR zero (4) diff --git a/release/man4/hd.4 b/release/man4/hd.4 new file mode 100644 index 00000000..87ba2542 --- /dev/null +++ b/release/man4/hd.4 @@ -0,0 +1,121 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 16:56:20 1993 by Rik Faith +.\" Modified Mon Oct 21 21:38:51 1996 by Eric S. Raymond +.\" (and some more by aeb) +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Sun Jan 11 03:35:23 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Thu Feb 5 17:36:37 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: hard disk drive ¥Ï¡¼¥É¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ö +.\" WORD: block device ¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ +.\" WORD: primary ¥×¥é¥¤¥Þ¥ê +.\" WORD: controller ¥³¥ó¥È¥í¡¼¥é +.\" WORD: master drive ¥Þ¥¹¥¿¡¼¥É¥é¥¤¥Ö +.\" WORD: slave drive ¥¹¥ì¡¼¥Ö¥É¥é¥¤¥Ö +.\" WORD: pertition ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó +.\" WORD: logical partition ÏÀÍý¥Ñ¡¼¥Æ¥£¥·¥ç¥ó +.\" WORD: pertitioning ¥Ñ¡¼¥Æ¥£¥·¥ç¥Ë¥ó¥° +.\" WORD: BSD-disklabel BSD ¥Ç¥£¥¹¥¯¥é¥Ù¥ë +.\" +.TH HD 4 1992-12-17 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +hd \- MFM/IDE ¥Ï¡¼¥É¥Ç¥£¥¹¥¯¥Ç¥Ð¥¤¥¹ +.SH ÀâÌÀ +\fBhd*\fP ¥Ç¥Ð¥¤¥¹¤Ï MFM/IDE ¥Ï¡¼¥É¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ö¤Ë¥í¡¼¥â¡¼¥É (raw mode) +¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ (block device) ¤Ç¤¢¤ë¡£¥×¥é¥¤¥Þ¥ê +(primary) IDE ¥³¥ó¥È¥í¡¼¥é (¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 3) ¤Î ¥Þ¥¹¥¿¡¼¥É¥é¥¤¥Ö +(mater drive) ¤Ï \fBhda\fR¡¢¥¹¥ì¡¼¥Ö¥É¥é¥¤¥Ö (slave drive) ¤Ï \fBhdb\fR +¤Ç¤¢¤ë¡£¤Þ¤¿¡¢¥»¥«¥ó¥É¥³¥ó¥È¥í¡¼¥é (¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 22) ¤Î¥Þ¥¹¥¿¡¼ +¥É¥é¥¤¥Ö¤Ï \fBhdc\fR ¥¹¥ì¡¼¥Ö¤Ï \fBhdd\fR ¤Ç¤¢¤ë¡£ +.LP +°ìÈÌŪ¤Ê IDE ¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Î̾Á°¤Ï +.BI hd X\c +¤Þ¤¿¤Ï¡¢ +.BI hd XP\c +¤È¤¤¤¦·ÁÂÖ¤ò¤È¤ë¡£¤³¤Î¡¢ +.I X +¤ÎÉôʬ¤ÏʪÍýŪ¤Ê¥É¥é¥¤¥Ö¤òɽ¤¹Ê¸»ú¤Ç¡¢ +.I P +¤ÎÉôʬ¤Ï¤½¤ÎʪÍýŪ¤Ê¥É¥é¥¤¥Ö¾å¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó (partition) ¤òɽ¤¹¿ô»ú¤Ç +¤¢¤ë¡£¤³¤ÎºÇ½é¤Î·Á¼° +.BI hd X, +¤Ï¥É¥é¥¤¥ÖÁ´ÂΤò¼¨¤¹¤Î¤Ë»È¤ï¤ì¤ë¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Ê¥ó¥Ð¡¼¤Ïȯ¸«¤µ¤ì¤¿¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ë½ç¤Ë³ä¤êÉÕ¤±¤é¤ì¤ë¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Ê¥ó¥Ð¡¼¤¬³ä¤êÉÕ¤±¤é¤ì¤ë¤Î¤Ï¡¢¶õ¤Ç¤Ê¤¯ (nonempty) ¤«¤Ä +³ÈÄ¥¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ç¤Ê¤¤ (nonextended) ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¤ß¤Ç¤¢¤ë¡£ +¤³¤Î¤¦¤Á¡¢¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Ê¥ó¥Ð¡¼ 1 ¤«¤é 4 ¤Ï¤½¤ì¤¬»È¤ï¤ì¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢ +¤Þ¤¿³ÈÄ¥¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤À¤È¤·¤Æ¤â MBR ¤Ëµ­½Ò¤µ¤ì¤ë»Í¤Ä¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó +(¤¤¤ï¤æ¤ë¡¢¥×¥é¥Þ¥ê'¥Ñ¡¼¥Æ¥£¥·¥ç¥ó) ¤ËÍ¿¤¨¤é¤ì¤ë¡£ +½¾¤Ã¤Æ¡¢ºÇ½é¤ÎÏÀÍý¥Ñ¡¼¥Æ¥£¥·¥ç¥ó (logical pertition) ¤Ï¡¢ +.BI hd X 5\c +¤È¤Ê¤ë¤À¤í¤¦¡£ +(IDE ¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤Ç¤Ï) DOS ¥¿¥¤¥×¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥Ë¥ó¥° (partitioning) +¤È BSD ¥Ç¥£¥¹¥¯¥é¥Ù¥ë (BSD-disklabel) ¤Ë¤è¤ë¥Ñ¡¼¥Æ¥£¥·¥ç¥Ë¥ó¥°¤ÎξÊý¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£¤Þ¤¿¡¢IDE ¥Ç¥£¥¹¥¯¾å¤ËºÇ¹â 63 ¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ò +ºîÀ®¤¹¤ë»ö¤¬¤Ç¤­¤ë¡£ +.LP +Î㤨¤Ð¡¢ +.I /dev/hda +¤Ï¥·¥¹¥Æ¥à¤ÎºÇ½é¤Î IDE ¥É¥é¥¤¥ÖÁ´ÂΤò»²¾È¤¹¤ë¡£¤½¤·¤Æ¡¢ +.I /dev/hdb3 +¤Ï¥»¥«¥ó¥É¥É¥é¥¤¥Ö¤Î»°¤Ä¤á¤Î DOS `¥×¥é¥¤¥Þ¥ê'¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ò»²¾È¤¹¤ë¡£ +.LP +¤³¤ì¤é¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë (device file) ¤Ïŵ·¿Åª¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤é¤ì¤ë¡£ +.RS +.sp +mknod \-m 660 /dev/hda b 3 0 +.br +mknod \-m 660 /dev/hda1 b 3 1 +.br +mknod \-m 660 /dev/hda2 b 3 2 +.br +\&... +.br +mknod \-m 660 /dev/hda8 b 3 8 +.br +mknod \-m 660 /dev/hdb b 3 64 +.br +mknod \-m 660 /dev/hdb1 b 3 65 +.br +mknod \-m 660 /dev/hdb2 b 3 66 +.br +\&... +.br +mknod \-m 660 /dev/hdb8 b 3 72 +.br +chown root:disk /dev/hd* +.RE +.SH ¥Õ¥¡¥¤¥ë +/dev/hd* +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR sd (4) +.BR mount (8), diff --git a/release/man4/initrd.4 b/release/man4/initrd.4 new file mode 100644 index 00000000..ffc03f72 --- /dev/null +++ b/release/man4/initrd.4 @@ -0,0 +1,498 @@ +.\" -*- nroff -*- +.\" This man-page is Copyright (C) 1997 John S. Kallal +.\" +.\" 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 author(s) of this work. +.\" +.\" If the you wish to distribute versions of this work under other +.\" conditions than the above, please contact the author(s) at the following +.\" for permission: +.\" +.\" John S. Kallal - +.\" email: +.\" mail: 518 Kerfoot Farm RD, Wilmington, DE 19803-2444, USA +.\" phone: (302)654-5478 +.\" +.\" $Id: initrd.4,v 1.1.1.1 1999/07/19 01:49:27 cvs Exp $ +.\" +.\" Japanese Version Copyright (c) 1997,1998 +.\" ISHIKAWA Mutsumi, all rights reserved. +.\" Translated 1997-12-15, ISHIKAWA Mutsumi +.\" Modified 1998-02-09, ISHIKAWA Mutsumi +.\" Updated & Modified 2005-10-08, Akihiro MOTOKI +.\" +.TH INITRD 4 2009-04-04 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +initrd \- ¥Ö¡¼¥È¥í¡¼¥À¤Ë¤è¤Ã¤Æ½é´ü²½¤µ¤ì¤¿ RAM ¥Ç¥£¥¹¥¯ +.SH ÀßÄê +.I /dev/initrd +¤Ï¡¢¥á¥¸¥ã¡¼ÈÖ¹æ 1¡¢¥Þ¥¤¥Ê¡¼ÈÖ¹æ 250 ¤¬³ä¤êÅö¤Æ¤é¤ì¤¿ +Æɤ߹þ¤ßÀìÍѤΥ֥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£ +ÉáÄÌ¡¢ +.I /dev/initrd +¤Î½êÍ­¼Ô¤Ï +.I root.disk +¤Ç¤¢¤ê¡¢¥â¡¼¥É¤Ï 400 (root ¤Î¤ß¤¬Æɤ߽Ф·²Äǽ) ¤Ç¤¢¤ë¡£ +¤â¤·¡¢Linux ¥·¥¹¥Æ¥à¤ËºîÀ®ºÑ¤Î +.I /dev/initrd +¥Õ¥¡¥¤¥ë¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤ÇºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë: +.nf +\fB + mknod \-m 400 /dev/initrd b 1 250 + chown root:disk /dev/initrd +\fP +.fi +.PP +¤Þ¤¿¡¢ +.I /dev/initrd +¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +"RAM disk" ¤È "Initial RAM disk" ¤ÎξÊý¤Îµ¡Ç½¤¬ +Linux ¥«¡¼¥Í¥ë¤ËľÀÜÁȤ߹þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(Î㤨¤Ð¡¢¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤ÎÀßÄê¤Ç +.B CONFIG_BLK_DEV_RAM=y +¤«¤Ä +.B CONFIG_BLK_DEV_INITRD=y +¤È¤¹¤ë)¡£ +.I /dev/initrd +¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ë¤Ï¡¢RAM ¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ð¤ò¥â¥¸¥å¡¼¥ë¤È¤·¤Æ +¥í¡¼¥É¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.\" +.\" +.\" +.SH ÀâÌÀ +.I /dev/initrd +¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤ÏÆɤ߹þ¤ßÀìÍѤΥ֥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£ +¤³¤Î¥Ç¥Ð¥¤¥¹¤Ï¥«¡¼¥Í¥ë¤¬µ¯Æ°¤µ¤ì¤ëÁ°¤Ë¥Ö¡¼¥È¥í¡¼¥À (boot loader) +¤Ë¤è¤Ã¤Æ½é´ü²½ (Î㤨¤Ð¡¢¥í¡¼¥É) ¤µ¤ì¤ë RAM ¥Ç¥£¥¹¥¯¤Ç¤¢¤ë¡£ +¤½¤Î¸å¡¢¥«¡¼¥Í¥ë¤Ï +.I /dev/initrd +¤ÎÆâÍƤòÆóÃʳ¬¤Î¥·¥¹¥Æ¥àµ¯Æ° (two-phase system boot-up) +¤ÇÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +ºÇ½é¤Î¥Ö¡¼¥È¥¢¥Ã¥×Ãʳ¬ (first boot-up phase) ¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤Ï +(Î㤨¤Ð¡¢¥Ö¡¼¥È¥í¡¼¥À¤Ë¤è¤Ã¤Æ½é´ü²½¤µ¤ì¤¿ RAM disk ¤Ç¤¢¤ë) +.I /dev/initrd +¤ÎÆâÍƤò½é´ü¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à (root file-system) ¤È¤·¤Æ¥Þ¥¦¥ó¥È +¤·¤Æµ¯Æ°¤¹¤ë¡£ +ÂèÆóÃʳ¬¤Ç¤Ï½é´ü¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤â¤Î¤«¤é¡¢ÄɲäΥɥ饤 +¥Ð¤ä¤½¤Î¾¤Î¥â¥¸¥å¡¼¥ë¤¬¥í¡¼¥É¤µ¤ì¤ë¡£ +ÄɲäΥ⥸¥å¡¼¥ë¤¬¥í¡¼¥É¤µ¤ì¤¿¸å¡¢¿·¤·¤¤¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +(¤¹¤Ê¤ï¤Á¡¢Ä̾ï»þ¤Î¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à) +¤¬Ê̤ΥǥХ¤¥¹¤«¤é¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +.\" +.\" +.\" +.SS ¥Ö¡¼¥È¥¢¥Ã¥×ºî¶È +.B initrd +¤òÍøÍѤ·¤¿»þ¤Ï¡¢¥·¥¹¥Æ¥à¤Ï¼¡¤Î¤è¤¦¤Ë¥Ö¡¼¥È¤¹¤ë: +.IP 1. 3 +¥Ö¡¼¥È¥í¡¼¥À¤Ï¥«¡¼¥Í¥ë¥×¥í¥°¥é¥à¤È +.I /dev/initrd +¤ÎÆâÍƤò¥á¥â¥ê¤Ë¥í¡¼¥É¤¹¤ë¡£ +.IP 2. +¥«¡¼¥Í¥ëµ¯Æ°»þ¡¢¥«¡¼¥Í¥ë¤Ï +.I /dev/initrd +¥Ç¥Ð¥¤¥¹¤ÎÆâÍƤòŸ³« (uncompress) ¤·¡¢ +.I /dev/ram0 +¤Ë¥³¥Ô¡¼¤¹¤ë¡£¤µ¤é¤Ë¡¢ +.I /dev/initrd +¤Î»È¤Ã¤Æ¤¤¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£ +.IP 3. +¥«¡¼¥Í¥ë¤Ï +.I /dev/ram0 +¥Ç¥Ð¥¤¥¹¤ò½é´ü¤Î¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤·¤ÆÆɤ߽ñ¤­²Äǽ¤Ê·Á¼°¤Ç¥Þ¥¦¥ó +¥È¤¹¤ë¡£ +.IP 4. +»Ø¼¨¤µ¤ì¤¿¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬½é´ü¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +(Î㤨¤Ð +.IR /dev/ram0 ) +¤ÈƱ°ì¤Î¾ì¹ç¤Ï¡¢¥«¡¼¥Í¥ë¤ÏÉáÄ̤Υ֡¼¥È¥·¡¼¥±¥ó¥¹¤Î¤¿¤á¤ÎºÇ¸å¤Î¥¹¥Æ¥Ã¥×¤ò +¾Êά¤¹¤ë¡£ +.IP 5. +.I /linuxrc +¤È¤¤¤¦¼Â¹Ô²Äǽ¤Ê¥Õ¥¡¥¤¥ë¤¬½é´ü¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ì¤Ð¡¢ +.I /linuxrc +¤ò UID 0 (¤¹¤Ê¤ï¤Á¡¢root) ¤Î¸¢¸Â¤Ç¼Â¹Ô¤¹¤ë¡£ +.RI ( /linuxrc +¥Õ¥¡¥¤¥ë¤Ï¼Â¹Ô²Äǽ¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I /linuxrc +¤ÏÀµÅö¤Ê¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ç¤¢¤ì¤Ð¤è¤¯¡¢¥·¥§¥ë¥¹¥¯¥ê¥×¥È¤Ç¤â¹½¤ï¤Ê¤¤¡£) +.IP 6. +.I /linuxrc +¤¬¼Â¹Ô¤µ¤ì¤Ê¤¤¡¢¤Þ¤¿¤Ï¡¢ +.I /linuxrc +¤Î¼Â¹Ô¤¬½ªÎ»¤·¤¿»þ¤Ï¡¢Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +.RI ( /linuxrc +¤ò½ªÎ»¤·¤¿»þ¡¢²¿¤é¤«¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬½é´ü¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ë +¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¥«¡¼¥Í¥ë¤ÎÆ°ºî¤Ï +\fB·è¤á¤é¤ì¤Æ¤¤¤Ê¤¤ (ÉÔÄê¤Ç¤¢¤ë)\fR¡£ +¸½ºß¤Î¥«¡¼¥Í¥ë¤¬¤É¤Î¤è¤¦¤ËÆ°ºî¤¹¤ë¤«¤Ï¡¢ +¡ÖÃí°Õ¡×¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È¤Î¤³¤È¡£) +.IP 7. +Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë +¥Ç¥£¥ì¥¯¥È¥ê +.I /initrd +¤¬¤¢¤ì¤Ð¡¢ +.I /dev/ram0 +¥Ç¥Ð¥¤¥¹¤Ï +.I / +¤«¤é +.I /initrd +¤Ë°ÜÆ°¤µ¤ì¤ë¡£ +.I /initrd +¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢ +.I /dev/ram0 +¤Ï¥¢¥ó¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +.RI ( / +¤¬ +.I /initrd +¤Ë°ÜÆ°¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +.I /dev/ram0 +¤Ï¥¢¥ó¥Þ¥¦¥ó¥È¤µ¤ì¤º¡¢¤½¤Î·ë²Ì¡¢ +.I /dev/ram0 +¤ÇÁö¤ê»Ï¤á¤¿¥×¥í¥»¥¹¤Ï¤½¤Î¤Þ¤Þ»Ä¤ë»ö¤¬¤Ç¤­¤ë¡£ +¤â¤·¡¢ +.I /initrd +¥Ç¥£¥ì¥¯¥È¥ê¤¬Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¸ºß¤»¤º¡¢ +.I /linuxrc +¤¬½ªÎ»¤·¤¿»þ¤Ë +.I /dev/ram0 +¾å¤Ç¼Â¹Ô¤µ¤ì¤¿¡¢¤Ê¤ó¤é¤«¤Î¥×¥í¥»¥¹¤¬Áö¤ê³¤±¤Æ¤¤¤¿¾ì¹ç¤Î +¥«¡¼¥Í¥ë¤ÎÆ°ºî¤Ï +.BR "·è¤á¤é¤ì¤Æ¤¤¤Ê¤¤ (ÉÔÄê¤Ç¤¢¤ë)" ¡£ +¸½ºß¤Î¥«¡¼¥Í¥ë¤¬¡¢¤³¤Î»þ¤É¤Î¤è¤¦¤ÊÆ°ºî¤ò¤¹¤ë¤«¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +¡ÖÃí°Õ¡×¤ò»²¾È¤Î¤³¤È¡£) +.IP 8. +ÉáÄ̤Υ֡¼¥È¥·¡¼¥±¥ó¥¹ (Î㤨¤Ð¡¢ +.I /sbin/init +¤Îµ¯Æ°) ¤¬Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ç¹Ô¤ï¤ì¤ë¡£ +.\" +.\" +.\" +.SS ¥ª¥×¥·¥ç¥ó +.B initrd +¤òÍѤ¤¤ë¾ì¹ç¤Ë¡¢¥«¡¼¥Í¥ë¤Î¥Ö¡¼¥È¥¢¥Ã¥×Áàºî¤Ë±Æ¶Á¤òÍ¿¤¨¤ë +¥Ö¡¼¥È¥í¡¼¥À¡¦¥ª¥×¥·¥ç¥ó¤Ï¼¡¤Î¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ë¡¢ +.TP +.BI initrd= "filename" +.I /dev/initrd +¤ÎÆâÍƤȤ·¤Æ¥í¡¼¥É¤¹¤ë¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¡£ +.B LOADLIN +¤Ç¤Ï¡¢¤³¤ì¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +.B LILO +¤Ç¤Ï¡¢ +.B LILO +¤ÎÀßÄê¥Õ¥¡¥¤¥ë +.I /etc/lilo.config +Æâ¤Ç¥³¥Þ¥ó¥É¤È¤·¤Æ»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ï¡¢Â¿¤¯¤Î¾ì¹ç gzip °µ½Ì¤µ¤ì¤¿ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¤¥á¡¼¥¸¤Ç¤¢¤ë¡£ +.TP +.B noinitrd +¤³¤Îµ¯Æ°¥ª¥×¥·¥ç¥ó¤ÏÆóÃʳ¬¤Îµ¯Æ°Áàºî¤ò̵¸ú¤Ë¤¹¤ë¡£ +¥«¡¼¥Í¥ë¤Ï +.I /dev/initrd +¤¬½é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤ÈƱÍͤΡ¢Ä̾ï¤Î¥Ö¡¼¥È¥¢¥Ã¥×Æ°ºî¤ò¹Ô¤¦¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È¡¢¥Ö¡¼¥È¥í¡¼¥À¤Ë¤è¤Ã¤Æ¥á¥â¥ê¾å¤Ë¥í¡¼¥É¤µ¤ì¤¿ +.I /dev/initrd +¤ÎÆâÍƤϤ½¤Î¤Þ¤ÞÊݸ¤µ¤ì¤ë¡£ +¤Ä¤Þ¤ê¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢ +.I /dev/initrd +¤ÎÆâÍƤò (¥Ö¡¼¥È°Ê³°¤ÎÌÜŪ¤Ë) ÍøÍѤ¹¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤ë¡£¤Þ¤¿¡¢¤½¤ÎÆâÍÆ¤Ï +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¤¥á¡¼¥¸¤Ë¸ÂÄꤵ¤ì¤Ê¤¤¡£ +¤·¤«¤·¡¢ +.I /dev/initrd +¥Ç¥Ð¥¤¥¹¤ÏÆɤߤÀ¤·¤Î¤ß²Äǽ¤Ç¤¢¤ê¡¢¥·¥¹¥Æ¥à¤Îµ¯Æ°¸å 1 ÅÙ¤·¤«Æɤ߽Ф¹»ö +¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.BI root= "device-name" +Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤·¤Æ»È¤ï¤ì¤ë¥Ç¥Ð¥¤¥¹¤ò»ØÄꤹ¤ë¡£ +.B LOADLIN +¤Ç¤Ï¡¢¤³¤ì¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +.B LILO +¤Ç¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¡¢¤Þ¤¿¤Ï¡¢ +.B LILO +¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë +.I /etc/lilo.config +¤Î¥ª¥×¥·¥ç¥ó¥é¥¤¥ó¤È¤·¤Æ»ÈÍѤ¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤ë¥Ç¥Ð¥¤¥¹¤Ï¡¢Å¬Àڤʥ롼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤· +¤Æ¥Þ¥¦¥ó¥È²Äǽ¤Ê¥Ç¥Ð¥¤¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" +.\" +.\" +.SS Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÊѹ¹ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤ÎÀßÄê +(Î㤨¤Ð¡¢ +.BR rdev (8) +¤òÍѤ¤¤Æ¥«¡¼¥Í¥ë¥Õ¥¡¥¤¥ëÆâ¤Ë¥»¥Ã¥È¤µ¤ì¤¿¤â¤Î¡¢¤Þ¤¿¤Ï¡¢¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥«¡¼ +¥Í¥ë¥Õ¥¡¥¤¥ëÆâ¤ËËä¤á¹þ¤Þ¤ì¤¿¤â¤Î)¡¢ +¤Þ¤¿¤Ï¡¢¥Ö¡¼¥È¥í¡¼¥À¤Î¥ª¥×¥·¥ç¥óÀßÄê¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¤â¤Î¤¬Ä̾ï»þ¥ë¡¼ +¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤·¤Æ»È¤ï¤ì¤ë¡£ +NFS ¥Þ¥¦¥ó¥È¤µ¤ì¤¿Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÍøÍѤ¹¤ë¾ì¹ç¡¢ +.B nfs_root_name +¤È +.B nfs_root_addrs +¥Ö¡¼¥È¥ª¥×¥·¥ç¥ó¤ò»È¤Ã¤Æ NFS ¤ÎÀßÄê¤òÍ¿¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +NFS ¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥ë¡¼¥È (¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à) ¤Ë¤Ä¤¤¤Æ¤Î +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¡¢¥«¡¼¥Í¥ë¤Î¥É¥­¥å¥á¥ó¥È¥Õ¥¡¥¤¥ë +.B Documentation/filesystems/nfsroot.txt +¤ò»²¾È¤Î¤³¤È¡£ +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÀßÄê¤Ë¤Ä¤¤¤Æ¤Î¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¡¢ +.B LILO +¤È +.B LOADLIN +¤Î¥É¥­¥å¥á¥ó¥È¤â»²¾È¤Î¤³¤È¡£ +.PP +¤Þ¤¿¡¢ +.I /linuxrc +¤òÍѤ¤¤ë»ö¤Ë¤è¤Ã¤Æ¤âÄ̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Ç¥Ð¥¤¥¹¤òÊѹ¹¤¹¤ë¤³¤È +¤¬¤Ç¤­¤ë¡£ +.I /linuxrc +¤òÍѤ¤¤Æ¡¢Ä̾ï»þ¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤òÊѹ¹¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.I /proc +¤¬¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I /proc +¤ò¥Þ¥¦¥ó¥È¤·¤¿¸å¤Ç¡¢ +.I /linuxrc +¤Ï proc ¥Õ¥¡¥¤¥ë +.IR /proc/sys/kernel/real-root-dev , +.IR /proc/sys/kernel/nfs-root-name , +.I /proc/sys/kernel/nfs-root-addrs +¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¤¡¢Ä̾ï»þ¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤òÊѹ¹¤¹¤ë¡£ +(NFS ¤Ç¤Ï¤Ê¤¤) ʪÍýŪ¤Ê¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Î¾ì¹ç¡¢ +.I /linuxrc +¤¬¿·¤·¤¤¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤ò +.I /proc/sys/kernel/real-root-dev +¤Ë½ñ¤­¹þ¤à¤³¤È¤Ç¡¢¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤¬Êѹ¹¤µ¤ì¤ë¡£ +NFS ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¾ì¹ç¡¢ +.I /linuxrc +¤¬ NFS ¤ÎÀßÄê¤ò +.I /proc/sys/kernel/nfs-root-name +¤È +.I /proc/sys/kernel/nfs-root-addrs +¤Ë½ñ¤­¹þ¤ß¡¢¤½¤ì¤«¤é +.I /proc/sys/kernel/real-root-dev +¤Ë (µ¿»÷ NFS ¥Ç¥Ð¥¤¥¹¥Ê¥ó¥Ð¡¼¤Ç¤¢¤ë) 0xff ¤ò½ñ¤­¹þ¤à¤³¤È¤Ç¡¢ +¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤¬Êѹ¹¤µ¤ì¤ë¡£ +Î㤨¤Ð¡¢¼¡¤Î¥·¥§¥ë¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë¤è¤ê¡¢Ä̾ï»þ¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤ò +.I /dev/hdb1 +¤ËÊѹ¹¤Ç¤­¤ë¤À¤í¤¦: +.nf + + echo 0x365 >/proc/sys/kernel/real-root-dev + +.fi +¤Þ¤¿¡¢NFS ¤Î¾ì¹ç¡¢¼¡¤Î¤è¤¦¤Ê¥·¥§¥ë¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë¤è¤ê¡¢ +¥í¡¼¥«¥ë¥Í¥Ã¥È¥ï¡¼¥¯¤Î 193.8.232.2 ¤È¤¤¤¦ IP ¥¢¥É¥ì¥¹¤ò»ý¤Ä NFS ¥µ¡¼¥Ð¤Î +NFS ¥Ç¥£¥ì¥¯¥È¥ê +.I /var/nfsroot +¤ò 193.8.232.7 ¤È¤¤¤¦ IP ¥¢¥É¥ì¥¹¤ò»ý¤Ä "idefix" ¤È¤¤¤¦Ì¾Á°¤Î¥· +¥¹¥Æ¥à¤ÎÄ̾ï»þ¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤È¤·¤Æ¥Þ¥¦¥ó¥È¤¹¤ë¤è¤¦¤ËÊѹ¹¤Ç¤­¤ë¤À¤í¤¦: +.nf + + echo /var/nfsroot >/proc/sys/kernel/nfs-root-name + echo 193.8.232.2:193.8.232.7::255.255.255.0:idefix \\ + >/proc/sys/kernel/nfs-root-addrs + echo 255 >/proc/sys/kernel/real-root-dev +.fi + +.BR Ãí°Õ : +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÊѹ¹¤¹¤ë¤¿¤á¤Ë +.I /proc/sys/kernel/real-root-dev +¤ò»È¤¦¤Î¤Ï°ÊÁ°¤ÎÊýË¡¤Ç¤¢¤ë¡£ +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÊѹ¹¤¹¤ë¿·¤·¤¤ÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï¡¢ +¥«¡¼¥Í¥ë¥½¡¼¥¹¤Ë´Þ¤Þ¤ì¤ë +.I Documentation/initrd.txt +¥Õ¥¡¥¤¥ë¤ä¡¢ +.BR pivot_root (2) +¤ä +.BR pivot_root (8) +¤ò»²¾È¤·¤Æ¤Û¤·¤¤¡£ +.\" FIXME ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç pivot_root ¤Î»ÅÁȤߤòÀâÌÀ¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.\" +.\" +.\" +.SS »È¤¤Êý +.B initrd +¤¬¼ÂÁõ¤µ¤ì¤¿¼ç¤ÊÌÜŪ¤Ï¡¢¥·¥¹¥Æ¥à¥¤¥ó¥¹¥È¡¼¥ë»þ¤Ë¡¢¥â¥¸¥å¡¼¥ë²½¤µ¤ì¤¿¥«¡¼ +¥Í¥ë¤ÎÀßÄê¤ò²Äǽ¤Ë¤¹¤ë¤³¤È¤Ç¤¢¤Ã¤¿¡£ +.PP +¼¡¤Î¤è¤¦¤Êή¤ì¤Î¥·¥¹¥Æ¥à¥¤¥ó¥¹¥È¡¼¥ë¤¬²Äǽ¤Ë¤Ê¤ë: +.IP 1. 3 +¥í¡¼¥À¥×¥í¥°¥é¥à¤Ï¡¢¥Õ¥í¥Ã¥Ô¡¼¤ä¤½¤Î¾¤Î¥á¥Ç¥£¥¢¤«¤é¡¢ +ºÇ¾®¸Â¤Î¥«¡¼¥Í¥ë (Î㤨¤Ð¡¢ +.IR /dev/ram , +.IR /dev/initrd , +ext2 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¤ß¤Î¥µ¥Ý¡¼¥È¤·¤¿¥«¡¼¥Í¥ë) ¤ò¥Ö¡¼¥È¤·¡¢ +gzip °µ½Ì¤µ¤ì¤¿½é´ü¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¤¥á¡¼¥¸¤ò +.I /dev/initrd +¤Ë¥í¡¼¥É¤¹¤ë¡£ +.IP 2. +¼Â¹Ô¥Õ¥¡¥¤¥ë +.I /linuxrc +¤Ï¡¢(1) Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¤Ë²¿¤¬É¬Íפ« +(¤¹¤Ê¤ï¤Á¡¢¥Ç¥Ð¥¤¥¹¥¿¥¤¥×¡¢¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à)¡¢ +(2) ÇÛÉÛ¥á¥Ç¥£¥¢¤Ë²¿¤¬É¬Íפ« (Î㤨¤Ð¡¢CD-ROM, ¥Í¥Ã¥È¥ï¡¼¥¯¡¢¥Æ¡¼¥×¤Ê¤É) +¤ò·èÄꤹ¤ë¡£·èÄê¤Ï¡¢¥æ¡¼¥¶¤Ø¤ÎÌ䤤¹ç¤ï¤»¡¢¼«Æ°¸¡½Ð¡¢¤¢¤ë¤¤¤Ï¤½¤Îξ¼Ô¤Î +ÊýË¡¤òÁȤ߹ç¤ï¤»¤Æ¹Ô¤ï¤ì¤ë¡£ +.IP 3. +¼Â¹Ô¥Õ¥¡¥¤¥ë +.I /linuxrc +¤Ï¡¢½é´ü¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤éɬÍפʥ⥸¥å¡¼¥ë¤ò¥í¡¼¥É¤¹¤ë¡£ +.IP 4. +¼Â¹Ô¥Õ¥¡¥¤¥ë +.I /linuxrc +¤Ï¡¢¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òºîÀ®¤·¡¢ÇÛÃÖ¤¹¤ë (¤³¤ÎÃʳ¬¤Ç¤Ï¡¢Ä̾ï»þ¥ë¡¼ +¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï´°Á´¤Ê¥·¥¹¥Æ¥à¤Ç¤¢¤ëɬÍפϤʤ¤)¡£ +.IP 5. +¼Â¹Ô¥Õ¥¡¥¤¥ë +.I /linuxrc +¤Ï¡¢ +.I /proc/sys/kernel/real-root-dev +¤òÀßÄꤷ¡¢ +.IR /proc "¡¢" +¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ëÄ̾ï»þ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àµÚ¤Ó¤½¤Î¾¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +¤ò¥¢¥ó¥Þ¥¦¥ó¥È¤·¡¢ +¼Â¹Ô¤ò½ªÎ»¤¹¤ë¡£ +.IP 6. +¼¡¤Ë¡¢¥«¡¼¥Í¥ë¤Ï¡¢Ä̾ï»þ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥Þ¥¦¥ó¥È¤¹¤ë¡£ +.IP 7. +¤³¤ÎÃʳ¬¤Ç¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÏÁ´¤¯Êѹ¹¤¬¹Ô¤ï¤ì¤Æ¤¤¤Ê¤¤¾õÂ֤ǡ¢ +¥¢¥¯¥»¥¹¤Ç¤­¤ë¾õÂ֤ˤʤ롣 +¤Þ¤¿¡¢¥Ö¡¼¥È¥í¡¼¥À¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.IP 8. +¥Ö¡¼¥È¥í¡¼¥À¤òÀßÄꤷ¡¢¥·¥¹¥Æ¥àµ¯Æ°»þ¤Ë»ÈÍѤµ¤ì¤ë¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤Î¥»¥Ã +¥È¤ò´Þ¤ó¤À¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +.I /dev/initrd +¤Ë¥í¡¼¥É¤¹¤ë (Î㤨¤Ð¡¢ +.I /dev/ram0 +¥Ç¥Ð¥¤¥¹¤ÎÆâÍƤò½¤Àµ¤·¡¢¥¢¥ó¥Þ¥¦¥ó¥È¤¹¤ë¡£ºÇ¸å¤Ë¡¢ +.I /dev/ram0 +¤Î¥¤¥á¡¼¥¸¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹)¡£ +.IP 9. +¤³¤ì¤Ç¡¢¥·¥¹¥Æ¥à¤¬¥Ö¡¼¥È²Äǽ¤Ë¤Ê¤ë¡£¤³¤Î¸å¡¢¤µ¤é¤Ë¤½¤Î¾¤Î¥¤¥ó¥¹¥È¡¼¥ë +¤Îºî¶È¤ò¼Â¹Ô¤Ç¤­¤ë¡£ +.PP +¾åµ­¤ÎÆ°ºî¤Ç¤Î +.I /dev/initrd +¤ÎÌò³ä¤Î¥­¡¼¥Ý¥¤¥ó¥È¤Ï¡¢½é´ü¥«¡¼¥Í¥ë¤ÎÁªÂò¤äÂ礭¤Ê¥¸¥§¥Í¥ê¥Ã¥¯¥«¡¼¥Í¥ë¡¢ +¥«¡¼¥Í¥ë¤ÎºÆ¹½Ãۤʤ·¤Ë¡¢Ä̾ï¤Î¥·¥¹¥Æ¥àÁàºî¤ÇºÆÍøÍѲÄǽ¤ÊÀßÄê¥Ç¡¼¥¿¤òÍø +ÍѤ¹¤ë¤³¤È¤Ë¤¢¤ë¡£ +.PP +2 ÈÖÌܤΥ±¡¼¥¹¤Ï¡¢°ì¤Ä¤Î´ÉÍý¾å¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤Ë¤ª¤¤¤Æ¡¢°Û¤Ê¤ëÀßÄê¤Î¥Ï¡¼ +¥É¥¦¥§¥¢¤Î¥·¥¹¥Æ¥à¾å¤Ç Linux ¤òÆ°ºî¤µ¤»¤ë¤¿¤á¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò¹Ô¤¦¾ì¹ç +¤Ç¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¥±¡¼¥¹¤Î¾ì¹ç¡¢¤´¤¯¾®¿ô¤Î¥«¡¼¥Í¥ë¤Î¥»¥Ã¥È (ÍýÁÛŪ¤Ë¤Ï¤¿¤Ã¤¿°ì +¤Ä¤Î¥«¡¼¥Í¥ë) ¤Î¤ß¤òÍøÍѤ·¡¢¥·¥¹¥Æ¥à¸ÇÍ­¤ÎÀßÄê¾ðÊó¤Ï²Äǽ¤Ê¸Â¤ê¾®¤µ¤¯¤¹ +¤ë¤³¤È¤¬Ë¾¤Þ¤·¤¤¤Ç¤¢¤í¤¦¡£ +¤³¤Î¾ì¹ç¡¢Á´¤Æ¤ÎɬÍפʥ⥸¥å¡¼¥ë¤¬Æþ¤Ã¤¿¶¦ÄÌ¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¡£ +¤½¤·¤Æ¡¢ +.I /linuxrc +¥Õ¥¡¥¤¥ë¡¢¤Þ¤¿¤Ï¡¢ +.I /linuxrc +¤«¤é¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î¤ß¤ò°Û¤Ê¤Ã¤¿¤â¤Î¤Ë¤·¤Æ¤ª¤¯¡£ +.PP +3 ÈÖÌܤΥ±¡¼¥¹¤Ï¡¢¤è¤êÊØÍø¤ÊÉüµìÍѥǥ£¥¹¥¯¤òºî¤ë¾ì¹ç¤Ç¤¢¤ë¡£ +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î°ÌÃ֤Ȥ¤¤Ã¤¿¾ðÊó¤Ï +¥Ö¡¼¥È»þ¤ËɬÍפʤ¤¤¿¤á¡¢ +.I /dev/initrd +¤«¤é¥í¡¼¥É¤µ¤ì¤¿¥·¥¹¥Æ¥à¤Ï¡¢ +ɬÍפÊÀµ¾ïÀ­¥Á¥§¥Ã¥¯¤ò¹Ô¤Ã¤¿¸å¤Ç¡¢¥æ¡¼¥¶¤Ø¤ÎÌ䤤¹ç¤ï¤»¤ä¼«Æ°¸¡½Ð +(¤â¤·¤¯¤Ï¤½¤ÎξÊý) ¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.PP +(¾¤Ë¤â¤¿¤¯¤µ¤óÎ㤬¤¢¤ë¤À¤í¤¦¤¬) ºÇ¸å¤ÎÎã¤È¤·¤Æ¤Ï¡¢ +.B initrd +¤òÍøÍѤ¹¤ë¤È¡¢CD-ROM ¾å¤Î Linux ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤ò +¤è¤ê´Êñ¤Ë CD-ROM ¤«¤é¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤À¤í¤¦¡£ +¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ï¡¢ +.B LOADLIN +¤ò»È¤Ã¤Æ¡¢¥Õ¥í¥Ã¥Ô¡¼¤òÁ´¤¯ÍøÍѤ»¤º¤Ë CD-ROM ¤«¤é +.I /dev/initrd +¤òľÀÜ¥í¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤Þ¤¿¡¢ +.B LILO +¥Ö¡¼¥È¥Õ¥í¥Ã¥Ô¡¼¤ò»È¤Ã¤Æ¥Ö¡¼¥È¤ò¹Ô¤¤¡¢ +.I /dev/initrd +¤òÄ̤·¤Æ CD-ROM ¤«¤é¤è¤êÂ礭¤Ê RAM ¥Ç¥£¥¹¥¯¤òµ¯Æ°¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.\" +.\" +.\" +.SH ¥Õ¥¡¥¤¥ë +.I /dev/initrd +.br +.I /dev/ram0 +.br +.I /linuxrc +.br +.I /initrd +.\" +.\" +.\" +.SH Ãí°Õ +.IP 1. 3 +¸½ºß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.I /dev/ram0 +¤¬ +.I / +¤«¤é +.I /initrd +¤Ë°ÜÆ°¤µ¤ì¤¿ºÝ¤Ë¡¢°ÜÆ°»þ¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢ +¤½¤Î¸å¤â·Ñ³Ū¤Ë¥¢¥¯¥»¥¹²Äǽ¤Ç¤¢¤ë¡£¤·¤«¤·¡¢ +.I /proc/mounts +¤Î¥¨¥ó¥È¥ê¤Ï¹¹¿·¤µ¤ì¤Ê¤¤¡£ +.IP 2. +¸½ºß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê +.I /initrd +¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +.I /dev/ram0 +¤ò²¿¤é¤«¤Î¥×¥í¥»¥¹¤¬ÍøÍѤ·¤Æ¤¤¤¿¤ê¡¢²¿¤é¤«¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ +.I /dev/ram0 +¾å¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +.I /dev/ram0 +¤Ï´°Á´¤Ë¤Ï¥¢¥ó¥Þ¥¦¥ó¥È¡Ö¤µ¤ì¤Ê¤¤¡×¡£ +.I /dev/ram0 +¤¬¡¢´°Á´¤Ë¥¢¥ó¥Þ¥¦¥ó¥È¡Ö¤µ¤ì¤Ê¤±¤ì¤Ð¡×¡¢ +.I /dev/ram0 +¤Ï¥á¥â¥ê¾å¤Ë»Ä¤Ã¤Æ¤·¤Þ¤¦¤Ï¤º¤Ç¤¢¤ë¡£ +.IP 3. +.I /dev/initrd +¤ÎÍøÍѼԤϡ¢¾åµ­¤ÎÃí°Õ»ö¹à¤Ç½Ò¤Ù¤¿Æ°ºî¤Ë°Í¸¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤ÎÆ°ºî¤Ï Linux ¥«¡¼¥Í¥ë¤Î¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤ÏÊѹ¹¤µ¤ì¤ë +¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤À¡£ +.\" +.\" +.\" +.\" .SH Ãø¼Ô +.\" .BR initrd +.\" ¥Ç¥Ð¥¤¥¹¤Î¤¿¤á¤Î¥«¡¼¥Í¥ë¥³¡¼¥É¤Ï Werner Almesberger +.\" ¤È Hans Lermen ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ +.\" .BR initrd +.\" ¤Î¤¿¤á¤Î¥³¡¼¥É¤Ï¡¢³«È¯¼Ô¸þ¤±¥Ð¡¼¥¸¥ç¥ó¤Î 1.3.73 ¤Ç +.\" ¥á¥¤¥ó¤Î Linux ¥«¡¼¥Í¥ë¤ËÁȤ߹þ¤Þ¤ì¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR ram (4), +.BR freeramdisk (8), +.BR rdev (8) + +¥«¡¼¥Í¥ë¥½¡¼¥¹¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤ë¥É¥­¥å¥á¥ó¥È¥Õ¥¡¥¤¥ë +.IR initrd.txt "¡¢" +LILO ¤Î¥É¥­¥å¥á¥ó¥È¡¢LOADLIN ¤Î¥É¥­¥å¥á¥ó¥È¡¢SYSLINUX ¤Î¥É¥­¥å¥á¥ó¥È¡£ diff --git a/release/man4/intro.4 b/release/man4/intro.4 new file mode 100644 index 00000000..9cc76256 --- /dev/null +++ b/release/man4/intro.4 @@ -0,0 +1,50 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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. +.\" +.\" Translated into Japanese, and added Information of Japanese +.\" man-pages project, Thu Feb 6 16:39:55 1997, +.\" Mutsumi Ishikawa +.\" +.\" Japanese Version Last 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" +.SH ̾Á° +intro \- ¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ë´Ø¤¹¤ë½øʸ +.SH ÀâÌÀ +¥Þ¥Ë¥å¥¢¥ë¤Î 4 ¾Ï¤Ï¡¢¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë (¥Ç¥Ð¥¤¥¹) ¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +/dev/* \(em ¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë +.SH È÷¹Í +.SS Ãø¼Ô¤ÈÃøºî¸¢ +Ãø¼Ô¤ª¤è¤Ó copyright ¤Î¾ò·ï¤Ë¤Ä¤¤¤Æ¤Ï³Æ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥½¡¼¥¹¤Î +¥Ø¥Ã¥ÀÉôʬ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£¾ò·ï¤Ï¤½¤ì¤¾¤ì¤Î¥Ú¡¼¥¸¤´¤È¤Ë°Û¤Ê¤Ã +¤Æ¤¤¤ë¤³¤È¤Ë¤´Ãí°Õ´ê¤¤¤Þ¤¹¡£ +.SH ´ØÏ¢¹àÌÜ +.BR standards (7) diff --git a/release/man4/lp.4 b/release/man4/lp.4 new file mode 100644 index 00000000..c0c339c4 --- /dev/null +++ b/release/man4/lp.4 @@ -0,0 +1,142 @@ +'\" t +.\" Copyright (c) Michael Haardt (michael@cantor.informatik.rwth-aachen.de), +.\" Sun Jan 15 19:16:33 1995 +.\" +.\" 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, Sun Feb 26 15:02:58 1995, faith@cs.unc.edu +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 +.\" ISHIKAWA Mutsumi, TAKAHASHI Mutsuji +.\" all rights reserved. +.\" Translated Tue Feb 13 22:48:47 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" and TAKAHASHI Mutsuji +.\" +.\" Japanese Version Last Modified Sun Jan 11 03:42:56 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: printer ¥×¥ê¥ó¥¿¡¼ +.\" WORD: parallel ¥Ñ¥é¥ì¥ë +.\" WORD: polling ¥Ý¡¼¥ê¥ó¥° +.\" WORD: interrupt ³ä¤ê¹þ¤ß +.\" WORD: dot matrix printer ¥É¥Ã¥È¥Þ¥È¥ê¥¯¥¹¥×¥ê¥ó¥¿¡¼ +.\" WORD: default ¥Ç¥Õ¥©¥ë¥È +.\" WORD: modularize ¥â¥¸¥å¡¼¥ë²½ +.\" WORD: driver ¥É¥é¥¤¥Ð +.\" WORD: buffer ¥Ð¥Ã¥Õ¥¡ +.\" +.TH LP 4 1995-01-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +lp \- ¥é¥¤¥ó¥×¥ê¥ó¥¿¡¼¥Ç¥Ð¥¤¥¹ +.SH ½ñ¼° +.B #include +.SH ÀßÄê +\fBlp\fP[0\(en2] ¤Ï¥Ñ¥é¥ì¥ë¥×¥ê¥ó¥¿¡¼¤Î¤¿¤á¤Î¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹¤Ç¥á¥¸¥ã¡¼ +¥Ê¥ó¥Ð¡¼ 6 ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ 0\(en2 ¤ò»ý¤Ä¡£¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼¤Ï¡¢¥Ù¡¼¥¹ +¥¢¥É¥ì¥¹ 0x03bc, 0x0378, 0x0278 ¤Î¤½¤ì¤¾¤ì¤Î¥×¥ê¥ó¥¿¡¼¥Ý¡¼¥È¤ËÂбþ¤¹¤ë +Ä̾¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ï¥â¡¼¥É 220 ¥ª¡¼¥Ê¡¼ root ¥°¥ë¡¼¥× lp ¤È¤Ê¤Ã +¤Æ¤¤¤ë¡£¥×¥ê¥ó¥¿¡¼¥Ý¡¼¥È¤Ï¥Ý¡¼¥ê¥ó¥°(polling)¤Þ¤¿¤Ï³ä¤ê¹þ¤ß +(interrupts) ¤Î¤É¤Á¤é¤òÍѤ¤¤Æ¤âÍøÍѤǤ­¤ë¡£³ä¤ê¹þ¤ß¤ÎÍøÍѤϡ¢¹âÉé²Ù¤¬ +ͽÁÛ¤µ¤ì¤ë»þ¡¢Î㤨¤Ð¥ì¡¼¥¶¡¼¥×¥ê¥ó¥¿¡¼¤ò¥×¥ê¥ó¥¿¥Ý¡¼¥È¤ËÀܳ¤¹¤ë¾ì¹ç¤Ê +¤É¤Ë¿ä¾©¤µ¤ì¤ë¡£ÉáÄ̤Υɥåȥޥȥꥯ¥¹¥×¥ê¥ó¥¿¡¼¤Ç¤Ï¡¢¥Ý¡¼¥ê¥ó¥°¤ÎÍøÍÑ +¤ÇÄ̾ï¤Ï½½Ê¬¤Ç¤¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥Ý¡¼¥ê¥ó¥°¤òÍøÍѤ¹¤ë¡£ +.SH ÀâÌÀ +¼¡¤Î +.BR ioctl (2) +¥³¡¼¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPTIME, int \fP\fIarg\fP\fB)\fP" +¥×¥ê¥ó¥¿¡¼¤Î¥Ð¥Ã¥Õ¥¡( buffer ) ¤¬¤¤¤Ã¤Ñ¤¤¤Ë¤Ê¤Ã¤¿»þ¡¢¥É¥é¥¤¥Ð¤¬¥×¥ê¥ó¥¿¡¼ +¤òºÆ¥Á¥§¥Ã¥¯¤¹¤ë¤Þ¤Ç¤ËµÙ»ß¤¹¤ë»þ´Ö¤ò \fIarg\fP ¤È¤¹¤ë¡£¹â®¤Ê¥×¥ê¥ó¥¿¡¼ +¤Î»þ¤Ï¤³¤ì¤ò¸º¤é¤·¡¢ÃÙ¤¤¥×¥ê¥ó¥¿¡¼¤Î»þ¤Ë¤ÏÁý¤ä¤¹¡£Ã±°Ì¤Ï1ÉäÎ100ʬ¤Î1 +¤Ç¡¢¥Ç¥Õ¥©¥ë¥È¤Î2¤Ï0.02Éäˤ¢¤¿¤ë¡£¥Ý¡¼¥ê¥ó¥°¥É¥é¥¤¥Ð( polling driver +)¤Î¤ß¤Ë±Æ¶Á¤¹¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCHAR, int \fP\fIarg\fP\fB)\fP" +¥Ý¡¼¥ê¥ó¥°¥É¥é¥¤¥Ð¤¬¥×¥ê¥ó¥¿¡¼¤Îʸ»ú¼õ¼è¤ê½àÈ÷¤¬¤Ç¤­¤ë¤Î¤òÂÔ +¤Ä¥Ó¥¸¡¼¥¦¥¨¥¤¥È(busy-wait)¤Î²ó¿ô¤ÎºÇÂçÃͤò \fIarg\fP¤È¤¹¤ë¡£ +¤â¤·°õºþ¤¬ÃÙ¤¹¤®¤ë»þ¤Ï¤³¤ì¤òÁý¤ä¤·¡¢¥·¥¹¥Æ¥à¤¬ÃÙ¤¯¤Ê¤ê¤¹¤®¤ë»þ¤Ë¤Ï +¸º¤é¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ï 1000 ¤Ç¤¢¤ë¡£¥Ý¡¼¥ê¥ó¥°¥É¥é¥¤¥Ð¤Î¤ß¤Ë±Æ¶Á¤¹¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORT, int \fP\fIarg\fP\fB)\fP" +¤â¤·¡¢\fIarg\fP ¤¬ 0 ¤Ê¤é¡¢¥×¥ê¥ó¥¿¡¼¥É¥é¥¤¥Ð¤Ï¥¨¥é¡¼¤Ë¤Ä¤¤¤ÆºÆ»î¹Ô +¤ò¹Ô¤¦¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤ÏÃæ»ß¤¹¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ï 0 ¤Ç¤¢¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORTOPEN, int \fP\fIarg\fP\fB)\fP" +¤â¤·¡¢\fIarg\fP ¤¬ 0 ¤Ê¤é +.BR open (2) +¤Î·ë²Ì¤¬¥¨¥é¡¼¤Î¾ì¹ç¡¢Æ°ºî¤¬Ãæ»ß¤µ¤ì¤ë¡£¤½¤ì°Ê³°¤Ê¤é¥¨¥é¡¼¤Ï̵ +»ë¤µ¤ì¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥¨¥é¡¼¤Ï̵»ë¤µ¤ì¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCAREFUL, int \fP\fIarg\fP\fB)\fP" +\fIarg\fP¤¬0¤Î¤È¤­¤Ë¤Ï¡¢¤¹¤Ù¤Æ¤Î½ñ¤­½Ð¤·¤Î»þ¤Ë¡¢»æÀڤ졢¥ª¥Õ¥é¥¤¥ó¡¢¥¨ +¥é¡¼¤Î¥·¥°¥Ê¥ë¤¬µ¶(false)¤Ç¤¢¤ë¤³¤È¤¬É¬ÍפȤµ¤ì¤ë¤¬¡¢0 °Ê³°¤Ê¤é¤³¤ì +¤é¤Î¥·¥°¥Ê¥ë¤Ï̵»ë¤µ¤ì¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤â¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤Ï̵»ë¤µ¤ì¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPWAIT, int \fP\fIarg\fP\fB)\fP" +¥×¥ê¥ó¥¿¡¼¤¬Á÷¤é¤ì¤¿Ê¸»ú¤ò¼õ¤±¼è¤ë¤Î¤òÂԤĤ¿¤á¡¢¥É¥é¥¤¥Ð¤¬Ê¸»ú¤òÁ÷¤Ã +¤Æ¤«¤é¥¹¥È¥í¡¼¥Ö(strobe)¤¹¤ë¤Þ¤Ç¤ÎÂÔ¤Á¤Î·«¤êÊÖ¤·¤Î²ó¿ô¤È¡¢¥¹¥È¥í¡¼¥Ö +¤òºÆ¤Ó¥ª¥Õ¤Ë¤¹¤ë¤Þ¤Ç¤ÎÂÔ¤Á¤Î·«¤êÊÖ¤·¤Î²ó¿ô¤ò \fIarg\fP¤ËÀßÄê +¤¹¤ë¡£»ÅÍͤˤè¤ì¤Ð¤³¤Î»þ´Ö¤Ï 0.5 ¥Þ¥¤¥¯¥íÉäȤ¹¤ë¤Ù¤­¤À¤¬¡¢·Ð¸³¤Ë¤è¤ì¤Ð +¤³¤Î¥³¡¼¥É¤Ë¤è¤Ã¤ÆÀ¸¤¸¤ëÃÙ¤ì¤Ç½½Ê¬¤Ç¤¢¤ë¡£¤½¤Î¤¿¤á¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 0 ¤Ç +¤¢¤ë¡£¤³¤ì¤Ï¡¢¥Ý¡¼¥ê¥ó¥°¤È³ä¤ê¹þ¤ß¥É¥é¥¤¥Ð¤ÎξÊý¤Ç»È¤ï¤ì¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPSETIRQ, int \fP\fIarg\fP\fB)\fP" +¤³¤Î +.BR ioctl (2) +¤ò»È¤¦¤Ë¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Î¸¢¸Â¤¬É¬ÍפǤ¢¤ë¡£¿·¤·¤¤IRQ¤ò¼¨¤¹ +.I int +¤ò°ú¿ô¤È¤·¤Æ¤È¤ë¡£¤Þ¤¿¡¢ÉûºîÍѤȤ·¤Æ¥×¥ê¥ó¥¿¡¼¤Ï¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +\fIarg\fP¤¬0¤Î»þ¤Þ¤¿¤Ï¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ç¤Ï¡¢¥Ý¡¼¥ê¥ó¥°¥É¥é¥¤¥Ð¡¼¤¬»È¤ï +¤ì¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETIRQ, int *\fP\fIarg\fP\fB)\fP" +¸½ºß»È¤ï¤ì¤Æ¤¤¤ëIRQ¤ò\fIarg\fP¤Ë¤¤¤ì¤ë¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETSTATUS, int *\fP\fIarg\fP\fB)\fP" +¥¹¥Æ¡¼¥¿¥¹¥Ý¡¼¥È¤ÎÃͤò\fIarg\fP¤Ë¼ý¤á¤ë¡£³Æ¥Ó¥Ã¥È¤Ë¤Ï¼¡¤Î¤è¤¦¤Ê°ÕÌ£¤¬ +¤¢¤ë¡§ +.TS +l l. +LP_PBUSY ¥Ó¥¸¡¼¿®¹æ¤Îȿž¡¢¥Ï¥¤¤¬¥¢¥¯¥Æ¥£¥Ö +LP_PACK ¥¢¥¯¥Î¥ê¥Ã¥¸¿®¹æ¡¢¥í¡¼¤¬¥¢¥¯¥Æ¥£¥Ö +LP_POUTPA »æÀڤ쿮¹æ¡¢¥Ï¥¤¤¬¥¢¥¯¥Æ¥£¥Ö +LP_PSELECD ÁªÂò¿®¹æ¡¢¥Ï¥¤¤¬¥¢¥¯¥Æ¥£¥Ö +LP_PERRORP ¥¨¥é¡¼¿®¹æ¡¢¥í¡¼¤¬¥¢¥¯¥Æ¥£¥Ö +.TE +.sp +¿®¹æ¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ï³Æ¼«¤Î¥×¥ê¥ó¥¿¡¼¤Î¥Þ¥Ë¥å¥¢¥ë¤ò»²¾È¤Î¤³¤È¡£¥×¥ê¥ó¥¿¡¼ +¤Ë¤è¤Ã¤Æ¤Ïµ­ºÜ¤Î¤Ê¤¤¥Ó¥Ã¥È¤â¥»¥Ã¥È¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç¡¢Ãí°Õ¤Î¤³¤È¡£ +.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPRESET)\fP" +¥×¥ê¥ó¥¿¡¼¤ò¥ê¥»¥Ã¥È¤¹¤ë¡£°ú¿ô¤Ï¤È¤é¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +/dev/lp* +.\" .SH Ãø¼Ô +.\" ¥×¥ê¥ó¥¿¡¼¥É¥é¥¤¥Ð¤Ï½é¤á¤Ï Jim Weigand ¤È Linus Torvalds ¤Ë¤è¤Ã¤Æ½ñ +.\" ¤«¤ì¡¢¤µ¤é¤Ë Michael K.\& Johnson ¤Ë¤è¤Ã¤Æ²þÎɤµ¤ì¤¿¡£³ä¤ê¹þ¤ß¤Î¥³¡¼¥É +.\" ¤Ï Nigel Gamble ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£¤Þ¤¿¡¢Alan Cox ¤Ï¥É¥é¥¤¥Ð¤ò¥â¥¸¥å¡¼ +.\" ¥ë²½¤·¤¿¡£ +.\" LPCAREFUL, LPABORT, LPGETSTATUS ¤Ï Chris Metcalf ¤Ë¤è¤Ã¤Æ²Ã¤¨¤é¤ì¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR chmod (1), +.BR chown (1), +.BR mknod (1), +.BR lpcntl (8), +.BR tunelp (8) +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ , +.\" ¹â¶¶ ËÓ»Ê +.SH ËÝÌõ¼ÔÃí +¥«¡¼¥Í¥ë 2.1.x ¤Ç¤Ï¥Ñ¥é¥ì¥ë¥Ý¡¼¥È¤Þ¤ï¤ê¤¬ÂçÉý¤Ë½ñ¤­Ä¾¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥«¡¼¥Í¥ë 2.1.x ¤Î¥Ñ¥é¥ì¥ë¥Ý¡¼¥È¥É¥é¥¤¥Ð¤Ë¤Ï¡¢ +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤ÎÆâÍƤϤ½¤Î¤Þ¤ÞŬÍѤǤ­¤Þ¤»¤ó¡£ diff --git a/release/man4/mem.4 b/release/man4/mem.4 new file mode 100644 index 00000000..3947b7d2 --- /dev/null +++ b/release/man4/mem.4 @@ -0,0 +1,105 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Tue Feb 6 16:48:30 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Sun Jan 11 03:52:01 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: system memory ¥·¥¹¥Æ¥à¥á¥â¥ê +.\" WORD: kernel memory ¥«¡¼¥Í¥ë¥á¥â¥ê +.\" WORD: system ports ¥·¥¹¥Æ¥à¥Ý¡¼¥È +.\" WORD: character device file ¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë +.\" WORD: patch ¥Ñ¥Ã¥Á +.\" WORD: byte address ¥Ð¥¤¥È¥¢¥É¥ì¥¹ +.\" WORD: physical memory address ʪÍý¥á¥â¥ê¥¢¥É¥ì¥¹ +.\" WORD: read-only Æɤ߹þ¤ßÀìÍÑ +.\" WORD: write-only ½ñ¤­¹þ¤ßÀìÍÑ +.\" WORD: kernel ¥«¡¼¥Í¥ë +.\" WORD: virtual memory ²¾ÁÛ¥á¥â¥ê +.\" WORD: I/O ports IO ¥Ý¡¼¥È +.TH MEM 4 1992-11-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mem, kmem, port \- ¥·¥¹¥Æ¥à¥á¥â¥ê(system memory)¡¢¥«¡¼¥Í¥ë¥á¥â¥ê +(kernel memory)¡¢¥·¥¹¥Æ¥à¥Ý¡¼¥È(sysmem ports) +.SH ÀâÌÀ +\fBmem\fP ¤Ï¥³¥ó¥Ô¥å¡¼¥¿¤Î¥á¥¤¥ó¥á¥â¥ê¥¤¥á¡¼¥¸¤Î¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹¥Õ¥¡ +¥¤¥ë(character device file)¤Ç¤¢¤ë¡£¤³¤Î¥Ç¥Ð¥¤¥¹¤Ï¡¢Î㤨¤Ð¡¢¥·¥¹¥Æ¥à¤ò +¸¡ºº¤¹¤ë¤¿¤á(¤Þ¤¿¡¢¥Ñ¥Ã¥Á(patch)¤ò¤¢¤Æ¤ë¤¿¤á)¤Ë»È¤ï¤ì¤ë¤À¤í¤¦¡£ +.LP +.B mem +¤Î¥Ð¥¤¥È¥¢¥É¥ì¥¹(byte address)¤Ï ʪÍý¥á¥â¥ê¥¢¥É¥ì¥¹¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +¸ºß¤·¤Æ¤¤¤Ê¤¤¾ì½ê¤Ø¤Î»²¾È¤Ï¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.LP +Æɤ߹þ¤ßÀìÍÑ(read-only)¤¢¤ë¤¤¤Ï½ñ¤­¹þ¤ßÀìÍÑ(write-only)¤Î¥Ó¥Ã¥È¤Ø¤Î¸¡ +ºº¤¢¤ë¤¤¤Ï¥Ñ¥Ã¥ÁÅö¤Æ¤Ïͽ´ü¤»¤Ì·ë²Ì¤ò¤â¤¿¤é¤¹¤³¤È¤¬¤¢¤ë¡£ +.LP +¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ïŵ·¿Åª¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤é¤ì¤ë¡£: +.RS +.sp +mknod \-m 660 /dev/mem c 1 1 +.br +chown root:kmem /dev/mem +.RE +.LP +.B kmem +¥Õ¥¡¥¤¥ë¤Ï +.B mem +¤ÈƱ¤¸¤À¤¬¡¢ +ʪÍý¥á¥â¥ê¤Ø¤Î¥¢¥¯¥»¥¹¤Ç¤Ï¤Ê¤¯¡¢¥«¡¼¥Í¥ë(kernel)¤Î²¾ÁÛ +¥á¥â¥ê(virtual memory)¤Ø¤Î¥¢¥¯¥»¥¹¤Ç¤¢¤ëÅÀ¤¬°Û¤Ê¤ë¡£ +.LP +¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ïŵ·¿Åª¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤é¤ì¤ë¡£: +.RS +.sp +mknod \-m 640 /dev/kmem c 1 2 +.br +chown root:kmem /dev/kmem +.RE +.LP +\fBport\fP ¤Ï +.B mem +¤Ë»÷¤Æ¤¤¤ë¤¬ I/O ¥Ý¡¼¥È(I/O ports)¤Ø¤Î¥¢¥¯¥»¥¹¤¬¹Ô¤ï¤ì¤ë¡£ +.LP +¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ïŵ·¿Åª¤Ë¤Ï¼¡¤Î¤è¤¦¤Ëºî¤é¤ì¤ë¡£: +.RS +.sp +mknod \-m 660 /dev/port c 1 4 +.br +chown root:mem /dev/port +.RE +.SH ¥Õ¥¡¥¤¥ë +.I /dev/mem +.br +.I /dev/kmem +.br +.I /dev/port +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR ioperm (2) +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ diff --git a/release/man4/mouse.4 b/release/man4/mouse.4 new file mode 100644 index 00000000..0564a3ea --- /dev/null +++ b/release/man4/mouse.4 @@ -0,0 +1,158 @@ +.\" t +.\" roff.\" Copyright +.\" This manpage is Copyright (C) 1996 Michael Haardt. +.\" Updates Nov 1998, 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) 1996,1997,1998 +.\" ISHIKAWA Mutsumi,TAKAHASHI Mutsuji +.\" all rights reserved. +.\" Translated Tue Feb 14 00:47:44 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" and TAKAHASHI Mutsuji +.\" +.\" Japanese Version Last Modified Sun Jan 11 03:55:54 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated & Modefied Sat Feb 27 1999 by Shouichi Saito +.\" +.\" WORD: serial mouse ¥·¥ê¥¢¥ë¥Þ¥¦¥¹ +.\" WORD: interface ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.\" WORD: RS232/V24 RS232/V24 +.\" WORD: dialout line ¥À¥¤¥¢¥ë¥¢¥¦¥È¥é¥¤¥ó +.\" WORD: pinout ¥Ô¥óÇÛÎó +.\" WORD: Microsoft-compatible ¥Þ¥¤¥¯¥í¥½¥Õ¥È¸ß´¹ +.\" +.TH MOUSE 4 1996-02-10 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mouse \- ¥·¥ê¥¢¥ë¥Þ¥¦¥¹¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.SH ÀßÄê +¥·¥ê¥¢¥ë¥Þ¥¦¥¹¤Ï RS232/V24 ¥À¥¤¥¢¥ë¥¢¥¦¥È¥é¥¤¥ó¤ËÀܳ¤µ¤ì¤ë¡£ +RS232/V24 ¥À¥¤¥¢¥ë¥¢¥¦¥È¥é¥¤¥ó ¤Ë¤Ä¤¤¤Æ¤Ï +.BR ttyS (4) +¤ò»²¾È¤Î¤³¤È¡£ +.SH ÀâÌÀ +.SS ³µÀâ +¥·¥ê¥¢¥ë¥Þ¥¦¥¹¤Ç»È¤ï¤ì¤ëÉáÄ̤Π9 ¥Ô¥ó¥×¥é¥°¤Î¥Ô¥óÇÛÎó¤Ï°Ê²¼¤Ç¤¢¤ë: +.TS +center; +r c l. +pin name used for +2 RX Data +3 TX -12 V, Imax = 10 mA +4 DTR +12 V, Imax = 10 mA +7 RTS +12 V, Imax = 10 mA +5 GND Ground +.TE + +¤³¤ì¤Ï»ÅÍͽñ¤Ç¤¢¤ê¡¢¼ÂºÝ¤Ï¤Û¤È¤ó¤É¤Î¥Þ¥¦¥¹¤Ç¤Ï 9 V ¤Ç½½Ê¬¤Ç¤¢¤ë¡£ +.PP +¥Þ¥¦¥¹¥É¥é¥¤¥Ð¤Ï RTS ¤ò¥í¡¼(low)¤ËÍ¡¢ºÆ¤Ó¾å¤²¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥Þ¥¦¥¹¤òǧ¼±¤Ç¤­ +¤ë¡£¤ª¤è¤½ 14 ms ¸å¡¢¥Þ¥¦¥¹¤Ï¥Ç¡¼¥¿¥é¥¤¥ó¾å¤Ë 0x4D (\(aqM\(aq) ¤òÁ÷¤ë¤À¤í¤¦¡£¤µ¤é +¤Ë 63ms ¤¢¤È¡¢¥Þ¥¤¥¯¥í¥½¥Õ¥È¸ß´¹ 3¥Ü¥¿¥ó¥Þ¥¦¥¹¤Ï 0x33 (\(aq3\(aq) ¤òÁ÷¤ë¡£ +.PP +¥Þ¥¦¥¹¤ÎÁêÂÐŪ¤Ê°ÜÆ°¤Ï¡¢\fIdx\fP(Àµ¤¬±¦)¤È\fIdy\fP(Àµ¤¬²¼)¤È¤·¤ÆÅÁ¤¨¤é¤ì¤ë¡£ +³Æ¼ï¤Î¥Þ¥¦¥¹¤Ï°Û¤Ê¤Ã¤¿¥¹¥Ô¡¼¥É¤ÇÁàºî¤Ç¤­¤ë¡£¥¹¥Ô¡¼¥É¤òÁªÂò¤¹¤ë¤Ë¤Ï¡¢ +²¼¤Îɽ¤Î£²Ê¸»ú¤òÁ÷¤Ã¤Æ¤«¤é 0.1 ÉÃÂԤĤ³¤È¤Ç¡¢9600, 4800, 2400, 1200 +bit/s ¤ò½ç¤ËÁª¤Ù¤ë¡£ +°Ê²¼¤Îɽ¤Ç¤ÏÁªÂò²Äǽ¤Ê¥¹¥Ô¡¼¥É¤È¤½¤ì¤òÁªÂò¤¹¤ë¤¿¤á¤Îʸ»úÎó¤ò¼¨¤·¤Æ¤¤¤ë¡£ +.TS +center; +l l. +bit/s string +9600 *q +4800 *p +2400 *o +1200 *n +.TE + +¥Ç¡¼¥¿¥Ñ¥±¥Ã¥È¤ÎÂè 1 ¥Ð¥¤¥È¤ÏƱ´ü¤ò¤È¤ë¤Î¤ËÍøÍѤǤ­¤ë¡£ +.SS "¥Þ¥¤¥¯¥í¥½¥Õ¥È ¥×¥í¥È¥³¥ë(Microsoft Protocol)" +\fB¥Þ¥¤¥¯¥í¥½¥Õ¥È\fP¥×¥í¥È¥³¥ë¤Ï¡¢1200 bits/sec ¤Î¥¹¥Ô¡¼¥É¤Ç¡¢1 ¥¹ +¥¿¡¼¥È¥Ó¥Ã¥È(1 start bit)¡¢7 ¥Ç¡¼¥¿¥Ó¥Ã¥È(7 data bits)¡¢¥Ñ¥ê¥Æ¥£¤Ê +¤·¡¢1 ¥¹¥È¥Ã¥×¥Ó¥Ã¥È(1 stop bit)¤Ç¤¢¤ë¡£ +¥Ç¡¼¥¿¤Ï RxD ¤Ë 3 ¥Ð¥¤¥È¤Î¥Ñ¥±¥Ã¥È¤È¤·¤ÆÁ÷¤é¤ì¤ë¡£\fIdx\fP ¤È \fIdy\fP +¤ÎÆ°¤­¤Ï 2 ¤ÎÊä¿ôɽ¼¨¤ÇÁ÷¤é¤ì¡¢º¸(±¦)¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿»þ¤Ë¤Ï \fIlb\fP +(\fIrb\fP)¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.TS +center; +r c c c c c c c. +byte d6 d5 d4 d3 d2 d1 d0 +1 1 lb rb dy7 dy6 dx7 dx6 +2 0 dx5 dx4 dx3 dx2 dx1 dx0 +3 0 dy5 dy4 dy3 dy2 dy1 dy0 +.TE +.SS "3¤Ä¥Ü¥¿¥ó ¥Þ¥¤¥¯¥í¥½¥Õ¥È ¥×¥í¥È¥³¥ë(3-button Microsoft protocol)" +ËÜÍè¤Î¥Þ¥¤¥¯¥í¥½¥Õ¥È¥Þ¥¦¥¹¤Ï 2 ¤Ä¤Î¥Ü¥¿¥ó¤·¤«»ý¤¿¤Ê¤¤¡£¤·¤«¤·¡¢3 ¤Ä¥Ü¥¿¥ó +¤Î¥Þ¥¦¥¹¤Ç¥Þ¥¤¥¯¥í¥½¥Õ¥È¥×¥í¥È¥³¥ë¤Îʪ¤â¸ºß¤¹¤ë¡£¿¿Ãæ¤Î¥Ü¥¿¥ó¤ò²¡¤¹¡¢ +¤Þ¤¿¤ÏÊü¤¹¤È¤¤¤¦¤³¤È¤Ï¡¢Æ°¤­¥¼¥í¤Ç¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤¤¤¦¥Ñ¥±¥Ã¥È +¤òÁ÷¤ë¤³¤È¤ÇÅÁ¤¨¤é¤ì¤ë¡£(½¾¤Ã¤Æ¾¤ÎÆó¤Ä¤Î¥Ü¥¿¥ó¤È°ã¤¤¡¢¿¿Ãæ¤Î¥Ü¥¿ +¥ó¤Î¥¹¥Æ¡¼¥¿¥¹¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥Ñ¥±¥Ã¥È¤«¤é¤ÏÅÁ¤ï¤Ã¤ÆÍè¤Ê¤¤¡£) +.SS "¥í¥¸¥Æ¥Ã¥¯ ¥×¥í¥È¥³¥ë(Logitech protocol)" +¥í¥¸¥Æ¥Ã¥¯ ¥·¥ê¥¢¥ë 3¤Ä¥Ü¥¿¥ó¥Þ¥¦¥¹¤Ï¡¢¥Þ¥¤¥¯¥í¥½¥Õ¥È ¥×¥í¥È¥³¥ë¤È¤Ï +°Û¤Ê¤Ã¤¿³ÈÄ¥¤ò¤·¤Æ¤¤¤ë¡£:¿¿Ãæ¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤Æ¤Ê¤¤¤È¡¢¾åµ­ 3¥Ð¥¤¥È¤Î +¥Ñ¥±¥Ã¥È¤¬Á÷¤é¤ì¤ë¡£¿¿Ãæ¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤Æ¤¤¤ë¤È¡¢4¥Ð¥¤¥È¤Î¥Ñ¥±¥Ã¥È¤¬ +Á÷¤é¤ì¤ë¡£Â裴¥Ð¥¤¥È¤Ï 0x20 ¤ÎÃͤò»ý¤Ã¤Æ¤¤¤ë(¤¢¤ë¤¤¤Ï¡¢¾¯¤Ê¤¯¤È¤â 0x20 +¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë)¡£ ⤷¡¢Â¾¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤Æ¤¤¤Ê¤¤¾õÂ֤ǡ¢ +¿¿Ãæ¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤ë¤È¡¢0,0,0,0x20 ¤ÈÅÁ¤¨¤é¤ì¤ë¡£ +.SS "¥Þ¥¦¥¹¥·¥¹¥Æ¥à¥º ¥×¥í¥È¥³¥ë(Mousesystems protocol)" +\fB¥Þ¥¦¥¹¥·¥¹¥Æ¥à¥º\fP¥×¥í¥È¥³¥ë¤Ï¡¢1200 bits/sec¤Ç¡¢1 ¥¹¥¿¡¼¥È¥Ó¥Ã¥È¡¢ +8 ¥Ç¡¼¥¿¥Ó¥Ã¥È¡¢¥Ñ¥ê¥Æ¥£¤Ê¤·¡¢2 ¥¹¥È¥Ã¥×¥Ó¥Ã¥È¤Ç¤¢¤ë¡£ +¥Ç¡¼¥¿¤Ï¡¢RxD ¤Ë 5 ¥Ð¥¤¥È¤Î¥Ñ¥±¥Ã¥È¤È¤·¤ÆÁ÷¤é¤ì¤ë¡£\fIdx\fP ¤Ï 2 ¤Ä¤Î +2 ¤ÎÊä¿ô¤ÎϤȤ·¤ÆÁ÷¤é¤ì¡¢\fIdy\fP ¤Ï 2 ¤Ä¤Î 2 ¤ÎÊä¿ô¤ÎϤÎÈÝÄê +¤È¤·¤ÆÁ÷¤é¤ì¤ë¡£º¸(Ãæ¡¢±¦)¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿»þ¤Ë¤Ï\fIlb\fP +(\fImb\fP, \fIrb\fP) ¤¬¥¯¥ê¥¢¤µ¤ì¤ë¡£ +.TS +center; +r c c c c c c c c. +byte d7 d6 d5 d4 d3 d2 d1 d0 +1 1 0 0 0 0 lb mb rb +2 0 dxa6 dxa5 dxa4 dxa3 dxa2 dxa1 dxa0 +3 0 dya6 dya5 dya4 dya3 dya2 dya1 dya0 +4 0 dxb6 dxb5 dxb4 dxb3 dxb2 dxb1 dxb0 +5 0 dyb6 dyb5 dyb4 dyb3 dyb2 dyb1 dyb0 +.TE + +Âè 4,5 ¥Ð¥¤¥È¤Ë¤Ï¡¢Âè 2,3 ¥Ð¥¤¥È¤¬Á÷¤é¤ì¤¿¤¢¤ÈÀ¸¤¸¤¿Êѹ¹¤¬µ­½Ò¤µ¤ì¤ë¡£ +.SS "¥µ¥ó ¥×¥í¥È¥³¥ë(Sun protocol)" +\fB¥µ¥ó\fP ¥×¥í¥È¥³¥ë¤Ï¡¢¾åµ­¤Î 5 ¥Ð¥¤¥È ¥Þ¥¦¥¹¥·¥¹¥Æ¥à¥×¥í¥È¥³¥ë¤Î 3 +¥Ð¥¤¥ÈÈǤǤ¹¡£¸å¤Î 2 ¥Ð¥¤¥È¤ÏÁ÷¤é¤ì¤Þ¤»¤ó¡£ +.SS "MM ¥×¥í¥È¥³¥ë(MM protocol)" +\fBMM\fP ¥×¥í¥È¥³¥ë¤Ï 1200 bits/sec ¤Ç 1 ¥¹¥¿¡¼¥È¥Ó¥Ã¥È¡¢8 ¥Ç¡¼¥¿¥Ó¥Ã +¥È¡¢´ñ¿ô¥Ñ¥ê¥Æ¥£¡¢ 1 ¥¹¥È¥Ã¥×¥Ó¥Ã¥È¤ò»È¤¦¡£¥Ç¡¼¥¿¤Ï RxD ¤Ë 3 ¥Ð¥¤¥È¤Î¥Ñ +¥±¥Ã¥È¤È¤·¤ÆÁ÷¤é¤ì¤ë¡£\fIdx\fP ¤È \fIdy\fP ¤Ï°ì¤Ä¤ÎÉä¹æ¤Ä¤­¤ÎÃͤȤ·¤Æ +Á÷¤é¤ì¡¢¥µ¥¤¥ó¥Ó¥Ã¥È¤ÏÉé¤ÎÃͤòɽ¤¹¡£º¸(Ãæ¡¢±¦)¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿»þ¤Ë¤Ï +\fIlb\fP (\fImb\fP, \fIrb\fP)¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.TS +center; +r c c c c c c c c. +byte d7 d6 d5 d4 d3 d2 d1 d0 +1 1 0 0 dxs dys lb mb rb +2 0 dx6 dx5 dx4 dx3 dx2 dx1 dx0 +3 0 dy6 dy5 dy4 dy3 dy2 dy1 dy0 +.TE +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /dev/mouse +°ìÈÌŪ¤Ë¥Þ¥¦¥¹¥Ç¥Ð¥¤¥¹¤ò¤µ¤¹¤Î¤Ë»È¤ï¤ì¤ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯ +.SH ´ØÏ¢¹àÌÜ +.BR ttyS (4), +.BR gpm (8) diff --git a/release/man4/null.4 b/release/man4/null.4 new file mode 100644 index 00000000..129b1619 --- /dev/null +++ b/release/man4/null.4 @@ -0,0 +1,72 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:00:12 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Tue Feb 6 16:42:51 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Sun Jan 11 04:04:34 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: special file ¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë +.\" WORD: end of file end of file +.\" WORD: \0 character \0 ʸ»ú(null ʸ»ú) +.\" WORD: device ¥Ç¥Ð¥¤¥¹ +.\" +.TH NULL 4 1992-11-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +null, zero \- ¥Ç¡¼¥¿¤ÎÁݤ­¤À¤á +.SH ÀâÌÀ +\fBnull\fP ¤Þ¤¿¤Ï \fBzero\fP ¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë(special file)¤Ë +½ñ¤«¤ì¤¿¥Ç¡¼¥¿¤Ï¼Î¤Æ¤é¤ì¤ë¡£ +.PP +\fBnull\fP ¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤òÆɤà¤È¾ï¤Ë end of file ¤¬ÊÖ¤µ¤ì (¤Ä¤Þ¤ê¡¢ +.BR read (2) +¤Ï 0 ¤òÊÖ¤¹)¡¢ÂоÈŪ +¤Ë \fBzero\fP ¤òÆɤà¤È¾ï¤Ë¥Ð¥¤¥È¿ô 0 (\e0 ʸ»ú) ¤¬ÊÖ¤µ¤ì¤ë¡£ +.LP +\fBnull\fP ¤È \fBzero\fP ¤Ï°ìÈÌŪ¤Ë¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤é¤ì¤ë: +.RS +.sp +mknod \-m 666 /dev/null c 1 3 +.br +mknod \-m 666 /dev/zero c 1 5 +.br +chown root:root /dev/null /dev/zero +.RE +.SH ¥Õ¥¡¥¤¥ë +.I /dev/null +.br +.I /dev/zero +.SH Ãí°Õ +¤³¤ì¤é¤Î¥Ç¥Ð¥¤¥¹¤¬Á´¤Æ¤Î¥æ¡¼¥¶¤ËÂФ·¤ÆÆɤ߽ñ¤­²Äǽ¤Ç¤Ê¤¤¾ì¹ç¡¢ +¿¤¯¤Î¥×¥í¥°¥é¥à¤ÎÆ°ºî¤¬¤ª¤«¤·¤¯¤Ê¤ë¤À¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR full (4) +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ diff --git a/release/man4/pts.4 b/release/man4/pts.4 new file mode 100644 index 00000000..a4c40c17 --- /dev/null +++ b/release/man4/pts.4 @@ -0,0 +1,88 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" This man page was written by Jeremy Phelps . +.\" Notes added - aeb +.\" Redistribute and revise at will. +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated Tue Jul 8 00:28:17 JST 2003 +.\" by Akihiro MOTOKI +.\" +.\"WORD: pseudo-terminal µ¼»÷üËö +.\"WORD: pts µ¼»÷üËö +.\" +.TH PTS 4 2002-10-09 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ptmx, pts \- µ¼»÷üËö¤Î¥Þ¥¹¥¿¤È¥¹¥ì¡¼¥Ö +.SH ÀâÌÀ +¥Õ¥¡¥¤¥ë \fI/dev/ptmx\fP ¤Ï¡¢¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ (major number) 5¡¢ +¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ (minor number) 2 ¤ò»ý¤Ä¥­¥ã¥é¥¯¥¿¡¦¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¡¢ +Ä̾¥â¡¼¥É¤Ï 0666 ¤Ç¡¢½êÍ­¼Ô.¥°¥ë¡¼¥×¤Ï root.root ¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢µ¼»÷üËö (pseudo-terminal) ¤Î¥Þ¥¹¥¿¤È¥¹¥ì¡¼¥Ö¤Î +¥Ú¥¢¤òºîÀ®¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +.PP +¥×¥í¥»¥¹¤¬ \fI/dev/ptmx\fP ¤ò¥ª¡¼¥×¥ó¤¹¤ë¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Ë¤Ï +µ¼»÷üËö¥Þ¥¹¥¿ (pseudo-terminal master; PTM) ¤Ø¤Î¥Õ¥¡¥¤¥ë¡¦ +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÊÖ¤µ¤ì¡¢ +.I /dev/pts +¥Ç¥£¥ì¥¯¥È¥ê¤Ëµ¼»÷üËö¥¹¥ì¡¼¥Ö (pseudo-terminal slave; PTS) +¥Ç¥Ð¥¤¥¹¤¬ºîÀ®¤µ¤ì¤ë¡£ +\fI/dev/ptmx\fP ¤ò¥ª¡¼¥×¥ó¤·¤ÆÆÀ¤é¤ì¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +¤½¤ì¤¾¤ìÆÈΩ¤Î PTM ¤Ç¤¢¤ê¡¢Âбþ¤¹¤ë PTS ¤ò³Æ¡¹»ý¤Ä¡£ +PTS ¤Î¥Ñ¥¹Ì¾¤Ï¡¢PTM ¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +.BR ptsname (3) +¤ËÅϤ¹¤ÈÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.PP +µ¼»÷üËö¥¹¥ì¡¼¥Ö¤ò¥ª¡¼¥×¥ó¤¹¤ëÁ°¤Ë¡¢É¬¤º¡¢¥Þ¥¹¥¿¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +°ú¤­¿ô¤È¤·¤Æ +.BR grantpt (3) +¤È +.BR unlockpt (3) +¤ò¸Æ¤Ó½Ð¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +µ¼»÷üËö¤Î¥Þ¥¹¥¿¤È¥¹¥ì¡¼¥Ö¤ÎξÊý¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¸å¤Ï¡¢¥¹¥ì¡¼¥Ö¤Ï¡¢ +¥×¥í¥»¥¹¤ËÂФ·¤Æ¡¢¼ÂüËö (real terminal) ¤ÈÁ´¤¯Æ±¤¸¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +.PP +¥¹¥ì¡¼¥Ö¤Ë½ñ¤«¤ì¤¿¥Ç¡¼¥¿¤Ï¥Þ¥¹¥¿¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ëÆþÎϤȤ·¤Æ°·¤ï¤ì¡¢ +¥Þ¥¹¥¿¤Ë½ñ¤«¤ì¤¿¥Ç¡¼¥¿¤Ï¥¹¥ì¡¼¥Ö¤ËÂФ¹¤ëÆþÎϤȤ·¤Æ°·¤ï¤ì¤ë¡£ +.PP +¼ÂÎã¤ò¤¢¤²¤ë¤È¡¢µ¼»÷üËö¤Ï +.BR xterm (1) +¤Î¤è¤¦¤ÊüËö¥¨¥ß¥å¥ì¡¼¥¿¤ò¼ÂÁõ¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +üËö¥¨¥ß¥å¥ì¡¼¥¿¤Ç¤Ï¡¢µ¼»÷üËö¤Î¥Þ¥¹¥¿¤«¤éÆɤ߹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤Ï¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤È¤Ã¤Æ¼ÂüËö¤Î¥Ç¡¼¥¿¤ÈÁ´¤¯Æ±¤¸¤â¤Î¤Î¤è¤¦¤Ë¸«¤¨¤ë¡£ +¤Þ¤¿¡¢ +.BR sshd (8) +¤Î¤è¤¦¤Ê¥ê¥â¡¼¥È¡¦¥í¥°¥¤¥óÍÑ¤Î¥×¥í¥°¥é¥à¤Î¼ÂÁõ¤Ç¤Ï¡¢ +µ¼»÷üËö¥Þ¥¹¥¿¤«¤éÆɤ߹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤ò·Ðͳ¤·¤Æ¡¢ +üËö¤äüËö¥¨¥ß¥å¥ì¡¼¥¿¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¥¯¥é¥¤¥¢¥ó¥È¡¦¥×¥í¥°¥é¥à¤ËÁ÷¿®¤µ¤ì¤ë¡£ +.PP +µ¼»÷üËö¤Ï¡¢ +.RB ( su (1) +¤ä +.BR passwd (1) +¤Î¤è¤¦¤Ê) Ä̾ï¤Ï¥Ñ¥¤¥×¤«¤é¤ÎÆþÎϤòµñÈݤ¹¤ë¥×¥í¥°¥é¥à¤Ë¡¢ +ÆþÎϤòÁ÷¿®¤¹¤ë¤¿¤á¤Ë¤â»ÈÍѤǤ­¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +.IR /dev/ptmx , +.I /dev/pts/* +.SH È÷¹Í +(Unix98 pty naming ¤È¸Æ¤Ð¤ì¤ë) ¾åµ­¤Îµ¡Ç½¤Î Linux ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¡¢ +Ä̾ï +.I /dev/pts +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë¤Ï¤º¤Î +.I devpts +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÄ̤·¤Æ¼Â¸½¤µ¤ì¤Æ¤¤¤ë¡¢ +.LP +¤³¤Î Unix98 ¥¹¥­¡¼¥à¤¬Æ³Æþ¤µ¤ì¤ëÁ°¤Ï¡¢¥Þ¥¹¥¿µ¼»÷üËö¤Ï +.IR /dev/ptyp0 ", ..." +¡¢¥¹¥ì¡¼¥Öµ¼»÷üËö¤Ï +.IR /dev/ttyp0 ", ..." +¤È¸Æ¤Ð¤ì¤Æ¤ª¤ê¡¢¤¢¤é¤«¤¸¤á¤¿¤¯¤µ¤ó¤Î¥Ç¥Ð¥¤¥¹¡¦¥Î¡¼¥É¤ò³ä¤êÅö¤Æ¤Æ +¤ª¤¯É¬Íפ¬¤¢¤Ã¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getpt (3), +.BR grantpt (3), +.BR ptsname (3), +.BR unlockpt (3), +.BR pty (7) diff --git a/release/man4/ram.4 b/release/man4/ram.4 new file mode 100644 index 00000000..967ca41c --- /dev/null +++ b/release/man4/ram.4 @@ -0,0 +1,57 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:01:11 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Tue Dec 28 17:23:13 JST 1996 +.\" by ISHIKAWA Mutsumi +.\" Japanese Version Last Modified Sun Jan 11 03:55:54 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: ram disk ¥é¥à¥Ç¥£¥¹¥¯ +.\" WORD: raw mode ¥í¡¼¥â¡¼¥É +.\" WORD: block device ¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ +.TH RAM 4 1992-11-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ram \- RAM ¥Ç¥£¥¹¥¯¥Ç¥Ð¥¤¥¹ +.SH ÀâÌÀ +\fIram\fP ¥Ç¥Ð¥¤¥¹¤Ï RAM ¥Ç¥£¥¹¥¯¤Ë¥í¡¼¥â¡¼¥É (raw mode) ¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î +¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ (block device) ¤Ç¤¢¤ë¡£ +.LP +ŵ·¿Åª¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤é¤ì¤ë¡£: +.RS +.sp +mknod \-m 660 /dev/ram b 1 1 +.br +chown root:disk /dev/ram +.RE +.SH ¥Õ¥¡¥¤¥ë +/dev/ram +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR mount (8) +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ diff --git a/release/man4/random.4 b/release/man4/random.4 new file mode 100644 index 00000000..fab28937 --- /dev/null +++ b/release/man4/random.4 @@ -0,0 +1,234 @@ +.\" Copyright (c) 1997 John S. Kallal (kallal@voicenet.com) +.\" +.\" 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. +.\" +.\" Some changes by tytso and aeb. +.\" +.\" 2004-12-16, John V. Belmonte/mtk, Updated init and quit scripts +.\" 2004-04-08, AEB, Improved description of read from /dev/urandom +.\" 2008-06-20, George Spelvin , +.\" Matt Mackall +.\" Add a Usage subsection that recommends most users to use +.\" /dev/urandom, and emphasizes parsimonious usage of /dev/random. +.\" +.\" Japanese Version Copyright (c) 1998 +.\" ISHIKAWA Mutsumi, all rights reserved. +.\" Translated into Japanese Mon Jan 12 03:20:27 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Japanese Version Last Modified Thu Feb 5 21:08:33 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated & Modified Sun Jun 6 14:48:03 JST 2004 +.\" by Yuichi SATO +.\" Updated & Modified Tue Jan 18 04:21:16 JST 2005 by Yuichi SATO +.\" Updated & Modified Fri Apr 22 03:44:01 JST 2005 by Yuichi SATO +.\" Updated 2008-08-13, Akihiro MOTOKI , LDP v3.05 +.\" +.\"WORD: random generator Íð¿ô¥¸¥§¥Í¥ì¡¼¥¿ +.\" +.TH RANDOM 4 2008-06-20 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +random, urandom \- ¥«¡¼¥Í¥ëÍð¿ô¥½¡¼¥¹¥Ç¥Ð¥¤¥¹ +.SH ÀâÌÀ +(Linux 1.3.30 ¤«¤éÄ󶡤µ¤ì¤Æ¤¤¤ë) \fI/dev/random\fP ¡¢ +\fI/dev/urandom\fP ¥­¥ã¥é¥¯¥¿¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ï +¥«¡¼¥Í¥ëÍð¿ô¥¸¥§¥Í¥ì¡¼¥¿¤Ø¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +\fI/dev/random\fP ¥Õ¥¡¥¤¥ë¤Ï¥á¥¸¥ã¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 1 +¥Þ¥¤¥Ê¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 8 ¤Ç¤¢¤ë¡£ +\fI/dev/urandom\fP ¤Ï¥á¥¸¥ã¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 1 +¥Þ¥¤¥Ê¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 9 ¤Ç¤¢¤ë¡£ +.LP +Íð¿ô¥¸¥§¥Í¥ì¡¼¥¿¤Ï¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ä¤½¤Î¾¤Î¸»¤«¤é¤Î´Ä¶­¥Î¥¤¥º¤ò +¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Ø½¸¤á¤ë¡£ +¤Þ¤¿¡¢¥¸¥§¥Í¥ì¡¼¥¿¤Ï¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ëÆâ¤Î¥Î¥¤¥º¤Î¥Ó¥Ã¥È¿ô¤Î¿äÄêÃͤò +ÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤«¤éÍð¿ô¤¬À¸À®¤µ¤ì¤ë¡£ +.LP +Æɤ߹þ¤ß¤¬¹Ô¤ï¤ì¤ë¤È¡¢ +\fI/dev/random\fP +¥Ç¥Ð¥¤¥¹¤Ï¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Î¥Î¥¤¥º¥Ó¥Ã¥È¤Î¿ô¤Î¿äÄêÃͤΤ¦¤Á¡¢ +¥é¥ó¥À¥à¥Ð¥¤¥È¤Î¤ß¤òÊÖ¤¹¡£ +\fI/dev/random\fP ¤Ï¥ï¥ó¥¿¥¤¥à¥Ñ¥Ã¥É (one-time pad) ¤ä¸°¤ÎÀ¸À®¤Î¤è¤¦¤Ê +Èó¾ï¤Ë¹â¤¤ÉʼÁ¤ò»ý¤Ã¤¿Ìµºî°ÙÀ­¤¬É¬ÍפˤʤëÍÑÅӤ˸þ¤¤¤Æ¤¤¤ë¤À¤í¤¦¡£ +¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤¬¶õ¤Î»þ¤Ï¡¢\fI/dev/random\fP ¤«¤é¤ÎÆɤ߽Ф·¤Ï¡¢ +¹¹¤Ê¤ë´Ä¶­¥Î¥¤¥º¤¬ÆÀ¤é¤ì¤ë¤Þ¤Ç¡¢¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¡£ +.LP +\fI/dev/urandom\fP ¥Ç¥Ð¥¤¥¹¤«¤éÆɤ߽Ф·¤Ç¤Ï¡¢ +¥¨¥ó¥È¥í¥Ô¡¼¤¬¤è¤ê¹â¤¯¤Ê¤ë¤Î¤òÂԤĤ¿¤á¤Î¥Ö¥í¥Ã¥¯¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +¤½¤Î·ë²Ì¡¢¤â¤·¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Ë½½Ê¬¤Ê¥¨¥ó¥È¥í¥Ô¡¼¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ +ÊÖ¤êÃͤϤ³¤Î¥É¥é¥¤¥Ð¤Ç»È¤ï¤ì¤Æ¤¤¤ë¥¢¥ë¥´¥ê¥º¥à¤Ë´ð¤Å¤¯°Å¹æ¹¶·â¤ËÂФ·¤Æ¡¢ +ÏÀÍýŪ¤Ë¤Ï¼å¤¯¤Ê¤ë¤³¤È¤Ë¤Ê¤ë¡£ +¤³¤Î¹¶·â¤ò¤É¤Î¤è¤¦¤Ë¹Ô¤¦¤«¤È¤¤¤¦»ö¤Ë¤Ä¤¤¤Æ¤Ï¡¢¸½ºß¸¦µæÏÀʸ¤Ê¤É¤Î +·Á¤ÇÆþ¼ê¤Ç¤­¤ë»ñÎÁ¤Ï¤Ê¤¤¡¢¤·¤«¤·¡¢¤½¤Î¤è¤¦¤Ê¹¶·â¤ÏÏÀÍýŪ¤Ë¸ºß²Äǽ¤Ç¤¢¤ë¡£ +¤â¤·¡¢¤³¤Î»ö¤¬¿´Çۤʤ顢(\fI/dev/urandom\fP ¤Ç¤Ï¤Ê¤¯) +\fI/dev/random\fP ¤òÍøÍѤ¹¤ì¤Ð¤¤¤¤¡£ +.SS »È¤¤Êý +.I /dev/random +¤È +.I /dev/urandom +¤Î¤É¤Á¤é¤ò»È¤¦¤Ù¤­¤«Ì¤ä¿¾ì¹ç¡¢¤¿¤¤¤Æ¤¤¤Ï +.I /dev/urandom +¤ÎÊý¤ò»È¤¤¤¿¤¤¤È»×¤Ã¤Æ¤¤¤ë¤Ï¤º¤À¤í¤¦¡£ +°ìÈ̤ˡ¢Ä¹´ü¤ËÅϤäƻȤï¤ì¤ë GPG/SSL/SSH ¤Î¥­¡¼°Ê³°¤ÎÁ´¤Æ¤Î¤â¤Î¤Ë +.I /dev/urandom +¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +²¼µ­¤Ç¿ä¾©¤·¤Æ¤¤¤ë¤è¤¦¤ËºÆµ¯Æ°¤ÎÁ°¸å¤ÇÍð¿ô¼ï¥Õ¥¡¥¤¥ë¤¬Êݸ¤µ¤ì¤ë¾ì¹ç +(Á´¤Æ¤Î¼ç¤Ê Linux ¤Î¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ï¾¯¤Ê¤¯¤È¤â 2000 ǯ°Ê¹ß¤Ï +Íð¿ô¼ï¤òÊݸ¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë)¡¢µ¯Æ°¥·¡¼¥±¥ó¥¹¤Ë¤ª¤¤¤ÆÍð¿ô¼ï¤¬ +ºÆ¥í¡¼¥É¤µ¤ì¤¿Ä¾¸å¤«¤é¡¢¤½¤Î½ÐÎÏ¤Ï¥í¡¼¥«¥ë¤Î¥ë¡¼¥È¥¢¥¯¥»¥¹¤¬¤Ç¤­¤Ê¤¤ +¹¶·â¼Ô¤ËÂФ·¤Æ°Å¹æŪ¤Ë°ÂÁ´¤Ê¤â¤Î¤È¤Ê¤ê¡¢¥Í¥Ã¥È¥ï¡¼¥¯°Å¹æ²½¤Î¥»¥Ã¥·¥ç¥ó¥­¡¼ +¤È¤·¤Æ»È¤¦¤Ë¤Ï´°Á´¤ËºÇŬ¤Ê¤â¤Î¤È¤Ê¤ë¡£ +.I /dev/random +¤«¤é¤ÎÆɤ߽Ф·¤ÏÄä»ß (block) ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¡¢¥æ¡¼¥¶¤ÏÉáÄÌ +¤³¤Î¥Õ¥¡¥¤¥ë¤òÈóÄä»ß (nonblocking) ¥â¡¼¥É¤Ç³«¤³¤¦¤È¤· +(¤â¤·¤¯¤Ï¥¿¥¤¥à¥¢¥¦¥È¤ò»ØÄꤷ¤ÆÆɤ߽Ф·¤ò¼Â¹Ô¤·)¡¢´õ˾¤¹¤ë¥ì¥Ù¥ë¤Î +¥¨¥ó¥È¥í¥Ô¡¼¤Ï¤¹¤°¤Ë¤ÏÍøÍѤǤ­¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢²¿¤é¤«¤ÎÄÌÃΤò¹Ô¤¦¤³¤È¤À¤í¤¦¡£ + +¥«¡¼¥Í¥ë¤ÎÍð¿ô¥¸¥§¥Í¥ì¡¼¥¿¤Ï¡¢°Å¹æµ¿»÷Íð¿ô¥¸¥§¥Í¥ì¡¼¥¿ (Cryptographic +pseudo-random number generator; CPRNG) ¤Î¼ï¤È¤·¤Æ»ÈÍѤǤ­¤ë +¹âÉʼÁ¤ÊÍð¿ô¼ï¤ÎºàÎÁ¤ò¾¯¤·À¸À®¤¹¤ë¤¿¤á¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï®Å٤ǤϤʤ¯°ÂÁ´À­¤ò½Å»ë¤·¤ÆÀ߷פµ¤ì¤Æ¤ª¤ê¡¢ +¥é¥ó¥À¥à¤Ê¥Ç¡¼¥¿¤òÂçÎ̤ËÀ¸À®¤¹¤ë¤Î¤Ë¤ÏÁ´¤¯¤â¤Ã¤ÆŬ¤·¤Æ¤¤¤Ê¤¤¡£ +¥æ¡¼¥¶¤Ï +.I /dev/urandom +(¤È +.IR /dev/random ) +¤«¤éÆɤ߽Ф¹Íð¿ô¼ï¤ÎºàÎÁ¤ÎÎ̤ò¤Ç¤­¤ë¤À¤±ÀáÌ󤹤٤­¤Ç¤¢¤ë¡£ +¤³¤Î¥Ç¥Ð¥¤¥¹¤«¤éÉÔɬÍפËÂçÎ̤Υǡ¼¥¿¤òÆɤ߽Ф¹¤È¡¢¤³¤Î¥Ç¥Ð¥¤¥¹¤ò»È¤¦ +¾¤Î¥æ¡¼¥¶¤Ë¥Þ¥¤¥Ê¥¹¤Î±Æ¶Á¤òÍ¿¤¨¤Æ¤·¤Þ¤¦¤À¤í¤¦¡£ + +°Å¹æ¸°¤òÀ¸À®¤¹¤ë¤Î¤ËɬÍפÊÍð¿ô¼ï¤ÎºàÎÁ¤ÎÎ̤ϡ¢¸°¤Î¼Â¸ú¥µ¥¤¥º¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢3072 ¥Ó¥Ã¥È¤Î RSA ¤ª¤è¤Ó Diffie-Hellman ¤ÎÈëÌ©¸°¤Î¼Â¸ú¥µ¥¤¥º¤Ï +128 ¥Ó¥Ã¥È (¤³¤ÎÈëÌ©¸°¤òÇˤë¤Ë¤Ï 2^128 ²ó¤ÎÁàºî¤¬É¬ÍפȤ¤¤¦¤³¤È) ¤Ç¤¢¤ê¡¢ +¤½¤Î¤¿¤á¸°À¸À®´ï¤¬ +.I /dev/random +¤«¤éÆɤ߽Ф¹É¬Íפ¬¤¢¤ëÍð¿ô¼ï¤ÎºàÎÁ¤ÎÎÌ¤Ï 128 ¥Ó¥Ã¥È (16 ¥Ð¥¤¥È) ¤À¤±¤Ç¤¢¤ë¡£ + +CPRNG ¥¢¥ë¥´¥ê¥º¥à¤Î·ç´Ù¤ËÂФ¹¤ëÊݸî¤È¤·¤Æ¡¢¤³¤ÎºÇ¾®ÃͤËÂФ·¤Æ¤¤¤¯¤é¤«¤Î +°ÂÁ´¾å¤Î¥Þ¡¼¥¸¥ó¤ò¼è¤ë¤Î¤Ï¤â¤Ã¤È¤â¤À¤¬¡¢¸½ºßÍøÍѲÄǽ¤Ê°Å¹æ¥×¥ê¥ß¥Æ¥£¥Ö¤Ç +256 ¥Ó¥Ã¥È¤è¤ê¿¤¯¤Î°ÂÁ´¤ÊÍð¿ô¤òɬÍפȤ¹¤ë¤è¤¦¤Ê¤â¤Î¤Ï¤Ê¤¤¡£ +µ¯Æ°¤¹¤ëÅ٤ˡ¢¤â¤·¤¯¤ÏÍð¿ô¼ï¤òÊѹ¹¤¹¤ëÂÅÅö¤Ê´Ö³Ö (1 ʬ¤è¤êû¤¯¤Ê¤ë¤³¤È¤Ï¤Ê¤¤) +¤ÎÅ٤ˡ¢¥«¡¼¥Í¥ë¤ÎÍð¿ô¥×¡¼¥ë¤«¤é 256 ¥Ó¥Ã¥È (32 ¥Ð¥¤¥È) ¤è¤ê¤¿¤¯¤µ¤óÆɤ߽Ф¹ +¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥×¥í¥°¥é¥à¤Î°Å¹æ½èÍý¤¬¤¦¤Þ¤¯¼ÂÁõ¤µ¤ì¤Æ¡Ö¤¤¤Ê¤¤¡×²ÄǽÀ­¤¬ +¤¢¤ë¤È¹Í¤¨¤ë¤Ù¤­¤Ç¤¢¤í¤¦¡£ +.SS ÀßÄê +¥·¥¹¥Æ¥à¤Ë¤¢¤é¤«¤¸¤áºîÀ®¤µ¤ì¤¿ \fI/dev/random\fP ¤È +\fI/dev/urandom\fP ¤¬Â¸ºß¤·¤Ê¤¤¤Ê¤é¡¢¼¡¤Î¤è¤¦¤Ê¥³¥Þ¥ó¥É¤ÇºîÀ®¤Ç¤­¤ë¡£ +.nf + + mknod \-m 644 /dev/random c 1 8 + mknod \-m 644 /dev/urandom c 1 9 + chown root:root /dev/random /dev/urandom +.fi + +¥ª¥Ú¥ì¡¼¥¿¤ÎÁàºî¤Ê¤·¤Ë Linux ¥·¥¹¥Æ¥à¤¬µ¯Æ°¤·¤¿Ä¾¸å¤Ï¡¢ +¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Ï°Õ³°À­¤Î˳¤·¤¤¶Ñ°ì¤Ê¾õÂ֤ˤ¢¤ë¤À¤í¤¦¡£ +¤³¤ì¤Ë¤è¤ê¡¢¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Î¼ÂºÝ¤Î¥Î¥¤¥ºÎ̤Ïɾ²ÁÃͤè¤ê¾¯¤Ê¤¯¤Ê¤ë¡£ +¤³¤Î¸ú²Ì¤òÂǤÁ¾Ã¤¹¤¿¤á¤Ë¡¢¥·¥ã¥Ã¥È¥À¥¦¥ó¤«¤é (¼¡¤Î) µ¯Æ°»þ¤Þ¤Ç»ý¤Á±Û¤·¤¿ +¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Î¾ðÊ󤬽õ¤±¤Ë¤Ê¤ë¡£ +¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤ò»ý¤Á±Û¤¹¤¿¤á¤Ë¤Ï¡¢ +Linux ¥·¥¹¥Æ¥à¤Îµ¯Æ°»þ¤Ë¼Â¹Ô¤µ¤ì¤ëŬÀڤʥ¹¥¯¥ê¥×¥È¤Ë¡¢ +°Ê²¼¤Î¹Ô¤òÄɲ乤ì¤Ð¤è¤¤: +.nf + + echo "Initializing random number generator..." + random_seed=/var/run/random-seed + # Íð¿ô¼ï¤òº£²ó¤Î¥¹¥¿¡¼¥È¥¢¥Ã¥×¤«¤é¼¡²ó¤Î¥¹¥¿¡¼¥È¥¢¥Ã¥×¤Þ¤Ç»ý¤Á±Û¤¹¡£ + # ¥í¡¼¥É¤ò¹Ô¤¤¡¢¤½¤Î¸å¡¢Á´¤Æ¤Î¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤òÊݸ¤¹¤ë¡£ + if [ \-f $random_seed ]; then + cat $random_seed >/dev/urandom + else + touch $random_seed + fi + chmod 600 $random_seed + poolfile=/proc/sys/kernel/random/poolsize + [ \-r $poolfile ] && bytes=\`cat $poolfile\` || bytes=512 + dd if=/dev/urandom of=$random_seed count=1 bs=$bytes +.fi + +¤Þ¤¿¡¢Linux ¥·¥¹¥Æ¥à¤Î¥·¥ã¥Ã¥È¥À¥¦¥ó»þ¤Ë¼Â¹Ô¤µ¤ì¤ëŬÀڤʥ¹¥¯¥ê¥×¥È¤Ë¡¢ +°Ê²¼¤Î¹Ô¤òÄɲ乤ì¤Ð¤è¤¤: +.nf + + # Íð¿ô¼ï¤òº£²ó¤Î¥·¥ã¥Ã¥È¥À¥¦¥ó¤«¤é¼¡²ó¤Î¥¹¥¿¡¼¥È¥¢¥Ã¥×¤Þ¤Ç»ý¤Á±Û¤¹¡£ + # Á´¤Æ¤Î¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤òÊݸ¤¹¤ë¡£ + echo "Saving random seed..." + random_seed=/var/run/random-seed + touch $random_seed + chmod 600 $random_seed + poolfile=/proc/sys/kernel/random/poolsize + [ \-r $poolfile ] && bytes=\`cat $poolfile\` || bytes=512 + dd if=/dev/urandom of=$random_seed count=1 bs=$bytes +.fi +.SS "/proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹" +¥Ç¥£¥ì¥¯¥È¥ê +.I /proc/sys/kernel/random +¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë (2.3.16 ¤«¤é¸ºß¤¹¤ë) ¤Ï¡¢ +.I /dev/random +¥Ç¥Ð¥¤¥¹¤Ø¤Î¤½¤Î¾¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +.LP +Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë +.I entropy_avail +¤Ï»ÈÍѲÄǽ¤Ê¥¨¥ó¥È¥í¥Ô¡¼¤òɽ¤¹¡£ +Ä̾¤³¤ì¤Ï 4096 (¥Ó¥Ã¥È) ¤Ë¤Ê¤ê¡¢¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤¬ËþÇդξõÂ֤Ǥ¢¤ë¡£ +.LP +¥Õ¥¡¥¤¥ë +.I poolsize +¤Ï¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Î¥µ¥¤¥º¤òɽ¤¹¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î°ÕÌ£¤Ï¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê°Û¤Ê¤ë¡£ +.RS +.TP 12 +Linux 2.4: +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Î¥µ¥¤¥º¤ò¡Ö¥Ð¥¤¥È¡×ñ°Ì¤Çµ¬Äꤹ¤ë¡£ +Ä̾¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÃÍ¤Ï 512 ¤Ë¤Ê¤ë¤¬¡¢½ñ¤­¹þ¤ß²Äǽ¤Ç¤¢¤ê¡¢ +¥¢¥ë¥´¥ê¥º¥à¤ÇÍøÍѲÄǽ¤ÊǤ°Õ¤ÎÃͤËÊѹ¹¤Ç¤­¤ë¡£ +ÁªÂò²Äǽ¤ÊÃÍ¤Ï 32, 64, 128, 256, 512, 1024, 2048 ¤Ç¤¢¤ë¡£ +.TP +Linux 2.6: +¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÆɤ߽Ф·ÀìÍѤǤ¢¤ê¡¢ +¥¨¥ó¥È¥í¥Ô¡¼¡¦¥×¡¼¥ë¤Î¥µ¥¤¥º¤ò¡Ö¥Ó¥Ã¥È¡×ñ°Ì¤Çµ¬Äꤹ¤ë¡£ +ÃÍ¤Ï 4096 ¤Ç¤¢¤ë¡£ +.RE +.LP +¥Õ¥¡¥¤¥ë +.I read_wakeup_threshold +¤Ï +.I /dev/random +¤«¤é¤Î¥¨¥ó¥È¥í¥Ô¡¼¤òÂԤäƵٻߤ·¤Æ¤¤¤ë¥×¥í¥»¥¹¤òµ¯¤³¤¹¤Î¤ËɬÍ×¤Ê +¥¨¥ó¥È¥í¥Ô¡¼¤Î¥Ó¥Ã¥È¿ô¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 64 ¤Ç¤¢¤ë¡£ +¥Õ¥¡¥¤¥ë +.I write_wakeup_threshold +¤Ï¥¨¥ó¥È¥í¥Ô¡¼¤Î¥Ó¥Ã¥È¿ô¤òÊÝ»ý¤·¤Æ¤ª¤ê¡¢¤³¤ÎÃͰʲ¼¤Ë¤Ê¤Ã¤¿¤é +.I /dev/random +¤Ø¤Î½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤Î¤¿¤á¤Ë +.BR select (2) +¤Þ¤¿¤Ï +.BR poll (2) +¤ò¼Â¹Ô¤¹¤ë¥×¥í¥»¥¹¤òµ¯¤³¤¹¡£ +¤³¤ÎÃͤϥե¡¥¤¥ë¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤³¤È¤Ë¤è¤Ã¤ÆÊѹ¹¤Ç¤­¤ë¡£ +.LP +Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë +.I uuid +¤È +.I boot_id +¤Ï 6fd5a44b-35f4-4ad4-a9b9-6b9be13e1fe9 ¤Î¤è¤¦¤Ê +¥é¥ó¥À¥à¤Êʸ»úÎó¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£ +Á°¼Ô¤ÏÆɤ߹þ¤ß¤ÎÅ٤˿·¤¿¤ËÀ¸À®¤µ¤ì¡¢ +¸å¼Ô¤Ï 1 ÅÙ¤À¤±À¸À®¤µ¤ì¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +/dev/random +.br +/dev/urandom +.\" .SH Ãø¼Ô +.\" ¥«¡¼¥Í¥ë¡¦¥é¥ó¥À¥à¥Ê¥ó¥Ð¡¼¡¦¥¸¥§¥Í¥ì¡¼¥¿¤Ï Theodora Ts'o +.\" (tytso@athena.mit.edu) ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +mknod (1) +.br +RFC\ 1750, "Randomness Recommendations for Security" +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ diff --git a/release/man4/rtc.4 b/release/man4/rtc.4 new file mode 100644 index 00000000..fda22869 --- /dev/null +++ b/release/man4/rtc.4 @@ -0,0 +1,334 @@ +.\" rtc.4 +.\" Copyright 2002 Urs Thuermann (urs@isnogud.escape.de) +.\" +.\" 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. +.\" +.\" $Id: rtc.4,v 1.4 2005/12/05 17:19:49 urs Exp $ +.\" +.\" 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" +.SH ̾Á° +rtc \- ¥ê¥¢¥ë¥¿¥¤¥à¥¯¥í¥Ã¥¯ +.SH ½ñ¼° +#include +.sp +.BI "int ioctl(" fd ", RTC_" request ", " param ");" +.SH ÀâÌÀ +¤³¤ì¤Ï¥ê¥¢¥ë¥¿¥¤¥à¥¯¥í¥Ã¥¯ (RTC) ¤Î¥É¥é¥¤¥Ð¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ + +¿¤¯¤Î¥³¥ó¥Ô¥å¡¼¥¿¤Ï¡¢¸½ºß¤Î¡ÖÊÉ»þ·×¡×»þ¹ï ("wall clock" time) ¤òµ­Ï¿¤¹¤ë¡¢ +¥Ï¡¼¥É¥¦¥§¥¢¥¯¥í¥Ã¥¯¤ò 1 ¸Ä°Ê¾å»ý¤Ã¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Ï¡Ö¥ê¥¢¥ë¥¿¥¤¥à¥¯¥í¥Ã¥¯¡×(RTC) ¤È¸Æ¤Ð¤ì¤ë¡£ +¤³¤ì¤é¤Î»þ·×¤Î¤¦¤Á 1 ¤Ä¤Ï¡¢Ä̾ï¤ÏÅÅÃӤǥХ寥¢¥Ã¥×¤·¤Æ¶îÆ°¤µ¤ì¤ë¤Î¤Ç¡¢ +¥³¥ó¥Ô¥å¡¼¥¿¤Î¥¹¥¤¥Ã¥Á¤òÀڤäƤ⡢»þ¹ï¤òÊÝ»ý¤Ç¤­¤ë¡£ +¿¤¯¤Î¾ì¹ç¡¢RTC ¤Ï¥¢¥é¡¼¥à¤ä¤½¤Î¾¤Î³ä¤ê¹þ¤ß¤Îµ¡Ç½¤òÄ󶡤¹¤ë¡£ + +Á´¤Æ¤Î i386 PC ¤È ACPI ¥Ù¡¼¥¹¤Î¥·¥¹¥Æ¥à¤Ë¤Ï RTC ¤¬¤¢¤ë¡£ +¤³¤Î RTC ¤Ï¡¢¸µ¡¹¤Î PC/AT ¤Ë¸ºß¤·¤¿ +Motorola MC146818 ¥Á¥Ã¥×¤È¸ß´¹À­¤¬¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê RTC ¤Ï¡¢º£Æü¤Ç¤Ï¥Þ¥¶¡¼¥Ü¡¼¥É¤Î +¥Á¥Ã¥×¥»¥Ã¥È (¥µ¥¦¥¹¥Ö¥ê¥Ã¥¸) Æâ¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¯¡¢ +¸ò´¹²Äǽ¤Ê¹Å²ß¤¯¤é¤¤¤ÎÂ礭¤µ¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×ÅÅÃÓ¤ò»È¤Ã¤Æ¤¤¤ë¡£ + +¥·¥¹¥Æ¥à¥ª¥ó¥Á¥Ã¥× (system-on-chip) ¥×¥í¥»¥Ã¥µ¤ò»È¤Ã¤Æºî¤é¤ì¤¿ +ÁȤ߹þ¤ß¥·¥¹¥Æ¥à¤È¤¤¤Ã¤¿¡¢PC °Ê³°¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢Ê̤ʼÂÁõ¤òÍѤ¤¤Æ¤¤¤ë¡£ +¤³¤Î¤è¤¦¤Ê¥·¥¹¥Æ¥à¤Ç¤Ï¡¢PC/AT ¤Î RTC ¤ÈƱ¤¸µ¡Ç½¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤¬Â¿¤¤¡£ + +.SS RTC ¤È¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Î°ã¤¤ +RTC ¤ò¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Èº®Æ±¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Ï¡¢¥«¡¼¥Í¥ë¤Ë´ÉÍý¤µ¤ì¤ë¥½¥Õ¥È¥¦¥§¥¢¥¯¥í¥Ã¥¯¤Ç¤¢¤ê¡¢ +¥Õ¥¡¥¤¥ë¤Ë¤è¤ë¥¿¥¤¥à¥¹¥¿¥ó¥×ÀßÄê¤Ê¤É¤È¤È¤â¤Ë¡¢ +.BR gettimeofday (2) +¤ä +.BR time (2) +¤ò¼ÂÁõ¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Ï¡¢POSIX ¤Ë¤ª¤±¤ëµª¸µ +(Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤ÎÉäȥߥêÉäòɽ¤¹¡£ +1 ¤Ä¤Î°ìÈÌŪ¤Ê¼ÂÁõ¤Ç¤Ï¥¿¥¤¥Þ¡¼³ä¤ê¹þ¤ß¤ò¡¢"jiffy" Ëè¤Ë 1 ²ó¡¢ +100, 250, 1000 Hz ¤È¤¤¤¦¼þÇÈ¿ô¤Ç¥«¥¦¥ó¥È¤¹¤ë¡£ + +RTC ¤È¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Î½ÅÍפʰ㤤¤Ï¡¢ +RTC ¤Ï¥·¥¹¥Æ¥à¤¬ÄãÅÅÎϾõÂÖ (¡Ö¥ª¥Õ¡×¤Î¾ì¹ç¤â´Þ¤à) ¤Ç¤âÆ°ºî¤¹¤ë¤Î¤ËÂФ·¡¢ +¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤ÏÆ°ºî¤·¤Ê¤¤ÅÀ¤Ç¤¢¤ë¡£ +¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Ï¡¢½é´ü²½¤¬¹Ô¤ï¤ì¤ë¤Þ¤Ç¤Ï¡¢ +POSIX µª¸µ¤«¤é¤Ç¤Ï¤Ê¤¯¥·¥¹¥Æ¥à¤Î¥Ö¡¼¥È»þ¤«¤é¤Î»þ¹ï¤·¤«ÊÖ¤»¤Ê¤¤¡£ +¤½¤Î¤¿¤á¡¢¥Ö¡¼¥È»þ¤ä¥·¥¹¥Æ¥à¤ÎÄãÅÅÎϾõÂÖ¤«¤é¤ÎÉüµ¢ (resume) ¸å¤Ë¤Ï¡¢ +¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Ï RTC ¤ò»È¤Ã¤Æ¸½ºß¤ÎÊÉ»þ·×»þ¹ï¤ËÀßÄꤵ¤ì¤ë¾ì¹ç¤¬Â¿¤¤¡£ +RTC ¤ò»ý¤¿¤Ê¤¤¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +¾¤Î»þ·×¤ò»È¤Ã¤Æ¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤òÀßÄꤹ¤ëɬÍפ¬¤¢¤ê¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¤Ë¥¢¥¯¥»¥¹¤·¤¿¤ê¡¢(»þ¹ï) ¥Ç¡¼¥¿¤ò¼êÆ°¤ÇÆþÎϤ·¤¿¤ê¤¹¤ë¤À¤í¤¦¡£ +.SS RTC ¤Îµ¡Ç½ +RTC ¤Ï +.BR hwclock (8) +¤Þ¤¿¤Ï²¼µ­¤Î ioctl ¥ê¥¯¥¨¥¹¥È¤ÇÆɤ߽ñ¤­¤¬¤Ç¤­¤ë¡£ + +ÆüÉդȻþ´Ö¤ò¥«¥¦¥ó¥È¤¹¤ë¤Î¤Ë²Ã¤¨¤Æ¡¢ +¿¤¯¤Î RTC ¤Ï°Ê²¼¤Î¤è¤¦¤Ë³ä¤ê¹þ¤ß¤òȯÀ¸¤Ç¤­¤ë¡£ +.IP * 3 +¥¯¥í¥Ã¥¯¤Î¹¹¿·Ëè (¤Ä¤Þ¤ê 1 ÉÃËè)¡£ +.IP * +2 Hz ¤«¤é 8192 Hz ¤Þ¤Ç¤Î 2 ¤Î¾è¿ô¤Î¼þÇÈ¿ô¤Ç¡¢Äê´üŪ¤Ê´Ö³Ö¡£ +.IP * +Á°¤â¤Ã¤Æ»ØÄꤷ¤¿¥¢¥é¡¼¥à»þ¹ï¤Ë㤷¤¿»þ¡£ +.PP +¤³¤ì¤é¤Î³ä¤ê¹þ¤ß¸µ¤Ï¡¢¸ÄÊ̤ËÍ­¸ú¤Ë¤·¤¿¤ê̵¸ú¤Ë¤·¤¿¤ê¤Ç¤­¤ë¡£ +¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥¢¥é¡¼¥à³ä¤ê¹þ¤ß¤ò¥·¥¹¥Æ¥à¤Î +¥¦¥§¥¤¥¯¥¢¥Ã¥×¥¤¥Ù¥ó¥È¤È¤·¤ÆÀßÄê¤Ç¤­¤ë¡£ +¤³¤Î¥¤¥Ù¥ó¥È¤Ï¡¢RAM ¤Ø¤Î¥µ¥¹¥Ú¥ó¥É (STR, ACPI ¥·¥¹¥Æ¥à¤Ç S3 ¤È¸Æ¤Ð¤ì¤ë) ¤ä +¥Ï¥¤¥Ð¡¼¥Í¡¼¥·¥ç¥ó (ACPI ¥·¥¹¥Æ¥à¤Ç S4 ¤È¸Æ¤Ð¤ì¤ë) ¤È¤¤¤Ã¤¿ÄãÅÅÎϾõÂ֤䡢 +¡Ö¥ª¥Õ¡×(ACPI ¥·¥¹¥Æ¥à¤Ç S5 ¤È¸Æ¤Ð¤ì¤ë) ¤«¤é¤Ç¤â¡¢¥·¥¹¥Æ¥à¤òÉüµ¢¤Ç¤­¤ë¡£ +ÅÅÃӤǥХ寥¢¥Ã¥×¤µ¤ì¤¿ RTC ¤¬³ä¤ê¹þ¤ß¤òȯÀ¸¤Ç¤­¤ë¥·¥¹¥Æ¥à¤È¡¢ +¤Ç¤­¤Ê¤¤¥·¥¹¥Æ¥à¤¬¤¢¤ë¡£ + +.I /dev/rtc +(¤Þ¤¿¤Ï +.IR /dev/rtc0 , +.I /dev/rtc1 +¤Ê¤É¤Î) +¥Ç¥Ð¥¤¥¹¤Ï (¥¯¥í¡¼¥º¤µ¤ì¤ë¤Þ¤Ç) 1 ²ó¤·¤«¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤º¡¢ +Æɤ߹þ¤ßÀìÍѤǤ¢¤ë¡£ +.BR read (2) +¤È +.BR select (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¡¢ +RTC ¤«¤é¤Î³ä¤ê¹þ¤ß¤ò¼õ¤±¼è¤ë¤Þ¤ÇÄä»ß (block) ¤µ¤ì¤ë¡£ +³ä¤ê¹þ¤ß¤Î¸å¡¢¥×¥í¥»¥¹¤Ï long ·¿À°¿ô¤òÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ÎÀ°¿ô¤ÎºÇ²¼°Ì¥Ð¥¤¥È¤ÏȯÀ¸¤·¤¿³ä¤ê¹þ¤ß¤Î¼ïÊ̤ò +¥³¡¼¥É²½¤·¤¿¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ê¡¢ +»Ä¤ê¤Î 3 ¥Ð¥¤¥È¤ÏºÇ¸å¤Î +.BR read (2) +°Ê¹ß¤ËȯÀ¸¤·¤¿³ä¤ê¹þ¤ß¤Î²ó¿ô¤Ç¤¢¤ë¡£ +.SS ioctl(2) ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +°Ê²¼¤Î +.BR ioctl (2) +¥ê¥¯¥¨¥¹¥È¤¬ RTC ¥Ç¥Ð¥¤¥¹¤ÎÀܳ¤µ¤ì¤¿ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.TP +.B RTC_RD_TIME +RTC ¤Î»þ¹ï¤ò°Ê²¼¤Î¹½Â¤ÂΤÇÊÖ¤¹: +.IP +.in +4n +.nf +struct rtc_time { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; /* ̤»ÈÍÑ */ + int tm_yday; /* ̤»ÈÍÑ */ + int tm_isdst; /* ̤»ÈÍÑ */ +}; +.fi +.in +.IP +¤³¤Î¹½Â¤ÂΤΥե£¡¼¥ë¥É¤Ï +.BR gmtime (3) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë +.I tm +¹½Â¤ÂΤΥե£¡¼¥ë¥É¤ÈƱ¤¸°ÕÌ£¤ÇƱ¤¸ÈϰϤǤ¢¤ë¡£ +¤³¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò +.BR ioctl (2) +¤ÎÂè 3 °ú¤­¿ô¤È¤·¤ÆÅϤ¹¡£ +.TP +.B RTC_SET_TIME +.BR ioctl (2) +¤ÎÂè 3 °ú¤­¿ô¤¬»Ø¤¹ +.I rtc_time +¹½Â¤ÂΤÎÃͤò RTC »þ¹ï¤ËÀßÄꤹ¤ë¡£ +RTC »þ¹ï¤ÎÀßÄꤹ¤ë¾ì¹ç¡¢¥×¥í¥»¥¹¤ÏÆø¢ +(¤Ä¤Þ¤ê +.B CAP_SYS_TIME +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BR RTC_ALM_READ ", " RTC_ALM_SET +¥¢¥é¡¼¥à¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë RTC ¤ËÂФ·¤Æ¡¢ +¥¢¥é¡¼¥à»þ¹ï¤ÎÆɤ߹þ¤ß¤ÈÀßÄê¤ò¹Ô¤¦¡£ +¥¢¥é¡¼¥à³ä¤ê¹þ¤ß¤Ï¡¢ +.BR RTC_AIE_ON ", " RTC_AIE_OFF +¤ò»È¤Ã¤Æ¡¢¤³¤ì¤È¤ÏÊ̤ËÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +\fBioctl\fP(2) ¤ÎÂè 3 °ú¤­¿ô¤Ï¡¢ +.I rtc_time +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î¹½Â¤ÂΤΠ+.IR tm_sec , +.IR tm_min , +.I tm_hour +¥Õ¥£¡¼¥ë¥É¤Î¤ß¤¬»ÈÍѤµ¤ì¤ë¡£ +.TP +.BR RTC_IRQP_READ ", " RTC_IRQP_SET +¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë RTC ¤ËÂФ·¤Æ¡¢ +¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤Î¼þÇÈ¿ô¤ÎÆɤ߹þ¤ß¤ÈÀßÄê¤ò¹Ô¤¦¡£ +¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤Ï¡¢ +.BR RTC_PIE_ON ", " RTC_PIE_OFF +¤ò»È¤Ã¤Æ¡¢¤³¤ì¤È¤ÏÊ̤ËÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +\fBioctl\fP(2) ¤ÎÂè 3 °ú¤­¿ô¤Ï¡¢¤½¤ì¤¾¤ì +.I "unsigned long\ *" +¤È +.I "unsigned long" +¤Ç¤¢¤ë¡£ +¤³¤ÎÃÍ¤Ï 1 ÉÃÅö¤¿¤ê¤Î³ä¤ê¹þ¤ß¤Î²ó¿ô¤Ç¤¢¤ë¡£ +»ØÄê²Äǽ¤Ê¼þÇÈ¿ô¤Ï¡¢2 ¤Î¾è¿ô¤Ç 2 ¤«¤é 8192 ¤ÎÈϰϤǤ¢¤ë¡£ +Æø¢¥×¥í¥»¥¹ (¤Ä¤Þ¤ê +.B CAP_SYS_RESOURCE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Î¤ß¤¬¡¢ +.I /proc/sys/dev/rtc/max-user-freq +¤Ë½ñ¤«¤ì¤¿¾åµ­¤Î¼þÇÈ¿ô¤òÀßÄê¤Ç¤­¤ë¡£ +(¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç 64 ¤È¤¤¤¦Ãͤ¬½ñ¤«¤ì¤Æ¤¤¤ë)¡£ +.TP +.BR RTC_AIE_ON ", " RTC_AIE_OFF +¥¢¥é¡¼¥à¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë RTC ¤ËÂФ·¤Æ¡¢ +¥¢¥é¡¼¥à³ä¤ê¹þ¤ß¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ +\fBioctl\fP(2) ¤ÎÂè 3 °ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.BR RTC_UIE_ON ", " RTC_UIE_OFF +1 ÉÃËè¤Î³ä¤ê¹þ¤ß¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë RTC ¤ËÂФ·¤Æ¡¢ +¥¯¥í¥Ã¥¯¹¹¿·Ëè¤Î³ä¤ê¹þ¤ß¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ +\fBioctl\fP(2) ¤ÎÂè 3 °ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.BR RTC_PIE_ON ", " RTC_PIE_OFF +¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë RTC ¤ËÂФ·¤Æ¡¢ +¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ +\fBioctl\fP(2) ¤ÎÂè 3 °ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +Æø¢¥×¥í¥»¥¹ (¤Ä¤Þ¤ê +.B CAP_SYS_RESOURCE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Î¤ß¤¬¡¢ +¤½¤Î»þÅÀ¤Ç +.I /proc/sys/dev/rtc/max-user-freq +¤Ë¼þ´ü¤¬¾åµ­¤ÎÃͤ˻ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤òÍ­¸ú¤Ë¤Ç¤­¤ë¡£ +.TP +.BR RTC_EPOCH_READ ", " RTC_EPOCH_SET +¿¤¯¤Î RTC ¤Ïǯ¤ò 8 ¥Ó¥Ã¥È¤Î¥ì¥¸¥¹¥¿¤Ë¥³¡¼¥É²½¤¹¤ë¡£ +ǯ¤Ï 8 ¥Ó¥Ã¥È¤Î¥Ð¥¤¥Ê¥ê¿ô¤Þ¤¿¤Ï BCD ¿ô¤ËÊÑ´¹¤µ¤ì¤ë¡£ +¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢¤½¤Î¿ôÃÍ¤Ï RTC ¤Îµª¸µ¤«¤éÁêÂÐÃͤËÊÑ´¹¤µ¤ì¤ë¡£ +¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï RTC ¤Îµª¸µ¤Ï 1900 ¤Ë½é´ü²½¤µ¤ì¤ë¤¬¡¢ +Alpha ¤È MIPS ¤Ç¤Ï¡¢RTC ¥ì¥¸¥¹¥¿¤Îǯ¤ÎÃͤ˱þ¤¸¤Æ¡¢ +1952, 1980, 2000 ¤Î²¿¤ì¤«¤Ë½é´ü²½¤µ¤ì¤ë¡£ +¤³¤ì¤é¤ÎÁàºî¤Ç¤½¤ì¤¾¤ì RTC ¤Îµª¸µ¤ÎÆɤ߹þ¤ß¤ÈÀßÄ꤬²Äǽ¤Ê RTC ¤â¤¢¤ë¡£ +\fBioctl\fP(2) ¤ÎÂè 3 °ú¤­¿ô¤Ï¡¢¤½¤ì¤¾¤ì +.I "unsigned long\ *" +¤È +.I "unsigned long" +¤Ç¤¢¤ë¡£ +ÊÖ¤µ¤ì¤ëÃÍ (¤Þ¤¿¤Ï»ØÄꤵ¤ì¤ëÃÍ) ¤Ïµª¸µ¤Ç¤¢¤ë¡£ +RTC ¤Îµª¸µ¤òÀßÄꤹ¤ë¾ì¹ç¡¢¥×¥í¥»¥¹¤ÏÆø¢ (¤Ä¤Þ¤ê +.B CAP_SYS_TIME +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BR RTC_WKALM_RD ", " RTC_WKALM_SET +RTC ¤ÎÃæ¤Ë¤Ï¤è¤ê¶¯ÎϤʥ¢¥é¡¼¥à¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤â¤Î¤â¤¢¤ê¡¢ +¤³¤ì¤é¤Î ioctl ¤ò»È¤¦¤³¤È¤Ç¡¢°Ê²¼¤Î¤è¤¦¤Ê¹½Â¤ÂÎ¤Ç +RTC ¤Î¥¢¥é¡¼¥à»þ¹ï¤ò (¤½¤ì¤¾¤ì) Æɤ߽ñ¤­¤Ç¤­¤ë: +.PP +.RS +.in +4n +.nf +struct rtc_wkalrm { + unsigned char enabled; + unsigned char pending; + struct rtc_time time; +}; +.fi +.in +.RE +.IP +.I enabled +¥Õ¥é¥°¤Ï¥¢¥é¡¼¥à³ä¤ê¹þ¤ß¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤·¤¿¤ê¡¢ +¸½ºß¤Î¾õÂÖ¤òÆɤ߹þ¤à¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥é¥°¤ò»È¤¦¾ì¹ç¡¢ +.BR RTC_AIE_ON " ¤È " RTC_AIE_OFF +¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£ +.I pending +¥Õ¥é¥°¤Ï +.B RTC_WKALM_RD +¤Ç»ÈÍѤµ¤ì¡¢½èÍýÂÔ¤Á¤Î³ä¤ê¹þ¤ß¤òɽ¼¨¤¹¤ë +(EFI ¥Õ¥¡¡¼¥à¥¦¥§¥¢¤Ç´ÉÍý¤µ¤ì¤ë RTC ¤ÈÄÌ¿®¤¹¤ë¤È¤­°Ê³°¡¢ +Linux ¤Ç¤Ï¤Û¤È¤ó¤ÉÌò¤ËΩ¤¿¤Ê¤¤)¡£ +.I time +¥Õ¥£¡¼¥ë¥É¤Ï +.B RTC_ALM_READ +¤ä +.B RTC_ALM_SET +¤Î¾ì¹ç¤ÈƱ¤¸¤è¤¦¤Ë»ÈÍѤµ¤ì¤ë¤¬¡¢ +.IR tm_mday , +.IR tm_mon , +.I tm_year +¥Õ¥£¡¼¥ë¥É¤âÍ­¸ú¤Ç¤¢¤ë¤È¤¤¤¦ÅÀ¤¬°Û¤Ê¤ë¡£ +¤³¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò +.BR ioctl (2) +¤ÎÂè 3 °ú¤­¿ô¤È¤·¤ÆÅϤµ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +.IR /dev/rtc ", " +.IR /dev/rtc0 ", " +.I /dev/rtc1 +¤Ê¤É: +RTC Æü쥭¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë + +.IR /proc/driver/rtc : +(1 ¤ÄÌܤÎ) RTC ¤Î¾õÂÖ +.SH Ãí°Õ +¥«¡¼¥Í¥ë¤Î¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤ò +.BR adjtimex (2) +¤ò»È¤Ã¤Æ³°Éô»²¾È¤ÇƱ´ü¤µ¤»¤ë¾ì¹ç¡¢ +.BR adjtimex (2) +¤Ï»ØÄꤵ¤ì¤¿ RTC ¤ò 11 ʬËè¤ËÄê´üŪ¤Ë¹¹¿·¤¹¤ë¡£ +¤³¤ì¤ò¹Ô¤¦¤¿¤á¥«¡¼¥Í¥ë¤Ï¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤òû´ü´Ö̵¸ú¤Ë¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤ì¤Ï RTC ¤ò»È¤¦¥×¥í¥°¥é¥à¤Ë±Æ¶Á¤òÍ¿¤¨¤ë¡£ + +RTC ¤Îµª¸µ¤Ï¡¢¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Ç¤Î¤ß»ÈÍѤµ¤ì¤ë +POSIX ¤Îµª¸µ¤È¤Ï²¿¤Î´Ø·¸¤â¤Ê¤¤¡£ + +RTC ¤Îµª¸µ¤Èǯ¤Î¥ì¥¸¥¹¥¿¤Ë´ð¤Å¤¯Ç¯¤¬ 1970 ̤Ëþ¤Ç¤¢¤ë¾ì¹ç¡¢ +100 ǯ¸å¡¢¤Ä¤Þ¤ê 2000 ¤«¤é 2069 ¤Ç¤¢¤ë¤È²¾Äꤵ¤ì¤ë¡£ + +RTC ¤ÎÃæ¤Ë¤Ï¥¢¥é¡¼¥à¥Õ¥£¡¼¥ë¥É¤Ë +¡Ö¥ï¥¤¥ë¥É¥«¡¼¥É¡×¤ÎÃͤò¥µ¥Ý¡¼¥È¤¹¤ë¤â¤Î¤â¤¢¤ê¡¢ +Ëè»þ 15 ʬ¤ä³Æ·î¤Î½éÆü¤Ê¤É¡¢Äê´üŪ¤Ê¥¢¥é¡¼¥à¤ò¹Ô¤¦¥·¥Ê¥ê¥ª¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +¤³¤Î¤è¤¦¤Ê»È¤¤Êý¤Ï°Ü¿¢À­¤¬¤Ê¤¤¡£ +°Ü¿¢À­¤Î¹â¤¤¥æ¡¼¥¶¶õ´Ö¥³¡¼¥É¤Ç¤Ï¡¢Ã±ÆȤΥ¢¥é¡¼¥à³ä¤ê¹þ¤ß¤À¤±¤òÁÛÄꤷ¡¢ +³ä¤ê¹þ¤ß¤Î¼õ¿®¸å¤Ë¥¢¥é¡¼¥à¤ò̵¸ú¤Þ¤¿¤ÏºÆ½é´ü²½¤¹¤Ù¤­¤Ç¤¢¤ë¡£ + +°Ê²¼¤Îµ¡Ç½¤ò¥µ¥Ý¡¼¥È¤¹¤ë 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), +/usr/src/linux/Documentation/rtc.txt diff --git a/release/man4/sd.4 b/release/man4/sd.4 new file mode 100644 index 00000000..b3689638 --- /dev/null +++ b/release/man4/sd.4 @@ -0,0 +1,147 @@ +.\" sd.4 +.\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" 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) 1996,1997 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated 1997-02-06, ISHIKAWA Mutsumi +.\" Updated 2005-11-19, Akihiro MOTOKI +.\" +.\" WORD: pointer ¥Ý¥¤¥ó¥¿ +.\" WORD: structure ¹½Â¤ÂÎ +.\" WORD: geometry ¥¸¥ª¥á¥È¥ê +.\" WORD: sector ¥»¥¯¥¿ +.\" WORD: implement ¼ÂÁõ +.\" WORD: raw device ¥í¡¼¥Ç¥Ð¥¤¥¹ +.\" +.TH SD 4 1992-12-17 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sd \- SCSI ¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ö¤Î¤¿¤á¤Î¥É¥é¥¤¥Ð +.SH ½ñ¼° +.nf +.BR "#include " "/* for HDIO_GETGEO */" +.BR "#include " "/* for BLKGETSIZE and BLKRRPART */" +.fi +.SH ÀßÄê +¤³¤Î¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ (block device) ¤Î̾Á°¤Ï¡¢¼¡¤Î¤è¤¦¤Ê·Á¼°¤ò¤È¤ë: +.BI sd lp, +¤³¤Î¤¦¤Á¡¢ +.I l +¤ÏʪÍý¥É¥é¥¤¥Ö¤ò°ÕÌ£¤¹¤ëʸ»ú¤Ç¤¢¤ê¡¢ +.I p +¤Ï¤½¤ÎʪÍý¥É¥é¥¤¥Ö¾å¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó (partition) ¤ò°ÕÌ£¤¹¤ë¿ô»ú¤Ç¤¢¤ë¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Ê¥ó¥Ð¡¼ +.I p +¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢¤½¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ï¥É¥é¥¤¥ÖÁ´ÂΤò¤µ¤¹¡£ + +SCSI ¥Ç¥£¥¹¥¯¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 8 ¤ò»ý¤Á¡¢¼¡¤Î¤è¤¦¤Ê·Á¼°¤Î¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ +¤ò»ý¤Ä¡£(16 * +.IR drive_number ") + " partition_number ¡¢ +¤³¤Î +.I drive_number +¤Ï¸¡½Ð¤µ¤ì¤¿ÊªÍý¥É¥é¥¤¥Ö¤ÎÈÖ¹æ¤Ç¤¢¤ê¡¢ +.I partition_number +¤Ï¼¡¤Î¤è¤¦¤Ë¤Ê¤ë: +.sp +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó 0 ¤Ï¥É¥é¥¤¥ÖÁ´ÂÎ +.br +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó 1 ¡Á 4 ¤Ï DOS ¤Î "´ðËÜ (primary)" ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó +.br +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó 5 ¡Á 8 ¤Ï DOS ¤Î "³ÈÄ¥ (extended)" (¤Þ¤¿¤Ï¡¢"ÏÀÍý +(logical)") ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¡£ + +Î㤨¤Ð¡¢ +.I /dev/sda +¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 8 ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ 0 ¤ò»ý¤Á¡¢¥·¥¹¥Æ¥à¤ÎºÇ½é¤Î SCSI +¥É¥é¥¤¥ÖÁ´ÂΤò»²¾È¤¹¤ë¡£¤½¤·¤Æ¡¢ +.I /dev/sdb3 +¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 8 ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ 19 ¤ò»ý¤Á¡¢¥·¥¹¥Æ¥à¤ÎÆó¤ÄÌܤΠ+SCSI ¥É¥é¥¤¥Ö¤Î»°ÈÖÌܤΠDOS "´ðËÜ" ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ò»²¾È¤¹¤ë¡£ + +¸½ºß¤Ï¡¢¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤À¤±¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£¥í¡¼¡¦¥Ç¥Ð¥¤¥¹ (raw device) +¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ÀâÌÀ +¼¡¤Î +.I ioctl +¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë: +.TP +.B HDIO_GETGEO +.RS +¼¡¤Î¤è¤¦¤Ê¹½Â¤ÂΤòÍѤ¤¤Æ BIOS ¤Î¥Ç¥£¥¹¥¯¥Ñ¥é¥á¡¼¥¿¤òÊÖ¤¹: +.in +4n +.nf + +struct hd_geometry { + unsigned char heads; + unsigned char sectors; + unsigned short cylinders; + unsigned long start; +}; +.fi +.in + +¤³¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤¬ +.BR ioctl (2) +¤Ø¤Î¥Ñ¥é¥á¡¼¥¿¤È¤·¤ÆÅϤµ¤ì¤ë¡£ + +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤ËÆþ¤ì¤é¤ì¤ÆÊÖ¤µ¤ì¤ë¾ðÊó¤Ï¡¢ +.I "DOS ¤Ë¤è¤Ã¤ÆÍý²ò¤µ¤ì¤ë¤è¤¦¤Ê" +¥É¥é¥¤¥Ö¤Î¥¸¥ª¥á¥È¥ê¤Ç¤¢¤ë¡£ +¤³¤Î¥¸¥ª¥á¥È¥ê¤Ï¡¢¥É¥é¥¤¥Ö¤ÎʪÍýŪ¤Ê¥¸¥ª¥á¥È¥ê +.I ¤Ç¤Ï¤Ê¤¤¡£ +¤³¤Î¾ðÊó¤Ï¥É¥é¥¤¥Ö¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤òºîÀ®¤¹¤ë»þ¤ËÍѤ¤¤é¤ì¤ë¡¢ +¤Þ¤¿¡¢ +.BR fdisk (1), +.BR efdisk (1), +.BR lilo (1) +¤ÎŬÀÚ¤ÊÁàºî¤ËɬÍפǤ¢¤ë¡£ +¤â¤·¡¢¥¸¥ª¥á¥È¥ê¤Î¾ðÊó¤¬ÆÀ¤é¤ì¤Ê¤±¤ì¤Ð¡¢¤½¤ì¤¾¤ì¤ÎÃÍÁ´¤Æ¤Ë¥¼¥í¤¬Æþ¤ì +¤é¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ +.RE +.TP +.B BLKGETSIZE +¥»¥¯¥¿¤Î¿ô¤Çɽ¤·¤¿¥Ç¥Ð¥¤¥¹¤Î¥µ¥¤¥º¤¬ÊÖ¤µ¤ì¤ë¡£ +.BR ioctl (2) +¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢ +.I long +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.B BLKRRPART +¶¯À©Åª¤Ë¡¢SCSI ¥Ç¥£¥¹¥¯¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤ÎºÆÆɤ߹þ¤ß¤ò¹Ô¤¦¡£ +¥Ñ¥é¥á¡¼¥¿¤ÏɬÍפʤ¤¡£ + +.BR scsi (4) +¤Î +.BR ioctl (2) +Áàºî¤âƱÍͤ˥µ¥Ý¡¼¥È¤µ¤ì¤ë¡£ +.BR ioctl (2) +¤Î¥Ñ¥é¥á¡¼¥¿¤¬É¬Íפǡ¢¤½¤ì¤¬ NULL ¤Ê¤é¤Ð¡¢ +.BR ioctl (2) +¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +/dev/sd[a\-h]: ¥É¥é¥¤¥ÖÁ´ÂÎ +.br +/dev/sd[a\-h][0\-8]: ¸Ä¡¹¤Î¥Ö¥í¥Ã¥¯¥Ñ¡¼¥Æ¥£¥·¥ç¥ó +.\" .SH ´ØÏ¢¹àÌÜ +.\" .BR scsi (4) diff --git a/release/man4/sk98lin.4 b/release/man4/sk98lin.4 new file mode 100644 index 00000000..585dd151 --- /dev/null +++ b/release/man4/sk98lin.4 @@ -0,0 +1,598 @@ +.\" (C)Copyright 1999-2003 Marvell(R) -- linux@syskonnect.de +.\" sk98lin.4 1.1 2003/12/17 10:03:18 +.\" This manpage can be viewed using `groff -Tascii -man sk98lin.4 | less` +.\" +.\" 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 2004-10-09, Yuichi SATO +.\" Modified 2007-06-05, Akihiro MOTOKI , LDP v2.51 +.\" +.\"WORD: autonegotiation ¼«Æ°ÀßÄê +.\"WORD: interrupt moderation ³ä¤ê¹þ¤ßÄ´Ää +.\" +.TH SK98LIN 4 2007-11-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sk98lin \- Marvell/SysKonnect ¥®¥¬¥Ó¥Ã¥È¥¤¡¼¥µ¥Í¥Ã¥È¥É¥é¥¤¥Ð v6.21 +.SH ½ñ¼° +.B insmod sk98lin.o +.RB [ Speed_A=\c +.IR i,j,... ] +.RB [ Speed_B=\c +.IR i,j,... ] +.RB [ AutoNeg_A=\c +.IR i,j,... ] +.RB [ AutoNeg_B=\c +.IR i,j,... ] +.RB [ DupCap_A=\c +.IR i,j,... ] +.RB [ DupCap_B=\c +.IR i,j,... ] +.RB [ FlowCtrl_A=\c +.IR i,j,... ] +.RB [ FlowCtrl_B=\c +.IR i,j,... ] +.RB [ Role_A=\c +.IR i,j,... ] +.RB [ Role_B=\c +.IR i,j,... ] +.RB [ ConType=\c +.IR i,j,... ] +.RB [ Moderation=\c +.IR i,j,... ] +.RB [ IntsPerSec=\c +.IR i,j,... ] +.RB [ PrefPort=\c +.IR i,j,... ] +.RB [ RlmtMode=\c +.IR i,j,... ] +.SH ÀâÌÀ +.ad l +.hy 0 +.B sk98lin +¤Ï Marvell ¤È SysKonnect ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥À¥×¥¿¥«¡¼¥É¤Î +¥®¥¬¥Ó¥Ã¥È¥¤¡¼¥µ¥Í¥Ã¥È¥É¥é¥¤¥Ð¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï SysKonnect SK-98xx/SK-95xx ¸ß´¹¤Î¥®¥¬¥Ó¥Ã¥È¥¤¡¼¥µ¥Í¥Ã¥È¥¢¥À¥×¥¿¤È +Yukon ¸ß´¹¤Î¥Á¥Ã¥×¥»¥Ã¥È¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ + +insmod ¤ò»È¤Ã¤Æ¥É¥é¥¤¥Ð¤ò¥í¡¼¥É¤¹¤ëºÝ¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ñ¥é¥á¡¼¥¿¤ò +¥³¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¤¿¥³¥Þ¥ó¥É¤ÎÎó¤È¤·¤Æ»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +2 ¤Ä¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥À¥×¥¿¤¬¼è¤êÉÕ¤±¤é¤ì¤Æ¤¤¤ë»þ¤Ë¡¢ +Î㤨¤Ð¡¢1 ¤ÄÌܤΥ¢¥À¥×¥¿¤Î¥Ý¡¼¥È A ¤Î¼«Æ°¥Í¥´¥·¥¨¡¼¥·¥ç¥ó¤Ï ON ¤Ë¤¹¤ë¤¬¡¢ +2 ¤ÄÌܤΥ¢¥À¥×¥¿¤Î¥Ý¡¼¥È A ¤Ï OFF ¤Ë¤¹¤ë¾ì¹ç¤Ï¡¢ +°Ê²¼¤Î¤è¤¦¤ËÆþÎϤ¹¤ì¤Ð¤è¤¤: + + insmod sk98lin.o AutoNeg_A=On,Off + +.B sk98lin +¤¬ 1 ¤Ä°Ê¾å¤Î¥¢¥À¥×¥¿¥«¡¼¥É¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤Æ¡¢ +¤«¤Ä +.I /proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥·¥¹¥Æ¥à¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¼è¤êÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥À¥×¥¿¥«¡¼¥É¤ÎÁ´¤Æ¤Î¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¡¢ +(¥Ý¡¼¥Èñ°Ì¤Ë) ÀìÍѤÎÅý·×¥Õ¥¡¥¤¥ë¤¬¥Õ¥©¥ë¥À +.I /proc/net/sk98lin +¤Ëºî¤é¤ì¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï +.I eth[x] +¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤ê¡¢ +.I x +¤Ï¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÎÈÖ¹æ¤Ç¤¢¤ë¡£ +¤³¤ÎÈÖ¹æ¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¥Ý¡¼¥ÈËè¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +¥í¡¼¥É¤¬´°Î»¤¹¤ë¤È¡¢ +.BR ifconfig (8) +¥³¥Þ¥ó¥É¤ò»È¤Ã¤Æ¡¢³Æ +.I eth[x] +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë´õ˾¤¹¤ë IP ¥¢¥É¥ì¥¹¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤è¤ê¥¢¥À¥×¥¿¤¬¥¤¡¼¥µ¥Í¥Ã¥È¤ËÀܳ¤µ¤ì¡¢ +¥³¥ó¥½¡¼¥ë¤Ë¾õÂÖ¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤ë¡£ +¤³¤Î¥á¥Ã¥»¡¼¥¸¤Ç¤Ï¡¢ +"ethx: network connection up using port y" ¤Î¸å¤Ë +ÀßÄꤵ¤ì¤¿¤ê¸¡½Ð¤µ¤ì¤¿Àܳ¥Ñ¥é¥á¡¼¥¿¤¬É½¼¨¤µ¤ì¤ë¡£ + +.B sk98lin +¤Ï¥é¡¼¥¸¥Õ¥ì¡¼¥à (¥¸¥ã¥ó¥Ü¥Õ¥ì¡¼¥à¤È¤â¸Æ¤Ð¤ì¤ë) ¤â¥µ¥Ý¡¼¥È¤¹¤ë¡£ +¥¸¥ã¥ó¥Ü¥Õ¥ì¡¼¥à¤ò»È¤¦¤È¡¢ÂçÎ̤Υǡ¼¥¿¤òžÁ÷¤¹¤ëºÝ¤Ë¡¢ +¥¹¥ë¡¼¥×¥Ã¥È¤òÂçÉý¤Ë¸þ¾å¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥é¡¼¥¸¥Õ¥ì¡¼¥à¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢ +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î MTU (maximum transfer unit, ºÇÂçžÁ÷ñ°Ì) ¥µ¥¤¥º¤ò +Â礭¤ÊÃͤËÀßÄꤹ¤ì¤Ð¤è¤¤¡£ +¥Ç¥Õ¥©¥ë¥È¤Î MTU ¥µ¥¤¥º¤Ï 1500 ¤Ç¤¢¤ê¡¢ +ºÇÂç¤Ç 9000 (¥Ð¥¤¥È) ¤Þ¤ÇÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +MTU ¥µ¥¤¥º¤òÀßÄꤹ¤ë¤Î¤Ï¡¢ +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë IP ¥¢¥É¥ì¥¹¤ò³ä¤êÅö¤Æ¤ë¤È¤­¤Ë¤â¤Ç¤­¤ë¤·¡¢¸å¤«¤é +.BR ifconfig (8) +¥³¥Þ¥ó¥É¤Ë mtu °ú¤­¿ô¤ò»ØÄꤹ¤ë¤³¤È¤ÇÀßÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +Î㤨¤Ð¡¢eth0 ¤Ë IP ¥¢¥É¥ì¥¹¤È¥é¡¼¥¸¥Õ¥ì¡¼¥à MTU ¥µ¥¤¥º¤ò +³ä¤êÅö¤Æ¤¿¤¤¾ì¹ç¡¢°Ê²¼¤Î 2 ¤Ä¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ì¤Ð¤è¤¤: + + ifconfig eth0 10.1.1.1 + ifconfig eth0 mtu 9000 + +¤³¤ì¤é¤Î 2 ¤Ä¤Î¥³¥Þ¥ó¥É¤Ï 1 ¤Ä¤Ë¤Þ¤È¤á¤ë¤³¤È¤â¤Ç¤­¤ë: + + ifconfig eth0 10.1.1.1 mtu 9000 + +¥é¡¼¥¸¥Õ¥ì¡¼¥à¤ò»ÈÍѤǤ­¤ë¤Î¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯´Ä¶­Á´ÂÎ¤Ç +¥é¡¼¥¸¥Õ¥ì¡¼¥à¤Î»ÈÍѤ¬Ç§¤á¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ß¤Ç¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤Ä¤Þ¤ê¡¢¥¤¡¼¥µ¥Í¥Ã¥È¤Ç»È¤ï¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥¹¥¤¥Ã¥Á¤Ç¤â +¥é¡¼¥¸¥Õ¥ì¡¼¥à¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¿¤¯¤Î¥¹¥¤¥Ã¥Á¤¬¥é¡¼¥¸¥Õ¥ì¡¼¥à¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤Ï¤¤¤ë¤¬¡¢ +ÀßÄê¤ò¹Ô¤¦É¬Íפ¬¤¢¤ë¡£ +¿¤¯¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¤Ç¤Ïɸ½à¥Õ¥ì¡¼¥à +(1500 ¥Ð¥¤¥È¤Î MTU ¥µ¥¤¥º) ¤À¤±¤·¤«¥µ¥Ý¡¼¥È¤·¤Ê¤¤¡£ +¥Í¥Ã¥È¥ï¡¼¥¯Æâ¤Î¥¹¥¤¥Ã¥Á¤Ë²Ã¤¨¡¢ +»ÈÍѤµ¤ì¤ëÁ´¤Æ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥À¥×¥¿¤Ç¤â +¥¸¥ã¥ó¥Ü¥Õ¥ì¡¼¥à¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥¢¥À¥×¥¿¤¬¥é¡¼¥¸¥Õ¥ì¡¼¥à¤ò¼õ¤±¼è¤ë¤è¤¦¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¥¢¥À¥×¥¿¤Ï¤½¤Î¥Õ¥ì¡¼¥à¤òñ½ã¤Ë¼Î¤Æ¤Æ¤·¤Þ¤¦¡£ + +ɸ½à¤Î¥¤¡¼¥µ¥Í¥Ã¥È¥Õ¥ì¡¼¥à¥µ¥¤¥º¤ËÌ᤹¤Î¤Ï¡¢ºÆ¤Ó +.BR ifconfig (8) +¥³¥Þ¥ó¥É¤ò»È¤¨¤Ð¤è¤¤: + + ifconfig eth0 mtu 1500 + +Linux ¤Î Marvell/SysKonnect ¥®¥¬¥Ó¥Ã¥È¥¤¡¼¥µ¥Í¥Ã¥È¥É¥é¥¤¥Ð¤Ï¡¢ +IEEE µ¬³Ê 802.1, 802.1q, 802.3ad ¤Ë½àµò¤¹¤ë +VLAN ¤È Link Aggregation ¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Îµ¡Ç½¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ë¤¢¤ë¥ª¡¼¥×¥ó¥½¡¼¥¹¥â¥¸¥å¡¼¥ë¤ò +¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¸å¤Ç¤Î¤ßÍøÍѲÄǽ¤Ç¤¢¤ë: + +.IR VLAN \c +: http://www.candelatech.com/~greear/vlan.html +.br +.I Link +.IR Aggregation \c +: http://www.st.rim.or.jp/~yumo + +.br +Marvell/SysKonnect ¤Ï¡¢¤³¤ì¤é¤Î¥ª¡¼¥×¥ó¥½¡¼¥¹¥â¥¸¥å¡¼¥ë¤ËÂФ¹¤ë¥µ¥Ý¡¼¥È¤Ï +¹Ô¤Ã¤Æ¤ª¤é¤º¡¢¤³¤ì¤é¤ò»È¤Ã¤¿¾ì¹ç¤ËÀ¸¤¸¤ë¤¤¤«¤Ê¤ë¼ºÇÔ¤äÌäÂê¤Ë¤Ä¤¤¤Æ¤â +ÀÕǤ¤òÉé¤ï¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SS °ú¤­¿ô +.TP +.BI Speed_A= i,j,... +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È A ¤¬¥µ¥Ý¡¼¥È¤¹¤ë¥ê¥ó¥¯Â®ÅÙ¤ò +ÀßÄꤹ¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£¤³¤ì¤Ï Yukon copper ¥¢¥À¥×¥¿¤Ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.IR 10 , +.IR 100 , +.IR 1000 , +.IR Auto ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I Auto +¤Ç¤¢¤ë¡£ +Ä̾¥ê¥ó¥¯Â®Å٤ϥê¥ó¥¯¤Î³ÎΩ»þ¤Ë 2 ¤Ä¤Î¥Ý¡¼¥È¤Î´Ö¤Ç¼«Æ°ÀßÄꤵ¤ì¤ë¡£ +¤³¤ì¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢¥Ý¡¼¥È¤Ï¤³¤Î°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿ÀßÄê¤Ë¤Ê¤ë¡£ +.TP +.BI Speed_B= i,j,... +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È B ¤¬¥µ¥Ý¡¼¥È¤¹¤ë¥ê¥ó¥¯Â®ÅÙ¤ò +ÀßÄꤹ¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£¤³¤ì¤Ï Yukon copper ¥¢¥À¥×¥¿¤Ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.IR 10 , +.IR 100 , +.IR 1000 , +.IR Auto ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I Auto +¤Ç¤¢¤ë¡£ +Ä̾¥ê¥ó¥¯Â®Å٤ϥê¥ó¥¯¤Î³ÎΩ»þ¤Ë 2 ¤Ä¤Î¥Ý¡¼¥È¤Î´Ö¤Ç¼«Æ°ÀßÄꤵ¤ì¤ë¡£ +¤³¤ì¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢¥Ý¡¼¥È¤Ï¤³¤Î°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿ÀßÄê¤Ë¤Ê¤ë¡£ +.TP +.BI AutoNeg_A= i,j,... +¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È A ¤Î¼«Æ°ÀßÄê (autonegotiation) ¤Î»ÈÍѤò +Í­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.IR On , +.IR Off , +.IR Sense ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I On +¤Ç¤¢¤ë¡£ +.I Sense +¥â¡¼¥É¤Ï¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤¬¼«Æ°ÀßÄê¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«Èݤ«¤ò +¼«Æ°Åª¤Ë¸¡ÃΤ¹¤ë¡£ +.TP +.BI AutoNeg_B= i,j,... +¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È B ¤Î¼«Æ°ÀßÄê (autonegotiation) ¤Î»ÈÍѤò +Í­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.IR On , +.IR Off , +.IR Sense ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I On +¤Ç¤¢¤ë¡£ +.I Sense +¥â¡¼¥É¤Ï¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤¬¼«Æ°ÀßÄê¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«Èݤ«¤ò +¼«Æ°Åª¤Ë¸¡ÃΤ¹¤ë¡£ +.TP +.BI DupCap_A= i,j,... +¤³¤Î°ú¤­¿ô¤Ï¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È A ¤Ç»È¤¦Æó½ÅÄÌ¿® (duplex) ¥â¡¼¥É¤ò¼¨¤¹¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.IR Half , +.IR Full , +.IR Both ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I Both +¤Ç¤¢¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ï¥Ý¡¼¥È A ¤Î AutoNeg_A ¤¬ +.I Sense +¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +AutoNeg_A ¤¬ +.I On +¤Î¾ì¹ç¡¢DupCap_A ¤Î 3 ¤Ä¤ÎÃÍ +.RI ( Half , +.IR Full , +.IR Both ) +¤Î¤¦¤Á¤É¤ì¤Ç¤â»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +AutoNeg_A ¤¬ +.I Off +¤Î¾ì¹ç¡¢DupCap_A ¤ÎÃÍ +.I Full +¤È +.I Half +¤Î¤ß¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î DupCap_A °ú¤­¿ô¤Ï¡¢¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤¬Á´¤Æ¤ÎÆó½ÅÄÌ¿®¤ÎÁȤ߹ç¤ï¤»¤ò +¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤ËÌò¤ËΩ¤Ä¡£ +.TP +.BI DupCap_B= i,j,... +¤³¤Î°ú¤­¿ô¤Ï¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È B ¤Ç»È¤¦Æó½ÅÄÌ¿®¥â¡¼¥É¤ò¼¨¤¹¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.IR Half , +.IR Full , +.IR Both ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I Both +¤Ç¤¢¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ï¥Ý¡¼¥È B ¤Î AutoNeg_B ¤¬ +.I Sense +¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +AutoNeg_B ¤¬ +.I On +¤Î¾ì¹ç¡¢DupCap_B ¤Î 3 ¤Ä¤ÎÃÍ +.RI ( Half , +.IR Full , +.IR Both ) +¤Î¤¦¤Á¤É¤ì¤Ç¤â»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +AutoNeg_B ¤¬ +.I Off +¤Î¾ì¹ç¡¢DupCap_B ¤ÎÃÍ +.I Full +¤È +.I Half +¤Î¤ß¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î DupCap_B °ú¤­¿ô¤Ï¡¢¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤¬Á´¤Æ¤ÎÆó½ÅÄÌ¿®¤ÎÁȤ߹ç¤ï¤»¤ò +¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤ËÌò¤ËΩ¤Ä¡£ +.TP +.BI FlowCtrl_A= i,j,... +¤³¤Î°ú¤­¿ô¤Ï¼«Æ°ÀßÄê»þ¤Ë¥Ý¡¼¥È¤¬Âиþ¤ËÅÁ¤¨¤ë +¥Õ¥í¡¼À©¸æµ¡Ç½¤òÀßÄꤹ¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.IR Sym , +.IR SymOrRem , +.IR LocSend , +.IR None ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I SymOrRem +¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥â¡¼¥É¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê°ÕÌ£¤¬¤¢¤ë: + +.br +.I Sym += Symmetric + ¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤ÎÁÐÊý¤¬ PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.I SymOrRem += SymmetricOrRemote + ¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤ÎÁÐÊý¤Þ¤¿¤Ï¥ê¥â¡¼¥È¥Ñ¡¼¥È¥Ê¤Î¤ß¤¬ +PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.I LocSend += LocalSend + ¥í¡¼¥«¥ë¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤Î¤ß¤¬ PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.I None += None + ¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤Î¤É¤Á¤é¤â PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ + +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï AutoNeg_A ¤¬ +.I Off +¤Î¾ì¹ç¤Ë¤Ï̵»ë¤µ¤ì¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.TP +.BI FlowCtrl_B= i,j,... +¤³¤Î°ú¤­¿ô¤Ï¼«Æ°ÀßÄê»þ¤Ë¥Ý¡¼¥È¤¬Âиþ¤ËÅÁ¤¨¤ë +¥Õ¥í¡¼À©¸æµ¡Ç½¤òÀßÄꤹ¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.IR Sym , +.IR SymOrRem , +.IR LocSend , +.IR None ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I SymOrRem +¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥â¡¼¥É¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê°ÕÌ£¤¬¤¢¤ë: + +.I Sym += Symmetric + ¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤ÎÁÐÊý¤¬ PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.I SymOrRem += SymmetricOrRemote + ¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤ÎÁÐÊý¤Þ¤¿¤Ï¥ê¥â¡¼¥È¥Ñ¡¼¥È¥Ê¤Î¤ß¤¬ +PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.I LocSend += LocalSend + ¥í¡¼¥«¥ë¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤Î¤ß¤¬ PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.br +.I None += None + ¥ê¥ó¥¯¥Ñ¡¼¥È¥Ê¤Î¤É¤Á¤é¤â PAUSE ¥Õ¥ì¡¼¥à¤òÁ÷¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.br + +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï AutoNeg_B ¤¬ +.I Off +¤Î¾ì¹ç¤Ë¤Ï̵»ë¤µ¤ì¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.TP +.BI Role_A= i,j,... +¤³¤Î°ú¤­¿ô¤Ï 1000Base-T ¥¢¥À¥×¥¿¥«¡¼¥É¤Ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +2 ¤Ä¤Î 1000Base-T ¥Ý¡¼¥È¤¬ÄÌ¿®¤¹¤ë¾ì¹ç¡¢ +ÊÒÊý¤¬ (¥¿¥¤¥ß¥ó¥°¾ðÊó¤òÄ󶡤¹¤ë) ¥Þ¥¹¥¿¤ÎÌò³ä¤ò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤â¤¦ÊÒÊý¤¬¥¹¥ì¡¼¥Ö¤Ë¤Ê¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.IR Auto , +.IR Master , +.IR Slave ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I Auto +¤Ç¤¢¤ë¡£ +Ä̾¥Ý¡¼¥È¤ÎÌò³ä¤Ï 2 ¤Ä¤Î¥Ý¡¼¥È¤Ç¥ê¥ó¥¯¤ò³ÎΩ¤¹¤ë¤È¤­¤Ë¼«Æ°ÀßÄꤵ¤ì¤ë¡£ +¼«Æ°ÀßÄê¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È A ¤Ï¤³¤Î°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿ÀßÄê¤Ë¤Ê¤ë¡£ +.TP +.BI Role_B= i,j,... +¤³¤Î°ú¤­¿ô¤Ï 1000Base-T ¥¢¥À¥×¥¿¥«¡¼¥É¤Ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +2 ¤Ä¤Î 1000Base-T ¥Ý¡¼¥È¤¬ÄÌ¿®¤¹¤ë¾ì¹ç¡¢ +ÊÒÊý¤¬ (¥¿¥¤¥ß¥ó¥°¾ðÊó¤òÄ󶡤¹¤ë) ¥Þ¥¹¥¿¤ÎÌò³ä¤ò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤â¤¦ÊÒÊý¤¬¥¹¥ì¡¼¥Ö¤Ë¤Ê¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.IR Auto , +.IR Master , +.IR Slave ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I Auto +¤Ç¤¢¤ë¡£ +Ä̾¥Ý¡¼¥È¤ÎÌò³ä¤Ï 2 ¤Ä¤Î¥Ý¡¼¥È¤Ç¥ê¥ó¥¯¤ò³ÎΩ¤¹¤ë¤È¤­¤Ë¼«Æ°ÀßÄꤵ¤ì¤ë¡£ +¼«Æ°ÀßÄê¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢ +¥¢¥À¥×¥¿¥«¡¼¥É¤Î¥Ý¡¼¥È B ¤Ï¤³¤Î°ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿ÀßÄê¤Ë¤Ê¤ë¡£ +.TP +.BI ConType= i,j,... +¤³¤Î°ú¤­¿ô¤Ï¡¢¥Ý¡¼¥ÈËè¤Ë»ØÄꤹ¤ë¡¢Á´Éô¤Ç 5 ¸Ä¤Î°ú¤­¿ô¤ÎÁȤ߹ç¤ï¤»¤ò¡¢ +1 ¤Ä¤Î°ú¤­¿ô¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë¤è¤ê¥¢¥À¥×¥¿¥«¡¼¥É¤Î 2 ¤Ä¤Î¥Ý¡¼¥È¤ÎÀßÄê¤ò´Êά²½¤Ç¤­¤ë¡£ +¤³¤ÎÊÑ¿ô¤Î¤½¤ì¤¾¤ì¤ÎÃͤϡ¢ +¥Ý¡¼¥È°ú¤­¿ô¤ÎºÇ¤â°ÕÌ£¤Î¤¢¤ëÁȤ߹ç¤ï¤»¤òÈ¿±Ç¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤȤ½¤ì¤ËÂбþ¤¹¤ë¥Ý¡¼¥ÈËè¤Î¥Ñ¥é¥á¡¼¥¿¤ÎÁȤ߹ç¤ï¤»¤Ï¡¢ +°Ê²¼¤ÎÄ̤ê: + +.nf +ConType | DupCap AutoNeg FlowCtrl Role Speed +--------+------------------------------------------- +\fIAuto\fP | Both On SymOrRem Auto Auto +.br +\fI100FD\fP | Full Off None Auto 100 +.br +\fI100HD\fP | Half Off None Auto 100 +.br +\fI10FD\fP | Full Off None Auto 10 +.br +\fI10HD\fP | Half Off None Auto 10 + +.fi +¤½¤Î¾¤Î¥Ý¡¼¥È°ú¤­¿ô¤ò +.I ConType +°ú¤­¿ô¤ÈÁȤ߹ç¤ï¤»¤Æ»ØÄꤹ¤ë¤È¡¢¤½¤ì¤é¤ÎÀßÄê¤ò·ë¹ç¤·¤¿ÀßÄê¤È¤Ê¤ë¡£ +¤³¤ì¤Ï¡¢¥Ý¡¼¥ÈËè¤Î°ú¤­¿ô (Î㤨¤Ð +.IR Speed_A ) +¤ÎÊý¤¬ÁȤ߹ç¤ï¤»ÊÑ¿ô +.I ConType +¤è¤êÍ¥Àè½ç°Ì¤¬¹â¤¤¤¿¤á¤Ç¤¢¤ë¡£ +.TP +.BI Moderation= i,j,... +³ä¤ê¹þ¤ßÄ´Ää (interrupt moderation) ¤Ï¡¢¥É¥é¥¤¥Ð¤¬½èÍý¤ò³«»Ï¤·¤Ê¤±¤ì¤Ð +¤Ê¤é¤Ê¤¤³ä¤ê¹þ¤ß²ó¿ô¤ÎºÇÂçÃͤòÀßÄꤹ¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤Ä¤Þ¤ê¡¢¥É¥é¥¤¥Ð¤¬½èÍý¤ò¹Ô¤¦¤Þ¤Ç¡¢1²ó°Ê¾å¤Î³ä¤ê¹þ¤ß +(Á÷¿®¤Þ¤¿¤Ï¼õ¿®¥Ñ¥±¥Ã¥È¤¬½èÍý¤µ¤ì¤ë¤³¤È) ¤¬¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¡£ +¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤¿³ä¤ê¹þ¤ß¤¬¤¤¤Ä½èÍý¤µ¤ì¤ë¤«¤Ï¡¢ +°Ê²¼¤ÇÀâÌÀ¤¹¤ë +.I IntsPerSec +°ú¤­¿ô¤Ç·èÄꤵ¤ì¤ë¡£ +»ÈÍѲÄǽ¤ÊÄ´Ää¥â¡¼¥É¤Ï°Ê²¼¤ÎÄ̤ê: +.IR None , +.IR Static , +.IR Dynamic ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I None +¤Ç¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥â¡¼¥É¤Ï°Ê²¼¤Î°ÕÌ£¤ò»ý¤Ä: + +.I None +¥¢¥À¥×¥¿¥«¡¼¥É¤ËÂФ·¤Æ³ä¤ê¹þ¤ßÄ´Ää¤òŬÍѤ·¤Ê¤¤¡£ +¤è¤Ã¤ÆÁ÷¿®¤Þ¤¿¤Ï¼õ¿®³ä¤ê¹þ¤ß¤Ï¡¢ +¥¢¥À¥×¥¿¥«¡¼¥É¤Î³ä¤ê¹þ¤ßÀþ¤Ë¸½¤ì¤ë¤Èľ¤°¤Ë½èÍý¤µ¤ì¤ë¡£ + +.br +.I Static +¥¢¥À¥×¥¿¥«¡¼¥É¤ËÂФ·¤Æ³ä¤ê¹þ¤ßÄ´Ä䤬ŬÍѤµ¤ì¤ë¡£ +Á´¤Æ¤ÎÁ÷¿®¤Þ¤¿¤Ï¼õ¿®³ä¤ê¹þ¤ß¤Ï¡¢Ä´Ää´Ö³Ö¤¬´°Á´¤Ë½ª¤ï¤ë¤Þ¤Ç +¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¡£ +¤³¤ÎÄ´Ää´Ö³Ö¤¬½ª¤ï¤ë¤È¡¢¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤¿Á´¤Æ¤Î³ä¤ê¹þ¤ß¤Ï¡¢ +1¸Ä¤ÎÂ礭¤Ê²ô¤È¤·¤ÆÃÙ±ä¤Ê¤¯½èÍý¤µ¤ì¤ë¡£ +.I Static +¤È¤¤¤¦ÍѸì¤Ï¡¢¤¢¤ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë¸½ºß¤É¤ì¤À¤±¤Î +¥Í¥Ã¥È¥ï¡¼¥¯Éé²Ù¤¬¤«¤«¤Ã¤Æ¤¤¤ë¤«¤Ë´Ø¤ï¤é¤º¡¢ +³ä¤ê¹þ¤ßÄ´Ä䤬¾ï¤ËÍ­¸ú¤Ë¤Ê¤ë¤³¤È¤òɽ¤·¤Æ¤¤¤ë¡£ +¤µ¤é¤Ë¡¢Ä´Ää´Ö³Ö¤Î»þ´Ö¤Ï¸ÇÄê¤Ç¡¢¥É¥é¥¤¥Ð¤¬Æ°ºî¤·¤Æ¤¤¤ë´Ö¤ÏÊѲ½¤·¤Ê¤¤¡£ + +.br +.I Dynamic +¥·¥¹¥Æ¥à¤ÎÉé²Ù¤Ë±þ¤¸¤Æ¡¢¥¢¥À¥×¥¿¥«¡¼¥É¤ËÂФ·¤Æ³ä¤ê¹þ¤ßÄ´Ä䤬ŬÍѤµ¤ì¤ë¡£ +¥É¥é¥¤¥Ð¤¬¥·¥¹¥Æ¥à¤ÎÉé²Ù¤¬¹â¤¹¤®¤ë¤È¸¡½Ð¤·¤¿¾ì¹ç¡¢ +³ä¤ê¹þ¤ßÄ´Ää¤òÍ­¸ú¤Ë¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢ +²á¾ê¤Ê¥Í¥Ã¥È¥ï¡¼¥¯Éé²Ù¤«¤é¥·¥¹¥Æ¥à¤òÊݸ¤è¤¦¤È¤¹¤ë¡£ +\(em ¤½¤Î¸å¤Ë \(em CPU ÍøÍÑΨ¤¬ºÆ¤Ó²¼¤¬¤Ã¤¿¾ì¹ç +(¤Þ¤¿¤Ï¥Í¥Ã¥È¥ï¡¼¥¯Éé²Ù¤¬¶Ë¤ï¤º¤«¤Ë¤Ê¤Ã¤¿¾ì¹ç)¡¢ +³ä¤ê¹þ¤ßÄ´Ää¤Ï¼«Æ°Åª¤Ë̵¸ú¤Ë¤µ¤ì¤ë¡£ + +¥É¥é¥¤¥Ð¤¬°·¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¤¦¤Á +¥Í¥Ã¥È¥ï¡¼¥¯Éé²Ù¤¬¹â¤¤¤â¤Î¤¬ 1 ¤Ä°Ê¾å¤¢¤ê¡¢ +\(em ¤½¤Î·ë²Ì \(em CPU ÍøÍÑΨ¤¬¹â¤¯¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +³ä¤ê¹þ¤ßÄ´Ää¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +¥Í¥Ã¥È¥ï¡¼¥¯Éé²Ù¤¬¹â¤¤¾õ¶·¤ÇÄ´Ä䤬ŬÍѤµ¤ì¤ë¤È¡¢ +ÃÙ¤¤¥³¥ó¥Ô¥å¡¼¥¿¤Ç¤Ï CPU Éé²Ù¤¬ 20-30% ºï¸º¤µ¤ì¤ë¤À¤í¤¦¡£ + +³ä¤ê¹þ¤ßÄ´Ää¤ò»È¤¦¤³¤È¤Î·çÅÀ¤È¤·¤Æ¡¢ +±ýÉüÃÙ±ä»þ´Ö (round-trip-time, RTT) ¤ÎÁý²Ã¤¬¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤³¤ì¤Ï¡¢³ä¤ê¹þ¤ß¤¬¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¡¢¤Þ¤È¤á¤Æ½èÍý¤µ¤ì¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.TP +.BI IntsPerSec= i,j,... +¤³¤Î°ú¤­¿ô¤Ï³ä¤ê¹þ¤ßÄ´Ää¤Î´Ö³Ö¤ò·èÄꤹ¤ë¡£ +ÀÅŪ (static) ³ä¤ê¹þ¤ßÄ´Ä䤬»È¤ï¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.I IntsPerSec +°ú¤­¿ô¤ÎÃͤ¬ 2000 ¤Ç¤¢¤ì¤Ð¡¢³ä¤ê¹þ¤ßÄ´Ää¤Î´Ö³Ö¤Ï 500 ¥ß¥êÉäˤʤ롣 +¤³¤Î°ú¤­¿ô¤ËÀßÄê²Äǽ¤ÊÃÍ¤Ï 30...40000 ¤ÎÈϰϤǡ¢ +¤³¤ì¤Ï 1 ÉÃËè¤Î³ä¤ê¹þ¤ß²ó¿ô¤Ç¤¢¤ë¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 2000 ¤Ç¤¢¤ë¡£ + +¤³¤Î°ú¤­¿ô¤ÏÀÅŪ (static) ¤Þ¤¿¤ÏưŪ (dynamic) ³ä¤ê¹þ¤ßÄ´Ä䤬 +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¤­¤Ë¤Î¤ß»ÈÍѤµ¤ì¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ï³ä¤ê¹þ¤ßÄ´Ä䤬ŬÍѤµ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï̵»ë¤µ¤ì¤ë¡£ + +Ä´Ää´Ö³Ö¤Î´ü´Ö¤ÏÃí°Õ¤·¤ÆÁª¤Ö¤³¤È¡£ +°ì¸«¤·¤¿¤È¤³¤í¤Ç¤Ï¡¢¤È¤Æ¤âŤ¤´ü´Ö (Î㤨¤Ð 1 ÉÃ´Ö¤Ë 100 ²ó¤À¤±¤Î³ä¤ê¹þ¤ß) ¤ò +Áª¤Ö¤³¤È¤Ë°ÕÌ£¤¬¤¢¤ë¤è¤¦¤Ë¸«¤¨¤ë¤«¤â¤·¤ì¤Ê¤¤¤¬¡¢¤½¤¦¤¹¤ë¤È +¥Ñ¥±¥Ã¥È½èÍý¤ÎÃٱ䤬·ã¤·¤¯Áý²Ã¤¹¤ë¡£ +°ìÊý¤Ç¡¢¤È¤Æ¤âû¤¤Ä´Ää»þ´Ö¤òÁª¤Ö¤È¡¢³ä¤ê¹þ¤ßÄ´Ää¤ò»È¤¦°ÕÌ£¤¬¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¡£ +.TP +.BI PrefPort= i,j,... +¤³¤Î°ú¤­¿ô¤Ï (2 ¥Ý¡¼¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥À¥×¥¿¤Ç) +Í¥Àè (preferred) ¥Ý¡¼¥È¤ò A ¤Þ¤¿¤Ï B ¤Î¤É¤Á¤é¤Ë¤¹¤ë¤«¤ò»ØÄꤹ¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£ +Í¥Àè¥Ý¡¼¥È¤È¤Ï¡¢A ¤È B ¤ÎξÊý¤Î¥Ý¡¼¥È¤¬´°Á´¤Ëµ¡Ç½¤·¤Æ¤¤¤ë¤È¸¡ÃΤµ¤ì¤¿¾ì¹ç¤Ë +»ÈÍѤµ¤ì¤ë¥Ý¡¼¥È¤Ç¤¢¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.I A +¤Þ¤¿¤Ï +.IR B ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I A +¤Ç¤¢¤ë¡£ +.TP +.BI RlmtMode= i,j,... +RLMT ¤Ï¥Ý¡¼¥È¤Î¾õÂÖ¤ò´Æ»ë¤¹¤ë¡£ +¥¢¥¯¥Æ¥£¥Ö¤Ê¥Ý¡¼¥È¤Î¥ê¥ó¥¯¤¬Íî¤Á¤¿¾ì¹ç¡¢ +RLMT ¤Ï¨»þ¤ËÂÔµ¡¤·¤Æ¤¤¤ë¥ê¥ó¥¯¤ËÀÚ¤êÂؤ¨¤ë¡£ +¾¯¤Ê¤¯¤È¤â 1 ¤Ä¤Î¡ÖʪÍýŪ¡×¥ê¥ó¥¯¤¬µ¯Æ°¤¹¤ë¤Þ¤Ç¤Ï¡¢²¾ÁÛ¥ê¥ó¥¯¤¬°Ý»ý¤µ¤ì¤ë¡£ +¤³¤Î°ú¤­¿ô¤Ï RLMT ¤¬Î¾Êý¤Î¥Ý¡¼¥È¤ò¤É¤Î¤è¤¦¤Ë´Æ»ë¤¹¤ë¤«¤ò·è¤á¤ë¡£ +»ÈÍѲÄǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ê: +.IR CheckLinkState , +.IR CheckLocalPort , +.IR CheckSeg , +.IR DualNet ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.I CheckLinkState +¤Ç¤¢¤ë¡£ +³Æ¥â¡¼¥É¤Ï°Ê²¼¤Î¤è¤¦¤Ê°ÕÌ£¤ò»ý¤Ä¡£ + +.I CheckLinkState +¥ê¥ó¥¯¾õÂ֤ΥÁ¥§¥Ã¥¯¤Î¤ß: +RLMT ¤Ï¡¢³Æ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¥¢¥À¥×¥¿¥Ï¡¼¥É¥¦¥§¥¢¤¬Êó¹ð¤¹¤ë¥ê¥ó¥¯¾õÂÖ¤ò»È¤¤¡¢ +¤½¤Î¥Ý¡¼¥È¤¬Á´¤Æ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥È¥é¥Õ¥£¥Ã¥¯¤òÁ÷¼õ¿®¤¹¤ë¤Î¤Ë»ÈÍѲÄǽ¤«¤ò +·èÄꤹ¤ë¡£ + +.br +.I CheckLocalPort +¤³¤Î¥â¡¼¥É¤Ç¤Ï¡¢RLMT ¤Ï¥¢¥À¥×¥¿¥«¡¼¥É¤Î 2 ¤Ä¤Î¥Ý¡¼¥È¤Î´Ö¤Ç +Äê´üŪ¤Ë¥Ñ¥±¥Ã¥È¤ò¸ò´¹¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢ +2 ¤Ä¤Î¥Ý¡¼¥È¤Î´Ö¤Î¥Í¥Ã¥È¥ï¡¼¥¯·ÐÏ©¤ò´Æ»ë¤¹¤ë¡£ +¤³¤Î¥â¡¼¥É¤Ç¤Ï 2 ¤Ä¤Î¥Ý¡¼¥È¤¬¸ß¤¤¤Ë¡Ö¸«¤¨¤ë¡×¤è¤¦¤Ê +¥Í¥Ã¥È¥ï¡¼¥¯ÀßÄ꤬ɬÍפǤ¢¤ë +(¤Ä¤Þ¤ê¡¢¥Ý¡¼¥È´Ö¤Ë¥ë¡¼¥¿¤¬¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤)¡£ + +.br +.I CheckSeg +¥í¡¼¥«¥ë¥Ý¡¼¥È¤È¥»¥°¥á¥ó¥È¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +¤³¤Î¥â¡¼¥É¤Ï CheckLocalPort ¥â¡¼¥É¤ÈƱ¤¸µ¡Ç½¤òÄ󶡤·¡¢ +¹¹¤Ë¥Ý¡¼¥È´Ö¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥»¥°¥á¥ó¥È¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +¤è¤Ã¤Æ¡¢¤³¤Î¥â¡¼¥É¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Ë +¥¹¥Ñ¥Ë¥ó¥°¥Ä¥ê¡¼¥×¥í¥È¥³¥ë (Spanning Tree protocol) ¤ò +»È¤¦¤è¤¦¤ËÀßÄꤵ¤ì¤¿¥®¥¬¥Ó¥Ã¥È¥¤¡¼¥µ¥Í¥Ã¥È¥¹¥¤¥Ã¥Á¤¬ +ÀßÃÖ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ß»ÈÍѤǤ­¤ë¡£ + +.br +.I DualNet +¤³¤Î¥â¡¼¥É¤Ç¤Ï¡¢¥Ý¡¼¥È A ¤È B ¤¬ÊÌ¡¹¤Î¥Ç¥Ð¥¤¥¹¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +2 ¥Ý¡¼¥È¤Î¥¢¥À¥×¥¿¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢¥Ý¡¼¥È A ¤ò +.I eth[x] +¤Ë¡¢¥Ý¡¼¥È B ¤ò +.I eth[x+1] +¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +2 ¤Ä¤Î¥Ý¡¼¥È¤ÏÊÌ¡¹¤Î IP ¥¢¥É¥ì¥¹¤òÉÕ¤±¤ÆÆÈΩ¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Í¥Àè¥Ý¡¼¥È¤ÎÀßÄê¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£ +RLMT ¤Ï̵¸ú¤Ë¤µ¤ì¤ë¡£ + +RLMT ¥â¡¼¥É +.I CheckLocalPort +¤È +.I CheckLinkState +¤Ï¡¢1 ¤Ä¤Î¥¢¥À¥×¥¿¾å¤Î¥Ý¡¼¥È´Ö¤Ç¥Í¥Ã¥È¥ï¡¼¥¯·ÐÏ©¤¬¤¢¤ë¤è¤¦¤ÊÀßÄê¤Ç +Æ°ºî¤¹¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +¤µ¤é¤Ë¡¢¤³¤Î¥â¡¼¥É¤Ï¥¢¥À¥×¥¿Æ±»Î¤¬Ä¾·ë (back-to-back) ¤Ç +Àܳ¤µ¤ì¤Æ¤¤¤ë¾õÂÖ¤ÇÆ°ºî¤¹¤ë¤è¤¦¤Ë¤ÏÀ߷פµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /proc/net/sk98lin/eth[x] +.br +¥¢¥À¥×¥¿¥«¡¼¥É¤ÎÆÃÄê¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÎÅý·×¥Õ¥¡¥¤¥ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¥¢¥À¥×¥¿¥«¡¼¥É¤Î°ìÈÌŪ¤Ê¾ðÊó¤È¡¢ +Á´¤Æ¤ÎÁ÷¿®¡¦¼õ¿®¥«¥¦¥ó¥¿¤Î¾ÜºÙ¤Ê°ìÍ÷¤¬´Þ¤Þ¤ì¤ë¡£ +.TP +.I /usr/src/linux/Documentation/networking/sk98lin.txt +.br +.I sk98lin +¥É¥é¥¤¥Ð¤Î +.I README +¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë¤Ï¾ÜºÙ¤Ê¥¤¥ó¥¹¥È¡¼¥ë HOWTO ¤¬´Þ¤Þ¤ì¤Æ¤ª¤ê¡¢ +¥É¥é¥¤¥Ð¤ÎÁ´¤Æ¤Î°ú¤­¿ô¤¬µ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +¤Þ¤¿°ìÈÌŪ¤ÊÌäÂê¤È¤½¤Î²ò·èË¡¤Ë¤Ä¤¤¤Æ¤â½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.SH ¥Ð¥° +¥Ð¥°¤Ï linux@syskonnect.de ¤ËÊó¹ð¤·¤Æ¤Û¤·¤¤¡£ +.\" .SH Ãø¼Ô +.\" Ralph Roesler \(em rroesler@syskonnect.de +.\" .br +.\" Mirko Lindner \(em mlindner@syskonnect.de +.SH ´ØÏ¢¹àÌÜ +.BR insmod (8), +.BR ifconfig (8), +.BR modprobe (8) diff --git a/release/man4/st.4 b/release/man4/st.4 new file mode 100644 index 00000000..bc71a86b --- /dev/null +++ b/release/man4/st.4 @@ -0,0 +1,916 @@ +.\" Copyright 1995 Robert K. Nichols (Robert.K.Nichols@att.com) +.\" Copyright 1999-2005 Kai M¥Æ¡¢kisara (Kai.Makisara@kolumbus.fi) +.\" +.\" 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 Last Modified Tue Feb 10 15:09:29 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated Sun Mar 12 2000 by NAKANO Takeo +.\" Updated Sun Apr 24 2005 by NAKANO Takeo +.sp +.BI "int ioctl(int " fd ", int " request " [, (void *)" arg3 "]);" +.BI "int ioctl(int " fd ", MTIOCTOP, (struct mtop *)" mt_cmd ); +.BI "int ioctl(int " fd ", MTIOCGET, (struct mtget *)" mt_status ); +.BI "int ioctl(int " fd ", MTIOCPOS, (struct mtpos *)" mt_pos ); +.fi +.SH ÀâÌÀ +.B st +¥É¥é¥¤¥Ð¡¼¤ÏÍÍ¡¹¤Ê SCSI ¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤òÄ󶡤¹¤ë¡£ +¸½ºß¤Ç¤Ï¡¢¥É¥é¥¤¥Ð¡¼¤Ï¸¡½Ð¤µ¤ì¤¿Á´¤Æ¤Î +\(lq¥·¡¼¥±¥ó¥·¥ã¥ë¥¢¥¯¥»¥¹ (sequential-access) \(rq ¥¿¥¤¥×¤Î¥Ç¥Ð¥¤¥¹¤Ø¤Î +À©¸æ¤ò¹Ô¤¦¡£ +.B st +¥É¥é¥¤¥Ð¡¼¤Ï¥á¥¸¥ã¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 9 ¤òÍѤ¤¤ë¡£ +.PP +¤½¤ì¤¾¤ì¤Î¥Ç¥Ð¥¤¥¹¤Ï 8 ¤Ä¤Î¥Þ¥¤¥Ê¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤ò»È¤¦¡£ +¥Þ¥¤¥Ê¡¼ÈÖ¹æ¤ÎÄã°Ì¦¤Î 5 ¥Ó¥Ã¥È¤Ï¡¢¸¡½Ð¤µ¤ì¤¿½ç¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +¥«¡¼¥Í¥ë 2.6 ¤Ç¤Ï¡¢ +Äã°Ì¦ 8 ¥Ó¥Ã¥È¤è¤ê¤â¾å°Ì¤Ë¤¢¤ë¥Ó¥Ã¥È·²¤¬¤³¤Î 5 ¥Ó¥Ã¥È¤ËÏ¢·ë (concatenate) +¤µ¤ì¡¢¥Æ¡¼¥ÖÈÖ¹æ¤È¤Ê¤ë¡£ +¥Þ¥¤¥Ê¡¼ÈÖ¹æ¤Ï¡¢¤½¤ì¤¾¤ì 4 ¤Ä¤Î¿ô»ú¤«¤é¤Ê¤ëÆó¤Ä¤Î¥»¥Ã¥È¤Ë +¥°¥ë¡¼¥×ʬ¤±¤µ¤ì¤ë¡£ +´ðËÜ (¼«Æ°´¬¤­Ìᤷ) ¥Ç¥Ð¥¤¥¹ÈÖ¹æ +.IR n ¡¢ +¤ª¤è¤Ó \(lqÈ󴬤­Ìᤷ (no-rewind) \(rq ¥Ç¥Ð¥¤¥¹ÈÖ¹æ +.RI ( n " + 128)." +¤Ç¤¢¤ë¡£ +´ðËܥǥХ¤¥¹ÈÖ¹æ¤òÍѤ¤¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Ç¥Ð¥¤¥¹¤Ë¤Ï¡¢ +¥¯¥í¡¼¥º¤¹¤ë»þ¤Ë +.B REWIND +¥³¥Þ¥ó¥É¤¬Á÷¤é¤ì¤ë¡£ +\(lqÈ󴬤­Ìᤷ\(rq ¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤òÍѤ¤¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤¿¾ì¹ç¤Ï +\s-1REWIND\s+1 ¥³¥Þ¥ó¥É¤ÏÁ÷¤é¤ì¤Ê¤¤ +(¼«Æ°´¬¤­Ìᤷ¥Ç¥Ð¥¤¥¹¤ò¥Æ¡¼¥×¤Î°ÌÃÖ·è¤á¤Ë (Î㤨¤Ð mt ¤Ç) ÍѤ¤¤Æ¤â¡¢ +˾¤à·ë²Ì¤ÏÆÀ¤é¤ì¤Ê¤¤¡£¥Æ¡¼¥×¤Ï mt ¥³¥Þ¥ó¥É¤Î¸å¤Ç´¬¤­Ìᤵ¤ì¡¢ +¼¡¤Î¥³¥Þ¥ó¥É¤Ï¥Æ¡¼¥×¤ÎÀèƬ¤«¤é»Ï¤Þ¤Ã¤Æ¤·¤Þ¤¦)¡£ +.PP +¤½¤ì¤¾¤ì¤Î¥°¥ë¡¼¥×¤Ç¡¢°Û¤Ê¤Ã¤¿ÆÃÀ­ (¥Ö¥í¥Ã¥¯¥µ¥¤¥º¡¦°µ½Ì¡¦ +Ì©Å٤ʤÉ) ¤Î¥Ç¥Ð¥¤¥¹¤òÄêµÁ¤¹¤ë¤¿¤á¤Ë 4 ¤Ä¤Î¥Þ¥¤¥Ê¡¼Èֹ椬ÍøÍѤǤ­¤ë¡£ +¥·¥¹¥Æ¥à¤¬µ¯Æ°¤·¤¿¤È¤­¤Ë¤Ï¡¢ºÇ½é¤Î¥Ç¥Ð¥¤¥¹¤À¤±¤¬»È¤¨¤ë¡£ +¾¤Î 3 ¤Ä¤Ï¥Ç¥Õ¥©¥ë¥È¤ÎÆÃÀ­¤¬ÄêµÁ¤µ¤ì¤Æ½é¤á¤Æ»È¤¨¤ë¤è¤¦¤Ë¤Ê¤ë (¸å½Ò)¡£ +(¥³¥ó¥Ñ¥¤¥ë»þ¤ÎÄê¿ô¤òÊѹ¹¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥Æ¡¼¥×¥É¥é¥¤¥Ö¤ÎºÇÂç¿ô¤È¡¢ +¤½¤ì¤¾¤ì¤Î¥É¥é¥¤¥Ö¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¥Þ¥¤¥Ê¡¼ÈÖ¹æ¤Î¸Ä¿ô¤È¤òÄ´À°¤Ç¤­¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î³ä¤êÅö¤Æ¤Ç¤Ï 32 Âæ¤Þ¤Ç¤Î¥Æ¡¼¥×¥É¥é¥¤¥Ö¤òÀ©¸æ¤Ç¤­¤ë¡£ +Î㤨¤Ð 64 Âæ¤Þ¤Ç¤Î¥Æ¡¼¥×¥É¥é¥¤¥Ö¤ò¡¢°Û¤Ê¤Ã¤¿¥ª¥×¥·¥ç¥ó¤ò»ý¤Ä +Æó¤Ä¤Î¥Þ¥¤¥Ê¡¼ÈÖ¹æ¤ÇÀ©¸æ¤¹¤ë¤è¤¦¤Ë¤â¤Ç¤­¤ë¡£) +.PP +¥Ç¥Ð¥¤¥¹¤ÏÉáÄ̼¡¤Î¤è¤¦¤Ëºî¤é¤ì¤ë: +.in +4n +.nf + +mknod \-m 666 /dev/st0 c 9 0 +mknod \-m 666 /dev/st0l c 9 32 +mknod \-m 666 /dev/st0m c 9 64 +mknod \-m 666 /dev/st0a c 9 96 +mknod \-m 666 /dev/nst0 c 9 128 +mknod \-m 666 /dev/nst0l c 9 160 +mknod \-m 666 /dev/nst0m c 9 192 +mknod \-m 666 /dev/nst0a c 9 224 +.fi +.in +.PP +¤³¤ì¤é¤Ë¤ÏÂбþ¤¹¤ë¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Ï¸ºß¤·¤Ê¤¤¡£ +.PP +¥É¥é¥¤¥Ð¤ÏÆâÉô¥Ð¥Ã¥Õ¥¡¤ò»È¤¤¡¢¤½¤ÎÂ礭¤µ¤Ï¾¯¤Ê¤¯¤È¤â¥Æ¡¼¥×¤Î +1 ¥Ö¥í¥Ã¥¯¤òÊÝ»ý¤Ç¤­¤ë¤è¤¦¤Ë¼è¤é¤ì¤ë¡£ 2.1.121 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¥Ð¥Ã¥Õ¥¡¤ÏϢ³¤¹¤ë°ì¤Ä¤Î¥Ö¥í¥Ã¥¯¤È¤·¤Æ³ä¤êÅö¤Æ¤é¤ì¤ë¡£¤³¤ÎÊýË¡¤À¤È¡¢ +¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎºÇÂçÃͤϥ«¡¼¥Í¥ë¤Î³ä¤êÅö¤Æ²Äǽ¤ÊϢ³¥á¥â¥ê¥Ö¥í¥Ã¥¯¤Ë +À©¸Â¤µ¤ì¤ë¡£¤³¤ÎÀ©¸Â¤Ï 32 ¥Ó¥Ã¥È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï 128 kB¡¢ +64 ¥Ó¥Ã¥È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï 256 kB ¤Ç¤¢¤ë¡£¤³¤ì°Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¥É¥é¥¤¥Ð¤ÏɬÍפ˱þ¤¸¤Æ¤¤¤¯¤Ä¤«¤Ë¤ï¤«¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ò³ä¤êÅö¤Æ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 16 ¸Ä¤Þ¤Ç¤ÎÉôʬ¤Ëʬ³ä¤Ç¤­¤ë¡£¤¹¤Ê¤ï¤Á +¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎºÇÂçÃͤÏÈó¾ï¤ËÂ礭¤¤ (128 kB ¤Î¥Ö¥í¥Ã¥¯ 16 ¸Ä¤Î +³ä¤êÅö¤Æ¤ËÀ®¸ù¤¹¤ì¤Ð 2 MB ¤È¤Ê¤ë)¡£ +.PP +¥É¥é¥¤¥Ð¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ï¥³¥ó¥Ñ¥¤¥ë»þ¤ÎÄê¿ô¤ÇÄêµÁ¤µ¤ì¤ë¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ë¤Îµ¯Æ°»þ¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¾å½ñ¤­²Äǽ¤Ç¤¢¤ë¡£ +¤µ¤é¤Ë¥É¥é¥¤¥Ð¤Ï¼Â¹Ô»þ¤Ë¤â¡¢É¬Íפ˱þ¤¸¤Æ¤è¤êÂ礭¤Ê°ì»þ¥Ð¥Ã¥Õ¥¡¤ò +³ä¤êÅö¤Æ¤è¤¦¤È¤¹¤ë¡£¤·¤«¤·¼Â¹Ô»þ¤ËÂ礭¤ÊϢ³¥á¥â¥ê¥Ö¥í¥Ã¥¯¤ò +³ä¤êÅö¤Æ¤è¤¦¤È¤¹¤ë¤È¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ë¤Î¤Ç¡¢ 2.1.121 +°ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢Æ°Åª¤Ê¥Ð¥Ã¥Õ¥¡³ä¤êÅö¤Æ¤Ï¤¢¤Þ¤ê¤¢¤Æ¤Ë¤·¤Ê¤¤¤Û¤¦¤¬Îɤ¤ +(¤³¤ì¤Ï kerneld ¤ä kmod ¤Ë¤è¤ë¥É¥é¥¤¥Ð¤Î¥Ç¥Þ¥ó¥É¥í¡¼¥É¤Ë´Ø¤·¤Æ¤âÅö¤Æ¤Ï¤Þ¤ë)¡£ +.PP +¥É¥é¥¤¥Ð¤Ï¥É¥é¥¤¥Ö¤Î¥á¡¼¥«¤ä¥â¥Ç¥ë¤òÆÃÄꤷ¤Æ¥µ¥Ý¡¼¥È¤¹¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¥·¥¹¥Æ¥à¤¬µ¯Æ°¤¹¤ë¤È¡¢¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤Î¥ª¥×¥·¥ç¥ó¤¬¥É¥é¥¤¥Ö¤Î +¥Õ¥¡¡¼¥à¥¦¥§¥¢¤Ë¤è¤Ã¤ÆÄêµÁ¤µ¤ì¤ë¡£Î㤨¤Ð¡¢ +¥É¥é¥¤¥Ö¤Î¥Õ¥¡¡¼¥à¥¦¥§¥¢¤¬¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤òÁªÂò¤¹¤ì¤Ð¡¢ +¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤Ï¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤ò»È¤¦¤³¤È¤Ë¤Ê¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.BR ioctl (2) +¥³¡¼¥ë¤òÌÀ¼¨Åª¤Ë»È¤¨¤ÐÊѹ¹¤Ç¤­¡¢ +¤½¤ÎÊѹ¹¤Ï¥Ç¥Ð¥¤¥¹¤¬¥¯¥í¡¼¥º¤µ¤ì¤ÆºÆ¤Ó¥ª¡¼¥×¥ó¤µ¤ì¤¿¤È¤­¤â»Ä¤ë¡£ +.\"nakano: µÕ¤«¡© +¥ª¥×¥·¥ç¥ó¤ÎÀßÄê¤Ï¡¢ +¼«Æ°´¬¤­Ìᤷ¥Ç¥Ð¥¤¥¹¤ÈÈ󴬤­Ìᤷ¥Ç¥Ð¥¤¥¹¤ÎξÊý¤Ë±Æ¶Á¤¹¤ë¡£ +.PP +4 ¤Ä¤Î¥µ¥Ö¥°¥ë¡¼¥×¤½¤ì¤¾¤ì¤Î¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ°Û¤Ê¤ë¥ª¥×¥·¥ç¥ó¤ò +Í¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¥ª¥×¥·¥ç¥ó¤Ï¥Ç¥Ð¥¤¥¹¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¤È¤­¤Ë +¸úÎϤòȯ´ø¤¹¤ë¡£Î㤨¤Ð¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô¤Ï¤¢¤ë¥Ç¥Ð¥¤¥¹¤ò +ŬÅö¤Ê¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤Î¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç½ñ¤­¹þ¤à¤è¤¦¤ËÄêµÁ¤·¡¢ +Ê̤ΥǥХ¤¥¹¤ò²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç½ñ¤­¹þ¤à¤è¤¦¤Ë¤Ç¤­¤ë (¥É¥é¥¤¥Ö¤¬ +ξÊý¤Î¥â¡¼¥É¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ì¤Ð)¡£ +.PP +¤³¤Î¥É¥é¥¤¥Ð¤Ï¡¢ +.B ¥Æ¡¼¥×¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë (¥É¥é¥¤¥Ö¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç)¡£ +(¥Æ¡¼¥×¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ï¥Ç¥£¥¹¥¯¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤È¤Ï¤Ê¤ó¤Î´Ø·¸¤â¤Ê¤¤¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó²½¤µ¤ì¤¿¥Æ¡¼¥×¤Ï¡¢°ì¤Ä¤Î¥á¥Ç¥£¥¢¤ËÊ£¿ô¤ÎÏÀÍý¥Æ¡¼¥×¤¬ +¸ºß¤¹¤ë¤«¤Î¤è¤¦¤Ë¸«¤¨¤ë¡£) +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¥µ¥Ý¡¼¥È¤Ï +.BR ioctl (2) +¤Ë¤è¤Ã¤ÆÍ­¸ú¤Ë¤Ç¤­¤ë¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤¬Êѹ¹¤µ¤ì¤ë¤È¡¢ +¥Æ¡¼¥×¤Î°ÌÃ֤Ϥ½¤ì¤¾¤ì¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥óÆâÉô¤ÇÊݸ¤µ¤ì¤ë¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ÎÁªÂò¤Ï +.BR ioctl (2) +¤Ç¹Ô¤¦¡£ +¤½¤ì°Ê¹ß¤Î¥Æ¡¼¥×Áàºî¤ÎÂоݤϡ¢¤½¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ë¤Ê¤ë¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ÎÀÚ¤êÂؤ¨¤Ï¡¢¼¡¤Î¥Æ¡¼¥×Áàºî¤ÈƱ»þ¤Ë¹Ô¤ï¤ì¡¢ +ÉÔɬÍפʥơ¼¥×°ÜÆ°¤ò¤·¤Ê¤¯¤Æ¤¹¤à¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +°ì¤Ä¤Î¥Æ¡¼¥×¤Ë¤ª¤±¤ë¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ÎºÇÂç¿ô¤Ï +¥³¥ó¥Ñ¥¤¥ë»þ¤ÎÄê¿ô¤Ë¤è¤Ã¤ÆÄêµÁ¤µ¤ì¤ë (Ä̾ï¤Ï 4)¡£ +¥É¥é¥¤¥Ð¤Ë¤Ï¡¢¥Æ¡¼¥×¤Î 1 ¤Ä¤Þ¤¿¤Ï +2 ¤Ä¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤­¤ë¤è¤¦¤Ê +.BR ioctl (2) +¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +Ä̾¥·¥¹¥Æ¥à¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë¥Ï¡¼¥É¥ê¥ó¥¯ +¤Þ¤¿¤Ï¥½¥Õ¥È¥ê¥ó¥¯¤È¤·¤Æ¡¢¥Ç¥Ð¥¤¥¹ +.I /dev/tape +¤¬ºîÀ®¤µ¤ì¤ë¡£ +.PP +¥«¡¼¥Í¥ë 2.6.2 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¥É¥é¥¤¥Ð¤Ï sysfs ¥Ç¥£¥ì¥¯¥È¥ê +.I /sys/class/scsi_tape +¤Ë¡¢¥¢¥¿¥Ã¥Á¤·¤¿¥Ç¥Ð¥¤¥¹¤È¤½¤Î¥Ç¥Ð¥¤¥¹¤Ë³äÅö¤Æ¤¿¥Ñ¥é¥á¡¼¥¿¤ò¥¨¥¯¥¹¥Ý¡¼¥È¤¹¤ë¡£ +.SS ¥Ç¡¼¥¿Å¾Á÷ +¤³¤Î¥É¥é¥¤¥Ð¤Ï¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤È²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Î +ξÊý¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë (¥É¥é¥¤¥Ö¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ì¤Ð)¡£ +¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç¤Ï¡¢¥É¥é¥¤¥Ö¤Ï·è¤Þ¤Ã¤¿¥µ¥¤¥º¤Î¥Ö¥í¥Ã¥¯¤ò +(Ê£¿ô¸Ä) ½ñ¤­¹þ¤à¡£¤³¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤Ï +write ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥Ð¥¤¥È¿ô¤Ë¤è¤é¤Ê¤¤¡£ +²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç¤Ï¡¢ +write ¥³¡¼¥ë¤´¤È¤Ë°ì¤Ä¤Î¥Æ¡¼¥×¥Ö¥í¥Ã¥¯¤Ë½ñ¤­¹þ¤ß¤¬¹Ô¤ï¤ì¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¥Ð¥¤¥È¿ô¤¬Âбþ¤¹¤ë¥Æ¡¼¥×¥Ö¥í¥Ã¥¯¤Î¥µ¥¤¥º¤ò·è¤á¤ë¡£ +¥Æ¡¼¥×¾å¤Î¥Ö¥í¥Ã¥¯¤Ë¤Ï¡¢½ñ¤­¹þ¤ß¥â¡¼¥É¤Î¾ðÊó¤Ï°ìÀÚ´Þ¤Þ¤ì¤Ê¤¤¡£ +Æɤ߹þ¤ß¤Î¤È¤­¤Ë½ÅÍפʤ³¤È¤Ï¡¢¥Æ¡¼¥×¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ò¼õ¤±Æþ¤ì¤ë +¥³¥Þ¥ó¥É¤ò»È¤¦¤«¤É¤¦¤«¤À¤±¤Ç¤¢¤ë¡£ +.PP +²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç¤Ï¡¢Æɤ߹þ¤ß¥Ð¥¤¥È¿ô¤Ï¥Æ¡¼¥×¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤È +ɬ¤º¤·¤â°ìÃפ·¤Æ¤¤¤Ê¤¯¤Æ¤âÎɤ¤¡£¥Ð¥¤¥È¿ô¤¬¥Æ¡¼¥×¤Î¼¡¤Î¥Ö¥í¥Ã¥¯¤è¤ê¤â +Â礭¤±¤ì¤Ð¡¢¥É¥é¥¤¥Ð¤Ï¤½¤Î¥Ç¡¼¥¿¤òÊÖ¤·¡¢´Ø¿ô¤Ï¼ÂºÝ¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤òÊÖ¤¹¡£ +¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤¬¥Ð¥¤¥È¿ô¤è¤ê¤âÂ礭¤±¤ì¤Ð¡¢Í׵ᤵ¤ì¤¿Ê¬¤Î¥Ç¡¼¥¿¤¬ +¥Ö¥í¥Ã¥¯¤ÎÀèƬ¤«¤éÆɤ߹þ¤Þ¤ì¤ÆÊÖ¤µ¤ì¡¢¥Ö¥í¥Ã¥¯¤Î»Ä¤ê¤ÏÇË´þ¤µ¤ì¤ë¡£ +.PP +¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç¤Ï¡¢¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ì¤Ð +Æɤ߹þ¤ß¥Ð¥¤¥È¿ô¤ÏǤ°Õ¤ÎÂ礭¤µ¤Ç¤è¤¤¡£¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤¬Ìµ¸ú¤Î¾ì¹ç¤Ï¡¢ +¥Æ¡¼¥×¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎÀ°¿ôÇܤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ 2.1.121 °ÊÁ°¤Î +¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤¬Í­¸ú¤Ê¾ì¹ç¤Ë¤Ï +Ǥ°Õ¤Î¥Ð¥¤¥È¿ô¤Î½ñ¤­¹þ¤ß¤¬¤Ç¤­¤ë¡£¤½¤Î¾¤Î¾ì¹ç¤¹¤Ù¤Æ +(2.1.121 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¥Ð¥Ã¥Õ¥¡¤¬Ìµ¸ú¤Ê¾ì¹ç¤È¡¢¿·¤·¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç) +¤Ç¤Ï¡¢½ñ¤­¹þ¤ß¥Ð¥¤¥È¿ô¤Ï¥Æ¡¼¥×¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎÀ°¿ôÇܤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +2.6 ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Î¥É¥é¥¤¥Ð¤Ï¥æ¡¼¥¶¥Ð¥Ã¥Õ¥¡¤È¥Ç¥Ð¥¤¥¹´Ö¤Ç¡¢ +¥Ç¡¼¥¿¤ÎľÀÜžÁ÷ (direct transfer) ¤ò»î¤ß¤ë¡£ +¤³¤ì¤¬ÉÔ²Äǽ¤Ê¾ì¹ç¤Ï¡¢¥É¥é¥¤¥Ð¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡¤òÍѤ¤¤ë¡£ +ľÀÜžÁ÷¤¬¤Ç¤­¤Ê¤¤Íýͳ¤È¤·¤Æ¤Ï¡¢¥æ¡¼¥¶¥Ð¥Ã¥Õ¥¡¤Î¥¢¥é¥¤¥ó¥á¥ó¥È¤¬Å¬ÀڤǤʤ¤ +(¥Ç¥Õ¥©¥ë¥È¤Ï 512 ¥Ð¥¤¥È¤À¤¬ HBA ¥É¥é¥¤¥Ð¤Ë¤è¤Ã¤ÆÊѹ¹¤µ¤ì¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ë)¡¢ +¥æ¡¼¥¶¥Ð¥Ã¥Õ¥¡¤Î¥Ú¡¼¥¸¤Î¤É¤ì¤«¤¬ SCSI ¥¢¥À¥×¥¿¤«¤é¸«¤¨¤Ê¤¤¡¢ +¤Ê¤É¤¬¹Í¤¨¤é¤ì¤ë¡£ +.PP +¥Æ¡¼¥×¤ò¥¯¥í¡¼¥º¤¹¤ëľÁ°¤Î¥Æ¡¼¥×ÁàºîÌ¿Î᤬½ñ¤­¹þ¤ß¤Ç¤¢¤ì¤Ð¡¢ +¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤¬¼«Æ°Åª¤Ë¥Æ¡¼¥×¤Ø½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.PP +Æɤ߹þ¤ß»þ¤Ë¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤Ë½Ð²ñ¤¦¤È¡¢°Ê²¼¤¬¼Â¹Ô¤µ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤¬¸«ÉÕ¤«¤Ã¤¿¤È¤­¤Ë¥Ð¥Ã¥Õ¥¡¤Ë¥Ç¡¼¥¿¤¬»Ä¤Ã¤Æ¤¤¤ë¤È¡¢ +¥Ð¥Ã¥Õ¥¡¤Î¥Ç¡¼¥¿¤¬ÊÖ¤µ¤ì¤ë¡£¼¡¤ÎÆɤ߹þ¤ßÁàºî¤Ï 0 ¥Ð¥¤¥È¤òÊÖ¤¹¡£ +¤½¤Î¼¡¤ÎÆɤ߹þ¤ß¤Ï¼¡¤Î¥Õ¥¡¥¤¥ë¤«¤é¤Î¥Ç¡¼¥¿¤òÊÖ¤¹¡£ +µ­Ï¿¥Ç¡¼¥¿¤ÎËöÈø¤Ï¡¢Æɤ߹þ¤ßÁàºî¤¬Æó²ó³¤±¤Æ +0 ¥Ð¥¤¥È¤òÊÖ¤·¤ÆÍè¤ë¤«¤¿¤Á¤ÇÄÌÃΤµ¤ì¤ë¡£»°²óÌܤÎÆɤ߹þ¤ß¤Ï¥¨¥é¡¼¤òÊÖ¤¹¡£ +.SS ioctl +¥É¥é¥¤¥Ð¤Ï 3 ¤Ä¤Î +.BR ioctl (2) +Í×µá¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.B st +¥É¥é¥¤¥Ð¤Ë¤è¤Ã¤Æǧ¼±¤µ¤ì¤Ê¤«¤Ã¤¿Í×µá¤Ï +.B SCSI +¥É¥é¥¤¥Ð¤Ë¤ï¤¿¤µ¤ì¤ë¡£ +°Ê²¼¤ÎÄêµÁ¤Ï +.I /usr/include/linux/mtio.h +¤Ë¤è¤ë¡£ +.SS "MTIOCTOP \(em ¥Æ¡¼¥×Áàºî¤Î¼Â¹Ô" +.PP +¤³¤ÎÍ×µá¤Ï +.I "(struct mtop *)" +·¿¤Î°ú¿ô¤ò¤È¤ë¡£Á´¤Æ¤Î¥É¥é¥¤¥Ö¤¬Á´¤Æ¤ÎÁàºî¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¥É¥é¥¤¥Ö¤¬Áàºî¤òµñÈݤ¹¤ë¤È¡¢¥É¥é¥¤¥Ð¤Ï +.B EIO +¥¨¥é¡¼¤òÊÖ¤¹¡£ +.PP +.in +4n +.nf +/* Structure for MTIOCTOP \- mag tape op command: */ +struct mtop { + short mt_op; /* operations defined below */ + int mt_count; /* how many of them */ +}; +.fi +.in +.PP +Ä̾ï¤Î¥Æ¡¼¥×ÍøÍѤΤ¿¤á¤Î¼§µ¤¥Æ¡¼¥×Áàºî: +.TP 14 +.B MTBSF +.I mt_count +¸Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯ (filemark) ʬ¤Î¸åÊý¥¹¥Ú¡¼¥¹ (backward space)¡£ +.TP +.B MTBSFM +.I mt_count +¸Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯Ê¬¤Î¸åÊý¥¹¥Ú¡¼¥¹¡£ +¥Æ¡¼¥×¤Î°ÌÃÖ¤òºÇ¸å¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤Î EOT ¦¤ËÊѹ¹¤¹¤ë¡£ +.TP +.B MTBSR +.I mt_count +¸Ä¤Î¥ì¥³¡¼¥É (¥Æ¡¼¥×¥Ö¥í¥Ã¥¯) ʬ¤Î¸åÊý¥¹¥Ú¡¼¥¹¡£ +.TP +.B MTBSS +.I mt_count +¸Ä¤Î¥»¥Ã¥È¥Þ¡¼¥¯Ê¬¤Î¸åÊý¥¹¥Ú¡¼¥¹¡£ +.TP +.B MTCOMPRESSION +.I mt_count +¤¬ 0 °Ê³°¤Ê¤é¡¢¥É¥é¥¤¥Ö¤Î¥Ç¡¼¥¿°µ½Ì¤òÍ­¸ú¤Ë¤¹¤ë¡£ +0 ¤Ê¤é°µ½Ì¤ò̵¸ú¤Ë¤¹¤ë¡£¤³¤Î¥³¥Þ¥ó¥É¤Ï MODE ¥Ú¡¼¥¸ 15 ¤òÍѤ¤¤ë¡£ +¤³¤ì¤Ï¤Û¤È¤ó¤É¤Î DAT ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B MTEOM +(¥Õ¥¡¥¤¥ë¤òÄɲ乤뤿¤á¤Ë) ¥á¥Ç¥£¥¢¤Îµ­Ï¿Éôʬ¤ÎºÇ¸å¤Þ¤Ç¿Ê¤á¤ë¡£ +.TP +.B MTERASE +¥Æ¡¼¥×¤ÎÆâÍƤò¾Ãµî¤¹¤ë¡£ +2.6 ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢°ú¿ô¤¬ 0 ¤Ê¤é¤Ð short erase (¥Æ¡¼¥×¤¬¶õ¤À¤È°õ¤ò¤Ä¤±¤ë) +¤ò¹Ô¤¦¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï long erase (Á´ÂΤò¾Ãµî¤¹¤ë) ¤ò¹Ô¤¦¡£ +.TP +.B MTFSF +.I mt_count +¸Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯Ê¬¤ÎÁ°Êý¥¹¥Ú¡¼¥¹ (forward space)¡£ +.TP +.B MTFSFM +.I mt_count +¸Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯Ê¬¤ÎÁ°Êý¥¹¥Ú¡¼¥¹¡£ +¥Æ¡¼¥×¤Î°ÌÃ֤ϺǸå¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤Î BOT ¦Êѹ¹¤µ¤ì¤ë¡£ +.TP +.B MTFSR +.I mt_count +¸Ä¤Î¥ì¥³¡¼¥É (¥Æ¡¼¥×¥Ö¥í¥Ã¥¯) ʬ¤ÎÁ°Êý¥¹¥Ú¡¼¥¹¡£ +.TP +.B MTFSS +.I mt_count +¸Ä¤Î¥»¥Ã¥È¥Þ¡¼¥¯Ê¬¤ÎÁ°Êý¥¹¥Ú¡¼¥¹¡£ +.TP +.B MTLOAD +SCSI ¥í¡¼¥É¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¡£ HP ¥ª¡¼¥È¥í¡¼¥À¤Ë¸Â¤Ã¤ÆÍøÍѤǤ­¤ë¡£ +.\"nakano: ¤¢¤Ã¤Æ¤ë¡© +.I mt_count +¤¬Äê¿ô +.B MT_ST_HPLOADER_OFFSET +¤È¤¢¤ë¿ôÃͤÎϤǤ¢¤ë¾ì¹ç¡¢ +¤½¤Î¿ôÃͤ¬¥É¥é¥¤¥Ö¤ËÁ÷¤é¤ì¡¢¥ª¡¼¥È¥í¡¼¥À¤ÎÀ©¸æ¤ËÍѤ¤¤é¤ì¤ë¡£ +.TP +.B MTLOCK +¥Æ¡¼¥×¥É¥é¥¤¥Ö¤ÎÈâ¤ò¥í¥Ã¥¯¤¹¤ë¡£ +.TP +.B MTMKPART +¥Æ¡¼¥×¤ò 1 ¤Þ¤¿¤Ï 2 ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ë¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ë¡£ +.I mt_count +¤¬ 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢¤³¤ì¤¬ºÇ½é¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¥µ¥¤¥º¤òÍ¿¤¨¡¢ +ÆóÈÖÌܤΥѡ¼¥Æ¥£¥·¥ç¥ó¤¬¥Æ¡¼¥×¤Î»Ä¤ê¤Ë¤Ê¤ë¡£ +.I mt_count +¤¬ 0 ¤Î¾ì¹ç¤Ï¡¢¥Æ¡¼¥×¤Ï°ì¤Ä¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤È¤·¤Æ¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤ë¡£ +¤³¤Î¥³¥Þ¥ó¥É¤Ï¡¢¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¥µ¥Ý¡¼¥È¤¬Í­¸ú¤Ë¤µ¤ì¤¿ +¥É¥é¥¤¥Ö¤Ç¤Ê¤±¤ì¤Ð»È¤¨¤Ê¤¤ (°Ê²¼¤Î +.B MT_ST_CAN_PARTITIONS +¤ò¸«¤è)¡£ +.TP +.B MTNOP +²¿¤âÁàºî¤ò¹Ô¤ï¤Ê¤¤¡£\- Éû¼¡Åª¤Ê¸ú²Ì¤È¤·¤Æ¡¢¥É¥é¥¤¥Ð¡¼¤Î¥Ð¥Ã¥Õ¥¡ +¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +.B MTIOCGET +¤ò»È¤Ã¤Æ¾õÂÖ¤òÆɤ߽Ф¹Á°¤Ë¤Ï¤³¤ÎÁàºî¤ò¹Ô¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B MTOFFL +´¬¤­Ìᤷ (rewind) ¤ò¹Ô¤¤¡¢¥É¥é¥¤¥Ö¤ò¥ª¥Õ¥é¥¤¥ó (off line) ¤Ë¤¹¤ë¡£ +.TP +.B MTRESET +¥É¥é¥¤¥Ö¤ò¥ê¥»¥Ã¥È¤¹¤ë¡£ +.TP +.B MTRETEN +¥Æ¡¼¥×¤ò¥ê¥Æ¥ó¥·¥ç¥ó (re-tension) ¤¹¤ë +(¥Æ¡¼¥×¤òºÇ¸å¤Þ¤Ç´¬¤¤¤¿¸å¡¢ºÇ½é¤Þ¤Ç´¬¤­Ì᤹)¡£ +.TP +.B MTREW +´¬¤­Ìᤷ¡£ +.TP +.B MTSEEK +.I mt_count +¤Ç»ØÄꤵ¤ì¤¿¥Æ¡¼¥×¥Ö¥í¥Ã¥¯ÈÖ¹æ¤ò¥·¡¼¥¯¤¹¤ë¡£ +¤³¤ÎÁàºî¤¬¹Ô¤¨¤ë¤Î¤Ï¡¢ \s-1LOCATE\s+1 ¥³¥Þ¥ó¥É (¥Ç¥Ð¥¤¥¹¸ÇÍ­¤Î¥¢¥É¥ì¥¹) +¤ò¥µ¥Ý¡¼¥È¤¹¤ë SCSI-2 ¥É¥é¥¤¥Ö¤«¡¢¤¢¤ë¤¤¤Ï Tandberg +¸ß´¹¤Î SCSI-1 ¥É¥é¥¤¥Ö (Tandberg, Archive, Viper, Wangtek,¡Ä) ¤Ç¤¢¤ë¡£ +¥Ç¥Ð¥¤¥¹¸ÇÍ­¤Î¥¢¥É¥ì¥¹¤¬ÍøÍѤµ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥Ö¥í¥Ã¥¯ÈÖ¹æ¤Ï +°ÊÁ°¤Ë \s-1MTIOCPOS\s+1 ¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤¿¤â¤Î¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B MTSETBLK +.I mt_count +¤ÎÃͤò¥É¥é¥¤¥Ö¤Î¥Ö¥í¥Ã¥¯Ä¹ (block length) ¤È¤·¤Æ¥»¥Ã¥È¤¹¤ë¡£ +¥Ö¥í¥Ã¥¯Ä¹¤ò 0 ¤Ë¤¹¤ë¤È¥É¥é¥¤¥Ö¤Ï²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥µ¥¤¥º¥â¡¼¥É¤Ë¥»¥Ã +¥È¤µ¤ì¤ë¡£ +.TP +.B MTSETDENSITY +¥Æ¡¼¥×Ì©ÅÙ (tape density) ¤ò +.I mt_count +¤Ç¼¨¤µ¤ì¤ë¥³¡¼¥É¤ËÊѹ¹¤¹¤ë¡£¥É¥é¥¤¥Ö¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÌ©ÅÙ¥³¡¼¥É +¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥É¥é¥¤¥Ö¤Îʸ½ñ¤Ë½ñ¤¤¤Æ¤¢¤ë¤À¤í¤¦¡£ +.TP +.B MTSETPART +¥¢¥¯¥Æ¥£¥Ö¤Ê¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤òÂè +.I mt_count +ÈÖÌܤËÀÚ¤êÂؤ¨¤ë¡£¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ï 0 ¤«¤é¿ô¤¨¤ë¡£ +¤³¤Î¥³¥Þ¥ó¥É¤Ï¡¢¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¥µ¥Ý¡¼¥È¤¬Í­¸ú¤Ë¤µ¤ì¤¿ +¥É¥é¥¤¥Ö¤Ç¤Ê¤±¤ì¤Ð»È¤¨¤Ê¤¤ (°Ê²¼¤Î +.B MT_ST_CAN_PARTITIONS +¤ò¸«¤è)¡£ +.TP +.B MTUNLOAD +SCSI unload ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë (¥Æ¡¼¥×¤Î¥¤¥¸¥§¥¯¥È¤Ï¹Ô¤ï¤Ê¤¤)¡£ +.TP +.B MTUNLOCK +¥Æ¡¼¥×¥É¥é¥¤¥Ö¤ÎÈâ¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë¡£ +.TP +.B MTWEOF +.I mt_count +¸Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤ò½ñ¤­¹þ¤à¡£ +.TP +.B MTWSM +.I mt_count +¸Ä¤Î¥»¥Ã¥È¥Þ¡¼¥¯¤ò½ñ¤­¹þ¤à¡£ +.PP +¥Ç¥Ð¥¤¥¹¥ª¥×¥·¥ç¥ó¤ÎÀßÄê¤Î¤¿¤á¤Î (¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Ë¤è¤ë) ¼§µ¤¥Æ¡¼¥×Áàºî: +.TP 8 +.B MTSETDRVBUFFER +¤¤¤í¤¤¤í¤Ê¥É¥é¥¤¥Ö¤È¥É¥é¥¤¥Ð¡¼¤Î¥ª¥×¥·¥ç¥ó¤ò +.I mt_count +¤Ë¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿³Æ¥Ó¥Ã¥È¤Ë½¾¤Ã¤ÆÀßÄꤹ¤ë¡£ +¥ª¥×¥·¥ç¥ó¤Ë¤Ï¡¢¥É¥é¥¤¥Ö¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¥â¡¼¥É¡¢ +¥Ö¡¼¥ëÃͤΥɥ饤¥Ð¥ª¥×¥·¥ç¥ó¤Î½¸¹ç¡¢ +¥Ð¥Ã¥Õ¥¡¤Î½ñ¤­¹þ¤ßïçÃÍ (¥Ç¥Õ¥©¥ë¥È¤Ï¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÈÌ©ÅÙ)¡¢ +¥¿¥¤¥à¥¢¥¦¥ÈÃͤ¬´Þ¤Þ¤ì¤ë (¥«¡¼¥Í¥ë 2.1 °Ê¹ß)¡£ +°ì²ó¤ÎÁàºî¤ÇÊѤ¨¤é¤ì¤ë¤Î¤Ï¡¢¾åµ­¤Î¥ê¥¹¥È¤Î¤É¤ì¤«°ì¤Ä¤À¤±¤Ç¤¢¤ë +(Ê£¿ô¤Î¥Ö¡¼¥ëÃͤϤޤȤá¤Æ°ì¤Ä¤È´ªÄꤵ¤ì¤ë)¡£ +.IP +¹â°Ì¤Î4¥Ó¥Ã¥È¤¬¥¼¥í¤Ç¤¢¤ëÃͤϡ¢ +¥É¥é¥¤¥Ö¤Î¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¥â¡¼¥É¤ÎÀßÄê¤Ë»È¤ï¤ì¤ë¡£ +¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¥â¡¼¥É¤Ï°Ê²¼¤ÎÄ̤ê: +.RS 12 +.IP 0 4 +¥É¥é¥¤¥Ö¤Ï¥é¥¤¥È¥³¥Þ¥ó¥É¤ËÂФ·¡¢ +¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤¬¼ÂºÝ¤ËÇÞÂΤ˽ñ¤­¹þ¤Þ¤ì¤ë¤Þ¤Ç +.B GOOD +¤Î¥¹¥Æ¡¼¥¿¥¹¤òÊÖ¤µ¤Ê¤¤¡£ +.IP 1 +¥É¥é¥¤¥Ö¤Ï¥é¥¤¥È¥³¥Þ¥ó¥É¤ËÂФ·¡¢ +¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¤¬¥É¥é¥¤¥Ö¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡¤ËžÁ÷¤µ¤ì¤ë¤È¤¹¤°¤Ë¡¢ +.B GOOD +¤Î¥¹¥Æ¡¼¥¿¥¹¤òÊÖ¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.IP 2 +¥é¥¤¥È¥³¥Þ¥ó¥É¤ËÂФ·¡¢°Ê²¼¤Î 2 ¤Ä¤Î¾ò·ï¤¬¤½¤í¤Ã¤¿¾ì¹ç¡¢ +¥É¥é¥¤¥Ö¤Ï¤¹¤°¤Ë +.B GOOD +¥¹¥Æ¡¼¥¿¥¹¤òÊÖ¤¹»ö¤¬¤Ç¤­¤ë¡£ +(a) ¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¤¬¥É¥é¥¤¥Ö¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡¤ËžÁ÷¤µ¤ì¤¿¡£ +(b) ÊÌ¡¹¤Î¥¤¥Ë¥·¥¨¡¼¥¿¡¼¤«¤éÍ褿¥Ð¥Ã¥Õ¥¡¥Ç¡¼¥¿¤¬¡¢ +¤¹¤Ù¤ÆÇÞÂΤØÌäÂê¤Ê¤¯½ñ¤­¹þ¤Þ¤ì¤¿¡£ +.RE +.IP +½ñ¤­¹þ¤ßïçÃͤòÀ©¸æ¤¹¤ë¤Ë¤Ï¡¢ +.I mt_count +¤Ë¤Ï¡¢Äê¿ô +.B MT_ST_WRITE_THRESHOLD +¤È¥Ö¥í¥Ã¥¯¥«¥¦¥ó¥È¤ÎÏÀÍýÏ +(OR) ¤ò¤È¤Ã¤¿Ãͤò²¼°Ì¤Î 28¥Ó¥Ã¥È¤Ë´Þ¤Þ¤Í¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î¥Ö¥í¥Ã¥¯¥«¥¦¥ó¥È¤Ï 1024 ¥Ð¥¤¥È¥Ö¥í¥Ã¥¯¤òñ°Ì¤È¤·¤¿¤â¤Î¤Ç¡¢¥Æ¡¼¥×¤Î +ʪÍý¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤òñ°Ì¤È¤·¤¿¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +¤Þ¤¿¡¢ïçÃͤϥɥ饤¥Ð¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡ (¾åµ­¤ÎÀâÌÀ»²¾È) +¤Î¥µ¥¤¥º¤ò±Û¤¨¤ë»ö¤Ï¤Ç¤­¤Ê¤¤¡£ +.IP +¥Ö¡¼¥ëÃͤΥե饰¤òÀßÄꡦ²ò½ü¤¹¤ë¤Ë¤Ï¡¢ +.I mt_count +¤ÎÃÍ¤Ï +.BR MT_ST_BOOLEANS , +.BR MT_ST_SETBOOLEANS , +.BR MT_ST_CLEARBOOLEANS , +.BR MT_ST_DEFBOOLEANS +¤Î¤¤¤º¤ì¤«°ì¤Ä¤ÎÃͤˡ¢°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤ÎǤ°Õ¤ÎÁȤ߹ç¤ï¤»¤ËÂФ·¤Æ +ÏÀÍýϤò¼è¤Ã¤¿¤â¤Î¤ò»ØÄꤹ¤ë¡£ +.BR MT_ST_BOOLEANS ¤òÍѤ¤¤ë¤È¡¢ +¥ª¥×¥·¥ç¥ó¤òÂбþ¤¹¤ë¥Ó¥Ã¥È¤ËÂФ·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ëÃͤËÀßÄê¤Ç¤­¤ë¡£ +.BR MT_ST_SETBOOLEANS ¤òÍѤ¤¤ë¤È¡¢ +¥ª¥×¥·¥ç¥ó¤ÏÁªÂòŪ¤ËÀßÄꤵ¤ì¡¢ +.BR MT_ST_DEFBOOLEANS ¤òÍѤ¤¤ë¤È +ÁªÂòŪ¤Ë²ò½ü¤µ¤ì¤ë¡£ +.IP "" +¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B MT_ST_DEFBOOLEANS +¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ +¥¢¥¯¥Æ¥£¥Ö¤Ç¤Ê¤¤¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹ (Îã: ¥Þ¥¤¥Ê¡¼ÈÖ¹æ ¤¬ 32 ¤ä 160 ¤Î¥Ç¥Ð¥¤¥¹) +¤Ï¡¢¤½¤ì¤é¤ËÂФ¹¤ë¥Ç¥Õ¥©¥ë¥È¤Î¥ª¥×¥·¥ç¥ó¤¬ºÇ½é¤ËÄêµÁ¤µ¤ì¤¿¤È¤­¤Ë +¥¢¥¯¥Æ¥£¥Ö¤Ë¤Ê¤ë¡£¥¢¥¯¥Æ¥£¥Ö¤Ë¤µ¤ì¤¿¥Ç¥Ð¥¤¥¹¤Ï¡¢ +µ¯Æ°»þ¤Ë¥¢¥¯¥Æ¥£¥Ö¤Ë¤µ¤ì¤¿¥Ç¥Ð¥¤¥¹¤«¤é¡¢ +ÌÀ¼¨Åª¤Ë»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¥ª¥×¥·¥ç¥ó¤ò·Ñ¾µ¤¹¤ë¡£ +.IP "" +¥Ö¡¼¥ëÃͤΥª¥×¥·¥ç¥ó¤Ï°Ê²¼¤ÎÄ̤ê: +.RS +.TP +.BR MT_ST_BUFFER_WRITES " (¥Ç¥Õ¥©¥ë¥È: ¿¿)" +¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ë¤ª¤±¤ë¤¹¤Ù¤Æ¤Î½ñ¤­¹þ¤ßÁàºî¤ò¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬µ¶¤Ç¤¢¤ê¡¢¤«¤Ä¥É¥é¥¤¥Ö¤¬¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤Î»þ¤Ï¡¢ +¤¹¤Ù¤Æ¤Î½ñ¤­¹þ¤ßÁàºî¤Ï¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎÇÜ¿ô¤ÎÂ礭¤µ¤Ç¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¿®ÍêÀ­¤Î¤¢¤ë¥Þ¥ë¥Á¥Ü¥ê¥å¡¼¥à¥¢¡¼¥«¥¤¥Ö¤ò½ñ¤­¹þ¤à¤¿¤á¤Ë¤Ï¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ïµ¶¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.BR MT_ST_ASYNC_WRITES " (¥Ç¥Õ¥©¥ë¥È: ¿¿)" +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¿¿¤Î»þ¤Ë¤Ï¡¢¥Ç¡¼¥¿¤¬¥É¥é¥¤¥Ð¤Î¥Ð¥Ã¥Õ¥¡¤Ë¼ý¤Þ¤ë»þ¤Ë¤Ï +¥Ç¡¼¥¿¤¬¥É¥é¥¤¥Ö¤ËžÁ÷¤µ¤ì¤ë¤Î¤òÂÔ¤¿¤º¤Ë¡¢¤¹¤°¤Ë½ñ¤­¹þ¤ßÁàºî¤¬Ê֤äÆÍè¤ë¡£ +¥Ð¥Ã¥Õ¥¡¤¬¤É¤Î¤¯¤é¤¤¶õ¤¤¤¿¤é¼¡¤Î SCSI write ¥³¥Þ¥ó¥É¤òȯ¹Ô¤Ç¤­¤ë¤«¤Ï¡¢ +½ñ¤­¹þ¤ßïçÃͤˤè¤Ã¤Æ·è¤Þ¤ë¡£ +¥É¥é¥¤¥Ö¤¬ÊÖ¤¹¤¹¤Ù¤Æ¤Î¥¨¥é¡¼¤Ï¡¢¼¡¤ÎÁàºî¤Þ¤ÇÊݸ¤µ¤ì¤ë¡£ +¿®ÍêÀ­¤Î¤¢¤ë¥Þ¥ë¥Á¥Ü¥ê¥å¡¼¥à¥¢¡¼¥«¥¤¥Ö¤ò½ñ¤­¹þ¤à¤¿¤á¤Ë¤Ï¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ïµ¶¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BR MT_ST_READ_AHEAD " (¥Ç¥Õ¥©¥ë¥È: ¿¿)" +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢ +¥É¥é¥¤¥Ð¤Ï¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤ÇÆɤ߹þ¤ß¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤ÈÀèÆɤߤò¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬µ¶¤Ç¤¢¤ê¡¢¤«¤Ä¥É¥é¥¤¥Ö¤¬¸ÇÄêĹ¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤Î»þ¤Ï¡¢ +¤¹¤Ù¤Æ¤ÎÆɤ߹þ¤ßÁàºî¤Ï¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÎÇÜ¿ô¤ÎÂ礭¤µ¤Ç¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BR MT_ST_TWO_FM " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Õ¥¡¥¤¥ë¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿»þ¤Î¥É¥é¥¤¥Ð¡¼¤Î¿¶Éñ¤¤¤òÊѹ¹¤¹¤ë¡£ +°ì¤Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤ò½ñ¤­¹þ¤à¤Î¤¬Ä̾ï¤ÎÆ°ºî¤Ç¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¿¿¤Î»þ¤Ë¤Ï¡¢ +¥É¥é¥¤¥Ð¡¼¤Ï 2 ¤Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤ò½ñ¤­¹þ¤ó¤Ç¡¢ +2 ¤Ä¤á¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤Î¤È¤³¤í¤ËÌá¤ë¡£ +.IP +Ãí°Õ¡§ +QIC¥Æ¡¼¥×¥É¥é¥¤¥Ö¤Ï¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤Ë¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¤Î¤Ç¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¿¿¤Ë¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤é¤Î¥É¥é¥¤¥Ö¤Ïµ­Ï¿¥Ç¡¼¥¿¤ÎËöÈø¤Î¸¡ÃΤˡ¢ +¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤¬ 2¤Ä³¤±¤Æ¤¢¤ë¤«¤Ç¤Ï¤Ê¤¯¡¢ +¥Ö¥é¥ó¥¯¥Æ¡¼¥×¤«¤É¤¦¤«¤Î¥Æ¥¹¥È¤òÍѤ¤¤ë¡£ +¸½ºß¤Î¾¤Î¤Û¤È¤ó¤É¤Î¥É¥é¥¤¥Ö¤â¡¢µ­Ï¿¥Ç¡¼¥¿¤ÎËöÈø¤ò¸¡ÃΤ¹¤ë¡£ +2 ¤Ä¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤¬É¬Íפˤʤë¤Î¤Ï¡¢ +¾¤Î¥·¥¹¥Æ¥à¤È¥Æ¡¼¥×¤ò¤ä¤ê¤È¤ê¤¹¤ë¾ì¹ç¤Ç¤¢¤ë¡£ +.TP +.BR MT_ST_DEBUGGING " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¿¿¤Ë¤¹¤ë¤È¡¢ +¥É¥é¥¤¥Ð¤Ï¤¤¤í¤¤¤í¤Ê¥Ç¥Ð¥Ã¥°ÍÑ¥á¥Ã¥»¡¼¥¸¤ò½Ð¤¹¤è¤¦¤Ë¤Ê¤ë +.RB ( DEBUG +¤òÈó¥¼¥í¤ËÄêµÁ¤·¤Æ¥É¥é¥¤¥Ð¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤¤¤ë»þ¤Î¤ßÍ­¸ú)¡£ +.TP +.BR MT_ST_FAST_EOM " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¿¿¤Ë¤¹¤ë¤È¡¢ +.B MTEOM +Áàºî¤¬Ä¾Àܥɥ饤¥Ö¤ËÁ÷¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +Áàºî¤¬Á᤯¤Ê¤ë¤Ï¤º¤À¤¬¡¢ +¥É¥é¥¤¥Ð¤¬¸½ºß¤Î¥Õ¥¡¥¤¥ëÈÖ¹æ¤ò¸«¼º¤¦¤³¤È¤Ë¤Ê¤ë +(¤³¤ì¤ÏÄ̾ï¤Ê¤é +.B MTIOCGET +¥ê¥¯¥¨¥¹¥È¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë)¡£ +.B MT_ST_FAST_EOM +¤¬µ¶¤Î»þ¤Ë¤Ï¡¢¥É¥é¥¤¥Ð¤Ï +.B MTEOM +¥ê¥¯¥¨¥¹¥È¤Ë±þ¤¨¤ë¤È¤­¡¢Á°Êý¤Ë¥Õ¥¡¥¤¥ë¤ò°ì¤Ä°ì¤Ä¿Ê¤á¤Æ¤¤¤¯¡£ +.TP +.BR MT_ST_AUTO_LOCK " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¿¿¤Î»þ¤Ë¤Ï¡¢ +¥Ç¥Ð¥¤¥¹¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¤È¥É¥é¥¤¥Ö¤ÎÈ⤬¥í¥Ã¥¯¤µ¤ì¡¢ +¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¥¢¥ó¥í¥Ã¥¯¤µ¤ì¤ë¡£ +.TP +.BR MT_ST_DEF_WRITES " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +¥Æ¡¼¥×¥ª¥×¥·¥ç¥ó (¥Ö¥í¥Ã¥¯¥µ¥¤¥º¡¢¥â¡¼¥É¡¢°µ½Ì¤Ê¤É) +¤¬¤¢¤ë¥É¥é¥¤¥Ö¤Ë¥ê¥ó¥¯¤µ¤ì¤¿¥Ç¥Ð¥¤¥¹¤ÇÊѹ¹¤µ¤ì¤ë¤È¡¢ +¤½¤ÎƱ¤¸¥É¥é¥¤¥Ö¤Ë¥ê¥ó¥¯¤µ¤ì¤¿Â¾¤Î¥Ç¥Ð¥¤¥¹¤Ç¤âÊѹ¹¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë +(¤½¤Î¥Ç¥Ð¥¤¥¹¤ÎÄêµÁ¤Ë¤è¤ë)¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +¥É¥é¥¤¥Ð¤Ë¤è¤ëÊѹ¹¤ò¤¤¤Ä SCSI ¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤ÆÈ¿±Ç¤µ¤»¤ë¤«¤È¡¢ +¥É¥é¥¤¥Ö¤Î¼«Æ°¸¡Ãε¡Ç½¤¬¤¤¤Ä¿®Íꤷ¤ÆÎɤ¤¤Î¤«¤òÄêµÁ¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òµ¶¤Ë¤·¤Æ¤ª¤¯¤È¡¢ +¥Ç¥Ð¥¤¥¹¤ÎÊѹ¹¤¬¤¢¤ë¤È¥É¥é¥¤¥Ð¤Ï¤¹¤°¤Ë SCSI ¥³¥Þ¥ó¥É¤òÁ÷¤ë¡£ +¿¿¤Ë¤·¤Æ¤ª¤¯¤È¡¢ SCSI ¥³¥Þ¥ó¥É¤Ï½ñ¤­¹þ¤ß¤¬Í׵ᤵ¤ì¤ë¤Þ¤ÇÁ÷¤é¤ì¤Ê¤¤¡£ +¸å¼Ô¤Î¾ì¹ç¤Ï¡¢Æɤ߹þ¤ß¤ÎºÝ¤Ë¥É¥é¥¤¥Ö¤Î¥Õ¥¡¡¼¥à¥¦¥§¥¢¤Ë¤è¤Ã¤Æ +¥Æ¡¼¥×¹½Â¤¤Î¸¡ÃΤ¬¹Ô¤¨¤ë¡£¤Þ¤¿ SCSI ¥³¥Þ¥ó¥É¤Ï¡¢ +¥Æ¡¼¥×¤¬Àµ¤·¤¤»ØÄê¤Ë±è¤Ã¤Æ½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Î +³Îǧ¤Î¤¿¤á¤À¤±¤ËÍѤ¤¤é¤ì¤ë¡£ +.TP +.BR MT_ST_CAN_BSR " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +ÀèÆɤߤò»È¤¦¤È¡¢¥Æ¡¼¥×¤ò¥¯¥í¡¼¥º¤¹¤ë¤È¤­¤Ë¡¢ +¾ì¹ç¤Ë¤è¤Ã¤Æ¤Ï¥Æ¡¼¥×¤òÀµ¤·¤¤°ÌÃ֤˵ÕÌᤷ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤¬¤¢¤ë¡£ +¤³¤ì¤Ë¤Ï¡¢¥ì¥³¡¼¥É¤ò±Û¤¨¤ÆµÕÌᤷ¤¹¤ë SCSI ¥³¥Þ¥ó¥É¤¬ÍѤ¤¤é¤ì¤ë¡£ +¸Å¤¤¥É¥é¥¤¥Ö¤Ç¤Ï¡¢¤³¤Î¥³¥Þ¥ó¥É½èÍý¤Î¿®ÍêÀ­¤¬Ä㤤¤³¤È¤¬¤¢¤ë¤¬¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢ +¥É¥é¥¤¥Ð¤Ë¤³¤Î¥³¥Þ¥ó¥É¤ÎÍøÍѤò¶Ø»ß¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +ÀèÆɤߤȸÇÄêĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤òÍѤ¤¤Æ¤¤¤ë¤È¡¢ºÇ½ªÅª¤Ê·ë²Ì¤È¤·¤Æ¡¢ +¥Ç¥Ð¥¤¥¹¤Î¥¯¥í¡¼¥º»þ¤Ë¥Æ¡¼¥×¤¬Àµ¤·¤¤°ÌÃ֤ˤʤé¤Ê¤¤¤³¤È¤¬¤¢¤ë¡£ +.\"nakano ¤½¤¦¤«¡© +2.6 ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢SCSI-3 ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¥É¥é¥¤¥Ö¤ËÂФ·¤Æ¡¢ +¤³¤ÎÃͤΥǥե©¥ë¥È¤Ï¿¿¤È¤Ê¤ë¡£ +.TP +.BR MT_ST_NO_BLKLIMS " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +¥É¥é¥¤¥Ö¤Ë¤è¤Ã¤Æ¤Ï +.B READ BLOCK LIMITS SCSI +¥³¥Þ¥ó¥É¤ò¼õ¤±¤Ä¤±¤Ê¤¤¤³¤È¤¬¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È¡¢¥É¥é¥¤¥Ð¤Ï¤³¤Î¥³¥Þ¥ó¥É¤òÍѤ¤¤Ê¤¤¡£ +·çÅÀ¤Ï¡¢»ØÄꤷ¤¿¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤¬¥É¥é¥¤¥Ö¤Ë¼õÍý¤µ¤ì¤Æ¤·¤Þ¤¦¤È¡¢ +¥É¥é¥¤¥Ð¤Î¥³¥Þ¥ó¥ÉÁ÷¿®Á°¥Á¥§¥Ã¥¯¤¬¤Ç¤­¤Ê¤¯¤Ê¤ëÅÀ¤Ç¤¢¤ë¡£ +.TP +.BR MT_ST_CAN_PARTITIONS " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢°ì¤Ä¤Î¥Æ¡¼¥×¤ËÊ£¿ô¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤òÃÖ¤¯¤³¤È¤ò +¥µ¥Ý¡¼¥È¤¹¤ë¤«¤É¤¦¤«¤ò·è¤á¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥É¥é¥¤¥Ö¤Ë¥ê¥ó¥¯¤µ¤ì¤¿Á´¤Æ¤Î¥Ç¥Ð¥¤¥¹¤ËŬÍѤµ¤ì¤ë¡£ +.TP +.TP MT_ST_SCSI2LOGICAL " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +seek ¤ª¤è¤Ó tell Áàºî (ξ¼Ô¤È¤â +.BR MTSEEK ¡¦ MTIOCPOS +¥³¥Þ¥ó¥É¤òȼ¤¤¡¢¥Æ¡¼¥×°ÌÃÖ¤òÊѹ¹¤¹¤ë¤È¤­) ¤ÎºÝ¤Ë¡¢ +SCSI-2 ¤Îɸ½à¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÏÀÍý¥Ö¥í¥Ã¥¯¥¢¥É¥ì¥¹¤òÍѤ¤¤ë¤«¤É¤¦¤«¤ò +¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +.\"nakano both with ¤ÎÉôʬ²ø¤·¤¤¡£ +µ¶¤À¤È¥Ç¥Ð¥¤¥¹¸ÇÍ­¤Î¥¢¥É¥ì¥¹¤¬ÍѤ¤¤é¤ì¤ë¡£ +¥É¥é¥¤¥Ö¤¬ÏÀÍý¥¢¥É¥ì¥¹¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤È¤­¤Ï¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¥»¥Ã¥È¤¹¤ë¤³¤È¤ò¶¯¤¯´«¤á¤ë¡£ +¤³¤Î¥â¡¼¥É¤Ç¤Ï¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤â¥«¥¦¥ó¥È¤¹¤ë¤«¤é¤Ç¤¢¤ë¡£ +ÏÀÍý¥Ö¥í¥Ã¥¯¥¢¥É¥ì¥¹¤·¤«¥µ¥Ý¡¼¥È¤·¤Ê¤¤¥É¥é¥¤¥Ö¤â¤¤¤¯¤Ä¤«Â¸ºß¤·¤Æ¤¤¤ë¡£ +.TP +.BR MT_ST_SYSV " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¿¿¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤Ï +SystemV ¤Î¥ë¡¼¥ë¤òÍѤ¤¤ë¡£µ¶¤À¤È BSD ¤Î¥ë¡¼¥ë¤òÍѤ¤¤ë¡£ +.\"nakano: semantics ¢ª ¥ë¡¼¥ë ¤Ï¤Á¤È°ã¤¦¤«¡© +¤³¤ì¤é¤Î¥ë¡¼¥ë´Ö¤ÎºÇ¤âÂ礭¤Ê°ã¤¤¤Ï¡¢Æɤ߹þ¤ß¤ò¹Ô¤Ã¤Æ¤¤¤¿ +¥Ç¥Ð¥¤¥¹¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿¤È¤­¤Î¿¶Éñ¤¤¤Ç¤¢¤ë¡£ +System V ¤Î¥ë¡¼¥ë¤Ç¤Ï¡¢¥Æ¡¼¥×¤Ï¼¡¤Î¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤ò±Û¤¨¤Æ°ÜÆ°¤¹¤ë +(¥Ç¥Ð¥¤¥¹¤ÎÍøÍÑ»þ¤Ë¤³¤ì¤¬¹Ô¤ï¤ì¤Ê¤«¤Ã¤¿¾ì¹ç)¡£ +BSD ¤Î¥ë¡¼¥ë¤Ç¤Ï¥Æ¡¼¥×°ÌÃÖ¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£ +.TP +.BR MT_NO_WAIT " (¥Ç¥Õ¥©¥ë¥È: µ¶)" +¨»þ¥â¡¼¥É (immediate mode; ¥³¥Þ¥ó¥É¤Î½ªÎ»¤òÂÔ¤¿¤Ê¤¤) +¤ò¡¢¤¢¤ë¼ï¤Î¥³¥Þ¥ó¥É (rewind ¤Ê¤É) ¤ËÂФ·¤ÆÍ­¸ú¤Ë¤¹¤ë¡£ +.PP +Îã: +.in +4n +.nf + +struct mtop mt_cmd; +mt_cmd.mt_op = MTSETDRVBUFFER; +mt_cmd.mt_count = MT_ST_BOOLEANS | + MT_ST_BUFFER_WRITES | MT_ST_ASYNC_WRITES; +ioctl(fd, MTIOCTOP, mt_cmd); +.fi +.in +.RE +.IP "" +¥Ç¥Ð¥¤¥¹¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤Ï +.B MT_ST_DEF_BLKSIZE +¤Ë¤è¤Ã¤ÆÀßÄê¤Ç¤­¡¢¥Ç¥Õ¥©¥ë¥È¤ÎÌ©ÅÙ¥³¡¼¥É¤Ï +.B MT_ST_DEFDENSITY +¤Ë¤è¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤ÎÃͤÏÁàºî¥³¡¼¥É¤È OR ¤·¤ÆÍ¿¤¨¤ë¡£ +.IP "" +2.1.x °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥ÈÃͤÎÀßÄê¤Ï¡¢ +¥µ¥Ö¥³¥Þ¥ó¥É +.B MT_ST_SET_TIMEOUT +¤ËÉÃñ°Ì¤Î¥¿¥¤¥à¥¢¥¦¥ÈÃͤò +OR ¤·¤ÆÍ¿¤¨¤ë¤³¤È¤Ë¤è¤Ã¤Æ¹Ô¤¨¤ë¡£ long ¥¿¥¤¥à¥¢¥¦¥È +(´¬¤­Ìᤷ¤Ê¤É¡¢Ä¹¤¤»þ´Ö¤¬¤«¤«¤ë¥³¥Þ¥ó¥É¤ËÂФ·¤ÆÍѤ¤¤é¤ì¤ë) ¤Ï +.B MT_ST_SET_LONG_TIMEOUT +¤ÇÀßÄê¤Ç¤­¤ë¡£ +¥«¡¼¥Í¥ë¤Î¥Ç¥Õ¥©¥ë¥È¤ÏÈó¾ï¤ËŤ¯¡¢¤É¤Î¥É¥é¥¤¥Ö¤Ç¤â +À®¸ù¤·¤Æ¤¤¤ë¥³¥Þ¥ó¥É¤¬·è¤·¤Æ¥¿¥¤¥à¥¢¥¦¥È¤·¤Ê¤¤¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥É¥é¥¤¥Ð¤Ï¥¿¥¤¥à¥¢¥¦¥È¤òÂԤäƤ¤¤ë¤À¤±¤Ê¤Î¤Ë¡¢ +»É¤µ¤Ã¤¿ (stuck ¤·¤¿) ¤è¤¦¤Ë¸«¤¨¤ë¤³¤È¤¬¤¢¤ë¡£¤³¤ì¤é¤Î¥³¥Þ¥ó¥É¤ò»È¤¨¤Ð¡¢ +ÆÃÄê¤Î¥É¥é¥¤¥Ö¤ËÂФ·¤Æ¤â¤¦¾¯¤·¼ÂºÝŪ¤ÊÃͤËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°ì¤Ä¤Î¥Ç¥Ð¥¤¥¹¤ËÀßÄꤷ¤¿¥¿¥¤¥à¥¢¥¦¥ÈÃͤϡ¢ +¤½¤ì¤ÈƱ¤¸¥É¥é¥¤¥Ö¤Ë¥ê¥ó¥¯¤·¤¿Á´¤Æ¤Î¥Ç¥Ð¥¤¥¹¤ËŬÍѤµ¤ì¤ë¡£ +.IP "" +2.4.19 ¤ª¤è¤Ó 2.5.43 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¤³¤Î¥É¥é¥¤¥Ð¤Ï¥É¥é¥¤¥Ö¤Î¥¯¥ê¡¼¥Ë¥ó¥°¤¬É¬Íפ«¤É¤¦¤«¤ò¼¨¤¹ +¾õÂ֥ӥåȤò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +¥É¥é¥¤¥Ö¤¬¥¯¥ê¡¼¥Ë¥ó¥°¾ðÊó¤òÊÖ¤µ¤»¤ë¤«¤É¤¦¤«¤Ï¡¢ +.B MT_ST_SEL_CLN +¥µ¥Ö¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡£ +¤³¤ÎÃͤ¬ 0 ¤À¤È¡¢¥¯¥ê¡¼¥Ë¥ó¥°¥Ó¥Ã¥È¤Ï¾ï¤Ë 0 ¤È¤Ê¤ë¡£ +Ãͤò 1 ¤Ë¤¹¤ë¤È¡¢SCSI-3 ɸ½à¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë +TapeAlert ¥Ç¡¼¥¿¤¬ÍѤ¤¤é¤ì¤ë (¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +ÃͤȤ·¤Æ¤Ï 2 ¤«¤é 17 ¤¬Í½Ì󤵤ì¤Æ¤¤¤ë¡£ +Äã°Ì¦¤Î 8 ¥Ó¥Ã¥È¤¬ 18 °Ê¾å¤À¤È¡¢³ÈÄ¥¾õÂ֥ǡ¼¥¿ (extended sense data) +¤¬ÍѤ¤¤é¤ì¤ë¡£Âè 9-16 ¥Ó¥Ã¥È¤ÏÃíÌܤ¹¤Ù¤­¥Ó¥Ã¥È¤òÁªÂò¤¹¤ë¤¿¤á¤Î¥Þ¥¹¥¯¤ò»ØÄꤷ¡¢ +Âè 17-23 ¥Ó¥Ã¥È¤Ïõ¤¹¤Ù¤­¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó¤¬ 0 ¤Î¤È¤­¤Ï¡¢ +¥Þ¥¹¥¯²¼¤Î¥Ó¥Ã¥È (·²) ¤¬¥¯¥ê¡¼¥Ë¥ó¥°Í×µá¤ò¼¨¤¹¡£¥Ñ¥¿¡¼¥ó¤¬ 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢ +¤³¤Î¥Ñ¥¿¡¼¥ó¤¬¥Þ¥¹¥¯¸å¤Î¾õÂ֥ǡ¼¥¿¥Ð¥¤¥È¤Ë¥Þ¥Ã¥Á¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SS "MTIOCGET \(em ¥¹¥Æ¡¼¥¿¥¹¤Î¼èÆÀ" +.PP +¤³¤Î¥ê¥¯¥¨¥¹¥È¤Ï +.IR "(struct mtget *)" +¤È¤¤¤¦·¿¤Î°ú¿ô¤ò¤È¤ë¡£ +.PP +.in +4n +.nf +/* structure for MTIOCGET \- mag tape get status command */ +struct mtget { + long mt_type; + long mt_resid; + /* the following registers are device dependent */ + long mt_dsreg; + long mt_gstat; + long mt_erreg; + /* The next two fields are not always used */ + daddr_t mt_fileno; + daddr_t mt_blkno; +}; +.fi +.in +.IP \fImt_type\fP 11 +¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëÃæ¤Ë¤Ï¿¤¯¤Î +.I mt_type +¤ÎÃͤ¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¸½¹Ô¤Î¥É¥é¥¤¥Ð¤ÏÈÆÍѤΥ¿¥¤¥×¤Ç¤¢¤ë +.B MT_ISSCSI1 +(ÈÆÍÑ SCSI-1 ¥Æ¡¼¥×) ¤ª¤è¤Ó +.B MT_ISSCSI2 +(ÈÆÍÑ SCSI-2 ¥Æ¡¼¥×) ¤Î¤ß¤òÊÖ¤¹¡£ +.IP \fImt_resid\fP +¸½ºß¤Î¥Æ¡¼¥×°ÌÃÖÈֹ档 +.IP \fImt_dsreg\fP +¥É¥é¥¤¥Ö¤Î¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ÈÌ©Å٤θ½ºß¤ÎÀßÄê¤òÊó¹ð¤¹¤ë +(²¼°Ì 24 ¥Ó¥Ã¥È¤¬¥Ö¥í¥Ã¥¯¥µ¥¤¥º¡¢¾å°Ì 8 ¥Ó¥Ã¥È¤¬Ì©ÅÙ)¡£ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +.BR MT_ST_BLKSIZE_SHIFT , +.BR MT_ST_BLKSIZE_MASK , +.BR MT_ST_DENSITY_SHIFT , +.BR MT_ST_DENSITY_MASK +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.IP \fImt_gstat\fP +ÈÆÍѤΠ(¥Ç¥Ð¥¤¥¹¤Ë°Í¸¤·¤Ê¤¤) ¥¹¥Æ¡¼¥¿¥¹¤òÊó¹ð¤¹¤ë¡£ +¤³¤ì¤é¤Î¥¹¥Æ¡¼¥¿¥¹¥Ó¥Ã¥È¤ò¥Æ¥¹¥È¤¹¤ë¤¿¤á¤Î¥Þ¥¯¥í¤¬ +¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.RS +.HP 4 +\fBGMT_EOF\fP(\fIx\fP): +¥Æ¡¼¥×¤Ï¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯¤Îľ¸å¤Ë°ÌÃÖ¤·¤Æ¤¤¤ë¡£ +.RB ( MTSEEK +Áàºî¤Î¸å¤Ç¤Ï¾ï¤Ëµ¶) +.HP +\fBGMT_BOT\fP(\fIx\fP): +¥Æ¡¼¥×¤ÏºÇ½é¤Î¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë°ÌÃÖ¤·¤Æ¤¤¤ë¡£ +.RB ( MTSEEK +Áàºî¤Î¸å¤Ç¤Ï¾ï¤Ëµ¶) +.HP +\fBGMT_EOT\fP(\fIx\fP): +¥Æ¡¼¥×Áàºî¤Ï¥Æ¡¼¥×¤ÎʪÍýŪ¤Ê½ªÅÀ¤Ë㤷¤¿¡£ +.HP +\s-1GMT_SM(\s+1\fIx\fP\s-1)\s+1: +¥Æ¡¼¥×¤Ï¸½ºß¥»¥Ã¥È¥Þ¡¼¥¯¤Ë°ÌÃÖ¤·¤Æ¤¤¤ë¡£ +.RB ( MTSEEK +Áàºî¤Î¸å¤Ç¤Ï¾ï¤Ëµ¶) +.HP +\fBGMT_EOD\fP(\fIx\fP): +¥Æ¡¼¥×¤Ïµ­Ï¿¥Ç¡¼¥¿¤ÎËöÈø¤Ë°ÌÃÖ¤·¤Æ¤¤¤ë¡£ +.HP +\fBGMT_WR_PROT\fP(\fIx\fP): +¥É¥é¥¤¥Ö¤Ï¥é¥¤¥È¥×¥í¥Æ¥¯¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¥É¥é¥¤¥Ö¤Ë¤è¤Ã¤Æ¤Ï¡¢ +¥É¥é¥¤¥Ö¤¬¸½ºß¤Î¥á¥Ç¥£¥¢¥¿¥¤¥×¤Ø¤Î½ñ¤­¹þ¤ß¤ò +¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤»ö¤ò°ÕÌ£¤¹¤ë¾ì¹ç¤â¤¢¤ë¡£ +.HP +\fBGMT_ONLINE\fP(\fIx\fP): +¤â¤Ã¤È¤âºÇ¶á¤Î +.BR open (2) +¤¬¡¢¥Æ¡¼¥×¤¬Æþ¤Ã¤Æ¤¤¤ÆÁàºî¤Î½àÈ÷¤¬¤Ç¤­¤Æ¤¤¤ë¥É¥é¥¤¥Ö¤ò¸¡ÃΤ·¤¿¡£ +.HP +\fBGMT_D_6250\fP(\fIx\fP), \fBGMT_D_1600\fP(\fIx\fP), \fBGMT_D_800\fP(\fIx\fP): +¤³¤Î¡ÖÈÆÍѡפΥ¹¥Æ¡¼¥¿¥¹¾ðÊó¤Ï¡¢ +9-¥È¥é¥Ã¥¯ \(12" ¥Æ¡¼¥×¥É¥é¥¤¥Ö¤Î¾ì¹ç¤Ë¤Î¤ß¡¢ +¸½ºß¤ÎÌ©ÅÙ¤ÎÀßÄê¤òÊó¹ð¤¹¤ë¡£ +.HP +\fBGMT_DR_OPEN\fP(\fIx\fP): +¥É¥é¥¤¥Ö¤Ë¥Æ¡¼¥×¤¬Æþ¤Ã¤Æ¤¤¤Ê¤¤¡£ +.HP +\fBGMT_IM_REP_EN\fP(\fIx\fP): +¨»þÊó¹ð¥â¡¼¥É¡£ write ¥³¡¼¥ë¤¬Ìá¤Ã¤¿¤È¤­¡¢ +¥Æ¡¼¥×¤ËÂФ·¤ÆʪÍýŪ¤Ê½ñ¤­¹þ¤ß¤¬¹Ô¤ï¤ì¤¿¤«¤É¤¦¤«¤òÊݾڤǤ­¤Ê¤¤¾ì¹ç¤Ë¡¢ +¤³¤Î¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£¥É¥é¥¤¥Ð¤¬¥Ç¡¼¥¿¤ò¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤»¤º¡¢ +¥É¥é¥¤¥Ö¤â¥Ç¡¼¥¿¤ò¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤·¤Ê¤¤¾ì¹ç¤Ë¸Â¤Ã¤Æ¡¢ +¤³¤ÎÃÍ¤Ï 0 ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.HP +\fBGMT_CLN\fP(\fIx\fP): +¥É¥é¥¤¥Ö¤¬¥¯¥ê¡¼¥Ë¥ó¥°¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë 2.4.19 ¤ª¤è¤Ó 2.5.43 °Ê¹ß¤Ç¼ÂÁõ¤µ¤ì¤¿¡£ +.RE +.IP \fImt_erreg\fP +.I mt_erreg +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Õ¥£¡¼¥ë¥É¤Ï°ì¤Ä¤À¤±¤Ç¡¢ +²¼°Ì¤Î 16 ¥Ó¥Ã¥È¤¬¥¨¥é¡¼¤ò¥ê¥«¥Ð¡¼¤·¤¿²ó¿ô¤Ç¤¢¤ë +.RB ( MT_ST_SOFTERR_SHIFT +¤È +.B MT_ST_SOFTERR_MASK +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ +¥É¥é¥¤¥Ö¤ÎÊó¹ð¤¹¤ë¥¨¥é¡¼¥ê¥«¥Ð¡¼¿ô¤ÈÌ·½â¤¹¤ë¤³¤È¤¬¤¢¤ë¤Î¤Ç¡¢ +¤³¤Î¿ô¤Ï¤Û¤È¤ó¤É¤Î¾ì¹ç°Ý»ý¤µ¤ì¤Ê¤¤ +(¤Û¤È¤ó¤É¤Î¥É¥é¥¤¥Ö¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥½¥Õ¥È¥¨¥é¡¼¤òÊó¹ð¤·¤Ê¤¤¡£ +¤·¤«¤·¤³¤ì¤Ï SCSI MODE SELECT ¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤ÆÊѹ¹¤Ç¤­¤ë)¡£ +.IP \fImt_fileno\fP +(¥¼¥í¤«¤é¿ô¤¨¤¿) ¸½ºß¤Î¥Õ¥¡¥¤¥ëÈÖ¹æ¤òÊó¹ð¤¹¤ë¡£ +¥Õ¥¡¥¤¥ëÈֹ椬¤ï¤«¤é¤Ê¤¤»þ (Î㤨¤Ð +.B MTBSS +¤ä +.B MTSEEK +¤Î¸å¤Ê¤É) ¤Ë¤Ï \-1 ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.IP \fImt_blkno\fP +¸½ºß¤Î¥Õ¥¡¥¤¥ëÃæ¤Î(¥¼¥í¤«¤é¿ô¤¨¤¿)¥Ö¥í¥Ã¥¯ÈÖ¹æ¤òÊó¹ð¤¹¤ë¡£ +¥Ö¥í¥Ã¥¯Èֹ椬¤ï¤«¤é¤Ê¤¤»þ (Î㤨¤Ð +.BR MTBSF , +.BR MTBSS , +.BR MTSEEK +¤Î¸å¤Ê¤É) ¤Ë¤Ï \-1 ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PD +.SS "MTIOCPOS \(em ¥Æ¡¼¥×°ÌÃ֤μèÆÀ" +.PP +¤³¤Î¥ê¥¯¥¨¥¹¥È¤Ï +.I "(struct mtpos *)" +·¿¤Î°ú¿ô¤ò¤È¤ê¡¢¥É¥é¥¤¥Ö¤¬ÊÝ»ý¤·¤Æ¤¤¤ë¸½ºß¤Î¥Æ¡¼¥×¥Ö¥í¥Ã¥¯ÈÖ¹æ¤òÊó¹ð¤¹¤ë¡£ +¤³¤ì¤Ï¡¢ +.B MTIOCGET +¤Ë¤è¤êÊÖ¤µ¤ì¤ë +.I mt_blkno +¤ÈƱ¤¸¤Ç¤Ï¤Ê¤¤¡£ +¥É¥é¥¤¥Ö¤Ï +.B "READ POSITION" +¥³¥Þ¥ó¥É (¥Ç¥Ð¥¤¥¹¸ÇÍ­¥¢¥É¥ì¥¹) +¤ò¥µ¥Ý¡¼¥È¤¹¤ë SCSI-2¥É¥é¥¤¥Ö¤«¡¢ +Tandberg ¸ß´¹¤Î SCSI-1 ¥É¥é¥¤¥Ö +(Tandberg, Archive, Viper, Wangtek, ... ) ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.in +4n +.nf +/* structure for MTIOCPOS \- mag tape get position command */ +struct mtpos { + long mt_blkno; /* current block number */ +}; +.fi +.in +.SH ÊÖ¤êÃÍ +.TP 14 +.TP +.B EACCES +½ñ¤­¹þ¤ßÊݸ¤ì¤Æ¤¤¤ë¥Æ¡¼¥×¤Ë½ñ¤­¹þ¤ß¤Þ¤¿¤Ï¾Ãµî¤ò¹Ô¤ª¤¦¤È¤·¤¿¡£ +(¤³¤Î¥¨¥é¡¼¤Ï +.BR open (2) +Ãæ¤Ë¤Ï¸¡ÃΤµ¤ì¤Ê¤¤¡£) +.TP +.B EBUSY +¥Ç¥Ð¥¤¥¹¤¬¤¹¤Ç¤Ë»È¤ï¤ì¤Æ¤¤¤ë¤«¡¢ +¥É¥é¥¤¥Ð¤¬¥Ð¥Ã¥Õ¥¡¤ò³äÅö¤Æ¤é¤ì¤Ê¤«¤Ã¤¿¡£ +.TP +.B EFAULT +¥³¥Þ¥ó¥É¤Î°ú¿ô¤¬¡¢ +¸Æ¤Ó¤À¤·¥×¥í¥»¥¹¤Ë°¤·¤Æ¤¤¤Ê¤¤¥á¥â¥ê°ÌÃÖ¤ò»Ø¤·¤Æ¤¤¤ë¡£ +.TP +.B EINVAL +.BR ioctl (2) +¤Î°ú¿ô¤¬ÉÔÀµ¤Ç¤¢¤ë¤«¡¢Í׵ᤷ¤¿¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤¬ÉÔÀµ¡£ +.TP +.B EIO 14 +Í׵ᤵ¤ì¤¿Áàºî¤¬ºÇ¸å¤Þ¤Ç¹Ô¤¨¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOMEM +.BR read (2) +¤Î¥Ð¥¤¥È¿ô¤¬¡¢¥Æ¡¼¥×¤Ë¤¢¤ë¼¡¤ÎʪÍý¥Ö¥í¥Ã¥¯¤è¤ê¾®¤µ¤¤ +(2.2.18 ¤ª¤è¤Ó 2.4.0-test6 °ÊÁ°¤Ç¤Ï¡¢ÌۤäÆ;ʬ¤Î¥Ð¥¤¥È¤ò̵»ë¤·¤Æ¤¤¤¿)¡£ +.TP +.B ENOSPC +¥á¥Ç¥£¥¢¤Î½ªÅÀ¤Ë㤷¤¿¤¿¤á¡¢½ñ¤­¹þ¤ßÁàºî¤¬´°Î»¤·¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENOSYS +ÉÔÌÀ¤Ê +.BR ioctl (2)¡£ +.TP +.B ENXIO +¥ª¡¼¥×¥ó¤¹¤ë»þ¤Ë¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¡£ +.TP +.B EOVERFLOW +¥É¥é¥¤¥Ð¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡¤è¤êÂ礭¤¤¥µ¥¤¥º¤Î²ÄÊÑĹ¥Ö¥í¥Ã¥¯¤ò +Æɤ߽ñ¤­¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B EROFS +¥É¥é¥¤¥Ö¤ËÆþ¤Ã¤Æ¤¤¤ë¥Æ¡¼¥×¤¬¥é¥¤¥È¥×¥í¥Æ¥¯¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +.B O_WRONLY +¤Þ¤¿¤Ï +.B O_RDWR +¤Ç open ¤ò¹Ô¤ª¤¦¤È¤·¤¿¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP 12 +.I /dev/st* +¼«Æ°´¬¤­Ìᤷ¤Î SCSI ¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¡£ +.TP 12 +.I /dev/nst* +´¬¤­Ìᤷ¤ò¤·¤Ê¤¤ SCSI ¥Æ¡¼¥×¥Ç¥Ð¥¤¥¹¡£ +.\" .SH Ãø¼Ô +.\" ¤³¤Î¥É¥é¥¤¥Ð¤Ï +.\" Dwayne Forsyth ¤Î½ñ¤¤¤¿¥É¥é¥¤¥Ð¤ò¤â¤È¤Ë¤·¤Æ +.\" Kai M\(:akisara (Kai.Makisara@metla.fi) ¤¬½ñ¤¤¤¿¡£ +.\" ¾¤Ë¤â²¿¿Í¤«¤Î¿Í¡¹¤¬¤³¤Î¥É¥é¥¤¥Ð¤Ë¹×¸¥¤·¤Æ¤­¤¿¡£ +.SH Ãí°Õ +.IP 1. 4 +°Û¤Ê¤ë¥·¥¹¥Æ¥à¤Ç¥Ç¡¼¥¿¤òÁê¸ß¤Ë¤ä¤ê¤È¤ê¤¹¤ë¾ì¹ç¡¢ +ξÊý¤Î¥·¥¹¥Æ¥à¤ÇʪÍýŪ¤Ê¥Æ¡¼¥×¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ò°ìÃפµ¤»¤ëɬÍפ¬¤¢¤ë¡£ +µ¯Æ°Ä¾¸å¤Î¥É¥é¥¤¥Ö¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢Âç¿¿ô¤Î OS ¤¬¤½¤Î¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ +ÍѤ¤¤Æ¤¤¤ëÃͤȰۤʤäƤ¤¤ë¤³¤È¤â¤è¤¯¤¢¤ë¡£Â¿¤¯¤Î¥·¥¹¥Æ¥à¤Ï¡¢ +¥É¥é¥¤¥Ö¤¬Âбþ¤·¤Æ¤¤¤ì¤Ð²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤òÍѤ¤¤ë¡£ DAT¡¢ +8mm ¥Ø¥ê¥«¥ë¥¹¥­¥ã¥ó¥É¥é¥¤¥Ö¡¢ DLT ¤Ê¤É¤ÎºÇ¶á¤Î¥É¥é¥¤¥Ö¤Î +¤Û¤È¤ó¤É¤Ï²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤ËÂбþ¤·¤Æ¤¤¤ë¤«¤é¡£ +¤³¤ì¤é¤Î¥É¥é¥¤¥Ö¤Ï (¾¯¤Ê¤¯¤È¤â¾¤Î¥·¥¹¥Æ¥à¤È¤Î¥Ç¡¼¥¿¸ò´¹¤¬ +¤¢¤ë¾ì¹ç¤Ï)¡¢ Linux ¤Ç¤â²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ç»È¤¦¤Û¤¦¤¬ +Îɤ¤¤«¤â¤·¤ì¤Ê¤¤ (¤Ä¤Þ¤ê¥·¥¹¥Æ¥à¤Îµ¯Æ°»þ¤Î¥â¡¼¥ÉÀßÄê¤Ë +.B MTSETBLK +¤Þ¤¿¤Ï +.B MTSETDEFBLK +¤òÍѤ¤¤ë)¡£ +·çÅÀ¤È¤·¤Æ¤Ï¡¢Èæ³ÓŪÂ礭¤Ê¥Æ¡¼¥×¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤òÍѤ¤¤Ê¤±¤ì¤Ð¡¢ +SCSI ¥Ð¥¹¾å¤ÇËþ­¤Î¤¤¤¯Å¾Á÷®ÅÙ¤¬ÆÀ¤é¤ì¤Ê¤¤¤³¤È¤Ç¤¢¤ë¡£ +.IP 2. +¿¤¯¤Î¥×¥í¥°¥é¥à +.RB ( tar (1) +¤Ê¤É) ¤Ç¤Ï¡¢ +¥³¥Þ¥ó¥É¥é¥¤¥ó¤«¤é¥æ¡¼¥¶¤¬¥Ö¥í¥Ã¥¯´ØÏ¢¤ÎÃͤò»ØÄê¤Ç¤­¤ë¡£ +¤³¤ÎÃͤˤè¤Ã¤Æ¥Æ¡¼¥×¾å¤ÎʪÍýŪ¤Ê¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤ò·èÄê¤Ç¤­¤ë¤Î¤Ï¡¢ +²ÄÊÑĹ¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ë¸Â¤é¤ì¤ë¤³¤È¤ËÃí°Õ¡£ +.IP 3. +SCSI ¥Æ¡¼¥×¥É¥é¥¤¥Ö¤òÍѤ¤¤ë¤Ë¤Ï¡¢´ðËܤΠSCSI ¥É¥é¥¤¥Ð¡¢ +SCSI ¥¢¥À¥×¥¿¤Î¥É¥é¥¤¥Ð¡¢ SCSI ¥Æ¡¼¥×¥É¥é¥¤¥Ð¤Î¤¹¤Ù¤Æ¤¬ +¥«¡¼¥Í¥ë¤ËÁȤ߹þ¤Þ¤ì¤Æ¤¤¤ë¤«¡¢¤¢¤ë¤¤¤Ï¥â¥¸¥å¡¼¥ë¤È¤·¤Æ¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë +ɬÍפ¬¤¢¤ë¡£ SCSI ¥Æ¡¼¥×¥É¥é¥¤¥Ð¤¬¤Ê¤¤¤È¡¢ +¥É¥é¥¤¥Ö¤Ïǧ¼±¤µ¤ì¤ë¤¬¡¢ +¤³¤Î¥Ú¡¼¥¸¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥Æ¡¼¥×¤Î¥µ¥Ý¡¼¥È¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +.IP 4. +¥É¥é¥¤¥Ð¤Ï¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò¥³¥ó¥½¡¼¥ë¤È¥í¥°¤È¤Ë½ñ¤­½Ð¤¹¡£ +¥«¡¼¥Í¥ëÀßÄê¤Ç verbose SCSI messages ¤¬Í­¸ú¤Ë¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +SENSE ¥³¡¼¥É¤¬¼«Æ°Åª¤Ë¥Æ¥­¥¹¥È¤ËÊÑ´¹¤µ¤ì¤Æ¡¢ +¤¤¤¯¤Ä¤«¤Î¥á¥Ã¥»¡¼¥¸¤Ë½ñ¤­¤À¤µ¤ì¤ë¡£ +.IP 5. +¤³¤Î¥É¥é¥¤¥Ð¤ÎÆâÉô¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤Ï¡¢¸ÇÄê¥Ö¥í¥Ã¥¯¥â¡¼¥É¤Ê¤é +.BR read (2) +¤ä +.BR write (2) +¤Î¥Ð¥¤¥È¿ô¤¬¾®¤µ¤¯¤Æ¤âÎɤ¤¥¹¥ë¡¼¥×¥Ã¥È¤ò½Ð¤¹¡£ +ľÀÜžÁ÷¤Ç¤Ï¤³¤ì¤ÏÉÔ²Äǽ¤Ê¤Î¤Ç¡¢2.6 ¥«¡¼¥Í¥ë¤Ë°Ü¹Ô¤·¤¿¤È¤­¤Ë¶Ã¤¯¤«¤â¤·¤ì¤Ê¤¤¡£ +²ò·èË¡¤È¤·¤Æ¤Ï¡¢¥½¥Õ¥È¥¦¥§¥¢¤Ë¤è¤êÂ礭¤ÊžÁ÷¤ò¹Ô¤¦¤è¤¦ÅÁ¤¨¤ë +(¤¿¤¤¤Æ¤¤¤Ï¤è¤êÂ礭¤Ê¥Ö¥í¥Ã¥¯¤ò»È¤ï¤»¤ë) ¤³¤È¤Ç¤¢¤ë¡£ +¤³¤ì¤¬ÉÔ²Äǽ¤Ê¤é¡¢Ä¾ÀÜžÁ÷¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.\" .SH Ãøºî¸¢ +.\" Copyright \(co 1995 Robert K. Nichols. +.\" .br +.\" Copyright \(co 1999-2005 Kai M\(:akisara. +.\" .PP +.\" 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. +.\" Additional permissions are contained in the header of the source file. +.SH ´ØÏ¢¹àÌÜ +.BR mt (1) +.PP +¥«¡¼¥Í¥ë¥½¡¼¥¹¤Î +.I drivers/scsi/README.st +¤ä +.I Documentation/scsi/st.txt +(¥«¡¼¥Í¥ë 2.6 °Ê¹ß) ¤Î³Æ¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢ +¥É¥é¥¤¥Ð¤Ë´Ø¤¹¤ë¤è¤ê¿·¤·¤¤¾ðÊó¤ä¡¢ +¤½¤ÎÀßÄê²Äǽ¤ÊÈϰϤ˴ؤ¹¤ëÆâÍƤ¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ diff --git a/release/man4/tty.4 b/release/man4/tty.4 new file mode 100644 index 00000000..43021f0c --- /dev/null +++ b/release/man4/tty.4 @@ -0,0 +1,88 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2003-04-07 by Michael Kerrisk +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Tue Feb 6 16:57:03 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" Modified Thu Feb 5 17:28:31 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated Fri Aug 16 00:04:53 JST 2002 +.\" by Akihiro MOTOKI +.\" +.\" WORD: terminal üËö +.\" WORD: process ¥×¥í¥»¥¹ +.\" WORD: controlling terminal À©¸æüËö +.\" WORD: file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\" +.TH TTY 4 2003-04-07 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +tty \- À©¸æüËö +.SH ÀâÌÀ +\fI/dev/tty\fP ¥Õ¥¡¥¤¥ë¤Ï¡¢¥á¥¸¥ã¡¼ÈÖ¹æ 5¡¢¥Þ¥¤¥Ê¡¼ÈÖ¹æ 0 ¤Î¥­¥ã¥é¥¯¥¿¡¼ +¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£Ä̾¤½¤Î¥â¡¼¥É¤Ï 0666¡¢¥ª¡¼¥Ê.¥°¥ë¡¼¥×¤Ï root.tty ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤¬Â¸ºß¤¹¤ë¾ì¹ç¡¢¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ï¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤È +Ʊ¤¸¤â¤Î¤òɽ¤¹¡£ +.LP +\fBtty\fP ¤¬»²¾È¤·¤Æ¤¤¤ë¥Ç¥Ð¥¤¥¹¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë +.BR ioctl (2) +Í×µá¤Ë +²Ã¤¨¤Æ¡¢ +.BR ioctl (2) +Í×µá \fBTIOCNOTTY\fP ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SS TIOCNOTTY +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ò¤½¤ÎÀ©¸æüËö¤«¤éÀÚ¤êÎ¥¤¹¡£ +.sp +¤½¤Î¥×¥í¥»¥¹¤¬¥»¥Ã¥·¥ç¥ó¡¦¥ê¡¼¥À¡¼ (session leader) ¤Î¾ì¹ç¡¢ +¥·¥°¥Ê¥ë +.B SIGHUP +¤È +.B SIGCONT +¤¬¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÁ÷¤é¤ì¡¢ +¥«¥ì¥ó¥È¡¦¥»¥Ã¥·¥ç¥ó¤Ë°¤¹Á´¤Æ¤Î¥×¥í¥»¥¹¤Ë¤Ä¤¤¤Æ³Æ¡¹¤ÎÀ©¸æüËö¤¬ÀÚ¤êÎ¥¤µ¤ì¤ë¡£ +.sp +¤³¤Î +.BR ioctl (2) +¸Æ¤Ó½Ð¤·¤Ï \fI/dev/tty\fP ¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¡¦ +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤Î¤ßºîÍѤ¹¤ë¡£¤³¤Îµ¡Ç½¤Ï¡¢¥æ¡¼¥¶¤Ë¤è¤Ã¤ÆüËö¤«¤é +µ¯Æ°¤µ¤ì¤¿¥Ç¡¼¥â¥ó¥×¥í¥»¥¹¤Ë¤è¤ê»ÈÍѤµ¤ì¤ë¡£ +¤½¤Î¥×¥í¥»¥¹¤Ï \fI/dev/tty\fP ¤ò¥ª¡¼¥×¥ó¤·¤è¤¦¤È»î¤ß¤ë¡£ +¥ª¡¼¥×¥ó¤ËÀ®¸ù¤¹¤ë¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Ï \fBTIOCNOTTY\fP ¤ò»È¤Ã¤Æ +¼«Ê¬¼«¿È¤òüËö¤«¤éÀÚ¤êÎ¥¤¹¡£¥ª¡¼¥×¥ó¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¤¬ +üËö¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤Ê¤¤¤Î¤ÏÌÀ¤é¤«¤Ç¤¢¤ê¡¢¼«¿È¤òüËö¤«¤éÀÚ¤êÎ¥¤¹ +ɬÍפϤʤ¤¡£ +.SH ¥Õ¥¡¥¤¥ë +/dev/tty +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR ioctl (2), +.BR termios (3), +.BR console (4), +.BR tty_ioctl (4), +.BR ttyS (4), +.BR agetty (8), +.BR mingetty (8) diff --git a/release/man4/ttyS.4 b/release/man4/ttyS.4 new file mode 100644 index 00000000..a8b61a8f --- /dev/null +++ b/release/man4/ttyS.4 @@ -0,0 +1,65 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:03:24 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Tue Feb 6 17:52:03 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Thu Feb 5 17:27:58 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: serial ¥·¥ê¥¢¥ë +.TH TTYS 4 1992-12-19 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ttyS \- ¥·¥ê¥¢¥ë¥¿¡¼¥ß¥Ê¥ë¥é¥¤¥ó(serial terminal lines) +.SH ÀâÌÀ +\fBttyS[0\-3]\fP ¤Ï¥·¥ê¥¢¥ë¥¿¡¼¥ß¥Ê¥ë¥é¥¤¥ó¤Î¤¿¤á¤Î¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹ +(character device)¤Ç¤¢¤ë¡£ +.LP +ŵ·¿Åª¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤é¤ì¤ë¡£: +.RS +.sp +mknod \-m 660 /dev/ttyS0 c 4 64 # base address 0x3f8 +.br +mknod \-m 660 /dev/ttyS1 c 4 65 # base address 0x2f8 +.br +mknod \-m 660 /dev/ttyS2 c 4 66 # base address 0x3e8 +.br +mknod \-m 660 /dev/ttyS3 c 4 67 # base address 0x2e8 +.br +chown root:tty /dev/ttyS[0\-3] +.RE +.SH ¥Õ¥¡¥¤¥ë +/dev/ttyS[0\-3] +.SH ´ØÏ¢¹àÌÜ +.BR chown (1), +.BR mknod (1), +.BR tty (4), +.BR agetty (8), +.BR mingetty (8), +.BR setserial (8) +.\" .SH ËÝÌõ¼Ô +.\" ÀÐÀî ËÓ diff --git a/release/man4/tty_ioctl.4 b/release/man4/tty_ioctl.4 new file mode 100644 index 00000000..22d2a84e --- /dev/null +++ b/release/man4/tty_ioctl.4 @@ -0,0 +1,506 @@ +.\" Copyright 2002 Walter Harms +.\" and Andries Brouwer . +.\" Distributed under GPL. +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Sat Oct 16 06:08:24 JST 2004 +.\" by Yuichi SATO +.\" +.TH TTY_IOCTL 4 2008-10-29 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +tty_ioctl \- üËö¤È¥·¥ê¥¢¥ë¥é¥¤¥ó¤Î ioctl (Æþ½ÐÎÏÀ©¸æ) +.SH ½ñ¼° +.B "#include " +.sp +.BI "int ioctl(int " fd ", int " cmd ", ...);" +.SH ÀâÌÀ +üËö¤È¥·¥ê¥¢¥ë¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¤Î +.BR ioctl () +¥³¡¼¥ë¤Ï¡¢Â¿¤¯¤Î¥³¥Þ¥ó¥É°ú¤­¿ô¤ò¼õ¤±ÉÕ¤±¤ë¡£ +¿¤¯¤¬¤¤¤í¤¤¤í¤Ê·¿¤Î 3 ÈÖÌܤΰú¤­¿ô¤òɬÍפȤ¹¤ë¡£ +¤³¤³¤Ç¤Ï \fIargp\fP ¤Þ¤¿¤Ï \fIarg\fP ¤È¸Æ¤Ö¡£ +.LP +.I ioctl +¤ò»ÈÍѤ¹¤ë¤È°Ü¿¢À­¤Î¤Ê¤¤¥×¥í¥°¥é¥à¤Ë¤Ê¤ë¡£ +²Äǽ¤Ê¾ì¹ç¤Ï¡¢ +.BR termios (3) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë POSIX ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò»È¤¦¤³¤È¡£ +.SS üËö°À­¤Î¼èÆÀ¤ÈÀßÄê +.TP +.BI "TCGETS struct termios *" argp +.I "tcgetattr(fd, argp)" +¤ÈƱ¤¸¡£ +.br +¸½ºß¤Î¥·¥ê¥¢¥ë¥Ý¡¼¥È¤ÎÀßÄê¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TCSETS const struct termios *" argp +.I "tcsetattr(fd, TCSANOW, argp)" +¤ÈƱ¤¸¡£ +.br +¸½ºß¤Î¥·¥ê¥¢¥ë¥Ý¡¼¥È¤ÎÀßÄê¤òÊѹ¹¤¹¤ë¡£ +.TP +.BI "TCSETSW const struct termios *" argp +.I "tcsetattr(fd, TCSADRAIN, argp)" +¤ÈƱ¤¸¡£ +.br +ÇӽР(drain) ¤ò¹Ô¤¦¤¿¤á¤Î½ÐÎϥХåե¡¤Î»ÈÍѤòµö²Ä¤·¡¢ +¸½ºß¤Î¥·¥ê¥¢¥ë¥Ý¡¼¥È¤ÎÀßÄê¤òÊѹ¹¤¹¤ë¡£ +.TP +.BI "TCSETSF const struct termios *" argp +.I "tcsetattr(fd, TCSAFLUSH, argp)" +¤ÈƱ¤¸¡£ +.br +ÇӽР(drain) ¤ò¹Ô¤¦¤¿¤á¤Î½ÐÎϥХåե¡¤Î»ÈÍѤòµö²Ä¤·¡¢ +½èÍý¤·¤Æ¤¤¤Ê¤¤ÆþÎϤòÇË´þ¤·¤Æ¡¢ +¸½ºß¤Î¥·¥ê¥¢¥ë¥Ý¡¼¥È¤ÎÀßÄê¤òÊѹ¹¤¹¤ë¡£ +.LP +°Ê²¼¤Î 4 ¤Ä¤Î ioctl ¤Ï +.BR TCGETS , +.BR TCSETS , +.BR TCSETSW , +.B TCSETSF +¤È»÷¤Æ¤¤¤ë¡£ +¤¿¤À¤·¡¢ +.I "struct termios *" +¤ÎÂå¤ï¤ê¤Ë +.I "struct termio *" +¤ò¼è¤ë¡£ +.TP +.BI "TCGETA struct termio *" argp +.TP +.BI "TCSETA const struct termio *" argp +.TP +.BI "TCSETAW const struct termio *" argp +.TP +.BI "TCSETAF const struct termio *" argp +.SS "termios ¹½Â¤ÂΤΥí¥Ã¥¯" +üËö¤Î +.I termios +¹½Â¤ÂΤϥí¥Ã¥¯¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¡£ +¤³¤Î¥í¥Ã¥¯¼«ÂÎ¤Ï +.I termios +¹½Â¤ÂΤǤ¢¤ê¡¢ +0 ¤Ç¤Ê¤¤¥Ó¥Ã¥È¤Þ¤¿¤Ï¥Õ¥£¡¼¥ë¥É¤Ï¥í¥Ã¥¯¤µ¤ì¤¿Ãͤò¼¨¤¹¡£ +.TP +.BI "TIOCGLCKTRMIOS struct termios *" argp +üËö¤Î +.I termios +¹½Â¤ÂΤΥí¥Ã¥¯¾õÂÖ¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCSLCKTRMIOS const struct termios *" argp +üËö¤Î +.I termios +¹½Â¤ÂΤΥí¥Ã¥¯¾õÂÖ¤òÀßÄꤹ¤ë¡£ +root ¤Î¤ß (¤è¤êÀµ³Î¤Ë¤Ï¡¢ +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤¬¤³¤ì¤ò¼Â¹Ô¤Ç¤­¤ë¡£ +.SS ¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤Î¼èÆÀ¤ÈÀßÄê +¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤Ï¥«¡¼¥Í¥ëÆâ¤ËÊÝ»ý¤µ¤ì¤ë¤¬¡¢ +¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤Ê¤¤ +(²¾ÁÛ¥³¥ó¥½¡¼¥ë¤Î¾ì¹ç¤ÏÎã³°¤Ç¤¢¤ê¡¢¿·¤·¤¤¥Õ¥©¥ó¥È¤òÆɤ߹þ¤ó¤À¾ì¹ç¤Ê¤É¡¢ +²¾ÁÛüËö¤Î¥µ¥¤¥º¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¡¢¥«¡¼¥Í¥ë¤Ï¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤ò¹¹¿·¤¹¤ë)¡£ + +°Ê²¼¤ÎÄê¿ô¤È¹½Â¤ÂÎ¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.BI "TIOCGWINSZ struct winsize *" argp +¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCSWINSZ const struct winsize *" argp +¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤òÀßÄꤹ¤ë¡£ +.LP +¤³¤ì¤é¤Î ioctl ¤Ç»ÈÍѤµ¤ì¤ë¹½Â¤ÂΤϡ¢°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ + +.in +4n +.nf +struct winsize { + unsigned short ws_row; + unsigned short ws_col; + unsigned short ws_xpixel; /* ̤»ÈÍÑ */ + unsigned short ws_ypixel; /* ̤»ÈÍÑ */ +}; +.fi +.in + +¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¡¢ +¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë +.B SIGWINCH +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +.SS "break ¤ÎÁ÷¿®" +.TP +.BI "TCSBRK int " arg +.I "tcsendbreak(fd, arg)" +¤ÈƱ¤¸¡£ +.br +üËö¤¬ÈóƱ´ü¥·¥ê¥¢¥ë¥Ç¡¼¥¿Å¾Á÷¤ò»ÈÍѤ·¤Æ¤ª¤ê¡¢ +.I arg +¤¬ 0 ¤Î¾ì¹ç¡¢0.25 ¤«¤é 0.5 ÉÃ¤Î´Ö¤Ë +break (0 ¤Î¥Ó¥Ã¥ÈÎó¤Î¥¹¥È¥ê¡¼¥à) ¤¬Á÷¿®¤µ¤ì¤ë¡£ +üËö¤¬ÈóƱ´ü¥·¥ê¥¢¥ë¥Ç¡¼¥¿Å¾Á÷¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢ +break ¤¬Á÷¿®¤µ¤ì¤ë¤«¡¢¤³¤Î´Ø¿ô¤Ï²¿¤â¤»¤º¤ËÊ֤롣 +.I arg +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢²¿¤¬µ¯¤³¤ë¤«Ê¬¤«¤é¤Ê¤¤¡£ + +(SVr4, UnixWare, Solaris, Linux ¤Ï¡¢ +.I "tcsendbreak(fd,arg)" +¤Î +.I arg +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢ +.I "tcdrain(fd)" +¤Î¤è¤¦¤Ë°·¤¦¡£ +SunOS ¤Ï +.I arg +¤òÇÜ¿ô¤È¤·¤Æ°·¤¤¡¢¥Ó¥Ã¥È¤Î¥¹¥È¥ê¡¼¥à¤ò +.I arg +²óÁ÷¿®¤¹¤ë¡£ +.I arg +¤¬ 0 ¤Î¾ì¹ç¤âƱ¤¸¡£ +DG/UX ¤È AIX ¤Ï¡¢(0 °Ê³°¤Î¾ì¹ç) +.I arg +¤ò¥ß¥êÉÃñ°Ì¤Î»þ´Ö´Ö³Ö¤È¤·¤Æ°·¤¦¡£ +HP-UX ¤Ï +.I arg +¤ò̵»ë¤¹¤ë¡£) +.TP +.BI "TCSBRKP int " arg +¤¤¤ï¤æ¤ë¡ÖPOSIX ÈǡפΠ+.B TCSBRK +¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï 0 °Ê³°¤Î +.I arg +¤ò 1/10 ÉÃñ°Ì¤Î»þ´Ö´Ö³Ö¤È¤·¤Æ°·¤¦¡£ +¤Þ¤¿¥É¥é¥¤¥Ð¤¬ break ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢²¿¤â¤·¤Ê¤¤¡£ +.TP +.B "TIOCSBRK void" +break ¤ò¥ª¥ó¤Ë¤¹¤ë¡£ +¤Ä¤Þ¤ê 0 ¤Î¥Ó¥Ã¥ÈÎó¤ÎÁ÷¿®¤ò³«»Ï¤¹¤ë¡£ +.TP +.B "TIOCCBRK void" +break ¤ò¥ª¥Õ¤Ë¤¹¤ë¡£ +¤Ä¤Þ¤ê 0 ¤Î¥Ó¥Ã¥ÈÎó¤ÎÁ÷¿®¤òÄä»ß¤¹¤ë¡£ +.SS ¥½¥Õ¥È¥¦¥§¥¢¥Õ¥í¡¼À©¸æ +.TP +.BI "TCXONC int " arg +.I "tcflow(fd, arg)" +¤ÈƱ¤¸¡£ +.br +.BR tcflow (3) +¤Î°ú¤­¿ô +.BR TCOOFF , +.BR TCOON , +.BR TCIOFF , +.B TCION +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SS "¥Ð¥Ã¥Õ¥¡¤Î¥«¥¦¥ó¥È¤È½ñ¤­½Ð¤· (flush)" +.TP +.BI "FIONREAD int *" argp +ÆþÎϥХåե¡¤Ë¤¢¤ë¥Ð¥¤¥È¿ô¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCINQ int *" argp +.B FIONREAD +¤ÈƱ¤¸¡£ +.TP +.BI "TIOCOUTQ int *" argp +½ÐÎϥХåե¡¤Ë¤¢¤ë¥Ð¥¤¥È¿ô¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TCFLSH int " arg +.I "tcflush(fd, arg)" +¤ÈƱ¤¸¡£ +.br +.BR tcflush (3) +¤Î°ú¤­¿ô +.BR TCIFLUSH , +.BR TCOFLUSH , +.B TCIOFLUSH +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SS ÆþÎϤε¶Áõ +.TP +.BI "TIOCSTI const char *" argp +»ØÄꤵ¤ì¤¿¥Ð¥¤¥È¤òÆþÎÏ¥­¥å¡¼¤ËÁÞÆþ¤¹¤ë¡£ +.SS ¥³¥ó¥½¡¼¥ë½ÐÎϤΥê¥À¥¤¥ì¥¯¥È +.TP +.B "TIOCCONS void" +.I /dev/console +¤Þ¤¿¤Ï +.I /dev/tty0 +¤ËÁ÷¤é¤ì¤ë½ÐÎϤò¡¢»ØÄꤵ¤ì¤¿Ã¼Ëö¥ê¥À¥¤¥ì¥¯¥È¤¹¤ë¡£ +»ØÄꤵ¤ì¤¿Ã¼Ëö¤¬µ¿»÷üËö (pseudo-terminal) ¤Î¥Þ¥¹¥¿¤Î¾ì¹ç¡¢ +½ÐÎϤϥ¹¥ì¡¼¥Ö¤ËÁ÷¤é¤ì¤ë¡£ +¥Ð¡¼¥¸¥ç¥ó 2.6.10 ¤è¤êÁ°¤Î Linux ¤Ç¤Ï¡¢½ÐÎϤ¬¤Þ¤À¥ê¥À¥¤¥ì¥¯¥È¤µ¤ì¤Æ +¤¤¤Ê¤±¤ì¤Ð¡¢Ã¯¤Ç¤â¥ê¥À¥¤¥ì¥¯¥È¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Ð¡¼¥¸¥ç¥ó 2.6.10 °Ê¹ß¤Ç¤Ï¡¢root +.RB ( CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤À¤±¤¬¥ê¥À¥¤¥ì¥¯¥È¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +½ÐÎϤ¬¤¹¤Ç¤Ë¥ê¥À¥¤¥ì¥¯¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï +.B EBUSY +¤¬ÊÖ¤µ¤ì¤ë¤¬¡¢ +.I /dev/console +¤« +.I /dev/tty0 +¤ò»Ø¤·¤Æ¤¤¤ë +.I fd +¤ËÂФ·¤Æ¤³¤Î ioctl ¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¡¢¥ê¥À¥¤¥ì¥¯¥È¤ò»ß¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SS "üËö¤ÎÀ©¸æ" +.TP +.BI "TIOCSCTTY int " arg +»ØÄꤵ¤ì¤¿Ã¼Ëö¤ò¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤Ë¤¹¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ï¥»¥Ã¥·¥ç¥ó¥ê¡¼¥À¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤«¤Ä´û¤ËÀ©¸æüËö¤ò»ý¤Ã¤Æ¤¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¤³¤ÎüËö¤¬´û¤Ë¾¤Î¥»¥Ã¥·¥ç¥ó¥°¥ë¡¼¥×¤ÎÀ©¸æüËö¤Ç¤¢¤ë¾ì¹ç¡¢ +ioctl ¤Ï +.B EPERM +¤Ç¼ºÇÔ¤¹¤ë¡£¤¿¤À¤·¸Æ¤Ó½Ð¤·¤¿¥æ¡¼¥¶¤¬ root ¤Ç +(¤è¤êÀµ³Î¤Ë¤Ï +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Æ)¡¢¤«¤Ä +.I arg +¤¬ 1 ¤Ç¤¢¤ë¾ì¹ç¤ò½ü¤¯¡£ +¤³¤Î¾ì¹ç¡¢Ã¼Ëö¤ÏÅð¤Þ¤ì (stolen)¡¢ +¤³¤ÎüËö¤òÀ©¸æüËö¤È¤·¤Æ¤¤¤¿Á´¤Æ¤Î¥×¥í¥»¥¹¤ÏüËö¤ò¼º¤¦¡£ +.TP +.B TIOCNOTTY void +»ØÄꤵ¤ì¤¿Ã¼Ëö¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤Ç¤¢¤ë¾ì¹ç¡¢ +¤³¤ÎÀ©¸æüËö¤òÊü´þ¤¹¤ë¡£ +¥×¥í¥»¥¹¤¬¥»¥Ã¥·¥ç¥ó¥ê¡¼¥À¤Î¾ì¹ç¡¢ +¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë +.B SIGHUP +¤È +.B SIGCONT +¤òÁ÷¤ê¡¢¥«¥ì¥ó¥È¥»¥Ã¥·¥ç¥ó¤ÎÁ´¤Æ¤Î¥×¥í¥»¥¹¤ÏÀ©¸æüËö¤ò¼º¤¦¡£ +.SS "¥°¥ë¡¼¥× ID ¤È¥»¥Ã¥·¥ç¥ó ID ¤Î½èÍý" +.TP +.BI "TIOCGPGRP pid_t *" argp +À®¸ù¤·¤¿¾ì¹ç¡¢ +.I "*argp = tcgetpgrp(fd)" +¤ÈƱ¤¸¡£ +.br +¤³¤ÎüËö¾å¤Î¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCSPGRP const pid_t *" argp +.I "tcsetpgrp(fd, *argp)" +¤ÈƱ¤¸¡£ +.br +¤³¤ÎüËö¤Î¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¥×¥í¥»¥¹¤Î¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë¡£ +.TP +.BI "TIOCGSID pid_t *" argp +»ØÄꤵ¤ì¤¿Ã¼Ëö¤Î¥»¥Ã¥·¥ç¥ó ID ¤ò¼èÆÀ¤¹¤ë¡£ +üËö¤¬¥Þ¥¹¥¿µ¿»÷üËö¤Þ¤¿¤ÏÀ©¸æüËö¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢ +.B ENOTTY +¤Ç¼ºÇÔ¤¹¤ë¡£ +´ñ̯¤À¡£ +.SS ÇÓ¾¥â¡¼¥É +.TP +.B "TIOCEXCL void" +üËö¤òÇÓ¾¥â¡¼¥É¤Ë¤¹¤ë¡£ +üËö¤ËÂФ·¤Æ¡¢¤³¤ì°Ê¹ß¤Î +.BR open (2) +Áàºî¤ò¶Ø»ß¤¹¤ë¡£ +(root °Ê³°¤Î¾ì¹ç¡¢¤Ä¤Þ¤ê +.B CAP_SYS_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹¤Î¾ì¹ç¡¢¤³¤ì°Ê¹ß¤Î +.BR open (2) +¤Ï +.B EBUSY +¤Ç¼ºÇÔ¤¹¤ë¡£) +.TP +.B "TIOCNXCL void" +ÇÓ¾¥â¡¼¥É¤ò̵¸ú¤Ë¤¹¤ë¡£ +.SS "¥é¥¤¥óÀ©¸æ (line discipline)" +.TP +.BI "TIOCGETD int *" argp +üËö¤Î¥é¥¤¥óÀ©¸æ¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCSETD const int *" argp +üËö¤Î¥é¥¤¥óÀ©¸æ¤Î¾ðÊó¤òÀßÄꤹ¤ë¡£ +.SS "µ¿»÷üËö¤Î ioctl" +.TP +.BI "TIOCPKT const int *" argp +¥Ñ¥±¥Ã¥È¥â¡¼¥É¤òÍ­¸ú +.RI (* argp +¤¬ 0 °Ê³°¤Î¾ì¹ç) ¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ +µ¿»÷üËö¤Î¥Þ¥¹¥¿Â¦¤Ë¤Î¤ßŬÍѤǤ­¤ë (¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï +.B ENOTTY +¤òÊÖ¤¹)¡£ +¥Ñ¥±¥Ã¥È¥â¡¼¥É¤Ç¤Ï¡¢¤½¤Î¸å¤Ë¼Â¹Ô¤µ¤ì¤ë +.BR read (2) +¤Ï¡¢Ãͤ¬ 0 °Ê³°¤Î 1 ¤Ä¤ÎÀ©¸æ¥Ð¥¤¥È¤ò´Þ¤à¥Ñ¥±¥Ã¥È¤«¡¢ +Ãͤ¬ 0 ¤Î 1 ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ëµ¿»÷üËö¤Î¥¹¥ì¡¼¥Ö¦¤Ç½ñ¤­¹þ¤Þ¤ì¤¿ +¥Ç¡¼¥¿¤¬Â³¤¯¥Ñ¥±¥Ã¥È¤òÊÖ¤¹¡£ +ºÇ½é¤Î¥Ð¥¤¥È¤¬ +.B TIOCPKT_DATA +(0) ¤Ç¤Ê¤¤¾ì¹ç¡¢°Ê²¼¤Î¥Ó¥Ã¥È¤Î 1 ¤Ä°Ê¾å¤ò OR ¤·¤¿¤â¤Î¤Ç¤¢¤ë: + +.nf +TIOCPKT_FLUSHREAD üËö¤ÎÆɤ߹þ¤ß¥­¥å¡¼¤¬¥Õ¥é¥Ã¥·¥å (flush) ¤µ¤ì¤ë¡£ +TIOCPKT_FLUSHWRITE üËö¤Î½ñ¤­½Ð¤·¥­¥å¡¼¤¬¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë¡£ +TIOCPKT_STOP üËö¤Ø¤Î½ÐÎϤ¬Ää»ß¤µ¤ì¤ë¡£ +TIOCPKT_START üËö¤Ø¤Î½ÐÎϤ¬ºÆ³«¤µ¤ì¤ë¡£ +TIOCPKT_DOSTOP ³«»Ïʸ»ú¤È½ªÎ»Ê¸»ú¤¬ \fB^S\fP/\fB^Q\fP ¤Ç¤¢¤ë¡£ +TIOCPKT_NOSTOP ³«»Ïʸ»ú¤È½ªÎ»Ê¸»ú¤¬ \fB^S\fP/\fB^Q\fP ¤Ç¤Ê¤¤¡£ +.fi + +¤³¤Î¥â¡¼¥É¤¬»È¤ï¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +À©¸æ¾õÂÖ¾ðÊó¤Î¸ºß¤¬¥Þ¥¹¥¿Â¦¤«¤éÆɤ߹þ¤á¤ë¤«¤Ï¡¢ +Î㳰Ū¤Ê¾ò·ï¤Ç +.BR select (2) +¤ò»È¤¦¤³¤È¤Ë¤è¤êÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ + +¤³¤Î¥â¡¼¥É¤Ï +.BR rlogin (1) +¤È +.BR rlogind (8) +¤Ç»È¤ï¤ì¡¢¥ê¥â¡¼¥È¥¨¥³¡¼¤Î¥ê¥â¡¼¥È¥í¥°¥¤¥ó¤È +¥í¡¼¥«¥ë¤Ç¤Î \fB^S\fP/\fB^Q\fP ¥Õ¥í¡¼À©¸æ¤Î¥ê¥â¡¼¥È¥í¥°¥¤¥ó¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£ + +BSD ¤Î ioctl ¤Ç¤¢¤ë +.BR TIOCSTOP , +.BR TIOCSTART , +.BR TIOCUCNTL , +.B TIOCREMOTE +¤Ï¡¢Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SS ¥â¥Ç¥àÀ©¸æ +.TP +.BI "TIOCMGET int *" argp +¥â¥Ç¥à¥Ó¥Ã¥ÈÎó¤Î¾õÂÖ¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCMSET const int *" argp +¥â¥Ç¥à¥Ó¥Ã¥ÈÎó¤Î¾õÂÖ¤òÀßÄꤹ¤ë¡£ +.TP +.BI "TIOCMBIC const int *" argp +»ØÄꤵ¤ì¤¿¥â¥Ç¥à¥Ó¥Ã¥ÈÎó¤ò¥¯¥ê¥¢¤¹¤ë¡£ +.TP +.BI "TIOCMBIS const int *" argp +»ØÄꤵ¤ì¤¿¥â¥Ç¥à¥Ó¥Ã¥ÈÎó¤òÀßÄꤹ¤ë¡£ +.LP +¤³¤ì¤é¤Î 4 ¤Ä¤Î ioctl ¤Ç»È¤ï¤ì¤ë¥Ó¥Ã¥È¤Ï°Ê²¼¤ÎÄ̤ê: + +.nf +TIOCM_LE DSR (data set ready/line enable) +TIOCM_DTR DTR (data terminal ready) +TIOCM_RTS RTS (request to send) +TIOCM_ST Secondary TXD (transmit) +TIOCM_SR Secondary RXD (receive) +TIOCM_CTS CTS (clear to send) +TIOCM_CAR DCD (data carrier detect) +TIOCM_CD TIOCM_CAR ¤ò»²¾È¡£ +TIOCM_RNG RNG (ring) +TIOCM_RI TIOCM_RNG ¤ò»²¾È¡£ +TIOCM_DSR DSR (data set ready) +.fi +.SS "²óÀþ¤ò¥í¡¼¥«¥ë¤È¤·¤Æ¥Þ¡¼¥¯¤¹¤ë" +.TP +.BI "TIOCGSOFTCAR int *" argp +("¥½¥Õ¥È¥¦¥§¥¢¥­¥ã¥ê¥¢¥Õ¥é¥°¤Î¼èÆÀ") +.I termios +¹½Â¤ÂΤΠc_cflag ¥Õ¥£¡¼¥ë¥É¤Î +.B CLOCAL +¥Õ¥é¥°¤Î¾õÂÖ¤ò¼èÆÀ¤¹¤ë¡£ +.TP +.BI "TIOCSSOFTCAR const int *" argp +("¥½¥Õ¥È¥¦¥§¥¢¥­¥ã¥ê¥¢¥Õ¥é¥°¤ÎÀßÄê") +.RI * argp +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢ +.I termios +¹½Â¤ÂΤΠ+.B CLOCAL +¥Õ¥é¥°¤òÀßÄꤹ¤ë¡£ +0 ¤Î¾ì¹ç¤Ï¥¯¥ê¥¢¤¹¤ë¡£ +.LP +¥é¥¤¥ó¤Î +.B CLOCAL +¥Õ¥é¥°¤¬¥ª¥Õ¤Î¾ì¹ç¡¢ +¥Ï¡¼¥É¥¦¥§¥¢¥­¥ã¥ê¥¢¸¡½Ð (hardware carrier detect, DCD) ¥·¥°¥Ê¥ë¤¬½ÅÍפǤ¢¤ê¡¢ +.B O_NONBLOCK +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Ê¤¤¸Â¤ê¡¢Âбþ¤¹¤ëüËö¤Î +.BR open (2) +¤Ï DCD ¤¬¼¨¤µ¤ì¤ë¤Þ¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¡£ +.B CLOCAL +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¥é¥¤¥ó¤Ï¾ï¤Ë DCD ¤¬¼¨¤µ¤ì¤Æ¤¤¤ë¤«¤Î¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ +¥½¥Õ¥È¥¦¥§¥¢¥­¥ã¥ê¥¢¥Õ¥é¥°¤Ï¡¢¥í¡¼¥«¥ë¥Ç¥Ð¥¤¥¹¤Ç¤ÏÄ̾ï¤Ï¥ª¥ó¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +¥â¥Ç¥à¤Î¥é¥¤¥ó¤Ç¤Ï¥ª¥Õ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SS "Linux ¸ÇÍ­¤Î ioctl" +.B TIOCLINUX +ioctl ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR console_ioctl (4) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SS ¥«¡¼¥Í¥ë¥Ç¥Ð¥Ã¥®¥ó¥° +.B "#include " +.TP +.BI "TIOCTTYGSTRUCT struct tty_struct *" argp +.I fd +¤ËÂбþ¤¹¤ë +.I tty_struct +¤ò¼èÆÀ¤¹¤ë¡£ +.\" .SS "¥·¥ê¥¢¥ë¾ðÊó" +.\" .BR "#include " +.\" .sp +.\" .TP +.\" .BI "TIOCGSERIAL struct serial_struct *" argp +.\" ¥·¥ê¥¢¥ë¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ +.\" .TP +.\" .BI "TIOCSSERIAL const struct serial_struct *" argp +.\" ¥·¥ê¥¢¥ë¾ðÊó¤òÀßÄꤹ¤ë¡£ +.SH ÊÖ¤êÃÍ +.BR ioctl () +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EINVAL +ÉÔÀµ¤Ê¥³¥Þ¥ó¥É°ú¤­¿ô¤Ç¤¢¤ë¡£ +.TP +.B ENOIOCTLCMD +ÉÔÌÀ¤Ê¥³¥Þ¥ó¥É¤Ç¤¢¤ë¡£ +.TP +.B ENOTTY +.I fd +¤¬ÉÔŬÀڤǤ¢¤ë¡£ +.TP +.B EPERM +¸¢¸Â¤¬ÉÔ­¤·¤Æ¤¤¤ë¡£ +.SH Îã +¥·¥ê¥¢¥ë¥Ý¡¼¥È¤Î DTR ¤Î¾õÂÖ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ + +.nf +#include +#include +#include + +int +main(void) +{ + int fd, serial; + + fd = open("/dev/ttyS0", O_RDONLY); + ioctl(fd, TIOCMGET, &serial); + if (serial & TIOCM_DTR) + puts("TIOCM_DTR ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£"); + else + puts("TIOCM_DTR ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¡£"); + close(fd); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR ioctl (2), +.BR termios (3), +.BR console_ioctl (4), +.BR pty (7) +.\" +.\" FIONBIO const int * +.\" FIONCLEX void +.\" FIOCLEX void +.\" FIOASYNC const int * +.\" serial.c ¤è¤ê: +.\" TIOCSERCONFIG void +.\" TIOCSERGWILD int * +.\" TIOCSERSWILD const int * +.\" TIOCSERGSTRUCT struct async_struct * +.\" TIOCSERGETLSR int * +.\" TIOCSERGETMULTI struct serial_multiport_struct * +.\" TIOCSERSETMULTI const struct serial_multiport_struct * +.\" TIOCGSERIAL, TIOCSSERIAL (¾åµ­¤ò»²¾È) diff --git a/release/man4/vcs.4 b/release/man4/vcs.4 new file mode 100644 index 00000000..319b3158 --- /dev/null +++ b/release/man4/vcs.4 @@ -0,0 +1,175 @@ +.\" Copyright (c) 1995 James R. Van Zandt +.\" Sat Feb 18 09:11:07 EST 1995 +.\" +.\" 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, Sun Feb 26 15:08:05 1995, faith@cs.unc.edu +.\" 2007-12-17, Samuel Thibault : +.\" document the VT_GETHIFONTMASK ioctl +.\" " +.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi +.\" all rights reserved. +.\" Translated Tue Feb 6 16:30:31 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Sun Jan 11 03:55:54 1998 +.\" by ISHIKAWA Mutsumi +.\" Updated Sat Feb 10 23:17:30 JST 2001 +.\" by Yuichi SATO +.\" Updated 2008-02-12, Akihiro MOTOKI , LDP v2.77 +.\" +.\" WORD: virtual console ²¾ÁÛ¥³¥ó¥½¡¼¥ë +.\" WORD: memory ¥á¥â¥ê +.\" WORD: permission ¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó +.\" WORD: prefix ¥×¥ì¥Õ¥£¥Ã¥¯¥¹ +.\" WORD: screen ¥¹¥¯¥ê¡¼¥ó +.\" WORD: cursor ¥«¡¼¥½¥ë +.\" WORD: Braille ¥Ö¥é¥¤¥æÅÀ»ú +.\" +.TH VCS 4 2007-12-17 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +vcs, vcsa \- ²¾ÁÛ¥³¥ó¥½¡¼¥ë¥á¥â¥ê (virtual console memory) +.SH ÀâÌÀ +\fI/dev/vcs0\fP ¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ (major number) 7¡¢¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ +(minor number) 0 ¤Î¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹ (character device) ¤Ç¡¢ +Ä̾¤½¤Î¥â¡¼¥É¤Ï 0644¡¢¥ª¡¼¥Ê¤Ï root.tty ¤Ç¤¢¤ë¡£ +¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë (device file) ¤Ï +¸½ºßɽ¼¨¤µ¤ì¤Æ¤¤¤ë²¾ÁÛ¥³¥ó¥½¡¼¥ëüËö¤Î¥á¥â¥ê¤ò»²¾È¤¹¤ë¡£ +.LP +\fB/dev/vcs[1\-63]\fP ¤Ï²¾ÁÛ¥³¥ó¥½¡¼¥ëüËö¤Î¤¿¤á¤Î +¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹¤Ç¡¢¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼¤¬ 7¡¢¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼¤¬ 1 ¤«¤é 63¡¢ +Ä̾ï¤Ï¥â¡¼¥É¤¬ 0644¡¢¥ª¡¼¥Ê¡¼¤¬ root.tty ¤Ç¤¢¤ë¡£ +\fB/dev/vcsa[0\-63]\fP ¤Ï \fB/dev/vcs[1\-63]\fP ¤ÈƱÍͤǤ¢¤ë¤¬¡¢ +°À­¤ò³ÊǼ¤¹¤ë¤Î¤Ë (¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¤Î) +.I "unsigned short" +¤ò»ÈÍѤ·¤Æ¤¤¤ëÅÀ¡¢¥¹¥¯¥ê¡¼¥ó¤Î¥µ¥¤¥º¡¦¥«¡¼¥½¥ë¤Î°ÌÃÖ¤òɽ¤¹ +4 ¥Ð¥¤¥È¤Î¾ðÊó +\fIlines\fP, \fIcolumns\fP, \fIx\fP, \fIy\fP +(\fIx\fP =\fIy\fP = 0 ¤¬²èÌ̤κ¸¾å) ¤¬ÀèƬ¤Ë¤¢¤ëÅÀ¤¬°Û¤Ê¤ë¡£ + +512 ʸ»ú¤«¤éÀ®¤ë¥Õ¥©¥ó¥È¤ò¥í¡¼¥É¤·¤¿¾ì¹ç¡¢ +9 ¥Ó¥Ã¥ÈÌܤξðÊó¤Ï \fI/dev/tty[1\-63]\fP ¤ËÂФ·¤Æ +.BR ioctl (2) +\fBVT_GETHIFONTMASK\fP Áàºî¤ò¹Ô¤¦¤³¤È¤Ç¼èÆÀ¤Ç¤­¤ë +(\fBVT_GETHIFONTMASK\fP Áàºî¤Ï¥«¡¼¥Í¥ë 2.6.18 °Ê¹ß¤Î Linux ¤Ç +ÍøÍѲÄǽ¤Ç¤¢¤ë)¡£ +ÃÍ¤Ï +.BR ioctl (2) +¤Î 3 ÈÖÌܤΰú¤­¿ô¤¬»Ø¤¹ +.I "unsigned short" +¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£ +.PP +¤³¤ì¤é¤Î¥Ç¥Ð¥¤¥¹¤Ï +.BR console (4) +¤Î screendump +.BR ioctl (2) +¤òÂåÂؤȤʤ롣 +½¾¤Ã¤Æ¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó +(filesystem permission) ¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤ò¥³¥ó¥È¥í¡¼¥ë¤Ç¤­¤ë¡£ +.PP +ºÇ½é¤Î 8 ¤Ä¤Î²¾ÁÛüËö¤Î¤¿¤á¤Î¥Ç¥Ð¥¤¥¹¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤ë»ö¤¬¤Ç¤­¤ë: + +.nf + for x in 0 1 2 3 4 5 6 7 8; do + mknod \-m 644 /dev/vcs$x c 7 $x; + mknod \-m 644 /dev/vcsa$x c 7 $[$x+128]; + done + chown root:tty /dev/vcs* +.fi + +.BR ioctl (2) +¤Ë¤è¤ëÍ×µá¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +/dev/vcs[0\-63] +.br +/dev/vcsa[0\-63] +.\" .SH Ãø¼Ô +.\" Andries Brouwer +.SH ¥Ð¡¼¥¸¥ç¥ó +Linux ¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó 1.1.92 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.SH Îã +vt3 ¤Î¥¹¥¯¥ê¡¼¥ó¥À¥ó¥×¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢Ã¼Ëö¤ò vt1 ¤ËÀÚÂؤ¨¤Æ +\fIcat /dev/vcs3 >foo\fP ¤È¥¿¥¤¥×¤¹¤ì¤Ð¤è¤¤¡£ +µ¤¤òÉÕ¤±¤ÆÍߤ·¤¤¤Î¤Ï¡¢¤³¤Î½ÐÎϤϲþ¹Ôʸ»ú (newline character) ¤ò +´Þ¤ó¤Ç¤¤¤Ê¤¤¤È¤¤¤¦»ö¤Ç¤¢¤ë¡£ +½¾¤Ã¤Æ¡¢\fIfold \-w 81 /dev/vcs3 | lpr\fP ¤ä +(¤¾¤Ã¤È¤¹¤ë¤¬) \fIsetterm \-dump 3 \-file /proc/self/fd/1\fP ¤Î¤è¤¦¤Ê +²¿¤é¤«¤Î½èÍý¤¬É¬Íפˤʤ뤫¤â¤·¤ì¤Ê¤¤¡£ +.LP +\fI/dev/vcsa0\fP ¥Ç¥Ð¥¤¥¹¤ò»È¤¦¤³¤È¤Ç¡¢ +¥Ö¥é¥¤¥æÅÀ»ú¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +°Ê²¼¤Î¥×¥í¥°¥é¥à¤ÏÆó¤ÄÌܤβ¾ÁÛ¥³¥ó¥½¡¼¥ë¤Î¥«¡¼¥½¥ë°ÌÃ֤Υ¹¥¯¥ê¡¼¥ó°À­¤Èʸ»ú +¤òɽ¼¨¤·¤¿¸å¡¢¥«¡¼¥½¥ë°ÌÃÖ¤ÎÇØ·Ê¿§¤òÊѹ¹¤¹¤ë : + +.nf +#include +#include +#include +#include +#include +#include + +int +main(void) +{ + int fd; + char *device = "/dev/vcsa2"; + char *console = "/dev/tty2"; + struct {unsigned char lines, cols, x, y;} scrn; + unsigned short s; + unsigned short mask; + unsigned char ch, attrib; + + fd = open(console, O_RDWR); + if (fd < 0) { + perror(console); + exit(EXIT_FAILURE); + } + if (ioctl(fd, VT_GETHIFONTMASK, &mask) < 0) { + perror("VT_GETHIFONTMASK"); + exit(EXIT_FAILURE); + } + (void) close(fd); + fd = open(device, O_RDWR); + if (fd < 0) { + perror(device); + exit(EXIT_FAILURE); + } + (void) read(fd, &scrn, 4); + (void) lseek(fd, 4 + 2*(scrn.y*scrn.cols + scrn.x), 0); + (void) read(fd, &s, 2); + ch = s & 0xff; + if (attrib & mask) + ch |= 0x100; + attrib = ((s & ~mask) >> 8); + printf("ch=\(aq%c\(aq attrib=0x%02x\\n", ch, attrib); + attrib ^= 0x10; + (void) lseek(fd, \-1, 1); + (void) write(fd, &attrib, 1); + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR console (4), +.BR tty (4), +.BR ttyS (4), +.BR gpm (8) diff --git a/release/man4/wavelan.4 b/release/man4/wavelan.4 new file mode 100644 index 00000000..25bbabe5 --- /dev/null +++ b/release/man4/wavelan.4 @@ -0,0 +1,138 @@ +.\" From jt@hplb.hpl.hp.com Thu Dec 19 18:31:49 1996 +.\" From: Jean Tourrilhes +.\" Address: HP Labs, Filton Road, Stoke Gifford, Bristol BS12 6QZ, U.K. +.\" Jean II - HPLB - '96 +.\" wavelan.c.4 +.\" +.\" Provenance of this page is unclear. Licensed under the GPL, +.\" after inquiries with Jean Tourrilhes and Bruce Janson +.\" (mtk, July 2006) +.\" +.\" Japanese Version Copyright (c) 1997 +.\" ISHIKAWA Mutsumi, all rights reserved. +.\" Translated Sat Sep 20 14:45:21 JST 1997 +.\" by ISHIKAWA Mutsumi +.\" +.\" Japanese Version Last Modified Tue Feb 10 15:21:08 JST 1998 +.\" by ISHIKAWA Mutsumi +.\" +.\" WORD: wireless ethernet ¥ï¥¤¥¢¥ì¥¹¥¤¡¼¥µ¥Í¥Ã¥È +.\" +.TH WAVELAN 4 1996-10-22 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +wavelan \- AT&T GIS WaveLAN ISA ¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð +.SH ½ñ¼° +.BI "insmod wavelan_cs.o [io=" B,B.. "] [ irq=" I,I.. "] [name=" N,N.. ] +.SH ÀâÌÀ +.I wavelan +¤Ï¡¢NCR / AT&T / Lucent ¤Î +.B WaveLan ISA +¤È Digital(DEC) ¤Î +.B RoamAbout DS +¤È¤¤¤¦¥ï¥¤¥¢¥ì¥¹¡¦¥¤¡¼¥µ¥Í¥Ã¥È (wireless ethernet) ¥¢¥À¥×¥¿¤Î¤¿¤á¤Î +¥í¡¼¥ì¥Ù¥ë¡¦¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ç¤¢¤ë¡£¤³¤Î¥É¥é¥¤¥Ð¤Ï¥â¥¸¥å¡¼¥ë¤È¤·¤Æ¤â¡¢¤Þ¤¿¡¢ +¥«¡¼¥Í¥ë¤ËÁȤ߹þ¤ó¤À·Á¤Ç¤âÍøÍѤǤ­¤ë¡£¤Þ¤¿¡¢¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢Ê£¿ô¥«¡¼¥É +(ºÇÂç 4 Ëç¤Þ¤Ç) ¤ò¥µ¥Ý¡¼¥È¤·¡¢ÌÀ¼¨Åª¤Ë¥Ç¥Ð¥¤¥¹¤Î̾Á°¤ò»ØÄꤷ¤Ê¤¤¸Â¤ê +(¤³¤ì¤Ë´Ø¤·¤Æ¤Ï¡¢²¼¤ò¸«¤è)¡¢È¯¸«¤µ¤ì¤¿¤½¤ì¤¾¤ì¤Î¥«¡¼¥É¤Ë¤Ï¡¢ÍøÍѲÄǽ¤Ê +¼¡¤Î¥¤¡¼¥µ¥Í¥Ã¥È¥Ç¥Ð¥¤¥¹(eth0..eth#)¤¬³ä¤êÅö¤Æ¤é¤ì¤ë¡£¤³¤Î¥Ç¥Ð¥¤¥¹Ì¾¤Ï +MAC ¥¢¥É¥ì¥¹¡¢NWID¡¢¥«¡¼¥É¤Ë¤è¤Ã¤ÆÍøÍѤµ¤ì¤ë¼þÇÈ¿ô¤È¤È¤â¤Ë +¥«¡¼¥Í¥ë¥í¥°¥Õ¥¡¥¤¥ë¤ËÊó¹ð¤µ¤ì¤ë¡£ +.SS °ú¿ô +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤Ï¡¢¥â¥¸¥å¡¼¥ë¤È¤·¤Æ»ÈÍѤ¹¤ë¾ì¹ç +¤ËŬÍѤµ¤ì¡¢ +.BR insmod (8) +¤Î¥³¥Þ¥ó¥É¡¦¥é¥¤¥ó°ú¤­¿ô¤È¤·¤ÆÍѤ¤¤ë¡£ +¥«¡¼¥Í¥ë¤Ë¥É¥é¥¤¥Ð¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.I ether=IRQ,IO,NAME +¤È¤¤¤¦·Á¼°¤Î¥Ñ¥é¥á¡¼¥¿¤ò¥«¡¼¥Í¥ë¡¦¥³¥Þ¥ó¥É¥é¥¤¥ó¤ËÅϤ¹¡£ +.TP +.B io +wavelan ¥«¡¼¥É¤ò¸¡½Ð¤¹¤ë»þ¤Ë¤É¤³¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹¤ò¥µ¡¼¥Á¤¹¤ë¤«¤È¤¤¤¦ +¥ê¥¹¥È¤ò»ØÄꤹ¤ë (¥«¡¼¥É¤¬ÍøÍѤ¹¤ë¥Ù¡¼¥¹¥¢¥É¥ì¥¹¤Ï¥«¡¼¥É¤Î¥Ç¥£¥Ã¥× +¥¹¥¤¥Ã¥Á¤ÇÀßÄꤹ¤ë)¡£¤â¤· io ¥¢¥É¥ì¥¹¤¬»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¥É¥é¥¤¥Ð¤Ï 0x390 ¤È +0x3E0 ¤ò¥¹¥­¥ã¥ó¤¹¤ë(¤³¤Î¥¢¥É¥ì¥¹¤Ï¾¤Î¥Ï¡¼¥É¤È¾×Æͤ¹¤ë¤³¤È¤â¹Í¤¨¤é¤ì¤ë)¡£ +.TP +.B irq +¤½¤ì¤¾¤ì¤Î wavelan ¥«¡¼¥É¤¬ÍøÍѤ¹¤ë irq ¤Î¥ê¥¹¥È¤ò¥»¥Ã¥È¤¹¤ë (¤³¤ÎÃÍ¤Ï +¾­ÍèŪ¤ÊÍøÍѤΤ¿¤á¤Ë¥Ñ¡¼¥Þ¥Í¥ó¥È¡¦¥¹¥È¥ì¡¼¥¸¤ËÊݸ¤µ¤ì¤ë)¡£ +.TP +.B name +¤½¤ì¤¾¤ì¤Î wavelan ¥«¡¼¥É¥Ç¥Ð¥¤¥¹¤Ë +.RB ( ifconfig (8) +¤¬ÍøÍѤ¹¤ë)̾Á°¤Î¥ê¥¹¥È¤ò¥»¥Ã¥È¤¹¤ë¡£ +.SS "¥ï¥¤¥¢¥ì¥¹³ÈÄ¥ (Wireless Extentions)" +¥ï¥¤¥¢¥ì¥¹³ÈÄ¥¤ÎÁàºî¤Ë¤Ï +.BR iwconfig (8) +¤ò»È¤¦¡£ +.SS NWID (or ¥É¥á¥¤¥ó) +¥Í¥Ã¥È¥ï¡¼¥¯ ID¤ò +.RI [ 0 +¤«¤é +.IR FFFF ] +¤ËÀßÄꤹ¤ë¤«¡¢ +.RI [ off ] +¤½¤ÎÍøÍѤò̵¸ú¤Ë¤¹¤ë¡£ +NWID ¤Ï¥«¡¼¥É¤Î¥Ñ¡¼¥Þ¥Í¥ó¥È¡¦¥¹¥È¥ì¡¼¥¸¥¨¥ê¥¢ (Permanent Strage Area) ¤Ë +³ÊǼ¤µ¤ì¤ë¤Î¤Ç¡¢NWID ¤Ï¥É¥é¥¤¥Ð¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤¿¤Ó¤ËÍøÍѤǤ­¤ë¡£ +.SS ¼þÇÈ¿ô¤È¥Á¥ã¥Í¥ë +2.4GHz 2.00 ¥Ï¡¼¥É¥¦¥§¥¢¤Ç¤Ï¡¢10 ¤ÎÄêµÁºÑ¤ß¤Î¥Á¥ã¥Í¥ë +.RI ( 2.412 +.I 2.422, 2.425, 2.4305, 2.432, 2.442, 2.452, 2.460, 2.462 +.IR 2.484 ) +¤Î¤¦¤Á¤Î°ì¤Ä¤ò»ØÄꤹ¤ë¤«¡¢¤½¤ÎÃͤòľÀÜ»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤Æ¼þÇÈ¿ô¤òÀßÄê +¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¼þÇÈ¿ô¤Ïľ¸å¤ËÊѹ¹¤µ¤ì¡¢¤Þ¤¿¡¢¤½¤ÎÊѹ¹¤Ï¹±µ×Ū¤Ç¤¢¤ë¡£ +¤É¤Î¼þÇÈ¿ô¤¬ÍøÍѤǤ­¤ë¤«¤È¤¤¤¦¤³¤È¤Ï¡¢(¤½¤Î¹ñ¤Î) ˡΧ¤Ë°Í¸¤¹¤ë¡Ä +.SS Åý·×¥¹¥Ñ¥¤ (Statics spy) +(8 ¤Ä¤Þ¤Ç¤Î) MAC ¥¢¥É¥ì¥¹¤Î¥ê¥¹¥È¤ò¥É¥é¥¤¥Ð¤ËÀßÄꤷ¤Æ¡¢ +¤½¤ì¤¾¤ì¤Î¥ê¥ó¥¯¤ÎÉʼÁ¤òÆÀ¤ë +.RB ( iwspy (8) +¤ò»²¾È)¡£ +.SS /proc/net/wireless +.I status +¤Ï¥â¥Ç¥à¤«¤éÊó¹ð¤µ¤ì¤¿¥¹¥Æ¡¼¥¿¥¹¤Ç¤¢¤ë¡£ +.I link quality +¤ÏÄÌ¿®Ãæ¤Î(ľÀܳȻ¶¥¹¥Ú¥¯¥È¥é¥àÄÌ¿®Êý¼°¤Ë¤ª¤±¤ë)ÊÑÄ´¤ÎÉʼÁ¤òÊó¹ð¤¹¤ë +[ºÇÂç = 16]¡£ +.I Level +¤È +.I Noise +¤Ï¿®¹æ¥ì¥Ù¥ë¤È¥Î¥¤¥º¤Î¥ì¥Ù¥ë¤ò»²¾È¤¹¤ë [ºÇÂç = 64]¡£ +.I °Å¹æ²½¤µ¤ì¤Æ¤¤¤ÆÇÑ´þ¤µ¤ì¤¿¥Ñ¥±¥Ã¥È(crypt discarded packet) +¤È +.I ¤½¤ì°Ê³°¤ÎÇÑ´þ¤µ¤ì¤¿¥Ñ¥±¥Ã¥È(misc discarded packet) +¤Î¥«¥¦¥ó¥¿¡¼¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SS "¥É¥é¥¤¥Ð¸ÇÍ­¤ÎIOCTL (Private Ioctl)" +.BR iwpriv (8) +¤ò¥É¥é¥¤¥Ð¸ÇÍ­¤Î ioctl ¤ÎÁàºî¤Î¤¿¤á¤ËÍøÍѤǤ­¤ë¡£ +.SS ÉʼÁ¤È¥ì¥Ù¥ë¤ÎïçÃÍ (Quality and Level threshold) +¥â¥Ç¥à¤Ç»È¤ï¤ì¤ëÉʼÁ¤È¥ì¥Ù¥ë¤ÎïçÃÍ (¤½¤Î¥ì¥Ù¥ë¤ò²¼²ó¤Ã¤¿¥Ñ¥±¥Ã¥È¤Ï +ÇË´þ¤µ¤ì¤ë) ¤òÄêµÁ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SS ¥Ò¥¹¥È¥°¥é¥à (Histogram) +¤³¤Îµ¡Ç½¤Ï¥·¥°¥Ê¥ë¥ì¥Ù¥ë´Ö³Ö¤Î¿ô¤ÎÀßÄê¡¢¤ª¤è¤Ó¡¢¤½¤ì¤é¤ÎÀßÄꤷ¤¿´Ö³Ö¤Î +¤½¤ì¤¾¤ì¤Ç¼õ¿®¤·¤¿¥Ñ¥±¥Ã¥È¤Î¿ô¤ò¥«¥¦¥ó¥È¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£ +¤³¤ÎʬÉۤϥ·¥°¥Ê¥ë¥ì¥Ù¥ë¤ÎºÇÉÎÃÍɸ½àÊк¹¤Î·×»»¤ËÌòΩ¤Ä¤À¤í¤¦¡£ +.SS ÆÃÄê¤Î¥É¥é¥¤¥Ð¤Ç¤ÎÃí°Õ +¤³¤Î¥É¥é¥¤¥Ð¤Ï¤¤¤¯¤Ä¤«¤Î +.B NCR/AT&T/Lucent ¤Ç¤Ï¤Ê¤¤ +Wavelan ¥«¡¼¥É¤Î¸¡½Ð¤Ë¼ºÇÔ¤¹¤ë¤À¤í¤¦¡£ +¤³¤ì¤¬¤¢¤Ê¤¿¤Î»ý¤Ã¤Æ¤¤¤ë¥«¡¼¥É¤Çµ¯¤³¤Ã¤¿¾ì¹ç +¡¢¤½¤Î¥«¡¼¥É¤Î¸¡½Ð½èÍý¤ò¤É¤Î¤è¤¦¤Ë²Ã¤¨¤ì¤Ð¤¤¤¤¤«¤È +¤¤¤¦¤³¤È¤Ë¤Ä¤¤¤Æ¥½¡¼¥¹¥³¡¼¥É¤ò³Îǧ¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.PP +¤³¤³¤Þ¤Ç¤Ç½Ò¤Ù¤Æ¤­¤¿µ¡Ç½¤Î¤¦¤Á¤Î¤¤¤¯¤Ä¤«¤Ï¡¢ÁªÂò²Äǽ¤Ç¤¢¤ë¡£ +¥É¥é¥¤¥Ð¤ÎÀèƬÉôʬ¤Î¥Õ¥é¥°¤òÊѹ¹¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤Ê¤ª¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¢ +¤½¤Îµ¡Ç½¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¢¤ë¡£ +.SH Ãø¼Ô +.\" Bruce Janson \(em bruce@cs.usyd.edu.au +.\" .br +.\" Jean Tourrilhes \(em jt@hplb.hpl.hp.com +.\" .br +.\" (¤ª¤è¤Ó¡¢¤½¤Î¾¤Î¿Íã; ¾ÜºÙ¤Ï¥½¡¼¥¹¥³¡¼¥É¤ò»²¾È¤Î¤³¤È) +.SH ´ØÏ¢¹àÌÜ +.BR wavelan_cs (4), +.BR ifconfig (8), +.BR insmod (8), +.BR iwconfig (8), +.BR iwpriv (8), +.BR iwspy (8) diff --git a/release/man5/acct.5 b/release/man5/acct.5 new file mode 100644 index 00000000..4f5c3dca --- /dev/null +++ b/release/man5/acct.5 @@ -0,0 +1,181 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-10, Akihiro MOTOKI , LDP v3.05 +.\" +.\"WORD: accounting ¥¢¥«¥¦¥ó¥Æ¥£¥ó¥° +.\" +.TH ACCT 5 2008-06-15 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +acct \- ¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¡¦¥Õ¥¡¥¤¥ë +.SH ½ñ¼° +.B #include +.SH ÀâÌÀ +¥«¡¼¥Í¥ë¤¬¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤Î¥ª¥×¥·¥ç¥ó +.RB ( CONFIG_BSD_PROCESS_ACCT ) +¤òÍ­¸ú¤Ë¤·¤ÆºîÀ®¤µ¤ì¤Æ¤¤¤ë¤È¡¢°Ê²¼¤Î¤è¤¦¤Ë +.BR acct (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤¬³«»Ï¤µ¤ì¤ë¡£ + +.in +4n + acct("/var/log/pacct"); +.in + +¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï +¥·¥¹¥Æ¥à¾å¤Î³Æ¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤¿¤Ó¤Ë¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤Ë +¥ì¥³¡¼¥É¤ò½ñ¤­¹þ¤à¡£ +¤³¤Î¥ì¥³¡¼¥É¤Ï¡¢½ªÎ»¤·¤¿¥×¥í¥»¥¹¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë¤â¤Î¤Ç¡¢ +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +.in +4n +.nf +#define ACCT_COMM 16 + +typedef u_int16_t comp_t; + +struct acct { + char ac_flag; /* Accounting flags */ + u_int16_t ac_uid; /* Accounting user ID */ + u_int16_t ac_gid; /* Accounting group ID */ + u_int16_t ac_tty; /* Controlling terminal */ + u_int32_t ac_btime; /* Process creation time + (seconds since the Epoch) */ + comp_t ac_utime; /* User CPU time */ + comp_t ac_stime; /* System CPU time */ + comp_t ac_etime; /* Elapsed time */ + comp_t ac_mem; /* Average memory usage (kB) */ + comp_t ac_io; /* Characters transferred (unused) */ + comp_t ac_rw; /* Blocks read or written (unused) */ + comp_t ac_minflt; /* Minor page faults */ + comp_t ac_majflt; /* Major page faults */ + comp_t ac_swaps; /* Number of swaps (unused) */ + u_int32_t ac_exitcode; /* Process termination status + (see wait(2)) */ + char ac_comm[ACCT_COMM+1]; + /* Command name (basename of last + executed command; null-terminated) */ + char ac_pad[\fIX\fP]; /* padding bytes */ +}; + +enum { /* Bits that may be set in ac_flag field */ + AFORK = 0x01, /* Has executed fork, but no exec */ + ASU = 0x02, /* Used superuser privileges */ + ACORE = 0x08, /* Dumped core */ + AXSIG = 0x10 /* Killed by a signal */ +}; +.fi +.in +.PP +¥Ç¡¼¥¿·¿ +.I comp_t +¤ÏÉâÆ°¾®¿ôÅÀÃͤǡ¢3 ¥Ó¥Ã¥ÈÉý¤Î´ð¿ô¤¬ 8 ¤Î»Ø¿ôÉô¤È 13 ¥Ó¥Ã¥ÈÉý¤Î²¾¿ôÉô¤«¤é +¹½À®¤µ¤ì¤ë¡£ +.I comp_t +·¿¤ÎÃÍ +.I c +¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ (long ·¿¤Î) À°¿ô¤ËÊÑ´¹¤Ç¤­¤ë¡£ +.nf + + v = (c & 0x1fff) << (((c >> 13) & 0x7) * 3); +.fi +.PP +¥Õ¥£¡¼¥ë¥É +.IR ac_utime , +.IR ac_stime , +.I ac_etime +¤Ï "clock ticks" ñ°Ì¤Ç·×¬¤·¤¿»þ´Ö¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤ÎÃͤò +.I sysconf(_SC_CLK_TCK) +¤Ç³ä¤ë¤È¡¢ÉäËÊÑ´¹¤Ç¤­¤ë¡£ +.SS ¥Ð¡¼¥¸¥ç¥ó 3 ¤Î¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +¥«¡¼¥Í¥ë 2.6.8 °Ê¹ß¤Ç¤Ï¡¢ +Ê̤ΥС¼¥¸¥ç¥ó¤Î¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤òÀ¸À®¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢ +¤³¤ì¤ò»È¤¦¤Ë¤Ï¥«¡¼¥Í¥ë¹½ÃÛ»þ¤Ë +.B CONFIG_BSD_PROCESS_ACCT_V3 +¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤ë¤È¡¢¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤ë +¥ì¥³¡¼¥É¤Ë¥Õ¥£¡¼¥ë¥É¤¬Äɲ䵤ì¤ë¡£ +¤Þ¤¿¡¢¥Õ¥£¡¼¥ë¥É +.I c_uid +¤È +.I ac_gid +¤ÎÉý¤¬ 16 ¥Ó¥Ã¥È¤«¤é 32 ¥Ó¥Ã¥È¤Ë³ÈÄ¥¤µ¤ì¤ë +(¤³¤ì¤Ï Linux 2.4 °Ê¹ß¤Ç UID ¤È GID ¤Î¥µ¥¤¥º¤¬Áý¤¨¤Æ¤¤¤ë¤Î¤Ë +Âбþ¤·¤¿¤â¤Î¤Ç¤¢¤ë)¡£ +¤³¤Î¥ì¥³¡¼¥É¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct acct_v3 { + char ac_flag; /* Flags */ + char ac_version; /* Always set to ACCT_VERSION (3) */ + u_int16_t ac_tty; /* Controlling terminal */ + u_int32_t ac_exitcode; /* Process termination status */ + u_int32_t ac_uid; /* Real user ID */ + u_int32_t ac_gid; /* Real group ID */ + u_int32_t ac_pid; /* Process ID */ + u_int32_t ac_ppid; /* Parent process ID */ + u_int32_t ac_btime; /* Process creation time */ + float ac_etime; /* Elapsed time */ + comp_t ac_utime; /* User CPU time */ + comp_t ac_stime; /* System time */ + comp_t ac_mem; /* Average memory usage (kB) */ + comp_t ac_io; /* Characters transferred (unused) */ + comp_t ac_rw; /* Blocks read or written + (unused) */ + comp_t ac_minflt; /* Minor page faults */ + comp_t ac_majflt; /* Major page faults */ + comp_t ac_swaps; /* Number of swaps (unused) */ + char ac_comm[ACCT_COMM]; /* Command name */ +}; + +.fi +.in +.SH ¥Ð¡¼¥¸¥ç¥ó +.I acct_v3 +¹½Â¤ÂΤϥС¼¥¸¥ç¥ó 2.6 °Ê¹ß¤Î glibc ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ½àµò +¥×¥í¥»¥¹¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤Ï BSD ͳÍè¤Ç¤¢¤ë¡£ +¤³¤Îµ¡Ç½¤Ï¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¤¬¡¢É¸½à²½¤µ¤ì¤Æ¤ª¤é¤º¡¢ +¤½¤Î¾ÜºÙ¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤ê¤¤¤¯¤é¤«°Û¤Ê¤ë¡£ +.SH Ãí°Õ +¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤Î¥ì¥³¡¼¥É¤Ï¡¢¥×¥í¥»¥¹¤Î½ªÎ»»þ¹ï¤Î½ç½ø¤È¤Ê¤ë¡£ + +¥Ð¡¼¥¸¥ç¥ó 2.6.9 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +NPTL ¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥¹¥ì¥Ã¥É¤Ç¤Ï +¥¹¥ì¥Ã¥ÉËè¤ËÊÌ¡¹¤Î¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥ì¥³¡¼¥É¤¬½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤¿¡£ +Linux 2.6.10 °Ê¹ß¤Ç¤Ï¡¢¥×¥í¥»¥¹Æâ¤ÎºÇ¸å¤Î¥¹¥ì¥Ã¥É¤¬½ªÎ»¤¹¤ë¤È¡¢ +¥×¥í¥»¥¹Á´ÂΤˤĤ¤¤Æ¤Î¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥ì¥³¡¼¥É¤¬°ì¤Ä¤À¤±½ñ¤­¹þ¤Þ¤ì¤ë¡£ + +.I proc/sys/kernel/acct +¥Õ¥¡¥¤¥ë +.RB ( proc (5) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë) ¤Ï¡¢¥Ç¥£¥¹¥¯ÍÆÎ̤λĤ꤬¾¯¤Ê¤¯¤Ê¤Ã¤¿ºÝ¤Î +¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤ÎÆ°ºî¤òÀ©¸æ¤¹¤ëÀßÄê¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR lastcomm (1), +.BR acct (2), +.BR accton (8), +.BR sa (8) diff --git a/release/man5/charmap.5 b/release/man5/charmap.5 new file mode 100644 index 00000000..df206f7e --- /dev/null +++ b/release/man5/charmap.5 @@ -0,0 +1,124 @@ +.\" Hey emacs, this is -*- nroff -*- +.\" +.\" This file is part of locale(1) which displays the settings of the +.\" current locale. +.\" Copyright (C) 1994 Jochen Hein (Hein@Student.TU-Clausthal.de) +.\" +.\" 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, USA. +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Thu Feb 5 21:12:56 JST 1998 +.\" by HANATAKA Shinya +.\" Updated Wed Jan 9 JST 2001 by Kentaro Shirakata +.\" +.TH CHARMAP 5 1994-11-28 "" "Linux User Manual" +.SH ̾Á° +charmap \- ʸ»úÉä¹æ²½¤òÄêµÁ¤¹¤ë¤¿¤á¤Îʸ»ú¥·¥ó¥Ü¥ë +.SH ½ñ¼° +ʸ»ú½¸¹çµ­½Ò (charmap) ¤Ï»ÈÍѤǤ­¤ëʸ»ú½¸¹ç¤È¤½¤ÎÉä¹æ²½¤òÄêµÁ¤¹¤ë¡£ +¥µ¥Ý¡¼¥È¤µ¤ì¤ëÁ´¤Æ¤Îʸ»ú½¸¹ç¤ÏÂÅÅö¤Ê¥µ¥Ö¥»¥Ã¥È¤È¤·¤Æ +.B "¶¦ÄÌʸ»ú½¸¹ç (portable character set)" +¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" °Ê²¼¤Ï¤â¤Ï¤äÀµ¤·¤¯¤Ê¤¤: +.\" ¶¦ÄÌʸ»ú½¸¹ç¤Ï»²¾ÈÍÑ¤Ë +.\" .I /usr/lib/nls/charmap/POSIX +.\" .I /usr/share/i18n/charmap/POSIX +.\" ¥Õ¥¡¥¤¥ë¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SS ʸˡ +charmap ¥Õ¥¡¥¤¥ë¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤«¤é¤Ê¤ë¥Ø¥Ã¥À¡¼¤Ç»Ï¤Þ¤ë: +.TP +.I +¤Ï¥³¡¼¥É¥»¥Ã¥È¤Î̾Á°¤ò»ØÄꤹ¤ë¡£ +.TP +.I +¤ÏÊ£¿ô¥Ð¥¤¥Èʸ»ú¤Î°ìʸ»ú¤¢¤¿¤ê¤ÎºÇÂç¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£ +Ê£¿ô¥Ð¥¤¥Èʸ»ú¤Ï¸½ºß¤Î¤È¤³¤í¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£¥Ç¥Õ¥©¥ë¥È¤Ï 1 ¤Ç¤¢¤ë¡£ +.TP +.I +¤Ï°ìʸ»ú¤¢¤¿¤ê¤ÎºÇÄã¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£¤³¤ÎÃÍ¤Ï +.B mb_cur_max +°Ê²¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤â¤·»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¥Ç¥Õ¥©¥ë¥È¤Ï +.B mb_cur_max +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.TP +.I +¥Õ¥¡¥¤¥ë¤Î»Ä¤ê¤ÎÉôʬ¤Ç¥¨¥¹¥±¡¼¥×¡¦¥­¥ã¥é¥¯¥¿¡¼¤È¤·¤Æ»ÈÍѤ¹¤ëʸ»ú +¤ò»ØÄꤹ¤ë¡£¤³¤ì¤ÇÆüì¤Ê°ÕÌ£¤Ë²ò¼á¤µ¤ì¤ëʸ»ú¤ò¥¨¥¹¥±¡¼¥×¤¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å +.RB ( \e ) +¤Ç¤¢¤ë¡£ +.TP +.I +¤Ï¥Õ¥¡¥¤¥ë¤Î»Ä¤ê¤ÎÉôʬ¤Ç¥³¥á¥ó¥È¡¦¥­¥ã¥é¥¯¥¿¡¼¤È¤·¤Æ»ÈÍѤ¹¤ëʸ»ú +¤ò»ØÄꤹ¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥·¥ã¡¼¥× +.RB ( # ) +¤Ç¤¢¤ë¡£ +.PP +charmap ¤ÎÄêµÁ¤½¤Î¤â¤Î¤ÏÂè°ì¥«¥é¥à¤Ë¥­¡¼¥ï¡¼¥É +.B CHARMAP +¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +°Ê²¼¤Î¹Ô¤Ïʸ»ú¤ÎÉä¹æ²½¤òÄêµÁ¤¹¤ë¤¿¤á¤ÎÆó¤Ä¤ÎÊýË¡¤Ç¤¢¤ë: +.TP +.I +¤³¤ì¤Ï°ì¤Ä¤Îʸ»ú¤È¤½¤ÎÉä¹æ²½¤òÄêµÁ¤¹¤ë¡£ +.TP +.I ... +¤³¤Î·Á¼°¤ÏÊ£¿ô¤Îʸ»ú¤òÄêµÁ¤¹¤ë¡£¤³¤ì¤ÏÊ£¿ô¥Ð¥¤¥Èʸ»ú (¸½ºß¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +¤Î¤ß¤ÇÍ­ÍѤǤ¢¤ë¡£ +.PP +charmap ¤ÎÄêµÁ¤ÎºÇ¸å¤Î¹Ô¤Ï +.B END CHARMAP +¤òÃÖ¤¯¡£ +.SS ¥·¥ó¥Ü¥ë̾ +ʸ»ú¤Î +.B ¥·¥ó¥Ü¥ë̾ (symbolic name) +¤Ï +.B ¶¦ÄÌʸ»ú½¸¹ç(portable character set) +¤Îʸ»ú¤Î¤ß¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +¤³¤Î̾Á°¤Ï¤«¤®¤«¤Ã¤³ < > ¤Ç¶´¤à¡£ +.B +¤Ë³¤¯Ê¸»ú¤Ï¤½¤ì¼«¿È¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£Î㤨¤Ð +.B "<\e\e\e>>" +¤Î¤è¤¦¤Êʸ»úÎó¤Ï +.B "\e>" +¤È¤¤¤¦¥·¥ó¥Ü¥ë̾¤ò¤«¤®¤«¤Ã¤³¤Ç¶¹¤ó¤Çɽ¸½¤·¤Æ¤¤¤ë¡£ +.SS ʸ»úÉä¹æ²½ +Éä¹æ²½¤Ï°Ê²¼¤Î»°¤Ä¤Î·Á¼°¤Î¤É¤ì¤«¤Çɽ¤¹: +.TP +.I d<¿ô»ú> +¤Ï 10 ¿Ê¤Î¿ôÃͤòɽ¤¹¡£ +.TP +.I x<¿ô»ú> +¤Ï 16 ¿Ê¤Î¿ôÃͤòɽ¤¹¡£ +.TP +.I <¿ô»ú> +¤Ï 8 ¿Ê¤Î¿ôÃͤòɽ¤¹¡£ +.\" FIXME comments +.\" FIXME char ... char +.SH ¥Õ¥¡¥¤¥ë +.I /usr/share/i18n/charmaps/* +.\" .SH Ãø¼Ô +.\" Jochen Hein (jochen.hein@delphi.central.de) +.SH ½àµò +POSIX.2. +.SH ´ØÏ¢¹àÌÜ +.BR locale (1), +.BR localedef (1), +.BR localeconv (3), +.BR setlocale (3), +.BR locale (5) diff --git a/release/man5/core.5 b/release/man5/core.5 new file mode 100644 index 00000000..314ec20a --- /dev/null +++ b/release/man5/core.5 @@ -0,0 +1,394 @@ +.\" Copyright (c) 2006, 2008 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. +.\" +.\" Japanese Version Copyright (c) 2006-2008 Akihiro MOTOKI +.\" Translated 2006-04-15, Akihiro MOTOKI +.\" Updated 2007-01-05, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2007-09-03, Akihiro MOTOKI, LDP v2.64 +.\" Updated 2008-08-10, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-09-19, Akihiro MOTOKI, LDP v3.08 +.\" +.TH CORE 5 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +core \- ¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë +.SH ÀâÌÀ +¤¢¤ë¼ï¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±¤¿¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥¢¥¯¥·¥ç¥ó¤Ï¡¢ +¥×¥í¥»¥¹¤ò½ªÎ»¤· (terminate)¡¢ +.I "¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë (core dump file)" +¤òÀ¸À®¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Ï¡¢¥Ç¥£¥¹¥¯¾å¤ËÀ¸À®¤µ¤ì¤ë +½ªÎ»»þ¤Î¥×¥í¥»¥¹¤Î¥á¥â¥ê¥¤¥á¡¼¥¸¤òÆâÍƤȤ¹¤ë¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +¤³¤Î¥¤¥á¡¼¥¸¤ò¥Ç¥Ð¥Ã¥¬ (Î㤨¤Ð +.BR gdb (1)) +¤ËÆɤ߹þ¤ó¤Ç¡¢ +¥×¥í¥°¥é¥à¤¬½ªÎ»¤·¤¿»þÅÀ¤Î¥×¥í¥°¥é¥à¤Î¾õÂÖ¤ò¸¡ºº¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤É¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±¤¿¤È¤­¤Ë¥×¥í¥»¥¹¤¬¥³¥¢¥À¥ó¥×¤òÀ¸À®¤¹¤ë¤«¤Î¥ê¥¹¥È¤Ï +.BR signal (7) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ + +¥×¥í¥»¥¹¤Ï¥½¥Õ¥È¡¦¥ê¥½¡¼¥¹À©¸Â +.B RLIMIT_CORE +¤òÀßÄꤹ¤ë¤³¤È¤Ç¡¢¡Ö¥³¥¢¥À¥ó¥×¡×¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤¿ºÝ¤ËÀ¸À®¤µ¤ì¤ë +¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤Ë¾å¸Â¤ò²Ý¤¹¤³¤È¤¬¤Ç¤­¤ë¡£¾ÜºÙ¤Ï +.BR getrlimit (2) +¤ò»²¾È¡£ + +¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤¬À¸À®¤µ¤ì¤Ê¤¤¾õ¶·¤¬¤¤¤¯¤Ä¤«¤¢¤ë: +.IP * 3 +¥×¥í¥»¥¹¤¬¥³¥¢¥Õ¥¡¥¤¥ë¤ò½ñ¤­¹þ¤àµö²Ä¤ò»ý¤¿¤Ê¤¤¾ì¹ç +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥³¥¢¥Õ¥¡¥¤¥ë¤Ï +.I core +¤È¤¤¤¦Ì¾Á°¤Ç¡¢¥«¥ì¥ó¥È¡¦¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ËÀ¸À®¤µ¤ì¤ë¡£ +̿̾µ¬Â§¤Î¾ÜºÙ¤Ï²¼µ­¤ò»²¾È)¡£ +¥³¥¢¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤è¤¦¤È¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬½ñ¤­¹þ¤ß²Äǽ¤Ç¤Ê¤¤¾ì¹ç¡¢ +¤â¤·¤¯¤ÏƱ¤¸Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬½ñ¤­¹þ¤ß²Äǽ¤Ç¤â +Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤â¤Ê¤¤¾ì¹ç (Î㤨¤Ð¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ä¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯)¡¢ +¥³¥¢¥Õ¥¡¥¤¥ë¤ÎÀ¸À®¤Ï¼ºÇÔ¤¹¤ë¡£ +.IP * +¥³¥¢¥À¥ó¥×¤Ë»È¤ª¤¦¤È¤·¤¿¤Î¤ÈƱ¤¸Ì¾Á°¤Î (½ñ¤­¹þ¤ß²Äǽ¤Ê¡¢Ä̾ï¤Î) ¥Õ¥¡¥¤¥ë¤¬ +¤¹¤Ç¤Ë¸ºß¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥Ï¡¼¥É¥ê¥ó¥¯¤¬ 2¸Ä°Ê¾å¤¢¤ë¾ì¹ç¡£ +.IP * +¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤è¤¦¤È¤·¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Õ¥ë¤Ç¤¢¤ë¤«¡¢ +inode ¤¬Á´¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤ë¤«¡¢Æɤ߹þ¤ßÀìÍѤǥޥ¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡£ +¤Þ¤¿¤Ï¡¢¤½¤Î¥æ¡¼¥¶¤Î¥Ç¥£¥¹¥¯»ÈÍÑÎ̤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î +¥¯¥ª¡¼¥¿ (quota) ¤Ë㤷¤Æ¤¤¤ë¡£ +.IP * +¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤è¤¦¤È¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡£ +.IP * +¥×¥í¥»¥¹Ëè¤Î¥ê¥½¡¼¥¹À©¸Â +.B RLIMIT_CORE +(¥³¥¢¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º) ¤« +.B RLIMIT_FSIZE +(¥Õ¥¡¥¤¥ë¥µ¥¤¥º) ¤¬ 0 ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡£ +.BR getrlimit (2) +¤ä¥·¥§¥ë¤Î +.I ulimit +¥³¥Þ¥ó¥É¤Î¥É¥­¥å¥á¥ó¥È +.RB ( csh (1) +¤Î +.IR limit ) +¤ò»²¾È¡£ +.IP * +¥×¥í¥»¥¹¤¬¼Â¹Ô¤·¤¿¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë¤ÎÆɤ߽Ф·µö²Ä¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡£ +.IP * +¥×¥í¥»¥¹¤¬¼Â¹Ô¤·¤Æ¤¤¤ë set-user-ID (set-group-ID) ¥×¥í¥°¥é¥à¤Î½êÍ­¼Ô¤Î +¥æ¡¼¥¶ (¥°¥ë¡¼¥×) ¤¬¡¢¥×¥í¥»¥¹¤Î¼Â UID (¼Â GID) ¤È°Û¤Ê¤ë¾ì¹ç +(⤷¡¢ +.BR prctl (2) +.B PR_SET_DUMPABLE +Áàºî¤ÎÀâÌÀ¤È¡¢ +.BR proc (5) +¤Î +.I /proc/sys/fs/suid_dumpable +¥Õ¥¡¥¤¥ë¤ÎÀâÌÀ¤â»²¾È¤Î¤³¤È)¡£ +.\" FIXME . Perhaps relocate discussion of /proc/sys/fs/suid_dumpable +.\" and PR_SET_DUMPABLE to this page? +.SS ¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î̾Á° +.\" motoki XXX Ʊ¤¸ÆâÍƤ¬½ÅÊ£¤·¤Æ½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î̾Á°¤Ï +.I core +¤È¤Ê¤ë¤¬¡¢¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î̾Á°¤ò·è¤á¤ë¤Î¤Ë»È¤ï¤ì¤ë¥Æ¥ó¥×¥ì¡¼¥È¤ò +.I /proc/sys/kernel/core_pattern +¥Õ¥¡¥¤¥ë¤ËÄêµÁ¤¹¤ë¤³¤È¤Ç¡¢¥Õ¥¡¥¤¥ë̾¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.RI ( /proc/sys/kernel/core_pattern +¤Ï Linux 2.6 ¤ª¤è¤Ó 2.4.21 °Ê¹ß¤ÇÍøÍѤǤ­¤ë)¡£ +¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤Ï % »Ø¼¨»Ò (specifier) ¤òÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ï¥³¥¢¥Õ¥¡¥¤¥ë¤¬À¸À®¤µ¤ì¤ëºÝ¤Ë¡¢°Ê²¼¤ÎÃͤËÃÖ¤­´¹¤¨¤é¤ì¤ë¡£ +.PP +.RS 4 +.PD 0 +.TP 4 +%% +1 ¤Ä¤Î % ʸ»ú +.TP +%p +¥À¥ó¥×¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ID (PID) +.TP +%u +¥À¥ó¥×¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID (real UID) +.TP +%g +¥À¥ó¥×¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¼Â¥°¥ë¡¼¥× ID (real GID) +.TP +%s +¥À¥ó¥×¤ò°ú¤­µ¯¤³¤·¤¿¥·¥°¥Ê¥ë¤ÎÈÖ¹æ +.TP +%t +¥À¥ó¥×»þ¹ï¡¢µª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) +¤«¤é¤ÎÉÿô¡£ +.TP +%h +¥Û¥¹¥È̾ (\fBuname\fP(2) ¤ÇÊÖ¤µ¤ì¤ë \fInodename\fP ¤ÈƱ¤¸) +.TP +%e +¼Â¹Ô¥Õ¥¡¥¤¥ë̾ (¥Ñ¥¹Ì¾¤Î¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤Ï´Þ¤Þ¤ì¤Ê¤¤) +.TP +%c +¥¯¥é¥Ã¥·¥å¤·¤¿¥×¥í¥»¥¹¤Î¥³¥¢¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤Ë´Ø¤¹¤ë¥½¥Õ¥È¥ê¥½¡¼¥¹¾å¸Â +(Linux 2.6.24 °Ê¹ß) +.PD +.RE +.PP +¥Æ¥ó¥×¥ì¡¼¥È¤ÎËöÈø¤Ë 1 ¸Ä¤À¤± % ¤¬¤¢¤ë¾ì¹ç¡¢ +¤½¤Î % ¤Ï¥³¥¢¥Õ¥¡¥¤¥ë̾¤Ë¤Ï´Þ¤á¤é¤ì¤Ê¤¤¡£¤Þ¤¿¡¢¾å¤ÇÎóµó¤µ¤ì¤Æ +¤¤¤Ê¤¤ % ¤Èʸ»ú¤ÎÁȤ߹ç¤ï¤»¤¬¤¢¤Ã¤¿¾ì¹ç¤âƱÍͤǤ¢¤ë¡£ +¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤ª¤±¤ë¾¤Îʸ»ú¤Ï¡¢ +¥³¥¢¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ¤½¤Î¤Þ¤Þ»È¤ï¤ì¤ë¡£ +¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤Ï \(aq/\(aq ʸ»ú¤òÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¡¢ +¥Ç¥£¥ì¥¯¥È¥ê̾¤Î¶èÀÚ¤êʸ»ú¤È²ò¼á¤µ¤ì¤ë¡£ +·ë²Ì¤È¤·¤ÆÀ¸À®¤µ¤ì¤ë¥³¥¢¥Õ¥¡¥¤¥ë̾¤ÎºÇÂ祵¥¤¥º¤Ï 128 ¥Ð¥¤¥È¤Ç¤¢¤ë +(2.6.19 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï 64 ¥Ð¥¤¥È)¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï "core" ¤Ç¤¢¤ë¡£ +°ÊÁ°¤Î¤â¤Î¤È¤Î¸ß´¹À­¤Î¤¿¤á¡¢ +.I /proc/sys/kernel/core_pattern +¤Ë "%p" ¤¬´Þ¤Þ¤ì¤º¡¢ +¤«¤Ä +.I /proc/sys/kernel/core_uses_pid +(²¼µ­»²¾È) ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢.PID ¤¬¥³¥¢¥Õ¥¡¥¤¥ë̾¤ËÄɲ䵤ì¤ë¡£ + +¥Ð¡¼¥¸¥ç¥ó 2.4 °Ê¹ß¤Î Linux ¤Ç¤Ï +¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î̾Á°¤òÀ©¸æ¤¹¤ë¸¶»ÏŪ¤ÊÊýË¡¤âÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.I /proc/sys/kernel/core_uses_pid +¥Õ¥¡¥¤¥ë¤ËÃÍ 0 ¤¬½ñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Ïñ½ã¤Ë +.I core +¤È¤¤¤¦Ì¾Á°¤Ë¤Ê¤ë¡£¤³¤Î¥Õ¥¡¥¤¥ë¤Ë 0 °Ê³°¤ÎÃͤ¬½ñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Ï +.I core.PID +¤È¤¤¤¦·Á¼°¤Î̾Á°¤Ë¤Ê¤ê¡¢¥Õ¥¡¥¤¥ë̾¤Ë¥×¥í¥»¥¹ ID ¤¬´Þ¤Þ¤ì¤ë¡£ +.SS ¥³¥¢¥À¥ó¥×¤Î¥×¥í¥°¥é¥à¤Ø¤Î¥Ñ¥¤¥× +¥«¡¼¥Í¥ë 2.6.19 °Ê¹ß¤Ç¤Ï¡¢Linux ¤Ï +.I /proc/sys/kernel/core_pattern +¥Õ¥¡¥¤¥ë¤ÎÊ̤ι½Ê¸¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤ÎºÇ½é¤Îʸ»ú¤¬¥Ñ¥¤¥×µ­¹æ (\fB|\fP) ¤Ç¤¢¤ì¤Ð¡¢ +¤½¤Î¹Ô¤Î»Ä¤ê¤ÎÉôʬ¤Ï¼Â¹Ô¤¹¤ë¥×¥í¥°¥é¥à¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +¥³¥¢¥À¥ó¥×¤Ï¡¢¥Ç¥£¥¹¥¯¾å¤Î¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¥×¥í¥°¥é¥à¤Îɸ½àÆþÎϤȤ·¤ÆÅϤµ¤ì¤ë¡£ +°Ê²¼¤ÎÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.IP * 3 +¥×¥í¥°¥é¥à¤ÏÀäÂХѥ¹Ì¾ (¤â¤·¤¯¤Ï¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê \fI/\fP ¤«¤é¤Î +ÁêÂХѥ¹Ì¾) ¤Ç»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤Þ¤¿¡¢'|' ʸ»ú¤Îľ¸å¤«¤é»Ï¤á¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP * +¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤ËÀ¸À®¤µ¤ì¤ë¥×¥í¥»¥¹¤Ï¡¢ +¥æ¡¼¥¶¡¢¥°¥ë¡¼¥×¤È¤â +.I root +¤È¤·¤Æ¼Â¹Ô¤µ¤ì¤ë¡£ +.IP * +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ò¥×¥í¥°¥é¥à¤ËÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­ (¥«¡¼¥Í¥ë 2.6.24 °Ê¹ß)¡¢ +°ú¤­¿ô¤Ï¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤Ç¶èÀÚ¤ë +(1¹Ô¤ÎºÇÂçĹ¤Ï 128 ¥Ð¥¤¥È¤¬¾å¸Â¤Ç¤¢¤ë)¡£ +.IP * +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ë¤Ï¡¢¾åµ­¤Î¥ê¥¹¥È¤Ë¤¢¤ë % »Ø¼¨»Ò¤ò´Þ¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Î㤨¤Ð¡¢¥À¥ó¥×¤µ¤ì¤ë¥×¥í¥»¥¹¤Î PID ¤òÅϤ¹¤Ë¤Ï¡¢ +°ú¤­¿ô¤Ë +.I %p +¤ò»ØÄꤹ¤ë¡£ +.SS ¤É¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¥³¥¢¥À¥ó¥×¤Ë½ñ¤­¹þ¤à¤«¤òÀ©¸æ¤¹¤ë +¥«¡¼¥Í¥ë 2.6.23 °Ê¹ß¤Ç¤Ï¡¢Linux ¸ÇÍ­¤Î¥Õ¥¡¥¤¥ë +.I /proc/PID/coredump_filter +¤ò»È¤Ã¤Æ¡¢Âбþ¤¹¤ë¥×¥í¥»¥¹ ID ¤ò»ý¤Ä¥×¥í¥»¥¹¤ËÂФ·¤Æ¥³¥¢¥À¥ó¥×¤¬¹Ô¤ï¤ì¤ë +ºÝ¤Ë¡¢¤É¤Î¥á¥â¥ê¥»¥°¥á¥ó¥È¤ò¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à¤«¤òÀ©¸æ¤Ç¤­¤ë¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÃͤϥá¥â¥ê¥Þ¥Ã¥Ô¥ó¥°¼ïÊÌ +.RB ( mmap (2) +»²¾È) ¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +¥Þ¥¹¥¯Æâ¤Î¤¢¤ë¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢¤½¤Î¥Ó¥Ã¥È¤ËÂбþ¤¹¤ë¼ïÊ̤Π+¥á¥â¥ê¥Þ¥Ã¥Ô¥ó¥°¤¬¥À¥ó¥×¤µ¤ì¤ë¡£¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤Ï¥À¥ó¥×¤µ¤ì¤Ê¤¤¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î³Æ¥Ó¥Ã¥È¤Ï°Ê²¼¤Î°ÕÌ£¤ò»ý¤Ä¡£ +.PP +.PD 0 +.RS 4 +.TP +bit 0 +̵̾¤Î¥×¥é¥¤¥Ù¡¼¥È¥Þ¥Ã¥Ô¥ó¥° (anonymous private mappings) ¤ò¥À¥ó¥×¤¹¤ë¡£ +.TP +bit 1 +̵̾¤Î¶¦Í­¥Þ¥Ã¥Ô¥ó¥° (anonymous shared mappings) ¤ò¥À¥ó¥×¤¹¤ë¡£ +.TP +bit 2 +¥Õ¥¡¥¤¥ë¤È´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥×¥é¥¤¥Ù¡¼¥È¥Þ¥Ã¥Ô¥ó¥° +(file-backed private mappings) ¤ò¥À¥ó¥×¤¹¤ë¡£ +.TP +bit 3 +¥Õ¥¡¥¤¥ë¤È´ØÏ¢ÉÕ¤±¤é¤ì¤¿¶¦Í­¥Þ¥Ã¥Ô¥ó¥° +(file-backed shared mappings) ¤ò¥À¥ó¥×¤¹¤ë¡£ +.\" file-backed shared mappings of course also update the underlying +.\" mapped file. +.RE +.PD +.PP +.I coredump_filter +¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 0x3 ¤Ç¤¢¤ë¡£ +¤³¤ÎÃͤÏÀΤ«¤é¤Î Linux ¤ÎµóÆ°¤òÈ¿±Ç¤·¤¿¤â¤Î¤Ç¤¢¤ê¡¢ +̵̾¥á¥â¥ê¥»¥°¥á¥ó¥È (anonymous memory segments) ¤À¤±¤¬¥À¥ó¥×¤µ¤ì¤ë +¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ + +.I coredump_filter +¤ÎÃͤ˴ؤï¤é¤º¡¢¥Õ¥ì¡¼¥à¥Ð¥Ã¥Õ¥¡¤Ê¤É¤Î memory-mapped I/O ¤Ë´Ø¤¹¤ë +¥Ú¡¼¥¸¤Ï·è¤·¤Æ¥À¥ó¥×¤µ¤ì¤º¡¢²¾ÁÛ DSO ¥Ú¡¼¥¸¤Ï¾ï¤Ë¥À¥ó¥×¤µ¤ì¤ë¡£ + +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤ë»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î +.I coredump_filter +¤ÎÃͤò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç +.I coredump_filter +¤ÎÃͤÏÊÝ»ý¤µ¤ì¤ë¡£ + +Îã¤Î¤è¤¦¤Ë¡¢¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¿Æ¥·¥§¥ë¤Î +.I coredump_filter +¤òÀßÄꤷ¤Æ¤ª¤¯¤ÈÌòΩ¤Ä¤³¤È¤¬¤¢¤ë¡£ + +.in +4n +.nf +.RB "$" " echo 0x7 > /proc/self/coredump_filter" +.RB "$" " ./some_program" +.fi +.in +.PP +¤³¤Î¥Õ¥¡¥¤¥ë¤¬Ä󶡤µ¤ì¤ë¤Î¤Ï¡¢¥«¡¼¥Í¥ë¤¬ÀßÄꥪ¥×¥·¥ç¥ó +.B CONFIG_ELF_CORE +¤òÍ­¸ú¤Ë¤·¤ÆºîÀ®¤µ¤ì¤¿¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +.SH È÷¹Í +.BR gdb (1) +¤Î +.I gcore +¥³¥Þ¥ó¥É¤ò»ÈÍѤ¹¤ë¤È¡¢¼Â¹ÔÃæ¤Î¥×¥í¥»¥¹¤Î¥³¥¢¥À¥ó¥×¤ò¼èÆÀ¤Ç¤­¤ë¡£ + +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥»¥¹ +(¤è¤êÀµ³Î¤Ë¤Ï¡¢ +.BR clone (2) +¤Î +.B CLONE_VM +¤ÇÀ¸À®¤µ¤ì¤¿ÊÌ¥×¥í¥»¥¹¤È¥á¥â¥ê¤ò¶¦Í­¤·¤Æ¤¤¤ë¥×¥í¥»¥¹) +¤¬¥³¥¢¥À¥ó¥×¤òÀ¸À®¤¹¤ë¾ì¹ç¡¢ +¥³¥¢¥Õ¥¡¥¤¥ë̾¤Ë¥×¥í¥»¥¹ ID ¤¬É¬¤ºÉղ䵤ì¤ë¡£ +¤¿¤À¤·¡¢ +.I /proc/sys/kernel/core_pattern +¤Î %p »ØÄê¤Ë¤è¤ê¥³¥¢¥Õ¥¡¥¤¥ë̾¤Î¤É¤³¤«Â¾¤Î¾ì½ê¤Ë¥×¥í¥»¥¹ ID ¤¬ +¤¹¤Ç¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥×¥í¥»¥¹ ID ¤¬ËöÈø¤ËÉղ䵤ì¤Ê¤¤¡£ +(¤³¤Îµ¡Ç½¤¬¤Þ¤ºÌò¤ËΩ¤Ä¤Î¤Ï LinuxThreads ¼ÂÁõ¤òÍøÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤ë¡£ +LinuxThreads ¼ÂÁõ¤Ç¤Ï¡¢¥×¥í¥»¥¹Æâ¤Î¸Ä¡¹¤Î¥¹¥ì¥Ã¥É¤Ï°Û¤Ê¤ë¥×¥í¥»¥¹ ID +¤ò»ý¤Ä¡£) +.\" Always including the PID in the name of the core file made +.\" sense for LinuxThreads, where each thread had a unique PID, +.\" but doesn't seem to serve any purpose with NPTL, where all the +.\" threads in a process share the same PID (as POSIX.1 requires). +.\" Probably the behavior is maintained so that applications using +.\" LinuxThreads continue appending the PID (the kernel has no easy +.\" way of telling which threading implementation the userspace +.\" application is using). -- mtk, April 2006 +.SH Îã +°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï +.I /proc/sys/kernel/core_pattern +¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¤¥×¹½Ê¸¤Î»ÈÍÑÎã¤ò¼¨¤·¤Æ¤¤¤ë¡£ +°Ê²¼¤Î¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥ó¤Ï¤³¤Î¥×¥í¥°¥é¥à¤Î»ÈÍÑÎã¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë +(¥³¥ó¥Ñ¥¤¥ë¤·¤Æ +.I core_pattern_pipe_test +¤È¤¤¤¦Ì¾Á°¤Î¼Â¹Ô¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Æ¤¤¤ë)¡£ +.PP +.in +4n +.nf +.RB "$" " cc \-o core_pattern_pipe_test core_pattern_pipe_test.c" +.RB "$" " su" +Password: +.RB "#" " echo \(aq|$PWD/core_pattern_pipe_test %p \ +UID=%u GID=%g sig=%s\(aq > \e" +.B " /proc/sys/kernel/core_pattern" +.RB "#" " exit" +.RB "$" " sleep 100" +.BR "^\e" " # type control-backslash" +Quit (core dumped) +.RB "$" " cat core.info" +argc=5 +argc[0]= +argc[1]=<20575> +argc[2]= +argc[3]= +argc[4]= +Total bytes in core dump: 282624 +.fi +.in +.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹ +\& +.nf +/* core_pattern_pipe_test.c */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +#define BUF_SIZE 1024 + +int +main(int argc, char *argv[]) +{ + int tot, j; + ssize_t nread; + char buf[BUF_SIZE]; + FILE *fp; + char cwd[PATH_MAX]; + + /* Change our current working directory to that of the + crashing process */ + + snprintf(cwd, PATH_MAX, "/proc/%s/cwd", argv[1]); + chdir(cwd); + + /* Write output to file "core.info" in that directory */ + + fp = fopen("core.info", "w+"); + if (fp == NULL) + exit(EXIT_FAILURE); + + /* Display command\-line arguments given to core_pattern + pipe program */ + + fprintf(fp, "argc=%d\\n", argc); + for (j = 0; j < argc; j++) + fprintf(fp, "argc[%d]=<%s>\\n", j, argv[j]); + + /* Count bytes in standard input (the core dump) */ + + tot = 0; + while ((nread = read(STDIN_FILENO, buf, BUF_SIZE)) > 0) + tot += nread; + fprintf(fp, "Total bytes in core dump: %d\\n", tot); + + exit(EXIT_SUCCESS); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR bash (1), +.BR gdb (1), +.BR getrlimit (2), +.BR mmap (2), +.BR prctl (2), +.BR sigaction (2), +.BR elf (5), +.BR proc (5), +.BR pthreads (7), +.BR signal (7) diff --git a/release/man5/dir_colors.5 b/release/man5/dir_colors.5 new file mode 100644 index 00000000..234c3fe0 --- /dev/null +++ b/release/man5/dir_colors.5 @@ -0,0 +1,367 @@ +.\" +.\" manpage for /etc/dir_colors, config file for dircolors(1) +.\" extracted from color-ls 3.12.0.3 dircolors(1) manpage +.\" +.\" This file may be copied under the conditions described +.\" in the LDP GENERAL PUBLIC LICENSE, Version 1, September 1998 +.\" that should have been distributed together with this file. +.\" +.\" 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 ¥­¥ã¥ì¥Ã¥È +.\" +.TH DIR_COLORS 5 2001-12-26 "GNU" "Linux User Manual" +.SH ̾Á° +dir_colors \- dircolors(1) ¤ÎÀßÄê¥Õ¥¡¥¤¥ë +.SH ÀâÌÀ +¥×¥í¥°¥é¥à +.BR ls (1) +¤Ï¡¢´Ä¶­ÊÑ¿ô +.B LS_COLORS +¤ò»È¤¤¡¢¥Õ¥¡¥¤¥ë̾¤ò²¿¿§¤Çɽ¼¨¤¹¤ë¤«¤ò·èÄꤹ¤ë¡£ +¤³¤Î´Ä¶­ÊÑ¿ô¤Ï¡¢Ä̾ï + +.RS +eval \`dircolors some_path/dir_colors\` +.RE + +¤Î¤è¤¦¤Ê¥³¥Þ¥ó¥É¤ÇÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¥³¥Þ¥ó¥É¤Ï +.I /etc/profile +¤ä +.I /etc/csh.cshrc +¤È¤¤¤Ã¤¿¥·¥¹¥Æ¥à¤Î¥·¥§¥ë½é´ü²½¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë¡£ +.RB ( dircolors (1) +¤ò»²¾È¤¹¤ë¤³¤È¡£) +Ä̾¤³¤³¤Ç»È¤ï¤ì¤ë¥Õ¥¡¥¤¥ë¤Ï +.I /etc/DIR_COLORS +¤Ç¤¢¤ë¤¬¡¢¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Î +.I .dir_colors +¥Õ¥¡¥¤¥ë¤Ç¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +ÀßÄê¥Õ¥¡¥¤¥ë¤Ï 1 ¹ÔËè¤Ë½ñ¤«¤ì¤¿¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç¹½À®¤µ¤ì¤ë¡£ +¥Ï¥Ã¥·¥å¥Þ¡¼¥¯ (#) ¤¬¹Ô¤Î»Ï¤á¤Ë¤¢¤ë¾ì¹ç¤ä¡¢ +¥Ï¥Ã¥·¥å¥Þ¡¼¥¯¤ÎÁ°¤Ë¾¯¤Ê¤¯¤È¤â 1 ¤Ä¤Î¶õÇò¤¬¤¢¤ë¾ì¹ç¡¢ +¥Ï¥Ã¥·¥å¥Þ¡¼¥¯¤Î¸å¤í¤Ï¥³¥á¥ó¥È¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +¶õ¹Ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.PP +¤³¤Î¥Õ¥¡¥¤¥ë¤Î +.I ¥°¥í¡¼¥Ð¥ë +¥»¥¯¥·¥ç¥ó¤Ï¡¢ +ºÇ½é¤Î +.B TERM +¥¹¥Æ¡¼¥È¥á¥ó¥È¤è¤êÁ°¤Ë¤¢¤ëǤ°Õ¤Î¥¹¥Æ¡¼¥È¥á¥ó¥È¤«¤é¤Ê¤ë¡£ +¥°¥í¡¼¥Ð¥ë¥»¥¯¥·¥ç¥ó¤Ë¤¢¤ë¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï¡¢ +¤¹¤Ù¤Æ¤ÎüËö¥¿¥¤¥×¤Ë¤Ä¤¤¤ÆÍ­¸ú¤Ç¤¢¤ë¤È¤ß¤Ê¤µ¤ì¤ë¡£ +¥°¥í¡¼¥Ð¥ë¥»¥¯¥·¥ç¥ó¤Î¼¡¤Ë¤Ï¡¢ +.I üËö¸ÇÍ­ +¥»¥¯¥·¥ç¥ó¤¬Â³¤¯¡£ +³ÆüËö¸ÇÍ­¥»¥¯¥·¥ç¥ó¤ÎÀèƬ¤Ë¤Ï¡¢1 ¤Ä°Ê¾å¤Î +.B TERM +¥¹¥Æ¡¼¥È¥á¥ó¥È¤¬ÃÖ¤«¤ì¤ë¡£ +.B TERM +¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï¡¢¤½¤Î¸å¤Ë³¤¯Àë¸À¤¬Å¬ÍѤµ¤ì¤ë (´Ä¶­ÊÑ¿ô +.B TERM +¤ÇÍ¿¤¨¤é¤ì¤ë) üËö¥¿¥¤¥×¤ò»ØÄꤹ¤ë¡£ +¥°¥í¡¼¥Ð¥ëÀë¸À¤ò¤½¤Î¸å¤Ë³¤¯Ã¼Ëö¸ÇÍ­¤ÎÀë¸À¤Ç¾å½ñ¤­¤¹¤ë¤³¤È¤¬¾ï¤Ë²Äǽ¤Ç¤¢¤ë¡£ +.PP +¼¡¤Î¥¹¥Æ¡¼¥È¥á¥ó¥È¤¬Ç§¼±¤µ¤ì¤ë¡£Âçʸ»ú¤È¾®Ê¸»ú¤Ï¶èÊ̤µ¤ì¤Ê¤¤¡£ +.TP +.B TERM \fIterminal-type\fR +üËö¸ÇÍ­¥»¥¯¥·¥ç¥ó¤ò³«»Ï¤·¡¢¤É¤ÎüËö¤ËŬÍѤ¹¤ë¤«¤ò»ØÄꤹ¤ë¡£ +Ê£¿ô¤ÎüËö¥¿¥¤¥×¤ËŬÍѤ¹¤ë¤¿¤á¡¢Ê£¿ô¤Î +.B TERM +¥¹¥Æ¡¼¥È¥á¥ó¥È¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B COLOR yes|all|no|none|tty +(Slackware ¤Î¤ß; GNU +.BR dircolors (1) +¤Ç¤Ï̵»ë¤µ¤ì¤ë¡£) +¥«¥é¡¼É½¼¨¤ò¾ï¤ËÍ­¸ú¤Ë¤¹¤ë¤Î¤« (\fIyes\fR ¤Þ¤¿¤Ï \fIall\fR)¡¢ +¾ï¤Ë̵¸ú¤Ë¤¹¤ë¤Î¤« (\fIno\fR ¤Þ¤¿¤Ï \fInone\fR)¡¢ +½ÐÎÏÀ褬üËö¤Î¾ì¹ç¤Ë¤Î¤ßÍ­¸ú¤Ë¤¹¤ë¤Î¤« (\fItty\fR) ¤ò»ØÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï \fIno\fR ¤Ç¤¢¤ë¡£ +.TP +.B EIGHTBIT yes|no +(Slackware ¤Î¤ß; GNU +.BR dircolors (1) +¤Ç¤Ï̵»ë¤µ¤ì¤ë¡£) +¥Ç¥Õ¥©¥ë¥È¤Ç 8 ¥Ó¥Ã¥È¤Î ISO 8859 ʸ»ú¤òÍ­¸ú¤Ë¤¹¤ë¤«¤ò»ØÄꤹ¤ë¡£ +¸ß´¹À­¤Î¤¿¤á¡¢1 ¤Ç \fIyes\fR ¤ò¡¢0 ¤Ç \fIno\fR ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï \fIno\fR ¤Ç¤¢¤ë¡£ +.TP +.B OPTIONS \fIoptions\fR +(Slackware ¤Î¤ß; GNU +.BR dircolors (1) +¤Ç¤Ï̵»ë¤µ¤ì¤ë¡£) +¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤ò¥Ç¥Õ¥©¥ë¥È¤Î +.B ls +¥³¥Þ¥ó¥É¥é¥¤¥ó¤ËÄɲ乤롣 +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ë¤Ï¡¢¤¹¤Ù¤Æ¤ÎÍ­¸ú¤Ê +.B ls +¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤ò»ØÄê¤Ç¤­¤ë¡£ +¥ª¥×¥·¥ç¥ó¤ÎÁ°¤Ë¤Ï¥Þ¥¤¥Ê¥¹µ­¹æ¤òÃÖ¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B dircolors +¤¬¥ª¥×¥·¥ç¥ó¤ÎÍ­¸úÀ­¤ò¸¡¾Ú¤·¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.TP +.B NORMAL \fIcolor-sequence\fR +(¥Õ¥¡¥¤¥ë̾¤Ç¤Ê¤¤) Ä̾ï¤Î¥Æ¥­¥¹¥È¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B FILE \fIcolor-sequence\fR +Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B DIR \fIcolor-sequence\fR +¥Ç¥£¥ì¥¯¥È¥ê¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B LINK \fIcolor-sequence\fR +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B ORPHAN \fIcolor-sequence\fR +¸ÉΩ¤·¤¿ (¸ºß¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë) +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢ +.B ls +¤Ï +.B LINK +¤Î¿§¤òÂå¤ï¤ê¤Ë»È¤¦¡£ +.TP +.B MISSING \fIcolor-sequence\fR +¹ÔÊýÉÔÌÀ¤Î¥Õ¥¡¥¤¥ë (¸ºß¤·¤Ê¤¤¤Ë¤â¤«¤«¤ï¤é¤º +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬»Ø¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë) ¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢ +.B ls +¤Ï +.B FILE +¤Î¿§¤òÂå¤ï¤ê¤Ë»È¤¦¡£ +.TP +.B FIFO \fIcolor-sequence\fR +FIFO (̾Á°ÉÕ¤­¥Ñ¥¤¥×) ¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B SOCK \fIcolor-sequence\fR +¥½¥±¥Ã¥È¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B DOOR \fIcolor-sequence\fR +(fileutils 4.1 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤ë) +door (Solaris 2.5 °Ê¹ß) ¤Ç»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B BLK \fIcolor-sequence\fR +¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B CHR \fIcolor-sequence\fR +¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B EXEC \fIcolor-sequence\fR +¼Â¹Ô°À­¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Ë»È¤ï¤ì¤ë¿§¤òÀßÄꤹ¤ë¡£ +.TP +.B LEFTCODE \fIcolor-sequence\fR +ISO\ 6429 üËö (²¼µ­»²¾È) °Ê³°¤Ç +.I "left code" +¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B RIGHTCODE \fIcolor-sequence\fR +ISO\ 6429 üËö (²¼µ­»²¾È) °Ê³°¤Ç +.I "right code" +¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +.B ENDCODE \fIcolor-sequence\fR +ISO\ 6429 üËö (²¼µ­»²¾È) °Ê³°¤Ç +.I "end code" +¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +\fB*\fIextension\fR \fIcolor-sequence\fR +\fIextension\fR ¤Ç½ª¤ë¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +.TP +\fB .\fIextension\fR \fIcolor-sequence\fR +\fB*\fR.\fIextension\fR ¤ÈƱ¤¸¡£ +\fIextension\fR ¤Ç½ª¤ë¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤Ë»È¤ï¤ì¤ë¿§¤ò»ØÄꤹ¤ë¡£ +¥Ô¥ê¥ª¥É¤Ï³ÈÄ¥»Ò¤Ë´Þ¤Þ¤ì¡¢ +.B emacs +¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë +.B ~ +¤Î¤è¤¦¤Ê¥Ô¥ê¥ª¥É¤Ç»Ï¤Þ¤é¤Ê¤¤³ÈÄ¥»Ò¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤³¤Î·Á¼°¤Ï¸Å¤¤¤â¤Î¤È¹Í¤¨¤é¤ì¤Æ¤¤¤ë¡£ +.SS "ISO 6429 (ANSI) ¥«¥é¡¼¥·¡¼¥±¥ó¥¹" +ºÇ¶á¤Î¥«¥é¡¼É½¼¨²Äǽ¤Ê ASCII üËö¤ÎÂçÉôʬ¤Ï¡¢ +ISO 6429 (ANSI) ¥«¥é¡¼¥·¡¼¥±¥ó¥¹¤òÍѤ¤¤ë¡£ +.B xterm +¤ä¹­¤¯»È¤ï¤ì¤Æ¤¤¤ë DEC VT100 ¥¯¥í¡¼¥ó¤ò´Þ¤à +¥«¥é¡¼É½¼¨¤Ç¤­¤Ê¤¤°ìÈÌŪ¤ÊüËö¤Î¿¤¯¤Ï¡¢ +ISO 6429 ¥«¥é¡¼¥³¡¼¥É¤òǧ¼±¤·¡¢½ÐÎϤ«¤é¼Â³²¤Ê¤¯ºï½ü¤¹¤ë¤«¡¢¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë¡£ +.B ls +¤Ï¡¢¥«¥é¡¼É½¼¨¤¬Í­¸ú¤Ç¤¢¤ë¤³¤È¤ò²¾Äꤷ¡¢ISO 6429 ¥³¡¼¥É¤ò¥Ç¥Õ¥©¥ë¥È¤Ç»È¤¦¡£ + +ISO 6429 ¥«¥é¡¼¥·¡¼¥±¥ó¥¹¤Ï¡¢¥»¥ß¥³¥í¥ó¤Ç¶èÀÚ¤é¤ì¤¿¿ô»ú¤Î¥·¡¼¥±¥ó¥¹¤Çºî¤é¤ì¤ë¡£ +ºÇ¤â°ìÈÌŪ¤Ê¥³¡¼¥É¤ò¼¨¤¹¡£ +.sp +.RS +.2i +.ta 1.0i +.nf + 0 ¥Ç¥Õ¥©¥ë¥È¥«¥é¡¼¤òÊݸ + 1 ÌÀ¤ë¤¤¿§ + 4 ¥¢¥ó¥À¡¼¥é¥¤¥ó¤µ¤ì¤¿¥Æ¥­¥¹¥È + 5 ¥Õ¥é¥Ã¥·¥å¤¹¤ë¥Æ¥­¥¹¥È +30 Á°·Ê¿§¡§¹õ +31 Á°·Ê¿§¡§ÀÖ +32 Á°·Ê¿§¡§ÎÐ +33 Á°·Ê¿§¡§²« (¤â¤·¤¯¤ÏÃã) +34 Á°·Ê¿§¡§ÀÄ +35 Á°·Ê¿§¡§»ç +36 Á°·Ê¿§¡§¥·¥¢¥ó +37 Á°·Ê¿§¡§Çò (¤â¤·¤¯¤Ï³¥) +40 ÇØ·Ê¿§¡§¹õ +41 ÇØ·Ê¿§¡§ÀÖ +42 ÇØ·Ê¿§¡§ÎÐ +43 ÇØ·Ê¿§¡§²« (¤â¤·¤¯¤ÏÃã) +44 ÇØ·Ê¿§¡§ÀÄ +45 ÇØ·Ê¿§¡§»ç +46 ÇØ·Ê¿§¡§¥·¥¢¥ó +47 ÇØ·Ê¿§¡§Çò (¤â¤·¤¯¤Ï³¥) +.fi +.RE +.sp +¥·¥¹¥Æ¥à¤Èɽ¼¨¥Ç¥Ð¥¤¥¹¤Ë¤è¤Ã¤Æ¤Ï¡¢Æ°ºî¤·¤Ê¤¤¥³¥Þ¥ó¥É¤â¤¢¤ë¡£ +.PP +.B ls +¤Ï°Ê²¼¤ò¥Ç¥Õ¥©¥ë¥È¤È¤·¤Æ»È¤¦¡£ +.sp +.RS +.2i +.ta 1.0i 2.5i +.nf +\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 ¼Â¹Ô¥Õ¥¡¥¤¥ë +.fi +.RE +.sp +¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¤ò´°Á´¤Ëǧ¼±¤Ç¤­¤Ê¤¤Ã¼Ëö¥×¥í¥°¥é¥à¤â¾¯¿ô¸ºß¤¹¤ë¡£ +¥Ç¥£¥ì¥¯¥È¥ê¤ò¥ê¥¹¥È¤·¤¿¸å¤Ë¤¹¤Ù¤Æ¤Î¥Æ¥­¥¹¥È¤¬¥«¥é¡¼É½¼¨¤µ¤ì¤¿¤Ê¤é¡¢ +.B NORMAL +¤È +.B FILE +¤Î¥³¡¼¥É¤òÄ̾ï¤ÎÁ°·Ê¿§¤ÈÇØ·Ê¿§¤Î¤¿¤á¤Î¿ôÃÍ¥³¡¼¥É¤ËÊѹ¹¤¹¤ë¤³¤È¡£ +.SS "¤½¤Î¾¤ÎüËö¥¿¥¤¥× (¹âÅÙ¤ÊÀßÄê)" +¥«¥é¡¼É½¼¨²Äǽ (¤Þ¤¿¤Ï¥Ï¥¤¥é¥¤¥Èɽ¼¨²Äǽ) ¤À¤¬¡¢ +°Û¤Ê¤ë¥³¡¼¥É¥»¥Ã¥È¤ò»È¤¦Ã¼Ëö (¤¢¤ë¤¤¤Ï¥×¥ê¥ó¥¿¡¼!) ¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ç¤â¡¢ +¤½¤ì¤ËŬ¤·¤¿ÀßÄê¤òºî¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤½¤Î¤¿¤á¤Ë¤Ï¡¢ +.BR LEFTCODE , +.BR RIGHTCODE , +.B ENDCODE +ÄêµÁ¤ò»È¤¦É¬Íפ¬¤¢¤ë¡£ +.PP +¥Õ¥¡¥¤¥ë̾¤ò½ÐÎϤ¹¤ë¾ì¹ç¡¢ +.B ls +¤Ï " +.B LEFTCODE +.I typecode +.B RIGHTCODE +.I filename +.B ENDCODE +" ¤È¤¤¤¦½ÐÎÏ¥·¡¼¥±¥ó¥¹¤òÀ¸À®¤¹¤ë¡£ +¤³¤³¤Ç¡¢ +.I typecode +¤Ï¥Õ¥¡¥¤¥ë¤Î¥¿¥¤¥×¤ä̾Á°¤Ë°Í¸¤·¤¿¥«¥é¡¼¥·¡¼¥±¥ó¥¹¤Ç¤¢¤ë¡£ +.B ENDCODE +¤¬Ì¤ÄêµÁ¤Î¾ì¹ç¡¢¥·¡¼¥±¥ó¥¹ +.B "LEFTCODE NORMAL RIGHTCODE" +¤¬Âå¤ï¤ê¤Ë»È¤ï¤ì¤ë¡£ +leftcode ¤È rightcode ¤ÎÌÜŪ¤Ï¡¢Ã±¤ËɬÍפÊÂǤÁ¹þ¤à²ó¿ô¤ò¸º¤é¤¹ +(¤µ¤é¤Ë¡¢¸«¶ì¤·¤¤¥¨¥¹¥±¡¼¥×¥³¡¼¥É¤ò¥æ¡¼¥¶¡¼¤Ë±£¤¹) ¤³¤È¤Ë¤¢¤ë¡£ +¥·¡¼¥±¥ó¥¹¤¬¤½¤ÎüËö¤Ë¤È¤Ã¤ÆŬÀڤǤʤ¤¾ì¹ç¡¢ +¹ÔÆâ¤Î¤½¤ì¤¾¤ì¤Î¥­¡¼¥ï¡¼¥É¼«¿È¤ò»ØÄꤷ¤Æºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.B Ãí°Õ¡§ +.B ENDCODE +¤¬ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥°¥í¡¼¥Ð¥ë¥»¥¯¥·¥ç¥ó¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¤ÎüËö¸ÇÍ­¥»¥¯¥·¥ç¥ó¤Ç̤ÄêµÁ¤Ë¤¹¤ë¤³¤È¤Ï +.IR ¤Ç¤­¤Ê¤¤ ¡£ +¤³¤ì¤Ï¡¢ +.B NORMAL +¤ÎÄêµÁ¤¬²¿¤â±Æ¶Á¤òµÚ¤Ü¤µ¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¤·¤«¤·¡¢°Û¤Ê¤Ã¤¿ +.B ENDCODE +¤ò»ØÄꤹ¤ë¤³¤È¤ÇƱ¤¸¸ú²Ì¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SS ¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ +¥«¥é¡¼¥·¡¼¥±¥ó¥¹¤ä¥Õ¥¡¥¤¥ë̾¤Î³ÈÄ¥»Ò¤ÇÀ©¸æʸ»ú¤ä¥Ö¥é¥ó¥¯Ê¸»ú¤ò»ØÄꤹ¤ë¤¿¤á¤Ë¡¢ +C ¸À¸ì¥¹¥¿¥¤¥ë¤Î \e ¥¨¥¹¥±¡¼¥×ɽµ­¤È +.B stty +¥¹¥¿¥¤¥ë¤Î ^ ɽµ­¤ÎξÊý¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +C ¸À¸ì¥¹¥¿¥¤¥ë¤Îɽµ­¤Ë¤Ï°Ê²¼¤Îʸ»ú¤¬´Þ¤Þ¤ì¤ë¡£ +.sp +.RS +.2i +.ta 1.0i +.nf +\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 ¥Ï¥Ã¥·¥å¥Þ¡¼¥¯ (#) +.fi +.RE +.sp +¥Ï¥Ã¥·¥å¥Þ¡¼¥¯¤ò»Ï¤á¤Îʸ»ú¤È¤·¤ÆÆþÎϤ¹¤ë¤È¤­¤ÈƱÍͤˡ¢ +¥¹¥Ú¡¼¥¹¡¦¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¡¦¥­¥ã¥ì¥Ã¥È¡¦À©¸æʸ»ú¤òʸ»úÎó¤ÎǤ°Õ¤ÎÉôʬ¤Ë +ÆþÎϤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥¨¥¹¥±¡¼¥×¤¬É¬ÍפǤ¢¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/DIR_COLORS +¥·¥¹¥Æ¥àÁ´ÂΤÎÀßÄê¥Õ¥¡¥¤¥ë¡£ +.TP +.I ~/.dir_colors +¥æ¡¼¥¶¡¼Ëè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¡£ +.SH Ãí°Õ +¤³¤Î¥Ú¡¼¥¸¤Ï fileutils-4.1 ¥Ñ¥Ã¥±¡¼¥¸¤Ç»È¤ï¤ì¤Æ¤¤¤ë +.B dir_colors +¤Î¥Õ¥¡¥¤¥ë·Á¼°¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤ë¡£ +¤½¤Î¾¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¾¯¤·°ã¤¤¤¬¤¢¤ë¤«¤âÃΤì¤Ê¤¤¡£ +.PP +ISO 6429 üËö¤Ç»È¤ï¤ì¤ë +.B LEFTCODE +¤È +.B RIGHTCODE +¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÄêµÁ¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.sp +.RS +.2i +.ta 1.0i +.nf +\fBLEFTCODE\fR \ee[ +\fBRIGHTCODE\fR m +.fi +.RE +.sp +.B ENDCODE +¤Î¥Ç¥Õ¥©¥ë¥È¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR dircolors (1), +.BR ls (1), +.BR stty (1), +.BR xterm (1) diff --git a/release/man5/elf.5 b/release/man5/elf.5 new file mode 100644 index 00000000..fe6e6242 --- /dev/null +++ b/release/man5/elf.5 @@ -0,0 +1,1904 @@ +.\" $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 +.\"HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\"LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\"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" +.SH ̾Á° +elf \- ¼Â¹Ô²Äǽ¥ê¥ó¥¯¥Õ¥©¡¼¥Þ¥Ã¥È (ELF) ¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.SH ½ñ¼° +.nf +.\" .B #include +.B #include +.fi +.SH ÀâÌÀ +¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.I +¤Ï ELF ¼Â¹Ô²Äǽ¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤òÄêµÁ¤¹¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤È¤·¤Æ¤Ï¡¢Ä̾ï¤Î¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¡¦ +ºÆÇÛÃÖ²Äǽ¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¡¦¥³¥¢¥Õ¥¡¥¤¥ë¡¦¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬¤¢¤ë¡£ +.PP +ELF ¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»È¤¦¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤Ï¡¢ +ELF ¥Ø¥Ã¥À¤Î¸å¤Ë¥×¥í¥°¥é¥à¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Þ¤¿¤Ï +¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë (¤Þ¤¿¤Ï¤½¤ÎξÊý) ¤¬Â³¤¯¹½À®¤Ç¤¢¤ë¡£ +ELF ¥Ø¥Ã¥À¤Ï¾ï¤Ë¥Õ¥¡¥¤¥ë¤Î¥ª¥Õ¥»¥Ã¥È 0 ¤Ë¤¢¤ë¡£ +¥×¥í¥°¥é¥à¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤È¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Î +¥Õ¥¡¥¤¥ëÆâ¤Ç¤Î¥ª¥Õ¥»¥Ã¥È¤Ï¡¢ELF ¥Ø¥Ã¥À¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î 2 ¤Ä¤Î¥Æ¡¼¥Ö¥ë¤Ï¥Õ¥¡¥¤¥ë¤Î»Ä¤ê¤ÎÉôʬ¤Î¾ÜºÙ¤òµ­½Ò¤¹¤ë¡£ +.PP +.\" ¥Í¥¤¥Æ¥£¥Ö¤Ê¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î ELF ¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë¤ò½èÍý¤·¤¿¤¤ +.\" ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢¥½¡¼¥¹¥³¡¼¥É¤Ë +.\" .I +.\" ¤ò´Þ¤á¤ë¤À¤±¤Ç¤è¤¤¡£ +.\" ¤³¤ì¤é¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢¥¸¥§¥Í¥ê¥Ã¥¯Ì¾ +.\" all the types and structures by their generic names +.\" "Elf_xxx" +.\" ¤Ë¤è¤Ã¤ÆÁ´¤Æ¤Î·¿¤È¹½Â¤ÂΤò»²¾È¤·¤¿¤ê¡¢ +.\" "ELF_xxx" +.\" ¤Ë¤è¤Ã¤Æ¥Þ¥¯¥í¤ò»²¾È¤·¤¿¤ê¤¹¤ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.\" ¤³¤Î¤è¤¦¤Ë¤·¤Æ½ñ¤«¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢ +.\" ¥Û¥¹¥È¤¬ 32 ¥Ó¥Ã¥È¤« 64 ¥Ó¥Ã¥È¤«¤Ë´Ø¤ï¤é¤º¡¢ +.\" ¤É¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¾å¤Ç¤â¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤ë¡£ +.\" .PP +.\" ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬Ì¤ÃΤΥ¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î ELF ¥Õ¥¡¥¤¥ë¤ò +.\" ½èÍý¤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¡¢¤½¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÏÌÀ¼¨Åª¤Ë +.\" "Elf32_xxx" +.\" ¤Þ¤¿¤Ï +.\" "Elf64_xxx" +.\" ¤È¤¤¤¦·¿Ì¾¤È¹½Â¤ÂÎ̾¤ò»È¤¦É¬Íפ¬¤¢¤ë¡£ +.\" ƱÍͤˡ¢¥Þ¥¯¥í¤Ï +.\" "ELF32_xxx" +.\" ¤Þ¤¿¤Ï +.\" "ELF64_xxx" +.\" ¤Ç¼±Ê̤µ¤ì¤ëɬÍפ¬¤¢¤ë¡£ +.\" .PP +¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ï¾åµ­¤Î¥Ø¥Ã¥À¤ò C ¸À¸ì¤Î¹½Â¤ÂΤǵ­½Ò¤·¡¢ +¤Þ¤¿Æ°Åª¥»¥¯¥·¥ç¥ó¡¦ºÆÇÛÃÖ²Äǽ¥»¥¯¥·¥ç¥ó¡¦¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤Î¹½Â¤ÂΤâ +´Þ¤ó¤Ç¤¤¤ë¡£ +.PP +°Ê²¼¤Î·¿¤Ï N ¥Ó¥Ã¥È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç»È¤ï¤ì¤ë (N=32,64 ¤Ç¤¢¤ê +.I ElfN +¤Ï +.I Elf32 +¤Þ¤¿¤Ï +.I Elf64 +¤òɽ¤·¡¢ +.I uintN_t +¤Ï +.I uint32_t +¤Þ¤¿¤Ï +.I uint64_t +¤òɽ¤¹): +.in +4n +.nf + +ElfN_Addr Éä¹æ¤Ê¤·¤Î¥×¥í¥°¥é¥à¥¢¥É¥ì¥¹, uintN_t +ElfN_Off Éä¹æ¤Ê¤·¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È, uintN_t +ElfN_Section Éä¹æ¤Ê¤·¤Î¥»¥¯¥·¥ç¥ó¥¤¥ó¥Ç¥Ã¥¯¥¹, 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 +.\" Elf32_Size Éä¹æ¤Ê¤·¤Î¥ª¥Ö¥¸¥§¥¯¥È¥µ¥¤¥º +.fi +.in +.PP +(Ãí°Õ: *BSD ¤Ç¤ÎÍѸì¤Ï¾¯¤·°Û¤Ê¤ë¡£ +.I Elf64_Half +¤Ï +.I Elf32_Half +¤Î 2 ÇܤǤ¢¤ê¡¢ +.I Elf64Quarter +¤¬ +.I uint16_t +¤ËÍѤ¤¤é¤ì¤ë¡£ +º®Íð¤òÈò¤±¤ë¤¿¤á¡¢°Ê²¼¤Ç¤Ï¡¢¤³¤ì¤é¤Î·¿¤Ï¥µ¥¤¥º¤¬¼«ÌÀ¤Ê·¿¤ËÃÖ¤­´¹¤¨¤Æ¤¢¤ë¡£) +.PP +¤³¤Î¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤¬ÄêµÁ¤¹¤ëÁ´¤Æ¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢ +´ØÏ¢¤¹¤ë¥¯¥é¥¹¤Î +"¼«Á³¤Ê" +¥µ¥¤¥º¤ÈÇÛÃ֤λؿˤ˽¾¤¦¡£ +ɬÍפʾì¹ç¡¢¥Ç¡¼¥¿¹½Â¤ÂΤǤÏÌÀ¼¨Åª¤Ê¥Ñ¥Ç¥£¥ó¥° (padding, µÍ¤á¹þ¤ß) +¤¬¹Ô¤Ê¤ï¤ì¤ë¡£¤³¤ì¤Ï 4 ¥Ð¥¤¥È¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ¹¤ë +4 ¥Ð¥¤¥ÈÇÛÃÖ¤òÊݾڤ¹¤ë¤¿¤á¤ä¡¢ +¹½Â¤ÂΤΥµ¥¤¥º¤ò 4 ¤ÎÇÜ¿ô¤Ë¤¹¤ë¤¿¤á¤Ê¤É¤Ç¤¢¤ë¡£ +.PP +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 +¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤Î°ÕÌ£¤ò»ý¤Ä: +.\" .Bl -tag -width "e_phentsize" +.TP 12 +.IR e_ident +¤³¤Î¥Ð¥¤¥ÈÇÛÎó¤Ï¡¢¥×¥í¥»¥Ã¥µ¤ä¥Õ¥¡¥¤¥ë¤Î¾¤ÎÉôʬ¤Ë¤Ï°Í¸¤»¤º¤Ë¡¢ +¥Õ¥¡¥¤¥ë¤ò²ò¼á (interpret) ¤¹¤ë¤¿¤á¤Ë»ØÄꤵ¤ì¤ë¡£ +¤³¤ÎÇÛÎóÆâ¤Î¤¹¤Ù¤Æ¤Î¤â¤Î¤Ï¡¢ÀÜƬ¼­ +.BR EI_ +¤Ç»Ï¤Þ¤ë¥Þ¥¯¥í¤Î̾Á°¤¬ÉÕ¤­¡¢ÀÜƬ¼­ +.BR ELF +¤Ç»Ï¤Þ¤ëÃͤò»ý¤Ä¡£ +°Ê²¼¤Î¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.RS 12 +.\" .Bl -tag -width "EI_VERSION" \" EI_ABIVERSION +.TP 12 +.BR EI_MAG0 +¥Þ¥¸¥Ã¥¯¥Ê¥ó¥Ð¡¼¤ÎÂè 1 ¥Ð¥¤¥È¡£ +.BR ELFMAG0 +¤ÇËä¤á¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +(0: 0x7f) +.TP +.BR EI_MAG1 +¥Þ¥¸¥Ã¥¯¥Ê¥ó¥Ð¡¼¤ÎÂè 2 ¥Ð¥¤¥È¡£ +.BR ELFMAG1 +¤ÇËä¤á¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +(1: \(aqE\(aq) +.TP +.BR EI_MAG2 +¥Þ¥¸¥Ã¥¯¥Ê¥ó¥Ð¡¼¤ÎÂè 3 ¥Ð¥¤¥È¡£ +.BR ELFMAG2 +¤ÇËä¤á¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +(2: \(aqL\(aq) +.TP +.BR EI_MAG3 +¥Þ¥¸¥Ã¥¯¥Ê¥ó¥Ð¡¼¤ÎÂè 4 ¥Ð¥¤¥È¡£ +.BR ELFMAG3 +¤ÇËä¤á¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +(3: \(aqF\(aq) +.TP +.BR EI_CLASS +Âè 5 ¥Ð¥¤¥È¤Ï¡¢¤³¤Î¥Ð¥¤¥Ê¥ê¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò¼¨¤¹: +.RS 12 +.\" .Bl -tag -width "ELFCLASSNONE" -compact +.TP 14 +.PD 0 +.BR ELFCLASSNONE +¤³¤Î¥¯¥é¥¹¤ÏÉÔÀµ¤Ç¤¢¤ë¡£ +.TP +.BR ELFCLASS32 +32 ¥Ó¥Ã¥È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤òÄêµÁ¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤È²¾ÁÛ¥¢¥É¥ì¥¹¶õ´Ö¤¬ 4 ¥®¥¬¥Ð¥¤¥È¤Þ¤Ç¤Î¥Þ¥·¥ó¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +.TP +.BR ELFCLASS64 +64 ¥Ó¥Ã¥È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤òÄêµÁ¤¹¤ë¡£ +.PD +.RE +.\" .El +.TP +.BR EI_DATA +Âè 6 ¥Ð¥¤¥È¤Ï¥Õ¥¡¥¤¥ëÆâ¤Î¥×¥í¥»¥Ã¥µ¸ÇÍ­¥Ç¡¼¥¿¤Î +¥Ç¡¼¥¿¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ò»ØÄꤹ¤ë¡£ +¸½ºß¤Î¤È¤³¤í°Ê²¼¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë: +.\" .Bl -tag -width "ELFDATA2LSB" -compact +.RS 12 +.TP 14 +.PD 0 +.BR ELFDATANONE +ÉÔÌÀ¤Ê¥Ç¡¼¥¿¥Õ¥©¡¼¥Þ¥Ã¥È¡£ +.TP +.BR ELFDATA2LSB +2 ¤ÎÊä¿ô¡¢¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó¡£ +.TP +.BR ELFDATA2MSB +2 ¤ÎÊä¿ô¡¢¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¡£ +.PD +.RE +.\" .El +.TP +.PD 0 +.BR EI_VERSION +ELF »ÅÍͤΥС¼¥¸¥ç¥óÈÖ¹æ: +.\" .Bl -tag -width "EV_CURRENT" -compact +.RS 12 +.TP 14 +.BR EV_NONE +ÉÔÀµ¤Ê¥Ð¡¼¥¸¥ç¥ó¡£ +.TP +.BR EV_CURRENT +¸½ºß¤Î¥Ð¡¼¥¸¥ç¥ó¡£ +.PD +.RE +.\".El +.TP +.BR EI_OSABI +¤³¤Î¥Ð¥¤¥È¤Ï¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¿¡¼¥²¥Ã¥È¤È¤Ê¤ë +¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤È ABI ¤ò¼¨¤¹¡£ +¾¤Î ELF ¹½Â¤ÂΤΥե£¡¼¥ë¥É¤Ë¤Ï¡¢ +¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¸ÇÍ­¤Î°ÕÌ£¤ò»ý¤Ä¥Õ¥é¥°¤äÃͤò»ý¤Ä¤â¤Î¤â¤¢¤ë; +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Î²ò¼á¤Ï¡¢¤³¤Î¥Ð¥¤¥È¤ÎÃͤˤè¤Ã¤Æ·èÄꤵ¤ì¤ë¡£ +Î㤨¤Ð: +.\" .Bl -tag -width "ELFOSABI_STANDALONE" -compact +.RS 12 +.TP 20 +.PD 0 +.BR ELFOSABI_NONE +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. +.\" 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 +ARM ¥¢¡¼¥­¥Æ¥¯¥Á¥ã ABI. +.\" 97 +.TP +.BR ELFOSABI_STANDALONE +¥¹¥¿¥ó¥É¥¢¥í¥ó (ÁȤ߹þ¤ß) ABI. +.\" 255 +.\" .El +.PD +.RE +.TP +.BR EI_ABIVERSION +¤³¤Î¥Ð¥¤¥È¤Ï¥ª¥Ö¥¸¥§¥¯¥È¤¬¥¿¡¼¥²¥Ã¥È¤È¤·¤Æ¤¤¤ë ABI ¤Î¥Ð¡¼¥¸¥ç¥ó¤ò¼¨¤¹¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¸ß´¹À­¤Î¤Ê¤¤ ABI ¤Î¥Ð¡¼¥¸¥ç¥ó¤ò¶èÊ̤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +¤³¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤Î²ò¼á¤Ï¡¢ +.B EI_OSABI +¥Õ¥£¡¼¥ë¥É¤Ç¼±Ê̤µ¤ì¤ë ABI ¤Ë°Í¸¤¹¤ë¡£ +¤³¤Î»ÅÍͤ˽àµò¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢ÃÍ 0 ¤ò»È¤¦¡£ +.TP +.BR EI_PAD +¥Ñ¥Ç¥£¥ó¥°¤Î³«»Ï¡£ +¤³¤ì¤é¤Î¥Ð¥¤¥È¤ÏͽÌ󤵤ì¤Æ¤ª¤ê¡¢0 ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤òÆɤ߹þ¤à¥×¥í¥°¥é¥à¤Ï¡¢¤³¤ì¤é¤Î¥Ð¥¤¥È¤ò̵»ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¸½ºß»È¤ï¤ì¤Æ¤¤¤Ê¤¤¥Ð¥¤¥È¤Ë°ÕÌ£¤¬Í¿¤¨¤é¤ì¤ë¾ì¹ç¡¢ +.B EI_PAD +¤ÎÃͤϾ­ÍèÊѹ¹¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.BR EI_BRAND +¥¢¡¼¥­¥Æ¥¯¥Á¥ã ID ¤Î³«»Ï¡£ +.TP +.BR EI_NIDENT +.I e_ident +ÇÛÎó¤Î¥µ¥¤¥º¡£ +.\" .El +.RE +.TP +.IR e_type +¤³¤Î¹½Â¤ÂΤΥá¥ó¥Ð¤Ï¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤ò¼¨¤¹: +.RS 12 +.\" .Bl -tag -width "ET_NONE" -compact +.TP 12 +.PD 0 +.BR ET_NONE +ÉÔÌÀ¤Ê¥¿¥¤¥×¡£ +.TP +.BR ET_REL +ºÆÇÛÃÖ²Äǽ¥Õ¥¡¥¤¥ë¡£ +.TP +.BR ET_EXEC +¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¡£ +.TP +.BR ET_DYN +¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¡£ +.TP +.BR ET_CORE +¥³¥¢¥Õ¥¡¥¤¥ë¡£ +.PD +.RE +.\" .El +.TP +.IR e_machine +¤³¤Î¥á¥ó¥Ð¤Ï¸Ä¡¹¤Î¥Õ¥¡¥¤¥ë¤ËɬÍפȤµ¤ì¤ë¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò»ØÄꤹ¤ë¡£ +Îã: +.RS 12 +.\" .Bl -tag -width "EM_MIPS_RS4_BE" -compact +.TP 12 +.PD 0 +.BR EM_NONE +ÉÔÌÀ¤Ê¥Þ¥·¥ó¡£ +.\" 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 +MIPS RS3000 (¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤Î¤ß)¡£ +.\" 8 +.\" EM_S370 +.\" 9 +.\" .It Dv EM_MIPS_RS4_BE +.\" MIPS RS4000 (¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤Î¤ß)¡£Èó¿ä¾©¡£ +.\" 10 +.\" EM_MIPS_RS3_LE (MIPS R3000 ¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó)¡£ +.\" 10 +.TP +.BR EM_PARISC +HP/PA. +.\" 15 +.TP +.BR EM_SPARC32PLUS +³Èĥ̿Î᥻¥Ã¥ÈÉÕ¤­ 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 +.\" ³Èĥ̿Î᥻¥Ã¥ÈÉÕ¤­ Compaq [DEC] Alpha¡£ +.PD +.RE +.\" .El +.TP +.IR e_version +¤³¤Î¥á¥ó¥Ð¤Ï¥Õ¥¡¥¤¥ë¥Ð¡¼¥¸¥ç¥ó¤ò¼¨¤¹: +.\" .Bl -tag -width "EV_CURRENT" -compact +.RS 12 +.TP 12 +.PD 0 +.BR EV_NONE +ÉÔÀµ¤Ê¥Ð¡¼¥¸¥ç¥ó¡£ +.TP +.BR EV_CURRENT +¸½ºß¤Î¥Ð¡¼¥¸¥ç¥ó¡£ +.\" .El +.PD +.RE +.TP +.IR e_entry +¤³¤Î¥á¥ó¥Ð¤Ï¡¢¥·¥¹¥Æ¥à¤¬ºÇ½é¤ËÀ©¸æ¤òÅϤ¹¡¢ +¤Ä¤Þ¤ê¥×¥í¥»¥¹¤ò³«»Ï¤¹¤ë²¾ÁÛ¥¢¥É¥ì¥¹¤ò»ØÄꤹ¤ë¡£ +¥Õ¥¡¥¤¥ë¤Ë¥¨¥ó¥È¥ê¥Ý¥¤¥ó¥È¤¬´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +¤³¤Î¥á¥ó¥Ð¤Ë¤Ï 0 ¤¬Æþ¤ë¡£ +.TP +.IR e_phoff +¤³¤Î¥á¥ó¥Ð¤Ï¥×¥í¥°¥é¥à¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Î +¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È (¥Ð¥¤¥Èñ°Ì) ¤òÊÝ»ý¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤Ë¥×¥í¥°¥é¥à¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤¬¤Ê¤¤¾ì¹ç¡¢ +¤³¤Î¥á¥ó¥Ð¤Ë¤Ï 0 ¤¬Æþ¤ë¡£ +.TP +.IR e_shoff +¤³¤Î¥á¥ó¥Ð¤Ï¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Î +¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È (¥Ð¥¤¥Èñ°Ì) ¤òÊÝ»ý¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤Ë¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤¬¤Ê¤¤¾ì¹ç¡¢ +¤³¤Î¥á¥ó¥Ð¤Ë¤Ï 0 ¤¬Æþ¤ë¡£ +.TP +.IR e_flags +¤³¤Î¥á¥ó¥Ð¤Ï¥Õ¥¡¥¤¥ë¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î¥Õ¥é¥°¤òÊÝ»ý¤¹¤ë¡£ +¥Õ¥é¥°¤Î̾Á°¤Ï EF_`machine_flag' ¤È¤¤¤¦·Á¼°¤Ç¤¢¤ë¡£ +¸½ºß¤Î¤È¤³¤í¥Õ¥é¥°¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.IR e_ehsize +¤³¤Î¥á¥ó¥Ð¤Ï ELF ¥Ø¥Ã¥À¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤òÊÝ»ý¤¹¤ë¡£ +.TP +.IR e_phentsize +¤³¤Î¥á¥ó¥Ð¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥×¥í¥°¥é¥à¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Î +1 ¥¨¥ó¥È¥ê¤¢¤¿¤ê¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤òÊÝ»ý¤¹¤ë; +Á´¤Æ¤Î¥¨¥ó¥È¥ê¤ÏƱ¤¸¥µ¥¤¥º¤Ç¤¢¤ë¡£ +.TP +.IR e_phnum +¤³¤Î¥á¥ó¥Ð¤Ï¥×¥í¥°¥é¥à¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Ë¤¢¤ë¥¨¥ó¥È¥ê¤Î¿ô¤òÊÝ»ý¤¹¤ë¡£ +¤è¤Ã¤Æ +.IR e_phentsize +¤È +.IR e_phnum +¤ÎÀѤ¬¥Æ¡¼¥Ö¥ë¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤Ë¤Ê¤ë¡£ +¥Õ¥¡¥¤¥ë¤Ë¥×¥í¥°¥é¥à¥Ø¥Ã¥À¤¬¤Ê¤¤¾ì¹ç¡¢ +.IR e_phnum +¤ÏÃÍ 0 ¤òÊÝ»ý¤¹¤ë¡£ +.TP +.IR e_shentsize +¤³¤Î¥á¥ó¥Ð¤Ï¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤òÊÝ»ý¤¹¤ë¡£ +¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¤Ï¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Î 1 ¤Ä¤Î¥¨¥ó¥È¥ê¤Ç¤¢¤ë; +Á´¤Æ¤Î¥¨¥ó¥È¥ê¤ÏƱ¤¸¥µ¥¤¥º¤Ç¤¢¤ë¡£ +.TP +.IR e_shnum +¤³¤Î¥á¥ó¥Ð¤Ï¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Ë¤¢¤ë¥¨¥ó¥È¥ê¤Î¿ô¤òÊÝ»ý¤¹¤ë¡£ +¤è¤Ã¤Æ +.IR e_shentsize +¤È +.IR e_shnum +¤ÎÀѤϥ»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤Ë¤Ê¤ë¡£ +¥Õ¥¡¥¤¥ë¤Ë¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤¬¤Ê¤¤¾ì¹ç¡¢ +.IR e_shnum +¤ÏÃÍ 0 ¤òÊÝ»ý¤¹¤ë¡£ +.TP +.IR e_shstrndx +¤³¤Î¥á¥ó¥Ð¤Ï¥»¥¯¥·¥ç¥ó̾ʸ»úÎó¥Æ¡¼¥Ö¥ë¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥¨¥ó¥È¥ê¤Î +¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÝ»ý¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤Ë¥»¥¯¥·¥ç¥ó̾ʸ»úÎó¥Æ¡¼¥Ö¥ë¤¬¤Ê¤¤¾ì¹ç¡¢ +¤³¤Î¥á¥ó¥Ð¤ÏÃÍ +.BR SHN_UNDEF +¤òÊÝ»ý¤¹¤ë¡£ +.BR SHN_UNDEF . +.RS 12 +.\" .Bl -tag -width "SHN_LORESERVE" +.TP 14 +.BR SHN_UNDEF +¤³¤ÎÃͤÏ̤ÄêµÁ¡¦Â¸ºß¤·¤Ê¤¤¡¦Ìµ´Ø·¸¤½¤Î¾¡¢ +°ÕÌ£¤Î¤Ê¤¤¥»¥¯¥·¥ç¥ó¤Î»²¾È¤Ç¤¢¤ë¤³¤È¤òɽ¤¹¡£ +Î㤨¤Ð¡¢¥»¥¯¥·¥ç¥óÈÖ¹æ +.BR SHN_UNDEF +¤Ë´ØÏ¢¤Å¤±¤Æ¡ÖÄêµÁ¡×¤µ¤ì¤¿¥·¥ó¥Ü¥ë¤Ï¡¢¡Ö̤ÄêµÁ¡×¤Ê¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£ +.\"nakano ¤³¤³¤Î "defined" ¤ÏÄ̾ï¤Îʸ¤Î°ìÉô¤Ç¤Ï¡© +.TP +.BR SHN_LORESERVE +¤³¤ÎÃͤÏͽÌóºÑ¤ß¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹ÈϰϤβ¼¸Â¤ò»ØÄꤹ¤ë¡£ +.TP +.BR SHN_LOPROC +¤³¤ÎÃͰʾå¤Ç +.BR SHN_HIPROC +°Ê²¼¤ÎÃͤϡ¢¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.TP +.BR SHN_HIPROC +¤³¤ÎÃͰʲ¼¤Ç +.BR SHN_LOPROC +°Ê¾å¤ÎÃͤϡ¢¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.\"sato: SHN_{HI,LO}PROC ¤ÎÀâÌÀ¤Ï¡¢¸¶Ê¸¤Î´Ö°ã¤¤¤é¤·¤¤¡£ +.TP +.BR SHN_ABS +¤³¤ÎÃͤÏÂбþ¤¹¤ë»²¾È¤ÎÀäÂÐÃͤò»ØÄꤹ¤ë¡£ +Î㤨¤Ð¡¢¥»¥¯¥·¥ç¥óÈÖ¹æ +.BR SHN_ABS +¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥·¥ó¥Ü¥ë¤ÏÀäÂÐÃͤòÊÝ»ý¤·¡¢ºÆÇÛÃ֤˱ƶÁ¤µ¤ì¤Ê¤¤¡£ +.TP +.BR SHN_COMMON +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ë´ØÏ¢¤·¤ÆÄêµÁ¤µ¤ì¤¿¥·¥ó¥Ü¥ë¤Ï¡¢ +Fortran ¤Î COMMON ¤ä C ¤Î̤³ä¤êÅö¤Æ external ÊÑ¿ô¤Î¤è¤¦¤Ê¡¢ +¶¦ÄÌ¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£ +.TP +.BR SHN_HIRESERVE +¤³¤ÎÃͤÏͽÌ󤵤줿¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÈϰϤξå¸Â¤ò»ØÄꤹ¤ë¡£ +.BR SHN_LORESERVE +¤È +.BR SHN_HIRESERVE +¤Ï´Þ¤Þ¤ì¤ë¡£ +¤³¤ÎÃͤϥ»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤ò»²¾È¤·¤Ê¤¤¡£ +¤Ä¤Þ¤ê¡¢¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Ï +ͽÌ󤵤줿¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î¥¨¥ó¥È¥ê¤ò +.I ´Þ¤Þ¤Ê¤¤ ¡£ +.RE +.\" .El +.\" .El +.PP +¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Î¥×¥í¥°¥é¥à¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Ï¡¢ +¥·¥¹¥Æ¥à¤Ë¤è¤ë¥×¥í¥°¥é¥à¼Â¹Ô½àÈ÷¤ËɬÍפʡ¢ +¥»¥°¥á¥ó¥ÈÅù¤Î¾ðÊó¤òµ­½Ò¤¹¤ë¹½Â¤ÂΤÎÇÛÎó¤Ç¤¢¤ë¡£ +¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Î +.IR ¥»¥°¥á¥ó¥È +¤Ë¤Ï 1 ¤Ä°Ê¾å¤Î +.IR ¥»¥¯¥·¥ç¥ó +¤¬´Þ¤Þ¤ì¤ë¡£ +¥×¥í¥°¥é¥à¥Ø¥Ã¥À¤Ï¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤È¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Ç¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +¥Õ¥¡¥¤¥ë¤Ï¼«¿È¤Î¥×¥í¥°¥é¥à¥Ø¥Ã¥À¥µ¥¤¥º¤ò ELF ¥Ø¥Ã¥À¤Î +.IR e_phentsize +¥á¥ó¥Ð¤È +.IR e_phnum +¥á¥ó¥Ð¤Ç»ØÄꤹ¤ë¡£ +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 +32 ¥Ó¥Ã¥È¤È 64 ¥Ó¥Ã¥È¤Î¥×¥í¥°¥é¥à¥Ø¥Ã¥À¤Î¼ç¤Ê°ã¤¤¤Ï¡¢¹½Â¤ÂΤˤª¤±¤ë +.IR p_flags +¥á¥ó¥Ð¤Î°ÌÃ֤ˤ¢¤ë¡£ +.\" .Bl -tag -width "p_offset" +.TP 12 +.IR p_type +Phdr ¹½Â¤ÂΤΤ³¤Î¥á¥ó¥Ð¤Ï¡¢ +¤³¤ÎÇÛÎóÍ×ÁǤ¬¤É¤Î¤è¤¦¤Ê¼ïÎà¤Î¥»¥°¥á¥ó¥È¤òµ­½Ò¤·¤Æ¤¤¤ë¤«¡¢ +¤Þ¤¿¤Ï¤³¤ÎÇÛÎóÍ×ÁǤξðÊó¤ò¤É¤Î¤è¤¦¤Ë²ò¼á¤¹¤ë¤«¡¢¤òɽ¤¹¡£ +.\" .Bl -tag -width "PT_DYNAMIC" +.RS 12 +.TP 12 +.BR PT_NULL +¤³¤ÎÇÛÎóÍ×ÁǤϻÈÍѤµ¤ì¤Æ¤ª¤é¤º¡¢¤½¤Î¾¤Î¥á¥ó¥Ð¤ÎÃͤÏ̤ÄêµÁ¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¤³¤Î¥×¥í¥°¥é¥à¥Ø¥Ã¥À¤Î¥¨¥ó¥È¥ê¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.BR PT_LOAD +¤³¤ÎÇÛÎóÍ×ÁÇ¤Ï +.IR p_filesz +¤È +.IR p_memsz +¤Çµ­½Ò¤µ¤ì¤ë¥í¡¼¥É²Äǽ¥»¥°¥á¥ó¥È¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤«¤é¤Î¥Ð¥¤¥È¥Ç¡¼¥¿¤¬¡¢¤³¤Î¥á¥â¥ê¥»¥°¥á¥ó¥È¤ÎÀèƬ¤«¤é¥Þ¥Ã¥×¤µ¤ì¤ë¡£ +¥»¥°¥á¥ó¥È¤Î¥á¥â¥ê¥µ¥¤¥º +.IR Sy p_memsz +¤¬¥Õ¥¡¥¤¥ë¥µ¥¤¥º +.IR Sy p_filesz +¤è¤êÂ礭¤¤¾ì¹ç¡¢ +¡Ö;¤Ã¤¿¡×¥Ð¥¤¥È¤ÏÃÍ 0 ¤È¤Ê¤ê¡¢ +¤½¤Î¥»¥°¥á¥ó¥È½é´ü²½¥Ç¡¼¥¿¤Î¸å¤í¤ËÃÖ¤«¤ì¤ë¤ÈÄê¤á¤é¤ì¤Æ¤¤¤ë¡£ +¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ï¥á¥â¥ê¥µ¥¤¥º¤è¤êÂ礭¤¯¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +¥×¥í¥°¥é¥à¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Î¥í¡¼¥É²Äǽ¥»¥°¥á¥ó¥È¥¨¥ó¥È¥ê¤Ï¡¢ +.IR p_vaddr +¥á¥ó¥Ð¤Î¾º½ç¤Ë¥½¡¼¥È¤µ¤ì¤Æ½Ð¸½¤¹¤ë¡£ +.TP +.BR PT_DYNAMIC +¤³¤ÎÇÛÎóÍ×ÁǤÏưŪ¥ê¥ó¥¯¾ðÊó¤ò»ØÄꤹ¤ë¡£ +.TP +.BR PT_INTERP +¤³¤ÎÇÛÎóÍ×ÁǤϡ¢¥¤¥ó¥¿¥×¥ê¥¿¤È¤·¤Æµ¯Æ°¤µ¤ì¤ë¥Ñ¥¹Ì¾ (NULL ʸ»ú½ªÃ¼) +¤Î°ÌÃ֤ȥµ¥¤¥º¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥»¥°¥á¥ó¥È·¿¤Ï (¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤â¤¢¤ë¤«¤âÃΤì¤Ê¤¤¤¬) +¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤Ç¤Î¤ß°ÕÌ£¤ò»ý¤Ä¡£ +¤¿¤À¤·¡¢¤³¤Î¥»¥°¥á¥ó¥È·¿¤Ï 1 ¤Ä¤Î¥Õ¥¡¥¤¥ë¤Ë 2 ²ó°Ê¾å½Ð¸½¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¤â¤·Â¸ºß¤¹¤ë¾ì¹ç¡¢¤³¤Î¥»¥°¥á¥ó¥È·¿¤Ï +Á´¤Æ¤Î¥í¡¼¥É²Äǽ¥»¥°¥á¥ó¥È¥¨¥ó¥È¥ê¤è¤êÁ°¤Ë¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BR PT_NOTE +¤³¤ÎÇÛÎóÍ×ÁǤÏÊä­¾ðÊó (auxiliary information) ¤Î°ÌÃ֤ȥµ¥¤¥º¤ò»ØÄꤹ¤ë¡£ +.TP +.BR PT_SHLIB +¤³¤Î¥»¥°¥á¥ó¥È·¿¤ÏͽÌ󤵤ì¤Æ¤¤¤ë¤¬¡¢°ÕÌ£¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤Î·¿¤ÎÇÛÎóÍ×ÁǤòÊÝ»ý¤¹¤ë¥×¥í¥°¥é¥à¤Ï ABI ¤Ë½àµò¤·¤Ê¤¤¡£ +.TP +.BR PT_PHDR +¤³¤ÎÇÛÎóÍ×ÁǤϡ¢¤â¤·Â¸ºß¤·¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢ +¥Õ¥¡¥¤¥ë¤ª¤è¤Ó¥×¥í¥°¥é¥à¤Î¥á¥â¥ê¥¤¥á¡¼¥¸ÁÐÊý¤Ë¤ª¤±¤ë +¥×¥í¥°¥é¥à¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¼«¿È¤Î°ÌÃ֤ȥµ¥¤¥º¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥»¥°¥á¥ó¥È·¿¤Ï 1 ¤Ä¤Î¥Õ¥¡¥¤¥ë¤Ë 2 ²ó°Ê¾å½Ð¸½¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¤µ¤é¤Ë¡¢¤³¤Î¥»¥°¥á¥ó¥È·¿¤¬Â¸ºß¤·¤Æ¤â¤è¤¤¤Î¤Ï¡¢¥×¥í¥°¥é¥à¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤¬ +¥×¥í¥°¥é¥à¤Î¥á¥â¥ê¥¤¥á¡¼¥¸¤Î°ìÉô¤Ç¤¢¤ë¾ì¹ç¤Î¤ß¤Ç¤¢¤ë¡£ +¤â¤·Â¸ºß¤¹¤ë¾ì¹ç¡¢¤³¤ì¤ÏÁ´¤Æ¤Î¥í¡¼¥É²Äǽ¥»¥°¥á¥ó¥È¥¨¥ó¥È¥ê¤è¤ê +Á°¤Ë¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BR PT_LOPROC +¤³¤ÎÃͰʾå¤Ç +.BR PT_HIPROC +°Ê²¼¤ÎÃÍ¤Ï¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.TP +.BR PT_HIPROC +¤³¤ÎÃͰʲ¼¤Ç +.BR PT_LOPROC +°Ê¾å¤ÎÃÍ¤Ï¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.\"sato: PT_{HI,LO}PROC ¤ÎÀâÌÀ¤Ï¡¢¸¶Ê¸¤Î´Ö°ã¤¤¤é¤·¤¤¡£ +.TP +.BR PT_GNU_STACK +GNU ³ÈÄ¥¤Ç¤¢¤ê¡¢Linux ¥«¡¼¥Í¥ë¤¬ +.I p_flags +¤Î¥á¥ó¥Ð¡¼¤Ë¥»¥Ã¥È¤µ¤ì¤¿¥Õ¥é¥°·Ðͳ¤Ç¥¹¥¿¥Ã¥¯¤Î¾õÂÖ¤òÀ©¸æ¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£ +.\" .El +.RE +.TP +.IR p_offset +¤³¤Î¥á¥ó¥Ð¤Ï¡¢¥»¥°¥á¥ó¥È¤ÎÀèƬ¥Ð¥¤¥È¤¬¤¢¤ë +(¥Õ¥¡¥¤¥ëÀèƬ¤«¤é¤Î) ¥ª¥Õ¥»¥Ã¥È¤òÊÝ»ý¤¹¤ë¡£ +.TP +.IR p_vaddr +¤³¤Î¥á¥ó¥Ð¤Ï¡¢¥»¥°¥á¥ó¥È¤ÎÀèƬ¥Ð¥¤¥È¤¬¤¢¤ë +¥á¥â¥ê¤Î²¾ÁÛ¥¢¥É¥ì¥¹¤òÊÝ»ý¤¹¤ë¡£ +.TP +.IR p_paddr +ʪÍý¥¢¥É¥ì¥¹¤¬°ÕÌ£¤ò¤â¤Ä¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +¤³¤Î¥á¥ó¥Ð¤Ï¥»¥°¥á¥ó¥È¤ÎʪÍý¥¢¥É¥ì¥¹¤È¤·¤ÆͽÌ󤵤ì¤Æ¤¤¤ë¡£ +BSD ¤Ç¤Ï¤³¤Î¥á¥ó¥Ð¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£0 ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.IR p_filesz +¤³¤Î¥á¥ó¥Ð¤Ï¥»¥°¥á¥ó¥È¤Î¥Õ¥¡¥¤¥ë¥¤¥á¡¼¥¸¤Î¥Ð¥¤¥È¿ô¤òÊÝ»ý¤¹¤ë¡£ +¤³¤ì¤Ï 0 ¤Ç¤â¤è¤¤¡£ +.TP +.IR p_memsz +¤³¤Î¥á¥ó¥Ð¤Ï¥»¥°¥á¥ó¥È¤Î¥á¥â¥ê¥¤¥á¡¼¥¸¤Î¥Ð¥¤¥È¿ô¤òÊÝ»ý¤¹¤ë¡£ +¤³¤ì¤Ï 0 ¤Ç¤â¤è¤¤¡£ +.TP +.IR p_flags +¤³¤Î¥á¥ó¥Ð¤Ï¥»¥°¥á¥ó¥È¤Ë´ØÏ¢¤¹¤ë¥Õ¥é¥°¤Î¥Ó¥Ã¥È¥Þ¥Ã¥×¤òÊÝ»ý¤¹¤ë: +.\" .Bl -tag -width "PF_X" -compact +.RS 12 +.TP +.PD 0 +.BR PF_X +¼Â¹Ô²Äǽ¥»¥°¥á¥ó¥È¡£ +.TP +.BR PF_W +½ñ¤­¹þ¤ß²Äǽ¥»¥°¥á¥ó¥È. +.TP +.BR PF_R +Æɤ߹þ¤ß²Äǽ¥»¥°¥á¥ó¥È¡£ +.PD +.RE +.\" .El +.IP +¥Æ¥­¥¹¥È¥»¥°¥á¥ó¥È¤Ï°ìÈ̤˥ե饰 +.BR PF_X +¤È +.BR PF_R +¤ò»ý¤Ä¡£ +¥Ç¡¼¥¿¥»¥°¥á¥ó¥È¤Ï°ìÈÌ¤Ë +.BR PF_X , +.BR PF_W , +.BR PF_R +¤ò»ý¤Ä¡£ +.TP +.IR p_align +¤³¤Î¥á¥ó¥Ð¤Ï¡¢¥»¥°¥á¥ó¥È¤¬¥á¥â¥ê¤ª¤è¤Ó¥Õ¥¡¥¤¥ë¤Ë¤ª¤¤¤ÆÇÛÃÖ (align) +¤µ¤ì¤ëÃͤòÊÝ»ý¤¹¤ë¡£ +.\"nakano align ¤ÎÄêÌõ¤Ï¤¢¤ê¤Þ¤·¤¿¤Ã¤±¡© +¥í¡¼¥É²Äǽ¥×¥í¥»¥¹¥»¥°¥á¥ó¥È¤Ï¡¢¥Ú¡¼¥¸¥µ¥¤¥º¤òË¡¤È¤·¤Æ +.IR p_vaddr +¤È +.IR p_offset +¤È¹çƱ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(ÌõÃí:¡Öp_vaddr mod ¥Ú¡¼¥¸¥µ¥¤¥º = p_offset mod ¥Ú¡¼¥¸¥µ¥¤¥º¡× +¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£¡£ +.\"nakano ¤³¤¦¤¤¤¦¾ì¹ç¤ÏÉáÄÌ congruent "with" ¤À¤±¤É¡Ä +0 ¤È 1 ¤È¤¤¤¦ÃͤÏÇÛÃÖ¤¬É¬Íפʤ¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ +.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 +¥Õ¥¡¥¤¥ë¤Î¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Ë¤Ï¡¢ +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤Î¾ì½ê¤¬µ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Ï +.I Elf32_Shdr +¹½Â¤ÂΤޤ¿¤Ï +.I Elf64_Shdr +¹½Â¤ÂΤÎÇÛÎó¤Ç¤¢¤ë¡£ +ELF ¥Ø¥Ã¥À¤Î +.IR e_shoff +¥á¥ó¥Ð¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤«¤é +¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Ø¤Î¥Ð¥¤¥È¥ª¥Õ¥»¥Ã¥È¤Ç¤¢¤ë¡£ +.IR e_shnum +¤Ï¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤Ë´Þ¤Þ¤ì¤ë¥¨¥ó¥È¥ê¤Î¿ô¤òÊÝ»ý¤¹¤ë¡£ +.IR e_shentsize +¤Ï³Æ¥¨¥ó¥È¥ê¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤òÊÝ»ý¤¹¤ë¡£ +.PP +¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¡¢¤³¤ÎÇÛÎó¤ÎÍ×ÁǤò»ØÄꤹ¤ë¡£ +¤¤¤¯¤Ä¤«¤Î¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÏͽÌ󤵤ì¤Æ¤¤¤ë¡£ +¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Ï¡¢¤³¤ì¤é¤ÎÆÃÊ̤ʥ¤¥ó¥Ç¥Ã¥¯¥¹¤ËÂбþ¤¹¤ë +¥»¥¯¥·¥ç¥ó¤ò»ý¤¿¤Ê¤¤: +.\" .Bl -tag -width "SHN_LORESERVE" +.TP 14 +.BR SHN_UNDEF +¤³¤ÎÃͤÏ̤ÄêµÁ¡¦ÉÔÌÀ¡¦Ìµ´Ø·¸¡¦Ìµ°ÕÌ£¤Ê¥»¥¯¥·¥ç¥ó»²¾È¤Î°õ¤È¤Ê¤ë¡£ +.TP +.BR SHN_LORESERVE +¤³¤ÎÃͤÏͽÌóºÑ¤ß¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹Îΰè¤Î²¼¸Â¤ò»ØÄꤹ¤ë¡£ +.TP +.BR SHN_LOPROC +¤³¤ÎÃͰʾå¤Ç +.BR SHN_HIPROC +°Ê²¼¤ÎÃÍ¤Ï¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.TP +.BR SHN_HIPROC +¤³¤ÎÃͰʲ¼¤Ç +.BR SHN_HIPROC +°Ê¾å¤ÎÃÍ¤Ï¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.\"sato: SHN_{HI,LO}PROC ¤ÎÀâÌÀ¤Ï¡¢¸¶Ê¸¤Î´Ö°ã¤¤¤é¤·¤¤¡£ +.TP +.BR SHN_ABS +¤³¤ÎÃͤÏÂбþ¤¹¤ë»²¾È¤ÎÀäÂÐÃͤò»ØÄꤹ¤ë¡£ +Î㤨¤Ð¡¢¥»¥¯¥·¥ç¥óÈÖ¹æ +.BR SHN_ABS +¤Ë´ØÏ¢¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥·¥ó¥Ü¥ë¤Ï¡¢ +ÀäÂÐÃͤòÊÝ»ý¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ºÆÇÛÃ֤˱ƶÁ¤µ¤ì¤Ê¤¤¡£ +.\"nakano "relative to" ¤¬¤Á¤ç¤Ã¤ÈÌõ¤·¤Ë¤¯¤¤¡£ +.\"nakano Íפ¹¤ë¤Ë SHN_ABS ¤Î¥»¥¯¥·¥ç¥ó¤Ë¤ÏÀäÂÐÃͤ¬ store ¤µ¤ì¤ë¡¢ +.\"nakano ¸å½Ò¤Î SHN_COMMON ¤Ë¤Ï global ÊÑ¿ô¤¬ store ¤µ¤ì¤ë¡¢ +.\"nakano ¤È¤¤¤¦¤³¤È¤Ê¤Î¤Ç¤·¤ç¤¦¤¬¡£ +.TP +.BR SHN_COMMON +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ë´ØÏ¢¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥·¥ó¥Ü¥ë¤Ï¡¢ +FORTRAN ¤Î COMMON ¤ä C ¤Î̤³ä¤êÅö¤Æ³°ÉôÊÑ¿ô¤Î¤è¤¦¤Ê¶¦ÄÌ¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£ +.TP +.BR SHN_HIRESERVE +¤³¤ÎÃͤÏͽÌóºÑ¤ß¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹Îΰè¤Î¾å¸Â¤ò»ØÄꤹ¤ë¡£ +¥·¥¹¥Æ¥à¤Ï +.BR SHN_LORESERVE +¤È +.BR SHN_HIRESERVE +¤ò´Þ¤àÈϰϤòͽÌ󤹤롣 +¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¤ÏͽÌ󤵤줿¥¤¥ó¥Ç¥Ã¥¯¥¹¤ËÂбþ¤¹¤ë¥¨¥ó¥È¥ê¤ò»ý¤¿¤Ê¤¤¡£ +.\" .El +.PP +¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¤Ï°Ê²¼¤Î¹½Â¤ÂΤò»ý¤Ä: +.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 +32 ¥Ó¥Ã¥È¤È 64 ¥Ó¥Ã¥È¤Î¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¤Ë¤Ï¼ÂºÝ¤Î°ã¤¤¤Ï¤Ê¤¤¡£ +.\" .Bl -tag -width "sh_addralign" +.TP 10 +.IR sh_name +¤³¤Î¥á¥ó¥Ð¤Ï¥»¥¯¥·¥ç¥ó̾¤òÄê¤á¤ë¡£ +¤³¤ÎÃͤϥ»¥¯¥·¥ç¥ó¥Ø¥Ã¥Àʸ»úÎó¥Æ¡¼¥Ö¥ë¥»¥¯¥·¥ç¥ó¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤¢¤ê¡¢ +NULL ʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Î¾ì½ê¤ò¼¨¤¹¡£ +.TP +.IR sh_type +¤³¤Î¥á¥ó¥Ð¤Ï¥»¥¯¥·¥ç¥ó¤ÎÆâÍƤȰÕÌ£¤¬´Þ¤Þ¤ì¤ë¥«¥Æ¥´¥ê¤ò¼¨¤¹¡£ +.\" .Bl -tag -width "SHT_PROGBITS" +.RS 10 +.TP 15 +.BR SHT_NULL +¤³¤ÎÃͤϥ»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¤¬ÉÔ³èÀ­¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +¤³¤ì¤Ï´ØÏ¢¤¹¤ë¥»¥¯¥·¥ç¥ó¤ò»ý¤¿¤Ê¤¤¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¤Î¾¤Î¥á¥ó¥Ð¤Ï¡¢Ì¤ÄêµÁ¤ÎÃͤò»ý¤Ä¡£ +.TP +.BR SHT_PROGBITS +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥×¥í¥°¥é¥à¤Ë¤è¤êÄêµÁ¤µ¤ì¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¾ðÊó¤Î·Á¼°¤È°ÕÌ£¤Ï¡¢¤Ò¤È¤¨¤Ë¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ·èÄꤵ¤ì¤ë¡£ +.TP +.BR SHT_SYMTAB +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤òÊÝ»ý¤¹¤ë¡£ +°ìÈÌ¤Ë¤Ï +.BR SHT_SYMTAB +¤Ï¥ê¥ó¥¯ÊÔ½¸¤Î¤¿¤á¤Î¥·¥ó¥Ü¥ë¤òÄ󶡤¹¤ë¤¬¡¢ +ưŪ¥ê¥ó¥¯¤Ë¤â»È¤ï¤ì¤ë¡£ +´°Á´¤Ê¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤È¤·¤Æ¡¢Æ°Åª¥ê¥ó¥¯¤Ë¤ÏÉÔÍ×¤Ê +¿¤¯¤Î¥·¥ó¥Ü¥ë¤òÊÝ»ý¤Ç¤­¤ë¡£ +¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤â +.BR SHT_DYNSYM +¥»¥¯¥·¥ç¥ó¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR SHT_STRTAB +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ïʸ»úÎó¥Æ¡¼¥Ö¥ë¤òÊÝ»ý¤¹¤ë¡£ +¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤ÏÊ£¿ô¤Îʸ»úÎó¥Æ¡¼¥Ö¥ë¥»¥¯¥·¥ç¥ó¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR SHT_RELA +¤³¤Î¥»¥¯¥·¥ç¥ó¤ÏÌÀ¼¨Åª¤Ê²Ã¿ô (addend) ¤ò»ý¤ÄºÆÇÛÃÖ¥¨¥ó¥È¥ê¤òÊÝ»ý¤¹¤ë¡£ +ºÆÇÛÃÖ¥¨¥ó¥È¥ê¤Î·¿¤Ï¡¢¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Î 32 ¥Ó¥Ã¥È¥¯¥é¥¹¤Ç¤Ï +.IR Elf32_Rela +¤Ç¤¢¤ë¡£ +¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤ÏÊ£¿ô¤ÎºÆÇÛÃÖ¥»¥¯¥·¥ç¥ó¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR SHT_HASH +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥·¥ó¥Ü¥ë¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤òÊÝ»ý¤¹¤ë¡£ +ưŪ¥ê¥ó¥¯¤µ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢ +¥·¥ó¥Ü¥ë¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ò´Þ¤ó¤Ç¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Ï 1 ¤Ä¤Î¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Î¤ß¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR SHT_DYNAMIC +¤³¤Î¥»¥¯¥·¥ç¥ó¤ÏưŪ¥ê¥ó¥¯¤Î¾ðÊó¤òÊÝ»ý¤¹¤ë¡£ +¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Ï 1 ¤Ä¤ÎưŪ¥»¥¯¥·¥ç¥ó¤Î¤ß¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR SHT_NOTE +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥Õ¥¡¥¤¥ë¤Ë²¿¤é¤«¤Î°õ¤òÉÕ¤±¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë¡£ +.TP +.BR SHT_NOBITS +¤³¤Î¥¿¥¤¥×¤Î¥»¥¯¥·¥ç¥ó¤Ï¥Õ¥¡¥¤¥ë¤ÎÎΰè¤ò»È¤ï¤Ê¤¤¤È¤¤¤¦°Ê³°¤Ï¡¢ +.BR SHT_PROGBITS +¤È»÷¤Æ¤¤¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï 1 ¥Ð¥¤¥È¤â´Þ¤Þ¤Ê¤¤¤¬¡¢ +.IR sh_offset +¥á¥ó¥Ð¤Ï³µÇ°Åª¤Ê¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ò»ý¤Ä¡£ +.TP +.BR SHT_REL +¤³¤Î¥»¥¯¥·¥ç¥ó¤ÏÌÀ¼¨Åª¤Ê²Ã¿ô¤ò»ý¤¿¤Ê¤¤ºÆÇÛÃÖ¥ª¥Õ¥»¥Ã¥È¤òÊÝ»ý¤¹¤ë¡£ +ºÆÇÛÃÖ¥ª¥Õ¥»¥Ã¥È¤Î·¿¤Ï¡¢¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Î 32 ¥Ó¥Ã¥È¥¯¥é¥¹¤Ç¤Ï +.IR Elf32_Rel +¤Ç¤¢¤ë¡£ +¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤ÏÊ£¿ô¤ÎºÆÇÛÃÖ¥»¥¯¥·¥ç¥ó¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR SHT_SHLIB +¤³¤Î¥»¥¯¥·¥ç¥ó¤ÏͽÌ󤵤ì¤Æ¤¤¤ë¤¬¡¢°ÕÌ£¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.BR SHT_DYNSYM +¤³¤Î¥»¥¯¥·¥ç¥ó¤ÏưŪ¥ê¥ó¥¯¥·¥ó¥Ü¥ë¤ÎºÇ¾®¥»¥Ã¥È¤òÊÝ»ý¤¹¤ë¡£ +¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Ï +.BR SHT_SYMTAB +¥»¥¯¥·¥ç¥ó¤â´Þ¤à¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR SHT_LOPROC +¤³¤ÎÃͰʾå¤Ç +.BR SHT_HIPROC +°Ê²¼¤ÎÈÏ°Ï¤Ï¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.TP +.BR SHT_HIPROC +¤³¤ÎÃͰʲ¼¤Ç +.BR SHT_LOPROC +°Ê¾å¤ÎÈÏ°Ï¤Ï¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.TP +.BR SHT_LOUSER +¤³¤ÎÃͤϥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Î¤¿¤á¤ËͽÌ󤵤ì¤ë +¥¤¥ó¥Ç¥Ã¥¯¥¹ÈϰϤβ¼¸Â¤ò»ØÄꤹ¤ë¡£ +.TP +.BR SHT_HIUSER +¤³¤ÎÃͤϥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Î¤¿¤á¤ËͽÌ󤵤ì¤ë +¥¤¥ó¥Ç¥Ã¥¯¥¹ÈϰϤξå¸Â¤ò»ØÄꤹ¤ë¡£ +.BR SHT_LOUSER +¤«¤é +.BR SHT_HIUSER +¤Î´Ö¤Î¥»¥¯¥·¥ç¥ó¥¿¥¤¥×¤Ï¡¢ +¸½ºß¤Þ¤¿¤Ï¾­Íè¤Î¥·¥¹¥Æ¥àÄêµÁ¥»¥¯¥·¥ç¥ó¥¿¥¤¥×¤È¾×Æͤ¹¤ë¤³¤È¤Ê¤¯¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\" .El +.RE +.TP +.IR sh_flags +ÍÍ¡¹¤Ê°À­¤òµ­½Ò¤¹¤ë¤¿¤á¤Î 1 ¥Ó¥Ã¥È¤Î¥Õ¥é¥°¤ò¥µ¥Ý¡¼¥È¤¹¤ë¥»¥¯¥·¥ç¥ó¡£ +¥Õ¥é¥°¥Ó¥Ã¥È¤¬ +.IR sh_flags +¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¤½¤Î¥»¥¯¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Î°À­¤Ï +"¥ª¥ó" +¤Ë¤Ê¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢Â°À­¤¬ +"¥ª¥Õ" +¤Ç¤¢¤ë¤«Â°À­¤¬Å¬ÍѤµ¤ì¤Ê¤¤¡£ +̤ÄêµÁ¤Î°À­¤Ï 0 ¤ËÀßÄꤵ¤ì¤ë¡£ +.\" .Bl -tag -width "SHF_EXECINSTR" -compact +.RS 10 +.TP 15 +.BR SHF_WRITE +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥×¥í¥»¥¹¼Â¹ÔÃæ¤Ë½ñ¤­¹þ¤ß²Äǽ¤Ê¥Ç¡¼¥¿¤ò´Þ¤à¡£ +.TP +.BR SHF_ALLOC +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥×¥í¥»¥¹¼Â¹ÔÃæ¤Ë¥á¥â¥ê¤ò»ÈÍѤ¹¤ë¡£ +À©¸æ¥»¥¯¥·¥ç¥ó¤ÎÃæ¤Ë¤Ï¡¢¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Î¥á¥â¥ê¥¤¥á¡¼¥¸¤Ë¤Ï +¸ºß¤·¤Ê¤¤¤â¤Î¤â¤¢¤ë¡£ +¤½¤¦¤·¤¿¥»¥¯¥·¥ç¥ó¤Î¾ì¹ç¡¢¤³¤Î°À­¤Ï¥ª¥Õ¤Ç¤¢¤ë¡£ +.TP +.BR SHF_EXECINSTR +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¼Â¹Ô²Äǽ¤Ê¥Þ¥·¥óÌ¿Îá¤ò´Þ¤à¡£ +.TP +.BR SHF_MASKPROC +¤³¤Î¥Þ¥¹¥¯¤Ë´Þ¤Þ¤ì¤ëÁ´¤Æ¤Î¥Ó¥Ã¥È¤Ï¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.RE +.\" .El +.TP +.IR sh_addr +¤³¤Î¥»¥¯¥·¥ç¥ó¤¬¥×¥í¥»¥¹¤Î¥á¥â¥ê¥¤¥á¡¼¥¸¤Ë¤¢¤ë¾ì¹ç¡¢ +¤³¤Î¥á¥ó¥Ð¤Ï¥»¥¯¥·¥ç¥ó¤ÎºÇ½é¤Î¥Ð¥¤¥È¤¬Â¸ºß¤¹¤ë¥¢¥É¥ì¥¹¤òÊÝ»ý¤¹¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¤³¤Î¥á¥ó¥Ð¤Ï 0 ¤Ç¤¢¤ë¡£ +.TP +.IR sh_offset +¤³¤Î¥á¥ó¥Ð¤ÎÃͤϡ¢¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤«¤é¥»¥¯¥·¥ç¥ó¤ÎºÇ½é¤Î¥Ð¥¤¥È¤Ø¤Î +¥Ð¥¤¥È¥ª¥Õ¥»¥Ã¥È¤òÊÝ»ý¤¹¤ë¡£ +¥»¥¯¥·¥ç¥ó¥¿¥¤¥× +.BR SHT_NOBITS +¤Ï¥Õ¥¡¥¤¥ë¤ÎÎΰè¤òÁ´¤¯»ÈÍѤ»¤º¡¢¤³¤Î¥¿¥¤¥×¤Î +.IR sh_offset +¥á¥ó¥Ð¤Ï¥Õ¥¡¥¤¥ë¤Î³µÇ°Åª¤Ê°ÌÃÖ¤ò¼¨¤¹¡£ +.\"nakano conceptual placement ¤È¤Ï¡© +.TP +.IR sh_size +¤³¤Î¥á¥ó¥Ð¤Ï¥»¥¯¥·¥ç¥ó¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤òÊÝ»ý¤¹¤ë¡£ +¥»¥¯¥·¥ç¥ó¥¿¥¤¥×¤¬ +.BR SHT_NOBITS +¤Ç¤Ê¤¤¸Â¤ê¡¢¤½¤Î¥»¥¯¥·¥ç¥ó¤Ï¥Õ¥¡¥¤¥ëÃæ¤Î +.IR sh_size +¥Ð¥¤¥È¤ò»ÈÍѤ¹¤ë¡£ +¥¿¥¤¥×¤¬ +.BR SHT_NOBITS +¤Î¥»¥¯¥·¥ç¥ó¤Ï¥µ¥¤¥º¤¬ 0 ¤Ç¤Ê¤¤¤¬¡¢¥Õ¥¡¥¤¥ë¤ÎÎΰè¤ò»ÈÍѤ·¤Ê¤¤¡£ +.TP +.IR sh_link +¤³¤Î¥á¥ó¥Ð¤Ï¡¢¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹¥ê¥ó¥¯¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î²ò¼á¤Ï¥»¥¯¥·¥ç¥ó¥¿¥¤¥×¤Ë°Í¸¤¹¤ë¡£ +.TP +.IR sh_info +¤³¤Î¥á¥ó¥Ð¤ÏÄɲþðÊó¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î²ò¼á¤Ï¥»¥¯¥·¥ç¥ó¥¿¥¤¥×¤Ë°Í¸¤¹¤ë¡£ +.TP +.IR sh_addralign +¥¢¥É¥ì¥¹ÇÛÃÖ¤ËÀ©Ì󤬤¢¤ë¥»¥¯¥·¥ç¥ó¤â¤¢¤ë¡£ +¥»¥¯¥·¥ç¥ó¤¬ÇÜŸì (doubleword) ¤òÊÝ»ý¤¹¤ë¾ì¹ç¡¢ +¥·¥¹¥Æ¥à¤ÏÁ´¤Æ¤Î¥»¥¯¥·¥ç¥ó¤Ë¤Ä¤¤¤ÆÇÜŸì¤ÎÇÛÃÖ¤òÊݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤Ä¤Þ¤ê¡¢ +.IR sh_addr +¤ÎÃÍ¤Ï +.IR sh_addralign +¤ÎÃͤòË¡¤È¤·¤Æ 0 ¤È¹çƱ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(ÌõÃí:¡Ösh_addr mod sh_addralign = 0 ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ +2 ¤Î 0 ¾è¤ÈÀµ¤ÎÀ°¿ô¾è¤Î¤ß¤¬µö²Ä¤µ¤ì¤ë¡£ +0 ¤Þ¤¿¤Ï 1 ¤Ï¥»¥¯¥·¥ç¥ó¤ÎÇÛÃÖ¤ËÀ©Ì󤬤ʤ¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.TP +.IR sh_entsize +¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤Î¤è¤¦¤Ê¸ÇÄꥵ¥¤¥º¥¨¥ó¥È¥ê¤Î¥Æ¡¼¥Ö¥ë¤òÊÝ»ý¤¹¤ë +¥»¥¯¥·¥ç¥ó¤â¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¥»¥¯¥·¥ç¥ó¤Ç¤Ï¡¢ +¤³¤Î¥á¥ó¥Ð¤Ï³Æ¥¨¥ó¥È¥ê¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤òɽ¤¹¡£ +¤³¤Î¥á¥ó¥Ð¤¬ 0 ¤Î¾ì¹ç¡¢ +¤½¤Î¥»¥¯¥·¥ç¥ó¤Ï¸ÇÄꥵ¥¤¥º¥¨¥ó¥È¥ê¤Î¥Æ¡¼¥Ö¥ë¤òÊÝ»ý¤·¤Ê¤¤¡£ +.\" .El +.PP +¤µ¤Þ¤¶¤Þ¤Ê¥»¥¯¥·¥ç¥ó¤Ë¥×¥í¥°¥é¥à¾ðÊó¡¦À©¸æ¾ðÊó¤¬ÊÝ»ý¤µ¤ì¤ë: +.\" .Bl -tag -width ".shstrtab" +.TP 10 +.IR .bss +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥×¥í¥°¥é¥à¤Î¥á¥â¥ê¥¤¥á¡¼¥¸¤ËÇÛÃÖ¤µ¤ì¤ë +Èó½é´ü²½¥Ç¡¼¥¿¤òÊÝ»ý¤¹¤ë¡£ +ÄêµÁ¾å¡¢¥·¥¹¥Æ¥à¤Ï¥×¥í¥°¥é¥à¤Î¼Â¹Ô³«»Ï»þ¤Ë¡¢¥Ç¡¼¥¿¤ò 0 ¤Ç½é´ü²½¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_NOBITS +¤Ç¤¢¤ë¡£ +°À­¥¿¥¤¥×¤Ï +.BR SHF_ALLOC +¤È +.BR SHF_WRITE +¤Ç¤¢¤ë¡£ +.TP +.IR .comment +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥Ð¡¼¥¸¥ç¥óÀ©¸æ¾ðÊó¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +°À­¥¿¥¤¥×¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£ +.TP +.IR .ctors +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï C++ ¥³¥ó¥¹¥È¥é¥¯¥¿´Ø¿ô¤Ø¤Î½é´ü²½¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +°À­¥¿¥¤¥×¤Ï +.BR SHF_ALLOC +¤È +.BR SHF_WRITE +¤Ç¤¢¤ë¡£ +.TP +.IR .data +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥×¥í¥°¥é¥à¤Î¥á¥â¥ê¥¤¥á¡¼¥¸¤ËÇÛÃÖ¤µ¤ì¤ë +½é´ü²½ºÑ¤ß¥Ç¡¼¥¿¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +°À­¥¿¥¤¥×¤Ï +.BR SHF_ALLOC +¤È +.BR SHF_WRITE +¤Ç¤¢¤ë¡£ +.TP +.IR .data1 +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥×¥í¥°¥é¥à¤Î¥á¥â¥ê¥¤¥á¡¼¥¸¤ËÇÛÃÖ¤µ¤ì¤ë +½é´ü²½ºÑ¤ß¥Ç¡¼¥¿¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +°À­¥¿¥¤¥×¤Ï +.BR SHF_ALLOC +¤È +.BR SHF_WRITE +¤Ç¤¢¤ë¡£ +.TP +.IR .debug +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥Ç¥Ð¥Ã¥°ÍѤξðÊó¤òÊÝ»ý¤¹¤ë¡£ +¤½¤ÎÆâÍƤϻØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +°À­¥¿¥¤¥×¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£ +.TP +.IR .dtors +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï C++ ¥Ç¥¹¥È¥é¥¯¥¿´Ø¿ô¤Ø¤Î½é´ü²½¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +°À­¥¿¥¤¥×¤Ï +.BR SHF_ALLOC +¤È +.BR SHF_WRITE +¤Ç¤¢¤ë¡£ +.TP +.IR .dynamic +¤³¤Î¥»¥¯¥·¥ç¥ó¤ÏưŪ¥ê¥ó¥¯¾ðÊó¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î°À­¤Ï +.BR SHF_ALLOC +¥Ó¥Ã¥È¤ò´Þ¤à¡£ +.BR SHF_WRITE +¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤ë¤«Èݤ«¤Ï¥×¥í¥»¥Ã¥µ¤Ë¤è¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_DYNAMIC +¤Ç¤¢¤ë¡£ +¾åµ­¤Î°À­¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.IR .dynstr +¤³¤Î¥»¥¯¥·¥ç¥ó¤ÏưŪ¥ê¥ó¥¯¤ËɬÍפÊʸ»úÎó¤òÊÝ»ý¤¹¤ë¡£ +ºÇ¤â°ìÈÌŪ¤Ë¤Ï¡¢¤³¤Îʸ»úÎó¤Ï¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¤È +´ØÏ¢¤Å¤±¤é¤ì¤¿Ì¾Á°¤òɽ¤¹¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_STRTAB +¤Ç¤¢¤ë¡£ +»ÈÍѤµ¤ì¤ë°À­¥¿¥¤¥×¤Ï +.BR SHF_ALLOC +¤Ç¤¢¤ë¡£ +.TP +.IR .dynsym +¤³¤Î¥»¥¯¥·¥ç¥ó¤ÏưŪ¥ê¥ó¥¯¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_DYNSYM +¤Ç¤¢¤ë¡£ +»ÈÍѤµ¤ì¤ë°À­¥¿¥¤¥×¤Ï +.BR SHF_ALLOC +¤Ç¤¢¤ë¡£ +.TP +.IR .fini +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥×¥í¥»¥¹½ªÎ»¥³¡¼¥É¤ËÃÖ¤«¤ì¤ë¼Â¹Ô²Äǽ̿Îá¤òÊÝ»ý¤¹¤ë¡£ +¥×¥í¥»¥¹¤¬Àµ¾ï¤Ë½ªÎ»¤·¤¿¾ì¹ç¡¢¥·¥¹¥Æ¥à¤Ï¤³¤Î¥»¥¯¥·¥ç¥ó¤Ë¤¢¤ë +¥³¡¼¥É¤òÇÛÃÖ¤·¤Æ¼Â¹Ô¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +»ÈÍѤµ¤ì¤ë°À­¥¿¥¤¥×¤Ï +.BR SHF_ALLOC +¤È +.BR SHF_EXECINSTR +¤Ç¤¢¤ë¡£ +.TP +.IR .gnu.version +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥Ð¡¼¥¸¥ç¥ó¡¦¥·¥ó¥Ü¥ë¡¦¥Æ¡¼¥Ö¥ë¤òÊÝ»ý¤¹¤ë¡£ +¤½¤ÎÆâÍÆ¤Ï +.I ElfN_Half +Í×ÁǤÎÇÛÎó¤Ç¤¢¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.B SHT_GNU_versym +¤Ç¤¢¤ë¡£ +»ÈÍѤµ¤ì¤ë°À­¥¿¥¤¥×¤Ï +.B SHF_ALLOC +¤Ç¤¢¤ë¡£ +.TP +.IR .gnu.version_d +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥Ð¡¼¥¸¥ç¥ó¥·¥ó¥Ü¥ë¤ÎÄêµÁ¤òÊÝ»ý¤¹¤ë¡£ +¤½¤ÎÆâÍÆ¤Ï +.I ElfN_Verdef +¹½Â¤ÂΤΥơ¼¥Ö¥ë¤Ç¤¢¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.B SHT_GNU_verdef +¤Ç¤¢¤ë¡£ +»ÈÍѤµ¤ì¤ë°À­¥¿¥¤¥×¤Ï +.B SHF_ALLOC +¤Ç¤¢¤ë¡£ +.TP +.IR .gnu.version_r +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥Ð¡¼¥¸¥ç¥ó¥·¥ó¥Ü¥ë¤¬É¬ÍפȤ¹¤ëÍ×ÁǤòÊÝ»ý¤¹¤ë¡£ +¤½¤ÎÆâÍÆ¤Ï +.I ElfN_Verneed +¹½Â¤ÂΤΥơ¼¥Ö¥ë¤Ç¤¢¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.B SHT_GNU_versym +¤Ç¤¢¤ë¡£ +»ÈÍѤµ¤ì¤ë°À­¥¿¥¤¥×¤Ï +.B shf_alloc +¤Ç¤¢¤ë¡£ +.TP +.IR .got +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥°¥í¡¼¥Ð¥ë¥ª¥Õ¥»¥Ã¥È¥Æ¡¼¥Ö¥ë¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +°À­¤Ï¥×¥í¥»¥Ã¥µËè¤Ë°Û¤Ê¤ë¡£ +.TP +.IR .hash +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥·¥ó¥Ü¥ë¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤òÊÝ»ý¤¹¤ë¡£ +¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_HASH +¤Ç¤¢¤ë¡£ +»ÈÍѤµ¤ì¤ë°À­¤Ï +.BR SHF_ALLOC +¤Ç¤¢¤ë¡£ +.TP +.IR .init +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥×¥í¥»¥¹½é´ü²½¥³¡¼¥É¤ËÇÛÃÖ¤µ¤ì¤ë¼Â¹Ô²Äǽ̿Îá¤òÊÝ»ý¤¹¤ë¡£ +¥×¥í¥°¥é¥à¤¬¼Â¹Ô¤ò³«»Ï¤¹¤ë¤È¡¢ +¥·¥¹¥Æ¥à¤Ï¥á¥¤¥ó¥×¥í¥°¥é¥à¥¨¥ó¥È¥ê¥Ý¥¤¥ó¥È¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë¡¢ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ë¤¢¤ë¥³¡¼¥É¤òÇÛÃÖ¤·¤Æ¼Â¹Ô¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +»ÈÍѤµ¤ì¤ë°À­¤Ï +.BR SHF_ALLOC +¤È +.BR SHF_EXECINSTR +¤Ç¤¢¤ë¡£ +.TP +.IR .interp +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥×¥í¥°¥é¥à¥¤¥ó¥¿¥×¥ê¥¿¤Î¥Ñ¥¹Ì¾¤òÊÝ»ý¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤Ë¤³¤Î¥»¥¯¥·¥ç¥ó¤ò´Þ¤à¥í¡¼¥É²Äǽ¥»¥°¥á¥ó¥È¤¬¤¢¤ë¾ì¹ç¡¢ +¤½¤Î¥»¥¯¥·¥ç¥ó¤Î°À­¤Ë¤Ï +.BR SHF_ALLOC +¥Ó¥Ã¥È¤¬´Þ¤Þ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤³¤Î¥Ó¥Ã¥È¤Ï¥ª¥Õ¤Ë¤Ê¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +.TP +.IR .line +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥Ç¥Ð¥Ã¥°¤Î¤¿¤á¤Î¹ÔÈÖ¹æ¾ðÊó¤òÊÝ»ý¤¹¤ë¡£ +¤³¤³¤Ë¤Ï¥×¥í¥°¥é¥à¥½¡¼¥¹¥³¡¼¥É¤È¥Þ¥·¥ó¥³¡¼¥É¤ÎÂбþ´Ø·¸¤¬µ­½Ò¤µ¤ì¤ë¡£ +ÆâÍƤϻØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +°À­¥¿¥¤¥×¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£ +.TP +.IR .note +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï°Ê²¼¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë +"Note Section" +·Á¼°¤Ç¾ðÊó¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_NOTE +¤Ç¤¢¤ë¡£ +°À­¥¿¥¤¥×¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£ +Ä̾ï +OpenBSD +¥Í¥¤¥Æ¥£¥Ö¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤Ï¼«¿È¤ò¼±Ê̤¹¤ë¤¿¤á¤Ë +.IR .note.openbsd.ident +¥»¥¯¥·¥ç¥ó¤ò»ý¤Ä¡£ +¤³¤ì¤Ë¤è¤ê¥«¡¼¥Í¥ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤¹¤ëºÝ¤Ë +¸ß´¹ ELF ¥Ð¥¤¥Ê¥ê¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¥Æ¥¹¥È¤ò²óÈò¤Ç¤­¤ë¡£ +.TP +.IR .note.GNU-stack +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï Linux ¤Î¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Ç +¥¹¥¿¥Ã¥¯Â°À­¤òÀë¸À¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.B SHT_PROGBITS +¤Ç¤¢¤ë¡£»ÈÍѤµ¤ì¤ë°À­¤Ï +.B SHF_EXECINSTR +¤À¤±¤Ç¤¢¤ë¡£¤³¤Î°À­¤Ï GNU ¥ê¥ó¥«¤ËÂФ·¤Æ +¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤¬¼Â¹Ô²Äǽ¤Ê¥¹¥¿¥Ã¥¯ (executable stack) ¤òɬÍפȤ¹¤ë +¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.IR .plt +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¼ê³¤­ (procedure) ¥ê¥ó¥¯¥Æ¡¼¥Ö¥ë¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +°À­¤Ï¥×¥í¥»¥Ã¥µËè¤Ë°Û¤Ê¤ë¡£ +.TP +.IR .relNAME +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï°Ê²¼¤Ëµ­½Ò¤µ¤ì¤ëºÆÇÛÃÖ¾ðÊó¤òÊÝ»ý¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬ºÆÇÛÃÖ¤ò´Þ¤à¥í¡¼¥É²Äǽ¥»¥°¥á¥ó¥È¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î°À­¤Ï +.BR SHF_ALLOC +¥Ó¥Ã¥È¤ò´Þ¤à¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¤½¤Î¥Ó¥Ã¥È¤Ï¥ª¥Õ¤Ç¤¢¤ë¡£ +´·Îã¤È¤·¤Æ¡¢ +"NAME" +¤ÏºÆÇÛÃÖ¤¬Å¬ÍѤµ¤ì¤ë¥»¥¯¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤ë¡£ +¤è¤Ã¤Æ +.BR .text +¤Ë¤Ä¤¤¤Æ¤ÎºÆÇÛÃÖ¥»¥¯¥·¥ç¥ó¤Ï¡¢Ä̾ï¤Ï +.BR .rel.text +¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_REL +¤Ç¤¢¤ë¡£ +.TP +.IR .relaNAME +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï°Ê²¼¤Ëµ­½Ò¤µ¤ì¤ëºÆÇÛÃÖ¾ðÊó¤òÊÝ»ý¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬ºÆÇÛÃÖ¤ò´Þ¤à¥í¡¼¥É²Äǽ¥»¥°¥á¥ó¥È¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î°À­¤Ï +.BR SHF_ALLOC +¥Ó¥Ã¥È¤ò´Þ¤à¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¤½¤Î¥Ó¥Ã¥È¤Ï¥ª¥Õ¤Ç¤¢¤ë¡£ +´·Îã¤È¤·¤Æ¡¢ +"NAME" +¤ÏºÆÇÛÃÖ¤¬Å¬ÍѤµ¤ì¤ë¥»¥¯¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤ë¡£ +¤è¤Ã¤Æ +.BR .text +¤Ë¤Ä¤¤¤Æ¤ÎºÆÇÛÃÖ¥»¥¯¥·¥ç¥ó¤Ï¡¢Ä̾ï¤Ï +.BR .rela.text +¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_RELA +¤Ç¤¢¤ë¡£ +.TP +.IR .rodata +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥ê¡¼¥É¥ª¥ó¥ê¡¼¤Î¥Ç¡¼¥¿¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥Ç¡¼¥¿¤Ï¥×¥í¥»¥¹¥¤¥á¡¼¥¸¤Ë¤ª¤±¤ë½ñ¤­¹þ¤ßÉÔ²Äǽ¤Ê¥»¥°¥á¥ó¥È¤ËÃÖ¤«¤ì¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +»ÈÍѤµ¤ì¤ë°À­¤Ï +.BR SHF_ALLOC +¤Ç¤¢¤ë¡£ +.TP +.IR .rodata1 +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥ê¡¼¥É¥ª¥ó¥ê¡¼¤Î¥Ç¡¼¥¿¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥Ç¡¼¥¿¤Ï¥×¥í¥»¥¹¥¤¥á¡¼¥¸¤Ë¤ª¤±¤ë½ñ¤­¹þ¤ßÉÔ²Äǽ¤Ê¥»¥°¥á¥ó¥È¤ËÃÖ¤«¤ì¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +»ÈÍѤµ¤ì¤ë°À­¤Ï +.BR SHF_ALLOC +¤Ç¤¢¤ë¡£ +.TP +.IR .shstrtab +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥»¥¯¥·¥ç¥ó̾¤òÊÝ»ý¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_STRTAB +¤Ç¤¢¤ë¡£ +°À­¥¿¥¤¥×¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£ +.TP +.IR .strtab +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ïʸ»úÎó¤òÊÝ»ý¤¹¤ë¡£ +ºÇ¤â°ìÈÌŪ¤Ê¤Î¤Ï¡¢¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿ +̾Á°¤òɽ¤¹Ê¸»úÎó¤Ç¤¢¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬¥·¥ó¥Ü¥ëʸ»úÎó¥Æ¡¼¥Ö¥ë¤ò´Þ¤à¥í¡¼¥É²Äǽ¥»¥°¥á¥ó¥È¤ò»ý¤Ä¾ì¹ç¡¢ +¥»¥¯¥·¥ç¥ó¤Î°À­¤Ï +.BR SHF_ALLOC +¥Ó¥Ã¥È¤ò´Þ¤à¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¤½¤Î¥Ó¥Ã¥È¤Ï¥ª¥Õ¤Ç¤¢¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_STRTAB +¤Ç¤¢¤ë¡£ +.TP +.IR .symtab +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤òÊÝ»ý¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤ò´Þ¤à¥í¡¼¥É²Äǽ¥»¥°¥á¥ó¥È¤ò»ý¤Ä¾ì¹ç¡¢ +¥»¥¯¥·¥ç¥ó¤Î°À­¤Ï +.BR SHF_ALLOC +¥Ó¥Ã¥È¤ò´Þ¤à¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥Ó¥Ã¥È¤Ï¥ª¥Õ¤Ç¤¢¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_SYMTAB +¤Ç¤¢¤ë¡£ +.TP +.IR .text +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥×¥í¥°¥é¥à¤Î +"¥Æ¥­¥¹¥È" +¤Þ¤¿¤Ï¼Â¹Ô²Äǽ̿Îá¤òÊÝ»ý¤¹¤ë¡£ +¥»¥¯¥·¥ç¥ó¤Î¥¿¥¤¥×¤Ï +.BR SHT_PROGBITS +¤Ç¤¢¤ë¡£ +»ÈÍѤµ¤ì¤ë°À­¤Ï +.BR SHF_ALLOC +¤È +.BR SHF_EXECINSTR +¤Ç¤¢¤ë¡£ +.\" .El +.PP +ʸ»úÎó¥Æ¡¼¥Ö¥ë¥»¥¯¥·¥ç¥ó¤Ï NULL ʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿¥­¥ã¥é¥¯¥¿ÇÛÎó +(Ä̾ïʸ»úÎó¤È¸Æ¤Ð¤ì¤ë¤â¤Î) ¤òÊÝ»ý¤¹¤ë¡£ +¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Ï¤³¤ì¤é¤Îʸ»úÎó¤ò +¥·¥ó¥Ü¥ë̾¤È¥»¥¯¥·¥ç¥ó̾¤òɽ¤¹¤¿¤á¤Ë»È¤¦¡£ +ʸ»úÎó¤Ï¡¢Ê¸»úÎó¥Æ¡¼¥Ö¥ë¥»¥¯¥·¥ç¥ó¤Ø¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤È¤·¤Æ»²¾È¤µ¤ì¤ë¡£ +¥¤¥ó¥Ç¥Ã¥¯¥¹ 0 ¤ÎºÇ½é¤Î¥Ð¥¤¥È¤Ï¡¢NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤ò +ÊÝ»ý¤¹¤ë¤ÈÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +ƱÍͤËʸ»úÎó¥Æ¡¼¥Ö¥ë¤ÎºÇ¸å¤Î¥Ð¥¤¥È¤â NULL ʸ»ú¤òÊÝ»ý¤¹¤ë¤ÈÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤ÏÁ´¤Æ¤Îʸ»úÎó¤¬ NULL ¥Ð¥¤¥È¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤ë¤³¤È¤òÊݾڤ¹¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.PP +¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Î¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤Ï¡¢ +¥×¥í¥°¥é¥à¤Î¥·¥ó¥Ü¥ëÄêµÁ¤È»²¾È¤òÇÛÃÖ¤Þ¤¿¤ÏºÆÇÛÃÖ¤¹¤ë¤Î¤Ë +ɬÍפʾðÊó¤òÊÝ»ý¤¹¤ë¡£ +.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 +32 ¥Ó¥Ã¥ÈÈÇ¤È 64 ¥Ó¥Ã¥ÈÈǤÏƱ¤¸¥á¥ó¥Ð¤ò»ý¤Á¡¢Ã±¤Ë½çÈÖ¤¬°Û¤Ê¤ë¤À¤±¤Ç¤¢¤ë¡£ +.\" .Bl -tag -width "st_value" +.TP 10 +.IR st_name +¤³¤Î¥á¥ó¥Ð¤Ï¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Î¥·¥ó¥Ü¥ëʸ»úÎó¥Æ¡¼¥Ö¥ë¤Î +¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÝ»ý¤¹¤ë¡£ +¥·¥ó¥Ü¥ëʸ»úÎó¥Æ¡¼¥Ö¥ë¤Ï¥·¥ó¥Ü¥ë̾¤Îʸ»úɽ¸½¤òÊÝ»ý¤¹¤ë¡£ +¤³¤ÎÃͤ¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢¥·¥ó¥Ü¥ë̾¤òÆÀ¤ë¤¿¤á¤Îʸ»ú¥Æ¡¼¥Ö¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤òɽ¤¹¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤Ï̾Á°¤ò»ý¤¿¤Ê¤¤¡£ +.TP +.IR st_value +¤³¤Î¥á¥ó¥Ð¤Ï´ØÏ¢¤Å¤±¤é¤ì¤¿¥·¥ó¥Ü¥ë¤ÎÃͤòɽ¤¹¡£ +.TP +.IR st_size +¿¤¯¤Î¥·¥ó¥Ü¥ë¤Ë¤Ï¤½¤ì¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥µ¥¤¥º¤¬¤¢¤ë¡£ +¥·¥ó¥Ü¥ë¤¬¥µ¥¤¥º¤ò»ý¤¿¤Ê¤¤¾ì¹ç¡¢¤Þ¤¿¤Ï¥µ¥¤¥º¤¬ÉÔÌÀ¤Ê¾ì¹ç¡¢ +¤³¤Î¥á¥ó¥Ð¤Ï 0 ¤Ç¤¢¤ë¡£ +.TP +.IR st_info +¤³¤Î¥á¥ó¥Ð¤Ï¥·¥ó¥Ü¥ë¤Î¥¿¥¤¥×¤È¥Ð¥¤¥ó¥Ç¥£¥ó¥° (binding) °À­¤ò»ØÄꤹ¤ë: +.RS 10 +.TP 12 +.BR STT_NOTYPE +¥·¥ó¥Ü¥ë¤Î¥¿¥¤¥×¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.BR STT_OBJECT +¥·¥ó¥Ü¥ë¤Ï¥Ç¡¼¥¿¥ª¥Ö¥¸¥§¥¯¥È¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤ë¡£ +.TP +.BR STT_FUNC +¥·¥ó¥Ü¥ë¤Ï´Ø¿ô¤Þ¤¿¤Ï¤½¤Î¾¤Î¼Â¹Ô¥³¡¼¥É¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤ë¡£ +.TP +.BR STT_SECTION +¥·¥ó¥Ü¥ë¤Ï¥»¥¯¥·¥ç¥ó¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥¿¥¤¥×¤Î¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¤Ï¡¢ +¼ç¤È¤·¤ÆºÆÇÛÃ֤Τ¿¤á¤Ë¸ºß¤·¡¢Ä̾ï¤Ï +.BR STB_LOCAL +¥Ð¥¤¥ó¥Ç¥£¥ó¥°¤ò»ý¤Ä¡£ +.TP +.BR STT_FILE +´·Îã¤È¤·¤Æ¡¢¥·¥ó¥Ü¥ë¤Î̾Á°¤Ï +¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Î̾Á°¤ò»ØÄꤹ¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥ó¥Ü¥ë¤Ï +.BR STB_LOCAL +¥Ð¥¤¥ó¥Ç¥£¥ó¥°¤ò»ý¤Á¡¢¤½¤Î¥»¥¯¥·¥ç¥ó¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï +.BR SHN_ABS +¤Ç¤¢¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥ó¥Ü¥ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤Ë¾¤Î +.BR STB_LOCAL +¥·¥ó¥Ü¥ë¤¬¤¢¤ë¾ì¹ç¤Ï¡¢¤½¤ì¤è¤ê¤âÀè¤ËÍè¤ë¡£ +.TP +.BR STT_LOPROC +¤³¤ÎÃͰʾå¤Ç +.BR STT_HIPROC +°Ê²¼¤ÎÈÏ°Ï¤Ï¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.TP +.BR STT_HIPROC +¤³¤ÎÃͰʲ¼¤Ç +.BR STT_LOPROC +°Ê¾å¤ÎÈÏ°Ï¤Ï¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.\" .El +.\" .Bl -tag -width "STB_GLOBAL" +.TP +.BR STB_LOCAL +¶É½êŪ¥·¥ó¥Ü¥ë¤Ï¤½¤ÎÄêµÁ¤ò´Þ¤à¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Î³°¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ +Ʊ¤¸Ì¾Á°¤Î¶É½êŪ¥·¥ó¥Ü¥ë¤Ï¡¢¤ª¸ß¤¤¤Ë±Æ¶Á¤ò¼õ¤±¤ë¤³¤È¤Ê¤¯¡¢ +Ê£¿ô¤Î¥Õ¥¡¥¤¥ë¤Ë¸ºß¤Ç¤­¤ë¡£ +.TP +.BR STB_GLOBAL +Âç°èŪ¥·¥ó¥Ü¥ë¤Ï·ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤«¤é¸«¤¨¤ë¡£ +1 ¤Ä¤Î¥Õ¥¡¥¤¥ë¤ÇÂç°èŪ¥·¥ó¥Ü¥ë¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤¿¤é¡¢ +¾¤Î¥Õ¥¡¥¤¥ë¤Ç¤ÏƱ¤¸¥·¥ó¥Ü¥ë¤Ø¤Î»²¾È¤Ï̤ÄêµÁ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.BR STB_WEAK +¼å¥·¥ó¥Ü¥ë¤ÏÂç°èŪ¥·¥ó¥Ü¥ë¤Ë»÷¤Æ¤¤¤ë¤¬¡¢¤½¤ÎÄêµÁ¤ÏÍ¥ÀèÅÙ¤¬Ä㤤¡£ +.TP +.BR STB_LOPROC +¤³¤ÎÃͰʾå¤Ç +.BR STB_HIPROC +°Ê²¼¤ÎÈÏ°Ï¤Ï¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.TP +.BR STB_HIPROC +¤³¤ÎÃͰʲ¼¤Ç +.BR STB_LOPROC +°Ê¾å¤ÎÈÏ°Ï¤Ï¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.IP +¥Ð¥¤¥ó¥Ç¥£¥ó¥°¤È¥¿¥¤¥×¥Õ¥£¡¼¥ë¥É¤ò +¥Ñ¥Ã¥¯¤·¤¿¤ê¥¢¥ó¥Ñ¥Ã¥¯¤·¤¿¤ê¤¹¤ë¥Þ¥¯¥í¤¬¤¢¤ë: +.IP +.BR ELF32_ST_BIND (info) +¤Þ¤¿¤Ï +.BR ELF64_ST_BIND (info) +.I st_info +¤ÎÃͤ«¤é¥Ð¥¤¥ó¥Ç¥£¥ó¥°¤ò¼è¤ê½Ð¤¹¡£ +.IP +.BR ELF32_ST_TYPE (info) +¤Þ¤¿¤Ï +.BR ELF64_ST_TYPE (info) +.br +.I st_info +¤ÎÃͤ«¤é¥¿¥¤¥×¤ò¼è¤ê½Ð¤¹¡£ +.IP +.BR ELF32_ST_INFO "(bind, type)" +¤Þ¤¿¤Ï +.BR ELF64_ST_INFO "(bind, type)" +.br +¥Ð¥¤¥ó¥Ç¥£¥ó¥°¤È¥¿¥¤¥×¤ò +.I st_info +¤ÎÃͤËÊÑ´¹¤¹¤ë¡£ +.RE +.\" .El +.TP +.IR st_other +¤³¤Î¥á¥ó¥Ð¤Ï¥·¥ó¥Ü¥ë¤Î visibility (¸«¤¨¤ëÈÏ°Ï) ¤òµ¬Äꤹ¤ë¡£ +.\" .Bl -tag -width "STV_PROTECTED" +.RS 10 +.TP 16 +.PD 0 +.BR STV_DEFAULT +¥Ç¥Õ¥©¥ë¥È¤Î¥·¥ó¥Ü¥ë visibility ¥ë¡¼¥ë¡£ +.TP +.BR STV_INTERNAL +¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î±£¤·¥¯¥é¥¹¡£ +.TP +.BR STV_HIDDEN +¥·¥ó¥Ü¥ë¤Ï¾¤Î¥â¥¸¥å¡¼¥ë¤«¤é¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +.TP +.BR STV_PROTECTED +²£¼è¤ê¤Ç¤­¤º (not preemptible)¡¢¸ø³«¤µ¤ì¤Ê¤¤¡£ +.PD +.PP +visibility ¼ïÊ̤òÃê½Ð¤¹¤ë¤¿¤á¤Î¥Þ¥¯¥í¤¬¤¢¤ë¡£ +.PP +.BR ELF32_ST_VISIBILITY (other) +¤Þ¤¿¤Ï +.BR ELF64_ST_VISIBILITY (other) +.RE +.\" .El +.TP +.IR st_shndx +³Æ¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¥»¥¯¥·¥ç¥ó¤Ë´ØÏ¢¤·¤Æ +"ÄêµÁ¤µ¤ì¤Æ¤¤¤ë"¡£ +¤³¤Î¥á¥ó¥Ð¤Ï´ØÏ¢¤¹¤ë¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¥Æ¡¼¥Ö¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÝ»ý¤¹¤ë¡£ +.\" .El +.PP +ºÆÇÛÃ֤ϥ·¥ó¥Ü¥ë»²¾È¤È¥·¥ó¥Ü¥ëÄêµÁ¤ò·ë¹ç¤¹¤ë¥×¥í¥»¥¹¤Ç¤¢¤ë¡£ +ºÆÇÛÃÖ²Äǽ¥Õ¥¡¥¤¥ë¤Ï¥»¥¯¥·¥ç¥ó¤ÎÆâÍƤò¤É¤Î¤è¤¦¤Ë½¤Àµ¤¹¤ë¤«¤Ë´Ø¤¹¤ë +¾ðÊó¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤Ë¤è¤ê¡¢¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤È¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Ï +¥×¥í¥»¥¹¤Î¥×¥í¥°¥é¥à¥¤¥á¡¼¥¸¤Ë¤Ä¤¤¤Æ¤ÎÀµ¤·¤¤¾ðÊó¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +ºÆÇÛÃÖ¥¨¥ó¥È¥ê¤Ï°Ê²¼¤Î¤è¤¦¤Ê¥Ç¡¼¥¿¤Ç¤¢¤ë¡£ +.PP +²Ã¿ô¤òɬÍפȤ·¤Ê¤¤ºÆÇÛÃÖ¹½Â¤ÂΡ£ +.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 +²Ã¿ô¤òɬÍפȤ¹¤ëºÆÇÛÃÖ¹½Â¤ÂΡ£ +.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 +¤³¤Î¥á¥ó¥Ð¤ÏºÆÇÛÃÖÆ°ºî¤¬Å¬ÍѤµ¤ì¤ë°ÌÃÖ¤òÍ¿¤¨¤ë¡£ +ºÆÇÛÃÖ²Äǽ¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¢¤³¤ÎÃͤϥ»¥¯¥·¥ç¥ó¤ÎÀèƬ¤«¤é +ºÆÇÛÃ֤DZƶÁ¤ò¼õ¤±¤ë³ÊǼñ°Ì (storage unit) ¤Þ¤Ç¤Î¥Ð¥¤¥È¥ª¥Õ¥»¥Ã¥È¤Ç¤¢¤ë¡£ +¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Î¾ì¹ç¡¢ +¤³¤ÎÃͤϺÆÇÛÃ֤DZƶÁ¤ò¼õ¤±¤ë³ÊǼñ°Ì¤Î²¾ÁÛ¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.TP +.IR r_info +¤³¤Î¥á¥ó¥Ð¤Ï¡¢ºÆÇÛÃÖ¤¬¹Ô¤ï¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤È¡¢ +ŬÍѤµ¤ì¤ëºÆÇÛÃ֤Υ¿¥¤¥×¤ÎξÊý¤òÍ¿¤¨¤ë¡£ +ºÆÇÛÃÖ¥¿¥¤¥×¤Ï¥×¥í¥»¥Ã¥µËè¤Ë°Û¤Ê¤ë¡£ +¥Æ¥­¥¹¥È¤¬ºÆÇÛÃÖ¥¨¥ó¥È¥ê¤ÎºÆÇÛÃÖ¥¿¥¤¥× +¤Þ¤¿¤Ï¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +¤½¤ì¤¾¤ì¥¨¥ó¥È¥ê¤Î +.IR r_info +¥á¥ó¥Ð¤ËÂФ·¤Æ¡¢¤½¤ì¤¾¤ì +.BR ELF_[32|64]_R_TYPE +¤È +.BR ELF[32|64]_R_SYM +¤òŬÍѤ·¤¿·ë²Ì¤ò°ÕÌ£¤¹¤ë¡£ +.TP +.IR r_addend +¤³¤Î¥á¥ó¥Ð¤ÏÄê¿ô¤Î²Ã¿ô¤ò»ØÄꤹ¤ë¡£ +¤³¤Î²Ã¿ô¤ÏºÆÇÛÃÖ²Äǽ¥Õ¥£¡¼¥ë¥É¤Ë³ÊǼ¤µ¤ì¤ëÃͤò·×»»¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.\" .El +.PP +\&.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 +¤³¤Î¥á¥ó¥Ð¤Ï°Ê²¼¤ÎÃͤò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë: +.\" .Bl -tag -width "DT_SYMBOLIC" +.RS 10 +.TP 12 +.BR DT_NULL +ưŪ¥»¥¯¥·¥ç¥ó¤Î½ª¤ê¤Î¥Þ¡¼¥¯ +.TP +.BR DT_NEEDED +ɬÍפʥ饤¥Ö¥é¥ê¤Î̾Á°¤Ø¤Îʸ»úÎó¥Æ¡¼¥Ö¥ë¥ª¥Õ¥»¥Ã¥È +.TP +.BR DT_PLTRELSZ +PLT ºÆÇÛÃÖ (reloc) ¥Æ¡¼¥Ö¥ë¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) +.TP +.BR DT_PLTGOT +PLT ¤È GOT (¤Þ¤¿¤Ï²¿¤ì¤«°ìÊý) ¤Î¥¢¥É¥ì¥¹ +.TP +.BR DT_HASH +¥·¥ó¥Ü¥ë¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Î¥¢¥É¥ì¥¹ +.TP +.BR DT_STRTAB +ʸ»úÎó¥Æ¡¼¥Ö¥ë¤Î¥¢¥É¥ì¥¹ +.TP +.BR DT_SYMTAB +¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤Î¥¢¥É¥ì¥¹ +.TP +.BR DT_RELA +Rela ºÆÇÛÃ֥ơ¼¥Ö¥ë¤Î¥¢¥É¥ì¥¹ +.TP +.BR DT_RELASZ +Rela ¥Æ¡¼¥Ö¥ë¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) +.TP +.BR DT_RELAENT +Rela ¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) +.TP +.BR DT_STRSZ +ʸ»úÎó¥Æ¡¼¥Ö¥ë¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) +.TP +.BR DT_SYMENT +¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) +.TP +.BR DT_INIT +½é´ü²½´Ø¿ô¤Î¥¢¥É¥ì¥¹ +.TP +.BR DT_FINI +½ªÎ»´Ø¿ô¤Î¥¢¥É¥ì¥¹ +.TP +.BR DT_SONAME +¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Î̾Á°¤Ø¤Îʸ»úÎó¥Æ¡¼¥Ö¥ë¥ª¥Õ¥»¥Ã¥È +.TP +.BR DT_RPATH +¥é¥¤¥Ö¥é¥ê¸¡º÷¥Ñ¥¹¤Ø¤Îʸ»úÎó¥Æ¡¼¥Ö¥ë¥ª¥Õ¥»¥Ã¥È (¿ä¾©¤µ¤ì¤Ê¤¤) +.TP +.BR DT_SYMBOLIC +¥ê¥ó¥«¤¬¥·¥ó¥Ü¥ë¤Î¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤è¤êÁ°¤Ë +¤³¤Î¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤ò¸¡º÷¤·¤¿¾ì¹ç¤Ï¡¢·Ù¹ð¤ò½Ð¤¹¡£ +.TP +.BR DT_REL +Rel ºÆÇÛÃ֥ơ¼¥Ö¥ë¤Î¥¢¥É¥ì¥¹ +.TP +.BR DT_RELSZ +Rel ¥Æ¡¼¥Ö¥ë¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) +.TP +.BR DT_RELENT +Rel ¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) +.TP +.BR DT_PLTREL +PLT ¤¬»²¾È¤¹¤ëºÆÇÛÃ֥ơ¼¥Ö¥ë¤Î¥¿¥¤¥× (Rela ¤Þ¤¿¤Ï Rel) +.TP +.BR DT_DEBUG +¥Ç¥Ð¥Ã¥°¤Î¤¿¤á¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ÆâÍƤÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.BR DT_TEXTREL +¤³¤ì¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +½ñ¤­¹þ¤ßÉԲĤΥ»¥°¥á¥ó¥È¤Ë¤ÏºÆÇÛÃÖ¤ÏŬÍѤµ¤ì¤Ê¤¤¡£ +.TP +.BR DT_JMPREL +PLT ÀìÍѤκÆÇÛÃÖ¥¨¥ó¥È¥ê¤Î¥¢¥É¥ì¥¹ +.TP +.BR DT_BIND_NOW +¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤ËÀ©¸æ¤ò¾ù¤ëÁ°¤Ë¡¢ +Á´¤Æ¤ÎºÆÇÛÃÖ¤ò½èÍý¤¹¤ë¤è¤¦¤ËưŪ¥ê¥ó¥«¤Ë»Ø¼¨¤¹¤ë¡£ +.TP +.BR DT_RUNPATH +¥é¥¤¥Ö¥é¥ê¸¡º÷¥Ñ¥¹¤Ø¤Îʸ»úÎó¥Æ¡¼¥Ö¥ë¥ª¥Õ¥»¥Ã¥È +.TP +.BR DT_LOPROC +¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤Î³«»Ï +.TP +.BR DT_HIPROC +¥×¥í¥»¥Ã¥µ¸ÇÍ­¤Î°ÕÌ£¤Î½ªÎ» +.RE +.\" .El +.TP +.IR d_val +¤³¤Î¥á¥ó¥Ð¤ÏÍÍ¡¹¤Ê°ÕÌ£¤Ë²ò¼á¤µ¤ì¤ëÀ°¿ôÃͤǤ¢¤ë¡£ +.TP +.IR d_ptr +¤³¤Î¥á¥ó¥Ð¤Ï¥×¥í¥°¥é¥à¤Î²¾ÁÛ¥¢¥É¥ì¥¹¤òɽ¤¹¡£ +¤³¤ì¤é¤Î¥¢¥É¥ì¥¹¤ò²ò¼á¤¹¤ëºÝ¤Ë¡¢ +¼ÂºÝ¤Î¥¢¥É¥ì¥¹¤Ï¸µ¡¹¤Î¥Õ¥¡¥¤¥ë¤ÎÃÍ¤È +¥á¥â¥ê¤Î´ðÄ쥢¥É¥ì¥¹¤«¤é·×»»¤µ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¤Ë¤Ï¤³¤ì¤é¤Î¥¢¥É¥ì¥¹¤ò½¤Àµ¤¹¤ë¤¿¤á¤Î +ºÆÇÛÃÖ¥¨¥ó¥È¥ê¤ò´Þ¤á¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.IR _DYNAMIC +\&.dynamic ¥»¥¯¥·¥ç¥ó¤Ë¤¢¤ëÁ´¤Æ¤ÎưŪ¹½Â¤ÂΤò´Þ¤àÇÛÎó¡£ +¤³¤ì¤Ï¼«Æ°Åª¤Ë¥ê¥ó¥«¤ËÅϤµ¤ì¤ë¡£ +.\" .El +.SH È÷¹Í +.\" OpenBSD +.\" ELF ¤Î¥µ¥Ý¡¼¥È¤Ï +.\" OpenBSD 1.2 +.\" ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.\" ¤·¤«¤·¡¢¤³¤ì¤ò¥µ¥Ý¡¼¥È¤¹¤ë¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤ÎÁ´¤Æ¤¬ +.\" ¥Í¥¤¥Æ¥£¥Ö¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤È¤·¤Æ»È¤Ã¤Æ¤¤¤¿Ìõ¤Ç¤Ï¤Ê¤¤¡£ +ELF ¤Ï System V ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +ELF ¼«ÂÎ¤Ï +System V +¤Ç½é¤á¤ÆÅо줷¤¿¡£ +ELF ¥Õ¥©¡¼¥Þ¥Ã¥È¤ÏºÎÂò¤µ¤ì¤¿É¸½à¤Ç¤¢¤ë¡£ +.\" .SH Ãø¼Ô +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Î¸µ¡¹¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢BSDi ¤Î +.\" .Bsx +.\" .Nm elf +.\" man ¥Ú¡¼¥¸¤Ë»É·ã¤ò¼õ¤±¤Æ +.\" .An Jeroen Ruigrok van der Werven +.\" .Aq asmodai@FreeBSD.org +.\" ¤¬½ñ¤¤¤¿¡£ +.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/release/man5/filesystems.5 b/release/man5/filesystems.5 new file mode 100644 index 00000000..57f32543 --- /dev/null +++ b/release/man5/filesystems.5 @@ -0,0 +1,203 @@ +.\" Copyright 1996 Daniel Quinlan (Daniel.Quinlan@linux.org) +.\" +.\" 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. +.\" +.\" 2007-12-14 mtk Added Reiserfs, XFS, JFS. +.\" +.\" Japanese Version Copyright (c) 1997 Ueyama Rui +.\" all rights reserved. +.\" Translated Tue Aug 19 21:56:35 JST 1997 +.\" by Ueyama Rui +.\" Modified Wed Oct 10 11:07:33 JST 2001 +.\" by Yuichi SATO +.\" Updated Fri Dec 21 JST 2001 by Kentaro Shirakata +.\" +.\"WORD: extended file system ³ÈÄ¥¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.\"WORD: second extended file system ÂèÆó³ÈÄ¥¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.\"WORD: RAM disk RAM¥Ç¥£¥¹¥¯ +.\"WORD: High Sierra ¥Ï¥¤¥·¥§¥é +.\"WORD: Rock Ridge ¥í¥Ã¥¯¥ê¥Ã¥¸ +.\" +.TH FILESYSTEMS 5 2007-12-14 "Linux" "Linux Programmer's Manual" +.nh +.SH ̾Á° +filesystems \- Linux ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à: minix, ext, ext2, ext3, Reiserfs, +XFS, JFS, xia, msdos, +umsdos, vfat, proc, nfs, iso9660, hpfs, sysv, smb, ncpfs +.SH ÀâÌÀ +.B proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬´·½¬¤É¤ª¤ê¤Ë +.I /proc +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¸½ºß¤Î¥«¡¼¥Í¥ë¤¬¤É¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤« +ÃΤ뤿¤á¤Ë¤Ï¥Õ¥¡¥¤¥ë +.I /proc/filesystems +¤ò¸«¤ì¤Ð¤è¤¤¡£ +ɬÍפʥե¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¸½ºß¤Î¥«¡¼¥Í¥ë¤Ë¥µ¥Ý¡¼¥È¤µ¤ì¤Æ +¤¤¤Ê¤¤¾ì¹ç¡¢Å¬Àڤʥ⥸¥å¡¼¥ë¤òÁȤ߹þ¤à¤«¡¢¤½¤ì¤â¤À¤á¤Ê¤é¤Ð +¥«¡¼¥Í¥ë¤òºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤³¤È¡£ + +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»È¤¦¤¿¤á¤Ë¤Ï¡¢ +.I ¥Þ¥¦¥ó¥È +¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.BR mount (8) +¤ò»²¾È¤Î¤³¤È¡£ + +°Ê²¼¤ÏÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¤¦¤Á¡¢¤¤¤¯¤Ä¤«¤Î´Êñ¤ÊÀâÌÀ¤Ç¤¢¤ë¡£ +.TP 10 +.B "minix" +Minix ¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡£ +Linux ¤ÇÆ°¤¤¤¿ºÇ½é¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤â¤¢¤ë¡£¤³¤ì¤Ë¤Ï¤¤¤¯¤Ä¤«·çÅÀ¤¬¤¢¤ë¡£ +¤Þ¤º¡¢¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¥µ¥¤¥º¤¬ºÇÂç 64MB ¤Ç¤¢¤ë¤³¤È¡£Â¾¤Ë¤â¡¢Ã»¤¤¥Õ¥¡¥¤¥ë̾ +¤·¤«»È¤¨¤Ê¤¤¡¢¥¿¥¤¥à¥¹¥¿¥ó¥×¤¬°ì¤Ä¤À¤±¤Ç¤¢¤ë¡¢¤Ê¤É¤Ê¤É¡£ +¥Õ¥í¥Ã¥Ô¡¼¤ä RAM ¥Ç¥£¥¹¥¯¤ËÊØÍø¤Ê¤Î¤Ç¤Þ¤À»Ä¤Ã¤Æ¤¤¤ë¡£ +.TP +.B ext +.B minix +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¼ê¤Î¹þ¤ó¤À³ÈÄ¥¤Ç¤¢¤ë¡£¤³¤ì¤ÏÂèÆó³ÈÄ¥¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +(second extended file system : +.BR ext2 ) +¤Ë´°Á´¤Ë¤È¤Ã¤ÆÂå¤ï¤é¤ì¡¢¥«¡¼¥Í¥ë 2.1.21 ¤Ç¼è¤ê½ü¤«¤ì¤¿¡£ +.TP +.B ext2 +Linux ¤Î¹âÀ­Ç½¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£¤³¤ì¤Ï¸ÇÄê¥Ç¥£¥¹¥¯¤À¤±¤Ç¤Ï¤Ê¤¯ +¥ê¥à¡¼¥Ð¥Ö¥ë¥Ç¥£¥¹¥¯¤Ë¤â¤è¤¯»È¤ï¤ì¤ë¡£ +³ÈÄ¥¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.RB ( ext ) +¤ÎȯŸ¤È¤·¤ÆÂèÆó³ÈÄ¥¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.RB ( ext2 ) +¤¬À߷פµ¤ì¤¿¡£¤³¤Î +.B ext2 +¤Ï Linux ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÃæ¤Ç (¥¹¥Ô¡¼¥É¤ª¤è¤Ó CPU ¤Î»ÈÍÑÎ̤ÎÌ̤Ç) ºÇ¤â +¤è¤¤¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤òȯ´ø¤¹¤ë¡£ +.TP +.B ext3 +ext2 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¸¥ã¡¼¥Ê¥ëµ¡Ç½¤ò¤Ä¤±¤¿¤â¤Î¤Ç¤¢¤ë¡£ +ext2 ¤È ext3 ¤Ï´Êñ¤Ë¹Ô¤­¤ÄÌá¤ê¤Ä¤Ç¤­¤ë¡£ +.TP +.B Reiserfs +Hans Reiser ¤Ë¤è¤Ã¤ÆÀ߷פµ¤ì¤¿¥¸¥ã¡¼¥Ê¥ê¥ó¥°¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.4.1 ¤Ç Linux ¤ËÅý¹ç¤µ¤ì¤¿¡£ +.TP +.B XFS +SGI ¤Ë¤è¤ê³«È¯¤µ¤ì¤¿¥¸¥ã¡¼¥Ê¥ê¥ó¥°¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.4.20 ¤Ç Linux ¤ËÅý¹ç¤µ¤ì¤¿¡£ +.TP +.B JFS +IBM ¤Ë¤è¤ê³«È¯¤µ¤ì¤¿¥¸¥ã¡¼¥Ê¥ê¥ó¥°¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.4.24 ¤Ç Linux ¤ËÅý¹ç¤µ¤ì¤¿¡£ +.TP +.B xiafs +¤Ï Minix ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î³ÈÄ¥¤Ç¡¢¤è¤ê°ÂÄꤷ°ÂÁ´¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤·¤Æ +À߷ס¢¼ÂÁõ¤µ¤ì¤¿¡£¤³¤ì¤Ï¡¢¤¤¤é¤Ê¤¤Ê£»¨¤µ¤ÏÈò¤±¤Ä¤ÄɬÍפʴðËÜŪµ¡Ç½¤ò +È÷¤¨¤Æ¤¤¤ë¡£ +.B xia +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢¤â¤Ï¤ä³«È¯¤â¥á¥ó¥Æ¥Ê¥ó¥¹¤â¹Ô¤ï¤ì¤Æ¤¤¤Ê¤¤¡£ +¥«¡¼¥Í¥ë 2.1.21 ¤Ç¼è¤ê½ü¤«¤ì¤¿¡£ +.TP +.B msdos +¤Ï DOS ¤ä Windows¡¢¤¤¤¯¤é¤«¤Î OS/2 ¥³¥ó¥Ô¥å¡¼¥¿¤¬»È¤Ã¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë +¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +¤³¤Î +.B msdos +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡Ö8 ʸ»ú¤Î̾Á°¡Ü¥Ô¥ê¥ª¥É¡Ü3 ʸ»ú¤Î³ÈÄ¥»Ò¡×¤è¤ê +Ť¤¥Õ¥¡¥¤¥ë̾¤Ï¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.B umsdos +¤Ï DOS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò³ÈÄ¥¤·¤¿ Linux ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï DOS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¤â¤È¤Ç¡¢Ä¹¤¤¥Õ¥¡¥¤¥ë̾¤ä UID/GID¡¢POSIX ·Á¼°¤Î +¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¡¢(¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤ä̾Á°ÉÕ¤­¥Ñ¥¤¥×¤Ê¤É¤Î) Æüì¥Õ¥¡¥¤¥ë¤ò +»È¤¨¤ë¤è¤¦¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£DOS ¤È¤Î¸ß´¹À­¤¬¤¢¤ë¡£ +.TP +.B vfat +¤Ï Microsoft Windows95 ¤È Windows NT ¤¬»È¤¦ DOS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î³ÈÄ¥¤Ç¤¢¤ë¡£ +Ť¤¥Õ¥¡¥¤¥ë̾¤¬»È¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.TP +.B proc +¤Ï¥«¡¼¥Í¥ë¥Ç¡¼¥¿¹½Â¤¤Ø¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤È¤Ê¤ëµ¿»÷¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï +.I /dev/kmem +¤òÆɤó¤Ç²ò¼á¤¹¤ë¤³¤È¤ÎÂå¤ï¤ê¤È¤·¤Æ»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤Ï¥Ç¥£¥¹¥¯¥¹¥Ú¡¼¥¹¤ò»ÈÍѤ·¤Ê¤¤¡£ +.BR proc (5) +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B iso9660 +¤Ï ISO 9660 ɸ½à¤Ë±è¤Ã¤¿ CD-ROM ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +.RS +.TP +.B "High Sierra" +Linux ¤Ï¥Ï¥¤¥·¥§¥é (High Sierra) ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£¤³¤ì¤Ï ISO 9660 ɸ½à¤¬ +·è¤Þ¤ë¤è¤êÁ°¤Ë»È¤ï¤ì¤Æ¤¤¤¿ CD-ROM ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£Linux ¤Î +.B iso9660 +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥µ¥Ý¡¼¥È¤¬¥Ï¥¤¥·¥§¥é¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¼«Æ°¤Ç +ǧ¼±¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B "Rock Ridge" +Linux ¤Ï¥í¥Ã¥¯¥ê¥Ã¥¸ (Rock Ridge) ÊÑ´¹¥×¥í¥È¥³¥ë¤Çµ¬Äꤵ¤ì¤¿ +¥·¥¹¥Æ¥à»ÈÍѶ¦Í­¥×¥í¥È¥³¥ë¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£¤³¤ì¤Ï UNIX ¥Û +¥¹¥È¤Î¥Õ¥¡¥¤¥ë¤ò +.B iso9660 +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤è¤ê¾Ü¤·¤¯µ­½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¡¢ +Ť¤¥Õ¥¡¥¤¥ë̾¤ä UID/GID¡¢POSIX ·Á¼°¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¡¢¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë +¤Ê¤É¤Î¾ðÊó¤òÄ󶡤¹¤ë¡£Linux ¤Î +.B iso9660 +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥µ¥Ý¡¼¥È¤¬¥í¥Ã¥¯¥ê¥Ã¥¸¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¼«Æ°¤Ç +ǧ¼±¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.RE +.TP +.B hpfs +¤Ï OS/2 ¤Ç»È¤ï¤ì¤ë¹âÀ­Ç½¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à(High Performance Filesystem)¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¥É¥­¥å¥á¥ó¥È¤¬Æþ¼ê¤Ç¤­¤Ê¤¤¤¿¤á¡¢ +Linux ¤Ç¤ÏÆɤ߹þ¤ßÀìÍÑ (Read-only) ¤Ç¤·¤«»ÈÍѤǤ­¤Ê¤¤¡£ +.TP +.B sysv +¤Ï SystemV/Coherent ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î Linux ¤Ç¤Î¼ÂÁõ¤Ç¤¢¤ë¡£ +Xenix, SystemV/386, Coherent ³Æ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B nfs +¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +Î¥¤ì¤¿¥³¥ó¥Ô¥å¡¼¥¿¤Î¥Ç¥£¥¹¥¯¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B smb +¤Ï SMB ¥×¥í¥È¥³¥ë¤ò¥µ¥Ý¡¼¥È¤·¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +Windows for Workgroups, Windows NT, Lan Manager ¤¬»È¤Ã¤Æ¤¤¤ë¡£ +.sp +.B smb +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»È¤¦¤¿¤á¤Ë¤Ï ksmbfs ¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤ë +Æüì¤Ê¥Þ¥¦¥ó¥È¥×¥í¥°¥é¥à¤¬É¬ÍפǤ¢¤ë¡£ +ksmbfs ¤Ï +.I ftp://sunsite.unc.edu/pub/Linux/system/Filesystems/smbfs +¤Ë¤¢¤ë¡£ +.TP +.B ncpfs +¤Ï NCP ¥×¥í¥È¥³¥ë¤ò¥µ¥Ý¡¼¥È¤·¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£Novell NetWare ¤¬ +»È¤Ã¤Æ¤¤¤ë¡£ +.sp +.B ncpfs +¤ò»È¤¦¤¿¤á¤Ë¤Ï +.I ftp://linux01.gwdg.de/pub/ncpfs +¤Ë¤¢¤ëÆüì¤Ê¥×¥í¥°¥é¥à¤¬É¬ÍפǤ¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR proc (5), +.BR fsck (8), +.BR mkfs (8), +.BR mount (8) diff --git a/release/man5/ftpusers.5 b/release/man5/ftpusers.5 new file mode 100644 index 00000000..f1fd6125 --- /dev/null +++ b/release/man5/ftpusers.5 @@ -0,0 +1,52 @@ +.\" Copyright (c) 2000 Christoph J. Thompson +.\" +.\" 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. +.\" +.\" 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 NAKANO Takeo all rights reserved. +.\" Translated Fri 16 Feb 2001 by NAKANO Takeo +.\" +.TH FTPUSERS 5 2000-08-27 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ftpusers \- FTP ¥Ç¡¼¥â¥ó·Ðͳ¤Ç¤Î¥í¥°¥¤¥ó¤òµö¤µ¤Ê¤¤¥æ¡¼¥¶¡¼¤Î¥ê¥¹¥È +.SH ÀâÌÀ +.B ftpusers +¤Ï¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¡¢File Transfer Protocol (FTP) ¥µ¡¼¥Ð¡¼¥Ç¡¼¥â¥ó +¤òÍøÍѤ·¤Æ¤Î¥í¥°¥¤¥ó¤òµö¤µ¤Ê¤¤¥æ¡¼¥¶¡¼¤ò¥ê¥¹¥È¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ïñ¤Ë¥·¥¹¥Æ¥à´ÉÍý¤Î¤¿¤á¤À¤±¤Ç¤Ê¤¯¡¢ +TCP/IP ¥Í¥Ã¥È¥ï¡¼¥¯´Ä¶­¤Ç¤Î¥»¥­¥å¥ê¥Æ¥£¤ò¸þ¾å¤µ¤»¤ë¤Î¤Ë¤âÍøÍѤǤ­¤ë¡£ +Ä̾ï¤Ï¡¢ftp ¤òÍѤ¤¤¿ºî¶È¤ò¹Ô¤ï¤Ê¤¤¥æ¡¼¥¶¡¼¤ä¡¢ +FTP ¥µ¡¼¥Ð¡¼¥Ç¡¼¥â¥ó·Ðͳ¤Ç¤Î¥í¥°¥¤¥ó¤òµö¤¹¤Ë¤Ï +¸¢¸Â¤¬Â礭¤¹¤®¤ë¥æ¡¼¥¶¡¼¤ò¥ê¥¹¥È¤·¤Æ¤ª¤¯¡£ +¤³¤Î¤è¤¦¤Ê¥æ¡¼¥¶¡¼¤Ë¤Ï¡¢Î㤨¤Ð root, daemon, bin, uucp, news ¤Ê¤É¤¬´Þ¤Þ¤ì¤ë¡£ +¤ª»È¤¤¤Î FTP ¥µ¡¼¥Ð¡¼¥Ç¡¼¥â¥ó¤¬ +.B ftpusers +¤òÍѤ¤¤Ê¤¤¾ì¹ç¤Ï¡¢¤½¤Î¥Ç¡¼¥â¥ó¤Î¥É¥­¥å¥á¥ó¥È¤òÆɤó¤Ç¡¢ +ÆÃÄê¤Î¥æ¡¼¥¶¡¼¤Î¥¢¥¯¥»¥¹¤ò¥Ö¥í¥Ã¥¯¤¹¤ë¤ä¤êÊý¤ò³Ø¤ó¤Ç¤ª¤¯¤³¤È¤ò¤¹¤¹¤á¤ë¡£ +Washington University FTP ¥µ¡¼¥Ð¡¼¥Ç¡¼¥â¥ó (wuftpd) ¤È +Professional FTP ¥Ç¡¼¥â¥ó (proftpd) ¤È¤Ï¡¢ +.B ftpusers +¤òÍøÍѤ¹¤ë¤³¤È¤¬¤ï¤«¤Ã¤Æ¤¤¤ë¡£ +.SS ¥Õ¥©¡¼¥Þ¥Ã¥È +.B ftpusers +¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ÏÈó¾ï¤Ëñ½ã¤Ç¤¢¤ê¡¢ +¥¢¥«¥¦¥ó¥È̾ (¤Þ¤¿¤Ï¥æ¡¼¥¶¡¼Ì¾) ¤ò³Æ¹Ô¤Ë½ñ¤¯¤À¤±¤Ç¤¢¤ë¡£ +# ¤Ç»Ï¤Þ¤ë¹Ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +.I /etc/ftpusers +.SH ´ØÏ¢¹àÌÜ +.BR passwd (5), +.BR proftpd (8), +.BR wuftpd (8) diff --git a/release/man5/group.5 b/release/man5/group.5 new file mode 100644 index 00000000..3a26fffb --- /dev/null +++ b/release/man5/group.5 @@ -0,0 +1,66 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:06:03 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1997 Ueyama Rui +.\" all rights reserved. +.\" Translated 1997-08-30, Ueyama Rui +.\" Modified 2005-02-20, Akihiro MOTOKI +.\" +.TH GROUP 5 2009-10-17 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +group \- ¥æ¡¼¥¶¡¼¥°¥ë¡¼¥×¤Î¥Õ¥¡¥¤¥ë +.SH ÀâÌÀ +\fI/etc/group\fP ¤Ï¡¢¤½¤Î¥·¥¹¥Æ¥à¤Î¥°¥ë¡¼¥×¤òÄêµÁ¤¹¤ë¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +1 ¹Ô¤Ë 1 ¥¨¥ó¥È¥ê¤Ç¡¢³Æ¹Ô¤Î·Á¼°¤Ï°Ê²¼¤Î¤È¤ª¤ê¤Ç¤¢¤ë¡£ +.sp +.RS +group_name:password:GID:user_list +.RE +.sp +¥Õ¥£¡¼¥ë¥É¤ÎÀâÌÀ: +.IP group_name +¥°¥ë¡¼¥×¤Î̾Á°¡£ +.IP password +(°Å¹æ²½¤µ¤ì¤¿) ¥Ñ¥¹¥ï¡¼¥É¡£¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬¶õ¤Ê¤é¥Ñ¥¹¥ï¡¼¥É¤ÏɬÍפʤ¤¡£ +.IP GID +¥°¥ë¡¼¥×ID¤Î¿ôÃÍ¡£ +.IP user_list +¤³¤Î¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤Î¥æ¡¼¥¶¡¼Ì¾¤Î¥ê¥¹¥È¡£ +¥æ¡¼¥¶¡¼Ì¾¤Ï¥³¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +/etc/group +.SH ¥Ð¥° +4.2BSD ¤Î +.BR initgroups (3) +¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë½ñ¤«¤ì¤Æ¤¤¤ë: +ï¤â +.I /etc/group +¤òºÇ¿·¤Î¾õÂÖ¤ËÊݤäƤϤ¤¤Ê¤¤¤è¤¦¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR login (1), +.BR newgrp (1), +.BR getgrent (3), +.BR getgrnam (3), +.BR passwd (5) diff --git a/release/man5/host.conf.5 b/release/man5/host.conf.5 new file mode 100644 index 00000000..e272a620 --- /dev/null +++ b/release/man5/host.conf.5 @@ -0,0 +1,220 @@ +.\" Copyright (c) 1997 Martin Schulze (joey@infodrom.north.de) +.\" +.\" 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. +.\" +.\" Much of the text is copied from the manpage of resolv+(8). +.\" +.\" 2003-08-23 Martin Schulze Updated according to glibc 2.3.2 +.\" +.\" Japanese Version Copyright (c) 2000-2003 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Sep 24 06:18:14 JST 2000 +.\" by Yuichi SATO +.\" Updated & Modified Sun Sep 7 17:51:03 JST 2003 +.\" by Yuichi SATO +.\" +.\"WORD: method Êý¼° +.\"WORD: trim ¼è¤êµî¤ë +.\"WORD: spoofing µ¶Áõ +.\" +.TH HOST.CONF 5 2003-08-23 "Linux" "Linux System Administration" +.SH ̾Á° +host.conf \- ¥ì¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë +.SH ÀâÌÀ +¥Õ¥¡¥¤¥ë +.I /etc/host.conf +¤Ë¤Ï¡¢¥ì¥¾¥ë¥Ð¥é¥¤¥Ö¥é¥ê¤Î¾ÜºÙ¤ÊÀßÄê¾ðÊ󤬴ޤޤì¤Æ¤¤¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢1 ¹ÔËè¤Ë 1 ¤Ä¤ÎÀßÄꥭ¡¼¥ï¡¼¥É¤È +¤½¤ì¤Ë³¤¯Å¬ÀÚ¤ÊÀßÄê¾ðÊ󤬤ʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +ǧ¼±¤µ¤ì¤ë¥­¡¼¥ï¡¼¥É¤Ï +.IR order ", " trim ", " multi ", " nospoof ", " spoof ", " reorder +¤Ç¤¢¤ë¡£ +³Æ¥­¡¼¥ï¡¼¥É¤ò¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ë¡£ +.TP +.I order +¤³¤Î¥­¡¼¥ï¡¼¥É¤Ï¡¢¥Û¥¹¥È¤Î¥ë¥Ã¥¯¥¢¥Ã¥×Êý¼°¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥­¡¼¥ï¡¼¥É¤Î¸å¤Ë¤Ï¡¢¥³¥ó¥Þ¤Çʬ¤±¤¿ +1 ¤Ä°Ê¾å¤Î¥ë¥Ã¥¯¥¢¥Ã¥×Êý¼°¤¬Â³¤«¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +»ÈÍѲÄǽ¤ÊÊý¼°¤Ï +.IR bind ", " hosts ", " nis +¤Ç¤¢¤ë¡£ +.TP +.I trim +¤³¤Î¥­¡¼¥ï¡¼¥É¤Ï¡¢2 ²ó°Ê¾å¥ê¥¹¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Ëè²ó¡¢¤³¤Î¥­¡¼¥ï¡¼¥É¤Î¸å¤Ë¤Ï¡¢ +¥É¥Ã¥È¤Ç¤Ï¤¸¤Þ¤ë 1 ¤Ä°Ê¾å¤Î¥É¥á¥¤¥ó̾¤Î¥ê¥¹¥È¤ò³¤±¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥É¥á¥¤¥ó̾¤Ï¥³¥í¥ó (\(aq:\(aq)¡¢¥»¥ß¥³¥í¥ó (\(aq;\(aq)¡¢¥³¥ó¥Þ (\(aq,\(aq) +¤Ç¶èÀڤ롣 +¤³¤Î¥­¡¼¥ï¡¼¥É¤¬ÀßÄꤵ¤ì¤ë¤È¡¢resolv+ ¥é¥¤¥Ö¥é¥ê¤Ï DNS ¤Ç¥ì¥¾¥ë¥Ö¤µ¤ì¤¿ +¤¹¤Ù¤Æ¤Î¥Û¥¹¥È̾¤Î¸å¤í¤«¤éÍ¿¤¨¤é¤ì¤¿¥É¥á¥¤¥ó̾¤ò¼«Æ°Åª¤Ë¼è¤êµî¤ë¡£ +¤³¤Î¥­¡¼¥ï¡¼¥É¤Ï¥í¡¼¥«¥ë¤Ê¥Û¥¹¥È¤È¥É¥á¥¤¥ó¤Ç»ÈÍѤ¹¤ë¤³¤È¤ò°Õ¿Þ¤·¤Æ¤¤¤ë¡£ +(´ØÏ¢¤·¤¿Ãí°Õ : NIS ¤Þ¤¿¤Ï hosts ¥Õ¥¡¥¤¥ë¤Ç½¸¤á¤é¤ì¤¿¥Û¥¹¥È̾¤Ë +trim ¤Ï±Æ¶Á¤·¤Ê¤¤¡£ +hosts ¥Õ¥¡¥¤¥ë¤Î³Æ¥¨¥ó¥È¥ê¤ÎºÇ½é¤Î¥Û¥¹¥È̾¤ò¡¢ +´°Á´¤Ê¥É¥á¥¤¥ó̾ÉÕ¤­¤Î¤â¤Î¤Ë¤¹¤ë¤«¤·¤Ê¤¤¤«¤Ï¡¢ +¥Û¥¹¥È¤´¤È¤Î¥¤¥ó¥¹¥È¡¼¥ë¥Ý¥ê¥·¡¼¤Ë¤¢¤ï¤»¤Æ +ŬÀÚ¤ËÁªÂò¤¹¤ëɬÍפ¬¤¢¤ë¡£Ãí°Õ¤¹¤ë¤³¤È¡£) +.TP +.I multi +Í­¸ú¤ÊÃÍ¤Ï +.IR on " ¤È " off +¤Ç¤¢¤ë¡£ +.I on +¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ºÇ½é¤Î¥¨¥ó¥È¥ê¤Î¤ß¤òÎã³°¤È¤·¤Æ¡¢ +resolv+ ¥é¥¤¥Ö¥é¥ê¤Ï +.I /etc/hosts +¥Õ¥¡¥¤¥ë¤Ë¸½¤ì¤ë¥Û¥¹¥È¤ËÂФ·¤ÆÁ´¤Æ¤ÎÍ­¸ú¤Ê¥¢¥É¥ì¥¹¤òÊÖ¤½¤¦¤È¤¹¤ë¡£ +Â礭¤Ê hosts ¥Õ¥¡¥¤¥ë¤ò»ý¤Ä¥µ¥¤¥È¤Ç¤Ï¡¢ +¤³¤ÎÀßÄê¤ÏÈó¾ï¤ÊÀ­Ç½¤ÎÄã²¼¤ò¾·¤¯¤Î¤Ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +.I off +¤Ç¤¢¤ë¡£ +.TP +.I nospoof +Í­¸ú¤ÊÃÍ¤Ï +.IR on " ¤È " off +¤Ç¤¢¤ë¡£ +.I on +¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢resolv+ ¥é¥¤¥Ö¥é¥ê¤Ï +.BR rlogin " ¤È " rsh +¤Î¥»¥­¥å¥ê¥Æ¥£¤ò¸þ¾å¤µ¤»¤ë¤¿¤á¥Û¥¹¥È̾¤Îµ¶Áõ¤òËɻߤ·¤è¤¦¤È¤¹¤ë¡£ +¤³¤ì¤Ï¡¢¡Ö¥Û¥¹¥È¥¢¥É¥ì¥¹¤Î¥ë¥Ã¥¯¥¢¥Ã¥×¤ò¹Ô¤Ã¤¿¸å¡¢ +resolv+ ¤Ï¤½¤Î¥¢¥É¥ì¥¹¤ËÂФ·¤Æ¥Û¥¹¥È̾¤Î¥ë¥Ã¥¯¥¢¥Ã¥×¤ò¹Ô¤¤¡¢ +¤â¤· 2 ¤Ä¤Î¥Û¥¹¥È̾¤¬°ìÃפ·¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢¥¯¥¨¥ê¡¼¤Ï¼ºÇÔ¤¹¤ë¡£¡× +¤È¤¤¤¦¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï +.I off +¤Ç¤¢¤ë¡£ +.TP +.I spoofalert +Í­¸ú¤ÊÃÍ¤Ï +.IR on " ¤È " off +¤Ç¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ +.I on +¤ËÀßÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.I nospoof +¥ª¥×¥·¥ç¥ó¤â (on ¤Ë) ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +resolv+ ¤Ï syslog µ¡Ç½¤òÄ̤¸¤Æ¥¨¥é¡¼¤Ë´Ø¤¹¤ë·Ù¹ð¤Î¥í¥°¤ò¤È¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï +.I off +¤Ç¤¢¤ë¡£ +.TP +.I spoof +Í­¸ú¤ÊÃÍ¤Ï +.IR off ", " nowarn ", " warn +¤Ç¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò +.I off +¤ËÀßÄꤹ¤ë¤È¡¢µ¶Áõ¤µ¤ì¤¿¥¢¥É¥ì¥¹¤òµö²Ä¤·¤Æ¡¢ +syslog µ¡Ç½¤òÄ̤¸¤¿·Ù¹ð¤òȯ¤·¤Ê¤¤¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò +.I warn +¤ËÀßÄꤹ¤ë¤È¡¢resolv+ ¤Ï¥»¥­¥å¥ê¥Æ¥£¤ò¹â¤á¤ë¤¿¤á¤Ë¥Û¥¹¥È̾¤Îµ¶Áõ¤òËɻߤ·¡¢ +syslog µ¡Ç½¤òÄ̤¸¤Æ¥¨¥é¡¼¤Ë´Ø¤¹¤ë·Ù¹ð¤Î¥í¥°¤ò¤È¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò +.I nowarn +¤ËÀßÄꤹ¤ë¤È¡¢resolv+ ¤Ï¥»¥­¥å¥ê¥Æ¥£¤ò¹â¤á¤ë¤¿¤á¤Ë¥Û¥¹¥È̾¤Îµ¶Áõ¤òËɻߤ¹¤ë¤¬¡¢ +syslog µ¡Ç½¤òÄ̤¸¤¿·Ù¹ð¤Ïȯ¤·¤Ê¤¤¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò²¿¤âÀßÄꤷ¤Ê¤¤¾ì¹ç¤Ï¡¢ +.I nowarn +¤òÀßÄꤷ¤¿¤Î¤ÈƱ¤¸¤Ë¤Ê¤ë¡£ +.TP +.I reorder +Í­¸ú¤ÊÃÍ¤Ï +.IR on " ¤È " off +¤Ç¤¢¤ë¡£ +.I on +¤ËÀßÄꤵ¤ì¤ë¤È¡¢ +.B gethostbyname (3) +¤¬¼Â¹Ô¤µ¤ì¤ë¤È¤­¡¢resolv+ ¥é¥¤¥Ö¥é¥ê¤Ï¡¢¥í¡¼¥«¥ë¤Ê +(¤Ä¤Þ¤ê¡¢Æ±¤¸¥µ¥Ö¥Í¥Ã¥È¤Ë¤¢¤ë) ¥¢¥É¥ì¥¹¤¬ºÇ½é¤Ë¥ê¥¹¥È¤µ¤ì¤ë¤è¤¦¤Ë +¥Û¥¹¥È¥¢¥É¥ì¥¹¤òʤÙÊѤ¨¤ë¡£ +¤¹¤Ù¤Æ¤Î¥ë¥Ã¥¯¥¢¥Ã¥×Êý¼°¤ËÂФ·¤ÆʤÙÊѤ¨¤¬¹Ô¤ï¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃͤϡ¢ +.I off +¤Ç¤¢¤ë¡£ +.SH ´Ä¶­ÊÑ¿ô +.I /etc/host.conf +¤ÇÀßÄꤵ¤ì¤Æ¤¤¤ëÆ°ºî¤ò¡¢¥æ¡¼¥¶¤¬¾å½ñ¤­¤Ç¤­¤ë 6 ¤Ä¤Î´Ä¶­ÊÑ¿ô¤¬¤¢¤ë¡£ +.TP +.B RESOLV_HOST_CONF +¤³¤ÎÊÑ¿ô¤òÀßÄꤹ¤ë¤È¡¢ +.I /etc/host.conf +¤ÎÂå¤ê¤ËÆɤ߹þ¤à¥Õ¥¡¥¤¥ë¤òÀßÄê¤Ç¤­¤ë¡£ +.TP +.B RESOLV_SERV_ORDER +.I order +¥³¥Þ¥ó¥É¤ò¾å½ñ¤­¤¹¤ë¡£ +.TP +.B RESOLV_SPOOF_CHECK +.I spoof +¥³¥Þ¥ó¥É¤ò²òÀϤ¹¤ë¤Î¤ÈƱ¤¸Êý¼°¤Ç¡¢ +.IR nospoof ", " spoofalert ", " spoof +¥³¥Þ¥ó¥É¤ò¾å½ñ¤­¤Ç¤­¤ë¡£ +Í­¸ú¤ÊÃÍ¤Ï +.IR off ", " nowarn ", " warn +¤Ç¤¢¤ë¡£ +.TP +.B RESOLV_MULTI +.I multi +¥³¥Þ¥ó¥É¤ò¾å½ñ¤­¤¹¤ë¡£ +.TP +.B RESOLV_REORDER +.I reorder +¥³¥Þ¥ó¥É¤ò¾å½ñ¤­¤¹¤ë¡£ +.TP +.B RESOLV_ADD_TRIM_DOMAINS +¥³¥í¥ó (\(aq:\(aq)¡¢¥»¥ß¥³¥í¥ó (\(aq;\(aq)¡¢¥³¥ó¥Þ (\(aq,\(aq) ¤Ç¶èÀڤä¿ +¥É¥Ã¥È (\(aq.\(aq) ¤Ç»Ï¤Þ¤ë¥É¥á¥¤¥ó̾¤Î¥ê¥¹¥È¡£ +¥Û¥¹¥È̾¤«¤é¼è¤êµî¤ë¥É¥á¥¤¥ó̾¤Î¥ê¥¹¥È¤ËÄɲ乤롣 +.TP +.B RESOLV_OVERRIDE_TRIM_DOMAINS +¥³¥í¥ó (\(aq:\(aq)¡¢¥»¥ß¥³¥í¥ó (\(aq;\(aq)¡¢¥³¥ó¥Þ (\(aq,\(aq) ¤Ç¶èÀڤä¿ +¥É¥Ã¥È (\(aq.\(aq) ¤Ç»Ï¤Þ¤ë¥É¥á¥¤¥ó̾¤Î¥ê¥¹¥È¡£ +¥Û¥¹¥È̾¤«¤é¼è¤êµî¤ë¥É¥á¥¤¥ó̾¤Î¥ê¥¹¥È¤ò¾å½ñ¤­¤¹¤ë¡£ +.I trim +¥³¥Þ¥ó¥É¤ò¾å½ñ¤­¤¹¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/host.conf +¥ê¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë +.TP +.I /etc/resolv.conf +¥ê¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë +.TP +.I /etc/hosts +¥í¡¼¥«¥ë¤Î hosts ¥Ç¡¼¥¿¥Ù¡¼¥¹ +.SH Ãí°Õ +¸µ¡¹¤Î¼ÂÁõ¤ËÈæ¤Ù¤Æ°Ê²¼¤Î¤è¤¦¤Ê°ã¤¤¤¬¤¢¤ë¡£ +¿·¤·¤¤¥³¥Þ¥ó¥É +.I spoof +¤È¿·¤·¤¤´Ä¶­ÊÑ¿ô +.B RESOLV_SPOOF_CHECK +¤Ï¡¢°ú¤­¿ô +.IR off ", " nowarn ", " warn +¤ò¤È¤ë¡£ +¥³¥á¥ó¥È¤Ï¹ÔƬ¤À¤±¤Ç¤Ï¤Ê¤¯¡¢¤É¤³¤Ë½ñ¤¤¤Æ¤â¤è¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR gethostbyname (3), +.BR hostname (7), +.BR named (8), +.BR resolv+ (8) diff --git a/release/man5/hosts.5 b/release/man5/hosts.5 new file mode 100644 index 00000000..30e57ea4 --- /dev/null +++ b/release/man5/hosts.5 @@ -0,0 +1,127 @@ +.\" Hey, Emacs! This is an -*- nroff -*- source file. +.\" Copyright (c) 2000 Manoj Srivastava +.\" +.\" 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. +.\" +.\" Minor polishing, aeb +.\" Modified, 2002-06-16, Mike Coleman +.\" +.\" Japanese Version Copyright (c) 2000-2002 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Sep 24 05:53:22 JST 2000 +.\" by Yuichi SATO +.\" Updated & Modified Sat Aug 31 05:49:00 JST 2002 by Yuichi SATO +.\" +.TH HOSTS 5 2002-06-16 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +hosts \- ¥Û¥¹¥È̾¤ÎÀÅŪ¤Ê¥ë¥Ã¥¯¥¢¥Ã¥×¥Æ¡¼¥Ö¥ë +.SH ½ñ¼° +.B /etc/hosts +.SH ÀâÌÀ +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï¡¢ +.I /etc/hosts +¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤Ä¤¤¤Æµ­½Ò¤·¤Æ¤¤¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï´Êñ¤Ê¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¡¢1 ¹Ô¤Ë 1 ¤Ä¤Î IP ¥¢¥É¥ì¥¹¤¬¤¢¤ê¡¢ +IP ¥¢¥É¥ì¥¹¤È¥Û¥¹¥È̾¤ò´ØÏ¢¤Å¤±¤Æ¤¤¤ë¡£ +³Æ¥Û¥¹¥È¤Ë¤Ä¤¤¤Æ¡¢¼¡¤Î¤è¤¦¤Ê¾ðÊó¤¬ 1 ¹Ô¤ÇÍ¿¤¨¤é¤ì¤ë¡£ +.RS +.PP +IP¥¢¥É¥ì¥¹ Àµ¼°¤Ê¥Û¥¹¥È̾ [¥¨¥¤¥ê¥¢¥¹...] +.RE +.PP +¥¨¥ó¥È¥ê¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢¶õÇò¤Þ¤¿¤Ï¥¿¥Ö (Ê£¿ô¤Ç¤â²Ä) ¤Ç¶èÀÚ¤é¤ì¤ë¡£ +"#" ʸ»ú¤«¤é¹ÔËö¤Þ¤Ç¤Î¥Æ¥­¥¹¥È¤Ï¥³¥á¥ó¥È¤È¤·¤Æ̵»ë¤µ¤ì¤ë¡£ +¥Û¥¹¥È̾¤Ï±Ñ¿ô»ú¡¦¥Þ¥¤¥Ê¥¹µ­¹æ ("\-")¡¦¥Ô¥ê¥ª¥É (".") ¤ò´Þ¤à¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Û¥¹¥È̾¤Ï±Ñʸ»ú (alphabetic character) ¤Ç»Ï¤Þ¤Ã¤Æ¡¢ +±Ñ¿ô»ú (alphanumeric characte) ¤Ç½ª¤ï¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥¨¥¤¥ê¥¢¥¹¤Ï¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ê¡¢Ì¾Á°¤ÎÊѹ¹¡¢Ê̤Υ¹¥Ú¥ë¡¢ +û¤¤¥Û¥¹¥È̾¡¢°ìÈÌŪ¤Ë»È¤ï¤ì¤ë¥Û¥¹¥È̾ (Î㤨¤Ð +.IR localhost ) +¤Ê¤É¤Î¤¿¤á¤ËÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +Berkeley Internet Name Domain (BIND) ¥µ¡¼¥Ð¤Ï¡¢ +Unix ¥·¥¹¥Æ¥à¤Î¤¿¤á¤Î¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Í¡¼¥à¥µ¡¼¥Ð¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¡¢ +.I /etc/hosts +¥Õ¥¡¥¤¥ë¤ä¥Û¥¹¥È̾¥ë¥Ã¥¯¥¢¥Ã¥×¤ò³ÈÄ¥¤·¤¿¤êÃÖ¤­´¹¤¨¤¿¤ê¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë¤è¤ê³Æ¥Û¥¹¥È¤Ï +.I /etc/hosts +¤òºÇ¿·¤«¤Ä´°Á´¤ËÊݤ¿¤Ê¤¯¤Æ¤â¤è¤¯¤Ê¤ë¡£ +.PP +¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤Ï¡¢DNS ¤Ë¤È¤Ã¤ÆÂå¤ï¤é¤ì¤¿¤Ë¤â¤«¤«¤ï¤é¤º¡¢ +¸½ºß¤Î¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¼¡¤Î¤è¤¦¤ÊÍÑÅӤǹ­¤¯»È¤ï¤ì¤Æ¤¤¤ë¡£ +.TP +.B ¥Ö¡¼¥È»þ +ÂçÉôʬ¤Î¥·¥¹¥Æ¥à¤Ï¡¢¥í¡¼¥«¥ë¥Í¥Ã¥È¥ï¡¼¥¯¤Ë¤ª¤¤¤Æ½ÅÍפʥۥ¹¥È¤Î +̾Á°¤È¥¢¥É¥ì¥¹¤¬´Þ¤Þ¤ì¤¿¾®¤µ¤Ê¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¡¢¥·¥¹¥Æ¥à¤Î¥Ö¡¼¥È»þ¤Ê¤É¤Î DNS ¤¬²ÔƯ¤·¤Æ¤¤¤Ê¤¤¤È¤­¤ËÌòΩ¤Ä¡£ +.TP +.B NIS +NIS ¤ò»ÈÍѤ·¤Æ¤¤¤ë¥µ¥¤¥È¤Ï¡¢¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤ò +NIS ¥Û¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÆþÎϤȤ·¤ÆÍѤ¤¤ë¡£ +NIS ¤ò DNS ¤È¶¦¤Ë»ÈÍѤǤ­¤ë¤Ë¤â¤«¤«¤ï¤é¤º¡¢ +ÂçÉôʬ¤Î NIS ¥µ¥¤¥È¤Ï̤¤À¤Ë¡¢ +Á´¤Æ¤Î¥í¡¼¥«¥ë¥Û¥¹¥È¤Î¥¨¥ó¥È¥ê¤ò¤â¤Ä¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤ò +¥Ð¥Ã¥¯¥¢¥Ã¥×¤È¤·¤Æ»ÈÍѤ·¤Æ¤¤¤ë¡£ +.TP +.B ³ÖÀ䤵¤ì¤¿¥Î¡¼¥É +¥Í¥Ã¥È¥ï¡¼¥¯¤«¤é³ÖÀ䤵¤ì¤¿Èó¾ï¤Ë¾®¤µ¤Ê¥µ¥¤¥È¤Ï¡¢ +DNS ¤ÎÂå¤ï¤ê¤Ë¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ·¤Æ¤¤¤ë¡£ +¥í¡¼¥«¥ë¾ðÊ󤬵©¤Ë¤·¤«Êѹ¹¤µ¤ì¤º¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¤¬¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤ÈÀܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +DNS ¤Ë¤½¤ì¤Û¤É¤ÎÍøÅÀ¤Ï¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +.I /etc/hosts +.SH Ãí°Õ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ø¤ÎÊѹ¹¤ÏÄ̾魯¤°¤ËÈ¿±Ç¤µ¤ì¤ë¡£Ã¢¤·¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó +¤Ë¤è¤ê¥Õ¥¡¥¤¥ë¤ÎÆâÍƤ¬¥­¥ã¥Ã¥·¥å¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¤³¤Î¸Â¤ê¤Ç¤Ï¤Ê¤¤¡£ +.SS Îò»ËŪ¤Ê·Ð°Þ +¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¤½¤Î¸åÊѹ¹¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +¸µ¡¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï RFC\ 952 ¤Ë¤Ïµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ + +DNS ¤ÎÅоì°ÊÁ°¡¢¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¤Ï¡¢¶î¤±½Ð¤·¤¿¤Ð¤«¤ê¤Î¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ë¤ª¤±¤ë +¥Û¥¹¥È̾²ò·è¤ÎÍ£°ì¤ÎÊýË¡¤Ç¤¢¤Ã¤¿¡£ +¼ÂºÝ¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ï Network Information Control Center (NIC) ¤Ë¤è¤Ã¤Æ +´ÉÍý¤µ¤ì¤ë¸ø¼°¥Û¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤¿¡£ +¤·¤«¤·¡¢Èó¸ø¼°¤Ê¥¨¥¤¥ê¥¢¥¹¤äÉÔÌÀ¤Ê¥Û¥¹¥È¤ò°·¤¨¤ë¤è¤¦¤Ë¡¢ +ºÇ¿·¤ËÊݤĤ¿¤á¤Î¥í¡¼¥«¥ë¤ÊÊѹ¹¤¬ÉÑÈˤËɬÍפȤµ¤ì¤¿¡£ +NIC ¤Ï´û¤Ë hosts.txt ¤ò´ÉÍý¤·¤Æ¤¤¤Ê¤¤¤¬¡¢ +¤³¤ì¤ò½ñ¤¤¤Æ¤¤¤ë (2000 ǯº¢¤Î) »þÅÀ¤ÇÄ´¤Ù¤Æ¤ß¤ë¤È¡¢ +WWW ¾å¤ËÎò»ËŪ¤Ê hosts.txt ¤¬Â¸ºß¤¹¤ë¡£ +92, 94, 95 ǯ¤Î¤â¤Î¤¬¸«¤Ä¤«¤Ã¤¿¡£ +.SH Îã +.nf +127.0.0.1 localhost +192.168.1.10 foo.mydomain.org foo +192.168.1.13 bar.mydomain.org bar +146.82.138.7 master.debian.org master +209.237.226.90 www.opensource.org +.fi +.SH ´ØÏ¢¹àÌÜ +.BR hostname (1), +.BR resolver (3), +.BR resolver (5), +.BR hostname (7), +.BR named (8), +Internet RFC\ 952 +.\" .SH Ãø¼Ô +.\" ¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï¡¢Debian GNU/Linux ¥·¥¹¥Æ¥à¤Î¤¿¤á¤Ë +.\" Manoj Srivastava ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ diff --git a/release/man5/hosts.equiv.5 b/release/man5/hosts.equiv.5 new file mode 100644 index 00000000..9ab1895a --- /dev/null +++ b/release/man5/hosts.equiv.5 @@ -0,0 +1,71 @@ +.\" Copyright (c) 1995 Peter Tobias +.\" This file may be distributed under the GNU General Public License. +.\" +.\" Japanese Version Copyright (c) 2000 NAKANO Takeo all rights reserved. +.\" Translated 2000-03-12, NAKANO Takeo +.\" Modified 2005-02-20, Akihiro MOTOKI +.\" +.TH HOSTS.EQUIV 5 2003-08-24 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +/etc/hosts.equiv \- ¡Ö¿®Íꤵ¤ì¤¿¡×\fBr\fP ¥³¥Þ¥ó¥É¤Ë¤è¤ë¥·¥¹¥Æ¥à¤Ø¤Î +¥¢¥¯¥»¥¹¤òµö²Ä¤¹¤ë¥Û¥¹¥È¤ª¤è¤Ó¥æ¡¼¥¶¤Î¥ê¥¹¥È +.SH ÀâÌÀ +.B hosts.equiv +¥Õ¥¡¥¤¥ë¤Ï \fBr\fP-¥³¥Þ¥ó¥É +.RB ( rlogin ", " rsh ", " rcp +¤Ê¤É) ¤Ë¤è¤ë¥Ñ¥¹¥ï¡¼¥É¤Ê¤·¤Ç¤ÎÍøÍѤò +µö²Ä/µñÈݤ¹¤ë¥Û¥¹¥È/¥æ¡¼¥¶¤òÀßÄꤹ¤ë¡£ +.PP +¤³¤Î¥Õ¥¡¥¤¥ë¤Ç¤Ï°Ê²¼¤Î½ñ¼°¤òÍѤ¤¤ë¡£ +.TP +\fI[ + | \- ]\fP \fI[hostname]\fP \fI[username]\fP +.PP +.I hostname +¤Ï¡¢¥í¡¼¥«¥ë¥Û¥¹¥È¤ÈÏÀÍýŪ¤ËÅù²Á¤Ê¥Û¥¹¥È¤Î̾Á°¤Ç¤¢¤ë¡£ +¤½¤Î¥Û¥¹¥È¤Ë¥í¥°¥¤¥ó¤·¤Æ¤¤¤ë¥æ¡¼¥¶¤Ï¡¢¥Ñ¥¹¥ï¡¼¥É¤Ê¤·¤Ç +¥í¡¼¥«¥ë¥Û¥¹¥È¤ÎƱ¤¸Ì¾Á°¤Î¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È¤Ë¥¢¥«¥¦¥ó¥È¤Ç¤­¤ë¡£ +.I hostname +¤ÎÁ°¤Ë¤Ï¥×¥é¥¹µ­¹æ (+) ¤òÃÖ¤¤¤Æ¤â¤è¤¤¡£¥×¥é¥¹µ­¹æ¤¬Ã±ÆȤÇÃÖ¤«¤ì¤¿¾ì¹ç¤Ï¡¢ +¤³¤Î¥·¥¹¥Æ¥à¤Ø¤Î¥¢¥¯¥»¥¹¤ò¤¢¤é¤æ¤ë¥Û¥¹¥È¤ËÂФ·¤Æµö²Ä¤·¤¿¤³¤È¤Ë¤Ê¤ë¡£ +¥¢¥¯¥»¥¹¤òÌÀ¼¨Åª¤ËµñÈݤ¹¤ë¤Ë¤Ï¡¢ +.I hostname +¤ÎÁ°¤Ë¥Þ¥¤¥Ê¥¹µ­¹æ (\-) ¤òÉÕ¤±¤ë¡£¤½¤Î¥Û¥¹¥È¤«¤é¤Î¥æ¡¼¥¶¤Ï +¾ï¤Ë¥Ñ¥¹¥ï¡¼¥É¤òÍ׵ᤵ¤ì¤ë¡£¥»¥­¥å¥ê¥Æ¥£¾å¡¢¥Û¥¹¥È̾¤Ï +û¤¤Ì¾Á°¤Ç¤Ï¤Ê¤¯¾ï¤Ë FQDN ¤ò»È¤Ã¤Æ»ØÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.I username +¥¨¥ó¥È¥ê¤Ï¡¢ÆÃÄê¤Î¥æ¡¼¥¶¤ËÂФ·¤Æ¡¢ (root °Ê³°¤Î) ¤¢¤é¤æ¤ë¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È +¤Ø¤Î¥¢¥¯¥»¥¹¤ò¥Ñ¥¹¥ï¡¼¥É¤Ê¤·¤Çµö²Ä¤¹¤ë¡£¤¹¤Ê¤ï¤Á¡¢¤½¤Î¥æ¡¼¥¶¤ÏƱ¤¸Ì¾Á°¤Î +¥¢¥«¥¦¥ó¥È°Ê³°¤Ë¤â¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.I username +¤ÎÁ°¤Ë¤Ï¥×¥é¥¹µ­¹æ (+) ¤òÃÖ¤¤¤Æ¤â¤è¤¤¡£ +ÆÃÄê¤Î¥æ¡¼¥¶¤«¤é¤Î¥¢¥¯¥»¥¹¤òÌÀ¼¨Åª¤ËµñÈݤ¹¤ë¤Ë¤Ï¡¢ +.I username +¤ÎÁ°¤Ë¥Þ¥¤¥Ê¥¹µ­¹æ (\-) ¤òÉÕ¤±¤ë¡£¤³¤¦¤¹¤ë¤È¡¢ +¥Û¥¹¥È¤Î¥¨¥ó¥È¥ê¤¬¤Ê¤ó¤È¸À¤ª¤¦¤È¤â¡¢¤½¤Î¥æ¡¼¥¶¤Ï¿®Íꤵ¤ì¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£ +.PP +netgroup ¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¡¢¤½¤Î¾ì¹ç¤Ï @ µ­¹æ¤òÁ°¤Ë¤Ä¤±¤ë¡£ +.PP +¥×¥é¥¹µ­¹æ (+) ¤òÍøÍѤ¹¤ëºÝ¤Ë¤Ï¤¯¤ì¤°¤ì¤âÃí°Õ¤¹¤ë¤³¤È¡£ +ñ½ã¤Ê¥ß¥¹¥¿¥¤¥×¤Ç¡¢Ã±ÆȤΥץ饹µ­¹æ¤òÃÖ¤¤¤Æ¤·¤Þ¤¦¤³¤È¤¬¤¢¤ë¡£ +ñÆȤΥץ饹µ­¹æ¤Ï¡Ö¤¹¤Ù¤Æ¤Î¥Û¥¹¥È¡×¤òɽ¤¹¥ï¥¤¥ë¥É¥«¡¼¥É¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦! +.SH ¥Õ¥¡¥¤¥ë +.I /etc/hosts.equiv +.SH Ãí°Õ +¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍƤ¬¸úÎϤò»ý¤Ä¤Î¤Ï¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤¬ root ¤Ç¡¢ +¤«¤Ä¤½¤ì°Ê³°¤Ë½ñ¤­¹þ¤ß¸¢¸Â¤¬¤Ê¤¤¾ì¹ç¤Ë¸ÂÄꤵ¤ì¤Æ¤¤¤ë¤³¤È¤â¤¢¤ë¡£ +¤Þ¤¿¡¢Èó¾ï¤ËÀ©¸Â¤¬¤­¤Ä¤¤¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¾¤Î +¥Ï¡¼¥É¥ê¥ó¥¯¤¬¤Ê¤¤¤³¤È¤¬Í׵ᤵ¤ì¤ë¾ì¹ç¤â¤¢¤ë¡£ +.PP +ºÇ¶á¤Î¥·¥¹¥Æ¥à¤Ç¤Ï Pluggable Authentication Modules library (PAM) ¤¬ +»È¤ï¤ì¤Æ¤¤¤ë¡£PAM ¤Ç¤Ï¡¢Ã±ÆȤΥץ饹µ­¹æ¤¬¡Ö¤¹¤Ù¤Æ¤Î¥Û¥¹¥È¡×¤òɽ¤¹ +¥ï¥¤¥ë¥É¥«¡¼¥É¤È¤·¤Æ°·¤ï¤ì¤ë¤Î¤Ï¡¢ÆÃÄê¤Î¥µ¡¼¥Ó¥¹ (Î㤨¤Ð +.BR rlogin ) +ÍѤΠPAM ¥Õ¥¡¥¤¥ë¤Ç auth ¹Ô¤Ë¥­¡¼¥ï¡¼¥É +.I promiscuous +¤¬Äɲ䵤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ß¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR rhosts (5), +.BR rlogind (8), +.BR rshd (8) diff --git a/release/man5/intro.5 b/release/man5/intro.5 new file mode 100644 index 00000000..d9a268e3 --- /dev/null +++ b/release/man5/intro.5 @@ -0,0 +1,41 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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 +.\" +.TH INTRO 5 2007-10-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +intro \- ¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¾Ò²ð +.SH ÀâÌÀ +¥Þ¥Ë¥å¥¢¥ë¤Î 5 ¾Ï¤Ï¡¢³Æ¼ï¤Î¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¡¢¥×¥í¥È¥³¥ë¡¢ +(¤â¤·¤¢¤ì¤Ð) Âбþ¤¹¤ë C ¤Î¹½Â¤ÂΤˤĤ¤¤Æµ­ºÜ¤·¤Æ¤¤¤ë¡£ +.SH È÷¹Í +.SS Ãø¼Ô¤ÈÃøºî¸¢ +Ãøºî¼Ô¤È¸¢Íø¾ò·ï¤Ë´Ø¤·¤Æ¤Ï¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥½¡¼¥¹¤Î¥Ø¥Ã¥À¤ò¸«¤è¡£ +¤³¤ì¤é¤Ï¥Ú¡¼¥¸¤´¤È¤Ë°Û¤Ê¤ë¾ì¹ç¤¬¤¢¤ë¤Î¤ÇÃí°Õ¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR standards (7) diff --git a/release/man5/issue.5 b/release/man5/issue.5 new file mode 100644 index 00000000..e41a4127 --- /dev/null +++ b/release/man5/issue.5 @@ -0,0 +1,48 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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 +.\" +.TH ISSUE 5 1993-07-24 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +issue \- ¥í¥°¥¤¥óÁ°¤Ëɽ¼¨¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¤È¥·¥¹¥Æ¥à¾ðÊó¤Î¥Õ¥¡¥¤¥ë +.SH ÀâÌÀ +\fI/etc/issue\fP¥Õ¥¡¥¤¥ë¤Ï¡¢¥í¥°¥¤¥ó¥×¥í¥ó¥×¥È¤ËÀè¤À¤Ã¤Æɽ¼¨¤µ¤ì¤ë¡¢ +¥á¥Ã¥»¡¼¥¸¤ä¥·¥¹¥Æ¥à¤Î¾ðÊ󤬽ñ¤«¤ì¤¿¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +¥·¥¹¥Æ¥à¤ÇºÎÍѤµ¤ì¤Æ¤¤¤ë +.BR getty ·Ï¤Î +¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï \fB@\fP\fIchar\fP ¤ä \fB\e\fP\fIchar\fP ¤Ê¤É¤Î +¥·¡¼¥±¥ó¥¹¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤³¤È¤â¤¢¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +/etc/issue +.SH ´ØÏ¢¹àÌÜ +.BR motd (5), +.BR agetty (8), +.BR mingetty (8) diff --git a/release/man5/locale.5 b/release/man5/locale.5 new file mode 100644 index 00000000..30ff51c1 --- /dev/null +++ b/release/man5/locale.5 @@ -0,0 +1,566 @@ +.\" Hey Emacs, this is -*- nroff -*- +.\" +.\" This file is part of locale(1) which displays the settings of the +.\" current locale. +.\" Copyright (C) 1994 Jochen Hein (Hein@Student.TU-Clausthal.de) +.\" Copyright (C) 2008 Petr Baudis (pasky@suse.cz) +.\" +.\" 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, USA. +.\" +.\" 2008-06-17 Petr Baudis +.\" LC_TIME: Describe first_weekday and first_workday +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1998-02-11, HANATAKA Shinya +.\" Updated & Modified 2001-10-18, AKihiro MOTOKI +.\" Updated 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" +.TH LOCALE 5 2008-06-17 "Linux" "Linux User Manual" +.SH ̾Á° +locale \- ¥í¥±¡¼¥ëÄêµÁ¥Õ¥¡¥¤¥ë +.SH ÀâÌÀ +.B "¥í¥±¡¼¥ë (locale)" +ÄêµÁ¥Õ¥¡¥¤¥ë¤Ï +.BR localedef (1) +¥³¥Þ¥ó¥É¤¬¥Ð¥¤¥Ê¥ê¤Î¥í¥±¡¼¥ë¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÊÑ´¹¤¹¤ë¤Î¤Ë +ɬÍפÊÁ´¤Æ¤Î¾ðÊó¤ò´Þ¤ó¤Ç¤¤¤ë¡£ + +ÄêµÁ¥Õ¥¡¥¤¥ë¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¥»¥¯¥·¥ç¥ó¤«¤é¹½À®¤µ¤ì¤Æ¤ª¤ê¡¢³Æ¥»¥¯¥·¥ç¥ó +¤Ë¤Ï¥í¥±¡¼¥ë¤Î¥«¥Æ¥´¥ê¤¬¾ÜºÙ¤Ëµ­½Ò¤µ¤ì¤ë¡£ + +.SS ʸˡ +¥í¥±¡¼¥ëÄêµÁ¥Õ¥¡¥¤¥ë¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤«¤é¹½À®¤µ¤ì¤ë¥Ø¥Ã¥À¡¼¤Ç»Ï¤Þ¤ë: +.TP +.I +¥Õ¥¡¥¤¥ë¤Î»Ä¤ê¤ÎÉôʬ¤Ç¥¨¥¹¥±¡¼¥×¡¦¥­¥ã¥é¥¯¥¿¡¼¤È¤·¤Æ»ÈÍѤ¹¤ëʸ»ú¤ò +»ØÄꤹ¤ë¡£¤³¤ì¤ÏÆüì¤Ê°ÕÌ£¤Ë²ò¼á¤µ¤ì¤ëʸ»ú¤ò¥¨¥¹¥±¡¼¥×¤¹¤ë¤Î¤Ë»ÈÍѤ¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å (\\) ¤Ç¤¢¤ë¡£ +.TP +.I +¥Õ¥¡¥¤¥ë¤Î»Ä¤ê¤ÎÉôʬ¤Ç¥³¥á¥ó¥È¡¦¥­¥ã¥é¥¯¥¿¡¼¤È¤·¤Æ»ÈÍѤ¹¤ëʸ»ú +¤ò»ØÄꤹ¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥·¥ã¡¼¥× (#) ¤Ç¤¢¤ë¡£ +.PP +¥í¥±¡¼¥ë¤ÎÄêµÁ¤Ï¥í¥±¡¼¥ë¤Î¥«¥Æ¥´¥êËè¤ÎÄêµÁ¤ò¹Ô¤¦Éôʬ¤«¤é¹½À®¤µ¤ì¤ë¡£ +³ÆÉôʬ¤Ï¡¢ÄêµÁºÑ¤ß¤Î¾¤Î¥í¥±¡¼¥ë¤Î¥³¥Ô¡¼¤ò¸µ¤ËÄêµÁ¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¤·¡¢ +ºÇ½é¤«¤éÄêµÁ¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£¥«¥Æ¥´¥ê¤ò¥³¥Ô¡¼¤¹¤ë¾ì¹ç¡¢ÄêµÁ¤ÎÃæ¤Ë +.B copy +¤È¤¤¤¦¥­¡¼¥ï¡¼¥É¤Ë³¤±¤Æ¥³¥Ô¡¼¤¹¤ë¥í¥±¡¼¥ë¤Î̾Á°¤ò½ñ¤¯¡£ +.\" FIXME glibc 2.2.2 added new nonstandard locale categories: +.\" LC_ADDRESS, LC_IDENTIFICATION, LC_MEASUREMENT, LC_NAME, +.\" LC_PAPER, LC_TELEPHONE. +.SS LC_CTYPE +.B LC_CTYPE +¥«¥Æ¥´¥ê¤ÎÄêµÁ¤ÏºÇ½é¤Î¥«¥é¥à¤Ë +.I LC_CTYPE +¤È¤¤¤¦Ê¸»úÎó¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +¤³¤³¤Ç¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤¬»ÈÍѤǤ­¤ë: +.TP +.I upper +Âçʸ»ú (uppercase letter) ¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.B A +¤«¤é +.B Z +¤Þ¤Ç¤Îʸ»ú¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.BR cntrl , +.BR digit , +.BR punct , +.B space +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.I lower +¾®Ê¸»ú (lowercase letter) ¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.B a +¤«¤é +.B z +¤Þ¤Ç¤Îʸ»ú¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.BR cntrl , +.BR digit , +.BR punct , +.B space +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.I alpha +¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Îʸ»ú¤ò»ØÄꤹ¤ë¡£ +.B upper +¤È +.B lower +¤ò»ØÄꤷ¤¿Á´¤Æ¤Îʸ»ú¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.BR cntrl , +.BR digit , +.BR punct , +.B space +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.I digit +¿ô»ú¤È¤·¤Æ»ÈÍѤµ¤ì¤ëʸ»ú¤ò»ØÄꤹ¤ë¡£¿ô»ú¤È¤·¤Æ¤Ï +.B 0 +¤«¤é +.B 9 +¤Î¤ß¤¬»ÈÍѤǤ­¤ë¡£¤³¤ì¤é¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I space +¶õÇò¤È¤·¤Æ»ÈÍѤ¹¤ëʸ»ú¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR graph , +.B xdigit +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.BR , +.BR , +.BR , +.BR , +.BR , +.B +¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.TP +.I cntrl +¥³¥ó¥È¥í¡¼¥ë¡¦¥­¥ã¥é¥¯¥¿¡¼¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR punct , +.BR graph , +.BR print , +.B xdigit +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.I punct +¶çÆÉÅÀʸ»ú¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR cntrl , +.BR xdigit , +.B +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.I graph +ɽ¼¨²Äǽʸ»ú¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¤¬¡¢ +.B +ʸ»ú¤Ï´Þ¤Þ¤Ê¤¤¡£ +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR xdigit , +.B punct +¤ò»ØÄꤷ¤¿Ê¸»ú¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.B cntrl +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.I print +.B +ʸ»ú¤ò´Þ¤á¤¿É½¼¨²Äǽʸ»ú¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.BR upper , +.BR lower , +.BR alpha , +.BR digit , +.BR xdigit , +.BR punct , +.B +¤Ë»ØÄꤷ¤¿Ê¸»ú¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.B cntrl +¤Ë»ØÄꤵ¤ì¤¿Ê¸»ú¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.I xdigit +16 ¿Ê¿ô¤È¤·¤Æ»ÈÍѤ¹¤ëʸ»ú¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£10 ¿Ê¤Î¿ô»ú¤Ë²Ã¤¨¤Æ¡¢ +6 ʸ»ú¤ò¾º½ç¤Ç³¤±¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï°Ê²¼¤Îʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë: +.B 0 +¤«¤é +.BR 9 ¡¢ +.B a +¤«¤é +.BR f ¡¢ +.B A +¤«¤é +.BR F ¡£ +.TP +.I blank +.B "̵ÃÏ (blank)" +¤ËʬÎव¤ì¤ëʸ»ú¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.B +¤È +.B +¤Ï¼«Æ°Åª¤Ë´Þ¤Þ¤ì¤ë¡£ +.TP +.I toupper +¾®Ê¸»ú¤«¤éÂçʸ»ú¤Ø¤ÎÂбþ¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£³ÆÂбþ¤Ï¾®Ê¸»ú¤ÈÂçʸ»ú¤Î¥Ú¥¢¤ò +.B , +¤Ç¶èÀڤäƳç¸Ì¤Ç³ç¤Ã¤Æ»ØÄꤹ¤ë¡£ +¥ê¥¹¥È¤Î³Æ¥á¥ó¥Ð¡¼¤Ï¥»¥ß¥³¥í¥ó¤Ç¶èÀڤ롣 +.TP +.I tolower +Âçʸ»ú¤«¤é¾®Ê¸»ú¤Ø¤ÎÂбþ¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£tolower ¤È¤¤¤¦ +¥­¡¼¥ï¡¼¥É¤¬Ìµ¤¤¾ì¹ç¤Ë¤Ï toupper ¤òµÕ¤Ë¤·¤¿¤â¤Î¤¬»ÈÍѤµ¤ì¤ë¡£ +.PP +.B LC_CTYPE +¤ÎÄêµÁ¤Ï +.I "END LC_CYTPE" +¤È¤¤¤¦Ê¸»úÎó¤Ç½ªÎ»¤¹¤ë¡£ +.SS LC_COLLATE +.B LC_COLLATE +¥«¥Æ¥´¥ê¤ÏÀ°Îó½ç½ø¤òÄêµÁ¤·¤Æ¤¤¤ë¡£libc ¤Ë¤è¤ëÀ©¸Â¤Î¤¿¤á +POSIX ¥ª¥×¥·¥ç¥ó¤ÎÁ´¤Æ¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ + +¤³¤Î¥«¥Æ¥´¥ê¤ÎÄêµÁ¤ÏºÇ½é¤Î¥«¥é¥à¤Ë +.B LC_COLLATE +¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +¤³¤³¤Ç¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤¬»ÈÍѤǤ­¤ë: +.TP +.I collating-element +.TP +.I collating-symbol +.PP +½ç½ø¤ÎÄêµÁ¤Ï°Ê²¼¤Î¹Ô¤Ç»Ï¤á¤ë: +.TP +.I order_start +.PP +¤³¤ì¤Ë +.BR forward , +.BR backward , +.B position +¤Î¤¤¤º¤ì¤«¤Î¥­¡¼¥ï¡¼¥É¤¬Â³¤¯¡£ +½ç½ø¤òµ­½Ò¤¹¤ë¹Ô¤¬Â³¤­¡¢°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤Ç½ª¤ë: +.TP +.I order_end +.PP +¤è¤ê¾Ü¤·¤¯¤Ï +.I /usr/lib/nls/src +¤Ë¤¢¤ë¥½¡¼¥¹¡¦¥Õ¥¡¥¤¥ë¤ò»²¾È¤Î¤³¤È¡£ÆÃ¤Ë +.B POSIX +¤ÎÎã¡¢ +.B Example +¤È +.B Example2 +¤ò¸«¤ë¤È¤è¤¤¡£ +.PP +.B LC_COLLATE +ÄêµÁ¤Ï +.I "END LC_COLLATE" +¤È¤¤¤¦Ê¸»úÎó¤Ç½ªÎ»¤¹¤ë¡£ +.SS LC_MONETARY +.B LC_MONETARY +¤ÎÄêµÁ¤ÏºÇ½é¤Î¥«¥é¥à¤Ë +.B LC_MONETARY +¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +¤³¤³¤Ç¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë: +.TP +.I int_curr_symbol +¹ñºÝÄ̲ߵ­¹æ¤ò»ØÄꤹ¤ë¡£¤³¤ì¤Ï ISO 4217 µ¬³Ê¤ËÄêµÁ¤µ¤ì¤¿¹ñºÝÄÌ²ß +µ­¹æ (3 ʸ»ú) ¤Ë¶èÀÚ¤êʸ»ú¤ò³¤±¤¿ 4 ʸ»ú¤Ç¤¢¤ëɬÍפ¬¤¢¤ë¡£ +.TP +.I currency_symbol +ÃÏ°èŪ¤ÊÄ̲ߵ­¹æ¤ò»ØÄꤹ¤ë¡£ +.TP +.I mon_decimal_point +¶â³Û¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ëºÝ¤Î¾®¿ôÅÀ¤Ë»ÈÍѤ¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.I mon_thousands_sep +¶â³Û¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ëºÝ¤Ë·å¤Î¶èÀÚ¤ê¤Ë»ÈÍѤ¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.I mon_grouping +¿ô»ú¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¤¹¤ëºÝ¤Ë²¿·å¤´¤È¤Ë¶èÀڤ뤫¤ò»ØÄꤹ¤ë¡£ +.TP +.I positive_sign +¿ôÃͤˤª¤¤¤ÆÀµ¤ÎÉä¹æ¤Ë»ÈÍѤ¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.I negative_sign +¿ôÃͤˤª¤¤¤ÆÉé¤ÎÉä¹æ¤Ë»ÈÍѤ¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.I int_frac_digits +.B int_curr_symbol +¤Ç¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ë»þ¤Ë»ÈÍѤ¹¤Ù¤­Ã¼¿ô¤Î·å¿ô¤ò»ØÄꤹ¤ë¡£ +.TP +.I frac_digits +.B currency_symbol +¤Ç¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ëºÝ¤Ë»ÈÍѤ¹¤Ù¤­Ã¼¿ô¤Î·å¿ô¤ò»ØÄꤹ¤ë¡£ +.TP +.I p_cs_precedes +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤·¤¿¶â³Û¤ÎÁ°¤ËÉÕ¤±¤ë¾ì¹ç¤Ë¤Ï +.B 1 +¤ò¡¢¸å¤í¤ËÉÕ¤±¤ë¾ì¹ç¤Ë¤Ï +.B 0 +¤ò»ØÄꤹ¤ë¡£ +.TP +.I p_sep_by_space +°Ê²¼¤ÎÀ°¿ô¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ +.RS +.TP +.B 0 +µ­¹æ¤È¿ôÃͤδ֤˶õÇò¤òÆþ¤ì¤Ê¤¤¡£ +.TP +.B 1 +µ­¹æ¤È¿ôÃͤδ֤˶õÇò¤òÆþ¤ì¤ë¡£ +.TP +.B 2 +µ­¹æ¤È¿ôÃͤ¬ÎÙÀܤ·¤Æ¤¤¤ì¤Ð´Ö¤Ë¶õÇò¤òÆþ¤ì¤ë¡£ +.RE +.TP +.I n_cs_precedes +.RS +.TP +.B 0 +- µ­¹æ¤Ï¿ôÃͤθå¤Ë¤ª¤¯¡£ +.TP +.B 1 +- µ­¹æ¤Ï¿ôÃͤÎÁ°¤Ë¤ª¤¯¡£ +.RE +.TP +.I n_sep_by_space +°Ê²¼¤ÎÀ°¿ô¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ +.RS +.TP +.B 0 +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ÈÉé¤Î¶â³Û¤È¤Î´Ö¤Ë¶õÇò¤òÆþ¤ì¤Ê¤¤¡£ +.TP +.B 1 +Éé¤Î¿ôÃͤȵ­¹æ¤Î´Ö¤Ë¶õÇò¤òÆþ¤ì¤ë¡£ +.TP +.B 2 +ÎÙÀܤ·¤Æ¤¤¤¿¾ì¹ç¤Ë¤Î¤ß¶õÇò¤òÆþ¤ì¤ë¡£ +.RE +.TP +.I p_sign_posn +.RS +.TP +.B 0 +ÃÍ¤È +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ò³ç¸Ì¤Ç³ç¤ë¡£ +.TP +.B 1 +Éä¹æ¤òÃÍ¤È +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ÎÁ°¤ËÃÖ¤¯¡£ +.TP +.B 2 +Éä¹æ¤òÃÍ¤È +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤Î¸å¤ËÃÖ¤¯¡£ +.TP +.B 3 +Éä¹æ¤ò +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ÎÁ°¤ËÃÖ¤¯¡£ +.TP +.B 4 +Éä¹æ¤ò +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤Î¸å¤ËÃÖ¤¯¡£ +.RE +.TP +.I n_sign_posn +.RS +.TP +.B 0 +ÃÍ¤È +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ò³ç¸Ì¤Ç³ç¤ë¡£ +.TP +.B 1 +Éä¹æ¤òÃÍ¤È +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ÎÁ°¤ËÃÖ¤¯¡£ +.TP +.B 2 +Éä¹æ¤òÃÍ¤È +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤Î¸å¤ËÃÖ¤¯¡£ +.TP +.B 3 +Éä¹æ¤ò +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤ÎÁ°¤ËÃÖ¤¯¡£ +.TP +.B 4 +Éä¹æ¤ò +.I currency_symbol +¤Þ¤¿¤Ï +.I int_curr_symbol +¤Î¸å¤ËÃÖ¤¯¡£ +.RE +.PP +.B LC_MONETARY +¤ÎÄêµÁ¤Ï +.I "END LC_MONETARY" +¤È¤¤¤¦Ê¸»úÎó¤Ç½ªÎ»¤¹¤ë¡£ +.SS LC_NUMERIC +¤³¤Î¥«¥Æ¥´¥ê¤ÎÄêµÁ¤ÏºÇ½é¤Î¥«¥é¥à¤Ë +.B LC_NUMERIC +¤È¤¤¤¦Ê¸»úÎó¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +¤³¤³¤Ç¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤ò»ÈÍѤǤ­¤ë: +.TP +.I decimal_point +¿ôÃͤò¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ëºÝ¤Ë¾®¿ôÅÀ¤Ë»ÈÍѤ¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.I thousands_sep +¿ôÃͤò¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ëºÝ¤Ë·å¤Î¶èÀÚ¤ê¤Ë»ÈÍѤ¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.I grouping +¿ôÃͤò¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ëºÝ¤Ë²¿·å¤´¤È¤Ë¶èÀڤ뤫¤òʸ»úÎó¤Ç»ØÄꤹ¤ë¡£ +.PP +The +.B LC_NUMERIC +¤ÎÄêµÁ¤Ï +.I "END LC_NUMERIC" +¤È¤¤¤¦Ê¸»úÎó¤Ç½ªÎ»¤¹¤ë¡£ +.SS LC_TIME +¤³¤Î¥«¥Æ¥´¥ê¤ÎÄêµÁ¤ÏºÇ½é¤Î¥«¥é¥à¤Ë +.B LC_TIME +¤È¤¤¤¦Ê¸»úÎó¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +¤³¤³¤Ç¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤¬»ÈÍѤǤ­¤ë: +.TP +.I abday +ÍËÆü¤Î̾Á°¤Î¾Êά·Á¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +¥ê¥¹¥È¤Ï +.I week +¤Ç»ØÄꤵ¤ì¤¿½µ¤Î³«»ÏÍËÆü (¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÆüÍËÆü) ¤«¤é»Ï¤á¤ë¡£ +.TP +.I day +ÍËÆü¤Î̾Á°¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +¥ê¥¹¥È¤Ï +.I week +¤Ç»ØÄꤵ¤ì¤¿½µ¤Î³«»ÏÍËÆü (¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÆüÍËÆü) ¤«¤é»Ï¤á¤ë¡£ +.TP +.I abmon +·î¤Î̾Á°¤Î¾Êά·Á¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.TP +.I mon +·î¤Î̾Á°¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +.TP +.I am_pm +¤½¤ì¤¾¤ì +.B "¸áÁ° (am)" +¤È +.B "¸á¸å (pm)" +¤ËÂбþ¤¹¤ëʸ»úÎó¤ò»ØÄꤹ¤ë¡£ +.TP +.I d_t_fmt +ŬÀÚ¤ÊÆüÉÕ¤± (date) ¤È»þ¹ï (time) ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë¡£ +.TP +.I d_fmt +ŬÀÚ¤ÊÆüÉÕ¤± (date) ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë¡£ +.TP +.I t_fmt +ŬÀڤʻþ¹ï (time) ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë¡£ +.TP +.I t_fmt_ampm +12 »þ´ÖÊý¼°¤ò»ÈÍѤ·¤¿»þ¹ï¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë¡£ +.TP +.I week +3 ¤Ä¤ÎÃͤ«¤é¤Ê¤ë¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£ +¥ê¥¹¥È¤Ï¡¢°ì½µ´Ö¤ÎÆü¿ô (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 7)¡¢ +½µ¤Î³«»ÏÍËÆü (¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÆüÍˤËÂбþ)¡¢ +°ìǯ¤ÎºÇ½é¤Î½µ¤ÎºÇ¾®¤ÎŤµ (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 4) ¤«¤é¹½À®¤µ¤ì¤ë¡£ +½µ¤Î³«»ÏÍËÆü¤Ë¤Ä¤¤¤Æ¤Ï¡¢½µ¤Î³«»ÏÆü¤¬ÆüÍËÆü¤Î¾ì¹ç¤Ë¤Ï +.B 19971130 +¤ò¡¢·îÍËÆü¤Î¾ì¹ç¤Ë¤Ï +.B 19971201 +¤ò»ÈÍѤ¹¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +.I day +¥ê¥¹¥È¤ÎºÇ½é¤ÎÆü¤È¤·¤Æ¡¢ +.B 19971130 +¤ò»È¤¦¹ñ¤Ç¤Ï¤½¤ÎÃÏ°è¤ÎÆüÍËÆü¤Î̾Á°¤ò¡¢ +.B 19971201 +¤ò»È¤¦¹ñ¤Ç¤Ï¤½¤ÎÃÏ°è¤Î·îÍËÆü¤Î̾Á°¤òÀßÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.IR first_weekday " (glibc 2.2 °Ê¹ß)" +¥«¥ì¥ó¥À¡¼¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇºÇ½é¤Ëɽ¼¨¤¹¤ëÍËÆü¤Î +.I day +¥ê¥¹¥È¤Ë¤ª¤±¤ëÈֹ档 +¥Ç¥Õ¥©¥ë¥ÈÃͤΠ1 ¤ÏÆüÍËÆü¤«·îÍËÆü¤ËÂбþ¤¹¤ë¡£ +¤É¤Á¤é¤ËÂбþ¤¹¤ë¤«¤Ï +.I week +¥ê¥¹¥È¤ÎÆóÈÖÌܤιàÌܤÎÃͤǷè¤Þ¤ë¡£ +.TP +.IR first_workday " (glibc 2.2 °Ê¹ß)" +ºÇ½é¤Î½¢¶ÈÆü¤ò¼¨¤¹ +.I day +¥ê¥¹¥È¤Ë¤ª¤±¤ëÍËÆü¤ÎÈֹ档 +.PP +.B LC_TIME +¤ÎÄêµÁ¤Ï +.I "END LC_TIME" +¤È¤¤¤¦Ê¸»úÎó¤Ç½ªÎ»¤¹¤ë¡£ +.SS LC_MESSAGES +¤³¤Î¥«¥Æ¥´¥ê¤ÎÄêµÁ¤ÏºÇ½é¤Î¥«¥é¥à¤Ë +.B LC_MESSAGES +¤È¤¤¤¦Ê¸»úÎó¤òÃÖ¤¯¤³¤È¤Ç»Ï¤á¤ë¡£ + +¤³¤³¤Ç¤Ï°Ê²¼¤Î¥­¡¼¥ï¡¼¥É¤¬»ÈÍѤǤ­¤ë: +.TP +.I yesexpr +¡Ö¤Ï¤¤ (yes)¡×¤ò°ÕÌ£¤¹¤ëÀµµ¬É½¸½¤ò»ØÄꤹ¤ë¡£ +.TP +.I noexpr +¡Ö¤¤¤¤¤¨ (no)¡×¤ò°ÕÌ£¤¹¤ëÀµµ¬É½¸½¤ò»ØÄꤹ¤ë¡£ +.PP +.B LC_MESSAGES +¤ÎÄêµÁ¤Ï +.I "END LC_MESSAGES" +¤È¤¤¤¦Ê¸»úÎó¤Ç½ªÎ»¤¹¤ë¡£ + +¤è¤ê¾Ü¤·¤¯¤Ï POSIX.2 µ¬³Ê¤ò»²¾È¤Î¤³¤È¡£ +.SH ¥Õ¥¡¥¤¥ë +/usr/lib/locale/ +\(em ¸½ºß¤Î¥í¥±¡¼¥ëÀßÄê¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.br +/usr/lib/nls/charmap/* \(em ʸ»úÄêµÁ¥Õ¥¡¥¤¥ë +.SH ½àµò +POSIX.2, ISO/IEC 14652. +.SH ¥Ð¥° +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï´°Á´¤Ç¤Ï¤Ê¤¤¡£ +.\" .SH Ãø¼Ô +.\" Jochen Hein (Hein@Student.TU-Clausthal.de) +.SH ´ØÏ¢¹àÌÜ +.BR locale (1), +.BR localedef (1) +.BR localeconv (3), +.BR setlocale (3), +.BR charmap (5), diff --git a/release/man5/motd.5 b/release/man5/motd.5 new file mode 100644 index 00000000..36208628 --- /dev/null +++ b/release/man5/motd.5 @@ -0,0 +1,46 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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 +.\" +.TH MOTD 5 1992-12-29 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +motd \- º£Æü¤Î¤ªÃΤ餻(message of the day) +.SH ÀâÌÀ +\fI/etc/motd\fP ¤ÎÆâÍÆ¤Ï +.BR login (1) +¤Ë¤è¤Ã¤Æ¥í¥°¥¤¥ó¤¬À®¸ù¤·¤¿¤¢¤È¤Ç¡¢¥í¥°¥¤¥ó¥·¥§¥ë¤¬µ¯Æ°¤µ¤ì¤ëÁ°¤Ë +ɽ¼¨¤µ¤ì¤ë¡£ + +ά¸ì "motd" ¤Ï "message of the day" ¤ò¤¢¤é¤ï¤·¤Æ¤¤¤Æ¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÅÁÅýŪ +¤Ë¤½¤Î̾¤Î¤È¤ª¤ê¤Ë»È¤ï¤ì¤Æ¤¤¤ë +(¤¹¤Ù¤Æ¤Î¥æ¡¼¥¶¡¼¤Ë¥á¥¤¥ë¤òÁ÷¤ë¤è¤ê¤â¾¯¤Ê¤¤¥Ç¥£¥¹¥¯ÍÆÎ̤·¤«É¬ÍפȤ·¤Ê¤¤)¡£ +.SH ¥Õ¥¡¥¤¥ë +/etc/motd +.SH ´ØÏ¢¹àÌÜ +.BR login (1), +.BR issue (5) diff --git a/release/man5/nologin.5 b/release/man5/nologin.5 new file mode 100644 index 00000000..708802ac --- /dev/null +++ b/release/man5/nologin.5 @@ -0,0 +1,44 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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 +.\" +.TH NOLOGIN 5 1992-12-29 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +nologin \- ÈóÆø¢¥æ¡¼¥¶¤Î¥í¥°¥¤¥ó¤ò¶Ø»ß¤¹¤ë +.SH ÀâÌÀ +\fI/etc/nologin\fP ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¤È +.BR login (1) +¤Ï¥ë¡¼¥È¤Î¤ß¤Ë¥¢¥¯¥»¥¹¤òµö²Ä¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£Â¾¤Î¥æ¡¼¥¶¡¼¤¬¥í¥°¥¤¥ó¤·¤è¤¦¤È +¤·¤Æ¤âµñÈݤ·¡¢¤½¤Î¤È¤­¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍƤòɽ¼¨¤¹¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +/etc/nologin +.SH ´ØÏ¢¹àÌÜ +.BR login (1), +.BR shutdown (8) diff --git a/release/man5/nscd.conf.5 b/release/man5/nscd.conf.5 new file mode 100644 index 00000000..18519ad0 --- /dev/null +++ b/release/man5/nscd.conf.5 @@ -0,0 +1,191 @@ +.\" -*- nroff -*- +.\" Copyright (c) 1999, 2000 SuSE GmbH Nuernberg, Germany +.\" Author: Thorsten Kukuk +.\" +.\" 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; see the file COPYING. If not, +.\" write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +.\" Boston, MA 02111-1307, USA. +.\" +.\" Japanese Version Copyright (c) 2001 Yuichi SATO +.\" all rights reserved. +.\" Translated 2001-06-09, Yuichi SATO +.\" Updated 2006-07-19, Akihiro MOTOKI , LDP v2.36 +.\" +.TH NSCD.CONF 5 1999-10-01 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +/etc/nscd.conf \- ¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥­¥ã¥Ã¥·¥å¥Ç¡¼¥â¥ó¤ÎÀßÄê¥Õ¥¡¥¤¥ë +.SH ÀâÌÀ +.BR nscd (8) +¤Ïµ¯Æ°»þ¤Ë¥Õ¥¡¥¤¥ë +.I /etc/nscd.conf +¤òÆɤ߹þ¤à¡£ +³Æ¹Ô¤Ë¤Ï¡Ö°À­¡¦Ã͡פޤ¿¤Ï¡Ö°À­¡¦¥µ¡¼¥Ó¥¹¡¦Ã͡פò»ØÄꤹ¤ë¡£ +¥Õ¥£¡¼¥ë¥É¤Ï¥¹¥Ú¡¼¥¹Ê¸»ú¤Þ¤¿¤Ï¥¿¥Öʸ»ú¤Ç¶èÀÚ¤é¤ì¤ë¡£ +\(aq#\(aq (¥Ê¥ó¥Ð¡¼µ­¹æ) ¤Ï¥³¥á¥ó¥È¤Î»Ï¤Þ¤ê¤òɽ¤¹¡£ +¤³¤Îµ­¹æ¤«¤é¹ÔËö¤Þ¤Ç¤Ï nscd ¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤Ê¤¤¡£ +»ØÄê²Äǽ¤Ê¥µ¡¼¥Ó¥¹¤Ï \fIpasswd\fP, \fIgroup\fP, \fIhosts\fP ¤Ç¤¢¤ë¡£ + +.B logfile +.I debug-file-name +.RS +¥Ç¥Ð¥Ã¥°¾ðÊ󤬽ñ¤­¹þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î̾Á°¤ò»ØÄꤹ¤ë¡£ +.RE + +.B debug-level +.I value +.RS +´õ˾¤¹¤ë¥Ç¥Ð¥Ã¥°¥ì¥Ù¥ë¤òÀßÄꤹ¤ë¡£ +.RE + +.B threads +.I number +.RS +¥¹¥ì¥Ã¥É¤ò¤¤¤¯¤Äµ¯Æ°¤·¤Æ¥ê¥¯¥¨¥¹¥È¤òÂԤĤΤ«¤ò»ØÄꤹ¤ë¡£ +¾¯¤Ê¤¯¤È¤â 5 ¤Ä¤Î¥¹¥ì¥Ã¥É¤¬¾ï¤ËºîÀ®¤µ¤ì¤ë¡£ +.RE + +.B server-user +.I user +.RS +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤ë¤È¡¢ +nscd ¤Ï root ¤Ç¤Ï¤Ê¤¯¡¢¤³¤Î user ¤È¤·¤Æ¼Â¹Ô¤µ¤ì¤ë¡£ +(\-S ¥Ñ¥é¥á¡¼¥¿¤Ë¤è¤ê) ³Æ¥æ¡¼¥¶¡¼Ëè¤ËÊÌ¡¹¤Î¥­¥ã¥Ã¥·¥å¤¬»È¤ï¤ì¤ë¾ì¹ç¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï̵»ë¤µ¤ì¤ë¡£ +.RE + +.B enable-cache +.I service +.I +.RS +»ØÄꤷ¤¿ +.I service +¤Î¥­¥ã¥Ã¥·¥å¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ +.RE + +.B positive-time-to-live +.I service +.I value +.RS +»ØÄꤷ¤¿ +.I service +¤Î¥­¥ã¥Ã¥·¥å¤Ë¤¢¤ë¥Ý¥¸¥Æ¥£¥Ö¥¨¥ó¥È¥ê (À®¸ù¤·¤¿Ì䤤¹ç¤ï¤») ¤Î +TTL (time-to-live) ¤òÀßÄꤹ¤ë¡£ +.I value +¤Îñ°Ì¤ÏÉäǤ¢¤ë¡£ +ÃͤòÂ礭¤¯¤¹¤ë¤È¡¢¥Ò¥Ã¥ÈΨ¤¬¹â¤¯¤Ê¤êÊ¿¶Ñ±þÅú»þ´Ö¤òû¤¯¤Ç¤­¤ë¤¬¡¢ +¥­¥ã¥Ã¥·¥å¤Î¥³¥Ò¡¼¥ì¥ó¥¹ (coherence, +¥­¥ã¥Ã¥·¥å¤¬¼ÂºÝ¤Î¥Ç¡¼¥¿¤È°ìÃפ·¤Æ¤¤¤ë¤³¤È) ¤ËÌäÂ꤬À¸¤¸¤ë¡£ +.RE + +.B negative-time-to-live +.I service +.I value +.RS +»ØÄꤷ¤¿ +.I service +¤Î¥­¥ã¥Ã¥·¥å¤Ë¤¢¤ë¥Í¥¬¥Æ¥£¥Ö¥¨¥ó¥È¥ê (¼ºÇÔ¤·¤¿Ì䤤¹ç¤ï¤») ¤Î +TTL (time-to-live) ¤òÀßÄꤹ¤ë¡£ +.I value +¤Îñ°Ì¤ÏÉäǤ¢¤ë¡£ +¥·¥¹¥Æ¥à¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ê¤¤ UID (¥æ¡¼¥¶¡¼ID) ¤Ç½êÍ­¤µ¤ì¤ë¥Õ¥¡¥¤¥ë +(¤¿¤È¤¨¤Ð root ¤Ç tar ¤òŸ³«¤·¤¿ linux ¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹) ¤¬¾¯¤Ê¤¤¤È¡¢ +¸²Ãø¤ÊÀ­Ç½¤Î¸þ¾å¤¬¸«¤é¤ì¤ë¡£ +¥­¥ã¥Ã¥·¥å¤Î¥³¥Ò¡¼¥ì¥ó¥¹ÌäÂê¤ò¾¯¤Ê¤¯¤¹¤ë¤¿¤á¤Ë¾®¤µ¤ÊÃͤˤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.RE + +.B suggested-size +.I service +.I value +.RS +ÆâÉô¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ÎÂ礭¤µ¤ò»ØÄꤹ¤ë¡£ +¸úΨ¤òºÇŬ¤Ë¤¹¤ë¤¿¤á¤Ë +.I value +¤ÏÁÇ¿ô¤Ë¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.RE + +.B check-files +.I service +.I +.RS +»ØÄꤷ¤¿ +.I service +¤Ë´ØÏ¢¤¹¤ë¥Õ¥¡¥¤¥ë¤ÎÊѹ¹¤Î¥Á¥§¥Ã¥¯¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤Ï +.IR /etc/passwd , +.IR /etc/group , +.I /etc/hosts +¤Ç¤¢¤ë¡£ +.RE + +.B max-threads +.I threads +.RS +³«»Ï¤¹¤ë¥¹¥ì¥Ã¥É¤ÎºÇÂç¿ô¤ò»ØÄꤹ¤ë¡£ +.RE + +.B stat-user +.I username +.RS +Åý·×¾ðÊó¤Î»²¾È¤òµö²Ä¤¹¤ë¥æ¡¼¥¶¤ò»ØÄꤹ¤ë¡£ +.RE + +.B reload-count +unlimited | +.I number +.RS +¥­¥ã¥Ã¥·¥å¤µ¤ì¤¿¥¨¥ó¥È¥ê¤¬»ÈÍѤµ¤ì¤Ê¤«¤Ã¤¿¤È¤­¤Ë¡¢ +ºï½ü¤µ¤ì¤ëÁ°¤Ë²¿²ó¥ê¥í¡¼¥É¤µ¤ì¤ë¤«¤òÀßÄꤹ¤ë¡£ +.RE + +.B paranoia +.I +.RS +¥Ñ¥é¥Î¥¤¥¢¥â¡¼¥É¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¥Ñ¥é¥Î¥¤¥¢¥â¡¼¥É¤Ç¤Ï nscd ¤òÄê´üŪ¤ËºÆµ¯Æ°¤¹¤ë¡£ +.RE + +.B restart-interval +.I time +.RS +¥Ñ¥é¥Î¥¤¥¢¥â¡¼¥É¤¬Í­¸ú¤ÇÄê´üŪ¤ËºÆµ¯Æ°¤¹¤ë¾ì¹ç¤Î¡¢ +ºÆµ¯Æ°´Ö³Ö¤ò +.I time +ÉäËÀßÄꤹ¤ë¡£ +.RE + +.B persistent +.I service +.I +.RS +¥µ¡¼¥Ð¤ÎºÆµ¯Æ°¤ÎÁ°¸å¤Ç +.I service +¤Î¥­¥ã¥Ã¥·¥åÆâÍƤòÊÝ»ý¤¹¤ë¡£ +.B paranoia +¥â¡¼¥É¤¬Í­¸ú¤Î¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.RE + +.B shared +.I service +.I +.RS +.I service +¤Î nscd ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥á¥â¥ê¡¦¥Þ¥Ã¥Ô¥ó¥°¤ò¥¯¥é¥¤¥¢¥ó¥È´Ö¤Ç¶¦Í­¤¹¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¸¡º÷¤ò¼Â¹Ô¤¹¤ëÅ٤˥½¥±¥Ã¥È·Ðͳ¤Ç¥Ç¡¼¥â¥ó¤ËÌ䤤¹ç¤ï¤»¤ò +¹Ô¤ï¤º¤Ë¡¢Ä¾Àܥǡ¼¥¿¥Ù¡¼¥¹¤ò¸¡º÷¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.RE +.SH ´ØÏ¢¹àÌÜ +.BR nscd (8) +.\" .SH Ãø¼Ô +.\" .B nscd +.\" ¤Ï Thorsten Kukuk ¤È Ulrich Drepper ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ diff --git a/release/man5/nsswitch.conf.5 b/release/man5/nsswitch.conf.5 new file mode 100644 index 00000000..941d5ed7 --- /dev/null +++ b/release/man5/nsswitch.conf.5 @@ -0,0 +1,274 @@ +.\" Copyright (c) 1998 Thorsten Kukuk (kukuk@vt.uni-paderborn.de) +.\" +.\" 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. +.\" +.\" This manual page based on the GNU C Library info pages. +.\" FIXME ? The use of quotes on this page is inconsistent with the +.\" rest of man-pages. +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Wed Apr 29 1998 by NAKANO Takeo +.\" Updated & Modified Sat Aug 21 1999 +.\" by NAKANO Takeo +.\" Updated Fri Oct 12 JST 2001 by Akihiro MOTOKI +.\" +.\" WORD: lookup ±ÜÍ÷(¤¹¤ë) +.\" +.TH NSSWITCH.CONF 5 1999-01-17 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +nsswitch.conf \- ¥·¥¹¥Æ¥à¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥¹¥¤¥Ã¥Á¤ÎÀßÄê¥Õ¥¡¥¤¥ë +.SH ÀâÌÀ +C ¥é¥¤¥Ö¥é¥ê¤Îµ¡Ç½¤ÎÃæ¤Ë¤Ï¡¢¥í¡¼¥«¥ë¤Ê´Ä¶­¤ÇÀµ¤·¤¯Æ°ºî¤µ¤»¤ë¤Ë¤ÏÀßÄ꤬ +ɬÍפʤâ¤Î¤¬Â¿¿ô¸ºß¤¹¤ë¡£ÅÁÅýŪ¤Ë¤³¤ì¤Ï¥Õ¥¡¥¤¥ë (Î㤨¤Ð \fI/etc/passwd\fP) ¤ò +ÍѤ¤¤ë¤³¤È¤Ç¼Â¸½¤µ¤ì¤Æ¤­¤¿¡£¤·¤«¤·Â¾¤Î¥Í¡¼¥à¥µ¡¼¥Ó¥¹ (Network +Information Service (NIS) ¤ä Domain Name Service (DNS)) ¤¬°ìÈÌŪ¤Ë¤Ê¤ê¡¢ +¤³¤ì¤é¤¬ C ¥é¥¤¥Ö¥é¥ê¤Ë¼è¤ê¹þ¤Þ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Ã¤¿¡£¤¿¤À¤·Ä̾¸¡ +º÷¤Î½ç½ø¤Ï¸ÇÄꤵ¤ì¤Æ¤¤¤¿¡£ +.LP +NYS ¤ò¥µ¥Ý¡¼¥È¤·¤¿ Linux libc5 ¤ä GNU C Linrary 2.x (libc.so.6) ¤Ç¤Ï¡¢ +¤³¤ÎÌäÂê¤Ï¤è¤ê¸«Ä̤·Îɤ¯²ò·è¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£¤³¤ì¤é¤Ï Sun +Microsystems ¤¬ Solaris 2 ¤Î C ¥é¥¤¥Ö¥é¥ê¤ÇÍѤ¤¤¿ÊýË¡¤Ë¤Ê¤é¤Ã¤Æ¤¤¤ë¡£ +°Ê²¼¤Ç¤Ï¤³¤Î»ÅÁȤߤò "Name Service Switch" (NSS) ¤È¸Æ¤Ö¡£¥Ç¡¼¥¿¥Ù¡¼¥¹ +¤Î¾ðÊ󸻤ȡ¢¤½¤ì¤é¤ò±ÜÍ÷¤¹¤ë½ç½ø¤ò»ØÄꤷ¤¿¤Î¤¬ +.I /etc/nsswitch.conf +¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.LP +NSS(¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥¹¥£¥Ã¥Á) ¤Ç¤Ï°Ê²¼¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B aliases +.BR sendmail (8) +¤ÇÍѤ¤¤é¤ì¤ë¥á¡¼¥ë¥¨¥¤¥ê¥¢¥¹¡£ +¸½ºß¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.B ethers +¥¤¡¼¥µ¡¼¥Í¥Ã¥ÈÈֹ档 +.TP +.B group +¥æ¡¼¥¶¡¼¤Î¥°¥ë¡¼¥×¡£ +.BR getgrent (3) +´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B hosts +¥Û¥¹¥È̾¤È¥Û¥¹¥ÈÈֹ档 +.BR gethostbyname (3) +¤Ê¤É¤Î´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B netgroup +¥Í¥Ã¥È¥ï¡¼¥¯¥ï¥¤¥É¤ËÍѤ¤¤é¤ì¤ë¥Û¥¹¥È¤ä¥æ¡¼¥¶¡¼¤Î¥ê¥¹¥È¡£¥¢¥¯¥»¥¹À©¸Â¤Ë +ÍøÍѤµ¤ì¤ë¡£ glibc 2.1 °ÊÁ°¤Î C ¥é¥¤¥Ö¥é¥ê¤Ï¡¢ NIS ¾å¤Ç¤À¤± +netgroup ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.TP +.B networks +¥Í¥Ã¥È¥ï¡¼¥¯Ì¾¤ÈÈֹ档 +.BR getnetent (3) +´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B passwd +¥æ¡¼¥¶¡¼¥Ñ¥¹¥ï¡¼¥É¡£ +.BR getpwent (3) +´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B protocols +¥Í¥Ã¥È¥ï¡¼¥¯¥×¥í¥È¥³¥ë¡£ +.BR getprotoent (3) +´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B publickey +NIS+ ¤È NFS ¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë secure_rpc ¤Î¸ø³«¸°¤ÈÈëÌ©¸°¡£ +.TP +.B rpc +¥ê¥â¡¼¥È¥×¥í¥·¥¸¥ã¡¼¥³¡¼¥ë (remote procedure call) ¤Î̾Á°¤ÈÈֹ档 +.BR getrpcbyname (3) +¤Ê¤É¤Î´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B services +¥Í¥Ã¥È¥ï¡¼¥¯¥µ¡¼¥Ó¥¹¡£ +.BR getservent (3) +´Ø¿ô¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B shadow +¥·¥ã¥É¥¦¥æ¡¼¥¶¡¼¥Ñ¥¹¥ï¡¼¥É¡£ +.BR getspnam (3) +¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£ +.LP +.I /etc/nsswitch.conf +¥Õ¥¡¥¤¥ë¤Î°ìÎã¤ò°Ê²¼¤Ë¼¨¤¹ (¤³¤³¤Ë¼¨¤¹ÆâÍÆ¤Ï +.I /etc/nsswitch.conf +¥Õ¥¡¥¤¥ë¤¬¤Ê¤¤¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¤ÈƱ¤¸¤Ç¤¢¤ë)¡£ +.sp 1n +.PD 0 +.TP 16 +passwd: +compat +.TP +group: +compat +.TP +shadow: +compat +.sp 1n +.TP +hosts: +dns [!UNAVAIL=return] files +.TP +networks: +nis [NOTFOUND=return] files +.TP +ethers: +nis [NOTFOUND=return] files +.TP +protocols: +nis [NOTFOUND=return] files +.TP +rpc: +nis [NOTFOUND=return] files +.TP +services: +nis [NOTFOUND=return] files +.PD +.LP +ºÇ½é¤Î¥«¥é¥à¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤Ç¤¢¤ë¡£ +¹Ô¤Î»Ä¤ê¤Ç¤Ï±ÜÍ÷¥×¥í¥»¥¹¤ÎÆ°ºî¤ò»ØÄꤷ¤Æ¤¤¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ·¤Æ¡¢±ÜÍ÷ÊýË¡¤ÏÆÈΩ¤ËÀßÄê¤Ç¤­¤ë¡£ +.LP +³Æ¡¹¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀßÄê¤Ë¤Ï°Ê²¼¤Î 2 ¼ïÎà¤ÎÆâÍƤò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PD 0 +.TP +* ¥µ¡¼¥Ó¥¹¤Î»ØÄê¡£ `files', `db', `nis' ¤Ê¤É¡£ +.TP +* ±ÜÍ÷·ë²Ì¤ËÂФ¹¤ë¥ê¥¢¥¯¥·¥ç¥ó¡£ `[NOTFOUND=return]' ¤Ê¤É¡£ +.PD +.LP +NYS µ¡Ç½¤òÁȤ߹þ¤ó¤À libc5 ¤Ç¤Ï¡¢»ØÄê¤Ç¤­¤ë¥µ¡¼¥Ó¥¹¤Ï `files'¡¢ `nis'¡¢ +`nisplus' ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ hosts ¤ËÂФ·¤Æ¤Ï `dns' ¤â»ØÄê¤Ç¤­¤ë¡£¤Þ¤¿ +passwd ¤È group ¤ËÂФ·¤Æ¤Ï `compat' ¤â»ØÄê¤Ç¤­¤ë¡£ shadow ¤Ë¤Ï +`compat' ¤Î»ØÄê¤Ï¤Ç¤­¤Ê¤¤¡£ +.LP +glibc ¤Ç¤Ï¡¢ÍøÍѤ·¤è¤¦¤È¤¹¤ë¥µ¡¼¥Ó¥¹ SERVICE ¤½¤ì¤¾¤ì¤ËÂФ· +¤Æ +.BI /lib/libnss_SERVICE.so. X +¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬É¬Íפˤʤ롣ɸ½àŪ¤Ê¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤Ï `files'¡¢ `db'¡¢ +`nis'¡¢ `nisplus' ¤¬ÍøÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¤¡£ hosts ¤ËÂÐ +¤·¤Æ¤Ï `dns' ¤â»ØÄê¤Ç¤­¡¢ passwd¡¢ group¡¢ shadow ¤ËÂФ·¤Æ¤Ï `compat' +¤â»ØÄê¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î¥µ¡¼¥Ó¥¹¤Ï libc5+NYS ¤Î´Ä¶­¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£ +¥Ð¡¼¥¸¥ç¥óÈÖ¹æ +.I X +¤Ï¡¢ glibc 2.0 ÍѤʤé 1¡¢ glibc 2.1 ÍѤʤé 2 ¤Ç¤¢¤ë¡£ +.LP +Æó¤Ä¤á¤Î»ØÄêÊýË¡¤Ï±ÜÍ÷¥×¥í¥»¥¹¤ò¤è¤ê¾ÜºÙ¤ËÀ©¸æ¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£¥¢ +¥¯¥·¥ç¥ó»ØÄê (action item) ¤Ï¥µ¡¼¥Ó¥¹Ì¾¤Î´Ö¤Ë¡¢³Ñ¤«¤Ã¤³ [] ¤Ç³ç¤é¤ì¤Æ +µ­½Ò¤µ¤ì¤ë¡£°ìÈÌŪ¤Ê½ñ¼°¤Ï°Ê²¼¤ÎÄ̤ꡣ +.LP +`[' ( `!'? STATUS `=' ACTION )+ `]' +.LP +¤³¤³¤Ç¤½¤ì¤¾¤ì +.sp 1n +.PD 0 +.TP +STATUS => success | notfound | unavail | tryagain +.TP +ACTION => return | continue +.PD +¤Ç¤¢¤ë¡£ +.LP +¥­¡¼¥ï¡¼¥É¤ÎÂçʸ»ú¾®Ê¸»ú¤Ï¶èÊ̤µ¤ì¤Ê¤¤¡£ STATUS ¤ÎÃͤÏÆÃÄê¤Îµ¡Ç½¤ËÂФ· +¤Æ±ÜÍ÷¤ò¹Ô¤Ã¤¿·ë²Ì¤Ç¤¢¤ë¡£¤½¤ì¤¾¤ì¤Î°ÕÌ£¤Ï°Ê²¼¤ÎÄ̤ꡣ +.TP +.B success +¥¨¥é¡¼¤Ïµ¯¤³¤é¤º¡¢É¬Íפʥ¨¥ó¥È¥ê¤¬ÊÖ¤µ¤ì¤¿¡£¤³¤Î·ë²Ì¤ËÂФ¹¤ë¥Ç¥Õ¥©¥ë¥È +¤Î¥¢¥¯¥·¥ç¥ó¤Ï `return' ¤Ç¤¢¤ë¡£ +.TP +.B notfound +±ÜÍ÷¥×¥í¥»¥¹¤Ïµ¡Ç½¤·¤Æ¤¤¤ë¤¬¡¢É¬ÍפÊÃͤ¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£¥Ç¥Õ¥©¥ë¥È¤Î +¥¢¥¯¥·¥ç¥ó¤Ï `continue'¡£ +.TP +.B unavail +¥µ¡¼¥Ó¥¹¤¬¡Ê±Ê³Ū¤Ë¡ËÍøÍѤǤ­¤Ê¤¤¡£É¬Íפʥե¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡¢DNS ¤Î +¾ì¹ç¤Ë¤Ï¥µ¡¼¥Ð¤ËÂФ¹¤ëÌ䤤¹ç¤ï¤»¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¡¢¤Ê¤É¤¬¤¢¤ê¤¦¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î¥¢¥¯¥·¥ç¥ó¤Ï `continue'¡£ +.TP +.B tryagain +¥µ¡¼¥Ó¥¹¤¬°ì»þŪ¤ËÍøÍѤǤ­¤Ê¤¤¡£¥Õ¥¡¥¤¥ë¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¡¢¥µ¡¼¥Ð¤ÎÀÜ +³¿ô¤¬¥ê¥ß¥Ã¥È¤ò±Û¤¨¤Æ¤¤¤Æ¸½ºßÍøÍѤǤ­¤Ê¤¤¡¢¤Ê¤É¤¬¹Í¤¨¤é¤ì¤ë¡£¥Ç¥Õ¥©¥ë +¥È¤Î¥¢¥¯¥·¥ç¥ó¤Ï `continue'¡£ +.SS +/\- ½ñ¼°¤È¤Î´Ø·¸ (compat ¥â¡¼¥É) +NYS µ¡Ç½¤òÁȤ߹þ¤ó¤Ç¤¤¤Ê¤¤ libc5 ¤Ï¡¢¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥¹¥¤¥Ã¥Á¤Îµ¡Ç½¤ò»ý¤Ã +¤Æ¤¤¤Ê¤¤¡£¤·¤«¤·¤¢¤ëÄøÅ٤Υݥꥷ¡¼À©¸æ¤Ï¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.I /etc/passwd +¤Ç¤Ï +user ¤ä +@netgroup (NIS ¤Î passwd ¥Þ¥Ã¥×¤«¤é»ØÄꤷ¤¿¥æ¡¼¥¶¤ò¼è¤ê¹þ +¤à)¡¢ \-user ¤ä \-@netgroup (»ØÄꤷ¤¿¥æ¡¼¥¶¤ò½ü³°¤¹¤ë)¡¢ + (NIS ¤Î +passwd ¥Þ¥Ã¥×¤«¤é¡¢½ü³°¤µ¤ì¤¿¥æ¡¼¥¶°Ê³°¤ÎÁ´¤Æ¤Î¥¨¥ó¥È¥ê¤ò¼è¤ê¹þ¤à) ¤Ê +¤É¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤Û¤È¤ó¤É¤Î¾ì¹ç¤Ï +.I /etc/passwd +¤ÎºÇ¸å¤Ë + ¤òÉÕ¤±¤Æ NIS ¤Î¤¹¤Ù¤Æ¤ò¼è¤ê¹þ¤ó¤Ç¤¤¤ë¤À¤±¤Ê¤Î¤Ç¡¢ +¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥¹¥¤¥Ã¥Á¤òÍѤ¤¤Æ +(`passwd: files nis') ¤Î¤è¤¦¤Ë¤¹¤ì¤Ð¤è¤ê¹â®¤ÊÆ°ºî¤¬´üÂԤǤ­¡¢ +¤Þ¤¿ +.IR /etc/passwd ", " /etc/group ", " /etc/shadow +¤Ë + ¤À¤±¤Î¥¨¥ó¥È¥ê¤ò½ñ¤«¤Ê¤¯¤Æ¤¹¤à¡£ +¤è¤êºÙ¤«¤ÊÀ©¸æ¤ò¹Ô¤¤¤¿¤¤¾ì¹ç¤Ï¡¢ NSS ¤Î `compat' ¥µ¡¼¥Ó¥¹¤òÍѤ¤¤ì¤Ð ++/\- ½ñ¼°¤ò¥Õ¥ë¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥½¡¼¥¹¤Ï `nis' ¤Ë¤Ê¤Ã +¤Æ¤¤¤ë¤¬¡¢¤³¤ì¤Ïµ¼»÷¥Ç¡¼¥¿¥Ù¡¼¥¹ +.BR passwd_compat , group_compat , shadow_compat +¤Ê¤É¤Ë `nisplus' ¤ò»ØÄꤹ¤ë¤³¤È¤Ç¾å½ñ¤­¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Îµ¼»÷¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ï GNU C ¥é¥¤¥Ö¥é¥ê¤Ç¤·¤«ÍøÍѤǤ­¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +SERVICE ¤È¤¤¤¦Ì¾Á°¤Î¥µ¡¼¥Ó¥¹¤Ï libnss_SERVICE.so.1 ¤È¤¤¤¦Ì¾Á°¤Î¶¦Í­¥ª +¥Ö¥¸¥§¥¯¥È¥é¥¤¥Ö¥é¥ê¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£¤³¤ì¤Ï /lib ¤ËÃÖ¤«¤ì¤ë¡£ +.TP 25 +.PD 0 +.I /etc/nsswitch.conf +ÀßÄê¥Õ¥¡¥¤¥ë¡£ +.TP +.BI /lib/libnss_compat.so. X +glibc2 ¤ËÂФ·¤Æ `compat' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.BI /lib/libnss_db.so. X +glibc2 ¤ËÂФ·¤Æ `db' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.BI /lib/libnss_dns.so. X +glibc2 ¤ËÂФ·¤Æ `dns' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.BI /lib/libnss_files.so. X +glibc2 ¤ËÂФ·¤Æ `files' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.BI /lib/libnss_hesoid.so. X +glibc2 ¤ËÂФ·¤Æ `hesoid' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.BI /lib/libnss_nis.so. X +glibc2 ¤ËÂФ·¤Æ `nis' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.BI /lib/libnss_nisplus.so. X +glibc2 ¤ËÂФ·¤Æ `nisplus' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.TP +.I /lib/libnss_nisplus.so.2 +glibc 2.1 ¤ËÂФ·¤Æ `nisplus' ¥½¡¼¥¹¤ò¼ÂÁõ¤·¤¿¤â¤Î¡£ +.PD +.SH Ãí°Õ +.I nsswitch.conf +¤òÍøÍѤ¹¤ë¤½¤ì¤¾¤ì¤Î¥×¥í¥»¥¹¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë¤Ï°ìÅÙ¤·¤«Æɤ߹þ¤Þ¤ì¤Ê¤¤¡£ +¤â¤· nsswitch.conf ¤¬¤¢¤È¤Ç½ñ¤­´¹¤¨¤é¤ì¤Æ¤â¡¢ +¤½¤Î¥×¥í¥»¥¹¤Ï¸Å¤¤ÀßÄê¤Î¤Þ¤Þ¤ÇÆ°ºî¤ò·Ñ³¤¹¤ë¡£ +.LP +Solaris ¤Ç¤Ï NSS ¥µ¡¼¥Ó¥¹¤òÍѤ¤¤¿¥×¥í¥°¥é¥à¤ò¥¹¥¿¥Æ¥£¥Ã¥¯¤Ë¥ê¥ó¥¯¤¹¤ë +¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ Linux ¤Ç¤ÏÌäÂê¤Ê¤¯¥¹¥¿¥Æ¥£¥Ã¥¯¥ê¥ó¥¯¤Ç¤­¤ë¡£ diff --git a/release/man5/passwd.5 b/release/man5/passwd.5 new file mode 100644 index 00000000..0833f9d9 --- /dev/null +++ b/release/man5/passwd.5 @@ -0,0 +1,155 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sun Jul 25 10:46:28 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Aug 21 18:12:27 1994 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Jun 18 01:53:57 1995 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Mon Jan 5 20:24:40 MET 1998 by Michael Haardt +.\" (michael@cantor.informatik.rwth-aachen.de) +.\" +.\" Japanese Version Copyright (c) 1997 Kazuyuki Tanisako +.\" all rights reserved. +.\" Translated 1998-02-10, Kazuyuki Tanisako +.\" Updated 1998-09-23, Kazuyuki Tanisako +.\" Updated 2006-07-19, Akihiro MOTOKI , LDP v2.36 +.\" +.TH PASSWD 5 1998-01-05 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +passwd \- ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë +.SH ÀâÌÀ +.B passwd +¥Õ¥¡¥¤¥ë¤Ï¡¢¤½¤Î¥·¥¹¥Æ¥à¤Î¥¢¥«¥¦¥ó¥È¥ê¥¹¥È¤òÊÝ»ý¤¹¤ë¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +¥¢¥«¥¦¥ó¥ÈËè¤Ë¡¢¥æ¡¼¥¶¡¼ ID¡¢¥°¥ë¡¼¥× ID¡¢¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¡¢ +»ÈÍѤ¹¤ë shell ¥³¥Þ¥ó¥É¤Î¼ïÎà¡¢Åù¤ÎÍ­ÍѤʾðÊó¤òÄ󶡤·¤Æ¤¤¤ë¡£ +¤Þ¤¿¡¢³Æ¥¢¥«¥¦¥ó¥È¤Î°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤òÊÝ»ý¤¹¤ë¾ì¹ç¤â¤¢¤ë¡£ +¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹µö²Ä¤Ï¡¢Á´¥æ¡¼¥¶¡¼¤Ë +Æɤ߽Ф·¤Îµö²Ä¤òÍ¿¤¨ +.RI ( ls (1) +Åù¤Î¿¤¯¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ç¤Ï¥æ¡¼¥¶¡¼ ID ¤ò¥æ¡¼¥¶¡¼Ì¾¤Ë +Âбþ¤µ¤»¤ë¤Î¤Ë +.B passwd +¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ¹¤ë)¡¢ +½ñ¤­¹þ¤ßµö²Ä¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤Ë¤Î¤ßÍ¿¤¨¤ë¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +¸Å¤­Îɤ­»þÂå¤Ë¤Ï¡¢¤³¤ÎÁ´¥æ¡¼¥¶¡¼¤ËÂФ¹¤ëÆɤ߼è¤êµö²Ä¤Ï +ÆÃÊ̤ÊÌäÂê¤òµ¯¤³¤µ¤Ê¤«¤Ã¤¿¡£Ã¯¤Ç¤â°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤ò +Æɤळ¤È¤¬½ÐÍ褿¤¬¡¢¾å¼ê¤ËÁª¤Ð¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤òÇˤë¤Î¤Ë¤Ï +Åö»þ¤Î¥Ï¡¼¥É¥¦¥§¥¢¤Î®Å٤Ϥ¢¤Þ¤ê¤ËÃÙ¤«¤Ã¤¿¤·¡¢¤½¤ì¤Ë²Ã¤¨¤Æ +ͧ¹¥Åª¤Ê¥æ¡¼¥¶¡¼¼Ò²ñ¤Ç¤¢¤ë¤³¤È¤ò´ðËÜŪ¤ÊÁ°Äó¤È¤·¤Æ¤¤¤¿¡£ +ºÇ¶á¤Ç¤Ï¿¤¯¤Î¿Í¤¬¡¢²¿¤é¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Î shadow password suite +(¥·¥ã¥É¥¦¡¦¥Ñ¥¹¥ï¡¼¥Éµ¡Ç½¤ò¼Â¸½¤¹¤ë¤¿¤á¤Î¥×¥í¥°¥é¥à·²) +¤òÆ°¤«¤·¤Æ¤¤¤ë¡£¤½¤Î¾ì¹ç +.I /etc/passwd +¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¥ï¡¼¥ÉÍó¤Ë¤Ï¡¢°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤ÎÂå¤ï¤ê¤Ë +¥¢¥¹¥¿¥ê¥¹¥¯ (*) ¤¬ÀßÄꤵ¤ì¤ë¡£°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ï +.I /etc/shadow +¥Õ¥¡¥¤¥ë¤ËÊÝ»ý¤µ¤ì¤ë¡£ +.I /etc/shadow +¥Õ¥¡¥¤¥ë¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤À¤±¤¬Æɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +shadow password ¤¬»È¤ï¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ë¤Ï¤è¤é¤º¡¢Â¿¤¯¤Î¥·¥¹¥Æ¥à +´ÉÍý¼Ô¤Ï¡¢°Å¹æ²½¥Ñ¥¹¥ï¡¼¥ÉÍó¤Ë¥¢¥¹¥¿¥ê¥¹¥¯¤òÀßÄꤹ¤ë¤³¤È¤Ç¡¢ +¤½¤Î¥æ¡¼¥¶¡¼¤¬¥Ñ¥¹¥ï¡¼¥É¤Ç¤Îǧ¾Ú¤¬¼õ¤±¤é¤ì¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¤¤ë +(²¼µ­¤Î¡ÖÃí°Õ¡×¤Î¹à¤ò»²¾È)¡£ +.PP +¿·¤·¤¤¥æ¡¼¥¶¡¼¤òÅÐÏ¿¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢¥Ñ¥¹¥ï¡¼¥ÉÍó¤Ë¥¢¥¹¥¿¥ê¥¹¥¯¤òÀßÄꤷ¤Æ¤ª¤­ +.BR passwd (1) +¥³¥Þ¥ó¥É¤Ë¤è¤êÀßÄê¤ò¹Ô¤¦¤è¤¦¤Ë¤¹¤ë¡£ +.PP +¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Ï 1 ¹Ô¤´¤È¤Ë 1 ¥¨¥ó¥È¥ê¤ò»ý¤Á¡¢ +³Æ¹Ô¤Î½ñ¼°¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.sp +.RS +account:password:UID:GID:GECOS:directory:shell +.RE +.sp +³ÆÍó¤ÎÀâÌÀ: +.RS +.TP 1.0in +.I account +¤½¤Î¥·¥¹¥Æ¥à¤Ç¤Î¥æ¡¼¥¶¡¼Ì¾¡£Âçʸ»ú¤ò´Þ¤Þ¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£ +.TP +.I password +¥æ¡¼¥¶¡¼¤Î°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¡¢¥¢¥¹¥¿¥ê¥¹¥¯¡¢¤Þ¤¿¤Ïʸ»ú \(aqx\(aq +(\(aqx\(aq ¤ÎÀâÌÀ¤Ë¤Ä¤¤¤Æ¤Ï +.BR pwconv (8) +¤ò»²¾È)¡£ +.TP +.I UID +¥æ¡¼¥¶¡¼ ID Èֹ档 +.TP +.I GID +¥æ¡¼¥¶¡¼¤¬Â°¤¹¤ë¥×¥é¥¤¥Þ¥ê¥°¥ë¡¼¥× ID Èֹ档 +.TP +.I GECOS +ËÜÍó¤Ï¾Êά²Äǽ¤Ç¡¢¾ðÊóÄ󶡤ÎÌÜŪ¤Î¤ß¤Ë»È¤ï¤ì¤ë¡£ +¥æ¡¼¥¶¡¼¤Î¥Õ¥ë¥Í¡¼¥à¤òÀßÄꤹ¤ë¤³¤È¤¬Â¿¤¤¡£GECOS ¤Ï General Electric +Comprehensive Operating System ¤ò°ÕÌ£¤·¤Æ¤ª¤ê¡¢GE ¼Ò¤ÎÂ絬ÌÏ¥·¥¹¥Æ¥àÉôÌç +¤¬ Honeywell ¼Ò¤ËÇäµÑ¤µ¤ì¤¿ºÝ¤Ë GCOS ¤Ø¤ÈÊѹ¹¤µ¤ì¤¿¡£Dennis Ritchie »á¤Ï +¼¡¤Î¤è¤¦¤Ë¸À¤Ã¤Æ¤¤¤ë:¡Ö»þ¡¹¥×¥ê¥ó¥¿½ÐÎϤ䡢 +¥Ð¥Ã¥Á¥¸¥ç¥Ö¤ò GCOS ¥Þ¥·¥ó¤ËÁ÷¤Ã¤¿¤ê¤¹¤ë¤¬¡¢ +¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î gcos Íó¤Ï $IDENT ¥«¡¼¥ÉÍѤξðÊó¤ò +±£¤·¤Æ¤ª¤¯¤¿¤á¤Î¾ì½ê¤Ê¤ó¤À¡£¤Þ¤ë¤Ã¤­¤ê¥¨¥ì¥¬¥ó¥È¤¸¤ã¤Ê¤¤¡£¡× +.TP +.I directory +¥æ¡¼¥¶¡¼¤Î +.B $HOME +¥Ç¥£¥ì¥¯¥È¥ê¡£ +.TP +.I shell +¥í¥°¥¤¥ó»þ¤ËÆ°¤¯¥×¥í¥°¥é¥à̾ (¶õÍó¤Î¾ì¹ç +.I /bin/sh +¤¬»È¤ï¤ì¤ë)¡£ +¸ºß¤·¤Ê¤¤¼Â¹Ô¥×¥í¥°¥é¥à¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +.BR login (1) +¤Ë¤è¤ë¥·¥¹¥Æ¥à¤Ø¤Î¥í¥°¥¤¥ó¤Ï¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +.RE +.SH ¥Õ¥¡¥¤¥ë +.I /etc/passwd +.SH Ãí°Õ +¥æ¡¼¥¶¡¼¥°¥ë¡¼¥×¤òºî¤ê¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢Æ±¤¸¥°¥ë¡¼¥×¤Ë°¤¹¤ë +¥æ¡¼¥¶¡¼¤Î GID ¤ÏƱ¤¸ÃͤȤ·¡¢¤½¤Î GID ¤ò \fI/etc/group\fP ¤ÎÃæ¤Ë +ÄêµÁ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£¤½¤¦¤·¤Ê¤¤¤È¥°¥ë¡¼¥×¤òºî¤Ã¤¿¤³¤È¤Ë¤Ï¤Ê¤é¤Ê¤¤¡£ +.PP +°Å¹æ²½¥Ñ¥¹¥ï¡¼¥É¤È¤·¤Æ¥¢¥¹¥¿¥ê¥¹¥¯¤òÀßÄꤹ¤ë¤È¡¢ +.BR login (1) +¤ò»È¤Ã¤Æ¤Î¥í¥°¥¤¥ó¤¬¤Ç¤­¤Ê¤¯¤Ê¤ë¤¬¡¢ +.BR rlogin (1) +¤Ç¤Ï¤Þ¤À¥í¥°¥¤¥ó¤¬¤Ç¤­¤ë¤·¡¢ +.BR rsh (1), +.BR cron (8), +.BR at (1) +¤ä¥á¥¤¥ë¤Î¥Õ¥£¥ë¥¿Åù¤ò»È¤¤¡¢¸½Â¸¤¹¤ë¥×¥í¥»¥¹¤ò +¼Â¹Ô¤µ¤»¤¿¤ê¡¢¿·¤¿¤Ê¥×¥í¥»¥¹¤òµ¯Æ°¤·¤¿¤ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +»ÈÍѤ¹¤ë shell ¤ÎÍó¤ò¡¢Ã±¤ËÊѹ¹¤¹¤ë¤³¤È¤Ç¥¢¥«¥¦¥ó¥È¤ò +»È¤¨¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Î¤âƱÍͤηë²Ì¤È¤Ê¤ë¡£¤½¤Î¾ì¹ç¤Ë¤Ï¤µ¤é¤Ë +.BR su (1) +¤âÍ­¸ú¤Ê¤Þ¤Þ»Ä¤Ã¤Æ¤·¤Þ¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR login (1), +.BR passwd (1), +.BR su (1), +.BR getpwent (3), +.BR getpwnam (3), +.BR group (5), +.BR shadow (5) diff --git a/release/man5/proc.5 b/release/man5/proc.5 new file mode 100644 index 00000000..120b95ce --- /dev/null +++ b/release/man5/proc.5 @@ -0,0 +1,2694 @@ +.\" 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" +.SH ̾Á° +proc \- ¥×¥í¥»¥¹¤Î¾ðÊó¤ò´Þ¤àµ¼»÷¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.SH ÀâÌÀ +.I proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ïµ¼»÷Ū¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ê¡¢ +¥«¡¼¥Í¥ëÆâ¤Î¥Ç¡¼¥¿¤Ø¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +°ìÈÌŪ¤Ë¤Ï +.I /proc +¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +ÂçÉôʬ¤Î¥Õ¥¡¥¤¥ë¤ÏÆɤ߽Ф·ÀìÍÑ (read-only) ¤Ç¤¢¤ë¤¬¡¢ +¤¤¤¯¤Ä¤«¤Î¥Õ¥¡¥¤¥ë¤Ï½ñ¤­¹þ¤ß²Äǽ¤Ç¤¢¤ê¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤á¤Ð¥«¡¼¥Í¥ë¤ÎÆâÉôÊÑ¿ô¤òÊѹ¹¤Ç¤­¤ë¡£ +.LP +°Ê²¼¤Ï +.I /proc +³¬ÁؤδÊñ¤Ê¤¢¤é¤Þ¤·¤Ç¤¢¤ë¡£ +.PD 1 +.TP +.I /proc/[pid] +¼Â¹ÔÃæ¤Î¥×¥í¥»¥¹¤Ë¤Ä¤¤¤Æ¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¡£ +¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê̾¤Ï (¤½¤Î¥×¥í¥»¥¹¤Î) ¥×¥í¥»¥¹ ID ¤Ç¤¢¤ë¡£ +³Æ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢°Ê²¼¤Îµ¼»÷¥Õ¥¡¥¤¥ë¤È¥Ç¥£¥ì¥¯¥È¥ê¤ò´Þ¤à¡£ +.\" FIXME Describe /proc/[pid]/attr and +.\" /proc/[pid]/task/[tid]/attr +.\" This is a directory +.\" Added in ??? +.\" CONFIG_SECURITY +.\" +.TP +.IR /proc/[number]/auxv " (¥«¡¼¥Í¥ë 2.6.0-test7 °Ê¹ß)" +¼Â¹Ô»þ¤Ë¥×¥í¥»¥¹¤ËÅϤµ¤ì¤¿ 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 +¥×¥í¥»¥¹¤Î´°Á´¤Ê¥³¥Þ¥ó¥É¹Ô¤òÊÝ»ý¤¹¤ë¡£ +¤¿¤À¤·¡¢¤½¤Î¥×¥í¥»¥¹¤¬¥¾¥ó¥Ó¥×¥í¥»¥¹¤Î¾ì¹ç¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¶õ¤È¤Ê¤ë¡£ +.\" Linux 2.3.26 ¤Ç¤Ï¡¢¥×¥í¥»¥¹¤¬¥¹¥ï¥Ã¥×¥¢¥¦¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤â¡¢ +.\" ¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¶õ¤È¤Ê¤Ã¤Æ¤¤¤¿¡£ +¤Ä¤Þ¤ê¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤òÆɤ߽Ф·¤Æ¤â°ìʸ»ú¤âÊÖ¤é¤Ê¤¤¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ç¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤¬¡¢ +¥Ì¥ëʸ»ú¤Ç¶èÀÚ¤é¤ì¤¿Ê¸»úÎó¤È¤·¤Æ½ñ¤«¤ì¤Æ¤ª¤ê¡¢ +ºÇ¸å¤Îʸ»úÎó¤Î¸å¤Ë¥Ì¥ë¥Ð¥¤¥È (\(aq\\0\(aq) ¤¬°ì¤ÄÃÖ¤«¤ì¤ë¡£ +.TP +.IR /proc/[pid]/coredump_filter " (kernel 2.6.23 °Ê¹ß)" +.BR core (5) +»²¾È¡£ +.TP +.IR /proc/[pid]/cpuset " (kernel 2.6.12 °Ê¹ß)" +.\" and/proc/[pid]/task/[tid]/cpuset +.BR cpuset (7) +»²¾È¡£ +.TP +.I /proc/[pid]/cwd +¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¡£ +Î㤨¤Ð¡¢¥×¥í¥»¥¹ 20 ¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤ò¸«¤Ä¤±¤ë¤¿¤á¤Ë¤Ï¡¢ +¼¡¤Î¤è¤¦¤Ë¤¹¤ì¤Ð¤è¤¤¡£ + +.in +4n +.nf +.RB "$" " cd /proc/20/cwd; /bin/pwd" +.fi +.in + +.I pwd +¥³¥Þ¥ó¥É¤Ï¥·¥§¥ë¤ÎÆâÉô¥³¥Þ¥ó¥É¤Î¤³¤È¤¬¤è¤¯¤¢¤ê¡¢ +¤¦¤Þ¤¯Æ°ºî¤·¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.BR bash (1) +¤Ç¤Ï +.I "pwd \-P" +¤ò»È¤Ã¤Æ¤â¤è¤¤¡£ + +.\" °Ê²¼¤ÎÆâÍÆ¤Ï ¥«¡¼¥Í¥ë 2.6.13 ¤Ç¤Ï¤Þ¤ÀÀµ¤·¤¤¡£ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥»¥¹¤Ç¤Ï¡¢¥á¥¤¥ó¥¹¥ì¥Ã¥É¤¬¤¹¤Ç¤Ë½ªÎ»¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +¤³¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ÎÆâÍƤϻ²¾È¤Ç¤­¤Ê¤¤ +(¥¹¥ì¥Ã¥É¤Î½ªÎ»¤ÏÄ̾ï +.BR pthread_exit (3) +¤ò¸Æ¤Ó½Ð¤·¤Ë¤è¤ê¹Ô¤ï¤ì¤ë)¡£ +.TP +.I /proc/[pid]/environ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥×¥í¥»¥¹¤Î´Ä¶­ÊÑ¿ô¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +³Æ¥¨¥ó¥È¥ê¤Ï 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 +Linux 2.2 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¡¢ +¼Â¹Ô²Äǽ¥³¥Þ¥ó¥É¤Î¼ÂºÝ¤Î¥Ñ¥¹Ì¾¤ò³ÊǼ¤·¤Æ¤¤¤ë¡£ +¤³¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ÏÄ̾ï¤Î¤è¤¦¤Ëé¤ë¤³¤È¤¬¤Ç¤­¤ë; +¤³¤ì¤ò¥ª¡¼¥×¥ó¤¹¤ë¤È¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£ +(¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç) +.I /proc/[pid]/exe +¤ÈÆþÎϤ¹¤ë¤È¡¢¥×¥í¥»¥¹ÈÖ¹æ [pid] ¤Ç¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë +¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤ò¤â¤¦°ì¤Ä¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\" °Ê²¼¤ÎÆâÍÆ¤Ï ¥«¡¼¥Í¥ë 2.6.13 ¤Ç¤Ï¤Þ¤ÀÀµ¤·¤¤¡£ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥»¥¹¤Ç¤Ï¡¢¥á¥¤¥ó¥¹¥ì¥Ã¥É¤¬¤¹¤Ç¤Ë½ªÎ»¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +¤³¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ÎÆâÍƤϻ²¾È¤Ç¤­¤Ê¤¤ +(¥¹¥ì¥Ã¥É¤Î½ªÎ»¤ÏÄ̾ï +.BR pthread_exit (3) +¤ò¸Æ¤Ó½Ð¤·¤Ë¤è¤ê¹Ô¤ï¤ì¤ë)¡£ + +Linux 2.0 °ÊÁ°¤Ç¤Ï¡¢ +.I /proc/[pid]/exe +¤Ï¼Â¹Ô¤µ¤ì¤¿¥Ð¥¤¥Ê¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¤è¤¦¤Ë¸«¤¨¤ë¡£ +Linux 2.0 °ÊÁ°¤Ç¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +.BR readlink (2) +¤ò¼Â¹Ô¤¹¤ë¤È¡¢ + + [¥Ç¥Ð¥¤¥¹ÈÖ¹æ]:i¥Î¡¼¥ÉÈÖ¹æ + +¤È¤¤¤¦¥Õ¥©¡¼¥Þ¥Ã¥È¤Îʸ»úÎó¤¬Ê֤롣 + +¤¿¤È¤¨¤Ð¡¢[0301]:1502 ¤Ï¥á¥¸¥ã¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 03 (IDE, MFM ¤Ê¤É¤Î¥É¥é¥¤¥Ö) +¥Þ¥¤¥Ê¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ 01 (ºÇ½é¤Î¥É¥é¥¤¥Ö¤ÎºÇ½é¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó) ¤Î +¥Ç¥Ð¥¤¥¹¾å¤Î i¥Î¡¼¥ÉÈÖ¹æ 1502 ¤Ç¤¢¤ë¡£ + +.I \-inum +¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Æ +.BR find (1) +¤ò»È¤¦¤È¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Î½êºß¤òõ¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.I /proc/[pid]/fd +¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤·¤¿¥Õ¥¡¥¤¥ë³Æ¡¹¤ËÂФ¹¤ë¥¨¥ó¥È¥ê¤ò´Þ¤à¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¡£ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥Õ¥¡¥¤¥ë̾¤Ç¡¢ +¼ÂºÝ¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ 0 ¤Ïɸ½àÆþÎÏ¡¢1 ¤Ïɸ½à½ÐÎÏ¡¢2 ¤Ïɸ½à¥¨¥é¡¼½ÐÎÏ¡¢¤Ê¤É¤È¤Ê¤ë¡£ + +.\" °Ê²¼¤ÎÆâÍÆ¤Ï ¥«¡¼¥Í¥ë 2.6.13 ¤Ç¤Ï¤Þ¤ÀÀµ¤·¤¤¡£ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥»¥¹¤Ç¤Ï¡¢¥á¥¤¥ó¥¹¥ì¥Ã¥É¤¬¤¹¤Ç¤Ë½ªÎ»¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍƤϻ²¾È¤Ç¤­¤Ê¤¤ +(¥¹¥ì¥Ã¥É¤Î½ªÎ»¤ÏÄ̾ï +.BR pthread_exit (3) +¤ò¸Æ¤Ó½Ð¤·¤Ë¤è¤ê¹Ô¤ï¤ì¤ë)¡£ + +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤È¤·¤Æ¥Õ¥¡¥¤¥ë̾¤ò¼õ¤±¼è¤ë¤¬¡¢°ú¤­¿ô¤¬ +ÅϤµ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ëɸ½àÆþÎϤ«¤éÆþÎϤò¼õ¤±¼è¤é¤Ê¤¤¤è¤¦¤Ê¥×¥í¥°¥é¥à¤ä¡¢ +¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤È¤·¤Æ½ñ¤­¹þ¤ß¥Õ¥¡¥¤¥ë¤ò¼õ¤±¼è¤ë¤¬¡¢°ú¤­¿ô¤¬ +ÅϤµ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ëɸ½à½ÐÎϤ˽ÐÎϤò¹Ô¤ï¤Ê¤¤¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¤¢¤Ã¤Æ¤â¡¢ +.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 + +.\" »ä¤Î¥Æ¥¹¥È¤Ç¤Ï¡¢°Ê²¼¤ÏÀµ¤·¤¯¤Ê¤«¤Ã¤¿ (MTK): +.\" ¤¿¤À¤· fd ¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤Ï¥·¡¼¥¯ (seek) ¤Ç¤­¤Ê¤¤¤Î¤Ç¡¢ +.\" ¤³¤ÎÊýË¡¤Ï¥Õ¥¡¥¤¥ë¤ò¥·¡¼¥¯¤¹¤ë¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¡£ + +.I /proc/self/fd/N +¤Ï¡¢¤¢¤ë¼ï¤Î Unix ¤ä Unix É÷¤Î¥·¥¹¥Æ¥à¤Ë¤¢¤ë +.I /dev/fd/N +¤È¤À¤¤¤¿¤¤Æ±¤¸¤Ç¤¢¤ë¡£ +»ö¼Â Linux ¤Î¤¿¤¤¤Æ¤¤¤Î MAKEDEV ¥¹¥¯¥ê¥×¥È¤Ï¡¢ +.I /dev/fd +¤ò +.I /proc/self/fd +¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤·¤Æ¤¤¤ë¡£ + +¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯ +.IR /dev/stdin , +.IR /dev/stdout , +.IR /dev/stderr +¤¬Ä󶡤µ¤ì¤Æ¤ª¤ê¡¢¤½¤ì¤¾¤ì +.I /proc/self/fd +Æâ¤Î¥Õ¥¡¥¤¥ë +.IR 0 , +.IR 1 , +.IR 2 +¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¾å½Ò¤Î¥µ¥ó¥×¥ë¥³¥Þ¥ó¥É¤Ï¼¡¤Î¤è¤¦¤Ë¤â½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë¡£ +.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 +.IR /proc/[pid]/fdinfo/ " (kernel 2.6.22 °Ê¹ß)" +¤³¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ëËè¤Î +¥¨¥ó¥È¥ê¤¬Æþ¤Ã¤Æ¤ª¤ê¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥Õ¥¡¥¤¥ë̾¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +³Æ¥Õ¥¡¥¤¥ë¤ÎÆâÍƤòÆɤ߽Ф¹¤³¤È¤Ç¡¢Âбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë´Ø¤¹¤ë +¾ðÊó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£°Ê²¼¤ËÎã¤ò¼¨¤¹¡£ +.in +4n +.nf + +.RB "$" " cat /proc/12015/fdinfo/4" +pos: 1000 +flags: 01002002 +.fi +.in + +.I pos +¥Õ¥£¡¼¥ë¥É¤Ï 10 ¿Ê¿ô¤Ç¡¢¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ò¼¨¤¹¡£ +.I flags +¥Õ¥£¡¼¥ë¥É¤Ï 8 ¿Ê¿ô¤Ç¡¢ +¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¥â¡¼¥É¤È¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤ò¼¨¤¹ +.RB ( open (2) +»²¾È)¡£ + +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¥×¥í¥»¥¹¤Î½êÍ­¼Ô¤À¤±¤¬Æɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.\" FIXME document /proc/[pid]/io +.\" .TP +.\" .IR /proc/[pid]/io " (since kernel 2.6.20)" +.TP +.IR /proc/[pid]/limits " (kernel 2.6.24 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î³Æ¥ê¥½¡¼¥¹À©¸Â¤Ë¤Ä¤¤¤Æ¡¢ +¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¡¢¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¡¢·×–°Ì¤òɽ¼¨¤¹¤ë +.RB ( getrlimit (2) +»²¾È)¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¥×¥í¥»¥¹¤Î¼Â UID ¤ò»ý¤Ä¤â¤Î¤À¤±¤¬Æɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.I /proc/[pid]/maps +¸½ºß¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ë¥á¥â¥êÎΰè¤È¤½¤Î¥¢¥¯¥»¥¹¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò´Þ¤à¡£ + +¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï°Ê²¼¤Î¤È¤ª¤ê: + +.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 + +¤³¤³¤Ç "address" ¤Ï¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ç¤½¤Î¥á¥â¥êÎΰ褬Àê¤á¤Æ¤¤¤ë +¥¢¥É¥ì¥¹¤Ç¡¢"perms" ¤Ï¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤Î¥»¥Ã¥È¤Ç¤¢¤ë¡£ + +.nf +.in +5 +r = read +w = write +x = execute +s = shared +p = private (copy on write) +.fi +.in + +\&"offset" ¤Ï¥Õ¥¡¥¤¥ë (¤Ê¤É¤Î) Ãæ¤Ç¤Î¥ª¥Õ¥»¥Ã¥È¡¢ +\&"dev" ¤Ï¥Ç¥Ð¥¤¥¹ (¥á¥¸¥ã¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ:¥Þ¥¤¥Ê¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ)¡¢ +\&"inode" ¤Ï¤½¤Î¥Ç¥Ð¥¤¥¹¤Î i ¥Î¡¼¥ÉÈÖ¹æ¤Ç¤¢¤ë¡£ +¤³¤ì¤¬ 0 ¤Î¤È¤­¤Ï¡¢bss (½é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ç¡¼¥¿Îΰè) ¤Î¾ì¹ç¤Î¤è¤¦¤Ë +¤³¤Î¥á¥â¥êÎΰè¤Ë¤Ï¤É¤Î i ¥Î¡¼¥É¤â³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò°ÕÌ£¤·¤Æ¤¤¤ë¡£ + +Linux 2.0 ¤Ç¤Ï¥Ñ¥¹Ì¾¤ò½ñ¤¤¤¿¥Õ¥£¡¼¥ë¥É¤¬¤Ê¤¤¡£ +.TP +.I /proc/[pid]/mem +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢ +.BR open (2), +.BR read (2), +.BR lseek (2) +¤òÄ̤·¤Æ¡¢¥×¥í¥»¥¹¤Î¥á¥â¥ê¤Î¥Ú¡¼¥¸¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +.TP +.IR /proc/[pid]/mountinfo " (Linux 2.6.26 °Ê¹ß)" +.\" This info adapted from Documentation/filesystems/proc.txt +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +°Ê²¼¤Î¤è¤¦¤Ê·Á¼°¤Î¹Ô¤«¤é¹½À®¤µ¤ì¤ë¡£ +.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 +³ç¸ÌÉÕ¤­¤Î¿ô»ú¤Ï¡¢°Ê²¼¤ÎÀâÌÀ¤Î¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.RS 7 +.TP 5 +(1) +¥Þ¥¦¥ó¥È ID: ¥Þ¥¦¥ó¥È¤Î°ì°Õ¤Ê¼±ÊÌ»Ò +.RB ( umount (2) +¤Î¸å¤ÏºÆÍøÍѤµ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤)¡£ +.TP +(2) +parent ID: ¿Æ¥Þ¥¦¥ó¥È¤Î ID +(¥Þ¥¦¥ó¥È¥Ä¥ê¡¼¤ÎºÇ¾å°Ì¤Î¾ì¹ç¤Ï¼«Ê¬¼«¿È¤Î ID ¤È¤Ê¤ë)¡£ +.TP +(3) +major:minor: ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤Î +.I st_dev +¤ÎÃÍ +.RB ( stat (2) +»²¾È)¡£ +.TP +(4) +¥ë¡¼¥È: ¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î¥Þ¥¦¥ó¥È¤Î¥ë¡¼¥È¡£ +.TP +(5) +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È: ¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Î¤½¤Î¥×¥í¥»¥¹¤Î¥ë¡¼¥È¤«¤é¤ÎÁêÂХѥ¹¡£ +.TP +(6) +¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó: ³Æ¥Þ¥¦¥ó¥È¤Î¥ª¥×¥·¥ç¥ó¡£ +.TP +(7) +¥ª¥×¥·¥ç¥ó¥Õ¥£¡¼¥ë¥É: "tag[:value]" ·Á¼°¤Î¥Õ¥£¡¼¥ë¥É¤¬ 0 ¸Ä°Ê¾åʤ֡£ +.TP +(8) +¥»¥Ñ¥ì¡¼¥¿: ¥ª¥×¥·¥ç¥ó¥Õ¥£¡¼¥ë¥É¤Î½ª¤ï¤ê¤ò¼¨¤¹¡£ +.TP +(9) +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¼ïÊÌ: ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î̾Á°¡£ +"type[.subtype]" ¤È¤¤¤¦·Á¼°¤È¤Ê¤ë¡£ +.TP +(10) +¥Þ¥¦¥ó¥È¸µ: ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¸ÇÍ­¤Î¾ðÊ󡣤ʤ¤¾ì¹ç¤Ï "none" ¤È¤Ê¤ë¡£ +.TP +(11) +super options: ¥¹¡¼¥Ñ¡¼¥Ö¥í¥Ã¥¯Ã±°Ì¤Î¥ª¥×¥·¥ç¥ó¡£ +.RE +.IP +²ò¼á¤¹¤ë¦¤Ïǧ¼±¤Ç¤­¤Ê¤¤¥ª¥×¥·¥ç¥ó¥Õ¥£¡¼¥ë¥É¤ÏÁ´¤Æ̵»ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¸½ºß¤Î¤È¤³¤í¡¢¥ª¥×¥·¥ç¥ó¥Õ¥£¡¼¥ë¥É¤È¤·¤Æ¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ë¡£ +.RS 12 +.TP 18 +shared:X +¥Þ¥¦¥ó¥È¤Ï¥Ô¥¢¥°¥ë¡¼¥× (peer group) X ¤Ç¶¦Í­¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +master:X +¥Þ¥¦¥ó¥È¤Ï¥Ô¥¢¥°¥ë¡¼¥× (peer group) X ¤Î¥¹¥ì¡¼¥Ö¤Ç¤¢¤ë¡£ +.TP +propagate_from:X +¥Þ¥¦¥ó¥È¤Ï¥¹¥ì¡¼¥Ö¤Ç¤¢¤ê¡¢¥Ô¥¢¥°¥ë¡¼¥× X (*) ¤«¤é +mount propagation ¤ò¼õ¿®¤¹¤ë¡£ +.TP +unbindable +¥Þ¥¦¥ó¥È¤Ï unbind ¤Ç¤­¤Ê¤¤¡£ +.RE +.IP +(*) X ¤Ï¡¢¥×¥í¥»¥¹¤Î root ¤Çľ¶á¤Î dominant peer group ¤Ç¤¢¤ë¡£ +X ¤¬¥Þ¥¦¥ó¥È¤ÎľÀܤΥޥ¹¥¿¡¼¤Ç¤¢¤ë¾ì¹ç¤ä¡¢ +Ʊ¤¸ root ¤Ë dominant peer group ¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢ +"master:X" ¥Õ¥£¡¼¥ë¥É¤À¤±¤¬Â¸ºß¤·¡¢ +"propagate_from:X" ¥Õ¥£¡¼¥ë¥É¤Ï¸ºß¤·¤Ê¤¤¡£ + +mount propagation ¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥«¡¼¥Í¥ë¥½¡¼¥¹¥Ä¥ê¡¼Æâ¤Î +.I Documentation/filesystems/sharedsubtree.txt +¤ò»²¾È¡£ +.TP +.IR /proc/[pid]/mounts " (Linux 2.4.19 °Ê¹ß)" +¤½¤Î¥×¥í¥»¥¹¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤Ë¸½ºß¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë +Á´¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥ê¥¹¥È¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï +.BR fstab (5) +¤ËºÜ¤Ã¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë 2.6.15 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ò´Æ»ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë (pollable)¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤òÆɤ߽Ф·ÍѤ˥ª¡¼¥×¥ó¤·¤¿¸å¤Ç¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ËÊѹ¹¤¬¤¢¤ë¤È +(¤Ä¤Þ¤ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¤ä¥¢¥ó¥Þ¥¦¥ó¥È¤¬¤¢¤ë¤È)¡¢ +.BR select (2) +¤Ç¤Ï¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÆɤ߽Ф·²Äǽ¤È¤Ê¤ê¡¢ +.BR poll (2) +¤È +.BR epoll_wait (2) +¤Ç¤Ï¤½¤Î¥Õ¥¡¥¤¥ë¤Ï¥¨¥é¡¼¾õÂ֤Ȥ·¤ÆÄÌÃΤµ¤ì¤ë¡£ +.TP +.IR /proc/[pid]/mountstats " (Linux 2.6.17 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤òÄ̤¸¤Æ¡¢¤½¤Î¥×¥í¥»¥¹¤Î̾Á°¶õ´ÖÆâ¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë´Ø¤¹¤ë +³Æ¼ï¾ðÊó (Åý·×¡¢ÀßÄê¾ðÊó) ¤ò»²¾È¤Ç¤­¤ë¡£ +¥Õ¥¡¥¤¥ë¤Î³Æ¹Ô¤Ï°Ê²¼¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤¢¤ë¡£ +.nf + +device /dev/sda7 mounted on /home with fstype ext3 [statistics] +( 1 ) ( 2 ) (3 ) (4) +.fi +.IP +³Æ¹Ô¤Î¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.RS 7 +.TP 5 +(1) +¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¥Ç¥Ð¥¤¥¹Ì¾ +(Âбþ¤¹¤ë¥Ç¥Ð¥¤¥¹¤¬¤Ê¤¤¾ì¹ç¤Ï "nodevice" ¤È¤Ê¤ë)¡£ +.TP +(2) +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Ä¥ê¡¼¤Ë¤ª¤±¤ë¥Ñ¥¹Ì¾¡£ +.TP +(3) +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¼ïÊÌ¡£ +.TP +(4) +ÄɲäÎÅý·×¤äÀßÄê¾ðÊó¡£ +¸½ºß¤Î¤È¤³¤í (Linux 2.6.26 »þÅÀ¤Ç¤Ï)¡¢ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ç¾ðÊó¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¤Î¤Ï NFS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤À¤±¤Ç¤¢¤ë¡£ +.RE +.IP +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥×¥í¥»¥¹¤Î½êÍ­¼Ô¤À¤±¤¬Æɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.IR /proc/[pid]/numa_maps " (Linux 2.6.14 °Ê¹ß)" +.BR numa (7) +¤ò»²¾È¡£ +.TP +.IR /proc/[pid]/oom_adj " (Linux 2.6.11 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¥á¥â¥êÉÔ­ (OOM) ¤Î¾õ¶·²¼¤Ç +¤É¤Î¥×¥í¥»¥¹¤ò»¦¤¹¤Ù¤­¤«¤òÁªÂò¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¥¹¥³¥¢¤ò +Ä´À°¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¡¢¥×¥í¥»¥¹¤Î +.I oom_score +ÃͤΥӥåȥ·¥Õ¥ÈÁàºî¤Ë¡¢¤³¤ÎÃͤò»ÈÍѤ¹¤ë¡£ +¤³¤ÎÃͤȤ·¤ÆÍ­¸ú¤ÊÃÍ¤Ï \-16 ¤«¤é +15 ¤Þ¤Ç¤È¡¢ +ÆÃÊ̤ʰÕÌ£¤ò»ý¤Ä \-17 ¤Ç¤¢¤ë¡£ +\-17 ¤Ï¤½¤Î¥×¥í¥»¥¹¤ËÂФ¹¤ë OOM-killing ¤ò´°Á´¤Ë̵¸ú¤Ë¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +Àµ¤ÎÃͤۤɡ¢¤½¤Î¥×¥í¥»¥¹¤¬ OOM-killer ¤Ë¤è¤ê»¦¤µ¤ì¤ë²ÄǽÀ­¤¬¹â¤¯¤Ê¤ê¡¢ +Éé¤ÎÃͤۤɲÄǽÀ­¤¬Ä㤯¤Ê¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 0 ¤Ç¤¢¤ë¡£ +¿·¤·¤¤¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î +.I oom_adj +¤ÎÀßÄê¤ò·Ñ¾µ¤¹¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤òÊѹ¹¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¥×¥í¥»¥¹¤ÏÆø¢ +.RB ( CAP_SYS_RESOURCE ) +¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.IR /proc/[pid]/oom_score " (Linux 2.6.11 °Ê¹ß)" +.\" See mm/oom_kill.c::badness() in the 2.6.25 sources +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢OOM-killer ¤Î¥×¥í¥»¥¹ÁªÂòÍѤȤ·¤Æ¡¢¥«¡¼¥Í¥ë¤¬ +¤³¤Î¥×¥í¥»¥¹¤ËÂФ·¤ÆÍ¿¤¨¤¿¸½ºß¤Î¥¹¥³¥¢¤òɽ¼¨¤¹¤ë¡£ +¹â¤¤¥¹¥³¥¢¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬ OOM-killer ¤Ë¤è¤êÁªÂò¤µ¤ì¤ë +²ÄǽÀ­¤¬¹â¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¤³¤Î¥¹¥³¥¢¤Î´ðËܤϤ½¤Î¥×¥í¥»¥¹¤¬»ÈÍѤ·¤Æ¤¤¤ë¥á¥â¥êÎ̤Ǥ¢¤ê¡¢ +°Ê²¼¤ÎÍ×°ø¤Ë¤è¤ê²Ã»» (+) ¸º»» (\-) ¤¬¹Ô¤ï¤ì¤ë¡£ +.\" See mm/oom_kill.c::badness() in the 2.6.25 sources +.RS +.IP * 2 +¤½¤Î¥×¥í¥»¥¹¤¬Â¿¤¯¤Î»Ò¥×¥í¥»¥¹¤ò +.BR fork (2) +¤ò»È¤Ã¤ÆºîÀ®¤·¤Æ¤¤¤ë¤« (+)¡£ +.IP * +¤½¤Î¥×¥í¥»¥¹¤¬Ä¹»þ´Ö¼Â¹Ô¤µ¤ì¤ÆÍ褿¤«¡¢¤â¤·¤¯¤Ï +¿¤¯¤Î CPU »þ´Ö¤ò»ÈÍѤ·¤Æ¤¤¤ë¤« (\-)¡£ +.IP * +¤½¤Î¥×¥í¥»¥¹¤¬Ä㤤 nice ÃÍ (> 0) ¤ò»ý¤Ã¤Æ¤¤¤ë¤« (+)¡£ +.IP * +¤½¤Î¥×¥í¥»¥¹¤¬Æø¢¤ò»ý¤Ã¤Æ¤¤¤ë¤« (\-)¡£ +.\" ¤è¤êÀµ³Î¤Ë¤Ï¡¢CAP_SYS_ADMIN ¤« CAP_SYS_RESOURCE ¤ò»ý¤Ã¤Æ¤¤¤ë¤«¡£ +.IP * +¤½¤Î¥×¥í¥»¥¹¤¬ direct hardware access ¤ò¹Ô¤Ã¤Æ¤¤¤ë¤« (\-)¡£ +.\" ¤è¤êÀµ³Î¤Ë¤Ï¡¢CAP_SYS_RAWIO ¤ò»ý¤Ã¤Æ¤¤¤ë¤«¡£ +.RE +.IP +.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 +Unix ¤È Linux ¤Ç¤Ï¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥ë¡¼¥È (/) ¤ò¥×¥í¥»¥¹¤´¤È¤ËÊÌ¡¹¤Ë¤Ç¤­¤ë¡£ +¤³¤ì¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR chroot (2) +¤Ë¤è¤Ã¤ÆÀßÄꤹ¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥×¥í¥»¥¹¤Î¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò»Ø¤¹¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¡¢ +exe ¤ä fd/* ¤Ê¤É¤ÈƱ¤¸¤è¤¦¤ÊÆ°ºî¤ò¤¹¤ë¡£ + +.\" °Ê²¼¤ÎÆâÍÆ¤Ï ¥«¡¼¥Í¥ë 2.6.13 ¤Ç¤Ï¤Þ¤ÀÀµ¤·¤¤¡£ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥»¥¹¤Ç¤Ï¡¢¥á¥¤¥ó¥¹¥ì¥Ã¥É¤¬¤¹¤Ç¤Ë½ªÎ»¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +¤³¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ÎÆâÍƤϻ²¾È¤Ç¤­¤Ê¤¤ +(¥¹¥ì¥Ã¥É¤Î½ªÎ»¤ÏÄ̾ï +.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 +.IR /proc/[pid]/smaps " (Linux 2.6.14 °Ê¹ß)" +.\" CONFIG_PROC_PAGE_MONITOR +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î³Æ¥Þ¥Ã¥Ô¥ó¥°¤Î¥á¥â¥ê¾ÃÈñÎ̤òɽ¼¨¤¹¤ë¡£ +¥Þ¥Ã¥Ô¥ó¥°¤Î¤½¤ì¤¾¤ì¤Ë¤Ä¤¤¤Æ¡¢°Ê²¼¤Î¤è¤¦¤ÊÆâÍƤ¬É½¼¨¤µ¤ì¤ë¡£ +.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 +ºÇ½é¤Î¹Ô¤Ë¤Ï¡¢ +.I /proc/[pid]/maps +¤Çɽ¼¨¤µ¤ì¤ë¥Þ¥Ã¥Ô¥ó¥°¤ÈƱ¤¸¾ðÊó¤¬É½¼¨¤µ¤ì¤ë¡£ +»Ä¤ê¤Î¹Ô¤Ë¤Ï¡¢¥Þ¥Ã¥Ô¥ó¥°¤Î¥µ¥¤¥º¡¢¸½ºß RAM ¾å¤Ë¸ºß¤¹¤ë¥Þ¥Ã¥Ô¥ó¥°¤ÎÎÌ¡¢ +¥Þ¥Ã¥Ô¥ó¥°Æâ¤Î¶¦Í­¥Ú¡¼¥¸¤Î¤¦¤Á¥¯¥ê¡¼¥ó¤Ê¥Ú¡¼¥¸¿ô¡¢¥À¡¼¥Æ¥£¤Ê¥Ú¡¼¥¸¿ô¡¢ +¥Þ¥Ã¥Ô¥ó¥°Æâ¤Î¥×¥é¥¤¥Ù¡¼¥È¥Ú¡¼¥¸¤Î¤¦¤Á¥¯¥ê¡¼¥ó¤Ê¥Ú¡¼¥¸¿ô¡¢ +¥À¡¼¥Æ¥£¤Ê¥Ú¡¼¥¸¿ô¡¢¤ò¼¨¤¹¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¤Î¤Ï¡¢¥«¡¼¥Í¥ë¤Î¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¡¦¥ª¥×¥·¥ç¥ó +.B CONFIG_MMU +¤òÍ­¸ú¤Ë¤·¤¿¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£ +.TP +.I /proc/[pid]/stat +¥×¥í¥»¥¹¤Î¾õÂ֤ˤĤ¤¤Æ¤Î¾ðÊó¡£ +¤³¤ì¤Ï +.BR ps (1) +¤Ç»È¤ï¤ì¡¢ +.I /usr/src/linux/fs/proc/array.c +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +³Æ¥Õ¥£¡¼¥ë¥É¤ò½çÈ֤ˡ¢ +.BR scanf (3) +¤Î¥Õ¥©¡¼¥Þ¥Ã¥È»ØÄê»ÒÉÕ¤­¤Ç°Ê²¼¤Ë¼¨¤¹¡£ +.RS +.TP 12 +\fIpid\fP %d +¥×¥í¥»¥¹ ID¡£ +.TP +\fIcomm\fP %s +³ç¸Ì¤Ç¤¯¤¯¤é¤ì¤¿¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë̾¡£ +¼Â¹Ô·Á¼°¤¬¥¹¥ï¥Ã¥×¥¢¥¦¥È¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ë¤è¤é¤º¡¢¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +\fIstate\fP %c +"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 +¿Æ¥×¥í¥»¥¹¤Î PID¡£ +.TP +\fIpgrp\fP %d +¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥× ID¡£ +.TP +\fIsession\fP %d +¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID¡£ +.TP +\fItty_nr\fP %d +¥×¥í¥»¥¹¤ÎÀ©¸æüËö +(¥Þ¥¤¥Ê¡¼¡¦¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤Ï¥Ó¥Ã¥È 31¡Á20 ¤È 7¡Á0 ¤Ë¤Þ¤¿¤¬¤Ã¤Æ³ÊǼ¤µ¤ì¡¢ +¥á¥¸¥ã¡¼¡¦¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤Ï¥Ó¥Ã¥È 15¡Á8 ¤Ë³ÊǼ¤µ¤ì¤ë)¡£ +.TP +\fItpgid\fP %d +.\" ¤³¤Î¥Õ¥£¡¼¥ë¥É¤«¤é wchan ¤Þ¤Ç¤Ï 0.99.1 ¤ÇÄɲ䵤줿¡£ +¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤Î¥Õ¥©¥¢¥°¥é¥ó¥É¡¦¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Î ID¡£ +.TP +\fIflags\fP %u (Linux 2.6.22 ¤è¤êÁ°¤Ï %lu) +¥×¥í¥»¥¹¤Î¥«¡¼¥Í¥ë¥Õ¥é¥°¥ï¡¼¥É¡£ +¥Ó¥Ã¥È¤Î°ÕÌ£¤Ï¡¢ +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë PF_* ¤ò»²¾È¤¹¤ë¤³¤È¡£ +¾ÜºÙ¤Ï¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë°Í¸¤¹¤ë¡£ +.TP +\fIminflt\fP %lu +¥×¥í¥»¥¹¤¬°ú¤­µ¯¤³¤·¤¿¥Þ¥¤¥Ê¡¼¥Õ¥©¡¼¥ë¥È (minor fault¡¢¥Ç¥£¥¹¥¯¤«¤é +¥á¥â¥ê¥Ú¡¼¥¸¤Ø¤Î¥í¡¼¥É¤òɬÍפȤ·¤Ê¤¤¥Õ¥©¡¼¥ë¥È) ¤Î²ó¿ô¡£ +.TP +.\" field 11 +\fIcminflt\fP %lu +(¤½¤Î¥×¥í¥»¥¹¤¬½ªÎ»¤òÂԤäƤ¤¤ë) +»Ò¥×¥í¥»¥¹¤¬°ú¤­µ¯¤³¤·¤¿¥Þ¥¤¥Ê¡¼¥Õ¥©¡¼¥ë¥È¤Î²ó¿ô¡£ +.TP +\fImajflt\fP %lu +¥×¥í¥»¥¹¤¬°ú¤­µ¯¤³¤·¤¿¥á¥¸¥ã¡¼¥Õ¥©¡¼¥ë¥È (major fault¡¢¥Ç¥£¥¹¥¯¤«¤é +¥á¥â¥ê¥Ú¡¼¥¸¤Ø¤Î¥í¡¼¥É¤òɬÍפȤ¹¤ë¥Õ¥©¡¼¥ë¥È) ¤Î²ó¿ô¡£ +.TP +\fIcmajflt\fP %lu +(¤½¤Î¥×¥í¥»¥¹¤¬½ªÎ»¤òÂԤäƤ¤¤ë) +»Ò¥×¥í¥»¥¹¤¬°ú¤­µ¯¤³¤·¤¿¥á¥¸¥ã¡¼¥Õ¥©¡¼¥ë¥È¤Î²ó¿ô¡£ +.TP +\fIutime\fP %lu +¤³¤Î¥×¥í¥»¥¹¤¬¥æ¡¼¥¶¡¼¥â¡¼¥É¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤¿»þ´Ö¤Î¹ç·×¡£ +clock tick ñ°Ì¤Ç·×¬¤µ¤ì¤ë +.RI ( sysconf(_SC_CLK_TCK) +¤Ç³ä¤Ã¤¿Ãͤ¬É½¼¨¤µ¤ì¤ë)¡£ +¤³¤ÎÃͤˤϥ²¥¹¥È»þ´Ö \fIguest_time\fP (²¾ÁÛ CPU ¤Î¼Â¹Ô¤Ë¾ÃÈñ¤µ¤ì¤¿»þ´Ö) +¤â´Þ¤Þ¤ì¤ë¡£¤³¤ì¤Ï¡¢¥²¥¹¥È»þ´Ö¤Î¥Õ¥£¡¼¥ë¥É¤òǧ¼±¤·¤Ê¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó +¤Ë¤ª¤¤¤Æ¡¢¥²¥¹¥È»þ´Öʬ¤ò·×»»¤ËÆþ¤ì»¤Í¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.TP +\fIstime\fP %lu +¥×¥í¥»¥¹¤Î¥«¡¼¥Í¥ë¥â¡¼¥É¤Ç¤Î¼Â¹Ô»þ´Ö (ñ°Ì jiffies)¡£ +¤³¤Î¥×¥í¥»¥¹¤¬¥«¡¼¥Í¥ë¥â¡¼¥É¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤¿»þ´Ö¤Î¹ç·×¡£ +clock tick ñ°Ì¤Ç·×¬¤µ¤ì¤ë +.RI ( sysconf(_SC_CLK_TCK) +¤Ç³ä¤Ã¤¿Ãͤ¬É½¼¨¤µ¤ì¤ë)¡£ +.TP +\fIcutime\fP %ld +¤³¤Î¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Ç¡¢½ªÎ»ÂÔ¤Á (waited-for) ¤Î¥×¥í¥»¥¹¤¬¡¢ +¥æ¡¼¥¶¥â¡¼¥É¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤¿»þ´Ö¤Î¹ç·×¡£ +clock tick ñ°Ì¤Ç·×¬¤µ¤ì¤ë +.RI ( sysconf(_SC_CLK_TCK) +¤Ç³ä¤Ã¤¿Ãͤ¬É½¼¨¤µ¤ì¤ë)¡£ +.RB ( times (2) +¤â»²¾È¤¹¤ë¤³¤È¡£) +¤³¤ÎÃͤˤϥ²¥¹¥È»þ´Ö \fIcguest_time\fP +(²¾ÁÛ CPU ¤ò¼Â¹Ô¤¹¤ë¤Î¤Ë¾ÃÈñ¤·¤¿»þ´Ö¡¢²¼µ­»²¾È) ¤â´Þ¤Þ¤ì¤ë¡£ +.TP +\fIcstime\fP %ld +¤³¤Î¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Ç¡¢½ªÎ»ÂÔ¤Á (waited-for) ¤Î¥×¥í¥»¥¹¤¬¡¢ +¥«¡¼¥Í¥ë¥â¡¼¥É¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤¿»þ´Ö¤Î¹ç·×¡£ +clock tick ñ°Ì¤Ç·×¬¤µ¤ì¤ë +.RI ( sysconf(_SC_CLK_TCK) +¤Ç³ä¤Ã¤¿Ãͤ¬É½¼¨¤µ¤ì¤ë)¡£ +.TP +\fIpriority\fP %ld +(Linux 2.6 ¤Î¾ì¹ç¤ÎÀâÌÀ) +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥Ý¥ê¥·¡¼ +(²¼µ­¤Î +.I policy ; +.BR sched_setscheduler (2) +»²¾È) ¤ÇÆ°ºî¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Ç¤Ï¡¢ +¤³¤ÎÃͤϥ¹¥±¥¸¥å¡¼¥ê¥ó¥°Í¥ÀèÅÙ¤òȿž¤·¤¿ÃÍ (¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Í¥ÀèÅÙ¤ò +¥Þ¥¤¥Ê¥¹¤Ë¤·¤¿ÃÍ) ¤È¤Ê¤ë¡£ÃÍ¤Ï \-2 ¤«¤é \-100 ¤Þ¤Ç¤ÎÈϰϤοôÃͤǡ¢ +¤½¤ì¤¾¤ì¥ê¥¢¥ë¥¿¥¤¥àÍ¥ÀèÅ٤Π1 ¤«¤é 9 ¤ËÂбþ¤¹¤ë¡£ +¥ê¥¢¥ë¥¿¥¤¥à°Ê³°¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥Ý¥ê¥·¡¼¤ÇÆ°ºî¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Ç¤Ï¡¢ +¤³¤ÎÃͤϥ«¡¼¥Í¥ëÆâ¤Ç´ÉÍý¤µ¤ì¤Æ¤¤¤ë nice Ãͤ½¤Î¤â¤Î +.RB ( setpriority (2)) +¤È¤Ê¤ë¡£ +¥«¡¼¥Í¥ë¤Ï nice Ãͤò 0 (¹â) ¤«¤é 39 (Äã) ¤ÎÈϰϤÎÃͤȤ·¤ÆÊÝ»ý¤·¤Æ¤ª¤ê¡¢ +¤½¤ì¤¾¤ì¥æ¡¼¥¶¤Ë¸«¤¨¤ë nice ÃͤΠ\-20 ¤«¤é 19 ¤ËÂбþ¤¹¤ë¡£ + +Linux 2.6 ¤è¤êÁ°¤Ç¤Ï¡¢¤³¤Î¥×¥í¥»¥¹¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥¹¥±¥¸¥å¡¼¥ê¥ó¥° +½Å¤ß¤òÊÑ´¹¤·¤¿Ãͤ¬É½¼¨¤µ¤ì¤Æ¤¤¤¿¡£ +.\" And back in kernel 1.2 days things were different again. +.TP +\fInice\fP %ld +nice ÃÍ +.RB ( setpriority (2) +»²¾È)¡£ +19 (ºÇÄãÍ¥Àè) ¤«¤é \-20 (ºÇ¹âÍ¥Àè) ¤ÎÈϰϤÎÃͤǤ¢¤ë¡£ +.\" Back in kernel 1.2 days things were different. +.TP +.\" .TP +.\" \fIcounter\fP %ld +.\" ¤³¤Î¥×¥í¥»¥¹¤¬¸½ºß¼Â¹ÔÃæ¤Ç¤¢¤ë¾ì¹ç¡¢ +.\" ¼¡¤Î¥¿¥¤¥à¥¹¥é¥¤¥¹¤Ë¤ª¤±¤ë¸½»þÅÀ¤Ç¤Î¥×¥í¥»¥¹¤ÎºÇÂç»ÈÍÑ»þ´Ö (ñ°Ì jiffies)¡¢ +.\" ¤Þ¤¿¤Ï¸½ºß¤Î¥¿¥¤¥à¥¹¥é¥¤¥¹¤Ë¤ª¤±¤ë»Ä¤ê»þ´Ö¤òɽ¤¹¡£ +.\" .TP +.\" \fItimeout\fP %u +.\" ¥×¥í¥»¥¹¤Î¼¡¤Î¥¿¥¤¥à¥¢¥¦¥È»þ´Ö(ñ°Ì jiffies)¡£ +\fInum_threads\fP %ld +¤³¤Î¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥É¿ô (Linux 2.6 °Ê¹ß)¡£ +¥«¡¼¥Í¥ë 2.6 ¤è¤êÁ°¤Ç¤Ï¡¢¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ïºï½ü¤µ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Î +¾ì½êËä¤á¤È¤·¤Æ 0 ¤Ë¥Ï¡¼¥É¥³¡¼¥É¤µ¤ì¤Æ¤¤¤¿¡£ +.TP +.\" field 21 +\fIitrealvalue\fP %ld +¥¤¥ó¥¿¡¼¥Ð¥ë¥¿¥¤¥Þ¤Ë¤è¤Ã¤Æ¡¢¼¡¤Ë +.B SIGALRM +¤¬¥×¥í¥»¥¹¤ØÁ÷¤é¤ì¤ë¤Þ¤Ç¤Î»þ´Ö (ñ°Ì jiffies)¡£ +¥«¡¼¥Í¥ë 2.6.17 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¥á¥ó¥Æ¥Ê¥ó¥¹¤µ¤ì¤Ê¤¯¤Ê¤ê¡¢ +0 ¤Ë¥Ï¡¼¥É¥³¡¼¥É¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +\fIstarttime\fP %llu (Linux 2.6 ¤è¤êÁ°¤Ï %lu) +¥×¥í¥»¥¹¤Îµ¯Æ°»þ¹ï¡£¥·¥¹¥Æ¥à¤¬µ¯Æ°¤·¤¿»þ¹ï¤¬µ¯ÅÀ (ñ°Ì jiffies)¡£ +.TP +\fIvsize\fP %lu +²¾ÁÛ¥á¥â¥ê¤Î¥µ¥¤¥º¡£Ã±°Ì¤Ï¥Ð¥¤¥È¡£ +.TP +\fIrss\fP %ld +Resident Set Size¡£¥×¥í¥»¥¹¤¬»ý¤Ã¤Æ¤¤¤ë¼Â¥á¥â¥ê¾å¤Î¥Ú¡¼¥¸¿ô¡£ +¤³¤ì¤Ï¤Á¤ç¤¦¤É¥Æ¥­¥¹¥È¡¢¥Ç¡¼¥¿¡¢¥¹¥¿¥Ã¥¯¶õ´Ö¤Ë»È¤ï¤ì¤Æ¤¤¤ë¥Ú¡¼¥¸¿ô¤Ç¤¢¤ë¡£ +¥Ç¥Þ¥ó¥É¥í¡¼¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ú¡¼¥¸¤ä +¥¹¥ï¥Ã¥×¥¢¥¦¥È¤µ¤ì¤¿¥Ú¡¼¥¸¤Î¿ô¤Ï´Þ¤ó¤Ç¤¤¤Ê¤¤¡£ +.TP +\fIrsslim\fP %lu +¤³¤Î¥×¥í¥»¥¹¤Î rss ¤Î¸½ºß¤Î¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È (¥Ð¥¤¥Èñ°Ì)¡£ +.BR getpriority (2) +¤Î +.B RLIMIT_RSS +¤ÎÀâÌÀ¤ò»²¾È¡£ +.TP +\fIstartcode\fP %lu +¥×¥í¥°¥é¥à¥Æ¥­¥¹¥È¤¬¼Â¹Ô²Äǽ¤Ç¤¢¤ë¤è¤¦¤ÊÎΰè¤ÎÀèƬ¥¢¥É¥ì¥¹¡£ +.TP +\fIendcode\fP %lu +¥×¥í¥°¥é¥à¥Æ¥­¥¹¥È¤¬¼Â¹Ô²Äǽ¤Ç¤¢¤ë¤è¤¦¤ÊÎΰè¤ÎËöÈø¥¢¥É¥ì¥¹¡£ +.TP +\fIstartstack\fP %lu +¥¹¥¿¥Ã¥¯¤Î³«»Ï¥¢¥É¥ì¥¹ (¤¹¤Ê¤ï¤Á¡¢¥¹¥¿¥Ã¥¯¤ÎÄì)¡£ +.TP +\fIkstkesp\fP %lu +¸½ºß¤Î ESP (¥¹¥¿¥Ã¥¯¥Ý¥¤¥ó¥¿) ¤ÎÃÍ¡£ +¥×¥í¥»¥¹¤Î¥«¡¼¥Í¥ë¥¹¥¿¥Ã¥¯¥Ú¡¼¥¸¤Ë¤¢¤ë¡£ +.TP +\fIkstkeip\fP %lu +¸½ºß¤Î EIP (¥¤¥ó¥¹¥È¥é¥¯¥·¥ç¥ó¥Ý¥¤¥ó¥¿) ¤ÎÃÍ¡£ +.TP +.\" field 31 +\fIsignal\fP %lu +½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Î¥Ó¥Ã¥È¥Þ¥Ã¥×¡£ +10 ¿Ê¿ô¤Çɽ¼¨¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£ +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +Âå¤ï¤ê¤Ë +.I /proc/[pid]/status +¤ò»È¤¦¤³¤È¡£ +.TP +\fIblocked\fP %lu +¥Ö¥í¥Ã¥¯¤µ¤ì¤¿ (blocked) ¥·¥°¥Ê¥ë¤Î¥Ó¥Ã¥È¥Þ¥Ã¥×¡£ +10 ¿Ê¿ô¤Çɽ¼¨¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£ +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +Âå¤ï¤ê¤Ë +.I /proc/[pid]/status +¤ò»È¤¦¤³¤È¡£ +.TP +\fIsigignore\fP %lu +̵»ë¤µ¤ì¤¿ (ignored) ¥·¥°¥Ê¥ë¤Î¥Ó¥Ã¥È¥Þ¥Ã¥×¡£ +10 ¿Ê¿ô¤Çɽ¼¨¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£ +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +Âå¤ï¤ê¤Ë +.I /proc/[pid]/status +¤ò»È¤¦¤³¤È¡£ +.TP +\fIsigcatch\fP %lu +Ê᪤µ¤ì¤¿ (caught) ¥·¥°¥Ê¥ë¤Î¥Ó¥Ã¥È¥Þ¥Ã¥×¡£ +10 ¿Ê¿ô¤Çɽ¼¨¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£ +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +Âå¤ï¤ê¤Ë +.I /proc/[pid]/status +¤ò»È¤¦¤³¤È¡£ +.TP +\fIwchan\fP %lu +¥×¥í¥»¥¹¤¬ÂԤäƤ¤¤ë¡Ö¥Á¥ã¥Í¥ë¡×¡£ +¤³¤ì¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ê¡¢Ê¸»ú̾¤¬É¬Íפʤé¤Ð +(¥¢¥É¥ì¥¹¤È¥·¥¹¥Æ¥à¥³¡¼¥ë̾¤È¤Î) Âбþɽ¤«¤é¸«¤Ä¤±¤é¤ì¤ë +(¤â¤· +.I /etc/psdatabase +[ÌõÃí: ¤³¤Î¥Õ¥¡¥¤¥ë̾¤Ï¥Ñ¥Ã¥±¡¼¥¸¤Ë¤è¤ë] ¤ò¹¹¿·¤·¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢ +\fIps \-l\fP ¤·¤Æ WCHAN ¥Õ¥£¡¼¥ë¥É¤ò¸«¤è)¡£ +.TP +\fInswap\fP %lu +.\" nswap was added in 2.0 +¥¹¥ï¥Ã¥×¤µ¤ì¤¿¥Ú¡¼¥¸¿ô (¥á¥ó¥Æ¥Ê¥ó¥¹¤µ¤ì¤Æ¤¤¤Ê¤¤)¡£ +.TP +\fIcnswap\fP %lu +.\" cnswap was added in 2.0 +»Ò¥×¥í¥»¥¹¤Î \fInswap\fP ¤ÎÎß·× (¥á¥ó¥Æ¥Ê¥ó¥¹¤µ¤ì¤Æ¤¤¤Ê¤¤)¡£ +.TP +\fIexit_signal\fP %d (Linux 2.1.22 °Ê¹ß) +¥×¥í¥»¥¹¤¬»à¤ó¤À¤È¤­¤Ë¿Æ¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤ë¥·¥°¥Ê¥ë¡£ +.TP +\fIprocessor\fP %d (Linux 2.2.8 °Ê¹ß) +¤³¤Î¥×¥í¥»¥¹¤òºÇ¸å¤Ë¼Â¹Ô¤·¤¿ CPU ¤ÎÈֹ档 +.TP +\fIrt_priority\fP %u (Linux 2.5.19 °Ê¹ß; Linux 2.6.22 ¤è¤êÁ°¤Ï %lu) +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ÎÍ¥ÀèÅÙ¡£ +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥Ý¥ê¥·¡¼¤Î¸µ¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤ë¥×¥í¥»¥¹¤Ç¤Ï +1 ¤«¤é 99 ¤ÎÈϰϤÎÃͤȤʤꡢ +¥ê¥¢¥ë¥¿¥¤¥à°Ê³°¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥Ý¥ê¥·¡¼¤Î¥×¥í¥»¥¹¤Ç¤Ï 0 ¤È¤Ê¤ë +.RB ( sched_setscheduler (2) +»²¾È)¡£ +.TP +.\" field 41 +\fIpolicy\fP %u (Linux 2.5.19 °Ê¹ß; Linux 2.6.22 ¤è¤êÁ°¤Ï %lu) +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ý¥ê¥·¡¼ +.RB ( sched_setscheduler (2) +»²¾È)¡£ +Ãͤϡ¢ +.I linux/sched.h +¤Î SCHED_* Äê¿ô¤ò»È¤Ã¤Æ¥Ç¥³¡¼¥É¤¹¤ì¤Ð¤è¤¤¡£ +.TP +\fIdelayacct_blkio_ticks\fP %llu (Linux 2.6.18 °Ê¹ß) +(clock tick (100ʬ¤Î1ÉÃ) ñ°Ì¤Ç¤Î) ¥Ö¥í¥Ã¥¯ I/O ¤ÎÁíÃÙ±äÎÌ¡£ +.TP +\fIguest_time\fP %lu (Linux 2.6.24 °Ê¹ß) +¥×¥í¥»¥¹¤Î¥²¥¹¥È»þ´Ö (¥²¥¹¥È OS ¤Î²¾ÁÛ CPU ¤ò¼Â¹Ô¤¹¤ë¤Î¤Ë¾ÃÈñ¤µ¤ì¤¿»þ´Ö)¡£ +clock tick ñ°Ì¤Ç·×¬¤µ¤ì¤ë +.RI ( sysconf(_SC_CLK_TCK) +¤Ç³ä¤Ã¤¿Ãͤ¬É½¼¨¤µ¤ì¤ë)¡£ +.TP +\fIcguest_time\fP %ld (Linux 2.6.24 °Ê¹ß) +¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î¥²¥¹¥È»þ´Ö¡£ +clock tick ñ°Ì¤Ç·×¬¤µ¤ì¤ë +.RI ( sysconf(_SC_CLK_TCK) +¤Ç³ä¤Ã¤¿Ãͤ¬É½¼¨¤µ¤ì¤ë)¡£ +.RE +.TP +.I /proc/[pid]/statm +(¥Ú¡¼¥¸Ã±°Ì¤Ç·×¬¤·¤¿) ¥á¥â¥ê»ÈÍÑÎ̤ˤĤ¤¤Æ¤Î¾ðÊó¤òÄ󶡤¹¤ë¡£ +³ÆÎó¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.in +4n +.nf + +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 +.I /proc/[pid]/stat +¤È +.I /proc/[pid]/statm +¤Ë¤¢¤ë¿¤¯¤Î¾ðÊó¤ò¡¢¿Í´Ö¤¬²òÀϤ·¤ä¤¹¤¤·Á¼°¤ÇÄ󶡤¹¤ë¡£ +°Ê²¼¤ËÎã¤ò¼¨¤¹¡£ +.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 +¥Õ¥£¡¼¥ë¥É¤Î¾ÜºÙ¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.RS +.IP * 2 +.IR Name : +¤³¤Î¥×¥í¥»¥¹¤Ë¤è¤ê¼Â¹Ô¤µ¤ì¤¿¥³¥Þ¥ó¥É¡£ +.IP * +.IR State : +¥×¥í¥»¥¹¤Î¸½ºß¤Î¾õÂÖ¡£ +"R (running; ¼Â¹ÔÃæ)", +"S (sleeping; µÙ̲¾õÂÖ)", +"D (disk sleep; ¥Ç¥£¥¹¥¯ÂÔ¤Á¤ÎµÙ̲¾õÂÖ)", +"T (stopped; Ää»ß¾õÂÖ)", +"T (tracing stop; ¥È¥ì¡¼¥¹¤Ë¤è¤ëÄä»ß)", +"Z (zombie; ¥¾¥ó¥Ó¾õÂÖ)", +"X (dead; »àË´)" +¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ +.IP * +.IR Tgid : +¥¹¥ì¥Ã¥É¥°¥ë¡¼¥× ID (¤¹¤Ê¤ï¤Á¡¢¥×¥í¥»¥¹ ID)¡£ +.IP * +.IR Pid : +¥¹¥ì¥Ã¥É ID +.RB ( gettid (2) +»²¾È)¡£ +.IP * +.IR TracerPid : +¤³¤Î¥×¥í¥»¥¹¤ò¥È¥ì¡¼¥¹¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î PID +(¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï 0)¡£ +.IP * +.IR Uid ", " Gid : +¼Â UID/GID¡¢¼Â¸ú UID/GID¡¢Êݸ set-UID/GID¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID/GID¡£ +.IP * +.IR FDSize : +¸½ºß³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥¹¥í¥Ã¥È¿ô¡£ +.IP * +.IR Groups : +Êä½õ¥°¥ë¡¼¥×¤Î¥ê¥¹¥È¡£ +.IP * +.IR VmPeak : +²¾ÁÛ¥á¥â¥ê¥µ¥¤¥º¤Î¥Ô¡¼¥¯ÃÍ¡£ +.IP * +.IR VmSize : +²¾ÁÛ¥á¥â¥ê¥µ¥¤¥º¡£ +.IP * +.IR VmLck : +¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¥á¥â¥ê¥µ¥¤¥º¡£ +.IP * +.IR VmHWM : +¼Â¥á¥â¥ê¾å¤Ë¸ºß¤¹¤ë¥Ú¡¼¥¸¥µ¥¤¥º (resident set size) +¤Î¥Ô¡¼¥¯ÃÍ ("high water mark")¡£ +.IP * +.IR VmRSS : +¼Â¥á¥â¥ê¾å¤Ë¸ºß¤¹¤ë¥Ú¡¼¥¸¥µ¥¤¥º¡£ +.IP * +.IR VmData ", " VmStk ", " VmExe : +¥Ç¡¼¥¿¡¢¥¹¥¿¥Ã¥¯¡¢¥Æ¥­¥¹¥È¥»¥°¥á¥ó¥È¤Î¥µ¥¤¥º¡£ +.IP * +.IR VmLib : +¶¦Í­¥é¥¤¥Ö¥é¥ê¡¦¥³¡¼¥É¤Î¥µ¥¤¥º¡£ +.IP * +.IR VmPTE : +¥Ú¡¼¥¸¡¦¥Æ¡¼¥Ö¥ë¡¦¥¨¥ó¥È¥ê¤Î¥µ¥¤¥º (Linux 2.6.10 °Ê¹ß)¡£ +.IP * +.IR Threads : +¤³¤Î¥¹¥ì¥Ã¥É¤¬Â°¤¹¤ë¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥É¿ô¡£ +.IP * +.IR SigPnd ", " ShdPnd : +¥¹¥ì¥Ã¥É°¸¤ª¤è¤Ó¥×¥í¥»¥¹Á´Âΰ¸¤Î½èÍýÂÔ¤Á¥·¥°¥Ê¥ë¤Î¿ô +.RB ( pthreads (7), +.BR signal (7) +»²¾È)¡£ +.IP * +.IR SigBlk ", " SigIgn ", " SigCgt : +¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¥·¥°¥Ê¥ë¡¢Ìµ»ë¤µ¤ì¤ë¥·¥°¥Ê¥ë¡¢ÊáªÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤ò +¼¨¤¹¥Þ¥¹¥¯ÃÍ +.RB ( signal (7))¡£ +.IP * +.IR CapInh ", " CapPrm ", " CapEff : +·Ñ¾µ²Äǽ (inheritable)¡¢µö²Ä (permitted)¡¢¼Â¸ú (effective) +¤Î³Æ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÇÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥Þ¥¹¥¯ÃÍ +.RB ( capabilities (7) +»²¾È)¡£ +.IP * +.IR CapBnd : +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È +(¥«¡¼¥Í¥ë 2.6.26 °Ê¹ß¡¢ +.BR capabilities (7) +»²¾È)¡£ +.IP * +.IR Cpus_allowed : +¤³¤Î¥×¥í¥»¥¹¤¬¼Â¹Ô¤òµö²Ä¤µ¤ì¤Æ¤¤¤ë CPU ¤Î¥Þ¥¹¥¯ÃÍ +(Linux 2.6.24 °Ê¹ß¡¢ +.BR cpuset (7) +»²¾È)¡£ +.IP * +.IR Cpus_allowed_list : +Á°¹à¤ÈƱ¤¸¤À¤¬¡¢¡Ö¥ê¥¹¥È·Á¼°¡×¤Ç¤Îɽ¼¨ +(Linux 2.6.26 °Ê¹ß¡¢ +.BR cpuset (7) +»²¾È)¡£ +.IP * +.IR Mems_allowed : +¤³¤Î¥×¥í¥»¥¹¤¬»ÈÍѤǤ­¤ë¥á¥â¥ê¥Î¡¼¥É¤Î¥Þ¥¹¥¯ÃÍ +(Linux 2.6.24 °Ê¹ß¡¢ +.BR cpuset (7) +»²¾È)¡£ +.IP * +.IR Mems_allowed_list : +Á°¹à¤ÈƱ¤¸¤À¤¬¡¢¡Ö¥ê¥¹¥È·Á¼°¡×¤Ç¤Îɽ¼¨ +(Linux 2.6.26 °Ê¹ß¡¢ +.BR cpuset (7) +»²¾È)¡£ +.IP * +.IR voluntary_context_switches ", " nonvoluntary_context_switches : +¼«È¯Åª/Èó¼«È¯Åª¤Ê¥³¥ó¥Æ¥­¥¹¥È¥¹¥¤¥Ã¥Á¤Î²ó¿ô +(Linux 2.6.23 °Ê¹ß)¡£ +.RE +.TP +.IR /proc/[pid]/task " (Linux 2.6.0-test6 °Ê¹ß)" +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥É¾ðÊó¤ò´Þ¤à +¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬ 1 ¥¹¥ì¥Ã¥É¤Ë¤Ä¤­ 1 ¤ÄÃÖ¤«¤ì¤ë¡£ +³Æ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Î̾Á°¤Ï¥¹¥ì¥Ã¥É¤Î¥¹¥ì¥Ã¥É ID +.RI ( [tid] ) +¤ò¼¨¤¹¿ô»ú¤Ç¤¢¤ë +.BR ( gettid (2) +¤ò»²¾È)¡£ +¤³¤ì¤é¤Î³Æ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢ +.I /proc/[pid] +¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤ÈƱ¤¸Ì¾Á°¤ÈÆâÍƤΥե¡¥¤¥ë·²¤¬¤¢¤ë¡£ +¤¹¤Ù¤Æ¤Î¥¹¥ì¥Ã¥É¤Ç¶¦Í­¤µ¤ì¤ë°À­¤Î¾ì¹ç¡¢ +.I task/[tid] +¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î³Æ¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤Ï +¿Æ¥Ç¥£¥ì¥¯¥È¥ê +.I /proc/[pid] +¤ÎÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¤ÈƱ¤¸¤Ë¤Ê¤ë¤³¤È¤À¤í¤¦ +(Î㤨¤Ð¡¢¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¡¦¥×¥í¥»¥¹¤Ç¤Ï¥Õ¥¡¥¤¥ë +.I task/[tid]/cwd +¤Ï¤¤¤º¤ì¤â¿Æ¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î +.I /proc/[pid]/cwd +¤ÈƱ¤¸Ãͤò»ý¤Ä¤³¤È¤Ë¤Ê¤ë¡£¤Ê¤¼¤Ê¤é¡¢°ì¤Ä¤Î¥×¥í¥»¥¹¤Ë°¤¹¤¹¤Ù¤Æ¤Î +¥¹¥ì¥Ã¥É¤Ïºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò¶¦Í­¤¹¤ë¤«¤é¤Ç¤¢¤ë)¡£ +¥¹¥ì¥Ã¥ÉËè¤ËÆÈΩ¤Ê°À­¤Î¾ì¹ç¡¢ +.I task/[tid] +¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î³Æ¥Õ¥¡¥¤¥ë¤Ï°Û¤Ê¤ëÃͤò»ý¤Ä¤³¤È¤¬¤¢¤ë +(Î㤨¤Ð¡¢¥Õ¥¡¥¤¥ë +.I task/[tid]/status +¤Ï¥¹¥ì¥Ã¥ÉËè¤Ë°Û¤Ê¤ëÃͤò»ý¤Ä²ÄǽÀ­¤¬¤¢¤ë)¡£ + +.\" °Ê²¼¤ÎÆâÍÆ¤Ï ¥«¡¼¥Í¥ë 2.6.13 ¤Ç¤Ï¤Þ¤ÀÀµ¤·¤¤¡£ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥»¥¹¤Ç¤Ï¡¢¥á¥¤¥ó¥¹¥ì¥Ã¥É¤¬¤¹¤Ç¤Ë½ªÎ»¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.I /proc/[pid]/task +¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍƤϻ²¾È¤Ç¤­¤Ê¤¤ +(¥¹¥ì¥Ã¥É¤Î½ªÎ»¤ÏÄ̾ï +.BR pthread_exit (3) +¤ò¸Æ¤Ó½Ð¤·¤Ë¤è¤ê¹Ô¤ï¤ì¤ë)¡£ +.TP +.I /proc/apm +Advanced Power Management ¤Î¥Ð¡¼¥¸¥ç¥ó¤È¥Ð¥Ã¥Æ¥ê¾ðÊó¡£ +¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_APM +¤òÄêµÁ¤·¤¿¤È¤­¤Ë¸ºß¤¹¤ë¡£ +.TP +.I /proc/bus +¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë³Æ¥Ð¥¹ÍѤ˥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ë¡£ +.TP +.I /proc/bus/pccard +PCMCIA ¥Ç¥Ð¥¤¥¹¤Î¾ðÊ󤬽ñ¤«¤ì¤ë¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¡£ +¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_PCMCIA +¤òÄêµÁ¤·¤¿¤È¤­¤Ë¸ºß¤¹¤ë¡£ +.TP +.I /proc/bus/pccard/drivers +.TP +.I /proc/bus/pci +¤¤¤¯¤Ä¤«¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ê¡¢ +PCI ¥Ð¥¹¡¦¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ç¥Ð¥¤¥¹¡¦ +¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Î¾ðÊ󤬽ñ¤«¤ì¤¿²¾ÁÛ¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î¤¦¤Á¤¤¤¯¤Ä¤«¤Ï ASCII ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£ +.TP +.I /proc/bus/pci/devices +PCI ¥Ç¥Ð¥¤¥¹¤Î¾ðÊó¡£ +.BR lspci (8) +¤ä +.BR setpci (8) +¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.I /proc/cmdline +¥Ö¡¼¥È»þ¤Ë Linux ¥«¡¼¥Í¥ë¤ËÅϤµ¤ì¤¿°ú¤­¿ô¡£ +°ú¤­¿ô¤Î¼õ¤±ÅϤ·¤Ï¡¢¤¿¤¤¤Æ¤¤ +.BR lilo (8) +¤ä +.BR grub (8) +¤È¤¤¤Ã¤¿¥Ö¡¼¥È¥Þ¥Í¡¼¥¸¥ã¤ò»È¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +.TP +.IR /proc/config.gz " (Linux 2.6 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ç¤Ï¡¢¸½ºß¼Â¹ÔÃæ¤Î¥«¡¼¥Í¥ë¤Î¹½ÃÛ»þ¤Ë»ÈÍѤµ¤ì¤¿ +ÀßÄꥪ¥×¥·¥ç¥ó¤ò»²¾È¤Ç¤­¤ë¡£ +½ñ¼°¤Ï¡¢ +.RI ( "make xconfig" , +.IR "make config" +¤Ê¤É¤ò»È¤Ã¤Æ) ¥«¡¼¥Í¥ë¤ÎÀßÄê¤òÊѹ¹¤·¤¿ºÝ¤ËÀ¸À®¤µ¤ì¤ë +.I .config +¥Õ¥¡¥¤¥ë¤Î¤â¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +¥Õ¥¡¥¤¥ë¤ÎÆâÍƤϰµ½Ì¤µ¤ì¤Æ¤ª¤ê¡¢ +.BR zcat (1), +.BR zgrep (1) +¤Ê¤É¤ò»È¤¦¤È¡¢É½¼¨¤ä¸¡º÷¤¬¤Ç¤­¤ë¡£ +¥Õ¥¡¥¤¥ë¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤Ê¤¤¸Â¤ê¡¢ +.I /proc/config.gz +¤ÎÆâÍƤϼ¡¤Î¥³¥Þ¥ó¥É¤ÇÆÀ¤é¤ì¤ëÆâÍƤÈƱ¤¸¤Ç¤¢¤ë¡£ +.in +4n +.nf + +cat /lib/modules/$(uname -r)/build/.config +.fi +.in +.IP +.I /proc/config.gz +¤¬Ä󶡤µ¤ì¤ë¤Î¤Ï¡¢¥«¡¼¥Í¥ë¤ÎÀßÄê¤Ç +.B CONFIG_IKCONFIG_PROC +¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Î¤ß¤Ç¤¢¤ë¡£ +.TP +.I /proc/cpuinfo +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢CPU ¤ª¤è¤Ó¥·¥¹¥Æ¥à¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë°Í¸¤¹¤ë¹àÌܤò +½¸¤á¤¿¤â¤Î¤Ç¡¢¥ê¥¹¥È¤ÎÆâÍƤϥµ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥¢¡¼¥­¥Æ¥¯¥Á¥ãËè¤Ë°Û¤Ê¤ë¡£ +2 ¤Ä¤À¤±¶¦Ä̤ιàÌܤ¬¤¢¤ë¡£ +\fIprocessor\fP ¤Ï¥×¥í¥»¥Ã¥µÈÖ¹æ¤Ç¡¢ +\fIbogomips\fP ¤Ï¥«¡¼¥Í¥ë¤Î½é´ü²½»þ¤Ë·×»»¤µ¤ì¤ë¥·¥¹¥Æ¥àÄê¿ô¤Ç¤¢¤ë¡£ +SMP ¥Þ¥·¥ó¤Ç¤Ï³Æ CPU ¤Ë¤Ä¤¤¤Æ¤Î¾ðÊ󤬽ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.I /proc/devices +¥á¥¸¥ã¡¼¥Ç¥Ð¥¤¥¹ÈÖ¹æ¤È¥Ç¥Ð¥¤¥¹¥°¥ë¡¼¥×¤Î¥Æ¥­¥¹¥È·Á¼°¤Î¥ê¥¹¥È¡£ +MAKEDEV ¥¹¥¯¥ê¥×¥È¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ¡¢ +¥«¡¼¥Í¥ë¤È¤ÎÀ°¹çÀ­¤òÊݤĤ³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.IR /proc/diskstats " (Linux 2.5.69 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï³Æ¥Ç¥£¥¹¥¯¥Ç¥Ð¥¤¥¹¤Î¥Ç¥£¥¹¥¯ I/O Åý·×¾ðÊ󤬽ñ¤«¤ì¤Æ¤¤¤ë¡£ +¹¹¤Ë¾Ü¤·¤¤¾ðÊó¤Ï¡¢¥«¡¼¥Í¥ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë +.I Documentation/iostats.txt +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.I /proc/dma +ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë \fIISA\fP DMA (direct memory access) ¥Á¥ã¥Í¥ë¤Î¥ê¥¹¥È¡£ +.TP +.I /proc/driver +¶õ¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¡£ +.TP +.I /proc/execdomains +¼Â¹Ô¥É¥á¥¤¥ó¤Î¥ê¥¹¥È (ABI ¥Ñ¡¼¥½¥Ê¥ê¥Æ¥£)¡£ +.TP +.I /proc/fb +¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_FB +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥Õ¥ì¡¼¥à¥Ð¥Ã¥Õ¥¡¤Î¾ðÊ󤬽ñ¤«¤ì¤ë¡£ +.TP +.I /proc/filesystems +¥«¡¼¥Í¥ë¤¬Âбþ¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Æ¥­¥¹¥È·Á¼°¤Î¥ê¥¹¥È¡£ +¥«¡¼¥Í¥ë¤ËÁȤ߹þ¤Þ¤ì¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¡¢ +¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤¬¸½ºß¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬Îóµó¤µ¤ì¤ë +.RB ( filesystems (5) +»²¾È)¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë "nodev" ¤È¤¤¤¦°õ¤¬ÉÕ¤¤¤Æ¤¤¤ë¾ì¹ç¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Þ¥¦¥ó¥È¤¹¤ë¤¿¤á¤Î¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤ò +ɬÍפȤ·¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë (Î㤨¤Ð¡¢ +²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ê¤É)¡£ + +¤Á¤Ê¤ß¤Ë¡¢¥Þ¥¦¥ó¥È»þ¤Ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬»ØÄꤵ¤ì¤º¡¢ +¤É¤¦¤ä¤Ã¤Æ¤â¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¼ïÎà¤òȽÄê¤Ç¤­¤Ê¤«¤Ã¤¿ºÝ¤Ë¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë¤ò +.BR mount (8) +¤¬»ÈÍѤ¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤½¤Î¾ì¹ç¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬»î¤µ¤ì¤ë +(¤¿¤À¤·¡¢"nodev" ¤Î°õ¤¬¤Ä¤¤¤¿¤â¤Î¤Ï½ü¤¯)¡£ +.TP +.I /proc/fs +¶õ¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¡£ +.TP +.I /proc/ide +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï IDE ¥Ð¥¹¤ò¤â¤Ä¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +³Æ IDE ¥Á¥ã¥Í¥ë¤È¤½¤ì¤Ë¼è¤êÉÕ¤±¤é¤ì¤Æ¤¤¤ë³Æ¥Ç¥Ð¥¤¥¹¤´¤È¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ê¡¢ +°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ + +.in +4n +.nf +cache ¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º (KB) +capacity ¥»¥¯¥¿¿ô +driver ¥É¥é¥¤¥Ð¤Î¥Ð¡¼¥¸¥ç¥ó +geometry ʪÍý¥¸¥ª¥á¥È¥ê¤ÈÏÀÍý¥¸¥ª¥á¥È¥ê +identify 16 ¿Ê¿ôɽµ­ +media ¥á¥Ç¥£¥¢¤Î¥¿¥¤¥× +model À½Â¤¼Ô¤Î¥â¥Ç¥ëÈÖ¹æ +settings ¥É¥é¥¤¥Ö¤ÎÀßÄê +smart_thresholds 16 ¿Ê¿ôɽµ­ +smart_values 16 ¿Ê¿ôɽµ­ +.fi +.in + +.BR hdparm (8) +¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ï¡¢Ê¬¤«¤ê¤ä¤¹¤¤·Á¼°¤Ç +¤³¤Î¾ðÊó¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î¼êÃʤòÄ󶡤¹¤ë¡£ +.TP +.I /proc/interrupts +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 +Linux 2.4 ¤Ë¤ª¤±¤ë I/O ¥á¥â¥ê¥Þ¥Ã¥×¡£ +.TP +.I /proc/ioports +¸½ºßÅÐÏ¿¤µ¤ì»È¤ï¤ì¤Æ¤¤¤ë I/O ¥Ý¡¼¥ÈÎΰè¤Î¥ê¥¹¥È¡£ +.TP +.IR /proc/kallsyms " (Linux 2.5.71 °Ê¹ß)" +¥«¡¼¥Í¥ë¤Î³°Éô¥·¥ó¥Ü¥ëÄêµÁ¤òÊÝ»ý¤¹¤ë¡£ +.BR modules (X) +´Ø·¸¤Î¥Ä¡¼¥ë¤¬¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤òưŪ¤Ë¥ê¥ó¥¯¤·¤¿¤ê +¥Ð¥¤¥ó¥É (bind) ¤¹¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£ +Linux 2.5.47 °ÊÁ°¤Ç¤Ï¡¢Èù̯¤Ë°Û¤Ê¤ë½ñ¼°¤Î»÷¤¿¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¤¬ +.I ksyms +¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤Ã¤¿¡£ +.TP +.I /proc/kcore +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥·¥¹¥Æ¥à¤ÎʪÍý¥á¥â¥ê¤òɽ¸½¤·¤Æ¤ª¤ê¡¢ +ELF ¥³¥¢¥Õ¥¡¥¤¥ë·Á¼° (core file format) ¤ÇÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Îµ¼»÷¥Õ¥¡¥¤¥ë¤È strip ¤µ¤ì¤Æ¤¤¤Ê¤¤¥«¡¼¥Í¥ë¤Î¥Ð¥¤¥Ê¥ê +.RI ( /usr/src/linux/vmlinux ) +[ÌõÃí: ¥Ñ¥Ã¥±¡¼¥¸¤Ë°Í¸¤¹¤ë]) ¤¬¤¢¤ì¤Ð¡¢ +GDB ¤Ï¥«¡¼¥Í¥ëÆâ¤ÎǤ°Õ¤Î¥Ç¡¼¥¿¹½Â¤¤Î¸½ºß¤Î¾õÂÖ¤òÄ´¤Ù¤é¤ì¤ë¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÂ礭¤µ¤ÏʪÍý¥á¥â¥ê (RAM) ¤Î¥µ¥¤¥º¤Ë 4KB ¤ò²Ã¤¨¤¿ÃͤǤ¢¤ë¡£ +.TP +.I /proc/kmsg +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï +.BR syslog (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¥«¡¼¥Í¥ë¥á¥Ã¥»¡¼¥¸¤òÆɤ߽Ф¹Âå¤ê¤Ë»È¤¨¤ë¡£ +¥×¥í¥»¥¹¤¬¤³¤Î¥Õ¥¡¥¤¥ë¤òÆɤि¤á¤Ë¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¸¢¸Â¤¬É¬ÍפǤ¢¤ê¡¢ +¥Õ¥¡¥¤¥ë¤òÆɤ߽Ф¹¤Î¤Ï 1 ¤Ä¤Î¥×¥í¥»¥¹¤Î¤ß¤Ë¸Â¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë¥á¥Ã¥»¡¼¥¸¤òµ­Ï¿¤¹¤ë¤¿¤á¤Ë¡¢ +.BR syslog (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Îµ¡Ç½¤ò»È¤¦ syslog ¥×¥í¥»¥¹¤¬²ÔƯ¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë¤òÆɤ߽Ф¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÃæ¤Î¾ðÊó¤Ï +.BR dmesg (1) +¤Ë¤è¤Ã¤Æɽ¼¨¤µ¤ì¤ë¡£ +.TP +.IR /proc/ksyms " (Linux 1.1.23-2.5.47)" +.I /proc/kallsyms +¤ò»²¾È¡£ +.TP +.I /proc/loadavg +¤³¤Î¥Õ¥¡¥¤¥ë¤ÎºÇ½é¤Î 3 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤Ï¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤Î¿ôÃͤǡ¢ +1, 5, 15 ʬ¤¢¤¿¤ê¤Î¼Â¹Ô¥­¥å¡¼Æâ (state R) ¤Þ¤¿¤Ï +¥Ç¥£¥¹¥¯ I/O ÂÔ¤Á (state D) ¤Î¥¸¥ç¥Ö¿ô¤òÍ¿¤¨¤ë¡£ +¤³¤ì¤Ï +.BR uptime (1) +¤Ê¤É¤Î¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤ëÃͤÈƱ¤¸¤Ç¤¢¤ë¡£ +4 ÈÖÌܤΥե£¡¼¥ë¥É¤Ï¥¹¥é¥Ã¥·¥å (/) ¤Ç¶èÀÚ¤é¤ì¤¿ 2 ¤Ä¤Î¿ôÃͤ«¤é¹½À®¤µ¤ì¤ë¡£ +¤³¤Î¿ôÃͤΤ¦¤ÁºÇ½é¤Î¤â¤Î¤Ï¡¢¸½ºß¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë +¥«¡¼¥Í¥ë¥¹¥±¥¸¥å¡¼¥ë¥¨¥ó¥Æ¥£¥Æ¥£ (¥×¥í¥»¥¹¡¢¥¹¥ì¥Ã¥É) ¤Î¿ô¤Ç¤¢¤ë¡£ +¤³¤Î¿ôÃÍ¤Ï CPU ¤Î¿ô°Ê²¼¤Ë¤Ê¤ë¡£ +¥¹¥é¥Ã¥·¥å¤Î¸å¤Î¿ôÃͤϡ¢¸½ºß¥·¥¹¥Æ¥à¾å¤Ë¸ºß¤¹¤ë +¥«¡¼¥Í¥ë¥¹¥±¥¸¥å¡¼¥ë¥¨¥ó¥Æ¥£¥Æ¥£¤Î¿ô¤Ç¤¢¤ë¡£ +5 ÈÖÌܤΥե£¡¼¥ë¥É¤Ï¥·¥¹¥Æ¥à¾å¤ËºÇ¤âºÇ¶áÀ¸À®¤µ¤ì¤¿¥×¥í¥»¥¹¤Î PID ¤Ç¤¢¤ë¡£ +.TP +.I /proc/locks +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¸½ºß¤Î¥Õ¥¡¥¤¥ë¥í¥Ã¥¯ +.RB ( flock "(2) ¤È " fcntl (2)) +¤È¥ê¡¼¥¹ +.RB ( fcntl (2)) +¤òɽ¼¨¤¹¤ë¡£ +.TP +.IR /proc/malloc " (Linux 2.2 °ÊÁ°¤Î¤ß)" +.\" It looks like this only ever did something back in 1.0 days +¥³¥ó¥Ñ¥¤¥ë¤Î¤È¤­¤Ë +.B CONFIGDEBUGMALLOC +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Î¤ß¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¸ºß¤¹¤ë¡£ +.TP +.I /proc/meminfo +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥·¥¹¥Æ¥à¾å¤Î¥á¥â¥ê»ÈÍÑÎ̤˴ؤ¹¤ëÅý·×¾ðÊó¤òɽ¼¨¤¹¤ë¡£ +.BR free (1) +¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¡¢ +¥·¥¹¥Æ¥à¤Î̤»ÈÍѤª¤è¤Ó»ÈÍÑÃæ¤Î¥á¥â¥êÎÌ (ʪÍý¥á¥â¥ê¤È¥¹¥ï¥Ã¥×) ¤È¡¢ +¥«¡¼¥Í¥ë¤Ë»È¤ï¤ì¤Æ¤¤¤ë¶¦Í­¥á¥â¥ê¤È¥Ð¥Ã¥Õ¥¡¤Î¾ðÊó¤òÊó¹ð¤¹¤ë¡£ +.TP +.I /proc/modules +¸½ºß¥·¥¹¥Æ¥à¤Ë¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥â¥¸¥å¡¼¥ë¤Î¥Æ¥­¥¹¥È·Á¼°¤Î¥ê¥¹¥È¡£ +.BR lsmod (8) +¤â»²¾È¡£ +.TP +.I /proc/mounts +¥«¡¼¥Í¥ë 2.4.19 ¤è¤êÁ°¤Ç¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¸½ºß¥·¥¹¥Æ¥à¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥ê¥¹¥È¤Ç¤¢¤Ã¤¿¡£ +Linux 2.4.19 ¤Ç¥×¥í¥»¥¹Ã±°Ì¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤¬Æ³Æþ¤µ¤ì¤¿¤³¤È¤Ëȼ¤¤¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï +.I /proc/self/mounts +¤Ø¤Î¥ê¥ó¥¯¤È¤Ê¤Ã¤¿¡£ +.I /proc/self/mounts +¤Ï¤½¤Î¥×¥í¥»¥¹¼«¿È¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Î¥ê¥¹¥È¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï +.BR fstab (5) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /proc/mtrr +Memory Type Range Registers¡£ +¾ÜºÙ¤Ï¡¢¥«¡¼¥Í¥ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë +.I Documentation/mtrr.txt +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.I /proc/net +¤µ¤Þ¤¶¤Þ¤Ê¥Í¥Ã¥È¥ï¡¼¥¯¤Ë¤Ä¤¤¤Æ¤Îµ¼»÷¥Õ¥¡¥¤¥ë¤Ç¡¢ +¤½¤ì¤¾¤ì¤¬¥Í¥Ã¥È¥ï¡¼¥¯ÁؤγƼï¤Î¾õÂÖ¤òÍ¿¤¨¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤Ï ASCII ·Á¼°¤Ê¤Î¤Ç¡¢ +.BR cat (1) +¤ÇÆɤ߽Ф»¤ë¡£ +¤È¤Ï¤¤¤¨´ðËÜ¥³¥Þ¥ó¥É¤Î +.BR netstat (8) +¤Ï¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍƤΤè¤ê¤¹¤Ã¤­¤ê¤È¤·¤¿É½¼¨¤òÄ󶡤¹¤ë¡£ +.TP +.I /proc/net/arp +¥¢¥É¥ì¥¹²ò·è¤Ë»È¤ï¤ì¤ë¥«¡¼¥Í¥ë¤Î 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 + +¤³¤³¤Ç IP address ¤Ï¥Þ¥·¥ó¤Î IPv4 ¥¢¥É¥ì¥¹¡¢ +HW type ¤Ï¤½¤Î¥¢¥É¥ì¥¹¤Î RFC\ 826 ¤ÇÄê¤á¤é¤ì¤Æ¤¤¤ë¥Ï¡¼¥É¥¦¥§¥¢¤Î·Á¼°¡¢ +Flags ¤Ï ARP ¹½Â¤ÂÎ +.RI ( /usr/include/linux/if_arp.h +Æâ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë) ¤ÎÆâÉô¥Õ¥é¥°¡¢ +HW address ¤Ï¤½¤Î IP ¥¢¥É¥ì¥¹¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ë¥Ç¡¼¥¿¥ê¥ó¥¯ÁؤΥ¢¥É¥ì¥¹ +(¤â¤·¤ï¤«¤Ã¤Æ¤¤¤ì¤Ð) ¤Ç¤¢¤ë¡£ +.TP +.I /proc/net/dev +µ¼»÷¥Õ¥¡¥¤¥ë 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 +.\" ¾ðÊó¤Ê¤·¡£ +.\" .TP +.\" .I /proc/net/ipx_route +.\" ¾ðÊó¤Ê¤·¡£ +.TP +.I /proc/net/dev_mcast +.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 +Internet Group Management Protocol (¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥°¥ë¡¼¥×´ÉÍý¥×¥í¥È¥³¥ë)¡£ +.I /usr/src/linux/net/core/igmp.c +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /proc/net/rarp +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï +.I arp +¤ÈƱ¤¸¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç +µÕ¥¢¥É¥ì¥¹²ò·è¥µ¡¼¥Ó¥¹ (reverse address lookup services) +.BR rarp (8) +¤ËÄ󶡤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¸½ºß¤ÎµÕ¥Þ¥Ã¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÆâÍƤò´Þ¤ó¤Ç¤¤¤ë¡£ +RARP ¤¬¥«¡¼¥Í¥ë¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥ó¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¸ºß¤·¤Ê¤¤¡£ +.TP +.I /proc/net/raw +RAW ¥½¥±¥Ã¥È¥Æ¡¼¥Ö¥ë¤Î¥À¥ó¥×¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£ +¤Û¤È¤ó¤É¤Î¾ðÊó¤Ï¥Ç¥Ð¥Ã¥°°Ê³°¤Ç¤Ï»È¤ï¤ì¤Ê¤¤¡£ +\&"sl" ¤ÎÃͤϥ½¥±¥Ã¥È¤Î¥«¡¼¥Í¥ë¥Ï¥Ã¥·¥å¥¹¥í¥Ã¥È¡¢ +\&"local_address" ¤Ï¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤È¥×¥í¥È¥³¥ëÈÖ¹æ¤Î¥Ú¥¢ +[Ìõ¼ÔÄɲÃ: "rem_address" ¤Ï¥ê¥â¡¼¥È¥¢¥É¥ì¥¹¤È¥×¥í¥È¥³¥ëÈÖ¹æ¤Î¥Ú¥¢]¡£ +\&"st" ¤Ï¥½¥±¥Ã¥È¤ÎÆâÉô¾õÂÖ¡£ +\&"tx_queue" ¤È "rx_queue" ¤Ï¥«¡¼¥Í¥ë¥á¥â¥ê¤ò¾ÃÈñ¤·¤Æ¤¤¤ë +Á÷¿®/¼õ¿®¥Ç¡¼¥¿¥­¥å¡¼¤Î¥µ¥¤¥º¡£ +\&"tr" ¤È "tm\->when" ¤È "rexmits" ¥Õ¥£¡¼¥ë¥É¤Ï RAW ¤Ç¤Ï»È¤ï¤ì¤Æ¤¤¤Ê¤¤¡£ +\&"uid" ¥Õ¥£¡¼¥ë¥É¤Ï¥½¥±¥Ã¥ÈÀ¸À®¼Ô¤Î¼Â¸ú UID ¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£ +.\" .TP +.\" .I /proc/net/route +.\" ¾ðÊó¤Ê¤·¡£ +.\" .BR route (8) +.\" (¤Î½ÐÎÏ) ¤Î¤è¤¦¤Ë¸«¤¨¤ë¡£ +.TP +.I /proc/net/snmp +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï SNMP ¥¨¡¼¥¸¥§¥ó¥È¤¬É¬ÍפȤ¹¤ë +IP, ICMP, TCP, UDP ´ÉÍý¾ðÊó¤ò ASCII ¥Ç¡¼¥¿¤È¤·¤ÆÊÝ»ý¤·¤Æ¤¤¤ë¡£ +.TP +.I /proc/net/tcp +TCP ¥½¥±¥Ã¥È¥Æ¡¼¥Ö¥ë¤Î¥À¥ó¥×¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£ +ÂçÉôʬ¤Î¾ðÊó¤Ï¥Ç¥Ð¥Ã¥°°Ê³°¤Ë¤Ï»È¤ï¤ì¤Ê¤¤¡£ +sl ¤Ï¥½¥±¥Ã¥È¤Î¥«¡¼¥Í¥ë¥Ï¥Ã¥·¥å¥¹¥í¥Ã¥È¤ÎÃÍ¡¢ +\&"local_address" ¤Ï¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤È¥Ý¡¼¥ÈÈÖ¹æ¤Î¥Ú¥¢¤Ç¤¢¤ë¡£ +(¥½¥±¥Ã¥È¤¬Àܳ¤·¤Æ¤¤¤ë¾ì¹ç¤Ï) +\&"rem_address" ¤Ï¥ê¥â¡¼¥È¥¢¥É¥ì¥¹¤È¥Ý¡¼¥ÈÈÖ¹æ¤ÎÂФǤ¢¤ë¡£ +\&"st" ¤Ï¥½¥±¥Ã¥È¤ÎÆâÉô¾õÂ֤Ǥ¢¤ë¡£ +\&"tx_queue" ¤È "rx_queue" ¤Ï¥«¡¼¥Í¥ë¥á¥â¥ê¤ò¾ÃÈñ¤·¤Æ¤¤¤ë +Á÷¿®/¼õ¿®¥Ç¡¼¥¿¥­¥å¡¼¤Î¥µ¥¤¥º¡£ +\&"tr" ¤È "tm\->when" ¤È "rexmits" ¥Õ¥£¡¼¥ë¥É¤Ï¥½¥±¥Ã¥È¾õÂ֤Υ«¡¼¥Í¥ë +ÆâÉô¾ðÊó¤òÊÝ»ý¤·¤Æ¤¤¤ë¤¬¡¢¤³¤ì¤é¤Ï¥Ç¥Ð¥Ã¥°¤Î¤È¤­¤Ë¤·¤«Ìò¤ËΩ¤¿¤Ê¤¤¡£ +\&"uid" ¥Õ¥£¡¼¥ë¥É¤Ï¥½¥±¥Ã¥ÈÀ¸À®¼Ô¤Î¼Â¸ú UID ¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£ +.TP +.I /proc/net/udp +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 +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 + +¤³¤³¤Ç¡¢Num ¤Ï¥«¡¼¥Í¥ë¤Î¥Æ¡¼¥Ö¥ë¥¹¥í¥Ã¥È¿ô¡¢ +RefCount ¤Ï¥½¥±¥Ã¥È¤ò»ÈÍѤ·¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¿ô¡¢ +Protocol ¤Ï¤¤¤Þ¤Î¤È¤³¤í¤¤¤Ä¤â 0 ¤Ç¡¢Flags ¤Ï¥½¥±¥Ã¥È¤Î¾õÂÖ¤òÊÝ»ý¤·¤Æ¤¤¤ë +¥«¡¼¥Í¥ëÆâÉô¤Î¥Õ¥é¥°¤Ç¤¢¤ë¡£ +Type ¤Ï¤¤¤Þ¤Î¤È¤³¤í¤¤¤Ä¤â 1 +(UNIX ¥É¥á¥¤¥ó¤Î¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤Ï¡¢¸½ºß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ +[ÌõÃí: 2.0.34 ¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤À])¡£ +St ¤Ï¥½¥±¥Ã¥È¤ÎÆâÉô¾õÂ֤ǡ¢Path ¤Ï (¤â¤·¤¢¤ì¤Ð) ¥½¥±¥Ã¥È¤Î¥Ñ¥¹Ì¾¤Ç¤¢¤ë¡£ +.TP +.I /proc/partitions +³Æ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¥á¥¸¥ã¡¼ÈÖ¹æ¤È¥Þ¥¤¥Ê¡¼Èֹ椬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¤µ¤é¤Ë¡¢¥Ö¥í¥Ã¥¯¿ô¤È¥Ñ¡¼¥Æ¥£¥·¥ç¥ó̾¤â½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.I /proc/pci +¥«¡¼¥Í¥ë¤Î½é´ü²½»þ¤Ë¸«¤Ä¤«¤Ã¤¿¤¹¤Ù¤Æ¤Î PCI ¥Ç¥Ð¥¤¥¹¤Î¥ê¥¹¥È¤È +¤½¤ÎÀßÄê¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÈó¿ä¾©¤Ç¤¢¤ê¡¢¿·¤·¤¤ 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 +.I scsi +Ãæ´Ö¥ì¥Ù¥ëµ¼»÷¥Õ¥¡¥¤¥ë¤È¤¤¤¯¤Ä¤«¤Î SCSI Äã¥ì¥Ù¥ë¥É¥é¥¤¥Ð¤Î +¥Ç¥£¥ì¥¯¥È¥ê¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È¥ê¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï ASCII ¤Çɽ¸½¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç +.BR cat (1) +¤ÇÆɤá¤ë¡£ + +¤¤¤¯¤Ä¤«¤Î¥Õ¥¡¥¤¥ë¤Ï½ñ¤­¹þ¤ß²Äǽ¤Ç¡¢¥µ¥Ö¥·¥¹¥Æ¥à¤ÎÀßÄê¤òÊѹ¹¤·¤¿¤ê¡¢ +ÆÃÄê¤Îµ¡Ç½¤ò¥ª¥ó/¥ª¥Õ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.I /proc/scsi/scsi +¥«¡¼¥Í¥ë¤¬ÃΤäƤ¤¤ë¤¹¤Ù¤Æ¤Î SCSI ¥Ç¥Ð¥¤¥¹¤Î¥ê¥¹¥È¡£ +¤³¤Î¥ê¥¹¥È¤Ïµ¯Æ°»þ¤Ë (¥³¥ó¥½¡¼¥ë¤Ç) ¸«¤é¤ì¤ë¤â¤Î¤È¤Û¤ÜƱ¤¸¤Ç¤¢¤ë¡£ +scsi ¤Ï¸½ºß¤Î¤È¤³¤í \fIadd-single-device\fP ¥³¥Þ¥ó¥É¤Î¤ß¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Ë¤è¤ê¥ë¡¼¥È (root) ¤Ï´ûÃΤΥǥХ¤¥¹¥ê¥¹¥È¤Ø³èÀþÁÞÈ´ (hotplugged) +¥Ç¥Ð¥¤¥¹¤ò²Ã¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¼¡¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤È¡¢ +.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] +¤¤¤Þ¤Î¤È¤³¤í \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) ¤Ë +¥É¥é¥¤¥Ð¤¬³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¤È¡¢¤½¤Î¥É¥é¥¤¥Ð¤ËÂбþ¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬¸½¤ì¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢ +ÅÐÏ¿¤µ¤ì¤¿¥Û¥¹¥È¥¢¥À¥×¥¿¤ËÂбþ¤·¤Æ¥Õ¥¡¥¤¥ë¤¬ºî¤é¤ì¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î̾Á°¤Ï¡¢¥·¥¹¥Æ¥à¤Î½é´ü²½¤ÎºÝ¤Ë +¥Û¥¹¥È¥¢¥À¥×¥¿¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ÈÖ¹æ¤Ë¤Ê¤ë¡£ + +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤òÆɤá¤Ð¥É¥é¥¤¥Ð¤È¥Û¥¹¥È¥¢¥À¥×¥¿¤ÎÀßÄê¤ä +Åý·×¤Ê¤É¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ß¤Ï¥Û¥¹¥È¥¢¥À¥×¥¿¤´¤È¤Ë°Û¤Ê¤ëÆ°ºî¤ò°ú¤­µ¯¤³¤¹¡£ +¤¿¤È¤¨¤Ð \fIlatency\fP ¤È \fInolatency\fP ¥³¥Þ¥ó¥É¤òÍѤ¤¤ë¤È¡¢ +¥ë¡¼¥È (root¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼) ¤Ï eata_dma ¥É¥é¥¤¥Ð¤Î±£¤·Â¬Äꥳ¡¼¥É¤Î +¥ª¥ó/¥ª¥Õ¤òÀÚ¤êÂؤ¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤Þ¤¿ \fI lockup\fP ¤È \fIunlock\fP ¥³¥Þ¥ó¥É¤òÍѤ¤¤ë¤È¡¢¥ë¡¼¥È¤Ï +scsi_debug ¥É¥é¥¤¥Ð¤¬¥·¥ß¥å¥ì¡¼¥È¤¹¤ë¥Ð¥¹¥í¥Ã¥¯¥¢¥Ã¥× (bus lockup) ¤ò +À©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.I /proc/self +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¥×¥í¥»¥¹¤Ë (¥×¥í¥»¥¹¼«¿È¤Î) +.I /proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î¥¢¥¯¥»¥¹¤ò»²¾È¤µ¤»¤ë¡£ +¤³¤ì¤Ï +.I /proc +Æâ¤Î (¤³¤Î¥×¥í¥»¥¹¤Î) ¥×¥í¥»¥¹ ID ¤¬Ì¾Á°¤È¤Ê¤Ã¤Æ¤¤¤ë +¥Ç¥£¥ì¥¯¥È¥ê¤ÈÁ´¤¯Æ±°ì¤Ç¤¢¤ë¡£ +.TP +.I /proc/slabinfo +Linux 2.6.16 °Ê¹ß¤Ç¤Ï¡¢ +¥«¡¼¥Í¥ëÀßÄꥪ¥×¥·¥ç¥ó +.B CONFIG_SLAB +¤¬Í­¸ú¤Î¾ì¹ç¤Ë¤Î¤ß¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¸ºß¤¹¤ë¡£ +¥«¡¼¥Í¥ë¥­¥ã¥Ã¥·¥å¤Î¾ðÊó¡£ +.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 + +¾ÜºÙ¤Ï +.BR slabinfo (5) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.I /proc/stat +¥«¡¼¥Í¥ë/¥·¥¹¥Æ¥à¤ÎÅý·×¡£ +¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +¶¦ÄÌ¥¨¥ó¥È¥ê¤Ë¤Ï°Ê²¼¤Î¤â¤Î¤¬´Þ¤Þ¤ì¤ë¡£ +.RS +.TP +\fIcpu 3357 0 4313 1362393\fP +¥æ¡¼¥¶¡¼¥â¡¼¥É¡¢ +Ä㤤ͥÀèÅÙ (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 Çܤ·¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +Linux 2.6 ¤Ç¤Ï¡¢¤³¤Î¹Ô¤Ë 3¤Ä¤ÎÍó¤¬Äɲ䵤ì¤Æ¤¤¤ë: +.I iowait +(I/O ¤Î´°Î»¤òÂԤäƤ¤¤¿»þ´Ö; 2.5.41 °Ê¹ß); +.I irq +(³ä¤ê¹þ¤ß½èÍý¤ò¹Ô¤Ã¤¿»þ´Ö; 2.6.0-test4 °Ê¹ß); +.I softirq +(¥½¥Õ¥È³ä¤ê¹þ¤ß¤Î½èÍý¤ò¹Ô¤Ã¤¿»þ´Ö; 2.6.0-test4 °Ê¹ß)¡£ + +Linux 2.6.11 °Ê¹ß¤Ç¤Ï¡¢8 ¸ÄÌܤÎÍó¤È¤·¤Æ +.I steal +(Åð¤Þ¤ì¤¿»þ´Ö; stolen time) ¤¬Â¸ºß¤¹¤ë¡£ +¤³¤ì¤Ï¡¢²¾ÁÛ²½´Ä¶­¤Ç¤ÎÆ°ºî»þ¤Ë¾¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ë¤è¤ê +¾ÃÈñ¤µ¤ì¤¿»þ´Ö¤Ç¤¢¤ë¡£ + +Linux 2.6.24 °Ê¹ß¤Ç¤Ï¡¢9 ¸ÄÌܤÎÍó¤È¤·¤Æ¡¢ +.I guest +¤¬¤¢¤ë¡£¤³¤ì¤Ï¡¢ +Linux ¥«¡¼¥Í¥ë¤ÎÀ©¸æ²¼¤Î¥²¥¹¥È¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î²¾ÁÛ CPU ¤Î +¼Â¹Ô¤Ë¾ÃÈñ¤µ¤ì¤¿»þ´Ö¤Ç¤¢¤ë¡£ +.\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de +.TP +\fIpage 5741 1808\fP +¥·¥¹¥Æ¥à¤¬ (¥Ç¥£¥¹¥¯¤«¤é) ¥Ú¡¼¥¸¥¤¥ó/¥Ú¡¼¥¸¥¢¥¦¥È¤·¤¿¥Ú¡¼¥¸¿ô¡£ +.TP +\fIswap 1 0\fP +¥¹¥ï¥Ã¥×¥¤¥ó/¥¹¥ï¥Ã¥×¥¢¥¦¥È¤µ¤ì¤¿¥Ú¡¼¥¸¿ô¡£ +.TP +.\" FIXME °Ê²¼¤ÎÀâÌÀ¤Ï¡¢¥«¡¼¥Í¥ë 2.6 ¤Î /proc/stat 'intr' ¥Õ¥£¡¼¥ë¥É¤Î +.\" ´°Á´¤ÊÀâÌÀ¤Ç¤Ï¤Ê¤¤¡£½ñ¤«¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤¬¤¢¤ë¡£ +\fIintr 1462898\fP +¤³¤Î¹Ô¤Ï¥·¥¹¥Æ¥àµ¯Æ°»þ°Ê¹ß¤Ë½èÍý¤µ¤ì¤¿³ä¤ê¹þ¤ß¤Î²ó¿ô¤ò¼¨¤¹¡£ +ºÇ½é¤ÎÍó¤Ï½èÍý¤µ¤ì¤¿³ä¤ê¹þ¤ßÁ´¤Æ¤Î¹ç·×¤Ç¤¢¤ê¡¢¤½¤ì°Ê¹ß¤ÎÍó¤Ï +¸Ä¡¹¤Î³ä¤ê¹þ¤ß¤Ë¤Ä¤¤¤Æ¤Î¹ç·×¿ô¤Ç¤¢¤ë¡£ +.TP +\fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP... +(¥á¥¸¥ã¡¼ÈÖ¹æ, ¥Ç¥£¥¹¥¯¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ):(¾ðÊó¤Ê¤· (noinfo), Æɤ߹þ¤ß²ó¿ô, +Æɤ߹þ¤ß¥Ö¥í¥Ã¥¯¿ô, ½ñ¤­½Ð¤·²ó¿ô, ½ñ¤­½Ð¤·¥Ö¥í¥Ã¥¯¿ô) +.br +(Linux 2.4 ¤Î¤ß) +.TP +\fIctxt 115315\fP +¥³¥ó¥Æ¥¯¥¹¥È¡¦¥¹¥¤¥Ã¥Á¤Î±ä¤Ù²ó¿ô¡£ +.TP +\fIbtime 769041601\fP +µ¯Æ°»þ¹ï¡¢µª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤ÎÉÿô¡£ +.TP +\fIprocesses 86031\fP +¥·¥¹¥Æ¥àµ¯Æ°»þ¤«¤é¤Î±ä¤Ù¥Õ¥©¡¼¥¯ (fork) ¿ô¡£ +.TP +\fIprocs_running 6\fP +¼Â¹ÔÃæ¾õÂÖ¤Î¥×¥í¥»¥¹¿ô (Linux 2.5.45 °Ê¹ß)¡£ +.TP +\fIprocs_blocked 2\fP +I/O ´°Î»ÂÔ¤Á¤ÇÄä»ß (blocked) ¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¿ô +(Linux 2.5.45 °Ê¹ß)¡£ +.RE +.TP +.I /proc/swaps +»ÈÍÑÃæ¤Î¥¹¥ï¥Ã¥×Îΰ衣 +.BR swapon (8) +¤â»²¾È¤¹¤ë¤³¤È¡£ +.TP +.I /proc/sys +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê (1.3.57 °Ê¹ß¤Ë¸ºß) ¤Ï¥«¡¼¥Í¥ëÊÑ¿ô¤ËÂбþ¤¹¤ë¤¤¤¯¤Ä¤«¤Î +¥Õ¥¡¥¤¥ë¤È¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ò´Þ¤à¡£ +¤³¤ì¤é¤ÎÊÑ¿ô¤ÏÆɤ߽Ф·²Äǽ¤Ç¤¢¤ë¡£ +¤Þ¤¿¾ì¹ç¤Ë¤è¤Ã¤Æ¤Ï \fI/proc\fP ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ä¡¢ +(Èó¿ä¾©¤Î) ¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR sysctl (2) +¤òÍѤ¤¤Æ½ñ¤­´¹¤¨¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤¤¤Þ¤Î¤È¤³¤í +.IR abi ", " debug ", " dev ", " fs ", " kernel ", " net ", " proc ", " +.IR rxrpc ", " sunrpc ", " vm +¤È¤¤¤¦¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤Ã¤Æ¡¢ +¤½¤ì¤¾¤ì¤¬¥Õ¥¡¥¤¥ë¤È¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +.TP +.IR /proc/sys/abi " (Linux 2.4.10 °Ê¹ß)" +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥Ð¥¤¥Ê¥ê¾ðÊó¤¬Æþ¤Ã¤¿¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +.\" ¤³¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +¹¹¤Ë¾Ü¤·¤¤¾ðÊó¤Ï¡¢¥«¡¼¥Í¥ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë +.I Documentation/sysctl/abi.txt +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.I /proc/sys/debug +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¶õ¤Î¾ì¹ç¤â¤¢¤ë¡£ +.TP +.I /proc/sys/dev +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¥Ç¥Ð¥¤¥¹ÆÃÍ­¤Î¾ðÊó (¤¿¤È¤¨¤Ð +.IR dev/cdrom/info ) +¤¬´Þ¤Þ¤ì¤ë¡£ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤¬¶õ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.TP +.I /proc/sys/fs +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê +.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 +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤Î¥É¥­¥å¥á¥ó¥È¤Ï¡¢ +¥«¡¼¥Í¥ë¥½¡¼¥¹¤Î +.I Documentation/binfmt_misc.txt +¤Ë¤¢¤ë¡£ +.TP +.IR /proc/sys/fs/dentry-state " (Linux 2.2 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¥­¥ã¥Ã¥·¥å (dcache) ¤Î¾õÂ֤˴ؤ¹¤ë¾ðÊó¤¬ +Æþ¤Ã¤Æ¤¤¤ë¡£¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢ +.IR nr_dentry ", " nr_unused ", " age_limit " (ÉÃñ°Ì¤Î age), " want_pages +(¥·¥¹¥Æ¥à¤¬¥ê¥¯¥¨¥¹¥È¤·¤¿¥Ú¡¼¥¸¿ô), ¥À¥ß¡¼¤Î 2 ¤Ä¤ÎÃÍ¡¢ +¤È¤¤¤¦ 6 ¤Ä¤Î¿ô»ú¤¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.RS +.IP * 2 +.I nr_dentry +¤Ï³ä¤êÅö¤Æ¤é¤ì¤¿ dentry (dcache ¥¨¥ó¥È¥ê) ¤Î¿ô¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï Linux 2.2 ¤Ç¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£ +.IP * +.I nr_unused +¤Ï̤»ÈÍѤΠdentry ¿ô¤Ç¤¢¤ë¡£ +.IP * +.I age_limit +¤Ï¡¢¥á¥â¥ê¤¬ÉÔ­¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¼¡¤Ë dcache entry ¤òºÆÍ×µá¤Ç¤­¤ë¤è¤¦¤Ë +¤Ê¤ë¤Þ¤Ç¤Î»Ä¤ê»þ´Ö (Éÿô) ¤Ç¤¢¤ë¡£ +.IP * +.\" looks like this is unused in kernels 2.2 to 2.6 +.I want_pages +¤Ï¡¢¥«¡¼¥Í¥ë¤¬ shrink_dcache_pages() ¤ò¸Æ¤Ó½Ð¤·¤¿¤¬ +dcache ¤¬¤Þ¤À½Ì¾®¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¡¢0 °Ê³°¤ÎÃͤȤʤ롣 +.RE +.TP +.I /proc/sys/fs/dir-notify-enable +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï +.BR fcntl (2) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë +.I dnotify +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò¥·¥¹¥Æ¥àÁ´ÂΤÇ̵¸ú¤Ë¤·¤¿¤êÍ­¸ú¤Ë¤·¤¿¤ê¤¹¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤ËÃÍ 0 ¤¬½ñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬Ìµ¸ú¤Ë¤Ê¤ê¡¢ +ÃÍ 1 ¤Î¾ì¹ç¤ÏÍ­¸ú¤Ë¤Ê¤ë¡£ +.TP +.I /proc/sys/fs/dquot-max +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¥­¥ã¥Ã¥·¥å¤µ¤ì¤ë¥Ç¥£¥¹¥¯ quota ¥¨¥ó¥È¥ê¤ÎºÇÂç¿ô¤¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +(2.4 ·Ï¤Î) ¥·¥¹¥Æ¥à¤ÎÃæ¤Ë¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¤â¤Î¤â¤¢¤ë¡£ +¥­¥ã¥Ã¥·¥å¤µ¤ì¤ë¥Ç¥£¥¹¥¯ quota ¥¨¥ó¥È¥ê¤Î¶õ¤­¤¬Èó¾ï¤Ë¾¯¤Ê¤¯¡¢ +¤È¤Æ¤â¿¤¯¤Î¥·¥¹¥Æ¥à¥æ¡¼¥¶¡¼¤¬Æ±»þ¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢ +¤³¤ÎÀ©¸Â¤ò¾å¤²¤ë¤È¤¤¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.I /proc/sys/fs/dquot-nr +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥Ç¥£¥¹¥¯ quota ¤Î¥¨¥ó¥È¥ê¿ô¤È¡¢ +¶õ¤¤¤Æ¤¤¤ë¥Ç¥£¥¹¥¯ quota ¤Î¥¨¥ó¥È¥ê¿ô¤¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.IR /proc/sys/fs/epoll " (Linux 2.6.28 °Ê¹ß)" +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ë +.I max_user_watches +¤¬¤¢¤ë¡£ +¤³¤ì¤é¤Ï¡¢ +.I epoll +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬¾ÃÈñ¤¹¤ë¥«¡¼¥Í¥ë¥á¥â¥êÎ̤òÀ©¸Â¤¹¤ë¤Î¤Ë»ÈÍѤǤ­¤ë¡£ +¾ÜºÙ¤Ï +.BR epoll (7) +¤ò»²¾È¡£ +.TP +.I /proc/sys/fs/file-max +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥·¥¹¥Æ¥àÁ´ÂÎ¤Ç¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤Ç¤­¤ë +¥Õ¥¡¥¤¥ë¿ô¤Î¾å¸Â¤òÄêµÁ¤¹¤ë¡£ +(³Æ¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¾å¸Â¤ò +.B RLIMIT_NOFILE +¤Ë¤è¤Ã¤ÆÀßÄꤹ¤ë +.BR setrlimit (2) +¤â»²¾È¤¹¤ë¤³¤È¡£) +¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤ò»È¤¤²Ì¤¿¤·¤ÆÂçÎ̤˥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½Ð¤ë¾ì¹ç¤Ï¡¢ +°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¤³¤ÎÃͤòÁý²Ã¤µ¤»¤Æ¤ß¤è: +.br + +.br +.nf +.ft CW +echo 100000 > /proc/sys/fs/file-max +.fi +.ft + +.I file-max +¤Ë½ñ¤«¤ì¤Æ¤¤¤ëÃͤϡ¢¥«¡¼¥Í¥ëÄê¿ô +.B NR_OPEN +¤ËÀ©¸Â¤µ¤ì¤ë¡£ + +.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 +(¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÆɤ߽Ф·ÀìÍѤÇ) Æɤ߽Ф¹¤È +¸½ºß¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Î¿ô¤¬ÆÀ¤é¤ì¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¿ô¡¦ +¶õ¤¤¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¿ô¡¦¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¿ô¤ÎºÇÂçÃÍ¡¢ +¤È¤¤¤¦ 3 ¤Ä¤Î¿ôÃͤ¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤òưŪ¤Ë³ä¤êÅö¤Æ¤ë¤¬¡¢ +¤½¤ì¤òºÆ¤Ó²òÊü¤·¤Ê¤¤¡£ +³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤¬ºÇÂçÃͤ˶á¤Å¤¤¤¿¾ì¹ç¤Ï¡¢ +ºÇÂçÃͤòÂ礭¤¯¤¹¤ë¤³¤È¤ò¹Íθ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¶õ¤¤¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¿ô¤¬Â¿¤¤¾ì¹ç¤Ï¡¢ +¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤Î»ÈÍѤΥԡ¼¥¯¤ò·Ð¸³¤·¤¿¤³¤È¤¬¤¢¤ê¡¢ +ºÇÂçÃͤòÂ礭¤¯¤¹¤ëɬÍפϤʤ¤¤À¤í¤¦¡£ +.TP +.I /proc/sys/fs/inode-max +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¥á¥â¥êÆâ inode ¤ÎºÇÂçÃͤ¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +(2.4 ·Ï¤Î) ¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤ÎÃÍ¤Ï +.I file-max +¤ÎÃͤΠ3-4 Çܤˤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï \fIstdin\fP, \fIstdout\fP, ¥Í¥Ã¥È¥ï¡¼¥¯¥½¥±¥Ã¥È¤ò°·¤¦¤Ë¤â +inode ¤¬É¬Íפʤ¿¤á¤Ç¤¢¤ë¡£ +Æü¾ïŪ¤Ë inode ¤ò»È¤¤²Ì¤¿¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤³¤ÎÃͤòÁý¤ä¤¹É¬Íפ¬¤¢¤ë¡£ +.TP +.I /proc/sys/fs/inode-nr +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢ +.I inode-state +¤ÎºÇ½é¤Î 2 ¤Ä¤ÎÃͤ¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.I /proc/sys/fs/inode-state +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï 7 ¸Ä¤ÎÃͤ¬½ñ¤«¤ì¤Æ¤¤¤ë: +.IR nr_inodes, +.IR nr_free_inodes , +.IR preshrink +¤È 4 ¤Ä¤Î¥À¥ß¡¼¤ÎÃͤǤ¢¤ë¡£ +.I nr_inodes +¤Ï¥·¥¹¥Æ¥à¤¬³ÎÊݤ¹¤ë inode ¤Î¿ô¤Ç¤¢¤ë¡£ +Linux ¤Ï 1 ÅÙ¤Ë 1 ¥Ú¡¼¥¸Ê¬¤¤¤Ã¤Ñ¤¤¤Ë nr_inode ¤ò³ÎÊݤ¹¤ë¤Î¤Ç¡¢¤³¤ÎÃͤ¬ +.I inode-max +¤è¤ê´öʬÂ礭¤¯¤Ê¤ë¤³¤È¤â¤¢¤ë¡£ +.I nr_free_inodes +¤Ï¶õ¤¤¤Æ¤¤¤ë inode ¤Î¿ô¤òɽ¤¹¡£ +.IR nr_inodes " > " inode-max +¤Î¾ì¹ç¡¢ +.I preshrink +¤Ï 0 °Ê³°¤ÎÃͤˤʤ롣 +¤³¤Î¾ì¹ç¥·¥¹¥Æ¥à¤Ï inode ¤ò¤µ¤é¤Ë³ÎÊݤ¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +inode ¥ê¥¹¥È¤òÀÚ¤êµÍ¤á¤ëɬÍפ¬¤¢¤ë¡£ +.TP +.IR /proc/sys/fs/inotify " (Linux 2.6.13 °Ê¹ß)" +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ë +.IR max_queued_events ", " max_user_instances ", and " max_user_watches +¤¬¤¢¤ë¡£¤³¤ì¤é¤Ï¡¢ +.I inotify +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬¾ÃÈñ¤¹¤ë¥«¡¼¥Í¥ë¥á¥â¥êÎ̤òÀ©¸Â¤¹¤ë¤Î¤ËÍøÍѤǤ­¤ë¡£ +¾ÜºÙ¤Ï +.BR inotify (7) +¤ò»²¾È¡£ +.TP +.I /proc/sys/fs/lease-break-time +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤òÊÝ»ý¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤ËÂФ·¤Æ +¥«¡¼¥Í¥ë¤¬¥·¥°¥Ê¥ë¤òÁ÷¤ê¡¢ +¾¤Î¥×¥í¥»¥¹¤¬¤½¤Î¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë¤Î¤òÂԤäƤ¤¤ë¤³¤È¤òÄÌÃΤ·¤Æ¤«¤é¡¢ +¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë¤Î¥ê¡¼¥¹ (lease, Âߤ·½Ð¤·) +.RB ( fcntl (2) +¤ò»²¾È) ¤òµö¤¹Í±Í½´ü´Ö¤ò»ØÄꤹ¤ë¡£ +¥ê¡¼¥¹¥Û¥ë¥À (lease holder: ¥Õ¥¡¥¤¥ë¤ÎÂߤ·½Ð¤·¤ò¼õ¤±¤Æ¤¤¤ë¥×¥í¥»¥¹) ¤¬ +ͱͽ´ü´ÖÃæ¤Ë¥ê¡¼¥¹¤òºï½ü¤¹¤ë¤«³¬µé¤òÄ㤯¤·¤Ê¤¤¾ì¹ç¡¢ +¥«¡¼¥Í¥ë¤Ï¥Õ¥¡¥¤¥ë¤Î¥ê¡¼¥¹¤ò¶¯À©Åª¤Ë»ß¤á¤ë¡£ +.TP +.I /proc/sys/fs/leases-enable +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥·¥¹¥Æ¥àÁ´ÂΤǤΥե¡¥¤¥ë¥ê¡¼¥¹ +.RB ( fcntl (2) +¤ò»²¾È) ¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤ËÃÍ 0 ¤¬½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥ê¡¼¥¹¤Ï̵¸ú¤Ç¤¢¤ë¡£ +0 °Ê³°¤Î¾ì¹ç¤Ë¤Ï¥ê¡¼¥¹¤ÏÍ­¸ú¤Ç¤¢¤ë¡£ +.TP +.IR /proc/sys/fs/mqueue " (Linux 2.6.6 °Ê¹ß)" +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¥Õ¥¡¥¤¥ë +.IR msg_max ", " msgsize_max ", and " queues_max +¤¬¤¢¤ë¡£¤³¤ì¤é¤Ï POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ç»ÈÍѤµ¤ì¤ë¥ê¥½¡¼¥¹¤Î +À©¸æ¤ò¹Ô¤¦¡£ +¾ÜºÙ¤Ï +.BR mq_overview (7) +¤ò»²¾È¡£ +.TP +.IR /proc/sys/fs/overflowgid " ¤È " /proc/sys/fs/overflowuid +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ë¤è¤ê¡¢¥æ¡¼¥¶¡¼¤Ï¸ÇÄê UID ¤È¸ÇÄê GID ¤ÎÃͤòÊѹ¹¤Ç¤­¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 65534 ¤Ç¤¢¤ë¡£ +Linux ¤Î UID ¤È GID ¤Ï 32 ¥Ó¥Ã¥È¤Ç¤¢¤ë¤¬¡¢ +16 ¥Ó¥Ã¥È¤Î UID ¤È GID ¤·¤«¥µ¥Ý¡¼¥È¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬½ñ¤­¹þ¤ß¤òµö²Ä¤·¤Æ¥Þ¥¦¥ó¥È¤µ¤ì¤¿¾ì¹ç¡¢ +65535 ¤òĶ¤¨¤ë UID ¤È GID ¤Ï¡¢ +¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤Þ¤ì¤ëÁ°¤Ë¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÃͤËÊÑ´¹¤µ¤ì¤ë¡£ +.TP +.IR /proc/sys/fs/suid_dumpable " (Linux 2.6.13 °Ê¹ß)" +.\" °Ê²¼¤Ï Documentation/sysctl/kernel.txt ¤ÎÆâÍƤ˴𤤤Ƥ¤¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÃͤˤè¤ê¡¢set-user-ID ¤µ¤ì¤¿¥Ð¥¤¥Ê¥ê¤ä¡¢ +Êݸ¤«¤«¤Ã¤¿ (protected) ¥Ð¥¤¥Ê¥ê / tainted ¤Ê (±øÀ÷¤µ¤ì¤¿; +¥é¥¤¥»¥ó¥¹¤¬¥«¡¼¥Í¥ë¤ÈŬ¹ç¤·¤Ê¤¤) ¥Ð¥¤¥Ê¥ê¤ËÂФ·¤Æ¡¢¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤ò +À¸À®¤¹¤ë¤«¤É¤¦¤«¤¬·èÄꤵ¤ì¤ë¡£ +°Ê²¼¤Î 3¤Ä¤ÎÃͤò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë: +.sp +\fI0\ (default)\fP +¤³¤ÎÃͤò»ØÄꤹ¤ë¤È¡¢°ÊÁ°¤ÈƱ¤¸ (Linux 2.6.13 ¤è¤êÁ°¤Î) Æ°ºî¤ò¤¹¤ë¡£ +.RB ( seteuid (2), +.BR setgid (2) +¤Ê¤É¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤ä¡¢set-user-ID ¤ä set-group-ID ¤µ¤ì¤¿¥×¥í¥°¥é¥à¤ò +¼Â¹Ô¤¹¤ë¤³¤È¤Ç) »ñ³Ê¾ðÊó (credentials) ¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤ë¥×¥í¥»¥¹¤ä¡¢ +¥×¥í¥»¥¹¤Î¼Â¹Ô¥Ð¥¤¥Ê¥ê¤ÎÆɤ߽Ф·µö²Ä¤¬¤Ê¤¤¥×¥í¥»¥¹¤ËÂФ·¤Æ¡¢ +¥³¥¢¥À¥ó¥×¤òÀ¸À®¤·¤Ê¤¤¡£ +.sp +\fI1\ ("debug")\fP +¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤Ç¡¢²Äǽ¤Ç¤¢¤ì¤Ð¥³¥¢¥À¥ó¥×¤ò¹Ô¤¦¡£ +¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤Ï¡¢¥À¥ó¥×¤ò¹Ô¤¦¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID +¤È¤Ê¤ê¡¢¥»¥­¥å¥ê¥Æ¥£¾å¤Î¹Íθ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +¤³¤ÎÃͤϡ¢¥·¥¹¥Æ¥à¥Ç¥Ð¥Ã¥°¤Î¾ìÌ̤À¤±¤òÁÛÄꤷ¤ÆÀߤ±¤é¤ì¤Æ¤¤¤ë¡£ +ptrace ¤Î¥Á¥§¥Ã¥¯¤â¹Ô¤ï¤ì¤Ê¤¤¡£ +.sp +\fI2\ ("suidsafe")\fP +Ä̾ï¤Ï¥À¥ó¥×¤µ¤ì¤Ê¤¤¤è¤¦¤Ê¥Ð¥¤¥Ê¥ê (¾åµ­¤Î "0" »²¾È) ¤ò +root ¤À¤±¤¬Æɤ߽Ф·²Äǽ¤Ê·Á¤Ç¥À¥ó¥×¤¹¤ë¡£ +¤³¤Î¾ì¹ç¡¢¥æ¡¼¥¶¤Ï¤½¤Î¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¤³¤È¤Ï¤Ç¤­¤ë¤¬¡¢ +Æɤळ¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¥»¥­¥å¥ê¥Æ¥£¾å¤ÎÍýͳ¤«¤é¡¢¤³¤Î¥â¡¼¥É¤Î¥³¥¢¥À¥ó¥×¤Ç¤Ï¡¢ +´û¸¤Î¥À¥ó¥×¥Õ¥¡¥¤¥ë¤ä¾¤Î¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +¤³¤Î¥â¡¼¥É¤Ï¡¢´ÉÍý¼Ô¤¬Ä̾ï¤Î´Ä¶­¤ÇÌäÂê¤ò²òÀϤ·¤è¤¦¤È¤¹¤ëºÝ¤Ë +Ŭ¤·¤Æ¤¤¤ë¡£ +.TP +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥¹¡¼¥Ñ¥Ö¥í¥Ã¥¯¤ÎÃͤòÀ©¸æ¤¹¤ë¡£ +¤³¤ÎÃͤϥ«¡¼¥Í¥ë¤¬¥Þ¥¦¥ó¥È¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎºÇÂçÃͤˤʤ롣 +¸½ºß¡¢ +.I super-max +¤Çµö²Ä¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¿ô°Ê¾å¤Ë +¥Þ¥¦¥ó¥È¤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ï¡¢¤³¤ÎÃͤòÁý²Ã¤µ¤»¤ë¤À¤±¤Ç¤è¤¤¡£ +.TP +.I /proc/sys/fs/super-nr +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¸½ºß¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¿ô¤¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.I /proc/sys/kernel +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ëÍÍ¡¹¤Ê¥«¡¼¥Í¥ë¥Ñ¥é¥á¡¼¥¿¤ò +À©¸æ¤¹¤ë¤¿¤á¤Î¥Õ¥¡¥¤¥ë¤¬ÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /proc/sys/kernel/acct +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï 3 ¤Ä¤ÎÃͤ¬´Þ¤Þ¤ì¤Æ¤¤¤ë: +.IR highwater , +.IR lowwater , +.IR frequency +¤Ç¤¢¤ë¡£ +BSD-style process accounting ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¤³¤ì¤é 3 ¤Ä¤ÎÃͤ¬Æ°ºî¤òÀ©¸æ¤¹¤ë¡£ +¥í¥°¥Õ¥¡¥¤¥ë¤Î¤¢¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¶õ¤­Îΰ褬 +.I lowwater +¥Ñ¡¼¥»¥ó¥È°Ê²¼¤Ë¤Ê¤Ã¤¿¾ì¹ç¤Ï¡¢¥í¥°µ­Ï¿¤ò°ì»þÄä»ß¤¹¤ë¡£ +¶õ¤­Îΰ褬 +.I highwater +¥Ñ¡¼¥»¥ó¥È°Ê¾å¤Ë¤Ê¤Ã¤¿¾ì¹ç¤Ë¡¢¥í¥°µ­Ï¿¤òºÆ³«¤¹¤ë¡£ +.I frequency +¤Ï¥«¡¼¥Í¥ë¤¬¶õ¤­Îΰè¤Î¥Á¥§¥Ã¥¯¤ò¤¹¤ëÉÑÅ٤Ǥ¢¤ë (ñ°Ì¤ÏÉÃ)¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃͤϡ¢4, 2, 30 ¤Ç¤¢¤ë¡£ +¤Ä¤Þ¤ê¡¢¶õ¤­Îΰ褬 2% °Ê²¼¤Ë¤Ê¤ë¤È¥í¥°µ­Ï¿¤ò°ì»þÄä»ß¤·¡¢ +¶õ¤­Îΰ褬 4% °Ê¾å¤È¤Ê¤Ã¤¿¤È¤­¤ËºÆ³«¤¹¤ë¡£ +¶õ¤­Îΰè¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï 30 ÉôÖÍ­¸ú¤Ç¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.TP +.IR /proc/sys/kernel/cap-bound " (Linux 2.2 to 2.6.24 °Ê¹ß)" +.I /proc/sys/kernel/cap-bound +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¥«¡¼¥Í¥ë¤Î +.I "capability bounding set" +(Éä¹æÉÕ¤­ 10 ¿Ê¿ôɽ¸½) ¤ÎÃͤ¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.BR execve (2) +Ãæ¤Ï¡¢¤³¤Î¥»¥Ã¥È¤È¥×¥í¥»¥¹¤Ëµö²Ä¤µ¤ì¤Æ¤¤¤ë¸¢¸Â¤Î AND ¤¬¤È¤é¤ì¤ë¡£ +Linux 2.6.25 °Ê¹ß¤Ç¤Ï¡¢¥·¥¹¥Æ¥àÁ´ÂΤΥ±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï +¤Ê¤¯¤Ê¤ê¡¢¥¹¥ì¥Ã¥Éñ°Ì¤Î¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +.BR capabilities (7) +¤ò»²¾È¡£ +.TP +.I /proc/sys/kernel/core_pattern +.BR core (5) +»²¾È¡£ +.TP +.I /proc/sys/kernel/core_uses_pid +.BR core (5) +»²¾È¡£ +.TP +.I /proc/sys/kernel/ctrl-alt-del +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥­¡¼¥Ü¡¼¥É¤Î Ctrl-Alt-Del ¤Î°·¤¤¤òÀ©¸æ¤¹¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤¢¤ëÃͤ¬ 0 ¤Î¾ì¹ç¡¢ +Ctrl-Alt-Del ¤¬Ê᪤µ¤ì¤ë¤È +.BR init (8) +¥×¥í¥°¥é¥à¤ËÁ÷¤é¤ì¤Æ¡¢Àµ¤·¤¯ºÆµ¯Æ°¤µ¤ì¤ë¡£ +Ãͤ¬ 0 ¤è¤êÂ礭¤¤¾ì¹ç¡¢Vulcan Nerve Pinch (tm) ¤ËÈ¿±þ¤·¤Æ¡¢ +Linux ¤Ï¥À¡¼¥Æ¥£¥Ð¥Ã¥Õ¥¡¤òƱ´ü¤µ¤»¤ë¤³¤È¤Ê¤¯¡¢¤¹¤°¤ËºÆµ¯Æ°¤ò¹Ô¤¦¡£ +Ãí°Õ: ¥×¥í¥°¥é¥à (dosemu ¤Ê¤É) ¤Ë "raw" ¥â¡¼¥É¤Î¥­¡¼¥Ü¡¼¥É¤¬¤¢¤ë¾ì¹ç¡¢ +ctrl-alt-del ¤Ï¥«¡¼¥Í¥ë¤Î tty ¥ì¥¤¥ä¡¼¤ËÅþ㤹¤ëÁ°¤Ë +¥×¥í¥°¥é¥à¤Ë¼×ÃǤµ¤ì¡¢ +¥×¥í¥°¥é¥à¤ËÁ÷¤é¤ì¤Æ¤É¤Î¤è¤¦¤Ë°·¤¦¤«¤¬·è¤á¤é¤ì¤ë¡£ +.TP +.I /proc/sys/kernel/hotplug +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥Û¥Ã¥È¥×¥é¥°¡¦¥Ý¥ê¥·¡¼¡¦¥¨¡¼¥¸¥§¥ó¥È¤Î¥Ñ¥¹¤¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï +.I /sbin/hotplug +¤Ç¤¢¤ë¡£ +.TP +.IR /proc/sys/kernel/domainname " ¤È " /proc/sys/kernel/hostname +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¥³¥Þ¥ó¥É +.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 + +¤Ï¡¢°Ê²¼¤ÈƱ¤¸¸ú²Ì¤¬¤¢¤ë¡£ + +.in +4n +.nf +.RB "#" " hostname \(aqdarkstar\(aq" +.RB "#" " domainname \(aqmydomain\(aq" +.fi +.in + +Ãí°Õ: ŵ·¿Åª¤Ê 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 +(PowerPC ¤Î¤ß) ¤³¤Î¥Õ¥¡¥¤¥ë¤ò 0 °Ê³°¤ÎÃͤËÀßÄꤹ¤ë¤È¡¢ +PowerPC htab +(¥«¡¼¥Í¥ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë +.I Documentation/powerpc/ppc_htab.txt +»²¾È) ¤ò¡¢¥·¥¹¥Æ¥à¤¬¥¢¥¤¥É¥ë¥ë¡¼¥×¤Ë¤Ê¤ë¤¿¤Ó¤ËÀÚ¤êµÍ¤á¤ë¡£ +.TP +.I /proc/sys/kernel/l2cr +(PowerPC ¤Î¤ß) ¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï G3 ¥×¥í¥»¥Ã¥µ¥Ü¡¼¥É¤Î +L2 ¥­¥ã¥Ã¥·¥å¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤ë¡£ +0 ¤Î¾ì¹ç¡¢¥­¥ã¥Ã¥·¥å¤Ï̵¸ú¤Ë¤Ê¤ë¡£ +0 °Ê³°¤Î¾ì¹ç¤ÏÍ­¸ú¤Ë¤Ê¤ë¡£ +.TP +.I /proc/sys/kernel/modprobe +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¥í¡¼¥À¤Ø¤Î¥Ñ¥¹¤¬´Þ¤Þ¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï +.I /sbin/modprobe +¤Ç¤¢¤ë¡£¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢ +.B CONFIG_KMOD +¥ª¥×¥·¥ç¥ó¤òÍ­¸ú¤Ë¤·¤Æ¥«¡¼¥Í¥ë¤¬ºîÀ®¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ß¸ºß¤¹¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥«¡¼¥Í¥ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë +.I Documentation/kmod.txt +(¥«¡¼¥Í¥ë 2.4 °ÊÁ°¤Î¤ß¤Ë¸ºß) ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /proc/sys/kernel/msgmax +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢System V ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ë½ñ¤­¹þ¤Þ¤ì¤ë 1 ¤Ä¤Î¥á¥Ã¥»¡¼¥¸¤Î +ºÇÂç¥Ð¥¤¥È¿ô¤ò¡¢¥·¥¹¥Æ¥àÁ´ÂΤÇÀ©¸Â¤¹¤ë¡£ +.TP +.I /proc/sys/kernel/msgmni +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¼±Ê̻ҤκÇÂç¿ô¤ò¥·¥¹¥Æ¥àÁ´ÂΤÇÀ©¸Â¤¹¤ë¡£ +(¤³¤Î¥Õ¥¡¥¤¥ë¤Ï Linux 2.4 °Ê¹ß¤Ë¤·¤«Â¸ºß¤·¤Ê¤¤)¡£ +.TP +.I /proc/sys/kernel/msgmnb +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢ +.I msg_qbytes +¤ÎÀßÄê¤ò½é´ü²½¤¹¤ë¥·¥¹¥Æ¥àÁ´ÂΤΥѥé¥á¡¼¥¿¤Ç¤¢¤ë¡£ +.I msg_qbytes +¤Ï°Ê¹ß¤ÇºîÀ®¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ç»È¤ï¤ì¤ë¡£ +.I msg_qbytes +ÀßÄê¤Ç¤Ï¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ë½ñ¤­¹þ¤Þ¤ì¤ëºÇÂç¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£ +.TP +.IR /proc/sys/kernel/ostype " ¤È " /proc/sys/kernel/osrelease +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ïʸ»úÎó +.I /proc/version +¤Î³ÆÉôʬ¤òÍ¿¤¨¤ë¡£ +.TP +.IR /proc/sys/kernel/overflowgid " ¤È " /proc/sys/kernel/overflowuid +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï +.I /proc/sys/fs/overflowgid +¤È +.I /proc/sys/fs/overflowuid +¤òÊ£À½¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.I /proc/sys/kernel/panic +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥«¡¼¥Í¥ëÊÑ¿ô +.I panic_timeout +¤Ø¤ÎÆɤ߽Ф·¤È½ñ¤­¹þ¤ß¤Î¥¢¥¯¥»¥¹¤òÍ¿¤¨¤ë¡£ +¤³¤ÎÃͤ¬ 0 ¤Ê¤é¤Ð¡¢¥Ñ¥Ë¥Ã¥¯»þ¤Ë¥«¡¼¥Í¥ë¤Ï (̵¸Â) ¥ë¡¼¥×¤ËÆþ¤ë¡£ +0 ¤Ç¤Ê¤±¤ì¤Ð¡¢¤½¤ÎÉÿô¤À¤±ÂԤäƤ«¤é¼«Æ°Åª¤ËºÆµ¯Æ°¤¹¤ë¡£ +¥½¥Õ¥È¥¦¥§¥¢ watchdog ¥É¥é¥¤¥Ð¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¿ä¾©¤µ¤ì¤ëÀßÄê¤Ï 60 ¤Ç¤¢¤ë¡£ +.TP +.IR /proc/sys/kernel/panic_on_oops " (Linux 2.5.68 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢oops ¤ä BUG ¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Î¥«¡¼¥Í¥ë¤ÎÆ°ºî¤òÀ©¸æ¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤Ë 0 ¤¬½ñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥·¥¹¥Æ¥à¤ÏÁàºî¤ò³¹Ô¤·¤è¤¦¤È¤¹¤ë¡£ +1 ¤¬½ñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥·¥¹¥Æ¥à¤Ï +(klogd ¤¬ oops ½ÐÎϤòµ­Ï¿¤¹¤ë»þ´Ö¤òÍ¿¤¨¤ë¤¿¤á¤Ë) ¿ôÉôÖÃٱ䤷¤¿¸å¡¢ +panic ¤òµ¯¤³¤¹¡£ +.I /proc/sys/kernel/panic +¥Õ¥¡¥¤¥ë¤â 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢¥Þ¥·¥ó¤ÏºÆµ¯Æ°¤µ¤ì¤ë¡£ +.TP +.IR /proc/sys/kernel/pid_max " (Linux 2.5.34 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢PID ¤ò¤¤¤¯¤Ä¤Ç½ªÎ»¤Ë¤¹¤ë¤«¤ò»ØÄꤹ¤ë +(¤¹¤Ê¤ï¤Á¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÃͤϺÇÂç PID ¤è¤ê 1 Â礭¤¤)¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 32768 ¤Ç¤¢¤ê¡¢ +¤½¤Î¾ì¹ç¤Ë¤Ï°ÊÁ°¤Î¥«¡¼¥Í¥ë¤ÈƱ¤¸ PID ¤ÎÈϰϤˤʤ롣 +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 +.IR /proc/sys/kernel/powersave-nap " (PowerPC ¤Î¤ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¥Õ¥é¥°¤¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤ë¤È¡¢Linux-PPC ¤Ï +¾ÊÅÅÎϤΠ"nap" ¥â¡¼¥É¤ò»È¤¦¡£ +ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢"doze" ¥â¡¼¥É¤¬»È¤ï¤ì¤ë¡£ +.TP +.I /proc/sys/kernel/printk +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë 4 ¤Ä¤ÎÃͤϡ¢ +.IR console_loglevel , +.IR default_message_loglevel , +.IR minimum_console_loglevel , +.IR default_console_loglevel +¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤ÎÃͤϥ¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤¿¤êµ­Ï¿¤·¤¿¤ê¤¹¤ë +.I printk() +¤ÎÆ°ºî¤Ë±Æ¶Á¤¹¤ë¡£ +³Æ loglevel ¤Î¾ðÊó¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR syslog (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +Í¥ÀèÅÙ¤¬ +.I console_loglevel +°Ê¾å¤Î¥á¥Ã¥»¡¼¥¸¤Ï¡¢¥³¥ó¥½¡¼¥ë¤Ëɽ¼¨¤µ¤ì¤ë¡£ +Í¥ÀèÅÙ¤¬ÌÀ¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¥á¥Ã¥»¡¼¥¸¤Ï¡¢Í¥ÀèÅÙ¤¬ +.I default_message_level +¤Î¤È¤­¤Ëɽ¼¨¤µ¤ì¤ë¡£ +.I minimum_console_loglevel +¤Ï +.I console_loglevel +¤ËÀßÄê¤Ç¤­¤ëºÇ¾® (ºÇ¹â) ¤ÎÃͤǤ¢¤ë¡£ +.I default_console_loglevel +¤Ï +.I console_loglevel +¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÃͤǤ¢¤ë¡£ +.TP +.IR /proc/sys/kernel/pty " (Linux 2.6.4 °Ê¹ß)" +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢Unix 98 µ¿»÷üËö +.RB ( pts (4) +¤ò»²¾È) ¤Î¿ô¤Ë´ØÏ¢¤¹¤ë 2 ¤Ä¤Î¥Õ¥¡¥¤¥ë¤ò´Þ¤à¡£ +.TP +.I /proc/sys/kernel/pty/max +¤³¤Î¥Õ¥¡¥¤¥ë¤Ïµ¿»÷üËö¤ÎºÇÂç¿ô¤òÄêµÁ¤¹¤ë¡£ +.TP +.I /proc/sys/kernel/pty/nr +¤³¤ÎÆɤ߽Ф·ÀìÍѤΥե¡¥¤¥ë¤Ï¡¢¸½ºß¤¤¤¯¤Ä¤Îµ¿»÷üËö¤¬»È¤ï¤ì¤Æ¤¤¤ë¤«¤òɽ¤¹¡£ +.TP +.I /proc/sys/kernel/random +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢¥Õ¥¡¥¤¥ë +.I /dev/random +¤ÎÁàºî¤òÀ©¸æ¤¹¤ëÍÍ¡¹¤Ê¥Ñ¥é¥á¡¼¥¿¤¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¾ÜºÙ¤Ï +.BR random (4) +¤ò»²¾È¡£ +.TP +.I /proc/sys/kernel/real-root-dev +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥«¡¼¥Í¥ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë +.I Documentation/initrd.txt +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.IR /proc/sys/kernel/reboot-cmd " (Sparc ¤Î¤ß) " +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï SPARC ROM/Flash ¥Ö¡¼¥È¥í¡¼¥À¤Ë°ú¤­¿ô¤òÅϤ¹ÊýË¡¤ò +Ä󶡤·¤Æ¤¤¤ë¤è¤¦¤Ë»×¤ï¤ì¤ë¡£ +ºÆµ¯Æ°¸å¤Ë²¿¤ò¤¹¤ë¤«¤ò»ØÄꤷ¤Æ¤¤¤ë¤Î¤À¤í¤¦¤«¡© +.TP +.I /proc/sys/kernel/rtsig-max +(2.6.7 ¤Þ¤Ç¤Î¥«¡¼¥Í¥ë¤Ë¤Î¤ß¸ºß¤¹¤ë¡£ +.BR setrlimit (2) +¤ò»²¾È¤¹¤ë¤³¤È) +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥·¥¹¥Æ¥à¤Çȯ¹Ô¤µ¤ì¤ë POSIX real-time (queued) signal ¤Î +ºÇÂç¿ô¤òÄ´À°¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +.TP +.I /proc/sys/kernel/rtsig-nr +(2.6.7 ¤Þ¤Ç¤Î¥«¡¼¥Í¥ë¤Ë¤Î¤ß¸ºß¤¹¤ë) +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¸½ºß¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë POSIX real-time signal ¤Î¿ô¤òɽ¤¹¡£ +.TP +.IR /proc/sys/kernel/sem " (Linux 2.4 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï System V IPC ¥»¥Þ¥Õ¥©¤òÀ©¸Â¤¹¤ë 4 ¤Ä¤ÎÃͤ¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï¼¡¤Î½çÈÖ¤Ëʤó¤Ç¤¤¤ë: +.RS +.IP SEMMSL 8 +¥»¥Þ¥Õ¥©½¸¹ç¤´¤È¤Î¥»¥Þ¥Õ¥©¿ô¤ÎºÇÂçÃÍ¡£ +.IP SEMMNS 8 +¥·¥¹¥Æ¥àÁ´ÂΤǤΡ¢Á´¤Æ¤Î¥»¥Þ¥Õ¥©½¸¹ç¤Ë¤ª¤±¤ë¥»¥Þ¥Õ¥©¿ô¤ÎÀ©¸Â¡£ +.IP SEMOPM 8 +.BR semop (2) +¥³¡¼¥ë¤Ë»ØÄꤵ¤ì¤ë¥ª¥Ú¥ì¡¼¥·¥ç¥ó¿ô¤ÎºÇÂçÃÍ¡£ +.IP SEMMNI 8 +¥·¥¹¥Æ¥àÁ´ÂΤǤΥ»¥Þ¥Õ¥©¼±Ê̻ҤκÇÂçÃÍ¡£ +.RE +.TP +.I /proc/sys/kernel/sg-big-buff +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢ÈÆÍÑ SCSI ¥Ç¥Ð¥¤¥¹ (sg) ¤Î¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ÎºÇÂçÃͤòɽ¤¹¡£ +º£¤Ï¤³¤ì¤òÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¤¬¡¢ +¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.I include/scsi/sg.h +¤òÊÔ½¸¤·¤Æ +.B SG_BIG_BUFF +¤ÎÃͤòÊѤ¨¤ì¤ÐÊѹ¹¤Ç¤­¤ë¡£ +¤¿¤À¤·¡¢¤³¤ÎÃͤòÊѹ¹¤¹¤ëÍýͳ¤Ï¤Ê¤¤¤À¤í¤¦¡£ +.TP +.I /proc/sys/kernel/shmall +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï System V ¶¦Í­¥á¥â¥ê¤ÎÁí¥Ú¡¼¥¸¿ô¤Î +¥·¥¹¥Æ¥àÁ´ÂΤǤÎÀ©¸Â¤¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.I /proc/sys/kernel/shmmax +¤³¤Î¥Õ¥¡¥¤¥ë¤òÄ̤¸¤Æ¡¢(System V IPC) ¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤òºîÀ®¤¹¤ë¤È¤­¤Î +ºÇÂ祵¥¤¥º¤Î¼Â¹Ô»þ¾å¸Â (run-time limit) ¤ò¼èÆÀ¤Þ¤¿¤ÏÀßÄê¤Ç¤­¤ë¡£ +¸½ºß¤Ï 1GB ¤Þ¤Ç¤Î¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤¬ +¥«¡¼¥Í¥ë¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ÎÃͤΥǥե©¥ë¥È¤Ï +.B SHMMAX +¤Ç¤¢¤ë¡£ +.TP +.I /proc/sys/kernel/shmmni +(Linux 2.4 °Ê¹ß¤Ç»ÈÍѲÄǽ) +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¥·¥¹¥Æ¥àÁ´ÂΤǺîÀ®²Äǽ¤Ê +System V ¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¿ô¤ò»ØÄꤹ¤ë¡£ +.TP +.I /proc/sys/kernel/sysrq +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢SysRq ¥­¡¼¤Ë¤è¤êµ¯Æ°¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë´Ø¿ô·²¤òÀ©¸æ¤¹¤ë +¤â¤Î¤Ç¤¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤Ï 1 ¤Ç¤¢¤ê¡¢ +¤³¤ì¤Ïµ¯¤³¤êÆÀ¤ëÁ´¤Æ¤Î SysRq ¥ê¥¯¥¨¥¹¥È¤¬µö²Ä¤µ¤ì¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë +(¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢SysRq ¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï̵¸ú¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +¼Â¹Ô»þ¤ËÌÀ¼¨Åª¤ËÍ­¸ú¤Ë¤¹¤ëɬÍפ¬¤¢¤Ã¤¿¤¬¡¢º£¤Ï¤½¤¦¤Ç¤Ï¤Ê¤¤)¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ç»ØÄê²Äǽ¤ÊÃͤϰʲ¼¤ÎÄ̤ꡣ + + 0 - sysrq ¤ò´°Á´¤Ë̵¸ú¤Ë¤¹¤ë + 1 - sysrq ¤ÎÁ´¤Æ¤Î´Ø¿ô¤òÍ­¸ú¤Ë¤¹¤ë + >1 - µö²Ä¤¹¤ë sysrq ´Ø¿ô¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¡£ÆâÌõ¤Ï°Ê²¼¤ÎÄ̤ꡣ + 2 - ¥³¥ó¥½¡¼¥ë¤Î¥í¥°¡¦¥ì¥Ù¥ë¤ÎÀ©¸æ¤òÍ­¸ú¤Ë¤¹¤ë + 4 - ¥­¡¼¥Ü¡¼¥É¤ÎÀ©¸æ¤òÍ­¸ú¤Ë¤¹¤ë (SAK, unraw) + 8 - ¥×¥í¥»¥¹¤Ê¤É¤Î¥Ç¥Ð¥Ã¥°¡¦¥À¥ó¥×¤òÍ­¸ú¤Ë¤¹¤ë + 16 - sync ¥³¥Þ¥ó¥É¤òÍ­¸ú¤Ë¤¹¤ë + 32 - Æɤ߽Ф·ÀìÍѤǤκƥޥ¦¥ó¥È¤òÍ­¸ú¤Ë¤¹¤ë + 64 - ¥×¥í¥»¥¹¤Ø¤Î¥·¥°¥Ê¥ëȯ¹Ô¤òÍ­¸ú¤Ë¤¹¤ë (term, kill, oom-kill) + 128 - ¥ê¥Ö¡¼¥È/ÅŸ»¥ª¥Õ¤òµö²Ä¤¹¤ë + 256 - Á´¤Æ¤Î¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¿¥¹¥¯¤Î nice ÃͤÎÊѹ¹¤òµö²Ä¤¹¤ë + +¥«¡¼¥Í¥ëÀßÄꥪ¥×¥·¥ç¥ó +.B CONFIG_MAGIC_SYSRQ +¤¬Í­¸ú¤Ê¾ì¹ç¤Î¤ß¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¸ºß¤¹¤ë¡£ +¾ÜºÙ¤Ï¡¢¥«¡¼¥Í¥ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë +.I Documentation/sysrq.txt +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.I /proc/sys/kernel/version +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Êʸ»úÎ󤬽ñ¤«¤ì¤Æ¤¤¤ë: + + #5 Wed Feb 25 21:49:24 MET 1998 + +\&"#5" ¤Ï¤³¤Î¥½¡¼¥¹¤Ç¹½ÃÛ¤µ¤ì¤¿ 5 ÈÖÌܤΥ«¡¼¥Í¥ë¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¤½¤Î¸å¤Ë¤¢¤ëÆüÉդϥ«¡¼¥Í¥ë¤¬¹½ÃÛ¤µ¤ì¤¿»þ¹ï¤òɽ¤¹¡£ +.TP +.IR /proc/sys/kernel/threads-max " (Linux 2.3.11 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¥·¥¹¥Æ¥àÁ´ÂΤǺîÀ®²Äǽ¤Ê¥¹¥ì¥Ã¥É¿ô +(¥¿¥¹¥¯¿ô) ¤Î¾å¸Â¤ò»ØÄꤹ¤ë¡£ +.TP +.IR /proc/sys/kernel/zero-paged " (PowerPC ¤Î¤ß) " +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥Õ¥é¥°¤ò´Þ¤à¡£ +(0 °Ê³°¤ÎÃͤÇ) Í­¸ú¤µ¤ì¤¿¾ì¹ç¡¢Linux-PPC ¤Ï¥¢¥¤¥É¥ë¥ë¡¼¥×¤Ç +pre-zero page ¤ò¹Ô¤¦¤Î¤Ç¡¢get_free_pages ¤Î®ÅÙ¤¬¸þ¾å¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.I /proc/sys/net +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¥Í¥Ã¥È¥ï¡¼¥¯´Ø·¸¤Î¾ðÊó¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤Î¤¤¤¯¤Ä¤«¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR tcp (7) +¤ä +.BR ip (7) +¤ËÀâÌÀ¤¬¤¢¤ë¡£ +.TP +.I /proc/sys/net/core/somaxconn +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï +.BR listen (2) +¤Î +.I backlog +°ú¤­¿ô¤Î¾å¸ÂÃͤòµ¬Äꤹ¤ë¡£ +¾ÜºÙ¤Ï +.BR listen (2) +¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¡£ +.TP +.I /proc/sys/proc +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¤¿¤Ö¤ó¶õ¤Ç¤¢¤ë¡£ +.TP +.I /proc/sys/sunrpc +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à (NFS) ¤Ø¤Î +Sun remote procedure call (±ó³Ö¼ê³¤­¸Æ¤Ó½Ð¤·) ¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +¤³¤ì¤¬Â¸ºß¤·¤Ê¤¤¥·¥¹¥Æ¥à¤â¤¢¤ë¡£ +.TP +.I /proc/sys/vm +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¥á¥â¥ê´ÉÍý¤ÎÄ´À°¡¢¥Ð¥Ã¥Õ¥¡¤ä¥­¥ã¥Ã¥·¥å´ÉÍý¤Î¤¿¤á¤Î +¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¡£ +.TP +.IR /proc/sys/vm/drop_caches " (Linux 2.6.16 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤³¤È¤Ç¡¢¥¯¥ê¡¼¥ó¤Ê¥­¥ã¥Ã¥·¥å¡¢dentry¡¢ +inode ¤ò¥á¥â¥ê¾å¤«¤é³°¤·¡¢¤½¤Î¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£ + +¥Ú¡¼¥¸¥­¥ã¥Ã¥·¥å¤ò²òÊü¤¹¤ë¤Ë¤Ï¡¢ +.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" +¤È¤¹¤ë¡£ + +¤³¤ÎÁàºî¤ÏÈóÇ˲õŪ¤ÊÁàºî¤Ç¡¢¥À¡¼¥Æ¥£¤Ê (dirty) ¥ª¥Ö¥¸¥§¥¯¥È¤Ï +²òÊü¤µ¤ì¤Ê¤¤¤Î¤Ç¡¢¤³¤ÎÁàºî¤ò¹Ô¤¦ºÝ¤ÏºÇ½é¤Ë +.BR sync (8) +¤ò¼Â¹Ô¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.IR /proc/sys/vm/swappiness +.\" The following is from Documentation/sysctl/vm.txt +¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÃͤˤè¤ê¡¢¥«¡¼¥Í¥ë¤¬¤É¤ÎÄøÅٷ㤷¤¯¥á¥â¥ê¥Ú¡¼¥¸¤Î +¥¹¥ï¥Ã¥×¤ò¹Ô¤¦¤«¤¬À©¸æ¤µ¤ì¤ë¡£ +Â礭¤ÊÃͤۤɥ¹¥ï¥Ã¥×¤¬·ã¤·¤¯¤Ê¤ê¡¢¾®¤µ¤¤Ãͤۤɷ㤷¤¯¤Ê¤¯¤Ê¤ë¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 60 ¤Ç¤¢¤ë¡£ +.TP +.IR /proc/sys/vm/legacy_va_layout " (Linux 2.6.9 °Ê¹ß)" +.\" °Ê²¼¤Îµ­½Ò¤Ï Documentation/filesystems/proc.txt ¤«¤é¤Î°úÍѤǤ¢¤ë¡£ +0 °Ê³°¤Î¾ì¹ç¡¢¿·¤·¤¤ 32¥Ó¥Ã¥È¥á¥â¥ê¥Þ¥Ã¥Ô¥ó¥°ÇÛÃÖ¤¬Ìµ¸ú¤Ë¤Ê¤ê¡¢ +¥«¡¼¥Í¥ë¤ÏÁ´¤Æ¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ½¾Íè¤Î (¥«¡¼¥Í¥ë 2.4 ¤Î) ÇÛÃÖÊýË¡¤ò +»ÈÍѤ¹¤ë¡£ +.TP +.IR /proc/sys/vm/oom_dump_tasks " (Linux 2.6.25 °Ê¹ß)" +.\" The following is from Documentation/sysctl/vm.txt +¥«¡¼¥Í¥ë¤¬ OOM-killing ¤ò¼Â¹Ô¤¹¤ëºÝ¤Ë¡¢¥·¥¹¥Æ¥àÁ´ÂΤΥ¿¥¹¥¯¡¦¥À¥ó¥× +(¥«¡¼¥Í¥ë¥¹¥ì¥Ã¥É¤ò½ü¤¯) ¤òÀ¸À®¤¹¤ë¤«¤òÀ©¸æ¤¹¤ë¡£ +¥À¥ó¥×¤Ë¤Ï¡¢¥¿¥¹¥¯ (¥¹¥ì¥Ã¥É¡¢¥×¥í¥»¥¹) Ëè¤Ë°Ê²¼¤Î¾ðÊ󤬽ÐÎϤµ¤ì¤ë: +¥¹¥ì¥Ã¥É ID¡¢¼Â¥æ¡¼¥¶ ID¡¢¥¹¥ì¥Ã¥É¥°¥ë¡¼¥× ID (¥×¥í¥»¥¹ ID)¡¢ +²¾ÁÛ¥á¥â¥ê¥µ¥¤¥º¡¢Resident Set Size (¼Â¥á¥â¥ê¾å¤Ë¸ºß¤¹¤ë¥Ú¡¼¥¸¥µ¥¤¥º)¡¢ +¥¿¥¹¥¯¤¬¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤¿ CPU¡¢ +oom_adj ¥¹¥³¥¢ +.RI ( /proc/[pid]/oom_adj +¤ÎÀâÌÀ¤ò»²¾È)¡¢¥³¥Þ¥ó¥É̾¡£ +¤³¤Î¥À¥ó¥×¾ðÊó¤Ï¡¢¤Ê¤¼ OOM-killer ¤¬µ¯Æ°¤µ¤ì¤¿¤«¤òÃΤꡢ +¤½¤Î¸¶°ø¤È¤Ê¤Ã¤¿¤Ê¤é¤º¼Ô¤Î¥¿¥¹¥¯¤òÆÃÄꤹ¤ë¤Î¤ËÌò¤ËΩ¤Ä¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍƤ¬ÃÍ 0 ¤Î¾ì¹ç¡¢¥À¥ó¥×¾ðÊó¤Î½ÐÎϤϹԤï¤ì¤Ê¤¤¡£ +¥¿¥¹¥¯¤¬²¿Àé¤â¤¢¤ëÈó¾ï¤ËµðÂç¤Ê¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +³Æ¡¹¤Î¥¿¥¹¥¯¤Ë¤Ä¤¤¤Æ¥á¥â¥ê¾õÂÖ¤ò¥À¥ó¥×¤¹¤ë¤Î¤ÏŬÀڤǤʤ¤¤«¤â¤·¤ì¤Ê¤¤¡£ +¤½¤Î¤è¤¦¤Ê¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥À¥ó¥×¾ðÊó¤¬É¬ÍפǤâ¤Ê¤¤¤È¤­¤Ë +¥á¥â¥êÉÔ­ (OOM) ¤Î¾õ¶·¤ÇÀ­Ç½Ì̤ÎÉÔÍø±×¤¬µ¯¤³¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤À¤í¤¦¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍƤ¬ 0 °Ê³°¤Î¾ì¹ç¡¢ +OOM-killer ¤¬¼ÂºÝ¤Ë¥á¥â¥ê¤òÀêÍ­¤·¤¿¥¿¥¹¥¯¤ò kill ¤¹¤ëÅÙ¤Ë +¥À¥ó¥×¾ðÊ󤬽ÐÎϤµ¤ì¤ë¡£ + +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 0 ¤Ç¤¢¤ë¡£ +.TP +.IR /proc/sys/vm/oom_kill_allocating_task " (Linux 2.6.24 °Ê¹ß)" +.\" The following is from Documentation/sysctl/vm.txt +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¥á¥â¥êÉÔ­ (OOM) ¤Î¾õ¶·¤¬µ¯¤³¤Ã¤¿ºÝ¤Ë¡¢ +¥á¥â¥êÉÔ­¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¥¿¥¹¥¯¤ò kill ¤¹¤ë¤«¤É¤¦¤«¤òÀ©¸æ¤¹¤ë¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤¬ 0 ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +OOM-killer ¤Ï¥¿¥¹¥¯¥ê¥¹¥ÈÁ´ÂΤò¥¹¥­¥ã¥ó¤·¡¢·Ð¸³Â§¤Ë´ð¤Å¤­ +kill ¤¹¤ë¥¿¥¹¥¯¤òÁªÂò¤¹¤ë¡£ +Ä̾ï¤Ï¡¢kill ¤·¤¿¾ì¹ç¤Ë¿¤¯¤Î¥á¥â¥ê¤¬²òÊü¤Ç¤­¤ë¡¢ +¤Ê¤é¤º¼Ô¤Î¥á¥â¥êÀêÍ­¥¿¥¹¥¯¤¬ÁªÂò¤µ¤ì¤ë¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤¬ 0 °Ê³°¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢ +OOM-killer ¤Ï¥á¥â¥êÉÔ­¤Î¾õ¶·¤¬È¯À¸¤¹¤ë¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿¥¿¥¹¥¯¤ò +ñ½ã¤Ë kill ¤¹¤ë¤À¤±¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¤¿¤¤¤Æ¤¤¤Ï½Å¤¤½èÍý¤È¤Ê¤ë¥¿¥¹¥¯¥ê¥¹¥È¤Î¥¹¥­¥ã¥ó¤ò²óÈò¤Ç¤­¤ë¡£ + +.I /proc/sys/vm/panic_on_oom +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢ +.I /proc/sys/vm/oom_kill_allocating_task +¤Ë¤É¤Î¤è¤¦¤ÊÃͤ¬Æþ¤Ã¤Æ¤¤¤¿¤È¤·¤Æ¤â¡¢ +.I /proc/sys/vm/panic_on_oom +¤ÎÊý¤¬Í¥À褵¤ì¤ë¡£ + +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 0 ¤Ç¤¢¤ë¡£ +.TP +.I /proc/sys/vm/overcommit_memory +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¥«¡¼¥Í¥ë²¾ÁÛ¥á¥â¥ê¤Î¥¢¥«¥¦¥ó¥È¥â¡¼¥É¤¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +Ãͤϰʲ¼¤ÎÄ̤ê: +.RS +.IP +0: ȯ¸«Åª¤Ê¥ª¡¼¥Ð¡¼¥³¥ß¥Ã¥È (heuristic overcommit) (¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤Ç¤¢¤ë) +.br +1: ¾ï¤Ë¥ª¡¼¥Ð¡¼¥³¥ß¥Ã¥È¤·¡¢¥Á¥§¥Ã¥¯¤·¤Ê¤¤¡£ +.br +2: ¾ï¤Ë¥Á¥§¥Ã¥¯¤·¡¢¥ª¡¼¥Ð¡¼¥³¥ß¥Ã¥È¤·¤Ê¤¤¡£ +.RE +.IP +¥â¡¼¥É 0 ¤Ç¤Ï¡¢ +.B MAP_NORESERVE +¤òÀßÄꤷ¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿ +.BR mmap (2) +¤Ï¥Á¥§¥Ã¥¯¤µ¤ì¤Ê¤¤¡£ +¤Þ¤¿¥Ç¥Õ¥©¥ë¥È¤Î¥Á¥§¥Ã¥¯¤Ï¤È¤Æ¤âÀȼå¤Ç¡¢ +¥×¥í¥»¥¹¤ò "OOM-kill" ¤·¤Æ¤·¤Þ¤¦¥ê¥¹¥¯¤ò°ú¤­µ¯¤³¤¹¡£ +Linux 2.4 ¤Ç¤Ï 0 °Ê³°¤ÎÃͤϥ⡼¥É 1 ¤ò°ÕÌ£¤¹¤ë¡£ +(Linux 2.6 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ê) ¥â¡¼¥É 2 ¤Ç¤Ï¡¢ +¥·¥¹¥Æ¥à¾å¤Î²¾ÁÛ¥¢¥É¥ì¥¹¶õ´Ö¤Î¹ç·×¤¬ (SS + RAM*(r/100)) ¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤³¤Ç¡¢SS ¤Ï¥¹¥ï¥Ã¥×¶õ´Ö¤Î¥µ¥¤¥º¡¢ +RAM ¤ÏʪÍý¥á¥â¥ê¤Î¥µ¥¤¥º¡¢r ¤Ï¥Õ¥¡¥¤¥ë +.I /proc/sys/vm/overcommit_ratio +¤ÎÆâÍƤǤ¢¤ë¡£ +.TP +.I /proc/sys/vm/overcommit_ratio +.I /proc/sys/vm/overcommit_memory +¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.IR /proc/sys/vm/panic_on_oom " (Linux 2.6.18 °Ê¹ß)" +.\" The following is adapted from Documentation/sysctl/vm.txt +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¥á¥â¥êÉÔ­»þ¤Ë¥«¡¼¥Í¥ë¥Ñ¥Ë¥Ã¥¯¤ò +µ¯¤³¤¹¤«µ¯¤³¤µ¤Ê¤¤¤«¤òÀ©¸æ¤¹¤ë¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤ËÃÍ 0 ¤òÀßÄꤹ¤ë¤È¡¢ +¥«¡¼¥Í¥ë¤Î OOM-killer ¤¬¤Ê¤é¤º¼Ô¤Î¥×¥í¥»¥¹¤ò kill ¤¹¤ë¡£ +ÉáÄ̤ϡ¢OOM-killer ¤¬¤Ê¤é¤º¼Ô¤Î¥×¥í¥»¥¹¤ò kill ¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢ +¥·¥¹¥Æ¥à¤Ï²¿¤È¤«Æ°¤­Â³¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤ËÃÍ 1 ¤òÀßÄꤹ¤ë¤È¡¢ +¥á¥â¥êÉÔ­¤Î¾õ¶·¤¬È¯À¸¤¹¤ë¤È¡¢¥«¡¼¥Í¥ë¤ÏÉáÄ̤ϥѥ˥寤¹¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¥×¥í¥»¥¹¤¬ +¥á¥â¥ê¥Ý¥ê¥·¡¼ +.RB ( mbind (2) +¤Î +.BR MPOL_BIND ) +¤ä cpusets +.RB ( cpuset (7)) +¤ò»È¤Ã¤ÆÆÃÄê¤Î¥Î¡¼¥É¤Ø¤Î¥á¥â¥ê³ä¤êÅö¤Æ¤òÀ©¸Â¤·¤Æ¤¤¤Æ¡¢ +¤½¤ì¤é¤Î¥Î¡¼¥É¤Ç¥á¥â¥ê¸Ï³é¾õÂ֤˻ê¤Ã¤¿¾ì¹ç¤Ï¡¢ +°ì¤Ä¤Î¥×¥í¥»¥¹¤¬ OOM-killer ¤Ë¤è¤ê kill ¤µ¤ì¤ë¤À¤±¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î¾ì¹ç¤Ë¤Ï¡¢¥«¡¼¥Í¥ë¥Ñ¥Ë¥Ã¥¯¤ÏȯÀ¸¤·¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢Â¾¤Î¥Î¡¼¥É¤Î¥á¥â¥ê¤Ë¤Ï¶õ¤­¤¬¤¢¤ë¤«¤â¤·¤ì¤º¡¢ +¤·¤¿¤¬¤Ã¤Æ¡¢¥·¥¹¥Æ¥àÁ´ÂΤȤ·¤Æ¤Ï¥á¥â¥êÉÔ­¤Î¾õ¶·¤Ë¤Þ¤À㤷¤Æ¤¤¤Ê¤¤¤«¤â +¤·¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤ËÃÍ 2 ¤òÀßÄꤹ¤ë¤È¡¢ +¥á¥â¥êÉÔ­¤Î¾õ¶·¤¬È¯À¸¤¹¤ë¤È¥«¡¼¥Í¥ë¤Ï¾ï¤Ë¥Ñ¥Ë¥Ã¥¯¤òµ¯¤³¤¹¡£ + +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 0 ¤Ç¤¢¤ë¡£ +1 ¤È 2 ¤Ï¥¯¥é¥¹¥¿¥ê¥ó¥°¤Î¥Õ¥§¥¤¥ë¥ª¡¼¥Ð¡¼ÍѤǤ¢¤ë¡£ +¥Õ¥§¥¤¥ë¥ª¡¼¥Ð¡¼¤ÎÊý¿Ë¤Ë±þ¤¸¤Æ¤É¤Á¤é¤«¤ÎÃͤòÁªÂò¤¹¤ë¤³¤È¡£ +.TP +.IR /proc/sysrq-trigger " (Linux 2.4.21 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ëʸ»ú character ¤ò½ñ¤­¹þ¤à¤È¡¢ +¥­¡¼¥Ü¡¼¥É¤«¤é ALT-SysRq- ¤òÆþÎϤ·¤¿¾ì¹ç¤È +Ʊ¤¸ SysRq ´Ø¿ô¤¬µ¯Æ°¤µ¤ì¤ë +.RI ( /proc/sys/kernel/sysrq +¤ÎÀâÌÀ¤ò»²¾È)¡£ +Ä̾¤³¤Î¥Õ¥¡¥¤¥ë¤Ø½ñ¤­¹þ¤ß¤¬¤Ç¤­¤ë¤Î¤Ï +.I root +¤À¤±¤Ç¤¢¤ë¡£¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥«¡¼¥Í¥ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Î +.I Documentation/sysrq.txt +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.I /proc/sysvipc +µ¿»÷¥Õ¥¡¥¤¥ë +.IR msg ", " sem ", " shm +¤ò´Þ¤à¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¸½ºß¥·¥¹¥Æ¥à¾å¤Ë¸ºß¤¹¤ë +System V ¥×¥í¥»¥¹´ÖÄÌ¿® (Interprocess Communication, IPC) ¥ª¥Ö¥¸¥§¥¯¥È +(¤½¤ì¤¾¤ì: ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¡¢¥»¥Þ¥Õ¥©¡¢¶¦Í­¥á¥â¥ê) +¤Î¥ê¥¹¥È¤Ç¤¢¤ê¡¢ +.BR ipcs (1) +¤Ç¼èÆÀ¤Ç¤­¤ë¾ðÊó¤ÈƱ¤¸¤â¤Î¤òÄ󶡤¹¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¥Ø¥Ã¥À¤¬¤¢¤ê¡¢Íý²ò¤·¤ä¤¹¤¤¤è¤¦¤Ë +(1 ¹Ô¤Ë¤Ä¤­ 1 ¸Ä¤Î IPC ¥ª¥Ö¥¸¥§¥¯¥È¤Î·Á¼°¤Ç) ¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.BR svipc (7) +¤Ë¤Ï¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤«¤éʬ¤«¤ë¾ðÊó¤Î¾ÜºÙ¤ÊÇطʤ¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.I /proc/tty +µ¿»÷¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¡£ +tty ¥É¥é¥¤¥Ð¤È¥é¥¤¥óÀßÄê (line discipline) ¤Î½ñ¤«¤ì¤¿ +¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤â´Þ¤Þ¤ì¤ë¡£ +.TP +.I /proc/uptime +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï +¥·¥¹¥Æ¥àµ¯Æ°»þ¤«¤é·Ð²á¤·¤¿»þ´Ö (ÉÃ) ¤È +¥¢¥¤¥É¥ë (idle) ¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤¬¾ÃÈñ¤·¤¿»þ´Ö (ÉÃ) ¤Î 2 ¤Ä¤Î¿ô¤ò´Þ¤à¡£ +.TP +.I /proc/version +¸½ºß²ÔƯ¤·¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¼±Ê̻ҤǤ¢¤ëʸ»úÎó¡£ +¤³¤ì¤Ë¤Ï +.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 +.IR /proc/vmstat " (Linux 2.6 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï²¾ÁÛ¥á¥â¥ê¤ÎÍÍ¡¹¤ÊÅý·×¾ðÊó¤òɽ¼¨¤¹¤ë¡£ +.TP +.IR /proc/zoneinfo " (Linux 2.6.13 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥á¥â¥ê¤Î¥¾¡¼¥ó (memory zone) ¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤¹¤ë¡£ +²¾ÁÛ¥á¥â¥ê¤Î¿¶Éñ¤¤¤òʬÀϤ¹¤ë¤Î¤ËÌòΩ¤Ä¡£ +.\" FIXME -- /proc/zoneinfo ¤Ë¤Ä¤¤¤Æ¤â¤Ã¤ÈÀâÌÀ¤¬É¬ÍפÀ +.SH Ãí°Õ +¤Û¤È¤ó¤É¤Îʸ»úÎó (¤¿¤È¤¨¤Ð´Ä¶­ÊÑ¿ô¤ä¥³¥Þ¥ó¥É¹Ô) ¤ÏÆâÉôɽ¸½¤Î¤Þ¤Þ¤Ê¤Î¤Ç¡¢ +³Æ¥Õ¥£¡¼¥ë¥É¤Ï NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤ë¡£ +¤À¤«¤é¡¢\fIod \-c\fP ¤ä \fItr "\\000" "\\n"\fP ¤ò»È¤¨¤Ð¡¢ +¤½¤ì¤é¤Ï¤è¤êÆɤߤ䤹¤¯¤Ê¤ë¡£ +¤Þ¤¿ \fIecho \`cat \`\fP ¤Ç¤â¤è¤¤¡£ + +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤ÏÉÔ´°Á´¤Ç¤¢¤ê¡¢¤¿¤Ö¤óÉÔÀµ³Î¤Ç¡¢¤·¤Ð¤·¤Ð¹¹¿·¤µ¤ì¤ëɬÍפ¬¤¢¤ë¡£ +.\" .SH ¼Õ¼­ +.\" /proc/sys/fs ¤È /proc/sys/kernel ¤Î»ñÎÁ¤Ï¡¢ +.\" Rik van Riel ¤¬½ñ¤¤¤¿¥«¡¼¥Í¥ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Î¥É¥­¥å¥á¥ó¥È¤Ë +.\" Ì©Àܤ˴ð¤Å¤¤¤Æ¤¤¤ë¡£ +.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 +¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë: +.IR Documentation/filesystems/proc.txt , +.IR Documentation/sysctl/vm.txt diff --git a/release/man5/protocols.5 b/release/man5/protocols.5 new file mode 100644 index 00000000..60efe939 --- /dev/null +++ b/release/man5/protocols.5 @@ -0,0 +1,82 @@ +.\" Copyright (c) 1995 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., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\" +.\" 1995-10-18 Martin Schulze +.\" * first released +.\" 2002-09-22 Seth W. Klein +.\" * protocol numbers are now assigned by the IANA +.\" +.\" Japanese Version Copyright (c) 1998 Hiroaki Nagoya all rights reserved. +.\" Translated Wed Feb 4 1998 by Hiroaki Nagoya +.\" Updated Tue Oct 16 2001 by Kentaro Shirakata +.\" +.TH PROTOCOLS 5 2008-09-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +protocols \- ¥×¥í¥È¥³¥ëÄêµÁ¥Õ¥¡¥¤¥ë +.SH ÀâÌÀ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï ASCII ¥Õ¥¡¥¤¥ë¤Ç¡¢TCP/IP ¥µ¥Ö¥·¥¹¥Æ¥à¤«¤éÍøÍѤǤ­¤ë +¤¤¤í¤¤¤í¤Ê DARPA ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥×¥í¥È¥³¥ë¤òµ­½Ò¤·¤Æ¤¤¤ë¡£ +ARPA ´ØÏ¢¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ëÆâ¤Î¿ôÃͤò»È¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¤·¡¢ +ñ¤Ë¿ä¬¤·¤¿Ãͤò»È¤¦¤Î¤Ï¤µ¤é¤ËÎɤ¯¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë¤³¤Î¥Õ¥¡¥¤¥ë¤ËÌ䤤¹ç¤ï¤»¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¿ôÃÍ¤Ï IP ¥Ø¥Ã¥À¤Î¥×¥í¥È¥³¥ë¥Õ¥£¡¼¥ë¥É¤Ë¸½¤ì¤ë¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÊѹ¹¤·¤Ê¤¤¤³¤È¡£Êѹ¹¤¹¤ë¤È IP ¥Ñ¥Ã¥±¡¼¥¸¤¬ÉÔÀµ¤Ë¤Ê¤ë¡£ +¥×¥í¥È¥³¥ëÈÖ¹æ¤È¥×¥í¥È¥³¥ë̾¤Ï +IANA (Internet Assigned Numbers Authority) ¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤ë¡£ +.\" DDN Network Information Center ¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤ë¡£ + +¤½¤ì¤¾¤ì¤Î¹Ô¤Ï¼¡¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤¢¤ë¡£ + +.RS +.I protocol number aliases ... +.RE + +³Æ¥Õ¥£¡¼¥ë¥É¤Ï¶õÇò¤«¥¿¥Ö¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤Æ¡¢¶õ¹Ô¤Ï̵»ë¤µ¤ì¤ë¡£ +¹Ô¤Ë¥Ï¥Ã¥·¥åµ­¹æ(#)¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¡¢ +¥Ï¥Ã¥·¥åµ­¹æ¤ò´Þ¤à¤½¤Î¹Ô¤Î»Ä¤ê¤Ï̵»ë¤µ¤ì¤ë¡£ + +¥Õ¥£¡¼¥ë¥É¤ÎÀâÌÀ¤Ï°Ê²¼¤Î¤È¤ª¤ê¡£ +.TP +.I protocol +¥×¥í¥È¥³¥ë¤Î¸Çͭ̾¡£¤¿¤È¤¨¤Ð +.IR ip , +.IR tcp , +.IR udp +¤Ê¤É¡£ +.TP +.I number +¥×¥í¥È¥³¥ë¤Î¸ø¼°Èֹ桢IP ¥Ø¥Ã¥À¤Ë¸½¤ì¤ë¡£ +.TP +.I aliases +¥×¥í¥È¥³¥ë¤ÎÊÌ̾¡¢¥ª¥×¥·¥ç¥ó¡£ +.LP +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï Yellow Pages/NIS ¤ä BIND/Hesoid ¤Ê¤É¤Î¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î +̾Á°ÉÕ¤±¥µ¡¼¥Ó¥¹¤Ë¤è¤Ã¤Æ¥Í¥Ã¥È¥ï¡¼¥¯¾å¤ÇÇÛÉÛ¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/protocols +¥×¥í¥È¥³¥ëÄêµÁ¥Õ¥¡¥¤¥ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getprotoent (3) + +http://www.iana.org/assignments/protocol-numbers diff --git a/release/man5/resolv.conf.5 b/release/man5/resolv.conf.5 new file mode 100644 index 00000000..d7771e1f --- /dev/null +++ b/release/man5/resolv.conf.5 @@ -0,0 +1,270 @@ +.\" Copyright (c) 1986 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms are permitted +.\" provided that the above copyright notice and this paragraph are +.\" duplicated in all such forms and that any documentation, +.\" advertising materials, and other materials related to such +.\" distribution and use acknowledge that the software was developed +.\" by the University of California, Berkeley. The name of the +.\" University may not be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" @(#)resolver.5 5.9 (Berkeley) 12/14/89 +.\" $Id$ +.\" +.\" Added ndots remark by Bernhard R. Link - debian bug #182886 +.\" +.\" Japanese Version Copyright (c) 2000, 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated 2000-09-15, Yuichi SATO +.\" Updated & Modified 2005-01-22, Yuichi SATO +.\" Updated 2010-04-18, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: resolver ¥ì¥¾¥ë¥Ð +.\"WORD: query Ì䤤¹ç¤ï¤» +.\" +.TH RESOLV.CONF 5 2009-03-01 "" "Linux Programmer's Manual" +.UC 4 +.SH ̾Á° +resolv.conf \- ¥ì¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë +.SH ½ñ¼° +.B /etc/resolv.conf +.SH ÀâÌÀ +.I resolver +¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î¥É¥á¥¤¥ó¥Í¡¼¥à¥·¥¹¥Æ¥à (DNS) ¤Ø¤Î¥¢¥¯¥»¥¹¤òÄ󶡤¹¤ë +C ¥é¥¤¥Ö¥é¥ê¤Î¥ë¡¼¥Á¥ó·²¤Ç¤¢¤ë¡£ +¥ì¥¾¥ë¥ÐÀßÄê¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¥ì¥¾¥ë¥Ð¥ë¡¼¥Á¥ó¤¬¥×¥í¥»¥¹¤Ë¤è¤Ã¤ÆºÇ½é¤Ë +µ¯Æ°¤µ¤ì¤¿¤È¤­¤ËÆɤ߹þ¤Þ¤ì¤ë¾ðÊ󤬳ÊǼ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¿Í´Ö¤Ë²ÄÆɤʤ褦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +¥­¡¼¥ï¡¼¥É¤ÈÃͤΥꥹ¥È¤¬´Þ¤Þ¤ì¡¢¤¤¤í¤¤¤í¤Ê¥¿¥¤¥×¤Î¥ì¥¾¥ë¥Ð¾ðÊó¤òÄ󶡤¹¤ë¡£ +.LP +ÉáÄ̤ËÀßÄꤵ¤ì¤¿¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ÏɬÍפʤ¤¡£ +Ì䤤¹ç¤ï¤»¤ò¤µ¤ì¤ëÍ£°ì¤Î¥Í¡¼¥à¥µ¡¼¥Ð¤Ï¥í¡¼¥«¥ë¥Þ¥·¥ó¾å¤Ë¤¢¤ë¡£ +¥É¥á¥¤¥ó̾¤Ï¥Û¥¹¥È̾¤«¤é·èÄꤵ¤ì¡¢ +¥É¥á¥¤¥ó¤Î¸¡º÷¥Ñ¥¹¤Ï¥É¥á¥¤¥ó̾¤«¤éºîÀ®¤µ¤ì¤ë¡£ +.LP +¤³¤Î¾õÂÖ¤òÊѹ¹¤¹¤ë¤¿¤á¤ÎÀßÄꥪ¥×¥·¥ç¥ó¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ë¡£ +.TP +\fBnameserver\fP ¥Í¡¼¥à¥µ¡¼¥Ð¤Î IP ¥¢¥É¥ì¥¹ +¥ì¥¾¥ë¥Ð¤¬Ì䤤¹ç¤ï¤»¤ò¤¹¤ë¥Í¡¼¥à¥µ¡¼¥Ð¤Î +(¥É¥Ã¥Èɽµ­¤Î) ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹¡£ +¤³¤Î¥­¡¼¥ï¡¼¥É 1 ¤Ä¤´¤È¤Ë 1 Âæ¤Å¤Ä¡¢ +.B MAXNS +Âæ (¸½¾õ¤Ç¤Ï 3 Âæ¡¢\fI\fP ¤ò»²¾È) ¤Þ¤Ç¤Î¥Í¡¼¥à¥µ¡¼¥Ð¤ò¥ê¥¹¥È¤Ç¤­¤ë¡£ +Ê£¿ô¤Î¥µ¡¼¥Ð¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥ì¥¾¥ë¥Ð¥é¥¤¥Ö¥é¥ê¤Ï +¥ê¥¹¥È¤µ¤ì¤¿½ç¤ËÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦¡£ +\fBnameserver\fP ¥¨¥ó¥È¥ê¤¬¤Ê¤¤¾ì¹ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥í¡¼¥«¥ë¥Þ¥·¥ó¾å¤Î¥Í¡¼¥à¥µ¡¼¥Ð¤¬»È¤ï¤ì¤ë¡£ +(¤³¤³¤Ç»È¤ï¤ì¤ë¥¢¥ë¥´¥ê¥º¥à¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +¤Ï¤¸¤á¤Ë¥Í¡¼¥à¥µ¡¼¥Ð¤ËÌ䤤¹ç¤ï¤»¤ò»î¤ß¤ë¡£ +¤³¤ÎÌ䤤¹ç¤ï¤»¤¬¥¿¥¤¥à¥¢¥¦¥È¤Ë¤Ê¤Ã¤¿¾ì¹ç¡¢ +¼¡¤Î¥Í¡¼¥à¥µ¡¼¥Ð¤ËÌ䤤¹ç¤ï¤»¤ò»î¤ß¤ë¡£ +¤³¤ì¤ò¥Í¡¼¥à¥µ¡¼¥Ð¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç³¤±¤ë¡£ +¤½¤ì¤Ç¤â±þÅú¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢¥ê¥È¥é¥¤ºÇÂç²ó¿ô¤Ë㤹¤ë¤Þ¤Ç +Á´¤Æ¤Î¥Í¡¼¥à¥µ¡¼¥Ð¤ËÌ䤤¹ç¤ï¤»¤ò·«¤êÊÖ¤¹¡£) +.TP +\fBdomain\fP ¥í¡¼¥«¥ë¥É¥á¥¤¥ó̾ +¤³¤Î¥É¥á¥¤¥ó¤Ë¤¢¤ë̾Á°¤ÎÌ䤤¹ç¤ï¤»¤Î¤Û¤È¤ó¤É¤Ë¡¢ +¤³¤Î¥í¡¼¥«¥ë¥É¥á¥¤¥ó¤Ë¤ª¤±¤ëû¤¤Ì¾Á°¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +\fBdomain\fP ¥¨¥ó¥È¥ê¤¬¤Ê¤¤¾ì¹ç¡¢¥É¥á¥¤¥ó̾¤Ï +.BR gethostname (2) +¤ÇÊÖ¤µ¤ì¤ë¥í¡¼¥«¥ë¥Û¥¹¥È̾¤«¤é·èÄꤵ¤ì¡¢ +ºÇ½é¤Î \(aq.\(aq °Ê¹ß¤ÎÁ´¤Æ¤ÎÉôʬ¤¬¥É¥á¥¤¥ó̾¤È¤µ¤ì¤ë¡£ +¤³¤Î¥Û¥¹¥È̾¤Ë¤â¥É¥á¥¤¥óÉô¤ò´Þ¤ó¤Ç¤¤¤Ê¤¤¾ì¹ç¡¢¥ë¡¼¥È¥É¥á¥¤¥ó¤¬²¾Äꤵ¤ì¤ë¡£ +.TP +\fBsearch\fP ¥Û¥¹¥È̾¥ë¥Ã¥¯¥¢¥Ã¥×¤Î¤¿¤á¤Î¸¡º÷¥ê¥¹¥È +¸¡º÷¥ê¥¹¥È¤ÏÄ̾ï¥í¡¼¥«¥ë¥É¥á¥¤¥ó̾¤«¤é·èÄꤵ¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¸¡º÷¥ê¥¹¥È¤Ï¥í¡¼¥«¥ë¥É¥á¥¤¥ó̾¤Î¤ß¤Ç¤¢¤ë¡£ +¤³¤ì¤òÊѹ¹¤¹¤ë¤Ë¤Ï¡¢\fIsearch\fP ¥­¡¼¥ï¡¼¥É¤Î¸å¤Ë +´õ˾¤¹¤ë¥É¥á¥¤¥ó¸¡º÷¥Ñ¥¹¤ò¥¹¥Ú¡¼¥¹¤Þ¤¿¤Ï¥¿¥Ö¤Ç¶èÀڤäƥꥹ¥È¤¹¤ì¤Ð¤è¤¤¡£ +¥É¥Ã¥È¤Î¿ô¤¬ +.I ndots +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 1) ¤è¤ê¾¯¤Ê¤¤¥ì¥¾¥ë¥Ð¤ÎÌ䤤¹ç¤ï¤»¤Ï¡¢ +°ìÃפ¹¤ë¤â¤Î¤¬¸«¤Ä¤«¤ë¤Þ¤Ç¸¡º÷¥Ñ¥¹¤Î³ÆÍ×ÁǤò½ç¤Ë»È¤Ã¤Æ»î¤¹¡£ +Ê£¿ô¤Î¥µ¥Ö¥É¥á¥¤¥ó¤ò»ý¤Ä´Ä¶­¤Ç¤Ï¡¢ +Âè»°¼Ô¤Ë¤è¤ë¹¶·â (man-in-the-middle attack) ¤È +¥ë¡¼¥È DNS ¥µ¡¼¥Ð¤Ø¤ÎÉÔɬÍפʥȥé¥Õ¥£¥Ã¥¯¤òÈò¤±¤ë¤¿¤á¤Ë¡¢ +°Ê²¼¤Î +.BI "options ndots:" n +¤òÆɤó¤Ç¤Û¤·¤¤¡£ +.\" resolv.conv ¤Ë +.\" search subdomain.domain.tld domain.tld +.\" °Ê²¼¤Î¤è¤¦¤Ê¹Ô¤¬¤¢¤ë¾ì¹ç¤Ë¡¢¤¿¤È¤¨¤Ð +.\" ping host.anothersubdomain +.\" ¤Ë¤è¤ë¥Û¥¹¥È¤Î¸¡º÷¤¬¹Ô¤ï¤ì¤ë¤È¡¢ +.\" host.anothersubdomain. +.\" host.anothersubdomain.subdomain.domain.tld. +.\" host.anothersubdomain.domain.tld. +.\" ¤ËÂФ·¤Æ DNS ¥ê¥¯¥¨¥¹¥È¤¬Á÷¤é¤ë¡£ +.\" ¤³¤ì¤Ë¤è¤Ã¤Æ¡¢¥ë¡¼¥È DNS ¥µ¡¼¥Ð¤ËÂФ·¤Æ +.\" ÉÔɬÍפʥȥé¥Õ¥£¥Ã¥¯¤ò°ú¤­µ¯¤³¤¹¤À¤±¤Ç¤Ê¤¯¡¢ +.\" ³°Éô¤Ë¾ðÊó¤ò¤Ð¤é¤Þ¤¤¤Æ¤·¤Þ¤¦¤¿¤á¤Ë¡¢Âè»°¼Ô¤Ë¤è¤ë¹¶·â¤¬²Äǽ¤Ë¤Ê¤ë¡£ +¤³¤Î¥×¥í¥»¥¹¤ÏÃÙ¤¯¡¢¥ê¥¹¥È¤µ¤ì¤¿¥É¥á¥¤¥ó¤¬¥í¡¼¥«¥ë¤Î¤â¤Î¤Ç¤Ê¤¤¾ì¹ç¡¢ +¿Âç¤Ê¥Í¥Ã¥È¥ï¡¼¥¯¥È¥é¥Õ¥£¥Ã¥¯¤òȯÀ¸¤µ¤»¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤µ¤é¤Ë¡¢¤³¤ì¤é¤Î¥É¥á¥¤¥ó¤Î¤¤¤º¤ì¤«¤Ò¤È¤Ä¤Ë¤Ç¤âŬÀڤʥµ¡¼¥Ð¤¬¤Ê¤¤¾ì¹ç¡¢ +Ì䤤¹ç¤ï¤»¤¬¥¿¥¤¥à¥¢¥¦¥È¤Ë¤Ê¤ëÅÀ¤Ë¤âÃí°Õ¤¹¤ë¤³¤È¡£ +.IP +¸½¾õ¤Ç¤Ï¡¢¸¡º÷¥ê¥¹¥È¤Ï 6 ¥É¥á¥¤¥ó¡¦·× 256 ʸ»ú¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +\fBsortlist\fP +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¡¢ +.BR gethostbyname (3) +¤ÇÊÖ¤µ¤ì¤ë¥¢¥É¥ì¥¹¤ò¥½¡¼¥È¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +sortlist ¤Ï IP ¥¢¥É¥ì¥¹¤È¥Í¥Ã¥È¥Þ¥¹¥¯¤Î¥Ú¥¢¤Ç»ØÄꤵ¤ì¤ë¡£ +¥Í¥Ã¥È¥Þ¥¹¥¯¤Ï¾Êά²Äǽ¤Ç¤¢¤ê¡¢ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥Í¥Ã¥È¤ËÂФ¹¤ë¥Ç¥Õ¥©¥ë¥È¤Î¥Í¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +IP ¥¢¥É¥ì¥¹¤È¥ª¥×¥·¥ç¥ó¤Î¥Í¥Ã¥È¥Þ¥¹¥¯¤Î¥Ú¥¢¤Ï¥¹¥é¥Ã¥·¥å¤Ç¶èÀڤ롣 +ºÇÂç 10 ÁȤΥڥ¢¤ò»ØÄê¤Ç¤­¤ë¡£ +°Ê²¼¤ËÎã¤ò¼¨¤¹¡£ + +.in +4n +sortlist 130.155.160.0/255.255.240.0 130.155.0.0 +.in +.br +.TP +\fBoptions\fP +options ¤Ë¤è¤ê¡¢¥ì¥¾¥ë¥Ð¤ÎÆâÉôÊÑ¿ô¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +½ñ¼°¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.RS +.IP +\fBoptions\fP \fIoption\fP \fI...\fP +.LP +¤³¤³¤Ç \fIoption\fP ¤Ï¼¡¤Î¤¦¤Á¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ +.TP +\fBdebug\fP +.\" Since glibc 2.2? +.I _res.options +¤Ë +.B RES_DEBUG +¤òÀßÄꤹ¤ë¡£ +.TP +.BI ndots: n +.\" Since glibc 2.2 +¡Ö\fIºÇ½é¤Î´°Á´¤Ê̾Á°¤Ç¤ÎÌ䤤¹ç¤ï¤»\fP¤¬¼Â¹Ô¤µ¤ì¤ëÁ°¤Ë¡¢ +.BR res_query (3) +.RB ( resolver (3) +¤ò»²¾È) ¤ËÍ¿¤¨¤é¤ì¤ë̾Á°¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤Ù¤­¥É¥Ã¥È¤Î¿ô¤ÎïçÃ͡פòÀßÄꤹ¤ë¡£ +\fIn\fP ¤Î¥Ç¥Õ¥©¥ë¥È¤Ï 1 ¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï¡¢Ì¾Á°¤Ë¥É¥Ã¥È¤¬¤¢¤ë¾ì¹ç¡¢\fIsearch list\fP ¤ÎÍ×ÁǤ¬Éղ䵤ì¤ëÁ°¤Ë¡¢ +¤½¤Î̾Á°¤¬´°Á´¤Ê̾Á°¤È¤·¤ÆºÇ½é¤Ë»î¤µ¤ì¤ë¤È¤¤¤¦¤³¤È¤ò°ÕÌ£¤·¤Æ¤¤¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÎÃͤξå¸Â¤Ï 15 ¤Ç¤¢¤ê¡¢ÌۤäƤ³¤ÎÃͤޤÇÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.TP +.BI timeout: n +.\" Since glibc 2.2 +¡Ö¥ì¥¾¥ë¥Ð¤¬Â¾¤Î¥Í¡¼¥à¥µ¡¼¥Ð¤ÇÌ䤤¹ç¤ï¤»¤ò¥ê¥È¥é¥¤¤¹¤ëÁ°¤Ë¡¢ +¥ê¥â¡¼¥È¥Í¡¼¥à¥µ¡¼¥Ð¤«¤é¤Î±þÅú¤òÂԤĻþ´Ö¡×¤òÀßÄꤹ¤ë¡£ +ñ°Ì¤ÏÉäǡ¢¥Ç¥Õ¥©¥ë¥È¤Ï +.B RES_TIMEOUT +¤Ç¤¢¤ë +(¸½¾õ¤Ç¤Ï 5 Éá¢\fI\fP ¤ò»²¾È)¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÎÃͤξå¸Â¤Ï 30 ¤Ç¤¢¤ê¡¢ÌۤäƤ³¤ÎÃͤޤÇÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.TP +.BI attempts: n +¡Ö¥ì¥¾¥ë¥Ð¤¬Äü¤á¤Æ¸Æ¤Ó½Ð¤·¸µ¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¥¨¥é¡¼¤òÊÖ¤¹¤Þ¤Ç¤Ë¡¢ +¥Í¡¼¥à¥µ¡¼¥Ð¤ËÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦²ó¿ô¡×¤òÀßÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï +.B RES_DFLRETRY +²ó¤Ç¤¢¤ë +(¸½¾õ¤Ç¤Ï 2 ²ó¡¢\fI\fP ¤ò»²¾È)¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÎÃͤξå¸Â¤Ï 5 ¤Ç¤¢¤ê¡¢ÌۤäƤ³¤ÎÃͤޤÇÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +.TP +.B rotate +.\" Since glibc 2.2 +.I _res.options +¤Ë RES_ROTATE ¤òÀßÄꤹ¤ë¡£ +¥ê¥¹¥È¤µ¤ì¤Æ¤¤¤ë¥Í¡¼¥à¥µ¡¼¥Ð¤«¤éÁª¤Ö¤È¤­¤Ë¡¢ +¥é¥¦¥ó¥É¥í¥Ó¥ó (round robin) ÁªÂò¤ò¹Ô¤ï¤»¤ë¡£ +¥ê¥¹¥È¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥µ¡¼¥Ð¤ÇÌ䤤¹ç¤ï¤»¤ÎÉé²Ù¤òʬ»¶¤¹¤ë¸ú²Ì¤¬¤¢¤ê¡¢ +ºÇ½é¤Ë¥ê¥¹¥È¤µ¤ì¤¿¥µ¡¼¥Ð¤ËÁ´¤Æ¤Î¥¯¥é¥¤¥¢¥ó¥È¤¬ +Ëè²óºÇ½é¤ËÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦¤ï¤±¤Ç¤Ï¤Ê¤¯¤Ê¤ë¡£ +.TP +.B no-check-names +.\" Since glibc 2.2 +.I _res.options +¤Ë +.B RES_NOCHECKNAME +¤òÀßÄꤹ¤ë¡£ +Æþ¤Ã¤Æ¤¯¤ë¥Û¥¹¥È̾¤È¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ë¡¢ +¥¢¥ó¥À¡¼¥¹¥³¥¢ (_)¡¦ASCII °Ê³°¤Îʸ»ú¡¦À©¸æʸ»ú¤È¤¤¤Ã¤¿ +ÉÔÀµ¤Êʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤«¤òÄ´¤Ù¤ë +ºÇ¶á¤Î BIND ¤Î¥Á¥§¥Ã¥¯¤ò̵¸ú¤Ë¤¹¤ë¡£ +.TP +.B inet6 +.\" Since glibc 2.2 +.I _res.options +¤Ë +.B RES_USE_INET6 +¤òÀßÄꤹ¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤ë¤È¡¢ +.BR gethostbyname (3) +´Ø¿ô¤ÎÆâÉô¤Ç A ¥ì¥³¡¼¥É¤ÎÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦Á°¤Ë +AAAA ¥ì¥³¡¼¥É¤ÎÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦¤è¤¦¤Ë¤Ê¤ë¡£ +¤Þ¤¿¡¢AAAA ¥ì¥³¡¼¥É¤Ï¸«¤Ä¤«¤é¤Ê¤¤¤¬ A ¥ì¥³¡¼¥É¥»¥Ã¥È¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ë¡¢ +IPv4 ¤Î±þÅú¤ò IPv6¡Ö¥È¥ó¥Í¥ë·Á¼°¡×¤Ë¥Þ¥Ã¥×¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.TP +.BR ip6-bytestring " (glibc 2.3.4 °Ê¹ß)" +.I _res.options +¤Ë +.B RES_USE_BSTRING +¤òÀßÄꤹ¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤ë¤È¡¢IPv6 ¥¢¥É¥ì¥¹¤ÎµÕ°ú¤­¤Ç +RFC\ 2673 ¤Çµ¬Äꤵ¤ì¤¿ bit-label ·Á¼°¤¬»ÈÍѤµ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢nibble ·Á¼°¤¬»ÈÍѤµ¤ì¤ë¡£ +.TP +.BR ip6-dotint / no-ip6-dotint " (glibc 2.3.4 °Ê¹ß)" +.I _res.options +¤Ø¤Î +.B RES_NOIP6DOTINT +¤Î¥»¥Ã¥È/¥¯¥ê¥¢¤ò¹Ô¤¦¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¥¯¥ê¥¢¤µ¤ì¤ë¤È +.RB ( ip6-dotint )¡¢ +IPv6 ¥¢¥É¥ì¥¹¤ÎµÕ°ú¤­¤¬ (Èó¿ä¾©¤Î) +.I ip6.int +¥¾¡¼¥ó¤Ç¹Ô¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¥»¥Ã¥È¤µ¤ì¤ë¤È +.RB ( no-ip6-dotint )¡¢ +IPv6 ¥¢¥É¥ì¥¹¤ÎµÕ°ú¤­¤¬¥Ç¥Õ¥©¥ë¥È¤Î +.I ip6.arpa +¥¾¡¼¥ó¤Ç¹Ô¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¥»¥Ã¥È¤µ¤ì¤ë¡£ +.TP +.BR edns0 " (glibc 2.6 °Ê¹ß)" +.I _res.options +¤Ë +.B RES_USE_EDNSO +¤ò¥»¥Ã¥È¤¹¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢RFC\ 2671 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë +DNS ³ÈÄ¥¤Î¥µ¥Ý¡¼¥È¤¬Í­¸ú¤Ë¤Ê¤ë¡£ +.RE +.LP +\fIdomain\fP ¤È \fIsearch\fP ¥­¡¼¥ï¡¼¥É¤Ï¡¢¸ß¤¤¤ËÇÓ¾Ū¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥­¡¼¥ï¡¼¥É¤¬ 2 ¤Ä°Ê¾åµ­½Ò¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +ºÇ¸å¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤¬Í­¸ú¤Ë¤Ê¤ë¡£ +.LP +¥·¥¹¥Æ¥à¤Î \fIresolv.conf\fP ¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë \fIsearch\fP ¥­¡¼¥ï¡¼¥É¤Ï¡¢ +¥¹¥Ú¡¼¥¹¤Ç¶èÀڤ俸¡º÷¥É¥á¥¤¥ó¤Î¥ê¥¹¥È¤ò +´Ä¶­ÊÑ¿ô +.B LOCALDOMAIN +¤ËÀßÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¢³Æ¥×¥í¥»¥¹Ëè¤Ë¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +¥·¥¹¥Æ¥à¤Î \fIresolv.conf\fP ¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë \fIoptions\fP ¥­¡¼¥ï¡¼¥É¤Ï¡¢ +¾å¤Î \fBoptions\fP ¥»¥¯¥·¥ç¥ó¤ÇÀâÌÀ¤·¤¿¤è¤¦¤Ë¡¢ +¥¹¥Ú¡¼¥¹¤Ç¶èÀڤ俥쥾¥ë¥Ð¥ª¥×¥·¥ç¥ó¤Î¥ê¥¹¥È¤ò +´Ä¶­ÊÑ¿ô +.B RES_OPTIONS +¤ËÀßÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¢³Æ¥×¥í¥»¥¹Ëè¤Ë½¤Àµ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +¥­¡¼¥ï¡¼¥É¤ÈÃͤÏƱ¤¸¹Ô¤Ë½ñ¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤Þ¤¿¡¢(\fBnameserver\fP ¤Î¤è¤¦¤Ê) ¥­¡¼¥ï¡¼¥É¤¬¹Ô¤ÎÀèƬ¤Ë¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Ãͤϥ­¡¼¥ï¡¼¥É¤Î¸å¤Ë¥¹¥Ú¡¼¥¹¤Ç¶èÀڤäƳ¤±¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +.IR /etc/resolv.conf , +.I +.SH ´ØÏ¢¹àÌÜ +.BR gethostbyname (3), +.BR resolver (3), +.BR hostname (7), +.BR named (8) +.br +BIND ¤Î¥Í¡¼¥à¥µ¡¼¥Ð¥ª¥Ú¥ì¡¼¥·¥ç¥ó¥¬¥¤¥É diff --git a/release/man5/rpc.5 b/release/man5/rpc.5 new file mode 100644 index 00000000..99aaa64a --- /dev/null +++ b/release/man5/rpc.5 @@ -0,0 +1,80 @@ +.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) +.\" +.\" @(#)rpc.5 2.2 88/08/03 4.0 RPCSRC; from 1.4 87/11/27 SMI; +.\" +.\" This page is a part of LDP man-pages 1.25 +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated Fri Aug 27 1999 by NAKANO Takeo +.\" Updated Sat Dec 22 JST 2001 by Kentaro Shirakata +.\" +.TH RPC 5 1985-09-26 "" "Linux Programmer's Manual" +.SH ̾Á° +rpc \- rpc ¥×¥í¥°¥é¥àÈÖ¹æ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.SH ½ñ¼° +.B /etc/rpc +.SH ÀâÌÀ +.I rpc +¥Õ¥¡¥¤¥ë¤Ë¤Ï RPC ¥×¥í¥°¥é¥àÈÖ¹æ¤ÎÂå¤ï¤ê¤Ë»È¤¦¤³¤È¤Î¤Ç¤­¤ë +¥æ¡¼¥¶¡¼¤Ë²ÄÆɤÊ̾Á°¤¬Æþ¤Ã¤Æ¤¤¤ë¡£¤½¤ì¤¾¤ì¤Î¹Ô¤Ï°Ê²¼¤Î¾ðÊó¤ò´Þ¤à¡£ +.HP 10 +RPC ¥×¥í¥°¥é¥à¤Î¥µ¡¼¥Ð¤Î̾Á° +.br +.ns +.HP 10 +RPC ¥×¥í¥°¥é¥àÈÖ¹æ +.br +.ns +.HP 10 +ÊÌ̾ +.LP +¤½¤ì¤¾¤ì¤Î¹àÌܤÏǤ°Õ¤Î¸Ä¿ô¤Î¶õÇò¡¦¥¿¥Ö (º®ºß²Ä) ¤Ë¤è¤Ã¤Æ¶èÀÚ¤é¤ì¤ë¡£ +ÀèƬ¤Ë \(aq#\(aq ¤Î¤¢¤ë¹Ô¤Ï¥³¥á¥ó¥È¤Ç¤¢¤ë¡£ +\(aq#\(aq ¤«¤é¤½¤Î¹Ô¤Î½ªÎ»¤Þ¤Ç¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ò¥µ¡¼¥Á¤¹¤ë¥ë¡¼¥Á¥ó¤Ë¤è¤Ã¤Æ +²ò¼á¤µ¤ì¤Ê¤¯¤Ê¤ë¡£ +.LP +°Ê²¼¤Ë¡¢ Sun RPC ¤Î¥½¡¼¥¹¥Ñ¥Ã¥±¡¼¥¸¤«¤é¤È¤Ã¤Æ¤­¤¿ +\fI/etc/rpc\fP ¥Õ¥¡¥¤¥ë¤ÎÎã¤ò¼¨¤¹¡£ +.nf +.ta 1.5i +0.5i +1.0i +1.0i +# +# rpc 88/08/01 4.0 RPCSRC; from 1.12 88/02/07 SMI +# +portmapper 100000 portmap sunrpc +rstatd 100001 rstat rstat_svc rup perfmeter +rusersd 100002 rusers +nfs 100003 nfsprog +ypserv 100004 ypprog +mountd 100005 mount showmount +ypbind 100007 +walld 100008 rwall shutdown +yppasswdd 100009 yppasswd +etherstatd 100010 etherstat +rquotad 100011 rquotaprog quota rquota +sprayd 100012 spray +3270_mapper 100013 +rje_mapper 100014 +selection_svc 100015 selnsvc +database_svc 100016 +rexd 100017 rex +alis 100018 +sched 100019 +llockmgr 100020 +nlockmgr 100021 +x25.inr 100022 +statmon 100023 +status 100024 +bootparam 100026 +ypupdated 100028 ypupdate +keyserv 100029 keyserver +tfsd 100037 +nsed 100038 +nsemntd 100039 +.fi +.DT +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/rpc +RPC ¥×¥í¥°¥é¥àÈÖ¹æ¥Ç¡¼¥¿¥Ù¡¼¥¹ +.SH ´ØÏ¢¹àÌÜ +.BR getrpcent (3) diff --git a/release/man5/securetty.5 b/release/man5/securetty.5 new file mode 100644 index 00000000..f578258d --- /dev/null +++ b/release/man5/securetty.5 @@ -0,0 +1,48 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sun Jul 25 11:06:27 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" Japanese Version Copyright (c) 1998 Hiroaki Nagoya all rights reserved. +.\" Translated Wed Feb 4 1998 by Hiroaki Nagoya +.\" +.TH SECURETTY 5 1992-12-29 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +securetty \- root ¤¬¥í¥°¥¤¥ó¤Ç¤­¤ëüËö¥ê¥¹¥È¤Î¥Õ¥¡¥¤¥ë +.SH ÀâÌÀ +.I /etc/securetty +¥Õ¥¡¥¤¥ë¤Ï (¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Î) +.BR login (1) +¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¡£ +root ¤Î¥í¥°¥¤¥ó¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ëüËö¤Î¥Ç¥Ð¥¤¥¹Ì¾¤¬£±¹Ô¤Ë +¤Ò¤È¤Ä¤º¤Ä½ñ¤«¤ì¤Æ¤¤¤ë (ÀèƬ¤Î +.I /dev/ +¤Ï¾Êά¤¹¤ë)¡£ +shadow login suite ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +.BR login.defs (5) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ¥Õ¥¡¥¤¥ë +.I /etc/securetty +.SH ´ØÏ¢¹àÌÜ +.BR login (1), +.BR login.defs (5) diff --git a/release/man5/services.5 b/release/man5/services.5 new file mode 100644 index 00000000..2582139b --- /dev/null +++ b/release/man5/services.5 @@ -0,0 +1,212 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" This manpage is Copyright (C) 1996 Austin Donnelly , +.\" with additional material Copyright (c) 1995 Martin Schulze +.\" +.\" +.\" 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 manpage was made by merging two independently written manpages, +.\" one written by Martin Schulze (18 Oct 95), the other written by +.\" Austin Donnelly, (9 Jan 96). +.\" +.\" Thu Jan 11 12:14:41 1996 Austin Donnelly +.\" * Merged two services(5) manpages +.\" +.\" Japanese Version Copyright (c) 1997 MOTOKI Akihiro +.\" all rights reserved. +.\" Translated Wed Aug 20 08:32:26 JST 1997 +.\" by MOTOKI Akihiro +.\" +.TH SERVICES 5 2008-09-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +services \- ¥¤¥ó¥¿¡¼¥Í¥Ã¥È ¥Í¥Ã¥È¥ï¡¼¥¯¥µ¡¼¥Ó¥¹ ¥ê¥¹¥È +.SH ÀâÌÀ +.B services +¤Ï¡¢¿Í¤¬Ê¬¤«¤ê¤ä¤¹¤¤·Á¤Î¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥µ¡¼¥Ó¥¹¤Î̾Á°¤È¡¢ +¤½¤ì¤é¤Î¥µ¡¼¥Ó¥¹¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥Ý¡¼¥ÈÈÖ¹æ¤ä +¥×¥í¥È¥³¥ë¼ïÊ̤ÎÂбþ´Ø·¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +¥Í¥Ã¥È¥ï¡¼¥¯¾å¤ÇÆ°ºî¤¹¤ë¥×¥í¥°¥é¥à¤Ï¤¹¤Ù¤Æ¡¢ +¤½¤Î¥µ¡¼¥Ó¥¹¤ËÂбþ¤¹¤ë¥Ý¡¼¥ÈÈÖ¹æ (¤È¥×¥í¥È¥³¥ë) ¤òÆÀ¤ë¤¿¤á¤Ë¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë¤òÄ´¤Ù¤ëɬÍפ¬¤¢¤ë¡£ +C ¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤¢¤ë +.BR getservent (3), +.BR getservbyname (3), +.BR getservbyport (3), +.BR setservent (3), +.BR endservent (3) +¤òÍøÍѤ¹¤ë¤³¤È¤Ç¡¢¥×¥í¥°¥é¥à¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤òÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¥Ý¡¼¥ÈÈÖ¹æ¤Ï¡¢IANA (Internet Assigned Numbers Authority) ¤Ë¤è¤Ã¤Æ +³ä¤êÅö¤Æ¤é¤ì¤Æ¤ª¤ê¡¢¸½ºß¤Ï¥Ý¡¼¥ÈÈÖ¹æ¤ò³ä¤êÅö¤Æ¤ëºÝ¤Ë +TCP ¤È UDP ¤ÎξÊý¤Î¥×¥í¥È¥³¥ë¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤½¤Î¤¿¤á¡¢¤Û¤È¤ó¤É¤Î¥µ¡¼¥Ó¥¹¤ËÂФ·¤Æ¡¢ +¤¿¤È¤¨ TCP ¤À¤±¤Î¥µ¡¼¥Ó¥¹¤Î¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢Âбþ¤¹¤ë¹àÌܤ¬Æó¤Ä¤¢¤ë¤³¤È¤Ë¤Ê¤ë¡£ + +1024 ¤è¤ê¾®¤µ¤¤¥Ý¡¼¥ÈÈÖ¹æ (¤¤¤ï¤æ¤ë "low numbered" ¥Ý¡¼¥È) ¤Ï +´ÉÍý¼Ô (root) ¸¢¸Â¤Ë¤è¤Ã¤Æ¤Î¤ß»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.RB ( bind (2), +.BR tcp (7), +.BR udp (7) +»²¾È)¡£ +¤³¤ì¤Ï¡¢¤³¤ì¤é¤Î¥Ý¡¼¥È¤ËÀܳ¤¹¤ë¥¯¥é¥¤¥¢¥ó¥È¤ËÂФ·¤Æ¡¢ +¤½¤Î¥Ý¡¼¥È¤ÇÆ°¤¤¤Æ¤¤¤ë¥µ¡¼¥Ó¥¹¤¬É¸½àŪ¤Ê¼ÂÁõ¤Ç¤¢¤ê¡¢ +¤½¤Î·×»»µ¡¤Î¥æ¡¼¥¶¡¼¤¬Æ°¤«¤·¤Æ¤¤¤ë +ÉÔÀµ¤Ê¥µ¡¼¥Ó¥¹¤Ç¤Ï¤Ê¤¤¤³¤È¤òÊݾڤ¹¤ë¤¿¤á¤Ç¤¢¤ë¡£ +IANA ¤ËÌÀµ­¤µ¤ì¤Æ¤¤¤ë¤è¤¯»ÈÍѤµ¤ì¤ë¥Ý¡¼¥ÈÈÖ¹æ¤Ï¡¢ +Ä̾盧¤Î¤è¤¦¤Ê´ÉÍý¼Ô¤À¤±¤¬»ÈÍѤǤ­¤ëÈϰϤËÇÛÃÖ¤µ¤ì¤ë¡£ + +.B services +¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë¥µ¡¼¥Ó¥¹¤ËÂФ¹¤ë¹àÌܤ¬¤¢¤Ã¤Æ¤â¡¢É¬¤º¤·¤â¤½¤Î¥µ¡¼¥Ó¥¹¤¬¸½ +ºß¤½¤Î·×»»µ¡¤ÇÆ°¤¤¤Æ¤¤¤ëÌõ¤Ç¤Ï¤Ê¤¤¡£ÍøÍѲÄǽ¤Ê¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥µ¡¼¥Ó¥¹¤ÎÀßÄê¤Ë +¤Ä¤¤¤Æ¤Ï +.BR inetd.conf (5) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£¤¿¤À¤·¡¢¤¹¤Ù¤Æ¤Î¥µ¡¼¥Ó¥¹¤¬ +.BR inetd (8) +¤Ë¤è¤Ã¤Æµ¯Æ°¤µ¤ì¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢ +.BR inetd.conf (5) +¤Ë¤Ï½ñ¤«¤ì¤Æ¤¤¤Ê¤¤¥µ¡¼¥Ó¥¹¤â¤¢¤ë¤³¤È¤ËÃí°Õ¤¹¤ëɬÍפ¬¤¢¤ë¡£ +Æäˡ¢¥Í¥Ã¥È¥Ë¥å¡¼¥¹ (NNTP) ¤ä ¥á¡¼¥ë (SMTP) ¤Î¥µ¡¼¥Ð¡¼¤Ï¡¢¥·¥¹¥Æ¥àµ¯Æ°»þ¤Î +¥¹¥¯¥ê¥×¥È¤«¤éµ¯Æ°¤µ¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ + +.B services +¥Õ¥¡¥¤¥ë¤Î¾ì½ê¤Ï¡¢ +.I +Ãæ¤Î +.B _PATH_SERVICES +¤Ë¤è¤Ã¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ÎÃͤÏÄ̾ï +.I /etc/services +¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¡£ + + 1 ¹Ô¤Ë¤Ä¤­ 1 ¥µ¡¼¥Ó¥¹¤¬µ­½Ò¤µ¤ì¤Æ¤ª¤ê¡¢¤½¤Î·Á¼°¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.IP +\f2service-name\ \ \ port\f3/\f2protocol\ \ \ \f1[\f2aliases ...\f1] +.TP +.TP 10 +.I service-name +¥µ¡¼¥Ó¥¹¤òɽ¤¹Ê¬¤«¤ê¤ä¤¹¤¤Ì¾Á°¤Ç¤¢¤ê¡¢¸¡º÷¤ÎºÝ¤Ë¤â»ÈÍѤµ¤ì¤ë¡£ +Âçʸ»ú¤È¾®Ê¸»ú¤Ï¶èÊ̤µ¤ì¤ë¡£ +¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Ï +.I service-name +¤Ë¤Á¤Ê¤ó¤Ç̾ÉÕ¤±¤é¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ +.TP +.I port +¥µ¡¼¥Ó¥¹¤ËÂФ·¤Æ»ÈÍѤµ¤ì¤ë¥Ý¡¼¥ÈÈֹ档10 ¿Ê¿ô¤Ç»ØÄꤹ¤ë¡£ +.TP +.I protocol +»ÈÍѤµ¤ì¤ë¥×¥í¥È¥³¥ë¤Î¼ïÎà¡£¤³¤ÎÍó¤Ï¡¢ +.BR protocols (5) +¥Õ¥¡¥¤¥ë¤ÎÃæ¤Î¹àÌܤȰìÃפ·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +Ä̾ï»ÈÍѤµ¤ì¤ëÃͤϡ¢ +.B tcp +¤È +.B udp +¤Ç¤¢¤ë¡£ +.TP +.I aliases +¥µ¡¼¥Ó¥¹¤ËÂФ¹¤ëÊÌ̾¤Î¥ê¥¹¥È (¶èÀڤϥ¹¥Ú¡¼¥¹¤Þ¤¿¤Ï¥¿¥Ö) ¤Ç¡¢¤³¤ÎÍó¤Ï +ɬÍפˤʤé¤Ð½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë +(⤷¡¢²¼µ­¤Î¥Ð¥°¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È¤Î¤³¤È)¡£¤Þ¤¿¡¢ÊÌ̾¤Ï +Âçʸ»ú¤È¾®Ê¸»ú¤Ï¶èÊ̤µ¤ì¤ë¡£ +.PP +¤½¤ì¤¾¤ì¤ÎÍó¤Î¶èÀÚ¤ê¤Ë¤Ï¡¢¥¹¥Ú¡¼¥¹¤Þ¤¿¤Ï¥¿¥Ö¤¬»ÈÍѤµ¤ì¤ë¡£ + +¥³¥á¥ó¥È¤Ï¥·¥ã¡¼¥× (#) ¤Ç»Ï¤Þ¤ê¡¢¤½¤Î¹Ô¤Î½ª¤ï¤ê¤Þ¤Ç¤¬¥³¥á¥ó¥È¤È¤ß¤Ê¤µ¤ì¤ë¡£ +¶õ¹Ô¤ÏÈô¤Ð¤µ¤ì¤ë¡£ + +¹Ô¤Î»Ï¤á¤Î¥¹¥Ú¡¼¥¹¤Ï̵»ë¤µ¤ì¤Ê¤¤¤Î¤Ç¡¢ +.I service-name +¤Ï¡¢¹ÔƬ¤«¤é½ñ¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I service-names +¤Ï¡¢¥¹¥Ú¡¼¥¹¤È¥¿¥Ö°Ê³°¤Î°õ»ú²Äǽ¤Êʸ»ú¤Ê¤é²¿¤Ç¤â¤è¤¤¤¬¡¢¤·¤«¤·¤Ê¤¬¤é +¸ß´¹À­¤ÎÌäÂê¤ò¾¯¤Ê¤¯¤¹¤ë¤è¤¦¤Êʸ»ú¤òÁªÂò¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢a\-z ¡¢0\-9 ¡¢¥Ï¥¤¥Õ¥©¥ó (\-) ¤ò»ÈÍѤ¹¤ë¤Î¤¬ÌµÆñ¤È»×¤ï¤ì¤ë¡£ + +»ØÄꤵ¤ì¤¿·Á¼°¤Ë¹ç¤ï¤Ê¤¤¹Ô¤Ï¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤ (¸½ºß¤Ï¡¢¤½¤Î¤è¤¦¤Ê¹Ô¤Ï +.BR getservent (3), +.BR getservbyname (3), +.BR getservbyport (3) +¤Ë¤è¤Ã¤Æ̵»ë¤µ¤ì¤ë¡£¤·¤«¤·¡¢¤½¤Î¾ì¹ç¤ÎµóÆ°¤Ï¿®Íê¤Ç¤­¤Ê¤¤)¡£ + +.\" The following is not true as at glibc 2.8 (a line with a comma is +.\" ignored by getservent()); it's not clear if/when it was ever true. +.\" ¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤È¤ÎÀ°¹çÀ­¤ÎÌäÂ꤫¤é¡¢¼ÂºÝ¤Ë¤Ï +.\" .I port +.\" ÈÖ¹æ¤È +.\" .I protocol +.\" ¤Î´Ö¤Î¥¹¥é¥Ã¥·¥å (/) ¤Ï¡¢¥¹¥é¥Ã¥·¥å¤«¥³¥ó¥Þ (,) ¤Î¤É¤Á¤é¤Ç¤â¹½¤ï¤Ê¤¤¡£ +.\" ¤·¤«¤·¤Ê¤¬¤é¡¢º£¤Ê¤ª¥³¥ó¥Þ¤ò»ÈÍѤ¹¤ë¤Î¤Ï˾¤Þ¤·¤¤¤³¤È¤Ç¤Ï¤Ê¤¤¡£ +.\" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢Yellow Pages/NIS ¤ä BIND/Hesiod ¤Î¤è¤¦¤Ê¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î̾Á° +¥µ¡¼¥Ó¥¹¤òÍѤ¤¤Æ¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤òÄ̤¸¤ÆÇÛÉÛ¤µ¤ì¤ë²ÄǽÀ­¤â¤¢¤ë¡£ + +.B services +¥Õ¥¡¥¤¥ë¤Î¸«Ëܤò°Ê²¼¤Ë¼¨¤¹¡£ +.RS +.nf +.sp +.ta 3i +netstat 15/tcp +qotd 17/tcp quote +msp 18/tcp # message send protocol +msp 18/udp # message send protocol +chargen 19/tcp ttytst source +chargen 19/udp ttytst source +ftp 21/tcp +# 22 \- unassigned +telnet 23/tcp +.fi +.RE +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/services +¥¤¥ó¥¿¡¼¥Í¥Ã¥È ¥Í¥Ã¥È¥ï¡¼¥¯¥µ¡¼¥Ó¥¹¤Î¥ê¥¹¥È +.TP +.I +.B _PATH_SERVICES +¤ÎÄêµÁ +.\" .SH ¥Ð¥° +.\" It's not clear when/if the following was ever true; +.\" it isn't true for glibc 2.8: +.\" .BR getservent (3) +.\" ¤Î¥³¡¼¥É¤Î½ñ¤­Êý¤ÎÌäÂê¤Ç¡¢35 ¸Ä¤Þ¤Ç¤·¤«ÊÌ̾¤òÉÕ¤±¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.\" +.\" It's not clear when/if the following was ever true; +.\" it isn't true for glibc 2.8: +.\" .B BUFSIZ +.\" (¸½ºß¤Ï 1024) ʸ»ú¤è¤êŤ¤¹Ô¤Ï¡¢ +.\" .BR getservent (3), +.\" .BR getservbyname (3), +.\" .BR getservbyport (3) +.\" ¤Ë¤è¤ê̵»ë¤µ¤ì¤ë¡£¤µ¤é¤Ë¡¢¤³¤Î¤³¤È¤Ï¼¡¤Î¹Ô¤¬Àµ¤·¤¯²ò¼á¤µ¤ì¤Ê¤¤¸¶°ø¤È¤Ê¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR listen (2), +.BR endservent (3), +.BR getservbyname (3), +.BR getservbyport (3), +.BR getservent (3), +.BR setservent (3), +.BR inetd.conf (5), +.BR protocols (5), +.BR inetd (8) + +¥Ý¡¼¥ÈÈÖ¹æ¤Î³ä¤êÅö¤Æ¤òÄê¤á¤Æ¤¤¤ë RFC (ºÇ¿·ÈÇ¤Ï RFC\ 1700¡¢ÊÌ̾ STD0002) diff --git a/release/man5/shells.5 b/release/man5/shells.5 new file mode 100644 index 00000000..49ffed8c --- /dev/null +++ b/release/man5/shells.5 @@ -0,0 +1,64 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Thu May 20 20:45:48 MET DST 1993 +.\" +.\" 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 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 +.\" +.TH SHELLS 5 1993-11-21 "" "Linux Programmer's Manual" +.SH ̾Á° +shells \- ¥í¥°¥¤¥ó¥·¥§¥ë¤È¤·¤ÆÍ­¸ú¤Ê¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾ +.SH ÀâÌÀ +.I /etc/shells +¤Ï¥í¥°¥¤¥ó¥·¥§¥ë¤È¤·¤ÆÍ­¸ú¤Ê¥Õ¥¡¥¤¥ë¤Î¥Õ¥ë¥Ñ¥¹¤¬½ñ¤«¤ì¤¿ +¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +.BR chsh (1) +¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¡£ +¾¤Î¥×¥í¥°¥é¥à¤â¤³¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤Ç¤­¤ë¡£ +.PP +Ãí°Õ¤·¤ÆÍߤ·¤¤¤Î¤À¤¬¡¢¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢ +¥æ¡¼¥¶¡¼¤¬Ä̾ï¤Î¥æ¡¼¥¶¡¼¤«¤É¤¦¤«¤òȽÃǤ¹¤ëºÝ¤Ë¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍƤò»²¹Í¤Ë¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +Î㤨¤Ð ftp ¥Ç¡¼¥â¥ó¤Ï¡¢ +¥í¥°¥¤¥ó¥·¥§¥ë¤¬¤³¤Î¥Õ¥¡¥¤¥ë¤Ë½ñ¤«¤ì¤Æ¤¤¤Ê¤¤ +¥æ¡¼¥¶¡¼¤«¤é¤Î¥¢¥¯¥»¥¹¤òµö¤µ¤Ê¤¤¤Î¤¬°ÊÁ°¤«¤é°ìÈÌŪ¤Ç¤¢¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +.I /etc/shells +.SH Îã +.I /etc/shells +¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê¥Ñ¥¹¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤À¤í¤¦¡£ +.sp +.RS +.I /bin/sh +.br +.I /bin/csh +.RE +.SH ´ØÏ¢¹àÌÜ +.BR chsh (1), +.BR getusershell (3) diff --git a/release/man5/slabinfo.5 b/release/man5/slabinfo.5 new file mode 100644 index 00000000..ed16386d --- /dev/null +++ b/release/man5/slabinfo.5 @@ -0,0 +1,124 @@ +.\" Copyright (c) 2001 Andreas Dilger (adilger@turbolinux.com) +.\" +.\" 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) 2001 NAKANO Takeo all rights reserved. +.\" Translated Thu Aug 16 2001 by NAKANO Takeo +.\" +.TH SLABINFO 5 2007-09-30 "" "Linux Programmer's Manual" +.SH ̾Á° +/proc/slabinfo \- ¥«¡¼¥Í¥ë slab ¥¢¥í¥±¡¼¥¿¤ÎÅý·× +.SH ½ñ¼° +.B cat /proc/slabinfo +.SH ÀâÌÀ +Linux ¥«¡¼¥Í¥ë¤ÎÆâÉô¤ÇÎɤ¯ÍøÍѤµ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È +(¥Ð¥Ã¥Õ¥¡¥Ø¥Ã¥É¡¢i-¥Î¡¼¥É¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤Ê¤É) +¤Ï¡¢¤½¤ì¤¾¤ì¼«Ê¬ÍѤΥ­¥ã¥Ã¥·¥å¤òÈ÷¤¨¤Æ¤¤¤ë¡£¥Õ¥¡¥¤¥ë +.I /proc/slabinfo +¤Ï¤³¤ì¤é¤ÎÅý·×¤òÍ¿¤¨¤ë¡£Îã¤ò¼¨¤¹¡£ +.LP +.in +4n +.nf +% cat /proc/slabinfo +slabinfo \- version: 1.1 +kmem_cache 60 78 100 2 2 1 +blkdev_requests 5120 5120 96 128 128 1 +mnt_cache 20 40 96 1 1 1 +inode_cache 7005 14792 480 1598 1849 1 +dentry_cache 5469 5880 128 183 196 1 +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 +\&... +.fi +.in +.LP +¤½¤ì¤¾¤ì¤Î slab ¥­¥ã¥Ã¥·¥å¤´¤È¤Ë¡¢¥­¥ã¥Ã¥·¥å¤Î̾Á°¡¢ +¸½ºß¥¢¥¯¥Æ¥£¥Ö¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î¿ô¡¢ÍøÍѲÄǽ¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤ÎÁí¿ô¡¢ +³Æ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì)¡¢¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¥¢¥¯¥Æ¥£¥Ö¤Ê +¥ª¥Ö¥¸¥§¥¯¥È¤òÍ­¤¹¤ë¥Ú¡¼¥¸¤Î¿ô¡¢¥¢¥í¥±¡¼¥È¤µ¤ì¤¿¥Ú¡¼¥¸¤ÎÁí¿ô¡¢ +slab ¤¢¤¿¤ê¤Î¥Ú¡¼¥¸¿ô¡¢¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤ë¡£ + +¤Ê¤ª¡¢ +¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥é¥¤¥ó¥á¥ó¥È¤È slab ¥­¥ã¥Ã¥·¥å¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤È¤Ë¤è¤ê¡¢ +¥ª¥Ö¥¸¥§¥¯¥È¤ÏÄ̾ï¥Ú¡¼¥¸¤ÎÆâÉô¤Ë¤­¤Ã¤Á¤ê¤È¤Ï¼ý¤á¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +ÍøÍÑÃæ¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¤Ò¤È¤Ä¤Ç¤âÊÝ»ý¤·¤Æ¤¤¤ë¥Ú¡¼¥¸¤Ï¡¢ +ÍøÍÑÃæ¤Ç¤¢¤ë¤È¤ß¤Ê¤µ¤ì¡¢²òÊü¤Ç¤­¤Ê¤¤¡£ + +slab ¥­¥ã¥Ã¥·¥åÅý·×¤Îµ¡Ç½¤òÍ­¸ú¤Ë¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +½ÐÎϤκǽé¤Î¹Ô¤Ë "(statistics)" ¤Èɽ¼¨¤µ¤ì¡¢ 5 ¤Ä¤Î¥«¥é¥à¤¬Äɲ䵤ì¤ë¡£ +¤½¤ì¤¾¤ì¡¢¥¢¥¯¥Æ¥£¥Ö¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½Ö´ÖºÇÂçÃÍ¡¢ +.\"nakano ¤Ç¤¤¤¤¤Î¤«¤Ê¤¢ > high water mark +¥ª¥Ö¥¸¥§¥¯¥È¤¬¥¢¥í¥±¡¼¥È¤µ¤ì¤¿²ó¿ô¡¢ +¥­¥ã¥Ã¥·¥å¤ÎÂ礭¤µ¤¬³ÈÄ¥¤µ¤ì¤¿ +(¿·¤·¤¤¥Ú¡¼¥¸¤¬¤³¤Î¥­¥ã¥Ã¥·¥å¤ËÄɲ䵤줿) ²ó¿ô¡¢ +¥­¥ã¥Ã¥·¥å¤ÎÂ礭¤µ¤¬½Ì¾®¤µ¤ì¤¿ +(»È¤Ã¤Æ¤¤¤Ê¤¤¥Ú¡¼¥¸¤¬¤³¤Î¥­¥ã¥Ã¥·¥å¤«¤éºï½ü¤µ¤ì¤¿) ²ó¿ô¡¢ +¿·¤¿¤Ê¥Ú¡¼¥¸¤ò¤³¤Î¥­¥ã¥Ã¥·¥å¤Ë¥¢¥í¥±¡¼¥È¤¹¤ëºÝ¤Ëµ¯¤­¤¿¥¨¥é¡¼¤Î²ó¿ô¡¢¤Ç¤¢¤ë¡£ +slab ¥­¥ã¥Ã¥·¥åÅý·×¤¬»È¤¨¤Ê¤¤¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥«¥é¥à¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¡£ + +SMP ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢½ÐÎϤκǽé¤Î¹Ô¤Ë "(SMP)" ¤Èɽ¼¨¤µ¤ì¡¢ +³Æ slab ¤´¤È¤Ë 2 ¤Ä¤Î¥«¥é¥à¤¬Äɲ䵤ì¤ë¡£ +¤³¤ì¤é¤Ï³Æ CPU ¤¬»ý¤Ä¥í¡¼¥«¥ë¤Ê¥­¥ã¥Ã¥·¥å (per-CPU ¥­¥ã¥Ã¥·¥å) ¤Î +slab ¥¢¥í¥±¡¼¥·¥ç¥ó¥Ý¥ê¥·¡¼¤òɽ¼¨¤¹¤ë +(per-CPU ¥­¥ã¥Ã¥·¥å¤Ï¡¢ +¥ª¥Ö¥¸¥§¥¯¥È¤ò¥­¥ã¥Ã¥·¥å¤«¤é¥¢¥í¥±¡¼¥È¤¹¤ëºÝ¤Ë +CPU ´Ö¤Ç¤ÎƱ´ü¤ò¸º¾¯¤µ¤»¤ë¤¿¤á¤ËÀߤ±¤é¤ì¤Æ¤¤¤ë)¡£ +ºÇ½é¤Î¥«¥é¥à¤Ï per-CPU À©¸Â¡¢ +¤¹¤Ê¤ï¤Á³Æ CPU ¤´¤È¤Ë¥­¥ã¥Ã¥·¥å¤Ç¤­¤ë¥ª¥Ö¥¸¥§¥¯¥È¤ÎºÇÂç¿ô¤Ç¤¢¤ë¡£ +ÆóÈÖÌܤΥ«¥é¥à¤Ï¥Ð¥Ã¥Á¥«¥¦¥ó¥È¡¢ +¤¹¤Ê¤ï¤Á per-CPU ¥­¥ã¥Ã¥·¥å¤¬¶õ¤À¤Ã¤¿¤ê°ìÇÕ¤À¤Ã¤¿¤ê¤·¤¿¾ì¹ç¤Ë¡¢ +¥°¥í¡¼¥Ð¥ë¤Ê¥­¥ã¥Ã¥·¥å¤È¼õ¤±ÅϤ·¤Ç¤­¤ë¥Õ¥ê¡¼¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤ÎºÇÂç¿ô¤Ç¤¢¤ë¡£ + +slab ¥­¥ã¥Ã¥·¥åÅý·×¤È SMP ¤¬Î¾ÊýÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +per-CPU ¥­¥ã¥Ã¥·¥å¤ÎÅý·×¤òɽ¼¨¤¹¤ë 4 ¤Ä¤Î¥«¥é¥à¤¬¤µ¤é¤ËÄɲ䵤ì¤ë¡£ +ºÇ½é¤Î 2 ¤Ä¤Ï per-CPU ¥­¥ã¥Ã¥·¥å¤Î +¥¢¥í¥±¡¼¥·¥ç¥ó¥Ò¥Ã¥È¥«¥¦¥ó¥È¤È¥¢¥í¥±¡¼¥·¥ç¥ó¥ß¥¹¥«¥¦¥ó¥È¤Ç¤¢¤ë¡£ +¤¹¤Ê¤ï¤Á¡¢¤¢¤ë¥ª¥Ö¥¸¥§¥¯¥È¤ò¥¢¥í¥±¡¼¥È¤·¤¿¤È¤­¤Ë¡¢ +¤½¤ì¤¬ per-CPU ¥­¥ã¥Ã¥·¥å¤ÎÆâÉô¤Ë ¤¢¤Ã¤¿/¤Ê¤«¤Ã¤¿ ²ó¿ô¤Ç¤¢¤ë¡£ +³¤¯ 2 ¤Ä¤Ï¡¢per-CPU ¥­¥ã¥Ã¥·¥å¤Î¥Õ¥ê¡¼¥Ò¥Ã¥È¥«¥¦¥ó¥È¤È¥ß¥¹¥«¥¦¥ó¥È¤Ç¤¢¤ë¡£ +¤¹¤Ê¤ï¤Á²òÊü¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ò¥°¥í¡¼¥Ð¥ë¤Ê¥­¥ã¥Ã¥·¥å¤Ë¥Õ¥é¥Ã¥·¥å¤¹¤ëÁ°¤Ë¡¢ +per-CPU ¥­¥ã¥Ã¥·¥å¤ÎÀ©¸Â¤ÎÈÏ°Ï¤Ë ¼ý¤Þ¤Ã¤¿/¼ý¤Þ¤é¤Ê¤«¤Ã¤¿ ²ó¿ô¤Ç¤¢¤ë¡£ + +SMP ¤Ë¤ª¤¤¤Æ per-CPU slab ¥­¥ã¥Ã¥·¥å¤ÎÀ©¸ÂÃͤä +¥Ð¥Ã¥Á¥«¥¦¥ó¥È¤òÊѹ¹¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ì¤Ð¤è¤¤: + +.in +4n +.nf +echo "\fIcache_name limit batchcount\fP" > /proc/slabinfo +.fi +.in +.SH ¥Õ¥¡¥¤¥ë +.I +.SH ¥Ð¡¼¥¸¥ç¥ó +.I /proc/slabinfo +¤Ï Linux 2.1.23 °Ê¹ß¤Ë¸ºß¤¹¤ë¡£ +SMP ¤Ë¤ª¤±¤ë CPU ¤´¤È¤Î¥­¥ã¥Ã¥·¥å¤Ï Linux 2.4.0-test3 °Ê¹ß¤Ë¸ºß¤¹¤ë¡£ +.SH Ãí°Õ +Linux 2.6.16 °Ê¹ß¤Ç¤Ï¡¢ +.I /proc/slabinfo +¥Õ¥¡¥¤¥ë¤Ï¡¢¥«¡¼¥Í¥ëÀßÄꥪ¥×¥·¥ç¥ó +.B CONFIG_SLAB +¤òÍ­¸ú¤Ë¤·¤¿¾ì¹ç¤Î¤ß¸ºß¤¹¤ë¡£ + diff --git a/release/man5/termcap.5 b/release/man5/termcap.5 new file mode 100644 index 00000000..ca6fa62d --- /dev/null +++ b/release/man5/termcap.5 @@ -0,0 +1,496 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 formatting Sat Jul 24 17:13:38 1993, Rik Faith (faith@cs.unc.edu) +.\" Modified (extensions and corrections) +.\" Sun May 1 14:21:25 MET DST 1994 Michael Haardt +.\" If mistakes in the capabilities are found, please send a bug report to: +.\" michael@moria.de +.\" Modified Mon Oct 21 17:47:19 EDT 1996 by Eric S. Raymond (esr@thyrsus.com) +.\" +.\" Japanese Version Copyright (c) 1999 NOKUBI Takatsugu +.\" all rights reserved. +.\" Translated Fri Jan 29 13:09:56 JST 1999 +.\" by NOKUBI Takatsugu +.\" Proofed & Modified Thu 12 Oct 2000 +.\" by NAKANO Takeo +.\" +.\"WORD capability µ¡Ç½ +.\"WORD formfeed ÊÇÁ÷¤ê +.\"WORD standout ¶¯Ä´ +.\"WORD carriage return Éüµ¢ +.\"WORD new line ²þ¹Ô +.\"WORD block graphic character(s) ¿Þ·Áʸ»ú(½¸¹ç) +.\"WORD alternate character set ÂåÂØʸ»ú½¸¹ç +.\" +.TH TERMCAP 5 1996-10-21 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +termcap \- üËöµ¡Ç½¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ +.SH ÀâÌÀ +termcap ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ï¡¢ +ʸ»úñ°Ì¤ÇÆ°ºî¤¹¤ëüËö¤ä¥×¥ê¥ó¥¿¤Îµ¡Ç½¤òµ­½Ò¤¹¤ë¤¿¤á¤Îµì¼°¤Îµ¡¹½¤Ç¤¢¤ë¡£ +¤³¤Îµ¡¹½¤Ï¸Å¤¤¥×¥í¥°¥é¥à¤òÆ°ºî¤µ¤»¤ë¤¿¤á¤À¤±¤ËÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢ +¿·¤·¤¤¥×¥í¥°¥é¥à¤Ï +.BR terminfo (5) +¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¤½¤ì¤Ë´ØÏ¢¤·¤¿¥é¥¤¥Ö¥é¥ê¤òÍѤ¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.LP +.I /etc/termcap +¤Ï¡¢Â¿¤¯¤Î°Û¤Ê¤ë¼ïÎà¤ÎüËö¤Ë´Ø¤¹¤ëµ¡Ç½¤òÎóµ­¤·¤¿¥¢¥¹¥­¡¼¥Õ¥¡¥¤¥ë +(¥Ç¡¼¥¿¥Ù¡¼¥¹¥Þ¥¹¥¿¡¼) ¤Ç¤¢¤ë¡£ +¥×¥í¥°¥é¥à¤Ï termcap ¤òÆɤ߹þ¤ó¤Ç¡¢ +¼ÂºÝ¤Ë»ÈÍѤ·¤Æ¤¤¤ëüËö¤Ë¸ÄÊ̤Υ¨¥¹¥±¡¼¥×¥³¡¼¥É·²¤ò¼èÆÀ¤¹¤ë¡£ +¤³¤ì¤òÍѤ¤¤ë¤È¡¢¤½¤ÎüËö¤Î»ë³ÐŪ¤ÊÀ­¼Á¤òÀ©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +(üËö¤Î¾¤ÎÀ­¼Á¤Ï +.BR stty (1) +¤ÇÀ©¸æ¤¹¤ë)¡£ +termcap ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ï¡¢´Ä¶­ÊÑ¿ô +.B TERM +¤ÎÃͤǰú¤«¤ì¤ë¡£ +.LP +termcap ¤Î¥¨¥ó¥È¥ê¤Ï¡¢Ã±°ì¤ÎÏÀÍý¹Ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤¿¤À¤·¡¢¹ÔËö¤Ë \(aq\\\(aq ¤òÍѤ¤¤ì¤Ð¤½¤³¤Ç¤Î²þ¹Ô¤òÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Õ¥£¡¼¥ë¥É¤Ï \(aq:\(aq ¤Çʬ³ä¤µ¤ì¤ë¡£ +³Æ¥¨¥ó¥È¥ê¤ÎºÇ½é¤Î¥Õ¥£¡¼¥ë¥É¤Ïº¸Â¦ÀèƬ¤«¤é»Ï¤Þ¤ê¡¢ +ÆâÍƤϤ½¤ÎüËö¤Î̾Á°¤Î¥ê¥¹¥È¤Ç¤¢¤ë¡£Ì¾Á°¤Î¶èÀÚ¤ê¤Ë¤Ï \(aq|\(aq ¤¬ÍѤ¤¤é¤ì¤ë¡£ +.LP +ºÇ½é¤Î¥µ¥Ö¥Õ¥£¡¼¥ë¥É¤Ï +(4.3 °ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤ÎBSD termcap ¥¨¥ó¥È¥ê¤Ç¤Ï) +2 ʸ»ú¤«¤é¤Ê¤ëû¤¤Ì¾Á°¤È¤Ê¤Ã¤Æ¤¤¤ë¡£¤³¤Îû¤¤Ì¾Á°¤Ï +Âçʸ»ú¤â¤·¤¯¤Ï¾®Ê¸»ú¤Ç¹½À®¤µ¤ì¤ë¡£4.4BSD ¤Î termcap ¥¨¥ó¥È¥ê¤Ç¤Ï¡¢ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¾Êά¤µ¤ì¤ë¡£ +.LP +2 ÈÖÌÜ (ºÇ¿·¤Î 4.4BSD ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤Ï 1 ÈÖÌÜ) ¤Î¥µ¥Ö¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢ +´Ä¶­ÊÑ¿ô +.B TERM +¤ÇÍѤ¤¤é¤ì¤ë̾¾Î¤¬Æþ¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¾®Ê¸»ú¤·¤«»È¤¨¤Ê¤¤¡£ +ÁªÂò²Äǽ¤Ê¥Ï¡¼¥É¥¦¥§¥¢µ¡Ç½¤Ï¡¢¥Ï¥¤¥Õ¥ó¤ÈÀÜÈø¸ì (suffix) +¤ò̾¾Î¤Î¸å¤ËÄɲ乤뤳¤È¤Ë¤è¤Ã¤Æ¼¨¤¹É¬Íפ¬¤¢¤ë¡£°Ê²¼¤ÎÎã¤ò¸«¤è¡£ +´·½¬Åª¤ÊÀÜÈø¸ì¤Ë¤Ï¡¢w (80 ʸ»ú°Ê¾å¤ÎÉý¤¬¤¢¤ë)¡¢ +am (automatic margins: ¼«Æ°Åª¤Ê¹Ô¤ÎÀÞ¤êÊÖ¤·)¡¢ +nam (non automatic margins: ¼«Æ°Åª¤Ç¤Ê¤¤¹Ô¤ÎÀÞ¤êÊÖ¤·)¡¢ +rv (reverse video display: ȿž¥Ó¥Ç¥ªÉ½¼¨) +¤Ê¤É¤¬¤¢¤ë¡£ +3ÈÖÌܤΥµ¥Ö¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢ +¤³¤Îtermcap¥¨¥ó¥È¥ê¡¼¤ËÂФ¹¤ëŤ¤ÀâÌÀŪ¤Ê̾¾Î¤¬Æþ¤ë¡£ +.LP +¤³¤Î¸å¤Ë³¤¯¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢Ã¼Ëö¤Îµ¡Ç½¤òµ­½Ò¤¹¤ë¡£ +µ¡Ç½¤òµ­½Ò¤¹¤ë¹Ô¤¬·Ñ³¤¹¤ë¾ì¹ç¤Ï¡¢ +º¸Ã¼¤«¤é1¤Ä¤Î¥¿¥Ö¤ò¤ª¤¤¤Æ¥¤¥ó¥Ç¥ó¥È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.LP +½ç½ø¤Ë¤Ä¤¤¤Æ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +Âçʸ»ú¾®Ê¸»ú¤Ï¶èÊ̤»¤º¤Ë¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Ë¤Ê¤é¤Ù¡¢ +»Ï¤á¤Ï¥Ö¡¼¥ëÃͤΡ¢¼¡¤Ï¿ôÃͤΡ¢ºÇ¸å¤Ïʸ»úÎó¤Îµ¡Ç½¤ò½ñ¤¯¤³¤È¤¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +Ʊ¤¸¤è¤¦¤ÊƯ¤­¤ò¤¹¤ëµ¡Ç½¤Ï 1 ¹Ô¤Ë¤Þ¤È¤á¤Æ½ñ¤¯¤ÈÎɤ¤¡£ +.LP +.nf +Îã: +.sp +Head line: vt|vt101|DEC VT 101 terminal in 80 character mode:\e +Head line: Vt|vt101-w|DEC VT 101 terminal in (wide) 132 character mode:\e +Boolean: :bs:\e +Numeric: :co#80:\e +String: :sr=\eE[H:\e +.fi +.SS "¥Ö¡¼¥ëÃͤǻØÄꤹ¤ëµ¡Ç½" +.nf +5i ¥×¥ê¥ó¥¿¤Ï¥¹¥¯¥ê¡¼¥ó¤Ë¥¨¥³¡¼¤·¤Ê¤¤ +am ¼«Æ°¥Þ¡¼¥¸¥ó¡£¼«Æ°Åª¤Ë¹Ô¤òÀÞ¤êÊÖ¤¹ +bs ¥³¥ó¥È¥í¡¼¥ë H (¥­¡¼¥³¡¼¥É 8) ¤ò¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤È¤·¤Æ°·¤¦ +bw º¸Ã¼¤Ç¤Î¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤ò¡¢¾å¤Î¹Ô¤Î±¦Ã¼¤ËÀÞ¤êÊÖ¤¹ +da ²èÌ̤ξåü¤«¤é³°¤ì¤Æ¤¤¤¿¹Ô¤òɽ¼¨¤¹¤ë (Ä̾ï¤Ï¥Þ¥ë¥Á¥Ú¡¼¥¸Ã¼Ëö¤Ç) +db ²èÌ̤β¼Ã¼¤«¤é³°¤ì¤Æ¤¤¤¿¹Ô¤òɽ¼¨¤¹¤ë (Ä̾ï¤Ï¥Þ¥ë¥Á¥Ú¡¼¥¸Ã¼Ëö¤Ç) +eo ¶õÇòʸ»ú¤Ï¥«¡¼¥½¥ë°ÌÃÖ¤ÎÁ´¤Æ¤Îʸ»ú¤ò¾Ã¤¹ +es ¥¹¥Æ¡¼¥¿¥¹¹Ô¾å¤Î¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤äÆüìʸ»ú¤ÏÍ­¸ú¤ËƯ¤¯ +gn °ìÈÌŪ¤Ê¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë +hc ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ç¤¢¤ë +HC ºÇ²¼¹Ô¤Ë¤Ê¤¤¥«¡¼¥½¥ë¤Ï¸«¤Å¤é¤¤ +hs ¥¹¥Æ¡¼¥¿¥¹¹Ô¤¬¤¢¤ë +hz ¥Á¥ë¥Àʸ»ú¤¬É½¼¨¤Ç¤­¤Ê¤¤Ã¼Ëö¤Ç¤¢¤ë (Hazeltine üËö¤Î¥Ð¥°) +in ¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤òËä¤á¤ë¤Î¤Ë¡¢¥¹¥Ú¡¼¥¹¤Ç¤Ï¤Ê¤¯ NULL ¥Ð¥¤¥È¤òÁÞÆþ¤¹¤ëüËö¤Ç¤¢¤ë +km üËö¤Ë¤Ï¥á¥¿¥­¡¼¤¬¤¢¤ë +mi ÁÞÆþ¥â¡¼¥É¤Ç¤â¥«¡¼¥½¥ë°ÜÆ°¤¬¤Ç¤­¤ë +ms ¶¯Ä´/²¼Àþ¥â¡¼¥É¤Ç¤â¥«¡¼¥½¥ë°ÜÆ°¤¬¤Ç¤­¤ë +NP ¥Ñ¥Ç¥£¥ó¥°Ê¸»ú¤¬¤Ê¤¤ +NR ti ¤Ï te ¤òȿž¤·¤Ê¤¤ +nx ¥Ñ¥Ç¥£¥ó¥°¤Ç¤Ï¤Ê¤¯¡¢XON/XOFF ¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +os ½Å¤ÍÂǤÁ¤¬²Äǽ¤ÊüËö¤Ç¤¢¤ë +ul ½Å¤ÍÂǤÁ¤Ï¤Ç¤­¤Ê¤¤¤¬¡¢²¼Àþɽ¼¨¤Î¤Ç¤­¤ëüËö¤Ç¤¢¤ë +xb f1 ¤Ï¥¨¥¹¥±¡¼¥×¤òÁ÷¿®¤·¡¢f2 ¤Ï \fB^C\fP ¤òÁ÷¿®¤¹¤ë (Beehive üËö¤ÎÉÔ¶ñ¹ç) +xn ²þ¹Ô/ÀÞ¤êÊÖ¤·¤ËÉÔ¶ñ¹ç¤¬¤¢¤ë +xo üËö¤Ï xon/xoff ¥×¥í¥È¥³¥ë¤òÍѤ¤¤ë +xs ¶¯Ä´Ê¸»ú¤Î¾å¤Ë½ÐÎϤµ¤ì¤¿Ê¸»ú¤Ï¶¯Ä´Ê¸»ú¤È¤·¤Æɽ¼¨¤µ¤ì¤ë +xt Ç˲õŪ¤Ê¥¿¥Ö¤ÈÃæÅÓȾü¤Ê¶¯Ä´¥â¡¼¥É (Teleray üËö¤ÎÉÔ¶ñ¹ç) +.fi +.SS "¿ôÃͤǻØÄꤹ¤ëµ¡Ç½" +.nf +co üËö¤Î¹Ô¿ô +dB ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ë¤ª¤¤¤Æ¡¢¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤ËɬÍפÊÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì) +dC ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ë¤ª¤¤¤Æ¡¢Éüµ¢¤ËɬÍפÊÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì) +dF ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ë¤ª¤¤¤Æ¡¢ÊÇÁ÷¤ê¤ËɬÍפÊÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì) +dN ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ë¤ª¤¤¤Æ¡¢²þ¹Ô¤ËɬÍפÊÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì) +dT ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ë¤ª¤¤¤Æ¡¢¥¿¥Ö¥¹¥È¥Ã¥×¤ËɬÍפÊÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì) +dV ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ë¤ª¤¤¤Æ¡¢¿âľ¥¿¥Ö¤ËɬÍפÊÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì) +it ¥¿¥Ö°ÌÃÖ´Ö¤Îʸ»ú¿ô +lh ¥½¥Õ¥È¥é¥Ù¥ë¤Î¹â¤µ +lm ²èÌÌ¥á¥â¥ê¤Ë¼ýÍƤǤ­¤ë¹Ô¿ô +lw ¥½¥Õ¥È¥é¥Ù¥ë¤ÎÉý +li ¹Ô¿ô +Nl ¥½¥Õ¥È¥é¥Ù¥ë¤Î¿ô +pb ¥Ñ¥Ç¥£¥ó¥°¤¬É¬ÍפȤʤëºÇÄã¤Î¥Ü¡¼¥ì¡¼¥È +sg ¶¯Ä´É½¼¨¤ÎÉÔ¶ñ¹ç (¶¯Ä´É½¼¨¤ËÀÚÂؤ¨¤¿¤È¤­¤Ëɽ¼¨¤µ¤ì¤ë¥¹¥Ú¡¼¥¹¤Î¿ô) +ug ²¼Àþɽ¼¨¤ÎÉÔ¶ñ¹ç (¶¯Ä´É½¼¨¤ËÀÚÂؤ¨¤¿¤È¤­¤Ëɽ¼¨¤µ¤ì¤ë¥¹¥Ú¡¼¥¹¤Î¿ô) +vt ²¾ÁÛüËöÈÖ¹æ +ws ¥¹¥Æ¡¼¥¿¥¹¹Ô¤ÎÉý (²èÌÌÉý¤È°Û¤Ê¤ë¾ì¹ç) +.fi +.SS "ʸ»úÎó¤Ç»ØÄꤹ¤ëµ¡Ç½" +.nf +!1 ¥·¥Õ¥È¾õÂ֤Πsave ¥­¡¼ +!2 ¥·¥Õ¥È¾õÂ֤Πsuspend ¥­¡¼ +!3 ¥·¥Õ¥È¾õÂ֤Πundo ¥­¡¼ +#1 ¥·¥Õ¥È¾õÂ֤Πhelp ¥­¡¼ +#2 ¥·¥Õ¥È¾õÂ֤Πhome ¥­¡¼ +#3 ¥·¥Õ¥È¾õÂ֤Πinput ¥­¡¼ +#4 ¥·¥Õ¥È¾õÂ֤κ¸¥«¡¼¥½¥ë¥­¡¼ +%0 redo ¥­¡¼ +%1 help ¥­¡¼ +%2 mark¥­¡¼ +%3 message ¥­¡¼ +%4 move ¥­¡¼ +%5 next-object ¥­¡¼ +%6 open ¥­¡¼ +%7 options ¥­¡¼ +%8 previous-object ¥­¡¼ +%9 print ¥­¡¼ +%a ¥·¥Õ¥È¾õÂ֤Πmessage ¥­¡¼ +%b ¥·¥Õ¥È¾õÂ֤Πmove ¥­¡¼ +%c ¥·¥Õ¥È¾õÂ֤Πnext ¥­¡¼ +%d ¥·¥Õ¥È¾õÂ֤Πoptions ¥­¡¼ +%e ¥·¥Õ¥È¾õÂ֤Πprevious ¥­¡¼ +%f ¥·¥Õ¥È¾õÂ֤Πprint ¥­¡¼ +%g ¥·¥Õ¥È¾õÂ֤Πredo ¥­¡¼ +%h ¥·¥Õ¥È¾õÂ֤Πreplace ¥­¡¼ +%i ¥·¥Õ¥È¾õÂ֤ᦥ«¡¼¥½¥ë¥­¡¼ +%j ¥·¥Õ¥È¾õÂ֤Πresume ¥­¡¼ +&0 ¥·¥Õ¥È¾õÂ֤Πcancel ¥­¡¼ +&1 reference ¥­¡¼ +&2 refresh ¥­¡¼ +&3 replace ¥­¡¼ +&4 restart ¥­¡¼ +&5 resume ¥­¡¼ +&6 save ¥­¡¼ +&7 suspend ¥­¡¼ +&8 undo ¥­¡¼ +&9 ¥·¥Õ¥È¾õÂ֤Πbegin ¥­¡¼ +*0 ¥·¥Õ¥È¾õÂ֤Πfind ¥­¡¼ +*1 ¥·¥Õ¥È¾õÂ֤Πcommand ¥­¡¼ +*2 ¥·¥Õ¥È¾õÂ֤Πcopy ¥­¡¼ +*3 ¥·¥Õ¥È¾õÂ֤Πcreate ¥­¡¼ +*4 ¥·¥Õ¥È¾õÂ֤Πdelete ¥­¡¼ +*5 ¥·¥Õ¥È¾õÂ֤Πdelete line ¥­¡¼ +*6 select ¥­¡¼ +*7 ¥·¥Õ¥È¾õÂ֤Πend ¥­¡¼ +*8 ¥·¥Õ¥È¾õÂ֤Πclear line ¥­¡¼ +*9 ¥·¥Õ¥È¾õÂ֤Πexit ¥­¡¼ +@0 find ¥­¡¼ +@1 begin ¥­¡¼ +@2 cancel ¥­¡¼ +@3 close ¥­¡¼ +@4 command ¥­¡¼ +@5 copy ¥­¡¼ +@6 create ¥­¡¼ +@7 end ¥­¡¼ +@8 enter/send ¥­¡¼ +@9 exit ¥­¡¼ +al 1 ¹ÔÁÞÆþ¤¹¤ë +AL %1 ¹ÔÁÞÆþ¤¹¤ë +ac ¿Þ·Áʸ»ú¤Î¥Ú¥¢¤Î½¸¹ç¡£ÂåÂØʸ»ú¥»¥Ã¥È¤Ë¥Þ¥Ã¥×¤¹¤ë¤¿¤á¤Î¤â¤Î +ae ÂåÂØʸ»ú¥»¥Ã¥È¤Î½ª¤ê +as ¿Þ·Áʸ»ú½¸¹ç¤ËÂФ¹¤ë¡¢ÂåÂØʸ»ú¥»¥Ã¥È¤Î³«»Ï +bc \fB^H\fP ¤¬¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤Ç¤Ê¤¤¾ì¹ç¤Î¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹ +bl (²»À¼¤Î) ¥Ù¥ë¤òÌĤ餹 +bt Á°¤Î¥¿¥Ö¥¹¥È¥Ã¥×¤Ø°ÜÆ° +cb ¹ÔƬ¤«¤é¥«¡¼¥½¥ë°ÌÃ֤ޤǤΥ¯¥ê¥¢ +cc ¥À¥ß¡¼¥³¥Þ¥ó¥Éʸ»ú +cd ²èÌ̤κǸå¤Þ¤Ç¤ò¥¯¥ê¥¢ +ce ¹Ô¤ÎºÇ¸å¤Þ¤Ç¤ò¥¯¥ê¥¢ +ch ¥«¡¼¥½¥ë¤ò¿åÊ¿Êý¸þ¤Ë¤À¤±°ÜÆ°¤·¡¢ %1 ·å¤Î°ÌÃ֤ˤ¹¤ë +cl ²èÌ̤ò¾Ãµî¤·¡¢¥«¡¼¥½¥ë¤ò¥Û¡¼¥à¥Ý¥¸¥·¥ç¥ó¤Ø +cm ²èÌ̾å¤Î %1 ¹Ô¡¢ %2 ·å¤Ø¥«¡¼¥½¥ë¤ò°ÜÆ° +CM ¥á¥â¥ê¾å¤Î %1 ¹Ô¡¢ %2 ·å¤Ø¥«¡¼¥½¥ë¤ò°ÜÆ° +cr Éüµ¢ +cs %1 ¹ÔÌܤ«¤é %2 ¹ÔÌܤޤǤÎÈϰϤò¥¹¥¯¥í¡¼¥ë¤¹¤ë +ct ¥¿¥Ö¤Î¾Ãµî +cv ¥«¡¼¥½¥ë¤ò¿âľÊý¸þ¤Ë¤À¤±°ÜÆ°¤·¡¢ %1 ¹Ô¤Î°ÌÃ֤ˤ¹¤ë +dc °ìʸ»úºï½ü¤¹¤ë +DC %1 ʸ»úºï½ü¤¹¤ë +dl °ì¹Ôºï½ü¤¹¤ë +DL %1 ¹Ôºï½ü¤¹¤ë +dm delete ¥â¡¼¥É³«»Ï +do ¥«¡¼¥½¥ë¤ò°ì¹Ô²¼¤²¤ë +DO ¥«¡¼¥½¥ë¤ò #1 ¹Ô²¼¤²¤ë +ds ¥¹¥Æ¡¼¥¿¥¹¹Ô¤ò̵¸ú¤Ë¤¹¤ë +eA ÂåÂØʸ»ú½¸¹ç¤òÍ­¸ú¤Ë¤¹¤ë +ec ¥«¡¼¥½¥ë°ÌÃÖ¤«¤é %1 ʸ»ú¾Ãµî¤¹¤ë +ed delete ¥â¡¼¥É½ªÎ» +ei intert ¥â¡¼¥É½ªÎ» +ff ¥Ï¡¼¥É¥³¥Ô¡¼Ã¼Ëö¤Ç¤ÎÊÇÁ÷¤êʸ»ú +fs ¥¹¥Æ¡¼¥¿¥¹¹Ô¤Ë°ÜÆ°¤¹¤ëÁ°¤Î°ÌÃÖ¤ØÉüµ¢¤¹¤ëʸ»ú +F1 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f11 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +F2 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f12 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +F3 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f13 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +\&... \&... +F9 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f19 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +FA ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f20 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +FB ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f21 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +\&... \&... +FZ ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f45 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +Fa ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f46 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +Fb ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f47 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +\&... \&... +Fr ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ f63 ¤¬Á÷½Ð¤¹¤ëʸ»úÎó +hd ¥«¡¼¥½¥ë¤ò°ì¹Ô¤ÎȾʬ¤À¤±²¼¤Ë°ÜÆ° +ho ¥«¡¼¥½¥ë¤ò¥Û¡¼¥à¥Ý¥¸¥·¥ç¥ó¤Ë°ÜÆ° +hu ¥«¡¼¥½¥ë¤ò°ì¹Ô¤ÎȾʬ¤À¤±¾å¤Ë°ÜÆ° +i1 ¥í¥°¥¤¥ó»þ¤Î½é´ü²½Ê¸»úÎó 1 +i3 ¥í¥°¥¤¥ó»þ¤Î½é´ü²½Ê¸»úÎó 3 +is ¥í¥°¥¤¥ó»þ¤Î½é´ü²½Ê¸»úÎó 2 +ic °ìʸ»úÁÞÆþ +IC %1 ʸ»úÁÞÆþ +if ½é´ü²½¥Õ¥¡¥¤¥ë +im insert ¥â¡¼¥É³«»Ï +ip ÁÞÆþ¸å¤Î¥Ñ¥Ç¥£¥ó¥°¤ËɬÍפʻþ´Ö¤ÈÆüìʸ»ú +iP ½é´ü²½¥×¥í¥°¥é¥à +K1 ¥­¡¼¥Ñ¥Ã¥É¤Îº¸¾å¥­¡¼ +K2 ¥­¡¼¥Ñ¥Ã¥É¤ÎÃæ±û¥­¡¼ +K3 ¥­¡¼¥Ñ¥Ã¥É¤Î±¦¾å¥­¡¼ +K4 ¥­¡¼¥Ñ¥Ã¥É¤Îº¸²¼¥­¡¼ +K5 ¥­¡¼¥Ñ¥Ã¥É¤Î±¦²¼¥­¡¼ +k0 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 0 +k1 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 1 +k2 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 2 +k3 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 3 +k4 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 4 +k5 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 5 +k6 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 6 +k7 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 7 +k8 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 8 +k9 ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 9 +k; ¥Õ¥¡¥ó¥¯¥·¥ç¥ó¥­¡¼ 10 +ka clea all tabs ¥­¡¼ +kA insert line ¥­¡¼ +kb ¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¥­¡¼ +kB back tab ¥­¡¼ +kC clear screen ¥­¡¼ +kd ²¼¥«¡¼¥½¥ë¥­¡¼ +kD ¥«¡¼¥½¥ë°ÌÃÖ¤Îʸ»ú¤ò¾Ã¤¹¥­¡¼ +ke ¥­¡¼¥Ñ¥Ã¥É¤ò¥ª¥Õ¤Ë¤¹¤ë +kE ¹ÔËö¤Þ¤Ç¤ò¥¯¥ê¥¢¤¹¤ë¥­¡¼ +kF Á°Êý¸þ/²¼Êý¸þ¤Ø¥¹¥¯¥í¡¼¥ë¤¹¤ë¥­¡¼ +kh home ¥­¡¼ +kH cursor hown down ¥­¡¼ +kI ʸ»úÁÞÆþ¥­¡¼/insert ¥â¡¼¥É¥­¡¼ +kl º¸¥«¡¼¥½¥ë¥­¡¼ +kL ¹Ô¤òºï½ü¤¹¤ë¥­¡¼ +kM insert ¥â¡¼¥É¤ò½ªÎ»¤¹¤ë¥­¡¼ +kN ¼¡¤Î¥Ú¡¼¥¸¤Ø°ÜÆ°¤¹¤ë¥­¡¼ +kP Á°¤Î¥Ú¡¼¥¸¤Ø°ÜÆ°¤¹¤ë¥­¡¼ +kr ±¦¥«¡¼¥½¥ë¥­¡¼ +kR ¸å¤íÊý¸þ/¾åÊý¸þ¤Ë¥¹¥¯¥í¡¼¥ë¤¹¤ë¥­¡¼ +ke ¥­¡¼¥Ñ¥Ã¥É¤ò¥ª¥ó¤Ë¤¹¤ë +kS ²èÌ̺Ǹå¤Þ¤Ç¤ò¥¯¥ê¥¢¤¹¤ë¥­¡¼ +kt ¥¿¥Ö¥¯¥ê¥¢¥­¡¼ +kT ¥¿¥Ö¥¹¥È¥Ã¥×ÀßÄꥭ¡¼ +ku ¾å¥«¡¼¥½¥ë¥­¡¼ +l0 0 ÈÖÌܤΥե¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Î¥é¥Ù¥ë (f0 ¤Ç¤Ê¤¤¾ì¹ç) +l1 1 ÈÖÌܤΥե¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Î¥é¥Ù¥ë (f1 ¤Ç¤Ê¤¤¾ì¹ç) +l2 2 ÈÖÌܤΥե¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Î¥é¥Ù¥ë (f2 ¤Ç¤Ê¤¤¾ì¹ç) +\&... \&... +la 10 ÈÖÌܤΥե¡¥ó¥¯¥·¥ç¥ó¥­¡¼¤Î¥é¥Ù¥ë (f10 ¤Ç¤Ê¤¤¾ì¹ç) +le ¥«¡¼¥½¥ë¤òº¸¤Ø°ìʸ»úʬ°ÜÆ°¤¹¤ë +ll ¥«¡¼¥½¥ë¤òº¸²¼¶ù¤Ë°ÜÆ°¤¹¤ë +LE ¥«¡¼¥½¥ë¤òº¸ %1 ʸ»úʬ°ÜÆ°¤¹¤ë +LF ¥½¥Õ¥È¥é¥Ù¥ë¤ò¥ª¥Õ¤Ë¤¹¤ë +LO ¥½¥Õ¥È¥é¥Ù¥ë¤ò¥ª¥ó¤Ë¤¹¤ë +mb ÅÀÌdz«»Ï +MC ¥½¥Õ¥È¥Þ¡¼¥¸¥ó¤ò¥¯¥ê¥¢ +md bold ¥â¡¼¥É³«»Ï +me so, us, mb, md, mr ¤Ê¤É¤Î¥â¡¼¥ÉÁ´¤Æ¤ò½ªÎ»¤¹¤ë +mh Ⱦµ±Å٥⡼¥É³«»Ï +mk ¥À¡¼¥¯¥â¡¼¥É (ʸ»ú¤Ï¸«¤¨¤Ê¤¯¤Ê¤ë) +ML º¸Â¦¤Î¥½¥Õ¥È¥Þ¡¼¥¸¥ó¤òÀßÄê +mm üËö¤ò¥á¥¿¥â¡¼¥É¤ËÀßÄꤹ¤ë +mo üËö¤ò¥á¥¿¥â¡¼¥É¤Ç¤Ê¤¯¤¹¤ë +mp °À­Êݸî¥â¡¼¥É¤ò¥ª¥ó¤Ë¤¹¤ë +mr ȿž¥â¡¼¥É³«»Ï +MR ±¦Ã¼¤Î¥½¥Õ¥È¥Þ¡¼¥¸¥ó¤òÀßÄê +nd ¥«¡¼¥½¥ë¤ò±¦¤Ë°ìʸ»úʬ°ÜÆ° +nw Éüµ¢¥³¥Þ¥ó¥É +pc ¥Ñ¥Ç¥£¥ó¥°Ê¸»ú +pf ¥×¥ê¥ó¥¿¤ò¥ª¥Õ¤Ë¤¹¤ë +pk ¥æ¡¼¥¶¤¬ÆþÎϤ·¤¿¤È¤­¤Ëʸ»úÎó %2 ¤òÁ÷½Ð¤¹¤ë¥×¥í¥°¥é¥à¥­¡¼ %1 +pl ¥í¡¼¥«¥ë¥â¡¼¥É¤Çʸ»úÎó %2 ¤ò¼Â¹Ô¤¹¤ë¥×¥í¥°¥é¥à¥­¡¼ %1 +pn ʸ»úÎó %2 ¤òɽ¼¨¤¹¤ë¤¿¤á¤Î¥×¥í¥°¥é¥à¥½¥Õ¥È¥é¥Ù¥ë %1 +po ¥×¥ê¥ó¥¿¤ò¥ª¥ó¤Ë¤¹¤ë +pO %1 (<256) ¥Ð¥¤¥È¤Î´Ö¥×¥ê¥ó¥¿¤ò¥ª¥ó¤Ë¤¹¤ë +ps ²èÌ̾å¤ÎÆâÍƤò¥×¥ê¥ó¥¿¤Ë°õºþ¤¹¤ë +px ʸ»úÎó %2 ¤ò¥³¥ó¥Ô¥å¡¼¥¿¤ËÁ÷½Ð¤¹¤ë¥×¥í¥°¥é¥à¥­¡¼ %1 +r1 üËö¤òÀµ¾ï¤Ê¥â¡¼¥É¤ËÀßÄꤹ¤ë¥ê¥»¥Ã¥Èʸ»úÎó 1 +r2 üËö¤òÀµ¾ï¤Ê¥â¡¼¥É¤ËÀßÄꤹ¤ë¥ê¥»¥Ã¥Èʸ»úÎó 2 +r3 üËö¤òÀµ¾ï¤Ê¥â¡¼¥É¤ËÀßÄꤹ¤ë¥ê¥»¥Ã¥Èʸ»úÎó 3 +RA ¼«Æ°ÀÞ¤êÊÖ¤·¤ò̵¸ú¤Ë¤¹¤ë +rc Êݸ¤·¤Æ¤ª¤¤¤¿¥«¡¼¥½¥ë°ÌÃÖ¤ËÉüµ¢¤¹¤ë +rf ¥ê¥»¥Ã¥Èʸ»úÎó¤ÎÆþ¤Ã¤¿¥Õ¥¡¥¤¥ë̾ +RF üËö¤«¤é¤ÎÆþÎÏÍ×µá +RI ¥«¡¼¥½¥ë¤ò±¦¤Ø %1 ʸ»úʬ°ÜÆ°¤¹¤ë +rp ʸ»ú %1 ¤ò %2 ²óʬ·«¤êÊÖ¤¹ +rP ÃÖ´¹¥â¡¼¥É¤Ë¤ª¤¤¤Æ¡¢Ê¸»ú¤òÁ÷½Ð¤·¤¿¸å¤Ë¹Ô¤¦¥Ñ¥Ç¥£¥ó¥° +rs ¥ê¥»¥Ã¥Èʸ»úÎó +RX XON/XOFF ¥Õ¥í¡¼À©¸æ¤ò¥ª¥Õ¤Ë¤¹¤ë +sa °À­ %1 %2 %3 %4 %5 %6 %7 %8 %9 ¤òÀßÄê +SA ¼«Æ°ÀÞ¤êÊÖ¤·¤òÍ­¸ú¤Ë¤¹¤ë +sc ¥«¡¼¥½¥ë°ÌÃÖ¤òÊݸ¤¹¤ë +se ¶¯Ä´¥â¡¼¥É½ªÎ» +sf ½çÊý¸þ¤Î 1 ¹Ô¥¹¥¯¥í¡¼¥ë +SF ½çÊý¸þ¤Î %1 ¹Ô¥¹¥¯¥í¡¼¥ë +so ¶¯Ä´¥â¡¼¥É³«»Ï +sr µÕ¥¹¥¯¥í¡¼¥ë +SR %1 ¹ÔʬµÕ¥¹¥¯¥í¡¼¥ë¤¹¤ë +st Á´¤Æ¤Î¹Ô¤Ë¤ª¤¤¤Æ¡¢¸½ºß¤Î·å°ÌÃÖ¤ò¥¿¥Ö¥¹¥È¥Ã¥×¤ËÀßÄꤹ¤ë +SX XON/XOFF ¥Õ¥í¡¼À©¸æ¤ò¥ª¥ó¤Ë¤¹¤ë +ta ¼¡¤Î¥Ï¡¼¥É¥¦¥§¥¢¥¿¥Ö°ÌÃ֤ذÜÆ° +tc ¾¤Î¥¨¥ó¥È¥ê¤«¤éüËö¤ÎÀâÌÀ¤òÆɤà¹þ¤à +te ¥«¡¼¥½¥ë°ÜÆ°¤òÍѤ¤¤ë¥×¥í¥°¥é¥à¤Î½ªÎ» +ti ¥«¡¼¥½¥ë°ÜÆ°¤òÍѤ¤¤ë¥×¥í¥°¥é¥à¤Î³«»Ï +ts ¥¹¥Æ¡¼¥¿¥¹¹Ô¤Î¥«¡¼¥½¥ë¤ò %1 ·å¤Ø°ÜÆ° +uc ¥«¡¼¥½¥ë°ÌÃÖ¤Îʸ»ú¤Ë²¼Àþ¤ò¤Ä¤±¡¢±¦¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ° +ue ²¼Àþ¥â¡¼¥É½ªÎ» +up ¥«¡¼¥½¥ë¤ò 1 ¹Ôʬ¾å¤Ë°ÜÆ° +UP ¥«¡¼¥½¥ë¤ò %1 ¹Ôʬ¾å¤Ë°ÜÆ° +us ²¼Àþ¥â¡¼¥É³«»Ï +vb ¥Ó¥¸¥å¥¢¥ë¥Ù¥ë +ve ¥«¡¼¥½¥ë¤òÄ̾ï¤ÎÌÀ¤ë¤µ¤Ë¤¹¤ë +vi ¥«¡¼¥½¥ë¤ò¸«¤¨¤Ê¤¯¤¹¤ë +vs ¶¯Ä´¥«¡¼¥½¥ë +wi ¥¦¥£¥ó¥É¥¦Îΰè¤ò %1¡Á%2 ¹Ô¡¢%3¡Á%4 ·å¤ËÀßÄê +XF XOFF À©¸æʸ»ú (\fB^S\fP ¤Ç¤Ê¤¤¾ì¹ç) +.fi +.LP +ʸ»úÎóµ¡Ç½¤ÎÀ©¸æ¥³¡¼¥É¤òÄêµÁ¤¹¤ë¤Ë¤Ï¡¢¤¤¤¯¤Ä¤«¤ÎÊýË¡¤¬¤¢¤ë¡£ +.LP +\&\(aq^\(aq, \(aq\e\(aq, \(aq%\(aq ¤ò½ü¤¯Á´¤Æ¤ÎÄ̾ï¤Îʸ»ú¤Ï¡¢¤½¤ì¼«¿È¤òɽ¤¹¡£ +.LP +\fB^x\fP ¤Ï Control-x ¤ò°ÕÌ£¤¹¤ë¡£ Control-A ¤Ï 10 ¿Ê¿ô¤Î 1 ¤ËÅù¤·¤¤¡£ +.\"NAKANO: 1 decimal? +.LP +\&\ex ¤ÏÆü쥳¡¼¥É¤È¤·¤Æ°·¤ï¤ì¤ë¡£x ¤Ë¤Ï°Ê²¼¤Îʸ»ú¤Î¤É¤ì¤«¤¬Æþ¤ë¡£ +.RS +E ¥¨¥¹¥±¡¼¥× (27) +.br +n ¥é¥¤¥ó¥Õ¥£¡¼¥É (10) +.br +r Éüµ¢ (13) +.br +t ¥¿¥Ö (9) +.br +b ¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹ (8) +.br +f ÊÇÁ÷¤ê (12) +.br +0 ¥Ì¥ë¥­¥ã¥é¥¯¥¿¡£'\exxx' ¤Ï 8 ¿Ê¿ô xxx ¤Îʸ»ú¤òɽ¤¹¡£ +.RE +.IP i +¥Ñ¥é¥á¡¼¥¿¤ò 1 Áý²Ã¤µ¤»¤ë¡£ +.IP r +°ì¤Ä¤Î¥Ñ¥é¥á¡¼¥¿¤ò¤È¤ëµ¡Ç½ +.IP + +¼¡¤Îʸ»ú¤ÎÃͤò¥Ñ¥é¥á¡¼¥¿¤ËÄɲä·¡¢¥Ð¥¤¥Ê¥ê¤Ç½ÐÎϤ¹¤ë +.IP 2 +¥Ñ¥é¥á¡¼¥¿¤ò 2 ·å¤Î¿ô»ú¤È¤·¤Æ ASCII ½ÐÎϤ¹¤ë (printf ¤Î %2d ¤ÈƱ¤¸°ÕÌ£) +.IP d +¥Ñ¥é¥á¡¼¥¿¤ò¿ô»ú¤È¤·¤Æ ASCII ½ÐÎϤ¹¤ë (printf ¤Î %d ¤ÈƱ¤¸°ÕÌ£) +.IP % +\(aq%\(aq ¤òɽ¼¨¤¹¤ë +.LP +¥Ð¥¤¥Ê¥ê½ÐÎϤò¹Ô¤¦¾ì¹ç¡¢ +ʸ»úÎó¤ò½ªÃ¼¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¥Ì¥ëʸ»ú¤òÈò¤±¤Í¤Ð¤Ê¤é¤Ê¤¤¡£ +¥¿¥Öʸ»ú¤ò¥Ñ¥é¥á¡¼¥¿¤Î¥Ð¥¤¥Ê¥ê½ÐÎϤȤ¹¤ë¾ì¹ç¤Ï¡¢ +¥¿¥Öʸ»ú¤ÎŸ³«¤ò¥ê¥»¥Ã¥È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP Ãí°Õ: +¾åµ­¤Î¤è¤¦¤Ê¡¢¥Ñ¥é¥á¡¼¥¿¤È¤·¤Æ¤Î¥á¥¿Ê¸»ú¤ÏÀµ¤·¤¯¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î¤³¤È¤Ï¡¢Minix¤Î termcap ¤È +Linux ¤Î termcap ¤È¤Î´Ö¤Ë¸ß´¹À­¤¬¤Ê¤¤¤³¤È¤Ë·Ò¤¬¤Ã¤Æ¤¤¤ë¡£ +.\"NAKANO: ¤¢¤ä¤·¤¤¡£ +.LP +¿Þ·Áʸ»ú¤Ï 3 ¤Ä¤Îʸ»úÎóµ¡Ç½¤Ç»ØÄê¤Ç¤­¤ë¡£ +.IP as +ÂåÂØʸ»ú¥»¥Ã¥È¤Î³«»Ï +.IP ae +ÂåÂØʸ»ú¥»¥Ã¥È¤Î½ªÎ» +.IP ac +ʸ»úÎó¤Î¥Ú¥¢¤Î½¸¹ç¤ò»ØÄꤹ¤ë¡£ +ºÇ½é¤Îʸ»ú¤Ï¿Þ·Áʸ»ú¤Î̾¾Î¤Ç¡¢ +2 ÈÖÌܤÎʸ»ú¤Ï¤½¤ÎÄêµÁ¤Ç¤¢¤ë¡£ +.LP +̾¾Î¤Ë¤Ï°Ê²¼¤Î¤â¤Î¤¬¤¢¤ë¡£ +.sp +.nf ++ ±¦Ìð°õ (>) +, º¸Ìð°õ (<) +\&. ²¼Ìð°õ (v) +0 ¤Ê¤«¤òÅɤê¤Ä¤Ö¤·¤¿»Í³Ñ (#) +I ¥é¥ó¥¿¥óµ­¹æ (#) +(ÌõÃí ¸¶Ê¸¤Ï latern ¤À¤Ã¤¿¤¬¡¢¤³¤ì¤Ï lantern ¤Î typo ¤È»×¤ï¤ì¤ë) +- ¾åÌð°õ (^) +\&' É©·Á (+) +a ¥Á¥§¥¹ÈÄ (:) +f ³ÑÅÙ (') +g ¥×¥é¥¹¥Þ¥¤¥Ê¥¹ (#) +h »Í³Ñ (#) +j ±¦²¼¶ù (+) +k ±¦¾å¶ù (+) +l º¸¾å¶ù (+) +m º¸²¼¶ù (+) +n ½½»ú (+) +o ¾å¿åÊ¿Àþ (-) +q Ãæ¿åÊ¿Àþ (-) +s ²¼¿åÊ¿Àþ (_) +t º¸ T »ú (+) +u ±¦ T »ú (+) +v ²¼ T »ú (+) +w Àµ T »ú (+) +x ¿âľÀþ (|) +~ ÃÊÍî (???) +.fi +.sp +³ç¸ÌÆâ¤ÎÃͤϡ¢ +»ØÄꤷ¤¿µ¡Ç½¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¥Ç¥Õ¥©¥ë¥È¤ÎÃͤǤ¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ncurses (3), +.BR termcap (3), +.BR terminfo (5) +.SH ¹»Àµ¼Ôµ­ +Ìõ½Ð¤Ë¤¢¤¿¤Ã¤Æ¤Ï "\fBtermcap & terminfo\fP" +(Strang, Mui, O'reilly ¶¦Ãø, ÎëÌÚÎï ´ÆÌõ, ¥¢¥¹¥­¡¼½ÐÈÇ¶É 1992) +¤ò»²¹Í¤Ë¤·¤¿¡£ +¤¿¤À¤·ËÜÆüËܸì¥Þ¥Ë¥å¥¢¥ë¤Ë¤ª¤±¤ë¸í¤ê¤Ï¹»Àµ¼Ô¤ÎÀÕǤ¤Ç¤¢¤ë¡£ diff --git a/release/man5/ttytype.5 b/release/man5/ttytype.5 new file mode 100644 index 00000000..016b9918 --- /dev/null +++ b/release/man5/ttytype.5 @@ -0,0 +1,66 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 Sat Jul 24 17:17:50 1993 by Rik Faith +.\" Modified Thu Oct 19 21:25:21 MET 1995 by Martin Schulze +.\" Modified Mon Oct 21 17:47:19 EDT 1996 by Eric S. Raymond +.\" xk +.\" +.\" Japanese Version Copyright (c) 1997 NAKANO Takeo all rights reserved. +.\" Translated Thu Feb 10 1998 by NAKANO Takeo +.\" +.TH TTYTYPE 5 1993-07-24 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ttytype \- üËö¥Ç¥Ð¥¤¥¹¡ÝüËö¥¿¥¤¥×¤Î¥Ç¥Õ¥©¥ë¥È¥Þ¥Ã¥Ô¥ó¥° +.SH ÀâÌÀ +.I /etc/ttytype +¤Ï tty ¥é¥¤¥ó¤ò termcap/terminfo ¤ÎüËö¥¿¥¤¥×¤Î̾Á°¤È´ØÏ¢ÉÕ¤±¤ë¡£¤½¤ì +¤¾¤ì¤Î¹Ô¤Ë¤Ï¡¢¤Þ¤ºÃ¼Ëö¤Î¥¿¥¤¥×¡¢Â³¤¤¤Æ¥¹¥Ú¡¼¥¹Ê¸»ú¡¢¤µ¤é¤Ë³¤¤¤Æ tty +̾ (¥Ç¥Ð¥¤¥¹Ì¾¤«¤éÀèƬ¤Î \fI/dev/\fP ¤ò¤È¤Ã¤¿¤â¤Î) ¤¬½ñ¤«¤ì¤ë¡£ + +¤³¤Î´ØÏ¢ÉÕ¤±¤Ï¥×¥í¥°¥é¥à +.BR tset (1) +¤¬ÍøÍѤ·¡¢¥æ¡¼¥¶¡¼¤¬¸½ºß»È¤Ã¤Æ¤¤¤ëüËö¤Î +.B TERM +´Ä¶­ÊÑ¿ô¤¬¡¢¥Ç¥Õ¥©¥ë¥È¤ÎüËö̾¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ + +¤³¤Îµ¡Ç½¤ÏÅÁÅýŪ¤Ê¥¿¥¤¥à¡¦¥·¥§¥¢¥ê¥ó¥°´Ä¶­ ( Unix ¥ß¥Ë¥³¥ó¥Ô¥å¡¼¥¿¤Ë +¥­¥ã¥é¥¯¥¿Ã¼Ëö¤¬Ä¾·ë¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê´Ä¶­) ¸þ¤±¤ËÀ߷פµ¤ì¤¿¡£¶áÂåŪ¤Ê +¥ï¡¼¥¯¥¹¥Æ¡¼¥·¥ç¥ó¤ä¥Ñ¡¼¥½¥Ê¥ë Unix ´Ä¶­¤Ç¤Ï¡¢¤Û¤È¤ó¤ÉÍøÍѤµ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +.TP +.I /etc/ttytype +tty ÄêµÁ¥Õ¥¡¥¤¥ë¡£ +.SH Îã +ŵ·¿Åª¤Ê \fI/etc/ttytype\fP ¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +.RS +.sp +con80x25 tty1 +.br +vt320 ttys0 +.RE +.SH ´ØÏ¢¹àÌÜ +.BR termcap (5), +.BR terminfo (5), +.BR agetty (8), +.BR mingetty (8) diff --git a/release/man5/tzfile.5 b/release/man5/tzfile.5 new file mode 100644 index 00000000..efa91866 --- /dev/null +++ b/release/man5/tzfile.5 @@ -0,0 +1,133 @@ +.\" @(#)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" +.SH ̾Á° +tzfile \- ¥¿¥¤¥à¥¾¡¼¥ó¤Î¾ðÊó +.SH ½ñ¼° +.B #include +.SH ÀâÌÀ +.BR tzset (3) +¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¥¿¥¤¥à¥¾¡¼¥ó¾ðÊó¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢ +¼±Ê̤Τ¿¤á¤Î magic ʸ»úÎó "TZif" ¤Ç»Ï¤Þ¤ê¡¢ +¾­Íè¤Î¤¿¤á¤Î 16 ¥Ð¥¤¥È¤ÎͽÌóÎΰ褬³¤­¡¢ +.I long +·¿¤Î 4 ¥Ð¥¤¥È¤ÎÃͤ¬ 6 ¸Ä³¤¯¡£ +¤³¤ÎÃͤϡÖɸ½à¡×¥Ð¥¤¥È¥ª¡¼¥À¡¼ (¹â°Ì¥Ð¥¤¥È¤¬Àè¤Ë½ñ¤«¤ì¤ë) +¤Çµ­½Ò¤µ¤ì¤ë¡£¤³¤ì¤é¤ÎÃͤϡ¢½ç¤Ë°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.I tzh_ttisgmtcnt +¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë UTC/local ¥¤¥ó¥¸¥±¡¼¥¿ (indicator) ¤Î¸Ä¿ô¡£ +.TP +.I tzh_ttisstdcnt +¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë standard/wall ¥¤¥ó¥¸¥±¡¼¥¿¤Î¸Ä¿ô¡£ +.TP +.I tzh_leapcnt +¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë±¼Éåǡ¼¥¿¤Î¸Ä¿ô¡£ +.TP +.I tzh_timecnt +¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡ÖÁ«°Ü»þ´Ö (transition time)¡×¥Ç¡¼¥¿¤Î¸Ä¿ô¡£ +.TP +.I tzh_typecnt +¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡Ö¥í¡¼¥«¥ë»þ´Ö·¿ (local time types)¡×¥Ç¡¼¥¿¤Î¸Ä¿ô +(0 ¤Ç¤¢¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤)¡£ +.TP +.I tzh_charcnt +¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡Ö¥¿¥¤¥à¥¾¡¼¥óά¼°Ê¸»úÎó (timezone +abbreviation string)¡×¤Î¸Ä¿ô¡£ +.PP +¾åµ­¤Î¥Ø¥Ã¥À¤Ë³¤¤¤Æ +.I tzh_timecnt +¤È¤¤¤¦ 4 ¥Ð¥¤¥È¤Î +.I long +·¿¤ÎÃͤ¬ (Ê£¿ô¸Ä) ³¤¯¡£¾º½ç¤ÇÊݴɤµ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤ÎÃͤϡÖɸ½à¡×¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +¤½¤ì¤¾¤ì¤ÏÁ«°Ü»þ´Ö +.RB ( time (2) +¤¬ÊÖ¤¹ÃÍ) ¤È¤·¤ÆÍѤ¤¤é¤ì¡¢ +¤½¤ì¤¾¤ì¤Ë¤ª¤¤¤Æ¥í¡¼¥«¥ë»þ´Ö¤Î·×»»¥ë¡¼¥ë¤¬Êѹ¹¤µ¤ì¤ë¡£ +¼¡¤ËÍè¤ë¤Î¤Ï +.I tzh_timecnt +¤Ç¡¢¤³¤ì¤Ï +.I "unsigned char" +·¿¤Î 1 ¥Ð¥¤¥È¤ÎÃͤǤ¢¤ë (Ê£¿ô¸Ä³¤¯¤³¤È¤â¤¢¤ë)¡£ +¤³¤ÎÃͤϡ¢¥Õ¥¡¥¤¥ë¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤ë°Û¤Ê¤Ã¤¿¥¿¥¤¥×¤Î¡Ö¥í¡¼¥«¥ë»þ´Ö¡×¤¬¡¢ +¤½¤ì¤¾¤ìƱ¤¸¤è¤¦¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤µ¤ì¤¿Á«°Ü»þ´Ö¤Î¤É¤ì¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ +¤¤¤ë¤«¤ò¼¨¤¹¡£ +¤³¤ì¤é¤ÎÃÍ¤Ï +.I ttinifo +¹½Â¤ÂΤÎÇÛÎó¤ËÂФ¹¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤È¤·¤ÆÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.I ttinfo +¹½Â¤ÂΤϥե¡¥¤¥ëÃæ¤Ç¼¡¤Î°ÌÃÖ¤ËÃÖ¤«¤ì¤ë¡£ +¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.sp +.nf +struct ttinfo { + long tt_gmtoff; + int tt_isdst; + unsigned int tt_abbrind; +}; +.in +.fi +.sp +¤½¤ì¤¾¤ì¤Î¹½Â¤ÂΤϡ¢ 4 ¥Ð¥¤¥È¤Î \fIlong\fP ·¿¤ÎÃÍ \fItt_gmtoff\fP¡¢ +1 ¥Ð¥¤¥È¤ÎÃÍ \fItt_isdst\fP, +1 ¥Ð¥¤¥È¤ÎÃÍ \fItt_abbrind\fP ¤«¤é¹½À®¤µ¤ì¤ë¡£ +.\"NAKANO int ¤Ê¤Î¤Ë 4 ¥Ð¥¤¥È¤Ê¤Î¡© +¤½¤ì¤¾¤ì¤Î¹½Â¤ÂΤˤª¤¤¤Æ¡¢ +.I tt_gmtoff +¤Ï UTC ¤Ë²Ã¤¨¤ë¤Ù¤­Éÿô¤òÍ¿¤¨¡¢ +.I tt_isdst +¤Ï +.I tm_isdst +¤ò +.BR localtime (3) +¤Ë¥»¥Ã¥È¤¹¤Ù¤­¤«¤É¤¦¤«¤ò¼¨¤·¡¢ +.I tt_abbrind +¤Ï¥Õ¥¡¥¤¥ëÃæ¤Ç \fIttinfo\fP ¹½Â¤ÂÎ (ÇÛÎó) ¤Î¤¢¤È¤ËÃÖ¤«¤ì¤ë +¥¿¥¤¥à¥¾¡¼¥óά¼°Ê¸»úÎó¤ÎÇÛÎó¤ËÂФ¹¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤¢¤ë¡£ +.PP +¼¡¤Ë¤Ï 4 ¥Ð¥¤¥ÈÃͤΥڥ¢¤Ç¤¢¤ë +.I tzh_leapcnt +¤¬ (Ê£¿ô¸Ä) ³¤¯¡£É¸½à¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Çµ­½Ò¤µ¤ì¤ë¡£ +¤½¤ì¤¾¤ì¤Î¥Ú¥¢¤ÎºÇ½é¤ÎÃͤϱ¼Éäε¯¤­¤¿»þ¹ï¤ò ( +.IR time (2) +¤ÎÊÖ¤¹·Á¼°¤Ç) Í¿¤¨¡¢ÆóÈÖÌܤÎÃͤϤ½¤Î»þ¹ï¤Ë²Ã¤¨¤ë¤Ù¤­±¼Éÿô¤Î +Á´Éÿô¤òÍ¿¤¨¤ë¡£¤³¤ì¤é¤Î¥Ú¥¢¤Ï»þ¹ï¤Î¸Å¤¤½ç¤Ëµ­½Ò¤¹¤ë¡£ +.PP +¼¡¤Ë¤Ï +.I tzh_ttisstdcnt +¤¬ÃÖ¤«¤ì¤ë¡£¤³¤ì¤Ï standard/wall ¥¤¥ó¥¸¥±¡¼¥¿¤Ç¡¢¤½¤ì¤¾¤ì 1 ¥Ð¥¤¥È¤Î +ÃͤòÊݴɤ¹¤ë¡£¤³¤ì¤é¤Ï¥í¡¼¥«¥ë»þ´Ö¤Î¥¿¥¤¥×¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿Á«°Ü»þ´Ö¤¬ +ɸ½à»þ¹ï (standard time) ¤ÈÊÉ»þ·×»þ¹ï (wall clock time) ¤Î +¤É¤Á¤é¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¤«¤ò¼¨¤¹¡£¤Þ¤¿¤³¤ÎÃͤϡ¢ +POSIX ¥¹¥¿¥¤¥ë¤Î¥¿¥¤¥à¥¾¡¼¥ó´Ä¶­ÊÑ¿ô¤ò½èÍý¤¹¤ë¤È¤­¤Ë +¥¿¥¤¥à¥¾¡¼¥ó¥Õ¥¡¥¤¥ë¤¬»È¤ï¤ì¤ë¤È¤­¤Ë¤âÍøÍѤµ¤ì¤ë¡£ +.PP +ºÇ¸å¤Ë +.I tzh_ttisgmtcnt +¤¬ÃÖ¤«¤ì¤ë¡£¤³¤ì¤Ï UTC/local ¥¤¥ó¥¸¥±¡¼¥¿¤Ç¡¢¤½¤ì¤¾¤ì 1 ¥Ð¥¤¥È¤Î +ÃͤòÊݴɤ¹¤ë¡£¤³¤ì¤é¤Ï¥í¡¼¥«¥ë»þ´Ö¤Î¥¿¥¤¥×¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿Á«°Ü»þ´Ö¤¬ +UTC ¤È¥í¡¼¥«¥ë»þ¹ï¤Î¤É¤Á¤é¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¤«¤ò¼¨¤¹¡£¤Þ¤¿¤³¤ÎÃͤϡ¢ +POSIX ¥¹¥¿¥¤¥ë¤Î¥¿¥¤¥à¥¾¡¼¥ó´Ä¶­ÊÑ¿ô¤ò½èÍý¤¹¤ë¤È¤­¤Ë +¥¿¥¤¥à¥¾¡¼¥ó¥Õ¥¡¥¤¥ë¤¬»È¤ï¤ì¤ë¤È¤­¤Ë¤âÍøÍѤµ¤ì¤ë¡£ +.PP +.I localtime +¤Ï¡¢ +.I tzh_timeout +¤¬ 0 ¤Ç¤¢¤ë¤« time °ú¿ô¤¬¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤µ¤ì¤Æ¤¤¤¿ºÇ½é¤ÎÁ«°Ü»þ¹ï +¤è¤ê¤â¾®¤µ¤¤¾ì¹ç¤Ë¤Ï¡¢ +¥Õ¥¡¥¤¥ë¤ËºÇ½é¤Ë¸½¤ì¤ëɸ½à»þ¹ï¤Î +.I ttinfo +¹½Â¤ÂΤò»È¤¦ (¤Þ¤¿¤Ïɸ½à»þ¹ï¤Î¹½Â¤ÂΤ¬¤Ê¤¤¾ì¹ç¤Ï¡¢Ã±¤ËºÇ½é¤Î +.I ttinfo +¹½Â¤ÂΤò»È¤¦)¡£ diff --git a/release/man5/utmp.5 b/release/man5/utmp.5 new file mode 100644 index 00000000..08bc6b32 --- /dev/null +++ b/release/man5/utmp.5 @@ -0,0 +1,363 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@cantor.informatik.rwth-aachen.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 1993-07-25 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1995-02-26 by Michael Haardt +.\" Modified 1996-07-20 by Michael Haardt +.\" Modified 1997-07-02 by Nicolas Lichtmaier +.\" Modified 2004-10-31 by aeb, following Gwenole Beauchesne +.\" +.\" Japanese Version Copyright (c) 1997 Kazuyuki Tanisako +.\" all rights reserved. +.\" Translated 1998-02-16, Kazuyuki Tanisako +.\" Updated 2003-01-20, Akihiro MOTOKI +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" Updated 2005-10-06, Akihiro MOTOKI +.\" Updated 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\" +.TH UTMP 5 2008-10-10 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +utmp, wtmp \- ¥í¥°¥¤¥óµ­Ï¿ +.SH ½ñ¼° +.B #include +.SH ÀâÌÀ +.I utmp +¥Õ¥¡¥¤¥ë¤ò¸«¤ë¤³¤È¤Ç¡¢¸½ºß郎¥·¥¹¥Æ¥à¤ò»È¤Ã¤Æ¤¤¤ë¤«¤È¤¤¤¦¾ðÊó +¤¬ÆÀ¤é¤ì¤ë¡£¤¿¤À¤¹¤Ù¤Æ¤Î¥×¥í¥°¥é¥à¤¬ utmp ¥Õ¥¡¥¤¥ë¤ò +¹¹¿·¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢¼ÂºÝ¤Ë¤Ï¤½¤ì°Ê¾å¤Î¥æ¡¼¥¶¡¼¤¬ +¥·¥¹¥Æ¥à¤ò»È¤Ã¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.PP +.B ·Ù¹ð: +(¶ò¤«¤Ë¤â) ¿¤¯¤Î¥·¥¹¥Æ¥à¥×¥í¥°¥é¥à¤¬¤½¤ÎÀ°¹çÀ­¤Ë°Í¸¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ +.I utmp +¥Õ¥¡¥¤¥ë¤Ï "other" ¤ËʬÎव¤ì¤ë¥æ¡¼¥¶¤ËÂФ·¤Æ +½ñ¤­¹þ¤ß²Äǽ¤Ë¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤È¥°¥ë¡¼¥×¥ª¡¼¥Ê¡¼°Ê³°¤Î¥æ¡¼¥¶¤ËÂФ·¤Æ +.I utmp +¥Õ¥¡¥¤¥ë¤ò½ñ¤­¹þ¤ß²Äǽ¤Ê¾õÂ֤ˤ·¤Æ¤ª¤¯¤È¡¢ +¥·¥¹¥Æ¥à¤Î¥í¥°¥Õ¥¡¥¤¥ë¤òµ¶Â¤¤µ¤ì¤¿¤ê¡¢¥·¥¹¥Æ¥à¥Õ¥¡¥¤¥ë¤Î +²þ¤¶¤ó¤ò¼õ¤±¤ë¤È¤¤¤Ã¤¿¥ê¥¹¥¯¤òÈȤ¹¤³¤È¤Ë¤Ê¤ë¡£ +.PP +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï +.I utmp +¹½Â¤ÂΤ竤êÊÖ¤·¤Ç¹½À®¤µ¤ì¤ë¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +(¤³¤³¤Ëµ­½Ò¤·¤Æ¤¢¤ë¤Î¤Ï´ö¤Ä¤«¤ÎÂç¤Þ¤«¤ÊÄêµÁ¤Î¤ß¤Ç¡¢ +¾ÜºÙ¤Ï libc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤êÊѤï¤ë¤³¤È¤ËÃí°Õ¤¬É¬ÍפǤ¢¤ë)¡£ +.in +4n +.nf +.sp +/* Values for ut_type field, below */ + +#define EMPTY 0 /* Record does not contain valid info + (formerly known as UT_UNKNOWN on Linux) */ +#define RUN_LVL 1 /* Change in system run-level (see + \fBinit\fP(8)) */ +#define BOOT_TIME 2 /* Time of system boot (in \fIut_tv\fP) */ +#define NEW_TIME 3 /* Time after system clock change + (in \fIut_tv\fP) */ +#define OLD_TIME 4 /* Time before system clock change + (in \fIut_tv\fP) */ +#define INIT_PROCESS 5 /* Process spawned by \fBinit\fP(8) */ +#define LOGIN_PROCESS 6 /* Session leader process for user login */ +#define USER_PROCESS 7 /* Normal process */ +#define DEAD_PROCESS 8 /* Terminated process */ +#define ACCOUNTING 9 /* Not implemented */ + +#define UT_LINESIZE 32 +#define UT_NAMESIZE 32 +#define UT_HOSTSIZE 256 + +struct exit_status { /* Type for ut_exit, below */ + short int e_termination; /* Process termination status */ + short int e_exit; /* Process exit status */ +}; + +struct utmp { + short ut_type; /* Type of record */ + pid_t ut_pid; /* PID of login process */ + char ut_line[UT_LINESIZE]; /* Device name of tty \- "/dev/" */ + char ut_id[4]; /* Terminal name suffix, + or inittab(5) ID */ + char ut_user[UT_NAMESIZE]; /* Username */ + char ut_host[UT_HOSTSIZE]; /* Hostname for remote login, or + kernel version for run-level + messages */ + struct exit_status ut_exit; /* Exit status of a process + marked as DEAD_PROCESS; not + used by Linux init(8) */ + /* ut_session ¤È ut_tv ¥Õ¥£¡¼¥ë¥É¤Ï¡¢32¥Ó¥Ã¥È¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¾ì¹ç¤È + 64¥Ó¥Ã¥È¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¾ì¹ç¤ÇƱ¤¸¥µ¥¤¥º¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + ¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢32¥Ó¥Ã¥È¤È64¥Ó¥Ã¥È¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¡¢ + ¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤È¶¦Í­¥á¥â¥ê¤ò¶¦Í­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ */ + +#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32 + int32_t ut_session; /* Session ID (\fBgetsid\fP(2)), + used for windowing */ + struct { + int32_t tv_sec; /* Seconds */ + int32_t tv_usec; /* Microseconds */ + } ut_tv; /* Time entry was made */ +#else + long ut_session; /* Session ID */ + struct timeval ut_tv; /* Time entry was made */ +#endif + + int32_t ut_addr_v6[4]; /* Internet address of remote + host; IPv4 address uses + just ut_addr_v6[0] */ + char __unused[20]; /* Reserved for future use */ +}; + +/* Backwards compatibility hacks */ +#define ut_name ut_user +#ifndef _NO_UT_TIME +#define ut_time ut_tv.tv_sec +#endif +#define ut_xtime ut_tv.tv_sec +#define ut_addr ut_addr_v6[0] +.sp +.fi +.in +¤³¤Î¹½Â¤ÂΤ«¤é¥æ¡¼¥¶¡¼¤Î»È¤Ã¤Æ¤¤¤ëüËö¤Î¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë̾¡¢ +¥æ¡¼¥¶¡¼¤Î¥í¥°¥¤¥ó̾¡¢ +.RB ( time (2) +·Á¼°¤Ç¤Î)¥í¥°¥¤¥ó»þ¹ï¤¬¤ï¤«¤ë¡£Ê¸»úÎó¥Õ¥£¡¼¥ë¥É¤Ï¡¢ +¥Õ¥£¡¼¥ë¥É¤ÎŤµ¤è¤êʸ»úÎó¤¬Ã»¤¤¾ì¹ç¤Ë¤Ï¡¢\fB\(aq\e0\(aq\fP ¤Ë¤è¤Ã¤Æ½ªÃ¼¤µ¤ì¤ë¡£ +.PP +ºÇ½é¤Î¥¨¥ó¥È¥ê¤Ï +.BR init (8) +¥³¥Þ¥ó¥É¤¬ +.BR inittab (5) +¤ò½èÍý¤¹¤ë¤³¤È¤Çºî¤é¤ì¤ë¡£ +¤¢¤ë¥¨¥ó¥È¥ê¤ò½èÍý¤¹¤ëÁ°¤Ë¡¢ +.BR init (8) +¤Ï \fIut_type\fP ¤ò \fBDEAD_PROCESS\fP ¤Ë½é´ü²½¤¹¤ë¡£ +¥ì¥³¡¼¥É¤Î +\fIut_type\fP ¤¬ \fBDEAD_PROCESS\fP ¤È \fBRUN_LVL\fP ¤Î¤¤¤º¤ì¤Ç¤â¤Ê¤¯¡¢ +¤«¤Ä PID ¤¬ \fIut_pid\fP ¤Ç¤¢¤ë¥×¥í¥»¥¹¤¬¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢\fIut_user\fP, +\fIut_host\fP, \fIut_time\fP ¤ò¥Ì¥ë¥Ð¥¤¥È¤Ç¥¯¥ê¥¢¤·¤Æ½é´ü²½¤ò¹Ô¤¦¡£ +ɬÍ×¤Ê \fIut_id\fP ¤ò»ý¤Ä¶õ¤Î¥ì¥³¡¼¥É¤ò¸«¤Ä¤±¤é¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +.BR init (8) +¤Ï¿·¤·¤¤¥ì¥³¡¼¥É¤òºî¤ë¡£inittab ¤«¤é \fIut_id\fP ¤òÀßÄꤷ¡¢ +\fIut_pid\fP ¤ª¤è¤Ó \fIut_time\fP ¤ò¸½ºßÃͤˡ¢ +\fIut_type\fP ¤ò \fBINIT_PROCESS\fP ¤ËÀßÄꤹ¤ë¡£ +.PP +.BR mingetty (8) +(¤Þ¤¿¤Ï +.BR agetty (8)) +¤Ï pid ¤Ç¥¨¥ó¥È¥ê¤òÆÃÄꤷ¡¢ +\fIut_type\fP ¤ò \fBLOGIN_PROCESS\fP ¤ËÊѹ¹¤·¡¢ +\fIut_time\fP ¤ò¹¹¿·¤·¡¢\fIut_line\fP¤òÀßÄꤷ¤¿¸å¡¢Àܳ¤¬³ÎΩ¤µ¤ì¤ë¤Î¤òÂԤġ£ +.BR login (1) +¤Ï¥æ¡¼¥¶¡¼Ç§¾Ú¤¬½ªÎ»¤¹¤ë¤È¡¢ +\fIut_type\fP ¤ò \fBUSER_PROCESS\fP ¤ËÊѹ¹¤·¡¢ +\fIut_time\fP ¤ò¹¹¿·¤·¡¢\fIut_host\fP ¤È \fIut_addr\fP¤òÀßÄꤹ¤ë¡£ +.BR mingetty (8) +(¤Þ¤¿¤Ï +.BR agetty (8)) +¤È +.BR login (1) +¤Ë¤è¤ê°Û¤Ê¤ë¤¬¡¢ +\fIut_pid\fP ¤ÎÂå¤ï¤ê¤Ë +\fIut_line\fP ¤ò»È¤Ã¤Æ¥ì¥³¡¼¥É¤ÎÆÃÄ꤬¹Ô¤ï¤ì¤ë¤³¤È¤â¤¢¤ë +(\fIut_pid\fP ¤ò»È¤¦Êý¤¬Ë¾¤Þ¤·¤¤) ¡£ +.PP +.BR init (8) +¤Ï¥×¥í¥»¥¹¤Î½ªÎ»¤ò¸¡½Ð¤·¤¿¾ì¹ç¡¢ +\fIut_pid\fP ¤ò¥­¡¼¤È¤·¤Æ utmp ¤Î¥¨¥ó¥È¥ê¤òÆÃÄꤷ¡¢ +\fIut_type\fP ¤ò \fBDEAD_PROCESS\fP ¤ËÀßÄꤷ¡¢ +\fIut_user\fP, \fIut_host\fP, \fIut_time\fP ¤ò¥Ì¥ë¥Ð¥¤¥È¤Ç¥¯¥ê¥¢¤¹¤ë¡£ +.PP +.BR xterm (1) +¥³¥Þ¥ó¥É¤ä¾¤ÎüËö¥¨¥ß¥å¥ì¡¼¥¿¤Ï +ľÀÜ \fBUSER_PROCESS\fP ¤Î¥ì¥³¡¼¥É¤òºî¤ê¡¢ +üËö̾¤Î¥µ¥Õ¥£¥Ã¥¯¥¹Ê¸»úÎó (\fI/dev/[pt]ty\fP ¤Ë³¤¯Ê¸»úÎó) +¤ò»È¤Ã¤Æ \fIut_id\fP ¤ÎÃͤòÀ¸À®¤¹¤ë¡£ +¤³¤Î id ¤ò»ý¤Ä¥¨¥ó¥È¥ê¤¬ \fBDEAD_PROCESS\fP ¤Ç¤¢¤Ã¤¿¾ì¹ç¤Ë¤ÏºÆÍøÍѤ·¡¢ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¿·¤·¤¤¥¨¥ó¥È¥ê¤¬ºî¤é¤ì¤ë¡£ +²Äǽ¤Ê¾ì¹ç¤Ë¤Ï¥×¥í¥»¥¹½ªÎ»»þ¤Ë \fBDEAD_PROCESS\fP ¤ÈÀßÄꤷ¡¢ +¤µ¤é¤Ë \fIut_line\fP, \fIut_time\fP, \fIut_user\fP, \fIut_host\fP +¤ò¥Ì¥ë¥Ð¥¤¥È¤Ç¥¯¥ê¥¢¤¹¤ë¤³¤È¤¬¾©Î夵¤ì¤Æ¤¤¤ë¡£ +.PP +.BR telnetd (8) +¤Ï \fBLOGIN_PROCESS\fP ¤òÀßÄꤹ¤ë¤À¤±¤Ç¤è¤¯¡¢ +»Ä¤ê¤Î½èÍý¤ÏÄ̾ïÄ̤ê +.BR login (1) +¤ËǤ¤»¤ì¤Ð¤è¤¤¡£ +telnet ¤Î¥»¥Ã¥·¥ç¥ó¤¬½ªÎ»¤·¤¿¸å¡¢Á°½Ò¤Î¤è¤¦¤Ë +.BR telnetd (8) +¤¬ utmp ¤Î¥¨¥ó¥È¥ê¤ò½é´ü²½¤¹¤ë¡£ +.PP +\fIwtmp\fP ¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¤¹¤Ù¤Æ¤Î¥í¥°¥¤¥ó¤È¥í¥°¥¢¥¦¥È¤¬µ­Ï¿¤µ¤ì¤ë¡£ +¤½¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢¥í¥°¥¢¥¦¥ÈºÑ¤ÎüËö¤Ç¥æ¡¼¥¶¡¼Ì¾¤¬¥Ì¥ë¤È¤Ê¤ë¤³¤È°Ê³°¤Ï +\fIutmp\fP ¤È¤Þ¤Ã¤¿¤¯Æ±¤¸¤Ç¤¢¤ë¡£ +¥æ¡¼¥¶¡¼Ì¾¤¬ \fBshutdown\fP ¤â¤·¤¯¤Ï \fBreboot\fP ¤Ç¤¢¤ë +üËö̾ \fB~\fP ¤Ï¥·¥¹¥Æ¥à¤ÎÄä»ß (shutdown) ¤Þ¤¿¤ÏºÆµ¯Æ° (reboot) +¤ò°ÕÌ£¤¹¤ë¡£¤Þ¤¿¤½¤ÎüËö̾¤¬ \fB|\fP ¤È \fB}\fP ¤ÎÂÐ¤Ï +.BR date (1) +¥³¥Þ¥ó¥É¤ÇÊѹ¹¤·¤¿¿·¡¿µì¤Î¥·¥¹¥Æ¥à»þ¹ï¤òµ­Ï¿¤·¤Æ¤¤¤ë¡£ +\fIwtmp\fP ¥Õ¥¡¥¤¥ë¤Ï +.BR login (1), +.BR init (8) +¤ä¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Î +.BR getty (8) +.RB ( mingetty (8) +¤Þ¤¿¤Ï +.BR agetty (8)) +¤Ë¤è¤ê´ÉÍý¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥×¥í¥°¥é¥à¤Ï¤É¤ì¤â¥Õ¥¡¥¤¥ë¤ò¿·¤¿¤ËºîÀ®¤·¤Ê¤¤¤Î¤Ç¡¢ +¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¤³¤È¤Ç¾ðÊó¤Îµ­Ï¿ (record-keeping) ¤ò»ß¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +/var/run/utmp +.br +/var/log/wtmp +.SH ½àµò +.PP +POSIX.1 ¤Ç¤Ï¡¢ +.I utmp +¹½Â¤ÂΤǤϤʤ¯¡¢ +.I utmpx +¹½Â¤ÂΤòµ¬Äꤷ¤Æ¤¤¤ë¡£ +.I utmpx +¹½Â¤ÂΤǵ¬Äꤵ¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢¥Õ¥£¡¼¥ë¥É +.IR ut_type , +.IR ut_pid , +.IR ut_line , +.IR ut_id , +.IR ut_user , +.IR ut_tv +¤Ç¤¢¤ë¡£ +POSIX.1 ¤Ç¤Ï¡¢¥Õ¥£¡¼¥ë¥É +.I ut_line +¤È +.I ut_user +¤ÎŤµ¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ + +Linux ¤Ç¤Ï¡¢ +.I utmpx +¹½Â¤ÂΤÎÄêµÁ¤Ï +.I utmp +¹½Â¤ÂΤÈƱ¤¸¤Ç¤¢¤ë¡£ +.SS ²áµî¤Î¥·¥¹¥Æ¥à¤È¤ÎÈæ³Ó +Linux ¤Ç¤Î utmp ¤Î¥¨¥ó¥È¥ê¤Ï v7/BSD ¤ä System V ¤Î¤¤¤º¤ì¤Ë¤â½àµò¤·¤Æ¤ª¤é¤º¡¢ +¤½¤ÎξÊý¤¬º®ºß¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +v7/BSD ¤Ç¤Ï¤è¤ê¾¯¤·¤Î¹àÌܤ·¤«¤Ê¤¤; +¤â¤Ã¤È¤â½ÅÍפʤ³¤È¤Ï¡¢\fIut_type\fP ¤¬Ìµ¤¤¤³¤È¤Ç¤¢¤ë¡£ +¤½¤Î¤¿¤á v7/BSD ·Ï¤Î¥×¥í¥°¥é¥à¤Ç¤Ï (¤¿¤È¤¨¤Ð) »à¤ó¤À¾õÂ֤Υ¨¥ó¥È¥ê¤ä +¥í¥°¥¤¥ó¾õÂ֤Υ¨¥ó¥È¥ê¤Þ¤Çɽ¼¨¤µ¤ì¤Æ¤·¤Þ¤¦¤³¤È¤Ë¤Ê¤Ã¤¿¡£ +¤µ¤é¤Ë¥»¥Ã¥·¥ç¥óÍѤΥ¹¥í¥Ã¥È¤ò³ä¤êÅö¤Æ¤ë¤¿¤á¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤¬¤Ê¤¤¡£ +BSD ¤ËÀßÄê¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¤Î¤Ï \fIut_id\fP ¤¬¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ + +Linux (System V ·Ï)¤Ç¤Ï¡¢ÀßÄê¥Õ¥¡¥¤¥ë¤òɬÍפȤ»¤º +¥»¥Ã¥·¥ç¥óÍѤΥ¹¥í¥Ã¥È¤ò³ä¤êÅö¤Æ¤ë¤Î¤Ç¡¢°ìöÀßÄê +¤µ¤ì¤Æ¤·¤Þ¤¦¤È¥ì¥³¡¼¥É¤Î \fIut_id\fP ¤Ï·è¤·¤ÆÊѹ¹¤µ¤ì¤Ê¤¤¡£ +\fIut_id\fP ¤ò¥¯¥ê¥¢¤¹¤ë¤È¶¥¹ç¾õÂ֤ˤª¤Á¤¤¤ê¡¢ +utmp ¤Î¥¨¥ó¥È¥ê¤ò²õ¤·¤¿¤ê¡¢ÀøºßŪ¤Ê¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤Ë¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¾å½Ò¤Î¥Õ¥£¡¼¥ë¥É¤ò NULL ¥Ð¥¤¥È¤ÇËä¤á¤Æ¥¯¥ê¥¢¤·¤Æ¤ª¤¯¤Î¤Ï¡¢ +System V ¤Ç¤Î¼è¤ê·è¤á¤Ç¤ÏɬÍפȤϤµ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +BSD ¤Ç¤Î¼è¤ê·è¤á¤òÁ°Äó¤È¤·¤Æ¤¤¤Æ¡¢¤«¤Ä utmp ¤ò¹¹¿·¤·¤Ê¤¤Â¿¤¯¤Î¥×¥í¥°¥é¥à¤¬ +Æ°ºî¤¹¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ç¤¢¤ë¡£ +Linux ¤Ç¤Ï¤³¤³¤Þ¤Çµ­½Ò¤·¤Æ¤­¤¿¤è¤¦¤Ë¡¢¹ÔÆâÍƤÎɽ¼¨¤Ï BSD ¤Î´·Îã¤Ë½¾¤Ã¤Æ¤¤¤ë¡£ +.PP +.\" mtk: What is the referrent of "them" in the following sentence? +.\" System V ¤Ç¤Ï ut_type ¤òÌÜ°õ¤Ë¤·¤¿¤ê¡¢¤¿¤È¤¨¤Ð \fB"new time"\fP ¤Î¤è¤¦¤Ê +.\" ÄÌÃÎ¥á¥Ã¥»¡¼¥¸¤òµ­Ï¿¤¹¤ë¤¿¤á¤Î¤ß¤Ë»È¤Ã¤Æ¤¤¤ë¡£ +\fBUT_UNKNOWN\fP ¤Ï Linux ¤Çºî¤é¤ì¤¿¤â¤Î¤Î¤è¤¦¤Ç¤¢¤ë¡£ +System V ¤Ë¤Ï \fIut_host\fP ¤â \fIut_addr_v6\fP ¤â¸ºß¤·¤Ê¤¤¡£ +.SH Ãí°Õ +.PP +¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¤³¤È¤Ç utmp ¤Ø¤Îµ­Ï¿¤ò»ß¤á¤é¤ì¤ë +¾¤ÎÍÍ¡¹¤Ê¥·¥¹¥Æ¥à¤È¤Ï°ã¤¤¡¢Linux ¤Ç¤Ï utmp ¥Õ¥¡¥¤¥ë¤òɬ¤º¤ª¤¤¤Æ +¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +.BR who (1) +¥³¥Þ¥ó¥É¤¬µ¡Ç½¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +utmp ¥Õ¥¡¥¤¥ë¤ÎÁ´¥æ¡¼¥¶¡¼¤ËÂФ¹¤ëÆɤ߼è¤êµö²Ä¤òÀßÄꤷ¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£ +.PP +¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¥Þ¥·¥ó¤Ë°Í¸¤¹¤ë¤Î¤Ç¡¢¥Õ¥¡¥¤¥ë¤¬ºî¤é¤ì¤¿ +¥Þ¥·¥ó¤â¤·¤¯¤ÏƱ°ì¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¥Þ¥·¥ó¾å¤Ç¤Î¤ß½èÍý¤¹¤ë¤³¤È¤ò¿ä¾©¤¹¤ë¡£ +.PP +Ãí°Õ¤¹¤Ù¤­ÅÀ¤È¤·¤Æ¤Ï¡¢ +\fIbiarch\fP ¤Ê¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¡¢¤Ä¤Þ¤ê 32¥Ó¥Ã¥È¤È 64¥Ó¥Ã¥È¤ÎξÊý¤Î +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¼Â¹Ô¤Ç¤­¤ë¥·¥¹¥Æ¥à (x86-64, ppc64, s390x ¤Ê¤É) ¤Ç¤Ï¡¢ +\fIut_tv\fP ¤Î¥µ¥¤¥º¤Ï 32¥Ó¥Ã¥È¥â¡¼¥É¤È 64¥Ó¥Ã¥È¥â¡¼¥É¤ÇƱ¤¸¤Ç¤¢¤ë¡£ +\fIut_session\fP ¤È \fIut_time\fP ¤â¡¢Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤ÏƱÍͤËƱ¤¸¥µ¥¤¥º +¤Ç¤¢¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢32¥Ó¥Ã¥È¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È 64¥Ó¥Ã¥È¥¢¥×¥ê¥±¡¼¥·¥ç¥ó +¤Î´Ö¤Ç¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤È¶¦Í­¥á¥â¥ê¤ò¶¦Í­¤¹¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤ë¡£ +¤½¤Î¤¿¤á¤Ë¤Ï¡¢ +.I ut_session +¤ò +.I int32_t +·¿¤Ë¡¢ +.I ut_tv +¤ò 2¤Ä¤Î +.I int32_t +·¿¤Î¥Õ¥£¡¼¥ë¥É +.IR tv_sec , +.I tv_usec +¤ò»ý¤Ä¹½Â¤ÂΤËÊѹ¹¤¹¤ì¤Ð¤è¤¤ +\fIut_tv\fP ¤Ï \fIstruct timeval\fP ¤ÈƱ¤¸¥µ¥¤¥º¤È¤Ï¸Â¤é¤Ê¤¤¤Î¤Ç¡¢ +.in +4n +.nf +.sp +gettimeofday((struct timeval *) &ut.ut_tv, NULL); +.fi +.in + +¤Î¤è¤¦¤Ê¸Æ¤Ó½Ð¤·¤ò¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +°Ê²¼¤Î¤è¤¦¤Ë³Æ¥Õ¥£¡¼¥ë¥É¤òÀßÄꤹ¤ëÊýË¡¤¬¿ä¾©¤µ¤ì¤ë: +.in +4n +.nf +.sp +struct utmp ut; +struct timeval tv; + +gettimeofday(&tv, NULL); +ut.ut_tv.tv_sec = tv.tv_sec; +ut.ut_tv.tv_usec = tv.tv_usec; +.fi +.in +.PP +utmp ¹½Â¤ÂÎ¤Ï libc5 ¤«¤é libc6 ¤ÇÊѹ¹¤µ¤ì¤¿¡£¤½¤Î¤¿¤áÀΤΠlibc5 ¤Î¹½Â¤ÂÎ +¤ò»È¤Ã¤¿¥×¥í¥°¥é¥à¤Ï +.IR /var/run/utmp " ¤ä " /var/log/wtmp +¥Õ¥¡¥¤¥ë¤ò²õ¤·¤Æ¤·¤Þ¤¦¡£ +.SH ¥Ð¥° +¤³¤Î man ¥Ú¡¼¥¸¤Ï libc5 ¤Ë´ð¤Å¤¤¤Æºî¤é¤ì¤Æ¤¤¤Æ¡¢ +ºÇ¿·¤Î¤â¤Î¤Ç¤Ï°ã¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ac (1), +.BR date (1), +.BR last (1), +.BR login (1), +.BR who (1), +.BR getutent (3), +.BR getutmp (3), +.BR login (3), +.BR logout (3), +.BR logwtmp (3), +.BR updwtmp (3), +.BR init (8) diff --git a/release/man6/intro.6 b/release/man6/intro.6 new file mode 100644 index 00000000..cb341f06 --- /dev/null +++ b/release/man6/intro.6 @@ -0,0 +1,40 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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 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 +.\" +.TH INTRO 6 2007-10-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +intro \- ¥²¡¼¥à¥×¥í¥°¥é¥à¤Î¾Ò²ð +.SH ÀâÌÀ +¥Þ¥Ë¥å¥¢¥ë¤Î 6 ¾Ï¤Ï¡¢ËÜ¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ê¤¹¤Ù¤Æ¤Î¥²¡¼¥à¤È +³Ú¤·¤¤¾®Êª¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æµ­ºÜ¤·¤Æ¤¤¤ë¡£ +.SH È÷¹Í +.SS Ãø¼Ô¤ÈÃøºî¸¢ +Ãø¼Ô(ã)¤È¸¢Íø¾ò·ï¤Ë¤Ä¤¤¤Æ¤Ï¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥½¡¼¥¹¤Î¥Ø¥Ã¥À¤ò»²¾È¤¹¤ë¤³¤È¡£ +¤¿¤À¤·¥Ú¡¼¥¸¤Ë¤è¤Ã¤Æ¤Ï°Û¤Ê¤ë¤â¤Î¤â¤¢¤ë¤³¤È¤ËÃí°Õ¤»¤è¡£ diff --git a/release/man7/arp.7 b/release/man7/arp.7 new file mode 100644 index 00000000..c477eb4d --- /dev/null +++ b/release/man7/arp.7 @@ -0,0 +1,333 @@ +'\" t +.\" This man page is Copyright (C) 1999 Matthew Wilcox . +.\" 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. +.\" Modified June 1999 Andi Kleen +.\" $Id: arp.7,v 1.9 2001/03/12 08:45:27 nakano Exp $ +.\" +.\" Japanese Version Copyright (c) 1999-2001 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated & Modified 2001-02-16, NAKANO Takeo +.\" Updated 2008-12-26, Akihiro MOTOKI, LDP v3.14 +.\" +.\"WORD permanent Êݸ +.\"WORD neighbor cache entry ¶á˵¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +.\"WORD stale ¸Å¤¯¤Ê¤Ã¤¿ +.\"WORD proxy arp ÂåÍý arp +.\"WORD garbage collect (-or) ¥¬¥Ù¡¼¥¸¡¦¥³¥ì¥¯¥È(¥³¥ì¥¯¥¿) +.\"WORD capability ¸¢¸Â +.\"WORD neighbor soliciation message ¶á˵Í×ÀÁ¥á¥Ã¥»¡¼¥¸ +.\"WORD network flooding ¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥Õ¥é¥Ã¥Ç¥£¥ó¥° +.\"WORD thrashing ¥¹¥é¥Ã¥·¥ó¥° +.\"WORD connection oriented Àܳ»Ø¸þ +.\"WORD forward progress ¥Õ¥©¥ï¡¼¥É¥×¥í¥°¥ì¥¹ +.\" +.TH ARP 7 2008-11-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +arp \- Linux ARP ¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë +.SH ÀâÌÀ +¤³¤Î¥«¡¼¥Í¥ë¥×¥í¥È¥³¥ë¥â¥¸¥å¡¼¥ë¤Ï¡¢ +RFC\ 826 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë Address Resolution Protocol ¤ò +¼ÂÁõ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ ARP ¤Ï¡¢¥À¥¤¥ì¥¯¥È¤ËÀܳ¤µ¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Ç¡¢ +Âè 2 ÁؤΥϡ¼¥É¥¦¥§¥¢¥¢¥É¥ì¥¹¤òIPv4 ¥×¥í¥È¥³¥ë¥¢¥É¥ì¥¹¤Ë +ÊÑ´¹¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£¥æ¡¼¥¶¡¼¤ÏÀßÄê¤Î¾ì¹ç¤ò½ü¤¤¤Æ +Ä̾ïľÀܤ³¤Î¥â¥¸¥å¡¼¥ë¤Ë´Ø¤ë¤³¤È¤Ï¤Ê¤¤¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ëÆâÉô¤Î¾¤Î¥×¥í¥È¥³¥ë¤Ë¥µ¡¼¥Ó¥¹¤òÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.PP +¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤Ï¡¢ +.BR packet (7) +¥½¥±¥Ã¥È¤òÍѤ¤¤ì¤Ð ARP ¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +ARP ¥­¥ã¥Ã¥·¥å¤ò¥æ¡¼¥¶¡¼¶õ´Ö¤Ç´ÉÍý¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤Ï +.BR netlink (7) +¤òÍѤ¤¤ë¡£ ARP ¥Æ¡¼¥Ö¥ë¤âÀ©¸æ²Äǽ¤Ç¡¢¤³¤ì¤Ë¤ÏǤ°Õ¤Î +.B AF_INET +¥½¥±¥Ã¥È¤Ë +.BR ioctl (2) +¤òÍѤ¤¤ë¡£ +.PP +ARP ¥â¥¸¥å¡¼¥ë¤Ï¥Ï¡¼¥É¥¦¥§¥¢¥¢¥É¥ì¥¹¤«¤é¥×¥í¥È¥³¥ë¥¢¥É¥ì¥¹¤Ø¤Î +¥Þ¥Ã¥Ô¥ó¥°¤Î¥­¥ã¥Ã¥·¥å¤ò´ÉÍý¤¹¤ë¡£¥­¥ã¥Ã¥·¥å¤ÎÂ礭¤µ¤Ë¤ÏÀ©¸Â¤¬ +¤¢¤ë¤Î¤Ç¡¢¸Å¤¤¥¨¥ó¥È¥ê¤äÍøÍѤµ¤ì¤Ê¤¤¥¨¥ó¥È¥ê¤Ï¥¬¥Ù¡¼¥¸¥³¥ì¥¯¥È +¤µ¤ì¤ë¡£ permanent (Êݸ) ¥Þ¡¼¥¯¤¬¤Ä¤±¤é¤ì¤¿¥¨¥ó¥È¥ê¤Ï¡¢ +·è¤·¤Æ¥¬¥Ù¡¼¥¸¥³¥ì¥¯¥¿¤Ë¤è¤Ã¤Æ¾Ãµî¤µ¤ì¤Ê¤¤¡£ +ioctl ¤òÍѤ¤¤ì¤Ð¥­¥ã¥Ã¥·¥å¤òľÀÜÁàºî¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤Þ¤¿¸å½Ò¤Î +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë¤è¤ê¥­¥ã¥Ã¥·¥å¤Î¿¶¤ëÉñ¤¤¤òÄ´À°¤Ç¤­¤ë¡£ +.PP +¸ºß¤·¤Æ¤¤¤ë¥Þ¥Ã¥Ô¥ó¥°¤ËÂФ·¤Æ¡¢ +Àµ¤Î¥Õ¥£¡¼¥É¥Ð¥Ã¥¯¤¬°ìÄê»þ´Ö¤Ê¤¤ (¸å½Ò¤Î +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¸«¤è) ¤È¡¢ +¶á˵¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê (neighbor cache entry) ¤Ï +¸Å¤¯¤Ê¤Ã¤¿ (stale) ¤È¤ß¤Ê¤µ¤ì¤ë¡£ +Àµ¤Î¥Õ¥£¡¼¥É¥Ð¥Ã¥¯¤Ï¹â°Ì¤Î¥ì¥¤¥ä¡¼¤«¤é¤â¼èÆÀ¤Ç¤­¤ë +(Î㤨¤Ð TCP ACK ¤¬À®¸ù¤·¤¿¾ì¹ç¤Ê¤É)¡£ +¾¤Î¥×¥í¥È¥³¥ë¤Ï¡¢ +.BR sendmsg (2) +¤Ë +.B MSG_CONFIRM +¥Õ¥é¥°¤òÍѤ¤¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢ +¥Õ¥©¥ï¡¼¥É¥×¥í¥°¥ì¥¹ (forward progress) ¤ò¥·¥°¥Ê¥ë¤Ç¤­¤ë¡£ +¥Õ¥©¥ï¡¼¥É¥×¥í¥°¥ì¥¹¤¬¤Ê¤±¤ì¤Ð¡¢ +ARP ¤ÏºÆ¤Ó¥×¥í¡¼¥Ö¤ò»î¤ß¤ë¡£ +¤Þ¤º¥í¡¼¥«¥ë¤Ê arp ¥Ç¡¼¥â¥ó¤ËÌä¹ç¤ï¤»¤ò¹Ô¤¤¡¢ +¹¹¿·¤µ¤ì¤¿ MAC ¥¢¥É¥ì¥¹¤ò¼èÆÀ¤·¤è¤¦¤È¤¹¤ë¡£ +¤³¤Î¥ê¥¯¥¨¥¹¥È¤Ë +.B app_solicit +²ó¼ºÇÔ¤¹¤ë¤È¡¢¸Å¤¤ MAC ¥¢¥É¥ì¥¹¤¬¤ï¤«¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +unicast ¤Î¥×¥í¡¼¥Ö¤¬ +.B ucaset_solicit +²óÁ÷¤é¤ì¤ë¡£¤³¤ì¤Ë¤â¼ºÇÔ¤¹¤ë¤È¡¢¿·¤·¤¤ ARP ¥ê¥¯¥¨¥¹¥È +¤ò¥Í¥Ã¥È¥ï¡¼¥¯¤Ë¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤¹¤ë¡£ +¥ê¥¯¥¨¥¹¥È¤Ï¡¢¥Ç¡¼¥¿¤¬Á÷¿®¥­¥å¡¼¤Ë¤Ê¤±¤ì¤ÐÁ÷¤é¤ì¤Ê¤¤¡£ +.PP +Linux ¤Ï¡¢¤¢¤ë¥¢¥É¥ì¥¹¤Ø¤Î¥ê¥¯¥¨¥¹¥È¤ò¼õ¿®¡¦¥Õ¥©¥ï¡¼¥É¤·¡¢ +¼õ¿®¤·¤¿¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÇÂåÍý arp ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¼«Æ°Åª¤Ë¤½¤Î¥¢¥É¥ì¥¹¤ò nonpermanent ¤ÊÂåÍý arp ¥¨¥ó¥È¥ê¤ËÄɲ乤롣 +¤½¤Î¥¿¡¼¥²¥Ã¥È¤Ë reject route ¤¬¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +ÂåÍý arp ¥¨¥ó¥È¥ê¤Ï°ìÀÚÄɲ䵤ì¤Ê¤¤¡£ +.SS ioctl +¤¹¤Ù¤Æ¤Î +.B AF_INET +¥½¥±¥Ã¥È¤Ç¤Ï¡¢ 3 ¤Ä¤Î ioctl ¤¬»ÈÍѤǤ­¤ë¡£ +¤³¤ì¤é¤Ï +.I struct arpreq +¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò°ú¿ô¤Ë¼è¤ë¡£ + +.in +4n +.nf +struct arpreq { + struct sockaddr arp_pa; /* protocol address */ + struct sockaddr arp_ha; /* hardware address */ + int arp_flags; /* flags */ + struct sockaddr arp_netmask; /* netmask of protocol address */ + char arp_dev[16]; +}; +.fi +.in + +.BR SIOCSARP ", " SIOCDARP ", " SIOCGARP +¤Ï¡¢¤½¤ì¤¾¤ì ARP ¥Þ¥Ã¥Ô¥ó¥°¤òÀßÄꡦºï½ü¡¦¼èÆÀ¤¹¤ë¡£ +ARP ¥Þ¥Ã¥×¤ÎÀßÄê¤Èºï½ü¤ÏÆø¢¤¬É¬ÍפÊÁàºî¤Ç¤¢¤ê¡¢ +.B CAP_NET_ADMIN +¸¢¸Â¤ò»ý¤Ä¥×¥í¥»¥¹¤«¡¢¼Â¹Ô¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹ +¤Ç¤Ê¤±¤ì¤Ð¼Â¹Ô¤Ç¤­¤Ê¤¤¡£ +.PP +.I arp_pa +¤Ï +.B AF_INET +¥½¥±¥Ã¥È¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +.I arp_ha +¤Ï +.I arp_dev +¤ÇÀßÄꤵ¤ì¤¿¥Ç¥Ð¥¤¥¹¤ÈƱ¤¸¥¿¥¤¥×¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.I arp_dev +¤Ï¥Ç¥Ð¥¤¥¹¤Î̾Á°¤ò¼¨¤¹¡¢¥¼¥í¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +.RS +.TS +tab(:) allbox; +c s +l l. +\fIarp_flags\fR +¥Õ¥é¥°:°ÕÌ£ +ATF_COM:»²¾È´°Î» +ATF_PERM:¥¨¥ó¥È¥ê¤ò peramanent ¤Ë¤¹¤ë +ATF_PUBL:¥¨¥ó¥È¥ê¤ò publish ¤¹¤ë +ATF_USETRAILERS:trailer ¤¬É¬Í× +ATF_NETMASK:netmask ¤òÍѤ¤¤ë +ATF_DONTPUB:²óÅú¤·¤Ê¤¤ +.TE +.RE + +.PP +.B ATF_NETMASK +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ë¤Ï¡¢ +.I arp_netmask +¤¬Í­¸ú¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Linux 2.2 ¤ÏÂåÍý¥Í¥Ã¥È¥ï¡¼¥¯ ARP ¥¨¥ó¥È¥ê¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢ +¤³¤ì¤Ï 0xffffffff ¤Ë¥»¥Ã¥È¤·¤Æ¤ª¤¯¤«¡¢¤¢¤ë¤¤¤Ï +¸½Â¸¤ÎÂåÍý arp ¥¨¥ó¥È¥ê¤òºï½ü¤·¤¿¤¤¾ì¹ç¤Ë¤Ï 0 ¤Ë¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +.B ATF_USETRAILERS +¤Ï obsolete ¤Ê¤Î¤Ç¡¢ÍѤ¤¤ë¤Ù¤­¤Ç¤Ê¤¤¡£ +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +ARP ¤Ç¤Ï¡¢¥°¥í¡¼¥Ð¥ë¤Ê¥Ñ¥é¥á¡¼¥¿¤ä¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤´¤È¤Î¥Ñ¥é¥á¡¼¥¿¤ò +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ̤·¤ÆÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë¤Ï¡¢ +.I proc/sys/net/ipv4/neigh/*/* +¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¤Ë¤è¤ê¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +¥·¥¹¥Æ¥à¤Ë¤¢¤ë¤½¤ì¤¾¤ì¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤Ï¡¢ +¤½¤ì¤¾¤ìÂбþ¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤¬ +.I /proc/sys/net/ipv4/neigh/ +°Ê²¼¤Ë¤¢¤ë¡£ +"default" ¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤ÆÀßÄê¤ò¤¹¤ë¤È¡¢ +¤½¤ì°Ê¹ßÀ¸À®¤µ¤ì¤ë¥Ç¥Ð¥¤¥¹Á´¤Æ¤ËÂФ·¤Æ¤½¤ÎÀßÄ꤬ÍѤ¤¤é¤ì¤ë¡£ +Æä˻ØÄ꤬¤Ê¤±¤ì¤Ð¡¢»þ´Ö¤Ë´Ø¤ë sysctl ¤Îñ°Ì¤ÏÉäǤ¢¤ë¡£ +.TP +.IR anycast_delay " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +IPv6 ¤Î¶á˵Í×ÀÁ¥á¥Ã¥»¡¼¥¸ (neighbor soliciation message) +¤Ë±þÅú¤¹¤ë¤Þ¤Ç¤ÎºÇÂçÃÙ±ä»þ´Ö (jiffy ñ°Ì)¡£ +anycast ¤Î¥µ¥Ý¡¼¥È¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 1 Éᣠ+.TP +.IR app_solicit " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +¥æ¡¼¥¶¡¼¶õ´Ö¤Î ARP ¥Ç¡¼¥â¥ó¤Ë netlink ¤òÍѤ¤¤Æõº÷¤µ¤»¤ëºÇÂç²ó¿ô¡£ +¤³¤ì¤ò±Û¤¨¤ë¤È¥Þ¥ë¥Á¥­¥ã¥¹¥È¤Ë¤è¤ëõº÷¤Ë°Ü¹Ô¤¹¤ë +.RI ( mcast_solicit +¤ò¸«¤è)¡£ +.TP +.IR base_reachable_time " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +¶á˵¤Î¥Û¥¹¥È¤¬¤ß¤Ä¤«¤ë¤È¡¢¤½¤Î¥¨¥ó¥È¥ê¤Ï +.IR base_reachable_time "/2 ¤«¤é 3*" base_reachable_time /2 +¤Î´Ö¤Î¥é¥ó¥À¥à¤ÊÃͤλþ´Ö¡¢Í­¸ú¤Ç¤¢¤ë¤È¤ß¤Ê¤µ¤ì¤ë¡£ +¥¨¥ó¥È¥ê¤ÎÍ­¸úÀ­¤Ï¡¢¹â°Ì¤Î¥×¥í¥È¥³¥ë¤«¤é¥Ý¥¸¥Æ¥£¥Ö¤Ê¥Õ¥£¡¼¥É¥Ð¥Ã¥¯¤ò +¼õ¤±¼è¤ë¤È±äŤµ¤ì¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ï 30 Éᣠ+¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¸½ºß¤ÏÈó¿ä¾©¤Ç¤¢¤ê¡¢Âå¤ï¤ê¤Ë +.I base_reachable_time_ms +¤ò»È¤¦¤³¤È¡£ +.TP +.IR base_reachable_time_ms " (Linux 2.6.12 °Ê¹ß)" +.I base_reachable_time +¤ÈƱ¤¸¤À¤¬¡¢»þ´Ö¤ò¥ß¥êÉÃñ°Ì¤Ç¬¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 30000 ¥ß¥êÉäǤ¢¤ë¡£ +.TP +.IR delay_first_probe_time " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +¶á˵¥Û¥¹¥È¤Î¥¨¥ó¥È¥ê¤¬¸Å¤¯¤Ê¤Ã¤¿¤ÈȽÃǤµ¤ì¤¿¸å¤Ë +ºÇ½é¤Ëõº÷¤ò¹Ô¤¦¤Þ¤Ç¤ÎÃÙ±ä»þ´Ö¡£¥Ç¥Õ¥©¥ë¥È¤Ï 5 Éᣠ+.TP +.IR gc_interval " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +¥¬¥Ù¡¼¥¸¡¦¥³¥ì¥¯¥¿¤ò¶á˵¥Û¥¹¥È¥¨¥ó¥È¥ê¤ËÂФ·¤Æ¼Â¹Ô¤µ¤»¤ëÉÑÅÙ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 30 Éᣠ+.TP +.IR gc_stale_time " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +¸Å¤¯¤Ê¤Ã¤¿¶á˵¥Û¥¹¥È¥¨¥ó¥È¥ê¤ËÂФ·¤Æ¥Á¥§¥Ã¥¯¤ò¹Ô¤¦ÉÑÅÙ¡£ +¶á˵¥Û¥¹¥È¥¨¥ó¥È¥ê¤¬¸Å¤¯¤Ê¤Ã¤¿¤È¤ß¤Ê¤µ¤ì¤ë¤È¡¢¤½¤Î¥¨¥ó¥È¥ê¤Ë +¥Ç¡¼¥¿¤òÁ÷¤ëÁ°¤Ë¤ÏºÆÅÙ²ò·è¤¬¹Ô¤ï¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 60 Éᣠ+.TP +.IR gc_thresh1 " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +ARP ¥­¥ã¥Ã¥·¥å¤ËÊݸ¤¹¤ë¥¨¥ó¥È¥ê¿ô¤ÎºÇ¾®ÃÍ¡£ +¤³¤Î¿ô¤è¤ê¾¯¤Ê¤¤¥¨¥ó¥È¥ê¤·¤«¥­¥ã¥Ã¥·¥å¤Ë¤Ê¤±¤ì¤Ð¡¢ +¥¬¥Ù¡¼¥¸¡¦¥³¥ì¥¯¥¿¤Ï¼Â¹Ô¤µ¤ì¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 128¡£ +.TP +.IR gc_thresh2 " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +ARP ¥­¥ã¥Ã¥·¥å¤ËÊݸ¤µ¤ì¤ë¥¨¥ó¥È¥ê¿ô¤Î¥½¥Õ¥È¤ÊºÇÂçÃÍ¡£ +¥­¥ã¥Ã¥·¥å¤Î¥¨¥ó¥È¥ê¤¬¤³¤Î¿ô¤ò 5 Éôֱۤ¨¤Ä¤Å¤±¤ë¤È¡¢ +¥¬¥Ù¡¼¥¸¡¦¥³¥ì¥¯¥¿¤¬¼Â¹Ô¤µ¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 512¡£ +.TP +.IR gc_thresh3 " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +ARP ¥­¥ã¥Ã¥·¥å¤ËÊݸ¤µ¤ì¤ë¥¨¥ó¥È¥ê¿ô¤Î¥Ï¡¼¥É¤ÊºÇÂçÃÍ¡£ +¥­¥ã¥Ã¥·¥å¤Î¥¨¥ó¥È¥ê¤¬¤³¤Î¿ô¤ò±Û¤¨¤ë¤È¡¢ +¥¬¥Ù¡¼¥¸¡¦¥³¥ì¥¯¥¿¤Ï¤¿¤À¤Á¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 1024¡£ +.TP +.IR locktime " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +ARP ¥¨¥ó¥È¥ê¤ò¥­¥ã¥Ã¥·¥å¤ËÊݸ¤¹¤ë»þ´Ö¤ÎºÇ¾®ÃÍ (jiffy ñ°Ì)¡£ +²ÄǽÀ­¤Î¤¢¤ë¥Þ¥Ã¥Ô¥ó¥°¤¬°ì¤Ä°Ê¾å¤¢¤ë (¤¿¤¤¤Æ¤¤¤Ï¥Í¥Ã¥È¥ï¡¼¥¯ÀßÄê¤Î¥ß¥¹) +¾ì¹ç¤Ë¡¢ ARP ¥­¥ã¥Ã¥·¥å¤Î¥¹¥é¥Ã¥·¥ó¥°¤¬µ¯¤­¤ë¤³¤È¤òËɤ°¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 1 Éᣠ+.TP +.IR mcast_solicit " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +¥¨¥ó¥È¥ê¤ò unreachable ¥Þ¡¼¥¯¤¹¤ëÁ°¤Ë¡¢ +¥¢¥É¥ì¥¹¤ò¥Þ¥ë¥Á¥­¥ã¥¹¥È/¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤Ç²ò·è¤·¤è¤¦¤È¤¹¤ë +»î¹Ô²ó¿ô¤ÎºÇÂçÃÍ¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 3¡£ +.TP +.IR proxy_delay " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +´ûÃΤÎÂåÍý ARP ¥¢¥É¥ì¥¹¤ËÂФ·¤Æ ARP ¥ê¥¯¥¨¥¹¥È¤ò¼õ¿®¤·¤¿¾ì¹ç¤Ë¡¢ +±þÅúÁ°¤ËºÇÂç +.I proxy_delay +jiffy ¤Þ¤ÇÃٱ䤹¤ë¡£¤³¤ì¤Ï¾ì¹ç¤Ë¤è¤Ã¤ÆÀ¸¤¸¤ë +¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥Õ¥é¥Ã¥Ç¥£¥ó¥° (network flooding) ¤òÈò¤±¤ë¤¿¤á¤ËÍѤ¤¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 0.8 Éᣠ+.TP +.IR proxy_qlen " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +ÂåÍý ARP ¥¢¥É¥ì¥¹¤ËÂФ·¤Æ¥­¥å¡¼¥¤¥ó¥°¤Ç¤­¤ëºÇÂç¤Î¥Ñ¥±¥Ã¥È¿ô¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 64¡£ +.TP +.IR retrans_time " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +¥ê¥¯¥¨¥¹¥È¤òºÆÅÙÁ÷¤ë¤Þ¤Ç¤ÎÃÙ±ä»þ´Ö (jiffy ñ°Ì)¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 1 Éᣠ+¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¸½ºß¤ÏÈó¿ä¾©¤Ç¤¢¤ê¡¢Âå¤ï¤ê¤Ë +.I retrans_time_ms +¤ò»È¤¦¤³¤È¡£ +.TP +.IR retrans_time_ms " (Linux 2.6.12 °Ê¹ß)" +¥ê¥¯¥¨¥¹¥È¤òºÆÅÙÁ÷¤ë¤Þ¤Ç¤ÎÃÙ±ä»þ´Ö (¥ß¥êÉÃñ°Ì)¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 1000 ¥ß¥êÉᣠ+.TP +.IR ucast_solicit " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +ARP ¥Ç¡¼¥â¥ó¤Ø¤ÎÌ䤤¹ç¤ï¤»¤ò¹Ô¤¦Á°¤Ë¹Ô¤¦ unicast õº÷¤ÎºÇÂç»î¹Ô¿ô +.RI ( app_solicit +¤ò¸«¤è)¡£¥Ç¥Õ¥©¥ë¥È¤Ï 3¡£ +.TP +.IR unres_qlen " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.79 +²ò·è¤µ¤ì¤Æ¤¤¤Ê¤¤¥¢¥É¥ì¥¹¤ËÂФ·¤Æ¡¢ +¾¤Î¥Í¥Ã¥È¥ï¡¼¥¯Áؤ«¤é¥­¥å¡¼¥¤¥ó¥°¤Ç¤­¤ëºÇÂç¥Ñ¥±¥Ã¥È¿ô¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 3¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +Linux 2.0 ¤Ç¡¢ +.I struct arpreq +¤Ë +.I arp_dev +¥á¥ó¥Ð¡¼¤¬´Þ¤Þ¤ì¤ë¤è¤¦¤ËÊѹ¹¤¬¤¢¤Ã¤¿¡£¤Þ¤¿Æ±»þ¤Ë +ioctl ÈÖ¹æ¤âÊѹ¹¤µ¤ì¤¿¡£¸Å¤¤ ioctl ¤Ï +Linux 2.2 ¤ÇÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¯¤Ê¤Ã¤¿¡£ + +¥Í¥Ã¥È¥ï¡¼¥¯¤ËÂФ¹¤ëÂåÍý arp ¥¨¥ó¥È¥ê (netmask ¤¬ 0xffffffff ¤Ç¤Ê¤¤) +¤Ï¡¢ Linux 2.2 ¤ÇÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¯¤Ê¤Ã¤¿¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡¢Ê̤Υ¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤ª¤±¤ë +Åþã²Äǽ¤Ê¤¹¤Ù¤Æ¤Î¥Û¥¹¥È¤ËÂФ¹¤ë¼«Æ°ÂåÍý arp ¤Ë¤è¤Ã¤ÆÃÖ¤­´¹¤¨¤é¤ì¤¿ +(¤½¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¥Õ¥©¥ï¡¼¥Ç¥£¥ó¥°¤ÈÂåÍý arp ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç)¡£ + +.I neigh/* +¤Î³Æ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï Linux 2.2 °ÊÁ°¤Ë¤Ï¸ºß¤·¤Ê¤¤¡£ +.SH ¥Ð¥° +¤¤¤¯¤Ä¤«¤Î¥¿¥¤¥Þ¡¼ÀßÄê¤Ï jiffy ¤Ç»ØÄꤵ¤ì¤ë¤¬¡¢ +jiffy ¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ä¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë°Í¸¤¹¤ë¡£ +.BR time (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +¥æ¡¼¥¶¡¼¶õ´Ö¤«¤é¥Ý¥¸¥Æ¥£¥Ö¤Ê¥Õ¥£¡¼¥É¥Ð¥Ã¥¯¤òÁ÷¤ëÊýË¡¤¬Â¸ºß¤·¤Ê¤¤¡£ +¤Ä¤Þ¤êÀܳ»Ø¸þ (connection-oriented) ¤Î¥×¥í¥È¥³¥ë¤ò¥æ¡¼¥¶¡¼¶õ´Ö¤Ç +¼ÂÁõ¤¹¤ë¤È¡¢Í¾·×¤Ê ARP ¥È¥é¥Õ¥£¥Ã¥¯¤Î¸¶°ø¤È¤Ê¤ë¡£ +¤Ê¤¼¤Ê¤é ndisc ¤ÏÄê´üŪ¤Ë MAC ¥¢¥É¥ì¥¹¤òºÆõº÷¤¹¤ë¤«¤é¤Ç¤¢¤ë¡£ +ƱÍͤÎÌäÂê¤Ï¤¤¤¯¤Ä¤«¤Î¥«¡¼¥Í¥ë¥×¥í¥È¥³¥ë (NFS over UDP ¤Ê¤É) ¤Ë¤â¸ºß¤¹¤ë¡£ +.PP +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ï IPv4 ÆÃÍ­¤Îµ¡Ç½¤È +IPv4¡¦IPv6 ¤Ç¶¦Í­¤µ¤ì¤ëµ¡Ç½¤È¤¬¤´¤Ã¤Á¤ã¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR capabilities (7), +.BR ip (7) +.PP +.BR RFC\ 826 : +ARP ¤Ë´Ø¤¹¤ëÀâÌÀ +.br +.BR RFC\ 2461 : +IPv6 neighbor discovery ¤Ë´Ø¤¹¤ëÀâÌÀ¤È¡¢ +ÍøÍѤµ¤ì¤Æ¤¤¤ë´ðÁÃ¥¢¥ë¥´¥ê¥º¥à +.LP +Linux 2.2 °Ê¹ß¤Î IPv4 ARP ¤Ï¡¢ +²Äǽ¤Ê¾ì¹ç¤Ï IPv6 ¤Î¥¢¥ë¥´¥ê¥º¥à¤òÍѤ¤¤ë¡£ diff --git a/release/man7/ascii.7 b/release/man7/ascii.7 new file mode 100644 index 00000000..483d6e60 --- /dev/null +++ b/release/man7/ascii.7 @@ -0,0 +1,204 @@ +'\" t +.\" Copyright (c) 1993 Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de) +.\" Created Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" 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. +.\" +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 1994-05-15 by Daniel Quinlan (quinlan@yggdrasil.com) +.\" Modified 1994-11-22 by Daniel Quinlan (quinlan@yggdrasil.com) +.\" Modified 1995-07-11 by Daniel Quinlan (quinlan@yggdrasil.com) +.\" Modified 1996-12-18 by Michael Haardt and aeb +.\" Modified 1999-05-31 by Dimitri Papadopoulos (dpo@club-internet.fr) +.\" 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" +.SH ̾Á° +ascii \- ASCII ʸ»ú½¸¹ç¤Î 8 ¿Ê¿ô¡¢10 ¿Ê¿ô¡¢16 ¿Ê¿ô¤Ë¤è¤ëÉä¹æ²½ +.SH ÀâÌÀ +ASCII ¤Ï¡¢¾ðÊó¸ò´¹ÍÑÊƹñɸ½à¥³¡¼¥É (American Standard Code for +Information Interchange) ¤Îά¤Ç¡¢7 ¥Ó¥Ã¥È¤Î¥³¡¼¥É¤Ç¤¢¤ë¡£ +(ISO 8859-1 ¤Î¤è¤¦¤Ê) ¿¤¯¤Î 8 ¥Ó¥Ã¥È¤Î¥³¡¼¥É¤Ç¤Ï²¼È¾Ê¬¤Ë +ASCII ¤ò´Þ¤ó¤Ç¤¤¤ë¡£ASCII ¤Ï¹ñºÝŪ¤Êµ¬³Ê¤Ç¤Ï ISO 646 ¤È¤·¤ÆÃΤé¤ì¤Æ¤¤¤ë¡£ +.LP +°Ê²¼¤Îɽ¤Ï 128 ʸ»ú¤Î ASCII ʸ»ú¤ò¤Þ¤È¤á¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.LP +C ¥×¥í¥°¥é¥à¤Ç¤Î \f(CW\(aq\eX\(aq\fP ¥¨¥¹¥±¡¼¥×¤âÃíµ­¤·¤Æ¤¢¤ë¡£ +.if t \{\ +.in 1i +.ft CW +\} +.TS +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 @ +001 1 01 SOH (¥Ø¥Ã¥À³«»Ï) 101 65 41 A +002 2 02 STX (¥Æ¥­¥¹¥È³«»Ï) 102 66 42 B +003 3 03 ETX (¥Æ¥­¥¹¥È½ªÎ») 103 67 43 C +004 4 04 EOT (žÁ÷½ªÎ») 104 68 44 D +005 5 05 ENQ (Ì䤤¹ç¤ï¤») 105 69 45 E +006 6 06 ACK (¹ÎÄê±þÅú) 106 70 46 F +007 7 07 BEL \(aq\ea\(aq (¥Ù¥ë) 107 71 47 G +010 8 08 BS \(aq\eb\(aq (¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹) 110 72 48 H +011 9 09 HT \(aq\et\(aq (¿åÊ¿¥¿¥Ö) 111 73 49 I +012 10 0A LF \(aq\en\(aq (²þ¹Ô) 112 74 4A J +013 11 0B VT \(aq\ev\(aq (¿âľ¥¿¥Ö) 113 75 4B K +014 12 0C FF \(aq\ef\(aq (²þ¥Ú¡¼¥¸) 114 76 4C L +015 13 0D CR \(aq\er\(aq (Éüµ¢) 115 77 4D M +016 14 0E SO (¥·¥Õ¥È¥¢¥¦¥È) 116 78 4E N +017 15 0F SI (¥·¥Õ¥È¥¤¥ó) 117 79 4F O +020 16 10 DLE (ÅÁÁ÷À©¸æ³ÈÄ¥) 120 80 50 P +021 17 11 DC1 (ÁõÃÖÀ©¸æ1) 121 81 51 Q +022 18 12 DC2 (ÁõÃÖÀ©¸æ2) 122 82 52 R +023 19 13 DC3 (ÁõÃÖÀ©¸æ3) 123 83 53 S +024 20 14 DC4 (ÁõÃÖÀ©¸æ4) 124 84 54 T +025 21 15 NAK (ÈÝÄê±þÅú) 125 85 55 U +026 22 16 SYN (Ʊ´ü) 126 86 56 V +027 23 17 ETB (žÁ÷¥Ö¥í¥Ã¥¯½ªÎ») 127 87 57 W +030 24 18 CAN (¥­¥ã¥ó¥»¥ë) 130 88 58 X +031 25 19 EM (¥á¥Ç¥£¥¢½ªÎ») 131 89 59 Y +032 26 1A SUB (ÃÖ´¹) 132 90 5A Z +033 27 1B ESC (¥¨¥¹¥±¡¼¥×) 133 91 5B [ +034 28 1C FS (¥Õ¥¡¥¤¥ë¶èÀÚ¤ê) 134 92 5C \e \(aq\e\e\(aq +035 29 1D GS (¥°¥ë¡¼¥×¶èÀÚ¤ê) 135 93 5D ] +036 30 1E RS (¥ì¥³¡¼¥É¶èÀÚ¤ê) 136 94 5E ^ +037 31 1F US (¥æ¥Ë¥Ã¥È¶èÀÚ¤ê) 137 95 5F \&_ +040 32 20 SPACE 140 96 60 \` +041 33 21 ! 141 97 61 a +042 34 22 " 142 98 62 b +043 35 23 # 143 99 63 c +044 36 24 $ 144 100 64 d +045 37 25 % 145 101 65 e +046 38 26 & 146 102 66 f +047 39 27 \' 147 103 67 g +050 40 28 ( 150 104 68 h +051 41 29 ) 151 105 69 i +052 42 2A * 152 106 6A j +053 43 2B + 153 107 6B k +054 44 2C , 154 108 6C l +055 45 2D \- 155 109 6D m +056 46 2E . 156 110 6E n +057 47 2F / 157 111 6F o +060 48 30 0 160 112 70 p +061 49 31 1 161 113 71 q +062 50 32 2 162 114 72 r +063 51 33 3 163 115 73 s +064 52 34 4 164 116 74 t +065 53 35 5 165 117 75 u +066 54 36 6 166 118 76 v +067 55 37 7 167 119 77 w +070 56 38 8 170 120 78 x +071 57 39 9 171 121 79 y +072 58 3A : 172 122 7A z +073 59 3B ; 173 123 7B { +074 60 3C < 174 124 7C | +075 61 3D = 175 125 7D } +076 62 3E > 176 126 7E ~ +077 63 3F ? 177 127 7F DEL +.TE +.if t \{\ +.in +.ft P +\} +.SS ɽ +ÊØÍø¤Ê¤Î¤Ç¡¢16¿Ê·Á¼°¤È10¿Ê·Á¼°¤Î´Ê·é¤Êɽ¤òºÜ¤»¤Æ¤ª¤¯¡£ +.sp +.nf +.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 +3: # 3 C S c s 3: ! + 5 ? I S ] g q { +4: $ 4 D T d t 4: " , 6 @ J T ^ h r | +5: % 5 E U e u 5: # \- 7 A K U _ i s } +6: & 6 F V f v 6: $ . 8 B L V \` j t ~ +7: \' 7 G W g w 7: % / 9 C M W a k u DEL +8: ( 8 H X h x 8: & 0 : D N X b l v +9: ) 9 I Y i y 9: \' 1 ; E O Y c m w +A: * : J Z j z +B: + ; K [ k { +C: , < L \e l | +D: \- = M ] m } +E: . > N ^ n ~ +F: / ? O _ o DEL +.if t \{\ +.in +.ft P +\} +.fi +.SH È÷¹Í +.SS Îò»Ë +.B ascii +¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï AT&T UNIX Version 7 ¤ÇÅо줷¤¿¡£ +.LP +¸Å¤¤Ã¼Ëö¤Ç¤Ï¡¢¥¢¥ó¥À¡¼¥¹¥³¥¢¤¬¥Ð¥Ã¥¯¥¢¥í¡¼ (backarrow) ¤È¸Æ¤Ð¤ì¤ë +º¸¸þ¤­¤ÎÌð°õ¤Çɽ¼¨¤µ¤ì¤ë¡¢¤Þ¤¿¥­¥ã¥ì¥Ã¥È¤¬¾å¸þ¤­¤ÎÌð°õ¤Çɽ¼¨¤µ¤ì¡¢ +½ÄËÀ (vertcal bar) ¤Ç¤Ï¿¿¤óÃæ¤Ë·ê¤¬¤¢¤ë¡£ +.LP +Âçʸ»ú (uppercase) ¤È¾®Ê¸»ú (lowercase) ¤Ï 1 ¥Ó¥Ã¥È¤À¤±°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +ASCII ¤Îʸ»ú 2 ¤Ï¥À¥Ö¥ë¥¯¥©¡¼¥È¤È¤Ï 1 ¥Ó¥Ã¥È¤À¤±°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤³¤ì¤Ë¤è¤Ã¤Æµ¡³£¼°¥­¡¼¥Ü¡¼¥É¤ä¥Þ¥¤¥³¥óÀ©¸æ¤Ç¤Ê¤¤ÅŻҥ­¡¼¥Ü¡¼¥É¤Ç +¥­¡¼¥³¡¼¥É²½¤¹¤ë¤³¤È¤¬´Êñ¤Ë¤Ê¤ë¡£¤Þ¤¿¡¢¸Å¤¤¥Æ¥ì¥¿¥¤¥×¤Ç¤â¤³¤Î +ÁȤ߹ç¤ï¤»¤¬»ÈÍѤµ¤ì¤Æ¤¤¤¿¡£(ÌõÃí: JIS ¥­¡¼ÇÛÎó¤â¤½¤Î°ì¼ï) +.LP +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 +.\" American National Standards Committee X3 (ANSC-X3) and now it is known +.\" as Accredited Standards Committee X3 (ASC X3). It is accredited by ANSI +.\" and administered by ITI. The subcommittee X3.2 worked on coded +.\" character sets; the task group working on ASCII appears to have been +.\" designated X3.2.4. In 1966, ASA became the United States of America +.\" Standards Institute (USASI) and published ASCII in 1968. It became the +.\" American National Standards Institute (ANSI) in 1969 and is the +.\" U.S. member body of ISO; private and nonprofit. +.\" +.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) diff --git a/release/man7/boot.7 b/release/man7/boot.7 new file mode 100644 index 00000000..b6f002a9 --- /dev/null +++ b/release/man7/boot.7 @@ -0,0 +1,214 @@ +.\" Written by Oron Peled . +.\" May be distributed subject to the GPL. +.\" +.\" I tried to be as much generic in the description as possible: +.\" - General boot sequence is applicable to almost any +.\" OS/Machine (DOS/PC, Linux/PC, Solaris/SPARC, CMS/S390) +.\" - kernel and init(8) is applicable to almost any Unix/Linux +.\" - boot scripts are applicable to SYSV-R4 based Unix/Linux +.\" +.\" Modified 2004-11-03 patch from Martin Schulze +.\" +.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. +.\" Translated 2002-08-07, NAKANO Takeo +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" +.TH BOOT 7 2007-06-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +boot-scripts \- ¥Ö¡¼¥È¥·¡¼¥±¥ó¥¹¤Î°ìÈÌŪ¤Ê²òÀâ +.SH ÀâÌÀ +ºÙ¤«¤¤¤È¤³¤í¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¤¬¡¢Âç¤Þ¤«¤Ë¸À¤¦¤È¡¢ +¥Ö¡¼¥È¥·¡¼¥±¥ó¥¹¤Ï°Ê²¼¤ÎÃʳ¬¤Ëʬ¤±¤é¤ì¤ë: +(1) ¥Ï¡¼¥É¥¦¥§¥¢¤Î¥Ö¡¼¥È (2) OS ¥í¡¼¥À¡¼ +(3) ¥«¡¼¥Í¥ë¤Îµ¯Æ° (4) init ¤È inittab +(5) ¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È +.SS ¥Ï¡¼¥É¥¦¥§¥¢¤Î¥Ö¡¼¥È +ÅŸ»ÅêÆþ¤ä¥Ï¡¼¥É¥ê¥»¥Ã¥È¤¬¹Ô¤ï¤ì¤ë¤È¡¢ +ROM (Ä̾ï¤Ï PROM) ¤ËÊݸ¤µ¤ì¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤ËÀ©¸æ¤¬ÅϤµ¤ì¤ë¡£ +PC ¤Ç¤Ï¤³¤Î¥×¥í¥°¥é¥à¤ÏÄ̾ï \fBBIOS\fR ¤È¸Æ¤Ð¤ì¤ë¡£ + +¤Õ¤Ä¤¦¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢¤Þ¤º¥Þ¥·¥ó¤Î´ðËÜŪ¤Ê¼«¸Ê¿ÇÃǤò¹Ô¤¤¡¢ +¤½¤·¤ÆÉÔ´øȯÀ­¥á¥â¥ê¤Ë¥¢¥¯¥»¥¹¤·¤Æ³Æ¼ï¤Î¥Ñ¥é¥á¡¼¥¿¤òÆɤ߹þ¤à¡£ +PC ¤Ç¤Ï¡¢¤³¤Î¥á¥â¥ê¤ÏÅÅÃӤˤè¤Ã¤Æ¥Ð¥Ã¥¯¥¢¥Ã¥×¤µ¤ì¤Æ¤¤¤ë CMOS ¥á¥â¥ê¤Ç¤¢¤ë¡£ +¤½¤Î¤¿¤á \fBCMOS\fR ¤È¸Æ¤Ð¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ +¤·¤«¤· PC °Ê³°¤ÎÀ¤³¦¤Ç¤Ï¡¢Ä̾ï \fBnvram\fR +(nonvolatile ram) ¤È¸Æ¤Ð¤ì¤Æ¤¤¤ë¡£ + +nvram ¤ËÊݸ¤µ¤ì¤Æ¤¤¤ë¥Ñ¥é¥á¡¼¥¿¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +¤·¤«¤·¡¢¥Ï¡¼¥É¥¦¥§¥¢¥Ö¡¼¥È¥×¥í¥°¥é¥à¤Ï¡¢¾¯¤Ê¤¯¤È¤â¡¢ +¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤¬¤É¤ì¤Ç¤¢¤ë¤«¡¢¤â¤·¤¯¤Ï +¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤È¤·¤Æõº÷¤¹¤ë¥Ç¥Ð¥¤¥¹¤¬¤É¤ì¤Ç¤¢¤ë¤«¤ò +ÃΤäƤ¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +¥Ï¡¼¥É¥¦¥§¥¢¥Ö¡¼¥È¤Î¥·¡¼¥±¥ó¥¹¤Ï¡¢¼¡¤Ë¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤Ë¥¢¥¯¥»¥¹¤·¡¢ +¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤Î¤¢¤é¤«¤¸¤á·è¤Þ¤Ã¤¿¾ì½ê¤ËÃÖ¤«¤ì¤Æ¤¤¤ë +OS ¥í¡¼¥À¡¼¤ò¥í¡¼¥É¤·¡¢À©¸æ¤òÅϤ¹¡£ +.TP +Ãí°Õ: +¤³¤³¤Ç¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ö¡¼¥È¤Ë¤Ä¤¤¤Æ¤Ï¿¨¤ì¤Ê¤¤¡£ +¤³¤ÎÏÃÂê¤Ë¤Ä¤¤¤ÆÄ´ºº¤·¤¿¤¤ÆɼԤϡ¢ +DHCP, TFTP, PXE, Etherboot Åù¤Ë¤Ä¤¤¤ÆÄ´¤Ù¤Æ¤ß¤ë¤È¤è¤¤¡£ +.SS OS ¥í¡¼¥À¡¼ +PC ¤Ç¤Ï¡¢OS ¥í¡¼¥À¡¼¤Ï¥Ö¡¼¥È¥Ç¥Ð¥¤¥¹¤ÎÀèƬ¥»¥¯¥¿¤ËÃÖ¤«¤ì¤ë¡£ +¤³¤ì¤Ï \fBMBR\fR (Master Boot Record) ¤È¸Æ¤Ð¤ì¤ë¡£ + +ÍÍ¡¹¤ÊÀ©Ìó¤Î¤¿¤á¡¢ +¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤ÇÂè°ì¥í¡¼¥À¡¼¤ÏÈó¾ï¤Ë´Êñ¤Êµ¡Ç½¤·¤«»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +PC °Ê³°¤Î¥·¥¹¥Æ¥à¤Ç¤â¡¢ +¥µ¥¤¥º¤ÎÀ©¸Â¤ä¥í¡¼¥À¡¼¤Îµ¡Ç½¤Ê¤É¤Ë¤¢¤ëÄøÅÙ¤ÎÀ©¸Â¤Ï¸ºß¤¹¤ë¡£ +¤·¤«¤·¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤ò´Þ¤á¤Æ 512 ¥Ð¥¤¥È¤È¤¤¤¦ +PC ¤Î MBR ¤Ç¤Ï¡¢OS ¥í¡¼¥À¡¼¤ÎÁ´µ¡Ç½¤ò¤³¤³¤Ë²¡¤·¹þ¤à¤Î¤Ï¤Þ¤ºÉÔ²Äǽ¤À¡£ + +¤·¤¿¤¬¤Ã¤ÆÂçÄñ¤Î OS ¤Ç¤Ï¡¢Âè°ì¥í¡¼¥À¡¼¤ÏÂèÆó¥í¡¼¥À¡¼¤ò¸Æ¤Ö¤è¤¦¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +¸å¼Ô¤Ï¤¢¤é¤«¤¸¤á»ØÄꤵ¤ì¤¿¥Ç¥£¥¹¥¯¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ËÃÖ¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ + +Linux ¤Ë¤ª¤±¤ë OS ¥í¡¼¥À¡¼¤Ï¡¢¤Õ¤Ä¤¦ +.BR lilo (8) +¤« +.BR grub (8) +¤Ç¤¢¤ë¡£Î¾¼Ô¤È¤âÂèÆó¥í¡¼¥À¡¼¤È¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤â¤Ç¤­ +(¤³¤Î¾ì¹ç DOS ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿ MBR ¤¬¤³¤ì¤é¤ò»Ø¤¹¤è¤¦¤Ë¤¹¤ë)¡¢ +¤Þ¤¿Âè°ì¡¦ÂèÆó¥í¡¼¥À¡¼¤ÎξÊý¤È¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¸å¼Ô¤Î¾ì¹ç¸þ¤±¤Ë¡¢Î¾¼Ô¤ÏÆÃÊÌ¤Ê MBR ¥¤¥á¡¼¥¸¤òÄ󶡤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Ë¤ÏÂèÆó¥í¡¼¥À¡¼¤ò¥ë¡¼¥È¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤«¤é¥í¡¼¥É¤¹¤ë¤è¤¦¤Ê +¥Ö¡¼¥È¥¹¥È¥é¥Ã¥×¥³¡¼¥É¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ + +OS ¥í¡¼¥À¡¼¤Î¼ç¤Ê»Å»ö¤Ï¡¢¥«¡¼¥Í¥ë¤Î¥Ç¥£¥¹¥¯¾å¤Î°ÌÃÖ¤òÆÃÄꤷ¡¢ +¥í¡¼¥É¤·¤Æµ¯Æ°¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£¤Û¤È¤ó¤É¤Î OS ¥í¡¼¥À¡¼¤Ï¡¢ +ÂÐÏå⡼¥É¤Ç»ÈÍѤ¹¤ë¤³¤È¤â¤Ç¤­¡¢ÄɲäΥѥé¥á¡¼¥¿¤ò¥«¡¼¥Í¥ë¤ËÅϤ·¤¿¤ê¡¢ +¥Ç¥Õ¥©¥ë¥È¤È¤ÏÊ̤Υ«¡¼¥Í¥ë¤ò»ØÄꤷ¤¿¤ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +(Î㤨¤Ð¡¢ºÇ¸å¤Ë¥³¥ó¥Ñ¥¤¥ë¤·¤¿¥«¡¼¥Í¥ë¤¬µ¡Ç½¤·¤Ê¤«¤Ã¤¿»þ¤Ë +¥Ð¥Ã¥¯¥¢¥Ã¥×¤Î¥«¡¼¥Í¥ë¤ò»ØÄꤷ¤Æµ¯Æ°¤¹¤ë¤È¤¤¤Ã¤¿¤³¤È¤¬¤Ç¤­¤ë)¡£ +.SS ¥«¡¼¥Í¥ë¤Îµ¯Æ° +¥«¡¼¥Í¥ë¤Ï¥í¡¼¥É¤µ¤ì¤ë¤È¡¢¥Ç¥Ð¥¤¥¹¤ò (¥É¥é¥¤¥Ð¤Ë¤è¤Ã¤Æ) +½é´ü²½¤·¡¢¥¹¥ï¥Ã¥Ñ¤òµ¯Æ°¤· (ºÇ¶á¤Î Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¥¹¥ï¥Ã¥Ñ¤Ï kswapd ¤È¤¤¤¦¡Ö¥«¡¼¥Í¥ë¥×¥í¥»¥¹¡×¤Ë¤Ê¤ë)¡¢ +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à (/) ¤ò¥Þ¥¦¥ó¥È¤¹¤ë¡£ + +¥«¡¼¥Í¥ë¤ËÅϤ¹¤³¤È¤Î¤Ç¤­¤ë¥Ñ¥é¥á¡¼¥¿¤Î¤¤¤¯¤Ä¤«¤Ï¡¢ +¤³¤ì¤é¤ÎÆ°ºî¤Ë´Ø·¸¤¹¤ë¡£ +(Î㤨¤Ð¥Ç¥Õ¥©¥ë¥È¤Î¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë)¡£ +Linux ¥«¡¼¥Í¥ë¥Ñ¥é¥á¡¼¥¿¤Ë´Ø¤¹¤ë¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR bootparam (7) +¤òÆɤó¤Ç¤Û¤·¤¤¡£ + +¤³¤ì¤é¤¬ºÑ¤ó¤Ç¤Ï¤¸¤á¤Æ¡¢ +¥«¡¼¥Í¥ë¤ÏºÇ½é¤Î (¥æ¡¼¥¶¥é¥ó¥É¤Î) ¥×¥í¥»¥¹¤òÀ¸À®¤·¡¢ +ÈÖ¹æ 1 ¤òÍ¿¤¨¤ë¡£¤³¤Î¥×¥í¥»¥¹¤Ï +.I /sbin/init +¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¡£ +¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ñ¥é¥á¡¼¥¿¤Ï¤¹¤Ù¤Æ +.I /sbin/init +¤ËÅϤµ¤ì¤ë¡£ +.SS init ¤È inittab +init ¤Ï¡¢µ¯Æ°¤¹¤ë¤È¤Þ¤º +.I /etc/inittab +¤òÆɤߡ¢¤½¤Î¸å¤Î¹ÔÆ°¤Ë´Ø¤¹¤ë¾ðÊó¤òÆÀ¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï +.I ¥é¥ó¥ì¥Ù¥ë +¤Ë¤è¤Ã¤Æ¤É¤Î¤è¤¦¤ÊÆ°ºî¤ò¹Ô¤¦¤Ù¤­¤Ç¤¢¤ë¤«¤òÄêµÁ¤¹¤ë¡£ + +¤³¤ì¤Ë¤è¤Ã¤Æ¥·¥¹¥Æ¥à´ÉÍý¼Ô¤Î´ÉÍý¤¬³Ú¤Ë¤Ê¤ë¡£ +³Æ\fI¥é¥ó¥ì¥Ù¥ë\fR¤ÏÄ󶡤¹¤ë¥µ¡¼¥Ó¥¹¤Î½¸¹ç¤ËÂбþ¤¹¤ë +(Î㤨¤Ð \fBS\fR ¤Ï \fI¥·¥ó¥°¥ë¥æ¡¼¥¶\fR¡¢ +\fB2\fR ¤Ç¤ÏÂçÄñ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥µ¡¼¥Ó¥¹¤òµ¯Æ°¤¹¤ë¡¢¤Ê¤É)¡£ +¥·¥¹¥Æ¥à´ÉÍý¼Ô¤Ï¡¢ +.BR init (8) +¤òÍѤ¤¤Æ¸½ºß¤Î¥é¥ó¥ì¥Ù¥ë¤òÊѹ¹¤Ç¤­¡¢ +.BR runlevel (8) +¤Ë¤è¤Ã¤Æ¸½ºß¤Î¥é¥ó¥ì¥Ù¥ë¤ò³Îǧ¤Ç¤­¤ë¡£ + +¤·¤«¤·¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤·¤Æ¸Ä¡¹¤Î¥µ¡¼¥Ó¥¹¤ò´ÉÍý¤¹¤ë¤Î¤ÏÉÔÊؤʤΤǡ¢ +inittab ¤Ïñ¤Ë¥¹¥¯¥ê¥×¥È¤Î½¸¹ç¤ËÂФ¹¤ë¥Ö¡¼¥È¥¹¥È¥é¥Ã¥×¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¼ÂºÝ¤Î¸Ä¡¹¤Î¥µ¡¼¥Ó¥¹¤Îµ¯Æ°¤äÄä»ß¤Ï¡¢¤³¤ì¤é¤Î¥¹¥¯¥ê¥×¥È¤Ç¹Ô¤¦¡£ +.SS ¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È +.TP +Ãí°Õ: +°Ê²¼¤ÎÀâÌÀ¤Ï System V Release 4 ¤ò¥Ù¡¼¥¹¤È¤·¤¿¥·¥¹¥Æ¥à¤Ë´Ø¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¸½ºß¤ÎÂçÄñ¤Î¾¦ÍÑ Unix ¥·¥¹¥Æ¥à (Solaris, HP-UX, Irix, Tru64) ¤ä¡¢ +¥á¥¸¥ã¡¼¤Ê Linux ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó (RedHat, Debian, Mandrake, +Suse, Caldera) ¤Ï¤³¤ì¤ò¥Ù¡¼¥¹¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤Îµ¡¹½¤¬ +¤¤¤¯¤é¤«°Û¤Ê¤ë¤³¤È¤â¤¢¤ë (Slackware Linux, FreeBSD, OpenBSD ¤Ê¤É)¡£ +.LP +´ÉÍý¤¹¤Ù¤­³Æ¥µ¡¼¥Ó¥¹ (¥á¡¼¥ë¡¢nfs ¥µ¡¼¥Ð¡¢cron ¤Ê¤É¤Ê¤É) +¤½¤ì¤¾¤ì¤ËÂФ·¤Æ¡¢¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤¬¤Ò¤È¤Ä¤º¤ÄÆÃÄê¤Î¥Ç¥£¥ì¥¯¥È¥ê +(¤Û¤È¤ó¤É¤Î Linux ¤Ç +.IR /etc/init.d ) +¤ËÇÛÃÖ¤µ¤ì¤ë¡£¤³¤ì¤é¤Î¥¹¥¯¥ê¥×¥È¤Ï¡¢ +¤½¤ì¤¾¤ì°ú¿ô¤È¤·¤Æ¤Ò¤È¤Ä¤Îñ¸ì¤ò¼è¤ë¡£"start" ¤¬»ØÄꤵ¤ì¤ë¤È +¤½¤Î¥µ¡¼¥Ó¥¹¤òµ¯Æ°¤·¡¢"stop" ¤¬»ØÄꤵ¤ì¤ë¤È¥µ¡¼¥Ó¥¹¤òÄä»ß¤¹¤ë¡£ +¥¹¥¯¥ê¥×¥È¤Ï¾¤Î¡ÖÊØÍø¤Ê¡×°ú¿ô¤ò¼è¤Ã¤Æ¤â¤è¤¤ +(Î㤨¤Ð "restart" ¤ÇÄä»ß¡¦µ¯Æ°¤ò½çÈ֤˹Ԥ俤ꡢ"status" +¤Ç¥µ¡¼¥Ó¥¹¤Î¾õÂÖ¤òɽ¼¨¤¹¤ë¤Ê¤É)¡£ +¥¹¥¯¥ê¥×¥È¤ò°ú¿ô¤Ê¤·¤Ç¼Â¹Ô¤¹¤ë¤È¡¢ +»ØÄê¤Ç¤­¤ë°ú¿ô¤Î°ìÍ÷¤¬É½¼¨¤µ¤ì¤ë¡£ +.SS ½ç½ø¤Å¤±¥Ç¥£¥ì¥¯¥È¥ê +¤¢¤ë¥é¥ó¥ì¥Ù¥ë¤Ç¡¢ÆÃÄê¤Î¥¹¥¯¥ê¥×¥È¤ò»ØÄꤷ¤¿½ç½ø¤Ç¼Â¹Ô¤µ¤»¤ë¤¿¤á¡¢ +.I ½ç½øÉÕ¤±¥Ç¥£¥ì¥¯¥È¥ê (sequencing directory) +¤È¤¤¤¦»ÅÁȤߤ¬Â¸ºß¤¹¤ë¡£ +¤³¤ì¤é¤Ï¤Õ¤Ä¤¦ +.I /etc/rc[0\-6S].d +¤Ç¤¢¤ë¡£³Æ¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÉô¤Ë¤Ï¡¢ +.I /etc/init.d +¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤¿¥¹¥¯¥ê¥×¥È¤Ø¤Î¥ê¥ó¥¯ (¤Õ¤Ä¤¦¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯) +¤¬ÃÖ¤«¤ì¤ë¡£ + +Âè°ì¥¹¥¯¥ê¥×¥È (Ä̾ï +.IR /etc/rc ) +¤Ï +.BR inittab (5) +¤«¤é¸Æ¤Ð¤ì¡¢ +½ç½øÉÕ¤±¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤¿¥ê¥ó¥¯·Ðͳ¤Ç³Æ¥µ¡¼¥Ó¥¹¥¹¥¯¥ê¥×¥È¤ò¸Æ¤Ó½Ð¤¹¡£ +̾Á°¤¬ \(aqS\(aq ¤Ç¤Ï¤¸¤Þ¤ë¥ê¥ó¥¯¤Ï "start" ¤È¤¤¤¦°ú¿ô¤ò¤Ä¤±¤Æ¸Æ¤Ó½Ð¤µ¤ì +(¤¹¤Ê¤ï¤Á¥µ¡¼¥Ó¥¹¤¬µ¯Æ°¤·)¡£Ì¾Á°¤¬ \(aqK\(aq ¤Ç¤Ï¤¸¤Þ¤ë¥ê¥ó¥¯¤Ï "stop" +¤È¤¤¤¦°ú¿ô¤ò¤Ä¤±¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë (¤¹¤Ê¤ï¤Á¥µ¡¼¥Ó¥¹¤¬Ää»ß¤¹¤ë)¡£ + +Ʊ¤¸¥é¥ó¥ì¥Ù¥ë¤ÎÆâÉô¤Ç¤Îµ¯Æ°¤äÄä»ß¤Î½ç½ø¤òµ¬Äꤹ¤ë¤¿¤á¤Ë¡¢ +¥ê¥ó¥¯¤Î̾Á°¤Ë¤Ï½ç½ø¤ò¼¨¤¹¿ô»ú¤¬´Þ¤Þ¤ì¤ë¡£ +¤Þ¤¿¡¢Ì¾Á°¤ò¤ï¤«¤ê¤ä¤¹¤¯¤¹¤ë¤¿¤á¡¢ +¥ê¥ó¥¯Ì¾¤ÎËöÈø¤Ë¤ÏÂбþ¤¹¤ë¥µ¡¼¥Ó¥¹¤Î̾Á°¤¬¤Ä¤±¤é¤ì¤ë¡£ +Î㤨¤Ð¡¢ +.I /etc/rc2.d/S80sendmail +¤È¤¤¤¦¥ê¥ó¥¯¤Ï¡¢sendmail ¥µ¡¼¥Ó¥¹¤ò¥é¥ó¥ì¥Ù¥ë 2 ¤Ë¤ª¤¤¤Æµ¯Æ°¤¹¤ë¡£ +¤³¤ì¤Ï¡¢ +.I /etc/rc2.d/S12syslog +¤è¤ê¤â¸å¤Ë¡¢¤Þ¤¿ +.I /etc/rc2.d/S90xfs +¤è¤ê¤âÀè¤Ë¼Â¹Ô¤µ¤ì¤ë¡£ + +¥Ö¡¼¥È¤Î½ç½ø¤È¥é¥ó¥ì¥Ù¥ë¤ò´ÉÍý¤¹¤ë¤Ë¤Ï¡¢ +¤³¤ì¤é¤Î¥ê¥ó¥¯¤ò´ÉÍý¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤·¤«¤·Â¿¤¯¤Î Linux ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +¤³¤ì¤é¤Îºî¶È¤ò¼ê½õ¤±¤·¤Æ¤¯¤ì¤ë¥Ä¡¼¥ë¤¬Â¸ºß¤¹¤ë +(Î㤨¤Ð +.BR chkconfig (8) +¤Ê¤É)¡£ +.SS ¥Ö¡¼¥È¤ÎÀßÄê +¥Ç¡¼¥â¥ó¤Îµ¯Æ°»þ¤Ë¤Ï¡¢ +¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤ä¥Ñ¥é¥á¡¼¥¿¤ò»ØÄê¤Ç¤­¤ë¤Î¤¬ÉáÄ̤Ǥ¢¤ë¡£ +¥·¥¹¥Æ¥à´ÉÍý¼Ô¤¬¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤òÊѹ¹¤·¤¿¤¤¤È»×¤Ã¤¿¤È¤­¤Ë¡¢ +¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤½¤Î¤â¤Î¤òÊÔ½¸¤·¤Ê¤¯¤Æ¤â¤¹¤à¤è¤¦¡¢ +ÀßÄê¥Õ¥¡¥¤¥ë¤¬ÍѤ¤¤é¤ì¤ë¡£¤³¤ì¤é¤ÏÆÃÄê¤Î¥Ç¥£¥ì¥¯¥È¥ê +(RedHat ¥·¥¹¥Æ¥à¤Ç¤Ï +.IR /etc/sysconfig ) +¤ËÃÖ¤«¤ì¡¢¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤«¤é»²¾È¤µ¤ì¤ë¡£ + +¸Å¤¤ Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï +¥Ç¡¼¥â¥ó¤ËÍ¿¤¨¤ë¼ÂºÝ¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤¬½ñ¤«¤ì¤Æ¤¤¤¿¡£ +¤·¤«¤·ºÇ¶á¤Î Linux ¥·¥¹¥Æ¥à (¤ä HP-UX) ¤Ç¤Ï¡¢ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ïñ¤Ë¥·¥§¥ëÊÑ¿ô¤¬½ñ¤«¤ì¤Æ¤¤¤ë¤À¤±¤Ç¤¢¤ë¡£ +.I /etc/init.d +¤ËÃÖ¤«¤ì¤¿¥Ö¡¼¥È¥¹¥¯¥ê¥×¥È¤Ï¡¢¤³¤ì¤é¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ò +.B source +¤·¡¢¤½¤ÎÊÑ¿ô¤ÎÃͤòÍѤ¤¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +.IR /etc/init.d/ , +.IR /etc/rc[S0\-6].d/ , +.I /etc/sysconfig/ +.SH ´ØÏ¢¹àÌÜ +.BR inittab (5), +.BR bootparam (7), +.BR init (8), +.BR runlevel (8), +.BR shutdown (8) diff --git a/release/man7/bootparam.7 b/release/man7/bootparam.7 new file mode 100644 index 00000000..90a7ab43 --- /dev/null +++ b/release/man7/bootparam.7 @@ -0,0 +1,1345 @@ +.\" Copyright (c) 1995,1997 Paul Gortmaker and Andries Brouwer +.\" +.\" 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 man page written 950814 by aeb, based on Paul Gortmaker's HOWTO +.\" (dated v1.0.1, 15/08/95). +.\" Major update, aeb, 970114. +.\" FIXME ? The use of quotes on this page is inconsistent with the +.\" rest of man-pages. +.\" +.\" Japanese Version Copyright (c) 1999 MATSUURA Masaaki +.\" all rights reserved. +.\" Translated 1999-02-04, MATSUURA Masaaki +.\" Modified 2001-07-08, Yuichi SATO +.\" Updated & Modified 2001-09-10, NAKANO Takeo +.\" Updated 2002-04-21, NAKANO Takeo +.\" Updated 2007-05-04, Akihiro MOTOKI , LDP v2.46 +.\" +.TH BOOTPARAM 7 2007-12-16 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +bootparam \- Linux ¥«¡¼¥Í¥ëµ¯Æ°»þ¥Ñ¥é¥á¡¼¥¿¤Î²òÀâ +.SH ÀâÌÀ +Linux ¥«¡¼¥Í¥ë¤Ïµ¯Æ°¤¹¤ë¤È¤­¤Ë¡Ö¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¡×¤¢¤ë¤¤¤Ï +¡Öµ¯Æ°»þ¥Ñ¥é¥á¡¼¥¿¡×¤ò¼õ¤±ÉÕ¤±¤ë¡£ +¤³¤ì¤Ï°ìÈ̤ˡ¢ +¥«¡¼¥Í¥ë¤Ë¤Ï·èÄê¤Ç¤­¤Ê¤¤¥Ï¡¼¥É¥¦¥§¥¢¤Î¥Ñ¥é¥á¡¼¥¿¤ò¥«¡¼¥Í¥ë¤ËÅϤ·¤¿¤¤¾ì¹ç¤ä¡¢ +¥«¡¼¥Í¥ë¤¬¸¡½Ð¤¹¤ë¤Ç¤¢¤í¤¦Ãͤò°Õ¿ÞŪ¤Ë̵¸ú¤Ë¤·¤¿¤êÊѹ¹¤·¤¿¤ê¤¹¤ë¾ì¹ç¤ËÍѤ¤¤ë¡£ + +¥«¡¼¥Í¥ë¤¬ BIOS ¤«¤éľÀܵ¯Æ°¤µ¤ì¤ë¤È¤­ +(¤¿¤È¤¨¤Ð 'cp zImage /dev/fd0' +¤Ç¥Õ¥í¥Ã¥Ô¡¼¤Ë¥³¥Ô¡¼¤·¤¿¥«¡¼¥Í¥ë¤«¤éµ¯Æ°¤¹¤ë¤Ê¤É) ¤Ï¡¢ +¥Ñ¥é¥á¡¼¥¿¤ò»ØÄꤹ¤ëµ¡²ñ¤Ï¤Ê¤¤¡£ +¤æ¤¨¤Ë¡¢¤³¤Îµ¯Æ°»þ¥Ñ¥é¥á¡¼¥¿µ¡Ç½¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.I LILO +¤ä +.I loadlin +¤Î¤è¤¦¤Ë¥Ñ¥é¥á¡¼¥¿¤ò»ØÄê¤Ç¤­¤ë¥½¥Õ¥È¥¦¥§¥¢¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤¤¤¯¤Ä¤«¤Î¥Ñ¥é¥á¡¼¥¿¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.I rdev +¤ò»È¤Ã¤Æ¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤½¤Î¤â¤Î¤ò½¤Àµ¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¾ÜºÙ¤Ï +.BR rdev (8) +¤ò»²¾È¤Î¤³¤È¡£ + +Werner Almesberger ¤Ë¤è¤ë +LILO (LInux LOader) ¥×¥í¥°¥é¥à¤ÏºÇ¤â¹­¤¯»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +LILO ¤Ï¤¤¤í¤¤¤í¤Ê¥«¡¼¥Í¥ë¤òÁªÂò¤·¤Æ¥Ö¡¼¥È¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¡¢ +ÀßÄê¾ðÊó¤ò¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤ËÊÝ»ý¤¹¤ë +.RB ( lilo (8) +¤È +.BR lilo.conf (5) +¤ò»²¾È)¡£ LILO ¤Ï DOS, OS/2, Linux, FreeBSD ¤Ê¤É¤òµ¯Æ°¤Ç¤­¡¢ +Èó¾ï¤Ë½ÀÆð¤Ç¤¢¤ë¡£ + +¤Û¤«¤Ë¤Ï +.I loadLin +¤â¤è¤¯»È¤ï¤ì¤Æ¤¤¤ë Linux ¥í¡¼¥À¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï DOS ¤Î¥×¥í¥°¥é¥à¤Ç¡¢DOS ¥×¥í¥ó¥×¥È¤«¤é +(µ¯Æ°»þ°ú¿ô¤È¤È¤â¤Ë) Linux ¥«¡¼¥Í¥ë¤òµ¯Æ°¤Ç¤­¤ë +(¤¤¤¯¤Ä¤«¤ÎÆÃÄê¤Î¥ê¥½¡¼¥¹¤¬ÍøÍѲÄǽ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ +loadlin ¤Ï DOS ¤«¤é Linux ¤òµ¯Æ°¤µ¤»¤¿¤¤¿Í¤Ë¤¢¤Ã¤Æ¤¤¤ë¡£ + +¤Þ¤¿ loadlin ¤Ï¡¢DOS ¤Î¥É¥é¥¤¥Ð¤Ç¤¢¤ë¾õÂÖ¤Ë +ÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¥Ï¡¼¥É¥¦¥§¥¢¤ò +»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤âÈó¾ï¤ËÊØÍø¤Ç¤¢¤ë¡£ +¤è¤¯¤¢¤ëÎã¤Ï +¡ÖSoundBlaster ¸ß´¹¡×¤Î¥µ¥¦¥ó¥É¥«¡¼¥É¤Ç¡¢ +¤³¤ì¤é¤ÎÃæ¤Ë¤Ï DOS ¤Î¥É¥é¥¤¥Ð¤ò»È¤Ã¤Æ +¤¤¤¯¤Ä¤«ÈëÌ©¤Î¥ì¥¸¥¹¥¿¤ò¤¤¤¸¤Ã¤Æ¤ä¤é¤Ê¤¤¤È¡¢ +ËÜÅö¤Î SB ¸ß´¹¥â¡¼¥É¤Ë¤Ï¤Ê¤é¤Ê¤¤¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ë¡£ +¤Þ¤º¥Ï¡¼¥É¥¦¥§¥¢¤Ë¤Ä¤¤¤Æ¤­¤¿¥É¥é¥¤¥Ð¤òÁȤ߹þ¤ó¤Ç DOS ¤òµ¯Æ°¤·¡¢ +¤½¤Î¸å loadlin ¤ò»ÈÍѤ·¤Æ Linux ¥«¡¼¥Í¥ë¤òÆɤ߹þ¤á¤Ð¡¢ +¥ê¥Ö¡¼¥È¤Ë¤è¤Ã¤Æ¥«¡¼¥É¤ÎÀßÄ꤬¥ê¥»¥Ã¥È¤µ¤ì¤ë¤Î¤òËɤ²¤ë¤ï¤±¤À¡£ +.SS °ú¿ô¥ê¥¹¥È +¥«¡¼¥Í¥ë¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ï¥¹¥Ú¡¼¥¹¤Ç¶èÀÚ¤é¤ì¤¿Ê¸»úÎó +.RI ( "µ¯Æ°»þ°ú¿ô: boot arguments" ) +¤Î¥ê¥¹¥È¤«¤éÀ®¤Ã¤Æ¤¤¤ë¡£¤Û¤È¤ó¤É¤Îµ¯Æ°»þ°ú¿ô¤Ï¼¡¤Î½ñ¼°¤Ë½¾¤¦¡£ +.IP +name[=value_1][,value_2]...[,value_10] +.LP +¤³¤³¤Ç 'name' ¤Ï¡¢¤½¤ì¤ËÂбþ¤¹¤ëÃͤ¬¥«¡¼¥Í¥ë¤Î¤É¤ÎÉôʬ¤ËÅϤµ¤ì¤ë¤â¤Î¤Ê¤Î¤«¤ò +¼±Ê̤¹¤ë¤¿¤á¤Î¡¢Â¾¤È½Å¤Ê¤é¤Ê¤¤¥­¡¼¥ï¡¼¥É¤Ç¤¢¤ë¡£ +½ñ¼°Ãæ¤Î 10 ¤È¤¤¤¦À©¸Â¤Ï¼ÂºÝ¤Ë¸ºß¤¹¤ë¡£ +¸½ºß¤Î¥³¡¼¥É¤Ï¡¢¥­¡¼¥ï¡¼¥É¤Ò¤È¤Ä¤¢¤¿¤ê¡¢¥³¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¤¿¥Ñ¥é¥á¡¼¥¿¤ò +10 ¸Ä¤Þ¤Ç¤·¤«¼è¤ê°·¤¦¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +(¤·¤«¤·¡¢»ö¾ð¤¬Èó¾ï¤ËÊ£»¨¤Ê¾ì¹ç¤Ë¤Ï¡¢Æ±¤¸¥­¡¼¥ï¡¼¥É¤òºÆÅÙÍøÍѤ·¤Æ +10 ¸Ä°Ê¾å¤Î¥Ñ¥é¥á¡¼¥¿¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +ÂоݤȤʤë¥Ï¡¼¥É¥¦¥§¥¢¤ÎÀßÄê´Ø¿ô¤¬¤½¤ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ì¤Ð¡¢¤À¤¬¡£) + +¥«¡¼¥Í¥ë¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î°·¤¤¤Ï¤Û¤È¤ó¤É linux/init/main.c ¤¬¹Ô¤Ê¤Ã¤Æ¤¤¤ë¡£ +½é¤á¤Ë¡¢¥«¡¼¥Í¥ë¤Ï +\&'root=', 'nfsroot=', 'nfsaddrs=', 'ro', 'rw', 'debug', 'init' +¤È¤¤¤Ã¤¿ÆÃÊ̤ʰú¿ô¤¬¤¢¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +¤³¤ì¤é¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò¤¹¤ë¡£ + +¥«¡¼¥Í¥ë¤Ï¼¡¤ËÀßÄê´Ø¿ô¤Î¥ê¥¹¥È +(ÇÛÎó bootsetups ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë) ¤ò¥¹¥­¥ã¥ó¤·¡¢ +»ØÄꤵ¤ì¤¿°ú¿ôʸ»úÎó (Î㤨¤Ð 'foo') ¤¬ +ÆÃÄê¤Î¥Ç¥Ð¥¤¥¹¤ä¥«¡¼¥Í¥ë¤Î°ìÉô¤ËÂФ¹¤ëÀßÄê´Ø¿ô +('foo_setup()') ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¤«¤òÄ´¤Ù¤ë¡£ +Î㤨¤Ð¥«¡¼¥Í¥ë¤Ë foo=3,4,5,6 ¤Î¤è¤¦¤Ê¥Ñ¥é¥á¡¼¥¿¤òÍ¿¤¨¤¿¤È¤¹¤ë¤È¡¢ +¥«¡¼¥Í¥ë¤ÏÇÛÎó bootsetups ¤òÄ´¤Ù¤Æ¡¢ 'foo' ¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤«Ä´¤Ù¤ë¡£ +ÅÐÏ¿¤µ¤ì¤Æ¤¤¤¿¤é¡¢'foo' ¤ËÂбþ¤¹¤ëÀßÄê´Ø¿ô ('foo_setup()') ¤ò¥³¡¼¥ë¤·¡¢ +¥«¡¼¥Í¥ë¥³¥Þ¥ó¥É¥é¥¤¥ó¤ËÍ¿¤¨¤é¤ì¤¿°ú¿ô¤Ç¤¢¤ë 3, 4, 5, 6 ¤òÀßÄê´Ø¿ô¤ËÅϤ¹¡£ + +\&'foo=bar' ¤È¤¤¤¦·Á¼°¤Î°ú¿ô¤Î¤¦¤Á¡¢ +¾åµ­¤Î¤è¤¦¤ËÀßÄê´Ø¿ô¤Ë¼õ¤±Æþ¤ì¤é¤ì¤Ê¤«¤Ã¤¿¤â¤Î¤Ï¡¢ +´Ä¶­ÊÑ¿ô¤È²ò¼á¤µ¤ì¤ÆÀßÄꤵ¤ì¤ë¡£ +(¤¢¤Þ¤êÌò¤ËΩ¤¿¤Ê¤¤?) Îã¤È¤·¤Æ¤Ï¡¢'TERM=VT100' ¤¬¤¢¤ë¡£ + +¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ½èÍý¤µ¤ì¤º¡¢´Ä¶­ÊÑ¿ô¤È¤·¤Æ¤â²ò¼á¤µ¤ì¤Ê¤«¤Ã¤¿ +»Ä¤ê¤Î°ú¿ô¤Ï¡¢¥×¥í¥»¥¹ 1 ¤ËÅϤµ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +Ä̾盧¤Î¥×¥í¥»¥¹ 1 ¤Ï +.I init +¥×¥í¥°¥é¥à¤Ç¤¢¤ë¡£ +¥×¥í¥»¥¹ 1 ¤ËÅϤµ¤ì¤ë°ú¿ô¤ÇºÇ¤âÎɤ¯»È¤ï¤ì¤ë¤Î¤Ï¡¢ +\&'single' ¤È¤¤¤¦¥­¡¼¥ï¡¼¥É¤Ç¤¢¤ë¡£ +¤³¤ì¤ò»ØÄꤹ¤ë¤È init ¤Ï¥·¥ó¥°¥ë¥æ¡¼¥¶¥â¡¼¥É¤Ç¥³¥ó¥Ô¥å¡¼¥¿¤òµ¯Æ°¤·¡¢ +Ä̾ï»È¤ï¤ì¤ë¥Ç¡¼¥â¥ó¤Ï°ìÀÚµ¯Æ°¤·¤Ê¤¤¡£ +¥·¥¹¥Æ¥à¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë init ¤¬ +¤É¤ó¤Ê°ú¿ô¤ò¼õ¤±ÉÕ¤±¤ë¤«¤Ï¡¢ +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÇÄ´¤Ù¤ë¤³¤È¡£ +.SS °ìÈÌŪ¤Ê¡¢¥Ç¥Ð¥¤¥¹¸ÇÍ­¤Ç¤Ï¤Ê¤¤µ¯Æ°»þ°ú¤­¿ô +.TP +.B "'init=...'" +¥«¡¼¥Í¥ë¤¬¼Â¹Ô¤¹¤ë½é´ü¥³¥Þ¥ó¥É¤òÀßÄꤹ¤ë¡£ +¤³¤Î»ØÄ꤬¤Ê¤µ¤ì¤Ê¤«¤Ã¤¿¤ê¡¢»ØÄꤷ¤¿¥³¥Þ¥ó¥É¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥«¡¼¥Í¥ë¤Ï +.IR /sbin/init , +.IR /etc/init , +.IR /bin/init , +.I /bin/sh +¤Î½ç¤Ç¼Â¹Ô¤ò»î¤ß¡¢¤¹¤Ù¤Æ¤Ë¼ºÇÔ¤·¤¿¤é panic ¤òµ¯¤³¤¹¡£ +.TP +.B "'nfsaddrs=...'" +nfs ¤Î¥Ö¡¼¥È¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤¿Ê¸»úÎó¤ËÀßÄꤹ¤ë¡£ +¤³¤Î¥Ö¡¼¥È¥¢¥É¥ì¥¹¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ö¡¼¥È¤Î¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¡£ +.TP +.B "'nfsroot=...'" +nfs ¥ë¡¼¥È¤Î̾Á°¤òÀßÄꤹ¤ë¡£ +¤³¤Îʸ»úÎó¤ÎÀèƬ¤¬ '/'¡¢','¡¢¿ô»ú¤Î¤¤¤º¤ì¤Ç¤â¤Ç¤Ê¤¤¤È¤­¤Ï¡¢ +\&'/tftpboot/' ¤¬ÀèƬ¤ËÉղ䵤ì¤ë¡£ +¤³¤Î̾Á°¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ö¡¼¥È¤Î¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¡£ +.TP +.B "'no387'" +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_BUGi386 +¤¬»ØÄꤵ¤ì¤¿¤È¤­¤Î¤ßÍ­¸ú¡£) +°ìÉô¤Î i387 ¥³¥×¥í¥»¥Ã¥µ¥Á¥Ã¥×¤Ë¤Ï¡¢ +32 ¥Ó¥Ã¥È¥×¥í¥Æ¥¯¥È¥â¡¼¥É¤Ç¤Î»ÈÍÑ»þ¤ËÀ¸¤¸¤ë¥Ð¥°¤¬¤¢¤ë¡£ +Î㤨¤Ð½é´ü¤Î ULSI-387 ¥Á¥Ã¥×¤Ï¡¢ +ÉâÆ°¾®¿ôÅÀ±é»»¤ò¹Ô¤Ê¤¦¤È³Î¼Â¤Ë¥í¥Ã¥¯¥¢¥Ã¥×¤·¤Æ¤·¤Þ¤¦¡£ +¤³¤Îµ¯Æ°»þ°ú¿ô 'no387' ¤ò»ØÄꤹ¤ë¤È¡¢ +Linux ¤Ï¥³¥×¥í¥»¥Ã¥µ¤¬¤¢¤Ã¤Æ¤â¤½¤ì¤ò̵»ë¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤Ê¤ª¤â¤Á¤í¤ó¡¢¥«¡¼¥Í¥ë¥³¥ó¥Ñ¥¤¥ë»þ¤ËÉâÆ°¾®¿ôÅÀ±é»»¤ò¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë +(kernel math emulation) »ØÄê¤ò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤! +.TP +.B "'no-hlt'" +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_BUGi386 +¤¬»ØÄꤵ¤ì¤¿¤È¤­¤Î¤ßÍ­¸ú¡£) +½é´ü¤Î i486DX-100 ¥Á¥Ã¥×¤Î°ìÉô¤Ç¤Ï 'hlt' Ì¿Îá¤ËÌäÂ꤬¤¢¤Ã¤Æ¡¢ +¤³¤ÎÌ¿Îá¤ò»È¤¦¤È¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥â¡¼¥É¤ËÀµ¤·¤¯Ìá¤Ã¤ÆÍè¤Ê¤¤¡£ +\&'no-hlt' ¤ò»ØÄꤹ¤ì¤Ð¡¢Linux ¤Ï¥¢¥¤¥É¥ê¥ó¥°»þ¤Ë CPU ¤òÄä»ß +(halt) ¤¹¤ë¤«¤ï¤ê¤Ë̵¸Â¥ë¡¼¥×¤ò¼Â¹Ô¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤³¤ì¤Ë¤è¤Ã¤Æ¡¢¤½¤Î¤è¤¦¤Ê¥Ð¥°¤Î¤¢¤ë¥Á¥Ã¥×¤Ç¤â Linux ¤ò»ÈÍѤǤ­¤ë¡£ +.TP +.B "'root=...'" +µ¯Æ°»þ¤Ë¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤·¤Æ»È¤ï¤ì¤ë¥Ç¥Ð¥¤¥¹¤ò¥«¡¼¥Í¥ë¤Ë»ØÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï¥³¥ó¥Ñ¥¤¥ë»þ¤Ë·èÄꤵ¤ì¡¢ +Ä̾ï¤Ï¥«¡¼¥Í¥ë¤ò¹½ÃÛ¤·¤¿¥·¥¹¥Æ¥à¤Î¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Ë¤Ê¤ë¡£ +¤³¤ÎÃͤò̵¸ú¤Ë¤·¤Æ¡¢ +Î㤨¤Ð 2 ÈÖÌܤΥեí¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ö¤ò¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Ë»ØÄꤹ¤ë¾ì¹ç¤Ï¡¢ +\&'root=/dev/fd1' ¤È¤¹¤ë¡£ +(¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Ï +.BR rdev (8) +¤òÍѤ¤¤Æ¤âÀßÄê¤Ç¤­¤ë¡£) + +¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤Î»ØÄê¤Ë¤Ï¥·¥ó¥Ü¥ë·Á¼°¤È¿ôÃÍ·Á¼°¤òÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥·¥ó¥Ü¥ë·Á¼°¤Î¾ì¹ç¤Ï /dev/XXYN ¤È¤¤¤¦½ñ¼°¤Ç»ØÄꤹ¤ë¡£ +XX ¤Ë¤Ï¥Ç¥Ð¥¤¥¹¥¿¥¤¥×¤ò»ØÄꤹ¤ë¡£ +Y ¤Ë¤Ï¥É¥é¥¤¥Ö¥ì¥¿¡¼¤â¤·¤¯¤Ï¥É¥é¥¤¥ÖÈֹ桢 +N ¤Ë¤Ï (¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯¤ò½ü¤¯) ¥Ç¥£¥¹¥¯¤Î +¥Ñ¡¼¥Æ¥£¥·¥ç¥óÈÖ¹æ¤ò 10 ¿Ê¿ô¤Î¿ôÃͤǻØÄꤹ¤ë¡£ +(ST-506 ¸ß´¹¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤Ç¤Ï¥Ç¥Ð¥¤¥¹¥¿¥¤¥×¤¬ 'hd' ¤Ç +Y ¤ÎÈÏ°Ï¤Ï 'a' ¤«¤é 'd'¡¢ +SCSI ¥Ç¥£¥¹¥¯¤Ï 'sd' ¤Ç Y ¤Ï 'a' ¤«¤é 'e'¡¢ +Atari ACSI ¥Ç¥£¥¹¥¯¤Ï 'ad' ¤Ç Y ¤Ï 'a' ¤«¤é 'e'¡¢ +Syquest EZ135 ¥Ñ¥é¥ì¥ë¥Ý¡¼¥È¥ê¥à¡¼¥Ð¥Ö¥ë¥Ç¥£¥¹¥¯¤Ï 'ez' ¤Ç Y ¤Ï 'a' ¤Î¤ß¡¢ +XT ¥Ç¥£¥¹¥¯¤Ï 'xt' ¤Ç Y ¤Ï 'a' ¤« 'b'¡¢ +¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯¤Ï 'fd' ¤Ç Y ¤Ë¤Ï¥É¥é¥¤¥ÖÈÖ¹æ¤ò»ØÄꤹ¤ë¡£ +fd0 ¤Ï DOS ¤Î 'A:'¡¢fd1 ¤Ï 'B:' ¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Ï¸ºß¤·¤Ê¤¤¤Î¤Ç N ¤Ï»ØÄꤷ¤Ê¤¤¡£) +ºÇ¿·¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢Â¾¤Ë¤â¼¡¤Î¤è¤¦¤Ê¿¤¯¤Î¥Ç¥Ð¥¤¥¹¥¿¥¤¥×¤ò»ØÄê¤Ç¤­¤ë +(¤Û¤È¤ó¤É¤Ï CD-ROM ¤À¤¬): +nfs, ram, scd, mcd, cdu535, aztcd, cm206cd, gscd, sbpcd, sonycd, bpcd¡£ +(nfs ¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ö¡¼¥È¤Ë¡¢ram ¤Ï RAM ¥Ç¥£¥¹¥¯¤ò»ÈÍѤ¹¤ë¾ì¹ç¤ËÍѤ¤¤ë¡£) + +¤Ê¤ª¡¢¤³¤ì¤é¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ç¤Î¥Ç¥Ð¥¤¥¹¤Î»ØÄêÊýË¡¤È¤ÏÁ´¤¯´Ø·¸¤Ê¤¤¡£ +\&'/dev/' ¤òÍѤ¤¤ë¤Î¤Ïñ¤Ë´·½¬¤Ë²á¤®¤Ê¤¤¡£ + +°·¤¤¤Ë¤¯¤¤¤·°Ü¿¢À­¤âÎɤ¯¤Ê¤¤¤¬¡¢ +¾åµ­¤Î¥Ç¥Ð¥¤¥¹¤ò major/minor ÈÖ¹æ¤Î¿ôÃͤǻØÄꤷ¤Æ¤â¤è¤¤¡£ +(Î㤨¤Ð /dev/sda3 ¤Ï major ÈÖ¹æ 8¡¢minor ÈÖ¹æ 3 ¤Ê¤Î¤Ç¡¢ +\&'root=0x803' ¤Èµ­½Ò¤Ç¤­¤ë¡£) +.TP +.B "'ro' ¤È 'rw'" +\&'ro' ¥ª¥×¥·¥ç¥ó¤Ï¡¢¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +¡ÖÆɤ߽Ф·ÀìÍѡפǥޥ¦¥ó¥È¤¹¤ë¤è¤¦¥«¡¼¥Í¥ë¤Ë»Ø¼¨¤·¡¢ +fsck ¥×¥í¥°¥é¥à¤¬¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÌ·½â¤ò¸¡ºº¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¡ÖÆɤ߽ñ¤­²Äǽ¡×¤È¤·¤ÆºÆ¥Þ¥¦¥ó¥È¤µ¤ì¤ë +(¤Ä¤Þ¤ê 'mount \-w \-n \-o remount /') ¤Þ¤Ç¤Î´Ö¤Ï¡¢ +¤¤¤«¤Ê¤ë¥×¥í¥»¥¹¤â¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.RB ( mount (8) +¤â»²¾È¤»¤è¡£) + +rw ¥ª¥×¥·¥ç¥ó¤Ï¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò +¡ÖÆɤ߽ñ¤­²Äǽ¡×¤Ç¥Þ¥¦¥ó¥È¤¹¤ë¤è¤¦¥«¡¼¥Í¥ë¤Ë»Ø¼¨¤¹¤ë¡£ +¤³¤Á¤é¤¬¥Ç¥Õ¥©¥ë¥È¤Ç¤¢¤ë¡£ + +¾Êά»þ¤Î»ØÄê¤ò¡ÖÆɤ߽Ф·ÀìÍÑ¡×¤È +¡ÖÆɤ߽ñ¤­²Äǽ¡×¤È¤Î¤É¤Á¤é¤Ë¤¹¤ë¤«¤Ï¡¢ +.BR rdev (8) +¤Ë¤è¤Ã¤Æ¤âÀßÄê¤Ç¤­¤ë¡£ +.TP +.B "'reserve=...'" +¥Ç¥Ð¥¤¥¹¤Î¼«Æ°¸¡½Ð¤«¤é I/O ¥Ý¡¼¥È¤òÊݸ¤ë¤¿¤á¤ËÍѤ¤¤ë¡£ +¥³¥Þ¥ó¥É¤Î·Á¼°¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +.BI reserve= iobase,extent[,iobase,extent]... +.sp +µ¡¼ï¤Ë¤è¤Ã¤Æ¤Ï¡¢ +¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ë¤è¤ë¥Ç¥Ð¥¤¥¹¤Î¼«Æ°¸¡½Ð¤ò¡¢ +ÆÃÄê¤ÎÈϰϤËÂФ·¤Æ¤Ï¶Ø»ß¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤¬¤¢¤ë¡£ +¥Ï¡¼¥É¥¦¥§¥¢¤¬¸¡½ÐÆ°ºî¤Ë¤è¤Ã¤Æ¿¼¹ï¤ÊÌäÂê¤ò°ú¤­µ¯¤³¤¹¾ì¹ç¤ä¡¢ +¸íǧ¼±¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¾ì¹ç¡¢ +¤Þ¤¿Ã±¤Ë¥«¡¼¥Í¥ë¤Ë¥Ï¡¼¥É¥¦¥§¥¢¤ò½é´ü²½¤µ¤»¤¿¤¯¤Ê¤¤¾ì¹ç¤Ê¤É¤¬¤¢¤ê¤¦¤ë¤À¤í¤¦¡£ + +¤³¤Îµ¯Æ°»þ°ú¿ô reserve ¤Ï¡¢¼«Æ°¸¡½Ð¤ÎÂоݳ°¤È¤¹¤ë I/O ¥Ý¡¼¥È¤ÎÈϰϤò»ØÄꤹ¤ë¡£ +¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ï¡¢ +¾¤Îµ¯Æ°»þ°ú¿ô¤Ë¤è¤Ã¤ÆÌÀ¼¨Åª¤Ë»ØÄꤵ¤ì¤Ê¤¤¸Â¤ê¡¢ +ͽÌ󤵤줿ÈϰϤËÂФ·¤Æ¼«Æ°¸¡½ÐÆ°ºî¤ò¹Ô¤ï¤Ê¤¤¡£ + +Î㤨¤Ð¥Ö¡¼¥È»þ¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë +.IP +reserve=0x300,32 blah=0x300 +.IP +¤È»ØÄꤹ¤ë¤È¡¢'blah' ¤ò½ü¤¯¤¹¤Ù¤Æ¤Î¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ï +0x300 ¤«¤é 0x31f ¤ÎÈϰϤò¼«Æ°¸¡½Ð¤ÎÂоݳ°¤È¤¹¤ë¡£ +.TP +.B "'mem=...'" +ÅëºÜ¤µ¤ì¤Æ¤¤¤ë¥á¥â¥ê¤ÎÎ̤òÊÖ¤¹ BIOS ¥³¡¼¥ë¤Ï +PC ¤Î»ÅÍͤÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¤³¤ì¤ÏºÇÂç 64MB ¤Þ¤Ç¤·¤«ÊÖ¤¹¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +Linux ¤ÏÅëºÜ¥á¥â¥ê¤ÎÎ̤òÄ´¤Ù¤ë¤¿¤á¤Ë¡¢ +µ¯Æ°»þ¤Ë¤³¤Î BIOS ¥³¡¼¥ë¤ò»ÈÍѤ¹¤ë¡£ +¤â¤· 64MB °Ê¾å¤Î RAM ¤òÅëºÜ¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¤³¤Îµ¯Æ°»þ°ú¿ô¤òÍѤ¤¤Æ +¼ÂºÝ¤Î¥á¥â¥êÍÆÎ̤ò Linux ¤ËÃΤ餻¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +ÃÍ¤Ï 10 ¿Ê¿ô¤Þ¤¿¤Ï 16 ¿Ê¿ô (ÀèƬ¤Ë 0x ¤òÉÕ²Ã) ¤Î¿ôÃͤǻØÄꤷ¡¢ +1024 Çܤòɽ¤¹ 'k' ¤Þ¤¿¤Ï 1048576 Çܤòɽ¤¹ 'M' +¤òËöÈø¤ËÉղäǤ­¤ë¡£ +°Ê²¼¤Ï Linus ¤Ë¤è¤ë 'mem=' ¥Ñ¥é¥á¡¼¥¿¤Î²òÀâ¤Ç¤¢¤ë¡£ + +.in +0.5i +¥«¡¼¥Í¥ë¤Ï 'mem=xx' ¥Ñ¥é¥á¡¼¥¿¤È¤·¤Æ +¤É¤ó¤ÊÃͤò»ØÄꤷ¤Æ¤â¤½¤ì¤ò¤½¤Î¤Þ¤Þ¼õ¤±Æþ¤ì¤ë¡£ +¤À¤«¤é¤½¤ì¤¬±³¤À¤È¤ï¤«¤Ã¤¿¤é¡¢ +ÃÙ¤«¤ìÁᤫ¤ì¤Ò¤É¤¤¥¯¥é¥Ã¥·¥å¤ò¤¹¤ë¤À¤í¤¦¡£ +¥Ñ¥é¥á¡¼¥¿¤Ï¥¢¥¯¥»¥¹¤·¤¦¤ëºÇ¤â¹â°Ì¤Î RAM ¥¢¥É¥ì¥¹¤ò»Ø¼¨¤¹¤ë¡£ +¤À¤«¤éÎ㤨¤Ð 'mem=0x1000000' ¤Ã¤Æ¤¤¤¦¤Î¤Ï +16MB ¤Î¥á¥â¥ê¤¬¤¢¤ë¡¢¤È¤¤¤¦°ÕÌ£¤Ë¤Ê¤ë¡£ +96MB ¤Î¥Þ¥·¥ó¤Ê¤é 'mem=0x6000000' ¤À¡£ + +.BR "Ãí°Õ Ãí°Õ Ãí°Õ" : +¥Þ¥·¥ó¤Ë¤è¤Ã¤Æ¤Ï¥á¥â¥ê¤ÎºÇ¾å°Ì¤ÎÎΰè¤ò BIOS ¤Î¥­¥ã¥Ã¥·¥å¤ä¤é²¿¤ä¤é¤Î +¤¿¤á¤Ë»È¤Ã¤Æ¤¤¤ë¤³¤È¤¬¤¢¤ë¤«¤é¡¢ +¼ÂºÝ¤Ë¤Ï 96MB ¤ò¥Õ¥ë¤Ë¥¢¥É¥ì¥¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +µÕ¤Î¾ì¹ç¤â¤¢¤ë¡£ +¤¤¤¯¤Ä¤«¤Î¥Á¥Ã¥×¥»¥Ã¥È¤Ç¤Ï¡¢ +BIOS Îΰè¤ËÆþ¤Ã¤Æ¤¤¤ëʪÍý¥á¥â¥ê¤òºÇ¾å°Ì¤Î¥á¥â¥ê¤Î¤µ¤é¤Ë¾å¤Ë¥Þ¥Ã¥×¤¹¤ë¡£ +¤è¤Ã¤ÆºÇ¾å°Ì¤Î¥á¥â¥ê¤Ï¤¿¤È¤¨¤Ð 96MB + 384kB ¤Ê¤ó¤ÆÃͤˤʤ뤫¤â¤·¤ì¤Ê¤¤¡£ +linux ¤Ë¼ÂºÝ¤è¤ê¿¤¤¥á¥â¥ê¤ò¶µ¤¨¤Æ¤·¤Þ¤Ã¤¿¤È¤·¤¿¤é¡¢ +¤Þ¤º¤¤¤³¤È¤¬µ¯¤­¤ë¤À¤í¤¦¡£ +¤¹¤°¤Ë¤Ç¤Ï¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¤±¤É¡¢¤æ¤¯¤æ¤¯¤Ï³Î¼Â¤Ë¤Í¡£ +.in + +¤Þ¤¿¡¢µ¯Æ°»þ°ú¿ô¤Ë 'mem=nopentium' ¤ò»ØÄꤹ¤ë¤È¡¢ +pentium ¤È¤½¤ì°Ê¹ß¤Î CPU ¤ò»È¤Ã¤¿ IA32 ¥·¥¹¥Æ¥àÍѤËÀßÄꤵ¤ì¤¿¥«¡¼¥Í¥ë¤Ç +4MB ¤Î¥Ú¡¼¥¸¥Æ¡¼¥Ö¥ë¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B "'panic=N'" +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤Ï¥Ñ¥Ë¥Ã¥¯¤Î¸å¥ê¥Ö¡¼¥È¤·¤Ê¤¤¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤Æ (N ¤ò 0 ¤è¤êÂ礭¤ÊÃͤȤ¹¤ì¤Ð) +N Éøå¤Ë¥ê¥Ö¡¼¥È¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤³¤ÎÃͤϡ¢µ¯Æ°¸å¤Ë "echo N > /proc/sys/kernel/panic" +¤È¤·¤ÆÀßÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.TP +.B "'reboot=[warm|cold][,[bios|hard]]'" +(¥«¡¼¥Í¥ë¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_BUGi386 +¤¬»ØÄꤵ¤ì¤¿¤È¤­¤Î¤ßÍ­¸ú¡£) +¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó 2.0.22 ¤«¤é¡¢ +¥ê¥Ö¡¼¥È¤Î¥Ç¥Õ¥©¥ë¥È¤Ï¥³¡¼¥ë¥É¥Ö¡¼¥È¤Ë¤Ê¤Ã¤¿¡£ +°ÊÁ°¤Î¥Ç¥Õ¥©¥ë¥È¤Ç¤¢¤ë¥¦¥©¡¼¥à¥Ö¡¼¥È¤ò¤¹¤ë¤Ë¤Ï +\&'reboot=warm' ¤È»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +(¤¢¤ë¼ï¤Î¥Ï¡¼¥É¥¦¥§¥¢¤ò¥ê¥»¥Ã¥È¤¹¤ë¤Ë¤Ï¥³¡¼¥ë¥É¥Ö¡¼¥È¤¬É¬Íפˤʤ뤬¡¢ +¥Ç¥£¥¹¥¯¥­¥ã¥Ã¥·¥å¤Ë¤¢¤ë½ñ¤­¹þ¤ó¤Ç¤¤¤Ê¤¤¥Ç¡¼¥¿¤ÏÇ˲õ¤µ¤ì¤ë¡£ +¥¦¥©¡¼¥à¥Ö¡¼¥È¤Ç¤Ï¡¢¤è¤êÁÇÁ᤯¥ê¥Ö¡¼¥È¤Ç¤­¤ë¡£) +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥ê¥Ö¡¼¥È¤Ï 'hard' ¤Ç¹Ô¤ï¤ì¤ë¡£ +¤¹¤Ê¤ï¤Á¥ê¥»¥Ã¥È¥é¥¤¥ó¤Ë low ¤ò½ÐÎϤ¹¤ë¤è¤¦¥­¡¼¥Ü¡¼¥É¥³¥ó¥È¥í¡¼¥é¤ËÍ׵ᤷ¤Æ¡¢ +¥ê¥Ö¡¼¥È¤ò¹Ô¤¦¡£ +¤·¤«¤·°ìÉô¤Î¥Þ¥¶¡¼¥Ü¡¼¥É¤Ç¤Ï¤³¤ì¤¬¤Ç¤­¤Ê¤¤¡£ +\&'reboot=bios' ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢ +Âå¤ï¤ê¤Ë BIOS ¤ò·Ðͳ¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.TP +.B "'nosmp'" ¤È "'maxcpus=N'" +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë __SMP__ ¤¬»ØÄꤵ¤ì¤¿¤È¤­¤Î¤ßÍ­¸ú¡£) +¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤Ë 'nosmp' ¤Þ¤¿¤Ï 'maxcpus=0' ¤ò»ØÄꤹ¤ë¤È¡¢ +SMP (Symmetric Multi Processing) ¤ò´°Á´¤Ë̵¸ú¤Ë¤¹¤ë¡£ +\&'maxcpus=N' ¥ª¥×¥·¥ç¥ó¤Ï¡¢ +SMP ¥â¡¼¥É¤ÇÍ­¸ú¤Ë¤¹¤ë CPU ¤ÎºÇÂç¿ô¤ò N ¤ËÀ©¸Â¤¹¤ë¡£ +.SS ¥«¡¼¥Í¥ë³«È¯¼ÔÍѤε¯Æ°»þ°ú¿ô +.TP +.B "'debug'" +¥«¡¼¥Í¥ë¤¬½ÐÎϤ¹¤ë¥á¥Ã¥»¡¼¥¸¤Ï¥«¡¼¥Í¥ë¥í¥°¥Ç¡¼¥â¥ó klogd ¤ËÅϤµ¤ì¡¢ +¥Ç¥£¥¹¥¯¤Ëµ­Ï¿¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¥×¥é¥¤¥ª¥ê¥Æ¥£¤¬ +.I console_loglevel +¤Î¥á¥Ã¥»¡¼¥¸¤Ï¥³¥ó¥½¡¼¥ë¤Ë¤âɽ¼¨¤µ¤ì¤ë¡£ +(¤³¤ì¤é¤Î¥ì¥Ù¥ë¤Ë¤Ä¤¤¤Æ¤Ï¡¢\fI\fP ¤ò»²¾È¡£) +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¤³¤ÎÊÑ¿ô¤Ï¡¢ +¥Ç¥Ð¥Ã¥°¥á¥Ã¥»¡¼¥¸¤è¤ê¤â½ÅÍפʤ¢¤é¤æ¤ë¥á¥Ã¥»¡¼¥¸¤òµ­Ï¿¤¹¤ë¤è¤¦ÀßÄꤵ¤ì¤Æ¤¤¤ë +(¥Ç¥Ð¥Ã¥°¥á¥Ã¥»¡¼¥¸¤Ï´Þ¤Þ¤Ê¤¤)¡£ +¤³¤Îµ¯Æ°»þ°ú¿ô¤ò»ØÄꤹ¤ë¤È¡¢ +¥«¡¼¥Í¥ë¤Ï¥×¥é¥¤¥ª¥ê¥Æ¥£¤¬ DEBUG ¤Î¥á¥Ã¥»¡¼¥¸¤â½ÐÎϤ¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.I console_loglevel +¤â klogd ¤Ë¥ª¥×¥·¥ç¥ó¤òÅϤ»¤Ð¼Â¹Ô»þ¤ËÀßÄê¤Ç¤­¤ë¡£ +.BR klogd (8) +¤ò¸«¤è¡£ +.TP +.B "'profile=N'" +¥«¡¼¥Í¥ë¤¬¤É¤³¤Ç CPU ¥µ¥¤¥¯¥ë¤ò¾ÃÈñ¤·¤Æ¤¤¤ë¤«Ä´¤Ù¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +¥«¡¼¥Í¥ë¤Î¥×¥í¥Õ¥¡¥¤¥ê¥ó¥°µ¡Ç½¤òÍ­¸ú¤Ë¤¹¤ì¤Ð¤³¤ì¤ò¼Â¸½¤Ç¤­¤ë¡£ +¥«¡¼¥Í¥ë¥×¥í¥Õ¥¡¥¤¥ê¥ó¥°¤Ï¡¢ÊÑ¿ô +.I prof_shift +¤ò 0 °Ê³°¤ÎÃͤ˥»¥Ã¥È¤¹¤ë¤ÈÍ­¸ú¤Ë¤Ê¤ë¡£ +¤³¤ÎÃͤϥ³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_PROFILE +¤Ç»ØÄꤹ¤ë¤«¡¢ +¤³¤Î 'prifile=N' ¥ª¥×¥·¥ç¥ó¤Ç»ØÄê¤Ç¤­¤ë¡£ +.I prof_shift +¤ÎÃÍ¤Ï N ¤¬»ØÄꤵ¤ì¤ì¤Ð N ¤È¤Ê¤ê¡¢N ¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï +.B CONFIG_PROFILE_SHIFT +¤ÎÃͤ¬ÍѤ¤¤é¤ì¤ë¡£ +¤É¤Á¤é¤â»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¥Ç¥Õ¥©¥ë¥ÈÃͤΠ2 ¤¬ÍѤ¤¤é¤ì¤ë¡£ +¤³¤ÎÊÑ¿ô¤¬½ÅÍפʤΤϡ¢ +¥«¡¼¥Í¥ë¥×¥í¥Õ¥¡¥¤¥ê¥ó¥°¤ÎγÅÙ¤ò·èÄꤹ¤ë¤È¤³¤í¤Ë¤¢¤ë¡£ +¤¹¤Ê¤ï¤Á¡¢³Æ¥¯¥í¥Ã¥¯¤Î³ä¹þ¤ß¤´¤È¤Ë¡¢¥·¥¹¥Æ¥à¤¬¥«¡¼¥Í¥ë¥³¡¼¥É¤ò¼Â¹Ô¤·¤Æ¤¤¤ì¤Ð¡¢ +°Ê²¼¤Î¤è¤¦¤Ë¥«¥¦¥ó¥¿¤ÎÃͤ¬¥¤¥ó¥¯¥ê¥á¥ó¥È¤µ¤ì¤ë¡£ +.IP +profile[address >> prof_shift]++; +.sp +À¸¤Î¥×¥í¥Õ¥¡¥¤¥ê¥ó¥°¾ðÊó¤Ï¡¢ +.I /proc/profile +¤«¤é¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¤¬¡¢readprofile.c +¤Î¤è¤¦¤Ê¾ðÊó¤ò²Ã¹©¤¹¤ë¥Ä¡¼¥ë¤ò»È¤Ã¤¿¤Û¤¦¤¬Îɤ¤¤À¤í¤¦¡£ +.I /proc/profile +¤ËǤ°Õ¤Î¥Ç¡¼¥¿¤ò½ñ¹þ¤à¤È¡¢ +¥«¥¦¥ó¥¿¤Ï¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +.TP +.B "'swap=N1,N2,N3,N4,N5,N6,N7,N8'" +¥«¡¼¥Í¥ë¤Î¥¹¥ï¥Ã¥×¥¢¥ë¥´¥ê¥º¥à¤ò¥³¥ó¥È¥í¡¼¥ë¤¹¤ë +¼¡¤Î 8 ¤Ä¤Î¥Ñ¥é¥á¡¼¥¿¤ò¥»¥Ã¥È¤¹¤ë¡£ +max_page_age, page_advance, +page_decline, page_initial_age, age_cluster_fract, +age_cluster_min, pageout_weight, bufferout_weight. +¤³¤ì¤Ï¥«¡¼¥Í¥ë¤ò¥Á¥å¡¼¥ó¤¹¤ë¿Í¤Î¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +.TP +.B "'buff=N1,N2,N3,N4,N5,N6'" +¥«¡¼¥Í¥ë¤Î¥Ð¥Ã¥Õ¥¡¥á¥â¥ê´ÉÍý¤ò¥³¥ó¥È¥í¡¼¥ë¤¹¤ë +¼¡¤Î 6 ¤Ä¤Î¥Ñ¥é¥á¡¼¥¿¤ò¥»¥Ã¥È¤¹¤ë¡£ +max_buff_age, buff_advance, +buff_decline, buff_initial_age, bufferout_weight, +buffermem_grace. +¤³¤ì¤Ï¥«¡¼¥Í¥ë¤ò¥Á¥å¡¼¥ó¤¹¤ë¿Í¤Î¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +.SS "RAM ¥Ç¥£¥¹¥¯´ØÏ¢¤Îµ¯Æ°»þ°ú¿ô" +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_BLK_DEV_RAM +¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤¿¤È¤­¤Î¤ßÍ­¸ú¡£) +°ìÈÌŪ¤Ë¤Ï¡¢Linux ¤Ç RAM ¥Ç¥£¥¹¥¯¤ò»ÈÍѤ¹¤ë¤Î¤Ï¤¢¤Þ¤êÎɤ¤¹Í¤¨¤Ç¤Ï¤Ê¤¤¡£ +¥·¥¹¥Æ¥à¤ËǤ¤»¤Æ¤ª¤±¤Ð¤â¤Ã¤È¸úΨŪ¤Ë¥á¥â¥ê¤ò»ÈÍѤ¹¤ë¡£ +¤·¤«¤·¥Ö¡¼¥È»þ (¤Þ¤¿¤Ï¥Ö¡¼¥È¥Õ¥í¥Ã¥Ô¡¼¤ÎºîÀ®Ãæ) ¤Ë¤Ï¡¢ +¥Õ¥í¥Ã¥Ô¡¼¤ÎÆâÍƤò RAM ¥Ç¥£¥¹¥¯¤Ë¥í¡¼¥É¤¹¤ë¤ÈÊØÍø¤«¤â¤·¤ì¤Ê¤¤¡£ +¥á¥¤¥ó¥Ç¥£¥¹¥¯¤¬¥¢¥¯¥»¥¹²Äǽ¤Ë¤Ê¤ëÁ°¤Ë¡¢ +(¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ä¥Ï¡¼¥É¥¦¥§¥¢¤Ë´Ø¤¹¤ë) +¥â¥¸¥å¡¼¥ë¤ò¤¤¤¯¤Ä¤«¥í¡¼¥É¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¥·¥¹¥Æ¥à¤â¤¢¤ë¤À¤í¤¦¡£ + +Linux ¤Î¥Ð¡¼¥¸¥ç¥ó 1.3.48 ¤Ë¤ª¤¤¤Æ¡¢ +RAM ¥Ç¥£¥¹¥¯¤Î¼è¤ê°·¤¤¤¬º¬Ä줫¤éÊѲ½¤·¤¿¡£ +¤½¤ì°ÊÁ°¤Þ¤Ç¤Ï¡¢¥á¥â¥ê¤ÏÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¡¢ +\&'ramdisk=N' ¥Ñ¥é¥á¡¼¥¿¤Ç¤½¤Î¥µ¥¤¥º¤ò»ØÄꤷ¤Æ¤¤¤¿¡£ +(¤³¤ÎÃͤϥ«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤ä +.BR rdev (8) +¤Ë¤è¤Ã¤Æ¤âÊѹ¹¤Ç¤­¤¿¡£) +¸½ºß¤Ï RAM ¥Ç¥£¥¹¥¯¤Ï¥Ð¥Ã¥Õ¥¡¥­¥ã¥Ã¥·¥å¤ò»ÈÍѤ·¤Æ¤ª¤ê¡¢ +ưŪ¤ËÀ®Ä¹¤¹¤ë¡£ +¤µ¤é¤Ë¿¤¯¤Î¾ðÊó (¤¿¤È¤¨¤Ð +.BR rdev (8) +¤¬¿·¤·¤¤ RAM ¥Ç¥£¥¹¥¯¤ÎÀßÄê¤È¤É¤Î¤è¤¦¤Ë´Ø·¸¤¹¤ë¤«) ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.I /usr/src/linux/Documentation/ramdisk.txt +¤ò»²¾È¡£ + +4 ¤Ä¤Î¥Ñ¥é¥á¡¼¥¿¤¬¤¢¤ë¡£ÏÀÍýÃͤò¤È¤ë¤â¤Î¤¬ 2 ¤Ä¡¢À°¿ôÃͤò¤È¤ë¤â¤Î¤¬ 2 ¤Ä¡£ +.TP +.B "'load_ramdisk=N'" +N=1 ¤Ê¤é RAM ¥Ç¥£¥¹¥¯¤ò¥í¡¼¥É¤¹¤ë¡£N=0 ¤Ê¤é¥í¡¼¥É¤·¤Ê¤¤ (¥Ç¥Õ¥©¥ë¥È)¡£ +.TP +.B "'prompt_ramdisk=N'" +N=1 ¤Ê¤é¥Õ¥í¥Ã¥Ô¡¼ÁÞÆþ¤òÂ¥¤¹¥×¥í¥ó¥×¥È¤ò½Ð¤¹ (¥Ç¥Õ¥©¥ë¥È)¡£ +N=0 ¤Ê¤é¥×¥í¥ó¥×¥È¤ò½Ð¤µ¤Ê¤¤¡£ +(½¾¤Ã¤Æ¡¢¤³¤Î¥Ñ¥é¥á¡¼¥¿¤ò»ØÄꤹ¤ëɬÍפϤޤºÌµ¤¤¤Ç¤¢¤í¤¦¡£) +.TP +.BR 'ramdisk_size=N' " ¤â¤·¤¯¤Ï (¸Å¤¤·Á¼°¤Î) " 'ramdisk=N' +¥é¥à¥Ç¥£¥¹¥¯¤ÎºÇÂ祵¥¤¥º¤ò N kB (¥­¥í¥Ð¥¤¥È) ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +¾Êά»þ¤Ï 4096 (4 MB)¡£ +.TP +.B "'ramdisk_start=N'" +³«»Ï¥Ö¥í¥Ã¥¯ÈÖ¹æ +(¥Õ¥í¥Ã¥Ô¡¼ÀèƬ¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤Ç»ØÄꤷ¤¿ RAM ¥Ç¥£¥¹¥¯¤Î³«»ÏÅÀ) +¤ò N ¤Ë¥»¥Ã¥È¤¹¤ë¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ë¥¤¥á¡¼¥¸¤Î¤¢¤È¤Ë RAM ¥Ç¥£¥¹¥¯¥¤¥á¡¼¥¸¤òÃÖ¤¯¾ì¹ç¤ËɬÍפȤʤ롣 +.TP +.B "'noinitrd'" +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_BLK_DEV_RAM +¤È +.B CONFIG_BLK_DEV_INITRD +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¤­¤Î¤ßÍ­¸ú¡£) +ºÇ¶á¤Ï initrd ¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¥«¡¼¥Í¥ë¤ò¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤ë¤È¡¢ +¥Ö¡¼¥È¥×¥í¥»¥¹¤Ï¥«¡¼¥Í¥ë¤È RAM ¥Ç¥£¥¹¥¯¤ò¥í¡¼¥É¤·¡¢ +¥«¡¼¥Í¥ë¤Ï initrd ¤ò¡ÖÉáÄÌ¤Î¡× RAM ¥Ç¥£¥¹¥¯¤ËÊÑ´¹¤·¡¢ +¤³¤Î RAM ¥Ç¥£¥¹¥¯¤¬¥ë¡¼¥È¥Ç¥Ð¥¤¥¹¤È¤·¤Æ¡ÖÆɤ߽ñ¤­²Äǽ¡×¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +¼¡¤Ë /linuxrc ¤¬¼Â¹Ô¤µ¤ì¤ë¡£ +¤½¤Î¸å¡Ö¿¿¤Î¡×¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Þ¥¦¥ó¥È¤µ¤ì¡¢ +initrd ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï /initrd ¤Ë°Ü¤µ¤ì¤ë¡£ +ºÇ¸å¤ËÄ̾ï¤Î¥Ö¡¼¥È¥·¡¼¥±¥ó¥¹ (¶ñÂÎŪ¤Ë¤Ï /sbin/init ¤Î¸Æ¤Ó½Ð¤·) ¤¬¼Â¹Ô¤µ¤ì¤ë¡£ + +initrd ¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ê²òÀâ¤Ï +.I /usr/src/linux/Documentation/initrd.txt +¤ò»²¾È¡£ + +\&'noinitrd' ¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È¡¢ +¥«¡¼¥Í¥ë¤Ï (initrd Æ°ºî¤ò¹Ô¤¦¤è¤¦¤Ë¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ç¤â) +¾åµ­¤ÎÆ°ºî¤ò¹Ô¤Ê¤ï¤º¡¢Âå¤ï¤ê¤Ë initrd ¤Î¥Ç¡¼¥¿¤ò +.I /dev/initrd +¤Ë»Ä¤¹¡£ +(¤³¤Î¥Ç¥Ð¥¤¥¹¤Ï°ìÅÙ¤·¤«»È¤¨¤Ê¤¤¡£ +¥Ç¡¼¥¿¤Ï¡¢¤½¤Î¥Ç¡¼¥¿¤ò»È¤Ã¤¿ºÇ¸å¤Î¥×¥í¥»¥¹¤¬ +.I /dev/initrd +¤ò¥¯¥í¡¼¥º¤¹¤ë¤È¤¹¤°¤Ë²òÊü¤µ¤ì¤ë¡£) +.SS "SCSI ¥Ç¥Ð¥¤¥¹ÍѤε¯Æ°»þ°ú¿ô" +¤³¤ÎÀá¤Ë¤ª¤±¤ëÍѸ졧 + +.I iobase +-- SCSI ¥Û¥¹¥È¥¢¥À¥×¥¿¤¬ÀêÍ­¤¹¤ë I/O ¥Ý¡¼¥È¤ÎÀèƬ¥¢¥É¥ì¥¹¡£ +16 ¿Êɽµ­¤Ç»ØÄꤷ¡¢Ä̾ï 0x200 ¤«¤é 0x3ff ¤ÎÈϰϤ˰ÌÃÖ¤¹¤ë¡£ + +.I irq +-- ¥«¡¼¥É¤¬ÍøÍѤ¹¤ë¥Ï¡¼¥É¥¦¥§¥¢³ä¤ê¹þ¤ß¡£Í­¸ú¤ÊÃͤϥ«¡¼¥É¤Ë +¤è¤Ã¤Æ°Û¤Ê¤ë¤¬¡¢Ä̾ï¤Ï 5, 7, 9, 10, 11, 12, 15 ¤Ç¤¢¤ë¡£ +¤³¤ì°Ê³°¤ÎÃͤÏÄ̾IDE ¥Ï¡¼¥É¥Ç¥£¥¹¥¯¡¢¥Õ¥í¥Ã¥Ô¡¼¡¢ +¥·¥ê¥¢¥ë¥Ý¡¼¥È¤È¤¤¤Ã¤¿°ìÈÌŪ¤Ê¼þÊÕµ¡´ï¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¡£ + +.I scsi-id +-- SCSI ¥Ð¥¹¾å¤Î¥Û¥¹¥È¥¢¥À¥×¥¿¤¬¼«Ê¬¼«¿È¤ò¼±Ê̤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë ID Èֹ档 +¤³¤ÎÃͤòÊѹ¹¤Ç¤­¤ë¥Û¥¹¥È¥¢¥À¥×¥¿¤â¤´¤¯´õ¤Ë¸ºß¤¹¤ë¤¬¡¢ +¤Û¤È¤ó¤É¤Ï¥¢¥À¥×¥¿ÆâÉô¤Ç¸ÇÄꤵ¤ì¤Æ¤¤¤ë¡£ +¤è¤¯»È¤ï¤ì¤ë¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 7 ¤Ç¤¢¤ë¤¬¡¢Seagate ¤â¤·¤¯¤Ï +Future Domain À½¤Î TMC-950 ¥Ü¡¼¥É¤Ç¤Ï 6 ¤¬»È¤ï¤ì¤ë¡£ + +.I parity +-- SCSI ¥Û¥¹¥È¥¢¥À¥×¥¿¤¬¼è¤êÉÕ¤±¤é¤ì¤¿¥Ç¥Ð¥¤¥¹¤È¤ÎÄÌ¿®¤ËºÝ¤·¤Æ +¥Ñ¥ê¥Æ¥£ÃͤòɬÍפȤ¹¤ë¤«¤É¤¦¤«¡£ +1 ¤ò»ØÄꤹ¤ë¤È¥Ñ¥ê¥Æ¥£¥Á¥§¥Ã¥¯¤¬Í­¸ú¤Ë¤Ê¤ê¡¢ +0 ¤Ç¥Ñ¥ê¥Æ¥£¥Á¥§¥Ã¥¯¤¬Ìµ¸ú¤Ë¤Ê¤ë¡£ +¤·¤«¤·¡¢¤¹¤Ù¤Æ¤Î¥Ç¥Ð¥¤¥¹¤¬¤³¤Îµ¯Æ°»þ°ú¿ô¤Ë¤è¤ë¥Ñ¥ê¥Æ¥£¤ÎÁªÂò¤ò +¥µ¥Ý¡¼¥È¤¹¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B "'max_scsi_luns=...'" +SCSI ¥Ç¥Ð¥¤¥¹¤ÏÊ£¿ô¤Î¡Ö¥µ¥Ö¥Ç¥Ð¥¤¥¹¡×¤ò¼«Ê¬¼«¿È¤ÎÆâÉô¤Ë»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ +ºÇ¤â¤è¤¯¤¢¤ëÎã¤È¤·¤Æ¡¢°ì»þ¤Ë 1 Ëç°Ê¾å¤Î¥Ç¥£¥¹¥¯¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤ë +(¥Á¥§¥ó¥¸¥ã¡¼µ¡Ç½ÉÕ¤Î) SCSI CD-ROM ¤¬¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î CD ¤Ï¤½¤Î¥Ç¥Ð¥¤¥¹¤Î +¡ÖÏÀÍý¥æ¥Ë¥Ã¥ÈÈÖ¹æ (LUN)¡×¤Ë¤è¤Ã¤ÆÆÃÄꤵ¤ì¤ë¡£ +¤·¤«¤·¤Û¤È¤ó¤É¤Î¥Ç¥Ð¥¤¥¹ (Î㤨¤Ð¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤ä¥Æ¡¼¥×¥É¥é¥¤¥Ö) ¤Ï¡¢ +LUN ÈÖ¹æ 0 ¤¬³ä¤êÅö¤Æ¤é¤ì¤¿¡¢¤¿¤À¤Ò¤È¤Ä¤Î¥Ç¥Ð¥¤¥¹¤«¤é¤Ê¤ë¡£ + +À߷פ¬ÉÔ½½Ê¬¤Ê SCSI ¥Ç¥Ð¥¤¥¹¤Ç¤Ï 0 °Ê³°¤Î LUN ÈÖ¹æ¤Ø¤Î¼«Æ°¸¡½Ð¤ò +°·¤¨¤Ê¤¤¤³¤È¤¬¤¢¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_SCSI_MULTI_LUN +¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢ +ºÇ¶á¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï LUN ÈÖ¹æ 0 ¤Î¤ß¤ò¸¡½Ð¤¹¤ë¡£ + +µ¯Æ°»þ¤ËÄ´¤Ù¤ë LUN ÈÖ¹æ¤ò»ØÄꤹ¤ë¾ì¹ç¡¢µ¯Æ°»þ°ú¿ô¤È¤·¤Æ +\&'max_scsi_luns=n' ¤ò»ØÄꤹ¤ë¡£n ¤Ï 1 ¤«¤é 8 ¤Î´Ö¤Ç»ØÄꤹ¤ë¡£ +n=1 °Ê¾å¤ÎÃͤò»ÈÍѤ·¤Ê¤¤¤è¤¦¤Ë¤¹¤ì¤Ð¡¢ +¤³¤Î¤è¤¦¤Ê¤¤¤«¤ì¤¿µ¡³£¤Ë¤Ò¤É¤¤Ìܤˤ¢¤ï¤µ¤ì¤º¤Ë¤¹¤à¤À¤í¤¦¡£ +.TP +.B SCSI ¥Æ¡¼¥×¥É¥é¥¤¥Ö¤ÎÀßÄê +SCSI ¥Æ¡¼¥×¥É¥é¥¤¥Ð¤Îµ¯Æ°»þÀßÄê¤Î°ìÉô¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¹Ô¤Ê¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.IP +.BI st= buf_size[,write_threshold[,max_bufs]] +.sp +ºÇ½é¤Î 2 ¤Ä¤Î¿ô»ú¤Ï kB ñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.I buf_size +¤Î¥Ç¥Õ¥©¥ë¥È¤Ï 32kB ¤Ç¤¢¤ë¡£¾å¸Â¤Ï 16384kB ¤Þ¤Ç»ØÄê¤Ç¤­¤ë¡£ +.I write_threshold +¤Ï¥Ç¡¼¥¿½ñ¤­½Ð¤·¤ÎïçÃͤǡ¢ +¥Ð¥Ã¥Õ¥¡¤Î¥Ç¡¼¥¿¤Î¥µ¥¤¥º¤¬¤³¤ÎÃͤò±Û¤¨¤ë¤È¥Ç¡¼¥¿¤Ï¥Æ¡¼¥×¤Ë½ñ¤­½Ð¤µ¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 30kB ¤Ç¤¢¤ë¡£ +¥Ð¥Ã¥Õ¥¡¿ô¤ÎºÇÂçÃÍ +.RI ( max_bufs ) +¤Ï¸¡½Ð¤µ¤ì¤¿¥É¥é¥¤¥Ö¤Î¿ô¤Ë¤è¤Ã¤ÆÊѲ½¤¹¤ë¤¬¡¢¥Ç¥Õ¥©¥ë¥È¤Ï 2 ¤Ç¤¢¤ë¡£ +»ÈÍÑÎã¤ò°Ê²¼¤Ë¼¨¤¹¡£ +.IP +st=32,30,2 +.IP +¾ÜºÙ¤Ï¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.I Documentation/scsi/st.txt +(¸Å¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï +.IR drivers/scsi/README.st ) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.B Adaptec aha151x, aha152x, aic6260, aic6360, SB16-SCSI ¤ÎÀßÄê +aha ¤Ë³¤¯ÈÖ¹æ¤Ï¥«¡¼¥É¤òɽ¤·¡¢ +aic ¤Ë³¤¯ÈÖ¹æ¤Ï¥«¡¼¥É¤ËÅëºÜ¤µ¤ì¤Æ¤¤¤ë¼ÂºÝ¤Î¥Á¥Ã¥×¤òɽ¤¹ +(Soundblaster-16 SCSI ¤â¸å¼Ô¤Ë´Þ¤Þ¤ì¤ë)¡£ + +SCSI ¥Û¥¹¥È¤Î¸¡½Ð¥³¡¼¥É¤Ï¡¢ +¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë BIOS ¤òõ¤¹¡£ +¸«¤Ä¤«¤é¤Ê¤¤¤È¡¢¥«¡¼¥É¤Ï¸¡½Ð¤Ç¤­¤Ê¤¤¡£ +¤³¤Î¾ì¹ç¤Ï°Ê²¼¤Î¤è¤¦¤Ëµ¯Æ°»þ°ú¿ô¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.IP +.BI aha152x= iobase[,irq[,scsi-id[,reconnect[,parity]]]] +.IP +¤â¤·¥É¥é¥¤¥Ð¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¤¤¤¿¾ì¹ç¤Ï¡¢ +6 ÈÖÌܤÎÃͤǥǥХå°¥ì¥Ù¥ë¤ò»ØÄê¤Ç¤­¤ë¡£ + +¤¹¤Ù¤Æ¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢¤³¤Î¥»¥¯¥·¥ç¥ó¤ÎºÇ½é¤ÇÀâÌÀ¤·¤¿Ä̤ê¤Ç¤¢¤ë¡£ +.I reconnect +¤Ë 0 °Ê³°¤ÎÃͤò»ØÄꤹ¤ë¤È¡¢¥Ç¥Ð¥¤¥¹¤òÀÚÃǤ·¤¿¤êÀܳ¤·¤¿¤ê¤Ç¤­¤ë¡£ +°Ê²¼¤ËÎã¤ò¼¨¤¹¡£ +.IP +aha152x=0x340,11,7,1 +.IP +¥Ñ¥é¥á¡¼¥¿¤Ïɬ¤º¾åµ­¤Î½çÈ֤ɤª¤ê¤Ë»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Î㤨¤Ð¡¢¥Ñ¥ê¥Æ¥£ (parity) ¤òÀßÄꤷ¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +iobase, irq, scsi-id, reconnect ¤âƱ»þ¤Ë»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£ +.TP +.B Adaptec aha154x ¤ÎÀßÄê +aha1542 ¥·¥ê¡¼¥º¤Î¥«¡¼¥É¤Ï +i82077 ¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯¥³¥ó¥È¥í¡¼¥é¤ò¥Ü¡¼¥É¤ËÅëºÜ¤·¤Æ¤¤¤ë¡£ +°ìÊý aha1540 ¥·¥ê¡¼¥º¤Î¥«¡¼¥É¤ÏÅëºÜ¤·¤Æ¤¤¤Ê¤¤¡£ +¤³¤ì¤é¤Ï¶¦¤Ë¥Ð¥¹¥Þ¥¹¥¿¥«¡¼¥É¤Ç¤¢¤ê¡¢ +¾¤Î¥Ç¥Ð¥¤¥¹¤È¥Ð¥¹¤ò¶¦Í­¤¹¤ëºÝ¤Ë¡¢ +¤É¤Î¤¯¤é¤¤¡Ö¥Õ¥§¥¢¤Ë¡×¿¶¤ëÉñ¤¦¤«¤ò»ØÄꤹ¤ë¥Ñ¥é¥á¡¼¥¿¤¬¤¢¤ë¡£ +µ¯Æ°»þ°ú¿ô¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ»ØÄꤹ¤ë¡£ +.IP +.BI aha1542= iobase[,buson,busoff[,dmaspeed]] +.IP +Í­¸ú¤Ê iobase ¤ÎÃͤϼ¡¤ÎÄ̤ꡣ +0x130, 0x134, 0x230, 0x234, 0x330, 0x334¡£ +¥¯¥í¡¼¥ó¥«¡¼¥É¤ÎÃæ¤Ë¤Ï¾¤ÎÃͤò»ØÄê¤Ç¤­¤ë¤â¤Î¤â¤¢¤ë¡£ + +.IR buson ", " busoff +Ãͤϥ«¡¼¥É¤¬ISA ¥Ð¥¹¤òÀêÍ­¤¹¤ë»þ´Ö¤ò¥Þ¥¤¥¯¥íÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ +¾Êά»þ¤Ï¤½¤ì¤¾¤ì 11us on ¤È 4us off ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ç¡¢ +¾¤Î¥«¡¼¥É (Î㤨¤Ð ISA LANCE ¥¤¡¼¥µ¥Í¥Ã¥È¥«¡¼¥É) ¤â +ISA ¥Ð¥¹¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ + +.I dmaspeed +ÃÍ¤Ï DMA (Direct Memory Access) žÁ÷®ÅÙ¤ò MB/s ñ°Ì¤ÇÀßÄꤹ¤ë¡£ +¾Êά»þ¤Ï 5MB/s ¤Ç¤¢¤ë¡£¿·¤·¤¤¥ê¥Ó¥¸¥ç¥ó¤Î¥«¡¼¥É¤Ç¤Ï¡¢ +¤³¤ÎÃͤò»È¤Ã¤¿¥½¥Õ¥È¥¦¥§¥¢¤Ë¤è¤ëÀßÄ꤬¤Ç¤­¤ë¡£ +¸Å¤¤¥«¡¼¥É¤Ï¥¸¥ã¥ó¥ÑÀßÄê¤òɬÍפȤ¹¤ë¡£ +¥Þ¥¶¡¼¥Ü¡¼¥É¤¬Âбþ¤·¤Æ¤¤¤ì¤ÐºÇÂç 10MB/s ¤Þ¤Ç»ØÄê²Äǽ¤Ç¤¢¤ë¡£ +5MB/s °Ê¾å¤ÎÃͤò»È¤¦¾ì¹ç¤ÏÃí°Õ¤·¤Æ¼Â¸³¤·¤Æ¤«¤é¤Ë¤¹¤ë¤³¤È¡£ +.TP +.B Adaptec aha274x, aha284x, aic7xxx ¤ÎÀßÄê +¤³¤ì¤é¤Î¥Ü¡¼¥É¤Ï°Ê²¼¤Î·Á¼°¤Ç»ØÄꤹ¤ë¡£ +.IP +.BI aic7xxx= extended,no_reset +.IP +.I extended +Ãͤ¬ 0 °Ê³°¤Î»þ¤Ï¡¢ÂçÍÆÎ̥ǥ£¥¹¥¯ÍѤγÈÄ¥ÊÑ´¹¤¬Í­¸ú¤Ë¤Ê¤ë¡£ +.I no_reset +Ãͤò 0 °Ê³°¤ÎÃͤˤ¹¤ë¤È¡¢¥Û¥¹¥È¥¢¥À¥×¥¿¤Î¸¡½Ð»þ¤Ë¡¢ +¥É¥é¥¤¥Ð¤Ë¤è¤ë SCSI ¥Ð¥¹¤Î½é´ü²½¤ò¹Ô¤ï¤Ê¤¤¡£ +.TP +.B "AdvanSys SCSI ¥Û¥¹¥È¥¢¥À¥×¥¿¤ÎÀßÄê ('advansys=')" +AdvanSys ¥É¥é¥¤¥Ð¤Ï¥«¡¼¥É¤Î¸¡½ÐÀè¤È¤·¤Æ +4 ¤Ä¤Î I/O ¥¢¥É¥ì¥¹¤ò¼õ¤±ÉÕ¤±¤ë¡£ +EISA ¤ä PCI ¥«¡¼¥É¤Ç¤Ï¤³¤ì¤é¤ò»ØÄꤷ¤Æ¤âÁ´¤¯¸ú²Ì¤¬Ìµ¤¤¡£ +ISA µÚ¤Ó VLB ¥«¡¼¥É¤Î¸¡½Ð¤ËÂФ·¤Æ¤Î¤ßÍѤ¤¤é¤ì¤ë¡£ +¤µ¤é¤Ë¡¢¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥óÉÕ¤­¤Ç¥É¥é¥¤¥Ð¤¬¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¥Ç¥Ð¥Ã¥°¾ðÊó¤Î½ÐÎÏ¥ì¥Ù¥ë¤È¤·¤Æ 0xdeb[0-f] ¥Ñ¥é¥á¡¼¥¿¤òÄɲäǤ­¤ë¡£ +0-f ¤Ë¤è¤ê¥Ç¥Ð¥Ã¥°¥á¥Ã¥»¡¼¥¸¤Î¾ðÊó¤Î¥ì¥Ù¥ë¤ò 16 Ãʳ¬¤Ç»ØÄꤹ¤ë¡£ +.TP +.B "AM53C974" +.IP +.BI AM53C974= host-scsi-id,target-scsi-id,max-rate,max-offset +.TP +.B BusLogic SCSI ¥Û¥¹¥È¥¢¥À¥×¥¿¤ÎÀßÄê ('BusLogic=') +.IP +.BI BusLogic= N1,N2,N3,N4,N5,S1,S2,... +.IP +Buslogic ¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ñ¥é¥á¡¼¥¿¤Ë´Ø¤¹¤ë¾ÜºÙ¤ÊµÄÏÀ¤Ï +.I /usr/src/linux/drivers/scsi/BusLogic.c +(Ãø¼Ô¤¬¤¤¤Þ¸«¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤Ç¤Ï 4350-4497 ¹ÔÌÜ) ¤ò»²¾È¤¹¤ë¤³¤È¡£ +°Ê²¼¤Ï¤³¤ì¤òÈó¾ï¤Ë¤ª¤ª¤¶¤Ã¤Ñ¤ËÍ×Ìó¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +¥Ñ¥é¥á¡¼¥¿ N1 ¤«¤é N5 ¤Þ¤Ç¤ÏÀ°¿ô¤Ç¤¢¤ë¡£ +¥Ñ¥é¥á¡¼¥¿ S1 °Ê¹ß¤Ïʸ»úÎó¤Ç¤¢¤ë¡£ +N1 ¤Ï¥Û¥¹¥È¥¢¥À¥×¥¿¤¬Â¸ºß¤¹¤ë I/O ¥¢¥É¥ì¥¹¡£ +N2 ¤Ï¥¿¥°¥­¥å¡¼¥¤¥ó¥°¤ò¥µ¥Ý¡¼¥È¤¹¤ë¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ»ÈÍѤ¹¤ë¥­¥å¡¼¤Î¿¼¤µ¡£ +N3 ¤Ï¥Ð¥¹°ÂÄê»þ´Ö (BST) ¤òÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ +¤³¤ì¤Ï¥Û¥¹¥È¥¢¥À¥×¥¿¤Î¥Ï¡¼¥É¥ê¥»¥Ã¥È¤Ë¤è¤ê SCSI ¥Ð¥¹¤ò¥ê¥»¥Ã¥È¤·¤Æ¤«¤é +SCSI ¥³¥Þ¥ó¥É¤Îȯ¹Ô¤ò³«»Ï¤¹¤ë¤Þ¤Ç¤ÎÂÔ¤Á»þ´Ö¤Ç¤¢¤ë¡£ +N4 ¤Ï¥í¡¼¥«¥ë¥ª¥×¥·¥ç¥ó (¤Ò¤È¤Ä¤Î¥Û¥¹¥È¥¢¥À¥×¥¿ÍÑ)¡£ +N5 ¤Ï¥°¥í¡¼¥Ð¥ë¥ª¥×¥·¥ç¥ó (¤¹¤Ù¤Æ¤Î¥Û¥¹¥È¥¢¥À¥×¥¿ÍÑ)¡£ + +ʸ»úÎ󥪥ץ·¥ç¥ó¤Ï°Ê²¼¤ÎÆ°ºî¤òÀ©¸æ¤¹¤ë: +¥¿¥°¥­¥å¡¼¥¤¥ó¥° (TQ:Default, TQ:Enable, TQ:Disable, TQ:)¡¢ +¥¨¥é¡¼Éüµ¢ (ER:Default, ER:HardReset, ER:BusDeviceReset, +ER:None, ER:)¡¢ +¥Û¥¹¥È¥¢¥À¥×¥¿¤Î¸¡½Ð (NoProbe, NoProbeISA, NoSortPCI)¡£ +.TP +.B EATA/DMA ¤ÎÀßÄê +¸¡½ÐÂоݤˤ¹¤ë I/O ¥Ý¡¼¥È¤Î¥ê¥¹¥È¤ò°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÊѹ¹¤Ç¤­¤ë¡£ +.IP +.BI eata= iobase,iobase,...\fP. +.TP +.B Future Domain TMC-16x0 ¤ÎÀßÄê +.IP +.BI fdomain= iobase,irq[,adapter_id] +.TP +.B Great Valley Products (GVP) SCSI ¥³¥ó¥È¥í¡¼¥é¤ÎÀßÄê +.IP +.BI gvp11= dma_transfer_bitmask +.TP +.B Future Domain À½ TMC-8xx, TMC-950 ¤ÎÀßÄê +.IP +.BI tmc8xx= mem_base,irq +.IP +.I mem_base +¤Ë¤Ï¥«¡¼¥É¤¬»ÈÍѤ¹¤ë¥á¥â¥ê¥Þ¥Ã¥× I/O ¤ÎÎΰè¤ò»ØÄꤹ¤ë¡£Ä̾ï +¤Ï¼¡¤ÎÃͤΤɤ줫¤¬»È¤ï¤ì¤ë: 0xc8000, 0xca000, 0xcc000, +0xce000, 0xdc000, 0xde000¡£ +.TP +.B IN2000 ¤ÎÀßÄê +.IP +.BI in2000= S +.IP +S ¤Ï¥³¥ó¥Þ¶èÀÚ¤ê¤Îʸ»úÎó¤Ç¡¢³Æ¹àÌÜ¤Ï keyword[:value] ·Á¼°¤Ç»ØÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ë¥­¡¼¥ï¡¼¥É¤Ï°Ê²¼¤ÎÄ̤ꡣ +ioport:addr, noreset, nosync:x, period:ns, disconnect:x, debug:x, proc:x¡£ +¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤Îµ¡Ç½¤Ë¤Ä¤¤¤Æ¤Ï +.I /usr/src/linux/drivers/scsi/in2000.c +¤ò»²¾È¡£ +.TP +.B NCR5380 ¤ª¤è¤Ó NCR53C400 ¤ÎÀßÄê +¤³¤Îµ¯Æ°»þ°ú¿ô¤Ï°Ê²¼¤Î½ñ¼°¤Ç»ØÄꤹ¤ë¡£ +.IP +.BI ncr5380= iobase,irq,dma +.IP +¤Þ¤¿¤Ï +.IP +.BI ncr53c400= iobase,irq +.IP +¥«¡¼¥É¤¬ IRQ ¤ò»ÈÍѤ·¤Ê¤¤¾ì¹ç¤Ï¡¢ +255 (0xff) ¤ò»ØÄꤹ¤ì¤Ð̵¸ú¤Ë¤Ç¤­¤ë¡£ +IRQ ¤Ë 254 ¤ò»ØÄꤹ¤ë¤È¼«Æ°¸¡½Ð¤¹¤ë¡£ +¾ÜºÙ¤Ï¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.I Documentation/scsi/g_NCR5380.txt +(¸Å¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï +.IR drivers/scsi/README.g_NCR5380 ) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.B NCR53C8xx ¤ÎÀßÄê +.IP +.BI ncr53c8xx= S +.IP +S ¤Ï¥³¥ó¥Þ¶èÀÚ¤ê¤Îʸ»úÎó¤Ç¡¢³Æ¹àÌÜ¤Ï keyword[:value] ·Á¼°¤Ç»ØÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ë¥­¡¼¥ï¡¼¥É¤Ï°Ê²¼¤ÎÄ̤ꡣ +mpar (master_parity), +spar (scsi_parity), disc (disconnection), specf +(special_features), ultra (ultra_scsi), fsn +(force_sync_nego), tags (default_tags), sync (default_sync), +verb (verbose), debug (debug), burst (burst_max)¡£ +¤³¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤Îµ¡Ç½¤Ë¤Ä¤¤¤Æ¤Ï +.I /usr/src/linux/drivers/scsi/README.ncr53c8xx +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.B NCR53c406a ¤ÎÀßÄê +.IP +.BI ncr53c406a= iobase[,irq[,fastpio]] +.IP +³ä¤ê¹þ¤ß̵¤·¤ÇÆ°ºî¤¹¤ë¥â¡¼¥É¤Ë¤Ï irq ¤Ë 0 ¤ò»ØÄꤹ¤ë¡£ +¹â® PIO ¥â¡¼¥É¤Ï fastpio ¤Ë 1 ¤ò»ØÄꤷ¡¢Ä㮥⡼¥É¤Ï 0 ¤ò»ØÄꤹ¤ë¡£ +.TP +.B Pro Audio Spectrum ¤ÎÀßÄê +PAS16 ¤Ï NC5380 SCSI ¥Á¥Ã¥×¤ò»ÈÍѤ·¤Æ¤ª¤ê¡¢ +ºÇ¶á¤Î¥â¥Ç¥ë¤Ï¥¸¥ã¥ó¥Ñ¥ì¥¹¤ÎÀßÄê¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +µ¯Æ°»þ°ú¿ô¤Î½ñ¼°¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +.BI pas16= iobase,irq +.IP +Í£°ì¤Î°ã¤¤¤È¤·¤Æ¡¢ +IRQ ¤Ë 255 ¤ò»ØÄꤹ¤ì¤Ð³ä¤ê¹þ¤ß¤ò»ÈÍѤ·¤Ê¤¤¤è¤¦¥É¥é¥¤¥Ð¤Ë»Ø¼¨¤Ç¤­¤ë +(¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ÏÄã²¼¤¹¤ë)¡£ +Ä̾ï iobase ¤Ï 0x388 ¤Ç¤¢¤ë¡£ +.TP +.B Seagate À½ ST-0x ¤ÎÀßÄê +¥«¡¼¥É¤¬µ¯Æ°»þ¤Ëǧ¼±¤µ¤ì¤Ê¤¤¾ì¹ç¤Ï°Ê²¼¤Î¤è¤¦¤Ê»ØÄ꤬ɬÍפˤʤë¤À¤í¤¦¡£ +.IP +.BI st0x= mem_base,irq +.IP +.I mem_base +¤Ë¤Ï¥«¡¼¥É¤¬»ÈÍѤ¹¤ë¥á¥â¥ê¥Þ¥Ã¥× I/O ¤ÎÎΰè¤ò»ØÄꤹ¤ë¡£ +Ä̾ï¤Ï¼¡¤Î¤É¤ì¤«: +0xc8000, 0xca000, 0xcc000, 0xce000, 0xdc000, 0xde000¡£ +TP +.B Trantor À½ T128 ¤ÎÀßÄê +¤³¤Î¥«¡¼¥É¤â NCR5380 ¥Á¥Ã¥×¤òÍøÍѤ·¤Æ¤ª¤ê¡¢ +°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤ò¼õ¤±ÉÕ¤±¤ë¡£ +.IP +.BI t128= mem_base,irq +.IP +Í­¸ú¤Ê +.I mem_base +¤ÎÃͤϼ¡¤ÎÄ̤ê¤Ç¤¢¤ë: 0xcc000, 0xc8000, 0xdc000, 0xd8000¡£ +.TP +.B UltraStor À½ 14F/34F ¤ÎÀßÄê +¼«Æ°¸¡½Ð¤ò»î¤ß¤ë I/O ¥Ý¡¼¥È¤Î¥ê¥¹¥È¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÊѹ¹¤Ç¤­¤ë¡£ +.IP +.BI eata= iobase,iobase,... . +.TP +.B WD7000 ¤ÎÀßÄê +.IP +.BI wd7000= irq,dma,iobase +.SS Commodore Amiga À½ A2091/590 SCSI ¥³¥ó¥È¥í¡¼¥é¤ÎÀßÄê +.IP +.BI wd33c93= S +.IP +S ¤Ï¥³¥ó¥Þ¶èÀÚ¤ê¤Îʸ»úÎó¤Ç¡¢³Æ¹àÌÜ¤Ï keyword[:value] ·Á¼°¤Ç»ØÄꤹ¤ë¡£ +ǧ¼±¤µ¤ì¤ë¥ª¥×¥·¥ç¥ó¤Ï°Ê²¼¤ÎÄ̤ꡣ +nosync:bitmask, nodma:x, period:ns, +disconnect:x, debug:x, clock:x, next¡£ +¾ÜºÙ¤Ï +.I /usr/src/linux/drivers/scsi/wd33c93.c +¤ò»²¾È¤»¤è¡£ +.SS ¥Ï¡¼¥É¥Ç¥£¥¹¥¯ +.TP +.B "IDE Disk/CD-ROM ¥É¥é¥¤¥Ð¤Î¥Ñ¥é¥á¡¼¥¿" +IDE ¥É¥é¥¤¥Ð¤Ï¡¢ +¥Ç¥£¥¹¥¯¤Î¥¸¥ª¥á¥È¥ê»ØÄ꤫¤é¥Ð¥°¤Î¤¢¤ë¥³¥ó¥È¥í¡¼¥é¥Á¥Ã¥×¤Î¥µ¥Ý¡¼¥È¤Þ¤Ç¡¢ +¿ô¿¤¯¤Î¥Ñ¥é¥á¡¼¥¿¤ò¼õ¤±ÉÕ¤±¤ë¡£ +¥É¥é¥¤¥Ö¤òÆÃÄꤹ¤ë¤Ë¤Ï 'hdX=' ¤ò»È¤¦¡£ +¤³¤³¤Ç X ¤Ë¤Ï 'a' ¤«¤é 'h' ¤Îʸ»ú¤ò»ØÄꤹ¤ë¡£ + +¤¢¤ë¥É¥é¥¤¥Ö¤ËÆÃÍ­¤Ê¤â¤Î¤Ç¤Ï¤Ê¤¤¥ª¥×¥·¥ç¥ó¤Ï¡¢hd= ¤òÁ°¤ËÉÕ¤±¤Æ»ØÄꤹ¤ë¡£ +¥É¥é¥¤¥ÖÆÃÍ­¤Ç¤Ê¤¤¥ª¥×¥·¥ç¥ó¤ËÂФ·¤Æ¥É¥é¥¤¥Ö»ØÄê +('hdX=') ¤òÁ°ÃÖ¤·¤Æ¤âÌäÂê¤Ï¤Ê¤¤¡£ +¤½¤Î¥ª¥×¥·¥ç¥ó¤Ï´üÂÔÄ̤ꤽ¤Î¥É¥é¥¤¥Ö¤ËŬÍѤµ¤ì¤ë¡£ +.\"nakano ¤È¤¤¤¦¤Î¤¬ "as expected" ¤À¤È»×¤¦¤ó¤À¤±¤É... + +\&'hd=' ¤Ï¡¢(a, ..., h) ¤Î¥·¡¼¥±¥ó¥¹¤Ë¤ª¤¤¤Æ¡¢ +¤Þ¤À»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¼¡¤Î¥É¥é¥¤¥Ö¤ò»Ø¤¹¤¿¤á¤Ë¤â»È¤¨¤ë¡£ +¤³¤ì°Ê¹ß¤Ç¤Ï´Êñ¤Î¤¿¤á¤Ë 'hd=' ¤ò»È¤Ã¤ÆÀâÌÀ¤¹¤ë¡£ +¤µ¤é¤Ë¾Ü¤·¤¤¾ðÊó¤òÆÀ¤ë¤Ë¤Ï¡¢¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.I Documentation/ide.txt +(¸Å¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï +.IR drivers/block/README.ide ) +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B 'hd=cyls,heads,sects[,wpcom[,irq]]' ¥ª¥×¥·¥ç¥ó +¤³¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Ç¥£¥¹¥¯¤ÎʪÍýŪ¤Ê¥¸¥ª¥á¥È¥ê¤ò»ØÄꤹ¤ë¤¿¤á¤Ë»È¤¦¡£ +ºÇ½é¤Î 3 ¤Ä¤ÎÃͰʹߤϾÊά¤Ç¤­¤ë¡£ +¥·¥ê¥ó¥À (cyls)¡¢¥Ø¥Ã¥É (heads)¡¢¥»¥¯¥¿ (sects) ¤Î³ÆÃÍ¤Ï +fdisk ¤ÇÍѤ¤¤é¤ì¤ë¤â¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +½ñ¤­¹þ¤ßÊäÀµ (wpcom) ÃÍ¤Ï IDE ¥Ç¥£¥¹¥¯¤Ç¤Ï̵»ë¤µ¤ì¤ë¡£ +IRQ Ãͤˤϡ¢¤½¤Î¥É¥é¥¤¥Ö¤¬Àܳ¤µ¤ì¤Æ¤¤¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ÍѤ¤¤ë +IRQ ¤ò»ØÄꤹ¤ë +(ËÜÍè¤Î°ÕÌ£¤Ç¤Ï¡Ö¥É¥é¥¤¥Ö¤ËÆÃÍ­¡×¤Î¥Ñ¥é¥á¡¼¥¿¤Ç¤Ï¤Ê¤¤)¡£ +.TP +.B 'hd=serialize' ¥ª¥×¥·¥ç¥ó +¥Ç¥å¥¢¥ë IDE ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë CMD-640 ¥Á¥Ã¥×¤Ë¤ÏÀß·×¾å¤ÎÌäÂ꤬¤¢¤Ã¤Æ¡¢ +¥»¥«¥ó¥À¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¾å¤Î¥É¥é¥¤¥Ö¤È +¥×¥é¥¤¥Þ¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¾å¤Î¥É¥é¥¤¥Ö¤ò +Ʊ»þ¤Ë»ÈÍѤ¹¤ë¤È¥Ç¡¼¥¿¤¬Ç˲õ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤ë¤È¡¢ +¥É¥é¥¤¥Ð¤ÏξÊý¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ +Ʊ»þ¤Ë»ÈÍѤµ¤ì¤ë¤³¤È¤¬ÀäÂФˤʤ¤¤è¤¦¤Ë¤¹¤ë¡£ +.TP +.B 'hd=dtc2278' ¥ª¥×¥·¥ç¥ó +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢DTC-2278D IDE ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬»È¤ï¤ì¤Æ¤¤¤ë +¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +¤¹¤ë¤È¥É¥é¥¤¥Ð¤Ï¡¢DTC ÆÃÍ­¤Îµ¡Ç½ +(2 ÈÖÌܤΥ¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤È¹â®žÁ÷¥â¡¼¥É) +¤ò»ÈÍѲÄǽ¤Ë¤¹¤ë¤è¤¦»î¤ß¤ë¡£ +.TP +.B 'hd=noprobe' ¥ª¥×¥·¥ç¥ó +¤³¤Î¥É¥é¥¤¥Ö¤Î¼«Æ°¸¡½Ð¤ò¤·¤Ê¤¤¡£ +Î㤨¤Ð +.IP +hdb=noprobe hdb=1166,7,17 +.IP +¤È¤¹¤ë¤È¼«Æ°¸¡½Ð¤¬Ìµ¸ú¤Ë¤Ê¤ë¡£ +¤·¤«¤·¥É¥é¥¤¥Ö¤Î¥¸¥ª¥á¥È¥ê¤ò»ØÄꤷ¤Æ¤¤¤ë¤Î¤Ç¡¢ +¤³¤Î¥É¥é¥¤¥Ö¤ÏÀµ¤·¤¤¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤È¤·¤ÆÅÐÏ¿¤µ¤ì¡¢»ÈÍѲÄǽ¤Ë¤Ê¤ë¡£ +.TP +.B 'hd=nowerr' ¥ª¥×¥·¥ç¥ó +¥É¥é¥¤¥Ö¤Ë¤è¤Ã¤Æ¤Ï¡¢½ñ¤­¹þ¤ß¥¨¥é¡¼ +.RB ( WRERR_STAT ) +¥Ó¥Ã¥È¤¬¥¯¥ê¥¢¤Ç¤­¤Ê¤¯¤Ê¤ë¤³¤È¤¬¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢ +¤³¤Î¤è¤¦¤Ê²õ¤ì¤¿¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë²óÈòµ¡Ç½¤¬Í­¸ú¤Ë¤Ê¤ë¡£ +.TP +.B "'hd=cdrom' ¥ª¥×¥·¥ç¥ó" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢Ä̾ï¤Î IDE ¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤ÎÂå¤ï¤ê¤Ë¡¢ +ATAPI ¸ß´¹¤Î CDROM ¤¬Â³¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò IDE ¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +CD-ROM ¤Ï¤¿¤¤¤Æ¤¤¼«Æ°Åª¤Ëǧ¼±¤µ¤ì¤ë¤¬¡¢ +¤¦¤Þ¤¯¹Ô¤«¤Ê¤¤¾ì¹ç¤Ë»î¤·¤Æ¤ß¤ë¤ÈÎɤ¤¡£ +.TP +.B ¥¹¥¿¥ó¥À¡¼¥É ST-506 ¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ð¤Î¥ª¥×¥·¥ç¥ó ('hd=') +¥¹¥¿¥ó¥À¡¼¥É¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ð¤Ï +IDE ¥É¥é¥¤¥Ð¤ÈƱÍͤΥ¸¥ª¥á¥È¥ê»ØÄê¤ò°ú¿ô¤Ë¤È¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤¿¤À¤·¼õ¤±ÉÕ¤±¤ëÃͤϤÁ¤ç¤¦¤É 3 ¤Ä (C/H/S) ¤Ë¸Â¤é¤ì¤ë¡£ +¤½¤ì°Ê¾å¤ÎÃͤ䤽¤ì°Ê²¼¤ÎÃͤò»ØÄꤹ¤ë¤È¡¢¥É¥é¥¤¥Ð¤ÏÌۤäƤ½¤Î»ØÄê¤ò̵»ë¤¹¤ë¡£ +¤Þ¤¿°ú¿ô¤È¤·¤Æ¼õ¤±Æþ¤ì¤é¤ì¤ë¤Î¤Ï 'hd=' ¤Î·Á¼°¤À¤±¤Ç¤¢¤ë¡£ +¤Ä¤Þ¤ê 'hda=' ¤Î¤è¤¦¤Ê»ØÄê¤Ï¤³¤³¤Ç¤ÏÀµ¤·¤¯¤Ê¤¤¡£ +½ñ¼°¤Ï¼¡¤ÎÄ̤ꡣ +.IP +hd=cyls,heads,sects +.IP +2 Âæ¤Î¥Ç¥£¥¹¥¯¤¬Àܳ¤µ¤ì¤Æ¤¤¾ì¹ç¤Ï¡¢ +2 ÈÖÌܤΥǥ£¥¹¥¯¤ËÂФ·¤Æ¤â¾åµ­¤Î¥¸¥ª¥á¥È¥ê¤¬ÀßÄꤵ¤ì¤ë¡£ +.TP +.B XT ¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ð¤Î¥ª¥×¥·¥ç¥ó ('xd=') +¤³¤ì¤é¤Î¸Å¤¤ 8 bit ¥«¡¼¥É (125kB/s ¤ÎžÁ÷®ÅÙ¤·¤«¤Ê¤¤!) +¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ÉÔ¹¬¤Ê¿Í¤Î¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +¥«¡¼¥É¤¬Ç§¼±¤µ¤ì¤Ê¤¤¾ì¹ç¤Ï°Ê²¼¤Î½ñ¼°¤Çµ¯Æ°»þ°ú¿ô¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¤À¤í¤¦¡£ +.IP +xd=type,irq,iobase,dma_chan +.IP +.\" 1.1.50, 1.3.81, 1.3.99, 2.0.34, 2.1.67, 2.1.78, 2.1.127 +type Ãͤˤϥ«¡¼¥É¤Î¥á¡¼¥«¡¼¤ò»ØÄꤷ¡¢¤³¤ì¤Ï¼«Æ°¸¡ÃΤè¤êÍ¥À褵¤ì¤ë¡£ +»ØÄꤹ¤Ù¤­ type ¤ÎÃͤˤĤ¤¤Æ¤Ï¡¢»È¤Ã¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë +.I drivers/block/xd.c +¤òÄ´¤Ù¤Æ¤Û¤·¤¤¡£type ¤Ï¥ê¥¹¥È +.I xd_sigs +¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¡¢Îò»Ë¤È¶¦¤ËÄɲ䵤줿¤êºï½ü¤µ¤ì¤¿¤ê¤·¤Æ¤­¤¿¡£ +¥ê¥¹¥È¤ÎÅÓÃæ¤Ç¤ÎÄɲᦺï½ü¤â¹Ô¤ï¤ì¤¿¤Î¤Ç¡¢ +¤½¤Î¾ì¹ç¤Ï¤¹¤Ù¤Æ¤Î type Èֹ椬Êѹ¹¤µ¤ì¤¿¡£ +º£Æü (Linux 2.5.0) ¤Ë¤ª¤±¤ë type ¤Ï¡¢ +0=generic; 1=DTC 5150cx; 2,3=DTC 5150x; 4,5=Western Digital; +6,7,8=Seagate; 9=Omti; 10=XEBEC ¤Ç¤¢¤ë¡£ +¤³¤³¤Ç¤Ï¤¤¤¯¤Ä¤«¤Î type ¤ËƱ¤¸»ØÄ꤬Ϳ¤¨¤é¤ì¤Æ¤¤¤ë¤¬¡¢ +¤½¤ì¤é¤ÏÅù²Á¤Ç¤¢¤ë¡£ + +0=¥Î¡¼¥Ö¥é¥ó¥É¡¢1=DTC¡¢2,3,4=Western Digital¡¢5,6,7=Seagate¡¢8=OMTI +Ʊ¤¸¥á¡¼¥«¡¼¤ËÊ£¿ô¤ÎÃͤ¬¤¢¤ë¤Î¤Ï¸¡½Ð¤Ë»ÈÍѤµ¤ì¤ë BIOS ʸ»úÎó¤Î°ã¤¤¤Ç¤¢¤ë¡£ +BIOS ʸ»úÎó¤Ï type ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£ + +xd_setup() ´Ø¿ô¤Ï°ú¿ô¤ò¥Á¥§¥Ã¥¯¤»¤º¡¢ +4 ¤Ä¤ÎÃͤ¬¤¹¤Ù¤Æ»ØÄꤵ¤ì¤ë¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤ë¡£ +°ú¿ô¤ò¾Êά¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +Îã¤È¤·¤Æ¡¢BIOS ¤¬Ìµ¸ú¤Ë¤µ¤ì¤¿ (¤¢¤ë¤¤¤Ïºï½ü¤µ¤ì¤¿) +WD1002 ¥³¥ó¥È¥í¡¼¥é¤Î¾ì¹ç¤ò¼¨¤¹ +(¥Ñ¥é¥á¡¼¥¿¤Ë¤Ï XT ¥³¥ó¥È¥í¡¼¥é¤Î¡Ö¥Ç¥Õ¥©¥ë¥È¡×¤ÎÃͤò»È¤Ã¤Æ¤¤¤ë)¡£ +.IP +xd=2,5,0x320,3 +.TP +.B Syquest À½ EZ* ¥ê¥à¡¼¥Ð¥Ö¥ë¥Ç¥£¥¹¥¯ +.IP +.BI ez= iobase[,irq[,rep[,nybble]]] +.SS "IBM MCA ¥Ð¥¹¾å¤Î¥Ç¥Ð¥¤¥¹" +.I /usr/src/linux/Documentation/mca.txt +¤â»²¾È¤»¤è¡£ +.TP +.B PS/2 ESDI ¥Ï¡¼¥É¥Ç¥£¥¹¥¯ +˾¤à¥¸¥ª¥á¥È¥ê¤òµ¯Æ°»þ¤Ë»ØÄê¤Ç¤­¤ë¡£ +.IP +.BI ed= cyls,heads,sectors. +.IP +ThinkPad-720 ¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤òÄɲ乤뤳¤È¡£ +.IP +.B tp720=1 +.TP +.B IBM Microchannel SCSI ¥µ¥Ö¥·¥¹¥Æ¥à¤ÎÀßÄê +.IP +.BI ibmmcascsi= N +.IP +N ¤Ï¥µ¥Ö¥·¥¹¥Æ¥à¤Î \fIpun\fP (SCSI ID) ¤òɽ¤¹¡£ +.TP +.B Aztech ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +¤³¤Î¥¿¥¤¥×¤Î¥«¡¼¥É¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +aztcd=iobase[,magic_number] +.IP +magic_number ¤Ë 0x79 ¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢ +¥É¥é¥¤¥Ð¤Ï¥Õ¥¡¡¼¥à¥¦¥§¥¢¤Î¥Ð¡¼¥¸¥ç¥ó¤¬Ê¬¤«¤é¤Ê¤¤¾ì¹ç¤Ç¤â¡¢ +¤È¤Ë¤«¤¯¼Â¹Ô¤ò»î¤ß¤ë¡£ +¤½¤Î¾¤ÎÃͤϤ¹¤Ù¤Æ̵»ë¤µ¤ì¤ë¡£ +.TP +.B "¥Ñ¥é¥ì¥ë¥Ý¡¼¥È CD-ROM ¥É¥é¥¤¥Ö" +½ñ¼°: +.IP +pcd.driveN=port,pro,uni,mod,slv,dly +.br +pcd.nice=nice +.IP +¤³¤³¤Ç 'port' ¤Ï¥Ù¡¼¥¹¥¢¥É¥ì¥¹¡¢'pro' +¤Ï¥×¥í¥È¥³¥ëÈֹ桢'uni' ¤Ï¥æ¥Ë¥Ã¥È¥»¥ì¥¯¥¿ +(¥Á¥§¥¤¥ó¥Ç¥Ð¥¤¥¹ÍÑ)¡¢'mod' ¤Ï¥â¡¼¥É +(¤¢¤ë¤¤¤Ï¼«Æ°Åª¤ËºÇŬ¤Î¤â¤Î¤òÁª¤Ð¤»¤ë¤Ë¤Ï \-1)¡¢'slv' +¤Ï¥¹¥ì¡¼¥Ö¤Ë¤·¤¿¤¤¾ì¹ç¤Ë 1¡¢'dly' +¤Ï¥Ý¡¼¥È¥¢¥¯¥»¥¹¤òÃÙ¤¯¤·¤¿¤¤¾ì¹ç¤Ë¾®¤µ¤ÊÀ°¿ô¤òÍ¿¤¨¤ë¡£'nice' ¥Ñ¥é¥á¡¼¥¿¤Ï¡¢ +¥É¥é¥¤¥Ð¤Î¥¢¥¤¥É¥ë CPU »þ´Ö¤Î»È¤¤Êý¤òÀ©¸æ¤¹¤ë¡£ +¤¿¤À¤·Â®Å٤Ϥ¢¤ëÄøÅÙÄã²¼¤¹¤ë¡£ +.TP +.B Sony À½ CDU-31A ¤È CDU-33A ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +¤³¤Î CD-ROM ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï¡¢ +Pro Audio Spectrum ¥µ¥¦¥ó¥É¥«¡¼¥É¤Î°ìÉô¤ä +¥½¥Ë¡¼¤¬¶¡µë¤¹¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥«¡¼¥É¤Ç»È¤ï¤ì¤Æ¤¤¤ë¡£ +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +cdu31a=iobase,[irq[,is_pas_card]] +.IP +IRQ ¤Ë 0 ¤ò»ØÄꤹ¤ë¤È¡¢ +¥Ï¡¼¥É¥¦¥§¥¢³ä¤ê¹þ¤ß¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë +(PAS ¥«¡¼¥É¤Ë¤Ï¤½¤Î¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ë)¡£ +»ÈÍѤ¹¤ë¥«¡¼¥É¤¬³ä¤ê¹þ¤ß¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤Ê¤é¡¢ +¥É¥é¥¤¥Ð¤Ë¤è¤ë CPU ¤ÎÉé²Ù¤ò¸º¤é¤¹¤¿¤á¤Ë¤â³ä¤ê¹þ¤ß¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +.I is_pas_card +¤Ë¤Ï¡¢Pro Audio Spectrum ¥«¡¼¥É¤ò»ÈÍѤ·¤Æ¤¤¤ë¤È¤­¤Ë¤Ï 'PAS' ¤ò»ØÄꤷ¡¢ +¤½¤¦¤Ç¤Ê¤¤¤È¤­¤Ë¤Ï¤Ê¤Ë¤â»ØÄꤷ¤Ê¤¤¡£ +.TP +.B Sony À½ CDU-535 ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +¤³¤Î CD-ROM ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +sonycd535=iobase[,irq] +.IP +IRQ ¤ÎÃͤÀ¤±¤ò»ØÄꤷ¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +iobase Ãͤò 0 ¤È¤¹¤ì¤Ðñ¤Ê¤ë·êËä¤á¤È²ò¼á¤µ¤ì¤ë¡£ +.TP +.B GoldStar ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +¤³¤Î CD-ROM ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +gscd=iobase +.TP +.B ISP16 CD-ROM ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +½ñ¼°: +.IP +isp16=[iobase[,irq[,dma[,type]]]] +.IP +(À°¿ôÃÍ 3 ¤Ä¤Èʸ»úÎó 1 ¤Ä¡£) type ¤Ë 'noisp16' ¤ò»ØÄꤹ¤ë¤È¡¢ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÎÀßÄê¤Ï¹Ô¤Ê¤ï¤ì¤Ê¤¤¡£ +type ¤Ë¤Ï¤³¤Î¾¤Ë¤â 'Sanyo', 'Sony', 'Panasonic', 'Mitsumi' ¤¬»ØÄê¤Ç¤­¤ë¡£ +.TP +.B Mitsumi ɸ½à¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +¤³¤ÎCD-ROM ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +mcd=iobase,[irq[,wait_value]] +.IP +.I wait_value +¤Ï¥É¥é¥¤¥Ö¤ËÌäÂ꤬¤¢¤ë¾ì¹ç¤Ë¡¢ +¥É¥é¥¤¥ÐÆâÉô¤Î¥¿¥¤¥à¥¢¥¦¥È¤Î»ØÄê¤ËÍѤ¤¤ë¡£ +¥³¥ó¥Ñ¥¤¥ë»þ¤Î #define ¤Ë¤è¤Ã¤Æ¼ÂÁõ¤µ¤ì¤ë¤«¤µ¤ì¤Ê¤¤¤«¤¬·è¤Þ¤ë¡£ +Mitsumi FX400 ¤Ï IDE/ATAPI CD-ROM ¥×¥ì¥¤¥ä¡¼¤Ç¤¢¤ê¡¢ +¤³¤Î mcd ¥É¥é¥¤¥Ð¤Ï»ÈÍѤ·¤Ê¤¤¡£ +.TP +.B Mitsumi XA/¥Þ¥ë¥Á¥»¥Ã¥·¥ç¥ó¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +¤³¤ì¤Ï¾åµ­¤ÈƱ¤¸¥Ï¡¼¥É¥¦¥§¥¢¤À¤¬¡¢³ÈÄ¥µ¡Ç½¤¬¤¢¤ë¡£ +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +mcdx=iobase[,irq] +.TP +.B Optics ¥¹¥È¥ì¡¼¥¸¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +¤³¤Î¥«¡¼¥É¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +optcd=iobase +.TP +.B Phillips CM206 ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +¤³¤Î¥«¡¼¥É¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +cm206=[iobase][,irq] +.IP +¥É¥é¥¤¥Ð¤Ï IRQ ÃͤȤ·¤Æ 3 ¤«¤é 11 ¤Þ¤Ç¡¢ +I/O ¥Ý¡¼¥È¥¢¥É¥ì¥¹¤ÎÃͤȤ·¤Æ 0x300 ¤«¤é 0x370 ¤òÁÛÄꤷ¤Æ¤¤¤ë¡£ +¤¤¤º¤ì¤«°ìÊý¡¢¤¢¤ë¤¤¤ÏξÊý¤ò»ØÄê¤Ç¤­¤ë¡£½çÈÖ¤âÌä¤ï¤Ê¤¤¡£ +\&'cm206=auto' ¤È¤¹¤ë¤³¤È¤Ë¤è¤ê¼«Æ°¸¡½Ð¤â¤Ç¤­¤ë¡£ +.TP +.B Sanyo ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +¤³¤Î¥«¡¼¥É¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +sjcd=iobase[,irq[,dma_channel]] +.TP +.B SoundBlaster Pro ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +¤³¤Î¥«¡¼¥É¤Î¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +sbpcd=iobase,type +.IP +type ÃÍ¤Ë¤Ï 'SoundBlaster', 'LaserMate', 'SPEA' ¤Î¤¦¤Á¤Ò¤È¤Ä¤ò»ØÄê¤Ç¤­¤ë +(Âçʸ»ú¾®Ê¸»ú¤¬¶èÊ̤µ¤ì¤ë)¡£ +iobase ¤Ï CD-ROM ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÎÃͤǤ¢¤ë¡£ +¥«¡¼¥É¤Î¥µ¥¦¥ó¥ÉÉô¤ÎÃͤȴְ㤨¤Ê¤¤¤³¤È¡£ +.SS "¥¤¡¼¥µ¥Í¥Ã¥È¥Ç¥Ð¥¤¥¹" +¥É¥é¥¤¥Ð¤¬°Û¤Ê¤ë¤ÈÍѤ¤¤ë¥Ñ¥é¥á¡¼¥¿¤â°Û¤Ê¤ë¤¬¡¢ +¤¹¤Ù¤Æ¤Î¥É¥é¥¤¥Ð¤Ï¡¢¾¯¤Ê¤¯¤È¤â³ä¤ê¹þ¤ßÈÖ¹æ (irq)¡¢ +I/O ¥Ý¡¼¥È¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹ (iobase)¡¢Ì¾Á° (name) ¤ò»ý¤Ä¡£ +ºÇ¤â°ìÈÌŪ¤Ê·Á¼°¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +ether=irq,iobase[,param_1[,...param_8]],name +.IP +ºÇ½é¤Î¿ô»ú¤Ç¤Ê¤¤ÃͤÏ̾Á°¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£ +param_n ¤ÎÃͤϥ«¡¼¥É (¥É¥é¥¤¥Ð) ¤´¤È¤Ë°Û¤Ê¤ë°ÕÌ£¤ò»ý¤Ä¡£ +¤è¤¯¤¢¤ëÌÜŪ¤Ï¡¢¶¦Í­¥á¥â¥ê¥¢¥É¥ì¥¹¤Î»ØÄê¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÎÁªÂò¡¢ +DMA ¥Á¥ã¥Í¥ë¤Ê¤É¤Ç¤¢¤ë¡£ + +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤ÎºÇ¤â¤è¤¯¤¢¤ëÍøÍÑË¡¤Ï¡¢ +2 ÈÖÌܤΠEthernet ¥«¡¼¥É¤ò¶¯À©Åª¤Ë¸¡½Ð¤µ¤»¤ë¾ì¹ç¤Ç¤¢¤ë +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 1 Ë礷¤«¸¡½Ð¤·¤Ê¤¤)¡£ +¤³¤ì¤Ï´Êñ¤Ç¡¢¼¡¤Î¤è¤¦¤Ë¤¹¤ì¤Ð¤è¤¤¡£ +.IP +ether=0,0,eth1 +.IP +¤³¤ÎÎã¤Ç IRQ ¤È I/O ¥Ù¡¼¥¹¥¢¥É¥ì¥¹¤Ë 0 ¤ò»ØÄꤷ¤Æ¤¤¤ë¤Î¤Ï¡¢ +¥É¥é¥¤¥Ð¤Ë¼«Æ°¸¡½Ð¤ò¤¹¤ë¤è¤¦ÅÁ¤¨¤Æ¤¤¤ë¤Î¤Ç¤¢¤ë¡£ + +Ethernet-HOWTO ¤Ç¤Ï¡¢Ê£¿ô¤Î¥«¡¼¥É¤ò»È¤¦¤ä¤êÊý¤ä¡¢ +¥«¡¼¥É¤ä¥É¥é¥¤¥Ð¤ËÆÃÍ­¤Î param_n ÃͤΰÕÌ£¤Ë¤Ä¤¤¤Æ¡¢ +¤º¤Ã¤È¾ÜºÙ¤Ë²òÀ⤵¤ì¤Æ¤¤¤ë¡£ +¶½Ì£¤ò»ý¤Ã¤¿ÆɼԤϡ¢¤³¤Îʸ½ñ¤Ë¤¢¤¿¤ê¡¢ +¼«Ê¬¤Î¥«¡¼¥É¤Ë´Ø¤·¤Æ½ñ¤«¤ì¤Æ¤¤¤ë¥»¥¯¥·¥ç¥ó¤ò»²¾È¤¹¤ë¤ÈÎɤ¤¡£ +.SS ¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ð +¥Õ¥í¥Ã¥Ô¡¼¥É¥é¥¤¥Ð¤Î¥ª¥×¥·¥ç¥ó¤Ï¿¿ô¤¢¤ê¡¢ +¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.I Documentation/floppy.txt +(¸Å¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï +.IR drivers/block/README.fd ) +¤Ë¤¹¤Ù¤Æµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +°Ê²¼¤Î¾ðÊó¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤«¤é¤È¤Ã¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.B "floppy=mask,allowed_drive_mask" +»È¤Ã¤Æ¤è¤¤¥É¥é¥¤¥Ö¤Ë¤«¤±¤ë¥Ó¥Ã¥È¥Þ¥¹¥¯¤òÀßÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ +¥æ¥Ë¥Ã¥È 0 ¤È 1 ¤Î¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¤À¤±¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¡¢É¸½à¤Ç¤Ê¤¤¥Ï¡¼¥É¥¦¥§¥¢ (Î㤨¤Ð ASUS ¤Î PCI¥Þ¥¶¡¼¥Ü¡¼¥É¤Ê¤É) +¤Ç¥æ¥Ë¥Ã¥È 2 ¤ä 3 ¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤È¡¢ +¥­¡¼¥Ü¡¼¥É¤¬¤ª¤«¤·¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤«¤é¤Ç¤¢¤ë¡£ +cmos ¥ª¥×¥·¥ç¥ó (¸å½Ò) ¤ÎƳÆþ¤Ë¤è¤Ã¤Æ¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¢¤Þ¤ê»È¤ï¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£ +.TP +.B "floppy=all_drives" +µö²Ä¤¹¤ë¥É¥é¥¤¥Ö¤ò¼¨¤¹¥Ó¥Ã¥È¥Þ¥¹¥¯¤ò¡¢¡Ö¤¹¤Ù¤Æ¤Î¥É¥é¥¤¥Ö¡×¤Ë¤¹¤ë¡£ +1 ¤Ä¤Î¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¤Ë 2 Âæ°Ê¾å¤Î¥É¥é¥¤¥Ö¤òÀܳ¤¹¤ë¾ì¹ç¤ËÍѤ¤¤ë¡£ +.TP +.B "floppy=asus_pci" +¥æ¥Ë¥Ã¥È 0 ¤È 1 ¤Î¤ß¤òµö²Ä¤¹¤ë¤è¤¦¥Ó¥Ã¥È¥Þ¥¹¥¯¤òÀßÄꤹ¤ë¡£ +(¥Ç¥Õ¥©¥ë¥È)¡£ +.TP +.B "floppy=daring" +Àµ¤·¤¯¿¶¤ëÉñ¤¦¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¤ò»È¤Ã¤Æ¤¤¤ë¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤ÈÆ°ºî¤Ï¤è¤ê¸úΨŪ¤«¤Ä¥¹¥à¡¼¥¹¤Ë¤Ê¤ë¤¬¡¢ +¥³¥ó¥È¥í¡¼¥é¤Ë¤è¤Ã¤Æ¤ÏÆ°ºî¤Ë¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +¤³¤ì¤ò»ØÄꤹ¤ë¤È¤¢¤ë¼ï¤ÎÆ°ºî¤¬¹â®¤Ë¤Ê¤ë¡£ +.TP +.B "floppy=0,daring" +Ãí°Õ¤·¤Æ°·¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¤Ç¤¢¤ë¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +.TP +.B "floppy=one_fdc" +¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¤¬¤Ò¤È¤Ä¤·¤«¤Ê¤¤¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë +(¥Ç¥Õ¥©¥ë¥È)¡£ +.TP +.BR floppy=two_fdc " ¤Þ¤¿¤Ï " floppy=address,two_fdc +¥Õ¥í¥Ã¥Ô¡¼¥³¥ó¥È¥í¡¼¥é¤¬¤Õ¤¿¤Ä¤¢¤ë¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +2 ÈÖÌܤΥ³¥ó¥È¥í¡¼¥é¤Î I/O ¥¢¥É¥ì¥¹¤Ï address ¤Ç»ØÄꤹ¤ë¡£ +address ¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï 0x370 ¤¬»È¤ï¤ì¤ë¡£ +.TP +.B "floppy=thinkpad" +Thinkpad ¤ò»È¤Ã¤Æ¤¤¤ë¤³¤È¤ò¥Õ¥í¥Ã¥Ô¡¼¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +Thinkpad ¤Ï¥Ç¥£¥¹¥¯¼è½Ð¤Î¸¡½Ð¿®¹æ¤òȿž¤·¤Æ»È¤Ã¤Æ¤¤¤ë¡£ +.TP +.B "floppy=0,thinkpad" +Thinkpad ¤ò»È¤Ã¤Æ¤¤¤Ê¤¤¤³¤È¤ò¥É¥é¥¤¥Ð¤ËÅÁ¤¨¤ë¡£ +.TP +.B "floppy=drive,type,cmos" +¥É¥é¥¤¥Ö¤Î cmos ¥¿¥¤¥×¤ò type ¤ËÀßÄꤹ¤ë¡£ +¤µ¤é¤Ë¥Ó¥Ã¥È¥Þ¥¹¥¯¤òÊѹ¹¤·¡¢¤³¤Î¥É¥é¥¤¥Ö¤Î»ÈÍѤòµö²Ä¤¹¤ë¡£ +¤³¤Î»ØÄ꤬ÊØÍø¤Ê¤Î¤Ï¡¢¥Õ¥í¥Ã¥Ô¡¼¥É¥é¥¤¥Ö¤¬ 2 Âæ°Ê¾å¤¢¤ë¾ì¹ç +(ʪÍý cmos ¤Ëµ­½Ò¤Ç¤­¤ë¤Î¤Ï 2 Âæ¤Þ¤Ç) ¤ä¡¢ +BIOS ¤¬É¸½àŪ¤Ç¤Ê¤¤ CMOS ¥¿¥¤¥×¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤ë¡£ +ºÇ½é¤Î 2 Âæ¤Î¥É¥é¥¤¥Ö¤Î CMOS ¤Ë 0 ¤ò»ØÄꤹ¤ë (¥Ç¥Õ¥©¥ë¥È) ¤È¡¢ +¥Õ¥í¥Ã¥Ô¡¼¥É¥é¥¤¥Ð¤Ï¤³¤ì¤é¤Î¥É¥é¥¤¥Ö¤ÎʪÍý cmos ¤ò»²¾È¤¹¤ë¡£ +.TP +.B "floppy=unexpected_interrupts" +ͽ´ü¤·¤Ê¤¤³ä¤ê¹þ¤ß¤ò¼õ¤±¤¿»þ¤Ë·Ù¹ð¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë (¥Ç¥Õ¥©¥ë¥È)¡£ +.TP +.BR floppy=no_unexpected_interrupts " ¤Þ¤¿¤Ï " floppy=L40SX +ͽ´ü¤·¤Ê¤¤³ä¤ê¹þ¤ß¤ò¼õ¤±¤¿»þ¤Ç¤â·Ù¹ð¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Ê¤¤¡£ +¤³¤ì¤Ï IBM L40SX ¥é¥Ã¥×¥È¥Ã¥×¥³¥ó¥Ô¥å¡¼¥¿¤ò +ÆÃÄê¤Î¥Ó¥Ç¥ª¥â¡¼¥É¤Ç»ÈÍѤ¹¤ë»þ¤ËɬÍפȤʤ롣 +(¥Ó¥Ç¥ª¤È¥Õ¥í¥Ã¥Ô¡¼¤È¤Î´Ö¤Ç²¿¤é¤«¤ÎÁê¸ßºîÍѤ¬¤¢¤ë¤è¤¦¤À¡£ +ͽ´ü¤·¤Ê¤¤³ä¤ê¹þ¤ß¤ÏÀ­Ç½¤À¤±¤Ë±Æ¶Á¤·¡¢Ìµ»ë¤·¤Æ¤â°ÂÁ´¤Ç¤¢¤ë¡£) +.SS ¥µ¥¦¥ó¥É¥É¥é¥¤¥Ð +¥µ¥¦¥ó¥É¥É¥é¥¤¥Ð¤âµ¯Æ°»þ°ú¿ô¤ò¼õ¤±ÉÕ¤±¡¢ +¥³¥ó¥Ñ¥¤¥ë»þ¤Ë»ØÄꤵ¤ì¤¿ÃͤòÊѹ¹¤Ç¤­¤ë¡£ +¤³¤ì¤Ï¤ä¤äÌÌÅݤʤ¿¤á¡¢¤¢¤Þ¤ê¤ªÁ¦¤á¤Ç¤­¤Ê¤¤¡£ +¾ÜºÙ¤Ï¡¢¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.IR Documentation/sound/oss/README.OSS +(¸Å¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï +.IR drivers/sound/Readme.linux ) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +°ú¿ô¤Î·Á¼°¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +sound=device1[,device2[,device3...[,device10]]] +.IP +³Æ deviceN ¤Ï¤½¤ì¤¾¤ì 0xTaaaId ¤È¤¤¤¦·Á¼°¤Ç»ØÄꤹ¤ë¡£ +³Æ¥Ð¥¤¥È¤Î°ÕÌ£¤Ï°Ê²¼¤ÎÄ̤ꡣ + +T \- ¥Ç¥Ð¥¤¥¹¤Î¥¿¥¤¥×: 1=FM, 2=SB, 3=PAS, 4=GUS, 5=MPU401, 6=SB16, 7=SB16-MPU401 + +aaa \- I/O ¥Ý¡¼¥È¥¢¥É¥ì¥¹ (16¿ÊÃÍ) + +I \- ³ä¤ê¹þ¤ßÈÖ¹æ (16 ¿ÊÃÍ¡£Îã: 10=a, 11=b, ...) + +d \- DMA ¥Á¥ã¥Í¥ë + +¾åµ­¤ÎÄ̤ꡢ¤«¤Ê¤ê°·¤¤¤Ë¤¯¤¤·Á¼°¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢ +¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¼«Ê¬¤Ë¤¢¤Ã¤¿Ãͤò»ØÄꤹ¤ëÊý¤¬Îɤ¤¤À¤í¤¦¡£ +¤Ê¤ªµ¯Æ°»þ°ú¿ô¤È¤·¤Æ 'sound=0' ¤ò»ØÄꤹ¤ë¤È¡¢ +¥µ¥¦¥ó¥É¥É¥é¥¤¥Ð¤ò´°Á´¤Ë̵¸ú¤Ë¤¹¤ë¡£ +.SS "ISDN ¥É¥é¥¤¥Ð" +.TP +.B ICN ISDN ¥É¥é¥¤¥Ð +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +icn=iobase,membase,icn_id1,icn_id2 +.IP +icn_id1,icn_id2 ¤Ï¥«¡¼¥É¤ò¼±Ê̤¹¤ë¤¿¤á¤Î 2 ¤Ä¤Îʸ»úÎó¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë¥á¥Ã¥»¡¼¥¸¤ÇÍѤ¤¤é¤ì¤ë¡£ +.TP +.B PCBIT ISDN ¥É¥é¥¤¥Ð +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +pcbit=membase1,irq1[,membase2,irq2] +.IP +membaseN ¤Ï N ÈÖÌܤΥ«¡¼¥É¤Î¶¦Í­¥á¥â¥ê¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹¤Ç¤¢¤ê¡¢ +irqN ¤Ï N ÈÖÌܤΥ«¡¼¥É¤Î³ä¤ê¹þ¤ßÀßÄê¤Ç¤¢¤ë¡£ +̵»ØÄê»þ¤Ë¤Ï IRQ = 5, membase = 0xD0000 ¤È¤Ê¤ë¡£ +.TP +.B Teles ISDN ¥É¥é¥¤¥Ð +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +teles=iobase,irq,membase,protocol,teles_id +.IP +iobase ¤Ï¥«¡¼¥É¤Î I/O ¥Ý¡¼¥È¥¢¥É¥ì¥¹¡¢ +membase ¤Ï¥«¡¼¥É¤Î¶¦Í­¥á¥â¥ê¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹¡¢ +¤½¤·¤Æ irq ¤Ï¥«¡¼¥É¤¬»ÈÍѤ¹¤ë³ä¤ê¹þ¤ß¥Á¥ã¥Í¥ë¤Ç¤¢¤ë¡£ +teles_id ¤Ï¥¢¥¹¥­¡¼Ê¸»úÎó¤Ë¤è¤ë¼±ÊÌʸ»úÎó¤Ç¤¢¤ë (¾¤È½Å¤Ê¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤ë)¡£ +.SS ¥·¥ê¥¢¥ë¥Ý¡¼¥È¥É¥é¥¤¥Ð +.TP +.B RISCom/8 ¥Þ¥ë¥Á¥Ý¡¼¥È¥·¥ê¥¢¥ë¥É¥é¥¤¥Ð ('riscom8=') +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +riscom=iobase1[,iobase2[,iobase3[,iobase4]]] +.IP +¾ÜºÙ¤Ï +.I /usr/src/linux/Documentation/riscom8.txt +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B DigiBoard ¥É¥é¥¤¥Ð ('digi=') +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤¦¾ì¹ç¤Ï¡¢ +6 ¤Ä¤Á¤ç¤¦¤É¤Î¥Ñ¥é¥á¡¼¥¿¤òÍ¿¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +digi=status,type,altpin,numports,iobase,membase +.IP +¥Ñ¥é¥á¡¼¥¿¤ÏÀ°¿ôÃͤ«Ê¸»úÎó¤ÇÍ¿¤¨¤ë¡£ +ʸ»úÎó¤Ç»ØÄꤹ¤ë¾ì¹ç¤Ï¡¢ +iobase ¤È membase ¤Ï 16 ¿ÊÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +À°¿ôÃͤǻØÄꤹ¤ë¾ì¹ç¤Ï¥Ñ¥é¥á¡¼¥¿¤Î¸Ä¿ô¤Ï¾¯¤Ê¤¯¤Æ¤âÎɤ¯¡¢½ç¤Ë: +status ¤³¤Î¥«¡¼¥É¤ÎÆ°ºî¤ò»ØÄꤹ¤ë (Enable(1) ¤Þ¤¿¤Ï Disable(0)), +type ¥«¡¼¥É¤Î¥¿¥¤¥× (PC/Xi(0), PC/Xe(1), PC/Xeve(2), PC/Xem(3)), +altpin ¥Ô¥óÇÛÃÖ¤òȿž¤µ¤»¤ë (Enable(1) or Disable(0)), +numports ¥«¡¼¥É¤Î¥Ý¡¼¥ÈÈÖ¹æ, +iobase ¤³¤Î¥«¡¼¥É¤Î I/O ¥Ý¡¼¥È (ʸ»úÎó»ØÄê¤Î¾ì¹ç¤Ï 16 ¿Êɽµ­), +membase ¥á¥â¥ê¥¦¥£¥ó¥É¥¦¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹ (ʸ»úÎó»ØÄê¤Î¾ì¹ç¤Ï 16 ¿Êɽµ­)¡£ +¤·¤¿¤¬¤Ã¤Æ°Ê²¼¤Î¤Õ¤¿¤Ä¤Îµ¯Æ°»þ°ú¿ô¤ÏƱ¤¸°ÕÌ£¤ò»ý¤Ä¡£ +.IP +digi=E,PC/Xi,D,16,200,D0000 +.br +digi=1,0,0,16,0x200,851968 +.IP +¾ÜºÙ¤Ï +.I /usr/src/linux/Documentation/digiboard.txt +¤ò»²¾È¤»¤è¡£ +.TP +.B Baycom ¥·¥ê¥¢¥ë¡¦¥Ñ¥é¥ì¥ë ¥é¥¸¥ª¥â¥Ç¥à +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +baycom=iobase,irq,modem +.IP +¤Á¤ç¤¦¤É 3 ¤Ä¤Î¥Ñ¥é¥á¡¼¥¿¤òÍ¿¤¨¤ë¡£ +Ê£¿ô¤Î¥«¡¼¥É¤¬¤¢¤ë¾ì¹ç¤Ï¡¢'baycom=' ¥³¥Þ¥ó¥É¤âÊ£¿ôµ­½Ò¤¹¤ë¡£ +modem ¥Ñ¥é¥á¡¼¥¿¤Ïʸ»úÎó¤Ç¡¢ +ser12, ser12*, par96, par96* ¤ÎÃ椫¤é¤Ò¤È¤Ä¤òÁª¤Ö¡£ +* ¤ò¤Ä¤±¤ë¤È¥½¥Õ¥È¥¦¥§¥¢ DCD ¤ò»ÈÍѤ¹¤ë¡£ +¥â¥Ç¥à¤Î¼ïÎà¤Ë±þ¤¸¤Æ ser12 ¤« par96 ¤«¤òÁªÂò¤¹¤ë¡£ +¾ÜºÙ¤Ï¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.I Documentation/networking/baycom.txt +(¸Å¤¤¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï +.IR drivers/net/README.baycom ) +¤ò»²¾È¡£ +.TP +.B ¥µ¥¦¥ó¥É¥«¡¼¥É¥é¥¸¥ª¥â¥Ç¥à¥É¥é¥¤¥Ð +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +soundmodem=iobase,irq,dma[,dma2[,serio[,pario]]],0,mode +.IP +ºÇ¸å¤Î¥Ñ¥é¥á¡¼¥¿¤ò½ü¤¯¤¹¤Ù¤Æ¤Î¥Ñ¥é¥á¡¼¥¿¤ÏÀ°¿ô¤Ç¤¢¤ë¡£ +¥À¥ß¡¼¤Î 0 ¤¬¤¢¤ë¤Î¤Ï¡¢ÀßÄê¥×¥í¥°¥é¥à¤Î¥Ð¥°¤Î¤»¤¤¤Ç¤¢¤ë¡£ +mode ¥Ñ¥é¥á¡¼¥¿¤Ïʸ»úÎó¤Ç¡¢hw:modem ¤È¤¤¤¦½ñ¼°¤Ç»ØÄꤹ¤ë¡£ +hw ¤Ï sbc, wss, wssfdx ¤Î¤¦¤Á¤Ò¤È¤Ä¡¢ +modem ¤Ï afsk1200, fsk9600 ¤Î¤É¤Á¤é¤«¤òÁªÂò¤·¤Æµ­½Ò¤¹¤ë¡£ +.\" HERE GOES (NAKANO) +.SS ¥é¥¤¥ó¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð +.TP +.B "'lp='" +½ñ¼°: +.IP +lp=0 +.br +lp=auto +.br +lp=reset +.br +lp=port[,port...] +.IP +¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Ë¤Ï¡¢¤É¤Î¥Ý¡¼¥È¤ò»È¤¦¤«¡¢ +¤É¤Î¥Ý¡¼¥È¤ò»È¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¤«¤òÅÁ¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¸å¼Ô¤Ï¡¢ +ÍøÍѲÄǽ¤Ê¤¢¤é¤æ¤ë¥Ñ¥é¥ì¥ë¥Ý¡¼¥È¤ò¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤¬Í׵ᤷ¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¡¢ +¾¤Î¥É¥é¥¤¥Ð (PLIP ¤ä PPA ¤Ê¤É) ¤«¤é +¤½¤ì¤é¤ò»È¤¨¤ë¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ + +°ú¿ô¤Î½ñ¼°¤Ï¡¢Ê£¿ô¤Î¥Ý¡¼¥È̾¤Ç¤¢¤ë¡£ +Î㤨¤Ð lp=none,parport0 ¤È¤¹¤ë¤È¡¢ +ºÇ½é¤Î¥Ñ¥é¥ì¥ë¥Ý¡¼¥È¤ò lp1 ¤È¤·¤Æ»È¤¤¡¢ +lp0 ¤Ï̵¸ú¤Ë¤¹¤ë¡£¥×¥ê¥ó¥¿¡¼¥É¥é¥¤¥Ð¤ò´°Á´¤Ë̵¸ú¤Ë¤¹¤ë¤Ë¤Ï +lp=0 ¤È¤¹¤ì¤Ð¤è¤¤¡£ +.TP +.B WDT500/501 ¥É¥é¥¤¥Ð +¹½Ê¸¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IP +wdt=io,irq +.SS ¥Þ¥¦¥¹¥É¥é¥¤¥Ð +.TP +.B "'bmouse=irq'" +¥Ð¥¹¥Þ¥¦¥¹¥É¥é¥¤¥Ð¤Ï¥Ñ¥é¥á¡¼¥¿¤ò¤Ò¤È¤Ä¤À¤±¤È¤ê¡¢ +¥Ï¡¼¥É¥¦¥§¥¢ IRQ ¤ò»ØÄê¤Ç¤­¤ë¡£ +.TP +.B "'msmouse=irq'" +msmouse ¥É¥é¥¤¥Ð¤Ç¤â¤³¤Î»ö¾ð¤Ï¤Þ¤Ã¤¿¤¯Æ±¤¸¤Ç¤¢¤ë¡£ +.TP +.B ATARI ¥Þ¥¦¥¹¤ÎÀßÄê +.IP +atamouse=threshold[,y-threshold] +.IP +¥Ñ¥é¥á¡¼¥¿¤¬¤Ò¤È¤Ä¤À¤±Í¿¤¨¤é¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +x-threshold ¤È y-threshold ¤òξÊý¤ËÍѤ¤¤é¤ì¤ë¡£ +¤Õ¤¿¤ÄÍ¿¤¨¤é¤ì¤¿¾ì¹ç¤Ï¡¢ºÇ½é¤ÎÃͤ¬ x-threshold ¤È¤·¤ÆÍѤ¤¤é¤ì¡¢ +2 ÈÖÌܤÎÃͤ¬ y-threshold ¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ +ÃÍ¤Ï 1 ¤«¤é 20 ¤Þ¤Ç¤Î¿ôÃͤǻØÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 2¡£ +.SS ¥Ó¥Ç¥ªµ¡´ï +.TP +.B "'no-scroll'" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð¤Ë¡¢ +¥Ï¡¼¥É¥¦¥§¥¢¥¹¥¯¥í¡¼¥ë¤òÍѤ¤¤Ê¤¤¤è¤¦ÅÁ¤¨¤ë +(¤³¤³¤Ç¸À¤¦¥Ï¡¼¥É¥¦¥§¥¢¥¹¥¯¥í¡¼¥ë¤È¤Ï¡¢ +¥Ó¥Ç¥ª¥á¥â¥ê¾å¤Î¥Ç¡¼¥¿¤ò°ÜÆ°¤µ¤»¤ë¤³¤È¤Ë¤è¤Ã¤Æ +¥¹¥¯¥ê¡¼¥óɽ¼¨Îΰè¤ò¥¹¥¯¥í¡¼¥ë¤µ¤»¤ë¤³¤È¤ò»Ø¤¹)¡£ +ÆÃÄê¤ÎÅÀ»ú¥Þ¥·¥ó¤Ç¤Ï¤³¤Î»ØÄ꤬ɬÍפȤʤ롣 +.\" .SH Ãø¼Ô +.\" Linus Torvalds (¾¿¿ô) +.SH ´ØÏ¢¹àÌÜ +.BR lilo.conf (5), +.BR klogd (8), +.BR lilo (8), +.BR mount (8), +.BR rdev (8) + +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÂçÉôʬ¤Ï Paul Gortmaker ¤Ë¤è¤ë +Boot Parameter HOWTO (version 1.0.1) ¤ò´ð¤Ë¤·¤Æ¤¤¤ë¡£ +¤³¤Î (¤¢¤ë¤¤¤ÏºÇ¿·¤Î) HOWTO ¤ò¤¢¤¿¤ì¤Ð¡¢ +¤µ¤é¤Ë¿¤¯¤Î¾ðÊó¤¬Æþ¼ê¤Ç¤­¤ë¤À¤í¤¦¡£ +ºÇ¿·¤Î¾ðÊó¸»¤Ï +.I /usr/src/linux/Documentation/kernel-parameters.txt +¤Ç¤¢¤ë¡£ + +(ÌõÃí) Boot Parameter HOWTO ¤Ï¸½ºß BootPrompt-HOWTO ¤È¤·¤Æ +¥á¥ó¥Æ¥Ê¥ó¥¹¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ËÙ¹¾À¿°ì¤µ¤ó¤Ë¤è¤ëÆüËܸìÈǤϡ¢ +.UR http://www.linux.or.jp/JF/JFdocs/BootPrompt-HOWTO.html +http://www.linux.or.jp/JF/JFdocs/BootPrompt-HOWTO.html +.UE +¤Ë¤¢¤ê¤Þ¤¹¡£±Ñ¸ìÈÇ¥ª¥ê¥¸¥Ê¥ë¤Ï¡¢ +.UR http://linuxdoc.org/HOWTO/BootPrompt-HOWTO.html +http://linuxdoc.org/HOWTO/BootPrompt-HOWTO.html +.UE +¤Ë¤¢¤ê¤Þ¤¹¡£ +¤¬¡¢¤¤¤º¤ì¤â May 1999 ¤Þ¤Ç¤Î¤â¤Î¤Ê¤Î¤Ç¤ä¤ä¸Å¤¤¤Ç¤¹¡£ diff --git a/release/man7/capabilities.7 b/release/man7/capabilities.7 new file mode 100644 index 00000000..17d05291 --- /dev/null +++ b/release/man7/capabilities.7 @@ -0,0 +1,948 @@ +.\" Copyright (c) 2002 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. +.\" +.\" 6 Aug 2002 - Initial Creation +.\" Modified 2003-05-23, Michael Kerrisk, +.\" Modified 2004-05-27, Michael Kerrisk, +.\" 2004-12-08, mtk Added O_NOATIME for CAP_FOWNER +.\" 2005-08-16, mtk, Added CAP_AUDIT_CONTROL and CAP_AUDIT_WRITE +.\" 2008-07-15, Serge Hallyn +.\" Document file capabilities, per-process capability +.\" bounding set, changed semantics for CAP_SETPCAP, +.\" and other changes in 2.6.2[45]. +.\" Add CAP_MAC_ADMIN, CAP_MAC_OVERRIDE, CAP_SETFCAP. +.\" 2008-07-15, mtk +.\" Add text describing circumstances in which CAP_SETPCAP +.\" (theoretically) permits a thread to change the +.\" capability sets of another thread. +.\" Add section describing rules for programmatically +.\" adjusting thread capability sets. +.\" Describe rationale for capability bounding set. +.\" Document "securebits" flags. +.\" Add text noting that if we set the effective flag for one file +.\" capability, then we must also set the effective flag for all +.\" other capabilities where the permitted or inheritable bit is set. +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-03-09, Akihiro MOTOKI +.\" Updated 2005-11-04, Akihiro MOTOKI +.\" Updated 2006-04-16, Akihiro MOTOKI, LDP v2.29 +.\" Updated 2006-07-20, Akihiro MOTOKI, LDP v2.34 +.\" Updated 2007-01-05, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2008-12-24, Akihiro MOTOKI, LDP v3.15 +.\" Updated 2009-02-27, Akihiro MOTOKI, LDP v3.19 +.\" Updated 2010-04-11, Akihiro MOTOKI, LDP v3.24 +.\" +.TH CAPABILITIES 7 2010-01-31 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +capabilities \- Linux ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤Î³µÍ× +.SH ÀâÌÀ +¸¢¸Â¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦´ÑÅÀ¤«¤é¸«¤ë¤È¡¢ÅÁÅýŪ¤Ê Unix ¤Î¼ÂÁõ¤Ç¤Ï +¥×¥í¥»¥¹¤ÏÆó¤Ä¤Î¥«¥Æ¥´¥ê¤ËʬÎà¤Ç¤­¤ë: +.I Æø¢ +¥×¥í¥»¥¹ (¼Â¸ú¥æ¡¼¥¶ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¡£¥æ¡¼¥¶ID 0 ¤Ï +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤ä root ¤È¸Æ¤Ð¤ì¤ë) ¤È +.I ÈóÆø¢ +¥×¥í¥»¥¹ (¼Â¸ú¥æ¡¼¥¶ID ¤¬ 0 °Ê³°¤Î¥×¥í¥»¥¹) ¤Ç¤¢¤ë¡£ +ÈóÆø¢¥×¥í¥»¥¹¤Ç¤Ï¡¢¥×¥í¥»¥¹¤Î»ñ³Ê¾ðÊó (Ä̾ï¤Ï¡¢¼Â¸úUID ¡¢¼Â¸úGID +¤ÈÄɲäΥ°¥ë¡¼¥×¥ê¥¹¥È) ¤Ë´ð¤Å¤¯¸¢¸Â¥Á¥§¥Ã¥¯¤¬¹Ô¤ï¤ì¤ë¤Î¤ËÂФ·¡¢ +Æø¢¥×¥í¥»¥¹¤Ç¤ÏÁ´¤Æ¤Î¥«¡¼¥Í¥ë¤Î¸¢¸Â¥Á¥§¥Ã¥¯¤¬¥Ð¥¤¥Ñ¥¹¤µ¤ì¤ë¡£ + +¥Ð¡¼¥¸¥ç¥ó 2.2 °Ê¹ß¤Î Linux ¤Ç¤Ï¡¢ +¤³¤ì¤Þ¤Ç¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤­¤¿¸¢¸Â¤ò¡¢ +¤¤¤¯¤Ä¤«¤Î¥°¥ë¡¼¥×¤Ëʬ³ä¤·¤Æ¤¤¤ë¡£¤³¤ì¤é¤Î¥°¥ë¡¼¥×¤Ï +.IR ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) +¤È¸Æ¤Ð¤ì¡¢¥°¥ë¡¼¥×Ëè¤ËÆÈΩ¤ËÍ­¸ú¡¢Ìµ¸ú¤òÀßÄê¤Ç¤­¤ë¡£ +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï¥¹¥ì¥Ã¥Éñ°Ì¤Î°À­¤Ç¤¢¤ë¡£ +.\" +.SS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥ê¥¹¥È +°Ê²¼¤Î¥ê¥¹¥È¤Ï¡¢ +Linux ¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤È +³Æ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬µö²Ä¤¹¤ëÁàºî¤ÈÆ°ºî¤ò¤Þ¤È¤á¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.BR CAP_AUDIT_CONTROL " (Linux 2.6.11 °Ê¹ß)" +¥«¡¼¥Í¥ë´Æºº (audit) ¤ÎÍ­¸ú̵¸ú¤ÎÀÚ¤êÂؤ¨¡¢ +´Æºº¤Î¥Õ¥£¥ë¥¿¡¦¥ë¡¼¥ë¤ÎÊѹ¹¡¢ +´Æºº¤Î¾õ¶·¤ä¥Õ¥£¥ë¥¿¡¦¥ë¡¼¥ë¤Î¼èÆÀ¤¬¤Ç¤­¤ë¡£ +.TP +.BR CAP_AUDIT_WRITE " (Linux 2.6.11 °Ê¹ß)" +¥«¡¼¥Í¥ë´Æºº¤Î¥í¥°¤Ë¥ì¥³¡¼¥É¤ò½ñ¤­¹þ¤à¡£ +.TP +.B CAP_CHOWN +¥Õ¥¡¥¤¥ë¤Î UID ¤ÈGID ¤òǤ°Õ¤ËÊѹ¹¤¹¤ë +.RB ( chown (2) +»²¾È)¡£ +.TP +.B CAP_DAC_OVERRIDE +¥Õ¥¡¥¤¥ë¤ÎÆɤ߽Ф·¡¢½ñ¤­¹þ¤ß¡¢¼Â¹Ô¤Î¸¢¸Â¥Á¥§¥Ã¥¯¤ò¥Ð¥¤¥Ñ¥¹¤¹¤ë +(DAC ¤Ï "discretionary access control (Ǥ°Õ¤Î¥¢¥¯¥»¥¹À©¸æ)" ¤Îά¤Ç¤¢¤ë)¡£ +.TP +.B CAP_DAC_READ_SEARCH +¥Õ¥¡¥¤¥ë¤ÎÆɤ߽Ф·¸¢¸Â¤Î¥Á¥§¥Ã¥¯¤È¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆɤ߽Ф·¤È¼Â¹Ô +¤Î¸¢¸Â¥Á¥§¥Ã¥¯¤ò¥Ð¥¤¥Ñ¥¹¤¹¤ë¡£ +.TP +.B CAP_FOWNER +.PD 0 +.RS +.IP * 2 +Ä̾¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤¬¥Õ¥¡¥¤¥ë¤Î UID ¤Ë°ìÃפ¹¤ë¤³¤È¤¬ +Í׵ᤵ¤ì¤ëÁàºî (Î㤨¤Ð +.BR chmod (2), +.BR utime (2)) +¤Ë¤ª¤±¤ë¸¢¸Â¥Á¥§¥Ã¥¯¤ò¥Ð¥¤¥Ñ¥¹¤¹¤ë¡£ +⤷¡¢ +.B CAP_DAC_OVERRIDE +¤« +.B CAP_DAC_READ_SEARCH +¤Ë¤è¤ê¥Á¥§¥Ã¥¯¤¬¹Ô¤ï¤ì¤ëÁàºî¤Ï½ü¤¯¡£ +.IP * +Ǥ°Õ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ³ÈÄ¥¥Õ¥¡¥¤¥ë°À­¤òÀßÄꤹ¤ë +.RB ( chattr (1) +»²¾È)¡£ +.IP * +Ǥ°Õ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¥¢¥¯¥»¥¹À©¸æ¥ê¥¹¥È (ACL) ¤òÀßÄꤹ¤ë¡£ +.IP * +¥Õ¥¡¥¤¥ë¤Îºï½ü¤ÎºÝ¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥¹¥Æ¥£¥Ã¥­¡¼¥Ó¥Ã¥È¤ò̵»ë¤¹¤ë¡£ +.IP * +.BR open (2) +¤ä +.BR fcntl (2) +¤ÇǤ°Õ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +.B O_NOATIME +¤ò»ØÄꤹ¤ë¡£ +.RE +.PD +.TP +.B CAP_FSETID +¥Õ¥¡¥¤¥ë¤¬Êѹ¹¤µ¤ì¤¿¤È¤­¤Ë set-user-ID ¤Èset-group-ID ¤Îµö²Ä¥Ó¥Ã¥È¤ò¥¯¥ê¥¢ +¤·¤Ê¤¤¡£¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à GID ¤ÈÄɲäΠGID ¤Î¤¤¤º¤ì¤È¤â +GID ¤¬°ìÃפ·¤Ê¤¤¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ set-group-ID ¥Ó¥Ã¥È¤òÀßÄꤹ¤ë¡£ +.TP +.B CAP_IPC_LOCK +¥á¥â¥ê¡¼¤Î¥í¥Ã¥¯ +.RB ( mlock (2), +.BR mlockall (2), +.BR mmap (2), +.BR shmctl (2)) +¤ò¹Ô¤¦¡£ +.TP +.B CAP_IPC_OWNER +System V IPC ¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ¹¤ëÁàºî¤Ë´Ø¤·¤Æ¸¢¸Â¥Á¥§¥Ã¥¯¤ò¥Ð¥¤¥Ñ¥¹¤¹¤ë¡£ +.TP +.B CAP_KILL +¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ëºÝ¤Ë¸¢¸Â¥Á¥§¥Ã¥¯¤ò¥Ð¥¤¥Ñ¥¹¤¹¤ë +.RB ( kill (2) +»²¾È)¡£¤³¤ì¤Ë¤Ï +.BR ioctl (2) +¤Î +.B KDSIGACCEPT +Áàºî¤Î»ÈÍѤâ´Þ¤Þ¤ì¤ë¡£ +.\" FIXME CAP_KILL also has an effect for threads + setting child +.\" termination signal to other than SIGCHLD: without this +.\" capability, the termination signal reverts to SIGCHLD +.\" if the child does an exec(). What is the rationale +.\" for this? +.TP +.BR CAP_LEASE " (Linux 2.4 °Ê¹ß)" +Ǥ°Õ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +¥Õ¥¡¥¤¥ë¥ê¡¼¥¹¤òÀßÄꤹ¤ë +.RB ( fcntl (2) +»²¾È)¡£ +.TP +.B CAP_LINUX_IMMUTABLE +³ÈÄ¥¥Õ¥¡¥¤¥ë°À­ +.B FS_APPEND_FL +¤È +.B FS_IMMUTABLE_FL +¤òÀßÄꤹ¤ë +.RB ( chattr (1) +»²¾È)¡£ +.\" ¤³¤ì¤é¤Î°À­¤Ï ext2, ext3, Reiserfs, XFS, JFS ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.TP +.BR CAP_MAC_ADMIN " (Linux 2.6.25 °Ê¹ß)" +¶¯À©¥¢¥¯¥»¥¹À©¸æ (MAC) ¤ò¾å½ñ¤­¤¹¤ë¡£ +Smack Linux Security Module (LSM) ÍѤ˼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.BR CAP_MAC_OVERRIDE " (Linux 2.6.25 °Ê¹ß)" +MAC ¤ÎÀßÄê¤ä¾õÂÖ¤òÊѹ¹¤¹¤ë¡£ +Smack LSM ÍѤ˼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.BR CAP_MKNOD " (Linux 2.4 °Ê¹ß)" +(Linux 2.4 °Ê¹ß) +.BR mknod (2) +¤ò»ÈÍѤ·¤Æ¥¹¥Ú¥·¥ã¥ë¡¦¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¡£ +.TP +.B CAP_NET_ADMIN +³Æ¼ï¤Î¥Í¥Ã¥È¥ï¡¼¥¯´ØÏ¢¤ÎÁàºî¤ò¼Â¹Ô¤¹¤ë¡£ +(Î㤨¤Ð¡¢Æø¢¤¬É¬Íפʥ½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¡¢¥Þ¥ë¥Á¥­¥ã¥¹¥È¤òÍ­¸ú¤Ë¤¹¤ë¡¢ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÀßÄꤹ¤ë¡¢¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤òÊѹ¹¤¹¤ë¤Ê¤É) +.TP +.B CAP_NET_BIND_SERVICE +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥É¥á¥¤¥ó¤ÎÆø¢¥Ý¡¼¥È (¥Ý¡¼¥ÈÈֹ椬 1024 ÈÖ̤Ëþ) +¤ò¥Ð¥¤¥ó¥É¤Ç¤­¤ë¡£ +.TP +.B CAP_NET_BROADCAST +(̤»ÈÍÑ) ¥½¥±¥Ã¥È¤Î¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤È¡¢¥Þ¥ë¥Á¥­¥ã¥¹¥È¤ÎÂÔ¤Á¼õ¤±¤ò¹Ô¤¦¡£ +.TP +.B CAP_NET_RAW +RAW ¥½¥±¥Ã¥È¤È PACKET ¥½¥±¥Ã¥È¤ò»ÈÍѤ¹¤ë¡£ +.\" ¤Þ¤¿¡¢³Æ¼ï¤Î IP ¥ª¥×¥·¥ç¥ó¤È SO_BINDTODEVICE ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤǤ­¤ë¡£ +.TP +.B CAP_SETGID +¥×¥í¥»¥¹¤Î GID ¤ÈÄɲäΠGID ¥ê¥¹¥È¤ËÂФ¹¤ëǤ°Õ¤ÎÁàºî¤ò¹Ô¤¦¡£ +Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È·Ðͳ¤Ç¥½¥±¥Ã¥È¤Î»ñ³Ê¾ðÊó (credential) ¤òÅϤ¹ºÝ¤Ë +µ¶¤Î GID ¤òÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR CAP_SETFCAP " (Linux 2.6.24 °Ê¹ß)" +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÀßÄꤹ¤ë¡£ +.TP +.B CAP_SETPCAP +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç: +¸Æ¤Ó½Ð¤·¸µ¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë´Þ¤Þ¤ì¤ëǤ°Õ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¡¢ +¾¤Î¥×¥í¥»¥¹¤ËÉÕÍ¿¤·¤¿¤ê¡¢ºï½ü¤·¤¿¤ê¤Ç¤­¤ë¡£ +(¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +.B CAP_SETPCAP +¤Ï¤³¤ÎÌò³ä¤ò»ý¤¿¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤Ç¤Ï +.B CAP_SETPCAP +¤ÏÁ´¤¯Ê̤ΰÕÌ£¤ò»ý¤Ä¤«¤é¤Ç¤¢¤ë¡£) + +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç: +¸Æ¤Ó½Ð¤·¸µ¥¹¥ì¥Ã¥É¤Î¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤ÎǤ°Õ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò +¼«¿È¤Î·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ËÄɲäǤ­¤ë¡£ +.RB ( prctl (2) +.BR PR_CAPBSET_DROP +¤ò»È¤Ã¤Æ) +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òºï½ü¤Ç¤­¤ë¡£ +.I securebits +¥Õ¥é¥°¤òÊѹ¹¤Ç¤­¤ë¡£ +.TP +.B CAP_SETUID +¥×¥í¥»¥¹¤Î UID ¤ËÂФ¹¤ëǤ°Õ¤ÎÁàºî +.RB ( setuid (2), +.BR setreuid (2), +.BR setresuid (2), +.BR setfsuid (2)) +¤ò¹Ô¤¦¡£ +Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È·Ðͳ¤Ç¥½¥±¥Ã¥È¤Î»ñ³Ê¾ðÊó (credential) ¤òÅϤ¹ºÝ¤Ë +µ¶¤Î UID ¤òÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.\" FIXME CAP_SETUID also an effect in exec(); document this. +.TP +.B CAP_SYS_ADMIN +.PD 0 +.RS +.IP * 2 +°Ê²¼¤Î¥·¥¹¥Æ¥à´ÉÍýÍѤÎÁàºî¤ò¼Â¹Ô¤¹¤ë: +.BR quotactl (2), +.BR mount (2), +.BR umount (2), +.BR swapon (2), +.BR swapoff (2), +.BR sethostname (2), +.BR setdomainname (2). +.IP * +Ǥ°Õ¤Î System V IPC ¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ¹¤ë +.B IPC_SET +¤È +.B IPC_RMID +Áàºî¤ò¼Â¹Ô¤¹¤ë¡£ +.IP * +³Èĥ°À­ +.I trusted +¤È +.I security +¤ËÂФ¹¤ëÁàºî¤ò¼Â¹Ô¤¹¤ë +.RB ( attr (5) +»²¾È)¡£ +.IP * +.BR lookup_dcookie (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ +.IP * +.BR ioprio_set (2) +¤ò»È¤Ã¤Æ I/O ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹ +.BR IOPRIO_CLASS_RT , +.B IOPRIO_CLASS_IDLE +¤ò³ä¤êÅö¤Æ¤ë +.RB ( IOPRIO_CLASS_IDLE +¤Ï Linux 2.6.25 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¤ß)¡£ +.IP * +¥½¥±¥Ã¥È¤Î»ñ³Ê¾ðÊó (credential) ¤òÅϤ¹ºÝ¤Ëµ¶¤Î UID ¤òÅϤ¹¡£ +.IP * +¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë (Î㤨¤Ð +.BR accept (2), +.BR execve (2), +.BR open (2), +.BR pipe (2)) +¤Ç¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¾å¸Â +.I /proc/sys/fs/file-max +¤òĶ²á¤¹¤ë¡£ +.IP * +.BR clone (2) +¤È +.BR unshare (2) +¤Ç +.B CLONE_NEWNS +¥Õ¥é¥°¤òÍøÍѤ¹¤ë¡£ +.IP * +.BR keyctl (2) +¤Î +.B KEYCTL_CHOWN +¤È +.B KEYCTL_SETPERM +Áàºî¤ò¼Â¹Ô¤¹¤ë¡£ +.RE +.PD +.TP +.B CAP_SYS_BOOT +.BR reboot (2) +¤È +.BR kexec_load (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ +.TP +.B CAP_SYS_CHROOT +.BR chroot (2). +¤ò¸Æ¤Ó½Ð¤¹¡£ +.TP +.B CAP_SYS_MODULE +¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤Î¥í¡¼¥É¡¢¥¢¥ó¥í¡¼¥É¤ò¹Ô¤¦ +.RB ( init_module (2) +¤È +.BR delete_module (2) +¤ò»²¾È¤Î¤³¤È)¡£ +¥Ð¡¼¥¸¥ç¥ó 2.6.25 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¡¢ +¥·¥¹¥Æ¥àÁ´ÂΤΥ±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È (capability bounding set) +¤«¤é¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò³°¤¹¡£ +.TP +.B CAP_SYS_NICE +.PD 0 +.RS +.IP * 2 +¥×¥í¥»¥¹¤Î nice Ãͤΰú¤­¾å¤² +.RB ( nice (2), +.BR setpriority (2)) +¤ä¡¢Ç¤°Õ¤Î¥×¥í¥»¥¹¤Î nice ÃͤÎÊѹ¹¤ò¹Ô¤¦¡£ +.IP * +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ËÂФ¹¤ë¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥Ý¥ê¥·¡¼¤È¡¢ +Ǥ°Õ¤Î¥×¥í¥»¥¹¤ËÂФ¹¤ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥Ý¥ê¥·¡¼¤ÈÍ¥ÀèÅÙ¤òÀßÄꤹ¤ë +.RB ( sched_setscheduler (2), +.BR sched_setparam (2))¡£ +.IP * +Ǥ°Õ¤Î¥×¥í¥»¥¹¤ËÂФ¹¤ë CPU affinity ¤òÀßÄê¤Ç¤­¤ë +.RB ( sched_setaffinity (2))¡£ +.IP * +Ǥ°Õ¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ I/O ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ÈÍ¥ÀèÅÙ¤òÀßÄê¤Ç¤­¤ë +.RB ( ioprio_set (2))¡£ +.IP * +.BR migrate_pages (2) +¤òǤ°Õ¤Î¥×¥í¥»¥¹¤ËŬÍѤ·¡¢¥×¥í¥»¥¹¤òǤ°Õ¤Î¥Î¡¼¥É¤Ë°ÜÆ°¤¹¤ë¡£ +.\" FIXME CAP_SYS_NICE also has the following effect for +.\" migrate_pages(2): +.\" do_migrate_pages(mm, &old, &new, +.\" capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE); +.IP * +.BR move_pages (2) +¤òǤ°Õ¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ¹Ô¤¦¡£ +.IP * +.BR mbind (2) +¤È +.BR move_pages (2) +¤Ç +.B MPOL_MF_MOVE_ALL +¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¡£ +.RE +.PD +.TP +.B CAP_SYS_PACCT +.BR acct (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ +.TP +.B CAP_SYS_PTRACE +.BR ptrace (2) +¤ò»È¤Ã¤ÆǤ°Õ¤Î¥×¥í¥»¥¹¤ò¥È¥ì¡¼¥¹¤¹¤ë¡£ +.TP +.B CAP_SYS_RAWIO +I/O ¥Ý¡¼¥ÈÁàºî¤ò¼Â¹Ô¤¹¤ë +.RB ( iopl (2) +¡¢ +.BR ioperm (2))¡£ +.I /proc/kcore +¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.TP +.B CAP_SYS_RESOURCE +.PD 0 +.RS +.IP * 2 +ext2 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤ÎͽÌ󤵤ì¤Æ¤¤¤ëÎΰè¤ò»ÈÍѤ¹¤ë¡£ +.IP * +ext3 ¤Î¥¸¥ã¡¼¥Ê¥ëµ¡Ç½¤òÀ©¸æ¤¹¤ë +.BR ioctl (2) +¤ò»ÈÍѤ¹¤ë¡£ +.IP * +¥Ç¥£¥¹¥¯ quota ¤Î¾å¸Â¤ò¾å½ñ¤­¤¹¤ë¡£ +.IP * +¥ê¥½¡¼¥¹¾å¸Â¤òÁý¤ä¤¹ +.RB ( setrlimit (2))¡£ +.IP * +.B RLIMIT_NPROC +¥ê¥½¡¼¥¹À©¸Â¤ò¾å½ñ¤­¤¹¤ë¡£ +.IP * +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ë´Ø¤¹¤ë¾å¸Â +.I msg_qbytes +¤ò +.I /proc/sys/kernel/msgmnb +¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¾å¸Â¤è¤ê¤âÂ礭¤¯ÀßÄꤹ¤ë +.RB ( msgop (2) +¤È +.BR msgctl (2) +»²¾È)¡£ +.RE +.PD +.TP +.B CAP_SYS_TIME +¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤òÊѹ¹¤¹¤ë +.RB ( settimeofday (2), +.BR stime (2), +.BR adjtimex (2))¡£ +¥ê¥¢¥ë¥¿¥¤¥à (¥Ï¡¼¥É¥¦¥§¥¢) ¥¯¥í¥Ã¥¯¤òÊѹ¹¤¹¤ë¡£ +.TP +.B CAP_SYS_TTY_CONFIG +.BR vhangup (2) +¤ò¸Æ¤Ó½Ð¤¹¡£ +.\" +.SS ²áµî¤È¸½ºß¤Î¼ÂÁõ +´°Á´¤Ê·Á¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¼ÂÁõ¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤ÎÍ×·ï¤òËþ¤¿¤¹É¬Íפ¬¤¢¤ë¡§ +.IP 1. 3 +Á´¤Æ¤ÎÆø¢Áàºî¤Ë¤Ä¤¤¤Æ¡¢¥«¡¼¥Í¥ë¤Ï¤½¤Î¥¹¥ì¥Ã¥É¤Î¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë +ɬÍפʥ±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤¢¤ë¤«¤ò³Îǧ¤¹¤ë¡£ +.IP 2. +¥«¡¼¥Í¥ë¤Ç¡¢¤¢¤ë¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤òÊѹ¹¤·¤¿¤ê¡¢ +¼èÆÀ¤·¤¿¤ê¤Ç¤­¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Ä󶡤µ¤ì¤ë¡£ +.IP 3. +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¡¢¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤Ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÉÕÍ¿¤Ç¤­¡¢¥Õ¥¡¥¤¥ë +¼Â¹Ô»þ¤Ë¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥×¥í¥»¥¹¤¬¼èÆÀ¤Ç¤­¤ë¤è¤¦¤Êµ¡Ç½¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +.PP +¥«¡¼¥Í¥ë 2.6.24 ¤è¤êÁ°¤Ç¤Ï¡¢ºÇ½é¤Î 2¤Ä¤ÎÍ×·ï¤Î¤ß¤¬Ëþ¤¿¤µ¤ì¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë 2.6.24 °Ê¹ß¤Ç¤Ï¡¢3¤Ä¤ÎÍ׷魯¤Ù¤Æ¤¬Ëþ¤¿¤µ¤ì¤Æ¤¤¤ë¡£ +.\" +.SS ¥¹¥ì¥Ã¥É¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È +³Æ¥¹¥ì¥Ã¥É¤Ï°Ê²¼¤Î 3¼ïÎà¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ò»ý¤Ä¡£³Æ¡¹¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ï +¾åµ­¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÎÁȤ߹ç¤ï¤»¤Ç¤¢¤ë (Á´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Ìµ¸ú¤Ç¤â¤è¤¤)¡£ +.TP +.IR "µö²Ä (permitted)" : +¤½¤Î¥¹¥ì¥Ã¥É¤¬»ý¤Ä¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î +¸ÂÄêŪ¤Ê¥¹¡¼¥Ñ¡¼¥»¥Ã¥È¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï¡¢¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¥¹¥ì¥Ã¥É¤¬·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë +ÄɲòÄǽ¤Ê¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¸ÂÄêŪ¤Ê¥¹¡¼¥Ñ¡¼¥»¥Ã¥È¤Ç¤â¤¢¤ë¡£ + +µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤«¤éºï½ü¤·¤Æ¤·¤Þ¤Ã¤¿¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï¡¢ +(set-user-ID-root ¥×¥í¥°¥é¥à¤«¡¢ +¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Çµö²Ä¤·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤ò +.BR execve (2) +¤·¤Ê¤¤¸Â¤ê¤Ï) ¤â¤¦°ìÅÙ³ÍÆÀ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.TP +.IR "·Ñ¾µ²Äǽ (inheritable)" : +.BR execve (2) +¤òÁ°¸å¤ÇÊÝ»ý¤µ¤ì¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ç¤¢¤ë¡£ +¤³¤Î»ÅÁȤߤò»È¤¦¤³¤È¤Ç¡¢¤¢¤ë¥×¥í¥»¥¹¤¬ +.BR execve (2) +¤ò¹Ô¤¦ºÝ¤Ë¿·¤·¤¤¥×¥í¥°¥é¥à¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤È¤·¤Æ +³ä¤êÅö¤Æ¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.IR "¼Â¸ú (effective)" : +¥«¡¼¥Í¥ë¤¬¥¹¥ì¥Ã¥É¤Î¸¢¸Â (permission) ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤È¤­¤Ë +»ÈÍѤ¹¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ç¤¢¤ë¡£ +.PP +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤ë»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +Ãæ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î°·¤¤¤Ë¤Ä¤¤¤Æ¤Ï²¼µ­¤ò»²¾È¤Î¤³¤È¡£ +.PP +.BR capset (2) +¤ò»È¤¦¤È¡¢¥×¥í¥»¥¹¤Ï¼«Ê¬¼«¿È¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È +¤òÁàºî¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë (²¼µ­»²¾È)¡£ +.\" +.SS ¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +¥«¡¼¥Í¥ë 2.6.24 °Ê¹ß¤Ç¤Ï¡¢ +.BR setcap (8) +¤ò»È¤Ã¤Æ¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤òÂбþÉÕ¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ï +.I "security.capability" +¤È¤¤¤¦Ì¾Á°¤Î³Èĥ°À­¤ËÊݸ¤µ¤ì¤ë +.RB ( setxattr (2) +»²¾È)¡£¤³¤Î³Èĥ°À­¤Ø¤Î½ñ¤­¹þ¤ß¤Ë¤Ï +.B CAP_SETFCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤È¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎξÊý¤¬ +¹Í褵¤ì¡¢ +.BR execve (2) +¸å¤Î¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤¬·èÄꤵ¤ì¤ë¡£ + +3 ¤Ä¤Î¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.IR "µö²Ä (Permitted)" " (°ÊÁ°¤Î" "¶¯À© (Forced)" "):" +¥¹¥ì¥Ã¥É¤Î·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ë´Ø¤ï¤é¤º¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ë¼«Æ°Åª¤Ë +ǧ¤á¤é¤ì¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡£ +.TP +.IR "·Ñ¾µ²Äǽ (Inheritable)" " (°ÊÁ°¤Î " "µöÍÆ (Allowed)" "):" +¤³¤Î¥»¥Ã¥È¤È¡¢¥¹¥ì¥Ã¥É¤Î·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤È¤Î +ÏÀÍýÀÑ (AND) ¤¬¤È¤é¤ì¡¢ +.BR execve (2) +¤Î¸å¤Ë¤½¤Î¥¹¥ì¥Ã¥É¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÇÍ­¸ú¤È¤Ê¤ë +·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬·èÄꤵ¤ì¤ë¡£ +.TP +.IR "¼Â¸ú (Effective)" : +¤³¤ì¤Ï½¸¹ç¤Ç¤Ï¤Ê¤¯¡¢1 ¥Ó¥Ã¥È¤Î¾ðÊó¤Ç¤¢¤ë¡£ +¤³¤Î¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +.BR execve (2) +¼Â¹ÔÃæ¤Ë¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Î¿·¤·¤¤µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Á´¤Æ +¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£½¸¹ç¤Ë¤ª¤¤¤Æ¤â¥»¥Ã¥È¤µ¤ì¤ë¡£ +¤³¤Î¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +.BR execve (2) +¸å¤Ë¤Ï¿·¤·¤¤µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¤É¤ì¤â¿·¤·¤¤¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£½¸¹ç +¤Ë¥»¥Ã¥È¤µ¤ì¤Ê¤¤¡£ + +¥Õ¥¡¥¤¥ë¤Î¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ó¥Ã¥È¤òÍ­¸ú¤Ë¤¹¤ë¤È¤¤¤¦¤Î¤Ï¡¢ +.BR execve (2) +¼Â¹Ô»þ¤Ë¡¢¥Õ¥¡¥¤¥ë¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤È·Ñ¾µ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ËÂбþ¤¹¤ë¤â¤Î¤¬ +¥¹¥ì¥Ã¥É¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤È¤·¤Æ¥»¥Ã¥È¤µ¤ì¤ë¤¬¡¢ +¤³¤ì¤¬¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë¤â¥»¥Ã¥È¤µ¤ì¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë +(¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÎÊÑ´¹¥ë¡¼¥ë¤Ï²¼µ­»²¾È)¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥Õ¥¡¥¤¥ë¤Ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò³ä¤êÅö¤Æ¤ëºÝ +.RB ( setcap (8), +.BR cap_set_file (3), +.BR cap_set_fd (3))¡¢ +¤¤¤º¤ì¤«¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ËÂФ·¤Æ¼Â¸ú¥Õ¥é¥°¤òÍ­¸ú¤È»ØÄꤹ¤ë¾ì¹ç¡¢ +µö²Ä¥Õ¥é¥°¤ä·Ñ¾µ²Äǽ¥Õ¥é¥°¤òÍ­¸ú¤Ë¤·¤¿Â¾¤ÎÁ´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +¤Ë¤Ä¤¤¤Æ¤â¼Â¸ú¥Õ¥é¥°¤òÍ­¸ú¤È»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.\" +.SS "execve() Ãæ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÎÊÑ´¹" +.PP +.BR execve (2) +¼Â¹Ô»þ¤Ë¡¢¥«¡¼¥Í¥ë¤Ï¥×¥í¥»¥¹¤Î¿·¤·¤¤¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¼¡¤Î +¥¢¥ë¥´¥ê¥º¥à¤òÍѤ¤¤Æ·×»»¤¹¤ë¡§ +.in +4n +.nf + +P'(permitted) = (P(inheritable) & F(inheritable)) | + (F(permitted) & cap_bset) + +P'(effective) = F(effective) ? P'(permitted) : 0 + +P'(inheritable) = P(inheritable) [¤Ä¤Þ¤ê¡¢Êѹ¹¤µ¤ì¤Ê¤¤] + +.fi +.in +³ÆÊÑ¿ô¤Î°ÕÌ£¤Ï°Ê²¼¤ÎÄ̤ê: +.RS 4 +.IP P 10 +.BR execve (2) +Á°¤Î¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÃÍ +.IP P' +.BR execve (2) +¸å¤Î¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÃÍ +.IP F +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÃÍ +.IP cap_bset +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤ÎÃÍ (²¼µ­»²¾È) +.RE +.\" +.SS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤È¡¢¥ë¡¼¥È¤Ë¤è¤ë¥×¥í¥°¥é¥à¤Î¼Â¹Ô +.BR execve (2) +»þ¤Ë¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ò»È¤Ã¤Æ¡¢Á´¤Æ¤Î¸¢¸Â¤ò»ý¤Ã¤¿ +.I root +¤ò¼Â¸½¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¡£ +.IP 1. 3 +set-user-ID-root ¥×¥í¥°¥é¥à¤¬¼Â¹Ô¤µ¤ì¤ë¾ì¹ç¡¢ +¤Þ¤¿¤Ï¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID ¤¬ 0 (root) ¤Î¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤Èµö²Ä¥»¥Ã¥È¤òÁ´¤Æ 1 +(Á´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Í­¸ú) ¤ËÄêµÁ¤¹¤ë¡£ +.IP 2. +set-user-ID-root ¥×¥í¥°¥é¥à¤¬¼Â¹Ô¤µ¤ì¤ë¾ì¹ç¡¢ +¥Õ¥¡¥¤¥ë¤Î¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ó¥Ã¥È¤ò 1 (enabled) ¤ËÄêµÁ¤¹¤ë¡£ +.PP +¾åµ­¤Î¥ë¡¼¥ë¤Ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ÊÑ´¹¤òŬÍѤ·¤¿·ë²Ì¤ò¤Þ¤È¤á¤ë¤È¡¢ +¥×¥í¥»¥¹¤¬ set-user-ID-root ¥×¥í¥°¥é¥à¤ò +.BR execve (2) +¤¹¤ë¾ì¹ç¡¢¤Þ¤¿¤Ï¼Â¸ú UID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤¬¥×¥í¥°¥é¥à¤ò +.BR execve (2) +¤¹¤ë¾ì¹ç¡¢µö²Ä¤È¼Â¸ú¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÁ´¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +(Àµ³Î¤Ë¤Ï¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ë¤è¤ë¥Þ¥¹¥¯¤Ç½ü³°¤µ¤ì¤ë¤â¤Î +°Ê³°¤ÎÁ´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò¼èÆÀ¤¹¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.\" ¼Â UID ¤¬ 0 ¤Ç¼Â¸ú UID ¤¬ 0 °Ê³°¤Î¥×¥í¥»¥¹¤¬ exec () ¤ò¹Ô¤¦¤È¡¢ +.\" µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë´Þ¤Þ¤ì¤ëÁ´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\" ¤¬¼èÆÀ¤µ¤ì¡¢¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï¼èÆÀ¤µ¤ì¤Ê¤¤¡£ +¤³¤ì¤Ë¤è¤ê¡¢ÅÁÅýŪ¤Ê Unix ¥·¥¹¥Æ¥à¤ÈƱ¤¸¿¶¤ëÉñ¤¤¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SS ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È (capability bounding set) ¤Ï¡¢ +.BR execve (2) +»þ¤Ë³ÍÆÀ¤Ç¤­¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÀ©¸Â¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë +¥»¥­¥å¥ê¥Æ¥£µ¡¹½¤Ç¤¢¤ë¡£ +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï°Ê²¼¤Î¤è¤¦¤Ë»ÈÍѤµ¤ì¤ë¡£ +.IP * 2 +.BR execve (2) +¼Â¹Ô»þ¤Ë¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤È +¥Õ¥¡¥¤¥ë¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÏÀÍýÏ (AND) ¤ò¼è¤Ã¤¿¤â¤Î¤¬¡¢ +¤½¤Î¥¹¥ì¥Ã¥É¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +¤Ä¤Þ¤ê¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï¡¢ +¼Â¹Ô¥Õ¥¡¥¤¥ë¤¬Ç§¤á¤Æ¤¤¤ëµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ËÂФ·¤Æ +À©¸Â¤ò²Ý¤¹Æ¯¤­¤ò¤¹¤ë¡£ +.IP * +(Linux 2.6.25 °Ê¹ß) +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï¡¢¥¹¥ì¥Ã¥É¤¬ +.BR capset (2) +¤Ë¤è¤ê¼«¿È¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤ËÄɲòÄǽ¤Ê¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÎÊ콸ÃĤò +À©¸Â¤¹¤ëÌò³ä¤ò»ý¤Ä¡£ +¥¹¥ì¥Ã¥É¤Ëµö²Ä¤µ¤ì¤¿¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ç¤¢¤Ã¤Æ¤â¡¢¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ë +´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¥¹¥ì¥Ã¥É¤Ï¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï¼«¿È¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤Ë +ÄɲäǤ­¤º¡¢¤½¤Î·ë²Ì¡¢·Ñ¾µ²Äǽ¥»¥Ã¥È¤Ë¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò´Þ¤à¥Õ¥¡¥¤¥ë¤ò +.BR execve (2) +¤¹¤ë¾ì¹ç¡¢¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òµö²Ä¥»¥Ã¥È¤Ë»ý¤Á³¤±¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡¢ +¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.PP +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤¬¥Þ¥¹¥¯¤ò¹Ô¤¦¤Î¤Ï¡¢·Ñ¾µ²Äǽ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ç¤Ï¤Ê¤¯¡¢ +¥Õ¥¡¥¤¥ë¤Îµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥Þ¥¹¥¯¤ò¹Ô¤¦ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤¢¤ë¥¹¥ì¥Ã¥É¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤Ë¤½¤Î¥¹¥ì¥Ã¥É¤Î¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ë +¸ºß¤·¤Ê¤¤¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ï¡¢ +·Ñ¾µ²Äǽ¥»¥Ã¥È¤Ë´Þ¤Þ¤ì¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢ +µö²Ä¥»¥Ã¥È¤Ë´Þ¤Þ¤ì¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â³ÍÆÀ¤Ç¤­¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +.PP +¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï +¥·¥¹¥Æ¥à¶¦Ä̤ΰÀ­¤Î¾ì¹ç¤È¡¢¥×¥í¥»¥¹Ã±°Ì¤Î°À­¤Î¾ì¹ç¤¬¤¢¤ë¡£ +.PP +.B "Linux 2.6.25 ¤è¤êÁ°¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È" +.PP +2.6.25 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï +¥·¥¹¥Æ¥à¶¦Ä̤ΰÀ­¤Ç¡¢¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤ËŬÍѤµ¤ì¤ë¡£ +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï +.I /proc/sys/kernel/cap-bound +¥Õ¥¡¥¤¥ë·Ðͳ¤Ç»²¾È¤Ç¤­¤ë¡£ +(´Ö°ã¤¨¤ä¤¹¤¤¤¬¡¢¤³¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯·Á¼°¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢ +.I /proc/sys/kernel/cap-bound +¤Ç¤ÏÉä¹æÉÕ¤­¤Î½½¿Ê¿ô¤Çɽ¸½¤µ¤ì¤ë¡£) + +.B init +¥×¥í¥»¥¹¤À¤±¤¬¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ç +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥»¥Ã¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤½¤ì°Ê³°¤Ç¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶ (¤è¤êÀµ³Î¤Ë¤Ï¡¢ +.B CAP_SYS_MODULE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤¿¥×¥í¥°¥é¥à) ¤¬¡¢ +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¥¯¥ê¥¢¤¬ +¤Ç¤­¤ë¤À¤±¤Ç¤¢¤ë¡£ + +Ä̾ï¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï¡¢ +.B CAP_SETPCAP +¤¬Ìµ¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤³¤ÎÀ©¸Â¤ò¼è¤êµî¤ë¤Ë¤Ï (¼è¤êµî¤ë¤Î¤Ï´í¸±!)¡¢ +.I include/linux/capability.h +Æâ¤Î +.B CAP_INIT_EFF_SET +¤ÎÄêµÁ¤ò½¤Àµ¤·¡¢¥«¡¼¥Í¥ë¤òºÆ¹½ÃÛ¤¹¤ëɬÍפ¬¤¢¤ë¡£ + +¥·¥¹¥Æ¥à¶¦Ä̤Υ±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥Èµ¡Ç½¤Ï¡¢ +¥«¡¼¥Í¥ë 2.2.11 °Ê¹ß¤Ç Linux ¤ËÄɲ䵤줿¡£ +.\" +.PP +.B "Linux 2.6.25 °Ê¹ß¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È" +.PP +Linux 2.6.25 °Ê¹ß¤Ç¤Ï¡¢ +¡Ö¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¡×¤Ï¥¹¥ì¥Ã¥Éñ°Ì¤Î°À­¤Ç¤¢¤ë +(¥·¥¹¥Æ¥à¶¦Ä̤Υ±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï¤â¤Ï¤ä¸ºß¤·¤Ê¤¤)¡£ + +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ï +.BR fork (2) +»þ¤Ë¤Ï¥¹¥ì¥Ã¥É¤Î¿Æ¥×¥í¥»¥¹¤«¤é·Ñ¾µ¤µ¤ì¡¢ +.BR execve (2) +¤ÎÁ°¸å¤Ç¤ÏÊÝ»ý¤µ¤ì¤ë¡£ + +¥¹¥ì¥Ã¥É¤¬ +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ï +.BR prctl (2) +¤Î +.BR PR_CAPBSET_DROP +Áàºî¤ò»È¤Ã¤Æ¼«¿È¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤¤¤Ã¤¿¤ó¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤éºï½ü¤·¤Æ¤·¤Þ¤¦¤È¡¢ +¥¹¥ì¥Ã¥É¤Ï¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òºÆÅÙ¥»¥Ã¥È¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.BR prctl (2) +¤Î +.B PR_CAPBSET_READ +Áàºî¤ò»È¤¦¤³¤È¤Ç¡¢¥¹¥ì¥Ã¥É¤¬¤¢¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¼«¿È¤Î¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È +¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤òÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ + +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Îºï½ü¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤ë¤Î¤Ï¡¢ +¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç +(CONFIG_SECURITY_FILE_CAPABILITIES) ¤À¤±¤Ç¤¢¤ë¡£ +¤³¤Î¾ì¹ç¤Ë¤Ï¡¢ (Á´¤Æ¤Î¥×¥í¥»¥¹¤ÎÀèÁĤǤ¢¤ë) +.I init +¥×¥í¥»¥¹¤Ï¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤ÇÁ´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬ +¥»¥Ã¥È¤µ¤ì¤¿¾õÂ֤dz«»Ï¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +.I init +¤Ï¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤Ç +.B CAP_SETPCAP +°Ê³°¤ÎÁ´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥»¥Ã¥È¤µ¤ì¤¿¾õÂ֤dz«»Ï¤¹¤ë¡£ +¤³¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ï¡¢ +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï +°ã¤Ã¤¿°ÕÌ£¤ò»ý¤Ä¤«¤é¤Ç¤¢¤ë¡£ + +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òºï½ü¤·¤Æ¤â¡¢ +¥¹¥ì¥Ã¥É¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤«¤é¤Ï¤½¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ïºï½ü¤µ¤ì¤Ê¤¤¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é¤Îºï½ü¤Ë¤è¤ê¡¢ +¤³¤ÎÀ褽¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥¹¥ì¥Ã¥É¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤ËÄɲ乤뤳¤È +¤Ï¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +.\" +.\" +.SS "¥æ¡¼¥¶ ID Êѹ¹¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ø¤Î±Æ¶Á" +¥æ¡¼¥¶ ID ¤¬ 0 ¤È 0 °Ê³°¤Î´Ö¤ÇÊѲ½¤¹¤ëºÝ¤Î¿¶¤ëÉñ¤¤¤ò½¾Íè¤ÈƱ¤¸¤Ë¤¹¤ë¤¿¤á¡¢ +¥¹¥ì¥Ã¥É¤Î¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤¬ +.RB ( setuid (2), +.BR setresuid (2) +¤Ê¤É¤ò»È¤Ã¤Æ) Êѹ¹¤µ¤ì¤¿ºÝ¤Ë¡¢¥«¡¼¥Í¥ë¤Ï¤½¤Î¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë +°Ê²¼¤ÎÊѹ¹¤ò¹Ô¤¦: +.IP 1. 3 +UID ¤ÎÊѹ¹Á°¤Ë¤Ï¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤Î¤¦¤Á +¾¯¤Ê¤¯¤È¤â°ì¤Ä¤¬ 0 ¤Ç¡¢Êѹ¹¸å¤Ë¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤¬ +¤¹¤Ù¤Æ 0 °Ê³°¤ÎÃͤˤʤ俾ì¹ç¡¢µö²Ä¤È¼Â¸ú¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Î +Á´¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥¯¥ê¥¢¤¹¤ë¡£ +.IP 2. +¼Â¸ú UID ¤¬ 0 ¤«¤é 0 °Ê³°¤ËÊѹ¹¤µ¤ì¤¿¾ì¹ç¡¢ +¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÁ´¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¥¯¥ê¥¢¤¹¤ë¡£ +.IP 3. +¼Â¸ú UID ¤¬ 0 °Ê³°¤«¤é 0 ¤ËÊѹ¹¤µ¤ì¤¿¾ì¹ç¡¢ +µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÆâÍƤò¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ë¥³¥Ô¡¼¤¹¤ë¡£ +.IP 4. +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤¬ 0 ¤«¤é 0 °Ê³°¤ËÊѹ¹¤µ¤ì¤¿¾ì¹ç +.RB ( setfsuid (2) +»²¾È)¡¢¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Î°Ê²¼¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¥¯¥ê¥¢¤µ¤ì¤ë: +.BR CAP_CHOWN , +.BR CAP_DAC_OVERRIDE , +.BR CAP_DAC_READ_SEARCH , +.BR CAP_FOWNER , +.BR CAP_FSETID , +.B CAP_LINUX_IMMUTABLE +(Linux 2.2.30 °Ê¹ß), +.BR CAP_MAC_OVERRIDE , +.B CAP_MKNOD +(Linux 2.2.30 °Ê¹ß)¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤¬ 0 °Ê³°¤«¤é 0 ¤ËÊѹ¹¤µ¤ì¤¿¾ì¹ç¡¢ +¾åµ­¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Î¤¦¤Áµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÇÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤â¤Î¤¬ +¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÇÍ­¸ú¤Ë¤µ¤ì¤ë¡£ +.PP +³Æ¼ï UID ¤Î¤¦¤Á¾¯¤Ê¤¯¤È¤â°ì¤Ä¤¬ 0 ¤Ç¤¢¤ë¥¹¥ì¥Ã¥É¤¬¡¢ +¤½¤Î UID ¤ÎÁ´¤Æ¤¬ 0 °Ê³°¤Ë¤Ê¤Ã¤¿¤È¤­¤Ëµö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤¬ +¥¯¥ê¥¢¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +.BR prctl (2) +¤Î +.B PR_SET_KEEPCAPS +Áàºî¤ò»È¤¨¤Ð¤è¤¤¡£ +.\" +.SS ¥×¥í¥°¥é¥à¤Ç¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤òÄ´À°¤¹¤ë +³Æ¥¹¥ì¥Ã¥É¤Ï¡¢ +.BR capget (2) +¤ä +.BR capset (2) +¤ò»È¤Ã¤Æ¡¢¼«¿È¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ò¼èÆÀ¤·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë¡£ +¤¿¤À¤·¡¢¤³¤ì¤ò¹Ô¤¦¤Ë¤Ï¡¢ +.I libcap +¥Ñ¥Ã¥±¡¼¥¸¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë +.BR cap_get_proc (3) +¤ä +.BR cap_set_proc (3) +¤ò»È¤¦¤Î¤¬Ë¾¤Þ¤·¤¤¡£ +¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÊѹ¹¤Ë¤Ï°Ê²¼¤Î¥ë¡¼¥ë¤¬Å¬ÍѤµ¤ì¤ë¡£ +.IP 1. 3 +¸Æ¤Ó½Ð¤·Â¦¤¬ +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¿·¤·¤¤·Ñ¾µ²Äǽ¥»¥Ã¥È¤Ï¡¢ +´û¸¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤Èµö²Ä¥»¥Ã¥È¤ÎÀѽ¸¹ç (AND) ¤ÎÉôʬ½¸¹ç¤Ç +¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP 2. +(¥«¡¼¥Í¥ë 2.6.25 °Ê¹ß) +¿·¤·¤¤·Ñ¾µ²Äǽ¥»¥Ã¥È¤Ï¡¢´û¸¤Î·Ñ¾µ²Äǽ¥»¥Ã¥È¤È¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦ +¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤ÎÀѽ¸¹ç (AND) ¤ÎÉôʬ½¸¹ç¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP 3. +¿·¤·¤¤µö²Ä¥»¥Ã¥È¤Ï¡¢´û¸¤Îµö²Ä¥»¥Ã¥È¤ÎÉôʬ½¸¹ç¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +(¤Ä¤Þ¤ê¡¢¤½¤Î¥¹¥ì¥Ã¥É¤¬¸½ºß»ý¤Ã¤Æ¤¤¤Ê¤¤µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò +³ÍÆÀ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤)¡£ +.IP 4. +¿·¤·¤¤¼Â¸ú¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Ï¿·¤·¤¤µö²Ä¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤Î +Éôʬ½¸¹ç¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SS securebits ¥Õ¥é¥°: ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤À¤±¤Î´Ä¶­¤ò¹½ÃÛ¤¹¤ë +.\" For some background: +.\" see http://lwn.net/Articles/280279/ and +.\" http://article.gmane.org/gmane.linux.kernel.lsm/5476/ +¥«¡¼¥Í¥ë 2.6.26 °Ê¹ß¤Ç¡¢ +¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Í­¸ú¤Ë¤Ê¤Ã¤¿¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +¥¹¥ì¥Ã¥Éñ°Ì¤Î +.I securebits +¥Õ¥é¥°¤¬¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢¤³¤Î¥Õ¥é¥°¤ò»È¤¦¤È UID 0 +.RI ( root ) +¤ËÂФ¹¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÎÆÃÊÌ°·¤¤¤ò̵¸ú¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°Ê²¼¤Î¤è¤¦¤Ê¥Õ¥é¥°¤¬¤¢¤ë¡£ +.TP +.B SECBIT_KEEP_CAPS +¤³¤Î¥Õ¥é¥°¤ò¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢UID ¤¬ 0 ¤Î¥¹¥ì¥Ã¥É¤Î UID ¤¬ 0 °Ê³°¤ÎÃÍ¤Ë +ÀÚ¤êÂؤï¤ëºÝ¤Ë¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ï¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò°Ý»ý¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢UID ¤¬ 0 ¤«¤é 0 °Ê³°¤ÎÃÍ¤Ë +ÀÚ¤êÂؤï¤ë¤È¡¢¤½¤Î¥¹¥ì¥Ã¥É¤ÏÁ´¤Æ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¼º¤¦¡£ +¤³¤Î¥Õ¥é¥°¤Ï +.BR execve (2) +»þ¤Ë¤ÏÁ´¤Æ¥¯¥ê¥¢¤µ¤ì¤ë +(¤³¤Î¥Õ¥é¥°¤Ï¡¢°ÊÁ°¤Î +.BR prctl (2) +¤Î +.B PR_SET_KEEPCAPS +Áàºî¤ÈƱ¤¸µ¡Ç½¤òÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë)¡£ +.TP +.B SECBIT_NO_SETUID_FIXUP +¤³¤Î¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢¥¹¥ì¥Ã¥É¤Î¼Â¸ú UID ¤È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤¬ +0 ¤È 0 °Ê³°¤Î´Ö¤ÇÀÚ¤êÂؤï¤Ã¤¿¾ì¹ç¤Ë¡¢ +¥«¡¼¥Í¥ë¤Ï¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ÎÄ´À°¤ò¹Ô¤ï¤Ê¤¯¤Ê¤ë +(¡Ö¥æ¡¼¥¶ ID Êѹ¹¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ø¤Î±Æ¶Á¡×¤ÎÀá¤ò»²¾È)¡£ +.TP +.B SECBIT_NOROOT +¤³¤Î¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +set-user-ID-root ¥×¥í¥°¥é¥à¤Î¼Â¹Ô»þ¤ä¡¢ +¼Â¸ú UID ¤« ¼Â UID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤¬ +.BR execve (2) +¤ò¸Æ¤Ó½Ð¤·¤¿»þ¤Ë¡¢¥«¡¼¥Í¥ë¤Ï¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òµö²Ä¤·¤Ê¤¤ +(¡Ö¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤È¡¢¥ë¡¼¥È¤Ë¤è¤ë¥×¥í¥°¥é¥à¤Î¼Â¹Ô¡×¤ÎÀá¤ò»²¾È)¡£ +.PP +¾åµ­¤Î "base" ¥Õ¥é¥°¤Î³Æ¡¹¤Ë¤ÏÂбþ¤¹¤ë "locked" ¥Õ¥é¥°¤¬Â¸ºß¤¹¤ë¡£ +¤¤¤º¤ì¤Î "locked" ¥Õ¥é¥°¤â°ìÅÙ¥»¥Ã¥È¤µ¤ì¤ë¤ÈÌ᤹¤³¤È¤Ï¤Ç¤­¤º¡¢ +¤½¤ì°Ê¹ß¤ÏÂбþ¤¹¤ë "base" ¥Õ¥é¥°¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +"locked" ¥Õ¥é¥°¤Ï +.BR SECBIT_KEEP_CAPS_LOCKED , +.BR SECBIT_NO_SETUID_FIXUP_LOCKED , +.BR SECBIT_NOROOT_LOCKED +¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤ë¡£ +.PP +.I securebits +¥Õ¥é¥°¤Ï¡¢ +.BR prctl (2) +¤ÎÁàºî +.B PR_SET_SECUREBITS +¤ä +.B PR_GET_SECUREBITS +¤ò»È¤¦¤³¤È¤ÇÊѹ¹¤·¤¿¤ê¼èÆÀ¤·¤¿¤ê¤Ç¤­¤ë¡£ +¥Õ¥é¥°¤òÊѹ¹¤¹¤ë¤Ë¤Ï +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ + +.I securebits +¥Õ¥é¥°¤Ï»Ò¥×¥í¥»¥¹¤Ë·Ñ¾µ¤µ¤ì¤ë¡£ +.BR execve (2) +¤Ë¤ª¤¤¤Æ¤Ï¡¢ +.B SECURE_KEEP_CAPS +¤¬¾ï¤Ë¥¯¥ê¥¢¤µ¤ì¤ë°Ê³°¤Ï¡¢Á´¤Æ¤Î¥Õ¥é¥°¤¬ÊÝ»ý¤µ¤ì¤ë¡£ + +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢°Ê²¼¤Î¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦¤³¤È¤Ë¤è¤ê¡¢ +¼«Ê¬¼«¿È¤ª¤è¤Ó»Ò¹¤È¤Ê¤ë¥×¥í¥»¥¹Á´¤Æ¤ËÂФ·¤Æ¡¢ +ɬÍפʥե¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤¿¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Ê¤¤¸Â¤ê¡¢ +Âбþ¤¹¤ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò³ÍÆÀ¤Ç¤­¤Ê¤¤¤è¤¦¤Ê¾õ¶·¤ËÊĤ¸¤³¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.in +4n +.nf + +prctl(PR_SET_SECUREBITS, + SECBIT_KEEP_CAPS_LOCKED | + SECBIT_NO_SETUID_FIXUP | + SECBIT_NO_SETUID_FIXUP_LOCKED | + SECBIT_NOROOT | + SECBIT_NOROOT_LOCKED); +.fi +.in +.SH ½àµò +.PP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ë´Ø¤¹¤ëɸ½à¤Ï¤Ê¤¤¤¬¡¢ Linux ¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÏÇѰƤˤʤä¿ +POSIX.1e Áð°Æ¤Ë´ð¤Å¤¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.I http://wt.xpilot.org/publications/posix.1e/ +¤ò»²¾È¡£ +.SH Ãí°Õ +¥«¡¼¥Í¥ë 2.5.27 °Ê¹ß¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÏÁªÂò¼°¤Î¥«¡¼¥Í¥ë¥³¥ó¥Ý¡¼¥Í¥ó¥È +¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢¥«¡¼¥Í¥ëÀßÄꥪ¥×¥·¥ç¥ó CONFIG_SECURITY_CAPABILITIES +¤Ë¤è¤êÍ­¸ú/̵¸ú¤òÀÚ¤êÂؤ¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.I /proc/PID/task/TID/status +¥Õ¥¡¥¤¥ë¤ò»È¤¦¤È¡¢¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.I /proc/PID/status +¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¥×¥í¥»¥¹¤Î¥á¥¤¥ó¥¹¥ì¥Ã¥É¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¥»¥Ã¥È¤¬É½¼¨¤µ¤ì¤ë¡£ + +.I libcap +¥Ñ¥Ã¥±¡¼¥¸¤Ï¡¢¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÀßÄꡦ¼èÆÀ¤¹¤ë¤¿¤á¤Î +¥ë¡¼¥Á¥ó·²¤òÄ󶡤·¤Æ¤¤¤ë¡£¤³¤ì¤é¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¡¢ +.BR capset (2) +¤È +.BR capget (2) +¤¬Ä󶡤¹¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÈÈæ¤Ù¤Æ¡¢¤è¤ê»È¤¤¤ä¤¹¤¯¡¢Êѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¾¯¤Ê¤¤¡£ +¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ç¤Ï¡¢ +.BR setcap (8), +.BR getcap (8) +¤È¤¤¤¦¥×¥í¥°¥é¥à¤âÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +¥Ñ¥Ã¥±¡¼¥¸¤Ï +.I http://www.kernel.org/pub/linux/libs/security/linux-privs +¤ÇÆþ¼ê¤Ç¤­¤ë¡£ + +¥Ð¡¼¥¸¥ç¥ó 2.6.24 ¤è¤êÁ°¡¢¤ª¤è¤Ó¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬ +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤2.6.24 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.B CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤¿¥¹¥ì¥Ã¥É¤Ï¼«Ê¬°Ê³°¤Î¥¹¥ì¥Ã¥É¤Î +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÁàºî¤Ç¤­¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¤³¤ì¤ÏÍýÏÀŪ¤Ë²Äǽ¤È¤¤¤¦¤À¤±¤Ç¤¢¤ë¡£ +°Ê²¼¤Î¤¤¤º¤ì¤«¤Î¾ì¹ç¤Ë¤ª¤¤¤Æ¤â¡¢¤É¤Î¥¹¥ì¥Ã¥É¤â +.BR CAP_SETPCAP +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¤³¤È¤Ï¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.IP * 2 +2.6.25 ¤è¤êÁ°¤Î¼ÂÁõ¤Ç¤Ï¡¢¥·¥¹¥Æ¥à¶¦Ä̤Υ±¡¼¥Ñ¥Ó¥ê¥Æ¥£¡¦¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È +.I /proc/sys/kernel/cap-bound +¤Ç¤Ï¤³¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï¾ï¤Ë̵¸ú¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ +¥½¡¼¥¹¤òÊѹ¹¤·¤Æ¥«¡¼¥Í¥ë¤òºÆ¥³¥ó¥Ñ¥¤¥ë¤·¤Ê¤¤¸Â¤ê¡¢ +¤³¤ì¤òÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.IP * +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¥Õ¥¡¥¤¥ë¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬Ìµ¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¥×¥í¥»¥¹Ëè¤Î¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤«¤é¤³¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤òÈ´¤¤¤Æ +.B init +¤Ï³«»Ï¤µ¤ì¡¢ +¥·¥¹¥Æ¥à¾å¤ÇÀ¸À®¤µ¤ì¤ë¾¤ÎÁ´¤Æ¤Î¥×¥í¥»¥¹¤Ç¤³¤Î¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥»¥Ã¥È¤¬ +·Ñ¾µ¤µ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR capget (2), +.BR prctl (2), +.BR setfsuid (2), +.BR cap_clear (3), +.BR cap_copy_ext (3), +.BR cap_from_text (3), +.BR cap_get_file (3), +.BR cap_get_proc (3), +.BR cap_init (3), +.BR capgetp (3), +.BR capsetp (3), +.BR credentials (7), +.BR pthreads (7), +.BR getcap (8), +.BR setcap (8) +.PP +¥«¡¼¥Í¥ë¥½¡¼¥¹Æâ¤Î +.I include/linux/capability.h diff --git a/release/man7/charsets.7 b/release/man7/charsets.7 new file mode 100644 index 00000000..3607e63d --- /dev/null +++ b/release/man7/charsets.7 @@ -0,0 +1,365 @@ +.\" Copyright (c) 1996 Eric S. Raymond +.\" and Andries Brouwer +.\" +.\" 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. +.\" +.\" This is combined from many sources, including notes by aeb and +.\" 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 +.\" +.\" WORD: ligature ¹ç»ú +.\" +.TH CHARSETS 7 2008-06-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +charsets \- ¥×¥í¥°¥é¥Þ¤Î»ëÅÀ¤«¤é¸«¤¿Ê¸»ú¥»¥Ã¥È¤È¹ñºÝ²½ +.SH ÀâÌÀ +Linux ¤Ï¹ñºÝ²½¤µ¤ì¤¿¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£ +Linux ¤ÎÍÍ¡¹¤Ê¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ä¡¢ console ¥É¥é¥¤¥Ð¤Ê¤É¤Î +¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ï¡¢Èó¥é¥Æ¥ó¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Ê¤É¤Î +¥Þ¥ë¥Á¥ê¥ó¥¬¥ëʸ»ú¥»¥Ã¥È (multilingual character sets) ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Ë¤Ï¥é¥Æ¥ó¥¢¥ë¥Õ¥¡¥Ù¥Ã¥Èʸ»ú¡¦¥®¥ê¥·¥ãʸ»ú¡¦ +¥­¥ê¥ëʸ»ú¡¦¥¢¥é¥Ó¥¢Ê¸»ú¡¦¥Ø¥Ö¥é¥¤Ê¸»ú¤Ê¤É¤¬´Þ¤Þ¤ì¡¢ +ȯ²»¶èÊÌÉä¹æ (diacritical marks)¡¦¥¢¥¯¥»¥ó¥È¡¦¹ç»ú (ligatures) ¤Ê¤É¤â +»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï¡¢¥×¥í¥°¥é¥Þ¤Î»ëÅÀ¤«¤é¤ß¤¿°Û¤Ê¤ëʸ»ú½¸¹çµ¬³Ê +(character-set standards) ¤È¡¢¤½¤ì¤é¤ò Linux ¤Ë¤É¤¦Å¬¹ç¤µ¤»¤ë¤«¤È¤¤¤¦¤³ +¤È¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤ë¡£¤³¤³¤Ç¤Ï¡¢ASCII, ISO 8859, KOI8-R, Unicode, ISO 2022, +ISO 4873 ¤Î³Æµ¬³Ê¤Ë¤Ä¤¤¤ÆµÄÏÀ¤¹¤ë¡£ +¤³¤³¤Ç¤Ï¼ÂºÝ¤Ë¥í¥±¡¼¥ëʸ»ú¥»¥Ã¥È¤È¤·¤Æ»È¤ï¤ì¤Æ¤¤¤ëʸ»ú¥»¥Ã¥È¤ËÃíÌܤ·¡¢ +¤½¤Î¾¤Î¥·¥¹¥Æ¥à¤Ç»È¤ï¤ì¤Æ¤¤¤ë̵¿ô¤Î¤â¤Î¤Ï½Å»ë¤·¤Ê¤¤¡£ +.LP +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 ¤ËÀÚ¤êÂؤï¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤) +.SS ASCII +ASCII (American Standard Code For Information Interchange) ¤Ï +7¡¡¥Ó¥Ã¥Èʸ»ú½¸¹ç¤Î¸µ¤È¤Ê¤Ã¤¿¤â¤Î¤Ç¤¢¤ê¡¢ +¤â¤È¤â¤È¤ÏÊƸì(American English) ¤Î¤¿¤á¤Ë¥Ç¥¶¥¤¥ó¤µ¤ì¤¿¡£ +¸½ºß¤Ï¡¢ECMA-6 ɸ½à¤ÎÃæ¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +¥É¥¤¥Ä¸ì¡¢¥Õ¥é¥ó¥¹¸ì¡¢¥¹¥Ú¥¤¥ó¸ì¤Ê¤É¤Ë 7 ¥Ó¥Ã¥È¤ÇÂбþ¤¹¤ë¤¿¤á¡¢ +ASCII ¤Î¥É¥ëµ­¹æ¤ò¾¤ÎÄ̲ߵ­¹æ¤ËÃÖ¤­´¹¤¨¡¢ +¶çÆÉÅÀ¤òÈó±Ñ¸ìʸ»ú¤Î¤â¤Î¤ËÃÖ¤­´¹¤¨¤¿ÍÍ¡¹¤ÊÊѼ郎¸ºß¤¹¤ë¡£ +¤³¤ì¤é¤ÏÁ´¤Æ»È¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +glibc ¤Ï ASCII ¤Î´°Á´¤Ê¥¹¡¼¥Ñ¡¼¥»¥Ã¥È¤Ç¤Ê¤¤Ê¸»ú¥»¥Ã¥È¤Î¥í¥±¡¼¥ë¤Ë +Âбþ¤·¤Æ¤¤¤Ê¤¤¡£ +(¤³¤ì¤é¤Îʸ»ú¥»¥Ã¥È¤Ï ISO-646 ¤È¤·¤ÆÃΤé¤ì¤ë¡£ +¤³¤ì¤Ï ASCII ¤È¶á¤¤´Ø·¸¤Ë¤¢¤ê¡¢¤³¤ì¤é¤Îʸ»ú¤òÃÖ¤­´¹¤¨¤ë¤³¤È¤òǧ¤á¤Æ¤¤¤ë) +.LP +Linux ¤ÏÊƹñ¤ÇÀ߷פµ¤ì¤¿¥Ï¡¼¥É¥¦¥§¥¢¤Î¤¿¤á¤Ë½ñ¤«¤ì¤¿¤Î¤Ç¡¢ +¤Ï¤¸¤á¤«¤é ASCII ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +.SS ISO 8859 +ISO 8859 ¤Ï 15 ÁȤΰìÏ¢¤Î 8 ¥Ó¥Ã¥Èʸ»ú½¸¹ç¤Ç¤¢¤ë¡£¤½¤ì¤é¤ÏÁ´¤Æ +²¼°Ì (7 ¥Ó¥Ã¥È) ¤Ë US ASCII ¤ò´Þ¤ß¡¢ 128 ¤«¤é 159 ¤Ë¤ÏÀ©¸æʸ»ú¤¬ÇÛÃÖ¤µ¤ì¡¢ +160 ¤«¤é 255 ¤Ë¤Ï 96 ¸Ä¤Î¸ÇÄêÉý¿Þ·Áʸ»ú¤¬ÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¡£ +.LP +¤³¤ì¤é¤Î¤¦¤Á¤Ç¡¢¤â¤Ã¤È¤â½ÅÍ×¤Ê¤Î¤Ï ISO 8859-1 (Latin-1) ¤Ç¤¢¤ë¡£¤³¤ì +¤Ï Linux ¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð¤Ë¤ª¤¤¤Æ¥Í¥¤¥Æ¥£¥Ö¤Ë¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤ª¤ê¡¢ +.\"nakano ¤Ç¤¤¤¤¤ó¤¸¤ã¤Ê¤¤¤«¤È»×¤¤¤Þ¤¹¡£ +X11R6 ¤Ë¤ª¤¤¤Æ¤âƱÍͤ˥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£¤µ¤é¤Ë¡¢ +HTML ¤Î´ðËÜʸ»ú½¸¹ç¤Ç¤¢¤ë¡£ +.LP +¥³¥ó¥½¡¼¥ë¤Ë¤ª¤±¤ë¡¢¤½¤Î¾¤Î 8859 ʸ»ú½¸¹ç¤Î¥µ¥Ý¡¼¥È¤Ï +.RB ( setfont (8)) +¤Î¤è¤¦¤Ê¥æ¡¼¥¶¥â¡¼¥É¡¦¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤òÍøÍѤ¹¤ë»ö¤Ç²Äǽ¤Ë¤Ê¤ë¡£ +¤³¤Î¤è¤¦¤Ê¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤òÍøÍѤ¹¤ë¤³¤È¤Ë¤è¤ê¡¢¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð¤Ë¤ª¤± +¤ë¥­¡¼¥Ü¡¼¥É¤È EGA ¥°¥é¥Õ¥£¥Ã¥¯¥Æ¡¼¥Ö¥ë¤Î³ä¤êÅö¤Æ¤òÊѹ¹¤·¡¢"¥æ¡¼¥¶³ä +¤êÅö¤Æ(user mapping)"¥Õ¥©¥ó¥È¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.LP +°Ê²¼¤Ï¡¢¤½¤ì¤¾¤ì¤Î½¸¹ç¤Î´Êñ¤ÊÀâÌÀ¤Ç¤¢¤ë¡£ +.TP +8859-1 (Latin-1) +Latin-1 ¤Ï ¥¢¥ë¥Ð¥Ë¥¢¸ì(Albanian)¡¢¥«¥¿¥í¥Ë¥¢¸ì(Catalan)¡¢¥Ç¥ó¥Þ¡¼¥¯¸ì +(Danish)¡¢¥ª¥é¥ó¥À¸ì(Dutch)¡¢±Ñ¸ì(English)¡¢¥Õ¥§¥í¡¼¸ì(Faroese)¡¢ +¥Õ¥£¥ó¥é¥ó¥É¸ì(Finnish)¡¢¥Õ¥é¥ó¥¹¸ì(French)¡¢¥É¥¤¥Ä¸ì(German)¡¢ +¥¬¥ê¥·¥¢¸ì(Galician)¡¢¥¢¥¤¥ë¥é¥ó¥É¸ì(Irish)¡¢¥¢¥¤¥¹¥é¥ó¥É¸ì(Icelandic)¡¢ +¥¤¥¿¥ê¥¢¸ì(Italian)¡¢¥Î¥ë¥¦¥§¡¼¸ì(Norwegian)¡¢¥Ý¥ë¥È¥¬¥ë¸ì(Portuguese)¡¢ +¥¹¥Ú¥¤¥ó¸ì(Spanish)¡¢¥¹¥¦¥§¡¼¥Ç¥ó¸ì(Swedish)¤È¤¤¤Ã¤¿¤Û¤È¤ó¤É¤Î +À¾¥è¡¼¥í¥Ã¥Ñ¸À¸ì¤ò¥«¥Ð¡¼¤¹¤ë¡£ +¥É¥¤¥Ä¸ì¤Î ij ¤ä¥Õ¥é¥ó¥¹¸ì¤Î oe ¤Î¹ç»ú¡¢¤ª¤è¤Ó¸Å¤¤¥¹¥¿¥¤¥ë¤Î +,,¥É¥¤¥Ä¸ì`` °úÍÑÉä¤Ï¤Ê¤¤¤¬¡¢µöÍÆÈϰϤȹͤ¨¤é¤ì¤Æ¤¤¤ë¡£ +.TP +8859-2 (Latin-2) +Latin-2 ¤Ï¥¹¥é¥ô¸ì(Slavic)¡¢¥¯¥í¥¢¥Á¥¢¸ì(Croatian)¡¢¥Á¥§¥³ +¸ì(Czech)¡¢¥É¥¤¥Ä¸ì(German)¡¢¥Ï¥ó¥¬¥ê¡¼¸ì(Hungarian)¡¢¥Ý¡¼¥é¥ó¥É¸ì +(Polish)¡¢¥ë¡¼¥Þ¥Ë¥¢¸ì(Rumanian)¡¢¥¹¥í¥ô¥¡¥­¥¢¸ì(Slovak)¡¢ +¥¹¥í¥Ù¥Ë¥¢¸ì(Slovene)¤È¤¤¤Ã¤¿¡¢½ñ¤­Ê¸»ú¤È¤·¤Æ¥é¥Æ¥óʸ»ú¤ò +»ÈÍѤ¹¤ë¡¢¥¹¥é¥Ö·Ï¸À¸ì¤ÈÃæ±û¥è¡¼¥í¥Ã¥Ñ¤Î¸À¸ì¤Î¤Û¤È¤ó¤É¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +.TP +8859-3 (Latin-3) +Latin-3 ¤Ï¥¨¥¹¥Ú¥é¥ó¥È(Esperanto)¡¢¥¬¥ê¥·¥¢¸ì(Galician)¡¢¥Þ¥ë¥¿¸ì +(Maltese)¤Ê¤É¤Î½ñ¤­¼ê¤Î´Ö¤ÇÎɤ¯ÍѤ¤¤é¤ì¤ë¡£ +(¥È¥ë¥³¸ì(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 +8859-5 +.br +¥Ö¥ë¥¬¥ê¥¢¸ì(Bulgarian)¡¢¥Ù¥é¥ë¡¼¥·¸ì(Byelorussian)¡¢¥Þ¥±¥É¥Ë¥¢¸ì +(Macedonian)¡¢¥í¥·¥¢¸ì(Russian)¡¢¥»¥ë¥Ó¥¢¸ì(Serbian)¡¢¥¦¥¯¥é¥¤¥Ê¸ì +(Ukrainian) ¤ò¥µ¥Ý¡¼¥È¤¹¤ë¥­¥ê¥ëʸ»ú½¸¹ç¤Ç¤¢¤ë¡£ ¥¦¥¯¥é¥¤¥Ê¸ì¤Ç¤Ï +downstroke ¤ò¤Ä¤±¤¿ "ghe" ¤È¤¤¤¦Ê¸»ú¤ò "heh" ¤ÈÆɤߡ¢ +ghe ¤òÀµ¤·¤¯½ñ¤¯¤Ë¤Ï ghe ¤Ë upstroke ¤ò¤Ä¤±¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ÎÅÀ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +²¼¤Î KOI8-R ¤Ë´Ø¤¹¤ëµÄÏÀ¤ò»²¾È¤Î¤³¤È¡£ +.TP +8859-6 +.br +¥¢¥é¥Ó¥¢¸ì(Arabic)¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£8859-6 ¤Î¥°¥ê¥Õ¥Æ¡¼¥Ö¥ë(glyph table) +¤Ïʸ»ú¤Î·ÁÂÖ¤òʬ³ä¤·¤¿¸ÇÄêÉý¥Õ¥©¥ó¥È¤Ç¤¢¤ë¡£ +¤½¤Î¤¿¤á¡¢Å¬Àڤʥǥ£¥¹¥×¥ì¥¤¥¨¥ó¥¸¥ó¤¬Àµ¤·¤¤ +initial, medial, final ¥Õ¥©¡¼¥à¤Ë·ë¹ç¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +8859-7 +¸½Â奮¥ê¥·¥ã¸ì(Modern Greek)¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +.TP +8859-8 +niqud(¶çÆÉÅÀµ­¹æ) ¤Î¤Ê¤¤¶áÂå¥Ø¥Ö¥é¥¤¸ì(Hebrew)¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +niqud ¤È´°Á´¤ÊÀ»½ñÉ÷¥Ø¥Ö¥é¥¤¸ì(Biblical Hebrew)¤Ï¤³¤Îʸ»ú¥»¥Ã¥È¤Î +Âоݳ°¤Ç¤¢¤ë¡£ +Linux ¤Ç¤Ï¡¢¤³¤ì¤é¤Î¤¿¤á¤Ë¤Ï UTF-8 ¤¬¹¥¤Þ¤·¤¤¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ç¤¢¤ë¡£ +.TP +8859-9 (Latin-5) +¤³¤ì¤Ï¡¢Latin-1 ¤ÎÊѼï¤Ç¡¢¥¢¥¤¥¹¥é¥ó¥É¸ì¤Îʸ»ú¤ò¥È¥ë¥³¸ì(Turkish)ʸ»ú¤Ë +ÃÖ¤­´¹¤¨¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.TP +8859-10 (Latin-6) +Latin-6 ¤ÏË̲¤(Nordic)ÃÏ°è¤ò¥«¥Ð¡¼¤¹¤ë¤¿¤á¤Ë Latin-4 ¤Ë¤Ï´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤ +¥¤¥Ì¥¤¥Ã¥È¸ì(Inuit)(¥°¥ê¡¼¥ó¥é¥ó¥É¸ì(Greenlandic)) ¤È +¥µ¡¼¥á¸ì(Sami)(¥é¥Ã¥×¸ì(Lappish)) ¤ò²Ã¤¨¤Æ¤¢¤ë¡£ +RFC 1345 ¤Ë¤Ï¡¢¤³¤ÎÁ°Ãʳ¬¤Î¡¢°Û¤Ê¤Ã¤¿ "latin6" ¤¬ºÜ¤»¤é¤ì¤Æ¤¤¤ë¡£ +¥¹¥³¥ë¥È¡¦¥µ¡¼¥á¸ì(Skolt Sami)¤Ç¤Ï¡¢ +¤µ¤é¤Ë¤¤¤¯¤Ä¤«¤Î¥¢¥¯¥»¥ó¥Èµ­¹æ¤¬É¬ÍפȤ¹¤ë¡£ +.TP +8859-11 +¤³¤ì¤ÏµñÀ䤵¤ì¤¿Áð°Æɸ½à¤Î¤¿¤á¤À¤±¤Ë¸ºß¤¹¤ë¡£ +¤³¤ÎÁð°Æɸ½à¤Ï Linux ¤Ç¥¿¥¤¸ì¤Î¤¿¤á¤ËÍѤ¤¤é¤ì¤ë TIS-620 ¤ÈƱ¤¸¤â¤Î¤Ç¤¢¤ë¡£ +.TP +8859-12 +¤³¤Îʸ»ú¥»¥Ã¥È¤Ï¸ºß¤·¤Ê¤¤¡£ +¥Ù¥È¥Ê¥à¸ì¤¬¤³¤Î¾ì½ê¤ò»È¤¦¤è¤¦¤ËÄó°Æ¤·¤¿¤¬¡¢ +ISO 8859 ¤¬Äó°Æ¤¹¤ë(¹çÀ®¤Ç¤Ê¤¤) 96 ʸ»ú¤Ë¼ý¤Þ¤é¤Ê¤«¤Ã¤¿¡£ +Linux ¤Ç¤Ï¥Ù¥È¥Ê¥à¸ì¤ò°·¤¦¾ì¹ç¤Ï UTF-8 ¤¬¹¥¤Þ¤·¤¤Ê¸»ú¥»¥Ã¥È¤Ç¤¢¤ë¡£ +.TP +8859-13 (Latin-7) +¥Ð¥ë¥È³¤½ô¹ñ¤Î¸À¸ì¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +Æäˡ¢Latin-4 ¤Ë¸ºß¤·¤Ê¤¤¥é¥È¥Ó¥¢¸ì¤Îʸ»ú¤ò´Þ¤à¡£ +.TP +8859-14 (Latin-8) +¤³¤ì¤Ï¥±¥ë¥È¸ì¤Îʸ»ú¥»¥Ã¥È¤Ç¤¢¤ê¡¢¥²¡¼¥ë¸ì(Gaelic)¤È¥¦¥§¡¼¥ë¥º¸ì(Welsh)¤Ë +Âбþ¤¹¤ë¡£ +¤³¤Îʸ»ú¥»¥Ã¥È¤Ï¸ÅÂ奢¥¤¥ë¥é¥ó¥É¸ì¤ÇÍѤ¤¤é¤ì¤ëÉÕÅÀÉÕ¤­Ê¸»ú¤â´Þ¤à¡£ +.TP +8859-15 (Latin-9) +¤³¤ì¤Ï¥æ¡¼¥íµ­¹æ¤È Latin-1 ¤ËÆþ¤Ã¤Æ¤¤¤Ê¤¤¥Õ¥é¥ó¥¹¸ì¤È¥Õ¥£¥ó¥é¥ó¥É¸ì¤Îʸ»ú¤¬ +Äɲ䵤ì¤Æ¤¤¤ë¡£ +.TP +8859-16 (Latin-10) +¤³¤Îʸ»ú¥»¥Ã¥È¤Ï 8859-2 ¤ÇÂбþ¤¹¤ë¿¤¯¤Î¸À¸ì¤ËÂбþ¤·¡¢ +¤µ¤é¤Ë¥ë¡¼¥Þ¥Ë¥¢¸ì¤Ë¤Ï¤è¤ê´°Á´¤ËÂбþ¤¹¤ë¡£ +.SS KOI8-R +KOI8-R ¤Ï¥í¥·¥¢¤Ë¤ª¤¤¤ÆÎɤ¯ÍѤ¤¤é¤ì¤ë¡¢ISO ¤Ç¤Ê¤¤Ê¸»ú½¸¹ç¤Ç¤¢¤ë¡£ +²¼°ÌȾʬ¤Ï US ASCII ¤Ç¤¢¤ë¡£¾å°ÌȾʬ¤Ï ISO 8859-5 ¤è¤ê´öʬÎɤ¯ +¥Ç¥¶¥¤¥ó¤µ¤ì¤¿¥­¥ê¥ëʸ»ú½¸¹ç¤Ç¤¢¤ë¡£ +KOI8-U ¤Ï KOI8-R ¤ò¸µ¤Ë¤·¤¿¶¦ÄÌʸ»ú¥»¥Ã¥È¤Ç¤¢¤ê¡¢ +¥¦¥¯¥é¥¤¥Ê¸ì(Ukrainian) ¤Ë¤è¤ê¤è¤¯Âбþ¤¹¤ë¡£ +¤³¤ì¤é¤Î¤É¤Á¤é¤â ISO-8859 ¥·¥ê¡¼¥º¤Î¤è¤¦¤Ë ISO-2022 ¸ß´¹¤Ç¤Ï¤Ê¤¤¡£ +.LP +Linux ¤Ç¤Î KOI8-R ¤Î¥³¥ó¥½¡¼¥ë¥µ¥Ý¡¼¥È¤Ï¡¢ +¥æ¡¼¥¶¥â¡¼¥É¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ç¼Â¸½¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¥­¡¼¥Ü¡¼¥É¤Î³ä¤êÅö¤Æ¤È EGA ¥°¥é¥Õ¥£¥Ã¥¯¥Æ¡¼¥Ö¥ë¤òÊѹ¹¤·¡¢ +¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð¤Î¥Õ¥©¥ó¥È¥Æ¡¼¥Ö¥ë¤Ë "¥æ¡¼¥¶³ä¤êÅö¤Æ" ¤ò¹Ô¤¦¡£ +.\" Thanks to Tomohiro KUBOTA for the following sections about +.\" national standards. +.SS JIS X 0208 +JIS X 0208 ¤ÏÆüËܸì¤Î¹ñÄêɸ½àʸ»ú¥»¥Ã¥È¤Ç¤¢¤ë¡£ +¾¤Ë¤â¤¤¤¯¤Ä¤«ÆüËܸì¤Î¹ñÄêɸ½àʸ»ú¥»¥Ã¥È¤Ï¤¢¤ë +(JIS X 0201, JIS X 0212, JIS X 0213 ¤Ê¤É)¤¬¡¢¤³¤ì¤¬ºÇ¤â½ÅÍפǤ¢¤ë¡£ +ʸ»ú¤Ï 94x94 ¤Î 2 ¥Ð¥¤¥È¥Þ¥È¥ê¥Ã¥¯¥¹¤ËÇÛÃÖ¤µ¤ì¤ë¡£ +³Æ¥Ð¥¤¥È¤Ï 0x21-0x7e ¤ÎÃͤò»ý¤Ä¡£ +JIS X 0208 ¤Ïʸ»ú¥»¥Ã¥È¤Ç¤¢¤ê¡¢¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ç¤Ï¤Ê¤¤¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤³¤ì¤Ï¡¢ +JIS X 0208 ¼«¿È¤Ï¥Æ¥­¥¹¥È¥Ç¡¼¥¿¤Îɽ¸½¤Ë¤Ï»È¤ï¤ì¤Ê¤¤¡¢¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +JIS X 0208 ¤Ï¡¢ +EUC-JP, Shift_JIS, ISO-2022-JP ¤È¤¤¤Ã¤¿¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ò +¹½À®¤¹¤ëÉôÉʤȤ·¤ÆÍѤ¤¤é¤ì¤ë¡£ +EUC-JP ¤¬ Linux ¤Ë¤ª¤¤¤ÆºÇ¤â½ÅÍפʥ¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ç¤¢¤ê¡¢ +US ASCII ¤È JIS X 0208 ¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +EUC-JP ¤Ç¤Ï¡¢JIS X 0208 ʸ»ú¤Ï 2 ¥Ð¥¤¥È¤Çɽ¸½¤µ¤ì¡¢ +³Æ¥Ð¥¤¥È¤Ï JIS X 0208 ¥³¡¼¥É¤Ë 0x80 ¤ò²Ã¤¨¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.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 ¤Ë¤ª¤¤¤ÆºÇ¤â½ÅÍפʥ¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ç¤¢¤ê¡¢ +US ASCII ¤È KS X 1001 ¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +KS C 5601 ¤Ï KS X 1001 ¤Î¸Å¤¤Ì¾Á°¤Ç¤¢¤ë¡£ +.SS GB 2312 +GB 2312 ¤Ï¡¢´ÊÂÎʸ»ú¤òɽ¸½¤¹¤ë¤¿¤á¤ÎÃæ¹ñ¤Î¹ñÄêɸ½àʸ»ú¥»¥Ã¥È¤Ç¤¢¤ë¡£ +JIS X 0208 ¤ÈƱÍͤˡ¢Ê¸»ú¤Ï 94x94 ¤Î 2 ¥Ð¥¤¥È¥Þ¥È¥ê¥Ã¥¯¥¹¤ËÇÛÃÖ¤µ¤ì¡¢ +EUC-CN ¤ËÍѤ¤¤é¤ì¤ë¡£ +EUC-CN ¤Ï Linux ¤Ë¤ª¤¤¤ÆºÇ¤â½ÅÍפʥ¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ç¤¢¤ê¡¢ +US ASCII ¤È GB 2312 ¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +EUC-CN ¤Ï¤·¤Ð¤·¤Ð GB, GB 2312, CN-GN ¤Ê¤É¤È¸Æ¤Ð¤ì¤ë¡£ +.SS Big5 +Big5 ¤ÏÂæÏѤÇÈËÂÎʸ»ú¤òµ­½Ò¤¹¤ë¤Î¤Ë°ìÈÌŪ¤Ë»È¤ï¤ì¤ëʸ»ú¥»¥Ã¥È¤Ç¤¢¤ë¡£ +(Big5 ¤Ïʸ»ú¥»¥Ã¥È¤È¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ÎξÊý¤Ç¤¢¤ë¡£) +¤³¤ì¤Ï US ASCII ¤Î¾å°Ì½¸¹ç¤Ç¤¢¤ë¡£ +Èó ASCII ʸ»ú¤Ï 2 ¥Ð¥¤¥È¤Çɽ¸½¤¹¤ë¡£ +0xa1-0xfe ¤Î¥Ð¥¤¥È¤Ï 2 ¥Ð¥¤¥Èʸ»ú¤Î 1 ʸ»úÌܤȤ·¤ÆÍѤ¤¤ë¡£ +Big5 ¤È¤½¤Î³ÈÄ¥¤ÏÂæÏѤȹá¹Á¤Ç¹­¤¯ÍѤ¤¤é¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï ISO 2022 ½àµò¤Ç¤Ï¤Ê¤¤¡£ +.SS TIS 620 +TIS 620 ¤Ï¥¿¥¤¤Î¹ñÄêɸ½àʸ»ú¥»¥Ã¥È¤Ç¡¢US ASCII ¤Î¾å°Ì½¸¹ç¤Ç¤¢¤ë¡£ +ISO 8859 ¥·¥ê¡¼¥º¤ÈƱÍͤˡ¢¥¿¥¤Ê¸»ú¤Ï 0xa1-0xfe ¤ËÇÛÃÖ¤µ¤ì¤ë¡£ +TIS 620 ¤Ï Linux ¤Ç¤Î¤ß°ìÈÌŪ¤ËÍѤ¤¤é¤ì¤Æ¤¤¤ëʸ»ú¥»¥Ã¥È¤Ç¤¢¤ê¡¢ +¤Þ¤¿¡¢UTF-8 ¤Ï¹çÀ®Ê¸»ú¤â»ý¤Ã¤Æ¤¤¤ë¡£ +.SS UNICODE +Unicode (ISO10646) ¤Ï¡¢¿Í´Ö¤¬ÍѤ¤¤ëÁ´¤Æ¤Î¸À¸ì¤ÎÁ´¤Æ¤Îʸ»ú¤ò¡¢ +ÌÀ³Î¤Ë¤¢¤é¤ï¤¹¤³¤È¤òÌÜŪ¤È¤·¤¿µ¬³Ê¤Ç¤¢¤ë¡£ +Unicode ¤Î¹½Â¤¤Ï³Æʸ»ú¤Î¥¨¥ó¥³¡¼¥É¤Ë 20.1 ¥Ó¥Ã¥È¤òÍ¿¤¨¤Æ¤¤¤ë¡£ +¤Û¤È¤ó¤É¤Î¥³¥ó¥Ô¥å¡¼¥¿¡¼¤Ï 20.1 ¥Ó¥Ã¥È¤ÎÀ°¿ô¤ò°·¤¨¤Ê¤¤¤Î¤Ç¡¢ +Unicode ¤ÏÉáÄÌÆâÉô¥Ç¡¼¥¿¤È¤·¤Æ 32 ¥Ó¥Ã¥ÈÀ°¿ô¤Ë¥¨¥ó¥³¡¼¥É¤µ¤ì¡¢ +16 ¥Ó¥Ã¥ÈÀ°¿ô¤ÎÎó (UTF-16)(¤¢¤ë¼ï¤ÎÄÁ¤·¤¤Ê¸»ú¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë¾ì¹ç¤Ë¤À¤± +2 ¤Ä¤Î 16 ¥Ó¥Ã¥ÈÀ°¿ô¤¬É¬ÍפȤʤë)¤«¡¢ +8 ¥Ó¥Ã¥È¥Ð¥¤¥È¤ÎÎó (UTF-8)¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +Unicode ¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï¡¢ ¤«¤éÆÀ¤é¤ì¤ë¡£ +.LP +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 +0,1,x ¤ò¥¼¥í¡¢£±¡¢Ç¤°Õ¤Î¥Ó¥Ã¥È¤È¤¹¤ë¤È¡¢¤¢¤ë¥Ð¥¤¥È 0xxxxxxx ¤Ï Unicode ¤Ç¤Ï +00000000 0xxxxxxx ¤È¤¢¤é¤ï¤µ¤ì¤ë¡£¤³¤ì¤Ï¡¢ASCII ¤Î 0xxxxxxx ¤ÈƱ¤¸ +¥·¥ó¥Ü¥ë¤Î¥³¡¼¥É¤Ç¤¢¤ë¡£¤³¤Î¤è¤¦¤Ë¡¢ASCII ¤ÏÊѹ¹¤Ê¤·¤Ë UTF-8 ¤ËÊÑ´¹¤Ç¤­¡¢ +ASCII ¤Î¤ß¤ò»È¤¦¾ì¹ç¤Ï¡¢¥³¡¼¥É¤Ë¤ª¤¤¤Æ¤â¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ë¤ª¤¤¤Æ¤â¡¢ +Êѹ¹¤Ë´Ø¤·¤Æ²¿¤âµ¤¤Ë¤·¤Ê¤¯¤Æ¤è¤¤¡£ +.LP +110xxxxx ¤È¤¤¤¦¥Ð¥¤¥È¤Ï 2 ¥Ð¥¤¥È¥³¡¼¥É¤Î»Ï¤Þ¤ê¤Ç¤¢¤ë¡¢¤½¤·¤Æ¡¢110xxxxx +10yyyyyy ¤Ï 00000xxx xxyyyyyy ¤È¤¤¤¦¤è¤¦¤ËÁȤßΩ¤Æ¤é¤ì¤ë¡£¤Þ¤¿¡¢ +1110xxxx ¤Ï 3 ¥Ð¥¤¥È¥³¡¼¥É¤Î»Ï¤Þ¤ê¤Ç¤¢¤ê¡¢1110xxxx 10yyyyyy 10zzzzzz +¤Ï xxxxyyyy yyzzzzzz ¤È¤¤¤¦¤è¤¦¤ËÁȤßΩ¤Æ¤é¤ì¤ë(UTF-8 ¤¬ 31 ¥Ó¥Ã¥È +ISO 10646 ¥³¡¼¥É¤òÍøÍѤ¹¤ë¤È¤­¤Ï¡¢¤³¤Î¹©Äø¤Ï 6 ¥Ð¥¤¥È¥³¡¼¥É¤Þ¤ÇȯŸ¤µ¤»¤é¤ì¤ë)¡£ +.LP +ISO-8859-1 ʸ»ú¥»¥Ã¥È¤ò»È¤¦¤Û¤È¤ó¤É¤Î¥æ¡¼¥¶¤Ë¤È¤Ã¤Æ¡¢ +¤³¤Î»ö¼Â¤Ï¡¢ASCII ¤ÎÈϰϳ°¤ò»È¤Ã¤¿Ê¸»ú¤Ï +Æó¤Ä¤Î¥Ð¥¤¥È¤ËÉä¹æ²½¤µ¤ì¤ë¤È¤¤¤¦¤³¤È¤ò°ÕÌ£¤¹¤ë¡£¤³¤Î¤³¤È¤«¤é +(UTF-8 ¤ò»È¤¦¤È¡¢ISO-8859-1¤ò»ÈÍѤ·¤Æ¤¤¤ë)¸µ¡¹¤Î¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤«¤é +1 ¡Á 2 ¥Ñ¡¼¥»¥ó¥ÈÂ礭¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤³¤È¤Ë¤Ê¤ë¡£ +¥í¥·¥¢¸ì¤ä¥®¥ê¥·¥ã¸ì¤òÍøÍѤ¹¤ë¥æ¡¼¥¶¡¼¤Ë¤È¤Ã¤Æ¤Ï¡¢ +¤³¤ì¤Ë¤è¤Ã¤Æ¸µ¤Î¥Æ¥­¥¹¥È¤Ï 2 ÇܤÎÂ礭¤µ¤Ë¤Ê¤ë¤³¤È¤Ë¤Ê¤ë¡£ +¤Ê¤¼¤Ê¤é¤³¤ì¤é¤Î¸À¸ì¤Ï¤Û¤È¤ó¤É¤¬ ASCII ¤ÎÈϰϳ°¤À¤«¤é¤Ç¤¢¤ë¡£ +¸½ºß 16-bit ¥³¡¼¥É¤ò¹­¤¯ÍøÍѤ·¤Æ¤¤¤ëÆüËܸì¤òÍøÍѤ¹¤ë¥æ¡¼¥¶¤Ë¤Ï +3 ¥Ð¥¤¥ÈɬÍפȤʤ롣 +Unicode ¤Ø¤ÎÊÑ´¹¤Ë¥¢¥ë¥´¥ê¥º¥àŪÊÑ´¹¤ò¤¹¤ì¤Ð¤è¤¤Ê¸»ú¥»¥Ã¥È¤¬¤¢¤ë +(ÆÃ¤Ë ISO-8859-1)°ìÊý¡¢°ìÈÌŪ¤Ë¤ÏÊÑ´¹¥Æ¡¼¥Ö¥ë¤¬É¬ÍפǤ¢¤ê¡¢ +16 ¥Ó¥Ã¥È¥³¡¼¥É¤Î¾ì¹ç¤Ï¤³¤Î¥Æ¡¼¥Ö¥ë¤Ï¤«¤Ê¤êÂ礭¤Ê¤â¤Î¤È¤Ê¤ë¡£ +.LP +UTF-8 ¤Ï¼«¸ÊƱ´üŪ¤Ç¤¢¤ë¡£10xxxxxx ¤Ï½ªÃ¼¤Ç¤¢¤ê¡¢¤Û¤«¤Î¥Ð¥¤¥È¤Ï¥³¡¼¥É¤Î +ÀèƬ¤Ç¤¢¤ë¡£UTF-8 ¤Îʸ»úÎó¤Ë¤ª¤±¤ë ASCII ¤Î¥Ð¥¤¥È¤Ï¡¢¾ï¤Ë¤½¤Îʸ»ú¼«¿È¤ò +ɽ¸½¤¹¤ë¤³¤È¤ËÃíÌܤ·¤Æ¤Û¤·¤¤¡£Æäˡ¢´ö¤Ä¤«¤ÎÂ礭¤Ê¥³¡¼¥É¤Î¥Ñ¡¼¥È¤ò·ÁÀ® +¤¹¤ë¤¿¤á¤Ë¡¢NUL (\(aq\\0\(aq)) ¤ä \(aq/\(aq ¤òËä¤á¹þ¤àɬÍפϤʤ¤¡£ +.LP +ASCII ¤È NUL ¤È \(aq/\(aq ¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¤¿¤á¡¢¥«¡¼¥Í¥ë¤Ï UTF-8 ¤ò +»ÈÍѤ·¤Æ¤¤¤ë¤³¤È¤òÆä˰ռ±¤·¤Ê¤¯¤Æ¤âÎɤ¤¡£ +¥«¡¼¥Í¥ë¤Ï¥Ð¥¤¥È¤¬²¿¤ò¤¢¤é¤ï¤·¤Æ¤¤¤ë¤«¤ËÃí°Õ¤¹¤ëɬÍפ¬¤Ê¤¤¡£ +.LP +Unicode ¥Ç¡¼¥¿Îó¤Î¥ì¥ó¥À¥ê¥ó¥°¤Ïŵ·¿Åª¤Ë¤Ï Unicode ¤Î¥µ¥Ö¥»¥Ã¥È¤«¤é +¥°¥ê¥Õ¤Ø¤Î¥Þ¥Ã¥×¤Ç¤¢¤ë"¥µ¥Ö¥Õ¥©¥ó¥È(subfont)"¥Æ¡¼¥Ö¥ë¤òÍøÍѤ·¤Æ +¹Ô¤ï¤ì¤ë¡£¥«¡¼¥Í¥ëÆâÉô¤Ç¤Ï¡¢Unicode ¤ò ¥Ó¥Ç¥ª RAM ÆâÉô¤Ë¥í¡¼¥É¤µ¤ì¤¿ +¥µ¥Ö¥Õ¥©¥ó¥È¤È¤·¤Æµ­½Ò¤¹¤ë¡£¤³¤ì¤Ï¡¢UTF-8 ¥â¡¼¥É¤Ç¤Ï 512 ¤Î°Û¤Ê¤Ã¤¿¥·¥ó¥Ü¥ë¤ò +»ý¤Ã¤¿Ê¸»ú½¸¹ç¤òÍøÍѲÄǽ¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¤³¤ì¤Ï¡¢ÆüËܸ졢Ãæ¹ñ¸ì¡¢´Ú¹ñ¸ì¤Ç¤Ï½½Ê¬¤Ç¤Ï¤Ê¤¤¡¢¤·¤«¤·¡¢¤½¤Î¾¤ÎÍøÍÑ¤Ç¤Ï +½½Ê¬¤Ç¤¢¤ë¡£ +.LP +¸½ºß¤Î¤È¤³¤í¡¢¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð¤Ï¹çÀ®Ê¸»ú¤ò°·¤¨¤Ê¤¤¡£ +½¾¤Ã¤Æ¡¢¥¿¥¤¸ì¡¢¥¹¡¼¸ì¤ä¤½¤Î¾¤Î¹çÀ®Ê¸»ú¤¬É¬ÍפÊʸ¾Ï¤Ï +¥³¥ó¥½¡¼¥ë¤Ç¤Ï°·¤¨¤Ê¤¤¡£ +.SS "ISO 2022 ¤È ISO 4873" +ISO 2022 ¤È ISO 4873 ɸ½à¤Ç¤Ï¡¢ +VT100 ¤ÎÆ°ºî¤Ë´ð¤Å¤¤¤¿¥Õ¥©¥ó¥È¥³¥ó¥È¥í¡¼¥ë¥â¥Ç¥ë¤ò½Ò¤Ù¤é¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥â¥Ç¥ë¤Ï Linux ¥«¡¼¥Í¥ë¤ä +.BR xterm (1) +¤Ë¤ª¤¤¤Æ(ÉôʬŪ¤Ë)¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£¤³¤Îɸ½à¤ÏÆüËܤä´Ú¹ñ¤Ë¤ª¤¤¤Æ¤è¤¯ +ÍѤ¤¤é¤ì¤ë¡£ +.LP +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 ¤Î¥³¡¼¥É¤ò»ÈÍѤ¹¤ë¡£ +.LP +ʸ»ú½¸¹ç¤ÎÀÚ¤êÂؤ¨¤Ï¥·¥Õ¥È¥Õ¥¡¥ó¥¯¥·¥ç¥ó \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) ¤ò»È¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£ +¥Õ¥¡¥ó¥¯¥·¥ç¥ó LS\fIn\fP ¤ÏºÇ¾å°Ì¥Ó¥Ã¥È¤¬ 0 ¤Ç¤¢¤ë¥³¡¼¥É¤Î¤¿¤á¤Îʸ»ú½¸¹ç¤ò +G\fIn\fP ¤ËÀßÄꤹ¤ë¡£ +¥Õ¥¡¥ó¥¯¥·¥ç¥ó LS\fIn\fPR ¤ÏºÇ¾å°Ì¥Ó¥Ã¥È¤¬ 1 ¤Ç¤¢¤ë¥³¡¼¥É¤Î¤¿¤á¤Îʸ»ú¥»¥Ã¥È¤ò +G\fIn\fP ¤ËÀßÄꤹ¤ë¡£ +¥Õ¥¡¥ó¥¯¥·¥ç¥ó SS\fIn\fP ¤Ï(ºÇ¾å°Ì¥Ó¥Ã¥È¤ÎÃͤˤ«¤«¤ï¤é¤º)¼¡¤Îʸ»ú¤Î¤ß +ʸ»ú½¸¹ç¤ò G\fIn\fP (\fIn\fP=2 ¤Þ¤¿¤Ï 3)¤ËÀßÄꤹ¤ë¡£ +.LP +94 ʸ»ú½¸¹ç¤Ç¤Ï¡¢¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ ESC ( xx (G0 ÍÑ), ESC ) xx (G1 +ÍÑ), ESC * xx (G2 ÍÑ), ESC + xx (G3 ÍÑ) ¤Ë¤è¤Ã¤Æ¡¢G\fIn\fP ʸ»ú½¸¹ç +¤òÍѤ¤¤ë¤è¤¦¤Ë»Ø¼¨¤µ¤ì¤ë¡£ +xx ¤Ï "ISO 2375 International Register of Coded Character Sets" ¤Ç +·è¤á¤é¤ì¤Æ¤¤¤ë°ìʸ»ú¡¢¤Þ¤¿¤ÏÆóʸ»ú¤Ç¤¢¤ë¡£ +¤¿¤È¤¨¤Ð ESC ( @ ¤Ï ISO 646 ʸ»ú½¸¹ç¤ò G0 ¤È¤·¤ÆÁª¤Ó¡¢ESC ( A +¤Ï(¥Ê¥ó¥Ð¡¼¥µ¥¤¥ó(¡ô)¤ÎÂå¤ï¤ê¤Ë¡¢¥Ý¥ó¥É(¡ò)¤ò»ý¤Ä) UK ¥¹¥¿¥ó¥À¡¼¥Éʸ»ú½¸¹ç¤ò +ÁªÂò¤¹¤ë¡£ESC ( B ¤Ï(Ä̲ߵ­¹æ¤Î¤«¤ï¤ê¤Ë¥À¥é¡¼(¡ð)¤ò»ý¤Ä) ASCII¤òÁªÂò¤¹¤ë¡£ +ESC ( M ¤Ï ¥¢¥Õ¥ê¥«¸À¸ì(African languages) ¤òÁªÂò¤·¡¢ESC +( ! A ¤Ï ¥­¥å¡¼¥Ð¸ì(Cuban)ʸ»ú½¸¹ç¤òÁªÂò¤¹¤ë¡£¤Ê¤É¤Ê¤É¡Ä +.LP +96-ʸ»ú½¸¹ç¤Ç¤Ï¡¢¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ ESC +\- xx (G1 ÍÑ), ESC . xx (G2 ÍÑ), ECS / xx (G3 ÍÑ)¤òÍѤ¤¤ë¤³¤È¤Ç¡¢ +G\fIn\fP ʸ»ú½¸¹ç¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë»Ø¼¨¤µ¤ì¤ë¡£ +Î㤨¤Ð¡¢ESC - G ¤Ï¥Ø¥Ö¥é¥¤¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È(Hebrew alphabet) ¤ò +G1 ¤È¤·¤ÆÁªÂò¤¹¤ë¡£ +.LP +¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú½¸¹ç¤Ç¤Ï¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ E $ xx ¤Þ¤¿¤Ï ESC $ ( xx +(G0 ÍÑ), ESC $ ) xx (G1 ÍÑ), ESC $ * xx (G2 ÍÑ), ESC$ + xx (G3 ÍÑ) ¤ò +ÍѤ¤¤ë¤³¤È¤Ç¡¢ G\fIn\fP ʸ»ú½¸¹ç¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë»Ø¼¨¤µ¤ì¤ë¡£ +Î㤨¤Ð¡¢ESC $ ( C ¤Ï ´Ú¹ñ¸ì(Korean)ʸ»ú½¸¹ç¤ò G0 ¤È¤·¤ÆÁªÂò¤¹¤ë¡£ +ESC $ B ¤Ë¤è¤Ã¤ÆÁªÂò¤µ¤ì¤ëÆüËܸìʸ»ú¥»¥Ã¥È¤Ï¡¢¤è¤êºÇ¶á¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï +ESC & @ ESC $ B ¤Ë¤è¤Ã¤ÆÁªÂò¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +.LP +ISO 4873 ¤Ï¤è¤êÀ©¸Â¤µ¤ì¤¿Ê¸»ú½¸¹ç¤ÎÍøÍѤòµ¬Äꤹ¤ë¡¢¤½¤Îµ¬Äê¤Ç +¤Ï¡¢G0 ¤Ï(¾ï¤Ë ASCII¤Ë)¸ÇÄꤵ¤ì¤ë¡£½¾¤Ã¤Æ¡¢G1, G2, G3 ¤ÏºÇ¾å°Ì¥Ó¥Ã¥È¤¬ +¥»¥Ã¥È¤µ¤ì¤¿¥³¡¼¥É¤È¤·¤Æ¤Î¤ß¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +Æäˡ¢\fB^N\fP ¤È \fB^O\fP ¤ÏÍѤ¤¤é¤ì¤º¡¢ESC ( xx ¤Ï xx=B ¤È¤·¤Æ¤Î¤ß +ÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¡¢ +ESC ) xx, ESC * xx, ESC + xx ¤Ï¤½¤ì¤¾¤ì ESC \- xx, ESC . xx, ESC / xx ¤È +Åù²Á¤Ë¤Ê¤ë¡£ +.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) diff --git a/release/man7/complex.7 b/release/man7/complex.7 new file mode 100644 index 00000000..1e1dc1f8 --- /dev/null +++ b/release/man7/complex.7 @@ -0,0 +1,61 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" Distributed under GPL +.\" +.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2003-08-02, Akihiro MOTOKI +.\" Updated 2005-02-20, Akihiro MOTOKI +.\" +.\"WORD: operations ±é»» +.\"WORD: imaginary unit µõ¿ôñ°Ì +.\" +.TH COMPLEX 7 2009-07-25 "" "Linux Programmer's Manual" +.SH ̾Á° +complex \- Ê£ÁÇ¿ô¤Î¿ô³Ø¤Î´ðÁà +.SH ½ñ¼° +.B #include +.SH ÀâÌÀ +Ê£ÁÇ¿ô¤Ï z = a+b*i ¤Î·Á¼°¤Î¿ô¤Ç¤¢¤ë¡£ a ¤È b ¤Ï¼Â¿ô¤Ç¤¢¤ê¡¢ +i ¤Ï i = sqrt(\-1) ¤Ä¤Þ¤ê i*i = \-1 ¤Î´Ø·¸¤òËþ¤¿¤¹¡£ +.br +Ê£ÁÇ¿ô¤òɽ¸½¤¹¤ëÊ̤ÎÊýË¡¤â¤¢¤ë¡£¼Â¿ô¤ÎÁÈ (a,b) ¤Ï XºÂɸ¡¢YºÂɸ¤Ç +»ØÄꤵ¤ì¤¿Ê¿Ì̾å¤ÎÅÀ¤È¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤³¤ÎƱ¤¸ÅÀ¤Ï¡¢¼Â¿ô¤ÎÁÈ +(r,phi) ¤Çɽ¤¹¤³¤È¤â¤Ç¤­¤ë¡£r ¤Ï¸¶ÅÀ 0 ¤«¤é¤Îµ÷Î¥¤Ç¤¢¤ê¡¢phi ¤Ï +X¼´¤È 0 ¤È z ¤ò·ë¤ÖÀþʬ¤¬¤Ê¤¹³Ñ¤Ç¤¢¤ë¡£¤³¤Î¤È¤­¡¢ +z = r*exp(i*phi) = r*(cos(phi)+i*sin(phi)) +¤Î´Ø·¸¤¬À®¤êΩ¤Ä¡£ +.PP +2¤Ä¤ÎÊ£ÁÇ¿ô z = a+b*i, w = c+d*i ¤Ë´Ø¤¹¤ë´ðËܱ黻¤Ï¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë: +.TP +.B ²ÃË¡: z+w = (a+c) + (b+d)*i +.TP +.B ¾èË¡: z*w = (a*c \- b*d) + (a*d + b*c)*i +.TP +.B ½üË¡: z/w = ((a*c + b*d)/(c*c + d*d)) + ((b*c \- a*d)/(c*c + d*d))*i +.PP +¤Û¤È¤ó¤ÉÁ´¤Æ¤Î¿ô³Ø´Ø¿ô¤Ë´Ø¤·¤ÆÊ£ÁÇ¿ôÈǤ¬¤¢¤ë¤¬¡¢ +Ê£ÁÇ¿ôÀìÍѤδؿô¤â´ö¤Ä¤«¤¢¤ë¡£ +.SH Îã +»ÈÍѤ¹¤ë C ¥³¥ó¥Ñ¥¤¥é¤¬ C99 ɸ½à¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ì¤ÐÊ£ÁÇ¿ô¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +\fI\-lm\fP ¤ò¤Ä¤±¤Æ¥ê¥ó¥¯¤¹¤ë¤³¤È¡£µõ¿ôñ°Ì¤Ï I ¤Çɽ¸½¤µ¤ì¤ë¡£ +.sp +.nf +/* exp(i * pi) == \-1 ¤È¤Ê¤ë¤³¤È¤ò³Îǧ¤¹¤ë */ +#include /* for atan */ +#include +#include + +int +main(void) +{ + double pi = 4 * atan(1.0); + double complex z = cexp(I * pi); + printf("%f + %f * i\\n", creal(z), cimag(z)); +} +.fi +.SH ´ØÏ¢¹àÌÜ +.BR cabs (3), +.BR carg (3), +.BR cexp (3), +.BR cimag (3), +.BR creal (3) diff --git a/release/man7/credentials.7 b/release/man7/credentials.7 new file mode 100644 index 00000000..b140150c --- /dev/null +++ b/release/man7/credentials.7 @@ -0,0 +1,297 @@ +.\" Copyright (c) 2007 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. +.\" +.\" 2007-06-13 Creation +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI all rights reserved. +.\" Translated 2007-10-25, Akihiro MOTOKI , LDP v2.66 +.\" Updated 2008-08-04, Akihiro MOTOKI, LDP v3.05 +.\" +.TH CREDENTIALS 7 2008-06-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +credentials \- ǧ¾Ú¤ËÍѤ¤¤é¤ì¤ë¥×¥í¥»¥¹¤Î¼±ÊÌ»Ò +.SH ÀâÌÀ +.SS ¥×¥í¥»¥¹ID (PID) +³Æ¥×¥í¥»¥¹¤Ï¡¢Éé¤Ç¤Ê¤¤À°¿ô¤Î°ì°Õ¤Ê¼±Ê̻Ҥò»ý¤Ä¡£ +¤³¤Î¼±ÊÌ»Ò¤Ï +.BR fork (2) +¤ò»È¤Ã¤Æ¥×¥í¥»¥¹¤¬À¸À®¤µ¤ì¤ëºÝ¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¡£ +¥×¥í¥»¥¹¤Ï +.BR getpid (2) +¤ò»È¤Ã¤Æ¼«Ê¬¤Î PID ¤ò¼èÆÀ¤Ç¤­¤ë¡£ +PID ¤Ï +.I pid_t +·¿¤Çɽ¸½¤µ¤ì¤ë +.RI ( pid_t +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ + +PID ¤Ï³Æ¼ï¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ºîÍѤ¹¤ë¥×¥í¥»¥¹¤ò +ÆÃÄꤹ¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£°Ê²¼¤ËÎã¤òµó¤²¤ë: +.BR kill (2), +.BR ptrace (2), +.BR setpriority (2), +.\" .BR sched_rr_get_interval (2), +.\" .BR sched_getaffinity (2), +.\" .BR sched_setaffinity (2), +.\" .BR sched_getparam (2), +.\" .BR sched_setparam (2), +.\" .BR sched_setscheduler (2), +.\" .BR sched_getscheduler (2), +.BR setpgid (2), +.\" .BR getsid (2), +.BR setsid (2), +.BR sigqueue (2), +.BR waitpid (2). +.\" .BR waitid (2), +.\" .BR wait4 (2), + +¥×¥í¥»¥¹¤Î PID ¤Ï +.BR execve (2) +¤ÎÁ°¸å¤ÇÉÔÊѤǤ¢¤ë¡£ +.SS ¿Æ¥×¥í¥»¥¹ ID (PPID) +¥×¥í¥»¥¹¤Î¿Æ¥×¥í¥»¥¹¤Î ID ¤Ï¡¢ +.BR fork (2) +¤ò»È¤Ã¤Æ¤½¤Î¥×¥í¥»¥¹¤òÀ¸À®¤·¤¿¥×¥í¥»¥¹¤ò¼¨¤¹¡£ +¥×¥í¥»¥¹¤Ï +.BR getppid (2) +¤ò»È¤Ã¤Æ¼«Ê¬¤Î PPID ¤ò¼èÆÀ¤Ç¤­¤ë¡£ +PPID ¤Ï +.I pid_t +·¿¤Çɽ¸½¤µ¤ì¤ë¡£ + +¥×¥í¥»¥¹¤Î PPID ¤Ï +.BR execve (2) +¤ÎÁ°¸å¤ÇÉÔÊѤǤ¢¤ë¡£ +.SS ¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤È¥»¥Ã¥·¥ç¥ó ID +³Æ¥×¥í¥»¥¹¤Ï¥»¥Ã¥·¥ç¥ó ID ¤È¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤ò»ý¤Ä¡£ +¤³¤ì¤é¤Î ID ¤Ï¤É¤Á¤é¤â +.I pid_t +·¿¤Çɽ¸½¤µ¤ì¤ë¡£ +¥×¥í¥»¥¹¤Ï¡¢¤½¤ì¤¾¤ì +.BR getsid (2), +.BR getpgrp (2) +¤ò»È¤Ã¤Æ¼«Ê¬¤Î¥»¥Ã¥·¥ç¥ó ID¡¢¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤ò¼èÆÀ¤Ç¤­¤ë¡£ + +.BR fork (2) +¤ÇÀ¸À®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤È¥×¥í¥»¥¹¥°¥ë¡¼¥× ID +¤ò·Ñ¾µ¤¹¤ë¡£¥×¥í¥»¥¹¤Î¥»¥Ã¥·¥ç¥ó ID ¤È¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤Ï +.BR execve (2) +¤ÎÁ°¸å¤ÇÉÔÊѤǤ¢¤ë¡£ + +¥»¥Ã¥·¥ç¥ó¤È¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î³µÇ°¤Ï¡¢¥·¥§¥ë¤Î¥¸¥ç¥ÖÀ©¸æ¤ò¹Ô¤¦¤¿¤á¤Ë +¹Í°Æ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¥×¥í¥»¥¹¥°¥ë¡¼¥× (»þ¤Ë¤Ï¡Ö¥¸¥ç¥Ö¡×¤È¸Æ¤Ð¤ì¤ë¤³¤È¤â¤¢¤ë) ¤Ï¡¢ +Ʊ¤¸¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤ò¶¦Í­¤¹¤ë¥×¥í¥»¥¹¤Î½¸¤Þ¤ê¤Ç¤¢¤ë¡£ +¥·¥§¥ë¤Ï¡¢°ì¤Ä¤Î¥³¥Þ¥ó¥É¤â¤·¤¯¤Ï¥Ñ¥¤¥×¥é¥¤¥ó¤Î¼Â¹Ô¤Ë»È¤ï¤ì¤ë¥×¥í¥»¥¹·²¤Ë +ÂФ·¤Æ°ì¤Ä¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤òÀ¸À®¤¹¤ë +(Î㤨¤Ð¡¢¥³¥Þ¥ó¥É "ls\ |\ wc" ¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤ËÀ¸À®¤µ¤ì¤ëÆó¤Ä¤Î¥×¥í¥»¥¹¤Ï +Ʊ¤¸¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ËÃÖ¤«¤ì¤ë)¡£ +½ê°¤¹¤ë¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ï +.BR setpgid (2) +¤ò»È¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡£ +¼«¿È¤Î¥×¥í¥»¥¹ ID ¤¬¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤ÈƱ¤¸¥×¥í¥»¥¹¤Ï¡¢ +¤½¤Î¥°¥ë¡¼¥×¤Î¡Ö¥×¥í¥»¥¹¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼¡×¤Ç¤¢¤ë¡£ + +¥»¥Ã¥·¥ç¥ó¤Ï¡¢Æ±¤¸¥»¥Ã¥·¥ç¥ó ID ¤ò¶¦Í­¤¹¤ë¥×¥í¥»¥¹¤Î½¸¤Þ¤ê¤Ç¤¢¤ë¡£ +¤¢¤ë°ì¤Ä¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¡¼¤ÏƱ¤¸¥»¥Ã¥·¥ç¥ó ID ¤ò»ý¤Ä +(¤Ä¤Þ¤ê¡¢°ì¤Ä¤Î¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤ÏÁ´¤ÆƱ¤¸¥»¥Ã¥·¥ç¥ó¤Ë½ê°¤·¡¢ +¤³¤ì¤Ë¤è¤ê¡¢¥»¥Ã¥·¥ç¥ó¤È¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÇÆó³¬ÁØ¤Î¥×¥í¥»¥¹³¬Áؤ¬·ÁÀ®¤Ç¤­¤ë)¡£ +¿·¤¿¤Ê¥»¥Ã¥·¥ç¥ó¤ÎÀ¸À®¤Ï¥×¥í¥»¥¹¤¬ +.BR setsid (2) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¹Ô¤¦¡£ +.BR setsid (2) +¤Ï¡¢ +.BR setsid (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î PID ¤ÈƱ¤¸ÃͤΥ»¥Ã¥·¥ç¥ó ID ¤ò»ý¤Ä +¿·¤¿¤Ê¥»¥Ã¥·¥ç¥ó¤òÀ¸À®¤¹¤ë¡£ +¥»¥Ã¥·¥ç¥ó¤ÎÀ¸À®¼Ô¤Ï¡Ö¥»¥Ã¥·¥ç¥ó¡¦¥ê¡¼¥À¡¼¡×¤È¸Æ¤Ð¤ì¤ë¡£ +.SS ¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥× ID +³Æ¥×¥í¥»¥¹¤Ï¡¢¿ô¼ïÎà¤Î¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥× ID ¤ò»ý¤Ä¡£ +¥æ¡¼¥¶ ID¡¢¥°¥ë¡¼¥× ID ¤ÏÀ°¿ô¤Ç¡¢¤½¤ì¤¾¤ì +.IR uid_t , +.I gid_t +·¿¤Çɽ¸½¤µ¤ì¤ë (¤³¤ì¤é¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£ + +Linux ¤Ç¤Ï¡¢³Æ¥×¥í¥»¥¹¤Ï°Ê²¼¤Î¤è¤¦¤Ê¼ïÎà¤Î¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥× ID ¤ò»ý¤Ä¡£ +.IP * 3 +¼Â¥æ¡¼¥¶ ID ¤È¼Â¥°¥ë¡¼¥× ID¡£ +¤³¤ì¤é¤Î ID ¤Ë¤è¤ê¥×¥í¥»¥¹¤Î½êÍ­¼Ô¤¬·èÄꤵ¤ì¤ë¡£ +¥×¥í¥»¥¹¤¬¼«Ê¬¤Î¼Â¥æ¡¼¥¶ ID¡¢¼Â¥°¥ë¡¼¥× ID ¤ò¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢¤½¤ì¤¾¤ì +.BR getuid (2), +.BR getgid (2) +¤ò»ÈÍѤ¹¤ë¡£ +.IP * +¼Â¸ú¥æ¡¼¥¶ ID ¤È¼Â¸ú¥°¥ë¡¼¥× ID¡£ +¤³¤ì¤é¤Î ID ¤Ï¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¡¢¶¦Í­¥á¥â¥ê¡¢¥»¥Þ¥Õ¥©¤Ê¤É¤Î +¶¦Í­¥ê¥½¡¼¥¹¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤¿ºÝ¤Ë¤½¤Î¥×¥í¥»¥¹¤¬¥¢¥¯¥»¥¹µö²Ä¤ò +»ý¤Ã¤Æ¤¤¤ë¤«¤ò¥«¡¼¥Í¥ë¤¬È½Äꤹ¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤Û¤È¤ó¤É¤Î Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤ì¤é¤Î ID ¤Ï¥Õ¥¡¥¤¥ë¤Ø¤Î¥¢¥¯¥»¥¹»þ¤Î +¥¢¥¯¥»¥¹µö²Ä¤ÎȽÄê¤Ë¤â»ÈÍѤµ¤ì¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢Linux ¤Ç¤Ï¥Õ¥¡¥¤¥ë¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä¤ÎȽÄê¤Ë¤Ï +¸å½Ò¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID ¤¬»ÈÍѤµ¤ì¤ë¡£ +¥×¥í¥»¥¹¤¬¼«Ê¬¤Î¼Â¸ú¥æ¡¼¥¶ ID¡¢¼Â¸ú¥°¥ë¡¼¥× ID ¤ò¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢¤½¤ì¤¾¤ì +.BR geteuid (2), +.BR getegid (2) +¤ò»ÈÍѤ¹¤ë¡£ +.IP * +Êݸ (saved) set-user-ID ¤ÈÊݸ set-group-ID¡£ +¤³¤ì¤é¤Î ID ¤Ï¡¢set-user-ID ¤ä set-group-ID ¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ë¤ª¤¤¤Æ¡¢ +¥×¥í¥°¥é¥à¤Î¼Â¹Ô»þ¤ËÀßÄꤵ¤ì¤¿¼Â¸ú ID ¤Î¥³¥Ô¡¼¤òÊݸ¤¹¤ë¤¿¤á¤Ë +»ÈÍѤµ¤ì¤ë +.RB ( execve (2) +»²¾È)¡£ +set-user-ID ¥×¥í¥°¥é¥à¤Ï¡¢¼Â¸ú¥æ¡¼¥¶ ID ¤ò¼Â¥æ¡¼¥¶ID ¤ÈÊݸ set-user-ID +¤Î´Ö¤Ç¹Ô¤Ã¤¿¤êÍ褿¤êÀÚ¤êÂؤ¨¤ë¤³¤È¤Ç¡¢Æø¢¤òÆÀ¤¿¤êÍî¤È¤·¤¿¤ê¤Ç¤­¤ë¡£ +¤³¤ÎÀÚ¤êÂؤ¨¤Ï +.BR seteuid (2), +.BR setreuid (2), +.BR setresuid (2) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¼Â¹Ô¤Ç¤­¤ë¡£ +set-group-ID ¥×¥í¥°¥é¥à¤Ï¡¢ +.BR setegid (2), +.BR setregid (2), +.BR setresgid (2) +¤ò»È¤Ã¤ÆƱÍͤΤ³¤È¤¬¤Ç¤­¤ë¡£ +¥×¥í¥»¥¹¤¬¼«Ê¬¤ÎÊݸ set-user-ID¡¢Êݸ set-group-ID ¤ò¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢ +.BR getresuid(2), +.BR getresgids (2) +¤ò¤½¤ì¤¾¤ì»ÈÍѤ¹¤ë¡£ +.IP * +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥æ¡¼¥¶ ID ¤È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥°¥ë¡¼¥× ID (Linux ¸ÇÍ­)¡£ +¤³¤ì¤é¤Î ID ¤Ï¡¢¸å½Ò¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤ÈÁȤ߹ç¤ï¤»¤Æ»ÈÍѤµ¤ì¡¢ +¥Õ¥¡¥¤¥ë¤Ø¤Î¥¢¥¯¥»¥¹¸¢¤Î·èÄê¤ËÍøÍѤµ¤ì¤ë¡£¾ÜºÙ¤Ï +.BR path_resolution (7) +¤ò»²¾È¡£ +¥×¥í¥»¥¹¤Î¼Â¸ú ID (¥æ¡¼¥¶ ID ¤ä ¥°¥ë¡¼¥× ID) ¤¬Êѹ¹¤µ¤ì¤ë¤¿¤Ó¤Ë¡¢ +¥«¡¼¥Í¥ë¤Ï¼«Æ°Åª¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID ¤òƱ¤¸ÃͤËÊѹ¹¤¹¤ë¡£ +¤½¤Î·ë²Ì¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID ¤ÏÄ̾ï¤ÏÂбþ¤¹¤ë¼Â¸ú ID ¤ÈƱ¤¸ÃͤȤʤꡢ +¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¤Î¥Á¥§¥Ã¥¯ÊýË¡¤Ï Linux ¤È¾¤Î Unix ¥·¥¹¥Æ¥à¤ÇƱ¤¸¤Ç¤¢¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ID ¤Ï¼Â¸ú ID ¤È¤Ï°Û¤Ê¤ëÃͤˤ¹¤ë¤³¤È¤¬¤Ç¤­¡¢ +Êѹ¹¤Ï +.BR setfsuid (2) +¤È +.BR setfsgid (2) +¤ò¸Æ¤Ó½Ð¤·¤Æ¹Ô¤¦¡£ +.IP * +Êä½õ¥°¥ë¡¼¥× ID¡£ +¤³¤Î ID ¤Ï¡¢¥Õ¥¡¥¤¥ë¤ä¾¤Î¶¦Í­¥ê¥½¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹»þ¤Ë¥¢¥¯¥»¥¹µö²Ä¤Î +¥Á¥§¥Ã¥¯¤Ë»ÈÍѤµ¤ì¤ë¡¢ÄɲäΥ°¥ë¡¼¥× ID ¤Î½¸¹ç¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.6.4 ¤è¤êÁ°¤Î Linux ¤Ç¤Ï¡¢°ì¤Ä¤Î¥×¥í¥»¥¹¤¢¤¿¤ê¤Î +Êä½õ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¿ô¤ÏºÇÂç¤Ç 32 ¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.6.4 °Ê¹ß¤Ç¤Ï¡¢°ì¤Ä¤Î¥×¥í¥»¥¹¤¢¤¿¤ê¤Î +Êä½õ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¿ô¤ÏºÇÂç¤Ç 65536 ¤Ç¤¢¤ë¡£ +.I sysconf(_SC_NGROUPS_MAX) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢¤¢¤ë¥×¥í¥»¥¹¤¬¥á¥ó¥Ð¡¼¤È¤Ê¤ë¤³¤È¤¬¤Ç¤­¤ë²ÄǽÀ­¤Î¤¢¤ë +Êä½õ¥°¥ë¡¼¥×¿ô¤òÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.\" Since kernel 2.6.4, the limit is visible via the read-only file +.\" /proc/sys/kernel/ngroups_max. +.\" As at 2.6.22-rc2, this file is still read-only. +¥×¥í¥»¥¹¤Ï¡¢¼«Ê¬¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤Î½¸¹ç¤ò +.BR getgroups (2) +¤Ç¼èÆÀ¤Ç¤­¡¢ +.BR setgroups (2) +¤Ç½¸¹ç¤òÊѹ¹¤Ç¤­¤ë¡£ +.PP +.BR fork (2) +¤ÇÀ¸À®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥× ID ¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤Î´Ö¡¢¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶/¥°¥ë¡¼¥× ID ¤ÈÊä½õ¥°¥ë¡¼¥× ID ½¸¹ç¤ÏÉÔÊѤǤ¢¤ë¡£ +¼Â¸ú ID ¤ÈÊݸ¥»¥Ã¥È ID ¤ÏÊѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë +.RB ( execve (2) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë)¡£ + +¾åµ­¤ÎÌÜŪ°Ê³°¤Ë¤â¡¢¥×¥í¥»¥¹¤Î¥æ¡¼¥¶ ID ¤Ï¾¤ÎÍÍ¡¹¤Ê¾ìÌ̤ÇÍøÍѤµ¤ì¤ë¡£ +.IP * 3 +¥·¥°¥Ê¥ë¤òÁ÷¤ëµö²Ä¤ÎȽÄê»þ \(em +.BR kill (2) +»²¾È¡£ +.IP * +¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°´ØÏ¢¤Î¥Ñ¥é¥á¡¼¥¿ (nice ÃÍ¡¢ +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥Ý¥ê¥·¡¼¤äÍ¥ÀèÅÙ¡¢CPU affinity¡¢ +Æþ½ÐÎÏÍ¥ÀèÅÙ) ¤ÎÀßÄêµö²Ä¤ÎȽÄê»þ¡£ +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°´ØÏ¢¤Î¥Ñ¥é¥á¡¼¥¿ÀßÄê¤Ë¤Ï +.BR setpriority (2), +.BR sched_setaffinity (2), +.BR sched_setscheduler (2), +.BR sched_setparam (2), +.BR ioprio_set (2) +¤¬»ÈÍѤµ¤ì¤ë¡£ +.IP * +¥ê¥½¡¼¥¹¾å¸Â¤Î¥Á¥§¥Ã¥¯»þ¡£ +.BR getrlimit (2) +»²¾È¡£ +.IP * +¥×¥í¥»¥¹¤¬À¸À®¤Ç¤­¤ë inotify ¥¤¥ó¥¹¥¿¥ó¥¹¿ô¤Î¾å¸Â¤Î¥Á¥§¥Ã¥¯»þ¡£ +.BR inotify (7) +»²¾È¡£ +.SH ½àµò +¥×¥í¥»¥¹ ID¡¢¿Æ¥×¥í¥»¥¹ ID¡¢¥×¥í¥»¥¹¥°¥ë¡¼¥× ID¡¢¥»¥Ã¥·¥ç¥ó ID ¤Ï +POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +¼Â ID¡¢¼Â¸ú ID¡¢Êݸ¥»¥Ã¥È ID ¤Î¥æ¡¼¥¶ ID / ¥°¥ë¡¼¥× ID ¤ª¤è¤Ó +Êä½õ¥°¥ë¡¼¥× ID ¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥æ¡¼¥¶ ID / ¥°¥ë¡¼¥× ID ¤Ï Linux ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +POSIX ¤Î¥¹¥ì¥Ã¥É»ÅÍͤǤϡ¢¤³¤ì¤é¤Î¼±Ê̻Ҥ¬¥×¥í¥»¥¹Æâ¤ÎÁ´¥¹¥ì¥Ã¥É¤Ç +¶¦Í­¤µ¤ì¤ë¤³¤È¤òµá¤á¤Æ¤¤¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¥«¡¼¥Í¥ë¤Î¥ì¥Ù¥ë¤Ç¤Ï¡¢Linux ¤Ï¥¹¥ì¥Ã¥ÉËè¤ËÊÌ¡¹¤Î +¥æ¡¼¥¶¤È¥°¥ë¡¼¥×¤Ë´Ø¤¹¤ë¼±Ê̻Ҥò´ÉÍý¤·¤Æ¤¤¤ë¡£ +NPTL ¥¹¥ì¥Ã¥É¼ÂÁõ¤¬¡¢(Î㤨¤Ð +.BR setuid (2), +.BR setresuid (2) +¤Ê¤É¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ë) ¥æ¡¼¥¶¤ä¥°¥ë¡¼¥×¤Ë´Ø¤¹¤ë¼±Ê̻ҤËÂФ¹¤ëÊѹ¹¤¬ +¥×¥í¥»¥¹Æâ¤ÎÁ´¤Æ¤Î POSIX ¥¹¥ì¥Ã¥É¤ËÂФ·¤ÆÈ¿±Ç¤µ¤ì¤ë¤³¤È¤òÊݾڤ¹¤ë +¤¿¤á¤Î½èÍý¤ò¹Ô¤Ã¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR bash (1), +.BR csh (1), +.BR ps (1), +.BR access (2), +.BR execve (2), +.BR faccessat (2), +.BR fork (2), +.BR getpgrp (2), +.BR getpid (2), +.BR getppid (2), +.BR getsid (2), +.BR kill (2), +.BR killpg (2), +.BR setegid (2), +.BR seteuid (2), +.BR setfsgid (2), +.BR setfsuid (2), +.BR setgid (2), +.BR setgroups (2), +.BR setresgid (2), +.BR setresuid (2), +.BR setuid (2), +.BR waitpid (2), +.BR euidaccess (3), +.BR initgroups (3), +.BR tcgetpgrp (3), +.BR tcsetpgrp (3), +.BR capabilities (7), +.BR path_resolution (7), +.BR unix (7) diff --git a/release/man7/ddp.7 b/release/man7/ddp.7 new file mode 100644 index 00000000..30108a63 --- /dev/null +++ b/release/man7/ddp.7 @@ -0,0 +1,243 @@ +.\" This man page is Copyright (C) 1998 Alan Cox. +.\" 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. +.\" $Id: ddp.7,v 1.6 1999/12/06 00:13:56 nakano Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated Mon 6 Dec 1999 by NAKANO Takeo +.\" +.TH DDP 7 2008-11-20 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ddp \- Linux ¤Ç¤Î AppleTalk ¥×¥í¥È¥³¥ë¤Î¼ÂÁõ +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.IB ddp_socket " = socket(AF_APPLETALK, SOCK_DGRAM, 0);" +.br +.IB raw_socket " = socket(AF_APPLETALK, SOCK_RAW, " protocol ");" +.SH ÀâÌÀ +Linux ¤Ï +.I "Inside Appletalk" +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë Appletalk ¥×¥í¥È¥³¥ë¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë¤Ë¤¢¤ë¤Î¤Ï DDP ÁØ¤È AARP ¤À¤±¤Ç¤¢¤ë¡£¤³¤ì¤é¤Ï +.B netatalk +¥×¥í¥È¥³¥ë¥é¥¤¥Ö¥é¥ê¤òÄ̤·¤ÆÍøÍѤµ¤ì¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Ú¡¼¥¸¤Ï DDP ÁؤòľÀÜÍøÍѤ·¤¿¤¤¥æ¡¼¥¶¡¼¤Î¤¿¤á¤Ë¡¢ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òµ­½Ò¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.PP +Appletalk ¤È¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤È¤ÎÄÌ¿®¤Ë¤Ï¡¢ +BSD ¸ß´¹¤Î¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÍøÍѤ¹¤ë¡£ +¥½¥±¥Ã¥È¤Ë´Ø¤¹¤ë¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR socket (7) +¤ò¸«¤è¡£ +.PP +Appletalk ¥½¥±¥Ã¥È¤Ï¡¢ +¥½¥±¥Ã¥È¥Õ¥¡¥ß¥ê¡¼¤Î°ú¿ô¤Ë +.B AF_APPLETALK +¤ò»ØÄꤷ¤Æ +.BR socket (2) +´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤ë¡£»ØÄê¤Ç¤­¤ë¥½¥±¥Ã¥È¥¿¥¤¥×¤Ï¡¢ +.B ddp +¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¾ì¹ç¤Ë¤Ï +.BR SOCK_DGRAM ¡¢ +.B raw +¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¾ì¹ç¤Ë¤Ï +.B SOCK_RAW +¤Ç¤¢¤ë¡£ +.I protocol +¤ÏÁ÷¼õ¿®¤µ¤ì¤ë Appletalk ¥×¥í¥È¥³¥ë¤Ç¤¢¤ë¡£ +¥½¥±¥Ã¥È¥¿¥¤¥×¤Ë +.B SOCK_RAW +¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï¡¢¥×¥í¥È¥³¥ë¤Ë +.B ATPROTO_DDP +¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +raw ¥½¥±¥Ã¥È¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤«¡¢ +.B CAT_NEW_RAW +¸¢¸Â¤ò»ý¤Ã¤¿¥×¥í¥»¥¹¤Ç¤Ê¤¤¤È¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤¡£ +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +Appletalk ¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï¥Í¥Ã¥È¥ï¡¼¥¯Èֹ桦¥Î¡¼¥ÉÈֹ桦¥Ý¡¼¥ÈÈÖ¹æ¤Î +ÁȤ߹ç¤ï¤»¤ÇÄêµÁ¤µ¤ì¤ë¡£ +.PP +.in +4n +.nf +struct at_addr { + unsigned short s_net; + unsigned char s_node; +}; + +struct sockaddr_atalk { + sa_family_t sat_family; /* address family */ + unsigned char sat_port; /* port */ + struct at_addr sat_addr; /* net/node */ +}; +.fi +.in +.PP +.I sat_family +¤Ï¾ï¤Ë +.B AF_APPLETALK +¤ËÀßÄꤹ¤ë¡£ +.I sat_port +¤Ï¥Ý¡¼¥È¤òÍ¿¤¨¤ë¡£¥Ý¡¼¥ÈÈֹ椬 129 °Ê²¼¤Î¥Ý¡¼¥È¤Ï +¡ÖͽÌó¥Ý¡¼¥È (reserved port)¡× ¤È¸Æ¤Ð¤ì¤ë¡£¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤«¡¢ +.B CAP_NET_BIND_SERVICE +¸¢¸Â¤ò»ý¤Ä¥×¥í¥»¥¹¤À¤±¤¬¡¢¤³¤Î¤è¤¦¤Ê¥½¥±¥Ã¥È¤ò +.BR bind (2) +¤Ç¤­¤ë¡£ +.I sat_addr +¤Ï¥Û¥¹¥È¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I struct at_addr +¤Î¥á¥ó¥Ð¡¼ +.I s_net +¤Ë¤Ï¥Û¥¹¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤ò¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤ÇÍ¿¤¨¤ë¡£ÃÍ +.B AT_ANYNET +¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É¤Ç¡¢¡Ö¤³¤Î¥Í¥Ã¥È¥ï¡¼¥¯¡×¤â°ÅÌۤΤ¦¤Á¤Ë´Þ¤Þ¤ì¤ë¡£ +.I struct at_addr +¤Î¥á¥ó¥Ð¡¼ +.I s_node +¤Ë¤Ï¥Û¥¹¥È¤Î¥Î¡¼¥ÉÈÖ¹æ¤òÍ¿¤¨¤ë¡£ÃÍ +.B AT_ANYNODE +¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É¤Ç¡¢¡Ö¤³¤Î¥Î¡¼¥É¡×¤â°ÅÌۤΤ¦¤Á¤Ë´Þ¤Þ¤ì¤ë¡£ÃÍ +.B ATADDR_BCAST +¤Ï¥í¡¼¥«¥ë¤Ê¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.\" FIXME this doesn't make sense [johnl] +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +¥×¥í¥È¥³¥ë¸ÇÍ­¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ï¤Ê¤¤¡£ +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +Appletalk ¤Î¥°¥í¡¼¥Ð¥ë¥Ñ¥é¥á¡¼¥¿¤Î¤¤¤¯¤Ä¤«¤Ï¡¢ +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ̤·¤ÆÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤Ë¤Ï¡¢ +.I /proc/sys/net/atalk/ +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.TP +.I aarp-expiry-time +AARP ¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê¤òÇË´þ¤¹¤ë¤Þ¤Ç¤Î¥¿¥¤¥à¥¤¥ó¥¿¡¼¥Ð¥ë (ÉÃñ°Ì)¡£ +.TP +.I aarp-resolve-time +AARP ¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê¤¬²ò·è¤µ¤ì¤ë¤Þ¤Ç¤Î¥¿¥¤¥à¥¤¥ó¥¿¡¼¥Ð¥ë (ÉÃñ°Ì)¡£ +.TP +.I aarp-retransmit-limit +AARP ¥¯¥¨¥ê¡¼¤ÎºÇÂçºÆÁ÷¿®²ó¿ô¡£¤³¤Î²ó¿ô¤ò±Û¤¨¤ë¤È¡¢ +¤½¤Î¥Î¡¼¥É¤Ï dead ¤Ç¤¢¤ë¤È¤ß¤Ê¤µ¤ì¤ë¡£ +.TP +.I aarp-tick-time +¥¿¥¤¥Þ¡¼Æ°ºî¤¹¤ë AARP ¤Î¥¿¥¤¥Þ¡¼¥ì¡¼¥È (ÉÃñ°Ì) +.PP +¥Ç¥Õ¥©¥ë¥È¤ÎÃͤǻÅÍͤ˥ޥåÁ¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ +Êѹ¹¤¹¤ëɬÍפÏÁ´¤¯¤Ê¤¤¤Ï¤º¤Ç¤¢¤ë¡£ +.SS ioctl +.BR socket (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î ioctl ¤¬ +DDP ¤Ë¤âŬÍѤµ¤ì¤ë¡£ +.\" FIXME Add a section about multicasting +.SH ¥¨¥é¡¼ +.\" FIXME document all errors. We should really fix the kernels to +.\" give more uniform error returns (ENOMEM vs ENOBUFS, EPERM vs +.\" EACCES etc.) +.TP +.B EACCES +¥æ¡¼¥¶¤¬¹Ô¤ª¤¦¤È¤·¤¿Áàºî¤ËɬÍפʸ¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +broadcast ¥Õ¥é¥°¤ò¥»¥Ã¥È¤»¤º¤Ë¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ØÁ÷¿®¤ò¹Ô¤ª¤¦¤È¤·¤¿¡¢ +¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Ç¤Ê¤¯¡¢ +.B CAP_NET_BIND_SERVICE +¸¢¸Â¤Î¤Ê¤¤¥×¥í¥»¥¹¤ÇÆø¢¥Ý¡¼¥È¤ò¥Ð¥¤¥ó¥É¤·¤è¤¦¤È¤·¤¿¡¢¤Ê¤É¤¬¹Í¤¨¤é¤ì¤ë¡£ +.TP +.B EADDRINUSE +´û¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B EADDRNOTAVAIL +¸ºß¤·¤Ê¤¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬Í׵ᤵ¤ì¤¿¡£¤Þ¤¿¤Ï +Í׵ᤵ¤ì¤¿¥½¡¼¥¹¥¢¥É¥ì¥¹¤¬¥í¡¼¥«¥ë¤Ê¤â¤Î¤Ç¤Ê¤¤¡£ +.TP +.B EAGAIN +Èó¥Ö¥í¥Ã¥­¥ó¥°¥½¥±¥Ã¥È¤ËÂФ·¤Æ¥Ö¥í¥Ã¥¯¤¹¤ëÁàºî¤ò¹Ô¤Ã¤¿¡£ +.TP +.B EALREADY +Èó¥Ö¥í¥Ã¥­¥ó¥°¥½¥±¥Ã¥È¤ËÂФ¹¤ëÀܳÁàºî¤¬´û¤Ë¼Â¹ÔÃæ¤Ç¤¢¤ë¡£ +.TP +.B ECONNABORTED +.BR accept (2) +¤ÎÅÓÃæ¤ÇÀܳ¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿¡£ +.TP +.B EHOSTUNREACH +¹Ô¤­À襢¥É¥ì¥¹¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤Ë¤Ê¤¤¡£ +.TP +.B EINVAL +ÅϤ·¤¿°ú¿ô¤¬ÉÔÀµ¡£ +.TP +.B EISCONN +ÀܳºÑ¤ß¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.BR connect (2) +¤¬¸Æ¤Ð¤ì¤¿¡£ +.TP +.B EMSGSIZE +¥Ç¡¼¥¿¥°¥é¥à¤¬ DDP MTU ¤è¤êÂ礭¤¤¡£ +.TP +.B ENODEV +¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤¬¤Ê¤¤¡£¤¢¤ë¤¤¤Ï IP ¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£ +.TP +.B ENOENT +¥Ñ¥±¥Ã¥È¤¬ÅþÃ夷¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.B SIOCGSTAMP +¤¬¸Æ¤Ð¤ì¤¿¡£ +.TP +.BR ENOMEM " ¤È " ENOBUFS +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B ENOPKG +¥«¡¼¥Í¥ë¤Î¥µ¥Ö¥·¥¹¥Æ¥à¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.BR ENOPROTOOPT " ¤È " EOPNOTSUPP +ÅϤ·¤¿¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÉÔÀµ¡£ +.TP +.B ENOTCONN +¹Ô¤ª¤¦¤È¤·¤¿Áàºî¤ÏÀܳºÑ¤ß¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Î¤ßÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤À¤¬¡¢ +¤½¤Î¥½¥±¥Ã¥È¤ÏÀܳ¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPERM +¹â¤¤Í¥ÀèÅÙ¤ËÀßÄꤷ¤¿¤ê¡¢ÀßÄê¤òÊѹ¹¤·¤¿¤ê¡¢ +»ØÄꤷ¤¿¥×¥í¥»¥¹¤ä¥°¥ë¡¼¥×¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¤Î¤ËɬÍפʸ¢¸Â¤ò +¥æ¡¼¥¶¤¬»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EPIPE +Àܳ¤¬ÀèÊý¤Ë¤è¤Ã¤Æ¡¢Ä̾ï°Ê³°¤Î¤ä¤êÊý¤Ç¥¯¥í¡¼¥º¤Þ¤¿¤Ï¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤¿¡£ +.TP +.B ESOCKTNOSUPPORT +¥½¥±¥Ã¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£¤Þ¤¿¤Ï̤ÃΤΥ½¥±¥Ã¥È¥¿¥¤¥×¤¬Í׵ᤵ¤ì¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +Appletalk ¤Ï Linux 2.0 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï Linux 2.2 °Ê¹ß¤Ë¸ºß¤¹¤ë¡£ +.SH Ãí°Õ +.B SO_BROADCAST +¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë»þ¤Ë¤Ï¿µ½Å¤Î¾å¤Ë¤â¿µ½Å¤Ë¤Ê¤Ã¤Æ¤Û¤·¤¤¡£ +Linux ¤Ç¤Ï¤³¤ì¤ËÆø¢¤òɬÍפȤ·¤Ê¤¤¡£ +ÉÔÃí°Õ¤Ë¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ËÁ÷¿®¤ò¹Ô¤¦¤È¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¤Î¾õÂÖ¤¬´Êñ¤ËÊѹ¹¤µ¤ì¤Æ¤·¤Þ¤¦¡£ +.SS °Ü¿¢À­ +´ðËÜŪ¤Ê Appletalk ¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï +BSD ͳÍè¤Î¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë +.B netatalk +¤È¸ß´¹À­¤¬¤¢¤ë¡£Â¿¤¯¤Î BSD ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥Õ¥ì¡¼¥à¤òÁ÷¿®¤·¤è¤¦¤È¤·¤¿¤È¤­¤Î +.B SO_BROADCAST +¤Î¥Á¥§¥Ã¥¯¤Ë¼ºÇÔ¤¹¤ë¡£¤³¤ì¤Ï¸ß´¹À­¤ÎÌäÂê¤È¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +raw ¥½¥±¥Ã¥È¥â¡¼¥É¤Ï Linux ÆÈÆäΤâ¤Î¤Ç¡¢¤â¤¦°ìÊý¤Î¼ÂÁõ¤Ç¤¢¤ë CAP +¥Ñ¥Ã¥±¡¼¥¸¤ä¡¢ Appletalk ¥â¥Ë¥¿¥Ä¡¼¥ë¤ò¤è¤ê´Êñ¤Ë¼ÂÁõ¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.SH ¥Ð¥° +¥¨¥é¡¼¤ÎÃͤ¬¤Þ¤Ã¤¿¤¯¼óÈø°ì´Ó¤·¤Æ¤¤¤Ê¤¤¡£ +.PP +¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¡¦¥Ç¥Ð¥¤¥¹¡¦ AARP ¥Æ¡¼¥Ö¥ë¡¦¤½¤Î¾¤Î¥Ç¥Ð¥¤¥¹¤ò +ÀßÄꤹ¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë ioctl ¤¬¤Þ¤Àµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR recvmsg (2), +.BR sendmsg (2), +.BR capabilities (7), +.BR socket (7) diff --git a/release/man7/environ.7 b/release/man7/environ.7 new file mode 100644 index 00000000..010f6b35 --- /dev/null +++ b/release/man7/environ.7 @@ -0,0 +1,267 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" and Andries Brouwer (aeb@cwi.nl), Fri Feb 14 21:47:50 1997. +.\" +.\" 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 Sun Jul 25 10:45:30 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Jul 21 21:25:26 1996 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Mon Oct 21 17:47:19 1996 by Eric S. Raymond (esr@thyrsus.com) +.\" Modified Wed Aug 27 20:28:58 1997 by Nicolas Lichtmaier (nick@debian.org) +.\" Modified Mon Sep 21 00:00:26 1998 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Wed Jan 24 06:37:24 2001 by Eric S. Raymond (esr@thyrsus.com) +.\" Modified Thu Dec 13 23:53:27 2001 by Martin Schulze +.\" +.\" nakano Ãí: Nicolas ¤µ¤ó¤Î a ¤Ï¥ª¥ê¥¸¥Ê¥ë¤Ç¤Ï \'a ¤À¤¬, +.\" ¥­¥ã¥é¥¯¥¿¤ò²õ¤¹¤Î¤Ç a ¤ËÊѹ¹¤·¤¿. +.\" +.\" Japanese Version Copyright (c) 1997 KURODA Masaru all rights reserved. +.\" Translated May 27, 1997 by KURODA Masaru +.\" Modified Sat 25 Jul 1998 by NAKANO Takeo +.\" Modified Sun 6 Dec 1998 by NAKANO Takeo +.\" Updated & Modified Sat Aug 21 1999 +.\" by NAKANO Takeo +.\" Updated & Modified Sat 18 Mar 2000 by NAKANO Takeo +.\" Updated Sat Dec 22 JST 2001 by Kentaro Shirakata +.\" Updated Sat Mar 23 JST 2002 by Kentaro Shirakata +.\" Updated 2010-04-11, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: environment ´Ä¶­ +.\"WORD: environment variable ´Ä¶­ÊÑ¿ô +.\"WORD: shell variable ¥·¥§¥ëÊÑ¿ô +.\"WORD: locale ¥í¥±¡¼¥ë +.\"WORD: locale category ¥í¥±¡¼¥ë¥«¥Æ¥´¥ê +.\" +.TH ENVIRON 7 2009-07-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +environ \- ¥æ¡¼¥¶´Ä¶­ +.SH ½ñ¼° +.nf +.BI "extern char **" environ ; +.br +.fi +.SH ÀâÌÀ +ÊÑ¿ô +.I environ +¤Ï¡Ö´Ä¶­ (environment)¡×¤È¸Æ¤Ð¤ì¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Ç¤¢¤ë¡£ +¤³¤ÎÇÛÎó¤ÎºÇ¸å¤Î¥Ý¥¤¥ó¥¿¤ÎÃÍ¤Ï NULL ¤Ç¤¢¤ë¡£ +(¤³¤ÎÊÑ¿ô¤Ï¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤ÇÀë¸À¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤¿¤À¤· libc4 ¤ä libc5 ¤Î¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤Ê¤é +.I +¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë¤·¡¢¤³¤ì¤¬ glibc ͳÍè¤Î¤â¤Î¤Ç¤â +.B _GNU_SOURCE +¤¬ define ¤µ¤ì¤Æ¤¤¤ì¤ÐÀë¸ÀºÑ¤ß¤È¤Ê¤ë)¡£ +¤³¤Îʸ»úÎóÇÛÎó¤Ï¡¢ +¥×¥í¥»¥¹¤òµ¯Æ°¤¹¤ë +.BR exec (3) +¤Ë¤è¤Ã¤Æ¡¢¤½¤Îµ¯Æ°¤µ¤ì¤¿¥×¥í¥»¥¹¤ÇÍøÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + +ÄÌÎã¤Ç¤Ï¡¢ +.I environ +¤Îʸ»úÎó¤Ï "\fIname\fP\fB=\fP\fIvalue\fP" ¤È¤¤¤¦½ñ¼°¤ò¤È¤ë¡£ +¤è¤¯ÍѤ¤¤é¤ì¤ëÎã¤ò°Ê²¼¤Ë¼¨¤¹¡£ +.TP +.B USER +¥æ¡¼¥¶¤Î¥í¥°¥¤¥ó̾ (BSD µ¯¸»¤Î¥×¥í¥°¥é¥à¤Ê¤É¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë)¡£ +.TP +.B LOGNAME +¥æ¡¼¥¶¤Î¥í¥°¥¤¥ó̾(System V µ¯¸»¤Î¥×¥í¥°¥é¥à¤Ê¤É¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë)¡£ +.TP +.B HOME +¥æ¡¼¥¶¤Î¥í¥°¥¤¥ó¥Ç¥£¥ì¥¯¥È¥ê¡£ +.BR login (1) +¤¬¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë +.BR passwd (5) +¤«¤é¼èÆÀ¤·¤ÆÀßÄꤹ¤ë¡£ +.TP +.B LANG +¥í¥±¡¼¥ë¤Î³Æ¥«¥Æ¥´¥ê¤Ç»ÈÍѤµ¤ì¤ë¥í¥±¡¼¥ë¤Î̾Á°¡£\fBLC_ALL\fP ¤ä¡¢ +¤è¤ê¶¹¤¤ÈϰϤòÂоݤȤ¹¤ë´Ä¶­ÊÑ¿ô +.RB ( LC_COLLATE , +.BR LC_CTYPE , +.BR LC_MESSAGES , +.BR LC_MONETARY , +.BR LC_NUMERIC , +.B LC_TIME +¤Ê¤É) +¤Ë¤è¤Ã¤Æ¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +.BR locale (5) +¤ò¸«¤è¡£ +.TP +.B PATH +.BR sh (1) +¤ä¾¤Î¥×¥í¥°¥é¥à¤¬¡¢¥Õ¥ë¥Ñ¥¹¤ÇÍ¿¤¨¤é¤ì¤Ê¤«¤Ã¤¿¼Â¹Ô¥Õ¥¡¥¤¥ë¤ò¸¡º÷¤¹¤ë¤È¤­¡¢ +¥Õ¥¡¥¤¥ë̾¤ËÁ°ÃÖ¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÎÇÛÎó¡£ +³Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ï \(aq\fB:\fP\(aq ¤Ë¤è¤Ã¤Æ¶èÀÚ¤é¤ì¤ë¡£ +(Ʊ¤¸¤è¤¦¤Ê¤â¤Î¤Ë¡¢ +¥·¥§¥ë¤¬¥Ç¥£¥ì¥¯¥È¥êÊѹ¹¥³¥Þ¥ó¥É¤ÎÊѹ¹Àè¤òõ¤¹¤¿¤á¤ËÍѤ¤¤ë +\fBCDPATH\fP ¤ä¡¢ +.BR man (1) +¤¬¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¸¡º÷¤ËÍѤ¤¤ë \fBMANPATH\fP ¤Ê¤É¤¬¤¢¤ë¡£) +.TP +.B PWD +¸½ºß¤Î¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¡£¤¤¤¯¤Ä¤«¤Î¥·¥§¥ë¤¬ÀßÄꤹ¤ë¡£ +.TP +.B SHELL +¥æ¡¼¥¶¡¼¤Î¥í¥°¥¤¥ó¥·¥§¥ë¤Î¥Ñ¥¹Ì¾¡£ +.TP +.B TERM +üËö¤Î¼ïÎà¡£½ÐÎϤϤ³¤ì¤Ë¤¢¤ï¤»¤ÆÍÑ°Õ¤µ¤ì¤ë¡£ +.TP +.B PAGER +¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤òɽ¼¨¤¹¤ë¥æ¡¼¥Æ¥ê¥Æ¥£¡£¥æ¡¼¥¶¡¼¤¬¹¥¤ß¤Î¤â¤Î¤òÀßÄꤹ¤ë¡£ +.TP +.BR EDITOR / VISUAL +¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤¹¤ë¥æ¡¼¥Æ¥ê¥Æ¥£¡£¥æ¡¼¥¶¡¼¤¬¹¥¤ß¤Î¤â¤Î¤òÀßÄꤹ¤ë¡£ +.\" .TP +.\" .B BROWSER +.\" URL ¤Î±ÜÍ÷¤ËÍѤ¤¤ë¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡£¥æ¡¼¥¶¡¼¤¬¹¥¤ß¤Î¤â¤Î¤òÀßÄꤹ¤ë¡£ +.\" ¥³¥í¥ó¤Ç¶èÀڤäƥ֥饦¥¶¥³¥Þ¥ó¥É¤òʤ٤롣 +.\" http://www.catb.org/~esr/BROWSER/ ¤ò¸«¤è¡£ +.PP +´Ä¶­¤Ë̾Á°¤òÄɲ乤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR sh (1) +¤Ç¤Ï \fIexport\fP ¥³¥Þ¥ó¥É¤È "name=value" ¤ò»ÈÍѤ¹¤ë¡£ +.BR csh (1) +¤Ç¤Ï \fIsetenv\fP ¥³¥Þ¥ó¥É¤ò»ÈÍѤ¹¤ë¡£ +.BR exec (3) +¤Î°ú¿ô¤È¤·¤Æ¤â´Ä¶­¤òÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +C ¥×¥í¥°¥é¥à¤«¤é¤Ï¡¢ +.BR getenv (3), +.BR putenv (3), +.BR setenv (3), +.BR unsetenv (3) +¤Ê¤É¤Î´Ø¿ô¤òÍѤ¤¤Æ´Ä¶­¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ + +¥×¥í¥°¥é¥à¤ä¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó¤Î¿¤¯¤Ï¡¢¤½¤ì¤¾¤ìŬÅö¤Ê´Ä¶­ÊÑ¿ô¤Î¸ºß +¤äÃͤˤè¤Ã¤Æ¡¢Æ°ºî¤Ë±Æ¶Á¤ò¼õ¤±¤ë¤³¤È¤¬¤¢¤ë¡£°Ê²¼¡¢Å¬µ¹µó¤²¤Æ¤ß¤è¤¦¡£ +.LP +.BR LANG ", " LANGUAGE ", " NLSPATH ", " LOCPATH ", " +.BR LC_ALL ", " LC_MESSAGES ", " +¤Ê¤É¤ÎÊÑ¿ô¡£¥í¥±¡¼¥ë¤Î°·¤¤¤Ë±Æ¶Á¤¹¤ë¡£ +.BR locale (5) +¤ò¸«¤è¡£ +.LP +.B TMPDIR +¤Ï +.BR tmpnam (3) +¤Ê¤É¤Î¥ë¡¼¥Á¥ó¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤ë¥Õ¥¡¥¤¥ë̾¤ËÁ°ÃÖ¤µ¤ì¤ë¥Ñ¥¹¤Ë±Æ¶Á¤¹¤ë¡£¤Þ¤¿ +.BR sort (1) +¤Î°ì»þ¥Ç¥£¥ì¥¯¥È¥ê¤ËÍѤ¤¤é¤ì¤¿¤ê¡¢Â¾¤Î¥×¥í¥°¥é¥à¤«¤é¤âÍøÍѤµ¤ì¤ë¡£ +.LP +.BR LD_LIBRARY_PATH ", " LD_PRELOAD +¤Ê¤É¤Î LD_* ÊÑ¿ô¤Ï¥À¥¤¥Ê¥ß¥Ã¥¯¥í¡¼¥À¡¦¥ê¥ó¥«¤ÎÆ°ºî¤Ë±Æ¶Á¤¹¤ë¡£ +.LP +.B POSIXLY_CORRECT +¤¬»ØÄꤵ¤ì¤ë¤È¡¢¤¢¤ë¼ï¤Î¥×¥í¥°¥é¥à¤ä¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó¤Ï +POSIX ¤Îµ¬Äê¤Ë½¾¤¦¤è¤¦¤Ë¤Ê¤ë¡£ +.LP +.BR malloc (3) +¤ÎÆ°ºî¤Ï +.B MALLOC_* +ÊÑ¿ô¤Ë¤è¤Ã¤Æ±Æ¶Á¤µ¤ì¤ë¡£ +.LP +.B HOSTALIAS +ÊÑ¿ô¤Ï¡¢ +.BR gethostbyname (3) +¤¬ÍѤ¤¤ë¥¨¥¤¥ê¥¢¥¹¤¬½ñ¤«¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë̾¤òÍ¿¤¨¤ë¡£ +.LP +.BR TZ " ¤È " TZDIR +¤Ï +.BR tzset (3) +¤ª¤è¤Ó¡¢¤³¤Î´Ø¿ô¤ò»È¤¦ +.BR ctime (3), +.BR localtime (3), +.BR mktime (3), +.BR strftime (3) +¤È¤¤¤Ã¤¿´Ø¿ô¤ÇÍѤ¤¤é¤ì¤ë¥¿¥¤¥à¥¾¡¼¥ó¤Î¾ðÊó¤òÍ¿¤¨¤ë¡£ +.BR tzselect (8) +¤â»²¾È¤Î¤³¤È¡£ +.LP +.B TERMCAP +¤Ï¡¢¸½ºß¤ÎüËö¾ðÊó¤Î¼èÆÀÀè +(¤¢¤ë¤¤¤Ï¤½¤Î¤è¤¦¤Ê¾ðÊ󤬽ñ¤«¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë̾) ¤òÍ¿¤¨¤ë¡£ +.LP +.BR COLUMNS " ¤È " LINES +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¥¦¥¤¥ó¥É¥¦¤Î¥µ¥¤¥º¤òÅÁ¤¨¤ë¡£ +¼ÂºÝ¤Î¥µ¥¤¥º¤È¤Ï°ã¤¦ÃͤòÍ¿¤¨¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.LP +.BR PRINTER " ¤Þ¤¿¤Ï " LPDEST +ÍѤ¤¤¿¤¤¥×¥ê¥ó¥¿¤ò»ØÄꤹ¤ë¡£ +.BR lpr (1) +¤ò»²¾È¤Î¤³¤È¡£ +.LP +¤Ê¤É¤Ê¤É... +.SH ¥Ð¥° +¤³¤ì¤é¤ÎÃæ¤Ë¤Ï¡¢ÌÀ¤é¤«¤Ë¥»¥­¥å¥ê¥Æ¥£¾å¤Î´í¸±¤¬Â¸ºß¤¹¤ë¡£ +¥æ¡¼¥¶¡¼¤¬ +.BR IFS " ¤ä " LD_LIBRARY_PATH +¤Ë°Û¾ï¤ÊÃͤòÍ¿¤¨¤¿¤³¤È¤Ë¤è¤Ã¤Æ¡¢ +¤³¤ì¤Þ¤Ç¿¤¯¤Î¥·¥¹¥Æ¥à¥³¥Þ¥ó¥É¤¬¤À¤Þ¤µ¤ì¤Æ¡¢ +¥·¥¹¥Æ¥à¤ò¤Ò¤É¤¤Ìܤˤ¢¤ï¤»¤Æ¤­¤¿¡£ + +̾Á°¶õ´Ö¤¬±øÀ÷¤µ¤ì¤ë´í¸±À­¤â¸ºß¤¹¤ë¡£ +.I make +¤ä +.I autoconf +¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ò +´Ä¶­¤Ë¤¢¤ë»÷¤¿¤è¤¦¤Ê̾Á°¤ÎÊÑ¿ô¤Ç¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +(Ä̾ï¤Ï¤¹¤Ù¤ÆÂçʸ»ú¤ÎÊÑ¿ô¤òÍѤ¤¤ë)¡£ +¤¹¤Ê¤ï¤Á¡¢ÍøÍѤ·¤¿¤¤ C ¥³¥ó¥Ñ¥¤¥é¤Ï +.B CC +¤ÇÁªÂò¤Ç¤­¤ë¡£¤Þ¤¿Æ±ÍÍ¤Ë +.BR MAKE , +.BR AR , +.BR AS , +.BR FC , +.BR LD , +.BR LEX , +.BR RM , +.B YACC +¤Ê¤É¤âÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤È¤³¤í¤¬°ìÊý¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤ÊÊÑ¿ô¤ò +(¥Ñ¥¹Ì¾¤Ç¤Ï¤Ê¤¯) +¥×¥í¥°¥é¥à¤ËÂФ¹¤ë¥ª¥×¥·¥ç¥ó¤È¤·¤Æ°·¤¦¤è¤¦¤Êήµ·¤â¸ºß¤·¤Æ¤­¤¿¡£ +Î㤨¤Ð +.BR MORE , +.BR LESS , +.B GZIP +¤Ê¤É¤¬¤½¤¦¤Ç¤¢¤ë¡£ +¤³¤Î¤è¤¦¤ÊÍøÍÑË¡¤Ï´Ö°ã¤Ã¤Æ¤¤¤ë¤È¹Í¤¨¤ë¤Ù¤­¤Ç¡¢ +¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.I gzip +¤Îºî¼Ô¤¿¤Á¤Ï¡¢¥ª¥×¥·¥ç¥ó¤òÍ¿¤¨¤ë´Ä¶­ÊÑ¿ô¤ò +.B GZIP_OPT +¤Ë²þ̾¤¹¤ë¤³¤È¤ò¹Í¤¨¤ë¤Û¤¦¤¬¤è¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR bash (1), +.BR csh (1), +.BR login (1), +.BR sh (1), +.BR tcsh (1), +.BR execve (2), +.BR clearenv (3), +.BR exec (3), +.BR getenv (3), +.BR putenv (3), +.BR setenv (3), +.BR unsetenv (3), +.BR locale (5) diff --git a/release/man7/epoll.7 b/release/man7/epoll.7 new file mode 100644 index 00000000..89d478d9 --- /dev/null +++ b/release/man7/epoll.7 @@ -0,0 +1,570 @@ +.\" +.\" 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 +.\" +.\" 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" +.SH ̾Á° +epoll \- I/O ¥¤¥Ù¥ó¥ÈÄÌÃε¡Ç½ +.SH ½ñ¼° +.B #include +.SH ÀâÌÀ +.B epoll +¤Ï +.BR poll (2) +¤Î°ì¼ï¤Ç¤¢¤ê¡¢¥¨¥Ã¥¸¥È¥ê¥¬¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤È +¥ì¥Ù¥ë¥È¥ê¥¬¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¤É¤Á¤é¤È¤·¤Æ¤â»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¡¢ +´Æ»ë¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô¤¬Â¿¤¤¾ì¹ç¤Ë¤â»ÈÍѤǤ­¤ë¡£ +.B epoll +¥¤¥ó¥¹¥¿¥ó¥¹¤ÎºîÀ®¤ä´ÉÍý¤ò¹Ô¤¦¤¿¤á¤Ë +°Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë: +.IP * 3 +.B epoll +¥¤¥ó¥¹¥¿¥ó¥¹¤Ï +.BR epoll_create (2) +¤ÇºîÀ®¤µ¤ì¤ë¡£ +.BR epoll_create (2) +¤ÏºîÀ®¤·¤¿ epoll ¥¤¥ó¥¹¥¿¥ó¥¹¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +(¤â¤Ã¤È¿·¤·¤¤ +.BR epoll_create1 (2) +¤Ç¤Ï¡¢ +.BR epoll_create (2) +¤Îµ¡Ç½¤¬³ÈÄ¥¤µ¤ì¤Æ¤¤¤ë)¡£ +.IP * +ÆÃÄê¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ë´Æ»ëÆâÍƤò +.BR epoll_ctl (2) +¤ÇÅÐÏ¿¤¹¤ë¡£ +.B epoll +¥¤¥ó¥¹¥¿¥ó¥¹¤Ë¸½ºßÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î½¸¹ç¤Ï +.I epoll +½¸¹ç¤È¸Æ¤Ð¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +.IP * +ºÇ¸å¤Ë +.BR epoll_wait (2) +¤Ç¼ÂºÝ¤Î¥¤¥Ù¥ó¥ÈÂÔ¤Á¤ò³«»Ï¤¹¤ë¡£ +.SS ¥ì¥Ù¥ë¥È¥ê¥¬¤È¥¨¥Ã¥¸¥È¥ê¥¬ +.B epoll +¥¤¥Ù¥ó¥ÈÇÛÁ÷ (distribution) ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¡¢ +¥¨¥Ã¥¸¥È¥ê¥¬ (ET) ¤È¤·¤Æ¤â¥ì¥Ù¥ë¥È¥ê¥¬ (LT) ¤È¤·¤Æ¤âÆ°ºî¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Æó¤Ä¤ÎÇÛÁ÷µ¡¹½¤Î°ã¤¤¤Ï¡¢¼¡¤Î¤è¤¦¤ËÀâÌÀ¤Ç¤­¤ë¡£ +¤³¤Î¤è¤¦¤Ê¥·¥Ê¥ê¥ª¤¬µ¯¤³¤Ã¤¿¤È¤·¤è¤¦: +.IP 1. 3 +¥Ñ¥¤¥×¤ÎÆɤ߹þ¤ß¦¤òɽ¤¹¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.RI ( rfd ) +¤¬ +.B epoll +¥¤¥ó¥¹¥¿¥ó¥¹¤ËÅÐÏ¿¤µ¤ì¤ë¡£ +.IP 2. +¥Ñ¥¤¥×¤Ø½ñ¤­¹þ¤à¥×¥í¥°¥é¥à¤¬ 2 kB ¤Î¥Ç¡¼¥¿¤ò¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤Ø½ñ¤­¹þ¤à¡£ +.IP 3. +.BR epoll_wait (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢Æɤ߹þ¤ß²Äǽ (ready) ¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤È¤·¤Æ +.I rfd +¤¬Ê֤롣 +.IP 4. +¥Ñ¥¤¥×¤«¤éÆɤ߽Ф¹¥×¥í¥°¥é¥à¤¬¡¢1 kB ¤Î¥Ç¡¼¥¿¤ò +.I rfd +¤«¤éÆɤ߽Ф¹¡£ +.IP 5. +.BR epoll_wait (2) +¤Î¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤ë¡£ +.PP +.I rfd +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.B EPOLLET +¥Õ¥é¥° (¥¨¥Ã¥¸¥È¥ê¥¬) ¤ò»È¤Ã¤Æ +.B epoll +¤ËÄɲ䵤ì¤Æ¤¤¤ë¤È¡¢ +ÍøÍѲÄǽ¤Ê¥Ç¡¼¥¿¤¬¥Õ¥¡¥¤¥ëÆþÎϥХåե¡¤Ë¤Þ¤À¸ºß¤¹¤ë¤Ë¤â¤«¤«¤ï¤é¤º +¥¹¥Æ¥Ã¥× +.B 5 +¤Î +.BR epoll_wait (2) +¤Î¸Æ¤Ó½Ð¤·¤Ç¥Ï¥ó¥°¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤½¤Î°ìÊý¤Ç¡¢¥ê¥â¡¼¥È¤ÎÀܳÀè (peer) ¤Ï´û¤ËÁ÷¤é¤ì¤¿¥Ç¡¼¥¿¤Ë +´ð¤Å¤¤¤Æ±þÅú¤ò´üÂÔ¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î¤è¤¦¤Ê¤³¤È¤¬µ¯¤³¤ëÍýͳ¤Ï¡¢¥¨¥Ã¥¸¥È¥ê¥¬¥¤¥Ù¥ó¥ÈÇÛÁ÷¤Ç¤Ï¡¢ +¥â¥Ë¥¿¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Ç¥¤¥Ù¥ó¥È¤¬µ¯¤Ã¤¿¤È¤­¤Ë¤Î¤ß¥¤¥Ù¥ó¥È¤¬ +ÇÛÁ÷¤µ¤ì¤ë¤¿¤á¤Ç¤¢¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢¥¹¥Æ¥Ã¥× +.B 5 +¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¤Ï·ë²ÌŪ¤Ë +ÆþÎϥХåե¡Æâ¤Ë¤¹¤Ç¸ºß¤¹¤ë¥Ç¡¼¥¿¤òÂԤĤ³¤È¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¾åµ­¤ÎÎã¤Ç¤Ï¡¢ +.B 2 +¤Ç¹Ô¤ï¤ì¤¿½ñ¤­¹þ¤ß¤Ë¤è¤Ã¤Æ +.I rfd +¤Ë´Ø¤¹¤ë¥¤¥Ù¥ó¥È¤¬À¸À®¤µ¤ì¡¢ +.B 3 +¤Ç¥¤¥Ù¥ó¥È¤¬¾ÃÈñ (consume) ¤µ¤ì¤ë¡£ +.B 4 +¤Ç¹Ô¤ï¤ì¤ëÆɤ߹þ¤ßÁàºî¤Ç¤Ï¡¢Á´Éô¤Î¥Ð¥Ã¥Õ¥¡¥Ç¡¼¥¿¤ò¾ÃÈñ¤·¤Ê¤¤¤Î¤Ç¡¢ +¥¹¥Æ¥Ã¥× +.B 5 +¤Ç¹Ô¤ï¤ì¤ë +.BR epoll_wait (2) +¤Î¸Æ¤Ó½Ð¤·¤¬ +̵´ü¸Â¤ËÄä»ß (block) ¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ + +.B EPOLLET +¥Õ¥é¥°¤òºÎÍѤ¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¥Ö¥í¥Ã¥¯¤·¤Ê¤¤ (nonblocking) ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï¡¢¥Ö¥í¥Ã¥¯¤µ¤ì¤ëÆɤ߹þ¤ß¤ä½ñ¤­¹þ¤ß¤Ë¤è¤Ã¤Æ¡¢ +Ê£¿ô¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò°·¤¦¥¿¥¹¥¯¤¬ +Ää»ß¤·¤Æ¤·¤Þ¤¦¤Î¤òÈò¤±¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.B epoll +¤ò¥¨¥Ã¥¸¥È¥ê¥¬ +.RB ( EPOLLET ) +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤È¤·¤Æ»È¤¦¤¿¤á¤ËÄó°Æ¤µ¤ì¤ëÊýË¡¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.RS +.TP 4 +.B i +¥Ö¥í¥Ã¥¯¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤È¶¦¤Ë»È¤¦¡£ +.TP +.B ii +.BR read (2) +¤Þ¤¿¤Ï +.BR write (2) +¤¬ +.B EAGAIN +¤òÊÖ¤·¤¿¸å¤Ç¤Î¤ß¡¢¥¤¥Ù¥ó¥È¤òÂԤġ£ +.RE +.PP +°ìÊý¡¢¥ì¥Ù¥ë¥È¥ê¥¬¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤È¤·¤Æ»È¤¦¾ì¹ç + (¤³¤Á¤é¤¬¥Ç¥Õ¥©¥ë¥È¤Ç¤¢¤ë¡¢ +.B EPOLLET +¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç)¡¢ +.B epoll +¤Ïñ¤Ë¹â®¤Ê +.BR poll (2) +¤Ç¤¢¤ê¡¢»È¤¤Êý¤¬Æ±¤¸¤Ê¤Î¤Ç¡¢ +.BR poll (2) +¤¬»È¤ï¤ì¤Æ¤¤¤ë¤È¤³¤í¤Ç¤Ï¤É¤³¤Ç¤â»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¥¨¥Ã¥¸¥È¥ê¥¬¤ò»È¤Ã¤¿¾ì¹ç¤Ç¤â¡¢Ê£¿ô¤Î¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ë¤ÈÊ£¿ô¤Î +.B epoll +¥¤¥Ù¥ó¥È¤¬À¸À®¤µ¤ì¤ë¤Î¤Ç¡¢ +¸Æ¤Ó½Ð¤·Â¦¤Ë¤Ï +.B EPOLLONESHOT +¥Õ¥é¥°¤ò»ØÄꤹ¤ë¥ª¥×¥·¥ç¥ó¤¬¤¢¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï +.B epoll +¤ËÂФ·¤Æ¡¢ +.BR epoll_wait (2) +¤Ë¤è¤ë¥¤¥Ù¥ó¥È¤ò¼õ¿®¤·¤¿¸å¤Ç¡¢´ØÏ¢¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò̵¸ú¤Ë¤µ¤»¤ë¡£ +.B EPOLLONESHOT +¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢ +.BR epoll_ctl (2) +¤Ë +.B EPOLL_CTL_MOD +¤ò»ØÄꤷ¤Æ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òºÆÅÙ»ÈÍѤǤ­¤ë¤è¤¦¤Ë¤¹¤ë¤Î¤Ï¡¢ +¸Æ¤Ó½Ð¤·Â¦¤ÎÀÕǤ¤Ç¤¢¤ë¡£ +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +epoll ¤¬¾ÃÈñ¤¹¤ë¥«¡¼¥Í¥ë¥á¥â¥ê¤ÎÎ̤òÀ©¸Â¤¹¤ë¤¿¤á¤Ë¡¢ +°Ê²¼¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.\" 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 +.IR /proc/sys/fs/epoll/max_user_watches " (Linux 2.6.28 °Ê¹ß)" +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¤¢¤ë¥æ¡¼¥¶¤¬¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î epoll ¥¤¥ó¥¹¥¿¥ó¥¹¤Ë +ÅÐÏ¿¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÁí¿ô¤Î¾å¸Â¤òµ¬Äꤹ¤ë¡£ +¤³¤Î¾å¸Â¤Ï¼Â¥æ¡¼¥¶ ID ñ°Ì¤Ç¤¢¤ë¡£ +ÅÐÏ¿¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ 1 ¤Ä¤¬¾ÃÈñ¤¹¤ë¥á¥â¥êÎ̤ϡ¢ +32 ¥Ó¥Ã¥È¥«¡¼¥Í¥ë¤Ç¤ª¤è¤½ 90 ¥Ð¥¤¥È¡¢ +64 ¥Ó¥Ã¥È¥«¡¼¥Í¥ë¤Ç¤ª¤è¤½ 160 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +.\" 2.6.29 (in 2.6.28, the default was 1/32 of lowmem) +¸½ºß¤Î¤È¤³¤í¡¢ +.I max_user_watches +¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤϡ¢ÍøÍѲÄǽ¤Ê¥á¥â¥ê²¼¸Â¤Î 1/25 (4%) ¤Ç¤¢¤ê¡¢ +ÅÐÏ¿¤Ç¾ÃÈñ¤µ¤ì¤ë¥á¥â¥êÎÌ (¥Ð¥¤¥Èñ°Ì) ¤Ç³ä¤Ã¤¿ÃͤȤʤ롣 +.SS ¤ª¤¹¤¹¤á¤Ê»ÈÍÑÎã +¥ì¥Ù¥ë¥È¥ê¥¬¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤È¤·¤Æ»ÈÍѤ¹¤ë¤È¤­¤Î +.B epoll +¤Î»È¤¤Êý¤Ï +.BR poll (2) +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +¤·¤«¤·¥¨¥Ã¥¸¥È¥ê¥¬¤È¤·¤Æ»È¤¦¾ì¹ç¤Ï¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥¤¥Ù¥ó¥È¥ë¡¼¥×¤Ç¥¹¥È¡¼¥ë (stall) ¤·¤Ê¤¤¤è¤¦¤Ë¡¢ +»È¤¤Êý¤ò¤è¤êÌÀ³Î¤Ë¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +¤³¤ÎÎã¤Ç¤Ï¡¢¥ê¥¹¥Ê¤Ï¥Ö¥í¥Ã¥¯¤·¤Ê¤¤¥½¥±¥Ã¥È¤Ç¤¢¤ê¡¢ +.BR listen (2) +¤¬¸Æ¤Ð¤ì¤Æ¤¤¤ë¡£ +´Ø¿ô +.I do_use_fd() +¤Ï¡¢ +.BR read (2) +¤Þ¤¿¤Ï +.BR write (2) +¤Ë¤è¤Ã¤Æ +.B EAGAIN +¤¬ÊÖ¤µ¤ì¤ë¤Þ¤Ç¤Ï¡¢¿·¤·¤¤½àÈ÷ºÑ¤ß¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»È¤¦¡£ +¥¤¥Ù¥ó¥È¶îÆ°¥¹¥Æ¡¼¥È¥Þ¥·¥ó¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢ +.B EAGAIN +¤ò¼õ¿®¤·¤¿¸å¡¢¥«¥ì¥ó¥È¤Î¾õÂÖ¤òµ­Ï¿¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¼¡¤Î +.I do_use_fd() +¸Æ¤Ó½Ð¤·¤Î¤È¤­¤Ë¡¢°ÊÁ°¤ËÄä»ß¤·¤¿¤È¤³¤í¤«¤é +.BR read (2) +¤Þ¤¿¤Ï +.BR write (2) +¤ò·Ñ³¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.in +4n +.nf +#define MAX_EVENTS 10 +struct epoll_event ev, events[MAX_EVENTS]; +int listen_sock, conn_sock, nfds, epollfd; + +/* Set up listening socket, \(aqlisten_sock\(aq (socket(), + bind(), listen()) */ + +epollfd = epoll_create(10); +if (epollfd == \-1) { + perror("epoll_create"); + exit(EXIT_FAILURE); +} + +ev.events = EPOLLIN; +ev.data.fd = listen_sock; +if (epoll_ctl(epollfd, EPOLL_CTL_ADD, listen_sock, &ev) == \-1) { + perror("epoll_ctl: listen_sock"); + exit(EXIT_FAILURE); +} + +for (;;) { + nfds = epoll_wait(epollfd, events, MAX_EVENTS, \-1); + if (nfds == \-1) { + perror("epoll_pwait"); + exit(EXIT_FAILURE); + } + + for (n = 0; n < nfds; ++n) { + if (events[n].data.fd == listen_sock) { + conn_sock = accept(listen_sock, + (struct sockaddr *) &local, &addrlen); + if (conn_sock == \-1) { + perror("accept"); + exit(EXIT_FAILURE); + } + setnonblocking(conn_sock); + ev.events = EPOLLIN | EPOLLET; + ev.data.fd = conn_sock; + if (epoll_ctl(epollfd, EPOLL_CTL_ADD, conn_sock, + &ev) == \-1) { + perror("epoll_ctl: conn_sock"); + exit(EXIT_FAILURE); + } + } else { + do_use_fd(events[n].data.fd); + } + } +} +.fi +.in + +¥¨¥Ã¥¸¥È¥ê¥¬¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤È¤·¤Æ»È¤¦¾ì¹ç¡¢À­Ç½¾å¤ÎÍýͳ¤Ë¤è¤ê¡¢ +°ìÅÙ +.RB ( EPOLLIN | EPOLLOUT ) +¤ò»ØÄꤷ¤Æ¤«¤é +.RB ( EPOLL_CTL_ADD +¤Ç) ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +.B epoll +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ËÄɲ乤뤳¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢ +.BR epoll_ctl (2) +¤Ë +.B EPOLL_CTL_MOD +¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¤Ç +.B EPOLLIN +¤È +.B EPOLLOUT +¤ÎϢ³Ū¤ÊÀÚ¤êÂؤ¨¤¬Èò¤±¤é¤ì¤ë¡£ +.SS ¼ÁÌä¤È²òÅú +.TP 4 +.B Q0 +.B epoll +½¸¹çÆâ¤ÎÅÐÏ¿¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¶èÊ̤¹¤ë¤Ë¤Ï¡¢ +²¿¤ò¥­¡¼¤È¤·¤Æ»È¤¨¤Ð¤è¤¤¤«¡© +.TP +.B A0 +¥­¡¼¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ÈÖ¹æ¤È¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò (open file +description) ¤ÎÁȤǤ¢¤ë (¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¤Ï "open file handle" ¤È¤â +¸Æ¤Ð¤ì¡¢¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥«¡¼¥Í¥ë¤ÎÆâÉôɽ¸½¤Ç¤¢¤ë)¡£ +.TP +.B Q1 +1 ¤Ä¤Î +.B epoll +¥¤¥ó¥¹¥¿¥ó¥¹¤ËƱ¤¸¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò 2 ²óÅÐÏ¿¤¹¤ë¤È¤É¤¦¤Ê¤ë¤«¡© +.TP +.B A1 +¤¿¤Ö¤ó +.B EEXIST +¤ò¼õ¤±¼è¤ë¤À¤í¤¦¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢Æ±¤¸ +.B epoll +¥¤¥ó¥¹¥¿¥ó¥¹¤ËÂФ·¤ÆÊ£À½¤µ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÄɲ乤뤳¤È¤Ï²Äǽ¤Ç¤¢¤ë +.RB ( dup (2), +.BR dup2 (2), +.BR fcntl (2) +.B F_DUPFD +¤Ê¤É)¡£ +.\" 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 +.\" cannot add the duplicate file descriptor to the epoll set. (In every +.\" other case that I can think of, descriptors duplicated by fork have +.\" similar semantics to descriptors duplicated by dup() and friends.) On +.\" the other hand, the very fact that the child has a duplicate of the +.\" descriptor means that even if the parent closes its descriptor, then +.\" epoll_wait() in the parent will continue to receive notifications for +.\" that descriptor because of the duplicated descriptor in the child. +.\" +.\" See http://thread.gmane.org/gmane.linux.kernel/596462/ +.\" "epoll design problems with common fork/exec patterns" +.\" +.\" mtk, Feb 2008 +Ê£À½¤·¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò°Û¤Ê¤ë +.I events +¥Þ¥¹¥¯¤ÇÅÐÏ¿¤¹¤ì¤Ð¡¢¥¤¥Ù¥ó¥È¤ò¥Õ¥£¥ë¥¿¥ê¥ó¥°¤¹¤ë¤Î¤Ë +¤³¤Îµ¡Ç½¤ÏÍ­ÍѤʼêË¡¤Ç¤¢¤ë¡£ +.TP +.B Q2 +2 ¤Ä¤Î +.B epoll +¥¤¥ó¥¹¥¿¥ó¥¹¤¬Æ±¤¸¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÂÔ¤Á¼õ¤±¤ë¤³¤È¤Ï²Äǽ¤«¡© +¤â¤·²Äǽ¤Ç¤¢¤ì¤Ð¡¢¥¤¥Ù¥ó¥È¤ÏξÊý¤Î +.B epoll +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÊó¹ð¤µ¤ì¤ë¤«¡© +.TP +.B A2 +¥¤¥Ù¥ó¥È¤ÏξÊý¤ËÊó¹ð¤µ¤ì¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¤³¤ì¤òÀµ¤·¤¯°·¤¦¤Ë¤ÏÃí°Õ¿¼¤¯¥×¥í¥°¥é¥ß¥ó¥°¤¹¤ëɬÍפ¬ +¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.B Q3 +.B epoll +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¼«¿È¤Ï poll/epoll/select ¤¬²Äǽ¤«¡© +.TP +.B A3 +²Äǽ¤Ç¤¢¤ë¡£ +.B epoll +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë½èÍýÂÔ¤Á¤Î¥¤¥Ù¥ó¥È¤¬¤¢¤ë¾ì¹ç¤Ï¡¢ +Æɤ߽Ф·²Äǽ¤À¤ÈÄÌÃΤµ¤ì¤ë¤³¤È¤À¤í¤¦¡£ +.TP +.B Q4 +.B epoll +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¼«¿È¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Ë +Æþ¤ì¤è¤¦¤È¤¹¤ë¤È¤É¤¦¤Ê¤ë¤«¡© +.TP +.B A4 +.BR epoll_ctl (2) +¤Î¸Æ¤Ó½Ð¤·¤Ï +.RB ( EINVAL +¤Ç) ¼ºÇÔ¤¹¤ë¤À¤í¤¦¡£ +¤¿¤À¤· +.B epoll +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¾¤Î +.B epoll +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤ÎÆâÉô¤ËÄɲ乤뤳¤È¤Ï²Äǽ¤Ç¤¢¤ë¡£ +.TP +.B Q5 +.B epoll +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤Ç¾¤Î¥×¥í¥»¥¹¤ËÁ÷¤ë¤³¤È¤Ï²Äǽ¤«¡© +.TP +.B A5 +²Äǽ¤À¤¬¡¢¤³¤ì¤ò¤¹¤ë¤³¤È¤Ë°ÕÌ£¤Ï¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢¼õ¿®Â¦¤Î¥×¥í¥»¥¹¤¬ +.B epoll +½¸¹çÆâ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥³¥Ô¡¼¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.TP +.B Q6 +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë¤È¡¢¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÁ´¤Æ¤Î +.B epoll +½¸¹ç¤«¤é¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤«¡© +.TP +.B A6 +ºï½ü¤µ¤ì¤ë¤¬¡¢°Ê²¼¤ÎÅÀ¤ËÃí°Õ¤¬É¬ÍפǤ¢¤ë¡£ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò +.RB ( open (2) +»²¾È) ¤Ø¤Î»²¾È¤Ç¤¢¤ë¡£ +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÊ£À½¤ò +.BR dup (2), +.BR dup2 (2), +.BR fcntl (2) +¤Î +.B F_DUPFD +¤ä +.BR fork (2) +·Ðͳ¤Ç¹Ô¤¦Å٤ˡ¢Æ±¤¸¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¤ò»²¾È¤¹¤ë¿·µ¬¤Î¥Õ¥¡¥¤¥ë +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬À¸À®¤µ¤ì¤ë¡£ +¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¼«ÂΤϡ¢¼«¿È¤ò»²¾È¤¹¤ëÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +¤¬¥¯¥í¡¼¥º¤µ¤ì¤ë¤Þ¤Ç¸ºß¤·Â³¤±¤ë¡£ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.B epoll +½¸¹ç¤«¤éºï½ü¤µ¤ì¤ë¤Î¤Ï¡¢Âбþ¤¹¤ë¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¤ò»²¾È¤·¤Æ¤¤¤ë +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿¸å¤Ç¤¢¤ë +.RB ( epoll_ctl () +.B EPOLL_CTL_DEL +¤ò»È¤Ã¤Æ¤½¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÌÀ¼¨Åª¤Ëºï½ü¤·¤¿¾ì¹ç¤Ë¤âºï½ü¤µ¤ì¤ë)¡£ +¤³¤Î¤³¤È¤Ï¡¢ +.B epoll +½¸¹ç¤Ë°¤·¤Æ¤¤¤ë¤¢¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤·¤¿¸å¤Ç¤¢¤Ã¤Æ¤â¡¢ +Ʊ¤¸¥Õ¥¡¥¤¥ëµ­½Ò¤ò»²¾È¤¹¤ë¾¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë´Ö¤Ï¡¢ +¥¯¥í¡¼¥º¤·¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿°¸¤Ë¥¤¥Ù¥ó¥È¤¬Êó¹ð¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¤È +¤¤¤¦¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.TP +.B Q7 +2 ¤Ä°Ê¾å¤Î¥¤¥Ù¥ó¥È¤¬ +.BR epoll_wait (2) +¥³¡¼¥ë¤Î´Ö¤ËȯÀ¸¤·¤¿¾ì¹ç¡¢¤½¤ì¤é¤Ï¤Þ¤È¤á¤ÆÊó¹ð¤µ¤ì¤ë¤«¡¢ +¤½¤ì¤È¤âÊÌ¡¹¤ËÊó¹ð¤µ¤ì¤ë¤«¡© +.TP +.B A7 +¤Þ¤È¤á¤ÆÊó¹ð¤µ¤ì¤ë¤À¤í¤¦¡£ +.TP +.B Q8 +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ëÁàºî¤Ï¡¢ +´û¤Ë½¸¤á¤é¤ì¤Æ¤¤¤ë¤¬¤Þ¤ÀÊó¹ð¤µ¤ì¤Æ¤¤¤Ê¤¤¥¤¥Ù¥ó¥È¤Ë±Æ¶Á¤¹¤ë¤«¡© +.TP +.B A8 +´û¸¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ 2 ¤Ä¤ÎÁàºî¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¾ì¹ç¡¢ºï½ü¤Ë¤Ï°ÕÌ£¤¬¤Ê¤¤¡£ +Êѹ¹¤¹¤ë¤È¡¢»ÈÍѲÄǽ¤Ê I/O ¤¬ºÆ¤ÓÆɤ߹þ¤Þ¤ì¤ë¡£ +.TP +.B Q9 +.B EPOLLET +¥Õ¥é¥° (¥¨¥Ã¥¸¥È¥ê¥¬Æ°ºî) ¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +.B EAGAIN +¤ò¼õ¤±¼è¤ë¤Þ¤Ç¡¢ +·Ñ³¤·¤Æ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÆɤ߽ñ¤­¤¹¤ëɬÍפ¬¤¢¤ë¤«¡© +.TP +.B A9 +.BR epoll_wait (2) +¤«¤é¥¤¥Ù¥ó¥È¤ò¼õ¤±¼è¤ë¤³¤È¤Ï¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Í׵ᤵ¤ì¤¿ I/O Áàºî¤ËÂФ·¤Æ½àÈ÷ºÑ¤ß¤Ç¤¢¤ë¡¢ +¤È¤¤¤¦¤³¤È¤ò¥æ¡¼¥¶¤Ë¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£ +¼¡¤Î (¥Ö¥í¥Ã¥¯¤·¤Ê¤¤) read/write ¤Ç +.B EAGAIN +¤ò¼õ¤±¼è¤ë¤Þ¤Ç¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï½àÈ÷ºÑ¤ß¤Ç¤¢¤ë¤È +¹Í¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¤¤¤Ä¤É¤Î¤è¤¦¤Ë»È¤¦¤«¤Ï¡¢ +Á´¤¯¥æ¡¼¥¶¤ËǤ¤µ¤ì¤Æ¤ë¡£ +.sp +¥Ñ¥±¥Ã¥È»Ø¸þ¤ä¥È¡¼¥¯¥ó»Ø¸þ¤Î¥Õ¥¡¥¤¥ë (Î㤨¤Ð¡¢¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¡¢ +canonical ¥â¡¼¥É¤ÎüËö) ¤Ç¤Ï¡¢ +Æɤ߹þ¤ßÍÑ / ½ñ¤­¹þ¤ßÍѤΠI/O ¶õ´Ö¤ÎËöÈø¤ò¸¡ÃΤ¹¤ëÍ£°ì¤ÎÊýË¡¤Ï +.B EAGAIN +¤Ë¤Ê¤ë¤Þ¤Ç read/write ¤ò¹Ô¤¦¤³¤È¤Ç¤¢¤ë¡£ +.sp +¥¹¥È¥ê¡¼¥à»Ø¸þ¤Î¥Õ¥¡¥¤¥ë (Î㤨¤Ð¡¢¥Ñ¥¤¥×¡¢FIFO¡¢¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È) ¤Ç¤Ï¡¢ +Æɤ߹þ¤ßÍÑ / ½ñ¤­¹þ¤ßÍѤΠI/O ¶õ´Ö¤¬»È¤¤¿Ô¤¯¤µ¤ì¤¿¾õÂ֤ϡ¢ +ÂоݤȤʤë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÆɤ߹þ¤ó¤À¥Ç¡¼¥¿Î̤ޤ¿¤Ï +½ñ¤­¹þ¤ó¤À¥Ç¡¼¥¿Î̤ò¥Á¥§¥Ã¥¯¤¹¤ë¤³¤È¤Ç¤â¸¡ÃΤǤ­¤ë¡£ +Î㤨¤Ð¡¢¤¢¤ëÆÃÄê¤ÎÎ̤Υǡ¼¥¿¤òÆɤ߹þ¤à¤¿¤á¤Ë +.BR read (2) +¤ò¸Æ¤ó¤À¤È¤­¤Ë¡¢ +.BR read (2) +¤¬ÊÖ¤·¤¿¥Ð¥¤¥È¿ô¤¬¤½¤ì¤è¤ê¾¯¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÆɤ߹þ¤ßÍÑ I/O ¶õ´Ö¤¬ +»È¤¤¿Ô¤¯¤µ¤ì¤¿¤³¤È¤¬Ê¬¤«¤ë¡£ +.BR write (2) +¤ò»È¤Ã¤Æ½ñ¤­¹þ¤ß¤ò¤¹¤ë¤È¤­¤â¡¢Æ±¤¸¤³¤È¤¬¸À¤¨¤ë +(´Æ»ë¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¾ï¤Ë¥¹¥È¥ê¡¼¥à»Ø¸þ¤Î¥Õ¥¡¥¤¥ë¤ò +»²¾È¤·¤Æ¤¤¤ë¤³¤È¤òÊݾڤǤ­¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¸å¼Ô¤Î¼êË¡¤Î»ÈÍѤòÈò¤±¤ë¤³¤È)¡£ +.SS ¤¢¤ê¤¬¤Á¤ÊÍî¤È¤··ê¤È²óÈòÊýË¡ +.TP +.B o µ²²î (starvation) (¥¨¥Ã¥¸¥È¥ê¥¬) +.PP +Â礭¤Ê I/O ¶õ´Ö¤¬¤¢¤ë¾ì¹ç¡¢ +¤½¤Î I/O ¶õ´Ö¤Î¥Ç¡¼¥¿¤òÁ´¤Æ½èÍý (drain) ¤·¤è¤¦¤È¤¹¤ë¤È¡¢ +¾¤Î¥Õ¥¡¥¤¥ë¤¬½èÍý¤µ¤ì¤º¡¢µ²²î¤òȯÀ¸¤µ¤»¤ë¤³¤È¤¬¤¢¤ë +(¤³¤ÎÌäÂê¤Ï +.B epoll +¤Ë¸ÇÍ­¤Î¤â¤Î¤Ç¤Ï¤Ê¤¤)¡£ +.PP +¤³¤ÎÌäÂê¤Î²ò·èË¡¤Ï¡¢½àÈ÷ºÑ¤ß¾õÂ֤Υꥹ¥È¤ò´ÉÍý¤·¤Æ¡¢ +´ØÏ¢¤¹¤ë data ¹½Â¤ÂΤÎÃæ¤Ç¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +ÍøÍѲÄǽ¤Ç¤¢¤ë¤È¥Þ¡¼¥¯¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +¤½¤ì¤Ë¤è¤Ã¤Æ¡¢ÍøÍѲÄǽ¤Ê¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤ÎÃæ¤Ç +¤É¤Î¥Õ¥¡¥¤¥ë¤ò½èÍý¤¹¤ëɬÍפ¬¤¢¤ë¤«¤ò²±¤¨¤ë¤³¤È¤¬¤Ç¤­¡¢ +¤·¤«¤â½çÈ֤˽èÍý (round robin) ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +´û¤ËÍøÍѲÄǽ¤Ç¤¢¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +¤½¤ì°Ê¸å¤Ë¼õ¤±¼è¤ë¥¤¥Ù¥ó¥È¤ò̵»ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.TP +.B o ¥¤¥Ù¥ó¥È¥­¥ã¥Ã¥·¥å¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç +.PP +¥¤¥Ù¥ó¥È¥­¥ã¥Ã¥·¥å¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¤Þ¤¿¤Ï +.BR epoll_wait (2) +¤«¤éÊÖ¤µ¤ì¤¿Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò³ÊǼ¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +¥¯¥í¡¼¥º¤µ¤ì¤¿¤³¤È¤òưŪ¤Ë¥Þ¡¼¥¯¤¹¤ë +(¤Ä¤Þ¤êÁ°¤Î¥¤¥Ù¥ó¥È¤Î½èÍý¤Ë¤è¤Ã¤Æ¥Þ¡¼¥¯¤µ¤ì¤ë) ÊýË¡¤òÄ󶡤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.BR epoll_wait (2) +¤«¤é 100 ¸Ä¤Î¥¤¥Ù¥ó¥È¤ò¼õ¤±¼è¤ê¡¢ +¥¤¥Ù¥ó¥È #47 ¤Ç¤Ï¤¢¤ë¾ò·ï¤Ç¥¤¥Ù¥ó¥È #13 ¤¬ÊĤ¸¤é¤ì¤ë¤È²¾Äꤹ¤ë¡£ +¥¤¥Ù¥ó¥È #13 ¤Î¹½Â¤ÂΤòºï½ü¤·¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +.BR close (2) +¤¹¤ë¤È¡¢¥¤¥Ù¥ó¥È¥­¥ã¥Ã¥·¥å¤Ï¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÂԤĥ¤¥Ù¥ó¥È¤¬ +¸ºß¤¹¤ë¤È¤¤¤Ã¤Æ¡¢º®Í𤬵¯¤­¤ë¡£ +.PP +¤³¤ÎÌäÂê¤ò²ò·è¤¹¤ë 1 ¤Ä¤ÎÊýË¡¤Ï¡¢¥¤¥Ù¥ó¥È 47 ¤Î½èÍý¤ò¤·¤Æ¤¤¤ë´Ö¤Ë¡¢ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ 13 ¤òºï½ü¤·¤Æ +.BR close (2) +¤¹¤ë¤¿¤á¤Ë +.BR epoll_ctl ( EPOLL_CTL_DEL ) +¤ò¸Æ¤Ó½Ð¤·¡¢´ØÏ¢ÉÕ¤±¤é¤ì¤¿ data ¹½Â¤ÂΤòºï½üºÑ¤ß¤È¥Þ¡¼¥¯¤·¤Æ¡¢ +¥¯¥ê¡¼¥ó¥¢¥Ã¥×¥ê¥¹¥È¤Ë¥ê¥ó¥¯¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +¥Ð¥Ã¥Á½èÍý¤ÎÃæ¤Ç¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ 13 ¤Ë¤Ä¤¤¤Æ¤Î +¾¤Î¥¤¥Ù¥ó¥È¤ò¸«¤Ä¤±¤¿¾ì¹ç¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬°ÊÁ°¤Ëºï½ü¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¤Èʬ¤«¤ë¤Î¤Ç¡¢ +º®Íð¤Ïµ¯¤­¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.B epoll +API ¤Ï Linux ¥«¡¼¥Í¥ë 2.5.44 ¤ËƳÆþ¤µ¤ì¤¿¡£ +.\" ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï Linux ¥«¡¼¥Í¥ë 2.5.66 ¤Ç³ÎÄꤵ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3.2 ¤ÇÄɲ䵤줿¡£ +.SH ½àµò +.B epoll +API ¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£ +¾¤Î¥·¥¹¥Æ¥à¤Ç¤âƱÍͤε¡¹½¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤¬¤¢¤ë¡£ +Î㤨¤Ð¡¢FreeBSD ¤Î +.I kqueue +¤ä Solaris ¤Î +.I /dev/poll +¤Ê¤É¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR epoll_create (2), +.BR epoll_create1 (2), +.BR epoll_ctl (2), +.BR epoll_wait (2) diff --git a/release/man7/feature_test_macros.7 b/release/man7/feature_test_macros.7 new file mode 100644 index 00000000..84b6385f --- /dev/null +++ b/release/man7/feature_test_macros.7 @@ -0,0 +1,592 @@ +.\" 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 2009-12-13 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +feature_test_macros \- µ¡Ç½¸¡ºº¥Þ¥¯¥í +.SH ½ñ¼° +.nf +.B #include +.fi +.SH ÀâÌÀ +µ¡Ç½¸¡ºº¥Þ¥¯¥í (feature test macro) ¤Ë¤è¤ê¡¢¥×¥í¥°¥é¥Þ¤Ï +¥×¥í¥°¥é¥à¤¬¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤ëºÝ¤Ë¥·¥¹¥Æ¥à¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ë¤è¤ê +¸ø³«¤µ¤ì¤ëÄêµÁ¤òÀ©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Îµ¡Ç½¤ò»È¤¦¤È¡¢Èóɸ½à¤ÎÄêµÁ¤¬¸ø³«¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤Ç¤­¡¢ +°Ü¿¢À­¤Î¤¢¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òºîÀ®¤¹¤ë¤Î¤ËÌòΩ¤Ä¡£ +¾¤Î¥Þ¥¯¥í¤ò»È¤¦¤È¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¸ø³«¤µ¤ì¤Ê¤¤Èóɸ½à¤ÎÄêµÁ¤ò +¸ø³«¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°Ê²¼¤ÇÀâÌÀ¤¹¤ëµ¡Ç½¸¡ºº¥Þ¥¯¥í¤Î¤½¤ì¤¾¤ì¤ÎÀµ³Î¤Ê±Æ¶Á¤ò³Îǧ¤¹¤ë¤Ë¤Ï¡¢ +¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.I +¤òÄ´¤Ù¤ì¤Ð¤è¤¤¡£ + +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤òµ¡Ç½¤µ¤»¤ë¤Ë¤Ï¡¢µ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÄêµÁ¤ò +¡Ö¤É¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¥¤¥ó¥¯¥ë¡¼¥É¤è¤ê¤âÁ°¤Ç¡×¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤ò¼Â¸½¤¹¤ë¤Ë¤Ï¡¢ +¥³¥ó¥Ñ¥¤¥ë¥³¥Þ¥ó¥É¤Ç»ØÄꤹ¤ëÊýË¡ +.RI ( "cc \-DMACRO=value" ) +¤È¡¢¥½¡¼¥¹¥³¡¼¥ÉÆâ¤ÇɬÍפʥޥ¯¥í¤ÎÄêµÁ¤ò +¤É¤Î¥Ø¥Ã¥À¤Î¥¤¥ó¥¯¥ë¡¼¥É¤è¤ê¤âÁ°¤Ç¹Ô¤¦ÊýË¡¤¬¤¢¤ë¡£ +.SS ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï¤Îµ¬Äê +´Ø¿ô¤¬µ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÄêµÁ¤òɬÍפȤ¹¤ë¾ì¹ç¡¢ +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î½ñ¼° (SYNOPSIS) ¤ÎÀá¤Ë +°Ê²¼¤Î·Á¼°¤ÎÃí¼á¤òÆþ¤ì¤ë +(°Ê²¼¤ÎÎã¤Ï +.BR chmod (2) +¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤«¤é¤Î°úÍѤǤ¢¤ë)¡£ +.RS +.sp +.B #include +.sp +.BI "int chmod(const char *" path ", mode_t " mode ); +.br +.BI "int fchmod(int " fd ", mode_t " mode ); +.sp +.in -4n +glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï +.RB ( feature_test_macros (7) +»²¾È): +.in +.sp +.BR fchmod (): +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.RE +.PP +\fB||\fP ¤Ï¡¢ +.BR fchmod (2) +¤ÎÄêµÁ¤ò +.I +¤«¤éÆÀ¤ë¤Ë¤Ï¡¢°Ê²¼¤Î¥Þ¥¯¥í¤ÎÄêµÁ¤Î¤¤¤º¤ì¤«¤ò¡¢¤É¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î +¥¤¥ó¥¯¥ë¡¼¥É¤è¤ê¤âÁ°¤Ç¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.RS +.nf + +#define _BSD_SOURCE +#define _XOPEN_SOURCE 500 /* or any value > 500 */ +.fi +.RE +.PP +Ê̤ÎÊýË¡¤È¤·¤Æ¤Ï¡¢Åù²Á¤ÊÄêµÁ¤ò¥³¥ó¥Ñ¥¤¥ëÍѤΥ³¥Þ¥ó¥É¤Ç +»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.RS +.nf + +cc \-D_BSD_SOURCE +cc \-D_XOPEN_SOURCE=500 # Or any value > 500 +.fi +.RE +.PP +¸å¤Ç½Ò¤Ù¤ë¤¬¡¢ +.B ¡Ö¤¤¤¯¤Ä¤«¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤Ï¥Ç¥Õ¥©¥ë¥È¤ÇÄêµÁ¤µ¤ì¤ë¡× +ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤³¤Î¤¿¤á¡¢¡Ö½ñ¼°¡×¤Ëµ­ºÜ¤µ¤ì¤¿µ¡Ç½¸¡ºº¥Þ¥¯¥í¤ò¾ï¤Ë +ÌÀ¼¨Åª¤Ë»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ + +¤¢¤Þ¤ê¿¤¯¤Ê¤¤¤¬¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¤è¤Ã¤Æ¤Ï¡¢ +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï¤ò°Ê²¼¤Î¤è¤¦¤Ë´Êñ¤Êɽ¸½¤Çµ­ºÜ¤¹¤ë¾ì¹ç¤¬¤¢¤ë¡£ +(°Ê²¼¤ÎÎã¤Ï +.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 +´Ø¿ôÄêµÁ¤Î¸ø³«¤Ë»È¤¨¤ëµ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬°ì¤Ä¤À¤±¤Ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¤½¤Î¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Ê¤¤¾ì¹ç¤Ë¡¢ +¤³¤Î·Á¼°¤Îɽ¸½¤òÍøÍѤ¹¤ë¡£ +.SS glibc ¤¬²ò¼á¤¹¤ëµ¡Ç½¸¡ºº¥Þ¥¯¥í +°Ê²¼¤Ç¤Ï¡¢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. + +Linux/glibc ¤Ï°Ê²¼¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ò²ò¼á¤¹¤ë: +.TP +.B __STRICT_ANSI__ +ISO ɸ½à¤Î C¡£ +.BR gcc (1) +¤ò +.I -std=c99 +¤ä +.I -ansi +¤Ê¤É¤Î¥Õ¥é¥°¤òÉÕ¤±¤Æµ¯Æ°¤·¤¿¾ì¹ç¡¢ +¤³¤Î¥Þ¥¯¥í¤Ï°ÅÌۤΤ¦¤Á¤ËÄêµÁ¤µ¤ì¤ë¡£ +.TP +.B _POSIX_C_SOURCE +¤³¤Î¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë¤È¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ç +°Ê²¼¤ÎÄêµÁ¤¬¸ø³«¤µ¤ì¤ë¡£ +.RS +.IP \(bu 3 +Ãͤ¬ 1 ¤Î¾ì¹ç¡¢POSIX.1-1990 ¤È ISO C (1990) ¤Ë½àµò¤¹¤ëÄêµÁ¤¬¸ø³«¤µ¤ì¤ë¡£ +.IP \(bu +Ãͤ¬ 2 °Ê¾å¤Î¾ì¹ç¡¢ +POSIX.2-1992 ´ØÏ¢¤ÎÄêµÁ¤âÄɲäǸø³«¤µ¤ì¤ë¡£ +.IP \(bu +Ãͤ¬ 199309 °Ê¾å¤Î¾ì¹ç¡¢ +POSIX.1b (¥ê¥¢¥ë¥¿¥¤¥à³ÈÄ¥) ´ØÏ¢¤ÎÄêµÁ¤¬ÄɲäǸø³«¤µ¤ì¤ë¡£ +.\" 199506L functionality is only available since glibc 2.1 +.IP \(bu +Ãͤ¬ 199506 °Ê¾å¤Î¾ì¹ç¡¢ +POSIX.1c (¥¹¥ì¥Ã¥É) ´ØÏ¢¤ÎÄêµÁ¤¬ÄɲäǸø³«¤µ¤ì¤ë¡£ +.IP \(bu +(glibc 2.3.3 °Ê¹ß) +Ãͤ¬ 200112L °Ê¾å¤Î¾ì¹ç¡¢ +(XSI ³ÈÄ¥¤ò½ü¤¯) POSIX.1-2001 ´ðËÜ»ÅÍͤËÂбþ¤¹¤ëÄêµÁ¤¬¸ø³«¤µ¤ì¤ë¡£ +.IP \(bu +(glibc 2.10 °Ê¹ß) +Ãͤ¬ 200809L °Ê¾å¤Î¾ì¹ç¡¢ +(XSI ³ÈÄ¥¤ò½ü¤¯) POSIX.1-2008 ´ðËÜ»ÅÍͤËÂбþ¤¹¤ëÄêµÁ¤¬¸ø³«¤µ¤ì¤ë¡£ +.RE +.TP +.B _POSIX_SOURCE +¤³¤Î¥Þ¥¯¥í¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£ +¤³¤Î¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤ë¤È¡¢Ãͤ˴ؤï¤é¤º¡¢ +.B _POSIX_C_SOURCE +¤òÃÍ 1 ¤ÇÄêµÁ¤¹¤ë¤Î¤ÈÅù²Á¤È¤Ê¤ë¡£ +.TP +.B _XOPEN_SOURCE +¤³¤Î¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë¤È¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ç°Ê²¼¤ÎÄêµÁ¤¬¸ø³«¤µ¤ì¤ë¡£ +.RS +.IP \(bu 3 +¤É¤ó¤ÊÃͤǤ⡢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ç +POSIX.1, POSIX.2, XPG4 ¤Ë½àµò¤¹¤ëÄêµÁ¤¬¸ø³«¤µ¤ì¤ë¡£ +.IP \(bu +Ãͤ¬ 500 °Ê¾å¤Î¾ì¹ç¡¢ +SUSv2 (UNIX 98) ´ØÏ¢¤ÎÄêµÁ¤¬ÄɲäǸø³«¤µ¤ì¤ë¡£ +.IP \(bu +(glibc 2.2 °Ê¹ß) +Ãͤ¬ 600 °Ê¾å¤Î¾ì¹ç¡¢ +SUSv3 (UNIX 03; POSIX.1-2001 ´ðËÜ»ÅÍÍ + XSI ³ÈÄ¥¤ÈƱ¤¸) +´ØÏ¢¤ÎÄêµÁ¤È C99 ¤Ç¤ÎÄêµÁ¤¬ÄɲäǸø³«¤µ¤ì¤ë¡£ +.IP \(bu +(glibc 2.10 °Ê¹ß) +Ãͤ¬ 700 °Ê¾å¤Î¾ì¹ç¡¢ +SUSv4 (POSIX.1-2008 ´ðËÜ»ÅÍÍ + XSI ³ÈÄ¥¤ÈƱ¤¸) +´ØÏ¢¤ÎÄêµÁ¤¬ÄɲäǸø³«¤µ¤ì¤ë¡£ +.RE +.TP +.B _XOPEN_SOURCE_EXTENDED +¤³¤Î¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¡¢¤µ¤é¤Ë +.B _XOPEN_SOURCE +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤È¡¢XPG4v2 (SUSv1) UNIX ³ÈÄ¥ (UNIX 95) +¤ËÂбþ¤¹¤ëÄêµÁ¤¬¸ø³«¤µ¤ì¤ë¡£ +.B _XOPEN_SOURCE +¤¬ 500 °Ê¾å¤ÎÃͤÇÄêµÁ¤µ¤ì¤¿¾ì¹ç¡¢¤³¤Î¥Þ¥¯¥í¤Ï°ÅÌۤΤ¦¤Á¤ËÄêµÁ¤µ¤ì¤ë¡£ +.TP +.B _ISOC99_SOURCE +ISO C (1990) ¤Î C99 ³ÈÄ¥¤ò¸ø³«¤¹¤ë¡£ +¤³¤Î¥Þ¥¯¥í¤Ï glibc 2.1.3 °Ê¹ß¤Çǧ¼±¤µ¤ì¤ë¡£ +½é´ü¤Î¥Ð¡¼¥¸¥ç¥ó 2.1.x ¤Î glibc ¤Ç¤Ï¡¢¤³¤ì¤ÈÅù²Á¤Ê +.B _ISOC9X_SOURCE +¤È¤¤¤¦Ì¾Á°¤Î¥Þ¥¯¥í¤¬»È¤ï¤ì¤Æ¤¤¤¿ +(¤Ê¤¼¤Ê¤é¡¢C99 ɸ½à¤Ï¤Þ¤À³ÎÄꤷ¤Æ¤¤¤Ê¤«¤Ã¤¿¤«¤é¤Ç¤¢¤ë)¡£ +.B _ISOC9X_SOURCE +¥Þ¥¯¥í¤Î»ÈÍѤÏÇѻߤµ¤ì¤Æ¤¤¤ë¤¬¡¢ +glibc ¤Ï²áµî¤È¤Î¸ß´¹À­¤Î¤¿¤áº£¤Ç¤â¤³¤Î¥Þ¥¯¥í¤òǧ¼±¤¹¤ë¡£ +.TP +.B _LARGEFILE64_SOURCE +LFS (Large File Summit) ¤Ë¤è¤ê +"»ÃÄê³ÈÄ¥ (transitional extension)" Single UNIX Specification +¤È¤·¤Æµ¬Äꤵ¤ì¤¿ÂåÂØ API (alternative API) ¤Ë´Ø¤¹¤ëÄêµÁ¤ò¸ø³«¤¹¤ë +(http://opengroup.org/platform/lfs.html »²¾È)¡£ +ÂåÂØ API ¤Ï¿·µ¬¥ª¥Ö¥¸¥§¥¯¥È (´Ø¿ô¤È·¿) ¤Î½¸¹ç¤Ç¹½À®¤µ¤ì¡¢ +¤½¤Î̾Á°¤Ï "64" ¤Ç½ª¤ï¤ë (Î㤨¤Ð¡¢ +.I off_t +¤ËÂбþ¤¹¤ë¤Î¤Ï +.IR off64_t ¡¢ +.BR lseek () +¤ËÂбþ¤¹¤ë¤Î¤Ï +.BR lseek64 () +¤Ç¤¢¤ë)¡£ +¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÍøÍѤ·¤Ê¤¤¤³¤È¡£ +Âå¤ï¤ê¤Ë +.I _FILE_OFFSET_BITS=64 +¤òÍøÍѤ¹¤ë¤³¤È¡£ +.TP +.B _FILE_OFFSET_BITS +¤³¤Î¥Þ¥¯¥í¤òÃÍ 64 ¤ÇÄêµÁ¤¹¤ë¤È¡¢¥Õ¥¡¥¤¥ë I/O ¤È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÁàºî¤Ë +´ØÏ¢¤¹¤ë 32 ¥Ó¥Ã¥ÈÈǤδؿô¤È¥Ç¡¼¥¿¥¿¥¤¥×¤Ï¼«Æ°Åª¤Ë 64 ¥Ó¥Ã¥ÈÈÇ¤Ë +ÊÑ´¹¤µ¤ì¤ë¡£ +¤³¤ì¤Ï¡¢32 ¥Ó¥Ã¥È¥·¥¹¥Æ¥à¤ÇÂ礭¤Ê¥Õ¥¡¥¤¥ë (> 2 ¥®¥¬¥Ð¥¤¥È) ¤Î I/O +¤ò¼Â¹Ô¤¹¤ëºÝ¤ËÌòΩ¤Ä +(¤³¤Î¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë¤È¡¢¥³¥ó¥Ñ¥¤¥ë¤·Ä¾¤¹¤À¤±¤ÇÂ礭¤Ê¥Õ¥¡¥¤¥ë¤ò +°·¤¨¤ë¥×¥í¥°¥é¥à¤ò½ñ¤¯¤³¤È¤¬¤Ç¤­¤ë)¡£ +64 ¥Ó¥Ã¥È¥·¥¹¥Æ¥à¤Ï¡¢¤â¤È¤â¤È 2 ¥®¥¬¥Ð¥¤¥È¤è¤êÂ礭¤Ê¥Õ¥¡¥¤¥ë¤ò +°·¤¨¤ë¤Î¤Ç¡¢64 ¥Ó¥Ã¥È¥·¥¹¥Æ¥à¤Ç¤Ï¤³¤Î¥Þ¥¯¥í¤Ï¸ú²Ì¤ò»ý¤¿¤Ê¤¤¡£ +.TP +.B _BSD_SOURCE +¤³¤Î¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë¤È (Ãͤ˴ؤï¤é¤º) ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ç +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 +¤³¤Î¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë¤È (Ãͤ˴ؤï¤é¤º) ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ç +System V ͳÍè¤ÎÄêµÁ¤¬¸ø³«¤µ¤ì¤ë +(SVID == System V Interface Definition; +.BR standards (7) +»²¾È)¡£ +.TP +.BR _ATFILE_SOURCE " (glibc 2.4 °Ê¹ß)" +¤³¤Î¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë¤È (Ãͤ˴ؤï¤é¤º) ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ç +̾Á°¤ÎËöÈø¤¬ "at" ¤Î³Æ¼ï¤Î´Ø¿ô¤ÎÄêµÁ¤¬¸ø³«¤µ¤ì¤ë¡£ +.BR openat (2) +»²¾È¡£ +glibc 2.10 °Ê¹ß¤Ç¤Ï¡¢ +.B _POSIX_C_SOURCE +¤¬ 200809L °Ê¾å¤ÎÃͤÇÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ +¤³¤Î¥Þ¥¯¥í¤â°ÅÌۤΤ¦¤Á¤ËÄêµÁ¤µ¤ì¤ë¡£ +.TP +.B _GNU_SOURCE +¤³¤Î¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë¤È (Ãͤ˴ؤï¤é¤º) °Ê²¼¤Î¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë¤Î¤È +Åù²Á¤Ë¤Ê¤ë: +.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 +¤³¤Î¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë¤È¡¢¤¤¤¯¤Ä¤«¤Î¥ê¥¨¥ó¥È¥é¥ó¥È (ºÆÆþ²Äǽ) ¤Ê´Ø¿ô +ÄêµÁ¤¬¸ø³«¤µ¤ì¤ë¡£¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¡¦¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¤³¤ÎÂå¤ï¤ê¤Ë +.I "cc\ \-pthread" +¤ò»ÈÍѤ¹¤ë¤³¤È¡£ +.TP +.B _THREAD_SAFE +.B _REENTRANT +¤ÎƱµÁ¸ì¡£ +¾¤Î¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤È¤Î¸ß´¹À­¤òÄ󶡤¹¤ë¤¿¤á¤Î¤â¤Î¡£ +.TP +.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 +¤³¤Î¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë¤È¡¢Ê¸»úÎó¤ä¥á¥â¥ê¤ÎÁàºî¤ò¹Ô¤¦ÍÍ¡¹¤Ê´Ø¿ô¤ò +»ÈÍѤ¹¤ëºÝ¤Ë¥Ð¥Ã¥Õ¥¡¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ò¸¡½Ð¤¹¤ë¤¿¤á¤Î·Ú¤á¤Î¥Á¥§¥Ã¥¯¤¬ +¼Â¹Ô¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£¤¹¤Ù¤Æ¤Î¥Ð¥Ã¥Õ¥¡¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬¸¡½Ð¤µ¤ì¤ë +¤ï¤±¤Ç¤Ï¤Ê¤¯¡¢¤¢¤¯¤Þ¤Ç¤è¤¯¤¢¤ëÎã¤Ë¤Ä¤¤¤Æ¤À¤±¤Ç¤¢¤ë¡£ +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢°Ê²¼¤Î´Ø¿ô¤Ë¥Á¥§¥Ã¥¯¤¬Äɲ䵤ì¤Æ¤¤¤ë: +.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), +.BR gets (3). +.B _FORTIFY_SOURCE +¤¬ 1 ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¥³¥ó¥Ñ¥¤¥é¤ÎºÇŬ²½¥ì¥Ù¥ë¤¬ 1 +.RI ( "gcc\ \-O1" ) +¤«¤½¤ì°Ê¾å¤Ç¤¢¤ì¤Ð¡¢µ¬³Ê¤Ë½àµò¤¹¤ë¥×¥í¥°¥é¥à¤Î¿¶¤ëÉñ¤¤¤ò +ÊѲ½¤µ¤»¤Ê¤¤¤è¤¦¤Ê¥Á¥§¥Ã¥¯¤¬¼Â¹Ô¤µ¤ì¤ë¡£ +.B _FORTIFY_SOURCE +¤¬ 2 ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¤µ¤é¤Ê¤ë¥Á¥§¥Ã¥¯¤¬Äɲ䵤ì¤ë¤¬¡¢ +µ¬³Ê¤Ë½àµò¤¹¤ë¥×¥í¥°¥é¥à¤Î¤¤¤¯¤Ä¤«¤¬¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤¤¤¯¤Ä¤«¤Î¥Á¥§¥Ã¥¯¤Ï¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¼Â¹Ô¤Ç¤­¡¢¥³¥ó¥Ñ¥¤¥é¤Î·Ù¹ð¤È¤·¤Æ +ɽ¼¨¤µ¤ì¤ë¡£Â¾¤Î¥Á¥§¥Ã¥¯¤Ï¼Â¹Ô»þ¤Ë¹Ô¤ï¤ì¡¢¥Á¥§¥Ã¥¯¤Ë¼ºÇÔ¤·¤¿¾ì¹ç +¤Ë¤Ï¼Â¹Ô»þ¥¨¥é¡¼¤È¤Ê¤ë¡£ +¤³¤Î¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¥³¥ó¥Ñ¥¤¥é¤ÎÂбþ¤¬É¬ÍפǤ¢¤ê¡¢ +¥Ð¡¼¥¸¥ç¥ó 4.0 °Ê¹ß¤Î +.BR gcc (1) +¤ÇÍøÍѤǤ­¤ë¡£ +.SS ¥Ç¥Õ¥©¥ë¥È¤ÎÄêµÁ¡¢°ÅÌÛ¤ÎÄêµÁ¡¢ÁȤ߹ç¤ï¤»ÄêµÁ +.PP +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬°ì¤Ä¤âÌÀ¼¨Åª¤ËÄêµÁ¤µ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤Çµ¡Ç½¸¡ºº¥Þ¥¯¥í +.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 +.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 +¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÄêµÁ¤µ¤ì¤Ê¤¤¡£ + +.B _POSIX_SOURCE +¤È +.B _POSIX_C_SOURCE +¤¬ÌÀ¼¨Åª¤ËÄêµÁ¤µ¤ì¤Ê¤¤¾ì¹ç¤Ç¡¢ +.B __STRICT_ANSI__ +¤¬ÄêµÁ¤µ¤ì¤Ê¤¤¡¢¤â¤·¤¯¤Ï +.B _XOPEN_SOURCE +¤¬ 500 °Ê¾å¤ÎÃͤÇÄêµÁ¤µ¤ì¤¿¤È¤­¤Ë¤Ï¡¢ +.RS 3 +.IP * 3 +.B _POSIX_SOURCE +¤¬ÃÍ 1 ¤ÇÄêµÁ¤µ¤ì¡¢¤«¤Ä +.IP * +.B _POSIX_C_SOURCE +¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤ÇÄêµÁ¤µ¤ì¤ë¡£ +.RS 6 +.IP \(bu 3 +2 +.RB ( _XOPEN_SOURCE +¤¬ 500 ̤Ëþ¤ÎÃͤÇÄêµÁ¤µ¤ì¤¿¾ì¹ç) +.IP \(bu +199506L +.RB ( _XOPEN_SOURCE +¤¬ 500 °Ê¾å 600 ̤Ëþ¤ÎÃͤÇÄêµÁ¤µ¤ì¤¿¾ì¹ç) +.IP \(bu +(glibc 2.4 °Ê¹ß) +200112L +.RB ( XOPEN_SOURCE +¤¬ 600 °Ê¾å 700 ̤Ëþ¤ÎÃͤÇÄêµÁ¤µ¤ì¤¿¾ì¹ç) +.IP \(bu +(glibc 2.10 °Ê¹ß) +200809L +.RB ( XOPEN_SOURCE +¤¬ 700 °Ê¾å¤ÎÃͤÇÄêµÁ¤µ¤ì¤¿¾ì¹ç) +.IP \(bu +¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï +.B _POSIX_C_SOURCE +¤ÎÃͤȤ·¤Æ 200112L ¤ä 200809L ¤Ï¸ºß¤»¤º¡¢ +.B _POSIX_C_SOURCE +¤ÎÃͤ¬¤É¤¦¤Ê¤ë¤«¤Ï glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê°Û¤Ê¤ë¡£ +.IP \(bu +.B _XOPEN_SOURCE +¤¬Ì¤ÄêµÁ¤Î¾ì¹ç¡¢ +.B _POSIX_C_SOURCE +¤ÎÃÍ¤Ï glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê°Û¤Ê¤ë¡£ +¥Ð¡¼¥¸¥ç¥ó 2.4 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï 199506L¡¢ +¥Ð¡¼¥¸¥ç¥ó 2.4 °Ê¹ß 2.9 ̤Ëþ¤Ç¤Ï 200112L¡¢ +glibc 2.10 °Ê¹ß¤Ç¤Ï 200809L ¤È¤Ê¤ë¡£ +.RE +.RE +.PP +¤Þ¤¿¡¢Ê£¿ô¤Î¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤Î¾ì¹ç¡¢ÄêµÁ¤·¤¿¥Þ¥¯¥í¤Ï¤¹¤Ù¤ÆÍ­¸ú¤Ë¤Ê¤ë¡£ +.SH ½àµò +POSIX.1 ¤Ç¤Ï +.BR _POSIX_C_SOURCE , +.BR _POSIX_SOURCE , +.B _XOPEN_SOURCE +¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.B _XOPEN_SOURCE_EXTENDED +¤Ï XPG4v2 (ÊÌ̾ SUSv1) ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤¿¡£ + +.B _FILE_OFFSET_BITS +¤Ï¤É¤Îɸ½à¤Ç¤âµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +¾¤Î¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤ÇºÎÍѤµ¤ì¤Æ¤¤¤ë¡£ + +.BR _BSD_SOURCE , +.BR _SVID_SOURCE , +.BR _ATFILE_SOURCE , +.BR _GNU_SOURCE , +.BR _FORTIFY_SOURCE , +.BR _REENTRANT , +.B _THREAD_SAFE +¤Ï Linux (glibc) ¸ÇÍ­¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.I +¤Ï Linux/glibc ¸ÇÍ­¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£ +¾¤Î¥·¥¹¥Æ¥à¤Ë¤âƱÍͤÎÌÜŪ¤Î¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¤¬¡¢ÉáÄ̤ϰ㤦̾Á°¤Ç¤¢¤ë¡£ +¤³¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ï¡¢Â¾¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ë¤è¤êɬÍפ˱þ¤¸¤Æ +¼«Æ°Åª¤Ë¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤ë¡£µ¡Ç½¸¡ºº¥Þ¥¯¥í¤òÍøÍѤ¹¤ë¤¿¤á¤Ë +ÌÀ¼¨Åª¤Ë¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëɬÍפϤʤ¤¡£ + +¾åµ­¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤Î¤¦¤Á¤É¤ì¤¬ÄêµÁ¤µ¤ì¤¿¤«¤Ë¤·¤¿¤¬¤Ã¤Æ¡¢ +.I +¤Ï¡¢Â¾¤Î glibc ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ç¥Á¥§¥Ã¥¯¤µ¤ì¤ë³Æ¼ï¤Î¾¤Î¥Þ¥¯¥í¤ò¡¢ +ÆâÉô¤ÇÄêµÁ¤¹¤ë¡£¤³¤ì¤é¤Î¥Þ¥¯¥í¤Î̾Á°¤Ï¥¢¥ó¥À¡¼¥¹¥³¥¢ 2¤Ä¤Ç»Ï¤Þ¤ë +(Î㤨¤Ð +.BR __USE_MISC )¡£ +¥æ¡¼¥¶¥×¥í¥°¥é¥à¤Ï¤³¤ì¤é¤Î¥Þ¥¯¥í¤ò \fI·è¤·¤Æ\fP ľÀÜÄêµÁ¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë¡¢¾åµ­¤Î¥ê¥¹¥È¤Ë¤¢¤ëŬÀڤʵ¡Ç½¸¡ºº¥Þ¥¯¥í¤òÍøÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH Îã +²¼µ­¤Î¥×¥í¥°¥é¥à¤ò»È¤¦¤È¡¢³Æ¼ï¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ 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 +.SH ´ØÏ¢¹àÌÜ +.BR libc (7), +.BR standards (7) +.sp +.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/release/man7/fifo.7 b/release/man7/fifo.7 new file mode 100644 index 00000000..d8875f96 --- /dev/null +++ b/release/man7/fifo.7 @@ -0,0 +1,69 @@ +.\" This man page is Copyright (C) 1999 Claus Fischer. +.\" 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. +.\" +.\" 990620 - page created - aeb@cwi.nl +.\" +.\" FIXME . Add example programs to this page? +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Wed Jan 5 23:35:27 JST 2000 +.\" by HANATAKA Shinya +.\" +.TH FIFO 7 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +fifo \- ÀèÆþÀè½ÐÆüì¥Õ¥¡¥¤¥ë¡¢Ì¾Á°ÉÕ¤­¥Ñ¥¤¥× +.SH ½ñ¼° +FIFO Æüì¥Õ¥¡¥¤¥ë(̾Á°ÉÕ¤­¥Ñ¥¤¥×)¤Ï¥Ñ¥¤¥×¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î°ìÉô¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ëÅÀ¤¬°Û¤Ã¤Æ¤¤¤ë¡£ +Ê£¿ô¤Î¥×¥í¥»¥¹¤¬Æɤ߹þ¤ß¤ä½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤¹¤ë¤³¤È +¤¬¤Ç¤­¤ë¡£¥×¥í¥»¥¹¤¬ FIFO ¤òÄ̤·¥Ç¡¼¥¿¤ò¸ò´¹¤¹¤ë¾ì¹ç¡¢ +¼ÂºÝ¤Ë¤½¤ì¤ò¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤Ï½ñ¤­¹þ¤Þ¤º¡¢¥«¡¼¥Í¥ë¤ÏÁ´¤Æ¤Î +¥Ç¡¼¥¿¤òÆâÉôŪ¤ËÅϤ¹¡£¤³¤Î¤è¤¦¤Ë¡¢FIFO Æüì¥Õ¥¡¥¤¥ë¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +¾å¤Ë¤ÏÆâÍƤò»ý¤¿¤Ê¤¤¤Î¤Ç¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¨¥ó¥È¥ê¤Ï +¥×¥í¥»¥¹¤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î̾Á°¤ò»ÈÍѤ·¤Æ¤½¤Î¥Ñ¥¤¥×¤Ë +¥¢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ë»²¾È¥Ý¥¤¥ó¥È¤òÄ󶡤·¤Æ¤¤¤ë¤Ë²á¤®¤Ê¤¤¡£ +.PP +¥«¡¼¥Í¥ë¤Ï¡¢¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë +FIFO Æüì¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡¢¤½¤ì¤¾¤ì°ì¤Ä¤Î¥Ñ¥¤¥×¤Î¤ß¤ò´ÉÍý¤·¤Æ¤¤¤ë¡£ +¥Ç¡¼¥¿¤¬ÅϤµ¤ì¤ëÁ°¤Ë¤½¤Î FIFO ¤Îξü(½ñ¤­¹þ¤ß¤ÈÆɤ߽Ф·)¤¬¥ª¡¼¥×¥ó +¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£Ä̾FIFO ¤ò¥ª¡¼¥×¥ó¤¹¤ë¤È¡¢ +¤½¤ÎÈ¿ÂЦ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¤Þ¤ÇÄä»ß(block)¤µ¤»¤é¤ì¤ë¡£ +.PP +¥×¥í¥»¥¹¤Ï FIFO ¤òÈóÄä»ß(nonblocking)¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤Î¾ì¹ç¡¢Æɤ߹þ¤ßÀìÍѤǥª¡¼¥×¥ó¤·¤¿¾ì¹ç¤Ë¤Ï½ñ¤­¹þ¤ß¦¤òï¤â¥ª¡¼¥×¥ó +¤·¤Æ¤¤¤Ê¤¯¤Æ¤âÀ®¸ù¤¹¤ë¡£½ñ¤­¹þ¤ßÀìÍѤǥª¡¼¥×¥ó¤·¤¿¾ì¹ç¤ÏÈ¿ÂЦ¤¬´û¤Ë +¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð +.B ENXIO +(¤½¤Î¤è¤¦¤Ê¥Ç¥Ð¥¤¥¹¤Þ¤¿¤Ï¥¢¥É¥ì¥¹¤Ï¸ºß¤·¤Ê¤¤) +¤È¤¤¤¦¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¡£ +.PP +Linux ¤Ç¤Ï¡¢FIFO ¤òÆɤ߹þ¤ß¤È½ñ¤­¹þ¤ßξÍѤ˥ª¡¼¥×¥ó¤·¤¿¾ì¹ç¡¢ +Ää»ß¡¢ÈóÄä»ß¤Î¤É¤Á¤é¤Î¥â¡¼¥É¤Ç¤âÀ®¸ù¤¹¤ë¡£POSIX ¤Ç¤Ï¤³¤Î¾ì¹ç¤Î +Æ°ºî¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£¤³¤ì¤ÏÆɤ߹þ¤ß¦¤¬¤¤¤Ê¤¤»þ¤Ë½ñ¤­¹þ¤ßÍÑ¤Ë +¥ª¡¼¥×¥ó¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¼«Ê¬¼«¿È¤ÈÄÌ¿®¤¹¤ë¤¿¤á¤Ë +ξü¤ò»ÈÍѤ¹¤ë¥×¥í¥»¥¹¤Ï¥Ç¥Ã¥É¥í¥Ã¥¯¤òÈò¤±¤ë¤¿¤á¤ËÈó¾ï¤ËÃí°Õ¿¼¤¯ +¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH Ãí°Õ +¥×¥í¥»¥¹¤¬¡¢È¿ÂФÎÆɤ߹þ¤ß¦¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤ FIFO ¤ò +½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤·¤è¤¦¤È¤·¤¿¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¤Ë +.B SIGPIPE +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ + +FIFO Æüì¥Õ¥¡¥¤¥ë¤Ï +.BR mkfifo (3) +¤ÇºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢ +.IR "ls \-l" +¤Ç¤Ï¥Õ¥¡¥¤¥ë¼ïÊÌ \(aqp\(aq ¤Çɽ¼¨¤µ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR mkfifo (1), +.BR open (2), +.BR pipe (2), +.BR sigaction (2), +.BR signal (2), +.BR socketpair (2), +.BR mkfifo (3), +.BR pipe (7) diff --git a/release/man7/futex.7 b/release/man7/futex.7 new file mode 100644 index 00000000..14236d48 --- /dev/null +++ b/release/man7/futex.7 @@ -0,0 +1,123 @@ +.\" This page is made available under the MIT license. +.\" +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.\" +.\" Japanese Version Copyright(C) 2003 Suzuki Takashi +.\" all rights reserved. +.\" Translated Fri Oct 24 10:37:10 JST 2003 +.\" by Suzuki Takashi. +.\" +.\"WORD: contend ¶¥¹ç¤¹¤ë +.\"WORD: sleep µ¯¾²ÂÔ¤Á¤¹¤ë +.\"WORD: wake µ¯¾²¤¹¤ë +.\"WORD: wake up µ¯¾²¤¹¤ë +.\" +.TH FUTEX 7 2002-12-31 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +futex - ¹â®¥æ¡¼¥¶¶õ´Ö¥í¥Ã¥¯µ¡¹½ +.SH ½ñ¼° +.nf +.B #include +.fi +.SH ÀâÌÀ +.PP +Linux ¥«¡¼¥Í¥ë¤Ï¡¢¥æ¡¼¥¶¶õ´Ö¤Ç¹â®¤Ê¥í¥Ã¥¯µ¡¹½¤ä¥»¥Þ¥Õ¥©¤ò»ÈÍѤ¹¤ë¤¿¤á¤Î +´ðÁÃŪÍ×ÁǤȤ·¤Æ futex ("Fast Userspace muTexes"; ¹â®¥æ¡¼¥¶¶õ´Ö mutex) ¤ò +Ä󶡤·¤Æ¤¤¤ë¡£ +futex ¤ÏÈó¾ï¤Ë´ðËÜŪ¤Ê¤â¤Î¤Ç¡¢ POSIX mutex ¤Î¤è¤¦¤Ê¹âÅ٤ʥí¥Ã¥¯µ¡¹½¤Î³µÇ°¤ò +¹½ÃÛ¤¹¤ë¤Î¤ËÌòΩ¤Ã¤Æ¤¤¤ë¡£ +.PP +¤³¤Î¥Ú¡¼¥¸¤Ï¤¹¤Ù¤Æ¤ÎÀß·×·èÄê¤òµ­½Ò¤¹¤ë¤è¤¦¤Ë¤Ï¤Ê¤Ã¤Æ¤ª¤é¤º¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ä¥é¥¤¥Ö¥é¥ê¤Î³«È¯¤Ë´Ø·¸¤¹¤ë¤³¤È¤¬¤é¤Ë¸Â¤Ã¤Æ¤¤¤ë¡£ +¼ÂºÝ¤Ë¤Ï¥×¥í¥°¥é¥Þ¤Î¿¤¯¤ÏľÀÜ¤Ï futex ¤ò°·¤ï¤Ê¤¤¤¬¡¢¤½¤ÎÂå¤ï¤ê +futex ¤Ë´ð¤Å¤¤¤Æ¹½ÃÛ¤µ¤ì¤¿¥·¥¹¥Æ¥à¥é¥¤¥Ö¥é¥ê (Î㤨¤Ð NPTL ¥¹¥ì¥Ã¥É) ¤Ë +°Í¸¤¹¤ë¤³¤È¤Ë¤Ê¤ë¤À¤í¤¦¡£ +.PP +futex ¤Ï°Û¤Ê¤ë¥×¥í¥»¥¹´Ö¤Ç¶¦Í­¤¹¤ë¤³¤È¤Î¤Ç¤­¤ë¥á¥â¥êÊҤǼ±Ê̤µ¤ì¤ë¡£ +¤³¤ì¤é¤Î°Û¤Ê¤ë¥×¥í¥»¥¹¤Ç¤Ï¡¢Æ±¤¸¥¢¥É¥ì¥¹¤¬ÉÕÍ¿¤µ¤ì¤Æ¤¤¤ëɬÍפϤʤ¤¡£ +Íç¤Î»Ñ¤Ç¤Ï futex ¤Î¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤Ï¥»¥Þ¥Õ¥©¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +futex ¤ÏÉÔ²ÄʬÁàºî¤Ç (atomically) ¥¤¥ó¥¯¥ê¥á¥ó¥È¤·¤¿¤ê¥Ç¥¯¥ê¥á¥ó¥È¤·¤¿¤ê¤Ç¤­¤ë +¥«¥¦¥ó¥¿¤Ç¡¢¥×¥í¥»¥¹¤ÏÃͤ¬Àµ¤Ë¤Ê¤ë¤Î¤òÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£ +.PP +futex ¤ÎÁàºî¤Ï¡¢¶¥¹ç¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï´°Á´¤Ë¥æ¡¼¥¶¶õ´Ö¤Ç¹Ô¤Ê¤ï¤ì¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¶¥¹ç¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤ÎÃçºÛ¤Ë´ØÍ¿¤¹¤ë¤À¤±¤Ç¤¢¤ë¡£ +Îɼ±¤¢¤ëÀ߷פǤ϶¥¹ç¤¬µ¯¤³¤é¤Ê¤¤¤è¤¦ÅØÎϤ¹¤ë¤¬¡¢ +futex ¤â¶¥¹ç¾õÂ֤˴ؤ·¤ÆºÇŬ²½¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +Íç¤Î»Ñ¤Ç¤Ï¡¢ futex ¤ÏÉÔ²Äʬ¤Ê¥¢¥»¥ó¥Ö¥êÌ¿Îá¤Ç¤Î¤ßÁàºî¤µ¤ì¤ë +¥¢¥é¥¤¥ó¥á¥ó¥È¤Î·¤Ã¤¿ int ·¿¤ÎÊÑ¿ô¤Ç¤¢¤ë¡£ +Ê£¿ô¤Î¥×¥í¥»¥¹¤Ï¤³¤Î int ·¿ÊÑ¿ô¤ò¡¢ +.BR mmap (2) +¤òÍѤ¤¤ë¤«¡¢ +¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È¤ò²ð¤¹¤ë¤«¡¢ +¥á¥â¥ê¶õ´Ö¤ò¶¦Í­¤¹¤ë (¤³¤Î¾ì¹ç¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï°ìÈÌŪ¤Ë¥Þ¥ë¥Á¡¦¥¹¥ì¥Ã¥É¤Ç¤¢¤ë¤È¸Æ¤Ð¤ì¤ë) ¤«ÊýË¡¤Ç¶¦Í­¤¹¤ë¡£ +.SS "¥»¥Þ¥ó¥Æ¥£¥¯¥¹" +.PP +futex ¤ÎÁàºî¤Ï¤¹¤Ù¤Æ¥æ¡¼¥¶¶õ´Ö¤«¤é»Ï¤Þ¤ë¤¬¡¢É¬Íפ˱þ¤¸¤Æ +.BR futex (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍѤ¤¤Æ¥«¡¼¥Í¥ë¤ÈÄÌ¿®¤¹¤ë¡£ +.PP +futex ¤ò "up" ¤¹¤ë¤Ë¤Ï¡¢ +¥Û¥¹¥È CPU ¤ËÂФ· int ·¿ÊÑ¿ô¤òÉÔ²ÄʬÁàºî¤Ç¥¤¥ó¥¯¥ê¥á¥ó¥È¤¹¤ë¤è¤¦¤Ê¡¢ +ŬÀڤʥ¢¥»¥ó¥Ö¥êÌ¿Îá¤ò¼Â¹Ô¤¹¤ë¡£ +¤½¤Î¤¢¤È¡¢¼ÂºÝ¤Ë 0 ¤«¤é 1 ¤ËÊѲ½¤·¤¿¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¡¢ +ÊѲ½¤·¤Æ¤¤¤ì¤ÐÂÔ¤Á¥×¥í¥»¥¹ (waiter) ¤Ï¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤ê¡¢Áàºî¤Ï´°Î»¤¹¤ë¡£ +¤³¤ì¤Ï¶¥¹ç¤Î¤Ê¤¤¾ì¹ç¤Ç¤¢¤ê¡¢¹â®¤Ç¤è¤¯µ¯¤³¤ë¤Ï¤º¤Ç¤¢¤ë¡£ +.PP +¶¥¹ç¤¬¤¢¤ë¾ì¹ç¡¢ÉÔ²ÄʬÁàºî¤Î¥¤¥ó¥¯¥ê¥á¥ó¥È¤Ç¥«¥¦¥ó¥¿¤Ï \-1 (¤Þ¤¿¤Ï¾¤ÎÉé¤Î¿ô) +¤«¤éÊѲ½¤¹¤ë¡£¤³¤ì¤¬¸¡½Ð¤µ¤ì¤ë¤È¡¢ÂÔ¤Á¥×¥í¥»¥¹¤¬¤¢¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +¥æ¡¼¥¶¶õ´Ö¤Ç¤Ï¥«¥¦¥ó¥¿¤ò 1 ¤ËÀßÄꤷ¡¢ +.B FUTEX_WAKE +¤òÍѤ¤¤Æ¥«¡¼¥Í¥ë¤ËÂÔ¤Á¥×¥í¥»¥¹¤ò wake (µ¯¾²) ¤µ¤»¤ë¤è¤¦»Ø¼¨¤¹¤ë¡£ +.PP +futex ¤Î³ÍÆÀ¤òÂԤġ¢¤¹¤Ê¤ï¤Á futex ¤ò "down" ¤¹¤ë¤Ë¤ÏÈ¿ÂФÎÁàºî¤ò¹Ô¤Ê¤¦¡£ +ÉÔ²ÄʬÁàºî¤Ç¥«¥¦¥ó¥¿¤ò¥Ç¥¯¥ê¥á¥ó¥È¤·¡¢¥«¥¦¥ó¥¿¤¬ 0 ¤ËÊѲ½¤·¤¿¤«¤É¤¦¤«¤ò +¥Á¥§¥Ã¥¯¤¹¤ë¡£ÊѲ½¤·¤Æ¤¤¤ì¤ÐÁàºî¤Ï´°Î»¤· futex ¤Ï¶¥¹ç¤·¤Æ¤¤¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +0 ¤Ë¤Ê¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥×¥í¥»¥¹¤Ï¥«¥¦¥ó¥¿¤ò \-1 ¤ËÀßÄꤷ¡¢ +¾¤Î¥×¥í¥»¥¹¤¬¤½¤Î futex ¤ò up ¤¹¤ë¤Î¤òÂԤĤ褦¥«¡¼¥Í¥ë¤ËÍ׵ᤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤ì¤Ï +.B FUTEX_WAIT +¤ò¹Ô¤Ê¤¦¤³¤È¤Ç¼Â¸½¤µ¤ì¤ë¡£ +.PP +.BR futex (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤Ï¡¢¾Êά²Äǽ¤Ê°ú¿ô¤È¤·¤Æ¥¿¥¤¥à¥¢¥¦¥È¤òÅϤ¹¤³¤È¤¬¤Ç¤­¡¢ +¥«¡¼¥Í¥ë¤Ï¤½¤Î futex ¤¬ up ¤µ¤ì¤ë¤Î¤ò¤É¤ì¤¯¤é¤¤¤Î´ü´ÖÂԤĤ٤­¤«¤ò +»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤³¤Î¾ì¹ç¡¢¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤Ï¤â¤Ã¤ÈÊ£»¨¤Ë¤Ê¤ë¤¿¤á¡¢ +¤è¤ê¾ÜºÙ¤Ê¾ðÊó¤òÆÀ¤ë¤Ë¤Ï¥×¥í¥°¥é¥Þ¤Ï +.BR futex (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +Ʊ¤¸¥Ú¡¼¥¸¤ËÈóƱ´ü¤Î futex ÂÔ¤Á¤Ë¤Ä¤¤¤Æ¤âµ­¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.PP +ºÇ½é¤Î futex Âбþ¤Ï Linux 2.5.7 ¤ÇÁȤ߹þ¤Þ¤ì¤¿¤¬¡¢ +¾åµ­¤Î¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤È¤Ï°Û¤Ê¤ë¡£ +¸½ºß¤Î¥»¥Þ¥ó¥Æ¥£¥¯¥¹¤Ï Linux 2.5.40 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +.PP +ºÆ¤Ó·«¤êÊÖ¤·¤Æ¤ª¤¯¤¬¡¢Íç¤Î futex ¤Ï¥¨¥ó¥É¥æ¡¼¥¶¤¬Íưפ˻Ȥ¨¤ë³µÇ°¤È¤·¤Æ +°Õ¿Þ¤µ¤ì¤¿¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +¼ÂÁõ¼Ô¤Ï¡¢¥¢¥»¥ó¥Ö¥ê¸À¸ì¤Ë´·¤ì¤Æ¤ª¤ê¡¢°Ê²¼¤Ëµó¤²¤ë futex ¥æ¡¼¥¶¶õ´Ö¥é¥¤¥Ö¥é¥ê¤Î +¥½¡¼¥¹¤òÆɤ߽ª¤¨¤Æ¤¤¤ë¤³¤È¤¬Í׵ᤵ¤ì¤ë¡£ +.PP +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¤Ï +.BR futex (2) +¥×¥ê¥ß¥Æ¥£¥Ö¤ÎºÇ¤â°ìÈÌŪ¤Ê»ÈÍÑË¡¤¬ +µ­¤µ¤ì¤Æ¤¤¤ë¡£¤³¤ì¤Ï·è¤·¤ÆÍ£°ì¤Î»ÈÍÑË¡¤Ç¤Ï¤Ê¤¤¡£ +.\" .SH Ãø¼Ô +.\" .PP +.\" futex ¤Ï Hubertus Franke (IBM Thomas J. Watson Research Center) ¤È +.\" Matthew Kirkwood ¡¢ Ingo Molnar (Red Hat) ¡¢ +.\" Rusty Russell (IBM Linux Technology Center) ¤¬À߷פ·¡¢¸¡Æ¤¤·¤¿¡£ +.\" ¤³¤Î¥Ú¡¼¥¸¤Ï bert hubert ¤¬µ­¤·¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR futex (2) +.PP +.IR "Fuss, Futexes and Furwocks: Fast Userlevel Locking in Linux" +(proceedings of the Ottawa Linux Symposium 2002), +futex ¤Î»ÈÍÑÎã¥é¥¤¥Ö¥é¥ê, futex-*.tar.bz2 +. diff --git a/release/man7/glob.7 b/release/man7/glob.7 new file mode 100644 index 00000000..b0c351c1 --- /dev/null +++ b/release/man7/glob.7 @@ -0,0 +1,211 @@ +.\" Copyright (c) 1998 Andries Brouwer +.\" +.\" 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. +.\" +.\" 2003-08-24 fix for / by John Kristoff + joey +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Wed 12 Aug 1998 by NAKANO Takeo +.\" Updated 2003-09-28 by NAKANO Takeo +.\" +.\"WORD: wild card pattern ¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó +.\"WORD: character class ʸ»ú¥¯¥é¥¹ +.\"WORD: range Îΰè»ØÄê +.\"WORD: complementation Ê佸¹ç +.\"WORD: regular expression Àµµ¬É½¸½ +.\"WORD: bracket expression ¥Ö¥é¥±¥Ã¥Èɽ¸½ +.\"WORD: collating sequence ¾È¹ç½ç½ø +.\"WORD: collating element ¾È¹ç½ç½ø¤ÎÍ×ÁÇ +.\"WORD: current locale ¥«¥ì¥ó¥È¥í¥±¡¼¥ë +.\"WORD: equivalence class Åù²Á¥¯¥é¥¹ +.\" +.TH GLOB 7 2003-08-24 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +glob \- ¥Ñ¥¹Ì¾¤ò glob ¤¹¤ë +.SH ÀâÌÀ +ÀΡ¹ Unix V6 ¤Ç¤Ï¡¢¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤òŸ³«¤¹¤ë +.I /etc/glob +¤È¸À¤¦¥×¥í¥°¥é¥à¤¬¤¢¤Ã¤¿¡£¤½¤Î¸å¤¹¤°¤Ë¡¢ +¤³¤Îµ¡Ç½¤Ï¥·¥§¥ë¤ËÁȤ߹þ¤Þ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ + +º£Æü¤Ç¤Ï¡¢¤³¤Îµ¡Ç½¤ò¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤«¤é¤â¼Â¹Ô¤Ç¤­¤ë¤è¤¦¡¢ +.BR glob (3) +¤È¤¤¤¦¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó¤â¸ºß¤·¤Æ¤¤¤ë¡£ + +glob ¤Îµ¬Â§¤ò°Ê²¼¤Ë½Ò¤Ù¤ë (POSIX.2 3.13)¡£ +.SS ¥ï¥¤¥ë¥É¥«¡¼¥É¥Þ¥Ã¥Á +ʸ»úÎó¤Ë \(aq?\(aq, \(aq*\(aq, \(aq[\(aq ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤È¡¢ +¤½¤ì¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤È¤ß¤Ê¤µ¤ì¤ë¡£ +¡Öglob ¤¹¤ë¡×¤È¤¤¤¦¤Î¤Ï¡¢¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤òŸ³«¤·¤Æ¡¢ +¤½¤Î¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹Ì¾¤Î¥ê¥¹¥È¤òÆÀ¤ë¤³¤È¤Ç¤¢¤ë¡£ +¥Þ¥Ã¥Á¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¡£ + +(¥Ö¥é¥±¥Ã¥È³°Éô¤Î) \(aq?\(aq ¤Ï¤¢¤é¤æ¤ëñ°ì¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ + +(¥Ö¥é¥±¥Ã¥È³°Éô¤Î) \(aq*\(aq ¤Ï¤¢¤é¤æ¤ëʸ»úÎó¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +¶õʸ»úÎó (empty string) ¤Ë¤â¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +.B "ʸ»ú¥¯¥é¥¹ (character class)" +.sp +"\fI[...]\fP" ¤È¸À¤¦É½µ­¤Ï¡¢ÀèƬ¤Î \(aq[\(aq ¤Ë³¤¯ºÇ½é¤Îʸ»ú¤¬ \(aq!\(aq ¤Ç +¤Ê¤±¤ì¤Ð¡¢¥Ö¥é¥±¥Ã¥È¤ÎÃæ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ëʸ»ú¤Î¤É¤ì¤«°ì¤Ä¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +¥Ö¥é¥±¥Ã¥È¤ÎÆâÉô¤Ë´Þ¤Þ¤ì¤ëʸ»úÎó¤Ï¶õ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ \(aq]\(aq ¤âºÇ½é¤Îʸ»ú¤Ë»ØÄꤹ¤ì¤Ð¥Ö¥é¥±¥Ã¥È¤ÎÆâÉô¤Ë´Þ¤á¤ë¤³¤È¤¬ +¤Ç¤­¤ë (¤Ä¤Þ¤ê "\fI[][!]\fP" ¤Ï \(aq[\(aq, \(aq]\(aq, \(aq!\(aq ¤Î +3 ʸ»ú¤Î¤É¤ì¤«¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡£ +.PP +.B "Îΰè»ØÄê (range)" +.sp +Æüì¤Êɽµ­Ë¡¤¬°ì¤Ä¸ºß¤¹¤ë¡£\(aq\-\(aq ¤ò¶´¤àÆó¤Ä¤Îʸ»ú¤ÏÎΰè»ØÄê¤È¤Ê¤ë¡£ +(¤Ä¤Þ¤ê "\fI[A\-Fa\-f0\-9]\fP" ¤Ï "\fI[ABCDEFabcdef0123456789]\fP" +¤ÈÅù²Á¤È¤Ê¤ë¡£) \(aq\-\(aq ʸ»ú¤½¤Î¤â¤Î¤òÆþ¤ì¤¿¤¤¾ì¹ç¤Ï¡¢ +¥Ö¥é¥±¥Ã¥È¤ÎÀèƬ¤Þ¤¿¤ÏºÇ¸å¤Îʸ»ú¤Ë»ØÄꤹ¤ì¤Ð¤è¤¤¡£ +(¤Ä¤Þ¤ê "\fI[]\-]\fP" ¤ÏÆó¤Ä¤Îʸ»ú \(aq]\(aq ¤È \(aq\-\(aq +¤Ë¥Þ¥Ã¥Á¤·¡¢"\fI[\-\-0]\fP" ¤Ï \(aq\-\(aq, \(aq.\(aq, \(aq0\(aq ¤Î +3 ʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£¤³¤Î´Ö¤Î \(aq/\(aq ¤Ë¤Ï¥Þ¥Ã¥Á¤·¤Ê¤¤¡£¸å½Ò¤ò»²¾È¡£) +.PP +.B Ê佸¹ç (complementation) +.sp +"\fI[!...]\fP" ¤È¸À¤¦É½µ­¤Ï¡¢¥Ö¥é¥±¥Ã¥È¤ÎÆâÉô¤Ë´Þ¤Þ¤ì¤Ê¤¤Ã±°ì¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë +(¤¿¤À¤·ÀèƬ¤Ë¤¢¤ë \(aq!\(aq ¤Ï½ü³°)¡£ (¤Ä¤Þ¤ê "\fI[!]a\-]\fP" ¤Ï +\(aq]\(aq, \(aqa\(aq, \(aq\-\(aq °Ê³°¤Î¤¹¤Ù¤Æ¤Îʸ»ú¤Î¡¢¤É¤ì¤«°ì¤Ä¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£) + +¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å \(aq\e\(aq ¤òÁ°ÃÖ¤¹¤ì¤Ð¡¢ \(aq?\(aq, \(aq*\(aq, \(aq[\(aq +¤ÏÄ̾ï¤Îʸ»ú¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +¤Þ¤¿¤Ï¥·¥§¥ë¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î°ìÉô¤Ë»ØÄꤹ¤ë¾ì¹ç¤Ï¡¢ +¥¯¥©¡¼¥È¤Ç°Ï¤Ã¤Æ¤âƱ¤¸¸ú²Ì¤¬ÆÀ¤é¤ì¤ë¡£¥Ö¥é¥±¥Ã¥È¤ÎÆâÉô¤Ç¤Ï¡¢ +¤³¤ì¤é¤Îʸ»ú¤Ï¤½¤Îʸ»ú¼«¿È¤À¤±¤ò°ÕÌ£¤¹¤ë¡£ +¤¹¤Ê¤ï¤Á "\fI[[?*\e]\fP" ¤Ï \(aq[\(aq, \(aq?\(aq, \(aq*\(aq, \(aq\e\(aq +¤Î¤É¤ì¤«°ìʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.SS "¥Ñ¥¹Ì¾ (pathname)" +glob Æ°ºî¤Ï¡¢¥Ñ¥¹Ì¾¤Î¤½¤ì¤¾¤ì¤ÎÉôʬ¤ËÆÈΩ¤ËŬÍѤµ¤ì¤ë¡£ +¥Ñ¥¹Ì¾¤Ë¸ºß¤¹¤ë \(aq/\(aq ¤Ï \(aq?\(aq ¤ä \(aq*\(aq ¥ï¥¤¥ë¥É¥«¡¼¥É¤Ë¤Ï¥Þ¥Ã¥Á¤·¤Ê¤¤¡£ +¤Þ¤¿ "\fI[.\-0]\fP" ¤Î¤è¤¦¤ÊÎΰè»ØÄê¤Ë¤â¥Þ¥Ã¥Á¤·¤Ê¤¤¡£ +Îΰè»ØÄê¤ÏÍÛ¤Ë \(aq/\(aq ʸ»ú¤ò´Þ¤à¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£¤³¤ì¤Ïʸˡ¥¨¥é¡¼¤È¤Ê¤ë¡£ + +\(aq.\(aq ¤Ç»Ï¤Þ¤ë¥Ñ¥¹Ì¾¤Ç¤Ï¡¢¤³¤Îʸ»ú¤ÏÍۤ˥ޥåÁ¤µ¤»¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +(¤Ä¤Þ¤ê \fIrm\ *\fP ¤Ï .profile ¤òºï½ü¤·¤Ê¤¤¡£¤Þ¤¿ \fItar\ c\ *\fP +¤Ç¤Ï¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤Ï¥¢¡¼¥«¥¤¥Ö¤µ¤ì¤Ê¤¤¡£ \fItar\ c\ .\fP ¤ÎÊý¤¬Îɤ¤¡£) +.SS ¶õ¤Î¥ê¥¹¥È +Àè¤ËÍ¿¤¨¤¿¡¢¤ï¤«¤ê¤ä¤¹¤¯´Êñ¤Ê¥ë¡¼¥ë¡¢ +¡Ö¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤ò¥Þ¥Ã¥Á¤·¤¿¥Ñ¥¹Ì¾¤Î¥ê¥¹¥È¤ËŸ³«¤¹¤ë¡×¤È¸À¤¦¤Î¤Ï¡¢ +¥ª¥ê¥¸¥Ê¥ë¤Î Unix ¤Ë¤ª¤±¤ëÄêµÁ¤Ç¤¢¤Ã¤¿¡£ +¤³¤ì¤Ï¥Ñ¥¿¡¼¥ó¤¬¶õ¤Î¥ê¥¹¥È¤ËŸ³«¤µ¤ì¤ë¤³¤È¤âµö²Ä¤µ¤ì¤Æ¤¤¤¿¡£ +Î㤨¤Ð +.br +.nf + xv \-wait 0 *.gif *.jpg +.fi +¤Ë¤ª¤¤¤Æ¡¢*.gif ¥Õ¥¡¥¤¥ë¤¬Á´¤¯¤Ê¤¤¾ì¹ç¤Ç¤â¡¢ +¤³¤ì¤Ï¶õ¤Î¥ê¥¹¥È¤ËŸ³«¤µ¤ì¤ë¤¿¤á¡¢¥¨¥é¡¼¤Ë¤Ê¤é¤Ê¤¤¡£ +¤·¤«¤· POSIX ¤Ç¤Ï¡¢Ê¸Ë¡Åª¤ËÀµ¤·¤¯¤Ê¤¤¥Ñ¥¿¡¼¥ó¤ä¡¢ +¥Þ¥Ã¥Á¤¬¤Ê¤«¤Ã¤¿¥Ñ¥¿¡¼¥ó¤Ï¡¢ +¤½¤Î¤Þ¤ÞÊѹ¹¤µ¤ì¤º¤Ë»Ä¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.I bash +¤Ç¤Ï +.I allow_null_glob_expansion=true +¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢°ÊÁ°¤Î¿¶¤ëÉñ¤¤¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +(ƱÍͤÎÌäÂê¤ÏÊ̤ΤȤ³¤í¤Ç¤âµ¯¤³¤Ã¤Æ¤¤¤ë¡£Î㤨¤Ð¡¢¸Å¤¤¥¹¥¯¥ê¥×¥È¤Ë¤ª¤±¤ë +.br +.nf + rm \`find . \-name "*~"\` +.fi +¤Î¤è¤¦¤Êµ­½Ò¤Ï¡¢¿·¤·¤¤¥¹¥¯¥ê¥×¥È¤Ç¤Ï +.br +.nf + rm \-f nosuchfile \`find . \-name "*~"\` +.fi +¤Î¤è¤¦¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤µ¤â¤Ê¤¤¤È +.I rm +¤ò°ú¤­¿ô¥ê¥¹¥È¤Ê¤·¤Ç¸Æ¤Ó½Ð¤¹²ÄǽÀ­¤¬¤¢¤ê¡¢ +¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½Ð¤Æ¤·¤Þ¤¦¡£) +.SH Ãí°Õ +.SS Àµµ¬É½¸½ +¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤ÏÀµµ¬É½¸½¤È¿¾¯»÷¤Æ¤¤¤ë¤¬¡¢¤·¤«¤·¤³¤Îξ¼Ô¤Ï°Û¤Ê¤ë¡£ +¤Þ¤ºÂè°ì¤Ë¡¢Á°¼Ô¤¬¥Õ¥¡¥¤¥ë̾¤Ë¥Þ¥Ã¥Á¤¹¤ë¤Î¤ËÂФ·¤Æ¡¢ +¸å¼Ô¤Ï¥Æ¥­¥¹¥È¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ÂèÆó¤Ë¡¢¥ë¡¼¥ë¤âƱ¤¸¤Ç¤Ï¤Ê¤¤¡£ +Î㤨¤ÐÀµµ¬É½¸½¤Ë¤ª¤±¤ë \(aq*\(aq ¤Ï¡¢ +Á°ÃÖ¤µ¤ì¤¿Ê¸»ú¤Î 0 °Ê¾å¤Î·«¤êÊÖ¤·¤òɽ¤¹¡£ + +Àµµ¬É½¸½¤Ë¤â¥Ö¥é¥±¥Ã¥Èɽ¸½¤Ï¤¢¤ë¤¬¡¢ÈÝÄê¤Ï \(aq^\(aq ¤Ç¤Ê¤µ¤ì¤ë¡£ +POSIX ¤Ç¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤Ë¤ª¤±¤ë "\fI[^...]\fP" ¤ò̤ÄêµÁ¤Ç¤¢¤ë¤È¤·¤Æ¤¤¤ë¡£ +.SS ʸ»ú¥¯¥é¥¹¤È¹ñºÝ²½ +Îΰè»ØÄê¤Ï¡¢¤â¤È¤â¤È¤Ï¤â¤Á¤í¤ó ASCII ¤Ë¤ª¤±¤ë½ç½øʤӤò°ÕÌ£¤·¤Æ¤¤¤¿¡£ +¤·¤¿¤¬¤Ã¤Æ "\fI[\ \-%]\fP" ¤Ï "\fI[\ !"#$%]\fP" ¤Î°ÕÌ£¤Ç¤¢¤ê¡¢ +"\fI[a\-z]\fP" ¤Ï¡Ö¤¹¤Ù¤Æ¤Î¾®Ê¸»ú¡×¤Î°ÕÌ£¤Ç¤¢¤Ã¤¿¡£ +Unix ¤Î¼ÂÁõ¤ÎÃæ¤Ë¤Ï¡¢¤³¤ì¤ò³ÈÄ¥¤·¤¿¤â¤Î¤¬Â¸ºß¤·¡¢ +¤½¤³¤Ç¤Ï X\-Y ¤È¤¤¤¦Îΰè»ØÄê¤Ï¡¢X ¤Î¥³¡¼¥É¤È +Y ¤Î¥³¡¼¥É¤Ë¶´¤Þ¤ì¤¿¥³¡¼¥É¤ò»ý¤Äʸ»ú¤¹¤Ù¤Æ¤òɽ¤¹¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£ +¤·¤«¤·¡¢¤³¤ì¤Ë¤Ï¥æ¡¼¥¶¡¼¤¬¥í¡¼¥«¥ë¤Ê¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë +ʸ»ú¥³¡¼¥É¤òÃΤé¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¤µ¤é¤Ë¥í¡¼¥«¥ë¤Ê¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤ËÂФ¹¤ë¾È¹ç½ç½ø +(collating sequence) ¤¬Ê¸»ú¥³¡¼¥É¤Î½ç½ø¤È°Û¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤ÏÉÔÊؤǤ¢¤Ã¤¿¡£ +(ÌõÃí: collating sequence ¤Ë´Ø¤·¤Æ¤Ï +.BR regex (7) +¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£) +¤·¤¿¤¬¤Ã¤Æ POSIX ¤Ç¤Ï¡¢¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤ÈÀµµ¬É½¸½¤ÎÁÐÊý¤Ë¤ª¤¤¤Æ¡¢ +¥Ö¥é¥±¥Ã¥Èɽµ­¤òÂçÉý¤Ë³ÈÄ¥¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Þ¤Ç²æ¡¹¤Ï¡¢¥Ö¥é¥±¥Ã¥Èɽµ­¤Ë¤Ï»°¤Ä¤ÎÍ×ÁǤ¬´Þ¤Þ¤ì¤¦¤ë¤³¤È¤ò¸«¤Æ¤­¤¿¡£ +¤¹¤Ê¤ï¤Á (i) ÈÝÄê¡¢(ii) ñ°ì¤Îʸ»ú¡¢(iii) Îΰè»ØÄê¡¢¤Î»°¤Ä¤Ç¤¢¤ë¡£ +POSIX ¤Ç¤Ï¡¢Îΰè»ØÄê¤ò¤è¤ê¹ñºÝ²½¤ËÊØÍø¤Ê¤è¤¦¤ËÄêµÁ¤·¤Æ¤ª¤ê¡¢ +¤Þ¤¿»°¤Ä¤Î¥¿¥¤¥×¤ò¥Ö¥é¥±¥Ã¥Èɽµ­¤ÎÍ×ÁǤȤ·¤ÆÄɲ䷤Ƥ¤¤ë¡£ + +(iii) Îΰè»ØÄê X\-Y ¤Ï X ¤È Y ¤Ë¶´¤Þ¤ì¤¿ (ξü´Þ¤à) ¤¹¤Ù¤Æ¤Îʸ»ú¤ò°ÕÌ£¤¹¤ë¡£ +¤³¤Î¤È¤­¡¢¥«¥ì¥ó¥È¥í¥±¡¼¥ë (current locale) ¤Î +.B LC_COLLATE +¥«¥Æ¥´¥ê¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾È¹ç½ç½ø¤¬ÍѤ¤¤é¤ì¤ë¡£ + +(iv) ̾Á°ÉÕ¤­Ê¸»ú¥¯¥é¥¹: °Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +.nf + +[:alnum:] [:alpha:] [:blank:] [:cntrl:] +[:digit:] [:graph:] [:lower:] [:print:] +[:punct:] [:space:] [:upper:] [:xdigit:] + +.fi +¤³¤ì¤òÍѤ¤¤ì¤Ð "\fI[a\-z]\fP" ¤ÎÂå¤ï¤ê¤Ë "\fI[[:lower:]]\fP" ¤Î¤è¤¦¤Ê»ØÄ꤬¤Ç¤­¤ë¡£ +¤Þ¤¿¥Ç¥ó¥Þ¡¼¥¯¤Î¤è¤¦¤Ë¡¢¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Î \(aqz\(aq °Ê¹ß¤Ë +3 ¤Ä¤Îʸ»ú¤¬Â¸ºß¤¹¤ë¤è¤¦¤Ê¾ì¹ç¤Ç¤â¡¢Æ±¤¸¤è¤¦¤ÊÆ°ºî¤¬´üÂԤǤ­¤ë¡£ +¤³¤ì¤é¤Îʸ»ú¥¯¥é¥¹¤Ï¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤Î +.B LC_CTYPE +¥«¥Æ¥´¥ê¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +(v) ¾È¹ç½ç½ø¤Ë¤ª¤±¤ë¥·¥ó¥Ü¥ë: "\fI[.ch.]\fP" ¤ä "\fI[.a-acute.]\fP" ¤Î¤è¤¦¤Ë "\fI[.\fP" +¤È "\fI.]\fP" ¤Ç¶´¤Þ¤ì¤¿Ê¸»úÎó¤Ï¡¢¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤ÇÄêµÁ¤µ¤ì¤¿¾È¹ç½ç½ø¤ÎÍ×ÁǤȤʤ롣 +¤¢¤ë°ì¤Ä¤ÎÍ×ÁǤ¬Ê£¿ô¤Îʸ»ú¤«¤é¤Ê¤ë¾ì¹ç¤â¤¢¤ê¤¦¤ë¤³¤È¤ËÃí°Õ¡£ + +(vi) Åù²Á¥¯¥é¥¹É½¸½ (equivalence class expressions): "\fI[=a=]\fP" +¤Î¤è¤¦¤Ë "\fI[=\fP" ¤È "\fI=]\fP" ¤È¤Ç¶´¤Þ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£ +¤³¤ì¤ÏÅù²Á¥¯¥é¥¹¤Î¥á¥ó¥Ð¡¼¤Ç¤¢¤ë¾È¹ç½ç½ø¤ÎÍ×ÁǤ¹¤Ù¤Æ¤Ë¤Ê¤ë¡£ +Åù²Á¥¯¥é¥¹¤Ï¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ë¤Ê¤ë¡£ +Î㤨¤Ð¡¢"\fI[[=a=]]\fP" ¤Ï +"\fI[a[.a\-acute.][.a\-grave.][.a\-umlaut.][.a\-circumflex.]]\fP" +¤ÈÅù²Á¤Ç¤¢¤ë +(Latin-1 ɽµ­¤Ç¤Ï [a\e`{a}\e'{a}\e"{a}\e^{a}] ¤âƱ¤¸¡£ +[ÌõÃí] ÆüËܸì¤Î roff ¥Ú¡¼¥¸¤Ç¤Ï latin1 ¥³¡¼¥É¤¬½Ð¤Ê¤¤¤Î¤Ç¡¢ +¤³¤³¤Ç¤Ï TeX ɽµ­¤Çµ­ºÜ)¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sh (1), +.BR fnmatch (3), +.BR glob (3), +.BR locale (7), +.BR regex (7) diff --git a/release/man7/hier.7 b/release/man7/hier.7 new file mode 100644 index 00000000..4ddfbbb4 --- /dev/null +++ b/release/man7/hier.7 @@ -0,0 +1,527 @@ +.\" 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 Sun Jul 25 11:05:58 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sat Feb 10 16:18:03 1996 by Urs Thuermann (urs@isnogud.escape.de) +.\" Modified Mon Jun 16 20:02:00 1997 by NicoláÔ Lichtmaier +.\" Modified Mon Feb 6 16:41:00 1999 by NicoláÔ Lichtmaier +.\" Modified Tue Feb 8 16:46:45 2000 by Chris Pepper +.\" Modified Fri Sep 7 20:32:45 2001 by Tammy Fox +.\" +.\" Japanese Version Copyright (c) 1997-2000 TACHIBANA Akira +.\" all rights reserved. +.\" Translated Wed Dec 11 02:08:20 JST 1997 +.\" by TACHIBANA Akira +.\" Modified Sat Apr 8 02:44:43 JST 2000 +.\" by TACHIBANA Akira +.\" Updated Sun Sep 17 20:48:33 JST 2000 +.\" by TACHIBANA Akira +.\" Updated Sat 29 Dec 2001 by NAKANO Takeo +.\" +.\"WORD: native language support Êì¹ñ¸ì¥µ¥Ý¡¼¥È +.TH HIER 7 2009-03-30 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +hier \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à³¬ÁؤÎÀâÌÀ +.SH ÀâÌÀ +ŵ·¿Åª¤Ê Linux system ¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ë +(¾¤Ë¤â¤¿¤¯¤µ¤ó¤Î¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ë¤¬): +.TP +.I / +¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¡£¤³¤³¤¬³¬Áؤε¯ÅÀ¤È¤Ê¤ë¡£ +.TP +.I /bin +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¥·¥ó¥°¥ë¥æ¡¼¥¶¡¼¥â¡¼¥É¤Ç +¥·¥¹¥Æ¥à¤Îµ¯Æ°¤ä½¤Íý¤ò¹Ô¤¦ºÝ¤ËɬÍפʼ¹ԷÁ¼°¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤ë¡£ +.TP +.I /boot +¥Ö¡¼¥È¥í¡¼¥À¤¬ÍѤ¤¤ëÀÅŪ¤Ê¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¥Ö¡¼¥È¥×¥í¥»¥¹¤Î´Ö¤ËɬÍפʥե¡¥¤¥ë¤À¤±¤¬ÃÖ¤«¤ì¤ë¡£ +¥Þ¥Ã¥×¥¤¥ó¥¹¥È¡¼¥é¤äÀßÄê¥Õ¥¡¥¤¥ë¤Ï +.I /sbin +¤ä +.I /etc +¤ËÃÖ¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.I /dev +ʪÍý¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤ë +¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤ä¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.BR mknod (1) +¤ò»²¾È¤Î¤³¤È¡£ +.TP +.I /etc +¥Þ¥·¥ó¸ÇÍ­¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¾ì½ê¡£X11 ¤Î¤è¤¦¤Ê +Â絬ÌϤʥ½¥Õ¥È¥¦¥§¥¢¥Ñ¥Ã¥±¡¼¥¸¤Ç¤Ï¡¢ +.I /etc +°Ê²¼¤Ë¹¹¤Ë¥Ñ¥Ã¥±¡¼¥¸Ã±°Ì¤Ç¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬ºî¤é¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +¥µ¥¤¥ÈÁ´ÂΤËÍ­¸ú¤ÊÀßÄê¥Õ¥¡¥¤¥ë¤Ï¡¢¤³¤³¤Ç¤Ï¤Ê¤¯ +.I /usr/etc +¤ËÃÖ¤«¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +¤·¤«¤·¡¢¥×¥í¥°¥é¥à¤«¤é¤Î¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î»²¾ÈÀè¤Ï¡¢¾ï¤Ë +.I /etc +¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.I /usr/etc +°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¤Ï¡¢¤½¤ì¤é¤Ø¤Î¥ê¥ó¥¯¤ò +.I /etc +¤ËÃÖ¤±¤Ð¤è¤¤¡£ +.TP +.I /etc/opt +.I /opt +¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥¢¥É¥ª¥ó¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬»È¤¦¡¢ +¥Û¥¹¥È¸ÇÍ­¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /etc/sgml +SGML ¤ä XML ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê (¤Ê¤¯¤Æ¤â¤è¤¤)¡£ +.TP +.I /etc/skel +¿·¤¿¤Ë¥æ¡¼¥¶¡¼¥¢¥«¥¦¥ó¥È¤òºî¤ëºÝ¡¢ +Ä̾盧¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤¬ +¥æ¡¼¥¶¡¼¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£ +.TP +.I /etc/X11 +X11 window system ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê (¤Ê¤¯¤Æ¤â¤è¤¤)¡£ +.TP +.I /home +Ä̾¥æ¡¼¥¶¡¼¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥êľ²¼¤Ê¤¤¤·¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Î²¼¤ËºîÀ®¤µ¤ì¤ë¡£ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¹½À®¤ò¤É¤¦¤¹¤ë¤«¤Ï¡¢ +¥í¡¼¥«¥ë¥Þ¥·¥ó¤Î´ÉÍý¼Ô¤¬·è¤á¤ë¤³¤È¤Ç¤¢¤ë¡£ +.TP +.I /lib +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¥·¥¹¥Æ¥à¤Îµ¯Æ°»þ¤ËɬÍפʶ¦Í­¥é¥¤¥Ö¥é¥ê¤ä¡¢ +¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤Î¤ËɬÍפʶ¦Í­¥é¥¤¥Ö¥é¥ê¤òÃÖ¤¯¡£ +.TP +.I /media +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢ +CD/DVD ¥Ç¥£¥¹¥¯¤ä USB ¥¹¥Æ¥£¥Ã¥¯¤Ê¤É¤Î¼è¤ê³°¤·²Äǽ¥á¥Ç¥£¥¢ +(removable media) ÍѤΥޥ¦¥ó¥È¥Ý¥¤¥ó¥È¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /mnt +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢°ì»þŪ¤Ë¥Þ¥¦¥ó¥È¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÍѤΠ+¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤¢¤ë¡£ +¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï¡¢°ì»þŪ¤Ë¥Þ¥¦¥ó¥È¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÍѤΠ+¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤È¤·¤Æ¡¢ +.I /mnt +Æâ¤Ë¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤¬¤¢¤ë¡£ +.TP +.I /opt +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¥¢¥É¥ª¥ó¥Ñ¥Ã¥±¡¼¥¸¤ÎÀÅŪ¤Ê¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /proc +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï +.I proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤¢¤ë¡£ +.I proc +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢¼Â¹ÔÃæ¥×¥í¥»¥¹¤ä¥«¡¼¥Í¥ë¤Î¾ðÊó¤òÄ󶡤¹¤ë¡£ +¤³¤Îµ¿»÷¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¾ÜºÙ¤Ï¡¢ +.BR proc (5) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /root +Ä̾盧¤³¤¬ root ¥æ¡¼¥¶¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ê¤ë (¤Ê¤¯¤Æ¤â¤è¤¤)¡£ +.TP +.I /sbin +.I /bin +¤ÈƱÍͤˡ¢ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¥·¥¹¥Æ¥à¤Îµ¯Æ°¤ËɬÍפʥ³¥Þ¥ó¥É¤¬´Þ¤Þ¤ì¤ë¡£ +¤¿¤À¤·¤³¤³¤Ë¤Ï¡¢°ìÈ̥桼¥¶¡¼¤ÏÄ̾ï¼Â¹Ô¤·¤Ê¤¤¥³¥Þ¥ó¥É¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /srv +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¤³¤Î¥·¥¹¥Æ¥à¤ÇÄ󶡤µ¤ì¤ë +¥µ¥¤¥È¸ÇÍ­¤Î¥Ç¡¼¥¿¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /tmp +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢ +Äê´üŪ¤Ê¥¸¥ç¥Ö¤Ë¤è¤Ã¤Æ¡¢¤Þ¤¿¤Ï¥·¥¹¥Æ¥àµ¯Æ°»þ¤Ë¡¢ +̵¾ò·ï¤Ëºï½ü¤·¤Æ¹½¤ï¤Ê¤¤°ì»þŪ¤Ê¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /usr +Ä̾盧¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢ÆÈΩ¤·¤¿¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤¬¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +¤³¤³¤Ë¤Ï¡¢¶¦Í­²Äǽ¤ÇÆɤ߹þ¤ßÀìÍѤΤâ¤Î¤À¤±¤¬´Þ¤Þ¤ì¡¢ +¤è¤Ã¤Æ¤¤¤í¤¤¤í¤Ê Linux ¥Þ¥·¥ó¤«¤é¥Þ¥¦¥ó¥È¤Ç¤­¤ë¡£ +.TP +.I /usr/X11R6 +X Window System, Version 11 release 6 (¤Ê¤¯¤Æ¤â¤è¤¤)¡£ +.\":tati:X(3) ¤Ë¹ç¤ï¤»¤Þ¤·¤¿ +.TP +.I /usr/X11R6/bin +X Window System ¤Î¥Ð¥¤¥Ê¥ê¤ÎÃÖ¤­¾ì½ê¡£ +¸Å¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë +.I /usr/bin/X11 +¤«¤é¤³¤³¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¤¡£ +.TP +.I /usr/X11R6/lib +X Window System ¤Ë´ØÏ¢¤¹¤ë¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/X11R6/lib/X11 +¤³¤³¤Ë¤Ï X ¤ÎÆ°ºî¤ËɬÍפʼ¤Î¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.I /usr/lib/X11 +¤«¤é¤³¤³¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¤¡£ +.TP +.I /usr/X11R6/include/X11 +¤³¤³¤Ë¤Ï X11 Window System ¤ò»È¤Ã¤¿¥×¥í¥°¥é¥à¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤¿¤á¤Ë +ɬÍפʥ¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.I /usr/include/X11 +¤«¤é¤³¤³¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¤¡£ +.TP +.I /usr/bin +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢¼Â¹Ô·Á¼°¥Õ¥¡¥¤¥ë¤Î¼ç¤ÊÃÖ¤­¾ì½ê¤Ç¤¢¤ë¡£ +¥·¥¹¥Æ¥à¤Î¥Ö¡¼¥È¤ä¥·¥¹¥Æ¥àÉüµì¤Ë¤ÏɬÍפȤµ¤ì¤Ê¤¤¡¢ +°ìÈ̥桼¥¶¡¼¤¬ÍøÍѤ¹¤ë¥³¥Þ¥ó¥É¤Î¿¤¯¤Ï¡¢ +¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë¤Î¤Ç¤Ê¤¤¸Â¤ê¡¢ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.I /usr/bin/X11 +X11 ¥³¥Þ¥ó¥É¤ÎÅÁÅýŪ¤ÊÃÖ¤­¾ì½ê¡£Linux ¤Ç¤Ï¡¢Ä̾ï +.I /usr/X11R6/bin +¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/dict +.I /usr/share/dict +¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +.TP +.I /usr/doc +.I /usr/share/doc +¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +.TP +.I /usr/etc +¥µ¥¤¥ÈÆâÉô¤ÎÊ£¿ô¤Î¥Þ¥·¥ó¤¬¶¦Í­¤¹¤ë¤è¤¦¤ÊÀßÄê¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¥³¥Þ¥ó¥É¤Ï¤½¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î»²¾ÈÀè¤ò¡¢¾ï¤Ë +.I /etc +¤Ë¤¹¤Ù¤­¤À¤í¤¦¡£ +.I /etc +¤Î¥Õ¥¡¥¤¥ë¤«¤é¥ê¥ó¥¯¤òÄ¥¤Ã¤Æ¡¢ +.I /usr/etc +¤ÎŬÀڤʥե¡¥¤¥ë¤ò»Ø¤¹¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.I /usr/games +¥²¡¼¥à¥×¥í¥°¥é¥à¤ä¶µ°éÍÑ¥×¥í¥°¥é¥à¤Î¥Ð¥¤¥Ê¥ê¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë (¤Ê¤¯¤Æ¤â¤è¤¤)¡£ +.TP +.I /usr/include +C ¥³¥ó¥Ñ¥¤¥éÍѤΥ¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/include/X11 +C ¥³¥ó¥Ñ¥¤¥é¤È X Window System ÍѤΥ¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +Ä̾盧¤ì¤Ï +.I /usr/inlcude/X11 +¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.TP +.I /usr/include/asm +¥¢¥»¥ó¥Ö¥é´Ø¿ô¤ÎÀë¸À¤ò¹Ô¤¦¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢°ÊÁ°¤Ï +.I /usr/src/linux/include/asm +¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤À¤Ã¤¿¡£ +.TP +.I /usr/include/linux +¤³¤³¤Ë¤Ï¡¢¥·¥¹¥Æ¥à¤Î¥ê¥ê¡¼¥¹¤Î¤¿¤Ó¤´¤È¤ËÊѹ¹¤µ¤ì¤¦¤ë¾ðÊ󤬴ޤޤì¤ë¡£ +¤³¤³¤Ï°ÊÁ°¤Ï +.I /usr/src/linux/include/linux +¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤µ¤ì¤Æ¤ª¤ê¡¢ +¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¸ÇÍ­¤Î¾ðÊó¤¬ÆÀ¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£ + +(¤³¤³¤ËÃÖ¤¯¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ï¡¢ +¸½ºß¤Î libc ¤ª¤è¤Ó¥æ¡¼¥¶¶õ´Ö¤ÇÀµ¤·¤¯Æ°ºî¤¹¤ë¤â¤Î¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤·¤«¤· Linux ¤Î¥«¡¼¥Í¥ë¥½¡¼¥¹¤Ï +¥æ¡¼¥¶¥×¥í¥°¥é¥à¤È¤¤¤Ã¤·¤ç¤Ë»È¤¦¤è¤¦¤Ë¤ÏÀ߷פµ¤ì¤Æ¤¤¤Ê¤¤¤·¡¢ +¤¢¤Ê¤¿¤¬»È¤Ã¤Æ¤¤¤ë libc ¤â´ØÃΤ·¤Ê¤¤¡£ +.I /usr/include/asm +¤È +.I /usr/include/linux +¤òŬÅö¤Ê¥«¡¼¥Í¥ë¥Ä¥ê¡¼¤Ø¤Î¥ê¥ó¥¯¤Ë¤·¤¿¤ê¤¹¤ë¤È¡¢ÇËþ¤¹¤ë¤Î¤ÏÌܤ˸«¤¨¤Æ¤¤¤ë¡£ +Debian ¤Ç¤Ï¤³¤¦¤»¤º¤Ë¡¢libc*-dev package ¤¬Ä󶡤¹¤ë¡¢ +°ÂÄꤷ¤¿¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤òÃÖ¤¤¤Æ¤¤¤ë¡£) +.TP +.I /usr/include/g++ +GNU C++ ¥³¥ó¥Ñ¥¤¥éÍѤΥ¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/lib +¥ª¥Ö¥¸¥§¥¯¥È¥é¥¤¥Ö¥é¥ê (¥À¥¤¥Ê¥ß¥Ã¥¯¥é¥¤¥Ö¥é¥ê¤â´Þ¤à) ¤È¡¢ +ľÀܤˤϵ¯Æ°¤µ¤ì¤Ê¤¤¤è¤¦¤Ê¼Â¹Ô·Á¼°¥Õ¥¡¥¤¥ë¾¯¡¹¤È¤¬ÃÖ¤«¤ì¤ë¡£ +Ê£»¨¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¹¹¤Ë¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.I /usr/lib/X11 +X ¤Î¥×¥í¥°¥é¥à¤Ë´ØÏ¢¤¹¤ë¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤È¡¢ +X Window System ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +Linux ¤Ç¤ÏÄ̾ï +.I /usr/X11R6/lib/X11 +¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/lib/gcc-lib +GNU C ¥³¥ó¥Ñ¥¤¥é +.BR gcc (1) +ÍѤμ¹ԷÁ¼°¥Õ¥¡¥¤¥ë¤È¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/lib/groff +GNU groff ʸ½ñÀ°·Á¥·¥¹¥Æ¥à¤Î¤¿¤á¤Î¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/lib/uucp +.BR uucp (1) +¤Î¤¿¤á¤Î¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/local +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢ +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ê¥×¥í¥°¥é¥à¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ëŵ·¿Åª¤Ê¾ì½ê¤Ç¤¢¤ë¡£ +.TP +.I /usr/local/bin +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ê¥×¥í¥°¥é¥à¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/local/doc +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ê¥É¥­¥å¥á¥ó¥È¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/local/etc +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥×¥í¥°¥é¥à¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/games +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥²¡¼¥à¤Î¥Ð¥¤¥Ê¥ê¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/lib +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Î´ØÏ¢¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/include +¥í¡¼¥«¥ë¤Ê C ¥³¥ó¥Ñ¥¤¥é¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/info +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Î info ¥Ú¡¼¥¸¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/man +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/sbin +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥·¥¹¥Æ¥à´ÉÍý¥³¥Þ¥ó¥É¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/share +Ʊ¤¸ OS ¤Ê¤é¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤¬°Û¤Ê¤Ã¤Æ¤â¶¦Í­¤Ç¤­¤ë¡¢ +¥í¡¼¥«¥ë¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ç¡¼¥¿¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/local/src +¥µ¥¤¥È¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥½¥Õ¥È¥¦¥§¥¢¤Î¥½¡¼¥¹¥³¡¼¥É¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/man +.I /usr/share/man +¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +.TP +.I /usr/sbin +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¥·¥¹¥Æ¥à´ÉÍý¥³¥Þ¥ó¥É¤¬´Þ¤Þ¤ì¤ë¡£ +¤³¤³¤ËÃÖ¤«¤ì¤ë¥³¥Þ¥ó¥É¤Ï¡¢¥Ö¡¼¥È¥×¥í¥»¥¹¤ä +.I /usr +¤Î¥Þ¥¦¥ó¥È¡¢¥·¥¹¥Æ¥à¤Î½¤Íý¤Ê¤É¤ËɬÍפʤâ¤Î¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.TP +.I /usr/share +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤´¤È¤Ë¸ÇÍ­¤Ê¥Ç¡¼¥¿ +(Ʊ¤¸ OS ¤Ê¤é¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤¬°ã¤Ã¤Æ¤¤¤Æ¤â¶¦Í­¤Ç¤­¤ë¤â¤Î) +¤¬¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥êñ°Ì¤ÇÃÖ¤«¤ì¤ë¡£ +°ÊÁ°¤Ë¤Ï +.IR /usr/doc , +.IR /usr/lib , +.I /usr/man +¤Ê¤É¤Ë¤¢¤Ã¤¿ÆâÍƤ¬¡¢Â¿¤¯¤³¤³¤ËÃÖ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.I /usr/share/dict +¥¹¥Ú¥ë¥Á¥§¥Ã¥«ÍѤÎñ¸ì¥ê¥¹¥È¤¬´Þ¤Þ¤ì¤ë¡£ +.TP +.I /usr/share/doc +¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Î¥É¥­¥å¥á¥ó¥È¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/share/games +.I /usr/games +¤ËÃÖ¤«¤ì¤¿¥²¡¼¥àÍѤÎÀÅŪ¤Ê¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/share/info +info ¥Ú¡¼¥¸¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /usr/share/locale +¥í¥±¡¼¥ë (locale) ¾ðÊó¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /usr/share/man +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¡£³Æ¥Ú¡¼¥¸¤Ï¥»¥¯¥·¥ç¥ó¤Ë±þ¤¸¤¿¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤ë¡£ +.TP +.I /usr/share/man//man[1\-9] +¤³¤ì¤é¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢ +³Æ¥í¥±¡¼¥ë¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥½¡¼¥¹¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¡£ +¤¹¤Ù¤Æ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÇƱ¤¸¸À¸ì¤È¥³¡¼¥É¥»¥Ã¥È¤ò»ÈÍѤ¹¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.I +¤Ï¾Êά¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +.I /usr/share/misc +Ʊ¤¸ OS ¤Ê¤é¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤¬°ã¤Ã¤Æ¤¤¤Æ¤â¶¦Í­¤Ç¤­¤ë¡¢»¨Â¿¤Ê¥Ç¡¼¥¿¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/share/nls +Êì¹ñ¸ì¥µ¥Ý¡¼¥È (native language support) ÍѤΥá¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/share/sgml +SGML ¤ä XML ¤Î¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/share/terminfo +terminfo ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /usr/share/tmac +groff ¤È°ì½ï¤Ë¤ÏÇÛÉÛ¤µ¤ì¤Æ¤¤¤Ê¤¤ troff ¥Þ¥¯¥í¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /usr/share/zoneinfo +¥¿¥¤¥à¥¾¡¼¥ó¾ðÊó¤Î¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /usr/src +¥·¥¹¥Æ¥à¾å¤Î¿§¡¹¤Ê¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë +(»²¾ÈÍѤΥѥ屡¼¥¸¤â´Þ¤à) ¤ÎÃÖ¤­¾ì½ê¡£ +¤³¤Î¾ì½ê¤Ç¼«Ê¬¤Î¥×¥í¥¸¥§¥¯¥È¤Îºî¶È¤ò¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ +/usr °Ê²¼¤Î¥Õ¥¡¥¤¥ë¤Ï¥½¥Õ¥È¥¦¥§¥¢¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Î»þ°Ê³°¤Ï +Æɤ߹þ¤ßÀìÍѤˤʤäƤ¤¤ë¤Ù¤­¤À¤«¤é¤Ç¤¢¤ë¡£ +.TP +.I /usr/src/linux +¤«¤Ä¤Æ¤Ï¥«¡¼¥Í¥ë¥½¡¼¥¹¤ÎÅÁÅýŪ¤ÊÃÖ¤­¾ì½ê¤À¤Ã¤¿¡£ +¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï¡¢ +½Ð²Ù»þ¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¤ò¤³¤³¤ËÃÖ¤¤¤Æ¤¤¤ë¡£ +¼«Ê¬¤Ç¥«¡¼¥Í¥ë¤ò¥Ó¥ë¥É¤¹¤ë¤È¤­¤ÏÊ̤ξì½ê¤ò»È¤¦¤Û¤¦¤¬¤¤¤¤¤À¤í¤¦¡£ +.TP +.I /usr/tmp +º£¤Ç¤ÏÍѤ¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï +.I /var/tmp +¤Ø¤Î¥ê¥ó¥¯¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤Î¥ê¥ó¥¯¤Ï¸ß´¹À­¤Î¤¿¤á¤À¤±¤Ë¤¢¤ê¡¢¤â¤Ï¤ä»È¤¦¤Ù¤­¤Ç¤Ê¤¤¡£ +.TP +.I /var +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢¥¹¥×¡¼¥ë¥Õ¥¡¥¤¥ë¤ä¥í¥°¥Õ¥¡¥¤¥ë¤Î¤è¤¦¤Ê¡¢ +¥µ¥¤¥º¤¬ÊѲ½¤¹¤ë¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /var/adm +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï +.I /var/log +¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +¤³¤³¤Ï +.I /var/log +¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.I /var/backups +Îò»ËŪ¤ÊÍýͳ¤«¤é¤Þ¤À»Ä¤Ã¤Æ¤¤¤ë¡£ +.TP +.I /var/cache +¥×¥í¥°¥é¥à¤Î¤¿¤á¤Ë¥­¥ã¥Ã¥·¥å¤µ¤ì¤¿¥Ç¡¼¥¿¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.IR /var/catman/cat[1\-9] " or " /var/cache/man/cat[1\-9] +¤³¤ì¤é¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢À°·ÁºÑ¤ß¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤¬¡¢ +¥Ú¡¼¥¸¤Î¥»¥¯¥·¥ç¥ó¤Ë½¾¤Ã¤ÆÃÖ¤«¤ì¤Æ¤¤¤ë¡£ +(À°·ÁºÑ¤ß¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÍøÍѤϿ侩¤µ¤ì¤Æ¤¤¤Ê¤¤¡£) +.TP +.I /var/cron +Îò»ËŪ¤ÊÍýͳ¤«¤é¤Þ¤À»Ä¤Ã¤Æ¤¤¤ë¡£ +.TP +.I /var/lib +¥×¥í¥°¥é¥à¤Î¾õÂ֤˴ؤ¹¤ë¾ðÊó¤Î¤¦¤Á¡¢²ÄÊѤʤâ¤Î¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/local +.I /usr/local +ÍѤβÄÊѥǡ¼¥¿¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/lock +¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +¥Ç¥Ð¥¤¥¹¤Î¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤Î̿̾¤Ï¡¢´·½¬¤È¤·¤Æ +.I LCK.. +¤È¤µ¤ì¤Æ¤¤¤ë¡£¤³¤³¤Ç +.I +¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ç¤Î¥Ç¥Ð¥¤¥¹Ì¾¤Ç¤¢¤ë¡£ +ÍøÍѤµ¤ì¤Æ¤¤¤ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï +HDU UUCP ¤Î¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤¹¤Ê¤ï¤Á³Æ¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤Ë¤Ï +¥¢¥¹¥­¡¼ 10 ¿Ê¿ôÃÍʸ»ú¤Çɽµ­¤·¤¿ PID 10 ¥Ð¥¤¥È¤È¡¢ +¤½¤ì¤Ë³¤¤¤Æ²þ¹Ôʸ»ú¤È¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.I /var/log +¼ï¡¹¤Î¥í¥°¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/opt +.I /opt +ÍѤβÄÊѥǡ¼¥¿¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/mail +¥æ¡¼¥¶¤Î¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤ÎÃÖ¤­¾ì½ê¡£ +.I /var/spool/mail +¤òÃÖ¤­´¹¤¨¤¿¡£ +.TP +.I /var/msgs +Îò»ËŪ¤ÊÍýͳ¤«¤é¤Þ¤À»Ä¤Ã¤Æ¤¤¤ë¡£ +.TP +.I /var/preserve +Îò»ËŪ¤ÊÍýͳ¤«¤é¤Þ¤À»Ä¤Ã¤Æ¤¤¤ë¡£ +.TP +.I /var/run +¼Â¹Ô»þ¤Î²ÄÊÑ¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +Î㤨¤Ð¥×¥í¥»¥¹¼±ÊÌ»Ò (PID) ¤òÊÝ»ý¤¹¤ë¥Õ¥¡¥¤¥ë¤ä¡¢ +¥æ¡¼¥¶¤Î¥í¥°¥¤¥ó¾ðÊó¥Õ¥¡¥¤¥ë +.I (utmp) +¤Ê¤É¤Ç¤¢¤ë¡£ +¤³¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢Ä̾亮¥¹¥Æ¥àµ¯Æ°»þ¤Ëºï½ü¤µ¤ì¤ë¡£ +.TP +.I /var/spool +¿§¡¹¤Ê¥×¥í¥°¥é¥à¤Î¥¹¥×¡¼¥ë¥Õ¥¡¥¤¥ë (¤¢¤ë¤¤¤Ï¥­¥å¡¼¥Õ¥¡¥¤¥ë) ¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/spool/at +.BR at (1) +¤Î¥¸¥ç¥Ö¥¹¥×¡¼¥ë¡£ +.TP +.I /var/spool/cron +.BR cron (8) +¤Î¥¸¥ç¥Ö¥¹¥×¡¼¥ë¡£ +.TP +.I /var/spool/lpd +°õºþÍѤΥ¹¥×¡¼¥ë¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤ë¡£ +.TP +.I /var/spool/mail +.I /var/mail +¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +.TP +.I /var/spool/mqueue +¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤¿Á÷¿®¥á¡¼¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/spool/news +¥Ë¥å¡¼¥¹¤Î¥¹¥×¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¡£ +.TP +.I /var/spool/rwho +.BR rwhod (8) +¤Î¥¹¥×¡¼¥ë¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/spool/smail +¥á¡¼¥ëÇÛÁ÷¥×¥í¥°¥é¥à +.BR smail (1) +¤Î¥¹¥×¡¼¥ë¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/spool/uucp +.BR uucp (1) +¤Î¥¹¥×¡¼¥ë¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.TP +.I /var/tmp +.I /tmp +¤È»÷¤Æ¤¤¤ë¤¬¡¢ +¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤ë°ì»þŪ¤Ê¥Õ¥¡¥¤¥ë¤ÏÊݸ´ü´Ö¤ÎÀ©¸Â¤¬¤Ê¤¤¡£ +.TP +.I /var/yp +NIS ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎÃÖ¤­¾ì½ê¡£ +.SH ½àµò +The Filesystem Hierarchy Standard, Version 2.2 . +.SH ¥Ð¥° +¤³¤Î¥ê¥¹¥È¤ÏÌÖÍåŪ¤Ê¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +¸Ä¡¹¤Î¥·¥¹¥Æ¥à¤Ç¤Ï°Û¤Ê¤ëÉôʬ¤¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR find (1), +.BR ln (1), +.BR proc (5), +.BR mount (8) + +The Filesystem Hierarchy Standard diff --git a/release/man7/icmp.7 b/release/man7/icmp.7 new file mode 100644 index 00000000..10f11df1 --- /dev/null +++ b/release/man7/icmp.7 @@ -0,0 +1,205 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: icmp.7,v 1.8 2001/01/14 05:30:41 hanataka Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2008-12-26, Akihiro MOTOKI , LDP v3.14 +.\" +.\"WORD destination route ¹Ô¤­Àè·ÐÏ© +.\"WORD token packet filter ¥È¡¼¥¯¥ó¡¦¥Ñ¥±¥Ã¥È¡¦¥Õ¥£¥ë¥¿ +.\" +.TH ICMP 7 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +icmp, IPPROTO_ICMP \- Linux IPv4 ICMP ¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë +.SH ÀâÌÀ +¤³¤Î¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤Ï RFC\ 792 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë Internet +Control Message Protocol ¤ò¼ÂÁõ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥×¥í¥È¥³¥ë¤Ï¥¨¥é¡¼¾õ¶·¤òÃΤ餻¤¿¤ê¿ÇÃǤò¹Ô¤¦¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +¥æ¡¼¥¶¡¼¤Ï¤³¤Î¥â¥¸¥å¡¼¥ë¤È¤ÏľÀܤˤÏÄÌ¿®¤Ç¤­¤Ê¤¤¡£ +¤³¤Î¥â¥¸¥å¡¼¥ë¤Ï¥«¡¼¥Í¥ë¤Î¾¤Î¥×¥í¥È¥³¥ë¤ÈÄÌ¿®¤·¡¢ +¤½¤ì¤é¤Î¥×¥í¥È¥³¥ë¤¬ ICMP ¥¨¥é¡¼¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ì¥¤¥ä¤ËÅϤ¹¡£ +¥«¡¼¥Í¥ë¤Î ICMP ¥â¥¸¥å¡¼¥ë¤Ï ICMP ¥ê¥¯¥¨¥¹¥È¤ËÂФ¹¤ë±þÅú¤â¹Ô¤¦¡£ +.PP +raw ¥½¥±¥Ã¥È¤ò¥×¥í¥È¥³¥ë +.B IPPROTO_ICMP +¤Ç¥ª¡¼¥×¥ó¤¹¤ì¤Ð¡¢ +¥æ¡¼¥¶¡¼¥×¥í¥È¥³¥ë¤Ï¥í¡¼¥«¥ë¤Ê¥½¥±¥Ã¥ÈÁ´¤Æ¤ËÂФ¹¤ë +ICMP ¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¾ÜºÙ¤Ï +.BR raw (7) +¤ò»²¾È¤Î¤³¤È¡£ +¥½¥±¥Ã¥È¤ËÅϤµ¤ì¤ë ICMP ¥Ñ¥±¥Ã¥È¤Î¥¿¥¤¥×¤Ï +.B ICMP_FILTER +¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¥Õ¥£¥ë¥¿¡¼¤Ç¤­¤ë¡£ +ICMP ¥Ñ¥±¥Ã¥È¤Ï (¤¿¤È¤¨¥æ¡¼¥¶¡¼¥½¥±¥Ã¥È¤ËÅϤµ¤ì¤ë¾ì¹ç¤Ç¤â)¡¢ +¾ï¤Ë¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ (¤â) ½èÍý¤µ¤ì¤ë¡£ +.LP +Linux ¤Ç¤Ï ICMP ¥¨¥é¡¼¥Ñ¥±¥Ã¥È¤Î¥ì¡¼¥È¤ò¤½¤ì¤¾¤ì¤ÎÁ÷¤êÀè¤ËÂФ·¤Æ +À©¸Â¤·¤Æ¤¤¤ë¡£ +.B ICMP_REDIRECT +¤È +.B ICMP_DEST_UNREACH +¤âÅþÃ夷¤¿¥Ñ¥±¥Ã¥È¤Î¹Ô¤­Àè·ÐÏ© (destination route) ¤òÀ©¸Â¤¹¤ë¡£ +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +ICMP ¤Ç¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¥°¥í¡¼¥Ð¥ë¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë¤¿¤á¤Î +.I /proc +¥Õ¥¡¥¤¥ë·²¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤Ë¤Ï¡¢ +.I /proc/sys/net/ipv4/ +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤Î¤Û¤È¤ó¤É¤ÏÆÃÄê¤Î ICMP ¥¿¥¤¥×¤ËÂФ¹¤ë¥ì¡¼¥ÈÀ©¸Â +(rate limitation) ¤Ç¤¢¤ë¡£ +Linux 2.2 ¤Ï ICMP ¤ÎÀ©¸Â¤Ë¥È¡¼¥¯¥ó¡¦¥Ð¥±¥Ã¥È¡¦¥Õ¥£¥ë¥¿ +(token bucket filter) ¤òÍѤ¤¤ë¡£ +.\" FIXME better description needed +¤½¤ì¤¾¤ì¤ÎÃͤϡ¢¥Ð¡¼¥¹¥È¤Î¸å¤Ë¥È¡¼¥¯¥ó¡¦¥Ð¥±¥Ã¥È¡¦¥Õ¥£¥ë¥¿¤¬¥¯¥ê¥¢ +¤µ¤ì¤ë¤Þ¤Ç¤Î¥¿¥¤¥à¥¢¥¦¥È¤òÉÃñ°Ì¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ºÇ¾®Ã±°Ì(jiffy)¤Ï +¥·¥¹¥Æ¥à°Í¸¤Îñ°Ì¤Ç i386 ¥·¥¹¥Æ¥à¤ÏÄ̾ï 10ms¡¢alpha ¤ä ia64 ¤Ç¤Ï +1ms ¤Ç¤¢¤ë¡£ +.TP +.IR icmp_destunreach_rate " (Linux 2.2 ¤«¤é 2.4.9 ¤Þ¤Ç)" +.\" Precisely: from 2.1.102 +ICMP ÉÔã¥Ñ¥±¥Ã¥È (Destination Unreachable packet) ¤òÁ÷¤ëºÇÂç¥ì¡¼¥È¡£ +¤³¤ì¤ÏÆÃÄê¤Î¥ë¡¼¥È¤Þ¤¿¤Ï¹Ô¤­Àè¤Ë¥Ñ¥±¥Ã¥È¤òÁ÷¿®¤¹¤ë¥ì¡¼¥È¤òÀ©¸Â¤¹¤ë¡£ +¤³¤ÎÀ©¸Â¤Ï¡¢ +path MTU discovery ¤ËɬÍ×¤Ê +.B ICMP_FRAG_NEEDED +¥Ñ¥±¥Ã¥È¤ÎÁ÷¿®¤Ë¤Ï±Æ¶Á¤·¤Ê¤¤¡£ +.TP +.IR icmp_echo_ignore_all " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.68 +¤³¤ÎÃͤ¬Èó¥¼¥í¤Î¾ì¹ç¤Ï¡¢ Linux ¤Ï¤¹¤Ù¤Æ¤Î +.B ICMP_ECHO +Í×µá¤ò̵»ë¤¹¤ë¡£ +.TP +.IR icmp_echo_ignore_broadcasts " (Linux 2.2 °Ê¹ß)" +.\" Precisely: from 2.1.68 +¤³¤ÎÃͤ¬Èó¥¼¥í¤Î¾ì¹ç¤Ï¡¢ Linux ¤Ï¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ËÁ÷¤é¤ì¤¿¤¹¤Ù¤Æ¤Î +.B ICMP_ECHO +Í×µá¤ò̵»ë¤¹¤ë¡£ +.TP +.IR icmp_echoreply_rate " (Linux 2.2 ¤«¤é 2.4.9 ¤Þ¤Ç)" +.\" Precisely: from 2.1.102 +.B ICMP_ECHOREQUEST +¥Ñ¥±¥Ã¥È¤Ë±þÅú¤¹¤ë +.B ICMP_ECHOREPLY +¥Ñ¥±¥Ã¥È¤ÎºÇÂçÁ÷¿®¥ì¡¼¥È¡£ +.TP +.IR icmp_errors_use_inbound_ifaddr " (Boolean; default: disabled; Linux 2.6.12 °Ê¹ß)" +.\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt +¤³¤ì¤ò̵¸ú¤Ë¤¹¤ë¤È¡¢ICMP ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Ï¡¢ +½ÐÎÏ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¥×¥é¥¤¥Þ¥ê¥¢¥É¥ì¥¹¤ÇÁ÷¿®¤µ¤ì¤ë¡£ + +¤³¤ì¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Ï ICMP ¥¨¥é¡¼¤Î¸¶°ø¤È¤Ê¤Ã¤¿¥Ñ¥±¥Ã¥È¤ò +¼õ¿®¤·¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¥×¥é¥¤¥Þ¥¢¥É¥ì¥¹¤ÇÁ÷¿®¤µ¤ì¤ë¡£ +¤³¤ÎÆ°ºî¤Ï¡¢Â¿¤¯¤Î¥Í¥Ã¥È¥ï¡¼¥¯´ÉÍý¼Ô¤¬¥ë¡¼¥¿¤ËÂФ·¤Æ´üÂÔ¤·¤Æ¤¤¤ë¤â¤Î¤Ç¤¢¤ê¡¢ +¤³¤ì¤Ë¤è¤êÊ£»¨¤Ê¥Í¥Ã¥È¥ï¡¼¥¯¥ì¥¤¥¢¥¦¥È¤Î¥Ç¥Ð¥Ã¥°¤¬¤è¤êÍưפˤʤ롣 + +ÁªÂò¤µ¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¥×¥é¥¤¥Þ¥ê¥¢¥É¥ì¥¹¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢ +¤³¤ÎÀßÄê¤Ë´Ø¤ï¤é¤º¡¢ºÇ½é¤Î¥ë¡¼¥×¥Ð¥Ã¥¯°Ê³°¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¡¢ +¥×¥é¥¤¥Þ¥ê¥¢¥É¥ì¥¹¤ò»ý¤Ä¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¥×¥é¥¤¥Þ¥ê¥¢¥É¥ì¥¹¤¬»ÈÍѤµ¤ì¤ëÅÀ¤Ë +Ãí°Õ¤¹¤ë¤³¤È¡£ +.TP +.IR icmp_ignore_bogus_error_responses " (Boolean; default: disabled; Linux 2.2 °Ê¹ß)" +.\" precisely: since 2.1.32 +.\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt +¥ë¡¼¥¿¤ÎÃæ¤Ë¤Ï¡¢RFC1122 ¤Ë°ãÈ¿¤·¡¢¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥Õ¥ì¡¼¥à¤ËÂФ·¤Æ +µ¶¤Î±þÅú¤òÁ÷¿®¤¹¤ë¤â¤Î¤¬¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê°ãÈ¿¤ÏÄ̾參¡¼¥Í¥ë¤Î·Ù¹ð¤È¤·¤Æ¥í¥°¤Ëµ­Ï¿¤µ¤ì¤ë¡£ +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï¤³¤Î¤è¤¦¤Ê·Ù¹ð¤ò½Ð¤µ¤Ê¤¯¤Ê¤ê¡¢ +¥í¥°¥Õ¥¡¥¤¥ë¤Ë»¨²»¤Î¤è¤¦¤Ê¾ðÊ󤬵­Ï¿¤µ¤ì¤ë¤Î¤òÈò¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.IR icmp_paramprob_rate " (Linux 2.2 ¤«¤é 2.4.9 ¤Þ¤Ç)" +.\" Precisely: from 2.1.102 +.B ICMP_PARAMETERPROB +¥Ñ¥±¥Ã¥È¤ÎºÇÂçÁ÷¿®¥ì¡¼¥È¡£ +¤³¤ì¤é¤Î¥Ñ¥±¥Ã¥È¤ÏÉÔÀµ¤Ê IP ¥Ø¥Ã¥À¤ò»ý¤Ä¥Ñ¥±¥Ã¥È¤¬ÅþÃ夷¤¿¾ì¹ç¤Ë +Á÷¿®¤µ¤ì¤ë¡£ +.TP +.IR icmp_ratelimit " (integer; default: 1000; Linux 2.4.10 °Ê¹ß)" +.\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt +¼ïÊ̤¬ +.I icmp_ratemask +(²¼µ­»²¾È) ¤Ë¥Þ¥Ã¥Á¤·¤¿ ICMP ¥Ñ¥±¥Ã¥È¤Î¡¢ +ÆÃÄê¤ÎÁ÷¿®Àè¤Ø¤ÎÁ÷¿®¥ì¡¼¥È¤ÎºÇÂçÃͤòÀ©¸Â¤¹¤ë¡£ +0 ¤Ï¥ì¡¼¥ÈÀ©¸Â¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤ò¡¢ +0 °Ê³°¤ÎÃͤϱþÅú´Ö¤ÎºÇ¾®´Ö³Ö (¥ß¥êÉÃñ°Ì) ¤ò¼¨¤¹¡£ +.TP +.IR icmp_ratemask " (integer; default: ²¼µ­»²¾È; Linux 2.4.10 °Ê¹ß)" +.\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt +¥ì¡¼¥ÈÀ©¸Â¤ò¹Ô¤¦ ICMP ¥¿¥¤¥×¤ò·è¤á¤ë¥Þ¥¹¥¯¡£ + +Í­¸ú¥Ó¥Ã¥È: IHGFEDCBA9876543210 +.br +¥Ç¥Õ¥©¥ë¥È¥Þ¥¹¥¯: 0000001100000011000 (0x1818) + +¥Ó¥Ã¥ÈÄêµÁ (¥«¡¼¥Í¥ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë +.I include/linux/icmp.h +¤ò»²¾È): + +.in +4n +.nf +0 Echo Reply +3 Destination Unreachable * +4 Source Quench * +5 Redirect +8 Echo Request +B Time Exceeded * +C Parameter Problem * +D Timestamp Request +E Timestamp Reply +F Info Request +G Info Reply +H Address Mask Request +I Address Mask Reply +.fi +.in + +¥¢¥¹¥¿¥ê¥¹¥¯°õ¤¬ÉÕ¤¤¤¿¥Ó¥Ã¥È¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¥ì¡¼¥ÈÀ©¸Â¤¬Í­¸ú¤Ë +¤Ê¤Ã¤Æ¤¤¤ë (¾åµ­¤Î¥Þ¥¹¥¯¤Î¥Ç¥Õ¥©¥ë¥È¤â»²¾È)¡£ +.TP +.IR icmp_timeexceed_rate " (Linux 2.2 ¤«¤é 2.4.9 ¤Þ¤Ç)" +.B ICMP_TIME_EXCEEDED +¥Ñ¥±¥Ã¥È¤ÎºÇÂçÁ÷¿®¥ì¡¼¥È¡£ +¤³¤ì¤é¤Î¥Ñ¥±¥Ã¥È¤Ï¥Ñ¥±¥Ã¥È¤¬¤¢¤Þ¤ê¤Ë¿¤¯¤Î hop ¤òÄ̲ᤷ¤¿¾ì¹ç¤Ë¡¢ +¥ë¡¼¥×¤òËɤ°¤¿¤á¤ËÁ÷¤é¤ì¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.B ICMP_ADDRESS +Í×µá¤ËÂФ¹¤ë¥µ¥Ý¡¼¥È¤Ï 2.2 ¤Çºï½ü¤µ¤ì¤¿¡£ +.PP +.B ICMP_SOURCE_QUENCH +¤Ï Linux 2.2 ¤Çºï½ü¤µ¤ì¤¿¡£ +.SH Ãí°Õ +¾¤Î¿¤¯¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.B IPPROTO_ICMP +raw ¥½¥±¥Ã¥È¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤Îµ¡Ç½¤Ï°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¤ÏÍѤ¤¤ë¤Ù¤­¤Ç¤Ê¤¤¡£ +.\" not really true ATM +.\" .PP +.\" Linux ICMP should be compliant to RFC 1122. +.PP +Linux ¤¬¥ë¡¼¥¿¡¼¤È¤·¤ÆÆ°ºî¤·¤Æ¤¤¤Ê¤¤¤È¤­¤Ë¤Ï¡¢ +.B ICMP_REDIRECT +¥Ñ¥±¥Ã¥È¤ÏÁ÷¿®¤µ¤ì¤Ê¤¤¡£ +¤Þ¤¿¤³¤ì¤é¤¬¼õ¤±¼è¤é¤ì¤ë¤Î¤â¡¢È¯¿®¸µ¤¬¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +¸Å¤¤¥²¡¼¥È¥¦¥§¥¤¤Ç¡¢¥ê¥À¥¤¥ì¥¯¥È¡¦¥ë¡¼¥È (redirect route) ¤¬ +ŬÅö¤Ê»þ´Ö¤Î¸å¤Ë´ü¸ÂÀÚ¤ì¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¸Â¤é¤ì¤ë¡£ +.PP +.B ICMP_TIMESTAMP +¤«¤éÊÖ¤µ¤ì¤ë 64 ¥Ó¥Ã¥È¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤Ï¡¢ +µª¸µ (Epoch) ¤Ç¤¢¤ë 1970-01-01 00:00:00 +0000 (UTC) +¤«¤é¤Î·Ð²á»þ´Ö¤ò¥ß¥êÉÃñ°Ì¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.PP +Linux ICMP ¤Ï ICMP ¤òÁ÷¤ë¤¿¤á¤ËÆâÉô¤Ç raw ¥½¥±¥Ã¥È¤òÍѤ¤¤ë¡£ +raw ¥½¥±¥Ã¥È¤Ï +.BR netstat (8) +¤Î½ÐÎÏ¤Ë 0 inode ¤È¤·¤Æ½ÐÎϤµ¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ip (7) +.PP +.BR RFC\ 792 : +ICMP ¥×¥í¥È¥³¥ë¤ÎÀâÌÀ diff --git a/release/man7/inotify.7 b/release/man7/inotify.7 new file mode 100644 index 00000000..2492786c --- /dev/null +++ b/release/man7/inotify.7 @@ -0,0 +1,418 @@ +'\" 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" +.SH ̾Á° +inotify \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¤¥Ù¥ó¥È¤ò´Æ»ë¤¹¤ë +.SH ÀâÌÀ +.I inotify +API ¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¤¥Ù¥ó¥È¤ò´Æ»ë¤¹¤ë¤¿¤á¤Îµ¡¹½¤òÄ󶡤¹¤ë¡£ +inotify ¤Ï¸Ä¡¹¤Î¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤ò´Æ»ë¤¹¤ë¤Î¤Ë»È¤¨¤ë¡£ +¥Ç¥£¥ì¥¯¥È¥ê¤ò´Æ»ë¤¹¤ë¾ì¹ç¡¢inotify ¤Ï¥Ç¥£¥ì¥¯¥È¥ê¼«¿È¤È +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤Î¥¤¥Ù¥ó¥È¤òÊÖ¤¹¡£ + +°Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤³¤Î 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). + +.BR inotify_init (2) +¤Ï inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤òºîÀ®¤·¡¢inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤ò»²¾È¤¹¤ë +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +¤â¤Ã¤È¿·¤·¤¤ +.BR inotify_init1 (2) +¤â +.BR inotify_init (2) +¤ÈƱÍͤÀ¤¬¡¢¤¤¤¯¤Ä¤«¤ÎÄɲäε¡Ç½¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£ + +.BR inotify_add_watch (2) +¤Ï inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¡Ö´Æ»ëÂÐ¾Ý (watch) ¥ê¥¹¥È¡×¤òÁàºî¤¹¤ë¡£ +´Æ»ëÂоݥꥹ¥È¤Î³Æ¥¢¥¤¥Æ¥à ("watch") ¤Ï¡¢ +¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¥¹Ì¾¤È¡¢ +¤½¤Î¥Ñ¥¹Ì¾¤Ç»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +¥«¡¼¥Í¥ë¤¬´Æ»ë¤¹¤ëÊ£¿ô¤Î¥¤¥Ù¥ó¥È¤Î½¸¹ç¤ò»ØÄꤹ¤ë¡£ +.BR inotify_add_watch (2) +¤Ï¿·¤·¤¤´Æ»ë¥¢¥¤¥Æ¥à¤ÎºîÀ®¤ä´û¸¤Î´Æ»ëÂоݤÎÊѹ¹¤¬¤Ç¤­¤ë¡£ +³Æ´Æ»ëÂоݤϰì°Õ¤Î¡Ö´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿¡×¤ò»ý¤Ä¡£ +¤³¤ì¤Ï´Æ»ëÂоݤòºîÀ®¤·¤¿¤È¤­¤Ë +.BR inotify_add_watch (2) +¤«¤éÊÖ¤µ¤ì¤ëÀ°¿ô¤Ç¤¢¤ë¡£ + +.BR inotify_rm_watch (2) +¤Ï inotify ¤Î´Æ»ëÂоݥꥹ¥È¤«¤é¥¢¥¤¥Æ¥à¤òºï½ü¤¹¤ë¡£ + +inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤ò»Ø¤·¤Æ¤¤¤ë +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿¾ì¹ç¡¢ +¤½¤Î²¼Áؤˤ¢¤ë¥ª¥Ö¥¸¥§¥¯¥È¤È¤½¤Î¥ê¥½¡¼¥¹¤Ï¡¢ +¥«¡¼¥Í¥ë¤ÇºÆÍøÍѤ¹¤ë¤¿¤á¤Ë²òÊü¤µ¤ì¤ë¡£ +´ØÏ¢¤¬ÀÚ¤é¤ì¤¿´Æ»ëÂоݤϼ«Æ°Åª¤Ë²òÊü¤µ¤ì¤ë¡£ + +¤É¤Î¤è¤¦¤Ê¥¤¥Ù¥ó¥È¤¬µ¯¤³¤Ã¤Æ¤¤¤¿¤«¤òÃΤë¤Ë¤Ï¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç inotify ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò +.BR read (2) +¤¹¤ì¤Ð¤è¤¤¡£ +¤³¤ì¤Þ¤Ç¤Ë²¿¤â¥¤¥Ù¥ó¥È¤¬µ¯¤³¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +Ää»ß (blocking) ¥â¡¼¥É¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ì¤Ð¡¢ +¾¯¤Ê¤¯¤È¤â 1 ¤Ä¤Î¥¤¥Ù¥ó¥È¤¬µ¯¤³¤ë¤Þ¤Ç +.BR read (2) +¤ÏÄä»ß¤¹¤ë (¥·¥°¥Ê¥ë¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡£ +¥·¥°¥Ê¥ë¤Ë¤è¤ë³ä¤ê¹þ¤ß¤¬¤¢¤Ã¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼ +.BR EINTR +¤Ç¼ºÇÔ¤¹¤ë¡£ +.BR signal (7) +»²¾È)¡£ + +.BR read (2) +¤¬À®¸ù¤¹¤ë¤È¡¢°Ê²¼¤Î¹½Â¤ÂΤò 1 ¤Ä°Ê¾å´Þ¤à¥Ð¥Ã¥Õ¥¡¤¬ÊÖ¤µ¤ì¤ë: +.in +4n +.nf + +struct inotify_event { + 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 + uint32_t mask; /* ¥¤¥Ù¥ó¥È¤Î¥Þ¥¹¥¯ */ + uint32_t cookie; /* ´ØÏ¢¤¹¤ë¥¤¥Ù¥ó¥È·²¤ò´ØÏ¢¤Å¤±¤ë + °ì°Õ¤Ê¥¯¥Ã¥­¡¼ (rename(2) ÍÑ) */ + uint32_t len; /* \(aqname\(aq ¥Õ¥£¡¼¥ë¥É¤Î¥µ¥¤¥º */ + char name[]; /* NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ç¤°Õ¤Î̾Á° */ +}; +.fi +.in + +.I wd +¤Ï¥¤¥Ù¥ó¥ÈȯÀ¸¤Î´Æ»ëÂоݤò»ØÄꤹ¤ë¡£ +¤³¤ì¤Ï¡¢Á°¤â¤Ã¤Æ¹Ô¤ï¤ì¤¿ +.BR inotify_add_watch (2) +¸Æ¤Ó½Ð¤·¤ÇÊÖ¤µ¤ì¤¿´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿¤Î¤¦¤Á¤Î 1 ¤Ä¤Ç¤¢¤ë¡£ + +.I mask +¤Ë¤ÏȯÀ¸¤·¤¿¥¤¥Ù¥ó¥È (²¼µ­»²¾È) ¤òµ­½Ò¤¹¤ë¤¿¤á¤Î¥Ó¥Ã¥È¤¬´Þ¤Þ¤ì¤ë¡£ + +.I cookie +¤Ï´ØÏ¢¤¹¤ë¥¤¥Ù¥ó¥È¤ò´ØÏ¢¤Å¤±¤ë¤¿¤á¤Î°ì°Õ¤ÊÀ°¿ô¤Ç¤¢¤ë¡£ +¸½ºß¤Î¤È¤³¤í¡¢¤³¤ÎÃÍ¤Ï rename ¥¤¥Ù¥ó¥È¤ËÂФ·¤Æ¤Î¤ß»È¤ï¤ì¤Æ¤ª¤ê¡¢ +·ë²Ì¤Î¥Ú¥¢¤Ç¤¢¤ë +.B IN_MOVE_FROM +¤È +.B IN_MOVE_TO +¥¤¥Ù¥ó¥È¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç´ØÏ¢¤Å¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.I name +¥Õ¥£¡¼¥ë¥É¤Ï´Æ»ë¤·¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +¥¤¥Ù¥ó¥È¤¬ÊÖ¤µ¤ì¤ë¾ì¹ç¤Î¤¿¤á¤Ë¤À¤±Â¸ºß¤¹¤ë¡£ +´Æ»ë¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î¥Õ¥¡¥¤¥ë¤ÎÁêÂХѥ¹Ì¾¤òɽ¤¹¡£ +¤³¤Î¥Ñ¥¹Ì¾¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¡¢ +¤½¤Î¸å¤ÎÆɤ߹þ¤ß¤ÇŬÀڤʥ¢¥É¥ì¥¹¶­³¦¤ËÄ´À°¤¹¤ë¤¿¤á¤Ë¡¢ +¤µ¤é¤Ë NULL ¥Ð¥¤¥È¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¤â¤¢¤ë¡£ + +.I len +¥Õ¥£¡¼¥ë¥É¤Ï NULL ¥Ð¥¤¥È¤ò´Þ¤à +.I name +¤ÎÁ´¤Æ¤Î¥Ð¥¤¥È¿ô¤òɽ¤¹¡£ +¤è¤Ã¤Æ¡¢ +.I inotify_event +¹½Â¤ÂΤΥµ¥¤¥º¤Ï +.I "sizeof(inotify_event)+len" +¤Ç¤¢¤ë¡£ + +.BR read (2) +¤ËÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ¤¹¤®¤Æ¼¡¤Î¥¤¥Ù¥ó¥È¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÖ¤»¤Ê¤¤ +¾ì¹ç¤ÎÆ°ºî¤Ï¥«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê°Û¤Ê¤ë¡£ +2.6.21 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.BR read (2) +¤Ï 0 ¤òÊÖ¤¹¡£ +2.6.21 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ +.BR read (2) +¤Ï¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë¡£ +.SS inotify ¥¤¥Ù¥ó¥È +.BR inotify_add_watch (2) +¤Î +.I mask +°ú¤­¿ô¤È¡¢inotify ¥Õ¥¡¥¤¥ë¹½Â¤ÂΤò +.BR read (2) +¤·¤¿¤È¤­¤ËÊÖ¤µ¤ì¤ë +.I inotify_event +¹½Â¤ÂΤΠ+.I mask +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤È¤â¤Ë inotify ¥¤¥Ù¥ó¥È¤ò¼±Ê̤¹¤ë¤¿¤á¤Î +¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£ +°Ê²¼¤Î¥Ó¥Ã¥È¤¬ +.BR inotify_add_watch (2) +¤ò¸Æ¤Ö¤È¤­¤Î +.I mask +¤Ë»ØÄê²Äǽ¤Ç¤¢¤ê¡¢ +.BR read (2) +¤ÇÊÖ¤µ¤ì¤ë +.I mask +¥Õ¥£¡¼¥ë¥É¤ÇÊÖ¤µ¤ì¤ë: +.RS 4 +.sp +.PD 0 +.TP 18 +.B IN_ACCESS +¥Õ¥¡¥¤¥ë¤¬¥¢¥¯¥»¥¹ (read) ¤µ¤ì¤¿¡£(*) +.TP +.B IN_ATTRIB +¥á¥¿¥Ç¡¼¥¿¤¬Êѹ¹¤µ¤ì¤¿¡£ +¥á¥¿¥Ç¡¼¥¿¤È¤Ï¡¢Î㤨¤Ð¡¢µö²Ä (permission)¡¢¥¿¥¤¥à¥¹¥¿¥ó¥×¡¢³Èĥ°À­¡¢ +¥ê¥ó¥¯¥«¥¦¥ó¥È (Linux 2.6.25 °Ê¹ß)¡¢UID¡¢GID ¤Ê¤É¤Ç¤¢¤ë¡£(*) +.TP +.B IN_CLOSE_WRITE +½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿¡£(*) +.TP +.B IN_CLOSE_NOWRITE +½ñ¤­¹þ¤ß°Ê³°¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿¡£(*) +.TP +.B IN_CREATE +´Æ»ëÂоݥǥ£¥ì¥¯¥È¥êÆâ¤Ç¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤¬ºîÀ®¤µ¤ì¤¿¡£(*) +.TP +.B IN_DELETE +´Æ»ëÂоݥǥ£¥ì¥¯¥È¥êÆâ¤Ç¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤¬ºï½ü¤µ¤ì¤¿¡£(*) +.TP +.B IN_DELETE_SELF +´Æ»ëÂоݤΥǥ£¥ì¥¯¥È¥ê¤Þ¤¿¤Ï¥Õ¥¡¥¤¥ë¼«¿È¤¬ºï½ü¤µ¤ì¤¿¡£ +.TP +.B IN_MODIFY +¥Õ¥¡¥¤¥ë¤¬½¤Àµ¤µ¤ì¤¿¡£(*) +.TP +.B IN_MOVE_SELF +´Æ»ëÂоݤΥǥ£¥ì¥¯¥È¥ê¤Þ¤¿¤Ï¥Õ¥¡¥¤¥ë¼«¿È¤¬°ÜÆ°¤µ¤ì¤¿¡£ +.TP +.B IN_MOVED_FROM +¥Õ¥¡¥¤¥ë¤¬´Æ»ëÂоݥǥ£¥ì¥¯¥È¥ê³°¤Ø°ÜÆ°¤µ¤ì¤¿¡£(*) +.TP +.B IN_MOVED_TO +¥Õ¥¡¥¤¥ë¤¬´Æ»ëÂоݥǥ£¥ì¥¯¥È¥êÆâ¤Ø°ÜÆ°¤µ¤ì¤¿¡£(*) +.TP +.B IN_OPEN +¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¡£(*) +.PD +.RE +.PP +¥Ç¥£¥ì¥¯¥È¥ê¤ò´Æ»ë¤¹¤ë¾ì¹ç¡¢ +¾åµ­¤Ç¥¢¥¹¥¿¥ê¥¹¥¯ (*) ¤òÉÕ¤±¤¿¥¤¥Ù¥ó¥È¤Ï¡¢ +¤½¤Î¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤ÆȯÀ¸¤¹¤ë¡£ +¤³¤Î¤È¤­ +.I inotify_event +¹½Â¤ÂΤÇÊÖ¤µ¤ì¤ë +.I name +¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë̾¤òɽ¤¹¡£ +.PP +.B IN_ALL_EVENTS +¥Þ¥¯¥í¤Ï¾åµ­¤Î¥¤¥Ù¥ó¥ÈÁ´¤Æ¤Î¥Þ¥¹¥¯¤È¤·¤ÆÄêµÁ¤µ¤ì¤ë¡£ +¤³¤Î¥Þ¥¯¥í¤Ï +.BR inotify_add_watch (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¤­¤Î +.I mask +°ú¤­¿ô¤È¤·¤Æ»È¤¨¤ë¡£ + +¤µ¤é¤Ë 2 ¤Ä¤ÎÊØÍø¤Ê¥Þ¥¯¥í¤¬¤¢¤ë¡£ +.B IN_MOVE +¤Ï +IN_MOVED_FROM|IN_MOVED_TO +¤ÈÅù¤·¤¯¡¢ +.B IN_CLOSE +¤Ï +IN_CLOSE_WRITE|IN_CLOSE_NOWRITE +¤ÈÅù¤·¤¤¡£ +.PP +¤½¤Î¾¤Ë¤â°Ê²¼¤Î¥Ó¥Ã¥È¤ò +.BR inotify_add_watch (2) +¤ò¸Æ¤Ö¤È¤­¤Î +.I mask +¤Ë»ØÄê¤Ç¤­¤ë: +.RS 4 +.sp +.PD 0 +.TP 18 +.B IN_DONT_FOLLOW +\fIpathname\fP ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¤Ëé¤é¤Ê¤¤¡£ +(Linux 2.6.15 °Ê¹ß) +.TP +.B IN_MASK_ADD +\fIpathname\fP ¤ËÂФ¹¤ë´Æ»ë¥Þ¥¹¥¯¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢ +(¥Þ¥¹¥¯¤ÎÃÖ¤­´¹¤¨¤Ç¤Ï¤Ê¤¯) ¥¤¥Ù¥ó¥È¤òÄɲà (OR) ¤¹¤ë¡£ +.TP +.B IN_ONESHOT +1 ¤Ä¤Î¥¤¥Ù¥ó¥È¤Ë¤Ä¤¤¤Æ \fIpathname\fP ¤ò´Æ»ë¤·¡¢ +¥¤¥Ù¥ó¥È¤¬È¯À¸¤·¤¿¤é´Æ»ëÂоݥꥹ¥È¤«¤éºï½ü¤¹¤ë¡£ +.TP +.BR IN_ONLYDIR " (Linux 2.6.15 °Ê¹ß)" +\fIpathname\fP ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¤Ë¤Î¤ß´Æ»ë¤¹¤ë¡£ +.PD +.RE +.PP +°Ê²¼¤Î¥Ó¥Ã¥È¤¬ +.BR read (2) +¤ÇÊÖ¤µ¤ì¤ë +.I mask +¥Õ¥£¡¼¥ë¥É¤ËÀßÄꤵ¤ì¤ë: +.RS 4 +.sp +.PD 0 +.TP 18 +.B IN_IGNORED +´Æ»ëÂоݤ¬ (\fBinotify_rm_watch\fP(2) ¤Ë¤è¤ê) ÌÀ¼¨Åª¤Ë +ºï½ü¤µ¤ì¤¿¡£¤â¤·¤¯¤Ï (¥Õ¥¡¥¤¥ë¤Îºï½ü¡¢¤Þ¤¿¤Ï¥Õ¥¡¥¤¥ë +¥·¥¹¥Æ¥à¤Î¥¢¥ó¥Þ¥¦¥ó¥È¤Ë¤è¤ê) ¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤¿¡£ +.TP +.B IN_ISDIR +¤³¤Î¥¤¥Ù¥ó¥È¤ÎÂоݤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¡£ +.TP +.B IN_Q_OVERFLOW +¥¤¥Ù¥ó¥È¥­¥å¡¼¤¬°î¤ì¤¿ (¤³¤Î¥¤¥Ù¥ó¥È¤Î¾ì¹ç¡¢\fIwd\fP ¤Ï \-1 ¤Ç¤¢¤ë)¡£ +.TP +.B IN_UNMOUNT +´Æ»ëÂоݥª¥Ö¥¸¥§¥¯¥È¤ò´Þ¤à¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥¢¥ó¥Þ¥¦¥ó¥È¤µ¤ì¤¿¡£ +.PD +.RE +.SS /proc ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +°Ê²¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï¡¢inotify ¤Ç¾ÃÈñ¤µ¤ì¤ë +¥«¡¼¥Í¥ë¥á¥â¥ê¤ÎÁíÎ̤òÀ©¸Â¤¹¤ë¤Î¤Ë»ÈÍѤǤ­¤ë: +.TP +.I /proc/sys/fs/inotify/max_queued_events +¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÃͤϡ¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ +.BR inotify_init (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¤­¤Ë»ÈÍѤµ¤ì¡¢Âбþ¤¹¤ë inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤Ë¤Ä¤¤¤Æ +¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¥¤¥Ù¥ó¥È¤Î¿ô¤Î¾å¸Â¤òÀßÄꤹ¤ë¡£ +¤³¤ÎÀ©¸Â¤òĶ¤¨¤¿¥¤¥Ù¥ó¥È¤ÏÇË´þ¤µ¤ì¤ë¤¬¡¢ +.B IN_Q_OVERFLOW +¥¤¥Ù¥ó¥È¤¬¾ï¤ËÀ¸À®¤µ¤ì¤ë¡£ +.TP +.I /proc/sys/fs/inotify/max_user_instances +1 ¤Ä¤Î¼Â¥æ¡¼¥¶ ID ¤ËÂФ·¤ÆÀ¸À®¤Ç¤­¤ë +inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤Î¿ô¤Î¾å¸Â¤ò»ØÄꤹ¤ë¡£ +.TP +.I /proc/sys/fs/inotify/max_user_watches +ºîÀ®²Äǽ¤Ê´Æ»ëÂоݤοô¤Î¼Â UID ñ°Ì¤Î¾å¸Â¤ò»ØÄꤹ¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +inotify ¤Ï 2.6.13 ¤Î Linux ¥«¡¼¥Í¥ë¤ËÁȹþ¤Þ¤ì¤¿¡£ +¤³¤ì¤ËɬÍפʥ饤¥Ö¥é¥ê¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï¡¢ +glibc ¤Î¥Ð¡¼¥¸¥ç¥ó 2.4 ¤ËÄɲ䵤줿 +.RB ( IN_DONT_FOLLOW , +.BR IN_MASK_ADD , +.B IN_ONLYDIR +¤À¤±¤Ï¥Ð¡¼¥¸¥ç¥ó 2.5 ¤ÇÄɲ䵤줿)¡£ +.SH ½àµò +inotify API ¤Ï Linux Æȼ«¤Î¤â¤Î¤Ç¤¢¤ë¡£ +.SH Ãí°Õ +inotify ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï +.BR select (2), +.BR poll (2), +.BR epoll (7) +¤ò»È¤Ã¤Æ´Æ»ë¤Ç¤­¤ë¡£ +¥¤¥Ù¥ó¥È¤¬¤¢¤ë¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÆɤ߹þ¤ß²Äǽ¤ÈÄÌÃΤ¹¤ë¡£ + +Linux 2.6.25 °Ê¹ß¤Ç¤Ï¡¢¥·¥°¥Ê¥ë¶îÆ° (signal-driven) I/O ¤ÎÄÌÃΤ¬ +inotify ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤Ä¤¤¤ÆÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +.BR fcntl (2) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë +.RB ( O_ASYNC +¥Õ¥é¥°¤òÀßÄꤹ¤ë¤¿¤á¤Î) +.BR F_SETFL , +.BR F_SETOWN , +.B F_SETSIG +¤ÎµÄÏÀ¤ò»²¾È¤Î¤³¤È¡£ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ËÅϤµ¤ì¤ë +.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 +¤¬ÀßÄꤵ¤ì¤ë¡£ + +inotify ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤Æ +Ϣ³¤·¤ÆÀ¸À®¤µ¤ì¤ë½ÐÎÏ inotify ¥¤¥Ù¥ó¥È¤¬Æ±°ì¤Î¾ì¹ç +.RI ( wd , +.IR mask , +.IR cookie , +.I name +¤¬Åù¤·¤¤¾ì¹ç)¡¢ +Á°¤Î¥¤¥Ù¥ó¥È¤¬¤Þ¤ÀÆɤ߹þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +Ϣ³¤¹¤ë¥¤¥Ù¥ó¥È¤¬ 1 ¤Ä¤Î¥¤¥Ù¥ó¥È¤Ë¤Þ¤È¤á¤é¤ì¤ë +(¤¿¤À¤·¡Ö¥Ð¥°¡×¤ÎÀá¤â»²¾È¤Î¤³¤È)¡£ + +inotify ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÆɤ߹þ¤ß¤ÇÊÖ¤µ¤ì¤ë¥¤¥Ù¥ó¥È¤Ï¡¢ +½ç½øÉÕ¤±¤é¤ì¤¿¥­¥å¡¼¤Ë¤Ê¤ë¡£ +½¾¤Ã¤Æ¡¢¤¿¤È¤¨¤Ð¡¢¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î̾Á°¤òÊ̤Î̾Á°¤ËÊѹ¹¤·¤¿¾ì¹ç¡¢ +inotify ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤Ä¤¤¤Æ¤ÎÀµ¤·¤¤½çÈÖ¤Ç +¥¤¥Ù¥ó¥È¤¬À¸À®¤µ¤ì¤ë¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ + +.B FIONREAD +.BR ioctl (2) +¤Ï inotify ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é²¿¥Ð¥¤¥ÈÆɤ߹þ¤á¤ë¤«¤òÊÖ¤¹¡£ + +inotify ¤Ë¤è¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î´Æ»ë¤ÏºÆµ¢Åª¤Ë¹Ô¤ï¤ì¤Ê¤¤: +¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ò´Æ»ë¤¹¤ë¾ì¹ç¡¢ +´Æ»ëÂоݤòÄɲäǺîÀ®¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SH ¥Ð¥° +2.6.16 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï +.B IN_ONESHOT +.I mask +¥Õ¥é¥°¤¬Æ¯¤«¤Ê¤¤¡£ + +¥«¡¼¥Í¥ë 2.6.25 ¤è¤êÁ°¤Ç¤Ï¡¢ +Ϣ³¤¹¤ëƱ°ì¤Î¥¤¥Ù¥ó¥È¤ò°ì¤Ä¤Ë¤Þ¤È¤á¤ë¤³¤È¤ò°Õ¿Þ¤·¤¿¥³¡¼¥É +(¸Å¤¤Êý¤Î¥¤¥Ù¥ó¥È¤¬¤Þ¤ÀÆɤ߹þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¡¢ +ºÇ¿·¤Î 2 ¤Ä¤Î¥¤¥Ù¥ó¥È¤ò°ì¤Ä¤Ë¤Þ¤È¤á¤é¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë) ¤¬¡¢ +ºÇ¿·¤Î¥¤¥Ù¥ó¥È¤¬¡ÖºÇ¤â¸Å¤¤¡×Æɤ߹þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¥¤¥Ù¥ó¥È¤È¤Þ¤È¤á¤é¤ì¤ë¤« +¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£ +.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/release/man7/intro.7 b/release/man7/intro.7 new file mode 100644 index 00000000..a8fca0d5 --- /dev/null +++ b/release/man7/intro.7 @@ -0,0 +1,45 @@ +.\" Copyright (c) 1993 Michael Haardt +.\" (michael@moria.de), Fri Apr 2 11:32:09 MET DST +.\" 1993 +.\" +.\" 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 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 +.\" +.TH INTRO 7 2007-10-23 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +intro \- ³µÍס¢´·½¬¤ä¤½¤Î¾¤ÎÀâÌÀ +.SH ÀâÌÀ +¥Þ¥Ë¥å¥¢¥ë¤Î 7 ¾Ï¤Ë¤ÏÍÍ¡¹¤Ê»öÊÁ¤Î³µÍפ¬½ñ¤«¤ì¤Æ¤¤¤ë¡£ +½¬´·¡¢¥×¥í¥È¥³¥ë¡¢Ê¸»ú½¸¹ç¤Îµ¬³Ê¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¹½À®¡¢ +¤½¤Î¾¤Î»¨Â¿¤Ê¤³¤È¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤ë¡£ +.SH È÷¹Í +.SS Ãø¼Ô¤ÈÃøºî¸¢ +Ãø¼Ô¤ÈÃøºî¸¢(copyright)¤Ë´Ø¤·¤Æ¤Ï³Æ¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸¤Î¥½¡¼¥¹¤Î¥Ø¥Ã¥À¤ò¸«¤ë¤³¤È¡£ +¤³¤ì¤é¤Ï¥Ú¡¼¥¸¤´¤È¤Ë°Û¤Ã¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR standards (7) diff --git a/release/man7/ip.7 b/release/man7/ip.7 new file mode 100644 index 00000000..b0063ddb --- /dev/null +++ b/release/man7/ip.7 @@ -0,0 +1,1074 @@ +'\" t +.\" Don't change the line above. it tells man that tbl is needed. +.\" This man page is Copyright (C) 1999 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. +.\" $Id: ip.7,v 1.19 2000/12/20 18:10:31 ak Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2001-02-14, Kentaro Shirakata +.\" Updated 2001-04-04, Yuichi SATO +.\" Updated & Modified 2003-10-16, Yuichi SATO +.\" Updated & Modified 2005-01-22, Yuichi SATO +.\" Updated & Modified 2005-09-10, Akihiro MOTOKI +.\" Updated & Modified 2005-10-06, Akihiro MOTOKI +.\" Updated 2007-01-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.43 +.\" Updated 2007-05-28, Akihiro MOTOKI , LDP v2.48 +.\" Updated 2008-12-26, Akihiro MOTOKI , LDP v3.14 +.\" +.\"WORD ancillary message Êä½õ¥á¥Ã¥»¡¼¥¸ +.\"WORD ... oriented ¡Á»Ø¸þ¤Î +.\"WORD capability ¸¢¸Â +.\"WORD payload ¥Ú¥¤¥í¡¼¥É +.\"WORD drop(ped) (¥Ñ¥±¥Ã¥È¤ò) Íî¤È¤¹¡¢(¼õÆ°¤Î¾ì¹ç) ÅþÃ夷¤Ê¤¤ +.\"WORD tap ¥¿¥Ã¥×(¤¹¤ë) +.\" +.TH IP 7 2009-02-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ip \- Linux IPv4 ¥×¥í¥È¥³¥ë¤Î¼ÂÁõ +.SH ½ñ¼° +.B #include +.br +.\" .B #include -- does not exist anymore +.\" .B #include -- never include +.B #include +.br +.B #include \fR/* ¾åµ­¤Î¥¹¡¼¥Ñ¡¼¥»¥Ã¥È */ +.sp +.IB tcp_socket " = socket(AF_INET, SOCK_STREAM, 0);" +.br +.IB udp_socket " = socket(AF_INET, SOCK_DGRAM, 0);" +.br +.IB raw_socket " = socket(AF_INET, SOCK_RAW, " protocol ");" +.SH ÀâÌÀ +Linux ¤Ï RFC\ 791 ¤È RFC\ 1122 ¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤ë +Internet Protocol, version 4 ¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +.B ip +¤Ë¤Ï RFC\ 1112 ¤Ë½àµò¤·¤¿ level 2 ¥Þ¥ë¥Á¥­¥ã¥¹¥È¤Î¼ÂÁõ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¤Þ¤¿¥Ñ¥±¥Ã¥È¥Õ¥£¥ë¥¿µ¡Ç½¤ò´Þ¤à IP ¥ë¡¼¥¿¡¼¤â¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" FIXME has someone verified that 2.1 is really 1812 compliant? +.PP +¥×¥í¥°¥é¥ß¥ó¥°¡¦¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï BSD ¥½¥±¥Ã¥È¤È¸ß´¹¤Ç¤¢¤ë¡£ +¥½¥±¥Ã¥È¤Ë´Ø¤¹¤ë¤è¤ê¾ÜºÙ¤Ê¾ðÊó¤Ï +.BR socket (7) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +IP ¥½¥±¥Ã¥È¤Ï¡¢ +.BR socket (2) +´Ø¿ô¤ò +.B "socket(AF_INET, socket_type, protocol)" +¤Î¤è¤¦¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤ÇÀ¸À®¤µ¤ì¤ë¡£ +»ØÄê¤Ç¤­¤ë¥½¥±¥Ã¥È¥¿¥¤¥×¤Ï 3 ¤Ä¤¢¤ê¡¢ +.BR tcp (7) +¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¾ì¹ç +.BR SOCK_STREAM ¡¢ +.BR udp (7) +¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¾ì¹ç +.BR SOCK_DGRAM ¡¢ +IP ¥×¥í¥È¥³¥ë¤ËľÀÜ¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Ë +.BR raw (7) +¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¾ì¹ç¤Ë¤Ï +.B SOCK_RAW +¤Ç¤¢¤ë¡£ +.I protocol +¤ÏÁ÷¼õ¿®¤µ¤ì¤ë IP ¥Ø¥Ã¥À¤Ë½ñ¤«¤ì¤ë IP ¥×¥í¥È¥³¥ë¤Ç¤¢¤ë¡£ +»ØÄê¤Ç¤­¤ëÃͤϡ¢ +TCP ¥½¥±¥Ã¥È¤Ë¤Ï 0 ¤« +.BR IPPROTO_TCP ¡¢ +UDP ¥½¥±¥Ã¥È¤Ë¤Ï 0 ¤« +.B IPPROTO_UDP +¤Ë¸Â¤é¤ì¤ë¡£ +.B SOCK_RAW +¤ËÂФ·¤Æ¤Ï¡¢ RFC\ 1700 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÍ­¸ú¤Ê IANA IP ¥×¥í¥È¥³¥ë¤ò¡¢ +³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ëÈÖ¹æ¤Ç»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.\" FIXME ip current does an autobind in listen, but I'm not sure +.\" if that should be documented. +¤¢¤ë¥×¥í¥»¥¹¤Ç¡¢¤ä¤Ã¤Æ¤¯¤ë¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤·¤¿¤ê +ÀܳÍ×µá¤ò¼õ¤±¤¿¤ê¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +¤½¤Î¥×¥í¥»¥¹¤Ï¥í¡¼¥«¥ë¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤Ë¡¢ +.BR bind (2) +¤òÍѤ¤¤Æ¥½¥±¥Ã¥È¤ò¥Ð¥¤¥ó¥É¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤¢¤ë¥í¡¼¥«¥ë¤Ê¡Ö¥¢¥É¥ì¥¹¤È¥Ý¡¼¥È¡×¤Î¥Ú¥¢¤ËÂФ·¤Æ¥Ð¥¤¥ó¥É¤Ç¤­¤ë +IP ¥½¥±¥Ã¥È¤Ï°ì¤Ä¤Ë¸Â¤é¤ì¤ë¡£ +.BR bind (2) +¤Î¸Æ¤Ó½Ð¤·¤Ç +.B INADDR_ANY +¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ï¡¢¥½¥±¥Ã¥È¤Ï¥í¡¼¥«¥ë¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î +\fI¤¹¤Ù¤Æ\fP¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤ë¡£ +.BR listen (2) +¤Þ¤¿¤Ï +.BR connect (2) +¤¬¥Ð¥¤¥ó¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤Ç¥³¡¼¥ë¤µ¤ì¤ë¤È¡¢ +¤½¤Î¥½¥±¥Ã¥È¤Ï¼«Æ°Åª¤Ë¥í¡¼¥«¥ë¤Ê¥¢¥É¥ì¥¹¤ò +.B INADDR_ANY +¤Ë¥»¥Ã¥È¤·¡¢¶õ¤¤¤Æ¤¤¤ë¥Ý¡¼¥È¤ò¥é¥ó¥À¥à¤ËÁª¤ó¤Ç¥Ð¥¤¥ó¥É¤¹¤ë¡£ + +.B SO_REUSEADDR +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ +¥Ð¥¤¥ó¥É¤µ¤ì¤Æ¤¤¤¿ TCP ¥í¡¼¥«¥ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï +¥¯¥í¡¼¥º¤µ¤ì¤¿¸å¤·¤Ð¤é¤¯¤Î´Ö»È¤¨¤Ê¤¯¤Ê¤ë¡£ +.B SO_REUSEADDR +¥Õ¥é¥°¤ò»È¤¦¤È TCP ¤Î¿®ÍêÀ­¤òÄã²¼¤µ¤»¤ë¤Î¤Ç¡¢ +»È¤¦¤È¤­¤Ë¤ÏÃí°Õ¤¬É¬ÍפǤ¢¤ë¡£ +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +IP ¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï¡¢ IP ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤È +16¥Ó¥Ã¥È¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ÎÁȤ߹ç¤ï¤»¤ÇÄêµÁ¤µ¤ì¤ë¡£ +IP ¥×¥í¥È¥³¥ë¤½¤Î¤â¤Î¤Ï¥Ý¡¼¥ÈÈÖ¹æ¤ò°·¤ï¤Ê¤¤¡£ +¥Ý¡¼¥ÈÈÖ¹æ¤Ï¡¢ +.BR udp (7) +¤ä +.BR tcp (7) +¤È¤¤¤Ã¤¿¡¢¾å°Ì¤Î¥×¥í¥È¥³¥ë¤Ç¼ÂÁõ¤µ¤ì¤ë¡£ +raw ¥½¥±¥Ã¥È¤Ç¤Ï¡¢ +.I sin_port +¤¬ IP ¥×¥í¥È¥³¥ë¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +.PP +.in +4n +.nf +struct sockaddr_in { + sa_family_t sin_family; /* address family: AF_INET */ + in_port_t sin_port; /* port in network byte order */ + struct in_addr sin_addr; /* internet address */ +}; + +/* Internet address. */ +struct in_addr { + uint32_t s_addr; /* address in network byte order */ +}; +.fi +.in +.PP +.I sin_familiy +¤Ë¤Ï¾ï¤Ë +.B AF_INET +¤ò¥»¥Ã¥È¤¹¤ë¡£¤³¤ì¤Ïɬ¿Ü¤Ç¤¢¤ë¡£ Linux 2.2 ¤Ç¤Ï¡¢¤³¤Î¥»¥Ã¥È¤ò˺¤ì¤ë¤È +¤Û¤È¤ó¤É¤Î¥Í¥Ã¥È¥ï¡¼¥¯´Ø¿ô¤Ï +.B EINVAL +¤òÊÖ¤¹¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.I sin_port +¤Ë¤Ï¥Ý¡¼¥ÈÈÖ¹æ¤ò¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç»ØÄꤹ¤ë¡£ +1024 ̤Ëþ¤Î¥Ý¡¼¥ÈÈÖ¹æ¤Ï +.I "Æø¢¥Ý¡¼¥È (privileged ports)" +¤È¸Æ¤Ð¤ì¤ë +.RI ( "ͽÌó¥Ý¡¼¥È (reserved ports)" +¤È¤â»þ¡¹¸Æ¤Ð¤ì¤ë)¡£ +Æø¢¥×¥í¥»¥¹ +.RB ( CAP_NET_BIND_SERVICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) °Ê³°¤Î¥×¥í¥»¥¹¤Ï¡¢¤³¤ì¤é¤Î¥Ý¡¼¥È¤Ë¤Ï +.BR bind (2) +¤Ç¤­¤Ê¤¤¡£ IPv4 ¥×¥í¥È¥³¥ë¤½¤Î¤â¤Î¤Ë¤Ï¥Ý¡¼¥È¤Ë´Ø¤¹¤ë³µÇ°¤¬¤Ê¤¤¡£ +¥Ý¡¼¥È¤Ï¡¢ +.BR tcp (7) +¤ä +.BR udp (7) +¤È¤¤¤Ã¤¿¡¢¾å°Ì¤Î¥×¥í¥È¥³¥ë¤Ë¤ª¤¤¤Æ¼ÂÁõ¤µ¤ì¤ë¡£ +.PP +.I sin_addr +¤Ï IP ¥Û¥¹¥È¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I struct in_addr +¤Î +.I s_addr +¥á¥ó¥Ð¤Ë¤Ï¡¢¥Û¥¹¥È¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤ò +¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç»ØÄꤹ¤ë¡£ +.I in_addr +¤Ï¡¢INADDR_* ¤Î°ì¤Ä (Î㤨¤Ð +.BR INADDR_ANY ) +¤òÂåÆþ¤¹¤ë¡¢ +¥é¥¤¥Ö¥é¥ê´Ø¿ô +.BR inet_aton (3), +.BR inet_addr (3), +.BR inet_makeaddr (3) +¤òÍѤ¤¤ë¡¢¤¢¤ë¤¤¤Ï̾Á°²ò·èµ¡¹½ (name resolver) +¤òľÀÜÍѤ¤¤ë¡¢¤Î¤É¤ì¤«¤ÇÀßÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.RB ( gethostbyname (3) +¤ò¸«¤è)¡£ + +IPv4 ¥¢¥É¥ì¥¹¤Ë¤Ï¡¢¥æ¥Ë¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¡¢ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¡¢¥Þ¥ë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤¬¤¢¤ë¡£ +¥æ¥Ë¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ï¡¢¤¢¤ë¥Û¥¹¥È¤Î°ì¤Ä¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤹ¤ë¡£ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ï¡¢¤¢¤ë¥Í¥Ã¥È¥ï¡¼¥¯¾å¤ÎÁ´¤Æ¤Î¥Û¥¹¥È¤ò»ØÄꤹ¤ë¡£ +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ï¡¢¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Ë½ê°¤¹¤ë +Á´¤Æ¤Î¥Û¥¹¥È¤ò»ØÄꤹ¤ë¡£¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ø¤Î¥Ç¡¼¥¿¥°¥é¥à¤Ï¡¢ +.B SO_BROADCAST +¥½¥±¥Ã¥È¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤ÈÁ÷¿®¡¦¼õ¿®¤Ç¤­¤Ê¤¤¡£ +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢Àܳ»Ø¸þ¤Î¥½¥±¥Ã¥È¤Ë¤Ï¥æ¥Ë¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤·¤«»È¤¨¤Ê¤¤¡£ +.\" Leave a loophole for XTP @) + +¥¢¥É¥ì¥¹¤È¥Ý¡¼¥È¤Ï¾ï¤Ë¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç³ÊǼ¤µ¤ì¤ë¤³¤È¤ËÃí°Õ¤»¤è¡£ +¶ñÂÎŪ¤Ë¤Ï¡¢¥Ý¡¼¥È¤ò»ØÄꤹ¤ë¿ôÃÍ¤Ë¤Ï +.BR htons (3) +¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢¤ë¡£ +ɸ½à¥é¥¤¥Ö¥é¥ê¤Ë¤¢¤ë¥¢¥É¥ì¥¹/¥Ý¡¼¥ÈÁàºî´Ø¿ô¤Ï +¤¹¤Ù¤Æ¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤ÇÆ°ºî¤¹¤ë¡£ + +ÆÃÊ̤ʥ¢¥É¥ì¥¹¤¬¤¤¤¯¤Ä¤«Â¸ºß¤¹¤ë: +.TP +.BR INADDR_LOOPBACK (127.0.0.1) +loopback ¥Ç¥Ð¥¤¥¹¤òÄ̤·¤Æ¾ï¤Ë¥í¡¼¥«¥ë¤Ê¥Û¥¹¥È¤ò»²¾È¤¹¤ë¡£ +.TP +.BR INADDR_ANY (0.0.0.0) +¥Ð¥¤¥ó¥É¤ËÍѤ¤¤ëǤ°Õ¤Î¥¢¥É¥ì¥¹¡£ +.TP +.BR INADDR_BROADCAST (255.255.255.255) +Ǥ°Õ¤Î¥Û¥¹¥È¡£Îò»ËŪÍýͳ¤«¤é¡¢¥Ð¥¤¥ó¥É¤ÎºÝ¤Ë¤Ï +.B INADDR_ANY +¤ÈƱ¤¸¸ú²Ì¤Ë¤Ê¤ë¡£ +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +IP ¤Ë¤Ï¥×¥í¥È¥³¥ë¸ÇÍ­¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬¤¤¤¯¤Ä¤«Â¸ºß¤·¡¢ +.BR setsockopt (2) +¤ÇÀßÄ꤬¡¢ +.BR getsockopt (2) +¤Ç¼èÆÀ¤¬¤Ç¤­¤ë¡£ IP ¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë¤Ï +.B IPPROTO_IP +.\" Linux ¤Ç¤Ï SOL_IP ¤â²Ä +¤Ç¤¢¤ë¡£ +¥Ö¡¼¥ëÀ°¿ôÃͤΥե饰¤Ç¤Ï¡¢ 0 ¤Ïµ¶¡¢¤½¤ì°Ê³°¤Ï¿¿¤ò°ÕÌ£¤¹¤ë¡£ +.\" +.\" FIXME Document IP_FREEBIND +.\" Boolean +.\" Since Linux 2.4.0-test10 +.\" +.TP +.BR IP_ADD_MEMBERSHIP " (Linux 1.2 °Ê¹ß)" +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Ë»²²Ã¤¹¤ë¡£ +°ú¤­¿ô¤Ï +.I ip_mreqn +¹½Â¤ÂΤǤ¢¤ë¡£ +.sp +.in +4n +.nf +struct ip_mreqn { + struct in_addr imr_multiaddr; /* IP multicast group + address */ + struct in_addr imr_address; /* IP address of local + interface */ + int imr_ifindex; /* interface index */ +}; +.fi +.in +.sp +.I imr_multiaddr +¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬»²²Ã¤Þ¤¿¤ÏűÂष¤¿¤¤ +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Î¥¢¥É¥ì¥¹¤¬Æþ¤ë¡£ +»ØÄꤹ¤ë¥¢¥É¥ì¥¹¤ÏÍ­¸ú¤Ê¥Þ¥ë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.\" (¤Ä¤Þ¤ê¡¢224.0.0.0-239.255.255.255 ¤ÎÈÏ°ÏÆâ) +(¤µ¤â¤Ê¤±¤ì¤Ð +.BR setsockopt (2) +¤¬¥¨¥é¡¼ +.B EINVAL +¤Ç¼ºÇÔ¤¹¤ë)¡£ +.I imr_address +¤Ï¥·¥¹¥Æ¥à¤¬¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Ë»²²Ã¤¹¤ëºÝ¤ËÍѤ¤¤ë +¥í¡¼¥«¥ë¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +¤³¤ì¤¬ +.B INADDR_ANY +¤Ç¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢Å¬Àڤʥ¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤ÆÁªÂò¤µ¤ì¤ë¡£ +.I imr_ifindex +¤Ï +.I imr_multiaddr +¥°¥ë¡¼¥×¤Ë»²²Ã/űÂह¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î interface index ¤Ç¤¢¤ë¡£ +¤É¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤â¤è¤¤¾ì¹ç¤Ï 0 ¤Ë¤¹¤ë¡£ +.IP +.I ip_mreqn +¤Ï Linux 2.2 °Ê¹ß¤Ç¤Î¤ßÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +¸ß´¹À­¤Î¤¿¤á¡¢¸Å¤¤ +.I ip_mreq +¹½Â¤ÂÎ (Linux 1.2 °Ê¹ß¤Ç¸ºß¤¹¤ë) ¤â¤Þ¤À¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.I ip_mreqn +¤È¤Î°ã¤¤¤Ï¡¢ +.I imr_ifindex +¥Õ¥£¡¼¥ë¥É¤ò´Þ¤Þ¤Ê¤¤¤³¤È¤À¤±¤Ç¤¢¤ë¡£ +.BR setsockopt (2) +¤Ç¤Î¤ß»È¤¨¤ë¡£ +.\" +.TP +.BR IP_DROP_MEMBERSHIP " (Linux 1.2 °Ê¹ß)" +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤«¤éÈ´¤±¤ë¡£°ú¤­¿ô¤Ï +.B IP_ADD_MEMBERSHIP +¤ÈƱÍÍ¤Ë +.I ip_mreqn +¤Þ¤¿¤Ï +.I ip_mreq +¹½Â¤ÂΤǤ¢¤ë¡£ +.TP +.BR IP_HDRINCL " (Linux 2.0 °Ê¹ß)" +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¥æ¡¼¥¶¤Ï IP ¥Ø¥Ã¥À¤ò¥æ¡¼¥¶¡¼¥Ç¡¼¥¿¤ÎÁ°¤ËÍ¿¤¨¤ë¡£ +.B SOCK_RAW +¥½¥±¥Ã¥È¤Ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£¾ÜºÙ¤Ï +.BR raw (7) +¤ò¸«¤è¡£¤³¤Î¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +.BR IP_OPTIONS , +.BR IP_TTL , +.B IP_TOS +¤Ï̵»ë¤µ¤ì¤ë¡£ +.\" FIXME Document IP_IPSEC_POLICY +.\" Since Linux 2.5.47 +.\" Needs CAP_NET_ADMIN +.TP +.BR IP_MTU " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.124 +¥½¥±¥Ã¥È¤Î¡¢´ûÃΤΠpath MTU ¤ò¼èÆÀ¤¹¤ë¡£ +¥½¥±¥Ã¥È¤¬Àܳ¤·¤Æ¤¤¤ë¾ì¹ç¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£ +.BR getsockopt (2) +¤Ç¤Î¤ß»È¤¨¤ë¡£ +.TP +.BR IP_MTU_DISCOVER " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.124 +¥½¥±¥Ã¥È¤Î Path MTU Discovery ¤ÎÀßÄê¤ò¥»¥Ã¥È¡¦¼èÆÀ¤¹¤ë¡£ +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ Linux ¤Ï¤³¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ +RFC\ 1191 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë Path MTU Discovery ¤ò¹Ô¤¦¡£ +ȯ¿®¥Ç¡¼¥¿¥°¥é¥à¤Ë¤Ï¡¢Á´¤Æ¡Ö¥Õ¥é¥°¥á¥ó¥ÈÉÔµö²Ä¡×¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +¥·¥¹¥Æ¥àÁ´ÂΤËÂФ¹¤ë¥Ç¥Õ¥©¥ë¥È¤Ï¡¢ +.B SOCK_STREAM +¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï +.I /proc/sys/net/ipv4/ip_no_pmtu_disc +¥Õ¥¡¥¤¥ë¤Ë¤è¤êÀ©¸æ¤Ç¤­¤ë¡£ +¤½¤Î¾¤Ë¤Ä¤¤¤Æ¤Ï̵¸ú¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.B SOCK_STREAM +¤Ç¤Ê¤¤¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï¡¢ +¥æ¡¼¥¶¡¼¤¬¥Ç¡¼¥¿¤ò MTU ¤Î¥µ¥¤¥º¤Î²ô¤Ë¥Ñ¥±¥Ã¥È²½¤·¤¿¤ê¡¢ +ɬÍפʾì¹ç¤Ë¤ÏºÆÁ÷¤·¤¿¤ê¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +¥«¡¼¥Í¥ë¤Ï´ûÃΤΠpath MTU ¤è¤êÂ礭¤Ê¥Ñ¥±¥Ã¥È¤òµñÈݤ¹¤ë +.RB ( EMSGSIZE +¤È¤Ê¤ë)¡£ +.TS +tab(:); +c l +l l. +Path MTU discovery ¥Õ¥é¥°:°ÕÌ£ +IP_PMTUDISC_WANT:¥ë¡¼¥È¤´¤È¤ÎÀßÄê¤òÍѤ¤¤ë¡£ +IP_PMTUDISC_DONT:Path MTU Discovery ¤ò¹Ô¤ï¤Ê¤¤¡£ +IP_PMTUDISC_DO:¾ï¤Ë Path MTU Discovery ¤ò¹Ô¤¦¡£ +IP_PMTUDISC_PROBE:DF¥Ó¥Ã¥È¤ò¥»¥Ã¥È¤¹¤ë¤¬¡¢Path MTU ¤ò̵»ë¤¹¤ë¡£ +.TE + +path MTU discovery ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï°¸Àè¥Û¥¹¥È¤´¤È¤Ë +¼«Æ°Åª¤Ë path MTU ¤ò½èÍý¤¹¤ë¡£ÆÃÄê¤ÎÁê¼ê¤Ë +.BR connect (2) +¤ÇÀܳ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +.B IP_MTU +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ì¤Ð¡¢´ûÃΤΠpath MTU ¤Î¼èÆÀ¤ËÊØÍø¤Ç¤¢¤ë +(¤¿¤È¤¨¤Ð +.B EMSGSIZE +¥¨¥é¡¼¤¬µ¯¤­¤¿¸å¤Ê¤É)¡£¤³¤ì¤Ï»þ´Ö¤È¤È¤â¤ËÊѲ½¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +°¸À褬¤¿¤¯¤µ¤ó¤¢¤ë¥³¥Í¥¯¥·¥ç¥ó¥ì¥¹¤Ê¥½¥±¥Ã¥È¤Ç¤Ï¡¢ +Í¿¤¨¤é¤ì¤¿°¸Àè¤ËÂФ¹¤ë¿·¤·¤¤ MTU ¤Ë¤â¡¢ +¥¨¥é¡¼¥­¥å¡¼¤òÍѤ¤¤Æ¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.RB ( IP_RECVERR +¤ò¸«¤è)¡£ +MTU ¹¹¿·¤¬ÅþÃ夹¤ë¤´¤È¤Ë¡¢¿·¤¿¤Ê¥¨¥é¡¼¤¬¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤ë¡£ + +MTU discovery ¤Î¿Ê¹ÔÃæ¤Ë¤Ï¡¢¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤«¤é¤Î½é´ü¥Ñ¥±¥Ã¥È¤Ï +ÅþÃ夷¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ UDP ¤òÍѤ¤¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +¤³¤Î¤³¤È¤òµ¤¤Ë¤«¤±¤Æ¤ª¤­¡¢ +¥Ñ¥±¥Ã¥È¤ÎºÆÁ÷¥¢¥ë¥´¥ê¥º¥à¤Ë¤³¤Îʬ¤ò½ü³°¤µ¤»¤ë¤Ù¤­¤Ç¤¢¤ë¡£ + +Àܳ¤·¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤ËÂФ·¤Æ +path MTU discovery ¥×¥í¥»¥¹¤òΩ¤Á¾å¤²¤ë¤Ë¤Ï¡¢ +Â礭¤Ê¥Ç¡¼¥¿¥°¥é¥à¥µ¥¤¥º (ºÇÂç 64K ¥Ø¥Ã¥À¥Ð¥¤¥ÈĹ) ¤«¤é¤Ï¤¸¤á¤Æ¡¢ +path MTU ¤¬¹¹¿·¤µ¤ì¤ë¤Þ¤Ç¥µ¥¤¥º¤ò½Ì¤á¤Æ¤¤¤¯¤³¤È¤â²Äǽ¤Ç¤¢¤ë¡£ +.\" FIXME this is an ugly hack + +path MTU ¤ÎÃͤò¤Þ¤º¸«ÀѤâ¤Ã¤Æ¤ß¤ë¤Ë¤Ï¡¢°¸À襢¥É¥ì¥¹¤Ë +.BR connect (2) +¤ò»È¤Ã¤Æ¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤òÀܳ¤·¡¢ +.BR getsockopt (2) +¤ò +.B IP_MTU +¥ª¥×¥·¥ç¥ó¤È¤È¤â¤Ë¸Æ¤Ó¡¢ MTU ¤ò¼èÆÀ¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ + +.B IP_PMTUDISC_PROBE +(Linux 2.6.22 °Ê¹ß¤ÇÍøÍѲÄǽ) ¤òÀßÄꤹ¤ë¤³¤È¤Ç¡¢ +.B SOCK_DGRAM +¤ä +.B SOCK_RAW +¤Î¥½¥±¥Ã¥È¤Ç RFC 4821 ¤Î MTU õº÷¤ò¼ÂÁõ¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¡£ +¤Þ¤¿¡¢¤³¤Îµ¡Ç½¤Ï¡¢ +.BR tracepath (8) +¤Î¤è¤¦¤Ê¿ÇÃǥġ¼¥ë¤ÇÆäËÍ­ÍѤǤ¢¤ë¡£¤³¤ì¤é¤Î¥Ä¡¼¥ë¤Ç¤Ï¡¢ +´Ñ¬¤µ¤ì¤¿ Path MTU ¤è¤ê¤âÂ礭¤Êõº÷¥Ñ¥±¥Ã¥È¤ò°Õ¿ÞŪ¤Ë +Á÷¿®¤·¤è¤¦¤È¤¹¤ë¡£ +.TP +.BR IP_MULTICAST_IF " (Linux 1.2 °Ê¹ß)" +¥í¡¼¥«¥ë¥Ç¥Ð¥¤¥¹¤ò¥Þ¥ë¥Á¥­¥ã¥¹¥È¥½¥±¥Ã¥È¤È¤·¤ÆÀßÄꤹ¤ë¡£°ú¤­¿ô¤Ï +.B IP_ADD_MEMBERSHIP +¤ÈƱÍÍ¤Ë +.I ip_mreqn +¤Þ¤¿¤Ï +.I ip_mreq +¹½Â¤ÂΤǤ¢¤ë¡£ +.IP +ÉÔÀµ¤Ê¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÅϤµ¤ì¤ë¤È¡¢ +.B ENOPROTOOPT +¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.BR IP_MULTICAST_LOOP " (Linux 1.2 °Ê¹ß)" +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È¤ò¥í¡¼¥«¥ë¤Ê¥½¥±¥Ã¥È¤Ë¥ë¡¼¥×¥Ð¥Ã¥¯¤¹¤ë¤«¤É¤¦¤«¤ò +Äê¤á¤ë¥Ö¡¼¥ëÃͤÎÀ°¿ô°ú¤­¿ô¤òÀßÄꡦ¼èÆÀ¤¹¤ë¡£ +.TP +.BR IP_MULTICAST_TTL " (Linux 1.2 °Ê¹ß)" +¤³¤Î¥½¥±¥Ã¥È¤«¤éȯ¿®¤µ¤ì¤ë¥Þ¥ë¥Á¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È¤Î +time-to-live ÃͤòÀßÄꡦ¼èÆÀ¤¹¤ë¡£ +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï¡¢¤Ç¤­¤ë¤À¤±¾®¤µ¤Ê +TTL ¤ËÀßÄꤹ¤ë¤³¤È¤¬¤È¤Æ¤â½ÅÍפǤ¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ï 1 ¤Ç¡¢ +¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤¬ÌÀ¼¨Åª¤ËÍ׵ᤷ¤Ê¤¤¸Â¤ê +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È¤Ï¥í¡¼¥«¥ë¤Ê¥Í¥Ã¥È¥ï¡¼¥¯¤«¤é½Ð¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£ +°ú¤­¿ô¤ËÀ°¿ô¤ò¼è¤ë¡£ +.TP +.BR IP_OPTIONS " (Linux 2.0 °Ê¹ß)" +.\" Precisely: 1.3.30 +¤³¤Î¥½¥±¥Ã¥È¤«¤éÁ÷¤é¤ì¤ë¥Ñ¥±¥Ã¥ÈÁ´¤Æ¤ËÉտ魯¤ë IP ¥ª¥×¥·¥ç¥ó¤ò +ÀßÄꡦ¼èÆÀ¤¹¤ë¡£¥ª¥×¥·¥ç¥ó¤òÊݸ¤·¤Æ¤¤¤ë¥á¥â¥ê¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤È +¥ª¥×¥·¥ç¥ó¤ÎŤµ¤È¤ò°ú¤­¿ô¤Ë¼è¤ë¡£ +.BR setsockopt (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¥½¥±¥Ã¥È¤Ë´ØÏ¢¤Å¤±¤é¤ì¤ë IP ¥ª¥×¥·¥ç¥ó¤òÀßÄê¤Ç¤­¤ë¡£ +IPv4 ¤Ë¤ª¤±¤ë¥ª¥×¥·¥ç¥ó¤Î¥µ¥¤¥º¤ÎºÇÂçÃÍ¤Ï 40 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +ÍѤ¤¤ë¤³¤È¤Î¤Ç¤­¤ë¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ï RFC\ 791 ¤ò¸«¤è¡£ +.B SOCK_STREAM +¥½¥±¥Ã¥È¤ËÂФ¹¤ë½é´üÀܳÍ×µá¥Ñ¥±¥Ã¥È¤Ë IP ¥ª¥×¥·¥ç¥ó¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤È¡¢ +¥ë¡¼¥Æ¥£¥ó¥°¥Ø¥Ã¥À¤òÉÕ¤±¤ÆÌᤵ¤ì¤Æ¤¯¤ë½é´ü¥Ñ¥±¥Ã¥È¤Î +IP ¥ª¥×¥·¥ç¥ó¤ËƱ¤¸¥ª¥×¥·¥ç¥ó¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£Àܳ¤¬³ÎΩ¤µ¤ì¤¿¸å¡¢ +¤ä¤Ã¤Æ¤­¤¿¥Ñ¥±¥Ã¥È¤Î¥ª¥×¥·¥ç¥ó¤òÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡£³°Éô¤«¤é¼õ¿®¤·¤¿¥Ñ¥±¥Ã¥È¤ÎÁ´¤Æ¤Î source routing ¥ª¥×¥·¥ç¥ó +¤Î½èÍý¤Ï̵¸ú¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢ +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î +.I accept_source_route +¤ò»È¤¦¤È¤³¤ì¤òÍ­¸ú¤Ë¤Ç¤­¤ë¡£¤³¤ì¤ò̵¸ú¤Ë¤·¤Æ¤¤¤Æ¤â timestamps ¤Ê¤É +¤Î¾¤Î¥ª¥×¥·¥ç¥ó¤Î½èÍý¤Ï¹Ô¤ï¤ì¤ë¡£¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤Ç¤Ï¡¢ +IP ¥ª¥×¥·¥ç¥ó¤Ï¥í¡¼¥«¥ë¥æ¡¼¥¶¡¼¤·¤«ÀßÄê¤Ç¤­¤Ê¤¤¡£ +.BR getsockopt (2) +¤ò +.B IP_OPTIONS +¤ò¤Ä¤±¤Æ¸Æ¤Ö¤È¡¢¸½ºßÁ÷¿®¤ËÍѤ¤¤é¤ì¤Æ¤¤¤ë IP ¥ª¥×¥·¥ç¥ó¤ò +°ú¤­¿ô¤ËÍ¿¤¨¤¿¥Ð¥Ã¥Õ¥¡¤Ë¼èÆÀ¤Ç¤­¤ë¡£ +.\" FIXME Document IP_PASSSEC +.\" Boolean +.\" Since Linux 2.6.17 +.\" commit 2c7946a7bf45ae86736ab3b43d0085e43947945c +.\" Author: Catherine Zhang +.TP +.BR IP_PKTINFO " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.68 +.B IP_PKTINFO +Êä½õ¥á¥Ã¥»¡¼¥¸¤òÅϤ¹¡£¤³¤ì¤Ë¤ÏÅþÃå¥Ñ¥±¥Ã¥È¤Ë´Ø¤¹¤ë¾ðÊó¤òÄ󶡤¹¤ë +.I pktinfo +¹½Â¤ÂΤ¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¥Ç¡¼¥¿¥°¥é¥à»Ø¸þ¤Î¥½¥±¥Ã¥È¤Ç¤·¤«Æ°ºî¤·¤Ê¤¤¡£ +°ú¤­¿ô¤Ï +.B IP_PKTINFO +¥á¥Ã¥»¡¼¥¸¤òÄ̲ᤵ¤»¤ë¤«¤É¤¦¤«¤ò¥½¥±¥Ã¥È¤ËÃΤ餻¤ë¥Õ¥é¥°¤Ç¤¢¤ë¡£ +¥á¥Ã¥»¡¼¥¸¼«¿È¤Ï +.BR recvmsg (2) +¤Þ¤¿¤Ï +.BR sendmsg (2) +¤òÍѤ¤¤¿¥Ñ¥±¥Ã¥È¤ÎÀ©¸æ¥á¥Ã¥»¡¼¥¸¤È¤·¤Æ¤Î¤ßÁ÷¼õ¿®¤Ç¤­¤ë¡£ + +.IP +.in +4n +.nf +struct in_pktinfo { + unsigned int ipi_ifindex; /* Interface index */ + struct in_addr ipi_spec_dst; /* Local address */ + struct in_addr ipi_addr; /* Header Destination + address */ +}; +.fi +.in +.IP +.\" FIXME elaborate on that. +.I ipi_ifindex +¤Ï¥Ñ¥±¥Ã¥È¤¬¼õ¿®¤µ¤ì¤¿¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¡¢Â¾¤È½Å¤Ê¤é¤Ê¤¤¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤¢¤ë¡£ +.I ipi_spec_dst +¤Ï¥Ñ¥±¥Ã¥È¤Î¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I ipi_addr +¤Ï¥Ñ¥±¥Ã¥È¥Ø¥Ã¥À¤Ë¤¢¤ë°¸À襢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.B IP_PKTINFO +¤¬ +.BR sendmsg (2) +¤ËÅϤµ¤ì¤Æ¡¢¤«¤Ä +.\" ¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢Ì¾Á°¤ÎÉÕ¤±Êý¤¬ÌÀ¤é¤«¤Ë´Ö°ã¤Ã¤Æ¤¤¤ë¤Î¤À¤¬ +.I ipi_spec_dst +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢ +.I ipi_spec_dst +¤Ï¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤ò¸¡º÷¤¹¤ëºÝ¤Ë¥í¡¼¥«¥ë¤ÊÁ÷¿®¸µ¥¢¥É¥ì¥¹¤È¤·¤Æ»ÈÍѤµ¤ì¡¢ +IP source route ¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¤Î¤Ë¤â»ÈÍѤµ¤ì¤ë¡£ +.I ipi_ifindex +¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢¤³¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î +¥×¥é¥¤¥Þ¥ê¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤Ç +.I ipi_spec_dst +¤ò¾å½ñ¤­¤·¡¢¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤ò¸¡º÷¤¹¤ë¡£ +.TP +.BR IP_RECVERR " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.15 +¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Î¼õ¤±ÅϤ·¤Ë¡¢¿®ÍêÀ­¤Î¹â¤¤³ÈÄ¥¤µ¤ì¤¿ÊýË¡¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤ËÂФ·¤ÆÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +ȯÀ¸¤·¤¿¥¨¥é¡¼¤ÏÁ´¤Æ¥½¥±¥Ã¥È¤´¤È¤Î¥¨¥é¡¼¥­¥å¡¼¤ËÊݸ¤µ¤ì¤ë¡£ +¥æ¡¼¥¶¡¼¤Ï¥½¥±¥Ã¥ÈÁàºî¤«¤é¥¨¥é¡¼¤ò¼õ¤±¼è¤Ã¤¿¤È¤­¡¢ +.BR recvmsg (2) +¤ò +.B MSG_ERRQUEUE +¥Õ¥é¥°¤È¤È¤â¤Ë¸Æ¤Ù¤Ð¤½¤Î¥¨¥é¡¼¤ò¼èÆÀ¤Ç¤­¤ë¡£ +¤½¤Î¥¨¥é¡¼¤òµ­½Ò¤¹¤ë +.I sock_extended_err +¹½Â¤ÂΤ¬¡¢¥¿¥¤¥× +.BR IP_RECVERR ¡¦ +¥ì¥Ù¥ë +.B IPPROTO_IP +.\" Linux ¤Ç¤Ï SOL_IP ¤â²Ä +¤ÎÊä½õ¥á¥Ã¥»¡¼¥¸¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +¤³¤ì¤ÏÀܳ»Ö¸þ¤Ç¤Ê¤¤¥½¥±¥Ã¥È¤Ç¿®ÍêÀ­¤Î¹â¤¤¥¨¥é¡¼½èÍý¤ò¹Ô¤¤¤¿¤¤¾ì¹ç¤Ë +Í­ÍѤǤ¢¤ë¡£¥¨¥é¡¼¥­¥å¡¼¤Î¼õ¿®¥Ç¡¼¥¿¥Õ¥é¥°¥á¥ó¥È¤Ë¤Ï +¥¨¥é¡¼¥Ñ¥±¥Ã¥È¤¬´Þ¤Þ¤ì¤ë¡£ +.\"NAKANO portion ¤ò¥Õ¥é¥°¥á¥ó¥È¤Ã¤Æ¸À¤Ã¤Á¤ã¤Ã¤Æ¤¤¤¤¤Î¤«¡© +.IP +.B IP_RECVERR +À©¸æ¥á¥Ã¥»¡¼¥¸¤Ë¤Ï +.I sock_extended_err +¹½Â¤ÂΤ¬´Þ¤Þ¤ì¤ë: +.IP +.in +4n +.ne 18 +.nf +#define SO_EE_ORIGIN_NONE 0 +#define SO_EE_ORIGIN_LOCAL 1 +#define SO_EE_ORIGIN_ICMP 2 +#define SO_EE_ORIGIN_ICMP6 3 + +struct sock_extended_err { + uint32_t ee_errno; /* error number */ + uint8_t ee_origin; /* where the error originated */ + uint8_t ee_type; /* type */ + uint8_t ee_code; /* code */ + uint8_t ee_pad; + uint32_t ee_info; /* additional information */ + uint32_t ee_data; /* other data */ + /* More data may follow */ +}; + +struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *); +.fi +.in +.IP +.I ee_errno +¤Ë¤Ï¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¥¨¥é¡¼¤Î +.I errno +Èֹ椬Æþ¤ë¡£ +.I ee_origin +¤Ë¤Ï¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì½ê¤ò¼¨¤¹¥³¡¼¥É¤¬Æþ¤ë¡£ +¤½¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤Ï¥×¥í¥È¥³¥ë°Í¸¤Ç¤¢¤ë¡£ +.B SO_EE_OFFENDER +¥Þ¥¯¥í¤ÏÍ¿¤¨¤é¤ì¤¿Êä½õ¥á¥Ã¥»¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿¤«¤é +¥¨¥é¡¼¤ÎȯÀ¸¤·¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥É¥ì¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +¥¢¥É¥ì¥¹¤¬ÉÔÌÀ¤Ê¾ì¹ç¡¢ +.I sockaddr +¹½Â¤ÂΤΠ+.I sa_family +¥Õ¥£¡¼¥ë¥É¤Ï +.B AF_UNSPEC +¤È¤Ê¤ê¡¢¤½¤Î¾¤Î¥Õ¥£¡¼¥ë¥ÉÃͤÏÉÔÄê¤Ç¤¢¤ë¡£ +.IP +IP ¤Ï°Ê²¼¤Î¤è¤¦¤Ê +.I sock_extended_err +¹½Â¤ÂΤòÍѤ¤¤ë: +.I ee_origin +¤Ï¡¢ +¥¨¥é¡¼¤¬ ICMP ¥Ñ¥±¥Ã¥È¤È¤·¤Æ¼õ¿®¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï +.B SO_EE_ORIGIN_ICMP +¤Ë¥»¥Ã¥È¤µ¤ì¡¢¥í¡¼¥«¥ë¤Çµ¯¤³¤Ã¤¿¾ì¹ç¤Ë¤Ï +.B SO_EE_ORIGIN_LOCAL +¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +ÉÔÌÀ¤ÊÃͤÏ̵»ë¤µ¤ì¤ë¡£ +.I ee_type +¤È +.I ee_code +¤Ï ICMP ¥Ø¥Ã¥À¤Î type ¥Õ¥£¡¼¥ë¥É¤È code ¥Õ¥£¡¼¥ë¥É¤ÎÃͤ˥»¥Ã¥È¤µ¤ì¤ë¡£ +.I ee_info +¤Ë¤Ï +.B EMSGSIZE +¥¨¥é¡¼¤ËÂФ¹¤ë discover ¤µ¤ì¤¿ MTU ¤¬Æþ¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤Ë¤Ï¥¨¥é¡¼¤ò°ú¤­µ¯¤³¤·¤¿¥Î¡¼¥É¤Î +.I sockaddr_in +¹½Â¤ÂΤâ´Þ¤Þ¤ì¤ë¡£ +¤³¤ì¤Ë¤Ï +.B SO_EE_OFFENDER +¥Þ¥¯¥í¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +¥½¡¼¥¹¤¬ÉÔÌÀ¤Î¾ì¹ç¡¢ +SO_EE_OFFENDER ¥¢¥É¥ì¥¹¤Î +.I sin_family +¥Õ¥£¡¼¥ë¥É¤Ï +.B AF_UNSPEC +¤È¤Ê¤ë¡£ +¥¨¥é¡¼¤¬¥Í¥Ã¥È¥ï¡¼¥¯¤Çµ¯¤­¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥½¥±¥Ã¥È¤ÇÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤¿¤¹¤Ù¤Æ¤Î IP ¥ª¥×¥·¥ç¥ó +.RB ( IP_OPTIONS ", " IP_TTL +¤Ê¤É) ¤È¥¨¥é¡¼¥Ñ¥±¥Ã¥È¤Ë´Þ¤Þ¤ì¤Æ¤¤¤¿¤¹¤Ù¤Æ¤Î IP ¥ª¥×¥·¥ç¥ó¤È¤¬¡¢ +À©¸æ¥á¥Ã¥»¡¼¥¸¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +¥¨¥é¡¼¤òµ¯¤³¤·¤¿¥Ñ¥±¥Ã¥È¤Î¥Ú¥¤¥í¡¼¥É (payload) ¤Ï +ÉáÄ̤Υڥ¤¥í¡¼¥É¤È¤·¤ÆÊÖ¤µ¤ì¤ë¡£ +.\" FIXME . is it a good idea to document that? It is a dubious feature. +.\" .B SOCK_STREAM +.\" ¥½¥±¥Ã¥È¤Ç¤Ï¡¢ +.\" .B IP_RECVERR +.\" ¤Ï¤ä¤ä°Û¤Ê¤ë°ÕÌ£¤ò»ý¤Ä¡£¼¡¤Î¥¿¥¤¥à¥¢¥¦¥È¤Þ¤Ç¥Ç¡¼¥¿¤òÊÝ»ý¤¹¤ë¤Î¤Ç¤Ê¤¯¡¢ +.\" ¤ä¤Ã¤Æ¤­¤¿¥¨¥é¡¼¤ÏÁ´¤Æ¤¿¤À¤Á¤Ë¥æ¡¼¥¶¡¼¤ËÅϤµ¤ì¤ë¡£¤³¤ì¤Ï¡¢ +.\" ¹â®¤Ê¥¨¥é¡¼½èÍý¤¬É¬ÍפȤʤë¤è¤¦¤Ê¡¢¶Ëü¤Ë¼÷Ì¿¤Îû¤¤ +.\" TCP Àܳ¤ËÂФ·¤ÆÍ­ÍѤǤ¢¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤ÏÃí°Õ¤·¤ÆÍѤ¤¤ë¤³¤È¡£ +.\" ·ÐÏ©¤¬ÊѤï¤Ã¤¿¤ê¡¢¤½¤Î¾Ä̾ï¤Î¾õ¶·¤ËÂФ·¤Æ¡¢Å¬ÀڤʲóÉü¤¬ÉÔ²Äǽ¤È¤Ê¤ê¡¢ +.\" TCP ¤Î¿®ÍêÀ­¤òÄ㤯¤·¤Æ¤·¤Þ¤¦¡£¤Þ¤¿¥×¥í¥È¥³¥ë¤Î»ÅÍͤËÈ¿¤·¤Æ¤·¤Þ¤¦¡£ +TCP ¤Ë¤Ï¥¨¥é¡¼¥­¥å¡¼¤¬¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤Û¤·¤¤¡£ +.B MSG_ERRQUEUE +¤Ï +.B SOCK_STREAM +¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï»È¤¨¤Ê¤¤¡£ +TCP ¤Ç¤Ï +.B IP_RECVERR +¤À¤±¤¬Í­¸ú¤À¤¬¡¢¥½¥±¥Ã¥È´Ø¿ô¤«¤éÊÖ¤µ¤ì¤ë¥¨¥é¡¼¤Ï +.B SO_ERROR +¤À¤±¤Ë¤Ê¤ë¡£ +.IP +raw ¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.B IP_RECVERR +¤ò»ØÄꤹ¤ë¤È¡¢¼õ¿®¤·¤¿¤¹¤Ù¤Æ¤Î ICMP ¥¨¥é¡¼¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë +ÅϤ¹¤è¤¦¤Ë¤Ê¤ë¡£»ØÄꤷ¤Ê¤¤¤È¡¢ +ÀܳºÑ¤ß¤Î¥½¥±¥Ã¥È¤ËÂФ¹¤ë¥¨¥é¡¼¤À¤±¤òÊó¹ð¤¹¤ë¡£ +.IP +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Ö¡¼¥ëÃͤΥե饰¤òÀßÄꡦ¼èÆÀ¤¹¤ë¡£ +.B IP_RECVERR +¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥ª¥Õ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.TP +.BR IP_RECVOPTS " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.15 +ÅþÃ夷¤¿Á´¤Æ¤Î IP ¥ª¥×¥·¥ç¥ó¤ò +.B IP_OPTION +¥³¥ó¥È¥í¡¼¥ë¥á¥Ã¥»¡¼¥¸¤ËÆþ¤ì¤Æ¥æ¡¼¥¶¡¼¤ËÅϤ¹¡£ +¥ë¡¼¥Æ¥£¥ó¥°¥Ø¥Ã¥À¤È¤½¤Î¾¤Î¥ª¥×¥·¥ç¥ó¤È¤Ï¡¢ +¥í¡¼¥«¥ë¥Û¥¹¥È¤ËÂФ·¤Æ¤Ï¤¢¤é¤«¤¸¤áµ­Æþ¤µ¤ì¤Æ¤¤¤ë¡£ +.B SOCK_STREAM +¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.BR IP_RECVTOS " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.68 +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +.B IP_TOS +Êä½õ¥á¥Ã¥»¡¼¥¸¤¬ÅþÃå¥Ñ¥±¥Ã¥È¤È¤È¤â¤ËÅϤµ¤ì¤ë¡£ +¤³¤ì¤Ë¤Ï¥Ñ¥±¥Ã¥È¥Ø¥Ã¥À¤Î Service/Precedence +¥Õ¥£¡¼¥ë¥É¤Î¥¿¥¤¥×¤ò»ØÄꤹ¤ë¥Ð¥¤¥È¥Ç¡¼¥¿¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¥Ö¡¼¥ëÀ°¿ôÃͤΥե饰¤ò¤È¤ë¡£ +.TP +.BR IP_RECVTTL " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.68 +¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢ +.B IP_TTL +¥³¥ó¥È¥í¡¼¥ë¥á¥Ã¥»¡¼¥¸¤¬¼õ¿®¥Ñ¥±¥Ã¥È¤Î +time-to-live ¥Õ¥£¡¼¥ë¥É¤Î¥Ð¥¤¥È¥Ç¡¼¥¿¤È¤È¤â¤ËÅϤµ¤ì¤ë¡£ +.B SOCK_STREAM +¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B IP_RETOPTS +.BR IP_RETOPTS " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.15 +.B IP_RECVOPTS +¤ÈÅù²Á¤À¤¬¡¢Ì¤½èÍý¤ÎÀ¸¤Î¥ª¥×¥·¥ç¥ó¤ò¡¢ +¤³¤Î hop ¤Ç¤Ïµ­Æþ¤µ¤ì¤Ê¤¤ timestamp ¥ì¥³¡¼¥É¤È route ¥ì¥³¡¼¥É¤È¤È¤â¤ËÊÖ¤¹¡£ +.\"NAKANO °ÕÌ£ÉÔÌÀ...(^^; +.TP +.BR IP_ROUTER_ALERT " (Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.68 +¥Õ¥©¥ï¡¼¥É¤¹¤Ù¤­¥Ñ¥±¥Ã¥È¤ò IP Router Alert ¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Æ +¤³¤Î¥½¥±¥Ã¥È¤ËÅϤ¹¡£ +raw ¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£¤³¤ì¤Ï¤¿¤È¤¨¤Ð¥æ¡¼¥¶¡¼¶õ´Ö¤Î +RSVP ¥Ç¡¼¥â¥ó¤ËÂФ·¤ÆÊØÍø¤Ç¤¢¤ë¡£¥¿¥Ã¥×¤µ¤ì¤¿¥Ñ¥±¥Ã¥È¤Ï +¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¤Ï¥Õ¥©¥ï¡¼¥É¤µ¤ì¤Ê¤¤¤Î¤Ç¡¢¤³¤ì¤é¤òºÆÁ÷¤¹¤ë¤Î¤Ï +¥æ¡¼¥¶¡¼¤ÎÀÕǤ¤È¤Ê¤ë¡£¥½¥±¥Ã¥È¤Î¥Ð¥¤¥ó¥É¤Ï̵»ë¤µ¤ì¡¢ +¤³¤Î¤è¤¦¤Ê¥Ñ¥±¥Ã¥È¤Ï¥×¥í¥È¥³¥ë¤Ë¤è¤Ã¤Æ¤Î¤ß¥Õ¥£¥ë¥¿¥ê¥ó¥°¤µ¤ì¤ë¡£ +À°¿ôÃͤΥե饰¤ò¼è¤ë¡£ +.\"NAKANO Socket binding... ¤Îʸ¡¢°ÕÌ£¤ï¤«¤é¤ó¡£ +.TP +.BR IP_TOS " (Linux 1.0 °Ê¹ß)" +¤³¤Î¥½¥±¥Ã¥È¤«¤éÁ÷¿®¤µ¤ì¤ë¤¹¤Ù¤Æ¤Î IP ¥Ñ¥±¥Ã¥È¤ËŬÍѤµ¤ì¤ë +Type-Of-Service (TOS) ¥Õ¥£¡¼¥ë¥É¤òÀßÄꡦ¼èÆÀ¤¹¤ë¡£ +¤³¤ì¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Ç¤Î¥Ñ¥±¥Ã¥È¤ÎÍ¥ÀèÅÙ¤ò·è¤á¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +TOS ¤Ï¥Ð¥¤¥È¥Ç¡¼¥¿¤Ç¤¢¤ë¡£É¸½à¤Î TOS ¥Õ¥é¥°¤¬¤¤¤¯¤Ä¤«ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.B IPTOS_LOWDELAY +¤Ï¥¤¥ó¥¿¥é¥¯¥Æ¥£¥Ö¤Ê¥È¥é¥Õ¥£¥Ã¥¯¤ÎÃÙ±ä¤òºÇ¾®¤Ë¤¹¤ë¡£ +.B IPTOS_THROUGHPUT +¤Ï¥¹¥ë¡¼¥×¥Ã¥È¤òºÇÂç¤Ë¤¹¤ë¡£ +.B IPTOS_RELIABILITY +¤Ï¿®ÍêÀ­¤òºÇ¹â¤Ë¤¹¤ë¡£ +.B IPTOS_MINCOST +¤ÏžÁ÷®ÅÙ¤¬ÃÙ¤¯¤Æ¤â¤«¤Þ¤ï¤Ê¤¤¤È¤­¡¢¡Ö¥Ç¡¼¥¿¤òµÍ¤á¹þ¤à¡×¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +¤³¤ì¤é¤Î¤¦¤Á¡¢ 1 ¤Ä¤Þ¤Ç¤À¤±¤òÀßÄê¤Ç¤­¤ë¡£ +¾¤Î¥Ó¥Ã¥È¤Ï̵¸ú¤Ç¡¢¥¯¥ê¥¢¤µ¤ì¤ë¡£ +.\"NAKANO ¢¬Ìõ¤¢¤Ã¤Æ¤ë¡© +Linux ¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +.B IPTOS_LOWDELAY +¥Ç¡¼¥¿¥°¥é¥à¤òºÇ½é¤ËÁ÷¿®¤¹¤ë¡£ +¤·¤«¤·¡¢Àµ³Î¤Ê¿¶¤ëÉñ¤¤¤Ï¥­¥å¡¼½èÍý¤ÎÀßÄê¤Ë°Í¸¤¹¤ë¡£ +.\" FIXME elaborate on this +¹â¤¤Í¥ÀèÅ٤ˤ¹¤ë¤Ë¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¸¢¸Â +.RB ( CAP_NET_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤¬É¬ÍפȤʤ뤫¤â¤·¤ì¤Ê¤¤¡£ +Í¥ÀèÅÙ¤Ï +.RB ( SOL_SOCKET ", " SO_PRIORITY ) +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ì¤Ð¡¢ +¥×¥í¥È¥³¥ë¤Ë°Í¸¤·¤Ê¤¤·Á¤Ç¤âÀßÄê¤Ç¤­¤ë +.RB ( socket (7) +¤ò¸«¤è)¡£ +.\" FIXME Document IP_TRANSPARENT +.\" Needs CAP_NET_ADMIN +.\" Boolean +.\" Since Linux 2.6.27 +.\" commit f5715aea4564f233767ea1d944b2637a5fd7cd2e +.\" Author: KOVACS Krisztian +.TP +.BR IP_TTL " (Linux 1.0 °Ê¹ß)" +time-to-live ¥Õ¥£¡¼¥ë¥É¤ÎÃͤòÀßÄê¤Þ¤¿¤Ï¼èÆÀ¤¹¤ë¡£ +¤³¤ÎÃͤϤ³¤Î¥½¥±¥Ã¥È¤«¤éÁ÷¿®¤µ¤ì¤ë¤¹¤Ù¤Æ¤Î¥Ñ¥±¥Ã¥È¤ËÍѤ¤¤é¤ì¤ë¡£ +.\" FIXME Document IP_XFRM_POLICY +.\" Since Linux 2.5.48 +.\" Needs CAP_NET_ADMIN +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +IP ¥×¥í¥È¥³¥ë¤Ç¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¥°¥í¡¼¥Ð¥ë¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë¤¿¤á¤Î +.I /proc +¥Õ¥¡¥¤¥ë·²¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤Ë¤Ï¡¢ +.I /proc/sys/net/ipv4/ +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.\" FIXME As at 2.6.12, 14 Jun 2005, the following are undocumented: +.\" ip_queue_maxlen +.\" ip_conntrack_max +.I Boolean +¤È½ñ¤«¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÏÀ°¿ôÃͤò¤È¤ê¡¢ +0 °Ê³°¤ÎÃÍ ("true") ¤ÏÂбþ¤¹¤ë¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¡¢ +0 ÃÍ ("false") ¤Ï̵¸ú¡¢¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.\" +.TP +.IR ip_always_defrag " (Boolean; Linux 2.2.13 °Ê¹ß)" +[2.2.13 ¤Ç¿·µ¬Åо졣°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Îµ¡Ç½¤Ï +¥³¥ó¥Ñ¥¤¥ë»þ¤Ë +.B CONFIG_IP_ALWAYS_DEFRAG +¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤ÆÀ©¸æ¤µ¤ì¤Æ¤¤¤¿; +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï 2.4.x °Ê¹ß¤Ç¤Ï¸ºß¤·¤Ê¤¤] + +¤³¤Î¥Ö¡¼¥ëÃͤΥե饰¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë (0 °Ê³°¤Ë¤Ê¤Ã¤Æ¤¤¤ë) ¤È¡¢ +ÅþÃ夷¤¿¥Õ¥é¥°¥á¥ó¥È (IP ¥Ñ¥±¥Ã¥È¤Î°ìÉô¤Ç¡¢ +ȯ¿®¸µ¤Èȯ¿®Àè¤Î´Ö¤Î¤É¤³¤«¤Î¥Û¥¹¥È¤Ç¡¢¤½¤Î¥Ñ¥±¥Ã¥È¤¬ +Â礭¤¹¤®¤ë¤ÈȽÃǤµ¤ì¡¢Ê¬³ä¤µ¤ì¤¿¾ì¹ç¤ËÀ¸¤¸¤ë) +¤Ï¡¢¤¿¤È¤¨¥Õ¥©¥ï¡¼¥É¤µ¤ì¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â +½èÍýÁ°¤ËºÆ¹½ÃÛ (¥Ç¥Õ¥é¥°¥á¥ó¥È) ¤µ¤ì¤ë¡£ + +¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤¬¥í¡¼¥«¥ë¦¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤ËÍ£°ì¤Î¥ê¥ó¥¯¤ò»ý¤Ã¤Æ¤¤¤ë +¾ì¹ç¤ä¡¢Æ©²á¥×¥í¥¯¥·¤Î¾ì¹ç¤Ë¸Â¤Ã¤ÆÍ­¸ú¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Ä̾ï¤Î¥ë¡¼¥¿¡¼¤ä¥Û¥¹¥È¤Ç¤Ï·è¤·¤Æ»ÈÍѤ¹¤ë¤³¤È¤Î¤Ê¤¤¤è¤¦¤Ë¡£ +¤µ¤â¤Ê¤¤¤È¥Õ¥é¥°¥á¥ó¥È¤¬Ê̤Υê¥ó¥¯¤ò·Ðͳ¤·¤ÆÅÁ¤ï¤ë¾ì¹ç¤Ë¡¢ +ÄÌ¿®¤Î¥Õ¥é¥°¥á¥ó¥È²½¤¬¤Ç¤­¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¡£ +¤Þ¤¿¥Õ¥é¥°¥á¥ó¥ÈºÆ¹½ÃÛ½èÍý¤Ï¥á¥â¥ê¤È CPU »þ´Ö¤Î¥³¥¹¥È¤¬Èó¾ï¤ËÂ礭¤¤¡£ + +¤³¤ì¤Ï¥Þ¥¹¥«¥ì¡¼¥É¤äÆ©²á¥×¥í¥¯¥·¤¬ÀßÄꤵ¤ì¤ë¤È¡¢ +ÉԻ׵ĤʻÅÁȤߤˤè¤Ã¤Æ¼«Æ°Åª¤ËÍ­¸ú¤Ë¤Ê¤ë¡£ +.\" +.TP +.IR ip_autoconfig " (Linux 2.2 °Ê¹ß 2.6.17 ¤Þ¤Ç)" +.\" Precisely: since 2.1.68 +.\" FIXME document ip_autoconfig +¤Þ¤Àµ­½Ò¤·¤Æ¤¤¤Ê¤¤¡£ +.\" +.TP +.IR ip_default_ttl " (integer; default: 64; Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.15 +Á÷½Ð¤µ¤ì¤ë¥Ñ¥±¥Ã¥È¤Î time-to-live ÃͤΥǥե©¥ë¥È¤ò¥»¥Ã¥È¤¹¤ë¡£ +¤³¤ì¤Ï +.B IP_TTL +¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ì¤Ð¡¢¥Ñ¥±¥Ã¥È¤´¤È¤ËÊѤ¨¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.\" +.TP +.IR ip_dynaddr " (Boolean; default: disabled; Linux 2.0.31 °Ê¹ß)" +ưŪ¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤È¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤¬Êѹ¹¤µ¤ì¤¿ºÝ¤Î +¥Þ¥¹¥«¥ì¡¼¥É¥¨¥ó¥È¥ê¤ÎºÆ½ñ¤­¹þ¤ß¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¥À¥¤¥¢¥ë¥¢¥Ã¥×¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¡¢ +IP ¥¢¥É¥ì¥¹¤¬Êѹ¹¤µ¤ì¤ë¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +.\" +.TP +.IR ip_forward " (Boolean; default: disabled; Linux 1.2 °Ê¹ß)" +IP forwarding ¤òÍ­¸ú¤Ë¤¹¤ë¤«¤É¤¦¤«¤Î¥Ö¡¼¥ëÃͥե饰¡£ +IP forwarding ¤¹¤ë¤«¤É¤¦¤«¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤´¤È¤Ë¤âÀßÄê¤Ç¤­¤ë¡£ +.\" +.TP +.IR ip_local_port_range " (Linux 2.2 °Ê¹ß)" +.\" Precisely: since 2.1.68 +¥½¥±¥Ã¥È¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥Ç¥Õ¥©¥ë¥È¤Î¥í¡¼¥«¥ë¥Ý¡¼¥È¤ÎÈϰϤòÄê¤á¤ë +Æó¤Ä¤ÎÀ°¿ô¤òÍ¿¤¨¤ë¡£³ä¤êÅö¤Æ¤Ï 1 ÈÖÌܤÎÈֹ椫¤é»Ï¤Þ¤ê¡¢ 2 ÈÖÌܤÎÈÖ¹æ¤Ç½ª¤ï¤ë¡£ +¤³¤ì¤é¤Ï¥Þ¥¹¥«¥ì¡¼¥É¤ÇÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Ý¡¼¥È¤È½Å¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤ +(¤½¤Î¾ì¹ç¤â¼è¤ê°·¤ï¤ì¤ë¤¬)¡£ +¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Î¥Ñ¥±¥Ã¥È¥Õ¥£¥ë¥¿¡¼¤¬¡ÖÍøÍÑÃæ¤Î¥í¡¼¥«¥ë¥Ý¡¼¥È¡× +¤Ë¤Ä¤¤¤Æ²¿¤é¤«¤Î²¾Äê¤ò¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +ÈÖ¹æ¤ò¾¡¼ê¤Ë·è¤á¤Æ¤·¤Þ¤¦¤ÈÌäÂ꤬µ¯¤­¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +1 ÈÖÌܤÎÈÖ¹æ¤Ï¾¯¤Ê¤¯¤È¤â 1024 ¤è¤êÂ礭¤¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Îɤ¯»È¤ï¤ì¤ë¥Ý¡¼¥È¤È¤Î¾×ÆͤòÈò¤±¤¿¤ê¡¢¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÌäÂê¤ò +²óÈò¤·¤¿¤±¤ì¤Ð¡¢ 4096 ¤è¤ê¤âÂ礭¤¯¤¹¤ë¤Û¤¦¤¬Îɤ¤¤À¤í¤¦¡£ +.\" +.TP +.IR ip_no_pmtu_disc " (Boolean; default: disabled; Linux 2.2 °Ê¹ß)" +.\" Precisely: 2.1.15 +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¥Ç¥Õ¥©¥ë¥È¤Ç TCP ¥½¥±¥Ã¥È¤ËÂФ¹¤ë +Path MTU Discoverty ¤ò¹Ô¤ï¤Ê¤¤¡£ +Path MTU Discovery ¤Ï¡¢ +Àµ¤·¤¯ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤ (ICMP ¥Ñ¥±¥Ã¥È¤òÁ´¤Æ¥É¥í¥Ã¥×¤¹¤ë) ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ä¡¢ +(point-to-point ¥ê¥ó¥¯¤ÇÁÐÊý¤Î MTU ¤¬°ìÃפ·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ê¤É) +Àµ¤·¤¯ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬·ÐÏ©¾å¤Ë¸ºß¤¹¤ë¤È¼ºÇÔ¤·¤Æ¤·¤Þ¤¦¡£ +Path MTU Discovery ¤ò¥°¥í¡¼¥Ð¥ë¤Ë̵¸ú¤Ë¤¹¤ë¤è¤ê¤Ï¡¢ +²õ¤ì¤Æ¤¤¤ë¥ë¡¼¥¿¤òľ¤¹¤Û¤¦¤¬Îɤ¤¡£ +Path MTU Discovery ¤ò̵¸ú¤Ë¤¹¤ë¤È¥Í¥Ã¥È¥ï¡¼¥¯¤Î¥³¥¹¥È¤¬ +Â礭¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤«¤é¤Ç¤¢¤ë¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR ip_nonlocal_bind " (Boolean; default: disabled; Linux 2.4 °Ê¹ß)" +.\" Precisely: patch-2.4.0-test10 +¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢¥×¥í¥»¥¹¤¬¼«Ê¬°Ê³°¤Î IP ¥¢¥É¥ì¥¹¤ò +.BR bind (2) +¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£¤³¤ì¤Ï¤«¤Ê¤êÊØÍø¤À¤¬¡¢¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤â¤¢¤ë¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR ip6frag_time " (integer; default 30)" +IPv6 ¥Õ¥é¥°¥á¥ó¥È¤ò¥á¥â¥ê¤ËÊÝ»ý¤·¤Æ¤ª¤¯»þ´Ö (ÉÃñ°Ì)¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR ip6frag_secret_interval " (integer; default 600)" +IPv6 ¥Õ¥é¥°¥á¥ó¥È¤Î hash secret ¤ÎÀ¸À®´Ö³Ö (hash secret ¤Î¼÷Ì¿) +(ÉÃñ°Ì)¡£ +.TP +.IR ipfrag_high_thresh " (integer), " ipfrag_low_thresh " (integer)" +¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤Æ¤¤¤ë IP ¥Õ¥é¥°¥á¥ó¥È¤ÎÎ̤¬ +.I ipfrag_high_thresh +¤Ë㤹¤ë¤È¡¢¥­¥å¡¼¤ÎÆâÍÆ¤Ï +.I ipfrag_low_thresh +¤Ë¤Þ¤ÇÀÚ¤ê¼Î¤Æ¤é¤ì¤ë¡£¤½¤ì¤¾¤ì¤ÎÂ礭¤µ¤ò +¥Ð¥¤¥Èñ°Ì¤Çɽ¤¹À°¿ôÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.TP +.I neigh/* +.BR arp (7) +¤ò¸«¤è¡£ +.\" FIXME Document the conf/*/* interfaces +.\" FIXME Document the route/* interfaces +.\" FIXME document them all +.SS ioctl +.BR socket (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë ioctl ¤Ï¡¢¤¹¤Ù¤Æ +.B ip +¤Ë¤âŬÍѤµ¤ì¤ë¡£ +.\" 2006-04-02, mtk +.\" commented out the following because ipchains is obsolete +.\" .PP +.\" ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë´Ø·¸¤ÎÀßÄê¤Ë´Ø¤¹¤ë ioctl ¤Ë¤Ä¤¤¤Æ¤Ï +.\" .B ipchains +.\" ¥Ñ¥Ã¥±¡¼¥¸¤Î +.\" .BR ipfw (4) +.\" ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +¥¸¥§¥Í¥ê¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Î¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë ioctl ¤Ë¤Ä¤¤¤Æ¤Ï +.BR netdevice (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.\" FIXME Add a discussion of multicasting +.SH ¥¨¥é¡¼ +.\" FIXME document all errors. +.\" We should really fix the kernels to give more uniform +.\" error returns (ENOMEM vs ENOBUFS, EPERM vs EACCES etc.) +.TP +.B EACCES +ɬÍפʸ¢¸Â¤Î¤Ê¤¤¥æ¡¼¥¶¡¼¤¬Áàºî¤ò¼Â¹Ô¤·¤è¤¦¤È¤·¤¿¡£ +°Ê²¼¤Î¤è¤¦¤Ê¾ì¹ç¤¬¹Í¤¨¤é¤ì¤ë: +.B SO_BROADCAST +¥Õ¥é¥°¤òÀßÄꤷ¤Æ¤¤¤Ê¤¤¾õÂÖ¤Ç¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ë +¥Ñ¥±¥Ã¥È¤òÁ÷¤í¤¦¤È¤·¤¿¡£ +.I prohibit +¤Ê¥ë¡¼¥È¤òÄ̤·¤Æ¥Ñ¥±¥Ã¥È¤òÁ÷¤í¤¦¤È¤·¤¿¡£ +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¸¢¸Â +.RB ( CAP_NET_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤Ê¤·¤Ç¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÀßÄê¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿¡£ +¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¸¢¸Â +.RB ( CAP_NET_BIND_SERVICE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤Ê¤·¤ÇÆø¢¥Ý¡¼¥È¤Ë¥Ð¥¤¥ó¥É¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B EADDRINUSE +´û¤Ë»È¤ï¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤·¤è¤¦¤È¤·¤¿¡£ +.TP +.B EADDRNOTAVAIL +¸ºß¤·¤Ê¤¤¥½¥±¥Ã¥È¤¬Í׵ᤵ¤ì¤¿¡£¤Þ¤¿¤ÏÍ׵ᤵ¤ì¤¿ +¥½¡¼¥¹¥¢¥É¥ì¥¹¤¬¥í¡¼¥«¥ë¤Ç¤Ê¤¤¡£ +.TP +.B EAGAIN +Èó¥Ö¥í¥Ã¥­¥ó¥°¥½¥±¥Ã¥È¤ËÂФ·¤Æ¥Ö¥í¥Ã¥¯¤¹¤ëÁàºî¤ò¹Ô¤Ã¤¿¡£ +.TP +.B EALREADY +Èó¥Ö¥í¥Ã¥­¥ó¥°¥½¥±¥Ã¥È¤ËÂФ¹¤ëÀܳÁàºî¤¬´û¤Ë¼Â¹ÔÃæ¤Ç¤¢¤ë¡£ +.TP +.B ECONNABORTED +.BR accept (2) +¤ÎºÇÃæ¤ËÀܳ¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿¡£ +.TP +.B EHOSTUNREACH +°¸À襢¥É¥ì¥¹¤Ë¥Þ¥Ã¥Á¤¹¤ëÍ­¸ú¤Ê¥¨¥ó¥È¥ê¤¬¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤Ë +¸ºß¤·¤Ê¤¤¡£¤³¤Î¥¨¥é¡¼¤Ï¥ê¥â¡¼¥È¥ë¡¼¥¿¤«¤é¤Î¡¢ +¤¢¤ë¤¤¤Ï¥í¡¼¥«¥ë¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤Ø¤Î +ICMP ¥á¥Ã¥»¡¼¥¸¤Ë¤è¤Ã¤Æ°ú¤­µ¯¤³¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +.B EINVAL +ÉÔÀµ¤Ê°ú¤­¿ô¤¬ÅϤµ¤ì¤¿¡£Á÷¿®Áàºî¤Ë¤ª¤¤¤Æ¡¢ +.I blackhole +¥ë¡¼¥È¤ËÁ÷¿®¤·¤è¤¦¤È¤¹¤ë¤È¤³¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +.B EISCONN +.BR connect (2) +¤¬¡¢´û¤ËÀܳºÑ¤ß¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ¸Æ¤Ð¤ì¤¿¡£ +.TP +.B EMSGSIZE +¥Ç¡¼¥¿¥°¥é¥à¤¬ path MTU ¤è¤ê¤âÂ礭¤¯¡¢¥Õ¥é¥°¥á¥ó¥È²½¤â¤Ç¤­¤Ê¤¤¡£ +.TP +.BR ENOBUFS ", " ENOMEM +¶õ¤­¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +¤³¤Î¥¨¥é¡¼¤Ï¡¢¥á¥â¥ê¥¢¥í¥±¡¼¥·¥ç¥ó¤¬¥½¥±¥Ã¥È¥Ð¥Ã¥Õ¥¡¤Î +Â礭¤µ¤Ë¤è¤Ã¤ÆÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò°ÕÌ£¤·¤Æ¤¤¤ë¤Î¤¬Ä̾ï¤Ç¤¢¤ë¤¬¡¢ +100% ¤½¤¦¤À¤È¤¤¤¦¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B ENOENT +¥Ñ¥±¥Ã¥È¤¬Á´¤¯ÅþÃ夷¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.B SIOCGSTAMP +¤¬¸Æ¤Ð¤ì¤¿¡£ +.TP +.B ENOPKG +¥«¡¼¥Í¥ë¥µ¥Ö¥·¥¹¥Æ¥à¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.BR ENOPROTOOPT " ¤È " EOPNOTSUPP +ÉÔÀµ¤Ê¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÅϤµ¤ì¤¿¡£ +.TP +.B ENOTCONN +Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤ËÂФ·¤Æ¡¢ +Àܳ¾õÂ֤Ǥ·¤«ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤Áàºî¤ò¹Ô¤ª¤¦¤È¤·¤¿¡£ +.TP +.B EPERM +¹â¤¤Í¥ÀèÅÙ¤òÀßÄꤷ¤¿¤ê¡¢ÀßÄê¤òÊѹ¹¤·¤¿¤ê¡¢Í׵ᤵ¤ì¤¿¥×¥í¥»¥¹¤ä +¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤Ã¤¿¤ê¤¹¤ë¤Î¤ËɬÍפʸ¢¸Â¤ò¡¢ +¥æ¡¼¥¶¡¼¤¬»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EPIPE +Àܳ¤¬ÀèÊý¤«¤é´üÂÔ¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¤ä¤êÊý¤Ç +¥¯¥í¡¼¥º¤¢¤ë¤¤¤Ï¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤¿¡£ +.TP +.B ESOCKTNOSUPPORT +¥½¥±¥Ã¥È¤¬Ì¤ÀßÄê¤Ç¤¢¤ë¤«¡¢ÃΤé¤Ê¤¤¥½¥±¥Ã¥È¥¿¥¤¥×¤¬Í׵ᤵ¤ì¤¿¡£ +.PP +¾¤Î¥¨¥é¡¼¤¬¾åÁؤΥץí¥È¥³¥ë¤Ë¤è¤Ã¤ÆÀ¸¤¸¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.BR tcp (7), +.BR raw (7), +.BR udp (7), +.BR socket (7) +¤Ê¤É¤ò»²¾È¤Î¤³¤È¡£ +.SH Ãí°Õ +.BR IP_MTU , +.BR IP_MTU_DISCOVER , +.BR IP_PKTINFO , +.BR IP_RECVERR , +.B IP_ROUTER_ALERT +¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢°Ü¿¢À­¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï +ÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\" IP_PASSSEC is Linux-specific +.\" IP_TRANSPARENT is Linux-specific +.\" IP_FREEBIND is Linux-specific +.\" IP_XFRM_POLICY is Linux-specific +.\" IP_IPSEC_POLICY is a nonstandard extension, also present on some BSDs +.B SO_BROADCAST +¥ª¥×¥·¥ç¥ó¤ÎÍøÍѤˤϡ¢¤¯¤ì¤°¤ì¤âÃí°Õ¤¹¤ë¤³¤È¡£ +¤³¤ì¤Ï Linux ¤Ç¤ÏÆø¢Áàºî¤Ç¤Ï¤Ê¤¤¡£ +ÉÔÃí°Õ¤Ê¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤ò¹Ô¤¦¤È¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤Ï´Êñ¤Ë²áÉé²Ù¾õÂ֤ˤʤ롣 +¿·¤·¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥È¥³¥ë¤Ë¤Ï¡¢¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤Ç¤Ï¤Ê¤¯ +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤òÍѤ¤¤ë¤Û¤¦¤¬¤è¤¤¡£ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤Ï¿ä¾©¤µ¤ì¤Ê¤¤¡£ +.PP +¾¤Î BSD ¤Î¥½¥±¥Ã¥È¼ÂÁõ¤Ç¤Ï¡¢ +.B IP_RCVDSTADDR +¤È +.B IP_RECVIF +¤È¤¤¤Ã¤¿¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤ª¤ê¡¢ +°¸À襢¥É¥ì¥¹¤ä¼õ¿®¥Ç¡¼¥¿¥°¥é¥à¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬¼èÆÀ¤Ç¤­¤ë¤è¤¦¤Ë +¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤â¤¢¤ë¡£ +Linux ¤ÇƱ¤¸¤³¤È¤ò¤ä¤é¤»¤ë¤Ë¤Ï¡¢¤è¤ê°ìÈÌŪ¤Ê +.B IP_PKTINFO +¤¬»È¤¨¤ë¡£ +.PP +¤¤¤¯¤Ä¤«¤Î BSD ¤Î¥½¥±¥Ã¥È¼ÂÁõ¤Ç¤Ï +.B IP_RECVTTL +¥ª¥×¥·¥ç¥ó¤âÄ󶡤µ¤ì¤Æ¤¤¤ë¤¬¡¢¥¿¥¤¥× +.B IP_RECVTTL +¤ÎÊä½õ¥á¥Ã¥»¡¼¥¸¤Ï¼õ¿®¥Ñ¥±¥Ã¥È¤È¤È¤â¤ËÅϤµ¤ì¤ë¡£ +¤³¤ì¤Ï Linux ¤Ç»È¤ï¤ì¤Æ¤¤¤ë +.B IP_TTL +¥ª¥×¥·¥ç¥ó¤È¤Ï°Û¤Ê¤ëÆ°ºî¤Ç¤¢¤ë¡£ +.PP +.B SOL_IP +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë¤Ï°Ü¿¢À­¤¬¤Ê¤¤¡£ +BSD ¥Ù¡¼¥¹¤Î¥×¥í¥È¥³¥ë¥¹¥¿¥Ã¥¯¤Ç¤Ï +.B IPPROTO_IP +¥ì¥Ù¥ë¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +.SS °Ü¿¢À­ +Linux 2.0 ¤È¤Î¸ß´¹À­¤Î¤¿¤á¤Ë¡¢ obsolete ¤Ê +.BI "socket(AF_INET, SOCK_PACKET, " protocol ) +¤È¤¤¤¦½ñ¼°¤Ç¤â +.BR packet (7) +¤ò¥ª¡¼¥×¥ó¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¬¡¢¤³¤ì¤Ï¤ª´«¤á¤Ç¤­¤Ê¤¤¡£º£¸å¤Ï +.BI "socket(AF_PACKET, SOCK_RAW, " protocol ) +¤òÂå¤ï¤ê¤ËÍѤ¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£¼ç¤Ê°ã¤¤¤Ï¡¢¥¸¥§¥Í¥ê¥Ã¥¯¤Ê¥ê¥ó¥¯ÁØÍѤΠ+.I sockaddr_ll +¥¢¥É¥ì¥¹¹½Â¤ÂΤ¬¡¢¸Å¤¤ +.B sockaddr_pkt +¤ËÊѤï¤Ã¤ÆÍѤ¤¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤³¤È¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +¥¨¥é¡¼¤ÎÃͤ¬Á´¤¯¼óÈø°ì´Ó¤·¤Æ¤¤¤Ê¤¤¡£ +.PP +IP ¸ÇÍ­¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤¿¤á¤Î ioctl ¤È +ARP ¥Æ¡¼¥Ö¥ë¤Î¤³¤È¤¬µ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï +.I in_pktinfo +¤ÎÄêµÁ¤ò˺¤ì¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ë¡£ +¸½»þÅÀ¤Ç¤Î¤È¤ê¤¢¤¨¤º¤ÎÂкö¤È¤·¤Æ¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤Ë¤¢¤ëÄêµÁ¤ò¥×¥í¥°¥é¥àÃæ¤Ë +¥³¥Ô¡¼¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£ +.PP +.BR recvmsg (2) +¤Ç +.I msg_name +¤Ë +.B MSG_ERRQUEUE +¤ò»ØÄꤷ¤Æ¡¢¼õ¿®¥Ñ¥±¥Ã¥È¤ËÆþ¤Ã¤Æ¤¤¤¿°¸À襢¥É¥ì¥¹¤ò¼èÆÀ¤¹¤ëÊýË¡¤Ï +2.2 ¥«¡¼¥Í¥ë¤Î°ìÉô¤Ç¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¡£ +.\" .SH Ãø¼Ô +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï Andi Kleen ¤¬½ñ¤¤¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR recvmsg (2), +.BR sendmsg (2), +.BR byteorder (3), +.BR ipfw (4), +.BR capabilities (7), +.BR netlink (7), +.BR raw (7), +.BR socket (7), +.BR tcp (7), +.BR udp (7) +.PP +.BR RFC\ 791 : +¥ª¥ê¥¸¥Ê¥ë¤Î IP ¤Î»ÅÍÍ +.br +.BR RFC\ 1122 : +IPv4 ¥Û¥¹¥È¤ÎɬÍ×¾ò·ï +.br +.BR RFC\ 1812 : +IPv4 ¥ë¡¼¥¿¤ÎɬÍ×¾ò·ï +.\" FIXME autobind INADDR REUSEADDR diff --git a/release/man7/ipv6.7 b/release/man7/ipv6.7 new file mode 100644 index 00000000..1574c883 --- /dev/null +++ b/release/man7/ipv6.7 @@ -0,0 +1,347 @@ +.\" This man page is Copyright (C) 2000 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. +.\" $Id: ipv6.7,v 1.4 2001/08/15 18:01:06 hanataka Exp $ +.\" +.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. +.\" Translated Sun 18 Feb 2001 by NAKANO Takeo +.\" Updated Wed 4 Apr 2001 by Yuichi SATO +.\" Updated Sat Dec 17 09:31:21 JST 2005 by Yuichi SATO +.\" Updated 2007-05-28, Akihiro MOTOKI , LDP v2.50 +.\" Updated 2008-08-07, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD: flow identifier ¥Õ¥í¡¼»ØÄê»Ò +.\"WORD: control message À©¸æ¥á¥Ã¥»¡¼¥¸ +.\"WORD: incoming ¡Á ¼õ¿® (¥Ñ¥±¥Ã¥È¡¢¥Ç¡¼¥¿¥°¥é¥à) +.\"WORD: outgoing ¡Á Á÷¿® (¥Ñ¥±¥Ã¥È¡¢¥Ç¡¼¥¿¥°¥é¥à) +.\"WORD: asynchronous error ÈóƱ´ü¥¨¥é¡¼ +.\" +.TH IPV6 7 2009-02-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +ipv6, AF_INET6 \- Linux ¤Î IPv6 ¥×¥í¥È¥³¥ë¼ÂÁõ +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.IB tcp6_socket " = socket(AF_INET6, SOCK_STREAM, 0);" +.br +.IB raw6_socket " = socket(AF_INET6, SOCK_RAW, " protocol ");" +.br +.IB udp6_socket " = socket(AF_INET6, SOCK_DGRAM, " protocol ");" +.SH ÀâÌÀ +Linux 2.2 ¤Ç¤Ï¡¢Internet Protocol, version 6 ¤ò +¥ª¥×¥·¥ç¥ó¤È¤·¤Æ¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ï¡¢Linux ¥«¡¼¥Í¥ë¤È glibc 2.1 ¤Ç¤Î¼ÂÁõ¤Ë´ð¤Å¤¤¤Æ¡¢ +IPv6 ¤Î´ðËÜŪ¤Ê API ¤ò²òÀ⤹¤ë¡£ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï BSD ¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò¤â¤È¤Ë¤·¤Æ¤¤¤ë¡£ +.BR socket (7) +¤ò»²¾È¡£ +.PP +IPv6 API ¤Ï¡¢ +IPv4 API +.RB ( ip (7) +»²¾È) ¤È¤Û¤Ü¸ß´¹¤Ë¤Ê¤ë¤³¤È¤òÌܻؤ·¤Æ¤¤¤ë¡£ +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤ÏÁê°ãÅÀ¤Î¤ß¤ò²òÀ⤹¤ë¡£ +.PP +.B AF_INET6 +¥½¥±¥Ã¥È¤ò²¿¤é¤«¤Î¥×¥í¥»¥¹¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¤Ë¤Ï¡¢ +¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤ò +.I in6_addr +·¿¤ÎÊÑ¿ô +.I in6addr_any +¤«¤é¥³¥Ô¡¼¤·¤Æ¤¯¤ëɬÍפ¬¤¢¤ë¡£ +static ¤Ê½é´üÃÍ +.B IN6ADDR_ANY_INIT +¤âÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¡¢¤³¤ì¤ÏÄê¿ô¼°¤ËŸ³«¤µ¤ì¤ë¡£ +¤³¤ì¤é¤Îξ¼Ô¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç¤¢¤ë¡£ +.PP +IPv6 ¤Î¥ë¡¼¥×¥Ð¥Ã¥¯¥¢¥É¥ì¥¹ (::1) ¤Ï global ÊÑ¿ô +.I in6addr_loopback +¤«¤é¼èÆÀ¤Ç¤­¤ë¡£½é´ü²½¤Ë¤Ï +.B IN6ADDR_LOOPBACK_INIT +¤òÍѤ¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +v4-mapped-on-v6 ¥¢¥É¥ì¥¹·¿¤òÍѤ¤¤ë¤³¤È¤Ç¡¢ +IPv4 Àܳ¤â v6 API ¤Ç°·¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤¦¤¹¤ì¤Ð¡¢¥×¥í¥°¥é¥à¤Ï v6 ¤Î API ¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤À¤±¤Ç¡¢ +ξÊý¤Î¥×¥í¥È¥³¥ë¤ò¥µ¥Ý¡¼¥È¤Ç¤­¤ë¡£ +v4-mapped-on-v6 ¥¢¥É¥ì¥¹·¿¤Ï C ¥é¥¤¥Ö¥é¥êÆâÉô¤Î¥¢¥É¥ì¥¹¤ò +°·¤¦´Ø¿ô¤Ë¤è¤Ã¤ÆÆ©²áŪ¤Ë½èÍý¤µ¤ì¤ë¡£ +.PP +IPv4 ¤È IPv6 ¤Ï¥í¡¼¥«¥ë¥Ý¡¼¥È¶õ´Ö¤ò¶¦Í­¤¹¤ë¡£ +IPv4 ¤ÎÀܳ (¤Þ¤¿¤Ï¥Ñ¥±¥Ã¥È) ¤ò IPv6 ¥½¥±¥Ã¥È¤¬¼èÆÀ¤¹¤ë¤È¡¢ +ȯ¿®¸µ¥¢¥É¥ì¥¹¤¬ v6 ¤Ë¥Þ¥Ã¥×¤µ¤ì¡¢¤½¤ÎÀܳ (¥Ñ¥±¥Ã¥È) ¤â v6 ¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¡£ +.\"nakano: ºÇ¸å¤Î it ¤¬¤Ê¤Ë¤ò»Ø¤¹¤Î¤«¤ï¤«¤é¤ó¡£ +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.in +4n +.nf +struct sockaddr_in6 { + sa_family_t sin6_family; /* AF_INET6 */ + in_port_t sin6_port; /* port number */ + uint32_t sin6_flowinfo; /* IPv6 flow information */ + struct in6_addr sin6_addr; /* IPv6 address */ + uint32_t sin6_scope_id; /* Scope ID (new in 2.4) */ +}; + +struct in6_addr { + unsigned char s6_addr[16]; /* IPv6 address */ +}; +.fi +.in +.sp +.I sin6_family +¤Ï¾ï¤Ë +.B AF_INET6 +¤ËÀßÄꤵ¤ì¤ë¡£ +.I sin6_port +¤Ï¥×¥í¥È¥³¥ë¥Ý¡¼¥È¤Ç¤¢¤ë +.RB ( ip (7) +¤Î +.I sin_port +¤ò»²¾È)¡£ +.I sin6_flowinfo +¤Ï IPv6 ¤Î¥Õ¥í¡¼»ØÄê»Ò (flow identifier) ¤Ç¤¢¤ë¡£ +.I sin6_addr +¤Ï 128 ¥Ó¥Ã¥È¤Î IPv6 ¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +.I sin6_scope_id +¤Ï¥¢¥É¥ì¥¹¤Î¥¹¥³¡¼¥×¤Ë°Í¸¤·¤¿ ID ¤Ç¤¢¤ë +(¤³¤ì¤Ï Linux 2.4 ¤ÇƳÆþ¤µ¤ì¤¿)¡£ +Linux ¤Î¾ì¹ç¤Ï¡¢¤³¤ì¤Ï¥ê¥ó¥¯¥¹¥³¡¼¥×¥¢¥É¥ì¥¹¤Ç¤·¤«¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤¡£ +¤³¤Î¾ì¹ç +.I sin6_scope_id +¤Ë¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬´Þ¤Þ¤ì¤ë¤³¤È¤Ë¤Ê¤ë +.RB ( netdevice (7) +¤ò»²¾È)¡£ +.PP +IPv6 ¤Ï²¿¼ïÎफ¤Î¥¢¥É¥ì¥¹¥¿¥¤¥×¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +ñ°ì¤Î¥Û¥¹¥È¤ò¥¢¥É¥ì¥¹¤¹¤ë¤¿¤á¤Î unicast¡¢ +¥Û¥¹¥È¤Î¥°¥ë¡¼¥×¤ò¥¢¥É¥ì¥¹¤¹¤ë¤¿¤á¤Î multicast¡¢ +¥Û¥¹¥È¤Î¥°¥ë¡¼¥×Ãæ¤ÇºÇ¤â¶á¤¯¤Ë¤¤¤ë¤â¤Î¤ò¥¢¥É¥ì¥¹¤¹¤ë¤¿¤á¤Î anycast +(¤³¤ì¤Ï Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤)¡¢ +IPv4 ¥Û¥¹¥È¤ò¥¢¥É¥ì¥¹¤¹¤ë¤¿¤á¤Î IPv4-on-IPv6¡£ +¾¤Ë¤âͽÌóºÑ¤ß¤Î¥¢¥É¥ì¥¹¥¿¥¤¥×¤¬¤¢¤ë¡£ +.PP +IPv6 ¤Ç¤Î¥¢¥É¥ì¥¹É½µ­¤Ï 2 ·å¤Î 16 ¿Ê¿ô 16 ¸Ä¤«¤é¤Ê¤ê¡¢ +\(aq:\(aq ¤Ï¶èÀÚ¤êʸ»ú¤Ï¤Ç¡¢"::" ¤Ï 0 ¥Ó¥Ã¥È¤Îʸ»úÎó¤òɽ¤¹¡£ +Æüì¤Ê¥¢¥É¥ì¥¹¤È¤·¤Æ¡¢¥ë¡¼¥×¥Ð¥Ã¥¯¤òɽ¤¹ ::1¡¢ +IPv4-mapped-on-IPv6 ¤òɽ¤¹ ::FFFF:: ¤¬¤¢¤ë¡£ +.PP +IPv6 ¤Î¥Ý¡¼¥È¶õ´Ö¤Ï IPv4 ¤È¶¦Í­¤µ¤ì¤Æ¤¤¤ë¡£ +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +IPv6 ¤Ï¥×¥í¥È¥³¥ë¸ÇÍ­¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ò¤¤¤¯¤Ä¤«¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Ï +.BR setsockopt (2) +¤ÇÀßÄê¤Ç¤­¡¢ +.BR getsockopt (2) +¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +IPv6 ¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë¤Ï +.B IPPROTO_IPV6 +¤Ç¤¢¤ë¡£ +¥Ö¡¼¥ëÀ°¿ô¤Î¥Õ¥é¥°¤Ï¡¢0 ¤¬µ¶¤Ç¤¢¤ê¡¢¤½¤ì°Ê³°¤Ï¿¿¤Ç¤¢¤ë¡£ +.TP +.B IPV6_ADDRFORM +.B AF_INET6 +¥½¥±¥Ã¥È¤òÊ̤Υ¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Î¥½¥±¥Ã¥È¤ËÊѤ¨¤ë¡£ +¸½ºß¤Ï +.B AF_INET +¤Î¤ß¤¬Êѹ¹Àè¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤È¤·¤Æ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤¬µö²Ä¤µ¤ì¤ë¤Î¤Ï¡¢IPv6 ¤¬Àܳ¤µ¤ì¡¢ +v4-mapped-on-v6 ¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤¿¾ì¹ç¤Ë¸Â¤é¤ì¤ë¡£ +°ú¤­¿ô¤Ï +.B AF_INET +¤¬Æþ¤Ã¤Æ¤¤¤ëÀ°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +v4-mapped ¥½¥±¥Ã¥È¤ò¡¢IPv6 API ¤ò°·¤¨¤Ê¤¤¥×¥í¥°¥é¥à¤ËÂФ·¤Æ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤È¤·¤ÆÅϤ¹¾ì¹ç¤ËÊØÍø¡£ +.TP +.B IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP +multicast ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤òÀ©¸æ¤¹¤ë¡£ +°ú¤­¿ô¤Ï +.I struct ipv6_mreq +¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡£ +.\" FIXME IPV6_CHECKSUM ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£ +.\" FIXME IPV6_JOIN_ANYCAST ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£ +.\" FIXME IPV6_LEAVE_ANYCAST ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£ +.\" FIXME IPV6_RECVPKTINFO ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£ +.\" FIXME IPV6_2292PKTINFO ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£ +.\" FIXME ¾¤Ë¤â¿¤¯¤Îµ­½Ò¤¹¤Ù¤­ IPV6_* ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬¤¢¤ë¤À¤í¤¦¡£ +.TP +.B IPV6_MTU +¤½¤Î¥½¥±¥Ã¥È¤ËÂФ·¤ÆÍѤ¤¤ë MTU ¤ÎÃͤòÀßÄꤹ¤ë¡£ +MTU ¤ÎÂ礭¤µ¤Ï¡¢ +¤½¤Î¥Ç¥Ð¥¤¥¹¤Î MTU ¤Þ¤¿¤Ï (Path MTU Discovery +¤¬²Äǽ¤Ê¤é) ¤½¤Î·ÐÏ©¤Î MTU ¤ÎÂ礭¤µ°Ê²¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +°ú¤­¿ô¤ÏÀ°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +.TP +.B IPV6_MTU_DISCOVER +¤½¤Î¥½¥±¥Ã¥È¤Ç¤Î Path MTU Discovery ¤òÀ©¸æ¤¹¤ë¡£ +¾ÜºÙ¤Ï +.BR ip (7) +¤Î +.B IP_MTU_DISCOVER +¤ò»²¾È¡£ +.TP +.B IPV6_MULTICAST_HOPS +¤½¤Î¥½¥±¥Ã¥È¤Ç¤Î multicast ¤Î hop ¿ô¤Î¾å¸ÂÃͤòÀßÄꤹ¤ë¡£ +°ú¤­¿ô¤ÏÀ°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +\-1 ¤ò»ØÄꤹ¤ë¤È·ÐÏ©¤Î¥Ç¥Õ¥©¥ë¥È¤òÍѤ¤¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤«¤é 255 ¤ÎÈϰϤò»ØÄꤹ¤ë¡£ +.TP +.B IPV6_MULTICAST_IF +¤½¤Î¥½¥±¥Ã¥È¤Ç¤Î¡¢Á÷¿® multicast ¥Ñ¥±¥Ã¥È¤ËÍѤ¤¤ë¥Ç¥Ð¥¤¥¹¤òÀßÄꤹ¤ë¡£ +¤³¤ì¤Ï +.B SOCK_DGRAM +¤ª¤è¤Ó +.B SOCK_RAW +³Æ¥½¥±¥Ã¥È¤Ç¤Î¤ßµö¤µ¤ì¤ë¡£ +°ú¤­¿ô¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÀ°¿ôÃÍ +.RB ( netdevice (7) +¤ò»²¾È) ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +.TP +.B IPV6_MULTICAST_LOOP +¥½¥±¥Ã¥È¤¬¡¢¼«Ê¬¼«¿È¤ÎÁ÷¿®¤·¤¿ +multicast ¥Ñ¥±¥Ã¥È¤ò´Æ»ë¤¹¤ë¤«¤É¤¦¤«¤òÀ©¸æ¤¹¤ë¡£ +°ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤؤΥݥ¤¥ó¥¿¡£ +.TP +.B IPV6_PKTINFO +¥Ç¡¼¥¿¥°¥é¥à¤ÎÅþÃå»þ¤Ë¤ª¤±¤ë +.B IPV6_PKTINFO +À©¸æ¥á¥Ã¥»¡¼¥¸¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¤òÀßÄꤹ¤ë¡£ +.B SOCK_DGRAM +¥½¥±¥Ã¥È¤Þ¤¿¤Ï +.B SOCK_RAW +¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Î¤ßµö²Ä¤µ¤ì¤ë¡£ +°ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤÎÆþ¤Ã¤¿À°¿ô¡£ +.TP +.nh +.B IPV6_RTHDR, IPV6_AUTHHDR, IPV6_DSTOPS, IPV6_HOPOPTS, IPV6_FLOWINFO, IPV6_HOPLIMIT +.hy +¼õ¿®¥Ñ¥±¥Ã¥È¤Î¥Ç¡¼¥¿¥°¥é¥à¤Ë³ÈÄ¥¥Ø¥Ã¥À¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¡¢ +À©¸æ¥á¥Ã¥»¡¼¥¸¤ÎÇÛÁ÷¤òÀßÄꤹ¤ë¡£ +.BR IPV6_RTHDR : +routing ¥Ø¥Ã¥À¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£ +.BR IPV6_AUTHHDR : +authentication ¥Ø¥Ã¥À¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£ +.BR IPV6_DSTOPTS : +destination ¥ª¥×¥·¥ç¥ó¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£ +.BR IPV6_HOPOPTS : +hop ¥ª¥×¥·¥ç¥ó¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£ +.BR IPV6_FLOWINFO : +flow ID ¤ò´Þ¤àÀ°¿ô¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£ +.BR IPV6_HOPLIMIT : +¥Ñ¥±¥Ã¥È¤Î hop ¥«¥¦¥ó¥È¤ò´Þ¤àÀ°¿ô¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£ +À©¸æ¥á¥Ã¥»¡¼¥¸¤Ï¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Î¤â¤Î¤ÈƱ¤¸¥¿¥¤¥×¤ò»ý¤Ä¡£ +¤³¤ì¤é¤Î¤¹¤Ù¤Æ¤Î¥Ø¥Ã¥À¥ª¥×¥·¥ç¥ó¤Ï¡¢ +ŬÀÚ¤ÊÀ©¸æ¥á¥Ã¥»¡¼¥¸¤ò +.BR sendmsg (2) +¤ÎÀ©¸æ¥Ð¥Ã¥Õ¥¡¡¼¤Ë½ñ¤­¤³¤á¤Ð¡¢ +Á÷¿®¥Ñ¥±¥Ã¥È¤Ë¤Ç¤âÀßÄê¤Ç¤­¤ë¡£ +.B SOCK_DGRAM +¥½¥±¥Ã¥È¤Þ¤¿¤Ï +.B SOCK_RAW +¥½¥±¥Ã¥È¤Ç¤Î¤ßµö¤µ¤ì¤ë¡£°ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤؤΥݥ¤¥ó¥¿¡£ +.TP +.B IPV6_RECVERR +ÈóƱ´ü¥¨¥é¡¼ (asynchronous error) ¥ª¥×¥·¥ç¥ó¤Î¼õ¿®¤òÀ©¸æ¤¹¤ë¡£ +¾ÜºÙ¤Ï +.BR ip (7) +¤Î +.B IP_RECVERR +¤ò»²¾È¡£ +°ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤؤΥݥ¤¥ó¥¿¡£ +.TP +.B IPV6_ROUTER_ALERT +¤³¤Î¥½¥±¥Ã¥È¤Ç¡¢router alert hop-by-hop ¥ª¥×¥·¥ç¥ó¤ÎÉÕ¤¤¤¿Å¾Á÷¥Ñ¥±¥Ã¥È¤ò +Ä̤¹¤«¤É¤¦¤«¤òÀ©¸æ¤¹¤ë¡£ +.B SOCK_RAW +¥½¥±¥Ã¥È¤Ç¤Î¤ßµö²Ä¤µ¤ì¤ë¡£ +tap ¤µ¤ì¤¿¥Ñ¥±¥Ã¥È¤Ï¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¤ÏžÁ÷¤µ¤ì¤Ê¤¤¡£¤½¤¦¤·¤¿¥Ñ¥±¥Ã¥È¤ò +ºÆÅÙÁ÷¿®¤¹¤ë¤Î¤Ï¥æ¡¼¥¶¡¼¤ÎÀÕǤ¤Ç¤¢¤ë¡£ +°ú¤­¿ô¤ÏÀ°¿ô (integer) ¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ +Àµ¤ÎÀ°¿ô¤Ï˵¼õ¤ò¹Ô¤¦ router alert ¥ª¥×¥·¥ç¥óÃͤò¼¨¤¹¡£ +¥ª¥×¥·¥ç¥óÃͤ¬¤³¤ÎÀ°¿ô¤Ç¤¢¤ë router alert ¥ª¥×¥·¥ç¥ó¤ÎÉÕ¤¤¤¿¥Ñ¥±¥Ã¥È¤Ï +¥½¥±¥Ã¥È¤ËÇÛÁ÷¤µ¤ì¤ë¡£Éé¤ÎÀ°¿ô¤ò»ØÄꤹ¤ë¤È¡¢¤³¤Î¥½¥±¥Ã¥È¤Ø¤Î +router alert ¥ª¥×¥·¥ç¥ó¤ÎÉÕ¤¤¤¿¥Ñ¥±¥Ã¥È¤ÎÇÛÁ÷¤¬¹Ô¤ï¤ì¤Ê¤¤¡£ +.\" FLOWLABEL_MGR, FLOWINFO_SEND +.TP +.B IPV6_UNICAST_HOPS +¤½¤Î¥½¥±¥Ã¥È¤Ç¤Î unicast ¤Î hop ¿ô¤Î¾å¸ÂÃͤòÀßÄꤹ¤ë¡£ +°ú¤­¿ô¤ÏÀ°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +\-1 ¤ò»ØÄꤹ¤ë¤È·ÐÏ©¤Î¥Ç¥Õ¥©¥ë¥È¤òÍѤ¤¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤«¤é 255 ¤ÎÈϰϤò»ØÄꤹ¤ë¡£ +.TP +.BR IPV6_V6ONLY " (Linux 2.4.21 °Ê¹ß¤ª¤è¤Ó 2.6 °Ê¹ß)" +.\" See RFC 3493 +¤³¤Î¥Õ¥é¥°¤ò¿¿ (0 °Ê³°) ¤ËÀßÄꤹ¤ë¤È¡¢¤½¤Î¥½¥±¥Ã¥È¤Ï IPv6 ¥Ñ¥±¥Ã¥È¤À¤±¤ò +Á÷¼õ¿®¤¹¤ë¤è¤¦¤ËÀ©¸Â¤µ¤ì¤ë¡£ +¤³¤Î¾ì¹ç¡¢IPv4 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È IPv6 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬Æ±»þ¤Ë +°ì¤Ä¤Î¥Ý¡¼¥È¤ò¥Ð¥¤¥ó¥É¤Ç¤­¤ë¡£ + +¤³¤Î¥Õ¥é¥°¤òµ¶ (0) ¤ËÀßÄꤹ¤ë¤È¡¢¤½¤Î¥½¥±¥Ã¥È¤Ï¥Ñ¥±¥Ã¥È¤ÎÁ÷¼õ¿®¤Ë +IPv6 ¥¢¥É¥ì¥¹¤È IPv4-mapped IPv6 ¥¢¥É¥ì¥¹¤ÎξÊý¤ò»ÈÍѤǤ­¤ë¡£ + +°ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤÎÆþ¤Ã¤¿À°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ + +¤³¤Î¥Õ¥é¥°¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤϥե¡¥¤¥ë +.I /proc/sys/net/ipv6/bindv6only +¤ÎÆâÍƤˤè¤êÄêµÁ¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 0 (µ¶) ¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +IPv6 API ¤ò libc5 ¥Ù¡¼¥¹¤Ç Linux ¸þ¤±¤Ë¼ÂÁõ¤·¤¿¡¢°ÊÁ°¤Î +.I libinet6 +¤Ë¤Ä¤¤¤Æ¤Ï¤³¤³¤Ç¤Ïµ­½Ò¤·¤Æ¤¤¤Ê¤¤¡£ +¤ª¤½¤é¤¯ºÙ¤«¤¤¤È¤³¤í¤Ë¤ÏÁê°ãÅÀ¤¬¤¢¤ë¤À¤í¤¦¡£ +.PP +Linux 2.4 ¤Ç¤Ï 64 ¥Ó¥Ã¥È¤Î¥Û¥¹¥È¤ËÂФ·¤Æ +.I sockaddr_in6 +¤Î¥Ð¥¤¥Ê¥ê¸ß´¹À­¤¬Êݤ¿¤ì¤Æ¤¤¤Ê¤¤¡£ +.I in6_addr +¤Î¥¢¥é¥¤¥ó¥á¥ó¥È¤¬Êѹ¹¤µ¤ì¡¢¤Þ¤¿ +.I sin6_scope_id +¥Õ¥£¡¼¥ë¥É¤¬¿·¤¿¤ËÄɲ䵤줿¤«¤é¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¸ß´¹À­¤ÏÊݤ¿¤ì¤Æ¤¤¤ë¤¬¡¢ +.I sockaddr_in6 +¤ä +.I in6_addr +¤ò¾¤Î¹½Â¤ÂΤ˴ޤó¤Ç¤¤¤ë¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï +Êݤ¿¤ì¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤ì¤Ï i386 ¤Î¤è¤¦¤Ê 32 ¥Ó¥Ã¥È¤Î¥Û¥¹¥È¤Ç¤ÏÌäÂê¤Ë¤Ê¤é¤Ê¤¤¡£ +.PP +.I sin6_flowinfo +¥Õ¥£¡¼¥ë¥É¤Ï Linux 2.4 ¤ÇÅо줷¤¿¡£ +¤³¤ì¤¬ÅϤµ¤ì¤¿¥¢¥É¥ì¥¹Ä¹¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤È¡¢ +¥«¡¼¥Í¥ë¤ËÆ©²áŪ¤ËÅϤµ¤ì¡¢Æɤޤì¤ë¡£ +.\"nakano ¤³¤³¤ï¤«¤é¤Ê¤¤¤Ç¤¹... +¤è¤êŤ¤¥¢¥É¥ì¥¹¥Ð¥Ã¥Õ¥¡¤òÅϤ·¡¢ +¤½¤·¤ÆÁ÷¿®¥¢¥É¥ì¥¹¤ÎŤµ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ï +¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH Ãí°Õ +.I sockaddr_in6 +¹½Â¤ÂΤϥ¸¥§¥Í¥ê¥Ã¥¯¤Ê +.I sockaddr +¤è¤ê¤âÂ礭¤¤¡£ +¤¹¤Ù¤Æ¤Î¥¢¥É¥ì¥¹¥¿¥¤¥×¤¬ +.I struct sockaddr +¤ÎÃæ¤Ë°ÂÁ´¤ËǼ¤á¤é¤ì¤ë¤È²¾Äꤷ¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤Ï¡¢Âå¤ï¤ê¤Ë +.I struct sockaddr_storage +¤òÍѤ¤¤ë¤è¤¦¤ËÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.SH ¥Ð¥° +IPv6 ³ÈÄ¥ API ¤Ï¡¢¸½ºß¤Þ¤À RFC\ 2292 ¤ò´°Á´¤Ë¤Ï¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¡£ +2.2 ¥«¡¼¥Í¥ë¤Ï¼õ¿®¥ª¥×¥·¥ç¥ó¤ò¤Û¤Ü´°Á´¤Ë¥µ¥Ý¡¼¥È¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤¬¡¢ +glibc2.1 ¤Ë¤Ï IPv6 ¥ª¥×¥·¥ç¥ó¤òÀ¸À®¤¹¤ë¥Þ¥¯¥í¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤¤¡£ +.PP +EH ¤ª¤è¤Ó AH ¥Ø¥Ã¥À ¤Ç¤Î IPSec ¤Î¥µ¥Ý¡¼¥È¤Ï¸ºß¤·¤Ê¤¤¡£ +.PP +¥Õ¥í¡¼¥é¥Ù¥ë´ÉÍý¤Ï¤Þ¤À´°Á´¤Ç¤Ê¤¯¡¢¤³¤³¤Ë¤âµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +¤³¤Î man ¥Ú¡¼¥¸¤Ï¤Þ¤À´°À®¤·¤Æ¤¤¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cmsg (3), +.BR ip (7) +.LP +RFC\ 2553: IPv6 BASIC API. +Linux ¤Ï¤³¤Î RFC ¤Ë½àµò¤¹¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤ë¡£ +.LP +RFC\ 2460: IPv6 specification. diff --git a/release/man7/iso_8859-1.7 b/release/man7/iso_8859-1.7 new file mode 100644 index 00000000..b8d970ad --- /dev/null +++ b/release/man7/iso_8859-1.7 @@ -0,0 +1,185 @@ +'\" t +.\" Copyright 1993-1995 Daniel Quinlan (quinlan@yggdrasil.com) +.\" +.\" 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. +.\" +.\" 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 +.\" +.TH ISO_8859-1 7 1999-05-31 "Linux" "Linux Programmer's Manual" +.nh +.SH ̾Á° +iso_8859-1 \- ISO 8859-1 ʸ»ú½¸¹ç¤Î 8¿Ê¿ô¡¢10¿Ê¿ô¡¢16¿Ê¿ô¤Ë¤è¤ëÉä¹æ²½ +.SH ÀâÌÀ +ISO 8859 µ¬³Ê¤Ï ASCII ʸ»ú½¸¹ç (ISO 6460IRV ¤È¤·¤Æ¤âÃΤé¤ì¤Æ¤¤¤ë) ¤Î +¤¤¤¯¤Ä¤«¤Î 8 ¥Ó¥Ã¥È³ÈÄ¥¤ò´Þ¤ó¤Ç¤¤¤ë¡£Æä˽ÅÍ×¤Ê¤Î¤Ï ISO 8859-1¡¢ +"¥é¥Æ¥ó¡¦¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È No. 1" ¤Ç¡¢¹­¤¯¼ÂÁõ¤µ¤ì¡¢´û¤Ë ASCII ¤ËÂå¤ï¤Ã¤Æ +»ö¼Â¾å¤Îɸ½à¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤è¤¦¤Ë¤ß¤¨¤ë¡£ +.P +ISO 8859-1 ¤Ï°Ê²¼¤Î¸À¸ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë: ¥¢¥Õ¥ê¥«¡¼¥ó¥¹¸ì¡¢¥Ð¥¹¥¯¸ì¡¢ +¥«¥¿¥í¥Ë¥¢¸ì¡¢¥Ç¥ó¥Þ¡¼¥¯¸ì¡¢¥ª¥é¥ó¥À¸ì¡¢±Ñ¸ì¡¢¥Õ¥§¥í¡¼¸ì¡¢¥Õ¥£¥ó¥é¥ó¥É¸ì¡¢ +¥Õ¥é¥ó¥¹¸ì¡¢¥¬¥ê¥·¥¢¸ì¡¢¥É¥¤¥Ä¸ì¡¢¥¢¥¤¥¹¥é¥ó¥É¸ì¡¢¥¢¥¤¥ë¥é¥ó¥É¸ì¡¢¥¤¥¿¥ê¥¢¸ì¡¢ +¥Î¥ë¥¦¥§¡¼¸ì¡¢¥Ý¥ë¥È¥¬¥ë¸ì¡¢¥¹¥³¥Ã¥È¥é¥ó¥É¸ì¡¢¥¹¥Ú¥¤¥ó¸ì¡¢¥¹¥¦¥§¡¼¥Ç¥ó¸ì +.P +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) +.TE +.SS "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) ¤ò»²¾È¡£ ] +.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 +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 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 +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 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 +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 +.TE +.SH ´ØÏ¢¹àÌÜ +.BR ascii (7), +.BR iso_8859-15 (7) diff --git a/release/man7/iso_8859-15.7 b/release/man7/iso_8859-15.7 new file mode 100644 index 00000000..b584a8a5 --- /dev/null +++ b/release/man7/iso_8859-15.7 @@ -0,0 +1,183 @@ +'\" t +.\" Copyright 1993-1995 Daniel Quinlan (quinlan@yggdrasil.com) +.\" Copyright 1999 Dimitri Papadopoulos (dpo@club-internet.fr) +.\" +.\" 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) 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 +.\" +.TH ISO_8859-15 7 1999-05-31 "Linux" "Linux Programmer's Manual" +.nh +.SH ̾Á° +iso_8859-15 \- ISO 8859-15 ʸ»ú½¸¹ç¤Î 8¿Ê¿ô¡¢10¿Ê¿ô¡¢16¿Ê¿ô¤Ë¤è¤ëÉä¹æ²½ +.SH ÀâÌÀ +ISO 8859 µ¬³Ê¤Ï ASCII ʸ»ú½¸¹ç (ISO 646-IRV ¤È¤â¸Æ¤Ð¤ì¤ë) ¤Î +¤¤¤¯¤Ä¤«¤Î 8 ¥Ó¥Ã¥È³ÈÄ¥¤ò´Þ¤ó¤Ç¤¤¤ë¡£Æä˽ÅÍ×¤Ê ISO 8859-1¡¢ +"¥é¥Æ¥ó¡¦¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È No. 1" ¤Ç¡¢¹­¤¯¼ÂÁõ¤µ¤ì¡¢´û¤Ë ASCII ¤ËÂå¤ï¤Ã¤Æ +»ö¼Â¾å¤Îɸ½à¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤è¤¦¤Ë¤ß¤¨¤ë¡£°ìÊý¤Ç¤½¤ì¤Ï¥æ¡¼¥í (EURO) µ­¹æ¤¬ +´Þ¤Þ¤ì¤Æ¤ª¤é¤º¡¢¥Õ¥£¥ó¥é¥ó¥É¸ì¤È¥Õ¥é¥ó¥¹¸ì¤ò´°Á´¤Ë¥µ¥Ý¡¼¥È¤Ç¤­¤Æ¤¤¤Ê¤¤¡£ +ISO 8859-15 ¤Ï¤³¤ì¤é¤ÎÍ×µá¤òËþ¤¿¤¹¤¿¤á¤Ë ISO 8859-1 ¤ò½¤Àµ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.P +ISO 8859-15 ¤Ï°Ê²¼¤Î¸À¸ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë: ¥¢¥ë¥Ð¥Ë¥¢¸ì¡¢¥Ð¥¹¥¯¸ì¡¢ +¥Ö¥ë¥¿¡¼¥Ë¥å¸ì¡¢¥«¥¿¥í¥Ë¥¢¸ì¡¢¥Ç¥ó¥Þ¡¼¥¯¸ì¡¢¥ª¥é¥ó¥À¸ì¡¢±Ñ¸ì¡¢ +¥¨¥¹¥È¥Ë¥¢¸ì¡¢¥Õ¥§¥í¡¼¸ì¡¢¥Õ¥£¥ó¥é¥ó¥É¸ì¡¢¥Õ¥é¥ó¥¹¸ì¡¢¥Õ¥ê¡¼¥¹¥é¥ó¥É¸ì¡¢ +¥¬¥ê¥·¥¢¸ì¡¢¥É¥¤¥Ä¸ì¡¢¥°¥ê¡¼¥ó¥é¥ó¥É¸ì¡¢¥¢¥¤¥¹¥é¥ó¥É¸ì¡¢ +¥¢¥¤¥ë¥é¥ó¥É¡¦¥²¡¼¥ë¸ì¡¢¥¤¥¿¥ê¥¢¸ì¡¢¥é¥Æ¥ó¸ì¡¢¥ë¥¯¥»¥ó¥Ö¥ë¥°¸ì¡¢ +¥Î¥ë¥¦¥§¡¼¸ì¡¢¥Ý¥ë¥È¥¬¥ë¸ì¡¢¥ì¡¼¥È¥í¥Þ¥ó¥¹¸ì¡¢¥¹¥³¥Ã¥È¥é¥ó¥É¡¦¥²¡¼¥ë¸ì¡¢ +¥¹¥Ú¥¤¥ó¸ì¡¢¥¹¥¦¥§¡¼¥Ç¥ó¸ì¡£ +.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-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) ¤òŬÀڤʥե©¥ó¥È¤ò½àÈ÷¤·¤Æ»²¾È¡£ ] +.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 +243 163 A3 ¡ò POUND SIGN +244 164 A4 EURO SIGN +245 165 A5 ¡ï YEN SIGN +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 +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 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 +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 +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 +.TE +.SH ´ØÏ¢¹àÌÜ +.BR ascii (7), +.BR iso_8859-1 (7) diff --git a/release/man7/iso_8859-16.7 b/release/man7/iso_8859-16.7 new file mode 100644 index 00000000..6d32630f --- /dev/null +++ b/release/man7/iso_8859-16.7 @@ -0,0 +1,179 @@ +'\" t +.\" Copyright 2002 Ionel Mugurel Ciobica (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 +.\" 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) 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" +.nh +.SH ̾Á° +iso_8859-16 \- ISO 8859-16 ʸ»ú½¸¹ç¤Î 8¿Ê¿ô¡¢10¿Ê¿ô¡¢16¿Ê¿ô¤Ë¤è¤ëÉä¹æ²½ +.SH ÀâÌÀ +ISO 8859 µ¬³Ê¤Ï ASCII ʸ»ú½¸¹ç (ISO 646-IRV ¤È¤â¸Æ¤Ð¤ì¤ë) ¤Î +¤¤¤¯¤Ä¤«¤Î 8 ¥Ó¥Ã¥È³ÈÄ¥¤ò´Þ¤ó¤Ç¤¤¤ë¡£ ISO 8859-16¡¢ +¡Ö¥é¥Æ¥ó¡¦¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È No.10¡×¤ÏÃæ±û¡¦Åì¥è¡¼¥í¥Ã¥Ñ¤Î¥é¥Æ¥óʸ»ú¤òÉä¹æ²½ +¤¹¤ë¤¿¤á¤Î¤â¤Î¤À¤¬¡¢¤Þ¤À¼ÂÁõ¤·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¡¦¥Ù¥ó¥À¤Ï¤Ê¤¤¡£ +.P +ISO 8859-16 ¤Ï°Ê²¼¤Î¸À¸ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë: ¥¢¥ë¥Ð¥Ë¥¢¸ì¡¢¥Ü¥¹¥Ë¥¢¸ì¡¢ +¥¯¥í¥¢¥Á¥¢¸ì¡¢±Ñ¸ì¡¢¥Õ¥£¥ó¥é¥ó¥É¸ì¡¢¥É¥¤¥Ä¸ì¡¢¥Ï¥ó¥¬¥ê¡¼¸ì¡¢ +¥¢¥¤¥ë¥é¥ó¥É¸ì¡¢¥Ý¡¼¥é¥ó¥É¸ì¡¢¥ë¡¼¥Þ¥Ë¥¢¸ì¡¢¥¹¥í¥Ù¥Ë¥¢¸ì¡¢¥»¥ë¥Ó¥¢¸ì¡£ +.P +¤Þ¤¿¡¢°Ê²¼¤Î¥­¥ê¥ëʸ»ú¥Ù¡¼¥¹¤Î¸À¸ì¤â Latin 10 ¤Ë 1 ÂÐ 1 ¤ÇÊÑ´¹²Äǽ¤Ç¤¢¤ë: +¥Þ¥±¥É¥Ë¥¢¸ì¡¢¥»¥ë¥Ó¥¢¸ì¡£ +.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-16 ʸ»ú" +°Ê²¼¤Îɽ¤Ï ISO 8859-16 (Latin-10) ¤Îɽ¼¨²Äǽ¤Êʸ»ú¤Î¤¦¤Á +.BR ascii (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 +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 +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 +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 +.TE +.SH ´ØÏ¢¹àÌÜ +.BR ascii (7), +.BR iso_8859-1 (7), +.BR iso_8859-15 (7), +.BR iso_8859-2 (7) +.P +Êä­¾ðÊó: +.I ISO 8859-16 (Latin 10) Resources +(http://bucovina.chem.tue.nl/fonturi/index-en.html) diff --git a/release/man7/iso_8859-2.7 b/release/man7/iso_8859-2.7 new file mode 100644 index 00000000..17af3bea --- /dev/null +++ b/release/man7/iso_8859-2.7 @@ -0,0 +1,188 @@ +'\" t +.\" Copyright 1999 Roman Maurer (roman.maurer@hermes.si) +.\" Copyright 1993-1995 Daniel Quinlan (quinlan@yggdrasil.com) +.\" +.\" 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. +.\" +.\" 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 +.\" +.TH ISO_8859-2 7 2007-11-25 "Linux" "Linux Programmer's Manual" +.nh +.SH ̾Á° +iso_8859-2 \- ISO 8859-2 ʸ»ú½¸¹ç¤Î 8¿Ê¿ô¡¢10¿Ê¿ô¡¢16¿Ê¿ô¤Ë¤è¤ëÉä¹æ²½ +.SH ½ñ¼° +ISO 8859 µ¬³Ê¤Ï ASCII ʸ»ú½¸¹ç (ISO 646-IRV ¤È¤â¸Æ¤Ð¤ì¤ë) ¤Î +¤¤¤¯¤Ä¤«¤Î 8 ¥Ó¥Ã¥È³ÈÄ¥¤ò´Þ¤ó¤Ç¤¤¤ë¡£ISO 8859-2¡¢ + "¥é¥Æ¥ó¡¦¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È No. 2" ¤ÏÃæ±û¥è¡¼¥í¥Ã¥Ñ¡¢Åì¥è¡¼¥í¥Ã¥Ñ¤Î +¥é¥Æ¥óʸ»ú¤òÉä¹æ²½¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¡¢¤¤¤¯¤Ä¤«¤Î¥×¥í¥°¥é¥à¡¦¥Ù¥ó¥À¡¼¤â +¼ÂÁõ¤·¤Æ¤¤¤ë¡£ +.P +ISO 8859-2 ¤Ï°Ê²¼¤Î¸À¸ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë: ¥¢¥ë¥Ð¥Ë¥¢¸ì¡¢¥Ü¥¹¥Ë¥¢¸ì¡¢ +¥¯¥í¥¢¥Á¥¢¸ì¡¢¥Á¥§¥³¸ì¡¢±Ñ¸ì¡¢¥Õ¥£¥ó¥é¥ó¥É¸ì¡¢¥É¥¤¥Ä¸ì¡¢¥Ï¥ó¥¬¥ê¡¼¸ì¡¢ +¥¢¥¤¥ë¥é¥ó¥É¸ì¡¢¥Ý¡¼¥é¥ó¥É¸ì¡¢¥¹¥í¥ô¥¡¥­¥¢¸ì¡¢¥¹¥í¥ô¥§¥Ë¥¢¸ì¡¢¥½¥ë¥Ó¥¢¸ì¡£ +.P +¤Þ¤¿°Ê²¼¤Î¥­¥ê¥ëʸ»ú¥Ù¡¼¥¹¤Î¸À¸ì¤â 1 ÂÐ 1 ¤Ç Latin 2 ¤ËÃÖ¤­´¹¤¨¤ë¤³¤È +¤¬¤Ç¤­¤ë: ¥Þ¥±¥É¥Ë¥¢¸ì¡¢¥»¥ë¥Ó¥¢¸ì +.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-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) ¤ò +ŬÀڤʥե©¥ó¥È¤ò½àÈ÷¤·¤Æ»²¾È¡£ ] +.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 +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 +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 +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 +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 +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 +.TE +.SH ´ØÏ¢¹àÌÜ +.BR ascii (7), +.BR iso_8859-1 (7) +.P +ÄɲþðÊó: +.I ISO 8859-2 (Latin 2) ¾ðÊó +(http://sizif.mf.uni-lj.si/linux/cee/iso8859-2.html). diff --git a/release/man7/iso_8859-7.7 b/release/man7/iso_8859-7.7 new file mode 100644 index 00000000..a7338083 --- /dev/null +++ b/release/man7/iso_8859-7.7 @@ -0,0 +1,170 @@ +'\" t +.\" Copyright 1999 Dimitri Papadopoulos (dpo@club-internet.fr) +.\" +.\" 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) 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 +.\" +.TH ISO_8859-7 7 2008-10-30 "Linux" "Linux Programmer's Manual" +.nh +.SH ̾Á° +iso_8859-7 \- ISO 8859-7 ʸ»ú½¸¹ç¤Î 8¿Ê¿ô¡¢10¿Ê¿ô¡¢16¿Ê¿ô¤Ë¤è¤ëÉä¹æ²½ +.SH ÀâÌÀ +ISO 8859 µ¬³Ê¤Ï ASCII ʸ»ú½¸¹ç (ISO 646-IRV ¤È¤â¸Æ¤Ð¤ì¤ë) ¤Î +¤¤¤¯¤Ä¤«¤Î 8 ¥Ó¥Ã¥È³ÈÄ¥¤ò´Þ¤ó¤Ç¤¤¤ë¡£ISO 8859-7 ¤Ï¸½Âå¤ÎñĴ¤Î +¥®¥ê¥·¥¢¸ì¤Ë»ÈÍѤµ¤ì¤ëʸ»ú¤òÉä¹æ²½¤·¤Æ¤¤¤ë¡£ +.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-7 ʸ»ú" + +°Ê²¼¤Îɽ¤Ï ISO 8859-7 ¤Îɽ¼¨²Äǽ¤Êʸ»ú¤Î¤¦¤Á +.BR ascii (7) +¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸¤ËºÜ¤Ã¤Æ¤¤¤Ê¤¤¤â¤Î¤ò¼¨¤·¤Æ¤¤¤ë¡£ +4ÎóÌÜ¤Ï ISO 8859-7 ÍѤËÀßÄꤵ¤ì¤¿´Ä¶­¤Ç¤Î¤ßÀµ¤·¤¯É½¼¨¤Ç¤­¤ë¤À¤í¤¦¡£ + +[ ÌõÃí ¸¶Ê¸¤Ç¤Ï Char ¤ÎÉôʬ¤Ë ISO 8859-7 ¤Îʸ»ú¤¬¤¢¤Ã¤¿¤¬¡¢ +ÆüËܸì EUC ¤È¤ÎÊ»ÍѤÏÆñ¤·¤¤¤Î¤Çºï½ü¤·¡¢JIS X 0208 ¤ÎƱ¤¸Ê¸»ú¤ò +¼¨¤¹¤è¤¦¤Ë¤·¤¿¡£¤½¤Î¾¤Îʸ»ú¤Ë´Ø¤·¤Æ¤Ï +±Ñ¸ìÈǤΠiso_8859-7(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 +243 163 A3 ¡ò POUND SIGN +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 +254 172 AC ¢Ì NOT SIGN +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 +301 193 C1 ¦¡ GREEK CAPITAL LETTER ALPHA +302 194 C2 ¦¢ GREEK CAPITAL LETTER BETA +303 195 C3 ¦£ GREEK CAPITAL LETTER GAMMA +304 196 C4 ¦¤ GREEK CAPITAL LETTER DELTA +305 197 C5 ¦¥ GREEK CAPITAL LETTER EPSILON +306 198 C6 ¦¦ GREEK CAPITAL LETTER ZETA +307 199 C7 ¦§ GREEK CAPITAL LETTER ETA +310 200 C8 ¦¨ GREEK CAPITAL LETTER THETA +311 201 C9 ¦© GREEK CAPITAL LETTER IOTA +312 202 CA ¦ª GREEK CAPITAL LETTER KAPPA +313 203 CB ¦« GREEK CAPITAL LETTER LAMBDA +314 204 CC ¦¬ GREEK CAPITAL LETTER MU +315 205 CD ¦­ GREEK CAPITAL LETTER NU +316 206 CE ¦® GREEK CAPITAL LETTER XI +317 207 CF ¦¯ GREEK CAPITAL LETTER OMICRON +320 208 D0 ¦° GREEK CAPITAL LETTER PI +321 209 D1 ¦± GREEK CAPITAL LETTER RHO +323 211 D3 ¦² GREEK CAPITAL LETTER SIGMA +324 212 D4 ¦³ GREEK CAPITAL LETTER TAU +325 213 D5 ¦´ GREEK CAPITAL LETTER UPSILON +326 214 D6 ¦µ GREEK CAPITAL LETTER PHI +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 +341 225 E1 ¦Á GREEK SMALL LETTER ALPHA +342 226 E2 ¦Â GREEK SMALL LETTER BETA +343 227 E3 ¦Ã GREEK SMALL LETTER GAMMA +344 228 E4 ¦Ä GREEK SMALL LETTER DELTA +345 229 E5 ¦Å GREEK SMALL LETTER EPSILON +346 230 E6 ¦Æ GREEK SMALL LETTER ZETA +347 231 E7 ¦Ç GREEK SMALL LETTER ETA +350 232 E8 ¦È GREEK SMALL LETTER THETA +351 233 E9 ¦É GREEK SMALL LETTER IOTA +352 234 EA ¦Ê GREEK SMALL LETTER KAPPA +353 235 EB ¦Ë GREEK SMALL LETTER LAMBDA +354 236 EC ¦Ì GREEK SMALL LETTER MU +355 237 ED ¦Í GREEK SMALL LETTER NU +356 238 EE ¦Î GREEK SMALL LETTER XI +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 +363 243 F3 ¦Ò GREEK SMALL LETTER SIGMA +364 244 F4 ¦Ó GREEK SMALL LETTER TAU +365 245 F5 ¦Ô GREEK SMALL LETTER UPSILON +366 246 F6 ¦Õ GREEK SMALL LETTER PHI +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 +.TE +.SH È÷¹Í +ISO 8859-7 ¤Ï°ÊÁ°¤Ï ELOT-928 ¤È¤« ECMA-118:1986 ¤È¸Æ¤Ð¤ì¤Æ¤¤¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ascii (7) diff --git a/release/man7/iso_8859-9.7 b/release/man7/iso_8859-9.7 new file mode 100644 index 00000000..016fc597 --- /dev/null +++ b/release/man7/iso_8859-9.7 @@ -0,0 +1,170 @@ +'\" t +.\" Copyright 2002 Dimitri Papadopoulos (dpo@club-internet.fr) +.\" +.\" 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) 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 +.\" +.TH ISO_8859-9 7 2002-09-24 "Linux" "Linux Programmer's Manual" +.nh +.SH ̾Á° +iso_8859-9 \- ISO 8859-9 ʸ»ú½¸¹ç¤Î 8¿Ê¿ô¡¢10¿Ê¿ô¡¢16¿Ê¿ô¤Ë¤è¤ëÉä¹æ²½ +.SH ÀâÌÀ +ISO 8859 µ¬³Ê¤Ï ASCII ʸ»ú½¸¹ç (ÊÌ̾¡¢ISO 646-IRV) ¤Ø¤Î 8 ¥Ó¥Ã¥È³ÈÄ¥ +¤ò¤¤¤¯¤Ä¤«´Þ¤ó¤Ç¤¤¤ë¡£ISO 8859-9 (ÊÌ̾¡¢¥é¥Æ¥ó¡¦¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È No.2) +¤Ï¥È¥ë¥³¸ì¤Ë»ÈÍѤµ¤ì¤ëʸ»ú¤òÉä¹æ²½¤·¤Æ¤¤¤ë¡£ +.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-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) ¤òŬÀڤʥե©¥ó¥È¤ò½àÈ÷¤·¤Æ»²¾È¡£ ] +.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 +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 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 +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 +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 +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 +.TE +.SH ´ØÏ¢¹àÌÜ +.BR ascii (7) diff --git a/release/man7/koi8-r.7 b/release/man7/koi8-r.7 new file mode 100644 index 00000000..4a6020a3 --- /dev/null +++ b/release/man7/koi8-r.7 @@ -0,0 +1,205 @@ +'\" 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 2009-02-04 "Linux" "Linux Programmer's Manual" +.nh +.SH ̾Á° +koi8-r \- ¥Í¥Ã¥È¥ï¡¼¥¯¤Ç»È¤ï¤ì¤ë¥í¥·¥¢¸ìʸ»ú½¸¹ç¤Î 8 ¿Ê¿ô¡¢10 ¿Ê¿ô¡¢16 ¿Ê¿ô¤Ë¤è¤ëÉä¹æ²½ +.SH ÀâÌÀ +KOI8-R ¤Ï¿¤¯¤Î Unix ·Ï OS ¤Ç»È¤ï¤ì¤ë¥í¥·¥¢¸ìʸ½ñ¤òÉä¹æ²½¤¹¤ë +ʸ»ú½¸¹ç¤ÎÁªÂò»Þ¤Î°ì¤Ä¤Ç¤¢¤ë¡£ +KOI8-R ¤Ï¡¢¾¯¤Ê¤¯¤È¤âµì¥½¥Ó¥¨¥ÈϢˮ¤ÎÁ´¤Æ¤Î·÷Æâ¤Ë¤ª¤¤¤Æ +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î¥á¡¼¥ë¡¦¥Ë¥å¡¼¥¹¡¦WWW¡¦¤½¤Î¾¤ÎÂÐÏÃŪ¥µ¡¼¥Ó¥¹¤Î +»ö¼Â¾å¤Îɸ½à¤Ç¤¢¤Ã¤¿ KOI-8 ¤ò·Ñ¾µ¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.PP +KOI8-R ¤Ï RFC\ 1489 (¥­¥ê¥ëʸ»ú½¸¹ç¤ÎÅÐÏ¿) ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH Ãí°Õ +KOI8-R ¤Ï¥í¥·¥¢¸ì¤È±Ñ¸ì¤¬º®¤¸¤Ã¤¿Ê¸½ñ¤Î¤¿¤á¤Ë¥Ç¥¶¥¤¥ó¤µ¤ì¡¢ +¥í¥·¥¢¸ì¥­¥ê¥ëʸ»ú¤Î¤ß¤ò°·¤¦¡£ +¥¦¥¯¥é¥¤¥Ê¸ì¤ä¥Ù¥é¥ë¡¼¥·¸ì¤Î¥­¥ê¥ëʸ»ú¤ò»È¤¤¤¿¤¤¤È¤­¤Ï¡¢ +ISO-IR-111, KOI8-U (¥¦¥¯¥é¥¤¥Ê¸ìʸ»ú½¸¹ç), +(¸ÅÂå¥í¥·¥¢¸ìʸ½ñ¤Î¤¿¤á¤Î) KOI8-C ¤Ê¤É¤ò»î¤¹¤³¤È¡£ +¤³¤ì¤é¤Îʸ»ú½¸¹ç¤Ï¡¢¥í¥·¥¢¸ì¥­¥ê¥ëʸ»ú¤ÎÈÏ°Ï¤Ç¤Ï KOI8-R ¤ÈÅù¤·¤¤¡£ +.PP +¤â¤Ã¤È´°Á´¤Ê¥­¥ê¥ëʸ»ú½¸¹ç¤Ï ISO-8859-5 ʸ»ú½¸¹ç¤Ç¤âÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.SS "KOI8-R ʸ»ú½¸¹ç" +°Ê²¼¤Îɽ¤Ï 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 ¨¡ FORMS LIGHT HORIZONTAL +201 129 81 ¨¢ FORMS LIGHT VERTICAL +202 130 82 ¨£ FORMS LIGHT DOWN AND RIGHT +203 131 83 ¨¤ FORMS LIGHT DOWN AND LEFT +204 132 84 ¨¦ FORMS LIGHT UP AND RIGHT +205 133 85 ¨¥ FORMS LIGHT UP AND LEFT +206 134 86 ¨§ FORMS LIGHT VERTICAL AND RIGHT +207 135 87 ¨© FORMS LIGHT VERTICAL AND LEFT +210 136 88 ¨¨ FORMS LIGHT DOWN AND HORIZONTAL +211 137 89 ¨ª FORMS LIGHT UP AND HORIZONTAL +212 138 8A ¨« FORMS 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 SMALL 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 NON-BREAKING SPACE +233 155 9B BOTTOM HALF INTEGRAL +234 156 9C ¡¬ DEGREE SIGN +235 157 9D SUPERSCRIPT DIGIT TWO +236 158 9E ¡¦ MIDDLE DOT +237 159 9F ¡à DIVISION SIGN +240 160 A0 ¨¬ FORMS DOUBLE HORIZONTAL +241 161 A1 ¨­ FORMS DOUBLE VERTICAL +242 162 A2 FORMS DOWN SINGLE AND RIGHT DOUBLE +243 163 A3 §× CYRILLIC SMALL LETTER IO +244 164 A4 FORMS DOWN DOUBLE AND RIGHT SINGLE +245 165 A5 ¨® FORMS DOUBLE DOWN AND RIGHT +246 166 A6 FORMS DOWN SINGLE AND LEFT DOUBLE +247 167 A7 FORMS DOWN DOUBLE AND LEFT SINGLE +250 168 A8 ¨¯ FORMS DOUBLE DOWN AND LEFT +251 169 A9 FORMS UP SINGLE AND RIGHT DOUBLE +252 170 AA FORMS UP DOUBLE AND RIGHT SINGLE +253 171 AB ¨± FORMS DOUBLE UP AND RIGHT +254 172 AC FORMS UP SINGLE AND LEFT DOUBLE +255 173 AD FORMS UP DOUBLE AND LEFT SINGLE +256 174 AE ¨° FORMS DOUBLE UP AND LEFT +257 175 AF ¨¼ FORMS VERTICAL SINGLE AND RIGHT DOUBLE +260 176 B0 ¨· FORMS VERTICAL DOUBLE AND RIGHT SINGLE +261 177 B1 ¨² FORMS DOUBLE VERTICAL AND RIGHT +262 178 B2 ¨¾ FORMS VERTICAL SINGLE AND LEFT DOUBLE +263 179 B3 §§ CYRILLIC CAPITAL LETTER IO +264 180 B4 ¨¹ FORMS VERTICAL DOUBLE AND LEFT SINGLE +265 181 B5 ¨´ FORMS DOUBLE VERTICAL AND LEFT +266 182 B6 ¨¸ FORMS DOWN SINGLE AND HORIZONTAL DOUBLE +267 183 B7 ¨½ FORMS DOWN DOUBLE AND HORIZONTAL SINGLE +270 184 B8 ¨³ FORMS DOUBLE DOWN AND HORIZONTAL +271 185 B9 ¨º FORMS UP SINGLE AND HORIZONTAL DOUBLE +272 186 BA ¨¿ FORMS UP DOUBLE AND HORIZONTAL SINGLE +273 187 BB ¨µ FORMS DOUBLE UP AND HORIZONTAL +274 188 BC ¨» FORMS VERTICAL SINGLE AND HORIZONTAL DOUBLE +275 189 BD ¨À FORMS VERTICAL DOUBLE AND HORIZONTAL SINGLE +276 190 BE ¨¶ FORMS DOUBLE VERTICAL AND HORIZONTAL +277 191 BF COPYRIGHT SIGN +300 192 C0 §ð CYRILLIC SMALL LETTER IU +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 GE +310 200 C8 §ç CYRILLIC SMALL LETTER KHA +311 201 C9 §Ú CYRILLIC SMALL LETTER II +312 202 CA §Û CYRILLIC SMALL LETTER SHORT II +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 IA +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 YERI +332 218 DA §Ù CYRILLIC SMALL LETTER ZE +333 219 DB §ê CYRILLIC SMALL LETTER SHA +334 220 DC §ï CYRILLIC SMALL LETTER REVERSED 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 IU +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 GE +350 232 E8 §· CYRILLIC CAPITAL LETTER KHA +351 233 E9 §ª CYRILLIC CAPITAL LETTER II +352 234 EA §« CYRILLIC CAPITAL LETTER SHORT II +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 IA +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 YERI +372 250 FA §© CYRILLIC CAPITAL LETTER ZE +373 251 FB §º CYRILLIC CAPITAL LETTER SHA +374 252 FC §¿ CYRILLIC CAPITAL LETTER REVERSED E +375 253 FD §» CYRILLIC CAPITAL LETTER SHCHA +376 254 FE §¹ CYRILLIC CAPITAL LETTER CHE +377 255 FF §¼ CYRILLIC CAPITAL LETTER HARD SIGN + +.TE +.SH ´ØÏ¢¹àÌÜ +.BR ascii (7), +.BR iso-8859-7 (7), +.BR koi8-u (7), +RFC\ 1489, +http://koi8.pp.ru/ diff --git a/release/man7/locale.7 b/release/man7/locale.7 new file mode 100644 index 00000000..27e889be --- /dev/null +++ b/release/man7/locale.7 @@ -0,0 +1,223 @@ +.\" 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. +.\" +.\" Modified Sat Jul 24 17:28:34 1993 by Rik Faith +.\" Modified Sun Jun 01 17:16:34 1997 by Jochen Hein +.\" +.\" Modified Thu Apr 25 00:43:19 2002 by Bruno Haible +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated Wed Dec 24 21:08:08 JST 1997 +.\" by HANATAKA Shinya +.\" Modified Thu 14 Nov 2002 by NAKANO Takeo +.\" +.\"WORD: locale ¥í¥±¡¼¥ë +.\" +.TH LOCALE 7 2008-12-05 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +locale \- ¿¸À¸ì¥µ¥Ý¡¼¥È¤Î²òÀâ +.SH ½ñ¼° +.nf +.B #include +.fi +.SH ÀâÌÀ +¥í¥±¡¼¥ë (locale) ¤Ï¸À¸ì¤äʸ²½¥ë¡¼¥ë¤Î½¸¹ç¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Ï¡¢¥á¥Ã¥»¡¼¥¸½ÐÎϤ˻ÈÍѤ¹¤ë¸À¸ì¡¦¤¤¤í¤¤¤í¤Êʸ»ú½¸¹ç¡¦ +ɽµ­¤Ë´Ø¤¹¤ë´·½¬¤È¤¤¤Ã¤¿¤è¤¦¤ÊÌ̤ò¥«¥Ð¡¼¤·¤Æ¤¤¤ë¡£ +¥×¥í¥°¥é¥à¤ò¤¤¤í¤¤¤í¤Êʸ²½¤Ë°Ü¿¢²Äǽ¤È¤¹¤ë¤Ë¤Ï¡¢ +¤½¤Î¥×¥í¥°¥é¥à¤Ï¼«Ê¬¤Î¥í¥±¡¼¥ë¤ò·è¤á¤Æ¡¢ +¤½¤ì¤Ë±þ¤¸¤¿Å¬ÀÚ¤ÊÆ°ºî¤¬¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë +.I +¤Ë¤Ï¡¢¤³¤ÎÌÜŪ¤ËÊØÍø¤Ê¥Ç¡¼¥¿·¿¡¦´Ø¿ô¡¦¥Þ¥¯¥í¤Ê¤É¤ÎÀë¸À¤¬¤¢¤ë¡£ +.PP +¤³¤Î¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤Ë¤Ï¡¢ +¸½ºß¤Î¥í¥±¡¼¥ë¤òÀßÄꤹ¤ë +.BR setlocale (3) +¤È¡¢¿ôÃͤΥե©¡¼¥Þ¥Ã¥ÈÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ë +.BR localeconv (3) +¤¬¤¢¤ë¡£ +.PP +¥×¥í¥°¥é¥à¤ÎɬÍפ˱þ¤¸¤Æ¡¢¥í¡¼¥«¥ë¾ðÊó¤Ï¤¤¤í¤¤¤í¤Ê¥«¥Æ¥´¥ê¤Ëʬ¤«¤ì¤Æ¤ª¤ê¡¢ +¤½¤ì¤é¤Ï¥Þ¥¯¥í¤È¤·¤ÆÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤ò +.BR setlocale (3) +´Ø¿ô¤ÎºÇ½é¤Î°ú¤­¿ô¤ËÍѤ¤¤ë¤È¡¢ +¤³¤ì¤é¤Î¤É¤ì¤«¤ò˾¤à¥í¥±¡¼¥ë¤ËÀßÄê¤Ç¤­¤ë¡£ +.TP +.B LC_COLLATE +¤³¤ì¤ÏÃÏ°èŪ¤Ê¥¢¥ë¥Õ¥¡¥Ù¥Ã¥Èʸ»úÎó¤ÎÈæ³Ó¤Ë»ÈÍѤ¹¤ë +.BR strcoll (3) +´Ø¿ô¤È +.BR strxfrm (3) +´Ø¿ô¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¡£Î㤨¤Ð¥É¥¤¥Ä¸ì¤Î¥¨¥¹¥Ä¥§¥Ã¥È (±Ô¤¤ s) +¤Ï¡¢¥½¡¼¥È¤ÎºÝ "ss" ¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +.TP +.B LC_CTYPE +¤³¤ì¤Ï +.BR isupper (3) +¤ä +.BR toupper (3) +¤Î¤è¤¦¤Êʸ»ú¤ÎȽÄꡦÁàºî¤ò¤¹¤ë´Ø¿ô¤ä¡¢Â¿¥Ð¥¤¥Èʸ»ú¤ò°·¤¦ +.BR mblen (3) +¤ä +.BR wctomb (3) +¤Î¤è¤¦¤Ê´Ø¿ô¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¡£ +.TP +.B LC_MONETARY +.BR localeconv (3) +¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë¾ðÊó¤òÊѹ¹¤¹¤ë¡£ +¤³¤ì¤Ë¤Ï¾®¿ôÅÀ¤ä¶èÀڤꥳ¥ó¥Þ¤Î°ÌÃ֤ʤɡ¢ +¿ô»ú¤Îɽ¼¨ÊýË¡¤Ë´Ø¤¹¤ë¾ÜºÙ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£¤³¤Î¾ðÊó¤Ï +.BR strfmon (3) +´Ø¿ô¤¬ÆâÉô¤Ç»ÈÍѤ¹¤ë¡£ +.TP +.B LC_MESSAGES +¥á¥Ã¥»¡¼¥¸É½¼¨¤Ë»ÈÍѤ¹¤ë¸À¸ì¤òÊѹ¹¤¹¤ë¡£ +¤Þ¤¿¹ÎÄêŪ¡¦ÈÝÄêŪ¤Ê²óÅú¤ò¤É¤Î¤è¤¦¤Ëɽ¼¨¤¹¤ë¤«¤òÊѹ¹¤¹¤ë¡£ +¤³¤ì¤é¤Î¾ðÊó¤ò´Êñ¤Ë»ÈÍѤ¹¤ë¤¿¤á¤Ë¡¢ GNU C ¥é¥¤¥Ö¥é¥ê¤Ë¤Ï +.BR gettext (3), +.BR ngettext (3), +.BR rpmatch (3) +´Ø¿ô¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +GNU gettext ¥Õ¥¡¥ß¥ê¡¼¤Ë°¤¹¤ë´Ø¿ô¤Ï¡¢¥«¥Æ¥´¥ê¤¬ +.B """C""" +°Ê³°¤ÎÍ­¸ú¤Ê¥í¥±¡¼¥ë¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢´Ä¶­ÊÑ¿ô +.B LANGUAGE +¤Ë¤â½¾¤¦ +.RB ( LANGUAGE +¤Ï¥³¥í¥ó¶èÀÚ¤ê¤Î¥í¥±¡¼¥ë¤Î¥ê¥¹¥È¤Ç¤¢¤ë)¡£ +.TP +.B LC_NUMERIC +.BR printf (3) +´Ø¿ô¤ª¤è¤Ó +.BR scanf (3) +´Ø¿ô¤Î¥Õ¥¡¥ß¥ê¡¼¤Ç¥í¥±¡¼¥ëÀßÄê¤ò»È¤¦¤è¤¦»Ø¼¨¤µ¤ì¤¿¾ì¹ç¤Ë +ÍѤ¤¤ë¾ðÊó¤òÊѹ¹¤¹¤ë¡£¤³¤Î¾ðÊó¤Ï +.BR localeconv (3) +´Ø¿ô¤Ç¼èÆÀ¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.TP +.B LC_TIME +.BR strftime (3) +´Ø¿ô¤ÎÆ°ºî¤òÊѹ¹¤·¡¢ +ÃÏ°è¤ÇÍøÍѤµ¤ì¤Æ¤¤¤ëÊýË¡¤Ç¸½ºß»þ¹ï¤òɽ¼¨¤¹¤ë¡£ +Î㤨¤Ð¡¢¥è¡¼¥í¥Ã¥Ñ¤Î¿¤¯¤Ç¤Ï 24»þ´Ö¼°¤Î»þ·×¤ò»È¤¦¤¬¡¢ +¥¢¥á¥ê¥«¤Ç¤Ï 12»þ´Ö¼°¤Î»þ·×¤ò»È¤¦¡£ +.TP +.B LC_ALL +¾åµ­¤ÎÁ´¤Æ¡£ +.\" FIXME glibc 2.2.2 added new nonstandard locale categories: +.\" LC_ADDRESS, LC_IDENTIFICATION, LC_MEASUREMENT, LC_NAME, +.\" LC_PAPER, LC_TELEPHONE. These need to be documented. +.PP +.BR setlocale (3) +¤ÎÆóÈÖÌܤΰú¤­¿ô¤¬¶õʸ»úÎó \fB""\fP ¤Î¾ì¹ç¡¢ +¥Ç¥Õ¥©¥ë¥È¤Î¥í¥±¡¼¥ë¤Ï°Ê²¼¤Î¼ê½ç¤Ç·èÄꤹ¤ë: +.IP 1. +´Ä¶­ÊÑ¿ô +.B LC_ALL +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï +.B LC_ALL +¤ÎÃͤ¬»ÈÍѤµ¤ì¤ë¡£ +.IP 2. +¾åµ­¤Î¥«¥Æ¥´¥ê¤Î¤É¤ì¤«¤ÈƱ¤¸Ì¾Á°¤Î´Ä¶­ÊÑ¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤½¤Î¥«¥Æ¥´¥ê¤Ë¤Ï¤½¤ÎÃͤ¬»ÈÍѤµ¤ì¤ë¡£ +.IP 3. +´Ä¶­ÊÑ¿ô +.B LANG +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï +.B LANG +¤ÎÃͤ¬»ÈÍѤµ¤ì¤ë¡£ +.PP +ÃÏ°èŪ¤Ê¿ôÃÍ¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¾ðÊó¤Ï +.BR localeconv (3) +´Ø¿ô¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë +.I struct lconv +¤ÇÆÀ¤ë¤³¤È¤¬¤Ç¤­¡¢¤³¤ì¤Ï°Ê²¼¤Î¤è¤¦¤ËÀë¸À¤µ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +struct lconv { + + /* (Ä̲߰ʳ°¤Î) ¿ôÃ;ðÊó */ + + char *decimal_point; /* ¾®¿ôÅÀ¤Îʸ»ú */ + char *thousands_sep; /* ¾®¿ôÅÀ¤Îº¸Â¦¤Î¿ô»ú¤Î¥°¥ë¡¼¥×¤Î + ¶èÀÚ¤êʸ»ú */ + char *grouping; /* ¤½¤ì¤¾¤ì¤ÎÍ×ÁǤϳƥ°¥ë¡¼¥×¤Î¿ô»ú¤Î¸Ä¿ô¤Ç¤¢¤ë¡£ + ¥¤¥ó¥Ç¥Ã¥¯¥¹Ãͤ¬Â礭¤¤¤Û¤É¡¢º¸Â¦¤Î¥°¥ë¡¼¥×¤òɽ¤¹¡£ + Í×ÁǤÎÃͤ¬ CHAR_MAX ¤Î¾ì¹ç¤Ï¡¢ºÇ¸å¤Î¥°¥ë¡¼¥×¤Ç + ¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£Í×ÁǤÎÃͤ¬ 0 ¤Î¾ì¹ç¤Ï¡¢ + ¤½¤ÎÍ×ÁǤè¤êº¸Â¦¤ÎÁ´¤Æ¤ÎÍ×ÁǤËÁ°¤ÎÍ×ÁǤÈƱ¤¸Ãͤò + »ÈÍѤ¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ */ + + /* »Ä¤ê¤Î¥Õ¥£¡¼¥ë¥É¤ÏÄ̲߾ðÊóÍѤǤ¢¤ë */ + + char *int_curr_symbol; /* ºÇ½é¤Î»°¤Ä¤Îʸ»ú¤Ï ISO 4217 ¤ÎÄ̲ߵ­¹æ¡£ + »ÍÈÖÌܤÎʸ»ú¤Ï¶èÀÚ¤êʸ»ú¡£ + ¸ÞÈÖÌÜ¤Ï \(aq\0\(aq¡£ */ + char *currency_symbol; /* ÃÏ°è¤ÎÄ̲ߵ­¹æ */ + char *mon_decimal_point; /* ¾®¿ôÅÀ¤Îʸ»ú */ + char *mon_thousands_sep; /* ¾åµ­¤Î `thousands_sep' ¤ÈƱÍÍ */ + char *mon_grouping; /* ¾åµ­¤Î `grouping' ¤ÈƱÍÍ */ + char *positive_sign; /* Àµ¤ÎÃͤÎÉä¹æ */ + char *negative_sign; /* Éé¤ÎÃͤÎÉä¹æ */ + char int_frac_digits; /* ¹ñºÝŪ¤Ê¾®¿ôÉô¤Î¿ô»ú */ + char frac_digits; /* ÃÏ°è¤Î¾®¿ôÉô¤Î¿ô»ú */ + char p_cs_precedes; /* Àµ¤ÎÃͤÎÁ°¤ËÄ̲ߵ­¹æ¤òÃÖ¤¯¾ì¹ç¤Ï 1, + ¸å¤í¤ËÃÖ¤¯¾ì¹ç¤Ï 0 */ + char p_sep_by_space; /* Àµ¤ÎÃͤÈÄ̲ߵ­¹æ¤Î´Ö¤Ë¥¹¥Ú¡¼¥¹¤ò + Æþ¤ì¤ë¾ì¹ç¤Ï 1 */ + char n_cs_precedes; /* Éé¤ÎÃͤÎÁ°¤ËÄ̲ߵ­¹æ¤òÃÖ¤¯¾ì¹ç¤Ï 1, + ¸å¤í¤ËÃÖ¤¯¾ì¹ç¤Ï 0 */ + char n_sep_by_space; /* Éé¤ÎÃͤÈÄ̲ߵ­¹æ¤Î´Ö¤Ë¥¹¥Ú¡¼¥¹¤ò + Æþ¤ì¤ë¾ì¹ç¤Ï 1 */ + /* Àµ¤ÈÉé¤ÎÉä¹æ¤Î°ÌÃÖ: + 0 ÃͤÈÄ̲ߵ­¹æ¤ò³ç¸Ì¤Ç°Ï¤à + 1 Éä¹æ¤ÏÃͤÈÄ̲ߵ­¹æ¤ÎÁ°¤ËÃÖ¤¯ + 2 Éä¹æ¤ÏÃͤÈÄ̲ߵ­¹æ¤Î¸å¤ËÃÖ¤¯ + 3 Éä¹æ¤ÏÄ̲ߵ­¹æ¤Îľ¸å¤ËÃÖ¤¯ + 4 Éä¹æ¤ÏÄ̲ߵ­¹æ¤ÎľÁ°¤ËÃÖ¤¯ */ + char p_sign_posn; + char n_sign_posn; +}; +.fi +.in +.SH ½àµò +POSIX.1-2001 + +GNU gettext ´Ø¿ô¥Õ¥¡¥ß¥ê¡¼¤Ï LI18NUX2000 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR locale (1), +.BR localedef (1), +.BR gettext (3), +.BR localeconv (3), +.BR ngettext (3), +.BR nl_langinfo (3), +.BR rpmatch (3), +.BR setlocale (3), +.BR strcoll (3), +.BR strfmon (3), +.BR strftime (3), +.BR strxfrm (3) diff --git a/release/man7/mailaddr.7 b/release/man7/mailaddr.7 new file mode 100644 index 00000000..43cde97a --- /dev/null +++ b/release/man7/mailaddr.7 @@ -0,0 +1,125 @@ +.\" +.\" Copyright (c) 1983, 1987 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms are permitted +.\" provided that the above copyright notice and this paragraph are +.\" duplicated in all such forms and that any documentation, +.\" advertising materials, and other materials related to such +.\" distribution and use acknowledge that the software was developed +.\" by the University of California, Berkeley. The name of the +.\" University may not be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" @(#)mailaddr.7 6.5 (Berkeley) 2/14/89 +.\" +.\" Extensively rewritten by Arnt Gulbrandsen . My +.\" changes are placed under the same copyright as the original BSD page. +.\" +.\" Adjusted by Arnt Gulbrandsen in 2004 to +.\" 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" +.UC 5 +.SH ̾Á° +mailaddr \- ¥á¡¼¥ë¡¦¥¢¥É¥ì¥¹¤ÎÀâÌÀ +.SH ÀâÌÀ +.nh +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸¤Ç¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ç»ÈÍѤµ¤ì¤ë SMTP ¥á¡¼¥ë¡¦ +¥¢¥É¥ì¥¹¤Î´Êñ¤Ê¾Ò²ð¤ò¹Ô¤¦¡£¥á¡¼¥ë¡¦¥¢¥É¥ì¥¹¤Ï°ìÈÌŪ¤Ë¤Ï +.PP + user@domain +.PP +¤Î·Á¤Ç¤¢¤ë¡£ +domain ¤Ï¥µ¥Ö¡¦¥É¥á¥¤¥ó¤Î³¬Áؤò ¥É¥Ã¥È (.) ¤Ç +¶èÀڤäƤĤʤ¤¤À¤â¤Î¤Ç¤¢¤ë¡£ +°Ê²¼¤ÎÎã¤ÏÁ´¤ÆƱ¤¸¥¢¥É¥ì¥¹¤ÎÀµ¤·¤¤É½µ­Ë¡¤Ç¤¢¤ë: +.PP + eric@monet.berkeley.edu +.br + Eric Allman +.br + eric@monet.berkeley.edu (Eric Allman) +.PP +¥É¥á¥¤¥óÉôʬ ("monet.berkeley.edu") ¤Ï¥á¡¼¥ë¤ò¼õ¿®¤¹¤ë¥É¥á¥¤¥ó¤Ç¤¢¤ë¡£ +¥É¥á¥¤¥ó¤Ï¥Û¥¹¥È̾¤Ç¤¢¤Ã¤Æ¤â¤è¤¯¡¢°ÊÁ°¤Ï¥Û¥¹¥È̾¤¬ÉáÄ̤Ǥ¢¤Ã¤¿¤¬¡¢ +¤½¤¦¤Ç¤¢¤ëɬÍפϤʤ¤¡£¥É¥á¥¤¥óÉôʬ¤ÏÂçʸ»ú¡¢¾®Ê¸»ú¤Î¶èÊ̤Ϥµ¤ì¤Ê¤¤¡£ +.PP +¥í¡¼¥«¥ëÉôʬ ("eric") ¤ÏÉáÄ̤ϥ桼¥¶¡¼¤Î̾Á°¤Ç¤¢¤ë¤¬¡¢ +¤½¤Î°ÕÌ£¤Ï¥í¡¼¥«¥ë¤Ê¥½¥Õ¥È¥¦¥§¥¢¤Ë¤è¤Ã¤ÆÄêµÁ¤µ¤ì¤ë¡£ +Âçʸ»ú¡¢¾®Ê¸»ú¤ò¶èÊ̤·¤Æ¤â¤è¤¤¤¬¡¢ÉáÄ̤϶èÊ̤µ¤ì¤Ê¤¤¡£ +¥í¡¼¥«¥ëÉôʬ¤¬¥´¥ß¤Î¤è¤¦¤Ë¸«¤¨¤ë¾ì¹ç¤Ï¡¢¤½¤ì¤Ï¤¿¤¤¤ÆÆâÉôŪ¤ÊÅŻҥ᡼¥ë +¥·¥¹¥Æ¥à¤È¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î´Ö¤Ë¤¢¤ë¥²¡¼¥È¥¦¥§¥¤¤Î¤»¤¤¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ë¡£ +.PP + "surname/admd=telemail/c=us/o=hp/prmd=hp"@some.where +.br + USER%SOMETHING@some.where +.br + machine!machine!name@some.where +.br + I2461572@some.where +.PP +(¤½¤ì¤¾¤ì¡¢X.400 ¥²¡¼¥È¥¦¥§¥¤¡¢ +Àµ¤·¤¤¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥µ¥Ý¡¼¥È¤ò·ç¤¤¤¿¾¡¼ê¤ÊÆâÉô¥á¡¼¥ë¥·¥¹¥Æ¥à¡¢ +UUCP ¥²¡¼¥È¥¦¥§¥¤¤Ç¤ÎÎã¤Ç¤¢¤ë¡£ +ºÇ¸å¤Î¤Ïñ¤Ë´ÖÈ´¤±¤Ê¥æ¡¼¥¶¡¼Ì¾¤Ç¤¢¤ë¡£) +.PP +¼Â̾Éôʬ ("Eric Allman") ¤Ï <> ¤ÎÁ°¤ËÃÖ¤¯¤³¤È¤â¤Ç¤­¤ë¤·¡¢ +()¤ËÆþ¤ì¤ÆºÇ¸å¤ËÃÖ¤¯¤³¤È¤â¤Ç¤­¤ë¡£(¸·Ì©¤Ë¸À¤¦¤È¡¢Æó¤Ä¤ÏÁ´¤¯Æ±¤¸ +¤ï¤±¤Ç¤Ï¤Ê¤¤¤¬¡¢¤½¤Î°ã¤¤¤Ï¤³¤Î¥Ú¡¼¥¸¤ÎÌÜŪ¤«¤é³°¤ì¤ë¤Î¤Ç¸ÀµÚ¤·¤Ê¤¤¡£) +Î㤨¤Ð "." ¤Ê¤É¤Îʸ»ú¤ò´Þ¤à¾ì¹ç¤Ë¤Ï̾Á°¤ò "" ¤Ç³ç¤ëɬÍפ¬¤¢¤ë: +.PP + "Eric P. Allman" +.SS ¾Êά·Á +.PP +¿¤¯¤Î¥á¡¼¥ë¡¦¥·¥¹¥Æ¥à¤¬¥É¥á¥¤¥ó̾¤Î¾Êά·Á¤òµö¤·¤Æ¤¤¤ë¡£ +Î㤨¤Ð berkeley.edu ¤Î¥æ¡¼¥¶¡¼¤Ï Eric Allman ¤Ë¥á¡¼¥ë¤òÁ÷¤ë¤¿¤á¤Ë +"eric@monet" ¤¬»ÈÍѤǤ­¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¡Ø¤³¤ÎÆ°ºî¤Ï¿ä¾©¤µ¤ì¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¡Ù +Àµ¤·¤¯Æ°ºî¤¹¤ë¾ì¹ç¤â¤¢¤ë¤¬¡¢¤½¤ì¤ò¤¢¤Æ¤Ë¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SS ·ÐÏ©¥¢¥É¥ì¥¹ +.PP +°ÊÁ°¤Ï¡¢¥á¥Ã¥»¡¼¥¸¤¬ºÇ½ªÌÜŪÃϤØÅþ㤹¤ë¤¿¤á¤ËÄ̲᤹¤ë¥Û¥¹¥È¤ò +»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤¬»þ¡¹¤¢¤Ã¤¿¡£ +Ãæ·ÑÅÀ¤ò»ØÄꤷ¤¿¥¢¥É¥ì¥¹¤ò "·ÐÏ©¥¢¥É¥ì¥¹ (route-addrs)" ¤È¤¤¤¦¡£ +°Ê²¼¤Î½ñ¼°¤ò»ÈÍѤ¹¤ë: +.PP + <@hosta,@hostb:user@hostc> +.PP +¤³¤ì¤ÏÄÌ¿®Ê¸¤ò hosta ¤ËÁ÷¤ê¡¢¤½¤³¤«¤é hostb ¤ËÁ÷¤ê¡¢ºÇ½ªÅª¤Ë hostc ¤Ë +Á÷¤ë¤³¤È¤ò»ØÄꤷ¤Æ¤¤¤ë¡£Â¿¤¯¤Î¥Û¥¹¥È¤Ï·ÐÏ©¥¢¥É¥ì¥¹¤ò̵»ë¤·¤ÆľÀÜ hostc +¤ËÁ÷¤ë¡£ +.PP +º£¤Ç¤Ï·ÐÏ©¥¢¥É¥ì¥¹¤¬»È¤ï¤ì¤ë¤³¤È¤Ï¤Û¤È¤ó¤É¤Ê¤¤¡£ +¸Å¤¤¥á¡¼¥ë¡¦¥¢¡¼¥«¥¤¥Ö¤Ç»þ¡¹¤ËÌܤˤ¹¤ë¤³¤È¤¬¤¢¤ë¡£ +°ìÈ̤ˤϼºݤΥ¢¥É¥ì¥¹¤òµá¤á¤ë¤¿¤á¤Ë "user@hostc" °Ê³°¤ÎÁ´¤ÆÉôʬ¤ò̵»ë +¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.SS "¥Ý¥¹¥È¥Þ¥¹¥¿¡¼ (postmaster)" +.PP +Á´¤Æ¤Î¥µ¥¤¥È¤Ï¡¢¥á¡¼¥ë¡¦¥·¥¹¥Æ¥à¤ÎÌäÂê¤òÃΤ餻¤ë°¸¤ÆÀè¤È¤·¤Æ¡¢ +"postmaster" ¤È¤¤¤¦¥æ¡¼¥¶¤«ÊÌ̾ÄêµÁ (alias) ¤òÍÑ°Õ¤·¤Ê¤±¤ì¤Ð +¤Ê¤é¤Ê¤¤¡£ "postmaster" ¤Î¥¢¥É¥ì¥¹¤ÏÂçʸ»ú¡¢¾®Ê¸»ú¤Î¶èÊ̤Ϥµ¤ì¤Ê¤¤¡£ +.SH ¥Õ¥¡¥¤¥ë +.I /etc/aliases +.br +.I ~/.forward +.SH ´ØÏ¢¹àÌÜ +.BR binmail (1), +.BR mail (1), +.BR mconnect (1), +.BR aliases (5), +.BR forward (5), +.BR sendmail (8), +.BR vrfy (8) + +RFC\ 2822 (Internet Message Format) diff --git a/release/man7/man-pages.7 b/release/man7/man-pages.7 new file mode 100644 index 00000000..e5c77e7d --- /dev/null +++ b/release/man7/man-pages.7 @@ -0,0 +1,552 @@ +.\" (C) Copyright 1992-1999 Rickard E. Faith and David A. Wheeler +.\" (faith@cs.unc.edu and dwheeler@ida.org) +.\" and (C) Copyright 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. +.\" +.\" 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" +.SH ̾Á° +man-pages \- Linux ¤Î man ¥Ú¡¼¥¸¤ò½ñ¤¯ºÝ¤Î·è¤Þ¤ê»ö +.SH ½ñ¼° +.B man +.RI [ section ] +.I title +.SH ÀâÌÀ +¤³¤Î¥Ú¡¼¥¸¤Ç¤Ï¡¢ +Linux \fIman-pages\fP ¥×¥í¥¸¥§¥¯¥È¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò½ñ¤¯ºÝ¤Ë +½¾¤¦¤Ù¤­·è¤Þ¤ê»ö¤Ë¤Ä¤¤¤ÆÀâÌÀ¤¹¤ë¡£ +Linux \fIman-pages\fP ¤Ï Linux ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î +¥»¥¯¥·¥ç¥ó 2, 3, 4, 5, 7 ¤«¤é¹½À®¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥Ú¡¼¥¸¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë·è¤Þ¤ê»ö¤Ï¡¢Â¾¤Î¥×¥í¥¸¥§¥¯¥È¤Î +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò½ñ¤¯ºî¼Ô¤Ë¤âÌòΩ¤Ä¤³¤È¤À¤í¤¦¡£ +.SS ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥»¥¯¥·¥ç¥ó +.PP +¥Þ¥Ë¥å¥¢¥ë¤Î¥»¥¯¥·¥ç¥ó¤Ï¡¢½¬´·Åª¤Ë°Ê²¼¤Î¤è¤¦¤ÊÄêµÁ¤¬ÍѤ¤¤é¤ì¤Æ¤¤¤ë: +.TP 10 +.B 1 ¥³¥Þ¥ó¥É (¥×¥í¥°¥é¥à) +¥·¥§¥ë¤ÎÃ椫¤é¥æ¡¼¥¶¤¬¼Â¹Ô¤Ç¤­¤ë¥³¥Þ¥ó¥É¡£ +.TP +.B 2 ¥·¥¹¥Æ¥à¥³¡¼¥ë +¥«¡¼¥Í¥ë¤¬½èÍý¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤´Ø¿ô¡£ +.TP +.B 3 ¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë +.I libc +¤Î´Ø¿ô¤ÎÂçÉôʬ¡£ +.TP +.B 4 ¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë (¥Ç¥Ð¥¤¥¹) +.I /dev +°Ê²¼¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¡£ +.TP +.B 5 ¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Èµ¬Ìó +.I /etc/passwd +¤Ê¤É¤Î¿Í¤¬Æɤá¤ë¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¡£ +.TP +.B 6 ¥²¡¼¥à +.TP +.B 7 Ìó«»ö¤½¤Î¾ +ÍÍ¡¹¤Ê»öÊÁ¤Î³µÍס¢´·½¬¡¢¥×¥í¥È¥³¥ë¡¢Ê¸»ú½¸¹ç¤Îµ¬³Ê¡¢¤½¤Î¾»¨Â¿¤Ê¤³¤È¡£ +.TP +.B 8 ¥·¥¹¥Æ¥à´ÉÍý¥³¥Þ¥ó¥É +.BR mount (8) +¤Î¤è¤¦¤Ê root ¤Î¤ß¤¬¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¡£ +.\" .TP +.\" .B 9 ¥«¡¼¥Í¥ë¥ë¡¼¥Á¥ó +.\" ¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥»¥¯¥·¥ç¥ó¤ÏÇѻߤµ¤ì¤¿¡£ +.\" ¤«¤Ä¤Æ¤Ï¤³¤³¤Ë Linux ¥«¡¼¥Í¥ë¤Î¥É¥­¥å¥á¥ó¥È¤òÃÖ¤¯¤Î¤¬Îɤ¤¤³¤È¤À¤È +.\" ¹Í¤¨¤é¤ì¤Æ¤¤¤¿¡£¤·¤«¤·¡¢Ê¸½ñ²½¤µ¤ì¤¿¤â¤Î¤ÏÈó¾ï¤Ë¾¯¤Ê¤¯¡¢ +.\" ¤Þ¤¿¤½¤ì¤é¤â¤¹¤Ç¤Ë¸Å¤¤¤â¤Î¤È¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£ +.\" ¥«¡¼¥Í¥ë³«È¯¼Ô¤Ë¤È¤Ã¤Æ¡¢¤â¤Ã¤È¤è¤¤¾ðÊ󸻤¬Â¾¤Ë¤¢¤ë¤À¤í¤¦¡£ +.SS ¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸ +¿·¤·¤¤¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï +.BR man (7) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë +.B groff an.tmac +¥Ñ¥Ã¥±¡¼¥¸¤ò»È¤Ã¤Æµ­½Ò¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤ÎÊý¿Ë¤Ï°ì´ÓÀ­¤Î³ÎÊݤ¬¼ç¤ÊÍýͳ¤Ç¤¢¤ë¡£´û¸¤Î Linux ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸ +¤Î°µÅÝŪ¿¿ô¤¬¤³¤ì¤é¤Î¥Þ¥¯¥í¤ò»È¤Ã¤Æµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.SS ¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎÇÛÃ֤˴ؤ¹¤ë·è¤Þ¤ê»ö +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥½¡¼¥¹¥³¡¼¥É¤Î 1¹Ô¤ÎŤµ¤Ï +²Äǽ¤Ê¸Â¤ê 75ʸ»ú¤ò±Û¤¨¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤Û¤·¤¤¡£ +¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢¥Ñ¥Ã¥Á¤ò¥á¡¼¥ëËÜʸ¤ËºÜ¤»¤ÆÁ÷¤ë¾ì¹ç¤Ë¡¢ +¥á¡¼¥ë¥¯¥é¥¤¥¢¥ó¥È¤Ë¤è¤ë¹ÔÀÞ¤êÊÖ¤·¤ò²óÈò¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¿·¤·¤¤Ê¸¤Ï¹ÔƬ¤«¤é³«»Ï¤¹¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¥Ñ¥Ã¥Á¤ÎÆâÍƤò³Îǧ¤·¤ä¤¹¤¯¤Ê¤ë¡£ +¥Ñ¥Ã¥Á¤Ïʸñ°Ì¤Ç¤¢¤ë¤³¤È¤¬Â¿¤¤¤«¤é¤Ç¤¢¤ë¡£ +.SS ¥¿¥¤¥È¥ë¹Ô +man ¥Ú¡¼¥¸¤ÎºÇ½é¤Î¹Ô¤Ï \fBTH\fP ¥³¥Þ¥ó¥É¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.RS +.sp +.B \&.TH +.I "title section date source manual" +.sp +.RE +¸Ä¡¹¤ÎÀâÌÀ: +.RS +.TP 10 +.I title +man ¥Ú¡¼¥¸¤Î¥¿¥¤¥È¥ë¡£Á´ÉôÂçʸ»ú¤Çµ­ºÜ¤¹¤ë (Îã: +.IR MAN-PAGES )¡£ +.TP +.I section +man ¥Ú¡¼¥¸¤¬Â°¤¹¤ë¥»¥¯¥·¥ç¥óÈÖ¹æ (Îã: +.IR 7 )¡£ +.TP +.I date +ºÇ¿·¤Î¥ê¥Ó¥¸¥ç¥ó¤ÎÆüÉÕ \(em man ¥Ú¡¼¥¸¤ËÊѹ¹¤ò²Ã¤¨¤¿¤È¤­¤Ë¤Ï +ɬ¤º¤³¤ì¤òÊѹ¹¤¹¤ë¤³¤È¡£ +¤³¤ì¤¬ºÇ¤â°ìÈÌŪ¤Ê¥Ð¡¼¥¸¥ç¥ó´ÉÍýÊýË¡¤Ç¤¢¤ë¡£ +ÆüÉÕ¤Ï YYYY-MM-DD ¤Î·Á¼°¤Çµ­ºÜ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.I source +¥³¥Þ¥ó¥É¡¢´Ø¿ô¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î½Ð¼«¡£ + +¿ô¾¯¤Ê¤¤¥»¥¯¥·¥ç¥ó 1 ¤È 8 ¤Î¥Ú¡¼¥¸¤Î¾ì¹ç¡¢¤ª¤½¤é¤¯Ã±¤Ë +.I GNU +¤È¤À¤±½ñ¤¯¤³¤È¤¬Â¿¤¤¤À¤í¤¦¡£ + +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¾ì¹ç¡¢Ã±¤Ë +.I "Linux" +¤È¤À¤±½ñ¤¯¡£ +(°ÊÁ°¤Î´·½¬¤Ç¤Ï¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òµ­ºÜ¤·¤¿/ÆâÍƤò³Îǧ¤·¤¿¥«¡¼¥Í¥ë¤Î +¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òµ­ºÜ¤·¤Æ¤¤¤¿¡£¤·¤«¤·¡¢¥Ð¡¼¥¸¥ç¥óÈֹ椬¼ÂºÝ¤ÎÆâÍÆ¤È +°ìÃפ·¤Æ¤¤¤ë¤³¤È¤Ï¤Ê¤¯¡¢¤½¤Î¤¿¤á¥Ð¡¼¥¸¥ç¥óÈֹ椬¤Ê¤¤¤è¤ê¤â +¤ª¤½¤é¤¯°­¤¤·Á¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£ +º£¸å¤Ï¡¢¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤ò´Þ¤á¤ë¤Î¤ÏÈò¤±¤ë¤³¤È¡£) + +glibc ¤Î¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤ä +¤½¤Î¾¤Î°ìÈÌŪ¤Ê GNU ¥é¥¤¥Ö¥é¥ê¤Î¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤Î¾ì¹ç¡¢ +ñ¤Ë +.IR "GNU C Library" ", " GNU +¤È½ñ¤¯¤«¡¢¶õ¤Îʸ»úÎó¤ò»È¤¦¡£ + +¥»¥¯¥·¥ç¥ó 4 ¤Î¥Ú¡¼¥¸¤Ç¤Ï +.I "Linux" +¤ò»È¤¦¡£ + +¤è¤¯¤ï¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢ +.I Linux +¤È¤« +.I GNU +¤È½ñ¤¤¤Æ¤ª¤¯¡£ +.TP +.I manual +¥Þ¥Ë¥å¥¢¥ë¤Î¥¿¥¤¥È¥ë (Îã: +\fIman-pages\fP ¥Ñ¥Ã¥±¡¼¥¸¤Î¥»¥¯¥·¥ç¥ó 2 ¤ª¤è¤Ó 3 ¤Î¥Ú¡¼¥¸¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I "Linux Programmer's Manual" +¤ò»È¤¦¤³¤È)¡£ +.RE +.SS ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥»¥¯¥·¥ç¥ó +ÀΤ«¤é»È¤ï¤ì¤Æ¤­¤¿¥»¥¯¥·¥ç¥ó̾¤ò°Ê²¼¤Î¥ê¥¹¥È¤Ë¼¨¤¹¡£ +¤³¤ì¤é¤ò»È¤¦¤ÈÎɤ¤¤À¤í¤¦¡£ +°ìÈÌŪ¤Ë¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï¡¢¾¯¤Ê¤¯¤È¤â +.B ¿§¤Ä¤­ +¤Î¥»¥¯¥·¥ç¥ó¤ò»ý¤Ä¤Î¤¬Ë¾¤Þ¤·¤¤¡£ +¿·¤·¤¯¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òºîÀ®¤¹¤ëºÝ¤Ë¤Ï¡¢¤À¤¤¤¿¤¤°Ê²¼¤Î¥ê¥¹¥È¤Ë¼¨¤·¤¿ +½ç½ø¤Ç¥»¥¯¥·¥ç¥ó¤òÇÛÃÖ¤¹¤ë¤è¤¦¤Ë¤·¤Æ¤â¤é¤¤¤¿¤¤¡£ +.in +0.5i +.nf + +\fB̾Á°\fP +\fB½ñ¼°\fP +ÀßÄê [Ä̾ï¤Ï¥»¥¯¥·¥ç¥ó 4 ¤Î¤ß] +\fBÀâÌÀ\fP +¥ª¥×¥·¥ç¥ó [Ä̾ï¤Ï¥»¥¯¥·¥ç¥ó 1, 8 ¤Î¤ß] +½ªÎ»¥¹¥Æ¡¼¥¿¥¹ [Ä̾ï¤Ï¥»¥¯¥·¥ç¥ó 1, 8 ¤Î¤ß] +ÊÖ¤êÃÍ [Ä̾ï¤Ï¥»¥¯¥·¥ç¥ó 2, 3 ¤Î¤ß] +.\" May 07: Few current man pages have an ERROR HANDLING section,,, +.\" ¥¨¥é¡¼½èÍý +¥¨¥é¡¼ [¤¿¤¤¤Æ¤¤¤Ï¥»¥¯¥·¥ç¥ó 2, 3 ¤Î¤ß] +.\" May 07: Almost no current man pages have a USAGE section,,, +.\" ÍøÍÑË¡ +.\" ¿ÇÃÇ¥á¥Ã¥»¡¼¥¸ +.\" May 07: Almost no current man pages have a SECURITY section,,, +.\" ¥»¥­¥å¥ê¥Æ¥£ +´Ä¶­ÊÑ¿ô +¥Õ¥¡¥¤¥ë +¥Ð¡¼¥¸¥ç¥ó [Ä̾ï¤Ï¥»¥¯¥·¥ç¥ó 2, 3 ¤Î¤ß] +½àµò +Ãí°Õ/È÷¹Í +¥Ð¥° +Îã +.\" Ãø¼Ô ¥»¥¯¥·¥ç¥ó¤ÏÈó¿ä¾©¤Ç¤¢¤ë +.\" Ãø¼Ô +\fB´ØÏ¢¹àÌÜ\fP + +.fi +.in +¡ÖÅÁÅýŪ¤Ë»È¤ï¤ì¤Æ¤­¤¿¸«½Ð¤·¤¬»È¤¨¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ì¤ò»È¤Ã¤Æ¤Û¤·¤¤¡£¡× +¤³¤Î¼ï¤Î°ì´ÓÀ­¤òÊݤĤ³¤È¤Ç¡¢¾ðÊó¤òÍý²ò¤·¤ä¤¹¤¯¤Ê¤ë¤«¤é¤Ç¤¢¤ë¡£ +¤É¤¦¤·¤Æ¤âɬÍפʾì¹ç¤Ë¤Ï¡¢Íý²ò¤·¤ä¤¹¤¯¤Ê¤ë¤è¤¦¤ËÆȼ«¤Î¸«½Ð¤·¤ò +ºî¤Ã¤Æ¤â¤è¤¤ (Æä˥»¥¯¥·¥ç¥ó 4 ¤ä 5 ¤Î¥Ú¡¼¥¸¤Ç¤Ï¤³¤¦¤·¤¿Êý¤¬ +¤ï¤«¤ê¤ä¤¹¤¯¤Ê¤ë)¡£¤¿¤À¤·¡¢¤½¤¦¤¹¤ëÁ°¤Ë¡¢ÅÁÅýŪ¤Ê¸«½Ð¤·¤ò»È¤¤¡¢ +¤½¤Î¥»¥¯¥·¥ç¥óÆâ¤Ë¥µ¥Ö¥»¥¯¥·¥ç¥ó (\fI.SS\fP) ¤òÀߤ±¤ë¤³¤È¤Ç +Âбþ¤Ç¤­¤Ê¤¤¤«¹Í¤¨¤Æ¤Û¤·¤¤¡£ + +°Ê²¼¤Î¥ê¥¹¥È¤Ç¤Ï¡¢¾åµ­¤Î¥»¥¯¥·¥ç¥ó¤Î¤½¤ì¤¾¤ì¤ÎÆâÍƤˤĤ¤¤Æ +¾Ü¤·¤¯ÀâÌÀ¤¹¤ë¡£ +.TP 14 +.B ̾Á° (NAME) +¤½¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î̾Á°¡£ +\fB.SH NAME\fP ¥³¥Þ¥ó¥É¤Î¹Ô¤¬½¾¤¦¤Ù¤­Âç»ö¤ÊÅÀ¤Ë¤Ä¤¤¤Æ¤Ï +.BR man (7) +¤ò»²¾È¤·¤Æ¤Û¤·¤¤¡£ +.TP +.B ½ñ¼° (SYNOPSIS) +¥³¥Þ¥ó¥É¤ä´Ø¿ô¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò´Ê·é¤Ëµ­½Ò¤¹¤ë¡£ +¥³¥Þ¥ó¥É¤ËÂФ·¤Æ¤Ï¡¢¥³¥Þ¥ó¥É¤ä°ú¤­¿ô (¥ª¥×¥·¥ç¥ó) ¤Îʸˡ¤ò½ñ¤¯¡£ +¤½¤Î¤Þ¤Þ½ñ¤¯¥Æ¥­¥¹¥È¤Ë¤Ï¥Ü¡¼¥ë¥ÉÂΤòÍѤ¤¡¢ÃÖ¤­´¹¤¨¤ë°ú¤­¿ô¤Ë¤Ï +¥¤¥¿¥ê¥Ã¥¯ÂΤòÍѤ¤¤ë¡£¾Êά²Äǽ¤Ê¥ª¥×¥·¥ç¥ó¤Ï¥Ö¥é¥±¥Ã¥È ([]) ¤Ç°Ï¤¤¡¢ +ÁªÂò»è¤Ï½ÄËÀ (|) ¤Ç¶èÀڤꡢ·«¤êÊÖ¤·¤Ë¤Ï¾ÊάÉä¹æ (...) ¤ò½ñ¤¯¡£ +´Ø¿ô¤ËÂФ·¤Æ¤Ï¡¢É¬Íפʥǡ¼¥¿Àë¸À¤ä +.B #include +»ØÄê¤ò½ñ¤­¡¢´Ø¿ôÀë¸À¤ò³¤±¤ë¡£ + +¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤«¤é´Ø¿ô (¤äÊÑ¿ô) ¤ÎÄêµÁ¤òÆÀ¤ë¤¿¤á¤Ë +µ¡Ç½¸¡ºº¥Þ¥¯¥í (feature test macro) ¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¾ì¹ç¡¢ +½ñ¼° (SYNOPSIS) ¤ËɬÍפʵ¡Ç½¸¡ºº¥Þ¥¯¥í¤òµ­ºÜ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +µ¡Ç½¸¡ºº¥Þ¥¯¥í¤Ë¤Ä¤¤¤Æ¤Ï +.BR feature_test_macros (7) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +.\" FIXME . Say something here about compiler options +.TP +.B CONFIGURATION +¥Ç¥Ð¥¤¥¹¤ÎÀßÄê¾ÜºÙ¡£ +Ä̾¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï 4 ¾Ï¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Î¤ßÅо줹¤ë¡£ +.TP +.B ÀâÌÀ (DESCRIPTION) +¥×¥í¥°¥é¥à¡¦´Ø¿ô¡¦¥Õ¥©¡¼¥Þ¥Ã¥È¤ÎÆ°ºî¡¦ÌÜŪ¤òÀâÌÀ¤¹¤ë¡£ +¥Õ¥¡¥¤¥ë¤äɸ½àÆþÎϤò¤É¤Î¤è¤¦¤Ë½èÍý¤·¡¢É¸½à½ÐÎϤäɸ½à¥¨¥é¡¼½ÐÎϤò +¤É¤Î¤è¤¦¤ËÀ¸À®¤¹¤ë¤«¤È¤¤¤Ã¤¿¤³¤È¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤ë¡£ +ÆâÉôÆ°ºî¤ä¼ÂÁõ¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¾Êά¤¹¤ë +(¤¿¤À¤·¤½¤ì¤¬Æ°ºî¤ÎÍý²ò¤Ë¤É¤¦¤·¤Æ¤âɬÍפʤéÊÌ)¡£ +Ä̾ï¤Î¾ì¹ç¤Ë¤Ä¤¤¤Æµ­½Ò¤¹¤ë¡£ +¥×¥í¥°¥é¥à¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¡¦¥ª¥×¥·¥ç¥ó¤ÎÀâÌÀ¤Ë¤Ï¡¢ +.B ¥ª¥×¥·¥ç¥ó +¤Î¥»¥¯¥·¥ç¥ó¤òÍѤ¤¤ë¡£ +.\" ÆþÎϤˤ¢¤ë¼ï¤Îʸˡ¤¬¤¢¤Ã¤¿¤ê¡¢Ê£»¨¤Ê¥µ¥Ö¥³¥Þ¥ó¥É¤¬¤¢¤ë¾ì¹ç¤Ï¡¢ +.\" ¤½¤ì¤é¤Ï +.\" .B ÍøÍÑË¡ +.\" ¤Î¥»¥¯¥·¥ç¥ó¤ËʬΥ¤¹¤ë¤³¤È¤ò¹Í¤¨¤ë¤È¤è¤¤ +.\" .RB ( ÀâÌÀ +.\" ¤Î¥»¥¯¥·¥ç¥ó¤Ë¤Ï³µÍפÀ¤±¤òÃÖ¤¯¤è¤¦¤Ë¤¹¤ë)¡£ +.TP +.B ¥ª¥×¥·¥ç¥ó (OPTIONS) +¥×¥í¥°¥é¥à¤¬¼õ¤±ÉÕ¤±¤ë¥³¥Þ¥ó¥É¥é¥¤¥ó¡¦¥ª¥×¥·¥ç¥ó¤È¡¢ +¤½¤Î¾ì¹ç¥×¥í¥°¥é¥à¤Î¿¶Éñ¤¤¤¬¤É¤¦ÊѤï¤ë¤«¤òÀâÌÀ¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥»¥¯¥·¥ç¥ó 1 ¤È 8 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¤À¤±Åо줹¤Ù¤­¤Ç¤¢¤ë¡£ +.\" .TP +.\" .B ÍøÍÑË¡ (USAGE) +.\" ¥³¥Þ¥ó¥É¤Ê¤É¤¬¼ÂÁõ¤·¤Æ¤¤¤ëÉû¸À¸ì (sublanguage) ¤Îʸˡ¤òµ­½Ò¤¹¤ë¡£ +.TP +.B ½ªÎ»¥¹¥Æ¡¼¥¿¥¹ (EXIT STATUS) +¥×¥í¥°¥é¥à¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤ÎÃͤȡ¢¤½¤ì¤é¤ÎÃͤËÂбþ¤¹¤ë¾õ¶·¤òÎóµó¤¹¤ë¡£ +¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥»¥¯¥·¥ç¥ó 1 ¤È 8 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¤À¤±Åо줹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B ÊÖ¤êÃÍ (RETURN VALUE) +¥»¥¯¥·¥ç¥ó 2 ¤È 3 ¤Î¥Ú¡¼¥¸¤Î¾ì¹ç¡¢¤³¤Î¥»¥¯¥·¥ç¥ó¤Ë +¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó¤¬¸Æ¤Ó½Ð¤·¸µ¤ËÊÖ¤¹ÃͤΥꥹ¥È¤òµ­ºÜ¤¹¤ë¡£ +¤½¤ì¤é¤ÎÃͤ¬ÊÖ¤µ¤ì¤¿¾ì¹ç¤Î¾õÂÖ¤ËÂФ¹¤ëÀâÌÀ¤â½ñ¤¯¡£ +.TP +.B ¥¨¥é¡¼ (ERRORS) +¥»¥¯¥·¥ç¥ó 2 ¤È 3 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï¡¢ +¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë +.I errno +¤ËÀßÄꤵ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ëÃͤΥꥹ¥È¤òµ­ºÜ¤¹¤ë¡£ +¥ê¥¹¥È¤Ë¤Ï¡¢¥¨¥é¡¼¤ÎÃͤȥ¨¥é¡¼¤Î¸¶°ø¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò½ñ¤¯¡£ +¡Ö¥¨¥é¡¼¥ê¥¹¥È¤Ï¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£¡× +.TP +.B ´Ä¶­ÊÑ¿ô (ENVIRONMENT) +¥×¥í¥°¥é¥à¤ä´Ø¿ô¤Ë±Æ¶Á¤¹¤ë´Ä¶­ÊÑ¿ô¤ò¥ê¥¹¥È¤·¡¢¤½¤ì¤é¤Î¸ú²Ì¤ò½ñ¤¯¡£ +.TP +.B ¥Õ¥¡¥¤¥ë (FILES) +¥×¥í¥°¥é¥à¤ä´Ø¿ô¤¬ÍѤ¤¤ë¥Õ¥¡¥¤¥ë¤òÎóµ­¤¹¤ë¡£ +Î㤨¤Ð¡¢ÀßÄê¥Õ¥¡¥¤¥ë¡¢µ¯Æ°¥Õ¥¡¥¤¥ë¡¢¥×¥í¥°¥é¥à¤¬Ä¾ÀÜÁàºî¤¹¤ë¥Õ¥¡¥¤¥ë¤Ê¤É¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë̾¤Ï¥Õ¥ë¥Ñ¥¹¤Çµ­ºÜ¤·¡¢ +¥Ç¥£¥ì¥¯¥È¥ê¤ÎÉôʬ¤Ï¥æ¡¼¥¶¡¼¤Î¹¥¤ß¤Ë¹ç¤ï¤»¤Æ +¥¤¥ó¥¹¥È¡¼¥ë½èÍý¤ÇÊѹ¹¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +¿¤¯¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¥Ç¥Õ¥©¥ë¥È¤Î¥¤¥ó¥¹¥È¡¼¥ëÀè¤Ï +.I /usr/local +¤Ç¤¢¤ë¡£¤·¤¿¤¬¤Ã¤Æ¥Ù¡¼¥¹¤È¤Ê¤ë¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤â +.I /usr/local +¤¬»È¤ï¤ì¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¤¤À¤í¤¦¡£ +.\" May 07: Almost no current man pages have a DIAGNOSTICS section; +.\" "RETURN VALUE" or "EXIT STATUS" is preferred. +.\" .TP +.\" .B ¿ÇÃÇ¥á¥Ã¥»¡¼¥¸ (DIAGNOSTICS) +.\" ¤´¤¯°ìÈÌŪ¤Ê¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Î³µÍפȡ¢ +.\" ¤½¤ì¤é¤ò¤É¤¦°·¤¦¤«¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤ë¡£¥×¥í¥°¥é¥à¤Î¼Â¹Ô»þ¤Ë¸½¤ì¤ë +.\" ¥·¥¹¥Æ¥à¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤äÃ×̿Ū¥·¥°¥Ê¥ë¤òÁ´ÉôÀâÌÀ¤¹¤ëɬÍפϤʤ¤¡£ +.\" ¤¿¤À¤·¤½¤ì¤é¤¬¥×¥í¥°¥é¥à¤ËÂФ·¤Æ +.\" ²¿¤é¤«¤ÎÆüì¤Ê°ÕÌ£¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤ÏÊ̤Ǥ¢¤ë¡£ +.\" +.\" May 07: Almost no current man pages have a SECURITY section. +.\".TP +.\" .B ¥»¥­¥å¥ê¥Æ¥£ (SECURITY) +.\" ¥»¥­¥å¥ê¥Æ¥£´ØÏ¢¤ÎÏÃÂꡦÌäÂê¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤ë¡£ +.\" Èò¤±¤ë¤Ù¤­ÀßÄê¤ä´Ä¶­¡¦¥»¥­¥å¥ê¥Æ¥£¾å¤ÎÌäÂê¤ò°ú¤­µ¯¤³¤¹¥³¥Þ¥ó¥É +.\" ¤Ê¤É¤Ë¤Ä¤¤¤Æ·Ù¹ð¤¹¤ë¡£¤½¤ì¤é¤¬ÌÀ¤é¤«¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¤³¤ì¤ÏÆä˽ÅÍפǤ¢¤ë¡£ +.\" ¥»¥­¥å¥ê¥Æ¥£¤Ë´Ø¤¹¤ëÏÃÂê¤Ï¡¢É¬¤º¤·¤âÆÈΩ¤·¤¿¥»¥¯¥·¥ç¥ó¤Ë¤¹¤ëɬÍפϤʤ¤¡£ +.\" ¤â¤·Íý²ò¤·¤ä¤¹¤±¤ì¤Ð¡¢¥»¥­¥å¥ê¥Æ¥£¤Î¾ðÊó¤Ï¾¤Î¥»¥¯¥·¥ç¥ó +.\" (Î㤨¤Ð +.\" .B ÀâÌÀ +.\" ¤ä +.\" .B ÍøÍÑË¡ +.\" ¤Ê¤É) ¤Ë½ñ¤¤¤Æ¤â¤è¤¤¡£ +.\" ¤·¤«¤·¡¢¥»¥­¥å¥ê¥Æ¥£¤Î¾ðÊó¤Ï¤É¤³¤«¤Ë¤Ï½ñ¤¤¤Æ¤ª¤¤¤Æ¤Û¤·¤¤! +.TP +.B ¥Ð¡¼¥¸¥ç¥ó (VERSIONS) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤¬Åо줷¤¿¤ê¡¢Æ°ºî¤Î½ÅÍפÊÊѹ¹¤¬¹Ô¤ï¤ì¤¿¡¢ +Linux ¥«¡¼¥Í¥ë¤ä glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Î´Ê·é¤Ê³µÍס£ +°ìÈ̤ˡ¢Á´¤Æ¤Î¿·¤·¤¤¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë +¡Ö¥Ð¡¼¥¸¥ç¥ó¡×¤ÎÀá¤òÀߤ±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +»ÄÇ°¤Ê¤³¤È¤Ë¡¢Â¿¤¯¤Î´û¸¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¤³¤Î¾ðÊó¤Ï´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤ +(¤³¤ì¤é¤Î¥Ú¡¼¥¸¤¬½ñ¤«¤ì¤¿»þÅÀ¤Ç¤Ï¤½¤Î¤è¤¦¤Ê¥Ý¥ê¥·¡¼¤Ï¤Ê¤«¤Ã¤¿¤«¤é¤Ç¤¢¤ë)¡£ +¤³¤ì¤ò²þÁ±¤¹¤ë¥Ñ¥Ã¥Á¤Ï´¿·Þ¤µ¤ì¤ë¤¬¡¢ +¿·¤·¤¤¥³¡¼¥É¤ò½ñ¤¯¥×¥í¥°¥é¥Þ¤Î´ÑÅÀ¤«¤é¤¹¤ì¤Ð¡¢ +¤ª¤½¤é¤¯¤³¤Î¾ðÊ󤬽ÅÍפˤʤë¤Î¤Ï¡¢ +Linux 2.4 °Ê¹ß¤ÇÄɲ䵤줿¥«¡¼¥Í¥ë¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹ (¥«¡¼¥Í¥ë 2.2 ¤«¤é¤ÎÊѹ¹) ¤È +glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤ÇÄɲ䵤줿¥é¥¤¥Ö¥é¥ê´Ø¿ô (glibc 2.0 ¤«¤é¤ÎÊѹ¹) +¤Ë¤Ä¤¤¤Æ¤Î¤ß¤Ç¤¢¤í¤¦¡£ + +.BR syscalls (2) +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¤â¡¢¤¤¤í¤¤¤í¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬½é¤á¤ÆÅо줷¤¿ +¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Î¾ðÊ󤬽ñ¤«¤ì¤Æ¤¤¤ë¡£ +.TP +.B ½àµò (CONFORMING TO) +¤½¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë´Ø¿ô¤ä¥³¥Þ¥ó¥É¤Ë´ØÏ¢¤¹¤ë +ɸ½àµ¬³Ê¤ä´·½¬¤Ë¤Ä¤¤¤Æµ­ºÜ¤¹¤ë¡£ +¥»¥¯¥·¥ç¥ó 2 ¤ä 3 ¤Î¥Ú¡¼¥¸¤Ç¤Ï¡¢¤³¤Î¥»¥¯¥·¥ç¥ó¤Ç +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä´Ø¿ô¤¬½àµò¤¹¤ë POSIX.1 ¤Î¥Ð¡¼¥¸¥ç¥ó¤È¡¢ +C99 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¤«¤Ë¿¨¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +(SUS, SUSv2, XPG ¤Ê¤É¤Î¾¤Îɸ½àµ¬³Ê¤ä¡¢SVr4 ¤ä 4.xBSD ¤Î¼ÂÁõɸ½à¤Ë +¤Ä¤¤¤Æ¤Ï¡¢ÀâÌÀ¤·¤Æ¤¤¤ë¥³¡¼¥ë¤¬¤³¤ì¤é¤Îµ¬³Ê¤Çµ¬Äꤵ¤ì¤Æ¤ª¤ê +POSIX.1 ¤Î¸½¹Ô¥Ð¡¼¥¸¥ç¥ó¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç°Ê³°¤Ï¡¢ +¤¢¤Þ¤ê¿¼¤¯µ¤¤Ë¤¹¤ëɬÍפϤʤ¤¡£) +.RB ( standards (7) +»²¾È¡£) + +¤½¤Î¥³¡¼¥ë¤¬¤É¤Îɸ½à¤Ë¤â´ð¤Å¤¤¤Æ¤¤¤Ê¤¤¤¬¡¢ +¾¤Î¥·¥¹¥Æ¥à¤Ç¹­¤¯Â¸ºß¤¹¤ë¾ì¹ç¤Ï¡¢¤½¤Î»Ý¤òµ­ºÜ¤¹¤ë¤³¤È¡£ +¤½¤Î¥³¡¼¥ë¤¬ Linux ¸ÇÍ­¤Î¾ì¹ç¤Ï¡¢¤½¤Î»Ý¤òµ­ºÜ¤¹¤ë¤³¤È¡£ + +(¤½¤¦¤Ê¤Ã¤Æ¤¤¤ë¥Ú¡¼¥¸¤¬Â¿¤¤¤¬) ¤³¤Î¥»¥¯¥·¥ç¥ó¤ÎÆâÍƤ¬É¸½à¤Î¥ê¥¹¥È +¤À¤±¤Î¾ì¹ç¡¢¥ê¥¹¥È¤ÎºÇ¸å¤Ë¥Ô¥ê¥ª¥É (\(aq.\(aq) ¤òÃÖ¤¯¤³¤È¡£ +.TP +.B Ãí°Õ (NOTES) +¤½¤Î¾¤ÎÃí°ÕÅÀ¤ò½ñ¤¯¡£ +¥»¥¯¥·¥ç¥ó 2 ¤È 3 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï¡¢ +\fILinux ¤Ç¤ÎÃí°Õ (Linux Notes)\fP ¤ä \fIglibc ¤Ç¤ÎÃí°Õ (Glibc Notes)\fP +¤È¤¤¤¦Ì¾Á°¤Î¥µ¥Ö¥»¥¯¥·¥ç¥ó (\fBSS\fP) ¤òÀߤ±¤ë¤ÈÊØÍø¤Ê¤³¤È¤â¤¢¤ë¡£ +.TP +.B ¥Ð¥° (BUGS) +À©¸Â¡¦ÃΤé¤ì¤Æ¤¤¤ë·ç´Ù¤äÉÔÊؤÊÅÀ¡¢¤½¤Î¾ÉԻ׵ĤÊÆ°ºî¤Ê¤É¤ò½ñ¤¯¡£ +.TP +.B Îã (EXAMPLE) +¤³¤Î´Ø¿ô¡¦¥Õ¥¡¥¤¥ë¡¦¥³¥Þ¥ó¥É¤ò¤É¤Î¤è¤¦¤Ë»È¤¦¤«¤ò¼¨¤·¤¿ +¤Ò¤È¤Ä¤Þ¤¿¤ÏÊ£¿ô¤ÎÎã¤òµ­½Ò¤¹¤ë¡£ +¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò½ñ¤¯ºÝ¤Î¾ÜºÙ¤Ï +°Ê²¼¤Î¡Ö¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£ +.TP +.B Ãø¼Ô (AUTHORS) +ʸ½ñ¤Þ¤¿¤Ï¥×¥í¥°¥é¥à¤ÎÃø¼Ô¤òÎóµ­¤¹¤ë¡£ +.B Ãø¼Ô¥»¥¯¥·¥ç¥ó¤Ï¶ËÎÏ»ÈÍѤ·¤Ê¤¤¤³¤È¡£ +°ìÈÌŪ¤Ë¤Ï¡¢Ãø¼Ô¤Î¥ê¥¹¥È¤ò³Æ¥Ú¡¼¥¸¤Ë»µ¤­»¶¤é¤µ¤Ê¤¤Êý¤¬¤è¤¤ +(»þ´Ö¤¬¤¿¤Ä¤È¡¢ºî¼Ô¤Î¥ê¥¹¥È¤ÏËÄÂç¤Ë¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ë)¡£ +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¿·µ¬¤Ë½ñ¤¤¤¿¤ê¡¢ÂçÉý¤Ë½¤Àµ¤ò¹Ô¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ë¥³¥á¥ó¥È¤È¤·¤ÆÃøºî¸¢É½¼¨¤òÄɲ乤뤳¤È¡£ +¤¢¤Ê¤¿¤¬¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Îºî¼Ô¤Ç¡¢¥Ð¥°¤òÊó¹ð¤¹¤ë¤¿¤á¤Î¥¢¥É¥ì¥¹¤ò +ºÜ¤»¤¿¤¤¾ì¹ç¤Ï¡¢¡Ö¥Ð¥°¡×¥»¥¯¥·¥ç¥ó¤Î¸å¤í¤Ë¤³¤Î¥»¥¯¥·¥ç¥ó¤òÇÛÃÖ¤¹¤ë¤³¤È¡£ +.TP +.B ´ØÏ¢¹àÌÜ (SEE ALSO) +´ØÏ¢¤¹¤ë¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¡¢¥³¥ó¥Þ¶èÀÚ¤ê¤Î¥ê¥¹¥È¤Ç¡¢ +¥»¥¯¥·¥ç¥óÈÖ¹æ½ç¤Ë¡¢¥»¥¯¥·¥ç¥óÆâ¤Ç¤Ï¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Çµ­ºÜ¤¹¤ë¡£ +²Äǽ¤Ê¤é´ØÏ¢¤¹¤ë¾¤Îʸ½ñ¤â½ñ¤¯¡£ +´·½¬¤Ç¤Ï¡¢¤³¤Î¥»¥¯¥·¥ç¥ó¤ÏºÇ¸å¤ËÃÖ¤¯¡£ +¥ê¥¹¥È¤ÎËöÈø¤Ë¥Ô¥ê¥ª¥É¤òÃÖ¤«¤Ê¤¤¤³¤È¡£ +.SS ¥Õ¥©¥ó¥È¤Î´·½¬ +.PP +´Ø¿ô¤ËÂФ·¤Æ¤Ï¡¢°ú¤­¿ô¤Ë¤Ï¾ï¤Ë¥¤¥¿¥ê¥Ã¥¯ÂΤòÍѤ¤¤ë¡£ +¡Ö¤¿¤È¤¨½ñ¼° (SYNOPSIS) ¥»¥¯¥·¥ç¥ó¤Ç¤¢¤Ã¤Æ¤â¡¢¤³¤Î¥ë¡¼¥ë¤Ë½¾¤¦¡× +´Ø¿ô¤Î¾¤ÎÉôʬ¤Ï¥Ü¡¼¥ë¥É¤ò»ØÄꤹ¤ë: +.PP +.BI " int myfunction(int " argc ", char **" argv ); +.PP +°ú¤­¿ô̾¤È¤¤¤Ã¤¿ÊÑ¿ô̾¤Ï¥¤¥¿¥ê¥Ã¥¯ÂΤò»ØÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +¥Õ¥¡¥¤¥ë̾ (¥Ñ¥¹Ì¾¡¢¤Þ¤¿¤Ï +.I /usr/include +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î»²¾È) ¤Ï¾ï¤Ë¥¤¥¿¥ê¥Ã¥¯ÂΤˤ¹¤ë (Îã: +.IR )¡£ +¤¿¤À¤·¡¢½ñ¼° (SYNOPSIS) ¥»¥¯¥·¥ç¥ó¤ÏÎã³°¤Ç¡¢ +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ï¥Ü¡¼¥ë¥É¤Ë¤¹¤ë (Îã: +.BR "#include " )¡£ +.I /usr/include +°Ê²¼¤Îɸ½à¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ëºÝ¤Ï¡¢ +Ä̾ï¤Î C ¸À¸ì¤ÈƱÍͤ˻³³ç¸Ì¤Ç¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ò°Ï¤Ì¤Ç»ØÄꤹ¤ë (Î㡧 +.IR )¡£ +.PP +Ä̾Âçʸ»ú¤Çɽ¸½¤¹¤ëÆüì¥Þ¥¯¥í¤Ï¥Ü¡¼¥ë¥É¤Çɽ¤¹ (Î㤨¤Ð +.BR MAXINT )¡£ +Îã³°¤È¤·¤Æ NULL ¤Ï¥Ü¡¼¥ë¥É¤Ë¤·¤Ê¤¤¡£ +.PP +¥¨¥é¡¼¥³¡¼¥É¤Î¥ê¥¹¥È¤òÎóµó¤¹¤ë»þ¤Ë¤Ï¡¢¥³¡¼¥É¤Ï¥Ü¡¼¥ë¥É¤Çɽ¤¹ +(¤³¤Î¥ê¥¹¥È¤Ë¤ÏÄ̾ï +.B \&.TP +¥Þ¥¯¥í¤òÍѤ¤¤ë)¡£ +.PP +´°Á´¤Ê¥³¥Þ¥ó¥É¤Ï¡¢Ä¹¤¤¾ì¹ç¤Ë¤Ï¡¢Îã¤Ë¼¨¤¹¤è¤¦¤Ë +»ú²¼¤²¤·¤¿¹Ô¤Ë¥³¥Þ¥ó¥É¤À¤±¤òµ­ºÜ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.in +4n +.nf + +man 7 man-pages + +.fi +.in +¥³¥Þ¥ó¥É¤¬Ã»¤¤¾ì¹ç¤Ï¡¢ +.I "man 7 man-pages" +¤Î¤è¤¦¤Ë¥¤¥¿¥ê¥Ã¥¯ÂΤÇʸÃæ¤ËËä¤á¹þ¤ó¤Çµ­ºÜ¤·¤Æ¤â¤è¤¤¡£ +¤³¤Î¾ì¹ç¡¢¥³¥Þ¥ó¥ÉÆâ¤ÎŬÀڤʰÌÃ֤ˡ¢²þ¹Ô¤Ç¤­¤Ê¤¤¥¹¥Ú¡¼¥¹ ("\e\ ") +¤ò»È¤¦¤È¤è¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +¥³¥Þ¥ó¥É¥ª¥×¥·¥ç¥ó¤â +.I \-l +¤Î¤è¤¦¤Ë¥¤¥¿¥ê¥Ã¥¯ÂΤǵ­ºÜ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +¼°¤Ï¡¢ÀìÍѤλú²¼¤²¤·¤¿¹Ô¤Ëµ­ºÜ¤·¤Ê¤¤¾ì¹ç¡¢¥¤¥¿¥ê¥Ã¥¯ÂΤò»ØÄꤹ¤ë¤³¤È¡£ +·«¤êÊÖ¤·¤Ë¤Ê¤ë¤¬¡¢¼°¤òÄ̾ï¤ÎʸÃæ¤ËËä¤á¹þ¤à¾ì¹ç¤Ë¤â¡¢ +²þ¹Ô¤Ç¤­¤Ê¤¤¥¹¥Ú¡¼¥¹¤ò»È¤¦¤È¤è¤¤¤À¤í¤¦¡£ +.PP +¤½¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÀâÌÀÂоݤؤλ²¾È¤Ï¡¢¥Ü¡¼¥ë¥É¤Ç̾Á°¤òµ­ºÜ¤¹¤ë¡£ +Âоݤ¬´Ø¿ô (¤Ä¤Þ¤ê¡¢¥»¥¯¥·¥ç¥ó 2 ¤ä 3 ¤Î¥Ú¡¼¥¸) ¤Î¾ì¹ç¡¢ +̾Á°¤Î¸å¤í¤Ë¥í¡¼¥Þ¥ó¥Õ¥©¥ó¥È (Ä̾ï¤Î¥Õ¥©¥ó¥È) ¤Ç´Ý³ç¸Ì¤ÎÂФò³¤±¤ë¡£ +Î㤨¤Ð¡¢ +.BR fcntl (2) +¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï¡¢ÀâÌÀÂоݤؤλ²¾È¤Ï +.BR fcntl () +¤Î¤è¤¦¤Ëµ­ºÜ¤¹¤ë¡£ +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ë¤Ï¼¡¤Î¤è¤¦¤Ëµ­ºÜ¤¹¤ë¤Î¤¬Ë¾¤Þ¤·¤¤: +.nf + + .BR fcntl () + +.fi +("\\fB...\\fP()" ¤è¤ê¤â¡¢¤³¤Î·Á¼°¤ò»È¤¦¤³¤È¡£ +¤³¤ì¤Ë¤è¤ê¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò²ò¼á¤¹¤ë¥Ä¡¼¥ë¤ò +½ñ¤¯¤Î¤¬´Êñ¤Ë¤Ê¤ë¡£) +.PP +Ê̤Υޥ˥奢¥ë¥Ú¡¼¥¸¤Ø¤Î»²¾È¤Ï¡¢¥Ü¡¼¥ë¥É¤Ç̾Á°¤òµ­ºÜ¤·¡¢ +¤½¤ì¤Ë³¤±¤Æ¥»¥¯¥·¥ç¥óÈÖ¹æ¤ò¡Öɬ¤º¡×½ñ¤¯¡£¥»¥¯¥·¥ç¥óÈÖ¹æ¤Ï +¥í¡¼¥Þ¥ó¥Õ¥©¥ó¥È (Ä̾ï¤Î¥Õ¥©¥ó¥È) ¤Ç½ñ¤­¡¢¥¹¥Ú¡¼¥¹¤ÏÆþ¤ì¤Ê¤¤ +(Îã: +.BR intro (2))¡£ +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ë¤Ï¼¡¤Î¤è¤¦¤Ëµ­ºÜ¤¹¤ë¤Î¤¬Ë¾¤Þ¤·¤¤: +.nf + + .BR intro (2) + +.fi +(Áê¸ß»²¾È¤Ë¥»¥¯¥·¥ç¥óÈÖ¹æ¤ò´Þ¤á¤Æ¤ª¤¯¤È¡¢ +.B man2html +¤È¤¤¤Ã¤¿¥Ä¡¼¥ë¤¬¥Ú¡¼¥¸´Ö¤Î¥Ï¥¤¥Ñ¡¼¥ê¥ó¥¯¤òŬÀÚ¤ËÀ¸À®¤Ç¤­¤ë¡£) +.SS ÄÖ¤ê (spelling) +¥ê¥ê¡¼¥¹ 2.59 ¤«¤é¤À¤¬¡¢ +.I man-pages +¤Ï¥¢¥á¥ê¥«±Ñ¸ì¤ÎÄÖ¤ê¤Î´·½¬¤Ë½¾¤Ã¤Æ¤¤¤ë¡£ +¿·¤·¤¤¥Ú¡¼¥¸¤ä¥Ñ¥Ã¥Á¤ÏÁ´¤Æ¤³¤Î´·½¬¤Ë½¾¤Ã¤Æ²¼¤µ¤¤¡£ +.SS ¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤È¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥ó +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î»È¤¤Êý¤ò¼¨¤¹ +¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò´Þ¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤½¤ÎºÝ¤Ë¤Ï¡¢°Ê²¼¤ÎÅÀ¤Ëα°Õ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TP 3 +* +¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï C ¤Çµ­ºÜ¤¹¤ë¤³¤È¡£ +.TP +* +¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï¡¢ +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë¤Ä¤¤¤Æʸ¾Ï¤Ç´Êñ¤ËÀâÌÀ¤Ç¤­¤ë°Ê¾å¤Î¤³¤È¤ò¼¨¤¹¾ì¹ç¤Ë¤À¤± +ɬÍפ«¤ÄÍ­ÍѤǤ¢¤ë¡£¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¸Æ¤Ó½Ð¤¹°Ê³°¤Ë²¿¤â¤·¤Ê¤¤¥µ¥ó¥×¥ë +¥×¥í¥°¥é¥à¤ÏÉáÄ̤ϤۤȤó¤ÉÌò¤ËΩ¤¿¤Ê¤¤¡£ +.TP +* +¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï¤«¤Ê¤êû¤á¤Ë¤¹¤ë¤³¤È +(100¹Ô̤Ëþ¤¬Ë¾¤Þ¤·¤¯¡¢50¹Ô̤Ëþ¤¬ÍýÁÛŪ¤Ç¤¢¤ë)¡£ +.TP +* +¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¸å¤Ç +¥¨¥é¡¼¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¤³¤È¡£ +.TP +* +¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï´°·ë¤·¤Æ¤¤¤Æ¡¢ +\fIcc\ \-Wall\fP +¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤¿ºÝ¤Ë·Ù¹ð¤Ê¤·¤Ç¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤ë¤³¤È¡£ +.TP +* +²Äǽ¤«¤ÄŬÀڤʾì¹ç¤Ë¤Ï¡¢¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ç +ÆþÎϤˤè¤êÆ°ºî¤òÊѲ½¤µ¤»¤ë¤Ê¤É¤Î¼Â¸³¤ò¹Ô¤¦¤È¤è¤¤ +(ÍýÁÛŪ¤Ë¤Ï¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ä¡¢¥×¥í¥°¥é¥à¤¬Æɤ߹þ¤àÆþÎϥǡ¼¥¿ +·Ðͳ¤Ç¡¢Æ°ºî¤òÊѲ½¤µ¤»¤ë¤Î¤¬¤è¤¤)¡£ +.TP +* +¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï¡¢K&R (Kernighan and Ritchie) ¥¹¥¿¥¤¥ë¤Ç½ñ¤­¡¢ +»ú²¼¤²¤Ï¥¹¥Ú¡¼¥¹ 4ʸ»ú¤Ç¹Ô¤¦¡£ +(¥½¡¼¥¹¥³¡¼¥É¤Ç TAB ʸ»ú¤ò»È¤¦¤Î¤ÏÈò¤±¤ë¤³¤È¡£) +.PP +¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤¬¤É¤ó¤ÊÉ÷¤Ë¤Ê¤Ã¤Æ¤¤¤ì¤Ð¤è¤¤¤«¤ÎÎã¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR wait (2) +¤È +.BR pipe (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ + +¥×¥í¥°¥é¥à¤Î»È¤¤Êý¤ä¾¤Î¥·¥¹¥Æ¥à¤ÎÆÃħ¤ò¼¨¤¹¤¿¤á¤Ë¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥óÎã +¤ò´Þ¤á¤ë¾ì¹ç¡¢¥æ¡¼¥¶¤ÎÆþÎÏʸ¤ò¥Ü¡¼¥ë¥É¤Ë¤·¤Æ¡¢¥·¥¹¥Æ¥à¤¬À¸À®¤¹¤ë +½ÐÎϤȶèÊ̤Ǥ­¤ë¤è¤¦¤Ë¤¹¤ë¤³¤È¡£ +.SS ¹½Â¤ÂΤÎÄêµÁ¡¢¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥ó¥í¥°¤Ê¤É¤Î»ú²¼¤² +¹½Â¤ÂΤÎÄêµÁ¤ä¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥ó¥í¥°¤Ê¤É¤òËÜʸÃæ¤Ëµ­ºÜ¤¹¤ëºÝ¤Ï¡¢ +¥¹¥Ú¡¼¥¹ 4¸Äʬ¤Î»ú²¼¤²¤ò¹Ô¤¦ (¤Ä¤Þ¤ê¡¢¥Ö¥í¥Ã¥¯¤ò +.I ".in\ +4n" +¤È +.I ".in" +¤Ç°Ï¤à)¡£ +.SH Îã +.I man-pages +¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤ë¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÂκۤÎɸ½àŪ¤ÊÎã¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR pipe (2) +¤È +.BR fcntl (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR man (1), +.BR man2html (1), +.BR groff (7), +.BR groff_man (7), +.BR man (7), +.BR mdoc (7) diff --git a/release/man7/man.7 b/release/man7/man.7 new file mode 100644 index 00000000..398d3268 --- /dev/null +++ b/release/man7/man.7 @@ -0,0 +1,558 @@ +.\" (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" +.SH ̾Á° +man \- man ¥Ú¡¼¥¸¤òÀ°·Á¤¹¤ë¥Þ¥¯¥í +.SH ½ñ¼° +.B groff \-Tascii \-man +.I file +\&... +.LP +.B groff \-Tps \-man +.I file +\&... +.LP +.B man +.RI [ section ] +.I title +.SH ÀâÌÀ +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï¡¢ +.B "groff an.tmac" +¤Î¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸ +.RB ( man +¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸¤È¤â¸Æ¤Ð¤ì¤ë¤³¤È¤â¿¤¤) ¤Ë¤Ä¤¤¤ÆÀâÌÀ¤¹¤ë¡£ +¤³¤Î¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸¤Ï¡¢ +Linux ¤Î man ¥Ú¡¼¥¸¤ò½ñ¤¤¤¿¤ê°Ü¿¢¤·¤¿¤ê¤¹¤ë¤È¤­¤Ë¡¢ +³«È¯¼Ô¤¬ÍѤ¤¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸¤Ï¥Ð¡¼¥¸¥ç¥ó´Ö¤Ç¤Î¸ß´¹À­¤¬¹â¤¯¡¢ +man page ¤Î°Ü¿¢¤Ë¤¢¤¿¤Ã¤Æ¤ÏÂ礭¤ÊÌäÂê¤Ï¤Ê¤¤¤À¤í¤¦ +(⤷¡¢NET-2 BSD release ¤ÏÎã³°¤Ç¤¢¤ë¡£ +¤³¤Á¤é¤Ç¤Ï mdoc ¤È¸Æ¤Ð¤ì¤ëÁ´¤¯°Û¤Ê¤ë¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +.BR mdoc (7) +¤ò»²¾È)¡£ +.PP +NET-2 BSD ¤Î man ¥Ú¡¼¥¸¤â¡¢ +.B groff +¤Î¥ª¥×¥·¥ç¥ó¤È¤·¤Æ +.B \-man +¤ÎÂå¤ï¤ê¤Ë +.B \-mdoc +¤ò»ØÄꤹ¤ë¤À¤±¤Ç¡¢ÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.B \-mandoc +¥ª¥×¥·¥ç¥ó¤ò»È¤¨¤Ð¤É¤Î¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸¤¬ÍѤ¤¤é¤ì¤Æ¤¤¤ë¤« +¼«Æ°Åª¤Ë¸¡½Ð¤Ç¤­¤ë¤Î¤Ç¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤Î¤¬¤ªÁ¦¤á¤Ç¤¢¤ë¡£ +.PP +Linux \fIman-pages\fP ¥×¥í¥¸¥§¥¯¥È¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò½ñ¤¯ºÝ¤Ë +½¾¤¦¤Ù¤­·è¤Þ¤ê»ö¤Ë¤Ä¤¤¤Æ¤Ï +.BR man-pages (7) +¤ò»²¾È¡£ +.SS ¥¿¥¤¥È¥ë¹Ô +man ¥Ú¡¼¥¸¤Î (¥³¥á¥ó¥È¹Ô¤ò½ü¤¯) ºÇ½é¤Î¥³¥Þ¥ó¥É¤Ï¡¢ +°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¥³¥á¥ó¥È¹Ô¤È¤Ï \fB.\\"\fP ¤Ç»Ï¤Þ¤ë¹Ô¤Î¤³¤È¤Ç¤¢¤ë¡£ +.RS +.sp +.B \&.TH +.I "title section date source manual" +.sp +.RE +\fBTH\fP ¤ËÅϤ¹°ú¤­¿ô¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR man-pages (7) +¤ò»²¾È¡£ +.PP +¤Ê¤ª BSD ¤Î mdoc ¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¥Ú¡¼¥¸¤Ï +.B TH +¥³¥Þ¥ó¥É¤Ç¤Ï¤Ê¤¯ +.B Dd +¥³¥Þ¥ó¥É¤«¤é»Ï¤Þ¤ë¡£ +.SS ¥»¥¯¥·¥ç¥ó +¥»¥¯¥·¥ç¥ó¤Ï +.B \&.SH +¤Ç»Ï¤Þ¤ê¡¢¸«½Ð¤·Ì¾¤¬¤½¤ì¤Ë³¤¯¡£ +.\" °Ê²¼¤Ïɬ¿Ü¤Ç¤Ï¤Ê¤¤¤è¤¦¤À (Debian bug 411303 »²¾È), +.\" ¥¹¥Ú¡¼¥¹¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë̾Á°¤ò +.\" .BR \&.SH +.\" ¤ÈƱ¤¸¹Ô¤ËÃÖ¤¯¾ì¹ç¤Ï¡¢¸«½Ð¤·Ì¾¤Ï¥À¥Ö¥ë¥¯¥©¡¼¥È¤Ç°Ï¤à¡£ + +NAME (̾Á°) ¤È¤¤¤¦¸«½Ð¤·¤À¤±¤Ïɬ¤ºÃÖ¤«¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£ +¤³¤Î¸«½Ð¤·¤Ï°ìÈֺǽé¤Î¥»¥¯¥·¥ç¥ó¤Ë¤¹¤Ù¤­¤Ç¡¢¸«½Ð¤·¤Î +¼¡¤Î¹Ô¤Ë¤Ï¥×¥í¥°¥é¥à¤ÎÀâÌÀ¤ò°ì¹Ô¤Ç½ñ¤¯¡£ +.RS +.sp +\&.SH NAME +.br +.sp +.RE +¤³¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë½¾¤¤¡¢¥³¥Þ¥ó¥É̾¤Ë³¤¯¥·¥ó¥°¥ë¥À¥Ã¥·¥å (-) +¤ÎÁ°¤Ë¤Ïɬ¤º¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤òÃÖ¤¯¤³¤È¡£ +¤³¤Îʸˡ¤Ï¡¢ +.BR makewhatis (8) +¥×¥í¥°¥é¥à¤¬ +.BR whatis (1) +¤ä +.BR apropos (1) +¥³¥Þ¥ó¥ÉÍѤΠ(¥³¥Þ¥ó¥É¤Îû¤¤ÀâÌÀ¤Î) ¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÀ¸À®¤¹¤ëºÝ¤ËÍøÍѤµ¤ì¤ë¡£ +.PP +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ËÅо줹¤ë²ÄǽÀ­¤Î¤¢¤ë¤³¤ì°Ê³°¤Î¥»¥¯¥·¥ç¥ó¤Î¥ê¥¹¥È¤Ë +¤Ä¤¤¤Æ¤Ï +.BR man-pages (7) +¤ò»²¾È¡£ +.SS ¥Õ¥©¥ó¥È +¥¿¥¤¥×¥Õ¥§¥¤¥¹¤òÁªÂò¤¹¤ë¥³¥Þ¥ó¥É¤Ï°Ê²¼¤Î¤è¤¦¤Ë»ØÄꤹ¤ë: +.TP 4 +.B \&.B +¥Ü¡¼¥ë¥É¡£ +.TP +.B \&.BI +¥Ü¡¼¥ë¥É¤È¥¤¥¿¥ê¥Ã¥¯¤È¤ò¸ò¸ß¤Ë +(Æä˴ؿô»ØÄê¤ËÊØÍø)¡£ +.TP +.B \&.BR +¥Ü¡¼¥ë¥É¤È¥í¡¼¥Þ¥ó¤È¤ò¸ò¸ß¤Ë +(Æä˾¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤¹¤ë¤È¤­¤ËÊØÍø)¡£ +.TP +.B \&.I +¥¤¥¿¥ê¥Ã¥¯¡£ +.TP +.B \&.IB +¥¤¥¿¥ê¥Ã¥¯¤È¥Ü¡¼¥ë¥É¤È¤ò¸ò¸ß¤Ë¡£ +.TP +.B \&.IR +¥¤¥¿¥ê¥Ã¥¯¤È¥í¡¼¥Þ¥ó¤È¤ò¸ò¸ß¤Ë¡£ +.TP +.B \&.RB +¥í¡¼¥Þ¥ó¤È¥Ü¡¼¥ë¥É¤È¤ò¸ò¸ß¤Ë¡£ +.TP +.B \&.RI +¥í¡¼¥Þ¥ó¤È¥¤¥¿¥ê¥Ã¥¯¤È¤ò¸ò¸ß¤Ë¡£ +.TP +.B \&.SB +¥¹¥â¡¼¥ë¤È¥Ü¡¼¥ë¥É¤ò¸ò¸ß¤Ë¡£ +.TP +.B \&.SM +¥¹¥â¡¼¥ë (Ƭ»ú¸ì¤Ê¤É¤ËÍѤ¤¤ë) +.LP +´·Îã¤È¤·¤Æ¤Ï¡¢³Æ¥³¥Þ¥ó¥É¤Ï 6 ¤Ä¤Þ¤Ç¤Î°ú¤­¿ô¤ò»ý¤Ä»ö¤¬²Äǽ¤À¤¬¡¢ +GNU ¤Î¼ÂÁõ¤Ç¤ÏÀ©¸Â¤Ï¤Ê¤¤¤è¤¦¤À (¤·¤«¤·°Ü¿¢À­¤òÊÝ»ý¤¹¤ë¤¿¤á¤Ë¤Ï +°ú¤­¿ô¤Ï 6 ¤Þ¤Ç¤Ë¸Â¤Ã¤Æ¤ª¤¯¤Î¤¬Îɤ¤¤À¤í¤¦)¡£ +°ú¤­¿ô¤Ï¥¹¥Ú¡¼¥¹¤Ç¶èÀÚ¤é¤ì¤ë¡£ +¥¹¥Ú¡¼¥¹¤ò´Þ¤ó¤À°ú¤­¿ô¤òÍ¿¤¨¤ë¤Ë¤Ï¡¢¥À¥Ö¥ë¥¯¥©¡¼¥È¤Ç°Ï¤¨¤Ð¤è¤¤¡£ +¤¹¤Ù¤Æ¤Î°ú¤­¿ô¤Ï¥¹¥Ú¡¼¥¹¤ò¼è¤ê½ü¤¤¤Æʤ٤é¤ì¤ë¤Î¤Ç¡¢ +.B \&.BR +¥³¥Þ¥ó¥É¤ò»È¤¨¤Ð¡¢Ã±¸ì¤Ï¥Ü¡¼¥ë¥É¤Ç¡¢¶çÆÉÅÀ¤ò¥í¡¼¥Þ¥ó¤Çɽ¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +°ú¤­¿ô¤¬Á´¤¯Í¿¤¨¤é¤ì¤Ê¤±¤ì¤Ð¡¢ +¤½¤Î¥³¥Þ¥ó¥É¤Ï¼¡¤Î¹Ô¤Î¥Æ¥­¥¹¥È¤ËŬÍѤµ¤ì¤ë¡£ +.SS ¤½¤Î¾¤Î¥Þ¥¯¥í¤äʸ»úÎó +.PP +°Ê²¼¤Ë¡¢Â¾¤Î¥Þ¥¯¥í¤äÄêµÁºÑ¤ß¤Îʸ»úÎó¤ò¼¨¤¹¡£ +Æä˵­½Ò¤¬¤Ê¤¤¸Â¤ê¡¢¥Þ¥¯¥í¤ò»È¤¦¤È²þ¹Ô¤¬¹Ô¤ï¤ì¤ë +(¥Æ¥­¥¹¥È¤Î¸½ºß¤Î¹Ô¤ò½ªÎ»¤¹¤ë)¡£ +¿¤¯¤Î¥Þ¥¯¥í¤Ï +¡ÖÍ¥À襤¥ó¥Ç¥ó¥È (prevailing indent)¡×¤òÀßÄꤷ¤¿¤ê¡¢»ÈÍѤ¹¤ë¡£ +Í¥À襤¥ó¥Ç¥ó¥È¤ÎÃͤϡ¢¤É¤Î¥Þ¥¯¥í¤«¤é¤â¥Ñ¥é¥á¡¼¥¿ +.I i +¤Ë¤è¤Ã¤Æ»ØÄê¤Ç¤­¤ë (°Ê²¼¤Ë¼¨¤¹)¡£ +¥Þ¥¯¥í¤Ç¤Ï +.I i +¤ò¾Êά¤¹¤ë¤³¤È¤â¤Ç¤­¡¢¤½¤Î¾ì¹ç¤Ï¸½ºß¤ÎÍ¥À襤¥ó¥Ç¥ó¥È¤ÎÃͤ¬ÍѤ¤¤é¤ì¤ë¡£ +¤³¤ì¤Ë¤è¤ê·ë²Ì¤È¤·¤Æ¡¢¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤¿ÃÊÍϢ³¤·¤Æ¤¤¤ë¾ì¹ç¡¢ +¥¤¥ó¥Ç¥ó¥È¤ÎÃͤòºÆ»ØÄꤷ¤Ê¤¯¤Æ¤â¥¤¥ó¥Ç¥ó¥ÈÎ̤òƱ¤¸¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +Ä̾ï¤Î (¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤Æ¤¤¤Ê¤¤) ÃÊÍÅо줹¤ë¤È¡¢ +Í¥À襤¥ó¥Ç¥ó¥È¤ÎÃͤϥǥե©¥ë¥È¤ÎÃÍ (0.5 ¥¤¥ó¥Á) ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢Í¿¤¨¤¿¥¤¥ó¥Ç¥ó¥È¤ÎÃÍ¤Ï ens ñ°Ì¤Ç¤¢¤ë¡£ +¥¤¥ó¥Ç¥ó¥È¤Îñ°Ì¤Ë¤Ï ens ¤ä ems ¤òÍѤ¤¤ë¤È¤è¤¤¡£¤³¤ì¤é¤Îñ°Ì¤Ï +¥Õ¥©¥ó¥È¥µ¥¤¥º¤¬Êѹ¹¤µ¤ì¤ë¤È¼«Æ°Åª¤ËÄ´À°¤µ¤ì¤ë¤«¤é¤Ç¤¢¤ë¡£ +¾¤Î½ÅÍפʥޥ¯¥íÄêµÁ¤Ï°Ê²¼¤ÎÄ̤ê: +.SS Ä̾ï¤ÎÃÊÍî +.TP 9m +.B \&.LP +.B \&.PP +¤ÈƱ¤¸ (¿·¤¿¤ÊÃÊÍî¤Î³«»Ï)¡£ +.TP +.B \&.P +.B \&.PP +¤ÈƱ¤¸ (¿·¤¿¤ÊÃÊÍî¤Î³«»Ï)¡£ +.TP +.B \&.PP +¿·¤·¤¤ÃÊÍî¤ò³«»Ï¤·¡¢¥¤¥ó¥Ç¥ó¥È¤ò¥ê¥»¥Ã¥È¤¹¤ë¡£ +.SS ÁêÂÐ¥Þ¡¼¥¸¥ó¥¤¥ó¥Ç¥ó¥È +.TP 9m +.BI \&.RS " i" +ÁêÂÐ¥Þ¡¼¥¸¥ó¥¤¥ó¥Ç¥ó¥È (relative margin indent) ¤ò³«»Ï¤¹¤ë¡£ +º¸¥Þ¡¼¥¸¥ó¤ò +.I i +¤À¤±±¦¤Ë°ÜÆ°¤¹¤ë +.RI ( i +¤¬¾Êά¤µ¤ì¤ë¤ÈÍ¥À襤¥ó¥Ç¥ó¥È¤ÎÃͤ¬ÍѤ¤¤é¤ì¤ë)¡£ +¿·¤¿¤ÊÍ¥À襤¥ó¥Ç¥ó¥È¤Ï 0.5 ¥¤¥ó¥Á¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +·ë²Ì¤È¤·¤Æ¡¢°Ê²¼¤ÎÃÊÍî¤ÏÂбþ¤¹¤ë +.B \&.RE +¤¬¸½¤ì¤ë¤Þ¤Ç¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤ë¡£ +.TP +.B \&.RE +ÁêÂÐ¥Þ¡¼¥¸¥ó¥¤¥ó¥Ç¥ó¥È¤ò½ªÎ»¤·¡¢ +Í¥À襤¥ó¥Ç¥ó¥È¤ÎÃͤò¸µ¤ËÌ᤹¡£ +.SS ÃÊÍî¤ò¥¤¥ó¥Ç¥ó¥È¤¹¤ë¥Þ¥¯¥í +.TP 9m +.BI \&.HP " i" +¤Ö¤é¤µ¤¬¤ê¥¤¥ó¥Ç¥ó¥È¤ÎÃÊÍî¤ò³«»Ï¤¹¤ë +(ÃÊÍî¤ÎÀèƬ¹Ô¤ÏÄ̾ï¤ÎÃÊÍî¤Îº¸¥Þ¡¼¥¸¥ó¤È¤Ê¤ê¡¢ +ÃÊÍî¤Î»Ä¤ê¤Î¹Ô¤Ï¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤ë)¡£ +.TP +.BI \&.IP " x i" +¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤¿ÃÊÍî¡£¥ª¥×¥·¥ç¥ó¤È¤·¤Æ¤Ö¤é¤µ¤¬¤ê¥¿¥°¤ò¤È¤ë¡£ +¥¿¥° +.I x +¤¬¾Êά¤µ¤ì¤ë¤È¡¢°Ê²¼¤ÎÃÊÍ¤Ù¤Æ¤¬ +.I i +¤Ç¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤ë¡£¥¿¥° +.I x +¤¬Í¿¤¨¤é¤ì¤ë¤È¡¢¥¿¥°¤Ï¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤¿ÃÊÍî¤ÎÁ°¤Ë¤Ö¤é²¼¤²¤é¤ì¤ë +.RB ( \&.TP +¤È¤Á¤ç¤¦¤ÉƱ¤¸¡£¤¿¤À¤·¥¿¥°¤ò¼¡¤Î¹Ô¤Ë½ñ¤¯Âå¤ï¤ê¤Ë¥³¥Þ¥ó¥É¤Ë»ØÄꤹ¤ë)¡£ +¥¿¥°¤¬Ä¹¤¹¤®¤ë¾ì¹ç¤Ë¤Ï¡¢¥¿¥°¤Ë³¤¯¥Æ¥­¥¹¥È¤Ï¼¡¤Î¹Ô¤Ë°ÜÆ°¤¹¤ë +(¥Æ¥­¥¹¥È¤¬¼º¤ï¤ì¤¿¤êº®¤¶¤Ã¤¿¤ê¤¹¤ë¤³¤È¤Ï¤Ê¤¤)¡£ +²Õ¾ò½ñ¤­¤ò¤¹¤ë¤Ë¤Ï¡¢ \e(bu (ÅÀ) ¤¢¤ë¤¤¤Ï \e(em (¥À¥Ã¥·¥å) +¤ò¥¿¥°¤Ë¤·¤Æ¤³¤Î¥Þ¥¯¥í¤òÍѤ¤¤ë¤È¤è¤¤¡£ÈÖ¹æÉÕ¤­¤Ç²Õ¾ò½ñ¤­¤ò¤¹¤ë¾ì¹ç¤Ï¡¢ +¿ô»ú¤Þ¤¿¤Ïʸ»ú¤Ë¥Ô¥ê¥ª¥É¤òÉÕ¤±¤¿¤â¤Î¤ò¥¿¥°¤Ë¤¹¤ì¤Ð¤è¤¤¡£ +¤³¤¦¤¹¤ì¤Ð¾¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ø¤ÎÊÑ´¹¤¬´Êñ¤Ë¤Ê¤ë¡£ +.TP +.BI \&.TP " i" +¤Ö¤é¤µ¤¬¤ê¥¿¥°¤ÎÃÊÍî¤ò³«»Ï¤¹¤ë¡£¥¿¥°¤Ï¼¡¤Î¹Ô¤Ë»ØÄꤹ¤ë¡£ +·ë²Ì¤Ï +.B \&.IP +¥³¥Þ¥ó¥É¤È»÷¤¿¤â¤Î¤Ë¤Ê¤ë¡£ +.SS ¥Ï¥¤¥Ñ¡¼¥Æ¥­¥¹¥È¥ê¥ó¥¯ÍѤΥޥ¯¥í +.RB ( groff +¤À¤±¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëµ¡Ç½) +¥Ï¥¤¥Ñ¡¼¥Æ¥­¥¹¥È¥ê¥ó¥¯ÍѤΥޥ¯¥í¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢ +.B www.tmac +¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸¤ò¥í¡¼¥É¤¹¤ëɬÍפ¬¤¢¤ë¡£ +¥í¡¼¥É¤ò¹Ô¤¦¤Ë¤Ï +.B .mso www.tmac +¥ê¥¯¥¨¥¹¥È¤ò»ÈÍѤ¹¤ë¡£ +.TP 9m +.BI \&.URL " link url trailer" +.\" motoki: ¸¶Ê¸¤Ç¤Ï .URL url link trailer ¤È¤Ê¤Ã¤Æ¤¤¤ë¤¬¡¢¸íµ­¡£ +URI (URL) +.I url +¤Ø¤Î¥Ï¥¤¥Ñ¡¼¥Æ¥­¥¹¥È¥ê¥ó¥¯¤òÁÞÆþ¤¹¤ë¡£ +.I link +¤Ï¥ê¥ó¥¯Ì¾¤Î¥Æ¥­¥¹¥È¤Ç¤¢¤ê¡¢ +.I trailer +¤ÎÆâÍƤϥê¥ó¥¯¤Îľ¸å¤Ëɽ¼¨¤µ¤ì¤ë¡£ +HTML ¤òÀ¸À®¤¹¤ë»þ¤Ë¡¢¤³¤Î¥Þ¥¯¥í¤Ï +\fB\fP\fIlink\fP\fB\fP\fItrailer\fP +¤È¤¤¤¦ HTML ¥³¥Þ¥ó¥É¤ËÊÑ´¹¤µ¤ì¤ë¡£ +.\" °Ê²¼¤Ï¥ê¥¹¥Èɽ¼¨¤ÎÃæ¤ÇÃÊÍî¤òºî¤ë¤¿¤á¤Î¤½¤Î¾ì¤·¤Î¤®¤ÎÊýË¡¤Ç¤¢¤ë¡£ +.TP +.B " " +¤³¤Î¥Þ¥¯¥í¤ä¾¤Î´ØÏ¢¥Þ¥¯¥í¤Ï¿·¤·¤¯¡¢ +¿¤¯¤Î¥Ä¡¼¥ë¤Ï¤³¤ì¤é¤ËÂФ·¤Æ¤Ï²¿¤â¤·¤Ê¤¤¤Ç¤¢¤í¤¦¡£ +(troff ¤ò´Þ¤á¤¿) ¿¤¯¤Î¥Ä¡¼¥ë¤Ï̤ÄêµÁ¤Î¥Þ¥¯¥í¤òñ¤Ë̵»ë¤¹¤ë¤À¤± +(¤¢¤ë¤¤¤ÏºÇ°­¤Ç¤â¥Þ¥¯¥í¤ò¥Æ¥­¥¹¥È¤È¤·¤ÆÁÞÆþ¤¹¤ë¤À¤±) +¤Ê¤Î¤Ç¡¢¤³¤ì¤é¤ò½ñ¤¤¤Æ¤â´í¸±¤Ï¤Ê¤¤¡£ +.\" °Ê²¼¤Ï¥ê¥¹¥Èɽ¼¨¤ÎÃæ¤ÇÃÊÍî¤òºî¤ë¤¿¤á¤Î¤½¤Î¾ì¤·¤Î¤®¤ÎÊýË¡¤Ç¤¢¤ë¡£ +.TP +.B " " +¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸Æâ¤Ç¼«Ê¬¤Ç +.B URL +¥Þ¥¯¥í¤òÄêµÁ¤·¤Æ¡¢ +.B groff +°Ê³°¤Î roff ¥Ó¥å¡¼¥¢¤Ç¤âɽ¼¨¤µ¤ì¤ë¤è¤¦¤Ë¤¹¤ë¤Î¤â¤¤¤¤¤À¤í¤¦¡£ +¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢URL ¤â¡¢¥ê¥ó¥¯ÍѤΥƥ­¥¹¥È¤â¡¢(¤â¤·¤¢¤ì¤Ð) ¤½¤ì¤Ë³¤¯ +¥Æ¥­¥¹¥È¤â¡¢É½¼¨¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.\" °Ê²¼¤Ï¥ê¥¹¥Èɽ¼¨¤ÎÃæ¤ÇÃÊÍî¤òºî¤ë¤¿¤á¤Î¤½¤Î¾ì¤·¤Î¤®¤ÎÊýË¡¤Ç¤¢¤ë¡£ +.TP +.B " " +°Ê²¼¤ËÎã¤òµó¤²¤ë: +.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 +.\" °Ê²¼¤Ï¥ê¥¹¥Èɽ¼¨¤ÎÃæ¤ÇÃÊÍî¤òºî¤ë¤¿¤á¤Î¤½¤Î¾ì¤·¤Î¤®¤ÎÊýË¡¤Ç¤¢¤ë¡£ +.TP +.B " " +¾åµ­¤ÎÎã¤Ë¤ª¤¤¤Æ¡¢ +.B groff +¤ò»È¤Ã¤Æɽ¼¨¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ +.B www.tmac +¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸¤Î URL ¥Þ¥¯¥í¤ÎÄêµÁ¤ÎÊý¤¬ +¥í¡¼¥«¥ë¤Ç¹Ô¤ï¤ì¤¿ÄêµÁ¤è¤ê¤âÍ¥À褵¤ì¤ë¡£ +.PP +.\" motoki: groff_mwww (7) ¤Î¸íµ­¤È»×¤ï¤ì¤ë¡£ +¾¤Ë¤â¤¤¤¯¤Ä¤«¤Î¥ê¥ó¥¯ÍѤΥޥ¯¥í¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£ +¾Ü¤·¤¯¤Ï +.BR groff_mwww (7) +¤ò»²¾È¤Î¤³¤È¡£ +.BR +.SH ¤½¤Î¾¤Î¥Þ¥¯¥í +.TP 9m +.B \&.DT +¥¿¥Ö¤ò¥Ç¥Õ¥©¥ë¥È¤Î¥¿¥ÖÃÍ (0.5 ¥¤¥ó¥Á¤´¤È) ¤Ë¥ê¥»¥Ã¥È¤¹¤ë¡£ +²þ¹Ô¤Ï¤·¤Ê¤¤¡£ +.TP +.BI \&.PD " d" +¥Ñ¥é¥°¥é¥Õ´Ö¤Î´Ö³Ö¤ò°ú¤­¿ô¤Ë¥»¥Ã¥È¤¹¤ë +(¾Êά¤µ¤ì¤ë¤È d=0.4v ¤È¤Ê¤ë)¡£ +.TP +.BI \&.SS " t" +¥µ¥Ö¥Ø¥Ã¥À +.I t +.RB ( \&.SH +¤Î¤è¤¦¤Ê¤â¤Î¤À¤¬¡¢¥µ¥Ö¥»¥¯¥·¥ç¥ó¤Î¤¿¤á¤ËÍѤ¤¤ë)¡£ +.SS ÄêµÁºÑ¤ß¤Îʸ»úÎó +.B man +¥Ñ¥Ã¥±¡¼¥¸¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤ÊÄêµÁºÑ¤ß¤Îʸ»úÎ󤬤¢¤ë: +.IP \e*R +ÅÐÏ¿¥·¥ó¥Ü¥ë: \*R +.IP \e*S +¥Ç¥Õ¥©¥ë¥È¥Õ¥©¥ó¥È¥µ¥¤¥º¤òÊѹ¹¤¹¤ë +.IP \e*(Tm +¾¦É¸¥·¥ó¥Ü¥ë: \*(Tm +.IP \e*(lq +º¸¤Ë·¹¤¤¤¿¥À¥Ö¥ë¥¯¥©¡¼¥È: \*(lq +.IP \e*(rq +±¦¤Ë·¹¤¤¤¿¥À¥Ö¥ë¥¯¥©¡¼¥È: \*(rq +.SS °ÂÁ´¤Ê¥µ¥Ö¥»¥Ã¥È +µ»½ÑŪ¤Ë¤Ï +.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 , +.B tr +.PP +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 , +.BR \ef(xx . +¥°¥é¥Õ¥£¥Ã¥¯¤ÎÉÁ²è¤Ë¤Ï¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤ÏÍѤ¤¤Ê¤¤¤Û¤¦¤¬Îɤ¤¡£ +.PP +.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 +¤³¤ÎÀ©¸Â¤ò±Û¤¨¤Æµ¡Ç½¤òÍѤ¤¤ë¾ì¹ç¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¥Ä¡¼¥ë¤ò»È¤Ã¤Æ¡¢ +¤½¤Î·ë²Ì¤òÃí°Õ¤·¤Æ¥Á¥§¥Ã¥¯¤¹¤ë¤³¤È¡£Äɲä·¤¿µ¡Ç½¤¬°ÂÁ´¤À¤È +³Î¿®¤·¤¿¤é¡¢¤³¤Îʸ½ñ¤Î´ÉÍý¼Ô¤Ë¤½¤Î°ÂÁ´¤Ê¥³¥Þ¥ó¥É¤Þ¤¿¤Ï¥·¡¼¥±¥ó¥¹¤ò +¶µ¤¨¤Æ¤Û¤·¤¤¡£¥ê¥¹¥È¤ËÄɲ乤롣 +.SH ¥Õ¥¡¥¤¥ë +.IR /usr/share/groff/ [*/] tmac/an.tmac +.br +.I /usr/man/whatis +.SH Ãí°Õ +.PP +¥Æ¥­¥¹¥È¤Ë¤Ï¤¼¤Ò¤È¤â´°Á´¤Ê URL (¤Þ¤¿¤Ï URI) ¤ò½ñ¤¯¤è¤¦¤Ë¤¹¤ë¤³¤È¡£ +.BR man2html (1) +¤Î¤è¤¦¤Ê¥Ä¡¼¥ë¤Ï¡¢¤³¤ì¤é¤ò¼«Æ°Åª¤Ë¥Ï¥¤¥Ñ¡¼¥Æ¥­¥¹¥È¥ê¥ó¥¯¤ËÊÑ´¹¤¹¤ë¡£ +¿·¤¿¤Ë¼è¤êÆþ¤ì¤é¤ì¤¿ +.B URL +¥Þ¥¯¥í¤ò´ØÏ¢¾ðÊó¤Ø¤Î¥ê¥ó¥¯¤ËÍѤ¤¤Æ¤âÎɤ¤¡£ URL ¤ò½ñ¤¯¾ì¹ç¤Ï¡¢ +Î㤨¤Ð ¤Î¤è¤¦¤Ë´°Á´¤Ê·Á¼°¤Ç½ñ¤­¡¢ +¥Ä¡¼¥ë¤Ë¤è¤ë URL ¼«Æ°¸¡ÃΤ¬¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¤³¤È¡£ +.PP +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤ò½èÍý¤¹¤ë¥Ä¡¼¥ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤Æ +ºÇ½é¤Î¶õÇò°Ê³°¤Îʸ»ú¤òÄ´¤Ù¤ë¡£¹Ô¤ÎÀèƬ¤Ë¥Ô¥ê¥ª¥É (.) +¤Þ¤¿¤Ï¥·¥ó¥°¥ë¥¯¥©¡¼¥È (') ¤¬¤¢¤ë¤È¡¢¤³¤ì¤Ï troff ¥Ù¡¼¥¹¤Î +¥Õ¥¡¥¤¥ë (man ¤ä mdoc) ¤Ç¤¢¤ë¤È¤ß¤Ê¤¹¡£º¸³Ñ³ç¸Ì (<) ¤Ï +SGML/XML ¥Ù¡¼¥¹¤Î¥Õ¥¡¥¤¥ë (HTML ¤ä Docbook) ¤Ç¤¢¤ë¤È¤ß¤Ê¤¹¡£ +¤½¤ì°Ê³°¤Ïñ½ã¤Ê ASCII ¥Æ¥­¥¹¥È ("catman" ¤Î·ë²Ì¤Ê¤É) ¤È¤ß¤Ê¤¹¡£ +.PP +¿¤¯¤Î 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) +.SH ¥Ð¥° +.PP +mdoc ¤ä DocBook ¤ËÈæ¤Ù¤ë¤È¡¢ +¥Þ¥¯¥í¤Î¿¤¯¤Ï½ñ¼° (¥Õ¥©¥ó¥È¥¿¥¤¥×¤ä¥¹¥Ú¡¼¥·¥ó¥°¤Ê¤É) ¤Ë´Ø¤¹¤ë¤â¤Î¤Ç¤¢¤ê¡¢ +°ÕÌ£¾å¤Î¤â¤Î (¤³¤Î¥Æ¥­¥¹¥È¤Ï¾¤Î¥Ú¡¼¥¸¤Ø¤Î»²¾È¤Ç¤¢¤ë¡¢¤Ê¤É) ¤Ç¤Ï¤Ê¤¤ +(HTML ¤Ç¤¹¤é°Ọ̃Ū¤Ê¥Þ¡¼¥­¥ó¥°¤Ë»×¤¨¤ë)¡£ +¤³¤Î¤¿¤á¡¢ +.B man +¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¾¤Î¥á¥Ç¥£¥¢¤ØÊÑ´¹¤·¤¿¤ê¡¢ +¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¾¤Î¥á¥Ç¥£¥¢¤ÇÍ­¸ú¤Ê¤â¤Î¤Ë¤·¤¿¤ê¡¢ +Áê¸ß»²¾È¤ò¼«Æ°Åª¤ËÁÞÆþ¤·¤¿¤ê¤¹¤ë¤³¤È¤¬º¤Æñ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¾å¤Ëµó¤²¤¿¤è¤¦¤Ê°ÂÁ´¤Ê¥µ¥Ö¥»¥Ã¥È¤ò¼é¤ì¤Ð¡¢ +¾­ÍèÊ̤Υê¥Õ¥¡¥ì¥ó¥¹¥Ú¡¼¥¸¥Õ¥©¡¼¥Þ¥Ã¥È¤ØÊÑ´¹¤¹¤ëºî¶È¤¬´Êñ¤Ë¤Ê¤ë¤À¤í¤¦¡£ +.LP +Sun ¤Î¥Þ¥¯¥í¤Ç¤¢¤ë +.B TX +¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" .SH Ãø¼Ô +.\" .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) ¤Ï¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òÂ礭¤¯Êѹ¹¤·¡¢ +.\" ¥»¥¯¥·¥ç¥ó¤ä¥Þ¥¯¥í¤Ë´Ø¤¹¤ëºÙ¤«¤Ê¾ðÊó¤òÄɲ乤ë¤Ê¤É¤ò¹Ô¤Ã¤¿¡£ +.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/release/man7/math_error.7 b/release/man7/math_error.7 new file mode 100644 index 00000000..13f57b78 --- /dev/null +++ b/release/man7/math_error.7 @@ -0,0 +1,258 @@ +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-17, Akihiro MOTOKI , LDP v3.07 +.\" +.\"WORD: significand ²¾¿ôÉô +.\"WORD: domain error Îΰ襨¥é¡¼ +.\"WORD: pole error ¶Ë¥¨¥é¡¼ +.\"WORD: range error ÈÏ°Ï¥¨¥é¡¼ +.\" +.TH MATH_ERROR 7 2008-08-11 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +math_error \- ¿ô³Ø´Ø¿ô¤«¤é¤Î¥¨¥é¡¼¤Î¸¡½Ð +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.fi +.SH ÀâÌÀ +¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢¤Û¤È¤ó¤É¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï (\-1 ¤ä NULL ¤Ê¤É¤Î) +ÆÃÊ̤ÊÃͤòÊÖ¤¹¤³¤È¤Ç¥¨¥é¡¼¤òÄÌÃΤ¹¤ë¡£ +.I +¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë¿ô³Ø´Ø¿ô¤Ï¡¢Ä̾ï¤ÏÉâÆ°¾®¿ôÅÀÃͤòÊÖ¤¹¤Î¤Ç¡¢ +¾¤Îµ¡¹½¤ò»È¤Ã¤Æ¥¨¥é¡¼¤òÄÌÃΤ¹¤ë¡£ +¥¨¥é¡¼ÄÌÃε¡¹½¤Ï 2 ¼ïÎढ¤ê¡¢ +¸Å¤¤¤â¤Î¤¬ +.I errno +¤òÀßÄꤹ¤ë¤ä¤êÊý¤Ç¤¢¤ê¡¢¿·¤·¤¤¤â¤Î¤¬ +.BR fenv (3) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ëÉâÆ°¾®¿ôÅÀÎã³°µ¡¹½¤Ç¤¢¤ë¡£ +.RB ( feclearexcept (3) +¤È +.BR fetestexcept (3) +¤ò»ÈÍѤ¹¤ë¡£¤³¤ì¤é¤Ë¤Ä¤¤¤Æ¤Ï°Ê²¼¤Ç³µÍפòÀâÌÀ¤·¤Æ¤¤¤ë¡£) + +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¡¢¿ô³Ø´Ø¿ô¤«¤é¤Î¥¨¥é¡¼¤ò³Îǧ¤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢ +¿ô³Ø´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë +.I errno +¤ò 0 ¤ËÀßÄꤷ¡¢°Ê²¼¤ò¸Æ¤Ó½Ð¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.in +4n +.nf + +feclearexcept(FE_ALL_EXCEPT); +.fi +.in + +¿ô³Ø´Ø¿ô¤«¤éÊ֤äƤ­¤¿ºÝ¤Ë¡¢ +.I errno +¤¬ 0 °Ê³°¤«¡¢°Ê²¼¤Î¸Æ¤Ó½Ð¤·¤¬ 0 °Ê³°¤òÊÖ¤·¤¿¾ì¹ç +.RB ( fenv (3) +»²¾È)¡¢¿ô³Ø´Ø¿ô¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤¤¤ë¡£ +.in +4n +.nf + +fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | + FE_UNDERFLOW); +.fi +.in +.\" enum +.\" { +.\" FE_INVALID = 0x01, +.\" __FE_DENORM = 0x02, +.\" FE_DIVBYZERO = 0x04, +.\" FE_OVERFLOW = 0x08, +.\" FE_UNDERFLOW = 0x10, +.\" FE_INEXACT = 0x20 +.\" }; + +¿ô³Ø´Ø¿ô¤ÇȯÀ¸¤¹¤ë¥¨¥é¡¼¾ò·ï¤Ë¤Ä¤¤¤Æ¤Ï°Ê²¼¤ÇÀâÌÀ¤¹¤ë¡£ +.SS Îΰ襨¥é¡¼ (domain error) +.I Îΰ襨¥é¡¼ +¤¬È¯À¸¤¹¤ë¤Î¤Ï¡¢¿ô³Ø´Ø¿ô¤ËÅϤµ¤ì¤¿°ú¤­¿ô¤ÎÃͤ¬¤½¤Î´Ø¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë +Îΰè¤ËÆþ¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤¢¤ë (Î㤨¤Ð +.BR log (3) +¤ËÉé¤Î°ú¤­¿ô¤òÅϤ·¤¿¾ì¹ç)¡£ +Îΰ襨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢ +¿ô³Ø´Ø¿ô¤ÏÉáÄÌ¤Ï NaN ¤òÊÖ¤· +(Ʊ¤¸¾õ¶·¤Ç°ã¤¦ÃͤòÊÖ¤¹´Ø¿ô¤â¤¢¤ë)¡¢ +.I errno +¤Ë +.B EDOM +¤òÀßÄꤷ¡¢¡Ö̵¸ú (invalid)¡× +ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_INVALID ) +¤ò¾å¤²¤ë¡£ +.SS ¶Ë¥¨¥é¡¼ (pole error) +.I ¶Ë¥¨¥é¡¼ +¤¬È¯À¸¤¹¤ë¤Î¤Ï¡¢´Ø¿ô¤Î¿ô³ØŪ¤Ê·ë²Ì¤¬Ìµ¸ÂÂ礽¤Î¤â¤Î¤È¤Ê¤ë¾ì¹ç¤Ç¤¢¤ë +(Î㤨¤Ð +0 ¤ÎÂпô¤ÏÉé¤Î̵¸ÂÂç¤Ç¤¢¤ë)¡£ +¶Ë¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢¤½¤Î´Ø¿ô¤ÎÊÖ¤êÃÍ¤Ï (Éä¹æÉÕ¤­¤Î) +.BR HUGE_VAL , +.BR HUGE_VALF , +.B HUGE_VALL +¤Î¤¤¤º¤ì¤«¤È¤Ê¤ë (Á°µ­¤ÎÃͤΤ¦¤Á¤É¤ì¤¬Ê֤뤫¤Ï´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ë¤è¤ê·è¤Þ¤ê¡¢ +¤½¤ì¤¾¤ì +.IR double , +.IR float , +.I "long double" +¤ËÂбþ¤¹¤ë)¡£ +·ë²Ì¤ÎÉä¹æ¤Ï¡¢¤½¤Î´Ø¿ô¤Î¿ô³ØŪ¤ÊÄêµÁ¤«¤é·èÄꤵ¤ì¤ë¡£ +.I errno +¤Ï +.B ERANGE +¤ËÀßÄꤵ¤ì¡¢¡Ö0 ¤Ë¤è¤ë½ü»» (divide-by-zero)¡× +ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_DIVBYZERO ) +¤¬¾å¤¬¤ë¡£ +.SS ÈÏ°Ï¥¨¥é¡¼ (range ¥¨¥é¡¼) +.I ÈÏ°Ï¥¨¥é¡¼ +¤¬È¯À¸¤¹¤ë¤Î¤Ï¡¢´Ø¿ô¤Î·ë²Ì¤ÎÃͤ¬¤½¤Î´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ç¤Ïɽ¸½¤Ç¤­¤Ê¤¤¾ì¹ç +¤Ç¤¢¤ë¡£´Ø¿ô¤ÎÊÖ¤êÃͤϡ¢ÈÏ°Ï¥¨¥é¡¼¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ç¤¢¤Ã¤¿¤«¥¢¥ó¥À¡¼¥Õ¥í¡¼ +¤Ç¤¢¤Ã¤¿¤«¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ + +ÉâÆ°¾®¿ôÅÀ¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ï¡¢·ë²Ì¤¬Í­¸Â¤À¤¬¡¢Â礭²á¤®¤Æ +·ë²Ì¤òÊÖ¤¹·¿¤Ç¤Ïɽ¸½¤Ç¤­¤Ê¤¤¾ì¹ç¤ËȯÀ¸¤¹¤ë¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬È¯À¸¤¹¤ë¤È¡¢ +¤½¤Î´Ø¿ô¤Ï +.BR HUGE_VAL , +.BR HUGE_VALF , +.B HUGE_VALL +¤Î¤¤¤º¤ì¤«¤òÊÖ¤¹ (Á°µ­¤ÎÃͤΤ¦¤Á¤É¤ì¤¬Ê֤뤫¤Ï´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ë¤è¤ê·è¤Þ¤ê¡¢ +¤½¤ì¤¾¤ì +.IR double , +.IR float , +.I "long double" +¤ËÂбþ¤¹¤ë)¡£ +.I errno +¤Ï +.B ERANGE +¤ËÀßÄꤵ¤ì¡¢¡Ö¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ (overflow)¡× +ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_OVERFLOW ) +¤¬¾å¤¬¤ë¡£ + +ÉâÆ°¾®¿ôÅÀ¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Ï¡¢ +·ë²Ì¤¬¾®¤µ²á¤®¤Æ¡¢·ë²Ì¤òÊÖ¤¹·¿¤Ç¤Ïɽ¸½¤Ç¤­¤Ê¤¤¾ì¹ç¤ËȯÀ¸¤¹¤ë¡£ +¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¬È¯À¸¤¹¤ë¤È¡¢¿ô³Ø´Ø¿ô¤ÏÄ̾ï¤Ï 0.0 ¤òÊÖ¤¹ +(C99 ¤Ç¤Ï¡¢»ØÄꤵ¤ì¤¿·¿¤Ë¤ª¤¤¤ÆºÇ¾®¤ÎÀµµ¬²½¤µ¤ì¤¿Àµ¤ÎÃͤè¤êÂ礭¤¯¤Ê¤¤ +Ãͤò»ý¤Ä¼ÂÁõÄêµÁ (implementation-defined) ¤ÎÃͤòÊÖ¤¹¡¢¤È¤Ê¤Ã¤Æ¤¤¤ë)¡£ +.I errno +¤Ï +.B ERANGE +¤ËÀßÄꤵ¤ì¡¢¡Ö¥¢¥ó¥À¡¼¥Õ¥í¡¼¡×ÉâÆ°¾®¿ôÅÀÎã³° +.RB ( FE_UNDERFLOW ) +¤¬¾å¤¬¤ë¡£ + +¤¤¤¯¤Ä¤«¤Î´Ø¿ô¤Ç¤Ï¡¢ÅϤµ¤ì¤¿°ú¤­¿ô¤ÎÃͤ䡢Àµ¤·¤¤´Ø¿ô¤Î·ë²Ì¤¬ +.I subnormal (ÈóÀµµ¬²½¿ô) +¤Ë¤Ê¤ë¾ì¹ç¤ËÈÏ°Ï¥¨¥é¡¼¤ò¾å¤²¤ë¡£ +subnormal ¤ÊÃͤȤϡ¢0 ¤Ç¤Ï¤Ê¤¤¤¬¡¢¤½¤ÎÃͤ¬¾®¤µ¤¹¤®¤Æ +(²¾¿ôÉô¤ÎºÇ¾å°Ì¥Ó¥Ã¥È¤¬ 1 ¤È¤Ê¤ë) ɸ½à·Á¤Ç¤Ïɽ¸½¤Ç¤­¤Ê¤¤¤è¤¦¤ÊÃͤǤ¢¤ë¡£ +subnormal ¤ÊÃͤÎɽ¸½¤Ç¤Ï¡¢²¾¿ôÉô¤Î¾å°Ì¦¤Î¥Ó¥Ã¥È¤Ë 1 ¸Ä°Ê¾å¤Î 0 ¤¬ +´Þ¤Þ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.SH Ãí°Õ +C99 ¤È POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë +.I math_errhandling +¼±ÊÌ»Ò¤Ï glibc ¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" See CONFORMANCE in the glibc 2.8 (and earlier) source. +¤³¤Î¼±Ê̻Ҥϡ¢2 ¤Ä¤Î¥¨¥é¡¼ÄÌÃε¡¹½ +.RI ( errno +¤È +.BR fetestexcept (3) +·Ðͳ¤Ç¼èÆÀ¤Ç¤­¤ëÎã³°) ¤Î¤¦¤Á¤É¤Á¤é¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¤«¤òÄÌÃÎ +¤¹¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +ɸ½à¤Ç¤Ï¡¢¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Ï»ÈÍѤµ¤ì¤ë¤³¤È¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë¤¬¡¢ +ξÊý¤È¤âÍøÍѲÄǽ¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¤È¤µ¤ì¤Æ¤¤¤ë¡£ +glibc ¤Ç¤Î¸½ºß¤Î (¥Ð¡¼¥¸¥ç¥ó 2.8 ¤Ç¤Î) ¾õ¶·¤Ï¤«¤Ê¤êº®Í𤷤Ƥ¤¤ë¡£ +¤Û¤È¤ó¤É¤Î´Ø¿ô (¤¿¤À¤·Á´Éô¤Ç¤Ï¤Ê¤¤) ¤Ï¥¨¥é¡¼»þ¤ËÎã³°¤ò¾å¤²¤ë¡£ +¤¤¤¯¤Ä¤«¤Î´Ø¿ô¤Ï +.I errno +¤âÀßÄꤹ¤ë¡£ +.I errno +¤òÀßÄꤹ¤ë¤¬¡¢Îã³°¤ò¾å¤²¤Ê¤¤´Ø¿ô¤â¾¯¤·¤À¤±Â¸ºß¤¹¤ë¡£ +¤É¤Á¤é¤â¹Ô¤ï¤Ê¤¤´Ø¿ô¤â¤´¤¯¾¯¿ô¤À¤¬Â¸ºß¤¹¤ë¡£ +¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¸Ä¡¹¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤Î¤³¤È¡£ + +.I errno +¤È +.BR fetestexcept (3) +¤ÎξÊý¤ò»È¤Ã¤Æ¥¨¥é¡¼¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¤³¤È¤ÇÊ£»¨¤Ë¤Ê¤ë¤Î¤òÈò¤±¤ë¤¿¤á¡¢ +¿¤¯¤Î¾ì¹ç¡¢´Ø¿ô¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦Á°¤ËÉÔÀµ¤Ê°ú¤­¿ô¤«¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦ +ÊýË¡¤¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£ +.\" http://www.securecoding.cert.org/confluence/display/seccode/FLP32-C.+Prevent+or+detect+domain+and+range+errors+in+math+functions +Î㤨¤Ð¡¢°Ê²¼¤Î¥³¡¼¥É¤Ï¡¢ +.BR log (3) +¤Î°ú¤­¿ô¤¬ NaN ¤Ç¤â (¶Ë¥¨¥é¡¼¤È¤Ê¤ë) 0 ¤Ç¤â (Îΰ襨¥é¡¼¤È¤Ê¤ë) 0 ̤Ëþ +¤Ç¤â¤Ê¤¤¤³¤È¤òÊݾڤ¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.in +4n +.nf + +double x, r; + +if (isnan(x) || islessequal(x, 0)) { + /* Deal with NaN / pole error / domain error */ +} + +r = log(x); + +.fi +.in +¤³¤Î¥Ú¡¼¥¸¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¤³¤È¤Ï¡¢ +.RI ( +¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë) Ê£ÁÇ¿ô´Ø¿ô¤Ë¤Ï¤¢¤Æ¤Ï¤Þ¤é¤Ê¤¤¡£ +°ìÈ̤ˡ¢C99 ¤ä POSIX.1-2001 ¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤¬¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤ò +Í׵ᤷ¤Æ¤Ê¤¤¡£ + +.BR gcc (1) +¤Î +.I "-fno-math-errno" +¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¡¢¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ç¡¢É¸½à¤Î¼ÂÁõ¤è¤ê¤â¹â®¤Ê¿ô³Ø´Ø¿ô¤Î +¼ÂÁõ¤¬»ÈÍѤµ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¤¬¡¢ +¥¨¥é¡¼»þ¤Ë +.I errno +¤¬ÀßÄꤵ¤ì¤Ê¤¤ +.RB ( gcc (1) +¤Î +.I "-ffast-math" +¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤â +.I "-fno-math-errno" +¤ÏÍ­¸ú¤Ë¤Ê¤ë)¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¤Ç¤â¡¢ +.BR fetestexcept (3) +¤ò»È¤Ã¤¿¥¨¥é¡¼¤Î¸¡ºº¤Ï²Äǽ¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR gcc (1), +.BR errno (3), +.BR fenv (3), +.BR fpclassify (3), +.BR INFINITY (3), +.BR isgreater (3), +.BR matherr (3), +.BR nan (3) +.br +.I "info libc" diff --git a/release/man7/mdoc.7 b/release/man7/mdoc.7 new file mode 100644 index 00000000..880b88e0 --- /dev/null +++ b/release/man7/mdoc.7 @@ -0,0 +1,429 @@ +.\" Copyright (c) 1991, 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. +.\" +.\" @(#)mdoc.7 8.2 (Berkeley) 12/30/93 +.\" $Id: mdoc.7,v 1.6 2000/09/07 07:21:50 hanataka 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 ¸Æ¤Ó½Ð¤·²Äǽ¥Þ¥¯¥í +.\" +.Dd July 11, 1999 +.Dt MDOC 7 +.Os Linux +.Sh ̾Á° +.Nm mdoc +.Nd +.Nm \-mdoc +¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸¤Î¥¯¥¤¥Ã¥¯¥ê¥Õ¥¡¥ì¥ó¥¹¥¬¥¤¥É +.Sh ½ñ¼° +.Nm groff +.Fl m Ns Ar doc +.Ar files ... +.Sh ÀâÌÀ +.Nm \-mdoc +¥Ñ¥Ã¥±¡¼¥¸¤Ï +.Bx +man ¥Ú¡¼¥¸¤ËÍѤ¤¤é¤ì¤ëÆâÍÆ¥Ù¡¼¥¹¡¦¥É¥á¥¤¥ó¥Ù¡¼¥¹¤Î¥Þ¥¯¥í¤Ç¤¢¤ë¡£ +°Ê²¼¤Ç¤Ï¥¯¥¤¥Ã¥¯¥ê¥Õ¥¡¥ì¥ó¥¹¤È¤·¤Æ¥Þ¥¯¥í¤Î̾Á°¤È¤½¤Î°ÕÌ£¤ò¥ê¥¹¥È¤¹¤ë¡£ +¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤ÎÍøÍÑË¡¤Ë´Ø¤¹¤ë¾ÜºÙ¤ÊÀâÌÀ¤Ï¡¢ +¥Á¥å¡¼¥È¥ê¥¢¥ëÍѤθ«ËܤǤ¢¤ë +.Xr mdoc.samples 7 +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.Pp +¤³¤ì¤Ï Linux ¤Îʸ½ñ¤ÇÄ̾ïÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸¤È¤Ï°Û¤Ê¤ë¡£ +¤·¤«¤·¹­¤¯ÍѤ¤¤é¤ì¤Æ¤¤¤ë¤¤¤¯¤Ä¤«¤Î¥×¥í¥°¥é¥à¤Îʸ½ñ¤Ç¡¢ +¤³¤Î¥Þ¥¯¥í¤¬ÍøÍѤµ¤ì¤Æ¤¤¤ë¡£ +.Xr man 7 +¤ò¸«¤è¡£ +.Pp +¥Þ¥¯¥í¤Ï 2 ¤Ä¤Î¥°¥ë¡¼¥×¤Ëʬ¤±¤ÆÀâÌÀ¤¹¤ë¡£ +ºÇ½é¤Î¥°¥ë¡¼¥×¤Ï¹½Â¤¤äʪÍýŪ¤Ê¥Ú¡¼¥¸¥ì¥¤¥¢¥¦¥È¤Ë´Ø¤¹¤ë¥Þ¥¯¥í¤Ç¤¢¤ë¡£ +2 ¤Ä¤á¤Ï¥Þ¥Ë¥å¥¢¥ë¥É¥á¥¤¥ó¥Þ¥¯¥í (manual domain macro) +¤ä°ìÈ̥ƥ­¥¹¥È¥É¥á¥¤¥ó¥Þ¥¯¥í (general text domain macro) +¤Ç¡¢ +.Nm \-mdoc +¥Ñ¥Ã¥±¡¼¥¸¤ò¾¤Î +.Xr troff +¥Õ¥©¡¼¥Þ¥Ã¥È¥Ñ¥Ã¥±¡¼¥¸¤Èº¹Ê̲½¤·¤Æ¤¤¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.Sh ¥Ú¡¼¥¸¹½Â¤¤Î¥É¥á¥¤¥ó +.Ss ¥¿¥¤¥È¥ë¥Þ¥¯¥í +Àµ¤·¤¤¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òÀ¸À®¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¤³¤ì¤é¤Î 3 ¤Ä¤Î¥Þ¥¯¥í¤ò +¤³¤Î½çÈ֤ǽñ¤¯É¬Íפ¬¤¢¤ë¡£ +.Bl -tag -width "xxxx.Os OPERATINGxSYSTEM [version/release]" -compact +.It Li "\&.Dd " Ar "Month day, year" +ʸ½ñ¤ÎÆüÉÕ¡£ +.It Li "\&.Dt " Ar "DOCUMENT_TITLE [section] [volume]" +¥¿¥¤¥È¥ë¤òÂçʸ»ú¤Ç¡£ +.It Li "\&.Os " Ar "OPERATING_SYSTEM [version/release]" +¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à +.Pq Tn BSD . +.El +.Ss ¥Ú¡¼¥¸¥ì¥¤¥¢¥¦¥È¥Þ¥¯¥í +¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥À¡¢ÃÊÍî¤Î½ª¤ï¤ê¡¢¥ê¥¹¥È¡¢É½¼¨¤Ê¤É¡£ +.Bl -tag -width flag -compact +.It Li \&.Sh +¥»¥¯¥·¥ç¥ó¤Î¥Ø¥Ã¥À¡£ +Àµ¤·¤¤¥Ø¥Ã¥À¤Ï¡¢¸½¤ì¤ë½ç¤Ë: +.Bl -tag -width "RETURN VALUE" -compact +.It Ar NAME +̾Á°¤Î¥»¥¯¥·¥ç¥ó¡£ +.Ql \&.Nm +, +.Ql \&.Fn +, +.Ql \&.Nd +¤Ê¤É¤Î¥Þ¥¯¥í¤ò´Þ¤à¡£ +.It Ar SYNOPSIS +ÍøÍÑË¡¡£ +.It Ar DESCRIPTION +°ìÈÌŪ¤ÊÀâÌÀ¡£¥ª¥×¥·¥ç¥ó¤ä¥Ñ¥é¥á¡¼¥¿¤ÎÀâÌÀ¤â´Þ¤à¡£ +.It Ar RETURN VALUE +¥»¥¯¥·¥ç¥ó 2 ¤ä 3 ¤Î´Ø¿ô¥³¡¼¥ë¡£ +.It Ar ENVIRONMENT +´Ä¶­ÊÑ¿ô¤òÀâÌÀ¤¹¤ë¡£ +.It Ar FILES +ÆâÍƤ˴ط¸¤¹¤ë¥Õ¥¡¥¤¥ë¡£ +.It Ar EXAMPLES +Îã¤ä¤ª¤¹¤¹¤á¡£ +.It Ar DIAGNOSTICS +Ä̾糧¥¯¥·¥ç¥ó 4 ¤Î¥Ç¥Ð¥¤¥¹¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¿ÇÃÇÍÑ¡£ +.It Ar ERRORS +¥»¥¯¥·¥ç¥ó 2 ¤ä 3 ¤Î¥¨¥é¡¼¤ä¥·¥°¥Ê¥ë½èÍý¡£ +.It Ar SEE ALSO +Áê¸ß»²¾È¤ä°úÍÑ¡£ +.It Ar CONFORMING TO +²Äǽ¤Ê¤éɸ½à¤Ø¤Î½àµò¡£ +.It Ar HISTORY +ɸ½à¤¬Å¬ÍѤµ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢ +Îò»ËŪ¤ÊÆâÍƤòÍ¿¤¨¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.It Ar BUGS +àìáÓ¤ä·Ù¹ð¡£ +.It Ar other +É®¼Ô¤ÎȽÃǤǥإåÀ¤ò¤¢¤Ä¤é¤¨¤Æ¤â¤è¤¤¡£ +.El +.It Li \&.Ss +¥µ¥Ö¥»¥¯¥·¥ç¥ó¤Î¥Ø¥Ã¥À¡£ +.It Li \&.Pp +ÃÊÍî¤Î¶èÀڤꡣ +¿âľ¥¹¥Ú¡¼¥¹ (°ì¹Ô)¡£ +.It Li \&.D1 +(D-one) Display-one +¥¤¥ó¥Ç¥ó¥È¤·¤Æ¥Æ¥­¥¹¥È¤ò°ì¹Ôɽ¼¨¡£ +.It Li \&.Dl +(D-ell) Displey-one literal¡£ +¥¤¥ó¥Ç¥ó¥È¤·¤Æ¥ê¥Æ¥é¥ë¤Ê¥Æ¥­¥¹¥È¤ò°ì¹Ôɽ¼¨¡£ +.It Li \&.Bd +ɽ¼¨¥Ö¥í¥Ã¥¯¤Î³«»Ï¡£ +ɽ¼¨¥ª¥×¥·¥ç¥ó: +.Bl -tag -width "xoffset string " -compact +.It Fl ragged +·¤¨¤Ê¤¤ (ξü¤ÏÉÔ·¤¤)¡£ +.It Fl filled +·¤¨¤ë¡£ +.It Fl literal +¥ê¥Æ¥é¥ë¤Ê¥Æ¥­¥¹¥È¤Þ¤¿¤Ï¥³¡¼¥É¡£ +.It Fl file Ar name +»ØÄꤵ¤ì¤¿ +.Ar file +¤òÆɤó¤Çɽ¼¨¤¹¤ë¡£ +.It Fl offset Ar string +¥ª¥Õ¥»¥Ã¥Èɽ¼¨¡£ +¼õÉÕ¤±¤ë +.Ar string +¤ÎÃͤÏ: +.Bl -tag -width indent-two -compact +.It Ar left +¥Ö¥í¥Ã¥¯¤òº¸¤Ë·¤¨¤ë (¥Ç¥Õ¥©¥ë¥È)¡£ +.It Ar center +Âç¤Þ¤«¤Ê¥»¥ó¥¿¡¼¥Þ¡¼¥¸¥ó¡£ +.It Ar indent +Äê¿ôÉý¤Î¶õÇò 6 ¤Ä (¥¿¥Ö 1 ¤Ä)¡£ +.It Ar indent-two +¥¿¥Ö 2 ¤Ä¡£ +.It Ar right +·¤¨¥Ö¥í¥Ã¥¯¤ò±¦¤«¤é 2 ¥¤¥ó¥Á¤Î°ÌÃ֤˻Ĥ¹¡£ +.\"NAKANO ??? +.It Ar xx Ns Cm n +.Ar xx +¤Ï +.No \&4 Ns Cm n +¤«¤é +.No \&9\&9 Ns Cm n +¤Þ¤Ç¤Î¿ô»ú¡£ +.It Ar Aa +.Ar Aa +¤Ï¸Æ¤Ó¤À¤·²Äǽ¤Ê¥Þ¥¯¥í¤Î̾Á°¡£ +.It Ar string +.Ar string +¤ÎÉý¤¬ÍѤ¤¤é¤ì¤ë¡£ +.El +.El +.It Li \&.Ed +ɽ¼¨½ªÎ» (\&.Bd ¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡£ +.It Li \&.Bl +¥ê¥¹¥È³«»Ï¡£ +¥ê¥¹¥È¤Þ¤¿¤Ï¥³¥é¥à¤òÀ¸À®¤¹¤ë¡£¥ª¥×¥·¥ç¥ó¤Ï°Ê²¼: +.Bl -tag -width flag -compact +.It Ar ¥ê¥¹¥È·Á¼° +.Bl -column xbullet -compact +.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 "¥é¥Ù¥ëÉÕ¤­¥ê¥¹¥È¤ÎÁÞÆþ¡¦·Ñ³" +.El +.It ¥ê¥¹¥È¥Ñ¥é¥á¡¼¥¿ +.Bl -tag -width "xcompact " -compact +.It Fl offset +(Á´¤Æ¤Î¥ê¥¹¥È) ¾åµ­¤Î +.Ql \&.Bd +¥Ç¥£¥¹¥×¥ì¥¤³«»Ï (begin-display) ¤ò¸«¤è¡£ +.It Fl width +.Pf ( Fl tag +¤ª¤è¤Ó +.Fl hang +¥ê¥¹¥È¤Î¤ß) +.Ql \&.Bd . +¤ò¸«¤è¡£ +.It Fl compact +(Á´¤Æ¤Î¥ê¥¹¥È) +¶õ¹Ô¤òÍÞÀ©¤¹¤ë¡£ +.El +.El +.It Li \&.El +¥ê¥¹¥È¤Î½ª¤ï¤ê¡£ +.It Li \&.It +¥ê¥¹¥È¹àÌÜ¡£ +.El +.Sh ¥Þ¥Ë¥å¥¢¥ë¥É¥á¥¤¥ó¥Þ¥¯¥í¤È°ìÈ̥ƥ­¥¹¥È¥É¥á¥¤¥ó¥Þ¥¯¥í +¥Þ¥Ë¥å¥¢¥ë¥É¥á¥¤¥ó¥Þ¥¯¥í¤È°ìÈ̥ƥ­¥¹¥È¥É¥á¥¤¥ó¥Þ¥¯¥í¤È¤¬ +¾¤È°Û¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ï¡¢ +¸Æ¤Ó¤À¤·²Äǽ¥Þ¥¯¥í (callable macro) ¤ÎÆâÉô¤Ç¤Ï¡¢ +¤½¤Î¤Û¤È¤ó¤É¤¬¥Ñ¡¼¥º¤µ¤ì¤ë¤È¤¤¤¦ÅÀ¤Ç¤¢¤ë¡£ +Î㤨¤Ð°Ê²¼¤Î¤è¤¦¤ËÊÑ´¹¤µ¤ì¤ë: +.Bl -tag -width ".Op Fl s Ar filex" -offset indent +.It Li "\&.Op Fl s Ar file" +¢ª +.Op Fl s Ar file +.El +.Pp +¤³¤ÎÎã¤Ç¤Ï¡¢°Ï¤ß¥Þ¥¯¥í +.Ql \&.Op +¤ËÍ¿¤¨¤é¤ì¤¿¥ª¥×¥·¥ç¥ó¤¬¥Ñ¡¼¥º¤µ¤ì¡¢ +Ãæ¿È¤Î¸Æ¤Ó¤À¤·²Äǽ¤Ê¥Þ¥¯¥í¤Ç¤¢¤ë +.Ql \&Fl +¤¬¸Æ¤Ð¤ì¡¢°ú¿ô¤Ç¤¢¤ë +.Ql s +¤ËÂФ·¤ÆºîÍѤ¹¤ë¡£¤½¤·¤Æ¼¡¤ËÃæ¿È¤Î¸Æ¤Ó¤À¤·²Äǽ¤Ê¥Þ¥¯¥í +.Ql \&Ar +¤¬¸Æ¤Ð¤ì¡¢°ú¿ô¤Ç¤¢¤ë +.Ql file +¤ËºîÍѤ¹¤ë¡£¸Æ¤Ó¤À¤·²Äǽ¤Ç¤¢¤ë¤¬¥Ñ¡¼¥¹¤µ¤ì¤Ê¤¤¥Þ¥¯¥í¤ä¡¢ +¤½¤ÎµÕ¤Î¥Þ¥¯¥í¤â¸ºß¤¹¤ë¡£¤³¤Î¤è¤¦¤Ê¥Þ¥¯¥í¤Ï°Ê²¼¤Î +.Em parsed +¥«¥é¥à¤ä +.Em callable +¥«¥é¥à¤Ç¼¨¤¹¡£ +.Pp +Æä˵­½Ò¤¬¤Ê¤±¤ì¤Ð¡¢¥Þ¥Ë¥å¥¢¥ë¥É¥á¥¤¥ó¥Þ¥¯¥í¤Ï¶¦Ä̤νñ¼°¤ò¤È¤ë: +.Pp +.Dl \&.Va argument [\ .\ ,\ ;\ :\ (\ )\ [\ ]\ argument \...\ ] +.Pp +.Sy Ãí°Õ : +¶çÆÉʸ»ú (punctuation character) ¤Î³«¤­¡¦ÊĤ¸¤Ï¡¢ +¤½¤ì¤é¤¬°ìÅÙ¤Ëñ°ì¤Îʸ»ú¤Ç¸½¤ì¤¿¾ì¹ç¤Î¤ß¤½¤Î¤è¤¦¤Ë²ò¼á¤µ¤ì¤ë¡£ +ʸ»úÎó +.Ql ")," +¤Ï¡¢¶çÆɶèÀÚ¤ê¤È¤Ï¤ß¤Ê¤µ¤ì¤º¡¢¤½¤ÎÁ°¤Ë¶õÇòʸ»ú¤¬¤¢¤ì¤Ð +¤½¤Îʸ»ú¤È¤È¤â¤Ë¡¢¤Þ¤¿¸Æ¤Ó½Ð¤·¤¿¥Þ¥¯¥í¤¬ÍѤ¤¤ë¥Õ¥©¥ó¥È¤Ç½ÐÎϤµ¤ì¤ë¡£ +°ú¿ô¥ê¥¹¥È +.Ql "] ) ," +¤Ï 3 ¤Ä¤ÎϢ³¤·¤¿ÊĤ¸¶çÆÉʸ»ú¤È²ò¼á¤µ¤ì¡¢ +¤½¤ì¤¾¤ì¤ÎÁ°¤Ë¤¢¤ë¶õÇòʸ»ú¤Ï¡¢³Æʸ»ú¤ä (¤â¤·¤¢¤ì¤Ð) ¤½¤ÎÁ°¤Ë¤¢¤ë +°ú¿ô¤È¤Î´Ö¤Ë¤Ï½ÐÎϤµ¤ì¤Ê¤¤¡£ +Æüì¤Ê°ÕÌ£¤ò»ý¤Ä¶çÆÉʸ»ú¤Ï¡¢Ê¸»úÎó +.Ql \e& +¤Ë¤è¤Ã¤Æ¥¨¥¹¥±¡¼¥×¤Ç¤­¤ë¡£ +Î㤨¤Ð°Ê²¼¤Îº¸¤Îʸ»úÎó¤Ï±¦¤Î¤è¤¦¤ËÊÑ´¹¤µ¤ì¤ë¡£ +.Bl -tag -width "&.Ar file1\ , file2\ , file3\ )\ ." -offset indent +.It Li "\&.Ar file1\ , file2\ , file3\ )\ ." +¢ª +.Ar file1 , file2 , file3 ) . +.El +.ne 1i +.Ss ¥Þ¥Ë¥å¥¢¥ë¥É¥á¥¤¥ó¥Þ¥¯¥í +.Bl -column "Name" "Parsed" Callable" -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 \&Cd Ta \&No Ta \&No Ta "ÀßÄê¤ÎÀë¸À (¥»¥¯¥·¥ç¥ó 4 ¤Î¤ß)" +.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 "´Ø¿ô¤ÎÀë¸À" +.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 \&Op Ta Yes Ta Yes Ta "¥ª¥×¥·¥ç¥ó (.Oo ¤È .Oc ¤â)" +.It Li \&Ot Ta Yes Ta Yes Ta "¸Å¤¤·Á¼°¤Î´Ø¿ô·¿ (Fortran ¤Î¤ß)." +.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 \&Vt Ta Yes Ta Yes Ta "ÊÑ¿ô¤Î·¿ (Fortran ¤Î¤ß)" +.It Li \&Xr Ta Yes Ta Yes Ta "¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÁê¸ß»²¾È" +.El +.Ss °ìÈ̥ƥ­¥¹¥È¥É¥á¥¤¥ó¥Þ¥¯¥í +.Bl -column "Name" "Parsed" Callable" -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 "»²¹Íʸ¸¥¤Î»¨»ï̾" +.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 "¥Ö¥é¥±¥Ã¥È¥¯¥©¡¼¥È" +.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 "¥À¥Ö¥ë¥¯¥©¡¼¥È" +.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 \&Fx Ta \&No Ta \&No Ta Tn "FreeBSD operating system" +.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 "³ç¸Ì¥¯¥©¡¼¥È¤Î³«¤­" +.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 "¥·¥ó¥°¥ë¥¯¥©¡¼¥È¤Î³«¤­" +.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)." +.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 "³ÈÄ¥°ú¿ô¥ê¥¹¥È¤Î³«¤­" +.El +.\" .It Sy \&Hf Ta \&No Ta \&No Ta "Include file with header" +.Pp +.Ql q +¤Ç½ª¤ï¤ë̾Á°¤Î¥Þ¥¯¥í¤Ï¡¢°ú¿ô¥ê¥¹¥È¤Î»Ä¤ê¤Î¹àÌܤò¥¯¥©¡¼¥È¤¹¤ë¡£ +.Ql o +¤Ç½ª¤ï¤ë̾Á°¤Î¥Þ¥¯¥í¤Ï°ì¹Ô°Ê¾å¤Ë¤ï¤¿¤ëÆþÎϤΥ¯¥©¡¼¥È¤ò³«»Ï¤·¡¢ +¤³¤ì¤ÏÂбþ¤¹¤ë̾Á°¤Î +.Ql c +¤Ç¤ª¤ï¤ë̾Á°¤Î¥Þ¥¯¥í¤Ç½ªÎ»¤¹¤ë¡£ +°Ï¤ß¥Þ¥¯¥í¤Ï¥Í¥¹¥È¤Ç¤­¡¢°ú¿ô¤Ï 8 ¤Ä¤Þ¤Ç¼è¤ì¤ë¡£ +.Pp +Ãí°Õ: ³ÈÄ¥°ú¿ô¥ê¥¹¥È¥Þ¥¯¥í +.Pf ( Ql \&.Xo , +.Ql \&.Xc ) +¤ª¤è¤Ó´Ø¿ô¤Î°Ï¤ß¥Þ¥¯¥í +.Pf ( Ql \&.Fo , +.Ql \&.Fc ) +¤ÏÊѧ¤Ç¤¢¤ë¡£ +³ÈÄ¥¥ê¥¹¥È¥Þ¥¯¥í¤Ï¥Þ¥¯¥í¤Î°ú¿ô¤¬ +.Xr troff +¤ÎÀ©¸Â¤Ç¤¢¤ë 9 ¸Ä¤ò±Û¤¨¤ë¤È¤­¤ËÍѤ¤¤é¤ì¤ë¡£ +.Pp +UR ¥Þ¥¯¥í (URI/URL ¥Ï¥¤¥Ñ¡¼¥Æ¥­¥¹¥È»²¾È¤Î³«»Ï), UE ¥Þ¥¯¥í (½ªÎ»), +UN ¥Þ¥¯¥í (»²¾ÈÍÑ¥¿¡¼¥²¥Ã¥È¤Î»ØÄê) ¤âÍøÍѤǤ­¤ë¡£ +¤³¤ì¤é¤Î¥Þ¥¯¥í¤Ë´Ø¤¹¤ë¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.Xr man 7 +¤ò¸«¤è¡£ +.\" The following does not apply on Linux: +.\".Sh ÀßÄê +.\"¥µ¥¤¥ÈÆÃÍ­¤Î¥Þ¥¯¥í¥Ñ¥Ã¥±¡¼¥¸¤ÎÀßÄê¤Ë´Ø¤·¤Æ¤Ï¡¢ +.\".Pa /usr/src/share/tmac/README +.\"¥Õ¥¡¥¤¥ë¤ò¸«¤è¡£ +.Sh ¥Õ¥¡¥¤¥ë +.Bl -tag -width "tmac.doc-ditroff" -compact +.It Pa doc.tmac +¥Þ¥Ë¥å¥¢¥ë¥É¥á¥¤¥ó¥Þ¥¯¥í¤È°ìÈ̥ƥ­¥¹¥È¥É¥á¥¤¥ó¥Þ¥¯¥í¡£ +.It Pa tmac/doc-common +¶¦Ä̤ι½Â¤¥Þ¥¯¥í¤ÈÄêµÁ¡£ +.It Pa tmac/doc-nroff +¥µ¥¤¥È°Í¸¤Î +.Xr nroff +¥¹¥¿¥¤¥ë¥Õ¥¡¥¤¥ë¡£ +.It Pa tmac/doc-ditroff +¥µ¥¤¥È°Í¸¤Î +.Xr troff +¥¹¥¿¥¤¥ë¥Õ¥¡¥¤¥ë¡£ +.It Pa tmac/doc-syms +ÆüìÄêµÁ (ɸ½à¥Þ¥¯¥í¤Ê¤É)¡£ +.El +.Sh ´ØÏ¢¹àÌÜ +.Xr groff_mdoc 7 , +.Xr mdoc.samples 7 , +.Xr man 7 , +.Xr man-pages 7 diff --git a/release/man7/mq_overview.7 b/release/man7/mq_overview.7 new file mode 100644 index 00000000..2912b7d1 --- /dev/null +++ b/release/man7/mq_overview.7 @@ -0,0 +1,313 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-03-13, Akihiro MOTOKI +.\" Updated 2006-07-20, Akihiro MOTOKI , LDP v2.36 +.\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.19 +.\" Updated 2010-04-11, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: message queue descriptor ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò +.\"WORD: message queue description ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò +.\" +.TH MQ_OVERVIEW 7 2009-09-27 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +mq_overview \- POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î³µÍ× +.SH ÀâÌÀ +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ò»ÈÍѤ¹¤ë¤È¡¢¥×¥í¥»¥¹´Ö¤Ç +¥á¥Ã¥»¡¼¥¸¤Î·Á¤Ç¤Î¥Ç¡¼¥¿¤Î¤ä¤ê¼è¤ê¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î API ¤Ï System V ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î API +.RB ( msgget (2), +.BR msgsnd (2), +.BR msgrcv (2) +¤Ê¤É) ¤È¤Ï°Û¤Ê¤ë¤â¤Î¤À¤¬¡¢Æ±Íͤε¡Ç½¤òÄ󶡤¹¤ë¡£ + +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ÎºîÀ®¤È¥ª¡¼¥×¥ó¤Ï +.BR mq_open (3) +¤ò»È¤Ã¤Æ¹Ô¤¦¡£¤³¤Î´Ø¿ô¤Ï +.I ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò (message queue descriptor) +.RI ( mqd_t ) +¤òÊÖ¤¹¡£¤³¤ì°Ê¹ß¤Î¥³¡¼¥ë¤Ç¤Ï¡¢¥ª¡¼¥×¥ó¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï +.I ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò +¤ò»È¤Ã¤Æ»²¾È¤µ¤ì¤ë¡£ +³Æ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï +.I /somename +¤Î·Á¤Î̾Á°¤Ç¶èÊ̤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤½¤Î̾Á°¤Ï¡¢ºÇÂç¤Ç +.B NAME_MAX +(¤¹¤Ê¤ï¤Á 255) ʸ»ú¤Î NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¡¢ +¥¹¥é¥Ã¥·¥å¤Ç»Ï¤Þ¤ê¡¢¥¹¥é¥Ã¥·¥å°Ê³°¤Îʸ»ú¤¬ 1 ʸ»ú°Ê¾å³¤¯·Á¼°¤Ç¤¢¤ë¡£ +.BR mq_open (3) +¤ËƱ¤¸Ì¾Á°¤òÅϤ¹¤³¤È¤Ç¡¢2¤Ä¤Î¥×¥í¥»¥¹¤ÇƱ°ì¤Î¥­¥å¡¼¤ò +Áàºî¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¥á¥Ã¥»¡¼¥¸¤Î¥­¥å¡¼¤Ø¤ÎÁ÷¼õ¿®¤Ï +.BR mq_send (3) +¤È +.BR mq_receive (3) +¤ò»È¤Ã¤Æ¹Ô¤¦¡£¥×¥í¥»¥¹¤¬¥­¥å¡¼¤Î»ÈÍѤò½ª¤¨¤ë¤È¤­¤Ë¤Ï¡¢ +.BR mq_close (3) +¤ò»È¤Ã¤Æ¥­¥å¡¼¤ò¥¯¥í¡¼¥º¤¹¤ë¡£¥­¥å¡¼¤¬¤â¤Ï¤äÉÔÍפȤʤ俾ì¹ç¤Ë¤Ï¡¢ +.BR mq_unlink (3) +¤ò»È¤Ã¤Æ¥­¥å¡¼¤òºï½ü¤Ç¤­¤ë¡£¥­¥å¡¼¤Î°À­¤Ï +.BR mq_getattr (3) +¤Ç¼èÆÀ¤Ç¤­¡¢ (À©¸Â¤Ï¤¢¤ë¤¬) +.BR mq_setattr (3) +¤ÇÊѹ¹¤Ç¤­¤ë¡£ +.BR mq_notify (3) +¤ò»È¤¦¤³¤È¤Ç¡¢¶õ¤Î¥­¥å¡¼¤Ø¤Î¥á¥Ã¥»¡¼¥¸ÅþÃå¤òÈóƱ´ü¤Ç +ÄÌÃΤ¹¤ë¤è¤¦¤ËÍ׵᤹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ + +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò¤Ï +.I "¥ª¡¼¥×¥ó¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò (open message queue description)" +¤Ø¤Î»²¾È¤Ç¤¢¤ë +.RB ( open (2) +¤â»²¾È)¡£ +.BR fork (2) +¼Â¹Ô¸å¤Ï¡¢»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +¤³¤ì¤é¤Îµ­½Ò»Ò¤Ï¡¢¿Æ¥×¥í¥»¥¹¤ÎÂбþ¤¹¤ëµ­½Ò»Ò¤ÈƱ¤¸¥ª¡¼¥×¥ó¥á¥Ã¥»¡¼¥¸¥­¥å¡¼ +µ­½Ò¤ò»²¾È¤·¤Æ¤¤¤ë¡£¿Æ¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤ÎÂбþ¤¹¤ëµ­½Ò»Ò¤Ï¡¢¥Õ¥é¥° +.RI ( mq_flags ) +¤ò¶¦Í­¤¹¤ë¡£¤Ê¤¼¤Ê¤é¡¢¥Õ¥é¥°¤Ï¥ª¡¼¥×¥ó¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò¤Ë +´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£ + +³Æ¥á¥Ã¥»¡¼¥¸¤Ë¤Ï¤½¤ì¤¾¤ì +.I Í¥ÀèÅÙ (priority) +¤¬¤¢¤ê¡¢¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®¥×¥í¥»¥¹¤Ø¤ÎÇÛÁ÷¤Ï¾ï¤Ë +Í¥ÀèÅ٤ι⤤¥á¥Ã¥»¡¼¥¸¤«¤é½ç¤Ë¹Ô¤ï¤ì¤ë¡£ +¥á¥Ã¥»¡¼¥¸¤ÎÍ¥ÀèÅÙ¤Ï 0 (ÄãÍ¥Àè) ¤«¤é +.I sysconf(_SC_MQ_PRIO_MAX)\ -\ 1 +(¹âÍ¥Àè) ¤ÎÃͤò»ý¤Ä¡£ +Linux ¤Ç¤Ï¡¢ +.I sysconf(_SC_MQ_PRIO_MAX) +¤Ï 32768 ¤òÊÖ¤¹¤¬¡¢ +POSIX.1-2001 ¤ÇÍ׵ᤵ¤ì¤Æ¤¤¤ë¤Î¤Ï 0 ¤«¤é 31 ¤Þ¤Ç¤ÎÍ¥ÀèÅÙ¤ò +¼ÂÁõ¤¹¤ë¤³¤È¤À¤±¤Ç¤¢¤ê¡¢¼ÂÁõ¤Ë¤è¤Ã¤Æ¤Ï¤³¤ÎÈϰϤÎÍ¥ÀèÅÙ¤·¤« +Âбþ¤·¤Æ¤¤¤Ê¤¤¡£ +.PP +¤³¤ÎÀá¤Î»Ä¤ê¤Ç¤Ï¡¢POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î Linux ¤Î¼ÂÁõ¤Î¾ÜºÙ +¤Ë¤Ä¤¤¤ÆÀâÌÀ¤¹¤ë¡£ +.SS ¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤È¥·¥¹¥Æ¥à¥³¡¼¥ë +¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢¾åµ­¤Î +.B mq_*() +¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¡¢Æ±¤¸Ì¾Á°¤Î²¼°ÌÁؤΥ·¥¹¥Æ¥à¥³¡¼¥ë¤ò +»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£¤³¤ÎÏÈÁȤߤˤ¢¤Æ¤Ï¤Þ¤é¤Ê¤¤¤â¤Î¤ò +°Ê²¼¤Îɽ¤Ë¼¨¤¹¡£ +.in +4n +.TS +lB lB +l l. +Library interface System call +mq_close(3) close(2) +mq_getattr(3) mq_getsetattr(2) +mq_notify(3) mq_notify(2) +mq_open(3) mq_open(2) +mq_receive(3) mq_timedreceive(2) +mq_send(3) mq_timedsend(2) +mq_setattr(3) mq_getsetattr(2) +mq_timedreceive(3) mq_timedreceive(2) +mq_timedsend(3) mq_timedsend(2) +mq_unlink(3) mq_unlink(2) +.TE +.in +.SS ¥Ð¡¼¥¸¥ç¥ó +Linux ¤Ç¤Ï POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï¥«¡¼¥Í¥ë 2.6.6 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +glibc ¤Ç¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3.4 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SS ¥«¡¼¥Í¥ë¤ÎÀßÄê +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¥µ¥Ý¡¼¥È¤Ï¡¢¥«¡¼¥Í¥ë¤ÎÀßÄê (configuration) +¥ª¥×¥·¥ç¥ó +.B CONFIG_POSIX_MQUEUE +¤ÇÀßÄê²Äǽ¤Ç¤¢¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÍ­¸ú¤Ç¤¢¤ë¡£ +.SS »ý³À­ +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï¥«¡¼¥Í¥ëÆâ¤ÇÊÝ»ý¤µ¤ì¤ë¡£ +.BR mq_unlink (3) +¤Çºï½ü¤µ¤ì¤Ê¤±¤ì¤Ð¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï +¥·¥¹¥Æ¥à¤¬¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤ë¤Þ¤Ç¸ºß¤·Â³¤±¤ë¡£ +.SS ¥ê¥ó¥¯ +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼ API ¤ò»ÈÍѤ·¤¿¥×¥í¥°¥é¥à¤Ï +.I cc \-lrt +¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¡¢¥ê¥¢¥ë¥¿¥¤¥à¥é¥¤¥Ö¥é¥ê +.I librt +¤È¥ê¥ó¥¯¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +°Ê²¼¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æ¡¢POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬¾ÃÈñ¤¹¤ë¥«¡¼¥Í¥ë +¥á¥â¥ê¤ÎÎ̤òÀ©¸Â¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.I /proc/sys/fs/mqueue/msg_max +¤³¤Î¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ¡¢°ì¤Ä¤Î¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¥á¥Ã¥»¡¼¥¸¤ÎºÇÂç¿ô¤Î +¾å¸ÂÃͤò»²¾È¤·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë¡£¤³¤ÎÃͤϡ¢ +.BR mq_open (3) +¤ËÅϤ¹ +.I attr\->mq_maxmsg +°ú¤­¿ô¤ËÂФ¹¤ë¾å¸ÂÃͤȤ·¤Æµ¡Ç½¤¹¤ë¡£ +.I msg_max +¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 10 ¤Ç¡¢ +ºÇ¾®ÃÍ¤Ï 1 (2.6.28 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï 10) ¤Ç¤¢¤ë¡£ +¾å¸Â¤Ï¡ÖËä¤á¹þ¤ß¤Î¸ÇÄêÃÍ¡× +.RB ( HARD_MAX ) +¤Ç +.IR "(131072\ /\ sizeof(void\ *))" +(Linux/86 ¤Ç¤Ï 32768) ¤Ç¤¢¤ë¡£ +¤³¤Î¾å¸Â¤ÏÆø¢¥×¥í¥»¥¹ +.RB ( CAP_SYS_RESOURCE ) +¤Ç¤Ï̵»ë¤µ¤ì¤ë¤¬¡¢Ëä¤á¹þ¤ß¤Î¸ÇÄêÃͤˤè¤ë¾å¸Â¤Ï +¤É¤ó¤Ê¾ì¹ç¤Ë¤Ç¤âŬÍѤµ¤ì¤ë¡£ +.TP +.I /proc/sys/fs/mqueue/msgsize_max +¤³¤Î¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ¡¢¥á¥Ã¥»¡¼¥¸¤ÎºÇÂ祵¥¤¥º¤Î¾å¸ÂÃͤò +»²¾È¤·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë¡£ +¤³¤ÎÃͤϡ¢ +.BR mq_open (3) +¤ËÅϤ¹ +.I attr\->mq_msgsize +°ú¤­¿ô¤ËÂФ¹¤ë¾å¸ÂÃͤȤ·¤Æµ¡Ç½¤¹¤ë¡£ +.I msgsize_max +¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 8192 ¥Ð¥¤¥È¤Ç¡¢ +ºÇ¾®ÃÍ¤Ï 128 (2.6.28 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï 8192) ¤Ç¤¢¤ë¡£ +.I msgsize_max +¤Î¾å¸Â¤Ï 1,048,576 ¤Ç¤¢¤ë +(2.6.28 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¾å¸Â¤Ï +.B INT_MAX +(Linux/86 ¤Ç¤Ï 2,147,483,647) ¤Ç¤¢¤Ã¤¿)¡£ +¤³¤Î¾å¸Â¤ÏÆø¢¥×¥í¥»¥¹ +.RB ( CAP_SYS_RESOURCE ) +¤Ç¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.I /proc/sys/fs/mqueue/queues_max +¤³¤Î¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ¡¢ºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¿ô¤Ë +ÂФ¹¤ë¥·¥¹¥Æ¥àÁ´ÂΤǤÎÀ©¸Â¤ò»²¾È¤·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤­¤ë¡£ +°ìÅÙ¤³¤Î¾å¸Â¤Ë㤹¤ë¤È¡¢¿·¤·¤¤¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òºîÀ®¤Ç¤­¤ë¤Î¤Ï +Æø¢¥×¥í¥»¥¹ +.RB ( CAP_SYS_RESOURCE ) +¤À¤±¤È¤Ê¤ë¡£ +.I queues_max +¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 256 ¤Ç¤¢¤ê¡¢ +0 ¤«¤é INT_MAX ¤ÎÈϰϤÎǤ°Õ¤ÎÃͤËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SS ¥ê¥½¡¼¥¹À©¸Â +¥ê¥½¡¼¥¹¾å¸Â +.B RLIMIT_MSGQUEUE +¤Ï¡¢¥×¥í¥»¥¹¤Î¼Â UID ¤ËÂбþ¤¹¤ëÁ´¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬¾ÃÈñ¤¹¤ë +¥á¥â¥ê¶õ´Ö¤ÎÎ̤ËÂФ·¤Æ¾å¸Â¤òÀßÄꤹ¤ë¡£ +.BR getrlimit (2) +¤ò»²¾È¡£ +.SS ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¡¦¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È +Linux ¤Ç¤Ï¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤ËºîÀ®¤µ¤ì¤ë +(¾¤Î¼ÂÁõ¤Ç¤âƱÍͤε¡Ç½¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¤â¤Î¤â¤¢¤ë¤¬¡¢ +¾ÜºÙ¤Ï°ã¤Ã¤Æ¤¤¤ë¤À¤í¤¦)¡£ +°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò»È¤¦¤³¤È¤Ç (¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤Ï) +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥Þ¥¦¥ó¥È¤Ç¤­¤ë: +.in +4n +.nf + +.RB "#" " mkdir /dev/mqueue" +.RB "#" " mount \-t mqueue none /dev/mqueue" + +.fi +.in +¥Þ¥¦¥ó¥È¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¥¹¥Æ¥£¥Ã¥­¡¼¥Ó¥Ã¥È (sticky bit) ¤Ï +¼«Æ°Åª¤Ë¥ª¥ó¤È¤Ê¤ë¡£ + +¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¡¦¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Þ¥¦¥ó¥È¸å¤Ï¡¢¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ +Ä̾ï»È¤¦¥³¥Þ¥ó¥É (Î㤨¤Ð +.BR ls (1) +¤ä +.BR rm (1)) +¤ò»È¤Ã¤Æ¡¢¥·¥¹¥Æ¥à¾å¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤òɽ¼¨¤·¤¿¤ê +Áàºî¤·¤¿¤ê¤Ç¤­¤ë¡£ + +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î³Æ¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤Ï 1¹Ô¤Ç¤¢¤ê¡¢ +¥­¥å¡¼¤Ë´Ø¤¹¤ë¾ðÊó¤¬É½¼¨¤µ¤ì¤ë¡£ +.in +4n +.nf + +.RB "$" " cat /dev/mqueue/mymq" +QSIZE:129 NOTIFY:2 SIGNO:0 NOTIFY_PID:8260 + +.fi +.in +³Æ¥Õ¥£¡¼¥ë¥É¤Î¾ÜºÙ¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.TP +.B QSIZE +¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ëÁ´¥á¥Ã¥»¡¼¥¸¤Î¹ç·×¥Ð¥¤¥È¿ô¡£ +.TP +.B NOTIFY_PID +¤³¤ÎÃͤ¬ 0 °Ê³°¤Î¾ì¹ç¡¢¤³¤ÎÃͤΠPID ¤ò»ý¤Ä¥×¥í¥»¥¹¤¬ +.BR mq_notify (3) +¤ò»È¤Ã¤Æ¡¢ÈóƱ´ü¤Î¥á¥Ã¥»¡¼¥¸ÄÌÃΤò¹Ô¤¦¤è¤¦¤ËÀßÄꤷ¤¿¤³¤È¤ò¼¨¤¹¡£ +¤É¤Î¤è¤¦¤ËÄÌÃΤ¬¹Ô¤ï¤ì¤ë¤«¤Ï¡¢°Ê²¼¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤è¤ê·èÄꤵ¤ì¤ë¡£ +.TP +.B NOTIFY +ÄÌÃÎÊýË¡: +0 ¤Ï +.BR SIGEV_SIGNAL ; +1 ¤Ï +.BR SIGEV_NONE ; +2 ¤Ï +.B SIGEV_THREAD +.TP +.B SIGNO +.B SIGEV_SIGNAL +¤Ë»ÈÍѤµ¤ì¤ë¥·¥°¥Ê¥ëÈֹ档 +.SS ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò¤Î¥Ý¡¼¥ê¥ó¥° +Linux ¤Ç¤Ï¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò»Ò¤Ï¼ÂºÝ¤Ï¥Õ¥¡¥¤¥ëµ­½Ò»Ò (file descriptor) +¤Ç¤¢¤ê¡¢ +.BR select (2), +.BR poll (2), +.BR epoll (7) +¤ò»È¤Ã¤Æ´Æ»ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Îµ¡Ç½¤Î°Ü¿¢À­¤Ï¤Ê¤¤¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +System V ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼ +.RB ( msgget (2), +.BR msgsnd (2), +.BR msgrcv (2) +¤Ê¤É) ¤Ï¥×¥í¥»¥¹´Ö¤Ç¥á¥Ã¥»¡¼¥¸¤ò¤ä¤ê¼è¤ê¤¹¤ë¤¿¤á¤Î¸Å¤¤ API ¤Ç¤¢¤ë¡£ +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï System V ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤è¤ê¤â¤¦¤Þ¤¯ +À߷פµ¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤·¤Æ¤¤¤ë¡£ +°ìÊý¤Ç¡¢POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ï System V ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ÈÈæ¤Ù¤ë¤È +ÍøÍѤǤ­¤ë¥·¥¹¥Æ¥à¤¬¾¯¤Ê¤¤ (Æäˡ¢¸Å¤¤¥·¥¹¥Æ¥à¤Ç¤Ï¾¯¤Ê¤¤)¡£ + +¸½ºß¤Î¤³¤È¤í (¥Ð¡¼¥¸¥ç¥ó 2.6.26 »þÅÀ)¡¢ +Linux ¤Ï POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤ËÂФ¹¤ë¥¢¥¯¥»¥¹À©¸æ¥ê¥¹¥È (ACL) ¤Ë +Âбþ¤·¤Æ¤¤¤Ê¤¤¡£ +.SH Îã +³Æ¼ï¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼´Ø¿ô¤ò»ÈÍѤ·¤¿Î㤬 +.BR mq_notify (3) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getrlimit (2), +.BR mq_getsetattr (2), +.BR poll (2), +.BR select (2), +.BR mq_close (3), +.BR mq_getattr (3), +.BR mq_notify (3), +.BR mq_open (3), +.BR mq_receive (3), +.BR mq_send (3), +.BR mq_unlink (3), +.BR epoll (7) diff --git a/release/man7/netdevice.7 b/release/man7/netdevice.7 new file mode 100644 index 00000000..019161cc --- /dev/null +++ b/release/man7/netdevice.7 @@ -0,0 +1,295 @@ +'\" t +.\" Don't change the first line, it tells man that tbl is needed. +.\" This man page is Copyright (C) 1999 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. +.\" $Id: netdevice.7,v 1.10 2001/08/15 18:01:06 hanataka Exp $ +.\" +.\" Modified, 2004-11-25, mtk, formatting and a few wording fixes +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated Mon 6 Dec 1999 by NAKANO Takeo +.\" Updated Wed 14 Feb 2001 by Kentaro Shirakata +.\" Updated 2009-02-12 by Kentaro Shirakata +.\" +.\"WORD load balancing bundle Éé²Ùʬ»¶¥°¥ë¡¼¥× +.\"WORD file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD capability ¸¢¸Â +.\" +.TH NETDEVICE 7 2009-01-14 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +netdevice \- Linux ¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤Ø¤ÎÄã¥ì¥Ù¥ë¥¢¥¯¥»¥¹ +.SH ½ñ¼° +.B "#include " +.br +.B "#include " +.SH ÀâÌÀ +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤òÀßÄꤹ¤ë¤¿¤á¤Ë +ÍѤ¤¤ë¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤Ä¤¤¤Æ²òÀ⤹¤ë¡£ + +Linux ¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤òÀßÄꤹ¤ë¤¿¤á¤Îɸ½àŪ¤Ê ioctl ¤ò +¤¤¤¯¤Ä¤«È÷¤¨¤Æ¤¤¤ë¡£¤³¤ì¤é¤Ï¤É¤ó¤Ê¥½¥±¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤â +ÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¥Õ¥¡¥ß¥ê¡¼¤ä¥¿¥¤¥×¤Ï²¿¤Ç¤â¤è¤¤¡£ +¤³¤ì¤é¤Î ioctl ¤Ï +.I ifreq +¹½Â¤ÂΤòÅϤ¹¡£ + +.in +4n +.nf +struct ifreq { + char ifr_name[IFNAMSIZ]; /* Interface name */ + union { + struct sockaddr ifr_addr; + struct sockaddr ifr_dstaddr; + struct sockaddr ifr_broadaddr; + struct sockaddr ifr_netmask; + struct sockaddr ifr_hwaddr; + short ifr_flags; + int ifr_ifindex; + int ifr_metric; + int ifr_mtu; + struct ifmap ifr_map; + char ifr_slave[IFNAMSIZ]; + char ifr_newname[IFNAMSIZ]; + char *ifr_data; + }; +}; + +struct ifconf { + int ifc_len; /* size of buffer */ + union { + char *ifc_buf; /* buffer address */ + struct ifreq *ifc_req; /* array of structures */ + }; +}; +.fi +.in + +Ä̾¥æ¡¼¥¶¡¼¤Ë¤è¤ëÀßÄêÂоݥǥХ¤¥¹¤Î»ØÄê¤Ï¡¢ +.I ifr_name +¤Ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î̾Á°¤ò¥»¥Ã¥È¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¹Ô¤¦¡£ +¾¤Î¹½Â¤ÂΤÎÁ´¤Æ¤Î¥á¥ó¥Ð¤Ï¡¢¥á¥â¥ê¤ò¶¦Í­¤¹¤ë¡£ +.SS ioctl +¡ÖÆø¢¤¬É¬Íספȵ­½Ò¤µ¤ì¤Æ¤¤¤ë ioctl ¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢ +¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤«¡¢ +.B CAP_NET_ADMIN +¸¢¸Â¤¬É¬ÍפǤ¢¤ë¡£¤³¤ì¤¬Ëþ¤¿¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï +.B EPERM +¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.B SIOCGIFNAME +.I ifr_ifindex +¤ò¼õ¤±¼è¤ê¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î̾Á°¤ò +.I ifr_name +¤ËÆþ¤ì¤ÆÊÖ¤¹¡£¤³¤ì¤Ï·ë²Ì¤ò +.I ifr_name +¤È¤·¤ÆÊÖ¤¹Í£°ì¤Î ioctl ¤Ç¤¢¤ë¡£ +.TP +.B SIOCGIFINDEX +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î interface index ¤ò¼èÆÀ¤·¡¢ +.I ifr_ifindex +¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +.TP +.BR SIOCGIFFLAGS ", " SIOCSIFFLAGS +¥Ç¥Ð¥¤¥¹¤Î active ¥Õ¥é¥°¥ï¡¼¥É¤ò¼èÆÀ¤Þ¤¿¤ÏÀßÄꤹ¤ë¡£ +.I ifr_flags +¤Ë¤Ï°Ê²¼¤ÎÃͤΥӥåȥޥ¹¥¯¤¬Æþ¤ë¡£ +.TS +tab(:); +c s +l l. +¥Ç¥Ð¥¤¥¹¥Õ¥é¥° +IFF_UP:¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÏÆ°ºîÃæ¡£ +IFF_BROADCAST:T{ +Í­¸ú¤Ê¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¡£ +T} +IFF_DEBUG:ÆâÉô¤Î¥Ç¥Ð¥Ã¥°¥Õ¥é¥°¡£ +IFF_LOOPBACK:¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï¥ë¡¼¥×¥Ð¥Ã¥¯¤Ç¤¢¤ë¡£ +IFF_POINTOPOINT:T{ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï point-to-point ¥ê¥ó¥¯¤Ç¤¢¤ë¡£ +T} +IFF_RUNNING:¥ê¥½¡¼¥¹¤¬³ä¤êÅö¤ÆºÑ¤ß¡£ +IFF_NOARP:arp ¥×¥í¥È¥³¥ë¤¬¤Ê¤¤¡£ +IFF_PROMISC:¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï promiscuous ¥â¡¼¥É¤Ç¤¢¤ë¡£ +IFF_NOTRAILERS:trailer ¤ÎÍøÍѤòÈò¤±¤ë¡£ +IFF_ALLMULTI:Á´¤Æ¤Î¥Þ¥ë¥Á¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤¹¤ë¡£ +IFF_MASTER:Éé²Ùʬ»¶¥°¥ë¡¼¥×¤Î¥Þ¥¹¥¿¡¼¤Ç¤¢¤ë¡£ +IFF_SLAVE:Éé²Ùʬ»¶¥°¥ë¡¼¥×¤Î¥¹¥ì¡¼¥Ö¤Ç¤¢¤ë¡£ +IFF_MULTICAST:¥Þ¥ë¥Á¥­¥ã¥¹¥È¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +IFF_PORTSEL:ifmap ¤Ë¤è¤Ã¤Æ¥á¥Ç¥£¥¢¥¿¥¤¥×¤òÁªÂò¤Ç¤­¤ë¡£ +IFF_AUTOMEDIA:¼«Æ°¥á¥Ç¥£¥¢ÁªÂò¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +IFF_DYNAMIC:T{ +¤³¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ÊĤ¸¤ë¤È¡¢¥¢¥É¥ì¥¹¤Ï¼º¤ï¤ì¤ë¡£ +T} +IFF_LOWER_UP:¥É¥é¥¤¥Ð¤«¤é¤Î L1 ¥¢¥Ã¥×¤ÎÄÌÃÎ (Linux 2.6.17 °Ê¹ß) +IFF_DORMANT:¥É¥é¥¤¥Ð¤«¤é¤ÎµÙ»ß¾õÂÖ¤ÎÄÌÃÎ (Linux 2.6.17 °Ê¹ß) +IFF_ECHO:Á÷¤é¤ì¤¿¥Ñ¥±¥Ã¥È¤ò¥¨¥³¡¼¤¹¤ë (Linux 2.6.25 °Ê¹ß) + + +.TE +active ¥Õ¥é¥°¥ï¡¼¥É¤ÎÀßÄê¤ÏÆø¢¤¬É¬ÍפÊÁàºî¤Ç¤¢¤ë¡£ +¤·¤«¤·Æɤ߽Ф·¤Ï¤É¤ó¤Ê¥×¥í¥»¥¹¤«¤é¤â²Äǽ¤Ç¤¢¤ë¡£ +.TP +.BR SIOCGIFMETRIC ", " SIOCSIFMETRIC +¥Ç¥Ð¥¤¥¹¤Î¥á¥È¥ê¥Ã¥¯¤ò +.I ifr_metric +¤òÍѤ¤¤Æ¼èÆÀ¡¦ÀßÄꤹ¤ë¡£ +¤³¤ì¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£Æɤ߽Ф½¤¦¤È¤¹¤ë¤È +.I ifr_metric +¤Ë 0 ¤ò¥»¥Ã¥È¤·¤ÆÊ֤ꡢÀßÄꤷ¤è¤¦¤È¤¹¤ë¤È +.B EOPNOTSUPP +¤¬Ê֤롣 +.TP +.BR SIOCGIFMTU ", " SIOCSIFMTU +¥Ç¥Ð¥¤¥¹¤Î MTU (Maximum Transfer Unit) ¤ò +.I ifr_mtu +¤òÍѤ¤¤Æ¼èÆÀ¡¦ÀßÄꤹ¤ë¡£ MTU ¤ÎÀßÄê¤ÏÆø¢¤¬É¬ÍפÊÁàºî¤Ç¤¢¤ë¡£ +MTU ¤ÎÃͤò¾®¤µ¤¯¤·¤¹¤®¤ë¤È¥«¡¼¥Í¥ë¤¬¥¯¥é¥Ã¥·¥å¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.BR SIOCGIFHWADDR ", " SIOCSIFHWADDR +¥Ç¥Ð¥¤¥¹¤Î¥Ï¡¼¥É¥¦¥§¥¢¥¢¥É¥ì¥¹¤ò +.I ifr_hwaddr +¤òÍѤ¤¤Æ¼èÆÀ¡¦ÀßÄꤹ¤ë¡£ +¥Ï¡¼¥É¥¦¥§¥¢¥¢¥É¥ì¥¹¤Ï +.I sockaddr +¹½Â¤ÂΤËÀßÄꤵ¤ì¤ë¡£ +.I sa_family +¤Ë¤Ï ARPHRD_* ¥Ç¥Ð¥¤¥¹¥¿¥¤¥×¤¬Æþ¤ê¡¢ +.I sa_data +¤Ë¤Ï¥Ð¥¤¥È 0 ¤«¤é»Ï¤Þ¤ë L2 ¥Ï¡¼¥É¥¦¥§¥¢¥¢¥É¥ì¥¹¤¬Æþ¤ë¡£ +¥Ï¡¼¥É¥¦¥§¥¢¥¢¥É¥ì¥¹¤ÎÀßÄê¤ÏÆø¢¤¬É¬ÍפÊÁàºî¤Ç¤¢¤ë¡£ +.TP +.B SIOCSIFHWBROADCAST +¥Ç¥Ð¥¤¥¹¤Î¥Ï¡¼¥É¥¦¥§¥¢¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ò +.I ifr_hwaddr +¤ÎÃͤËÀßÄꤹ¤ë¡£¤³¤ÎÁàºî¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£ +.TP +.BR SIOCGIFMAP ", " SIOCSIFMAP +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥Ï¡¼¥É¥¦¥§¥¢¤Î¥Ñ¥é¥á¡¼¥¿¤ò +.I ifr_map +¤òÍѤ¤¤Æ¼èÆÀ¡¦ÀßÄꤹ¤ë¡£ +¥Ñ¥é¥á¡¼¥¿¤ÎÀßÄê¤ÏÆø¢¤¬É¬ÍפÊÁàºî¤Ç¤¢¤ë¡£ + +.in +4n +.nf +struct ifmap { + unsigned long mem_start; + unsigned long mem_end; + unsigned short base_addr; + unsigned char irq; + unsigned char dma; + unsigned char port; +}; +.fi +.in + +ifmap ¹½Â¤ÂΤβò¼á¤Ï¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë°Í¸¤¹¤ë¡£ +.TP +.BR SIOCADDMULTI ", " SIOCDELMULTI +¥Ç¥Ð¥¤¥¹¤Î¥ê¥ó¥¯ÁؤΥޥë¥Á¥­¥ã¥¹¥È¥Õ¥£¥ë¥¿¡¼¤«¤é¡¢ +.I ifr_hwaddr +¤Î¥¢¥É¥ì¥¹¤òÄɲᦺï½ü¤¹¤ë¡£¤³¤ì¤é¤ÎÁàºî¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£ +Ê̤ÎÊýË¡¤¬ +.BR packet (7) +¤Ç²òÀ⤵¤ì¤Æ¤¤¤ë¡£ +.TP +.BR SIOCGIFTXQLEN ", " SIOCSIFTXQLEN +¥Ç¥Ð¥¤¥¹¤ÎÁ÷¿®¥­¥å¡¼¤ÎŤµ¤ò +.I ifr_qlen +¤Ë¼èÆÀ¡¦ÀßÄꤹ¤ë¡£Á÷¿®¥­¥å¡¼¤ÎŤµ¤ÎÀßÄê¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£ +.TP +.B SIOCSIFNAME +.I ifr_name +¤Ç»ØÄꤷ¤¿¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î̾Á°¤ò +.I ifr_newname +¤ËÊѹ¹¤¹¤ë¡£¤³¤ÎÁàºî¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ up ¤·¤Æ¤¤¤Ê¤¤ +»þ¤Ë¤Î¤ß»ÈÍѤǤ­¤ë¡£ +.TP +.B SIOCGIFCONF +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹(¥È¥é¥ó¥¹¥Ý¡¼¥ÈÁØ)¥¢¥É¥ì¥¹¤Î¥ê¥¹¥È¤òÊÖ¤¹¡£ +¸½ºß¤Î¤È¤³¤í¡¢¸ß´¹À­¤Î¤¿¤á¤Ë +.B AF_INET +(IPv4) ¥Õ¥¡¥ß¥ê¡¼¤Î¥¢¥É¥ì¥¹¤Î¤ß¤Ç¤¢¤ë¡£ +¥æ¡¼¥¶¡¼¤Ï +.I ifconf +¹½Â¤ÂΤò ioctl ¤Î°ú¿ô¤È¤·¤ÆÅϤ¹¡£ +.I ifconf +¹½Â¤ÂΤˤϡ¢ +.I ifreq +¹½Â¤ÂΤÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë +.I ifc_req +¤È¡¢¥Ð¥¤¥Èñ°Ì¤ÎÇÛÎó¤ÎŤµ¤ò»ØÄꤹ¤ë +.I ifc_len +¤¬´Þ¤Þ¤ì¤ë¡£ +¥«¡¼¥Í¥ë¤Ï ifreqs ¤ò¸½ºßÆ°ºî¤·¤Æ¤¤¤ëÁ´¤Æ¤Î L3 ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤ÇËä¤á¤ë¡£ +.I ifr_name +¤Ë¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹Ì¾ (eth0:1 ¤Ê¤É) ¤¬Æþ¤ê¡¢ +.I ifr_addr +¤Ë¤Ï¥¢¥É¥ì¥¹¤¬Æþ¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¼ÂºÝ¤ÎŤµ¤ò +.I ifc_len +¤ËÊÖ¤¹¡£ +.I ifc_len +¤¬¸µ¤Î¥Ð¥Ã¥Õ¥¡¤ÎŤµ¤ÈƱ¤¸¤À¤Ã¤¿¾ì¹ç¡¢ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤·¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¡¢ +Á´¤Æ¤Î¥¢¥É¥ì¥¹¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë¤è¤êÂ礭¤Ê¥Ð¥Ã¥Õ¥¡¤ÇºÆ»î¹Ô¤¹¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +¥¨¥é¡¼¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï ioctl ¤Ï 0 ¤òÊÖ¤¹¡£ +¥¨¥é¡¼¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£ +¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ï¥¨¥é¡¼¤È¤Ï¸«¤Ê¤µ¤ì¤Ê¤¤¡£ +.\" Slaving isn't supported in 2.2 +.\" . +.\" .TP +.\" .BR SIOCGIFSLAVE ", " SIOCSIFSLAVE +.\" Get or set the slave device using +.\" .IR ifr_slave . +.\" Setting the slave device is a privileged operation. +.\" .PP +.\" FIXME add amateur radio stuff. +.PP +¤Û¤È¤ó¤É¤Î¥×¥í¥È¥³¥ë¤Ë¤Ï¡¢ÀìÍѤΥ¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥ª¥×¥·¥ç¥ó¤ò +ÀßÄꤹ¤ë¤¿¤á¤ÎÆȼ«¤Î ioctl ¤¬Â¸ºß¤¹¤ë¡£ +ÀâÌÀ¤Ï³Æ¥×¥í¥È¥³¥ë¤Î man ¥Ú¡¼¥¸¤ò¸«¤è¡£ +.PP +¤µ¤é¤Ë¡¢¥Ç¥Ð¥¤¥¹¤Ë¤è¤Ã¤Æ¤Ï¥×¥é¥¤¥Ù¡¼¥È¤Ê ioctl ¤¬¤¢¤ë¡£ +¤³¤ì¤é¤Ï¤³¤³¤Ç¤ÏÀâÌÀ¤·¤Ê¤¤¡£ +.SH Ãí°Õ +¸·Ì©¤Ë¤¤¤¦¤È¡¢ +.B SIOCGIFCONF +¤Ï IP ¸ÇÍ­¤Ç¤¢¤ê¡¢ +.BR ip (7) +¤Ë°¤¹¤ë¡£ +.LP +¥¢¥É¥ì¥¹¤¬¤Ê¤«¤Ã¤¿¤ê¡¢ +.B IFF_RUNNING +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î̾Á°¤Ï +.I /proc/net/dev +¤ÇÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.LP +¥í¡¼¥«¥ë IPV6 IP ¥¢¥É¥ì¥¹¤Ï +.I /proc/net +¤« +.BR rtnetlink (7) +¤ÇÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.SH ¥Ð¥° +glibc 2.1 ¤Ç¤Ï +.I +¤Ë +.I ifr_newname +¥Þ¥¯¥í¤¬¤Ê¤¤¡£ +¤È¤ê¤¢¤¨¤º¤ÎÂбþºö¤È¤·¤Æ¡¢°Ê²¼¤Î¥³¡¼¥É¤òÄɲ䷤Ƥª¤¯¤³¤È¡£ +.sp +.in +4n +.nf +#ifndef ifr_newname +#define ifr_newname ifr_ifru.ifru_slave +#endif +.fi +.in +.RE +.SH ´ØÏ¢¹àÌÜ +.BR proc (5), +.BR capabilities (7), +.BR ip (7), +.BR rtnetlink (7) diff --git a/release/man7/netlink.7 b/release/man7/netlink.7 new file mode 100644 index 00000000..75eda2c9 --- /dev/null +++ b/release/man7/netlink.7 @@ -0,0 +1,473 @@ +'\" t +.\" Don't change the first line, it tells man that tbl is needed. +.\" This man page is Copyright (c) 1998 by Andi Kleen. Subject to the GPL. +.\" Based on the original comments from Alexey Kuznetsov +.\" $Id: netlink.7,v 1.8 2000/06/22 13:23:00 ak Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06 by NAKANO Takeo +.\" Updated 2001-04-04 by Yuichi SATO , catch up to LDP v1.35 +.\" Updated 2006-06-23 by Yuichi SATO , catch up to LDP v2.29 +.\" +.\"WORD payload ¥Ú¥¤¥í¡¼¥É +.\"WORD capability ¸¢¸Â +.\" +.TH NETLINK 7 2008-11-11 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +netlink \- ¥«¡¼¥Í¥ë¤È¥æ¡¼¥¶¡¼¶õ´Ö¤ÎÄÌ¿® (AF_NETLINK) +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include + +.BI "netlink_socket = socket(AF_NETLINK, " socket_type ", " netlink_family ); +.fi +.SH ÀâÌÀ +netlink ¤Ï¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤È¥æ¡¼¥¶¡¼¶õ´Ö¤Î¥×¥í¥»¥¹´Ö¤Ç +¾ðÊó¤ò¤ä¤ê¤È¤ê¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +netlink ¤Ï¡¢¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤ËÂФ·¤Æ¤Ï +ɸ½àŪ¤Ê¥½¥±¥Ã¥È¥Ù¡¼¥¹¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò¡¢ +¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤Ë¤Ï¥«¡¼¥Í¥ë¤ÎÆâÉô API ¤òÄ󶡤¹¤ë¡£ +¥«¡¼¥Í¥ëÆâÉô¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤Ä¤¤¤Æ¤Ï¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ïµ­½Ò¤·¤Ê¤¤¡£ +¤Þ¤¿¡¢netlink ¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹¤òÍѤ¤¤¿ +obsolete ¤Ê netlink ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤â¤¢¤ë¤¬¡¢¤³¤ì¤â¤³¤Îʸ½ñ¤Ç¤Ï²òÀ⤷¤Ê¤¤¡£ +¤³¤ì¤Ïñ¤Ë²áµî¸ß´¹À­¤Î¤¿¤á¤ËÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ë¤¹¤®¤Ê¤¤¡£ + +netlink ¤Ï¥Ç¡¼¥¿¥°¥é¥à»Ø¸þ¤Î¥µ¡¼¥Ó¥¹¤Ç¤¢¤ë¡£ +.I socket_type +¤Ë¤Ï +.B SOCK_RAW +¤È +.B SOCK_DGRAM +¤ÎξÊý¤È¤â»ØÄê²Äǽ¤Ç¤¢¤ë¡£ +¤·¤«¤· netlink ¥×¥í¥È¥³¥ë¤Ï¥Ç¡¼¥¿¥°¥é¥à¤È raw ¥½¥±¥Ã¥È¤Î¶èÊ̤ò¤·¤Ê¤¤¡£ + +.I netlink_family +¤Ï¡¢ÄÌ¿®¤¹¤ë¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤ä netlink ¥°¥ë¡¼¥×¤ÎÁªÂò¤ËÍѤ¤¤ë¡£ +¸½ºß³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë netlink ¥Õ¥¡¥ß¥ê¡¼¤Ï°Ê²¼¤ÎÄ̤ꡣ +.TP +.B NETLINK_ROUTE +¥ë¡¼¥Æ¥£¥ó¥°¤È¥ê¥ó¥¯¤Î¹¹¿·¤ò¼õ¿®¤¹¤ë¡£ +(IPv4 ¤È IPv6 ξÊý¤Î) ¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¡¦ +IP ¥¢¥É¥ì¥¹¡¦¥ê¥ó¥¯¥Ñ¥é¥á¡¼¥¿¡¦¶á˵ÀßÄê (neighbor setup)¡¦ +¥­¥å¡¼¥¤¥ó¥°¥ë¡¼¥ë (queueing dicipline)¡¦¥È¥é¥Õ¥£¥Ã¥¯¥¯¥é¥¹¡¦ +¥Ñ¥±¥Ã¥È¤Î¥¯¥é¥¹Ê¬Îà¤Î½¤Àµ¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¤À¤í¤¦ +.RB ( rtnetlink (7) +¤ò¸«¤è)¡£ +.TP +.B NETLINK_W1 +ñÀþ (1-wire) ¤Î¥µ¥Ö¥·¥¹¥Æ¥à¤«¤é¤Î¥á¥Ã¥»¡¼¥¸¡£ +.TP +.B NETLINK_USERSOCK +¥æ¡¼¥¶¡¼¥â¡¼¥É¥½¥±¥Ã¥È¥×¥í¥È¥³¥ë¤Î¤¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +.TP +.B NETLINK_FIREWALL +IPv4 ¥Ñ¥±¥Ã¥È¤ò netfilter ¤«¤é¥æ¡¼¥¶¡¼¶õ´Ö¤ØžÁ÷¤¹¤ë¡£ +.I ip_queue +¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤Ç»ÈÍѤµ¤ì¤ë¡£ +.TP +.B NETLINK_INET_DIAG +.\" FIXME More details on NETLINK_INET_DIAG needed. +INET ¥½¥±¥Ã¥È¤ò¥â¥Ë¥¿¥ê¥ó¥°¤¹¤ë¡£ +.TP +.B NETLINK_NFLOG +Netfilter/iptables ULOG. +.TP +.B NETLINK_XFRM +.\" FIXME More details on NETLINK_XFRM needed. +IPsec. +.TP +.B NETLINK_SELINUX +SELinux ¤Î¥¤¥Ù¥ó¥ÈÄÌÃΡ£ +.TP +.B NETLINK_ISCSI +.\" FIXME More details on NETLINK_ISCSI needed. +Open-iSCSI. +.TP +.B NETLINK_AUDIT +.\" FIXME More details on NETLINK_AUDIT needed. +´Æºº (audit) ¤ò¹Ô¤¦¡£ +.TP +.B NETLINK_FIB_LOOKUP +.\" FIXME More details on NETLINK_FIB_LOOKUP needed. +¥æ¡¼¥¶¡¼¶õ´Ö¤«¤é FIB ¥ë¥Ã¥¯¥¢¥Ã¥×¤Ë¥¢¥¯¥»¥¹¤¹¤ë¡£ +.TP +.B NETLINK_CONNECTOR +¥«¡¼¥Í¥ë¥³¥Í¥¯¥¿¡£ +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¥«¡¼¥Í¥ë¥½¡¼¥¹¤Î +.I Documentation/connector/* +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.TP +.B NETLINK_NETFILTER +.\" FIXME More details on NETLINK_NETFILTER needed. +netfilter ¥µ¥Ö¥·¥¹¥Æ¥à¡£ +.TP +.B NETLINK_IP6_FW +IPv6 ¥Ñ¥±¥Ã¥È¤ò netfilter ¤«¤é¥æ¡¼¥¶¡¼¶õ´Ö¤ØžÁ÷¤¹¤ë¡£ +.I ip6_queue +¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤Ç»ÈÍѤµ¤ì¤ë¡£ +.TP +.B NETLINK_DNRTMSG +DECnet ¥ë¡¼¥Æ¥£¥ó¥°¥á¥Ã¥»¡¼¥¸¡£ +.TP +.B NETLINK_KOBJECT_UEVENT +.\" FIXME More details on NETLINK_KOBJECT_UEVENT needed. +¥æ¡¼¥¶¡¼¶õ´Ö¤Ø¤Î¥«¡¼¥Í¥ë¥á¥Ã¥»¡¼¥¸ +.TP +.B NETLINK_GENERIC +netlink ¤ò´Êñ¤Ë»ÈÍѤ¹¤ë¤¿¤á¤Î°ìÈÌŪ¤Ê netlink ¥Õ¥¡¥ß¥ê¡¼¡£ +.PP +netlink ¥á¥Ã¥»¡¼¥¸¤Ï¥Ð¥¤¥È¥¹¥È¥ê¡¼¥à¤«¤é¤Ê¤ê¡¢ +°ì¤Ä°Ê¾å¤Î +.I nlmsghdr +¥Ø¥Ã¥À¤È¡¢¤½¤ì¤ËÂбþ¤¹¤ë¥Ú¥¤¥í¡¼¥É (payload) ¤¬´Þ¤Þ¤ì¤ë¡£ +¥Ð¥¤¥È¥¹¥È¥ê¡¼¥à¤Ë¤Ï¡¢É¸½à¤Î +.B NLMSG_* +¥Þ¥¯¥í¤Ë¤è¤Ã¤Æ¤Î¤ß¥¢¥¯¥»¥¹¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR netlink (3) +¤ò¸«¤è¡£ + +¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸ (°ì¤Ä°Ê¾å¤Î +.I nlmsghdr +¥Ø¥Ã¥À¤È¡¢¤½¤ì¤ËÂбþ¤¹¤ë¥Ú¥¤¥í¡¼¥É¤¬ +°ì¤Ä¥Ð¥¤¥È¥¹¥È¥ê¡¼¥à¤Ë´Þ¤Þ¤ì¤ë) ¤Ë¤ª¤¤¤Æ¤Ï¡¢ +ÀèƬ¤Î¥Ø¥Ã¥À¡¦¸å³¤Î¥Ø¥Ã¥À¤Ë¤Ï +.B NLM_F_MULTI +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£¤¿¤À¤·ºÇ¸å¤Î¥Ø¥Ã¥À¤À¤±¤ÏÎã³°¤Ç¡¢ +.B NLMSG_DONE +¥¿¥¤¥×¤È¤Ê¤ë¡£ + +¤½¤ì¤¾¤ì¤Î +.B nlmsghdr +¤Î¸å¤Ë¤Ï¥Ú¥¤¥í¡¼¥É¤¬Â³¤¯¡£ + +.in +4n +.nf +struct nlmsghdr { + __u32 nlmsg_len; /* ¥Ø¥Ã¥À¤ò´Þ¤à¥á¥Ã¥»¡¼¥¸¤ÎŤµ */ + __u16 nlmsg_type; /* ¥á¥Ã¥»¡¼¥¸¤ÎÆâÍƤΥ¿¥¤¥× */ + __u16 nlmsg_flags; /* Äɲåե饰 */ + __u32 nlmsg_seq; /* ¥·¡¼¥±¥ó¥¹ÈÖ¹æ */ + __u32 nlmsg_pid; /* Á÷¿®¥×¥í¥»¥¹¤Î PID */ +}; +.fi +.in + +.I nlmsg_type +¤Ïɸ½à¤Î¥á¥Ã¥»¡¼¥¸¥¿¥¤¥×¤Î¤É¤ì¤«°ì¤Ä¤Ç¤¢¤ë: +.B NLMSG_NOOP +¥á¥Ã¥»¡¼¥¸¤Ï̵»ë¤µ¤ì¤ë¡£ +.B NLMSG_ERROR +¥á¥Ã¥»¡¼¥¸¤Ï¥¨¥é¡¼¤ò¼¨¤·¡¢¥Ú¥¤¥í¡¼¥É¤Ë¤Ï +.I nlmsgerr +¹½Â¤ÂΤ¬Æþ¤ë¡£ +.B NLMSG_DONE +¥á¥Ã¥»¡¼¥¸¤Ï¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸¤Î½ªÎ»¤òÅÁ¤¨¤ë¡£ + +.in +4n +.nf +struct nlmsgerr { + int error; /* Éé¤Þ¤¿¤Ï 0 ¤Î errno ¤Ï±þÅú¤òɽ¤¹ */ + struct nlmsghdr msg; /* ¥¨¥é¡¼¤òµ¯¤³¤·¤¿¥á¥Ã¥»¡¼¥¸¤Î¥Ø¥Ã¥À */ +}; +.fi +.in + +¤¢¤ë netlink ¥Õ¥¡¥ß¥ê¡¼¤Ç»ØÄê¤Ç¤­¤ë¥á¥Ã¥»¡¼¥¸¥¿¥¤¥×¤Ï¡¢ +Ä̾ï¤â¤Ã¤È¿¤¤¡£¤³¤ì¤é¤Ë´Ø¤·¤Æ¤ÏŬÀÚ¤Ê man ¥Ú¡¼¥¸¤ò¸«¤Æ¤Û¤·¤¤¡£ +¤¿¤È¤¨¤Ð +.B NETLINK_ROUTE +¤Ë´Ø¤·¤Æ¤Ï +.BR rtnetlink (7) +¤Ë½ñ¤¤¤Æ¤¢¤ë¡£ + +.I nlmsg_flags +¤Îɸ½à¥Õ¥é¥°¥Ó¥Ã¥È +.br +--------------------------------- +.TS +tab(:); +lB l. +NLM_F_REQUEST:Í×µá¥á¥Ã¥»¡¼¥¸Á´¤Æ¤Ç¥»¥Ã¥È¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +NLM_F_MULTI:T{ +¤³¤Î¥á¥Ã¥»¡¼¥¸¤Ï¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸¤Î°ìÉô¤Ç¤¢¤ë¡£ +¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸¤Ï +.B NLMSG_DONE +¤Ç½ªÃ¼¤¹¤ë¡£ +T} +NLM_F_ACK:À®¸ù¤·¤¿¾ì¹ç¤Î±þÅú¤òÍ׵᤹¤ë¡£ +NLM_F_ECHO:¤³¤ÎÍ×µá¤ò¥¨¥³¡¼¤¹¤ë¡£ +.TE + +GET Í×µá¤Ë¤ª¤±¤ëÄɲåե饰¥Ó¥Ã¥È +.br +------------------------------------- +.TS +tab(:); +lB l. +.\" FIXME NLM_F_ATOMIC is not used any more? +NLM_F_ROOT:ñ°ì¤Î¥¨¥ó¥È¥ê¤Ç¤Ï¤Ê¤¯¥Æ¡¼¥Ö¥ëÁ´ÂΤòÊÖ¤¹¡£ +NLM_F_MATCH:T{ +¥á¥Ã¥»¡¼¥¸¤ÎÆâÍƤÇÅϤµ¤ì¤¿´ð½à (criteria) ¤Ë¥Þ¥Ã¥Á¤¹¤ë +Á´¤Æ¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£ +¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +T} +NLM_F_ATOMIC:¥Æ¡¼¥Ö¥ë¤Î¥¢¥È¥ß¥Ã¥¯¤Ê¥¹¥Ê¥Ã¥×¥·¥ç¥Ã¥È¤òÊÖ¤¹¡£ +NLM_F_DUMP:ÊØÍø¤Ê¥Þ¥¯¥í¡£(NLM_F_ROOT|NLM_F_MATCH) ¤ÈƱ¤¸¡£ +.TE + +.B NLM_F_ATOMIC +¤ò»È¤¦¾ì¹ç¤Ï¡¢ +.B CAP_NET_ADMIN +¸¢¸Â¤ò»ý¤Ä¤«¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ + +NEW Í×µá¤Ë¤ª¤±¤ëÄɲåե饰¥Ó¥Ã¥È +.br +------------------------------------- +.TS +tab(:); +lB l. +NLM_F_REPLACE:¸½Â¸¤Î¥ª¥Ö¥¸¥§¥¯¥È¤òÃÖ´¹¤¹¤ë¡£ +NLM_F_EXCL:¤¹¤Ç¤Ë¥ª¥Ö¥¸¥§¥¯¥È¤¬¤¢¤Ã¤¿¤éÃÖ´¹¤·¤Ê¤¤¡£ +NLM_F_CREATE:¤Þ¤À¥ª¥Ö¥¸¥§¥¯¥È¤¬¤Ê¤±¤ì¤ÐºîÀ®¤¹¤ë¡£ +NLM_F_APPEND:¥ª¥Ö¥¸¥§¥¯¥È¥ê¥¹¥È¤ÎºÇ¸å¤ËÄɲ乤롣 +.TE + +.I nlmsg_seq +¤È +.I nlmsg_pid +¤Ï¥á¥Ã¥»¡¼¥¸¤ÎÄÉÀפ˻ÈÍѤµ¤ì¤ë¡£ +.I nlmsg_pid +¤Ï¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®¸µ¤òɽ¤¹¡£ +¥á¥Ã¥»¡¼¥¸¤¬ netlink ¥½¥±¥Ã¥È¤ÇÁ÷¿®¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +.I nlmsg_pid +¤È¥×¥í¥»¥¹¤Î PID ¤Ï 1:1 ¤Î´Ø·¸¤Ç¤Ï¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¡¢ +.RB ¡Ö ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È ¡× +¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È¤¹¤ë¤³¤È¡£ + +.I nlmsg_seq +¤È +.I nlmsg_pid +¤Ï netlink ¤Î¥³¥¢¤Ë¤Ï¸«¤¨¤Ê¤¤ (opaque)¡£ + +netlink ¤Ï¿®ÍêÀ­¤Î¹â¤¤¥×¥í¥È¥³¥ë¤Ç¤Ï¤Ê¤¤¡£ +netlink ¤Ï¥á¥Ã¥»¡¼¥¸¤ò¹Ô¤­Àè¤ËÆϤ±¤ë¤¿¤á¤ËºÇÁ±¤ò¿Ô¤¯¤¹¤¬¡¢ +¥á¥â¥ê¤¬Â­¤ê¤Ê¤«¤Ã¤¿¤ê¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¤¹¤ë¤È +¥á¥Ã¥»¡¼¥¸¤ò¼è¤ê¤³¤Ü¤¹¤³¤È¤â¤¢¤ë¡£ +¿®ÍêÀ­¤Î¹â¤¤Å¾Á÷¤ò¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢ +Á÷¿®¼Ô¤Ï¼õ¿®¼Ô¤Ë±þÅú¤òÍ׵᤹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤Ï +.B NLM_F_ACK +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£ +±þÅú¤Ï +.B NLMSG_ERROR +¥Ñ¥±¥Ã¥È¤Î¥¨¥é¡¼¥Õ¥£¡¼¥ë¥É¤ò 0 ¤Ë¤·¤¿¤â¤Î¤Ë¤Ê¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¼«Ê¬¼«¿È¤Î¥á¥Ã¥»¡¼¥¸¤ò¼õ¤±¤¿¤È¤­¤Ë¤Ï¡¢ +±þÅú¤òÀ¸À®¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥«¡¼¥Í¥ë¤Ï¼ºÇÔ¤·¤¿¥Ñ¥±¥Ã¥È¤ËÂФ·¤Æ¡¢ +.B NLMSG_ERROR +¥á¥Ã¥»¡¼¥¸¤òÁ÷¤í¤¦¤È¤¹¤ë¡£ +¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤Ï¤³¤Î´·½¬¤Ë¤â½¾¤¦É¬Íפ¬¤¢¤ë¡£ + +¤·¤«¤·¡¢¤É¤Î¤è¤¦¤Ê¾ì¹ç¤Ç¤â¥«¡¼¥Í¥ë¤«¤é¥æ¡¼¥¶¡¼¤Ø¤Î +¿®ÍêÀ­¤Î¹â¤¤Å¾Á÷¤ÏÉÔ²Äǽ¤Ç¤¢¤ë¡£ +¥½¥±¥Ã¥È¥Ð¥Ã¥Õ¥¡¤¬ËþÇդξì¹ç¡¢¥«¡¼¥Í¥ë¤Ï netlink ¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤Ç¤­¤Ê¤¤¡£ +¥á¥Ã¥»¡¼¥¸¤Ï¼è¤ê¤³¤Ü¤µ¤ì¤Æ¡¢¥«¡¼¥Í¥ë¤È¥æ¡¼¥¶¡¼¶õ´Ö¥×¥í¥»¥¹¤Ï¡¢ +¥«¡¼¥Í¥ë¤Î¾õÂ֤ˤĤ¤¤Æ¤ÎƱ¤¸¥Ó¥å¡¼¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤Ê¤¯¤Ê¤ë¡£ +¤³¤ì¤¬µ¯¤³¤Ã¤¿¤³¤È +.RB ( recvmsg (2) +¤Ë¤è¤Ã¤Æ +.B ENOBUFS +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë) ¤ò¸¡ÃΤ·¤ÆºÆ¤ÓƱ´ü¤µ¤»¤ë¤Î¤Ï¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÀÕǤ¤Ç¤¢¤ë¡£ +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +.I sockaddr_nl +¹½Â¤ÂΤϥ桼¥¶¡¼¶õ´Ö¤ä¥«¡¼¥Í¥ë¶õ´Ö¤Ç netlink ¥¯¥é¥¤¥¢¥ó¥È¤òµ­½Ò¤¹¤ë¡£ +.I sockaddr_nl +¤Ï¥æ¥Ë¥­¥ã¥¹¥È (ñ°ì¤ÎÀܳÀè¤Ë¤À¤±Á÷¤é¤ì¤ë) ¤Ë¤â¤Ç¤­¤ë¤·¡¢ +netlink ¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥× +.RI ( nl_groups +¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç) ¤Ë¤âÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.in +4n +.nf +struct sockaddr_nl { + sa_family_t nl_family; /* AF_NETLINK */ + unsigned short nl_pad; /* 0 ¤Ç¤¢¤ë */ + pid_t nl_pid; /* ¥×¥í¥»¥¹ ID */ + __u32 nl_groups; /* ¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¥Þ¥¹¥¯ */ +}; +.fi +.in + +.I nl_pid +¤Ï netlink ¥½¥±¥Ã¥È¤Î¥æ¥Ë¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ +¹Ô¤­À褬¥«¡¼¥Í¥ë¤Î¾ì¹ç¤Ï¡¢¾ï¤Ë 0 ¤Ç¤¢¤ë¡£ +¥æ¡¼¥¶¡¼¶õ´Ö¥×¥í¥»¥¹¤Î¾ì¹ç¡¢Ä̾ï¤Ï +.I nl_pid +¤Ï¹Ô¤­Àè¤Î¥½¥±¥Ã¥È¤ò½êÍ­¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î PID ¤Ç¤¢¤ë¡£ +¤¿¤À¤·¡¢ +.I nl_pid +¤Ï¥×¥í¥»¥¹¤Ç¤Ï¤Ê¤¯ netlink ¥½¥±¥Ã¥È¤òƱÄꤹ¤ë¡£ +¥×¥í¥»¥¹¤¬Ê£¿ô¤Î netlink ¥½¥±¥Ã¥È¤ò½êÍ­¤¹¤ë¾ì¹ç¡¢ +.I nl_pid +¤ÏºÇÂç¤Ç¤â°ì¤Ä¤Î¥½¥±¥Ã¥È¤Î¥×¥í¥»¥¹ ID ¤È¤·¤«Åù¤·¤¯¤Ê¤é¤Ê¤¤¡£ +.I nl_pid +¤ò netlink ¥½¥±¥Ã¥È¤Ë³ä¤êÅö¤Æ¤ëÊýË¡¤Ï 2 ¤Ä¤¢¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ +.BR bind (2) +¤ò¸Æ¤ÖÁ°¤Ë +.I nl_pid +¤òÀßÄꤹ¤ë¾ì¹ç¡¢ +.I nl_pid +¤¬°ì°Õ¤Ç¤¢¤ë¤³¤È¤ò³Îǧ¤¹¤ë¤Î¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÀÕǤ¤È¤Ê¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ +.I nl_pid +¤ò 0 ¤ËÀßÄꤷ¤¿¾ì¹ç¡¢¥«¡¼¥Í¥ë¤¬¤³¤ÎÃͤò³ä¤êÅö¤Æ¤ë¡£ +¥«¡¼¥Í¥ë¤Ï¥×¥í¥»¥¹¤¬ºÇ½é¤Ë¥ª¡¼¥×¥ó¤·¤¿ +netlink ¥½¥±¥Ã¥È¤ËÂФ·¤Æ¥×¥í¥»¥¹ ID ¤ò³ä¤êÅö¤Æ¡¢ +¤½¤ì°Ê¹ß¤Ë¥×¥í¥»¥¹¤¬ºîÀ®¤·¤¿Á´¤Æ¤Î netlink ¥½¥±¥Ã¥È¤Ë¤â°ì°Õ¤Ê +.I nl_pid +¤ò³ä¤êÅö¤Æ¤ë¡£ + +.I nl_groups +¤Ï¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¡¢¤¹¤Ù¤Æ¤Î¥Ó¥Ã¥È¤¬ netlink ¥°¥ë¡¼¥×ÈÖ¹æ¤òɽ¤¹¡£ +¤½¤ì¤¾¤ì¤Î netlink ¥Õ¥¡¥ß¥ê¡¼¤Ï 32 ¤Î¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Î¥»¥Ã¥È¤ò»ý¤Ä¡£ +¤½¤ì¤¾¤ì¤Î netlink ¥Õ¥¡¥ß¥ê¡¼¤Ï 32 ¤Î¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Î +¥»¥Ã¥È¤ò»ý¤Ä¡£ +.BR bind (2) +¤¬¥½¥±¥Ã¥È¤ËÂФ·¤Æ¸Æ¤Ð¤ì¤ë¤È¡¢ +.I sockaddr_nl +¤Î +.I nl_groups +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï listen ¤·¤¿¤¤¥°¥ë¡¼¥×¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï 0 ¤Ç¡¢¥Þ¥ë¥Á¥­¥ã¥¹¥È¤ò°ìÀÚ¼õ¿®¤·¤Ê¤¤¡£ +.BR sendmsg (2) +¤ä +.BR connect (2) +¤Ë¤è¤Ã¤Æ¡¢¤¢¤ë¥½¥±¥Ã¥È¤«¤é¥á¥Ã¥»¡¼¥¸¤ò¥Þ¥ë¥Á¥­¥ã¥¹¥È¤·¤¿¤¤¤È¤­¤Ï¡¢ +.I nl_groups +¤ËÁ÷¿®¤·¤¿¤¤¥°¥ë¡¼¥×¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤ò¥»¥Ã¥È¤¹¤ì¤Ð¤è¤¤¡£ +¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤«¡¢ +.B CAP_NET_ADMIN +¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¡¼¤Î¤ß¤¬ netlink ¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤Ë +Á÷¿®¤·¤¿¤ê¡¢¤³¤ì¤ò listen ¤·¤¿¤ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¸þ¤±¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤·¤¿¾ì¹ç¡¢¤³¤ìÂФ¹¤ë±þÅú¤Ï +Á÷¤ê¼ç¤Î PID ¤È¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤È¤ËÁ÷¤êÊÖ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +netlink ¤Ø¤Î¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï Linux 2.2 ¤Î¿·µ¡Ç½¤Ç¤¢¤ë¡£ + +Linux 2.0 ¤Ï¡¢¤â¤Ã¤È¸¶»ÏŪ¤Ê¥Ç¥Ð¥¤¥¹¥Ù¡¼¥¹¤Î netlink ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò +¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤¿ (¤³¤ì¤â¸ß´¹À­¤Î¤¿¤á¤Ëº£¤Ç¤â»ÈÍѤǤ­¤ë)¡£ +¸Å¤¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë´Ø¤·¤Æ¤Ï¤³¤³¤Ç¤Ïµ­½Ò¤·¤Ê¤¤¡£ + +NETLINK_SELINUX ¤Ï Linux 2.6.4 ¤ÇÅо줷¤¿¡£ + +NETLINK_AUDIT ¤Ï Linux 2.6.6 ¤ÇÅо줷¤¿¡£ + +NETLINK_KOBJECT_UEVENT ¤Ï Linux 2.6.10 ¤ÇÅо줷¤¿¡£ + +NETLINK_W1, NETLINK_FIB_LOOKUP ¤Ï Linux 2.6.13 ¤ÇÅо줷¤¿¡£ + +NETLINK_INET_DIAG, NETLINK_CONNECTOR, NETLINK_NETFILTER ¤Ï +Linux 2.6.14 ¤ÇÅо줷¤¿¡£ + +NETLINK_GENERIC, NETLINK_ISCSI ¤Ï Linux 2.6.15 ¤ÇÅо줷¤¿¡£ +.SH Ãí°Õ +Äã¥ì¥Ù¥ë¤Î¥«¡¼¥Í¥ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤è¤ê¡¢ +.I libnetlink +¤Þ¤¿¤Ï +.I libnl +¤òÄ̤·¤Æ netlink ¤òÍøÍѤ¹¤ë¤Û¤¦¤¬Îɤ¤¤³¤È¤¬Â¿¤¤¡£ +.SH ¥Ð¥° +¤³¤Î man ¥Ú¡¼¥¸¤Ï´°À®¤·¤Æ¤¤¤Ê¤¤¡£ +.SH Îã +°Ê²¼¤ÎÎã¤Ç¤Ï¡¢ +.B RTMGRP_LINK +(¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î create/delete/up/down ¥¤¥Ù¥ó¥È) ¤È +.B RTMGRP_IPV4_IFADDR +(IPv4 ¥¢¥É¥ì¥¹¤Î add/delete ¥¤¥Ù¥ó¥È) ¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¤ò listen ¤¹¤ë +.B NETLINK_ROUTE +netlink ¤òºîÀ®¤·¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct sockaddr_nl sa; + +memset(&sa, 0, sizeof(sa)); +sa.nl_family = AF_NETLINK; +sa.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR; + +fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); +bind(fd, (struct sockaddr *) &sa, sizeof(sa)); +.fi +.in + +¼¡¤ÎÎã¤Ç¤Ï¡¢netlink ¥á¥Ã¥»¡¼¥¸¤ò¥«¡¼¥Í¥ë (pid 0) ¤ËÁ÷¤ëÊýË¡¤ò¼¨¤·¤Æ¤¤¤ë¡£ +±þÅú¤òÄÉÀפ¹¤ëºÝ¤Î¿®ÍêÀ­¤ò¹â¤á¤ë¤¿¤á¤Ë¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ +¥á¥Ã¥»¡¼¥¸¤Î¥·¡¼¥±¥ó¥¹ÈÖ¹æ¤òÀµ¤·¤¯½èÍý¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ + +.in +4n +.nf +struct nlmsghdr *nh; /* Á÷¿®¤¹¤ë nlmsghdr ¤È¥Ú¥¤¥í¡¼¥É */ +struct sockaddr_nl sa; +struct iovec iov = { (void *) nh, nh\->nlmsg_len }; +struct msghdr msg; + +msg = { (void *)&sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; +memset(&sa, 0, sizeof(sa)); +sa.nl_family = AF_NETLINK; +nh\->nlmsg_pid = 0; +nh\->nlmsg_seq = ++sequence_number; +/* NLM_F_ACK ¤òÀßÄꤹ¤ë¤³¤È¤Ç¡¢¥«¡¼¥Í¥ë¤Ë±þÅú¤òÍ׵᤹¤ë */ +nh\->nlmsg_flags |= NLM_F_ACK; + +sendmsg(fd, &msg, 0); +.fi +.in + +ºÇ¸å¤Ï¡¢netlink ¥á¥Ã¥»¡¼¥¸¤ÎÆɤ߹þ¤ß¤ÎÎã¤Ç¤¢¤ë¡£ + +.in +4n +.nf +int len; +char buf[4096]; +struct iovec iov = { buf, sizeof(buf) }; +struct sockaddr_nl sa; +struct msghdr msg; +struct nlmsghdr *nh; + +msg = { (void *)&sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; +len = recvmsg(fd, &msg, 0); + +for (nh = (struct nlmsghdr *) buf; NLMSG_OK (nh, len); + nh = NLMSG_NEXT (nh, len)) { + /* ¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¥Ã¥»¡¼¥¸¤Î½ª¤ï¤ê */ + if (nh\->nlmsg_type == NLMSG_DONE) + return; + + if (nh\->nlmsg_type == NLMSG_ERROR) + /* ²¿¤é¤«¤Î¥¨¥é¡¼½èÍý¤ò¹Ô¤¦ */ + ... + + /* ¥Ú¥¤¥í¡¼¥É¤Î²òÀϤò³¤±¤ë */ + ... +} +.fi +.in +.SH ´ØÏ¢¹àÌÜ +.BR cmsg (3), +.BR netlink (3), +.BR capabilities (7), +.BR rtnetlink (7) +.PP +libnetlink ¤Ë´Ø¤¹¤ë¾ðÊó¤Ï +ftp://ftp.inr.ac.ru/ip-routing/iproute2* + +libnl ¤Ë´Ø¤¹¤ë¾ðÊó¤Ï +http://people.suug.ch/~tgr/libnl/ + +RFC 3549 "Linux Netlink as an IP Services Protocol" diff --git a/release/man7/operator.7 b/release/man7/operator.7 new file mode 100644 index 00000000..3dcf4687 --- /dev/null +++ b/release/man7/operator.7 @@ -0,0 +1,67 @@ +.\" 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 2007-12-08 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +C operator \- C ¸À¸ì¤Î±é»»»Ò¤ÎÍ¥Àè½ç°Ì¤Èɾ²Á¤Î½ç½ø +.SH ÀâÌÀ +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ï C ¸À¸ì¤Î±é»»»Ò¤Èɾ²Á¤ÎÍ¥Àè½ç°Ì¤ò¥ê¥¹¥È¤¹¤ë¡£ +.nf + +.B "±é»»»Ò ·ë¹ç¤Î½ç½ø" +() [] \-> . º¸¤«¤é±¦¤Ø +! ~ ++ \-\- + \- (type) * & sizeof ±¦¤«¤éº¸¤Ø +* / % º¸¤«¤é±¦¤Ø ++ \- º¸¤«¤é±¦¤Ø +<< >> º¸¤«¤é±¦¤Ø +< <= > >= º¸¤«¤é±¦¤Ø +== != º¸¤«¤é±¦¤Ø +& º¸¤«¤é±¦¤Ø +^ º¸¤«¤é±¦¤Ø +| º¸¤«¤é±¦¤Ø +&& º¸¤«¤é±¦¤Ø +|| º¸¤«¤é±¦¤Ø +?: ±¦¤«¤éº¸¤Ø += += \-= *= /= %= <<= >>= &= ^= |= ±¦¤«¤éº¸¤Ø +, º¸¤«¤é±¦¤Ø +.fi +.\" diff --git a/release/man7/packet.7 b/release/man7/packet.7 new file mode 100644 index 00000000..6143d1f5 --- /dev/null +++ b/release/man7/packet.7 @@ -0,0 +1,418 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: packet.7,v 1.12 2001/06/19 07:07:38 argrath Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2001-02-13, Kentaro Shirakata +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" +.\"WORD physical layer ʪÍýÁØ +.\"WORD link level header(s) ¥ê¥ó¥¯¥ì¥Ù¥ë¥Ø¥Ã¥À +.\"WORD phyxical header(s) ʪÍý¥Ø¥Ã¥À +.\"WORD effective user id ¼Â¸ú¥æ¡¼¥¶¡¼ ID +.\"WORD capability ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.\"WORD pending error Ãٱ䥨¥é¡¼ +.\"WORD promiscuous mode ̵º¹Ê̥⡼¥É +.\" +.TH PACKET 7 2008-08-08 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +packet, AF_PACKET \- ¥Ç¥Ð¥¤¥¹¥ì¥Ù¥ë¤Î¥Ñ¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.SH ½ñ¼° +.nf +.B #include +.br +.B #include +.br +.B #include /* the L2 protocols */ +.sp +.BI "packet_socket = socket(AF_PACKET, int " socket_type ", int "protocol ); +.fi +.SH ÀâÌÀ +packet ¥½¥±¥Ã¥È¤Ï¡¢¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð (OSI ¥ì¥¤¥ä 2) ¥ì¥Ù¥ë¤Ç +À¸¤Î¥Ñ¥±¥Ã¥È (raw packet) ¤òÁ÷¼õ¿®¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +packet ¥½¥±¥Ã¥È¤ò»È¤¦¤È¡¢¥æ¡¼¥¶¡¼¶õ´Ö¤ÇʪÍýÁؤξå¤Ë +¥×¥í¥È¥³¥ë¥â¥¸¥å¡¼¥ë¤ò¼ÂÁõ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.I socket_type +¤Ë¤Ï +.B SOCK_RAW +¤È +.B SOCK_DGRAM +¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ +.B SOCK_RAW +¤Ï¥ê¥ó¥¯¥ì¥Ù¥ë¥Ø¥Ã¥À¤ò´Þ¤à raw ¥Ñ¥±¥Ã¥È¤ò¡¢ +.B SOCK_DGRAM +¤Ï¥ê¥ó¥¯¥ì¥Ù¥ë¥Ø¥Ã¥À¤¬ºï½ü¤µ¤ì¤¿²Ã¹©ºÑ¤ß¥Ñ¥±¥Ã¥È¤ò¼¨¤¹¡£ +¥ê¥ó¥¯¥ì¥Ù¥ë¥Ø¥Ã¥À¾ðÊó¤Ï +.I sockaddr_ll +¤Ç¶¦Ä̤Υե©¡¼¥Þ¥Ã¥È¤ÇÆþ¼ê¤Ç¤­¤ë¡£ +.I protocol +¤Ë¤Ï IEEE 802.3 ¥×¥í¥È¥³¥ëÈÖ¹æ¤ò +¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç»ØÄꤹ¤ë¡£ +»ØÄê¤Ç¤­¤ë¥×¥í¥È¥³¥ë¤Î¥ê¥¹¥È¤Ï¡¢¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ò»²¾È¡£¥×¥í¥È¥³¥ë¤ò +.B htons(ETH_P_ALL) +¤Ë¤¹¤ë¤È¡¢Á´¤Æ¤Î¥×¥í¥È¥³¥ë¤¬¼õ¿®¤µ¤ì¤ë¡£ +³°Éô¤«¤éÍ褿¥Ñ¥±¥Ã¥È¤Î¤¦¤Á»ØÄꤷ¤¿¥×¥í¥È¥³¥ë¤Î¤â¤Î¤Ï¡¢ +¥«¡¼¥Í¥ë¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¤ËÅϤµ¤ì¤ëÁ°¤ÎÃʳ¬¤Ç¡¢ +packet ¥½¥±¥Ã¥È¤ËÅϤµ¤ì¤ë¡£ + +packet ¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤Ç¤­¤ë¤Î¤Ï¡¢ +¼Â¸ú¥æ¡¼¥¶¡¼ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤«¡¢ +.B CAP_NET_RAW +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹¤À¤±¤Ç¤¢¤ë¡£ + +.B SOCK_RAW +¥Ñ¥±¥Ã¥È¤Ç¤Ï¡¢¥Ñ¥±¥Ã¥È¤ò¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤È¼õ¤±ÅϤ·¤¹¤ëºÝ¡¢ +¥Ñ¥±¥Ã¥È¥Ç¡¼¥¿¤ËÊѹ¹¤¬¹Ô¤ï¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +¥Ñ¥±¥Ã¥È¤Î¼õ¿®»þ¤Ë¤Ï¡¢¥¢¥É¥ì¥¹¤Î²òÀϤÀ¤±¤Ï¹Ô¤ï¤ì¡¢ +ɸ½àŪ¤Ê +.I sockaddr_ll +¥¢¥É¥ì¥¹¹½Â¤ÂΤËÅϤµ¤ì¤ë¡£¥Ñ¥±¥Ã¥È¤ÎÁ÷¿®»þ¤Ë¤Ï¡¢¥æ¡¼¥¶¤¬»ØÄꤹ¤ë +¥Ð¥Ã¥Õ¥¡¤ËʪÍýÁؤΥإåÀ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ +¥Ñ¥±¥Ã¥È¤Ï¤½¤Î¤Þ¤Þ½¤Àµ¤ò¼õ¤±¤º¤Ë¡¢¹Ô¤­À襢¥É¥ì¥¹¤«¤é·èÄꤵ¤ì¤ë +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥É¥é¥¤¥Ð¤Ë¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤ë¡£ +¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ë¤è¤Ã¤Æ¤Ï¡¢Â¾¤Î¥Ø¥Ã¥À¤ò¾ï¤ËÄɲ乤ë¤â¤Î¤â¤¢¤ë¡£ +.B SOCK_RAW +¤Ï Linux 2.0 ¤Î obosolete ¤Ê +.B AF_INET/SOCK_PACKET +¤È»÷¤Æ¤¤¤ë¤¬¡¢¸ß´¹À­¤¬¤¢¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ + +.B SOCK_DGRAM +¤Ï¤ä¤ä¹â°Ì¤Î¥ì¥Ù¥ë¤ÇÆ°ºî¤¹¤ë¡£ÊªÍý¥Ø¥Ã¥À¤Ï¡¢¥Ñ¥±¥Ã¥È¤¬¥æ¡¼¥¶¡¼¤Ë +ÅϤµ¤ì¤ëÁ°¤Ëºï½ü¤µ¤ì¤ë¡£ +.B SOCK_DGRAM +¤Î packet ¥½¥±¥Ã¥È¤òÄ̤·¤ÆÁ÷¤é¤ì¤ë¥Ñ¥±¥Ã¥È¤Ï¡¢ +.I sockaddr_ll +¤Î¹Ô¤­À襢¥É¥ì¥¹¤Î¾ðÊó¤Ë´ð¤Å¤­¡¢Å¬ÀÚ¤ÊʪÍýÁؤΥإåÀ¤¬Éղ䵤ì¤Æ¤«¤é¡¢ +¥­¥å¡¼¤ËÁ÷¤é¤ì¤ë¡£ + +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢»ØÄꤷ¤¿¥×¥í¥È¥³¥ë·¿¤Î¥Ñ¥±¥Ã¥È¤Ï¤¹¤Ù¤Æ packet +¥½¥±¥Ã¥È¤ËÁ÷¤é¤ì¤ë¡£ÆÃÄê¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤«¤é¤Î¥Ñ¥±¥Ã¥È¤À¤±¤ò +¼èÆÀ¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +.I struct sockaddr_ll +¤Ë¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Æ +.BR bind (2) +¤ò¸Æ¤Ó¡¢ packet ¥½¥±¥Ã¥È¤ò¤½¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë·ë¤ÓÉÕ¤±¤ë (¥Ð¥¤¥ó¥É¤¹¤ë)¡£ +¥Ð¥¤¥ó¥É¤ÎºÝ¤Ë¤Ï¡¢¥¢¥É¥ì¥¹¥Õ¥£¡¼¥ë¥É¤Î¤¦¤Á +.I sll_protocol +¤È +.I sll_ifindex +¤À¤±¤¬ÍѤ¤¤é¤ì¤ë¡£ + +.BR connect (2) +Áàºî¤Ï packet ¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.B MSG_TRUNC +¥Õ¥é¥°¤¬ +.BR recvmsg (2), +.BR recv (2), +.BR recvfrom (2) +¤ËÅϤµ¤ì¤ë¤È¡¢ (¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤è¤êÂ礭¤«¤Ã¤¿¤È¤·¤Æ¤â) ¾ï¤Ë¼ÂºÝ¤ËÄÌ¿®¤µ¤ì¤¿ +¥Ñ¥±¥Ã¥È¤ÎŤµ¤¬ÊÖ¤µ¤ì¤ë¡£ +.SS ¥¢¥É¥ì¥¹¤Î¥¿¥¤¥× +sockaddr_ll ¤Ï¥Ç¥Ð¥¤¥¹¤Ë°Í¸¤·¤Ê¤¤ÊªÍýÁؤΥ¢¥É¥ì¥¹¤Ç¤¢¤ë¡£ + +.in +4n +.nf +struct sockaddr_ll { + unsigned short sll_family; /* ¾ï¤Ë AF_PACKET */ + unsigned short sll_protocol; /* ʪÍýÁؤΥץí¥È¥³¥ë */ + int sll_ifindex; /* ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ÈÖ¹æ */ + unsigned short sll_hatype; /* ¥Ø¥Ã¥À¼ïÊÌ */ + unsigned char sll_pkttype; /* ¥Ñ¥±¥Ã¥È¼ïÊÌ */ + unsigned char sll_halen; /* ¥¢¥É¥ì¥¹¤ÎŤµ */ + unsigned char sll_addr[8]; /* ʪÍýÁؤΥ¢¥É¥ì¥¹ */ +}; +.fi +.in + +.I sll_protocol +¤Ïɸ½àŪ¤Ê¥¤¡¼¥µ¥Í¥Ã¥È¥×¥í¥È¥³¥ë¤Î¥¿¥¤¥×¤Ç¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Çµ­½Ò¤¹¤ë¡£ +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤¬¤³¤Î¥½¥±¥Ã¥È¤Î¥×¥í¥È¥³¥ë¤Î¥Ç¥Õ¥©¥ë¥È¤È¤Ê¤ë¡£ + +.I sll_ifindex +¤Ï¤½¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î interface index ¤Ç¤¢¤ë +.RB ( netdevice (7) +¤ò»²¾È)¡£ +0 ¤Ï (¥Ð¥¤¥ó¥É¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë) Ǥ°Õ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ + +.I sll_hatype +¤Ï¡¢¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë ARP ¼ïÊ̤Ǥ¢¤ë¡£ + +.I sll_pkttype +¤Ï¥Ñ¥±¥Ã¥È¼ïÊ̤Ǥ¢¤ë¡£»ØÄê¤Ç¤­¤ë¼ïÊ̤ϰʲ¼¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë: +.B PACKET_HOST +(¥í¡¼¥«¥ë¥Û¥¹¥È¸þ¤±¤Î¥Ñ¥±¥Ã¥È)¡¢ +.B PACKET_BORADCAST +(ʪÍýÁØ¤Î¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È)¡¢ +.B PACKET_MULTICAST +(ʪÍýÁؤΥޥë¥Á¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ËÁ÷¤ë¥Ñ¥±¥Ã¥È)¡¢ +.B PACKET_OTHERHOST +(¾¤Î¥Û¥¹¥È¤Ë¸þ¤±¤é¤ì¤¿¥Ñ¥±¥Ã¥È¤Î¤¦¤Á¡¢ +̵º¹Ê̥⡼¥É (promiscuous mode: ¸å½Ò) ¤Î¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ë¤è¤êÊä­¤µ¤ì¤¿¤â¤Î)¡¢ +.B PACKET_OUTGOING +(¥í¡¼¥«¥ë¥Û¥¹¥È¤«¤éȯ¿®¤µ¤ì¡¢ +packet ¥½¥±¥Ã¥È¤Ë¥ë¡¼¥×¥Ð¥Ã¥¯¤·¤Æ¤­¤¿¥Ñ¥±¥Ã¥È)¡£ +¤³¤ì¤é¤Î¼ïÊ̤¬°ÕÌ£¤ò»ý¤Ä¤Î¤Ï¼õ¿®»þ¤Î¤ß¤Ç¤¢¤ë¡£ + +.I sll_addr +¤È +.I sll_halen +¤Ï¡¢ÊªÍýÁؤΠ(¤Ä¤Þ¤ê IEEE 802.3 ¤Î) ¥¢¥É¥ì¥¹¤È¤½¤ÎŤµ¤Ç¤¢¤ë¡£ +¸·Ì©¤Ê²ò¼á¤Ï¥Ç¥Ð¥¤¥¹¤Ë°Í¸¤¹¤ë¡£ + +¥Ñ¥±¥Ã¥È¤òÁ÷¤ë¾ì¹ç¤Ï¡¢ +.IR sll_family , +.IR sll_addr , +.IR sll_halen , +.I sll_ifindex +¤ò»ØÄꤹ¤ì¤Ð½½Ê¬¤Ç¤¢¤ë¡£ +¤½¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤Ï 0 ¤Ë¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤ë¡£ +.I sll_hatype +¤È +.I sll_pkttype +¤Ë¤Ï¼õ¿®¤·¤¿¥Ñ¥±¥Ã¥È¤Î¾ðÊó¤¬ÀßÄꤵ¤ì¤ë¡£ +¥Ð¥¤¥ó¥É¤ÎºÝ¤Ë¤Ï¡¢ +.I sll_protocol +¤È +.I sll_ifindex +¤À¤±¤¬»ÈÍѤµ¤ì¤ë¡£ +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +packet ¥½¥±¥Ã¥È¤Ï¡¢ÊªÍýÁؤΥޥë¥Á¥­¥ã¥¹¥È¤ä +̵º¹Ê̥⡼¥É (promiscuous mode) ¤òÀßÄꤷ¤Æ»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ë¤Ï +.B SOL_PACKET +¤È°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Î¤¤¤º¤ì¤«¤ò»ØÄꤷ¤Æ +.BR setsockopt (2) +¤ò¸Æ¤Ù¤Ð¤è¤¤¡£ +¥Ð¥¤¥ó¥É¤òÄɲ乤ë¾ì¹ç¤Ï +.B PACKET_ADD_MEMBERSHIP +¤Ç¤¢¤ê¡¢¼è¤êµî¤ë¾ì¹ç¤Ï +.B PACKET_DROP_MEMBERSHIP +¤Ç¤¢¤ë¡£¤³¤ì¤é¤Ï¤¤¤º¤ì¤â +.B packet_mreq +¹½Â¤ÂΤò°ú¤­¿ô¤Ë¼è¤ë¡£ + +.in +4n +.nf +struct packet_mreq { + int mr_ifindex; /* ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ÈÖ¹æ */ + unsigned short mr_type; /* Æ°ºî */ + unsigned short mr_alen; /* ¥¢¥É¥ì¥¹¤ÎŤµ */ + unsigned char mr_address[8]; /* ʪÍýÁؤΥ¢¥É¥ì¥¹ */ +}; +.fi +.in + +.I mr_ifindex +¤Ï¡¢¥¹¥Æ¡¼¥¿¥¹¤òÊѹ¹¤·¤¿¤¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ÈÖ¹æ¤Ç¤¢¤ë¡£ +.I mr_type +¥Ñ¥é¥á¡¼¥¿¤Ï¼Â¹Ô¤¹¤ëÆ°ºî¤ò»ØÄꤹ¤ë: +.B PACKET_MR_PROMISC +¤Ï¡¢¶¦Í­¤·¤Æ¤¤¤ëÇÞÂΤ«¤é¤ÎÁ´¤Æ¤Î¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë +(¤·¤Ð¤·¤Ð "̵º¹Ê̥⡼¥É (promiscuous mode)" ¤È¸Æ¤Ð¤ì¤ë)¡£ +.B PACKET_MR_MULTICAST +¤Ï¡¢¤½¤Î¥½¥±¥Ã¥È¤ò¡¢ +.I mr_address +¤È +.I mr_alen +¤Ç»ØÄꤵ¤ì¤ëʪÍýÁؤΥޥë¥Á¥­¥ã¥¹¥È¥Ö¥ë¡¼¥×¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¡£ +.B PACKET_MR_ALLMULTI +¤Ï socket ¤ò up ¤Ë¤·¤Æ¡¢¤½¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ËÅþ㤷¤¿¤¹¤Ù¤Æ¤Î +¥Þ¥ë¥Á¥­¥ã¥¹¥È¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ + +ÀΤ«¤é¤¢¤ë ioctl ¤À¤±¤Ç¤Ê¤¯¡¢ +.BR SIOCSIFFLAGS , +.BR SIOCADDMULTI , +.B SIOCDELMULTI +¤òƱ¤¸ÌÜŪ¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SS ioctl +.B SIOCGSTAMP +¤òÍѤ¤¤ë¤È¡¢ºÇ¸å¤Ë¼õ¿®¤·¤¿¥Ñ¥±¥Ã¥È¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°ú¤­¿ô¤Ï +.I struct timeval +¤Ç¤¢¤ë¡£ + +¤µ¤é¤Ë¡¢ +.BR netdevice (7) +¤ª¤è¤Ó +.BR socket (7) +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëɸ½à¤Î ioctl ¤Ï¤¤¤º¤ì¤â +packet ¥½¥±¥Ã¥È¤Ë»ØÄê²Äǽ¤Ç¤¢¤ë¡£ +.SS ¥¨¥é¡¼½èÍý +packet ¥½¥±¥Ã¥È¤Ï¡¢¥Ñ¥±¥Ã¥È¤ò¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ËÅϤ¹¤È¤­¤Ë +µ¯¤­¤¿¥¨¥é¡¼¤·¤«½èÍý¤·¤Ê¤¤¡£Ãٱ䥨¥é¡¼ (pending error) +¤Ë´Ø¤¹¤ë³µÇ°¤Ï»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +.SH ¥¨¥é¡¼ +.TP +.B EADDRNOTAVAIL +ÉÔÌÀ¤Ê¥Þ¥ë¥Á¥­¥ã¥¹¥È¥°¥ë¡¼¥×¥¢¥É¥ì¥¹¤¬ÅϤµ¤ì¤¿¡£ +.TP +.B EFAULT +¥æ¡¼¥¶¤¬ÅϤ·¤¿¥á¥â¥ê¥¢¥É¥ì¥¹¤¬ÉÔÀµ¡£ +.TP +.B EINVAL +°ú¤­¿ô¤¬ÉÔÀµ¡£ +.TP +.B EMSGSIZE +¥Ñ¥±¥Ã¥È¤¬¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î MTU ¤è¤êÂ礭¤¤¡£ +.TP +.B ENETDOWN +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ up ¤Ç¤Ê¤¤¡£ +.TP +.B ENOBUFS +¥Ñ¥±¥Ã¥È¤Ë³ä¤êÅö¤Æ¤ë¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B ENODEV +¥Ç¥Ð¥¤¥¹Ì¾¤¬ÉÔÌÀ¡£¤¢¤ë¤¤¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤Ç»ØÄꤵ¤ì¤¿ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬ÉÔÌÀ¡£ +.TP +.B ENOENT +¥Ñ¥±¥Ã¥È¤ò°ì¤Ä¤â¼õ¿®¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +.B ENOTCONN +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤¬ÅϤµ¤ì¤Ê¤«¤Ã¤¿¡£ +.TP +.B ENXIO +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤ËÉÔÀµ¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +.TP +.B EPERM +¤³¤ÎÁàºî¤ò¹Ô¤¦¤Î¤ËɬÍפʸ¢¸Â¤ò¥æ¡¼¥¶¤¬»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ + +¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬¡¢Äã¥ì¥Ù¥ë¤Î¥É¥é¥¤¥Ð¤ÇÀ¸À®¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.B AF_PACKET +¤Ï Linux 2.2 ¤Î¿·µ¡Ç½¤Ç¤¢¤ë¡£¤³¤ì¤è¤ê¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Linux ¤Ç¤Ï +.B SOCK_PACKET +¤Î¤ß¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤¿¡£ +.PP +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤¬Â¸ºß¤¹¤ë¤Î¤Ï glibc 2.1 °Ê¹ß¤Ç¤¢¤ë¡£ +¤½¤ì°ÊÁ°¤Î¥·¥¹¥Æ¥à¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ëɬÍפ¬¤¢¤ë: +.sp +.in +4n +.nf +#include +#include +#include /* The L2 protocols */ +.fi +.in +.SH Ãí°Õ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +.BR pcap (3) +·Ðͳ¤Ç +.B AF_PACKET +¤òÍѤ¤¤ë¤³¤È¤ò¤ªÁ¦¤á¤¹¤ë¡£¤¿¤À¤·¡¢¤³¤ÎÊýË¡¤Ç¤Ï +.B AF_PACKET +¤Îµ¡Ç½¤¹¤Ù¤Æ¤òÍøÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ + +.B SOCK_DGRAM +packet ¥½¥±¥Ã¥È¤Ï¡¢IEEE 802.3 ¥Õ¥ì¡¼¥à¤Î IEEE 802.2 LLC ¥Ø¥Ã¥À¤Î +À¸À®¤ä²òÀϤò¹Ô¤ª¤¦¤È¤·¤Ê¤¤¡£ +.B ETH_P_802_3 +¤¬Á÷¿®¥×¥í¥È¥³¥ë¤Ë»ØÄꤵ¤ì¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï 802.3 ¥Õ¥ì¡¼¥à¤ò +À¸À®¤·¤Æ length ¥Õ¥£¡¼¥ë¥É¤Ë½ñ¤­¹þ¤à¡£ +´°Á´¤Ë½àµò¤·¤¿¥Ñ¥±¥Ã¥È¤òÆÀ¤ë¤¿¤á¤Ë¤Ï¥æ¡¼¥¶¡¼¤¬ LLC ¥Ø¥Ã¥À¤ò +Í¿¤¨¤ëɬÍפ¬¤¢¤ë¡£ÅþÃ夷¤¿ 802.3 ¥Ñ¥±¥Ã¥È¤Ç¤Ï¡¢ +DSAP/SSAP protocol ¤Î³Æ¥Õ¥£¡¼¥ë¥É¤Ï¿½Å²½ (multiplex) ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë¤³¤ì¤é¤Ï LLC ¥Ø¥Ã¥À¤¬Á°ÃÖ¤µ¤ì¤¿ +.B ETH_P_802_2 +¥×¥í¥È¥³¥ë¤È¤·¤ÆÍ¿¤¨¤é¤ì¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +.B ETH_P_802_3 +¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£¤«¤ï¤ê¤Ë +.B ETH_P_802_2 +¤Ë¥Ð¥¤¥ó¥É¤·¡¢¼«Ê¬¼«¿È¤Ç¥×¥í¥È¥³¥ë¤Î¿½Å²½¤ò¹Ô¤¦¤³¤È¡£ +Á÷¿®¤Î¥Ç¥Õ¥©¥ë¥È¤Ï¡¢¥×¥í¥È¥³¥ë¥Õ¥£¡¼¥ë¥É¤ò»ý¤Ä +ɸ½à¤Î Ethernet DIX encapsulation ¤Ç¤¢¤ë¡£ + +packet ¥½¥±¥Ã¥È¤ÏÆþ½ÐÎϤΠfirewall chain ¤Ë±Æ¶Á¤ò¤¦¤±¤Ê¤¤¡£ +.SS °Ü¿¢À­ +Linux 2.0 ¤Ç¤Ï¡¢ packet ¥½¥±¥Ã¥È¤òÆÀ¤ëÊýË¡¤Ï +.BI "socket(AF_INET, SOCK_PACKET, " protocol )\fR +¤ò¸Æ¤Ö¤ä¤êÊý¤·¤«¤Ê¤«¤Ã¤¿¡£¤³¤ÎÊýË¡¤Ï¤Þ¤À¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢ +ÍѤ¤¤Ê¤¤¤³¤È¤ò¶¯¤¯¿ä¾©¤¹¤ë¡£¸½ºß¤ÎÊýË¡¤È¤Î¼ç¤Ê°ã¤¤¤Ï¡¢ +.B SOCK_PACKET +¤Ç¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î»ØÄê¤Ë¸Å¤¤ +.I struct sockaddr_pkt +¤òÍѤ¤¤ëÅÀ¤Ç¤¢¤ë¡£¤³¤ì¤Ë¤ÏʪÍýÁؤ«¤é¤ÎÆÈΩÀ­¤¬¤Ê¤¤¡£ + +.in +4n +.nf +struct sockaddr_pkt { + unsigned short spkt_family; + unsigned char spkt_device[14]; + unsigned short spkt_protocol; +}; +.fi +.in + +.I spkt_family +¤Ï¥Ç¥Ð¥¤¥¹¤Î¥¿¥¤¥×¡¢ +.I spkt_protocol +¤Ï +.I +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë IEEE 802.3 ¥×¥í¥È¥³¥ë¥¿¥¤¥×¡¢ +.I spkt_device +¤Ï¥Ç¥Ð¥¤¥¹¤Î̾Á°¤ò NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤ÇÍ¿¤¨¤¿¤â¤Î (Îã: eth0) ¤Ç¤¢¤ë¡£ + +¤³¤Î¹½Â¤ÂÎ¤Ï obsolete ¤Ç¤¢¤ê¡¢ +¿·¤·¤¯¥³¡¼¥É¤ò½ñ¤¯»þ¤Ë¤ÏÍѤ¤¤ë¤Ù¤­¤Ç¤Ê¤¤¡£ +.SH ¥Ð¥° +glibc 2.1 ¤Ë¤Ï +.B SOL_PACKET +¤ÎÄêµÁ¤¬¤Ê¤¤¡£²óÈòºö¤È¤·¤Æ¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¤È¤è¤¤¡£ +.in +4n +.nf + +#ifndef SOL_PACKET +#define SOL_PACKET 263 +#endif + +.fi +.in +¤³¤ÎÌäÂê¤Ï¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï½¤Àµ¤µ¤ì¤Æ¤¤¤ë¡£ +libc5 ¤Î¥·¥¹¥Æ¥à¤Ë¤Ï¤³¤ÎÌäÂê¤Ï¤Ê¤¤¡£ + +IEEE 802.2/803.3 ¤Î LLC ¤Î°·¤¤Êý¤Ï¡¢¥Ð¥°¤È¹Í¤¨¤Æ¤âÎɤ¤¤À¤í¤¦¡£ + +¥½¥±¥Ã¥È¥Õ¥£¥ë¥¿¡¼¤Ë¤Ä¤¤¤Æµ­ºÜ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.B MSG_TRUNC +.BR recvmsg (2) +³ÈÄ¥¤ÏÈó¾ï¤Ë¤Þ¤º¤¤Âнè¤Ç¤¢¤ê¡¢À©¸æ¥á¥Ã¥»¡¼¥¸¤ÇÃÖ¤­´¹¤¨¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +º£¤Î¤È¤³¤í +.B SOCK_DGRAM +·Ðͳ¤Ç¥Ñ¥±¥Ã¥È¤Ë¤Ä¤¤¤Æ¤¤¤¿°¸À襢¥É¥ì¥¹¤òÆÀ¤ëÊýË¡¤¬¤Ê¤¤¡£ +.\" .SH Ãø¼Ô +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï Matthew Wilcox ¤Î½õÎϤΤâ¤È¤Ë Andi Kleen ¤¬½ñ¤¤¤¿¡£ +.\" Linux 2.2 ¤Î AF_PACKET ¤Ï¡¢ +.\" Alan Cox ¤¿¤Á¤Î¥³¡¼¥É¤ò¤â¤È¤Ë¤·¤Æ Alexey Kuznetsov ¤¬¼ÂÁõ¤·¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR socket (2), +.BR pcap (3), +.BR capabilities (7), +.BR ip (7), +.BR raw (7), +.BR socket (7) + +ɸ½à IP Ethernet encapsulation ¤Ë´Ø¤¹¤ë¾ðÊó¤Ï RFC\ 894 ¤Ë¤¢¤ë¡£ + +IEEE 802.3 IP encapsulation ¤Ë´Ø¤¹¤ë¾ðÊó¤Ï RFC\ 1700 ¤Ë¤¢¤ë¡£ + +ʪÍýÁؤΥץí¥È¥³¥ë¤Ë´Ø¤¹¤ëµ­½Ò¤Ï +.I +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë¡£ diff --git a/release/man7/path_resolution.7 b/release/man7/path_resolution.7 new file mode 100644 index 00000000..fd05bf53 --- /dev/null +++ b/release/man7/path_resolution.7 @@ -0,0 +1,236 @@ +.\" Copyright (C) 2003 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. +.\" +.\" Japanese Version Copyright (c) 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated 2005-01-26, Yuichi SATO +.\" Updated and Modified 2005-10-27, Akihiro MOTOKI +.\" Updated and Modified 2005-11-04, Akihiro MOTOKI +.\" +.TH PATH_RESOLUTION 7 2009-12-05 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +path_resolution \- ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤Î²ò·èÊýË¡ +.SH ÀâÌÀ +¤¤¤¯¤Ä¤«¤Î Unix/Linux ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢ +1 ¤Ä°Ê¾å¤Î¥Õ¥¡¥¤¥ë̾¤ò°ú¤­¿ô¤È¤·¤Æ»ý¤Ä¡£ +¥Õ¥¡¥¤¥ë̾ (¤Þ¤¿¤Ï¥Ñ¥¹Ì¾) ¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ²ò·è¤µ¤ì¤ë¡£ +.SS "¥¹¥Æ¥Ã¥× 1: ²ò·è²áÄø¤ò³«»Ï¤¹¤ë" +¥Ñ¥¹Ì¾¤¬ \(aq/\(aq ʸ»ú¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¥Ç¥£¥ì¥¯¥È¥ê¸¡º÷¤Î³«»ÏÅÀ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ê¤ë¡£ +(¥×¥í¥»¥¹¤Ï¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò¿Æ¥×¥í¥»¥¹¤«¤é·Ñ¾µ¤¹¤ë¡£ +Ä̾ï¤Ï¡¢¤³¤ì¤¬¥Õ¥¡¥¤¥ë³¬ÁؤΥ롼¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ê¤ë¡£ +¥×¥í¥»¥¹¤Ï +.BR chroot (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤ÆÊ̤Υ롼¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò¼èÆÀ¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤Î¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¤È +.B CLONE_NEWNS +¥Õ¥é¥°¤òÀßÄꤷ¤Æ +.BR clone (2) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤Æ³«»Ï¤µ¤ì¤¿¤½¤Î¥×¥í¥»¥¹¤Î»Ò¹¤Ï¡¢ +´°Á´¤Ë¥×¥é¥¤¥Ù¡¼¥È¤Ê¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤ò¼èÆÀ¤Ç¤­¤ë¡£) +¥Ñ¥¹Ì¾¤Î \(aq/\(aq ¤ÎÉôʬ¤Ï¡¢¤³¤Î¤è¤¦¤Ë¤·¤Æ°·¤ï¤ì¤ë¡£ + +¥Ñ¥¹Ì¾¤¬ \(aq/\(aq ʸ»ú¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +²ò·è²áÄø¤Ë¤ª¤±¤ë¥Ç¥£¥ì¥¯¥È¥ê¸¡º÷¤Î³«»ÏÅÀ¤Ï¡¢ +¥×¥í¥»¥¹¤Î¸½ºß¤Îºî¶È (working) ¥Ç¥£¥ì¥¯¥È¥ê¤È¤Ê¤ë¡£ +(¤³¤ì¤â¿Æ¥×¥í¥»¥¹¤«¤é·Ñ¾µ¤µ¤ì¤ë¡£ +¤³¤ì¤Ï +.BR chdir (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤³¤È¤ÇÊѹ¹¤Ç¤­¤ë¡£) + +\(aq/\(aq ʸ»ú¤Ç»Ï¤Þ¤ë¥Ñ¥¹Ì¾¤ÏÀäÂХѥ¹Ì¾¤È¸Æ¤Ð¤ì¡¢ +\(aq/\(aq ʸ»ú¤Ç»Ï¤Þ¤é¤Ê¤¤¥Ñ¥¹Ì¾¤ÏÁêÂХѥ¹Ì¾¤È¸Æ¤Ð¤ì¤ë¡£ +.SS "¥¹¥Æ¥Ã¥× 2: ¥Ñ¥¹¤òé¤ë" +¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤ò¥Ç¥£¥ì¥¯¥È¥ê¸¡º÷¤Î³«»ÏÅÀ¤È¤¹¤ë¡£ +¤½¤·¤Æ¡¢¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Î¹½À®Í×ÁÇ (component) ¤Ç¤Ê¤¤³Æ¹½À®Í×ÁǤˤĤ¤¤Æ¡¢ +¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤Ç¸¡º÷¤ò¹Ô¤¦¡£ +¤³¤³¤Ç¹½À®Í×ÁÇ¤Ï \(aq/\(aq ¤Ç¶èÀÚ¤é¤ì¤¿Éôʬʸ»úÎó¤Ç¤¢¤ë¡£ + +¥×¥í¥»¥¹¤¬¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤Î¸¡º÷µö²Ä¤ò»ý¤¿¤Ê¤¤¾ì¹ç¡¢ +.B EACCES +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë ("Permission denied")¡£ + +¹½À®Í×ÁǤ¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¡¢ +.B ENOENT +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë +("No such file or directory")¡£ + +¹½À®Í×ÁǤϸ«¤Ä¤«¤Ã¤¿¤¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤â¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤â¤Ê¤¤¾ì¹ç¡¢ +.B ENOTDIR +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë ("Not a directory")¡£ + +¹½À®Í×ÁǤ¬¸«¤Ä¤«¤Ã¤Æ¡¢¤«¤Ä¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¾ì¹ç¡¢ +¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤ò¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÀßÄꤷ¡¢ +¼¡¤Î¹½À®Í×ÁǤ˰ÜÆ°¤¹¤ë¡£ + +¹½À®Í×ÁǤ¬¸«¤Ä¤«¤Ã¤Æ¡¢¤«¤Ä¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯ (symlink) ¤Ç¤¢¤ë¾ì¹ç¡¢ +(¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤ò¥Ç¥£¥ì¥¯¥È¥ê¸¡º÷¤Î³«»ÏÅÀ¤È¤·¤Æ) +ºÇ½é¤Ë¤½¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò²ò·è¤¹¤ë¡£ +·ë²Ì¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¾ì¹ç¡¢ +.B ENOTDIR +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î²ò·è¤¬À®¸ù¤·¤Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬ÊÖ¤µ¤ì¤¿¾ì¹ç¡¢ +¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¸½ºß¤Î¸¡º÷¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤ÆÀßÄꤷ¡¢ +¼¡¤Î¹½À®Í×ÁǤ˰ÜÆ°¤¹¤ë¡£ +²ò·è²áÄø¤ËºÆµ¢¤¬´Þ¤Þ¤ì¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¥«¡¼¥Í¥ë¤ò¥¹¥¿¥Ã¥¯¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ä +¥µ¡¼¥Ó¥¹µñÈÝ (denial of service) ¤«¤é¼é¤ë¤¿¤á¡¢ +ºÆµ¢¤ÎºÇÂç¤Î¿¼¤µ¤È¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òé¤ëºÇÂç²ó¿ô¤ËÀ©¸Â¤¬¤¢¤ë¡£ +ºÇÂçÃͤòĶ¤¨¤¿¾ì¹ç +.B ELOOP +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë +("Too many levels of symbolic links")¡£ +.\" +.\" ¸½ºß¤Î¤È¤³¤í: ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯²ò·è¤Ë¤ª¤±¤ëºÆµ¢¤ÎºÇÂç¤Î¿¼¤µ¤Ï 5 ¤Ç¤¢¤ë¡£ +.\" ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òé¤ëºÇÂç²ó¿ô¤Ï 40 ¤Ç¤¢¤ë¡£ +.\" _POSIX_SYMLOOP_MAX ¤Ï 8 ¤Ç¤¢¤ë¡£ +.SS "¥¹¥Æ¥Ã¥× 3: ºÇ¸å¤Î¥¨¥ó¥È¥ê¤ò¸«¤Ä¤±¤ë" +¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Î¹½À®Í×ÁǤθ¡º÷¤Ï¡¢Á°¤Î¥¹¥Æ¥Ã¥×¤ÇÀâÌÀ¤·¤¿ +¾¤ÎÁ´¤Æ¤Î¹½À®Í×ÁǤÈƱ¤¸¤è¤¦¤Ë¼Â¹Ô¤µ¤ì¤ë¤¬¡¢2 ¤Ä¤Î°ã¤¤¤¬¤¢¤ë¡£ +(i) ºÇ¸å¤Î¹½À®Í×ÁǤϥǥ£¥ì¥¯¥È¥ê¤Ç¤¢¤ëɬÍפ¬¤Ê¤¤ +(¥Ñ¥¹²ò·è²áÄø¤Ë´Ø¤¹¤ë¸Â¤ê¤Ï¤É¤Á¤é¤Ç¤â¹½¤ï¤Ê¤¤ \(em +ÆÃÄê¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Í׵᤹¤ë¤â¤Î¤Ë¤è¤Ã¤Æ¡¢ +¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¾ì¹ç¤â¤¢¤ë¤·¡¢ +¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¾ì¹ç¤â¤¢¤ë)¡£ +(ii) ¹½À®Í×ÁǤ¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ë¥¨¥é¡¼¤Ë¤¹¤ëɬÍפϤʤ¤ \(em +¤½¤Î¹½À®Í×ÁǤòºîÀ®¤¹¤ë¤À¤±¤Ç¤è¤¤¾ì¹ç¤â¤¢¤ë¡£ +ºÇ¸å¤Î¥¨¥ó¥È¥ê¤Î¾ÜºÙ¤Ê°·¤¤¤Ï¡¢ +ÆÃÄê¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£ +.SS ". ¤È .." +´·½¬¤È¤·¤Æ¡¢Á´¤Æ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¥¨¥ó¥È¥ê "." ¤È ".." ¤ò»ý¤Ä¡£ +¤³¤ì¤é¤Ï¤½¤ì¤¾¤ì¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¼«¿È¤È¤½¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤¹¤ë¡£ + +¥Ñ¥¹²ò·è²áÄø¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥¨¥ó¥È¥ê¤¬ÊªÍýŪ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë +¼ÂºÝ¤Ë¸ºß¤¹¤ë¤«Èݤ«¤Ë´Ø¤ï¤é¤º¡¢´·½¬Åª¤Ê°ÕÌ£¤ò»ý¤Ä¤È²¾Äꤹ¤ë¡£ + +¥ë¡¼¥È¤è¤ê¾å¤Ëé¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤: "/.." ¤Ï "/" ¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.SS "¥Þ¥¦¥ó¥È°ÌÃÖ" +"mount dev path" ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤¿¸å¡¢ +¥Ñ¥¹Ì¾ "path" ¤Ï¥Ç¥Ð¥¤¥¹ "dev" ¾å¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à³¬ÁؤΠ+¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¡¢°ÊÁ°¤Î°ÌÃÖ¤ò»²¾È¤·¤Ê¤¤¡£ + +¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î³°¤Ë½Ð¤ë¤³¤È¤¬¤Ç¤­¤ë: +"path/.." ¤Ï "dev" ¾å¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à³¬Áؤγ°¤Ç¤¢¤ë +"path" ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤¹¤ë¡£ +.SS "ËöÈø¤Î¥¹¥é¥Ã¥·¥å" +¥Ñ¥¹Ì¾¤¬ \(aq/\(aq ¤Ç½ª¤ï¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¥¹¥Æ¥Ã¥× 2 ¤Ë¤ª¤¤¤Æ¡¢¤½¤ÎÁ°¤Ë¤¢¤ë¹½À®Í×ÁǤβò·èË¡¤ò¼¡¤Î¤è¤¦¤Ë¶¯À©¤¹¤ë: +¤½¤Î¹½À®Í×ÁǤ¬Â¸ºß¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤Æ²ò·è¤µ¤ì¤ë¡£ +¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢ËöÈø¤Î \(aq/\(aq ¤¬Ìµ»ë¤µ¤ì¤ë¡£ +(¤Þ¤¿Æ±Íͤˡ¢ËöÈø¤Ë \(aq/\(aq ¤¬¤¢¤ë¥Ñ¥¹Ì¾¤Ï¡¢ +\(aq.\(aq ¤òËöÈø¤Ë²Ã¤¨¤ÆÆÀ¤é¤ì¤ë¥Ñ¥¹Ì¾¤ÈÅù¤·¤¤¡£) +.SS "ºÇ¸å¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¤È¤­" +¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Î¹½À®Í×ÁǤ¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¡¢ +»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ò¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤È¤¹¤ë¤«¡¢ +¤½¤ÎÆâÍƤˤĤ¤¤Æ¥Ñ¥¹¤ò²ò·è¤·¤¿·ë²Ì¤È¤¹¤ë¤«¤Ï¡¢ +¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë°Í¸¤¹¤ë¡£ +¤¿¤È¤¨¤Ð¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR lstat (2) +¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ËºîÍѤ¹¤ë¡£ +°ìÊý¡¢ +.BR stat (2) +¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç»Ø¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËºîÍѤ¹¤ë¡£ +.SS "Ťµ¤ÎÀ©¸Â" +¥Ñ¥¹Ì¾¤Ë¤ÏºÇÂ獬¤¢¤ë¡£ +¥Ñ¥¹Ì¾ (¤Þ¤¿¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò²ò·è¤¹¤ë¤È¤­¤ËÆÀ¤é¤ì¤ëÃæ´Ö¥Ñ¥¹Ì¾) ¤¬ +Ť¹¤®¤ë¾ì¹ç¡¢ +.B ENAMETOOLONG +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë ("File name too long")¡£ +.SS "¶õ¤Î¥Ñ¥¹Ì¾" +¸µ¡¹¤Î Unix ¤Ç¤Ï¡¢¶õ¤Î¥Ñ¥¹Ì¾¤Ï¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤¿¡£ +ºÇ¶á¡¢POSIX ¤Ç¤Ï¶õ¤Î¥Ñ¥¹Ì¾¤ò²ò·è¤¹¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¤È¤¤¤¦·èÄ꤬¤Ê¤µ¤ì¤¿¡£ +¤³¤Î¾ì¹ç¡¢Linux ¤Ï +.B ENOENT +¤òÊÖ¤¹¡£ +.SS "µö²Ä" +¥Õ¥¡¥¤¥ë¤Îµö²Ä¥Ó¥Ã¥È¤Ï¡¢3 ÁȤΠ3 ¥Ó¥Ã¥È¤«¤é¹½À®¤µ¤ì¤ë¡£ +.BR chmod (1) +¤È +.BR stat (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤¬¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô ID ¤ÈÅù¤·¤¤¾ì¹ç¡¢ +3 ¤Ä¤Î¤¦¤ÁºÇ½é¤Î¥°¥ë¡¼¥×¤¬»È¤ï¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥× ID ¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤Þ¤¿¤Ï +.RB ( setgroups (2) +¤ÇÀßÄꤵ¤ì¤ë) ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÊä½õ (supplementary) ¥°¥ë¡¼¥× ID ¤È +Åù¤·¤¤¾ì¹ç¡¢3 ¤Ä¤Î¤¦¤Á 2 ÈÖÌܤΥ°¥ë¡¼¥×¤¬»È¤ï¤ì¤ë¡£ +¤É¤Á¤é¤Ë¤âÅö¤Æ¤Ï¤Þ¤é¤Ê¤¤¾ì¹ç¡¢3 ÈÖÌܤΥ°¥ë¡¼¥×¤¬»È¤ï¤ì¤ë¡£ + +3 ¥Ó¥Ã¥È¤¬»È¤ï¤ì¤ë¾ì¹ç¡¢ºÇ½é¤Î¥Ó¥Ã¥È¤ÏÆɤ߹þ¤ßµö²Ä¤ò·èÄꤷ¡¢ +2 ÈÖÌܤΥӥåȤϽñ¤­¹þ¤ßµö²Ä¤ò·èÄꤹ¤ë¡£ +¤Þ¤¿ 3 ÈÖÌܤΥӥåȤϡ¢Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¼Â¹Ôµö²Ä¤òɽ¤·¡¢ +¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¤Ï¸¡º÷µö²Ä¤òɽ¤¹¡£ + +Linux ¤Ï¡¢µö²Ä¤Î¥Á¥§¥Ã¥¯¤Ë¤ª¤¤¤Æ¡¢¼Â¸ú¥æ¡¼¥¶ ID ¤Ç¤Ï¤Ê¤¯ fsuid ¤ò»È¤¦¡£ +Ä̾ï¤Ï fsuid ¤Ï¼Â¸ú¥æ¡¼¥¶ ID ¤ÈÅù¤·¤¤¤¬¡¢fsuid ¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR setfsuid (2) +¤ÇÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +(¤³¤³¤Ç "fsuid" ¤Ï "file system user ID" ¤òɽ¤·¤Æ¤¤¤ë¡£ +¤³¤Î³µÇ°¤Ï¡Ö¥×¥í¥»¥¹¤¬Æ±¤¸¼Â¸ú¥æ¡¼¥¶ ID ¤ò»ý¤Ä¥×¥í¥»¥¹¤Ë +Ʊ»þ¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡×¤È¤¤¤¦¥æ¡¼¥¶¶õ´Ö NFS ¥µ¡¼¥Ð¤ò +¼ÂÁõ¤¹¤ëºÝ¤ËɬÍפǤ¢¤Ã¤¿¡£ +¤³¤ì¤Ïº£¤Ç¤ÏÇѤì¤Æ¤·¤Þ¤Ã¤¿¡£ +.BR setfsuid (2) +¤ò»È¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ + +ƱÍͤˡ¢Linux ¤Ç¤Ï¼Â¸ú¥°¥ë¡¼¥× ID ¤ÎÂå¤ï¤ê¤Ë +fsgid ("¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥°¥ë¡¼¥×ID") ¤ò»È¤¦¡£ +.BR setfsgid (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.\" FIXME say something about file system mounted read-only ? +.SS "µö²Ä¤Î³Îǧ¤ò¥¹¥­¥Ã¥×¤¹¤ë: ¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤È¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£" +ÅÁÅýŪ¤Ê Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶ +.RI ( root , +¥æ¡¼¥¶ ID 0) ¤ÏÈó¾ï¤Ë¶¯ÎϤǤ¢¤ê¡¢¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹»þ¤Î +µö²Ä¤Ë¤è¤ëÀ©¸Â¤òÁ´¤Æ¥¹¥­¥Ã¥×¤¹¤ë¡£ +.\" (but for exec at least one x bit must be set) -- AEB +.\" but there is variation across systems on this point: for +.\" example, HP-UX and Tru64 are as described by AEB. However, +.\" on some implementations (e.g., Solaris, FreeBSD), +.\" access(X_OK) by superuser will report success, regardless +.\" of the file's execute permission bits. -- MTK (Oct 05) + +Linux ¤Ç¤Ï¡¢¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¸¢¸Â¤¬Ê£¿ô¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ëʬ³ä¤µ¤ì¤Æ¤¤¤ë +.RB ( capabilities (7) +»²¾È)¡£¥Õ¥¡¥¤¥ë¤Îµö²Ä¤Î³Îǧ¤Ë¤Ï¡¢ +.B CAP_DAC_OVERRIDE +¤È +.B CAP_DAC_READ_SEARCH +¤Î 2¤Ä¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬´Ø·¸¤¹¤ë +(¥×¥í¥»¥¹¤Î fsuid ¤¬ 0 ¤Î¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¤Ï¤³¤ì¤é¤Î¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä)¡£ + +.B CAP_DAC_OVERRIDE +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ÏÁ´¤Æ¤Îµö²Ä¥Á¥§¥Ã¥¯¤ò¾å½ñ¤­¤¹¤ë¡£ +¼ÂºÝ¤Ë¤Ï¡¢ÂоݤȤʤë¥Õ¥¡¥¤¥ë¤Î 3 ¤Ä¤Î¼Â¹Ôµö²Ä¥Ó¥Ã¥È¤Î¤¦¤Á¤Î +¾¯¤Ê¤¯¤È¤â 1 ¤Ä¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢¼Â¹Ô¤òµö²Ä¤¹¤ë¤À¤±¤Ç¤¢¤ë¡£ + +.B CAP_DAC_READ_SEARCH +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤ÆÆɤ߹þ¤ß¤È¸¡º÷¤òµö²Ä¤·¡¢ +Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤ÆÆɤ߹þ¤ß¤òµö²Ä¤¹¤ë¡£ +.\" FIXME say something about immutable files +.\" FIXME say something about ACLs +.SH ´ØÏ¢¹àÌÜ +.BR readlink (2), +.BR capabilities (7), +.BR credentials (7), +.BR symlink (7) diff --git a/release/man7/pipe.7 b/release/man7/pipe.7 new file mode 100644 index 00000000..5f9dd83a --- /dev/null +++ b/release/man7/pipe.7 @@ -0,0 +1,248 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2005 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) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-12-26, Akihiro MOTOKI +.\" +.TH PIPE 7 2005-12-08 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +pipe \- ¥Ñ¥¤¥×¤È FIFO ¤Î³µÍ× +.SH ÀâÌÀ +¥Ñ¥¤¥×¤È FIFO (̾Á°ÉÕ¤­¥Ñ¥¤¥×¤È¤â¤¤¤¦) ¤Ï¡¢ +ñÊý¸þ¤Î¥×¥í¥»¥¹´ÖÄÌ¿®¥Á¥ã¥Í¥ë¤òÄ󶡤¹¤ë¡£ +¥Ñ¥¤¥×¤Ë¤Ï¡ÖÆɤ߽Ф·Â¦¡×¤È¡Ö½ñ¤­¹þ¤ß¦¡×¤¬¤¢¤ë¡£ +¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤Ç½ñ¤­¹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤Ï¡¢ +¥Ñ¥¤¥×¤ÎÆɤ߽Ф·Â¦¤«¤éÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ + +¥Ñ¥¤¥×¤òºîÀ®¤¹¤ë¤Ë¤Ï +.BR pipe (2) +¤ò»ÈÍѤ¹¤ë¡£ +.BR pipe (2) +¤Ï¿·¤·¤¤¥Ñ¥¤¥×¤òºîÀ®¤·¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÆó¤ÄÊÖ¤¹¡£ +¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¦¤Á¡¢°ìÊý¤Ï¥Ñ¥¤¥×¤ÎÆɤ߽Ф·Â¦¤ò¡¢¤â¤¦°ìÊý¤Ï +½ñ¤­¹þ¤ß¦¤ò»²¾È¤·¤Æ¤¤¤ë¡£ +¥Ñ¥¤¥×¤Ï´ØÏ¢¤¹¤ë¥×¥í¥»¥¹´Ö¤ÎÄÌ¿®¤òºîÀ®¤¹¤ë¤Î¤Ë»ÈÍѤǤ­¤ë¡£ +Îã¤Ï +.BR pipe (2) +¤ò»²¾È¡£ + +FIFO (First In First Out ¤Î¾Êά) ¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Î̾Á°¤ò»ý¤Á¡¢ +.BR open (2) +¤ò»È¤Ã¤Æ¥ª¡¼¥×¥ó¤Ç¤­¤ë +.RB ( mkfifo (3) +¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤ë)¡£ +¤É¤ó¤Ê¥×¥í¥»¥¹¤Ç¤â¡¢¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹µö²Ä¤¬¤¢¤ì¤Ð FIFO ¤ò¥ª¡¼¥×¥ó¤¹¤ë +¤³¤È¤¬¤Ç¤­¤ë¡£ +Æɤ߽Ф·Â¦¤ò¥ª¡¼¥×¥ó¤¹¤ë¤Ë¤Ï +.B O_RDONLY +¥Õ¥é¥°¤ò»ÈÍѤ·¡¢½ñ¤­¹þ¤ß¦¤ò¥ª¡¼¥×¥ó¤¹¤ë¤Ë¤Ï +.B O_WRONLY +¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¡£¾ÜºÙ¤Ï +.BR fifo (7) +¤ò»²¾È¡£ +¡ÚÃí°Õ¡Û +FIFO ¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î¥Ñ¥¹Ì¾¤ò»ý¤Ä¤¬¡¢ +FIFO ¤ËÂФ·¤ÆÆþ½ÐÎϤò¹Ô¤Ã¤Æ¤â¡¢(¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬Â¸ºß¤¹¤ë¥Ç¥Ð¥¤¥¹¤¬ +¤¢¤Ã¤¿¤È¤·¤Æ¤â) ¤½¤Î¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ëÁàºî¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.SS "¥Ñ¥¤¥×¤ä FIFO ¤ËÂФ¹¤ëÆþ½ÐÎÏ" +¥Ñ¥¤¥×¤È FIFO ¤Î°ã¤¤¤ÏºîÀ®¤ä¥ª¡¼¥×¥ó¤ÎÊýË¡¤À¤±¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤ÎÁàºî¤¬´°Î»¤·¤¿¸å¤Ï¡¢¥Ñ¥¤¥×¤È FIFO ¤ËÂФ¹¤ëÆþ½ÐÎÏ¤Ï +Á´¤¯Æ±¤¸»ÅÁȤߤǹԤï¤ì¤ë¡£ + +¥×¥í¥»¥¹¤¬¶õ¤Î¥Ñ¥¤¥×¤«¤éÆɤ߽Ф·¤ò¹Ô¤ª¤¦¤È¤·¤¿¾ì¹ç¡¢ +.BR read (2) +¤Ï¥Ç¡¼¥¿¤¬Æɤ߽Ф·²Äǽ¤Ë¤Ê¤ë¤Þ¤ÇÄä»ß¤¹¤ë¡£ +¥×¥í¥»¥¹¤¬¥Õ¥ë¾õÂ֤Υѥ¤¥×¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤ª¤¦¤È¤·¤¿¾ì¹ç¡¢ +.BR write (2) +¤Ï½ñ¤­¹þ¤ß¤ò´°Î»¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÎ̤Υѥ¤¥×¤«¤é¤ÎÆɤ߽Ф·¤¬ +¹Ô¤ï¤ì¤ë¤Þ¤ÇÄä»ß¤¹¤ë¡£ +ÈóÄä»ß (nonblocking) I/O ¤ò»È¤¦¤³¤È¤â¤Ç¤­¤ë¡£ +ÈóÄä»ß I/O ¤ò»È¤¦¤Ë¤Ï¡¢ +.BR fcntl (2) +.B F_SETFL +Áàºî¤ò»È¤Ã¤Æ¡¢ +.B O_NONBLOCK +¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤òÍ­¸ú¤Ë¤¹¤ë¡£ + +¥Ñ¥¤¥×¤Ë¤è¤êÄ󶡤µ¤ì¤ëÄÌ¿®¥Á¥ã¥Í¥ë¤Ï¡Ö¥Ð¥¤¥È¥¹¥È¥ê¡¼¥à¡×¤Ç¤¢¤ê¡¢ +¥á¥Ã¥»¡¼¥¸¶­³¦¤Î³µÇ°¤Ï¤Ê¤¤¡£ + +¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤ò»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +¤¹¤Ù¤Æ¥¯¥í¡¼¥º¤µ¤ì¤¿¸å¤Ç¡¢¤½¤Î¥Ñ¥¤¥×¤«¤é +.BR read (2) +¤ò¹Ô¤ª¤¦¤È¤·¤¿¾ì¹ç¡¢ +end-of-file (¥Õ¥¡¥¤¥ëËöÈø) ¤¬¸«¤¨¤ë +.RB ( read (2) +¤Ï 0 ¤òÊÖ¤¹)¡£ +¥Ñ¥¤¥×¤ÎÆɤ߽Ф·Â¦¤ò»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +¤¹¤Ù¤Æ¥¯¥í¡¼¥º¤µ¤ì¤¿¸å¤Ç¡¢ +.BR write (2) +¤ò¹Ô¤¦¤È¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë +.B SIGPIPE +¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¤³¤Î¥·¥°¥Ê¥ë¤ò̵»ë¤·¤Æ¤¤¤ë¤È¤­¤Ë¤Ï¡¢ +.BR write (2) +¤Ï¥¨¥é¡¼ +.B EPIPE +¤Ç¼ºÇÔ¤¹¤ë¡£ +.BR pipe (2) +¤È +.BR fork (2) +¤ò»ÈÍѤ¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +.BR close (2) +¤òŬÀڤ˻ȤäÆÉÔɬÍפʥե¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÊ£À½¤ò +¥¯¥í¡¼¥º¤¹¤Ù¤­¤Ç¤¢¤ë¡£¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢É¬Íפʻþ¤Ë³Î¼Â¤Ë +end-of-file ¤ä +.BR SIGPIPE / EPIPE +¤¬ÇÛÁ÷¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + +¥Ñ¥¤¥×¤Ë¤Ï +.BR lseek (2) +¤ò¹Ô¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.SS ¥Ñ¥¤¥×¤ÎÍÆÎÌ +¥Ñ¥¤¥×¤ÎÍÆÎ̤ˤϾå¸Â¤¬¤¢¤ë¡£ +¥Ñ¥¤¥×¤¬¥Õ¥ë¤Î¾ì¹ç¡¢ +.BR write (2) +¤ÏÄä»ß¤·¤¿¤ê¼ºÇÔ¤·¤¿¤ê¤¹¤ë¡£¤É¤Á¤é¤Ë¤Ê¤ë¤«¤Ï +.B O_NONBLOCK +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ë°Í¸¤¹¤ë (²¼µ­»²¾È)¡£ +¼ÂÁõ¤Ë¤è¤ê¡¢¥Ñ¥¤¥×¤ÎÍÆÎ̤ξå¸Â¤Ï°Û¤Ê¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÏÆÃÄê¤ÎÍÆÎ̤òÁ°Äó¤Ë¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +½ñ¤­¹þ¤ß¦¤Î¥×¥í¥»¥¹¤¬Ää»ß¤·¤¿¤Þ¤Þ¤Ë¤Ê¤é¤Ê¤¤¤è¤¦¡¢ +Æɤ߽Ф·Â¦¤Î¥×¥í¥»¥¹¤Ï¥Ç¡¼¥¿¤¬ÍøÍѲÄǽ¤Ë¤Ê¤Ã¤¿¤é¤Ç¤­¤ë¤À¤±¤¹¤°¤Ë +Æɤ߽Ф·¤ò¹Ô¤¦¤è¤¦¤Ë¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òÀ߷פ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +¥Ð¡¼¥¸¥ç¥ó 2.6.11 ¤è¤êÁ°¤Î Linux ¤Ç¤Ï¥Ñ¥¤¥×¤ÎÍÆÎ̤ϥ·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º +¤ÈƱ¤¸¤Ç¤¢¤Ã¤¿ (Î㤨¤Ð i386 ¤Ç¤Ï 4096 ¥Ð¥¤¥È)¡£ +Linux 2.6.11 °Ê¹ß¤Ç¤Ï¡¢¥Ñ¥¤¥×¤ÎÍÆÎÌ¤Ï 65536 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +.SS PIPE_BUF +POSIX.1-2001 ¤Ç¤Ï¡¢ +.B PIPE_BUF +¥Ð¥¤¥È°Ê²¼¤Î +.BR write (2) +¤Ï atomic ¤Ë¹Ô¤ï¤ì¤ë¤³¤È¡¢¤Ä¤Þ¤ê¥Ñ¥¤¥×¤Ø¤Î½ÐÎϥǡ¼¥¿¤Î½ñ¤­¹þ¤ß¤Ï +Ϣ³¤·¤¿¥·¡¼¥±¥ó¥¹¤È¤·¤Æ¹Ô¤ï¤ì¤ë¤³¤È¤òɬ¿Ü¤È¤·¤Æ¤¤¤ë (MUST)¡£ +.B PIPE_BUF +¥Ð¥¤¥È¤è¤ê¿¤¯¤Î¥Ç¡¼¥¿¤ò½ñ¤­¹þ¤ß¾ì¹ç¤Ï atomic ¤È¤Ï¤Ê¤é¤Ê¤¤¡¢ +¤Ä¤Þ¤ê¥Ñ¥¤¥×¤Ø¤Î¾¤Î¥×¥í¥»¥¹¤Ë¤è¤ë¥Ç¡¼¥¿¤Î½ñ¤­¹þ¤ß¤¬´Ö¤ËÆþ¤ë +²ÄǽÀ­¤¬¤¢¤ë¡£ +POSIX.1-2001 ¤Î»ÅÍͤǤϡ¢ +.B PIPE_BUF +¤ÏºÇ¾®¤Ç¤â 512 ¥Ð¥¤¥È¤Ç¤¢¤ë¤³¤È¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë +(Linux ¤Ç¤Ï +.B PIPE_BUF +¤Ï 4096 ¥Ð¥¤¥È¤Ç¤¢¤ë)¡£ +Àµ³Î¤ÊÆ°ºî¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ nonblocking +.RB ( O_NONBLOCK ) +¤«¤É¤¦¤«¡¢¥Ñ¥¤¥×¤Ø¤Î½ñ¤­¹þ¤ß¤¬Ê£¿ô¤«¤é¹Ô¤ï¤ì¤ë¤«¤É¤¦¤«¡¢¤ª¤è¤Ó +½ñ¤­¹þ¤ß¤ò¹Ô¤¦¥Ð¥¤¥È¿ô +.I n +¤Ë¤è¤ê·èÄꤵ¤ì¤ë¡£ +.TP +\fBO_NONBLOCK\fP ̵¸ú, \fIn\fP <= \fBPIPE_BUF\fP +.I n +¥Ð¥¤¥ÈÁ´Éô¤Î½ñ¤­¹þ¤ß¤¬ atomic ¤Ë¹Ô¤ï¤ì¤ë¡£ +.I n +¥Ð¥¤¥Èʬ¤ò¤¹¤°¤Ë½ñ¤­¹þ¤à;ÃϤ¬¤Ê¤¤¾ì¹ç¤Ï +.BR write (2) +¤ÏÄä»ß (block) ¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +\fBO_NONBLOCK\fP Í­¸ú, \fIn\fP <= \fBPIPE_BUF\fP +¥Ñ¥¤¥×¤Ë +.I n +¥Ð¥¤¥È¤ò½ñ¤­¹þ¤à;ÃϤ¬¤¢¤ë¾ì¹ç¤Ï¡¢ +.I n +¥Ð¥¤¥ÈÁ´Éô¤¬¤¹¤°¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +;ÃϤ¬¤Ê¤¤¾ì¹ç¤Ï¡¢ +.BR write (2) +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.TP +\fBO_NONBLOCK\fP ̵¸ú, \fIn\fP > \fBPIPE_BUF\fP +½ñ¤­¹þ¤ß¤Ï atomic ¤È¤Ï¤Ê¤é¤Ê¤¤¡£ +.BR write (2) +¤ËÅϤµ¤ì¤¿¥Ç¡¼¥¿¤Î´Ö¤Ë¡¢Â¾¤Î¥×¥í¥»¥¹¤Ë¤è¤ê +.BR write (2) +¤µ¤ì¤¿¥Ç¡¼¥¿¤¬Æþ¤ë¤³¤È¤¬¤¢¤ë¡£ +.BR write (2) +¤Ï +.I n +¥Ð¥¤¥È¤Î½ñ¤­¹þ¤ß¤¬´°Î»¤¹¤ë¤Þ¤ÇÄä»ß¤¹¤ë¡£ +.TP +\fBO_NONBLOCK\fP Í­¸ú, \fIn\fP > \fBPIPE_BUF\fP +¥Ñ¥¤¥×¤¬¥Õ¥ë¤Î¾ì¹ç¡¢ +.BR write (2) +¤Ï¼ºÇÔ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢1 ¥Ð¥¤¥È°Ê¾å +.I n +¥Ð¥¤¥È°Ê²¼¤Î¥Ç¡¼¥¿¤¬½ñ¤­¹þ¤Þ¤ì¤ë +(¤Ä¤Þ¤ê¡Ö°ìÉôʬ¤À¤±½ñ¤­¹þ¤Þ¤ì¤ë¡×¾ì¹ç¤â¤¢¤êÆÀ¤ë)¡£ +¸Æ¤Ó½Ð¤·¸µ¤Ï +.BR write (2) +¤ÎÊÖ¤êÃͤò»²¾È¤·¡¢¼ÂºÝ¤Ë²¿¥Ð¥¤¥È½ñ¤­¹þ¤Þ¤ì¤¿¤Î¤«¤ò³Îǧ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤Þ¤¿¡¢½ñ¤­¹þ¤ß¤ËÀ®¸ù¤·¤¿¥Ç¡¼¥¿¤â¡¢Â¾¤Î¥×¥í¥»¥¹¤¬½ñ¤­¹þ¤ó¤À¥Ç¡¼¥¿¤¬ +´Ö¤ËÆþ¤ë¤³¤È¤¬¤¢¤ë¡£ +.SS ¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¾õÂ֥ե饰 +¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¾õÂ֥ե饰¤Î¤¦¤Á¡¢¥Ñ¥¤¥×¤ä FIFO ¤ËÂФ·¤Æ°ÕÌ£¤ò»ý¤Ä¤Î¤Ï +.B O_NONBLOCK +¤È +.B O_ASYNC +¤À¤±¤Ç¤¢¤ë¡£ + +¥Ñ¥¤¥×¤ÎÆɤ߽Ф·Â¦¤Ë +.B O_ASYNC +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢¥Ñ¥¤¥×¤Ë¿·¤¿¤ÊÆþÎϤ¬¤¢¤ë¤È¥·¥°¥Ê¥ë (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +.BR SIGIO ) +¤¬À¸À®¤µ¤ì¤ë (¾ÜºÙ¤Ï +.BR fcntl (2) +¤ò»²¾È)¡£ +Linux ¤Ç¤Ï¡¢ +¥Ñ¥¤¥×¤È FIFO ¤ËÂФ¹¤ë +.B O_ASYNC +¤Ï¥«¡¼¥Í¥ë 2.6 °Ê¹ß¤Ç¤Î¤ß¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SS °Ü¿¢¤Ë´Ø¤¹¤ëÃí°Õ +¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à (Linux ¤Ç¤Ï¤Ê¤¤) ¤Ç¤Ï¡¢¥Ñ¥¤¥×¤ÏÁÐÊý¸þ¤Ç¤¢¤ë¡¢ +¤Ä¤Þ¤ê¥Ñ¥¤¥×¤Îξü´Ö¤Ç¥Ç¡¼¥¿¤òξÊý¸þ¤ËÁ÷¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢¥Ñ¥¤¥×¤Ï°ìÊý¸þ¤ÎÄÌ¿®¤À¤±¤ËÂбþ¤·¤Æ¤¤¤ì¤Ð¤è¤¤¡£ +°Ü¿¢¤ò¹Íθ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ÁÐÊý¸þ¥Ñ¥¤¥×¤Î»ÅÁȤߤò +Á°Äó¤Ë¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR dup (2), +.BR fcntl (2), +.BR open (2), +.BR pipe (2), +.BR poll (2), +.BR select (2), +.BR socketpair (2), +.BR stat (2), +.BR mkfifo (3), +.BR epoll (7), +.BR fifo (7) diff --git a/release/man7/posixoptions.7 b/release/man7/posixoptions.7 new file mode 100644 index 00000000..90c175b9 --- /dev/null +++ b/release/man7/posixoptions.7 @@ -0,0 +1,888 @@ +.\" 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" +.SH ̾Á° +POSIX ɸ½à¤ÎÁªÂò²Äǽ¤ÊÉôʬ +.SH ÀâÌÀ +POSIX ɸ½à (°Ê²¼¤Î¾ðÊó¤Ï POSIX.1-2001 ¤ÎÈ´¿è) ¤Ï +¸ß´¹¥·¥¹¥Æ¥à¤ÎÆ°ºî¤È¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¥»¥Ã¥È¤òµ­½Ò¤·¤Æ¤¤¤ë¡£ +¤·¤«¤·¡¢Â¿¤¯¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÏÁªÂò²Äǽ¤Ç¤¢¤ê¡¢ +¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬»ÈÍѲÄǽ¤«¤ò¥Æ¥¹¥È¤¹¤ëµ¡Ç½¥Æ¥¹¥È¥Þ¥¯¥í¤È¡¢ +¼Â¹Ô»þ¤Ë¥Æ¥¹¥È¤¹¤ë´Ø¿ô +.BR sysconf (3), +.BR fpathconf (3), +.BR pathconf (3), +.BR confstr (3) +¤¬¤¢¤ë¡£ +¥·¥§¥ë¥¹¥¯¥ê¥×¥È¤Ç¤Ï +.BR getconf (1) +¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¾ÜºÙ¤Ï +.BR sysconf (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.LP +POSIX ¾Êά·Á¤Î̾Á°¡¦¥ª¥×¥·¥ç¥ó¡¦¥ª¥×¥·¥ç¥ó¤òÄ´¤Ù¤ë¤¿¤á¤Î +.BR sysconf () +°ú¤­¿ô¤Î̾Á°¡¦(²Äǽ¤Ê¤é¤Ð) Èó¾ï¤Ëû¤¤ÀâÌÀ¤òµ­½Ò¤¹¤ë¡£ +¤è¤êÀµ³Î¤Ê¾ÜºÙ¤Ï POSIX ɸ½à¼«¿È¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ +POSIX ɸ½à¤Ïº£Æü¤Ç¤Ï Web ¤Ç¼«Í³¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.SS "ADV - _POSIX_ADVISORY_INFO - _SC_ADVISORY_INFO" +°Ê²¼¤Î¥¢¥É¥Ð¥¤¥¹¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +¥Ø¥Ã¥À +.I +¤¬Â¸ºß¤¹¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B _POSIX_THREADS +¤È +.B _POSIX_THREAD_SAFE_FUNCTIONS +¥ª¥×¥·¥ç¥ó¤ò°ÅÌÛ¤ÎÆâ¤Ë»ØÄꤹ¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +.\" ¥Ð¥Ã¥Á´Ä¶­ +.\" .SS "CD" +.\" C ¤Ë¤è¤ë³«È¯ +.SS "--- - POSIX_CHOWN_RESTRICTED" +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ê¾ì¹ç (POSIX.1-2001 ¤Ç¤Ï¾ï¤ËÍ­¸ú)¡¢ +root ¤À¤±¤¬¥Õ¥¡¥¤¥ë½êÍ­¼Ô¤ÎÊѹ¹¤òµö¤µ¤ì¡¢ +root °Ê³°¤Ï¥Õ¥¡¥¤¥ë¤Î¥°¥ë¡¼¥×¤ò +¼«Ê¬¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤Î 1 ¤Ä¤ËÀßÄꤹ¤ë¤³¤È¤À¤±¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤Ï°Ê²¼¤Î´Ø¿ô¤Ë±Æ¶Á¤¹¤ë¡£ +.br +.nf +.in +4n + +.IR chown (), +.IR fchown (). +.\" lchown() ¤Ï¤É¤¦¤Ê¤Î¤«? +.in -4 +.br +.fi +.SS "CS - _POSIX_CLOCK_SELECTION - _SC_CLOCK_SELECTION" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B _POSIX_TIMERS +¥ª¥×¥·¥ç¥ó¤ò°ÅÌÛ¤ÎÆâ¤Ë»ØÄꤹ¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.br +.nf +.in +4 + +.IR pthread_condattr_getclock (), +.IR pthread_condattr_setclock (), +.IR clock_nanosleep (). + +.in -4 +.br +.fi +.B CLOCK_REALTIME +¤¬´Ø¿ô +.IR clock_settime () +¤ÇÊѹ¹¤µ¤ì¤¿¾ì¹ç¡¢ÀäÂлþ´Ö¤Ë´Ø·¸¤¹¤ëÁ´¤Æ¤Î¥¿¥¤¥Þ¤Î¥»¥Ã¥È¤Ë±Æ¶Á¤¹¤ë¡£ +.SS "CPT - _POSIX_CPUTIME - _SC_CPUTIME" +clockID CLOCK_PROCESS_CPUTIME_ID ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥¯¥í¥Ã¥¯¤Î½é´üÃͤϡ¢³Æ¥×¥í¥»¥¹Ëè¤Ë 0 ¤È¤Ê¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B _POSIX_TIMERS +¥ª¥×¥·¥ç¥ó¤ò°ÅÌÛ¤ÎÆâ¤Ë»ØÄꤹ¤ë¡£ +´Ø¿ô +.IR clock_getcpuclockid () +¤¬Â¸ºß¤¹¤ë¡£ +.\" .SS "FD" +.\" Fortran ¤Ë¤è¤ë³«È¯ +.\" .SS "FR" +.\" Fortran ¥é¥ó¥¿¥¤¥à +.SS "--- - _POSIX_FILE_LOCKING - _SC_FILE_LOCKING" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ïºï½ü¤µ¤ì¤¿¡£XPG6 ºÇ½ªÈǤˤϤʤ¤¡£ +.SS "FSC - _POSIX_FSYNC - _SC_FSYNC " +´Ø¿ô +.IR fsync () +¤¬Â¸ºß¤¹¤ë¡£ +.SS "IP6 - _POSIX_IPV6 - _SC_IPV6" +Internet Protocol Version 6 ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SS "--- - _POSIX_JOB_CONTROL - _SC_JOB_CONTROL" +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ê¾ì¹ç (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" +¶¦Í­¥á¥â¥ê¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤¬Â¸ºß¤¹¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.br +.nf +.in +4n + +.IR mmap (), +.IR msync (), +.IR munmap (). +.in -4 +.br +.fi +.SS "ML - _POSIX_MEMLOCK - _SC_MEMLOCK" +¶¦Í­¥á¥â¥ê¤¬¥³¥¢Æâ¤Ë¥í¥Ã¥¯¤Ç¤­¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.br +.nf +.in +4n + +.IR mlockall (), +.IR munlockall (). +.in -4 +.br +.fi +.SS "MR/MLR - _POSIX_MEMLOCK_RANGE - _SC_MEMLOCK_RANGE" +¤è¤ê¾ÜºÙ¤Ë¡¢ÈϰϤò¥³¥¢Æâ¤Ë¥í¥Ã¥¯¤Ç¤­¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.br +.nf +.in +4n + +.IR mlock (), +.IR munlock (). +.in -4 +.br +.fi +.SS "MPR - _POSIX_MEMORY_PROTECTION - _SC_MEMORY_PROTECTION" +´Ø¿ô +.IR mprotect () +¤¬Â¸ºß¤¹¤ë¡£ +.SS "MSG - _POSIX_MESSAGE_PASSING - _SC_MESSAGE_PASSING" +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤¬Â¸ºß¤¹¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +.B CLOCK_MONOTONIC +¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B _POSIX_TIMERS +¥ª¥×¥·¥ç¥ó¤ò°ÅÌÛ¤ÎÆâ¤Ë»ØÄꤹ¤ë¡£ +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.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" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ïºï½ü¤µ¤ì¤¿¡£XPG6 ºÇ½ªÈǤˤϤʤ¤¡£ +.\" .SS "MX" +.\" IEC 60559 ÉâÆ°¾®¿ôÅÀ¿ô¥ª¥×¥·¥ç¥ó¡£ +.SS "--- - _POSIX_NO_TRUNC" +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ê¾ì¹ç (POSIX.1-2001 ¤Ç¤Ï¾ï¤ËÍ­¸ú)¡¢ +.B NAME_MAX +¤è¤êŤ¤¥Ñ¥¹Ì¾¤Î¹½À®Í×ÁǤÏÀÚ¤êµÍ¤á¤é¤ì¤Ê¤¤¤¬¡¢¥¨¥é¡¼¤Ë¤Ê¤ë¡£ +¤³¤ÎÀßÄê¤Ï¹½À®Í×ÁǤΥѥ¹ÀÜƬ¼­¤Ë°Í¸¤¹¤ë¾ì¹ç¤â¤¢¤ë¡£ +.SS "PIO - _POSIX_PRIORITIZED_IO - _SC_PRIORITIZED_IO" +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÏÈóƱ´ü I/O ¤ÎÍ¥ÀèÅÙ¤¬»ØÄê¤Ç¤­¤ë¤³¤È¤òɽ¤¹¡£ +¤³¤ì¤Ï°Ê²¼¤Î´Ø¿ô¤Ë±Æ¶Á¤¹¤ë¡£ +.br +.nf +.in +4 + +.IR aio_read (), +.IR aio_write (). +.in -4 +.fi +.SS "PS - _POSIX_PRIORITY_SCHEDULING - _SC_PRIORITY_SCHEDULING" +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤¬Â¸ºß¤¹¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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 +.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" +raw ¥½¥±¥Ã¥È¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.br +.nf +.in +4n + +.IR getsockopt (), +.IR setsockopt (). +.in -4 +.br +.fi +.SS "--- - _POSIX_READER_WRITER_LOCKS - _SC_READER_WRITER_LOCKS" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B _POSIX_THREADS +¥ª¥×¥·¥ç¥ó¤ò°ÅÌÛ¤ÎÆâ¤Ë»ØÄꤹ¤ë¡£ +µÕ¤Ë POSIX.1-2001 ¤Ç¤Ï +.B _POSIX_THREADS +¥ª¥×¥·¥ç¥ó¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤ò°ÅÌÛ¤ÎÆâ¤Ë»ØÄꤹ¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.br +.nf +.in +4 + +.IR sigqueue (), +.IR sigtimedwait (), +.IR sigwaitinfo (). +.br +.in -4 +.fi +.SS "--- - _POSIX_REGEXP - _SC_REGEXP" +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ê¾ì¹ç (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 ¤ò»ý¤Ä¡£ +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.br +.nf +.in +4 + +.IR exec (), +.IR kill (), +.IR seteuid (), +.IR setegid (), +.IR setgid (), +.IR setuid (). +.br +.in -4 +.fi +.\" .SS "SD" +.\" Software ³«È¯ +.SS "SEM - _POSIX_SEMAPHORES - _SC_SEMAPHORES" +¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤¬Â¸ºß¤¹¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.br +.nf +.in +4 + +.IR mmap (), +.IR munmap (), +.IR shm_open (), +.IR shm_unlink (). +.br +.in -4 +.fi +.SS "--- - _POSIX_SHELL - _SC_SHELL" +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ê¾ì¹ç (POSIX.1-2001 ¤Ç¤Ï¾ï¤ËÍ­¸ú)¡¢´Ø¿ô +.IR system () +¤¬Â¸ºß¤¹¤ë¡£ +.SS "SPN - _POSIX_SPAWN - _SC_SPAWN" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢Î㤨¤Ð MMU ¤¬Â¸ºß¤·¤Ê¤¤¤Ê¤É¤ÎÍýͳ¤Ë¤è¤Ã¤Æ¡¢ +.IR fork () +¤ò»ÈÍѤ¹¤ë¤³¤È¤¬Æñ¤·¤¤¤«ÉÔ²Äǽ¤È¤¤¤¦¾õ¶·¤Ç¡¢ +¥×¥í¥»¥¹À¸À®¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤³¤È¤òɽ¤¹¡£ +.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 +.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" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B _POSIX_THREADS +¤È +.B _POSIX_THREAD_SAFE_FUNCTIONS +¥ª¥×¥·¥ç¥ó¤ò°ÅÌÛ¤ÎÆâ¤Ë»ØÄꤹ¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥Ý¥ê¥·¡¼ +.B SCHED_SPORADIC +¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B _POSIX_PRIORITY_SCHEDULING +¥ª¥×¥·¥ç¥ó¤ò°ÅÌÛ¤ÎÆâ¤Ë»ØÄꤹ¤ë¡£ +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.br +.nf +.in +4 + +.IR sched_setparam (), +.IR sched_setscheduler (). +.in -4 +.br +.fi +.SS "SIO - _POSIX_SYNCHRONIZED_IO - _SC_SYNCHRONIZED_IO" +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.IR open (), +.IR msync (), +.IR fsync (), +.IR fdatasync (). +.SS "TSA - _POSIX_THREAD_ATTR_STACKADDR - _SC_THREAD_ATTR_STACKADDR" +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.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" +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.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" +clockID CLOCK_THREAD_CPUTIME_ID ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B _POSIX_TIMERS +¥ª¥×¥·¥ç¥ó¤ò°ÅÌÛ¤ÎÆâ¤Ë»ØÄꤹ¤ë¡£ +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.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" +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.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" +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.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" +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ê¾ì¹ç¡¢1 ¤Ä¤Î¥×¥í¥»¥¹Æâ¤Î¸Ä¡¹¤Î¥¹¥ì¥Ã¥É¤ò +¸Ä¡¹¤ÎÍ¥ÀèÅÙ¤Þ¤¿¤Ï¸Ä¡¹¤Î¥¹¥±¥¸¥å¡¼¥é (¤Þ¤¿¤Ï¤½¤ÎξÊý) ¤Ç¼Â¹Ô¤Ç¤­¤ë¡£ +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.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" +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.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" +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.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" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B _POSIX_THREAD_PRIORITY_SCHEDULING +¥ª¥×¥·¥ç¥ó¤ò°ÅÌÛ¤ÎÆâ¤Ë»ØÄꤹ¤ë¡£ +±Æ¶Á¤ò¼õ¤±¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ꡣ +.br +.nf +.in +4 + +.IR sched_getparam (), +.IR sched_setparam (), +.IR sched_setscheduler (). +.in -4 +.br +.fi +.SS "THR - _POSIX_THREADS - _SC_THREADS" +POSIX ¥¹¥ì¥Ã¥É¤Î´ðËÜ¥µ¥Ý¡¼¥È¤¬»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +POSIX ¥È¥ì¡¼¥·¥ó¥° (tracing) ¤¬»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B _POSIX_TRACE +¥ª¥×¥·¥ç¥ó¤ò°ÅÌÛ¤ÎÆâ¤Ë»ØÄꤹ¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î¥È¥ì¡¼¥¹¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B _POSIX_TRACE +¥ª¥×¥·¥ç¥ó¤ò°ÅÌÛ¤ÎÆâ¤Ë»ØÄꤹ¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B _POSIX_TRACE +¥ª¥×¥·¥ç¥ó¤ò°ÅÌÛ¤ÎÆâ¤Ë»ØÄꤹ¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +°Ê²¼¤Î´Ø¿ô¤¬Â¸ºß¤¹¤ë¡£ +.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" +¾ï¤Ë¸ºß¤¹¤ë (¤¿¤Ö¤ó 0 ¤Ç¤¢¤ë)¡£ +Êѹ¹²Äǽ¤ÊÆüìÀ©¸æʸ»ú¤òÀßÄꤹ¤ëÃÍ¡£ +¤³¤ì¤Ë¤è¤êÆüìÀ©¸æʸ»ú¤¬Ìµ¸ú¤Ç¤¢¤ë¤³¤È¤òɽ¤¹¡£ +.SH "XOPEN ³ÈÄ¥" +.BR _XOPEN_CRYPT , +.BR _XOPEN_LEGACY , +.BR _XOPEN_REALTIME , +.BR _XOPEN_REALTIME_THREADS , +.BR _XOPEN_UNIX . +.\" µ­½Ò¤µ¤ì¤ëͽÄê¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sysconf (3), +.BR standards (7) diff --git a/release/man7/pthreads.7 b/release/man7/pthreads.7 new file mode 100644 index 00000000..f4f971c5 --- /dev/null +++ b/release/man7/pthreads.7 @@ -0,0 +1,926 @@ +'\" t +.\" Copyright (c) 2005 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. +.\" +.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-09-06, Akihiro MOTOKI +.\" Updated 2006-04-15, Akihiro MOTOKI, LDP v2.29 +.\" Updated 2007-01-05, Akihiro MOTOKI, LDP v2.43 +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-11-05, Akihiro MOTOKI, LDP v3.12 +.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" Updated 2008-12-26, Akihiro MOTOKI, LDP v3.14 +.\" +.\"WORD: manager thread ´ÉÍý¥¹¥ì¥Ã¥É +.\"WORD: thread group ¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥× +.\"WORD: real-time signal ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë +.\"WORD: non-conformant ɸ½àÈó½àµò¤Î +.\"WORD: alternate signal stack ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯ +.\" +.TH PTHREADS 7 2008-11-18 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +pthreads \- POSIX ¥¹¥ì¥Ã¥É +.SH ÀâÌÀ +POSIX.1 ¤Ï¡¢°ìÈÌ¤Ë POSIX ¥¹¥ì¥Ã¥É¤ä Pthreads ¤È¤·¤ÆÃΤé¤ì¤ë +¥¹¥ì¥Ã¥É¡¦¥×¥í¥°¥é¥ß¥ó¥°¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹·² (´Ø¿ô¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë) +¤òµ¬Äꤷ¤Æ¤¤¤ë¡£°ì¤Ä¤Î¥×¥í¥»¥¹¤ÏÊ£¿ô¤Î¥¹¥ì¥Ã¥É¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¡¢ +Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤ÏƱ¤¸¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¡£ +¤³¤ì¤é¤Î¥¹¥ì¥Ã¥É¤ÏƱ¤¸Âç°è¥á¥â¥ê (¥Ç¡¼¥¿¤È¥Ò¡¼¥×Îΰè) ¤ò¶¦Í­¤¹¤ë¤¬¡¢ +³Æ¥¹¥ì¥Ã¥É¤Ï¼«Ê¬ÀìÍѤΥ¹¥¿¥Ã¥¯ (¼«Æ°ÊÑ¿ô) ¤ò»ý¤Ä¡£ + +POSIX.1 ¤Ï¥¹¥ì¥Ã¥É´Ö¤Ç¤É¤Î¤è¤¦¤Ê°À­¤ò¶¦Í­¤¹¤ë¤«¤Ë¤Ä¤¤¤Æ¤âÄê¤á¤Æ¤¤¤ë +(¤Ä¤Þ¤ê¡¢¤³¤ì¤é¤Î°À­¤Ï¥¹¥ì¥Ã¥Éñ°Ì¤Ç¤Ï¤Ê¤¯¥×¥í¥»¥¹Á´ÂΤǶ¦Ä̤Ǥ¢¤ë): +.IP \- 3 +¥×¥í¥»¥¹ ID +.IP \- 3 +¿Æ¥×¥í¥»¥¹ ID +.IP \- 3 +¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤È¥»¥Ã¥·¥ç¥ó ID +.IP \- 3 +À©¸æüËö +.IP \- 3 +¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥× ID +.IP \- 3 +¥ª¡¼¥×¥ó¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.IP \- 3 +¥ì¥³¡¼¥É¤Î¥í¥Ã¥¯ +.RB ( fcntl (3) +»²¾È) +.IP \- 3 +¥·¥°¥Ê¥ë¤ÎÇÛÃÖ +.IP \- 3 +¥Õ¥¡¥¤¥ë¥â¡¼¥ÉºîÀ®¥Þ¥¹¥¯ +.RB ( umask (2)) +.IP \- 3 +¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê +.RB ( chdir (2)) +¤È¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê +.RB ( chroot (2)) +.IP \- 3 +¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ +.RB ( setitimer (2)) +¤È POSIX ¥¿¥¤¥Þ +.RB ( timer_create (2)) +.IP \- 3 +nice ÃÍ +.RB ( setpriority (2)) +.IP \- 3 +¥ê¥½¡¼¥¹À©¸Â +.RB ( setrlimit (2)) +.IP \- 3 +CPU »þ´Ö +.RB ( times (2)) +¤È¥ê¥½¡¼¥¹ +.RB ( getrusage (2)) +¤Î¾ÃÈñ¾õ¶·¤Î·×¬ +.PP +¥¹¥¿¥Ã¥¯¤Ë¤Ä¤¤¤Æ¤â¡¢POSIX.1 ¤Ï¤É¤Î¤è¤¦¤Ê°À­¤¬ +¸Ä¡¹¤Î¥¹¥ì¥Ã¥É¤ÇÆÈΩ¤Ë´ÉÍý¤µ¤ì¤ë¤«¤òµ¬Äꤷ¤Æ¤¤¤ë: +.IP \- 3 +¥¹¥ì¥Ã¥É ID +.RB ( pthread_t +¥Ç¡¼¥¿·¿) +.IP \- 3 +¥·¥°¥Ê¥ë¥Þ¥¹¥¯ +.RB ( pthread_sigmask (3)) +.IP \- 3 +.I errno +ÊÑ¿ô +.IP \- 3 +ÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯ +.RB ( sigaltstack (2)) +.IP \- 3 +¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Î¥Ý¥ê¥·¡¼¤ÈÍ¥ÀèÅÙ +.RB ( sched_setscheduler (2) +¤È +.BR sched_setparam (2)) +.PP +°Ê²¼¤Î Linux ÆÃÍ­¤Îµ¡Ç½¤â¥¹¥ì¥Ã¥Éñ°Ì¤Ç¤¢¤ë: +.IP \- 3 +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ +.RB ( capabilities (7) +»²¾È) +.IP \- 3 +CPU affinity (¿ÆÏÂÅÙ) +.RB ( sched_setaffinity (2)) +.SS "pthreads ´Ø¿ô¤ÎÊÖ¤êÃÍ" +¤Û¤È¤ó¤É¤Î pthreads ´Ø¿ô¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢ +¼ºÇÔ¤·¤¿¾ì¹ç¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹¡£ +pthreads ´Ø¿ô¤Ï +.I errno +¤ò¥»¥Ã¥È¤·¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢ +¥¨¥é¡¼¤òÊÖ¤¹²ÄǽÀ­¤Î¤¢¤ë pthreads ´Ø¿ô¤¬¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¤Èµ¬Äꤷ¤Æ¤¤¤ë¡£ +.SS "¥¹¥ì¥Ã¥É ID" +¤¢¤ë¥×¥í¥»¥¹Æâ¤Î³Æ¥¹¥ì¥Ã¥É¤Ï +.RI ( pthread_t +·¿¤Î) °ì°Õ¤Ê¥¹¥ì¥Ã¥É¼±Ê̻Ҥò»ý¤Ä¡£ +¤³¤Î¼±Ê̻Ҥϡ¢ +.BR pthread_create (3) +¤Î¸Æ¤Ó½Ð¤·¸µ¤ËÊÖ¤µ¤ì¤ë¡£¤Þ¤¿¡¢¥¹¥ì¥Ã¥É¤Ï¼«¿È¤Î¥¹¥ì¥Ã¥É¼±Ê̻Ҥò +.BR pthread_self (3) +¤ò»È¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£ +¥¹¥ì¥Ã¥É ID ¤Î°ì°ÕÀ­¤¬Êݾڤµ¤ì¤ë¤Î¤Ï¡¢°ì¤Ä¤Î¥×¥í¥»¥¹Æâ¤Ë¤ª¤¤¤Æ¤Î¤ß¤Ç¤¢¤ë¡£ +½ªÎ»¤·¤¿¥¹¥ì¥Ã¥É¤¬ join ¤µ¤ì¤¿¸å¤Ç¤Ï¡¢¥¹¥ì¥Ã¥É ID ¤ÏºÆÍøÍѤµ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¥¹¥ì¥Ã¥É ID ¤ò°ú¤­¿ô¤Ë¼è¤ëÁ´¤Æ¤Î¥¹¥ì¥Ã¥É´Ø¿ô¤Ë¤ª¤¤¤Æ¡¢ +¤½¤Î ID ¤Ï¸Æ¤Ó½Ð¤·¸µ¤ÈƱ¤¸¥×¥í¥»¥¹Æâ¤Î°ì¤Ä¤Î¥¹¥ì¥Ã¥É¤ò»²¾È¤¹¤ë¡£ +.SS "¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ê´Ø¿ô" +¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ê´Ø¿ô¤Ï¡¢Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤«¤éƱ»þ¤Ë¸Æ¤Ó½Ð¤·¤Æ¤â°ÂÁ´¤Ê +(¤¹¤Ê¤ï¤Á¡¢Æ±»þ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿¤«¤Ë´Ø¤ï¤é¤º¡¢Æ±¤¸·ë²Ì¤òÊÖ¤¹) ´Ø¿ô¤Î¤³¤È¤Ç¤¢¤ë¡£ + +POSIX.1-2001 ¤È POSIX.1-2008¤Ç¤Ï¡¢°ìÉô¤ÎÎã³°¤ò½ü¤­¡¢ +ɸ½à¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î´Ø¿ô¤¬¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤¢¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£ +°Ê²¼¤Î´Ø¿ô¤¬Îã³°¤Ç¤¢¤ë¡£ +.in +4n +.nf + +asctime() +basename() +catgets() +crypt() +ctermid() (NULL ¤Ç¤Ê¤¤°ú¤­¿ô¤òÅϤµ¤ì¤¿¾ì¹ç) +ctime() +dbm_clearerr() +dbm_close() +dbm_delete() +dbm_error() +dbm_fetch() +dbm_firstkey() +dbm_nextkey() +dbm_open() +dbm_store() +dirname() +dlerror() +drand48() +ecvt() [POSIX.1-2001 ¤Î¤ß (POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤¿)] +encrypt() +endgrent() +endpwent() +endutxent() +fcvt() [POSIX.1-2001 ¤Î¤ß (POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤¿)] +ftw() +gcvt() [POSIX.1-2001 ¤Î¤ß (POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤¿)] +getc_unlocked() +getchar_unlocked() +getdate() +getenv() +getgrent() +getgrgid() +getgrnam() +gethostbyaddr() [POSIX.1-2001 ¤Î¤ß (POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤¿)] +gethostbyname() [POSIX.1-2001 ¤Î¤ß (POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤¿)] +gethostent() +getlogin() +getnetbyaddr() +getnetbyname() +getnetent() +getopt() +getprotobyname() +getprotobynumber() +getprotoent() +getpwent() +getpwnam() +getpwuid() +getservbyname() +getservbyport() +getservent() +getutxent() +getutxid() +getutxline() +gmtime() +hcreate() +hdestroy() +hsearch() +inet_ntoa() +l64a() +lgamma() +lgammaf() +lgammal() +localeconv() +localtime() +lrand48() +mrand48() +nftw() +nl_langinfo() +ptsname() +putc_unlocked() +putchar_unlocked() +putenv() +pututxline() +rand() +readdir() +setenv() +setgrent() +setkey() +setpwent() +setutxent() +strerror() +strsignal() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +strtok() +system() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +tmpnam() (NULL ¤Ç¤Ê¤¤°ú¤­¿ô¤òÅϤµ¤ì¤¿¾ì¹ç) +ttyname() +unsetenv() +wcrtomb() (ºÇ¸å¤Î°ú¤­¿ô¤¬ NULL ¤Î¾ì¹ç) +wcsrtombs() (ºÇ¸å¤Î°ú¤­¿ô¤¬ NULL ¤Î¾ì¹ç) +wcstombs() +wctomb() +.fi +.in +.SS ¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È (cancellation points) +POSIX.1 ¤Îµ¬Äê¤Ç¤Ï¡¢ÆÃÄê¤Î´Ø¿ô¤Ï¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¾¤ÎÆÃÄê¤Î´Ø¿ô¤Ï¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¤È¤µ¤ì¤Æ¤¤¤ë¡£ +¤¢¤ë¥¹¥ì¥Ã¥É¤¬¼è¤ê¾Ã¤·²Äǽ¤Ç¡¢¤½¤Î¼è¤ê¾Ã¤·¼ïÊÌ (cancelability type) +¤¬±ä´ü (deferred) ¤Ç¡¢¤½¤Î¥¹¥ì¥Ã¥É¤ËÂФ¹¤ë¼è¤ê¾Ã¤·Í׵᤬½èÍýÂÔ¤Á¤Î¾ì¹ç¡¢ +¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È¤Ç¤¢¤ë´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿»þÅÀ¤Ç¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Î¥­¥ã¥ó¥»¥ë¤¬ +¹Ô¤ï¤ì¤ë¡£ + +POSIX.1-2001 ¤È POSIX.1-2008 ¤ÎξÊý¡¢¤â¤·¤¯¤Ï¤¤¤º¤ì¤«°ìÊý¤Ç¤Ï¡¢ +°Ê²¼¤Î´Ø¿ô¤Ï¡¢¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È (cancellation points) ¤Ç +¤¢¤ë¤³¤È¤¬É¬¿Ü¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ + +.\" FIXME +.\" Document the list of all functions that are cancellation points in glibc +.in +4n +.nf +accept() +aio_suspend() +clock_nanosleep() +close() +connect() +creat() +fcntl() F_SETLKW +fdatasync() +fsync() +getmsg() +getpmsg() +lockf() F_LOCK +mq_receive() +mq_send() +mq_timedreceive() +mq_timedsend() +msgrcv() +msgsnd() +msync() +nanosleep() +open() +openat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +pause() +poll() +pread() +pselect() +pthread_cond_timedwait() +pthread_cond_wait() +pthread_join() +pthread_testcancel() +putmsg() +putpmsg() +pwrite() +read() +readv() +recv() +recvfrom() +recvmsg() +select() +sem_timedwait() +sem_wait() +send() +sendmsg() +sendto() +sigpause() [POSIX.1-2001 only (moves to "may" list in POSIX.1-2008)] +sigsuspend() +sigtimedwait() +sigwait() +sigwaitinfo() +sleep() +system() +tcdrain() +usleep() [POSIX.1-2001 ¤Î¤ß (POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤¿)] +wait() +waitid() +waitpid() +write() +writev() +.fi +.in + +POSIX.1-2001 ¤È POSIX.1-2008 ¤ÎξÊý¡¢¤â¤·¤¯¤Ï¤¤¤º¤ì¤«°ìÊý¤Ç¤Ï¡¢ +°Ê²¼¤Î´Ø¿ô¤Ï¡¢¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È (cancellation points) ¤Ç +¤¢¤Ã¤Æ¤â¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ + +.in +4n +.nf +access() +asctime() +asctime_r() +catclose() +catgets() +catopen() +chmod() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +chown() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +closedir() +closelog() +ctermid() +ctime() +ctime_r() +dbm_close() +dbm_delete() +dbm_fetch() +dbm_nextkey() +dbm_open() +dbm_store() +dlclose() +dlopen() +dprintf() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +endgrent() +endhostent() +endnetent() +endprotoent() +endpwent() +endservent() +endutxent() +faccessat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +fchmod() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +fchmodat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +fchown() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +fchownat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +fclose() +fcntl() (cmd °ú¤­¿ô¤¬²¿¤Ç¤¢¤Ã¤Æ¤â) +fflush() +fgetc() +fgetpos() +fgets() +fgetwc() +fgetws() +fmtmsg() +fopen() +fpathconf() +fprintf() +fputc() +fputs() +fputwc() +fputws() +fread() +freopen() +fscanf() +fseek() +fseeko() +fsetpos() +fstat() +fstatat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +ftell() +ftello() +ftw() +futimens() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +fwprintf() +fwrite() +fwscanf() +getaddrinfo() +getc() +getc_unlocked() +getchar() +getchar_unlocked() +getcwd() +getdate() +getdelim() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +getgrent() +getgrgid() +getgrgid_r() +getgrnam() +getgrnam_r() +gethostbyaddr() [SUSv3 ¤Î¤ß (¤³¤Î´Ø¿ô¤Ï POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤Æ¤¤¤ë)] +gethostbyname() [SUSv3 ¤Î¤ß (¤³¤Î´Ø¿ô¤Ï POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤Æ¤¤¤ë)] +gethostent() +gethostid() +gethostname() +getline() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +getlogin() +getlogin_r() +getnameinfo() +getnetbyaddr() +getnetbyname() +getnetent() +getopt() (opterr ¤¬ 0 °Ê³°¤Î¾ì¹ç) +getprotobyname() +getprotobynumber() +getprotoent() +getpwent() +getpwnam() +getpwnam_r() +getpwuid() +getpwuid_r() +gets() +getservbyname() +getservbyport() +getservent() +getutxent() +getutxid() +getutxline() +getwc() +getwchar() +getwd() [SUSv3 ¤Î¤ß (¤³¤Î´Ø¿ô¤Ï POSIX.1-2008 ¤Çºï½ü¤µ¤ì¤Æ¤¤¤ë)] +glob() +iconv_close() +iconv_open() +ioctl() +link() +linkat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +lio_listio() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +localtime() +localtime_r() +lockf() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +lseek() +lstat() +mkdir() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mkdirat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mkdtemp() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mkfifo() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mkfifoat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mknod() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mknodat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +mkstemp() +mktime() +nftw() +opendir() +openlog() +pathconf() +pclose() +perror() +popen() +posix_fadvise() +posix_fallocate() +posix_madvise() +posix_openpt() +posix_spawn() +posix_spawnp() +posix_trace_clear() +posix_trace_close() +posix_trace_create() +posix_trace_create_withlog() +posix_trace_eventtypelist_getnext_id() +posix_trace_eventtypelist_rewind() +posix_trace_flush() +posix_trace_get_attr() +posix_trace_get_filter() +posix_trace_get_status() +posix_trace_getnext_event() +posix_trace_open() +posix_trace_rewind() +posix_trace_set_filter() +posix_trace_shutdown() +posix_trace_timedgetnext_event() +posix_typed_mem_open() +printf() +psiginfo() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +psignal() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +pthread_rwlock_rdlock() +pthread_rwlock_timedrdlock() +pthread_rwlock_timedwrlock() +pthread_rwlock_wrlock() +putc() +putc_unlocked() +putchar() +putchar_unlocked() +puts() +pututxline() +putwc() +putwchar() +readdir() +readdir_r() +readlink() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +readlinkat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +remove() +rename() +renameat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +rewind() +rewinddir() +scandir() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +scanf() +seekdir() +semop() +setgrent() +sethostent() +setnetent() +setprotoent() +setpwent() +setservent() +setutxent() +sigpause() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +stat() +strerror() +strerror_r() +strftime() +symlink() +symlinkat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +sync() +syslog() +tmpfile() +tmpnam() +ttyname() +ttyname_r() +tzset() +ungetc() +ungetwc() +unlink() +unlinkat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +utime() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +utimensat() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +utimes() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +vdprintf() [POSIX.1-2008 ¤ÇÄɲ䵤줿] +vfprintf() +vfwprintf() +vprintf() +vwprintf() +wcsftime() +wordexp() +wprintf() +wscanf() +.fi +.in + +¼ÂÁõ»þ¤Ë¡¢É¸½àµ¬³Ê¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤½¤Î¾¤Î´Ø¿ô¤ò¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È +¤È¤¹¤ë¤³¤È¤âǧ¤á¤é¤ì¤Æ¤¤¤ë¡£ +Æäˡ¢Ää»ß (block) ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ëÈóɸ½à¤Î´Ø¿ô¤ò¼è¤ê¾Ã¤·¥Ý¥¤¥ó¥È¤È +¤¹¤ë¼ÂÁõ¤Ï¤¢¤êÆÀ¤ë¤³¤È¤À¤í¤¦ +(¥Õ¥¡¥¤¥ë¤ò°·¤¦²ÄǽÀ­¤Î¤¢¤ë¤Û¤È¤ó¤É¤Î´Ø¿ô¤¬¤³¤ì¤Ë´Þ¤Þ¤ì¤ë)¡£ +.\" So, scanning "cancellation point" comments in the glibc 2.8 header +.\" files, it looks as though at least the following nonstandard +.\" functions are cancellation points: +.\" endnetgrent +.\" endspent +.\" epoll_pwait +.\" epoll_wait +.\" fcloseall +.\" fdopendir +.\" fflush_unlocked +.\" fgetc_unlocked +.\" fgetgrent +.\" fgetgrent_r +.\" fgetpwent +.\" fgetpwent_r +.\" fgets_unlocked +.\" fgetspent +.\" fgetspent_r +.\" fgetwc_unlocked +.\" fgetws_unlocked +.\" fputc_unlocked +.\" fputs_unlocked +.\" fputwc_unlocked +.\" fputws_unlocked +.\" fread_unlocked +.\" fwrite_unlocked +.\" gai_suspend +.\" getaddrinfo_a +.\" getdate_r +.\" getgrent_r +.\" getgrouplist +.\" gethostbyaddr_r +.\" gethostbyname2 +.\" gethostbyname2_r +.\" gethostbyname_r +.\" gethostent_r +.\" getnetbyaddr_r +.\" getnetbyname_r +.\" getnetent_r +.\" getnetgrent +.\" getnetgrent_r +.\" getprotobyname_r +.\" getprotobynumber_r +.\" getprotoent_r +.\" getpw +.\" getpwent_r +.\" getservbyname_r +.\" getservbyport_r +.\" getservent_r +.\" getspent +.\" getspent_r +.\" getspnam +.\" getspnam_r +.\" getutmp +.\" getutmpx +.\" getw +.\" getwc_unlocked +.\" getwchar_unlocked +.\" initgroups +.\" innetgr +.\" mkostemp +.\" mkostemp64 +.\" mkstemp64 +.\" ppoll +.\" pthread_timedjoin_np +.\" putgrent +.\" putpwent +.\" putspent +.\" putw +.\" putwc_unlocked +.\" putwchar_unlocked +.\" rcmd +.\" rcmd_af +.\" rexec +.\" rexec_af +.\" rresvport +.\" rresvport_af +.\" ruserok +.\" ruserok_af +.\" setnetgrent +.\" setspent +.\" sgetspent +.\" sgetspent_r +.\" updwtmpx +.\" utmpxname +.\" vfscanf +.\" vfwscanf +.\" vscanf +.\" vsyslog +.\" vwscanf +.SS "Linux ¤Ç¤Î¥³¥ó¥Ñ¥¤¥ë" +Linux ¤Ç¤Ï¡¢Pthreads API ¤òÍѤ¤¤¿¥×¥í¥°¥é¥à¤Ï +.I "cc \-pthread" +¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SS "POSIX ¥¹¥ì¥Ã¥É¤Î Linux ¤Ç¤Î¼ÂÁõ" +¤³¤ì¤Þ¤Ç¡¢2¤Ä¤Î¥¹¥ì¥Ã¥É¤Î¼ÂÁõ¤¬ Linux ¤Î GNU C ¥é¥¤¥Ö¥é¥ê¤Ë¤è¤ê +Ä󶡤µ¤ì¤Æ¤­¤¿¡£ +.TP +.B LinuxThreads +ºÇ½é¤Î Pthreads ¤Î¼ÂÁõ¡£ +glibc 2.4 °Ê¹ß¤Ï¡¢¤³¤Î¼ÂÁõ¤Ï¤â¤Ï¤ä¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.BR NPTL " (Native POSIX Threads Library)" +¿·¤·¤¤ Pthreads ¤Î¼ÂÁõ¡£LinuxThreads ¤ÈÈæ¤Ù¤ë¤È¡¢ +NPTL ¤Ï POSIX.1 ¤ÎÍ×µá»ÅÍͤؤνàµò¤ÎÅٹ礤¤¬¹â¤¯¡¢ +¿¿ô¤Î¥¹¥ì¥Ã¥É¤òºîÀ®¤·¤¿ºÝ¤ÎÀ­Ç½¤â¹â¤¤¡£ +NPTL ¤Ï glibc 2.3.2 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ +NPTL ¤òÍøÍѤ¹¤ë¤Ë¤Ï Linux 2.6 ¥«¡¼¥Í¥ë¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ëµ¡Ç½¤¬É¬ÍפǤ¢¤ë¡£ +.PP +¤É¤Á¤é¤Î¼ÂÁõ¤â¤¤¤ï¤æ¤ë 1:1 ¼ÂÁõ¡¢¤¹¤Ê¤ï¤Á¸Ä¡¹¤Î¥¹¥ì¥Ã¥É¤¬ +¥«¡¼¥Í¥ë¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¼ÂÂΤ˥ޥåԥ󥰤µ¤ì¤ë¡£ +¤É¤Á¤é¤Î¥¹¥ì¥Ã¥É¤Î¼ÂÁõ¤â Linux ¤Î +.BR clone (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍøÍѤ·¤Æ¤¤¤ë¡£ +NPTL ¤Ç¤Ï¡¢¥¹¥ì¥Ã¥ÉƱ´ü¤Î´ðËܵ¡¹½ (mutex ¤ä ¥¹¥ì¥Ã¥É¤Î join Åù) ¤Ï +Linux ¤Î +.BR futex (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£ +.SS LinuxThreads +¤³¤Î¼ÂÁõ¤ÎÂ礭¤ÊÆÃħ¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.IP \- 3 +¥á¥¤¥ó¥¹¥ì¥Ã¥É (ºÇ½é¤Î¥¹¥ì¥Ã¥É) ¤È¥×¥í¥°¥é¥à¤¬ +.BR pthread_create (3) +¤ò»È¤Ã¤ÆºîÀ®¤·¤¿¥¹¥ì¥Ã¥É¤Ë²Ã¤¨¡¢ +¤³¤Î¼ÂÁõ¤Ç¤Ï¡Ö´ÉÍý (manager)¡×¥¹¥ì¥Ã¥É¤¬ºîÀ®¤µ¤ì¤ë¡£ +´ÉÍý¥¹¥ì¥Ã¥É¤Ï¥¹¥ì¥Ã¥É¤ÎºîÀ®¤È½ªÎ»¤ò¼è¤ê°·¤¦ +(¤³¤Î¥¹¥ì¥Ã¥É¤¬¤¦¤Ã¤«¤ê kill ¤µ¤ì¤ë¤È¡¢ÌäÂ꤬µ¯¤³¤ë¤³¤È¤¬¤¢¤ë)¡£ +.IP \- 3 +¤³¤Î¼ÂÁõ¤Ç¤ÏÆâÉô¤Ç¥·¥°¥Ê¥ë¤ò»ÈÍѤ·¤Æ¤¤¤ë¡£ +Linux 2.2 °Ê¹ß¤Ç¤Ï¡¢¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î¤¦¤ÁºÇ½é¤Î 3¤Ä¤¬»È¤ï¤ì¤ë +.RB ( signal (7) +»²¾È)¡£ +¤½¤ì°ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï +.B SIGUSR1 +¤È +.B SIGUSR2 +¤¬»È¤ï¤ì¤ë¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢¥¹¥ì¥Ã¥É¼ÂÁõ¤ÇÍøÍѤµ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤ò +¤É¤ì¤â»È¤ï¤Ê¤¤¤è¤¦¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.IP \- 3 +¥¹¥ì¥Ã¥É´Ö¤Ç¥×¥í¥»¥¹ ID ¤ò¶¦Í­¤·¤Ê¤¤ +(¼ÂºÝ¤Ë¤Ï LinuxThreads ¤Î¥¹¥ì¥Ã¥É¤ÏÄ̾ï¤è¤ê¤Ï¾ðÊó¤ò¶¦Í­¤¹¤ë¥×¥í¥»¥¹¤È¤·¤Æ +¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢°ì¤Ä¤Î¶¦ÄÌ¤Î¥×¥í¥»¥¹ ID ¤ò¶¦Í­¤·¤Æ¤Ï¤¤¤Ê¤¤)¡£ +(´ÉÍý¥¹¥ì¥Ã¥É¤ò´Þ¤à) LinuxThreads ¥¹¥ì¥Ã¥É¤Ï +.BR ps (1) +¤ò»È¤¦¤ÈÊÌ¤Î¥×¥í¥»¥¹¤Î¤è¤¦¤Ë¸«¤¨¤ë¡£ +.PP +LinuxThreads ¤Î¼ÂÁõ¤Ç¤Ï POSIX.1 »ÅÍͤ«¤é°ï椷¤Æ¤¤¤ëÅÀ¤¬ +¤¤¤¯¤Ä¤«¤¢¤ë¡£°Ê²¼¤Ë¼¨¤¹¤è¤¦¤ÊÅÀ¤¬¤¢¤ë: +.IP \- 3 +.BR getpid (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤­¤Ë¡¢¥¹¥ì¥Ã¥ÉËè¤Ë°Û¤Ê¤ëÃͤ¬ÊÖ¤µ¤ì¤ë¡£ +.IP \- 3 +¥á¥¤¥ó¥¹¥ì¥Ã¥É°Ê³°¤Î¥¹¥ì¥Ã¥É¤Ç +.BR getppid (2) +¤ò¸Æ¤Ó½Ð¤¹¤È¡¢´ÉÍý¥¹¥ì¥Ã¥É¤Î¥×¥í¥»¥¹ ID ¤¬ÊÖ¤µ¤ì¤ë¡£ +ËÜÅö¤Ï¡¢¤³¤ì¤é¤Î¥¹¥ì¥Ã¥É¤Ç +.BR getppid (2) +¤ò¸Æ¤ó¤À¾ì¹ç¤Ë¤Ï¥á¥¤¥ó¥¹¥ì¥Ã¥É¤Ç¤Î +.BR getppid (2) +¤ÈƱ¤¸Ãͤ¬ÊÖ¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.IP \- 3 +¤¢¤ë¥¹¥ì¥Ã¥É¤¬ +.BR fork (2) +¤ò»È¤Ã¤Æ¿·¤·¤¤»Ò¥×¥í¥»¥¹¤òºîÀ®¤·¤¿¾ì¹ç¡¢ +¤É¤Î¥¹¥ì¥Ã¥É¤Ç¤â¤³¤Î»Ò¥×¥í¥»¥¹¤ò +.BR wait (2) +¤Ç¤­¤ë¤Ù¤­¤Ç¤¢¤ë¡£¤·¤«¤·¤Ê¤¬¤é¡¢¤³¤Î¼ÂÁõ¤Ç¤Ï»Ò¥×¥í¥»¥¹¤òºîÀ®¤·¤¿ +¥¹¥ì¥Ã¥É¤À¤±¤¬¤³¤Î»Ò¥×¥í¥»¥¹¤ò +.BR wait (2) +¤Ç¤­¤ë¡£ +.IP \- 3 +¤¢¤ë¥¹¥ì¥Ã¥É¤¬ +.BR execve (2) +¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤ÏÁ´¤Æ½ªÎ»¤µ¤ì¤ë (POSIX.1 ¤Î»ÅÍÍÄ̤ê)¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢¿·¤·¤¤¥×¥í¥»¥¹¤Ï +.BR execve (2) +¤ò¸Æ¤ó¤À¥¹¥ì¥Ã¥É¤ÈƱ¤¸ PID ¤ò»ý¤Ä¡£Àµ¤·¤¯¤Ï +¥á¥¤¥ó¥¹¥ì¥Ã¥É¤ÈƱ¤¸ PID ¤ò»ý¤Ä¤Ù¤­¤Ç¤¢¤ë¡£ +.IP \- 3 +¥¹¥ì¥Ã¥É´Ö¤Ç¥æ¡¼¥¶ ID ¤È¥°¥ë¡¼¥× ID ¤¬¶¦Í­¤µ¤ì¤Ê¤¤ +¤³¤Î¤³¤È¤Ï¡¢set-user-ID ¥×¥í¥°¥é¥à¤ÇÌÌÅݤʻöÂÖ¤ò¾·¤¤¤¿¤ê¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ +.BR seteuid (2) +¤Ê¤É¤ò»È¤Ã¤Æ¿®ÍѾðÊó (credentials) ¤òÊѹ¹¤·¤¿¾ì¹ç¤Ë +Pthreads ´Ø¿ô¤¬¼ºÇÔ¤¹¤ë¸¶°ø¤È¤Ê¤ë¡£ +.IP \- 3 +¥¹¥ì¥Ã¥É´Ö¤Ç¶¦Ä̤Υ»¥Ã¥·¥ç¥ó ID ¤ä¥×¥í¥»¥¹¥°¥ë¡¼¥× ID ¤ò¶¦Í­¤·¤Ê¤¤¡£ +.IP \- 3 +¥¹¥ì¥Ã¥É´Ö¤Ç +.BR fcntl (2) +¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤ë¥ì¥³¡¼¥É¡¦¥í¥Ã¥¯¤ò¶¦Í­¤·¤Ê¤¤¡£ +.IP \- 3 +.BR times (2) +¤È +.BR getrusage (2) +¤¬ÊÖ¤¹¾ðÊó¤¬¥×¥í¥»¥¹Á´ÂΤξðÊó¤Ç¤Ê¤¯¥¹¥ì¥Ã¥Éñ°Ì¤Î¾ðÊó¤Ç¤¢¤ë¡£ +.IP \- 3 +¥¹¥ì¥Ã¥É´Ö¤Ç¥»¥Þ¥Õ¥©¤Î¥¢¥ó¥É¥¥ÃÍ +.RB ( semop (2) +»²¾È) ¤ò¶¦Í­¤·¤Ê¤¤¡£ +.IP \- 3 +¥¹¥ì¥Ã¥É´Ö¤Ç¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¤ò¶¦Í­¤·¤Ê¤¤¡£ +.IP \- 3 +¥¹¥ì¥Ã¥É¤Ï¶¦Ä̤Πnice Ãͤò¶¦Í­¤·¤Ê¤¤¡£ +.IP \- 3 +POSXI.1 ¤Ç¤Ï¡¢Á´ÂΤȤ·¤Æ¤Î¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤ë¥·¥°¥Ê¥ë¤È¡¢ +¸ÄÊ̤Υ¹¥ì¥Ã¥É¤ËÁ÷¤é¤ì¤ë¥·¥°¥Ê¥ë¤ò¶èÊ̤·¤Æ¹Í¤¨¤Æ¤¤¤ë¡£ +POSIX.1 ¤Ë¤è¤ë¤È¡¢¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤¿¥·¥°¥Ê¥ë (Î㤨¤Ð +.BR kill (2) +¤ò»È¤Ã¤ÆÁ÷¤ë) ¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Ë°¤¹¥¹¥ì¥Ã¥É¤Î¤¦¤Á +¾¡¼ê¤Ë (arbitrarily) ¤ËÁªÂò¤µ¤ì¤¿°ì¤Ä¤Î¥¹¥ì¥Ã¥É¤Ë¤è¤ê½èÍý¤µ¤ì¤ë +¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£LinuxThreads ¤Ï¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤ë¥·¥°¥Ê¥ë¤Î +³µÇ°¤ËÂбþ¤·¤Æ¤ª¤é¤º¡¢¥·¥°¥Ê¥ë¤ÏÆÃÄê¤Î¥¹¥ì¥Ã¥É¤Ë¤À¤±Á÷¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.IP \- 3 +¥¹¥ì¥Ã¥É¤Ï¤½¤ì¤¾¤ì¤ÎÆȼ«¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ÎÀßÄê¤ò»ý¤Ä¡£ +¤·¤«¤·¡¢¿·¤·¤¤¥¹¥ì¥Ã¥É¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ÎÀßÄê¤Ï +¤½¤Î¥¹¥ì¥Ã¥É¤òºîÀ®¤·¤¿¥¹¥ì¥Ã¥É¤«¤é¥³¥Ô¡¼¤µ¤ì¡¢¤½¤Î¤¿¤á +¥¹¥ì¥Ã¥É¤ÏºÇ½é¤Ï°ì¤Ä¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò¶¦Í­¤¹¤ë¡£ +(»ÅÍͤǤϡ¢¿·¤·¤¤¥¹¥ì¥Ã¥É¤ÏÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¾õÂÖ +¤Ç³«»Ï¤µ¤ì¤ë¤Ù¤­¤È¤µ¤ì¤Æ¤¤¤ë¡£ +2¤Ä¤Î¥¹¥ì¥Ã¥É¤¬¶¦Í­¤µ¤ì¤Æ¤¤¤ëÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¾å¤ÇƱ»þ¤Ë +¥·¥°¥Ê¥ë¤Î½èÍý¤ò¹Ô¤Ã¤¿¾ì¹ç¡¢Í½Â¬ÉÔ²Äǽ¤Ê¥×¥í¥°¥é¥à¤Î¥¨¥é¡¼¤¬ +µ¯¤³¤êÆÀ¤ë¡£) +.SS NPTL +NPTL ¤Ç¤Ï¡¢°ì¤Ä¤Î¥×¥í¥»¥¹¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤ÏƱ¤¸¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥× +¤Ë°¤¹¤ë; ¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¡¼¤ÏƱ¤¸ PID ¤ò¶¦Í­¤¹¤ë¡£ +NPTL ¤Ï´ÉÍý¥¹¥ì¥Ã¥É (manager thread) ¤òÍøÍѤ·¤Ê¤¤¡£ +NPTL ¤ÏÆâÉô¤Ç¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î¤¦¤ÁºÇ½é¤Î 2¤Ä¤ÎÈÖ¹æ¤ò»ÈÍѤ·¤Æ¤ª¤ê +.RB ( signal (7) +»²¾È)¡¢¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï»ÈÍѤǤ­¤Ê¤¤¡£ + +NPTL ¤Ë¤â POSIX.1 ¤Ë½àµò¤·¤Æ¤¤¤Ê¤¤ÅÀ¤¬¾¯¤Ê¤¯¤È¤â°ì¤Ä¤¢¤ë: +.IP \- 3 +¥¹¥ì¥Ã¥É¤Ï¶¦Ä̤Πnice Ãͤò¶¦Í­¤·¤Ê¤¤¡£ +.\" FIXME . bug report filed for NPTL nice nonconformance +.\" http://bugzilla.kernel.org/show_bug.cgi?id=6258 +.\" Sep 08: there is a patch by Denys Vlasenko to address this +.\" "make setpriority POSIX compliant; introduce PRIO_THREAD extension" +.\" Monitor this to see if it makes it into mainline. +.PP +NPTL ¤Îɸ½àÈó½àµò¤ÊÅÀ¤Î¤¦¤Á¤¤¤¯¤Ä¤«¤Ï°ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Î¤ßȯÀ¸¤¹¤ë: +.IP \- 3 +.BR times (2) +¤È +.BR getrusage (2) +¤¬ÊÖ¤¹¾ðÊó¤¬¥×¥í¥»¥¹Á´ÂΤξðÊó¤Ç¤Ê¤¯¥¹¥ì¥Ã¥Éñ°Ì¤Î¾ðÊó¤Ç¤¢¤ë +(¥«¡¼¥Í¥ë 2.6.9 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£ +.IP \- 3 +¥¹¥ì¥Ã¥É´Ö¤Ç¥ê¥½¡¼¥¹À©¸Â¤ò¶¦Í­¤·¤Ê¤¤ (¥«¡¼¥Í¥ë 2.6.10 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£ +.IP \- 3 +¥¹¥ì¥Ã¥É´Ö¤Ç¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¤ò¶¦Í­¤·¤Ê¤¤ +(¥«¡¼¥Í¥ë 2.6.12 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£ +.IP \- 3 +¥á¥¤¥ó¥¹¥ì¥Ã¥É¤À¤±¤¬ +.BR setsid (2) +¤ò»È¤Ã¤Æ¿·¤·¤¤¥»¥Ã¥·¥ç¥ó¤ò³«»Ï¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +(¥«¡¼¥Í¥ë 2.6.16 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£ +.IP \- 3 +¥á¥¤¥ó¥¹¥ì¥Ã¥É¤À¤±¤¬ +.BR setpgid (2) +¤ò»È¤Ã¤Æ¤½¤Î¥×¥í¥»¥¹¤ò¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +(¥«¡¼¥Í¥ë 2.6.16 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£ +.IP \- 3 +¥¹¥ì¥Ã¥É¤Ï¤½¤ì¤¾¤ì¤ÎÆȼ«¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ÎÀßÄê¤ò»ý¤Ä¡£ +¤·¤«¤·¡¢¿·¤·¤¤¥¹¥ì¥Ã¥É¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ÎÀßÄê¤Ï +¤½¤Î¥¹¥ì¥Ã¥É¤òºîÀ®¤·¤¿¥¹¥ì¥Ã¥É¤«¤é¥³¥Ô¡¼¤µ¤ì¡¢¤½¤Î¤¿¤á +¥¹¥ì¥Ã¥É¤ÏºÇ½é¤Ï°ì¤Ä¤ÎÂåÂØ¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯¤ò¶¦Í­¤¹¤ë +(¥«¡¼¥Í¥ë 2.6.16 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£ +.PP +NPTL ¤Î¼ÂÁõ¤Ç¤Ï°Ê²¼¤ÎÅÀ¤Ë¤Ä¤¤¤Æ¤âÃí°Õ¤¹¤ë¤³¤È: +.IP \- 3 +¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤Î¥ê¥½¡¼¥¹¤Î¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È +.RB ( setrlimit (2) +¤Î +.B RLIMIT_STACK +¤ÎÀâÌÀ¤ò»²¾È) ¤¬ +.I unlimited +°Ê³°¤ÎÃͤËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤ÎÃͤ¬ +¿·¤·¤¤¥¹¥ì¥Ã¥É¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤È¤Ê¤ë¡£ +ÀßÄê¤òÍ­¸ú¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¥ê¥ß¥Ã¥ÈÃͤò +ÀßÄꤷ¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤¿¤¤¤Æ¤¤¤Ï¡¢¥·¥§¥ë¤ÎÁȤ߹þ¤ß¥³¥Þ¥ó¥É¤Î +.I ulimit -s +(C ¥·¥§¥ë¤Ç¤Ï +.IR "limit stacksize" ) +¤ò»È¤Ã¤ÆÀßÄꤹ¤ë¡£ +.SS "¥¹¥ì¥Ã¥É¼ÂÁõ¤ÎȽÄê" +glibc 2.3.2 °Ê¹ß¤Ç¤Ï¡¢ +.BR getconf (1) +¥³¥Þ¥ó¥É¤ò»È¤Ã¤Æ¡¢ +¥·¥¹¥Æ¥à¤Î¥¹¥ì¥Ã¥É¼ÂÁõ¤òȽÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°Ê²¼¤ËÎã¤ò¼¨¤¹: +.nf +.in +4n + +bash$ getconf GNU_LIBPTHREAD_VERSION +NPTL 2.3.4 +.in +.fi +.PP +¤¾¤ì°ÊÁ°¤Î glibc ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê¥³¥Þ¥ó¥É¤Ç +¥Ç¥Õ¥©¥ë¥È¤Î¥¹¥ì¥Ã¥É¼ÂÁõ¤òȽÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.nf +.in +4n + +bash$ $( ldd /bin/ls | grep libc.so | awk \(aq{print $3}\(aq ) | \\ + egrep \-i \(aqthreads|ntpl\(aq + Native POSIX Threads Library by Ulrich Drepper et al +.in +.fi +.SS "¥¹¥ì¥Ã¥É¤Î¼ÂÁõ¤ÎÁªÂò: LD_ASSUME_KERNEL" +LinuxThreads ¤È NPTL ¤ÎξÊý¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë glibc +(glibc 2.3.\fIx\fP) ¤¬¤¢¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ +.B LD_ASSUME_KERNEL +´Ä¶­ÊÑ¿ô¤ò»È¤¦¤³¤È¤Ç¡¢Æ°Åª¥ê¥ó¥«¤¬¥Ç¥Õ¥©¥ë¥È¤Ç +ÁªÂò¤¹¤ë¥¹¥ì¥Ã¥É¼ÂÁõ¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤ÎÊÑ¿ô¤Ë¤è¤ê¡¢Æ°Åª¥ê¥ó¥«¤¬ÆÃÄê¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¾å¤Ç +Æ°ºî¤·¤Æ¤¤¤ë¤È²¾Äꤹ¤ë¤è¤¦¤Ë»ØÄꤹ¤ë¡£ +NPTL ¤¬É¬ÍפȤ¹¤ë¥µ¥Ý¡¼¥Èµ¡Ç½¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤ò +»ØÄꤹ¤ë¤³¤È¤Ç¡¢¶¯À©Åª¤Ë LinuxThreads ¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë +(¤³¤Î¤è¤¦¤Ê¤³¤È¤ò¤¹¤ëºÇ¤â¤¢¤ê¤½¤¦¤Ê¾ìÌ̤ϡ¢ +LinuxThreads ¤Îɸ½àÈó½àµò¤Ê¿¶Éñ¤¤¤Ë°Í¸¤¹¤ë (²õ¤ì¤¿) ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó +¤òÆ°ºî¤µ¤»¤ë¾ì¹ç¤À¤í¤¦)¡£ +°Ê²¼¤ËÎã¤ò¼¨¤¹: +.nf +.in +4n + +bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\ + awk \(aq{print $3}\(aq ) | egrep \-i \(aqthreads|ntpl\(aq + linuxthreads-0.10 by Xavier Leroy +.in +.fi +.SH ´ØÏ¢¹àÌÜ +.BR clone (2), +.BR futex (2), +.BR gettid (2), +.BR futex (7), +.BR signal (7), +.br +¤ª¤è¤Ó Pthreads ¤Î³Æ¼ï¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¡¢Î㤨¤Ð: +.BR pthread_attr_init (3), +.BR pthread_atfork (3), +.BR pthread_cancel (3), +.BR pthread_cleanup_push (3), +.BR pthread_cond_signal (3), +.BR pthread_cond_wait (3), +.BR pthread_create (3), +.BR pthread_detach (3), +.BR pthread_equal (3), +.BR pthread_exit (3), +.BR pthread_key_create (3), +.BR pthread_kill (3), +.BR pthread_mutex_lock (3), +.BR pthread_mutex_unlock (3), +.BR pthread_once (3), +.BR pthread_setcancelstate (3), +.BR pthread_setcanceltype (3), +.BR pthread_setspecific (3), +.BR pthread_sigmask (3), +.BR pthread_testcancel (3) diff --git a/release/man7/pty.7 b/release/man7/pty.7 new file mode 100644 index 00000000..cae18eab --- /dev/null +++ b/release/man7/pty.7 @@ -0,0 +1,162 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2005 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) 2005 Akihiro MOTOKI all rights reserved. +.\" Translated 2005-10-14, Akihiro MOTOKI +.\" +.\"WORD: pseudo-terminal µ¼»÷üËö +.\"WORD: character device ¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹ +.\"WORD: pseudo-terminal +.\" +.TH PTY 7 2005-10-10 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +pty \- µ¼»÷üËö¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.SH ÀâÌÀ +µ¼»÷üËö (pseudo-terminal) ¤Ï¡¢ÁÐÊý¸þÄÌ¿®¥Á¥ã¥ó¥Í¥ë¤òÄ󶡤¹¤ë +²¾ÁÛ¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹¤Î¥Ú¥¢¤Ç¤¢¤ë¡£ +¥Á¥ã¥ó¥Í¥ë¤Î°ìÊý¤ÎüÅÀ¤Ï +.I ¥Þ¥¹¥¿ (master) +¤È¸Æ¤Ð¤ì¡¢¤â¤¦°ìÊý¤ÎüÅÀ¤Ï +.I ¥¹¥ì¡¼¥Ö (slave) +¤È¸Æ¤Ð¤ì¤ë¡£ +µ¼»÷üËö¤Î¥¹¥ì¡¼¥Ö¤Ï¡¢ÅÁÅýŪ¤ÊüËö¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò +Ä󶡤¹¤ë¡£Ã¼Ëö¤ËÀܳ¤µ¤ì¤ë¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤ë¥×¥í¥»¥¹¤Ïµ¼»÷üËö¤Î +¥¹¥ì¡¼¥Ö¤ò¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢¤½¤ì°Ê¹ß¤Ï¥Þ¥¹¥¿Â¦¤ò¥ª¡¼¥×¥ó +¤·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤«¤é¤½¤Î¥×¥í¥»¥¹¤òÀ©¸æ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +üËö¤ÇÆþÎϤµ¤ì¤¿¤Î¤ÈƱ¤¸¤è¤¦¤Ë¡¢ +¥Þ¥¹¥¿Â¦¤Ë½ñ¤­¹þ¤Þ¤ì¤¿Á´¤Æ¤Î¥Ç¡¼¥¿¤Ï¡¢¥¹¥ì¡¼¥Ö¦¤Î¥×¥í¥»¥¹¤ËÁ÷¤é¤ì¤ë¡£ +Î㤨¤Ð¡¢¥Þ¥¹¥¿¥Ç¥Ð¥¤¥¹¤Ë³ä¤ê¹þ¤ß¥­¥ã¥é¥¯¥¿ (Ä̾ï¤Ï control-C) ¤ò½ñ¤­¹þ¤à¤È¡¢ +¥¹¥ì¡¼¥Ö¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ËÂФ·¤Æ +³ä¤ê¹þ¤ß¥·¥°¥Ê¥ë +.RB ( SIGINT ) +¤¬À¸À®¤µ¤ì¤ë¡£ +È¿ÂФˡ¢µ¼»÷üËö¤Î¥¹¥ì¡¼¥Ö¦¤Ë½ñ¤­¹þ¤Þ¤ì¤¿Á´¤Æ¤Î¥Ç¡¼¥¿¤Ï¡¢ +¥Þ¥¹¥¿Â¦¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¥×¥í¥»¥¹¤«¤éÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +µ¼»÷üËö¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥í¥°¥¤¥ó¥µ¡¼¥Ó¥¹ +.RB ( ssh "(1), " rlogin "(1), " telnet (1)) +¤äüËö¥¨¥ß¥å¥ì¡¼¥¿¡¢ +.BR script (1), +.BR screen (1), +.BR expect (1) +¤Ê¤É¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ + +Îò»ËŪ¤Ë¸«¤ë¤È BSD ¤È System V ¤Î2¼ïÎà¤Îµ¼»÷üËö¤Î API ¤¬È¯Å¸¤·¤Æ¤­¤Æ¤¤¤ë¡£ +SUSv1 ¤Ï System V API ¤Ë´ð¤Å¤¤¤¿µ¼»÷üËö API ¤òɸ½à²½¤·¤Æ¤ª¤ê¡¢ +µ¼»÷üËö¤ò»ÈÍѤ¹¤ë¿·¤·¤¤¥×¥í¥°¥é¥à¤Ï¤¹¤Ù¤Æ¤³¤Î API ¤òºÎÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ + +Linux ¤Ç¤Ï BSD É÷¤È (ɸ½à²½¤µ¤ì¤¿) System V É÷¤Îµ¼»÷üËö¤òÄ󶡤·¤Æ¤¤¤ë¡£ +System V É÷¤ÎüËö¤Ï¡¢Linux ¥·¥¹¥Æ¥à¤Ç¤Ï°ìÈÌ¤Ë Unix 98 µ¼»÷üËö¤È¸Æ¤Ð¤ì¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë 2.6.4 °Ê¹ß¤Ç¤Ï¡¢BSD É÷¤Îµ¼»÷üËö¤ÏÇÑ»ßͽÄê¤È¤ß¤Ê¤µ¤ì¤Æ¤¤¤ë +(¥«¡¼¥Í¥ë¤Î¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¤Ç BSD É÷¤Îµ¼»÷üËö¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë)¡£ +¿·¤·¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢Unix 98 µ¼»÷üËö¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +.SS "Unix 98 µ¼»÷üËö" +̤»ÈÍѤΠUnix 98 µ¼»÷üËö¥Þ¥¹¥¿¤ò¥ª¡¼¥×¥ó¤¹¤ë¤Ë¤Ï +.BR posix_openpt (3) +¤ò¸Æ¤Ó½Ð¤¹ +(¤³¤Î´Ø¿ô¤Ï¥Þ¥¹¥¿¡¦¥¯¥í¡¼¥ó¡¦¥Ç¥Ð¥¤¥¹ (master clone device), +.I /dev/ptmx +¤ò¥ª¡¼¥×¥ó¤¹¤ë; +.BR pts (4) +¤ò»²¾È)¡£ +¥×¥í¥°¥é¥à¸ÇÍ­¤Î½é´ü²½½èÍý¤ò¼Â¹Ô¤·¡¢ +.BR grantpt (3) +¤ò»È¤Ã¤Æ¥¹¥ì¡¼¥Ö¥Ç¥Ð¥¤¥¹¤Î½êÍ­¸¢¤äµö²Ä¤òÊѹ¹¤·¡¢ +.BR unlockpt (3) +¤ò»È¤Ã¤Æ¥¹¥ì¡¼¥Ö¤Î¥í¥Ã¥¯²ò½ü¤ò¹Ô¤¦¤È¡¢ +.BR ptsname (3) +¤¬ÊÖ¤¹Ì¾Á°¤òÅϤ·¤Æ +.BR open (2) +¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤ê +Âбþ¤¹¤ë¥¹¥ì¡¼¥Ö¥Ç¥Ð¥¤¥¹¤ò¥ª¡¼¥×¥ó¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + +Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ÍøÍѤǤ­¤ë Unix 98 µ¼»÷üËö¤Î¿ô¤Ë¾å¸Â¤òÀߤ±¤Æ¤¤¤ë¡£ +2.6.3 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Î¾å¸Â¤Ï¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤ÎÀßÄê +.RB ( CONFIG_UNIX98_PTYS ) +¤Ç¤¢¤ë¡£µö²Ä¤µ¤ì¤ëµ¼»÷üËö¤Î¿ô¤ÏºÇÂç 2048 ¤Ç¤¢¤ê¡¢ +¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¤Ï 256 ¤Ç¤¢¤ë¡£ +¥«¡¼¥Í¥ë 2.6.4 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¾å¸Â¤Ï +.I /proc/sys/kernel/pty/max +·Ðͳ¤ÇưŪ¤ËÄ´À°²Äǽ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£¤Þ¤¿¡¢ +.I /proc/sys/kernel/pty/nr +¤Ç¸½ºß»ÈÍÑÃæ¤Îµ¼»÷üËö¤Î¿ô¤ò¼èÆÀ¤Ç¤­¤ë¡£ +¤³¤Î 2¤Ä¤Î¥Õ¥¡¥¤¥ë¤Î¾ÜºÙ¤Ï +.BR proc (5) +¤ò»²¾È¡£ +.SS "BSD µ¼»÷üËö" +BSD É÷¤Îµ¼»÷üËö¤Ï¤¢¤é¤«¤¸¤áºîÀ®¤µ¤ì¤¿¥Ú¥¢¤È¤·¤ÆÄ󶡤µ¤ì¤ë¡£¤½¤Î̾Á°¤Ï +.I /dev/ptyXY +(¥Þ¥¹¥¿Â¦)¡¢ +.I /dev/ttyXY +(¥¹¥ì¡¼¥Ö¦) ¤Ç¤¢¤ë¡£¤³¤³¤Ç¡¢ +X ¤Ï [p-za-e] ¤Î 16ʸ»ú¤Î¤¦¤Á¤Î°ìʸ»ú¡¢ +Y ¤Ï [0-9a-f] ¤Î 16ʸ»ú¤Î¤¦¤Á¤Î°ìʸ»ú¤Ç¤¢¤ë +(X, Y ¤Ë»È¤ï¤ì¤ëʸ»ú¤ÎÀµ³Î¤ÊÈÏ°Ï¤Ï Unix ¤Î¼ÂÁõ¤Ë¤è¤ê°Û¤Ê¤ë)¡£ +Î㤨¤Ð¡¢ +.I /dev/ptyp1 +¤È +.I /dev/ttyp1 +¤Ï BSD µ¼»÷üËö¥Ú¥¢¤ò¹½À®¤¹¤ë¡£ +¥×¥í¥»¥¹¤¬Ì¤»ÈÍѤε¼»÷üËö¥Ú¥¢¤ò¸«¤Ä¤±¤ë¤Ë¤Ï¡¢ +³Æµ¼»÷üËö¤Î¥Þ¥¹¥¿¤Î +.BR open (2) +¤ò»î¤ß¡¢open ¤¬À®¸ù¤¹¤ë¤Þ¤Ç¤³¤ì¤ò·«¤êÊÖ¤¹¡£ +¥Þ¥¹¥¿¤ò open ¤¹¤ë¤È¡¢Âбþ¤¹¤ëµ¼»÷üËö¤Î¥¹¥ì¡¼¥Ö¤â open ¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë +(¥¹¥ì¡¼¥Ö¤Î̾Á°¤Ï¡¢¥Þ¥¹¥¿¤Î̾Á°¤Î "pty" ¤ò "tty" ¤ËÃÖ¤­´¹¤¨¤¿¤â¤Î¤Ç¤¢¤ë)¡£ +.SH ¥Õ¥¡¥¤¥ë +.I /dev/ptmx +(Unix 98 ¥Þ¥¹¥¿¡¦¥¯¥í¡¼¥ó¡¦¥Ç¥Ð¥¤¥¹) +.br +.I /dev/pts/* +(Unix 98 ¥¹¥ì¡¼¥Ö¥Ç¥Ð¥¤¥¹) +.br +.I /dev/pty[p-za-e][0-9a-f] +(BSD ¥Þ¥¹¥¿¥Ç¥Ð¥¤¥¹) +.br +.I /dev/tty[p-za-e][0-9a-f] +(BSD ¥¹¥ì¡¼¥Ö¥Ç¥Ð¥¤¥¹) +.SH Ãí°Õ +¥Ñ¥±¥Ã¥È¡¦¥â¡¼¥ÉÁàºî¤ÎÀ©¸æ¤ò¹Ô¤¦ +.B TIOCPKT +.BR ioctl (2) +¤ÎÀâÌÀ¤Ï +.BR tty_ioctl (4) +¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£ + +BSD +.BR ioctl (2) +¤Î +.BR TIOCSTOP , +.BR TIOCSTART , +.BR TIOCUCNTL , +.B TIOCREMOTE +¤Ï¤³¤ì¤Þ¤Ç¤Î¤È¤³¤í Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR select (2), +.BR setsid (2), +.BR forkpty (3), +.BR openpty (3), +.BR termios (3), +.BR pts (4), +.BR tty (4), +.BR tty_ioctl (4) diff --git a/release/man7/raw.7 b/release/man7/raw.7 new file mode 100644 index 00000000..0d22930f --- /dev/null +++ b/release/man7/raw.7 @@ -0,0 +1,297 @@ +'\" t +.\" Don't change the first line, it tells man that we need tbl. +.\" This man page is Copyright (C) 1999 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. +.\" $Id: raw.7,v 1.6 1999/06/05 10:32:08 freitag Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2007-01-05, Akihiro MOTOKI , LDP v2.43 +.\" +.\"WORD link level header(s) ¥ê¥ó¥¯¥ì¥Ù¥ë¥Ø¥Ã¥À +.\"WORD effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ ID +.\"WORD capability ¸¢¸Â +.\"WORD route (¥Ñ¥±¥Ã¥È¤Î) ·ÐÏ© +.\" +.TH RAW 7 2008-11-20 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +raw, SOCK_RAW \- Linux ¤Î IPv4 raw ¥½¥±¥Ã¥È +.SH ½ñ¼° +.B #include +.br +.B #include +.br +.BI "raw_socket = socket(AF_INET, SOCK_RAW, int " protocol ); +.SH ÀâÌÀ +raw ¥½¥±¥Ã¥È¤ò»È¤¦¤È¡¢¿·¤·¤¤ IPv4 ¥×¥í¥È¥³¥ë¤ò¥æ¡¼¥¶¶õ´Ö¤Ç +¼ÂÁõ¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ raw ¥½¥±¥Ã¥È¤Ï¡¢¥ê¥ó¥¯¥ì¥Ù¥ë¥Ø¥Ã¥À¤ò +´Þ¤Þ¤Ê¤¤ raw ¥Ç¡¼¥¿¥°¥é¥à¤ÎÁ÷¼õ¿®¤¬¤Ç¤­¤ë¡£ + +IPv4 ¥ì¥¤¥ä¤Ï¡¢°·¤Ã¤Æ¤¤¤ë¥½¥±¥Ã¥È¤Ç +.B IP_HDRINCL +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +¥Ñ¥±¥Ã¥È¤òÁ÷¿®¤¹¤ë¤È¤­¤Ë IP ¥Ø¥Ã¥À¤òÀ¸À®¤¹¤ë¡£ +.B IP_HDRINCL +¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¤­¤Ï¡¢¥Ñ¥±¥Ã¥È¤Ë¤Ï +IP ¥Ø¥Ã¥À¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¼õ¿®»þ¤Ë¤Ï¡¢ IP ¥Ø¥Ã¥À¤Ï¾ï¤Ë¥Ñ¥±¥Ã¥È¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ + +¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤«¡¢ +.B CAP_NET_RAW +¸¢¸Â¤ò»ý¤Ä¥×¥í¥»¥¹¤À¤±¤¬ raw ¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¤³¤Î raw ¥½¥±¥Ã¥È¤Ë»ØÄꤵ¤ì¤¿ +.I protocol +ÈÖ¹æ¤Ë¥Þ¥Ã¥Á¤¹¤ëÁ´¤Æ¤Î¥Ñ¥±¥Ã¥È¤È¥¨¥é¡¼¤È¤¬¡¢¤³¤Î¥½¥±¥Ã¥È¤ËÅϤµ¤ì¤ë¡£ +µö²Ä¤µ¤ì¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¤Î¥ê¥¹¥È¤Ï RFC\ 1700 ¤Î³ä¤êÅö¤ÆÈÖ¹æ¤È +.BR getprotobyname (3) +¤ò¸«¤è¡£ + +.B IPPROTO_RAW +¤Î¥×¥í¥È¥³¥ë¤Ï°ÅÌۤΤ¦¤Á¤Ë +.B IP_HDRINCL +¤òÍ­¸ú¤Ë¤¹¤ë¤Î¤Ç¡¢ +ÅϤµ¤ì¤¿¥Ø¥Ã¥À¤Ç»ØÄꤵ¤ì¤¿¡¢¤¢¤é¤æ¤ë IP ¥×¥í¥È¥³¥ë¤òÁ÷¿®¤Ç¤­¤ë¡£ +.B IPPROTO_RAW +·Ðͳ¤Ç¤Î¤¢¤é¤æ¤ë IP ¥×¥í¥È¥³¥ë¤Î¼õ¿®¤Ï¡¢ +raw ¥½¥±¥Ã¥È¤òÍѤ¤¤Æ¤Ï¹Ô¤¨¤Ê¤¤¡£ +.TS +tab(:) allbox; +c s +l l. +IP ¥Ø¥Ã¥À¥Õ¥£¡¼¥ë¥É¡£ \fBIP_HDRINCL\fP ¤Ë¤è¤Ã¤ÆÁ÷¿®»þ¤ËÊѹ¹¤µ¤ì¤ë¡£ +IP ¥Á¥§¥Ã¥¯¥µ¥à:¾ï¤ËÊѹ¹¤µ¤ì¤ë¡£ +¥½¡¼¥¹¥¢¥É¥ì¥¹:¸µ¤ÎÃͤ¬ 0 ¤Î»þ¤ËÊѹ¹¤µ¤ì¤ë¡£ +¥Ñ¥±¥Ã¥È ID:¸µ¤ÎÃͤ¬ 0 ¤Î»þ¤ËÊѹ¹¤µ¤ì¤ë¡£ +Á´ÂΤÎŤµ:¾ï¤ËËä¤á¤é¤ì¤ë¡£ +.TE +.sp +.PP +.\"NAKANO Aloways filled in. ¤È¤Ï? +.B IP_HERINCL +¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ IP ¥Ø¥Ã¥À¤Ë +0 ¤Ç¤Ê¤¤Á÷¿®À襢¥É¥ì¥¹¤¬µ­Æþ¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ï¡¢ +¤½¤ÎÁ÷¿®À襢¥É¥ì¥¹¤¬¥Ñ¥±¥Ã¥È¤Î·ÐÏ©¤ò·è¤á¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£ +.B MSG_DONTROUTE +¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë»þ¤Ë¤Ï¡¢ +Á÷¿®À襢¥É¥ì¥¹¤Ï¥í¡¼¥«¥ë¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»²¾È¤¹¤ë¤â¤Î¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤µ¤â¤Ê¤¤¤È¡¢¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤Î»²¾È¤Ï¤¤¤º¤ì¤Ë¤»¤è¹Ô¤ï¤ì¤ë¤¬¡¢ +¥²¡¼¥È¥¦¥§¥¤¤¬É¬ÍפʷÐÏ©¤Ï̵»ë¤µ¤ì¤ë¡£ +.\"NAKANO ¥í¡¼¥«¥ë¤Ê¥Í¥Ã¥È¤Ê¤Î¤«¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ê¤Î¤«¡© + +.B IP_HDRINCL +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ +raw ¥½¥±¥Ã¥È¤Î IP ¥Ø¥Ã¥À¥ª¥×¥·¥ç¥ó¤ò +.BR setsockopt (2) +¤òÍѤ¤¤ÆÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¾ÜºÙ¤Ê¾ðÊó¤Ï +.BR ip (7) +¤ò¸«¤è¡£ + +Linux 2.2 ¤Ç¤Ï¡¢ IP ¥Ø¥Ã¥À¤ÎÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤È¥ª¥×¥·¥ç¥ó¤È¤ò +IP ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡£¤·¤¿¤¬¤Ã¤Æ +raw ¥½¥±¥Ã¥È¤¬É¬Íפˤʤë¤Î¤Ï¡¢¿·¤·¤¤¥×¥í¥È¥³¥ë¤òÀ߷פ¹¤ë¾ì¹ç¤«¡¢ +¥æ¡¼¥¶¡¼¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»ý¤¿¤Ê¤¤¥×¥í¥È¥³¥ë (ICMP ¤Ê¤É) ¤ò°·¤¦¾ì¹ç¤Ë +¸Â¤é¤ì¤ë¡£ + +¥Ñ¥±¥Ã¥È¤Ï¡¢¼õ¿®¤µ¤ì¤ë¤È¤Þ¤º¥×¥í¥È¥³¥ë¤Ë¥Ð¥¤¥ó¥É¤·¤Æ¤¤¤ë +raw ¥½¥±¥Ã¥È¤ËÅϤµ¤ì¡¢ +¤½¤Î¸å¤Ç¾¤Î¥×¥í¥È¥³¥ë¥Ï¥ó¥É¥é (¥«¡¼¥Í¥ë¤Î¥×¥í¥È¥³¥ë¥â¥¸¥å¡¼¥ë¤Ê¤É) +¤ËÅϤµ¤ì¤ë¡£ +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +raw ¥½¥±¥Ã¥È¤Ïɸ½à¤Î +.I sockaddr_in +¥¢¥É¥ì¥¹¹½Â¤ÂΤòÍѤ¤¤ë¡£ÄêµÁ¤Ï +.BR ip (7) +¤Ç¤Ê¤µ¤ì¤Æ¤¤¤ë¡£ +.I sin_port +¥Õ¥£¡¼¥ë¥É¤ò IP ¥×¥í¥È¥³¥ëÈÖ¹æ¤Î»ØÄê¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¤¬¡¢ +Linux 2.2 ¤Ç¤Ï¤³¤ì¤ÏÁ÷¿®»þ¤Ë¤Ï̵»ë¤µ¤ì¡¢¾ï¤Ë 0 ¤Ë¤µ¤ì¤ë +(¥Ð¥° ¤Î¹à¤ò»²¾È)¡£ +¼õ¿®¥Ñ¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï¡¢ +.I sin_port +¤Ï¤½¤Î¥Ñ¥±¥Ã¥È¤Î¥×¥í¥È¥³¥ë¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ +ÍѤ¤¤ë¤³¤È¤Î¤Ç¤­¤ë IP ¥×¥í¥È¥³¥ë¤Ï¡¢¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ò¸«¤è¡£ +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +raw ¥½¥±¥Ã¥È¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.B IPPROTO_RAW +.\" ¤â¤·¤¯¤Ï Linux ¤Ç¤Ï .I SOL_RAW +¥Õ¥¡¥ß¥ê¡¼¥Õ¥é¥°¤òÍ¿¤¨¤Æ +.BR setsockopt (2) +¤ò¸Æ¤Ù¤ÐÀßÄê¤Ç¤­¡¢ +.BR getsockopt (2) +¤ò¸Æ¤Ù¤Ð¼èÆÀ¤Ç¤­¤ë¡£ +.TP +.B ICMP_FILTER +.B IPPROTO_ICMP +¥×¥í¥È¥³¥ë¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤¿ raw ¥½¥±¥Ã¥È¤Î¤¿¤á¤ÎÆüì¤Ê¥Õ¥£¥ë¥¿¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤ÎÃÍ¤Ï ICMP ¥á¥Ã¥»¡¼¥¸¤Î¥¿¥¤¥×¤½¤ì¤¾¤ì¤ËÂФ·¤Æ¡¢¤É¤ì¤ò¥Õ¥£¥ë¥¿¡¼¥¢¥¦¥È +¤¹¤ë¤«¤òɽ¤·¤¿¥Ó¥Ã¥È¥»¥Ã¥È¤Ç¤¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï +ICMP ¥á¥Ã¥»¡¼¥¸¤ÏÁ´¤¯¥Õ¥£¥ë¥¿¡¼¤·¤Ê¤¤¡£ +.PP +¤µ¤é¤Ë¡¢¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤Ë»È¤¨¤ëÁ´¤Æ¤Î +.BR ip (7) +.B SOL_IP +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SS ¥¨¥é¡¼½èÍý +¥Í¥Ã¥È¥ï¡¼¥¯¤ÇÀ¸¤¸¤¿¥¨¥é¡¼¤¬¥æ¡¼¥¶¤ËÅϤµ¤ì¤ë¤Î¤Ï¡¢ +¥½¥±¥Ã¥È¤¬ÀܳºÑ¤ß¤Î¾ì¹ç¤« +.B IP_RECVERR +¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¸Â¤é¤ì¤ë¡£ +ÀܳºÑ¤ß¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï¡¢ +.B EMSGSIZE +¤ª¤è¤Ó +.B EPROTO +¤À¤±¤¬ÅϤµ¤ì¤ë (¸ß´¹À­¤Î¤¿¤á)¡£ +.B IP_RECVERR +¤òÀßÄꤹ¤ë¤È¡¢Á´¤Æ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥é¡¼¤¬¥¨¥é¡¼¥­¥å¡¼¤ËÊݸ¤µ¤ì¤ë¡£ +.SH ¥¨¥é¡¼ +.TP +.B EACCES +¥æ¡¼¥¶¡¼¤¬ broadcast ¥Õ¥é¥°¤òÀßÄꤷ¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤òÍѤ¤¤Æ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ËÁ÷¿®¤ò¹Ô¤ª¤¦¤È¤·¤¿¡£ +.TP +.B EFAULT +ÉÔÀµ¤Ê¥á¥â¥ê¥¢¥É¥ì¥¹¤¬Í¿¤¨¤é¤ì¤¿¡£ +.TP +.B EINVAL +°ú¿ô¤¬Àµ¤·¤¯¤Ê¤¤¡£ +.TP +.B EMSGSIZE +¥Ñ¥±¥Ã¥È¤¬Â礭¤¹¤®¤ë¡£ Path MTU Discoverry ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë +.RB ( IP_MTU_DISCOVER +¥½¥±¥Ã¥È¥Õ¥é¥°) ¤«¡¢¥Ñ¥±¥Ã¥È¤Î¥µ¥¤¥º¤¬ IPv4 ¤Çµö¤µ¤ì¤Æ¤¤¤ë +¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤ÎºÇÂçÃÍ 64KB ¤ò±Û¤¨¤Æ¤¤¤ë¡£ +.TP +.B EOPNOTSUPP +¥½¥±¥Ã¥È¸Æ¤Ó½Ð¤·¤ËÉÔÀµ¤Ê¥Õ¥é¥° +.RB ( MSG_OOB +¤Ê¤É) ¤¬ÅϤµ¤ì¤¿¡£ +.TP +.B EPERM +¥æ¡¼¥¶¡¼¤Ï raw ¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£ +¼Â¹Ô¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤«¡¢ +.B CAP_NET_RAW +°À­¤ò»ý¤Ä¥×¥í¥»¥¹¤À¤±¤¬¤³¤ì¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B EPROTO +¥Ñ¥é¥á¡¼¥¿¤ÎÌäÂê¤òÊó¹ð¤¹¤ë ICMP ¥¨¥é¡¼¤ò¼õ¤±¼è¤Ã¤¿¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.B IP_RECVERR +¤È +.B ICMP_FILTER +¤Ï Linux 2.2 ¤ÇÅо줷¤¿¡£¤³¤ì¤é¤Ï Linux ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤ÏÍѤ¤¤ë¤Ù¤­¤Ç¤Ê¤¤¡£ + +Linux 2.0 ¤Ç¤Ï +.B SO_BSDCOMPAT +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢ +BSD ¤Î raw ¥½¥±¥Ã¥È¤Ë¤¢¤ë¥Ð¥°¤Ë¸ß´¹À­¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¤¿ \(em +Linux 2.2 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤â¤Ï¤ä¸úÎϤò»ý¤¿¤Ê¤¤¡£ +.SH Ãí°Õ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢raw ¥½¥±¥Ã¥È¤Ï Path MTU Discovery ¤ò¹Ô¤¦¡£ +¤Ä¤Þ¤ê¡¢¥«¡¼¥Í¥ë¤ÏÆÃÄê¤Î°¸Àè IP ¥¢¥É¥ì¥¹¤Î MTU (Maximum Transmission Unit; +ºÇÂçžÁ÷ñ°Ì) ¤òµ­Ï¿¤·¡¢raw ¥Ñ¥±¥Ã¥È¤Î½ñ¤­¹þ¤ß¤¬ MTU ¤òĶ¤¨¤¿¾ì¹ç +.B EMSGSIZE +¤òÊÖ¤¹¡£ +.B EMSGSIZE +¤òÊÖ¤µ¤ì¤¿¾ì¹ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤ò¾®¤µ¤¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.B IP_MTU_DISCOVER +¤Þ¤¿¤Ï +.I /proc/sys/net/ipv4/ip_no_pmtu_disc +¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ Path MTU Discovery ¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë +(¾ÜºÙ¤Ï +.BR ip (7) +¤ò»²¾È)¡£ +Path MTU Discovery ¤ò̵¸ú¤Ë¤·¤¿¾ì¹ç¤Ï¡¢¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤¬ +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î MTU ¤è¤ê¤âÂ礭¤¤¤È raw ¥½¥±¥Ã¥È¤Ï¤½¤Î¥Ñ¥±¥Ã¥È¤ò +¥Õ¥é¥°¥á¥ó¥È²½¤·¤ÆÁ÷½Ð¤¹¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢À­Ç½¤È¿®ÍêÀ­¤ÎÍýͳ¤«¤é Path MTU Discovery ¤ò +̵¸ú¤Ë¤¹¤ë¤Î¤Ï¿ä¾©¤Ç¤­¤Ê¤¤¡£ + +.BR bind (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍѤ¤¤ë¤È¡¢ +raw ¥½¥±¥Ã¥È¤ò +ÆÃÄê¤Î¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Ð¥¤¥ó¥É¤¬¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢»ØÄꤷ¤¿ IP ¥×¥í¥È¥³¥ë¤Î +¤¹¤Ù¤Æ¤Î¥Ñ¥±¥Ã¥È¤¬¼õ¿®¤µ¤ì¤ë¡£ +¤µ¤é¤Ë¡¢ +.B SO_BINDTODEVICE +¤òÍѤ¤¤ì¤Ð raw ¥½¥±¥Ã¥È¤òÆÃÄê¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤Ë +¥Ð¥¤¥ó¥É¤µ¤»¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.BR socket (7) +¤ò¸«¤è¡£ + +.B IPPROTO_RAW +¥½¥±¥Ã¥È¤ÏÁ÷¿®ÀìÍѤǤ¢¤ë¡£¤â¤·¤É¤¦¤·¤Æ¤â¤¹¤Ù¤Æ¤Î IP ¥Ñ¥±¥Ã¥È¤ò +¼õ¿®¤·¤¿¤¤¾ì¹ç¤Ï¡¢ +.BR packet (7) +¥½¥±¥Ã¥È¤ò +.B ETH_P_IP +¥×¥í¥È¥³¥ë¤ÇÍѤ¤¤ë¤³¤È¡£ +packet ¥½¥±¥Ã¥È¤Ï raw ¥½¥±¥Ã¥È¤Î¤è¤¦¤Ë +IP ¥Õ¥é¥°¥á¥ó¥È¤òºÆ¹½À®¤·¤Ê¤¤¤³¤È¤ËÃí°Õ¡£ + +datagram ¥½¥±¥Ã¥È¤ËÂФ¹¤ë¤¹¤Ù¤Æ¤Î ICMP ¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤·¤¿¤¤¾ì¹ç¤Ï¡¢ +ÆÃÄê¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.B IP_RECVERR +¤òÍѤ¤¤ë¤Û¤¦¤¬Îɤ¤¾ì¹ç¤¬Â¿¤¤¡£ +.BR ip (7) +¤ò¸«¤è¡£ + +raw ¥½¥±¥Ã¥È¤Ï¡¢ Linux ¤Î¤¹¤Ù¤Æ¤Î IP ¥×¥í¥È¥³¥ë¤ò¼õ¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +ICMP ¤ä TCP ¤Î¤è¤¦¤Ë¡¢¥«¡¼¥Í¥ëÆâÉô¤Ë¥×¥í¥È¥³¥ë¥â¥¸¥å¡¼¥ë¤ò»ý¤Ä¤è¤¦¤Ê +¤â¤Î¤â²Äǽ¤Ç¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢¥Ñ¥±¥Ã¥È¤Ï¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤È +raw ¥½¥±¥Ã¥È¤ÎξÊý¤ËÅϤµ¤ì¤ë (raw ¥½¥±¥Ã¥È¤¬Ê£¿ô¤¢¤ì¤Ð¤½¤ì¤¾¤ì¤ËÅϤµ¤ì¤ë)¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Îµ¡Ç½¤Ë°Í¸¤¹¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¾¤Î¿¤¯¤Î BSD ¤Ë¤ª¤±¤ë¥½¥±¥Ã¥È¤Î¼ÂÁõ¤Ç¤Ï¤³¤ÎÅÀ¤Ë¤ª¤¤¤ÆÀ©¸Â¤¬¤¢¤ë¡£ + +Linux ¤Ï¥æ¡¼¥¶¡¼¤«¤éÅϤµ¤ì¤¿¥Ø¥Ã¥À¤ò·è¤·¤ÆÊѹ¹¤·¤Ê¤¤ (¤¿¤À¤· +.B IP_HDRINCL +¤ÎÀâÌÀ¤Ë¤¢¤ë¤è¤¦¤Ë¡¢ 0 ¤ò¤¤¤¯¤Ä¤«Ëä¤á¤ë¾ì¹ç¤ò½ü¤¯)¡£ +¤³¤ì¤Ï¾¤Î¿¤¯¤Î raw ¥½¥±¥Ã¥È¤Î¼ÂÁõ¤Ç¤Ï°Û¤Ê¤ë¡£ + +°ìÈÌ¤Ë raw ¥½¥±¥Ã¥È¤Ï°Ü¿¢À­¤¬¤Ê¤¤¤³¤È¤¬Â¿¤¤¤Î¤Ç¡¢ +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ + +raw ¥½¥±¥Ã¥È¤Ø¤ÎÁ÷¿®¤Ç¤Ï¡¢ IP ¥×¥í¥È¥³¥ë¤ò +.I sin_port +¤«¤é¼èÆÀ¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤Îµ¡Ç½¤Ï Linux 2.2 ¤Ç¤Ï»È¤¨¤Ê¤¯¤Ê¤Ã¤¿¡£ +.B IP_HDRINCL +¤òÍѤ¤¤ì¤ÐƱÍͤΤ³¤È¤¬¼Â¸½¤Ç¤­¤ë¡£ +.SH ¥Ð¥° +Æ©²á¥×¥í¥¯¥· (transparent proxy) ³ÈÄ¥¤Ë¤Ä¤¤¤Æ¤Ïµ­½Ò¤·¤Æ¤¤¤Ê¤¤¡£ + +.B IP_HDRINCL +¥ª¥×¥·¥ç¥ó¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¥Ç¡¼¥¿¥°¥é¥à¤Ï¥Õ¥é¥°¥á¥ó¥È²½¤µ¤ì¤º¡¢ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î MTU ¤ÎÂ礭¤µ¤ËÀ©¸Â¤µ¤ì¤ë¡£ + +Á÷¿®ÍѤΠIP ¥×¥í¥È¥³¥ë¤ÎÀßÄê¤ò +.I sin_port +¤Ë¤·¤Æ¤ª¤¯µ¡Ç½¤Ï Linux 2.2 ¤«¤é»È¤¨¤Ê¤¯¤Ê¤Ã¤¿¡£ +¥½¥±¥Ã¥È¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¤«¡¢ºÇ½é¤Î +.BR socket (2) +¥³¡¼¥ë¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥×¥í¥È¥³¥ë¤¬¾ï¤ËÍѤ¤¤é¤ì¤ë¡£ +.\" .SH Ãø¼Ô +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï Andi Kleen ¤¬½ñ¤¤¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR recvmsg (2), +.BR sendmsg (2), +.BR capabilities (7), +.BR ip (7), +.BR socket (7) + +¥Ñ¥¹ MTU ȯ¸«¤Ë´Ø¤¹¤ë¾ðÊó¤Ï +.B RFC\ 1191 +¤Ë¤¢¤ë + +IP ¥×¥í¥È¥³¥ë¤Ë´Ø¤·¤Æ¤Ï +.B RFC\ 791 +¤È¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë +.I +¤ò»²¾È¡£ diff --git a/release/man7/regex.7 b/release/man7/regex.7 new file mode 100644 index 00000000..b4f36484 --- /dev/null +++ b/release/man7/regex.7 @@ -0,0 +1,306 @@ +.\" From Henry Spencer's regex package (as found in the apache +.\" distribution). The package carries the following copyright: +.\" +.\" Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. +.\" This software is not subject to any license of the American Telephone +.\" and Telegraph Company or of the Regents of the University of California. +.\" +.\" Permission is granted to anyone to use this software for any purpose +.\" on any computer system, and to alter it and redistribute it, subject +.\" to the following restrictions: +.\" +.\" 1. The author is not responsible for the consequences of use of this +.\" software, no matter how awful, even if they arise from flaws in it. +.\" +.\" 2. The origin of this software must not be misrepresented, either by +.\" explicit claim or by omission. Since few users ever read sources, +.\" credits must appear in the documentation. +.\" +.\" 3. Altered versions must be plainly marked as such, and must not be +.\" misrepresented as being the original software. Since few users +.\" ever read sources, credits must appear in the documentation. +.\" +.\" 4. This notice may not be removed or altered. +.\" +.\" In order to comply with `credits must appear in the documentation' +.\" I added an AUTHOR paragraph below - aeb. +.\" +.\" In the default nroff environment there is no dagger \(dg. +.\" +.\" 2005-05-11 Removed discussion of `[[:<:]]' and `[[:>:]]', which +.\" appear not to be in the glibc implementation of regcomp +.\" +.ie t .ds dg \(dg +.el .ds dg (!) +.\" +.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. +.\" Translated Wed 8 Jul 1998 by NAKANO Takeo +.\" +.\"WORD: regular expression Àµµ¬É½¸½ +.\"WORD: modern RE ¿·¤·¤¤Àµµ¬É½¸½ +.\"WORD: obsolete RE ¸Å¤¤Àµµ¬É½¸½ +.\"WORD: basic RE ´ðËÜÀµµ¬É½¸½ +.\"WORD: extended RE ³ÈÄ¥Àµµ¬É½¸½ +.\"WORD: branch »Þ +.\"WORD: piece ʸÀá +.\"WORD: atom ¥¢¥È¥à +.\"WORD: bound ·«¤êÊÖ¤·»ØÄê +.\"WORD: bracket expression ¥Ö¥é¥±¥Ã¥Èɽ¸½ +.\"WORD: digit ¿ô»ú +.\"WORD: collating sequence ¾È¹ç½ç½ø +.\"WORD: collating element ¾È¹ç½ç½ø¤ÎÍ×ÁÇ +.\"WORD: character class ʸ»ú¥¯¥é¥¹ +.\"WORD: equivalent class Åù²Á¥¯¥é¥¹ +.\"WORD: substring Éôʬʸ»úÎó +.\"WORD: subexpression ÉôʬÀµµ¬É½¸½ +.\" +.TH REGEX 7 2009-01-12 "" "Linux Programmer's Manual" +.SH ̾Á° +regex \- POSIX.2 Àµµ¬É½¸½ +.SH ÀâÌÀ +Àµµ¬É½¸½ (Regular expression: RE) ¤Ï POSIX.2 ¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢ +Æó¤Ä¤Î·Á¼°¤¬¤¢¤ë¡£¿·¤·¤¤Àµµ¬É½¸½ (modern RE) ¤È¸Å¤¤Àµµ¬É½¸½ (obsolete RE) +¤Ç¤¢¤ë¡£¿·¤·¤¤Àµµ¬É½¸½¤Ï¤À¤¤¤¿¤¤ +.I egrep +¤Î¤â¤Î¤ÈƱ¤¸¤Ç¡¢ POSIX.2 ¤Ç¤Ï¡Ö³ÈÄ¥¡×Àµµ¬É½¸½ ("extended" RE) +¤È¸Æ¤Ð¤ì¤Æ¤¤¤ë¡£¸Å¤¤Àµµ¬É½¸½¤Ï¤À¤¤¤¿¤¤ +.BR ed (1) +¤Î¤â¤Î¤ÈƱ¤¸¤Ç¡¢ POSIX.2 ¤Ç¤Ï¡Ö´ðËÜ¡×Àµµ¬É½¸½ ("basic" RE) ¤Ç¤¢¤ë¡£ +¸Å¤¤Àµµ¬É½¸½¤Ï¡¢¸Å¤¤¥×¥í¥°¥é¥à¤È¤Î¸ß´¹À­¤òÊݤĤ¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë¤Ä¤¤¤Æ¤ÏºÇ¸å¤ËµÄÏÀ¤¹¤ë¡£ +POSIX.2 ¤Ç¤Ï¡¢Àµµ¬É½¸½¤Îʸˡ¤äµ­¹æ¤Î°ìÉô¤¬¡¢Ì¤ÄêµÁ¤Î¤Þ¤Þ»Ä¤µ¤ì¤Æ¤¤¤ë¡£ +"\*(dg" ¤Ï¡¢¤³¤Î¤è¤¦¤Ê°ÕÌ£¤Ç¡¢Â¾¤Î POSIX.2 ¤Î¼ÂÁõ¤È +´°Á´¤Ë¤Ï¸ß´¹¤Ç¤Ê¤¤¤«¤âÃΤì¤Ê¤¤Éôʬ¤Ç¤¢¤ë¡£ +.PP +(¿·¤·¤¤) Àµµ¬É½¸½¤Ï°ì¤Ä°Ê¾å\*(dg ¤Î¶õÇò¤Ç¤Ê¤¤ \fI»Þ (branch)\fP ¤«¤é¤Ê¤ë¡£ +»Þ¤É¤¦¤·¤Ï \(aq|\(aq ¤Ç¶èÀÚ¤é¤ì¤ë¡£Àµµ¬É½¸½¤Ï¡¢ +»Þ¤Î¤É¤ì¤«¤Ë¥Þ¥Ã¥Á (match) ¤·¤¿¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +»Þ¤Ï°ì¤Ä°Ê¾å¤ÎʸÀá (piece) ¤¬·ë¹ç¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£ +»Þ¤ÏÂè°ì¤ÎʸÀ᤬¥Þ¥Ã¥Á¤·¡¢ +³¤¤¤ÆÂèÆó¤ÎʸÀ᤬¥Þ¥Ã¥Á¤·¡¢... ¤·¤¿¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +ʸÀá¤Ï\fI¥¢¥È¥à (atom)\fR ¤«¤é¤Ê¤ë¡£¤¿¤À¤·¥¢¥È¥à¤Î¸å¤Ë¤Ï°ì¤Ä\*(dg ¤Î \(aq*\(aq, +\(aq+\(aq, \(aq?\(aq ¤¢¤ë¤¤¤Ï \fI·«¤êÊÖ¤·»ØÄê (bound)\fR ¤¬Â³¤¯¤³¤È¤â¤¢¤ë¡£ +\(aq*\(aq ¤¬¸åÃÖ¤µ¤ì¤¿¥¢¥È¥à¤Ï¡¢¥Þ¥Ã¥Á¤·¤¿¥¢¥È¥à¤Î 0 ¸Ä°Ê¾å¤ÎʤӤ˥ޥåÁ¤¹¤ë¡£ +\(aq+\(aq ¤¬¸åÃÖ¤µ¤ì¤¿¥¢¥È¥à¤Ï¡¢¥Þ¥Ã¥Á¤·¤¿¥¢¥È¥à¤Î 1 ¸Ä°Ê¾å¤ÎʤӤ˥ޥåÁ¤¹¤ë¡£ +\(aq?\(aq ¤¬¸åÃÖ¤µ¤ì¤¿¥¢¥È¥à¤Ï¡¢¥Þ¥Ã¥Á¤·¤¿¥¢¥È¥à¤Î 0 ¸Ä¤Þ¤¿¤Ï 1 ¸Ä¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +\fI·«¤êÊÖ¤·»ØÄê\fR¤È¤Ï \(aq{\(aq ¤Ë³¤¤¤Æ¡¢Éä¹æ¤Ê¤· 10 ¿ÊÀ°¿ô¡¢\(aq,\(aq¡¢ +¤â¤¦°ì¤Ä¤Î 10 ¿ÊÀ°¿ô¡¢\(aq}\(aq ¤òʤ٤¿¤â¤Î¤Ç¤¢¤ë¡£\(aq,\(aq ¤ÈÆó¤Ä¤á¤Î +10 ¿ÊÀ°¿ô¤Ï¾Êά¤Ç¤­¤ë¡£Æó¤Ä¤á¤Î 10 ¿ÊÀ°¿ô¤À¤±¤ò¾Êά¤¹¤ë¤³¤È¤â¤Ç¤­¤ë +(ºÇ¸å¤Î `}' ¤Ï¾Êά¤Ç¤­¤Ê¤¤)¡£ +À°¿ô¤Ï 0 °Ê¾å +.B RE_DUP_MAX +(255\*(dg) °Ê²¼¤Î´Ö¤Ç»ØÄê¤Ç¤­¤ë¡£ +Æó¤Ä»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ºÇ½é¤Î¿ôÃͤϸå¤Î¿ôÃͤò±Û¤¨¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +À°¿ô \fIi\fR ¤À¤±¤«¤é¤Ê¤ë·«¤êÊÖ¤·»ØÄê¤ò¸åÃÖ¤µ¤ì¤¿¥¢¥È¥à¤Ï¡¢ +¥¢¥È¥à¤ò¤Ô¤Ã¤¿¤ê¤Á¤ç¤¦¤É \fIi\fR ¸Ä¤À¤±Ê¤٤¿¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +À°¿ô \fIi\fR ¤È¥³¥ó¥Þ¤¬»ØÄꤵ¤ì¤¿·«¤êÊÖ¤·»ØÄê¤ò¸åÃÖ¤µ¤ì¤¿¥¢¥È¥à¤Ï¡¢ +¥¢¥È¥à¤ò \fIi\fR¸Ä°Ê¾åʤ٤¿¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +À°¿ô \fIi\fR ¤È \fIj\fR ¤¬»ØÄꤵ¤ì¤¿·«¤êÊÖ¤·»ØÄê¤ò¸åÃÖ¤µ¤ì¤¿¥¢¥È¥à¤Ï¡¢ +¥¢¥È¥à¤ò \fIi\fR¸Ä°Ê¾å \fIj\fR ¸Ä°Ê²¼¤À¤±Ê¤٤¿¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +¥¢¥È¥à¤Î¼ïÎà¤Ï°Ê²¼¤ÎÄ̤ꡣ"\fI()\fP" ¤Ë°Ï¤Þ¤ì¤¿Àµµ¬É½¸½ +(¤½¤ÎÀµµ¬É½¸½¤¬¥Þ¥Ã¥Á¤¹¤ëʸ»úÎó¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡¢ +Ãæ¿È¤¬¶õ¤Î "\fI()\fP" (null ʸ»úÎó¤Ë¥Þ¥Ã¥Á¤¹¤ë)\*(dg¡¢ +\fI¥Ö¥é¥±¥Ã¥Èɽ¸½ (bracket expression\fR :¸å½Ò)¡¢ +\(aq.\(aq (Ǥ°Õ¤Î 1 ʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡¢ +\(aq^\(aq (¹ÔƬ¤Î¶õÇòʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡¢ +\(aq$\(aq (¹ÔËö¤Î¶õÇòʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡¢ +\(aq\e\(aq ¤Ë "\fI^.[$()|*+?{\e\fP" ¤Î¤¤¤º¤ì¤«°ìʸ»ú¤ò¸åÃÖ¤·¤¿¤â¤Î +(Ä̾ï¤Îʸ»ú¤È¤·¤Æ°·¤ï¤ì¡¢¤½¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡¢ +\(aq\e\(aq ¤Ë¤½¤ì°Ê³°¤Îʸ»ú¤ò¸åÃÖ¤·¤¿¤â¤Î\*(dg +(\(aq\e\(aq ¤¬¤Ê¤¤¾ì¹ç¤ÈƱ¤¸¤è¤¦¤Ë¡¢¤½¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë\*(dg)¡¢ +Æä˰ÕÌ£¤ò»ý¤¿¤Ê¤¤Ê¸»ú°ì¤Ä (¤½¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë)¡£ +\(aq{\(aq ¤Ï¿ô»ú°Ê³°¤Îʸ»ú¤¬¸åÃÖ¤µ¤ì¤ë¤ÈÄ̾ï¤Îʸ»ú¤È¤·¤Æ°·¤ï¤ì¡¢ +·«¤êÊÖ¤·»ØÄê¤Î»Ï¤Þ¤ê¤È¤Ï¤µ¤ì¤Ê¤¤\*(dg¡£\(aq\e\(aq +¤Ç½ª¤ï¤ëÀµµ¬É½¸½¤ÏÉÔÀµ¤Ê¤â¤Î¤È¤ß¤Ê¤µ¤ì¤ë¡£ +.PP +\fI¥Ö¥é¥±¥Ã¥Èɽ¸½\fR¤Ï "\fI[]\fP" ¤Ë¤è¤Ã¤ÆÊĤ¸¤é¤ì¤¿Ê¸»ú¤Î¥ê¥¹¥È¤Ç¤¢¤ë¡£ +¤³¤ì¤ÏÄ̾ï¥ê¥¹¥ÈÃæ¤Ë¸ºß¤·¤Æ¤¤¤ëʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +(Îã³°¤¢¤ê¡¢¸å½Ò¡£) ¥ê¥¹¥È¤¬ \(aq^\(aq ¤Ç»Ï¤Þ¤ë¤È¡¢ +\fI¥Ö¥é¥±¥Ã¥Èɽ¸½\fR¤Ï¥ê¥¹¥È¤Ë¸ºß¤·¤Æ\fI¤¤¤Ê¤¤\fRʸ»ú°ì¤Ä¤Ë¥Þ¥Ã¥Á¤¹¤ë +(Îã³°¤¢¤ê¡¢¸å½Ò)¡£ ¥ê¥¹¥ÈÃæ¤ÎÆó¤Ä¤Îʸ»ú¤¬ \(aq\-\(aq ¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +¤³¤ì¤Ï¾È¹ç½ç½ø (collating sequence) ¤Ç¤½¤ÎÆó¤Ä¤Îʸ»ú¤Ë¶´¤Þ¤ì¤ë¡¢ +¤¹¤Ù¤Æ¤Îʸ»ú¤ÎʤӤòû½Ì¤·¤¿¤â¤Î¤È¤ß¤Ê¤µ¤ì¤ë (ξü´Þ¤à)¡£ +Î㤨¤Ð "\fI[0\-9]\fP" ¤Ï ASCII ¤Ç¤Ï 10 ¿Ê¤Î¿ô»ú (digit) ¤Î¤¤¤º¤ì¤«¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +Æó¤Ä¤ÎÎΰè»ØÄ꤬üÅÀ¤ò¶¦Í­¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤\*(dg¡£ +¤Ä¤Þ¤ê "\fIa-c-e\fP" ¤Î¤è¤¦¤Ê¤â¤Î¤ÏÉÔÀµ¤Ç¤¢¤ë¡£Îΰè»ØÄê¤Ï¾È¹ç½ç½ø¤Ë¶¯¤¯°Í¸¤¹¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ°Ü¿¢À­¤Î¹â¤¤¥×¥í¥°¥é¥à¤òºî¤ë¾ì¹ç¤Ï¡¢ +Îΰè»ØÄê¤Ë¤ÏÍê¤é¤Ê¤¤¤Û¤¦¤¬Îɤ¤¤À¤í¤¦¡£ +.PP +¡ÚÌõÃí: ¾È¹ç½ç½ø (collating sequence) ¤È¤¤¤¦¤Î¤Ï¡¢¹ñºÝ²½ +(Internationalization) ¤Ë´ØÏ¢¤·¤¿ÍѸì¤Ç¤¹¡£¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Ëñ¸ì¤òÊ +¤Ù¤ëºÝ¤Ë¤Ï¡¢¸À¸ì¤Ë¤è¤Ã¤Æʤ٤ë´ð½à¤¬°Û¤Ê¤ê¤Þ¤¹¡£¾È¹ç½ç½ø¤Ï¡¢¤½¤Îº¹°Û¤ò +µÛ¼ý¤¹¤ë¤¿¤á¤Î»ÅÁȤߤǤ¹¡£ +.PP +Î㤨¤Ð¡¢¥¹¥Ú¥¤¥ó¸ì¤Ç¤Ï ch ¤È¤¤¤¦Ê¸»úʤӤòÆÃÊÌ°·¤¤¤¹¤ë¤¿¤á¡¢¥¢¥ë¥Õ¥¡¥Ù¥Ã +¥È½ç¤¬ a, b, c, ch, d, e, ... ¤Î½ç¤Ë¤Ê¤ë¤½¤¦¤Ç¤¹¡£¤³¤Î¤è¤¦¤Ê¥·¡¼¥±¥ó¥¹ +¤Î¤³¤È¤ò collating sequence ¤È¸À¤¤¤Þ¤¹¡£¤³¤Î¤È¤­ `ch' ¤È¤¤¤¦Ê¸»úʤӤϡ¢ +ñ¸ìÀ°Îó¤ÎºÝ¤Ë¤¢¤¿¤«¤â¡Ö°ìʸ»ú¡×¤Î¤è¤¦¤Ë°·¤ï¤ì¤Þ¤¹¡£¤³¤³¤Ç¡¢ +½ç½øÉÕ¤±¤ò¹Ô¤¦ºÝ¤ËºÇ¾®¤Îñ°Ì¤È¤Ê¤ë¡¢`a'¡¢`b' ¤Îʸ»ú¤ä +`ch' ¤Î¤è¤¦¤ÊÆÃÊ̤Êʸ»úʤӤʤɡ¢¾È¹ç½ç½ø¤ÎÍ×ÁǤΤ³¤È¤ò +collating element ¤È¸À¤¤¤Þ¤¹¡£collating sequence ¤Ï¡¢Ê¸»úñ°Ì¤Ç¤Ï¤Ê¤¯ +collating element ¤òñ°Ì¤È¤·¤ÆÄêµÁ¤µ¤ì¤Þ¤¹¡£¡Û +.PP +ʸ»ú \(aq]\(aq ¤½¤Î¤â¤Î¤ò¥ê¥¹¥È¤ËÆþ¤ì¤¿¤¤¾ì¹ç¤Ï¡¢ +ºÇ½é¤Îʸ»ú¤È¤·¤Æ»ØÄꤹ¤ì¤ÐÎɤ¤ (\(aq^\(aq) ¤Î¸å¤Ë³¤±¤ë¤Î¤Ç¤âÎɤ¤)¡£ +ʸ»ú \(aq\-\(aq ¤½¤Î¤â¤Î¤ò¥ê¥¹¥È¤ËÆþ¤ì¤¿¤¤¾ì¹ç¤Ï¡¢ +ºÇ½é¤«ºÇ¸å¤Îʸ»ú¤È¤¹¤ì¤ÐÎɤ¤¡£ +¤¢¤ë¤¤¤ÏÎΰè»ØÄê¤Î½ªÃ¼Ê¸»ú¤È¤·¤Æ»ØÄꤷ¤Æ¤âÎɤ¤¡£ +\(aq\-\(aq ¤òÎΰè»ØÄê¤ÎÀèƬʸ»ú¤Ë»ØÄꤹ¤ë¤Ë¤Ï¡¢"\fI[.\fP" ¤È "\fI.]\fP" ¤Ç°Ï¤Ã¤Æ¡¢ +¾È¹ç½ç½ø¤ÎÍ×ÁÇ (collating element: ¸å½Ò) ¤Ë¤¹¤ì¤ÐÎɤ¤¡£ +¾¤ÎÆüìʸ»ú ( ¤â´Þ¤à) ¤Ï¡¢ +¥Ö¥é¥±¥Ã¥Èɽ¸½¤ÎÆâÉô¤Ç¤Ï¤¹¤Ù¤ÆÄ̾ï¤Îʸ»ú¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +.PP +¥Ö¥é¥±¥Ã¥Èɽ¸½¤ÎÆâÉô¤Ç¤Ï¡¢"\fI[.\fP" ¤È "\fI.]\fP" ¤Ë°Ï¤ï¤ì¤¿¾È¹ç½ç½ø¤ÎÍ×ÁǤϡ¢ +¤½¤ÎÍ×ÁǤËÂбþ¤¹¤ëʸ»úʤӤòɽ¤¹¡£ +¡Ö¾È¹ç½ç½ø¤ÎÍ×ÁǡפȤϡ¢ +[1] ʸ»ú¡¢ [2] ñ°ìʸ»ú¤Î¤è¤¦¤Ë°·¤ï¤ì¤ëÊ£¿ôʸ»ú¤Î¥·¡¼¥±¥ó¥¹¡¢ +[3] 1, 2 ¤¤¤º¤ì¤«¤ËÂбþ¤¹¤ë¾È¹ç½ç½ø¾å¤Î̾Á°¡¢¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ +¤³¤Î·«¤êÊÖ¤·¤Ï¡¢¥Ö¥é¥±¥Ã¥Èɽ¸½¤Î¥ê¥¹¥È¤Ë¤ª¤±¤ëñ°ì¤ÎÍ×ÁǤȤʤ롣 +¾åµ­ [2] ¤Î¡¢¡ÖÊ£¿ôʸ»ú¤«¤é¤Ê¤ë¾È¹ç½ç½øÍ×Áǡפò´Þ¤à¥Ö¥é¥±¥Ã¥Èɽ¸½¤Ï¡¢ +¤·¤¿¤¬¤Ã¤Æ°ìʸ»ú°Ê¾å¤Ë¥Þ¥Ã¥Á¤¹¤ë¤³¤È¤¬¤¢¤ë¡£ +Î㤨¤Ð¡¢¤â¤·¾È¹ç½ç½ø¤¬ "ch" ¤È¤¤¤¦Í×ÁǤò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +Àµµ¬É½¸½ "\fI[[.ch.]]*c\fP" ¤Ï "chchcc" ¤ÎºÇ½é¤Î 5 ʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +¥Ö¥é¥±¥Ã¥Èɽ¸½¤ÎÆâÉô¤Ç¤Ï¡¢"\fI[=\fP" ¤È "\fI=]\fP" ¤Ë°Ï¤Þ¤ì¤¿¾È¹ç½ç½ø¤ÎÍ×ÁǤϡ¢ +Åù²Á¥¯¥é¥¹ (equivalence class) ¤È¤Ê¤ë¡£ +¤³¤ì¤Ï¡¢¤½¤ÎÍ×ÁǤÈÅù²Á¤ÊÍ×ÁǤ¹¤Ù¤Æ¤«¤é¤Ê¤ëʸ»ú¥·¡¼¥±¥ó¥¹ (¼«¿È¤â´Þ¤à) ¤òɽ¤¹¡£ +¾¤ËÅù²Á¤ÊÍ×ÁǤ¬¤Ê¤±¤ì¤Ð¡¢ +¼è¤ê°·¤¤¤Ï "\fI[.\fP" ¤È "\fI.]\fP" ¤Ç°Ï¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +Î㤨¤Ð o ¤È ou ¤¬Åù²Á¥¯¥é¥¹¤Î¥á¥ó¥Ð¡¼¤Ç¤¢¤ì¤Ð¡¢ +"\fI[[=o=]]\fP", "\fI[[=\o'o^'=]]\fP", "\fI[o\o'o^']\fP" ¤Ï¤¹¤Ù¤ÆƱ¤¸°ÕÌ£¤Ë¤Ê¤ë¡£ +Åù²Á¥¯¥é¥¹¤ÏÎΰè»ØÄê¤ÎüÅÀ¤Ë¤Ï¤Ê¤ì¤Ê¤¤\*(dg¡£ +.\" nippon üËö¤Ç¤Ï \o'o^' ¤¬Àµ¤·¤¯½Ð¤Ê¤¤¤Î¤Ç¡¢Î㼨¤òÊѹ¹¤·¤Þ¤·¤¿¡£ +.PP +¥Ö¥é¥±¥Ã¥Èɽ¸½¤ÎÆâÉô¤Ç¤Ï¡¢"\fI[:\fP" ¤È "\fI:]\fP" ¤Ç°Ï¤ï¤ì¤¿\fIʸ»ú¥¯¥é¥¹ +(character class)\fR ¤Ï¤½¤Î¥¯¥é¥¹¤Ë°¤¹¤ë¤¹¤Ù¤Æ¤Îʸ»ú¤Î¥ê¥¹¥È¤òɽ¤¹¡£ +ɸ½à¤ÇÍÑ°Õ¤µ¤ì¤Æ¤¤¤ëʸ»ú¥¯¥é¥¹¤Î̾Á°¤Ï°Ê²¼¤ÎÄ̤ê: +.PP +.RS +.nf +.ta 3c 6c 9c +alnum digit punct +alpha graph space +blank lower upper +cntrl print xdigit +.fi +.RE +.PP +¤³¤ì¤é¤Ï +.BR wctype (3) +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëʸ»ú¥¯¥é¥¹¤òɽ¤·¤Æ¤¤¤ë¡£¥í¥±¡¼¥ë (locale) ¤Ë¤è¤Ã¤Æ¡¢ +¤³¤ì¤é°Ê³°¤Î¥¯¥é¥¹¤¬ÄêµÁ¤µ¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +ʸ»ú¥¯¥é¥¹¤ÏÎΰè»ØÄê¤ÎüÅÀ¤Ë¤Ï¤Ê¤ì¤Ê¤¤¡£ +.\" .PP +.\" http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295666 ¤Ë¤¢¤ë¤è¤¦¤Ë +.\" °Ê²¼¤Îµ­ºÜ¤Ï glibc ¤Î¼ÂÁõ¤Ë¤Ï¤¢¤Æ¤Ï¤Þ¤é¤Ê¤¤¤è¤¦¤Ç¤¢¤ë¡£ +.\" ¥Ö¥é¥±¥Ã¥Èɽ¸½¤Ë¤Ï¡¢Æüì¤Ê°ÕÌ£¤ò»ý¤Ä¤â¤Î¤¬Æó¤Ä¸ºß¤¹¤ë\*(dg¡£ +.\" ¥Ö¥é¥±¥Ã¥Èɽ¸½ "\fI[[:<:]]\fP" ¤Ï¥ï¡¼¥É (word) ÀèƬ¤Î¥Ì¥ëʸ»úÎó¤Ë¡¢ +.\" "\fI[[:>:]]\fP" ¤Ï¥ï¡¼¥ÉËöÈø¤Î¥Ì¥ëʸ»úÎó¤Ë¤½¤ì¤¾¤ì¥Þ¥Ã¥Á¤¹¤ë¡£ +.\" ¥ï¡¼¥É¤È¤Ï¥ï¡¼¥Éʸ»ú¤ÎʤӤǤ¢¤ê¡¢ +.\" ¥ï¡¼¥Éʸ»ú¤¬Á°ÃÖ¤â¸åÃ֤⤵¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¡£ +.\" ¥ï¡¼¥Éʸ»ú¤Ï +.\" .I alnum +.\" ʸ»ú +.\" .RB ( wctype (3) +.\" ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë) ¤ª¤è¤Ó¥¢¥ó¥À¡¼¥¹¥³¥¢ `_' ¤Ç¤¢¤ë¡£ +.\" ¤³¤ì¤Ï³ÈÄ¥µ­Ë¡¤Ç¤¢¤ê¡¢POSIX.2 ¤ËÈ¿¤·¤Æ¤Ï¤¤¤Ê¤¤¤¬¡¢ +.\" ÄêµÁ¤â¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" ¾¤Î¥·¥¹¥Æ¥à¤È¸ß´¹À­¤ò³ÎÊݤ·¤¿¤¤¥½¥Õ¥È¥¦¥§¥¢¤Ç¤Ï¡¢ +.\" Ãí°Õ¤·¤ÆÍѤ¤¤ë¤è¤¦¤Ë¤¹¤ë¤³¤È¡£ +.PP +Àµµ¬É½¸½¤¬¡¢Í¿¤¨¤é¤ì¤¿Ê¸»úÎó¤ÎÊ£¿ô¤ÎÉôʬʸ»úÎó +(substring) ¤Ë¥Þ¥Ã¥Á¤Ç¤­¤ë¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï¡¢ +ºÇ¤âÀèƬ¤Î¶á¤¯¤«¤é»Ï¤Þ¤ë¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +¤½¤Î°ÌÃÖ¤«¤é»Ï¤Þ¤ê¡¢Àµµ¬É½¸½¤¬¥Þ¥Ã¥Á¤Ç¤­¤ëÉôʬʸ»úÎó¤¬Ê£¿ô¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢ +ºÇŤΤâ¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +ÉôʬÀµµ¬É½¸½ (subexpression) ¤âºÇ¤âŤ¤Éôʬʸ»úÎó¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +¤¿¤À¤·¡¢Á´ÂΤΥޥåÁ¤¬ºÇŤǤ¢¤ë¤è¤¦¤Ë¡¢¤È¤¤¤¦¾ò·ï¤¬Í¥À褵¤ì¤ë¡£ +Àµµ¬É½¸½¤ÎÃæ¤ÇÀè¤Ë¸½¤ì¤ëÉôʬÀµµ¬É½¸½¤Ï¡¢¸å¤Ë¸½¤ì¤ë¤â¤Î¤è¤êÍ¥À褵¤ì¤ë¡£ +¤¿¤À¤·¡¢¤è¤ê¹â°Ì¤ÎÉôʬÀµµ¬É½¸½¤Ï¡¢ +¤½¤ì¤ò¹½À®¤¹¤ëÄã°Ì¤ÎÉôʬÀµµ¬É½¸½¤è¤ê¤âÍ¥À褵¤ì¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.PP +¥Þ¥Ã¥ÁĹ¤Ï¾È¹ç½ç½ø¤ÎÍ×ÁǤǤϤʤ¯¡¢Ê¸»ú¿ô¤òñ°Ì¤È¤·¤Æ¥«¥¦¥ó¥È¤µ¤ì¤ë¡£ +null ʸ»úÎó¤Ï¡¢Á´¤¯¥Þ¥Ã¥Á¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤è¤ê¤âŤ¤¤È¤ß¤Ê¤µ¤ì¤ë¡£ +Î㤨¤Ð "\fIbb*\fP" ¤Ï "abbbc" ¤Î¤Þ¤óÃæ¤Î 3 ʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +"\fI(wee|week)(knights|nights)\fP" ¤Ï "weeknights" ¤ÎÁ´ÂΤ˥ޥåÁ¤¹¤ë¡£ +"\fI(.*).*\fP" ¤ò "abc" ¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¤È¡¢ +³ç¸Ì¤ÎÆâÉô¤ÎÉôʬÀµµ¬É½¸½¤¬ 3 ʸ»ú¤¹¤Ù¤Æ¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +"\fI(a*)*\fP" ¤ò "bc" ¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¤È¡¢Àµµ¬É½¸½Á´ÂΤ⡢ +³ç¸Ì¤Ç³ç¤é¤ì¤¿ÉôʬÀµµ¬É½¸½¤â null ʸ»úÎó¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +.PP +¥Þ¥Ã¥Á¤¬Âçʸ»ú¡¦¾®Ê¸»ú¤ò̵»ë¤¹¤ë¤è¤¦¤Ë»ØÄꤵ¤ì¤ë¤È¡¢ +¥¢¥ë¥Õ¥¡¥Ù¥Ã¥ÈÁ´ÂΤ«¤éÂ羮ʸ»ú¤Î¶èÊ̤¬Ìµ¤¯¤Ê¤Ã¤¿¤«¤Î¤è¤¦¤Ê¸ú²Ì¤È¤Ê¤ë¡£ +Âçʸ»ú¡¦¾®Ê¸»ú¤ò»ý¤Ä¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤¬¥Ö¥é¥±¥Ã¥Èɽ¸½¤Î³°Éô¤Ç +Ä̾ï¤Îʸ»ú¤È¤·¤Æ¸½¤ì¤ë¤È¡¢ +¤³¤ì¤Ï¼Â¸úŪ¤ËÂ羮ξÊý¤Îʸ»ú¤Î¥Ö¥é¥±¥Ã¥Èɽ¸½¤Î¤è¤¦¤ËÊÑ´¹¤µ¤ì¤ë¡£ +¤¹¤Ê¤ï¤Á \(aqx\(aq ¤Ï "\fI[xX]\fP" ¤È¤Ê¤ë¡£¥Ö¥é¥±¥Ã¥Èɽ¸½¤ÎÆâÉô¤Ë¸½¤ì¤ë¤È¡¢ +Âçʸ»ú¤Ê¤é¾®Ê¸»ú¤¬¡¢¾®Ê¸»ú¤Ê¤éÂçʸ»ú¤¬¤½¤Î¥Ö¥é¥±¥Ã¥Èɽ¸½¤Ë²Ã¤¨¤é¤ì¤ë¡£ +¤¹¤Ê¤ï¤Á +"\fI[x]\fP" ¤Ï "\fI[xX]\fP" ¤Ë¡¢"\fI[^x]\fP" ¤Ï "\fI[^xX]\fP" ¤Ë¤Ê¤ë¡£ +.PP +Àµµ¬É½¸½¤ÎŤµ¤Ë¤ÏÆäËÀ©¸Â¤Ï¤Ê¤¤\*(dg¡£ +¤¿¤À¤·°Ü¿¢À­¤ò¹â¤¯¤·¤¿¤¤¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +256 ¥Ð¥¤¥È¤è¤êŤ¤Àµµ¬É½¸½¤Ï¼Â¹Ô¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Û¤¦¤¬Îɤ¤¡£ +¤Ê¤¼¤Ê¤é¡¢¤½¤Î¤è¤¦¤ÊÀµµ¬É½¸½¤òµñÈݤ·¡¢ +¤·¤«¤â POSIX ¸ß´¹¤òÊݤĤ褦¤Ê¼ÂÁõ¤¬²Äǽ¤À¤«¤é¤Ç¤¢¤ë¡£ +.PP +¸Å¤¤ ("´ðËÜ") Àµµ¬É½¸½¤Ï¡¢¤¤¤¯¤Ä¤«¤ÎÅÀ¤Ë¤ª¤¤¤Æ°Û¤Ê¤ë¡£ +\(aq|\(aq, \(aq+\(aq, and \(aq?\(aq ¤ÏÄ̾ï¤Îʸ»ú¤È¤Ê¤ë¡£ +Âбþ¤¹¤ëµ¡Ç½¤Ï¸ºß¤·¤Ê¤¤¡£·«¤êÊÖ¤·»ØÄê¤Î¶èÀÚ¤ê¤Ï +"\fI\e{\fP" ¤ª¤è¤Ó "\fI\e}\fP" ¤È¤Ê¤ë¡£\(aq{\(aq ¤È \(aq}\(aq ¤Ï¡¢ +ñÆȤǤÏÄ̾ï¤Îʸ»ú¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +ÉôʬÀµµ¬É½¸½¤ò¥Í¥¹¥È¤¹¤ë³ç¸Ì¤Ï "\fI\e(\fP" ¤ª¤è¤Ó "\fI\e)\fP" ¤È¤Ê¤ê¡¢ +\(aq(\(aq ¤È \(aq)\(aq ¤ÏñÆȤǤÏÄ̾ï¤Îʸ»ú¤È¤Ê¤ë¡£ +\(aq^\(aq ¤ÏÀµµ¬É½¸½¤ÎÀèƬ¤«¡¢ +³ç¸Ì¤Ç¤¯¤¯¤é¤ì¤¿Éôʬɽ¸½¤ÎÀèƬ\*(dg¤ò½ü¤¤¤ÆÄ̾ï¤Îʸ»ú¤È¤Ê¤ë¡£ +\(aq$\(aq ¤ÏÀµµ¬É½¸½¤ÎËöÈø¤«¡¢ +³ç¸Ì¤Ç¤¯¤¯¤é¤ì¤¿ÉôʬÀµµ¬É½¸½¤ÎËöÈø\*(dg¤ò½ü¤¤¤ÆÄ̾ï¤Îʸ»ú¤È¤Ê¤ë¡£ +\(aq*\(aq ¤Ï¡¢Àµµ¬É½¸½¤ÎÀèƬ¤«¡¢ +³ç¸Ì¤Ç¤¯¤¯¤é¤ì¤¿Éôʬʸ»úÎó¤ÎÀèƬ¤ËÃÖ¤«¤ì¤¿¾ì¹ç¤ÏÄ̾ï¤Îʸ»ú¤È¤Ê¤ë +(\(aq^\(aq) ¤¬Á°ÃÖ¤µ¤ì¤Æ¤¤¤Æ¤â¤è¤¤)¡£ +.PP +ºÇ¸å¤Ë¡¢¥¢¥È¥à¤È¤·¤ÆÊ̤Υ¿¥¤¥×¤¬Â¸ºß¤¹¤ë¡£ +\fI¸åÊý»²¾È (back reference)\fR ¤Ç¤¢¤ë¡£ +\(aq\e\(aq ¤Î¸å¤Ë 0 ¤Ç¤Ê¤¤ 10 ¿Ê¿ôÃÍʸ»ú \fId\fR ¤¬Â³¤¯¤È¡¢ +³ç¸Ì¤Ç¤¯¤¯¤é¤ì¤¿ÉôʬÀµµ¬É½¸½¤Î +\fId\fR ÈÖÌܤ˥ޥåÁ¤·¤¿Ê¸»úʤӤÈƱ¤¸¤â¤Î¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£ +(ÉôʬÀµµ¬É½¸½¤ÎÈÖ¹æÉÕ¤±¤Ï¡¢ +³«¤­³ç¸Ì `(' ¤Î°ÌÃÖ¤¬º¸¤Î¤â¤Î¤«¤é±¦¤Î¤â¤Î¤Ø¸þ¤«¤Ã¤Æ¤Ê¤µ¤ì¤ë¡£) +¤·¤¿¤¬¤Ã¤Æ "\fI\e([bc]\e)\e1\fP" ¤Ï +"bb" ¤Þ¤¿¤Ï "cc" ¤Ë¤Ï¥Þ¥Ã¥Á¤¹¤ë¤¬¡¢"bc" ¤Ë¤Ï¥Þ¥Ã¥Á¤·¤Ê¤¤¡£ +.SH ¥Ð¥° +Àµµ¬É½¸½¤¬ 2 ¼ïÎढ¤ë¤Î¤Ï³Ê¹¥°­¤¤¡£ +.PP +¸½ºß¤Î POSIX.2 µ¬³Ê¤Ë¤ª¤¤¤Æ¤Ï¡¢\(aq)\(aq ¤Ï¡¢ +Âбþ¤¹¤ë \(aq(\(aq ¤¬¤Ê¤¤¾ì¹ç¤Ë¤ÏÄ̾ï¤Îʸ»ú¤È¤·¤Æ°·¤ï¤ì¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤·¤«¤·¤³¤ì¤Ï¡¢ËÜÍè¤Î°Õ¿Þ¤È¤Ï°Û¤Ê¤ëµ­½Ò¾å¤Î¥¨¥é¡¼¤Ç¤¢¤ê¡¢ +½¤Àµ¤µ¤ì¤ë²ÄǽÀ­¤¬¹â¤¤¡£¤³¤ì¤Ë°Í¸¤·¤¿¥³¡¼¥É¤Ï»È¤ï¤Ê¤¤¤³¤È¡£ +.PP +¸åÊý»²¾È¤Ï¤Ò¤É¤¯½ÐÍè¤Î°­¤¤Âåʪ¤Ç¤¢¤ë¡£ +¸úΨ¤ÎÎɤ¤¼ÂÁõ¤ò¤¹¤ë¤Î¤Ï¤È¤Æ¤âÆñ¤·¤¤¡£ +¤Þ¤¿ÄêµÁ¤¬¤¢¤¤¤Þ¤¤¤Ç¤¢¤ë¡£ +("\fIa\e(\e(b\e)*\e2\e)*d\fP" ¤Ï "abbbd" ¤Ë¥Þ¥Ã¥Á¤¹¤ë¤È»×¤¦¤«¡©) +»È¤ï¤Ê¤¤¤Û¤¦¤¬Îɤ¤¡£ +.PP +POSIX.2 ¤Îµ¬³Ê¤Ç¤Ï¡¢case (Âçʸ»ú¤«¾®Ê¸»ú¤«) +¤Ë°Í¸¤·¤Ê¤¤¥Þ¥Ã¥Á¤Îµ­½Ò¤¬¤¢¤¤¤Þ¤¤¤Ç¤¢¤ë¡£ +¸½ºß¤Î¤È¤³¤í¤Ç¤Ï¡Ö°ì¤Ä¤Î case ¤¬¤¹¤Ù¤Æ¤Î case ¤ò°ÕÌ£¤¹¤ë¡× +¤È¤¤¤¦¾åµ­¤ÎÄêµÁ¤¬Àµ¤·¤¤²ò¼á¤Ç¤¢¤ë¤È¤¤¤¦¤Î¤¬¡¢ +¼ÂÁõ¼Ô¤Î´Ö¤Ç¤Î¶¦ÄÌǧ¼±¤Î¤è¤¦¤Ç¤¢¤ë¡£ +.\" As per http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295666 +.\" The following does not seem to apply in the glibc implementation +.\" .PP +.\" ¥ï¡¼¥É¶­³¦¤Ë´Ø¤¹¤ëʸˡÄêµÁ¤¬Èó¾ï¤Ë½¹¤¤¡£ +.SH Ãø¼Ô +.\" Sigh... The page license means we must have the author's name +.\" in the formatted output. +¤³¤Î¥Ú¡¼¥¸¤Ï Henry Spencer ¤Î regex ¥Ñ¥Ã¥±¡¼¥¸¤«¤éºÎÏ¿¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR grep (1), +.BR regex (3) +.PP +POSIX.2, section 2.8 (Regular Expression Notation). diff --git a/release/man7/rtnetlink.7 b/release/man7/rtnetlink.7 new file mode 100644 index 00000000..14889532 --- /dev/null +++ b/release/man7/rtnetlink.7 @@ -0,0 +1,467 @@ +'\" t +.\" Don't remove the line above, it tells man that tbl is needed. +.\" This man page is Copyright (C) 1999 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. +.\" Based on the original comments from Alexey Kuznetsov, written with +.\" help from Matthew Wilcox. +.\" $Id: rtnetlink.7,v 1.10 2001/04/04 08:02:19 ysato Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated Mon 6 Dec 1999 by NAKANO Takeo +.\" +.\"WORD queueing dicipline ¥­¥å¡¼¥¤¥ó¥°(¤Î)¥ë¡¼¥ë +.\"WORD permanent ±Ê³Ū¤Ê +.\"WORD neighbor ¶á˵ +.\" +.TH RTNETLINK 7 2008-08-08 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +rtnetlink, NETLINK_ROUTE \- Linux IPv4 ¥ë¡¼¥Æ¥£¥ó¥°¥½¥±¥Ã¥È +.SH ½ñ¼° +.B #include +.br +.B #include +.br +.B #include +.br +.B #include +.sp +.BI "rtnetlink_socket = socket(AF_NETLINK, int " socket_type ", NETLINK_ROUTE);" +.SH ÀâÌÀ +.B rtnetlink +¤Ï¥«¡¼¥Í¥ë¤Î¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤òÆɤó¤À¤êÊѹ¹¤·¤¿¤ê +¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£¤³¤ì¤Ï¥«¡¼¥Í¥ë¤¬ÆâÉô¤Î¥µ¥Ö¥·¥¹¥Æ¥à¤È +ÄÌ¿®¤¹¤ë¤¿¤á¤Ë¤âÍѤ¤¤é¤ì¤Æ¤¤¤ë¤¬¡¢¤½¤ì¤Ï¤³¤³¤Ç¤Ïµ­½Ò¤·¤Ê¤¤¡£ +¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ï¥æ¡¼¥¶¡¼¶õ´Ö¤Î¥×¥í¥°¥é¥à¤È¤ÎÄÌ¿®¤Ë´Ø¤·¤Æ¤Î¤ß½Ò¤Ù¤ë¡£ +¥Í¥Ã¥È¥ï¡¼¥¯·ÐÏ©¡¦IP ¥¢¥É¥ì¥¹¡¦¥ê¥ó¥¯¥Ñ¥é¥á¡¼¥¿¡¦ +¶á˵ÀßÄê (neighbor setup)¡¦¥­¥å¡¼¥¤¥ó¥°¥ë¡¼¥ë (queueing dicipline)¡¦ +¥È¥é¥Õ¥£¥Ã¥¯¥¯¥é¥¹¡¦¥Ñ¥±¥Ã¥È¤Î¥¯¥é¥¹Ê¬Îà¤Ê¤É¤¬¡¢¤¹¤Ù¤Æ +.B NETLINK_ROUTE +¥½¥±¥Ã¥È¤òÄ̤·¤ÆÀ©¸æ¤Ç¤­¤ë¡£ +.B rtnetlink +¤Ï netlink ¥á¥Ã¥»¡¼¥¸¤ò¥Ù¡¼¥¹¤Ë¤·¤Æ¤¤¤ë¡£¾ÜºÙ¤Ï +.BR netlink (7) +¤ò¸«¤ë¤³¤È¡£ +.\" FIXME ? all these macros could be moved to rtnetlink(3) +.SS ¥ë¡¼¥Æ¥£¥ó¥°Â°À­ +rtnetlink ¥á¥Ã¥»¡¼¥¸¤Ë¤Ï¡¢½é´ü¥Ø¥Ã¥À¤Î¸å¤ËÉÕ²ÃŪ¤Ê°À­¤ò +»ý¤Ä¤â¤Î¤¬¤¢¤ë¡£ + +.in +4n +.nf +struct rtattr { + unsigned short rta_len; /* Length of option */ + unsigned short rta_type; /* Type of option */ + /* Data follows */ +}; +.fi +.in + +¤³¤ì¤é¤Î°À­¤ÎÁàºî¤Ï¡¢ RTA_* ¥Þ¥¯¥í¤« libnetlink ¤òÄ̤·¤Æ¤Î¤ß +¹Ô¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.BR rtnetlink (3) +¤ò¸«¤è¡£ +.SS ¥á¥Ã¥»¡¼¥¸ +rtnetlink ¤Ï (ɸ½àŪ¤Ê netlink ¥á¥Ã¥»¡¼¥¸¤Ë²Ã¤¨¤Æ) +°Ê²¼¤Î¥á¥Ã¥»¡¼¥¸¥¿¥¤¥×¤«¤é¹½À®¤µ¤ì¤ë¡£ +.TP +.BR RTM_NEWLINK ", " RTM_DELLINK ", " RTM_GETLINK +»ØÄꤷ¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¾ðÊó¤ò¡¢À¸À®¡¦ºï½ü¡¦¼èÆÀ¤¹¤ë¡£ +¤³¤ì¤é¤Î¥á¥Ã¥»¡¼¥¸¤Ï +.I ifinfomsg +¹½Â¤ÂΤȡ¢¤½¤ì¤Ë³¤¤¤Æ¤¤¤¯¤Ä¤«¤Î +.I rtattr +¹½Â¤ÂΤòȼ¤¦¡£ + +.nf +struct ifinfomsg { + unsigned char ifi_family; /* AF_UNSPEC */ + unsigned short ifi_type; /* Device type */ + int ifi_index; /* Interface index */ + unsigned int ifi_flags; /* Device flags */ + unsigned int ifi_change; /* change mask */ +}; +.fi + +.\" FIXME ifi_type +.I ifi_flags +¤Ï¥Ç¥Ð¥¤¥¹¤Î¥Õ¥é¥°¤Ç¤¢¤ë¡£ +.BR netdevice (7) +¤ò¸«¤è¡£ +.I ifi_index +¤Ï¾¤È½Å¤Ê¤é¤Ê¤¤¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î index ¤Ç¤¢¤ë¡£ +.I ifi_change +¤Ï¾­Íè¤ÎÍøÍѤΤ¿¤á¤ËͽÌ󤵤ì¤Æ¤ª¤ê¡¢¾ï¤Ë +0xFFFFFFFF ¤Ë¥»¥Ã¥È¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.TS +tab(:); +c +l l l. +¥ë¡¼¥Æ¥£¥ó¥°Â°À­ +rta_type:Ãͤη¿:ÀâÌÀ +_ +IFLA_UNSPEC:-:»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£ +IFLA_ADDRESS:hardware address:T{ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ L2 ¥¢¥É¥ì¥¹ +T} +IFLA_BROADCAST:hardware address:T{ +L2 ¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹ +T} +IFLA_IFNAME:asciiz string:¥Ç¥Ð¥¤¥¹Ì¾ +IFLA_MTU:unsigned int:¥Ç¥Ð¥¤¥¹¤Î MTU +IFLA_LINK:int:¥ê¥ó¥¯¥¿¥¤¥× +IFLA_QDISC:asciiz string:¥­¥å¡¼¥¤¥ó¥°¤Î¥ë¡¼¥ë +IFLA_STATS:T{ +²¼µ­»²¾È +T}:¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÎÅý·× +.TE +.sp +IFLA_STATS ¤ÎÃͤη¿¤Ï \fIstruct net_device_stats\fP ¤Ç¤¢¤ë¡£ +.TP +.BR RTM_NEWADDR ", " RTM_DELADDR ", " RTM_GETADDR +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î IP ¥¢¥É¥ì¥¹¤Î¾ðÊó¤òÄɲᦺï½ü¡¦¼èÆÀ¤¹¤ë¡£ +Linux 2.2 ¤Ç¤Ï¡¢°ì¤Ä¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ËÊ£¿ô¤Î IP ¥¢¥É¥ì¥¹¤ò +ÊÝ»ý¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¡¢¤³¤ì¤Ï 2.0 ¤ÎÊÌ̾¥Ç¥Ð¥¤¥¹¤Î³µÇ°¤òÃÖ¤­´¹¤¨¤ë¡£ +Linux 2.2 ¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥á¥Ã¥»¡¼¥¸¤Ï +IPv4 ¤È IPv6 ¤ÎξÊý¤Î¥¢¥É¥ì¥¹¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Ï +.I ifaddrmsg +¹½Â¤ÂΤòȼ¤¦¡£¤½¤Î¤¢¤È¤Ë +.I rtaddr +¥ë¡¼¥Æ¥£¥ó¥°Â°À­¤¬Â³¤¯¤³¤È¤â¤¢¤ë¡£ + +.nf +struct ifaddrmsg { + unsigned char ifa_family; /* Address type */ + unsigned char ifa_prefixlen; /* Prefixlength of address */ + unsigned char ifa_flags; /* Address flags */ + unsigned char ifa_scope; /* Address scope */ + int ifa_index; /* Interface index */ +}; +.fi + +.I ifa_family +¤Ï¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Î¥¿¥¤¥×¤Ç¤¢¤ë (¸½ºß¤Ï +.B AF_INET +¤Þ¤¿¤Ï +.BR AF_INET6 )¡£ +.I ifa_prefixlen +¤Ï¥¢¥É¥ì¥¹¤Î¥¢¥É¥ì¥¹¥Þ¥¹¥¯¤ÎŤµ¤Ç¤¢¤ë (IPv4 ¤Î¤è¤¦¤Ë¡¢ +¤½¤Î¥Õ¥¡¥ß¥ê¡¼¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç)¡£ +.I ifa_scope +¤Ï¥¢¥É¥ì¥¹¤Î¥¹¥³¡¼¥×¤Ç¤¢¤ë¡£ +.I ifa_index +¤Ï¥¢¥É¥ì¥¹¤¬´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î index ¤Ç¤¢¤ë¡£ +.I ifa_flags +¤Ï¥Õ¥é¥°¥ï¡¼¥É¤Ç¡¢ +Æó¤Ä¤á¤Î¥¢¥É¥ì¥¹ (¸Å¤¤ÊÌ̾¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹) ¤Î¾ì¹ç¤Ï +.B IFA_F_SECONDARY +¤Ë¡¢±Ê³Ū¤Ê¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï +.B IFA_F_PERMANENT +¤ËŬÍѤµ¤ì¤ë¡£¥æ¡¼¥¶¡¼¤Ë¤è¤Ã¤Æ¥»¥Ã¥È¤µ¤ì¤ë¥Õ¥é¥°¤È¡¢ +undocumented ¤Ê¥Õ¥é¥°¤¬¤¢¤ë¡£ +.TS +tab(:); +c +l l l. +°À­ +rta_type:Ãͤη¿:ÀâÌÀ +_ +IFA_UNSPEC:-:»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤ +IFA_ADDRESS:raw protocol address:¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹ +IFA_LOCAL:raw protocol address:¥í¡¼¥«¥ë¥¢¥É¥ì¥¹ +IFA_LABEL:asciiz string:¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î̾Á° +IFA_BROADCAST:raw protocol address:¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹ +IFA_ANYCAST:raw protocol address:anycast ¥¢¥É¥ì¥¹ +IFA_CACHEINFO:struct ifa_cacheinfo:¥¢¥É¥ì¥¹¾ðÊó +.TE +.\" FIXME struct ifa_cacheinfo +.TP +.BR RTM_NEWROUTE ", " RTM_DELROUTE ", " RTM_GETROUTE +¥Í¥Ã¥È¥ï¡¼¥¯·ÐÏ©¤Î¾ðÊó¤òÀ¸À®¡¦ºï½ü¡¦¼èÆÀ¤¹¤ë¡£ +¤³¤ì¤é¤Î¥á¥Ã¥»¡¼¥¸¤Ï +.I rtmsg +¹½Â¤ÂΤòȼ¤¦¡£¤½¤Î¤¢¤È¤Ë¤¤¤¯¤Ä¤«¤Î +.I rtattr +¹½Â¤ÂΤò³¤±¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.B RTM_GETROUTE +¤Ç +.I rtm_dst_len +¤È +.I rtm_src_len +¤Ë 0 ¤ò¥»¥Ã¥È¤¹¤ë¤È¡¢ +»ØÄꤵ¤ì¤¿¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤ÎÁ´¤Æ¤Î¥¨¥ó¥È¥ê¤ò½êÆÀ¤¹¤ë¡£ +.I rtm_table +¤È +.I rtm_protocol +°Ê³°¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤òÆþ¤ì¤ë¤È¡¢¥ï¥¤¥ë¥É¥«¡¼¥É¤ò°ÕÌ£¤¹¤ë¡£ + +.nf +struct rtmsg { + unsigned char rtm_family; /* Address family of route */ + unsigned char rtm_dst_len; /* Length of destination */ + unsigned char rtm_src_len; /* Length of source */ + unsigned char rtm_tos; /* TOS filter */ + + unsigned char rtm_table; /* Routing table ID */ + unsigned char rtm_protocol; /* Routing protocol; see below */ + unsigned char rtm_scope; /* See below */ + unsigned char rtm_type; /* See below */ + + unsigned int rtm_flags; +}; +.fi +.TS +tab(:); +l l. +rtm_type:·ÐÏ©¤Î¥¿¥¤¥× +_ +RTN_UNSPEC:̤ÃΤηÐÏ© +RTN_UNICAST:¥²¡¼¥È¥¦¥§¥¤¤Þ¤¿¤Ï¥À¥¤¥ì¥¯¥È¤Ê·ÐÏ© +RTN_LOCAL:¥í¡¼¥«¥ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î·ÐÏ© +RTN_BROADCAST:T{ +¥í¡¼¥«¥ë¤Ê¥Ö¥í¡¼¥É¥­¥ã¥¹¥È·ÐÏ© +(¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤È¤·¤ÆÁ÷¿®¤µ¤ì¤ë) +T} +RTN_ANYCAST:T{ +¥í¡¼¥«¥ë¤Ê¥Ö¥í¡¼¥É¥­¥ã¥¹¥È·ÐÏ© +(¥æ¥Ë¥­¥ã¥¹¥È¤È¤·¤ÆÁ÷¿®¤µ¤ì¤ë) +T} +RTN_MULTICAST:¥Þ¥ë¥Á¥­¥ã¥¹¥È·ÐÏ© +RTN_BLACKHOLE:¥Ñ¥±¥Ã¥È¤ò¼Î¤Æ¤ë·ÐÏ© +RTN_UNREACHABLE:Åþã¤Ç¤­¤Ê¤¤¹Ô¤­Àè +RTN_PROHIBIT:¥Ñ¥±¥Ã¥È¤òµñÈݤ¹¤ë·ÐÏ© +RTN_THROW:·Ðϩõº÷¤òÊ̤Υơ¼¥Ö¥ë¤Ç·Ñ³ +RTN_NAT:¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ÎÊÑ´¹¥ë¡¼¥ë +RTN_XRESOLVE:T{ +³°Éô¥ì¥¾¥ë¥Ð¤ò»²¾È (¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +T} +.TE +.TS +tab(:); +l l. +rtm_protocol:·ÐÏ©¤Î¾ðÊó¸» +_ +RTPROT_UNSPEC:ÉÔÌÀ +RTPROT_REDIRECT:T{ +ICMP ¥ê¥À¥¤¥ì¥¯¥È¤Ë¤è¤ë (¸½ºß¤ÏÍѤ¤¤é¤ì¤Ê¤¤) +T} +RTPROT_KERNEL:¥«¡¼¥Í¥ë¤Ë¤è¤ë +RTPROT_BOOT:¥Ö¡¼¥È»þ +RTPROT_STATIC:´ÉÍý¼Ô¤Ë¤è¤ë +.TE + +.B RTPROT_STATIC +¤è¤ê¤âÂ礭¤ÊÃͤϥ«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤Ê¤¤¡£¤³¤ì¤Ï +ñ¤Ê¤ë¥æ¡¼¥¶¡¼¤Ø¤Î¾ðÊó¤Ç¤¢¤ë¡£¤³¤ì¤é¤Ï·ÐÏ©¾ðÊó¤Î¾ðÊ󸻤ò +¥¿¥°ÉÕ¤±¤·¤¿¤ê¡¢Ê£¿ô¤Î¥ë¡¼¥Æ¥£¥ó¥°¥Ç¡¼¥â¥ó¤«¤é¤Î¾ðÊó¤ò +¶èÊ̤¹¤ë¤¿¤á¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +´û¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥ë¡¼¥Æ¥£¥ó¥°¥Ç¡¼¥â¥ó¤Î¼±Ê̻ҤˤĤ¤¤Æ¤Ï +.I +¤ò¸«¤è¡£ + +.I rtm_scope +¤Ï¹Ô¤­Àè¤Ø¤Îµ÷Î¥¤Ç¤¢¤ë¡£ + +.TS +tab(:); +l l. +RT_SCOPE_UNIVERSE:¥°¥í¡¼¥Ð¥ë¤Ê·ÐÏ© +RT_SCOPE_SITE:T{ +¥í¡¼¥«¥ë¤Ê¼«Î§¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ëÆâÉô·ÐÏ© +T} +RT_SCOPE_LINK:¤³¤Î¥ê¥ó¥¯¾å¤Î·ÐÏ© +RT_SCOPE_HOST:¥í¡¼¥«¥ë¥Û¥¹¥È¾å¤Î·ÐÏ© +RT_SCOPE_NOWHERE:¹Ô¤­À褬¸ºß¤·¤Ê¤¤ +.TE + +¥æ¡¼¥¶¡¼¤Ï +.B RT_SCOPE_UNIVERSE +¤È +.B RT_SCOPE_SITE +¤Î´Ö¤ÎÃͤòÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +.I rtm_flags +¤Ï°Ê²¼¤Î°ÕÌ£¤ò»ý¤Ä: +.TS +tab(:); +l l. +RTM_F_NOTIFY:T{ +·ÐÏ©¤¬Êѹ¹¤µ¤ì¤ë¤È¡¢ rtnetlink ¤òÄ̤·¤Æ¥æ¡¼¥¶¡¼¤ËÄÌÃΤ¬¹Ô¤¯¡£ +T} +RTM_F_CLONED:·ÐÏ©¤Ï¾¤Î·ÐÏ©¤Ë¤è¤Ã¤ÆÊ£À½¤µ¤ì¤¿¡£ +RTM_F_EQUALIZE:¥Þ¥ë¥Á¥Ñ¥¹¥¤¥³¥é¥¤¥¶ (¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤) +.TE + +.I rtm_table +¤Ç¤Ï¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë¤ò»ØÄꤹ¤ë¡£ +.TS +tab(:); +l l. +RT_TABLE_UNSPEC:»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥ë¡¼¥Æ¥£¥ó¥°¥Æ¡¼¥Ö¥ë +RT_TABLE_DEFAULT:¥Ç¥Õ¥©¥ë¥È¤Î¥Æ¡¼¥Ö¥ë +RT_TABLE_MAIN:¥á¥¤¥ó¤Î¥Æ¡¼¥Ö¥ë +RT_TABLE_LOCAL:¥í¡¼¥«¥ë¥Æ¡¼¥Ö¥ë +.TE + +¥æ¡¼¥¶¡¼¤Ï +.B RT_TABLE_UNSPEC +¤È +.BR RT_TABLE_DEFAULT . +¤Î´Ö¤ÎǤ°Õ¤ÎÃͤòÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TS +tab(:); +c +l l l. +°À­ +rta_type:Ãͤη¿:ÀâÌÀ +_ +RTA_UNSPEC:-:̵»ë¤µ¤ì¤ë +RTA_DST:protocol address:·ÐÏ©¤Î¹Ô¤­À襢¥É¥ì¥¹ +RTA_SRC:protocol address:·ÐÏ©¤Îȯ¿®¸µ¥¢¥É¥ì¥¹ +RTA_IIF:int:ÆþÎÏ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î index +RTA_OIF:int:½ÐÎÏ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î index +RTA_GATEWAY:protocol address:·ÐÏ©¤Î¥²¡¼¥È¥¦¥§¥¤ +RTA_PRIORITY:int:·ÐÏ©¤ÎÍ¥ÀèÅÙ +RTA_PREFSRC:: +RTA_METRICS:int:·ÐÏ©¤Î¥á¥È¥ê¥Ã¥¯ +RTA_MULTIPATH:: +RTA_PROTOINFO:: +RTA_FLOW:: +RTA_CACHEINFO:: +.TE + +.B (¤³¤ì¤é¤ÎÃͤòËä¤á¤ë¤³¤È!) +.TP +.BR RTM_NEWNEIGH ", " RTM_DELNEIGH ", " RTM_GETNEIGH +¶á˵¥Æ¡¼¥Ö¥ë (neighbor table) ¤Î¥¨¥ó¥È¥ê +(Î㤨¤Ð ARP ¥¨¥ó¥È¥ê) ¤Î¾ðÊó¤òÄɲᦺï½ü¡¦¼èÆÀ¤¹¤ë¡£ +¤³¤Î¥á¥Ã¥»¡¼¥¸¤Ï +.I ndmsg +¹½Â¤ÂΤòȼ¤¦¡£ + +.nf +struct ndmsg { + unsigned char ndm_family; + int ndm_ifindex; /* Interface index */ + __u16 ndm_state; /* State */ + __u8 ndm_flags; /* Flags */ + __u8 ndm_type; +}; + +struct nda_cacheinfo { + __u32 ndm_confirmed; + __u32 ndm_used; + __u32 ndm_updated; + __u32 ndm_refcnt; +}; +.fi + +.I ndm_state +¤Ï°Ê²¼¤Î¾õÂ֤Υӥåȥޥ¹¥¯¤Ç¤¢¤ë: +.TS +tab(:); +l l. +NUD_INCOMPLETE:¸½ºß¥ì¥¾¥ë¥ÖÃæ¤Î¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +NUD_REACHABLE:Æ°ºî³ÎǧºÑ¤ß¤Î¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +NUD_STALE:´ü¸ÂÀÚ¤ì¤Î¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +NUD_DELAY:¥¿¥¤¥ÞÂÔ¤Á¤Î¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +NUD_PROBE:ºÆ³ÎǧÃæ¤Î¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +NUD_FAILED:ÉÔÀµ¤Ê¥­¥ã¥Ã¥·¥å¥¨¥ó¥È¥ê +NUD_NOARP:¹Ô¤­À襭¥ã¥Ã¥·¥å¤Î¤Ê¤¤¥Ç¥Ð¥¤¥¹ +NUD_PERMANENT:ÀÅŪ¤Ê¥¨¥ó¥È¥ê +.TE + +Í­¸ú¤Ê +.I ndm_flags +¤Ï°Ê²¼¤ÎÄ̤ê: +.TS +tab(:); +l l. +NTF_PROXY:¥×¥í¥¯¥· arp ¥¨¥ó¥È¥ê +NTF_ROUTER:IPv6 ¥ë¡¼¥¿ +.TE + +.\" FIXME +.\" document the members of the struct better +.I rtaddr +¹½Â¤ÂΤϡ¢ +.I rta_type +¥Õ¥£¡¼¥ë¥É¤Ë±þ¤¸¤Æ¤½¤ì¤¾¤ì°Ê²¼¤Î°ÕÌ£¤ò»ý¤Ä: +.TS +tab(:); +l l. +NDA_UNSPEC:̤ÃΤΥ¿¥¤¥× +NDA_DST:¶á˵¥­¥ã¥Ã¥·¥å¥Í¥Ã¥È¥ï¡¼¥¯ÁؤιԤ­À襢¥É¥ì¥¹ +NDA_LLADDR:¶á˵¥­¥ã¥Ã¥·¥å¥ê¥ó¥¯ÁؤΥ¢¥É¥ì¥¹ +NDA_CACHEINFO:¥­¥ã¥Ã¥·¥å¤ÎÅý·× +.TE + +.I rta_type +¥Õ¥£¡¼¥ë¥É¤¬ +.B NDA_CACHEINFO +¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I struct nda_cacheinfo +¥Ø¥Ã¥À¤¬Â³¤¯¡£ +.TP +.BR RTM_NEWRULE ", " RTM_DELRULE ", " RTM_GETRULE +¥ë¡¼¥Æ¥£¥ó¥°¥ë¡¼¥ë¤òÄɲᦺï½ü¡¦¼èÆÀ¤¹¤ë¡£ +.I struct rtmsg +¤òȼ¤¦¡£ +.TP +.BR RTM_NEWQDISC ", " RTM_DELQDISC ", " RTM_GETQDISC +¥­¥å¡¼¥¤¥ó¥°¥ë¡¼¥ë¤òÄɲᦺï½ü¡¦¼èÆÀ¤¹¤ë¡£ +¤³¤Î¥á¥Ã¥»¡¼¥¸¤Ï +.I struct tcmsg +¤òȼ¤¤¡¢¤Þ¤¿¤½¤Î¤¢¤È¤Ë°À­¤¬¤¤¤¯¤Ä¤«Â³¤¯¤³¤È¤â¤¢¤ë¡£ + +.nf +struct tcmsg { + unsigned char tcm_family; + int tcm_ifindex; /* interface index */ + __u32 tcm_handle; /* Qdisc handle */ + __u32 tcm_parent; /* Parent qdisc */ + __u32 tcm_info; +}; +.fi +.TS +tab(:); +c +l l l. +°À­ +rta_type:Ãͤη¿:ÀâÌÀ +_ +TCA_UNSPEC:-:»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤ +TCA_KIND:asciiz string:¥­¥å¡¼¥¤¥ó¥°¥ë¡¼¥ë¤Î̾Á° +TCA_OPTIONS:byte sequence:Qdisc ÆÃÍ­¤Î¥ª¥×¥·¥ç¥ó¤¬Â³¤¯ +TCA_STATS:struct tc_stats:Qdisc ¤ÎÅý·× +TCA_XSTATS:qdisc specific:¥â¥¸¥å¡¼¥ëÆÃÍ­¤ÎÅý·× +TCA_RATE:struct tc_estimator:¥ì¡¼¥ÈÀ©¸Â +.TE + +¤µ¤é¤Ë¡¢ qdisc ¥â¥¸¥å¡¼¥ëÆÃÍ­¤ÎÍÍ¡¹¤Ê°À­¤ò»ØÄê¤Ç¤­¤ë¡£ +¾ÜºÙ¤Ê¾ðÊó¤ÏŬÀڤʥ¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤ò¸«¤è¡£ +.TP +.BR RTM_NEWTCLASS ", " RTM_DELTCLASS ", " RTM_GETTCLASS +¥È¥é¥Õ¥£¥Ã¥¯¥¯¥é¥¹¤òÄɲᦺï½ü¡¦¼èÆÀ¤¹¤ë¡£ +¤³¤ì¤é¤Î¥á¥Ã¥»¡¼¥¸¤Ï¡¢¾å½Ò¤Î +.I struct tcmsg +¤òȼ¤¦¡£ +.TP +.BR RTM_NEWTFILTER ", " RTM_DELTFILTER ", " RTM_GETTFILTER +¥È¥é¥Õ¥£¥Ã¥¯¥Õ¥£¥ë¥¿¡¼¤Î¾ðÊó¤òÄɲᦺï½ü¡¦¼èÆÀ¤¹¤ë¡£ +¤³¤ì¤é¤Î¥á¥Ã¥»¡¼¥¸¤Ï¡¢¾å½Ò¤Î +.I struct tcmsg +¤òȼ¤¦¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.B rtnetlink +¤Ï Linux 2.2 ¤Î¿·µ¡Ç½¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +¤³¤Î man ¥Ú¡¼¥¸¤ÏÉÔ´°Á´¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR cmsg (3), +.BR rtnetlink (3), +.BR ip (7), +.BR netlink (7) diff --git a/release/man7/sem_overview.7 b/release/man7/sem_overview.7 new file mode 100644 index 00000000..4c34ddc0 --- /dev/null +++ b/release/man7/sem_overview.7 @@ -0,0 +1,173 @@ +'\" 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 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-04-18, Akihiro MOTOKI +.\" Updated 2008-08-07, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2009-02-23, Akihiro MOTOKI, LDP v3.19 +.\" +.TH SEM_OVERVIEW 7 2009-02-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +sem_overview \- POSIX ¥»¥Þ¥Õ¥©¤Î³µÍ× +.SH ÀâÌÀ +POSIX ¥»¥Þ¥Õ¥©¤ò»ÈÍѤ¹¤ë¤È¡¢¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É´Ö¤Ç¤½¤ÎÆ°ºî¤ò +Ʊ´ü¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¥»¥Þ¥Õ¥©¤ÏÀ°¿ô¤Ç¤¢¤ê¡¢¤½¤ÎÃͤϷ褷¤Æ 0 ̤Ëþ¤Ë¤Ê¤ë¤³¤È¤Ïµö¤µ¤ì¤Ê¤¤¡£ +¥»¥Þ¥Õ¥©¤ËÂФ·¤Æ¤Ç¤­¤ëÁàºî¤Ï 2 ¤Ä¤Ç¤¢¤ë: +¥»¥Þ¥Õ¥©Ãͤò 1 Áý¤ä¤¹ +.RB ( sem_post (3)); +¥»¥Þ¥Õ¥©Ãͤò 1 ¸º¤é¤¹ +.RB ( sem_wait (3))¡£ +¥»¥Þ¥Õ¥©¤ÎÃͤ¬¤¹¤Ç¤Ë 0 ¤Î¾ì¹ç¡¢¥»¥Þ¥Õ¥©Ãͤ¬ 0 ¤è¤êÂ礭¤¯¤Ê¤ë¤Þ¤Ç +.BR sem_wait (3) +Áàºî¤ÏÄä»ß (block) ¤¹¤ë¡£ + +POSIX ¥»¥Þ¥Õ¥©¤Ë¤Ï¡¢Ì¾Á°ÉÕ¤­¥»¥Þ¥Õ¥© (named semaphore) ¤È +̾Á°¤Ê¤·¥»¥Þ¥Õ¥© (unnamed semaphore) ¤Î 2¤Ä¤Î·Á¤¬¤¢¤ë¡£ +.TP +.B ̾Á°ÉÕ¤­¥»¥Þ¥Õ¥© +̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤Ï +.I /somename +¤È¤¤¤¦·Á¼°¤Î̾Á°¤Ç¼±Ê̤µ¤ì¤ë¡£ +¤½¤Î̾Á°¤Ï¡¢ºÇÂç¤Ç +.BI NAME_MAX \-4 +(¤¹¤Ê¤ï¤Á 251) ʸ»ú¤Î 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. +¥¹¥é¥Ã¥·¥å¤Ç»Ï¤Þ¤ê¡¢¥¹¥é¥Ã¥·¥å°Ê³°¤Îʸ»ú¤¬ 1 ʸ»ú°Ê¾å³¤¯·Á¼°¤Ç¤¢¤ë¡£ +.\" glibc allows subdirectory components in the name, in which +.\" case the subdirectory tree must exist under /dev/shm, and +.\" the fist subdirectory component must exist as the name +.\" sem.name, and all of the subdirectory components must allow the +.\" required permissions if a user wants to create a semaphore +.\" object in a subdirectory. +.BR sem_open (3) +¤ËƱ¤¸Ì¾Á°¤òÅϤ¹¤³¤È¤Ë¤è¤ê¡¢2 ¤Ä¤Î¥×¥í¥»¥¹´Ö¤ÇƱ¤¸Ì¾Á°¤Î¥»¥Þ¥Õ¥© +¤ËÂФ·Áàºî¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ + +.BR sem_open (3) +´Ø¿ô¤Ï¡¢¿·¤·¤¤Ì¾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤òºîÀ®¤¹¤ë¤«¡¢´û¤Ë¸ºß¤¹¤ë̾Á°ÉÕ¤­ +¥»¥Þ¥Õ¥©¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£ +¥»¥Þ¥Õ¥©¤ò¥ª¡¼¥×¥ó¤·¤¿¸å¤Ï¡¢ +.BR sem_post (3) +¤È +.BR sem_wait (3) +¤ò»È¤Ã¤Æ¥»¥Þ¥Õ¥©¤òÁàºî¤Ç¤­¤ë¡£ +¥×¥í¥»¥¹¤¬¥»¥Þ¥Õ¥©¤Î»ÈÍѤò½ª¤¨¤¿ºÝ¤Ï¡¢ +.BR sem_close (3) +¤ò»È¤Ã¤Æ¥»¥Þ¥Õ¥©¤ò¥¯¥í¡¼¥º¤Ç¤­¤ë¡£ +¤¢¤ë¥»¥Þ¥Õ¥©¤ò¤É¤Î¥×¥í¥»¥¹¤â»ÈÍѤ·¤Ê¤¯¤Ê¤ë¤È¡¢ +.BR sem_unlink (3) +¤ò»È¤Ã¤Æ¤½¤Î¥»¥Þ¥Õ¥©¤ò¥·¥¹¥Æ¥à¤«¤éºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B ̾Á°¤Ê¤·¥»¥Þ¥Õ¥© (¥á¥â¥ê¥Ù¡¼¥¹¡¦¥»¥Þ¥Õ¥©) +̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤Ï̾Á°¤ò»ý¤¿¤Ê¤¤¡£¤½¤ÎÂå¤ï¤ê¡¢¥»¥Þ¥Õ¥©¤Ï¡¢ +Ê£¿ô¥¹¥ì¥Ã¥É´Ö¤Ç¶¦Í­¤µ¤ì¤¿¥á¥â¥êÎΰ衢¤â¤·¤¯¤ÏÊ£¿ô¥×¥í¥»¥¹´Ö¤Ç +¶¦Í­¤µ¤ì¤¿¥á¥â¥êÎΰè¤ËÃÖ¤«¤ì¤ë (Á°¼Ô¤ò +.IR "¥¹¥ì¥Ã¥É¶¦Í­¥»¥Þ¥Õ¥© (thread-shared semaphore)" ¡¢ +¸å¼Ô¤ò +.IR "¥×¥í¥»¥¹¶¦Í­¥»¥Þ¥Õ¥© (process-shared semaphore)" +¤È¸Æ¤Ö)¡£¥¹¥ì¥Ã¥É¶¦Í­¥»¥Þ¥Õ¥©¤Ï¡¢Æ±¤¸¥×¥í¥»¥¹Æâ¤Î¥¹¥ì¥Ã¥É´Ö¤Ç¶¦Í­¤µ¤ì¤¿ +¥á¥â¥êÎΰ衢Î㤨¤ÐÂç°èÊÑ¿ô (global variable) ¤ËÇÛÃÖ¤µ¤ì¤ë¡£ +¥×¥í¥»¥¹¶¦Í­¥»¥Þ¥Õ¥©¤Ï¡¢¶¦Í­¥á¥â¥êÎΰè (Î㤨¤Ð¡¢ +.BR semget (2) +¤ò»È¤Ã¤ÆºîÀ®¤Ç¤­¤ë System V ¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ä +.BR shm_open (3) +¤ò»È¤Ã¤ÆºîÀ®¤Ç¤­¤ë POSIX ¶¦Í­¥á¥â¥ê¡¦¥ª¥Ö¥¸¥§¥¯¥È) +Æâ¤ËÇÛÃÖ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +̾Á°¤Ê¤·¥»¥Þ¥Õ¥©¤Ï¡¢»ÈÍѤ¹¤ëÁ°¤Ë +.BR sem_init (3) +¤ò»È¤Ã¤Æ½é´ü²½¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥»¥Þ¥Õ¥©¤Ï +.BR sem_post (3) +¤È +.BR sem_wait (3) +¤ò»È¤Ã¤ÆÁàºî¤Ç¤­¤ë¡£ +¥»¥Þ¥Õ¥©¤¬¤â¤Ï¤äɬÍפʤ¯¤Ê¤Ã¤¿¤È¤­¤ä¡¢ +¥»¥Þ¥Õ¥©¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¥á¥â¥ê¤ò²òÊü¤¹¤ëÁ°¤Ë¤Ï¡¢ +.BR sem_destroy (3) +¤ò»È¤Ã¤Æ¥»¥Þ¥Õ¥©¤òÇË´þ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +¤³¤ÎÀá¤Î»Ä¤ê¤Ç¤Ï¡¢POSIX ¥»¥Þ¥Õ¥©¤Î Linux ¤Î¼ÂÁõ¤Î¾ÜºÙ +¤Ë¤Ä¤¤¤ÆÀâÌÀ¤¹¤ë¡£ +.SS ¥Ð¡¼¥¸¥ç¥ó +¥Ð¡¼¥¸¥ç¥ó 2.6 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢Linux ¤Ï +̾Á°¤Ê¤·¤Î¥¹¥ì¥Ã¥É¶¦Í­¥»¥Þ¥Õ¥©¤Î¤ß¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤¿¡£ +Linux 2.6 ¤È NPTL ¥¹¥ì¥Ã¥É¼ÂÁõ¤òÄ󶡤·¤Æ¤¤¤ë glibc ¤¬Æþ¤Ã¤¿ +¥·¥¹¥Æ¥à¤Ç¤Ï¡¢POSIX ¥»¥Þ¥Õ¥©¤Î´°Á´¤Ê¼ÂÁõ¤¬Ä󶡤µ¤ì¤ë¡£ +.SS »ý³À­ +POSIX ̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤Ï¥«¡¼¥Í¥ëÆâ¤ÇÊÝ»ý¤µ¤ì¤ë¡£ +.BR sem_unlink (3) +¤Çºï½ü¤µ¤ì¤Ê¤±¤ì¤Ð¡¢¥»¥Þ¥Õ¥©¤Ï +¥·¥¹¥Æ¥à¤¬¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤ë¤Þ¤Ç¸ºß¤·Â³¤±¤ë¡£ +.SS ¥ê¥ó¥¯ +POSIX ¥»¥Þ¥Õ¥© API ¤ò»ÈÍѤ·¤¿¥×¥í¥°¥é¥à¤Ï +.I cc \-lrt +¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¡¢¥ê¥¢¥ë¥¿¥¤¥à¥é¥¤¥Ö¥é¥ê +.I librt +¤È¥ê¥ó¥¯¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à·Ðͳ¤Ç¤Î̾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤Ø¤Î¥¢¥¯¥»¥¹ +Linux ¤Ç¤Ï¡¢Ì¾Á°ÉÕ¤­¥»¥Þ¥Õ¥©¤Ï²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +(virtual file system) Æâ¤Ë +.I \fBsem.\fPsomename +¤È¤¤¤¦·Á¤Î̾Á°¤ÇºîÀ®¤µ¤ì¤ë¡£²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÏÄ̾ï +.I /dev/shm +°Ê²¼¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë¡£ +(¤³¤ì¤¬¡¢¥»¥Þ¥Õ¥©¤Î̾Á°¤Îʸ»ú¿ô¤Î¾å¸Â¤¬ +.B NAME_MAX +¤Ç¤Ï¤Ê¤¯ +.BI NAME_MAX \-4 +¤È¤Ê¤Ã¤Æ¤¤¤ëÍýͳ¤Ç¤¢¤ë¡£) + +Linux 2.6.19 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¥Ç¥£¥ì¥¯¥È¥êÇÛ²¼¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ ACL ¤ò +ÀßÄê¤Ç¤­¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Îµö²Ä¤ò¥æ¡¼¥¶Ã±°Ì¡¢¥°¥ë¡¼¥×ñ°Ì¤ÇÀ©¸æ¤¹¤ë¤³¤È¤¬ +¤Ç¤­¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +System V ¥»¥Þ¥Õ¥© +.RB ( semget (2), +.BR semop (2) +¤Ê¤É) ¤Ï¸Å¤¤¥»¥Þ¥Õ¥© API ¤Ç¤¢¤ë¡£ POSIX ¥»¥Þ¥Õ¥©¤Ï System V ¤è¤ê¤â +´Êñ¤Ç¡¢¤¦¤Þ¤¯À߷פµ¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤·¤Æ¤¤¤ë¡£ +°ìÊý¤Ç¡¢POSIX ¥»¥Þ¥Õ¥©¤Ï System V ¥»¥Þ¥Õ¥©¤ÈÈæ¤Ù¤ë¤È +ÍøÍѤǤ­¤ë¥·¥¹¥Æ¥à¤¬¾¯¤Ê¤¤ (Æäˡ¢¸Å¤¤¥·¥¹¥Æ¥à¤Ç¤Ï¾¯¤Ê¤¤)¡£ +.SH Îã +³Æ¼ï¤Î POSIX ¥»¥Þ¥Õ¥©´Ø¿ô¤ò»ÈÍѤ·¤¿Î㤬 +.BR sem_wait (3) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sem_close (3), +.BR sem_destroy (3), +.BR sem_getvalue (3), +.BR sem_init (3), +.BR sem_open (3), +.BR sem_post (3), +.BR sem_unlink (3), +.BR sem_wait (3), +.BR pthreads (7) diff --git a/release/man7/shm_overview.7 b/release/man7/shm_overview.7 new file mode 100644 index 00000000..431ac685 --- /dev/null +++ b/release/man7/shm_overview.7 @@ -0,0 +1,133 @@ +'\" t +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" 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. +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 +.\" +.TH SHM_OVERVIEW 7 2008-06-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +shm_overview \- POSIX ¶¦Í­¥á¥â¥ê¤Î³µÍ× +.SH ÀâÌÀ +POSIX ¶¦Í­¥á¥â¥ê API ¤ò»ÈÍѤ¹¤ë¤È¡¢¥á¥â¥ê¤Î¤¢¤ëÎΰè¤ò¶¦Í­¤·¤Æ¡¢ +¥×¥í¥»¥¹´Ö¤Ç¾ðÊó¤ò¤ä¤ê¼è¤ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¤³¤Î API ¤Ç¤Ï°Ê²¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬ºÎÍѤµ¤ì¤Æ¤¤¤ë¡£ +.TP 15 +.BR shm_open (3) +¿·¤·¤¤¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¤·¥ª¡¼¥×¥ó¤¹¤ë¡¢¤â¤·¤¯¤Ï +´û¸¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£¤³¤ì¤Ï +.BR open (2) +¤ÈƱ¤¸¤Ç¤¢¤ë¡£²¼µ­¤Ë¤¢¤ë¾¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç»ÈÍѤ¹¤ë +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£ +.TP +.BR ftruncate (2) +¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤ÎÂ礭¤µ¤òÀßÄꤹ¤ë¡£ +.TP +.BR mmap (2) +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î²¾ÁÛ¥¢¥É¥ì¥¹¶õ´Ö¤Ë¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤ò +¥Þ¥Ã¥×¤¹¤ë¡£ +.TP +.BR munmap (2) +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î²¾ÁÛ¥¢¥É¥ì¥¹¶õ´Ö¤«¤é +¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤ò¥¢¥ó¥Þ¥Ã¥×¤¹¤ë¡£ +.TP +.BR shm_unlink (3) +¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È̾¤òºï½ü¤¹¤ë¡£ +.TP +.BR close (2) +.BR shm_open (3) +¤Ç³ä¤êÅö¤Æ¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÍפˤʤ俺ݤˡ¢ +¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.TP +.BR fstat (2) +¤½¤Î¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤¬Æþ¤Ã¤¿ +.I stat +¹½Â¤ÂΤò¼èÆÀ¤¹¤ë¡£ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÊÖ¤¹¾ðÊó¤Ë¤Ï¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Î¥µ¥¤¥º +.RI ( st_size )¡¢ +µö²Ä°À­ +.RI ( st_mode )¡¢ +½êÍ­¼Ô +.RI ( st_uid )¡¢ +¥°¥ë¡¼¥× +.RI ( st_gid ) +¤¬¤¢¤ë¡£ +.TP +.BR fchown (2) +¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤òÊѹ¹¤¹¤ë¡£ +.TP +.BR fchmod (2) +¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Îµö²Ä°À­¤òÊѹ¹¤¹¤ë¡£ +.SS ¥Ð¡¼¥¸¥ç¥ó +POSIX ¶¦Í­¥á¥â¥ê¤Ï Linux 2.4 ¤È glibc 2.2 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.SS »ý³À­ +POSIX ¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Ï¥«¡¼¥Í¥ëÆâ¤ÇÊÝ»ý¤µ¤ì¤ë¡£ +¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢¥·¥¹¥Æ¥à¤¬¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤ë¤«¡¢ +Á´¤Æ¤Î¥×¥í¥»¥¹¤¬¤½¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¥¢¥ó¥Þ¥Ã¥×¤·¡¢ +.BR shm_unlink (3) +¤Çºï½ü¤µ¤ì¤ë¤Þ¤Ç¡¢Â¸ºß¤·Â³¤±¤ë¡£ +.SS ¥ê¥ó¥¯ +POSIX ¶¦Í­¥á¥â¥ê API ¤ò»ÈÍѤ·¤¿¥×¥í¥°¥é¥à¤Ï +.I cc \-lrt +¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¡¢¥ê¥¢¥ë¥¿¥¤¥à¥é¥¤¥Ö¥é¥ê +.I librt +¤È¥ê¥ó¥¯¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.SS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à·Ðͳ¤Ç¤Î¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥¢¥¯¥»¥¹ +Linux ¤Ç¤Ï¡¢¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤ÏÄ̾ï +.I /dev/shm +°Ê²¼¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.RI ( tmpfs ) +Æâ¤ËºîÀ®¤µ¤ì¤ë¡£ +¥«¡¼¥Í¥ë 2.6.19 °Ê¹ß¤Î Linux ¤Ç¤Ï¡¢ +²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Îµö²Ä°À­¤ÎÀ©¸æ¤Ë¡¢ +¥¢¥¯¥»¥¹À©¸æ¥ê¥¹¥È (ACL; access control lists) ¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH ½àµò +POSIX.1-2001. +.SH Ãí°Õ +Ä̾ï¤Ï¡¢¶¦Í­¥á¥â¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¢¥¯¥»¥¹¤¹¤ë¥×¥í¥»¥¹¤Ï¡¢ +POSIX ¥»¥Þ¥Õ¥©¤Ê¤É¤ò»È¤Ã¤Æ¥×¥í¥»¥¹´Ö¤ÇƱ´ü¤ò¤È¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +System V ¶¦Í­¥á¥â¥ê +.RB ( shmget (2), +.BR shmop (2) +¤Ê¤É) ¤Ï¸Å¤¤¶¦Í­¥á¥â¥ê API ¤Ç¤¢¤ë¡£ +POSIX ¶¦Í­¥á¥â¥ê¤Ï¡¢¤è¤ê´Êñ¤Ç¡¢¤¦¤Þ¤¯À߷פµ¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤·¤Æ¤¤¤ë¡£ +°ìÊý¤Ç¡¢POSIX ¶¦Í­¥á¥â¥ê¤Ï System V ¶¦Í­¥á¥â¥ê¤ÈÈæ¤Ù¤ë¤È +ÍøÍѤǤ­¤ë¥·¥¹¥Æ¥à¤¬¾¯¤Ê¤¤ (Æäˡ¢¸Å¤¤¥·¥¹¥Æ¥à¤Ç¤Ï¾¯¤Ê¤¤)¡£ +.SH ´ØÏ¢¹àÌÜ +.BR fchmod (2), +.BR fchown (2), +.BR fstat (2), +.BR ftruncate (2), +.BR mmap (2), +.BR mprotect (2), +.BR munmap (2), +.BR shmget (2), +.BR shmop (2), +.BR shm_open (3), +.BR shm_unlink (3), +.BR sem_overview (7) diff --git a/release/man7/signal.7 b/release/man7/signal.7 new file mode 100644 index 00000000..7e9a1364 --- /dev/null +++ b/release/man7/signal.7 @@ -0,0 +1,894 @@ +'\" t +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" and Copyright (c) 2002, 2006 by Michael Kerrisk +.\" and 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. +.\" +.\" Modified Sat Jul 24 17:34:08 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Jan 7 01:41:27 1996 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Sun Apr 14 12:02:29 1996 by Andries Brouwer (aeb@cwi.nl) +.\" Modified Sat Nov 13 16:28:23 1999 by Andries Brouwer (aeb@cwi.nl) +.\" Modified 10 Apr 2002, by Michael Kerrisk +.\" Modified 7 Jun 2002, by Michael Kerrisk +.\" Added information on real-time signals +.\" Modified 13 Jun 2002, by Michael Kerrisk +.\" Noted that SIGSTKFLT is in fact unused +.\" 2004-12-03, Modified mtk, added notes on RLIMIT_SIGPENDING +.\" 2006-04-24, mtk, Added text on changing signal dispositions, +.\" signal mask, and pending signals. +.\" 2008-07-04, mtk: +.\" Added section on system call restarting (SA_RESTART) +.\" Added section on stop/cont signals interrupting syscalls. +.\" 2008-10-05, mtk: various additions +.\" +.\" Japanese Version Copyright (c) 1997 Takafumi Naka +.\" and 2005-2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 1997-02-13, Takafumi Naka +.\" Modified 1999-06-22, Tatsuo SEKINE +.\" Modified 1999-07-18, Takafumi Naka +.\" Modified 1999-12-06, NAKANO Takeo , LDP v1.28 +.\" Updated 2003-07-24, Kentaro Shirakata +.\" Updated 2005-02-23, Akihiro MOTOKI +.\" Updated 2006-07-28, Akihiro MOTOKI , LDP v2.36 +.\" Updated 2007-05-28, Akihiro MOTOKI , LDP v2.50 +.\" Updated 2007-09-08, Akihiro MOTOKI , LDP v2.64 +.\" Updated 2008-08-11, Akihiro MOTOKI , LDP v3.05 +.\" Updated 2008-11-21, Akihiro MOTOKI , LDP v3.13 +.\" Updated 2010-04-10, Akihiro MOTOKI , LDP v3.24 +.\" +.\"WORD: disposition ½èÍýÊýË¡ +.\"WORD: pending ½èÍýÂÔ¤Á +.\"WORD: signal handler ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é +.\" +.TH SIGNAL 7 2010-02-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +signal \- ¥·¥°¥Ê¥ë¤Î³µÍ× +.SH ÀâÌÀ +Linux ¤Ï POSIX ¿®Íꥷ¥°¥Ê¥ë (reliable signal; °Ê¸å "ɸ½à¥·¥°¥Ê¥ë"¤Èɽµ­) +¤È POSIX ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎξÊý¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +.SS ¥·¥°¥Ê¥ë½èÍýÊýË¡ +¥·¥°¥Ê¥ë¤Ï¤½¤ì¤¾¤ì¸½ºß¤Î¡Ö½èÍýÊýË¡ (disposition)¡×¤òÊÝ»ý¤·¤Æ¤ª¤ê¡¢ +¤³¤Î½èÍýÊýË¡¤Ë¤è¤ê¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤¿ºÝ¤Ë¥×¥í¥»¥¹¤¬ +¤É¤Î¤è¤¦¤Ê¿¶Éñ¤¤¤ò¤¹¤ë¤«¤¬·è¤Þ¤ë¡£ + +¸å½Ò¤Îɽ¤Î "Æ°ºî" ¤ÎÍó¤Î¥¨¥ó¥È¥ê¤Ï³Æ¥·¥°¥Ê¥ë¤Î¥Ç¥Õ¥©¥ë¥È¤Î +½èÍýÊýË¡¤ò¼¨¤·¤Æ¤ª¤ê¡¢°Ê²¼¤Î¤è¤¦¤Ê°ÕÌ£¤ò»ý¤Ä¡£ +.IP Term +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¥×¥í¥»¥¹½ªÎ»¡£ +.IP Ign +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¤³¤Î¥·¥°¥Ê¥ë¤Î̵»ë¡£ +.IP Core +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¥×¥í¥»¥¹½ªÎ»¤È¥³¥¢¥À¥ó¥×½ÐÎÏ +.RB ( core (5) +»²¾È)¡£ +.IP Stop +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¥×¥í¥»¥¹¤Î°ì»þÄä»ß¡£ +.IP Cont +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¡¢¥×¥í¥»¥¹¤¬Ää»ßÃæ¤Î¾ì¹ç¤Ë¤½¤Î¼Â¹Ô¤ÎºÆ³«¡£ +.PP +¥×¥í¥»¥¹¤Ï¡¢ +.BR sigaction (2) +¤ä +.BR signal (2) +¤ò»È¤Ã¤Æ¡¢¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +.RB ( signal (2) +¤ÎÊý¤¬°Ü¿¢À­¤ÏÄ㤤)¡£¥·¥°¥Ê¥ë¤ÎÇÛÁ÷»þ¤Ëµ¯¤³¤ëÆ°ºî¤È¤·¤Æ +¥×¥í¥»¥¹¤¬ÁªÂò¤Ç¤­¤ë¤Î¤Ï¡¢¼¡¤Î¤¤¤º¤ì¤«°ì¤Ä¤Ç¤¢¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤ò¼Â¹Ô¤¹¤ë¡¢¥·¥°¥Ê¥ë¤ò̵»ë¤¹¤ë¡¢ +.I "¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é (signal handler)" +¤Ç¥·¥°¥Ê¥ë¤òÊ᪤¹¤ë¡£¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤È¤Ï¡¢¥·¥°¥Ê¥ëÇÛÁ÷»þ¤Ë +¼«Æ°Åª¤Ëµ¯Æ°¤µ¤ì¤ë¥×¥í¥°¥é¥ÞÄêµÁ¤Î´Ø¿ô¤Ç¤¢¤ë¡£ +(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÏÄ̾ï¤Î¥×¥í¥»¥¹¤Î¥¹¥¿¥Ã¥¯¾å¤Çµ¯Æ°¤µ¤ì¤ë¡£ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ÂåÂØ¥¹¥¿¥Ã¥¯ (alternate stack) ¤ò»ÈÍѤ¹¤ë¤è¤¦¤ËÀßÄꤹ¤ë +¤³¤È¤â¤Ç¤­¤ë¡£ÂåÂØ¥¹¥¿¥Ã¥¯¤ò»ÈÍѤ¹¤ë¤è¤¦¤ËÀßÄꤹ¤ëÊýË¡¤È¡¢¤É¤Î¤è¤¦¤ÊºÝ¤Ë +ÂåÂØ¥¹¥¿¥Ã¥¯¤¬Ìò¤ËΩ¤Ä¤«¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤Ë¤Ä¤¤¤Æ¤Ï +.BR sigaltstack (2) +¤ò»²¾È¤Î¤³¤È¡£ + +¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï¥×¥í¥»¥¹Ã±°Ì¤Î°À­¤Ç¤¢¤ë¡£ +¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢¤¢¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï +Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤ÇƱ¤¸¤Ç¤¢¤ë¡£ + +.BR fork (2) +¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤Î´Ö¡¢¥Ï¥ó¥É¥é¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È +¤µ¤ì¡¢Ìµ»ë¤È¤Ê¤Ã¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤ÏÊѹ¹¤µ¤ì¤º¤½¤Î¤Þ¤Þ¤È¤Ê¤ë¡£ +.SS ¥·¥°¥Ê¥ë¤ÎÁ÷¿® +°Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ò»È¤Ã¤Æ¡¢ +¸Æ¤Ó½Ð¤·¼Ô¤Ï¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP 16 +.BR raise (3) +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.TP +.BR kill (2) +»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤ä¡¢»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¡¼¡¢ +¥·¥¹¥Æ¥à¤ÎÁ´¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.TP +.BR killpg (2) +»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¡¼¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.TP +.BR pthread_kill (3) +¸Æ¤Ó½Ð¤·¼Ô¤ÈƱ¤¸¥×¥í¥»¥¹Æâ¤Î»ØÄꤵ¤ì¤¿ POSIX ¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.TP +.BR tgkill (2) +»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹Æâ¤Î»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë +(¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ +.BR pthread_kill (3) +¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë)¡£ +.TP +.BR sigqueue (2) +»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤ËÉÕ°¥Ç¡¼¥¿¤È¤È¤â¤Ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£ +.SS ¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤ë¤Î¤òÂÔ¤Ä +°Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¡¢¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤ë¤Þ¤Ç +¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤òÃæÃÇ (suspend) ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +(¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤Ë¤è¤ê¤½¤Î¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿ +¾ì¹ç¤Ë¤â¼Â¹Ô¤ÎÄä»ß¤Ï½ªÎ»¤¹¤ë)¡£ +.TP 16 +.BR pause (2) +²¿¤«¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤ë¤Þ¤Ç¼Â¹Ô¤òÄä»ß¤¹¤ë¡£ +.TP +.BR sigsuspend (2) +°ì»þŪ¤Ë¥·¥°¥Ê¥ë¥Þ¥¹¥¯ (²¼µ­»²¾È) ¤òÊѹ¹¤·¡¢ +¥Þ¥¹¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤Î¤¤¤º¤ì¤«¤¬Ê᪤µ¤ì¤ë¤Þ¤Ç +¼Â¹Ô¤òÃæÃǤ¹¤ë¡£ +.SS ¥·¥°¥Ê¥ë¤ÎƱ´ü¼õ¿® +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é·Ðͳ¤Ç¥·¥°¥Ê¥ë¤òÈóƱ´ü (asynchronously) ¤ÇÊ᪤¹¤ë°Ê³°¤Ë¤â¡¢ +¥·¥°¥Ê¥ë¤òƱ´ü (synchronously) ¤·¤Æ¼õ¤±ÉÕ¤±¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +Ʊ´ü¤·¤Æ¼õ¤±ÉÕ¤±¤ë¤È¤Ï¡¢¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¼Â¹Ô¤òÄä»ß (block) +¤¹¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£¥·¥°¥Ê¥ë¤ò¼õ¤±ÉÕ¤±¤¿ºÝ¤Ë¡¢¥«¡¼¥Í¥ë¤Ï +¤½¤Î¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤ò¸Æ¤Ó½Ð¤·¼Ô¤ËÊÖ¤¹¡£ +¤³¤ì¤ò¹Ô¤¦°ìÈÌŪ¤ÊÊýË¡¤¬Æó¤Ä¤¢¤ë¡£ +.IP * 2 +.BR sigwaitinfo (2), +.BR sigtimedwait (2), +.BR sigwait (3) +¤Ï¡¢»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤Î¥·¥°¥Ê¥ë¤Î°ì¤Ä¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¼Â¹Ô¤òÃæÃǤ¹¤ë¡£ +¤É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä´Ø¿ô¤Ç¤â¡¢ÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£ +.IP * +.BR signalfd (2) +¤¬ÊÖ¤¹¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»È¤¦¤È¡¢¸Æ¤Ó½Ð¤·¸µ¤ËÇÛÁ÷¤µ¤ì¤¿ +¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤òÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î +.BR read (2) +¤Ï¡¢ +.BR signalfd (2) +¤Î¸Æ¤Ó½Ð¤·»þ¤Ë»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤Î¥·¥°¥Ê¥ë¤Î°ì¤Ä¤¬¸Æ¤Ó½Ð¤·¸µ¤Ë +ÇÛÁ÷¤µ¤ì¤ë¤Þ¤ÇÄä»ß (block) ¤¹¤ë¡£ +.BR read (2) +¤¬ÊÖ¤¹¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤ò³ÊǼ¤·¤¿¹½Â¤ÂΤ¬Æþ¤Ã¤Æ¤¤¤ë¡£ +.SS ¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤È½èÍýÂÔ¤Á¥·¥°¥Ê¥ë +¥·¥°¥Ê¥ë¤Ï +.I "¥Ö¥í¥Ã¥¯ (block)" +¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¤È¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï +¤½¤Î¸å¥Ö¥í¥Ã¥¯¤ò²ò½ü¤µ¤ì¤ë¤Þ¤ÇÇÛÁ÷¤µ¤ì¤Ê¤¯¤Ê¤ë¡£ +¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤Æ¤«¤éÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¤Î´Ö¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï +.I "½èÍýÂÔ¤Á (pending)" +¤Ç¤¢¤ë¤È¸Æ¤Ð¤ì¤ë¡£ + +¥×¥í¥»¥¹Æâ¤Î³Æ¥¹¥ì¥Ã¥É¤Ï¡¢¤½¤ì¤¾¤ìÆÈΩ¤Ê +.I "¥·¥°¥Ê¥ë¥Þ¥¹¥¯ (signal mask)" +¤ò»ý¤Ä¡£¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï¤½¤Î¥¹¥ì¥Ã¥É¤¬¸½ºß¥Ö¥í¥Ã¥¯¤·¤Æ¤¤¤ë +¥·¥°¥Ê¥ë½¸¹ç¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£ +¥¹¥ì¥Ã¥É¤Ï¡¢ +.BR pthread_sigmask (3) +¤ò»È¤Ã¤Æ¼«Ê¬¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÁàºî¤Ç¤­¤ë¡£ +ÅÁÅýŪ¤Ê¥·¥ó¥°¥ë¥¹¥ì¥Ã¥É¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢ +.BR sigprocmask (2) +¤ò»È¤Ã¤Æ¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÁàºî¤Ç¤­¤ë¡£ + +.BR fork (2) +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢ +¿Æ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÏÊÝ»ý¤µ¤ì¤ë¡£ + +À¸À®¤µ¤ì¤ë¥·¥°¥Ê¥ë (¤·¤¿¤¬¤Ã¤Æ½èÍýÂÔ¤Á¤È¤Ê¤ë¥·¥°¥Ê¥ë) ¤Ë¤Ï¡¢ +¥×¥í¥»¥¹Á´Âΰ¸¤Æ¤ÈÆÃÄê¤Î¥¹¥ì¥Ã¥É°¸¤Æ¤¬¤¢¤ë¡£ +Î㤨¤Ð¡¢¥×¥í¥»¥¹Á´Âΰ¸¤Æ¤Î¥·¥°¥Ê¥ë¤Ï +.BR kill (2) +¤ò»È¤Ã¤ÆÁ÷¿®¤µ¤ì¤ë¡£ +ÆÃÄê¤Î¥Þ¥·¥ó¸ì¤ÎÌ¿Îá¤Î¼Â¹Ô¤Î·ë²Ì¤È¤·¤ÆÀ¸À®¤µ¤ì¤ë¡¢ +.B SIGSEGV +¤ä +.B SIGFPE +¤Ê¤É¤Î¥·¥°¥Ê¥ë¤Ï¡¢¥¹¥ì¥Ã¥É°¸¤Æ¤È¤Ê¤ë¡£ +¤Þ¤¿¡¢ +.BR pthread_kill (3) +¤ò»È¤Ã¤ÆÆÃÄê¤Î¥¹¥ì¥Ã¥É°¸¤Æ¤ËÀ¸À®¤µ¤ì¤¿¥·¥°¥Ê¥ë¤â +¥¹¥ì¥Ã¥É°¸¤Æ¤È¤Ê¤ë¡£ +¥×¥í¥»¥¹°¸¤Æ¤Î¥·¥°¥Ê¥ë¤Ï¡¢¤½¤Î¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤·¤Æ¤¤¤Ê¤¤¥¹¥ì¥Ã¥É¤Î¤¦¤Á +¤¤¤º¤ì¤«¤Î°ì¤Ä¤ËÇÛÁ÷¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤½¤Î¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤·¤Æ¤¤¤Ê¤¤ +¥¹¥ì¥Ã¥É¤¬Ê£¿ô¤¢¤ë¾ì¹ç¡¢¥·¥°¥Ê¥ë¤òÇÛÁ÷¤¹¤ë¥¹¥ì¥Ã¥É¤Ï¥«¡¼¥Í¥ë¤¬ +̵ºî°Ù¤ËÁªÂò¤¹¤ë¡£ + +¥¹¥ì¥Ã¥É¤Ï¡¢ +.BR sigpending (2) +¤ò»È¤Ã¤Æ¡¢¸½ºß½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤ò¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î½¸¹ç¤Ï¡¢¥×¥í¥»¥¹°¸¤Æ¤Î½èÍýÂÔ¤Á¥·¥°¥Ê¥ë¤È +¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É°¸¤Æ¤Î¥·¥°¥Ê¥ë¤ÎξÊý¤«¤é¹½À®¤µ¤ì¤ë¡£ + +.BR fork (2) +·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ç¤Ï¡¢½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤Ï +¶õ¤Î½¸¹ç¤Ç½é´ü²½¤µ¤ì¤ë¡£ +.BR execve (2) +¤ÎÁ°¸å¤Ç¡¢½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤ÏÊÝ»ý¤µ¤ì¤ë¡£ +.SS ɸ½à¥·¥°¥Ê¥ë +Linux ¤Ï°Ê²¼¤Ë¼¨¤¹É¸½à¥·¥°¥Ê¥ë¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +¥·¥°¥Ê¥ëÈÖ¹æ¤Î°ìÉô¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã°Í¸¤Ç¤¢¤ê¡¢"ÃÍ" Íó¤Ë¼¨¤¹Ä̤ê¤Ç¤¢¤ë¡£ +(3¤Ä¤ÎÃͤ¬½ñ¤«¤ì¤Æ¤¤¤ë¤â¤Î¤Ï¡¢ 1¤ÄÌܤ¬ alpha ¤È sparc ¤ÇÄ̾ïÍ­¸ú¤ÊÃÍ¡¢ +¿¿¤óÃ椬 ix86, ia64, ppc, s390, arm, sh ¤Ç¤ÎÃÍ¡¢ºÇ¸å¤¬ mips ¤Ç¤ÎÃͤǤ¢¤ë¡£ +.\" parisc is a law unto itself +\- ¤Ï¤½¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤¤¤ÆÂбþ¤¹¤ë¥·¥°¥Ê¥ë¤¬¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£) + +ºÇ½é¤Ë¡¢POSIX.1-1990 ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤ò¼¨¤¹¡£ +.TS +l c c l +____ +lB c c l. +¥·¥°¥Ê¥ë ÃÍ Æ°ºî ¥³¥á¥ó¥È +SIGHUP \01 Term T{ +À©¸æüËö(controlling terminal)¤Î¥Ï¥ó¥°¥¢¥Ã¥×¸¡½Ð¡¢ +¤Þ¤¿¤ÏÀ©¸æ¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î»à +T} +SIGINT \02 Term ¥­¡¼¥Ü¡¼¥É¤«¤é¤Î³ä¤ê¹þ¤ß (Interrupt) +SIGQUIT \03 Core ¥­¡¼¥Ü¡¼¥É¤Ë¤è¤ëÃæ»ß (Quit) +SIGILL \04 Core ÉÔÀµ¤ÊÌ¿Îá +SIGABRT \06 Core \fBabort\fP(3) ¤«¤é¤ÎÃæÃÇ (Abort) ¥·¥°¥Ê¥ë +SIGFPE \08 Core ÉâÆ°¾®¿ôÅÀÎã³° +SIGKILL \09 Term Kill ¥·¥°¥Ê¥ë +SIGSEGV 11 Core ÉÔÀµ¤Ê¥á¥â¥ê»²¾È +SIGPIPE 13 Term ¥Ñ¥¤¥×Ç˲õ: Æɤ߼ê¤Î̵¤¤¥Ñ¥¤¥×¤Ø¤Î½ñ¤­½Ð¤· +SIGALRM 14 Term \fBalarm\fP(2) ¤«¤é¤Î¥¿¥¤¥Þ¡¼¥·¥°¥Ê¥ë +SIGTERM 15 Term ½ªÎ» (termination) ¥·¥°¥Ê¥ë +SIGUSR1 30,10,16 Term ¥æ¡¼¥¶ÄêµÁ¥·¥°¥Ê¥ë 1 +SIGUSR2 31,12,17 Term ¥æ¡¼¥¶ÄêµÁ¥·¥°¥Ê¥ë 2 +SIGCHLD 20,17,18 Ign »Ò¥×¥í¥»¥¹¤Î°ì»þÄä»ß (stop) ¤Þ¤¿¤Ï½ªÎ» +SIGCONT 19,18,25 Cont °ì»þÄä»ß (stop) ¤«¤é¤ÎºÆ³« +SIGSTOP 17,19,23 Stop ¥×¥í¥»¥¹¤Î°ì»þÄä»ß (stop) +SIGTSTP 18,20,24 Stop üËö (tty) ¤è¤êÆþÎϤµ¤ì¤¿°ì»þÄä»ß (stop) +SIGTTIN 21,21,26 Stop ¥Ð¥Ã¥¯¥°¥é¥ó¥É¥×¥í¥»¥¹¤Î tty ÆþÎÏ +SIGTTOU 22,22,27 Stop ¥Ð¥Ã¥¯¥°¥é¥ó¥É¥×¥í¥»¥¹¤Î tty ½ÐÎÏ +.TE + +¥·¥°¥Ê¥ë +.B SIGKILL +¤È +.B SIGSTOP +¤Ï¥­¥ã¥Ã¥Á¡¢¥Ö¥í¥Ã¥¯¡¢Ìµ»ë¤Ç¤­¤Ê¤¤¡£ + +¼¡¤Ë¡¢ POSIX.1-1990 ɸ½à¤Ë¤Ï¤Ê¤¤¤¬¡¢ SUSv2 ¤È +POSIX.1-2001 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤ò¼¨¤¹¡£ +.TS +l c c l +____ +lB c c l. +¥·¥°¥Ê¥ë ÃÍ Æ°ºî ¥³¥á¥ó¥È +SIGBUS 10,7,10 Core ¥Ð¥¹¥¨¥é¡¼ (ÉÔÀµ¤Ê¥á¥â¥ê¥¢¥¯¥»¥¹) +SIGPOLL Term ¥Ý¡¼¥ê¥ó¥°²Äǽ¤Ê¥¤¥Ù¥ó¥È (Sys V)¡£ + \fBSIGIO\fP ¤ÈƱµÁ +SIGPROF 27,27,29 Term profiling ¥¿¥¤¥Þ¤Î»þ´ÖÀÚ¤ì +SIGSYS 12,31,12 Core ¥ë¡¼¥Á¥ó¤Ø¤Î°ú¤­¿ô¤¬ÉÔÀµ (SVr4) +SIGTRAP 5 Core ¥È¥ì¡¼¥¹/¥Ö¥ì¡¼¥¯¥Ý¥¤¥ó¥È ¥È¥é¥Ã¥× +SIGURG 16,23,21 Ign T{ +¥½¥±¥Ã¥È¤Î¶ÛµÞ»öÂÖ (urgent condition) (4.2BSD) +T} +SIGVTALRM 26,26,28 Term ²¾ÁÛ¥¢¥é¡¼¥à¥¯¥í¥Ã¥¯ (4.2BSD) +SIGXCPU 24,24,30 Core CPU»þ´ÖÀ©¸ÂĶ²á (4.2BSD) +SIGXFSZ 25,25,31 Core ¥Õ¥¡¥¤¥ë¥µ¥¤¥ºÀ©¸Â¤ÎĶ²á (4.2BSD) +.TE + +Linux 2.2 °ÊÁ°¤Ç¤Ï¡¢ +.BR SIGSYS ", " SIGXCPU ", " SIGXFSZ +¤ª¤è¤Ó SPARC ¤È MIPS °Ê³°¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Î +.B SIGBUS +¤Î¥Ç¥Õ¥©¥ë¥È¤Î¿¶¤ëÉñ¤¤¤Ï (¥³¥¢¥À¥ó¥×½ÐÎϤʤ·¤Î) ¥×¥í¥»¥¹½ªÎ»¤Ç¤¢¤Ã¤¿¡£ +(¾¤Î Unix ¥·¥¹¥Æ¥à¤Ë¤â +.BR SIGXCPU " ¤È " SIGXFSZ +¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤¬¥³¥¢¥À¥ó¥×¤Ê¤·¤Î¥×¥í¥»¥¹½ªÎ»¤Î¤â¤Î¤¬¤¢¤ë¡£) +Linux 2.4 ¤Ç¤Ï¡¢POSIX.1-2001 ¤Ç¤ÎÍ×µá»ÅÍͤ˽àµò¤·¤Æ¡¢ +¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤Ç¡¢¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¡¢¥³¥¢¥À¥ó¥×¤ò½ÐÎϤ¹¤ë +¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ + +¼¡¤Ë¤½¤Î¾¤Î³Æ¼ï¥·¥°¥Ê¥ë¤ò¼¨¤¹¡£ +.TS +l c c l +____ +lB c c l. +¥·¥°¥Ê¥ë ÃÍ Æ°ºî ¥³¥á¥ó¥È +SIGIOT 6 Core IOT ¥È¥é¥Ã¥×¡£\fBSIGABRT\fP ¤ÈƱµÁ +SIGEMT 7,\-,7 Term +SIGSTKFLT \-,16,\- A T{ +¿ôÃͱ黻¥×¥í¥»¥Ã¥µ¤Ë¤ª¤±¤ë¥¹¥¿¥Ã¥¯¥Õ¥©¥ë¥È (̤»ÈÍÑ) +T} +SIGIO 23,29,22 Term Æþ½ÐÎϤ¬²Äǽ¤Ë¤Ê¤Ã¤¿ (4.2BSD) +SIGCLD \-,\-,18 Ign \fBSIGCHLD\fP ¤ÈƱµÁ +SIGPWR 29,30,19 Term ÅŸ»ÁÓ¼º (Power failure) (System V) +SIGINFO 29,\-,\- \fBSIGPWR\fP ¤ÈƱµÁ +SIGLOST \-,\-,\- Term ¥Õ¥¡¥¤¥ë¥í¥Ã¥¯¤¬¼º¤ï¤ì¤¿ +SIGWINCH 28,28,20 Ign T{ +¥¦¥£¥ó¥É¥¦ ¥ê¥µ¥¤¥º ¥·¥°¥Ê¥ë (4.3BSD, Sun) +T} +SIGUNUSED \-,31,\- Core \fBSIGSYS\fP ¤ÈƱµÁ +.TE + +(¥·¥°¥Ê¥ë 29 ¤Ï alpha ¤Ç¤Ï +.B SIGINFO +/ +.B SIGPWR +¤À¤¬¡¢sparc ¤Ç¤Ï +.B SIGLOST +¤Ç¤¢¤ë¡£) + +.B SIGEMT +¤Ï POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢ +¤½¤Î¾¤Î¿¤¯¤Î Unix ¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¿¤¯¤Î¾ì¹ç¡¢¥³¥¢¥À¥ó¥×½ÐÎϤòȼ¤¦¥×¥í¥»¥¹¤Î½ªÎ»¤Ç¤¢¤ë¡£ + +.B SIGPWR +¤Ï (POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬) ¤³¤Î¥·¥°¥Ê¥ë¤¬Â¸ºß¤¹¤ë +¾¤Î Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¿¤¯¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥ÈÆ°ºî¤Ï̵»ë¤Ç¤¢¤ë¡£ + +.B SIGIO +¤Ï (POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬) ¤¤¤¯¤Ä¤«¤Î¾¤Î Unix ¥·¥¹¥Æ¥à¤Ç¤Ï +¥Ç¥Õ¥©¥ë¥ÈÆ°ºî¤Ï̵»ë¤Ç¤¢¤ë¡£ + +.B SIGUNUSED +¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤Û¤È¤ó¤É¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç +.B SIGSYS +¤ÎƱµÁ¸ì¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.\" parisc is the only exception: SIGSYS is 12, SIGUNUSED is 31 +.SS ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë +Linux ¤Ï¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ï¸µ¡¹ POSIX.1b ¤Î¥ê¥¢¥ë¥¿¥¤¥à³ÈÄ¥¤ÇÄêµÁ¤µ¤ì¤Æ +¤¤¤ë¤â¤Î¤Ç¤¢¤ê¡¢¸½ºß¤Ç¤Ï POSIX.1-2001 ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +Âбþ¤·¤Æ¤¤¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÈϰϤϡ¢¥Þ¥¯¥í +.B SIGRTMIN +¤È +.B SIGRTMAX +¤ÇÄêµÁ¤µ¤ì¤ë¡£ +POSIX.1-2001 ¤Ç¤Ï¡¢¾¯¤Ê¤¯¤È¤â +.B _POSIX_RTSIG_MAX +(8) ¸Ä¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ËÂбþ¤·¤¿¼ÂÁõ¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë¡£ +.PP +Linux ¤Ï¡¢32 ¸Ä¤Î°Û¤Ê¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ËÂбþ¤·¤Æ¤ª¤ê¡¢ +¤½¤ÎÈÖ¹æ¤Ï 33 ¤«¤é 64 ¤Ç¤¢¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢glibc ¤Î POSIX ¥¹¥ì¥Ã¥É¼ÂÁõ¤Ï¡¢ +ÆâÉô¤Ç 2¸Ä (NPTL ¤Î¾ì¹ç) ¤« 3¸Ä (LinuxThreads ¤Î¾ì¹ç) ¤Î +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ò»ÈÍѤ·¤Æ¤ª¤ê +.RB ( pthreads (7) +»²¾È)¡¢ +.B SIGRTMIN +¤ÎÃͤòŬÀÚ¤Ë (34 ¤« 35 ¤Ë) Ä´À°¤¹¤ë¡£ +ÍøÍѲÄǽ¤Ê¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÈÏ°Ï¤Ï glibc ¤Î¥¹¥ì¥Ã¥É¼ÂÁõ¤Ë¤è¤ê +°Û¤Ê¤ë¤· (»ÈÍѤ¹¤ë¥«¡¼¥Í¥ë¤È glibc ¤Ë¤è¤ê¼Â¹Ô»þ¤Ë¤âÊѲ½¤¹¤ë)¡¢ +Unix ¥·¥¹¥Æ¥à¤Î¼ïÎà¤Ë¤è¤Ã¤Æ¤â°Û¤Ê¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +¥×¥í¥°¥é¥à¤Ç¤Ï¡Ö¥Ï¡¼¥É¥³¡¼¥Ç¥£¥ó¥°¤·¤¿¿ô»ú¤ò»È¤Ã¤Æ¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î +»²¾È¤Ï·è¤·¤Æ¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¯¡×¡¢Âå¤ï¤ê¤Ë +.BR SIGRTMIN +n +¤Î·Á¤Ç»²¾È¤¹¤Ù¤­¤Ç¤¢¤ë¡£¤Þ¤¿¡¢ +.BR SIGRTMIN +n +¤¬ +.B SIGRTMAX +¤òĶ¤¨¤Æ¤¤¤Ê¤¤¤«¤Î¥Á¥§¥Ã¥¯¤ò (¼Â¹Ô»þ¤Ë) ŬÀڤ˹Ԥ¦¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +ɸ½à¥·¥°¥Ê¥ë¤È°Û¤Ê¤ê¡¢¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ë¤Ï +»öÁ°¤ËÄêµÁ¤µ¤ì¤¿°ÕÌ£¤Ï¤Ê¤¤¡£ +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÁ´Éô¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÄêµÁ¤·¤¿ÍÑÅӤ˻Ȥ¨¤ë¡£ +(⤷¡¢LinuxThreads ¼ÂÁõ¤Ç¡¢¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÈÖ¹æ¤Î¤¦¤Á +ºÇ½é¤Î 3¤Ä¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È) +.PP +¥Ï¥ó¥É¥ê¥ó¥°¤·¤Ê¤¤¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï +¼õ¿®¤·¤¿¥×¥í¥»¥¹¤Î½ªÎ»¤Ç¤¢¤ë¡£ +.PP +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ï°Ê²¼¤ÎÆÃħ¤¬¤¢¤ë: +.IP 1. 4 +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÏÊ£¿ô¤Î¼ÂÂΤò¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°ìÊý¡¢É¸½à¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢¤½¤Î¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë´Ö¤Ë +Ʊ¤¸¥·¥°¥Ê¥ë¤ÎÊ£¿ô¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤¬ÇÛÁ÷¤µ¤ì¤Æ¤â¡¢ +1 ¤Ä¤À¤±¤¬¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¡£ +.IP 2. 4 +¥·¥°¥Ê¥ë¤¬ +.BR sigqueue (2) +¤òÍѤ¤¤ÆÁ÷¿®¤µ¤ì¤¿¾ì¹ç¡¢ +ÉÕ°¥Ç¡¼¥¿ (À°¿ô¤«¥Ý¥¤¥ó¥¿) ¤ò¥·¥°¥Ê¥ë¤È¶¦¤ËÁ÷¿®¤Ç¤­¤ë¡£ +¼õ¿®Â¦¥×¥í¥»¥¹¤¬ +.BR sigaction (2) +¤Ë +.B SA_SIGINFO +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤷ¤¿¾ì¹ç¡¢ +¤³¤Î¥Ç¡¼¥¿¤Ï +.I siginfo_t +¹½Â¤ÂΤΠ+.I si_value +¥Õ¥£¡¼¥ë¥É·Ðͳ¤Ç¥Ï¥ó¥É¥é¤ÎÂè 2 °ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¡¢ +ÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤µ¤é¤Ë¡¢¤³¤Î¹½Â¤ÂΤΠ+.I si_pid +¤È +.I si_uid +¥Õ¥£¡¼¥ë¥É¤Ç¥·¥°¥Ê¥ë¤òÁ÷¿®¤·¤¿¥×¥í¥»¥¹¤Î PID ¤È¼Â¥æ¡¼¥¶ ID ¤ò +ÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.IP 3. 4 +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ç¤ÏÇÛÁ÷¤µ¤ì¤ë½ç½ø¤¬Êݾڤµ¤ì¤ë¡£ +Ʊ¤¸¥¿¥¤¥×¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÏÁ÷¿®¤µ¤ì¤¿½çÈÖ¤ËÅþÃ夹¤ë¡£ +°Û¤Ê¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤¬°ì¤Ä¤Î¥×¥í¥»¥¹¤ËÁ÷¿®¤µ¤ì¤¿¾ì¹ç¡¢ +ÈÖ¹æ¤Î¾®¤µ¤¤¥·¥°¥Ê¥ë¤«¤éÀè¤ËÅþÃ夹¤ë¡£ +(¤Ä¤Þ¤ê¾®¤µ¤¤ÈÖ¹æ¤Î¥·¥°¥Ê¥ë¤¬¹â¤¤Í¥Àè½ç°Ì¤ò»ý¤Ä¡£) +ÂоÈŪ¤Ë¡¢°ì¤Ä¤Î¥×¥í¥»¥¹¤ËÂФ·¤ÆÊ£¿ô¤Îɸ½à¥·¥°¥Ê¥ë¤¬½èÍýÂÔ¤Á¤È¤Ê¤Ã¤¿¾ì¹ç¡¢ +¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë½ç½ø¤ÏÉÔÄê¤Ç¤¢¤ë¡£ +.PP +°ì¤Ä¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æɸ½à¥·¥°¥Ê¥ë¤È¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎξÊý¤¬ +½èÍýÂÔ¤Á¤Î¾ì¹ç¡¢POSIX ¤Ï¤É¤Á¤é¤¬Àè¤ËÇÛÁ÷¤µ¤ì¤ë¤«¤òµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£ +Linux ¤Ç¤Ï¡¢Â¾¤Î¿¤¯¤Î¼ÂÁõ¤ÈƱÍÍ¡¢¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï +ɸ½à¥·¥°¥Ê¥ë¤¬Í¥À褵¤ì¤ë¡£ +.PP +POSIX ¤Ë¤è¤ì¤Ð¡¢1 ¥×¥í¥»¥¹Ëè¤ËºÇÄã +.B _POSIX_SIGQUEUE_MAX +(32) ¸Ä¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ò¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¤Ù¤­¤È¤·¤Æ¤¤¤ë¡£ +¤·¤«¤·¡¢ Linux ¤Ç¤Ï°ã¤Ã¤¿¼ÂÁõ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£¥«¡¼¥Í¥ë 2.6.7 ¤Þ¤Ç¤Ï +(2.6.7 ¤ò´Þ¤à)¡¢Á´¥×¥í¥»¥¹¤Ç¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë +¤Î¿ô¤Î¹ç·×¤Ë¤Ä¤¤¤Æ¥·¥¹¥Æ¥àÁ´ÂΤǤÎÀ©¸Â¤¬¤¢¤ë¡£ +¤³¤ÎÀ©¸Â¤Ï +.I /proc/sys/kernel/rtsig-max +¥Õ¥¡¥¤¥ë¤Ç¸«¤ë¤³¤È¤¬¤Ç¤­¡¢ (¸¢¸Â¤¬¤¢¤ì¤Ð) Êѹ¹¤â¤Ç¤­¤ë¡£ +´Ø·¸¤¹¤ë¥Õ¥¡¥¤¥ë¤È¤·¤Æ¡¢ +.I /proc/sys/kernel/rtsig-nr +¤ò¸«¤ë¤³¤È¤Ç¡¢¤¤¤¯¤Ä¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤¬¸½ºß¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¤«¤ò +ÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +Linux 2.6.8 ¤Ç¡¢¤³¤ì¤é¤Î +.I /proc +·Ðͳ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï¡¢ +.B RLIMIT_SIGPENDING +¥ê¥½¡¼¥¹À©¸Â¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£ +¤³¤ì¤Ï¡¢¥­¥å¡¼¤ËÆþ¤ë¥·¥°¥Ê¥ë¿ô¤Ë´Ø¤·¤Æ¥æ¡¼¥¶Ã±°Ì¤Ë +¾å¸Â¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¾Ü¤·¤¯¤Ï +.BR setrlimit (2) +¤ò»²¾È¡£ +.SS "ÈóƱ´ü¥·¥°¥Ê¥ë¤Ç°ÂÁ´¤Ê´Ø¿ô (async-signal-safe functions)" +.PP +¾¤Î¾ì½ê¤Î½èÍý¤Ï¥×¥í¥°¥é¥à¼Â¹Ô¤ÎǤ°Õ¤Î²Õ½ê¤ÇÃæÃǤµ¤ì¤ë¤¿¤á¡¢ +.BR sigaction (2) +¤ä +.BR signal (2) +¤ÇÅÐÏ¿¤¹¤ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Ë¤ÏÈó¾ï¤ËÃí°Õ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +POSIX ¤Ë¤Ï¡Ö°ÂÁ´¤Ê´Ø¿ô (safe function)¡×¤È¤¤¤¦³µÇ°¤¬¤¢¤ë¡£ +¥·¥°¥Ê¥ë¤¬°ÂÁ´¤Ç¤Ê¤¤´Ø¿ô¤Î¼Â¹Ô¤òÃæÃǤ·¡¢¤«¤Ä +.I handler +¤¬°ÂÁ´¤Ç¤Ê¤¤´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¡¢¥×¥í¥°¥é¥à¤ÎµóÆ°¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ + +POSIX.1-2004 (POSIX.1-2001 Technical Corrigendum (Àµ¸íɽ) 2 ¤È¤â¸À¤¦) ¤Ç¤Ï¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥éÆâ¤Ç¤Î°ÂÁ´¤Ê¸Æ¤Ó½Ð¤·¤òÊݾڤ¹¤ë¤³¤È¤¬É¬¿Ü¤Î´Ø¿ô¤È¤·¤Æ +°Ê²¼¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£ + +.in +4 +.nf +_Exit() +_exit() +abort() +accept() +access() +aio_error() +aio_return() +aio_suspend() +alarm() +bind() +cfgetispeed() +cfgetospeed() +cfsetispeed() +cfsetospeed() +chdir() +chmod() +chown() +clock_gettime() +close() +connect() +creat() +dup() +dup2() +execle() +execve() +fchmod() +fchown() +fcntl() +fdatasync() +fork() +fpathconf() +fstat() +fsync() +ftruncate() +getegid() +geteuid() +getgid() +getgroups() +getpeername() +getpgrp() +getpid() +getppid() +getsockname() +getsockopt() +getuid() +kill() +link() +listen() +lseek() +lstat() +mkdir() +mkfifo() +open() +pathconf() +pause() +pipe() +poll() +posix_trace_event() +pselect() +raise() +read() +readlink() +recv() +recvfrom() +recvmsg() +rename() +rmdir() +select() +sem_post() +send() +sendmsg() +sendto() +setgid() +setpgid() +setsid() +setsockopt() +setuid() +shutdown() +sigaction() +sigaddset() +sigdelset() +sigemptyset() +sigfillset() +sigismember() +signal() +sigpause() +sigpending() +sigprocmask() +sigqueue() +sigset() +sigsuspend() +sleep() +sockatmark() +socket() +socketpair() +stat() +symlink() +sysconf() +tcdrain() +tcflow() +tcflush() +tcgetattr() +tcgetpgrp() +tcsendbreak() +tcsetattr() +tcsetpgrp() +time() +timer_getoverrun() +timer_gettime() +timer_settime() +times() +umask() +uname() +unlink() +utime() +wait() +waitpid() +write() +.fi +.in +.PP +POSIX.1-2008 ¤Ç¤Ï¡¢¾åµ­¤Î¥ê¥¹¥È¤Î¤¦¤Á fpathconf(), pathconf(), sysconf() +¤¬ºï½ü¤µ¤ì¡¢°Ê²¼¤Î´Ø¿ô¤¬Äɲ䵤줿¡£ +.PP +.in +4n +.nf +execl() +execv() +faccessat() +fchmodat() +fchownat() +fexecve() +fstatat() +futimens() +linkat() +mkdirat() +mkfifoat() +mknod() +mknodat() +openat() +readlinkat() +renameat() +symlinkat() +unlinkat() +utimensat() +utimes() +.fi +.in +.SS ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ø¤Î³ä¤ê¹þ¤ß +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê¤¬Ää»ß (block) ¤·¤Æ¤¤¤ë´Ö¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ +µ¯Æ°¤µ¤ì¤ë¤È¡¢°Ê²¼¤Î¤É¤Á¤é¤«¤È¤Ê¤ë¡£ +.IP * 2 +¥·¥°¥Ê¥ë¤¬Ê֤俸塢¸Æ¤Ó½Ð¤·¤Ï¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¡£ +.IP * +¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¡£ +.PP +¤³¤ì¤é¤ÎÆó¤Ä¤ÎµóÆ°¤Î¤¦¤Á¤É¤Á¤é¤¬µ¯¤³¤ë¤«¤Ï¡¢¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ë¤è¤ê°Í¸¤·¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ +.B SA_RESTART +¥Õ¥é¥° +.RB ( sigaction (2) +»²¾È) ¤ò»È¤Ã¤ÆÀßÄꤵ¤ì¤Æ¤¤¤¿¤«¤Ë¤â°Í¸¤¹¤ë¡£ +¾ÜºÙ¤Ï Unix ¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ +Linux ¤Ë¤ª¤±¤ë¾ÜºÙ¤ò°Ê²¼¤ÇÀâÌÀ¤¹¤ë¡£ + +°Ê²¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Î¤¤¤º¤ì¤«¤Î¸Æ¤Ó½Ð¤·¤¬Ää»ß¤·¤Æ¤¤¤ë´Ö¤Ë +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢ +.B SA_RESTART +¥Õ¥é¥°¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ì¤Ð¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬Ê֤俸å¤Ë +¤½¤Î¸Æ¤Ó½Ð¤·¤Ï¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¤½¤Î¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.\" °Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï ERESTARTSYS ¤ò»È¤Ã¤Æ¤¤¤ë¡£ +.\" ¤½¤Î¤¿¤á¡¢¤³¤ì¤é¤ÏºÆ¥¹¥¿¡¼¥È¤¬²Äǽ¤Ç¤¢¤ë¡£ +.RS 4 +.IP * 2 +.BR read (2), +.BR readv (2), +.BR write (2), +.BR writev (2), +.BR ioctl (2) +¤Î¡ÖÃÙ¤¤ (slow)¡×¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë¸Æ¤Ó½Ð¤·¡£ +¤³¤³¤Ç¤¤¤¦¡ÖÃÙ¤¤¡×¥Ç¥Ð¥¤¥¹¤È¤Ï¡¢I/O ¸Æ¤Ó½Ð¤·¤¬Ìµ´ü¸Â¤ËÄä»ß (block) ¤¹¤ë +²ÄǽÀ­¤Î¤¢¤ë¥Ç¥Ð¥¤¥¹¤Î¤³¤È¤Ç¡¢Îã¤È¤·¤Æ¤ÏüËö¡¢¥Ñ¥¤¥×¡¢¥½¥±¥Ã¥È¤¬¤¢¤ë +(¤³¤ÎÄêµÁ¤Ç¤Ï¡¢¥Ç¥£¥¹¥¯¤ÏÃÙ¤¤¥Ç¥Ð¥¤¥¹¤Ç¤Ï¤Ê¤¤)¡£ +ÃÙ¤¤¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë I/O ¸Æ¤Ó½Ð¤·¤¬¡¢ +¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿»þÅÀ¤Þ¤Ç¤Ë²¿¤é¤«¤Î¥Ç¡¼¥¿¤ò +¤¹¤Ç¤ËžÁ÷¤·¤Æ¤¤¤ì¤Ð¡¢¸Æ¤Ó½Ð¤·¤ÏÀ®¸ù¥¹¥Æ¡¼¥¿¥¹ +(Ä̾ï¤Ï¡¢Å¾Á÷¤µ¤ì¤¿¥Ð¥¤¥È¿ô) ¤òÊÖ¤¹¤³¤È¤À¤í¤¦¡£ +.IP * +Ää»ß (block) ¤¹¤ë²ÄǽÀ­¤Î¤¢¤ë +.BR open (2) +(Î㤨¤Ð¡¢FIFO ¤Î¥ª¡¼¥×¥ó»þ; +.BR fifo (7) +»²¾È)¡£ +.IP * +.BR wait (2), +.BR wait3 (2), +.BR wait4 (2), +.BR waitid (2), +.BR waitpid (2). +.IP * +¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.\" If a timeout (setsockopt()) is in effect on the socket, then these +.\" system calls switch to using EINTR. Consequently, they and are not +.\" automatically restarted, and they show the stop/cont behavior +.\" described below. (Verified from 2.6.26 source, and by experiment; mtk) +.BR accept (2), +.BR connect (2), +.BR recv (2), +.BR recvfrom (2), +.BR recvmsg (2), +.BR send (2), +.BR sendto (2), +.BR sendmsg (2). +⤷¡¢¥½¥±¥Ã¥È¤Ë¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç (²¼µ­»²¾È)¡£ +.IP * +¥Õ¥¡¥¤¥ë¥í¥Ã¥¯ÍÑ¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.BR flock (2), +.BR fcntl (2) +.BR F_SETLKW . +.IP * +POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.BR mq_receive (3), +.BR mq_timedreceive (3), +.BR mq_send (3), +.BR mq_timedsend (3). +.IP * +.BR futex (2) +.B FUTEX_WAIT +(Linux 2.6.22 °Ê¹ß; ¤½¤ì°ÊÁ°¤Ï¾ï¤Ë +.B EINTR +¤Ç¼ºÇÔ¤·¤Æ¤¤¤¿)¡£ +.IP * +POSIX ¥»¥Þ¥Õ¥©¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.BR sem_wait (3), +.BR sem_timedwait (3) +(Linux 2.6.22 °Ê¹ß; ¤½¤ì°ÊÁ°¤Ï¾ï¤Ë +.B EINTR +¤Ç¼ºÇÔ¤·¤Æ¤¤¤¿)¡£ +.RE +.PP +°Ê²¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï¡¢ +.B SA_RESTART +¤ò»È¤Ã¤Æ¤¤¤ë¤É¤¦¤«¤Ë´Ø¤ï¤é¤º¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¸å¡¢ +ºÆ¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£ +¤³¤ì¤é¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤ë¤È¡¢¾ï¤Ë¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë¡£ +.\" ¤³¤ì¤é¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ë³ä¤ê¹þ¤ß¤ÎºÝ¤Ë +.\" EINTR ¤« ERESTARTNOHAND ¤òÊÖ¤¹¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£ +.RS 4 +.IP * 2 +.BR setsockopt (2) +¤ò»È¤Ã¤Æ¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹: +.BR accept (2), +.BR recv (2), +.BR recvfrom (2), +.BR recvmsg (2) +¤Ç¼õ¿®¥¿¥¤¥à¥¢¥¦¥È +.RB ( SO_RCVTIMEO ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤È¡¢ +.BR connect (2), +.BR send (2), +.BR sendto (2), +.BR sendmsg (2) +¤ÇÁ÷¿®¥¿¥¤¥à¥¢¥¦¥È +.RB ( SO_SNDTIMEO ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡£ +.IP * +¥·¥°¥Ê¥ëÂÔ¤Á¤Ë»È¤ï¤ì¤ë¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.BR pause (2), +.BR sigsuspend (2), +.BR sigtimedwait (2), +.BR sigwaitinfo (2). +.IP * +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿Â¿½Å¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.BR epoll_wait (2), +.BR epoll_pwait (2), +.BR poll (2), +.BR ppoll (2), +.BR select (2), +.BR pselect (2). +.IP * +System V IPC ¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.\" On some other systems, SA_RESTART does restart these system calls +.BR msgrcv (2), +.BR msgsnd (2), +.BR semop (2), +.BR semtimedop (2). +.IP * +¥¹¥ê¡¼¥×ÍѤΥ¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹: +.BR clock_nanosleep (2), +.BR nanosleep (2), +.BR usleep (3). +.IP * +.BR inotify (7) +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î +.BR read (2). +.IP * +.BR io_getevents (2). +.RE +.PP +.BR sleep (3) +´Ø¿ô¤â¡¢¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢·è¤·¤ÆºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +¤·¤«¤·¡¢À®¸ù¤È¤Ê¤ê¡¢»Ä¤Ã¤Æ¤¤¤ëÄä»ß»þ´Ö¤òÊÖ¤¹¡£ +.SS °ì»þÄä»ß¥·¥°¥Ê¥ë¤Ë¤è¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ø¤Î³ä¤ê¹þ¤ß +Linux ¤Ç¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤â¡¢ +¤¤¤¯¤Ä¤«¤Î¥Ö¥í¥Ã¥­¥ó¥°·¿¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï¡¢ +¥×¥í¥»¥¹¤¬°ì»þÄä»ß (stop) ¥·¥°¥Ê¥ë¤Î°ì¤Ä¤Ë¤è¤êÄä»ß¤µ¤ì¡¢ +.B SIGCONT +¤Ë¤è¤êºÆ³«¤µ¤ì¤¿¸å¤Ë¡¢¥¨¥é¡¼ +.B EINTR +¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +¤³¤ÎµóÆ°¤Ï POSIX.1 ¤Çǧ¤á¤é¤ì¤Æ¤ª¤é¤º¡¢Â¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ïµ¯¤³¤é¤Ê¤¤¡£ + +¤³¤ÎµóÆ°¤ò¼¨¤¹ Linux ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.RS 4 +.IP * 2 +.BR setsockopt (2) +¤ò»È¤Ã¤Æ¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹: +.BR accept (2), +.BR recv (2), +.BR recvfrom (2), +.BR recvmsg (2) +¤Ç¼õ¿®¥¿¥¤¥à¥¢¥¦¥È +.RB ( SO_RCVTIMEO ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤È¡¢ +.BR connect (2), +.BR send (2), +.BR sendto (2), +.BR sendmsg (2) +¤ÇÁ÷¿®¥¿¥¤¥à¥¢¥¦¥È +.RB ( SO_SNDTIMEO ) +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡£ +.IP * 2 +.BR epoll_wait (2), +.BR epoll_pwait (2). +.IP * +.BR semop (2), +.BR semtimedop (2). +.IP * +.BR sigtimedwait (2), +.BR sigwaitinfo (2). +.IP * +.BR inotify (7) +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î +.BR read (2). +.IP * +Linux 2.6.21 °ÊÁ°: +.BR futex (2) +.BR FUTEX_WAIT , +.BR sem_timedwait (3), +.BR sem_wait (3). +.IP * +Linux 2.6.8 °ÊÁ°: +.BR msgrcv (2), +.BR msgsnd (2). +.IP * +Linux 2.4 °ÊÁ°: +.BR nanosleep (2). +.RE +.SH ½àµò +POSIX.1 (Ãíµ­¤·¤¿ÆâÍưʳ°)¡£ +.SH ¥Ð¥° +.B SIGIO +¤È +.B SIGLOST +¤ÏƱ¤¸Ãͤò»ý¤Ã¤Æ¤¤¤ë¡£ +.B SIGLOST +¤Ï¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¤Ç¤Ï¥³¥á¥ó¥È¥¢¥¦¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤·¤«¤·¡¢¥½¥Õ¥È¥¦¥§¥¢¤Ë¤è¤Ã¤Æ¤Ï¥Ó¥ë¥É¤Î²áÄø¤Ç¥·¥°¥Ê¥ë 29 ¤ò +.B SIGLOST +¤È¤ß¤Ê¤·¤Æ¤·¤Þ¤¦¤â¤Î¤¬¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR kill (1), +.BR getrlimit (2), +.BR kill (2), +.BR killpg (2), +.BR setitimer (2), +.BR setrlimit (2), +.BR sgetmask (2), +.BR sigaction (2), +.BR sigaltstack (2), +.BR signal (2), +.BR signalfd (2), +.BR sigpending (2), +.BR sigprocmask (2), +.BR sigqueue (2), +.BR sigsuspend (2), +.BR sigwaitinfo (2), +.BR abort (3), +.BR bsd_signal (3), +.BR longjmp (3), +.BR raise (3), +.BR sigset (3), +.BR sigsetops (3), +.BR sigvec (3), +.BR sigwait (3), +.BR strsignal (3), +.BR sysv_signal (3), +.BR core (5), +.BR proc (5), +.BR pthreads (7) diff --git a/release/man7/socket.7 b/release/man7/socket.7 new file mode 100644 index 00000000..6409cbde --- /dev/null +++ b/release/man7/socket.7 @@ -0,0 +1,761 @@ +'\" t +.\" Don't change the first line, it tells man that we need tbl. +.\" This man page is Copyright (C) 1999 Andi Kleen . +.\" and copyright (c) 1999 Matthew Wilcox. +.\" 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. +.\" +.\" 2002-10-30, Michael Kerrisk, +.\" Added description of SO_ACCEPTCONN +.\" 2004-05-20, aeb, added SO_RCVTIMEO/SO_SNDTIMEO text. +.\" Modified, 27 May 2004, Michael Kerrisk +.\" Added notes on capability requirements +.\" A few small grammar fixes +.\" FIXME +.\" The following are not yet documented: +.\" SO_PEERNAME +.\" SO_TIMESTAMPNS +.\" SO_MARK +.\" SO_TIMESTAMPING +.\" SO_PROTOCOL (2.6.32) +.\" SO_DOMAIN (2.6.32) +.\" SO_RXQ_OVFL (2.6.33) +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2003-01-20, Akihiro Motoki +.\" Updated 2005-02-23, Akihiro MOTOKI +.\" Updated 2005-10-05, Akihiro MOTOKI +.\" Updated 2005-12-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.16 +.\" Updated 2005-12-26, Akihiro MOTOKI, Catch up to LDP man-pages 2.18 +.\" Updated 2006-04-15, Akihiro MOTOKI, Catch up to LDP man-pages 2.29 +.\" Updated 2007-01-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.43 +.\" +.\"WORD protocol family ¥×¥í¥È¥³¥ë¥Õ¥¡¥ß¥ê¡¼ +.\"WORD socket type ¥½¥±¥Ã¥È¥¿¥¤¥× +.\"WORD file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\"WORD anonymous socket ̾Á°Ìµ¤·¥½¥±¥Ã¥È +.\"WORD asynchronous ÈóƱ´ü (Ū) +.\"WORD credential ¿®Ç¤¾õ +.\"WORD capability ¸¢¸Â +.\"WORD ancillary data Êä½õ¥Ç¡¼¥¿ +.\" +.TH SOCKET 7 2008-12-03 Linux "Linux Programmer's Manual" +.SH ̾Á° +socket \- Linux ¤Î¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.SH ½ñ¼° +.B #include +.sp +.IB sockfd " = socket(int " socket_family ", int " socket_type ", int " protocol ); +.SH ÀâÌÀ +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï Linux ¥Í¥Ã¥È¥ï¡¼¥¯¤Î¥½¥±¥Ã¥ÈÁؤËÂФ¹¤ë +¥æ¡¼¥¶¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òµ­½Ò¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +BSD ¸ß´¹¥½¥±¥Ã¥È¤Ï¡¢¥æ¡¼¥¶¥×¥í¥»¥¹¤È¥«¡¼¥Í¥ëÆâÉô¤Î +¥Í¥Ã¥È¥ï¡¼¥¯¥×¥í¥È¥³¥ë¥¹¥¿¥Ã¥¯·²¤È¤Î´Ö¤Ë¡¢ +Åý°ìŪ¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¥×¥í¥È¥³¥ë¥â¥¸¥å¡¼¥ë¤Ï +.I "¥×¥í¥È¥³¥ë¥Õ¥¡¥ß¥ê¡¼ (protocol familiy)" +(Î㡧 +.BR AF_INET ", " AF_IPX ", " AF_PACKET ) +¤È +.I "¥½¥±¥Ã¥È¥¿¥¤¥× (socket types)" +(Î㡧 +.BR SOCK_STREAM ", " SOCK_DGRAM ) +¤ËʬÎà¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Ë´Ø¤¹¤ë¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR socket (2) +¤ò»²¾È¤Î¤³¤È¡£ +.SS ¥½¥±¥Ã¥ÈÁؤδؿô·² +¤³¤ì¤é¤Î´Ø¿ô¤Ï¥æ¡¼¥¶¥×¥í¥»¥¹¤¬¥Ñ¥±¥Ã¥È¤òÁ÷¼õ¿®¤·¤¿¤ê¡¢¤½¤Î¾¤Î¥½¥±¥Ã¥ÈÁàºî¤ò +¹Ô¤Ã¤¿¤ê¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£¾ÜºÙ¤Ï¤½¤ì¤¾¤ì¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò +¸«¤Æ¤Û¤·¤¤¡£ + +.BR socket (2) +¤Ï¥½¥±¥Ã¥È¤òÀ¸À®¤¹¤ë¡£ +.BR connect (2) +¤Ï¥½¥±¥Ã¥È¤ò¥ê¥â¡¼¥È¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ËÀܳ¤¹¤ë¡£ +.BR bind (2) +¤Ï¥½¥±¥Ã¥È¤ò¥í¡¼¥«¥ë¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¡£ +.BR listen (2) +¤Ï¥½¥±¥Ã¥È¤Ë¿·¤·¤¤Àܳ¤¬Í褿¤é¼õ¿®¤¹¤ë¤è¤¦¤ËÅÁ¤¨¡¢ +.BR accept (2) +¤Ï³°Éô¤«¤é¤ä¤Ã¤Æ¤­¤¿Àܳ¤ËÂФ·¤Æ¿·¤·¤¤¥½¥±¥Ã¥È¤òÆÀ¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +.BR socketpair (2) +¤Ï¸ß¤¤¤ËÀܳ¤µ¤ì¤¿Æó¤Ä¤Î̾Á°Ìµ¤·¥½¥±¥Ã¥È (anonymous socket) ¤òÊÖ¤¹ +.RB ( AF_UNIX +¤Î¤è¤¦¤Ê¡¢¤¤¤¯¤Ä¤«¤Î¥í¡¼¥«¥ë¤Ê¥Õ¥¡¥ß¥ê¡¼¤Ç¤·¤«¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤)¡£ +.PP +.BR send (2), +.BR sendto (2), +.BR sendmsg (2) +¤Ï¥½¥±¥Ã¥È¤òÄ̤·¤Æ¥Ç¡¼¥¿¤òÁ÷¿®¤·¡¢ +.BR recv (2) +.BR recvfrom (2), +.BR recvmsg (2) +¤Ï¥½¥±¥Ã¥È¤«¤é¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ë¡£ +.BR poll (2) +¤È +.BR select (2) +¤Ï¥Ç¡¼¥¿¤ÎÅþÃå¤òÂԤ俤ꡢ¥Ç¡¼¥¿Á÷¿®¤Î½àÈ÷¤¬¤Ç¤­¤ë¤Þ¤ÇÂԤ俤ꤹ¤ë¡£ +¤µ¤é¤Ë¡¢ +.BR write (2), +.BR writev (2), +.BR sendfile (2), +.BR read (2), +.BR readv (2) +¤Î¤è¤¦¤Êɸ½àŪ¤Ê I/O Áàºî¤â¥Ç¡¼¥¿¤ÎÆɤ߽ñ¤­¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.BR getsockbyname (2) +¤Ï¥í¡¼¥«¥ë¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤òÊÖ¤·¡¢ +.BR getpeername (2) +¤Ï¥ê¥â¡¼¥È¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£ +.BR getsockopt (2) +¤È +.BR setsockopt (2) +¤Ï¥½¥±¥Ã¥ÈÁؤΥª¥×¥·¥ç¥ó¤ä¥×¥í¥È¥³¥ë¥ª¥×¥·¥ç¥ó¤Î¼èÆÀ¡¦ÀßÄê¤ËÍѤ¤¤é¤ì¤ë¡£ +¾¤Î¤¤¤¯¤Ä¤«¤Î¥ª¥×¥·¥ç¥ó¤Î¼èÆÀ¡¦ÀßÄê¤Ë¤Ï +.BR ioctl (2) +¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.BR close (2) +¤Ï¥½¥±¥Ã¥È¤ò¥¯¥í¡¼¥º¤¹¤ë¡£ +.BR shutdown (2) +¤ÏÁ´Æó½Å¤Ê¥½¥±¥Ã¥ÈÀܳ¤òÉôʬŪ¤Ë¥¯¥í¡¼¥º¤¹¤ë¡£ +.PP +¥·¡¼¥¯Æ°ºî¤ä¡¢ 0 °Ê³°¤Î°ÌÃÖ¤ËÂФ¹¤ë +.BR pread (2) +¤ä +.BR pwrite (2) +¤Ï¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +Èó¥Ö¥í¥Ã¥­¥ó¥°¤Ê I/O ¤ò¥½¥±¥Ã¥È¤Ç¹Ô¤¦¤³¤È¤Ï²Äǽ¤Ç¡¢ +.BR fcntl (2) +¤ò»È¤Ã¤Æ¥½¥±¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë +.B O_NONBLOCK +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ì¤ÐÎɤ¤¡£ +¤³¤¦¤¹¤ë¤È¥Ö¥í¥Ã¥¯¤µ¤ì¤ëÁàºî¤Ï¡¢ (Ä̾ï) +.B EAGAIN +¥¨¥é¡¼¤ÇÌá¤ë¤³¤È¤Ë¤Ê¤ë +(¸å¤Ç½èÍý¤¬ºÆ»î¹Ô¤µ¤ì¤ë¤³¤È¤¬´üÂÔ¤µ¤ì¤Æ¤¤¤ë)¡£ +.BR connect (2) +¤Ç¤Ï +.B EINPROGRESS +¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +¤³¤Î¾ì¹ç¡¢¥æ¡¼¥¶¤Ï¤µ¤Þ¤¶¤Þ¤Ê¥¤¥Ù¥ó¥È¤ò +.BR poll (2) +¤ä +.BR select (2) +¤ò»È¤Ã¤ÆÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£ +.TS +tab(:) allbox; +c s s +l l l. +I/O ¥¤¥Ù¥ó¥È +¥¤¥Ù¥ó¥È:poll ¥Õ¥é¥°:ÆâÍÆ +Read:POLLIN:T{ +¿·¤·¤¤¥Ç¡¼¥¿¤¬ÅþÃ夷¤¿¡£ +T} +Read:POLLIN:T{ +(Àܳ»Ö¸þ¤Î¥½¥±¥Ã¥È¤Ç) +Àܳ¤ÎÀßÄ꤬½ªÎ»¤·¤¿¡£ +T} +Read:POLLHUP:T{ +ÀܳÀè¤ÇÀÚÃÇÍ׵᤬À¸À®¤µ¤ì¤¿¡£ +T} +Read:POLLHUP:T{ +Àܳ¤¬²õ¤ì¤¿ (Àܳ»Ö¸þ¤Î¥×¥í¥È¥³¥ë¤Î¤ß)¡£ +¤³¤Î¾ì¹ç¡¢¥½¥±¥Ã¥È¤Ë½ñ¤­¹þ¤ß¤¬¹Ô¤ï¤ì¤ë¤È +.B SIGPIPE +¤âÁ÷¿®¤µ¤ì¤ë¡£ +T} +Write:POLLOUT:T{ +¥½¥±¥Ã¥È¤Ë¤Ï¿·¤·¤¤¥Ç¡¼¥¿¤ò½ñ¤­¹þ¤à¤Î¤Ë +½¼Ê¬¤Ê¥Ð¥Ã¥Õ¥¡Îΰ褬¤¢¤ë¡£ +T} +Read/Write:T{ +POLLIN| +.br +POLLOUT +T}:T{ +³°Éô¸þ¤±¤Î +.BR connect (2) +¤¬½ªÎ»¤·¤¿¡£ +T} +Read/Write:POLLERR:T{ +ÈóƱ´üŪ (asynchronous) ¤Ê¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£ +T} +Read/Write:POLLHUP:ÀܳÀ褬ÊÒÊý¸þ¤òÀÚÃǤ·¤¿¡£ +Exception:POLLPRI:T{ +¶ÛµÞ¥Ç¡¼¥¿ (urgent data) ¤¬ÅþÃ夷¤¿¡£ +¤³¤Î¾ì¹ç¤Ï +.B SIGURG +¤¬Á÷¿®¤µ¤ì¤ë¡£ +T} +.\" FIXME . The following is not true currently: +.\" It is no I/O event when the connection +.\" is broken from the local end using +.\" .BR shutdown (2) +.\" or +.\" .BR close (2). +.TE + +.PP +.BR poll (2) +¤ä +.BR select (2) +¤ò»È¤¦Âå¤ï¤ê¤Ë¡¢¥«¡¼¥Í¥ë¤«¤é¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë +¥¤¥Ù¥ó¥È¤òÄÌÃΤµ¤»¤ë¤Î¤Ë +.B SIGIO +¥·¥°¥Ê¥ë¤ò»È¤¦ÊýË¡¤â¤¢¤ë¡£ +¤³¤ÎÊýË¡¤ò»È¤¦¤Ë¤Ï¡¢ +.BR fcntl (2) +¤òÍѤ¤¤Æ¥½¥±¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë +.B O_ASYNC +¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¡¢ +.B SIGIO +¤ËÂФ¹¤ëÍ­¸ú¤Ê¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ò +.BR sigaction (2) +¤Ë¤è¤Ã¤ÆÀßÄꤷ¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ +¸å½Ò¤Î +.I ¥·¥°¥Ê¥ë +¤Ë´Ø¤¹¤ëµÄÏÀ¤â»²¹Í¤Ë¤¹¤ë¤³¤È¡£ +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +¤³¤ì¤é¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.BR setsockopt (2) +¤òÍѤ¤¤ì¤ÐÀßÄê¤Ç¤­¡¢ +.BR getsockopt (2) +¤òÍѤ¤¤ì¤Ð¼èÆÀ¤Ç¤­¤ë¡£ +⤷¡¢¤É¤Î¥½¥±¥Ã¥È¤Î¾ì¹ç¤â +¥½¥±¥Ã¥È¥ì¥Ù¥ë¤Ë¤Ï +.B SOL_SOCKET +¤ò»ØÄꤹ¤ë¤³¤È¡£ +.\" SO_ACCEPTCONN ¤Ï POSIX.1-2001 ¤ÇÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢¸µ¤Ï +.\" W R Stevens ¤Î UNPv1 ¤Ë½ñ¤«¤ì¤Æ¤¤¤¿¡£ +.TP +.B SO_ACCEPTCONN +¤³¤Î¥½¥±¥Ã¥È¤¬ +.BR listen (2) +¤Ë¤è¤Ã¤ÆÀܳÂÔ¤Á¼õ¤±¾õÂÖ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¼¨¤¹ÃͤòÊÖ¤¹¡£ +ÃÍ 0 ¤Ï listen ¾õÂ֤Υ½¥±¥Ã¥È¤Ç¤Ê¤¤¤³¤È¤ò¡¢ +ÃÍ 1 ¤Ï listen ¾õÂ֤Υ½¥±¥Ã¥È¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£ +.BR getsockopt (2) +¤«¤é¤Î¤ßÆɤ߽Ф·²Äǽ¤Ç¤¢¤ë¡£ +.TP +.B SO_BINDTODEVICE +¤³¤Î¥½¥±¥Ã¥È¤ò¡¢°ú¤­¿ô¤ÇÅϤ·¤¿¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹Ì¾¤Ç»ØÄꤵ¤ì¤ë +(\(lqeth0\(rq ¤Î¤è¤¦¤Ê) ÆÃÄê¤Î¥Ç¥Ð¥¤¥¹¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¡£ +̾Á°¤¬¶õʸ»úÎó¤À¤Ã¤¿¤ê¡¢¥ª¥×¥·¥ç¥ó¤ÎŤµ (optlen) ¤¬ 0 ¤Î¾ì¹ç¤Ë¤Ï¡¢ +¥½¥±¥Ã¥È¤Î¥Ð¥¤¥ó¥É¤¬ºï½ü¤µ¤ì¤ë¡£ÅϤ¹¥ª¥×¥·¥ç¥ó¤Ï¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹Ì¾¤¬ +Æþ¤Ã¤¿¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿²ÄÊÑŤÎʸ»úÎó¤Ç¤¢¤ë¡£ +ʸ»úÎó¤ÎºÇÂç¤Î¥µ¥¤¥º¤Ï +.B IFNAMSIX +¤Ç¤¢¤ë¡£ +¥½¥±¥Ã¥È¤¬¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤ë¤È¡¢ +¤½¤ÎÆÃÄê¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤«¤é¼õ¿®¤µ¤ì¤¿¥Ñ¥±¥Ã¥È¤À¤±¤ò½èÍý¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤¤¯¤Ä¤«¤Î¥½¥±¥Ã¥È¥¿¥¤¥×¡¢ÆÃ¤Ë +.B AF_INET +¤ËÂФ·¤Æ¤Î¤ßÆ°ºî¤¹¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +¥Ñ¥±¥Ã¥È¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ (Ä̾ï¤Î +.BR bind (8) +¤ò»È¤¦¤³¤È)¡£ +.TP +.B SO_BROADCAST +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥Õ¥é¥°¤òÀßÄꡦ¼èÆÀ¤¹¤ë¡£Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤Ï¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤ËÁ÷¤é¤ì¤¿¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤·¤¿¤ê¡¢ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥¢¥É¥ì¥¹¤Ë¥Ñ¥±¥Ã¥È¤òÁ÷¿®¤·¤¿¤ê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¥¹¥È¥ê¡¼¥à»Ø¸þ¤Î¥½¥±¥Ã¥È¤Ë¤Ï²¿¤Î¸ú²Ì¤â¤Ê¤¤¡£ +.TP +.B SO_BSDCOMPAT +BSD ¤Î¥Ð¥°¤ËÂФ·¤Æ¸ß´¹À­¤ò¼è¤ë¤¿¤á¤Îµ¡Ç½¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤Îµ¡Ç½¤Ï Linux 2.0 ¤È 2.2 ¤Î UDP ¥×¥í¥È¥³¥ë¥â¥¸¥å¡¼¥ë¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ UDP ¥½¥±¥Ã¥È¤Ç¼õ¿®¤µ¤ì¤¿ ICMP ¥¨¥é¡¼¤Ï +¥æ¡¼¥¶¥×¥í¥°¥é¥à¤ËÅϤµ¤ì¤Ê¤¤¡£ +¤³¤ì°Ê¹ß¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Î¥µ¥Ý¡¼¥È¤Ï +Ãʳ¬Åª¤ËÇѻߤµ¤ì¤Æ¤­¤¿¡£ +Linux 2.4 ¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤ÏÌۤäÆ̵»ë¤µ¤ì¡¢ +Linux 2.6 ¤Ç¤Ï¥×¥í¥°¥é¥à¤¬¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤ë¤È (printk() ¤ò»È¤Ã¤Æ) +¥«¡¼¥Í¥ë¤Î·Ù¹ð¥á¥Ã¥»¡¼¥¸¤¬½ÐÎϤµ¤ì¤ë¡£ +Linux 2.0 ¤Ç¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢ +raw ¥½¥±¥Ã¥È¤Ë¤ª¤¤¤Æ¤â BSD ¤Î¥Ð¥° (¥é¥ó¥À¥à¥Ø¥Ã¥ÀÊѹ¹¡¢ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¥Õ¥é¥°¤Î¥¹¥­¥Ã¥×) +¤ËÂФ¹¤ë¸ß´¹µ¡Ç½¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£ +¤·¤«¤·¡¢¤³¤Á¤é¤Ï Linux 2.2 ¤Çºï½ü¤µ¤ì¤¿¡£ +.TP +.B SO_DEBUG +¥½¥±¥Ã¥È¤Î¥Ç¥Ð¥Ã¥°µ¡Ç½¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.B CAP_NET_ADMIN +¸¢¸Â¤ò»ý¤Ä¥×¥í¥»¥¹¤«¡¢¼Â¸ú¥æ¡¼¥¶ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤Ç¤·¤« +ÍøÍѤǤ­¤Ê¤¤¡£ +.TP +.B SO_ERROR +ÊÝα¤Ë¤Ê¤Ã¤Æ¤¤¤¿¥½¥±¥Ã¥È¥¨¥é¡¼¤ò¼èÆÀ¤·¤Æ¥¯¥ê¥¢¤¹¤ë¡£ +.BR getsockopt (2) +¤Ç¤Î¤ßÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +À°¿ôÃͤò¤È¤ë¡£ +.TP +.B SO_DONTROUTE +¥²¡¼¥È¥¦¥§¥¤¤ò·Ðͳ¤»¤º¡¢Ä¾ÀÜÀܳ¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¤ËÁ÷¿®¤¹¤ë¡£ +.BR send (2) +Áàºî¤Ç +.B MSG_DONTROUTE +¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¤¿¾ì¹ç¤âƱ¤¸¸ú²Ì¤¬ÆÀ¤é¤ì¤ë¡£ +¥Ö¡¼¥ëÀ°¿ô¤Î¥Õ¥é¥°¤ò¼è¤ë¡£ +.TP +.B SO_KEEPALIVE +Àܳ»Ö¸þ¤Î¥½¥±¥Ã¥È¤ËÂФ¹¤ë keep-alive ¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¥Ö¡¼¥ëÃͤÎÀ°¿ô¥Õ¥é¥°¤ò¤È¤ë¡£ +.TP +.B SO_LINGER +.B SO_LINGER +¥ª¥×¥·¥ç¥ó¤ò¼èÆÀ¡¦ÀßÄꤹ¤ë¡£°ú¤­¿ô¤Ë¤Ï +.I linger +¹½Â¤ÂΤò¼è¤ë¡£ +.sp +.in +4n +.nf +struct linger { + int l_onoff; /* linger active */ + int l_linger; /* how many seconds to linger for */ +}; +.fi +.in +.IP +Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +.BR close (2) +¤ä +.BR shutdown (2) +¤Ï¡¢¤½¤Î¥½¥±¥Ã¥È¤Ë¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤¬¤¹¤Ù¤ÆÁ÷¿®´°Î»¤¹¤ë¤«¡¢ +linger (µï»Ä¤ê) ¥¿¥¤¥à¥¢¥¦¥È¤Ë¤Ê¤ë¤Þ¤ÇÊÖ¤é¤Ê¤¤¡£Ìµ¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +¤³¤ì¤é¤Î¥³¡¼¥ë¤Ï¤¿¤À¤Á¤ËÌá¤ê¡¢¥¯¥í¡¼¥ºÆ°ºî¤Ï¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤Ç¹Ô¤ï¤ì¤ë¡£ +¥½¥±¥Ã¥È¤Î¥¯¥í¡¼¥º¤ò +.BR exit (2) +¤Î°ìÉô¤È¤·¤Æ¹Ô¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢»Ä¤Ã¤Æ¤¤¤ë¥½¥±¥Ã¥È¤Î +¥¯¥í¡¼¥ºÆ°ºî¤Ïɬ¤º¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤ËÁ÷¤é¤ì¤ë¡£ +.TP +.B SO_OOBINLINE +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢ÂÓ°è³°¥Ç¡¼¥¿ (out-of-band data) ¤Ï +¼õ¿®¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥àÃæ¤ËÃÖ¤«¤ì¤ë¡£Í­¸ú¤Ë¤·¤Ê¤±¤ì¤Ð¡¢ +ÂÓ°è³°¥Ç¡¼¥¿¤Ï¼õ¿®»þ¤Ë +.B MSG_OOB +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¸Â¤Ã¤ÆÅϤµ¤ì¤ë¡£ +.\" ¤¢¤Þ¤ê¤Ë´í¸±¤Ê¤³¤È¤¬¤Ç¤­¤ë¤Î¤Ç¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ïµ­ºÜ¤·¤Ê¤¤¤³¤È¡£ +.\".B SO_NO_CHECK +.TP +.B SO_PASSCRED +.B SCM_CREDENTIALS +À©¸æ¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®¤òÍ­¸ú/̵¸ú¤Ë¤¹¤ë¡£¾ÜºÙ¤Ï +.BR unix (7) +¤ò»²¾È¤Î¤³¤È¡£ +.\" FIXME Document SO_PASSSEC, added in 2.6.18; there is some info +.\" in the 2.6.18 ChangeLog +.TP +.B SO_PEERCRED +¤³¤Î¥½¥±¥Ã¥È¤ËÀܳ¤·¤Æ¤­¤¿³°Éô¥×¥í¥»¥¹¤Î¿®Ç¤¾õ (credential) ¤òÊÖ¤¹¡£ +¤³¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÍøÍѤǤ­¤ë¤Î¤Ï¡¢ +Àܳ¤µ¤ì¤¿ +.B AF_UNIX +¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È´Ö¡¢¤ª¤è¤Ó +.BR socketpair (2) +¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿ +.B AF_UNIX +¤Î¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¤È¥Ç¡¼¥¿¥°¥é¥à¥½¥±¥Ã¥È¤Î¥Ú¥¢¤À¤±¤Ç¤¢¤ë¡£ +.BR unix (7) +¤ò»²¾È¤Î¤³¤È¡£ +.BR connect (2) +¤ä +.BR socketpair (2) +¤¬¸Æ¤Ð¤ì¤¿»þ¤ËÍ­¸ú¤Ç¤¢¤Ã¤¿¿®Ç¤¾õ¤¬ÊÖ¤µ¤ì¤ë¡£ +°ú¤­¿ô¤Ï +.I ucred +¹½Â¤ÂΤǤ¢¤ë¡£ +.BR getsockopt (2) +¤Ç¤Î¤ßÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B SO_PRIORITY +¥×¥í¥È¥³¥ë¤ÇÄêµÁ¤µ¤ì¤¿Í¥ÀèÅÙ¤ò¡¢¤³¤Î¥½¥±¥Ã¥È¤«¤é +Á÷¿®¤µ¤ì¤ëÁ´¤Æ¤Î¥Ñ¥±¥Ã¥È¤Ë¥»¥Ã¥È¤¹¤ë¡£ Linux ¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥­¥å¡¼ÆâÉô¤Î +À°Îó¤Ë¤³¤ÎÃͤòÍѤ¤¤ë¡£¹â¤¤Í¥ÀèÅÙ¤ò»ý¤Ã¤Æ¤¤¤ë¥Ñ¥±¥Ã¥È¤ÏÀè¤Ë½èÍý¤µ¤ì¤ë¡£ +¤¿¤À¤·¤½¤Î¥Ç¥Ð¥¤¥¹¤Î¥­¥å¡¼½èÍý¤Î¤ä¤êÊý¤Ë°Í¸¤¹¤ë¡£ +.BR ip (7) +¤Ç¤Ï¡¢³°¸þ¤±¥Ñ¥±¥Ã¥È¤Î IP type-of-service (TOS) ¥Õ¥£¡¼¥ë¥É¤Ë¤â¤³¤ÎÃͤ¬ÀßÄꤵ¤ì¤ë¡£ +0 ¤«¤é 6 °Ê³°¤ÎÍ¥ÀèÅÙ¤ò¥»¥Ã¥È¤¹¤ë¤Ë¤Ï +.B CAP_NET_ADMIN +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£ +.TP +.B SO_RCVBUF +¥½¥±¥Ã¥È¤Î¼õ¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇÂ祵¥¤¥º¤òÀßÄꡦ¼èÆÀ¤¹¤ë (¥Ð¥¤¥Èñ°Ì)¡£ +.BR setsockopt (2) +¤ò»È¤Ã¤ÆÃͤ¬ÀßÄꤵ¤ì¤¿¤È¤­¤Ë (´ÉÍý¥ª¡¼¥Ð¥Ø¥Ã¥ÉÍѤÎÎΰè¤ò³ÎÊݤ¹¤ë¤¿¤á¤Ë) +¥«¡¼¥Í¥ë¤Ï¤³¤ÎÃͤò 2Çܤ·¡¢ +.\" ¾¤Î¤Û¤È¤ó¤É¤Î (Á´¤Æ¤Î?) ¼ÂÁõ¤Ç¤Ï¤³¤ó¤Ê¤³¤È¤Ï¹Ô¤Ã¤Æ¤¤¤Ê¤¤ -- MTK, Dec 05 +.BR getsockopt (2) +¤Ï¤³¤Î 2Çܤµ¤ì¤¿ÃͤòÊÖ¤¹¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï +.I /proc/sys/net/core/rmem_default +¥Õ¥¡¥¤¥ë¤ÇÀßÄꤵ¤ì¡¢µöÍƤµ¤ì¤ëºÇÂç¤ÎÃÍ¤Ï +.I /proc/sys/net/core/rmem_max +¥Õ¥¡¥¤¥ë¤ÇÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÎºÇ¾®ÃÍ¤Ï (2Çܤ·¤¿ÃͤÇ) 256 ¤Ç¤¢¤ë¡£ +.TP +.BR SO_RCVBUFFORCE " (Linux 2.6.14 °Ê¹ß)" +¤³¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¡¢Æø¢¥×¥í¥»¥¹ +.RB ( CAP_NET_ADMIN +¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Ï +.B SO_RCVBUF +¤ÈƱ¤¸¤³¤È¤ò¼Â¹Ô¤Ç¤­¤ë¡£ +¤¿¤À¤·¡¢¾å¸Â +.I rmem_max +¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR SO_RCVLOWAT " ¤È " SO_SNDLOWAT +¥Ð¥Ã¥Õ¥¡Ãæ¤Ëί¤á¤ë¤³¤È¤Î¤Ç¤­¤ë¥Ç¡¼¥¿¤ÎºÇ¾®Ãͤò»ØÄꤹ¤ë¡£ +¤³¤Î¥µ¥¤¥º¤ò±Û¤¨¤ë¤È¡¢¥½¥±¥Ã¥ÈÁؤϤ½¤Î¥Ç¡¼¥¿¤ò¥×¥í¥È¥³¥ë¤ËÅϤ· +.RB ( SO_SNDLOWAT )¡¢ +¼õ¿®»þ¤Ë¤Ï¥æ¡¼¥¶¤ËÅϤ¹ +.RB ( SO_RCVLOWAT )¡£ +¤³¤ì¤éÆó¤Ä¤ÎÃÍ¤Ï 1 ¤Ë½é´ü²½¤µ¤ì¤ë¡£ +.B SO_SNDLOWAT +¤Ï Linux ¤Ç¤ÏÊѹ¹¤Ç¤­¤Ê¤¤ +.RB ( setsockopt (2) +¤Ï +.B ENOPROTOOPT +¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë)¡£ +.B SO_RCVLOWAT +¤Ï Linux 2.4 °Ê¹ß¤Ç¤Î¤ßÊѹ¹²Äǽ¤Ç¤¢¤ë¡£ +¸½¾õ¡¢Linux ¤Ç¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë +.BR select (2) +¤È +.BR poll (2) +¤Ï +.B SO_RCVLOWAT +¤ÎÀßÄê¤ò¹Íθ¤ËÆþ¤ì¤º¤ËÆ°ºî¤·¡¢ +¥Ç¡¼¥¿¤¬1¥Ð¥¤¥ÈÍøÍѲÄǽ¤Ë¤Ê¤Ã¤¿¤À¤±¤Ç¤â¡¢ +¥½¥±¥Ã¥È¤ÏÆɤ߽Ф·²Äǽ¤È¤Î¥Þ¡¼¥¯¤ò¤Ä¤±¤ë¡£ +°ìÊý¡¢¤½¤ì¤Ë³¤±¤Æ¹Ô¤¦¥½¥±¥Ã¥È¤«¤é¤Î read ¤Ï +.B SO_RCVLOWAT +¥Ð¥¤¥È¤Î¥Ç¡¼¥¿¤¬ÍøÍѲÄǽ¤Ë¤Ê¤ë¤Þ¤ÇÄä»ß¤·¤Æ¤·¤Þ¤¦¡£ +.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2 +.\" Tested on kernel 2.6.14 -- mtk, 30 Nov 05 +.TP +.BR SO_RCVTIMEO " ¤È " SO_SNDTIMEO +.\" 2.0 ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.\" getsockopt ¤Ë¤Ä¤¤¤Æ¤Ï 2.1.11 ¤Ç¼ÂÁõ¤µ¤ì¤¿¡£¾ï¤Ë 0 ¤Î¹½Â¤ÂΤòÊÖ¤¹¡£ +.\" setsockopt ¤Ë¤Ä¤¤¤Æ¤Ï 2.3.41 ¤Ç¼ÂÁõ¤µ¤ì¡¢¼ÂºÝ¤Ë»È¤ï¤ì¤Æ¤¤¤ë¡£ +Á÷¿®¡¦¼õ¿®¤Î¥¿¥¤¥à¥¢¥¦¥È¤ò»ØÄꤹ¤ë¡£¤³¤ì¤ò±Û¤¨¤ë¤È¥¨¥é¡¼¤òÊó¹ð¤¹¤ë¡£ +°ú¤­¿ô¤Ï +.I "struct timeval" +¤Ç¤¢¤ë¡£ +Æþ½ÐÎÏ´Ø¿ô¤¬¥¿¥¤¥à¥¢¥¦¥È»þ´Ö¤Î´Ö¥Ö¥í¥Ã¥¯¤µ¤ì¡¢¤«¤Ä¥Ç¡¼¥¿¤ÎÁ÷¿®¤Þ¤¿¤Ï +¼õ¿®¤¬¹Ô¤ï¤ì¤Æ¤¤¤¿¾ì¹ç¤Ï¡¢Å¾Á÷¤µ¤ì¤¿¥Ç¡¼¥¿Î̤¬´Ø¿ô¤ÎÊÖ¤êÃͤȤʤ롣 +²¿¤â¥Ç¡¼¥¿¤¬Å¾Á÷¤µ¤ì¤º¤Ë¥¿¥¤¥à¥¢¥¦¥È¤Ë㤷¤¿¾ì¹ç¤Ï¡¢ +\-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B EAGAIN +¤« +.B EWOULDBLOCK +¤òÀßÄꤵ¤ì¡¢ +.\" ¼ÂºÝ¤Ë¤Ï EAGAIN ¤¬ÀßÄꤵ¤ì¤ë +¤¢¤¿¤«¤â¥½¥±¥Ã¥È¤ËÈó¥Ö¥í¥Ã¥­¥ó¥°¤¬»ØÄꤵ¤ì¤¿¤è¤¦¤Ë¸«¤¨¤ë¡£ +¥¿¥¤¥à¥¢¥¦¥ÈÃÍ¤Ë (¥Ç¥Õ¥©¥ë¥ÈÃͤǤ¢¤ë) 0 ¤ËÀßÄꤹ¤ë¤È¡¢ +Áàºî¤Ï·è¤·¤Æ¥¿¥¤¥à¥¢¥¦¥È¤·¤Ê¤¯¤Ê¤ë¡£ +¥¿¥¤¥à¥¢¥¦¥È¤¬±Æ¶Á¤òµÚ¤Ü¤¹¤Î¤Ï¡¢ +¥½¥±¥Ã¥È I/O ¤ò¼Â¹Ô¤¹¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤À¤± +(Î㤨¤Ð +.BR read (2), +.BR recvmsg (2), +.BR send (2), +.BR sendmsg (2)) +¤Ç¤¢¤ë¡£ +.BR select (2), +.BR poll (2), +.BR epoll_wait (2) +¤Ê¤É¤Ë¤Ï¥¿¥¤¥à¥¢¥¦¥È¤Ï±Æ¶Á¤òµÚ¤Ü¤µ¤Ê¤¤¡£ +.TP +.B SO_REUSEADDR +.BR bind (2) +¥³¡¼¥ë¤ËÍ¿¤¨¤é¤ì¤¿¥¢¥É¥ì¥¹¤¬Àµ¤·¤¤¤«¤òȽÃǤ¹¤ë¥ë¡¼¥ë¤Ç¡¢ +¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤ÎºÆÍøÍѤò²Äǽ¤Ë¤¹¤ë¡£ +¤Ä¤Þ¤ê +.B AF_INET +¥½¥±¥Ã¥È¤Ê¤é¡¢¤½¤Î¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤¿¥¢¥¯¥Æ¥£¥Ö¤Ê listen +¾õÂ֤Υ½¥±¥Ã¥È¤¬Â¸ºß¤·¤Ê¤¤¸Â¤ê¡¢¥Ð¥¤¥ó¥É¤¬¹Ô¤¨¤ë¡£ +listen ¾õÂ֤Υ½¥±¥Ã¥È¤¬¥¢¥É¥ì¥¹ +.B INADDR_ANY +¤ÇÆÃÄê¤Î¥Ý¡¼¥È¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¤³¤Î¥Ý¡¼¥È¤ËÂФ·¤Æ¤Ï¡¢¤É¤ó¤Ê¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤Ç¤â¥Ð¥¤¥ó¥É¤Ç¤­¤Ê¤¤¡£ +°ú¤­¿ô¤Ï¥Ö¡¼¥ëÀ°¿ô¤Î¥Õ¥é¥°¤Ç¤¢¤ë¡£ +.TP +.B SO_SNDBUF +¥½¥±¥Ã¥È¤ÎÁ÷¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇÂ祵¥¤¥º¤òÀßÄꡦ¼èÆÀ¤¹¤ë (¥Ð¥¤¥Èñ°Ì)¡£ +.BR setsockopt (2) +¤ò»È¤Ã¤ÆÃͤ¬ÀßÄꤵ¤ì¤¿¤È¤­¤Ë (´ÉÍý¥ª¡¼¥Ð¥Ø¥Ã¥ÉÍѤÎÎΰè¤ò³ÎÊݤ¹¤ë¤¿¤á¤Ë) +¥«¡¼¥Í¥ë¤Ï¤³¤ÎÃͤò 2Çܤ·¡¢ +.\" ¾¤Î¤Û¤È¤ó¤É¤Î (Á´¤Æ¤Î?) ¼ÂÁõ¤Ç¤Ï¤³¤ó¤Ê¤³¤È¤Ï¹Ô¤Ã¤Æ¤¤¤Ê¤¤ -- MTK, Dec 05 +.BR getsockopt (2) +¤Ï¤³¤Î 2Çܤµ¤ì¤¿ÃͤòÊÖ¤¹¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï +.I /proc/sys/net/core/wmem_default +¥Õ¥¡¥¤¥ë¤ÇÀßÄꤵ¤ì¡¢µöÍƤµ¤ì¤ëºÇÂç¤ÎÃÍ¤Ï +.I /proc/sys/net/core/wmem_max +¥Õ¥¡¥¤¥ë¤ÇÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÎºÇ¾®ÃÍ¤Ï (2Çܤ·¤¿ÃͤÇ) 2048 ¤Ç¤¢¤ë¡£ +.TP +.BR SO_SNDBUFFORCE " (Linux 2.6.14 °Ê¹ß)" +¤³¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¡¢Æø¢¥×¥í¥»¥¹ +.RB ( CAP_NET_ADMIN +¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Ï +.B SO_SNDBUF +¤ÈƱ¤¸¤³¤È¤ò¼Â¹Ô¤Ç¤­¤ë¡£ +¤¿¤À¤·¡¢¾å¸Â +.I wmem_max +¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B SO_TIMESTAMP +.B SO_TIMESTAMP +À©¸æ¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®¤òÍ­¸ú/̵¸ú¤Ë¤¹¤ë¡£ +¥¿¥¤¥à¥¹¥¿¥ó¥×À©¸æ¥á¥Ã¥»¡¼¥¸¤Ï¥ì¥Ù¥ë +.B SOL_SOCKET +¤ÇÁ÷¿®¤µ¤ì¡¢ +.I cmsg_data +¥Õ¥£¡¼¥ë¥É¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¥æ¡¼¥¶¤ËÅϤ·¤¿ +ºÇ¸å¤Î¥Ñ¥±¥Ã¥È¤Î¼õ¿®»þ¹ï¤ò¼¨¤¹ +.I "struct timeval" +¤Ç¤¢¤ë¡£ +À©¸æ¥á¥Ã¥»¡¼¥¸¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï +.BR cmsg (3) +¤ò»²¾È¡£ +.TP +.B SO_TYPE +¥½¥±¥Ã¥È¤Î¥¿¥¤¥×¤òÀ°¿ô¤Ç¼èÆÀ¤¹¤ë (Îã: +.BR SOCK_STREAM )¡£ +.BR getsockopt (2) +¤«¤é¤Î¤ßÆɤ߽Ф·²Äǽ¤Ç¤¢¤ë¡£ +.SS ¥·¥°¥Ê¥ë +(¥í¡¼¥«¥ë¤â¤·¤¯¤Ï¥ê¥â¡¼¥È¦¤Ç) ÀÚÃǤµ¤ì¤¿ +Àܳ»Ø¸þ (connection-oriented) ¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ +½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤È¡¢¤½¤Î½ñ¤­¹þ¤ß¤ò¹Ô¤Ã¤¿¥×¥í¥»¥¹¤Ë +.B SIGPIPE +¤¬Á÷¤é¤ì¡¢ +.B EPIPE +¤¬ÊÖ¤µ¤ì¤ë¡£ write ¸Æ¤Ó½Ð¤·¤Ë +.B MSG_NOSIGNAL +¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¤¤¤¿¾ì¹ç¤Ï¥·¥°¥Ê¥ë¤ÏÁ÷¤é¤ì¤Ê¤¤¡£ +.PP +.B FIOSETOWN +.BR fcntl (2) +¤ä +.B SIOCSPGRP +.BR ioctl (2) +¤ò¥×¥í¥»¥¹¤Þ¤¿¤Ï¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë»ØÄꤷ¤Æ¤ª¤¯¤È¡¢ +I/O ¥¤¥Ù¥ó¥È¤¬µ¯¤­¤¿¤È¤­¤Ë +.B SIGIO +¤¬Á÷¤é¤ì¤ë¡£ +.BR poll (2) +¤ä +.BR select (2) +¤ò¥·¥°¥Ê¥ë¥Ï¥ó¥É¥éÆâ¤ÇÍѤ¤¤ì¤Ð¡¢¤É¤Î¥½¥±¥Ã¥È¤Ç¥¤¥Ù¥ó¥È¤¬µ¯¤³¤Ã¤¿¤«¤ò +ÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +(Linux 2.2 ¤Ë¤ª¤±¤ë) Ê̤ÎÊýË¡¤È¤·¤Æ¤Ï¡¢ +.B F_SETSIG +.BR fcntl (2) +¤òÍѤ¤¤Æ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤òÀßÄꤹ¤ë¤ä¤êÊý¤â¤¢¤ë¡£ +¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î¥Ï¥ó¥É¥é¤Ï¡¢ +.I siginfo_t +¤Î +.I si_fd +¥Õ¥£¡¼¥ë¥É¤Ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Æþ¤Ã¤¿¾õÂ֤ǸƤӽФµ¤ì¤ë¡£ +¾ÜºÙ¤Ï +.BR fcntl (2) +¤ò»²¾È¤Î¤³¤È¡£ +.PP +¾õ¶·¤Ë¤è¤Ã¤Æ¤Ï (Î㤨¤ÐÊ£¿ô¤Î¥×¥í¥»¥¹¤¬°ì¤Ä¤Î¥½¥±¥Ã¥È¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¤¤ë¤Ê¤É)¡¢ +.B SIGIO +¤Î¸¶°ø¤È¤Ê¤Ã¤¿¾õÂ֤ϡ¢¥×¥í¥»¥¹¤¬¤½¤Î¥·¥°¥Ê¥ë¤Ø¤ÎÂбþ¤ò¹Ô¤Ã¤¿¤È¤­¤Ë¤Ï +¾Ã¤¨¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î¾ì¹ç¤Ï¡¢¥×¥í¥»¥¹¤ÏºÆ¤ÓÂԤĤ褦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Linux ¤ÏƱ¤¸¥·¥°¥Ê¥ë¤ò¸å¤ÇºÆÁ÷¤¹¤ë¤«¤é¤Ç¤¢¤ë¡£ +.\" .SS Ancillary Messages +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +core ¤Î¥½¥±¥Ã¥È¤Î¥Í¥Ã¥È¥ï¡¼¥­¥ó¥°¥Ñ¥é¥á¡¼¥¿¤Ë¤Ï¡¢ +.I /proc/sys/net/core/ +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤òÄ̤·¤Æ¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.TP +.I rmem_default +¥½¥±¥Ã¥È¤Î¼õ¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ (¥Ð¥¤¥Èñ°Ì)¡£ +.TP +.I rmem_max +.B SO_RCVBUF +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤Æ¥æ¡¼¥¶¤¬ÀßÄê¤Ç¤­¤ë +¥½¥±¥Ã¥È¤Î¼õ¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ÎºÇÂçÃÍ (¥Ð¥¤¥Èñ°Ì)¡£ +.TP +.I wmem_default +¥½¥±¥Ã¥È¤ÎÁ÷¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ (¥Ð¥¤¥Èñ°Ì)¡£ +.TP +.I wmem_max +.B SO_SNDBUF +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤Æ¥æ¡¼¥¶¤¬ÀßÄê¤Ç¤­¤ë +¥½¥±¥Ã¥È¤ÎÁ÷¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ÎºÇÂçÃÍ (¥Ð¥¤¥Èñ°Ì)¡£ +.TP +.IR message_cost " ¤È " message_burst +¥È¡¼¥¯¥ó¡¦¥Ð¥±¥Ã¥È¡¦¥Õ¥£¥ë¥¿¡¼¤òÀßÄꤹ¤ë¡£ +¤³¤ì¤Ï³°Éô¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥Ù¥ó¥È¤Ë¤è¤Ã¤Æ°ú¤­µ¯¤³¤µ¤ì¤¿ +Éé²Ù¸Â³¦¤Î·Ù¹ð¥á¥Ã¥»¡¼¥¸¤ËÍѤ¤¤é¤ì¤ë¡£ +.\"NAKANO "load limit" ¤À¤È»×¤¦¤ó¤À¤±¤É... +.TP +.I netdev_max_backlog +¥°¥í¡¼¥Ð¥ë¤ÊÆþÎÏ¥­¥å¡¼¤Ë¤ª¤±¤ëºÇÂç¤Î¥Ñ¥±¥Ã¥È¿ô¡£ +.TP +.I optmem_max +¥½¥±¥Ã¥È¤¢¤¿¤ê¤Î¡¢Êä½õ¥Ç¡¼¥¿ (ancillary data) ¤È¥æ¡¼¥¶À©¸æ¥Ç¡¼¥¿ +(iovecs ¤Î¤è¤¦¤Ê¤â¤Î) ¤È¤ÎϤκÇÂçĹ¡£ +.\" netdev_fastroute is not documented because it is experimental +.SS ioctl +°Ê²¼¤Ë¼¨¤¹Áàºî¤Ë¤Ï +.BR ioctl (2) +¤òÍѤ¤¤Æ¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ + +.in +4n +.nf +.IB error " = ioctl(" ip_socket ", " ioctl_type ", " &value_result ");" +.fi +.in +.TP +.B SIOCGSTAMP +ºÇ¸å¤Ë¥æ¡¼¥¶¤ËÅϤµ¤ì¤¿¥Ñ¥±¥Ã¥È¤Î¼õ¿®¥¿¥¤¥à¥¹¥¿¥ó¥×¤ò +.I struct timeval +¤ËÆþ¤ì¤ÆÊÖ¤¹¡£ +¤³¤ì¤Ï round trip »þ´Ö¤òÀµ³Î¤Ë¬¤ê¤¿¤¤¤È¤­¤ËÊØÍø¤Ç¤¢¤ë¡£ +.I struct timeval +¤ÎÀâÌÀ¤Ï +.BR setitimer (2) +¤ò¸«¤Æ¤Û¤·¤¤¡£ +.\" +¤³¤Î ioctl ¤Ï¡¢¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.B SO_TIMESTAMP +¤¬¥½¥±¥Ã¥È¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Î¤ß»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£ +¤µ¤â¤Ê¤±¤ì¤Ð¡¢¤³¤Î ioctl ¤Ï +.B SO_TIMESTAMP +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿´Ö¤Ë¼õ¿®¤·¤¿ºÇ¸å¤Î¥Ñ¥±¥Ã¥È¤Î»þ¹ï¤òÊÖ¤¹¤«¡¢ +¤½¤Î¤è¤¦¤Ê¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¼ºÇÔ¤¹¤ë +(¤Ä¤Þ¤ê¡¢ +.BR ioctl (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤Ë +.B ENOENT +¤ò¥»¥Ã¥È¤¹¤ë)¡£ +.TP +.B SIOCSPGRP +ÈóƱ´ü I/O Áàºî¤Î½ªÎ»»þ¤ä¶ÛµÞ¥Ç¡¼¥¿¤Î¼õ¿®»þ¤Ë +.B SIGIO +¤ä +.B SIGURG +¥·¥°¥Ê¥ë·²¤òÁ÷¤ë¥×¥í¥»¥¹¤ä¥×¥í¥»¥¹¥°¥ë¡¼¥×¤òÀßÄꤹ¤ë¡£ +°ú¤­¿ô¤Ï +.I pid_t +¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ +°ú¤­¿ô¤¬Àµ¤À¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£Éé¤À¤È¡¢ +°ú¤­¿ô¤ÎÀäÂÐÃͤò ID ¤Ë»ý¤Ä¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£ +¥·¥°¥Ê¥ë¼õ¿®Àè¤Ë¤Ï¡¢¼«Ê¬¼«¿È¤Î¥×¥í¥»¥¹ / ¼«Ê¬¤Î½ê°¤¹¤ë¥×¥í¥»¥¹¥°¥ë¡¼¥× +¤·¤«»ØÄê¤Ç¤­¤Ê¤¤¡£Ã¢¤·¡¢ +.B CAP_KILL +¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢µÚ¤Ó¼Â¸ú¥æ¡¼¥¶ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤Î¾ì¹ç¤Ï +¤³¤Î¸Â¤ê¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B FIOASYNC +.B O_ASYNC +¥Õ¥é¥°¤òÊѹ¹¤·¡¢¥½¥±¥Ã¥È¤ÎÈóƱ´ü (asynchronous) I/O ¥â¡¼¥É¤ò +Í­¸ú/̵¸ú¤Ë¤¹¤ë¡£ÈóƱ´ü I/O ¥â¡¼¥É¤Ç¤Ï¡¢ +¿·¤·¤¤ I/O ¥¤¥Ù¥ó¥È¤¬µ¯¤­¤¿¤È¤­¤Ë¡¢ +.B SIGIO +¥·¥°¥Ê¥ë¤ä +.B F_SETSIG +¤ÇÀßÄꤵ¤ì¤¿¥·¥°¥Ê¥ë¡¦¥»¥Ã¥È¤¬È¯¹Ô¤µ¤ì¤ë¡£ +.IP +°ú¤­¿ô¤Ï¥Ö¡¼¥ëÀ°¿ô¤Î¥Õ¥é¥°¤Ç¤¢¤ë¡£ +(¤³¤ÎÁàºî¤Ï +.BR fcntl (2) +¤ò»È¤Ã¤Æ +.B O_ASYNC +¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¤Î¤ÈƱ¤¸°ÕÌ£¤Ç¤¢¤ë¡£) +.\" +.TP +.B SIOCGPGRP +.B SIGIO +¤ä +.B SIGURG +¤ò¼õ¿®¤·¤¿¥«¥ì¥ó¥È¥×¥í¥»¥¹¡¦¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ò¼èÆÀ¤¹¤ë¡£ +¤Ê¤¤¾ì¹ç¤Ï 0 ¤¬Ê֤롣 +.PP +Í­¸ú¤Ê +.BR fcntl (2) +Áàºî: +.TP +.B FIOGETOWN +.B SIOCGPGRP +.BR ioctl (2) +¤ÈƱ¤¸¡£ +.TP +.B FIOSETOWN +.B SIOCSPGRP +.BR ioctl (2) +¤ÈƱ¤¸¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.B SO_BINDTODEVICE +¤Ï Linux 2.0.30 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.B SO_PASSCRED +¤Ï Linux 2.2 ¤ÇÅо줷¤¿¡£ +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï Linux 2.2 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.B SO_RCVTIMEO +¤È +.B SO_SNDTIMEO +¤Ï Linux 2.3.41 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤½¤ì°ÊÁ°¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥È¤Ï¥×¥í¥È¥³¥ë¸ÇÍ­¤Î¸ÇÄê¤ÎÀßÄêÃͤǡ¢ +Æɤ߽ñ¤­¤ò¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤«¤Ã¤¿¡£ +.SH Ãí°Õ +Linux ¤Ï¡¢Á÷¼õ¿®¥Ð¥Ã¥Õ¥¡¤ÎȾʬ¤òÆâÉô¤Î¥«¡¼¥Í¥ë¹½Â¤ÂΤÇÍѤ¤¤ë¤È²¾Äꤷ¤Æ¤¤¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ¡¢Âбþ¤¹¤ë +.I /proc +¥Õ¥¡¥¤¥ë¤Ï¥Í¥Ã¥È¥ï¡¼¥¯²óÀþ¾å¤Ç¤ÎÂ礭¤µ¤Î 2 Çܤˤʤ롣 + +Linux ¤Ç¤Ï¡¢ +.B SO_REUSEADDR +¥ª¥×¥·¥ç¥ó¤Ç¥Ý¡¼¥È¤ÎºÆÍøÍѤ¬µö²Ä¤µ¤ì¤ë¤Î¤Ï¡¢ +¤½¤Î¥Ý¡¼¥È¤ËÂФ·¤Æ +.BR bind (2) +¤òÁ°¤Ë¼Â¹Ô¤·¤¿¥×¥í¥°¥é¥à¤È¤½¤Î¥Ý¡¼¥È¤òºÆÍøÍÑ +¤·¤è¤¦¤È¤¹¤ë¥×¥í¥°¥é¥à¤ÎξÊý¤Ç +.B SO_REUSEADDR +¤¬¥»¥Ã¥È¤µ¤ì¤¿¾ì¹ç¤Î¤ß¤Ç¤¢¤ë¡£ +¤³¤ÎÆ°ºî¤Ï (FreeBSD ¤Ê¤É¤Î) ¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤È¤Ï°Û¤Ê¤ë¡£¤³¤ì¤é¤Ç¤Ï¡¢ +¸å¤Ç¥Ý¡¼¥È¤òºÆÍøÍѤ·¤è¤¦¤È¤¹¤ë¥×¥í¥°¥é¥à¤Ç +.B SO_REUSEADDR +¥ª¥×¥·¥ç¥ó¤ò¥»¥Ã¥È¤¹¤ë¤À¤±¤Ç¤è¤¤¡£ +¤¿¤¤¤Æ¤¤¤Ï¤³¤Î°ã¤¤¤Ï¸«¤¨¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢Î㤨¤Ð¥µ¡¼¥Ð¥×¥í¥°¥é¥à¤Ï +¾ï¤Ë¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¥»¥Ã¥È¤¹¤ë¤è¤¦¤ËÀ߷פµ¤ì¤ë¤«¤é¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +.\" FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER +.B CONFIG_FILTER +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë +.B SO_ATTACH_FILTER +¤È +.B SO_DETACH_FILTER +¤Ë¤Ä¤¤¤Æµ­ºÜ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£¤³¤ì¤é¤Ï libpcap ¥é¥¤¥Ö¥é¥ê¤òÄ̤·¤Æ +ÍѤ¤¤ëÊý¤¬Îɤ¤¡£ +.\" .SH Ãø¼Ô +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï Andi Kleen ¤¬½ñ¤¤¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR getsockopt (2), +.BR setsockopt (2), +.BR socket (2), +.BR capabilities (7), +.BR ddp (7), +.BR ip (7), +.BR packet (7), +.BR tcp (7), +.BR udp (7), +.BR unix (7) diff --git a/release/man7/spufs.7 b/release/man7/spufs.7 new file mode 100644 index 00000000..8882be00 --- /dev/null +++ b/release/man7/spufs.7 @@ -0,0 +1,475 @@ +.\" This is _*_ nroff _*_ source. Emacs, gimme all those colors :) +.\" +.\" Copyright (c) International Business Machines Corp., 2006 +.\" +.\" 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 +.\" +.\" HISTORY: +.\" 2005-09-28, created by Arnd Bergmann , +.\" Mark Nutter and +.\" Ulrich Weigand +.\" 2006-06-16, revised by Eduardo M. Fleury +.\" 2007-07-10, quite a lot of polishing by mtk +.\" +.TH SPUFS 7 2007-07-10 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +spufs \- SPU ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à +.SH ÀâÌÀ +SPU ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¢Cell Broadband Engine ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò¼ÂÁõ¤·¤¿ +PowerPC ¥Þ¥·¥ó¤Ë¤ª¤¤¤Æ¡¢Synergistic Processor Unit (SPU) ¤Ë¥¢¥¯¥»¥¹¤¹¤ë +¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢POSIX ¶¦Í­¥á¥â¥ê¤ä¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Ë +»÷¤¿Ì¾Á°¶õ´Ö¤¬Ä󶡤µ¤ì¤ë¡£ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤Ä¥æ¡¼¥¶¤Ï +.BR spu_create (2) +¤ò»È¤Ã¤Æ spufs ¤Î¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë SPU ¥³¥ó¥Æ¥­¥¹¥È¤òºîÀ®¤Ç¤­¤ë¡£ + +³Æ SPU ¥³¥ó¥Æ¥­¥¹¥È¤Ï¡¢¤¢¤é¤«¤¸¤áÄêµÁ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë·²¤ò´Þ¤à +¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤Æɽ¸½¤µ¤ì¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ¡¢ÏÀÍý SPU ¤Î¾õÂÖ¤òÁàºî¤Ç¤­¤ë¡£ +¥æ¡¼¥¶¤Ï¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹µö²Ä¤òÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤ë¤¬¡¢ +¥Õ¥¡¥¤¥ë¤ÎÄɲᦺï½ü¤ò¹Ô¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +.SS ¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó +.TP +.B uid= +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò½êÍ­¤¹¤ë¥æ¡¼¥¶¤òÀßÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 0 (root) ¤Ç¤¢¤ë¡£ +.TP +.B gid= +¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò½êÍ­¤¹¤ë¥°¥ë¡¼¥×¤òÀßÄꤹ¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï 0 (root) ¤Ç¤¢¤ë¡£ +.SS ¥Õ¥¡¥¤¥ë +.I spufs +¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç +.BR read (2) +¤ä +.BR write (2) +¤È¤¤¤Ã¤¿Ä̾ï¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ëɸ½àŪ¤Ê¿¶¤ëÉñ¤¤¤ò¼¨¤¹¤¬¡¢ +¿¤¯¤Î¾ì¹çÄ̾ï¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÁàºî¤Î°ìÉôʬ¤À¤±¤¬ +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£°Ê²¼¤Î¥ê¥¹¥È¤Ç¤Ï¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÁàºî¤È +¤½¤ì¤¾¤ì¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë½ñ¤«¤ì¤Æ¤¤¤ëɸ½àŪ¤Ê¿¶¤ëÉñ¤¤¤È¤Î°ã¤¤¤Ë +¤Ä¤¤¤ÆÀâÌÀ¤¹¤ë¡£ + +.BR read (2) +Áàºî¤ËÂбþ¤·¤Æ¤¤¤ëÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¤Ï +.BR readv (2) +¤Ë¤âÂбþ¤·¤Æ¤¤¤ë¡£¤Þ¤¿¡¢ +.BR write (2) +Áàºî¤ËÂбþ¤·¤Æ¤¤¤ëÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¤Ï +.BR writev (2) +¤Ë¤âÂбþ¤·¤Æ¤¤¤ë¡£ + +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢ +.BR access (2) +¤È +.BR stat (2) +·Ï¤ÎÁàºî¤ËÂбþ¤·¤Æ¤¤¤ë¤¬¡¢ +.BR stat (2) +¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿ºÝ¤ËÊÖ¤µ¤ì¤ë +.I stat +¹½Â¤ÂΤΥե£¡¼¥ë¥É¤Î¤¦¤Á¿®Íê¤Ç¤­¤ë¾ðÊó¤¬Æþ¤Ã¤Æ¤¤¤ë¤Î¤Ï +.IR st_mode , +.IR st_nlink , +.IR st_uid , +.I st_gid +¤À¤±¤Ç¤¢¤ë¡£ + +Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¤Ï +.BR chmod (2)/ fchmod (2) +¤È +.BR chown (2)/ fchown (2) +¤ÎÁàºî¤ËÂбþ¤·¤Æ¤¤¤ë¤¬¡¢ +¤½¤Î¥Õ¥¡¥¤¥ë¤¬Âбþ¤·¤Æ¤¤¤ëÁàºî¤ÈÌ·½â¤¹¤ë¥¢¥¯¥»¥¹µö²Ä¤ò +ÉÕÍ¿¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤ (Î㤨¤Ð¡¢ +.I wbox +¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëÆɤ߽Ф·¥¢¥¯¥»¥¹¤Ê¤É)¡£ + +¸½»þÅÀ¤Ç¤Î¥Õ¥¡¥¤¥ë¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£ +.TP +.B /mem +SPU ¤Î¥í¡¼¥«¥ë¥¹¥È¥ì¡¼¥¸¤ÎÆâÍÆ¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÄ̾ï¤Î¶¦Í­¥á¥â¥ê¥Õ¥¡¥¤¥ë¤ÈƱÍͤ˥¢¥¯¥»¥¹¤Ç¤­¡¢ +SPU ¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤Ï¥³¡¼¥É¤È¥Ç¡¼¥¿¤ÎξÊý¤ò³ÊǼ¤Ç¤­¤ë¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I mem +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read "(2), " pread "(2), " write "(2), " pwrite "(2), " lseek (2) +¤³¤ì¤é¤ÏÄ̾ïÄ̤êÆ°ºî¤¹¤ë¤¬¡¢ +¥Õ¥¡¥¤¥ëËöÈø¤ò±Û¤¨¤Æ¤Î +.BR lseek (2), +.BR write (2), +.BR pwrite (2) +¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤ÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£ +¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ï SPU ¤Î¥í¡¼¥«¥ë¥¹¥È¥ì¡¼¥¸¤Î¥µ¥¤¥º¤Ç¤¢¤ê¡¢ +Ä̾ï¤Ï 256 ¥­¥í¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +.TP +.BR mmap (2) +.I mem +¤ò¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¤È¡¢ +¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î°ìÉô¤È¤·¤Æ +SPU ¤Î¥í¡¼¥«¥ë¡¦¥¹¥È¥ì¡¼¥¸¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +.RE +.TP +.B /mbox +SPU ¤«¤é CPU ¤Ø¤ÎÄÌ¿®ÍѤΰì¤ÄÌܤΥ᡼¥ë¥Ü¥Ã¥¯¥¹¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÆɤ߽Ф·ÀìÍѤǡ¢Æɤ߽Ф·¤Ï 32¥Ó¥Ã¥Èñ°Ì¤Ç¹Ô¤¦¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÈóÄä»ß (non-blocking) ¥â¡¼¥É¤Ç¤Î¤ß»ÈÍѤǤ­¡¢ +.BR poll (2) +¤Ç¤¢¤Ã¤Æ¤â¤³¤Î¥Õ¥¡¥¤¥ë¤ÇÄä»ß (block) ¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I mbox +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR read (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ë¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç¡¢\-1 ¤¬Ê֤ꡢ +.I errno +¤¬ +.B EAGAIN +¤ËÀßÄꤵ¤ì¤ë¡£¥Ç¡¼¥¿¤ÎÆɤ߽Ф·¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ +4 ¥Ð¥¤¥È¤¬¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¡¢ÊÖ¤êÃͤȤ·¤Æ 4 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.RE +.TP +.B /ibox +SPU ¤«¤é CPU ¤Ø¤ÎÄÌ¿®ÍѤÎÆó¤ÄÌܤΥ᡼¥ë¥Ü¥Ã¥¯¥¹¤Ç¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï°ì¤ÄÌܤΥ᡼¥ë¥Ü¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤È»÷¤Æ¤¤¤ë¤¬¡¢ +Ää»ß (blocking) I/O ¥â¡¼¥É¤Ç¤ÎÆɤ߽Ф·¤¬²Äǽ¤Ç¤¢¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢ +.BR poll (2) +¤äƱÍͤΥ·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ò´Æ»ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I ibox +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR read (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ë¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.B O_NONBLOCK +¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢ÊÖ¤êÃÍ¤Ï \-1 ¤È¤Ê¤ê¡¢ +.I errno +¤Ï +.B EAGAIN +¤ËÀßÄꤵ¤ì¤ë¡£ + +¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ë¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç¤Ç¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.B O_NONBLOCK +¤Ê¤·¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢ +SPU ¤¬¼«Ê¬¤Î³ä¤ê¹þ¤ß¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¥Á¥ã¥Í¥ë (interrupt mailbox channel) +¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤Þ¤Ç +.BR read (2) +¤ÏÄä»ß (block) ¤¹¤ë¡£ +¥Ç¡¼¥¿¤ÎÆɤ߽Ф·¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ +4 ¥Ð¥¤¥È¤¬¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¡¢ÊÖ¤êÃͤȤ·¤Æ 4 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.BR poll (2) +.I ibox +¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë +.BR poll (2) +¤Ï¡¢Æɤ߽Ф·¥Ç¡¼¥¿¤¬ÍøÍѲÄǽ¤Ë¤Ê¤ëÅÙ¤Ë +.I "(POLLIN | POLLRDNORM)" +¤òÊÖ¤¹¡£ +.RE +.TP +.B /wbox +CPU ¤«¤é SPU ¤Ø¤ÎÄÌ¿®ÍѤΥ᡼¥ë¥Ü¥Ã¥¯¥¹¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï½ñ¤­¹þ¤ßÀìÍѤǡ¢½ñ¤­¹þ¤ß¤Ï 32¥Ó¥Ã¥Èñ°Ì¤Ç¹Ô¤¦¡£ +¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤¬°ìÇդξì¹ç¡¢ +.BR write (2) +¤ÏÄä»ß (block) ¤·¡¢ +.BR poll (2) +¤ò»È¤Ã¤Æ¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤ËºÆÅÙ¶õ¤­¤¬¤Ç¤­¤ë¤Þ¤ÇÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I wbox +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR write (2) +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR write (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ë¶õ¤­Îΰ褬¤Ê¤¤¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.B O_NONBLOCK +¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢ÊÖ¤êÃÍ¤Ï \-1 ¤È¤Ê¤ê¡¢ +.I errno +¤Ï +.B EAGAIN +¤ËÀßÄꤵ¤ì¤ë¡£ + +¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ë¶õ¤­Îΰ褬¤Ê¤¤¾ì¹ç¤Ç¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ +.B O_NONBLOCK +¤Ê¤·¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢ +SPU ¤¬¼«Ê¬¤Î PPE ¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¥Á¥ã¥Í¥ë¤«¤éÆɤ߽Ф·¤ò¹Ô¤¦¤Þ¤Ç +.BR write (2) +¤ÏÄä»ß (block) ¤¹¤ë¡£ +¥Ç¡¼¥¿¤Î½ñ¤­¹þ¤ß¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ÊÖ¤êÃͤȤ·¤Æ 4 ¤¬ÊÖ¤µ¤ì¤ë¡£ +.TP +.BR poll (2) +.I wbox +¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë +.BR poll (2) +¤Ï¡¢½ñ¤­¹þ¤ßÍѤζõ´Ö¤¬ÍøÍѲÄǽ¤Ë¤Ê¤ëÅÙ¤Ë +.I "(POLLOUT | POLLWRNORM)" +¤òÊÖ¤¹¡£ +.RE +.TP +.BR /mbox_stat ", " /ibox_stat ", " /wbox_stat +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤ÏÆɤ߽Ф·ÀìÍѤǡ¢ +³Æ¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Î¸½ºß¤Î¥­¥å¡¼Ä¹¤òÊÝ»ý¤¹¤ë¡£ +¶ñÂÎŪ¤Ë¤Ï¡¢Ää»ß (blocking) ¤»¤º¤Ë¡¢ +.IR mbox " ¤ä " ibox +¤«¤é²¿¥ï¡¼¥É¤òÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¡¢ +.I wbox +¤Ë²¿¥ï¡¼¥É¤ò½ñ¤­¹þ¤à¤³¤È¤¬¤Ç¤­¤ë¤«¡¢¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï 4 ¥Ð¥¤¥Èñ°Ì¤Ç¤Î¤ßÆɤ߽Ф·¤¬²Äǽ¤Ç¡¢ +¥Ó¥Ã¥°¡¦¥¨¥ó¥Ç¥£¥¢¥ó¤ÎÀ°¿ôÃͤòÊÖ¤¹¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I *box_stat +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR read (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤Ë 4 ¥Ð¥¤¥È¤ÎÃͤ¬½ñ¤­¹þ¤Þ¤ì¤ë¡£ +¤³¤ÎÃͤϡ¢³Æ¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ë¤ª¤¤¤ÆÄä»ß¤»¤º¤Ë¡¢¤Þ¤¿¤Ï +.B EAGAIN +¥¨¥é¡¼¤Ê¤·¤Ç¡¢Æɤ߽Ф·²Äǽ¤Ê¥¨¥ì¥á¥ó¥È¿ô +.RI ( mbox_stat +¤ä +.I ibox_stat +¤Î¾ì¹ç)¡¢½ñ¤­¹þ¤ß²Äǽ¤Ê¥¨¥ì¥á¥ó¥È¿ô +.RI ( wbox_stat +¤Î¾ì¹ç) ¤Ç¤¢¤ë¡£ +.RE +.TP +.BR /npc ", " /decr ", " /decr_status ", " /spu_tag_mask ", " \ +/event_mask ", " /srr0 +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï SPU ¤ÎÆâÉô¥ì¥¸¥¹¥¿¤ò¸ø³«¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +Ãͤϡ¢³Æ¥ì¥¸¥¹¥¿¤Î¿ôÃͤò´Þ¤à¥¢¥¹¥­¡¼Ê¸»úÎó¤Çɽ¸½¤µ¤ì¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï¥Ç¥Ð¥Ã¥°ÍѤȤ·¤ÆÆɤ߽Ф·/½ñ¤­¹þ¤ß¤Îξ¥â¡¼¥É¤ÇÍøÍѤǤ­¤ë¤¬¡¢ +¥×¥í¥°¥é¥à¤ÎÄ̾ï¤ÎÁàºî¤Ï¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ë°Í¸¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¤Ê¤¼¤Ê¤é¡¢¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î¤¦¤Á +.I npc +°Ê³°¤Ø¤Î¥¢¥¯¥»¥¹¤Ç¤Ï SPU ¥³¥ó¥Æ¥­¥¹¥È¤ÎÊݸ¤¬É¬¿Ü¤Ç¤¢¤ê¡¢ +SPU ¥³¥ó¥Æ¥­¥¹¥È¤ÎÊݸ¤ÏÈó¾ï¤Ë¸úΨ¤¬°­¤¤¤«¤é¤Ç¤¢¤ë¡£ +.IP +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍƤϰʲ¼¤ÎÄ̤ꡣ +.RS +.TP 16 +.I npc +¼¡¤Î¥×¥í¥°¥é¥à¥«¥¦¥ó¥¿ +.TP +.I decr +SPU Decrementer +.TP +.I decr_status +Decrementer ¤Î¾õÂÖ +.TP +.I spu_tag_mask +SPU ¤Î DMA ÍѤΠMFA ¥¿¥°¥Þ¥¹¥¯ +.TP +.I event_mask +SPU ¤Î³ä¤ê¹þ¤ß¤Î¥¤¥Ù¥ó¥È¥Þ¥¹¥¯ +.TP +.I srr0 +³ä¤ê¹þ¤ß¥ê¥¿¡¼¥ó¥¢¥É¥ì¥¹¥ì¥¸¥¹¥¿ +.RE +.IP +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.BR read (2) +¤ËÅϤµ¤ì¤¿ +.I count +¤¬¥ì¥¸¥¹¥¿ÃͤȲþ¹Ô (newline) ʸ»ú 1 ¸Ä¤ò³ÊǼ¤¹¤ë¤Î¤ËɬÍפÊŤµ¤è¤êû¤¤¾ì¹ç¡¢ +Ʊ¤¸¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò³¤±¤Æ read ¤¹¤ë¤³¤È¤Ç¡¢Ê¸»úÎóÁ´ÂΤòÆɤ߽Ф¹¤³¤È +¤¬¤Ç¤­¤ë¡£¤³¤ÎºÝ¡¢¼Â¹ÔÃæ¤Î SPU ¥¿¥¹¥¯¤Ë¤è¤ê¥ì¥¸¥¹¥¿ÃͤÎÊѹ¹¤Î±Æ¶Á¤Ï¼õ¤±¤Ê¤¤¡£ +ʸ»úÎóÁ´ÂΤ¬Æɤ߽Фµ¤ì¤ë¤È¡¢¤½¤ì°Ê¹ß¤Î read Áàºî¤Ç¤Ï 0 ¥Ð¥¤¥È¤¬ÊÖ¤µ¤ì¡¢ +¿·¤·¤¤ÃͤòÆɤ߽Ф¹¤Ë¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥ª¡¼¥×¥ó¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.TP +.BR write (2) +¤³¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î +.BR write (2) +Áàºî¤Ï¥ì¥¸¥¹¥¿Ãͤòʸ»úÎó¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +ʸ»úÎó¤Î²ò¼á¤ÏÀèƬ¤«¤é³«»Ï¤µ¤ì¡¢¿ô»ú°Ê³°¤Îʸ»ú¤¬½é¤á¤ÆÅо줹¤ë¤«¡¢ +¥Ð¥Ã¥Õ¥¡¤ÎËöÈø¤Ë㤹¤ë¤Þ¤Ç¹Ô¤ï¤ì¤ë¡£ +Ʊ¤¸¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ø³¤±¤Æ write ¤ò¹Ô¤¦¤È¡¢ +¸å¤Î write ¤Ë¤è¤êÁ°¤ÎÀßÄ꤬¾å½ñ¤­¤µ¤ì¤ë¡£ +.RE +.TP +.B /fpcr +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤è¤ê Floating Point Status and Control Register ¤Ë +¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÂ礭¤µ 4 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +.I fpcr +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR read (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤Ë 4 ¥Ð¥¤¥È¤ÎÃͤ¬½ñ¤­¹þ¤Þ¤ì¤ë¡£ +½ñ¤­¹þ¤Þ¤ì¤ëÃÍ¤Ï +.I fpcr +¥ì¥¸¥¹¥¿¤Î¸½ºß¤ÎÃͤǤ¢¤ë¡£ +.TP +.BR write (2) +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR write (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ 4 ¥Ð¥¤¥È¤ÎÃͤ¬¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤«¤é¥³¥Ô¡¼¤µ¤ì¡¢ +.I fpcr +¥ì¥¸¥¹¥¿¤ÎÃͤ¬¹¹¿·¤µ¤ì¤ë¡£ +.RE +.TP +.BR /signal1 ", " /signal2 +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ë¤è¤ê +SPU ¤ÎÆó¤Ä¤Î¥·¥°¥Ê¥ëÄÌÃÎ¥Á¥ã¥Í¥ë (signal notification channel) ¤Ë +¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Ï 32 ¥Ó¥Ã¥Èñ°Ì¤ÎÆɤ߽ñ¤­¤¬¤Ç¤­¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î°ì¤Ä¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦¤È¡¢¤½¤Î SPU ¤Î³ä¤ê¹þ¤ß¤¬ +ȯÀ¸¤¹¤ë¥È¥ê¥¬¡¼¤È¤Ê¤ë¡£ +¥·¥°¥Ê¥ë¥Õ¥¡¥¤¥ë¤Ø½ñ¤­¹þ¤Þ¤ì¤¿Ãͤϡ¢¥Á¥ã¥Í¥ë·Ðͳ¤Ç SPU ¤ÇÆɤ߽Ф·¤¿¤ê¡¢ +¤³¤Î¥Õ¥¡¥¤¥ë·Ðͳ¤Ç¥Û¥¹¥È¤Î¥æ¡¼¥¶¶õ´Ö¤ÇÆɤ߽Ф·¤¿¤ê¤Ç¤­¤ë¡£ +SPU ¤¬ÃͤòÆɤ߽Ф·¤¿¸å¤Ç¤Ï¡¢ÃÍ¤Ï 0 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I signal1 +¤ä +.I signal2 +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR read (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤Ë 4 ¥Ð¥¤¥È¤ÎÃͤ¬½ñ¤­¹þ¤Þ¤ì¤ë¡£ +½ñ¤­¹þ¤Þ¤ì¤ëÃͤϡ¢»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ëÄÌÃΥ쥸¥¹¥¿¤Î¸½ºß¤ÎÃͤǤ¢¤ë¡£ +.TP +.BR write (2) +.I count +¤¬ 4 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢ +.BR write (2) +¤Ï \-1 ¤òÊÖ¤·¡¢ +.I errno +¤ò +.B EINVAL +¤ËÀßÄꤹ¤ë¡£ +¤½¤ì°Ê³°¤Î¾ì¹ç¡¢ 4 ¥Ð¥¤¥È¤ÎÃͤ¬¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤«¤é¥³¥Ô¡¼¤µ¤ì¡¢ +»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ëÄÌÃΥ쥸¥¹¥¿¤ÎÃͤ¬¹¹¿·¤µ¤ì¤ë¡£ +¥·¥°¥Ê¥ëÄÌÃΥ쥸¥¹¥¿¤Î¹¹¿·¤Ë¤Ï¡¢¥ì¥¸¥¹¥¿ÃͤòÆþÎϥǡ¼¥¿¤ÇÃÖ¤­´¹¤¨¤ë¥â¡¼¥É¤È +°ÊÁ°¤ÎÃͤÈÆþÎϥǡ¼¥¿¤Î¥Ó¥Ã¥Èñ°Ì¤Î OR ¤ò¤È¤Ã¤¿Ãͤ˹¹¿·¤¹¤ë¥â¡¼¥É¤¬¤¢¤ë¡£ +¤É¤Á¤é¤Î¥â¡¼¥É¤Ë¤Ê¤ë¤«¤Ï¡¢¤½¤ì¤¾¤ì +.IR signal1_type , +.I signal2_type +¥Õ¥¡¥¤¥ë¤ÎÆâÍƤˤè¤Ã¤Æ·è¤Þ¤ë¡£ +.RE +.TP +.BR /signal1_type ", " /signal2_type +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¥·¥°¥Ê¥ëÄÌÃÎ¥Õ¥¡¥¤¥ë +.I signal1 +¤È +.I signal2 +¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¡£ +¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï¿ôÃͤòɽ¤¹¥¢¥¹¥­¡¼Ê¸»úÎó¤òÊÝ»ý¤·¡¢ +Æɤ߽Ф¹¤È "1" ¤« "0" ¤Î¤É¤Á¤é¤«¤¬ÆÀ¤é¤ì¤ë¡£ +¥â¡¼¥É 0 (¾å½ñ¤­¥â¡¼¥É) ¤Ç¤Ï¡¢¥Ï¡¼¥É¥¦¥§¥¢¤Ï¥·¥°¥Ê¥ë¥Á¥ã¥Í¥ë¤ÎÆâÍƤò +¥·¥°¥Ê¥ë¥Á¥ã¥Í¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤ÇÃÖ¤­´¹¤¨¤ë¡£ +¥â¡¼¥É 1 (ÏÀÍý OR ¥â¡¼¥É) ¤Ç¤Ï¡¢¥Ï¡¼¥É¥¦¥§¥¢¤Ï¥·¥°¥Ê¥ë¥Á¥ã¥Í¥ë¤Ë +½ñ¤­¹þ¤Þ¤ì¤¿¥Ó¥Ã¥È¤òÀÑ»»¤·¤Æ¤¤¤¯¡£ +¥ª¡¼¥×¥ó¤µ¤ì¤¿ +.I signal1_type +¤ä +.I signal2_type +¥Õ¥¡¥¤¥ë¤Ë²Äǽ¤ÊÁàºî¤Ï°Ê²¼¤Ç¤¢¤ë¡£ +.RS +.TP +.BR read (2) +.BR read (2) +¤ËÅϤµ¤ì¤¿ +.I count +¤¬¥ì¥¸¥¹¥¿¤Î¿ôÃͤȲþ¹Ô (newline) ʸ»ú 1 ¸Ä¤ò³ÊǼ¤¹¤ë¤Î¤ËɬÍפÊŤµ¤è¤ê +û¤¤¾ì¹ç¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò³¤±¤Æ read ¤¹¤ë¤³¤È¤Ç¡¢ +ʸ»úÎóÁ´ÂΤòÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ +ʸ»úÎóÁ´ÂΤ¬Æɤ߽Фµ¤ì¤ë¤È¡¢¤½¤ì°Ê¹ß¤Î read Áàºî¤Ç¤Ï 0 ¥Ð¥¤¥È¤¬ÊÖ¤µ¤ì¡¢ +¿·¤·¤¤ÃͤòÆɤ߽Ф¹¤Ë¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥ª¡¼¥×¥ó¤¹¤ëɬÍפ¬¤¢¤ë¡£ +.TP +.BR write (2) +¤³¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î +.BR write (2) +Áàºî¤Ï¥ì¥¸¥¹¥¿Ãͤòʸ»úÎó¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£ +ʸ»úÎó¤Î²ò¼á¤ÏÀèƬ¤«¤é³«»Ï¤µ¤ì¡¢¿ô»ú°Ê³°¤Îʸ»ú¤¬½é¤á¤ÆÅо줹¤ë¤«¡¢ +¥Ð¥Ã¥Õ¥¡¤ÎËöÈø¤Ë㤹¤ë¤Þ¤Ç¹Ô¤ï¤ì¤ë¡£ +Ʊ¤¸¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ø³¤±¤Æ write ¤ò¹Ô¤¦¤È¡¢ +¸å¤Î write ¤Ë¤è¤êÁ°¤ÎÀßÄ꤬¾å½ñ¤­¤µ¤ì¤ë¡£ +.RE +.SH Îã +.TP +.IR /etc/fstab " entry" +none /spu spufs gid=spu 0 0 +.\" .SH AUTHORS +.\" Arnd Bergmann , +.\" Mark Nutter and +.\" Ulrich Weigand +.SH ´ØÏ¢¹àÌÜ +.BR close (2), +.BR spu_create (2), +.BR spu_run (2) diff --git a/release/man7/standards.7 b/release/man7/standards.7 new file mode 100644 index 00000000..5e8144d2 --- /dev/null +++ b/release/man7/standards.7 @@ -0,0 +1,289 @@ +.\" Copyright (c) 2006, Michael Kerrisk +.\" includes some material by other authors that was formerly +.\" in intro.2. +.\" +.\" 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) 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 »Ø¿Ë +.\" +.TH STANDARDS 7 2009-06-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +standards \- C ¤È UNIX ¤Îɸ½àµ¬³Ê +.SH ÀâÌÀ +¿¤¯¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¡Ö½àµò (CONFORMING TO)¡×¤Î¾Ï¤Ï¡¢ +¤½¤Î¥Ú¡¼¥¸¤Ëµ­ºÜ¤µ¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬½àµò¤¹¤ë +³Æ¼ï¤Îɸ½àµ¬³Ê¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£ +°Ê²¼¤Ë¤³¤ì¤é¤Îɸ½àµ¬³Ê¤Î´Êñ¤ÊÀâÌÀ¤òµ­¤¹¡£ +.TP +.B V7 +¥Ù¥ë¸¦µæ½ê¤Ë¤è¤ë¸µÁÄ UNIX ¤Ç¤¢¤ë Version 7¡£ +.TP +.B 4.2BSD +¥«¥ê¥Õ¥©¥ë¥Ë¥¢Âç¥Ð¡¼¥¯¥ì¡¼¹» (the University of California at Berkeley) +¤Ë¤è¤ê¥ê¥ê¡¼¥¹¤µ¤ì¤¿ +.IR "Berkeley Software Distribution" +¥ê¥ê¡¼¥¹ 4.2 ¤Ë¤è¤Ã¤Æµ¬Äꤵ¤ì¤¿¡¢¼ÂÁõ¤Ë´ð¤Å¤¯É¸½àµ¬³Ê +(implementation standard)¡£ +¥Ð¡¼¥¯¥ì¡¼¤Ë¤è¤ë¥ê¥ê¡¼¥¹¤ÎÃæ¤Ç +TCP/IP ¥¹¥¿¥Ã¥¯¤È¥½¥±¥Ã¥È API ¤ò´Þ¤àºÇ½é¤Î¥ê¥ê¡¼¥¹¤Ç¤¢¤ë¡£ + +¤³¤ì¤è¤êÁ°¤ÎBSD ¤Î¼ç¤Ê¥ê¥ê¡¼¥¹¤È¤·¤Æ¤Ï +\fI3BSD\fP (1980), \fI4BSD\fP (1980), \fI4.1BSD\fP (1981) ¤¬¤¢¤ë¡£ +.TP +.B 4.3BSD +1986 ǯ¤Ë¥ê¥ê¡¼¥¹¤µ¤ì¤¿ 4.2BSD ¤Î¸å·Ñ¡£ +.TP +.B 4.4BSD +1993 ǯ¤Ë¥ê¥ê¡¼¥¹¤µ¤ì¤¿ 4.3BSD ¤Î¸å·Ñ¡£ +¥Ð¡¼¥¯¥ì¡¼ (Berkeley) ¤Ë¤è¤ëºÇ¸å¤ÎÂ礭¤Ê¥ê¥ê¡¼¥¹¤Ç¤¢¤ë¡£ +.TP +.B System V +AT&T ¤Î¾¦ÍÑ System V (5) ¥ê¥ê¡¼¥¹¤Î 1983 ǯÈǤˤè¤êµ¬Äꤵ¤ì¤¿ +¼ÂÁõ¤Ë´ð¤Å¤¯É¸½àµ¬³Ê¡£ +°ì¤ÄÁ°¤Î AT&T ¤ÎÂ礭¤Ê¥ê¥ê¡¼¥¹¤Ï 1981 ǯ¤Ë¥ê¥ê¡¼¥¹¤µ¤ì¤¿ +.I "System III" +¤Ç¤¢¤ë¡£ +.TP +.B System V release 2 (SVr2) +System V ¤ÎÆóÈÖÌܤΥê¥ê¡¼¥¹¤Ç¤¢¤ê¡¢1985 ǯ¤ËºîÀ®¤µ¤ì¤¿¡£ +SVr2 ¤ÏÀµ¼°¤Ë¤Ï 1985 ǯ¤Ëȯ¹Ô¤µ¤ì¤¿ +.I "System V Interface Definition version 1" +.RI ( "SVID 1" ) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B System V release 3 (SVr3) +SVr2 ¤Î¸å·Ñ¡£1986 ǯ¤Ë¥ê¥ê¡¼¥¹¤µ¤ì¤¿¡£ +¤³¤Î¥ê¥ê¡¼¥¹¤ÏÀµ¼°¤Ë¤Ï +.I "System V Interface Definition version 2" +.RI ( "SVID 2" ) +¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£ +.TP +.B System V release 4 (SVr4) +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 +System V Interface Definition version 4¡£ +1995 ǯ¤Ëȯ¹Ô¤µ¤ì¤¿¡£ +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ç¤Ï http://www.sco.com/developers/devspecs/ +¤ÇÆþ¼ê¤Ç¤­¤ë¡£ +.TP +.B C89 +ºÇ½é¤Î 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 +.B C99 +C ¸À¸ì¤Îɸ½àµ¬³Ê¤Î¤³¤Î²þÄûÈÇ¤Ï ISO ¤Ë¤è¤ê 1999 ǯ¤Ë¾µÇ§¤µ¤ì¤¿ +.RI ( "ISO/IEC 9899:1999" )¡£ +http://www.open-std.org/jtc1/sc22/wg14/www/standards +¤«¤é¥ª¥ó¥é¥¤¥ó¤ÇÆþ¼ê²Äǽ¤Ç¤¢¤ë¡£ +.TP +.B POSIX.1-1990 +"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 +IEEE Std 1003.2-1992. +¥³¥Þ¥ó¥É¤È¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ë¤Ä¤¤¤ÆÀâÌÀ¤¬½ñ¤«¤ì¤Æ¤ª¤ê¡¢ +1993 ǯ¤Ë ISO ¤Ë¤è¤ê¾µÇ§¤µ¤ì¤¿ +.RI ( "ISO/IEC 9945-2:1993" )¡£ +.TP +.BR POSIX.1b " (°ÊÁ°¤Ï \fIPOSIX.4\fP ¤È¤â¸À¤ï¤ì¤¿)" +IEEE Std 1003.1b-1993. +°Ü¿¢²Äǽ¤Ê¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î¤¿¤á¤Î¥ê¥¢¥ë¥¿¥¤¥àµ¡Ç½¤Ë¤Ä¤¤¤Æ +µ­ºÜ¤µ¤ì¤Æ¤ª¤ê¡¢ +1996 ǯ¤Î ISO ¤Ë¤è¤ê¾µÇ§¤µ¤ì¤¿ +.RI ( "ISO/IEC 9945-1:1996" )¡£ +.TP +.B POSIX.1c +IEEE Std 1003.1c-1995. +POSIX ¥¹¥ì¥Ã¥É¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë¤Ä¤¤¤Æµ­ºÜ¤·¤Æ¤¤¤ë¡£ +.TP +.B POSIX.1d +IEEE Std 1003.1c-1999. +ÄɲäΥꥢ¥ë¥¿¥¤¥à³ÈÄ¥¤Ë¤Ä¤¤¤Æµ­ºÜ¤·¤Æ¤¤¤ë¡£ +.TP +.B POSIX.1g +IEEE Std 1003.1g-2000. +(¥½¥±¥Ã¥È¤ò´Þ¤á¤¿) ¥Í¥Ã¥È¥ï¡¼¥¯ API ¤Ë¤Ä¤¤¤Æµ­ºÜ¤·¤Æ¤¤¤ë¡£ +.TP +.B POSIX.1j +IEEE Std 1003.1j-2000. +¹âÅ٤ʥꥢ¥ë¥¿¥¤¥à³ÈÄ¥¤Ë¤Ä¤¤¤Æµ­ºÜ¤·¤Æ¤¤¤ë¡£ +.TP +.B POSIX.1-1996 +POSIX.1 ¤Î 1996 ǯ¤Î²þÄûÈÇ¡£ +POSIX.1b ¤È POSIX.1c ¤ò¼è¤ê¹þ¤ó¤Ç¤¤¤ë¡£ +.TP +.B XPG3 +1989 ǯ¥ê¥ê¡¼¥¹¤Î¡¢¥Þ¥ë¥Á¥Ù¥ó¥À¤Ë¤è¤ë¶È³¦ÃÄÂΤǤ¢¤ë X/Open ¼Ò¤Ë¤è¤ë +.I "X/Open Portability Guide" +¤ÎºÇ½é¤ÎÂ礭¤Ê¥ê¥ê¡¼¥¹¤Ç¤¢¤ë¡£ +¤³¤Î»Ø¿Ë¤Ï POSIX ɸ½àµ¬³Ê¤Ë´ð¤Å¤¤¤Æ¤¤¤ë¡£ +.TP +.B XPG4 +1992 ǯ¤Ë¥ê¥ê¡¼¥¹¤µ¤ì¤¿¡¢X/Open Portability Guide (°Ü¿¢À­¤Ë´Ø¤¹¤ë»Ø¿Ë) +¤Î²þÄûÈÇ¡£ +.TP +.B XPG4v2 +XPG4 ¤Î 1994ǯ²þÄûÈÇ¡£ +.I "Spec 1170" +¤È¤â¸Æ¤Ð¤ì¤ë¡£ +1170 ¤È¤Ï¤³¤Îɸ½àµ¬³Ê¤¬ÄêµÁ¤·¤Æ¤¤¤ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¿ô¤òɽ¤¹¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.B SUS (SUSv1) +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 +Single UNIX Specification version 2. +.I XPG5 +¤È¸Æ¤Ð¤ì¤ë¤³¤È¤â¤¢¤ë¡£ +¤³¤Îµ¬³Ê¤Ï 1997 ǯ¤ËÅо줷¤¿¡£ +¤³¤Îµ¬³Ê¤Ë½àµò¤¹¤ë¥·¥¹¥Æ¥à¤Ï +.I "UNIX 98" +¤ò̾¾è¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +http://www.UNIX-systems.org/version2/ +¤â»²¾È¤Î¤³¤È¡£ +.TP +.B POSIX.1-2001, SUSv3 +¤³¤ì¤Ï 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")¡£ + +¤³¤Îµ¬³Ê¤Ç¤Ï¡¢ +.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 ) +¤Ç¤¢¤ë)¡£ + +POSIX.1-2001 ʸ½ñ¤Ï 4¤Ä¤ÎÉôʬ¤Ëʬ¤±¤ë¤³¤È¤¬¤Ç¤­¤ë: + +.BR XBD : +ÄêµÁ¡¢ÍѸì¤È³µÇ°¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î»ÅÍÍ¡£ + +.BR XSH : +´Ø¿ô¤Î»ÅÍÍ (´Ø¿ô¤È¤Ï¡¢¼ÂºÝ¤Î¼ÂÁõ¤Ç¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤È +¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î¤³¤È¤Ç¤¢¤ë)¡£ + +.BR XCU : +¥³¥Þ¥ó¥É¤È¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Î»ÅÍÍ +(°ÊÁ°¡¢ POSIX.2 ¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤¿ÆâÍÆ)¡£ + +.BR XRAT : +»²¹Í¾ðÊó¤Èµ¬³Ê¤Î¤½¤ì°Ê³°¤ÎÉôʬ + +POSIX.1-2001 ¤Ï C99 ¤ÈÀ°¹ç¤¬¤È¤é¤ì¤Æ¤ª¤ê¡¢ +C99 ¤Çɸ½à²½¤µ¤ì¤¿¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï POSIX.1-2001 ¤Ç¤â +ɸ½à²½¤µ¤ì¤Æ¤¤¤ë¡£ + +¸µ¤Î 2001 ǯÈǤÎɸ½à¤ËÂФ¹¤ë Technical Corrigenda +(Àµ¸íɽ; ºÙ¤«¤Ê½¤Àµ¤È²þÎÉ) ¤¬Æó¤Ä¹Ô¤ï¤ì¤Æ¤¤¤ë: +2003 ǯ¤Î TC1 +.RI ( POSIX.1-2003 +¤È¸Æ¤Ð¤ì¤ë) ¤È 2004 ǯ¤Î TC2 +.RI ( POSIX.1-2004 +¤È¸Æ¤Ð¤ì¤ë) ¤Ç¤¢¤ë¡£ +.TP +.B POSIX.1-2008, SUSv4 +POSIX.1/SUS ¤Î¼¡¤Î²þÄûÈǤ˴ؤ¹¤ëºî¶È¤Ï 2008 ǯ¤Ë´°Î»¤·¾µÇ§¤µ¤ì¤¿¡£ + +¤³¤Î²þÄûÈǤǤÎÊѹ¹¤Ï POSIX.1-2001/SUSv3 ¤Ç¹Ô¤ï¤ì¤¿Êѹ¹¤Û¤ÉÂ礭¤¯¤Ê¤¤¤¬¡¢ +¿¤¯¤Î¿·¤·¤¤¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤¬Äɲ䵤졢´û¸¤Î»ÅÍͤ˴ؤ·¤Æ¤â +¼ï¡¹¤Î¾ÜºÙ¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤ë¡£ +POSIX.1-2001 ¤Ç¤ÏǤ°Õ (optional) ¤È¤µ¤ì¤Æ¤¤¤¿¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Î¿¤¯¤¬ +2008 ǯÈǤÎɸ½à¤Ç¤Ïɬ¿Ü (mandatory) ¤Ë¤Ê¤ë¡£ +POSIX.1-2001 ¤Ë¸ºß¤¹¤ë¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Î¤¤¤¯¤Ä¤«¤Ï¡¢ +POSIX.1-2008 ¤Ç¤ÏÇÑ»ßͽÄê¤Î°õ¤¬ÉÕ¤±¤é¤ì¤¿¤ê¡¢ +ɸ½à¤«¤é´°Á´¤Ëºï½ü¤µ¤ì¤¿¤ê¤·¤Æ¤¤¤ë¡£ + +²þÄû¤µ¤ì¤¿É¸½à¤Ï POSIX.1-2001 ¤ÈƱ¤¸¤¯ 4 ¤Ä¤ÎÉôʬ¤Ëʬ¤±¤é¤ì¡¢ +Á°²ó¤ÈƱÍͤËÆóÃʳ¬¤ÎŬ¹çÀ­¤òÄêµÁ¤·¤Æ¤¤¤ë¡£ +´ðËÜ¥»¥Ã¥È¤Ç¤¢¤ë +.I "POSIX Conformance (POSIX ½àµò)" +¤È¡¢ +´ðËÜ»ÅÍͤΥ¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ë²Ã¤¨¤ÆÄɲäΥ¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹·²¤¬ +µÁ̳ÉÕ¤±¤é¤ì¤Æ¤¤¤ë +.I "XSI Conformance (XSI ½àµò)" +¤ÎÆó¤Ä¤Ç¤¢¤ë¡£ + +°ìÈ̤ˤϡ¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¡Ö½àµò¡×¤Î¾Ï¤Î¥ê¥¹¥È¤Ë POSIX.1-2001 ¤¬ +¤¢¤ì¤Ð¡¢Â¾¤ËÃí°Õ½ñ¤­¤¬¤Ê¤±¤ì¤Ð¡¢¤½¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï POSIX.1-2008 +¤Ë¤â½àµò¤·¤Æ¤¤¤ë¤È¹Í¤¨¤Æ¤è¤¤¡£ + +¾Ü¤·¤¤¾ðÊó¤Ï Austin Group ¤Î¥¦¥§¥Ö¥µ¥¤¥È +http://www.opengroup.org/austin/ +¤ËºÜ¤Ã¤Æ¤¤¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR feature_test_macros (7), +.BR libc (7), +.BR posixoptions (7) diff --git a/release/man7/suffixes.7 b/release/man7/suffixes.7 new file mode 100644 index 00000000..68f7fda4 --- /dev/null +++ b/release/man7/suffixes.7 @@ -0,0 +1,293 @@ +'\" 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" +.SH ̾Á° +suffixes \- ¥Õ¥¡¥¤¥ë¤ÎÀÜÈø (suffix) ¤Î¥ê¥¹¥È +.SH ÀâÌÀ +½¬´·Åª¤Ë¥Õ¥¡¥¤¥ë¤ÎÀÜÈø (suffix) ¤Ï¥Õ¥¡¥¤¥ë¤ÎÆâÍƤò¼¨¤·¤Æ¤¤¤ë¡£ +¤³¤ÎÀÜÈø¤Ï¥Ô¥ê¥ª¥É (.) ¤È¤½¤ì¤Ë³¤¯°ì¤Ä°Ê¾å¤Îʸ»ú¤«¤é¤Ê¤Ã¤Æ¤¤¤ë¡£ +¥³¥ó¥Ñ¥¤¥é¡¼¤Î¤è¤¦¤Ê¡¢Â¿¤¯¤Îɸ½àŪ¤Ê¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ï¡¢ +¤³¤ÎÀÜÈø¤ò»ÈÍѤ·¤Æ¼è¤ê°·¤¦¥Õ¥¡¥¤¥ë¤Î·¿¤òÍý²ò¤¹¤ë¡£ +.BR make (1) +¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ï¥Õ¥¡¥¤¥ë¤ÎÀÜÈø¤Ë´ð¤Å¤¤¤¿¥ë¡¼¥ë¤Ë½¾¤Ã¤ÆÆ°ºî¤¹¤ë¡£ +.PP +°Ê²¼¤Ï Linux ¥·¥¹¥Æ¥à¤Ç¤è¤¯¸«¤é¤ì¤ëÀÜÈø¤Î¥ê¥¹¥È¤Ç¤¢¤ë¡£ +.PP + +.TS +l | l +_ | _ +lI | l . +Suffix File type + ,v RCS (¥ê¥Ó¥¸¥ç¥ó¡¦¥³¥ó¥È¥í¡¼¥ë) ¤Î¤¿¤á¤Î¥Õ¥¡¥¤¥ë + - ¥Ð¥Ã¥¯¥¢¥Ã¥×¡¦¥Õ¥¡¥¤¥ë + .C C++ ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É¡¢\fI.cc\fP ¤ÈÅù²Á + .F \fBcpp\fP(1)Ì¿Îá¤ò¤â¤Ã¤¿¥Õ¥©¡¼¥È¥é¥ó¤Î¥½¡¼¥¹ + ¤Þ¤¿¤Ï freeze(1) ¤Ç°µ½Ì¤µ¤ì¤¿¥Õ¥¡¥¤¥ë + .S \fBcpp\fP(1)Ì¿Îá¤ò¤â¤Ã¤¿¥¢¥»¥ó¥Ö¥é¡¦¥½¡¼¥¹ + .Y yabba(1) ¤Ç°µ½Ì¤µ¤ì¤¿¥Õ¥¡¥¤¥ë + .Z \fBcompress\fP(1)¤Ç°µ½Ì¤µ¤ì¤¿¥Õ¥¡¥¤¥ë + .[0-9]+gf TeX ¤Î°ìÈÌ¥Õ¥©¥ó¥È + .[0-9]+pk TeX ¤Î°µ½Ì¥Õ¥©¥ó¥È + .[1-9] Âбþ¤¹¤ë¾Ï¤Î¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸ + .[1-9][a-z] ¥µ¥Ö¥»¥¯¥·¥ç¥óÉÕ¤­¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸ + .a ¥ª¥Ö¥¸¥§¥¯¥È¡¦¥³¡¼¥É¤ÎÀÅŪ¥é¥¤¥Ö¥é¥ê + .ad X ¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¡¦¥Ç¥Õ¥©¥ë¥È¡¦¥Õ¥¡¥¤¥ë + .ada Ada ¤Î¥½¡¼¥¹(ËÜÂΤ«»ÞÍÕ¤«ÁȤ߹ç¤ï¤») + .adb Ada ¤Î¥½¡¼¥¹ËÜÂÎ + .ads Ada ¤Î¥½¡¼¥¹»ÅÍÍ + .afm PostScript ¤Î¥Õ¥©¥ó¥È¡¦¥á¥È¥ê¥¯¥¹ + .al Perl ¤Î¥ª¡¼¥È¥í¡¼¥É¡¦¥Õ¥¡¥¤¥ë + .am \fBautomake\fP(1) ¤ÎÆþÎÏ¥Õ¥¡¥¤¥ë + .arc \fBarc\fP(1)¤Î¥¢¡¼¥«¥¤¥Ö + .arj \fBarj\fP(1)¤Î¥¢¡¼¥«¥¤¥Ö + .asc PGP ¤Î ASCII ²½¤µ¤ì¤¿¥Ç¡¼¥¿ + .asm (GNU) ¥¢¥»¥ó¥Ö¥é¤Î¥½¡¼¥¹ + .au ¥ª¡¼¥Ç¥£¥ª¡¦¥µ¥¦¥ó¥É¡¦¥Õ¥¡¥¤¥ë + .aux LaTeX ¤ÎÊä½õ¥Õ¥¡¥¤¥ë +.avi (Microsoft ¥Ó¥Ç¥ª) ¥à¡¼¥Ó¡¼ + .awk AWK ¸À¸ì¤Î¥×¥í¥°¥é¥à + .b LILO ¤Î¥Ö¡¼¥È¥í¡¼¥À¡¦¥¤¥á¡¼¥¸ + .bak ¥Ð¥Ã¥¯¥¢¥Ã¥×¡¦¥Õ¥¡¥¤¥ë + .bash \fBbash\fP(1) ¥·¥§¥ë¡¦¥¹¥¯¥ê¥×¥È + .bb gcc -ftest-coverage ¤Î¥Ù¡¼¥·¥Ã¥¯¡¦¥Ö¥í¥Ã¥¯¡¦¥ê¥¹¥È + .bbg gcc -ftest-coverage ¤Î¥Ù¡¼¥·¥Ã¥¯¡¦¥Ö¥í¥Ã¥¯¡¦¥°¥é¥Õ + .bbl BibTeX ¤Î½ÐÎÏ + .bdf X ¤Î¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë + .bib TeX ʸ¸¥¥Ç¡¼¥¿¥Ù¡¼¥¹, BibTeX ¤ÎÆþÎÏ + .bm ¥Ó¥Ã¥È¥Þ¥Ã¥×¤Î¥½¡¼¥¹ + .bmp ¥Ó¥Ã¥È¥Þ¥Ã¥× + .bz2 \fBbzip2\fP(1) ¤ò»ÈÍѤ·¤Æ°µ½Ì¤µ¤ì¤¿¥Õ¥¡¥¤¥ë + .c C ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .cat ¥á¥Ã¥»¡¼¥¸¡¦¥«¥¿¥í¥°¡¦¥Õ¥¡¥¤¥ë + .cc C++ ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .cf ÀßÄê¥Õ¥¡¥¤¥ë + .cfg ÀßÄê¥Õ¥¡¥¤¥ë + .cgi WWW ¤Î¥³¥ó¥Æ¥ó¥Ä¤òºîÀ®¤¹¤ë¥×¥í¥°¥é¥à + .cls LaTeX ¤Î¥¯¥é¥¹ÄêµÁ¥Õ¥¡¥¤¥ë + .class Java ¤Î¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ð¥¤¥È¥³¡¼¥É + .conf ÀßÄê¥Õ¥¡¥¤¥ë + .config ÀßÄê¥Õ¥¡¥¤¥ë + .cpp \fI.cc\fR ¤ÈƱ¤¸ + .csh \fBcsh\fP(1) ¥·¥§¥ë¡¦¥¹¥¯¥ê¥×¥È + .cxx \fI.cc\fR ¤ÈƱ¤¸ + .dat ¥Ç¡¼¥¿¡¦¥Õ¥¡¥¤¥ë + .deb Debian ¤Î¥½¥Õ¥È¥¦¥§¥¢¡¦¥Ñ¥Ã¥±¡¼¥¸ + .def Modula-2 ¥½¡¼¥¹¤Î¥â¥¸¥å¡¼¥ëÄêµÁ¥Õ¥¡¥¤¥ë + .def ¤½¤Î¾¤ÎÄêµÁ¥Õ¥¡¥¤¥ë + .desc \fBmunpack\fP(1) ¤Ç¥¢¥ó¥Ñ¥Ã¥¯¤µ¤ì¤¿¥á¡¼¥ë¤ÎºÇ½é¤ÎÉôʬ + .diff ¥Õ¥¡¥¤¥ëº¹Ê¬ (\fBdiff\fP(1) ¥³¥Þ¥ó¥É¤Î½ÐÎÏ) + .dir dbm ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¦¥Õ¥¡¥¤¥ë + .doc ¥É¥­¥å¥á¥ó¥È¡¦¥Õ¥¡¥¤¥ë + .dsc Debian ¤Î¥½¡¼¥¹¡¦¥³¥ó¥È¥í¡¼¥ë¥Õ¥¡¥¤¥ë + (¥½¡¼¥¹¡¦¥Ñ¥Ã¥±¡¼¥¸) + .dtx LaTeX ¥Ñ¥Ã¥±¡¼¥¸¤Î¥½¡¼¥¹ + .dvi TeX ¤Î¥Ç¥Ð¥¤¥¹ÆÈΩ½ÐÎÏ¥Õ¥¡¥¤¥ë + .el Emacs-Lisp ¤Î¥½¡¼¥¹ + .elc ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ Emacs-Lisp¤Î¥³¡¼¥É + .eps ¥«¥×¥»¥ë²½¤µ¤ì¤¿PostScript + .exp Expect ¤Î¥½¡¼¥¹¥³¡¼¥É + .f Fortran ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .f77 Fortran 77 ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .f90 Fortran 90 ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .fas ¥×¥ê¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ Common-Lisp¤Î¥³¡¼¥É + .fi ¥Õ¥©¡¼¥È¥é¥ó¤Î¥¤¥ó¥¯¥ë¡¼¥É¡¦¥Õ¥¡¥¤¥ë + .fig FIG ¥¤¥á¡¼¥¸¡¦¥Õ¥¡¥¤¥ë (\fBxfig\fR(1) ¤Ç»ÈÍѤµ¤ì¤ë) + .fmt TeX ¥Õ¥©¡¼¥Þ¥Ã¥È¡¦¥Õ¥¡¥¤¥ë + .gif ¥°¥é¥Õ¥£¥Ã¥¯¡¦¥¤¥á¡¼¥¸ (Compuserve Graphics Image File) + .gmo GNU ¥Õ¥©¡¼¥Þ¥Ã¥È¡¦¥á¥Ã¥»¡¼¥¸¡¦¥«¥¿¥í¥° + .gsf ghostscript ¤Î¥Õ¥©¥ó¥È + .gz \fBgzip\fP(1) ¤ò»ÈÍѤ·¤Æ°µ½Ì¤µ¤ì¤¿¥Õ¥¡¥¤¥ë + .h C ¤Þ¤¿¤Ï C++ ¤Î¥Ø¥Ã¥À¡¼¡¦¥Õ¥¡¥¤¥ë + .help ¥Ø¥ë¥×¡¦¥Õ¥¡¥¤¥ë + .hf \fI.help\fP ¤ËƱ¤¸ + .hlp \fI.help\fP ¤ËƱ¤¸ + .htm ÉÏ˳¿Í¤Î \fI.html\fP + .html World Wide Web ¤Ç»ÈÍѤ¹¤ë HTML ¤Îʸ½ñ + .hqx 7 ¥Ó¥Ã¥È¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿ Macintosh ¥Õ¥¡¥¤¥ë + .i ¥×¥ê¥×¥í¥»¥¹¤ò¹Ô¤Ê¤Ã¤¿ C ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .icon ¥Ó¥Ã¥È¥Þ¥Ã¥×¤Î¥½¡¼¥¹ + .idx ¥Ï¥¤¥Ñ¡¼¥Æ¥­¥¹¥È¤ä¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¡¦¥Õ¥¡¥¤¥ë + .image ¥Ó¥Ã¥È¥Þ¥Ã¥×¤Î¥½¡¼¥¹ + .in ¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¤Î¥Æ¥ó¥×¥ì¡¼¥È (ÆÃ¤Ë GNU Autoconf) + .info Emacs info ¥Õ¥¡¥¤¥ë + .info-[0-9]+ ʬ³ä¤µ¤ì¤¿ info ¥Õ¥¡¥¤¥ë + .ins docstrip ¤Î LaTeX ¥Ñ¥Ã¥±¡¼¥¸¡¦¥¤¥ó¥¹¥È¡¼¥ë¡¦¥Õ¥¡¥¤¥ë + .itcl itcl ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + itcl (incr tcl) ¤Ï tcl ¤Î OO ³ÈÄ¥ + .java Java ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .jpeg ¥°¥é¥Õ¥£¥Ã¥¯¥¤¥á¡¼¥¸ (Joint Photographic Experts Group) + .jpg ÉÏ˳¿Í¤Î \fI.jpeg\fP + .kmap \fBlyx\fP(1) ¤Î¥­¡¼¥Þ¥Ã¥× + .l \fI.lex\fP ¤Þ¤¿¤Ï \fI.lisp\fP ¤ËƱ¤¸ + .lex \fBlex\fP(1) ¤Þ¤¿¤Ï \fBflex\fP(1) ¥Õ¥¡¥¤¥ë + .lha lharc ¥¢¡¼¥«¥¤¥Ö + .lib Common-Lisp ¤Î¥é¥¤¥Ö¥é¥ê + .lisp Lisp ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .ln \fBlint\fP(1) ¤Ç»ÈÍѤ¹¤ë¤¿¤á¤Î¥Õ¥¡¥¤¥ë + .log ¥í¥°¡¦¥Õ¥¡¥¤¥ë, ÆÃ¤Ë TeX ¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤ë + .lsm Linux ¥½¥Õ¥È¥¦¥§¥¢¡¦¥Þ¥Ã¥×¤Î¸«½Ð¤· + .lsp Common-Lisp ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .lzh lharc ¥¢¡¼¥«¥¤¥Ö + .m Objective-C ¥½¡¼¥¹¡¦¥³¡¼¥É + .m4 \fBm4\fP(1) ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .mac ¤¤¤í¤¤¤í¤Ê¥×¥í¥°¥é¥à¤Ç¤Î¥Þ¥¯¥í¡¦¥Õ¥¡¥¤¥ë + .man ¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸ (ÂçÄñ¤Ï¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤) + .map ³Æ¼ï¥×¥í¥°¥é¥à¤Î¥Þ¥Ã¥×¡¦¥Õ¥¡¥¤¥ë + .me me ¥Þ¥¯¥í¡¦¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ·¤¿ Nroff ¤Î¥½¡¼¥¹ + .mf ¥á¥¿¥Õ¥©¥ó¥È (TeX ¤Î¥Õ¥©¥ó¥ÈºîÀ®¥Ä¡¼¥ë) ¤Î¥½¡¼¥¹ + .mgp MagicPoint ¥Õ¥¡¥¤¥ë + .mm mm ¥Þ¥¯¥í¤ò»ÈÍѤ·¤¿ \fBgroff\fP(1) ¤Î¥½¡¼¥¹ + .mo ¥á¥Ã¥»¡¼¥¸¡¦¥«¥¿¥í¥°¤Î¥Ð¥¤¥Ê¥ê + .mod Modula-2 ¤Î¥â¥¸¥å¡¼¥ë¼ÂÁõ¤Î¤¿¤á¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .mov (quicktime) ¥à¡¼¥Ó¡¼ + .mp Metapost ¤Î¥½¡¼¥¹ + .mp2 MPEG ¥ì¥¤¥ä¡¼ 2 (¥ª¡¼¥Ç¥£¥ª) ¥Õ¥¡¥¤¥ë + .mp3 MPEG ¥ì¥¤¥ä¡¼ 3 (¥ª¡¼¥Ç¥£¥ª) ¥Õ¥¡¥¤¥ë + .mpeg ¥à¡¼¥Ó¡¼¡¦¥Õ¥¡¥¤¥ë + .o ¥ª¥Ö¥¸¥§¥¯¥È¡¦¥Õ¥¡¥¤¥ë + .old ¸Å¤¤¥Õ¥¡¥¤¥ë¡¢¤Þ¤¿¤Ï¥Ð¥Ã¥¯¥¢¥Ã¥×¡¦¥Õ¥¡¥¤¥ë + .orig \fBpatch\fP(1) ¤Ë¤è¤ë (¥ª¥ê¥¸¥Ê¥ë¤Î) ¥Ð¥Ã¥¯¥¢¥Ã¥×¡¦¥Õ¥¡¥¤¥ë + .out ½ÐÎÏ¥Õ¥¡¥¤¥ë¡¢ÂçÄñ¤Ï¼Â¹Ô¥×¥í¥°¥é¥à¤Ç¤¢¤ë (a.out) + .p pascal ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .pag dbm ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ç¡¼¥¿¡¦¥Õ¥¡¥¤¥ë + .patch \fBpatch\fP(1) ¤Ç»ÈÍѤ¹¤ë¤¿¤á¤Îº¹Ê¬¥Õ¥¡¥¤¥ë + .pbm ¥°¥é¥Õ¥£¥Ã¥¯¡¦¥¤¥á¡¼¥¸ (portable bitmap format) + .pcf X11 ¤Î¥Õ¥©¥ó¥È¡¦¥Õ¥¡¥¤¥ë + .pdf Adobe Portable Data Format + (Acrobat/\fBacroread\fP ¤ä \fBxpdf\fP ¤Ç»ÈÍѤ¹¤ë) + .perl Perl ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É (.ph, .pl, .pm ¤ò»²¾È) + .pfa PostScript¤Î¥Õ¥©¥ó¥ÈÄêµÁ (ASCII ¥Õ¥©¡¼¥Þ¥Ã¥È) + .pfb PostScript¤Î¥Õ¥©¥ó¥ÈÄêµÁ (¥Ð¥¤¥Ê¥ê¡¦¥Õ¥©¡¼¥Þ¥Ã¥È) + .pgm ¥°¥é¥Õ¥£¥Ã¥¯¡¦¥¤¥á¡¼¥¸ (portable greymap format) + .pgp PGP ¤Î¥Ð¥¤¥Ê¥ê¡¦¥Ç¡¼¥¿ + .ph Perl ¤Î¥Ø¥Ã¥À¡¼¡¦¥Õ¥¡¥¤¥ë + .php PHP ¤Î¥×¥í¥°¥é¥à¡¦¥Õ¥¡¥¤¥ë + .php3 PHP3 ¤Î¥×¥í¥°¥é¥à¡¦¥Õ¥¡¥¤¥ë + .pid ¥Ç¡¼¥â¥ó¤Î PID ¤ò³ÊǼ¤·¤¿¥Õ¥¡¥¤¥ë (crond.pid ¤Ê¤É) + .pl TeX ¤Î¥×¥í¥Ñ¥Æ¥£¡¦¥ê¥¹¥È¤Þ¤¿¤Ï Perl ¤Î¥é¥¤¥Ö¥é¥ê + .pm Perl ¤Î¥â¥¸¥å¡¼¥ë + .png ¥°¥é¥Õ¥£¥Ã¥¯¡¦¥¤¥á¡¼¥¸ (Portable Network Graphics) + .po ¥á¥Ã¥»¡¼¥¸¡¦¥«¥¿¥í¥°¤Î¥½¡¼¥¹ + .pod \fBperldoc\fP(1) ¥Õ¥¡¥¤¥ë + .ppm ¥°¥é¥Õ¥£¥Ã¥¯¡¦¥¤¥á¡¼¥¸ (portable pixmap format) + .pr ¥Ó¥Ã¥È¥Þ¥Ã¥×¤Î¥½¡¼¥¹ + .ps PostScript ¥Õ¥¡¥¤¥ë + .py python ¤Î¥½¡¼¥¹ + .pyc ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ python + .qt quicktime ¥à¡¼¥Ó¡¼ + .r RATFOR ¤Î¥½¡¼¥¹ (ÇѸì) + .rej \fBpatch\fP(1) ¤Ë¼ºÇÔ¤·¤¿ pacth ¥Õ¥¡¥¤¥ë + .rpm RedHat ¤Î¥½¥Õ¥È¥¦¥§¥¢¡¦¥Ñ¥Ã¥±¡¼¥¸ + .rtf ¥ê¥Ã¥Á¡¦¥Æ¥­¥¹¥È¡¦¥Õ¥©¡¼¥Þ¥Ã¥È + .rules ²¿¤«¤Î¤¿¤á¤Î¥ë¡¼¥ë + .s ¥¢¥»¥ó¥Ö¥é¤Î¥½¡¼¥¹ + .sa a.out ¶¦Í­¥é¥¤¥Ö¥é¥ê¤Î¤¿¤á¤Î¥¹¥¿¥Ö¡¦¥é¥¤¥Ö¥é¥ê + .sc \fBsc\fP(1) ¤Î¥¹¥×¥ì¥Ã¥É¥·¡¼¥ÈÌ¿Îá + .scm Scheme ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .sed sed ¤Î¥½¡¼¥¹¡¦¥Õ¥¡¥¤¥ë + .sgml SGML ¥½¡¼¥¹ + .sh \fBsh\fP(1) ¤Î¥¹¥¯¥ê¥×¥È + .shar \fBshar\fP(1) ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ÇºîÀ®¤µ¤ì¤¿¥¢¡¼¥«¥¤¥Ö + .so ¶¦Í­¥é¥¤¥Ö¥é¥ê¤Þ¤¿¤ÏưŪ¥í¡¼¥É¡¦¥ª¥Ö¥¸¥§¥¯¥È + .sql SQL ¤Î¥½¡¼¥¹ + .sqml SQML ¤Î schema ¤Þ¤¿¤Ï query program + .sty LaTeX ¤Î¥¹¥¿¥¤¥ë¡¦¥Õ¥¡¥¤¥ë + .sym Modula-2 ¤Î¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ÄêµÁ¥â¥¸¥å¡¼¥ë + .tar \fBtar\fP(1) ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ÇºîÀ®¤µ¤ì¤¿¥¢¡¼¥«¥¤¥Ö + .tar.Z \fBcompress\fP(1) ¤Ç°µ½Ì¤µ¤ì¤¿ \fBtar\fP(1) ¥¢¡¼¥«¥¤¥Ö + .tar.bz2 \fBbzip2\fP(1) ¤Ç°µ½Ì¤µ¤ì¤¿ \fBtar\fP(1) ¥¢¡¼¥«¥¤¥Ö + .tar.gz \fBgzip\fP(1) ¤Ç°µ½Ì¤µ¤ì¤¿ \fBtar\fP(1) ¥¢¡¼¥«¥¤¥Ö + .taz \fBcompress\fP(1) ¤Ç°µ½Ì¤µ¤ì¤¿ \fBtar\fP(1) ¥¢¡¼¥«¥¤¥Ö + .tcl tcl ¤Î¥½¡¼¥¹¡¦¥³¡¼¥É + .tex TeX ¤Þ¤¿¤Ï LaTeX ¤Î¥½¡¼¥¹ + .texi \fI.texinfo\fP ¤ËƱ¤¸ + .texinfo texinfo ʸ½ñ¤Î¥½¡¼¥¹ + .text ¥Æ¥­¥¹¥È¡¦¥Õ¥¡¥¤¥ë + .tfm TeX ¤Î¥Õ¥©¥ó¥È¡¦¥á¥È¥ê¥Ã¥¯ + .tgz \fRgzip\fP(1)¤Ç°µ½Ì¤µ¤ì¤¿ \fRtar\fP(1) ¥¢¡¼¥«¥¤¥Ö + .tif ÉÏ˳¿Í¤Î \fI.tiff\fP + .tiff ¥°¥é¥Õ¥£¥Ã¥¯¡¦¥¤¥á¡¼¥¸ (Tagged Image File Format) + .tk tcl/tk ¥¹¥¯¥ê¥×¥È + .tmp °ì»þ¥Õ¥¡¥¤¥ë + .tmpl ¥Æ¥ó¥×¥ì¡¼¥È¡¦¥Õ¥¡¥¤¥ë + .txt \fI.text\fP ¤ËƱ¤¸ + .uu \fI.uue\fP ¤ËƱ¤¸ + .uue \fBuuencode\fP(1) ¤ÇÉä¹æ²½¤µ¤ì¤¿¥Ð¥¤¥Ê¥ê¡¦¥Õ¥¡¥¤¥ë + .vf TeX ¤Î²¾ÁÛ¥Õ¥©¥ó¥È¡¦¥Õ¥¡¥¤¥ë + .vpl TeX ¤Î²¾ÁÛ¥×¥í¥Ñ¥Æ¥£¡¦¥ê¥¹¥È¡¦¥Õ¥¡¥¤¥ë + .w Silvio Levi ¤Î CWEB + .wav ¥¦¥§¡¼¥Ö¡¦¥µ¥¦¥ó¥É¡¦¥Õ¥¡¥¤¥ë + .web Donald Knuth ¤Î WEB + .wml Web Meta Language ¤Î¥½¡¼¥¹¡¦¥Õ¥¡¥¤¥ë + .xbm X11 ¥Ó¥Ã¥È¥Þ¥Ã¥×¤Î¥½¡¼¥¹ + .xcf GIMP ¥°¥é¥Õ¥£¥Ã¥¯¡¦¥Õ¥¡¥¤¥ë + .xml XML (³ÈÄ¥µ­½Ò¸À¸ì)¥Õ¥¡¥¤¥ë + .xpm X11 ¥Ô¥¯¥¹¥Þ¥Ã¥×¤Î¥½¡¼¥¹ + .xs h2xs ¤ÇÀ¸À®¤µ¤ì¤ë Perl xsub ¥Õ¥¡¥¤¥ë + .xsl XSL ¥¹¥¿¥¤¥ë¥·¡¼¥È + .y \fByacc\fP(1) ¤Þ¤¿¤Ï \fBbison\fP(1) ¤Î¥Õ¥¡¥¤¥ë + .z \fBpack\fP(1) (¤Þ¤¿¤Ï¸Å¤¤ \fBgzip\fP(1)) ¤Ç°µ½Ì¤µ¤ì¤¿¥Õ¥¡¥¤¥ë + .zip \fBzip\fP(1) ¥¢¡¼¥«¥¤¥Ö + .zoo \fBzoo\fP(1) ¥¢¡¼¥«¥¤¥Ö + ~ Emacs ¤Þ¤¿¤Ï \fBpatch\fP(1) ¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×¡¦¥Õ¥¡¥¤¥ë + rc µ¯Æ°¥Õ¥¡¥¤¥ë (`run control') (Îã \fI.newsrc\fP) +.TE +.SH ½àµò +°ìÈÌŪ¤Ê Unix ¤ÎºîË¡¡£ +.SH ¥Ð¥° +¤³¤Î¥ê¥¹¥È¤Ï´°Á´¤Ç¤Ï¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR file (1), +.BR make (1) diff --git a/release/man7/svipc.7 b/release/man7/svipc.7 new file mode 100644 index 00000000..5ba2932c --- /dev/null +++ b/release/man7/svipc.7 @@ -0,0 +1,337 @@ +.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) +.\" +.\" 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 Wed Feb 11 21:29:14 JST 1998 +.\" by HANATAKA Shinya +.\" +.\"WORD: semaphore set ¥»¥Þ¥Õ¥©¡¼½¸¹ç +.\"WORD: shared memory segment ¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È +.\"WORD: message queue ¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼ +.\" +.\" FIXME There is now duplication of some of the information +.\" below in semctl.2, msgctl.2, and shmctl.2 -- MTK, Nov 04 +.TH SVIPC 7 2009-01-26 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +svipc \- System V ¥×¥í¥»¥¹´ÖÄÌ¿®µ¡¹½ +.SH ½ñ¼° +.nf +.B #include +.B #include +.B #include +.B #include +.B #include +.fi +.SH ÀâÌÀ +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸¤Ï System V ¥×¥í¥»¥¹´ÖÄÌ¿® +(interprocess communication; IPC) µ¡¹½¤Î Linux ¤Ë +¤ª¤±¤ë¼ÂÁõ¤òÀâÌÀ¤¹¤ë¡£ +¤³¤Î¥×¥í¥»¥¹´ÖÄÌ¿®µ¡¹½¤Ë¤Ï¡¢ +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼ (message queue)¡¢¥»¥Þ¥Õ¥©¡¼½¸¹ç (semaphore set)¡¢ +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È (shared memory segment) ¤Ê¤É¤¬¤¢¤ë¡£°Ê²¼¤Ç +.I "»ñ¸» (resource)" +¤È¤¤¤¦ÍѸì¤ò»ÈÍѤ·¤¿¾ì¹ç¤Ë¤Ï¤³¤ì¤é¤Îµ¡¹½¤Î¤É¤ì¤«¤ò°ÕÌ£¤¹¤ë¡£ +.SS »ñ¸»¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä +¥·¥¹¥Æ¥à¤Î¤½¤ì¤¾¤ì¤Î»ñ¸»¤Ï¡¢IPC ¤Ø¤ÎÁàºî¤òµö²Ä¤¹¤ë¤«¤É¤¦¤«¤ò·èÄꤹ¤ë +¤¿¤á¤Î¾ðÊó¤ò¶¦Ä̤ι½Â¤ÂÎ +.I "struct ipc_perm" +¤Ë³ÊǼ¤·¤Æ»ÈÍѤ¹¤ë¡£ +.I ipc_perm +¹½Â¤ÂΤϡ¢¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤Î +.I +¤ËÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢°Ê²¼¤Î¥á¥ó¥Ð¡¼¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë: +.in +4n +.nf + +struct ipc_perm { + uid_t cuid; /* ºîÀ®¼Ô¤Î¥æ¡¼¥¶¡¼ID */ + gid_t cgid; /* ºîÀ®¼Ô¤Î¥°¥ë¡¼¥×ID */ + uid_t uid; /* ½êÍ­¼Ô¤Î¥æ¡¼¥¶¡¼ID */ + gid_t gid; /* ½êÍ­¼Ô¤Î¥°¥ë¡¼¥×ID */ + unsigned short mode; /* Æɤ߽ñ¤­¤Îµö²Ä */ +}; +.fi +.in +.PP +.I ipc_perm +¹½Â¤ÂΤΠ+.I mode +¥á¥ó¥Ð¡¼¤Ï°Ê²¼¤Î 9 ¥Ó¥Ã¥È¤Ç¡¢¥×¥í¥»¥¹¤Î IPC ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë +¤Ë¤è¤ë»ñ¸»¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä¤òÄêµÁ¤¹¤ë¡£ +µö²Ä¤Ï°Ê²¼¤Î¤è¤¦¤Ë²ò¼á¤µ¤ì¤ë: +.sp +.nf + 0400 ¥æ¡¼¥¶¡¼¤Ë¤è¤ëÆɤ߹þ¤ß¡£ + 0200 ¥æ¡¼¥¶¡¼¤Ë¤è¤ë½ñ¤­¹þ¤ß¡£ +.sp .5 + 0040 ¥°¥ë¡¼¥×¤Ë¤è¤ëÆɤ߹þ¤ß¡£ + 0020 ¥°¥ë¡¼¥×¤Ë¤è¤ë½ñ¤­¹þ¤ß¡£ +.sp .5 + 0004 ¾¿Í¤Ë¤è¤ëÆɤ߹þ¤ß¡£ + 0002 ¾¿Í¤Ë¤è¤ë½ñ¤­¹þ¤ß¡£ +.fi +.PP +¥·¥¹¥Æ¥à¤Ï¥Ó¥Ã¥È 0100, 0010, 0001 (¼Â¹Ô¥Ó¥Ã¥È) ¤Ï»ÈÍѤ·¤Ê¤¤¡£ +¤µ¤é¤Ë¡¢¥»¥Þ¥Õ¥©¡¼¤Î¾ì¹ç¤Ë¤Ï +"½ñ¤­¹þ¤ß(write)" +¤Ï¼ÂºÝ¤Ë¤Ï +"Êѹ¹(alter)" +¤ò°ÕÌ£¤¹¤ë¡£ +.PP +Ʊ¤¸¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤Ë¤Ï°Ê²¼¤Î¥·¥ó¥Ü¥ë¤ÎÄêµÁ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë: +.TP 14 +.B IPC_CREAT +¥­¡¼(key)¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï¿·¤¿¤Ê¥¨¥ó¥È¥ê¤òºîÀ®¤¹¤ë¡£ +.TP +.B IPC_EXCL +¥­¡¼(key)¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¼ºÇÔ¤¹¤ë¡£ +.TP +.B IPC_NOWAIT +Í׵᤬ÂÔ¤¿¤µ¤ì¤ë¾ì¹ç¤Ë¤Ï¥¨¥é¡¼¤Ë¤Ê¤ë¡£ +.TP +.B IPC_PRIVATE +¥×¥é¥¤¥Ù¡¼¥È¡¦¥­¡¼¡£ +.TP +.B IPC_RMID +»ñ¸»¤òºï½ü¤¹¤ë¡£ +.TP +.B IPC_SET +»ñ¸»¤Ë¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¡£ +.TP +.B IPC_STAT +»ñ¸»¤Î¥ª¥×¥·¥ç¥ó¤ò¼èÆÀ¤¹¤ë¡£ +.PP +.B IPC_PRIVATE +¤Ï +.I key_t +·¿¤Ç¤¢¤ë¡£¤½¤Î¾¤ÎÁ´¤Æ¤Î¥·¥ó¥Ü¥ë¤Ï¥Õ¥é¥°¡¦¥Õ¥£¡¼¥ë¥É¤È¤·¤Æ +.I int +ÊÑ¿ô¤Ë OR ±é»»¤Ç³ÊǼ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SS ¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼ +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ÏÀµ¤ÎÀ°¿ô +.RI "(" msqid ) +¤Ë¤è¤Ã¤Æ¼±Ê̤µ¤ì¡¢ +.I +¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¹½Â¤ÂÎ +.IR "struct msqid_ds" +¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¥á¥ó¥Ð¡¼¤ò´Þ¤ó¤Ç¤¤¤ë: +.in +4n +.nf + +struct msqid_ds { + struct ipc_perm msg_perm; + msgqnum_t msg_qnum; /* ¥­¥å¡¼¤Ë¤¢¤ë¥á¥Ã¥»¡¼¥¸¤Î¿ô */ + msglen_t msg_qbytes; /* ¥­¥å¡¼¤ÎºÇÂç¥Ð¥¤¥È¿ô */ + pid_t msg_lspid; /* ºÇ¸å¤Ë msgsnd(2) ¤ò¤·¤¿ PID */ + pid_t msg_lrpid; /* ºÇ¸å¤Ë msgrcv(2) ¤ò¤·¤¿ PID */ + time_t msg_stime; /* ºÇ¸å¤Ë msgsnd(2) ¤ò¤·¤¿»þ´Ö */ + time_t msg_rtime; /* ºÇ¸å¤Ë msgrcv(2) ¤ò¤·¤¿»þ´Ö */ + time_t msg_ctime; /* ºÇ¸å¤ËÊѹ¹¤µ¤ì¤¿»þ´Ö */ +}; +.fi +.in +.TP 11 +.I msg_perm +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä¤ò»ØÄꤹ¤ë +.I ipc_perm +¹½Â¤ÂΡ£ +.TP +.I msg_qnum +¸½ºß¡¢¤³¤Î¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤Ë¤¢¤ë¥á¥Ã¥»¡¼¥¸¤Î¿ô¡£ +.TP +.I msg_qbytes +¥á¥Ã¥»¡¼¥¸¡¦¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¥á¥Ã¥»¡¼¥¸¤ÎºÇÂç¥Ð¥¤¥È¿ô¡£ +.TP +.I msg_lspid +ºÇ¸å¤Ë +.BR msgsnd (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤¿¥×¥í¥»¥¹¤Î ID¡£ +.TP +.I msg_lrpid +ºÇ¸å¤Ë +.BR msgrcv (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤¿¥×¥í¥»¥¹¤Î ID¡£ +.TP +.I msg_stime +ºÇ¸å¤Ë +.BR msgsnd (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤¿»þ´Ö¡£ +.I msg_rtime +ºÇ¸å¤Ë +.BR msgrcv (2) +¤ò¹Ô¤Ê¤Ã¤¿»þ´Ö¡£ +.TP +.I msg_ctime +ºÇ¸å¤Ë +.I msqid_ds +¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤¬Êѹ¹¤µ¤ì¤¿»þ´Ö¡£ +.SS ¥»¥Þ¥Õ¥©¡¼½¸¹ç +¥»¥Þ¥Õ¥©¡¼½¸¹ç¤ÏÀµ¤ÎÀ°¿ô +.RI "(" semid ) +¤Ë¤è¤Ã¤Æ¼±Ê̤µ¤ì¡¢ +.I +¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¹½Â¤ÂÎ +.IR "struct semid_ds" +¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¥á¥ó¥Ð¡¼¤ò´Þ¤ó¤Ç¤¤¤ë: +.in +4n +.nf + +struct semid_ds { + struct ipc_perm sem_perm; + time_t sem_otime; /* ºÇ¸å¤ËÁàºî¤·¤¿»þ´Ö */ + time_t sem_ctime; /* ºÇ¸å¤ËÊѹ¹¤·¤¿»þ´Ö */ + unsigned long sem_nsems; /* ½¸¹ç¤ÎÃæ¤Ë¤¢¤ë¥»¥Þ¥Õ¥©¡¼¿ô */ +}; +.fi +.in +.TP 11 +.I sem_perm +¥»¥Þ¥Õ¥©¡¼½¸¹ç¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä¤ò»ØÄꤹ¤ë +.I ipc_perm +¹½Â¤ÂΡ£ +.TP +.I sem_otime +ºÇ¸å¤Ë +.BR semop (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤¿»þ´Ö¡£ +.TP +.I sem_ctime +ºÇ¸å¤Ë +.BR semctl (2) +¤ò¹Ô¤Ê¤Ã¤Æ¾åµ­¤Î¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤òÊѹ¹¤¹¤ë¤«¡¢¥»¥Þ¥Õ¥©¡¼½¸¹ç¤Ë°¤¹¤ë +¥»¥Þ¥Õ¥©¡¼¤òÊѹ¹¤·¤¿»þ´Ö¡£ +.TP +.I sem_nsems +¥»¥Þ¥Õ¥©¡¼½¸¹ç¤ÎÃæ¤Ë¤¢¤ë¥»¥Þ¥Õ¥©¡¼¤Î¿ô¡£ +½¸¹ç¤ÎÃæ¤Ë¤¢¤ë¤½¤ì¤¾¤ì¤Î¥»¥Þ¥Õ¥©¡¼¤ÏÉé¤Ç¤Ê¤¤À°¿ô¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¡¢ +.B 0 +¤«¤é +.I sem_nsems\-1 +¤Þ¤Ç¤ÎÈÖ¹æ¤ò»ý¤Ä¡£ +.PP +¥»¥Þ¥Õ¥©¡¼¤Ï +.I "struct sem" +·¿¤Î¥Ç¡¼¥¿¹½Â¤ÂΤǤ¢¤ê¡¢°Ê²¼¤Î¥á¥ó¥Ð¡¼¤ò´Þ¤ó¤Ç¤¤¤ë: +.in +4n +.nf + +struct sem { + int semval; /* ¥»¥Þ¥Õ¥©¡¼¤ÎÃÍ */ + int sempid; /* ºÇ¸å¤ËÁàºî¤·¤¿¥×¥í¥»¥¹ ID */ +.\" unsigned short semncnt; /* semval ¤ÎÁý²Ã¤òÂԤĿô */ +.\" unsigned short semzcnt; /* semval = 0 ¤òÂԤĿô */ +}; +.fi +.in +.TP 11 +.I semval +¥»¥Þ¥Õ¥©¡¼ÃÍ: Éé¤Ç¤Ê¤¤À°¿ô¡£ +.TP +.I sempid +¤³¤Î¥»¥Þ¥Õ¥©¡¼¤òºÇ¸å¤ËÁàºî¤·¤¿¥×¥í¥»¥¹¤Î ID¡£ +.\".TP +.\".I semncnt +.\".I semval +.\"¤ÎÃͤ¬Áý²Ã¤¹¤ë¤òÂԤäÆÄä»ß¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î¿ô¡£ +.\".TP +.\".I semznt +.\".I semval +.\"¤¬ 0 ¤Ë¤Ê¤ë¤Î¤òÂԤäÆÄä»ß¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î¿ô¡£ +.SS ¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥È¤ÏÀµ¤ÎÀ°¿ô +.RI "(" shmid ) +¤Ë¤è¤Ã¤Æ¼±Ê̤µ¤ì¡¢ +.I +¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë +.IR "struct shmid_ds" +¹½Â¤ÂΤ˷ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¥á¥ó¥Ð¡¼¤ò´Þ¤ó¤Ç¤¤¤ë: +.in +4n +.nf + +struct shmid_ds { + struct ipc_perm shm_perm; + size_t shm_segsz; /* ¥»¥°¥á¥ó¥È¤Î¥µ¥¤¥º */ + pid_t shm_cpid; /* ºîÀ®¼Ô¤Î¥×¥í¥»¥¹ ID */ + pid_t shm_lpid; /* ºÇ¸å¤ËÁàºî¤·¤¿¥×¥í¥»¥¹ ID */ + shmatt_t shm_nattch; /* ¸½ºß¡¢Éղ䷤Ƥ¤¤ë¿ô */ + time_t shm_atime; /* ºÇ¸å¤ËÉղä·¤¿»þ´Ö */ + time_t shm_dtime; /* ºÇ¸å¤ËʬΥ¤·¤¿»þ´Ö */ + time_t shm_ctime; /* ºÇ¸å¤ËÊѹ¹¤·¤¿»þ´Ö */ +}; +.fi +.in +.TP 11 +.I shm_perm +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Ø¤Î¥¢¥¯¥»¥¹µö²Ä¤ò»ØÄꤷ¤¿ +.I ipc_perm +¹½Â¤ÂΡ£ +.TP +.I shm_segsz +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Î¥Ð¥¤¥È¿ô¡£ +.TP +.I shm_cpid +¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤òºîÀ®¤·¤¿¥×¥í¥»¥¹¤Î ID¡£ +.TP +.I shm_lpid +ºÇ¸å¤Ë +.BR shmat (2) +¤Þ¤¿¤Ï +.BR shmdt (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¼Â¹Ô¤·¤¿¥×¥í¥»¥¹¤Î ID¡£ +.TP +.I shm_nattch +¤³¤Î¶¦Í­¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ò¥á¥â¥ê¤ËÉղà (attach) ¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î¿ô¡£ +.TP +.I shm_atime +ºÇ¸å¤Ë +.BR shmat (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤¿»þ´Ö¡£ +.TP +.I shm_dtime +ºÇ¸å¤Ë +.BR shmdt (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤¿»þ´Ö¡£ +.TP +.I shm_ctime +ºÇ¸å¤Ë +.BR shmctl (2) +¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤Ê¤Ã¤Æ¡¢ +.I shmid_ds +¹½Â¤ÂΤòÊѹ¹¤·¤¿»þ´Ö¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ipc (2), +.BR msgctl (2), +.BR msgget (2), +.BR msgrcv (2), +.BR msgsnd (2), +.BR semctl (2), +.BR semget (2), +.BR semop (2), +.BR shmat (2), +.BR shmctl (2), +.BR shmdt (2), +.BR shmget (2), +.BR ftok (3) diff --git a/release/man7/tcp.7 b/release/man7/tcp.7 new file mode 100644 index 00000000..94470840 --- /dev/null +++ b/release/man7/tcp.7 @@ -0,0 +1,1132 @@ +.\" This man page is Copyright (C) 1999 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. +.\" +.\" 2.4 Updates by Nivedita Singhvi 4/20/02 . +.\" Modified, 2004-11-11, Michael Kerrisk and Andries Brouwer +.\" Updated details of interaction of TCP_CORK and TCP_NODELAY. +.\" +.\" 2008-11-21, mtk, many, many updates. +.\" The descriptions of /proc files and socket options should now +.\" be more or less up to date and complete as at Linux 2.6.27 +.\" (other than the remaining FIXMEs in the page source below). +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2002-11-15, NAKANO Takeo +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" Updated 2005-09-07, Akihiro MOTOKI +.\" Updated 2005-12-26, Akihiro MOTOKI +.\" Updated 2006-07-19, Akihiro MOTOKI, LDP v2.36 +.\" Updated 2008-08-07, Akihiro MOTOKI, LDP v3.05 +.\" Updated 2008-12-31, Akihiro MOTOKI, LDP v3.15 +.\" Updated 2009-03-01, Akihiro MOTOKI, LDP v3.19 +.\" +.\"WORD full duplex connection Á´Æó½ÅÄÌ¿® +.\"WORD listening state ÀܳÂÔ¤Á¼õ¤±¾õÂÖ +.\"WORD denial of service attack DoS ¹¶·â +.\"WORD urgent data ¶ÛµÞ¥Ç¡¼¥¿ +.\" +.TH TCP 7 2009-09-30 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +tcp \- TCP ¥×¥í¥È¥³¥ë +.SH ½ñ¼° +.B #include +.br +.B #include +.br +.B #include +.sp +.B tcp_socket = socket(AF_INET, SOCK_STREAM, 0); +.SH ÀâÌÀ +¤³¤ì¤Ï RFC\ 793, RFC\ 1122, RFC\ 2001 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë TCP ¥×¥í¥È¥³¥ë¤ò +NewReno ³ÈÄ¥¤È SACK ³ÈÄ¥¤ò´Þ¤á¤Æ¼ÂÁõ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ +TCP ¤Ï¡¢ +.BR ip (7) +¾å¤ÎÆó¤Ä¤Î¥½¥±¥Ã¥È´Ö¤Ë¡¢¿®ÍêÀ­¤Î¹â¤¤¡¢¥¹¥È¥ê¡¼¥à»Ø¸þ¤ÎÁ´Æó½Å +(full-duplex) ÄÌ¿®¤òÄ󶡤¹¤ë¡£ +v4 ¤È v6 ¤ÎξÊý¤Î¥Ð¡¼¥¸¥ç¥ó¤Î +.BR ip (7) +¤ËÂбþ¤·¤Æ¤¤¤ë¡£ +TCP ¤Ï¡¢¥Ç¡¼¥¿¤¬½ç½ø¤ò¼é¤Ã¤ÆÅþÃ夹¤ë¤³¤È¡¢ÅÓÃæ¤Ç¼º¤ï¤ì¤¿¥Ñ¥±¥Ã¥È¤¬ +ºÆÁ÷¤µ¤ì¤ë¤³¤È¤òÊݾڤ¹¤ë¡£¤Þ¤¿¡¢¥Ñ¥±¥Ã¥Èñ°Ì¤Ë¥Á¥§¥Ã¥¯¥µ¥à¤ò +À¸À®¡¢¸¡ºº¤¹¤ë¤³¤È¤Ç¡¢Å¾Á÷¥¨¥é¡¼¤ò¸¡ÃΤ¹¤ë¡£ +TCP ¤Ï¥ì¥³¡¼¥É¶­³¦ (record boundary) ¤òÊݸ¤·¤Ê¤¤¡£ + +¿·¤·¤¯À¸À®¤µ¤ì¤¿¤Ð¤«¤ê¤Î TCP ¥½¥±¥Ã¥È¤Ï¡¢ +¥ê¥â¡¼¥È¥¢¥É¥ì¥¹¤«¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤¬¤Ê¤¯¡¢ +¤·¤¿¤¬¤Ã¤Æ¾ÜºÙ¤¬´°Á´¤Ë»ØÄꤵ¤ì¤¿¾õÂ֤ǤϤʤ¤¡£ +³°Éô¤Ø¤Î TCP Àܳ¤òÀ¸À®¤¹¤ë¤Ë¤Ï¡¢ +.BR connect (2) +¤òÍѤ¤¤Æ¤â¤¦°ìÊý¤Î TCP ¥½¥±¥Ã¥È¤Ø¤ÎÀܳ¤ò³ÎΩ¤¹¤ë¡£ +³°Éô¤«¤é¤Î¿·¤¿¤ÊÀܳ¤ò¼õ¤±¤ë¤Ë¤Ï¡¢¤Þ¤º +.BR bind (2) +¤Ç¥½¥±¥Ã¥È¤ò¥í¡¼¥«¥ë¤Ê¥¢¥É¥ì¥¹¤È¥Ý¡¼¥È¤Ë·ë¤Ó¤Ä¤±¡¢¼¡¤Ë +.BR listen (2) +¤ò¸Æ¤ó¤Ç¥½¥±¥Ã¥È¤òÀܳÂÔ¤Á¼õ¤±¾õÂ֤ˤ¹¤ë¡£ +¤½¤Î¸å¡¢ÅþÃ夷¤¿ÀܳÍ×µá¤ËÂФ·¤Æ +.BR accept (2) +¤òÍѤ¤¡¢¥½¥±¥Ã¥È¤ò¿·¤·¤¯À¸À®¤¹¤ë¡£ +.BR accept (2) +¤Þ¤¿¤Ï +.BR connect (2) +¤Î¥³¡¼¥ë¤¬À®¸ù¤·¤¿¥½¥±¥Ã¥È¤Ï¡¢¾ÜºÙ¤¬´°Á´¤Ë»ØÄꤵ¤ì¤¿¾õÂ֤Ȥʤꡢ +¥Ç¡¼¥¿¤Î¤ä¤ê¤È¤ê¤¬²Äǽ¤È¤Ê¤ë¡£ÀܳÂÔ¤Á¼õ¤±¾õÂ֤Π(listening) ¥½¥±¥Ã¥È¤ä¡¢ +Àܳ (connect) ¤µ¤ì¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¤òÄ̤·¤Æ¥Ç¡¼¥¿¤ò¤ä¤ê¤È¤ê¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ + +Linux ¤Ï RFC\ 1323 ¤Î TCP high performance ³ÈÄ¥¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤Ë¤Ï¡¢Protection Against Wrapped Sequence Numbers (PAWS)¡¢ +¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¡¢¥¿¥¤¥à¥¹¥¿¥ó¥×¤Ê¤É¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¤òÍøÍѤ¹¤ë¤È¡¢ÃÙ±ä¤Þ¤¿¤ÏÂÓ°è¤ÎÂ礭¤ÊÀܳ¤Ç¡¢ +(64K °Ê¾å¤Î) µðÂç¤Ê TCP ¥¦¥£¥ó¥É¥¦¤òÍѤ¤¤ë¤³¤È¤¬²Äǽ¤È¤Ê¤ë¡£ +¤³¤ì¤òÍѤ¤¤ë¤Ë¤Ï¡¢Á÷¼õ¿®¤Î¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤òÂ礭¤¯¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥·¥¹¥Æ¥àÁ´ÂΤËÂФ¹¤ë¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ÎÊѹ¹¤Ï¡¢¥Õ¥¡¥¤¥ë +.I /proc/sys/net/ipv4/tcp_wmem +¤È +.I /proc/sys/net/ipv4/tcp_rmem +¤òÍѤ¤¤Æ¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤Þ¤¿¡¢¸Ä¡¹¤Î¥½¥±¥Ã¥È¤Î¤ß¤òÂ礭¤¯¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ +.B SO_SNDBUF +¤ä +.B SO_RCVBUF +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤Æ +.BR setsockopt (2) +¥³¡¼¥ë¤òÍѤ¤¤ÆÀßÄꤹ¤ì¤Ð¤è¤¤¡£ + +.B SO_SNDBUF +¤ä +.B SO_RCVBUF +¤Î¥á¥«¥Ë¥º¥à¤ÇÀë¸À¤µ¤ì¤ë¥½¥±¥Ã¥È¥Ð¥Ã¥Õ¥¡¤ÎºÇÂ祵¥¤¥º¤Ï¡¢¥Õ¥¡¥¤¥ë +.I /proc/sys/net/core/rmem_max +¤ä +.I /proc/sys/net/core/wmem_max +¤Ç»ØÄꤵ¤ì¤¿¥·¥¹¥Æ¥à¤È¤·¤Æ¤ÎÀ©¸ÂÃͤòĶ¤¨¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ +TCP ¤Ï¼ÂºÝ¤Ë¤Ï +.BR setsockopt (2) +¥³¡¼¥ë¤¬Í׵ᤷ¤¿¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ÎÆóÇܤò³ä¤êÅö¤Æ¤ë¡£ +¤½¤Î¤¿¤á¡¢¤³¤Î¸å¤Ç +.BR getsockopt (2) +¥³¡¼¥ë¤ò¹Ô¤¦¤È¡¢ +.BR setsockopt (2) +¤ÇÍ׵ᤷ¤¿¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤È¤Ï°Û¤Ê¤ëÃͤ¬Ê֤롣 +TCP ¤Ï¤³¤Î;ʬ¤Ê¶õ´Ö¤ò¡¢´ÉÍýÌÜŪ¤ä¥«¡¼¥Í¥ëÆâÉô¤Î¹½Â¤ÂΤËÍѤ¤¤Æ¤¤¤ë¡£ +.I /proc +¥Õ¥¡¥¤¥ë¤ÎÃͤϡ¢¤³¤ì¤é¤òÈ¿±Ç¤·¡¢¼ÂºÝ¤Î TCP ¥¦¥£¥ó¥É¥¦¤è¤ê¤âÂ礭¤ÊÃͤȤʤ롣 +³ÆÀܳ¤Ë¤ª¤±¤ë¥½¥±¥Ã¥È¤Î¥Ð¥Ã¥Õ¥¡¥µ¥¤¥ºÊѹ¹¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢ +.BR listen (2) +¤ä +.BR connect (2) +¥³¡¼¥ë¤ÎÁ°¤ËÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR socket (7) +¤ò¸«¤è¡£ +.PP +TCP ¤Ï¶ÛµÞ¥Ç¡¼¥¿ (urgent data) ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£¶ÛµÞ¥Ç¡¼¥¿¤Ï +²¿¤é¤«¤Î½ÅÍפʥá¥Ã¥»¡¼¥¸¤¬¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥à¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤³¤È¡¢ +¤½¤Î¥Ç¡¼¥¿¤ò¤Ç¤­¤ë¤À¤±Á᤯½èÍý¤¹¤Ù¤­¤³¤È¡¢¤ò¼õ¿®¼Ô¤ËÅÁ¤¨¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +¶ÛµÞ¥Ç¡¼¥¿¤òÁ÷¤ë¤Ë¤Ï¡¢ +.BR send (2) +¤Ë +.B MSG_OOB +¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¡£ +¶ÛµÞ¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï +.B SIGURG +¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ë¡£Á÷¿®Àè¤Ï +.B SIOCSPGRP +¤ä +.B FIOSETOWN +ioctl (¤ä POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë +.BR fcntl (2) +.B F_SETOWN +Áàºî) ¤òÍѤ¤¤Æ¤½¤Î¥½¥±¥Ã¥È¤Î¡Ö½êÍ­¼Ô¡×¤È¤·¤ÆÀßÄꤵ¤ì¤¿ +¥×¥í¥»¥¹¤«¥×¥í¥»¥¹¥°¥ë¡¼¥×¤Ç¤¢¤ë¡£ +.B SO_OOBINLINE +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¶ÛµÞ¥Ç¡¼¥¿¤Ï +Ä̾ï¤Î¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥à¤ÎÃæ¤Ëº®¤¼¤ÆÁ÷¤é¤ì¤ë (¥×¥í¥°¥é¥à¤Ï²¼µ­¤Î +.B SIOCATMARK +ioctl ¤ò»È¤Ã¤Æ¶ÛµÞ¥Ç¡¼¥¿¤Î¾ì½ê¤òÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë)¡£ +̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +.BR recv (2) +¤ä +.BR recvmsg (2) +¤Ç +.B MSG_OOB +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ë¤Î¤ß¡¢¶ÛµÞ¥Ç¡¼¥¿¤ò¼õ¿®¤Ç¤­¤ë¡£ + +Linux 2.4 ¤Ç¤Ï¿¤¯¤ÎÊѹ¹¤¬¤Ê¤µ¤ì¡¢ +¥¹¥ë¡¼¥×¥Ã¥È¤È¥¹¥±¡¼¥ê¥ó¥°¤¬¸þ¾å¤·¡¢µ¡Ç½¤â¹â¤Þ¤Ã¤¿¡£ +¤³¤ì¤é¤Îµ¡Ç½¤Ë¤Ï¡¢¥¼¥í¥³¥Ô¡¼ +.BR sendfile (2)¡¢ +Explicit Congestion Notification¡¢ +TIME_WAIT ¥½¥±¥Ã¥È¤Î¿·¤·¤¤´ÉÍýË¡¡¢ +keep-alive ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¡¢ +Duplicate SACK ³ÈÄ¥¤Î¥µ¥Ý¡¼¥È¤Ê¤É¤¬¤¢¤ë¡£ +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +TCP ¤Ï IP ¤Î¾åÁؤ˹½ÃÛ¤µ¤ì¤Æ¤¤¤ë +.RB ( ip (7) +¤ò»²¾È)¡£ +.BR ip (7) +¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï TCP ¤Ë¤âŬÍѤµ¤ì¤ë¡£ +TCP ¤Ï point-to-point ¤ÎÄÌ¿®¤À¤±¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +¥Ö¥í¡¼¥É¥­¥ã¥¹¥È¤ä¥Þ¥ë¥Á¥­¥ã¥¹¥È¤Ï¥µ¥Ý¡¼¥È¤·¤Ê¤¤¡£ +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +¥·¥¹¥Æ¥àÁ´ÂΤËÂФ¹¤ë TCP ¥Ñ¥é¥á¡¼¥¿¤ÎÀßÄê¤Ë¤Ï¡¢ +.I /proc/sys/net/ipv4/ +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤Ë¤è¤ê¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +¤µ¤é¤Ë¡¢IP ¤Ë´ØÏ¢¤¹¤ë +.I /proc +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¤Û¤È¤ó¤É¤Ï TCP ¤Ë¤Ä¤¤¤Æ¤âŬÍѤµ¤ì¤ë¡£ +.BR ip (7) +¤ò»²¾È¤Î¤³¤È¡£ +.I Boolean +¤ÏÀ°¿ôÃͤǡ¢ +0 °Ê³°¤ÎÃÍ ("true") ¤ÏÂбþ¤¹¤ë¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¡¢ +0 ÃÍ ("false") ¤Ï̵¸ú¡¢¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.TP +.IR tcp_abc " (Integer; default: 0; Linux 2.6.15 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +RFC 3465 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë Appropriate Byte Count (ABC) ¤òÀ©¸æ¤¹¤ë¡£ +ABC ¤Ï¡¢ÉôʬŪ¤Ê ACK ¤Ë±þ¤¸¤¿íÕíÔ¥¦¥£¥ó¥É¥¦ +.RI ( cwnd ) +¤ÎÁý²Ã¤ò¤è¤ê´Ë¤ä¤«¤Ë¤¹¤ëÊýË¡¤Ç¤¢¤ë¡£ +°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤­¤ë¡£ +.RS +.IP 0 3 +ACK ¤ò¼õ¿®¤¹¤ëËè¤Ë +.I cwnd +¤òÁý¤ä¤¹ (ABC ¤Ê¤·)¡£ +.IP 1 +¥Õ¥ë¥µ¥¤¥º¤Î¥»¥°¥á¥ó¥È¤Î ACK ¤ò¼õ¿®¤¹¤ëËè¤Ë +.I cwnd +¤òÁý¤ä¤¹¡£ +.IP 2 +ACK ¤¬ÃÙ±ä ACK (delayed acknowledgment) ¤òÁ껦¤¹¤ë¤¿¤á¤Î 2 ¥»¥°¥á¥ó¥È¤Ë +ÂФ¹¤ë ACK ¤Î¾ì¹ç¤Ë¡¢ +.I cwnd +¤ò 2 Áý¤ä¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.RE +.TP +.IR tcp_abort_on_overflow " (Boolean; default: disabled; Linux 2.4 °Ê¹ß)" +.\" Since 2.3.41 +Àܳ¤òÂÔ¤Á¼õ¤±¤Æ¤¤¤ë¥µ¡¼¥Ó¥¹¤¬ÃÙ¤¹¤®¤Æ¡¢¼õ¿®¤Ë¤Ä¤¤¤Æ¤¤¤±¤Ê¤¤¾ì¹ç¤Ë¡¢ +Àܳ¤ò¥ê¥»¥Ã¥È¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +¤³¤ì¤òÍѤ¤¤ë¤È¡¢¥Ð¡¼¥¹¥È¤Ë¤è¤Ã¤Æ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬µ¯¤³¤Ã¤¿¤È¤­¤Ë¡¢ +Àܳ¤ò²óÉü¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Î¤Ï¡¢ +¼õ¿®¥Ç¡¼¥â¥ó¤ò¹â®²½¤Ç¤­¤Ê¤¤¾ì¹ç¤Ë¡Ö¸ÂÄꤹ¤ë¡×¤³¤È¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È¡¢¤½¤Î¥µ¡¼¥Ð¤ËÀܳ¤·¤Æ¤¤¤ë¥¯¥é¥¤¥¢¥ó¥È +¤Ë¤È¤Ã¤Æ¤Ï³²¤Ë¤Ê¤ë¤³¤È¤¬¤¢¤ë¡£ +.TP +.IR tcp_adv_win_scale " (integer; default: 2; Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤Î·×»»ÊýË¡¤ò¡¢ +.I tcp_adv_win_scale +¤¬Àµ¤Î¾ì¹ç¤Ï +.I "bytes/2^tcp_adv_win_scale" +¤Ë¡¢ +.I tcp_adv_win_scale +¤¬É餫 0 ¤Î¾ì¹ç¤Ï +.I "bytes-bytes/2^(\-tcp_adv_win_scale)" +¤È¤¹¤ë¡£ + +¥½¥±¥Ã¥È¤Î¼õ¿®¥Ð¥Ã¥Õ¥¡¶õ´Ö¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È¥«¡¼¥Í¥ë¤Ç¶¦Í­¤µ¤ì¤ë¡£ +TCP ¤Ï¥Ð¥Ã¥Õ¥¡¤Î°ìÉô¤ò TCP ¥¦¥£¥ó¥É¥¦¤È¤·¤Æ´ÉÍý¤·¡¢ +¤³¤ì¤ò¼õ¿®¥¦¥£¥ó¥É¥¦¤È¤·¤ÆÀܳ¤Î¾ü¤ËÄÌÃΤ¹¤ë¡£ +¶õ´Ö¤Î»Ä¤ê¤Ï¡Ö¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¡×¥Ð¥Ã¥Õ¥¡¤È¤·¤ÆÍѤ¤¤é¤ì¡¢ +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ä¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÃٱ䤫¤é¥Í¥Ã¥È¥ï¡¼¥¯¤ò³ÖÎ¥¤¹¤ë¡£ +.I tcp_adv_win_scale +¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 2 ¤Ç¤¢¤ê¡¢ +¤³¤Î¾ì¹ç¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ð¥Ã¥Õ¥¡¤ÏÁ´ÂΤΠ1/4 ¤Ë¤Ê¤ë¡£ +.TP +.IR tcp_allowed_congestion_control " (String; default: see text; Linux 2.4.20 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +ÈóÆø¢¥×¥í¥»¥¹¤ÇÍøÍѤǤ­¤ëíÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤ÎÁªÂò»è¤òɽ¼¨/ÀßÄꤹ¤ë +.RB ( TCP_CONGESTION +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È)¡£ +¤³¤Î¥ê¥¹¥È¤Ï +.I tcp_available_congestion_control +¤Çɽ¼¨¤µ¤ì¤ë¥ê¥¹¥È¤ÎÉôʬ½¸¹ç¤È¤Ê¤ë¡£ +.\" FIXME How are the items in this delimited? Null bytes, spaces, commas? +¤³¤Î¥ê¥¹¥È¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤϡ¢"reno" ¤È +.I tcp_congestion_control +¤Î¥Ç¥Õ¥©¥ë¥ÈÀßÄê¤ò¤¢¤ï¤»¤¿¤â¤Î¤È¤Ê¤ë¡£ +.TP +.IR tcp_available_congestion_control " (String; read-only; Linux 2.4.20 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëíÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤Î¥ê¥¹¥È¤òɽ¼¨¤¹¤ë¡£ +.\" FIXME How are the items in this delimited? Null bytes, spaces, commas? +¤³¤Î¥ê¥¹¥È¤ËºÜ¤Ã¤Æ¤¤¤ë¤â¤Î¤À¤±¤¬¡¢ +.I tcp_allowed_congestion_control +¤Ëɽ¼¨¤µ¤ì¤ë¡£ +¾¤ÎíÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤¬¥â¥¸¥å¡¼¥ë¤È¤·¤ÆÍøÍѲÄǽ¤À¤¬¡¢ +¥â¥¸¥å¡¼¥ë¤¬¥í¡¼¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤â¤¢¤ë¡£ +.TP +.IR tcp_app_win " (integer; default: 31; Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +¤³¤ÎÊÑ¿ô¤Ï¡¢TCP ¥¦¥£¥ó¥É¥¦¤Î²¿¥Ð¥¤¥Èʬ¤ò +¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥ÉÍѤËͽÌ󤹤뤫¤ò»ØÄꤹ¤ë¡£ + +¤½¤Î¥¦¥£¥ó¥É¥¦¤Î \fIwindow/2^tcp_app_win\fP ¤È mss ¤ÎÂ礭¤¤¤Û¤¦ (¥Ð¥¤¥Èñ°Ì) +¤¬¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ð¥Ã¥Õ¥¡¤È¤·¤ÆͽÌ󤵤ì¤ë¡£ +0 ¤ò»ØÄꤹ¤ë¤È°ìÀÚͽÌóÎΰè¤ò¼è¤é¤Ê¤¤¡£ +.\" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_base_mss " (Integer; default: 512; Linux 2.6.17 °Ê¹ß)" +¥Ñ¥±¥Ã¥È²½¥ì¥¤¥ä¤Î Path MTU discovery (MTU probing) ¤Ç¡¢ +.I search_low +¤Î½é´üÃͤȻÈÍѤµ¤ì¤ëÃÍ¡£ +MTU probing ¤¬Í­¸ú¤Ê¾ì¹ç¡¢¤³¤ÎÃͤϤ½¤ÎÀܳ¤Î MSS ¤Î½é´üÃͤȤʤ롣 +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_bic " (Boolean; default: disabled; Linux 2.4.27/2.6.6 ¤«¤é 2.6.13 ¤Þ¤Ç)" +BIC TCP íÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤òÍ­¸ú¤Ë¤¹¤ë¡£ +BIC-TCP ¤ÏÁ÷¿®Â¦¤Î¤ß¤ÎÊѹ¹¤Ç¡¢ +¥¹¥±¡¼¥é¥Ó¥ê¥Æ¥£¤È TCP ¿ÆÏÂÀ­ (friendliness) ¤ÎξÊý¤òÄ󶡤·¤Ä¤Ä¡¢ +Â礭¤Ê¥¦¥£¥ó¥É¥¦¤Î²¼¤Ç¤ÎÀþ·Á¤Ê RTT ¸øÊ¿À­¤òÊݾڤ¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î¥×¥í¥È¥³¥ë¤Ç¤Ï additive increase (ÄɲÃŪ¤ÊÁý²Ã) ¤È +binary search increase (Æóʬõº÷Áý²Ã) ¤È¤¤¤ï¤ì¤ëÆó¤Ä¤Î»ÅÁȤߤò +ÁȤ߹ç¤ï¤»¤Æ¤¤¤ë¡£íÕíÔ¥¦¥£¥ó¥É¥¦¤¬Â礭¤¤¤È¤­¤Ï¡¢Áýʬ¤ÎÂ礭¤¤ +additive increase ¤Ë¤è¤ê¡¢¥¹¥±¡¼¥é¥Ó¥ê¥Æ¥£¤ò³ÎÊݤ·¤Ê¤¬¤é +Àþ·Á¤Ê RTT ¸øÊ¿À­¤òÊݾڤ¹¤ë¡£ +íÕíÔ¥¦¥£¥ó¥É¥¦¤¬¾®¤µ¤¤¤È¤­¤Ë¤Ï binary search increase ¤Ë¤è¤ê +TCP ¿ÆÏÂÀ­¤òãÀ®¤·¤Æ¤¤¤ë¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_bic_low_window " (integer; default: 14; Linux 2.4.27/2.6.6 °Ê¹ß 2.6.13 ¤Þ¤Ç)" +BIC TCP ¤¬íÕíÔ¥¦¥£¥ó¥É¥¦¤ÎÄ´À°¤ò³«»Ï¤¹¤ëïçÃÍ¥¦¥£¥ó¥É¥¦ (¥Ñ¥±¥Ã¥Èñ°Ì) +¤òÀßÄꤹ¤ë¡£¤³¤ÎïçÃͤò²¼²ó¤ë¾ì¹ç¡¢BIC TCP ¤Ï¥Ç¥Õ¥©¥ë¥È¤Î TCP Reno ¤È +Ʊ¤¸Æ°ºî¤ò¤¹¤ë¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_bic_fast_convergence " (Boolean; default: enabled; Linux 2.4.27/2.6.6 °Ê¹ß 2.6.13 ¤Þ¤Ç)" +BIC TCP ¤¬íÕíÔ¥¦¥£¥ó¥É¥¦¤ÎÊѲ½¤Ë¤è¤ê®¤¯È¿±þ¤¹¤ë¤è¤¦¤Ë¤¹¤ë¡£ +Ʊ¤¸¥³¥Í¥¯¥·¥ç¥ó¤ò¶¦Í­¤¹¤ëÆó¤Ä¤Î¥Õ¥í¡¼¤¬°ì¤Ä¤Ë¤Þ¤È¤Þ¤ë¤Î¤ò +¤è¤ê®¤¯¹Ô¤¦¤è¤¦¤Ë¤¹¤ë¡£ +.TP +.IR tcp_congestion_control " (String; default: ÀâÌÀ»²¾È; Linux 2.4.13 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +¿·µ¬¤ÎÀܳ¤Ç»ÈÍѤµ¤ì¤ë¥Ç¥Õ¥©¥ë¥È¤ÎíÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤òÀßÄꤹ¤ë¡£ +"reno" ¥¢¥ë¥´¥ê¥º¥à¤Ï¾ï¤ËÍøÍѲÄǽ¤À¤¬¡¢ +¥«¡¼¥Í¥ëÀßÄ꼡Âè¤Ç¤ÏÊ̤ÎÁªÂò»è¤¬ÍøÍѤǤ­¤ë¤³¤È¤â¤¢¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤϥ«¡¼¥Í¥ëÀßÄê¤Î°ì¤Ä¤È¤·¤ÆÀßÄꤵ¤ì¤ë¡£ +.TP +.IR tcp_dma_copybreak " (integer; default: 4096; Linux 2.6.24 °Ê¹ß)" +¥·¥¹¥Æ¥à¤Ë DMA ¥³¥Ô¡¼¥¨¥ó¥¸¥ó¤¬Â¸ºß¤·¡¢¥«¡¼¥Í¥ë¤Ç +.B CONFIG_NET_DMA +¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ +DMA ¥³¥Ô¡¼¥¨¥ó¥¸¥ó¤Ë¥ª¥Õ¥í¡¼¥É¤µ¤ì¤ë¥½¥±¥Ã¥È¤ÎÆɤ߹þ¤ß¥µ¥¤¥º¤Î²¼¸ÂÃÍ +(¥Ð¥¤¥Èñ°Ì)¡£ +.TP +.IR tcp_dsack " (Boolean; default: enabled; Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +RFC\ 2883 ¤Î TCP Duplicate SACK ¤Î¥µ¥Ý¡¼¥È¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.IR tcp_ecn " (Boolean; default: disabled; Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +RFC\ 2884 ¤Î Explicit Congestion Notification ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤ì¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢´Ö°ã¤Ã¤¿¿¶Éñ¤¤¤ò¤¹¤ë¸Å¤¤¥ë¡¼¥¿¤¬ +·ÐÏ©¤ÎÅÓÃæ¤Ë¤¢¤ë¤è¤¦¤ÊÀܳÀè¤ËÂФ·¤Æ±Æ¶Á¤¬À¸¤¸¡¢ +¾ì¹ç¤Ë¤è¤Ã¤Æ¤ÏÀܳ¤¬Íî¤Á¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.IR tcp_fack " (Boolean; default: enabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.92 +TCP Forward Acknowledgement ¤Î¥µ¥Ý¡¼¥È¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.IR tcp_fin_timeout " (integer; default: 60; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.53 +¥½¥±¥Ã¥È¤ò¶¯À©Åª¤Ë¥¯¥í¡¼¥º¤¹¤ëÁ°¤Ë¡¢ +ºÇ¸å¤Î FIN ¥Ñ¥±¥Ã¥È¤òÂԤĻþ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ +¤³¤ì¤Ï¸·Ì©¤Ë¤Ï TCP ¤Î»ÅÍͤòËþ¤¿¤·¤Æ¤¤¤Ê¤¤¤¬¡¢ +DoS ¹¶·â (denial of service attack) ¤«¤é¿È¤ò¼é¤ë¤¿¤á¤ËɬÍפǤ¢¤ë¡£ +Linux 2.2 ¤Ç¤Ï¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 180 ¤Ç¤¢¤Ã¤¿¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_frto " (integer; default: 0; Linux 2.4.21/2.6 °Ê¹ß)" +.\" Since 2.4.21/2.5.43 +F-RTO ¤òÍ­¸ú¤Ë¤¹¤ë¡£F-RTO ¤Ï TCP ºÆÁ÷¥¿¥¤¥à¥¢¥¦¥È (RTO) ¤«¤é¤Î +ÉüµìÀ­Ç½¤ò¸þ¾å¤µ¤»¤¿¥¢¥ë¥´¥ê¥º¥à¤Ç¤¢¤ë¡£ +¤³¤Îµ¡Ç½¤Ï̵Àþ´Ä¶­¤ÇÆä˸ú²Ì¤òȯ´ø¤¹¤ë¡£ +̵Àþ´Ä¶­¤Ç¤Ï¡¢Ä̾ï¤Ï¡¢Ãæ´Ö¥ë¡¼¥¿¤ÎíÕíԤǤϤʤ¯¥é¥ó¥À¥à¤Ê̵Àþ¤Î´³¾Ä +¤Ë¤è¤ê¥Ñ¥±¥Ã¥È¥í¥¹¤¬È¯À¸¤¹¤ë¡£ +¾ÜºÙ¤Ï RFC\ 4138 ¤ò»²¾È¡£ + +¤³¤Î¥Õ¥¡¥¤¥ë¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤ÎÃͤò¼è¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.RS +.IP 0 3 +F-RTO ¤ò̵¸ú¤Ë¤¹¤ë¡£ +.IP 1 +´ðËÜÈǤΠF-RTO ¥¢¥ë¥´¥ê¥º¥à¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.IP 2 +¤½¤Î¥Õ¥í¡¼¤Ç SACK ¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢SACK ³ÈÄ¥ÈǤΠF-RTO ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +´ðËÜÈǤΠF-RTO ¤â SACK ¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤â»ÈÍѤǤ­¤ë¤¬¡¢ +´ðËÜÈǤξì¹ç¤Ë¤Ï F-RTO ¤¬ SACK ¤¬Í­¸ú¤Ë¤Ê¤Ã¤¿ TCP ¥Õ¥í¡¼¤Ç¤Î +¥Ñ¥±¥Ã¥È¿ô·×¬¤È¡¢ÁêÀ­¤¬°­¤¯Áê¸ß´³¾Ä¤¬µ¯¤³¤ë¾ìÌ̤¬Â¸ºß¤¹¤ë¡£ +.RE +.IP +Linu 2.6.22 ¤è¤êÁ°¤Ç¤Ï¡¢¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¥Ö¡¼¥ëÃͤǤ¢¤ê¡¢ +¾åµ­¤Î 0 ¤È 1 ¤Î¤ß¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤¿¡£ +.TP +.IR tcp_frto_response " (integer; default: 0; Linux 2.6.22 °Ê¹ß)" +F-RTO ¤¬ TCP ºÆÁ÷¥¿¥¤¥à¥¢¥¦¥È¤¬µ¶Êª¤À¤È¸¡½Ð¤·¤¿¾ì¹ç +(¤Ä¤Þ¤ê¡¢TCP ¤¬¤â¤Ã¤ÈŤ¤ºÆÁ÷¥¿¥¤¥à¥¢¥¦¥È¤òÀßÄꤷ¤Æ¤¤¤ì¤Ð +¥¿¥¤¥à¥¢¥¦¥È¤¬Èò¤±¤é¤ì¤¿¾ì¹ç)¡¢ +¼¡¤Ë¤É¤¦¤¹¤ë¤«¤Ë´Ø¤·¤ÆÁªÂò»è¤¬¤¤¤¯¤Ä¤«¤¢¤ë¡£ +°Ê²¼¤ÎÃͤòÁªÂò¤Ç¤­¤ë¡£ +.RS +.IP 0 3 +¥ì¡¼¥È¤ò¸µ¤ÎȾʬ¤Ë¤¹¤ë¡£ +³ê¤é¤«¤Ç¡¢ÊݼéŪ¤ÊÈ¿±þ¤ò¹Ô¤¤¡¢RTT 1²óʬ¤Î»þ´Ö¸å¤Ë +íÕíÔ¥¦¥£¥ó¥É¥¦ +.RI ( cwnd ) +¤È¥¹¥í¡¼¥¹¥¿¡¼¥È¤ÎïçÃÍ +.RI ( ssthresh ) +¤¬È¾Ê¬¤Ë¤Ê¤ë¡£ +.IP 1 +Èó¾ï¤ËÊݼéŪ¤ÊÈ¿±þ¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Î»ÈÍѤϿ侩¤µ¤ì¤Ê¤¤¡£ +È¿±þ¤¬Àµ¤·¤«¤Ã¤¿¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢Linux TCP ¤Î¾¤ÎÉôʬ¤È +¤¦¤Þ¤¯Ï¢·È¤Ç¤­¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +.I cwnd +¤È +.I ssthresh +¤Ïľ¤Á¤ËȾʬ¤Ë¤µ¤ì¤ë¡£ +.IP 2 +ÀѶËŪ¤ÊÈ¿±þ¡£ +ÉÔÍפÈȽÌÀ¤·¤¿íÕíÔÀ©¸æ¤Î¬Äê¾ðÊó¤ò¼è¤ê¾Ã¤¹ +(TCP ¤¬¤â¤Ã¤ÈÃí°Õ¿¼¤¯°·¤¦¤Ù¤­ºÆÁ÷¤¬¼º¤ï¤ì¤ë²ÄǽÀ­¤ò̵»ë¤¹¤ë)¡£ +¡£ +.I cwnd +¤È +.I ssthresh +¤Ï¥¿¥¤¥à¥¢¥¦¥ÈÁ°¤ÎÃͤËÌᤵ¤ì¤ë¡£ +.RE +.TP +.IR tcp_keepalive_intvl " (integer; default: 75; Linux 2.4 °Ê¹ß)" +.\" Since 2.3.18 +TCP keep-alive ¤Î¥×¥í¡¼¥Ö¤òÁ÷¤ë´Ö³Ö (ÉÃñ°Ì)¡£ +.TP +.IR tcp_keepalive_probes " (integer; default: 9; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.43 +TCP keep-alive ¥×¥í¡¼¥Ö¤ÎºÇÂç²ó¿ô¡£ +¤³¤Î²ó¿ô¤À¤±»î¤·¤Æ¤âÀܳÀ褫¤éÈ¿±þ¤¬ÆÀ¤é¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢ +¤¢¤­¤é¤á¤ÆÀܳ¤òÀÚÃǤ¹¤ë¡£ +.TP +.IR tcp_keepalive_time " (integer; default: 7200; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.43 +Àܳ¤¬¥¢¥¤¥É¥ë¾õÂ֤ˤʤäƤ«¤é¡¢keep-alive +¥×¥í¡¼¥Ö¤òÁ÷¿®¤¹¤ë¤Þ¤Ç¤Î»þ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£ +.B SO_KEEPALIVE +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¤È +keep-alive ¤ÏÁ÷¤é¤ì¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 7200 Éà (2 »þ´Ö)¡£ +keep-alive ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢ +¤µ¤é¤Ë¤ª¤è¤½ 11 ʬ (75 Éôֳ֤Π9 ¥×¥í¡¼¥Öʬ) +·Ð²á¤¹¤ë¤È¥¢¥¤¥É¥ë¾õÂÖ¤ÎÀܳ¤Ï½ªÎ»¤µ¤»¤é¤ì¤ë¡£ + +²¼Áؤˤ¢¤ëÀܳÄÉÀ×µ¡¹½¤ä¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Î¥¿¥¤¥à¥¢¥¦¥È¤Ï¡¢ +¤â¤Ã¤È¤º¤Ã¤Èû¤¤¤«¤â¤·¤ì¤Ê¤¤¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_low_latency " (Boolean; default: disabled; Linux 2.4.21/2.6 °Ê¹ß)" +.\" Since 2.4.21/2.5.60 +Í­¸ú¤Ë¤¹¤ë¤È¡¢TCP ¥¹¥¿¥Ã¥¯¤Ï¥¹¥ë¡¼¥×¥Ã¥È¤ò¹â¤¯¤¹¤ë¤è¤ê¤â +ÃÙ±ä¤ò¾¯¤Ê¤¯¤¹¤ë¤³¤È¤òÍ¥À褷¤ÆȽÃǤò¹Ô¤¦¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò̵¸ú¤Ë¤¹¤ë¤È¡¢¥¹¥ë¡¼¥×¥Ã¥È¤ò¹â¤¯¤¹¤ë¤³¤È¤¬Í¥À褵¤ì¤ë¡£ +¤³¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤòÊѹ¹¤·¤¿Êý¤¬¤è¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÎã¤È¤·¤Æ¤Ï +Beowulf ¥³¥ó¥Ô¥å¡¼¥¿¥¯¥é¥¹¥¿¤¬µó¤²¤é¤ì¤ë¤À¤í¤¦¡£ +.TP +.IR tcp_max_orphans " (integer; default: see below; Linux 2.4 °Ê¹ß)" +.\" Since 2.3.41 +¥·¥¹¥Æ¥à¤¬µöÍƤ¹¤ë¡¢ +orphan ¤Ê (¤É¤Î¥æ¡¼¥¶¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤Ë¤â¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤Ê¤¤) +TCP ¥½¥±¥Ã¥È¤ÎºÇÂç¿ô¡£ +¤³¤Î¿ô¤ò±Û¤¨¤ë¤È¡¢orphan ¤ÊÀܳ¤Ï¥ê¥»¥Ã¥È¤µ¤ì¡¢·Ù¹ð¤¬É½¼¨¤µ¤ì¤ë¡£ +¤³¤ÎÀ©¸Â¤¬Â¸ºß¤¹¤ë¤Î¤Ï¡¢Ã±½ã¤Ê»ÈÍÑÉÔǽ (denial-of-service) ¹¶·â¤ò +Ëɤ°¤¿¤á¤Ë²á¤®¤Ê¤¤¡£¤³¤ÎÃͤò¾®¤µ¤¯¤¹¤ë¤³¤È¤Ï¿ä¾©¤·¤Ê¤¤¡£ +¥Í¥Ã¥È¥ï¡¼¥¯¤Î¾ò·ï¤Ë¤è¤Ã¤Æ¤Ï¡¢¤³¤Î¿ôÃͤòÂ礭¤¯¤·¤Ê¤¤¤È¤¤¤±¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¤¬¡¢ +orphan ¤Ê¥½¥±¥Ã¥È¤Ò¤È¤Ä¤¢¤¿¤ê +64K ÄøÅ٤Υ¹¥ï¥Ã¥×ÉÔ²Äǽ¤Ê¥á¥â¥ê¤ò¾ÃÈñ¤¹¤ë¤³¤È¤âÃí°Õ¤»¤è¡£ +¥Ç¥Õ¥©¥ë¥È¤Î½é´üÃͤϥ«¡¼¥Í¥ë¥Ñ¥é¥á¡¼¥¿¤Î NR_FILE ¤ÈÅù¤·¤¤¡£ +¤³¤Î½é´ü¥Ç¥Õ¥©¥ë¥ÈÃͤϥ·¥¹¥Æ¥à¤Î¥á¥â¥ê¤Ë±þ¤¸¤ÆÄ´À°¤µ¤ì¤ë¡£ +.TP +.IR tcp_max_syn_backlog " (integer; default: ²¼µ­»²¾È; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.53 +Àܳ¤·¤Æ¤­¤Æ¤¤¤ë¥¯¥é¥¤¥¢¥ó¥È¤«¤é +ack ¤ò¼õ¿®¤·¤Æ¤¤¤Ê¤¤¾õÂÖ¤ÎÀܳ¥ê¥¯¥¨¥¹¥È¤ò¥­¥å¡¼¤ËÃÖ¤±¤ëºÇÂç¿ô¡£ +¤³¤Î¿ôÃͤò±Û¤¨¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï¥ê¥¯¥¨¥¹¥È¤ò¼Î¤Æ»Ï¤á¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï 256 ¤Ç¡¢ +¥·¥¹¥Æ¥à¤Ë½¼Ê¬¤Ê¥á¥â¥ê¤¬¤¢¤ë (128Mb °Ê¾å) ¾ì¹ç¤Ï 1024 ¤Ë¤Ê¤ê¡¢ +¥á¥â¥ê¤¬Èó¾ï¤Ë¾¯¤Ê¤¤¾ì¹ç (32 Mb °Ê²¼) ¤Ï 128 ¤Ë¤Ê¤ë¡£ +¤³¤Î¿ôÃͤò 1024 °Ê¾å¤ËÁý¤ä¤·¤¿¤¤¾ì¹ç¤Ï¡¢ +.I include/net/tcp.h +¤Î TCP_SYNQ_HSIZE ¤ò +TCP_SYNQ_HSIZE*16<=tcp_max_syn_backlog ¤Î¤è¤¦¤Ë½¤Àµ¤·¡¢ +¥«¡¼¥Í¥ë¤òºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤³¤È¤ò¾©¤á¤ë¡£ +.TP +.IR tcp_max_tw_buckets " (integer; default: ²¼µ­»²¾È; Linux 2.4 °Ê¹ß)" +.\" Since 2.3.41 +¥·¥¹¥Æ¥à¤¬µöÍƤ¹¤ë TIME_WAIT ¾õÂ֤ˤ¢¤ë¥½¥±¥Ã¥È¤ÎºÇÂç¿ô¡£ +¤³¤ÎÀ©¸Â¤¬Â¸ºß¤¹¤ë¤Î¤Ï¡¢ +ñ½ã¤Ê»ÈÍÑÉÔǽ (denial-of-service) ¹¶·â¤òËɤ°¤¿¤á¤Ë²á¤®¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï NR_FILE*2 ¤Ç¡¢¥·¥¹¥Æ¥à¤Î¥á¥â¥ê¤Ë±þ¤¸¤ÆÄ´À°¤µ¤ì¤ë¡£ +¤³¤Î¿ôÃͤò±Û¤¨¤ë¤È¡¢¤½¤Î¤è¤¦¤Ê¥½¥±¥Ã¥È¤Ï¥¯¥í¡¼¥º¤µ¤ì¡¢·Ù¹ð¤¬É½¼¨¤µ¤ì¤ë¡£ +.TP +.IR tcp_moderate_rcvbuf " (Boolean; default: enabled; Linux 2.4.17/2.6.7 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +Í­¸ú¤Ë¤¹¤ë¤È¡¢TCP ¤Ï¼õ¿®¥Ð¥Ã¥Õ¥¡¤Î¼«Æ°Ä´À°¤ò¹Ô¤¦¡£ +¶ñÂÎŪ¤Ë¤Ï¡¢ +.RI ( tcp_rmem[2] +¤òĶ¤¨¤Ê¤¤ÈϰϤÇ) ¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ¤ò¼«Æ°Åª¤ËÊѲ½¤µ¤»¡¢ +¤½¤Î·ÐÏ©¤ÇºÇÂç¤Î¥¹¥ë¡¼¥×¥Ã¥È¤òãÀ®¤¹¤ë¤Î¤ËɬÍפÊÂ礭¤µ¤Ë¹ç¤ï¤»¤è¤¦¤È¤¹¤ë¡£ +.TP +.IR tcp_mem " (Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +¤³¤ì¤Ï 3 ¤Ä¤ÎÀ°¿ô [low, pressure, high] ¤«¤é¤Ê¤ë¥Ù¥¯¥È¥ëÃͤǤ¢¤ë¡£ +¤³¤ì¤é¤Ï TCP ¤¬¥á¥â¥ê»ÈÍÑÎ̤òÄÉÀפ¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë +(»ÈÍÑÎ̤ϥ·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥ºÃ±°Ì¤Ç·×¬¤µ¤ì¤ë)¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï¥Ö¡¼¥È»þ¤ËÍøÍѤǤ­¤ë¥á¥â¥ê¤ÎÎ̤«¤é·×»»¤µ¤ì¤ë¡£ +(¼ÂºÝ¤Ë¤Ï¡¢TCP ¤Ï +.I "low memory" +¤Î¤ß¤ò»ÈÍѤ¹¤ë¡£ÃÍ¤Ï 32¥Ó¥Ã¥È¥·¥¹¥Æ¥à¤Ç¤ÏÌó 900 ¥á¥¬¥Ð¥¤¥È¤ËÀ©¸Â¤µ¤ì¤ë¡£ +64 ¥Ó¥Ã¥È¥·¥¹¥Æ¥à¤Ç¤Ï¤³¤ÎÀ©¸Â¤Ï¤Ê¤¤¡£) +.RS +.TP 10 +.I low +TCP ¤Ï¡¢¥°¥í¡¼¥Ð¥ë¤Ë¥¢¥í¥±¡¼¥È¤·¤¿¥Ú¡¼¥¸¤¬¤³¤Î¿ôÃͰʲ¼¤Î¾ì¹ç¤Ï¡¢ +¥á¥â¥ê¥¢¥í¥±¡¼¥·¥ç¥ó¤òÄ´À°¤·¤Ê¤¤¡£ +.TP +.I pressure +TCP ¤¬¥¢¥í¥±¡¼¥È¤·¤¿¥á¥â¥ê¤¬¤³¤Î¿ôÃÍʬ¤Î¥Ú¡¼¥¸¿ô¤ò±Û¤¨¤ë¤È¡¢ +TCP ¤Ï¥á¥â¥ê¾ÃÈñ¤òÍÞ¤¨¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¥¢¥í¥±¡¼¥È¤·¤¿¥Ú¡¼¥¸¿ô¤¬ +.I low +°Ê²¼¤Ë¤Ê¤ë¤È¡¢¤³¤Î¥á¥â¥ê°µÇ÷¾õÂÖ¤«¤é椹¤ë¡£ +.TP +.I high +TCP ¤¬¥°¥í¡¼¥Ð¥ë¤Ë³ä¤êÅö¤Æ¤ë¥Ú¡¼¥¸¿ô¤ÎºÇÂçÃÍ¡£ +¤³¤ÎÃͤϥ«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ²Ý¤µ¤ì¤ë¤¢¤é¤æ¤ëÀ©¸Â¤è¤ê¤âÍ¥À褵¤ì¤ë¡£ +.RE +.TP +.IR tcp_mtu_probing " (integer; default: 0; Linux 2.6.17 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢TCP ¤Î¥Ñ¥±¥Ã¥È²½¥ì¥¤¥ä¤Î Path MTU discovery ¤òÀ©¸æ¤¹¤ë¡£ +¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï°Ê²¼¤ÎÃͤòÀßÄê¤Ç¤­¤ë¡£ +.RS +.IP 0 3 +̵¸ú¤Ë¤¹¤ë¡£ +.IP 1 +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï̵¸ú¤À¤¬¡¢ICMP ¥Ö¥é¥Ã¥¯¥Û¡¼¥ë¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤ÏÍ­¸ú¤Ë¤¹¤ë¡£ +.IP 2 +¾ï¤ËÍ­¸ú¤Ë¤¹¤ë¡£ +MSS ¤Î½é´üÃͤȤ·¤Æ +.I tcp_base_mss +¤¬»ÈÍѤµ¤ì¤ë¡£ +.RE +.TP +.IR tcp_no_metrics_save " (Boolean; default: disabled; Linux 2.6.6 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢TCP ¤ÏÀܳ¥¯¥í¡¼¥º»þ¤Ë³Æ¼ï¤ÎÀܳ¥Ñ¥é¥á¡¼¥¿¤ò +¥ë¡¼¥È¥­¥ã¥Ã¥·¥å (route cache) ¤ËÊݸ¤·¡¢¶á¤¤¾­Íè¤ËÀܳ¤¬³ÎΩ¤µ¤ì¤¿ºÝ¤Ë +¤³¤ì¤é¤Î¾ðÊó¤ò½é´ü¾õÂ֤Ȥ·¤Æ»ÈÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +Ä̾ï¤Ï¡¢¤³¤ì¤Ë¤è¤êÁ´ÂΤȤ·¤ÆÀ­Ç½¤¬¸þ¾å¤¹¤ë¤¬¡¢ +»þ¤È¤·¤ÆÀ­Ç½¤ÎÎô²½¤ò°ú¤­µ¯¤³¤¹¤³¤È¤â¤¢¤ë¡£ +.I tcp_no_metrics_save +¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢TCP ¤ÏÀܳ¥¯¥í¡¼¥º»þ¤ËÀܳ¥Ñ¥é¥á¡¼¥¿¤ò¥­¥ã¥Ã¥·¥å +¤·¤Ê¤¯¤Ê¤ë¡£ +.TP +.IR tcp_orphan_retries " (integer; default: 8; Linux 2.4 °Ê¹ß)" +.\" Since 2.3.41 +¤³¤Á¤é¤«¤é¥¯¥í¡¼¥º¤·¤¿Àܳ¤Ë¤Ä¤¤¤Æ¡¢ +ÀèÊý¤ò¥×¥í¡¼¥Ö¤¹¤ëºÇÂç»î¹Ô¿ô¡£ +.TP +.IR tcp_reordering " (integer; default: 3; Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +TCP ¥Ñ¥±¥Ã¥È¥¹¥È¥ê¡¼¥à¤Ç¥Ñ¥±¥Ã¥È½ç½ø¤ÎµÕž¤¬È¯À¸¤·¤¿¤À¤±¤Ç¤¢¤ê¡¢ +¥Ñ¥±¥Ã¥È¥í¥¹¤¬µ¯¤³¤Ã¤¿¤È¤Ï¤ß¤Ê¤µ¤Ê¤¤¡¢¥Ñ¥±¥Ã¥È¿ô¤ÎºÇÂçÃÍ¡£ +¤³¤ÎÃͤòĶ¤¨¤Æ¥Ñ¥±¥Ã¥È¤Î½ç½øµÕž¤¬µ¯¤³¤ë¤È¡¢¥Ñ¥±¥Ã¥È¥í¥¹¤¬À¸¤¸¤¿¤È +¤ß¤Ê¤·¡¢slow start ¤ËÆþ¤ë¡£ +¤³¤Î¿ôÃͤÏÊѹ¹¤·¤Ê¤¤¤Û¤¦¤¬Îɤ¤¡£ +¤³¤ì¤Ï¡¢ÀܳÃæ¤Î¥Ñ¥±¥Ã¥È¤ÎʤÓÂؤ¨¤Ë¤è¤Ã¤ÆÀ¸¤¸¤ë +ÉÔɬÍפÊ®ÅÙÄã²¼¤äºÆÁ÷¤òºÇ¾®²½¤¹¤ë¤è¤¦¤ËÀ߷פµ¤ì¤¿¡¢ +¥Ñ¥±¥Ã¥ÈʤÓÂؤ¨ (packet reordering) ¤Î¸¡ÃÎ¥á¥È¥ê¥Ã¥¯¤Ê¤Î¤Ç¤¢¤ë¡£ +.TP +.IR tcp_retrans_collapse " (Boolean; default: enabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.96 +ºÆÁ÷¤ÎºÝ¤Ë¥Õ¥ë¥µ¥¤¥º¤Î¥Ñ¥±¥Ã¥È¤òÁ÷¤í¤¦¤È¤¹¤ë¡£ +.TP +.IR tcp_retries1 " (integer; default: 3; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.43 +ÉáÄ̤˳ÎΩ¤µ¤ì¤Æ¤¤¤ëÀܳ¾å¤Ë¡¢ +TCP ¤¬¥Í¥Ã¥È¥ï¡¼¥¯Áؤò´¬¤­¹þ¤Þ¤º¤ËºÆÁ÷¤ò»î¤ß¤ë²ó¿ô¡£ +ºÆÁ÷¤¬¤³¤Î²ó¿ô¤ò±Û¤¨¤ë¤È¡¢¤Þ¤ººÇ½é¤Ë¡¢ +¿·¤·¤¤ºÆÁ÷¤òÁ÷¤ëÁ°¤Ë²Äǽ¤Ê¤é¥Í¥Ã¥È¥ï¡¼¥¯Áؤ˷ÐÏ©¤ò¹¹¿·¤µ¤»¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï RFC ¤¬»ØÄꤷ¤Æ¤¤¤ëºÇ¾¯¿ô¤Ç¤¢¤ë 3¡£ +.TP +.IR tcp_retries2 " (integer; default: 15; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.43 +³ÎΩ¾õÂÖ¤ÎÀܳ¤Ë¡¢¤³¤Î²ó¿ô TCP ¥Ñ¥±¥Ã¥È¤ÎºÆÁ÷¿®¤ò +¹Ô¤Ê¤Ã¤Æ¤â¤À¤á¤Ê¾ì¹ç¤Ï¤¢¤­¤é¤á¤ë¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 15 ¤Ç¡¢¤³¤ì¤Ï (ºÆÁ÷¤Î¥¿¥¤¥à¥¢¥¦¥È¤Ë°Í¸¤¹¤ë¤¬) +¤ª¤è¤½ 13¡Á30 ʬÄøÅ٤δü´Ö¤ËÂбþ¤¹¤ë¡£ +RFC\ 1122 ¤ÏºÇ¾®¤Î¸Â³¦¤ò 100 ÉäÈÃÖ¤¤¤Æ¤¤¤ë¤¬¡¢ +¤³¤ì¤Ï¤¿¤¤¤Æ¤¤¤Î¾ì¹ç¤Ë¤Ïû¤¹¤®¤ë¤È»×¤ï¤ì¤ë¡£ +.TP +.IR tcp_rfc1337 " (Boolean; default: disabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.90 +TCP ¤ÎÆ°ºî¤ò RFC\ 1337 ¤Ë½àµò¤µ¤»¤ë¡£ +̵¸ú¤Ë¤¹¤ë¤È¡¢TIME_WAIT ¾õÂ֤ΤȤ­¤Ë RST ¤¬¼õ¿®¤µ¤ì¤¿¾ì¹ç¡¢ +TIME_WAIT ´ü´Ö¤Î½ªÎ»¤òÂÔ¤¿¤º¤Ë¤½¤Î¥½¥±¥Ã¥È¤òľ¤Á¤Ë¥¯¥í¡¼¥º¤¹¤ë¡£ +.TP +.IR tcp_rmem " (Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +¤³¤ì¤Ï 3 ¤Ä¤ÎÀ°¿ô [min, default, max] ¤«¤é¤Ê¤ë¥Ù¥¯¥È¥ëÃͤǤ¢¤ë¡£ +¤³¤ì¤é¤Ï TCP ¤¬¼õ¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤òÄ´À°¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +TCP ¤Ï¡¢¥·¥¹¥Æ¥à¤ÇÍøÍѤǤ­¤ë¥á¥â¥ê¤Ë±þ¤¸¤Æ¡¢ +¼õ¿®¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò¤³¤ì¤é¤ÎÊÑ¿ô¤ÎÈÏ°Ï¤Ç +°Ê²¼¤Ë¼¨¤¹¥Ç¥Õ¥©¥ë¥È¤«¤éưŪ¤ËÄ´À°¤¹¤ë¡£ +.RS +.TP 10 +.I min +³Æ TCP ¥½¥±¥Ã¥È¤¬ÍѤ¤¤ë¼õ¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇ¾®¥µ¥¤¥º¡£ +¥Ç¥Õ¥©¥ë¥ÈÃͤϥ·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤Ç¤¢¤ë +(Linux 2.4 ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 4K ¥Ð¥¤¥È¤Ç¡¢ +¥á¥â¥ê¤Î¾¯¤Ê¤¤¥·¥¹¥Æ¥à¤Ç¤Ï +.B PAGE_SIZE +¥Ð¥¤¥È¤Ë¸º¤é¤µ¤ì¤ë)¡£ +¤³¤ÎÃͤϡ¢¥á¥â¥ê°µÇ÷¥â¡¼¥É¤Ë¤ª¤¤¤Æ¤â¡¢ +¤³¤Î¥µ¥¤¥º¤Î³ä¤êÅö¤Æ¤¬À®¸ù¤¹¤ë¤³¤È¤òÊݾڤ¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +¤³¤ì¤Ï¡¢ +.B SO_RCVBUF +¤òÍѤ¤¤Æ¥½¥±¥Ã¥È¤ÎºÇÄã¼õ¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤òÀë¸À¤¹¤ëºÝ¤Ë¤ÏÍѤ¤¤é¤ì¤Ê¤¤¡£ +.\"nakano Documentation/networking/ip-sysctls.txt +.\"nakano ¤ò¤ß¤ë¸Â¤ê¤Ç¤Ï¤³¤¦¤¤¤¦ÆâÍƤΤ褦¤Ê¡£ +.TP +.I default +TCP ¥½¥±¥Ã¥È¤Î¼õ¿®¥Ð¥Ã¥Õ¥¡¤Î¥Ç¥Õ¥©¥ë¥È¥µ¥¤¥º¡£ +¤³¤ÎÃͤϡ¢¤¹¤Ù¤Æ¤Î¥×¥í¥È¥³¥ë¤ËÂФ·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡¢ +¥¸¥§¥Í¥ê¥Ã¥¯¤Ê¥°¥í¡¼¥Ð¥ë¤Î¥Ç¥Õ¥©¥ë¥È¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º +.I net.core.rmem_default +¤è¤êÍ¥À褵¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 87380 ¥Ð¥¤¥È¤Ç¤¢¤ë +(Linux 2.4 ¤Ç¤Ï¡¢¥á¥â¥ê¤Î¾¯¤Ê¤¤¥·¥¹¥Æ¥à¤Î¾ì¹ç +43689 ¤Þ¤Ç¸º¤é¤µ¤ì¤ë)¡£ +Â礭¤Ê¼õ¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤¬É¬Íפʾì¹ç¤Ï¡¢ +¤³¤ÎÃͤòÁý¤ä¤¹¤Ù¤­¤Ç¤¢¤ë (¤¹¤Ù¤Æ¤Î¥½¥±¥Ã¥È¤Ë±Æ¶Á¤¹¤ë)¡£ +Â礭¤Ê TCP ¥¦¥£¥ó¥É¥¦¤òÍѤ¤¤ë¤Ë¤Ï¡¢ +.I net.ipv4.tcp_window_scaling +¤òÍ­¸ú¤Ë¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ (¥Ç¥Õ¥©¥ë¥È¤ÏÍ­¸ú)¡£ +.TP +.I max +³Æ TCP ¥½¥±¥Ã¥È¤ÇÍѤ¤¤ë¼õ¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇÂ祵¥¤¥º¡£ +¤³¤ÎÃͤè¤ê¤â¥°¥í¡¼¥Ð¥ë¤Î +.I net.core.rmem_max +¤¬Í¥À褵¤ì¤ë¡£ +¤³¤ì¤Ï¡¢ +.B SO_RCVBUF +¤òÍѤ¤¤Æ¥½¥±¥Ã¥È¤Î¼õ¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥ºÀ©¸Â¤òÀë¸À¤¹¤ëºÝ¤Ë¤ÏÍѤ¤¤é¤ì¤Ê¤¤¡£ +.\"nakano Ʊ¾å¡£ +¥Ç¥Õ¥©¥ë¥ÈÃͤϰʲ¼¤Î¼°¤Ç·×»»¤µ¤ì¤ë¡£ + + max(87380, min(4MB, \fItcp_mem\fP[1]*PAGE_SIZE/128)) + +(Linux 2.4 ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 87380*2 ¥Ð¥¤¥È¤Ç¡¢ +¥á¥â¥ê¤Î¾¯¤Ê¤¤¥·¥¹¥Æ¥à¤Ç¤Ï 87380 ¤Þ¤Ç¸º¤é¤µ¤ì¤ë¡£) +.RE +.TP +.IR tcp_sack " (Boolean; default: enabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.36 +RFC\ 2018 ¤Î TCP Selective Acknowledgements ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.IR tcp_slow_start_after_idle " (Boolean; default: enabled; Linux 2.6.18 °Ê¹ß)" +.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt +Í­¸ú¤Ë¤¹¤ë¤È¡¢RFC 2861 ¤ÎÆ°ºî¤¬¹Ô¤ï¤ì¡¢ +¥¢¥¤¥É¥ë»þ´Ö·Ð²á¸å¤ËíÕíÔ¥¦¥£¥ó¥É¥¦¤ò¥¿¥¤¥à¥¢¥¦¥È¤µ¤»¤ë¡£ +¥¢¥¤¥É¥ë»þ´Ö¤Ï¸½ºß¤Î RTO (ºÆÁ÷¥¿¥¤¥à¥¢¥¦¥È) ¤ÇÄêµÁ¤µ¤ì¤ë¡£ +̵¸ú¤Ë¤¹¤ë¤È¡¢íÕíÔ¥¦¥£¥ó¥É¥¦¤Ï¥¢¥¤¥É¥ë»þ´Ö·Ð²á¸å¤â¥¿¥¤¥à¥¢¥¦¥È¤µ¤ì¤Ê¤¤¡£ +.TP +.IR tcp_stdurg " (Boolean; default: disabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.44 +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢ TCP ¶ÛµÞ¥Ý¥¤¥ó¥¿ (urgent-pointer) +¥Õ¥£¡¼¥ë¥É¤ò RFC\ 1122 ¤Ë½¾¤Ã¤¿²ò¼á¤ò¹Ô¤¦¡£ +.\" RFC\ 793 ¤Ï¶ÛµÞ¥Ý¥¤¥ó¥¿¤Î°ÕÌ£¤Îµ¬Ä꤬ۣËæ¤Ç¤¢¤Ã¤¿¡£ +.\" RFC\ 1122 (¤È RFC\ 961) ¤Ç¤Ï¤³¤ÎÛ£Ë椵¤Ë°ì¤Ä¤Î²ò·èºö¤òÄê¤á¤¿ +.\" (»ÄÇ°¤Ê¤¬¤é "´Ö°ã¤Ã¤¿" ²ò·èºö¤Ç¤¢¤Ã¤¿¤¬)¡£ +¤³¤Î²ò¼á¤Ë½¾¤¦¤È¡¢¶ÛµÞ¥Ý¥¤¥ó¥¿¤Ï¶ÛµÞ¥Ç¡¼¥¿¤ÎºÇ¸å¤Î¥Ð¥¤¥È¤ò»Ø¤¹¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò̵¸ú¤Ë¤¹¤ë¤È¡¢¶ÛµÞ¥Ý¥¤¥ó¥¿¤Î²ò¼á¤¬ BSD ¸ß´¹¤ÎÊýË¡¤Ç +¹Ô¤ï¤ì¤ë: ¶ÛµÞ¥Ý¥¤¥ó¥¿¤Ï¶ÛµÞ¥Ç¡¼¥¿¤Î¸å¤ÎºÇ½é¤Î¥Ð¥¤¥È¤ò»Ø¤¹¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢Áê¸ß±¿ÍÑÀ­¤ËÌäÂ꤬À¸¤¸¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.TP +.IR tcp_syn_retries " (integer; default: 5; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.38 +¥¢¥¯¥Æ¥£¥Ö¤Ê TCP Àܳ¤Ë½é´ü SYN ¤ÎºÆÁ÷¤ò»î¤ß¤ëºÇÂç²ó¿ô¡£ +¤³¤Î¿ôÃÍ¤Ï 255 ¤è¤ê¤âÂ礭¤¯¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï 5 ¤Ç¡¢¤ª¤è¤½ 180 ÉäËÂбþ¤¹¤ë¡£ +.TP +.IR tcp_synack_retries " (integer; default: 5; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.38 +passive ¤Ê TCP Àܳ¤Î SYN/ACK ¥»¥°¥á¥ó¥È¤ÇºÆÁ÷¤ò»î¤ß¤ëºÇÂç¿ô¡£ +¤³¤Î¿ôÃÍ¤Ï 255 ¤è¤ê¤âÂ礭¤¯¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.IR tcp_syncookies " (Boolean; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.43 +.TCP syncookies ¤òÍ­¸ú¤Ë¤¹¤ë¡£¥«¡¼¥Í¥ë¤Ï +.B CONFIG_SYNCOOKIES +¤ò¤Ä¤±¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥½¥±¥Ã¥È¤Î¥Ð¥Ã¥¯¥í¥°¥­¥å¡¼¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¤È¡¢ +syncookies ¤¬Á÷¿®¤µ¤ì¤ë¡£ +syncookies µ¡Ç½¤Ï¡¢SYN flood ¹¶·â¤«¤é¥½¥±¥Ã¥È¤ò¼é¤í¤¦¤È¤¹¤ë¡£ +¤³¤ì¤Ï¤¤¤º¤ì¤Ë¤·¤Æ¤â¡¢ºÇ½ª¼êÃʤȤ·¤ÆÍѤ¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï TCP ¥×¥í¥È¥³¥ë¤Ë°ãÈ¿¤·¤Æ¤ª¤ê¡¢ +TCP ³ÈÄ¥¤Î¤è¤¦¤Ê¡¢TCP ¤Î¾¤ÎÉôʬ¤È¾×Æͤ·¤Æ¤·¤Þ¤¦¡£ +¥¯¥é¥¤¥¢¥ó¥È¤ä¥ê¥ì¡¼¤ÇÌäÂ꤬µ¯¤³¤ë¤³¤È¤â¤¢¤ë¡£ +²áÉé²Ù¤äÀßÄê´Ö°ã¤¤¤Ë¤è¤Ã¤ÆÉé²Ù¤ÎÂ礭¤Ê¾õÂ֤ˤ¢¤ë¥µ¡¼¥Ð¤òÄ´À°¤·¤Æµß¤¦¤¿¤á¤Î +µ¡¹½¤È¤ß¤Ê¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +¤½¤Î¤è¤¦¤ÊÍÑÅӤˤϡ¢Âå¤ï¤ê¤Ë +.IR tcp_max_syn_backlog , +.IR tcp_synack_retries , +.I tcp_abort_on_overflow +¤Ê¤É¤Î»ÈÍѤò¹Í¤¨¤ë¤³¤È¡£ +.TP +.IR tcp_timestamps " (Boolean; default: enabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.36 +RFC\ 1323 ¤Î TCP timestamps ¤òÍ­¸ú¤Ë¤¹¤ë¡£ +.TP +.IR tcp_tso_win_divisor " (integer; default: 3; Linux 2.6.9 °Ê¹ß)" +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢°ì¤Ä¤Î TCP Segmentation Offload (TSO) ¥Õ¥ì¡¼¥à¤Ç +¾ÃÈñ¤Ç¤­¤ëíÕíÔ¥¦¥£¥ó¥É¥¦¤Î³ä¹ç (¥Ñ¡¼¥»¥ó¥È) ¤òÀ©¸æ¤¹¤ë¡£ +¥Ð¡¼¥¹¥ÈÀ­¤È¡¢¤É¤ì¤À¤±Â礭¤Ê TSO ¥Õ¥ì¡¼¥à¤ò¹½ÃÛ¤¹¤ë¤«¤Î¤Ï¥È¥ì¡¼¥É¥ª¥Õ¤Ç¤¢¤ê¡¢ +¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¤½¤ÎÅٹ礤¤òÀßÄꤹ¤ë¡£ +.TP +.IR tcp_tw_recycle " (Boolean; default: disabled; Linux 2.4 °Ê¹ß)" +.\" Since 2.3.15 +TIME_WAIT ¥½¥±¥Ã¥È¤ÎÁÇÁᤤºÆÍøÍѤòÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë¤È¡¢ +NAT (¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹ÊÑ´¹) ¤òÍѤ¤¤Æ¤¤¤ë¤ÈÌäÂ꤬À¸¤¸¤ë¤Î¤Ç¡¢ +¤¢¤Þ¤ê¿ä¾©¤·¤Ê¤¤¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_tw_reuse " (Boolean; default: disabled; Linux 2.4.19/2.6 °Ê¹ß)" +.\" Since 2.4.19/2.5.43 +¥×¥í¥È¥³¥ë¤ÎÌ̤«¤é¸«¤ÆÌäÂê¤Ê¤¤¾ì¹ç¤Ë¿·µ¬¥³¥Í¥¯¥·¥ç¥ó¤Ë TIME_WAIT +¾õÂ֤Υ½¥±¥Ã¥È¤òºÆÍøÍѤ¹¤ë¤³¤È¤òµö²Ä¤¹¤ë¡£µ»½ÑŪ¤Ë¾Ü¤·¤¤¿Í¤Î½õ¸À¤ä +Í×ÀÁ¤Ê¤·¤Ë¤³¤Î¥ª¥×¥·¥ç¥ó¤òÊѹ¹¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_vegas_cong_avoid " (Boolean; default: disabled; Linux 2.2 ¤«¤é 2.6.13 ¤Þ¤Ç)" +.\" Since 2.1.8; removed in 2.6.13 +TCP Vegas íÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤òÍ­¸ú¤Ë¤¹¤ë¡£ +TCP Vegas ¤ÏÂÓ°è¤ò¿ä¬¤¹¤ë¤³¤È¤ÇíÕíԤε¯¤³¤ê»Ï¤á¤òͽÁÛ¤¹¤ë¤è¤¦¤Ë +TCP ¤ÎÁ÷¿®Â¦¤Î¤ß¤ËÊѹ¹¤ò²Ã¤¨¤¿¤â¤Î¤Ç¤¢¤ë¡£ +TCP Vegas ¤ÏíÕíÔ¥¦¥£¥ó¥É¥¦¤ò½¤Àµ¤¹¤ë¤³¤È¤Ç¡¢Á÷¿®¥ì¡¼¥È¤òÄ´À°¤¹¤ë¡£ +TCP Vegas ¤Ï TCP Reno ¤ÈÈæ¤Ù¤Æ¥Ñ¥±¥Ã¥È¥í¥¹¤Ï¾¯¤Ê¤¤¤¬¡¢ +TCP Reno ¤Û¤ÉÀѶËŪ¤ÊµóÆ°¤Ï¤·¤Ê¤¤¡£ +.\" +.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt +.TP +.IR tcp_westwood " (Boolean; default: disabled; Linux 2.4.26/2.6.3 ¤«¤é 2.6.13 ¤Þ¤Ç)" +TCP Westwood+ íÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¤òÍ­¸ú¤Ë¤¹¤ë¡£ +TCP Westwood+ ¤Ï TCP íÕíÔÀ©¸æ¤ÎÀ­Ç½¤òºÇŬ²½¤¹¤ë¤è¤¦¤Ë TCP Reno ¤Î +¥×¥í¥È¥³¥ë¥¹¥¿¥Ã¥¯¤ÎÁ÷¿®Â¦¤Î¤ß¤Ë½¤Àµ¤ò²Ã¤¨¤¿¤â¤Î¤Ç¤¢¤ë¡£ +íÕíÔ¤¬µ¯¤³¤Ã¤¿¸å¤Ç¡¢íÕíÔ¥¦¥£¥ó¥É¥¦¤ä slow start ¤ÎïçÃͤò +ÄÌ¿®Î¾Ã¼´Ö¤ÎÂÓ°è¤Î¿ä¬¤Ë´ð¤Å¤¤¤ÆÀßÄꤹ¤ë¡£ +¤³¤Î¿ä¬¤ò»È¤Ã¤Æ¡¢TCP Westwood+ ¤ÏíÕíÔ¤¬È¯À¸¤·¤¿»þ¤Ë»È¤Ã¤Æ¤¤¤¿ +ÂÓ°è¤ò¹Íθ¤ËÆþ¤ì¤¿ slow start ¤ÎïçÃͤÈíÕíÔ¥¦¥£¥ó¥É¥¦¤òÀßÄꤹ¤ë¡£ +TCP Westwood+ ¤Ï¡¢Í­Àþ¥Í¥Ã¥È¥ï¡¼¥¯¤Ë¤ª¤±¤ë TCP Reno ¤Î¸øÊ¿À­ +(fairness) ¤È¡¢ÌµÀþ¥ê¥ó¥¯¤Ç¤Î¥¹¥ë¡¼¥×¥Ã¥È¤òÂ礭¤¯¸þ¾å¤¹¤ë¡£ +.TP +.IR tcp_window_scaling " (Boolean; default: enabled; Linux 2.2 °Ê¹ß)" +.\" Since 2.1.36 +RFC\ 1323 ¤Î TCP ¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¤òÍ­¸ú¤Ë¤¹¤ë¡£ +¤³¤Îµ¡Ç½¤òÍѤ¤¤ë¤È¡¢ÀܳÀ褬Âбþ¤·¤Æ¤¤¤ì¤Ð¡¢ +TCP Àܳ¤ÇÂ礭¤Ê (64K °Ê¾å¤Î) ¥¦¥£¥ó¥É¥¦¤¬»È¤¨¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +Ä̾ï¤Ï TCP ¥Ø¥Ã¥À¤Î¥¦¥¤¥ó¥É¥¦Ä¹¥Õ¥£¡¼¥ë¥É¤Ï 16 ¥Ó¥Ã¥È¤Ê¤Î¤Ç¡¢ +¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤Ï 64K ¥Ð¥¤¥È°Ê²¼¤Ë¸Â¤é¤ì¤ë¡£ +¤â¤Ã¤ÈÂ礭¤Ê¥¦¥£¥ó¥É¥¦¤ò»È¤¤¤¿¤¤¾ì¹ç¤Ï¡¢ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥½¥±¥Ã¥È¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òÁý¤ä¤·¤Æ¡¢ +¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¤Î¥ª¥×¥·¥ç¥ó¤òÍøÍѤ¹¤ì¤Ð¤è¤¤¡£ +.I tcp_window_scaling +¤ò̵¸ú¤Ë¤·¤Æ¤¤¤ë¤È¡¢ +TCP ¤Ï¾ü¤È¤ÎÀܳÀßÄê¤ÎºÝ¤Ë¡¢ +¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¤Î¥Í¥´¥·¥¨¡¼¥·¥ç¥ó¤ò¹Ô¤Ê¤ï¤Ê¤¤¡£ +.TP +.IR tcp_wmem " (Linux 2.4 °Ê¹ß)" +.\" Since 2.4.0-test7 +¤³¤ì¤Ï 3 ¤Ä¤ÎÀ°¿ô [min, default, max] ¤«¤é¤Ê¤ë¥Ù¥¯¥È¥ëÃͤǤ¢¤ë¡£ +¤³¤ì¤é¤Ï TCP ¤¬Á÷¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤òÄ´À°¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +TCP ¤Ï¡¢¥·¥¹¥Æ¥à¤ÇÍøÍѤǤ­¤ë¥á¥â¥ê¤Ë±þ¤¸¤Æ¡¢Á÷¿®¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò +¤³¤ì¤é¤ÎÊÑ¿ô¤ÎÈϰϤǰʲ¼¤Ë¼¨¤¹¥Ç¥Õ¥©¥ë¥È¤«¤éưŪ¤ËÄ´À°¤¹¤ë¡£ +.RS +.TP 10 +.I min +³Æ TCP ¥½¥±¥Ã¥È¤¬ÍѤ¤¤ëÁ÷¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇ¾®¥µ¥¤¥º¡£ +¥Ç¥Õ¥©¥ë¥ÈÃͤϥ·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤Ç¤¢¤ë +(Linux 2.4 ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 4K ¤Ç¤¢¤ë)¡£ +¤³¤ÎÃͤϡ¢¥á¥â¥ê°µÇ÷¥â¡¼¥É¤Ë¤ª¤¤¤Æ¤â¡¢ +¤³¤Î¥µ¥¤¥º°Ê²¼¤Î³ä¤êÅö¤Æ¤¬À®¸ù¤¹¤ë¤³¤È¤òÊݾڤ¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +¤³¤ì¤Ï¡¢ +.B SO_SNDBUF +¤òÍѤ¤¤Æ¥½¥±¥Ã¥È¤ÎºÇÄãÁ÷¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤òÀë¸À¤¹¤ëºÝ¤Ë¤ÏÍѤ¤¤é¤ì¤Ê¤¤¡£ +.TP +.I default +TCP ¥½¥±¥Ã¥È¤ÎÁ÷¿®¥Ð¥Ã¥Õ¥¡¤Î¥Ç¥Õ¥©¥ë¥È¥µ¥¤¥º¡£ +¤³¤ÎÃͤϡ¢¤¹¤Ù¤Æ¤Î¥×¥í¥È¥³¥ë¤ËÂФ·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡¢ +¥¸¥§¥Í¥ê¥Ã¥¯¤Ê¥°¥í¡¼¥Ð¥ë¤Î¥Ç¥Õ¥©¥ë¥È¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º +.I /proc/sys/net/core/wmem_default +¤è¤êÍ¥À褵¤ì¤ë¡£ +¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 16K ¥Ð¥¤¥È¤Ç¤¢¤ë¡£ +.\" Linux 2.4 ¤È 2.6 ¤Ç¤ÏÀµ¤·¤¤¡£ +Â礭¤ÊÁ÷¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤¬É¬Íפʾì¹ç¤Ï¡¢ +¤³¤ÎÃͤòÁý¤ä¤¹¤Ù¤­¤Ç¤¢¤ë (¤¹¤Ù¤Æ¤Î¥½¥±¥Ã¥È¤Ë±Æ¶Á¤¹¤ë)¡£ +Â礭¤Ê TCP ¥¦¥£¥ó¥É¥¦¤òÍѤ¤¤ë¤Ë¤Ï¡¢ +.I /proc/sys/net/ipv4/tcp_window_scaling +¤ò 0 °Ê³°¤ÎÃÍ (¥Ç¥Õ¥©¥ë¥ÈÃÍ) ¤Ë¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.TP +.I max +³Æ TCP ¥½¥±¥Ã¥È¤ÇÍѤ¤¤ëÁ÷¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇÂ祵¥¤¥º¡£ +¤³¤ÎÃͤè¤ê¤â +.IR /proc/sys/net/core/wmem_max +¤¬Í¥À褵¤ì¤ë¡£ +¤³¤ì¤Ï +.B SO_SNDBUF +¤òÍѤ¤¤Æ¥½¥±¥Ã¥È¤ÎÁ÷¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥ºÀ©¸Â¤òÀë¸À¤¹¤ëºÝ¤Ë¤ÏÍѤ¤¤é¤ì¤Ê¤¤¡£ +¥Ç¥Õ¥©¥ë¥ÈÃͤϰʲ¼¤Î¼°¤Ç·×»»¤µ¤ì¤ë¡£ + + max(65536, min(4MB, \fItcp_mem\fP[1]*PAGE_SIZE/128)) + +(Linux 2.4 ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 128K ¥Ð¥¤¥È¤Ç¡¢ +¥á¥â¥ê¤Î¾¯¤Ê¤¤¥·¥¹¥Æ¥à¤Ç¤Ï 64K ¤Ë¤Þ¤Ç¸º¤é¤µ¤ì¤ë¡£) +.RE +.TP +.IR tcp_workaround_signed_windows " (Boolean; default: disabled; Linux 2.6.26 °Ê¹ß)" +Í­¸ú¤Ë¤¹¤ë¤È¡¢¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¥ª¥×¥·¥ç¥ó¤ò¼õ¿®¤·¤Ê¤¤¤Î¤Ï¡¢ +ÀܳÁê¼ê¤Î TCP ¤¬²õ¤ì¤Æ¤¤¤ë¤È¹Í¤¨¡¢¥¦¥£¥ó¥É¥¦¤òÉä¹æÉÕ¤­¤ÎÎ̤Ȥߤʤ¹¡£ +̵¸ú¤Ë¤¹¤ë¤È¡¢ÀܳÁê¼ê¤«¤é¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°¥ª¥×¥·¥ç¥ó¤ò¼õ¿®¤·¤Ê¤«¤Ã¤¿ +¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢ÀܳÁê¼ê¤Î TCP ¤¬²õ¤ì¤Æ¤¤¤ë¤È¤Ï¤ß¤Ê¤µ¤Ê¤¤¡£ +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +TCP ¥½¥±¥Ã¥È¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ +¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë°ú¿ô¤Ë +.I IPPROTO_TCP +¤ò»ØÄꤷ¤¿ +.BR setsockopt (2) +¤ÇÀßÄê¤Ç¤­¡¢ +.BR getsockopt (2) +¤Ç¼èÆÀ¤Ç¤­¤ë¡£ +¤µ¤é¤Ë¡¢¤Û¤È¤ó¤É¤Î +.B IPPROTO_IP +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤â TCP ¥½¥±¥Ã¥È¤ËÂФ·¤ÆÍ­¸ú¤Ç¤¢¤ë¡£¾ÜºÙ¤Ï +.BR ip (7) +¤ò¸«¤è¡£ +.\" FIXME Document TCP_CONGESTION (new in 2.6.13) +.TP +.BR TCP_CORK " (Linux 2.2 °Ê¹ß)" +.\" precisely: since 2.1.127 +¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢ partial ¥Õ¥ì¡¼¥à¤òÁ÷¿®¤·¤Ê¤¤¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬²ò½ü¤µ¤ì¤ë¤È¡¢ +¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤¿ partial ¥Õ¥ì¡¼¥à¤¬Á÷¤é¤ì¤ë¡£¤³¤ì¤Ï +.BR sendfile (2) +¤ò¸Æ¤ÖÁ°¤Ë¥Ø¥Ã¥À¤òÁ°ÃÖ¤·¤¿¤ê¡¢ +¥¹¥ë¡¼¥×¥Ã¥È¤òºÇŬ²½¤·¤¿¤¤¾ì¹ç¤ËÊØÍø¤Ç¤¢¤ë¡£ +¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢ +.B TCP_CORK +¤Ç½ÐÎϤòÍÞ¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë»þ´Ö¤Î¾å¸Â¤Ï 200 ¥ß¥êÉäǤ¢¤ë¡£ +¤³¤Î¾å¸Â¤Ë㤹¤ë¤È¡¢¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤¿¥Ç¡¼¥¿¤Ï¼«Æ°Åª¤ËÁ÷¿®¤µ¤ì¤ë¡£ +Linux 2.5.71 °Ê¹ß¤Ë¤ª¤¤¤Æ¤Î¤ß¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò +.B TCP_NODELAY +¤ÈƱ»þ¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.BR TCP_DEFER_ACCEPT " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.38 +¤³¤ì¤òÍѤ¤¤ë¤È¡¢¥ê¥¹¥Ê¤Ï¥Ç¡¼¥¿¤¬¥½¥±¥Ã¥È¤ËÅþÃ夷¤¿»þ¤Î¤ßÌܳФá¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +À°¿ôÃÍ (ÉÃ) ¤ò¤È¤ê¡¢ +TCP ¤¬Àܳ¤ò´°Î»¤·¤è¤¦¤È»î¤ß¤ë²ó¿ô¤òÀ©¸Â¤Ç¤­¤ë¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.BR TCP_INFO " (Linux 2.4 °Ê¹ß)" +¤³¤Î¥½¥±¥Ã¥È¤Î¾ðÊó¤ò¼ý½¸¤¹¤ë¤Î¤ËÍѤ¤¤ë¡£ +¥«¡¼¥Í¥ë¤Ï +.I /usr/include/linux/tcp.h +¥Õ¥¡¥¤¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë +\fIstruct tcp_info\fP ¤òÊÖ¤¹¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.BR TCP_KEEPCNT " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.18 +Àܳ¤òÍî¤È¤¹Á°¤Ë TCP ¤¬»î¤ß¤ë keepalive ¥×¥í¡¼¥Ö¤ÎºÇÂç²ó¿ô¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.BR TCP_KEEPIDLE " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.18 +¤³¤Î»þ´Ö (ÉÃñ°Ì) ¤ò±Û¤¨¤ÆÀܳ¤¬¥¢¥¤¥É¥ë¾õÂÖ¤Ëα¤Þ¤Ã¤Æ¤¤¤ë¤È¡¢ +¤³¤Î¥½¥±¥Ã¥È¤Ë +.B SO_KEEPALIVE +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +TCP ¤Ï keepalive ¥×¥í¡¼¥Ö¤òÁ÷¤ê¤Ï¤¸¤á¤ë¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.BR TCP_KEEPINTVL " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.18 +³Æ keepalive ¥×¥í¡¼¥Ö¤Î´Ö³Ö (ÉÃñ°Ì)¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.BR TCP_LINGER2 " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.41 +orphan ¤µ¤ì¤¿ FIN_WAIT2 ¾õÂ֤Υ½¥±¥Ã¥È¤Î¼÷Ì¿¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È¡¢¥·¥¹¥Æ¥àÁ´ÂΤËŬÍѤµ¤ì¤ë¥Õ¥¡¥¤¥ë +.I /proc/sys/net/ipv4/tcp_fin_timeout +¤ÎÃͤò¡¢¤³¤Î¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Î¤ßÊѹ¹¤Ç¤­¤ë¡£ +.BR socket (7) +¥ì¥Ù¥ë¤Î¥ª¥×¥·¥ç¥ó +.B SO_LINGER +¤Èº®Æ±¤·¤Ê¤¤¤³¤È¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B TCP_MAXSEG +.\" Present in Linux 1.0 +Á÷½Ð TCP ¥Ñ¥±¥Ã¥È¤ÎºÇÂ祻¥°¥á¥ó¥È¥µ¥¤¥º¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤òÀܳ³ÎΩ¤ÎÁ°¤ËÀßÄꤹ¤ë¤È¡¢ +½é´ü¥Ñ¥±¥Ã¥È¤Ç¾ü¤Ë¥¢¥Ê¥¦¥ó¥¹¤¹¤ë MSS ¤ÎÃͤâÊѲ½¤¹¤ë¡£ +¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î MTU ¤è¤ê¤âÂ礭¤Ê (¤¢¤ë¤¤¤ÏÂ礭¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿) +Ãͤϸú²Ì¤ò»ý¤¿¤Ê¤¤¡£ +¤Þ¤¿ TCP ¤Ï¡¢¤³¤ÎÃͤè¤ê¤âºÇ¾®¡¦ºÇÂç¤ÎÀ©¸Â¤ÎÊý¤òÍ¥À褹¤ë¡£ +.\" FIXME +.\" Document TCP_MD5SIG, added in Linux 2.6.20, +.\" Needs CONFIG_TCP_MD5SIG +.\" From net/inet/Kconfig +.\" bool "TCP: MD5 Signature Option support (RFC2385) (EXPERIMENTAL)" +.\" RFC2385 specifies a method of giving MD5 protection to TCP sessions. +.\" Its main (only?) use is to protect BGP sessions between core routers +.\" on the Internet. +.\" +.\" There is a TCP_MD5SIG option documented in FreeBSD's tcp(4), +.\" but probably many details are different on Linux +.\" Authors were yoshfuji@linux-ipv6.org and Dave Muller +.\" http://thread.gmane.org/gmane.linux.network/47490 +.\" http://www.daemon-systems.org/man/tcp.4.html +.\" http://article.gmane.org/gmane.os.netbsd.devel.network/3767/match=tcp_md5sig+freebsd +.TP +.B TCP_NODELAY +.\" Present in Linux 1.0 +ÀßÄꤹ¤ë¤È Nagle ¥¢¥ë¥´¥ê¥º¥à¤ò̵¸ú¤Ë¤¹¤ë¡£ +¤¹¤Ê¤ï¤Á¡¢¥Ç¡¼¥¿Î̤¬¾¯¤Ê¤¤¾ì¹ç¤Ç¤â +³Æ¥»¥°¥á¥ó¥È¤Ï²Äǽ¤Ê¸Â¤êÁ᤯Á÷¿®¤µ¤ì¤ë¡£ +ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢ +Á÷¿®¤¹¤ëʬ¤À¤±Î¯¤Þ¤ë¤Þ¤Ç¥Ç¡¼¥¿¤Ï¥Ð¥Ã¥Õ¥¡¤µ¤ì¡¢ +¾®¤µ¤Ê¥Ñ¥±¥Ã¥È¤òÉÑÈˤËÁ÷¤é¤º¤Ë¤¹¤ß¡¢ +¥Í¥Ã¥È¥ï¡¼¥¯¤òÍ­¸ú¤ËÍøÍѤǤ­¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï +.B TCP_CORK +¤Ë¤è¤ê¾å½ñ¤­¤µ¤ì¤ë¡£¤·¤«¤·¤Ê¤¬¤é¡¢ +.B TCP_CORK +¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¤È¡¢ +Á÷¿®ÂÔ¤Á¤Î½ÐÎϤòÌÀ¼¨Åª¤ËÁݤ­½Ð¤¹ (flush) ¤³¤È¤Ë¤Ê¤ë¡£ +.TP +.BR TCP_QUICKACK " (Linux 2.4.4 °Ê¹ß)" +ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È quickack ¥â¡¼¥É¤òÍ­¸ú¤Ë¤·¡¢¥¯¥ê¥¢¤µ¤ì¤ë¤È̵¸ú¤Ë¤¹¤ë¡£ +Ä̾ï¤Î TCP Æ°ºî¤Ç¤Ï ack ¤ÏɬÍפ˱þ¤¸¤ÆÃٱ䤵¤ì¤ë¤Î¤ËÂФ·¡¢ +quickack ¥â¡¼¥É¤Ç¤Ï ack ¤Ï¤¹¤°¤ËÁ÷¿®¤µ¤ì¤ë¡£ +¤³¤Î¥Õ¥é¥°¤Ï±Ê³Ū¤Ê¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢ +quickack ¥â¡¼¥É¤«¤é/¥â¡¼¥É¤ØÀÚ¤êÂؤ¨¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤ì°Ê¹ß¤Î TCP ¥×¥í¥È¥³¥ë¤ÎÆ°ºî¤Ë¤è¤Ã¤Æ¤Ï¡¢ +ÆâÉô¤Î¥×¥í¥È¥³¥ë½èÍý¤ä¡¢ÃÙ±ä ack ¥¿¥¤¥à¥¢¥¦¥È¤ÎȯÀ¸¡¢ +¥Ç¡¼¥¿Å¾Á÷¤Ê¤É¤ÎÍ×°ø¤Ë¤è¤Ã¤Æ¡¢ +ºÆ¤Ó quickack ¤«¤é½Ð¤¿¤êÆþ¤Ã¤¿¤ê¤¹¤ë¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.BR TCP_SYNCNT " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.18 +Àܳ¤Î»î¹Ô¤òÃæ»ß¤µ¤»¤ëÁ°¤Ë TCP ¤¬Á÷¤ë SYN ºÆÁ÷¿ô¤òÀßÄꤹ¤ë¡£ +¤³¤ì¤Ï 255 ¤è¤êÂ礭¤¯¤Ï¤Ç¤­¤Ê¤¤¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.BR TCP_WINDOW_CLAMP " (Linux 2.4 °Ê¹ß)" +.\" Precisely: since 2.3.41 +¹­Ê󤹤륦¥£¥ó¥É¥¦¤Î¥µ¥¤¥º¤ò¤³¤ÎÃͤ˸ÇÄꤹ¤ë¡£ +¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤ÆºÇ¾®¥µ¥¤¥º¤Ï SOCK_MIN_RCVBUF/2 ¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï°Ü¿¢À­¤ÎɬÍפʥ³¡¼¥É¤Ç¤ÏÍѤ¤¤ë¤Ù¤­¤Ç¤Ê¤¤¡£ +.SS ¥½¥±¥Ã¥È API +TCP ¤ÏÂÓ°è³°¥Ç¡¼¥¿ (out-of-band data) ¤ò¸ÂÄêŪ¤Ë¥µ¥Ý¡¼¥È¤·¤Æ¤ª¤ê¡¢ +(1 ¥Ð¥¤¥È¤Î) ¶ÛµÞ¥Ç¡¼¥¿¤È¤¤¤¦·Á¤Ç¤¢¤ë¡£ +¤Ä¤Þ¤ê Linux ¤Ë¤ª¤¤¤Æ¤Ï¡¢ +ÀܳÀ褬 (¿·¤·¤¤¤ä¤êÊý¤Î) ÂÓ°è³°¥Ç¡¼¥¿¤òÁ÷¤Ã¤Æ¤­¤¿¾ì¹ç¡¢ +(¸Å¤¤¤ä¤êÊý¤Î) +¶ÛµÞ¥Ç¡¼¥¿¤ÏÄ̾ï¤Î¥Ç¡¼¥¿¤È¤·¤Æ¥¹¥È¥ê¡¼¥à¤ËÁÞÆþ¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë (¤³¤ì¤Ï +.B SO_OOBINLINE +¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ç¤âƱÍͤǤ¢¤ë)¡£ +¤³¤ì¤Ï BSD ¥Ù¡¼¥¹¤Î¥¹¥¿¥Ã¥¯¤È¤Ï°Û¤Ê¤ë¡£ +.PP +Linux ¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï urgent ¥Ý¥¤¥ó¥¿¥Õ¥£¡¼¥ë¥É¤Î²ò¼á¤Ë +BSD ¸ß´¹¤ÎÊýË¡¤òÍѤ¤¤ë¡£¤³¤ì¤Ï RFC\ 1122 ¤ËÈ¿¤·¤Æ¤¤¤ë¤¬¡¢ +¾¤Î¥¹¥¿¥Ã¥¯¤ÈƱ»þ¤ËÆ°ºî¤µ¤»¤ë¤Ë¤Ï¤ä¤à¤òÆÀ¤Ê¤¤¡£¤³¤ì¤Ï +.I /proc/sys/net/ipv4/tcp_stdurg +¤Ë¤è¤Ã¤ÆÊѹ¹¤Ç¤­¤ë¡£ + +.BR recv (2) +¤Î +.B MSG_PEEK +¥Õ¥é¥°¤ò»È¤¦¤È¡¢ÂÓ°è³°¥Ç¡¼¥¿¤òÇÁ¤­¸«¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +Linux 2.4 °Ê¹ß¤Ç¤Ï¡¢ +.BR recv (2) +(¤ä +.BR recvmsg (2)) +¤Î +.I flags +°ú¤­¿ô¤Ë +.B MSG_TRUNC +¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢¼õ¿®¥Ç¡¼¥¿¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤«¤éÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡ +¤Ë¥³¥Ô¡¼¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ÇÑ´þ¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +Linux 2.4.4 °Ê¹ß¤Ç¤Ï¡¢ +.B MSG_PEEK +¤ò¡¢ÂÓ°è³°¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ë¤¿¤á¤Î +.B MSG_OOB +¤ÈÁȤ߹ç¤ï¤»¤Æ»È¤Ã¤¿¾ì¹ç¤Ë¤â¡¢¤³¤ì¤ÈƱ¤¸¸ú²Ì¤ò»ý¤Ä¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SS ioctl +°Ê²¼¤Î +.BR ioctl (2) +¸Æ¤Ó½Ð¤·¤Ï +.I value +¤Ë¾ðÊó¤òÆþ¤ì¤ÆÊÖ¤¹¡£ +Àµ¤·¤¤½ñ¼°¤Ï°Ê²¼¤ÎÄ̤ꡣ +.PP +.RS +.nf +.BI int " value"; +.IB error " = ioctl(" tcp_socket ", " ioctl_type ", &" value ");" +.fi +.RE +.PP +.I ioctl_type +¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«°ì¤Ä¤Ç¤¢¤ë: +.TP +.B SIOCINQ +¼õ¿®¥Ð¥Ã¥Õ¥¡¤Î¥­¥å¡¼¤Ë¤¢¤ë¡¢¤Þ¤ÀÆɤó¤Ç¤¤¤Ê¤¤¥Ç¡¼¥¿¤ÎÎ̤òÊÖ¤¹¡£ +¥½¥±¥Ã¥È¤Ï LISTEN ¾õÂ֤ˤ¢¤Ã¤Æ¤Ï¤Ê¤é¤º¡¢ +¤µ¤â¤Ê¤¤¤È¥¨¥é¡¼ +.RB ( EINVAL ) +¤¬Ê֤롣 +.TP +.B SIOCATMARK +¼õ¿®¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥à¤¬¶ÛµÞ¥Þ¡¼¥¯¤Î°ÌÃ֤Ǥ¢¤ì¤Ð¡¢¿¿¤òÊÖ¤¹ (¤Ä¤Þ¤ê +.I value +¤¬ 0 °Ê³°)¡£ +.sp +.B SO_OOBINLINE +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¡¢ +.B SIOCATMARK +¤¬¿¿¤òÊÖ¤·¤¿¾ì¹ç¡¢¼¡¤Î¥½¥±¥Ã¥È¤«¤é¤ÎÆɤ߹þ¤ß¤Ç¤Ï¶ÛµÞ¥Ç¡¼¥¿¤¬ +ÊÖ¤µ¤ì¤ë¡£ +.B SO_OOBINLINE +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Æ¤ª¤é¤º¡¢ +.B SIOCATMARK +¤¬¿¿¤òÊÖ¤·¤¿¾ì¹ç¡¢¼¡¤Î¥½¥±¥Ã¥È¤«¤é¤ÎÆɤ߹þ¤ß¤Ç¤Ï¶ÛµÞ¥Ç¡¼¥¿¤Ë +³¤¯¥Ç¡¼¥¿¤¬ÊÖ¤µ¤ì¤ë (¼ÂºÝ¤Ë¶ÛµÞ¥Ç¡¼¥¿¤òÆɤ߹þ¤à¤Ë¤Ï +.B recv(MSG_OOB) +¤È¥Õ¥é¥°¤ò¤Ä¤±¤ëɬÍפ¬¤¢¤ë)¡£ + +¥Ç¡¼¥¿¤Î°ì²ó¤ÎÆɤ߹þ¤ß¤Ç¤Ï¶ÛµÞ¥Þ¡¼¥¯¤ò¸Ù¤¬¤Ã¤Æ¤ÎÆɤ߹þ¤ß¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¶ÛµÞ¥Ç¡¼¥¿¤Î¸ºß¤ò +.RI ( exceptfds +°ú¤­¿ô¤ò»È¤Ã¤Æ) +.BR select (2) +·Ðͳ¤Þ¤¿¤Ï +.B SIGURG +¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤òÄ̤¸¤ÆÃΤ餵¤ì¤¿¾ì¹ç¡¢ +.B SIOCATMARK +¤Î¥Á¥§¥Ã¥¯¤ÈÆɤ߹þ¤ß (²¿¥Ð¥¤¥ÈÆɤ߹þ¤ßÍ×µá¤ò¤·¤Æ¤â¤è¤¤) ¤ò +.B SIOCATMARK +¤¬µ¶¤òÊÖ¤µ¤Ê¤¯¤Ê¤ë¤Þ¤Ç·«¤êÊÖ¤·¹Ô¤¦¤³¤È¤Ç¡¢¶ÛµÞ¥Þ¡¼¥¯¤Î°ÌÃÖ¤Þ¤Ç +Æɤ߿ʤá¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B SIOCOUTQ +¥½¥±¥Ã¥È¤ÎÁ÷¿®¥­¥å¡¼¤Ë»Ä¤Ã¤Æ¤¤¤ë̤Á÷¿®¥Ç¡¼¥¿¤ÎÎ̤òÊÖ¤¹¡£ +¥½¥±¥Ã¥È¤Ï LISTEN ¾õÂ֤ˤ¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +LISTEN ¾õÂ֤ξì¹ç¤Ë¤Ï¥¨¥é¡¼ +.RB ( EINVAL ) +¤È¤Ê¤ë¡£ +.SS ¥¨¥é¡¼½èÍý +¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥é¡¼¤¬µ¯¤³¤ë¤È¡¢ TCP ¤Ï¥Ñ¥±¥Ã¥È¤ÎºÆÁ÷¤ò»î¤ß¤ë¡£ +²¿²ó¤«¤ä¤Ã¤Æ¤âÀ®¸ù¤·¤Ê¤±¤ì¤Ð¡¢¤³¤ÎÀܳ¤ËÂФ·¤Æ +.B ETIMEOUT +¥¨¥é¡¼¤«ºÇ¸å¤Ë¼õ¿®¤·¤¿¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë¡£ +.PP +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï¡¢¤â¤Ã¤ÈÁ᤯¥¨¥é¡¼¤òÃΤ餻¤Æ¤Û¤·¤¤¾ì¹ç¤¬¤¢¤ë¡£ +¤³¤ì¤Ë¤Ï +.B IPPROTO_IP +¥ì¥Ù¥ë¤Î +.B IP_RECVERR +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤ÈÎɤ¤¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +ÅþÃ夷¤¿¥¨¥é¡¼¤Ï¤¹¤Ù¤Æ¤¿¤À¤Á¤Ë¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤ËÅϤµ¤ì¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¿µ½Å¤ËÍѤ¤¤ë¤³¤È \(em ¥ë¡¼¥Æ¥£¥ó¥°¤ÎÊѹ¹¤Ê¤É¡¢ +Ä̾濫¤ê¤¦¤ë¥Í¥Ã¥È¥ï¡¼¥¯¾õÂÖ¤ËÂФ·¤Æ TCP ¤ò¤è¤êÀȼå¤Ë¤·¤Æ¤·¤Þ¤¦¡£ +.SH ¥¨¥é¡¼ +.TP +.B EAFNOTSUPPORT +.I sin_family +¤ËÅϤµ¤ì¤¿¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Î¥¿¥¤¥×¤¬ +.B AF_INET +¤Ç¤Ï¤Ê¤«¤Ã¤¿¡£ +.TP +.B EPIPE +ÀܳÀ褬ͽ´ü¤·¤Ê¤«¤Ã¤¿¤«¤¿¤Á¤Ç¥½¥±¥Ã¥È¤ò¥¯¥í¡¼¥º¤·¤¿¡£ +¤Þ¤¿¤Ï¥·¥ã¥Ã¥È¥À¥¦¥ó¤µ¤ì¤¿¥½¥±¥Ã¥È¤ËÆɤ߹þ¤ß¤¬¼Â¹Ô¤µ¤ì¤¿¡£ +.TP +.B ETIMEDOUT +ÀܳÀ褬¡¢²¿²ó¤«¥Ç¡¼¥¿¤òºÆÁ÷¤·¤Æ¤âÈ¿±þ¤·¤Ê¤¤¡£ +.PP +.BR ip (7) +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤ä¡¢¥¸¥§¥Í¥ê¥Ã¥¯¤Ê¥½¥±¥Ã¥ÈÁؤˤª¤±¤ë¥¨¥é¡¼¤â +TCP ¤ËÊÖ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +Explicit Congestion Notification¡¢zero-copy ¤Î +.BR sendfile (2)¡¢ +ʤÓÂؤ¨¤Î¥µ¥Ý¡¼¥È¡¢SACK ³ÈÄ¥ (DSACK) ¤Ê¤É¤Î¥µ¥Ý¡¼¥È¤Ï +2.4 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +¥Õ¥©¥ï¡¼¥É³Îǧ (FACK)¡¢TIME_WAIT ¥ê¥µ¥¤¥¯¥ë¡¢Àܳ¤´¤È¤Î keepalive +¤ËÂФ¹¤ë¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ï 2.3 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +.SH ¥Ð¥° +¤Þ¤ÀÀâÌÀ¤µ¤ì¤Æ¤¤¤Ê¤¤¥¨¥é¡¼¤¬¤¢¤ë¡£ +.br +IPv6 ¤Ë´Ø¤¹¤ëµ­½Ò¤¬¤Ê¤¤¡£ +.\" Only a single Linux kernel version is described +.\" Info for 2.2 was lost. Should be added again, +.\" or put into a separate page. +.\" .SH Ãø¼Ô +.\" ¤³¤Î man ¥Ú¡¼¥¸¤ÏºÇ½é Andi Kleen ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ +.\" Alexey Kuznetsov ¤Îʸ½ñ Documentation/networking/ip-sysctl.txt +.\" ¤Î¾ðÊó¤ò¸µ¤Ë¡¢Nivedita Singhvi ¤¬ 2.4 ¸þ¤±¤Ë¹¹¿·¤·¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR accept (2), +.BR bind (2), +.BR connect (2), +.BR getsockopt (2), +.BR listen (2), +.BR recvmsg (2), +.BR sendfile (2), +.BR sendmsg (2), +.BR socket (2), +.BR ip (7), +.BR socket (7) +.sp +RFC\ 793: TCP ¤Î»ÅÍÍ¡£ +.br +RFC\ 1122: TCP ¤ÎÍ×µá»ö¹à¤È Nagle ¥¢¥ë¥´¥ê¥º¥à¤Îµ­½Ò¡£ +.br +RFC\ 1323: TCP ¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¡¦¥¦¥£¥ó¥É¥¦¥¹¥±¡¼¥ê¥ó¥°³Æ¥ª¥×¥·¥ç¥ó¡£ +.br +RFC\ 1644: TIME_WAIT assassination hazard ¤Ë´Ø¤¹¤ëµ­½Ò¡£ +.br +RFC\ 3168: Explicit Congestion Notification ¤Ë´Ø¤¹¤ëµ­½Ò¡£ +.br +RFC\ 2581: TCP íÕíÔÀ©¸æ¥¢¥ë¥´¥ê¥º¥à¡£ +.br +RFC\ 2018 ¤È RFC\ 2883: SACK ¤È¤½¤Î³ÈÄ¥¡£ diff --git a/release/man7/termio.7 b/release/man7/termio.7 new file mode 100644 index 00000000..6e331d09 --- /dev/null +++ b/release/man7/termio.7 @@ -0,0 +1,65 @@ +.\" Copyright (c) 2006 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. +.\" +.\" 28 Dec 2006 - Initial Creation +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-05-04, Akihiro MOTOKI , LDP v2.44 +.\" +.TH TERMIO 7 2006-12-28 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +termio \- System V üËö¥É¥é¥¤¥Ð¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +.SH ÀâÌÀ +.B termio +¤Ï¡¢¸Å¤¤ System V üËö¥É¥é¥¤¥Ð¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î̾Á°¤Ç¤¢¤ë¡£ +¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¡¢ +üËöÀßÄê¤òÊÝ»ý¤¹¤ë¤¿¤á¤Î +.I termio +¹½Â¤ÂΡ¢¤ª¤è¤ÓüËö°À­¤ò¼èÆÀ¡¦Êѹ¹¤¹¤ë¤¿¤á¤Î¼ï¡¹¤Î +.BR ioctl (2) +Áàºî¤òÄêµÁ¤·¤Æ¤¤¤¿¡£ + +.B termio +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¸½ºß¤Ç¤Ï»þÂåÃÙ¤ì¤Ç¤¢¤ë¡£ +POSIX.1-1990 ¤Ç¡¢¤³¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î½¤ÀµÈǤ¬ +.B termios +¤È¤¤¤¦Ì¾Á°¤Çɸ½à²½¤µ¤ì¤¿¡£ +POSIX.1 ¤Î¥Ç¡¼¥¿¹½Â¤¤Ï System V ÈǤȾ¯¤·°ã¤¤¤¬¤¢¤ë¡£ +¤Þ¤¿¡¢POSIX.1 ¤Ï System V ÈǤǸºß¤·¤¿¼ï¡¹¤Î +.BR ioctl (2) +Áàºî¤òÃÖ¤­´¹¤¨¤ë´Ø¿ô·²¤òÄêµÁ¤·¤¿ +(¤³¤Î¤è¤¦¤Ë¤Ê¤Ã¤¿¤Î¤Ï¡¢ +.BR ioctl (2) +¤¬É¸½à²½¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤³¤È¤È¡¢ +.BR ioctl (2) +¤ÎÂè»°°ú¤­¿ô¤¬²ÄÊÑĹ°ú¤­¿ô¤Ç·¿¥Á¥§¥Ã¥¯¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¤Î¤¬Íýͳ¤Ç¤¢¤ë)¡£ + +"termio" ¤È¤¤¤¦ man page ¤òõ¤·¤Æ¤¤¤ë¤Î¤Ç¤¢¤ì¤Ð¡¢ +õ¤·¤Æ¤¤¤ë¾ðÊó¤Î¤Û¤È¤ó¤É¤Ï +.BR termios (3) +¤« +.BR tty_ioctl (4) +¤Î¤É¤Á¤é¤«¤Ç¸«¤Ä¤«¤ë¤³¤È¤À¤í¤¦¡£ +.SH ´ØÏ¢¹àÌÜ +.BR termios (3), +.BR tty_ioctl (4) diff --git a/release/man7/time.7 b/release/man7/time.7 new file mode 100644 index 00000000..3321f037 --- /dev/null +++ b/release/man7/time.7 @@ -0,0 +1,198 @@ +.\" Copyright (c) 2006 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. +.\" +.\" 2008-06-24, mtk: added some details about where jiffies come into +.\" play; added section on high-resolution timers. +.\" +.\" Japanese Version Copyright (c) 2006 Yuichi SATO +.\" all rights reserved. +.\" Translated 2006-07-23 by Yuichi SATO , LDP v2.36 +.\" Updated 2007-05-04, Akihiro MOTOKI , LDP v2.44 +.\" Updated 2008-08-10, Akihiro MOTOKI , LDP v3.05 +.\" +.TH TIME 7 2010-02-25 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +time \- »þ´Ö¤È¥¿¥¤¥Þ¤Î³µÍ× +.SH ÀâÌÀ +.SS "¼Â»þ´Ö (real time) ¤È¥×¥í¥»¥¹»þ´Ö" +\fI¼Â»þ´Ö\fR¤Ï¡¢ÆÃÄê¤Î»þÅÀ¤«¤é·×¤Ã¤¿»þ´Ö¤ÈÄêµÁ¤µ¤ì¤ë¡£ +ÆÃÄê¤Î»þÅÀ¤È¤Ï¡¢²áµî¤Îɸ½àŪ¤Ê»þÅÀ +(²¼µ­¤Îµª¸µ (Epoch) ¤È¥«¥ì¥ó¥À»þ¹ï¤ÎÀâÌÀ¤ò»²¾È) ¤ä¡¢ +¥×¥í¥»¥¹¤Î°ìÀ¸¤Ë¤ª¤±¤ë²¿¤é¤«¤Î»þÅÀ (Î㤨¤Ð¡¢³«»Ï»þ) ¤Ç¤¢¤ë +.RI ( "·Ð²á»þ´Ö" )¡£ + +\fI¥×¥í¥»¥¹»þ´Ö\fR¤Ï¡¢¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ»È¤ï¤ì¤¿Áí CPU »þ´Ö¤ÈÄêµÁ¤µ¤ì¤ë¡£ +¿¤¯¤Î¾ì¹ç¡¢\fI¥æ¡¼¥¶\fR»þ´Ö¤È\fI¥·¥¹¥Æ¥à\fR»þ´Ö¤Ëʬ¤±¤é¤ì¤ë¡£ +¥æ¡¼¥¶ CPU »þ´Ö¤Ï¡¢¥³¡¼¥É¤ò¥æ¡¼¥¶¥â¡¼¥É¤Ç¼Â¹Ô¤¹¤ë¤Î¤Ë»È¤Ã¤¿»þ´Ö¤Ç¤¢¤ë¡£ +¥·¥¹¥Æ¥à CPU »þ´Ö¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¤¿¤á¤Ë +¥«¡¼¥Í¥ë¤¬¥·¥¹¥Æ¥à¥â¡¼¥É¤Ç¼Â¹Ô¤¹¤ë¤Î¤Ë»È¤Ã¤¿»þ´Ö¤Ç¤¢¤ë +(Î㤨¤Ð¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¼Â¹Ô¤¹¤ë¤Î¤Ë»È¤Ã¤¿»þ´Ö)¡£ +.BR time (1) +¥³¥Þ¥ó¥É¤Ï¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤ËÈñ¤µ¤ì¤¿Áí CPU »þ´Ö¤ò·×¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ +¥×¥í¥°¥é¥à¤Ï¡¢¼«¿È¤¬Èñ¤·¤¿Áí CPU »þ´Ö¤ò +.BR times (2), +.BR getrusage (2), +.BR clock (3) +¤ò»È¤Ã¤Æ·×¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SS ¥Ï¡¼¥É¥¦¥§¥¢¥¯¥í¥Ã¥¯ +¿¤¯¤Î¥³¥ó¥Ô¥å¡¼¥¿¤¬ (ÅÅÃӤǶîÆ°¤µ¤ì¤ë) ¥Ï¡¼¥É¥¦¥§¥¢¥¯¥í¥Ã¥¯¤ò»ý¤Ã¤Æ¤¤¤ë¡£ +¥«¡¼¥Í¥ë¤Ïµ¯Æ°»þ¤Ë¥½¥Õ¥È¥¦¥§¥¢¥¯¥í¥Ã¥¯¤ò½é´ü²½¤¹¤ë¤¿¤á¤Ë +¥Ï¡¼¥É¥¦¥§¥¢¥¯¥í¥Ã¥¯¤òÆɤ߹þ¤à¡£ +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¡¢ +.BR rtc (4) +¤È +.BR hwclock (8) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SS "¥½¥Õ¥È¥¦¥§¥¢¥¯¥í¥Ã¥¯, HZ, Jiffy" +¥¿¥¤¥à¥¢¥¦¥È¤òÀßÄꤷ¤¿¤ê (Î㤨¤Ð +.BR select (2), +.BR sigtimedwait (2))¡¢ +.\" semtimedop(), mq_timedwait(), io_getevents(), poll() ¤ÏƱ¤¸ futex ¤Ç¤¢¤ê¡¢ +.\" ¤·¤¿¤¬¤Ã¤Ã¤Æ sem_timedwait() ¤Ï¹âÀºÅÙ¥¿¥¤¥Þ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤è¤¦¤Ç¤¢¤ë¡£ +CPU »þ´Ö¤ò·×¬¤·¤¿¤ê (Î㤨¤Ð +.BR getrusage (2)) ¤¹¤ëÍÍ¡¹¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀºÅÙ¤Ï +.I ¥½¥Õ¥È¥¦¥§¥¢¥¯¥í¥Ã¥¯ +¤Îʬ²òǽ (resolution) ¤ËÀ©¸Â¤µ¤ì¤ë¡£ +¥½¥Õ¥È¥¦¥§¥¢¥¯¥í¥Ã¥¯¤È¤Ï¡¢¥«¡¼¥Í¥ë¤¬´ÉÍý¤¹¤ë +.I jiffy +ñ°Ì¤Ç»þ´Ö¤ò·×¬¤¹¤ë¥¯¥í¥Ã¥¯¤Î¤³¤È¤Ç¤¢¤ë¡£ +jiffy ¤ÎÂ礭¤µ¤Ï¥«¡¼¥Í¥ëÄê¿ô +.I HZ +¤ÎÃͤǷèÄꤵ¤ì¤ë¡£ + +.I HZ +¤ÎÃͤϥ«¡¼¥Í¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤È¥Ï¡¼¥É¥¦¥§¥¢¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç°Û¤Ê¤ë¡£ +i386 ¤Î¾ì¹ç¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +2.4.x ¤È¤½¤ì¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢HZ ¤Ï 100 ¤Ç¤¢¤Ã¤¿¤Î¤Ç¡¢ +jiffy ¤ÎÃÍ¤Ï 0.01 ÉäˤʤäƤ¤¤¿¡£ +2.6.0 °Ê¹ß¤Ç¤Ï¡¢HZ ¤Ï 1000 ¤ËÁý¤ä¤µ¤ì¤¿¤Î¤Ç¡¢jiffy ¤ÎÃÍ¤Ï 0.001 ÉäǤ¢¤ë¡£ +¥«¡¼¥Í¥ë 2.6.13 °Ê¹ß¤Ç¤Ï¡¢HZ ¤ÎÃͤϥ«¡¼¥Í¥ëÀßÄê¥Ñ¥é¥á¡¼¥¿¤Ë¤Ê¤ê¡¢ +100, 250 (¥Ç¥Õ¥©¥ë¥È), 1000 ¤È¤¤¤¦ÃͤˤǤ­¤ë¡£ +¤½¤ì¤¾¤ì jiffy ¤ÎÃÍ¤Ï 0.01, 0.004, 0.001 Éäˤʤ롣 +¥«¡¼¥Í¥ë 2.6.20 °Ê¹ß¤Ç¤Ï¡¢300 ¤âÍøÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +300 ¤Ï°ìÈÌŪ¤Ê±ÇÁü¥Õ¥ì¡¼¥à¥ì¡¼¥È¤Î¸øÇÜ¿ô¤Ç¤¢¤ë (PAL, 25HZ; NTSC, 30HZ)¡£ + +.BR times (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÆüì¤Ê¥±¡¼¥¹¤Ç¤¢¤ê¡¢ +¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ëÄê¿ô +.I USER_HZ +¤ÇÄêµÁ¤µ¤ì¤¿Î³Å٤ǻþ´Ö¤òÊó¹ð¤¹¤ë¡£ +¥æ¡¼¥¶¶õ´Ö¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï +.I sysconf(_SC_CLK_TCK) +¤ò»È¤Ã¤Æ¤³¤ÎÄê¿ô¤ÎÃͤòÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.\" glibc gets this info with a little help from the ELF loader; +.\" see glibc elf/dl-support.c and kernel fs/binfmt_elf.c. +.\" +.SS "¹âÀºÅÙ¥¿¥¤¥Þ" +Linux 2.6.21 ¤è¤êÁ°¤Ç¤Ï¡¢¥¿¥¤¥Þ¤ä¥¹¥ê¡¼¥×´ØÏ¢¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀºÅÙ¤â +jiffy ¤Î¥µ¥¤¥º¤Ë¤è¤êÀ©¸Â¤µ¤ì¤Æ¤¤¤¿¡£ + +Linux 2.6.21 °Ê¹ß¤Ç¤Ï¡¢Linux ¤Ï¹âÀºÅÙ¥¿¥¤¥Þ (high-resolution timers; HRTs) +¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤ª¤ê¡¢ +.B CONFIG_HIGH_RES_TIMERS +¤ÇÀ©¸æ¤Ç¤­¤ë¡£ +¹âÀºÅÙ¥¿¥¤¥Þ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥¿¥¤¥Þ¤È¥¹¥ê¡¼¥×´ØÏ¢¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë +¤ÎÀºÅ٤Ϥâ¤Ï¤ä jiffy ¤ËÀ©Ì󤵤ì¤ë¤³¤È¤Ï¤Ê¤¯¡¢ +¥Ï¡¼¥É¥¦¥§¥¢¤¬µö¤¹¸Â¤ê¤ÎÀºÅ٤Ȥʤë +(ºÇ¶á¤Î¥Ï¡¼¥É¥¦¥§¥¢¤Ç¤Ï¥Þ¥¤¥¯¥íÉÃñ°Ì¤ÎÀºÅÙ¤¬°ìÈÌŪ¤Ç¤¢¤ë)¡£ +¹âÀºÅÙ¥¿¥¤¥Þ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤Ï¡¢ +.BR clock_getres (2) +¤ò¸Æ¤Ó½Ð¤·¤Æʬ²òǽ¤ò³Îǧ¤¹¤ë¤«¡¢ +.I /proc/timer_list +Æâ¤Î "resolution" ¥¨¥ó¥È¥ê¤ò»²¾È¤¹¤ë¤«¤ÇȽÃǤǤ­¤ë¡£ + +¹âÀºÅÙ¥¿¥¤¥Þ¤Ï¤¹¤Ù¤Æ¤Î¥Ï¡¼¥É¥¦¥§¥¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë +Ìõ¤Ç¤Ï¤Ê¤¤ (Âбþ¤·¤Æ¤¤¤ë¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ï x86, arm, powerpc ¤Ç¤¢¤ë)¡£ +.SS "µª¸µ" +Unix ¥·¥¹¥Æ¥à¤Ï»þ¹ï¤ò +µª¸µ (1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤ÎÉÿô¤Çɽ¸½¤¹¤ë¡£ + +¥×¥í¥°¥é¥à¤Ï \fI¥«¥ì¥ó¥À»þ¹ï\fR ¤ò +.BR gettimeofday (2) +¤ò»È¤Ã¤Æ·×¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î´Ø¿ô¤Ïµª¸µ¤«¤é¤Î·Ð²á»þ´Ö¤ò (Éäȥޥ¤¥¯¥íÉäÇ) ÊÖ¤¹¡£ +.BR time (2) +¤ÏƱÍͤξðÊó¤òÄ󶡤¹¤ë¤¬¡¢ºÇ¤â¶á¤¤ÉäÎÀºÅÙ¤·¤«¤Ê¤¤¡£ +¥·¥¹¥Æ¥à»þ¹ï¤Ï +.BR settimeofday (2) +¤ÇÊѹ¹¤Ç¤­¤ë¡£ +.SS "Í×ÁÇÊ̤λþ¹ï" +¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ÎÃæ¤Ë¤Ï +.I tm +·¿¤Î¹½Â¤ÂΤò»È¤¦¤â¤Î¤¬¤¢¤ë¡£ +¤³¤Î¹½Â¤ÂΤÏ\fIÍ×ÁÇÊ̤λþ¹ï\fR¤òɽ¤·¡¢ +»þ¹ï¤ÎÃͤòÊÌ¡¹¤ÎÍ×ÁÇ (ǯ¡¦·î¡¦Æü¡¦»þ¡¦Ê¬¡¦ÉäʤÉ) ¤Ëʬ¤±¤Æ³ÊǼ¤¹¤ë¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï +.BR ctime (3) +¤Ëµ­½Ò¤µ¤ì¤Æ¤ª¤ê¡¢¥«¥ì¥ó¥À»þ¹ï¤òÍ×ÁÇÊ̤λþ¹ï¤ËÊÑ´¹¤¹¤ë +´Ø¿ô¤Ë¤Ä¤¤¤Æ¤âµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +Í×ÁÇÊ̤λþ¹ï¤òɽ¼¨²Äǽ¤Êʸ»úÎó¤ËÊÑ´¹¤¹¤ë´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.BR ctime (3), +.BR strftime (3), +.BR strptime (3) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.SS "¥¿¥¤¥Þ¤Î¥¹¥ê¡¼¥×¤ÈÀßÄê" +ÍÍ¡¹¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤È´Ø¿ô¤Ë¤è¤ê¡¢»ØÄꤵ¤ì¤¿°ìÄê¤Î»þ´Ö¡¢ +¥×¥í¥°¥é¥à¤Ï¥¹¥ê¡¼¥× (¼Â¹Ô¤òÄä»ß) ¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¡£ +.BR nanosleep (2), +.BR clock_nanosleep (2), +.BR sleep (3) +¤ò»²¾È¤¹¤ë¤³¤È¡£ + +ÍÍ¡¹¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤è¤ê¡¢¥×¥í¥»¥¹¤Ï¾­Íè¤Î¤¢¤ë»þÅÀ¤Ç +Í­¸ú´ü´Ö¤¬½ªÎ»¤¹¤ë¥¿¥¤¥Þ¤òÀßÄê¤Ç¤­¤ë¡£ +¤Þ¤¿¥ª¥×¥·¥ç¥ó¤È¤·¤Æ·«¤êÊÖ¤·´Ö³Ö¤¬»ØÄê¤Ç¤­¤ë¤â¤Î¤â¤¢¤ë¡£ +.BR alarm (2), +.BR getitimer (2), +.BR timerfd_create (2), +.BR timer_create (2) +¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR date (1), +.BR time (1), +.BR adjtimex (2), +.BR alarm (2), +.BR clock_gettime (2), +.BR clock_nanosleep (2), +.BR getitimer (2), +.BR getrlimit (2), +.BR getrusage (2), +.BR gettimeofday (2), +.BR nanosleep (2), +.BR stat (2), +.BR time (2), +.BR timer_create (2), +.BR timerfd_create (2), +.BR times (2), +.BR utime (2), +.BR adjtime (3), +.BR clock (3), +.BR clock_getcpuclockid (3), +.BR ctime (3), +.BR pthread_getcpuclockid (3), +.BR sleep (3), +.BR strftime (3), +.BR strptime (3), +.BR timeradd (3), +.BR usleep (3), +.BR rtc (4), +.BR hwclock (8) diff --git a/release/man7/udp.7 b/release/man7/udp.7 new file mode 100644 index 00000000..ce42abfb --- /dev/null +++ b/release/man7/udp.7 @@ -0,0 +1,259 @@ +.\" This man page is Copyright (C) 1999 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. +.\" $Id: udp.7,v 1.7 2000/01/22 01:55:05 freitag Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" Updated 2005-10-09, Kentaro Shirakata +.\" Updated 2007-01-05, Akihiro MOTOKI , LDP v2.43 +.\" Updated 2008-12-29, Akihiro MOTOKI, LDP v3.14 +.\" Updated 2010-04-10, Akihiro MOTOKI, LDP v3.24 +.\" +.TH UDP 7 2009-09-30 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +udp \- IPv4 ¤Î ¥æ¡¼¥¶¡¼¥Ç¡¼¥¿¥°¥é¥à¥×¥í¥È¥³¥ë +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.B udp_socket = socket(AF_INET, SOCK_DGRAM, 0); +.SH ÀâÌÀ +¤³¤ì¤Ï RFC\ 768 ¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤ë User Datagram Protocol ¤Î¼ÂÁõ¤Ç¤¢¤ë¡£ +UDP ¤Ï¥³¥Í¥¯¥·¥ç¥ó¥ì¥¹¤Î¡¢¿®ÍêÀ­¤ÎÄ㤤¥Ç¡¼¥¿¥Ñ¥±¥Ã¥È¥µ¡¼¥Ó¥¹¤Ç¤¢¤ë¡£ +¥Ñ¥±¥Ã¥È¤ÏÅþÃåÁ°¤ËʤÓÂؤ¨¤é¤ì¤¿¤êÊ£À½¤µ¤ì¤¿¤ê¤¹¤ë¡£ +UDP ¤ÏžÁ÷¥¨¥é¡¼¤ò¸¡½Ð¤¹¤ë¤¿¤á¤Ë¥Á¥§¥Ã¥¯¥µ¥à¤òÀ¸À®¡¦¥Á¥§¥Ã¥¯¤¹¤ë¡£ + +UDP ¥½¥±¥Ã¥È¤¬À¸À®¤µ¤ì¤ë¤È¤­¡¢ +¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤ä¥ê¥â¡¼¥È¥¢¥É¥ì¥¹¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£ +Àµ¤·¤¤¹Ô¤­À襢¥É¥ì¥¹¤ò°ú¿ô¤È¤·¤Æ +.BR sendto (2) +¤ä +.BR sendmsg (2) +¤ò¸Æ¤Ù¤Ð¡¢¥Ç¡¼¥¿¥°¥é¥à¤Ï¤¿¤À¤Á¤ËÁ÷¿®¤µ¤ì¤ë¡£ +¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.BR connect (2) +¤ò¸Æ¤Ö¤È¡¢¥Ç¥Õ¥©¥ë¥È¤Î¹Ô¤­À襢¥É¥ì¥¹¤¬ÀßÄꤵ¤ì¡¢ +.BR send (2) +¤ä +.BR write (2) +¤ò»È¤Ã¤Æ¡¢¹Ô¤­À襢¥É¥ì¥¹¤Î»ØÄê¤Ê¤·¤Ë¥Ç¡¼¥¿¥°¥é¥à¤òÁ÷¿®¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ +¤³¤Î¾ì¹ç¤Ç¤â¡¢¹Ô¤­À襢¥É¥ì¥¹¤ò +.BR sendto (2) +¤ä +.BR sendmsg (2) +¤ËÅϤ»¤Ð¡¢¥Ç¥Õ¥©¥ë¥È°Ê³°¤Î¥¢¥É¥ì¥¹¤ËÁ÷¿®²Äǽ¤Ç¤¢¤ë¡£ +¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤¹¤ë¤¿¤á¤Ë¡¢¤Þ¤º¥½¥±¥Ã¥È¤ò +.BR bind (2) +¤òÍѤ¤¤Æ¥í¡¼¥«¥ë¤Ê¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤»¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢¥½¥±¥Ã¥ÈÁؤϼ«Æ°Åª¤Ë +.I /proc/sys/net/ipv4/ip_local_port_range +¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÈϰϤγ°¤Ç¶õ¤¤¤Æ¤¤¤ë¥í¡¼¥«¥ë¤Ê¥Ý¡¼¥È¤ò³ä¤êÅö¤Æ¡¢ +¥½¥±¥Ã¥È¤ò +.B INADDR_ANY +¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¡£ + +¼õ¿®Æ°ºî¤Ï¥Ñ¥±¥Ã¥È¤ò°ì¤Ä¤À¤±ÊÖ¤¹¡£ÅϤ·¤¿¥Ð¥Ã¥Õ¥¡¤è¤ê¤â¥Ñ¥±¥Ã¥È¤¬ +¾®¤µ¤±¤ì¤Ð¡¢¤½¤Î¥Ñ¥±¥Ã¥È¤ÎÂ礭¤µ¤Î¥Ç¡¼¥¿¤À¤±¤¬ÊÖ¤µ¤ì¤ë¡£ +µÕ¤Ë¥Ð¥Ã¥Õ¥¡¤è¤ê¤âÂ礭¤¤¾ì¹ç¤Ï¥Ñ¥±¥Ã¥È¤Ï´Ý¤á¤é¤ì¡¢ +.B MSG_TRUNC +¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£ +.B MSG_WAITALL +¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ + +IP ¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.BR ip (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ÆÆɤ߽ñ¤­¤Ç¤­¤ë¡£ +¤³¤ì¤é¤ÏŬÀÚ¤Ê +.I /proc +¥Ñ¥é¥á¡¼¥¿¤¬Í­¸ú¤Ê¾ì¹ç¤Ë¸Â¤Ã¤Æ¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ½èÍý¤µ¤ì¤ë +(¤·¤«¤·Ìµ¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ç¤â¥æ¡¼¥¶¡¼¤Ë¤ÏÅϤµ¤ì¤ë)¡£ +.BR ip (7) +¤ò»²¾È¤Î¤³¤È¡£ + +.B MSG_DONTROUTE +¥Õ¥é¥°¤¬Á÷¿®»þ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ +¹Ô¤­À襢¥É¥ì¥¹¤Ï¥í¡¼¥«¥ë¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤«¤é +»²¾È¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¥Ñ¥±¥Ã¥È¤Ï¤½¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤·¤«Á÷¤é¤ì¤Ê¤¤¡£ + +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢Linux ¤Î UDP ¤Ï Path MTU Discovery ¤ò¹Ô¤¦¡£ +¤Ä¤Þ¤ê¡¢¥«¡¼¥Í¥ë¤ÏÆÃÄê¤Î°¸Àè IP ¥¢¥É¥ì¥¹¤Î MTU (Maximum Transmission Unit; +ºÇÂçžÁ÷ñ°Ì) ¤òµ­Ï¿¤·¡¢UDP ¥Ñ¥±¥Ã¥È¤Î½ñ¤­¹þ¤ß¤¬ MTU ¤òĶ¤¨¤¿¾ì¹ç +.B EMSGSIZE +¤òÊÖ¤¹¡£ +.B EMSGSIZE +¤òÊÖ¤µ¤ì¤¿¾ì¹ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤ò¾®¤µ¤¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +.B IP_MTU_DISCOVER +¤Þ¤¿¤Ï +.I /proc/sys/net/ipv4/ip_no_pmtu_disc +¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ Path MTU Discovery ¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤â¤Ç¤­¤ë +(¾ÜºÙ¤Ï +.BR ip (7) +¤ò»²¾È)¡£ +Path MTU Discovery ¤ò̵¸ú¤Ë¤·¤¿¾ì¹ç¤Ï¡¢¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤¬ +¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î MTU ¤è¤ê¤âÂ礭¤¤¤È UDP ¤Ï¤½¤Î¥Ñ¥±¥Ã¥È¤ò +¥Õ¥é¥°¥á¥ó¥È²½¤·¤ÆÁ÷½Ð¤¹¤ë¡£ +¤·¤«¤·¤Ê¤¬¤é¡¢À­Ç½¤È¿®ÍêÀ­¤ÎÍýͳ¤«¤é Path MTU Discovery ¤ò +̵¸ú¤Ë¤¹¤ë¤Î¤Ï¿ä¾©¤Ç¤­¤Ê¤¤¡£ +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +UDP ¤Ï IPv4 ¤Î +.I sockaddr_in +¥¢¥É¥ì¥¹¥Õ¥©¡¼¥Þ¥Ã¥È¤òÍѤ¤¤ë¡£¤³¤ì¤Ï +.BR ip (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.SS ¥¨¥é¡¼½èÍý +Ã×̿Ū¤Ê¥¨¥é¡¼¤Ï¡¢¤¿¤È¤¨¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢ +¤¹¤Ù¤Æ¥¨¥é¡¼Ìá¤êÃͤȤ·¤Æ¥æ¡¼¥¶¡¼¤ËÅϤµ¤ì¤ë¡£ +¤³¤ì¤Ë¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¤«¤é¼õ¤±¼è¤ëÈóƱ´ü¥¨¥é¡¼¤â´Þ¤Þ¤ì¤ë¡£ +Ʊ¤¸¥½¥±¥Ã¥È¤ò»È¤Ã¤ÆÁ÷¿®¤·¤¿ÀΤΥѥ±¥Ã¥È¤Ë´Ø¤¹¤ë¥¨¥é¡¼¤ò¼õ¤±¼è¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î¿¶¤ëÉñ¤¤¤Ï¾¤Î BSD ¥½¥±¥Ã¥È¤Î¼ÂÁõ¤Î¿¤¯¤È¤Ï°Û¤Ê¤ë¡£ +¤³¤ì¤é¤Ç¤Ï¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¥¨¥é¡¼¤òÁ´¤¯ÊÖ¤µ¤Ê¤¤¡£ +Linux ¤Î¿¶¤ëÉñ¤¤¤Ï +.B RFC\ 1122 +¤Ç¤Î»ØÄê¤Ë½¾¤Ã¤¿¤â¤Î¤Ç¤¢¤ë¡£ + +Linux 2.0 ¤È 2.2 ¤Ç¤Ï¡¢¸Å¤¤¥³¡¼¥É¤È¤Î¸ß´¹À­¤Î¤¿¤á¤Ë¡¢ +.B SO_BSDCOMPAT +.B SOL_SOCKET +¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ì¤Ð¡¢¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤ë +¾ì¹ç¤Ë¸Â¤Ã¤Æ¥ê¥â¡¼¥È¤Î¥¨¥é¡¼¤ò¼õ¿®¤¹¤ë¤è¤¦¤Ë¤Ç¤­¤¿ +.RB ( EPROTO " ¤È " EMSGSIZE +¤ò½ü¤¯)¡£ +¥í¡¼¥«¥ë¤ÇÀ¸À®¤µ¤ì¤¿¥¨¥é¡¼¤Ï¾ï¤ËÅϤµ¤ì¤ë¡£ +¤³¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Î¥µ¥Ý¡¼¥È¤Ï¤½¤ì°Ê¹ß¤Î¥Ð¡¼¥¸¥ç¥ó¤Î Linux ¤Ç +ºï½ü¤µ¤ì¤¿¡£¾ÜºÙ¤Ï +.BR socket (7) +¤ò»²¾È¡£ + +.B IP_RECVERR +¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢ +¤¹¤Ù¤Æ¤Î¥¨¥é¡¼¤Ï¥½¥±¥Ã¥È¤Î¥¨¥é¡¼¥­¥å¡¼¤ËÊݸ¤µ¤ì¤ë¡£ +¤³¤ì¤Ï +.B MSG_ERRQUEUE +¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¤Æ +.BR recvmsg (2) +¤ò¸Æ¤Ù¤Ð¼õ¿®¤Ç¤­¤ë¡£ +.SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ +¥·¥¹¥Æ¥àÁ´ÂΤΠUDP ¥Ñ¥é¥á¡¼¥¿ÀßÄê¤Ë¤Ï¡¢ +.I /proc/sys/net/ipv4/ +¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +.TP +.IR udp_mem " (Linux 2.6.25 °Ê¹ß)" +¤³¤ì¤Ï 3 ¤Ä¤ÎÀ°¿ô¤«¤é¤Ê¤ë¥Ù¥¯¥È¥ëÃͤǡ¢ +UDP ¤ÎÁ´¥½¥±¥Ã¥È¤Î¥­¥å¡¼¤ÇÍøÍѲÄǽ¤Ê¥Ú¡¼¥¸¿ô¤òÀ©¸æ¤¹¤ë¡£ +.RS +.TP 10 +.I min +¤³¤Î¥Ú¡¼¥¸¿ô¤è¤ê¾¯¤Ê¤±¤ì¤Ð¡¢UDP ¤Ï¤½¤Î¥á¥â¥ê»ÈÍѤ˴ؤ·¤Æ +´³¾Ä¤µ¤ì¤Ê¤¤¡£ +UDP ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥êÁíÎ̤¬¤³¤ÎÃͤòĶ²á¤¹¤ë¤È¡¢ +UDP ¤Ï¥á¥â¥ê»ÈÍÑÎ̤òÄ´À°¤·»Ï¤á¤ë¡£ +.TP +.I pressure +¤³¤ÎÃÍ¤Ï +.I tcp_mem +¤Î·Á¼° +.RB ( tcp (7) +»²¾È) ¤È¹ç¤ï¤»¤ë¤¿¤á¤ËƳÆþ¤µ¤ì¤¿ +.TP +.I max +UDP ¤ÎÁ´¥½¥±¥Ã¥È¤Î¥­¥å¡¼¤ÇÍøÍѲÄǽ¤Ê¥Ú¡¼¥¸¿ô¡£ +.RE +.IP +¤³¤ì¤é¤Î 3 ¤Ä¤ÎÃͤΥǥե©¥ë¥ÈÃͤϡ¢ +¥Ö¡¼¥È»þ¤ËÍøÍѲÄǽ¤Ê¥á¥â¥êÁíÎ̤«¤é·×»»¤µ¤ì¤ë¡£ +.TP +.IR udp_rmem_min " (integer; ¥Ç¥Õ¥©¥ë¥ÈÃÍ: PAGE_SIZE; Linux 2.6.25 °Ê¹ß)" +¥á¥â¥ê»ÈÍÑÎ̤ÎÄ´À°Ãæ¤Ë¡¢UDP ¥½¥±¥Ã¥È¤¬»ÈÍѤǤ­¤ë¼õ¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇ¾®ÃÍ +(¥Ð¥¤¥Èñ°Ì)¡£ +UDP ¤ÎÁ´¥½¥±¥Ã¥È¤Î¥Ú¡¼¥¸»ÈÍÑÎ̤ιç·×¤¬ +.I udp_mem +pressure ¤òĶ²á¤·¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢ +³Æ UDP ¥½¥±¥Ã¥È¤Ï¥Ç¡¼¥¿¤Î¼õ¿®¤Ë¤³¤Î¥µ¥¤¥ºÊ¬¤À¤±¤Ï»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.IR udp_wmem_min " (integer; ¥Ç¥Õ¥©¥ë¥ÈÃÍ: PAGE_SIZE; Linux 2.6.25 °Ê¹ß)" +¥á¥â¥ê»ÈÍÑÎ̤ÎÄ´À°Ãæ¤Ë¡¢UDP ¥½¥±¥Ã¥È¤¬»ÈÍѤǤ­¤ëÁ÷¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇ¾®ÃÍ +(¥Ð¥¤¥Èñ°Ì)¡£ +UDP ¤ÎÁ´¥½¥±¥Ã¥È¤Î¥Ú¡¼¥¸»ÈÍÑÎ̤ιç·×¤¬ +.I udp_mem +pressure ¤òĶ²á¤·¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢ +³Æ UDP ¥½¥±¥Ã¥È¤Ï¥Ç¡¼¥¿¤ÎÁ÷¿®¤Ë¤³¤Î¥µ¥¤¥ºÊ¬¤À¤±¤Ï»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +UDP ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÀßÄê¤Þ¤¿¤Ï¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢ +¼èÆÀ¤Ë¤Ï +.BR getsockopt (2) +¤ò¡¢ÀßÄê¤Ë¤Ï +.BR setsockopt (2) +¤ò¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë°ú¿ô¤Ë +.B IPPROTO_UDP +¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤¹¡£ +.TP +.BR UDP_CORK " (Linux 2.5.44 °Ê¹ß)" +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤ë¤È¡¢¤³¤Î¥½¥±¥Ã¥È¤ÎÁ´¤Æ¤Î¥Ç¡¼¥¿½ÐÎÏ¤Ï +°ì¤Ä¤Î¥Ç¡¼¥¿¥°¥é¥à¤ËÃßÀѤµ¤ì¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤¬Ìµ¸ú²½¤µ¤ì¤¿»þ¤Ë +Á÷¿®¤µ¤ì¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï°Ü¿¢À­¤ò¹Íθ¤·¤¿¥³¡¼¥É¤Ç¤ÏÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\" FIXME document UDP_ENCAP (new in kernel 2.5.67) +.\" From include/linux/udp.h: +.\" /* UDP encapsulation types */ +.\" #define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */ +.\" #define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ +.\" #define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */ +.SS ioctl +°Ê²¼¤Ë¼¨¤¹ ioctl ¤Ï +.BR ioctl (2) +¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£ +Àµ¤·¤¤Ê¸Ë¡¤Ï°Ê²¼¤ÎÄ̤ꡣ +.PP +.RS +.nf +.BI int " value"; +.IB error " = ioctl(" udp_socket ", " ioctl_type ", &" value ");" +.fi +.RE +.TP +.BR FIONREAD " (" SIOCINQ ) +integer ¤Î¥Ý¥¤¥ó¥¿¤ò°ú¿ô¤È¤·¤Æ¼è¤ë¡£ +¼¡¤ËÂÔµ¡¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¥°¥é¥à¤Î¥µ¥¤¥º¤ò¥Ð¥¤¥Èñ°Ì¤ÎÀ°¿ô¤ÇÊÖ¤¹¡£ +ÂÔµ¡¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¥°¥é¥à¤¬¤Ê¤¤¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£ +.TP +.BR TIOCOUTQ " (" SIOCOUTQ ) +¥í¡¼¥«¥ëÁ÷¿®¥­¥å¡¼¤Ë¤¢¤ë¥Ç¡¼¥¿¥µ¥¤¥º¤ò¥Ð¥¤¥Èñ°Ì¤ÇÊÖ¤¹¡£ +Linux 2.4 °Ê¾å¤Ç¤Î¤ßÂбþ¤·¤Æ¤¤¤ë¡£ +.PP +¤µ¤é¤Ë¡¢ +.BR ip (7) +¤È +.BR socket (7) +¤Ç½Ò¤Ù¤é¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î ioctl ¤âÂбþ¤·¤Æ¤¤¤ë¡£ +.SH ¥¨¥é¡¼ +.BR socket (7) +¤ä +.BR ip (7) +¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥¨¥é¡¼¤¬¡¢ +UDP ¥½¥±¥Ã¥È¤ÎÁ÷¼õ¿®¤ÇÊÖ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +.TP +.B ECONNREFUSED +¹Ô¤­À襢¥É¥ì¥¹¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤ë¼õ¿®¼Ô¤¬¤¤¤Ê¤¤¡£ +¤³¤ì¤Ï°ÊÁ°¤Î¥Ñ¥±¥Ã¥È¤¬¤½¤Î¥Ñ¥±¥Ã¥È¤ò +¾å½ñ¤­Á÷¿®¤·¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¤³¤È¤¬Â¿¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.B IP_RECVERR +¤Ï Linux 2.2 ¤Î¿·¤·¤¤µ¡Ç½¤Ç¤¢¤ë¡£ +.\" .SH Ãø¼Ô +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï Andi Kleen ¤¬½ñ¤¤¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ip (7), +.BR raw (7), +.BR socket (7), +.BR udplite (7) + +RFC\ 768 : User Datagram Protocol +.br +RFC\ 1122 : ¥Û¥¹¥È¤ÎɬÍ×¾ò·ï +.br +RFC\ 1191 : path MTU discovery ¤Îµ­½Ò diff --git a/release/man7/udplite.7 b/release/man7/udplite.7 new file mode 100644 index 00000000..b7fa6b7a --- /dev/null +++ b/release/man7/udplite.7 @@ -0,0 +1,159 @@ +.\" Copyright (c) 2008 by Gerrit Renker +.\" +.\" 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. +.\" +.\" $Id: udplite.7,v 1.12 2008/07/23 15:22:22 gerrit Exp gerrit $ +.\" +.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.07 +.\" +.TH UDPLITE 7 2008-12-03 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +udplite \- ·ÚÎ̤ʥ桼¥¶¡¼¥Ç¡¼¥¿¥°¥é¥à¥×¥í¥È¥³¥ë +.SH ½ñ¼° +.B #include +.br +.\" FIXME . see #defines under `BUGS', +.\" when glibc supports this, add +.\" #include +.sp +.B sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDPLITE); +.SH ÀâÌÀ +¤³¤ì¤Ï RFC\ 3828 ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë·ÚÎ̤ʥ桼¥¶¡¼¥Ç¡¼¥¿¥°¥é¥à¥×¥í¥È¥³¥ë +(Lightweight User Datagram Protocol; UDP-Lite) ¤Î¼ÂÁõ¤Ç¤¢¤ë¡£ + +UDP-Lite ¤Ï UDP (RFC\ 768) ¤Î³ÈÄ¥¤Ç¡¢²ÄÊÑĹ¤Î¥Á¥§¥Ã¥¯¥µ¥à¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +¤³¤Î¥×¥í¥È¥³¥ë¤¬¸ú²Ì¤òȯ´ø¤¹¤ë¤Î¤Ï¡¢¾¯¤·¤À¤±²õ¤ì¤¿¥Ç¡¼¥¿¥°¥é¥à¤¬¤¢¤Ã¤¿¾ì¹ç¤Ë¡¢ +¤½¤Î¥Ç¡¼¥¿¥°¥é¥à¤ò²¼°Ì¥ì¥¤¥ä¡¼¤Î¥×¥í¥È¥³¥ë¤ËÇÑ´þ¤µ¤»¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +¤½¤ì¤òÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ê¡¢¤¢¤ë¼ï¤Î¥Þ¥ë¥Á¥á¥Ç¥£¥¢Å¾Á÷¤Ë¤ª¤¤¤Æ¤Ç¤¢¤ë¡£ + +²ÄÊÑĹ¤Î¥Á¥§¥Ã¥¯¥µ¥à¤ÎÂоÝÈÏ°Ï¤Ï +.BR setsockopt (2) +¥ª¥×¥·¥ç¥ó·Ðͳ¤ÇÀßÄꤵ¤ì¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢UDP ¤È°Û¤Ê¤ë¤Î¤Ï +°ã¤¦ IP ¥×¥í¥È¥³¥ë¼±ÊÌ»Ò (IANA ÈÖ¹æ 136) ¤ò»ÈÍѤ¹¤ëÅÀ¤À¤±¤Ç¤¢¤ë¡£ + +UDP-Lite ¤Î¼ÂÁõ¤Ï +.BR udp (7) +¤Î´°Á´¤Ê³ÈÄ¥¡¢¤¹¤Ê¤ï¤Á API ¤È API ¤ÎÆ°ºî¤ÏƱ¤¸¤Ç¤¢¤ë¡£ +¤³¤ì¤Ë²Ã¤¨¤Æ¡¢2 ¤Ä¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬¥Á¥§¥Ã¥¯¥µ¥à¤ÎÂоÝÈϰϤò +À©¸æ¤¹¤ë¤¿¤á¤ËÄ󶡤µ¤ì¤Æ¤¤¤ë¡£ +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +UDP-Litev4 ¤Ï +.BR ip (7) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë +.I sockaddr_in +¥¢¥É¥ì¥¹¤ò»ÈÍѤ¹¤ë¡£ +UDP-Litev6 ¤Ï +.BR ipv6 (7) +¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë +.I sockaddr_in6 +¥¢¥É¥ì¥¹¤ò»ÈÍѤ¹¤ë¡£ +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +UDP-Lite ¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÀßÄê/¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢ +¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë°ú¤­¿ô¤Ë +.B IPPROTO_UDPLITE +¤ò»ØÄꤷ¤Æ¡¢¼èÆÀ»þ¤Ë¤Ï +.BR getsockopt (2) +¤ò¡¢ÀßÄê»þ¤Ë¤Ï +.BR setsockopt (2) +¤ò¸Æ¤Ó½Ð¤¹¡£¤µ¤é¤Ë¡¢Á´¤Æ¤Î +.B IPPROTO_UDP +¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬ UDP-Lite ¥½¥±¥Ã¥È¤Ç¤â»ÈÍѤǤ­¤ë¡£ +¾ÜºÙ¤Ï +.BR udp (7) +¤ò»²¾È¤Î¤³¤È¡£ + +°Ê²¼¤Î 2 ¤Ä¤¬ UDP-Lite ¤Ë¸ÇÍ­¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¡£ +.TP +.BR UDPLITE_SEND_CSCOV +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÏÁ÷¿®Â¦¤Î¥Á¥§¥Ã¥¯¥µ¥à¤ÎÂоÝÈϰϤòÀßÄꤹ¤ë¡£ +.I int +·¿¤ò°ú¤­¿ô¤È¤·¤Æ¼è¤ê¡¢ÀßÄê²Äǽ¤ÊÃͤÎÈÏ°Ï¤Ï 0 ¤«¤é 2^16-1 ¤Þ¤Ç¤Ç¤¢¤ë¡£ + +ÃÍ 0 ¤Ï¥Ç¡¼¥¿¥°¥é¥àÁ´ÂΤ¬¾ï¤Ë¥Á¥§¥Ã¥¯¥µ¥à¤ÎÂоݤȤʤ뤳¤È¤ò°ÕÌ£¤¹¤ë¡£ +ÃÍ 1¡Á7 ¤ÏÉÔÀµ¤Ç¤¢¤ê (RFC\ 3828 ¤Î 3.1 ¾Ï)¡¢ÈϰϤÎÀßÄê¤È¤·¤ÆºÇ¾®ÃͤǤ¢¤ë +8 ¤ËÀÚ¤ê¾å¤²¤é¤ì¤ë¡£ + +IPv6 ¤Î jumbograms (µðÂç¤Ê¥Ç¡¼¥¿¥°¥é¥à; RFC\ 2675) ¤Î¾ì¹ç¤Ë¤Ï¡¢ +UDP-Litev6 ¤Î¥Á¥§¥Ã¥¯¥µ¥à¤ÎÂоÝÈϰϤϡ¢RFC\ 3828 ¤Î 3.5 ¾Ï¤Ë¤¢¤ë¤è¤¦¤Ë¡¢ +ÀèƬ¤«¤é 2^16-1 ¥ª¥¯¥Æ¥Ã¥È¤Þ¤Ç¤Ë¸ÂÄꤵ¤ì¤ë¡£ +¤½¤Î¤¿¤á¡¢¤½¤ì¤è¤êÂ礭¤ÊÃÍ¤Ï 2^16-1 ¤ËÌۤäÆÀÚ¤êµÍ¤á¤é¤ì¤ë¡£ +¸½ºß¤ÎÂоÝÈϰϤÎÃͤòÃΤꤿ¤±¤ì¤Ð¡¢¤¤¤Ä¤Ç¤â +.BR getsockopt (2) +¤ò»È¤Ã¤ÆÃͤòÌ䤤¹ç¤ï¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BR UDPLITE_RECV_CSCOV +¤³¤ì¤Ï¼õ¿®Â¦¤Î¥Á¥§¥Ã¥¯¥µ¥à¤ÎÂоÝÈϰϤòÀßÄꤹ¤ë¤â¤Î¤Ç¡¢ +»ÈÍѤµ¤ì¤ë°ú¤­¿ô·Á¼°¤ÈÃͤÎÈÏ°Ï¤Ï +.B UDPLITE_SEND_CSCOV +¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ÉôʬŪ¤Ê¥Á¥§¥Ã¥¯¥µ¥àÂоÝÈϰϤò»ý¤Ä¥È¥é¥Õ¥£¥Ã¥¯¤ò +Í­¸ú¤Ë¤¹¤ë¤Î¤ËɬÍפʤ櫓¤Ç¤Ï¤Ê¤¯¡¢¥È¥é¥Õ¥£¥Ã¥¯¥Õ¥£¥ë¥¿¡¼¤È¤·¤Æµ¡Ç½¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤¹¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï»ØÄꤵ¤ì¤¿¥Á¥§¥Ã¥¯¥µ¥àÂоÝÈÏ°Ï +¤è¤ê¤â¡Öû¤«¤¤¡×ÂоÝÈϰϤò»ý¤Ä¥Ñ¥±¥Ã¥È¤òÁ´¤ÆÇÑ´þ¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + +.B UDPLITE_RECV_CSCOV +¤ÎÃͤ¬¼ÂºÝ¤Î¥Ñ¥±¥Ã¥È¤Î¥Á¥§¥Ã¥¯¥µ¥àÂоÝÈϰϤè¤ê¤âÂ礭¤¤¾ì¹ç¡¢ +¼õ¿®¤·¤¿¥Ñ¥±¥Ã¥È¤ÏÌۤäÆÇÑ´þ¤µ¤ì¤ë¡£ +¤¿¤À¤·¡¢¥·¥¹¥Æ¥à¥í¥°¤ËÂФ·¤Æ·Ù¹ð¥á¥Ã¥»¡¼¥¸¤¬À¸À®¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.\" SO_NO_CHECK exists and is supported by UDPv4, but is +.\" commented out in socket(7), hence also commented out here +.\".PP +.\"Since UDP-Lite mandates checksums, checksumming can not be disabled +.\"via the +.\".B SO_NO_CHECK +.\"option from +.\".BR socket (7). +.SH ¥¨¥é¡¼ +.BR udp (7) +¤Ë¤Ä¤¤¤Æ½ñ¤«¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥¨¥é¡¼¤ÏÊÖ¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ +UDP-Lite ¼«ÂΤϿ·¤¿¤Ê¥¨¥é¡¼¤ÏÄɲ䷤Ƥ¤¤Ê¤¤¡£ +.SH ¥Ð¥° +.\" FIXME . remove this section once glibc supports UDP-Lite +glibc ¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢°Ê²¼¤ÎÄêµÁ¤ò¹Ô¤¦É¬Íפ¬¤¢¤ë¡£ +.in +4n +.nf + +#define IPPROTO_UDPLITE 136 +.\" The following two are defined in the kernel in linux/net/udplite.h +#define UDPLITE_SEND_CSCOV 10 +#define UDPLITE_RECV_CSCOV 11 +.fi +.in +.SH ¥Õ¥¡¥¤¥ë +.I /proc/net/snmp +\- UDP-Litev4 ¤Î´ðËÜŪ¤ÊÅý·×¾ðÊ󥫥¦¥ó¥¿¡¼¡£ +.br +.I /proc/net/snmp6 +\- UDP-Litev6 ¤Î´ðËÜŪ¤ÊÅý·×¾ðÊ󥫥¦¥ó¥¿¡¼¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +UDP-Litev4/v6 ¤Ï Linux 2.6.20 ¤Ç½é¤á¤ÆÅо줷¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR udp (7), +.BR ip (7), +.BR ipv6 (7), +.BR socket (7) + +RFC\ 3828 for the Lightweight User Datagram Protocol (UDP-Lite) +.br +.I Documentation/networking/udplite.txt diff --git a/release/man7/unicode.7 b/release/man7/unicode.7 new file mode 100644 index 00000000..0d0cbcf0 --- /dev/null +++ b/release/man7/unicode.7 @@ -0,0 +1,314 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) Markus Kuhn, 1995, 2001 +.\" +.\" 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. +.\" +.\" 1995-11-26 Markus Kuhn +.\" First version written +.\" 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: +.\" +.TH UNICODE 7 2001-05-11 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +Unicode \- ÈÆÍÑʸ»ú½¸¹ç +.SH ÀâÌÀ +¹ñºÝµ¬³Ê +.B ISO 10646 +¤Ï +.B "ÈÆÍÑʸ»ú½¸¹ç (Universal Character Set (UCS))" +¤òÄêµÁ¤·¤Æ¤¤¤ë¡£ +UCS ¤Ï¾µ¬³Ê¤Îʸ»ú½¸¹ç¤Îʸ»ú¤òÁ´¤Æ´Þ¤ó¤Ç¤¤¤ë¡£ +¤µ¤é¤Ë¡¢ +.B "ÁÐÊý¸þ¤Î¸ß´¹À­ (round-trip compatibility)" +¤òÊݾڤ¹¤ë¡£ +Î㤨¤Ð¾¤ÎÉä¹æ¤«¤é UCS ¤ËÊÑ´¹¤·¤µ¤é¤Ë¸µ¤ÎÉä¹æ¤ËÊÑ´¹¤·¤¿¤È¤·¤Æ¤â¡¢ +²¿¤Î¾ðÊó¤â¼º¤Ê¤ï¤ì¤Ê¤¤¤è¤¦¤ËÊÑ´¹¥Æ¡¼¥Ö¥ë¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +UCS ¤Ï¸½¼ÂŪ¤ËÃΤé¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¸À¸ì¤òɽ¸½¤¹¤ë¤Î¤ËɬÍפÊʸ»ú¤ò´Þ¤ó¤Ç¤¤¤ë¡£ +¤³¤ì¤Ë¤Ï¥é¥Æ¥óʸ»ú¡¢¥®¥ê¥·¥ãʸ»ú¡¢¥­¥ê¥ëʸ»ú¡¢¥Ø¥Ö¥é¥¤Ê¸»ú¡¢¥¢¥é¥Ó¥¢Ê¸»ú¡¢ +¥¢¥ë¥á¥Ë¥¢Ê¸»ú¡¢¥°¥ë¥¸¥¢Ê¸»ú¤À¤±¤Ç¤Ê¤¯¡¢Ãæ¹ñ¡¦ÆüËÜ¡¦´Ú¹ñ¤Ç»È¤ï¤ì¤Æ¤¤¤ë´Á»ú¡¢ +¤µ¤é¤Ë¤Ï¡¢Ê¿²¾Ì¾¡¢ÊÒ²¾Ì¾¡¢¥Ï¥ó¥°¥ëʸ»ú¡¢ +¥Ç¡¼¥ô¥¡¥Ê¡¼¥¬¥ê¡¼Ê¸»ú¡¢¥Ù¥ó¥¬¥ëʸ»ú¡¢¥°¥ë¥à¥­¡¼Ê¸»ú¡¢¥°¥¸¥ã¥é¡¼¥Èʸ»ú¡¢ +¥ª¥ê¥ä¡¼Ê¸»ú¡¢¥¿¥ß¡¼¥ëʸ»ú¡¢¥Æ¥ë¥°Ê¸»ú¡¢¥«¥Ê¥éʸ»ú¡¢¥Þ¥é¥ä¡¼¥é¥àʸ»ú¡¢ +¥¿¥¤Ê¸»ú¡¢¥é¥ª¥¹Ê¸»ú¡¢¥¯¥á¡¼¥ëʸ»ú¡¢¥Ü¥Ý¥â¥Õ¥©Ê¸»ú (Ãí²»»úÊì)¡¢ +¥Á¥Ù¥Ã¥Èʸ»ú¡¢¥ë¡¼¥óʸ»ú¡¢¥¨¥Á¥ª¥Ô¥¢Ê¸»ú¡¢¥«¥Ê¥À²»Àáʸ»ú¡¢ +¥Á¥§¥í¥­¡¼Ê¸»ú¡¢¥â¥ó¥´¥ëʸ»ú¡¢ +¥ª¥¬¥àʸ»ú¡¢¥ß¥ã¥ó¥Þ¡¼Ê¸»ú¡¢¥·¥ó¥Ï¥éʸ»ú¡¢ +¥¿¡¼¥Êʸ»ú¡¢¥¤ (׳) ʸ»ú¤Ê¤É¤¬´Þ¤Þ¤ì¤ë¡£ +¤Þ¤À¥«¥Ð¡¼¤µ¤ì¤Æ¤¤¤Ê¤¤Ê¸»ú¤ËÉÕ¤¤¤Æ¤â¡¢ +¥³¥ó¥Ô¥å¡¼¥¿¤Ç»ÈÍѤ¹¤ë¤¿¤á¤Ë +¤É¤Î¤è¤¦¤Ê¥¨¥ó¥³¡¼¥É¤¬¤â¤Ã¤È¤âÎɤ¤¤«¤È¤¤¤¦¸¦µæ¤¬¿Ê¤á¤é¤ì¤Æ¤ª¤ê¡¢ +ºÇ½ªÅª¤Ë¤ÏÄɲ䵤ì¤ë¤À¤í¤¦¡£ +¥Ò¥¨¥í¥°¥ê¥Õ¤äÎò»ËŪ¤Ê¤¤¤í¤¤¤í¤Ê¥¤¥ó¥É¡á¥è¡¼¥í¥Ã¥Ñ¸À¸ì¤À¤±¤Ç¤Ê¤¯¡¢ +¥Æ¥ó¥°¥ï¡¼¥ëʸ»ú¡¢¥­¥¢¥¹Ê¸»ú¡¢¥¯¥ê¥ó¥´¥óʸ»ú¤Ê¤É¤Î¿Í¹©Åª¤Ê¸À¸ì¤âÁª¤Ð¤ì¤Æ¤¤¤ë¡£ +UCS ¤Ï¡¢¤³¤ì¤é¤Îʸ»ú¤Ë²Ã¤¨¤Æ¡¢TeX, PostScript, APL, MS-DOS, MS-Windows, +Macintosh, OCR ¥Õ¥©¥ó¥È¡¢¿ô¿¤¯¤Î¥ï¡¼¥É¥×¥í¥»¥Ã¥µ¡¼¤ä +½ÐÈÇ¥·¥¹¥Æ¥à¡¢¤Ê¤É¤¬Ä󶡤¹¤ë +¿Þ·Áµ­¹æ¡¦°õ»úµ­¹æ¡¦¿ô³Øµ­¹æ¡¦²Ê³Øµ­¹æ¤Ê¤É¤Î¿¤¯¤ò´Þ¤à¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ + +UCS µ¬³Ê (ISO 10646) ¤Ï +.I "31¥Ó¥Ã¥È¤Îʸ»ú½¸¹ç¥¢¡¼¥­¥Æ¥¯¥Á¥ã¡¼" +¤òµ­½Ò¤·¤Æ¤ª¤ê¡¢128 ¸Ä¤Î 24 ¥Ó¥Ã¥È +.IR ·² " (" group ) +¤«¤é¹½À®¤µ¤ì¤Æ¤¤¤ë¡£ +³Æ·²¤Ï 256 ¸Ä¤Î 16 ¥Ó¥Ã¥È +.IR ÌÌ " (" plane ) +¤Ëʬ³ä¤µ¤ì¤Æ¤ª¤ê¡¢³Æʸ»ú¤Ï 256 ¸Ä¤Î 8 ¥Ó¥Ã¥È +.IR ¶è " (" row ) +¤Î 256 +.IR ÅÀ " (" column ) +¤ÎÃæ¤Ë°ÌÃÖ¤¹¤ë¡£ +¤³¤Îµ¬³Ê¤Î Part 1 +.RB ( "ISO 10646-1" ) +¤Ç¤Ï¡¢ºÇ½é¤Î 65534 ¸Ä¤Î¥³¡¼¥É°ÌÃÖ (0x0000 ¡Á 0xfffd) ¤òÄêµÁ¤·¤Æ¤¤¤ë¡£ +¤³¤ì¤ÏÂè 0 ·²¤ÎÂè 0 Ì̤Ǥ¢¤ë +.IR "´ðËÜ¿¸À¸ìÌÌ (Basic Multilingual Plane (BMP))" +¤ò¹½À®¤¹¤ë¡£ +¤³¤Îµ¬³Ê¤Î Part 2 +.RB ( "ISO 10646-2" ) +¤Ç¤Ï¡¢Âè 0 ·²¤Î BMP ¤Î³°Éô¤Ç¤¢¤ë +0x10000 ¡Á 0x10ffff ¤ÎÈϰϤˤ¢¤ë +.I "Êä½õÌÌ" +¤Ëʸ»ú¤òÄɲä·¤¿¡£ +¤³¤Îµ¬³Ê¤Ç¤Ï 0x10ffff ¤ò±Û¤¨¤¿°ÌÃÖ¤Ëʸ»ú¤òÄɲ乤ëͽÄê¤Ï¤Ê¤¤¤Î¤Ç¡¢ +ͽÁۤǤ­¤ë¾­Íè¤Ë¤ª¤¤¤Æ¤Ï¡¢ +Á´¥³¡¼¥É¶õ´Ö¤Î¤¦¤Á¥°¥ë¡¼¥× 0 ¤Î°ìÉôʬ¤Ï¼ÂºÝ¤Ë¤Ï»È¤ï¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£ +BMP ¤Ë¤Ï¾¤Îʸ»ú½¸¹ç¤Ç°ìÈ̤˻Ȥï¤ì¤ëÁ´¤Æ¤Îʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£ +ISO 10646-2 ¤ÇÄɲ䵤줿Êä½õÌ̤ϡ¢ +ÆÃÄê¤Î²Ê³ØʬÌ¼­½ñ½ÐÈÇ¡¦°õºþ»º¶È¡¦¹â¼¡¥×¥í¥È¥³¥ë¡¦ +²¿¤«¤Î¥Õ¥¡¥ó¤Î´Ö¤Ê¤É¤Ç»È¤ï¤ì¤ëÆüì¤Êʸ»ú¤À¤±¤ò¥«¥Ð¡¼¤¹¤ë¡£ +.PP +UCS ʸ»ú¤ò 2 ¥Ð¥¤¥È¤Î¥ï¡¼¥É¤Çɽ¸½¤¹¤ë¤Î¤¬ +.B UCS-2 +·Á¼°¤Ç¤¢¤ë (BMP ʸ»ú¤Î¤ß)¡£ +¤Þ¤¿¡¢ +.B UCS-4 +¤Ç¤Ïʸ»ú¤ò 4 ¥Ð¥¤¥È¤Î¥ï¡¼¥É¤Çɽ¸½¤¹¤ë¡£ +¤µ¤é¤Ë¡¢ASCII ¤ò½èÍý¤¹¤ë¥½¥Õ¥È¥¦¥§¥¢¤Ø¤Î²¼°Ì¸ß´¹¤Î¤¿¤á¤Ë +.B UTF-8 +¥¨¥ó¥³¡¼¥É·Á¼°¤¬¤¢¤ë¡£ +¤Þ¤¿¡¢0x10ffff ¤Þ¤Ç¤ÎÈó BMP ʸ»ú¤ò°·¤¦ +UCS-2 Âбþ¥½¥Õ¥È¥¦¥§¥¢¤È¤Î¸ß´¹¤Î¤¿¤á¤Ë +.B UTF-16 +¥¨¥ó¥³¡¼¥É·Á¼°¤¬¤¢¤ë¡£ +.PP +UCS ʸ»ú½¸¹ç¤Î 0x0000 ¤«¤é 0x007f ¤Ï¡¢¸ÅŵŪ¤Ê +.B US-ASCII +ʸ»ú½¸¹ç¤Îʸ»ú¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +¤Þ¤¿ 0x0000 ¤«¤é 0x00ff ¤ÎÈϰϤǤϡ¢ +.B ISO 8859-1 Latin-1 +ʸ»ú½¸¹ç¤Îʸ»ú¤ÈƱ¤¸¤Ç¤¢¤ë¡£ +.SS "¹çÀ®Ê¸»ú (Combining Characters)" +.B UCS +¤Î¤¤¤¯¤Ä¤«¤Î¥³¡¼¥É¡¦¥Ý¥¤¥ó¥È¤Ï +.I "¹çÀ®Ê¸»ú (combining characters)" +¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤é¤Ï¥¿¥¤¥×¥é¥¤¥¿¡¼¤Î°ÜÆ°¤·¤Ê¤¤¥¢¥¯¥»¥ó¥È¡¦¥­¡¼¤Ë»÷¤Æ¤¤¤ë¡£ +¹çÀ®Ê¸»ú¤ÏľÁ°¤Îʸ»ú¤Ë¥¢¥¯¥»¥ó¥È¤Î¤ß¤ò²Ã¤¨¤ë¡£ +ºÇ¤â½ÅÍפʥ¢¥¯¥»¥ó¥ÈÉÕ¤­¤Îʸ»ú¤Ï¤½¤ì¼«¿È¤Î¥³¡¼¥É¤ò UCS ¤Ë»ý¤Ã¤Æ¤¤¤ë¡£ +°ìÊý¤Ç¹çÀ®Ê¸»úµ¡¹½¤ÏÁ´¤Æ¤Îʸ»ú¤Ë¥¢¥¯¥»¥ó¥È¤äȯ²»¶èÊÌÉä¹æ¤ò²Ã¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¹çÀ®Ê¸»ú¤Ï¾ï¤Ë¤½¤ì¤¬½¤Àµ¤¹¤ëʸ»ú¤Ë³¤¯¡£ +Î㤨¤Ð¥É¥¤¥Ä¸ì¤Îʸ»ú A ¥¦¥à¥é¥¦¥È ("Latin capital letter A with diaeresis") ¤Ï +UCS ¤ËÁ°¤â¤Ã¤Æ½àÈ÷¤µ¤ì¤¿¥³¡¼¥É 0x00c4 ¤Ç¤â¡¢ +Ä̾ï¤Î A "Latin capital letter A" ¤Ë +"combining diaeresis (¹çÀ®Ê¬²»µ­¹æ)" ¤ò³¤±¤¿Áȹ礻 +(0x0041 0x0308) ¤Î¤É¤Á¤é¤Ç¤âɽ¸½¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +¹çÀ®Ê¸»ú¤Ï¡¢¥¿¥¤Ê¸»ú¤ä¿ô³Ø¿¢»ú¤Î¥¨¥ó¥³¡¼¥É¡¦ +¹ñºÝ²»À¼»úÊì¤ò»È¤¦¥æ¡¼¥¶¡¼¤Ê¤É¤Ë¤Ïɬ¿Ü¤Ç¤¢¤ë¡£ +.SS ¼ÂÁõ¥ì¥Ù¥ë +Á´¤Æ¤Î¥·¥¹¥Æ¥à¤Ë¹çÀ®Ê¸»ú¤Î¤è¤¦¤Ê¿Ê¤ó¤À¥µ¥Ý¡¼¥È¤ò´üÂÔ¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +ISO 10646-1 ¤Ï°Ê²¼¤Î»°Ãʳ¬¤Î UCS ¤Î¼ÂÁõ¥ì¥Ù¥ë¤ò»ØÄꤷ¤Æ¤¤¤ë¡£ +.TP 0.9i +Level 1 +¹çÀ®Ê¸»ú¤È +.B ¥Ï¥ó¥°¥ë¡¦¥¸¥ã¥âʸ»ú +(¤¤¤í¤¤¤í¤Ê´Ú¹ñ¡¦Ä«Á¯Ê¸»ú¤ÎÉä¹æ²½¡£ +¤³¤ÎÉä¹æ²½¤Ç¤Ï¡¢¥Ï¥ó¥°¥ë²»Àá¤Î¥°¥ê¥Õ¤¬ +3 ¤Ä¤Þ¤¿¤Ï 2 ¤Ä¤ÎÊì²»¡¦»Ò²»¥³¡¼¥É¤ÎÁȤ߹ç¤ï¤»¤ÇÉä¹æ²½¤µ¤ì¤ë) ¤Ï¥µ¥Ý¡¼¥È¤·¤Ê¤¤¡£ +.TP +Level 2 +Level 1 ¤ÈƱÍͤÀ¤¬¡¢¹çÀ®Ê¸»ú¤òɬ¿Ü¤È¤¹¤ë¸À¸ì¤Î¤¿¤á¤Îʸ»ú +(Î㤨¤Ð¡¢¥¿¥¤Ê¸»ú¡¦¥é¥ª¥¹Ê¸»ú¡¦¥Ø¥Ö¥é¥¤Ê¸»ú¡¦¥¢¥é¥Ó¥¢Ê¸»ú¡¦ +¥Ç¡¼¥ô¥¡¥Ê¡¼¥¬¥ê¡¼Ê¸»ú¡¦¥Þ¥ì¥ä¡¼¥é¥àʸ»ú¤Ê¤É) ¤Ï»È¤¨¤ë¡£ +.TP +Level 3 +Á´¤Æ¤Î +.B UCS +ʸ»ú¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ +.PP +.B ¥æ¥Ë¥³¡¼¥É¡¦¥³¥ó¥½¡¼¥·¥¢¥à (Unicode Consortium) +¤«¤éȯ¹Ô¤µ¤ì¤¿ +.B Unicode 3.0 Standard +¤Ï¡¢ISO 10646-1:2000 ¤Ëµ­½Ò¤µ¤ì¤¿ +.B UCS Basic Multilingual Plane +¤Î level 3 ¼ÂÁõ¤ÈÁ´¤¯Æ±¤¸¤Ç¤¢¤ë¡£ +.B Unicode 3.1 +¤Ç¤Ï ISO 10646-2 ¤ÎÊä½õÌ̤¬Äɲ䵤ì¤Æ¤¤¤ë¡£ +Unicode Consortium ¤«¤éȯ¹Ô¤µ¤ì¤ë Unicode µ¬³Ê¤Èµ»½Ñ¥ì¥Ý¡¼¥È¤Ë¤è¤ê¡¢ +¤¤¤í¤¤¤í¤Êʸ»ú¤Î°ÕÌ£¤È¿ä¾©¤µ¤ì¤ë»ÈÍÑË¡¤Ë¤Ä¤¤¤Æ¤Î¹¹¤Ê¤ë¾ðÊó¤¬ÆÀ¤é¤ì¤ë¡£ +¤³¤ì¤é¤Îµ¬³Ê½ñ¤äµ»½Ñ¥ì¥Ý¡¼¥È¤Ç¡¢Unicode ʸ»úÎó¤ò +ÊÔ½¸¡¦Ê¤ÙÂؤ¨¡¦Èæ³Ó¡¦Àµµ¬²½¡¦ÊÑ´¹¡¦É½¼¨¤¹¤ë¤¿¤á¤Î +¥¬¥¤¥É¥é¥¤¥ó¤È¥¢¥ë¥´¥ê¥º¥à¤¬Ê¬¤«¤ë¡£ +.SS "Linux ¤Ë¤ª¤±¤ë Unicode" +GNU/Linux ¤Ç¤Ï¡¢C ¸À¸ì¤Î·¿ +.B wchar_t +¤ÏÉä¹æÉÕ¤­ 32 ¥Ó¥Ã¥ÈÀ°¿ô·¿¤Ç¤¢¤ë¡£ +¤½¤ÎÃÍ¤Ï C ¥é¥¤¥Ö¥é¥ê¤Ë¤è¤ê (¤¹¤Ù¤Æ¤Î¥í¥±¡¼¥ë¤Ë¤ª¤¤¤Æ) ¾ï¤Ë +.B UCS +¥³¡¼¥É¤ÎÃͤȤ·¤Æ²ò¼á¤µ¤ì¤ë¡£ +¤³¤ì¤ò GNU C ¥é¥¤¥Ö¥é¥ê¤¬¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÃΤ餻¤ë¤¿¤á¤Îµ¬Ìó¤È¤·¤Æ¡¢ +Äê¿ô +.B __STDC_ISO_10646__ +¤òÄêµÁ¤¹¤ë¡£ +¤³¤ì¤Ï ISO C99 µ¬³Ê¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¡£ + +ASCII ¸ß´¹¤Î +.B UTF-8 +¥Þ¥ë¥Á¥Ð¥¤¥È¥¨¥ó¥³¡¼¥É¤Ç¤Ï¡¢Æþ½ÐÎÏ¥¹¥È¥ê¡¼¥à¡¦Ã¼ËöÄÌ¿®¡¦ +¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¡¦¥Õ¥¡¥¤¥ë̾¡¦´Ä¶­ÊÑ¿ô¤Ë¤ª¤¤¤Æ¡¢ +UCS/Unicode ¤ò ASCII ¤Î¤è¤¦¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +UTF-8 ¤òʸ»ú¥¨¥ó¥³¡¼¥É¤È¤·¤Æ»È¤¦¤³¤È¤ò +Á´¤Æ¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÃΤ餻¤ë¤¿¤á¤Ë¤Ï¡¢ +("LANG=en_GB.UTF-8" ¤Î¤è¤¦¤Ë) ´Ä¶­ÊÑ¿ô¤ò»È¤Ã¤ÆŬÀÚ¤Ê +.I ¥í¥±¡¼¥ë (locale) +¤òÁªÂò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.B nl_langinfo(CODESET) +´Ø¿ô¤ÏÁªÂò¤µ¤ì¤¿¥¨¥ó¥³¡¼¥É¤Î̾Á°¤òÊÖ¤¹¡£ +ÆâÉôŪ¤Ê +.I wchar_t +ʸ»ú¤äʸ»úÎó¤ò¥·¥¹¥Æ¥àʸ»úÎ󥨥󥳡¼¥É¤ËÊÑ´¹ (µÕÊÑ´¹) ¤¹¤ë¤Î¤Ë»È¤ï¤ì¤ë +.BR wctomb (3) +¤ä +.BR mbsrtowcs (3)¡¢ +¤µ¤é¤Ë¤Ï +.BR wcwidth (3) +¤È¤¤¤Ã¤¿¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï¡¢ +ʸ»ú½ÐÎϤǤɤì¤À¤±¥«¡¼¥½¥ë¤¬¿Ê¤ó¤À¤« (0\(en2) ¤òÊÖ¤¹¡£ +.PP +°ìÈÌŪ¤Ë¸À¤¦¤È¡¢Linux ¤Ç¤Ï¸½ºß¤Î¤È¤³¤í +BMP ¤Î level 1 ¼ÂÁõ¤Î¤ß¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +¤¢¤ë¸À¸ì¤Îʸ»ú (¤È¤¯¤Ë¥¿¥¤Ê¸»ú) ¤Ç¤Ï¡¢ +¥Ù¡¼¥¹Ê¸»úÅö¤¿¤ê 2 ¤Ä¤Þ¤Ç¤Î¹çÀ®Ê¸»ú¤ò»È¤¦¤³¤È¤¬ +UTF-8 üËö¥¨¥ß¥å¥ì¡¼¥¿¤È ISO 10646 ¥Õ¥©¥ó¥È (level 2) ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤·¤«¤·°ìÈÌŪ¤Ë¸À¤¨¤Ð¡¢¤â¤·²Äǽ¤Ê¤é¤Ð¤¢¤é¤«¤¸¤á¹çÀ®¤·¤¿Ê¸»ú¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë +(Unicode ¤Ç¤Ï¡¢¤³¤ì¤ò +.B "Normalization Form C (¹çÀ®Ê¸»ú¤ÎÀµµ¬²½·Á¼°)" +¤È¤¤¤¦)¡£ +.SS ¥×¥é¥¤¥Ù¡¼¥È¡¦¥¨¥ê¥¢ +.B BMP +¤Î 0xe000 ¡Á 0xf8ff ¤ÎÈϰϤϡ¢µ¬³Ê¤Ç¤Ï¤¤¤«¤Ê¤ëʸ»ú¤â³ä¤êÅö¤Æ¤º¡¢ +»äŪ¤Ê»ÈÍѤΤ¿¤á¤ËͽÌ󤵤ì¤Æ¤¤¤ë¡£ +Linux ¥³¥ß¥å¥Ë¥Æ¥£¤Ç¤Ï¡¢ +¤³¤Î¥×¥é¥¤¥Ù¡¼¥È¡¦¥¨¥ê¥¢¤ò¤µ¤é¤ËºÙ¤«¤¯Ê¬³ä¤·¤Æ»ÈÍѤ¹¤ë¡£ +0xe000 ¡Á 0xefff ¤ÎÈϰϤϥ¨¥ó¥É¡¦¥æ¡¼¥¶¡¼¤¬¸Ä¡¹¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +0xf000 ¡Á 0xf8ff ¤ÎÈÏ°Ï¤Ï Linux Zone ¤Ç +Á´¤Æ¤Î Linux ¥æ¡¼¥¶¡¼¤Ç¶¦Ä̤˻ÈÍѤ¹¤ë¡£ +Linux Zone ¤Ø¤Îʸ»ú³ä¤êÅö¤Æ¤ÎÅÐÏ¿¤Ï¡¢ +¸½ºß H. Peter Anvin ¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤Æ¤¤¤ë¡£ +.SS ʸ¸¥ +.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. + +¤³¤ì¤Ï +.B UCS +¤Î¸ø¼°¤Ê»ÅÍͤǤ¢¤ë¡£ +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 +* +S. Harbison, G. Steele. C: A Reference Manual. Fourth edition, +Prentice Hall, Englewood Cliffs, 1995, ISBN 0-13-326224-3. + +C ¥×¥í¥°¥é¥à¸À¸ì¤Ë¤Ä¤¤¤Æ¤Î¤È¤Æ¤âÎɤ¤»²¹Í½ñ¤Ç¤¢¤ë¡£ +Âè»ÍÈǤǤϡ¢¥ï¥¤¥Éʸ»ú¤ä¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¥¨¥ó¥³¡¼¥É¤ò°·¤¦¤¿¤á¤Î +¿¤¯¤Î¿·¤·¤¤ C ¥é¥¤¥Ö¥é¥ê´Ø¿ô¤¬ +²Ã¤¨¤é¤ì¤¿ ISO C90 µ¬³Ê¤Î 1994 Amendment 1 ¤ò¥«¥Ð¡¼¤·¤Æ¤¤¤ë¡£ +¤·¤«¤·¡¢¥ï¥¤¥Éʸ»ú¤ä¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Î¥µ¥Ý¡¼¥È¤ò +¹¹¤Ë²þÁ±¤·¤¿ ISO C99 ¤Ï¡¢¤Þ¤À¥«¥Ð¡¼¤·¤Æ¤¤¤Ê¤¤¡£ +.TP +* +Unicode µ»½Ñ¥ì¥Ý¡¼¥È¡£ +.RS +http://www.unicode.org/unicode/reports/ +.RE +.TP +* +Markus Kuhn: Unix/Linux ¤Î¤¿¤á¤Î UTF-8 ¤È Unicode ¤Î FAQ¡£ +.RS +http://www.cl.cam.ac.uk/~mgk25/unicode.html + +.I linux-utf8 +¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤ò¹ØÆɤ¹¤ë¤¿¤á¤Î¾ðÊ󤬤¢¤ë¡£ +Linux ¤Ç Unicode ¤ò»È¤¦¾ì¹ç¤Î¥¢¥É¥Ð¥¤¥¹¤òõ¤¹¤Î¤Ë°ìÈÖÎɤ¤¾ì½ê¤Ç¤¢¤ë¡£ +.RE +.TP +* +Bruno Haible: Unicode HOWTO. +.RS +ftp://ftp.ilog.fr/pub/Users/haible/utf8/Unicode-HOWTO.html +.RE +.SH ¥Ð¥° +¤³¤Î¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸¤òºÇ¸å¤Ë²þÄû¤·¤¿»þÅÀ¤Ç¡¢ +GNU C ¥é¥¤¥Ö¥é¥ê¤Î +.B UTF-8 +¥µ¥Ý¡¼¥È¤Ï´°À®¤·¤Æ¤¤¤ë¡£ +XFree86 ¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ï¿Ê¹ÔÃæ¤Ç¤¢¤ë¡£ +.B UTF-8 +¥í¥±¡¼¥ë¤Ç²÷Ŭ¤Ë»È¤¨¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó +(¿¤¯¤Îͭ̾¤Ê¥¨¥Ç¥£¥¿) ¤ÎºîÀ®¤Ï¡¢¤Þ¤À¿Ê¹ÔÃæ¤Ç¤¢¤ë¡£ +Linux ¤Ç¤Î +.B UCS +¥µ¥Ý¡¼¥È¤Ç¤ÏÄ̾ï CJK ¤Î 2 ¥ï¥¤¥Éʸ»ú¤¬Ä󶡤µ¤ì¤ë¡£ +ñ½ã¤Ê½Å¤ÍÂǤÁ¤Ë¤è¤ë¹çÀ®Ê¸»ú¤¬Ä󶡤µ¤ì¤ë¾ì¹ç¤â¤¢¤ë¡£ +¤·¤«¤·¡¢±¦¤«¤éº¸¤Ø½ñ¤¯Ê¸»ú¤ä¥Ø¥Ö¥é¥¤Ê¸»ú¡¦¥¢¥é¥Ó¥¢Ê¸»ú¡¦¥¤¥ó¥É¸ì·Ïʸ»ú¤Ê¤É¤Î +¹ç»ú¤ÎÃÖ¤­´¹¤¨¤òɬÍפȤ¹¤ëʸ»ú¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¸½ºß¡¢¤³¤ì¤é¤Îʸ»ú¤ÏÀöÎý¤µ¤ì¤¿¥Æ¥­¥¹¥ÈÉÁ²è¥¨¥ó¥¸¥ó¤òÈ÷¤¨¤¿ +GUI ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó (HTML ¥Ó¥å¡¼¥¢¡¦¥ï¡¼¥É¥×¥í¥»¥Ã¥µ) ¤Ç¤Î¤ß +¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +.\" .SH Ãø¼Ô +.\" Markus Kuhn +.SH ´ØÏ¢¹àÌÜ +.BR setlocale (3), +.BR charsets (7), +.BR utf-8 (7) diff --git a/release/man7/units.7 b/release/man7/units.7 new file mode 100644 index 00000000..945b6f19 --- /dev/null +++ b/release/man7/units.7 @@ -0,0 +1,130 @@ +'\" t +.\" 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) 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" +.SH ̾Á° +units, kilo, kibi, mega, mebi, giga, gibi \- 10 ¿Ê¤ª¤è¤Ó 2 ¿Ê¤ÎÀÜƬ¸ì +.SH ÀâÌÀ +.SS 10 ¿Ê¤ÎÀÜƬ¸ì +SI ñ°Ì·Ï¤Ç¤Ï 10 ¤ÎÎß¾è¤ò¼¨¤¹ÀÜƬ¸ì¤òÍѤ¤¤ë¡£ +¥­¥í¥á¡¼¥È¥ë¤Ï 1000 ¥á¡¼¥È¥ë¡¢¥á¥¬¥ï¥Ã¥È¤Ï 1000000 ¥ï¥Ã¥È¤Ç¤¢¤ë¡£ +¼¡¤Ëɸ½àŪ¤ÊÀÜƬ¸ì¤ò¼¨¤¹¡£ +.RS +.TS +l l l. +ÀÜƬ¸ì ̾Á° ÃÍ +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 +M ¥á¥¬(mega) 10^ 6 = 1000000 +G ¥®¥¬(giga) 10^ 9 = 1000000000 +T ¥Æ¥é(tera) 10^12 = 1000000000000 +P ¥Ú¥¿(peta) 10^15 = 1000000000000000 +E ¥¨¥¯¥µ(exa) 10^18 = 1000000000000000000 +Z ¥¼¥¿(zetta) 10^21 = 1000000000000000000000 +Y ¥è¥¿(yotta) 10^24 = 1000000000000000000000000 +.TE +.RE +.sp +¥Þ¥¤¥¯¥í¤Îµ­¹æ¤Ï¥®¥ê¥·¥ãʸ»ú¤Î¦Ì¤Ç¤¢¤ë¤¬¡¢ +ASCII ¤Ç¥Æ¥­¥¹¥È¤¬µ­½Ò¤µ¤ì¤Æ¤¤¤Æ¡¢¥®¥ê¥·¥ãʸ»ú¤¬»È¤¨¤Ê¤¤¾ì¹ç¤Ï +u ¤È½ñ¤«¤ì¤ë¤³¤È¤¬Â¿¤¤¡£ +.sp +.RS +http://physics.nist.gov/cuu/Units/prefixes.html +.RE +.sp +¤â»²¹Í¤Ë¤·¤Æ¤Û¤·¤¤¡£ +.SS 2 ¿Ê¤ÎÀÜƬ¸ì +2 ¿Ê¤ÎÀÜƬ¸ì¤Ï 10 ¿Ê¤ÎÀÜƬ¸ì¤È»÷¤Æ¤¤¤ë¤¬¡¢¸å¤í¤Ë \(aqi\(aq ¤¬ÉÕ¤¯ +(¤Þ¤¿ "Ki" ¤Ë¤Ä¤¤¤Æ¤ÏÂçʸ»ú¤Î \(aqK\(aq) ¤Ç»Ï¤Þ¤ë)¡£ +̾Á°¤Ï¡¢¤À¤¤¤¿¤¤Æ±¤¸¤¯¤é¤¤¤Î 10 ¿ÊÀÜƬ¸ì¤ÎºÇ½é¤Î²»Àá¤Ë¡¢ +2 ¿Ê¿ô¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë "bi" ¤ò­¤·¤¿¤â¤Î¤Ë¤Ê¤ë¡£ +.RS +.TS +l l l. +ÀÜƬ¸ì ̾Á° ÃÍ +Ki ¥­¥Ó(kibi) 2^10 = 1024 +Mi ¥á¥Ó(mebi) 2^20 = 1048576 +Gi ¥®¥Ó(gibi) 2^30 = 1073741824 +Ti ¥Æ¥Ó(tebi) 2^40 = 1099511627776 +Pi ¥Ú¥Ó(pebi) 2^50 = 1125899906842624 +Ei ¥¨¥¯¥·¥Ó(exbi) 2^60 = 1152921504606846976 +.TE +.RE +.sp +.RS +http://physics.nist.gov/cuu/Units/binary.html +.RE +.sp +¤â»²¹Í¤Ë¤·¤Æ¤Û¤·¤¤¡£ +.SS ¹Í»¡ +¤³¤ì¤é¤Î 2 ¿Ê¤ÎÀÜƬ¸ì¤¬Æ³Æþ¤µ¤ì¤ëÁ°¤Ï¡¢ +k=1000 ¤È K=1024 ¤Î¤è¤¦¤Ë»È¤¦¤Î¤¬³ä¤ËÎɤ¯ÃΤé¤ì¤¿½¬´·¤À¤Ã¤¿ +(b=¥Ó¥Ã¥È¡¢B=¥Ð¥¤¥È ¤Î´Ø·¸¤Ë»÷¤Æ¤¤¤ë)¡£ +»ÄÇ°¤Ê¤¬¤é M ¤ÏºÇ½é¤«¤éÂçʸ»ú¤Ê¤Î¤Ç¡¢ +2 ¿Ê¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¤¿¤á¤Ë¤µ¤é¤ËÂçʸ»ú¤Ë¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤«¤Ã¤¿¡£ + +Åö½é¤Ï¤³¤Î¤³¤È¤Ï¤¢¤Þ¤êÂ礭¤ÊÌäÂê¤Ç¤Ï¤Ê¤«¤Ã¤¿¡£ +¤Ê¤¼¤Ê¤é¥á¥â¥ê¥â¥¸¥å¡¼¥ë¤ä¥Ç¥£¥¹¥¯¤Ï 2 ¤ÎÎß¾è¤Ë¤Ê¤ë¤â¤Î¤À¤Ã¤¿¤Î¤Ç¡¢ +³§¤½¤Î¤è¤¦¤Ê¤È¤³¤í¤Ç¤Ï¡Ö¥­¥í¥Ð¥¤¥È¡×¤ò 1024 ¥Ð¥¤¥È¡¢ +¡Ö¥á¥¬¥Ð¥¤¥È¡×¤ò 1048576 ¥Ð¥¤¥È¤Ç¤¢¤ë¤È¤ß¤Ê¤·¤Æ¤¤¤¿¤«¤é¤Ç¤¢¤ë¡£ +ºÇ½é¤ÏÀÜƬ¸ì¤Î¡Ö¥­¥í¡×¤È¤«¡Ö¥á¥¬¡×¤òÛ£Ëæ¤Ë±çÍѤ·¤Æ¤¤¤¿¤Î¤À¤¬¡¢ +¤½¤Î¤¦¤Á¥³¥ó¥Ô¥å¡¼¥¿¤Ë´ØÏ¢¤¹¤ëÏÃÂê¤Ç¤Ï¡¢¤³¤Á¤é¤¬¡Ö¼ÂºÝ¤Î°ÕÌ£¡×¤Ë¤Ê¤Ã¤Æ¤¤¤Ã¤¿¡£ +¤·¤«¤·¤½¤Î¸å¥Ç¥£¥¹¥¯¤Î¥Æ¥¯¥Î¥í¥¸¡¼¤¬Âå¤ï¤ê¡¢ +¥Ç¥£¥¹¥¯¥µ¥¤¥º¤ÏǤ°Õ¤Î¿ôÃͤò¤È¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£ +¤É¤Ã¤Á¤Ä¤«¤º¤Î»þ´ü¤¬¤·¤Ð¤é¤¯Â³¤¤¤¿¤¢¤È¡¢ +¥Ç¥£¥¹¥¯¤Î¥á¡¼¥«¡¼¤¹¤Ù¤Æ¤¬¡¢É¸½à¤ò»È¤¦¤³¤È¤Ë¹ç°Õ¤·¤¿¡£ +¤¹¤Ê¤ï¤Á k=1000, M=1000k, G=1000M ¤Ç¤¢¤ë¡£ + +¾õ¶·¤Ï¤Ò¤É¤¯¤Ê¤Ã¤¿¡£14.4k ¥â¥Ç¥à¤Ç¤Ï k=1000, +1.44MB ¥Õ¥í¥Ã¥Ô¡¼¤Ç¤Ï M=1024000 ¤Ë¤Ê¤Ã¤¿¡£ +1998 ǯ¤Ë¡¢IEC ¤Ï¾åµ­¤Î¤è¤¦¤Ê 2 ¿ÊÍѤÎÀÜƬ¸ì¤ò¾µÇ§¤·¡¢ +¤³¤ì¤Ë¤è¤Ã¤Æξ¼Ô¤ò¤Ï¤Ã¤­¤ê¶èÊ̤¹¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤Ã¤¿¡£ + +¤·¤¿¤¬¤Ã¤Æº£Æü¤Ç¤Ï¡¢MB=1000000B ¤Ç¡¢MiB = 1048576B ¤Ê¤Î¤Ç¤¢¤ë¡£ + +¥Õ¥ê¡¼¥½¥Õ¥È¥¦¥§¥¢¤ÎÀ¤³¦¤Ç¤â¡¢ +¥×¥í¥°¥é¥à¤¿¤Á¤Ï¤æ¤Ã¤¯¤ê¤È¤³¤ì¤é¤Ë½àµò¤·¤Æ¤­¤Æ¤¤¤ë¡£ +Linux ¥«¡¼¥Í¥ë¤Ï¡¢¥Ö¡¼¥È¤¹¤ë¤È¼¡¤Î¤è¤¦¤Ê¥á¥Ã¥»¡¼¥¸¤ò½Ð¤¹¡£ +.sp +.RS +.nf +hda: 120064896 sectors (61473 MB) w/2048KiB Cache +.fi +.RE +.sp +MB ¤Ï¥á¥¬¥Ð¥¤¥È¤Ç¡¢KiB ¤Ï¥­¥Ó¥Ð¥¤¥È¤Ç¤¢¤ë¡£ diff --git a/release/man7/unix.7 b/release/man7/unix.7 new file mode 100644 index 00000000..77277c0a --- /dev/null +++ b/release/man7/unix.7 @@ -0,0 +1,401 @@ +.\" This man page is Copyright (C) 1999 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. +.\" +.\" Modified, 2003-12-02, Michael Kerrisk, +.\" Modified, 2003-09-23, Adam Langley +.\" Modified, 2004-05-27, Michael Kerrisk, +.\" Added SOCK_SEQPACKET +.\" 2008-05-27, mtk, Provide a clear description of the three types of +.\" address that can appear in the sockaddr_un structure: pathname, +.\" unnamed, and abstract. +.\" +.\" Japanese Version Copyright (c) 1999 Shouichi Saito and +.\" NAKANO Takeo all rights reserved. +.\" Translated 1999-12-06, NAKANO Takeo +.\" based on the work by Shouichi Saito +.\" Updated 2003-01-07, Akihiro MOTOKI +.\" Updated 2005-02-21, Akihiro MOTOKI +.\" Updated 2005-12-26, Akihiro MOTOKI +.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" +.\"WORD abstract namespace Ãê¾Ý̾Á°¶õ´Ö +.\"WORD anonymous socket ̾Á°Ìµ¤·¥½¥±¥Ã¥È +.\"WORD credential ¿®Ç¤¾õ +.\"WORD ancillary message Êä½õ¥á¥Ã¥»¡¼¥¸ +.\"WORD file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ +.\" +.\" ÌõÃí: Ìõ¤¹ºÝ¤â Unix ¤Ï capitalize ¤·¤Æ¤ª¤¯¤³¤È¡£ +.\" LDP_man-pages 1.66¢ª2.01 ¤Ë¤ª¤¤¤Æ unix ¢ª Unix ¤ÎÊѹ¹¤¬¤¢¤ê¡¢ +.\" °Õ¿ÞŪ¤Êɽµ­¤È»×¤ï¤ì¤ë¡£ +.\" +.TH UNIX 7 2008-12-01 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +unix, AF_UNIX, AF_LOCAL \- ¥í¡¼¥«¥ë¤Ê +¥×¥í¥»¥¹´ÖÄÌ¿®ÍѤΥ½¥±¥Ã¥È +.SH ½ñ¼° +.B #include +.br +.B #include + +.IB unix_socket " = socket(AF_UNIX, type, 0);" +.br +.IB error " = socketpair(AF_UNIX, type, 0, int *" sv ");" +.SH ÀâÌÀ +.B AF_UNIX +.RB ( AF_LOCAL +¤È¤â¸À¤ï¤ì¤ë) ¥½¥±¥Ã¥È¥Õ¥¡¥ß¥ê¡¼¤Ï¡¢Æ±¤¸¥Þ¥·¥ó¾å¤Ç¥×¥í¥»¥¹Æ±»Î¤¬ +¸úΨŪ¤ËÄÌ¿®¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ +ÅÁÅýŪ¤Ë¡¢Unix ¥½¥±¥Ã¥È¤Ï¡¢Ì¾Á°¤Ê¤·¤Ë¤â¤Ç¤­¤ë¤·¡¢ +(¥½¥±¥Ã¥È·¿¤Ç¤¢¤ë¤È°õ¤Î¤Ä¤¤¤¿) ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ñ¥¹Ì¾¤Ë +·ë¤ÓÉÕ¤±¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤µ¤é¤Ë Linux ¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Ê¤¤ +Ãê¾Ý̾Á°¶õ´Ö (abstract namespace) ¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ + +.\" MOTOKI: ¸«¤ä¤¹¤¤¤è¤¦¤Ë .TP ·Á¼°¤ËÊѹ¹ +Í­¸ú¤Ê¥¿¥¤¥×¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë: +.TP +.B SOCK_STREAM +¥¹¥È¥ê¡¼¥à»Ø¸þ¤Î¥½¥±¥Ã¥È +.TP +.B SOCK_DGRAM +¥á¥Ã¥»¡¼¥¸¶­³¦¤òÊݸ¤¹¤ë¥Ç¡¼¥¿¥°¥é¥à»Ø¸þ¤Î¥½¥±¥Ã¥È +(¤Û¤È¤ó¤É¤Î Unix ¤Î¼ÂÁõ¤Ç¤Ï¡¢Unix ¥É¥á¥¤¥ó¡¦¥Ç¡¼¥¿¥°¥é¥à¡¦¥½¥±¥Ã¥È¤Ï +¾ï¤Ë¿®Íê¤Ç¤­¡¢¥Ç¡¼¥¿¥°¥é¥à¤ÎʤÓÂؤ¨¤Ï¹Ô¤ï¤Ê¤¤) +.TP +.B SOCK_SEQPACKET +(Linux 2.6.4 °Ê¹ß¤ÇÍøÍѤǤ­¤ë) +¥á¥Ã¥»¡¼¥¸¶­³¦¤òÊݸ¤·¡¢Á÷¿®¤µ¤ì¤¿½ç½ø¤Ç¥á¥Ã¥»¡¼¥¸¤òÆϤ±¤ëÀܳ»Ø¸þ¥½¥±¥Ã¥È + +Unix ¥½¥±¥Ã¥È¤Ç¤Ï¡¢Êä½õ¥Ç¡¼¥¿¤ò»È¤Ã¤Æ +¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ä¥×¥í¥»¥¹¤Î¿®Ç¤¾õ (credential) ¤ò +Á÷¼õ¿®¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +.SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È +Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤Î¥¢¥É¥ì¥¹¤Ï°Ê²¼¤Î¹½Â¤ÂΤÇɽ¸½¤µ¤ì¤ë¡£ +.in +4n +.nf + +#define UNIX_PATH_MAX 108 + +struct sockaddr_un { + sa_family_t sun_family; /* AF_UNIX */ + char sun_path[UNIX_PATH_MAX]; /* pathname */ +}; +.fi +.in +.PP +.I sun_family +¤Ë¤Ïɬ¤º +.B AF_UNIX +¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ + +¤³¤Î¹½Â¤ÂÎ¤Ç¤Ï 3 ¼ïÎà¤Î¥¢¥É¥ì¥¹¤¬¶èÊ̤µ¤ì¤ë¡£ +.IP * 3 +.IR "pathname (¥Ñ¥¹Ì¾)" : +.BR bind (2) +¤ò»È¤Ã¤Æ¡¢Unix ¥É¥á¥¤¥ó¥½¥±¥Ã¥È¤ò NULL ½ªÃ¼¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î +¥Ñ¥¹Ì¾¤Ë·ë¤ÓÉÕ¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.BR getsockname (2), +.BR getpeername (2), +.BR accept (2) +¤¬¥½¥±¥Ã¥È¤Î¥¢¥É¥ì¥¹¤òÊÖ¤¹ºÝ¤Ë¤Ï¡¢ +¤½¤ÎŤµ¤Ï +.I "sizeof(sa_family_t) + strlen(sun_path) + 1" +¤Ç¤¢¤ê¡¢ +.I sun_path +¤Ë NULL ½ªÃ¼¤µ¤ì¤¿¥Ñ¥¹Ì¾¤¬³ÊǼ¤µ¤ì¤ë¡£ +.IP * +.IR "unnamed (̾Á°¤Ê¤·)" : +.BR bind (2) +¤ò»È¤Ã¤Æ¥Ñ¥¹Ì¾¤Ë·ë¤ÓÉÕ¤±¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¥¹¥È¥ê¡¼¥à·¿¤Î¥½¥±¥Ã¥È¤Ï +̾Á°¤ò»ý¤¿¤Ê¤¤¡£Æ±Íͤˡ¢ +.BR socketpair (2) +¤ÇºîÀ®¤µ¤ì¤ë 2 ¤Ä¤Î¥½¥±¥Ã¥È¤â̾Á°¤ò»ý¤¿¤Ê¤¤¡£ +.BR getsockname (2), +.BR getpeername (2), +.BR accept (2) +¤¬Ì¾Á°¤Ê¤·¤Î¥½¥±¥Ã¥È¤Î¥¢¥É¥ì¥¹¤òÊÖ¤¹ºÝ¤Ë¤Ï¡¢ +¤½¤ÎŤµ¤Ï +.I "sizeof(sa_family_t)" +¤Ç¤¢¤ê¡¢ +.I sun_path +¤Ï¸¡ºº¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.\" ¼ÂÁõ¤´¤È¤Ë¤«¤Ê¤ê¤Î°ã¤¤¤¬Â¸ºß¤¹¤ë¡£ +.\" FreeBSD ¤Ç¤ÏŤµ¤Ï 16 ¥Ð¥¤¥È¤È¤Ê¤ê¡¢HP-UX ¤Ç¤ÏŤµ¤Ï 0 ¥Ð¥¤¥È¤È¤Ê¤ë¡£ +.IP * +.IR "abstract (Ãê¾Ý)" : +Ãê¾Ý¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï¡¢ +.I sun_path[0] +¤¬¥Ì¥ë¥Ð¥¤¥È ('\\0') ¤Ç¤¢¤ë¤³¤È¤«¤é¶èÊ̤Ǥ­¤ë¡£ +.I sun_path +¤Î»Ä¤ê¤ÎÁ´¥Ð¥¤¥È¤Ë¤è¤ê¥½¥±¥Ã¥È¤Î¡Ö̾Á°¡×¤¬ÄêµÁ¤µ¤ì¤ë +(̾Á°Ãæ¤Î¥Ì¥ë¥Ð¥¤¥È¤Ë¤ÏÆÃÊ̤ʰÕÌ£¤Ï¤Ê¤¤)¡£ +¤³¤Î̾Á°¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ñ¥¹Ì¾¤È¤Ï²¿¤Î´Ø·¸¤â¤Ê¤¤¡£ +¤³¤Î̾Á°¶õ´Ö¤Ë¤ª¤±¤ë¥½¥±¥Ã¥È¤Î¥¢¥É¥ì¥¹¤Ï¡¢ +.I sun_path +¤Î»Ä¤ê¤Î¥Ð¥¤¥È¤Çɽ¤µ¤ì¤ë¡£ +.BR getsockname (2), +.BR getpeername (2), +.BR accept (2) +¤¬Ãê¾Ý¥½¥±¥Ã¥È¤Î¥¢¥É¥ì¥¹¤òÊÖ¤¹ºÝ¤Ë¤Ï¡¢¤½¤ÎŤµ¤Ï +.I "sizeof(struct sockaddr_un)" +¤Ç¤¢¤ê¡¢ +.I sun_path +¤ËÃê¾Ý̾Á°¶õ´Ö¤Î̾Á°¤¬³ÊǼ¤µ¤ì¤ë¡£ +¥½¥±¥Ã¥È¤ÎÃê¾Ý̾Á°¶õ´Ö¤Ï Linux ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ê¡¢°Ü¿¢À­¤Ï¤Ê¤¤¡£ +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +Îò»ËŪ¤ÊÍýͳ¤Ë¤è¤ê¡¢¤³¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤Ï +¤¿¤È¤¨ +.B AF_UNIX +¸ÇÍ­¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤Ã¤Æ¤â +.B SOL_SOCKET +·¿¤Ç»ØÄꤹ¤ë¡£ +¥½¥±¥Ã¥È¥Õ¥¡¥ß¥ê¡¼¤È¤·¤Æ +.B SOL_SOCKET +¤ò»ØÄꤹ¤ë¤È¡¢ +.BR setsockopt (2) +¤Ç¥ª¥×¥·¥ç¥ó¤¬ÀßÄê¤Ç¤­¡¢ +.BR getsockopt (2) +¤Ç¼èÆÀ¤¬¤Ç¤­¤ë¡£ +.\" NAKANO added this TP +.TP +.B SO_PASSCRED +Á÷¿®¥×¥í¥»¥¹¤ÎÊä½õ¥á¥Ã¥»¡¼¥¸¤È¤·¤Æ¿®Ç¤¾õ¤ò¼õ¿®¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Æ¡¢¤Þ¤À¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢ +Ãê¾Ý̾Á°¶õ´Ö¤Ë¾¤È½Å¤Ê¤é¤Ê¤¤Ì¾Á°¤¬¼«Æ°Åª¤ËÀ¸À®¤µ¤ì¤ë¡£ +¥Ö¡¼¥ëÀ°¿ôÃͤΥե饰¤ò¼è¤ë¡£ +.SS ¥½¥±¥Ã¥È API +¤³¤ÎÀá¤Ç¤Ï¡¢Linux ¤Î Unix ¥É¥á¥¤¥ó¡¦¥½¥±¥Ã¥È¤Ç¤Î¡¢ +¥É¥á¥¤¥ó¸ÇÍ­¤Î¾ÜºÙ»ÅÍͤȥ½¥±¥Ã¥È API ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤µ¡Ç½¤Ë +¤Ä¤¤¤ÆÀâÌÀ¤¹¤ë¡£ + +Unix ¥É¥á¥¤¥ó¡¦¥½¥±¥Ã¥È¤Ç¤Ï¡¢ÂÓ°è³°¥Ç¡¼¥¿ (out-of-band data) ¤Î +Á÷¿® +.RB ( send (2) +¤È +.BR recv (2) +¤Î +.B MSG_OOB +¥Õ¥é¥°) ¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.BR send (2) +.B MSG_MORE +¥Õ¥é¥°¤Ï Unix ¥É¥á¥¤¥ó¡¦¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.BR recv (2) +¤Î +.I flags +°ú¤­¿ô¤Ç¤Î +.B MSG_TRUNC +¤Î»ÈÍÑ¤Ï Unix ¥É¥á¥¤¥ó¡¦¥½¥±¥Ã¥È¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ + +.B SO_SNDBUF +¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ï Unix ¥É¥á¥¤¥ó¡¦¥½¥±¥Ã¥È¤Ç¸ú²Ì¤ò»ý¤Ä¤¬¡¢ +.B SO_RCVBUF +¤Ï¸ú²Ì¤¬¤Ê¤¤¡£ +¥Ç¡¼¥¿¥°¥é¥à¡¦¥½¥±¥Ã¥È¤Ç¤Ï¡¢ +.B SO_SNDBUF +¤ÎÃͤ¬½ÐÎϥǡ¼¥¿¥°¥é¥à¤Î¾å¸Â¥µ¥¤¥º¤È¤Ê¤ë¡£ +¼ÂºÝ¤Î¾å¸ÂÃͤϡ¢ +.B SO_SNDBUF +¥ª¥×¥·¥ç¥ó¤È¤·¤ÆÀßÄꤵ¤ì¤¿ÃͤΠ2ÇÜ +.RB ( socket (7) +»²¾È) ¤«¤é¥ª¡¼¥Ð¥Ø¥Ã¥É¤È¤·¤Æ»ÈÍѤµ¤ì¤ë 32 ¥Ð¥¤¥È¤ò°ú¤¤¤¿ÃͤȤʤ롣 +.SS Êä½õ¥á¥Ã¥»¡¼¥¸ +Êä½õ¥Ç¡¼¥¿¤òÁ÷¼õ¤¹¤ë¤Ë¤Ï¡¢ +.BR sendmsg (2) +¤ä +.BR recvmsg (2) +¤ò»ÈÍѤ¹¤ë¡£ +Îò»ËŪ¤ÊÍýͳ¤Ë¤è¤ê¡¢°Ê²¼¤Ë¼¨¤¹Êä½õ¥á¥Ã¥»¡¼¥¸¤Î·¿¤Ï +¤¿¤È¤¨ +.B AF_UNIX +¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤Ã¤Æ¤â +.B SOL_SOCKET +·¿¤Ç»ØÄꤹ¤ë¡£ +¤³¤ì¤é¤òÁ÷¤ë¤Ë¤Ï¡¢¹½Â¤ÂÎ +.I cmsghdr +¤Î +.I cmsg_level +¥Õ¥£¡¼¥ë¥É¤Ë +.B SOL_SOCKET +¤ò¥»¥Ã¥È¤·¡¢ +.I cmsg_type +¥Õ¥£¡¼¥ë¥É¤Ë¥¿¥¤¥×¤ò¥»¥Ã¥È¤¹¤ë¡£ +¾ÜºÙ¤Ï +.BR cmsg (3) +¤ò¸«¤è¡£ +.TP +.B SCM_RIGHTS +¾¤Î¥×¥í¥»¥¹¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥»¥Ã¥È¤òÁ÷¼õ¿®¤¹¤ë¡£ +¥Ç¡¼¥¿Éôʬ¤Ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÀ°¿ôÇÛÎó¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ +ÅϤµ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤¢¤¿¤«¤â +.BR dup (2) +¤ÇÀ¸À®¤µ¤ì¤¿¤«¤Î¤è¤¦¤Ë¿¶¤ëÉñ¤¦¡£ +.TP +.B SCM_CREDENTIALS +Unix ¿®Ç¤¾õ¤òÁ÷¼õ¿®¤¹¤ë¡£¤³¤ì¤Ïǧ¾Ú¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¿®Ç¤¾õ¤Ï¡¢ +.I struct ucred +¤ÎÊä½õ¥á¥Ã¥»¡¼¥¸¤È¤·¤ÆÅϤµ¤ì¤ë¡£ +¤³¤Î¹½Â¤ÂÎ¤Ï +.I +¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ + +.in +4n +.nf +struct ucred { + pid_t pid; /* process ID of the sending process */ + uid_t uid; /* user ID of the sending process */ + gid_t gid; /* group ID of the sending process */ +}; +.fi +.in + +glibc 2.8 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î¹½Â¤ÂΤÎÄêµÁ¤òÆÀ¤ë¤¿¤á¤Ë¤Ïµ¡Ç½¸¡ºº¥Þ¥¯¥í +.B _GNU_SOURCE +¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ + +Á÷¿®Â¦¤¬»ØÄꤷ¤¿¿®Ç¤¾õ¤Ï¡¢¥«¡¼¥Í¥ë¤¬¥Á¥§¥Ã¥¯¤¹¤ë¡£ +¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ 0 ¤Î¥×¥í¥»¥¹¤Ë¤Ï¡¢ +¼«Ê¬¼«¿È°Ê³°¤ÎÃͤò»ØÄꤹ¤ë»ö¤¬µö¤µ¤ì¤ë¡£ +Á÷¿®Â¦¤Ï°Ê²¼¤Î 3 ¤Ä¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +1) ¼«Ê¬¼«¿È¤Î¥×¥í¥»¥¹ ID +.RB ( CAP_SYS_ADMIN +¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢ +2) ¼«Ê¬¼«¿È¤Î¥æ¡¼¥¶¡¼ ID ¤¢¤ë¤¤¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤«Êݸ set-user-ID +.RB ( CAP_SETUID +¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢ +3) ¼«Ê¬¼«¿È¤Î¥°¥ë¡¼¥× ID ¤¢¤ë¤¤¤Ï¼Â¹Ô¥°¥ë¡¼¥× ID ¤«Êݸ set-group-ID +.RB ( CAP_SETGID +¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç)¡£ +.I struct ucred +¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¥½¥±¥Ã¥È¤ËÂФ· +.B SO_PASSCRED +¥ª¥×¥·¥ç¥ó¤òÍ­¸ú¤Ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +.SH ¥¨¥é¡¼ +.TP +.B EADDRINUSE +ÁªÂò¤·¤¿¥½¥±¥Ã¥È¤¬´û¤ËÍѤ¤¤é¤ì¤Æ¤¤¤¿¡£¤Þ¤¿¤Ï¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥½¥±¥Ã¥È¥ª¥Ö¥¸¥§¥¯¥È¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤¿¡£ +.TP +.B ECONNREFUSED +listen ¾õÂ֤ˤʤ¤¥½¥±¥Ã¥È¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ·¤Æ +.BR connect (2) +¤¬¸Æ¤Ð¤ì¤¿¡£¥ê¥â¡¼¥È¥½¥±¥Ã¥È¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¡¢ +¥Õ¥¡¥¤¥ë̾¤¬¥½¥±¥Ã¥È¤Ç¤Ï¤Ê¤«¤Ã¤¿¡¢¤Ê¤É¤Î¤È¤­¤Ëµ¯¤³¤ë¡£ +.TP +.B ECONNRESET +¥ê¥â¡¼¥È¥½¥±¥Ã¥È¤¬Í½´ü¤·¤Ê¤¤¤«¤¿¤Á¤Ç¥¯¥í¡¼¥º¤µ¤ì¤¿¡£ +.TP +.B EFAULT +¥æ¡¼¥¶¡¼¥á¥â¥ê¥¢¥É¥ì¥¹¤¬ÉÔÀµ¡£ +.TP +.B EINVAL +ÅϤ·¤¿°ú¿ô¤¬ÉÔÀµ¡£¤è¤¯¤¢¤ë¸¶°ø¤Ï¡¢ +ÅϤ·¤¿¥¢¥É¥ì¥¹¤Î +.I sun_type +¥Õ¥£¡¼¥ë¥É¤Ë AF_UNIX ¤òÀßÄꤷ¤Ê¤«¤Ã¤¿¡¢ +¹Ô¤ª¤¦¤È¤·¤¿Áàºî¤ËÂФ·¤Æ¥½¥±¥Ã¥È¤Î¾õÂÖ¤¬Í­¸ú¤Ç¤Ï¤Ê¤«¤Ã¤¿¡¢¤Ê¤É¡£ +.TP +.B EISCONN +´û¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¤ËÂФ·¤Æ +.BR connect (2) +¤¬¸Æ¤Ð¤ì¤¿¡£¤Þ¤¿¤Ï¡¢»ØÄꤷ¤¿¥¿¡¼¥²¥Ã¥È¥¢¥É¥ì¥¹¤¬ +´û¤ËÀܳºÑ¤ß¤Î¥½¥±¥Ã¥È¤À¤Ã¤¿¡£ +.TP +.B ENOMEM +¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£ +.TP +.B ENOTCONN +¥½¥±¥Ã¥ÈÁàºî¤Ë¥¿¡¼¥²¥Ã¥È¥¢¥É¥ì¥¹¤¬É¬ÍפÀ¤¬¡¢ +¤³¤Î¥½¥±¥Ã¥È¤ÏÀܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.TP +.B EOPNOTSUPP +¥¹¥È¥ê¡¼¥à»Ø¸þ¤Ç¤Ê¤¤¥½¥±¥Ã¥È¤ËÂФ·¤Æ¥¹¥È¥ê¡¼¥àÁàºî¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¡£ +¤Þ¤¿¤ÏÂÓ°è³°¥Ç¡¼¥¿¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤è¤¦¤È¤·¤¿¡£ +.TP +.B EPERM +Á÷¿®¼Ô¤¬ +.I struct ucred +¤ËÉÔÀµ¤Ê¿®Ç¤¾õ¤òÅϤ·¤¿¡£ +.TP +.B EPIPE +¥ê¥â¡¼¥È¥½¥±¥Ã¥È¤¬¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¾å¤Ç¥¯¥í¡¼¥º¤µ¤ì¤¿¡£ +²Äǽ¤Ê¾ì¹ç¤Ï +.B SIGPIPE +¤âƱ»þ¤ËÁ÷¤é¤ì¤ë¡£¤³¤ì¤òÈò¤±¤ë¤Ë¤Ï +.B MSG_NOSIGNAL +¥Õ¥é¥°¤ò +.BR sendmsg (2) +¤ä +.BR recvmsg (2) +¤ËÅϤ¹¡£ +.TP +.B EPROTONOSUPPORT +ÅϤµ¤ì¤¿¥×¥í¥È¥³¥ë¤¬ AF_UNIX ¤Ç¤Ê¤¤¡£ +.TP +.B EPROTOTYPE +¥ê¥â¡¼¥È¥½¥±¥Ã¥È¤È¥í¡¼¥«¥ë¥½¥±¥Ã¥È¤Î¥¿¥¤¥×¤¬°ìÃפ·¤Æ¤¤¤Ê¤«¤Ã¤¿ +.RB ( SOCK_DGRAM +¤È +.BR SOCK_STREAM )¡£ +.TP +.B ESOCKTNOSUPPORT +̤ÃΤΥ½¥±¥Ã¥È¥¿¥¤¥×¡£ +.PP +¾¤Ë¤âÈÆÍѤΥ½¥±¥Ã¥ÈÁؤǥ¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Ë¥½¥±¥Ã¥È¥ª¥Ö¥¸¥§¥¯¥È¤òºî¤í¤¦¤È¤·¤¿¾ì¹ç¤Ë +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë¤³¤È¤¬¤¢¤ë¡£ +¤½¤ì¤¾¤ì¤Î¾ÜºÙ¤ÏŬÀÚ¤Ê man ¥Ú¡¼¥¸¤ò»²¾È¤¹¤ë¤³¤È¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +.B SCM_CREDENTIALS +¤ÈÃê¾Ý̾Á°¶õ´Ö¤Ï¡¢Linux 2.2 ¤ÇƳÆþ¤µ¤ì¤¿¡£ +°Ü¿¢À­¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï»È¤¦¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +(BSD ͳÍè¤Î¥·¥¹¥Æ¥à¤ÎÃæ¤Ë¤â¿®Ç¤¾õ¤ÎÁ÷¼õ¿®¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ë¤¬¡¢ +¤½¤Î¼ÂÁõ¤Î¾ÜºÙ¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë) +.SH Ãí°Õ +Linux ¤Î¼ÂÁõ¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤«¤é¸«¤¨¤ë¥½¥±¥Ã¥È¤Ï¡¢ +¤½¤ì¤é¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤Ë½¾¤¦¡£ +¥½¥±¥Ã¥È¤Î½êÍ­¼Ô¡¢¥°¥ë¡¼¥×¡¢¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ÏÊѹ¹¤Ç¤­¤ë¡£ +¿·¤·¤¤¥½¥±¥Ã¥È¤òºî¤ë¤È¤­¡¢ºî¤í¤¦¤È¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ +¥×¥í¥»¥¹¤¬½ñ¤­¹þ¤ß¤È¸¡º÷ (¼Â¹Ô) ¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ºîÀ®¤Ë¼ºÇÔ¤¹¤ë¡£ +¥½¥±¥Ã¥È¥ª¥Ö¥¸¥§¥¯¥È¤ËÀܳ¤¹¤ë¤Ë¤Ï¡¢ read/write ¸¢¸Â¤¬É¬ÍפǤ¢¤ë¡£ +¤³¤ÎÆ°ºî¤Ï¡¢Â¿¤¯¤Î BSD ͳÍè¤Î¥·¥¹¥Æ¥à¤È¤Ï°Û¤Ê¤Ã¤Æ¤¤¤ë +(BSD ¤Ç¤Ï Unix ¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Ï¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò̵»ë¤¹¤ë)¡£ +°Ü¿¢À­¤ÎɬÍ×¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +¥»¥­¥å¥ê¥Æ¥£¤ò¤³¤Î»ÅÍͤ˰͸¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Æ¥½¥±¥Ã¥È¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¤È¡¢ +¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥½¥±¥Ã¥È¤¬À¸À®¤µ¤ì¤ë¡£ +¤³¤ì¤ÏɬÍפʤ¯¤Ê¤Ã¤¿¤È¤­¤Ë¸Æ¤Ó¤À¤·¤¿¥æ¡¼¥¶¡¼¤¬ºï½ü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +.RB ( unlink (2) +¤òÍѤ¤¤ë)¡£ +Unix ¤ÇÄ̾ï»È¤ï¤ì¤ë¡ÖÇظå¤ÇÊĤ¸¤ëÊý¼°¡×¤¬Å¬ÍѤµ¤ì¤ë¡£ +¥½¥±¥Ã¥È¤Ï¤¤¤Ä¤Ç¤â unlink ¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢ºÇ¸å¤Î»²¾È¤¬ +¥¯¥í¡¼¥º¤µ¤ì¤¿¤È¤­¤Ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤«¤éºï½ü¤µ¤ì¤ë¡£ + +.B SOCK_STREAM +¾å¤Ç¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ä¿®Ç¤¾õ¤òÅϤ¹¤¿¤á¤Ë¤Ï¡¢Æ±¤¸ +.BR sendmsg (2) +¤ä +.BR recvmsg (2) +¥³¡¼¥ë¤ÇÊä½õ¥Ç¡¼¥¿°Ê³°¤Î¥Ç¡¼¥¿¤ò¾¯¤Ê¤¯¤È¤â +1 ¥Ð¥¤¥ÈÁ÷¿®/¼õ¿®¤¹¤ëɬÍפ¬¤¢¤ë¡£ + +Unix ¥É¥á¥¤¥ó¤Î¥¹¥È¥ê¡¼¥à¡¦¥½¥±¥Ã¥È¤Ç¤Ï¡¢ +ÂÓ°è³°¥Ç¡¼¥¿¤Î³µÇ°¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤¡£ +.SH Îã +.BR bind (2) +»²¾È¡£ +.SH ´ØÏ¢¹àÌÜ +.BR recvmsg (2), +.BR sendmsg (2), +.BR socket (2), +.BR socketpair (2), +.BR cmsg (3), +.BR capabilities (7), +.BR credentials (7), +.BR socket (7) diff --git a/release/man7/uri.7 b/release/man7/uri.7 new file mode 100644 index 00000000..61f490e9 --- /dev/null +++ b/release/man7/uri.7 @@ -0,0 +1,682 @@ +'\" +.\" (C) Copyright 1999-2000 David A. Wheeler (dwheeler@dwheeler.com) +.\" +.\" 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. +.\" +.\" Fragments of this document are directly derived from IETF standards. +.\" For those fragments which are directly derived from such standards, +.\" the following notice applies, which is the standard copyright and +.\" rights announcement of The Internet Society: +.\" +.\" Copyright (C) The Internet Society (1998). All Rights Reserved. +.\" This document and translations of it may be copied and furnished to +.\" others, and derivative works that comment on or otherwise explain it +.\" or assist in its implementation may be prepared, copied, published +.\" and distributed, in whole or in part, without restriction of any +.\" kind, provided that the above copyright notice and this paragraph are +.\" included on all such copies and derivative works. However, this +.\" document itself may not be modified in any way, such as by removing +.\" the copyright notice or references to the Internet Society or other +.\" Internet organizations, except as needed for the purpose of +.\" developing Internet standards in which case the procedures for +.\" copyrights defined in the Internet Standards process must be +.\" followed, or as required to translate it into languages other than English. +.\" +.\" Modified Fri Jul 25 23:00:00 1999 by David A. Wheeler (dwheeler@dwheeler.com) +.\" Modified Fri Aug 21 23:00:00 1999 by David A. Wheeler (dwheeler@dwheeler.com) +.\" Modified Tue Mar 14 2000 by David A. Wheeler (dwheeler@dwheeler.com) +.\" +.\" Japanese Version Copyright (c) 2000 NAKANO Takeo all rights reserved. +.\" Translated San 12 Mar 2000 by NAKANO Takeo +.\" +.\"WORD: generated file (KDE ¤Î) À¸À®¥Õ¥¡¥¤¥ë +.\" +.TH URI 7 2000-03-14 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +uri, url, urn \- uniform resource identifier (URI), URL ¤È URN ¤â´Þ¤à. +.SH ½ñ¼° +.nf +.HP 0.2i +URI = [ absoluteURI | relativeURI ] [ "#" fragment ] +.HP +absoluteURI = scheme ":" ( hierarchical_part | opaque_part ) +.HP +relativeURI = ( net_path | absolute_path | relative_path ) [ "?" query ] +.HP +scheme = "http" | "ftp" | "gopher" | "mailto" | "news" | "telnet" | + "file" | "man" | "info" | "whatis" | "ldap" | "wais" | \&... +.HP +hierarchical_part = ( net_path | absolute_path ) [ "?" query ] +.HP +net_path = "//" authority [ absolute_path ] +.HP +absolute_path = "/" path_segments +.HP +relative_path = relative_segment [ absolute_path ] +.fi +.SH ÀâÌÀ +.PP +Uniform Resource Identifier (URI) +¤ÏÃê¾ÝŪ¡¦ÊªÍýŪ¤Ê¥ê¥½¡¼¥¹ (web ¥Ú¡¼¥¸¤Ê¤É) +¤ò¼±Ê̤¹¤ë¤¿¤á¤Îû¤¤Ê¸»úÎó¤Ç¤¢¤ë¡£ +Uniform Resource Locator (URL) ¤Ï URI ¤Î°ì¼ï¤Ç¡¢ +¥ê¥½¡¼¥¹¤Î̾Á°¤Ê¤É¤Î°À­¤Ç¤Ç¤Ï¤Ê¤¯¡¢ +¤½¤Î¥ê¥½¡¼¥¹¤ËÂбþ¤¹¤ë¥¢¥¯¥»¥¹¥á¥«¥Ë¥º¥à¤òÄ̤·¤Æ¥ê¥½¡¼¥¹¤ò»ØÄꤹ¤ë +(¤Ä¤Þ¤ê¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î¡Ö¾ì½ê (location)¡×¤ò»ØÄꤹ¤ë)¡£ +Uniform Resource Name (URN) ¤Ï URI ¤Î°ì¼ï¤Ç¡¢ +¤³¤ì¤ÏÂоݤΥ꥽¡¼¥¹¤¬ÇÑ´þ¤µ¤ì¤¿¤êÍøÍѤǤ­¤Ê¤¯¤Ê¤Ã¤¿¾ì¹ç¤Ë¤â¡¢ +¥°¥í¡¼¥Ð¥ë¤Ë¾¤È½Å¤Ê¤ë¤³¤È¤Ê¤¯±Ê³¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +URI ¤Ï¡¢ web ¥Ö¥é¥¦¥¶¤Ê¤É¤Î¥Ä¡¼¥ë¤Ç +¥Ï¥¤¥Ñ¡¼¥Æ¥­¥¹¥È¥ê¥ó¥¯¤Î¥ê¥ó¥¯Àè¤ò»ØÄꤹ¤ë»þ¤Îɸ½àŪ¤ÊÊýË¡¤Ç¤¢¤ë¡£ +ʸ»úÎó "http://www.kernelnotes.org" ¤Ï URL ¤Ç¤¢¤ë (½¾¤Ã¤Æ +URI ¤Ç¤â¤¢¤ë)¡£Â¿¤¯¤Î¿Í¡¹¤Ï¡¢ URL ¤È¤¤¤¦¸ÀÍÕ¤ò¤Û¤Ü URI ¤Î +ƱµÁ¸ì¤È¤·¤Æ»È¤Ã¤Æ¤¤¤ë (¤·¤«¤·µ»½ÑŪ¤Ë¤Ï URL ¤Ï URI ¤Î¥µ¥Ö¥»¥Ã¥È¤Ç¤¢¤ë)¡£ +.PP +URI ¤ÏÀäÂÐŪ¤Ë¤âÁêÂÐŪ¤Ë¤â»ØÄê¤Ç¤­¤ë¡£ +ÀäÂÐŪ¤Ê»ØÄê¤Ï¡¢¥ê¥½¡¼¥¹¤ò¥³¥ó¥Æ¥¯¥¹¥È¤Ë°Í¸¤·¤Ê¤¤¤«¤¿¤Á¤Ç»²¾È¤¹¤ë¡£ +ÁêÂÐŪ¤Ê»ØÄê¤Ï¡¢¥ê¥½¡¼¥¹¤ò¸½ºß¤Î¥³¥ó¥Æ¥¯¥¹¥È¤«¤é¤Îº¹°Û¤Ë¤è¤Ã¤Æµ­½Ò¤¹¤ë¡£ +ÁêÂХѥ¹»²¾È¤Ç¤Ï¡¢ "." ¤ª¤è¤Ó ".." ¤À¤±¤Î¥Ñ¥¹Éôʬ (path segment) +¤ÏÆÃÊ̤ʰÕÌ£¤ò»ý¤Á¡¢ +¤½¤ì¤¾¤ì¡Ö¸½ºß¤Î³¬ÁØ¥ì¥Ù¥ë¡×¤ª¤è¤Ó¡Ö¸½ºß¤Î³¬Áؤΰì¤Ä¾å¤Î¥ì¥Ù¥ë¡× +¤È¤·¤Æ°·¤ï¤ì¤ë (Unix-like ¤Ê¥·¥¹¥Æ¥à¤ÈƱÍÍ)¡£ +¥³¥í¥óʸ»ú¤ò´Þ¤à¥Ñ¥¹Éôʬ¤ÏÁêÂÐ URI ¥Ñ¥¹¤ÎÀèƬ¤ËÍѤ¤¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤ +(¤Ä¤Þ¤ê "this:that" ¤Ï¥À¥á)¡£¥¹¥­¡¼¥à̾¤È¶èÊ̤Ǥ­¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï ./ ¤òÁ°ÃÖ¤¹¤ë¤³¤È (¤Ä¤Þ¤ê "./this:that" ¤È¤¹¤ë)¡£ +MS-DOS ¤Î»Ò¹ (Microsoft Windows ¤Ê¤É) ¤Ï¡¢ +¥Ç¥Ð¥¤¥¹Ì¾¤Î¥³¥í¥ó¤ò URI ¤Ç¤Ï¿âľ¥Ð¡¼ ("|") ¤ËÃÖ¤­´¹¤¨¤ë¡£ +¤·¤¿¤¬¤Ã¤Æ "C:" ¤Ï "C|" ¤È¤Ê¤ë¡£ +.PP +¥Õ¥é¥°¥á¥ó¥È»ØÄê»Ò (fragment identifier) ¤Ï¡¢(¤â¤·´Þ¤Þ¤ì¤Æ¤¤¤ì¤Ð) +¥ê¥½¡¼¥¹Ãæ¤Î̾Á°ÉÕ¤±¤µ¤ì¤¿ÆÃÄê¤ÎÉôʬ (¥Õ¥é¥°¥á¥ó¥È) ¤ò»²¾È¤¹¤ë¡£ +\(aq#\(aq »ØÄê»Ò°Ê¹ß¤Îʸ»úÎ󤬥ե饰¥á¥ó¥È¤ò»ØÄꤹ¤ë¡£ +\(aq#\(aq ¤Ç»Ï¤Þ¤ë URI ¤Ï¸½ºß¤Î¥ê¥½¡¼¥¹Ãæ¤Î¥Õ¥é¥°¥á¥ó¥È¤ò»²¾È¤¹¤ë¡£ +.S ÍøÍÑË¡ +URI ¤Î¥¹¥­¡¼¥à¤Ë¤Ï¿§¡¹¤Ê¼ïÎब¤¢¤ê¡¢ +¤½¤ì¤¾¤ì¸ÇÍ­¤Î¥ë¡¼¥ë¤ä°ÕÌ£¤¬Äɲ䵤ì¤Æ¤¤¤ë¡£ +¤·¤«¤·¤Ç¤­¤ë¤À¤±Åý°ì¤·¤¿¤â¤Î¤Ë¤·¤è¤¦¤È¤¤¤¦ÅØÎϤâ¤Ê¤µ¤ì¤Æ¤¤¤ë¡£ +Î㤨¤Ð¡¢Â¿¤¯¤Î URL ¥¹¥­¡¼¥à¤Ï¡Öµ¡´Ø (authority)¡×¤ËÂФ·¤Æ°Ê²¼¤Î½ñ¼° +(¤³¤³¤Ç¤Ï +.I ip_server +¤È¸Æ¤Ö¤³¤È¤Ë¤¹¤ë) +¤òµö¤·¤Æ¤¤¤ë (³Ñ³ç¸ÌÆâÉô¤Ï¾Êά²Äǽ)¡£ +.HP +.IR "ip_server = " [ user " [ : " password " ] @ ] " host " [ : " port ] +.PP +¤³¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤Ï¡¢¥æ¡¼¥¶Ì¾¡¢¥æ¡¼¥¶Ì¾+¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄê¤Ç¤­¤ë¡£ +¥Ý¡¼¥ÈÈÖ¹æ¤òÄɲ乤뤳¤È¤â²Äǽ¤Ç¤¢¤ë¡£ +.I host +¤Ï¥Û¥¹¥È¥³¥ó¥Ô¥å¡¼¥¿¤Î̾Á°¤Ç¡¢ DNS ¤ÇÄêµÁ¤µ¤ì¤ë̾Á°¤« IP ¥¢¥É¥ì¥¹ +(¥Ô¥ê¥ª¥É¤Ç¶èÀÚ¤é¤ì¤¿¿ô»ú) ¤Ç»ØÄꤹ¤ë¡£¤·¤¿¤¬¤Ã¤Æ URI + +¤Ï¡¢¥Û¥¹¥È xyz.com ¤Ë fred ¤È¤·¤Æ (¥Ñ¥¹¥ï¡¼¥É¤ò»È¤Ã¤Æ) +¥Ý¡¼¥È 8080 ¤ò»È¤Ã¤Æ¥í¥°¥¤¥ó¤¹¤ë¡£ +¥Ñ¥¹¥ï¡¼¥É¤Ï²Äǽ¤Ê¤é URI ¤Ë¤Ï´Þ¤á¤Ê¤¤¤Û¤¦¤¬Îɤ¤¤À¤í¤¦¡£ +¥Ñ¥¹¥ï¡¼¥É¤òľ½ñ¤­¤¹¤ë¤ÈÍÍ¡¹¤Ê¥»¥­¥å¥ê¥Æ¥£¾å¤Î¥ê¥¹¥¯¤¬À¸¤¸¤ë¤«¤é¤Ç¤¢¤ë¡£ +URL ¤Ë¥æ¡¼¥¶Ì¾¤À¤±¤òÍ¿¤¨¡¢¥Ñ¥¹¥ï¡¼¥É¤òÍ¿¤¨¤Ê¤¤¾ì¹ç¤Ï¡¢ +¥ê¥â¡¼¥È¥µ¡¼¥Ð¤Ï¥Ñ¥¹¥ï¡¼¥É¤òÍ׵ᤷ¤Æ¤¯¤ë¡£ +URL ¤ò²ò¼á¤·¤¿¥×¥í¥°¥é¥à¤¬¡¢¥æ¡¼¥¶¤Ë¤³¤ÎÆþÎϤòÂ¥¤¹¤³¤È¤Ë¤Ê¤í¤¦¡£ +.PP +°Ê²¼¤Ë¡¢ Unix-like ¤Ê¥·¥¹¥Æ¥à¤ÇÈó¾ï¤ËÎɤ¯ÍѤ¤¤é¤ì¤Æ¤ª¤ê¡¢ +¿¤¯¤Î¥Ä¡¼¥ë¤¬Íý²ò¤¹¤ë¥¹¥­¡¼¥à¤ò¼¨¤¹¡£ +URI ¤ò»È¤¦¥Ä¡¼¥ë¤Î¿¤¯¤Ç¤Ï¡¢ÆâÉô¥¹¥­¡¼¥à¤äÆüì¤Ê¥¹¥­¡¼¥à¤â +»È¤¨¤ë¤³¤È¤¬Â¿¤¤¡£¤½¤Î¤è¤¦¤Ê¥¹¥­¡¼¥à¤Ë´Ø¤·¤Æ¤Ï¥Ä¡¼¥ë¤Î¥É¥­¥å¥á¥ó¥È¤ò¸«¤ë¤³¤È¡£ +.PP +.B "http \- Web (HTTP) ¥µ¡¼¥Ð" +.PP +.RI http:// ip_server / path +.br +.RI http:// ip_server / path ? query +.PP +¤³¤ì¤Ï web (HTTP) ¥µ¡¼¥Ð¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î URL ¤Ç¤¢¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Î¥Ý¡¼¥È¤Ï 80¡£¥Ñ¥¹¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤ë¤È¤­¤Ï¡¢ +ÊÖ¤µ¤ì¤ë¾ðÊó¤Ï web ¥µ¡¼¥Ð¤¬ÁªÂò¤¹¤ë¡£Ä̾ï¤Ï¡¢ +"index.html" ¤ä "index.htm" ¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¤¬¤¢¤ì¤Ð¡¢¤½¤ÎÆâÍƤ¬ÊÖ¤µ¤ì¤ë¡£ +¤Ê¤±¤ì¤Ð¡¢¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤¬ (ŬÀڤʥê¥ó¥¯¤È¤È¤â¤Ë) À¸À®¤µ¤ì¤Æ +ÊÖ¤µ¤ì¤ë¡£Îã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +Ì䤤¹ç¤ï¤» (query) ¤ò¡¢¸Å¤¤ "isindex" ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤è¤Ã¤ÆÁ÷¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤³¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ïñ¸ì¤Þ¤¿¤Ï¥Õ¥ì¡¼¥º¤«¤é¤Ê¤ê¡¢Åù¹æ (=) ¤Ï´Þ¤Þ¤Ê¤¤¡£ +¤è¤êŤ¤ "GET" ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤âÌ䤤¹ç¤ï¤»¤Ï¹Ô¤¨¤ë¡£ +¤³¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤Ï¡¢°ì¤Ä°Ê¾å¤ÎÌ䤤¹ç¤ï¤»¥¨¥ó¥È¥ê¤¬ +.IR key = value +¤È¤¤¤¦·Á¼°¤Ç´Þ¤Þ¤ì¤ë¡£¤½¤ì¤¾¤ì¤Î¥¨¥ó¥È¥ê¤Ï¥¢¥ó¥Ñ¥µ¥ó¥É (&) ¤Ç¶èÀÚ¤é¤ì¤ë¡£ +.I key +¤ÏÊ£¿ô¸Ä»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£¤·¤«¤·¤½¤ì¤Ë°ÕÌ£¤¬¤¢¤ë¤«¤É¤¦¤«¤Ï +web ¥µ¡¼¥Ð¤È¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤¬·è¤á¤ë¡£ +HTML/XML/SGML ¤È GET Ì䤤¹ç¤ï¤»·Á¼°¤Î´Ö¤Ë¤Ï¡¢ÉÔ¹¬¤Ê´Ø·¸¤¬¤¢¤ë¡£ +°ì¤Ä°Ê¾å¤Î¥­¡¼¤Î´Þ¤Þ¤ì¤ë URI ¤¬ SGML/XML ʸ½ñ (HTML ¤â¤½¤¦) +¤ËËä¤á¤³¤Þ¤ì¤ëºÝ¤Ë¤Ï¡¢¥¢¥ó¥Ñ¥µ¥ó¥É (&) ¤Ï & ¤È½ñ¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +Á´¤Æ¤ÎÌ䤤¹ç¤ï¤»¤¬¤³¤Î·Á¼°¤ò»È¤¦¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¥Õ¥©¡¼¥à¤¬Ä¹¤¯¤Ê¤ë¤È URI ¤ËÆþ¤ì¤ë¤Ë¤ÏŤ¹¤®¤ë¤«¤é¡¢ +Ê̤ÎÄÌ¿®¥á¥«¥Ë¥º¥à (POST ¤È¸Æ¤Ð¤ì¤ë) ¤¬ÍѤ¤¤é¤ì¤ë¡£ +POST ¤Ç¤Ï URI ¤Ë¤Ï¥Ç¡¼¥¿¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¡¢ + ¤Ë¤¢¤ë +Common Gateway Interface ¤Î»ÅÍͽñ¤ò¸«¤è¡£ +.PP +.B "ftp \- ¥Õ¥¡¥¤¥ëžÁ÷¥×¥í¥È¥³¥ë (FTP)" +.PP +.RI ftp:// ip_server / path +.PP +¤³¤ì¤Ï¥Õ¥¡¥¤¥ëžÁ÷¥×¥í¥È¥³¥ë (FTP) ¤òÄ̤·¤Æ¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î +URL ¤Ç¤¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Î (À©¸æÍÑ) ¥Ý¡¼¥È¤Ï 21 ¤Ç¤¢¤ë¡£ +¥æ¡¼¥¶Ì¾¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥æ¡¼¥¶Ì¾ anonymous ¤¬Í¿¤¨¤é¤ì¤ë¡£ +¤½¤·¤Æ¤½¤Î¾ì¹ç¤Ë¤Ï¡¢¥¯¥é¥¤¥¢¥ó¥È¤Î¿¤¯¤ÏÍ׵ᤷ¤¿¿Í¤Î +¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥á¡¼¥ë¥¢¥É¥ì¥¹¤ò¥Ñ¥¹¥ï¡¼¥É¤È¤·¤ÆÍ¿¤¨¤ë¡£ +Îã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +.B "gofer \- Gofer ¥µ¡¼¥Ð" +.PP +.RI gopher:// ip_server / "gophertype selector" +.br +.RI gopher:// ip_server / "gophertype selector" %09 search +.br +.RI gopher:// ip_server / "gophertype selector" %09 search %09 gopher+_string +.br +.PP +¥Ç¥Õ¥©¥ë¥È¤Î gopher ¥Ý¡¼¥È¤Ï 70 ¤Ç¤¢¤ë¡£ +.I gophertype +¤Ï 1 ʸ»ú¤«¤é¤Ê¤ë¥Õ¥£¡¼¥ë¥É¤Ç¡¢ +URL ¤¬»²¾È¤·¤Æ¤¤¤ë Gopher ¤Î¥ê¥½¡¼¥¹¥¿¥¤¥×¤ò¼¨¤¹¡£ +¥Ñ¥¹Á´ÂΤ¬¶õ¤Ç¤¢¤Ã¤Æ¤â¤è¤¯¡¢¤½¤Î¾ì¹ç¤Ï¶èÀÚ¤ê¤Î "/" ¤â¾Êά¤Ç¤­¤ë¡£ +¤³¤Î¤È¤­ gophertype ¤Î¥Ç¥Õ¥©¥ë¥È¤Ï "1" ¤Ë¤Ê¤ë¡£ +.PP +.I selector +¤Ï Gopher ¥»¥ì¥¯¥¿Ê¸»úÎó¤Ç¤¢¤ë¡£Gopher ¥×¥í¥È¥³¥ë¤Ç¤Ï¡¢ +Gopher ¥»¥ì¥¯¥¿Ê¸»úÎó¤Ï¥ª¥¯¥Æ¥Ã¥Èʸ»ú¤«¤é¤Ê¤ê¡¢ +16¿Ê¿ô¤Î 09 (US-ASCII ¤Î HT ¤Þ¤¿¤Ï tab)¡¢ 0A (US-ASCII ¤Î LF ʸ»ú)¡¢ +0D (US-ASCII ¤Î CR ʸ»ú) °Ê³°¤Ê¤é¤É¤ó¤Ê¥ª¥¯¥Æ¥Ã¥È¤â»ØÄê¤Ç¤­¤ë¡£ +.PP +.B "mailto \- ÅŻҥ᡼¥ë¥¢¥É¥ì¥¹" +.PP +.RI mailto: email-address +.PP +¤³¤ì¤ÏÅŻҥ᡼¥ë¥¢¥É¥ì¥¹¤Ç¡¢Ä̾ï +.IR name @ hostname +¤È¤¤¤¦·Á¼°¤ò¤È¤ë¡£ÅŻҥ᡼¥ë¥¢¥É¥ì¥¹¤ÎÀµ¤·¤¤¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë´Ø¤¹¤ë +¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.BR mailaddr (7) +¤ò¸«¤è¡£ % ʸ»ú¤Ï¤¹¤Ù¤Æ %25 ¤È½ñ¤­Ä¾¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤ËÃí°Õ¡£ +Îã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +.B "news \- ¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¡¦¥Ë¥å¡¼¥¹¥á¥Ã¥»¡¼¥¸" +.PP +.RI news: newsgroup-name +.br +.RI news: message-id +.PP +.I newsgroup-name +¤Ï¥Ô¥ê¥ª¥É¤Ç¶èÀÚ¤é¤ì¤¿³¬ÁØŪ¤Ê̾Á°¤Ç¤¢¤ë¡£Î㤨¤Ð +"comp.infosystems.www.misc" ¤Ê¤É¡£ + ¤¬ "*" (¤Ä¤Þ¤ê ) ¤Î¾ì¹ç¤Ë¤Ï¡¢ +¡Ö»²¾È¤Ç¤­¤ëÁ´¤Æ¤Î¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¡×¤Î°ÕÌ£¤Ë¤Ê¤ë¡£ +Îã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +.I message-id +¤Ï +.UR http://www.ietf.org/rfc/rfc1036.txt +IETF RFC\ 1036 +.UE +¤Î Message-ID ¤«¤é¡¢°Ï¤ß¤Î "<" ¤È ">" ¤ò¼è¤Ã¤¿¤â¤Î¤ËÂбþ¤¹¤ë¡£ +Message-ID ¤Ï +.IR unique @ full_domain_name +¤È¤¤¤¦·Á¼°¤ò¤È¤ë¡£¥á¥Ã¥»¡¼¥¸¤Î»ØÄê¤Ë¤Ï "@" ʸ»ú¤¬´Þ¤Þ¤ì¤ë¤Î¤Ç¡¢ +¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¤Î̾Á°¤È¶èÊ̤Ǥ­¤ë¤À¤í¤¦¡£ +.PP +.B "telnet \- telnet ¥í¥°¥¤¥ó" +.PP +.RI telnet:// ip_server / +.PP +Telnet URL ¥¹¥­¡¼¥à¤ÏÂÐÏÃŪ¤Ê¥Æ¥­¥¹¥È¥µ¡¼¥Ó¥¹¤Ë Telnet ¥×¥í¥È¥³¥ë¤ò +Ä̤·¤Æ¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ºÇ¸å¤Î "/" ʸ»ú¤Ï¾Êά¤·¤Æ¤è¤¤¡£ +Îã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +.B "file \- Ä̾ï¤Î¥Õ¥¡¥¤¥ë" +.PP +.RI file:// ip_server / path_segments +.br +.RI file: path_segments +.PP +¤³¤ì¤Ï¥í¡¼¥«¥ë¤ËľÀÜ¥¢¥¯¥»¥¹¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤ò¼¨¤¹¡£ +Æüì¤Ê¥±¡¼¥¹¤È¤·¤Æ¡¢ +.I host +¤Ë¤Ï "localhost" ¤È¤¤¤¦Ê¸»úÎó¤òÍѤ¤¤¿¤ê¡¢¶õʸ»ú¤Ë¤·¤Æ¤â¤è¤¤¡£ +¤³¤ì¤Ï¡ÖURI ¤¬²ò¼á¤µ¤ì¤¿¥Þ¥·¥ó¡×¤È¤ß¤Ê¤µ¤ì¤ë¡£ +path ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¤Ï¡¢¥Ó¥å¡¼¥¢¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍƤò +¥ê¥ó¥¯¤òÄ¥¤Ã¤¿¤«¤¿¤Á¤Çɽ¼¨¤¹¤ë¤È¤è¤¤¤À¤í¤¦¡£ +¤·¤«¤·¸½ºß¤Ï¡¢¤Þ¤ÀÁ´¤Æ¤Î¥Ó¥å¡¼¥¢¤¬¤³¤ÎÆ°ºî¤ò¤¹¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +KDE ¤ÏÀ¸À®¥Õ¥¡¥¤¥ë (generated file) ¤ò URL +¤Î·Á¼°¤Ç¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£ +Í¿¤¨¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¸«ÉÕ¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +¥Õ¥¡¥¤¥ë̾¤ò¥°¥í¥Ö¤Ë¤è¤Ã¤ÆŸ³«¤¹¤ë¤ÈÎɤ¤¤«¤â¤·¤ì¤Ê¤¤ +.RB ( glob (7) +¤ª¤è¤Ó +.BR glob (3) +¤ò¸«¤è)¡£ +.PP +Æó¤Ä¤á¤Î½ñ¼° (Î㤨¤Ð ) ¤â¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë +Àµ¤·¤¤¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤¢¤ë¡£¤·¤«¤·¸Å¤¤É¸½à¤Ç¤Ï¤³¤Î½ñ¼°¤òµö¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤Ç¡¢ +¤³¤ì¤ò URI ¤È¤·¤Æǧ¼±¤·¤Ê¤¤¥×¥í¥°¥é¥à¤â¸ºß¤¹¤ë¡£ +¤è¤êÈÆÍÑŪ¤Êʸˡ¤Ï¡¢¥µ¡¼¥Ð̾¤Ë¶õʸ»ú¤òÍѤ¤¤ë¤â¤Î¡¢ +¤Ä¤Þ¤ê ¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +¤³¤Î·Á¼°¤â»Ø¤¹ÆâÍƤÏƱ¤¸¤Ç¤¢¤ê¡¢¥Ñ¥¿¡¼¥ó¥Þ¥Ã¥Á¤ä¤è¤ê¸Å¤¤¥×¥í¥°¥é¥à¤Ç¤â +URI ¤È¤·¤Æǧ¼±¤µ¤ì¤ä¤¹¤¤¡£ +¤â¤·°Õ¿Þ¤¹¤ë¤È¤³¤í¤¬¡Ö¸½ºß¤Î¾ì½ê¤«¤é¥¹¥¿¡¼¥È¡×¤Ê¤é¡¢ +¥¹¥­¡¼¥à¤Ï°ìÀÚÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +<../test.txt> ¤Î¤è¤¦¤Ê¡¢¥¹¥­¡¼¥à¤Ë°Í¸¤·¤Ê¤¤ÁêÂÐ¥ê¥ó¥¯¤òÍѤ¤¤ë¤³¤È¡£ +¤³¤Î¥¹¥­¡¼¥à¤ÎÎã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +.B "man \- man ¥Ú¡¼¥¸Ê¸½ñ" +.PP +.RI man: command-name +.br +.RI man: command-name ( section ) +.PP +¤³¤ì¤Ï¥í¡¼¥«¥ë¤Î¥ª¥ó¥é¥¤¥ó¥Þ¥Ë¥å¥¢¥ë (man) ¥ê¥Õ¥¡¥ì¥¹¥Ú¡¼¥¸¤ò»²¾È¤¹¤ë¡£ +command-name ¤Ë¤Ï³ç¸Ì¤È¥»¥¯¥·¥ç¥óÈÖ¹æ¤òÄɲ䷤Ƥâ¤è¤¤¡£ +¥»¥¯¥·¥ç¥óÈÖ¹æ¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¾Ü¤·¤¯ÃΤꤿ¤¤¾ì¹ç¤Ï +.BR man (7) +¤ò¤ß¤è¡£¤³¤Î URI ¥¹¥­¡¼¥à¤Ï Unix-like ¤Ê¥·¥¹¥Æ¥à (Linux ¤Ê¤É) +¤ËÆÃÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢¸½ºß¤Ï¤Þ¤À IETF ¤Ë¤è¤ëÅÐÏ¿¤Ï¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +Îã¤È¤·¤Æ¤Ï ¤Ê¤É¡£ +.PP +.B "info \- info ¥Ú¡¼¥¸Ê¸½ñ" +.PP +.RI info: virtual-filename +.br +.RI info: virtual-filename # nodename +.br +.RI info:( virtual-filename ) +.br +.RI info:( virtual-filename ) nodename +.PP +¤³¤Î¥¹¥­¡¼¥à¤Ï¡¢¥ª¥ó¥é¥¤¥ó¤Î info ¥ê¥Õ¥¡¥ì¥ó¥¹¥Ú¡¼¥¸ +(texinfo ¥Õ¥¡¥¤¥ë¤«¤éÀ¸À®¤µ¤ì¤ë) ¤ò»²¾È¤¹¤ë¡£ info ¥Ú¡¼¥¸¤Ï +GNU ¥Ä¡¼¥ë¤Ê¤É¤Î¥×¥í¥°¥é¥à¤ÇÍѤ¤¤é¤ì¤Æ¤¤¤ëʸ½ñ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤¢¤ë¡£ +¤³¤Î URI ¥¹¥­¡¼¥à¤Ï Unix-like ¤Ê¥·¥¹¥Æ¥à (Linux ¤Ê¤É) +¤ËÆÃÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢¸½ºß¤Ï¤Þ¤À IETF ¤Ë¤è¤ëÅÐÏ¿¤Ï¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +¤³¤Îʸ½ñ¤Î¼¹É®»þ¤Ë¤ª¤¤¤Æ¡¢ GNOME ¤È KDE ¤Ï¤½¤ì¤¾¤ì°Û¤Ê¤ëʸˡ¤Î URI +¤òÍѤ¤¤Æ¤ª¤ê¡¢¤ª¸ß¤¤Áê¼ê¤Îʸˡ¤ò¼õ¤±Æþ¤ì¤Ê¤¤¡£ +ºÇ½é¤Î 2 ¤Ä¤Î½ñ¼°¤Ï GNOME ¤Î½ñ¼°¤Ç¤¢¤ë¡£¥Î¡¼¥É̾ (nodename) +¤Î¥¹¥Ú¡¼¥¹¤Ï¤¹¤Ù¤Æ¥¢¥ó¥À¡¼¥¹¥³¥¢¤ËÊÑ´¹¤µ¤ì¤ë¡£ +3 ¤Ä¤á¤È 4 ¤Ä¤á¤Ï KDE ¤Î½ñ¼°¤Ç¤¢¤ë¡£¥Î¡¼¥É̾¤Î¥¹¥Ú¡¼¥¹¤Ï +¤½¤Î¤Þ¤Þ¥¹¥Ú¡¼¥¹¤Ç½ñ¤«¤ì¤ë +(URI ¤Îɸ½à¤Ç¤Ï¶Ø»ß¤µ¤ì¤Æ¤¤¤ë¤Î¤À¤¬)¡£ +¾­Íè¤Ï¿¤¯¤Î¥Ä¡¼¥ë¤¬¤³¤ì¤é¤Î½ñ¼°¤¹¤Ù¤Æ¤òÍý²ò¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¡¢ +¥Î¡¼¥É̾¤Î¥¢¥ó¥À¡¼¥¹¥³¥¢¡¢¥¹¥Ú¡¼¥¹¤òξÊý¤È¤âÍý²ò¤Ç¤­¤ë¤è¤¦¤Ë +¤Ê¤ë¤³¤È¤ò´üÂÔ¤·¤¿¤¤¡£ GNOME ¤Ç¤â KDE ¤Ç¤â¡¢ +¥Î¡¼¥É̾¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¤Ï¡¢¥Î¡¼¥É̾¤È¤·¤Æ "Top" ¤¬ÍѤ¤¤é¤ì¤ë¡£ +GNOME ½ñ¼°¤ÎÎã¤È¤·¤Æ¤Ï ¤ä ¤Ê¤É¡¢ +KDE ½ñ¼°¤ÎÎã¤È¤·¤Æ¤Ï ¤ä ¤Ê¤É¡£ +.PP +.B "whatis \- ʸ½ñ¸¡º÷" +.PP +.RI whatis: string +.PP +¤³¤Î¥¹¥­¡¼¥à¤Ï¡¢¥³¥Þ¥ó¥É¤Ë´Ø¤¹¤ëû¤¤ (1 ¹Ô¤Î) ÀâÌÀ¤ò½¸¤á¤¿ +¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¸¡º÷¤·¡¢ string ¤ò´Þ¤àʸ»úÎó¤ò¥ê¥¹¥È¤·¤ÆÊÖ¤¹¡£ +ñ¸ì¤¬´°Á´¤Ë¥Þ¥Ã¥Á¤·¤¿·ë²Ì¤À¤±¤¬ÊÖ¤µ¤ì¤ë¡£ +.BR whatis (1) +¤ò¸«¤è¡£ +¤³¤Î URI ¥¹¥­¡¼¥à¤Ï Unix-like ¤Ê¥·¥¹¥Æ¥à (Linux ¤Ê¤É) +¤ËÆÃÍ­¤Î¤â¤Î¤Ç¤¢¤ê¡¢¸½ºß¤Ï¤Þ¤À IETF ¤Ë¤è¤ëÅÐÏ¿¤Ï¤µ¤ì¤Æ¤¤¤Ê¤¤¡£ +.PP +.B "ghelp \- GNOME ¥Ø¥ë¥×ʸ½ñ" +.PP +.RI ghelp: name-of-application +.PP +Í¿¤¨¤é¤ì¤¿ application ¤ËÂбþ¤¹¤ë GNOME help ¤ò¥í¡¼¥É¤¹¤ë¡£ +¤³¤Î½ñ¼°¤òÍѤ¤¤¿Ê¸½ñ¤Ï¤Þ¤À¤¢¤Þ¤ê¿¤¯¤Ê¤¤¡£ +.PP +.B "ldap \- ·ÚÎ̥ǥ£¥ì¥¯¥È¥ê¥¢¥¯¥»¥¹¥×¥í¥È¥³¥ë" +.PP +.RI ldap:// hostport +.br +.RI ldap:// hostport / +.br +.RI ldap:// hostport / dn +.br +.RI ldap:// hostport / dn ? attributes +.br +.RI ldap:// hostport / dn ? attributes ? scope +.br +.RI ldap:// hostport / dn ? attributes ? scope ? filter +.br +.RI ldap:// hostport / dn ? attributes ? scope ? filter ? extensions +.PP +¤³¤Î¥¹¥­¡¼¥à¤Ï Lightweight Directory Access Protocol (LDAP) +¤Ø¤Î¥¯¥¨¥ê¡¼¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ LDAP ¤ÏÊ£¿ô¤Î¥µ¡¼¥Ð¤Ëʬ»¶¤·¤¿¡¢ +³¬Áز½¤µ¤ì¤¿¾ðÊó (¿Í¡¹¤ä·×»»»ñ¸»¤Ê¤É) ¤ËÌ䤤¹ç¤ï¤»¤ë¤¿¤á¤Î +¥×¥í¥È¥³¥ë¤Ç¤¢¤ë¡£ LDAP ¤Î URL ¥¹¥­¡¼¥à¤Ë´Ø¤¹¤ë¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +.UR http://www.ietf.org/rfc/rfc2255.txt +RFC\ 2255 +.UE +¤Ç¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Î URL ¤Î³ÆÉô¤Ï°Ê²¼¤ÎÄ̤ê: +.IP hostport 12 +¥¯¥¨¥ê¡¼¤ò¹Ô¤¦ LDAP ¥µ¡¼¥Ð¡£¥Û¥¹¥È̾¤ò½ñ¤¯¡£Â³¤±¤Æ¥³¥í¥ó¤È¥Ý¡¼¥ÈÈÖ¹æ¤ò +Äɲ乤뤳¤È¤â¤Ç¤­¤ë¡£ LDAP ¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥Ý¡¼¥È¤Ï TCP ¥Ý¡¼¥È 389 ¤Ç¤¢¤ë¡£ +¾Êά¤µ¤ì¤ë¤È¡¢¤É¤Î LDAP ¥µ¡¼¥Ð¤òÍѤ¤¤ë¤«¤Ï¥¯¥é¥¤¥¢¥ó¥È¤¬·èÄꤹ¤ë¡£ +.IP dn +LDAP ¤Î Distintuished Name (¼±ÊÌ̾)¡£ +LDAP ¸¡º÷¤Î base ¥ª¥Ö¥¸¥§¥¯¥È¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë ( +.UR http://www.ietf.org/rfc/rfc2253.txt +RFC\ 2253 +.UE +¤Î section 3 ¤ò¸«¤è)¡£ +.IP attributes +¥³¥ó¥Þ¶èÀÚ¤ê¤Î¡¢ÊÖ¤µ¤ì¤ë°À­ (attribute) ¤Î¥ê¥¹¥È¡£ +RFC\ 2251 ¤Î section 4.1.5 ¤ò¸«¤è¡£¾Êά¤µ¤ì¤ë¤ÈÁ´¤Æ¤Î°À­¤¬ÊÖ¤µ¤ì¤ë¡£ +.IP scope +¸¡º÷¤Î¥¹¥³¡¼¥×¤ò»ØÄꤹ¤ë¡£ +"base" (base ¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷), "one" (1 ¥ì¥Ù¥ë¸¡º÷), +"sub" (¥µ¥Ö¥Ä¥ê¡¼¸¡º÷) ¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£ +¾Êά¤¹¤ë¤È "base" ¤¬²¾Äꤵ¤ì¤ë¡£ +.IP filter +¸¡º÷¥Õ¥£¥ë¥¿ (ÊÖ¤µ¤ì¤ë¥¨¥ó¥È¥ê¤Î¥µ¥Ö¥»¥Ã¥È) ¤ò»ØÄꤹ¤ë¡£ +¾Êά¤µ¤ì¤ë¤È¡¢Á´¤Æ¤Î¥¨¥ó¥È¥ê¤¬ÊÖ¤µ¤ì¤ë¡£ +.UR http://www.ietf.org/rfc/rfc2254.txt +RFC\ 2254 +.UE +¤Î section 4 ¤ò¸«¤è¡£ +.IP extensions +¥³¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¤¿ type=value ¥Ú¥¢¤Î¥ê¥¹¥È¡£ +¤³¤³¤Ç =value ¤ÎÉôʬ¤Ï¡¢¤½¤ì¤òÍ׵ᤷ¤Ê¤¤¥ª¥×¥·¥ç¥ó¤ËÂФ·¤Æ¤Ï +¾Êά¤Ç¤­¤ë¡£ \(aq!\(aq ¤¬Á°ÃÖ¤µ¤ì¤¿ extension ¤Ï critical +(¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤) ¤Ç¤¢¤ê¡¢ +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð critical ¤Ç¤Ï¤Ê¤¤ (¾Êά¤Ç¤­¤ë)¡£ +.PP +LDAP ¤Î¥¯¥¨¥ê¡¼¤Ï¡¢Îã¤È¤È¤â¤ËÀâÌÀ¤¹¤ë¤Î¤¬ºÇ¤â´Êñ¤Ç¤¢¤ë¡£ +¼¡¤ÎÎã¤Ï¡¢ ldap.itd.umich.edu ¤Ë¡¢ +U.S. ¤Ë¤¢¤ë University of Michigan ¤Î¾ðÊó¤ò¿Ò¤Í¤ëÎã¤Ç¤¢¤ë¡£ +.PP +.nf +ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US +.fi +.PP +͹ÊØÍѤν»½ê°À­¤À¤±¤ò¼èÆÀ¤¹¤ë¾ì¹ç¤Ï¡¢ +¼¡¤Î¤è¤¦¤Ë¥ê¥¯¥¨¥¹¥È¤¹¤ë: +.PP +.nf +ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US?postalAddress +.fi +.PP +host.com ¤Î¥Ý¡¼¥È 6666 ¤Ë¡¢ University of Michigan ¤Ë¤¤¤ë +common name (cn) ¤¬ "Babs Jenson" ¤Î¿Í¤Î¾ðÊó¤ò¿Ò¤Í¤ë¾ì¹ç¤Ï¡¢ +¼¡¤Î¤è¤¦¤Ë¥ê¥¯¥¨¥¹¥È¤¹¤ë: +.PP +.nf +ldap://host.com:6666/o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen) +.fi +.PP +.B "wais \- ¹­°è¾ðÊ󥵡¼¥Ó¥¹" +.PP +.RI wais:// hostport / database +.br +.RI wais:// hostport / database ? search +.br +.RI wais:// hostport / database / wtype / wpath +.PP +¤³¤Î¥¹¥­¡¼¥à¤Ï WAIS ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢¸¡º÷¡¢Ê¸½ñ¤ò»ØÄꤹ¤ë +(WAIS ¤Ë´Ø¤¹¤ë¾Ü¤·¤¤¾ðÊó¤Ï +.UR http://www.ietf.org/rfc/rfc1625.txt +IETF RFC\ 1625 +.UE +¤ò¸«¤è)¡£ +hostport ¤Ï¡¢¥Û¥¹¥È̾¤Ë¥³¥í¥ó¤È¥Ý¡¼¥ÈÈÖ¹æ¤òÉղä·¤¿¤â¤Î¤Ç¤¢¤ë +(¥³¥í¥ó + ¥Ý¡¼¥ÈÈÖ¹æ¤Ï¾Êά²Ä¡£¥Ç¥Õ¥©¥ë¥È¤Î¥Ý¡¼¥ÈÈÖ¹æ¤Ï 210 ¤Ç¤¢¤ë)¡£ +.PP +ºÇ½é¤Î½ñ¼°¤Ï WAIS ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë¸¡º÷¤Î»ØÄê¤Ç¤¢¤ë¡£ +Æó¤Ä¤á¤Î½ñ¼°¤ÏÆÃÄê¤Î WAIS ¥Ç¡¼¥¿¥Ù¡¼¥¹ +.I database +¤ËÂФ¹¤ë¸¡º÷¤Î»ØÄê¤Ç¤¢¤ë¡£ +»°¤Ä¤á¤Î½ñ¼°¤Ï WAIS ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤¢¤ëÆÃÄê¤Îʸ½ñ¤ò¼è½Ð¤¹»ØÄê¤Ç¤¢¤ë¡£ +.I wtype +¤Ï WAIS ¤Î¥ª¥Ö¥¸¥§¥¯¥È·Á¼°»ØÄê¤Ç¤¢¤ê¡¢ +.I wpath +¤Ï WAIS document-id ¤Ç¤¢¤ë¡£ +.PP +.B ¤½¤Î¾¤Î¥¹¥­¡¼¥à +.PP +¾¤Ë¤â¿¤¯¤Î URI ¥¹¥­¡¼¥à¤¬Â¸ºß¤¹¤ë¡£ +URI ¤ò¼õÉÕ¤±¤ë¤Û¤È¤ó¤É¤Î¥Ä¡¼¥ë¤Ï¡¢ÆâÉô URI ¤Î¥»¥Ã¥È¤ò¥µ¥Ý¡¼¥È¤¹¤ë +(Î㤨¤Ð Mozilla ¤ÏÆâÉô¾ðÊóÍѤΠabout: ¤È¤¤¤¦¥¹¥­¡¼¥à¤ò¼õÉÕ¤±¤ë¤·¡¢ +GNOME ¥Ø¥ë¥×¥Ö¥é¥¦¥¶¤Ï¤¤¤í¤¤¤í¤Ê½ÐȯÅÀÍÑ¤Ë toc: ¤È¤¤¤¦¥¹¥­¡¼¥à¤ò»ý¤Ã¤Æ¤¤¤ë)¡£ +ÄêµÁ¤µ¤ì¤¿¥¹¥­¡¼¥à¤Ï¤¿¤¯¤µ¤ó¤¢¤ë¤¬¡¢¸½»þÅÀ¤Ç¹­¤¯ÍѤ¤¤é¤ì¤Æ¤Ï¤¤¤Ê¤¤ +(Î㤨¤Ð prospero ¤È¤«)¡£ +nntp: ¥¹¥­¡¼¥à¤Ï news: ¥¹¥­¡¼¥à¤¬¹¥¤ó¤ÇÍѤ¤¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤Î¤Ç +»È¤ï¤Ê¤¤¤Û¤¦¤¬Îɤ¤¡£ URN ¤Ï urn: ¥¹¥­¡¼¥à¤Ë¤è¤Ã¤Æ¡¢³¬ÁØŪ¤Ê̾Á°¶õ´Ö +(Î㤨¤Ð urn:ietf:... ¤Ï IETF ʸ½ñ¤ò¼¨¤¹) +¤È¤·¤Æ¥µ¥Ý¡¼¥È¤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¤¬¡¢¸½»þÅÀ¤Ç¤Ï URN ¤Ï¤¢¤Þ¤êÍѤ¤¤é¤ì¤Æ¤¤¤Ê¤¤¡£ +Á´¤Æ¤Î¥Ä¡¼¥ë¤¬Á´¤Æ¤Î¥¹¥­¡¼¥à¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +.SS ʸ»ú¥¨¥ó¥³¡¼¥É +.PP +URI ¤Ç¤Ï¡¢¿§¡¹¤Ê¾õ¶·²¼¤ÇÆþÎϤǤ­¤ë¤è¤¦¤Ë¡¢Ê¸»ú¤Î¼ïÎà¤òÀ©¸Â¤·¤Æ¤¤¤ë¡£ +.PP +°Ê²¼¤Îʸ»ú¤ÏͽÌ󤵤ì¤Æ¤¤¤ë¡£¤¹¤Ê¤ï¤Á¡¢¤³¤ì¤é¤Îʸ»ú¤Ï +URI ¤ËÅо줹¤ë¤³¤È¤¬¤¢¤ë¤¬¡¢¤½¤ì¤é¤ÎÍøÍÑË¡ (²ò¼á¤Î¤µ¤ìÊý) ¤Ï +ͽÌ󤵤줿ÌÜŪ¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë (¾×Æͤ¹¤ë¥Ç¡¼¥¿¤Ï +URI ¤Ë¤¹¤ëÁ°¤Ë¥¨¥¹¥±¡¼¥×¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ +.IP + ; / ? : @ & = + $ , +.PP +̤ͽÌóʸ»ú (unreserved character) ¤Ï URI ¤Ë»È¤Ã¤Æ¤è¤¤¡£ +¤³¤ì¤Ë¤Ï±Ñ»ú¤ÎÂçʸ»ú¤È¾®Ê¸»ú¡¢10 ¿Ê¤Î¿ô»ú¡¢¤ª¤è¤Ó +°Ê²¼¤Î¶çÆÉʸ»ú¡¦µ­¹æ¤¬´Þ¤Þ¤ì¤ë +.IP + \- _ . ! ~ * ' ( ) +.PP +¾¤Îʸ»ú¤Ï¤¹¤Ù¤Æ¥¨¥¹¥±¡¼¥×¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥¨¥¹¥±¡¼¥×¤µ¤ì¤¿¥ª¥¯¥Æ¥Ã¥È¤Ï 3 ʸ»ú¤«¤é¤Ê¤ë: +ÀèƬ¤Ë¥Ñ¡¼¥»¥ó¥Èʸ»ú "%"¡¢¤½¤ì¤Ë³¤±¤Æ¥ª¥¯¥Æ¥Ã¥È¥³¡¼¥É¤òɽ¤¹ +2 ʸ»ú¤Î 16 ¿Ê¿ô»ú¤Ç¤¢¤ë (16 ¿Ê¿ô¤Î±Ñ»ú¤ÏÂçʸ»ú¾®Ê¸»ú¤É¤Á¤é¤Ç¤âÎɤ¤)¡£ +Î㤨¤Ð¶õÇòʸ»ú¤Ï "%20" ¤Î¤è¤¦¤Ë¥¨¥¹¥±¡¼¥×¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢ +¥¿¥Öʸ»ú¤Ï "%09"¡¢ "&" ¤Ï "%26" ¤È¤Ê¤ë¡£ +¥Ñ¡¼¥»¥ó¥Èʸ»ú "%" ¤Ï¾ï¤Ë¥¨¥¹¥±¡¼¥×¤ò¼¨¤¹Í½Ì󤵤줿ÌÜŪ¤ËÍѤ¤¤é¤ì¤ë¤Î¤Ç¡¢ +"%" ¼«¿È¤òɽ¤¹¤Ë¤Ï "%25" ¤È¥¨¥¹¥±¡¼¥×¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +¥¯¥¨¥ê¡¼¤Î¥Æ¥­¥¹¥È¤Ç¤Ï¡¢¥¹¥Ú¡¼¥¹Ê¸»ú¤ò¥×¥é¥¹µ­¹æ (+) ¤Ç¥¨¥¹¥±¡¼¥×¤¹¤ë¤³¤È¤â +°ìÈ̤ËÎɤ¯¹Ô¤ï¤ì¤ë¡£¤³¤Î´·Îã¤Ï´ØÏ¢ RFC ¤Ç¼ÂºÝ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤ +(Âå¤ï¤ê¤Ë %20 ¤ò¿ä¾©¤·¤Æ¤¤¤ë) ¤¬¡¢¥¯¥¨¥ê¡¼¥Æ¥­¥¹¥È¤ò¼õÉÕ¤±¤ë +¥Ä¡¼¥ë¤Ï¡¢¤³¤Î½ñ¼°¤Ø¤ÎÂбþ¤òÍÑ°Õ¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¢¤í¤¦¡£ +URI ¤Ï¡¢¾ï¤Ë¡Ö¥¨¥¹¥±¡¼¥×¤µ¤ì¤¿¡×¤«¤¿¤Á¤Çɽ¼¨¤µ¤ì¤ë¡£ +.PP +̤ͽÌóʸ»ú¤â¥¨¥¹¥±¡¼¥×¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢¤³¤ì¤Ë¤è¤Ã¤Æ +URI ¤Î°ÕÌ£¤¹¤ë¤È¤³¤í¤¬ÊѤï¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ +¤·¤«¤·URI ¤Ë¤½¤ÎÈ󥨥¹¥±¡¼¥×ʸ»ú¤¬¸½¤ì¤ë¤³¤È¤¬µö¤µ¤ì¤Ê¤¤¤è¤¦¤Ê +Æüì¤Ê¾ì¹ç¤ò½ü¤¤¤Æ¡¢¤³¤ì¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +Î㤨¤Ð¡¢ HTTP URL ¤Î path ¤Ë¤ª¤¤¤Æ +"%7e" ¤¬ "~" ¤ÎÂå¤ï¤ê¤ËÍѤ¤¤é¤ì¤ë¤³¤È¤¬¤¢¤ë¤¬¡¢ +¤³¤ÎÆó¤Ä¤Ï HTTP URL ¤È¤·¤Æ¤ÏÅù²Á¤Ç¤¢¤ë¡£ +.PP +US ASCII ¥­¥ã¥é¥¯¥¿¥»¥Ã¥È°Ê³°¤Îʸ»ú¤ò URI ¤È¤·¤Æ°·¤¦¾ì¹ç¡¢ +HTML 4.1 µ¬³Ê (section B.2) µÚ¤Ó IETF RFC\ 2718 (section 2.2.5) ¤Ï +°Ê²¼¤Î¼êË¡¤òÍѤ¤¤ë¤è¤¦¿ä¾©¤·¤Æ¤¤¤ë¡£ +.IP 1. 4 +¥­¥ã¥é¥¯¥¿Îó¤ò UTF-8 (IETF RFC\ 2279, +.BR utf-8 (7) +»²¾È) ¤ËÊÑ´¹¤·¡¢ +.IP 2. +URI ¥¨¥¹¥±¡¼¥×µ¡¹½¤òÍѤ¤¤ë¡£ +¤Ä¤Þ¤ê¡¢°ÂÁ´¤Ç¤Ê¤¤¥ª¥¯¥Æ¥Ã¥È¤ò %HH ¤Ç¥¨¥ó¥³¡¼¥É¤¹¤ë¡£ +.SS "URI ¤ò½ñ¤¯¤Ë¤Ï" +URI ¤ò½ñ¤¯»þ¤Ë¤Ï¡¢¥À¥Ö¥ë¥¯¥©¡¼¥È¤ÎÆâÉô¤Ë½ñ¤¯ +(Îã: "http://www.kernelnotes.org") ¤«¡¢ +angle ¥Ö¥é¥±¥Ã¥È¤Ç°Ï¤à (Îã: ) ¤«¡¢ +°ì¹Ô¤Ë URI ¤À¤±¤ò½ñ¤¯¤«¤¹¤ë¡£ +¥À¥Ö¥ë¥¯¥©¡¼¥È¤ò»È¤¦¿Í¤Ë·Ù¹ð: +\fBÀäÂФË\fP¶çÆÉÅÀ (ʸËö¤Î¥Ô¥ê¥ª¥É¤ä¥ê¥¹¥È¶èÀÚ¤ê¤Î¥³¥ó¥Þ) ¤ò +URI ¤ÎÆâÉô¤Ë°ÜÆ°¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +Âå¤ï¤ê¤Ë angle ¥Ö¥é¥±¥Ã¥È¤ò»È¤¦¤«¡¢ +³°¤Ë¤¢¤ëʸ»ú¤ò¥¯¥©¡¼¥Æ¡¼¥·¥ç¥ó¥Þ¡¼¥¯¤ÎÆâÉô¤Ë +·è¤·¤Æ´Þ¤á¤Ê¤¤¤è¤¦¤Ê°úÍÑÊý¼°¤ËÀÚÂؤ¨¤ë¤³¤È¡£ +¸å¼Ô¤ÎÊý¼°¤Ï "Hart's Rules" ¤ä +"Oxford Dictionary for Writers and Editors" ¤Ë¤è¤ì¤Ð +¡Ö¿·¤·¤¤ (new) °úÍÑÊý¼°¡×¤¢¤ë¤¤¤Ï¡ÖÏÀÍýŪ (logical) ¤Ê°úÍÑÊý¼°¡× +¤È¸Æ¤Ð¤ì¤Æ¤ª¤ê¡¢ ¥¤¥®¥ê¥¹¿Í¤äÀ¤³¦Ãæ¤Î¥Ï¥Ã¥«¡¼Ã£¤Ï¤³¤Á¤é¤Î´·½¬¤ò¹¥¤ó¤Ç¤¤¤ë +(¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï +Hacker Writing Style ¤Î Jargon File ¤Î¥»¥¯¥·¥ç¥ó +.I http://www.fwi.uva.nl/~mes/jargon/h/HackerWritingStyle.html +¤ò¸«¤è)¡£ +¸Å¤¤Ê¸½ñ¤Ç¤Ï¡¢ "URL:" ¤È¤¤¤¦Ê¸»úÎó¤ò URI ¤ÎľÁ°¤ËÁÞÆþ¤¹¤ë¤³¤È¤ò +´«¤á¤Æ¤¤¤ë¤â¤Î¤â¤¢¤ë¤¬¡¢¤·¤«¤·¤³¤Î·Á¼°¤Ï¤Þ¤Ã¤¿¤¯Î®¹Ô¤·¤Ê¤«¤Ã¤¿¡£ +.PP +URI ¤Î½ñ¼°¤ÏÛ£Ë椵¤òÇÓ½ü¤¹¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£ +¤·¤«¤· URI ¤¬¹­¤Þ¤ë¤Ë¤Ä¤ì¡¢ÀΤʤ¬¤é¤Î¥á¥Ç¥£¥¢ (TV¡¢¥é¥¸¥ª¡¢¿·Ê¹¡¢ +´ÇÈĤʤɤʤÉ) ¤Ï URI »²¾È¤ò¾Êά¤·¤¿¤«¤¿¤Á¡¢¤¹¤Ê¤ï¤Á +µ¡´ØÉô¤È¥Ñ¥¹Éô¤À¤±¤Ç¥ê¥½¡¼¥¹¤ò»ØÄꤹ¤ë¤³¤È¤¬Â¿¤¯¤Ê¤Ã¤Æ¤¤¤ë +(Îã: )¡£ +¤³¤Î¤è¤¦¤Ê»²¾È¤Ï¥Þ¥·¥ó¤È¤¤¤¦¤è¤ê¤Ï¿Í´Ö¸þ¤±¤Î¤â¤Î¤Ç¡¢ +¥³¥ó¥Æ¥­¥¹¥È¥Ù¡¼¥¹¤Î¿ä¬¤Ë¤è¤Ã¤Æ URI ¤ÎÊä´°¤¬²Äǽ¤Ç¤¢¤ë¤³¤È¤ò +¤¢¤Æ¤Ë¤·¤Æ¤¤¤ë¤Î¤Ç¤¢¤ë (Î㤨¤Ð "www" ¤Ç¤Ï¤¸¤Þ¤ë¥Û¥¹¥È̾¤Ê¤é +"http://" ¤¬¤Ä¤¯¤À¤í¤¦¤·¡¢ "ftp" ¤Ç¤Ï¤¸¤Þ¤ë¥Û¥¹¥È̾¤Ê¤é +"ftp://" ¤¬¤Ä¤¯¤À¤í¤¦)¡£ +¿¤¯¤Î¥¯¥é¥¤¥¢¥ó¥È¤Î¼ÂÁõ¤Ç¤Ï¡¢¤³¤Î¼ï¤Î»²¾È¤ò¿ä¬¤Ë¤è¤Ã¤Æ²ò·è¤¹¤ë¡£ +¤³¤Î¤è¤¦¤Ê¿ä¬¤Ï»þÂå¤È¤È¤â¤ËÊѤï¤ê¤¦¤ë¡£ +Æä˿·¤·¤¤¥¹¥­¡¼¥à¤¬Æ³Æþ¤µ¤ì¤ë¤È¤½¤¦¤Ç¤¢¤ë¡£ +URI ¤Î¾Êά·Á¤Ç¤ÏÁêÂÐ URL ¥Ñ¥¹¤Î¶èÊ̤¬ÉÕ¤±¤é¤ì¤Ê¤¤¤Î¤Ç¡¢ +¾Êά·Á URI »²¾È¤ÏÁêÂÐ URI ¤ÎÍøÍѤǤ­¤ë¤È¤³¤í¤Ç¤Ï»È¤¨¤Ê¤¤¡£ +¤Ä¤Þ¤êÄêµÁºÑ¤ß¤Î¥Ù¡¼¥¹ (¥À¥¤¥¢¥í¥°¥Ü¥Ã¥¯¥¹¤Ê¤É) +¤¬¤Ê¤¤¾ì¹ç¤Ë¸Â¤Ã¤ÆÍøÍѤǤ­¤ë¡£ +.\"nakano: ¤³¤Îʸ̮¤Ç¤Î dialog box ¤È¤Ï¡© +ʸ½ñÆâÉô¤Ç¤Î¥Ï¥¤¥Ñ¡¼¥Æ¥­¥¹¥È¥ê¥ó¥¯¤Ë¤Ï¾Êά·Á URI ¤ò»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ +¾å½Ò¤Îɸ½à¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»È¤¦¤³¤È¡£ +.SH ½àµò +.PP +.I http://www.ietf.org/rfc/rfc2396.txt +(IETF RFC\ 2396), +.UE +.I http://www.w3.org/TR/REC-html40 +(HTML 4.0). +.SH Ãí°Õ +Linux ¥·¥¹¥Æ¥à¤Ç URI ¤ò¼õÉÕ¤±¤ë¥Ä¡¼¥ë (Î㤨¤Ð web ¥Ö¥é¥¦¥¶¤Ê¤É) ¤Ï¡¢ +¾å¤Ë¤¢¤²¤¿Á´¤Æ¤Î¥¹¥­¡¼¥à¤ò (ľÀܤޤ¿¤Ï´ÖÀܤË) °·¤¨¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +man: ¤ä info: ¤â´Þ¤á¤Æ¡¢¤Ç¤¢¤ë¡£ +¥¹¥­¡¼¥à¤Î½èÍý¤Ë¾¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤Î¤ÏÎɤ¤¤³¤È¤À¤·¡¢ +¼Â¤Ï¤¹¤¹¤ó¤Ç¤½¤¦¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +µ»½ÑŪ¤Ë¤Ï¡¢¥Õ¥é¥°¥á¥ó¥È¤Ï URI ¤Î°ìÉô¤Ç¤Ï¤Ê¤¤¡£ +.PP +URI (URL ¤â´Þ¤à) ¤ò¥Ç¡¼¥¿¥Õ¥©¡¼¥Þ¥Ã¥È¤ËËä¤á¤³¤àÊýË¡¤Ë´Ø¤¹¤ë¾ðÊó¤Ï¡¢ +¤½¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¥É¥­¥å¥á¥ó¥È¤ò¸«¤è¡£ HTML ¤Ï +\fItext\fP +¤òÍѤ¤¤ë¡£ texinfo ¤Ï @uref{\fIuri\fP} ¤È¤¤¤¦½ñ¼°¤òÍѤ¤¤ë¡£ +man ¤È mdoc ¤Ï¡¢ºÇ¶áÄɲ䵤줿 UR ¥Þ¥¯¥í¤ò»È¤¦¡£ +¤¢¤ë¤¤¤Ï URI ¤ò¤½¤Î¤Þ¤Þ¥Æ¥­¥¹¥È¤ËËä¤á¤³¤à +(¥Ó¥å¡¼¥¢¤¬ :// ¤ò URI ¤Î°ìÉô¤È²ò¼á¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£ +.PP +¥Ç¥¹¥¯¥È¥Ã¥×´Ä¶­¤Ç¤¢¤ë GNOME ¤È KDE ¤Ï¡¢ +¤½¤ì¤¾¤ì¼õÉÕ¤±¤ë URI ¤¬ (Æäˤ½¤ì¤¾¤ì¤Î¥Ø¥ë¥×¥Ö¥é¥¦¥¶¤Ë¤ª¤¤¤Æ) +°Û¤Ê¤Ã¤Æ¤¤¤ë¡£ +man ¥Ú¡¼¥¸¤ò¥ê¥¹¥È¤¹¤ë¤Ë¤Ï¡¢ +GNOME ¤Ç¤Ï ¤òÍѤ¤¡¢ KDE ¤Ç¤Ï ¤òÍѤ¤¤ë¡£ +¤Þ¤¿ info ¥Ú¡¼¥¸¤ò¥ê¥¹¥È¤¹¤ë¤Ë¤Ï¡¢ +GNOME ¤Ç¤Ï ¤òÍѤ¤¡¢ KDE ¤Ç¤Ï ¤òÍѤ¤¤ë +(ËÜ man ¥Ú¡¼¥¸¤ÎÃø¼Ô¤Ï KDE ¤Î¥¢¥×¥í¡¼¥Á¤Î¤Û¤¦¤¬¹¥¤ß¤Ç¤¢¤ë¡£ +¤·¤«¤·¤è¤êɸ½àŪ¤Ê½ñ¼°¤ÎÊý¤¬¹¹¤ËÎɤ¤¤¬)¡£ +°ìÈÌ¤Ë KDE ¤ÏÀ¸À®¥Õ¥¡¥¤¥ë (generated file) ¤Î¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤È¤·¤Æ + ¤òÍѤ¤¤ë¡£ +.\"nakano: °ÕÌ£¥ï¥«¥é¥ó... KDE ¤Ë¾Ü¤·¤¤¿Í¡Á +KDE ¤Ï HTML ¤Îʸ½ñ¤ò + ·Ðͳ¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤Î¤¬¹¥¤ß¤Ê¤è¤¦¤Ç¤¢¤ë¡£ +GNOME ¤Ïʸ½ñ¤ÎÊÝ´É¡¦¸¡º÷¤Ë ghelp ¥¹¥­¡¼¥à¤òÍѤ¤¤ëÊýË¡¤ò¼è¤Ã¤Æ¤¤¤ë¤è¤¦¤À¡£ +¤É¤Á¤é¤Î¥Ö¥é¥¦¥¶¤â¡¢¸½»þÅÀ¤Ç¤Ï file: ¤Ë¤è¤ë¥Ç¥£¥ì¥¯¥È¥ê»²¾È¤ò°·¤¨¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¥Ç¥£¥ì¥¯¥È¥êÁ´ÂΤò¥Ö¥é¥¦¥º²Äǽ¤Ê URI ¤Ç»²¾È¤¹¤ë¤³¤È¤¬Æñ¤·¤¤¡£ +Àè¤Ë½Ò¤Ù¤¿¤è¤¦¤Ë¡¢¤³¤ì¤éÆó¤Ä¤Î´Ä¶­¤Ç¤Ï info: ¥¹¥­¡¼¥à¤Î +°·¤¤¤¬°Û¤Ê¤Ã¤Æ¤¤¤ë (¤ª¤½¤é¤¯ºÇ¤â½ÅÍפʺ¹°Û¤Ç¤¢¤í¤¦)¡£ +GNOME ¤È KDE ¤¬¶¦ÄÌ URI ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¼ýṲ́¹¤ë¤³¤È¤¬Ë¾¤Þ¤·¤¤¡£ +¤³¤Î man ¥Ú¡¼¥¸¤¬¡¢¾­Íè¤Ï¤½¤Î¼ýṲ́·¤¿·ë²Ì¤òµ­½Ò¤Ç¤­¤ë¤³¤È¤ò˾¤à¡£ +¤³¤Îºî¶È¤Ø¤Î½õÎϤò´­µ¯¤·¤¿¤¤¡£ +.SS ¥»¥­¥å¥ê¥Æ¥£ +.PP +URI ¤½¤Î¤â¤Î¤Ï¥»¥­¥å¥ê¥Æ¥£¤Î¶¼°Ò¤ò°ú¤­µ¯¤³¤¹¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ +¤¢¤ë»þÅÀ¤Ç¤Ï¥ê¥½¡¼¥¹¤Î¾ì½ê¤òÍ¿¤¨¤Æ¤¤¤¿ URL ¤¬¡¢ +¤º¤Ã¤È¤½¤¦¤Ç¤¢¤ê¤Ä¤Å¤±¤ë¤È¤¤¤¦ÊݾڤϰìÈ̤ˤϤʤ¤¡£ +¤Þ¤¿¤¢¤ë URL ¤¬¡¢¾­Íè¤Ë¤ÏÊ̤Υ꥽¡¼¥¹¤ò¼¨¤µ¤Ê¤¤¤È¤â¸Â¤é¤Ê¤¤¡£ +¤³¤Î¤è¤¦¤ÊÊݾڤϡ¢¤½¤Î̾Á°¶õ´Ö¤È¥ê¥½¡¼¥¹¤È¤ò´ÉÍý¤·¤Æ¤¤¤ë¸Ä¿Í¤Ë +µ¢¤¹¤ë¤â¤Î¤Ë²á¤®¤Ê¤¤¡£ +.PP +̵³²¤Ë¸«¤¨¤ëÁàºî (¥ê¥½¡¼¥¹¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥¨¥ó¥Æ¥£¥Æ¥£¤Î¼èÆÀ¤Ê¤É) +¤Ë¤è¤Ã¤Æ¡¢¼ÂºÝ¤Ë¤Ï¥ê¥â¡¼¥È¤Ë¥À¥á¡¼¥¸¤òÍ¿¤¨¤ëÆ°ºî¤ò°ú¤­µ¯¤³¤¹¤è¤¦¤Ê +URL ¤òµ­½Ò¤¹¤ë¤³¤È¤â¾ì¹ç¤Ë¤è¤Ã¤Æ¤Ï²Äǽ¤Ç¤¢¤ë¡£ +´í¸±¤Ê URL ¤Îŵ·¿Åª¤Ê¤â¤Î¤Ï¡¢¤½¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥×¥í¥È¥³¥ë¤Ë +ͽÌ󤵤ì¤Æ¤¤¤ë¥Ý¡¼¥ÈÈÖ¹æ¤È¤Ï°Û¤Ê¤ë¥Ý¡¼¥È¤ò»ØÄꤷ¤Æ¤¤¤ë¤â¤Î¤Ç¤¢¤ë¡£ +URL ¤ÎÆâÍƤˤÏÌ¿Î᤬´Þ¤Þ¤ì¤Æ¤¤¤Æ¡¢ +¤½¤Î¥×¥í¥È¥³¥ë¤Ë¤·¤¿¤¬¤Ã¤Æ²ò¼á¤µ¤ì¤¿¤È¤­¡¢ +ͽ´ü¤µ¤ì¤Ê¤¤Æ°ºî¤ò°úµ¯¤³¤¹¤Î¤Ç¤¢¤ë¡£ +Îã¤ò¤¢¤²¤ë¤È¡¢ gopher ¤Î URL ¤Ë¤è¤Ã¤Æ¡¢°Õ¿Þ¤·¤Ê¤¤¥á¥Ã¥»¡¼¥¸¤ä +¤Ê¤ê¤¹¤Þ¤·¥á¥Ã¥»¡¼¥¸¤Ê¤É¤¬ SMTP ¥µ¡¼¥Ð·Ðͳ¤ÇÁ÷¿®¤µ¤ì¤ë¤è¤¦¤Ê¤³¤È¤¬¤¢¤Ã¤¿¡£ +.PP +¤½¤Î¥×¥í¥È¥³¥ë¤Î¥Ç¥Õ¥©¥ë¥È°Ê³°¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤷ¤Æ¤¤¤ë +URL ¤òÍѤ¤¤ë¤È¤­¤Ë¤ÏÃí°Õ¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +Æäˤ½¤ÎÈֹ椬ͽÌó¶õ´Ö¤ÎÆâÉô¤Ë¤¢¤ë¾ì¹ç¤Ë¤Ï¡£ +.PP +URI ¤Ë¡¢¤½¤Î¥×¥í¥È¥³¥ë¤ËÂФ¹¤ë¥Ç¥ê¥ß¥¿¤¬¥¨¥¹¥±¡¼¥×¤µ¤ì¤¿¤«¤¿¤Á¤ÇÆþ¤Ã¤Æ¤¤¤ë +¾ì¹ç¤âÃí°Õ¤¬É¬ÍפǤ¢¤ë +(Î㤨¤Ð telnet ¥×¥í¥È¥³¥ë¤ËÂФ¹¤ë CR ʸ»ú¤ä LF ʸ»ú¤Ê¤É)¡£ +¤Ê¤¼¤Ê¤é¤³¤ì¤é¤ÏžÁ÷Á°¤Ë¥¨¥¹¥±¡¼¥×¤¬³°¤µ¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +¤³¤ì¤Ï¥×¥í¥È¥³¥ë¤ËÈ¿¤·¤Æ¤ª¤ê¡¢Í½´ü¤·¤Ê¤¤¡¢¤ª¤½¤é¤¯¤Ï³²¤Ë¤Ê¤ë¤è¤¦¤Ê +¥ê¥â¡¼¥ÈÆ°ºî¤ò°úµ¯¤³¤¹·ë²Ì¤È¤Ê¤ê¤«¤Í¤Ê¤¤¡£ +.PP +ÈëÌ©¤Ë¤·¤Æ¤ª¤¯¤Ù¤­¥Ñ¥¹¥ï¡¼¥É¤ò´Þ¤ó¤À URI ¤ò»È¤¦¤Î¤¬ +¸­¤¯¤Ê¤¤¤Î¤ÏÌÀ¤é¤«¤Ç¤¢¤ë¡£Æäˡ¢¥Ñ¥¹¥ï¡¼¥É¤ò URI ¤Î +"userinfo" ¤ÎÉôʬ¤Ë»È¤¦¤Î¤ÏÀäÂФËÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +¤¿¤À¤·¤½¤Î "password" ¤Î¥Ñ¥é¥á¡¼¥¿¤ò°Õ¿ÞŪ¤Ë¸ø³«¤·¤¿¤¤¾ì¹ç¤ÏÊ̤Ǥ¢¤ë¤¬¡£ +.SH ¥Ð¥° +.PP +ʸ½ñ¤ÏÍÍ¡¹¤Ê¾ì½ê¤ËÃÖ¤«¤ì¤¦¤ë¡£¤·¤¿¤¬¤Ã¤Æ¸½»þÅÀ¤Ç¤Ï¡¢ +Ǥ°Õ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç½ñ¤«¤ì¤¿°ìÈ̤Υª¥ó¥é¥¤¥óʸ½ñ¤ËÂФ¹¤ëÎɤ¤ URI ¥¹¥­¡¼¥à¤¬ +¸ºß¤·¤Ê¤¤¡£ + ·Á¼°¤Î»²¾È¤Ï»È¤¨¤Ê¤¤¡£¤Ê¤¼¤Ê¤é +¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤ä¥í¡¼¥«¥ë¤Ø¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ÎºÝ¤Î¾ò·ï¤Ë¤è¤Ã¤Æ¡¢ +¥Õ¥¡¥¤¥ë¤Ï°Û¤Ê¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤ë¤³¤È¤¬¤¢¤ë¤«¤é¤Ç¤¢¤ë +(/usr/doc ¤« /usr/local/doc ¤« /usr/share ¤«¤½¤Î¾¤Î¾ì½ê¤«¡¢¤Ê¤É¤Ê¤É)¡£ +¤Þ¤¿¡¢¥Ç¥£¥ì¥¯¥È¥ê ZZZ ¤ÏÄ̾ï¥Ð¡¼¥¸¥ç¥ó¤¬ÊѤï¤ë¤È°Û¤Ê¤Ã¤¿¤â¤Î¤Ë¤Ê¤ë +(¥Õ¥¡¥¤¥ë̾¤Î¥°¥í¥Ö¤Ë¤è¤Ã¤Æ¤¢¤ëÄøÅÙ¹îÉþ¤Ç¤­¤ë¤À¤í¤¦¤¬)¡£ +ºÇ¸å¤Ë¤â¤¦°ì¤Ä¡¢Ê¸½ñ¤ò¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤«¤é (¥í¡¼¥«¥ë¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë +¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯) ưŪ¤Ë¥í¡¼¥É¤¹¤ë¿Í¡¹¤Ï¡¢ +¤Ê¤«¤Ê¤« file: ¥¹¥­¡¼¥à¤ò»È¤Ã¤Æ¤¯¤ì¤Ê¤¤¡£ +¾­Íè¤Ë¤Ï¿·¤¿¤Ê URI ¥¹¥­¡¼¥à (Î㤨¤Ð "userdoc:" ¤Î¤è¤¦¤Ê) ¤¬Äɲ䵤졢 +¤è¤ê¾Ü¤·¤¤Ê¸½ñ¤Ø¤Î¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹¤¬¡¢ +¤½¤Îʸ½ñ¤ÎÀµ³Î¤Ê¾ì½ê¤ò¥×¥í¥°¥é¥à¤¬ÃΤé¤Ê¤¯¤Æ¤â²Äǽ¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤¢¤ë¤¤¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àµ¬³Ê¤Î¾­Íè¤ÎÈÇ¤Ç +¥Õ¥¡¥¤¥ë¤Î¾ì½ê¤Î»ØÄê¤ò¤è¤ê¸·Ì©¤Ë¤·¤Æ¡¢ +file: ¥¹¥­¡¼¥à¤Ë¤è¤ëʸ½ñ¤Î°ÌÃÖ»ØÄ꤬²Äǽ¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +¥×¥í¥°¥é¥à¤ä¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¿¤¯¤Ç¤Ï¡¢ +URI ¤ò»È¤Ã¤¿¥ê¥ó¥¯¤ò¼è¤ê¹þ¤ó¤À¤ê¼ÂÁõ¤·¤¿¤ê¤¹¤ëÊýË¡¤¬¤Ê¤¤¡£ +.PP +¥×¥í¥°¥é¥à¤Î¿¤¯¤Ï¡¢¤³¤ì¤é¤Î URI ¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¤¹¤Ù¤Æ¤Ï°·¤¨¤Ê¤¤¡£ +¥æ¡¼¥¶¤Î´Ä¶­ (¥Æ¥­¥¹¥È¤«¥°¥é¥Õ¥£¥Ã¥¯¤«¡¢ +¥Ç¥¹¥¯¥È¥Ã¥×´Ä¶­¡¢¥í¡¼¥«¥ë¥æ¡¼¥¶¤Î¹¥¤ß¡¢ +¸½ºß¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¥Ä¡¼¥ë) ¤Ê¤É¤ò¼«Æ°Åª¤Ë¸¡ÃΤ·¤Æ¡¢ +Ǥ°Õ¤Î URI ¤ò¥í¡¼¥É¤·¡¢¤½¤Î URI ¤ËŬ¤·¤¿¥Ä¡¼¥ë¤òµ¯Æ°¤¹¤ë¤è¤¦¤Ê +ɸ½àŪ¤Ê»ÅÁȤߤ¬¤¢¤ë¤È¤¤¤¤¤Î¤À¤í¤¦¤¬¡£ +.\" .SH Ãø¼Ô +.\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï David A. Wheeler (dwheeler@ida.dwheeler.com) ¤¬½ñ¤¤¤¿¡£ +.SH ´ØÏ¢¹àÌÜ +.BR lynx (1), +.BR man2html (1), +.BR mailaddr (7), +.BR utf-8 (7), +.UR http://www.ietf.org/rfc/rfc2255.txt +IETF RFC\ 2255 +.UE diff --git a/release/man7/utf-8.7 b/release/man7/utf-8.7 new file mode 100644 index 00000000..77f60910 --- /dev/null +++ b/release/man7/utf-8.7 @@ -0,0 +1,297 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) Markus Kuhn, 1996, 2001 +.\" +.\" 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. +.\" +.\" 1995-11-26 Markus Kuhn +.\" First version written +.\" 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" +.SH ̾Á° +UTF-8 \- ASCII ¤È¸ß´¹À­¤Î¤¢¤ë¿¥Ð¥¤¥È Unicode ¤ÎÉä¹æ²½ +.SH ÀâÌÀ +.B "¥æ¥Ë¥³¡¼¥É (Unicode) 3.0" +ʸ»ú½¸¹ç¤Ï 16 ¥Ó¥Ã¥È¤Î¥³¡¼¥É¶õ´Ö¤òÀê¤á¤ë¡£ +ºÇ¤âñ½ã¤Ê Unicode ¤ÎÉä¹æ²½ÊýË¡ +.RB ( UCS-2 ) +¤Ç¤Ï¡¢Ê¸»ú¤Ï 16 ¥Ó¥Ã¥È¡¦¥ï¡¼¥É (16 ¥Ó¥Ã¥Èʸ»ú¤ÎÎó) ¤Ç¹½À®¤µ¤ì¤ë¡£ +¤³¤ÎÎó¤Ë¤Ï¡¢ +\(aq\\0\(aq ¤ä \(aq/\(aq ¤Î¤è¤¦¤Ê (¥Õ¥¡¥¤¥ë̾¤ä C ¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î°ú¤­¿ô¤ÎÆâÉô¤Ç) +Æüì¤Ê°ÕÌ£¤ò»ý¤Ä 16 ¥Ó¥Ã¥Èʸ»ú¤¬´Þ¤Þ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ +¤µ¤é¤Ë¡¢¤Û¤È¤ó¤É¤Î Unix ¥Ä¡¼¥ë¤Ï ASCII ¥Õ¥¡¥¤¥ë¤òÆþÎϤȤ·¤Æ´üÂÔ¤¹¤ë¤Î¤Ç¡¢ +ÂçÉý¤ÊÊѹ¹¤Ê¤·¤Ë¤Ï 16 ¥Ó¥Ã¥È¥ï¡¼¥É¤òʸ»ú¤È¤·¤ÆÆɤळ¤È¤¬¤Ç¤­¤Ê¤¤¡£ +¤³¤ì¤é¤ÎÍýͳ¤«¤é¡¢ +.B UCS-2 +¤Ï¥Õ¥¡¥¤¥ë̾¡¦¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¡¦´Ä¶­ÊÑ¿ô¤Ê¤É¤ËÍѤ¤¤ë¡¢³°ÉôÍѤΠ+.B Unicode +Éä¹æ¤È¤·¤Æ¤ÏÉÔŬÀڤǤ¢¤ë¡£ +Unicode ¤Î¥¹¡¼¥Ñ¡¼¥»¥Ã¥È¤Ç¤¢¤ë +.B "ISO 10646 Universal Character Set (UCS)" +¤Ï 31 ¥Ó¥Ã¥È¤Î¥³¡¼¥É¶õ´Ö¤òÀê¤á¤ë¤¬¡¢¤½¤ÎºÇ¤âñ½ã¤ÊÉä¹æ²½¤Ç¤¢¤ë +.B UCS-4 +¤Ë¤â (32 ¥Ó¥Ã¥È¡¦¥ï¡¼¥É¤ÎÎó¤È¤·¤Æ) Ʊ¤¸ÌäÂ꤬¤¢¤ë¡£ +.PP +.B Unicode +¤È +.B UCS +¤Î +.B UTF-8 +Éä¹æ²½¤Ë¤Ï¤³¤ì¤é¤ÎÌäÂ꤬¤Ê¤¤¤Î¤Ç¡¢Unix ·Á¼°¤Î OS ¾å¤Ç +.B Unicode +ʸ»ú½¸¹ç¤ò»ÈÍѤ¹¤ë¤¿¤á¤Î°ìÈÌŪ¤ÊÊýË¡¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ +.SS À­¼Á +.B UTF-8 +Éä¹æ²½¤Ï°Ê²¼¤Î¤è¤¦¤ÊÁÇÀ²¤·¤¤À­¼Á¤òÈ÷¤¨¤Æ¤¤¤ë: +.TP 0.2i +* +.B UCS +ʸ»ú¤Î¤¦¤Á 0x00000000 ¤«¤é 0x0000007f ¤Þ¤Ç (¸ÅŵŪ¤Ê +.B US-ASCII +¤Îʸ»ú) ¤Ï (ASCII ¤È¤Î¸ß´¹À­¤Î¤¿¤á¤Ë) ñ½ã¤Ë 0x00 ¤«¤é 0x7f ¤Î¥Ð¥¤¥È¤Ë +Éä¹æ²½¤¹¤ë¡£¤³¤ì¤Ï 7 ¥Ó¥Ã¥È ASCII ʸ»ú¤Î¤ß¤ò´Þ¤à¥Õ¥¡¥¤¥ë¤äʸ»úÎó¤Ë +´Ø¤·¤Æ¤Ï¡¢ +.B ASCII +¤È +.B UTF-8 +¤ÇƱ¤¸Éä¹æ²½¤ò¹Ô¤Ê¤¦¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ +.TP +* +0x7f ¤è¤êÂ礭¤¤¤Î¤¹¤Ù¤Æ¤Î +.B UCS +ʸ»ú¤Ï¡¢ 0x80 ¤«¤é 0xfd ¤Þ¤Ç¤ÎÈϰϤΥХ¤¥È¤Î¤ß¤ò´Þ¤à +¿¥Ð¥¤¥Èʸ»úÎó¤ËÉä¹æ²½¤µ¤ì¤ë¡£ +¤·¤¿¤¬¤Ã¤Æʸ»úÎó¤Ë +ASCII ¥Ð¥¤¥È¤¬´Þ¤Þ¤ì¤ë¤³¤È¤¬¤Ê¤¯¡¢\(aq\\0\(aq ¤ä \(aq/\(aq ¤ÎÌäÂê¤ÏȯÀ¸¤·¤Ê¤¤¡£ +.TP +* +.B UCS-4 +ʸ»úÎó¤Ç¤Ï¼­½ñŪ¥½¡¼¥È¤Î½ç½ø¤¬Êݤ¿¤ì¤ë¡£ +.TP +* +2^31 ¥Ó¥Ã¥È¤Î¤¹¤Ù¤Æ¤Î UCS ¥³¡¼¥É ¤¬ +.B UTF-8 +¤ò»ÈÍѤ·¤ÆÉä¹æ²½¤Ç¤­¤ë¡£ +.TP +* +.B UTF-8 +Éä¹æ²½¤Ç¤Ï 0xfe ¤È 0xff ¤Î¥Ð¥¤¥È¤ÏÀäÂФ˻ÈÍѤ·¤Ê¤¤¡£ +.TP +* +ASCII ¤Ç¤Ê¤¤ +.B UCS +ʸ»ú¤Î¿¥Ð¥¤¥ÈÎó¤ÎºÇ½é¤Î¥Ð¥¤¥È¤Ï¡¢ +¾ï¤Ë 0xc0 ¤«¤é 0xfd ¤ÎÈϰϤÇɽ¸½¤µ¤ì¡¢ +¤½¤Îʸ»ú¤¬²¿¥Ð¥¤¥È¤Ç¹½À®¤µ¤ì¤Æ¤¤¤ë¤«¤ò¼¨¤¹¡£ +¿¥Ð¥¤¥ÈÎó¤Î»Ä¤ê¤ÎÉôʬ¤Î¥Ð¥¤¥È¤Ï¡¢¤½¤ì¤¾¤ì 0x80 ¤«¤é 0xbf ¤ÎÈϰϤˤ¢¤ë¡£ +¤³¤ì¤Ë¤è¤êƱ´ü¤¬Íưפˤʤꡢ¥¹¥Æ¡¼¥È¥ì¥¹¤ÊÉä¹æ²½¤¬²Äǽ¤Ë¤Ê¤ê¡¢ +¥Ð¥¤¥È¤Îʶ¼º¤ËÂФ·¤Æ·ø¸Ç¤Ë¤Ê¤ë¡£ +.TP +* +.B UTF-8 +¤ò»ÈÍѤ·¤¿ +.B UCS +ʸ»ú¤ÎÉä¹æ²½¤ÏºÇÂç 6 ¥Ð¥¤¥È¤ÎŤµ¤Ë¤Ê¤ë¡£ +¤·¤«¤·¡¢ +.B Unicode +µ¬³Ê¤Ç¤Ï 0x10ffff ¤è¤êÀè¤Îʸ»ú¤ò»ØÄꤷ¤Ê¤¤¤Î¤Ç¡¢Unicode ʸ»ú¤Ï +.B UTF-8 +¤Ç¤Ï 4 ¥Ð¥¤¥È¤Þ¤Ç¤Ë¤·¤«¤Ê¤é¤Ê¤¤¡£ +.SS Éä¹æ²½ +°Ê²¼¤Î¥Ð¥¤¥ÈÎó¤¬Ê¸»ú¤Îɽ¸½¤Ë»ÈÍѤµ¤ì¤ë¡£ +¤É¤Î¥Ð¥¤¥ÈÎó¤ò»ÈÍѤ¹¤ë¤«¤Ïʸ»ú¤Î UCS ¥³¡¼¥ÉÈÖ¹æ¤Ë°Í¸¤¹¤ë: +.TP 0.4i +0x00000000 \- 0x0000007F: +.RI 0 xxxxxxx +.TP +0x00000080 \- 0x000007FF: +.RI 110 xxxxx +.RI 10 xxxxxx +.TP +0x00000800 \- 0x0000FFFF: +.RI 1110 xxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.TP +0x00010000 \- 0x001FFFFF: +.RI 11110 xxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.TP +0x00200000 \- 0x03FFFFFF: +.RI 111110 xx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.TP +0x04000000 \- 0x7FFFFFFF: +.RI 1111110 x +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.RI 10 xxxxxx +.PP +.I xxx +¥Ó¥Ã¥È¤ÎÉôʬ¤Ë¤Ï 2 ¿Ê¿ô¤Çɽ¤ï¤·¤¿Ê¸»ú¥³¡¼¥É¤Î¥Ó¥Ã¥ÈÉôʬ¤¬Âбþ¤¹¤ë¡£ +¤½¤Îʸ»ú¤òɽ¸½¤¹¤ë¤Î¤ËºÇ¤âû¤¤¥Ð¥¤¥ÈÎó¤Î¤ß¤¬»ÈÍѤǤ­¤ë¡£ +.PP +0xd800\(en0xdfff (UTF-16 ¥µ¥í¥²¡¼¥È) ¤ä +0xfffe, 0xffff (UCS ¤Î noncharacter) ¤È¤¤¤¦ +.B UCS +¥³¡¼¥É¤ÎÃͤϡ¢ +.B UTF-8 +¤Ë½àµò¤·¤¿¥¹¥È¥ê¡¼¥à¤ËÆþ¤ì¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.SS Îã +.B Unicode +ʸ»ú¤Î 0xa9 = 1010 1001 (¥³¥Ô¡¼¥é¥¤¥È¡¦¥Þ¡¼¥¯) ¤Ï UTF-8 ¤ÇÉä¹æ²½¤¹¤ë¤È +.sp +.RS +11000010 10101001 = 0xc2 0xa9 +.RE +.sp +¤Ë¤Ê¤ë¡£ +.PP +0x2260 = 0010 0010 0110 0000 (ÉÔÅù¹æ) ¤Ï +.sp +.RS +11100010 10001001 10100000 = 0xe2 0x89 0xa0 +.RE +.sp +¤Ë¤Ê¤ë¡£ +.SS ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤ª¤±¤ëÃí°Õ +¥æ¡¼¥¶¡¼¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î +.B UTF-8 +¥µ¥Ý¡¼¥È¤òÍ­¸ú¤Ë¤¹¤ë¤¿¤á¤Ë¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ +.B UTF-8 +¥í¥±¡¼¥ë¤òÁªÂò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.PP +.RS +export LANG=en_GB.UTF-8 +.RE +.PP +»ÈÍѤµ¤ì¤Æ¤¤¤ëʸ»úÉä¹æ²½¤òʬ¤«¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥½¥Õ¥È¥¦¥§¥¢¤Ï¡¢ +°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¾ï¤Ë¥í¥±¡¼¥ë¤òÀßÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +.RS +setlocale(LC_CTYPE, "") +.RE +.PP +¤Þ¤¿ +.B UTF-8 +¥í¥±¡¼¥ë¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Æ¡¢¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È¤Îɸ½àÆþ½ÐÎÏ¡¦Ã¼Ëö´ÖÄÌ¿®¡¦ +¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¡¦¥Õ¥¡¥¤¥ë̾¡¦´Ä¶­ÊÑ¿ô¤¬ +.B UTF-8 +¤ÇÉä¹æ²½¤µ¤ì¤Æ¤¤¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤¿¤á¤Ë¡¢ +¥×¥í¥°¥é¥Þ¡¼¤Ï°Ê²¼¤Î¤è¤¦¤Ê¼°¤ò»î¤¹¤³¤È¤¬¤Ç¤­¤ë¡£ +.PP +.RS +strcmp(nl_langinfo(CODESET), "UTF-8") == 0 +.RE +.PP +.B US-ASCII +¤ä +.B ISO 8859 +¤È¤¤¤Ã¤¿¥·¥ó¥°¥ë¥Ð¥¤¥È¤ÎÉä¹æ²½¤¬½¬´·¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥×¥í¥°¥é¥Þ¡¼¤Ï¡¢ +¤³¤ì¤Þ¤Ç¤Î 2 ¤Ä¤Î²¾Ä꤬ +.B UTF-8 +¥í¥±¡¼¥ë¤Ë¤ª¤¤¤Æ¤ÏºÇÁáÍ­¸ú¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¤³¤È¤òÃΤäƤª¤¯¤Ù¤­¤À¡£ +1 ÈÖÌܤÎÊѹ¹ÅÀ¤Ï¡¢1 ¥Ð¥¤¥È¤¬É¬¤º¤·¤â 1 ¤Ä¤Îʸ»ú¤ËÂбþ¤·¤Ê¤¤¤È¤¤¤¦ÅÀ¤Ç¤¢¤ë¡£ +2 ÈÖÌܤÎÊѹ¹ÅÀ¤Ï¡¢ºÇ¶á¤ÎüËö¥¨¥ß¥å¥ì¡¼¥¿¤Ï +.B UTF-8 +¥â¡¼¥É¤Ë¤ª¤¤¤ÆÃæ¹ñ¸ì¡¦ÆüËܸ졦´Ú¹ñÄ«Á¯¸ì¤Î +.B Á´³Ñʸ»ú +¤ä¥¹¥Ú¡¼¥¹¤¬Æþ¤é¤Ê¤¤ (nonspacing) +.B "¹çÀ®Ê¸»ú (combining characters)" +¤ËÂбþ¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ +.B ASCII +¤Î¤È¤­¤Î¤è¤¦¤Ë 1 ʸ»ú½ÐÎϤ·¤¿¸å¤Ç +¥«¡¼¥½¥ë¤òɬ¤º¤·¤â 1 ¤Ä¤À¤±¿Ê¤á¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤È¤¤¤¦ÅÀ¤Ç¤¢¤ë¡£ +º£Æü¤Ç¤Ï¡¢Ê¸»ú¤ä¥«¡¼¥½¥ë¤Î°ÌÃÖ¤ò¿ô¤¨¤ë¤Î¤Ë +.BR mbsrtowcs (3) +¤ä +.BR wcswidth (3) +¤È¤¤¤Ã¤¿¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£ +.PP +(VT100 üËö¤Ê¤É¤Ç»È¤ï¤ì¤ë) +.B ISO 2022 +Éä¹æ²½·Á¼°¤«¤é +.B UTF-8 +¤ØÀÚÂؤ¨¤ë¸ø¼°¤Ê¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤Ï ESC % G ("\\x1b%G") ¤Ç¤¢¤ë¡£ +¤³¤ì¤ËÂбþ¤¹¤ë +.B UTF-8 +¤«¤é +.B ISO 2022 +¤Ø¤Î¥ê¥¿¡¼¥ó¥·¡¼¥±¥ó¥¹¤Ï ESC % @ ("\\x1b%@") ¤Ç¤¢¤ë¡£ +(G0 ¥»¥Ã¥È¤È G1 ¥»¥Ã¥È¤òÀÚÂؤ¨¤ë¤È¤¤¤Ã¤¿) +¤½¤Î¾¤Î ISO 2022 ¥·¡¼¥±¥ó¥¹¤Ï¡¢UTF-8 ¥â¡¼¥É¤Ç¤Ï»È¤¨¤Ê¤¤¡£ +.PP +ͽÃΤǤ­¤ë¾­Íè¤Ç¤Ï¡¢POSIX ¥·¥¹¥Æ¥à¾å¤Î°ìÈÌŪ¤Êʸ»úÉä¹æ²½¤ÎÁ´¤Æ¤Î¥ì¥Ù¥ë¤Ç +.B UTF-8 +¤¬ +.B ASCII +¤È +.B ISO 8859 +¤òÃÖ¤­´¹¤¨¡¢¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È¤ò°·¤¦Èó¾ï¤ËÍ¥¤ì¤¿´Ä¶­¤¬ºî¤é¤ì¤ë¤³¤È¤¬´üÂԤǤ­¤ë¡£ +.SS ¥»¥­¥å¥ê¥Æ¥£ +.BR Unicode " ¤È " UCS +¤Îµ¬³Ê¤Ç¤Ï¡¢ +.B UTF-8 +¤ÎÀ¸À®¼Ô¤Ï¤Ç¤­¤ë¤À¤±Ã»¤¤·Á¼°¤òÍѤ¤¤ë¤è¤¦Í׵ᤷ¤Æ¤¤¤ë¡£ +Î㤨¤Ð¡¢ÀèƬ¥Ð¥¤¥È¤¬ 0xc0 ¤Ç¤¢¤ë¤è¤¦¤Ê 2 ¥Ð¥¤¥ÈÎó¤ò +À¸À®¤¹¤ë¤Î¤Ï½àµò¤·¤Æ¤¤¤ë¤È¤Ï¤¤¤¨¤Ê¤¤¡£ +.B Unicode 3.1 +¤Ç¤Ï¡¢µ¬³Ê¤Ë½àµò¤¹¤ë¥×¥í¥°¥é¥à¤Ï +ºÇû¤Îɽ¸½·Á¼°¤Ç¤Ï¤Ê¤¤ÆþÎϤò¼õ¤±ÉÕ¤±¤Ê¤¤¡¢¤È¤¤¤¦Í×µá»ö¹à¤¬Äɲ䵤줿¡£ +¤³¤ì¤Ï¥»¥­¥å¥ê¥Æ¥£¾å¤ÎÍýͳ¤Ë¤è¤ë¡£ +¥æ¡¼¥¶¡¼ÆþÎϤ¬¥»¥­¥å¥ê¥Æ¥£¾å¤Î´í¸±¤ËÂФ·¥Á¥§¥Ã¥¯¤µ¤ì¤ë¾ì¹ç¡¢ +¥×¥í¥°¥é¥à¤Ï +.B ASCII +ÈǤΠ"/../" ¤ä ";" ¤ä "NUL" ¤À¤±¤ò¥Á¥§¥Ã¥¯¤·¡¢ +ºÇû¤ËÉä¹æ²½¤µ¤ì¤Æ¤Ê¤¤¤³¤ì¤é¤Îʸ»ú¤ò¸«²á¤´¤·¤Æ¤·¤Þ¤¦¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£ +¤Ê¤¼¤Ê¤é¡¢ºÇû¤Ç¤Ï¤Ê¤¤ +.B UTF-8 +Éä¹æ²½¤Ç¤Ï¡¢¤³¤ì¤é¤Îʸ»ú¤òɽ¸½¤¹¤ë¤è¤¦¤ÊÍÍ¡¹¤Ê +.B ASCII +°Ê³°¤Î·Á¼°¤¬Â¸ºß¤¹¤ë¤¿¤á¤Ç¤¢¤ë¡£ +.SS ½àµò +ISO/IEC 10646-1:2000, Unicode 3.1, RFC\ 2279, Plan 9. +.\" .SH Ãø¼Ô +.\" Markus Kuhn +.SH ´ØÏ¢¹àÌÜ +.BR nl_langinfo (3), +.BR setlocale (3), +.BR charsets (7), +.BR unicode (7) diff --git a/release/man7/x25.7 b/release/man7/x25.7 new file mode 100644 index 00000000..b0f7a58a --- /dev/null +++ b/release/man7/x25.7 @@ -0,0 +1,119 @@ +.\" This man page is Copyright (C) 1998 Heiner Eisen. +.\" 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. +.\" $Id: x25.7,v 1.4 1999/05/18 10:35:12 freitag Exp $ +.\" +.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. +.\" Translated Mon 6 Dec 1999 by NAKANO Takeo +.\" +.TH X25 7 2008-08-08 "Linux" "Linux Programmer's Manual" +.SH ̾Á° +x25, AF_X25 \- ITU-T X.25 / ISO-8208 ¥×¥í¥È¥³¥ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ +.SH ½ñ¼° +.B #include +.br +.B #include +.sp +.B x25_socket = socket(AF_X25, SOCK_SEQPACKET, 0); +.SH ÀâÌÀ +X25 ¥½¥±¥Ã¥È¤Ï X.25 ¥Ñ¥±¥Ã¥ÈÁØ¥×¥í¥È¥³¥ë¤ËÂФ¹¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£ +¤³¤ì¤Ë¤è¤ê¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥Ñ¥Ö¥ê¥Ã¥¯¤Ê X.25 ¥Ç¡¼¥¿¥Í¥Ã¥È¥ï¡¼¥¯¤Ç +ÄÌ¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£ X.25 ¤Ï +International Telecommunication Union's recommendation X.25 +(X.25 DTE-DCE mode) ¤Çɸ½à²½¤µ¤ì¤Æ¤¤¤ë¡£ +X25 ¥½¥±¥Ã¥È¤Ï¡¢Ãæ´ÖÁؤΤʤ¤ X.25 ¥Í¥Ã¥È¥ï¡¼¥¯ (X.25 DTE-DTE mode) +¤Ç¤ÎÄÌ¿®¤Ë¤âÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +DTE-DTE ¥â¡¼¥É¤Ï ISO-8208 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +¥á¥Ã¥»¡¼¥¸¶­³¦¤ÏÊݸ¤µ¤ì¤ë¡£¥½¥±¥Ã¥È¤«¤é¤Î +.BR read (2) +¤Ï¡¢È¿ÂЦ¤Î¥½¥±¥Ã¥È¤«¤é¤ÎÂбþ¤¹¤ë +.BR write (2) +¤ÈƱ¤¸Â礭¤µ¤Î¥Ç¡¼¥¿¤ò¼õ¤±¼è¤ê¡¢½ÐÎϤ¹¤ë¡£ +ɬÍפ¬¤¢¤ë¾ì¹ç¤Ï¡¢¥«¡¼¥Í¥ë¤¬Ä¹¤¤¥á¥Ã¥»¡¼¥¸¤Î +ʬ³ä (segmenting) ¤ÈºÆ¹½À® (reassembling) ¤ò¹Ô¤¦¡£ +¤³¤ì¤Ë¤Ï X.25 ¤Î M ¥Ó¥Ã¥È¤¬ÍѤ¤¤é¤ì¤ë¡£ +¥á¥Ã¥»¡¼¥¸¥µ¥¤¥º¤Ë¤Ï¡¢¥Ï¡¼¥É¥³¡¼¥Ç¥£¥ó¥°¤µ¤ì¤¿¾å¸Â¤Ï¤Ê¤¤¡£ +¤·¤«¤·¡¢°ì»þŪ¤Ë¥·¥¹¥Æ¥à¥ê¥½¡¼¥¹¤¬Â­¤ê¤Ê¤«¤Ã¤¿¤ê¡¢ +¾¤ÎÀ©Ìó (¥½¥±¥Ã¥È¥á¥â¥ê¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥ºÀ©¸Â¤Ê¤É) ¤¬ +¸ú¤¤¤Æ¤·¤Þ¤¦¤È¡¢Ä¹¤¤¥á¥Ã¥»¡¼¥¸¤ÎºÆ¹½À®¤Ë¤Ï¼ºÇÔ¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +¤³¤Î¾ì¹ç¡¢¤½¤Î X.25 Àܳ¤Ï¥ê¥»¥Ã¥È¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£ +.SS ¥½¥±¥Ã¥È¥¢¥É¥ì¥¹ +.B AF_X25 +¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤òɽ¤¹¤¿¤á¤Ë +.I struct sockaddr_x25 +¤òÍѤ¤¤ë¡£¤³¤ì¤Ï ITU-T recommendation X.121 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ +.PP +.in +4n +.nf +struct sockaddr_x25 { + sa_family_t sx25_family; /* must be AF_X25 */ + x25_address sx25_addr; /* X.121 Address */ +}; +.fi +.in +.PP +.I sx25_addr +¤Ë¤Ï char ÇÛÎó +.I x25_addr[] +¤ò´Þ¤Þ¤ì¤ë¡£¤³¤ì¤Ï 0 ¤Ç½ªÃ¼¤¹¤ëʸ»úÎó¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£ +.I sx25_addr.x25_addr[] +¤Ï 15 ¸Ä¤Þ¤Ç¤Î ASCII ʸ»ú¤ò´Þ¤à¤³¤È¤¬¤Ç¤­ (½ªÃ¼¤Î 0 ¤Ï´Þ¤Þ¤Ê¤¤)¡¢ +¤³¤ì¤¬ X.121 ¥¢¥É¥ì¥¹¤ò¤Ê¤¹¡£ +10 ¿Ê¤Î¿ôʸ»ú¡¢\(aq0\(aq ¤«¤é \(aq9\(aq ¤Þ¤Ç¤À¤±¤¬µö¤µ¤ì¤ë¡£ +.SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó +°Ê²¼¤Î X.25 ÆÃÍ­¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Ï¡¢ +.BR setsockopt (2) +¤ÇÀßÄê¤Ç¤­¡¢ +.BR getsockopt (2) +¤Ç¼èÆÀ¤Ç¤­¤ë¡£¤³¤Î¤È¤­ +.I level +°ú¤­¿ô¤Ë¤Ï +.B SOL_X25 +¤ò»ØÄꤹ¤ë¡£ +.TP +.B X25_QBITINCL +X.25 ¤Î Q ¥Ó¥Ã¥È (Qualified ¥Ç¡¼¥¿¥Ó¥Ã¥È) ¤Ë¥æ¡¼¥¶¡¼¤¬¥¢¥¯¥»¥¹ +¤Ç¤­¤ë¤«¤É¤¦¤«¤ò¥³¥ó¥È¥í¡¼¥ë¤¹¤ë¡£À°¿ô¤Î°ú¿ô¤ò¼è¤ë¡£ +0 ¤Ë¥»¥Ã¥È¤¹¤ë¤È¡¢ Q ¥Ó¥Ã¥È¤Ïȯ¿®¥Ñ¥±¥Ã¥È¤Ë¤Ï·è¤·¤Æ¥»¥Ã¥È¤µ¤ì¤º¡¢ +¼õ¿®¥Ñ¥±¥Ã¥È¤Ç¤Ï̵»ë¤µ¤ì¤ë (¥Ç¥Õ¥©¥ë¥È)¡£ +1 ¤Ë¥»¥Ã¥È¤¹¤ë¤È¡¢¥½¥±¥Ã¥È¤«¤éÆɤࡢ¤¢¤ë¤¤¤Ï¥½¥±¥Ã¥È¤ËÁ÷¤ë +¥á¥Ã¥»¡¼¥¸¤½¤ì¤¾¤ì¤ËÀèƬ¥Ð¥¤¥È¤¬Á°ÃÖ¤µ¤ì¤ë¡£ +¥½¥±¥Ã¥È¤«¤éÆɤó¤À¥Ç¡¼¥¿¤Ç¤Ï¡¢ÀèƬ¥Ð¥¤¥È¤¬ 0 ¤À¤È¡¢ +¤³¤ÎÅþÃå¥Ç¡¼¥¿¥Ñ¥±¥Ã¥È¤ËÂбþ¤¹¤ë Q ¥Ó¥Ã¥È¤Ï¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤³¤È¤Ë¤Ê¤ë¡£ +ÀèƬ¥Ð¥¤¥È¤¬ 1 ¤À¤È¡¢ÅþÃå¥Ç¡¼¥¿¥Ñ¥±¥Ã¥È¤Î +Q ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¤³¤È¤Ë¤Ê¤ë¡£ +¥½¥±¥Ã¥È¤Ë½ñ¤­¹þ¤à¥Ç¡¼¥¿¤ÎÀèƬ¥Ð¥¤¥È¤¬ 1 ¤À¤È¡¢ +¤½¤Îȯ¿®¥Ñ¥±¥Ã¥È¤Î Q ¥Ó¥Ã¥È¤ò¥»¥Ã¥È¤¹¤ë¡£ +0 ¤À¤È¡¢ Q ¥Ó¥Ã¥È¤ò¥»¥Ã¥È¤·¤Ê¤¤¡£ +.SH ¥Ð¡¼¥¸¥ç¥ó +AF_X25 ¥×¥í¥È¥³¥ë¥Õ¥¡¥ß¥ê¤Ï Linux 2.2 ¤Î¿·µ¡Ç½¤Ç¤¢¤ë¡£ +.SH ¥Ð¥° +X.25 PLP ¼ÂÁõ¤Ï +.B CONFIG_EXPERIMENTAL +¤Ê¤Î¤Ç¡¢¤¿¤¯¤µ¤ó¤¢¤ë¤À¤í¤¦¡£ +.PP +¤³¤Î man ¥Ú¡¼¥¸¤Ï´°À®¤·¤Æ¤¤¤Ê¤¤¡£ +.PP +¤Þ¤À¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥Þ¡¼ÍѤΥإåÀ¥Õ¥¡¥¤¥ë¤¬¤Ê¤¤¡£ +¥«¡¼¥Í¥ë¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë +.I +¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +.B CONFIG_EXPERIMENTAL +¤Ê¤Î¤Ç¡¢¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤Ï +¥Ð¥¤¥Ê¥ê¸ß´¹À­¤¬¼º¤ï¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.PP +X.25 N-Reset ¥¤¥Ù¥ó¥È¤Ï¡¢¤Þ¤À¥æ¡¼¥¶¡¼¥×¥í¥»¥¹¤ËÅÁÇŤ·¤Ê¤¤¡£ +¤·¤¿¤¬¤Ã¤Æ¥ê¥»¥Ã¥È¤¬µ¯¤³¤ë¤È¡¢¥Ç¡¼¥¿¤ÏÄÌÃÎ̵¤·¤Ë¼º¤ï¤ì¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR socket (2), +.BR socket (7) +.PP +Jonathan Simon Naylor: +\(lqX.25 ¤ÎºÆʬÀϤȺƼÂÁõ\(rq +.RS +URL ¤Ï +.I ftp://ftp.pspt.fi/pub/ham/linux/ax25/x25doc.tgz +.RE diff --git a/release/man8/intro.8 b/release/man8/intro.8 new file mode 100644 index 00000000..05f212be --- /dev/null +++ b/release/man8/intro.8 @@ -0,0 +1,49 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" and Copyright (C) 2007 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 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" +.SH ̾Á° +intro \- ´ÉÍý¥³¥Þ¥ó¥É¤ÈÆø¢¥³¥Þ¥ó¥É¤ÎÀâÌÀ +.SH ÀâÌÀ +¥Þ¥Ë¥å¥¢¥ë¤Î 8 ¾Ï¤Ï¡¢¥·¥¹¥Æ¥à´ÉÍýÍѤΥ³¥Þ¥ó¥É¡¢¥Ç¡¼¥â¥ó (daemon)¡¢ +¥Ï¡¼¥É¥¦¥§¥¢´ØÏ¢¤Î¥³¥Þ¥ó¥É¤È¤¤¤Ã¤¿¡¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ë¤è¤Ã¤Æ¤Î¤ß +»ÈÍѤµ¤ì¤ë/¤Ç¤­¤ë¥³¥Þ¥ó¥É¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤ë¡£ + +1 ¾Ï¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥³¥Þ¥ó¥É¤ÈƱÍÍ¡¢¤³¤Î¾Ï¤ÇÀâÌÀ¤µ¤ì¤ë¥³¥Þ¥ó¥É¤Ï +¥³¥Þ¥ó¥É¤ÎÀ®¸ù¡¦¼ºÇÔ¤ò¼¨¤¹½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ç½ªÎ»¤¹¤ë¡£ +¤µ¤é¤Ê¤ë¾ðÊó¤Ï +.BR intro (1) +¤ò»²¾È¤Î¤³¤È¡£ +.SH È÷¹Í +.SS Ãø¼Ô¤ÈÃøºî¸¢ +Ãø¼Ô¤ÈÃøºî¸¢ (copyright) ¤Ë´Ø¤·¤Æ¤Ï³Æ¥Þ¥Ë¥å¥¢¥ë¡¦¥Ú¡¼¥¸¤Î¥½¡¼¥¹¤Î¥Ø¥Ã¥À¡¼¤ò¸«¤ë¤³¤È¡£ +¤³¤ì¤é¤Ï¥Ú¡¼¥¸¤´¤È¤Ë°Û¤Ã¤Æ¤¤¤ë¡£ diff --git a/release/man8/ld.so.8 b/release/man8/ld.so.8 new file mode 100644 index 00000000..52bef5dd --- /dev/null +++ b/release/man8/ld.so.8 @@ -0,0 +1,401 @@ +.\" 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" +.SH ̾Á° +ld.so, ld-linux.so* \- ưŪ¤Ê¥ê¥ó¥«/¥í¡¼¥À +.SH ½ñ¼° +ưŪ¥ê¥ó¥«¤Ï¡¢Æ°Åª¤Ë¥ê¥ó¥¯¤µ¤ì¤¿¥×¥í¥°¥é¥à¤ä¥é¥¤¥Ö¥é¥ê¤Î¼Â¹Ô¤Ë¤è¤Ã¤Æ +´ÖÀÜŪ¤Ë¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë +(ELF ¤Î¾ì¹ç¡¢Æ°Åª¥ê¥ó¥«¤Ë¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤òÅϤ¹¤³¤È¤Ï¤Ç¤­¤º¡¢ +¥×¥í¥°¥é¥à¤Î +.B .interp +¥»¥¯¥·¥ç¥ó¤ËÆþ¤Ã¤Æ¤¤¤ëưŪ¥ê¥ó¥«¤¬¼Â¹Ô¤µ¤ì¤ë)¡£ +¤Þ¤¿°Ê²¼¤Î¤è¤¦¤ËľÀܼ¹Ԥ¹¤ë¤³¤È¤â¤Ç¤­¤ë +.P +.I /lib/ld-linux.so.* +[OPTIONS] [PROGRAM [ARGUMENTS]] +.SH ÀâÌÀ +¥×¥í¥°¥é¥à +.B ld.so +¤È +.B ld-linux.so* +¤Ï¥×¥í¥°¥é¥à¤ËɬÍפʶ¦Í­¥é¥¤¥Ö¥é¥ê¤ò¸«¤Ä¤±¤Æ¥í¡¼¥É¤·¡¢ +¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤ò½àÈ÷¤·¤Æ¤«¤éµ¯Æ°¤µ¤»¤ë¡£ +.LP +Linux ¤Î¥Ð¥¤¥Ê¥ê¤Ï¡¢¥³¥ó¥Ñ¥¤¥ë¤Î»þ¤Ë +.BR ld (1) +¤ËÂФ·¤Æ +.B \-static +¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¸Â¤ê¡¢Æ°Åª¥ê¥ó¥¯ (¼Â¹Ô»þ¥ê¥ó¥¯) ¤¬É¬ÍפȤʤ롣 +.LP +¥×¥í¥°¥é¥à +.B ld.so +¤Ï a.out ¥Ð¥¤¥Ê¥ê¤ò°·¤¦¡£ +¤³¤ì¤Ï¤º¤Ã¤ÈÀΤ˻Ȥï¤ì¤Æ¤¤¤¿¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤¢¤ë¡£ +.B ld-linux.so* +(libc5 ¤Ç¤Ï \fI/lib/ld-linux.so.1\fP, +glibc2 ¤Ç¤Ï \fI/lib/ld-linux.so.2\fP) +¤Ï ELF ¥Ð¥¤¥Ê¥ê¤ò°·¤¦¡£ +¤³¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¿¤¯¤Î¿Í¤¬ºÇ¶á²¿Ç¯¤â»È¤Ã¤Æ¤¤¤ë¡£ +¤½¤ì°Ê³°¤ÎÅÀ¤Ç¤ÏξÊý¤È¤âƱ¤¸¤è¤¦¤ËÆ°ºî¤·¡¢ +Ʊ¤¸¥µ¥Ý¡¼¥È¥Õ¥¡¥¤¥ë¤È¥×¥í¥°¥é¥à +.BR ldd (1), +.BR ldconfig (8), +.I /etc/ld.so.conf +¤ò»ÈÍѤ¹¤ë¡£ +.LP +¥×¥í¥°¥é¥à¤ÇɬÍפȤµ¤ì¤ë¶¦Í­¥é¥¤¥Ö¥é¥ê¤Ï¡¢ +°Ê²¼¤Î½ç½ø¤Ç¸¡º÷¤µ¤ì¤ë¡£ +.IP o 3 +(ELF ¤Î¤ß) +¥Ð¥¤¥Ê¥ê¤ÎưŪ¥»¥¯¥·¥ç¥ó°À­ DT_RPATH ¤¬Â¸ºß¤·¡¢ +DT_RUNPATH °À­¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢ +DT_RPATH ¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò»ÈÍѤ¹¤ë¡£ +DT_RPATH ¤Î»ÈÍѤϿ侩¤µ¤ì¤Ê¤¤¡£ +.IP o +´Ä¶­ÊÑ¿ô +.B LD_LIBRARY_PATH +¤òÍѤ¤¤ë¡£ +¤¿¤À¤·¼Â¹Ô¥Õ¥¡¥¤¥ë¤¬ set-user-ID/set-group-ID ¥Ð¥¤¥Ê¥ê¤Î¾ì¹ç¡¢ +¤³¤ì¤Ï̵»ë¤µ¤ì¤ë¡£ +.IP o +(ELF ¤Î¤ß) +¥Ð¥¤¥Ê¥ê¤ÎưŪ¥»¥¯¥·¥ç¥ó°À­ DT_RUNPATH ¤¬Â¸ºß¤¹¤ì¤Ð¡¢ +DT_RUNPATH ¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò»ÈÍѤ¹¤ë¡£ +.IP o +¥­¥ã¥Ã¥·¥å¥Õ¥¡¥¤¥ë +.I /etc/ld.so.cache +¤òõ¤¹¡£¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢ +(ld.so.conf ¤ÇÄɲûØÄꤵ¤ì¤¿¤â¤Î¤â´Þ¤á¤¿) ¥é¥¤¥Ö¥é¥ê¸¡º÷¥Ñ¥¹¤«¤é +¸«¤Ä¤«¤Ã¤¿¥é¥¤¥Ö¥é¥ê¥Õ¥¡¥¤¥ë¤Î¾ðÊó¤ò½¸¤á¤¿¤â¤Î¤Ç¤¢¤ë¡£ +¤¿¤À¤·¥Ð¥¤¥Ê¥ê¤¬¥ê¥ó¥«¥ª¥×¥·¥ç¥ó +.B \-z nodeflib +¤Ç¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥é¥¤¥Ö¥é¥ê¥Ñ¥¹¤Ë¤¢¤ë +¥é¥¤¥Ö¥é¥ê¤Ï¥¹¥­¥Ã¥×¤µ¤ì¤ë¡£ +.IP o +¥Ç¥Õ¥©¥ë¥È¥Ñ¥¹¤Ç¤¢¤ë +.IR /lib ¡¢ +¼¡¤¤¤Ç +.I /usr/lib +¤òÍѤ¤¤ë¡£ +¥Ð¥¤¥Ê¥ê¤¬¥ê¥ó¥«¥ª¥×¥·¥ç¥ó +.B \-z nodeflib +¤Ç¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤Î¥¹¥Æ¥Ã¥×¤Ï¥¹¥­¥Ã¥×¤µ¤ì¤ë¡£ +.SS $ORIGIN ¤È rpath +.PP +.B ld.so +¤Ç¤Ï¡¢rpath »ØÄê (DT_RPATH ¤ä DT_RUNPATH) Ãæ¤Ë +.I $ORIGIN +¤È¤¤¤¦Ê¸»úÎó +.RI ( ${ORIGIN} +¤âÅù²Á) ¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£ +.I $ORIGIN +¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¼Â¹Ô¥Õ¥¡¥¤¥ë¤¬Æþ¤Ã¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤òɽ¤¹¡£ +¤³¤ì¤ò»È¤Ã¤Æ +.I somedir/app +¤ËÃÖ¤«¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò +.I gcc -Wl,-rpath,'$ORIGIN/../lib' +¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤È¡¢ +.I somedir +¤¬¥Ç¥£¥ì¥¯¥È¥ê³¬ÁؤΤɤ³¤Ë¤¢¤Ã¤Æ¤â¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï +.I somedir/lib +¤Ë¤¢¤ëÂбþ¤¹¤ë¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +¤³¤Îµ¡Ç½¤ò»È¤¦¤È¡¢ +ÆÃÊ̤ʥǥ£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¯Ç¤°Õ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤â +"¤ä¤ä¤³¤·¤¤ÀßÄê¤Ê¤·¤Ç" +Æȼ«¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò»È¤¨¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.\" 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!! +.SH ¥ª¥×¥·¥ç¥ó +.TP +.B \-\-list +Á´¤Æ¤Î°Í¸´Ø·¸¤È¤½¤Î²ò·èË¡¤ò¥ê¥¹¥È¤¹¤ë¡£ +.TP +.B \-\-verify +¥×¥í¥°¥é¥à¤¬Æ°Åª¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë¤«¤È¡¢ +ưŪ¥ê¥ó¥«¤¬¤½¤Î¥×¥í¥°¥é¥à¤ò°·¤¨¤ë¤«¤ò¸¡¾Ú¤¹¤ë¡£ +.TP +.B \-\-library\-path PATH +.B LD_LIBRARY_PATH +´Ä¶­ÊÑ¿ô¤ÎÀßÄê¤ò¾å½ñ¤­¤¹¤ë (²¼µ­»²¾È)¡£ +.TP +.B \-\-inhibit\-rpath LIST +LIST ¤Ë¤¢¤ë¥ª¥Ö¥¸¥§¥¯¥È̾¤Î RPATH ¤È RUNPATH ¤Î¾ðÊó¤ò̵»ë¤¹¤ë¡£ +.B ld.so +¤¬ set-user-ID ¤« set-group-ID ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ +¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï̵»ë¤µ¤ì¤ë¡£ +.SH ´Ä¶­ÊÑ¿ô +4 ¤Ä¤Î½ÅÍפʴĶ­ÊÑ¿ô¤¬¤¢¤ë¡£ +.TP +.B LD_BIND_NOW +(libc5; glibc 2.1.1 °Ê¹ß) +¶õʸ»úÎó¤Ç¤Ê¤¤¾ì¹ç¡¢ +ưŪ¥ê¥ó¥«¤Ï¥×¥í¥°¥é¥à¤Î³«»Ï»þ¤ËÁ´¤Æ¤Î¥·¥ó¥Ü¥ë¤ò²ò·è¤¹¤ë¡£ +¶õʸ»úÎó¤Î¾ì¹ç¡¢²ò·è¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤´Ø¿ô¸Æ¤Ó½Ð¤·¤¬ +ºÇ½é¤Ë»²¾È¤µ¤ì¤¿»þÅÀ¤Ç²ò·è¤¹¤ë¡£ +¥Ç¥Ð¥Ã¥¬¤ò»È¤Ã¤Æ¤¤¤ë¤È¤­¤ËÌòΩ¤Ä¡£ +.TP +.B LD_LIBRARY_PATH +¥³¥í¥ó¶èÀÚ¤ê¤Î¥Ç¥£¥ì¥¯¥È¥ê¥ê¥¹¥È¡£ +¼Â¹Ô»þ¤Ë ELF ¥é¥¤¥Ö¥é¥ê¤ò¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤹ¤ë¡£ +.B PATH +´Ä¶­ÊÑ¿ô¤ÈƱ¤¸¤è¤¦¤Ë»ØÄꤹ¤ë¡£ +.TP +.B LD_PRELOAD +¥¹¥Ú¡¼¥¹¶èÀÚ¤ê¤Ç ELF ¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò»ØÄꤹ¤ë¡£ +¤³¤ì¤Ï¥æ¡¼¥¶¡¼¤¬»ØÄê¤Ç¤­¡¢¤¹¤Ù¤Æ¤Î¥é¥¤¥Ö¥é¥ê¤ËÀèΩ¤Ã¤Æ¥í¡¼¥É¤µ¤ì¤ë¡£ +¾¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤Ë¤¢¤ë´Ø¿ô¤òÁªÂòŪ¤ËÃÖ¤­´¹¤¨¤ë¤¿¤á¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +set-user-ID/set-group-ID ¤µ¤ì¤¿ ELF ¥Ð¥¤¥Ê¥ê¤ËÂФ·¤Æ¡¢ +ɸ½àŪ¤Ê¸¡º÷¥Ñ¥¹¤Ë¤¢¤ë¥é¥¤¥Ö¥é¥ê¤Î¤¦¤Á set-user-ID ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ï¥í¡¼¥É¤·¤Ê¤¤¡£ +.TP +.B LD_TRACE_LOADED_OBJECTS +(ELF ¤Î¤ß) +¶õʸ»úÎó¤Ç¤Ê¤¤¾ì¹ç¡¢ +¥×¥í¥°¥é¥à¤òÉáÄ̤˼¹Ԥ¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ +.BR ldd (1) +¤ò¼Â¹Ô¤·¤¿¤È¤­¤Î¤è¤¦¤ËưŪ¥é¥¤¥Ö¥é¥ê¤Î°Í¸´Ø·¸¤ò¥ê¥¹¥Èɽ¼¨¤µ¤»¤ë¡£ +.LP +¤½¤·¤Æ¡¢¤½¤ì¤Û¤ÉÃΤé¤ì¤Æ¤¤¤Ê¤¤´Ä¶­ÊÑ¿ô¤â¤¢¤ë¡£ +¿¤¯¤ÏÇѤì¤Æ¤·¤Þ¤Ã¤¿¤â¤Î¤«ÆâÉô¤Ç¤Î¤ß»ÈÍѤµ¤ì¤ë´Ä¶­ÊÑ¿ô¤Ç¤¢¤ë¡£ +.TP +.B LD_AOUT_LIBRARY_PATH +(libc5) +a.out ¥Ð¥¤¥Ê¥ê¤Ë¤Î¤ß»È¤ï¤ì¤ë´Ä¶­ÊÑ¿ô¤Ç¡¢ +.B LD_LIBRARY_PATH +¤ÈƱ¤¸Ìò³ä¤ò¤¹¤ë¡£ +ld\-linux.so.1 ¤Î¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï +.B LD_ELF_LIBRARY_PATH +¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤¿¡£ +.TP +.B LD_AOUT_PRELOAD +(libc5) +a.out ¥Ð¥¤¥Ê¥ê¤Ë¤Î¤ß»È¤ï¤ì¤ë´Ä¶­ÊÑ¿ô¤Ç¡¢ +.B LD_PRELOAD +¤ÈƱ¤¸Ìò³ä¤ò¤¹¤ë¡£ +ld\-linux.so.1 ¤Î¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï +.B LD_ELF_PRELOAD +¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤¿¡£ +.TP +.B LD_AUDIT +(glibc 2.4 °Ê¹ß) +¾¤Î¥ª¥Ö¥¸¥§¥¯¥È¤è¤ê¤âÁ°¤Ë¡¢Ê̤Υê¥ó¥«Ì¾Á°¶õ´Ö (¤½¤Î¥×¥í¥»¥¹¤Ç¹Ô¤ï¤ì¤ë +Ä̾ï¤Î¥·¥ó¥Ü¥ë·ë¹ç (symbol bindigns) ¤Ë¤Ï´ØÍ¿¤·¤Ê¤¤Ì¾Á°¶õ´Ö) ¤Ç +¥í¡¼¥É¤µ¤ì¤ë¡¢¥æ¡¼¥¶»ØÄê¤Î ELF ¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Î¥³¥í¥ó¶èÀÚ¤ê¤Î¥ê¥¹¥È¡£ +¤³¤ì¤é¤Î¥é¥¤¥Ö¥é¥ê¤ò»È¤Ã¤Æ¡¢Æ°Åª¥ê¥ó¥«¤ÎÆ°ºî¤ò´Æºº¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +set-user-ID/set-group-ID ¤µ¤ì¤¿¥Ð¥¤¥Ê¥ê¤Ç¤Ï¡¢ +.B LD_AUDIT +¤Ï̵»ë¤µ¤ì¤ë¡£ + +ưŪ¥ê¥ó¥«¤Ï¡¢¤¤¤ï¤æ¤ë´Æºº¥Á¥§¥Ã¥¯¥Ý¥¤¥ó¥È (auditing checkpoints) +¤Ë¤ª¤¤¤Æ¡¢´Æºº (audit) ¥é¥¤¥Ö¥é¥ê¤ÎŬÀڤʴؿô¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢ +´Æºº¥é¥¤¥Ö¥é¥ê¤Ø¤ÎÄÌÃΤò¹Ô¤¦¡£´Æºº¥Á¥§¥Ã¥¯¥Ý¥¤¥ó¥È¤ÎÎã¤È¤·¤Æ¤Ï¡¢ +¿·¤¿¤Ê¥é¥¤¥Ö¥é¥ê¤Î¥í¡¼¥É¡¢¥·¥ó¥Ü¥ë¤Î²ò·è¡¢Ê̤ζ¦Í­¥ª¥Ö¥¸¥§¥¯¥È +¤«¤é¤Î¥·¥ó¥Ü¥ë¤Î¸Æ¤Ó½Ð¤·¡¢¤Ê¤É¤¬¤¢¤ë¡£ +¾ÜºÙ¤Ï +.BR rtld-audit (7) +¤ò»²¾È¤·¤Æ¤Û¤·¤¤¡£ +audit ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¡¢Solaris ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¤â¤Î¤È +ÂçÉôʬ¤Ï¸ß´¹À­¤¬¤¢¤ë¡£Solaris ¤Î audit ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë¤Ä¤¤¤Æ¤Ï¡¢ +.I "Linker and Libraries Guide" +¤Î +.I "Runtime Linker Auditing Interface" +¤Î¾Ï¤ËÀâÌÀ¤¬¤¢¤ë¡£ +.TP +.B LD_BIND_NOT +(glibc 2.1.95 °Ê¹ß) +¥·¥ó¥Ü¥ë¤ò²ò·è¤·¤¿¸å¡¢GOT (global offset table) ¤È +PLT (procedure linkage table) ¤ò¹¹¿·¤·¤Ê¤¤¡£ +.TP +.B LD_DEBUG +(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 +(glibc 2.1 °Ê¹ß) +.B LD_DEBUG +¤Î½ÐÎϤò½ñ¤­¹þ¤à¥Õ¥¡¥¤¥ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ïɸ½à½ÐÎϤǤ¢¤ë¡£ +set-user-ID/set-group-ID ¤µ¤ì¤¿¥Ð¥¤¥Ê¥ê¤Ç¤Ï¡¢ +.B LD_DEBUG_OUTPUT +¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.B LD_DYNAMIC_WEAK +(glibc 2.1.19 °Ê¹ß) +¾å½ñ¤­¤µ¤ì¤ë¼å¤¤¥·¥ó¥Ü¥ë (ÀΤΠglibc ¤ÎµóÆ°¤òµÕ¤Ë¤¹¤ë)¡£ +¥»¥­¥å¥ê¥Æ¥£¾å¤ÎÍýͳ¤«¤é¡¢glibc 2.3.4 °Ê¹ß¡¢ +set-user-ID/set-group-ID ¤µ¤ì¤¿¥Ð¥¤¥Ê¥ê¤Ç¤Ï +.B LD_DYNAMIC_WEAK +¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.B LD_HWCAP_MASK +(glibc 2.1 °Ê¹ß) +¥Ï¡¼¥É¥¦¥§¥¢µ¡Ç½¤Î¥Þ¥¹¥¯¡£ +.TP +.B LD_KEEPDIR +(a.out ¤Î¤ß)(libc5) +¥í¡¼¥É¤¹¤ë a.out ¥é¥¤¥Ö¥é¥ê¤Î̾Á°¤Ë¤ª¤¤¤Æ¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ò̵»ë¤·¤Ê¤¤¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ÏÍѤ¤¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ +.TP +.B LD_NOWARN +(a.out ¤Î¤ß)(libc5) +a.out ¥é¥¤¥Ö¥é¥ê¤Ë¤ª¤±¤ë¥Þ¥¤¥Ê¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤ÎÈó¸ß´¹¤Ë +ÂФ¹¤ë·Ù¹ð¥á¥Ã¥»¡¼¥¸¤òÍÞÀ©¤¹¤ë¡£ +.TP +.B LD_ORIGIN_PATH +(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 +(glibc 2.4 °Ê¹ß) +0 ¤ËÀßÄꤹ¤ë¤È¡¢¥Ý¥¤¥ó¥¿Êݸî (pointer guarding) ¤¬Ìµ¸ú¤Ë¤Ê¤ë¡£ +¤½¤ì°Ê³°¤ÎÃͤξì¹ç¤Ï¥Ý¥¤¥ó¥¿Êݸͭ¸ú¤Ë¤Ê¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤Ï¥Ý¥¤¥ó¥¿ÊݸîÍ­¸ú¤Ç¤¢¤ë¡£ +¥Ý¥¤¥ó¥¿Êݸî¤Ï¥»¥­¥å¥ê¥Æ¥£µ¡¹½¤Î°ì¤Ä¤Ç¡¢½ñ¤­¹þ¤ß²Äǽ¤Ê¥×¥í¥°¥é¥à¥á¥â¥ê +¤Ë³ÊǼ¤µ¤ì¤¿¥³¡¼¥É¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò¤Û¤Ü¥é¥ó¥À¥à²½¤¹¤ë¤³¤È¤Ç¡¢ +¹¶·â¼Ô¤¬¥Ð¥Ã¥Õ¥¡¥ª¡¼¥Ð¡¼¥é¥ó¤ä¥¹¥¿¥Ã¥¯Ç˲õ (stack-smashing) ¹¶·â¤ÎºÝ¤Ë +¥Ý¥¤¥ó¥¿¤ò¾è¤Ã¼è¤ë¤³¤È¤òº¤Æñ¤Ë¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ +.TP +.B LD_PROFILE +(glibc 2.1 °Ê¹ß) +¥×¥í¥Õ¥¡¥¤¥ë¤ò¹Ô¤¦¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¡£ +¥Ñ¥¹Ì¾¤«¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È̾ (soname) ¤Ç»ØÄꤵ¤ì¤ë¡£ +¥×¥í¥Õ¥£¡¼¥ë¤Î½ÐÎÏ¤Ï +"\fI$LD_PROFILE_OUTPUT\fP/\fI$LD_PROFILE\fP.profile" ¤È¤¤¤¦Ì¾Á°¤Î +¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£ +.TP +.B LD_PROFILE_OUTPUT +(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 +(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 +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï (¤Ä¤Þ¤ê¡¢¤³¤ÎÊÑ¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢ +¼Â¹Ô¥Õ¥¡¥¤¥ë¤È prelink ¤µ¤ì¤¿¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤Ï¡¢¤½¤ì¤é¤¬°Í¸¤¹¤ë +¥é¥¤¥Ö¥é¥ê¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹¤¬Âº½Å¤µ¤ì¤ë°ìÊý¡¢ +(prelink ¤µ¤ì¤Æ¤¤¤Ê¤¤) position-independent executables (PIEs) ¤È +¾¤Î¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤Ï°Í¸¤¹¤ë¥é¥¤¥Ö¥é¥ê¤Î¥Ù¡¼¥¹¥¢¥É¥ì¥¹¤Ï +º½Å¤µ¤ì¤Ê¤¤¡£ +.B LD_USE_LOAD_BIAS +¤ËÃͤ¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¡¢¼Â¹Ô¥Õ¥¡¥¤¥ë¤È PIE ¤Î¤É¤Á¤é¤Ç¤â +¥Ù¡¼¥¹¥¢¥É¥ì¥¹¤¬Âº½Å¤µ¤ì¤ë¡£ +.B LD_USE_LOAD_BIAS +¤¬ÃÍ 0 ¤ÇÄêµÁ¤µ¤ì¤¿¾ì¹ç¡¢¼Â¹Ô¥Õ¥¡¥¤¥ë¤È PIE ¤Î¤É¤Á¤é¤Ç¤â +¥Ù¡¼¥¹¥¢¥É¥ì¥¹¤Ïº½Å¤µ¤ì¤Ê¤¤¡£ +set-user-ID ¤ä set-group-ID ¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ +¤³¤ÎÊÑ¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ +.TP +.B LD_VERBOSE +(glibc 2.1 °Ê¹ß) +¶õʸ»úÎó¤Ç¤Ê¤¤¾ì¹ç¤Ë¡¢ +.RB ( LD_TRACE_LOADED_OBJECTS +¤òÀßÄꤹ¤ë¤«¡¢ +.B \-\-list +¤Þ¤¿¤Ï +.B \-\-verify +¥ª¥×¥·¥ç¥ó¤òưŪ¥ê¥ó¥«¤Ë»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê) +¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÌ䤤¹ç¤ï¤»¤ë¤È¡¢ +¥×¥í¥°¥é¥à¤Î¥·¥ó¥Ü¥ë¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɽ¼¨¤¹¤ë¡£ +.TP +.B LD_WARN +(ELF ¤Î¤ß)(glibc 2.1.3 °Ê¹ß) +¶õʸ»úÎó¤Ç¤Ê¤¤¾ì¹ç¡¢²ò·è¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥ó¥Ü¥ë¤¬¤¢¤ì¤Ð·Ù¹ð¤ò½Ð¤¹¡£ +.TP +.B LDD_ARGV0 +(libc5) +.BR ldd (1) +¤Î°ú¤­¿ô¤¬¤Ê¤¤¾ì¹ç¤Ë¡¢ +.IR argv [0] +¤È¤·¤Æ»È¤ï¤ì¤ëÃÍ¡£ +.SH ¥Õ¥¡¥¤¥ë +.PD 0 +.TP +.I /lib/ld.so +a.out ¤ÎưŪ¥ê¥ó¥«/¥í¡¼¥À +.TP +.IR /lib/ld\-linux.so. { 1 , 2 } +ELF ¤ÎưŪ¥ê¥ó¥«/¥í¡¼¥À +.TP +.I /etc/ld.so.cache +¥é¥¤¥Ö¥é¥ê¤ò¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò½¸¤á¤¿¥ê¥¹¥È¤È¡¢ +¶¦Í­¥é¥¤¥Ö¥é¥ê¤Î¸õÊä¤ÎÀ°Îó¥ê¥¹¥È¤ò´Þ¤à¥Õ¥¡¥¤¥ë¡£ +.TP +.I /etc/ld.so.preload +¥×¥í¥°¥é¥à¤ÎÁ°¤Ë¥í¡¼¥É¤¹¤Ù¤­ ELF ¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò +¥¹¥Ú¡¼¥¹¤Ç¶èÀڤ俥ꥹ¥È¤¬½ñ¤«¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¡£ +.TP +.B lib*.so* +¶¦Í­¥é¥¤¥Ö¥é¥ê +.PD +.SH Ãí°Õ +.B ld.so +¤Îµ¡Ç½¤Ï libc ¤Î¥Ð¡¼¥¸¥ç¥ó 4.4.3 °Ê¾å¤òÍѤ¤¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ +¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +ELF ¤Îµ¡Ç½¤Ï Linux 1.1.52 °Ê¹ß¤È libc5 °Ê¹ß¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR ldd (1), +.BR rtld-audit (7), +.BR ldconfig (8) +.\" .SH Ãø¼Ô +.\" ld.so: David Engel, Eric Youngdale, Peter MacDonald, Hongjiu Lu, Linus +.\" Torvalds, Lars Wirzenius and Mitch D'Souza +.\" ld-linux.so: Roland McGrath, Ulrich Drepper, ¤½¤Î¾¤Î¿Í¡¹ +.\" +.\" ¾åµ­¤ÎÀâÌÀ¤Ë¤ª¤¤¤Æ¡¢(libc5) ¤Ï David Engel ¤Î +.\" ld.so/ld-linux.so ¤òɽ¤·¤Æ¤¤¤ë¡£ diff --git a/release/man8/ldconfig.8 b/release/man8/ldconfig.8 new file mode 100644 index 00000000..32c582ed --- /dev/null +++ b/release/man8/ldconfig.8 @@ -0,0 +1,182 @@ +.\" -*- nroff -*- +.\" Copyright 1999 SuSE GmbH Nuernberg, Germany +.\" Author: Thorsten Kukuk +.\" +.\" 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; see the file COPYING. If not, +.\" write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +.\" Boston, MA 02111-1307, USA. +.\" +.\" 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 +.\" +.\"WORD: verbose mode ¾ÜºÙɽ¼¨¥â¡¼¥É +.\"WORD: quiet mode ¥á¥Ã¥»¡¼¥¸ÍÞÀ©¥â¡¼¥É +.\" +.TH LDCONFIG 8 2009-04-15 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +/sbin/ldconfig \- ưŪ¥ê¥ó¥«¤Ë¤è¤ë¼Â¹Ô»þ¤Î·ë¹ç´Ø·¸¤òÀßÄꤹ¤ë +.SH ½ñ¼° +.B /sbin/ldconfig +[ +.B \-nNvXV +] +[ +.BR \-f\ conf +] +[ +.BR \-C\ cache +] +[ +.BR \-r\ root +] +.IR directory \ ... +.PD 0 +.PP +.PD +.B /sbin/ldconfig +.B \-l +[ +.B \-v +] +.IR library \ ... +.PD 0 +.PP +.PD +.B /sbin/ldconfig +.B \-p +.SH ÀâÌÀ +.B ldcofig +¤ÏºÇ¿·¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤ËÂФ·¤ÆɬÍפʥê¥ó¥¯¤òºîÀ®¤·¤¿¤ê¡¢ +¥é¥¤¥Ö¥é¥ê¤ò¥­¥ã¥Ã¥·¥å¤·¤¿¤ê¤¹¤ë¡£ +¥é¥¤¥Ö¥é¥ê¤Ï¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó¤ä +.I /etc/ld.so.conf +¥Õ¥¡¥¤¥ë¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ä¡¢¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬ +Ä̾ïÃÖ¤«¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê +.RI ( /lib " ¤È " /usr/lib ) +¤«¤é¸¡º÷¤µ¤ì¤ë¡£ +¥­¥ã¥Ã¥·¥å¤Ï¼Â¹Ô»þ¥ê¥ó¥« +.I ld.so +¤Þ¤¿¤Ï +.I ld-linux.so +¤Ë¤è¤Ã¤Æ»È¤ï¤ì¤ë¡£ +.B ldconfig +¤Ï½èÍý¤¹¤ë¥é¥¤¥Ö¥é¥ê¤Î¥Ø¥Ã¥ÀÉôʬ¤È¥Õ¥¡¥¤¥ë̾¤ò¥Á¥§¥Ã¥¯¤·¡¢ +¤É¤Î¥Ð¡¼¥¸¥ç¥ó¤ËÂФ·¤Æ¥ê¥ó¥¯¤ò¹¹¿·¤¹¤Ù¤­¤«¤òȽÃǤ¹¤ë¡£ +.PP +.B ldconfig +¤Ï ELF ¥é¥¤¥Ö¥é¥ê¤Î¼ïÎà (libc5 ¤« libc6/glibc ¤«) ¤òȽÃǤ¹¤ë¤È¤­¡¢ +¤½¤Î¥é¥¤¥Ö¥é¥ê¤¬¥ê¥ó¥¯¤·¤Æ¤¤¤ë C ¥é¥¤¥Ö¥é¥ê¤ò»²¹Í¤Ë¤¹¤ë¡£ +.\" °Ê²¼¤Îʸ¤ÎÆâÍƤÏËÜÅö¤«¤É¤¦¤«µ¿¤ï¤·¤¤ +.\" (¤ª¤½¤é¤¯²áµî¤Î°äʪ¤Ç¤¢¤í¤¦) -- MTK, Jul 2005 +.\" ¤·¤¿¤¬¤Ã¤Æ¥À¥¤¥Ê¥ß¥Ã¥¯¥é¥¤¥Ö¥é¥ê¤òºîÀ®¤¹¤ë¤È¤­¤Ë¤Ï¡¢ +.\" libc ¤ËÂФ¹¤ë¥ê¥ó¥¯¤ò (\-lc ¤ò¤Ä¤«¤Ã¤Æ) ÌÀ¼¨¤·¤Æ¤ª¤¯¤ÈÎɤ¤¡£ +.PP +¤¹¤Ç¤Ë¸ºß¤·¤Æ¤¤¤ë¥é¥¤¥Ö¥é¥ê¤ÎÃæ¤Ë¤Ï¡¢¼ïÎà¤ò¶èÊ̤¹¤ë¤¿¤á¤Ë½¼Ê¬¤Ê +¾ðÊ󤬴ޤޤì¤Æ¤¤¤Ê¤¤¤â¤Î¤â¤¢¤ë¡£ +¤³¤Î¤¿¤á +.I /etc/ld.so.conf +¥Õ¥¡¥¤¥ë¤Ç¥é¥¤¥Ö¥é¥ê¤Î·Á¼°¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¶èÊÌÉÔǽ¤Ê ELF ¥é¥¤¥Ö¥é¥ê¡Ö¤À¤±¡×¤ËÍѤ¤¤ë¤â¤Î¤Ç¤¢¤ë¡£ +¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï "dirname=TYPE" ¤È¤¹¤ë¡£ +¤³¤³¤Ç TYPE ¤Ï libc4, libc5, libc6 ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë +(¤³¤Î½ñ¼°¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç¤â»È¤¨¤ë)¡£ +¡Ö¥¹¥Ú¡¼¥¹¤òÆþ¤ì¤Æ¤Ï¤Ê¤é¤Ê¤¤¡×¡£ +.B \-p +¥ª¥×¥·¥ç¥ó¤â¸«¤Æ¤ª¤¯¤³¤È¡£ +.B ldconfig +¤ÏÄ̾凉¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¸¢¸Â¤Ç¼Â¹Ô¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +root ¤¬½êÍ­¤·¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ä¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ß¸¢¸Â¤¬ +ɬÍפˤʤ뤫¤é¤Ç¤¢¤ë¡£ +.SH ¥ª¥×¥·¥ç¥ó +.TP +.B \-v +¾ÜºÙɽ¼¨¥â¡¼¥É¡£ +¸½ºß¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òɽ¼¨¤¹¤ë¡£ +¤Þ¤¿¤½¤ì¤¾¤ì¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¥¹¥­¥ã¥ó¤·¡¢ +¿·¤·¤¤¥ê¥ó¥¯¤òÀ¸À®¤¹¤ë¤¿¤Ó¤Ë¡¢¤½¤ÎÆâÍƤòɽ¼¨¤¹¤ë¡£ +¥á¥Ã¥»¡¼¥¸ÍÞÀ©¥â¡¼¥É¤ò¾å½ñ¤­¤¹¤ë¡£ +.TP +.B \-n + +¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¤ß¤ò½èÍý¤¹¤ë¡£ +Ä̾ﶦͭ¥é¥¤¥Ö¥é¥ê¤¬ÃÖ¤«¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê +.RI ( /lib " ¤È " /usr/lib ) +¤ä +.I /etc/ld.so.conf +¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ï½èÍý¤·¤Ê¤¤¡£ +°ÅÌۤΤ¦¤Á¤Ë +.B \-N +¤¬»ØÄꤵ¤ì¤ë¡£ +.TP +.B \-N +¥­¥ã¥Ã¥·¥å¤òºÆ¹½À®¤·¤Ê¤¤¡£ +Ʊ»þ¤Ë +.B \-X +¤¬Æ±»þ¤Ë»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¡¢¥ê¥ó¥¯¤Î¤Û¤¦¤Ï¹¹¿·¤µ¤ì¤ë¡£ +.TP +.B \-X +¥ê¥ó¥¯¤ò¹¹¿·¤·¤Ê¤¤¡£ +.B \-N +¤¬Æ±»þ¤Ë»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¡¢¥­¥ã¥Ã¥·¥å¤Î¤Û¤¦¤ÏºÆ¹½À®¤µ¤ì¤ë¡£ +.TP +.B \-f conf +.B conf +¤ò +.I /etc/ld.so.conf +¤ÎÂå¤ï¤ê¤ËÍѤ¤¤ë¡£ +.TP +.B \-C cache +.B cache +¤ò +.I /etc/ld.so.cache +¤ÎÂå¤ï¤ê¤ËÍѤ¤¤ë¡£ +.TP +.B \-r root +.I root +¤Ë¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤·¡¢¤³¤³¤ò¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤ÆÍѤ¤¤ë¡£ +.TP +.B \-l +¥é¥¤¥Ö¥é¥ê¥â¡¼¥É¡£¤½¤ì¤¾¤ì¤Î¥é¥¤¥Ö¥é¥ê¤ò¼êÆ°¤Ç¥ê¥ó¥¯¤¹¤ë¡£ +½ÏÎý¼Ô¤Î¤ß¤¬ÍѤ¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +.TP +.B \-p +¸½ºß¤Î¥­¥ã¥Ã¥·¥å¤ËÊݸ¤µ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤È¡¢ +¥é¥¤¥Ö¥é¥ê¤Î¸õÊä¤òɽ¼¨¤¹¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +.PD 0 +.TP 20 +.I /lib/ld.so +¼Â¹Ô»þ¥ê¥ó¥«/¥í¡¼¥À¡¼¡£ +.TP 20 +.I /etc/ld.so.conf +¥³¥í¥ó¡¦¥¹¥Ú¡¼¥¹¡¦¥¿¥Ö¡¦²þ¹Ô¡¦¥³¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¡£ +¤½¤ì¤¾¤ì¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç¥é¥¤¥Ö¥é¥ê¤¬¸¡º÷¤µ¤ì¤ë¡£ +.TP 20 +.I /etc/ld.so.cache +.I /etc/ld.so.conf +¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥é¥¤¥Ö¥é¥ê¡¢¤ª¤è¤Ó +.I /lib +¤È +.I /usr/lib +¤Ë¤¢¤ë¥é¥¤¥Ö¥é¥ê¤Î½ç½øÉÕ¤­¥ê¥¹¥È¡£ +.PD +.SH ´ØÏ¢¹àÌÜ +.BR ldd (1), +.BR ld.so (8) diff --git a/release/man8/nscd.8 b/release/man8/nscd.8 new file mode 100644 index 00000000..482ee36b --- /dev/null +++ b/release/man8/nscd.8 @@ -0,0 +1,94 @@ +.\" -*- nroff -*- +.\" Copyright 1999 SuSE GmbH Nuernberg, Germany +.\" Author: Thorsten Kukuk +.\" +.\" 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; see the file COPYING. If not, +.\" write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +.\" Boston, MA 02111-1307, USA. +.\" +.\" 2008-12-05 Petr Baudis +.\" Rewrite the NOTES section to reflect modern reality +.\" +.\" Japanese Version Copyright (c) 2001, 2005 Yuichi SATO +.\" all rights reserved. +.\" Translated Fri Jun 8 23:20:57 JST 2001 +.\" by Yuichi SATO +.\" Updated & Modified Sat Jan 22 14:11:51 JST 2005 +.\" by Yuichi SATO +.\" Updated 2009-03-05 by Kentaro Shirakata +.\" +.TH NSCD 8 2008-12-05 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +/usr/sbin/nscd \- ¥Í¡¼¥à¥µ¡¼¥Ó¥¹¥­¥ã¥Ã¥·¥å¥Ç¡¼¥â¥ó +.SH ÀâÌÀ +nscd ¤Ï°ìÈÌŪ¤Ê¥Í¡¼¥à¥µ¡¼¥Ó¥¹¤ËɬÍפÊ¿¤¯¤Î¤â¤Î¤ò +¥­¥ã¥Ã¥·¥å¤È¤·¤ÆÄ󶡤¹¤ë¥Ç¡¼¥â¥ó¤Ç¤¢¤ë¡£ +¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¥Õ¥¡¥¤¥ë +.I /etc/nscd.conf +¤Ç¥­¥ã¥Ã¥·¥å¥Ç¡¼¥â¥ó¤ÎÆ°ºî¤ò·èÄꤹ¤ë¡£ +.BR nscd.conf (5) +¤ò¸«¤è¡£ + +nscd ¤Ï +.BR passwd (5), +.BR group (5), +.BR hosts (5) +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¤Î¥­¥ã¥Ã¥·¥å¤ò +.BR getpwnam (3), +.BR getpwuid (3), +.BR getgrnam (3), +.BR getgrgid (3), +.BR gethostbyname (3) +¤Ê¤É¤Îɸ½à libc ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ̤·¤ÆÄ󶡤¹¤ë¡£ + +³Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ï 2 ¤Ä¤Î¥­¥ã¥Ã¥·¥å¤¬¤¢¤ë¡£ +¹ÎÄêŪ (positive) ¤Ê¥­¥ã¥Ã¥·¥å¤Ï¸«¤Ä¤«¤Ã¤¿¥¢¥¤¥Æ¥à¤ò¥­¥ã¥Ã¥·¥å¤·¡¢ +ÈÝÄêŪ (negative) ¤Ê¥­¥ã¥Ã¥·¥å¤Ï¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¥¢¥¤¥Æ¥à¤ò¥­¥ã¥Ã¥·¥å¤¹¤ë¡£ +³Æ¥­¥ã¥Ã¥·¥å¤Ï¥Ç¡¼¥¿¤Î TTL (time-to-live, À¸Â¸»þ´Ö) ¤ò¸ÄÊ̤˻ý¤Ã¤Æ¤¤¤ë¡£ +ÆÃÎã¤È¤·¤Æ shadow ¥Õ¥¡¥¤¥ë¤Ï¥­¥ã¥Ã¥·¥å¤µ¤ì¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£ +.BR getspnam (3) +¤ò¸Æ¤Ó½Ð¤·¤Æ¤â·ë²Ì¤È¤·¤Æ¥­¥ã¥Ã¥·¥å¤µ¤ì¤Ê¤¤¤Þ¤Þ¤Ë¤Ê¤ë¡£ +.SH ¥ª¥×¥·¥ç¥ó +.TP +.B "\-\-help" +Á´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤È¤½¤ÎÆ°ºî¤ò¥ê¥¹¥È¤·¤Æɽ¼¨¤¹¤ë¡£ +.SH Ãí°Õ +¥Ç¡¼¥â¥ó¤Ï( +.I passwd +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ä¤¤¤Æ¤Ï +.IR /etc/passwd ¡¢ +.I hosts +¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ä¤¤¤Æ¤Ï +.I /etc/hosts +¤È +.I /etc/resolv.conf +¤È¤¤¤¦¤è¤¦¤Ê)¤½¤ì¤¾¤ì¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¤¿¤á¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ò¸«Ä¥¤Ã¤Æ¡¢ +¤³¤ì¤é¤¬Êѹ¹¤µ¤ì¤ë¤È¥­¥ã¥Ã¥·¥å¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ +¤·¤«¤·¡¢¤³¤ì¤Ï( +.BR inotify (7) +¤¬ÍøÍѲÄǽ¤Ç¡¢glibc 2.9 °Ê¹ß¤¬ÍøÍѲÄǽ¤Ê¾ì¹ç¤ò½ü¤¤¤Æ) +û¤¤ÃÙ±ä¤Î¸å¤Ëµ¯¤³¤ê¡¢¤Þ¤¿¤³¤Î¼«Æ°¸¡½Ð¤ÏÈóɸ½à NSS ¥â¥¸¥å¡¼¥ë¤¬ +.I /etc/nsswitch.conf +¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¤½¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ë¤ÏÂбþ¤·¤Ê¤¤¡£ +¤³¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤òÊѹ¹¤·¤¿¸å¡¢ +.B nscd +¤Î¥­¥ã¥Ã¥·¥å¤ò̵¸ú¤Ë¤¹¤ë¤¿¤á¤Ë°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ë: + + $ \fBnscd -i\fP \fI\fP +.SH ´ØÏ¢¹àÌÜ +.BR nscd.conf (5), +.BR nsswitch.conf (5) +.\" .SH Ãø¼Ô +.\" .B nscd +.\" ¤Ï Thorsten Kukuk ¤È Ulrich Drepper ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤¿¡£ diff --git a/release/man8/sync.8 b/release/man8/sync.8 new file mode 100644 index 00000000..72547624 --- /dev/null +++ b/release/man8/sync.8 @@ -0,0 +1,93 @@ +.\" Reboot/halt and Linux information extracted from Rick Faith's original +.\" sync(8) manpage, dating back to the Linux 0.99 days. The Linux-specific +.\" information is attributed to Linus Torvalds +.\" Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" May be distributed under the GNU General Public License +.\" +.\" Japanese Version Copyright (c) 2000 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jun 13 14:04:28 JST 2000 +.\" by by Yuichi SATO +.\" +.\"WORD: synchronize Ʊ´ü +.\"WORD: superblock ¥¹¡¼¥Ñ¡¼¥Ö¥í¥Ã¥¯ +.\"WORD: halt Ää»ß +.\"WORD: processer ¥×¥í¥»¥Ã¥µ¡¼ +.\" +.TH SYNC 8 1998-11-01 "GNU" "Linux Programmer's Manual" +.SH ̾Á° +sync \- ¥Ç¥£¥¹¥¯¾å¤Î¥Ç¡¼¥¿¤ò¥á¥â¥ê¤ÈƱ´ü¤µ¤»¤ë +.SH ½ñ¼° +.B "sync [\-\-help] [\-\-version]" +.SH ÀâÌÀ +.B sync +¤Ï¥á¥â¥ê¤Ë¥Ð¥Ã¥Õ¥¡¤µ¤ì¤¿¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¤ò¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤à¡£ +¤³¤ì¤Ë¤Ï¡¢Êѹ¹¤µ¤ì¤¿¥¹¡¼¥Ñ¡¼¥Ö¥í¥Ã¥¯¡¦Êѹ¹¤µ¤ì¤¿ inode¡¦ +Ãٱ䤷¤¿Æɤ߽ñ¤­¤¬´Þ¤Þ¤ì¤ë (¾¤Ë¤â¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤)¡£ +¤³¤ì¤Ï¥«¡¼¥Í¥ë¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +¤Ê¤¼¤Ê¤é +.B sync +¥×¥í¥°¥é¥à¤Ï +.BR sync (2) +¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¹Ô»È¤¹¤ë¤À¤±¤À¤«¤é¤Ç¤¢¤ë¡£ +.PP +¥«¡¼¥Í¥ë¤Ï (Èæ³ÓŪÃÙ¤¤) ¥Ç¥£¥¹¥¯¤ÎÆɤ߽ñ¤­¤òÈò¤±¤ë¤¿¤á¡¢ +¥Ç¡¼¥¿¤ò¥á¥â¥ê¤ËÊÝ»ý¤¹¤ë¡£ +¤³¤ì¤Ë¤è¤êÀ­Ç½¤Ï¸þ¾å¤¹¤ë¤¬¡¢¥³¥ó¥Ô¥å¡¼¥¿¤¬¥¯¥é¥Ã¥·¥å¤·¤¿¾ì¹ç¡¢ +·ë²Ì¤È¤·¤Æ¥Ç¡¼¥¿¤¬Â»¼º¤·¤¿¤ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬²õ¤ì¤¿¤ê¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.B sync +¤Ï¥á¥â¥ê¤Ë¤¢¤ëÆâÍƤ¹¤Ù¤Æ¤¬¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¤³¤È¤òÊݾڤ¹¤ë¡£ +.PP +(¿·¤·¤¤¥«¡¼¥Í¥ë¥³¡¼¥É¤ò¥Ç¥Ð¥Ã¥¯¤·¤Æ¤¤¤Æ¥«¡¼¥Í¥ë¥Ñ¥Ë¥Ã¥¯¤ò°ú¤­µ¯¤³¤¹Á°¤Ê¤É¤Î) +Ä̾ï¤È°Û¤Ê¤ëÊýË¡¤Ç¥×¥í¥»¥Ã¥µ¡¼¤òÄä»ß¤µ¤»¤ëÁ°¤Ë¤Ï¡¢ +.B sync +¤ò¸Æ¤Ó½Ð¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +°ìÈÌŪ¤Ë¤Ï +.BR sync (2) +¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë¡¢ +¥·¥¹¥Æ¥à¤òÀŻ߾õÂ֤ˤµ¤»¤ë +.BR shutdown (8), +.BR reboot (8), +.BR halt (8) +¤È¤¤¤Ã¤¿¥³¥Þ¥ó¥É¤ò»È¤Ã¤Æ¥×¥í¥»¥Ã¥µ¡¼¤òÄä»ß¤µ¤»¤ë¤Ù¤­¤Ç¤¢¤ë¡£ +(¤³¤ì¤é¤Î¥³¥Þ¥ó¥É¤Ë¤Ï¤¤¤í¤¤¤í¤Ê¼ÂÁõ¤¬¤¢¤ë¤Î¤Ç¡¢ +¥É¥­¥å¥á¥ó¥È¤òÅö¤ë¤³¤È¡£ +.BR reboot (8), +.BR halt (8) +¤òľÀܸƤӽФ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¥·¥¹¥Æ¥à¤â¤¢¤ë¡£) +.SH ¥ª¥×¥·¥ç¥ó +.TP +.B "\-\-help" +ɸ½à½ÐÎϤ˻ÈÍÑÊýË¡¤Î¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¤ÆÀµ¾ï½ªÎ»¤¹¤ë¡£ +.TP +.B "\-\-version" +ɸ½à½ÐÎϤ˥С¼¥¸¥ç¥ó¾ðÊó¤ò½ÐÎϤ·¤ÆÀµ¾ï½ªÎ»¤¹¤ë¡£ +.TP +.B "\-\-" +¥ª¥×¥·¥ç¥ó¥ê¥¹¥È¤ò½ªÎ»¤¹¤ë¡£ +.SH ´Ä¶­ÊÑ¿ô +ÊÑ¿ô \fBLANG\fP, \fBLC_ALL\fP, \fBLC_CTYPE\fP, \fBLC_MESSAGES\fP +¤ÏÄ̾ï¤Î°ÕÌ£¤ò»ý¤Ä¡£ +.SH ½àµò +POSIX.2. +.SH Ãí°Õ +Linux ¤Ç¤Ï¡¢ +.B sync +¤Ï (¤Þ¤À½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤Ê¤¤) ¥À¡¼¥Æ¥£¤Ê¥Ö¥í¥Ã¥¯¤Î½ñ¤­¹þ¤ß¤ò +¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤¹¤ë¤³¤È¤Î¤ß¤òÊݾڤ¹¤ë¡£ +¤Ä¤Þ¤ê¡¢¤¹¤Ù¤Æ¤Î¥Ö¥í¥Ã¥¯¤Î½ñ¤­¹þ¤ß¤¬½ª¤ë¤Þ¤Ç¤Ë¡¢¼ÂºÝ¤Ë¤Ï¾¯¤·»þ´Ö¤¬¤«¤«¤ë¡£ +.BR reboot (8), +.BR halt (8) +¥³¥Þ¥ó¥É¤Ï +.BR sync (2) +¤ò¸Æ¤ó¤À¸å¤Ë¿ôÉô֥¹¥ê¡¼¥×¤¹¤ë¤³¤È¤Ç¡¢¤³¤ì¤ò¹Íθ¤ËÆþ¤ì¤Æ¤¤¤ë¡£ +.PP +¤³¤Î¥Ú¡¼¥¸¤Ç¤Ï file\%utils-4.0 ¥Ñ¥Ã¥±¡¼¥¸¤Ç¤Î +.B sync +¥³¥Þ¥ó¥É¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ +¤½¤Î¾¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¾¯¤·°ã¤¤¤¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR sync (2), +.BR halt (8), +.BR reboot (8), +.BR update (8) diff --git a/release/man8/tzselect.8 b/release/man8/tzselect.8 new file mode 100644 index 00000000..1967432b --- /dev/null +++ b/release/man8/tzselect.8 @@ -0,0 +1,55 @@ +.\" 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 ¹ñÊÌ¥³¡¼¥É +.\" +.TH TZSELECT 8 2007-05-18 "" "Linux System Administration" +.SH ̾Á° +tzselect \- ¥¿¥¤¥à¥¾¡¼¥ó¤òÁªÂò¤¹¤ë +.SH ½ñ¼° +.B tzselect +.SH ÀâÌÀ +.B tzselect +¥×¥í¥°¥é¥à¤Ï¡¢¥æ¡¼¥¶¡¼¤¬¸½ºß¤¤¤ë¾ì½ê¤Î¾ðÊó¤ò¿Ò¤Í¤Æ¡¢ +¤½¤Î·ë²ÌÆÀ¤é¤ì¤¿¥¿¥¤¥à¥¾¡¼¥ó¤Îɽµ­¤òɸ½à½ÐÎϤËɽ¼¨¤¹¤ë¡£ +¤³¤Î½ÐÎÏ¤Ï +.B TZ +´Ä¶­ÊÑ¿ô¤ÎÃͤˤ¹¤ë¤ÈÎɤ¤¡£ +.PP +¥æ¡¼¥¶¤È¤ÎÂÐÏäϡ¢Á´¤Æɸ½àÆþÎϤÈɸ½à¥¨¥é¡¼½ÐÎϤȤǹԤï¤ì¤ë¡£ +.SH ÊÖ¤êÃÍ +¥æ¡¼¥¶¤«¤é¤ÎÆþÎϤˤè¤Ã¤Æ¥¿¥¤¥à¥¾¡¼¥ó¤¬Àµ¤·¤¯¼èÆÀ¤Ç¤­¤¿¾ì¹ç¤Ï 0 ¤ò +ÊÖ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 °Ê³°¤òÊÖ¤¹¡£ +.SH ´Ä¶­ +.TP +\fBAWK\fP +Posix ¸ß´¹¤Î +.I awk +¥×¥í¥°¥é¥à (¥Ç¥Õ¥©¥ë¥È¤Ï +.BR awk )¡£ +.TP +\fBTZDIR\fP +¥¿¥¤¥à¥¾¡¼¥ó¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î̾Á° (¥Ç¥Õ¥©¥ë¥È¤Ï +.IR /usr/share/zoneinfo )¡£ +.\" ¸Å¤¤¥·¥¹¥Æ¥à¤Ç¤Ï /usr/local/etc/zoneinfo ¤À¤í¤¦ +.SH ¥Õ¥¡¥¤¥ë +.TP +\fBTZDIR\fP\fI/iso3166.tab\fP +2 ʸ»ú¤Î¹ñÊÌ¥³¡¼¥É (countory code) ¤È¹ñ¤Î̾Á°¤«¤é¤Ê¤ë ISO 3166 ¤Îɽ¡£ +.TP +\fBTZDIR\fP\fI/zone.tab\fP +¹ñÊÌ¥³¡¼¥É¡¢·ÐÅÙ¡¦°ÞÅÙ¡¢TZ ¤ÎÃÍ¡¢ÀâÌÀʸ¤«¤é¤Ê¤ëɽ¡£ +.TP +\fBTZDIR\fP\fI/\fP\fITZ\fP +¥¿¥¤¥à¥¾¡¼¥ó \fITZ\fP ¤ËÂФ¹¤ë¥¿¥¤¥à¥¾¡¼¥ó¥Ç¡¼¥¿¤Î¥Õ¥¡¥¤¥ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR tzfile (5), +.BR zdump (8), +.BR zic (8) +.\" @(#)tzselect.8 1.3 diff --git a/release/man8/zdump.8 b/release/man8/zdump.8 new file mode 100644 index 00000000..3c0d1752 --- /dev/null +++ b/release/man8/zdump.8 @@ -0,0 +1,46 @@ +.\" 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" +.SH ̾Á° +zdump \- ¥¿¥¤¥à¥¾¡¼¥ó¤ò¥À¥ó¥×¤¹¤ë +.SH ½ñ¼° +.B zdump +[ +.B \-v +] [ +.B \-c +cutoffyear ] [ zonename ... ] +.SH ÀâÌÀ +.I zdump +¤Ï +¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç»ØÄꤷ¤¿ +.I zonename +¤½¤ì¤¾¤ì¤Ë¤ª¤±¤ë¸½ºß»þ¹ï¤òɽ¼¨¤¹¤ë¡£ +.PP +°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄê¤Ç¤­¤ë: +.TP +.B \-v +¥³¥Þ¥ó¥É¥é¥¤¥ó¤ÇÍ¿¤¨¤é¤ì¤¿ +.I zonename +¤½¤ì¤¾¤ì¤ËÂФ·¤Æ¡¢»ØÄê²Äǽ¤ÊºÇÄã°Ì¤Î»þ¹ïÃÍ (time value)¡¢ +ºÇÄã°Ì¤Î»þ¹ïÃͤΰìÆü¸å¤Î»þ¹ï¡¢ +¸«ÉÕ¤«¤Ã¤¿»þ´ÖÉÔϢ³¤Î°ìÉÃÁ°¤ÈÃúÅÙ¤½¤Î»þ¹ï¡¢ +ºÇ¹â°Ì»þ¹ïÃͤΰìÆüÁ°¤Î»þ¹ï¡¢ +»ØÄê²Äǽ¤ÊºÇ¹â°Ì¤Î»þ¹ïÃÍ¡¢¤òɽ¼¨¤¹¤ë¡£ +¤½¤ì¤¾¤ì¤Î¹Ô¤ÎËöÈø¤Ë¤Ï¡¢ +Í¿¤¨¤é¤ì¤Æ¤¤¤ë»þ¹ï¤¬¥µ¥Þ¡¼¥¿¥¤¥à (Daylight Saving Time) ¤Ê¤é +.B isdst=1 +¤¬¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð +.B isdst=0 +¤¬Éղ䵤ì¤ë¡£ +.TP +.BI "\-c " cutoffyear +Í¿¤¨¤é¤ì¤¿Ç¯¤ÎºÇ½é¤Îº¢¤Ë¤ª¤±¤ë;·×¤Ê½ÐÎϤòÀÚ¤ê¼Î¤Æ¤ë¡£ +.SH ´ØÏ¢¹àÌÜ +.BR tzfile (5), +.BR zic (8) +.\" @(#)zdump.8 7.3 diff --git a/release/man8/zic.8 b/release/man8/zic.8 new file mode 100644 index 00000000..76b6d325 --- /dev/null +++ b/release/man8/zic.8 @@ -0,0 +1,405 @@ +.\" 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) ɸ½à (»þ¹ï) +.\" +.TH ZIC 8 2010-02-25 "" "Linux System Administration" +.SH ̾Á° +zic \- ¥¿¥¤¥à¥¾¡¼¥ó¥³¥ó¥Ñ¥¤¥é +.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 +\&... ] +.SH ÀâÌÀ +.if t .ds lq `` +.if t .ds rq '' +.if n .ds lq \&"\" +.if n .ds rq \&"\" +.de q +\\$3\*(lq\\$1\*(rq\\$2 +.. +.I zic +¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë (Ê£¿ô»ØÄê²Ä) ¤«¤é¥Æ¥­¥¹¥È¤òÆɤߡ¢ +»þ¹ïÊÑ´¹¾ðÊó¥Õ¥¡¥¤¥ë¤òÀ¸À®¤¹¤ë¡£¥Õ¥¡¥¤¥ë̾¤âÆɤ߹þ¤ß¥Æ¥­¥¹¥È¤Ç»ØÄꤷ¤Æ¤ª¤¯¡£ +.I filename +¤¬ +.B \- +¤Î¾ì¹ç¤Ï¡¢É¸½àÆþÎϤ«¤éÆɤ߹þ¤à¡£ +.PP +°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄê¤Ç¤­¤ë: +.TP +.BI "\-d " directory +»þ¹ïÊÑ´¹¾ðÊó¥Õ¥¡¥¤¥ë¤òÀ¸À®¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò¡¢É¸½à¤Î¥Ç¥£¥ì¥¯¥È¥ê +(°Ê²¼¤ò»²¾È) ¤Ç¤Ï¤Ê¤¯»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¹¤ë¡£ +.TP +.BI "\-l " timezone +»ØÄꤷ¤¿¥¿¥¤¥à¥¾¡¼¥ó¤ò¥í¡¼¥«¥ë¥¿¥¤¥à¤ËÍѤ¤¤ë¡£ +.I zic +¤ÏÆþÎϤ˰ʲ¼¤Î½ñ¼°¤Î¥ê¥ó¥¯¹Ô¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤Î¤è¤¦¤Ë¿¶¤ëÉñ¤¦¡£ +.sp +.ti +.5i +Link \fItimezone\fP localtime +.TP +.BI "\-p " timezone +POSIX ·Á¼°¤Î¥¿¥¤¥à¥¾¡¼¥ó´Ä¶­ÊÑ¿ô¤ò°·¤¦¤È¤­¡¢ +»ØÄꤷ¤¿¥¿¥¤¥à¥¾¡¼¥ó¤Î¥ë¡¼¥ë¤òÍѤ¤¤ë¡£ +.I zic +¤ÏÆþÎϤ˰ʲ¼¤Î½ñ¼°¤Î¥ê¥ó¥¯¹Ô¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤Î¤è¤¦¤Ë¿¶¤ëÉñ¤¦¡£ +.sp +.ti +.5i +Link \fItimezone\fP posixrules +.TP +.BI "\-L " leapsecondfilename +±¼ÉþðÊó¤òÍ¿¤¨¤é¤ì¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤«¤éÆɤ߹þ¤à¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +½ÐÎÏ¥Õ¥¡¥¤¥ë¤Ë¤Ï±¼ÉäξðÊó¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£ +.TP +.B \-v +¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤Ë¸½¤ì¤ëǯ¤¬ +.BR time (2) +¤Çɽµ­¤Ç¤­¤ëÈϰϤò±Û¤¨¤Æ¤¤¤ë¾ì¹ç¤Ëʸ¶ç¤ò¸À¤¦¡£ +.TP +.B \-s +½ÐÎÏ¥Õ¥¡¥¤¥ë¤Ë³ÊǼ¤µ¤ì¤ë»þ¹ï¤ÎÃͤò¡¢ signed ¤Çɾ²Á¤·¤Æ¤â unsigned ¤Ç +ɾ²Á¤·¤Æ¤âƱ¤¸Ãͤˤʤë¤è¤¦¤ÊÈϰϤËÀ©¸Â¤¹¤ë¡£ +¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È SVVS ¸ß´¹¤Ê¥Õ¥¡¥¤¥ë¤òÀ¸À®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.TP +.BI "\-y " command +ǯ¤Î·¿¤Î¥Á¥§¥Ã¥¯ (°Ê²¼»²¾È) ¤Ë +.B yearistype +¤Ç¤Ï¤Ê¤¯»ØÄꤷ¤¿ +.I command +¤òÍѤ¤¤ë¡£ +.PP +ÆþÎϹԤϥե£¡¼¥ë¥É¤«¤é¤Ê¤ë¡£ +¥Õ¥£¡¼¥ë¥É´Ö¤Ï¡¢Ï¢Â³¤·¤¿Ç¤°Õ¤Î¸Ä¿ô¤Î¶õÇòʸ»ú¤Ë¤è¤Ã¤Æ¶èÀÚ¤é¤ì¤ë¡£ +¹ÔƬ¡¦¹ÔËö¤Î¶õÇòʸ»ú¤Ï̵»ë¤µ¤ì¤ë¡£ +¥¯¥©¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥ã¡¼¥×ʸ»ú (#) ¤¬ÆþÎϹԤ˸½¤ì¤¿¾ì¹ç¤Ï¡¢ +¤½¤³¤«¤é¹ÔËö¤Þ¤Ç¤Ï¥³¥á¥ó¥È¤È¤·¤Æ°·¤ï¤ì¤ë¡£ +¶õÇòʸ»ú¤ä¥·¥ã¡¼¥×ʸ»ú¤ò¥À¥Ö¥ë¥¯¥©¡¼¥È (") ¤Ç°Ï¤á¤Ð¡¢ +¥Õ¥£¡¼¥ë¥É¤Î°ìÉô¤È¤·¤ÆÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +(¥³¥á¥ó¥È½üµî½èÍý¤ò¹Ô¤Ã¤¿¸å¤Î¤â¤Î¤ò´Þ¤á¤Æ) ¶õ¹Ô¤Ï̵»ë¤µ¤ì¤ë¡£ +¶õ¹Ô°Ê³°¤Î¹Ô¤Ï¡¢ 3 ¼ïÎढ¤ë¥¿¥¤¥×¤Î¹Ô¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¤È¤ß¤Ê¤µ¤ì¤ë¡£ +3 ¤Ä¤Î¥¿¥¤¥×¤È¤Ï¡¢¥ë¡¼¥ë¹Ô (rule line)¡¢¥¾¡¼¥ó¹Ô (zone line)¡¢ +¥ê¥ó¥¯¹Ô (link line) ¤Ç¤¢¤ë¡£ +.PP +¥ë¡¼¥ë¹Ô¤Î½ñ¼°¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +.nf +.ti +.5i +.ta \w'Rule\0\0'u +\w'NAME\0\0'u +\w'FROM\0\0'u +\w'1973\0\0'u +\w'TYPE\0\0'u +\w'Apr\0\0'u +\w'lastSun\0\0'u +\w'2:00\0\0'u +\w'SAVE\0\0'u +.sp +Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +.sp +Îã: +.ti +.5i +.sp +Rule US 1967 1973 \- Apr lastSun 2:00 1:00 D +.sp +.fi +¥ë¡¼¥ë¹Ô¤ò¹½À®¤¹¤ë¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤ÎÄ̤ê: +.TP "\w'LETTER/S'u" +.B NAME +¤³¤Î¥ë¡¼¥ë¤¬½ê°¤¹¤ë¥ë¡¼¥ë¥»¥Ã¥È¤Î̾Á°¤òÍ¿¤¨¤ë (Ǥ°Õ)¡£ +.TP +.B FROM +¤³¤Î¥ë¡¼¥ë¤¬Å¬ÍѤµ¤ì¤ëºÇ½é¤Îǯ¤òÍ¿¤¨¤ë¡£ +Ǥ°Õ¤ÎÀ°¿ô¤òǯ¤È¤·¤ÆÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¥°¥ì¥´¥ê¥ªÎñ¤¬²¾Äꤵ¤ì¤ë¡£ +.I minimum +(¤¢¤ë¤¤¤Ï¤½¤Îû½Ì) ¤ÏÀ°¿ôɽµ­¤Ç¤­¤ëºÇ¾®¤Îǯ¤ò°ÕÌ£¤¹¤ë¡£ +.I maximum +(¤¢¤ë¤¤¤Ï¤½¤Îû½Ì) ¤ÏÀ°¿ôɽµ­¤Ç¤­¤ëºÇÂç¤Îǯ¤ò°ÕÌ£¤¹¤ë¡£ +¥ë¡¼¥ë¤Ç¤Ï»þ¹ïÃÍ (time value) ¤Ç¤Ïɽµ­¤Ç¤­¤Ê¤¤»þ¹ï¤âµ­½Ò¤Ç¤­¤ë¡£ +ɽµ­¤Ç¤­¤Ê¤¤»þ¹ï¤Ï̵»ë¤µ¤ì¤ë¡£¤Ä¤Þ¤ê¥ë¡¼¥ë¤Ï +°Û¤Ê¤Ã¤¿»þ¹ïÃͤη¿¤ò»ý¤Ä¥Û¥¹¥È´Ö¤Ç¥Ý¡¼¥¿¥Ö¥ë¤Ç¤¢¤ë¡£ +.TP +.B TO +¤³¤Î¥ë¡¼¥ë¤¬Å¬ÍѤµ¤ì¤ëºÇ¸å¤Îǯ¤òÍ¿¤¨¤ë¡£ +.I minimum +¤È +.I maximum +(¾å½Ò) ¤Ë²Ã¤¨¡¢ +.I only +(¤Þ¤¿¤Ï¤½¤Îû½Ì) ¤òÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¡¢¤³¤Î¾ì¹ç¤Ï +.B FROM +¥Õ¥£¡¼¥ë¥É¤Ë»ØÄꤷ¤¿ÃͤÈƱ¤¸Ãͤ¬ÍѤ¤¤é¤ì¤ë¡£ +.TP +.B TYPE +¥ë¡¼¥ë¤ÎŬÍѤµ¤ì¤ëǯ¤Î¥¿¥¤¥×¤òÍ¿¤¨¤ë¡£ +.B TYPE +¤¬ +.B \- +¤Ç¤¢¤ì¤Ð¡¢¤³¤Î¥ë¡¼¥ë¤Ï +.B FROM +¤«¤é +.B TO +¤Ë¶´¤Þ¤ì¤¿ (ξü´Þ¤à) Á´¤Æ¤Îǯ¤ËŬÍѤµ¤ì¤ë¡£ +.B TYPE +¤¬¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢ +.I zic +¤Ï°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æǯ¤Î¥¿¥¤¥×¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ +.ti +.5i +\fByearistype\fP \fIyear\fP \fItype\fP +.br +ÊÖ¤êÃͤ¬ 0 ¤Î¾ì¹ç¤Ï¡¢¤½¤Îǯ¤ÏÍ¿¤¨¤é¤ì¤¿¥¿¥¤¥×¤Ë´Þ¤Þ¤ì¡¢ +ÊÖ¤êÃͤ¬ 1 ¤Î¾ì¹ç¤Ï´Þ¤Þ¤ì¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£ +.TP +.B IN +¥ë¡¼¥ë¤¬¸úÎϤò»ý¤Ä·î¤Î̾Á°¤ò»ØÄꤹ¤ë¡£ +·î̾¤Ïû½Ì¤Ç¤­¤ë¡£ +.TP +.B ON +¥ë¡¼¥ë¤¬¸úÎϤò»ý¤ÄÆü¤Î̾Á°¤ò»ØÄꤹ¤ë¡£ +°Ê²¼¤Î¤è¤¦¤Ê½ñ¼°¤òǧ¼±¤¹¤ë: +.nf +.in +.5i +.sp +.ta \w'Sun<=25\0\0'u +5 ¤½¤Î·î¤ÎÂè 5 Æü +lastSun ¤½¤Î·î¤ÎºÇ¸å¤ÎÆüÍËÆü +lastMon ¤½¤Î·î¤ÎºÇ¸å¤Î·îÍËÆü +Sun>=8 Âè 8 Æü°Ê¹ß¤ÎºÇ½é¤ÎÆüÍËÆü +Sun<=25 Âè 25 Æü°ÊÁ°¤ÎºÇ¸å¤ÎÆüÍËÆü +.fi +.in -.5i +.sp +ÍËÆü¤Î̾Á°¤Ïû½Ì¤Ç¤­¤ë¡£Á´ÉôÄ֤äƤâÎɤ¤¡£ +.B ON +¥Õ¥£¡¼¥ë¥É¤ÎÆâÉô¤Ë¤Ï¥¹¥Ú¡¼¥¹¤òÆþ¤ì¤Æ¤Ï¤¤¤±¤Ê¤¤¤³¤È¤ËÃí°Õ¡£ +.TP +.B AT +¥ë¡¼¥ë¤¬¸úÎϤò»ý¤Ä°ìÆü¤Î¤¦¤Á¤Î»þ¹ï¤òÍ¿¤¨¤ë¡£ +°Ê²¼¤Î¤è¤¦¤Ê½ñ¼°¤òǧ¼±¤¹¤ë: +.nf +.in +.5i +.sp +.ta \w'1:28:13\0\0'u +2 »þ´Ö¤Ç¤Îɽµ­ +2:00 »þ´Ö¤Èʬ¤Ç¤Îɽµ­ +15:00 24 »þ´Ö·Á¼°¤Î»þ´Ö (Àµ¸á°Ê¹ß) +1:28:14 »þ´Ö¡¦Ê¬¡¦ÉäǤÎɽµ­ +\- 0 ¤ÈƱ¤¸ +.fi +.in -.5i +.sp +¤³¤³¤Ç 0 »þ¤Ï¤½¤ÎÆü¤Î¤Ï¤¸¤Þ¤ê¤Ç¤¢¤ê¡¢ +24 »þ¤Ï¤½¤ÎÆü¤Î½ª¤ï¤ê¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Î½ñ¼°¤Î¤¢¤È¤Ë¤Ï¡¢°Ê²¼¤Îʸ»ú¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.I w +Í¿¤¨¤é¤ì¤¿»þ¹ï¤¬¥í¡¼¥«¥ë¤Ê +.q "ÊÉ»þ·× (wall clock)" +»þ¹ï¤Ç¤¢¤ë; +.I s +Í¿¤¨¤é¤ì¤¿»þ¹ï¤¬¥í¡¼¥«¥ë¤Ê +.q "ɸ½à (standard)" +»þ¹ï¤Ç¤¢¤ë; +.I u +(¤Þ¤¿¤Ï +.I g +¤Þ¤¿¤Ï +.IR z ) +Í¿¤¨¤é¤ì¤¿»þ¹ï¤¬É¸½à»þ (universal time) ¤Ç¤¢¤ë¡£ +¤³¤ì¤é¤Îɽ°Õʸ»ú¤¬¤¤¤º¤ì¤â»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ +ÊÉ»þ·×»þ¹ï¤¬²¾Äꤵ¤ì¤ë¡£ +.TP +.B SAVE +¥ë¡¼¥ë¤¬¸úÎϤò»ý¤Ã¤Æ¤¤¤ë¤È¤­¡¢¥í¡¼¥«¥ë¤Êɸ½à»þ¹ï¤ËÄɲ乤٤­ +»þ´Ö¤ÎÎ̤òÍ¿¤¨¤ë¡£¤³¤Î¥Õ¥£¡¼¥ë¥É¤Î½ñ¼°¤Ï +.B AT +¥Õ¥£¡¼¥ë¥É¤Î¤â¤Î¤ÈƱ¤¸¤Ç¤¢¤ë (¤¿¤À¤·¤â¤Á¤í¤ó +.I w +¤È +.I s +¤Î¸åÃÖʸ»ú¤ÏÍѤ¤¤é¤ì¤Ê¤¤)¡£ +.TP +.B LETTER/S +¤³¤Î¥ë¡¼¥ë¤¬¸úÎϤò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¥¿¥¤¥à¥¾¡¼¥óû½Ì·¿¤Î +.q "²ÄÊÑÉô (variable part) +¤òÍ¿¤¨¤ë (Î㤨¤Ð +.q EST +¤ä +.q EDT +¤Ë¤ª¤±¤ë +.q S +¤ä +.q D +¤Ê¤É)¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬ +.B \- +¤Ç¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ +²ÄÊÑÉô¤Ï¸ºß¤·¤Ê¤¤¡£ +.PP +¥¾¡¼¥ó¹Ô¤Î½ñ¼°¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +.sp +.nf +.ti +.5i +.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 +Îã: +.sp +.ti +.5i +Zone Australia/Adelaide 9:30 Aus CST 1971 Oct 31 2:00 +.sp +.fi +¥¾¡¼¥ó¹Ô¤ò¹½À®¤¹¤ë¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤ÎÄ̤ê: +.TP "\w'UTCOFF'u" +.B NAME +¥¿¥¤¥à¥¾¡¼¥ó¤Î̾Á°¡£¤³¤Î̾Á°¤¬¤³¤Î¥¾¡¼¥ó¤Î»þ¹ïÊÑ´¹¾ðÊó¥Õ¥¡¥¤¥ë¤ò +À¸À®¤¹¤ë¤È¤­¤ËÍѤ¤¤é¤ì¤ë¡£ +.TP +.B UTCOFF +¤³¤Î¥¾¡¼¥ó¤Îɸ½à»þ¹ï¤òÆÀ¤ë¤¿¤á¤Ë¡¢ UTC ¤Ë²Ã¤¨¤ë»þ´Ö¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤Î½ñ¼°¤Ï¡¢¥ë¡¼¥ë¹Ô¤Î +.B AT +¤ª¤è¤Ó +.B SAVE +¥Õ¥£¡¼¥ë¥É¤Î¤â¤Î¤ÈƱ¤¸¤Ç¤¢¤ë¡£»þ´Ö¤ò UTC ¤«¤é°ú¤¯É¬Íפ¬¤¢¤ë¾ì¹ç¤Ï +¥Þ¥¤¥Ê¥¹µ­¹æ¤òÁ°ÃÖ¤¹¤ë¡£ +.TP +.B RULES/SAVE +¥¿¥¤¥à¥¾¡¼¥ó¤ËŬÍѤµ¤ì¤ë¥ë¡¼¥ë¤Î̾Á°¤«¡¢¤¢¤ë¤¤¤Ï +¥í¡¼¥«¥ëɸ½à»þ¹ï¤Ë²Ã¤¨¤ë¤Ù¤­»þ´Ö¤ÎÎ̤ò»ØÄꤹ¤ë¡£ +¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬ +.B \- +¤Ê¤é¤Ð¡¢¾ï¤Ëɸ½à»þ¹ï¤¬¤³¤Î¥¾¡¼¥ó¤ËÂФ·¤ÆÍѤ¤¤é¤ì¤ë¡£ +.TP +.B FORMAT +¤³¤Î¥¿¥¤¥à¥¾¡¼¥ó¤ËÂФ¹¤ë¥¿¥¤¥à¥¾¡¼¥óû½Ì̾¤Î½ñ¼°¡£ +2 ʸ»ú¤Îʸ»úÎó +.B %s +¤òÍѤ¤¤Æ¡¢¤É¤³¤¬ +.q ²ÄÊÑÉô +¤Ë¤Ê¤ë¤«¤ò»ØÄê¤Ç¤­¤ë¡£¤¢¤ë¤¤¤Ï¥¹¥é¥Ã¥·¥åʸ»ú (/) ¤òÍѤ¤¤Æ +ɸ½à¤Îû½Ì̾¤È¥µ¥Þ¡¼¥¿¥¤¥àû½Ì̾¤ò¶èÀڤ뤳¤È¤¬¤Ç¤­¤ë¡£ +.TP +.B UNTIL +UTC ¤ËÂФ¹¤ë¥ª¥Õ¥»¥Ã¥È¤«¡¢¤½¤Î¾ì½ê¤Ë¤ª¤±¤ë¥ë¡¼¥ë¤¬Êѹ¹¤µ¤ì¤ë»þ¹ï¡£ +ǯ¡¦·î¡¦Æü¡¦»þ¹ï¤Ç»ØÄꤹ¤ë¡£ +¤³¤ì¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢¥¿¥¤¥à¥¾¡¼¥ó¤Î¾ðÊó¤ÏÍ¿¤¨¤é¤ì¤Æ¤¤¤ë +UTC ¥ª¥Õ¥»¥Ã¥È¤«¤éÀ¸À®¤µ¤ì¡¢¥ë¡¼¥ë¤Ï»ØÄê»þ¹ï¤Ë¤Ê¤ë¤ÈÊѹ¹¤µ¤ì¤ë¡£ +·î¡¦Æü¡¦»þ¹ï¤Ï¡¢¥ë¡¼¥ë¤Î IN, ON, AT ¥«¥é¥à¤ÈƱ¤¸½ñ¼°¤Ç»ØÄꤹ¤ë¡£ +¤³¤Î¸å¤Ë³¤¯¥«¥é¥à¤Ï¾Êά¤Ç¤­¤ë¡£ +¾Êά¤µ¤ì¤¿¥«¥é¥à¤ËÂФ·¤Æ¤Ï¡¢ +²ÄǽÀ­¤Î¤¢¤ë¤â¤Î¤Î¤¦¤ÁºÇ¤âÁᤤÃͤ¬¥Ç¥Õ¥©¥ë¥È¤ÇÍѤ¤¤é¤ì¤ë¡£ +.IP +¤³¤Î¹Ô¤Ë¤Ïɬ¤º +.q ·Ñ³ (continuation) +¹Ô¤¬Â³¤¯¡£ +·Ñ³¹Ô¤Ï¥¾¡¼¥ó¹Ô¤ÈƱ¤¸½ñ¼°¤ò»ý¤Ä¤¬¡¢ +.q Zone +¤È̾Á°¤Ï¾Êά¤µ¤ì¤ë¡£¤Ê¤¼¤Ê¤é·Ñ³¹Ô¤ÏľÁ°¤Î¹Ô¤Î +.B UNTIL +¥Õ¥£¡¼¥ë¥É¤Ç»ØÄꤵ¤ì¤¿»þ¹ï°Ê¹ß¤Î¾ðÊó¤òÍ¿¤¨¤ë¤â¤Î¤À¤«¤é¤Ç¤¢¤ë¡£ +·Ñ³¹Ô¤Ë¤â¥¾¡¼¥ó¹Ô¤ÈƱ¤¸¤è¤¦¤Ë +.B UNTIL +¥Õ¥£¡¼¥ë¥É¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¡¢¤³¤Î¾ì¹ç¤Ï¤½¤Î¼¡¤Î¹Ô¤¬ +¤µ¤é¤Ê¤ë·Ñ³¹Ô¤Ë¤Ê¤ë¤³¤È¤È¤Ê¤ë¡£ +.PP +¥ê¥ó¥¯¹Ô¤Î½ñ¼°¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£ +.sp +.nf +.ti +.5i +.ta \w'Link\0\0'u +\w'Europe/Istanbul\0\0'u +Link LINK-FROM LINK-TO +.sp +Îã: +.sp +.ti +.5i +Link Europe/Istanbul Asia/Istanbul +.sp +.fi +.PP +.B LINK-FROM +¥Õ¥£¡¼¥ë¥É¤Ï¥¾¡¼¥ó¹Ô¤Î +.B NAME +¥Õ¥£¡¼¥ë¥É¤¬µ­½Ò¤µ¤ì¤ë¡£ +.B LINK-TO +¥Õ¥£¡¼¥ë¥É¤Ï¤½¤Î¥¾¡¼¥ó¤ÎÊÌ̾¤Ç¤¢¤ë¡£ +.PP +¥Õ¥¡¥¤¥ëÃæ¤Ç±¼Éäòµ­½Ò¤¹¤ë¹Ô¤Ï°Ê²¼¤Î¤è¤¦¤Ê½ñ¼°¤ò»ý¤Ä¡£ +.nf +.ti +.5i +.ta \w'Leap\0\0'u +\w'YEAR\0\0'u +\w'MONTH\0\0'u +\w'DAY\0\0'u +\w'HH:MM:SS\0\0'u +\w'CORR\0\0'u +.sp +Leap YEAR MONTH DAY HH:MM:SS CORR R/S +.sp +Îã: +.ti +.5i +.sp +Leap 1974 Dec 31 23:59:60 + S +.sp +.fi +.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. +.\" See Terry J Quinn, The BIPM and the accurate measure of time, +.\" Proc IEEE 79, 7 (July 1991), 894-905. +.\" or +.\" .q ++ +.\" if two seconds were added +.\" or +.\" .q -- +.\" if two seconds were skipped. +.B R/S +¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢Â¾¤Î¥Õ¥£¡¼¥ë¥É¤¬µ­½Ò¤·¤Æ¤¤¤ë±¼Éäλþ¹ï¤¬ +UTC ¤Ê¤é¤Ð +.q Stationary +(¤¢¤ë¤¤¤Ï¤½¤Îû½Ì·Á) ¤ò¡¢¥í¡¼¥«¥ë¤ÊÊÉ»þ·×»þ¹ï¤Ê¤é +.q Rolling +(¤¢¤ë¤¤¤Ï¤½¤Îû½Ì·Á) ¤ò»ØÄꤹ¤ë¡£ +.SH ¥Õ¥¡¥¤¥ë +/usr/local/etc/zoneinfo À¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ëÍѤÎɸ½à¥Ç¥£¥ì¥¯¥È¥ê +.SH Ãí°Õ +Æó¤Ä°Ê¾å¤Î¥í¡¼¥«¥ë¥¿¥¤¥à¤ò»ý¤Ã¤Æ¤¤¤ëÃÏ°è¤Ç¤Ï¡¢ +¥í¡¼¥«¥ë¤Êɸ½à»þ¤ò +ºÇ¤âÁᤤÊý¤Î»þ¹ïÊÑ´¹¥ë¡¼¥ë¤Î +.B AT +¥Õ¥£¡¼¥ë¥É¤ËÍѤ¤¤ëɬÍפ¬¤¢¤ë¤À¤í¤¦¡£¤µ¤â¤Ê¤¤¤È +¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤µ¤ì¤¿ºÇ¤âÁᤤÊÑ´¹»þ¹ï¤¬ +Àµ¤·¤¤¤³¤È¤¬Êݾڤµ¤ì¤Ê¤¤¡£ +.SH ´ØÏ¢¹àÌÜ +.BR tzfile (5), +.BR zdump (8) +.\" @(#)zic.8 7.19 diff --git a/translation_list b/translation_list new file mode 100644 index 00000000..7ae78284 --- /dev/null +++ b/translation_list @@ -0,0 +1,2059 @@ +¡û:LDP man-pages:3.24:2007/11/15:intro:1:2008/02/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2000/10/30:ldd:1:2002/02/14::ysato@h4.dion.ne.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/11/14:time:1:2008/11/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/11/27:_Exit:2:_exit:2: +¡÷:LDP man-pages:3.24:2009/07/18:__clone2:2:clone:2: +¡û:LDP man-pages:3.24:2008/11/27:_exit:2:2001/12/14::ysato@h4.dion.ne.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:1995/06/10:_llseek:2:llseek:2: +¡÷:LDP man-pages:3.24:2008/12/05:_newselect:2:select:2: +¡û:LDP man-pages:3.24:2007/12/19:_syscall:2:2008/02/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/11/20:_sysctl:2:sysctl:2: +¡û:LDP man-pages:3.24:2009/02/23:accept:2:2008/12/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/02/23:accept4:2:accept:2: +¡û:LDP man-pages:3.24:2007/07/10:access:2:2007/10/11::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/06/16:acct:2:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡ß:LDP man-pages:3.24:2010/02/25:add_key:2::::: +¡û:LDP man-pages:3.24:2004/05/27:adjtimex:2:2006/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/05:afs_syscall:2:unimplemented:2: +¡û:LDP man-pages:3.24:2008/06/12:alarm:2:1997/02/22::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:2007/05/31:alloc_hugepages:2:2007/06/13::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/12/26:arch_prctl:2:2005/11/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2004/06/17:bdflush:2:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/12/28:bind:2:2007/06/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/05:break:2:unimplemented:2: +¡û:LDP man-pages:3.24:2008/06/18:brk:2:2007/02/08::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1995/06/27:cacheflush:2:2005/10/05::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/01/26:capget:2:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/01/26:capset:2:capget:2: +¡û:LDP man-pages:3.24:2007/07/26:chdir:2:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/05/26:chmod:2:2005/01/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/06/16:chown:2:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/06/16:chown32:2:chown:2: +¡û:LDP man-pages:3.24:2008/06/23:chroot:2:2005/01/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2010/02/03:clock_getres:2:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2010/02/03:clock_gettime:2:clock_getres:2: +¡û:LDP man-pages:3.24:2008/07/09:clock_nanosleep:2:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2010/02/03:clock_settime:2:clock_getres:2: +¡û:LDP man-pages:3.24:2009/07/18:clone:2:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/07/18:clone2:2:clone:2: +¡û:LDP man-pages:3.24:2007/12/28:close:2:2007/10/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/12/03:connect:2:2005/10/05::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/09/20:creat:2:open:2: +¡û:LDP man-pages:3.24:2007/06/03:create_module:2:2006/07/30::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:0000/00/00:delete_module:2:2006/07/30::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/10/09:dup:2:2005/09/07::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/10/09:dup2:2:dup:2: +¡÷:LDP man-pages:3.24:2008/10/09:dup3:2:dup:2: +¡û:LDP man-pages:3.24:2009/01/17:epoll_create:2:2009/03/14::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2009/01/17:epoll_create1:2:epoll_create:2: +¡û:LDP man-pages:3.24:2009/01/17:epoll_ctl:2:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/01/17:epoll_pwait:2:epoll_wait:2: +¡û:LDP man-pages:3.24:2009/01/17:epoll_wait:2:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/01/26:eventfd:2:2008/11/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/01/26:eventfd2:2:eventfd:2: +¡û:LDP man-pages:3.24:2010/01/06:execve:2:2008/04/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/11/27:exit:2:_exit:2: +¡û:LDP man-pages:3.24:2008/11/27:exit_group:2:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2009/12/13:faccessat:2:2007/05/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2003/02/14:fadvise64:2:posix_fadvise:2: +¡÷:LDP man-pages:3.24:2003/02/14:fadvise64_64:2:posix_fadvise:2: +¡û:LDP man-pages:3.24:2009/03/13:fallocate:2:2007/10/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/26:fchdir:2:chdir:2: +¡÷:LDP man-pages:3.24:2008/05/26:fchmod:2:chmod:2: +¡û:LDP man-pages:3.24:2009/12/13:fchmodat:2:2006/12/28::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/06/16:fchown:2:chown:2: +¡÷:LDP man-pages:3.24:2008/06/16:fchown32:2:fchown:2: +¡û:LDP man-pages:3.24:2009/12/13:fchownat:2:2006/12/28::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2009/10/17:fcntl:2:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/10/17:fcntl64:2:fcntl:2: +¡÷:LDP man-pages:3.24:2008/11/07:fdatasync:2:fsync:2: +¡÷:LDP man-pages:3.24:2001/12/01:fgetxattr:2:getxattr:2: +¡÷:LDP man-pages:3.24:2001/12/01:flistxattr:2:listxattr:2: +¡û:LDP man-pages:3.24:2009/07/25:flock:2:2005/09/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/04/27:fork:2:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/05/31:free_hugepages:2:alloc_hugepages:2: +¡÷:LDP man-pages:3.24:2001/12/01:fremovexattr:2:removexattr:2: +¡÷:LDP man-pages:3.24:2001/12/31:fsetxattr:2:setxattr:2: +¡÷:LDP man-pages:3.24:2009/09/30:fstat:2:stat:2: +¡÷:LDP man-pages:3.24:2009/01/22:fstat64:2:fstat:2: +¡û:LDP man-pages:3.24:2009/12/13:fstatat:2:2006/12/28::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2009/12/13:fstatat64:2:fstatat:2: +¡÷:LDP man-pages:3.24:2004/06/23:fstatfs:2:statfs:2: +¡÷:LDP man-pages:3.24:2004/06/23:fstatfs64:2:fstatfs:2: +¡÷:LDP man-pages:3.24:2003/08/22:fstatvfs:2:statvfs:2: +¡û:LDP man-pages:3.24:2008/11/07:fsync:2:2007/10/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/02/28:ftruncate:2:truncate:2: +¡÷:LDP man-pages:3.24:2009/02/28:ftruncate64:2:ftruncate:2: +¡û:LDP man-pages:3.24:2008/11/27:futex:2:2007/02/08::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2009/12/13:futimesat:2:2006/10/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:0000/00/00:get_kernel_syms:2:2006/07/31::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/15:get_mempolicy:2:2008/11/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/11/27:get_thread_area:2:2003/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/03/15:getcontext:2:2001/12/15::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡ß:LDP man-pages:3.24:2008/06/03:getcpu:2::::: +¡÷:LDP man-pages:3.24:2009/03/31:getcwd:2:getcwd:3: +¡û:LDP man-pages:3.24:2009/07/04:getdents:2:2009/03/05::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2009/07/04:getdents64:2:getdents:2: +¡û:LDP man-pages:3.24:2009/09/27:getdomainname:2:2009/01/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:getdtablesize:2:2007/01/14::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:1993/07/23:getegid:2:getgid:2: +¡÷:LDP man-pages:3.24:1993/07/23:getegid32:2:getegid:2: +¡÷:LDP man-pages:3.24:1993/07/23:geteuid:2:getuid:2: +¡÷:LDP man-pages:3.24:1993/07/23:geteuid32:2:geteuid:2: +¡û:LDP man-pages:3.24:1993/07/23:getgid:2:1997/06/26::suto@av.crl.sony.co.jp:SUTO, Mitsuaki: +¡÷:LDP man-pages:3.24:1993/07/23:getgid32:2:getgid:2: +¡û:LDP man-pages:3.24:2008/06/03:getgroups:2:2008/08/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/06/03:getgroups32:2:getgroups:2: +¡÷:LDP man-pages:3.24:2009/01/13:gethostid:2:gethostid:3: +¡û:LDP man-pages:3.24:2008/11/27:gethostname:2:2009/01/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/03/15:getitimer:2:2007/10/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:getpagesize:2:2007/01/07::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/12/03:getpeername:2:2005/02/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/09/20:getpgid:2:setpgid:2: +¡÷:LDP man-pages:3.24:2009/09/20:getpgrp:2:setpgid:2: +¡û:LDP man-pages:3.24:2008/09/23:getpid:2:1997/06/27::suto@av.crl.sony.co.jp:SUTO, Mitsuaki: +¡÷:LDP man-pages:3.24:2007/07/05:getpmsg:2:unimplemented:2: +¡÷:LDP man-pages:3.24:2008/09/23:getppid:2:getpid:2: +¡û:LDP man-pages:3.24:2008/05/29:getpriority:2:2005/10/08::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/28:getresgid:2:getresuid:2: +¡÷:LDP man-pages:3.24:2007/12/28:getresgid32:2:getresgid:2: +¡û:LDP man-pages:3.24:2007/12/28:getresuid:2:2003/11/13::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2007/12/28:getresuid32:2:getresuid:2: +¡û:LDP man-pages:3.24:2008/10/06:getrlimit:2:2008/08/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/08/25:getrusage:2:2008/11/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/12/05:getsid:2:2002/02/03::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2008/12/03:getsockname:2:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/12/03:getsockopt:2:2008/07/24::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2008/04/14:gettid:2:2003/09/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/03/25:gettimeofday:2:2006/07/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1993/07/23:getuid:2:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:1993/07/23:getuid32:2:getuid:2: +¡û:LDP man-pages:3.24:2001/12/01:getxattr:2:2003/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/05:gtty:2:unimplemented:2: +¡û:LDP man-pages:3.24:1994/08/21:idle:2:2000/01/14::argrath@yo.rim.or.jp:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:1995/11/29:inb:2:outb:2: +¡÷:LDP man-pages:3.24:1995/11/29:inb_p:2:outb:2: +¡û:LDP man-pages:3.24:0000/00/00:init_module:2:2006/07/30::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:1995/11/29:inl:2:outb:2: +¡÷:LDP man-pages:3.24:1995/11/29:inl_p:2:outb:2: +¡û:LDP man-pages:3.24:2006/02/07:inotify_add_watch:2:2006/08/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/10/10:inotify_init:2:2006/08/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/10/10:inotify_init1:2:inotify_init:2: +¡û:LDP man-pages:3.24:2006/02/07:inotify_rm_watch:2:2006/08/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:1995/11/29:insb:2:outb:2: +¡÷:LDP man-pages:3.24:1995/11/29:insl:2:outb:2: +¡÷:LDP man-pages:3.24:1995/11/29:insw:2:outb:2: +¡û:LDP man-pages:3.24:2010/02/03:intro:2:2006/04/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:1995/11/29:inw:2:outb:2: +¡÷:LDP man-pages:3.24:1995/11/29:inw_p:2:outb:2: +¡û:LDP man-pages:3.24:2008/06/18:io_cancel:2:2003/03/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/06/18:io_destroy:2:2003/03/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/07/04:io_getevents:2:2003/03/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/06/18:io_setup:2:2003/03/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/06/18:io_submit:2:2003/03/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2000/09/21:ioctl:2:2005/02/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/12/29:ioctl_list:2:2004/06/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/06/15:ioperm:2:2007/01/07::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2004/12/26:iopl:2:2005/02/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/07/09:ioprio_get:2:ioprio_set:2: +¡û:LDP man-pages:3.24:2008/07/09:ioprio_set:2:2007/01/08::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/06/28:ipc:2:1997/02/23::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡ß:LDP man-pages:3.24:2010/02/25:keyctl:2::::: +¡û:LDP man-pages:3.24:2009/09/15:kill:2:2005/12/05::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:killpg:2:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/06/16:lchown:2:chown:2: +¡÷:LDP man-pages:3.24:2008/06/16:lchown32:2:lchown:2: +¡÷:LDP man-pages:3.24:2001/12/01:lgetxattr:2:getxattr:2: +¡û:LDP man-pages:3.24:2008/08/21:link:2:2005/05/12::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2009/12/13:linkat:2:2007/01/21::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/11/20:listen:2:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2001/12/01:listxattr:2:2003/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2001/12/01:llistxattr:2:listxattr:2: +¡û:LDP man-pages:3.24:1995/06/10:llseek:2:2005/01/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2007/07/05:lock:2:unimplemented:2: +¡û:LDP man-pages:3.24:2004/06/17:lookup_dcookie:2:2005/02/26::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2001/12/01:lremovexattr:2:removexattr:2: +¡û:LDP man-pages:3.24:2001/09/24:lseek:2:2006/03/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2001/12/31:lsetxattr:2:setxattr:2: +¡÷:LDP man-pages:3.24:2009/09/30:lstat:2:stat:2: +¡÷:LDP man-pages:3.24:2009/01/22:lstat64:2:lstat:2: +¡û:LDP man-pages:3.24:2008/04/22:madvise:2:2007/01/08::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/05:madvise1:2:unimplemented:2: +¡û:LDP man-pages:3.24:2008/08/15:mbind:2:2008/11/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/04/22:mincore:2:2007/05/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/05/13:mkdir:2:2008/10/08::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/12/13:mkdirat:2:2006/10/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/12/01:mknod:2:2005/09/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/12/13:mknodat:2:2006/10/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/09/25:mlock:2:2006/02/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/09/25:mlockall:2:mlock:2: +¡û:LDP man-pages:3.24:2009/09/26:mmap:2:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/04/22:mmap2:2:2007/10/11::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/06/01:modify_ldt:2:2007/06/18::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/06/26:mount:2:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/10/06:move_pages:2:2008/11/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/06:mprotect:2:2007/06/13::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/05:mpx:2:unimplemented:2: +¡û:LDP man-pages:3.24:2007/06/01:mq_getsetattr:2:2006/07/30::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/09/15:mq_notify:2:mq_notify:3: +¡÷:LDP man-pages:3.24:2009/02/20:mq_open:2:mq_open:3: +¡÷:LDP man-pages:3.24:2010/02/25:mq_timedreceive:2:mq_receive:3: +¡÷:LDP man-pages:3.24:2010/02/25:mq_timedsend:2:mq_send:3: +¡÷:LDP man-pages:3.24:2006/02/25:mq_unlink:2:mq_unlink:3: +¡û:LDP man-pages:3.24:2005/09/13:mremap:2:2006/04/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/06:msgctl:2:2005/10/11::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2004/05/27:msgget:2:2005/03/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/04/23:msgop:2:2006/03/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/04/23:msgrcv:2:msgop:2: +¡÷:LDP man-pages:3.24:2008/04/23:msgsnd:2:msgop:2: +¡û:LDP man-pages:3.24:2008/04/22:msync:2:2008/07/24::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/09/25:munlock:2:mlock:2: +¡÷:LDP man-pages:3.24:2008/09/25:munlockall:2:mlock:2: +¡÷:LDP man-pages:3.24:2009/09/26:munmap:2:mmap:2: +¡û:LDP man-pages:3.24:2009/01/19:nanosleep:2:2008/08/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1997/07/16:nfsservctl:2:1997/08/30::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:2007/07/26:nice:2:2005/10/08::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/09/30:oldfstat:2:stat:2: +¡÷:LDP man-pages:3.24:2009/09/30:oldlstat:2:stat:2: +¡÷:LDP man-pages:3.24:2008/12/03:oldolduname:2:uname:2: +¡÷:LDP man-pages:3.24:2009/09/30:oldstat:2:stat:2: +¡÷:LDP man-pages:3.24:2008/12/03:olduname:2:uname:2: +¡û:LDP man-pages:3.24:2009/09/20:open:2:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/12/13:openat:2:2006/10/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:1995/11/29:outb:2:2005/10/30::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:1995/11/29:outb_p:2:outb:2: +¡÷:LDP man-pages:3.24:1995/11/29:outl:2:outb:2: +¡÷:LDP man-pages:3.24:1995/11/29:outl_p:2:outb:2: +¡÷:LDP man-pages:3.24:1995/11/29:outsb:2:outb:2: +¡÷:LDP man-pages:3.24:1995/11/29:outsl:2:outb:2: +¡÷:LDP man-pages:3.24:1995/11/29:outsw:2:outb:2: +¡÷:LDP man-pages:3.24:1995/11/29:outw:2:outb:2: +¡÷:LDP man-pages:3.24:1995/11/29:outw_p:2:outb:2: +¡÷:LDP man-pages:3.24:2009/12/05:path_resolution:2:path_resolution:7: +¡û:LDP man-pages:3.24:2008/10/06:pause:2:1997/06/27::suto@av.crl.sony.co.jp:SUTO, Mitsuaki: +¡÷:LDP man-pages:3.24:2003/07/14:pciconfig_iobase:2:pciconfig_read:2: +¡û:LDP man-pages:3.24:2003/07/14:pciconfig_read:2:2004/07/18::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2003/07/14:pciconfig_write:2:pciconfig_read:2: +¡û:LDP man-pages:3.24:2003/01/01:personality:2:2003/09/14::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/09/15:pipe:2:2008/11/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/09/15:pipe2:2:pipe:2: +¡û:LDP man-pages:3.24:2007/06/01:pivot_root:2:2000/06/14::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2009/09/15:poll:2:2006/07/26::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2003/02/14:posix_fadvise:2:2007/02/08::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2009/09/15:ppoll:2:poll:2: +¡û:LDP man-pages:3.24:2008/07/16:prctl:2:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/12/03:pread:2:1999/06/25::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡÷:LDP man-pages:3.24:2008/12/03:pread64:2:pread:2: +¡÷:LDP man-pages:3.24:2007/07/05:prof:2:unimplemented:2: +¡÷:LDP man-pages:3.24:2008/12/05:pselect:2:select:2: +¡÷:LDP man-pages:3.24:2008/12/05:pselect6:2:select:2: +¡û:LDP man-pages:3.24:2009/03/30:ptrace:2:2007/05/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/05:putpmsg:2:unimplemented:2: +¡÷:LDP man-pages:3.24:2008/12/03:pwrite:2:pread:2: +¡÷:LDP man-pages:3.24:2008/12/03:pwrite64:2:pwrite:2: +¡û:LDP man-pages:3.24:0000/00/00:query_module:2:2006/07/30::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/06/01:quotactl:2:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2009/02/23:read:2:2005/10/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:readahead:2:2005/02/27::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/10/02:readdir:2:1997/02/23::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:2007/07/26:readlink:2:2006/07/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/12/13:readlinkat:2:2006/10/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2002/10/17:readv:2:2007/06/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/02/11:reboot:2:2008/07/24::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/03/10:recv:2:2008/12/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/03/10:recvfrom:2:recv:2: +¡÷:LDP man-pages:3.24:2009/03/10:recvmsg:2:recv:2: +¡û:LDP man-pages:3.24:2008/04/22:remap_file_pages:2:2005/10/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2001/12/01:removexattr:2:2003/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/03/30:rename:2:2007/05/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/12/13:renameat:2:2006/10/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡ß:LDP man-pages:3.24:2010/02/25:request_key:2::::: +¡û:LDP man-pages:3.24:2008/05/08:rmdir:2:2006/07/26::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/07/25:rt_sigaction:2:sigaction:2: +¡÷:LDP man-pages:3.24:2008/10/04:rt_sigpending:2:sigpending:2: +¡÷:LDP man-pages:3.24:2008/10/17:rt_sigprocmask:2:sigprocmask:2: +¡÷:LDP man-pages:3.24:2007/07/26:rt_sigqueueinfo:2:sigqueue:2: +¡÷:LDP man-pages:3.24:2008/06/26:rt_sigreturn:2:sigreturn:2: +¡÷:LDP man-pages:3.24:2005/09/15:rt_sigsuspend:2:sigsuspend:2: +¡÷:LDP man-pages:3.24:2008/10/04:rt_sigtimedwait:2:sigtimedwait:2: +¡÷:LDP man-pages:3.24:2008/06/18:sbrk:2:brk:2: +¡û:LDP man-pages:3.24:2006/03/23:sched_get_priority_max:2:2006/04/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2006/03/23:sched_get_priority_min:2:sched_get_priority_max:2: +¡÷:LDP man-pages:3.24:2008/11/14:sched_getaffinity:2:sched_setaffinity:2: +¡÷:LDP man-pages:3.24:2006/03/23:sched_getparam:2:sched_setparam:2: +¡÷:LDP man-pages:3.24:2008/11/06:sched_getscheduler:2:sched_setscheduler:2: +¡û:LDP man-pages:3.24:2007/04/06:sched_rr_get_interval:2:2007/06/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/11/14:sched_setaffinity:2:2008/12/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2006/03/23:sched_setparam:2:2006/04/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/11/06:sched_setscheduler:2:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/10/18:sched_yield:2:1997/02/23::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡÷:LDP man-pages:3.24:2007/07/05:security:2:unimplemented:2: +¡û:LDP man-pages:3.24:2008/12/05:select:2:2007/10/11::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/01/26:select_tut:2:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/09/27:semctl:2:2005/10/11::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2004/05/27:semget:2:2006/07/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/10/04:semop:2:2007/05/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/10/04:semtimedop:2:semop:2: +¡û:LDP man-pages:3.24:2009/02/23:send:2:2006/04/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2010/02/15:sendfile:2:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2010/02/15:sendfile64:2:sendfile:2: +¡÷:LDP man-pages:3.24:2009/02/23:sendmsg:2:send:2: +¡÷:LDP man-pages:3.24:2009/02/23:sendto:2:send:2: +¡û:LDP man-pages:3.24:2008/08/15:set_mempolicy:2:2008/11/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/11/27:set_thread_area:2:2003/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2004/09/10:set_tid_address:2:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2009/03/15:setcontext:2:getcontext:2: +¡÷:LDP man-pages:3.24:2009/09/27:setdomainname:2:getdomainname:2: +¡÷:LDP man-pages:3.24:2009/10/17:setegid:2:seteuid:2: +¡û:LDP man-pages:3.24:2009/10/17:seteuid:2:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/12/05:setfsgid:2:2005/02/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/12/05:setfsgid32:2:setfsgid:2: +¡û:LDP man-pages:3.24:2008/12/05:setfsuid:2:2005/02/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/12/05:setfsuid32:2:setfsuid:2: +¡û:LDP man-pages:3.24:2009/10/17:setgid:2:2003/02/14::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2009/10/17:setgid32:2:setgid:2: +¡÷:LDP man-pages:3.24:2008/06/03:setgroups:2:getgroups:2: +¡÷:LDP man-pages:3.24:2008/06/03:setgroups32:2:setgroups:2: +¡÷:LDP man-pages:3.24:2009/01/13:sethostid:2:gethostid:3: +¡÷:LDP man-pages:3.24:2008/11/27:sethostname:2:gethostname:2: +¡÷:LDP man-pages:3.24:2009/03/15:setitimer:2:getitimer:2: +¡û:LDP man-pages:3.24:2009/09/20:setpgid:2:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/09/20:setpgrp:2:setpgid:2: +¡÷:LDP man-pages:3.24:2008/05/29:setpriority:2:getpriority:2: +¡÷:LDP man-pages:3.24:2009/10/17:setregid:2:setreuid:2: +¡÷:LDP man-pages:3.24:2009/10/17:setregid32:2:setregid:2: +¡÷:LDP man-pages:3.24:2007/07/26:setresgid:2:setresuid:2: +¡÷:LDP man-pages:3.24:2007/07/26:setresgid32:2:setresgid:2: +¡û:LDP man-pages:3.24:2007/07/26:setresuid:2:2005/11/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/26:setresuid32:2:setresuid:2: +¡û:LDP man-pages:3.24:2009/10/17:setreuid:2:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/10/17:setreuid32:2:setreuid:2: +¡÷:LDP man-pages:3.24:2008/10/06:setrlimit:2:getrlimit:2: +¡û:LDP man-pages:3.24:2008/12/03:setsid:2:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/12/03:setsockopt:2:getsockopt:2: +¡÷:LDP man-pages:3.24:2009/03/25:settimeofday:2:gettimeofday:2: +¡û:LDP man-pages:3.24:2010/02/21:setuid:2:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2010/02/21:setuid32:2:setuid:2: +¡û:LDP man-pages:3.24:2008/12/03:setup:2:2008/07/24::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2001/12/31:setxattr:2:2003/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/05:sgetmask:2:2007/10/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/06/03:shmat:2:shmop:2: +¡û:LDP man-pages:3.24:2008/08/07:shmctl:2:2006/07/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/06/03:shmdt:2:shmop:2: +¡û:LDP man-pages:3.24:2006/05/02:shmget:2:2006/07/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/06/03:shmop:2:2006/04/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/12/03:shutdown:2:2001/11/09::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/07/25:sigaction:2:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/10/04:sigaltstack:2:2006/01/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/07/11:signal:2:2007/06/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/01/13:signalfd:2:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/01/13:signalfd4:2:signalfd:2: +¡û:LDP man-pages:3.24:2008/10/04:sigpending:2:2005/12/05::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/10/17:sigprocmask:2:2005/10/05::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:sigqueue:2:2007/10/11::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/06/26:sigreturn:2:2005/09/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2005/09/15:sigsuspend:2:2005/10/05::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/10/04:sigtimedwait:2:sigwaitinfo:2: +¡û:LDP man-pages:3.24:2008/10/04:sigwaitinfo:2:2006/07/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/01/19:socket:2:2008/11/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/06/28:socketcall:2:1997/03/03::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:2008/10/11:socketpair:2:2002/09/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/09/15:splice:2:2007/02/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡ù:LDP man-pages:2.67=>3.24:2007/12/20:spu_create:2:2007/10/23::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/11/25:spu_run:2:2007/10/23::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/05:ssetmask:2:sgetmask:2: +¡û:LDP man-pages:3.24:2009/09/30:stat:2:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/09/30:stat64:2:stat:2: +¡û:LDP man-pages:3.24:2004/06/23:statfs:2:2006/07/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2004/06/23:statfs64:2:statfs:2: +¡û:LDP man-pages:3.24:2003/08/22:statvfs:2:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2010/02/25:stime:2:2003/09/14::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2007/07/05:stty:2:unimplemented:2: +¡÷:LDP man-pages:3.24:2007/06/22:swapoff:2:swapon:2: +¡û:LDP man-pages:3.24:2007/06/22:swapon:2:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/07/26:symlink:2:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2009/12/13:symlinkat:2:2006/10/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/07/26:sync:2:2003/09/14::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2010/01/17:sync_file_range:2:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:syscall:2:2002/08/20::ysato@h4.dion.ne.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2009/05/06:syscalls:2:2007/10/11::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/11/20:sysctl:2:1999/12/03::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:1995/08/09:sysfs:2:2001/06/02::ysato@h4.dion.ne.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/11/15:sysinfo:2:2000/09/23::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:2008/06/20:syslog:2:2008/04/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/09/15:tee:2:2007/02/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/10/01:tgkill:2:tkill:2: +¡û:LDP man-pages:3.24:2010/02/25:time:2:1999/07/27::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡ß:LDP man-pages:3.24:2009/02/20:timer_create:2::::: +¡ß:LDP man-pages:3.24:2009/02/20:timer_delete:2::::: +¡ß:LDP man-pages:3.24:2009/02/20:timer_getoverrun:2::::: +¢¨:LDP man-pages:3.24:2009/02/20:timer_gettime:2:timer_settime:2: +¡ß:LDP man-pages:3.24:2009/02/20:timer_settime:2::::: +¡û:LDP man-pages:3.24:2009/03/10:timerfd_create:2:2008/11/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/03/10:timerfd_gettime:2:timerfd_create:2: +¡÷:LDP man-pages:3.24:2009/03/10:timerfd_settime:2:timerfd_create:2: +¡û:LDP man-pages:3.24:2008/06/25:times:2:2008/02/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/10/01:tkill:2:2005/03/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/02/28:truncate:2:2006/07/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/02/28:truncate64:2:truncate:2: +¡÷:LDP man-pages:3.24:2007/07/05:tuxcall:2:unimplemented:2: +¡÷:LDP man-pages:3.24:2008/10/06:ugetrlimit:2:getrlimit:2: +¡û:LDP man-pages:3.24:2008/01/09:umask:2:2008/02/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/09/03:umount:2:2008/11/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/09/03:umount2:2:umount:2: +¡û:LDP man-pages:3.24:2008/12/03:uname:2:2002/02/14::ysato@h4.dion.ne.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/07/05:unimplemented:2:2003/03/06::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:2004/06/23:unlink:2:2006/04/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/12/13:unlinkat:2:2006/10/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/11/20:unshare:2:2006/08/19::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2005/01/09:uselib:2:2005/04/21::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2003/08/04:ustat:2:2004/06/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/06/19:utime:2:2006/10/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡ß:LDP man-pages:3.24:2009/12/13:utimensat:2::::: +¡÷:LDP man-pages:3.24:2008/06/19:utimes:2:utime:2: +¡û:LDP man-pages:3.24:2009/06/21:vfork:2:2008/11/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:vhangup:2:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2009/02/20:vm86:2:2004/06/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2009/02/20:vm86old:2:vm86:2: +¡û:LDP man-pages:3.24:2009/09/15:vmsplice:2:2007/02/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/05:vserver:2:unimplemented:2: +¡û:LDP man-pages:3.24:2009/04/21:wait:2:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/09/28:wait3:2:wait4:2: +¡û:LDP man-pages:3.24:2008/09/28:wait4:2:2005/03/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/04/21:waitid:2:wait:2: +¡÷:LDP man-pages:3.24:2009/04/21:waitpid:2:wait:2: +¡û:LDP man-pages:3.24:2009/02/23:write:2:2007/05/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2002/10/17:writev:2:readv:2: +¡÷:LDP man-pages:3.24:2008/11/20:CMSG_ALIGN:3:cmsg:3: +¡÷:LDP man-pages:3.24:2008/11/20:CMSG_FIRSTHDR:3:cmsg:3: +¡÷:LDP man-pages:3.24:2008/11/20:CMSG_NXTHDR:3:cmsg:3: +¡÷:LDP man-pages:3.24:2008/11/20:CMSG_SPACE:3:cmsg:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_ALLOC:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_ALLOC_SIZE:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_AND:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_AND_S:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_CLR:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_CLR_S:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_COUNT:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_COUNT_S:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_EQUAL:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_EQUAL_S:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_FREE:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_ISSET:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_ISSET_S:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_OR:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_OR_S:3:CPU_SET:3: +¡ß:LDP man-pages:3.24:2010/02/21:CPU_SET:3::::: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_SET_S:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_XOR:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_XOR_S:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_ZERO:3:CPU_SET:3: +¢¨:LDP man-pages:3.24:2010/02/21:CPU_ZERO_S:3:CPU_SET:3: +¡÷:LDP man-pages:3.24:2008/12/05:FD_CLR:3:select:2: +¡÷:LDP man-pages:3.24:2008/12/05:FD_ISSET:3:select:2: +¡÷:LDP man-pages:3.24:2008/12/05:FD_SET:3:select:2: +¡÷:LDP man-pages:3.24:2008/12/05:FD_ZERO:3:select:2: +¡÷:LDP man-pages:3.24:2007/07/26:HUGE_VAL:3:INFINITY:3: +¡÷:LDP man-pages:3.24:2007/07/26:HUGE_VALF:3:INFINITY:3: +¡÷:LDP man-pages:3.24:2007/07/26:HUGE_VALL:3:INFINITY:3: +¡û:LDP man-pages:3.24:2007/07/26:INFINITY:3:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:1999/07/04:MB_CUR_MAX:3:1999/09/11::cz8cb01@linux.or.jp:HAYAKAWA Hitoshi: +¡û:LDP man-pages:3.24:1999/07/04:MB_LEN_MAX:3:1999/09/11::cz8cb01@linux.or.jp:HAYAKAWA Hitoshi: +¡÷:LDP man-pages:3.24:2007/07/26:NAN:3:INFINITY:3: +¡÷:LDP man-pages:3.24:2001/12/16:__fbufsize:3:stdio_ext:3: +¡÷:LDP man-pages:3.24:2001/12/16:__flbf:3:stdio_ext:3: +¡÷:LDP man-pages:3.24:2001/12/16:__fpending:3:stdio_ext:3: +¡÷:LDP man-pages:3.24:2001/12/15:__fpurge:3:fpurge:3: +¡÷:LDP man-pages:3.24:2001/12/16:__freadable:3:stdio_ext:3: +¡÷:LDP man-pages:3.24:2001/12/16:__freading:3:stdio_ext:3: +¡÷:LDP man-pages:3.24:2001/12/16:__fsetlocking:3:stdio_ext:3: +¡÷:LDP man-pages:3.24:2001/12/16:__fwritable:3:stdio_ext:3: +¡÷:LDP man-pages:3.24:2001/12/16:__fwriting:3:stdio_ext:3: +¡÷:LDP man-pages:3.24:2002/07/20:__malloc_hook:3:malloc_hook:3: +¡û:LDP man-pages:3.24:1997/03/08:__setfpucw:3:2000/09/20::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡÷:LDP man-pages:3.24:2001/12/16:_flushlbf:3:stdio_ext:3: +¡û:LDP man-pages:3.24:2007/07/26:a64l:3:2004/01/17::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/12/15:abort:3:1998/02/18::tyoshino@eng.toyo.ac.jp:Takashi Yoshino: +¡û:LDP man-pages:3.24:2007/07/26:abs:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2008/08/05:acos:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:acosf:3:acos:3: +¡û:LDP man-pages:3.24:2008/08/05:acosh:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:acoshf:3:acosh:3: +¡÷:LDP man-pages:3.24:2008/08/05:acoshl:3:acosh:3: +¡÷:LDP man-pages:3.24:2008/08/05:acosl:3:acos:3: +¡÷:LDP man-pages:3.24:2009/09/15:addmntent:3:getmntent:3: +¡û:LDP man-pages:3.24:2008/06/14:addseverity:3:2004/07/18::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/06/22:adjtime:3:2006/07/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2003/11/14:aio_cancel:3:2004/07/18::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2003/11/14:aio_error:3:2004/07/18::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2003/11/14:aio_fsync:3:2004/07/18::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2003/11/14:aio_read:3:2004/07/18::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2003/11/14:aio_return:3:2004/07/18::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2003/11/14:aio_suspend:3:2004/07/18::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2003/11/14:aio_write:3:2004/07/18::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/01/24:alloca:3:2002/09/19::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2009/02/10:alphasort:3:scandir:3: +¡÷:LDP man-pages:3.24:2007/05/18:argz:3:argz_add:3: +¡û:LDP man-pages:3.24:2007/05/18:argz_add:3:2003/03/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/05/18:argz_add_sep:3:argz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:argz_append:3:argz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:argz_count:3:argz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:argz_create:3:argz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:argz_create_sep:3:argz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:argz_delete:3:argz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:argz_extract:3:argz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:argz_insert:3:argz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:argz_next:3:argz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:argz_replace:3:argz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:argz_stringify:3:argz_add:3: +¡÷:LDP man-pages:3.24:2010/02/25:asctime:3:ctime:3: +¡÷:LDP man-pages:3.24:2010/02/25:asctime_r:3:ctime:3: +¡û:LDP man-pages:3.24:2008/08/05:asin:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:asinf:3:asin:3: +¡û:LDP man-pages:3.24:2008/08/05:asinh:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:asinhf:3:asinh:3: +¡÷:LDP man-pages:3.24:2008/08/05:asinhl:3:asinh:3: +¡÷:LDP man-pages:3.24:2008/08/05:asinl:3:asin:3: +¡û:LDP man-pages:3.24:2001/12/18:asprintf:3:2002/01/14::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2002/08/25:assert:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2002/08/25:assert_perror:3:2003/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/12/02:atan:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/11/20:atan2:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/11/20:atan2f:3:atan2:3: +¡÷:LDP man-pages:3.24:2008/11/20:atan2l:3:atan2:3: +¡÷:LDP man-pages:3.24:2008/12/02:atanf:3:atan:3: +¡û:LDP man-pages:3.24:2008/08/05:atanh:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:atanhf:3:atanh:3: +¡÷:LDP man-pages:3.24:2008/08/05:atanhl:3:atanh:3: +¡÷:LDP man-pages:3.24:2008/12/02:atanl:3:atan:3: +¡û:LDP man-pages:3.24:2008/12/05:atexit:3:2009/01/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1993/03/29:atof:3:1998/02/18::tyoshino@eng.toyo.ac.jp:Takashi Yoshino: +¡û:LDP man-pages:3.24:2007/07/26:atoi:3:2001/02/09::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2007/07/26:atol:3:atoi:3: +¡÷:LDP man-pages:3.24:2007/07/26:atoll:3:atoi:3: +¡÷:LDP man-pages:3.24:2007/07/26:atoq:3:atoi:3: +¡÷:LDP man-pages:3.24:2008/07/17:auth_destroy:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:authnone_create:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:authunix_create:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:authunix_create_default:3:rpc:3: +¡û:LDP man-pages:3.24:2008/06/14:backtrace:3:2007/10/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/06/14:backtrace_symbols:3:backtrace:3: +¡÷:LDP man-pages:3.24:2008/06/14:backtrace_symbols_fd:3:backtrace:3: +¡û:LDP man-pages:3.24:2009/03/30:basename:3:2007/05/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/06:bcmp:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/03/15:bcopy:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¢¨:LDP man-pages:3.24:2009/01/19:be16toh:3:endian:3: +¢¨:LDP man-pages:3.24:2009/01/19:be32toh:3:endian:3: +¢¨:LDP man-pages:3.24:2009/01/19:be64toh:3:endian:3: +¡û:LDP man-pages:3.24:2008/12/03:bindresvport:3:2007/06/13::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/03/15:bsd_signal:3:2007/06/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2003/11/01:bsearch:3:2005/02/26::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2004/12/26:bstring:3:2003/11/13::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/02/04:btowc:3:1999/09/11::cz8cb01@linux.or.jp:HAYAKAWA Hitoshi: +¡û:LDP man-pages:3.24:1994/08/18:btree:3:1999/08/16::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2009/01/15:byteorder:3:2005/11/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2002/12/31:bzero:3:2003/03/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/12/26:cabs:3:2003/07/23::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:cabsf:3:cabs:3: +¡÷:LDP man-pages:3.24:2007/12/26:cabsl:3:cabs:3: +¡û:LDP man-pages:3.24:2007/12/26:cacos:3:2003/09/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:cacosf:3:cacos:3: +¡û:LDP man-pages:3.24:2008/08/11:cacosh:3:2003/09/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:cacoshf:3:cacosh:3: +¡÷:LDP man-pages:3.24:2008/08/11:cacoshl:3:cacosh:3: +¡÷:LDP man-pages:3.24:2007/12/26:cacosl:3:cacos:3: +¡÷:LDP man-pages:3.24:2009/01/13:calloc:3:malloc:3: +¡÷:LDP man-pages:3.24:2008/07/17:callrpc:3:rpc:3: +¡û:LDP man-pages:3.24:2005/07/14:canonicalize_file_name:3:2005/09/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/12/26:carg:3:2003/09/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:cargf:3:carg:3: +¡÷:LDP man-pages:3.24:2007/12/26:cargl:3:carg:3: +¡û:LDP man-pages:3.24:2007/12/26:casin:3:2003/09/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:casinf:3:casin:3: +¡û:LDP man-pages:3.24:2007/12/26:casinh:3:2003/09/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:casinhf:3:casinh:3: +¡÷:LDP man-pages:3.24:2007/12/26:casinhl:3:casinh:3: +¡÷:LDP man-pages:3.24:2007/12/26:casinl:3:casin:3: +¡û:LDP man-pages:3.24:2007/12/26:catan:3:2003/09/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:catanf:3:catan:3: +¡û:LDP man-pages:3.24:2007/12/26:catanh:3:2003/09/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:catanhf:3:catanh:3: +¡÷:LDP man-pages:3.24:2007/12/26:catanhl:3:catanh:3: +¡÷:LDP man-pages:3.24:2007/12/26:catanl:3:catan:3: +¡÷:LDP man-pages:3.24:2001/12/14:catclose:3:catopen:3: +¡û:LDP man-pages:3.24:1998/08/09:catgets:3:1999/03/01::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2001/12/14:catopen:3:2002/01/14::ysato@h4.dion.ne.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2007/05/18:cbc_crypt:3:des_crypt:3: +¡û:LDP man-pages:3.24:2008/08/05:cbrt:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:cbrtf:3:cbrt:3: +¡÷:LDP man-pages:3.24:2008/08/05:cbrtl:3:cbrt:3: +¡û:LDP man-pages:3.24:2007/12/26:ccos:3:2003/07/28::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:ccosf:3:ccos:3: +¡û:LDP man-pages:3.24:2007/12/26:ccosh:3:2003/09/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:ccoshf:3:ccosh:3: +¡÷:LDP man-pages:3.24:2007/12/26:ccoshl:3:ccosh:3: +¡÷:LDP man-pages:3.24:2007/12/26:ccosl:3:ccos:3: +¡û:LDP man-pages:3.24:2008/08/05:ceil:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:ceilf:3:ceil:3: +¡÷:LDP man-pages:3.24:2008/08/05:ceill:3:ceil:3: +¡û:LDP man-pages:3.24:2007/12/26:cerf:3:2005/02/26::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:cerfc:3:cerf:3: +¡÷:LDP man-pages:3.24:2007/12/26:cerfcf:3:cerf:3: +¡÷:LDP man-pages:3.24:2007/12/26:cerfcl:3:cerf:3: +¡÷:LDP man-pages:3.24:2007/12/26:cerff:3:cerf:3: +¡÷:LDP man-pages:3.24:2007/12/26:cerfl:3:cerf:3: +¡û:LDP man-pages:3.24:2007/12/26:cexp:3:2003/08/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2002/07/28:cexp2:3:2005/03/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2002/07/28:cexp2f:3:cexp2:3: +¡÷:LDP man-pages:3.24:2002/07/28:cexp2l:3:cexp2:3: +¡÷:LDP man-pages:3.24:2007/12/26:cexpf:3:cexp:3: +¡÷:LDP man-pages:3.24:2007/12/26:cexpl:3:cexp:3: +¡÷:LDP man-pages:3.24:2007/11/26:cfgetispeed:3:termios:3: +¡÷:LDP man-pages:3.24:2007/11/26:cfgetospeed:3:termios:3: +¡÷:LDP man-pages:3.24:2007/11/26:cfmakeraw:3:termios:3: +¡û:LDP man-pages:3.24:2007/07/26:cfree:3:2004/08/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2007/11/26:cfsetispeed:3:termios:3: +¡÷:LDP man-pages:3.24:2007/11/26:cfsetospeed:3:termios:3: +¡÷:LDP man-pages:3.24:2007/11/26:cfsetspeed:3:termios:3: +¡û:LDP man-pages:3.24:2007/12/23:cimag:3:2003/09/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/23:cimagf:3:cimag:3: +¡÷:LDP man-pages:3.24:2007/12/23:cimagl:3:cimag:3: +¡û:LDP man-pages:3.24:2007/07/26:clearenv:3:2002/08/20::ysato@h4.dion.ne.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/08/29:clearerr:3:ferror:3: +¡÷:LDP man-pages:3.24:2008/08/29:clearerr_unlocked:3:unlocked_stdio:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnt_broadcast:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnt_call:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnt_control:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnt_create:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnt_destroy:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnt_freeres:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnt_geterr:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnt_pcreateerror:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnt_perrno:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnt_perror:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnt_spcreateerror:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnt_sperrno:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnt_sperror:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clntraw_create:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clnttcp_create:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clntudp_bufcreate:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:clntudp_create:3:rpc:3: +¡û:LDP man-pages:3.24:2008/08/28:clock:3:2007/06/01::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡ß:LDP man-pages:3.24:2009/02/20:clock_getcpuclockid:3::::: +¡÷:LDP man-pages:3.24:2010/02/03:clock_getres:3:clock_getres:2: +¡÷:LDP man-pages:3.24:2010/02/03:clock_gettime:3:clock_getres:2: +¡÷:LDP man-pages:3.24:2010/02/03:clock_settime:3:clock_getres:2: +¡û:LDP man-pages:3.24:2007/12/26:clog:3:2003/09/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2002/07/28:clog10:3:2007/01/07::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2002/07/28:clog10f:3:clog10:3: +¡÷:LDP man-pages:3.24:2002/07/28:clog10l:3:clog10:3: +¡û:LDP man-pages:3.24:2002/07/28:clog2:3:2007/01/07::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2002/07/28:clog2f:3:clog2:3: +¡÷:LDP man-pages:3.24:2002/07/28:clog2l:3:clog2:3: +¡÷:LDP man-pages:3.24:2007/12/26:clogf:3:clog:3: +¡÷:LDP man-pages:3.24:2007/12/26:clogl:3:clog:3: +¡û:LDP man-pages:3.24:2008/09/23:closedir:3:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/11/12:closelog:3:syslog:3: +¡û:LDP man-pages:3.24:2008/11/20:cmsg:3:1999/08/17::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2010/02/03:confstr:3:2006/07/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/12/26:conj:3:2003/09/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:conjf:3:conj:3: +¡÷:LDP man-pages:3.24:2007/12/26:conjl:3:conj:3: +¡û:LDP man-pages:3.24:2008/08/05:copysign:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:copysignf:3:copysign:3: +¡÷:LDP man-pages:3.24:2008/08/05:copysignl:3:copysign:3: +¡û:LDP man-pages:3.24:2009/02/04:cos:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/02/04:cosf:3:cos:3: +¡û:LDP man-pages:3.24:2008/08/10:cosh:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/10:coshf:3:cosh:3: +¡÷:LDP man-pages:3.24:2008/08/10:coshl:3:cosh:3: +¡÷:LDP man-pages:3.24:2009/02/04:cosl:3:cos:3: +¡û:LDP man-pages:3.24:2002/07/28:cpow:3:2003/09/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2002/07/28:cpowf:3:cpow:3: +¡÷:LDP man-pages:3.24:2002/07/28:cpowl:3:cpow:3: +¡û:LDP man-pages:3.24:2002/07/28:cproj:3:2005/03/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2002/07/28:cprojf:3:cproj:3: +¡÷:LDP man-pages:3.24:2002/07/28:cprojl:3:cproj:3: +¡û:LDP man-pages:3.24:2007/12/26:creal:3:2003/07/28::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:crealf:3:creal:3: +¡÷:LDP man-pages:3.24:2007/12/26:creall:3:creal:3: +¡û:LDP man-pages:3.24:2008/08/25:crypt:3:2008/10/08::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/08/25:crypt_r:3:crypt:3: +¡û:LDP man-pages:3.24:2007/12/26:csin:3:2003/07/28::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:csinf:3:csin:3: +¡û:LDP man-pages:3.24:2007/12/26:csinh:3:2003/09/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:csinhf:3:csinh:3: +¡÷:LDP man-pages:3.24:2007/12/26:csinhl:3:csinh:3: +¡÷:LDP man-pages:3.24:2007/12/26:csinl:3:csin:3: +¡û:LDP man-pages:3.24:2008/08/11:csqrt:3:2003/08/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:csqrtf:3:csqrt:3: +¡÷:LDP man-pages:3.24:2008/08/11:csqrtl:3:csqrt:3: +¡û:LDP man-pages:3.24:2007/12/26:ctan:3:2005/02/21::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:ctanf:3:ctan:3: +¡û:LDP man-pages:3.24:2007/12/26:ctanh:3:2005/02/21::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/26:ctanhf:3:ctanh:3: +¡÷:LDP man-pages:3.24:2007/12/26:ctanhl:3:ctanh:3: +¡÷:LDP man-pages:3.24:2007/12/26:ctanl:3:ctan:3: +¡û:LDP man-pages:3.24:2007/07/26:ctermid:3:1997/2/10::nagoya@cc.hit-u.ac.jp:NAGOYA Hiroaki: +¡û:LDP man-pages:3.24:2010/02/25:ctime:3:2008/11/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2010/02/25:ctime_r:3:ctime:3: +¡÷:LDP man-pages:3.24:2008/06/29:cuserid:3:getlogin:3: +¡û:LDP man-pages:3.24:2009/12/05:daemon:3:2002/01/14::ysato@h4.dion.ne.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2010/02/25:daylight:3:tzset:3: +¡÷:LDP man-pages:3.24:1994/01/02:db:3:dbopen:3: +¡û:LDP man-pages:3.24:1994/01/02:dbopen:3:1999/08/19::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2007/05/18:des_crypt:3:2004/08/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2007/05/18:des_setparity:3:des_crypt:3: +¡û:LDP man-pages:3.24:2010/02/25:difftime:3:2006/07/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/21:dirfd:3:2003/10/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2009/03/30:dirname:3:basename:3: +¡û:LDP man-pages:3.24:2007/07/26:div:3:2004/06/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/05/18:dl_iterate_phdr:3:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/12/06:dladdr:3:dlopen:3: +¡÷:LDP man-pages:3.24:2008/12/06:dlclose:3:dlopen:3: +¡÷:LDP man-pages:3.24:2008/12/06:dlerror:3:dlopen:3: +¡û:LDP man-pages:3.24:2008/12/06:dlopen:3:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/12/06:dlsym:3:dlopen:3: +¡÷:LDP man-pages:3.24:2008/12/06:dlvsym:3:dlopen:3: +¡÷:LDP man-pages:3.24:2008/11/07:dn_comp:3:resolver:3: +¡÷:LDP man-pages:3.24:2008/11/07:dn_expand:3:resolver:3: +¡û:LDP man-pages:3.24:2008/06/14:dprintf:3:2002/01/14::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2007/07/26:drand48:3:1997/01/20::tyoshino@eng.toyo.ac.jp:YOSHINO Takashi: +¡û:LDP man-pages:3.24:2007/07/26:drand48_r:3:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2009/02/04:drem:3:remainder:3: +¡÷:LDP man-pages:3.24:2009/02/04:dremf:3:remainder:3: +¡÷:LDP man-pages:3.24:2009/02/04:dreml:3:remainder:3: +¡û:LDP man-pages:3.24:2007/07/26:dysize:3:2002/01/06::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡÷:LDP man-pages:3.24:2007/07/26:eaccess:3:euidaccess:3: +¡÷:LDP man-pages:3.24:2007/05/18:ecb_crypt:3:des_crypt:3: +¡û:LDP man-pages:3.24:2009/03/15:ecvt:3:2009/05/14::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2007/07/26:ecvt_r:3:2002/09/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/07/17:edata:3:end:3: +¡û:LDP man-pages:3.24:2003/04/04:encrypt:3:2004/02/06::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2003/04/04:encrypt_r:3:encrypt:3: +¡û:LDP man-pages:3.24:2008/07/17:end:3:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2003/09/09:endaliasent:3:setaliasent:3: +¡÷:LDP man-pages:3.24:2002/02/28:endfsent:3:getfsent:3: +¡÷:LDP man-pages:3.24:2009/03/30:endgrent:3:getgrent:3: +¡÷:LDP man-pages:3.24:2009/12/03:endhostent:3:gethostbyname:3: +¡ß:LDP man-pages:3.24:2009/01/19:endian:3::::: +¡÷:LDP man-pages:3.24:2009/09/15:endmntent:3:getmntent:3: +¡÷:LDP man-pages:3.24:2008/08/19:endnetent:3:getnetent:3: +¡÷:LDP man-pages:3.24:2007/07/26:endnetgrent:3:setnetgrent:3: +¡÷:LDP man-pages:3.24:2008/08/19:endprotoent:3:getprotoent:3: +¡÷:LDP man-pages:3.24:2009/03/30:endpwent:3:getpwent:3: +¡÷:LDP man-pages:3.24:2008/08/19:endrpcent:3:getrpcent:3: +¡÷:LDP man-pages:3.24:2008/08/19:endservent:3:getservent:3: +¡÷:LDP man-pages:3.24:2010/02/25:endspent:3:getspnam:3: +¡÷:LDP man-pages:3.24:2002/07/18:endttyent:3:getttyent:3: +¡÷:LDP man-pages:3.24:2007/07/26:endusershell:3:getusershell:3: +¡÷:LDP man-pages:3.24:2008/06/29:endutent:3:getutent:3: +¡÷:LDP man-pages:3.24:2008/06/29:endutxent:3:getutent:3: +¡÷:LDP man-pages:3.24:2007/05/18:envz:3:envz_add:3: +¡û:LDP man-pages:3.24:2007/05/18:envz_add:3:2003/03/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/05/18:envz_entry:3:envz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:envz_get:3:envz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:envz_merge:3:envz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:envz_remove:3:envz_add:3: +¡÷:LDP man-pages:3.24:2007/05/18:envz_strip:3:envz_add:3: +¡÷:LDP man-pages:3.24:2007/07/26:erand48:3:drand48:3: +¡÷:LDP man-pages:3.24:2007/07/26:erand48_r:3:drand48_r:3: +¡û:LDP man-pages:3.24:2008/08/05:erf:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/05:erfc:3:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:erfcf:3:erfc:3: +¡÷:LDP man-pages:3.24:2008/08/05:erfcl:3:erfc:3: +¡÷:LDP man-pages:3.24:2008/08/05:erff:3:erf:3: +¡÷:LDP man-pages:3.24:2008/08/05:erfl:3:erf:3: +¡û:LDP man-pages:3.24:2007/12/28:err:3:2003/03/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/07/09:errno:3:2006/07/26::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2006/04/25:error:3:2006/08/19::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2006/04/25:error_at_line:3:error:3: +¡÷:LDP man-pages:3.24:2006/04/25:error_message_count:3:error:3: +¡÷:LDP man-pages:3.24:2006/04/25:error_on_per_line:3:error:3: +¡÷:LDP man-pages:3.24:2006/04/25:error_print_progname:3:error:3: +¡÷:LDP man-pages:3.24:2007/12/28:errx:3:err:3: +¡÷:LDP man-pages:3.24:2008/07/17:etext:3:end:3: +¡û:LDP man-pages:3.24:2002/07/20:ether_aton:3:2002/09/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2002/07/20:ether_aton_r:3:ether_aton:3: +¡÷:LDP man-pages:3.24:2002/07/20:ether_hostton:3:ether_aton:3: +¡÷:LDP man-pages:3.24:2002/07/20:ether_line:3:ether_aton:3: +¡÷:LDP man-pages:3.24:2002/07/20:ether_ntoa:3:ether_aton:3: +¡÷:LDP man-pages:3.24:2002/07/20:ether_ntoa_r:3:ether_aton:3: +¡÷:LDP man-pages:3.24:2002/07/20:ether_ntohost:3:ether_aton:3: +¡û:LDP man-pages:3.24:2007/07/26:euidaccess:3:2007/06/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/01/26:eventfd_read:3:eventfd:2: +¡÷:LDP man-pages:3.24:2009/01/26:eventfd_write:3:eventfd:2: +¡û:LDP man-pages:3.24:2009/02/22:exec:3:2005/03/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/02/22:execl:3:exec:3: +¡÷:LDP man-pages:3.24:2009/02/22:execle:3:exec:3: +¡÷:LDP man-pages:3.24:2009/02/22:execlp:3:exec:3: +¡÷:LDP man-pages:3.24:2009/02/22:execv:3:exec:3: +¡÷:LDP man-pages:3.24:2009/02/22:execvp:3:exec:3: +¡û:LDP man-pages:3.24:2009/09/20:exit:3:2007/06/18::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/05:exp:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/11:exp10:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:exp10f:3:exp10:3: +¡÷:LDP man-pages:3.24:2008/08/11:exp10l:3:exp10:3: +¡û:LDP man-pages:3.24:2008/08/11:exp2:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:exp2f:3:exp2:3: +¡÷:LDP man-pages:3.24:2008/08/11:exp2l:3:exp2:3: +¡÷:LDP man-pages:3.24:2008/08/05:expf:3:exp:3: +¡÷:LDP man-pages:3.24:2008/08/05:expl:3:exp:3: +¡û:LDP man-pages:3.24:2008/08/05:expm1:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:expm1f:3:expm1:3: +¡÷:LDP man-pages:3.24:2008/08/05:expm1l:3:expm1:3: +¡û:LDP man-pages:3.24:2008/08/05:fabs:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:fabsf:3:fabs:3: +¡÷:LDP man-pages:3.24:2008/08/05:fabsl:3:fabs:3: +¡û:LDP man-pages:3.24:2009/02/23:fclose:3:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2006/12/27:fcloseall:3:2007/05/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/03/15:fcvt:3:ecvt:3: +¡÷:LDP man-pages:3.24:2007/07/26:fcvt_r:3:ecvt_r:3: +¡û:LDP man-pages:3.24:2008/08/11:fdim:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:fdimf:3:fdim:3: +¡÷:LDP man-pages:3.24:2008/08/11:fdiml:3:fdim:3: +¡÷:LDP man-pages:3.24:2009/02/23:fdopen:3:fopen:3: +¡÷:LDP man-pages:3.24:2008/08/06:fdopendir:3:opendir:3: +¡÷:LDP man-pages:3.24:2008/08/11:feclearexcept:3:fenv:3: +¡÷:LDP man-pages:3.24:2008/08/11:fedisableexcept:3:fenv:3: +¡÷:LDP man-pages:3.24:2008/08/11:feenableexcept:3:fenv:3: +¡÷:LDP man-pages:3.24:2008/08/11:fegetenv:3:fenv:3: +¡÷:LDP man-pages:3.24:2008/08/11:fegetexcept:3:fenv:3: +¡÷:LDP man-pages:3.24:2008/08/11:fegetexceptflag:3:fenv:3: +¡÷:LDP man-pages:3.24:2008/08/11:fegetround:3:fenv:3: +¡÷:LDP man-pages:3.24:2008/08/11:feholdexcept:3:fenv:3: +¡û:LDP man-pages:3.24:2008/08/11:fenv:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/29:feof:3:ferror:3: +¡÷:LDP man-pages:3.24:2008/08/29:feof_unlocked:3:unlocked_stdio:3: +¡÷:LDP man-pages:3.24:2008/08/11:feraiseexcept:3:fenv:3: +¡û:LDP man-pages:3.24:2008/08/29:ferror:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/08/29:ferror_unlocked:3:unlocked_stdio:3: +¡÷:LDP man-pages:3.24:2008/08/11:fesetenv:3:fenv:3: +¡÷:LDP man-pages:3.24:2008/08/11:fesetexceptflag:3:fenv:3: +¡÷:LDP man-pages:3.24:2008/08/11:fesetround:3:fenv:3: +¡÷:LDP man-pages:3.24:2008/08/11:fetestexcept:3:fenv:3: +¡÷:LDP man-pages:3.24:2008/08/11:feupdateenv:3:fenv:3: +¡û:LDP man-pages:3.24:2009/02/04:fexecve:3:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/09/06:fflush:3:2001/11/09::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/08/29:fflush_unlocked:3:unlocked_stdio:3: +¡û:LDP man-pages:3.24:2009/08/27:ffs:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2009/08/27:ffsl:3:ffs:3: +¡÷:LDP man-pages:3.24:2009/08/27:ffsll:3:ffs:3: +¡÷:LDP man-pages:3.24:2008/08/06:fgetc:3:gets:3: +¡÷:LDP man-pages:3.24:2008/08/29:fgetc_unlocked:3:unlocked_stdio:3: +¡û:LDP man-pages:3.24:2008/07/10:fgetgrent:3:1997/12/19::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¡÷:LDP man-pages:3.24:2007/07/26:fgetgrent_r:3:getgrent_r:3: +¡÷:LDP man-pages:3.24:1993/11/29:fgetpos:3:fseek:3: +¡û:LDP man-pages:3.24:2008/07/10:fgetpwent:3:1997/12/18::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¡÷:LDP man-pages:3.24:2007/07/26:fgetpwent_r:3:getpwent_r:3: +¡÷:LDP man-pages:3.24:2008/08/06:fgets:3:gets:3: +¡÷:LDP man-pages:3.24:2008/08/29:fgets_unlocked:3:unlocked_stdio:3: +¡÷:LDP man-pages:3.24:2010/02/25:fgetspent:3:getspnam:3: +¡÷:LDP man-pages:3.24:2010/02/25:fgetspent_r:3:getspnam:3: +¡û:LDP man-pages:3.24:1999/07/25:fgetwc:3:2001/11/09::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/08/29:fgetwc_unlocked:3:unlocked_stdio:3: +¡û:LDP man-pages:3.24:1999/07/25:fgetws:3:2001/11/09::ysato@h4.dion.ne.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/08/29:fgetws_unlocked:3:unlocked_stdio:3: +¡÷:LDP man-pages:3.24:2008/08/29:fileno:3:ferror:3: +¡÷:LDP man-pages:3.24:2008/08/29:fileno_unlocked:3:unlocked_stdio:3: +¡û:LDP man-pages:3.24:2008/08/05:finite:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:finitef:3:finite:3: +¡÷:LDP man-pages:3.24:2008/08/05:finitel:3:finite:3: +¡û:LDP man-pages:3.24:2008/08/29:flockfile:3:2001/11/05::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/10/06:floor:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/10/06:floorf:3:floor:3: +¡÷:LDP man-pages:3.24:2008/10/06:floorl:3:floor:3: +¡û:LDP man-pages:3.24:2008/10/06:fma:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/10/06:fmaf:3:fma:3: +¡÷:LDP man-pages:3.24:2008/10/06:fmal:3:fma:3: +¡û:LDP man-pages:3.24:2008/08/11:fmax:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:fmaxf:3:fmax:3: +¡÷:LDP man-pages:3.24:2008/08/11:fmaxl:3:fmax:3: +¡û:LDP man-pages:3.24:2009/09/15:fmemopen:3:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/11:fmin:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:fminf:3:fmin:3: +¡÷:LDP man-pages:3.24:2008/08/11:fminl:3:fmin:3: +¡û:LDP man-pages:3.24:2008/08/05:fmod:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:fmodf:3:fmod:3: +¡÷:LDP man-pages:3.24:2008/08/05:fmodl:3:fmod:3: +¡û:LDP man-pages:3.24:2008/06/14:fmtmsg:3:2004/08/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2000/10/15:fnmatch:3:2006/03/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/02/23:fopen:3:2009/01/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡ß:LDP man-pages:3.24:2008/12/05:fopencookie:3::::: +¡÷:LDP man-pages:3.24:2003/07/18:forkpty:3:openpty:3: +¡û:LDP man-pages:3.24:1993/04/04:fpathconf:3:1998/03/20::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2008/08/07:fpclassify:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/12/19:fprintf:3:printf:3: +¡û:LDP man-pages:3.24:2001/12/15:fpurge:3:2002/01/14::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡÷:LDP man-pages:3.24:1993/04/04:fputc:3:puts:3: +¡÷:LDP man-pages:3.24:2008/08/29:fputc_unlocked:3:unlocked_stdio:3: +¡÷:LDP man-pages:3.24:1993/04/04:fputs:3:puts:3: +¡÷:LDP man-pages:3.24:2008/08/29:fputs_unlocked:3:unlocked_stdio:3: +¡û:LDP man-pages:3.24:1999/07/25:fputwc:3:2001/11/09::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/08/29:fputwc_unlocked:3:unlocked_stdio:3: +¡û:LDP man-pages:3.24:1999/07/25:fputws:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/08/29:fputws_unlocked:3:unlocked_stdio:3: +¡û:LDP man-pages:3.24:1996/05/17:fread:3:2001/11/09::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/08/29:fread_unlocked:3:unlocked_stdio:3: +¡÷:LDP man-pages:3.24:2009/01/13:free:3:malloc:3: +¡÷:LDP man-pages:3.24:2009/09/03:freeaddrinfo:3:getaddrinfo:3: +¡÷:LDP man-pages:3.24:2007/11/15:freehostent:3:getipnodebyname:3: +¢¨:LDP man-pages:3.24:2009/01/23:freeifaddrs:3:getifaddrs:3: +¡÷:LDP man-pages:3.24:2009/02/23:freopen:3:fopen:3: +¡û:LDP man-pages:3.24:2008/10/29:frexp:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/10/29:frexpf:3:frexp:3: +¡÷:LDP man-pages:3.24:2008/10/29:frexpl:3:frexp:3: +¡÷:LDP man-pages:3.24:2008/07/12:fscanf:3:scanf:3: +¡û:LDP man-pages:3.24:1993/11/29:fseek:3:1998/04/27::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2001/11/05:fseeko:3:2006/01/18::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:1993/11/29:fsetpos:3:fseek:3: +¡÷:LDP man-pages:3.24:1993/11/29:ftell:3:fseek:3: +¡÷:LDP man-pages:3.24:2001/11/05:ftello:3:fseeko:3: +¡û:LDP man-pages:3.24:2010/02/25:ftime:3:2008/10/08::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2001/11/28:ftok:3:2002/01/06::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡÷:LDP man-pages:3.24:2008/08/29:ftrylockfile:3:flockfile:3: +¡û:LDP man-pages:3.24:2007/12/28:fts:3:2000/09/05::sato@complex.eng.hokudai.ac.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2007/12/28:fts_children:3:fts:3: +¡÷:LDP man-pages:3.24:2007/12/28:fts_close:3:fts:3: +¡÷:LDP man-pages:3.24:2007/12/28:fts_open:3:fts:3: +¡÷:LDP man-pages:3.24:2007/12/28:fts_read:3:fts:3: +¡÷:LDP man-pages:3.24:2007/12/28:fts_set:3:fts:3: +¡û:LDP man-pages:3.24:2008/08/06:ftw:3:2006/07/30::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/29:funlockfile:3:flockfile:3: +¢¨:LDP man-pages:3.24:2009/12/13:futimens:3:utimensat:2: +¡û:LDP man-pages:3.24:2008/04/07:futimes:3:2006/07/31::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:fwide:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡÷:LDP man-pages:3.24:2007/07/26:fwprintf:3:wprintf:3: +¡÷:LDP man-pages:3.24:1996/05/17:fwrite:3:fread:3: +¡÷:LDP man-pages:3.24:2008/08/29:fwrite_unlocked:3:unlocked_stdio:3: +¡÷:LDP man-pages:3.24:2009/09/03:gai_strerror:3:getaddrinfo:3: +¡û:LDP man-pages:3.24:2008/08/05:gamma:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:gammaf:3:gamma:3: +¡÷:LDP man-pages:3.24:2008/08/05:gammal:3:gamma:3: +¡û:LDP man-pages:3.24:2009/03/15:gcvt:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/03/31:get_current_dir_name:3:getcwd:3: +¡÷:LDP man-pages:3.24:2008/07/17:get_myaddress:3:rpc:3: +¡û:LDP man-pages:3.24:2009/09/03:getaddrinfo:3:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2003/09/09:getaliasbyname:3:setaliasent:3: +¡÷:LDP man-pages:3.24:2003/09/09:getaliasbyname_r:3:setaliasent:3: +¡÷:LDP man-pages:3.24:2003/09/09:getaliasent:3:setaliasent:3: +¡÷:LDP man-pages:3.24:2003/09/09:getaliasent_r:3:setaliasent:3: +¡÷:LDP man-pages:3.24:2008/08/06:getc:3:gets:3: +¡÷:LDP man-pages:3.24:2008/08/29:getc_unlocked:3:unlocked_stdio:3: +¡÷:LDP man-pages:3.24:2008/08/06:getchar:3:gets:3: +¡÷:LDP man-pages:3.24:2008/08/29:getchar_unlocked:3:unlocked_stdio:3: +¡û:LDP man-pages:3.24:2009/03/31:getcwd:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2008/09/07:getdate:3:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/09/07:getdate_err:3:getdate:3: +¡÷:LDP man-pages:3.24:2008/09/07:getdate_r:3:getdate:3: +¡÷:LDP man-pages:3.24:2009/12/05:getdelim:3:getline:3: +¡û:LDP man-pages:3.24:2007/07/26:getdirentries:3:1998/04/30::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2008/03/17:getenv:3:2003/09/28::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2002/02/28:getfsent:3:2002/08/07::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡÷:LDP man-pages:3.24:2002/02/28:getfsfile:3:getfsent:3: +¡÷:LDP man-pages:3.24:2002/02/28:getfsspec:3:getfsent:3: +¡û:LDP man-pages:3.24:2009/03/30:getgrent:3:2005/09/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:getgrent_r:3:2004/08/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2009/03/30:getgrgid:3:getgrnam:3: +¡÷:LDP man-pages:3.24:2009/03/30:getgrgid_r:3:getgrnam:3: +¡û:LDP man-pages:3.24:2009/03/30:getgrnam:3:2005/09/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/03/30:getgrnam_r:3:getgrnam:3: +¡û:LDP man-pages:3.24:2008/07/03:getgrouplist:3:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/12/03:gethostbyaddr:3:gethostbyname:3: +¡÷:LDP man-pages:3.24:2009/12/03:gethostbyaddr_r:3:gethostbyname:3: +¡û:LDP man-pages:3.24:2009/12/03:gethostbyname:3:2007/06/13::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/12/03:gethostbyname2:3:gethostbyname:3: +¡÷:LDP man-pages:3.24:2009/12/03:gethostbyname2_r:3:gethostbyname:3: +¡÷:LDP man-pages:3.24:2009/12/03:gethostbyname_r:3:gethostbyname:3: +¡÷:LDP man-pages:3.24:2009/12/03:gethostent:3:gethostbyname:3: +¡÷:LDP man-pages:3.24:2009/12/03:gethostent_r:3:gethostbyname:3: +¡û:LDP man-pages:3.24:2009/01/13:gethostid:3::::: +¡ß:LDP man-pages:3.24:2009/01/23:getifaddrs:3::::: +¡÷:LDP man-pages:3.24:2007/11/15:getipnodebyaddr:3:getipnodebyname:3: +¡û:LDP man-pages:3.24:2007/11/15:getipnodebyname:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/12/05:getline:3:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:0000/00/00:getloadavg:3:2002/01/21::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2008/06/29:getlogin:3:2005/03/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/06/29:getlogin_r:3:getlogin:3: +¡û:LDP man-pages:3.24:2009/09/15:getmntent:3:2005/03/18::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/09/15:getmntent_r:3:getmntent:3: +¡û:LDP man-pages:3.24:2009/12/03:getnameinfo:3:2007/01/07::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/19:getnetbyaddr:3:getnetent:3: +¢¨:LDP man-pages:3.24:2009/02/21:getnetbyaddr_r:3:getnetent_r:3: +¡÷:LDP man-pages:3.24:2008/08/19:getnetbyname:3:getnetent:3: +¢¨:LDP man-pages:3.24:2009/02/21:getnetbyname_r:3:getnetent_r:3: +¡û:LDP man-pages:3.24:2008/08/19:getnetent:3:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡ß:LDP man-pages:3.24:2009/02/21:getnetent_r:3::::: +¡÷:LDP man-pages:3.24:2007/07/26:getnetgrent:3:setnetgrent:3: +¡÷:LDP man-pages:3.24:2007/07/26:getnetgrent_r:3:setnetgrent:3: +¡û:LDP man-pages:3.24:2010/02/03:getopt:3:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2010/02/03:getopt_long:3:getopt:3: +¡÷:LDP man-pages:3.24:2010/02/03:getopt_long_only:3:getopt:3: +¡û:LDP man-pages:3.24:2000/12/05:getpass:3:2001/02/14::nakano@apm.seikei.ac.jp:NAKANO Takeo:Older ver. is in obsolete/ +¡÷:LDP man-pages:3.24:2008/08/19:getprotobyname:3:getprotoent:3: +¢¨:LDP man-pages:3.24:2008/08/19:getprotobyname_r:3:getprotoent_r:3: +¡÷:LDP man-pages:3.24:2008/08/19:getprotobynumber:3:getprotoent:3: +¢¨:LDP man-pages:3.24:2008/08/19:getprotobynumber_r:3:getprotoent_r:3: +¡û:LDP man-pages:3.24:2008/08/19:getprotoent:3:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡ß:LDP man-pages:3.24:2008/08/19:getprotoent_r:3::::: +¡û:LDP man-pages:3.24:2008/06/14:getpt:3:2003/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/12/12:getpw:3:2008/10/08::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/03/30:getpwent:3:2005/09/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:getpwent_r:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/03/30:getpwnam:3:2005/10/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/03/30:getpwnam_r:3:getpwnam:3: +¡÷:LDP man-pages:3.24:2009/03/30:getpwuid:3:getpwnam:3: +¡÷:LDP man-pages:3.24:2009/03/30:getpwuid_r:3:getpwnam:3: +¡÷:LDP man-pages:3.24:2008/08/19:getrpcbyname:3:getrpcent:3: +¢¨:LDP man-pages:3.24:2008/08/19:getrpcbyname_r:3:getrpcent_r:3: +¡÷:LDP man-pages:3.24:2008/08/19:getrpcbynumber:3:getrpcent:3: +¢¨:LDP man-pages:3.24:2008/08/19:getrpcbynumber_r:3:getrpcent_r:3: +¡û:LDP man-pages:3.24:2008/08/19:getrpcent:3:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡ß:LDP man-pages:3.24:2008/08/19:getrpcent_r:3::::: +¡û:LDP man-pages:3.24:1987/10/06:getrpcport:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:2008/08/06:gets:3:2005/09/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/19:getservbyname:3:getservent:3: +¢¨:LDP man-pages:3.24:2008/08/19:getservbyname_r:3:getservent_r:3: +¡÷:LDP man-pages:3.24:2008/08/19:getservbyport:3:getservent:3: +¢¨:LDP man-pages:3.24:2008/08/19:getservbyport_r:3:getservent_r:3: +¡û:LDP man-pages:3.24:2008/08/19:getservent:3:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡ß:LDP man-pages:3.24:2008/08/19:getservent_r:3::::: +¡÷:LDP man-pages:3.24:2010/02/25:getspent:3:getspnam:3: +¡÷:LDP man-pages:3.24:2010/02/25:getspent_r:3:getspnam:3: +¡û:LDP man-pages:3.24:2010/02/25:getspnam:3:2005/09/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2010/02/25:getspnam_r:3:getspnam:3: +¡û:LDP man-pages:3.24:2008/05/29:getsubopt:3:2007/06/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2002/07/18:getttyent:3:2004/09/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2002/07/18:getttynam:3:getttyent:3: +¡û:LDP man-pages:3.24:2009/01/20:getumask:3:2003/02/02::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:getusershell:3:1998/02/05::ishioka@dad.eec.toshiba.co.jp:ISHIOKA Takashi: +¡û:LDP man-pages:3.24:2008/06/29:getutent:3:2005/03/18::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/06/29:getutent_r:3:getutent:3: +¡÷:LDP man-pages:3.24:2008/06/29:getutid:3:getutent:3: +¡÷:LDP man-pages:3.24:2008/06/29:getutid_r:3:getutent:3: +¡÷:LDP man-pages:3.24:2008/06/29:getutline:3:getutent:3: +¡÷:LDP man-pages:3.24:2008/06/29:getutline_r:3:getutent:3: +¡ß:LDP man-pages:3.24:2008/07/02:getutmp:3::::: +¢¨:LDP man-pages:3.24:2008/07/02:getutmpx:3:getutmp:3: +¡÷:LDP man-pages:3.24:2008/06/29:getutxent:3:getutent:3: +¡÷:LDP man-pages:3.24:2008/06/29:getutxid:3:getutent:3: +¡÷:LDP man-pages:3.24:2008/06/29:getutxline:3:getutent:3: +¡û:LDP man-pages:3.24:2007/12/20:getw:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:1999/07/25:getwc:3:fgetwc:3: +¡÷:LDP man-pages:3.24:2008/08/29:getwc_unlocked:3:unlocked_stdio:3: +¡û:LDP man-pages:3.24:1999/07/25:getwchar:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/08/29:getwchar_unlocked:3:unlocked_stdio:3: +¡÷:LDP man-pages:3.24:2009/03/31:getwd:3:getcwd:3: +¡û:LDP man-pages:3.24:2007/10/10:glob:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2007/10/10:globfree:3:glob:3: +¡÷:LDP man-pages:3.24:2010/02/25:gmtime:3:ctime:3: +¡÷:LDP man-pages:3.24:2010/02/25:gmtime_r:3:ctime:3: +¢¨:LDP man-pages:3.24:2008/12/01:gnu_dev_major:3:makedev:3: +¢¨:LDP man-pages:3.24:2008/12/01:gnu_dev_makedev:3:makedev:3: +¢¨:LDP man-pages:3.24:2008/12/01:gnu_dev_minor:3:makedev:3: +¡÷:LDP man-pages:3.24:2008/07/02:gnu_get_libc_release:3:gnu_get_libc_version:3: +¡û:LDP man-pages:3.24:2008/07/02:gnu_get_libc_version:3:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/06/14:grantpt:3:2003/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:gsignal:3:2003/03/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/12/03:h_errno:3:gethostbyname:3: +¡û:LDP man-pages:3.24:1994/08/18:hash:3:1999/08/17::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡÷:LDP man-pages:3.24:2009/09/15:hasmntopt:3:getmntent:3: +¡÷:LDP man-pages:3.24:2008/10/06:hcreate:3:hsearch:3: +¡÷:LDP man-pages:3.24:2008/10/06:hcreate_r:3:hsearch:3: +¡÷:LDP man-pages:3.24:2008/10/06:hdestroy:3:hsearch:3: +¡÷:LDP man-pages:3.24:2008/10/06:hdestroy_r:3:hsearch:3: +¡÷:LDP man-pages:3.24:2009/12/03:herror:3:gethostbyname:3: +¡û:LDP man-pages:3.24:2008/10/06:hsearch:3:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/10/06:hsearch_r:3:hsearch:3: +¡÷:LDP man-pages:3.24:2009/12/03:hstrerror:3:gethostbyname:3: +¢¨:LDP man-pages:3.24:2009/01/19:htobe16:3:endian:3: +¢¨:LDP man-pages:3.24:2009/01/19:htobe32:3:endian:3: +¢¨:LDP man-pages:3.24:2009/01/19:htobe64:3:endian:3: +¢¨:LDP man-pages:3.24:2009/01/19:htole16:3:endian:3: +¢¨:LDP man-pages:3.24:2009/01/19:htole32:3:endian:3: +¢¨:LDP man-pages:3.24:2009/01/19:htole64:3:endian:3: +¡÷:LDP man-pages:3.24:2009/01/15:htonl:3:byteorder:3: +¡÷:LDP man-pages:3.24:2009/01/15:htons:3:byteorder:3: +¡û:LDP man-pages:3.24:2008/08/05:hypot:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:hypotf:3:hypot:3: +¡÷:LDP man-pages:3.24:2008/08/05:hypotl:3:hypot:3: +¡û:LDP man-pages:3.24:2008/09/08:iconv:3:2000/07/11::sato@complex.eng.hokudai.ac.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:1999/11/27:iconv_close:3:2000/07/11::sato@complex.eng.hokudai.ac.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/03/31:iconv_open:3:2007/06/01::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/02/04:ilogb:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/02/04:ilogbf:3:ilogb:3: +¡÷:LDP man-pages:3.24:2009/02/04:ilogbl:3:ilogb:3: +¡÷:LDP man-pages:3.24:2007/07/26:imaxabs:3:abs:3: +¡÷:LDP man-pages:3.24:2007/07/26:imaxdiv:3:div:3: +¡û:LDP man-pages:3.24:2009/03/15:index:3:1997/12/12::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¡û:LDP man-pages:3.24:2008/06/19:inet:3:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/06/19:inet_addr:3:inet:3: +¡÷:LDP man-pages:3.24:2008/06/19:inet_aton:3:inet:3: +¡÷:LDP man-pages:3.24:2008/06/19:inet_lnaof:3:inet:3: +¡÷:LDP man-pages:3.24:2008/06/19:inet_makeaddr:3:inet_addr:3: +¡÷:LDP man-pages:3.24:2008/06/19:inet_netof:3:inet:3: +¡÷:LDP man-pages:3.24:2008/06/19:inet_network:3:inet:3: +¡÷:LDP man-pages:3.24:2008/06/19:inet_ntoa:3:inet:3: +¡û:LDP man-pages:3.24:2008/11/11:inet_ntop:3:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/06/18:inet_pton:3:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1993/06/02:infnan:3:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/07/26:initgroups:3:2005/02/26::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/02/03:initstate:3:random:3: +¡÷:LDP man-pages:3.24:2008/03/07:initstate_r:3:random_r:3: +¡÷:LDP man-pages:3.24:2007/07/26:innetgr:3:setnetgrent:3: +¡û:LDP man-pages:3.24:2008/07/11:insque:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2010/02/03:intro:3:2008/02/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/28:iruserok:3:rcmd:3: +¡÷:LDP man-pages:3.24:2009/03/15:isalnum:3:isalpha:3: +¡û:LDP man-pages:3.24:2009/03/15:isalpha:3:2007/05/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/03/15:isascii:3:isalpha:3: +¡û:LDP man-pages:3.24:2008/12/03:isatty:3:1997/2/10::nagoya@cc.hit-u.ac.jp:NAGOYA Hiroaki: +¡÷:LDP man-pages:3.24:2009/03/15:isblank:3:isalpha:3: +¡÷:LDP man-pages:3.24:2009/03/15:iscntrl:3:isalpha:3: +¡÷:LDP man-pages:3.24:2009/03/15:isdigit:3:isalpha:3: +¡÷:LDP man-pages:3.24:2008/08/07:isfinite:3:fpclassify:3: +¡÷:LDP man-pages:3.24:2009/03/15:isgraph:3:isalpha:3: +¡û:LDP man-pages:3.24:2008/08/05:isgreater:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:isgreaterequal:3:isgreater:3: +¡÷:LDP man-pages:3.24:2008/08/07:isinf:3:fpclassify:3: +¡÷:LDP man-pages:3.24:2008/08/05:isinff:3:finite:3: +¡÷:LDP man-pages:3.24:2008/08/05:isinfl:3:finite:3: +¡÷:LDP man-pages:3.24:2008/08/05:isless:3:isgreater:3: +¡÷:LDP man-pages:3.24:2008/08/05:islessequal:3:isgreater:3: +¡÷:LDP man-pages:3.24:2008/08/05:islessgreater:3:isgreater:3: +¡÷:LDP man-pages:3.24:2009/03/15:islower:3:isalpha:3: +¡÷:LDP man-pages:3.24:2008/08/07:isnan:3:fpclassify:3: +¡÷:LDP man-pages:3.24:2008/08/05:isnanf:3:finite:3: +¡÷:LDP man-pages:3.24:2008/08/05:isnanl:3:finite:3: +¡÷:LDP man-pages:3.24:2008/08/07:isnormal:3:fpclassify:3: +¡÷:LDP man-pages:3.24:2009/03/15:isprint:3:isalpha:3: +¡÷:LDP man-pages:3.24:2009/03/15:ispunct:3:isalpha:3: +¡÷:LDP man-pages:3.24:2009/03/15:isspace:3:isalpha:3: +¡÷:LDP man-pages:3.24:2008/08/05:isunordered:3:isgreater:3: +¡÷:LDP man-pages:3.24:2009/03/15:isupper:3:isalpha:3: +¡û:LDP man-pages:3.24:1999/07/25:iswalnum:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:1999/07/25:iswalpha:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2007/07/26:iswblank:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:1999/07/25:iswcntrl:3:1999/09/12::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:iswctype:3:1999/09/12::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:iswdigit:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:1999/07/25:iswgraph:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:1999/07/25:iswlower:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:1999/07/25:iswprint:3:1999/09/12::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:iswpunct:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:1999/07/25:iswspace:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:1999/07/25:iswupper:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:1999/07/25:iswxdigit:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2009/03/15:isxdigit:3:isalpha:3: +¡û:LDP man-pages:3.24:2008/08/05:j0:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:j0f:3:j0:3: +¡÷:LDP man-pages:3.24:2008/08/05:j0l:3:j0:3: +¡÷:LDP man-pages:3.24:2008/08/05:j1:3:j0:3: +¡÷:LDP man-pages:3.24:2008/08/05:j1f:3:j0:3: +¡÷:LDP man-pages:3.24:2008/08/05:j1l:3:j0:3: +¡÷:LDP man-pages:3.24:2008/08/05:jn:3:j0:3: +¡÷:LDP man-pages:3.24:2008/08/05:jnf:3:j0:3: +¡÷:LDP man-pages:3.24:2008/08/05:jnl:3:j0:3: +¡÷:LDP man-pages:3.24:2007/07/26:jrand48:3:drand48:3: +¡÷:LDP man-pages:3.24:2007/07/26:jrand48_r:3:drand48_r:3: +¡÷:LDP man-pages:3.24:2002/07/18:key_decryptsession:3:key_setsecret:3: +¡÷:LDP man-pages:3.24:2002/07/18:key_encryptsession:3:key_setsecret:3: +¡÷:LDP man-pages:3.24:2002/07/18:key_gendes:3:key_setsecret:3: +¡÷:LDP man-pages:3.24:2002/07/18:key_secretkey_is_set:3:key_setsecret:3: +¡û:LDP man-pages:3.24:2002/07/18:key_setsecret:3:2003/02/01::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/06/20:klogctl:3:syslog:2: +¡÷:LDP man-pages:3.24:2007/07/26:l64a:3:a64l:3: +¡÷:LDP man-pages:3.24:2007/07/26:labs:3:abs:3: +¡÷:LDP man-pages:3.24:2010/02/25:lckpwdf:3:getspnam:3: +¡÷:LDP man-pages:3.24:2007/07/26:lcong48:3:drand48:3: +¡÷:LDP man-pages:3.24:2007/07/26:lcong48_r:3:drand48_r:3: +¡û:LDP man-pages:3.24:2008/08/05:ldexp:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:ldexpf:3:ldexp:3: +¡÷:LDP man-pages:3.24:2008/08/05:ldexpl:3:ldexp:3: +¡÷:LDP man-pages:3.24:2007/07/26:ldiv:3:div:3: +¢¨:LDP man-pages:3.24:2009/01/19:le16toh:3:endian:3: +¢¨:LDP man-pages:3.24:2009/01/19:le32toh:3:endian:3: +¢¨:LDP man-pages:3.24:2009/01/19:le64toh:3:endian:3: +¡÷:LDP man-pages:3.24:1999/09/27:lfind:3:lsearch:3: +¡û:LDP man-pages:3.24:2008/08/05:lgamma:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:lgamma_r:3:lgamma:3: +¡÷:LDP man-pages:3.24:2008/08/05:lgammaf:3:lgamma:3: +¡÷:LDP man-pages:3.24:2008/08/05:lgammaf_r:3:lgamma:3: +¡÷:LDP man-pages:3.24:2008/08/05:lgammal:3:lgamma:3: +¡÷:LDP man-pages:3.24:2008/08/05:lgammal_r:3:lgamma:3: +¡÷:LDP man-pages:3.24:2007/07/26:llabs:3:abs:3: +¡÷:LDP man-pages:3.24:2007/07/26:lldiv:3:div:3: +¡÷:LDP man-pages:3.24:2008/08/11:llrint:3:lrint:3: +¡÷:LDP man-pages:3.24:2008/08/11:llrintf:3:lrint:3: +¡÷:LDP man-pages:3.24:2008/08/11:llrintl:3:lrint:3: +¡÷:LDP man-pages:3.24:2008/08/11:llround:3:lround:3: +¡÷:LDP man-pages:3.24:2008/08/11:llroundf:3:lround:3: +¡÷:LDP man-pages:3.24:2008/08/11:llroundl:3:lround:3: +¡û:LDP man-pages:3.24:1993/04/25:localeconv:3:1998/05/25::tyoshino@eng.toyo.ac.jp:Takashi Yoshino: +¡÷:LDP man-pages:3.24:2010/02/25:localtime:3:ctime:3: +¡÷:LDP man-pages:3.24:2010/02/25:localtime_r:3:ctime:3: +¡û:LDP man-pages:3.24:2009/07/25:lockf:3:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/10:log:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/05:log10:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:log10f:3:log10:3: +¡÷:LDP man-pages:3.24:2008/08/05:log10l:3:log10:3: +¡û:LDP man-pages:3.24:2008/08/05:log1p:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:log1pf:3:log1p:3: +¡÷:LDP man-pages:3.24:2008/08/05:log1pl:3:log1p:3: +¡û:LDP man-pages:3.24:2008/08/11:log2:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:log2f:3:log2:3: +¡÷:LDP man-pages:3.24:2008/08/11:log2l:3:log2:3: +¡û:LDP man-pages:3.24:2008/08/05:logb:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:logbf:3:logb:3: +¡÷:LDP man-pages:3.24:2008/08/05:logbl:3:logb:3: +¡÷:LDP man-pages:3.24:2008/08/10:logf:3:log:3: +¡û:LDP man-pages:3.24:2004/05/06:login:3:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2003/07/18:login_tty:3:openpty:3: +¡÷:LDP man-pages:3.24:2008/08/10:logl:3:log:3: +¡÷:LDP man-pages:3.24:2004/05/06:logout:3:login:3: +¡÷:LDP man-pages:3.24:2008/07/02:logwtmp:3:updwtmp:3: +¡û:LDP man-pages:3.24:2009/01/13:longjmp:3:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/26:lrand48:3:drand48:3: +¡÷:LDP man-pages:3.24:2007/07/26:lrand48_r:3:drand48_r:3: +¡û:LDP man-pages:3.24:2008/08/11:lrint:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:lrintf:3:lrint:3: +¡÷:LDP man-pages:3.24:2008/08/11:lrintl:3:lrint:3: +¡û:LDP man-pages:3.24:2008/08/11:lround:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:lroundf:3:lround:3: +¡÷:LDP man-pages:3.24:2008/08/11:lroundl:3:lround:3: +¡û:LDP man-pages:3.24:1999/09/27:lsearch:3:2005/03/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2004/12/11:lseek64:3:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/04/07:lutimes:3:futimes:3: +¢¨:LDP man-pages:3.24:2008/12/01:major:3:makedev:3: +¡û:LDP man-pages:3.24:2009/03/31:makecontext:3:2008/12/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡ß:LDP man-pages:3.24:2008/12/01:makedev:3::::: +¡û:LDP man-pages:3.24:2009/01/13:malloc:3:2007/10/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2002/07/20:malloc_hook:3:2003/01/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡ß:LDP man-pages:3.24:2008/07/21:matherr:3::::: +¡û:LDP man-pages:3.24:1999/07/25:mblen:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:1999/07/25:mbrlen:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:2001/11/22:mbrtowc:3:2008/07/24::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2000/11/20:mbsinit:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:2007/07/26:mbsnrtowcs:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:1999/07/25:mbsrtowcs:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:1999/07/25:mbstowcs:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:2001/07/04:mbtowc:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡÷:LDP man-pages:3.24:2009/03/30:memalign:3:posix_memalign:3: +¡û:LDP man-pages:3.24:2009/01/13:memccpy:3:1997/07/26::tyoshino@eng.toyo.ac.jp:Takashi Yoshino: +¡û:LDP man-pages:3.24:2009/12/04:memchr:3:2004/01/17::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:1993/04/10:memcmp:3:1997/12/17::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¡û:LDP man-pages:3.24:1993/04/10:memcpy:3:1997/02/21::tyoshino@eng.toyo.ac.jp:Takashi Yoshino: +¡û:LDP man-pages:3.24:2007/07/26:memfrob:3:1998/05/34::ishikawa@linux.or.jp:ISHIKAWA Mutsumi: +¡û:LDP man-pages:3.24:2008/12/05:memmem:3:1997/12/17::tyoshino@eng.toyo.ac.jp:Takashi Yoshino: +¡û:LDP man-pages:3.24:1993/04/10:memmove:3:2007/06/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/12:mempcpy:3:2004/09/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2009/12/04:memrchr:3:memchr:3: +¡û:LDP man-pages:3.24:1993/04/11:memset:3:1997/02/21::tyoshino@eng.toyo.ac.jp:Takashi Yoshino: +¢¨:LDP man-pages:3.24:2008/12/01:minor:3:makedev:3: +¡û:LDP man-pages:3.24:2007/07/26:mkdtemp:3:2001/11/09::ysato@h4.dion.ne.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/06/12:mkfifo:3:2008/10/08::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/12/13:mkfifoat:3:2006/08/19::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/06/19:mkostemp:3:mkstemp:3: +¡û:LDP man-pages:3.24:2008/06/19:mkstemp:3:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:mktemp:3:1999/04/10::tanisako@osa.dec.com:Kazuyuki Tanisako: +¡÷:LDP man-pages:3.24:2010/02/25:mktime:3:ctime:3: +¡÷:LDP man-pages:3.24:2008/04/22:mmap64:3:mmap2:2: +¡û:LDP man-pages:3.24:2008/08/05:modf:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:modff:3:modf:3: +¡÷:LDP man-pages:3.24:2008/08/05:modfl:3:modf:3: +¡û:LDP man-pages:3.24:1993/06/04:mpool:3:1999/08/19::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2006/02/25:mq_close:3:2006/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/09/29:mq_getattr:3:2006/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/09/15:mq_notify:3:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/02/20:mq_open:3:2006/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2010/02/25:mq_receive:3:2006/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2010/02/25:mq_send:3:2006/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/09/29:mq_setattr:3:mq_getattr:3: +¡÷:LDP man-pages:3.24:2010/02/25:mq_timedreceive:3:mq_receive:3: +¡÷:LDP man-pages:3.24:2010/02/25:mq_timedsend:3:mq_send:3: +¡û:LDP man-pages:3.24:2006/02/25:mq_unlink:3:2006/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/26:mrand48:3:drand48:3: +¡÷:LDP man-pages:3.24:2007/07/26:mrand48_r:3:drand48_r:3: +¡û:LDP man-pages:3.24:2002/07/20:mtrace:3:2003/01/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2002/07/20:muntrace:3:mtrace:3: +¡û:LDP man-pages:3.24:2008/08/11:nan:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:nanf:3:nan:3: +¡÷:LDP man-pages:3.24:2008/08/11:nanl:3:nan:3: +¡÷:LDP man-pages:3.24:2008/08/05:nearbyint:3:rint:3: +¡÷:LDP man-pages:3.24:2008/08/05:nearbyintf:3:rint:3: +¡÷:LDP man-pages:3.24:2008/08/05:nearbyintl:3:rint:3: +¡û:LDP man-pages:3.24:1999/05/14:netlink:3:1999/08/20::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2009/12/05:nextafter:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/12/05:nextafterf:3:nextafter:3: +¡÷:LDP man-pages:3.24:2009/12/05:nextafterl:3:nextafter:3: +¡÷:LDP man-pages:3.24:2009/12/05:nexttoward:3:nextafter:3: +¡÷:LDP man-pages:3.24:2009/12/05:nexttowardf:3:nextafter:3: +¡÷:LDP man-pages:3.24:2009/12/05:nexttowardl:3:nextafter:3: +¡÷:LDP man-pages:3.24:2008/08/06:nftw:3:ftw:3: +¡û:LDP man-pages:3.24:2001/05/11:nl_langinfo:3:2001/07/15::KY4N-UCD@asahi-net.or.jp:UCHIDA Norihiro: +¡÷:LDP man-pages:3.24:2007/07/26:nrand48:3:drand48:3: +¡÷:LDP man-pages:3.24:2007/07/26:nrand48_r:3:drand48_r:3: +¡÷:LDP man-pages:3.24:2009/01/15:ntohl:3:byteorder:3: +¡÷:LDP man-pages:3.24:2009/01/15:ntohs:3:byteorder:3: +¡û:LDP man-pages:3.24:2008/07/12:offsetof:3:2006/07/26::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/12/05:on_exit:3:2009/01/15:o:amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/09/15:open_memstream:3:fmemopen:3: +¡÷:LDP man-pages:3.24:2009/09/15:open_wmemstream:3:fmemopen:3: +¡û:LDP man-pages:3.24:2008/08/06:opendir:3:2007/10/14:o:amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/11/12:openlog:3:syslog:3: +¡û:LDP man-pages:3.24:2003/07/18:openpty:3:2006/02/13::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2010/02/03:optarg:3:getopt:3: +¡÷:LDP man-pages:3.24:2010/02/03:opterr:3:getopt:3: +¡÷:LDP man-pages:3.24:2010/02/03:optind:3:getopt:3: +¡÷:LDP man-pages:3.24:2010/02/03:optopt:3:getopt:3: +¡÷:LDP man-pages:3.24:2003/04/04:passwd2des:3:xcrypt:3: +¡÷:LDP man-pages:3.24:1993/04/04:pathconf:3:fpathconf:3: +¡÷:LDP man-pages:3.24:2010/02/03:pclose:3:popen:3: +¡û:LDP man-pages:3.24:2007/07/26:perror:3:2005/03/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/07/17:pmap_getmaps:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:pmap_getport:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:pmap_rmtcall:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:pmap_set:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:pmap_unset:3:rpc:3: +¡û:LDP man-pages:3.24:2010/02/03:popen:3:2008/11/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/09/30:posix_fallocate:3:2006/08/19::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2009/03/30:posix_memalign:3:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:posix_openpt:3:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/08/10:pow:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2004/10/05:pow10:3:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2004/10/05:pow10f:3:pow10:3: +¡÷:LDP man-pages:3.24:2004/10/05:pow10l:3:pow10:3: +¡÷:LDP man-pages:3.24:2008/08/10:powf:3:pow:3: +¡÷:LDP man-pages:3.24:2008/08/10:powl:3:pow:3: +¡û:LDP man-pages:3.24:2008/12/19:printf:3:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:profil:3:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2006/04/29:program_invocation_name:3:2006/07/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2006/04/29:program_invocation_short_name:3:program_invocation_name:3: +¡û:LDP man-pages:3.24:2008/08/21:psignal:3:1997/12/26::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¢¨:LDP man-pages:3.24:2008/11/11:pthread_attr_destroy:3:pthread_attr_init:3: +¢¨:LDP man-pages:3.24:2009/02/01:pthread_attr_getaffinity_np:3:pthread_attr_setaffinity_np:3: +¢¨:LDP man-pages:3.24:2010/02/03:pthread_attr_getdetachstate:3:pthread_attr_setdetachstate:3: +¢¨:LDP man-pages:3.24:2008/10/24:pthread_attr_getguardsize:3:pthread_attr_setguardsize:3: +¢¨:LDP man-pages:3.24:2008/11/10:pthread_attr_getinheritsched:3:pthread_attr_setinheritsched:3: +¢¨:LDP man-pages:3.24:2010/02/03:pthread_attr_getschedparam:3:pthread_attr_setschedparam:3: +¢¨:LDP man-pages:3.24:2010/02/03:pthread_attr_getschedpolicy:3:pthread_attr_setschedpolicy:3: +¢¨:LDP man-pages:3.24:2008/10/24:pthread_attr_getscope:3:pthread_attr_setscope:3: +¢¨:LDP man-pages:3.24:2008/10/24:pthread_attr_getstack:3:pthread_attr_setstack:3: +¢¨:LDP man-pages:3.24:2008/10/24:pthread_attr_getstackaddr:3:pthread_attr_setstackaddr:3: +¢¨:LDP man-pages:3.24:2008/11/05:pthread_attr_getstacksize:3:pthread_attr_setstacksize:3: +¡ß:LDP man-pages:3.24:2008/11/11:pthread_attr_init:3::::: +¡ß:LDP man-pages:3.24:2009/02/01:pthread_attr_setaffinity_np:3::::: +¡ß:LDP man-pages:3.24:2010/02/03:pthread_attr_setdetachstate:3::::: +¡ß:LDP man-pages:3.24:2008/10/24:pthread_attr_setguardsize:3::::: +¡ß:LDP man-pages:3.24:2008/11/10:pthread_attr_setinheritsched:3::::: +¡ß:LDP man-pages:3.24:2010/02/03:pthread_attr_setschedparam:3::::: +¡ß:LDP man-pages:3.24:2010/02/03:pthread_attr_setschedpolicy:3::::: +¡ß:LDP man-pages:3.24:2008/10/24:pthread_attr_setscope:3::::: +¡ß:LDP man-pages:3.24:2008/10/24:pthread_attr_setstack:3::::: +¡ß:LDP man-pages:3.24:2008/10/24:pthread_attr_setstackaddr:3::::: +¡ß:LDP man-pages:3.24:2008/11/05:pthread_attr_setstacksize:3::::: +¡ß:LDP man-pages:3.24:2008/11/17:pthread_cancel:3::::: +¢¨:LDP man-pages:3.24:2008/11/24:pthread_cleanup_pop:3:pthread_cleanup_push:3: +¢¨:LDP man-pages:3.24:2008/12/04:pthread_cleanup_pop_restore_np:3:pthread_cleanup_push_defer_np:3: +¡ß:LDP man-pages:3.24:2008/11/24:pthread_cleanup_push:3::::: +¡ß:LDP man-pages:3.24:2008/12/04:pthread_cleanup_push_defer_np:3::::: +¡ß:LDP man-pages:3.24:2008/11/11:pthread_create:3::::: +¡ß:LDP man-pages:3.24:2008/11/27:pthread_detach:3::::: +¡ß:LDP man-pages:3.24:2009/03/30:pthread_equal:3::::: +¡ß:LDP man-pages:3.24:2009/03/30:pthread_exit:3::::: +¢¨:LDP man-pages:3.24:2008/11/27:pthread_getaffinity_np:3:pthread_setaffinity_np:3: +¡ß:LDP man-pages:3.24:2008/11/11:pthread_getattr_np:3::::: +¢¨:LDP man-pages:3.24:2009/04/10:pthread_getconcurrency:3:pthread_setconcurrency:3: +¡ß:LDP man-pages:3.24:2009/02/08:pthread_getcpuclockid:3::::: +¢¨:LDP man-pages:3.24:2008/11/17:pthread_getschedparam:3:pthread_setschedparam:3: +¡ß:LDP man-pages:3.24:2008/11/27:pthread_join:3::::: +¡ß:LDP man-pages:3.24:2009/01/28:pthread_kill:3::::: +¡ß:LDP man-pages:3.24:2009/01/28:pthread_kill_other_threads_np:3::::: +¡ß:LDP man-pages:3.24:2008/10/24:pthread_self:3::::: +¡ß:LDP man-pages:3.24:2008/11/27:pthread_setaffinity_np:3::::: +¡ß:LDP man-pages:3.24:2008/11/24:pthread_setcancelstate:3::::: +¢¨:LDP man-pages:3.24:2008/11/24:pthread_setcanceltype:3:pthread_setcancelstate:3: +¡ß:LDP man-pages:3.24:2009/04/10:pthread_setconcurrency:3::::: +¡ß:LDP man-pages:3.24:2008/11/17:pthread_setschedparam:3::::: +¡ß:LDP man-pages:3.24:2008/11/06:pthread_setschedprio:3::::: +¡ß:LDP man-pages:3.24:2009/01/25:pthread_sigmask:3::::: +¡ß:LDP man-pages:3.24:2008/11/17:pthread_testcancel:3::::: +¢¨:LDP man-pages:3.24:2008/11/11:pthread_timedjoin_np:3:pthread_tryjoin_np:3: +¡ß:LDP man-pages:3.24:2008/11/11:pthread_tryjoin_np:3::::: +¡ß:LDP man-pages:3.24:2009/04/10:pthread_yield:3::::: +¡û:LDP man-pages:3.24:2008/09/03:ptsname:3:2005/03/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/09/03:ptsname_r:3:ptsname:3: +¡÷:LDP man-pages:3.24:1993/04/04:putc:3:puts:3: +¡÷:LDP man-pages:3.24:2008/08/29:putc_unlocked:3:unlocked_stdio:3: +¡÷:LDP man-pages:3.24:1993/04/04:putchar:3:puts:3: +¡÷:LDP man-pages:3.24:2008/08/29:putchar_unlocked:3:unlocked_stdio:3: +¡û:LDP man-pages:3.24:2007/07/26:putenv:3:2008/07/24::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2003/09/09:putgrent:3:2004/09/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/07/26:putpwent:3:1997/12/18::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¡û:LDP man-pages:3.24:1993/04/04:puts:3:2008/07/24::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2010/02/25:putspent:3:getspnam:3: +¡÷:LDP man-pages:3.24:2008/06/29:pututline:3:getutent:3: +¡÷:LDP man-pages:3.24:2008/06/29:pututxline:3:getutent:3: +¡÷:LDP man-pages:3.24:2007/12/20:putw:3:getw:3: +¡÷:LDP man-pages:3.24:1999/07/25:putwc:3:fputwc:3: +¡÷:LDP man-pages:3.24:2008/08/29:putwc_unlocked:3:unlocked_stdio:3: +¡û:LDP man-pages:3.24:1999/07/25:putwchar:3:2001/11/09::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/08/29:putwchar_unlocked:3:unlocked_stdio:3: +¡û:LDP man-pages:3.24:2007/07/26:qecvt:3:2002/09/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/26:qecvt_r:3:ecvt_r:3: +¡÷:LDP man-pages:3.24:2007/07/26:qfcvt:3:qecvt:3: +¡÷:LDP man-pages:3.24:2007/07/26:qfcvt_r:3:ecvt_r:3: +¡÷:LDP man-pages:3.24:2007/07/26:qgcvt:3:qecvt:3: +¡û:LDP man-pages:3.24:2009/09/15:qsort:3:2007/01/07::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/12/28:queue:3:2004/09/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/10/17:raise:3:1997/12/25::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¡û:LDP man-pages:3.24:2008/08/29:rand:3:2005/03/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/29:rand_r:3:rand:3: +¡û:LDP man-pages:3.24:2009/02/03:random:3:1997/01/21::tyoshino@eng.toyo.ac.jp:YOSHINO Takashi: +¡û:LDP man-pages:3.24:2008/03/07:random_r:3:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/12/04:rawmemchr:3:memchr:3: +¡û:LDP man-pages:3.24:2007/12/28:rcmd:3:1999/03/01::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:1995/07/14:re_comp:3:1997/12/18::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¡÷:LDP man-pages:3.24:1995/07/14:re_exec:3:re_comp:3: +¡û:LDP man-pages:3.24:2009/07/04:readdir:3:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/07/04:readdir_r:3:readdir:3: +¡÷:LDP man-pages:3.24:2009/01/13:realloc:3:malloc:3: +¡û:LDP man-pages:3.24:2009/02/23:realpath:3:2005/09/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1994/08/18:recno:3:1999/08/19::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡÷:LDP man-pages:3.24:2008/05/29:regcomp:3:regex:3: +¡÷:LDP man-pages:3.24:2008/05/29:regerror:3:regex:3: +¡û:LDP man-pages:3.24:2008/05/29:regex:3:2005/03/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/05/29:regexec:3:regex:3: +¡÷:LDP man-pages:3.24:2008/05/29:regfree:3:regex:3: +¡÷:LDP man-pages:3.24:2008/07/17:registerrpc:3:rpc:3: +¡û:LDP man-pages:3.24:2009/02/04:remainder:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/02/04:remainderf:3:remainder:3: +¡÷:LDP man-pages:3.24:2009/02/04:remainderl:3:remainder:3: +¡û:LDP man-pages:3.24:2008/12/03:remove:3:2008/07/24::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/07/11:remque:3:insque:3: +¡û:LDP man-pages:3.24:2008/08/11:remquo:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:remquof:3:remquo:3: +¡÷:LDP man-pages:3.24:2008/08/11:remquol:3:remquo:3: +¡÷:LDP man-pages:3.24:2008/11/07:res_init:3:resolver:3: +¡÷:LDP man-pages:3.24:2008/11/07:res_mkquery:3:resolver:3: +¡÷:LDP man-pages:3.24:2008/11/07:res_query:3:resolver:3: +¡÷:LDP man-pages:3.24:2008/11/07:res_querydomain:3:resolver:3: +¡÷:LDP man-pages:3.24:2008/11/07:res_search:3:resolver:3: +¡÷:LDP man-pages:3.24:2008/11/07:res_send:3:resolver:3: +¡û:LDP man-pages:3.24:2008/11/07:resolver:3:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:1993/11/29:rewind:3:fseek:3: +¡û:LDP man-pages:3.24:1995/06/11:rewinddir:3:1997/12/24::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¡û:LDP man-pages:3.24:2007/12/28:rexec:3:2005/12/28::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/03/15:rindex:3:index:3: +¡û:LDP man-pages:3.24:2008/08/05:rint:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:rintf:3:rint:3: +¡÷:LDP man-pages:3.24:2008/08/05:rintl:3:rint:3: +¡û:LDP man-pages:3.24:2008/08/11:round:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:roundf:3:round:3: +¡÷:LDP man-pages:3.24:2008/08/11:roundl:3:round:3: +¡û:LDP man-pages:3.24:2008/07/17:rpc:3:2001/11/09::ysato@h4.dion.ne.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/07/26:rpmatch:3:2006/07/31::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/28:rresvport:3:rcmd:3: +¡û:LDP man-pages:3.24:2010/02/25:rtime:3:2004/09/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2010/01/11:rtnetlink:3:1999/08/20::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡÷:LDP man-pages:3.24:2007/12/28:ruserok:3:rcmd:3: +¡û:LDP man-pages:3.24:2009/03/15:scalb:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/03/15:scalbf:3:scalb:3: +¡÷:LDP man-pages:3.24:2009/03/15:scalbl:3:scalb:3: +¡ß:LDP man-pages:3.24:2008/08/11:scalbln:3::::: +¢¨:LDP man-pages:3.24:2008/08/11:scalblnf:3:scalbln:3: +¢¨:LDP man-pages:3.24:2008/08/11:scalblnl:3:scalbln:3: +¢¨:LDP man-pages:3.24:2008/08/11:scalbn:3:scalbln:3: +¢¨:LDP man-pages:3.24:2008/08/11:scalbnf:3:scalbln:3: +¢¨:LDP man-pages:3.24:2008/08/11:scalbnl:3:scalbln:3: +¡û:LDP man-pages:3.24:2009/02/10:scandir:3:2006/07/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/07/12:scanf:3:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/12/08:sched_getcpu:3:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/26:seed48:3:drand48:3: +¡÷:LDP man-pages:3.24:2007/07/26:seed48_r:3:drand48_r:3: +¡û:LDP man-pages:3.24:2009/03/11:seekdir:3:1997/12/24::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¡û:LDP man-pages:3.24:2006/03/25:sem_close:3:2006/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2006/03/25:sem_destroy:3:2006/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2006/03/25:sem_getvalue:3:2006/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/07/27:sem_init:3:2006/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/02/20:sem_open:3:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/03/30:sem_post:3:2006/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2010/02/25:sem_timedwait:3:sem_wait:3: +¡÷:LDP man-pages:3.24:2010/02/25:sem_trywait:3:sem_wait:3: +¡û:LDP man-pages:3.24:2006/03/25:sem_unlink:3:2006/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2010/02/25:sem_wait:3:2006/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2003/09/09:setaliasent:3:2004/09/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/06/26:setbuf:3:2001/07/14::ysato@h4.dion.ne.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/06/26:setbuffer:3:setbuf:3: +¡û:LDP man-pages:3.24:2009/09/20:setenv:3:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2002/02/28:setfsent:3:getfsent:3: +¡÷:LDP man-pages:3.24:2009/03/30:setgrent:3:getgrent:3: +¡÷:LDP man-pages:3.24:2009/12/03:sethostent:3:gethostbyname:3: +¡÷:LDP man-pages:3.24:2009/01/13:sethostid:3:gethostid:3: +¡û:LDP man-pages:3.24:2009/06/26:setjmp:3:2009/03/05::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2003/04/04:setkey:3:encrypt:3: +¡÷:LDP man-pages:3.24:2003/04/04:setkey_r:3:encrypt:3: +¡÷:LDP man-pages:3.24:2008/06/26:setlinebuf:3:setbuf:3: +¡û:LDP man-pages:3.24:2008/12/05:setlocale:3:2002/10/12::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2001/10/05:setlogmask:3:2001/11/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/09/15:setmntent:3:getmntent:3: +¡÷:LDP man-pages:3.24:2008/08/19:setnetent:3:getnetent:3: +¡û:LDP man-pages:3.24:2007/07/26:setnetgrent:3:2005/03/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/19:setprotoent:3:getprotoent:3: +¡÷:LDP man-pages:3.24:2009/03/30:setpwent:3:getpwent:3: +¡÷:LDP man-pages:3.24:2008/08/19:setrpcent:3:getrpcent:3: +¡÷:LDP man-pages:3.24:2008/08/19:setservent:3:getservent:3: +¡÷:LDP man-pages:3.24:2010/02/25:setspent:3:getspnam:3: +¡÷:LDP man-pages:3.24:2009/02/03:setstate:3:random:3: +¡÷:LDP man-pages:3.24:2008/03/07:setstate_r:3:random_r:3: +¡÷:LDP man-pages:3.24:2002/07/18:setttyent:3:getttyent:3: +¡÷:LDP man-pages:3.24:2007/07/26:setusershell:3:getusershell:3: +¡÷:LDP man-pages:3.24:2008/06/29:setutent:3:getutent:3: +¡÷:LDP man-pages:3.24:2008/06/29:setutxent:3:getutent:3: +¡÷:LDP man-pages:3.24:2008/06/26:setvbuf:3:setbuf:3: +¡÷:LDP man-pages:3.24:2010/02/25:sgetspent:3:getspnam:3: +¡÷:LDP man-pages:3.24:2010/02/25:sgetspent_r:3:getspnam:3: +¡û:LDP man-pages:3.24:2009/02/25:shm_open:3:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/02/25:shm_unlink:3:shm_open:3: +¡÷:LDP man-pages:3.24:2008/09/01:sigaddset:3:sigsetops:3: +¡÷:LDP man-pages:3.24:2008/09/01:sigandset:3:sigsetops:3: +¡÷:LDP man-pages:3.24:2007/07/26:sigblock:3:sigvec:3: +¡÷:LDP man-pages:3.24:2008/09/01:sigdelset:3:sigsetops:3: +¡÷:LDP man-pages:3.24:2008/09/01:sigemptyset:3:sigsetops:3: +¡÷:LDP man-pages:3.24:2008/09/01:sigfillset:3:sigsetops:3: +¡÷:LDP man-pages:3.24:2007/07/26:siggetmask:3:sigvec:3: +¡÷:LDP man-pages:3.24:2009/03/15:sighold:3:sigset:3: +¡÷:LDP man-pages:3.24:2009/03/15:sigignore:3:sigset:3: +¡û:LDP man-pages:3.24:2009/03/15:siginterrupt:3:1998/05/24::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡÷:LDP man-pages:3.24:2008/09/01:sigisemptyset:3:sigsetops:3: +¡÷:LDP man-pages:3.24:2008/09/01:sigismember:3:sigsetops:3: +¡÷:LDP man-pages:3.24:2009/01/13:siglongjmp:3:longjmp:3: +¡÷:LDP man-pages:3.24:2007/07/26:sigmask:3:sigvec:3: +¡û:LDP man-pages:3.24:2008/08/05:signbit:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:signgam:3:lgamma:3: +¡û:LDP man-pages:3.24:2009/02/04:significand:3:2005/02/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2009/02/04:significandf:3:significand:3: +¡÷:LDP man-pages:3.24:2009/02/04:significandl:3:significand:3: +¡÷:LDP man-pages:3.24:2008/09/01:sigorset:3:sigsetops:3: +¡û:LDP man-pages:3.24:2005/12/01:sigpause:3:2005/12/05::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/03/15:sigrelse:3:sigset:3: +¡û:LDP man-pages:3.24:2009/03/15:sigset:3:2005/12/08::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/06/26:sigsetjmp:3:setjmp:3: +¡÷:LDP man-pages:3.24:2007/07/26:sigsetmask:3:sigvec:3: +¡û:LDP man-pages:3.24:2008/09/01:sigsetops:3:2005/12/05::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:sigvec:3:2005/12/13::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/02/10:sigwait:3:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/02/04:sin:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/11:sincos:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:sincosf:3:sincos:3: +¡÷:LDP man-pages:3.24:2008/08/11:sincosl:3:sincos:3: +¡÷:LDP man-pages:3.24:2009/02/04:sinf:3:sin:3: +¡û:LDP man-pages:3.24:2008/08/05:sinh:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:sinhf:3:sinh:3: +¡÷:LDP man-pages:3.24:2008/08/05:sinhl:3:sinh:3: +¡÷:LDP man-pages:3.24:2009/02/04:sinl:3:sin:3: +¡û:LDP man-pages:3.24:2010/02/03:sleep:3:1997/01/21::tyoshino@eng.toyo.ac.jp:YOSHINO Takashi: +¡÷:LDP man-pages:3.24:2008/12/19:snprintf:3:printf:3: +¡û:LDP man-pages:3.24:2008/12/03:sockatmark:3:2006/08/19::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/12/19:sprintf:3:printf:3: +¡û:LDP man-pages:3.24:2008/08/05:sqrt:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:sqrtf:3:sqrt:3: +¡÷:LDP man-pages:3.24:2008/08/05:sqrtl:3:sqrt:3: +¡÷:LDP man-pages:3.24:2008/08/29:srand:3:rand:3: +¡÷:LDP man-pages:3.24:2007/07/26:srand48:3:drand48:3: +¡÷:LDP man-pages:3.24:2007/07/26:srand48_r:3:drand48_r:3: +¡÷:LDP man-pages:3.24:2009/02/03:srandom:3:random:3: +¡÷:LDP man-pages:3.24:2008/03/07:srandom_r:3:random_r:3: +¡÷:LDP man-pages:3.24:2008/07/12:sscanf:3:scanf:3: +¡÷:LDP man-pages:3.24:2007/07/26:ssignal:3:gsignal:3: +¡û:LDP man-pages:3.24:2001/10/14:stdarg:3:2008/07/24::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/07/14:stderr:3:stdin:3: +¡û:LDP man-pages:3.24:2008/07/14:stdin:3:2005/09/05::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2001/12/26:stdio:3:2004/02/06::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2001/12/16:stdio_ext:3:2002/08/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/07/14:stdout:3:stdin:3: +¡û:LDP man-pages:3.24:2009/02/04:stpcpy:3:1997/12/26::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¡û:LDP man-pages:3.24:1999/07/25:stpncpy:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:1993/04/11:strcasecmp:3:1997/12/25::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¡÷:LDP man-pages:3.24:2005/04/05:strcasestr:3:strstr:3: +¡û:LDP man-pages:3.24:2008/06/13:strcat:3:2005/03/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/08/11:strchr:3:2006/07/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:strchrnul:3:strchr:3: +¡û:LDP man-pages:3.24:2009/04/21:strcmp:3:2001/10/18::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1993/04/12:strcoll:3:2007/06/01::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/12/04:strcpy:3:2008/07/23::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:1993/04/12:strcspn:3:strspn:3: +¡û:LDP man-pages:3.24:2007/07/26:strdup:3:2008/07/24::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2007/07/26:strdupa:3:strdup:3: +¡û:LDP man-pages:3.24:2009/03/30:strerror:3:2005/12/26::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/03/30:strerror_r:3:strerror:3: +¡û:LDP man-pages:3.24:2000/12/05:strfmon:3:2001/02/14::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:1993/04/12:strfry:3:1998/05/25::motoki@hal.t.u-tokyo.ac.jp:Akihiro Motoki: +¡û:LDP man-pages:3.24:2010/01/17:strftime:3:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2010/02/25:string:3:1997/01/20::yoshino@civil.jcn.nihon-u.ac.jp:YOSHINO Takashi: +¡û:LDP man-pages:3.24:1993/04/12:strlen:3:1997/01/20::tyoshino@eng.toyo.ac.jp:YOSHINO Takashi: +¡÷:LDP man-pages:3.24:1993/04/11:strncasecmp:3:strcasecmp:3: +¡÷:LDP man-pages:3.24:2008/06/13:strncat:3:strcat:3: +¡÷:LDP man-pages:3.24:2009/04/21:strncmp:3:strcmp:3: +¡÷:LDP man-pages:3.24:2009/12/04:strncpy:3:strcpy:3: +¡÷:LDP man-pages:3.24:2007/07/26:strndup:3:strdup:3: +¡÷:LDP man-pages:3.24:2007/07/26:strndupa:3:strdup:3: +¡û:LDP man-pages:3.24:1999/07/25:strnlen:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:1993/04/12:strpbrk:3:1999/12/25::argrath@yo.rim.or.jp:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/12/05:strptime:3:2002/01/14::ysato@h4.dion.ne.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/08/11:strrchr:3:strchr:3: +¡û:LDP man-pages:3.24:2009/01/16:strsep:3:2009/03/05::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:1999/02/08:strsignal:3:1999/12/25::argrath@yo.rim.or.jp:Kentaro Shirakata: +¡û:LDP man-pages:3.24:1993/04/12:strspn:3:1997/12/16::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¡û:LDP man-pages:3.24:2005/04/05:strstr:3:2008/07/24::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2007/07/26:strtod:3:2006/07/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/26:strtof:3:strtod:3: +¡û:LDP man-pages:3.24:2003/11/28:strtoimax:3:2004/09/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/10/29:strtok:3:2005/11/19:o:amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/10/29:strtok_r:3:strtok:3: +¡û:LDP man-pages:3.24:2007/07/26:strtol:3:2006/07/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/26:strtold:3:strtod:3: +¡÷:LDP man-pages:3.24:2007/07/26:strtoll:3:strtol:3: +¡÷:LDP man-pages:3.24:2007/07/26:strtoq:3:strtol:3: +¡û:LDP man-pages:3.24:2007/07/26:strtoul:3:2006/07/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/07/26:strtoull:3:strtoul:3: +¡÷:LDP man-pages:3.24:2003/11/28:strtoumax:3:strtoimax:3: +¡÷:LDP man-pages:3.24:2007/07/26:strtouq:3:strtoul:3: +¡û:LDP man-pages:3.24:2001/12/19:strverscmp:3:2002/09/22::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1993/04/12:strxfrm:3:1999/03/24::ss236rx@ymg.urban.ne.jp:Shouichi Saito: +¡÷:LDP man-pages:3.24:2008/07/17:svc_destroy:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svc_freeargs:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svc_getargs:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svc_getcaller:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svc_getreq:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svc_getreqset:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svc_register:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svc_run:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svc_sendreply:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svc_unregister:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svcerr_auth:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svcerr_decode:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svcerr_noproc:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svcerr_noprog:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svcerr_progvers:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svcerr_systemerr:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svcerr_weakauth:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svcfd_create:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svcraw_create:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svctcp_create:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svcudp_bufcreate:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:svcudp_create:3:rpc:3: +¡û:LDP man-pages:3.24:2001/12/15:swab:3:2008/07/24::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2009/03/31:swapcontext:3:makecontext:3: +¡÷:LDP man-pages:3.24:2007/07/26:swprintf:3:wprintf:3: +¡÷:LDP man-pages:3.24:2007/07/26:sys_errlist:3:perror:3: +¡÷:LDP man-pages:3.24:2007/07/26:sys_nerr:3:perror:3: +¡û:LDP man-pages:3.24:2007/12/12:sysconf:3:2005/03/31::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/11/12:syslog:3:2008/07/24:o:argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2004/12/20:system:3:2005/03/12:o:amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/05/04:sysv_signal:3:2007/06/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/05:tan:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:tanf:3:tan:3: +¡û:LDP man-pages:3.24:2008/08/05:tanh:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/05:tanhf:3:tanh:3: +¡÷:LDP man-pages:3.24:2008/08/05:tanhl:3:tanh:3: +¡÷:LDP man-pages:3.24:2008/08/05:tanl:3:tan:3: +¡÷:LDP man-pages:3.24:2007/11/26:tcdrain:3:termios:3: +¡÷:LDP man-pages:3.24:2007/11/26:tcflow:3:termios:3: +¡÷:LDP man-pages:3.24:2007/11/26:tcflush:3:termios:3: +¡÷:LDP man-pages:3.24:2007/11/26:tcgetattr:3:termios:3: +¡û:LDP man-pages:3.24:2003/01/28:tcgetpgrp:3:2003/08/30::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/06/14:tcgetsid:3:2003/08/30::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/11/26:tcsendbreak:3:termios:3: +¡÷:LDP man-pages:3.24:2007/11/26:tcsetattr:3:termios:3: +¡÷:LDP man-pages:3.24:2003/01/28:tcsetpgrp:3:tcgetpgrp:3: +¡÷:LDP man-pages:3.24:2008/09/23:tdelete:3:tsearch:3: +¡÷:LDP man-pages:3.24:2008/09/23:tdestroy:3:tsearch:3: +¡û:LDP man-pages:3.24:2009/03/11:telldir:3:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/07/26:tempnam:3:2006/07/26::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/11/26:termios:3:2007/05/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/09/23:tfind:3:tsearch:3: +¡û:LDP man-pages:3.24:2008/08/11:tgamma:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:tgammaf:3:tgamma:3: +¡÷:LDP man-pages:3.24:2008/08/11:tgammal:3:tgamma:3: +¡û:LDP man-pages:3.24:2007/07/26:timegm:3:2002/01/14::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡÷:LDP man-pages:3.24:2007/07/26:timelocal:3:timegm:3: +¡û:LDP man-pages:3.24:2010/02/25:timeradd:3:2007/10/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2010/02/25:timerclear:3:timeradd:3: +¡÷:LDP man-pages:3.24:2010/02/25:timercmp:3:timeradd:3: +¡÷:LDP man-pages:3.24:2010/02/25:timerisset:3:timeradd:3: +¡÷:LDP man-pages:3.24:2010/02/25:timersub:3:timeradd:3: +¡÷:LDP man-pages:3.24:2010/02/25:timezone:3:tzset:3: +¡û:LDP man-pages:3.24:2008/07/14:tmpfile:3:2001/12/14:o:ysato@h4.dion.ne.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2003/11/15:tmpnam:3:2006/07/26:o:amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2003/11/15:tmpnam_r:3:tmpnam:3: +¡û:LDP man-pages:3.24:2009/03/15:toascii:3:1997/12/16::nishi@rpts.cl.nec.co.jp:HIROFUMI Nishizuka: +¡÷:LDP man-pages:3.24:1993/04/04:tolower:3:toupper:3: +¡û:LDP man-pages:3.24:1993/04/04:toupper:3:1997/04/29::rui@linux.or.jp:Ueyama Rui: +¡û:LDP man-pages:3.24:1999/07/25:towctrans:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:towlower:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:towupper:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:2008/08/11:trunc:3:2008/09/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/11:truncf:3:trunc:3: +¡÷:LDP man-pages:3.24:2008/08/11:truncl:3:trunc:3: +¡û:LDP man-pages:3.24:2008/09/23:tsearch:3:2002/02/14::ysato@h4.dion.ne.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/07/14:ttyname:3:2008/07/24::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/07/14:ttyname_r:3:ttyname:3: +¡û:LDP man-pages:3.24:2007/11/26:ttyslot:3:2004/09/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/09/23:twalk:3:tsearch:3: +¡÷:LDP man-pages:3.24:2010/02/25:tzname:3:tzset:3: +¡û:LDP man-pages:3.24:2010/02/25:tzset:3:2007/01/07::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/06:ualarm:3:2007/05/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2010/02/25:ulckpwdf:3:getspnam:3: +¡û:LDP man-pages:3.24:2008/08/06:ulimit:3:1998/12/06::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2010/02/10:undocumented:3:2005/02/21::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/06:ungetc:3:gets:3: +¡û:LDP man-pages:3.24:1999/09/19:ungetwc:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:2008/08/29:unlocked_stdio:3:2001/11/03::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/06/14:unlockpt:3:2003/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/09/20:unsetenv:3:setenv:3: +¡û:LDP man-pages:3.24:2008/07/02:updwtmp:3:2008/10/08::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2008/07/02:updwtmpx:3:updwtmp:3: +¡û:LDP man-pages:3.24:2007/07/26:usleep:3:2007/05/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/06/29:utmpname:3:getutent:3: +¡÷:LDP man-pages:3.24:2008/06/29:utmpxname:3:getutent:3: +¡÷:LDP man-pages:3.24:2001/10/14:va_arg:3:stdarg:3: +¡÷:LDP man-pages:3.24:2001/10/14:va_copy:3:stdarg:3: +¡÷:LDP man-pages:3.24:2001/10/14:va_end:3:stdarg:3: +¡÷:LDP man-pages:3.24:2001/10/14:va_start:3:stdarg:3: +¡÷:LDP man-pages:3.24:2009/03/30:valloc:3:posix_memalign:3: +¡÷:LDP man-pages:3.24:2001/12/18:vasprintf:3:asprintf:3: +¡÷:LDP man-pages:3.24:2008/06/14:vdprintf:3:dprintf:3: +¡÷:LDP man-pages:3.24:2007/12/28:verr:3:err:3: +¡÷:LDP man-pages:3.24:2007/12/28:verrx:3:err:3: +¡÷:LDP man-pages:3.24:2009/02/10:versionsort:3:scandir:3: +¡÷:LDP man-pages:3.24:2008/12/19:vfprintf:3:printf:3: +¡÷:LDP man-pages:3.24:2008/07/12:vfscanf:3:scanf:3: +¡÷:LDP man-pages:3.24:2007/07/26:vfwprintf:3:wprintf:3: +¡÷:LDP man-pages:3.24:2008/12/19:vprintf:3:printf:3: +¡÷:LDP man-pages:3.24:2008/07/12:vscanf:3:scanf:3: +¡÷:LDP man-pages:3.24:2008/12/19:vsnprintf:3:printf:3: +¡÷:LDP man-pages:3.24:2008/12/19:vsprintf:3:printf:3: +¡÷:LDP man-pages:3.24:2008/07/12:vsscanf:3:scanf:3: +¡÷:LDP man-pages:3.24:2007/07/26:vswprintf:3:wprintf:3: +¡÷:LDP man-pages:3.24:2008/11/12:vsyslog:3:syslog:3: +¡÷:LDP man-pages:3.24:2007/12/28:vwarn:3:err:3: +¡÷:LDP man-pages:3.24:2007/12/28:vwarnx:3:err:3: +¡÷:LDP man-pages:3.24:2007/07/26:vwprintf:3:wprintf:3: +¡÷:LDP man-pages:3.24:2007/12/28:warn:3:err:3: +¡÷:LDP man-pages:3.24:2007/12/28:warnx:3:err:3: +¡û:LDP man-pages:3.24:1999/07/25:wcpcpy:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:2003/11/01:wcpncpy:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcrtomb:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:2009/02/04:wcscasecmp:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcscat:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcschr:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcscmp:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcscpy:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcscspn:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:2009/02/04:wcsdup:3:2004/06/13::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:1999/07/25:wcslen:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:2009/02/04:wcsncasecmp:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcsncat:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcsncmp:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcsncpy:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:2007/07/26:wcsnlen:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:2007/07/26:wcsnrtombs:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcspbrk:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcsrchr:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcsrtombs:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcsspn:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcsstr:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:2003/11/01:wcstoimax:3:2004/09/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:1999/07/25:wcstok:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcstombs:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡÷:LDP man-pages:3.24:2003/11/01:wcstoumax:3:wcstoimax:3: +¡û:LDP man-pages:3.24:2007/07/26:wcswidth:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:2009/02/04:wctob:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wctomb:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:1999/07/25:wctrans:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wctype:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wcwidth:3:2002/08/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1999/07/25:wmemchr:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wmemcmp:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wmemcpy:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:1999/07/25:wmemmove:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡÷:LDP man-pages:3.24:2008/08/12:wmempcpy:3:mempcpy:3: +¡û:LDP man-pages:3.24:1999/07/25:wmemset:3:1999/10/29::fujiwara@linux.or.jp:FUJIWARA Teruyoshi: +¡û:LDP man-pages:3.24:2008/07/14:wordexp:3:2004/09/29::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/07/14:wordfree:3:wordexp:3: +¡û:LDP man-pages:3.24:2007/07/26:wprintf:3:2000/01/11::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:2003/04/04:xcrypt:3:2004/10/16::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2003/04/04:xdecrypt:3:xcrypt:3: +¡û:LDP man-pages:3.24:2007/12/30:xdr:3:2000/01/14::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡÷:LDP man-pages:3.24:2008/07/17:xdr_accepted_reply:3:rpc:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_array:3:xdr:3: +¡÷:LDP man-pages:3.24:2008/07/17:xdr_authunix_parms:3:rpc:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_bool:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_bytes:3:xdr:3: +¡÷:LDP man-pages:3.24:2008/07/17:xdr_callhdr:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:xdr_callmsg:3:rpc:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_char:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_destroy:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_double:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_enum:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_float:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_free:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_getpos:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_inline:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_int:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_long:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_opaque:3:xdr:3: +¡÷:LDP man-pages:3.24:2008/07/17:xdr_opaque_auth:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:xdr_pmap:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:xdr_pmaplist:3:rpc:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_pointer:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_reference:3:xdr:3: +¡÷:LDP man-pages:3.24:2008/07/17:xdr_rejected_reply:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:xdr_replymsg:3:rpc:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_setpos:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_short:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_string:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_u_char:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_u_int:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_u_long:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_u_short:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_union:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_vector:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_void:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdr_wrapstring:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdrmem_create:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdrrec_create:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdrrec_endofrecord:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdrrec_eof:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdrrec_skiprecord:3:xdr:3: +¡÷:LDP man-pages:3.24:2007/12/30:xdrstdio_create:3:xdr:3: +¡÷:LDP man-pages:3.24:2003/04/04:xencrypt:3:xcrypt:3: +¡÷:LDP man-pages:3.24:2008/07/17:xprt_register:3:rpc:3: +¡÷:LDP man-pages:3.24:2008/07/17:xprt_unregister:3:rpc:3: +¡û:LDP man-pages:3.24:2008/08/10:y0:3:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/08/10:y0f:3:y0:3: +¡÷:LDP man-pages:3.24:2008/08/10:y0l:3:y0:3: +¡÷:LDP man-pages:3.24:2008/08/10:y1:3:y0:3: +¡÷:LDP man-pages:3.24:2008/08/10:y1f:3:y0:3: +¡÷:LDP man-pages:3.24:2008/08/10:y1l:3:y0:3: +¡÷:LDP man-pages:3.24:2008/08/10:yn:3:y0:3: +¡÷:LDP man-pages:3.24:2008/08/10:ynf:3:y0:3: +¡÷:LDP man-pages:3.24:2008/08/10:ynl:3:y0:3: +¡û:LDP man-pages:3.24:1994/10/31:console:4:2002/01/14:o:argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2008/01/01:console_codes:4:2008/10/08::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/02/28:console_ioctl:4:2008/07/22::argrath@ub32.org:Kentaro Shirakata: +¡ß:LDP man-pages:3.24:2009/03/31:cpuid:4::::: +¡û:LDP man-pages:3.24:2000/03/01:dsp56k:4:2000/07/11::sato@complex.eng.hokudai.ac.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2009/02/01:epoll:4:epoll:7: +¡û:LDP man-pages:3.24:1995/01/29:fd:4:1998/01/12:o:ishikawa@linux.or.jp:ISHIKAWA Mutsumi: +¡÷:LDP man-pages:3.24:2008/12/03:fifo:4:fifo:7: +¡û:LDP man-pages:3.24:1997/08/02:full:4:2006/07/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2002/12/31:futex:4:futex:7: +¡û:LDP man-pages:3.24:1992/12/17:hd:4:1998/02/05:o:ishikawa@linux.or.jp:ISHIKAWA Mutsumi: +¡û:LDP man-pages:3.24:2009/04/04:initrd:4:2005/10/09:o:amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/10/23:intro:4:1998/02/05:o:ishikawa@linux.or.jp:ISHIKAWA Mutsumi: +¡÷:LDP man-pages:3.24:1992/11/21:kmem:4:mem:4: +¡û:LDP man-pages:3.24:1995/01/15:lp:4:1998/02/05:o:ishikawa@linux.or.jp:ISHIKAWA Mutsumi: +¡û:LDP man-pages:3.24:1992/11/21:mem:4:1998/02/05:o:ishikawa@linux.or.jp:ISHIKAWA Mutsumi: +¡û:LDP man-pages:3.24:1996/02/10:mouse:4:1999/03/24:o:ss236rx@ymg.urban.ne.jp:Shouichi Saito: +¡ß:LDP man-pages:3.24:2009/03/31:msr:4::::: +¡û:LDP man-pages:3.24:2009/02/23:null:4:1998/02/05:o:ishikawa@linux.or.jp:ISHIKAWA Mutsumi: +¡÷:LDP man-pages:3.24:1992/11/21:port:4:mem:4: +¡÷:LDP man-pages:3.24:2002/10/09:ptmx:4:pts:4: +¡û:LDP man-pages:3.24:2002/10/09:pts:4:2003/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1992/11/21:ram:4:1997/01/12:o:ishikawa@linux.or.jp:ISHIKAWA Mutsumi: +¡û:LDP man-pages:3.24:2008/06/20:random:4:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2010/02/25:rtc:4:2007/02/08::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:1992/12/17:sd:4:1998/02/05::ishikawa@linux.or.jp:ISHIKAWA Mutsumi: +¡û:LDP man-pages:3.24:2007/11/25:sk98lin:4:2007/06/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/12/16:st:4:2005/06/12::nakano@st.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2003/04/07:tty:4:2003/09/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1992/12/19:ttyS:4:1998/02/05::ishikawa@linux.or.jp:ISHIKAWA Mutsumi: +¡û:LDP man-pages:3.24:2008/10/29:tty_ioctl:4:2004/11/16::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2008/06/20:urandom:4:random:4: +¡û:LDP man-pages:3.24:2007/12/17:vcs:4:2001/02/11::sato@complex.eng.hokudai.ac.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2007/12/17:vcsa:4:vcs:4: +¡û:LDP man-pages:3.24:1996/10/22:wavelan:4:1998/02/10::ishikawa@linux.or.jp:ISHIKAWA Mutsumi: +¡÷:LDP man-pages:3.24:2009/02/23:zero:4:null:4: +¡û:LDP man-pages:3.24:2008/06/15:acct:5:2008/08/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1994/11/28:charmap:5:2008/07/22::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2009/07/25:complex:5:complex:7: +¡û:LDP man-pages:3.24:2010/02/25:core:5:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2001/12/26:dir_colors:5:2002/01/14::ysato@h4.dion.ne.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/12/28:elf:5:2005/11/03::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2009/07/25:environ:5:environ:7: +¡û:LDP man-pages:3.24:2007/12/14:filesystems:5:2008/02/08::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2007/12/14:fs:5:filesystems:5: +¡û:LDP man-pages:3.24:2000/08/27:ftpusers:5:2001/03/12::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2009/10/17:group:5:2005/03/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2003/08/23:host.conf:5:2003/10/15::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2002/06/16:hosts:5:2005/09/06::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2003/08/24:hosts.equiv:5:2005/03/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/10/23:intro:5:1998/10/13::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡÷:LDP man-pages:3.24:2009/01/26:ipc:5:svipc:7: +¡û:LDP man-pages:3.24:1993/07/24:issue:5:1998/07/25::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2008/06/17:locale:5:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1992/12/29:motd:5:1998/2/4::nagoya@cc.hit-u.ac.jp:Hiroaki Nagoya: +¡ß:LDP man-pages:3.24:2008/09/04:networks:5::::: +¡û:LDP man-pages:3.24:1992/12/29:nologin:5:1998/02/18::rui@linux.or.jp:Ueyama Rui: +¡û:LDP man-pages:3.24:1999/10/01:nscd.conf:5:2006/07/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1999/01/17:nsswitch.conf:5:2001/10/18::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¢¨:LDP man-pages:3.24:2008/08/15:numa_maps:5:numa:7: +¡û:LDP man-pages:3.24:1998/01/05:passwd:5:2006/07/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/09/30:proc:5:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/09/23:protocols:5:2008/07/22::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/03/01:resolv.conf:5:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/03/01:resolver:5:resolv.conf:5: +¡û:LDP man-pages:3.24:1985/09/26:rpc:5:2008/07/22::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:1992/12/29:securetty:5:2003/01/08::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/09/23:services:5:2002/08/14::amotoki@dd.iij4u.or.jp:Akihiro Motoki: +¡û:LDP man-pages:3.24:1993/11/21:shells:5:2000/12/11::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2001/06/19:slabinfo:5:2001/09/10::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:1996/10/21:termcap:5:2000/10/12::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:1993/07/24:ttytype:5:1998/02/10::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:1996/06/05:tzfile:5:1999/09/14::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2008/10/10:utmp:5:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2008/10/10:utmpx:5:utmp:5: +¡÷:LDP man-pages:3.24:2008/10/10:wtmp:5:utmp:5: +¡û:LDP man-pages:3.24:2007/10/23:intro:6:1997/11/15::pessi@kmc.kyoto-u.ac.jp:II Ryouta: +¡ß:LDP man-pages:3.24:2009/01/21:armscii-8:7::::: +¡û:LDP man-pages:3.24:2008/11/25:arp:7:2009/01/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/02/12:ascii:7:2006/04/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/06/03:boot:7:2005/03/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/12/16:bootparam:7:2007/05/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2010/01/31:capabilities:7:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/06/03:charsets:7:2008/07/22::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/07/25:complex:7:2006/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡ß:LDP man-pages:3.24:2009/01/15:cp1251:7::::: +¡ß:LDP man-pages:3.24:2008/11/12:cpuset:7::::: +¡û:LDP man-pages:3.24:2008/06/03:credentials:7:2008/08/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/11/20:ddp:7:1999/12/06::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2009/07/25:environ:7:2006/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/02/01:epoll:7:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/12/13:feature_test_macros:7:2007/10/11::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/12/03:fifo:7:2006/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2002/12/31:futex:7:2006/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¢¨:LDP man-pages:3.24:2009/01/13:glibc:7:libc:7: +¡û:LDP man-pages:3.24:2003/08/24:glob:7:2003/09/28::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2009/03/30:hier:7:2002/01/14::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡ß:LDP man-pages:3.24:2008/06/11:hostname:7::::: +¡û:LDP man-pages:3.24:2010/02/25:icmp:7:2009/01/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/11/18:inotify:7:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:1993/04/23:intro:7:2005/12/05::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/02/28:ip:7:2009/01/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/02/28:ipv6:7:2006/01/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:1999/05/31:iso-8859-1:7:iso_8859-1:7: +¢¨:LDP man-pages:3.24:2009/01/15:iso-8859-10:7:iso_8859-10:7: +¢¨:LDP man-pages:3.24:2009/01/28:iso-8859-11:7:iso_8859-11:7: +¢¨:LDP man-pages:3.24:2009/01/15:iso-8859-13:7:iso_8859-13:7: +¢¨:LDP man-pages:3.24:2009/01/15:iso-8859-14:7:iso_8859-14:7: +¡÷:LDP man-pages:3.24:1999/05/31:iso-8859-15:7:iso_8859-15:7: +¡÷:LDP man-pages:3.24:2003/03/05:iso-8859-16:7:iso_8859-16:7: +¡÷:LDP man-pages:3.24:2007/11/25:iso-8859-2:7:iso_8859-2:7: +¢¨:LDP man-pages:3.24:2009/01/15:iso-8859-3:7:iso_8859-3:7: +¢¨:LDP man-pages:3.24:2009/01/24:iso-8859-4:7:iso_8859-4:7: +¢¨:LDP man-pages:3.24:2009/01/15:iso-8859-5:7:iso_8859-5:7: +¢¨:LDP man-pages:3.24:2009/01/27:iso-8859-6:7:iso_8859-6:7: +¡÷:LDP man-pages:3.24:2008/10/30:iso-8859-7:7:iso_8859-7:7: +¢¨:LDP man-pages:3.24:2009/01/15:iso-8859-8:7:iso_8859-8:7: +¡÷:LDP man-pages:3.24:2002/09/24:iso-8859-9:7:iso_8859-9:7: +¡û:LDP man-pages:3.24:1999/05/31:iso_8859-1:7:2002/09/14::argrath@ub32.org:Kentaro Shirakata: +¡ß:LDP man-pages:3.24:2009/01/15:iso_8859-10:7::::: +¡ß:LDP man-pages:3.24:2009/01/28:iso_8859-11:7::::: +¡ß:LDP man-pages:3.24:2009/01/15:iso_8859-13:7::::: +¡ß:LDP man-pages:3.24:2009/01/15:iso_8859-14:7::::: +¡û:LDP man-pages:3.24:1999/05/31:iso_8859-15:7:2002/09/28::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡û:LDP man-pages:3.24:2003/03/05:iso_8859-16:7:2003/09/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/11/25:iso_8859-2:7:2002/09/28::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡ß:LDP man-pages:3.24:2009/01/15:iso_8859-3:7::::: +¡ß:LDP man-pages:3.24:2009/01/24:iso_8859-4:7::::: +¡ß:LDP man-pages:3.24:2009/01/15:iso_8859-5:7::::: +¡ß:LDP man-pages:3.24:2009/01/27:iso_8859-6:7::::: +¡û:LDP man-pages:3.24:2008/10/30:iso_8859-7:7:2002/09/28::hanataka@abyss.rim.or.jp:HANATAKA Shinya: +¡ß:LDP man-pages:3.24:2009/01/15:iso_8859-8:7::::: +¡û:LDP man-pages:3.24:2002/09/24:iso_8859-9:7:2003/01/20::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:1999/05/31:iso_8859_1:7:iso_8859-1:7: +¢¨:LDP man-pages:3.24:2009/01/15:iso_8859_10:7:iso_8859-10:7: +¢¨:LDP man-pages:3.24:2009/01/28:iso_8859_11:7:iso_8859-11:7: +¢¨:LDP man-pages:3.24:2009/01/15:iso_8859_13:7:iso_8859-13:7: +¢¨:LDP man-pages:3.24:2009/01/15:iso_8859_14:7:iso_8859-14:7: +¡÷:LDP man-pages:3.24:1999/05/31:iso_8859_15:7:iso_8859-15:7: +¡÷:LDP man-pages:3.24:2003/03/05:iso_8859_16:7:iso_8859-16:7: +¡÷:LDP man-pages:3.24:2007/11/25:iso_8859_2:7:iso_8859-2:7: +¢¨:LDP man-pages:3.24:2009/01/15:iso_8859_3:7:iso_8859-3:7: +¢¨:LDP man-pages:3.24:2009/01/24:iso_8859_4:7:iso_8859-4:7: +¢¨:LDP man-pages:3.24:2009/01/15:iso_8859_5:7:iso_8859-5:7: +¢¨:LDP man-pages:3.24:2009/01/27:iso_8859_6:7:iso_8859-6:7: +¡÷:LDP man-pages:3.24:2008/10/30:iso_8859_7:7:iso_8859-7:7: +¢¨:LDP man-pages:3.24:2009/01/15:iso_8859_8:7:iso_8859-8:7: +¡÷:LDP man-pages:3.24:2002/09/24:iso_8859_9:7:iso_8859-9:7: +¡û:LDP man-pages:3.24:2009/02/04:koi8-r:7:2001/07/14::ysato@h4.dion.ne.jp:Yuichi SATO: +¡ß:LDP man-pages:3.24:2009/01/15:koi8-u:7::::: +¡÷:LDP man-pages:3.24:1999/05/31:latin1:7:iso_8859-1:7: +¡÷:LDP man-pages:3.24:2003/03/05:latin10:7:iso_8859-16:7: +¡÷:LDP man-pages:3.24:2007/11/25:latin2:7:iso_8859-2:7: +¢¨:LDP man-pages:3.24:2009/01/15:latin3:7:iso_8859-3:7: +¢¨:LDP man-pages:3.24:2009/01/24:latin4:7:iso_8859-4:7: +¡÷:LDP man-pages:3.24:2002/09/24:latin5:7:iso_8859-9:7: +¢¨:LDP man-pages:3.24:2009/01/15:latin6:7:iso_8859-10:7: +¢¨:LDP man-pages:3.24:2009/01/15:latin7:7:iso_8859-13:7: +¢¨:LDP man-pages:3.24:2009/01/15:latin8:7:iso_8859-14:7: +¡÷:LDP man-pages:3.24:1999/05/31:latin9:7:iso_8859-15:7: +¡ß:LDP man-pages:3.24:2009/01/13:libc:7::::: +¡û:LDP man-pages:3.24:2008/12/05:locale:7:2006/02/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2004/09/15:mailaddr:7:2005/03/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/05/30:man:7:2007/06/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/10/28:man-pages:7:2008/02/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/08/11:math_error:7:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:0000/00/00:mdoc:7:2008/10/08::argrath@ub32.org:Kentaro Shirakata: +£ã:LDP man-pages:3.24:0000/00/00:mdoc.samples:7:1999/01/21::man-jp@freebsd.org:FreeBSD jpman project:http://www.jp.freebsd.org/man-jp/ +¡û:LDP man-pages:3.24:2009/09/27:mq_overview:7:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/01/14:netdevice:7:2009/03/05::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2008/11/11:netlink:7:2006/07/12::ysato444@yahoo.co.jp:Yuichi SATO: +¡ß:LDP man-pages:3.24:2008/08/15:numa:7::::: +¡û:LDP man-pages:3.24:2004/08/24:operator:7:2004/11/16::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/08/08:packet:7:2005/03/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/12/05:path_resolution:7:2007/06/13::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2005/12/08:pipe:7:2005/12/27::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2007/12/21:posixoptions:7:2005/01/14::ysato444@yahoo.co.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2008/11/18:pthreads:7:2009/01/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2005/10/10:pty:7:2005/10/14::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/11/20:raw:7:2007/01/05::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/01/12:regex:7:1998/07/08::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡ß:LDP man-pages:3.24:2009/03/30:rtld-audit:7::::: +¡û:LDP man-pages:3.24:2008/08/08:rtnetlink:7:2001/03/11::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:2009/02/25:sem_overview:7:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/06/25:shm_overview:7:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2010/02/03:signal:7:2008/08/19::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/12/03:socket:7:2007/01/05::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡ù:LDP man-pages:2.67=>3.24:2007/12/20:spufs:7:2007/10/23::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/06/01:standards:7:2006/08/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2000/11/16:suffixes:7:2001/04/24::ysato@h4.dion.ne.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2009/01/26:svipc:7:2006/07/16::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡ß:LDP man-pages:3.24:2008/06/18:symlink:7::::: +¡û:LDP man-pages:3.24:2009/09/30:tcp:7:2009/03/09::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2006/12/28:termio:7:2007/05/04::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2010/02/25:time:7:2008/08/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¢¨:LDP man-pages:3.24:2009/01/28:tis-620:7:iso_8859-11:7: +¡û:LDP man-pages:3.24:2009/09/30:udp:7:2009/01/15::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2008/12/03:udplite:7:2008/10/12::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2001/05/11:unicode:7:2001/07/14::ysato@h4.dion.ne.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2001/12/22:units:7:2002/01/14::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2008/12/01:unix:7:2008/08/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2000/03/14:uri:7:2008/07/22::argrath@ub32.org:Kentaro Shirakata: +¡÷:LDP man-pages:3.24:2000/03/14:url:7:uri:7: +¡÷:LDP man-pages:3.24:2000/03/14:urn:7:uri:7: +¡û:LDP man-pages:3.24:2001/05/11:utf-8:7:2001/07/14::ysato@h4.dion.ne.jp:Yuichi SATO: +¡÷:LDP man-pages:3.24:2001/05/11:utf8:7:utf-8:7: +¡û:LDP man-pages:3.24:2008/08/08:x25:7:1999/12/06::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2007/10/23:intro:8:2008/02/10::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡÷:LDP man-pages:3.24:2009/01/12:ld-linux:8:ld.so:8: +¡÷:LDP man-pages:3.24:2009/01/12:ld-linux.so:8:ld.so:8: +¡û:LDP man-pages:3.24:2009/01/12:ld.so:8:2010/04/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: +¡û:LDP man-pages:3.24:2009/04/15:ldconfig:8:2002/08/20::ysato@h4.dion.ne.jp:Yuichi SATO:The ancestor is in ld.so. +¡û:LDP man-pages:3.24:2008/12/05:nscd:8:2009/03/14::argrath@ub32.org:Kentaro Shirakata: +¡û:LDP man-pages:3.24:1998/11/01:sync:8:2000/06/13::sato@complex.eng.hokudai.ac.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:2007/05/18:tzselect:8:2002/01/14::ysato@h4.dion.ne.jp:Yuichi SATO: +¡û:LDP man-pages:3.24:0000/00/00:zdump:8:1999/09/14::nakano@apm.seikei.ac.jp:NAKANO Takeo: +¡û:LDP man-pages:3.24:2010/02/25:zic:8:2001/04/04::sato@complex.eng.hokudai.ac.jp:Yuichi SATO: -- 2.11.0